From ed8fa3abd005f28f2a699469e56cb5bedfbecd68 Mon Sep 17 00:00:00 2001 From: Sungguk Na Date: Thu, 27 Jun 2019 10:50:52 +0900 Subject: [PATCH] Imported Upstream version 5.1 Change-Id: Id26107698f42299518ed12a24068c87977839e2f --- .strace.1.in.date | 1 + .tarball-version | 2 +- .version | 2 +- .year | 1 + COPYING | 34 +- CREDITS | 95 +- ChangeLog | 22975 ++++++++++++++++ INSTALL | 434 +- LGPL-2.1-or-later | 501 + Makefile.am | 417 +- Makefile.in | 4809 +++- NEWS | 513 +- README | 28 +- README-configure | 301 + access.c | 7 + aclocal.m4 | 217 +- affinity.c | 24 +- aio.c | 169 +- alpha.c | 27 +- arch_defs.h | 15 + basic_filters.c | 385 + bind.c | 23 + bjm.c | 23 +- block.c | 129 +- bpf.c | 1082 +- bpf_attr.h | 343 + bpf_attr_check.c | 1039 + bpf_filter.c | 181 + bpf_filter.h | 30 + bpf_fprog.h | 16 + bpf_seccomp_filter.c | 51 + bpf_sock_filter.c | 54 + btrfs.c | 856 +- cacheflush.c | 55 +- capability.c | 23 +- caps0.h | 7 + caps1.h | 7 + chdir.c | 7 + chmod.c | 7 + clone.c | 39 +- compile | 13 +- config.guess | 745 +- config.h.in | 753 +- config.sub | 2518 +- configure | 8259 ++++-- configure.ac | 618 +- copy_file_range.c | 24 +- count.c | 153 +- debian/changelog | 89 +- debian/changelog.in | 83 +- debian/compat | 2 +- debian/control | 18 +- debian/copyright | 38 +- debian/rules | 62 +- debian/strace-udeb.install | 2 +- debian/strace.install | 1 + debian/strace.manpages | 3 +- debian/strace64.manpages | 2 +- defs.h | 1565 +- delay.c | 134 + delay.h | 18 + depcomp | 10 +- desc.c | 86 +- dirent.c | 38 +- dirent64.c | 38 +- dm.c | 267 +- dyxlat.c | 81 + epoll.c | 25 +- errnoent.sh | 38 - error_prints.c | 108 + error_prints.h | 59 + evdev.c | 252 +- evdev_mpers.c | 131 + eventfd.c | 24 +- execve.c | 49 +- f_owner_ex.h | 21 + fadvise.c | 23 +- fallocate.c | 7 + fanotify.c | 31 +- fchownat.c | 7 + fcntl.c | 46 +- fetch_bpf_fprog.c | 44 + fetch_indirect_syscall_args.c | 35 + fetch_seccomp_fprog.c | 52 - fetch_struct_flock.c | 23 +- fetch_struct_keyctl_kdf_params.c | 41 + fetch_struct_mmsghdr.c | 24 +- fetch_struct_msghdr.c | 24 +- fetch_struct_stat.c | 26 +- fetch_struct_stat64.c | 26 +- fetch_struct_statfs.c | 25 +- fetch_struct_xfs_quotastat.c | 42 + file_handle.c | 23 +- file_ioctl.c | 39 +- filter.h | 19 + filter_qualify.c | 469 + flock.c | 23 +- flock.h | 47 +- fs_x_ioctl.c | 25 +- fstatfs.c | 7 + fstatfs64.c | 7 + futex.c | 79 +- gcc_compat.h | 191 +- gen_bpf_attr_check.sh | 60 + generate_sen.sh | 7 + get_personality.c | 14 + get_personality.h | 16 + get_robust_list.c | 24 +- getcpu.c | 7 + getcwd.c | 7 + getpagesize.c | 13 + getrandom.c | 7 + hdio.c | 25 +- hostname.c | 7 + inotify.c | 24 +- inotify_ioctl.c | 28 + install-sh | 397 +- io.c | 62 +- io_uring.c | 135 + ioctl.c | 134 +- ioctl_iocdef.c | 23 +- ioctlsort.c | 27 +- ioperm.c | 7 + iopl.c | 7 + ioprio.c | 64 +- ipc.c | 31 +- ipc_defs.h | 54 +- ipc_msg.c | 32 +- ipc_msgctl.c | 23 +- ipc_sem.c | 52 +- ipc_shm.c | 56 +- ipc_shmctl.c | 23 +- kcmp.c | 73 +- kernel_timespec.h | 25 + kernel_timeval.h | 16 + kernel_timex.h | 105 + kernel_types.h | 59 +- kexec.c | 27 +- keyctl.c | 110 +- keyctl_kdf_params.h | 34 + kill_save_errno.h | 24 + kvm.c | 419 + largefile_wrappers.h | 44 + ldt.c | 169 +- link.c | 24 +- linux/32/ioctls_inc.h | 7 + linux/32/ioctls_inc_align16.h | 443 +- linux/32/ioctls_inc_align32.h | 443 +- linux/32/ioctls_inc_align64.h | 441 +- linux/32/syscallent.h | 109 +- linux/64/ioctls_inc.h | 441 +- linux/64/syscallent.h | 92 +- linux/aarch64/arch_defs_.h | 11 + linux/aarch64/arch_get_personality.c | 16 + linux/aarch64/arch_regs.c | 59 +- linux/aarch64/arch_regs.h | 2 - linux/aarch64/errnoent1.h | 2 - linux/aarch64/get_error.c | 15 +- linux/aarch64/get_scno.c | 10 +- linux/aarch64/get_syscall_args.c | 13 +- linux/aarch64/ioctls_arch0.h | 72 + linux/aarch64/nr_prefix.c | 1 + linux/aarch64/raw_syscall.h | 29 + linux/aarch64/set_error.c | 7 + linux/aarch64/set_scno.c | 7 + linux/aarch64/shuffle_scno.c | 19 + linux/aarch64/signalent1.h | 1 - linux/aarch64/syscallent.h | 35 +- linux/alpha/arch_defs_.h | 10 + linux/alpha/arch_getrval2.c | 9 +- linux/alpha/arch_regs.c | 15 + linux/alpha/arch_regs.h | 5 - linux/alpha/arch_sigreturn.c | 11 +- linux/alpha/errnoent.h | 8 + linux/alpha/get_error.c | 9 +- linux/alpha/get_scno.c | 11 +- linux/alpha/get_syscall_args.c | 13 +- linux/alpha/get_syscall_result.c | 11 +- linux/alpha/raw_syscall.h | 31 + linux/alpha/set_error.c | 15 +- linux/alpha/set_scno.c | 9 +- linux/alpha/signalent.h | 9 +- linux/alpha/syscallent.h | 351 +- linux/alpha/userent.h | 7 + linux/arc/arch_regs.c | 8 + linux/arc/get_error.c | 11 +- linux/arc/get_scno.c | 7 + linux/arc/get_syscall_args.c | 9 +- linux/arc/raw_syscall.h | 41 + linux/arc/set_error.c | 7 + linux/arc/set_scno.c | 7 + linux/arc/syscallent.h | 9 +- linux/arch_defs_.h | 68 + linux/arch_kvm.c | 26 + linux/arch_rt_sigframe.c | 14 + linux/arch_sigreturn.c | 7 +- linux/arm/arch_defs_.h | 11 + linux/arm/arch_regs.c | 9 +- linux/arm/arch_regs.h | 1 - linux/arm/arch_sigreturn.c | 22 +- linux/arm/get_error.c | 11 +- linux/arm/get_scno.c | 34 +- linux/arm/get_syscall_args.c | 9 +- linux/arm/ioctls_arch0.h | 23 +- linux/arm/nr_prefix.c | 19 + linux/arm/raw_syscall.h | 44 + linux/arm/set_error.c | 7 + linux/arm/set_scno.c | 7 + linux/arm/shuffle_scno.c | 35 + linux/arm/syscallent.h | 191 +- linux/arm/userent.h | 7 + linux/asm_stat.h | 9 +- linux/avr32/arch_regs.c | 8 + linux/avr32/get_error.c | 11 +- linux/avr32/get_scno.c | 7 + linux/avr32/get_syscall_args.c | 9 +- linux/avr32/raw_syscall.h | 29 + linux/avr32/set_error.c | 7 + linux/avr32/set_scno.c | 7 + linux/avr32/syscallent.h | 117 +- linux/avr32/userent.h | 7 + linux/bfin/arch_defs_.h | 9 + linux/bfin/arch_regs.c | 8 + linux/bfin/get_error.c | 11 +- linux/bfin/get_scno.c | 9 +- linux/bfin/get_syscall_args.c | 18 +- linux/bfin/get_syscall_result.c | 9 +- linux/bfin/raw_syscall.h | 28 + linux/bfin/rt_sigframe.h | 22 + linux/bfin/set_error.c | 11 +- linux/bfin/set_scno.c | 9 +- linux/bfin/syscallent.h | 135 +- linux/bfin/userent.h | 7 + linux/check_scno.c | 13 + linux/crisv10/arch_regs.c | 2 - linux/crisv10/arch_sigreturn.c | 16 - linux/crisv10/get_error.c | 10 - linux/crisv10/get_scno.c | 6 - linux/crisv10/get_syscall_args.c | 15 - linux/crisv10/get_syscall_result.c | 5 - linux/crisv10/set_error.c | 13 - linux/crisv10/set_scno.c | 5 - linux/crisv10/syscallent.h | 358 - linux/crisv10/userent.h | 26 - linux/crisv32/arch_regs.c | 2 - linux/crisv32/arch_sigreturn.c | 1 - linux/crisv32/get_error.c | 1 - linux/crisv32/get_scno.c | 1 - linux/crisv32/get_syscall_args.c | 1 - linux/crisv32/get_syscall_result.c | 1 - linux/crisv32/set_error.c | 1 - linux/crisv32/set_scno.c | 1 - linux/crisv32/syscallent.h | 1 - linux/crisv32/userent.h | 43 - linux/csky/arch_regs.c | 12 + linux/csky/get_error.c | 18 + linux/csky/get_scno.c | 18 + linux/csky/get_syscall_args.c | 19 + linux/csky/ioctls_arch0.h | 1 + linux/csky/ioctls_inc0.h | 1 + linux/csky/raw_syscall.h | 32 + linux/csky/set_error.c | 20 + linux/csky/set_scno.c | 17 + linux/csky/syscallent.h | 4 + linux/dummy.h | 255 +- linux/errnoent.h | 8 + linux/getregs_old.h | 7 + linux/hppa/arch_defs_.h | 16 + linux/hppa/arch_regs.c | 14 +- linux/hppa/arch_regs.h | 5 - linux/hppa/arch_rt_sigframe.c | 21 + linux/hppa/errnoent.h | 8 + linux/hppa/get_error.c | 11 +- linux/hppa/get_scno.c | 9 +- linux/hppa/get_syscall_args.c | 16 +- linux/hppa/get_syscall_result.c | 9 +- linux/hppa/raw_syscall.h | 32 + linux/hppa/rt_sigframe.h | 19 + linux/hppa/set_error.c | 11 +- linux/hppa/set_scno.c | 9 +- linux/hppa/signalent.h | 9 +- linux/hppa/syscallent.h | 134 +- linux/hppa/userent.h | 69 + linux/i386/arch_defs_.h | 11 + linux/i386/arch_kvm.c | 1 + linux/i386/arch_regs.c | 12 +- linux/i386/arch_regs.h | 1 - linux/i386/arch_rt_sigframe.c | 12 + linux/i386/arch_sigreturn.c | 13 +- linux/i386/get_error.c | 11 +- linux/i386/get_scno.c | 7 + linux/i386/get_syscall_args.c | 9 +- linux/i386/ioctls_arch0.h | 27 +- linux/i386/raw_syscall.h | 28 + linux/i386/rt_sigframe.h | 23 + linux/i386/set_error.c | 19 +- linux/i386/set_scno.c | 14 +- linux/i386/syscallent.h | 176 +- linux/i386/userent.h | 7 + linux/i386/userent0.h | 7 + linux/ia64/arch_defs_.h | 11 + linux/ia64/arch_getrval2.c | 9 + linux/ia64/arch_regs.c | 12 +- linux/ia64/arch_regs.h | 1 - linux/ia64/arch_rt_sigframe.c | 12 + linux/ia64/arch_sigreturn.c | 12 - linux/ia64/get_error.c | 29 +- linux/ia64/get_scno.c | 9 +- linux/ia64/get_syscall_args.c | 44 +- linux/ia64/raw_syscall.h | 41 + linux/ia64/rt_sigframe.h | 25 + linux/ia64/set_error.c | 21 +- linux/ia64/set_scno.c | 12 +- linux/ia64/syscallent.h | 705 +- linux/ia64/userent.h | 7 + linux/inet_diag.h | 120 +- linux/m68k/arch_defs_.h | 11 + linux/m68k/arch_regs.c | 11 +- linux/m68k/arch_regs.h | 1 - linux/m68k/arch_rt_sigframe.c | 1 + linux/m68k/arch_sigreturn.c | 16 +- linux/m68k/get_error.c | 11 +- linux/m68k/get_scno.c | 7 + linux/m68k/get_syscall_args.c | 9 +- linux/m68k/raw_syscall.h | 28 + linux/m68k/rt_sigframe.h | 23 + linux/m68k/set_error.c | 7 + linux/m68k/set_scno.c | 7 + linux/m68k/syscallent.h | 182 +- linux/m68k/userent.h | 7 + linux/metag/arch_regs.c | 8 + linux/metag/arch_rt_sigframe.c | 15 + linux/metag/get_error.c | 11 +- linux/metag/get_scno.c | 7 + linux/metag/get_syscall_args.c | 9 +- linux/metag/raw_syscall.h | 29 + linux/metag/set_error.c | 7 + linux/metag/set_scno.c | 7 + linux/metag/syscallent.h | 9 +- linux/microblaze/arch_defs_.h | 9 + linux/microblaze/arch_regs.c | 8 + linux/microblaze/arch_sigreturn.c | 11 +- linux/microblaze/get_error.c | 11 +- linux/microblaze/get_scno.c | 9 +- linux/microblaze/get_syscall_args.c | 13 +- linux/microblaze/get_syscall_result.c | 9 +- linux/microblaze/raw_syscall.h | 30 + linux/microblaze/set_error.c | 11 +- linux/microblaze/set_scno.c | 9 +- linux/microblaze/syscallent.h | 163 +- linux/microblaze/userent.h | 7 + linux/mips/arch_defs_.h | 10 + linux/mips/arch_getrval2.c | 9 + linux/mips/arch_regs.c | 26 +- linux/mips/arch_regs.h | 18 - linux/mips/arch_sigreturn.c | 30 +- linux/mips/errnoent.h | 8 + linux/mips/genstub.sh | 5 + linux/mips/get_error.c | 9 +- linux/mips/get_scno.c | 7 + linux/mips/get_syscall_args.c | 69 +- linux/mips/ioctls_arch0.h | 72 + linux/mips/ioctls_inc0.h | 7 + linux/mips/raw_syscall.h | 35 + linux/mips/rt_sigframe.h | 19 + linux/mips/set_error.c | 7 + linux/mips/set_scno.c | 7 + linux/mips/signalent.h | 9 +- linux/mips/syscallent-compat.h | 71 +- linux/mips/syscallent-n32.h | 127 +- linux/mips/syscallent-n64.h | 103 +- linux/mips/syscallent-o32.h | 156 +- linux/mips/userent.h | 7 + linux/mtd-abi.h | 278 - linux/netlink_diag.h | 39 +- linux/nios2/arch_defs_.h | 8 + linux/nios2/arch_regs.c | 10 +- linux/nios2/get_error.c | 9 +- linux/nios2/get_scno.c | 7 + linux/nios2/get_syscall_args.c | 9 +- linux/nios2/raw_syscall.h | 29 + linux/nios2/set_error.c | 7 + linux/nios2/set_scno.c | 7 + linux/nios2/syscallent.h | 7 + linux/nr_prefix.c | 18 + linux/or1k/arch_regs.c | 8 + linux/or1k/get_error.c | 11 +- linux/or1k/get_scno.c | 7 + linux/or1k/get_syscall_args.c | 9 +- linux/or1k/raw_syscall.h | 30 + linux/or1k/set_error.c | 7 + linux/or1k/set_scno.c | 7 + linux/or1k/syscallent.h | 7 + linux/or1k/userent.h | 7 + linux/packet_diag.h | 80 + linux/personality.h | 69 - linux/powerpc/arch_defs_.h | 10 + linux/powerpc/arch_regs.c | 13 +- linux/powerpc/arch_regs.h | 1 - linux/powerpc/arch_rt_sigframe.c | 14 + linux/powerpc/arch_sigreturn.c | 44 +- linux/powerpc/errnoent.h | 7 + linux/powerpc/get_error.c | 9 +- linux/powerpc/get_scno.c | 7 + linux/powerpc/get_syscall_args.c | 36 +- linux/powerpc/getregs_old.c | 19 +- linux/powerpc/ioctls_arch0.h | 36 +- linux/powerpc/raw_syscall.h | 32 + linux/powerpc/set_error.c | 23 +- linux/powerpc/set_scno.c | 14 +- linux/powerpc/syscallent.h | 185 +- linux/powerpc/userent.h | 7 + linux/powerpc64/arch_defs_.h | 10 + linux/powerpc64/arch_get_personality.c | 16 + linux/powerpc64/arch_regs.c | 2 - linux/powerpc64/arch_regs.h | 1 - linux/powerpc64/arch_rt_sigframe.c | 23 + linux/powerpc64/errnoent1.h | 1 - linux/powerpc64/get_scno.c | 7 + linux/powerpc64/raw_syscall.h | 1 + linux/powerpc64/rt_sigframe.h | 22 + linux/powerpc64/signalent1.h | 1 - linux/powerpc64/syscallent.h | 161 +- linux/ptp_clock.h | 98 - linux/ptrace_pokeuser.c | 12 + linux/raw_syscall.h | 1 + linux/riscv/arch_defs_.h | 10 + linux/riscv/arch_get_personality.c | 16 + linux/riscv/arch_regs.c | 8 + linux/riscv/errnoent1.h | 2 - linux/riscv/get_error.c | 11 +- linux/riscv/get_scno.c | 7 + linux/riscv/get_syscall_args.c | 9 +- linux/riscv/raw_syscall.h | 29 + linux/riscv/set_error.c | 7 + linux/riscv/set_scno.c | 7 + linux/riscv/signalent1.h | 2 - linux/riscv/syscallent.h | 10 + linux/rt_sigframe.h | 21 + linux/s390/arch_defs_.h | 11 + linux/s390/arch_regs.c | 9 +- linux/s390/arch_regs.h | 1 - linux/s390/arch_sigreturn.c | 26 +- linux/s390/get_error.c | 21 +- linux/s390/get_scno.c | 15 +- linux/s390/get_syscall_args.c | 25 +- linux/s390/ioctls_arch0.h | 37 +- linux/s390/raw_syscall.h | 29 + linux/s390/rt_sigframe.h | 27 + linux/s390/set_error.c | 15 +- linux/s390/set_scno.c | 13 +- linux/s390/syscallent.h | 179 +- linux/s390/userent.h | 7 + linux/s390/userent0.h | 7 + linux/s390/userent1.h | 7 + linux/s390x/arch_defs_.h | 11 + linux/s390x/arch_get_personality.c | 16 + linux/s390x/arch_regs.c | 46 +- linux/s390x/arch_regs.h | 1 - linux/s390x/arch_sigreturn.c | 28 + linux/s390x/get_error.c | 30 +- linux/s390x/get_scno.c | 28 +- linux/s390x/get_syscall_args.c | 29 +- linux/s390x/ioctls_arch0.h | 37 +- linux/s390x/ioctls_arch1.h | 1 + linux/s390x/ioctls_inc1.h | 1 + linux/s390x/raw_syscall.h | 1 + linux/s390x/rt_sigframe.h | 1 + linux/s390x/set_error.c | 41 +- linux/s390x/set_scno.c | 28 +- linux/s390x/syscallent.h | 147 +- linux/s390x/syscallent1.h | 1 + linux/s390x/userent.h | 7 + linux/sh/arch_defs_.h | 10 + linux/sh/arch_getrval2.c | 9 +- linux/sh/arch_regs.c | 8 + linux/sh/get_error.c | 11 +- linux/sh/get_scno.c | 9 +- linux/sh/get_syscall_args.c | 13 +- linux/sh/get_syscall_result.c | 9 +- linux/sh/raw_syscall.h | 34 + linux/sh/set_error.c | 11 +- linux/sh/set_scno.c | 9 +- linux/sh/syscallent.h | 179 +- linux/sh/userent.h | 7 + linux/sh/userent0.h | 7 + linux/sh64/arch_defs_.h | 8 + linux/sh64/arch_regs.c | 8 + linux/sh64/arch_regs.h | 27 +- linux/sh64/get_error.c | 11 +- linux/sh64/get_scno.c | 9 +- linux/sh64/get_syscall_args.c | 13 +- linux/sh64/get_syscall_result.c | 9 +- linux/sh64/raw_syscall.h | 1 + linux/sh64/rt_sigframe.h | 21 + linux/sh64/set_error.c | 11 +- linux/sh64/set_scno.c | 9 +- linux/sh64/syscallent.h | 144 +- linux/sh64/userent.h | 7 + linux/shuffle_scno.c | 12 + linux/signal.h.in | 5 + linux/signalent.h | 9 +- linux/smc_diag.h | 99 + linux/sock_diag.h | 14 +- linux/sparc/arch_defs_.h | 12 + linux/sparc/arch_getrval2.c | 9 + linux/sparc/arch_regs.c | 18 +- linux/sparc/arch_regs.h | 7 - linux/sparc/arch_sigreturn.c | 17 +- linux/sparc/errnoent.h | 8 + linux/sparc/gen.pl | 37 - linux/sparc/get_error.c | 11 +- linux/sparc/get_scno.c | 7 + linux/sparc/get_syscall_args.c | 9 +- linux/sparc/raw_syscall.h | 38 + linux/sparc/rt_sigframe.h | 25 + linux/sparc/set_error.c | 7 + linux/sparc/set_scno.c | 7 + linux/sparc/signalent.h | 9 +- linux/sparc/syscallent.h | 164 +- linux/sparc64/arch_defs_.h | 12 + linux/sparc64/arch_get_personality.c | 16 + linux/sparc64/arch_regs.c | 7 + linux/sparc64/arch_regs.h | 1 - linux/sparc64/arch_rt_sigframe.c | 17 + linux/sparc64/arch_sigreturn.c | 7 + linux/sparc64/errnoent1.h | 1 - linux/sparc64/get_error.c | 9 +- linux/sparc64/get_scno.c | 31 +- linux/sparc64/get_syscall_args.c | 9 +- linux/sparc64/raw_syscall.h | 40 + linux/sparc64/rt_sigframe.h | 31 + linux/sparc64/set_error.c | 7 + linux/sparc64/signalent1.h | 1 - linux/sparc64/syscallent.h | 138 +- linux/sparc64/userent.h | 7 + linux/subcall.h | 23 +- linux/subcall32.h | 5 + linux/subcall64.h | 5 + linux/syscall.h | 35 +- linux/tile/arch_defs_.h | 13 + linux/tile/arch_get_personality.c | 20 + linux/tile/arch_regs.c | 10 +- linux/tile/arch_regs.h | 1 - linux/tile/arch_sigreturn.c | 16 +- linux/tile/errnoent1.h | 2 - linux/tile/get_error.c | 11 +- linux/tile/get_scno.c | 7 + linux/tile/get_syscall_args.c | 9 +- linux/tile/raw_syscall.h | 33 + linux/tile/rt_sigframe.h | 19 + linux/tile/set_error.c | 7 + linux/tile/set_scno.c | 7 + linux/tile/signalent1.h | 2 - linux/tile/syscallent.h | 7 + linux/tile/syscallent1.h | 7 + linux/tile/userent.h | 7 + linux/ubi-user.h | 420 - linux/unix_diag.h | 38 +- linux/userent0.h | 7 + linux/x32/arch_defs_.h | 13 + linux/x32/arch_get_personality.c | 1 + linux/x32/arch_kvm.c | 1 + linux/x32/arch_rt_sigframe.c | 1 + linux/x32/check_scno.c | 22 + linux/x32/errnoent1.h | 2 - linux/x32/ioctls_inc0.h | 443 +- linux/x32/ptrace_pokeuser.c | 17 + linux/x32/raw_syscall.h | 1 + linux/x32/rt_sigframe.h | 1 + linux/x32/shuffle_scno.c | 15 + linux/x32/signalent1.h | 2 - linux/x32/syscallent.h | 200 +- linux/x86_64/arch_defs_.h | 11 + linux/x86_64/arch_get_personality.c | 47 + linux/x86_64/arch_kvm.c | 117 + linux/x86_64/arch_regs.c | 17 +- linux/x86_64/arch_regs.h | 37 +- linux/x86_64/arch_rt_sigframe.c | 1 + linux/x86_64/arch_sigreturn.c | 32 +- linux/x86_64/asm_stat.h | 9 +- linux/x86_64/errnoent1.h | 2 - linux/x86_64/errnoent2.h | 2 - linux/x86_64/gentab.pl | 73 - linux/x86_64/get_error.c | 16 +- linux/x86_64/get_scno.c | 87 +- linux/x86_64/get_syscall_args.c | 11 +- linux/x86_64/getregs_old.c | 27 +- linux/x86_64/getregs_old.h | 9 +- linux/x86_64/ioctls_arch0.h | 27 +- linux/x86_64/raw_syscall.h | 28 + linux/x86_64/rt_sigframe.h | 23 + linux/x86_64/set_error.c | 45 +- linux/x86_64/set_scno.c | 21 +- linux/x86_64/shuffle_scno.c | 15 + linux/x86_64/signalent1.h | 2 - linux/x86_64/signalent2.h | 2 - linux/x86_64/syscallent.h | 101 +- linux/x86_64/userent.h | 7 + linux/xtensa/arch_regs.c | 8 + linux/xtensa/get_error.c | 11 +- linux/xtensa/get_scno.c | 9 +- linux/xtensa/get_syscall_args.c | 13 +- linux/xtensa/get_syscall_result.c | 9 +- linux/xtensa/raw_syscall.h | 28 + linux/xtensa/set_error.c | 11 +- linux/xtensa/set_scno.c | 9 +- linux/xtensa/syscallent.h | 131 +- linux/xtensa/userent.h | 7 + list.h | 300 + listen.c | 21 + lookup_dcookie.c | 23 +- loop.c | 75 +- lseek.c | 29 +- m4/ax_code_coverage.m4 | 112 +- m4/ax_prog_cc_for_build.m4 | 1 + m4/ax_valgrind_check.m4 | 14 +- m4/bpf_attr.m4 | 131 + m4/mpers.m4 | 90 +- m4/st_demangle.m4 | 65 + m4/st_libdw.m4 | 93 + m4/st_libunwind.m4 | 99 + m4/st_save_restore_var.m4 | 7 + m4/st_stacktrace.m4 | 58 + m4/st_warn_cflags.m4 | 10 + macros.h | 76 + maint/ioctls_gen.sh | 126 - maint/ioctls_hex.sh | 49 - maint/ioctls_sym.sh | 435 - maint/print_ioctlent.c | 79 - mem.c | 163 +- membarrier.c | 23 +- memfd_create.c | 65 +- missing | 16 +- mknod.c | 23 +- mmap_cache.c | 227 + mmap_cache.h | 70 + mmap_notify.c | 34 + mmap_notify.h | 20 + mmsghdr.c | 62 +- mount.c | 25 +- mpers.am | 2 +- mpers.awk | 186 +- mpers.sh | 37 +- mpers_test.sh | 52 +- mpers_type.h | 61 +- mpers_xlat.h | 31 +- mq.c | 73 +- msghdr.c | 129 +- msghdr.h | 9 +- mtd.c | 56 +- native_defs.h | 7 + nbd_ioctl.c | 53 + negated_errno.h | 31 + net.c | 686 +- netlink.c | 630 +- netlink.h | 55 + netlink_crypto.c | 224 + netlink_inet_diag.c | 410 + netlink_kobject_uevent.c | 45 + netlink_kobject_uevent.h | 24 + netlink_netfilter.c | 81 + netlink_netlink_diag.c | 171 + netlink_packet_diag.c | 197 + netlink_route.c | 127 + netlink_route.h | 37 + netlink_selinux.c | 49 + netlink_smc_diag.c | 243 + netlink_sock_diag.c | 74 + netlink_sock_diag.h | 44 + netlink_unix_diag.c | 157 + nlattr.c | 474 + nlattr.h | 92 + nsfs.c | 40 + nsfs.h | 28 + nsig.h | 25 +- numa.c | 61 +- number_set.c | 123 + number_set.h | 46 + oldstat.c | 23 +- open.c | 57 +- or1k_atomic.c | 45 +- pathtrace.c | 314 +- perf.c | 277 +- perf_event_struct.h | 74 +- perf_ioctl.c | 133 + personality.c | 34 +- pkeys.c | 7 + poll.c | 85 +- prctl.c | 130 +- print_aio_sigset.c | 33 + print_dev_t.c | 38 +- print_fields.h | 267 + print_group_req.c | 38 + print_ifindex.c | 64 + print_instruction_pointer.c | 24 + print_kernel_version.c | 31 + print_mac.c | 48 + print_mq_attr.c | 25 +- print_msgbuf.c | 23 +- print_sg_req_info.c | 28 +- print_sigevent.c | 26 +- print_statfs.c | 24 +- print_struct_stat.c | 49 +- print_time.c | 36 +- print_timespec.c | 133 +- print_timespec.h | 171 + print_timespec32.c | 23 + print_timespec64.c | 19 + print_timeval.c | 133 +- print_timeval64.c | 15 + print_timex.c | 82 +- print_timex.h | 45 + print_utils.h | 39 + printmode.c | 54 +- printrusage.c | 23 +- printsiginfo.c | 57 +- printsiginfo.h | 9 +- process.c | 118 +- process_vm.c | 23 +- ptp.c | 73 +- ptrace.h | 312 +- ptrace_syscall_info.c | 345 + ptrace_syscall_info.h | 16 + qualify.c | 640 - quota.c | 177 +- random_ioctl.c | 61 + readahead.c | 7 + readlink.c | 23 +- reboot.c | 20 +- regs.h | 18 +- renameat.c | 7 + resource.c | 104 +- retval.c | 50 + retval.h | 15 + riscv.c | 33 + rt_sigframe.c | 17 + rt_sigreturn.c | 34 + rtc.c | 31 +- rtnl_addr.c | 119 + rtnl_addrlabel.c | 74 + rtnl_dcb.c | 53 + rtnl_link.c | 911 + rtnl_mdb.c | 216 + rtnl_neigh.c | 118 + rtnl_neightbl.c | 157 + rtnl_netconf.c | 51 + rtnl_nsid.c | 43 + rtnl_route.c | 312 + rtnl_rule.c | 152 + rtnl_tc.c | 313 + rtnl_tc_action.c | 44 + s390.c | 1244 + sched.c | 159 +- sched_attr.h | 26 + scno.am | 31 +- scno.head | 7 + scsi.c | 30 +- seccomp.c | 227 +- seccomp_fprog.h | 9 - sendfile.c | 23 +- sg_io_v3.c | 123 +- sg_io_v4.c | 130 +- shutdown.c | 24 + sigaltstack.c | 23 +- sigevent.h | 26 +- signal.c | 288 +- signalent.sh | 53 - signalfd.c | 23 +- sigreturn.c | 9 +- sock.c | 152 +- sockaddr.c | 608 +- socketcall.c | 32 +- socketutils.c | 439 +- sparc.c | 26 + sram_alloc.c | 11 +- stat.c | 23 +- stat.h | 26 +- stat64.c | 23 +- statfs.c | 7 + statfs.h | 26 +- statfs64.c | 7 + static_assert.h | 29 + statx.c | 95 + statx.h | 50 + strace-graph | 67 +- strace-log-merge | 67 +- strace-log-merge.1 | 126 + strace-log-merge.1.in | 126 + strace.1 | 622 +- strace.1.in | 1202 + strace.c | 1806 +- strace.spec | 137 +- strace.spec.in | 131 +- string_to_uint.c | 43 + string_to_uint.h | 49 + swapon.c | 7 + sync_file_range.c | 23 +- sync_file_range2.c | 23 +- syscall.c | 1135 +- syscallent.sh | 73 - sysctl.c | 25 +- sysent.h | 41 +- sysent_shorthand_defs.h | 56 + sysent_shorthand_undefs.h | 27 + sysinfo.c | 23 +- syslog.c | 37 +- sysmips.c | 46 +- term.c | 39 +- test-driver | 23 +- tests-m32/COPYING | 11 + tests-m32/GPL-2.0-or-later | 339 + tests-m32/Makefile.am | 977 +- tests-m32/Makefile.in | 8783 +++++- tests-m32/PTRACE_SEIZE.sh | 13 + tests-m32/_newselect-P.c | 2 + tests-m32/_newselect-P.gen.test | 4 + tests-m32/_newselect.c | 24 +- tests-m32/_newselect.gen.test | 4 + tests-m32/_newselect.test | 5 - tests-m32/accept.c | 54 +- tests-m32/accept.gen.test | 4 + tests-m32/accept.test | 6 - tests-m32/accept4.c | 24 +- tests-m32/accept4.gen.test | 4 + tests-m32/accept4.test | 6 - tests-m32/accept_compat.h | 32 + tests-m32/access.c | 8 + tests-m32/access.gen.test | 4 + tests-m32/access.test | 15 - tests-m32/acct.c | 7 + tests-m32/acct.gen.test | 4 + tests-m32/acct.test | 6 - tests-m32/add_key.c | 34 +- tests-m32/add_key.gen.test | 4 + tests-m32/add_key.test | 6 - tests-m32/adjtimex.c | 69 +- tests-m32/adjtimex.gen.test | 4 + tests-m32/adjtimex.test | 12 - tests-m32/aio.c | 111 +- tests-m32/aio.gen.test | 4 + tests-m32/aio.test | 8 - tests-m32/aio_pgetevents.c | 170 + tests-m32/aio_pgetevents.gen.test | 4 + tests-m32/alarm.c | 24 +- tests-m32/alarm.gen.test | 4 + tests-m32/alarm.test | 6 - tests-m32/answer.c | 24 +- tests-m32/attach-f-p-cmd.c | 25 +- tests-m32/attach-f-p.c | 24 +- tests-m32/attach-f-p.test | 38 +- tests-m32/attach-p-cmd-cmd.c | 54 +- tests-m32/attach-p-cmd-p.c | 87 +- tests-m32/attach-p-cmd.h | 9 + tests-m32/attach-p-cmd.test | 36 +- tests-m32/bexecve.test | 29 +- tests-m32/block_reset_raise_run.c | 35 + tests-m32/bpf-obj_get_info_by_fd-prog-v.c | 3 + .../bpf-obj_get_info_by_fd-prog-v.gen.test | 4 + tests-m32/bpf-obj_get_info_by_fd-prog.c | 2 + .../bpf-obj_get_info_by_fd-prog.gen.test | 4 + tests-m32/bpf-obj_get_info_by_fd-v.c | 2 + tests-m32/bpf-obj_get_info_by_fd-v.gen.test | 4 + tests-m32/bpf-obj_get_info_by_fd.c | 608 + tests-m32/bpf-obj_get_info_by_fd.gen.test | 4 + tests-m32/bpf-success-v.c | 2 + tests-m32/bpf-success-v.test | 11 + tests-m32/bpf-success.c | 2 + tests-m32/bpf-success.test | 11 + tests-m32/bpf-v.c | 3 + tests-m32/bpf-v.gen.test | 4 + tests-m32/bpf.c | 1372 +- tests-m32/bpf.gen.test | 4 + tests-m32/bpf.test | 6 - tests-m32/brk.c | 7 + tests-m32/brk.test | 8 +- tests-m32/btrfs-X.test | 16 + tests-m32/btrfs-v.test | 17 +- tests-m32/btrfs-vX.test | 16 + tests-m32/btrfs-vw.test | 15 +- tests-m32/btrfs-vwX.test | 30 + tests-m32/btrfs-w.test | 15 +- tests-m32/btrfs-wX.test | 30 + tests-m32/btrfs.c | 1150 +- tests-m32/btrfs.gen.test | 4 + tests-m32/btrfs.test | 5 - tests-m32/caps-abbrev.awk | 24 +- tests-m32/caps-abbrev.test | 7 +- tests-m32/caps.awk | 24 +- tests-m32/caps.c | 24 +- tests-m32/caps.test | 7 +- tests-m32/check_sigblock.c | 29 + tests-m32/check_sigign.c | 29 + tests-m32/chmod.c | 32 +- tests-m32/chmod.gen.test | 4 + tests-m32/chmod.test | 6 - tests-m32/chown.c | 7 + tests-m32/chown.gen.test | 4 + tests-m32/chown.test | 6 - tests-m32/chown32.c | 7 + tests-m32/chown32.gen.test | 4 + tests-m32/chown32.test | 6 - tests-m32/chroot.c | 7 + tests-m32/chroot.gen.test | 4 + tests-m32/chroot.test | 6 - tests-m32/clock.gen.test | 4 + tests-m32/clock.in | 3 + tests-m32/clock_adjtime.c | 24 +- tests-m32/clock_adjtime.gen.test | 4 + tests-m32/clock_adjtime.test | 6 - tests-m32/clock_nanosleep.c | 93 +- tests-m32/clock_nanosleep.gen.test | 4 + tests-m32/clock_nanosleep.test | 6 - tests-m32/clock_xettime.c | 67 +- tests-m32/clock_xettime.gen.test | 4 + tests-m32/clock_xettime.test | 6 - tests-m32/clone_parent.c | 60 + tests-m32/clone_parent.test | 10 + tests-m32/clone_ptrace.c | 90 + tests-m32/clone_ptrace.test | 24 + tests-m32/copy_file_range.c | 27 +- tests-m32/copy_file_range.gen.test | 4 + tests-m32/copy_file_range.test | 6 - tests-m32/count-f.c | 24 +- tests-m32/count-f.test | 9 +- tests-m32/count.test | 31 +- tests-m32/creat.c | 7 + tests-m32/creat.gen.test | 4 + tests-m32/creat.test | 6 - tests-m32/create_nl_socket.c | 33 + tests-m32/delay.c | 115 + tests-m32/delay.test | 16 + tests-m32/delete_module.c | 28 +- tests-m32/delete_module.gen.test | 4 + tests-m32/delete_module.test | 6 - tests-m32/detach-running.test | 47 +- tests-m32/detach-sleeping.test | 42 +- tests-m32/detach-stopped.test | 48 +- tests-m32/dev-yy.c | 81 + tests-m32/dev-yy.gen.test | 4 + tests-m32/dup.c | 7 + tests-m32/dup.gen.test | 4 + tests-m32/dup.test | 6 - tests-m32/dup2.c | 7 + tests-m32/dup2.gen.test | 4 + tests-m32/dup2.test | 6 - tests-m32/dup3.c | 9 +- tests-m32/dup3.gen.test | 4 + tests-m32/dup3.test | 6 - tests-m32/epoll_create.c | 7 + tests-m32/epoll_create.gen.test | 4 + tests-m32/epoll_create.test | 6 - tests-m32/epoll_create1.c | 24 +- tests-m32/epoll_create1.gen.test | 4 + tests-m32/epoll_create1.test | 6 - tests-m32/epoll_ctl.c | 13 +- tests-m32/epoll_ctl.gen.test | 4 + tests-m32/epoll_ctl.test | 6 - tests-m32/epoll_pwait.c | 9 +- tests-m32/epoll_pwait.gen.test | 4 + tests-m32/epoll_pwait.test | 6 - tests-m32/epoll_wait.c | 9 +- tests-m32/epoll_wait.gen.test | 4 + tests-m32/epoll_wait.test | 6 - tests-m32/erestartsys.c | 24 +- tests-m32/erestartsys.gen.test | 4 + tests-m32/erestartsys.test | 6 - tests-m32/errno2name.c | 26 +- tests-m32/error_msg.c | 26 +- tests-m32/eventfd.c | 24 +- tests-m32/eventfd.test | 7 +- tests-m32/execve-v.test | 9 +- tests-m32/execve.c | 76 +- tests-m32/execve.test | 9 +- tests-m32/execveat-v.gen.test | 4 + tests-m32/execveat-v.test | 6 - tests-m32/execveat.c | 128 +- tests-m32/execveat.gen.test | 4 + tests-m32/execveat.test | 6 - tests-m32/faccessat.c | 7 + tests-m32/faccessat.gen.test | 4 + tests-m32/faccessat.test | 5 - tests-m32/fadvise.h | 25 +- tests-m32/fadvise64.c | 23 +- tests-m32/fadvise64.test | 8 +- tests-m32/fadvise64_64.c | 23 +- tests-m32/fadvise64_64.gen.test | 4 + tests-m32/fadvise64_64.test | 5 - tests-m32/fallocate.c | 23 +- tests-m32/fallocate.gen.test | 4 + tests-m32/fallocate.test | 6 - tests-m32/fanotify_init.c | 35 +- tests-m32/fanotify_init.gen.test | 4 + tests-m32/fanotify_init.test | 6 - tests-m32/fanotify_mark-Xabbrev.c | 1 + tests-m32/fanotify_mark-Xabbrev.gen.test | 4 + tests-m32/fanotify_mark-Xraw.c | 2 + tests-m32/fanotify_mark-Xraw.gen.test | 4 + tests-m32/fanotify_mark-Xverbose.c | 2 + tests-m32/fanotify_mark-Xverbose.gen.test | 4 + tests-m32/fanotify_mark.c | 143 +- tests-m32/fanotify_mark.gen.test | 4 + tests-m32/fanotify_mark.test | 6 - tests-m32/fchdir.c | 7 + tests-m32/fchdir.gen.test | 4 + tests-m32/fchdir.test | 6 - tests-m32/fchmod.c | 23 +- tests-m32/fchmod.gen.test | 4 + tests-m32/fchmod.test | 6 - tests-m32/fchmodat.c | 24 +- tests-m32/fchmodat.gen.test | 4 + tests-m32/fchmodat.test | 6 - tests-m32/fchown.c | 7 + tests-m32/fchown.gen.test | 4 + tests-m32/fchown.test | 6 - tests-m32/fchown32.c | 7 + tests-m32/fchown32.gen.test | 4 + tests-m32/fchown32.test | 6 - tests-m32/fchownat.c | 24 +- tests-m32/fchownat.gen.test | 4 + tests-m32/fchownat.test | 6 - tests-m32/fcntl-common.c | 379 + tests-m32/fcntl.c | 66 +- tests-m32/fcntl.gen.test | 4 + tests-m32/fcntl.test | 6 - tests-m32/fcntl64.c | 77 +- tests-m32/fcntl64.gen.test | 4 + tests-m32/fcntl64.test | 5 - tests-m32/fdatasync.c | 7 + tests-m32/fdatasync.gen.test | 4 + tests-m32/fdatasync.test | 6 - tests-m32/fflush.c | 22 + tests-m32/fflush.test | 21 + tests-m32/file_handle.c | 32 +- tests-m32/file_handle.gen.test | 4 + tests-m32/file_handle.test | 6 - tests-m32/file_ioctl.c | 9 +- tests-m32/file_ioctl.gen.test | 4 + tests-m32/file_ioctl.test | 5 - tests-m32/fill_memory.c | 9 +- tests-m32/filter-unavailable.c | 24 +- tests-m32/filter-unavailable.test | 9 +- tests-m32/filtering_fd-syntax.test | 40 + tests-m32/filtering_syscall-syntax.test | 101 + tests-m32/finit_module.c | 26 +- tests-m32/finit_module.gen.test | 4 + tests-m32/finit_module.test | 6 - tests-m32/first_exec_failure.test | 30 + tests-m32/flock.c | 7 + tests-m32/flock.gen.test | 4 + tests-m32/flock.test | 6 - tests-m32/fork-f.c | 24 +- tests-m32/fork-f.gen.test | 4 + tests-m32/fork-f.test | 6 - tests-m32/fstat-Xabbrev.c | 1 + tests-m32/fstat-Xabbrev.gen.test | 4 + tests-m32/fstat-Xraw.c | 2 + tests-m32/fstat-Xraw.gen.test | 4 + tests-m32/fstat-Xverbose.c | 2 + tests-m32/fstat-Xverbose.gen.test | 4 + tests-m32/fstat.c | 23 +- tests-m32/fstat.gen.test | 4 + tests-m32/fstat.test | 19 - tests-m32/fstat64-Xabbrev.c | 1 + tests-m32/fstat64-Xabbrev.gen.test | 4 + tests-m32/fstat64-Xraw.c | 2 + tests-m32/fstat64-Xraw.gen.test | 4 + tests-m32/fstat64-Xverbose.c | 2 + tests-m32/fstat64-Xverbose.gen.test | 4 + tests-m32/fstat64.c | 23 +- tests-m32/fstat64.gen.test | 4 + tests-m32/fstat64.test | 5 - tests-m32/fstatat.c | 23 +- tests-m32/fstatat64.c | 23 +- tests-m32/fstatat64.gen.test | 4 + tests-m32/fstatat64.test | 5 - tests-m32/fstatfs.c | 24 +- tests-m32/fstatfs.gen.test | 4 + tests-m32/fstatfs.test | 5 - tests-m32/fstatfs64.c | 24 +- tests-m32/fstatfs64.gen.test | 4 + tests-m32/fstatfs64.test | 5 - tests-m32/fstatx.c | 23 +- tests-m32/fsync-y.c | 51 + tests-m32/fsync-y.gen.test | 4 + tests-m32/fsync.c | 7 + tests-m32/fsync.gen.test | 4 + tests-m32/fsync.test | 6 - tests-m32/ftruncate.c | 24 +- tests-m32/ftruncate.gen.test | 4 + tests-m32/ftruncate.test | 6 - tests-m32/ftruncate64.c | 24 +- tests-m32/ftruncate64.gen.test | 4 + tests-m32/ftruncate64.test | 6 - tests-m32/futex.c | 327 +- tests-m32/futex.test | 7 +- tests-m32/futimesat.c | 167 +- tests-m32/futimesat.gen.test | 4 + tests-m32/futimesat.test | 6 - tests-m32/gen_pure_executables.sh | 30 + tests-m32/gen_tests.am | 1574 ++ tests-m32/gen_tests.in | 531 + tests-m32/gen_tests.sh | 92 + tests-m32/get_mempolicy.c | 24 +- tests-m32/get_mempolicy.gen.test | 4 + tests-m32/get_mempolicy.test | 6 - tests-m32/get_page_size.c | 7 + tests-m32/get_regs.test | 33 + tests-m32/get_sigset_size.c | 46 + tests-m32/getcpu.c | 35 +- tests-m32/getcpu.gen.test | 4 + tests-m32/getcpu.test | 6 - tests-m32/getcwd.c | 13 +- tests-m32/getcwd.gen.test | 4 + tests-m32/getcwd.test | 6 - tests-m32/getdents.c | 29 +- tests-m32/getdents.gen.test | 4 + tests-m32/getdents.test | 8 - tests-m32/getdents64.c | 29 +- tests-m32/getdents64.gen.test | 4 + tests-m32/getdents64.test | 8 - tests-m32/getegid.c | 7 + tests-m32/getegid.gen.test | 4 + tests-m32/getegid.test | 5 - tests-m32/getegid32.c | 7 + tests-m32/getegid32.gen.test | 4 + tests-m32/getegid32.test | 5 - tests-m32/geteuid.c | 7 + tests-m32/geteuid.gen.test | 4 + tests-m32/geteuid.test | 5 - tests-m32/geteuid32.c | 7 + tests-m32/geteuid32.gen.test | 4 + tests-m32/geteuid32.test | 5 - tests-m32/getgid.c | 7 + tests-m32/getgid.gen.test | 4 + tests-m32/getgid.test | 5 - tests-m32/getgid32.c | 7 + tests-m32/getgid32.gen.test | 4 + tests-m32/getgid32.test | 5 - tests-m32/getgroups.c | 29 +- tests-m32/getgroups.gen.test | 4 + tests-m32/getgroups.test | 6 - tests-m32/getgroups32.c | 7 + tests-m32/getgroups32.gen.test | 4 + tests-m32/getgroups32.test | 6 - tests-m32/getpeername.c | 24 +- tests-m32/getpeername.gen.test | 4 + tests-m32/getpeername.test | 5 - tests-m32/getpgrp.c | 7 + tests-m32/getpgrp.gen.test | 4 + tests-m32/getpgrp.test | 6 - tests-m32/getpid.c | 28 + tests-m32/getpid.gen.test | 4 + tests-m32/getppid.c | 28 + tests-m32/getppid.gen.test | 4 + tests-m32/getrandom.c | 24 +- tests-m32/getrandom.gen.test | 4 + tests-m32/getrandom.test | 6 - tests-m32/getresgid.c | 7 + tests-m32/getresgid.gen.test | 4 + tests-m32/getresgid.test | 6 - tests-m32/getresgid32.c | 7 + tests-m32/getresgid32.gen.test | 4 + tests-m32/getresgid32.test | 6 - tests-m32/getresugid.c | 29 +- tests-m32/getresuid.c | 7 + tests-m32/getresuid.gen.test | 4 + tests-m32/getresuid.test | 6 - tests-m32/getresuid32.c | 7 + tests-m32/getresuid32.gen.test | 4 + tests-m32/getresuid32.test | 6 - tests-m32/getrlimit.c | 7 + tests-m32/getrlimit.gen.test | 4 + tests-m32/getrlimit.test | 5 - tests-m32/getrusage.c | 64 +- tests-m32/getrusage.gen.test | 4 + tests-m32/getrusage.test | 6 - tests-m32/getsid.c | 7 + tests-m32/getsid.gen.test | 4 + tests-m32/getsid.test | 6 - tests-m32/getsockname.c | 24 +- tests-m32/getsockname.gen.test | 4 + tests-m32/getsockname.test | 6 - tests-m32/gettid.c | 19 + tests-m32/gettid.gen.test | 4 + tests-m32/getuid.c | 7 + tests-m32/getuid.test | 8 +- tests-m32/getuid32.c | 7 + tests-m32/getuid32.gen.test | 4 + tests-m32/getuid32.test | 5 - tests-m32/getxxid.c | 24 +- tests-m32/getxxid.gen.test | 4 + tests-m32/getxxid.test | 6 - tests-m32/group_req.c | 141 + tests-m32/group_req.gen.test | 4 + tests-m32/hexdump_strdup.c | 24 +- tests-m32/hexquote_strndup.c | 24 +- tests-m32/ifindex.c | 35 + tests-m32/inet-cmsg.c | 30 +- tests-m32/inet-cmsg.gen.test | 4 + tests-m32/inet-cmsg.test | 6 - tests-m32/init.sh | 176 +- tests-m32/init_delete_module.h | 28 +- tests-m32/init_module.c | 27 +- tests-m32/init_module.gen.test | 4 + tests-m32/init_module.test | 6 - tests-m32/inject-nf.c | 66 + tests-m32/inject-nf.test | 55 + tests-m32/inode_of_sockfd.c | 25 +- tests-m32/inotify.c | 27 +- tests-m32/inotify.gen.test | 4 + tests-m32/inotify.test | 6 - tests-m32/inotify_init1.c | 23 +- tests-m32/inotify_init1.gen.test | 4 + tests-m32/inotify_init1.test | 6 - tests-m32/int_0x80.c | 32 + tests-m32/int_0x80.test | 16 + tests-m32/interactive_block.test | 20 + tests-m32/io_uring_enter.c | 83 + tests-m32/io_uring_enter.gen.test | 4 + tests-m32/io_uring_register.c | 100 + tests-m32/io_uring_register.gen.test | 4 + tests-m32/io_uring_setup.c | 103 + tests-m32/io_uring_setup.gen.test | 4 + tests-m32/ioctl.c | 34 +- tests-m32/ioctl.test | 17 +- tests-m32/ioctl_block.c | 45 +- tests-m32/ioctl_block.gen.test | 4 + tests-m32/ioctl_block.test | 5 - tests-m32/ioctl_dm-v.gen.test | 4 + tests-m32/ioctl_dm-v.test | 12 - tests-m32/ioctl_dm.c | 121 +- tests-m32/ioctl_dm.gen.test | 4 + tests-m32/ioctl_dm.test | 12 - tests-m32/ioctl_evdev-success-v.c | 2 + tests-m32/ioctl_evdev-success-v.test | 18 + tests-m32/ioctl_evdev-success.c | 239 + tests-m32/ioctl_evdev-success.test | 18 + tests-m32/ioctl_evdev-v.gen.test | 4 + tests-m32/ioctl_evdev-v.test | 12 - tests-m32/ioctl_evdev.c | 79 +- tests-m32/ioctl_evdev.gen.test | 4 + tests-m32/ioctl_evdev.test | 5 - tests-m32/ioctl_inotify.c | 61 + tests-m32/ioctl_inotify.gen.test | 4 + tests-m32/ioctl_kvm_run-v.c | 2 + tests-m32/ioctl_kvm_run-v.gen.test | 4 + tests-m32/ioctl_kvm_run.c | 18 + tests-m32/ioctl_kvm_run.gen.test | 4 + tests-m32/ioctl_kvm_run_auxstr_vcpu.c | 31 + tests-m32/ioctl_kvm_run_auxstr_vcpu.gen.test | 4 + tests-m32/ioctl_kvm_run_common.c | 412 + tests-m32/ioctl_loop-nv.gen.test | 4 + tests-m32/ioctl_loop-nv.test | 12 - tests-m32/ioctl_loop-v.gen.test | 4 + tests-m32/ioctl_loop-v.test | 12 - tests-m32/ioctl_loop.c | 97 +- tests-m32/ioctl_loop.gen.test | 4 + tests-m32/ioctl_loop.test | 12 - tests-m32/ioctl_mtd.c | 93 +- tests-m32/ioctl_mtd.gen.test | 4 + tests-m32/ioctl_mtd.test | 5 - tests-m32/ioctl_nbd.c | 92 + tests-m32/ioctl_nbd.gen.test | 4 + tests-m32/ioctl_nsfs.c | 126 + tests-m32/ioctl_nsfs.gen.test | 4 + tests-m32/ioctl_perf-success.c | 145 + tests-m32/ioctl_perf-success.test | 20 + tests-m32/ioctl_perf.c | 218 + tests-m32/ioctl_perf.gen.test | 4 + tests-m32/ioctl_ptp.c | 111 + tests-m32/ioctl_ptp.gen.test | 4 + tests-m32/ioctl_random.c | 61 + tests-m32/ioctl_random.gen.test | 4 + tests-m32/ioctl_rtc-v.gen.test | 4 + tests-m32/ioctl_rtc-v.test | 12 - tests-m32/ioctl_rtc.c | 29 +- tests-m32/ioctl_rtc.gen.test | 4 + tests-m32/ioctl_rtc.test | 5 - tests-m32/ioctl_scsi.c | 32 +- tests-m32/ioctl_scsi.gen.test | 4 + tests-m32/ioctl_scsi.test | 4 - tests-m32/ioctl_sg_io_v3.c | 72 +- tests-m32/ioctl_sg_io_v3.gen.test | 4 + tests-m32/ioctl_sg_io_v3.test | 4 - tests-m32/ioctl_sg_io_v4.c | 56 +- tests-m32/ioctl_sg_io_v4.gen.test | 4 + tests-m32/ioctl_sg_io_v4.test | 4 - tests-m32/ioctl_sock_gifconf.c | 28 +- tests-m32/ioctl_sock_gifconf.gen.test | 4 + tests-m32/ioctl_sock_gifconf.test | 12 - tests-m32/ioctl_uffdio.c | 46 +- tests-m32/ioctl_uffdio.gen.test | 4 + tests-m32/ioctl_uffdio.test | 5 - tests-m32/ioctl_v4l2.c | 656 +- tests-m32/ioctl_v4l2.gen.test | 4 + tests-m32/ioctl_v4l2.test | 5 - tests-m32/ioperm.c | 7 + tests-m32/ioperm.gen.test | 4 + tests-m32/ioperm.test | 6 - tests-m32/iopl.c | 7 + tests-m32/iopl.gen.test | 4 + tests-m32/iopl.test | 6 - tests-m32/ioprio-Xabbrev.c | 1 + tests-m32/ioprio-Xabbrev.gen.test | 4 + tests-m32/ioprio-Xraw.c | 2 + tests-m32/ioprio-Xraw.gen.test | 4 + tests-m32/ioprio-Xverbose.c | 2 + tests-m32/ioprio-Xverbose.gen.test | 4 + tests-m32/ioprio.c | 97 +- tests-m32/ioprio.gen.test | 4 + tests-m32/ioprio.test | 6 - tests-m32/ip_mreq.c | 164 +- tests-m32/ip_mreq.gen.test | 4 + tests-m32/ip_mreq.test | 6 - tests-m32/ipc.c | 24 +- tests-m32/ipc.gen.test | 4 + tests-m32/ipc.sh | 13 +- tests-m32/ipc.test | 6 - tests-m32/ipc_msg-Xabbrev.c | 1 + tests-m32/ipc_msg-Xabbrev.gen.test | 4 + tests-m32/ipc_msg-Xraw.c | 2 + tests-m32/ipc_msg-Xraw.gen.test | 4 + tests-m32/ipc_msg-Xverbose.c | 2 + tests-m32/ipc_msg-Xverbose.gen.test | 4 + tests-m32/ipc_msg.c | 113 +- tests-m32/ipc_msg.gen.test | 4 + tests-m32/ipc_msg.test | 5 - tests-m32/ipc_msgbuf-Xabbrev.c | 1 + tests-m32/ipc_msgbuf-Xabbrev.gen.test | 4 + tests-m32/ipc_msgbuf-Xraw.c | 2 + tests-m32/ipc_msgbuf-Xraw.gen.test | 4 + tests-m32/ipc_msgbuf-Xverbose.c | 2 + tests-m32/ipc_msgbuf-Xverbose.gen.test | 4 + tests-m32/ipc_msgbuf.c | 92 +- tests-m32/ipc_msgbuf.expected | 4 - tests-m32/ipc_msgbuf.test | 11 +- tests-m32/ipc_sem-Xabbrev.c | 1 + tests-m32/ipc_sem-Xabbrev.gen.test | 4 + tests-m32/ipc_sem-Xraw.c | 2 + tests-m32/ipc_sem-Xraw.gen.test | 4 + tests-m32/ipc_sem-Xverbose.c | 2 + tests-m32/ipc_sem-Xverbose.gen.test | 4 + tests-m32/ipc_sem.c | 103 +- tests-m32/ipc_sem.gen.test | 4 + tests-m32/ipc_sem.test | 5 - tests-m32/ipc_shm-Xabbrev.c | 1 + tests-m32/ipc_shm-Xabbrev.gen.test | 4 + tests-m32/ipc_shm-Xraw.c | 2 + tests-m32/ipc_shm-Xraw.gen.test | 4 + tests-m32/ipc_shm-Xverbose.c | 2 + tests-m32/ipc_shm-Xverbose.gen.test | 4 + tests-m32/ipc_shm.c | 169 +- tests-m32/ipc_shm.gen.test | 4 + tests-m32/ipc_shm.test | 5 - tests-m32/is_linux_mips_n64.c | 25 + tests-m32/kcmp-y.c | 3 + tests-m32/kcmp-y.gen.test | 4 + tests-m32/kcmp.c | 172 +- tests-m32/kcmp.gen.test | 4 + tests-m32/kcmp.test | 6 - tests-m32/kern_features-fault.test | 43 + tests-m32/kern_features.c | 100 + tests-m32/kern_features.gen.test | 4 + tests-m32/kernel_version-Xabbrev.c | 1 + tests-m32/kernel_version-Xabbrev.gen.test | 4 + tests-m32/kernel_version-Xraw.c | 2 + tests-m32/kernel_version-Xraw.gen.test | 4 + tests-m32/kernel_version-Xverbose.c | 2 + tests-m32/kernel_version-Xverbose.gen.test | 4 + tests-m32/kernel_version.c | 104 + tests-m32/kernel_version.gen.test | 4 + tests-m32/kexec_file_load.c | 25 +- tests-m32/kexec_file_load.gen.test | 4 + tests-m32/kexec_file_load.test | 6 - tests-m32/kexec_load.c | 28 +- tests-m32/kexec_load.gen.test | 4 + tests-m32/kexec_load.test | 6 - tests-m32/keyctl-Xabbrev.c | 1 + tests-m32/keyctl-Xabbrev.gen.test | 4 + tests-m32/keyctl-Xraw.c | 2 + tests-m32/keyctl-Xraw.gen.test | 4 + tests-m32/keyctl-Xverbose.c | 2 + tests-m32/keyctl-Xverbose.gen.test | 4 + tests-m32/keyctl.c | 620 +- tests-m32/keyctl.gen.test | 4 + tests-m32/keyctl.test | 6 - tests-m32/kill.c | 25 +- tests-m32/kill.gen.test | 4 + tests-m32/kill.test | 6 - tests-m32/kill_child.c | 69 + tests-m32/kill_child.test | 31 + tests-m32/ksysent.c | 39 +- tests-m32/ksysent.sed | 9 +- tests-m32/ksysent.test | 5 + tests-m32/lchown.c | 7 + tests-m32/lchown.gen.test | 4 + tests-m32/lchown.test | 6 - tests-m32/lchown32.c | 7 + tests-m32/lchown32.gen.test | 4 + tests-m32/lchown32.test | 6 - tests-m32/libmmsg.c | 24 +- tests-m32/libsocketcall.c | 28 +- tests-m32/link.c | 7 + tests-m32/link.gen.test | 4 + tests-m32/link.test | 6 - tests-m32/linkat.c | 7 + tests-m32/linkat.gen.test | 4 + tests-m32/linkat.test | 6 - tests-m32/list_sigaction_signum.c | 37 + tests-m32/llseek.c | 24 +- tests-m32/llseek.test | 13 +- tests-m32/localtime.c | 37 + tests-m32/localtime.test | 18 + tests-m32/lookup_dcookie.c | 23 +- tests-m32/lookup_dcookie.gen.test | 4 + tests-m32/lookup_dcookie.test | 6 - tests-m32/looping_threads.c | 121 + tests-m32/looping_threads.test | 38 + tests-m32/lseek.c | 24 +- tests-m32/lseek.test | 11 +- tests-m32/lstat.c | 23 +- tests-m32/lstat.gen.test | 4 + tests-m32/lstat.test | 5 - tests-m32/lstat64.c | 23 +- tests-m32/lstat64.gen.test | 4 + tests-m32/lstat64.test | 5 - tests-m32/lstatx.c | 23 +- tests-m32/madvise.c | 59 + tests-m32/madvise.gen.test | 4 + tests-m32/match.awk | 24 +- tests-m32/mbind.c | 24 +- tests-m32/mbind.gen.test | 4 + tests-m32/mbind.test | 6 - tests-m32/membarrier.c | 72 +- tests-m32/membarrier.gen.test | 4 + tests-m32/membarrier.test | 6 - tests-m32/memfd_create-Xabbrev.c | 1 + tests-m32/memfd_create-Xabbrev.gen.test | 4 + tests-m32/memfd_create-Xraw.c | 2 + tests-m32/memfd_create-Xraw.gen.test | 4 + tests-m32/memfd_create-Xverbose.c | 2 + tests-m32/memfd_create-Xverbose.gen.test | 4 + tests-m32/memfd_create.c | 96 +- tests-m32/memfd_create.gen.test | 4 + tests-m32/memfd_create.test | 6 - tests-m32/migrate_pages.c | 24 +- tests-m32/migrate_pages.gen.test | 4 + tests-m32/migrate_pages.test | 6 - tests-m32/mincore.c | 25 +- tests-m32/mincore.gen.test | 4 + tests-m32/mincore.test | 6 - tests-m32/mkdir.c | 7 + tests-m32/mkdir.gen.test | 4 + tests-m32/mkdir.test | 6 - tests-m32/mkdirat.c | 7 + tests-m32/mkdirat.gen.test | 4 + tests-m32/mkdirat.test | 6 - tests-m32/mknod.c | 18 +- tests-m32/mknod.gen.test | 4 + tests-m32/mknod.test | 6 - tests-m32/mknodat.c | 13 +- tests-m32/mknodat.gen.test | 4 + tests-m32/mknodat.test | 6 - tests-m32/mlock.c | 7 + tests-m32/mlock.gen.test | 4 + tests-m32/mlock.test | 6 - tests-m32/mlock2.c | 24 +- tests-m32/mlock2.gen.test | 4 + tests-m32/mlock2.test | 6 - tests-m32/mlockall.c | 24 +- tests-m32/mlockall.gen.test | 4 + tests-m32/mlockall.test | 6 - tests-m32/mmap-Xabbrev.c | 1 + tests-m32/mmap-Xabbrev.gen.test | 4 + tests-m32/mmap-Xraw.c | 2 + tests-m32/mmap-Xraw.gen.test | 4 + tests-m32/mmap-Xverbose.c | 2 + tests-m32/mmap-Xverbose.gen.test | 4 + tests-m32/mmap.c | 84 +- tests-m32/mmap.test | 40 +- tests-m32/mmap64-Xabbrev.c | 1 + tests-m32/mmap64-Xabbrev.gen.test | 4 + tests-m32/mmap64-Xraw.c | 2 + tests-m32/mmap64-Xraw.gen.test | 4 + tests-m32/mmap64-Xverbose.c | 2 + tests-m32/mmap64-Xverbose.gen.test | 4 + tests-m32/mmap64.gen.test | 4 + tests-m32/mmap64.test | 6 - tests-m32/mmsg-silent.c | 24 +- tests-m32/mmsg-silent.gen.test | 4 + tests-m32/mmsg-silent.test | 6 - tests-m32/mmsg.c | 44 +- tests-m32/mmsg.gen.test | 4 + tests-m32/mmsg.test | 6 - tests-m32/mmsg_name-v.gen.test | 4 + tests-m32/mmsg_name-v.test | 7 - tests-m32/mmsg_name.c | 33 +- tests-m32/mmsg_name.gen.test | 4 + tests-m32/mmsg_name.test | 7 - tests-m32/modify_ldt.c | 117 + tests-m32/modify_ldt.gen.test | 4 + tests-m32/mount-Xabbrev.c | 1 + tests-m32/mount-Xabbrev.gen.test | 4 + tests-m32/mount-Xraw.c | 2 + tests-m32/mount-Xraw.gen.test | 4 + tests-m32/mount-Xverbose.c | 2 + tests-m32/mount-Xverbose.gen.test | 4 + tests-m32/mount.c | 108 +- tests-m32/mount.gen.test | 4 + tests-m32/mount.test | 6 - tests-m32/move_pages-Xabbrev.c | 1 + tests-m32/move_pages-Xabbrev.gen.test | 4 + tests-m32/move_pages-Xraw.c | 2 + tests-m32/move_pages-Xraw.gen.test | 4 + tests-m32/move_pages-Xverbose.c | 2 + tests-m32/move_pages-Xverbose.gen.test | 4 + tests-m32/move_pages.c | 55 +- tests-m32/move_pages.gen.test | 4 + tests-m32/move_pages.test | 6 - tests-m32/mq.c | 39 +- tests-m32/mq.gen.test | 4 + tests-m32/mq.test | 6 - tests-m32/mq_sendrecv-read.gen.test | 4 + tests-m32/mq_sendrecv-read.test | 6 - tests-m32/mq_sendrecv-write.gen.test | 4 + tests-m32/mq_sendrecv-write.test | 6 - tests-m32/mq_sendrecv.c | 118 +- tests-m32/mq_sendrecv.gen.test | 4 + tests-m32/mq_sendrecv.test | 6 - tests-m32/msg_control-v.gen.test | 4 + tests-m32/msg_control-v.test | 6 - tests-m32/msg_control.c | 380 +- tests-m32/msg_control.gen.test | 4 + tests-m32/msg_control.test | 6 - tests-m32/msg_name.c | 31 +- tests-m32/msg_name.gen.test | 4 + tests-m32/msg_name.test | 6 - tests-m32/munlockall.c | 9 +- tests-m32/munlockall.gen.test | 4 + tests-m32/munlockall.test | 6 - tests-m32/nanosleep.c | 77 +- tests-m32/nanosleep.gen.test | 4 + tests-m32/nanosleep.test | 6 - tests-m32/net-accept-connect.c | 38 +- tests-m32/net-icmp_filter.c | 31 +- tests-m32/net-icmp_filter.gen.test | 4 + tests-m32/net-icmp_filter.test | 6 - tests-m32/net-packet_mreq-Xabbrev.c | 1 + tests-m32/net-packet_mreq-Xabbrev.gen.test | 4 + tests-m32/net-packet_mreq-Xraw.c | 2 + tests-m32/net-packet_mreq-Xraw.gen.test | 4 + tests-m32/net-packet_mreq-Xverbose.c | 2 + tests-m32/net-packet_mreq-Xverbose.gen.test | 4 + tests-m32/net-packet_mreq.c | 206 + tests-m32/net-packet_mreq.gen.test | 4 + tests-m32/net-sockaddr.c | 337 +- tests-m32/net-sockaddr.gen.test | 4 + tests-m32/net-sockaddr.test | 6 - tests-m32/net-tpacket_req.c | 59 + tests-m32/net-tpacket_req.gen.test | 4 + tests-m32/net-tpacket_stats-success.c | 2 + tests-m32/net-tpacket_stats-success.test | 11 + tests-m32/net-tpacket_stats.c | 154 + tests-m32/net-tpacket_stats.gen.test | 4 + tests-m32/net-y-unix.c | 73 +- tests-m32/net-y-unix.test | 35 +- tests-m32/net-yy-inet.c | 122 +- tests-m32/net-yy-inet.test | 35 +- tests-m32/net-yy-inet6.c | 21 + tests-m32/net-yy-inet6.gen.test | 4 + tests-m32/net-yy-netlink.c | 44 +- tests-m32/net-yy-netlink.test | 35 +- tests-m32/net-yy-unix.c | 96 +- tests-m32/net-yy-unix.test | 37 +- tests-m32/net.expected | 2 +- tests-m32/net.test | 11 +- tests-m32/netlink_audit.c | 45 + tests-m32/netlink_audit.gen.test | 4 + tests-m32/netlink_crypto.c | 161 + tests-m32/netlink_crypto.gen.test | 4 + tests-m32/netlink_generic.c | 61 + tests-m32/netlink_generic.gen.test | 4 + tests-m32/netlink_inet_diag.c | 29 +- tests-m32/netlink_kobject_uevent.c | 143 + tests-m32/netlink_kobject_uevent.gen.test | 4 + tests-m32/netlink_netfilter.c | 189 + tests-m32/netlink_netfilter.gen.test | 4 + tests-m32/netlink_netlink_diag.c | 36 +- tests-m32/netlink_protocol.c | 304 +- tests-m32/netlink_protocol.gen.test | 4 + tests-m32/netlink_protocol.test | 11 - tests-m32/netlink_route.c | 477 + tests-m32/netlink_route.gen.test | 4 + tests-m32/netlink_selinux.c | 88 + tests-m32/netlink_selinux.gen.test | 4 + tests-m32/netlink_sock_diag-v.sh | 13 + tests-m32/netlink_sock_diag.c | 659 + tests-m32/netlink_sock_diag.test | 13 + tests-m32/netlink_unix_diag.c | 33 +- tests-m32/netlink_xfrm.c | 89 + tests-m32/netlink_xfrm.gen.test | 4 + tests-m32/newfstatat.c | 24 +- tests-m32/newfstatat.gen.test | 4 + tests-m32/newfstatat.test | 5 - tests-m32/nfnetlink_acct.c | 100 + tests-m32/nfnetlink_acct.gen.test | 4 + tests-m32/nfnetlink_cthelper.c | 100 + tests-m32/nfnetlink_cthelper.gen.test | 4 + tests-m32/nfnetlink_ctnetlink.c | 100 + tests-m32/nfnetlink_ctnetlink.gen.test | 4 + tests-m32/nfnetlink_ctnetlink_exp.c | 100 + tests-m32/nfnetlink_ctnetlink_exp.gen.test | 4 + tests-m32/nfnetlink_cttimeout.c | 104 + tests-m32/nfnetlink_cttimeout.gen.test | 4 + tests-m32/nfnetlink_ipset.c | 63 + tests-m32/nfnetlink_ipset.gen.test | 4 + tests-m32/nfnetlink_nft_compat.c | 82 + tests-m32/nfnetlink_nft_compat.gen.test | 4 + tests-m32/nfnetlink_nftables.c | 100 + tests-m32/nfnetlink_nftables.gen.test | 4 + tests-m32/nfnetlink_osf.c | 65 + tests-m32/nfnetlink_osf.gen.test | 4 + tests-m32/nfnetlink_queue.c | 63 + tests-m32/nfnetlink_queue.gen.test | 4 + tests-m32/nfnetlink_ulog.c | 63 + tests-m32/nfnetlink_ulog.gen.test | 4 + tests-m32/nlattr.c | 313 + tests-m32/nlattr.gen.test | 4 + tests-m32/nlattr_br_port_msg.c | 74 + tests-m32/nlattr_br_port_msg.gen.test | 4 + tests-m32/nlattr_crypto_user_alg.c | 175 + tests-m32/nlattr_crypto_user_alg.gen.test | 4 + tests-m32/nlattr_dcbmsg.c | 72 + tests-m32/nlattr_dcbmsg.gen.test | 4 + tests-m32/nlattr_fib_rule_hdr.c | 184 + tests-m32/nlattr_fib_rule_hdr.gen.test | 4 + tests-m32/nlattr_ifaddrlblmsg.c | 79 + tests-m32/nlattr_ifaddrlblmsg.gen.test | 4 + tests-m32/nlattr_ifaddrmsg.c | 138 + tests-m32/nlattr_ifaddrmsg.gen.test | 4 + tests-m32/nlattr_ifinfomsg.c | 346 + tests-m32/nlattr_ifinfomsg.gen.test | 4 + tests-m32/nlattr_ifla.h | 58 + tests-m32/nlattr_ifla_af_spec.c | 303 + tests-m32/nlattr_ifla_af_spec.gen.test | 4 + tests-m32/nlattr_ifla_brport.c | 72 + tests-m32/nlattr_ifla_brport.gen.test | 4 + tests-m32/nlattr_ifla_linkinfo.c | 692 + tests-m32/nlattr_ifla_linkinfo.gen.test | 4 + tests-m32/nlattr_ifla_port.c | 64 + tests-m32/nlattr_ifla_port.gen.test | 4 + tests-m32/nlattr_ifla_xdp.c | 123 + tests-m32/nlattr_ifla_xdp.gen.test | 4 + tests-m32/nlattr_inet_diag_msg.c | 205 + tests-m32/nlattr_inet_diag_msg.gen.test | 4 + tests-m32/nlattr_inet_diag_req_compat.c | 85 + .../nlattr_inet_diag_req_compat.gen.test | 4 + tests-m32/nlattr_inet_diag_req_v2.c | 407 + tests-m32/nlattr_inet_diag_req_v2.gen.test | 4 + tests-m32/nlattr_mdba_mdb_entry.c | 167 + tests-m32/nlattr_mdba_mdb_entry.gen.test | 4 + tests-m32/nlattr_mdba_router_port.c | 110 + tests-m32/nlattr_mdba_router_port.gen.test | 4 + tests-m32/nlattr_ndmsg.c | 104 + tests-m32/nlattr_ndmsg.gen.test | 4 + tests-m32/nlattr_ndtmsg.c | 139 + tests-m32/nlattr_ndtmsg.gen.test | 4 + tests-m32/nlattr_netconfmsg.c | 71 + tests-m32/nlattr_netconfmsg.gen.test | 4 + tests-m32/nlattr_netlink_diag_msg.c | 101 + tests-m32/nlattr_netlink_diag_msg.gen.test | 4 + tests-m32/nlattr_nlmsgerr.c | 68 + tests-m32/nlattr_nlmsgerr.gen.test | 4 + tests-m32/nlattr_packet_diag_msg.c | 158 + tests-m32/nlattr_packet_diag_msg.gen.test | 4 + tests-m32/nlattr_rtgenmsg.c | 72 + tests-m32/nlattr_rtgenmsg.gen.test | 4 + tests-m32/nlattr_rtmsg.c | 203 + tests-m32/nlattr_rtmsg.gen.test | 4 + tests-m32/nlattr_smc_diag_msg.c | 231 + tests-m32/nlattr_smc_diag_msg.gen.test | 4 + tests-m32/nlattr_tc_stats.c | 131 + tests-m32/nlattr_tc_stats.gen.test | 4 + tests-m32/nlattr_tca_stab.c | 111 + tests-m32/nlattr_tca_stab.gen.test | 4 + tests-m32/nlattr_tcamsg.c | 61 + tests-m32/nlattr_tcamsg.gen.test | 4 + tests-m32/nlattr_tcmsg.c | 104 + tests-m32/nlattr_tcmsg.gen.test | 4 + tests-m32/nlattr_unix_diag_msg.c | 98 + tests-m32/nlattr_unix_diag_msg.gen.test | 4 + tests-m32/nsyscalls-d.c | 2 + tests-m32/nsyscalls-d.test | 31 + tests-m32/nsyscalls-nd.test | 9 + tests-m32/nsyscalls.c | 86 +- tests-m32/nsyscalls.test | 7 +- tests-m32/old_mmap-P.c | 3 + tests-m32/old_mmap-P.gen.test | 4 + tests-m32/old_mmap-Xabbrev.c | 1 + tests-m32/old_mmap-Xabbrev.gen.test | 4 + tests-m32/old_mmap-Xraw.c | 2 + tests-m32/old_mmap-Xraw.gen.test | 4 + tests-m32/old_mmap-Xverbose.c | 2 + tests-m32/old_mmap-Xverbose.gen.test | 4 + tests-m32/old_mmap-v-none.c | 1 + tests-m32/old_mmap-v-none.gen.test | 4 + tests-m32/old_mmap.c | 100 +- tests-m32/old_mmap.gen.test | 4 + tests-m32/old_mmap.test | 6 - tests-m32/oldfstat.c | 23 +- tests-m32/oldfstat.gen.test | 4 + tests-m32/oldfstat.test | 19 - tests-m32/oldlstat.c | 23 +- tests-m32/oldlstat.gen.test | 4 + tests-m32/oldlstat.test | 5 - tests-m32/oldselect-P.c | 2 + tests-m32/oldselect-P.gen.test | 4 + tests-m32/oldselect-efault-P.c | 2 + tests-m32/oldselect-efault-P.gen.test | 4 + tests-m32/oldselect-efault.c | 58 + tests-m32/oldselect-efault.gen.test | 4 + tests-m32/oldselect.c | 75 +- tests-m32/oldselect.expected | 2 - tests-m32/oldselect.gen.test | 4 + tests-m32/oldselect.test | 11 - tests-m32/oldstat.c | 23 +- tests-m32/oldstat.gen.test | 4 + tests-m32/oldstat.test | 5 - tests-m32/open.c | 38 +- tests-m32/open.gen.test | 4 + tests-m32/open.test | 6 - tests-m32/openat.c | 98 +- tests-m32/openat.gen.test | 4 + tests-m32/openat.test | 6 - tests-m32/opipe.test | 13 +- tests-m32/options-syntax.test | 154 +- tests-m32/orphaned_process_group.c | 155 + tests-m32/orphaned_process_group.gen.test | 4 + tests-m32/osf_utimes.c | 25 + tests-m32/osf_utimes.gen.test | 4 + tests-m32/overflowuid.c | 24 +- tests-m32/pause.c | 23 +- tests-m32/pause.gen.test | 4 + tests-m32/pause.test | 6 - tests-m32/pc.c | 24 +- tests-m32/pc.test | 31 +- tests-m32/perf_event_open.c | 251 +- tests-m32/perf_event_open.gen.test | 4 + tests-m32/perf_event_open.test | 7 - tests-m32/perf_event_open_nonverbose.c | 35 +- tests-m32/perf_event_open_nonverbose.gen.test | 4 + tests-m32/perf_event_open_nonverbose.test | 6 - tests-m32/perf_event_open_unabbrev.gen.test | 4 + tests-m32/perf_event_open_unabbrev.test | 7 - tests-m32/personality-Xabbrev.c | 1 + tests-m32/personality-Xabbrev.gen.test | 4 + tests-m32/personality-Xraw.c | 2 + tests-m32/personality-Xraw.gen.test | 4 + tests-m32/personality-Xverbose.c | 2 + tests-m32/personality-Xverbose.gen.test | 4 + tests-m32/personality.c | 98 +- tests-m32/personality.test | 14 +- tests-m32/pidfd_send_signal.c | 71 + tests-m32/pidfd_send_signal.gen.test | 4 + tests-m32/pipe.c | 23 +- tests-m32/pipe.test | 8 +- tests-m32/pipe2.c | 30 +- tests-m32/pipe2.gen.test | 4 + tests-m32/pipe2.test | 6 - tests-m32/pipe_maxfd.c | 24 +- tests-m32/pkey_alloc.c | 31 +- tests-m32/pkey_alloc.gen.test | 4 + tests-m32/pkey_alloc.test | 6 - tests-m32/pkey_free.c | 23 +- tests-m32/pkey_free.gen.test | 4 + tests-m32/pkey_free.test | 6 - tests-m32/pkey_mprotect.c | 23 +- tests-m32/pkey_mprotect.gen.test | 4 + tests-m32/pkey_mprotect.test | 6 - tests-m32/poll-P.c | 2 + tests-m32/poll-P.test | 22 + tests-m32/poll.c | 177 +- tests-m32/poll.test | 19 +- tests-m32/ppoll-P.c | 2 + tests-m32/ppoll-P.gen.test | 4 + tests-m32/ppoll-v.c | 3 + tests-m32/ppoll-v.expected | 3 - tests-m32/ppoll-v.gen.test | 4 + tests-m32/ppoll.c | 265 +- tests-m32/ppoll.expected | 3 - tests-m32/ppoll.gen.test | 4 + tests-m32/ppoll.test | 13 - tests-m32/prctl-arg2-intptr.c | 25 +- tests-m32/prctl-arg2-intptr.test | 10 +- tests-m32/prctl-dumpable.c | 29 +- tests-m32/prctl-dumpable.test | 10 +- tests-m32/prctl-name.c | 23 +- tests-m32/prctl-name.test | 10 +- tests-m32/prctl-no-args.c | 25 +- tests-m32/prctl-no-args.test | 10 +- tests-m32/prctl-pdeathsig.c | 25 +- tests-m32/prctl-pdeathsig.test | 9 +- tests-m32/prctl-seccomp-filter-v.c | 39 +- tests-m32/prctl-seccomp-filter-v.test | 9 +- tests-m32/prctl-seccomp-strict.c | 24 +- tests-m32/prctl-seccomp-strict.test | 10 +- tests-m32/prctl-securebits.c | 23 +- tests-m32/prctl-securebits.test | 10 +- tests-m32/prctl-spec-inject.c | 148 + tests-m32/prctl-spec-inject.test | 35 + tests-m32/prctl-tid_address.c | 25 +- tests-m32/prctl-tid_address.test | 10 +- tests-m32/prctl-tsc.c | 25 +- tests-m32/prctl-tsc.test | 9 +- tests-m32/pread64-pwrite64.c | 28 +- tests-m32/pread64-pwrite64.gen.test | 4 + tests-m32/pread64-pwrite64.test | 18 - tests-m32/preadv-pwritev.c | 32 +- tests-m32/preadv-pwritev.gen.test | 4 + tests-m32/preadv-pwritev.test | 6 - tests-m32/preadv.c | 32 +- tests-m32/preadv.gen.test | 4 + tests-m32/preadv.test | 6 - tests-m32/preadv2-pwritev2.c | 104 +- tests-m32/preadv2-pwritev2.gen.test | 4 + tests-m32/preadv2-pwritev2.test | 6 - tests-m32/print_maxfd.c | 24 +- tests-m32/print_quoted_string.c | 114 +- tests-m32/print_time.c | 54 + tests-m32/print_user_desc.c | 58 + tests-m32/printflags.c | 24 +- tests-m32/printpath-umovestr-legacy.test | 32 + tests-m32/printpath-umovestr-peekdata.c | 27 + .../printpath-umovestr-peekdata.gen.test | 4 + tests-m32/printpath-umovestr-undumpable.c | 51 + .../printpath-umovestr-undumpable.gen.test | 4 + tests-m32/printpath-umovestr.c | 26 + tests-m32/printpath-umovestr.gen.test | 4 + tests-m32/printsignal-Xabbrev.c | 1 + tests-m32/printsignal-Xabbrev.gen.test | 4 + tests-m32/printsignal-Xraw.c | 2 + tests-m32/printsignal-Xraw.gen.test | 4 + tests-m32/printsignal-Xverbose.c | 2 + tests-m32/printsignal-Xverbose.gen.test | 4 + tests-m32/printsignal.c | 33 + tests-m32/printstr.c | 32 +- tests-m32/printstr.gen.test | 4 + tests-m32/printstr.test | 6 - tests-m32/printstrn-umoven-legacy.test | 32 + tests-m32/printstrn-umoven-peekdata.c | 27 + tests-m32/printstrn-umoven-peekdata.gen.test | 4 + tests-m32/printstrn-umoven-undumpable.c | 51 + .../printstrn-umoven-undumpable.gen.test | 4 + tests-m32/printstrn-umoven.c | 24 + tests-m32/printstrn-umoven.gen.test | 4 + tests-m32/printxval.c | 24 +- tests-m32/prlimit64.c | 24 +- tests-m32/prlimit64.gen.test | 4 + tests-m32/prlimit64.test | 6 - tests-m32/process_vm_readv.c | 7 + tests-m32/process_vm_readv.gen.test | 4 + tests-m32/process_vm_readv.test | 6 - tests-m32/process_vm_readv_writev.c | 44 +- tests-m32/process_vm_writev.c | 7 + tests-m32/process_vm_writev.gen.test | 4 + tests-m32/process_vm_writev.test | 6 - tests-m32/pselect6.c | 70 +- tests-m32/pselect6.gen.test | 4 + tests-m32/pselect6.test | 6 - tests-m32/ptrace.c | 101 +- tests-m32/ptrace.gen.test | 4 + tests-m32/ptrace.test | 6 - tests-m32/ptrace_syscall_info.c | 460 + tests-m32/ptrace_syscall_info.gen.test | 4 + tests-m32/pure_executables.am | 522 + tests-m32/pure_executables.list | 526 + tests-m32/pwritev.c | 25 +- tests-m32/pwritev.gen.test | 4 + tests-m32/pwritev.test | 6 - tests-m32/qual_fault-exit_group.test | 31 +- tests-m32/qual_fault-syntax.test | 47 +- tests-m32/qual_fault-syscall.test | 3 + tests-m32/qual_fault.c | 138 +- tests-m32/qual_fault.test | 65 +- .../qual_inject-error-signal-syscall.test | 3 + tests-m32/qual_inject-error-signal.c | 24 +- tests-m32/qual_inject-error-signal.test | 16 +- tests-m32/qual_inject-retval-syscall.test | 3 + tests-m32/qual_inject-retval.c | 23 +- tests-m32/qual_inject-retval.test | 15 +- tests-m32/qual_inject-signal-syscall.test | 3 + tests-m32/qual_inject-signal.c | 24 +- tests-m32/qual_inject-signal.test | 15 +- tests-m32/qual_inject-syntax.test | 60 +- tests-m32/qual_signal.c | 24 +- tests-m32/qual_signal.test | 28 +- tests-m32/qual_syscall.test | 25 +- tests-m32/qualify_personality.sh | 74 + tests-m32/qualify_personality_empty.in | 0 tests-m32/quotactl-Xabbrev.c | 1 + tests-m32/quotactl-Xabbrev.gen.test | 4 + tests-m32/quotactl-Xraw.c | 2 + tests-m32/quotactl-Xraw.gen.test | 4 + tests-m32/quotactl-Xverbose.c | 2 + tests-m32/quotactl-Xverbose.gen.test | 4 + tests-m32/quotactl-success-v.c | 2 + tests-m32/quotactl-success-v.test | 11 + tests-m32/quotactl-success.c | 2 + tests-m32/quotactl-success.test | 11 + tests-m32/quotactl-v.gen.test | 4 + tests-m32/quotactl-v.test | 6 - tests-m32/quotactl-xfs-success-v.c | 2 + tests-m32/quotactl-xfs-success-v.test | 11 + tests-m32/quotactl-xfs-success.c | 2 + tests-m32/quotactl-xfs-success.test | 11 + tests-m32/quotactl-xfs-v.gen.test | 4 + tests-m32/quotactl-xfs-v.test | 6 - tests-m32/quotactl-xfs.c | 174 +- tests-m32/quotactl-xfs.gen.test | 4 + tests-m32/quotactl-xfs.test | 6 - tests-m32/quotactl.c | 265 +- tests-m32/quotactl.gen.test | 4 + tests-m32/quotactl.h | 120 +- tests-m32/quotactl.test | 6 - tests-m32/read-write.c | 147 +- tests-m32/read-write.gen.test | 4 + tests-m32/read-write.test | 18 - tests-m32/readahead.c | 27 +- tests-m32/readahead.gen.test | 4 + tests-m32/readahead.test | 6 - tests-m32/readdir.c | 29 +- tests-m32/readdir.gen.test | 4 + tests-m32/readdir.test | 8 - tests-m32/readlink.c | 24 +- tests-m32/readlink.gen.test | 4 + tests-m32/readlink.test | 6 - tests-m32/readlinkat.c | 24 +- tests-m32/readlinkat.gen.test | 4 + tests-m32/readlinkat.test | 5 - tests-m32/readv.c | 35 +- tests-m32/readv.test | 25 +- tests-m32/reboot.c | 85 +- tests-m32/reboot.gen.test | 4 + tests-m32/reboot.test | 6 - tests-m32/recvfrom.c | 24 +- tests-m32/recvfrom.gen.test | 4 + tests-m32/recvfrom.test | 6 - tests-m32/recvmmsg-timeout.c | 51 +- tests-m32/recvmmsg-timeout.gen.test | 4 + tests-m32/recvmmsg-timeout.test | 6 - tests-m32/recvmsg.c | 32 +- tests-m32/recvmsg.gen.test | 4 + tests-m32/recvmsg.test | 6 - tests-m32/redirect-fds.c | 24 +- tests-m32/redirect-fds.test | 28 +- tests-m32/redirect.test | 25 +- tests-m32/regex.gen.test | 4 + tests-m32/regex.in | 2 + tests-m32/remap_file_pages-Xabbrev.c | 1 + tests-m32/remap_file_pages-Xabbrev.gen.test | 4 + tests-m32/remap_file_pages-Xraw.c | 2 + tests-m32/remap_file_pages-Xraw.gen.test | 4 + tests-m32/remap_file_pages-Xverbose.c | 2 + tests-m32/remap_file_pages-Xverbose.gen.test | 4 + tests-m32/remap_file_pages.c | 123 +- tests-m32/remap_file_pages.gen.test | 4 + tests-m32/remap_file_pages.test | 6 - tests-m32/rename.c | 7 + tests-m32/rename.gen.test | 4 + tests-m32/rename.test | 6 - tests-m32/renameat.c | 7 + tests-m32/renameat.gen.test | 4 + tests-m32/renameat.test | 6 - tests-m32/renameat2.c | 24 +- tests-m32/renameat2.gen.test | 4 + tests-m32/renameat2.test | 6 - tests-m32/request_key.c | 30 +- tests-m32/request_key.gen.test | 4 + tests-m32/request_key.test | 6 - tests-m32/restart_syscall.c | 48 +- tests-m32/restart_syscall.test | 14 +- tests-m32/riscv_flush_icache.c | 73 + tests-m32/riscv_flush_icache.gen.test | 4 + tests-m32/rmdir.c | 7 + tests-m32/rmdir.gen.test | 4 + tests-m32/rmdir.test | 6 - tests-m32/rt_sigaction.awk | 76 + tests-m32/rt_sigaction.c | 48 + tests-m32/rt_sigaction.test | 16 + tests-m32/rt_sigpending.c | 29 +- tests-m32/rt_sigpending.gen.test | 4 + tests-m32/rt_sigpending.test | 6 - tests-m32/rt_sigprocmask.c | 25 +- tests-m32/rt_sigprocmask.gen.test | 4 + tests-m32/rt_sigprocmask.test | 6 - tests-m32/rt_sigqueueinfo.c | 25 +- tests-m32/rt_sigqueueinfo.gen.test | 4 + tests-m32/rt_sigqueueinfo.test | 6 - tests-m32/rt_sigreturn.c | 59 + tests-m32/rt_sigreturn.gen.test | 4 + tests-m32/rt_sigsuspend.c | 25 +- tests-m32/rt_sigsuspend.gen.test | 4 + tests-m32/rt_sigsuspend.test | 6 - tests-m32/rt_sigtimedwait.c | 122 +- tests-m32/rt_sigtimedwait.gen.test | 4 + tests-m32/rt_sigtimedwait.test | 6 - tests-m32/rt_tgsigqueueinfo.c | 36 +- tests-m32/rt_tgsigqueueinfo.gen.test | 4 + tests-m32/rt_tgsigqueueinfo.test | 6 - tests-m32/run.sh | 14 +- tests-m32/run_expect_termsig.c | 38 + tests-m32/s390_guarded_storage-v.c | 2 + tests-m32/s390_guarded_storage-v.gen.test | 4 + tests-m32/s390_guarded_storage.c | 208 + tests-m32/s390_guarded_storage.gen.test | 4 + tests-m32/s390_pci_mmio_read_write.c | 134 + tests-m32/s390_pci_mmio_read_write.gen.test | 4 + tests-m32/s390_runtime_instr.c | 78 + tests-m32/s390_runtime_instr.gen.test | 4 + tests-m32/s390_sthyi-v.c | 2 + tests-m32/s390_sthyi-v.gen.test | 4 + tests-m32/s390_sthyi.c | 763 + tests-m32/s390_sthyi.gen.test | 4 + tests-m32/sched.gen.test | 4 + tests-m32/sched.in | 7 + tests-m32/sched_get_priority_mxx.c | 9 +- tests-m32/sched_get_priority_mxx.gen.test | 4 + tests-m32/sched_get_priority_mxx.test | 6 - tests-m32/sched_rr_get_interval.c | 15 +- tests-m32/sched_rr_get_interval.gen.test | 4 + tests-m32/sched_rr_get_interval.test | 6 - tests-m32/sched_xetaffinity.c | 24 +- tests-m32/sched_xetaffinity.gen.test | 4 + tests-m32/sched_xetaffinity.test | 6 - tests-m32/sched_xetattr.c | 338 +- tests-m32/sched_xetattr.gen.test | 4 + tests-m32/sched_xetattr.test | 12 - tests-m32/sched_xetparam.c | 7 + tests-m32/sched_xetparam.gen.test | 4 + tests-m32/sched_xetparam.test | 6 - tests-m32/sched_xetscheduler.c | 9 +- tests-m32/sched_xetscheduler.gen.test | 4 + tests-m32/sched_xetscheduler.test | 6 - tests-m32/sched_yield.c | 7 + tests-m32/sched_yield.gen.test | 4 + tests-m32/sched_yield.test | 6 - tests-m32/scm_rights-fd.test | 44 +- tests-m32/scm_rights.c | 27 +- tests-m32/scno_tampering.sh | 36 +- tests-m32/seccomp-filter-v.c | 54 +- tests-m32/seccomp-filter-v.gen.test | 4 + tests-m32/seccomp-filter-v.test | 6 - tests-m32/seccomp-filter.c | 38 +- tests-m32/seccomp-filter.gen.test | 4 + tests-m32/seccomp-filter.test | 6 - tests-m32/seccomp-strict.c | 24 +- tests-m32/seccomp-strict.test | 10 +- tests-m32/seccomp_get_action_avail.c | 108 + tests-m32/seccomp_get_action_avail.gen.test | 4 + tests-m32/select-P.c | 2 + tests-m32/select-P.gen.test | 4 + tests-m32/select.c | 24 +- tests-m32/select.gen.test | 4 + tests-m32/select.test | 6 - tests-m32/semop.c | 56 +- tests-m32/semop.gen.test | 4 + tests-m32/semop.test | 6 - tests-m32/sendfile.c | 99 +- tests-m32/sendfile.gen.test | 4 + tests-m32/sendfile.test | 6 - tests-m32/sendfile64.c | 94 +- tests-m32/sendfile64.gen.test | 4 + tests-m32/sendfile64.test | 6 - tests-m32/set_mempolicy.c | 25 +- tests-m32/set_mempolicy.gen.test | 4 + tests-m32/set_mempolicy.test | 6 - tests-m32/set_ptracer_any.c | 35 +- tests-m32/set_sigblock.c | 33 + tests-m32/set_sigign.c | 29 + tests-m32/setdomainname.c | 7 + tests-m32/setdomainname.gen.test | 4 + tests-m32/setdomainname.test | 6 - tests-m32/setfsgid.c | 7 + tests-m32/setfsgid.gen.test | 4 + tests-m32/setfsgid.test | 6 - tests-m32/setfsgid32.c | 7 + tests-m32/setfsgid32.gen.test | 4 + tests-m32/setfsgid32.test | 6 - tests-m32/setfsugid.c | 25 +- tests-m32/setfsuid.c | 7 + tests-m32/setfsuid.gen.test | 4 + tests-m32/setfsuid.test | 6 - tests-m32/setfsuid32.c | 7 + tests-m32/setfsuid32.gen.test | 4 + tests-m32/setfsuid32.test | 6 - tests-m32/setgid.c | 7 + tests-m32/setgid.gen.test | 4 + tests-m32/setgid.test | 6 - tests-m32/setgid32.c | 7 + tests-m32/setgid32.gen.test | 4 + tests-m32/setgid32.test | 6 - tests-m32/setgroups.c | 35 +- tests-m32/setgroups.gen.test | 4 + tests-m32/setgroups.test | 6 - tests-m32/setgroups32.c | 7 + tests-m32/setgroups32.gen.test | 4 + tests-m32/setgroups32.test | 6 - tests-m32/sethostname.c | 35 +- tests-m32/sethostname.gen.test | 4 + tests-m32/sethostname.test | 6 - tests-m32/setns.c | 23 +- tests-m32/setns.gen.test | 4 + tests-m32/setns.test | 6 - tests-m32/setregid.c | 7 + tests-m32/setregid.gen.test | 4 + tests-m32/setregid.test | 6 - tests-m32/setregid32.c | 7 + tests-m32/setregid32.gen.test | 4 + tests-m32/setregid32.test | 6 - tests-m32/setresgid.c | 7 + tests-m32/setresgid.gen.test | 4 + tests-m32/setresgid.test | 6 - tests-m32/setresgid32.c | 7 + tests-m32/setresgid32.gen.test | 4 + tests-m32/setresgid32.test | 6 - tests-m32/setresugid.c | 24 +- tests-m32/setresuid.c | 7 + tests-m32/setresuid.gen.test | 4 + tests-m32/setresuid.test | 6 - tests-m32/setresuid32.c | 7 + tests-m32/setresuid32.gen.test | 4 + tests-m32/setresuid32.test | 6 - tests-m32/setreugid.c | 24 +- tests-m32/setreuid.c | 7 + tests-m32/setreuid.gen.test | 4 + tests-m32/setreuid.test | 6 - tests-m32/setreuid32.c | 7 + tests-m32/setreuid32.gen.test | 4 + tests-m32/setreuid32.test | 6 - tests-m32/setrlimit-Xabbrev.c | 1 + tests-m32/setrlimit-Xabbrev.gen.test | 4 + tests-m32/setrlimit-Xraw.c | 2 + tests-m32/setrlimit-Xraw.gen.test | 4 + tests-m32/setrlimit-Xverbose.c | 2 + tests-m32/setrlimit-Xverbose.gen.test | 4 + tests-m32/setrlimit.c | 47 +- tests-m32/setrlimit.gen.test | 4 + tests-m32/setrlimit.test | 6 - tests-m32/setugid.c | 30 +- tests-m32/setuid.c | 7 + tests-m32/setuid.gen.test | 4 + tests-m32/setuid.test | 6 - tests-m32/setuid32.c | 7 + tests-m32/setuid32.gen.test | 4 + tests-m32/setuid32.test | 6 - tests-m32/shmxt.c | 36 +- tests-m32/shmxt.gen.test | 4 + tests-m32/shmxt.test | 12 - tests-m32/shutdown.c | 7 + tests-m32/shutdown.gen.test | 4 + tests-m32/shutdown.test | 6 - tests-m32/sigaction.awk | 95 - tests-m32/sigaction.c | 222 +- tests-m32/sigaction.gen.test | 4 + tests-m32/sigaction.test | 11 - tests-m32/sigaltstack.c | 7 + tests-m32/sigaltstack.test | 7 +- tests-m32/sigblock.test | 27 + tests-m32/sigign.test | 27 + tests-m32/siginfo.c | 24 +- tests-m32/siginfo.gen.test | 4 + tests-m32/siginfo.test | 6 - tests-m32/signal.c | 112 + tests-m32/signal.gen.test | 4 + tests-m32/signal2name.c | 10 +- tests-m32/signal_receive.c | 112 +- tests-m32/signal_receive.gen.test | 4 + tests-m32/signal_receive.test | 6 - tests-m32/signalfd4.c | 47 +- tests-m32/signalfd4.gen.test | 4 + tests-m32/signalfd4.test | 6 - tests-m32/sigpending.c | 86 + tests-m32/sigpending.gen.test | 4 + tests-m32/sigprocmask.c | 131 + tests-m32/sigprocmask.gen.test | 4 + tests-m32/sigreturn.c | 85 +- tests-m32/sigreturn.gen.test | 4 + tests-m32/sigreturn.test | 48 - tests-m32/sigsuspend.c | 97 + tests-m32/sigsuspend.gen.test | 4 + tests-m32/skip_unavailable.c | 20 + tests-m32/sleep.c | 24 +- tests-m32/so_error.c | 103 + tests-m32/so_error.gen.test | 4 + tests-m32/so_linger.c | 161 + tests-m32/so_linger.gen.test | 4 + tests-m32/so_peercred-Xabbrev.c | 1 + tests-m32/so_peercred-Xabbrev.gen.test | 4 + tests-m32/so_peercred-Xraw.c | 2 + tests-m32/so_peercred-Xraw.gen.test | 4 + tests-m32/so_peercred-Xverbose.c | 2 + tests-m32/so_peercred-Xverbose.gen.test | 4 + tests-m32/so_peercred.c | 190 + tests-m32/so_peercred.gen.test | 4 + tests-m32/sock_filter-v-Xabbrev.c | 1 + tests-m32/sock_filter-v-Xabbrev.gen.test | 4 + tests-m32/sock_filter-v-Xraw.c | 2 + tests-m32/sock_filter-v-Xraw.gen.test | 4 + tests-m32/sock_filter-v-Xverbose.c | 2 + tests-m32/sock_filter-v-Xverbose.gen.test | 4 + tests-m32/sock_filter-v.c | 211 + tests-m32/sock_filter-v.gen.test | 4 + tests-m32/sockaddr_xlat-Xabbrev.c | 1 + tests-m32/sockaddr_xlat-Xabbrev.gen.test | 4 + tests-m32/sockaddr_xlat-Xraw.c | 2 + tests-m32/sockaddr_xlat-Xraw.gen.test | 4 + tests-m32/sockaddr_xlat-Xverbose.c | 2 + tests-m32/sockaddr_xlat-Xverbose.gen.test | 4 + tests-m32/sockaddr_xlat.c | 271 + tests-m32/socketcall.c | 24 +- tests-m32/socketcall.gen.test | 4 + tests-m32/socketcall.test | 6 - tests-m32/sockname.c | 31 +- tests-m32/sockopt-sol_netlink.c | 193 + tests-m32/sockopt-sol_netlink.gen.test | 4 + tests-m32/sockopt-timestamp.c | 197 + tests-m32/sockopt-timestamp.gen.test | 4 + tests-m32/splice.c | 27 +- tests-m32/splice.gen.test | 4 + tests-m32/splice.test | 6 - tests-m32/sprintrc.c | 26 +- tests-m32/stack-fcall-0.c | 9 +- tests-m32/stack-fcall-1.c | 9 +- tests-m32/stack-fcall-2.c | 9 +- tests-m32/stack-fcall-3.c | 19 +- tests-m32/stack-fcall-mangled-0.c | 2 + tests-m32/stack-fcall-mangled-1.c | 2 + tests-m32/stack-fcall-mangled-2.c | 2 + tests-m32/stack-fcall-mangled-3.c | 2 + tests-m32/stack-fcall-mangled.c | 2 + tests-m32/stack-fcall.c | 14 +- tests-m32/stack-fcall.h | 20 + tests-m32/stat.c | 23 +- tests-m32/stat.gen.test | 4 + tests-m32/stat.test | 5 - tests-m32/stat64.c | 23 +- tests-m32/stat64.gen.test | 4 + tests-m32/stat64.test | 5 - tests-m32/statfs.c | 24 +- tests-m32/statfs.expected | 1 - tests-m32/statfs.gen.test | 4 + tests-m32/statfs.test | 11 - tests-m32/statfs64.c | 24 +- tests-m32/statfs64.gen.test | 4 + tests-m32/statfs64.test | 5 - tests-m32/statx.c | 50 + tests-m32/statx.gen.test | 4 + tests-m32/statx.sh | 6 - tests-m32/strace-C.test | 11 +- tests-m32/strace-E.expected | 2 +- tests-m32/strace-E.test | 9 +- tests-m32/strace-S.test | 13 +- tests-m32/strace-T.test | 11 +- tests-m32/strace-V.test | 57 +- tests-m32/strace-ff.test | 12 +- tests-m32/strace-k-demangle.expected | 2 + tests-m32/strace-k-demangle.test | 12 + tests-m32/strace-k.expected | 2 + tests-m32/strace-k.test | 89 +- tests-m32/strace-log-merge-error.test | 37 + tests-m32/strace-log-merge-suffix.test | 29 + tests-m32/strace-r.expected | 2 +- tests-m32/strace-r.test | 11 +- tests-m32/strace-t.test | 34 +- tests-m32/strace-tt.test | 12 +- tests-m32/strace-ttt.test | 12 +- tests-m32/strace.supp | 10 + tests-m32/struct_flock.c | 107 - tests-m32/sun_path.test | 9 +- tests-m32/swap.c | 7 + tests-m32/swap.gen.test | 4 + tests-m32/swap.test | 6 - tests-m32/sxetmask.c | 104 + tests-m32/sxetmask.gen.test | 4 + tests-m32/symlink.c | 17 +- tests-m32/symlink.gen.test | 4 + tests-m32/symlink.test | 6 - tests-m32/symlinkat.c | 7 + tests-m32/symlinkat.gen.test | 4 + tests-m32/symlinkat.test | 6 - tests-m32/sync.c | 7 + tests-m32/sync.gen.test | 4 + tests-m32/sync.test | 6 - tests-m32/sync_file_range.c | 24 +- tests-m32/sync_file_range.gen.test | 4 + tests-m32/sync_file_range.test | 6 - tests-m32/sync_file_range2.c | 24 +- tests-m32/sync_file_range2.gen.test | 4 + tests-m32/sync_file_range2.test | 6 - tests-m32/syntax.sh | 59 + tests-m32/sysinfo.c | 25 +- tests-m32/sysinfo.gen.test | 4 + tests-m32/sysinfo.test | 6 - tests-m32/syslog.c | 7 + tests-m32/syslog.gen.test | 4 + tests-m32/syslog.test | 6 - tests-m32/tail_alloc.c | 24 +- tests-m32/tee.c | 24 +- tests-m32/tee.gen.test | 4 + tests-m32/tee.test | 6 - tests-m32/termsig.test | 20 + tests-m32/test_netlink.h | 104 + tests-m32/test_nlattr.h | 343 + tests-m32/test_printpath.c | 91 + tests-m32/test_printstrn.c | 99 + tests-m32/test_ucopy.c | 143 + tests-m32/test_ucopy.h | 20 + tests-m32/tests.h | 187 +- tests-m32/threads-execve.c | 44 +- tests-m32/threads-execve.test | 40 +- tests-m32/time.c | 38 +- tests-m32/time.gen.test | 4 + tests-m32/time.test | 6 - tests-m32/timer_create.c | 30 +- tests-m32/timer_create.gen.test | 4 + tests-m32/timer_create.test | 6 - tests-m32/timer_xettime.c | 110 +- tests-m32/timer_xettime.gen.test | 4 + tests-m32/timer_xettime.test | 6 - tests-m32/timerfd_xettime.c | 105 +- tests-m32/timerfd_xettime.gen.test | 4 + tests-m32/timerfd_xettime.test | 6 - tests-m32/times-fail.c | 9 +- tests-m32/times-fail.gen.test | 4 + tests-m32/times-fail.test | 6 - tests-m32/times.c | 25 +- tests-m32/times.gen.test | 4 + tests-m32/times.test | 6 - tests-m32/tprintf.c | 24 +- tests-m32/trace_fstat.gen.test | 4 + tests-m32/trace_fstat.in | 11 + tests-m32/trace_fstatfs.gen.test | 4 + tests-m32/trace_fstatfs.in | 2 + tests-m32/trace_lstat.gen.test | 4 + tests-m32/trace_lstat.in | 3 + tests-m32/trace_personality_32.gen.test | 4 + tests-m32/trace_personality_32.in | 1 + tests-m32/trace_personality_64.gen.test | 4 + tests-m32/trace_personality_64.in | 1 + tests-m32/trace_personality_regex_32.gen.test | 4 + tests-m32/trace_personality_regex_32.in | 3 + tests-m32/trace_personality_regex_64.gen.test | 4 + tests-m32/trace_personality_regex_64.in | 3 + .../trace_personality_regex_x32.gen.test | 4 + tests-m32/trace_personality_regex_x32.in | 3 + tests-m32/trace_personality_x32.gen.test | 4 + tests-m32/trace_personality_x32.in | 1 + tests-m32/trace_question.gen.test | 4 + tests-m32/trace_question.in | 4 + tests-m32/trace_stat.gen.test | 4 + tests-m32/trace_stat.in | 3 + tests-m32/trace_stat_like.gen.test | 4 + tests-m32/trace_stat_like.in | 18 + tests-m32/trace_statfs.gen.test | 4 + tests-m32/trace_statfs.in | 2 + tests-m32/trace_statfs_like.gen.test | 4 + tests-m32/trace_statfs_like.in | 5 + tests-m32/truncate.c | 24 +- tests-m32/truncate.gen.test | 4 + tests-m32/truncate.test | 6 - tests-m32/truncate64.c | 24 +- tests-m32/truncate64.gen.test | 4 + tests-m32/truncate64.test | 6 - tests-m32/ugetrlimit.c | 7 + tests-m32/ugetrlimit.gen.test | 4 + tests-m32/ugetrlimit.test | 6 - tests-m32/uio.c | 29 +- tests-m32/uio.test | 9 +- tests-m32/umask.c | 7 + tests-m32/umask.gen.test | 4 + tests-m32/umask.test | 6 - tests-m32/umode_t.c | 32 +- tests-m32/umount.c | 26 +- tests-m32/umount.test | 7 +- tests-m32/umount2.c | 26 +- tests-m32/umount2.test | 7 +- tests-m32/umoven-illptr.c | 24 +- tests-m32/umoven-illptr.gen.test | 4 + tests-m32/umoven-illptr.test | 6 - tests-m32/umovestr-illptr.c | 24 +- tests-m32/umovestr-illptr.gen.test | 4 + tests-m32/umovestr-illptr.test | 6 - tests-m32/umovestr.c | 24 +- tests-m32/umovestr.test | 5 + tests-m32/umovestr2.c | 24 +- tests-m32/umovestr2.test | 9 +- tests-m32/umovestr3.c | 25 +- tests-m32/umovestr3.gen.test | 4 + tests-m32/umovestr3.test | 6 - tests-m32/uname.c | 24 +- tests-m32/uname.test | 10 +- tests-m32/unblock_reset_raise.c | 34 + tests-m32/unix-pair-send-recv.c | 24 +- tests-m32/unix-pair-send-recv.test | 9 +- tests-m32/unix-pair-sendto-recvfrom.c | 25 +- tests-m32/unix-pair-sendto-recvfrom.test | 9 +- tests-m32/unlink.c | 7 + tests-m32/unlink.gen.test | 4 + tests-m32/unlink.test | 6 - tests-m32/unlinkat.c | 7 + tests-m32/unlinkat.gen.test | 4 + tests-m32/unlinkat.test | 6 - tests-m32/unshare.c | 23 +- tests-m32/unshare.gen.test | 4 + tests-m32/unshare.test | 6 - tests-m32/userfaultfd.c | 24 +- tests-m32/userfaultfd.gen.test | 4 + tests-m32/userfaultfd.test | 6 - tests-m32/ustat.c | 33 +- tests-m32/ustat.gen.test | 4 + tests-m32/ustat.test | 6 - tests-m32/utime.c | 45 +- tests-m32/utime.gen.test | 4 + tests-m32/utime.test | 6 - tests-m32/utimensat-Xabbrev.c | 1 + tests-m32/utimensat-Xabbrev.gen.test | 4 + tests-m32/utimensat-Xraw.c | 2 + tests-m32/utimensat-Xraw.gen.test | 4 + tests-m32/utimensat-Xverbose.c | 2 + tests-m32/utimensat-Xverbose.gen.test | 4 + tests-m32/utimensat.c | 244 +- tests-m32/utimensat.gen.test | 4 + tests-m32/utimensat.test | 20 - tests-m32/utimes.c | 72 +- tests-m32/utimes.gen.test | 4 + tests-m32/utimes.test | 6 - tests-m32/vfork-f.c | 24 +- tests-m32/vfork-f.gen.test | 4 + tests-m32/vfork-f.test | 5 - tests-m32/vhangup.c | 7 + tests-m32/vhangup.gen.test | 4 + tests-m32/vhangup.test | 7 - tests-m32/vmsplice.c | 25 +- tests-m32/vmsplice.gen.test | 4 + tests-m32/vmsplice.test | 6 - tests-m32/wait4-v.gen.test | 4 + tests-m32/wait4-v.test | 6 - tests-m32/wait4.c | 39 +- tests-m32/wait4.gen.test | 4 + tests-m32/wait4.test | 6 - tests-m32/waitid-v.gen.test | 4 + tests-m32/waitid-v.test | 6 - tests-m32/waitid.c | 38 +- tests-m32/waitid.gen.test | 4 + tests-m32/waitid.test | 6 - tests-m32/waitpid.c | 24 +- tests-m32/waitpid.gen.test | 4 + tests-m32/waitpid.test | 6 - tests-m32/xattr-strings.c | 7 + tests-m32/xattr-strings.gen.test | 4 + tests-m32/xattr-strings.test | 7 - tests-m32/xattr.c | 27 +- tests-m32/xattr.gen.test | 4 + tests-m32/xattr.test | 12 - tests-m32/xchownx.c | 38 +- tests-m32/xet_robust_list.c | 27 +- tests-m32/xet_robust_list.gen.test | 4 + tests-m32/xet_robust_list.test | 6 - tests-m32/xet_thread_area_x86.c | 206 + tests-m32/xet_thread_area_x86.test | 16 + tests-m32/xetitimer.c | 195 +- tests-m32/xetitimer.gen.test | 4 + tests-m32/xetitimer.test | 6 - tests-m32/xetpgid.c | 30 +- tests-m32/xetpgid.gen.test | 4 + tests-m32/xetpgid.test | 6 - tests-m32/xetpriority.c | 12 +- tests-m32/xetpriority.gen.test | 4 + tests-m32/xetpriority.test | 6 - tests-m32/xettimeofday.c | 84 +- tests-m32/xettimeofday.gen.test | 4 + tests-m32/xettimeofday.test | 6 - tests-m32/xgetrlimit.c | 75 +- tests-m32/xselect.c | 485 +- tests-m32/xstatfs.c | 24 +- tests-m32/xstatfs64.c | 24 +- tests-m32/xstatfsx.c | 44 +- tests-m32/xstatx.c | 369 +- tests-m32/xutimes.c | 129 + tests-m32/zeroargc.c | 23 + tests-mx32/COPYING | 11 + tests-mx32/GPL-2.0-or-later | 339 + tests-mx32/Makefile.am | 977 +- tests-mx32/Makefile.in | 8783 +++++- tests-mx32/PTRACE_SEIZE.sh | 13 + tests-mx32/_newselect-P.c | 2 + tests-mx32/_newselect-P.gen.test | 4 + tests-mx32/_newselect.c | 24 +- tests-mx32/_newselect.gen.test | 4 + tests-mx32/_newselect.test | 5 - tests-mx32/accept.c | 54 +- tests-mx32/accept.gen.test | 4 + tests-mx32/accept.test | 6 - tests-mx32/accept4.c | 24 +- tests-mx32/accept4.gen.test | 4 + tests-mx32/accept4.test | 6 - tests-mx32/accept_compat.h | 32 + tests-mx32/access.c | 8 + tests-mx32/access.gen.test | 4 + tests-mx32/access.test | 15 - tests-mx32/acct.c | 7 + tests-mx32/acct.gen.test | 4 + tests-mx32/acct.test | 6 - tests-mx32/add_key.c | 34 +- tests-mx32/add_key.gen.test | 4 + tests-mx32/add_key.test | 6 - tests-mx32/adjtimex.c | 69 +- tests-mx32/adjtimex.gen.test | 4 + tests-mx32/adjtimex.test | 12 - tests-mx32/aio.c | 111 +- tests-mx32/aio.gen.test | 4 + tests-mx32/aio.test | 8 - tests-mx32/aio_pgetevents.c | 170 + tests-mx32/aio_pgetevents.gen.test | 4 + tests-mx32/alarm.c | 24 +- tests-mx32/alarm.gen.test | 4 + tests-mx32/alarm.test | 6 - tests-mx32/answer.c | 24 +- tests-mx32/attach-f-p-cmd.c | 25 +- tests-mx32/attach-f-p.c | 24 +- tests-mx32/attach-f-p.test | 38 +- tests-mx32/attach-p-cmd-cmd.c | 54 +- tests-mx32/attach-p-cmd-p.c | 87 +- tests-mx32/attach-p-cmd.h | 9 + tests-mx32/attach-p-cmd.test | 36 +- tests-mx32/bexecve.test | 29 +- tests-mx32/block_reset_raise_run.c | 35 + tests-mx32/bpf-obj_get_info_by_fd-prog-v.c | 3 + .../bpf-obj_get_info_by_fd-prog-v.gen.test | 4 + tests-mx32/bpf-obj_get_info_by_fd-prog.c | 2 + .../bpf-obj_get_info_by_fd-prog.gen.test | 4 + tests-mx32/bpf-obj_get_info_by_fd-v.c | 2 + tests-mx32/bpf-obj_get_info_by_fd-v.gen.test | 4 + tests-mx32/bpf-obj_get_info_by_fd.c | 608 + tests-mx32/bpf-obj_get_info_by_fd.gen.test | 4 + tests-mx32/bpf-success-v.c | 2 + tests-mx32/bpf-success-v.test | 11 + tests-mx32/bpf-success.c | 2 + tests-mx32/bpf-success.test | 11 + tests-mx32/bpf-v.c | 3 + tests-mx32/bpf-v.gen.test | 4 + tests-mx32/bpf.c | 1372 +- tests-mx32/bpf.gen.test | 4 + tests-mx32/bpf.test | 6 - tests-mx32/brk.c | 7 + tests-mx32/brk.test | 8 +- tests-mx32/btrfs-X.test | 16 + tests-mx32/btrfs-v.test | 17 +- tests-mx32/btrfs-vX.test | 16 + tests-mx32/btrfs-vw.test | 15 +- tests-mx32/btrfs-vwX.test | 30 + tests-mx32/btrfs-w.test | 15 +- tests-mx32/btrfs-wX.test | 30 + tests-mx32/btrfs.c | 1150 +- tests-mx32/btrfs.gen.test | 4 + tests-mx32/btrfs.test | 5 - tests-mx32/caps-abbrev.awk | 24 +- tests-mx32/caps-abbrev.test | 7 +- tests-mx32/caps.awk | 24 +- tests-mx32/caps.c | 24 +- tests-mx32/caps.test | 7 +- tests-mx32/check_sigblock.c | 29 + tests-mx32/check_sigign.c | 29 + tests-mx32/chmod.c | 32 +- tests-mx32/chmod.gen.test | 4 + tests-mx32/chmod.test | 6 - tests-mx32/chown.c | 7 + tests-mx32/chown.gen.test | 4 + tests-mx32/chown.test | 6 - tests-mx32/chown32.c | 7 + tests-mx32/chown32.gen.test | 4 + tests-mx32/chown32.test | 6 - tests-mx32/chroot.c | 7 + tests-mx32/chroot.gen.test | 4 + tests-mx32/chroot.test | 6 - tests-mx32/clock.gen.test | 4 + tests-mx32/clock.in | 3 + tests-mx32/clock_adjtime.c | 24 +- tests-mx32/clock_adjtime.gen.test | 4 + tests-mx32/clock_adjtime.test | 6 - tests-mx32/clock_nanosleep.c | 93 +- tests-mx32/clock_nanosleep.gen.test | 4 + tests-mx32/clock_nanosleep.test | 6 - tests-mx32/clock_xettime.c | 67 +- tests-mx32/clock_xettime.gen.test | 4 + tests-mx32/clock_xettime.test | 6 - tests-mx32/clone_parent.c | 60 + tests-mx32/clone_parent.test | 10 + tests-mx32/clone_ptrace.c | 90 + tests-mx32/clone_ptrace.test | 24 + tests-mx32/copy_file_range.c | 27 +- tests-mx32/copy_file_range.gen.test | 4 + tests-mx32/copy_file_range.test | 6 - tests-mx32/count-f.c | 24 +- tests-mx32/count-f.test | 9 +- tests-mx32/count.test | 31 +- tests-mx32/creat.c | 7 + tests-mx32/creat.gen.test | 4 + tests-mx32/creat.test | 6 - tests-mx32/create_nl_socket.c | 33 + tests-mx32/delay.c | 115 + tests-mx32/delay.test | 16 + tests-mx32/delete_module.c | 28 +- tests-mx32/delete_module.gen.test | 4 + tests-mx32/delete_module.test | 6 - tests-mx32/detach-running.test | 47 +- tests-mx32/detach-sleeping.test | 42 +- tests-mx32/detach-stopped.test | 48 +- tests-mx32/dev-yy.c | 81 + tests-mx32/dev-yy.gen.test | 4 + tests-mx32/dup.c | 7 + tests-mx32/dup.gen.test | 4 + tests-mx32/dup.test | 6 - tests-mx32/dup2.c | 7 + tests-mx32/dup2.gen.test | 4 + tests-mx32/dup2.test | 6 - tests-mx32/dup3.c | 9 +- tests-mx32/dup3.gen.test | 4 + tests-mx32/dup3.test | 6 - tests-mx32/epoll_create.c | 7 + tests-mx32/epoll_create.gen.test | 4 + tests-mx32/epoll_create.test | 6 - tests-mx32/epoll_create1.c | 24 +- tests-mx32/epoll_create1.gen.test | 4 + tests-mx32/epoll_create1.test | 6 - tests-mx32/epoll_ctl.c | 13 +- tests-mx32/epoll_ctl.gen.test | 4 + tests-mx32/epoll_ctl.test | 6 - tests-mx32/epoll_pwait.c | 9 +- tests-mx32/epoll_pwait.gen.test | 4 + tests-mx32/epoll_pwait.test | 6 - tests-mx32/epoll_wait.c | 9 +- tests-mx32/epoll_wait.gen.test | 4 + tests-mx32/epoll_wait.test | 6 - tests-mx32/erestartsys.c | 24 +- tests-mx32/erestartsys.gen.test | 4 + tests-mx32/erestartsys.test | 6 - tests-mx32/errno2name.c | 26 +- tests-mx32/error_msg.c | 26 +- tests-mx32/eventfd.c | 24 +- tests-mx32/eventfd.test | 7 +- tests-mx32/execve-v.test | 9 +- tests-mx32/execve.c | 76 +- tests-mx32/execve.test | 9 +- tests-mx32/execveat-v.gen.test | 4 + tests-mx32/execveat-v.test | 6 - tests-mx32/execveat.c | 128 +- tests-mx32/execveat.gen.test | 4 + tests-mx32/execveat.test | 6 - tests-mx32/faccessat.c | 7 + tests-mx32/faccessat.gen.test | 4 + tests-mx32/faccessat.test | 5 - tests-mx32/fadvise.h | 25 +- tests-mx32/fadvise64.c | 23 +- tests-mx32/fadvise64.test | 8 +- tests-mx32/fadvise64_64.c | 23 +- tests-mx32/fadvise64_64.gen.test | 4 + tests-mx32/fadvise64_64.test | 5 - tests-mx32/fallocate.c | 23 +- tests-mx32/fallocate.gen.test | 4 + tests-mx32/fallocate.test | 6 - tests-mx32/fanotify_init.c | 35 +- tests-mx32/fanotify_init.gen.test | 4 + tests-mx32/fanotify_init.test | 6 - tests-mx32/fanotify_mark-Xabbrev.c | 1 + tests-mx32/fanotify_mark-Xabbrev.gen.test | 4 + tests-mx32/fanotify_mark-Xraw.c | 2 + tests-mx32/fanotify_mark-Xraw.gen.test | 4 + tests-mx32/fanotify_mark-Xverbose.c | 2 + tests-mx32/fanotify_mark-Xverbose.gen.test | 4 + tests-mx32/fanotify_mark.c | 143 +- tests-mx32/fanotify_mark.gen.test | 4 + tests-mx32/fanotify_mark.test | 6 - tests-mx32/fchdir.c | 7 + tests-mx32/fchdir.gen.test | 4 + tests-mx32/fchdir.test | 6 - tests-mx32/fchmod.c | 23 +- tests-mx32/fchmod.gen.test | 4 + tests-mx32/fchmod.test | 6 - tests-mx32/fchmodat.c | 24 +- tests-mx32/fchmodat.gen.test | 4 + tests-mx32/fchmodat.test | 6 - tests-mx32/fchown.c | 7 + tests-mx32/fchown.gen.test | 4 + tests-mx32/fchown.test | 6 - tests-mx32/fchown32.c | 7 + tests-mx32/fchown32.gen.test | 4 + tests-mx32/fchown32.test | 6 - tests-mx32/fchownat.c | 24 +- tests-mx32/fchownat.gen.test | 4 + tests-mx32/fchownat.test | 6 - tests-mx32/fcntl-common.c | 379 + tests-mx32/fcntl.c | 66 +- tests-mx32/fcntl.gen.test | 4 + tests-mx32/fcntl.test | 6 - tests-mx32/fcntl64.c | 77 +- tests-mx32/fcntl64.gen.test | 4 + tests-mx32/fcntl64.test | 5 - tests-mx32/fdatasync.c | 7 + tests-mx32/fdatasync.gen.test | 4 + tests-mx32/fdatasync.test | 6 - tests-mx32/fflush.c | 22 + tests-mx32/fflush.test | 21 + tests-mx32/file_handle.c | 32 +- tests-mx32/file_handle.gen.test | 4 + tests-mx32/file_handle.test | 6 - tests-mx32/file_ioctl.c | 9 +- tests-mx32/file_ioctl.gen.test | 4 + tests-mx32/file_ioctl.test | 5 - tests-mx32/fill_memory.c | 9 +- tests-mx32/filter-unavailable.c | 24 +- tests-mx32/filter-unavailable.test | 9 +- tests-mx32/filtering_fd-syntax.test | 40 + tests-mx32/filtering_syscall-syntax.test | 101 + tests-mx32/finit_module.c | 26 +- tests-mx32/finit_module.gen.test | 4 + tests-mx32/finit_module.test | 6 - tests-mx32/first_exec_failure.test | 30 + tests-mx32/flock.c | 7 + tests-mx32/flock.gen.test | 4 + tests-mx32/flock.test | 6 - tests-mx32/fork-f.c | 24 +- tests-mx32/fork-f.gen.test | 4 + tests-mx32/fork-f.test | 6 - tests-mx32/fstat-Xabbrev.c | 1 + tests-mx32/fstat-Xabbrev.gen.test | 4 + tests-mx32/fstat-Xraw.c | 2 + tests-mx32/fstat-Xraw.gen.test | 4 + tests-mx32/fstat-Xverbose.c | 2 + tests-mx32/fstat-Xverbose.gen.test | 4 + tests-mx32/fstat.c | 23 +- tests-mx32/fstat.gen.test | 4 + tests-mx32/fstat.test | 19 - tests-mx32/fstat64-Xabbrev.c | 1 + tests-mx32/fstat64-Xabbrev.gen.test | 4 + tests-mx32/fstat64-Xraw.c | 2 + tests-mx32/fstat64-Xraw.gen.test | 4 + tests-mx32/fstat64-Xverbose.c | 2 + tests-mx32/fstat64-Xverbose.gen.test | 4 + tests-mx32/fstat64.c | 23 +- tests-mx32/fstat64.gen.test | 4 + tests-mx32/fstat64.test | 5 - tests-mx32/fstatat.c | 23 +- tests-mx32/fstatat64.c | 23 +- tests-mx32/fstatat64.gen.test | 4 + tests-mx32/fstatat64.test | 5 - tests-mx32/fstatfs.c | 24 +- tests-mx32/fstatfs.gen.test | 4 + tests-mx32/fstatfs.test | 5 - tests-mx32/fstatfs64.c | 24 +- tests-mx32/fstatfs64.gen.test | 4 + tests-mx32/fstatfs64.test | 5 - tests-mx32/fstatx.c | 23 +- tests-mx32/fsync-y.c | 51 + tests-mx32/fsync-y.gen.test | 4 + tests-mx32/fsync.c | 7 + tests-mx32/fsync.gen.test | 4 + tests-mx32/fsync.test | 6 - tests-mx32/ftruncate.c | 24 +- tests-mx32/ftruncate.gen.test | 4 + tests-mx32/ftruncate.test | 6 - tests-mx32/ftruncate64.c | 24 +- tests-mx32/ftruncate64.gen.test | 4 + tests-mx32/ftruncate64.test | 6 - tests-mx32/futex.c | 327 +- tests-mx32/futex.test | 7 +- tests-mx32/futimesat.c | 167 +- tests-mx32/futimesat.gen.test | 4 + tests-mx32/futimesat.test | 6 - tests-mx32/gen_pure_executables.sh | 30 + tests-mx32/gen_tests.am | 1574 ++ tests-mx32/gen_tests.in | 531 + tests-mx32/gen_tests.sh | 92 + tests-mx32/get_mempolicy.c | 24 +- tests-mx32/get_mempolicy.gen.test | 4 + tests-mx32/get_mempolicy.test | 6 - tests-mx32/get_page_size.c | 7 + tests-mx32/get_regs.test | 33 + tests-mx32/get_sigset_size.c | 46 + tests-mx32/getcpu.c | 35 +- tests-mx32/getcpu.gen.test | 4 + tests-mx32/getcpu.test | 6 - tests-mx32/getcwd.c | 13 +- tests-mx32/getcwd.gen.test | 4 + tests-mx32/getcwd.test | 6 - tests-mx32/getdents.c | 29 +- tests-mx32/getdents.gen.test | 4 + tests-mx32/getdents.test | 8 - tests-mx32/getdents64.c | 29 +- tests-mx32/getdents64.gen.test | 4 + tests-mx32/getdents64.test | 8 - tests-mx32/getegid.c | 7 + tests-mx32/getegid.gen.test | 4 + tests-mx32/getegid.test | 5 - tests-mx32/getegid32.c | 7 + tests-mx32/getegid32.gen.test | 4 + tests-mx32/getegid32.test | 5 - tests-mx32/geteuid.c | 7 + tests-mx32/geteuid.gen.test | 4 + tests-mx32/geteuid.test | 5 - tests-mx32/geteuid32.c | 7 + tests-mx32/geteuid32.gen.test | 4 + tests-mx32/geteuid32.test | 5 - tests-mx32/getgid.c | 7 + tests-mx32/getgid.gen.test | 4 + tests-mx32/getgid.test | 5 - tests-mx32/getgid32.c | 7 + tests-mx32/getgid32.gen.test | 4 + tests-mx32/getgid32.test | 5 - tests-mx32/getgroups.c | 29 +- tests-mx32/getgroups.gen.test | 4 + tests-mx32/getgroups.test | 6 - tests-mx32/getgroups32.c | 7 + tests-mx32/getgroups32.gen.test | 4 + tests-mx32/getgroups32.test | 6 - tests-mx32/getpeername.c | 24 +- tests-mx32/getpeername.gen.test | 4 + tests-mx32/getpeername.test | 5 - tests-mx32/getpgrp.c | 7 + tests-mx32/getpgrp.gen.test | 4 + tests-mx32/getpgrp.test | 6 - tests-mx32/getpid.c | 28 + tests-mx32/getpid.gen.test | 4 + tests-mx32/getppid.c | 28 + tests-mx32/getppid.gen.test | 4 + tests-mx32/getrandom.c | 24 +- tests-mx32/getrandom.gen.test | 4 + tests-mx32/getrandom.test | 6 - tests-mx32/getresgid.c | 7 + tests-mx32/getresgid.gen.test | 4 + tests-mx32/getresgid.test | 6 - tests-mx32/getresgid32.c | 7 + tests-mx32/getresgid32.gen.test | 4 + tests-mx32/getresgid32.test | 6 - tests-mx32/getresugid.c | 29 +- tests-mx32/getresuid.c | 7 + tests-mx32/getresuid.gen.test | 4 + tests-mx32/getresuid.test | 6 - tests-mx32/getresuid32.c | 7 + tests-mx32/getresuid32.gen.test | 4 + tests-mx32/getresuid32.test | 6 - tests-mx32/getrlimit.c | 7 + tests-mx32/getrlimit.gen.test | 4 + tests-mx32/getrlimit.test | 5 - tests-mx32/getrusage.c | 64 +- tests-mx32/getrusage.gen.test | 4 + tests-mx32/getrusage.test | 6 - tests-mx32/getsid.c | 7 + tests-mx32/getsid.gen.test | 4 + tests-mx32/getsid.test | 6 - tests-mx32/getsockname.c | 24 +- tests-mx32/getsockname.gen.test | 4 + tests-mx32/getsockname.test | 6 - tests-mx32/gettid.c | 19 + tests-mx32/gettid.gen.test | 4 + tests-mx32/getuid.c | 7 + tests-mx32/getuid.test | 8 +- tests-mx32/getuid32.c | 7 + tests-mx32/getuid32.gen.test | 4 + tests-mx32/getuid32.test | 5 - tests-mx32/getxxid.c | 24 +- tests-mx32/getxxid.gen.test | 4 + tests-mx32/getxxid.test | 6 - tests-mx32/group_req.c | 141 + tests-mx32/group_req.gen.test | 4 + tests-mx32/hexdump_strdup.c | 24 +- tests-mx32/hexquote_strndup.c | 24 +- tests-mx32/ifindex.c | 35 + tests-mx32/inet-cmsg.c | 30 +- tests-mx32/inet-cmsg.gen.test | 4 + tests-mx32/inet-cmsg.test | 6 - tests-mx32/init.sh | 176 +- tests-mx32/init_delete_module.h | 28 +- tests-mx32/init_module.c | 27 +- tests-mx32/init_module.gen.test | 4 + tests-mx32/init_module.test | 6 - tests-mx32/inject-nf.c | 66 + tests-mx32/inject-nf.test | 55 + tests-mx32/inode_of_sockfd.c | 25 +- tests-mx32/inotify.c | 27 +- tests-mx32/inotify.gen.test | 4 + tests-mx32/inotify.test | 6 - tests-mx32/inotify_init1.c | 23 +- tests-mx32/inotify_init1.gen.test | 4 + tests-mx32/inotify_init1.test | 6 - tests-mx32/int_0x80.c | 32 + tests-mx32/int_0x80.test | 16 + tests-mx32/interactive_block.test | 20 + tests-mx32/io_uring_enter.c | 83 + tests-mx32/io_uring_enter.gen.test | 4 + tests-mx32/io_uring_register.c | 100 + tests-mx32/io_uring_register.gen.test | 4 + tests-mx32/io_uring_setup.c | 103 + tests-mx32/io_uring_setup.gen.test | 4 + tests-mx32/ioctl.c | 34 +- tests-mx32/ioctl.test | 17 +- tests-mx32/ioctl_block.c | 45 +- tests-mx32/ioctl_block.gen.test | 4 + tests-mx32/ioctl_block.test | 5 - tests-mx32/ioctl_dm-v.gen.test | 4 + tests-mx32/ioctl_dm-v.test | 12 - tests-mx32/ioctl_dm.c | 121 +- tests-mx32/ioctl_dm.gen.test | 4 + tests-mx32/ioctl_dm.test | 12 - tests-mx32/ioctl_evdev-success-v.c | 2 + tests-mx32/ioctl_evdev-success-v.test | 18 + tests-mx32/ioctl_evdev-success.c | 239 + tests-mx32/ioctl_evdev-success.test | 18 + tests-mx32/ioctl_evdev-v.gen.test | 4 + tests-mx32/ioctl_evdev-v.test | 12 - tests-mx32/ioctl_evdev.c | 79 +- tests-mx32/ioctl_evdev.gen.test | 4 + tests-mx32/ioctl_evdev.test | 5 - tests-mx32/ioctl_inotify.c | 61 + tests-mx32/ioctl_inotify.gen.test | 4 + tests-mx32/ioctl_kvm_run-v.c | 2 + tests-mx32/ioctl_kvm_run-v.gen.test | 4 + tests-mx32/ioctl_kvm_run.c | 18 + tests-mx32/ioctl_kvm_run.gen.test | 4 + tests-mx32/ioctl_kvm_run_auxstr_vcpu.c | 31 + tests-mx32/ioctl_kvm_run_auxstr_vcpu.gen.test | 4 + tests-mx32/ioctl_kvm_run_common.c | 412 + tests-mx32/ioctl_loop-nv.gen.test | 4 + tests-mx32/ioctl_loop-nv.test | 12 - tests-mx32/ioctl_loop-v.gen.test | 4 + tests-mx32/ioctl_loop-v.test | 12 - tests-mx32/ioctl_loop.c | 97 +- tests-mx32/ioctl_loop.gen.test | 4 + tests-mx32/ioctl_loop.test | 12 - tests-mx32/ioctl_mtd.c | 93 +- tests-mx32/ioctl_mtd.gen.test | 4 + tests-mx32/ioctl_mtd.test | 5 - tests-mx32/ioctl_nbd.c | 92 + tests-mx32/ioctl_nbd.gen.test | 4 + tests-mx32/ioctl_nsfs.c | 126 + tests-mx32/ioctl_nsfs.gen.test | 4 + tests-mx32/ioctl_perf-success.c | 145 + tests-mx32/ioctl_perf-success.test | 20 + tests-mx32/ioctl_perf.c | 218 + tests-mx32/ioctl_perf.gen.test | 4 + tests-mx32/ioctl_ptp.c | 111 + tests-mx32/ioctl_ptp.gen.test | 4 + tests-mx32/ioctl_random.c | 61 + tests-mx32/ioctl_random.gen.test | 4 + tests-mx32/ioctl_rtc-v.gen.test | 4 + tests-mx32/ioctl_rtc-v.test | 12 - tests-mx32/ioctl_rtc.c | 29 +- tests-mx32/ioctl_rtc.gen.test | 4 + tests-mx32/ioctl_rtc.test | 5 - tests-mx32/ioctl_scsi.c | 32 +- tests-mx32/ioctl_scsi.gen.test | 4 + tests-mx32/ioctl_scsi.test | 4 - tests-mx32/ioctl_sg_io_v3.c | 72 +- tests-mx32/ioctl_sg_io_v3.gen.test | 4 + tests-mx32/ioctl_sg_io_v3.test | 4 - tests-mx32/ioctl_sg_io_v4.c | 56 +- tests-mx32/ioctl_sg_io_v4.gen.test | 4 + tests-mx32/ioctl_sg_io_v4.test | 4 - tests-mx32/ioctl_sock_gifconf.c | 28 +- tests-mx32/ioctl_sock_gifconf.gen.test | 4 + tests-mx32/ioctl_sock_gifconf.test | 12 - tests-mx32/ioctl_uffdio.c | 46 +- tests-mx32/ioctl_uffdio.gen.test | 4 + tests-mx32/ioctl_uffdio.test | 5 - tests-mx32/ioctl_v4l2.c | 656 +- tests-mx32/ioctl_v4l2.gen.test | 4 + tests-mx32/ioctl_v4l2.test | 5 - tests-mx32/ioperm.c | 7 + tests-mx32/ioperm.gen.test | 4 + tests-mx32/ioperm.test | 6 - tests-mx32/iopl.c | 7 + tests-mx32/iopl.gen.test | 4 + tests-mx32/iopl.test | 6 - tests-mx32/ioprio-Xabbrev.c | 1 + tests-mx32/ioprio-Xabbrev.gen.test | 4 + tests-mx32/ioprio-Xraw.c | 2 + tests-mx32/ioprio-Xraw.gen.test | 4 + tests-mx32/ioprio-Xverbose.c | 2 + tests-mx32/ioprio-Xverbose.gen.test | 4 + tests-mx32/ioprio.c | 97 +- tests-mx32/ioprio.gen.test | 4 + tests-mx32/ioprio.test | 6 - tests-mx32/ip_mreq.c | 164 +- tests-mx32/ip_mreq.gen.test | 4 + tests-mx32/ip_mreq.test | 6 - tests-mx32/ipc.c | 24 +- tests-mx32/ipc.gen.test | 4 + tests-mx32/ipc.sh | 13 +- tests-mx32/ipc.test | 6 - tests-mx32/ipc_msg-Xabbrev.c | 1 + tests-mx32/ipc_msg-Xabbrev.gen.test | 4 + tests-mx32/ipc_msg-Xraw.c | 2 + tests-mx32/ipc_msg-Xraw.gen.test | 4 + tests-mx32/ipc_msg-Xverbose.c | 2 + tests-mx32/ipc_msg-Xverbose.gen.test | 4 + tests-mx32/ipc_msg.c | 113 +- tests-mx32/ipc_msg.gen.test | 4 + tests-mx32/ipc_msg.test | 5 - tests-mx32/ipc_msgbuf-Xabbrev.c | 1 + tests-mx32/ipc_msgbuf-Xabbrev.gen.test | 4 + tests-mx32/ipc_msgbuf-Xraw.c | 2 + tests-mx32/ipc_msgbuf-Xraw.gen.test | 4 + tests-mx32/ipc_msgbuf-Xverbose.c | 2 + tests-mx32/ipc_msgbuf-Xverbose.gen.test | 4 + tests-mx32/ipc_msgbuf.c | 92 +- tests-mx32/ipc_msgbuf.expected | 4 - tests-mx32/ipc_msgbuf.test | 11 +- tests-mx32/ipc_sem-Xabbrev.c | 1 + tests-mx32/ipc_sem-Xabbrev.gen.test | 4 + tests-mx32/ipc_sem-Xraw.c | 2 + tests-mx32/ipc_sem-Xraw.gen.test | 4 + tests-mx32/ipc_sem-Xverbose.c | 2 + tests-mx32/ipc_sem-Xverbose.gen.test | 4 + tests-mx32/ipc_sem.c | 103 +- tests-mx32/ipc_sem.gen.test | 4 + tests-mx32/ipc_sem.test | 5 - tests-mx32/ipc_shm-Xabbrev.c | 1 + tests-mx32/ipc_shm-Xabbrev.gen.test | 4 + tests-mx32/ipc_shm-Xraw.c | 2 + tests-mx32/ipc_shm-Xraw.gen.test | 4 + tests-mx32/ipc_shm-Xverbose.c | 2 + tests-mx32/ipc_shm-Xverbose.gen.test | 4 + tests-mx32/ipc_shm.c | 169 +- tests-mx32/ipc_shm.gen.test | 4 + tests-mx32/ipc_shm.test | 5 - tests-mx32/is_linux_mips_n64.c | 25 + tests-mx32/kcmp-y.c | 3 + tests-mx32/kcmp-y.gen.test | 4 + tests-mx32/kcmp.c | 172 +- tests-mx32/kcmp.gen.test | 4 + tests-mx32/kcmp.test | 6 - tests-mx32/kern_features-fault.test | 43 + tests-mx32/kern_features.c | 100 + tests-mx32/kern_features.gen.test | 4 + tests-mx32/kernel_version-Xabbrev.c | 1 + tests-mx32/kernel_version-Xabbrev.gen.test | 4 + tests-mx32/kernel_version-Xraw.c | 2 + tests-mx32/kernel_version-Xraw.gen.test | 4 + tests-mx32/kernel_version-Xverbose.c | 2 + tests-mx32/kernel_version-Xverbose.gen.test | 4 + tests-mx32/kernel_version.c | 104 + tests-mx32/kernel_version.gen.test | 4 + tests-mx32/kexec_file_load.c | 25 +- tests-mx32/kexec_file_load.gen.test | 4 + tests-mx32/kexec_file_load.test | 6 - tests-mx32/kexec_load.c | 28 +- tests-mx32/kexec_load.gen.test | 4 + tests-mx32/kexec_load.test | 6 - tests-mx32/keyctl-Xabbrev.c | 1 + tests-mx32/keyctl-Xabbrev.gen.test | 4 + tests-mx32/keyctl-Xraw.c | 2 + tests-mx32/keyctl-Xraw.gen.test | 4 + tests-mx32/keyctl-Xverbose.c | 2 + tests-mx32/keyctl-Xverbose.gen.test | 4 + tests-mx32/keyctl.c | 620 +- tests-mx32/keyctl.gen.test | 4 + tests-mx32/keyctl.test | 6 - tests-mx32/kill.c | 25 +- tests-mx32/kill.gen.test | 4 + tests-mx32/kill.test | 6 - tests-mx32/kill_child.c | 69 + tests-mx32/kill_child.test | 31 + tests-mx32/ksysent.c | 39 +- tests-mx32/ksysent.sed | 9 +- tests-mx32/ksysent.test | 5 + tests-mx32/lchown.c | 7 + tests-mx32/lchown.gen.test | 4 + tests-mx32/lchown.test | 6 - tests-mx32/lchown32.c | 7 + tests-mx32/lchown32.gen.test | 4 + tests-mx32/lchown32.test | 6 - tests-mx32/libmmsg.c | 24 +- tests-mx32/libsocketcall.c | 28 +- tests-mx32/link.c | 7 + tests-mx32/link.gen.test | 4 + tests-mx32/link.test | 6 - tests-mx32/linkat.c | 7 + tests-mx32/linkat.gen.test | 4 + tests-mx32/linkat.test | 6 - tests-mx32/list_sigaction_signum.c | 37 + tests-mx32/llseek.c | 24 +- tests-mx32/llseek.test | 13 +- tests-mx32/localtime.c | 37 + tests-mx32/localtime.test | 18 + tests-mx32/lookup_dcookie.c | 23 +- tests-mx32/lookup_dcookie.gen.test | 4 + tests-mx32/lookup_dcookie.test | 6 - tests-mx32/looping_threads.c | 121 + tests-mx32/looping_threads.test | 38 + tests-mx32/lseek.c | 24 +- tests-mx32/lseek.test | 11 +- tests-mx32/lstat.c | 23 +- tests-mx32/lstat.gen.test | 4 + tests-mx32/lstat.test | 5 - tests-mx32/lstat64.c | 23 +- tests-mx32/lstat64.gen.test | 4 + tests-mx32/lstat64.test | 5 - tests-mx32/lstatx.c | 23 +- tests-mx32/madvise.c | 59 + tests-mx32/madvise.gen.test | 4 + tests-mx32/match.awk | 24 +- tests-mx32/mbind.c | 24 +- tests-mx32/mbind.gen.test | 4 + tests-mx32/mbind.test | 6 - tests-mx32/membarrier.c | 72 +- tests-mx32/membarrier.gen.test | 4 + tests-mx32/membarrier.test | 6 - tests-mx32/memfd_create-Xabbrev.c | 1 + tests-mx32/memfd_create-Xabbrev.gen.test | 4 + tests-mx32/memfd_create-Xraw.c | 2 + tests-mx32/memfd_create-Xraw.gen.test | 4 + tests-mx32/memfd_create-Xverbose.c | 2 + tests-mx32/memfd_create-Xverbose.gen.test | 4 + tests-mx32/memfd_create.c | 96 +- tests-mx32/memfd_create.gen.test | 4 + tests-mx32/memfd_create.test | 6 - tests-mx32/migrate_pages.c | 24 +- tests-mx32/migrate_pages.gen.test | 4 + tests-mx32/migrate_pages.test | 6 - tests-mx32/mincore.c | 25 +- tests-mx32/mincore.gen.test | 4 + tests-mx32/mincore.test | 6 - tests-mx32/mkdir.c | 7 + tests-mx32/mkdir.gen.test | 4 + tests-mx32/mkdir.test | 6 - tests-mx32/mkdirat.c | 7 + tests-mx32/mkdirat.gen.test | 4 + tests-mx32/mkdirat.test | 6 - tests-mx32/mknod.c | 18 +- tests-mx32/mknod.gen.test | 4 + tests-mx32/mknod.test | 6 - tests-mx32/mknodat.c | 13 +- tests-mx32/mknodat.gen.test | 4 + tests-mx32/mknodat.test | 6 - tests-mx32/mlock.c | 7 + tests-mx32/mlock.gen.test | 4 + tests-mx32/mlock.test | 6 - tests-mx32/mlock2.c | 24 +- tests-mx32/mlock2.gen.test | 4 + tests-mx32/mlock2.test | 6 - tests-mx32/mlockall.c | 24 +- tests-mx32/mlockall.gen.test | 4 + tests-mx32/mlockall.test | 6 - tests-mx32/mmap-Xabbrev.c | 1 + tests-mx32/mmap-Xabbrev.gen.test | 4 + tests-mx32/mmap-Xraw.c | 2 + tests-mx32/mmap-Xraw.gen.test | 4 + tests-mx32/mmap-Xverbose.c | 2 + tests-mx32/mmap-Xverbose.gen.test | 4 + tests-mx32/mmap.c | 84 +- tests-mx32/mmap.test | 40 +- tests-mx32/mmap64-Xabbrev.c | 1 + tests-mx32/mmap64-Xabbrev.gen.test | 4 + tests-mx32/mmap64-Xraw.c | 2 + tests-mx32/mmap64-Xraw.gen.test | 4 + tests-mx32/mmap64-Xverbose.c | 2 + tests-mx32/mmap64-Xverbose.gen.test | 4 + tests-mx32/mmap64.gen.test | 4 + tests-mx32/mmap64.test | 6 - tests-mx32/mmsg-silent.c | 24 +- tests-mx32/mmsg-silent.gen.test | 4 + tests-mx32/mmsg-silent.test | 6 - tests-mx32/mmsg.c | 44 +- tests-mx32/mmsg.gen.test | 4 + tests-mx32/mmsg.test | 6 - tests-mx32/mmsg_name-v.gen.test | 4 + tests-mx32/mmsg_name-v.test | 7 - tests-mx32/mmsg_name.c | 33 +- tests-mx32/mmsg_name.gen.test | 4 + tests-mx32/mmsg_name.test | 7 - tests-mx32/modify_ldt.c | 117 + tests-mx32/modify_ldt.gen.test | 4 + tests-mx32/mount-Xabbrev.c | 1 + tests-mx32/mount-Xabbrev.gen.test | 4 + tests-mx32/mount-Xraw.c | 2 + tests-mx32/mount-Xraw.gen.test | 4 + tests-mx32/mount-Xverbose.c | 2 + tests-mx32/mount-Xverbose.gen.test | 4 + tests-mx32/mount.c | 108 +- tests-mx32/mount.gen.test | 4 + tests-mx32/mount.test | 6 - tests-mx32/move_pages-Xabbrev.c | 1 + tests-mx32/move_pages-Xabbrev.gen.test | 4 + tests-mx32/move_pages-Xraw.c | 2 + tests-mx32/move_pages-Xraw.gen.test | 4 + tests-mx32/move_pages-Xverbose.c | 2 + tests-mx32/move_pages-Xverbose.gen.test | 4 + tests-mx32/move_pages.c | 55 +- tests-mx32/move_pages.gen.test | 4 + tests-mx32/move_pages.test | 6 - tests-mx32/mq.c | 39 +- tests-mx32/mq.gen.test | 4 + tests-mx32/mq.test | 6 - tests-mx32/mq_sendrecv-read.gen.test | 4 + tests-mx32/mq_sendrecv-read.test | 6 - tests-mx32/mq_sendrecv-write.gen.test | 4 + tests-mx32/mq_sendrecv-write.test | 6 - tests-mx32/mq_sendrecv.c | 118 +- tests-mx32/mq_sendrecv.gen.test | 4 + tests-mx32/mq_sendrecv.test | 6 - tests-mx32/msg_control-v.gen.test | 4 + tests-mx32/msg_control-v.test | 6 - tests-mx32/msg_control.c | 380 +- tests-mx32/msg_control.gen.test | 4 + tests-mx32/msg_control.test | 6 - tests-mx32/msg_name.c | 31 +- tests-mx32/msg_name.gen.test | 4 + tests-mx32/msg_name.test | 6 - tests-mx32/munlockall.c | 9 +- tests-mx32/munlockall.gen.test | 4 + tests-mx32/munlockall.test | 6 - tests-mx32/nanosleep.c | 77 +- tests-mx32/nanosleep.gen.test | 4 + tests-mx32/nanosleep.test | 6 - tests-mx32/net-accept-connect.c | 38 +- tests-mx32/net-icmp_filter.c | 31 +- tests-mx32/net-icmp_filter.gen.test | 4 + tests-mx32/net-icmp_filter.test | 6 - tests-mx32/net-packet_mreq-Xabbrev.c | 1 + tests-mx32/net-packet_mreq-Xabbrev.gen.test | 4 + tests-mx32/net-packet_mreq-Xraw.c | 2 + tests-mx32/net-packet_mreq-Xraw.gen.test | 4 + tests-mx32/net-packet_mreq-Xverbose.c | 2 + tests-mx32/net-packet_mreq-Xverbose.gen.test | 4 + tests-mx32/net-packet_mreq.c | 206 + tests-mx32/net-packet_mreq.gen.test | 4 + tests-mx32/net-sockaddr.c | 337 +- tests-mx32/net-sockaddr.gen.test | 4 + tests-mx32/net-sockaddr.test | 6 - tests-mx32/net-tpacket_req.c | 59 + tests-mx32/net-tpacket_req.gen.test | 4 + tests-mx32/net-tpacket_stats-success.c | 2 + tests-mx32/net-tpacket_stats-success.test | 11 + tests-mx32/net-tpacket_stats.c | 154 + tests-mx32/net-tpacket_stats.gen.test | 4 + tests-mx32/net-y-unix.c | 73 +- tests-mx32/net-y-unix.test | 35 +- tests-mx32/net-yy-inet.c | 122 +- tests-mx32/net-yy-inet.test | 35 +- tests-mx32/net-yy-inet6.c | 21 + tests-mx32/net-yy-inet6.gen.test | 4 + tests-mx32/net-yy-netlink.c | 44 +- tests-mx32/net-yy-netlink.test | 35 +- tests-mx32/net-yy-unix.c | 96 +- tests-mx32/net-yy-unix.test | 37 +- tests-mx32/net.expected | 2 +- tests-mx32/net.test | 11 +- tests-mx32/netlink_audit.c | 45 + tests-mx32/netlink_audit.gen.test | 4 + tests-mx32/netlink_crypto.c | 161 + tests-mx32/netlink_crypto.gen.test | 4 + tests-mx32/netlink_generic.c | 61 + tests-mx32/netlink_generic.gen.test | 4 + tests-mx32/netlink_inet_diag.c | 29 +- tests-mx32/netlink_kobject_uevent.c | 143 + tests-mx32/netlink_kobject_uevent.gen.test | 4 + tests-mx32/netlink_netfilter.c | 189 + tests-mx32/netlink_netfilter.gen.test | 4 + tests-mx32/netlink_netlink_diag.c | 36 +- tests-mx32/netlink_protocol.c | 304 +- tests-mx32/netlink_protocol.gen.test | 4 + tests-mx32/netlink_protocol.test | 11 - tests-mx32/netlink_route.c | 477 + tests-mx32/netlink_route.gen.test | 4 + tests-mx32/netlink_selinux.c | 88 + tests-mx32/netlink_selinux.gen.test | 4 + tests-mx32/netlink_sock_diag-v.sh | 13 + tests-mx32/netlink_sock_diag.c | 659 + tests-mx32/netlink_sock_diag.test | 13 + tests-mx32/netlink_unix_diag.c | 33 +- tests-mx32/netlink_xfrm.c | 89 + tests-mx32/netlink_xfrm.gen.test | 4 + tests-mx32/newfstatat.c | 24 +- tests-mx32/newfstatat.gen.test | 4 + tests-mx32/newfstatat.test | 5 - tests-mx32/nfnetlink_acct.c | 100 + tests-mx32/nfnetlink_acct.gen.test | 4 + tests-mx32/nfnetlink_cthelper.c | 100 + tests-mx32/nfnetlink_cthelper.gen.test | 4 + tests-mx32/nfnetlink_ctnetlink.c | 100 + tests-mx32/nfnetlink_ctnetlink.gen.test | 4 + tests-mx32/nfnetlink_ctnetlink_exp.c | 100 + tests-mx32/nfnetlink_ctnetlink_exp.gen.test | 4 + tests-mx32/nfnetlink_cttimeout.c | 104 + tests-mx32/nfnetlink_cttimeout.gen.test | 4 + tests-mx32/nfnetlink_ipset.c | 63 + tests-mx32/nfnetlink_ipset.gen.test | 4 + tests-mx32/nfnetlink_nft_compat.c | 82 + tests-mx32/nfnetlink_nft_compat.gen.test | 4 + tests-mx32/nfnetlink_nftables.c | 100 + tests-mx32/nfnetlink_nftables.gen.test | 4 + tests-mx32/nfnetlink_osf.c | 65 + tests-mx32/nfnetlink_osf.gen.test | 4 + tests-mx32/nfnetlink_queue.c | 63 + tests-mx32/nfnetlink_queue.gen.test | 4 + tests-mx32/nfnetlink_ulog.c | 63 + tests-mx32/nfnetlink_ulog.gen.test | 4 + tests-mx32/nlattr.c | 313 + tests-mx32/nlattr.gen.test | 4 + tests-mx32/nlattr_br_port_msg.c | 74 + tests-mx32/nlattr_br_port_msg.gen.test | 4 + tests-mx32/nlattr_crypto_user_alg.c | 175 + tests-mx32/nlattr_crypto_user_alg.gen.test | 4 + tests-mx32/nlattr_dcbmsg.c | 72 + tests-mx32/nlattr_dcbmsg.gen.test | 4 + tests-mx32/nlattr_fib_rule_hdr.c | 184 + tests-mx32/nlattr_fib_rule_hdr.gen.test | 4 + tests-mx32/nlattr_ifaddrlblmsg.c | 79 + tests-mx32/nlattr_ifaddrlblmsg.gen.test | 4 + tests-mx32/nlattr_ifaddrmsg.c | 138 + tests-mx32/nlattr_ifaddrmsg.gen.test | 4 + tests-mx32/nlattr_ifinfomsg.c | 346 + tests-mx32/nlattr_ifinfomsg.gen.test | 4 + tests-mx32/nlattr_ifla.h | 58 + tests-mx32/nlattr_ifla_af_spec.c | 303 + tests-mx32/nlattr_ifla_af_spec.gen.test | 4 + tests-mx32/nlattr_ifla_brport.c | 72 + tests-mx32/nlattr_ifla_brport.gen.test | 4 + tests-mx32/nlattr_ifla_linkinfo.c | 692 + tests-mx32/nlattr_ifla_linkinfo.gen.test | 4 + tests-mx32/nlattr_ifla_port.c | 64 + tests-mx32/nlattr_ifla_port.gen.test | 4 + tests-mx32/nlattr_ifla_xdp.c | 123 + tests-mx32/nlattr_ifla_xdp.gen.test | 4 + tests-mx32/nlattr_inet_diag_msg.c | 205 + tests-mx32/nlattr_inet_diag_msg.gen.test | 4 + tests-mx32/nlattr_inet_diag_req_compat.c | 85 + .../nlattr_inet_diag_req_compat.gen.test | 4 + tests-mx32/nlattr_inet_diag_req_v2.c | 407 + tests-mx32/nlattr_inet_diag_req_v2.gen.test | 4 + tests-mx32/nlattr_mdba_mdb_entry.c | 167 + tests-mx32/nlattr_mdba_mdb_entry.gen.test | 4 + tests-mx32/nlattr_mdba_router_port.c | 110 + tests-mx32/nlattr_mdba_router_port.gen.test | 4 + tests-mx32/nlattr_ndmsg.c | 104 + tests-mx32/nlattr_ndmsg.gen.test | 4 + tests-mx32/nlattr_ndtmsg.c | 139 + tests-mx32/nlattr_ndtmsg.gen.test | 4 + tests-mx32/nlattr_netconfmsg.c | 71 + tests-mx32/nlattr_netconfmsg.gen.test | 4 + tests-mx32/nlattr_netlink_diag_msg.c | 101 + tests-mx32/nlattr_netlink_diag_msg.gen.test | 4 + tests-mx32/nlattr_nlmsgerr.c | 68 + tests-mx32/nlattr_nlmsgerr.gen.test | 4 + tests-mx32/nlattr_packet_diag_msg.c | 158 + tests-mx32/nlattr_packet_diag_msg.gen.test | 4 + tests-mx32/nlattr_rtgenmsg.c | 72 + tests-mx32/nlattr_rtgenmsg.gen.test | 4 + tests-mx32/nlattr_rtmsg.c | 203 + tests-mx32/nlattr_rtmsg.gen.test | 4 + tests-mx32/nlattr_smc_diag_msg.c | 231 + tests-mx32/nlattr_smc_diag_msg.gen.test | 4 + tests-mx32/nlattr_tc_stats.c | 131 + tests-mx32/nlattr_tc_stats.gen.test | 4 + tests-mx32/nlattr_tca_stab.c | 111 + tests-mx32/nlattr_tca_stab.gen.test | 4 + tests-mx32/nlattr_tcamsg.c | 61 + tests-mx32/nlattr_tcamsg.gen.test | 4 + tests-mx32/nlattr_tcmsg.c | 104 + tests-mx32/nlattr_tcmsg.gen.test | 4 + tests-mx32/nlattr_unix_diag_msg.c | 98 + tests-mx32/nlattr_unix_diag_msg.gen.test | 4 + tests-mx32/nsyscalls-d.c | 2 + tests-mx32/nsyscalls-d.test | 31 + tests-mx32/nsyscalls-nd.test | 9 + tests-mx32/nsyscalls.c | 86 +- tests-mx32/nsyscalls.test | 7 +- tests-mx32/old_mmap-P.c | 3 + tests-mx32/old_mmap-P.gen.test | 4 + tests-mx32/old_mmap-Xabbrev.c | 1 + tests-mx32/old_mmap-Xabbrev.gen.test | 4 + tests-mx32/old_mmap-Xraw.c | 2 + tests-mx32/old_mmap-Xraw.gen.test | 4 + tests-mx32/old_mmap-Xverbose.c | 2 + tests-mx32/old_mmap-Xverbose.gen.test | 4 + tests-mx32/old_mmap-v-none.c | 1 + tests-mx32/old_mmap-v-none.gen.test | 4 + tests-mx32/old_mmap.c | 100 +- tests-mx32/old_mmap.gen.test | 4 + tests-mx32/old_mmap.test | 6 - tests-mx32/oldfstat.c | 23 +- tests-mx32/oldfstat.gen.test | 4 + tests-mx32/oldfstat.test | 19 - tests-mx32/oldlstat.c | 23 +- tests-mx32/oldlstat.gen.test | 4 + tests-mx32/oldlstat.test | 5 - tests-mx32/oldselect-P.c | 2 + tests-mx32/oldselect-P.gen.test | 4 + tests-mx32/oldselect-efault-P.c | 2 + tests-mx32/oldselect-efault-P.gen.test | 4 + tests-mx32/oldselect-efault.c | 58 + tests-mx32/oldselect-efault.gen.test | 4 + tests-mx32/oldselect.c | 75 +- tests-mx32/oldselect.expected | 2 - tests-mx32/oldselect.gen.test | 4 + tests-mx32/oldselect.test | 11 - tests-mx32/oldstat.c | 23 +- tests-mx32/oldstat.gen.test | 4 + tests-mx32/oldstat.test | 5 - tests-mx32/open.c | 38 +- tests-mx32/open.gen.test | 4 + tests-mx32/open.test | 6 - tests-mx32/openat.c | 98 +- tests-mx32/openat.gen.test | 4 + tests-mx32/openat.test | 6 - tests-mx32/opipe.test | 13 +- tests-mx32/options-syntax.test | 154 +- tests-mx32/orphaned_process_group.c | 155 + tests-mx32/orphaned_process_group.gen.test | 4 + tests-mx32/osf_utimes.c | 25 + tests-mx32/osf_utimes.gen.test | 4 + tests-mx32/overflowuid.c | 24 +- tests-mx32/pause.c | 23 +- tests-mx32/pause.gen.test | 4 + tests-mx32/pause.test | 6 - tests-mx32/pc.c | 24 +- tests-mx32/pc.test | 31 +- tests-mx32/perf_event_open.c | 251 +- tests-mx32/perf_event_open.gen.test | 4 + tests-mx32/perf_event_open.test | 7 - tests-mx32/perf_event_open_nonverbose.c | 35 +- .../perf_event_open_nonverbose.gen.test | 4 + tests-mx32/perf_event_open_nonverbose.test | 6 - tests-mx32/perf_event_open_unabbrev.gen.test | 4 + tests-mx32/perf_event_open_unabbrev.test | 7 - tests-mx32/personality-Xabbrev.c | 1 + tests-mx32/personality-Xabbrev.gen.test | 4 + tests-mx32/personality-Xraw.c | 2 + tests-mx32/personality-Xraw.gen.test | 4 + tests-mx32/personality-Xverbose.c | 2 + tests-mx32/personality-Xverbose.gen.test | 4 + tests-mx32/personality.c | 98 +- tests-mx32/personality.test | 14 +- tests-mx32/pidfd_send_signal.c | 71 + tests-mx32/pidfd_send_signal.gen.test | 4 + tests-mx32/pipe.c | 23 +- tests-mx32/pipe.test | 8 +- tests-mx32/pipe2.c | 30 +- tests-mx32/pipe2.gen.test | 4 + tests-mx32/pipe2.test | 6 - tests-mx32/pipe_maxfd.c | 24 +- tests-mx32/pkey_alloc.c | 31 +- tests-mx32/pkey_alloc.gen.test | 4 + tests-mx32/pkey_alloc.test | 6 - tests-mx32/pkey_free.c | 23 +- tests-mx32/pkey_free.gen.test | 4 + tests-mx32/pkey_free.test | 6 - tests-mx32/pkey_mprotect.c | 23 +- tests-mx32/pkey_mprotect.gen.test | 4 + tests-mx32/pkey_mprotect.test | 6 - tests-mx32/poll-P.c | 2 + tests-mx32/poll-P.test | 22 + tests-mx32/poll.c | 177 +- tests-mx32/poll.test | 19 +- tests-mx32/ppoll-P.c | 2 + tests-mx32/ppoll-P.gen.test | 4 + tests-mx32/ppoll-v.c | 3 + tests-mx32/ppoll-v.expected | 3 - tests-mx32/ppoll-v.gen.test | 4 + tests-mx32/ppoll.c | 265 +- tests-mx32/ppoll.expected | 3 - tests-mx32/ppoll.gen.test | 4 + tests-mx32/ppoll.test | 13 - tests-mx32/prctl-arg2-intptr.c | 25 +- tests-mx32/prctl-arg2-intptr.test | 10 +- tests-mx32/prctl-dumpable.c | 29 +- tests-mx32/prctl-dumpable.test | 10 +- tests-mx32/prctl-name.c | 23 +- tests-mx32/prctl-name.test | 10 +- tests-mx32/prctl-no-args.c | 25 +- tests-mx32/prctl-no-args.test | 10 +- tests-mx32/prctl-pdeathsig.c | 25 +- tests-mx32/prctl-pdeathsig.test | 9 +- tests-mx32/prctl-seccomp-filter-v.c | 39 +- tests-mx32/prctl-seccomp-filter-v.test | 9 +- tests-mx32/prctl-seccomp-strict.c | 24 +- tests-mx32/prctl-seccomp-strict.test | 10 +- tests-mx32/prctl-securebits.c | 23 +- tests-mx32/prctl-securebits.test | 10 +- tests-mx32/prctl-spec-inject.c | 148 + tests-mx32/prctl-spec-inject.test | 35 + tests-mx32/prctl-tid_address.c | 25 +- tests-mx32/prctl-tid_address.test | 10 +- tests-mx32/prctl-tsc.c | 25 +- tests-mx32/prctl-tsc.test | 9 +- tests-mx32/pread64-pwrite64.c | 28 +- tests-mx32/pread64-pwrite64.gen.test | 4 + tests-mx32/pread64-pwrite64.test | 18 - tests-mx32/preadv-pwritev.c | 32 +- tests-mx32/preadv-pwritev.gen.test | 4 + tests-mx32/preadv-pwritev.test | 6 - tests-mx32/preadv.c | 32 +- tests-mx32/preadv.gen.test | 4 + tests-mx32/preadv.test | 6 - tests-mx32/preadv2-pwritev2.c | 104 +- tests-mx32/preadv2-pwritev2.gen.test | 4 + tests-mx32/preadv2-pwritev2.test | 6 - tests-mx32/print_maxfd.c | 24 +- tests-mx32/print_quoted_string.c | 114 +- tests-mx32/print_time.c | 54 + tests-mx32/print_user_desc.c | 58 + tests-mx32/printflags.c | 24 +- tests-mx32/printpath-umovestr-legacy.test | 32 + tests-mx32/printpath-umovestr-peekdata.c | 27 + .../printpath-umovestr-peekdata.gen.test | 4 + tests-mx32/printpath-umovestr-undumpable.c | 51 + .../printpath-umovestr-undumpable.gen.test | 4 + tests-mx32/printpath-umovestr.c | 26 + tests-mx32/printpath-umovestr.gen.test | 4 + tests-mx32/printsignal-Xabbrev.c | 1 + tests-mx32/printsignal-Xabbrev.gen.test | 4 + tests-mx32/printsignal-Xraw.c | 2 + tests-mx32/printsignal-Xraw.gen.test | 4 + tests-mx32/printsignal-Xverbose.c | 2 + tests-mx32/printsignal-Xverbose.gen.test | 4 + tests-mx32/printsignal.c | 33 + tests-mx32/printstr.c | 32 +- tests-mx32/printstr.gen.test | 4 + tests-mx32/printstr.test | 6 - tests-mx32/printstrn-umoven-legacy.test | 32 + tests-mx32/printstrn-umoven-peekdata.c | 27 + tests-mx32/printstrn-umoven-peekdata.gen.test | 4 + tests-mx32/printstrn-umoven-undumpable.c | 51 + .../printstrn-umoven-undumpable.gen.test | 4 + tests-mx32/printstrn-umoven.c | 24 + tests-mx32/printstrn-umoven.gen.test | 4 + tests-mx32/printxval.c | 24 +- tests-mx32/prlimit64.c | 24 +- tests-mx32/prlimit64.gen.test | 4 + tests-mx32/prlimit64.test | 6 - tests-mx32/process_vm_readv.c | 7 + tests-mx32/process_vm_readv.gen.test | 4 + tests-mx32/process_vm_readv.test | 6 - tests-mx32/process_vm_readv_writev.c | 44 +- tests-mx32/process_vm_writev.c | 7 + tests-mx32/process_vm_writev.gen.test | 4 + tests-mx32/process_vm_writev.test | 6 - tests-mx32/pselect6.c | 70 +- tests-mx32/pselect6.gen.test | 4 + tests-mx32/pselect6.test | 6 - tests-mx32/ptrace.c | 101 +- tests-mx32/ptrace.gen.test | 4 + tests-mx32/ptrace.test | 6 - tests-mx32/ptrace_syscall_info.c | 460 + tests-mx32/ptrace_syscall_info.gen.test | 4 + tests-mx32/pure_executables.am | 522 + tests-mx32/pure_executables.list | 526 + tests-mx32/pwritev.c | 25 +- tests-mx32/pwritev.gen.test | 4 + tests-mx32/pwritev.test | 6 - tests-mx32/qual_fault-exit_group.test | 31 +- tests-mx32/qual_fault-syntax.test | 47 +- tests-mx32/qual_fault-syscall.test | 3 + tests-mx32/qual_fault.c | 138 +- tests-mx32/qual_fault.test | 65 +- .../qual_inject-error-signal-syscall.test | 3 + tests-mx32/qual_inject-error-signal.c | 24 +- tests-mx32/qual_inject-error-signal.test | 16 +- tests-mx32/qual_inject-retval-syscall.test | 3 + tests-mx32/qual_inject-retval.c | 23 +- tests-mx32/qual_inject-retval.test | 15 +- tests-mx32/qual_inject-signal-syscall.test | 3 + tests-mx32/qual_inject-signal.c | 24 +- tests-mx32/qual_inject-signal.test | 15 +- tests-mx32/qual_inject-syntax.test | 60 +- tests-mx32/qual_signal.c | 24 +- tests-mx32/qual_signal.test | 28 +- tests-mx32/qual_syscall.test | 25 +- tests-mx32/qualify_personality.sh | 74 + tests-mx32/qualify_personality_empty.in | 0 tests-mx32/quotactl-Xabbrev.c | 1 + tests-mx32/quotactl-Xabbrev.gen.test | 4 + tests-mx32/quotactl-Xraw.c | 2 + tests-mx32/quotactl-Xraw.gen.test | 4 + tests-mx32/quotactl-Xverbose.c | 2 + tests-mx32/quotactl-Xverbose.gen.test | 4 + tests-mx32/quotactl-success-v.c | 2 + tests-mx32/quotactl-success-v.test | 11 + tests-mx32/quotactl-success.c | 2 + tests-mx32/quotactl-success.test | 11 + tests-mx32/quotactl-v.gen.test | 4 + tests-mx32/quotactl-v.test | 6 - tests-mx32/quotactl-xfs-success-v.c | 2 + tests-mx32/quotactl-xfs-success-v.test | 11 + tests-mx32/quotactl-xfs-success.c | 2 + tests-mx32/quotactl-xfs-success.test | 11 + tests-mx32/quotactl-xfs-v.gen.test | 4 + tests-mx32/quotactl-xfs-v.test | 6 - tests-mx32/quotactl-xfs.c | 174 +- tests-mx32/quotactl-xfs.gen.test | 4 + tests-mx32/quotactl-xfs.test | 6 - tests-mx32/quotactl.c | 265 +- tests-mx32/quotactl.gen.test | 4 + tests-mx32/quotactl.h | 120 +- tests-mx32/quotactl.test | 6 - tests-mx32/read-write.c | 147 +- tests-mx32/read-write.gen.test | 4 + tests-mx32/read-write.test | 18 - tests-mx32/readahead.c | 27 +- tests-mx32/readahead.gen.test | 4 + tests-mx32/readahead.test | 6 - tests-mx32/readdir.c | 29 +- tests-mx32/readdir.gen.test | 4 + tests-mx32/readdir.test | 8 - tests-mx32/readlink.c | 24 +- tests-mx32/readlink.gen.test | 4 + tests-mx32/readlink.test | 6 - tests-mx32/readlinkat.c | 24 +- tests-mx32/readlinkat.gen.test | 4 + tests-mx32/readlinkat.test | 5 - tests-mx32/readv.c | 35 +- tests-mx32/readv.test | 25 +- tests-mx32/reboot.c | 85 +- tests-mx32/reboot.gen.test | 4 + tests-mx32/reboot.test | 6 - tests-mx32/recvfrom.c | 24 +- tests-mx32/recvfrom.gen.test | 4 + tests-mx32/recvfrom.test | 6 - tests-mx32/recvmmsg-timeout.c | 51 +- tests-mx32/recvmmsg-timeout.gen.test | 4 + tests-mx32/recvmmsg-timeout.test | 6 - tests-mx32/recvmsg.c | 32 +- tests-mx32/recvmsg.gen.test | 4 + tests-mx32/recvmsg.test | 6 - tests-mx32/redirect-fds.c | 24 +- tests-mx32/redirect-fds.test | 28 +- tests-mx32/redirect.test | 25 +- tests-mx32/regex.gen.test | 4 + tests-mx32/regex.in | 2 + tests-mx32/remap_file_pages-Xabbrev.c | 1 + tests-mx32/remap_file_pages-Xabbrev.gen.test | 4 + tests-mx32/remap_file_pages-Xraw.c | 2 + tests-mx32/remap_file_pages-Xraw.gen.test | 4 + tests-mx32/remap_file_pages-Xverbose.c | 2 + tests-mx32/remap_file_pages-Xverbose.gen.test | 4 + tests-mx32/remap_file_pages.c | 123 +- tests-mx32/remap_file_pages.gen.test | 4 + tests-mx32/remap_file_pages.test | 6 - tests-mx32/rename.c | 7 + tests-mx32/rename.gen.test | 4 + tests-mx32/rename.test | 6 - tests-mx32/renameat.c | 7 + tests-mx32/renameat.gen.test | 4 + tests-mx32/renameat.test | 6 - tests-mx32/renameat2.c | 24 +- tests-mx32/renameat2.gen.test | 4 + tests-mx32/renameat2.test | 6 - tests-mx32/request_key.c | 30 +- tests-mx32/request_key.gen.test | 4 + tests-mx32/request_key.test | 6 - tests-mx32/restart_syscall.c | 48 +- tests-mx32/restart_syscall.test | 14 +- tests-mx32/riscv_flush_icache.c | 73 + tests-mx32/riscv_flush_icache.gen.test | 4 + tests-mx32/rmdir.c | 7 + tests-mx32/rmdir.gen.test | 4 + tests-mx32/rmdir.test | 6 - tests-mx32/rt_sigaction.awk | 76 + tests-mx32/rt_sigaction.c | 48 + tests-mx32/rt_sigaction.test | 16 + tests-mx32/rt_sigpending.c | 29 +- tests-mx32/rt_sigpending.gen.test | 4 + tests-mx32/rt_sigpending.test | 6 - tests-mx32/rt_sigprocmask.c | 25 +- tests-mx32/rt_sigprocmask.gen.test | 4 + tests-mx32/rt_sigprocmask.test | 6 - tests-mx32/rt_sigqueueinfo.c | 25 +- tests-mx32/rt_sigqueueinfo.gen.test | 4 + tests-mx32/rt_sigqueueinfo.test | 6 - tests-mx32/rt_sigreturn.c | 59 + tests-mx32/rt_sigreturn.gen.test | 4 + tests-mx32/rt_sigsuspend.c | 25 +- tests-mx32/rt_sigsuspend.gen.test | 4 + tests-mx32/rt_sigsuspend.test | 6 - tests-mx32/rt_sigtimedwait.c | 122 +- tests-mx32/rt_sigtimedwait.gen.test | 4 + tests-mx32/rt_sigtimedwait.test | 6 - tests-mx32/rt_tgsigqueueinfo.c | 36 +- tests-mx32/rt_tgsigqueueinfo.gen.test | 4 + tests-mx32/rt_tgsigqueueinfo.test | 6 - tests-mx32/run.sh | 14 +- tests-mx32/run_expect_termsig.c | 38 + tests-mx32/s390_guarded_storage-v.c | 2 + tests-mx32/s390_guarded_storage-v.gen.test | 4 + tests-mx32/s390_guarded_storage.c | 208 + tests-mx32/s390_guarded_storage.gen.test | 4 + tests-mx32/s390_pci_mmio_read_write.c | 134 + tests-mx32/s390_pci_mmio_read_write.gen.test | 4 + tests-mx32/s390_runtime_instr.c | 78 + tests-mx32/s390_runtime_instr.gen.test | 4 + tests-mx32/s390_sthyi-v.c | 2 + tests-mx32/s390_sthyi-v.gen.test | 4 + tests-mx32/s390_sthyi.c | 763 + tests-mx32/s390_sthyi.gen.test | 4 + tests-mx32/sched.gen.test | 4 + tests-mx32/sched.in | 7 + tests-mx32/sched_get_priority_mxx.c | 9 +- tests-mx32/sched_get_priority_mxx.gen.test | 4 + tests-mx32/sched_get_priority_mxx.test | 6 - tests-mx32/sched_rr_get_interval.c | 15 +- tests-mx32/sched_rr_get_interval.gen.test | 4 + tests-mx32/sched_rr_get_interval.test | 6 - tests-mx32/sched_xetaffinity.c | 24 +- tests-mx32/sched_xetaffinity.gen.test | 4 + tests-mx32/sched_xetaffinity.test | 6 - tests-mx32/sched_xetattr.c | 338 +- tests-mx32/sched_xetattr.gen.test | 4 + tests-mx32/sched_xetattr.test | 12 - tests-mx32/sched_xetparam.c | 7 + tests-mx32/sched_xetparam.gen.test | 4 + tests-mx32/sched_xetparam.test | 6 - tests-mx32/sched_xetscheduler.c | 9 +- tests-mx32/sched_xetscheduler.gen.test | 4 + tests-mx32/sched_xetscheduler.test | 6 - tests-mx32/sched_yield.c | 7 + tests-mx32/sched_yield.gen.test | 4 + tests-mx32/sched_yield.test | 6 - tests-mx32/scm_rights-fd.test | 44 +- tests-mx32/scm_rights.c | 27 +- tests-mx32/scno_tampering.sh | 36 +- tests-mx32/seccomp-filter-v.c | 54 +- tests-mx32/seccomp-filter-v.gen.test | 4 + tests-mx32/seccomp-filter-v.test | 6 - tests-mx32/seccomp-filter.c | 38 +- tests-mx32/seccomp-filter.gen.test | 4 + tests-mx32/seccomp-filter.test | 6 - tests-mx32/seccomp-strict.c | 24 +- tests-mx32/seccomp-strict.test | 10 +- tests-mx32/seccomp_get_action_avail.c | 108 + tests-mx32/seccomp_get_action_avail.gen.test | 4 + tests-mx32/select-P.c | 2 + tests-mx32/select-P.gen.test | 4 + tests-mx32/select.c | 24 +- tests-mx32/select.gen.test | 4 + tests-mx32/select.test | 6 - tests-mx32/semop.c | 56 +- tests-mx32/semop.gen.test | 4 + tests-mx32/semop.test | 6 - tests-mx32/sendfile.c | 99 +- tests-mx32/sendfile.gen.test | 4 + tests-mx32/sendfile.test | 6 - tests-mx32/sendfile64.c | 94 +- tests-mx32/sendfile64.gen.test | 4 + tests-mx32/sendfile64.test | 6 - tests-mx32/set_mempolicy.c | 25 +- tests-mx32/set_mempolicy.gen.test | 4 + tests-mx32/set_mempolicy.test | 6 - tests-mx32/set_ptracer_any.c | 35 +- tests-mx32/set_sigblock.c | 33 + tests-mx32/set_sigign.c | 29 + tests-mx32/setdomainname.c | 7 + tests-mx32/setdomainname.gen.test | 4 + tests-mx32/setdomainname.test | 6 - tests-mx32/setfsgid.c | 7 + tests-mx32/setfsgid.gen.test | 4 + tests-mx32/setfsgid.test | 6 - tests-mx32/setfsgid32.c | 7 + tests-mx32/setfsgid32.gen.test | 4 + tests-mx32/setfsgid32.test | 6 - tests-mx32/setfsugid.c | 25 +- tests-mx32/setfsuid.c | 7 + tests-mx32/setfsuid.gen.test | 4 + tests-mx32/setfsuid.test | 6 - tests-mx32/setfsuid32.c | 7 + tests-mx32/setfsuid32.gen.test | 4 + tests-mx32/setfsuid32.test | 6 - tests-mx32/setgid.c | 7 + tests-mx32/setgid.gen.test | 4 + tests-mx32/setgid.test | 6 - tests-mx32/setgid32.c | 7 + tests-mx32/setgid32.gen.test | 4 + tests-mx32/setgid32.test | 6 - tests-mx32/setgroups.c | 35 +- tests-mx32/setgroups.gen.test | 4 + tests-mx32/setgroups.test | 6 - tests-mx32/setgroups32.c | 7 + tests-mx32/setgroups32.gen.test | 4 + tests-mx32/setgroups32.test | 6 - tests-mx32/sethostname.c | 35 +- tests-mx32/sethostname.gen.test | 4 + tests-mx32/sethostname.test | 6 - tests-mx32/setns.c | 23 +- tests-mx32/setns.gen.test | 4 + tests-mx32/setns.test | 6 - tests-mx32/setregid.c | 7 + tests-mx32/setregid.gen.test | 4 + tests-mx32/setregid.test | 6 - tests-mx32/setregid32.c | 7 + tests-mx32/setregid32.gen.test | 4 + tests-mx32/setregid32.test | 6 - tests-mx32/setresgid.c | 7 + tests-mx32/setresgid.gen.test | 4 + tests-mx32/setresgid.test | 6 - tests-mx32/setresgid32.c | 7 + tests-mx32/setresgid32.gen.test | 4 + tests-mx32/setresgid32.test | 6 - tests-mx32/setresugid.c | 24 +- tests-mx32/setresuid.c | 7 + tests-mx32/setresuid.gen.test | 4 + tests-mx32/setresuid.test | 6 - tests-mx32/setresuid32.c | 7 + tests-mx32/setresuid32.gen.test | 4 + tests-mx32/setresuid32.test | 6 - tests-mx32/setreugid.c | 24 +- tests-mx32/setreuid.c | 7 + tests-mx32/setreuid.gen.test | 4 + tests-mx32/setreuid.test | 6 - tests-mx32/setreuid32.c | 7 + tests-mx32/setreuid32.gen.test | 4 + tests-mx32/setreuid32.test | 6 - tests-mx32/setrlimit-Xabbrev.c | 1 + tests-mx32/setrlimit-Xabbrev.gen.test | 4 + tests-mx32/setrlimit-Xraw.c | 2 + tests-mx32/setrlimit-Xraw.gen.test | 4 + tests-mx32/setrlimit-Xverbose.c | 2 + tests-mx32/setrlimit-Xverbose.gen.test | 4 + tests-mx32/setrlimit.c | 47 +- tests-mx32/setrlimit.gen.test | 4 + tests-mx32/setrlimit.test | 6 - tests-mx32/setugid.c | 30 +- tests-mx32/setuid.c | 7 + tests-mx32/setuid.gen.test | 4 + tests-mx32/setuid.test | 6 - tests-mx32/setuid32.c | 7 + tests-mx32/setuid32.gen.test | 4 + tests-mx32/setuid32.test | 6 - tests-mx32/shmxt.c | 36 +- tests-mx32/shmxt.gen.test | 4 + tests-mx32/shmxt.test | 12 - tests-mx32/shutdown.c | 7 + tests-mx32/shutdown.gen.test | 4 + tests-mx32/shutdown.test | 6 - tests-mx32/sigaction.awk | 95 - tests-mx32/sigaction.c | 222 +- tests-mx32/sigaction.gen.test | 4 + tests-mx32/sigaction.test | 11 - tests-mx32/sigaltstack.c | 7 + tests-mx32/sigaltstack.test | 7 +- tests-mx32/sigblock.test | 27 + tests-mx32/sigign.test | 27 + tests-mx32/siginfo.c | 24 +- tests-mx32/siginfo.gen.test | 4 + tests-mx32/siginfo.test | 6 - tests-mx32/signal.c | 112 + tests-mx32/signal.gen.test | 4 + tests-mx32/signal2name.c | 10 +- tests-mx32/signal_receive.c | 112 +- tests-mx32/signal_receive.gen.test | 4 + tests-mx32/signal_receive.test | 6 - tests-mx32/signalfd4.c | 47 +- tests-mx32/signalfd4.gen.test | 4 + tests-mx32/signalfd4.test | 6 - tests-mx32/sigpending.c | 86 + tests-mx32/sigpending.gen.test | 4 + tests-mx32/sigprocmask.c | 131 + tests-mx32/sigprocmask.gen.test | 4 + tests-mx32/sigreturn.c | 85 +- tests-mx32/sigreturn.gen.test | 4 + tests-mx32/sigreturn.test | 48 - tests-mx32/sigsuspend.c | 97 + tests-mx32/sigsuspend.gen.test | 4 + tests-mx32/skip_unavailable.c | 20 + tests-mx32/sleep.c | 24 +- tests-mx32/so_error.c | 103 + tests-mx32/so_error.gen.test | 4 + tests-mx32/so_linger.c | 161 + tests-mx32/so_linger.gen.test | 4 + tests-mx32/so_peercred-Xabbrev.c | 1 + tests-mx32/so_peercred-Xabbrev.gen.test | 4 + tests-mx32/so_peercred-Xraw.c | 2 + tests-mx32/so_peercred-Xraw.gen.test | 4 + tests-mx32/so_peercred-Xverbose.c | 2 + tests-mx32/so_peercred-Xverbose.gen.test | 4 + tests-mx32/so_peercred.c | 190 + tests-mx32/so_peercred.gen.test | 4 + tests-mx32/sock_filter-v-Xabbrev.c | 1 + tests-mx32/sock_filter-v-Xabbrev.gen.test | 4 + tests-mx32/sock_filter-v-Xraw.c | 2 + tests-mx32/sock_filter-v-Xraw.gen.test | 4 + tests-mx32/sock_filter-v-Xverbose.c | 2 + tests-mx32/sock_filter-v-Xverbose.gen.test | 4 + tests-mx32/sock_filter-v.c | 211 + tests-mx32/sock_filter-v.gen.test | 4 + tests-mx32/sockaddr_xlat-Xabbrev.c | 1 + tests-mx32/sockaddr_xlat-Xabbrev.gen.test | 4 + tests-mx32/sockaddr_xlat-Xraw.c | 2 + tests-mx32/sockaddr_xlat-Xraw.gen.test | 4 + tests-mx32/sockaddr_xlat-Xverbose.c | 2 + tests-mx32/sockaddr_xlat-Xverbose.gen.test | 4 + tests-mx32/sockaddr_xlat.c | 271 + tests-mx32/socketcall.c | 24 +- tests-mx32/socketcall.gen.test | 4 + tests-mx32/socketcall.test | 6 - tests-mx32/sockname.c | 31 +- tests-mx32/sockopt-sol_netlink.c | 193 + tests-mx32/sockopt-sol_netlink.gen.test | 4 + tests-mx32/sockopt-timestamp.c | 197 + tests-mx32/sockopt-timestamp.gen.test | 4 + tests-mx32/splice.c | 27 +- tests-mx32/splice.gen.test | 4 + tests-mx32/splice.test | 6 - tests-mx32/sprintrc.c | 26 +- tests-mx32/stack-fcall-0.c | 9 +- tests-mx32/stack-fcall-1.c | 9 +- tests-mx32/stack-fcall-2.c | 9 +- tests-mx32/stack-fcall-3.c | 19 +- tests-mx32/stack-fcall-mangled-0.c | 2 + tests-mx32/stack-fcall-mangled-1.c | 2 + tests-mx32/stack-fcall-mangled-2.c | 2 + tests-mx32/stack-fcall-mangled-3.c | 2 + tests-mx32/stack-fcall-mangled.c | 2 + tests-mx32/stack-fcall.c | 14 +- tests-mx32/stack-fcall.h | 20 + tests-mx32/stat.c | 23 +- tests-mx32/stat.gen.test | 4 + tests-mx32/stat.test | 5 - tests-mx32/stat64.c | 23 +- tests-mx32/stat64.gen.test | 4 + tests-mx32/stat64.test | 5 - tests-mx32/statfs.c | 24 +- tests-mx32/statfs.expected | 1 - tests-mx32/statfs.gen.test | 4 + tests-mx32/statfs.test | 11 - tests-mx32/statfs64.c | 24 +- tests-mx32/statfs64.gen.test | 4 + tests-mx32/statfs64.test | 5 - tests-mx32/statx.c | 50 + tests-mx32/statx.gen.test | 4 + tests-mx32/statx.sh | 6 - tests-mx32/strace-C.test | 11 +- tests-mx32/strace-E.expected | 2 +- tests-mx32/strace-E.test | 9 +- tests-mx32/strace-S.test | 13 +- tests-mx32/strace-T.test | 11 +- tests-mx32/strace-V.test | 57 +- tests-mx32/strace-ff.test | 12 +- tests-mx32/strace-k-demangle.expected | 2 + tests-mx32/strace-k-demangle.test | 12 + tests-mx32/strace-k.expected | 2 + tests-mx32/strace-k.test | 89 +- tests-mx32/strace-log-merge-error.test | 37 + tests-mx32/strace-log-merge-suffix.test | 29 + tests-mx32/strace-r.expected | 2 +- tests-mx32/strace-r.test | 11 +- tests-mx32/strace-t.test | 34 +- tests-mx32/strace-tt.test | 12 +- tests-mx32/strace-ttt.test | 12 +- tests-mx32/strace.supp | 10 + tests-mx32/struct_flock.c | 107 - tests-mx32/sun_path.test | 9 +- tests-mx32/swap.c | 7 + tests-mx32/swap.gen.test | 4 + tests-mx32/swap.test | 6 - tests-mx32/sxetmask.c | 104 + tests-mx32/sxetmask.gen.test | 4 + tests-mx32/symlink.c | 17 +- tests-mx32/symlink.gen.test | 4 + tests-mx32/symlink.test | 6 - tests-mx32/symlinkat.c | 7 + tests-mx32/symlinkat.gen.test | 4 + tests-mx32/symlinkat.test | 6 - tests-mx32/sync.c | 7 + tests-mx32/sync.gen.test | 4 + tests-mx32/sync.test | 6 - tests-mx32/sync_file_range.c | 24 +- tests-mx32/sync_file_range.gen.test | 4 + tests-mx32/sync_file_range.test | 6 - tests-mx32/sync_file_range2.c | 24 +- tests-mx32/sync_file_range2.gen.test | 4 + tests-mx32/sync_file_range2.test | 6 - tests-mx32/syntax.sh | 59 + tests-mx32/sysinfo.c | 25 +- tests-mx32/sysinfo.gen.test | 4 + tests-mx32/sysinfo.test | 6 - tests-mx32/syslog.c | 7 + tests-mx32/syslog.gen.test | 4 + tests-mx32/syslog.test | 6 - tests-mx32/tail_alloc.c | 24 +- tests-mx32/tee.c | 24 +- tests-mx32/tee.gen.test | 4 + tests-mx32/tee.test | 6 - tests-mx32/termsig.test | 20 + tests-mx32/test_netlink.h | 104 + tests-mx32/test_nlattr.h | 343 + tests-mx32/test_printpath.c | 91 + tests-mx32/test_printstrn.c | 99 + tests-mx32/test_ucopy.c | 143 + tests-mx32/test_ucopy.h | 20 + tests-mx32/tests.h | 187 +- tests-mx32/threads-execve.c | 44 +- tests-mx32/threads-execve.test | 40 +- tests-mx32/time.c | 38 +- tests-mx32/time.gen.test | 4 + tests-mx32/time.test | 6 - tests-mx32/timer_create.c | 30 +- tests-mx32/timer_create.gen.test | 4 + tests-mx32/timer_create.test | 6 - tests-mx32/timer_xettime.c | 110 +- tests-mx32/timer_xettime.gen.test | 4 + tests-mx32/timer_xettime.test | 6 - tests-mx32/timerfd_xettime.c | 105 +- tests-mx32/timerfd_xettime.gen.test | 4 + tests-mx32/timerfd_xettime.test | 6 - tests-mx32/times-fail.c | 9 +- tests-mx32/times-fail.gen.test | 4 + tests-mx32/times-fail.test | 6 - tests-mx32/times.c | 25 +- tests-mx32/times.gen.test | 4 + tests-mx32/times.test | 6 - tests-mx32/tprintf.c | 24 +- tests-mx32/trace_fstat.gen.test | 4 + tests-mx32/trace_fstat.in | 11 + tests-mx32/trace_fstatfs.gen.test | 4 + tests-mx32/trace_fstatfs.in | 2 + tests-mx32/trace_lstat.gen.test | 4 + tests-mx32/trace_lstat.in | 3 + tests-mx32/trace_personality_32.gen.test | 4 + tests-mx32/trace_personality_32.in | 1 + tests-mx32/trace_personality_64.gen.test | 4 + tests-mx32/trace_personality_64.in | 1 + .../trace_personality_regex_32.gen.test | 4 + tests-mx32/trace_personality_regex_32.in | 3 + .../trace_personality_regex_64.gen.test | 4 + tests-mx32/trace_personality_regex_64.in | 3 + .../trace_personality_regex_x32.gen.test | 4 + tests-mx32/trace_personality_regex_x32.in | 3 + tests-mx32/trace_personality_x32.gen.test | 4 + tests-mx32/trace_personality_x32.in | 1 + tests-mx32/trace_question.gen.test | 4 + tests-mx32/trace_question.in | 4 + tests-mx32/trace_stat.gen.test | 4 + tests-mx32/trace_stat.in | 3 + tests-mx32/trace_stat_like.gen.test | 4 + tests-mx32/trace_stat_like.in | 18 + tests-mx32/trace_statfs.gen.test | 4 + tests-mx32/trace_statfs.in | 2 + tests-mx32/trace_statfs_like.gen.test | 4 + tests-mx32/trace_statfs_like.in | 5 + tests-mx32/truncate.c | 24 +- tests-mx32/truncate.gen.test | 4 + tests-mx32/truncate.test | 6 - tests-mx32/truncate64.c | 24 +- tests-mx32/truncate64.gen.test | 4 + tests-mx32/truncate64.test | 6 - tests-mx32/ugetrlimit.c | 7 + tests-mx32/ugetrlimit.gen.test | 4 + tests-mx32/ugetrlimit.test | 6 - tests-mx32/uio.c | 29 +- tests-mx32/uio.test | 9 +- tests-mx32/umask.c | 7 + tests-mx32/umask.gen.test | 4 + tests-mx32/umask.test | 6 - tests-mx32/umode_t.c | 32 +- tests-mx32/umount.c | 26 +- tests-mx32/umount.test | 7 +- tests-mx32/umount2.c | 26 +- tests-mx32/umount2.test | 7 +- tests-mx32/umoven-illptr.c | 24 +- tests-mx32/umoven-illptr.gen.test | 4 + tests-mx32/umoven-illptr.test | 6 - tests-mx32/umovestr-illptr.c | 24 +- tests-mx32/umovestr-illptr.gen.test | 4 + tests-mx32/umovestr-illptr.test | 6 - tests-mx32/umovestr.c | 24 +- tests-mx32/umovestr.test | 5 + tests-mx32/umovestr2.c | 24 +- tests-mx32/umovestr2.test | 9 +- tests-mx32/umovestr3.c | 25 +- tests-mx32/umovestr3.gen.test | 4 + tests-mx32/umovestr3.test | 6 - tests-mx32/uname.c | 24 +- tests-mx32/uname.test | 10 +- tests-mx32/unblock_reset_raise.c | 34 + tests-mx32/unix-pair-send-recv.c | 24 +- tests-mx32/unix-pair-send-recv.test | 9 +- tests-mx32/unix-pair-sendto-recvfrom.c | 25 +- tests-mx32/unix-pair-sendto-recvfrom.test | 9 +- tests-mx32/unlink.c | 7 + tests-mx32/unlink.gen.test | 4 + tests-mx32/unlink.test | 6 - tests-mx32/unlinkat.c | 7 + tests-mx32/unlinkat.gen.test | 4 + tests-mx32/unlinkat.test | 6 - tests-mx32/unshare.c | 23 +- tests-mx32/unshare.gen.test | 4 + tests-mx32/unshare.test | 6 - tests-mx32/userfaultfd.c | 24 +- tests-mx32/userfaultfd.gen.test | 4 + tests-mx32/userfaultfd.test | 6 - tests-mx32/ustat.c | 33 +- tests-mx32/ustat.gen.test | 4 + tests-mx32/ustat.test | 6 - tests-mx32/utime.c | 45 +- tests-mx32/utime.gen.test | 4 + tests-mx32/utime.test | 6 - tests-mx32/utimensat-Xabbrev.c | 1 + tests-mx32/utimensat-Xabbrev.gen.test | 4 + tests-mx32/utimensat-Xraw.c | 2 + tests-mx32/utimensat-Xraw.gen.test | 4 + tests-mx32/utimensat-Xverbose.c | 2 + tests-mx32/utimensat-Xverbose.gen.test | 4 + tests-mx32/utimensat.c | 244 +- tests-mx32/utimensat.gen.test | 4 + tests-mx32/utimensat.test | 20 - tests-mx32/utimes.c | 72 +- tests-mx32/utimes.gen.test | 4 + tests-mx32/utimes.test | 6 - tests-mx32/vfork-f.c | 24 +- tests-mx32/vfork-f.gen.test | 4 + tests-mx32/vfork-f.test | 5 - tests-mx32/vhangup.c | 7 + tests-mx32/vhangup.gen.test | 4 + tests-mx32/vhangup.test | 7 - tests-mx32/vmsplice.c | 25 +- tests-mx32/vmsplice.gen.test | 4 + tests-mx32/vmsplice.test | 6 - tests-mx32/wait4-v.gen.test | 4 + tests-mx32/wait4-v.test | 6 - tests-mx32/wait4.c | 39 +- tests-mx32/wait4.gen.test | 4 + tests-mx32/wait4.test | 6 - tests-mx32/waitid-v.gen.test | 4 + tests-mx32/waitid-v.test | 6 - tests-mx32/waitid.c | 38 +- tests-mx32/waitid.gen.test | 4 + tests-mx32/waitid.test | 6 - tests-mx32/waitpid.c | 24 +- tests-mx32/waitpid.gen.test | 4 + tests-mx32/waitpid.test | 6 - tests-mx32/xattr-strings.c | 7 + tests-mx32/xattr-strings.gen.test | 4 + tests-mx32/xattr-strings.test | 7 - tests-mx32/xattr.c | 27 +- tests-mx32/xattr.gen.test | 4 + tests-mx32/xattr.test | 12 - tests-mx32/xchownx.c | 38 +- tests-mx32/xet_robust_list.c | 27 +- tests-mx32/xet_robust_list.gen.test | 4 + tests-mx32/xet_robust_list.test | 6 - tests-mx32/xet_thread_area_x86.c | 206 + tests-mx32/xet_thread_area_x86.test | 16 + tests-mx32/xetitimer.c | 195 +- tests-mx32/xetitimer.gen.test | 4 + tests-mx32/xetitimer.test | 6 - tests-mx32/xetpgid.c | 30 +- tests-mx32/xetpgid.gen.test | 4 + tests-mx32/xetpgid.test | 6 - tests-mx32/xetpriority.c | 12 +- tests-mx32/xetpriority.gen.test | 4 + tests-mx32/xetpriority.test | 6 - tests-mx32/xettimeofday.c | 84 +- tests-mx32/xettimeofday.gen.test | 4 + tests-mx32/xettimeofday.test | 6 - tests-mx32/xgetrlimit.c | 75 +- tests-mx32/xselect.c | 485 +- tests-mx32/xstatfs.c | 24 +- tests-mx32/xstatfs64.c | 24 +- tests-mx32/xstatfsx.c | 44 +- tests-mx32/xstatx.c | 369 +- tests-mx32/xutimes.c | 129 + tests-mx32/zeroargc.c | 23 + tests/COPYING | 11 + tests/GPL-2.0-or-later | 339 + tests/Makefile.am | 975 +- tests/Makefile.in | 8781 +++++- tests/PTRACE_SEIZE.sh | 13 + tests/_newselect-P.c | 2 + tests/_newselect-P.gen.test | 4 + tests/_newselect.c | 24 +- tests/_newselect.gen.test | 4 + tests/_newselect.test | 5 - tests/accept.c | 54 +- tests/accept.gen.test | 4 + tests/accept.test | 6 - tests/accept4.c | 24 +- tests/accept4.gen.test | 4 + tests/accept4.test | 6 - tests/accept_compat.h | 32 + tests/access.c | 8 + tests/access.gen.test | 4 + tests/access.test | 15 - tests/acct.c | 7 + tests/acct.gen.test | 4 + tests/acct.test | 6 - tests/add_key.c | 34 +- tests/add_key.gen.test | 4 + tests/add_key.test | 6 - tests/adjtimex.c | 69 +- tests/adjtimex.gen.test | 4 + tests/adjtimex.test | 12 - tests/aio.c | 111 +- tests/aio.gen.test | 4 + tests/aio.test | 8 - tests/aio_pgetevents.c | 170 + tests/aio_pgetevents.gen.test | 4 + tests/alarm.c | 24 +- tests/alarm.gen.test | 4 + tests/alarm.test | 6 - tests/answer.c | 24 +- tests/attach-f-p-cmd.c | 25 +- tests/attach-f-p.c | 24 +- tests/attach-f-p.test | 38 +- tests/attach-p-cmd-cmd.c | 54 +- tests/attach-p-cmd-p.c | 87 +- tests/attach-p-cmd.h | 9 + tests/attach-p-cmd.test | 36 +- tests/bexecve.test | 29 +- tests/block_reset_raise_run.c | 35 + tests/bpf-obj_get_info_by_fd-prog-v.c | 3 + tests/bpf-obj_get_info_by_fd-prog-v.gen.test | 4 + tests/bpf-obj_get_info_by_fd-prog.c | 2 + tests/bpf-obj_get_info_by_fd-prog.gen.test | 4 + tests/bpf-obj_get_info_by_fd-v.c | 2 + tests/bpf-obj_get_info_by_fd-v.gen.test | 4 + tests/bpf-obj_get_info_by_fd.c | 608 + tests/bpf-obj_get_info_by_fd.gen.test | 4 + tests/bpf-success-v.c | 2 + tests/bpf-success-v.test | 11 + tests/bpf-success.c | 2 + tests/bpf-success.test | 11 + tests/bpf-v.c | 3 + tests/bpf-v.gen.test | 4 + tests/bpf.c | 1372 +- tests/bpf.gen.test | 4 + tests/bpf.test | 6 - tests/brk.c | 7 + tests/brk.test | 8 +- tests/btrfs-X.test | 16 + tests/btrfs-v.test | 17 +- tests/btrfs-vX.test | 16 + tests/btrfs-vw.test | 15 +- tests/btrfs-vwX.test | 30 + tests/btrfs-w.test | 15 +- tests/btrfs-wX.test | 30 + tests/btrfs.c | 1150 +- tests/btrfs.gen.test | 4 + tests/btrfs.test | 5 - tests/caps-abbrev.awk | 24 +- tests/caps-abbrev.test | 7 +- tests/caps.awk | 24 +- tests/caps.c | 24 +- tests/caps.test | 7 +- tests/check_sigblock.c | 29 + tests/check_sigign.c | 29 + tests/chmod.c | 32 +- tests/chmod.gen.test | 4 + tests/chmod.test | 6 - tests/chown.c | 7 + tests/chown.gen.test | 4 + tests/chown.test | 6 - tests/chown32.c | 7 + tests/chown32.gen.test | 4 + tests/chown32.test | 6 - tests/chroot.c | 7 + tests/chroot.gen.test | 4 + tests/chroot.test | 6 - tests/clock.gen.test | 4 + tests/clock.in | 3 + tests/clock_adjtime.c | 24 +- tests/clock_adjtime.gen.test | 4 + tests/clock_adjtime.test | 6 - tests/clock_nanosleep.c | 93 +- tests/clock_nanosleep.gen.test | 4 + tests/clock_nanosleep.test | 6 - tests/clock_xettime.c | 67 +- tests/clock_xettime.gen.test | 4 + tests/clock_xettime.test | 6 - tests/clone_parent.c | 60 + tests/clone_parent.test | 10 + tests/clone_ptrace.c | 90 + tests/clone_ptrace.test | 24 + tests/copy_file_range.c | 27 +- tests/copy_file_range.gen.test | 4 + tests/copy_file_range.test | 6 - tests/count-f.c | 24 +- tests/count-f.test | 9 +- tests/count.test | 31 +- tests/creat.c | 7 + tests/creat.gen.test | 4 + tests/creat.test | 6 - tests/create_nl_socket.c | 33 + tests/delay.c | 115 + tests/delay.test | 16 + tests/delete_module.c | 28 +- tests/delete_module.gen.test | 4 + tests/delete_module.test | 6 - tests/detach-running.test | 47 +- tests/detach-sleeping.test | 42 +- tests/detach-stopped.test | 48 +- tests/dev-yy.c | 81 + tests/dev-yy.gen.test | 4 + tests/dup.c | 7 + tests/dup.gen.test | 4 + tests/dup.test | 6 - tests/dup2.c | 7 + tests/dup2.gen.test | 4 + tests/dup2.test | 6 - tests/dup3.c | 9 +- tests/dup3.gen.test | 4 + tests/dup3.test | 6 - tests/epoll_create.c | 7 + tests/epoll_create.gen.test | 4 + tests/epoll_create.test | 6 - tests/epoll_create1.c | 24 +- tests/epoll_create1.gen.test | 4 + tests/epoll_create1.test | 6 - tests/epoll_ctl.c | 13 +- tests/epoll_ctl.gen.test | 4 + tests/epoll_ctl.test | 6 - tests/epoll_pwait.c | 9 +- tests/epoll_pwait.gen.test | 4 + tests/epoll_pwait.test | 6 - tests/epoll_wait.c | 9 +- tests/epoll_wait.gen.test | 4 + tests/epoll_wait.test | 6 - tests/erestartsys.c | 24 +- tests/erestartsys.gen.test | 4 + tests/erestartsys.test | 6 - tests/errno2name.c | 26 +- tests/error_msg.c | 26 +- tests/eventfd.c | 24 +- tests/eventfd.test | 7 +- tests/execve-v.test | 9 +- tests/execve.c | 76 +- tests/execve.test | 9 +- tests/execveat-v.gen.test | 4 + tests/execveat-v.test | 6 - tests/execveat.c | 128 +- tests/execveat.gen.test | 4 + tests/execveat.test | 6 - tests/faccessat.c | 7 + tests/faccessat.gen.test | 4 + tests/faccessat.test | 5 - tests/fadvise.h | 25 +- tests/fadvise64.c | 23 +- tests/fadvise64.test | 8 +- tests/fadvise64_64.c | 23 +- tests/fadvise64_64.gen.test | 4 + tests/fadvise64_64.test | 5 - tests/fallocate.c | 23 +- tests/fallocate.gen.test | 4 + tests/fallocate.test | 6 - tests/fanotify_init.c | 35 +- tests/fanotify_init.gen.test | 4 + tests/fanotify_init.test | 6 - tests/fanotify_mark-Xabbrev.c | 1 + tests/fanotify_mark-Xabbrev.gen.test | 4 + tests/fanotify_mark-Xraw.c | 2 + tests/fanotify_mark-Xraw.gen.test | 4 + tests/fanotify_mark-Xverbose.c | 2 + tests/fanotify_mark-Xverbose.gen.test | 4 + tests/fanotify_mark.c | 143 +- tests/fanotify_mark.gen.test | 4 + tests/fanotify_mark.test | 6 - tests/fchdir.c | 7 + tests/fchdir.gen.test | 4 + tests/fchdir.test | 6 - tests/fchmod.c | 23 +- tests/fchmod.gen.test | 4 + tests/fchmod.test | 6 - tests/fchmodat.c | 24 +- tests/fchmodat.gen.test | 4 + tests/fchmodat.test | 6 - tests/fchown.c | 7 + tests/fchown.gen.test | 4 + tests/fchown.test | 6 - tests/fchown32.c | 7 + tests/fchown32.gen.test | 4 + tests/fchown32.test | 6 - tests/fchownat.c | 24 +- tests/fchownat.gen.test | 4 + tests/fchownat.test | 6 - tests/fcntl-common.c | 379 + tests/fcntl.c | 66 +- tests/fcntl.gen.test | 4 + tests/fcntl.test | 6 - tests/fcntl64.c | 77 +- tests/fcntl64.gen.test | 4 + tests/fcntl64.test | 5 - tests/fdatasync.c | 7 + tests/fdatasync.gen.test | 4 + tests/fdatasync.test | 6 - tests/fflush.c | 22 + tests/fflush.test | 21 + tests/file_handle.c | 32 +- tests/file_handle.gen.test | 4 + tests/file_handle.test | 6 - tests/file_ioctl.c | 9 +- tests/file_ioctl.gen.test | 4 + tests/file_ioctl.test | 5 - tests/fill_memory.c | 9 +- tests/filter-unavailable.c | 24 +- tests/filter-unavailable.test | 9 +- tests/filtering_fd-syntax.test | 40 + tests/filtering_syscall-syntax.test | 101 + tests/finit_module.c | 26 +- tests/finit_module.gen.test | 4 + tests/finit_module.test | 6 - tests/first_exec_failure.test | 30 + tests/flock.c | 7 + tests/flock.gen.test | 4 + tests/flock.test | 6 - tests/fork-f.c | 24 +- tests/fork-f.gen.test | 4 + tests/fork-f.test | 6 - tests/fstat-Xabbrev.c | 1 + tests/fstat-Xabbrev.gen.test | 4 + tests/fstat-Xraw.c | 2 + tests/fstat-Xraw.gen.test | 4 + tests/fstat-Xverbose.c | 2 + tests/fstat-Xverbose.gen.test | 4 + tests/fstat.c | 23 +- tests/fstat.gen.test | 4 + tests/fstat.test | 19 - tests/fstat64-Xabbrev.c | 1 + tests/fstat64-Xabbrev.gen.test | 4 + tests/fstat64-Xraw.c | 2 + tests/fstat64-Xraw.gen.test | 4 + tests/fstat64-Xverbose.c | 2 + tests/fstat64-Xverbose.gen.test | 4 + tests/fstat64.c | 23 +- tests/fstat64.gen.test | 4 + tests/fstat64.test | 5 - tests/fstatat.c | 23 +- tests/fstatat64.c | 23 +- tests/fstatat64.gen.test | 4 + tests/fstatat64.test | 5 - tests/fstatfs.c | 24 +- tests/fstatfs.gen.test | 4 + tests/fstatfs.test | 5 - tests/fstatfs64.c | 24 +- tests/fstatfs64.gen.test | 4 + tests/fstatfs64.test | 5 - tests/fstatx.c | 23 +- tests/fsync-y.c | 51 + tests/fsync-y.gen.test | 4 + tests/fsync.c | 7 + tests/fsync.gen.test | 4 + tests/fsync.test | 6 - tests/ftruncate.c | 24 +- tests/ftruncate.gen.test | 4 + tests/ftruncate.test | 6 - tests/ftruncate64.c | 24 +- tests/ftruncate64.gen.test | 4 + tests/ftruncate64.test | 6 - tests/futex.c | 327 +- tests/futex.test | 7 +- tests/futimesat.c | 167 +- tests/futimesat.gen.test | 4 + tests/futimesat.test | 6 - tests/gen_pure_executables.sh | 30 + tests/gen_tests.am | 1574 ++ tests/gen_tests.in | 531 + tests/gen_tests.sh | 92 + tests/get_mempolicy.c | 24 +- tests/get_mempolicy.gen.test | 4 + tests/get_mempolicy.test | 6 - tests/get_page_size.c | 7 + tests/get_regs.test | 33 + tests/get_sigset_size.c | 46 + tests/getcpu.c | 35 +- tests/getcpu.gen.test | 4 + tests/getcpu.test | 6 - tests/getcwd.c | 13 +- tests/getcwd.gen.test | 4 + tests/getcwd.test | 6 - tests/getdents.c | 29 +- tests/getdents.gen.test | 4 + tests/getdents.test | 8 - tests/getdents64.c | 29 +- tests/getdents64.gen.test | 4 + tests/getdents64.test | 8 - tests/getegid.c | 7 + tests/getegid.gen.test | 4 + tests/getegid.test | 5 - tests/getegid32.c | 7 + tests/getegid32.gen.test | 4 + tests/getegid32.test | 5 - tests/geteuid.c | 7 + tests/geteuid.gen.test | 4 + tests/geteuid.test | 5 - tests/geteuid32.c | 7 + tests/geteuid32.gen.test | 4 + tests/geteuid32.test | 5 - tests/getgid.c | 7 + tests/getgid.gen.test | 4 + tests/getgid.test | 5 - tests/getgid32.c | 7 + tests/getgid32.gen.test | 4 + tests/getgid32.test | 5 - tests/getgroups.c | 29 +- tests/getgroups.gen.test | 4 + tests/getgroups.test | 6 - tests/getgroups32.c | 7 + tests/getgroups32.gen.test | 4 + tests/getgroups32.test | 6 - tests/getpeername.c | 24 +- tests/getpeername.gen.test | 4 + tests/getpeername.test | 5 - tests/getpgrp.c | 7 + tests/getpgrp.gen.test | 4 + tests/getpgrp.test | 6 - tests/getpid.c | 28 + tests/getpid.gen.test | 4 + tests/getppid.c | 28 + tests/getppid.gen.test | 4 + tests/getrandom.c | 24 +- tests/getrandom.gen.test | 4 + tests/getrandom.test | 6 - tests/getresgid.c | 7 + tests/getresgid.gen.test | 4 + tests/getresgid.test | 6 - tests/getresgid32.c | 7 + tests/getresgid32.gen.test | 4 + tests/getresgid32.test | 6 - tests/getresugid.c | 29 +- tests/getresuid.c | 7 + tests/getresuid.gen.test | 4 + tests/getresuid.test | 6 - tests/getresuid32.c | 7 + tests/getresuid32.gen.test | 4 + tests/getresuid32.test | 6 - tests/getrlimit.c | 7 + tests/getrlimit.gen.test | 4 + tests/getrlimit.test | 5 - tests/getrusage.c | 64 +- tests/getrusage.gen.test | 4 + tests/getrusage.test | 6 - tests/getsid.c | 7 + tests/getsid.gen.test | 4 + tests/getsid.test | 6 - tests/getsockname.c | 24 +- tests/getsockname.gen.test | 4 + tests/getsockname.test | 6 - tests/gettid.c | 19 + tests/gettid.gen.test | 4 + tests/getuid.c | 7 + tests/getuid.test | 8 +- tests/getuid32.c | 7 + tests/getuid32.gen.test | 4 + tests/getuid32.test | 5 - tests/getxxid.c | 24 +- tests/getxxid.gen.test | 4 + tests/getxxid.test | 6 - tests/group_req.c | 141 + tests/group_req.gen.test | 4 + tests/hexdump_strdup.c | 24 +- tests/hexquote_strndup.c | 24 +- tests/ifindex.c | 35 + tests/inet-cmsg.c | 30 +- tests/inet-cmsg.gen.test | 4 + tests/inet-cmsg.test | 6 - tests/init.sh | 176 +- tests/init_delete_module.h | 28 +- tests/init_module.c | 27 +- tests/init_module.gen.test | 4 + tests/init_module.test | 6 - tests/inject-nf.c | 66 + tests/inject-nf.test | 55 + tests/inode_of_sockfd.c | 25 +- tests/inotify.c | 27 +- tests/inotify.gen.test | 4 + tests/inotify.test | 6 - tests/inotify_init1.c | 23 +- tests/inotify_init1.gen.test | 4 + tests/inotify_init1.test | 6 - tests/int_0x80.c | 32 + tests/int_0x80.test | 16 + tests/interactive_block.test | 20 + tests/io_uring_enter.c | 83 + tests/io_uring_enter.gen.test | 4 + tests/io_uring_register.c | 100 + tests/io_uring_register.gen.test | 4 + tests/io_uring_setup.c | 103 + tests/io_uring_setup.gen.test | 4 + tests/ioctl.c | 34 +- tests/ioctl.test | 17 +- tests/ioctl_block.c | 45 +- tests/ioctl_block.gen.test | 4 + tests/ioctl_block.test | 5 - tests/ioctl_dm-v.gen.test | 4 + tests/ioctl_dm-v.test | 12 - tests/ioctl_dm.c | 121 +- tests/ioctl_dm.gen.test | 4 + tests/ioctl_dm.test | 12 - tests/ioctl_evdev-success-v.c | 2 + tests/ioctl_evdev-success-v.test | 18 + tests/ioctl_evdev-success.c | 239 + tests/ioctl_evdev-success.test | 18 + tests/ioctl_evdev-v.gen.test | 4 + tests/ioctl_evdev-v.test | 12 - tests/ioctl_evdev.c | 79 +- tests/ioctl_evdev.gen.test | 4 + tests/ioctl_evdev.test | 5 - tests/ioctl_inotify.c | 61 + tests/ioctl_inotify.gen.test | 4 + tests/ioctl_kvm_run-v.c | 2 + tests/ioctl_kvm_run-v.gen.test | 4 + tests/ioctl_kvm_run.c | 18 + tests/ioctl_kvm_run.gen.test | 4 + tests/ioctl_kvm_run_auxstr_vcpu.c | 31 + tests/ioctl_kvm_run_auxstr_vcpu.gen.test | 4 + tests/ioctl_kvm_run_common.c | 412 + tests/ioctl_loop-nv.gen.test | 4 + tests/ioctl_loop-nv.test | 12 - tests/ioctl_loop-v.gen.test | 4 + tests/ioctl_loop-v.test | 12 - tests/ioctl_loop.c | 97 +- tests/ioctl_loop.gen.test | 4 + tests/ioctl_loop.test | 12 - tests/ioctl_mtd.c | 93 +- tests/ioctl_mtd.gen.test | 4 + tests/ioctl_mtd.test | 5 - tests/ioctl_nbd.c | 92 + tests/ioctl_nbd.gen.test | 4 + tests/ioctl_nsfs.c | 126 + tests/ioctl_nsfs.gen.test | 4 + tests/ioctl_perf-success.c | 145 + tests/ioctl_perf-success.test | 20 + tests/ioctl_perf.c | 218 + tests/ioctl_perf.gen.test | 4 + tests/ioctl_ptp.c | 111 + tests/ioctl_ptp.gen.test | 4 + tests/ioctl_random.c | 61 + tests/ioctl_random.gen.test | 4 + tests/ioctl_rtc-v.gen.test | 4 + tests/ioctl_rtc-v.test | 12 - tests/ioctl_rtc.c | 29 +- tests/ioctl_rtc.gen.test | 4 + tests/ioctl_rtc.test | 5 - tests/ioctl_scsi.c | 32 +- tests/ioctl_scsi.gen.test | 4 + tests/ioctl_scsi.test | 4 - tests/ioctl_sg_io_v3.c | 72 +- tests/ioctl_sg_io_v3.gen.test | 4 + tests/ioctl_sg_io_v3.test | 4 - tests/ioctl_sg_io_v4.c | 56 +- tests/ioctl_sg_io_v4.gen.test | 4 + tests/ioctl_sg_io_v4.test | 4 - tests/ioctl_sock_gifconf.c | 28 +- tests/ioctl_sock_gifconf.gen.test | 4 + tests/ioctl_sock_gifconf.test | 12 - tests/ioctl_uffdio.c | 46 +- tests/ioctl_uffdio.gen.test | 4 + tests/ioctl_uffdio.test | 5 - tests/ioctl_v4l2.c | 656 +- tests/ioctl_v4l2.gen.test | 4 + tests/ioctl_v4l2.test | 5 - tests/ioperm.c | 7 + tests/ioperm.gen.test | 4 + tests/ioperm.test | 6 - tests/iopl.c | 7 + tests/iopl.gen.test | 4 + tests/iopl.test | 6 - tests/ioprio-Xabbrev.c | 1 + tests/ioprio-Xabbrev.gen.test | 4 + tests/ioprio-Xraw.c | 2 + tests/ioprio-Xraw.gen.test | 4 + tests/ioprio-Xverbose.c | 2 + tests/ioprio-Xverbose.gen.test | 4 + tests/ioprio.c | 97 +- tests/ioprio.gen.test | 4 + tests/ioprio.test | 6 - tests/ip_mreq.c | 164 +- tests/ip_mreq.gen.test | 4 + tests/ip_mreq.test | 6 - tests/ipc.c | 24 +- tests/ipc.gen.test | 4 + tests/ipc.sh | 13 +- tests/ipc.test | 6 - tests/ipc_msg-Xabbrev.c | 1 + tests/ipc_msg-Xabbrev.gen.test | 4 + tests/ipc_msg-Xraw.c | 2 + tests/ipc_msg-Xraw.gen.test | 4 + tests/ipc_msg-Xverbose.c | 2 + tests/ipc_msg-Xverbose.gen.test | 4 + tests/ipc_msg.c | 113 +- tests/ipc_msg.gen.test | 4 + tests/ipc_msg.test | 5 - tests/ipc_msgbuf-Xabbrev.c | 1 + tests/ipc_msgbuf-Xabbrev.gen.test | 4 + tests/ipc_msgbuf-Xraw.c | 2 + tests/ipc_msgbuf-Xraw.gen.test | 4 + tests/ipc_msgbuf-Xverbose.c | 2 + tests/ipc_msgbuf-Xverbose.gen.test | 4 + tests/ipc_msgbuf.c | 92 +- tests/ipc_msgbuf.expected | 4 - tests/ipc_msgbuf.test | 11 +- tests/ipc_sem-Xabbrev.c | 1 + tests/ipc_sem-Xabbrev.gen.test | 4 + tests/ipc_sem-Xraw.c | 2 + tests/ipc_sem-Xraw.gen.test | 4 + tests/ipc_sem-Xverbose.c | 2 + tests/ipc_sem-Xverbose.gen.test | 4 + tests/ipc_sem.c | 103 +- tests/ipc_sem.gen.test | 4 + tests/ipc_sem.test | 5 - tests/ipc_shm-Xabbrev.c | 1 + tests/ipc_shm-Xabbrev.gen.test | 4 + tests/ipc_shm-Xraw.c | 2 + tests/ipc_shm-Xraw.gen.test | 4 + tests/ipc_shm-Xverbose.c | 2 + tests/ipc_shm-Xverbose.gen.test | 4 + tests/ipc_shm.c | 169 +- tests/ipc_shm.gen.test | 4 + tests/ipc_shm.test | 5 - tests/is_linux_mips_n64.c | 25 + tests/kcmp-y.c | 3 + tests/kcmp-y.gen.test | 4 + tests/kcmp.c | 172 +- tests/kcmp.gen.test | 4 + tests/kcmp.test | 6 - tests/kern_features-fault.test | 43 + tests/kern_features.c | 100 + tests/kern_features.gen.test | 4 + tests/kernel_version-Xabbrev.c | 1 + tests/kernel_version-Xabbrev.gen.test | 4 + tests/kernel_version-Xraw.c | 2 + tests/kernel_version-Xraw.gen.test | 4 + tests/kernel_version-Xverbose.c | 2 + tests/kernel_version-Xverbose.gen.test | 4 + tests/kernel_version.c | 104 + tests/kernel_version.gen.test | 4 + tests/kexec_file_load.c | 25 +- tests/kexec_file_load.gen.test | 4 + tests/kexec_file_load.test | 6 - tests/kexec_load.c | 28 +- tests/kexec_load.gen.test | 4 + tests/kexec_load.test | 6 - tests/keyctl-Xabbrev.c | 1 + tests/keyctl-Xabbrev.gen.test | 4 + tests/keyctl-Xraw.c | 2 + tests/keyctl-Xraw.gen.test | 4 + tests/keyctl-Xverbose.c | 2 + tests/keyctl-Xverbose.gen.test | 4 + tests/keyctl.c | 620 +- tests/keyctl.gen.test | 4 + tests/keyctl.test | 6 - tests/kill.c | 25 +- tests/kill.gen.test | 4 + tests/kill.test | 6 - tests/kill_child.c | 69 + tests/kill_child.test | 31 + tests/ksysent.c | 39 +- tests/ksysent.sed | 9 +- tests/ksysent.test | 5 + tests/lchown.c | 7 + tests/lchown.gen.test | 4 + tests/lchown.test | 6 - tests/lchown32.c | 7 + tests/lchown32.gen.test | 4 + tests/lchown32.test | 6 - tests/libmmsg.c | 24 +- tests/libsocketcall.c | 28 +- tests/link.c | 7 + tests/link.gen.test | 4 + tests/link.test | 6 - tests/linkat.c | 7 + tests/linkat.gen.test | 4 + tests/linkat.test | 6 - tests/list_sigaction_signum.c | 37 + tests/llseek.c | 24 +- tests/llseek.test | 13 +- tests/localtime.c | 37 + tests/localtime.test | 18 + tests/lookup_dcookie.c | 23 +- tests/lookup_dcookie.gen.test | 4 + tests/lookup_dcookie.test | 6 - tests/looping_threads.c | 121 + tests/looping_threads.test | 38 + tests/lseek.c | 24 +- tests/lseek.test | 11 +- tests/lstat.c | 23 +- tests/lstat.gen.test | 4 + tests/lstat.test | 5 - tests/lstat64.c | 23 +- tests/lstat64.gen.test | 4 + tests/lstat64.test | 5 - tests/lstatx.c | 23 +- tests/madvise.c | 59 + tests/madvise.gen.test | 4 + tests/match.awk | 24 +- tests/mbind.c | 24 +- tests/mbind.gen.test | 4 + tests/mbind.test | 6 - tests/membarrier.c | 72 +- tests/membarrier.gen.test | 4 + tests/membarrier.test | 6 - tests/memfd_create-Xabbrev.c | 1 + tests/memfd_create-Xabbrev.gen.test | 4 + tests/memfd_create-Xraw.c | 2 + tests/memfd_create-Xraw.gen.test | 4 + tests/memfd_create-Xverbose.c | 2 + tests/memfd_create-Xverbose.gen.test | 4 + tests/memfd_create.c | 96 +- tests/memfd_create.gen.test | 4 + tests/memfd_create.test | 6 - tests/migrate_pages.c | 24 +- tests/migrate_pages.gen.test | 4 + tests/migrate_pages.test | 6 - tests/mincore.c | 25 +- tests/mincore.gen.test | 4 + tests/mincore.test | 6 - tests/mkdir.c | 7 + tests/mkdir.gen.test | 4 + tests/mkdir.test | 6 - tests/mkdirat.c | 7 + tests/mkdirat.gen.test | 4 + tests/mkdirat.test | 6 - tests/mknod.c | 18 +- tests/mknod.gen.test | 4 + tests/mknod.test | 6 - tests/mknodat.c | 13 +- tests/mknodat.gen.test | 4 + tests/mknodat.test | 6 - tests/mlock.c | 7 + tests/mlock.gen.test | 4 + tests/mlock.test | 6 - tests/mlock2.c | 24 +- tests/mlock2.gen.test | 4 + tests/mlock2.test | 6 - tests/mlockall.c | 24 +- tests/mlockall.gen.test | 4 + tests/mlockall.test | 6 - tests/mmap-Xabbrev.c | 1 + tests/mmap-Xabbrev.gen.test | 4 + tests/mmap-Xraw.c | 2 + tests/mmap-Xraw.gen.test | 4 + tests/mmap-Xverbose.c | 2 + tests/mmap-Xverbose.gen.test | 4 + tests/mmap.c | 84 +- tests/mmap.test | 40 +- tests/mmap64-Xabbrev.c | 1 + tests/mmap64-Xabbrev.gen.test | 4 + tests/mmap64-Xraw.c | 2 + tests/mmap64-Xraw.gen.test | 4 + tests/mmap64-Xverbose.c | 2 + tests/mmap64-Xverbose.gen.test | 4 + tests/mmap64.gen.test | 4 + tests/mmap64.test | 6 - tests/mmsg-silent.c | 24 +- tests/mmsg-silent.gen.test | 4 + tests/mmsg-silent.test | 6 - tests/mmsg.c | 44 +- tests/mmsg.gen.test | 4 + tests/mmsg.test | 6 - tests/mmsg_name-v.gen.test | 4 + tests/mmsg_name-v.test | 7 - tests/mmsg_name.c | 33 +- tests/mmsg_name.gen.test | 4 + tests/mmsg_name.test | 7 - tests/modify_ldt.c | 117 + tests/modify_ldt.gen.test | 4 + tests/mount-Xabbrev.c | 1 + tests/mount-Xabbrev.gen.test | 4 + tests/mount-Xraw.c | 2 + tests/mount-Xraw.gen.test | 4 + tests/mount-Xverbose.c | 2 + tests/mount-Xverbose.gen.test | 4 + tests/mount.c | 108 +- tests/mount.gen.test | 4 + tests/mount.test | 6 - tests/move_pages-Xabbrev.c | 1 + tests/move_pages-Xabbrev.gen.test | 4 + tests/move_pages-Xraw.c | 2 + tests/move_pages-Xraw.gen.test | 4 + tests/move_pages-Xverbose.c | 2 + tests/move_pages-Xverbose.gen.test | 4 + tests/move_pages.c | 55 +- tests/move_pages.gen.test | 4 + tests/move_pages.test | 6 - tests/mq.c | 39 +- tests/mq.gen.test | 4 + tests/mq.test | 6 - tests/mq_sendrecv-read.gen.test | 4 + tests/mq_sendrecv-read.test | 6 - tests/mq_sendrecv-write.gen.test | 4 + tests/mq_sendrecv-write.test | 6 - tests/mq_sendrecv.c | 118 +- tests/mq_sendrecv.gen.test | 4 + tests/mq_sendrecv.test | 6 - tests/msg_control-v.gen.test | 4 + tests/msg_control-v.test | 6 - tests/msg_control.c | 380 +- tests/msg_control.gen.test | 4 + tests/msg_control.test | 6 - tests/msg_name.c | 31 +- tests/msg_name.gen.test | 4 + tests/msg_name.test | 6 - tests/munlockall.c | 9 +- tests/munlockall.gen.test | 4 + tests/munlockall.test | 6 - tests/nanosleep.c | 77 +- tests/nanosleep.gen.test | 4 + tests/nanosleep.test | 6 - tests/net-accept-connect.c | 38 +- tests/net-icmp_filter.c | 31 +- tests/net-icmp_filter.gen.test | 4 + tests/net-icmp_filter.test | 6 - tests/net-packet_mreq-Xabbrev.c | 1 + tests/net-packet_mreq-Xabbrev.gen.test | 4 + tests/net-packet_mreq-Xraw.c | 2 + tests/net-packet_mreq-Xraw.gen.test | 4 + tests/net-packet_mreq-Xverbose.c | 2 + tests/net-packet_mreq-Xverbose.gen.test | 4 + tests/net-packet_mreq.c | 206 + tests/net-packet_mreq.gen.test | 4 + tests/net-sockaddr.c | 337 +- tests/net-sockaddr.gen.test | 4 + tests/net-sockaddr.test | 6 - tests/net-tpacket_req.c | 59 + tests/net-tpacket_req.gen.test | 4 + tests/net-tpacket_stats-success.c | 2 + tests/net-tpacket_stats-success.test | 11 + tests/net-tpacket_stats.c | 154 + tests/net-tpacket_stats.gen.test | 4 + tests/net-y-unix.c | 73 +- tests/net-y-unix.test | 35 +- tests/net-yy-inet.c | 122 +- tests/net-yy-inet.test | 35 +- tests/net-yy-inet6.c | 21 + tests/net-yy-inet6.gen.test | 4 + tests/net-yy-netlink.c | 44 +- tests/net-yy-netlink.test | 35 +- tests/net-yy-unix.c | 96 +- tests/net-yy-unix.test | 37 +- tests/net.expected | 2 +- tests/net.test | 11 +- tests/netlink_audit.c | 45 + tests/netlink_audit.gen.test | 4 + tests/netlink_crypto.c | 161 + tests/netlink_crypto.gen.test | 4 + tests/netlink_generic.c | 61 + tests/netlink_generic.gen.test | 4 + tests/netlink_inet_diag.c | 29 +- tests/netlink_kobject_uevent.c | 143 + tests/netlink_kobject_uevent.gen.test | 4 + tests/netlink_netfilter.c | 189 + tests/netlink_netfilter.gen.test | 4 + tests/netlink_netlink_diag.c | 36 +- tests/netlink_protocol.c | 304 +- tests/netlink_protocol.gen.test | 4 + tests/netlink_protocol.test | 11 - tests/netlink_route.c | 477 + tests/netlink_route.gen.test | 4 + tests/netlink_selinux.c | 88 + tests/netlink_selinux.gen.test | 4 + tests/netlink_sock_diag-v.sh | 13 + tests/netlink_sock_diag.c | 659 + tests/netlink_sock_diag.test | 13 + tests/netlink_unix_diag.c | 33 +- tests/netlink_xfrm.c | 89 + tests/netlink_xfrm.gen.test | 4 + tests/newfstatat.c | 24 +- tests/newfstatat.gen.test | 4 + tests/newfstatat.test | 5 - tests/nfnetlink_acct.c | 100 + tests/nfnetlink_acct.gen.test | 4 + tests/nfnetlink_cthelper.c | 100 + tests/nfnetlink_cthelper.gen.test | 4 + tests/nfnetlink_ctnetlink.c | 100 + tests/nfnetlink_ctnetlink.gen.test | 4 + tests/nfnetlink_ctnetlink_exp.c | 100 + tests/nfnetlink_ctnetlink_exp.gen.test | 4 + tests/nfnetlink_cttimeout.c | 104 + tests/nfnetlink_cttimeout.gen.test | 4 + tests/nfnetlink_ipset.c | 63 + tests/nfnetlink_ipset.gen.test | 4 + tests/nfnetlink_nft_compat.c | 82 + tests/nfnetlink_nft_compat.gen.test | 4 + tests/nfnetlink_nftables.c | 100 + tests/nfnetlink_nftables.gen.test | 4 + tests/nfnetlink_osf.c | 65 + tests/nfnetlink_osf.gen.test | 4 + tests/nfnetlink_queue.c | 63 + tests/nfnetlink_queue.gen.test | 4 + tests/nfnetlink_ulog.c | 63 + tests/nfnetlink_ulog.gen.test | 4 + tests/nlattr.c | 313 + tests/nlattr.gen.test | 4 + tests/nlattr_br_port_msg.c | 74 + tests/nlattr_br_port_msg.gen.test | 4 + tests/nlattr_crypto_user_alg.c | 175 + tests/nlattr_crypto_user_alg.gen.test | 4 + tests/nlattr_dcbmsg.c | 72 + tests/nlattr_dcbmsg.gen.test | 4 + tests/nlattr_fib_rule_hdr.c | 184 + tests/nlattr_fib_rule_hdr.gen.test | 4 + tests/nlattr_ifaddrlblmsg.c | 79 + tests/nlattr_ifaddrlblmsg.gen.test | 4 + tests/nlattr_ifaddrmsg.c | 138 + tests/nlattr_ifaddrmsg.gen.test | 4 + tests/nlattr_ifinfomsg.c | 346 + tests/nlattr_ifinfomsg.gen.test | 4 + tests/nlattr_ifla.h | 58 + tests/nlattr_ifla_af_spec.c | 303 + tests/nlattr_ifla_af_spec.gen.test | 4 + tests/nlattr_ifla_brport.c | 72 + tests/nlattr_ifla_brport.gen.test | 4 + tests/nlattr_ifla_linkinfo.c | 692 + tests/nlattr_ifla_linkinfo.gen.test | 4 + tests/nlattr_ifla_port.c | 64 + tests/nlattr_ifla_port.gen.test | 4 + tests/nlattr_ifla_xdp.c | 123 + tests/nlattr_ifla_xdp.gen.test | 4 + tests/nlattr_inet_diag_msg.c | 205 + tests/nlattr_inet_diag_msg.gen.test | 4 + tests/nlattr_inet_diag_req_compat.c | 85 + tests/nlattr_inet_diag_req_compat.gen.test | 4 + tests/nlattr_inet_diag_req_v2.c | 407 + tests/nlattr_inet_diag_req_v2.gen.test | 4 + tests/nlattr_mdba_mdb_entry.c | 167 + tests/nlattr_mdba_mdb_entry.gen.test | 4 + tests/nlattr_mdba_router_port.c | 110 + tests/nlattr_mdba_router_port.gen.test | 4 + tests/nlattr_ndmsg.c | 104 + tests/nlattr_ndmsg.gen.test | 4 + tests/nlattr_ndtmsg.c | 139 + tests/nlattr_ndtmsg.gen.test | 4 + tests/nlattr_netconfmsg.c | 71 + tests/nlattr_netconfmsg.gen.test | 4 + tests/nlattr_netlink_diag_msg.c | 101 + tests/nlattr_netlink_diag_msg.gen.test | 4 + tests/nlattr_nlmsgerr.c | 68 + tests/nlattr_nlmsgerr.gen.test | 4 + tests/nlattr_packet_diag_msg.c | 158 + tests/nlattr_packet_diag_msg.gen.test | 4 + tests/nlattr_rtgenmsg.c | 72 + tests/nlattr_rtgenmsg.gen.test | 4 + tests/nlattr_rtmsg.c | 203 + tests/nlattr_rtmsg.gen.test | 4 + tests/nlattr_smc_diag_msg.c | 231 + tests/nlattr_smc_diag_msg.gen.test | 4 + tests/nlattr_tc_stats.c | 131 + tests/nlattr_tc_stats.gen.test | 4 + tests/nlattr_tca_stab.c | 111 + tests/nlattr_tca_stab.gen.test | 4 + tests/nlattr_tcamsg.c | 61 + tests/nlattr_tcamsg.gen.test | 4 + tests/nlattr_tcmsg.c | 104 + tests/nlattr_tcmsg.gen.test | 4 + tests/nlattr_unix_diag_msg.c | 98 + tests/nlattr_unix_diag_msg.gen.test | 4 + tests/nsyscalls-d.c | 2 + tests/nsyscalls-d.test | 31 + tests/nsyscalls-nd.test | 9 + tests/nsyscalls.c | 86 +- tests/nsyscalls.test | 7 +- tests/old_mmap-P.c | 3 + tests/old_mmap-P.gen.test | 4 + tests/old_mmap-Xabbrev.c | 1 + tests/old_mmap-Xabbrev.gen.test | 4 + tests/old_mmap-Xraw.c | 2 + tests/old_mmap-Xraw.gen.test | 4 + tests/old_mmap-Xverbose.c | 2 + tests/old_mmap-Xverbose.gen.test | 4 + tests/old_mmap-v-none.c | 1 + tests/old_mmap-v-none.gen.test | 4 + tests/old_mmap.c | 100 +- tests/old_mmap.gen.test | 4 + tests/old_mmap.test | 6 - tests/oldfstat.c | 23 +- tests/oldfstat.gen.test | 4 + tests/oldfstat.test | 19 - tests/oldlstat.c | 23 +- tests/oldlstat.gen.test | 4 + tests/oldlstat.test | 5 - tests/oldselect-P.c | 2 + tests/oldselect-P.gen.test | 4 + tests/oldselect-efault-P.c | 2 + tests/oldselect-efault-P.gen.test | 4 + tests/oldselect-efault.c | 58 + tests/oldselect-efault.gen.test | 4 + tests/oldselect.c | 75 +- tests/oldselect.expected | 2 - tests/oldselect.gen.test | 4 + tests/oldselect.test | 11 - tests/oldstat.c | 23 +- tests/oldstat.gen.test | 4 + tests/oldstat.test | 5 - tests/open.c | 38 +- tests/open.gen.test | 4 + tests/open.test | 6 - tests/openat.c | 98 +- tests/openat.gen.test | 4 + tests/openat.test | 6 - tests/opipe.test | 13 +- tests/options-syntax.test | 154 +- tests/orphaned_process_group.c | 155 + tests/orphaned_process_group.gen.test | 4 + tests/osf_utimes.c | 25 + tests/osf_utimes.gen.test | 4 + tests/overflowuid.c | 24 +- tests/pause.c | 23 +- tests/pause.gen.test | 4 + tests/pause.test | 6 - tests/pc.c | 24 +- tests/pc.test | 31 +- tests/perf_event_open.c | 251 +- tests/perf_event_open.gen.test | 4 + tests/perf_event_open.test | 7 - tests/perf_event_open_nonverbose.c | 35 +- tests/perf_event_open_nonverbose.gen.test | 4 + tests/perf_event_open_nonverbose.test | 6 - tests/perf_event_open_unabbrev.gen.test | 4 + tests/perf_event_open_unabbrev.test | 7 - tests/personality-Xabbrev.c | 1 + tests/personality-Xabbrev.gen.test | 4 + tests/personality-Xraw.c | 2 + tests/personality-Xraw.gen.test | 4 + tests/personality-Xverbose.c | 2 + tests/personality-Xverbose.gen.test | 4 + tests/personality.c | 98 +- tests/personality.test | 14 +- tests/pidfd_send_signal.c | 71 + tests/pidfd_send_signal.gen.test | 4 + tests/pipe.c | 23 +- tests/pipe.test | 8 +- tests/pipe2.c | 30 +- tests/pipe2.gen.test | 4 + tests/pipe2.test | 6 - tests/pipe_maxfd.c | 24 +- tests/pkey_alloc.c | 31 +- tests/pkey_alloc.gen.test | 4 + tests/pkey_alloc.test | 6 - tests/pkey_free.c | 23 +- tests/pkey_free.gen.test | 4 + tests/pkey_free.test | 6 - tests/pkey_mprotect.c | 23 +- tests/pkey_mprotect.gen.test | 4 + tests/pkey_mprotect.test | 6 - tests/poll-P.c | 2 + tests/poll-P.test | 22 + tests/poll.c | 177 +- tests/poll.test | 19 +- tests/ppoll-P.c | 2 + tests/ppoll-P.gen.test | 4 + tests/ppoll-v.c | 3 + tests/ppoll-v.expected | 3 - tests/ppoll-v.gen.test | 4 + tests/ppoll.c | 265 +- tests/ppoll.expected | 3 - tests/ppoll.gen.test | 4 + tests/ppoll.test | 13 - tests/prctl-arg2-intptr.c | 25 +- tests/prctl-arg2-intptr.test | 10 +- tests/prctl-dumpable.c | 29 +- tests/prctl-dumpable.test | 10 +- tests/prctl-name.c | 23 +- tests/prctl-name.test | 10 +- tests/prctl-no-args.c | 25 +- tests/prctl-no-args.test | 10 +- tests/prctl-pdeathsig.c | 25 +- tests/prctl-pdeathsig.test | 9 +- tests/prctl-seccomp-filter-v.c | 39 +- tests/prctl-seccomp-filter-v.test | 9 +- tests/prctl-seccomp-strict.c | 24 +- tests/prctl-seccomp-strict.test | 10 +- tests/prctl-securebits.c | 23 +- tests/prctl-securebits.test | 10 +- tests/prctl-spec-inject.c | 148 + tests/prctl-spec-inject.test | 35 + tests/prctl-tid_address.c | 25 +- tests/prctl-tid_address.test | 10 +- tests/prctl-tsc.c | 25 +- tests/prctl-tsc.test | 9 +- tests/pread64-pwrite64.c | 28 +- tests/pread64-pwrite64.gen.test | 4 + tests/pread64-pwrite64.test | 18 - tests/preadv-pwritev.c | 32 +- tests/preadv-pwritev.gen.test | 4 + tests/preadv-pwritev.test | 6 - tests/preadv.c | 32 +- tests/preadv.gen.test | 4 + tests/preadv.test | 6 - tests/preadv2-pwritev2.c | 104 +- tests/preadv2-pwritev2.gen.test | 4 + tests/preadv2-pwritev2.test | 6 - tests/print_maxfd.c | 24 +- tests/print_quoted_string.c | 114 +- tests/print_time.c | 54 + tests/print_user_desc.c | 58 + tests/printflags.c | 24 +- tests/printpath-umovestr-legacy.test | 32 + tests/printpath-umovestr-peekdata.c | 27 + tests/printpath-umovestr-peekdata.gen.test | 4 + tests/printpath-umovestr-undumpable.c | 51 + tests/printpath-umovestr-undumpable.gen.test | 4 + tests/printpath-umovestr.c | 26 + tests/printpath-umovestr.gen.test | 4 + tests/printsignal-Xabbrev.c | 1 + tests/printsignal-Xabbrev.gen.test | 4 + tests/printsignal-Xraw.c | 2 + tests/printsignal-Xraw.gen.test | 4 + tests/printsignal-Xverbose.c | 2 + tests/printsignal-Xverbose.gen.test | 4 + tests/printsignal.c | 33 + tests/printstr.c | 32 +- tests/printstr.gen.test | 4 + tests/printstr.test | 6 - tests/printstrn-umoven-legacy.test | 32 + tests/printstrn-umoven-peekdata.c | 27 + tests/printstrn-umoven-peekdata.gen.test | 4 + tests/printstrn-umoven-undumpable.c | 51 + tests/printstrn-umoven-undumpable.gen.test | 4 + tests/printstrn-umoven.c | 24 + tests/printstrn-umoven.gen.test | 4 + tests/printxval.c | 24 +- tests/prlimit64.c | 24 +- tests/prlimit64.gen.test | 4 + tests/prlimit64.test | 6 - tests/process_vm_readv.c | 7 + tests/process_vm_readv.gen.test | 4 + tests/process_vm_readv.test | 6 - tests/process_vm_readv_writev.c | 44 +- tests/process_vm_writev.c | 7 + tests/process_vm_writev.gen.test | 4 + tests/process_vm_writev.test | 6 - tests/pselect6.c | 70 +- tests/pselect6.gen.test | 4 + tests/pselect6.test | 6 - tests/ptrace.c | 101 +- tests/ptrace.gen.test | 4 + tests/ptrace.test | 6 - tests/ptrace_syscall_info.c | 460 + tests/ptrace_syscall_info.gen.test | 4 + tests/pure_executables.am | 522 + tests/pure_executables.list | 526 + tests/pwritev.c | 25 +- tests/pwritev.gen.test | 4 + tests/pwritev.test | 6 - tests/qual_fault-exit_group.test | 31 +- tests/qual_fault-syntax.test | 47 +- tests/qual_fault-syscall.test | 3 + tests/qual_fault.c | 138 +- tests/qual_fault.test | 65 +- tests/qual_inject-error-signal-syscall.test | 3 + tests/qual_inject-error-signal.c | 24 +- tests/qual_inject-error-signal.test | 16 +- tests/qual_inject-retval-syscall.test | 3 + tests/qual_inject-retval.c | 23 +- tests/qual_inject-retval.test | 15 +- tests/qual_inject-signal-syscall.test | 3 + tests/qual_inject-signal.c | 24 +- tests/qual_inject-signal.test | 15 +- tests/qual_inject-syntax.test | 60 +- tests/qual_signal.c | 24 +- tests/qual_signal.test | 28 +- tests/qual_syscall.test | 25 +- tests/qualify_personality.sh | 74 + tests/qualify_personality_empty.in | 0 tests/quotactl-Xabbrev.c | 1 + tests/quotactl-Xabbrev.gen.test | 4 + tests/quotactl-Xraw.c | 2 + tests/quotactl-Xraw.gen.test | 4 + tests/quotactl-Xverbose.c | 2 + tests/quotactl-Xverbose.gen.test | 4 + tests/quotactl-success-v.c | 2 + tests/quotactl-success-v.test | 11 + tests/quotactl-success.c | 2 + tests/quotactl-success.test | 11 + tests/quotactl-v.gen.test | 4 + tests/quotactl-v.test | 6 - tests/quotactl-xfs-success-v.c | 2 + tests/quotactl-xfs-success-v.test | 11 + tests/quotactl-xfs-success.c | 2 + tests/quotactl-xfs-success.test | 11 + tests/quotactl-xfs-v.gen.test | 4 + tests/quotactl-xfs-v.test | 6 - tests/quotactl-xfs.c | 174 +- tests/quotactl-xfs.gen.test | 4 + tests/quotactl-xfs.test | 6 - tests/quotactl.c | 265 +- tests/quotactl.gen.test | 4 + tests/quotactl.h | 120 +- tests/quotactl.test | 6 - tests/read-write.c | 147 +- tests/read-write.gen.test | 4 + tests/read-write.test | 18 - tests/readahead.c | 27 +- tests/readahead.gen.test | 4 + tests/readahead.test | 6 - tests/readdir.c | 29 +- tests/readdir.gen.test | 4 + tests/readdir.test | 8 - tests/readlink.c | 24 +- tests/readlink.gen.test | 4 + tests/readlink.test | 6 - tests/readlinkat.c | 24 +- tests/readlinkat.gen.test | 4 + tests/readlinkat.test | 5 - tests/readv.c | 35 +- tests/readv.test | 25 +- tests/reboot.c | 85 +- tests/reboot.gen.test | 4 + tests/reboot.test | 6 - tests/recvfrom.c | 24 +- tests/recvfrom.gen.test | 4 + tests/recvfrom.test | 6 - tests/recvmmsg-timeout.c | 51 +- tests/recvmmsg-timeout.gen.test | 4 + tests/recvmmsg-timeout.test | 6 - tests/recvmsg.c | 32 +- tests/recvmsg.gen.test | 4 + tests/recvmsg.test | 6 - tests/redirect-fds.c | 24 +- tests/redirect-fds.test | 28 +- tests/redirect.test | 25 +- tests/regex.gen.test | 4 + tests/regex.in | 2 + tests/remap_file_pages-Xabbrev.c | 1 + tests/remap_file_pages-Xabbrev.gen.test | 4 + tests/remap_file_pages-Xraw.c | 2 + tests/remap_file_pages-Xraw.gen.test | 4 + tests/remap_file_pages-Xverbose.c | 2 + tests/remap_file_pages-Xverbose.gen.test | 4 + tests/remap_file_pages.c | 123 +- tests/remap_file_pages.gen.test | 4 + tests/remap_file_pages.test | 6 - tests/rename.c | 7 + tests/rename.gen.test | 4 + tests/rename.test | 6 - tests/renameat.c | 7 + tests/renameat.gen.test | 4 + tests/renameat.test | 6 - tests/renameat2.c | 24 +- tests/renameat2.gen.test | 4 + tests/renameat2.test | 6 - tests/request_key.c | 30 +- tests/request_key.gen.test | 4 + tests/request_key.test | 6 - tests/restart_syscall.c | 48 +- tests/restart_syscall.test | 14 +- tests/riscv_flush_icache.c | 73 + tests/riscv_flush_icache.gen.test | 4 + tests/rmdir.c | 7 + tests/rmdir.gen.test | 4 + tests/rmdir.test | 6 - tests/rt_sigaction.awk | 76 + tests/rt_sigaction.c | 48 + tests/rt_sigaction.test | 16 + tests/rt_sigpending.c | 29 +- tests/rt_sigpending.gen.test | 4 + tests/rt_sigpending.test | 6 - tests/rt_sigprocmask.c | 25 +- tests/rt_sigprocmask.gen.test | 4 + tests/rt_sigprocmask.test | 6 - tests/rt_sigqueueinfo.c | 25 +- tests/rt_sigqueueinfo.gen.test | 4 + tests/rt_sigqueueinfo.test | 6 - tests/rt_sigreturn.c | 59 + tests/rt_sigreturn.gen.test | 4 + tests/rt_sigsuspend.c | 25 +- tests/rt_sigsuspend.gen.test | 4 + tests/rt_sigsuspend.test | 6 - tests/rt_sigtimedwait.c | 122 +- tests/rt_sigtimedwait.gen.test | 4 + tests/rt_sigtimedwait.test | 6 - tests/rt_tgsigqueueinfo.c | 36 +- tests/rt_tgsigqueueinfo.gen.test | 4 + tests/rt_tgsigqueueinfo.test | 6 - tests/run.sh | 14 +- tests/run_expect_termsig.c | 38 + tests/s390_guarded_storage-v.c | 2 + tests/s390_guarded_storage-v.gen.test | 4 + tests/s390_guarded_storage.c | 208 + tests/s390_guarded_storage.gen.test | 4 + tests/s390_pci_mmio_read_write.c | 134 + tests/s390_pci_mmio_read_write.gen.test | 4 + tests/s390_runtime_instr.c | 78 + tests/s390_runtime_instr.gen.test | 4 + tests/s390_sthyi-v.c | 2 + tests/s390_sthyi-v.gen.test | 4 + tests/s390_sthyi.c | 763 + tests/s390_sthyi.gen.test | 4 + tests/sched.gen.test | 4 + tests/sched.in | 7 + tests/sched_get_priority_mxx.c | 9 +- tests/sched_get_priority_mxx.gen.test | 4 + tests/sched_get_priority_mxx.test | 6 - tests/sched_rr_get_interval.c | 15 +- tests/sched_rr_get_interval.gen.test | 4 + tests/sched_rr_get_interval.test | 6 - tests/sched_xetaffinity.c | 24 +- tests/sched_xetaffinity.gen.test | 4 + tests/sched_xetaffinity.test | 6 - tests/sched_xetattr.c | 338 +- tests/sched_xetattr.gen.test | 4 + tests/sched_xetattr.test | 12 - tests/sched_xetparam.c | 7 + tests/sched_xetparam.gen.test | 4 + tests/sched_xetparam.test | 6 - tests/sched_xetscheduler.c | 9 +- tests/sched_xetscheduler.gen.test | 4 + tests/sched_xetscheduler.test | 6 - tests/sched_yield.c | 7 + tests/sched_yield.gen.test | 4 + tests/sched_yield.test | 6 - tests/scm_rights-fd.test | 44 +- tests/scm_rights.c | 27 +- tests/scno_tampering.sh | 36 +- tests/seccomp-filter-v.c | 54 +- tests/seccomp-filter-v.gen.test | 4 + tests/seccomp-filter-v.test | 6 - tests/seccomp-filter.c | 38 +- tests/seccomp-filter.gen.test | 4 + tests/seccomp-filter.test | 6 - tests/seccomp-strict.c | 24 +- tests/seccomp-strict.test | 10 +- tests/seccomp_get_action_avail.c | 108 + tests/seccomp_get_action_avail.gen.test | 4 + tests/select-P.c | 2 + tests/select-P.gen.test | 4 + tests/select.c | 24 +- tests/select.gen.test | 4 + tests/select.test | 6 - tests/semop.c | 56 +- tests/semop.gen.test | 4 + tests/semop.test | 6 - tests/sendfile.c | 99 +- tests/sendfile.gen.test | 4 + tests/sendfile.test | 6 - tests/sendfile64.c | 94 +- tests/sendfile64.gen.test | 4 + tests/sendfile64.test | 6 - tests/set_mempolicy.c | 25 +- tests/set_mempolicy.gen.test | 4 + tests/set_mempolicy.test | 6 - tests/set_ptracer_any.c | 35 +- tests/set_sigblock.c | 33 + tests/set_sigign.c | 29 + tests/setdomainname.c | 7 + tests/setdomainname.gen.test | 4 + tests/setdomainname.test | 6 - tests/setfsgid.c | 7 + tests/setfsgid.gen.test | 4 + tests/setfsgid.test | 6 - tests/setfsgid32.c | 7 + tests/setfsgid32.gen.test | 4 + tests/setfsgid32.test | 6 - tests/setfsugid.c | 25 +- tests/setfsuid.c | 7 + tests/setfsuid.gen.test | 4 + tests/setfsuid.test | 6 - tests/setfsuid32.c | 7 + tests/setfsuid32.gen.test | 4 + tests/setfsuid32.test | 6 - tests/setgid.c | 7 + tests/setgid.gen.test | 4 + tests/setgid.test | 6 - tests/setgid32.c | 7 + tests/setgid32.gen.test | 4 + tests/setgid32.test | 6 - tests/setgroups.c | 35 +- tests/setgroups.gen.test | 4 + tests/setgroups.test | 6 - tests/setgroups32.c | 7 + tests/setgroups32.gen.test | 4 + tests/setgroups32.test | 6 - tests/sethostname.c | 35 +- tests/sethostname.gen.test | 4 + tests/sethostname.test | 6 - tests/setns.c | 23 +- tests/setns.gen.test | 4 + tests/setns.test | 6 - tests/setregid.c | 7 + tests/setregid.gen.test | 4 + tests/setregid.test | 6 - tests/setregid32.c | 7 + tests/setregid32.gen.test | 4 + tests/setregid32.test | 6 - tests/setresgid.c | 7 + tests/setresgid.gen.test | 4 + tests/setresgid.test | 6 - tests/setresgid32.c | 7 + tests/setresgid32.gen.test | 4 + tests/setresgid32.test | 6 - tests/setresugid.c | 24 +- tests/setresuid.c | 7 + tests/setresuid.gen.test | 4 + tests/setresuid.test | 6 - tests/setresuid32.c | 7 + tests/setresuid32.gen.test | 4 + tests/setresuid32.test | 6 - tests/setreugid.c | 24 +- tests/setreuid.c | 7 + tests/setreuid.gen.test | 4 + tests/setreuid.test | 6 - tests/setreuid32.c | 7 + tests/setreuid32.gen.test | 4 + tests/setreuid32.test | 6 - tests/setrlimit-Xabbrev.c | 1 + tests/setrlimit-Xabbrev.gen.test | 4 + tests/setrlimit-Xraw.c | 2 + tests/setrlimit-Xraw.gen.test | 4 + tests/setrlimit-Xverbose.c | 2 + tests/setrlimit-Xverbose.gen.test | 4 + tests/setrlimit.c | 47 +- tests/setrlimit.gen.test | 4 + tests/setrlimit.test | 6 - tests/setugid.c | 30 +- tests/setuid.c | 7 + tests/setuid.gen.test | 4 + tests/setuid.test | 6 - tests/setuid32.c | 7 + tests/setuid32.gen.test | 4 + tests/setuid32.test | 6 - tests/shmxt.c | 36 +- tests/shmxt.gen.test | 4 + tests/shmxt.test | 12 - tests/shutdown.c | 7 + tests/shutdown.gen.test | 4 + tests/shutdown.test | 6 - tests/sigaction.awk | 95 - tests/sigaction.c | 222 +- tests/sigaction.gen.test | 4 + tests/sigaction.test | 11 - tests/sigaltstack.c | 7 + tests/sigaltstack.test | 7 +- tests/sigblock.test | 27 + tests/sigign.test | 27 + tests/siginfo.c | 24 +- tests/siginfo.gen.test | 4 + tests/siginfo.test | 6 - tests/signal.c | 112 + tests/signal.gen.test | 4 + tests/signal2name.c | 10 +- tests/signal_receive.c | 112 +- tests/signal_receive.gen.test | 4 + tests/signal_receive.test | 6 - tests/signalfd4.c | 47 +- tests/signalfd4.gen.test | 4 + tests/signalfd4.test | 6 - tests/sigpending.c | 86 + tests/sigpending.gen.test | 4 + tests/sigprocmask.c | 131 + tests/sigprocmask.gen.test | 4 + tests/sigreturn.c | 85 +- tests/sigreturn.gen.test | 4 + tests/sigreturn.test | 48 - tests/sigsuspend.c | 97 + tests/sigsuspend.gen.test | 4 + tests/skip_unavailable.c | 20 + tests/sleep.c | 24 +- tests/so_error.c | 103 + tests/so_error.gen.test | 4 + tests/so_linger.c | 161 + tests/so_linger.gen.test | 4 + tests/so_peercred-Xabbrev.c | 1 + tests/so_peercred-Xabbrev.gen.test | 4 + tests/so_peercred-Xraw.c | 2 + tests/so_peercred-Xraw.gen.test | 4 + tests/so_peercred-Xverbose.c | 2 + tests/so_peercred-Xverbose.gen.test | 4 + tests/so_peercred.c | 190 + tests/so_peercred.gen.test | 4 + tests/sock_filter-v-Xabbrev.c | 1 + tests/sock_filter-v-Xabbrev.gen.test | 4 + tests/sock_filter-v-Xraw.c | 2 + tests/sock_filter-v-Xraw.gen.test | 4 + tests/sock_filter-v-Xverbose.c | 2 + tests/sock_filter-v-Xverbose.gen.test | 4 + tests/sock_filter-v.c | 211 + tests/sock_filter-v.gen.test | 4 + tests/sockaddr_xlat-Xabbrev.c | 1 + tests/sockaddr_xlat-Xabbrev.gen.test | 4 + tests/sockaddr_xlat-Xraw.c | 2 + tests/sockaddr_xlat-Xraw.gen.test | 4 + tests/sockaddr_xlat-Xverbose.c | 2 + tests/sockaddr_xlat-Xverbose.gen.test | 4 + tests/sockaddr_xlat.c | 271 + tests/socketcall.c | 24 +- tests/socketcall.gen.test | 4 + tests/socketcall.test | 6 - tests/sockname.c | 31 +- tests/sockopt-sol_netlink.c | 193 + tests/sockopt-sol_netlink.gen.test | 4 + tests/sockopt-timestamp.c | 197 + tests/sockopt-timestamp.gen.test | 4 + tests/splice.c | 27 +- tests/splice.gen.test | 4 + tests/splice.test | 6 - tests/sprintrc.c | 26 +- tests/stack-fcall-0.c | 9 +- tests/stack-fcall-1.c | 9 +- tests/stack-fcall-2.c | 9 +- tests/stack-fcall-3.c | 19 +- tests/stack-fcall-mangled-0.c | 2 + tests/stack-fcall-mangled-1.c | 2 + tests/stack-fcall-mangled-2.c | 2 + tests/stack-fcall-mangled-3.c | 2 + tests/stack-fcall-mangled.c | 2 + tests/stack-fcall.c | 14 +- tests/stack-fcall.h | 20 + tests/stat.c | 23 +- tests/stat.gen.test | 4 + tests/stat.test | 5 - tests/stat64.c | 23 +- tests/stat64.gen.test | 4 + tests/stat64.test | 5 - tests/statfs.c | 24 +- tests/statfs.expected | 1 - tests/statfs.gen.test | 4 + tests/statfs.test | 11 - tests/statfs64.c | 24 +- tests/statfs64.gen.test | 4 + tests/statfs64.test | 5 - tests/statx.c | 50 + tests/statx.gen.test | 4 + tests/statx.sh | 6 - tests/strace-C.test | 11 +- tests/strace-E.expected | 2 +- tests/strace-E.test | 9 +- tests/strace-S.test | 13 +- tests/strace-T.test | 11 +- tests/strace-V.test | 57 +- tests/strace-ff.test | 12 +- tests/strace-k-demangle.expected | 2 + tests/strace-k-demangle.test | 12 + tests/strace-k.expected | 2 + tests/strace-k.test | 89 +- tests/strace-log-merge-error.test | 37 + tests/strace-log-merge-suffix.test | 29 + tests/strace-r.expected | 2 +- tests/strace-r.test | 11 +- tests/strace-t.test | 34 +- tests/strace-tt.test | 12 +- tests/strace-ttt.test | 12 +- tests/strace.supp | 10 + tests/struct_flock.c | 107 - tests/sun_path.test | 9 +- tests/swap.c | 7 + tests/swap.gen.test | 4 + tests/swap.test | 6 - tests/sxetmask.c | 104 + tests/sxetmask.gen.test | 4 + tests/symlink.c | 17 +- tests/symlink.gen.test | 4 + tests/symlink.test | 6 - tests/symlinkat.c | 7 + tests/symlinkat.gen.test | 4 + tests/symlinkat.test | 6 - tests/sync.c | 7 + tests/sync.gen.test | 4 + tests/sync.test | 6 - tests/sync_file_range.c | 24 +- tests/sync_file_range.gen.test | 4 + tests/sync_file_range.test | 6 - tests/sync_file_range2.c | 24 +- tests/sync_file_range2.gen.test | 4 + tests/sync_file_range2.test | 6 - tests/syntax.sh | 59 + tests/sysinfo.c | 25 +- tests/sysinfo.gen.test | 4 + tests/sysinfo.test | 6 - tests/syslog.c | 7 + tests/syslog.gen.test | 4 + tests/syslog.test | 6 - tests/tail_alloc.c | 24 +- tests/tee.c | 24 +- tests/tee.gen.test | 4 + tests/tee.test | 6 - tests/termsig.test | 20 + tests/test_netlink.h | 104 + tests/test_nlattr.h | 343 + tests/test_printpath.c | 91 + tests/test_printstrn.c | 99 + tests/test_ucopy.c | 143 + tests/test_ucopy.h | 20 + tests/tests.h | 187 +- tests/threads-execve.c | 44 +- tests/threads-execve.test | 40 +- tests/time.c | 38 +- tests/time.gen.test | 4 + tests/time.test | 6 - tests/timer_create.c | 30 +- tests/timer_create.gen.test | 4 + tests/timer_create.test | 6 - tests/timer_xettime.c | 110 +- tests/timer_xettime.gen.test | 4 + tests/timer_xettime.test | 6 - tests/timerfd_xettime.c | 105 +- tests/timerfd_xettime.gen.test | 4 + tests/timerfd_xettime.test | 6 - tests/times-fail.c | 9 +- tests/times-fail.gen.test | 4 + tests/times-fail.test | 6 - tests/times.c | 25 +- tests/times.gen.test | 4 + tests/times.test | 6 - tests/tprintf.c | 24 +- tests/trace_fstat.gen.test | 4 + tests/trace_fstat.in | 11 + tests/trace_fstatfs.gen.test | 4 + tests/trace_fstatfs.in | 2 + tests/trace_lstat.gen.test | 4 + tests/trace_lstat.in | 3 + tests/trace_personality_32.gen.test | 4 + tests/trace_personality_32.in | 1 + tests/trace_personality_64.gen.test | 4 + tests/trace_personality_64.in | 1 + tests/trace_personality_regex_32.gen.test | 4 + tests/trace_personality_regex_32.in | 3 + tests/trace_personality_regex_64.gen.test | 4 + tests/trace_personality_regex_64.in | 3 + tests/trace_personality_regex_x32.gen.test | 4 + tests/trace_personality_regex_x32.in | 3 + tests/trace_personality_x32.gen.test | 4 + tests/trace_personality_x32.in | 1 + tests/trace_question.gen.test | 4 + tests/trace_question.in | 4 + tests/trace_stat.gen.test | 4 + tests/trace_stat.in | 3 + tests/trace_stat_like.gen.test | 4 + tests/trace_stat_like.in | 18 + tests/trace_statfs.gen.test | 4 + tests/trace_statfs.in | 2 + tests/trace_statfs_like.gen.test | 4 + tests/trace_statfs_like.in | 5 + tests/truncate.c | 24 +- tests/truncate.gen.test | 4 + tests/truncate.test | 6 - tests/truncate64.c | 24 +- tests/truncate64.gen.test | 4 + tests/truncate64.test | 6 - tests/ugetrlimit.c | 7 + tests/ugetrlimit.gen.test | 4 + tests/ugetrlimit.test | 6 - tests/uio.c | 29 +- tests/uio.test | 9 +- tests/umask.c | 7 + tests/umask.gen.test | 4 + tests/umask.test | 6 - tests/umode_t.c | 32 +- tests/umount.c | 26 +- tests/umount.test | 7 +- tests/umount2.c | 26 +- tests/umount2.test | 7 +- tests/umoven-illptr.c | 24 +- tests/umoven-illptr.gen.test | 4 + tests/umoven-illptr.test | 6 - tests/umovestr-illptr.c | 24 +- tests/umovestr-illptr.gen.test | 4 + tests/umovestr-illptr.test | 6 - tests/umovestr.c | 24 +- tests/umovestr.test | 5 + tests/umovestr2.c | 24 +- tests/umovestr2.test | 9 +- tests/umovestr3.c | 25 +- tests/umovestr3.gen.test | 4 + tests/umovestr3.test | 6 - tests/uname.c | 24 +- tests/uname.test | 10 +- tests/unblock_reset_raise.c | 34 + tests/unix-pair-send-recv.c | 24 +- tests/unix-pair-send-recv.test | 9 +- tests/unix-pair-sendto-recvfrom.c | 25 +- tests/unix-pair-sendto-recvfrom.test | 9 +- tests/unlink.c | 7 + tests/unlink.gen.test | 4 + tests/unlink.test | 6 - tests/unlinkat.c | 7 + tests/unlinkat.gen.test | 4 + tests/unlinkat.test | 6 - tests/unshare.c | 23 +- tests/unshare.gen.test | 4 + tests/unshare.test | 6 - tests/userfaultfd.c | 24 +- tests/userfaultfd.gen.test | 4 + tests/userfaultfd.test | 6 - tests/ustat.c | 33 +- tests/ustat.gen.test | 4 + tests/ustat.test | 6 - tests/utime.c | 45 +- tests/utime.gen.test | 4 + tests/utime.test | 6 - tests/utimensat-Xabbrev.c | 1 + tests/utimensat-Xabbrev.gen.test | 4 + tests/utimensat-Xraw.c | 2 + tests/utimensat-Xraw.gen.test | 4 + tests/utimensat-Xverbose.c | 2 + tests/utimensat-Xverbose.gen.test | 4 + tests/utimensat.c | 244 +- tests/utimensat.gen.test | 4 + tests/utimensat.test | 20 - tests/utimes.c | 72 +- tests/utimes.gen.test | 4 + tests/utimes.test | 6 - tests/vfork-f.c | 24 +- tests/vfork-f.gen.test | 4 + tests/vfork-f.test | 5 - tests/vhangup.c | 7 + tests/vhangup.gen.test | 4 + tests/vhangup.test | 7 - tests/vmsplice.c | 25 +- tests/vmsplice.gen.test | 4 + tests/vmsplice.test | 6 - tests/wait4-v.gen.test | 4 + tests/wait4-v.test | 6 - tests/wait4.c | 39 +- tests/wait4.gen.test | 4 + tests/wait4.test | 6 - tests/waitid-v.gen.test | 4 + tests/waitid-v.test | 6 - tests/waitid.c | 38 +- tests/waitid.gen.test | 4 + tests/waitid.test | 6 - tests/waitpid.c | 24 +- tests/waitpid.gen.test | 4 + tests/waitpid.test | 6 - tests/xattr-strings.c | 7 + tests/xattr-strings.gen.test | 4 + tests/xattr-strings.test | 7 - tests/xattr.c | 27 +- tests/xattr.gen.test | 4 + tests/xattr.test | 12 - tests/xchownx.c | 38 +- tests/xet_robust_list.c | 27 +- tests/xet_robust_list.gen.test | 4 + tests/xet_robust_list.test | 6 - tests/xet_thread_area_x86.c | 206 + tests/xet_thread_area_x86.test | 16 + tests/xetitimer.c | 195 +- tests/xetitimer.gen.test | 4 + tests/xetitimer.test | 6 - tests/xetpgid.c | 30 +- tests/xetpgid.gen.test | 4 + tests/xetpgid.test | 6 - tests/xetpriority.c | 12 +- tests/xetpriority.gen.test | 4 + tests/xetpriority.test | 6 - tests/xettimeofday.c | 84 +- tests/xettimeofday.gen.test | 4 + tests/xettimeofday.test | 6 - tests/xgetrlimit.c | 75 +- tests/xselect.c | 485 +- tests/xstatfs.c | 24 +- tests/xstatfs64.c | 24 +- tests/xstatfsx.c | 44 +- tests/xstatx.c | 369 +- tests/xutimes.c | 129 + tests/zeroargc.c | 23 + time.c | 266 +- times.c | 30 +- trace_event.h | 71 + truncate.c | 7 + ubi.c | 71 +- ucopy.c | 308 + uid.c | 39 +- uid16.c | 7 + umask.c | 7 + umount.c | 7 + uname.c | 42 +- unwind-libdw.c | 191 + unwind-libunwind.c | 170 + unwind.c | 499 +- unwind.h | 50 + upeek.c | 30 +- upoke.c | 31 +- userfaultfd.c | 172 +- ustat.c | 23 +- util.c | 1421 +- utime.c | 14 +- utimes.c | 46 +- v4l2.c | 563 +- wait.c | 57 +- wait.h | 42 + xattr.c | 24 +- xfs_quota_stat.h | 29 + xlat.c | 500 + xlat.h | 47 +- xlat/Makemodule.am | 434 +- xlat/access_flags.h | 16 +- xlat/aclipc.h | 23 - xlat/aclipc.in | 3 - xlat/addrfams.h | 372 +- xlat/addrfams.in | 3 + xlat/adjtimex_modes.h | 124 +- xlat/adjtimex_modes.in | 27 +- xlat/adjtimex_state.h | 66 +- xlat/adjtimex_state.in | 13 +- xlat/adjtimex_status.h | 138 +- xlat/adjtimex_status.in | 32 +- xlat/advise.h | 88 +- xlat/advise.in | 17 +- xlat/af_packet_types.h | 83 +- xlat/af_packet_types.in | 16 +- xlat/af_packet_versions.h | 46 + xlat/af_packet_versions.in | 3 + xlat/aio_cmds.h | 94 + xlat/aio_cmds.in | 10 + xlat/archvals.h | 94 +- xlat/archvals.in | 10 +- xlat/arp_hardware_types.h | 486 +- xlat/arp_hardware_types.in | 131 +- xlat/at_flags.h | 42 +- xlat/at_statx_sync_types.h | 55 + xlat/at_statx_sync_types.in | 5 + xlat/atomic_ops.h | 16 +- xlat/audit_arch.h | 19 +- xlat/ax25_protocols.h | 130 + xlat/ax25_protocols.in | 17 + xlat/baud_options.h | 16 +- xlat/bdaddr_types.h | 46 + xlat/bdaddr_types.in | 4 + xlat/blkpg_ops.h | 36 +- xlat/block_ioctl_cmds.h | 301 + xlat/block_ioctl_cmds.in | 39 + xlat/bluetooth_l2_cid.h | 103 + xlat/bluetooth_l2_cid.in | 11 + xlat/bluetooth_l2_psm.h | 95 + xlat/bluetooth_l2_psm.in | 10 + xlat/bootflags1.h | 22 +- xlat/bootflags2.h | 40 +- xlat/bootflags3.h | 64 +- xlat/bpf_attach_flags.h | 38 + xlat/bpf_attach_flags.in | 2 + xlat/bpf_attach_type.h | 160 +- xlat/bpf_attach_type.in | 16 + xlat/bpf_class.h | 80 +- xlat/bpf_class.in | 17 +- xlat/bpf_commands.h | 192 +- xlat/bpf_commands.in | 13 + xlat/bpf_file_mode_flags.h | 38 + xlat/bpf_file_mode_flags.in | 2 + xlat/bpf_map_flags.h | 78 + xlat/bpf_map_flags.in | 7 + xlat/bpf_map_types.h | 208 +- xlat/bpf_map_types.in | 13 + xlat/bpf_map_update_elem_flags.h | 48 +- xlat/bpf_map_update_elem_flags.in | 2 + xlat/bpf_miscop.h | 38 +- xlat/bpf_miscop.in | 4 +- xlat/bpf_mode.h | 73 +- xlat/bpf_mode.in | 14 +- xlat/bpf_op_alu.h | 123 +- xlat/bpf_op_alu.in | 27 +- xlat/bpf_op_jmp.h | 126 +- xlat/bpf_op_jmp.in | 24 +- xlat/bpf_prog_flags.h | 38 + xlat/bpf_prog_flags.in | 2 + xlat/bpf_prog_types.h | 192 +- xlat/bpf_prog_types.in | 10 + xlat/bpf_query_flags.h | 30 + xlat/bpf_query_flags.in | 1 + xlat/bpf_rval.h | 45 +- xlat/bpf_rval.in | 6 +- xlat/bpf_size.h | 52 +- xlat/bpf_size.in | 8 +- xlat/bpf_src.h | 38 +- xlat/bpf_src.in | 4 +- xlat/bpf_task_fd_type.h | 70 + xlat/bpf_task_fd_type.in | 7 + xlat/bsg_flags.h | 28 +- xlat/bsg_protocol.h | 16 +- xlat/bsg_subprotocol.h | 16 +- xlat/bt_protocols.h | 80 +- xlat/bt_protocols.in | 17 +- xlat/btrfs_balance_args.h | 84 +- xlat/btrfs_balance_ctl_cmds.h | 30 +- xlat/btrfs_balance_flags.h | 48 +- xlat/btrfs_balance_state.h | 36 +- xlat/btrfs_compress_types.h | 36 +- xlat/btrfs_cont_reading_from_srcdev_mode.h | 40 + xlat/btrfs_cont_reading_from_srcdev_mode.in | 2 + xlat/btrfs_defrag_flags.h | 18 +- xlat/btrfs_dev_replace_cmds.h | 18 +- xlat/btrfs_dev_replace_results.h | 18 +- xlat/btrfs_dev_replace_state.h | 18 +- xlat/btrfs_dev_stats_flags.h | 18 +- xlat/btrfs_dev_stats_values.h | 18 +- xlat/btrfs_features_compat.h | 18 +- xlat/btrfs_features_compat_ro.h | 30 +- xlat/btrfs_features_incompat.h | 86 +- xlat/btrfs_features_incompat.in | 1 + xlat/btrfs_key_types.h | 264 +- xlat/btrfs_logical_ino_args_flags.h | 32 + xlat/btrfs_logical_ino_args_flags.in | 1 + xlat/btrfs_qgroup_ctl_cmds.h | 18 +- xlat/btrfs_qgroup_inherit_flags.h | 18 +- xlat/btrfs_qgroup_limit_flags.h | 54 +- xlat/btrfs_qgroup_status_flags.h | 30 +- xlat/btrfs_scrub_flags.h | 24 +- xlat/btrfs_send_flags.h | 36 +- xlat/btrfs_snap_flags_v2.h | 18 +- xlat/btrfs_space_info_flags.h | 84 +- xlat/btrfs_tree_objectids.h | 96 +- xlat/cacheflush_scope.h | 16 +- xlat/caif_protocols.h | 70 + xlat/caif_protocols.in | 7 + xlat/can_protocols.h | 70 + xlat/can_protocols.in | 7 + xlat/cap.h | 16 +- xlat/cap_mask0.h | 16 +- xlat/cap_mask1.h | 16 +- xlat/cap_version.h | 16 +- xlat/clockflags.h | 16 +- xlat/clocknames.h | 111 +- xlat/clocknames.in | 1 + xlat/clone_flags.h | 154 +- xlat/cpuclocknames.h | 45 +- xlat/cpuclocknames.in | 7 +- xlat/crypto_nl_attrs.h | 118 + xlat/crypto_nl_attrs.in | 12 + xlat/dcb_commands.h | 246 + xlat/dcb_commands.in | 28 + xlat/delete_module_flags.h | 16 +- xlat/dirent_types.h | 12 +- xlat/dm_flags.h | 126 +- xlat/ebpf_class.h | 86 + xlat/ebpf_class.in | 9 + xlat/ebpf_mode.h | 62 + xlat/ebpf_mode.in | 5 + xlat/ebpf_op_alu.h | 46 + xlat/ebpf_op_alu.in | 3 + xlat/ebpf_op_jmp.h | 94 + xlat/ebpf_op_jmp.in | 9 + xlat/ebpf_regs.h | 110 + xlat/ebpf_regs.in | 12 + xlat/ebpf_size.h | 30 + xlat/ebpf_size.in | 1 + xlat/efd_flags.h | 34 +- xlat/epollctls.h | 34 +- xlat/epollevents.h | 145 +- xlat/epollevents.in | 31 +- xlat/epollflags.h | 22 +- xlat/ethernet_protocols.h | 768 +- xlat/ethernet_protocols.in | 176 +- xlat/evdev_abs.h | 309 +- xlat/evdev_abs.in | 84 +- xlat/evdev_autorepeat.h | 40 +- xlat/evdev_autorepeat.in | 5 +- xlat/evdev_ev.h | 103 +- xlat/evdev_ev.in | 24 +- xlat/evdev_ff_status.h | 40 +- xlat/evdev_ff_status.in | 5 +- xlat/evdev_ff_types.h | 139 +- xlat/evdev_ff_types.in | 33 +- xlat/evdev_keycode.h | 4019 ++- xlat/evdev_keycode.in | 1221 +- xlat/evdev_leds.h | 103 +- xlat/evdev_leds.in | 23 +- xlat/evdev_misc.h | 68 +- xlat/evdev_misc.in | 13 +- xlat/evdev_mtslots.h | 18 +- xlat/evdev_prop.h | 75 +- xlat/evdev_prop.in | 15 +- xlat/evdev_relative_axes.h | 120 +- xlat/evdev_relative_axes.in | 24 +- xlat/evdev_snd.h | 47 +- xlat/evdev_snd.in | 7 +- xlat/evdev_switch.h | 142 +- xlat/evdev_switch.in | 33 +- xlat/evdev_sync.h | 28 - xlat/evdev_sync.in | 4 - xlat/f_owner_types.h | 34 +- xlat/f_seals.h | 48 +- xlat/f_seals.in | 1 + xlat/falloc_flags.h | 58 +- xlat/fan_classes.h | 34 +- xlat/fan_event_flags.h | 148 +- xlat/fan_event_flags.in | 29 +- xlat/fan_init_flags.h | 64 +- xlat/fan_init_flags.in | 3 + xlat/fan_mark_flags.h | 72 +- xlat/fan_mark_flags.in | 1 + xlat/fcntl64cmds.h | 27 - xlat/fcntl64cmds.in | 4 - xlat/fcntlcmds.h | 442 +- xlat/fcntlcmds.in | 68 + xlat/fdflags.h | 16 +- xlat/fib_rule_actions.h | 94 + xlat/fib_rule_actions.in | 9 + xlat/fib_rule_flags.h | 40 + xlat/fib_rule_flags.in | 6 + xlat/fiemap_extent_flags.h | 82 +- xlat/fiemap_flags.h | 34 +- xlat/flockcmds.h | 64 +- xlat/fsmagic.h | 22 +- xlat/fsmagic.in | 5 +- xlat/futexbitset.h | 30 + xlat/futexbitset.in | 1 + xlat/futexops.h | 166 +- xlat/futexwakecmps.h | 52 +- xlat/futexwakeops.h | 46 +- xlat/gen.sh | 203 +- xlat/getrandom_flags.h | 28 +- xlat/getsock_ip_options.h | 91 + xlat/getsock_ip_options.in | 29 + xlat/getsock_ipv6_options.h | 40 + xlat/getsock_ipv6_options.in | 10 + xlat/getsock_options.h | 44 + xlat/getsock_options.in | 5 + xlat/getsockipoptions.h | 83 - xlat/getsockipoptions.in | 29 - xlat/getsockipv6options.h | 32 - xlat/getsockipv6options.in | 10 - xlat/hci_channels.h | 59 +- xlat/hci_channels.in | 11 +- xlat/hw_breakpoint_len.h | 40 +- xlat/hw_breakpoint_type.h | 51 +- xlat/hw_breakpoint_type.in | 4 +- xlat/icmpfilterflags.h | 16 +- xlat/if_dqblk_valid.h | 52 +- xlat/if_dqinfo_flags.h | 28 +- xlat/if_dqinfo_valid.h | 34 +- xlat/ifaddrflags.h | 58 + xlat/ifaddrflags.in | 12 + xlat/iffflags.h | 159 +- xlat/iffflags.in | 35 +- xlat/in6_addr_gen_mode.h | 54 + xlat/in6_addr_gen_mode.in | 5 + xlat/inet6_devconf_indices.h | 430 + xlat/inet6_devconf_indices.in | 52 + xlat/inet6_if_flags.h | 63 + xlat/inet6_if_flags.in | 6 + xlat/inet_devconf_indices.h | 279 + xlat/inet_devconf_indices.in | 34 + xlat/inet_diag_attrs.h | 40 + xlat/inet_diag_attrs.in | 19 + xlat/inet_diag_bytecodes.h | 35 + xlat/inet_diag_bytecodes.in | 14 + xlat/inet_diag_extended_flags.h | 39 + xlat/inet_diag_extended_flags.in | 18 + xlat/inet_diag_req_attrs.h | 24 + xlat/inet_diag_req_attrs.in | 3 + xlat/inet_protocols.h | 271 +- xlat/inet_protocols.in | 67 +- xlat/inotify_flags.h | 150 +- xlat/inotify_flags.in | 1 + xlat/inotify_init_flags.h | 28 +- xlat/ioctl_dirs.h | 22 +- xlat/ioctl_dirs.in | 2 +- xlat/ioprio_class.h | 44 +- xlat/ioprio_class.in | 9 +- xlat/ioprio_who.h | 37 +- xlat/ioprio_who.in | 7 +- xlat/ip_cmsg_types.h | 64 +- xlat/ip_type_of_services.h | 29 + xlat/ip_type_of_services.in | 4 + xlat/ipc_msg_flags.h | 16 +- xlat/ipc_private.h | 25 + xlat/ipc_private.in | 1 + xlat/ipccalls.h | 88 +- xlat/irda_protocols.h | 38 + xlat/irda_protocols.in | 3 + xlat/isdn_protocols.h | 132 + xlat/isdn_protocols.in | 19 + xlat/itimer_which.h | 45 +- xlat/itimer_which.in | 7 +- xlat/kcm_protocols.h | 30 + xlat/kcm_protocols.in | 2 + xlat/kcmp_types.h | 66 +- xlat/kcmp_types.in | 1 + xlat/kexec_arch_values.h | 94 +- xlat/kexec_file_load_flags.h | 34 +- xlat/kexec_load_flags.h | 28 +- xlat/key_perms.h | 184 +- xlat/key_reqkeys.h | 88 +- xlat/key_reqkeys.in | 1 + xlat/key_spec.h | 80 +- xlat/key_spec.in | 1 + xlat/keyctl_commands.h | 168 +- xlat/keyctl_commands.in | 1 + xlat/kvm_cap.h | 1318 + xlat/kvm_cap.in | 163 + xlat/kvm_cpuid_flags.h | 56 + xlat/kvm_cpuid_flags.in | 10 + xlat/kvm_exit_reason.h | 247 + xlat/kvm_exit_reason.in | 30 + xlat/kvm_mem_flags.h | 38 + xlat/kvm_mem_flags.in | 2 + xlat/lockfcmds.h | 16 +- xlat/loop_cmds.h | 115 +- xlat/loop_cmds.in | 2 +- xlat/loop_crypt_type_options.h | 18 +- xlat/loop_flags_options.h | 56 +- xlat/lwtunnel_encap_types.h | 78 + xlat/lwtunnel_encap_types.in | 7 + xlat/madvise_cmds.h | 311 +- xlat/madvise_cmds.in | 92 +- xlat/mbindflags.h | 34 +- xlat/mctl_sync.h | 16 +- xlat/mdb_flags.h | 25 + xlat/mdb_flags.in | 1 + xlat/mdb_states.h | 28 + xlat/mdb_states.in | 2 + xlat/membarrier_cmds.h | 80 +- xlat/membarrier_cmds.in | 10 +- xlat/memfd_create_flags.h | 36 +- xlat/memfd_create_flags.in | 1 + xlat/mempolicyflags.h | 28 +- xlat/mlock_flags.h | 22 +- xlat/mlockall_flags.h | 64 +- xlat/mlockall_flags.in | 6 + xlat/mmap_flags.h | 702 +- xlat/mmap_flags.in | 227 +- xlat/mmap_prot.h | 19 +- xlat/mmap_prot.in | 1 + xlat/modem_flags.h | 16 +- xlat/modetypes.h | 16 +- xlat/module_init_flags.h | 28 +- xlat/mount_flags.h | 198 +- xlat/mount_flags.in | 1 + xlat/move_pages_flags.h | 16 +- xlat/mq_attr_flags.h | 18 +- xlat/mremap_flags.h | 16 +- xlat/msg_flags.h | 206 +- xlat/msg_flags.in | 55 +- xlat/msgctl_flags.h | 83 +- xlat/msgctl_flags.in | 10 +- xlat/mtd_file_mode_options.h | 18 +- xlat/mtd_flags_options.h | 18 +- xlat/mtd_mode_options.h | 18 +- xlat/mtd_nandecc_options.h | 18 +- xlat/mtd_otp_options.h | 18 +- xlat/mtd_type_options.h | 18 +- xlat/multicast_router_types.h | 54 + xlat/multicast_router_types.in | 4 + xlat/name_to_handle_at_flags.h | 28 +- xlat/nbd_ioctl_cmds.h | 110 + xlat/nbd_ioctl_cmds.in | 11 + xlat/nbd_ioctl_flags.h | 128 + xlat/nbd_ioctl_flags.in | 29 + xlat/neighbor_cache_entry_flags.h | 86 + xlat/neighbor_cache_entry_flags.in | 8 + xlat/neighbor_cache_entry_states.h | 49 + xlat/neighbor_cache_entry_states.in | 9 + xlat/netfilter_versions.h | 38 + xlat/netfilter_versions.in | 2 + xlat/netlink_ack_flags.h | 28 + xlat/netlink_ack_flags.in | 2 + xlat/netlink_delete_flags.h | 25 + xlat/netlink_delete_flags.in | 1 + xlat/netlink_diag_attrs.h | 27 + xlat/netlink_diag_attrs.in | 6 + xlat/netlink_diag_show.h | 34 + xlat/netlink_diag_show.in | 4 + xlat/netlink_flags.h | 52 +- xlat/netlink_get_flags.h | 34 + xlat/netlink_get_flags.in | 4 + xlat/netlink_new_flags.h | 34 + xlat/netlink_new_flags.in | 4 + xlat/netlink_protocols.h | 149 +- xlat/netlink_protocols.in | 1 + xlat/netlink_sk_meminfo_indices.h | 94 + xlat/netlink_sk_meminfo_indices.in | 10 + xlat/netlink_socket_flags.h | 40 + xlat/netlink_socket_flags.in | 6 + xlat/netlink_states.h | 47 + xlat/netlink_states.in | 4 + xlat/netlink_types.h | 40 +- xlat/nf_acct_msg_types.h | 62 + xlat/nf_acct_msg_types.in | 5 + xlat/nf_cthelper_msg_types.h | 46 + xlat/nf_cthelper_msg_types.in | 3 + xlat/nf_ctnetlink_exp_msg_types.h | 54 + xlat/nf_ctnetlink_exp_msg_types.in | 4 + xlat/nf_ctnetlink_msg_types.h | 86 + xlat/nf_ctnetlink_msg_types.in | 8 + xlat/nf_cttimeout_msg_types.h | 62 + xlat/nf_cttimeout_msg_types.in | 5 + xlat/nf_ipset_msg_types.h | 176 + xlat/nf_ipset_msg_types.in | 21 + xlat/nf_nft_compat_msg_types.h | 30 + xlat/nf_nft_compat_msg_types.in | 1 + xlat/nf_nftables_msg_types.h | 198 + xlat/nf_nftables_msg_types.in | 22 + xlat/nf_osf_msg_types.h | 38 + xlat/nf_osf_msg_types.in | 2 + xlat/nf_queue_msg_types.h | 54 + xlat/nf_queue_msg_types.in | 4 + xlat/nf_ulog_msg_types.h | 38 + xlat/nf_ulog_msg_types.in | 2 + xlat/nfc_protocols.h | 38 + xlat/nfc_protocols.in | 3 + xlat/nl_audit_types.h | 787 + xlat/nl_audit_types.in | 117 + xlat/nl_crypto_types.h | 62 + xlat/nl_crypto_types.in | 5 + xlat/nl_netfilter_msg_types.h | 33 + xlat/nl_netfilter_msg_types.in | 2 + xlat/nl_netfilter_subsys_ids.h | 118 + xlat/nl_netfilter_subsys_ids.in | 12 + xlat/nl_route_types.h | 452 + xlat/nl_route_types.in | 71 + xlat/nl_selinux_types.h | 38 + xlat/nl_selinux_types.in | 2 + xlat/nl_sock_diag_types.h | 54 + xlat/nl_sock_diag_types.in | 4 + xlat/nl_xfrm_types.h | 217 + xlat/nl_xfrm_types.in | 34 + xlat/nlmsgerr_attrs.h | 54 + xlat/nlmsgerr_attrs.in | 4 + xlat/notifyflags.h | 16 +- xlat/nt_descriptor_types.h | 561 +- xlat/nt_descriptor_types.in | 93 +- xlat/numa_node.h | 30 + xlat/numa_node.in | 1 + xlat/open_access_modes.h | 42 +- xlat/open_access_modes.in | 9 +- xlat/open_mode_flags.h | 810 +- xlat/open_mode_flags.in | 229 +- xlat/openmodessol.h | 28 - xlat/openmodessol.in | 14 - xlat/packet_diag_attrs.h | 30 + xlat/packet_diag_attrs.in | 9 + xlat/packet_diag_info_flags.h | 37 + xlat/packet_diag_info_flags.in | 5 + xlat/packet_diag_show.h | 40 + xlat/packet_diag_show.in | 6 + xlat/packet_mreq_type.h | 16 +- xlat/perf_attr_size.h | 52 +- xlat/perf_branch_sample_type.h | 120 +- xlat/perf_branch_sample_type.in | 1 + xlat/perf_event_open_flags.h | 40 +- xlat/perf_event_read_format.h | 40 +- xlat/perf_event_sample_format.h | 138 +- xlat/perf_event_sample_format.in | 1 + xlat/perf_hw_cache_id.h | 61 +- xlat/perf_hw_cache_id.in | 2 +- xlat/perf_hw_cache_op_id.h | 37 +- xlat/perf_hw_cache_op_id.in | 2 +- xlat/perf_hw_cache_op_result_id.h | 31 +- xlat/perf_hw_cache_op_result_id.in | 2 +- xlat/perf_hw_id.h | 79 +- xlat/perf_hw_id.in | 2 +- xlat/perf_ioctl_cmds.h | 120 + xlat/perf_ioctl_cmds.in | 12 + xlat/perf_ioctl_flags.h | 32 + xlat/perf_ioctl_flags.in | 1 + xlat/perf_sw_ids.h | 85 +- xlat/perf_sw_ids.in | 2 +- xlat/perf_type_id.h | 55 +- xlat/perf_type_id.in | 2 +- xlat/personality_flags.h | 93 +- xlat/personality_flags.in | 23 +- xlat/personality_types.h | 178 +- xlat/personality_types.in | 46 +- xlat/phonet_protocols.h | 46 + xlat/phonet_protocols.in | 4 + xlat/pkey_access.h | 36 +- xlat/pkey_access.in | 1 + xlat/policies.h | 40 +- xlat/pollflags.h | 213 +- xlat/pollflags.in | 52 +- xlat/pr_cap_ambient.h | 40 +- xlat/pr_dumpable.h | 42 +- xlat/pr_fp_mode.h | 32 +- xlat/pr_mce_kill.h | 28 +- xlat/pr_mce_kill_policy.h | 34 +- xlat/pr_set_mm.h | 106 +- xlat/pr_spec_cmds.h | 38 + xlat/pr_spec_cmds.in | 3 + xlat/pr_spec_get_store_bypass_flags.h | 70 + xlat/pr_spec_get_store_bypass_flags.in | 6 + xlat/pr_spec_set_store_bypass_flags.h | 54 + xlat/pr_spec_set_store_bypass_flags.in | 4 + xlat/pr_sve_vl_flags.h | 38 + xlat/pr_sve_vl_flags.in | 2 + xlat/pr_tsc.h | 28 +- xlat/pr_unalign_flags.h | 28 +- xlat/prctl_options.h | 338 +- xlat/prctl_options.in | 5 + xlat/priorities.h | 16 +- xlat/ptp_flags_options.h | 16 +- xlat/ptrace_cmds.h | 39 +- xlat/ptrace_cmds.in | 2 + xlat/ptrace_events.h | 18 +- xlat/ptrace_peeksiginfo_flags.h | 22 +- xlat/ptrace_setoptions_flags.h | 18 +- xlat/ptrace_syscall_info_op.h | 34 + xlat/ptrace_syscall_info_op.in | 5 + xlat/quota_formats.h | 40 +- xlat/quotacmds.h | 226 +- xlat/quotatypes.h | 34 +- xlat/random_ioctl_cmds.h | 78 + xlat/random_ioctl_cmds.in | 7 + xlat/rename_flags.h | 34 +- xlat/resource_flags.h | 12 +- xlat/resources.h | 287 +- xlat/resources.in | 56 +- xlat/riscv_flush_icache_flags.h | 30 + xlat/riscv_flush_icache_flags.in | 1 + xlat/route_nexthop_flags.h | 70 + xlat/route_nexthop_flags.in | 6 + xlat/routing_flags.h | 37 + xlat/routing_flags.in | 5 + xlat/routing_protocols.h | 191 + xlat/routing_protocols.in | 22 + xlat/routing_scopes.h | 57 + xlat/routing_scopes.in | 5 + xlat/routing_table_ids.h | 57 + xlat/routing_table_ids.in | 5 + xlat/routing_types.h | 113 + xlat/routing_types.in | 12 + xlat/rtnl_addr_attrs.h | 110 + xlat/rtnl_addr_attrs.in | 11 + xlat/rtnl_addrlabel_attrs.h | 38 + xlat/rtnl_addrlabel_attrs.in | 2 + xlat/rtnl_dcb_attrs.h | 158 + xlat/rtnl_dcb_attrs.in | 17 + xlat/rtnl_ifla_af_spec_inet6_attrs.h | 94 + xlat/rtnl_ifla_af_spec_inet6_attrs.in | 10 + xlat/rtnl_ifla_af_spec_inet_attrs.h | 38 + xlat/rtnl_ifla_af_spec_inet_attrs.in | 3 + xlat/rtnl_ifla_brport_attrs.h | 302 + xlat/rtnl_ifla_brport_attrs.in | 35 + xlat/rtnl_ifla_events.h | 78 + xlat/rtnl_ifla_events.in | 7 + xlat/rtnl_ifla_info_attrs.h | 70 + xlat/rtnl_ifla_info_attrs.in | 6 + xlat/rtnl_ifla_info_data_bridge_attrs.h | 398 + xlat/rtnl_ifla_info_data_bridge_attrs.in | 48 + xlat/rtnl_ifla_info_data_tun_attrs.h | 102 + xlat/rtnl_ifla_info_data_tun_attrs.in | 11 + xlat/rtnl_ifla_port_attrs.h | 86 + xlat/rtnl_ifla_port_attrs.in | 8 + xlat/rtnl_ifla_vf_port_attrs.h | 38 + xlat/rtnl_ifla_vf_port_attrs.in | 2 + xlat/rtnl_ifla_xdp_attached_mode.h | 62 + xlat/rtnl_ifla_xdp_attached_mode.in | 6 + xlat/rtnl_ifla_xdp_attrs.h | 86 + xlat/rtnl_ifla_xdp_attrs.in | 8 + xlat/rtnl_link_attrs.h | 438 + xlat/rtnl_link_attrs.in | 52 + xlat/rtnl_mdb_attrs.h | 46 + xlat/rtnl_mdb_attrs.in | 3 + xlat/rtnl_mdba_mdb_attrs.h | 38 + xlat/rtnl_mdba_mdb_attrs.in | 2 + xlat/rtnl_mdba_mdb_eattr_attrs.h | 38 + xlat/rtnl_mdba_mdb_eattr_attrs.in | 2 + xlat/rtnl_mdba_mdb_entry_attrs.h | 38 + xlat/rtnl_mdba_mdb_entry_attrs.in | 2 + xlat/rtnl_mdba_router_attrs.h | 38 + xlat/rtnl_mdba_router_attrs.in | 2 + xlat/rtnl_mdba_router_pattr_attrs.h | 46 + xlat/rtnl_mdba_router_pattr_attrs.in | 3 + xlat/rtnl_neigh_attrs.h | 126 + xlat/rtnl_neigh_attrs.in | 13 + xlat/rtnl_neightbl_attrs.h | 102 + xlat/rtnl_neightbl_attrs.in | 10 + xlat/rtnl_neightbl_parms_attrs.h | 174 + xlat/rtnl_neightbl_parms_attrs.in | 19 + xlat/rtnl_netconf_attrs.h | 94 + xlat/rtnl_netconf_attrs.in | 9 + xlat/rtnl_nsid_attrs.h | 78 + xlat/rtnl_nsid_attrs.in | 7 + xlat/rtnl_route_attrs.h | 262 + xlat/rtnl_route_attrs.in | 30 + xlat/rtnl_rta_metrics_attrs.h | 158 + xlat/rtnl_rta_metrics_attrs.in | 17 + xlat/rtnl_rule_attrs.h | 222 + xlat/rtnl_rule_attrs.in | 25 + xlat/rtnl_tc_action_attrs.h | 78 + xlat/rtnl_tc_action_attrs.in | 7 + xlat/rtnl_tc_attrs.h | 142 + xlat/rtnl_tc_attrs.in | 15 + xlat/rtnl_tca_stab_attrs.h | 46 + xlat/rtnl_tca_stab_attrs.in | 3 + xlat/rtnl_tca_stats_attrs.h | 86 + xlat/rtnl_tca_stats_attrs.in | 8 + xlat/rwf_flags.h | 56 +- xlat/rwf_flags.in | 8 +- xlat/s390_guarded_storage_commands.h | 62 + xlat/s390_guarded_storage_commands.in | 5 + xlat/s390_runtime_instr_commands.h | 38 + xlat/s390_runtime_instr_commands.in | 2 + xlat/s390_sthyi_function_codes.h | 30 + xlat/s390_sthyi_function_codes.in | 1 + xlat/sa_handler_values.h | 16 +- xlat/sched_flags.h | 38 +- xlat/sched_flags.in | 4 +- xlat/schedulers.h | 16 +- xlat/scmvals.h | 125 +- xlat/scmvals.in | 25 + xlat/scsi_sg_commands.h | 154 +- xlat/secbits.h | 64 +- xlat/seccomp_filter_flags.h | 45 +- xlat/seccomp_filter_flags.in | 3 + xlat/seccomp_mode.h | 34 +- xlat/seccomp_ops.h | 44 +- xlat/seccomp_ops.in | 2 + xlat/seccomp_ret_action.h | 78 +- xlat/seccomp_ret_action.in | 13 +- xlat/semctl_flags.h | 134 +- xlat/semctl_flags.in | 24 +- xlat/semop_flags.h | 16 +- xlat/setns_types.h | 57 +- xlat/setsock_ip_options.h | 97 + xlat/setsock_ip_options.in | 31 + xlat/setsock_ipv6_options.h | 44 + xlat/setsock_ipv6_options.in | 8 + xlat/setsock_options.h | 44 + xlat/setsock_options.in | 5 + xlat/setsockipoptions.h | 89 - xlat/setsockipoptions.in | 31 - xlat/setsockipv6options.h | 26 - xlat/setsockipv6options.in | 8 - xlat/sfd_flags.h | 28 +- xlat/sg_io_dxfer_direction.h | 18 +- xlat/sg_io_flags.h | 54 +- xlat/sg_io_info.h | 30 +- xlat/sg_scsi_reset.h | 52 +- xlat/shm_flags.h | 30 +- xlat/shm_flags.in | 3 +- xlat/shm_resource_flags.h | 19 +- xlat/shm_resource_flags.in | 1 + xlat/shmctl_flags.h | 103 +- xlat/shmctl_flags.in | 14 +- xlat/shutdown_modes.h | 34 +- xlat/sigact_flags.h | 20 +- xlat/sigact_flags.in | 2 +- xlat/sigaltstack_flags.h | 36 +- xlat/sigbus_codes.h | 51 +- xlat/sigbus_codes.in | 1 + xlat/sigchld_codes.h | 54 +- xlat/sigemt_codes.h | 24 +- xlat/sigev_value.h | 42 +- xlat/sigfpe_codes.h | 100 +- xlat/sigfpe_codes.in | 8 + xlat/sigill_codes.h | 96 +- xlat/sigill_codes.in | 10 + xlat/siginfo_codes.h | 127 +- xlat/siginfo_codes.in | 14 +- xlat/sigpoll_codes.h | 54 +- xlat/sigprocmaskcmds.h | 16 +- xlat/sigprof_codes.h | 18 +- xlat/sigsegv_codes.h | 72 +- xlat/sigsegv_codes.in | 5 + xlat/sigsys_codes.h | 24 +- xlat/sigtrap_codes.h | 62 +- xlat/sigtrap_codes.in | 5 + xlat/skf_ad.h | 150 + xlat/skf_ad.in | 16 + xlat/skf_off.h | 26 + xlat/skf_off.in | 4 + xlat/smc_decl_codes.h | 151 + xlat/smc_decl_codes.in | 17 + xlat/smc_diag_attrs.h | 28 + xlat/smc_diag_attrs.in | 7 + xlat/smc_diag_extended_flags.h | 24 + xlat/smc_diag_extended_flags.in | 3 + xlat/smc_diag_mode.h | 46 + xlat/smc_diag_mode.in | 4 + xlat/smc_link_group_roles.h | 38 + xlat/smc_link_group_roles.in | 2 + xlat/smc_protocols.h | 38 + xlat/smc_protocols.in | 3 + xlat/smc_states.h | 118 + xlat/smc_states.in | 12 + xlat/snmp_icmp6_stats.h | 70 + xlat/snmp_icmp6_stats.in | 7 + xlat/snmp_ip_stats.h | 318 + xlat/snmp_ip_stats.in | 38 + xlat/sock_alg_options.h | 62 + xlat/sock_alg_options.in | 6 + xlat/sock_ax25_options.h | 116 + xlat/sock_ax25_options.in | 15 + xlat/sock_bluetooth_options.h | 87 + xlat/sock_bluetooth_options.in | 9 + xlat/sock_caif_options.h | 46 + xlat/sock_caif_options.in | 3 + xlat/sock_dccp_options.h | 151 + xlat/sock_dccp_options.in | 17 + xlat/sock_ip_options.h | 172 + xlat/{sockipoptions.in => sock_ip_options.in} | 0 xlat/sock_ipv6_options.h | 214 + xlat/sock_ipv6_options.in | 64 + xlat/sock_ipx_options.h | 25 + ...{sockipxoptions.in => sock_ipx_options.in} | 0 xlat/sock_irda_options.h | 110 + xlat/sock_irda_options.in | 12 + xlat/sock_iucv_options.h | 46 + xlat/sock_iucv_options.in | 3 + xlat/sock_kcm_options.h | 30 + xlat/sock_kcm_options.in | 1 + xlat/sock_llc_options.h | 102 + xlat/sock_llc_options.in | 11 + xlat/sock_netlink_options.h | 118 + xlat/sock_netlink_options.in | 12 + xlat/sock_nfcllcp_options.h | 62 + xlat/sock_nfcllcp_options.in | 6 + xlat/sock_options.h | 1990 ++ xlat/sock_options.in | 477 + xlat/sock_packet_options.h | 85 + ...acketoptions.in => sock_packet_options.in} | 0 xlat/sock_pnp_options.h | 54 + xlat/sock_pnp_options.in | 4 + xlat/sock_pppol2tp_options.h | 62 + xlat/sock_pppol2tp_options.in | 6 + xlat/sock_raw_options.h | 25 + ...{sockrawoptions.in => sock_raw_options.in} | 0 xlat/sock_rds_options.h | 209 + xlat/sock_rds_options.in | 29 + xlat/sock_rxrpc_options.h | 70 + xlat/sock_rxrpc_options.in | 7 + xlat/sock_sctp_options.h | 543 + xlat/sock_sctp_options.in | 66 + xlat/sock_shutdown_flags.h | 38 + xlat/sock_shutdown_flags.in | 2 + xlat/sock_tcp_options.h | 310 + xlat/sock_tcp_options.in | 37 + xlat/sock_tipc_options.h | 103 + xlat/sock_tipc_options.in | 11 + xlat/sock_tls_options.h | 38 + xlat/sock_tls_options.in | 2 + xlat/sock_type_flags.h | 16 +- xlat/sock_udp_options.h | 70 + xlat/sock_udp_options.in | 6 + xlat/sock_xdp_options.h | 78 + xlat/sock_xdp_options.in | 8 + xlat/socketcalls.h | 136 +- xlat/socketlayers.h | 271 +- xlat/socketlayers.in | 10 + xlat/sockipoptions.h | 164 - xlat/sockipv6options.h | 176 - xlat/sockipv6options.in | 54 - xlat/sockipxoptions.h | 17 - xlat/sockoptions.h | 213 - xlat/sockoptions.in | 67 - xlat/sockpacketoptions.h | 77 - xlat/sockrawoptions.h | 17 - xlat/socksctpoptions.h | 168 - xlat/socksctpoptions.in | 52 - xlat/socktcpoptions.h | 101 - xlat/socktcpoptions.in | 29 - xlat/socktypes.h | 88 +- xlat/socktypes.in | 19 +- xlat/sparc_kern_features.h | 30 + xlat/sparc_kern_features.in | 1 + xlat/splice_flags.h | 16 +- xlat/sram_alloc_flags.h | 16 +- xlat/statfs_flags.h | 76 +- xlat/statx_attrs.h | 70 + xlat/statx_attrs.in | 6 + xlat/statx_masks.h | 135 + xlat/statx_masks.in | 15 + xlat/swap_flags.h | 40 +- xlat/sync_file_range_flags.h | 34 +- xlat/sysctl_kern.h | 22 +- xlat/sysctl_kern.in | 2 + xlat/sysctl_net.h | 16 +- xlat/sysctl_net_core.h | 16 +- xlat/sysctl_net_ipv4.h | 16 +- xlat/sysctl_net_ipv4_conf.h | 16 +- xlat/sysctl_net_ipv4_route.h | 16 +- xlat/sysctl_net_ipv6.h | 16 +- xlat/sysctl_net_ipv6_route.h | 16 +- xlat/sysctl_net_unix.h | 16 +- xlat/sysctl_root.h | 16 +- xlat/sysctl_vm.h | 16 +- xlat/syslog_action_type.h | 115 +- xlat/syslog_action_type.in | 24 +- xlat/sysmips_operations.h | 16 +- xlat/tcflsh_options.h | 16 +- xlat/tcp_state_flags.h | 54 + xlat/tcp_state_flags.in | 13 + xlat/tcp_states.h | 113 + xlat/tcp_states.in | 12 + xlat/tcxonc_options.h | 16 +- xlat/timerfdflags.h | 42 +- xlat/tun_device_types.h | 38 + xlat/tun_device_types.in | 3 + xlat/ubi_volume_props.h | 16 +- xlat/ubi_volume_types.h | 16 +- xlat/uffd_api_features.h | 49 + xlat/uffd_api_features.in | 10 + xlat/uffd_api_flags.h | 16 +- xlat/uffd_copy_flags.h | 16 +- xlat/uffd_flags.h | 16 +- xlat/uffd_register_ioctl_flags.h | 16 +- xlat/uffd_register_mode_flags.h | 16 +- xlat/uffd_zeropage_flags.h | 16 +- xlat/umount_flags.h | 40 +- xlat/unix_diag_attrs.h | 29 + xlat/unix_diag_attrs.in | 8 + xlat/unix_diag_show.h | 40 + xlat/unix_diag_show.in | 6 + xlat/unshare_flags.h | 16 +- xlat/uring_enter_flags.h | 38 + xlat/uring_enter_flags.in | 2 + xlat/uring_register_opcodes.h | 54 + xlat/uring_register_opcodes.in | 4 + xlat/uring_setup_flags.h | 46 + xlat/uring_setup_flags.in | 3 + xlat/usagewho.h | 53 +- xlat/usagewho.in | 7 +- xlat/v4l2_buf_flags.h | 51 +- xlat/v4l2_buf_flags.in | 11 + xlat/v4l2_buf_types.h | 30 +- xlat/v4l2_buf_types.in | 4 + xlat/v4l2_capture_modes.h | 18 +- xlat/v4l2_colorspaces.h | 30 +- xlat/v4l2_colorspaces.in | 4 + xlat/v4l2_control_classes.h | 116 +- xlat/v4l2_control_classes.in | 22 +- xlat/v4l2_control_flags.h | 27 +- xlat/v4l2_control_flags.in | 3 + xlat/v4l2_control_id_bases.h | 235 + xlat/v4l2_control_id_bases.in | 39 + xlat/v4l2_control_ids.h | 2755 +- xlat/v4l2_control_ids.in | 429 +- xlat/v4l2_control_types.h | 43 +- xlat/v4l2_control_types.in | 9 +- xlat/v4l2_device_capabilities_flags.h | 33 +- xlat/v4l2_device_capabilities_flags.in | 5 + xlat/v4l2_fields.h | 18 +- xlat/v4l2_format_description_flags.h | 18 +- xlat/v4l2_frameinterval_types.h | 18 +- xlat/v4l2_framesize_types.h | 18 +- xlat/v4l2_input_types.h | 18 +- xlat/v4l2_memories.h | 24 +- xlat/v4l2_memories.in | 2 + xlat/v4l2_pix_fmts.h | 1361 + xlat/v4l2_pix_fmts.in | 168 + xlat/v4l2_sdr_fmts.h | 89 + xlat/v4l2_sdr_fmts.in | 9 + xlat/v4l2_sliced_flags.h | 42 + xlat/v4l2_sliced_flags.in | 6 + xlat/v4l2_streaming_capabilities.h | 18 +- xlat/v4l2_tuner_audmodes.h | 42 + xlat/v4l2_tuner_audmodes.in | 6 + xlat/v4l2_tuner_capabilities.h | 66 + xlat/v4l2_tuner_capabilities.in | 14 + xlat/v4l2_tuner_rxsubchanses.h | 42 + xlat/v4l2_tuner_rxsubchanses.in | 6 + xlat/v4l2_tuner_types.h | 42 + xlat/v4l2_tuner_types.in | 6 + xlat/v4l2_vbi_flags.h | 42 + xlat/v4l2_vbi_flags.in | 6 + xlat/wait4_options.h | 34 +- xlat/waitid_types.h | 16 +- xlat/whence_codes.h | 12 +- xlat/xattrflags.h | 28 +- xlat/xdp_flags.h | 37 + xlat/xdp_flags.in | 5 + xlat/xfs_dqblk_flags.h | 34 +- xlat/xfs_quota_flags.h | 52 +- xlate.el | 78 - xmalloc.c | 100 +- xmalloc.h | 73 + xstring.h | 113 + 6754 files changed, 269592 insertions(+), 76205 deletions(-) create mode 100644 .strace.1.in.date create mode 100644 .year create mode 100644 LGPL-2.1-or-later create mode 100644 README-configure create mode 100644 arch_defs.h create mode 100644 basic_filters.c create mode 100644 bind.c create mode 100644 bpf_attr.h create mode 100644 bpf_attr_check.c create mode 100644 bpf_filter.c create mode 100644 bpf_filter.h create mode 100644 bpf_fprog.h create mode 100644 bpf_seccomp_filter.c create mode 100644 bpf_sock_filter.c create mode 100644 delay.c create mode 100644 delay.h create mode 100644 dyxlat.c delete mode 100755 errnoent.sh create mode 100644 error_prints.c create mode 100644 error_prints.h create mode 100644 evdev_mpers.c create mode 100644 f_owner_ex.h create mode 100644 fetch_bpf_fprog.c create mode 100644 fetch_indirect_syscall_args.c delete mode 100644 fetch_seccomp_fprog.c create mode 100644 fetch_struct_keyctl_kdf_params.c create mode 100644 fetch_struct_xfs_quotastat.c create mode 100644 filter.h create mode 100644 filter_qualify.c create mode 100755 gen_bpf_attr_check.sh create mode 100644 get_personality.c create mode 100644 get_personality.h create mode 100644 getpagesize.c create mode 100644 inotify_ioctl.c create mode 100644 io_uring.c create mode 100644 kernel_timespec.h create mode 100644 kernel_timeval.h create mode 100644 kernel_timex.h create mode 100644 keyctl_kdf_params.h create mode 100644 kill_save_errno.h create mode 100644 kvm.c create mode 100644 largefile_wrappers.h create mode 100644 linux/aarch64/arch_defs_.h create mode 100644 linux/aarch64/arch_get_personality.c delete mode 100644 linux/aarch64/arch_regs.h delete mode 100644 linux/aarch64/errnoent1.h create mode 100644 linux/aarch64/nr_prefix.c create mode 100644 linux/aarch64/raw_syscall.h create mode 100644 linux/aarch64/shuffle_scno.c delete mode 100644 linux/aarch64/signalent1.h create mode 100644 linux/alpha/arch_defs_.h delete mode 100644 linux/alpha/arch_regs.h create mode 100644 linux/alpha/raw_syscall.h create mode 100644 linux/arc/raw_syscall.h create mode 100644 linux/arch_defs_.h create mode 100644 linux/arch_kvm.c create mode 100644 linux/arch_rt_sigframe.c create mode 100644 linux/arm/arch_defs_.h delete mode 100644 linux/arm/arch_regs.h create mode 100644 linux/arm/nr_prefix.c create mode 100644 linux/arm/raw_syscall.h create mode 100644 linux/arm/shuffle_scno.c create mode 100644 linux/avr32/raw_syscall.h create mode 100644 linux/bfin/arch_defs_.h create mode 100644 linux/bfin/raw_syscall.h create mode 100644 linux/bfin/rt_sigframe.h create mode 100644 linux/check_scno.c delete mode 100644 linux/crisv10/arch_regs.c delete mode 100644 linux/crisv10/arch_sigreturn.c delete mode 100644 linux/crisv10/get_error.c delete mode 100644 linux/crisv10/get_scno.c delete mode 100644 linux/crisv10/get_syscall_args.c delete mode 100644 linux/crisv10/get_syscall_result.c delete mode 100644 linux/crisv10/set_error.c delete mode 100644 linux/crisv10/set_scno.c delete mode 100644 linux/crisv10/syscallent.h delete mode 100644 linux/crisv10/userent.h delete mode 100644 linux/crisv32/arch_regs.c delete mode 100644 linux/crisv32/arch_sigreturn.c delete mode 100644 linux/crisv32/get_error.c delete mode 100644 linux/crisv32/get_scno.c delete mode 100644 linux/crisv32/get_syscall_args.c delete mode 100644 linux/crisv32/get_syscall_result.c delete mode 100644 linux/crisv32/set_error.c delete mode 100644 linux/crisv32/set_scno.c delete mode 100644 linux/crisv32/syscallent.h delete mode 100644 linux/crisv32/userent.h create mode 100644 linux/csky/arch_regs.c create mode 100644 linux/csky/get_error.c create mode 100644 linux/csky/get_scno.c create mode 100644 linux/csky/get_syscall_args.c create mode 100644 linux/csky/ioctls_arch0.h create mode 100644 linux/csky/ioctls_inc0.h create mode 100644 linux/csky/raw_syscall.h create mode 100644 linux/csky/set_error.c create mode 100644 linux/csky/set_scno.c create mode 100644 linux/csky/syscallent.h create mode 100644 linux/hppa/arch_defs_.h delete mode 100644 linux/hppa/arch_regs.h create mode 100644 linux/hppa/arch_rt_sigframe.c create mode 100644 linux/hppa/raw_syscall.h create mode 100644 linux/hppa/rt_sigframe.h create mode 100644 linux/hppa/userent.h create mode 100644 linux/i386/arch_defs_.h create mode 100644 linux/i386/arch_kvm.c delete mode 100644 linux/i386/arch_regs.h create mode 100644 linux/i386/arch_rt_sigframe.c create mode 100644 linux/i386/raw_syscall.h create mode 100644 linux/i386/rt_sigframe.h create mode 100644 linux/ia64/arch_defs_.h create mode 100644 linux/ia64/arch_rt_sigframe.c delete mode 100644 linux/ia64/arch_sigreturn.c create mode 100644 linux/ia64/raw_syscall.h create mode 100644 linux/ia64/rt_sigframe.h create mode 100644 linux/m68k/arch_defs_.h delete mode 100644 linux/m68k/arch_regs.h create mode 100644 linux/m68k/arch_rt_sigframe.c create mode 100644 linux/m68k/raw_syscall.h create mode 100644 linux/m68k/rt_sigframe.h create mode 100644 linux/metag/arch_rt_sigframe.c create mode 100644 linux/metag/raw_syscall.h create mode 100644 linux/microblaze/arch_defs_.h create mode 100644 linux/microblaze/raw_syscall.h create mode 100644 linux/mips/arch_defs_.h delete mode 100644 linux/mips/arch_regs.h create mode 100644 linux/mips/raw_syscall.h create mode 100644 linux/mips/rt_sigframe.h delete mode 100644 linux/mtd-abi.h create mode 100644 linux/nios2/arch_defs_.h create mode 100644 linux/nios2/raw_syscall.h create mode 100644 linux/nr_prefix.c create mode 100644 linux/or1k/raw_syscall.h create mode 100644 linux/packet_diag.h delete mode 100644 linux/personality.h create mode 100644 linux/powerpc/arch_defs_.h delete mode 100644 linux/powerpc/arch_regs.h create mode 100644 linux/powerpc/arch_rt_sigframe.c create mode 100644 linux/powerpc/raw_syscall.h create mode 100644 linux/powerpc64/arch_defs_.h create mode 100644 linux/powerpc64/arch_get_personality.c delete mode 100644 linux/powerpc64/arch_regs.h create mode 100644 linux/powerpc64/arch_rt_sigframe.c delete mode 100644 linux/powerpc64/errnoent1.h create mode 100644 linux/powerpc64/raw_syscall.h create mode 100644 linux/powerpc64/rt_sigframe.h delete mode 100644 linux/powerpc64/signalent1.h delete mode 100644 linux/ptp_clock.h create mode 100644 linux/ptrace_pokeuser.c create mode 100644 linux/raw_syscall.h create mode 100644 linux/riscv/arch_defs_.h create mode 100644 linux/riscv/arch_get_personality.c delete mode 100644 linux/riscv/errnoent1.h create mode 100644 linux/riscv/raw_syscall.h delete mode 100644 linux/riscv/signalent1.h create mode 100644 linux/rt_sigframe.h create mode 100644 linux/s390/arch_defs_.h delete mode 100644 linux/s390/arch_regs.h create mode 100644 linux/s390/raw_syscall.h create mode 100644 linux/s390/rt_sigframe.h create mode 100644 linux/s390x/arch_defs_.h create mode 100644 linux/s390x/arch_get_personality.c delete mode 100644 linux/s390x/arch_regs.h create mode 100644 linux/s390x/ioctls_arch1.h create mode 100644 linux/s390x/ioctls_inc1.h create mode 100644 linux/s390x/raw_syscall.h create mode 100644 linux/s390x/rt_sigframe.h create mode 100644 linux/s390x/syscallent1.h create mode 100644 linux/sh/arch_defs_.h create mode 100644 linux/sh/raw_syscall.h create mode 100644 linux/sh64/arch_defs_.h create mode 100644 linux/sh64/raw_syscall.h create mode 100644 linux/sh64/rt_sigframe.h create mode 100644 linux/shuffle_scno.c create mode 100644 linux/signal.h.in create mode 100644 linux/smc_diag.h create mode 100644 linux/sparc/arch_defs_.h delete mode 100644 linux/sparc/arch_regs.h delete mode 100644 linux/sparc/gen.pl create mode 100644 linux/sparc/raw_syscall.h create mode 100644 linux/sparc/rt_sigframe.h create mode 100644 linux/sparc64/arch_defs_.h create mode 100644 linux/sparc64/arch_get_personality.c delete mode 100644 linux/sparc64/arch_regs.h create mode 100644 linux/sparc64/arch_rt_sigframe.c delete mode 100644 linux/sparc64/errnoent1.h create mode 100644 linux/sparc64/raw_syscall.h create mode 100644 linux/sparc64/rt_sigframe.h delete mode 100644 linux/sparc64/signalent1.h create mode 100644 linux/subcall32.h create mode 100644 linux/subcall64.h create mode 100644 linux/tile/arch_defs_.h create mode 100644 linux/tile/arch_get_personality.c delete mode 100644 linux/tile/arch_regs.h delete mode 100644 linux/tile/errnoent1.h create mode 100644 linux/tile/raw_syscall.h create mode 100644 linux/tile/rt_sigframe.h delete mode 100644 linux/tile/signalent1.h delete mode 100644 linux/ubi-user.h create mode 100644 linux/x32/arch_defs_.h create mode 100644 linux/x32/arch_get_personality.c create mode 100644 linux/x32/arch_kvm.c create mode 100644 linux/x32/arch_rt_sigframe.c create mode 100644 linux/x32/check_scno.c delete mode 100644 linux/x32/errnoent1.h create mode 100644 linux/x32/ptrace_pokeuser.c create mode 100644 linux/x32/raw_syscall.h create mode 100644 linux/x32/rt_sigframe.h create mode 100644 linux/x32/shuffle_scno.c delete mode 100644 linux/x32/signalent1.h create mode 100644 linux/x86_64/arch_defs_.h create mode 100644 linux/x86_64/arch_get_personality.c create mode 100644 linux/x86_64/arch_kvm.c create mode 100644 linux/x86_64/arch_rt_sigframe.c delete mode 100644 linux/x86_64/errnoent1.h delete mode 100644 linux/x86_64/errnoent2.h delete mode 100644 linux/x86_64/gentab.pl create mode 100644 linux/x86_64/raw_syscall.h create mode 100644 linux/x86_64/rt_sigframe.h create mode 100644 linux/x86_64/shuffle_scno.c delete mode 100644 linux/x86_64/signalent1.h delete mode 100644 linux/x86_64/signalent2.h create mode 100644 linux/xtensa/raw_syscall.h create mode 100644 list.h create mode 100644 listen.c create mode 100644 m4/bpf_attr.m4 create mode 100644 m4/st_demangle.m4 create mode 100644 m4/st_libdw.m4 create mode 100644 m4/st_libunwind.m4 create mode 100644 m4/st_stacktrace.m4 create mode 100644 macros.h delete mode 100755 maint/ioctls_gen.sh delete mode 100755 maint/ioctls_hex.sh delete mode 100755 maint/ioctls_sym.sh delete mode 100644 maint/print_ioctlent.c create mode 100644 mmap_cache.c create mode 100644 mmap_cache.h create mode 100644 mmap_notify.c create mode 100644 mmap_notify.h create mode 100644 nbd_ioctl.c create mode 100644 negated_errno.h create mode 100644 netlink.h create mode 100644 netlink_crypto.c create mode 100644 netlink_inet_diag.c create mode 100644 netlink_kobject_uevent.c create mode 100644 netlink_kobject_uevent.h create mode 100644 netlink_netfilter.c create mode 100644 netlink_netlink_diag.c create mode 100644 netlink_packet_diag.c create mode 100644 netlink_route.c create mode 100644 netlink_route.h create mode 100644 netlink_selinux.c create mode 100644 netlink_smc_diag.c create mode 100644 netlink_sock_diag.c create mode 100644 netlink_sock_diag.h create mode 100644 netlink_unix_diag.c create mode 100644 nlattr.c create mode 100644 nlattr.h create mode 100644 nsfs.c create mode 100644 nsfs.h create mode 100644 number_set.c create mode 100644 number_set.h create mode 100644 perf_ioctl.c create mode 100644 print_aio_sigset.c create mode 100644 print_fields.h create mode 100644 print_group_req.c create mode 100644 print_ifindex.c create mode 100644 print_instruction_pointer.c create mode 100644 print_kernel_version.c create mode 100644 print_mac.c create mode 100644 print_timespec.h create mode 100644 print_timespec32.c create mode 100644 print_timespec64.c create mode 100644 print_timeval64.c create mode 100644 print_timex.h create mode 100644 print_utils.h create mode 100644 ptrace_syscall_info.c create mode 100644 ptrace_syscall_info.h delete mode 100644 qualify.c create mode 100644 random_ioctl.c create mode 100644 retval.c create mode 100644 retval.h create mode 100644 riscv.c create mode 100644 rt_sigframe.c create mode 100644 rt_sigreturn.c create mode 100644 rtnl_addr.c create mode 100644 rtnl_addrlabel.c create mode 100644 rtnl_dcb.c create mode 100644 rtnl_link.c create mode 100644 rtnl_mdb.c create mode 100644 rtnl_neigh.c create mode 100644 rtnl_neightbl.c create mode 100644 rtnl_netconf.c create mode 100644 rtnl_nsid.c create mode 100644 rtnl_route.c create mode 100644 rtnl_rule.c create mode 100644 rtnl_tc.c create mode 100644 rtnl_tc_action.c create mode 100644 s390.c create mode 100644 sched_attr.h delete mode 100644 seccomp_fprog.h create mode 100644 shutdown.c delete mode 100755 signalent.sh create mode 100644 sparc.c create mode 100644 static_assert.h create mode 100644 statx.c create mode 100644 statx.h create mode 100644 strace-log-merge.1 create mode 100644 strace-log-merge.1.in create mode 100644 strace.1.in create mode 100644 string_to_uint.c create mode 100644 string_to_uint.h delete mode 100755 syscallent.sh create mode 100644 sysent_shorthand_defs.h create mode 100644 sysent_shorthand_undefs.h create mode 100644 tests-m32/COPYING create mode 100644 tests-m32/GPL-2.0-or-later create mode 100755 tests-m32/PTRACE_SEIZE.sh create mode 100644 tests-m32/_newselect-P.c create mode 100755 tests-m32/_newselect-P.gen.test create mode 100755 tests-m32/_newselect.gen.test delete mode 100755 tests-m32/_newselect.test create mode 100755 tests-m32/accept.gen.test delete mode 100755 tests-m32/accept.test create mode 100755 tests-m32/accept4.gen.test delete mode 100755 tests-m32/accept4.test create mode 100644 tests-m32/accept_compat.h create mode 100755 tests-m32/access.gen.test delete mode 100755 tests-m32/access.test create mode 100755 tests-m32/acct.gen.test delete mode 100755 tests-m32/acct.test create mode 100755 tests-m32/add_key.gen.test delete mode 100755 tests-m32/add_key.test create mode 100755 tests-m32/adjtimex.gen.test delete mode 100755 tests-m32/adjtimex.test create mode 100755 tests-m32/aio.gen.test delete mode 100755 tests-m32/aio.test create mode 100644 tests-m32/aio_pgetevents.c create mode 100755 tests-m32/aio_pgetevents.gen.test create mode 100755 tests-m32/alarm.gen.test delete mode 100755 tests-m32/alarm.test create mode 100644 tests-m32/attach-p-cmd.h create mode 100644 tests-m32/block_reset_raise_run.c create mode 100644 tests-m32/bpf-obj_get_info_by_fd-prog-v.c create mode 100755 tests-m32/bpf-obj_get_info_by_fd-prog-v.gen.test create mode 100644 tests-m32/bpf-obj_get_info_by_fd-prog.c create mode 100755 tests-m32/bpf-obj_get_info_by_fd-prog.gen.test create mode 100644 tests-m32/bpf-obj_get_info_by_fd-v.c create mode 100755 tests-m32/bpf-obj_get_info_by_fd-v.gen.test create mode 100644 tests-m32/bpf-obj_get_info_by_fd.c create mode 100755 tests-m32/bpf-obj_get_info_by_fd.gen.test create mode 100644 tests-m32/bpf-success-v.c create mode 100755 tests-m32/bpf-success-v.test create mode 100644 tests-m32/bpf-success.c create mode 100755 tests-m32/bpf-success.test create mode 100644 tests-m32/bpf-v.c create mode 100755 tests-m32/bpf-v.gen.test create mode 100755 tests-m32/bpf.gen.test delete mode 100755 tests-m32/bpf.test create mode 100755 tests-m32/btrfs-X.test create mode 100755 tests-m32/btrfs-vX.test create mode 100755 tests-m32/btrfs-vwX.test create mode 100755 tests-m32/btrfs-wX.test create mode 100755 tests-m32/btrfs.gen.test delete mode 100755 tests-m32/btrfs.test create mode 100644 tests-m32/check_sigblock.c create mode 100644 tests-m32/check_sigign.c create mode 100755 tests-m32/chmod.gen.test delete mode 100755 tests-m32/chmod.test create mode 100755 tests-m32/chown.gen.test delete mode 100755 tests-m32/chown.test create mode 100755 tests-m32/chown32.gen.test delete mode 100755 tests-m32/chown32.test create mode 100755 tests-m32/chroot.gen.test delete mode 100755 tests-m32/chroot.test create mode 100755 tests-m32/clock.gen.test create mode 100755 tests-m32/clock.in create mode 100755 tests-m32/clock_adjtime.gen.test delete mode 100755 tests-m32/clock_adjtime.test create mode 100755 tests-m32/clock_nanosleep.gen.test delete mode 100755 tests-m32/clock_nanosleep.test create mode 100755 tests-m32/clock_xettime.gen.test delete mode 100755 tests-m32/clock_xettime.test create mode 100644 tests-m32/clone_parent.c create mode 100755 tests-m32/clone_parent.test create mode 100644 tests-m32/clone_ptrace.c create mode 100755 tests-m32/clone_ptrace.test create mode 100755 tests-m32/copy_file_range.gen.test delete mode 100755 tests-m32/copy_file_range.test create mode 100755 tests-m32/creat.gen.test delete mode 100755 tests-m32/creat.test create mode 100644 tests-m32/create_nl_socket.c create mode 100644 tests-m32/delay.c create mode 100755 tests-m32/delay.test create mode 100755 tests-m32/delete_module.gen.test delete mode 100755 tests-m32/delete_module.test create mode 100644 tests-m32/dev-yy.c create mode 100755 tests-m32/dev-yy.gen.test create mode 100755 tests-m32/dup.gen.test delete mode 100755 tests-m32/dup.test create mode 100755 tests-m32/dup2.gen.test delete mode 100755 tests-m32/dup2.test create mode 100755 tests-m32/dup3.gen.test delete mode 100755 tests-m32/dup3.test create mode 100755 tests-m32/epoll_create.gen.test delete mode 100755 tests-m32/epoll_create.test create mode 100755 tests-m32/epoll_create1.gen.test delete mode 100755 tests-m32/epoll_create1.test create mode 100755 tests-m32/epoll_ctl.gen.test delete mode 100755 tests-m32/epoll_ctl.test create mode 100755 tests-m32/epoll_pwait.gen.test delete mode 100755 tests-m32/epoll_pwait.test create mode 100755 tests-m32/epoll_wait.gen.test delete mode 100755 tests-m32/epoll_wait.test create mode 100755 tests-m32/erestartsys.gen.test delete mode 100755 tests-m32/erestartsys.test create mode 100755 tests-m32/execveat-v.gen.test delete mode 100755 tests-m32/execveat-v.test create mode 100755 tests-m32/execveat.gen.test delete mode 100755 tests-m32/execveat.test create mode 100755 tests-m32/faccessat.gen.test delete mode 100755 tests-m32/faccessat.test create mode 100755 tests-m32/fadvise64_64.gen.test delete mode 100755 tests-m32/fadvise64_64.test create mode 100755 tests-m32/fallocate.gen.test delete mode 100755 tests-m32/fallocate.test create mode 100755 tests-m32/fanotify_init.gen.test delete mode 100755 tests-m32/fanotify_init.test create mode 100644 tests-m32/fanotify_mark-Xabbrev.c create mode 100755 tests-m32/fanotify_mark-Xabbrev.gen.test create mode 100644 tests-m32/fanotify_mark-Xraw.c create mode 100755 tests-m32/fanotify_mark-Xraw.gen.test create mode 100644 tests-m32/fanotify_mark-Xverbose.c create mode 100755 tests-m32/fanotify_mark-Xverbose.gen.test create mode 100755 tests-m32/fanotify_mark.gen.test delete mode 100755 tests-m32/fanotify_mark.test create mode 100755 tests-m32/fchdir.gen.test delete mode 100755 tests-m32/fchdir.test create mode 100755 tests-m32/fchmod.gen.test delete mode 100755 tests-m32/fchmod.test create mode 100755 tests-m32/fchmodat.gen.test delete mode 100755 tests-m32/fchmodat.test create mode 100755 tests-m32/fchown.gen.test delete mode 100755 tests-m32/fchown.test create mode 100755 tests-m32/fchown32.gen.test delete mode 100755 tests-m32/fchown32.test create mode 100755 tests-m32/fchownat.gen.test delete mode 100755 tests-m32/fchownat.test create mode 100644 tests-m32/fcntl-common.c create mode 100755 tests-m32/fcntl.gen.test delete mode 100755 tests-m32/fcntl.test create mode 100755 tests-m32/fcntl64.gen.test delete mode 100755 tests-m32/fcntl64.test create mode 100755 tests-m32/fdatasync.gen.test delete mode 100755 tests-m32/fdatasync.test create mode 100644 tests-m32/fflush.c create mode 100755 tests-m32/fflush.test create mode 100755 tests-m32/file_handle.gen.test delete mode 100755 tests-m32/file_handle.test create mode 100755 tests-m32/file_ioctl.gen.test delete mode 100755 tests-m32/file_ioctl.test create mode 100755 tests-m32/filtering_fd-syntax.test create mode 100755 tests-m32/filtering_syscall-syntax.test create mode 100755 tests-m32/finit_module.gen.test delete mode 100755 tests-m32/finit_module.test create mode 100755 tests-m32/first_exec_failure.test create mode 100755 tests-m32/flock.gen.test delete mode 100755 tests-m32/flock.test create mode 100755 tests-m32/fork-f.gen.test delete mode 100755 tests-m32/fork-f.test create mode 100644 tests-m32/fstat-Xabbrev.c create mode 100755 tests-m32/fstat-Xabbrev.gen.test create mode 100644 tests-m32/fstat-Xraw.c create mode 100755 tests-m32/fstat-Xraw.gen.test create mode 100644 tests-m32/fstat-Xverbose.c create mode 100755 tests-m32/fstat-Xverbose.gen.test create mode 100755 tests-m32/fstat.gen.test delete mode 100755 tests-m32/fstat.test create mode 100644 tests-m32/fstat64-Xabbrev.c create mode 100755 tests-m32/fstat64-Xabbrev.gen.test create mode 100644 tests-m32/fstat64-Xraw.c create mode 100755 tests-m32/fstat64-Xraw.gen.test create mode 100644 tests-m32/fstat64-Xverbose.c create mode 100755 tests-m32/fstat64-Xverbose.gen.test create mode 100755 tests-m32/fstat64.gen.test delete mode 100755 tests-m32/fstat64.test create mode 100755 tests-m32/fstatat64.gen.test delete mode 100755 tests-m32/fstatat64.test create mode 100755 tests-m32/fstatfs.gen.test delete mode 100755 tests-m32/fstatfs.test create mode 100755 tests-m32/fstatfs64.gen.test delete mode 100755 tests-m32/fstatfs64.test create mode 100644 tests-m32/fsync-y.c create mode 100755 tests-m32/fsync-y.gen.test create mode 100755 tests-m32/fsync.gen.test delete mode 100755 tests-m32/fsync.test create mode 100755 tests-m32/ftruncate.gen.test delete mode 100755 tests-m32/ftruncate.test create mode 100755 tests-m32/ftruncate64.gen.test delete mode 100755 tests-m32/ftruncate64.test create mode 100755 tests-m32/futimesat.gen.test delete mode 100755 tests-m32/futimesat.test create mode 100755 tests-m32/gen_pure_executables.sh create mode 100644 tests-m32/gen_tests.am create mode 100644 tests-m32/gen_tests.in create mode 100755 tests-m32/gen_tests.sh create mode 100755 tests-m32/get_mempolicy.gen.test delete mode 100755 tests-m32/get_mempolicy.test create mode 100755 tests-m32/get_regs.test create mode 100644 tests-m32/get_sigset_size.c create mode 100755 tests-m32/getcpu.gen.test delete mode 100755 tests-m32/getcpu.test create mode 100755 tests-m32/getcwd.gen.test delete mode 100755 tests-m32/getcwd.test create mode 100755 tests-m32/getdents.gen.test delete mode 100755 tests-m32/getdents.test create mode 100755 tests-m32/getdents64.gen.test delete mode 100755 tests-m32/getdents64.test create mode 100755 tests-m32/getegid.gen.test delete mode 100755 tests-m32/getegid.test create mode 100755 tests-m32/getegid32.gen.test delete mode 100755 tests-m32/getegid32.test create mode 100755 tests-m32/geteuid.gen.test delete mode 100755 tests-m32/geteuid.test create mode 100755 tests-m32/geteuid32.gen.test delete mode 100755 tests-m32/geteuid32.test create mode 100755 tests-m32/getgid.gen.test delete mode 100755 tests-m32/getgid.test create mode 100755 tests-m32/getgid32.gen.test delete mode 100755 tests-m32/getgid32.test create mode 100755 tests-m32/getgroups.gen.test delete mode 100755 tests-m32/getgroups.test create mode 100755 tests-m32/getgroups32.gen.test delete mode 100755 tests-m32/getgroups32.test create mode 100755 tests-m32/getpeername.gen.test delete mode 100755 tests-m32/getpeername.test create mode 100755 tests-m32/getpgrp.gen.test delete mode 100755 tests-m32/getpgrp.test create mode 100644 tests-m32/getpid.c create mode 100755 tests-m32/getpid.gen.test create mode 100644 tests-m32/getppid.c create mode 100755 tests-m32/getppid.gen.test create mode 100755 tests-m32/getrandom.gen.test delete mode 100755 tests-m32/getrandom.test create mode 100755 tests-m32/getresgid.gen.test delete mode 100755 tests-m32/getresgid.test create mode 100755 tests-m32/getresgid32.gen.test delete mode 100755 tests-m32/getresgid32.test create mode 100755 tests-m32/getresuid.gen.test delete mode 100755 tests-m32/getresuid.test create mode 100755 tests-m32/getresuid32.gen.test delete mode 100755 tests-m32/getresuid32.test create mode 100755 tests-m32/getrlimit.gen.test delete mode 100755 tests-m32/getrlimit.test create mode 100755 tests-m32/getrusage.gen.test delete mode 100755 tests-m32/getrusage.test create mode 100755 tests-m32/getsid.gen.test delete mode 100755 tests-m32/getsid.test create mode 100755 tests-m32/getsockname.gen.test delete mode 100755 tests-m32/getsockname.test create mode 100644 tests-m32/gettid.c create mode 100755 tests-m32/gettid.gen.test create mode 100755 tests-m32/getuid32.gen.test delete mode 100755 tests-m32/getuid32.test create mode 100755 tests-m32/getxxid.gen.test delete mode 100755 tests-m32/getxxid.test create mode 100644 tests-m32/group_req.c create mode 100755 tests-m32/group_req.gen.test create mode 100644 tests-m32/ifindex.c create mode 100755 tests-m32/inet-cmsg.gen.test delete mode 100755 tests-m32/inet-cmsg.test create mode 100755 tests-m32/init_module.gen.test delete mode 100755 tests-m32/init_module.test create mode 100644 tests-m32/inject-nf.c create mode 100755 tests-m32/inject-nf.test create mode 100755 tests-m32/inotify.gen.test delete mode 100755 tests-m32/inotify.test create mode 100755 tests-m32/inotify_init1.gen.test delete mode 100755 tests-m32/inotify_init1.test create mode 100644 tests-m32/int_0x80.c create mode 100755 tests-m32/int_0x80.test create mode 100755 tests-m32/interactive_block.test create mode 100644 tests-m32/io_uring_enter.c create mode 100755 tests-m32/io_uring_enter.gen.test create mode 100644 tests-m32/io_uring_register.c create mode 100755 tests-m32/io_uring_register.gen.test create mode 100644 tests-m32/io_uring_setup.c create mode 100755 tests-m32/io_uring_setup.gen.test create mode 100755 tests-m32/ioctl_block.gen.test delete mode 100755 tests-m32/ioctl_block.test create mode 100755 tests-m32/ioctl_dm-v.gen.test delete mode 100755 tests-m32/ioctl_dm-v.test create mode 100755 tests-m32/ioctl_dm.gen.test delete mode 100755 tests-m32/ioctl_dm.test create mode 100644 tests-m32/ioctl_evdev-success-v.c create mode 100755 tests-m32/ioctl_evdev-success-v.test create mode 100644 tests-m32/ioctl_evdev-success.c create mode 100755 tests-m32/ioctl_evdev-success.test create mode 100755 tests-m32/ioctl_evdev-v.gen.test delete mode 100755 tests-m32/ioctl_evdev-v.test create mode 100755 tests-m32/ioctl_evdev.gen.test delete mode 100755 tests-m32/ioctl_evdev.test create mode 100644 tests-m32/ioctl_inotify.c create mode 100755 tests-m32/ioctl_inotify.gen.test create mode 100644 tests-m32/ioctl_kvm_run-v.c create mode 100755 tests-m32/ioctl_kvm_run-v.gen.test create mode 100644 tests-m32/ioctl_kvm_run.c create mode 100755 tests-m32/ioctl_kvm_run.gen.test create mode 100644 tests-m32/ioctl_kvm_run_auxstr_vcpu.c create mode 100755 tests-m32/ioctl_kvm_run_auxstr_vcpu.gen.test create mode 100644 tests-m32/ioctl_kvm_run_common.c create mode 100755 tests-m32/ioctl_loop-nv.gen.test delete mode 100755 tests-m32/ioctl_loop-nv.test create mode 100755 tests-m32/ioctl_loop-v.gen.test delete mode 100755 tests-m32/ioctl_loop-v.test create mode 100755 tests-m32/ioctl_loop.gen.test delete mode 100755 tests-m32/ioctl_loop.test create mode 100755 tests-m32/ioctl_mtd.gen.test delete mode 100755 tests-m32/ioctl_mtd.test create mode 100644 tests-m32/ioctl_nbd.c create mode 100755 tests-m32/ioctl_nbd.gen.test create mode 100644 tests-m32/ioctl_nsfs.c create mode 100755 tests-m32/ioctl_nsfs.gen.test create mode 100644 tests-m32/ioctl_perf-success.c create mode 100755 tests-m32/ioctl_perf-success.test create mode 100644 tests-m32/ioctl_perf.c create mode 100755 tests-m32/ioctl_perf.gen.test create mode 100644 tests-m32/ioctl_ptp.c create mode 100755 tests-m32/ioctl_ptp.gen.test create mode 100644 tests-m32/ioctl_random.c create mode 100755 tests-m32/ioctl_random.gen.test create mode 100755 tests-m32/ioctl_rtc-v.gen.test delete mode 100755 tests-m32/ioctl_rtc-v.test create mode 100755 tests-m32/ioctl_rtc.gen.test delete mode 100755 tests-m32/ioctl_rtc.test create mode 100755 tests-m32/ioctl_scsi.gen.test delete mode 100755 tests-m32/ioctl_scsi.test create mode 100755 tests-m32/ioctl_sg_io_v3.gen.test delete mode 100755 tests-m32/ioctl_sg_io_v3.test create mode 100755 tests-m32/ioctl_sg_io_v4.gen.test delete mode 100755 tests-m32/ioctl_sg_io_v4.test create mode 100755 tests-m32/ioctl_sock_gifconf.gen.test delete mode 100755 tests-m32/ioctl_sock_gifconf.test create mode 100755 tests-m32/ioctl_uffdio.gen.test delete mode 100755 tests-m32/ioctl_uffdio.test create mode 100755 tests-m32/ioctl_v4l2.gen.test delete mode 100755 tests-m32/ioctl_v4l2.test create mode 100755 tests-m32/ioperm.gen.test delete mode 100755 tests-m32/ioperm.test create mode 100755 tests-m32/iopl.gen.test delete mode 100755 tests-m32/iopl.test create mode 100644 tests-m32/ioprio-Xabbrev.c create mode 100755 tests-m32/ioprio-Xabbrev.gen.test create mode 100644 tests-m32/ioprio-Xraw.c create mode 100755 tests-m32/ioprio-Xraw.gen.test create mode 100644 tests-m32/ioprio-Xverbose.c create mode 100755 tests-m32/ioprio-Xverbose.gen.test create mode 100755 tests-m32/ioprio.gen.test delete mode 100755 tests-m32/ioprio.test create mode 100755 tests-m32/ip_mreq.gen.test delete mode 100755 tests-m32/ip_mreq.test create mode 100755 tests-m32/ipc.gen.test delete mode 100755 tests-m32/ipc.test create mode 100644 tests-m32/ipc_msg-Xabbrev.c create mode 100755 tests-m32/ipc_msg-Xabbrev.gen.test create mode 100644 tests-m32/ipc_msg-Xraw.c create mode 100755 tests-m32/ipc_msg-Xraw.gen.test create mode 100644 tests-m32/ipc_msg-Xverbose.c create mode 100755 tests-m32/ipc_msg-Xverbose.gen.test create mode 100755 tests-m32/ipc_msg.gen.test delete mode 100755 tests-m32/ipc_msg.test create mode 100644 tests-m32/ipc_msgbuf-Xabbrev.c create mode 100755 tests-m32/ipc_msgbuf-Xabbrev.gen.test create mode 100644 tests-m32/ipc_msgbuf-Xraw.c create mode 100755 tests-m32/ipc_msgbuf-Xraw.gen.test create mode 100644 tests-m32/ipc_msgbuf-Xverbose.c create mode 100755 tests-m32/ipc_msgbuf-Xverbose.gen.test delete mode 100644 tests-m32/ipc_msgbuf.expected create mode 100644 tests-m32/ipc_sem-Xabbrev.c create mode 100755 tests-m32/ipc_sem-Xabbrev.gen.test create mode 100644 tests-m32/ipc_sem-Xraw.c create mode 100755 tests-m32/ipc_sem-Xraw.gen.test create mode 100644 tests-m32/ipc_sem-Xverbose.c create mode 100755 tests-m32/ipc_sem-Xverbose.gen.test create mode 100755 tests-m32/ipc_sem.gen.test delete mode 100755 tests-m32/ipc_sem.test create mode 100644 tests-m32/ipc_shm-Xabbrev.c create mode 100755 tests-m32/ipc_shm-Xabbrev.gen.test create mode 100644 tests-m32/ipc_shm-Xraw.c create mode 100755 tests-m32/ipc_shm-Xraw.gen.test create mode 100644 tests-m32/ipc_shm-Xverbose.c create mode 100755 tests-m32/ipc_shm-Xverbose.gen.test create mode 100755 tests-m32/ipc_shm.gen.test delete mode 100755 tests-m32/ipc_shm.test create mode 100644 tests-m32/is_linux_mips_n64.c create mode 100644 tests-m32/kcmp-y.c create mode 100755 tests-m32/kcmp-y.gen.test create mode 100755 tests-m32/kcmp.gen.test delete mode 100755 tests-m32/kcmp.test create mode 100755 tests-m32/kern_features-fault.test create mode 100644 tests-m32/kern_features.c create mode 100755 tests-m32/kern_features.gen.test create mode 100644 tests-m32/kernel_version-Xabbrev.c create mode 100755 tests-m32/kernel_version-Xabbrev.gen.test create mode 100644 tests-m32/kernel_version-Xraw.c create mode 100755 tests-m32/kernel_version-Xraw.gen.test create mode 100644 tests-m32/kernel_version-Xverbose.c create mode 100755 tests-m32/kernel_version-Xverbose.gen.test create mode 100644 tests-m32/kernel_version.c create mode 100755 tests-m32/kernel_version.gen.test create mode 100755 tests-m32/kexec_file_load.gen.test delete mode 100755 tests-m32/kexec_file_load.test create mode 100755 tests-m32/kexec_load.gen.test delete mode 100755 tests-m32/kexec_load.test create mode 100644 tests-m32/keyctl-Xabbrev.c create mode 100755 tests-m32/keyctl-Xabbrev.gen.test create mode 100644 tests-m32/keyctl-Xraw.c create mode 100755 tests-m32/keyctl-Xraw.gen.test create mode 100644 tests-m32/keyctl-Xverbose.c create mode 100755 tests-m32/keyctl-Xverbose.gen.test create mode 100755 tests-m32/keyctl.gen.test delete mode 100755 tests-m32/keyctl.test create mode 100755 tests-m32/kill.gen.test delete mode 100755 tests-m32/kill.test create mode 100644 tests-m32/kill_child.c create mode 100755 tests-m32/kill_child.test create mode 100755 tests-m32/lchown.gen.test delete mode 100755 tests-m32/lchown.test create mode 100755 tests-m32/lchown32.gen.test delete mode 100755 tests-m32/lchown32.test create mode 100755 tests-m32/link.gen.test delete mode 100755 tests-m32/link.test create mode 100755 tests-m32/linkat.gen.test delete mode 100755 tests-m32/linkat.test create mode 100644 tests-m32/list_sigaction_signum.c create mode 100644 tests-m32/localtime.c create mode 100755 tests-m32/localtime.test create mode 100755 tests-m32/lookup_dcookie.gen.test delete mode 100755 tests-m32/lookup_dcookie.test create mode 100644 tests-m32/looping_threads.c create mode 100755 tests-m32/looping_threads.test create mode 100755 tests-m32/lstat.gen.test delete mode 100755 tests-m32/lstat.test create mode 100755 tests-m32/lstat64.gen.test delete mode 100755 tests-m32/lstat64.test create mode 100644 tests-m32/madvise.c create mode 100755 tests-m32/madvise.gen.test create mode 100755 tests-m32/mbind.gen.test delete mode 100755 tests-m32/mbind.test create mode 100755 tests-m32/membarrier.gen.test delete mode 100755 tests-m32/membarrier.test create mode 100644 tests-m32/memfd_create-Xabbrev.c create mode 100755 tests-m32/memfd_create-Xabbrev.gen.test create mode 100644 tests-m32/memfd_create-Xraw.c create mode 100755 tests-m32/memfd_create-Xraw.gen.test create mode 100644 tests-m32/memfd_create-Xverbose.c create mode 100755 tests-m32/memfd_create-Xverbose.gen.test create mode 100755 tests-m32/memfd_create.gen.test delete mode 100755 tests-m32/memfd_create.test create mode 100755 tests-m32/migrate_pages.gen.test delete mode 100755 tests-m32/migrate_pages.test create mode 100755 tests-m32/mincore.gen.test delete mode 100755 tests-m32/mincore.test create mode 100755 tests-m32/mkdir.gen.test delete mode 100755 tests-m32/mkdir.test create mode 100755 tests-m32/mkdirat.gen.test delete mode 100755 tests-m32/mkdirat.test create mode 100755 tests-m32/mknod.gen.test delete mode 100755 tests-m32/mknod.test create mode 100755 tests-m32/mknodat.gen.test delete mode 100755 tests-m32/mknodat.test create mode 100755 tests-m32/mlock.gen.test delete mode 100755 tests-m32/mlock.test create mode 100755 tests-m32/mlock2.gen.test delete mode 100755 tests-m32/mlock2.test create mode 100755 tests-m32/mlockall.gen.test delete mode 100755 tests-m32/mlockall.test create mode 100644 tests-m32/mmap-Xabbrev.c create mode 100755 tests-m32/mmap-Xabbrev.gen.test create mode 100644 tests-m32/mmap-Xraw.c create mode 100755 tests-m32/mmap-Xraw.gen.test create mode 100644 tests-m32/mmap-Xverbose.c create mode 100755 tests-m32/mmap-Xverbose.gen.test create mode 100644 tests-m32/mmap64-Xabbrev.c create mode 100755 tests-m32/mmap64-Xabbrev.gen.test create mode 100644 tests-m32/mmap64-Xraw.c create mode 100755 tests-m32/mmap64-Xraw.gen.test create mode 100644 tests-m32/mmap64-Xverbose.c create mode 100755 tests-m32/mmap64-Xverbose.gen.test create mode 100755 tests-m32/mmap64.gen.test delete mode 100755 tests-m32/mmap64.test create mode 100755 tests-m32/mmsg-silent.gen.test delete mode 100755 tests-m32/mmsg-silent.test create mode 100755 tests-m32/mmsg.gen.test delete mode 100755 tests-m32/mmsg.test create mode 100755 tests-m32/mmsg_name-v.gen.test delete mode 100755 tests-m32/mmsg_name-v.test create mode 100755 tests-m32/mmsg_name.gen.test delete mode 100755 tests-m32/mmsg_name.test create mode 100644 tests-m32/modify_ldt.c create mode 100755 tests-m32/modify_ldt.gen.test create mode 100644 tests-m32/mount-Xabbrev.c create mode 100755 tests-m32/mount-Xabbrev.gen.test create mode 100644 tests-m32/mount-Xraw.c create mode 100755 tests-m32/mount-Xraw.gen.test create mode 100644 tests-m32/mount-Xverbose.c create mode 100755 tests-m32/mount-Xverbose.gen.test create mode 100755 tests-m32/mount.gen.test delete mode 100755 tests-m32/mount.test create mode 100644 tests-m32/move_pages-Xabbrev.c create mode 100755 tests-m32/move_pages-Xabbrev.gen.test create mode 100644 tests-m32/move_pages-Xraw.c create mode 100755 tests-m32/move_pages-Xraw.gen.test create mode 100644 tests-m32/move_pages-Xverbose.c create mode 100755 tests-m32/move_pages-Xverbose.gen.test create mode 100755 tests-m32/move_pages.gen.test delete mode 100755 tests-m32/move_pages.test create mode 100755 tests-m32/mq.gen.test delete mode 100755 tests-m32/mq.test create mode 100755 tests-m32/mq_sendrecv-read.gen.test delete mode 100755 tests-m32/mq_sendrecv-read.test create mode 100755 tests-m32/mq_sendrecv-write.gen.test delete mode 100755 tests-m32/mq_sendrecv-write.test create mode 100755 tests-m32/mq_sendrecv.gen.test delete mode 100755 tests-m32/mq_sendrecv.test create mode 100755 tests-m32/msg_control-v.gen.test delete mode 100755 tests-m32/msg_control-v.test create mode 100755 tests-m32/msg_control.gen.test delete mode 100755 tests-m32/msg_control.test create mode 100755 tests-m32/msg_name.gen.test delete mode 100755 tests-m32/msg_name.test create mode 100755 tests-m32/munlockall.gen.test delete mode 100755 tests-m32/munlockall.test create mode 100755 tests-m32/nanosleep.gen.test delete mode 100755 tests-m32/nanosleep.test create mode 100755 tests-m32/net-icmp_filter.gen.test delete mode 100755 tests-m32/net-icmp_filter.test create mode 100644 tests-m32/net-packet_mreq-Xabbrev.c create mode 100755 tests-m32/net-packet_mreq-Xabbrev.gen.test create mode 100644 tests-m32/net-packet_mreq-Xraw.c create mode 100755 tests-m32/net-packet_mreq-Xraw.gen.test create mode 100644 tests-m32/net-packet_mreq-Xverbose.c create mode 100755 tests-m32/net-packet_mreq-Xverbose.gen.test create mode 100644 tests-m32/net-packet_mreq.c create mode 100755 tests-m32/net-packet_mreq.gen.test create mode 100755 tests-m32/net-sockaddr.gen.test delete mode 100755 tests-m32/net-sockaddr.test create mode 100644 tests-m32/net-tpacket_req.c create mode 100755 tests-m32/net-tpacket_req.gen.test create mode 100644 tests-m32/net-tpacket_stats-success.c create mode 100755 tests-m32/net-tpacket_stats-success.test create mode 100644 tests-m32/net-tpacket_stats.c create mode 100755 tests-m32/net-tpacket_stats.gen.test create mode 100644 tests-m32/net-yy-inet6.c create mode 100755 tests-m32/net-yy-inet6.gen.test create mode 100644 tests-m32/netlink_audit.c create mode 100755 tests-m32/netlink_audit.gen.test create mode 100644 tests-m32/netlink_crypto.c create mode 100755 tests-m32/netlink_crypto.gen.test create mode 100644 tests-m32/netlink_generic.c create mode 100755 tests-m32/netlink_generic.gen.test create mode 100644 tests-m32/netlink_kobject_uevent.c create mode 100755 tests-m32/netlink_kobject_uevent.gen.test create mode 100644 tests-m32/netlink_netfilter.c create mode 100755 tests-m32/netlink_netfilter.gen.test create mode 100755 tests-m32/netlink_protocol.gen.test delete mode 100755 tests-m32/netlink_protocol.test create mode 100644 tests-m32/netlink_route.c create mode 100755 tests-m32/netlink_route.gen.test create mode 100644 tests-m32/netlink_selinux.c create mode 100755 tests-m32/netlink_selinux.gen.test create mode 100755 tests-m32/netlink_sock_diag-v.sh create mode 100644 tests-m32/netlink_sock_diag.c create mode 100755 tests-m32/netlink_sock_diag.test create mode 100644 tests-m32/netlink_xfrm.c create mode 100755 tests-m32/netlink_xfrm.gen.test create mode 100755 tests-m32/newfstatat.gen.test delete mode 100755 tests-m32/newfstatat.test create mode 100644 tests-m32/nfnetlink_acct.c create mode 100755 tests-m32/nfnetlink_acct.gen.test create mode 100644 tests-m32/nfnetlink_cthelper.c create mode 100755 tests-m32/nfnetlink_cthelper.gen.test create mode 100644 tests-m32/nfnetlink_ctnetlink.c create mode 100755 tests-m32/nfnetlink_ctnetlink.gen.test create mode 100644 tests-m32/nfnetlink_ctnetlink_exp.c create mode 100755 tests-m32/nfnetlink_ctnetlink_exp.gen.test create mode 100644 tests-m32/nfnetlink_cttimeout.c create mode 100755 tests-m32/nfnetlink_cttimeout.gen.test create mode 100644 tests-m32/nfnetlink_ipset.c create mode 100755 tests-m32/nfnetlink_ipset.gen.test create mode 100644 tests-m32/nfnetlink_nft_compat.c create mode 100755 tests-m32/nfnetlink_nft_compat.gen.test create mode 100644 tests-m32/nfnetlink_nftables.c create mode 100755 tests-m32/nfnetlink_nftables.gen.test create mode 100644 tests-m32/nfnetlink_osf.c create mode 100755 tests-m32/nfnetlink_osf.gen.test create mode 100644 tests-m32/nfnetlink_queue.c create mode 100755 tests-m32/nfnetlink_queue.gen.test create mode 100644 tests-m32/nfnetlink_ulog.c create mode 100755 tests-m32/nfnetlink_ulog.gen.test create mode 100644 tests-m32/nlattr.c create mode 100755 tests-m32/nlattr.gen.test create mode 100644 tests-m32/nlattr_br_port_msg.c create mode 100755 tests-m32/nlattr_br_port_msg.gen.test create mode 100644 tests-m32/nlattr_crypto_user_alg.c create mode 100755 tests-m32/nlattr_crypto_user_alg.gen.test create mode 100644 tests-m32/nlattr_dcbmsg.c create mode 100755 tests-m32/nlattr_dcbmsg.gen.test create mode 100644 tests-m32/nlattr_fib_rule_hdr.c create mode 100755 tests-m32/nlattr_fib_rule_hdr.gen.test create mode 100644 tests-m32/nlattr_ifaddrlblmsg.c create mode 100755 tests-m32/nlattr_ifaddrlblmsg.gen.test create mode 100644 tests-m32/nlattr_ifaddrmsg.c create mode 100755 tests-m32/nlattr_ifaddrmsg.gen.test create mode 100644 tests-m32/nlattr_ifinfomsg.c create mode 100755 tests-m32/nlattr_ifinfomsg.gen.test create mode 100644 tests-m32/nlattr_ifla.h create mode 100644 tests-m32/nlattr_ifla_af_spec.c create mode 100755 tests-m32/nlattr_ifla_af_spec.gen.test create mode 100644 tests-m32/nlattr_ifla_brport.c create mode 100755 tests-m32/nlattr_ifla_brport.gen.test create mode 100644 tests-m32/nlattr_ifla_linkinfo.c create mode 100755 tests-m32/nlattr_ifla_linkinfo.gen.test create mode 100644 tests-m32/nlattr_ifla_port.c create mode 100755 tests-m32/nlattr_ifla_port.gen.test create mode 100644 tests-m32/nlattr_ifla_xdp.c create mode 100755 tests-m32/nlattr_ifla_xdp.gen.test create mode 100644 tests-m32/nlattr_inet_diag_msg.c create mode 100755 tests-m32/nlattr_inet_diag_msg.gen.test create mode 100644 tests-m32/nlattr_inet_diag_req_compat.c create mode 100755 tests-m32/nlattr_inet_diag_req_compat.gen.test create mode 100644 tests-m32/nlattr_inet_diag_req_v2.c create mode 100755 tests-m32/nlattr_inet_diag_req_v2.gen.test create mode 100644 tests-m32/nlattr_mdba_mdb_entry.c create mode 100755 tests-m32/nlattr_mdba_mdb_entry.gen.test create mode 100644 tests-m32/nlattr_mdba_router_port.c create mode 100755 tests-m32/nlattr_mdba_router_port.gen.test create mode 100644 tests-m32/nlattr_ndmsg.c create mode 100755 tests-m32/nlattr_ndmsg.gen.test create mode 100644 tests-m32/nlattr_ndtmsg.c create mode 100755 tests-m32/nlattr_ndtmsg.gen.test create mode 100644 tests-m32/nlattr_netconfmsg.c create mode 100755 tests-m32/nlattr_netconfmsg.gen.test create mode 100644 tests-m32/nlattr_netlink_diag_msg.c create mode 100755 tests-m32/nlattr_netlink_diag_msg.gen.test create mode 100644 tests-m32/nlattr_nlmsgerr.c create mode 100755 tests-m32/nlattr_nlmsgerr.gen.test create mode 100644 tests-m32/nlattr_packet_diag_msg.c create mode 100755 tests-m32/nlattr_packet_diag_msg.gen.test create mode 100644 tests-m32/nlattr_rtgenmsg.c create mode 100755 tests-m32/nlattr_rtgenmsg.gen.test create mode 100644 tests-m32/nlattr_rtmsg.c create mode 100755 tests-m32/nlattr_rtmsg.gen.test create mode 100644 tests-m32/nlattr_smc_diag_msg.c create mode 100755 tests-m32/nlattr_smc_diag_msg.gen.test create mode 100644 tests-m32/nlattr_tc_stats.c create mode 100755 tests-m32/nlattr_tc_stats.gen.test create mode 100644 tests-m32/nlattr_tca_stab.c create mode 100755 tests-m32/nlattr_tca_stab.gen.test create mode 100644 tests-m32/nlattr_tcamsg.c create mode 100755 tests-m32/nlattr_tcamsg.gen.test create mode 100644 tests-m32/nlattr_tcmsg.c create mode 100755 tests-m32/nlattr_tcmsg.gen.test create mode 100644 tests-m32/nlattr_unix_diag_msg.c create mode 100755 tests-m32/nlattr_unix_diag_msg.gen.test create mode 100644 tests-m32/nsyscalls-d.c create mode 100755 tests-m32/nsyscalls-d.test create mode 100755 tests-m32/nsyscalls-nd.test create mode 100644 tests-m32/old_mmap-P.c create mode 100755 tests-m32/old_mmap-P.gen.test create mode 100644 tests-m32/old_mmap-Xabbrev.c create mode 100755 tests-m32/old_mmap-Xabbrev.gen.test create mode 100644 tests-m32/old_mmap-Xraw.c create mode 100755 tests-m32/old_mmap-Xraw.gen.test create mode 100644 tests-m32/old_mmap-Xverbose.c create mode 100755 tests-m32/old_mmap-Xverbose.gen.test create mode 100644 tests-m32/old_mmap-v-none.c create mode 100755 tests-m32/old_mmap-v-none.gen.test create mode 100755 tests-m32/old_mmap.gen.test delete mode 100755 tests-m32/old_mmap.test create mode 100755 tests-m32/oldfstat.gen.test delete mode 100755 tests-m32/oldfstat.test create mode 100755 tests-m32/oldlstat.gen.test delete mode 100755 tests-m32/oldlstat.test create mode 100644 tests-m32/oldselect-P.c create mode 100755 tests-m32/oldselect-P.gen.test create mode 100644 tests-m32/oldselect-efault-P.c create mode 100755 tests-m32/oldselect-efault-P.gen.test create mode 100644 tests-m32/oldselect-efault.c create mode 100755 tests-m32/oldselect-efault.gen.test delete mode 100644 tests-m32/oldselect.expected create mode 100755 tests-m32/oldselect.gen.test delete mode 100755 tests-m32/oldselect.test create mode 100755 tests-m32/oldstat.gen.test delete mode 100755 tests-m32/oldstat.test create mode 100755 tests-m32/open.gen.test delete mode 100755 tests-m32/open.test create mode 100755 tests-m32/openat.gen.test delete mode 100755 tests-m32/openat.test create mode 100644 tests-m32/orphaned_process_group.c create mode 100755 tests-m32/orphaned_process_group.gen.test create mode 100644 tests-m32/osf_utimes.c create mode 100755 tests-m32/osf_utimes.gen.test create mode 100755 tests-m32/pause.gen.test delete mode 100755 tests-m32/pause.test create mode 100755 tests-m32/perf_event_open.gen.test delete mode 100755 tests-m32/perf_event_open.test create mode 100755 tests-m32/perf_event_open_nonverbose.gen.test delete mode 100755 tests-m32/perf_event_open_nonverbose.test create mode 100755 tests-m32/perf_event_open_unabbrev.gen.test delete mode 100755 tests-m32/perf_event_open_unabbrev.test create mode 100644 tests-m32/personality-Xabbrev.c create mode 100755 tests-m32/personality-Xabbrev.gen.test create mode 100644 tests-m32/personality-Xraw.c create mode 100755 tests-m32/personality-Xraw.gen.test create mode 100644 tests-m32/personality-Xverbose.c create mode 100755 tests-m32/personality-Xverbose.gen.test create mode 100644 tests-m32/pidfd_send_signal.c create mode 100755 tests-m32/pidfd_send_signal.gen.test create mode 100755 tests-m32/pipe2.gen.test delete mode 100755 tests-m32/pipe2.test create mode 100755 tests-m32/pkey_alloc.gen.test delete mode 100755 tests-m32/pkey_alloc.test create mode 100755 tests-m32/pkey_free.gen.test delete mode 100755 tests-m32/pkey_free.test create mode 100755 tests-m32/pkey_mprotect.gen.test delete mode 100755 tests-m32/pkey_mprotect.test create mode 100644 tests-m32/poll-P.c create mode 100755 tests-m32/poll-P.test create mode 100644 tests-m32/ppoll-P.c create mode 100755 tests-m32/ppoll-P.gen.test create mode 100644 tests-m32/ppoll-v.c delete mode 100644 tests-m32/ppoll-v.expected create mode 100755 tests-m32/ppoll-v.gen.test delete mode 100644 tests-m32/ppoll.expected create mode 100755 tests-m32/ppoll.gen.test delete mode 100755 tests-m32/ppoll.test create mode 100644 tests-m32/prctl-spec-inject.c create mode 100755 tests-m32/prctl-spec-inject.test create mode 100755 tests-m32/pread64-pwrite64.gen.test delete mode 100755 tests-m32/pread64-pwrite64.test create mode 100755 tests-m32/preadv-pwritev.gen.test delete mode 100755 tests-m32/preadv-pwritev.test create mode 100755 tests-m32/preadv.gen.test delete mode 100755 tests-m32/preadv.test create mode 100755 tests-m32/preadv2-pwritev2.gen.test delete mode 100755 tests-m32/preadv2-pwritev2.test create mode 100644 tests-m32/print_time.c create mode 100644 tests-m32/print_user_desc.c create mode 100755 tests-m32/printpath-umovestr-legacy.test create mode 100644 tests-m32/printpath-umovestr-peekdata.c create mode 100755 tests-m32/printpath-umovestr-peekdata.gen.test create mode 100644 tests-m32/printpath-umovestr-undumpable.c create mode 100755 tests-m32/printpath-umovestr-undumpable.gen.test create mode 100644 tests-m32/printpath-umovestr.c create mode 100755 tests-m32/printpath-umovestr.gen.test create mode 100644 tests-m32/printsignal-Xabbrev.c create mode 100755 tests-m32/printsignal-Xabbrev.gen.test create mode 100644 tests-m32/printsignal-Xraw.c create mode 100755 tests-m32/printsignal-Xraw.gen.test create mode 100644 tests-m32/printsignal-Xverbose.c create mode 100755 tests-m32/printsignal-Xverbose.gen.test create mode 100644 tests-m32/printsignal.c create mode 100755 tests-m32/printstr.gen.test delete mode 100755 tests-m32/printstr.test create mode 100755 tests-m32/printstrn-umoven-legacy.test create mode 100644 tests-m32/printstrn-umoven-peekdata.c create mode 100755 tests-m32/printstrn-umoven-peekdata.gen.test create mode 100644 tests-m32/printstrn-umoven-undumpable.c create mode 100755 tests-m32/printstrn-umoven-undumpable.gen.test create mode 100644 tests-m32/printstrn-umoven.c create mode 100755 tests-m32/printstrn-umoven.gen.test create mode 100755 tests-m32/prlimit64.gen.test delete mode 100755 tests-m32/prlimit64.test create mode 100755 tests-m32/process_vm_readv.gen.test delete mode 100755 tests-m32/process_vm_readv.test create mode 100755 tests-m32/process_vm_writev.gen.test delete mode 100755 tests-m32/process_vm_writev.test create mode 100755 tests-m32/pselect6.gen.test delete mode 100755 tests-m32/pselect6.test create mode 100755 tests-m32/ptrace.gen.test delete mode 100755 tests-m32/ptrace.test create mode 100644 tests-m32/ptrace_syscall_info.c create mode 100755 tests-m32/ptrace_syscall_info.gen.test create mode 100644 tests-m32/pure_executables.am create mode 100755 tests-m32/pure_executables.list create mode 100755 tests-m32/pwritev.gen.test delete mode 100755 tests-m32/pwritev.test create mode 100755 tests-m32/qual_fault-syscall.test create mode 100755 tests-m32/qual_inject-error-signal-syscall.test create mode 100755 tests-m32/qual_inject-retval-syscall.test create mode 100755 tests-m32/qual_inject-signal-syscall.test create mode 100644 tests-m32/qualify_personality.sh create mode 100644 tests-m32/qualify_personality_empty.in create mode 100644 tests-m32/quotactl-Xabbrev.c create mode 100755 tests-m32/quotactl-Xabbrev.gen.test create mode 100644 tests-m32/quotactl-Xraw.c create mode 100755 tests-m32/quotactl-Xraw.gen.test create mode 100644 tests-m32/quotactl-Xverbose.c create mode 100755 tests-m32/quotactl-Xverbose.gen.test create mode 100644 tests-m32/quotactl-success-v.c create mode 100755 tests-m32/quotactl-success-v.test create mode 100644 tests-m32/quotactl-success.c create mode 100755 tests-m32/quotactl-success.test create mode 100755 tests-m32/quotactl-v.gen.test delete mode 100755 tests-m32/quotactl-v.test create mode 100644 tests-m32/quotactl-xfs-success-v.c create mode 100755 tests-m32/quotactl-xfs-success-v.test create mode 100644 tests-m32/quotactl-xfs-success.c create mode 100755 tests-m32/quotactl-xfs-success.test create mode 100755 tests-m32/quotactl-xfs-v.gen.test delete mode 100755 tests-m32/quotactl-xfs-v.test create mode 100755 tests-m32/quotactl-xfs.gen.test delete mode 100755 tests-m32/quotactl-xfs.test create mode 100755 tests-m32/quotactl.gen.test delete mode 100755 tests-m32/quotactl.test create mode 100755 tests-m32/read-write.gen.test delete mode 100755 tests-m32/read-write.test create mode 100755 tests-m32/readahead.gen.test delete mode 100755 tests-m32/readahead.test create mode 100755 tests-m32/readdir.gen.test delete mode 100755 tests-m32/readdir.test create mode 100755 tests-m32/readlink.gen.test delete mode 100755 tests-m32/readlink.test create mode 100755 tests-m32/readlinkat.gen.test delete mode 100755 tests-m32/readlinkat.test create mode 100755 tests-m32/reboot.gen.test delete mode 100755 tests-m32/reboot.test create mode 100755 tests-m32/recvfrom.gen.test delete mode 100755 tests-m32/recvfrom.test create mode 100755 tests-m32/recvmmsg-timeout.gen.test delete mode 100755 tests-m32/recvmmsg-timeout.test create mode 100755 tests-m32/recvmsg.gen.test delete mode 100755 tests-m32/recvmsg.test create mode 100755 tests-m32/regex.gen.test create mode 100755 tests-m32/regex.in create mode 100644 tests-m32/remap_file_pages-Xabbrev.c create mode 100755 tests-m32/remap_file_pages-Xabbrev.gen.test create mode 100644 tests-m32/remap_file_pages-Xraw.c create mode 100755 tests-m32/remap_file_pages-Xraw.gen.test create mode 100644 tests-m32/remap_file_pages-Xverbose.c create mode 100755 tests-m32/remap_file_pages-Xverbose.gen.test create mode 100755 tests-m32/remap_file_pages.gen.test delete mode 100755 tests-m32/remap_file_pages.test create mode 100755 tests-m32/rename.gen.test delete mode 100755 tests-m32/rename.test create mode 100755 tests-m32/renameat.gen.test delete mode 100755 tests-m32/renameat.test create mode 100755 tests-m32/renameat2.gen.test delete mode 100755 tests-m32/renameat2.test create mode 100755 tests-m32/request_key.gen.test delete mode 100755 tests-m32/request_key.test create mode 100644 tests-m32/riscv_flush_icache.c create mode 100755 tests-m32/riscv_flush_icache.gen.test create mode 100755 tests-m32/rmdir.gen.test delete mode 100755 tests-m32/rmdir.test create mode 100644 tests-m32/rt_sigaction.awk create mode 100644 tests-m32/rt_sigaction.c create mode 100755 tests-m32/rt_sigaction.test create mode 100755 tests-m32/rt_sigpending.gen.test delete mode 100755 tests-m32/rt_sigpending.test create mode 100755 tests-m32/rt_sigprocmask.gen.test delete mode 100755 tests-m32/rt_sigprocmask.test create mode 100755 tests-m32/rt_sigqueueinfo.gen.test delete mode 100755 tests-m32/rt_sigqueueinfo.test create mode 100644 tests-m32/rt_sigreturn.c create mode 100755 tests-m32/rt_sigreturn.gen.test create mode 100755 tests-m32/rt_sigsuspend.gen.test delete mode 100755 tests-m32/rt_sigsuspend.test create mode 100755 tests-m32/rt_sigtimedwait.gen.test delete mode 100755 tests-m32/rt_sigtimedwait.test create mode 100755 tests-m32/rt_tgsigqueueinfo.gen.test delete mode 100755 tests-m32/rt_tgsigqueueinfo.test create mode 100644 tests-m32/run_expect_termsig.c create mode 100644 tests-m32/s390_guarded_storage-v.c create mode 100755 tests-m32/s390_guarded_storage-v.gen.test create mode 100644 tests-m32/s390_guarded_storage.c create mode 100755 tests-m32/s390_guarded_storage.gen.test create mode 100644 tests-m32/s390_pci_mmio_read_write.c create mode 100755 tests-m32/s390_pci_mmio_read_write.gen.test create mode 100644 tests-m32/s390_runtime_instr.c create mode 100755 tests-m32/s390_runtime_instr.gen.test create mode 100644 tests-m32/s390_sthyi-v.c create mode 100755 tests-m32/s390_sthyi-v.gen.test create mode 100644 tests-m32/s390_sthyi.c create mode 100755 tests-m32/s390_sthyi.gen.test create mode 100755 tests-m32/sched.gen.test create mode 100755 tests-m32/sched.in create mode 100755 tests-m32/sched_get_priority_mxx.gen.test delete mode 100755 tests-m32/sched_get_priority_mxx.test create mode 100755 tests-m32/sched_rr_get_interval.gen.test delete mode 100755 tests-m32/sched_rr_get_interval.test create mode 100755 tests-m32/sched_xetaffinity.gen.test delete mode 100755 tests-m32/sched_xetaffinity.test create mode 100755 tests-m32/sched_xetattr.gen.test delete mode 100755 tests-m32/sched_xetattr.test create mode 100755 tests-m32/sched_xetparam.gen.test delete mode 100755 tests-m32/sched_xetparam.test create mode 100755 tests-m32/sched_xetscheduler.gen.test delete mode 100755 tests-m32/sched_xetscheduler.test create mode 100755 tests-m32/sched_yield.gen.test delete mode 100755 tests-m32/sched_yield.test create mode 100755 tests-m32/seccomp-filter-v.gen.test delete mode 100755 tests-m32/seccomp-filter-v.test create mode 100755 tests-m32/seccomp-filter.gen.test delete mode 100755 tests-m32/seccomp-filter.test create mode 100644 tests-m32/seccomp_get_action_avail.c create mode 100755 tests-m32/seccomp_get_action_avail.gen.test create mode 100644 tests-m32/select-P.c create mode 100755 tests-m32/select-P.gen.test create mode 100755 tests-m32/select.gen.test delete mode 100755 tests-m32/select.test create mode 100755 tests-m32/semop.gen.test delete mode 100755 tests-m32/semop.test create mode 100755 tests-m32/sendfile.gen.test delete mode 100755 tests-m32/sendfile.test create mode 100755 tests-m32/sendfile64.gen.test delete mode 100755 tests-m32/sendfile64.test create mode 100755 tests-m32/set_mempolicy.gen.test delete mode 100755 tests-m32/set_mempolicy.test create mode 100644 tests-m32/set_sigblock.c create mode 100644 tests-m32/set_sigign.c create mode 100755 tests-m32/setdomainname.gen.test delete mode 100755 tests-m32/setdomainname.test create mode 100755 tests-m32/setfsgid.gen.test delete mode 100755 tests-m32/setfsgid.test create mode 100755 tests-m32/setfsgid32.gen.test delete mode 100755 tests-m32/setfsgid32.test create mode 100755 tests-m32/setfsuid.gen.test delete mode 100755 tests-m32/setfsuid.test create mode 100755 tests-m32/setfsuid32.gen.test delete mode 100755 tests-m32/setfsuid32.test create mode 100755 tests-m32/setgid.gen.test delete mode 100755 tests-m32/setgid.test create mode 100755 tests-m32/setgid32.gen.test delete mode 100755 tests-m32/setgid32.test create mode 100755 tests-m32/setgroups.gen.test delete mode 100755 tests-m32/setgroups.test create mode 100755 tests-m32/setgroups32.gen.test delete mode 100755 tests-m32/setgroups32.test create mode 100755 tests-m32/sethostname.gen.test delete mode 100755 tests-m32/sethostname.test create mode 100755 tests-m32/setns.gen.test delete mode 100755 tests-m32/setns.test create mode 100755 tests-m32/setregid.gen.test delete mode 100755 tests-m32/setregid.test create mode 100755 tests-m32/setregid32.gen.test delete mode 100755 tests-m32/setregid32.test create mode 100755 tests-m32/setresgid.gen.test delete mode 100755 tests-m32/setresgid.test create mode 100755 tests-m32/setresgid32.gen.test delete mode 100755 tests-m32/setresgid32.test create mode 100755 tests-m32/setresuid.gen.test delete mode 100755 tests-m32/setresuid.test create mode 100755 tests-m32/setresuid32.gen.test delete mode 100755 tests-m32/setresuid32.test create mode 100755 tests-m32/setreuid.gen.test delete mode 100755 tests-m32/setreuid.test create mode 100755 tests-m32/setreuid32.gen.test delete mode 100755 tests-m32/setreuid32.test create mode 100644 tests-m32/setrlimit-Xabbrev.c create mode 100755 tests-m32/setrlimit-Xabbrev.gen.test create mode 100644 tests-m32/setrlimit-Xraw.c create mode 100755 tests-m32/setrlimit-Xraw.gen.test create mode 100644 tests-m32/setrlimit-Xverbose.c create mode 100755 tests-m32/setrlimit-Xverbose.gen.test create mode 100755 tests-m32/setrlimit.gen.test delete mode 100755 tests-m32/setrlimit.test create mode 100755 tests-m32/setuid.gen.test delete mode 100755 tests-m32/setuid.test create mode 100755 tests-m32/setuid32.gen.test delete mode 100755 tests-m32/setuid32.test create mode 100755 tests-m32/shmxt.gen.test delete mode 100755 tests-m32/shmxt.test create mode 100755 tests-m32/shutdown.gen.test delete mode 100755 tests-m32/shutdown.test delete mode 100644 tests-m32/sigaction.awk create mode 100755 tests-m32/sigaction.gen.test delete mode 100755 tests-m32/sigaction.test create mode 100755 tests-m32/sigblock.test create mode 100755 tests-m32/sigign.test create mode 100755 tests-m32/siginfo.gen.test delete mode 100755 tests-m32/siginfo.test create mode 100644 tests-m32/signal.c create mode 100755 tests-m32/signal.gen.test create mode 100755 tests-m32/signal_receive.gen.test delete mode 100755 tests-m32/signal_receive.test create mode 100755 tests-m32/signalfd4.gen.test delete mode 100755 tests-m32/signalfd4.test create mode 100644 tests-m32/sigpending.c create mode 100755 tests-m32/sigpending.gen.test create mode 100644 tests-m32/sigprocmask.c create mode 100755 tests-m32/sigprocmask.gen.test create mode 100755 tests-m32/sigreturn.gen.test delete mode 100755 tests-m32/sigreturn.test create mode 100644 tests-m32/sigsuspend.c create mode 100755 tests-m32/sigsuspend.gen.test create mode 100644 tests-m32/skip_unavailable.c create mode 100644 tests-m32/so_error.c create mode 100755 tests-m32/so_error.gen.test create mode 100644 tests-m32/so_linger.c create mode 100755 tests-m32/so_linger.gen.test create mode 100644 tests-m32/so_peercred-Xabbrev.c create mode 100755 tests-m32/so_peercred-Xabbrev.gen.test create mode 100644 tests-m32/so_peercred-Xraw.c create mode 100755 tests-m32/so_peercred-Xraw.gen.test create mode 100644 tests-m32/so_peercred-Xverbose.c create mode 100755 tests-m32/so_peercred-Xverbose.gen.test create mode 100644 tests-m32/so_peercred.c create mode 100755 tests-m32/so_peercred.gen.test create mode 100644 tests-m32/sock_filter-v-Xabbrev.c create mode 100755 tests-m32/sock_filter-v-Xabbrev.gen.test create mode 100644 tests-m32/sock_filter-v-Xraw.c create mode 100755 tests-m32/sock_filter-v-Xraw.gen.test create mode 100644 tests-m32/sock_filter-v-Xverbose.c create mode 100755 tests-m32/sock_filter-v-Xverbose.gen.test create mode 100644 tests-m32/sock_filter-v.c create mode 100755 tests-m32/sock_filter-v.gen.test create mode 100644 tests-m32/sockaddr_xlat-Xabbrev.c create mode 100755 tests-m32/sockaddr_xlat-Xabbrev.gen.test create mode 100644 tests-m32/sockaddr_xlat-Xraw.c create mode 100755 tests-m32/sockaddr_xlat-Xraw.gen.test create mode 100644 tests-m32/sockaddr_xlat-Xverbose.c create mode 100755 tests-m32/sockaddr_xlat-Xverbose.gen.test create mode 100644 tests-m32/sockaddr_xlat.c create mode 100755 tests-m32/socketcall.gen.test delete mode 100755 tests-m32/socketcall.test create mode 100644 tests-m32/sockopt-sol_netlink.c create mode 100755 tests-m32/sockopt-sol_netlink.gen.test create mode 100644 tests-m32/sockopt-timestamp.c create mode 100755 tests-m32/sockopt-timestamp.gen.test create mode 100755 tests-m32/splice.gen.test delete mode 100755 tests-m32/splice.test create mode 100644 tests-m32/stack-fcall-mangled-0.c create mode 100644 tests-m32/stack-fcall-mangled-1.c create mode 100644 tests-m32/stack-fcall-mangled-2.c create mode 100644 tests-m32/stack-fcall-mangled-3.c create mode 100644 tests-m32/stack-fcall-mangled.c create mode 100644 tests-m32/stack-fcall.h create mode 100755 tests-m32/stat.gen.test delete mode 100755 tests-m32/stat.test create mode 100755 tests-m32/stat64.gen.test delete mode 100755 tests-m32/stat64.test delete mode 100644 tests-m32/statfs.expected create mode 100755 tests-m32/statfs.gen.test delete mode 100755 tests-m32/statfs.test create mode 100755 tests-m32/statfs64.gen.test delete mode 100755 tests-m32/statfs64.test create mode 100644 tests-m32/statx.c create mode 100755 tests-m32/statx.gen.test delete mode 100755 tests-m32/statx.sh create mode 100644 tests-m32/strace-k-demangle.expected create mode 100755 tests-m32/strace-k-demangle.test create mode 100644 tests-m32/strace-k.expected create mode 100755 tests-m32/strace-log-merge-error.test create mode 100755 tests-m32/strace-log-merge-suffix.test delete mode 100644 tests-m32/struct_flock.c create mode 100755 tests-m32/swap.gen.test delete mode 100755 tests-m32/swap.test create mode 100644 tests-m32/sxetmask.c create mode 100755 tests-m32/sxetmask.gen.test create mode 100755 tests-m32/symlink.gen.test delete mode 100755 tests-m32/symlink.test create mode 100755 tests-m32/symlinkat.gen.test delete mode 100755 tests-m32/symlinkat.test create mode 100755 tests-m32/sync.gen.test delete mode 100755 tests-m32/sync.test create mode 100755 tests-m32/sync_file_range.gen.test delete mode 100755 tests-m32/sync_file_range.test create mode 100755 tests-m32/sync_file_range2.gen.test delete mode 100755 tests-m32/sync_file_range2.test create mode 100644 tests-m32/syntax.sh create mode 100755 tests-m32/sysinfo.gen.test delete mode 100755 tests-m32/sysinfo.test create mode 100755 tests-m32/syslog.gen.test delete mode 100755 tests-m32/syslog.test create mode 100755 tests-m32/tee.gen.test delete mode 100755 tests-m32/tee.test create mode 100755 tests-m32/termsig.test create mode 100644 tests-m32/test_netlink.h create mode 100644 tests-m32/test_nlattr.h create mode 100644 tests-m32/test_printpath.c create mode 100644 tests-m32/test_printstrn.c create mode 100644 tests-m32/test_ucopy.c create mode 100644 tests-m32/test_ucopy.h create mode 100755 tests-m32/time.gen.test delete mode 100755 tests-m32/time.test create mode 100755 tests-m32/timer_create.gen.test delete mode 100755 tests-m32/timer_create.test create mode 100755 tests-m32/timer_xettime.gen.test delete mode 100755 tests-m32/timer_xettime.test create mode 100755 tests-m32/timerfd_xettime.gen.test delete mode 100755 tests-m32/timerfd_xettime.test create mode 100755 tests-m32/times-fail.gen.test delete mode 100755 tests-m32/times-fail.test create mode 100755 tests-m32/times.gen.test delete mode 100755 tests-m32/times.test create mode 100755 tests-m32/trace_fstat.gen.test create mode 100644 tests-m32/trace_fstat.in create mode 100755 tests-m32/trace_fstatfs.gen.test create mode 100644 tests-m32/trace_fstatfs.in create mode 100755 tests-m32/trace_lstat.gen.test create mode 100644 tests-m32/trace_lstat.in create mode 100755 tests-m32/trace_personality_32.gen.test create mode 100644 tests-m32/trace_personality_32.in create mode 100755 tests-m32/trace_personality_64.gen.test create mode 100644 tests-m32/trace_personality_64.in create mode 100755 tests-m32/trace_personality_regex_32.gen.test create mode 100755 tests-m32/trace_personality_regex_32.in create mode 100755 tests-m32/trace_personality_regex_64.gen.test create mode 100755 tests-m32/trace_personality_regex_64.in create mode 100755 tests-m32/trace_personality_regex_x32.gen.test create mode 100755 tests-m32/trace_personality_regex_x32.in create mode 100755 tests-m32/trace_personality_x32.gen.test create mode 100644 tests-m32/trace_personality_x32.in create mode 100755 tests-m32/trace_question.gen.test create mode 100644 tests-m32/trace_question.in create mode 100755 tests-m32/trace_stat.gen.test create mode 100644 tests-m32/trace_stat.in create mode 100755 tests-m32/trace_stat_like.gen.test create mode 100644 tests-m32/trace_stat_like.in create mode 100755 tests-m32/trace_statfs.gen.test create mode 100644 tests-m32/trace_statfs.in create mode 100755 tests-m32/trace_statfs_like.gen.test create mode 100644 tests-m32/trace_statfs_like.in create mode 100755 tests-m32/truncate.gen.test delete mode 100755 tests-m32/truncate.test create mode 100755 tests-m32/truncate64.gen.test delete mode 100755 tests-m32/truncate64.test create mode 100755 tests-m32/ugetrlimit.gen.test delete mode 100755 tests-m32/ugetrlimit.test create mode 100755 tests-m32/umask.gen.test delete mode 100755 tests-m32/umask.test create mode 100755 tests-m32/umoven-illptr.gen.test delete mode 100755 tests-m32/umoven-illptr.test create mode 100755 tests-m32/umovestr-illptr.gen.test delete mode 100755 tests-m32/umovestr-illptr.test create mode 100755 tests-m32/umovestr3.gen.test delete mode 100755 tests-m32/umovestr3.test create mode 100644 tests-m32/unblock_reset_raise.c create mode 100755 tests-m32/unlink.gen.test delete mode 100755 tests-m32/unlink.test create mode 100755 tests-m32/unlinkat.gen.test delete mode 100755 tests-m32/unlinkat.test create mode 100755 tests-m32/unshare.gen.test delete mode 100755 tests-m32/unshare.test create mode 100755 tests-m32/userfaultfd.gen.test delete mode 100755 tests-m32/userfaultfd.test create mode 100755 tests-m32/ustat.gen.test delete mode 100755 tests-m32/ustat.test create mode 100755 tests-m32/utime.gen.test delete mode 100755 tests-m32/utime.test create mode 100644 tests-m32/utimensat-Xabbrev.c create mode 100755 tests-m32/utimensat-Xabbrev.gen.test create mode 100644 tests-m32/utimensat-Xraw.c create mode 100755 tests-m32/utimensat-Xraw.gen.test create mode 100644 tests-m32/utimensat-Xverbose.c create mode 100755 tests-m32/utimensat-Xverbose.gen.test create mode 100755 tests-m32/utimensat.gen.test delete mode 100755 tests-m32/utimensat.test create mode 100755 tests-m32/utimes.gen.test delete mode 100755 tests-m32/utimes.test create mode 100755 tests-m32/vfork-f.gen.test delete mode 100755 tests-m32/vfork-f.test create mode 100755 tests-m32/vhangup.gen.test delete mode 100755 tests-m32/vhangup.test create mode 100755 tests-m32/vmsplice.gen.test delete mode 100755 tests-m32/vmsplice.test create mode 100755 tests-m32/wait4-v.gen.test delete mode 100755 tests-m32/wait4-v.test create mode 100755 tests-m32/wait4.gen.test delete mode 100755 tests-m32/wait4.test create mode 100755 tests-m32/waitid-v.gen.test delete mode 100755 tests-m32/waitid-v.test create mode 100755 tests-m32/waitid.gen.test delete mode 100755 tests-m32/waitid.test create mode 100755 tests-m32/waitpid.gen.test delete mode 100755 tests-m32/waitpid.test create mode 100755 tests-m32/xattr-strings.gen.test delete mode 100755 tests-m32/xattr-strings.test create mode 100755 tests-m32/xattr.gen.test delete mode 100755 tests-m32/xattr.test create mode 100755 tests-m32/xet_robust_list.gen.test delete mode 100755 tests-m32/xet_robust_list.test create mode 100644 tests-m32/xet_thread_area_x86.c create mode 100755 tests-m32/xet_thread_area_x86.test create mode 100755 tests-m32/xetitimer.gen.test delete mode 100755 tests-m32/xetitimer.test create mode 100755 tests-m32/xetpgid.gen.test delete mode 100755 tests-m32/xetpgid.test create mode 100755 tests-m32/xetpriority.gen.test delete mode 100755 tests-m32/xetpriority.test create mode 100755 tests-m32/xettimeofday.gen.test delete mode 100755 tests-m32/xettimeofday.test create mode 100644 tests-m32/xutimes.c create mode 100644 tests-m32/zeroargc.c create mode 100644 tests-mx32/COPYING create mode 100644 tests-mx32/GPL-2.0-or-later create mode 100755 tests-mx32/PTRACE_SEIZE.sh create mode 100644 tests-mx32/_newselect-P.c create mode 100755 tests-mx32/_newselect-P.gen.test create mode 100755 tests-mx32/_newselect.gen.test delete mode 100755 tests-mx32/_newselect.test create mode 100755 tests-mx32/accept.gen.test delete mode 100755 tests-mx32/accept.test create mode 100755 tests-mx32/accept4.gen.test delete mode 100755 tests-mx32/accept4.test create mode 100644 tests-mx32/accept_compat.h create mode 100755 tests-mx32/access.gen.test delete mode 100755 tests-mx32/access.test create mode 100755 tests-mx32/acct.gen.test delete mode 100755 tests-mx32/acct.test create mode 100755 tests-mx32/add_key.gen.test delete mode 100755 tests-mx32/add_key.test create mode 100755 tests-mx32/adjtimex.gen.test delete mode 100755 tests-mx32/adjtimex.test create mode 100755 tests-mx32/aio.gen.test delete mode 100755 tests-mx32/aio.test create mode 100644 tests-mx32/aio_pgetevents.c create mode 100755 tests-mx32/aio_pgetevents.gen.test create mode 100755 tests-mx32/alarm.gen.test delete mode 100755 tests-mx32/alarm.test create mode 100644 tests-mx32/attach-p-cmd.h create mode 100644 tests-mx32/block_reset_raise_run.c create mode 100644 tests-mx32/bpf-obj_get_info_by_fd-prog-v.c create mode 100755 tests-mx32/bpf-obj_get_info_by_fd-prog-v.gen.test create mode 100644 tests-mx32/bpf-obj_get_info_by_fd-prog.c create mode 100755 tests-mx32/bpf-obj_get_info_by_fd-prog.gen.test create mode 100644 tests-mx32/bpf-obj_get_info_by_fd-v.c create mode 100755 tests-mx32/bpf-obj_get_info_by_fd-v.gen.test create mode 100644 tests-mx32/bpf-obj_get_info_by_fd.c create mode 100755 tests-mx32/bpf-obj_get_info_by_fd.gen.test create mode 100644 tests-mx32/bpf-success-v.c create mode 100755 tests-mx32/bpf-success-v.test create mode 100644 tests-mx32/bpf-success.c create mode 100755 tests-mx32/bpf-success.test create mode 100644 tests-mx32/bpf-v.c create mode 100755 tests-mx32/bpf-v.gen.test create mode 100755 tests-mx32/bpf.gen.test delete mode 100755 tests-mx32/bpf.test create mode 100755 tests-mx32/btrfs-X.test create mode 100755 tests-mx32/btrfs-vX.test create mode 100755 tests-mx32/btrfs-vwX.test create mode 100755 tests-mx32/btrfs-wX.test create mode 100755 tests-mx32/btrfs.gen.test delete mode 100755 tests-mx32/btrfs.test create mode 100644 tests-mx32/check_sigblock.c create mode 100644 tests-mx32/check_sigign.c create mode 100755 tests-mx32/chmod.gen.test delete mode 100755 tests-mx32/chmod.test create mode 100755 tests-mx32/chown.gen.test delete mode 100755 tests-mx32/chown.test create mode 100755 tests-mx32/chown32.gen.test delete mode 100755 tests-mx32/chown32.test create mode 100755 tests-mx32/chroot.gen.test delete mode 100755 tests-mx32/chroot.test create mode 100755 tests-mx32/clock.gen.test create mode 100755 tests-mx32/clock.in create mode 100755 tests-mx32/clock_adjtime.gen.test delete mode 100755 tests-mx32/clock_adjtime.test create mode 100755 tests-mx32/clock_nanosleep.gen.test delete mode 100755 tests-mx32/clock_nanosleep.test create mode 100755 tests-mx32/clock_xettime.gen.test delete mode 100755 tests-mx32/clock_xettime.test create mode 100644 tests-mx32/clone_parent.c create mode 100755 tests-mx32/clone_parent.test create mode 100644 tests-mx32/clone_ptrace.c create mode 100755 tests-mx32/clone_ptrace.test create mode 100755 tests-mx32/copy_file_range.gen.test delete mode 100755 tests-mx32/copy_file_range.test create mode 100755 tests-mx32/creat.gen.test delete mode 100755 tests-mx32/creat.test create mode 100644 tests-mx32/create_nl_socket.c create mode 100644 tests-mx32/delay.c create mode 100755 tests-mx32/delay.test create mode 100755 tests-mx32/delete_module.gen.test delete mode 100755 tests-mx32/delete_module.test create mode 100644 tests-mx32/dev-yy.c create mode 100755 tests-mx32/dev-yy.gen.test create mode 100755 tests-mx32/dup.gen.test delete mode 100755 tests-mx32/dup.test create mode 100755 tests-mx32/dup2.gen.test delete mode 100755 tests-mx32/dup2.test create mode 100755 tests-mx32/dup3.gen.test delete mode 100755 tests-mx32/dup3.test create mode 100755 tests-mx32/epoll_create.gen.test delete mode 100755 tests-mx32/epoll_create.test create mode 100755 tests-mx32/epoll_create1.gen.test delete mode 100755 tests-mx32/epoll_create1.test create mode 100755 tests-mx32/epoll_ctl.gen.test delete mode 100755 tests-mx32/epoll_ctl.test create mode 100755 tests-mx32/epoll_pwait.gen.test delete mode 100755 tests-mx32/epoll_pwait.test create mode 100755 tests-mx32/epoll_wait.gen.test delete mode 100755 tests-mx32/epoll_wait.test create mode 100755 tests-mx32/erestartsys.gen.test delete mode 100755 tests-mx32/erestartsys.test create mode 100755 tests-mx32/execveat-v.gen.test delete mode 100755 tests-mx32/execveat-v.test create mode 100755 tests-mx32/execveat.gen.test delete mode 100755 tests-mx32/execveat.test create mode 100755 tests-mx32/faccessat.gen.test delete mode 100755 tests-mx32/faccessat.test create mode 100755 tests-mx32/fadvise64_64.gen.test delete mode 100755 tests-mx32/fadvise64_64.test create mode 100755 tests-mx32/fallocate.gen.test delete mode 100755 tests-mx32/fallocate.test create mode 100755 tests-mx32/fanotify_init.gen.test delete mode 100755 tests-mx32/fanotify_init.test create mode 100644 tests-mx32/fanotify_mark-Xabbrev.c create mode 100755 tests-mx32/fanotify_mark-Xabbrev.gen.test create mode 100644 tests-mx32/fanotify_mark-Xraw.c create mode 100755 tests-mx32/fanotify_mark-Xraw.gen.test create mode 100644 tests-mx32/fanotify_mark-Xverbose.c create mode 100755 tests-mx32/fanotify_mark-Xverbose.gen.test create mode 100755 tests-mx32/fanotify_mark.gen.test delete mode 100755 tests-mx32/fanotify_mark.test create mode 100755 tests-mx32/fchdir.gen.test delete mode 100755 tests-mx32/fchdir.test create mode 100755 tests-mx32/fchmod.gen.test delete mode 100755 tests-mx32/fchmod.test create mode 100755 tests-mx32/fchmodat.gen.test delete mode 100755 tests-mx32/fchmodat.test create mode 100755 tests-mx32/fchown.gen.test delete mode 100755 tests-mx32/fchown.test create mode 100755 tests-mx32/fchown32.gen.test delete mode 100755 tests-mx32/fchown32.test create mode 100755 tests-mx32/fchownat.gen.test delete mode 100755 tests-mx32/fchownat.test create mode 100644 tests-mx32/fcntl-common.c create mode 100755 tests-mx32/fcntl.gen.test delete mode 100755 tests-mx32/fcntl.test create mode 100755 tests-mx32/fcntl64.gen.test delete mode 100755 tests-mx32/fcntl64.test create mode 100755 tests-mx32/fdatasync.gen.test delete mode 100755 tests-mx32/fdatasync.test create mode 100644 tests-mx32/fflush.c create mode 100755 tests-mx32/fflush.test create mode 100755 tests-mx32/file_handle.gen.test delete mode 100755 tests-mx32/file_handle.test create mode 100755 tests-mx32/file_ioctl.gen.test delete mode 100755 tests-mx32/file_ioctl.test create mode 100755 tests-mx32/filtering_fd-syntax.test create mode 100755 tests-mx32/filtering_syscall-syntax.test create mode 100755 tests-mx32/finit_module.gen.test delete mode 100755 tests-mx32/finit_module.test create mode 100755 tests-mx32/first_exec_failure.test create mode 100755 tests-mx32/flock.gen.test delete mode 100755 tests-mx32/flock.test create mode 100755 tests-mx32/fork-f.gen.test delete mode 100755 tests-mx32/fork-f.test create mode 100644 tests-mx32/fstat-Xabbrev.c create mode 100755 tests-mx32/fstat-Xabbrev.gen.test create mode 100644 tests-mx32/fstat-Xraw.c create mode 100755 tests-mx32/fstat-Xraw.gen.test create mode 100644 tests-mx32/fstat-Xverbose.c create mode 100755 tests-mx32/fstat-Xverbose.gen.test create mode 100755 tests-mx32/fstat.gen.test delete mode 100755 tests-mx32/fstat.test create mode 100644 tests-mx32/fstat64-Xabbrev.c create mode 100755 tests-mx32/fstat64-Xabbrev.gen.test create mode 100644 tests-mx32/fstat64-Xraw.c create mode 100755 tests-mx32/fstat64-Xraw.gen.test create mode 100644 tests-mx32/fstat64-Xverbose.c create mode 100755 tests-mx32/fstat64-Xverbose.gen.test create mode 100755 tests-mx32/fstat64.gen.test delete mode 100755 tests-mx32/fstat64.test create mode 100755 tests-mx32/fstatat64.gen.test delete mode 100755 tests-mx32/fstatat64.test create mode 100755 tests-mx32/fstatfs.gen.test delete mode 100755 tests-mx32/fstatfs.test create mode 100755 tests-mx32/fstatfs64.gen.test delete mode 100755 tests-mx32/fstatfs64.test create mode 100644 tests-mx32/fsync-y.c create mode 100755 tests-mx32/fsync-y.gen.test create mode 100755 tests-mx32/fsync.gen.test delete mode 100755 tests-mx32/fsync.test create mode 100755 tests-mx32/ftruncate.gen.test delete mode 100755 tests-mx32/ftruncate.test create mode 100755 tests-mx32/ftruncate64.gen.test delete mode 100755 tests-mx32/ftruncate64.test create mode 100755 tests-mx32/futimesat.gen.test delete mode 100755 tests-mx32/futimesat.test create mode 100755 tests-mx32/gen_pure_executables.sh create mode 100644 tests-mx32/gen_tests.am create mode 100644 tests-mx32/gen_tests.in create mode 100755 tests-mx32/gen_tests.sh create mode 100755 tests-mx32/get_mempolicy.gen.test delete mode 100755 tests-mx32/get_mempolicy.test create mode 100755 tests-mx32/get_regs.test create mode 100644 tests-mx32/get_sigset_size.c create mode 100755 tests-mx32/getcpu.gen.test delete mode 100755 tests-mx32/getcpu.test create mode 100755 tests-mx32/getcwd.gen.test delete mode 100755 tests-mx32/getcwd.test create mode 100755 tests-mx32/getdents.gen.test delete mode 100755 tests-mx32/getdents.test create mode 100755 tests-mx32/getdents64.gen.test delete mode 100755 tests-mx32/getdents64.test create mode 100755 tests-mx32/getegid.gen.test delete mode 100755 tests-mx32/getegid.test create mode 100755 tests-mx32/getegid32.gen.test delete mode 100755 tests-mx32/getegid32.test create mode 100755 tests-mx32/geteuid.gen.test delete mode 100755 tests-mx32/geteuid.test create mode 100755 tests-mx32/geteuid32.gen.test delete mode 100755 tests-mx32/geteuid32.test create mode 100755 tests-mx32/getgid.gen.test delete mode 100755 tests-mx32/getgid.test create mode 100755 tests-mx32/getgid32.gen.test delete mode 100755 tests-mx32/getgid32.test create mode 100755 tests-mx32/getgroups.gen.test delete mode 100755 tests-mx32/getgroups.test create mode 100755 tests-mx32/getgroups32.gen.test delete mode 100755 tests-mx32/getgroups32.test create mode 100755 tests-mx32/getpeername.gen.test delete mode 100755 tests-mx32/getpeername.test create mode 100755 tests-mx32/getpgrp.gen.test delete mode 100755 tests-mx32/getpgrp.test create mode 100644 tests-mx32/getpid.c create mode 100755 tests-mx32/getpid.gen.test create mode 100644 tests-mx32/getppid.c create mode 100755 tests-mx32/getppid.gen.test create mode 100755 tests-mx32/getrandom.gen.test delete mode 100755 tests-mx32/getrandom.test create mode 100755 tests-mx32/getresgid.gen.test delete mode 100755 tests-mx32/getresgid.test create mode 100755 tests-mx32/getresgid32.gen.test delete mode 100755 tests-mx32/getresgid32.test create mode 100755 tests-mx32/getresuid.gen.test delete mode 100755 tests-mx32/getresuid.test create mode 100755 tests-mx32/getresuid32.gen.test delete mode 100755 tests-mx32/getresuid32.test create mode 100755 tests-mx32/getrlimit.gen.test delete mode 100755 tests-mx32/getrlimit.test create mode 100755 tests-mx32/getrusage.gen.test delete mode 100755 tests-mx32/getrusage.test create mode 100755 tests-mx32/getsid.gen.test delete mode 100755 tests-mx32/getsid.test create mode 100755 tests-mx32/getsockname.gen.test delete mode 100755 tests-mx32/getsockname.test create mode 100644 tests-mx32/gettid.c create mode 100755 tests-mx32/gettid.gen.test create mode 100755 tests-mx32/getuid32.gen.test delete mode 100755 tests-mx32/getuid32.test create mode 100755 tests-mx32/getxxid.gen.test delete mode 100755 tests-mx32/getxxid.test create mode 100644 tests-mx32/group_req.c create mode 100755 tests-mx32/group_req.gen.test create mode 100644 tests-mx32/ifindex.c create mode 100755 tests-mx32/inet-cmsg.gen.test delete mode 100755 tests-mx32/inet-cmsg.test create mode 100755 tests-mx32/init_module.gen.test delete mode 100755 tests-mx32/init_module.test create mode 100644 tests-mx32/inject-nf.c create mode 100755 tests-mx32/inject-nf.test create mode 100755 tests-mx32/inotify.gen.test delete mode 100755 tests-mx32/inotify.test create mode 100755 tests-mx32/inotify_init1.gen.test delete mode 100755 tests-mx32/inotify_init1.test create mode 100644 tests-mx32/int_0x80.c create mode 100755 tests-mx32/int_0x80.test create mode 100755 tests-mx32/interactive_block.test create mode 100644 tests-mx32/io_uring_enter.c create mode 100755 tests-mx32/io_uring_enter.gen.test create mode 100644 tests-mx32/io_uring_register.c create mode 100755 tests-mx32/io_uring_register.gen.test create mode 100644 tests-mx32/io_uring_setup.c create mode 100755 tests-mx32/io_uring_setup.gen.test create mode 100755 tests-mx32/ioctl_block.gen.test delete mode 100755 tests-mx32/ioctl_block.test create mode 100755 tests-mx32/ioctl_dm-v.gen.test delete mode 100755 tests-mx32/ioctl_dm-v.test create mode 100755 tests-mx32/ioctl_dm.gen.test delete mode 100755 tests-mx32/ioctl_dm.test create mode 100644 tests-mx32/ioctl_evdev-success-v.c create mode 100755 tests-mx32/ioctl_evdev-success-v.test create mode 100644 tests-mx32/ioctl_evdev-success.c create mode 100755 tests-mx32/ioctl_evdev-success.test create mode 100755 tests-mx32/ioctl_evdev-v.gen.test delete mode 100755 tests-mx32/ioctl_evdev-v.test create mode 100755 tests-mx32/ioctl_evdev.gen.test delete mode 100755 tests-mx32/ioctl_evdev.test create mode 100644 tests-mx32/ioctl_inotify.c create mode 100755 tests-mx32/ioctl_inotify.gen.test create mode 100644 tests-mx32/ioctl_kvm_run-v.c create mode 100755 tests-mx32/ioctl_kvm_run-v.gen.test create mode 100644 tests-mx32/ioctl_kvm_run.c create mode 100755 tests-mx32/ioctl_kvm_run.gen.test create mode 100644 tests-mx32/ioctl_kvm_run_auxstr_vcpu.c create mode 100755 tests-mx32/ioctl_kvm_run_auxstr_vcpu.gen.test create mode 100644 tests-mx32/ioctl_kvm_run_common.c create mode 100755 tests-mx32/ioctl_loop-nv.gen.test delete mode 100755 tests-mx32/ioctl_loop-nv.test create mode 100755 tests-mx32/ioctl_loop-v.gen.test delete mode 100755 tests-mx32/ioctl_loop-v.test create mode 100755 tests-mx32/ioctl_loop.gen.test delete mode 100755 tests-mx32/ioctl_loop.test create mode 100755 tests-mx32/ioctl_mtd.gen.test delete mode 100755 tests-mx32/ioctl_mtd.test create mode 100644 tests-mx32/ioctl_nbd.c create mode 100755 tests-mx32/ioctl_nbd.gen.test create mode 100644 tests-mx32/ioctl_nsfs.c create mode 100755 tests-mx32/ioctl_nsfs.gen.test create mode 100644 tests-mx32/ioctl_perf-success.c create mode 100755 tests-mx32/ioctl_perf-success.test create mode 100644 tests-mx32/ioctl_perf.c create mode 100755 tests-mx32/ioctl_perf.gen.test create mode 100644 tests-mx32/ioctl_ptp.c create mode 100755 tests-mx32/ioctl_ptp.gen.test create mode 100644 tests-mx32/ioctl_random.c create mode 100755 tests-mx32/ioctl_random.gen.test create mode 100755 tests-mx32/ioctl_rtc-v.gen.test delete mode 100755 tests-mx32/ioctl_rtc-v.test create mode 100755 tests-mx32/ioctl_rtc.gen.test delete mode 100755 tests-mx32/ioctl_rtc.test create mode 100755 tests-mx32/ioctl_scsi.gen.test delete mode 100755 tests-mx32/ioctl_scsi.test create mode 100755 tests-mx32/ioctl_sg_io_v3.gen.test delete mode 100755 tests-mx32/ioctl_sg_io_v3.test create mode 100755 tests-mx32/ioctl_sg_io_v4.gen.test delete mode 100755 tests-mx32/ioctl_sg_io_v4.test create mode 100755 tests-mx32/ioctl_sock_gifconf.gen.test delete mode 100755 tests-mx32/ioctl_sock_gifconf.test create mode 100755 tests-mx32/ioctl_uffdio.gen.test delete mode 100755 tests-mx32/ioctl_uffdio.test create mode 100755 tests-mx32/ioctl_v4l2.gen.test delete mode 100755 tests-mx32/ioctl_v4l2.test create mode 100755 tests-mx32/ioperm.gen.test delete mode 100755 tests-mx32/ioperm.test create mode 100755 tests-mx32/iopl.gen.test delete mode 100755 tests-mx32/iopl.test create mode 100644 tests-mx32/ioprio-Xabbrev.c create mode 100755 tests-mx32/ioprio-Xabbrev.gen.test create mode 100644 tests-mx32/ioprio-Xraw.c create mode 100755 tests-mx32/ioprio-Xraw.gen.test create mode 100644 tests-mx32/ioprio-Xverbose.c create mode 100755 tests-mx32/ioprio-Xverbose.gen.test create mode 100755 tests-mx32/ioprio.gen.test delete mode 100755 tests-mx32/ioprio.test create mode 100755 tests-mx32/ip_mreq.gen.test delete mode 100755 tests-mx32/ip_mreq.test create mode 100755 tests-mx32/ipc.gen.test delete mode 100755 tests-mx32/ipc.test create mode 100644 tests-mx32/ipc_msg-Xabbrev.c create mode 100755 tests-mx32/ipc_msg-Xabbrev.gen.test create mode 100644 tests-mx32/ipc_msg-Xraw.c create mode 100755 tests-mx32/ipc_msg-Xraw.gen.test create mode 100644 tests-mx32/ipc_msg-Xverbose.c create mode 100755 tests-mx32/ipc_msg-Xverbose.gen.test create mode 100755 tests-mx32/ipc_msg.gen.test delete mode 100755 tests-mx32/ipc_msg.test create mode 100644 tests-mx32/ipc_msgbuf-Xabbrev.c create mode 100755 tests-mx32/ipc_msgbuf-Xabbrev.gen.test create mode 100644 tests-mx32/ipc_msgbuf-Xraw.c create mode 100755 tests-mx32/ipc_msgbuf-Xraw.gen.test create mode 100644 tests-mx32/ipc_msgbuf-Xverbose.c create mode 100755 tests-mx32/ipc_msgbuf-Xverbose.gen.test delete mode 100644 tests-mx32/ipc_msgbuf.expected create mode 100644 tests-mx32/ipc_sem-Xabbrev.c create mode 100755 tests-mx32/ipc_sem-Xabbrev.gen.test create mode 100644 tests-mx32/ipc_sem-Xraw.c create mode 100755 tests-mx32/ipc_sem-Xraw.gen.test create mode 100644 tests-mx32/ipc_sem-Xverbose.c create mode 100755 tests-mx32/ipc_sem-Xverbose.gen.test create mode 100755 tests-mx32/ipc_sem.gen.test delete mode 100755 tests-mx32/ipc_sem.test create mode 100644 tests-mx32/ipc_shm-Xabbrev.c create mode 100755 tests-mx32/ipc_shm-Xabbrev.gen.test create mode 100644 tests-mx32/ipc_shm-Xraw.c create mode 100755 tests-mx32/ipc_shm-Xraw.gen.test create mode 100644 tests-mx32/ipc_shm-Xverbose.c create mode 100755 tests-mx32/ipc_shm-Xverbose.gen.test create mode 100755 tests-mx32/ipc_shm.gen.test delete mode 100755 tests-mx32/ipc_shm.test create mode 100644 tests-mx32/is_linux_mips_n64.c create mode 100644 tests-mx32/kcmp-y.c create mode 100755 tests-mx32/kcmp-y.gen.test create mode 100755 tests-mx32/kcmp.gen.test delete mode 100755 tests-mx32/kcmp.test create mode 100755 tests-mx32/kern_features-fault.test create mode 100644 tests-mx32/kern_features.c create mode 100755 tests-mx32/kern_features.gen.test create mode 100644 tests-mx32/kernel_version-Xabbrev.c create mode 100755 tests-mx32/kernel_version-Xabbrev.gen.test create mode 100644 tests-mx32/kernel_version-Xraw.c create mode 100755 tests-mx32/kernel_version-Xraw.gen.test create mode 100644 tests-mx32/kernel_version-Xverbose.c create mode 100755 tests-mx32/kernel_version-Xverbose.gen.test create mode 100644 tests-mx32/kernel_version.c create mode 100755 tests-mx32/kernel_version.gen.test create mode 100755 tests-mx32/kexec_file_load.gen.test delete mode 100755 tests-mx32/kexec_file_load.test create mode 100755 tests-mx32/kexec_load.gen.test delete mode 100755 tests-mx32/kexec_load.test create mode 100644 tests-mx32/keyctl-Xabbrev.c create mode 100755 tests-mx32/keyctl-Xabbrev.gen.test create mode 100644 tests-mx32/keyctl-Xraw.c create mode 100755 tests-mx32/keyctl-Xraw.gen.test create mode 100644 tests-mx32/keyctl-Xverbose.c create mode 100755 tests-mx32/keyctl-Xverbose.gen.test create mode 100755 tests-mx32/keyctl.gen.test delete mode 100755 tests-mx32/keyctl.test create mode 100755 tests-mx32/kill.gen.test delete mode 100755 tests-mx32/kill.test create mode 100644 tests-mx32/kill_child.c create mode 100755 tests-mx32/kill_child.test create mode 100755 tests-mx32/lchown.gen.test delete mode 100755 tests-mx32/lchown.test create mode 100755 tests-mx32/lchown32.gen.test delete mode 100755 tests-mx32/lchown32.test create mode 100755 tests-mx32/link.gen.test delete mode 100755 tests-mx32/link.test create mode 100755 tests-mx32/linkat.gen.test delete mode 100755 tests-mx32/linkat.test create mode 100644 tests-mx32/list_sigaction_signum.c create mode 100644 tests-mx32/localtime.c create mode 100755 tests-mx32/localtime.test create mode 100755 tests-mx32/lookup_dcookie.gen.test delete mode 100755 tests-mx32/lookup_dcookie.test create mode 100644 tests-mx32/looping_threads.c create mode 100755 tests-mx32/looping_threads.test create mode 100755 tests-mx32/lstat.gen.test delete mode 100755 tests-mx32/lstat.test create mode 100755 tests-mx32/lstat64.gen.test delete mode 100755 tests-mx32/lstat64.test create mode 100644 tests-mx32/madvise.c create mode 100755 tests-mx32/madvise.gen.test create mode 100755 tests-mx32/mbind.gen.test delete mode 100755 tests-mx32/mbind.test create mode 100755 tests-mx32/membarrier.gen.test delete mode 100755 tests-mx32/membarrier.test create mode 100644 tests-mx32/memfd_create-Xabbrev.c create mode 100755 tests-mx32/memfd_create-Xabbrev.gen.test create mode 100644 tests-mx32/memfd_create-Xraw.c create mode 100755 tests-mx32/memfd_create-Xraw.gen.test create mode 100644 tests-mx32/memfd_create-Xverbose.c create mode 100755 tests-mx32/memfd_create-Xverbose.gen.test create mode 100755 tests-mx32/memfd_create.gen.test delete mode 100755 tests-mx32/memfd_create.test create mode 100755 tests-mx32/migrate_pages.gen.test delete mode 100755 tests-mx32/migrate_pages.test create mode 100755 tests-mx32/mincore.gen.test delete mode 100755 tests-mx32/mincore.test create mode 100755 tests-mx32/mkdir.gen.test delete mode 100755 tests-mx32/mkdir.test create mode 100755 tests-mx32/mkdirat.gen.test delete mode 100755 tests-mx32/mkdirat.test create mode 100755 tests-mx32/mknod.gen.test delete mode 100755 tests-mx32/mknod.test create mode 100755 tests-mx32/mknodat.gen.test delete mode 100755 tests-mx32/mknodat.test create mode 100755 tests-mx32/mlock.gen.test delete mode 100755 tests-mx32/mlock.test create mode 100755 tests-mx32/mlock2.gen.test delete mode 100755 tests-mx32/mlock2.test create mode 100755 tests-mx32/mlockall.gen.test delete mode 100755 tests-mx32/mlockall.test create mode 100644 tests-mx32/mmap-Xabbrev.c create mode 100755 tests-mx32/mmap-Xabbrev.gen.test create mode 100644 tests-mx32/mmap-Xraw.c create mode 100755 tests-mx32/mmap-Xraw.gen.test create mode 100644 tests-mx32/mmap-Xverbose.c create mode 100755 tests-mx32/mmap-Xverbose.gen.test create mode 100644 tests-mx32/mmap64-Xabbrev.c create mode 100755 tests-mx32/mmap64-Xabbrev.gen.test create mode 100644 tests-mx32/mmap64-Xraw.c create mode 100755 tests-mx32/mmap64-Xraw.gen.test create mode 100644 tests-mx32/mmap64-Xverbose.c create mode 100755 tests-mx32/mmap64-Xverbose.gen.test create mode 100755 tests-mx32/mmap64.gen.test delete mode 100755 tests-mx32/mmap64.test create mode 100755 tests-mx32/mmsg-silent.gen.test delete mode 100755 tests-mx32/mmsg-silent.test create mode 100755 tests-mx32/mmsg.gen.test delete mode 100755 tests-mx32/mmsg.test create mode 100755 tests-mx32/mmsg_name-v.gen.test delete mode 100755 tests-mx32/mmsg_name-v.test create mode 100755 tests-mx32/mmsg_name.gen.test delete mode 100755 tests-mx32/mmsg_name.test create mode 100644 tests-mx32/modify_ldt.c create mode 100755 tests-mx32/modify_ldt.gen.test create mode 100644 tests-mx32/mount-Xabbrev.c create mode 100755 tests-mx32/mount-Xabbrev.gen.test create mode 100644 tests-mx32/mount-Xraw.c create mode 100755 tests-mx32/mount-Xraw.gen.test create mode 100644 tests-mx32/mount-Xverbose.c create mode 100755 tests-mx32/mount-Xverbose.gen.test create mode 100755 tests-mx32/mount.gen.test delete mode 100755 tests-mx32/mount.test create mode 100644 tests-mx32/move_pages-Xabbrev.c create mode 100755 tests-mx32/move_pages-Xabbrev.gen.test create mode 100644 tests-mx32/move_pages-Xraw.c create mode 100755 tests-mx32/move_pages-Xraw.gen.test create mode 100644 tests-mx32/move_pages-Xverbose.c create mode 100755 tests-mx32/move_pages-Xverbose.gen.test create mode 100755 tests-mx32/move_pages.gen.test delete mode 100755 tests-mx32/move_pages.test create mode 100755 tests-mx32/mq.gen.test delete mode 100755 tests-mx32/mq.test create mode 100755 tests-mx32/mq_sendrecv-read.gen.test delete mode 100755 tests-mx32/mq_sendrecv-read.test create mode 100755 tests-mx32/mq_sendrecv-write.gen.test delete mode 100755 tests-mx32/mq_sendrecv-write.test create mode 100755 tests-mx32/mq_sendrecv.gen.test delete mode 100755 tests-mx32/mq_sendrecv.test create mode 100755 tests-mx32/msg_control-v.gen.test delete mode 100755 tests-mx32/msg_control-v.test create mode 100755 tests-mx32/msg_control.gen.test delete mode 100755 tests-mx32/msg_control.test create mode 100755 tests-mx32/msg_name.gen.test delete mode 100755 tests-mx32/msg_name.test create mode 100755 tests-mx32/munlockall.gen.test delete mode 100755 tests-mx32/munlockall.test create mode 100755 tests-mx32/nanosleep.gen.test delete mode 100755 tests-mx32/nanosleep.test create mode 100755 tests-mx32/net-icmp_filter.gen.test delete mode 100755 tests-mx32/net-icmp_filter.test create mode 100644 tests-mx32/net-packet_mreq-Xabbrev.c create mode 100755 tests-mx32/net-packet_mreq-Xabbrev.gen.test create mode 100644 tests-mx32/net-packet_mreq-Xraw.c create mode 100755 tests-mx32/net-packet_mreq-Xraw.gen.test create mode 100644 tests-mx32/net-packet_mreq-Xverbose.c create mode 100755 tests-mx32/net-packet_mreq-Xverbose.gen.test create mode 100644 tests-mx32/net-packet_mreq.c create mode 100755 tests-mx32/net-packet_mreq.gen.test create mode 100755 tests-mx32/net-sockaddr.gen.test delete mode 100755 tests-mx32/net-sockaddr.test create mode 100644 tests-mx32/net-tpacket_req.c create mode 100755 tests-mx32/net-tpacket_req.gen.test create mode 100644 tests-mx32/net-tpacket_stats-success.c create mode 100755 tests-mx32/net-tpacket_stats-success.test create mode 100644 tests-mx32/net-tpacket_stats.c create mode 100755 tests-mx32/net-tpacket_stats.gen.test create mode 100644 tests-mx32/net-yy-inet6.c create mode 100755 tests-mx32/net-yy-inet6.gen.test create mode 100644 tests-mx32/netlink_audit.c create mode 100755 tests-mx32/netlink_audit.gen.test create mode 100644 tests-mx32/netlink_crypto.c create mode 100755 tests-mx32/netlink_crypto.gen.test create mode 100644 tests-mx32/netlink_generic.c create mode 100755 tests-mx32/netlink_generic.gen.test create mode 100644 tests-mx32/netlink_kobject_uevent.c create mode 100755 tests-mx32/netlink_kobject_uevent.gen.test create mode 100644 tests-mx32/netlink_netfilter.c create mode 100755 tests-mx32/netlink_netfilter.gen.test create mode 100755 tests-mx32/netlink_protocol.gen.test delete mode 100755 tests-mx32/netlink_protocol.test create mode 100644 tests-mx32/netlink_route.c create mode 100755 tests-mx32/netlink_route.gen.test create mode 100644 tests-mx32/netlink_selinux.c create mode 100755 tests-mx32/netlink_selinux.gen.test create mode 100755 tests-mx32/netlink_sock_diag-v.sh create mode 100644 tests-mx32/netlink_sock_diag.c create mode 100755 tests-mx32/netlink_sock_diag.test create mode 100644 tests-mx32/netlink_xfrm.c create mode 100755 tests-mx32/netlink_xfrm.gen.test create mode 100755 tests-mx32/newfstatat.gen.test delete mode 100755 tests-mx32/newfstatat.test create mode 100644 tests-mx32/nfnetlink_acct.c create mode 100755 tests-mx32/nfnetlink_acct.gen.test create mode 100644 tests-mx32/nfnetlink_cthelper.c create mode 100755 tests-mx32/nfnetlink_cthelper.gen.test create mode 100644 tests-mx32/nfnetlink_ctnetlink.c create mode 100755 tests-mx32/nfnetlink_ctnetlink.gen.test create mode 100644 tests-mx32/nfnetlink_ctnetlink_exp.c create mode 100755 tests-mx32/nfnetlink_ctnetlink_exp.gen.test create mode 100644 tests-mx32/nfnetlink_cttimeout.c create mode 100755 tests-mx32/nfnetlink_cttimeout.gen.test create mode 100644 tests-mx32/nfnetlink_ipset.c create mode 100755 tests-mx32/nfnetlink_ipset.gen.test create mode 100644 tests-mx32/nfnetlink_nft_compat.c create mode 100755 tests-mx32/nfnetlink_nft_compat.gen.test create mode 100644 tests-mx32/nfnetlink_nftables.c create mode 100755 tests-mx32/nfnetlink_nftables.gen.test create mode 100644 tests-mx32/nfnetlink_osf.c create mode 100755 tests-mx32/nfnetlink_osf.gen.test create mode 100644 tests-mx32/nfnetlink_queue.c create mode 100755 tests-mx32/nfnetlink_queue.gen.test create mode 100644 tests-mx32/nfnetlink_ulog.c create mode 100755 tests-mx32/nfnetlink_ulog.gen.test create mode 100644 tests-mx32/nlattr.c create mode 100755 tests-mx32/nlattr.gen.test create mode 100644 tests-mx32/nlattr_br_port_msg.c create mode 100755 tests-mx32/nlattr_br_port_msg.gen.test create mode 100644 tests-mx32/nlattr_crypto_user_alg.c create mode 100755 tests-mx32/nlattr_crypto_user_alg.gen.test create mode 100644 tests-mx32/nlattr_dcbmsg.c create mode 100755 tests-mx32/nlattr_dcbmsg.gen.test create mode 100644 tests-mx32/nlattr_fib_rule_hdr.c create mode 100755 tests-mx32/nlattr_fib_rule_hdr.gen.test create mode 100644 tests-mx32/nlattr_ifaddrlblmsg.c create mode 100755 tests-mx32/nlattr_ifaddrlblmsg.gen.test create mode 100644 tests-mx32/nlattr_ifaddrmsg.c create mode 100755 tests-mx32/nlattr_ifaddrmsg.gen.test create mode 100644 tests-mx32/nlattr_ifinfomsg.c create mode 100755 tests-mx32/nlattr_ifinfomsg.gen.test create mode 100644 tests-mx32/nlattr_ifla.h create mode 100644 tests-mx32/nlattr_ifla_af_spec.c create mode 100755 tests-mx32/nlattr_ifla_af_spec.gen.test create mode 100644 tests-mx32/nlattr_ifla_brport.c create mode 100755 tests-mx32/nlattr_ifla_brport.gen.test create mode 100644 tests-mx32/nlattr_ifla_linkinfo.c create mode 100755 tests-mx32/nlattr_ifla_linkinfo.gen.test create mode 100644 tests-mx32/nlattr_ifla_port.c create mode 100755 tests-mx32/nlattr_ifla_port.gen.test create mode 100644 tests-mx32/nlattr_ifla_xdp.c create mode 100755 tests-mx32/nlattr_ifla_xdp.gen.test create mode 100644 tests-mx32/nlattr_inet_diag_msg.c create mode 100755 tests-mx32/nlattr_inet_diag_msg.gen.test create mode 100644 tests-mx32/nlattr_inet_diag_req_compat.c create mode 100755 tests-mx32/nlattr_inet_diag_req_compat.gen.test create mode 100644 tests-mx32/nlattr_inet_diag_req_v2.c create mode 100755 tests-mx32/nlattr_inet_diag_req_v2.gen.test create mode 100644 tests-mx32/nlattr_mdba_mdb_entry.c create mode 100755 tests-mx32/nlattr_mdba_mdb_entry.gen.test create mode 100644 tests-mx32/nlattr_mdba_router_port.c create mode 100755 tests-mx32/nlattr_mdba_router_port.gen.test create mode 100644 tests-mx32/nlattr_ndmsg.c create mode 100755 tests-mx32/nlattr_ndmsg.gen.test create mode 100644 tests-mx32/nlattr_ndtmsg.c create mode 100755 tests-mx32/nlattr_ndtmsg.gen.test create mode 100644 tests-mx32/nlattr_netconfmsg.c create mode 100755 tests-mx32/nlattr_netconfmsg.gen.test create mode 100644 tests-mx32/nlattr_netlink_diag_msg.c create mode 100755 tests-mx32/nlattr_netlink_diag_msg.gen.test create mode 100644 tests-mx32/nlattr_nlmsgerr.c create mode 100755 tests-mx32/nlattr_nlmsgerr.gen.test create mode 100644 tests-mx32/nlattr_packet_diag_msg.c create mode 100755 tests-mx32/nlattr_packet_diag_msg.gen.test create mode 100644 tests-mx32/nlattr_rtgenmsg.c create mode 100755 tests-mx32/nlattr_rtgenmsg.gen.test create mode 100644 tests-mx32/nlattr_rtmsg.c create mode 100755 tests-mx32/nlattr_rtmsg.gen.test create mode 100644 tests-mx32/nlattr_smc_diag_msg.c create mode 100755 tests-mx32/nlattr_smc_diag_msg.gen.test create mode 100644 tests-mx32/nlattr_tc_stats.c create mode 100755 tests-mx32/nlattr_tc_stats.gen.test create mode 100644 tests-mx32/nlattr_tca_stab.c create mode 100755 tests-mx32/nlattr_tca_stab.gen.test create mode 100644 tests-mx32/nlattr_tcamsg.c create mode 100755 tests-mx32/nlattr_tcamsg.gen.test create mode 100644 tests-mx32/nlattr_tcmsg.c create mode 100755 tests-mx32/nlattr_tcmsg.gen.test create mode 100644 tests-mx32/nlattr_unix_diag_msg.c create mode 100755 tests-mx32/nlattr_unix_diag_msg.gen.test create mode 100644 tests-mx32/nsyscalls-d.c create mode 100755 tests-mx32/nsyscalls-d.test create mode 100755 tests-mx32/nsyscalls-nd.test create mode 100644 tests-mx32/old_mmap-P.c create mode 100755 tests-mx32/old_mmap-P.gen.test create mode 100644 tests-mx32/old_mmap-Xabbrev.c create mode 100755 tests-mx32/old_mmap-Xabbrev.gen.test create mode 100644 tests-mx32/old_mmap-Xraw.c create mode 100755 tests-mx32/old_mmap-Xraw.gen.test create mode 100644 tests-mx32/old_mmap-Xverbose.c create mode 100755 tests-mx32/old_mmap-Xverbose.gen.test create mode 100644 tests-mx32/old_mmap-v-none.c create mode 100755 tests-mx32/old_mmap-v-none.gen.test create mode 100755 tests-mx32/old_mmap.gen.test delete mode 100755 tests-mx32/old_mmap.test create mode 100755 tests-mx32/oldfstat.gen.test delete mode 100755 tests-mx32/oldfstat.test create mode 100755 tests-mx32/oldlstat.gen.test delete mode 100755 tests-mx32/oldlstat.test create mode 100644 tests-mx32/oldselect-P.c create mode 100755 tests-mx32/oldselect-P.gen.test create mode 100644 tests-mx32/oldselect-efault-P.c create mode 100755 tests-mx32/oldselect-efault-P.gen.test create mode 100644 tests-mx32/oldselect-efault.c create mode 100755 tests-mx32/oldselect-efault.gen.test delete mode 100644 tests-mx32/oldselect.expected create mode 100755 tests-mx32/oldselect.gen.test delete mode 100755 tests-mx32/oldselect.test create mode 100755 tests-mx32/oldstat.gen.test delete mode 100755 tests-mx32/oldstat.test create mode 100755 tests-mx32/open.gen.test delete mode 100755 tests-mx32/open.test create mode 100755 tests-mx32/openat.gen.test delete mode 100755 tests-mx32/openat.test create mode 100644 tests-mx32/orphaned_process_group.c create mode 100755 tests-mx32/orphaned_process_group.gen.test create mode 100644 tests-mx32/osf_utimes.c create mode 100755 tests-mx32/osf_utimes.gen.test create mode 100755 tests-mx32/pause.gen.test delete mode 100755 tests-mx32/pause.test create mode 100755 tests-mx32/perf_event_open.gen.test delete mode 100755 tests-mx32/perf_event_open.test create mode 100755 tests-mx32/perf_event_open_nonverbose.gen.test delete mode 100755 tests-mx32/perf_event_open_nonverbose.test create mode 100755 tests-mx32/perf_event_open_unabbrev.gen.test delete mode 100755 tests-mx32/perf_event_open_unabbrev.test create mode 100644 tests-mx32/personality-Xabbrev.c create mode 100755 tests-mx32/personality-Xabbrev.gen.test create mode 100644 tests-mx32/personality-Xraw.c create mode 100755 tests-mx32/personality-Xraw.gen.test create mode 100644 tests-mx32/personality-Xverbose.c create mode 100755 tests-mx32/personality-Xverbose.gen.test create mode 100644 tests-mx32/pidfd_send_signal.c create mode 100755 tests-mx32/pidfd_send_signal.gen.test create mode 100755 tests-mx32/pipe2.gen.test delete mode 100755 tests-mx32/pipe2.test create mode 100755 tests-mx32/pkey_alloc.gen.test delete mode 100755 tests-mx32/pkey_alloc.test create mode 100755 tests-mx32/pkey_free.gen.test delete mode 100755 tests-mx32/pkey_free.test create mode 100755 tests-mx32/pkey_mprotect.gen.test delete mode 100755 tests-mx32/pkey_mprotect.test create mode 100644 tests-mx32/poll-P.c create mode 100755 tests-mx32/poll-P.test create mode 100644 tests-mx32/ppoll-P.c create mode 100755 tests-mx32/ppoll-P.gen.test create mode 100644 tests-mx32/ppoll-v.c delete mode 100644 tests-mx32/ppoll-v.expected create mode 100755 tests-mx32/ppoll-v.gen.test delete mode 100644 tests-mx32/ppoll.expected create mode 100755 tests-mx32/ppoll.gen.test delete mode 100755 tests-mx32/ppoll.test create mode 100644 tests-mx32/prctl-spec-inject.c create mode 100755 tests-mx32/prctl-spec-inject.test create mode 100755 tests-mx32/pread64-pwrite64.gen.test delete mode 100755 tests-mx32/pread64-pwrite64.test create mode 100755 tests-mx32/preadv-pwritev.gen.test delete mode 100755 tests-mx32/preadv-pwritev.test create mode 100755 tests-mx32/preadv.gen.test delete mode 100755 tests-mx32/preadv.test create mode 100755 tests-mx32/preadv2-pwritev2.gen.test delete mode 100755 tests-mx32/preadv2-pwritev2.test create mode 100644 tests-mx32/print_time.c create mode 100644 tests-mx32/print_user_desc.c create mode 100755 tests-mx32/printpath-umovestr-legacy.test create mode 100644 tests-mx32/printpath-umovestr-peekdata.c create mode 100755 tests-mx32/printpath-umovestr-peekdata.gen.test create mode 100644 tests-mx32/printpath-umovestr-undumpable.c create mode 100755 tests-mx32/printpath-umovestr-undumpable.gen.test create mode 100644 tests-mx32/printpath-umovestr.c create mode 100755 tests-mx32/printpath-umovestr.gen.test create mode 100644 tests-mx32/printsignal-Xabbrev.c create mode 100755 tests-mx32/printsignal-Xabbrev.gen.test create mode 100644 tests-mx32/printsignal-Xraw.c create mode 100755 tests-mx32/printsignal-Xraw.gen.test create mode 100644 tests-mx32/printsignal-Xverbose.c create mode 100755 tests-mx32/printsignal-Xverbose.gen.test create mode 100644 tests-mx32/printsignal.c create mode 100755 tests-mx32/printstr.gen.test delete mode 100755 tests-mx32/printstr.test create mode 100755 tests-mx32/printstrn-umoven-legacy.test create mode 100644 tests-mx32/printstrn-umoven-peekdata.c create mode 100755 tests-mx32/printstrn-umoven-peekdata.gen.test create mode 100644 tests-mx32/printstrn-umoven-undumpable.c create mode 100755 tests-mx32/printstrn-umoven-undumpable.gen.test create mode 100644 tests-mx32/printstrn-umoven.c create mode 100755 tests-mx32/printstrn-umoven.gen.test create mode 100755 tests-mx32/prlimit64.gen.test delete mode 100755 tests-mx32/prlimit64.test create mode 100755 tests-mx32/process_vm_readv.gen.test delete mode 100755 tests-mx32/process_vm_readv.test create mode 100755 tests-mx32/process_vm_writev.gen.test delete mode 100755 tests-mx32/process_vm_writev.test create mode 100755 tests-mx32/pselect6.gen.test delete mode 100755 tests-mx32/pselect6.test create mode 100755 tests-mx32/ptrace.gen.test delete mode 100755 tests-mx32/ptrace.test create mode 100644 tests-mx32/ptrace_syscall_info.c create mode 100755 tests-mx32/ptrace_syscall_info.gen.test create mode 100644 tests-mx32/pure_executables.am create mode 100755 tests-mx32/pure_executables.list create mode 100755 tests-mx32/pwritev.gen.test delete mode 100755 tests-mx32/pwritev.test create mode 100755 tests-mx32/qual_fault-syscall.test create mode 100755 tests-mx32/qual_inject-error-signal-syscall.test create mode 100755 tests-mx32/qual_inject-retval-syscall.test create mode 100755 tests-mx32/qual_inject-signal-syscall.test create mode 100644 tests-mx32/qualify_personality.sh create mode 100644 tests-mx32/qualify_personality_empty.in create mode 100644 tests-mx32/quotactl-Xabbrev.c create mode 100755 tests-mx32/quotactl-Xabbrev.gen.test create mode 100644 tests-mx32/quotactl-Xraw.c create mode 100755 tests-mx32/quotactl-Xraw.gen.test create mode 100644 tests-mx32/quotactl-Xverbose.c create mode 100755 tests-mx32/quotactl-Xverbose.gen.test create mode 100644 tests-mx32/quotactl-success-v.c create mode 100755 tests-mx32/quotactl-success-v.test create mode 100644 tests-mx32/quotactl-success.c create mode 100755 tests-mx32/quotactl-success.test create mode 100755 tests-mx32/quotactl-v.gen.test delete mode 100755 tests-mx32/quotactl-v.test create mode 100644 tests-mx32/quotactl-xfs-success-v.c create mode 100755 tests-mx32/quotactl-xfs-success-v.test create mode 100644 tests-mx32/quotactl-xfs-success.c create mode 100755 tests-mx32/quotactl-xfs-success.test create mode 100755 tests-mx32/quotactl-xfs-v.gen.test delete mode 100755 tests-mx32/quotactl-xfs-v.test create mode 100755 tests-mx32/quotactl-xfs.gen.test delete mode 100755 tests-mx32/quotactl-xfs.test create mode 100755 tests-mx32/quotactl.gen.test delete mode 100755 tests-mx32/quotactl.test create mode 100755 tests-mx32/read-write.gen.test delete mode 100755 tests-mx32/read-write.test create mode 100755 tests-mx32/readahead.gen.test delete mode 100755 tests-mx32/readahead.test create mode 100755 tests-mx32/readdir.gen.test delete mode 100755 tests-mx32/readdir.test create mode 100755 tests-mx32/readlink.gen.test delete mode 100755 tests-mx32/readlink.test create mode 100755 tests-mx32/readlinkat.gen.test delete mode 100755 tests-mx32/readlinkat.test create mode 100755 tests-mx32/reboot.gen.test delete mode 100755 tests-mx32/reboot.test create mode 100755 tests-mx32/recvfrom.gen.test delete mode 100755 tests-mx32/recvfrom.test create mode 100755 tests-mx32/recvmmsg-timeout.gen.test delete mode 100755 tests-mx32/recvmmsg-timeout.test create mode 100755 tests-mx32/recvmsg.gen.test delete mode 100755 tests-mx32/recvmsg.test create mode 100755 tests-mx32/regex.gen.test create mode 100755 tests-mx32/regex.in create mode 100644 tests-mx32/remap_file_pages-Xabbrev.c create mode 100755 tests-mx32/remap_file_pages-Xabbrev.gen.test create mode 100644 tests-mx32/remap_file_pages-Xraw.c create mode 100755 tests-mx32/remap_file_pages-Xraw.gen.test create mode 100644 tests-mx32/remap_file_pages-Xverbose.c create mode 100755 tests-mx32/remap_file_pages-Xverbose.gen.test create mode 100755 tests-mx32/remap_file_pages.gen.test delete mode 100755 tests-mx32/remap_file_pages.test create mode 100755 tests-mx32/rename.gen.test delete mode 100755 tests-mx32/rename.test create mode 100755 tests-mx32/renameat.gen.test delete mode 100755 tests-mx32/renameat.test create mode 100755 tests-mx32/renameat2.gen.test delete mode 100755 tests-mx32/renameat2.test create mode 100755 tests-mx32/request_key.gen.test delete mode 100755 tests-mx32/request_key.test create mode 100644 tests-mx32/riscv_flush_icache.c create mode 100755 tests-mx32/riscv_flush_icache.gen.test create mode 100755 tests-mx32/rmdir.gen.test delete mode 100755 tests-mx32/rmdir.test create mode 100644 tests-mx32/rt_sigaction.awk create mode 100644 tests-mx32/rt_sigaction.c create mode 100755 tests-mx32/rt_sigaction.test create mode 100755 tests-mx32/rt_sigpending.gen.test delete mode 100755 tests-mx32/rt_sigpending.test create mode 100755 tests-mx32/rt_sigprocmask.gen.test delete mode 100755 tests-mx32/rt_sigprocmask.test create mode 100755 tests-mx32/rt_sigqueueinfo.gen.test delete mode 100755 tests-mx32/rt_sigqueueinfo.test create mode 100644 tests-mx32/rt_sigreturn.c create mode 100755 tests-mx32/rt_sigreturn.gen.test create mode 100755 tests-mx32/rt_sigsuspend.gen.test delete mode 100755 tests-mx32/rt_sigsuspend.test create mode 100755 tests-mx32/rt_sigtimedwait.gen.test delete mode 100755 tests-mx32/rt_sigtimedwait.test create mode 100755 tests-mx32/rt_tgsigqueueinfo.gen.test delete mode 100755 tests-mx32/rt_tgsigqueueinfo.test create mode 100644 tests-mx32/run_expect_termsig.c create mode 100644 tests-mx32/s390_guarded_storage-v.c create mode 100755 tests-mx32/s390_guarded_storage-v.gen.test create mode 100644 tests-mx32/s390_guarded_storage.c create mode 100755 tests-mx32/s390_guarded_storage.gen.test create mode 100644 tests-mx32/s390_pci_mmio_read_write.c create mode 100755 tests-mx32/s390_pci_mmio_read_write.gen.test create mode 100644 tests-mx32/s390_runtime_instr.c create mode 100755 tests-mx32/s390_runtime_instr.gen.test create mode 100644 tests-mx32/s390_sthyi-v.c create mode 100755 tests-mx32/s390_sthyi-v.gen.test create mode 100644 tests-mx32/s390_sthyi.c create mode 100755 tests-mx32/s390_sthyi.gen.test create mode 100755 tests-mx32/sched.gen.test create mode 100755 tests-mx32/sched.in create mode 100755 tests-mx32/sched_get_priority_mxx.gen.test delete mode 100755 tests-mx32/sched_get_priority_mxx.test create mode 100755 tests-mx32/sched_rr_get_interval.gen.test delete mode 100755 tests-mx32/sched_rr_get_interval.test create mode 100755 tests-mx32/sched_xetaffinity.gen.test delete mode 100755 tests-mx32/sched_xetaffinity.test create mode 100755 tests-mx32/sched_xetattr.gen.test delete mode 100755 tests-mx32/sched_xetattr.test create mode 100755 tests-mx32/sched_xetparam.gen.test delete mode 100755 tests-mx32/sched_xetparam.test create mode 100755 tests-mx32/sched_xetscheduler.gen.test delete mode 100755 tests-mx32/sched_xetscheduler.test create mode 100755 tests-mx32/sched_yield.gen.test delete mode 100755 tests-mx32/sched_yield.test create mode 100755 tests-mx32/seccomp-filter-v.gen.test delete mode 100755 tests-mx32/seccomp-filter-v.test create mode 100755 tests-mx32/seccomp-filter.gen.test delete mode 100755 tests-mx32/seccomp-filter.test create mode 100644 tests-mx32/seccomp_get_action_avail.c create mode 100755 tests-mx32/seccomp_get_action_avail.gen.test create mode 100644 tests-mx32/select-P.c create mode 100755 tests-mx32/select-P.gen.test create mode 100755 tests-mx32/select.gen.test delete mode 100755 tests-mx32/select.test create mode 100755 tests-mx32/semop.gen.test delete mode 100755 tests-mx32/semop.test create mode 100755 tests-mx32/sendfile.gen.test delete mode 100755 tests-mx32/sendfile.test create mode 100755 tests-mx32/sendfile64.gen.test delete mode 100755 tests-mx32/sendfile64.test create mode 100755 tests-mx32/set_mempolicy.gen.test delete mode 100755 tests-mx32/set_mempolicy.test create mode 100644 tests-mx32/set_sigblock.c create mode 100644 tests-mx32/set_sigign.c create mode 100755 tests-mx32/setdomainname.gen.test delete mode 100755 tests-mx32/setdomainname.test create mode 100755 tests-mx32/setfsgid.gen.test delete mode 100755 tests-mx32/setfsgid.test create mode 100755 tests-mx32/setfsgid32.gen.test delete mode 100755 tests-mx32/setfsgid32.test create mode 100755 tests-mx32/setfsuid.gen.test delete mode 100755 tests-mx32/setfsuid.test create mode 100755 tests-mx32/setfsuid32.gen.test delete mode 100755 tests-mx32/setfsuid32.test create mode 100755 tests-mx32/setgid.gen.test delete mode 100755 tests-mx32/setgid.test create mode 100755 tests-mx32/setgid32.gen.test delete mode 100755 tests-mx32/setgid32.test create mode 100755 tests-mx32/setgroups.gen.test delete mode 100755 tests-mx32/setgroups.test create mode 100755 tests-mx32/setgroups32.gen.test delete mode 100755 tests-mx32/setgroups32.test create mode 100755 tests-mx32/sethostname.gen.test delete mode 100755 tests-mx32/sethostname.test create mode 100755 tests-mx32/setns.gen.test delete mode 100755 tests-mx32/setns.test create mode 100755 tests-mx32/setregid.gen.test delete mode 100755 tests-mx32/setregid.test create mode 100755 tests-mx32/setregid32.gen.test delete mode 100755 tests-mx32/setregid32.test create mode 100755 tests-mx32/setresgid.gen.test delete mode 100755 tests-mx32/setresgid.test create mode 100755 tests-mx32/setresgid32.gen.test delete mode 100755 tests-mx32/setresgid32.test create mode 100755 tests-mx32/setresuid.gen.test delete mode 100755 tests-mx32/setresuid.test create mode 100755 tests-mx32/setresuid32.gen.test delete mode 100755 tests-mx32/setresuid32.test create mode 100755 tests-mx32/setreuid.gen.test delete mode 100755 tests-mx32/setreuid.test create mode 100755 tests-mx32/setreuid32.gen.test delete mode 100755 tests-mx32/setreuid32.test create mode 100644 tests-mx32/setrlimit-Xabbrev.c create mode 100755 tests-mx32/setrlimit-Xabbrev.gen.test create mode 100644 tests-mx32/setrlimit-Xraw.c create mode 100755 tests-mx32/setrlimit-Xraw.gen.test create mode 100644 tests-mx32/setrlimit-Xverbose.c create mode 100755 tests-mx32/setrlimit-Xverbose.gen.test create mode 100755 tests-mx32/setrlimit.gen.test delete mode 100755 tests-mx32/setrlimit.test create mode 100755 tests-mx32/setuid.gen.test delete mode 100755 tests-mx32/setuid.test create mode 100755 tests-mx32/setuid32.gen.test delete mode 100755 tests-mx32/setuid32.test create mode 100755 tests-mx32/shmxt.gen.test delete mode 100755 tests-mx32/shmxt.test create mode 100755 tests-mx32/shutdown.gen.test delete mode 100755 tests-mx32/shutdown.test delete mode 100644 tests-mx32/sigaction.awk create mode 100755 tests-mx32/sigaction.gen.test delete mode 100755 tests-mx32/sigaction.test create mode 100755 tests-mx32/sigblock.test create mode 100755 tests-mx32/sigign.test create mode 100755 tests-mx32/siginfo.gen.test delete mode 100755 tests-mx32/siginfo.test create mode 100644 tests-mx32/signal.c create mode 100755 tests-mx32/signal.gen.test create mode 100755 tests-mx32/signal_receive.gen.test delete mode 100755 tests-mx32/signal_receive.test create mode 100755 tests-mx32/signalfd4.gen.test delete mode 100755 tests-mx32/signalfd4.test create mode 100644 tests-mx32/sigpending.c create mode 100755 tests-mx32/sigpending.gen.test create mode 100644 tests-mx32/sigprocmask.c create mode 100755 tests-mx32/sigprocmask.gen.test create mode 100755 tests-mx32/sigreturn.gen.test delete mode 100755 tests-mx32/sigreturn.test create mode 100644 tests-mx32/sigsuspend.c create mode 100755 tests-mx32/sigsuspend.gen.test create mode 100644 tests-mx32/skip_unavailable.c create mode 100644 tests-mx32/so_error.c create mode 100755 tests-mx32/so_error.gen.test create mode 100644 tests-mx32/so_linger.c create mode 100755 tests-mx32/so_linger.gen.test create mode 100644 tests-mx32/so_peercred-Xabbrev.c create mode 100755 tests-mx32/so_peercred-Xabbrev.gen.test create mode 100644 tests-mx32/so_peercred-Xraw.c create mode 100755 tests-mx32/so_peercred-Xraw.gen.test create mode 100644 tests-mx32/so_peercred-Xverbose.c create mode 100755 tests-mx32/so_peercred-Xverbose.gen.test create mode 100644 tests-mx32/so_peercred.c create mode 100755 tests-mx32/so_peercred.gen.test create mode 100644 tests-mx32/sock_filter-v-Xabbrev.c create mode 100755 tests-mx32/sock_filter-v-Xabbrev.gen.test create mode 100644 tests-mx32/sock_filter-v-Xraw.c create mode 100755 tests-mx32/sock_filter-v-Xraw.gen.test create mode 100644 tests-mx32/sock_filter-v-Xverbose.c create mode 100755 tests-mx32/sock_filter-v-Xverbose.gen.test create mode 100644 tests-mx32/sock_filter-v.c create mode 100755 tests-mx32/sock_filter-v.gen.test create mode 100644 tests-mx32/sockaddr_xlat-Xabbrev.c create mode 100755 tests-mx32/sockaddr_xlat-Xabbrev.gen.test create mode 100644 tests-mx32/sockaddr_xlat-Xraw.c create mode 100755 tests-mx32/sockaddr_xlat-Xraw.gen.test create mode 100644 tests-mx32/sockaddr_xlat-Xverbose.c create mode 100755 tests-mx32/sockaddr_xlat-Xverbose.gen.test create mode 100644 tests-mx32/sockaddr_xlat.c create mode 100755 tests-mx32/socketcall.gen.test delete mode 100755 tests-mx32/socketcall.test create mode 100644 tests-mx32/sockopt-sol_netlink.c create mode 100755 tests-mx32/sockopt-sol_netlink.gen.test create mode 100644 tests-mx32/sockopt-timestamp.c create mode 100755 tests-mx32/sockopt-timestamp.gen.test create mode 100755 tests-mx32/splice.gen.test delete mode 100755 tests-mx32/splice.test create mode 100644 tests-mx32/stack-fcall-mangled-0.c create mode 100644 tests-mx32/stack-fcall-mangled-1.c create mode 100644 tests-mx32/stack-fcall-mangled-2.c create mode 100644 tests-mx32/stack-fcall-mangled-3.c create mode 100644 tests-mx32/stack-fcall-mangled.c create mode 100644 tests-mx32/stack-fcall.h create mode 100755 tests-mx32/stat.gen.test delete mode 100755 tests-mx32/stat.test create mode 100755 tests-mx32/stat64.gen.test delete mode 100755 tests-mx32/stat64.test delete mode 100644 tests-mx32/statfs.expected create mode 100755 tests-mx32/statfs.gen.test delete mode 100755 tests-mx32/statfs.test create mode 100755 tests-mx32/statfs64.gen.test delete mode 100755 tests-mx32/statfs64.test create mode 100644 tests-mx32/statx.c create mode 100755 tests-mx32/statx.gen.test delete mode 100755 tests-mx32/statx.sh create mode 100644 tests-mx32/strace-k-demangle.expected create mode 100755 tests-mx32/strace-k-demangle.test create mode 100644 tests-mx32/strace-k.expected create mode 100755 tests-mx32/strace-log-merge-error.test create mode 100755 tests-mx32/strace-log-merge-suffix.test delete mode 100644 tests-mx32/struct_flock.c create mode 100755 tests-mx32/swap.gen.test delete mode 100755 tests-mx32/swap.test create mode 100644 tests-mx32/sxetmask.c create mode 100755 tests-mx32/sxetmask.gen.test create mode 100755 tests-mx32/symlink.gen.test delete mode 100755 tests-mx32/symlink.test create mode 100755 tests-mx32/symlinkat.gen.test delete mode 100755 tests-mx32/symlinkat.test create mode 100755 tests-mx32/sync.gen.test delete mode 100755 tests-mx32/sync.test create mode 100755 tests-mx32/sync_file_range.gen.test delete mode 100755 tests-mx32/sync_file_range.test create mode 100755 tests-mx32/sync_file_range2.gen.test delete mode 100755 tests-mx32/sync_file_range2.test create mode 100644 tests-mx32/syntax.sh create mode 100755 tests-mx32/sysinfo.gen.test delete mode 100755 tests-mx32/sysinfo.test create mode 100755 tests-mx32/syslog.gen.test delete mode 100755 tests-mx32/syslog.test create mode 100755 tests-mx32/tee.gen.test delete mode 100755 tests-mx32/tee.test create mode 100755 tests-mx32/termsig.test create mode 100644 tests-mx32/test_netlink.h create mode 100644 tests-mx32/test_nlattr.h create mode 100644 tests-mx32/test_printpath.c create mode 100644 tests-mx32/test_printstrn.c create mode 100644 tests-mx32/test_ucopy.c create mode 100644 tests-mx32/test_ucopy.h create mode 100755 tests-mx32/time.gen.test delete mode 100755 tests-mx32/time.test create mode 100755 tests-mx32/timer_create.gen.test delete mode 100755 tests-mx32/timer_create.test create mode 100755 tests-mx32/timer_xettime.gen.test delete mode 100755 tests-mx32/timer_xettime.test create mode 100755 tests-mx32/timerfd_xettime.gen.test delete mode 100755 tests-mx32/timerfd_xettime.test create mode 100755 tests-mx32/times-fail.gen.test delete mode 100755 tests-mx32/times-fail.test create mode 100755 tests-mx32/times.gen.test delete mode 100755 tests-mx32/times.test create mode 100755 tests-mx32/trace_fstat.gen.test create mode 100644 tests-mx32/trace_fstat.in create mode 100755 tests-mx32/trace_fstatfs.gen.test create mode 100644 tests-mx32/trace_fstatfs.in create mode 100755 tests-mx32/trace_lstat.gen.test create mode 100644 tests-mx32/trace_lstat.in create mode 100755 tests-mx32/trace_personality_32.gen.test create mode 100644 tests-mx32/trace_personality_32.in create mode 100755 tests-mx32/trace_personality_64.gen.test create mode 100644 tests-mx32/trace_personality_64.in create mode 100755 tests-mx32/trace_personality_regex_32.gen.test create mode 100755 tests-mx32/trace_personality_regex_32.in create mode 100755 tests-mx32/trace_personality_regex_64.gen.test create mode 100755 tests-mx32/trace_personality_regex_64.in create mode 100755 tests-mx32/trace_personality_regex_x32.gen.test create mode 100755 tests-mx32/trace_personality_regex_x32.in create mode 100755 tests-mx32/trace_personality_x32.gen.test create mode 100644 tests-mx32/trace_personality_x32.in create mode 100755 tests-mx32/trace_question.gen.test create mode 100644 tests-mx32/trace_question.in create mode 100755 tests-mx32/trace_stat.gen.test create mode 100644 tests-mx32/trace_stat.in create mode 100755 tests-mx32/trace_stat_like.gen.test create mode 100644 tests-mx32/trace_stat_like.in create mode 100755 tests-mx32/trace_statfs.gen.test create mode 100644 tests-mx32/trace_statfs.in create mode 100755 tests-mx32/trace_statfs_like.gen.test create mode 100644 tests-mx32/trace_statfs_like.in create mode 100755 tests-mx32/truncate.gen.test delete mode 100755 tests-mx32/truncate.test create mode 100755 tests-mx32/truncate64.gen.test delete mode 100755 tests-mx32/truncate64.test create mode 100755 tests-mx32/ugetrlimit.gen.test delete mode 100755 tests-mx32/ugetrlimit.test create mode 100755 tests-mx32/umask.gen.test delete mode 100755 tests-mx32/umask.test create mode 100755 tests-mx32/umoven-illptr.gen.test delete mode 100755 tests-mx32/umoven-illptr.test create mode 100755 tests-mx32/umovestr-illptr.gen.test delete mode 100755 tests-mx32/umovestr-illptr.test create mode 100755 tests-mx32/umovestr3.gen.test delete mode 100755 tests-mx32/umovestr3.test create mode 100644 tests-mx32/unblock_reset_raise.c create mode 100755 tests-mx32/unlink.gen.test delete mode 100755 tests-mx32/unlink.test create mode 100755 tests-mx32/unlinkat.gen.test delete mode 100755 tests-mx32/unlinkat.test create mode 100755 tests-mx32/unshare.gen.test delete mode 100755 tests-mx32/unshare.test create mode 100755 tests-mx32/userfaultfd.gen.test delete mode 100755 tests-mx32/userfaultfd.test create mode 100755 tests-mx32/ustat.gen.test delete mode 100755 tests-mx32/ustat.test create mode 100755 tests-mx32/utime.gen.test delete mode 100755 tests-mx32/utime.test create mode 100644 tests-mx32/utimensat-Xabbrev.c create mode 100755 tests-mx32/utimensat-Xabbrev.gen.test create mode 100644 tests-mx32/utimensat-Xraw.c create mode 100755 tests-mx32/utimensat-Xraw.gen.test create mode 100644 tests-mx32/utimensat-Xverbose.c create mode 100755 tests-mx32/utimensat-Xverbose.gen.test create mode 100755 tests-mx32/utimensat.gen.test delete mode 100755 tests-mx32/utimensat.test create mode 100755 tests-mx32/utimes.gen.test delete mode 100755 tests-mx32/utimes.test create mode 100755 tests-mx32/vfork-f.gen.test delete mode 100755 tests-mx32/vfork-f.test create mode 100755 tests-mx32/vhangup.gen.test delete mode 100755 tests-mx32/vhangup.test create mode 100755 tests-mx32/vmsplice.gen.test delete mode 100755 tests-mx32/vmsplice.test create mode 100755 tests-mx32/wait4-v.gen.test delete mode 100755 tests-mx32/wait4-v.test create mode 100755 tests-mx32/wait4.gen.test delete mode 100755 tests-mx32/wait4.test create mode 100755 tests-mx32/waitid-v.gen.test delete mode 100755 tests-mx32/waitid-v.test create mode 100755 tests-mx32/waitid.gen.test delete mode 100755 tests-mx32/waitid.test create mode 100755 tests-mx32/waitpid.gen.test delete mode 100755 tests-mx32/waitpid.test create mode 100755 tests-mx32/xattr-strings.gen.test delete mode 100755 tests-mx32/xattr-strings.test create mode 100755 tests-mx32/xattr.gen.test delete mode 100755 tests-mx32/xattr.test create mode 100755 tests-mx32/xet_robust_list.gen.test delete mode 100755 tests-mx32/xet_robust_list.test create mode 100644 tests-mx32/xet_thread_area_x86.c create mode 100755 tests-mx32/xet_thread_area_x86.test create mode 100755 tests-mx32/xetitimer.gen.test delete mode 100755 tests-mx32/xetitimer.test create mode 100755 tests-mx32/xetpgid.gen.test delete mode 100755 tests-mx32/xetpgid.test create mode 100755 tests-mx32/xetpriority.gen.test delete mode 100755 tests-mx32/xetpriority.test create mode 100755 tests-mx32/xettimeofday.gen.test delete mode 100755 tests-mx32/xettimeofday.test create mode 100644 tests-mx32/xutimes.c create mode 100644 tests-mx32/zeroargc.c create mode 100644 tests/COPYING create mode 100644 tests/GPL-2.0-or-later create mode 100755 tests/PTRACE_SEIZE.sh create mode 100644 tests/_newselect-P.c create mode 100755 tests/_newselect-P.gen.test create mode 100755 tests/_newselect.gen.test delete mode 100755 tests/_newselect.test create mode 100755 tests/accept.gen.test delete mode 100755 tests/accept.test create mode 100755 tests/accept4.gen.test delete mode 100755 tests/accept4.test create mode 100644 tests/accept_compat.h create mode 100755 tests/access.gen.test delete mode 100755 tests/access.test create mode 100755 tests/acct.gen.test delete mode 100755 tests/acct.test create mode 100755 tests/add_key.gen.test delete mode 100755 tests/add_key.test create mode 100755 tests/adjtimex.gen.test delete mode 100755 tests/adjtimex.test create mode 100755 tests/aio.gen.test delete mode 100755 tests/aio.test create mode 100644 tests/aio_pgetevents.c create mode 100755 tests/aio_pgetevents.gen.test create mode 100755 tests/alarm.gen.test delete mode 100755 tests/alarm.test create mode 100644 tests/attach-p-cmd.h create mode 100644 tests/block_reset_raise_run.c create mode 100644 tests/bpf-obj_get_info_by_fd-prog-v.c create mode 100755 tests/bpf-obj_get_info_by_fd-prog-v.gen.test create mode 100644 tests/bpf-obj_get_info_by_fd-prog.c create mode 100755 tests/bpf-obj_get_info_by_fd-prog.gen.test create mode 100644 tests/bpf-obj_get_info_by_fd-v.c create mode 100755 tests/bpf-obj_get_info_by_fd-v.gen.test create mode 100644 tests/bpf-obj_get_info_by_fd.c create mode 100755 tests/bpf-obj_get_info_by_fd.gen.test create mode 100644 tests/bpf-success-v.c create mode 100755 tests/bpf-success-v.test create mode 100644 tests/bpf-success.c create mode 100755 tests/bpf-success.test create mode 100644 tests/bpf-v.c create mode 100755 tests/bpf-v.gen.test create mode 100755 tests/bpf.gen.test delete mode 100755 tests/bpf.test create mode 100755 tests/btrfs-X.test create mode 100755 tests/btrfs-vX.test create mode 100755 tests/btrfs-vwX.test create mode 100755 tests/btrfs-wX.test create mode 100755 tests/btrfs.gen.test delete mode 100755 tests/btrfs.test create mode 100644 tests/check_sigblock.c create mode 100644 tests/check_sigign.c create mode 100755 tests/chmod.gen.test delete mode 100755 tests/chmod.test create mode 100755 tests/chown.gen.test delete mode 100755 tests/chown.test create mode 100755 tests/chown32.gen.test delete mode 100755 tests/chown32.test create mode 100755 tests/chroot.gen.test delete mode 100755 tests/chroot.test create mode 100755 tests/clock.gen.test create mode 100755 tests/clock.in create mode 100755 tests/clock_adjtime.gen.test delete mode 100755 tests/clock_adjtime.test create mode 100755 tests/clock_nanosleep.gen.test delete mode 100755 tests/clock_nanosleep.test create mode 100755 tests/clock_xettime.gen.test delete mode 100755 tests/clock_xettime.test create mode 100644 tests/clone_parent.c create mode 100755 tests/clone_parent.test create mode 100644 tests/clone_ptrace.c create mode 100755 tests/clone_ptrace.test create mode 100755 tests/copy_file_range.gen.test delete mode 100755 tests/copy_file_range.test create mode 100755 tests/creat.gen.test delete mode 100755 tests/creat.test create mode 100644 tests/create_nl_socket.c create mode 100644 tests/delay.c create mode 100755 tests/delay.test create mode 100755 tests/delete_module.gen.test delete mode 100755 tests/delete_module.test create mode 100644 tests/dev-yy.c create mode 100755 tests/dev-yy.gen.test create mode 100755 tests/dup.gen.test delete mode 100755 tests/dup.test create mode 100755 tests/dup2.gen.test delete mode 100755 tests/dup2.test create mode 100755 tests/dup3.gen.test delete mode 100755 tests/dup3.test create mode 100755 tests/epoll_create.gen.test delete mode 100755 tests/epoll_create.test create mode 100755 tests/epoll_create1.gen.test delete mode 100755 tests/epoll_create1.test create mode 100755 tests/epoll_ctl.gen.test delete mode 100755 tests/epoll_ctl.test create mode 100755 tests/epoll_pwait.gen.test delete mode 100755 tests/epoll_pwait.test create mode 100755 tests/epoll_wait.gen.test delete mode 100755 tests/epoll_wait.test create mode 100755 tests/erestartsys.gen.test delete mode 100755 tests/erestartsys.test create mode 100755 tests/execveat-v.gen.test delete mode 100755 tests/execveat-v.test create mode 100755 tests/execveat.gen.test delete mode 100755 tests/execveat.test create mode 100755 tests/faccessat.gen.test delete mode 100755 tests/faccessat.test create mode 100755 tests/fadvise64_64.gen.test delete mode 100755 tests/fadvise64_64.test create mode 100755 tests/fallocate.gen.test delete mode 100755 tests/fallocate.test create mode 100755 tests/fanotify_init.gen.test delete mode 100755 tests/fanotify_init.test create mode 100644 tests/fanotify_mark-Xabbrev.c create mode 100755 tests/fanotify_mark-Xabbrev.gen.test create mode 100644 tests/fanotify_mark-Xraw.c create mode 100755 tests/fanotify_mark-Xraw.gen.test create mode 100644 tests/fanotify_mark-Xverbose.c create mode 100755 tests/fanotify_mark-Xverbose.gen.test create mode 100755 tests/fanotify_mark.gen.test delete mode 100755 tests/fanotify_mark.test create mode 100755 tests/fchdir.gen.test delete mode 100755 tests/fchdir.test create mode 100755 tests/fchmod.gen.test delete mode 100755 tests/fchmod.test create mode 100755 tests/fchmodat.gen.test delete mode 100755 tests/fchmodat.test create mode 100755 tests/fchown.gen.test delete mode 100755 tests/fchown.test create mode 100755 tests/fchown32.gen.test delete mode 100755 tests/fchown32.test create mode 100755 tests/fchownat.gen.test delete mode 100755 tests/fchownat.test create mode 100644 tests/fcntl-common.c create mode 100755 tests/fcntl.gen.test delete mode 100755 tests/fcntl.test create mode 100755 tests/fcntl64.gen.test delete mode 100755 tests/fcntl64.test create mode 100755 tests/fdatasync.gen.test delete mode 100755 tests/fdatasync.test create mode 100644 tests/fflush.c create mode 100755 tests/fflush.test create mode 100755 tests/file_handle.gen.test delete mode 100755 tests/file_handle.test create mode 100755 tests/file_ioctl.gen.test delete mode 100755 tests/file_ioctl.test create mode 100755 tests/filtering_fd-syntax.test create mode 100755 tests/filtering_syscall-syntax.test create mode 100755 tests/finit_module.gen.test delete mode 100755 tests/finit_module.test create mode 100755 tests/first_exec_failure.test create mode 100755 tests/flock.gen.test delete mode 100755 tests/flock.test create mode 100755 tests/fork-f.gen.test delete mode 100755 tests/fork-f.test create mode 100644 tests/fstat-Xabbrev.c create mode 100755 tests/fstat-Xabbrev.gen.test create mode 100644 tests/fstat-Xraw.c create mode 100755 tests/fstat-Xraw.gen.test create mode 100644 tests/fstat-Xverbose.c create mode 100755 tests/fstat-Xverbose.gen.test create mode 100755 tests/fstat.gen.test delete mode 100755 tests/fstat.test create mode 100644 tests/fstat64-Xabbrev.c create mode 100755 tests/fstat64-Xabbrev.gen.test create mode 100644 tests/fstat64-Xraw.c create mode 100755 tests/fstat64-Xraw.gen.test create mode 100644 tests/fstat64-Xverbose.c create mode 100755 tests/fstat64-Xverbose.gen.test create mode 100755 tests/fstat64.gen.test delete mode 100755 tests/fstat64.test create mode 100755 tests/fstatat64.gen.test delete mode 100755 tests/fstatat64.test create mode 100755 tests/fstatfs.gen.test delete mode 100755 tests/fstatfs.test create mode 100755 tests/fstatfs64.gen.test delete mode 100755 tests/fstatfs64.test create mode 100644 tests/fsync-y.c create mode 100755 tests/fsync-y.gen.test create mode 100755 tests/fsync.gen.test delete mode 100755 tests/fsync.test create mode 100755 tests/ftruncate.gen.test delete mode 100755 tests/ftruncate.test create mode 100755 tests/ftruncate64.gen.test delete mode 100755 tests/ftruncate64.test create mode 100755 tests/futimesat.gen.test delete mode 100755 tests/futimesat.test create mode 100755 tests/gen_pure_executables.sh create mode 100644 tests/gen_tests.am create mode 100644 tests/gen_tests.in create mode 100755 tests/gen_tests.sh create mode 100755 tests/get_mempolicy.gen.test delete mode 100755 tests/get_mempolicy.test create mode 100755 tests/get_regs.test create mode 100644 tests/get_sigset_size.c create mode 100755 tests/getcpu.gen.test delete mode 100755 tests/getcpu.test create mode 100755 tests/getcwd.gen.test delete mode 100755 tests/getcwd.test create mode 100755 tests/getdents.gen.test delete mode 100755 tests/getdents.test create mode 100755 tests/getdents64.gen.test delete mode 100755 tests/getdents64.test create mode 100755 tests/getegid.gen.test delete mode 100755 tests/getegid.test create mode 100755 tests/getegid32.gen.test delete mode 100755 tests/getegid32.test create mode 100755 tests/geteuid.gen.test delete mode 100755 tests/geteuid.test create mode 100755 tests/geteuid32.gen.test delete mode 100755 tests/geteuid32.test create mode 100755 tests/getgid.gen.test delete mode 100755 tests/getgid.test create mode 100755 tests/getgid32.gen.test delete mode 100755 tests/getgid32.test create mode 100755 tests/getgroups.gen.test delete mode 100755 tests/getgroups.test create mode 100755 tests/getgroups32.gen.test delete mode 100755 tests/getgroups32.test create mode 100755 tests/getpeername.gen.test delete mode 100755 tests/getpeername.test create mode 100755 tests/getpgrp.gen.test delete mode 100755 tests/getpgrp.test create mode 100644 tests/getpid.c create mode 100755 tests/getpid.gen.test create mode 100644 tests/getppid.c create mode 100755 tests/getppid.gen.test create mode 100755 tests/getrandom.gen.test delete mode 100755 tests/getrandom.test create mode 100755 tests/getresgid.gen.test delete mode 100755 tests/getresgid.test create mode 100755 tests/getresgid32.gen.test delete mode 100755 tests/getresgid32.test create mode 100755 tests/getresuid.gen.test delete mode 100755 tests/getresuid.test create mode 100755 tests/getresuid32.gen.test delete mode 100755 tests/getresuid32.test create mode 100755 tests/getrlimit.gen.test delete mode 100755 tests/getrlimit.test create mode 100755 tests/getrusage.gen.test delete mode 100755 tests/getrusage.test create mode 100755 tests/getsid.gen.test delete mode 100755 tests/getsid.test create mode 100755 tests/getsockname.gen.test delete mode 100755 tests/getsockname.test create mode 100644 tests/gettid.c create mode 100755 tests/gettid.gen.test create mode 100755 tests/getuid32.gen.test delete mode 100755 tests/getuid32.test create mode 100755 tests/getxxid.gen.test delete mode 100755 tests/getxxid.test create mode 100644 tests/group_req.c create mode 100755 tests/group_req.gen.test create mode 100644 tests/ifindex.c create mode 100755 tests/inet-cmsg.gen.test delete mode 100755 tests/inet-cmsg.test create mode 100755 tests/init_module.gen.test delete mode 100755 tests/init_module.test create mode 100644 tests/inject-nf.c create mode 100755 tests/inject-nf.test create mode 100755 tests/inotify.gen.test delete mode 100755 tests/inotify.test create mode 100755 tests/inotify_init1.gen.test delete mode 100755 tests/inotify_init1.test create mode 100644 tests/int_0x80.c create mode 100755 tests/int_0x80.test create mode 100755 tests/interactive_block.test create mode 100644 tests/io_uring_enter.c create mode 100755 tests/io_uring_enter.gen.test create mode 100644 tests/io_uring_register.c create mode 100755 tests/io_uring_register.gen.test create mode 100644 tests/io_uring_setup.c create mode 100755 tests/io_uring_setup.gen.test create mode 100755 tests/ioctl_block.gen.test delete mode 100755 tests/ioctl_block.test create mode 100755 tests/ioctl_dm-v.gen.test delete mode 100755 tests/ioctl_dm-v.test create mode 100755 tests/ioctl_dm.gen.test delete mode 100755 tests/ioctl_dm.test create mode 100644 tests/ioctl_evdev-success-v.c create mode 100755 tests/ioctl_evdev-success-v.test create mode 100644 tests/ioctl_evdev-success.c create mode 100755 tests/ioctl_evdev-success.test create mode 100755 tests/ioctl_evdev-v.gen.test delete mode 100755 tests/ioctl_evdev-v.test create mode 100755 tests/ioctl_evdev.gen.test delete mode 100755 tests/ioctl_evdev.test create mode 100644 tests/ioctl_inotify.c create mode 100755 tests/ioctl_inotify.gen.test create mode 100644 tests/ioctl_kvm_run-v.c create mode 100755 tests/ioctl_kvm_run-v.gen.test create mode 100644 tests/ioctl_kvm_run.c create mode 100755 tests/ioctl_kvm_run.gen.test create mode 100644 tests/ioctl_kvm_run_auxstr_vcpu.c create mode 100755 tests/ioctl_kvm_run_auxstr_vcpu.gen.test create mode 100644 tests/ioctl_kvm_run_common.c create mode 100755 tests/ioctl_loop-nv.gen.test delete mode 100755 tests/ioctl_loop-nv.test create mode 100755 tests/ioctl_loop-v.gen.test delete mode 100755 tests/ioctl_loop-v.test create mode 100755 tests/ioctl_loop.gen.test delete mode 100755 tests/ioctl_loop.test create mode 100755 tests/ioctl_mtd.gen.test delete mode 100755 tests/ioctl_mtd.test create mode 100644 tests/ioctl_nbd.c create mode 100755 tests/ioctl_nbd.gen.test create mode 100644 tests/ioctl_nsfs.c create mode 100755 tests/ioctl_nsfs.gen.test create mode 100644 tests/ioctl_perf-success.c create mode 100755 tests/ioctl_perf-success.test create mode 100644 tests/ioctl_perf.c create mode 100755 tests/ioctl_perf.gen.test create mode 100644 tests/ioctl_ptp.c create mode 100755 tests/ioctl_ptp.gen.test create mode 100644 tests/ioctl_random.c create mode 100755 tests/ioctl_random.gen.test create mode 100755 tests/ioctl_rtc-v.gen.test delete mode 100755 tests/ioctl_rtc-v.test create mode 100755 tests/ioctl_rtc.gen.test delete mode 100755 tests/ioctl_rtc.test create mode 100755 tests/ioctl_scsi.gen.test delete mode 100755 tests/ioctl_scsi.test create mode 100755 tests/ioctl_sg_io_v3.gen.test delete mode 100755 tests/ioctl_sg_io_v3.test create mode 100755 tests/ioctl_sg_io_v4.gen.test delete mode 100755 tests/ioctl_sg_io_v4.test create mode 100755 tests/ioctl_sock_gifconf.gen.test delete mode 100755 tests/ioctl_sock_gifconf.test create mode 100755 tests/ioctl_uffdio.gen.test delete mode 100755 tests/ioctl_uffdio.test create mode 100755 tests/ioctl_v4l2.gen.test delete mode 100755 tests/ioctl_v4l2.test create mode 100755 tests/ioperm.gen.test delete mode 100755 tests/ioperm.test create mode 100755 tests/iopl.gen.test delete mode 100755 tests/iopl.test create mode 100644 tests/ioprio-Xabbrev.c create mode 100755 tests/ioprio-Xabbrev.gen.test create mode 100644 tests/ioprio-Xraw.c create mode 100755 tests/ioprio-Xraw.gen.test create mode 100644 tests/ioprio-Xverbose.c create mode 100755 tests/ioprio-Xverbose.gen.test create mode 100755 tests/ioprio.gen.test delete mode 100755 tests/ioprio.test create mode 100755 tests/ip_mreq.gen.test delete mode 100755 tests/ip_mreq.test create mode 100755 tests/ipc.gen.test delete mode 100755 tests/ipc.test create mode 100644 tests/ipc_msg-Xabbrev.c create mode 100755 tests/ipc_msg-Xabbrev.gen.test create mode 100644 tests/ipc_msg-Xraw.c create mode 100755 tests/ipc_msg-Xraw.gen.test create mode 100644 tests/ipc_msg-Xverbose.c create mode 100755 tests/ipc_msg-Xverbose.gen.test create mode 100755 tests/ipc_msg.gen.test delete mode 100755 tests/ipc_msg.test create mode 100644 tests/ipc_msgbuf-Xabbrev.c create mode 100755 tests/ipc_msgbuf-Xabbrev.gen.test create mode 100644 tests/ipc_msgbuf-Xraw.c create mode 100755 tests/ipc_msgbuf-Xraw.gen.test create mode 100644 tests/ipc_msgbuf-Xverbose.c create mode 100755 tests/ipc_msgbuf-Xverbose.gen.test delete mode 100644 tests/ipc_msgbuf.expected create mode 100644 tests/ipc_sem-Xabbrev.c create mode 100755 tests/ipc_sem-Xabbrev.gen.test create mode 100644 tests/ipc_sem-Xraw.c create mode 100755 tests/ipc_sem-Xraw.gen.test create mode 100644 tests/ipc_sem-Xverbose.c create mode 100755 tests/ipc_sem-Xverbose.gen.test create mode 100755 tests/ipc_sem.gen.test delete mode 100755 tests/ipc_sem.test create mode 100644 tests/ipc_shm-Xabbrev.c create mode 100755 tests/ipc_shm-Xabbrev.gen.test create mode 100644 tests/ipc_shm-Xraw.c create mode 100755 tests/ipc_shm-Xraw.gen.test create mode 100644 tests/ipc_shm-Xverbose.c create mode 100755 tests/ipc_shm-Xverbose.gen.test create mode 100755 tests/ipc_shm.gen.test delete mode 100755 tests/ipc_shm.test create mode 100644 tests/is_linux_mips_n64.c create mode 100644 tests/kcmp-y.c create mode 100755 tests/kcmp-y.gen.test create mode 100755 tests/kcmp.gen.test delete mode 100755 tests/kcmp.test create mode 100755 tests/kern_features-fault.test create mode 100644 tests/kern_features.c create mode 100755 tests/kern_features.gen.test create mode 100644 tests/kernel_version-Xabbrev.c create mode 100755 tests/kernel_version-Xabbrev.gen.test create mode 100644 tests/kernel_version-Xraw.c create mode 100755 tests/kernel_version-Xraw.gen.test create mode 100644 tests/kernel_version-Xverbose.c create mode 100755 tests/kernel_version-Xverbose.gen.test create mode 100644 tests/kernel_version.c create mode 100755 tests/kernel_version.gen.test create mode 100755 tests/kexec_file_load.gen.test delete mode 100755 tests/kexec_file_load.test create mode 100755 tests/kexec_load.gen.test delete mode 100755 tests/kexec_load.test create mode 100644 tests/keyctl-Xabbrev.c create mode 100755 tests/keyctl-Xabbrev.gen.test create mode 100644 tests/keyctl-Xraw.c create mode 100755 tests/keyctl-Xraw.gen.test create mode 100644 tests/keyctl-Xverbose.c create mode 100755 tests/keyctl-Xverbose.gen.test create mode 100755 tests/keyctl.gen.test delete mode 100755 tests/keyctl.test create mode 100755 tests/kill.gen.test delete mode 100755 tests/kill.test create mode 100644 tests/kill_child.c create mode 100755 tests/kill_child.test create mode 100755 tests/lchown.gen.test delete mode 100755 tests/lchown.test create mode 100755 tests/lchown32.gen.test delete mode 100755 tests/lchown32.test create mode 100755 tests/link.gen.test delete mode 100755 tests/link.test create mode 100755 tests/linkat.gen.test delete mode 100755 tests/linkat.test create mode 100644 tests/list_sigaction_signum.c create mode 100644 tests/localtime.c create mode 100755 tests/localtime.test create mode 100755 tests/lookup_dcookie.gen.test delete mode 100755 tests/lookup_dcookie.test create mode 100644 tests/looping_threads.c create mode 100755 tests/looping_threads.test create mode 100755 tests/lstat.gen.test delete mode 100755 tests/lstat.test create mode 100755 tests/lstat64.gen.test delete mode 100755 tests/lstat64.test create mode 100644 tests/madvise.c create mode 100755 tests/madvise.gen.test create mode 100755 tests/mbind.gen.test delete mode 100755 tests/mbind.test create mode 100755 tests/membarrier.gen.test delete mode 100755 tests/membarrier.test create mode 100644 tests/memfd_create-Xabbrev.c create mode 100755 tests/memfd_create-Xabbrev.gen.test create mode 100644 tests/memfd_create-Xraw.c create mode 100755 tests/memfd_create-Xraw.gen.test create mode 100644 tests/memfd_create-Xverbose.c create mode 100755 tests/memfd_create-Xverbose.gen.test create mode 100755 tests/memfd_create.gen.test delete mode 100755 tests/memfd_create.test create mode 100755 tests/migrate_pages.gen.test delete mode 100755 tests/migrate_pages.test create mode 100755 tests/mincore.gen.test delete mode 100755 tests/mincore.test create mode 100755 tests/mkdir.gen.test delete mode 100755 tests/mkdir.test create mode 100755 tests/mkdirat.gen.test delete mode 100755 tests/mkdirat.test create mode 100755 tests/mknod.gen.test delete mode 100755 tests/mknod.test create mode 100755 tests/mknodat.gen.test delete mode 100755 tests/mknodat.test create mode 100755 tests/mlock.gen.test delete mode 100755 tests/mlock.test create mode 100755 tests/mlock2.gen.test delete mode 100755 tests/mlock2.test create mode 100755 tests/mlockall.gen.test delete mode 100755 tests/mlockall.test create mode 100644 tests/mmap-Xabbrev.c create mode 100755 tests/mmap-Xabbrev.gen.test create mode 100644 tests/mmap-Xraw.c create mode 100755 tests/mmap-Xraw.gen.test create mode 100644 tests/mmap-Xverbose.c create mode 100755 tests/mmap-Xverbose.gen.test create mode 100644 tests/mmap64-Xabbrev.c create mode 100755 tests/mmap64-Xabbrev.gen.test create mode 100644 tests/mmap64-Xraw.c create mode 100755 tests/mmap64-Xraw.gen.test create mode 100644 tests/mmap64-Xverbose.c create mode 100755 tests/mmap64-Xverbose.gen.test create mode 100755 tests/mmap64.gen.test delete mode 100755 tests/mmap64.test create mode 100755 tests/mmsg-silent.gen.test delete mode 100755 tests/mmsg-silent.test create mode 100755 tests/mmsg.gen.test delete mode 100755 tests/mmsg.test create mode 100755 tests/mmsg_name-v.gen.test delete mode 100755 tests/mmsg_name-v.test create mode 100755 tests/mmsg_name.gen.test delete mode 100755 tests/mmsg_name.test create mode 100644 tests/modify_ldt.c create mode 100755 tests/modify_ldt.gen.test create mode 100644 tests/mount-Xabbrev.c create mode 100755 tests/mount-Xabbrev.gen.test create mode 100644 tests/mount-Xraw.c create mode 100755 tests/mount-Xraw.gen.test create mode 100644 tests/mount-Xverbose.c create mode 100755 tests/mount-Xverbose.gen.test create mode 100755 tests/mount.gen.test delete mode 100755 tests/mount.test create mode 100644 tests/move_pages-Xabbrev.c create mode 100755 tests/move_pages-Xabbrev.gen.test create mode 100644 tests/move_pages-Xraw.c create mode 100755 tests/move_pages-Xraw.gen.test create mode 100644 tests/move_pages-Xverbose.c create mode 100755 tests/move_pages-Xverbose.gen.test create mode 100755 tests/move_pages.gen.test delete mode 100755 tests/move_pages.test create mode 100755 tests/mq.gen.test delete mode 100755 tests/mq.test create mode 100755 tests/mq_sendrecv-read.gen.test delete mode 100755 tests/mq_sendrecv-read.test create mode 100755 tests/mq_sendrecv-write.gen.test delete mode 100755 tests/mq_sendrecv-write.test create mode 100755 tests/mq_sendrecv.gen.test delete mode 100755 tests/mq_sendrecv.test create mode 100755 tests/msg_control-v.gen.test delete mode 100755 tests/msg_control-v.test create mode 100755 tests/msg_control.gen.test delete mode 100755 tests/msg_control.test create mode 100755 tests/msg_name.gen.test delete mode 100755 tests/msg_name.test create mode 100755 tests/munlockall.gen.test delete mode 100755 tests/munlockall.test create mode 100755 tests/nanosleep.gen.test delete mode 100755 tests/nanosleep.test create mode 100755 tests/net-icmp_filter.gen.test delete mode 100755 tests/net-icmp_filter.test create mode 100644 tests/net-packet_mreq-Xabbrev.c create mode 100755 tests/net-packet_mreq-Xabbrev.gen.test create mode 100644 tests/net-packet_mreq-Xraw.c create mode 100755 tests/net-packet_mreq-Xraw.gen.test create mode 100644 tests/net-packet_mreq-Xverbose.c create mode 100755 tests/net-packet_mreq-Xverbose.gen.test create mode 100644 tests/net-packet_mreq.c create mode 100755 tests/net-packet_mreq.gen.test create mode 100755 tests/net-sockaddr.gen.test delete mode 100755 tests/net-sockaddr.test create mode 100644 tests/net-tpacket_req.c create mode 100755 tests/net-tpacket_req.gen.test create mode 100644 tests/net-tpacket_stats-success.c create mode 100755 tests/net-tpacket_stats-success.test create mode 100644 tests/net-tpacket_stats.c create mode 100755 tests/net-tpacket_stats.gen.test create mode 100644 tests/net-yy-inet6.c create mode 100755 tests/net-yy-inet6.gen.test create mode 100644 tests/netlink_audit.c create mode 100755 tests/netlink_audit.gen.test create mode 100644 tests/netlink_crypto.c create mode 100755 tests/netlink_crypto.gen.test create mode 100644 tests/netlink_generic.c create mode 100755 tests/netlink_generic.gen.test create mode 100644 tests/netlink_kobject_uevent.c create mode 100755 tests/netlink_kobject_uevent.gen.test create mode 100644 tests/netlink_netfilter.c create mode 100755 tests/netlink_netfilter.gen.test create mode 100755 tests/netlink_protocol.gen.test delete mode 100755 tests/netlink_protocol.test create mode 100644 tests/netlink_route.c create mode 100755 tests/netlink_route.gen.test create mode 100644 tests/netlink_selinux.c create mode 100755 tests/netlink_selinux.gen.test create mode 100755 tests/netlink_sock_diag-v.sh create mode 100644 tests/netlink_sock_diag.c create mode 100755 tests/netlink_sock_diag.test create mode 100644 tests/netlink_xfrm.c create mode 100755 tests/netlink_xfrm.gen.test create mode 100755 tests/newfstatat.gen.test delete mode 100755 tests/newfstatat.test create mode 100644 tests/nfnetlink_acct.c create mode 100755 tests/nfnetlink_acct.gen.test create mode 100644 tests/nfnetlink_cthelper.c create mode 100755 tests/nfnetlink_cthelper.gen.test create mode 100644 tests/nfnetlink_ctnetlink.c create mode 100755 tests/nfnetlink_ctnetlink.gen.test create mode 100644 tests/nfnetlink_ctnetlink_exp.c create mode 100755 tests/nfnetlink_ctnetlink_exp.gen.test create mode 100644 tests/nfnetlink_cttimeout.c create mode 100755 tests/nfnetlink_cttimeout.gen.test create mode 100644 tests/nfnetlink_ipset.c create mode 100755 tests/nfnetlink_ipset.gen.test create mode 100644 tests/nfnetlink_nft_compat.c create mode 100755 tests/nfnetlink_nft_compat.gen.test create mode 100644 tests/nfnetlink_nftables.c create mode 100755 tests/nfnetlink_nftables.gen.test create mode 100644 tests/nfnetlink_osf.c create mode 100755 tests/nfnetlink_osf.gen.test create mode 100644 tests/nfnetlink_queue.c create mode 100755 tests/nfnetlink_queue.gen.test create mode 100644 tests/nfnetlink_ulog.c create mode 100755 tests/nfnetlink_ulog.gen.test create mode 100644 tests/nlattr.c create mode 100755 tests/nlattr.gen.test create mode 100644 tests/nlattr_br_port_msg.c create mode 100755 tests/nlattr_br_port_msg.gen.test create mode 100644 tests/nlattr_crypto_user_alg.c create mode 100755 tests/nlattr_crypto_user_alg.gen.test create mode 100644 tests/nlattr_dcbmsg.c create mode 100755 tests/nlattr_dcbmsg.gen.test create mode 100644 tests/nlattr_fib_rule_hdr.c create mode 100755 tests/nlattr_fib_rule_hdr.gen.test create mode 100644 tests/nlattr_ifaddrlblmsg.c create mode 100755 tests/nlattr_ifaddrlblmsg.gen.test create mode 100644 tests/nlattr_ifaddrmsg.c create mode 100755 tests/nlattr_ifaddrmsg.gen.test create mode 100644 tests/nlattr_ifinfomsg.c create mode 100755 tests/nlattr_ifinfomsg.gen.test create mode 100644 tests/nlattr_ifla.h create mode 100644 tests/nlattr_ifla_af_spec.c create mode 100755 tests/nlattr_ifla_af_spec.gen.test create mode 100644 tests/nlattr_ifla_brport.c create mode 100755 tests/nlattr_ifla_brport.gen.test create mode 100644 tests/nlattr_ifla_linkinfo.c create mode 100755 tests/nlattr_ifla_linkinfo.gen.test create mode 100644 tests/nlattr_ifla_port.c create mode 100755 tests/nlattr_ifla_port.gen.test create mode 100644 tests/nlattr_ifla_xdp.c create mode 100755 tests/nlattr_ifla_xdp.gen.test create mode 100644 tests/nlattr_inet_diag_msg.c create mode 100755 tests/nlattr_inet_diag_msg.gen.test create mode 100644 tests/nlattr_inet_diag_req_compat.c create mode 100755 tests/nlattr_inet_diag_req_compat.gen.test create mode 100644 tests/nlattr_inet_diag_req_v2.c create mode 100755 tests/nlattr_inet_diag_req_v2.gen.test create mode 100644 tests/nlattr_mdba_mdb_entry.c create mode 100755 tests/nlattr_mdba_mdb_entry.gen.test create mode 100644 tests/nlattr_mdba_router_port.c create mode 100755 tests/nlattr_mdba_router_port.gen.test create mode 100644 tests/nlattr_ndmsg.c create mode 100755 tests/nlattr_ndmsg.gen.test create mode 100644 tests/nlattr_ndtmsg.c create mode 100755 tests/nlattr_ndtmsg.gen.test create mode 100644 tests/nlattr_netconfmsg.c create mode 100755 tests/nlattr_netconfmsg.gen.test create mode 100644 tests/nlattr_netlink_diag_msg.c create mode 100755 tests/nlattr_netlink_diag_msg.gen.test create mode 100644 tests/nlattr_nlmsgerr.c create mode 100755 tests/nlattr_nlmsgerr.gen.test create mode 100644 tests/nlattr_packet_diag_msg.c create mode 100755 tests/nlattr_packet_diag_msg.gen.test create mode 100644 tests/nlattr_rtgenmsg.c create mode 100755 tests/nlattr_rtgenmsg.gen.test create mode 100644 tests/nlattr_rtmsg.c create mode 100755 tests/nlattr_rtmsg.gen.test create mode 100644 tests/nlattr_smc_diag_msg.c create mode 100755 tests/nlattr_smc_diag_msg.gen.test create mode 100644 tests/nlattr_tc_stats.c create mode 100755 tests/nlattr_tc_stats.gen.test create mode 100644 tests/nlattr_tca_stab.c create mode 100755 tests/nlattr_tca_stab.gen.test create mode 100644 tests/nlattr_tcamsg.c create mode 100755 tests/nlattr_tcamsg.gen.test create mode 100644 tests/nlattr_tcmsg.c create mode 100755 tests/nlattr_tcmsg.gen.test create mode 100644 tests/nlattr_unix_diag_msg.c create mode 100755 tests/nlattr_unix_diag_msg.gen.test create mode 100644 tests/nsyscalls-d.c create mode 100755 tests/nsyscalls-d.test create mode 100755 tests/nsyscalls-nd.test create mode 100644 tests/old_mmap-P.c create mode 100755 tests/old_mmap-P.gen.test create mode 100644 tests/old_mmap-Xabbrev.c create mode 100755 tests/old_mmap-Xabbrev.gen.test create mode 100644 tests/old_mmap-Xraw.c create mode 100755 tests/old_mmap-Xraw.gen.test create mode 100644 tests/old_mmap-Xverbose.c create mode 100755 tests/old_mmap-Xverbose.gen.test create mode 100644 tests/old_mmap-v-none.c create mode 100755 tests/old_mmap-v-none.gen.test create mode 100755 tests/old_mmap.gen.test delete mode 100755 tests/old_mmap.test create mode 100755 tests/oldfstat.gen.test delete mode 100755 tests/oldfstat.test create mode 100755 tests/oldlstat.gen.test delete mode 100755 tests/oldlstat.test create mode 100644 tests/oldselect-P.c create mode 100755 tests/oldselect-P.gen.test create mode 100644 tests/oldselect-efault-P.c create mode 100755 tests/oldselect-efault-P.gen.test create mode 100644 tests/oldselect-efault.c create mode 100755 tests/oldselect-efault.gen.test delete mode 100644 tests/oldselect.expected create mode 100755 tests/oldselect.gen.test delete mode 100755 tests/oldselect.test create mode 100755 tests/oldstat.gen.test delete mode 100755 tests/oldstat.test create mode 100755 tests/open.gen.test delete mode 100755 tests/open.test create mode 100755 tests/openat.gen.test delete mode 100755 tests/openat.test create mode 100644 tests/orphaned_process_group.c create mode 100755 tests/orphaned_process_group.gen.test create mode 100644 tests/osf_utimes.c create mode 100755 tests/osf_utimes.gen.test create mode 100755 tests/pause.gen.test delete mode 100755 tests/pause.test create mode 100755 tests/perf_event_open.gen.test delete mode 100755 tests/perf_event_open.test create mode 100755 tests/perf_event_open_nonverbose.gen.test delete mode 100755 tests/perf_event_open_nonverbose.test create mode 100755 tests/perf_event_open_unabbrev.gen.test delete mode 100755 tests/perf_event_open_unabbrev.test create mode 100644 tests/personality-Xabbrev.c create mode 100755 tests/personality-Xabbrev.gen.test create mode 100644 tests/personality-Xraw.c create mode 100755 tests/personality-Xraw.gen.test create mode 100644 tests/personality-Xverbose.c create mode 100755 tests/personality-Xverbose.gen.test create mode 100644 tests/pidfd_send_signal.c create mode 100755 tests/pidfd_send_signal.gen.test create mode 100755 tests/pipe2.gen.test delete mode 100755 tests/pipe2.test create mode 100755 tests/pkey_alloc.gen.test delete mode 100755 tests/pkey_alloc.test create mode 100755 tests/pkey_free.gen.test delete mode 100755 tests/pkey_free.test create mode 100755 tests/pkey_mprotect.gen.test delete mode 100755 tests/pkey_mprotect.test create mode 100644 tests/poll-P.c create mode 100755 tests/poll-P.test create mode 100644 tests/ppoll-P.c create mode 100755 tests/ppoll-P.gen.test create mode 100644 tests/ppoll-v.c delete mode 100644 tests/ppoll-v.expected create mode 100755 tests/ppoll-v.gen.test delete mode 100644 tests/ppoll.expected create mode 100755 tests/ppoll.gen.test delete mode 100755 tests/ppoll.test create mode 100644 tests/prctl-spec-inject.c create mode 100755 tests/prctl-spec-inject.test create mode 100755 tests/pread64-pwrite64.gen.test delete mode 100755 tests/pread64-pwrite64.test create mode 100755 tests/preadv-pwritev.gen.test delete mode 100755 tests/preadv-pwritev.test create mode 100755 tests/preadv.gen.test delete mode 100755 tests/preadv.test create mode 100755 tests/preadv2-pwritev2.gen.test delete mode 100755 tests/preadv2-pwritev2.test create mode 100644 tests/print_time.c create mode 100644 tests/print_user_desc.c create mode 100755 tests/printpath-umovestr-legacy.test create mode 100644 tests/printpath-umovestr-peekdata.c create mode 100755 tests/printpath-umovestr-peekdata.gen.test create mode 100644 tests/printpath-umovestr-undumpable.c create mode 100755 tests/printpath-umovestr-undumpable.gen.test create mode 100644 tests/printpath-umovestr.c create mode 100755 tests/printpath-umovestr.gen.test create mode 100644 tests/printsignal-Xabbrev.c create mode 100755 tests/printsignal-Xabbrev.gen.test create mode 100644 tests/printsignal-Xraw.c create mode 100755 tests/printsignal-Xraw.gen.test create mode 100644 tests/printsignal-Xverbose.c create mode 100755 tests/printsignal-Xverbose.gen.test create mode 100644 tests/printsignal.c create mode 100755 tests/printstr.gen.test delete mode 100755 tests/printstr.test create mode 100755 tests/printstrn-umoven-legacy.test create mode 100644 tests/printstrn-umoven-peekdata.c create mode 100755 tests/printstrn-umoven-peekdata.gen.test create mode 100644 tests/printstrn-umoven-undumpable.c create mode 100755 tests/printstrn-umoven-undumpable.gen.test create mode 100644 tests/printstrn-umoven.c create mode 100755 tests/printstrn-umoven.gen.test create mode 100755 tests/prlimit64.gen.test delete mode 100755 tests/prlimit64.test create mode 100755 tests/process_vm_readv.gen.test delete mode 100755 tests/process_vm_readv.test create mode 100755 tests/process_vm_writev.gen.test delete mode 100755 tests/process_vm_writev.test create mode 100755 tests/pselect6.gen.test delete mode 100755 tests/pselect6.test create mode 100755 tests/ptrace.gen.test delete mode 100755 tests/ptrace.test create mode 100644 tests/ptrace_syscall_info.c create mode 100755 tests/ptrace_syscall_info.gen.test create mode 100644 tests/pure_executables.am create mode 100755 tests/pure_executables.list create mode 100755 tests/pwritev.gen.test delete mode 100755 tests/pwritev.test create mode 100755 tests/qual_fault-syscall.test create mode 100755 tests/qual_inject-error-signal-syscall.test create mode 100755 tests/qual_inject-retval-syscall.test create mode 100755 tests/qual_inject-signal-syscall.test create mode 100644 tests/qualify_personality.sh create mode 100644 tests/qualify_personality_empty.in create mode 100644 tests/quotactl-Xabbrev.c create mode 100755 tests/quotactl-Xabbrev.gen.test create mode 100644 tests/quotactl-Xraw.c create mode 100755 tests/quotactl-Xraw.gen.test create mode 100644 tests/quotactl-Xverbose.c create mode 100755 tests/quotactl-Xverbose.gen.test create mode 100644 tests/quotactl-success-v.c create mode 100755 tests/quotactl-success-v.test create mode 100644 tests/quotactl-success.c create mode 100755 tests/quotactl-success.test create mode 100755 tests/quotactl-v.gen.test delete mode 100755 tests/quotactl-v.test create mode 100644 tests/quotactl-xfs-success-v.c create mode 100755 tests/quotactl-xfs-success-v.test create mode 100644 tests/quotactl-xfs-success.c create mode 100755 tests/quotactl-xfs-success.test create mode 100755 tests/quotactl-xfs-v.gen.test delete mode 100755 tests/quotactl-xfs-v.test create mode 100755 tests/quotactl-xfs.gen.test delete mode 100755 tests/quotactl-xfs.test create mode 100755 tests/quotactl.gen.test delete mode 100755 tests/quotactl.test create mode 100755 tests/read-write.gen.test delete mode 100755 tests/read-write.test create mode 100755 tests/readahead.gen.test delete mode 100755 tests/readahead.test create mode 100755 tests/readdir.gen.test delete mode 100755 tests/readdir.test create mode 100755 tests/readlink.gen.test delete mode 100755 tests/readlink.test create mode 100755 tests/readlinkat.gen.test delete mode 100755 tests/readlinkat.test create mode 100755 tests/reboot.gen.test delete mode 100755 tests/reboot.test create mode 100755 tests/recvfrom.gen.test delete mode 100755 tests/recvfrom.test create mode 100755 tests/recvmmsg-timeout.gen.test delete mode 100755 tests/recvmmsg-timeout.test create mode 100755 tests/recvmsg.gen.test delete mode 100755 tests/recvmsg.test create mode 100755 tests/regex.gen.test create mode 100755 tests/regex.in create mode 100644 tests/remap_file_pages-Xabbrev.c create mode 100755 tests/remap_file_pages-Xabbrev.gen.test create mode 100644 tests/remap_file_pages-Xraw.c create mode 100755 tests/remap_file_pages-Xraw.gen.test create mode 100644 tests/remap_file_pages-Xverbose.c create mode 100755 tests/remap_file_pages-Xverbose.gen.test create mode 100755 tests/remap_file_pages.gen.test delete mode 100755 tests/remap_file_pages.test create mode 100755 tests/rename.gen.test delete mode 100755 tests/rename.test create mode 100755 tests/renameat.gen.test delete mode 100755 tests/renameat.test create mode 100755 tests/renameat2.gen.test delete mode 100755 tests/renameat2.test create mode 100755 tests/request_key.gen.test delete mode 100755 tests/request_key.test create mode 100644 tests/riscv_flush_icache.c create mode 100755 tests/riscv_flush_icache.gen.test create mode 100755 tests/rmdir.gen.test delete mode 100755 tests/rmdir.test create mode 100644 tests/rt_sigaction.awk create mode 100644 tests/rt_sigaction.c create mode 100755 tests/rt_sigaction.test create mode 100755 tests/rt_sigpending.gen.test delete mode 100755 tests/rt_sigpending.test create mode 100755 tests/rt_sigprocmask.gen.test delete mode 100755 tests/rt_sigprocmask.test create mode 100755 tests/rt_sigqueueinfo.gen.test delete mode 100755 tests/rt_sigqueueinfo.test create mode 100644 tests/rt_sigreturn.c create mode 100755 tests/rt_sigreturn.gen.test create mode 100755 tests/rt_sigsuspend.gen.test delete mode 100755 tests/rt_sigsuspend.test create mode 100755 tests/rt_sigtimedwait.gen.test delete mode 100755 tests/rt_sigtimedwait.test create mode 100755 tests/rt_tgsigqueueinfo.gen.test delete mode 100755 tests/rt_tgsigqueueinfo.test create mode 100644 tests/run_expect_termsig.c create mode 100644 tests/s390_guarded_storage-v.c create mode 100755 tests/s390_guarded_storage-v.gen.test create mode 100644 tests/s390_guarded_storage.c create mode 100755 tests/s390_guarded_storage.gen.test create mode 100644 tests/s390_pci_mmio_read_write.c create mode 100755 tests/s390_pci_mmio_read_write.gen.test create mode 100644 tests/s390_runtime_instr.c create mode 100755 tests/s390_runtime_instr.gen.test create mode 100644 tests/s390_sthyi-v.c create mode 100755 tests/s390_sthyi-v.gen.test create mode 100644 tests/s390_sthyi.c create mode 100755 tests/s390_sthyi.gen.test create mode 100755 tests/sched.gen.test create mode 100755 tests/sched.in create mode 100755 tests/sched_get_priority_mxx.gen.test delete mode 100755 tests/sched_get_priority_mxx.test create mode 100755 tests/sched_rr_get_interval.gen.test delete mode 100755 tests/sched_rr_get_interval.test create mode 100755 tests/sched_xetaffinity.gen.test delete mode 100755 tests/sched_xetaffinity.test create mode 100755 tests/sched_xetattr.gen.test delete mode 100755 tests/sched_xetattr.test create mode 100755 tests/sched_xetparam.gen.test delete mode 100755 tests/sched_xetparam.test create mode 100755 tests/sched_xetscheduler.gen.test delete mode 100755 tests/sched_xetscheduler.test create mode 100755 tests/sched_yield.gen.test delete mode 100755 tests/sched_yield.test create mode 100755 tests/seccomp-filter-v.gen.test delete mode 100755 tests/seccomp-filter-v.test create mode 100755 tests/seccomp-filter.gen.test delete mode 100755 tests/seccomp-filter.test create mode 100644 tests/seccomp_get_action_avail.c create mode 100755 tests/seccomp_get_action_avail.gen.test create mode 100644 tests/select-P.c create mode 100755 tests/select-P.gen.test create mode 100755 tests/select.gen.test delete mode 100755 tests/select.test create mode 100755 tests/semop.gen.test delete mode 100755 tests/semop.test create mode 100755 tests/sendfile.gen.test delete mode 100755 tests/sendfile.test create mode 100755 tests/sendfile64.gen.test delete mode 100755 tests/sendfile64.test create mode 100755 tests/set_mempolicy.gen.test delete mode 100755 tests/set_mempolicy.test create mode 100644 tests/set_sigblock.c create mode 100644 tests/set_sigign.c create mode 100755 tests/setdomainname.gen.test delete mode 100755 tests/setdomainname.test create mode 100755 tests/setfsgid.gen.test delete mode 100755 tests/setfsgid.test create mode 100755 tests/setfsgid32.gen.test delete mode 100755 tests/setfsgid32.test create mode 100755 tests/setfsuid.gen.test delete mode 100755 tests/setfsuid.test create mode 100755 tests/setfsuid32.gen.test delete mode 100755 tests/setfsuid32.test create mode 100755 tests/setgid.gen.test delete mode 100755 tests/setgid.test create mode 100755 tests/setgid32.gen.test delete mode 100755 tests/setgid32.test create mode 100755 tests/setgroups.gen.test delete mode 100755 tests/setgroups.test create mode 100755 tests/setgroups32.gen.test delete mode 100755 tests/setgroups32.test create mode 100755 tests/sethostname.gen.test delete mode 100755 tests/sethostname.test create mode 100755 tests/setns.gen.test delete mode 100755 tests/setns.test create mode 100755 tests/setregid.gen.test delete mode 100755 tests/setregid.test create mode 100755 tests/setregid32.gen.test delete mode 100755 tests/setregid32.test create mode 100755 tests/setresgid.gen.test delete mode 100755 tests/setresgid.test create mode 100755 tests/setresgid32.gen.test delete mode 100755 tests/setresgid32.test create mode 100755 tests/setresuid.gen.test delete mode 100755 tests/setresuid.test create mode 100755 tests/setresuid32.gen.test delete mode 100755 tests/setresuid32.test create mode 100755 tests/setreuid.gen.test delete mode 100755 tests/setreuid.test create mode 100755 tests/setreuid32.gen.test delete mode 100755 tests/setreuid32.test create mode 100644 tests/setrlimit-Xabbrev.c create mode 100755 tests/setrlimit-Xabbrev.gen.test create mode 100644 tests/setrlimit-Xraw.c create mode 100755 tests/setrlimit-Xraw.gen.test create mode 100644 tests/setrlimit-Xverbose.c create mode 100755 tests/setrlimit-Xverbose.gen.test create mode 100755 tests/setrlimit.gen.test delete mode 100755 tests/setrlimit.test create mode 100755 tests/setuid.gen.test delete mode 100755 tests/setuid.test create mode 100755 tests/setuid32.gen.test delete mode 100755 tests/setuid32.test create mode 100755 tests/shmxt.gen.test delete mode 100755 tests/shmxt.test create mode 100755 tests/shutdown.gen.test delete mode 100755 tests/shutdown.test delete mode 100644 tests/sigaction.awk create mode 100755 tests/sigaction.gen.test delete mode 100755 tests/sigaction.test create mode 100755 tests/sigblock.test create mode 100755 tests/sigign.test create mode 100755 tests/siginfo.gen.test delete mode 100755 tests/siginfo.test create mode 100644 tests/signal.c create mode 100755 tests/signal.gen.test create mode 100755 tests/signal_receive.gen.test delete mode 100755 tests/signal_receive.test create mode 100755 tests/signalfd4.gen.test delete mode 100755 tests/signalfd4.test create mode 100644 tests/sigpending.c create mode 100755 tests/sigpending.gen.test create mode 100644 tests/sigprocmask.c create mode 100755 tests/sigprocmask.gen.test create mode 100755 tests/sigreturn.gen.test delete mode 100755 tests/sigreturn.test create mode 100644 tests/sigsuspend.c create mode 100755 tests/sigsuspend.gen.test create mode 100644 tests/skip_unavailable.c create mode 100644 tests/so_error.c create mode 100755 tests/so_error.gen.test create mode 100644 tests/so_linger.c create mode 100755 tests/so_linger.gen.test create mode 100644 tests/so_peercred-Xabbrev.c create mode 100755 tests/so_peercred-Xabbrev.gen.test create mode 100644 tests/so_peercred-Xraw.c create mode 100755 tests/so_peercred-Xraw.gen.test create mode 100644 tests/so_peercred-Xverbose.c create mode 100755 tests/so_peercred-Xverbose.gen.test create mode 100644 tests/so_peercred.c create mode 100755 tests/so_peercred.gen.test create mode 100644 tests/sock_filter-v-Xabbrev.c create mode 100755 tests/sock_filter-v-Xabbrev.gen.test create mode 100644 tests/sock_filter-v-Xraw.c create mode 100755 tests/sock_filter-v-Xraw.gen.test create mode 100644 tests/sock_filter-v-Xverbose.c create mode 100755 tests/sock_filter-v-Xverbose.gen.test create mode 100644 tests/sock_filter-v.c create mode 100755 tests/sock_filter-v.gen.test create mode 100644 tests/sockaddr_xlat-Xabbrev.c create mode 100755 tests/sockaddr_xlat-Xabbrev.gen.test create mode 100644 tests/sockaddr_xlat-Xraw.c create mode 100755 tests/sockaddr_xlat-Xraw.gen.test create mode 100644 tests/sockaddr_xlat-Xverbose.c create mode 100755 tests/sockaddr_xlat-Xverbose.gen.test create mode 100644 tests/sockaddr_xlat.c create mode 100755 tests/socketcall.gen.test delete mode 100755 tests/socketcall.test create mode 100644 tests/sockopt-sol_netlink.c create mode 100755 tests/sockopt-sol_netlink.gen.test create mode 100644 tests/sockopt-timestamp.c create mode 100755 tests/sockopt-timestamp.gen.test create mode 100755 tests/splice.gen.test delete mode 100755 tests/splice.test create mode 100644 tests/stack-fcall-mangled-0.c create mode 100644 tests/stack-fcall-mangled-1.c create mode 100644 tests/stack-fcall-mangled-2.c create mode 100644 tests/stack-fcall-mangled-3.c create mode 100644 tests/stack-fcall-mangled.c create mode 100644 tests/stack-fcall.h create mode 100755 tests/stat.gen.test delete mode 100755 tests/stat.test create mode 100755 tests/stat64.gen.test delete mode 100755 tests/stat64.test delete mode 100644 tests/statfs.expected create mode 100755 tests/statfs.gen.test delete mode 100755 tests/statfs.test create mode 100755 tests/statfs64.gen.test delete mode 100755 tests/statfs64.test create mode 100644 tests/statx.c create mode 100755 tests/statx.gen.test delete mode 100755 tests/statx.sh create mode 100644 tests/strace-k-demangle.expected create mode 100755 tests/strace-k-demangle.test create mode 100644 tests/strace-k.expected create mode 100755 tests/strace-log-merge-error.test create mode 100755 tests/strace-log-merge-suffix.test delete mode 100644 tests/struct_flock.c create mode 100755 tests/swap.gen.test delete mode 100755 tests/swap.test create mode 100644 tests/sxetmask.c create mode 100755 tests/sxetmask.gen.test create mode 100755 tests/symlink.gen.test delete mode 100755 tests/symlink.test create mode 100755 tests/symlinkat.gen.test delete mode 100755 tests/symlinkat.test create mode 100755 tests/sync.gen.test delete mode 100755 tests/sync.test create mode 100755 tests/sync_file_range.gen.test delete mode 100755 tests/sync_file_range.test create mode 100755 tests/sync_file_range2.gen.test delete mode 100755 tests/sync_file_range2.test create mode 100644 tests/syntax.sh create mode 100755 tests/sysinfo.gen.test delete mode 100755 tests/sysinfo.test create mode 100755 tests/syslog.gen.test delete mode 100755 tests/syslog.test create mode 100755 tests/tee.gen.test delete mode 100755 tests/tee.test create mode 100755 tests/termsig.test create mode 100644 tests/test_netlink.h create mode 100644 tests/test_nlattr.h create mode 100644 tests/test_printpath.c create mode 100644 tests/test_printstrn.c create mode 100644 tests/test_ucopy.c create mode 100644 tests/test_ucopy.h create mode 100755 tests/time.gen.test delete mode 100755 tests/time.test create mode 100755 tests/timer_create.gen.test delete mode 100755 tests/timer_create.test create mode 100755 tests/timer_xettime.gen.test delete mode 100755 tests/timer_xettime.test create mode 100755 tests/timerfd_xettime.gen.test delete mode 100755 tests/timerfd_xettime.test create mode 100755 tests/times-fail.gen.test delete mode 100755 tests/times-fail.test create mode 100755 tests/times.gen.test delete mode 100755 tests/times.test create mode 100755 tests/trace_fstat.gen.test create mode 100644 tests/trace_fstat.in create mode 100755 tests/trace_fstatfs.gen.test create mode 100644 tests/trace_fstatfs.in create mode 100755 tests/trace_lstat.gen.test create mode 100644 tests/trace_lstat.in create mode 100755 tests/trace_personality_32.gen.test create mode 100644 tests/trace_personality_32.in create mode 100755 tests/trace_personality_64.gen.test create mode 100644 tests/trace_personality_64.in create mode 100755 tests/trace_personality_regex_32.gen.test create mode 100755 tests/trace_personality_regex_32.in create mode 100755 tests/trace_personality_regex_64.gen.test create mode 100755 tests/trace_personality_regex_64.in create mode 100755 tests/trace_personality_regex_x32.gen.test create mode 100755 tests/trace_personality_regex_x32.in create mode 100755 tests/trace_personality_x32.gen.test create mode 100644 tests/trace_personality_x32.in create mode 100755 tests/trace_question.gen.test create mode 100644 tests/trace_question.in create mode 100755 tests/trace_stat.gen.test create mode 100644 tests/trace_stat.in create mode 100755 tests/trace_stat_like.gen.test create mode 100644 tests/trace_stat_like.in create mode 100755 tests/trace_statfs.gen.test create mode 100644 tests/trace_statfs.in create mode 100755 tests/trace_statfs_like.gen.test create mode 100644 tests/trace_statfs_like.in create mode 100755 tests/truncate.gen.test delete mode 100755 tests/truncate.test create mode 100755 tests/truncate64.gen.test delete mode 100755 tests/truncate64.test create mode 100755 tests/ugetrlimit.gen.test delete mode 100755 tests/ugetrlimit.test create mode 100755 tests/umask.gen.test delete mode 100755 tests/umask.test create mode 100755 tests/umoven-illptr.gen.test delete mode 100755 tests/umoven-illptr.test create mode 100755 tests/umovestr-illptr.gen.test delete mode 100755 tests/umovestr-illptr.test create mode 100755 tests/umovestr3.gen.test delete mode 100755 tests/umovestr3.test create mode 100644 tests/unblock_reset_raise.c create mode 100755 tests/unlink.gen.test delete mode 100755 tests/unlink.test create mode 100755 tests/unlinkat.gen.test delete mode 100755 tests/unlinkat.test create mode 100755 tests/unshare.gen.test delete mode 100755 tests/unshare.test create mode 100755 tests/userfaultfd.gen.test delete mode 100755 tests/userfaultfd.test create mode 100755 tests/ustat.gen.test delete mode 100755 tests/ustat.test create mode 100755 tests/utime.gen.test delete mode 100755 tests/utime.test create mode 100644 tests/utimensat-Xabbrev.c create mode 100755 tests/utimensat-Xabbrev.gen.test create mode 100644 tests/utimensat-Xraw.c create mode 100755 tests/utimensat-Xraw.gen.test create mode 100644 tests/utimensat-Xverbose.c create mode 100755 tests/utimensat-Xverbose.gen.test create mode 100755 tests/utimensat.gen.test delete mode 100755 tests/utimensat.test create mode 100755 tests/utimes.gen.test delete mode 100755 tests/utimes.test create mode 100755 tests/vfork-f.gen.test delete mode 100755 tests/vfork-f.test create mode 100755 tests/vhangup.gen.test delete mode 100755 tests/vhangup.test create mode 100755 tests/vmsplice.gen.test delete mode 100755 tests/vmsplice.test create mode 100755 tests/wait4-v.gen.test delete mode 100755 tests/wait4-v.test create mode 100755 tests/wait4.gen.test delete mode 100755 tests/wait4.test create mode 100755 tests/waitid-v.gen.test delete mode 100755 tests/waitid-v.test create mode 100755 tests/waitid.gen.test delete mode 100755 tests/waitid.test create mode 100755 tests/waitpid.gen.test delete mode 100755 tests/waitpid.test create mode 100755 tests/xattr-strings.gen.test delete mode 100755 tests/xattr-strings.test create mode 100755 tests/xattr.gen.test delete mode 100755 tests/xattr.test create mode 100755 tests/xet_robust_list.gen.test delete mode 100755 tests/xet_robust_list.test create mode 100644 tests/xet_thread_area_x86.c create mode 100755 tests/xet_thread_area_x86.test create mode 100755 tests/xetitimer.gen.test delete mode 100755 tests/xetitimer.test create mode 100755 tests/xetpgid.gen.test delete mode 100755 tests/xetpgid.test create mode 100755 tests/xetpriority.gen.test delete mode 100755 tests/xetpriority.test create mode 100755 tests/xettimeofday.gen.test delete mode 100755 tests/xettimeofday.test create mode 100644 tests/xutimes.c create mode 100644 tests/zeroargc.c create mode 100644 trace_event.h create mode 100644 ucopy.c create mode 100644 unwind-libdw.c create mode 100644 unwind-libunwind.c create mode 100644 unwind.h create mode 100644 wait.h create mode 100644 xfs_quota_stat.h create mode 100644 xlat.c delete mode 100644 xlat/aclipc.h delete mode 100644 xlat/aclipc.in create mode 100644 xlat/af_packet_versions.h create mode 100644 xlat/af_packet_versions.in create mode 100644 xlat/aio_cmds.h create mode 100644 xlat/aio_cmds.in create mode 100644 xlat/at_statx_sync_types.h create mode 100644 xlat/at_statx_sync_types.in create mode 100644 xlat/ax25_protocols.h create mode 100644 xlat/ax25_protocols.in create mode 100644 xlat/bdaddr_types.h create mode 100644 xlat/bdaddr_types.in create mode 100644 xlat/block_ioctl_cmds.h create mode 100644 xlat/block_ioctl_cmds.in create mode 100644 xlat/bluetooth_l2_cid.h create mode 100644 xlat/bluetooth_l2_cid.in create mode 100644 xlat/bluetooth_l2_psm.h create mode 100644 xlat/bluetooth_l2_psm.in create mode 100644 xlat/bpf_attach_flags.h create mode 100644 xlat/bpf_attach_flags.in create mode 100644 xlat/bpf_file_mode_flags.h create mode 100644 xlat/bpf_file_mode_flags.in create mode 100644 xlat/bpf_map_flags.h create mode 100644 xlat/bpf_map_flags.in create mode 100644 xlat/bpf_prog_flags.h create mode 100644 xlat/bpf_prog_flags.in create mode 100644 xlat/bpf_query_flags.h create mode 100644 xlat/bpf_query_flags.in create mode 100644 xlat/bpf_task_fd_type.h create mode 100644 xlat/bpf_task_fd_type.in create mode 100644 xlat/btrfs_cont_reading_from_srcdev_mode.h create mode 100644 xlat/btrfs_cont_reading_from_srcdev_mode.in create mode 100644 xlat/btrfs_logical_ino_args_flags.h create mode 100644 xlat/btrfs_logical_ino_args_flags.in create mode 100644 xlat/caif_protocols.h create mode 100644 xlat/caif_protocols.in create mode 100644 xlat/can_protocols.h create mode 100644 xlat/can_protocols.in create mode 100644 xlat/crypto_nl_attrs.h create mode 100644 xlat/crypto_nl_attrs.in create mode 100644 xlat/dcb_commands.h create mode 100644 xlat/dcb_commands.in create mode 100644 xlat/ebpf_class.h create mode 100644 xlat/ebpf_class.in create mode 100644 xlat/ebpf_mode.h create mode 100644 xlat/ebpf_mode.in create mode 100644 xlat/ebpf_op_alu.h create mode 100644 xlat/ebpf_op_alu.in create mode 100644 xlat/ebpf_op_jmp.h create mode 100644 xlat/ebpf_op_jmp.in create mode 100644 xlat/ebpf_regs.h create mode 100644 xlat/ebpf_regs.in create mode 100644 xlat/ebpf_size.h create mode 100644 xlat/ebpf_size.in delete mode 100644 xlat/evdev_sync.h delete mode 100644 xlat/evdev_sync.in delete mode 100644 xlat/fcntl64cmds.h delete mode 100644 xlat/fcntl64cmds.in create mode 100644 xlat/fib_rule_actions.h create mode 100644 xlat/fib_rule_actions.in create mode 100644 xlat/fib_rule_flags.h create mode 100644 xlat/fib_rule_flags.in create mode 100644 xlat/futexbitset.h create mode 100644 xlat/futexbitset.in create mode 100644 xlat/getsock_ip_options.h create mode 100644 xlat/getsock_ip_options.in create mode 100644 xlat/getsock_ipv6_options.h create mode 100644 xlat/getsock_ipv6_options.in create mode 100644 xlat/getsock_options.h create mode 100644 xlat/getsock_options.in delete mode 100644 xlat/getsockipoptions.h delete mode 100644 xlat/getsockipoptions.in delete mode 100644 xlat/getsockipv6options.h delete mode 100644 xlat/getsockipv6options.in create mode 100644 xlat/ifaddrflags.h create mode 100644 xlat/ifaddrflags.in create mode 100644 xlat/in6_addr_gen_mode.h create mode 100644 xlat/in6_addr_gen_mode.in create mode 100644 xlat/inet6_devconf_indices.h create mode 100644 xlat/inet6_devconf_indices.in create mode 100644 xlat/inet6_if_flags.h create mode 100644 xlat/inet6_if_flags.in create mode 100644 xlat/inet_devconf_indices.h create mode 100644 xlat/inet_devconf_indices.in create mode 100644 xlat/inet_diag_attrs.h create mode 100644 xlat/inet_diag_attrs.in create mode 100644 xlat/inet_diag_bytecodes.h create mode 100644 xlat/inet_diag_bytecodes.in create mode 100644 xlat/inet_diag_extended_flags.h create mode 100644 xlat/inet_diag_extended_flags.in create mode 100644 xlat/inet_diag_req_attrs.h create mode 100644 xlat/inet_diag_req_attrs.in create mode 100644 xlat/ip_type_of_services.h create mode 100644 xlat/ip_type_of_services.in create mode 100644 xlat/ipc_private.h create mode 100644 xlat/ipc_private.in create mode 100644 xlat/irda_protocols.h create mode 100644 xlat/irda_protocols.in create mode 100644 xlat/isdn_protocols.h create mode 100644 xlat/isdn_protocols.in create mode 100644 xlat/kcm_protocols.h create mode 100644 xlat/kcm_protocols.in create mode 100644 xlat/kvm_cap.h create mode 100644 xlat/kvm_cap.in create mode 100644 xlat/kvm_cpuid_flags.h create mode 100644 xlat/kvm_cpuid_flags.in create mode 100644 xlat/kvm_exit_reason.h create mode 100644 xlat/kvm_exit_reason.in create mode 100644 xlat/kvm_mem_flags.h create mode 100644 xlat/kvm_mem_flags.in create mode 100644 xlat/lwtunnel_encap_types.h create mode 100644 xlat/lwtunnel_encap_types.in create mode 100644 xlat/mdb_flags.h create mode 100644 xlat/mdb_flags.in create mode 100644 xlat/mdb_states.h create mode 100644 xlat/mdb_states.in create mode 100644 xlat/multicast_router_types.h create mode 100644 xlat/multicast_router_types.in create mode 100644 xlat/nbd_ioctl_cmds.h create mode 100644 xlat/nbd_ioctl_cmds.in create mode 100644 xlat/nbd_ioctl_flags.h create mode 100644 xlat/nbd_ioctl_flags.in create mode 100644 xlat/neighbor_cache_entry_flags.h create mode 100644 xlat/neighbor_cache_entry_flags.in create mode 100644 xlat/neighbor_cache_entry_states.h create mode 100644 xlat/neighbor_cache_entry_states.in create mode 100644 xlat/netfilter_versions.h create mode 100644 xlat/netfilter_versions.in create mode 100644 xlat/netlink_ack_flags.h create mode 100644 xlat/netlink_ack_flags.in create mode 100644 xlat/netlink_delete_flags.h create mode 100644 xlat/netlink_delete_flags.in create mode 100644 xlat/netlink_diag_attrs.h create mode 100644 xlat/netlink_diag_attrs.in create mode 100644 xlat/netlink_diag_show.h create mode 100644 xlat/netlink_diag_show.in create mode 100644 xlat/netlink_get_flags.h create mode 100644 xlat/netlink_get_flags.in create mode 100644 xlat/netlink_new_flags.h create mode 100644 xlat/netlink_new_flags.in create mode 100644 xlat/netlink_sk_meminfo_indices.h create mode 100644 xlat/netlink_sk_meminfo_indices.in create mode 100644 xlat/netlink_socket_flags.h create mode 100644 xlat/netlink_socket_flags.in create mode 100644 xlat/netlink_states.h create mode 100644 xlat/netlink_states.in create mode 100644 xlat/nf_acct_msg_types.h create mode 100644 xlat/nf_acct_msg_types.in create mode 100644 xlat/nf_cthelper_msg_types.h create mode 100644 xlat/nf_cthelper_msg_types.in create mode 100644 xlat/nf_ctnetlink_exp_msg_types.h create mode 100644 xlat/nf_ctnetlink_exp_msg_types.in create mode 100644 xlat/nf_ctnetlink_msg_types.h create mode 100644 xlat/nf_ctnetlink_msg_types.in create mode 100644 xlat/nf_cttimeout_msg_types.h create mode 100644 xlat/nf_cttimeout_msg_types.in create mode 100644 xlat/nf_ipset_msg_types.h create mode 100644 xlat/nf_ipset_msg_types.in create mode 100644 xlat/nf_nft_compat_msg_types.h create mode 100644 xlat/nf_nft_compat_msg_types.in create mode 100644 xlat/nf_nftables_msg_types.h create mode 100644 xlat/nf_nftables_msg_types.in create mode 100644 xlat/nf_osf_msg_types.h create mode 100644 xlat/nf_osf_msg_types.in create mode 100644 xlat/nf_queue_msg_types.h create mode 100644 xlat/nf_queue_msg_types.in create mode 100644 xlat/nf_ulog_msg_types.h create mode 100644 xlat/nf_ulog_msg_types.in create mode 100644 xlat/nfc_protocols.h create mode 100644 xlat/nfc_protocols.in create mode 100644 xlat/nl_audit_types.h create mode 100644 xlat/nl_audit_types.in create mode 100644 xlat/nl_crypto_types.h create mode 100644 xlat/nl_crypto_types.in create mode 100644 xlat/nl_netfilter_msg_types.h create mode 100644 xlat/nl_netfilter_msg_types.in create mode 100644 xlat/nl_netfilter_subsys_ids.h create mode 100644 xlat/nl_netfilter_subsys_ids.in create mode 100644 xlat/nl_route_types.h create mode 100644 xlat/nl_route_types.in create mode 100644 xlat/nl_selinux_types.h create mode 100644 xlat/nl_selinux_types.in create mode 100644 xlat/nl_sock_diag_types.h create mode 100644 xlat/nl_sock_diag_types.in create mode 100644 xlat/nl_xfrm_types.h create mode 100644 xlat/nl_xfrm_types.in create mode 100644 xlat/nlmsgerr_attrs.h create mode 100644 xlat/nlmsgerr_attrs.in create mode 100644 xlat/numa_node.h create mode 100644 xlat/numa_node.in delete mode 100644 xlat/openmodessol.h delete mode 100644 xlat/openmodessol.in create mode 100644 xlat/packet_diag_attrs.h create mode 100644 xlat/packet_diag_attrs.in create mode 100644 xlat/packet_diag_info_flags.h create mode 100644 xlat/packet_diag_info_flags.in create mode 100644 xlat/packet_diag_show.h create mode 100644 xlat/packet_diag_show.in create mode 100644 xlat/perf_ioctl_cmds.h create mode 100644 xlat/perf_ioctl_cmds.in create mode 100644 xlat/perf_ioctl_flags.h create mode 100644 xlat/perf_ioctl_flags.in create mode 100644 xlat/phonet_protocols.h create mode 100644 xlat/phonet_protocols.in create mode 100644 xlat/pr_spec_cmds.h create mode 100644 xlat/pr_spec_cmds.in create mode 100644 xlat/pr_spec_get_store_bypass_flags.h create mode 100644 xlat/pr_spec_get_store_bypass_flags.in create mode 100644 xlat/pr_spec_set_store_bypass_flags.h create mode 100644 xlat/pr_spec_set_store_bypass_flags.in create mode 100644 xlat/pr_sve_vl_flags.h create mode 100644 xlat/pr_sve_vl_flags.in create mode 100644 xlat/ptrace_syscall_info_op.h create mode 100644 xlat/ptrace_syscall_info_op.in create mode 100644 xlat/random_ioctl_cmds.h create mode 100644 xlat/random_ioctl_cmds.in create mode 100644 xlat/riscv_flush_icache_flags.h create mode 100644 xlat/riscv_flush_icache_flags.in create mode 100644 xlat/route_nexthop_flags.h create mode 100644 xlat/route_nexthop_flags.in create mode 100644 xlat/routing_flags.h create mode 100644 xlat/routing_flags.in create mode 100644 xlat/routing_protocols.h create mode 100644 xlat/routing_protocols.in create mode 100644 xlat/routing_scopes.h create mode 100644 xlat/routing_scopes.in create mode 100644 xlat/routing_table_ids.h create mode 100644 xlat/routing_table_ids.in create mode 100644 xlat/routing_types.h create mode 100644 xlat/routing_types.in create mode 100644 xlat/rtnl_addr_attrs.h create mode 100644 xlat/rtnl_addr_attrs.in create mode 100644 xlat/rtnl_addrlabel_attrs.h create mode 100644 xlat/rtnl_addrlabel_attrs.in create mode 100644 xlat/rtnl_dcb_attrs.h create mode 100644 xlat/rtnl_dcb_attrs.in create mode 100644 xlat/rtnl_ifla_af_spec_inet6_attrs.h create mode 100644 xlat/rtnl_ifla_af_spec_inet6_attrs.in create mode 100644 xlat/rtnl_ifla_af_spec_inet_attrs.h create mode 100644 xlat/rtnl_ifla_af_spec_inet_attrs.in create mode 100644 xlat/rtnl_ifla_brport_attrs.h create mode 100644 xlat/rtnl_ifla_brport_attrs.in create mode 100644 xlat/rtnl_ifla_events.h create mode 100644 xlat/rtnl_ifla_events.in create mode 100644 xlat/rtnl_ifla_info_attrs.h create mode 100644 xlat/rtnl_ifla_info_attrs.in create mode 100644 xlat/rtnl_ifla_info_data_bridge_attrs.h create mode 100644 xlat/rtnl_ifla_info_data_bridge_attrs.in create mode 100644 xlat/rtnl_ifla_info_data_tun_attrs.h create mode 100644 xlat/rtnl_ifla_info_data_tun_attrs.in create mode 100644 xlat/rtnl_ifla_port_attrs.h create mode 100644 xlat/rtnl_ifla_port_attrs.in create mode 100644 xlat/rtnl_ifla_vf_port_attrs.h create mode 100644 xlat/rtnl_ifla_vf_port_attrs.in create mode 100644 xlat/rtnl_ifla_xdp_attached_mode.h create mode 100644 xlat/rtnl_ifla_xdp_attached_mode.in create mode 100644 xlat/rtnl_ifla_xdp_attrs.h create mode 100644 xlat/rtnl_ifla_xdp_attrs.in create mode 100644 xlat/rtnl_link_attrs.h create mode 100644 xlat/rtnl_link_attrs.in create mode 100644 xlat/rtnl_mdb_attrs.h create mode 100644 xlat/rtnl_mdb_attrs.in create mode 100644 xlat/rtnl_mdba_mdb_attrs.h create mode 100644 xlat/rtnl_mdba_mdb_attrs.in create mode 100644 xlat/rtnl_mdba_mdb_eattr_attrs.h create mode 100644 xlat/rtnl_mdba_mdb_eattr_attrs.in create mode 100644 xlat/rtnl_mdba_mdb_entry_attrs.h create mode 100644 xlat/rtnl_mdba_mdb_entry_attrs.in create mode 100644 xlat/rtnl_mdba_router_attrs.h create mode 100644 xlat/rtnl_mdba_router_attrs.in create mode 100644 xlat/rtnl_mdba_router_pattr_attrs.h create mode 100644 xlat/rtnl_mdba_router_pattr_attrs.in create mode 100644 xlat/rtnl_neigh_attrs.h create mode 100644 xlat/rtnl_neigh_attrs.in create mode 100644 xlat/rtnl_neightbl_attrs.h create mode 100644 xlat/rtnl_neightbl_attrs.in create mode 100644 xlat/rtnl_neightbl_parms_attrs.h create mode 100644 xlat/rtnl_neightbl_parms_attrs.in create mode 100644 xlat/rtnl_netconf_attrs.h create mode 100644 xlat/rtnl_netconf_attrs.in create mode 100644 xlat/rtnl_nsid_attrs.h create mode 100644 xlat/rtnl_nsid_attrs.in create mode 100644 xlat/rtnl_route_attrs.h create mode 100644 xlat/rtnl_route_attrs.in create mode 100644 xlat/rtnl_rta_metrics_attrs.h create mode 100644 xlat/rtnl_rta_metrics_attrs.in create mode 100644 xlat/rtnl_rule_attrs.h create mode 100644 xlat/rtnl_rule_attrs.in create mode 100644 xlat/rtnl_tc_action_attrs.h create mode 100644 xlat/rtnl_tc_action_attrs.in create mode 100644 xlat/rtnl_tc_attrs.h create mode 100644 xlat/rtnl_tc_attrs.in create mode 100644 xlat/rtnl_tca_stab_attrs.h create mode 100644 xlat/rtnl_tca_stab_attrs.in create mode 100644 xlat/rtnl_tca_stats_attrs.h create mode 100644 xlat/rtnl_tca_stats_attrs.in create mode 100644 xlat/s390_guarded_storage_commands.h create mode 100644 xlat/s390_guarded_storage_commands.in create mode 100644 xlat/s390_runtime_instr_commands.h create mode 100644 xlat/s390_runtime_instr_commands.in create mode 100644 xlat/s390_sthyi_function_codes.h create mode 100644 xlat/s390_sthyi_function_codes.in create mode 100644 xlat/setsock_ip_options.h create mode 100644 xlat/setsock_ip_options.in create mode 100644 xlat/setsock_ipv6_options.h create mode 100644 xlat/setsock_ipv6_options.in create mode 100644 xlat/setsock_options.h create mode 100644 xlat/setsock_options.in delete mode 100644 xlat/setsockipoptions.h delete mode 100644 xlat/setsockipoptions.in delete mode 100644 xlat/setsockipv6options.h delete mode 100644 xlat/setsockipv6options.in create mode 100644 xlat/skf_ad.h create mode 100644 xlat/skf_ad.in create mode 100644 xlat/skf_off.h create mode 100644 xlat/skf_off.in create mode 100644 xlat/smc_decl_codes.h create mode 100644 xlat/smc_decl_codes.in create mode 100644 xlat/smc_diag_attrs.h create mode 100644 xlat/smc_diag_attrs.in create mode 100644 xlat/smc_diag_extended_flags.h create mode 100644 xlat/smc_diag_extended_flags.in create mode 100644 xlat/smc_diag_mode.h create mode 100644 xlat/smc_diag_mode.in create mode 100644 xlat/smc_link_group_roles.h create mode 100644 xlat/smc_link_group_roles.in create mode 100644 xlat/smc_protocols.h create mode 100644 xlat/smc_protocols.in create mode 100644 xlat/smc_states.h create mode 100644 xlat/smc_states.in create mode 100644 xlat/snmp_icmp6_stats.h create mode 100644 xlat/snmp_icmp6_stats.in create mode 100644 xlat/snmp_ip_stats.h create mode 100644 xlat/snmp_ip_stats.in create mode 100644 xlat/sock_alg_options.h create mode 100644 xlat/sock_alg_options.in create mode 100644 xlat/sock_ax25_options.h create mode 100644 xlat/sock_ax25_options.in create mode 100644 xlat/sock_bluetooth_options.h create mode 100644 xlat/sock_bluetooth_options.in create mode 100644 xlat/sock_caif_options.h create mode 100644 xlat/sock_caif_options.in create mode 100644 xlat/sock_dccp_options.h create mode 100644 xlat/sock_dccp_options.in create mode 100644 xlat/sock_ip_options.h rename xlat/{sockipoptions.in => sock_ip_options.in} (100%) create mode 100644 xlat/sock_ipv6_options.h create mode 100644 xlat/sock_ipv6_options.in create mode 100644 xlat/sock_ipx_options.h rename xlat/{sockipxoptions.in => sock_ipx_options.in} (100%) create mode 100644 xlat/sock_irda_options.h create mode 100644 xlat/sock_irda_options.in create mode 100644 xlat/sock_iucv_options.h create mode 100644 xlat/sock_iucv_options.in create mode 100644 xlat/sock_kcm_options.h create mode 100644 xlat/sock_kcm_options.in create mode 100644 xlat/sock_llc_options.h create mode 100644 xlat/sock_llc_options.in create mode 100644 xlat/sock_netlink_options.h create mode 100644 xlat/sock_netlink_options.in create mode 100644 xlat/sock_nfcllcp_options.h create mode 100644 xlat/sock_nfcllcp_options.in create mode 100644 xlat/sock_options.h create mode 100644 xlat/sock_options.in create mode 100644 xlat/sock_packet_options.h rename xlat/{sockpacketoptions.in => sock_packet_options.in} (100%) create mode 100644 xlat/sock_pnp_options.h create mode 100644 xlat/sock_pnp_options.in create mode 100644 xlat/sock_pppol2tp_options.h create mode 100644 xlat/sock_pppol2tp_options.in create mode 100644 xlat/sock_raw_options.h rename xlat/{sockrawoptions.in => sock_raw_options.in} (100%) create mode 100644 xlat/sock_rds_options.h create mode 100644 xlat/sock_rds_options.in create mode 100644 xlat/sock_rxrpc_options.h create mode 100644 xlat/sock_rxrpc_options.in create mode 100644 xlat/sock_sctp_options.h create mode 100644 xlat/sock_sctp_options.in create mode 100644 xlat/sock_shutdown_flags.h create mode 100644 xlat/sock_shutdown_flags.in create mode 100644 xlat/sock_tcp_options.h create mode 100644 xlat/sock_tcp_options.in create mode 100644 xlat/sock_tipc_options.h create mode 100644 xlat/sock_tipc_options.in create mode 100644 xlat/sock_tls_options.h create mode 100644 xlat/sock_tls_options.in create mode 100644 xlat/sock_udp_options.h create mode 100644 xlat/sock_udp_options.in create mode 100644 xlat/sock_xdp_options.h create mode 100644 xlat/sock_xdp_options.in delete mode 100644 xlat/sockipoptions.h delete mode 100644 xlat/sockipv6options.h delete mode 100644 xlat/sockipv6options.in delete mode 100644 xlat/sockipxoptions.h delete mode 100644 xlat/sockoptions.h delete mode 100644 xlat/sockoptions.in delete mode 100644 xlat/sockpacketoptions.h delete mode 100644 xlat/sockrawoptions.h delete mode 100644 xlat/socksctpoptions.h delete mode 100644 xlat/socksctpoptions.in delete mode 100644 xlat/socktcpoptions.h delete mode 100644 xlat/socktcpoptions.in create mode 100644 xlat/sparc_kern_features.h create mode 100644 xlat/sparc_kern_features.in create mode 100644 xlat/statx_attrs.h create mode 100644 xlat/statx_attrs.in create mode 100644 xlat/statx_masks.h create mode 100644 xlat/statx_masks.in create mode 100644 xlat/tcp_state_flags.h create mode 100644 xlat/tcp_state_flags.in create mode 100644 xlat/tcp_states.h create mode 100644 xlat/tcp_states.in create mode 100644 xlat/tun_device_types.h create mode 100644 xlat/tun_device_types.in create mode 100644 xlat/uffd_api_features.h create mode 100644 xlat/uffd_api_features.in create mode 100644 xlat/unix_diag_attrs.h create mode 100644 xlat/unix_diag_attrs.in create mode 100644 xlat/unix_diag_show.h create mode 100644 xlat/unix_diag_show.in create mode 100644 xlat/uring_enter_flags.h create mode 100644 xlat/uring_enter_flags.in create mode 100644 xlat/uring_register_opcodes.h create mode 100644 xlat/uring_register_opcodes.in create mode 100644 xlat/uring_setup_flags.h create mode 100644 xlat/uring_setup_flags.in create mode 100644 xlat/v4l2_control_id_bases.h create mode 100644 xlat/v4l2_control_id_bases.in create mode 100644 xlat/v4l2_pix_fmts.h create mode 100644 xlat/v4l2_pix_fmts.in create mode 100644 xlat/v4l2_sdr_fmts.h create mode 100644 xlat/v4l2_sdr_fmts.in create mode 100644 xlat/v4l2_sliced_flags.h create mode 100644 xlat/v4l2_sliced_flags.in create mode 100644 xlat/v4l2_tuner_audmodes.h create mode 100644 xlat/v4l2_tuner_audmodes.in create mode 100644 xlat/v4l2_tuner_capabilities.h create mode 100644 xlat/v4l2_tuner_capabilities.in create mode 100644 xlat/v4l2_tuner_rxsubchanses.h create mode 100644 xlat/v4l2_tuner_rxsubchanses.in create mode 100644 xlat/v4l2_tuner_types.h create mode 100644 xlat/v4l2_tuner_types.in create mode 100644 xlat/v4l2_vbi_flags.h create mode 100644 xlat/v4l2_vbi_flags.in create mode 100644 xlat/xdp_flags.h create mode 100644 xlat/xdp_flags.in delete mode 100644 xlate.el create mode 100644 xmalloc.h create mode 100644 xstring.h diff --git a/.strace.1.in.date b/.strace.1.in.date new file mode 100644 index 00000000..53f3c932 --- /dev/null +++ b/.strace.1.in.date @@ -0,0 +1 @@ +2019-03-17 diff --git a/.tarball-version b/.tarball-version index e95590ca..a75b92f1 100644 --- a/.tarball-version +++ b/.tarball-version @@ -1 +1 @@ -4.16 +5.1 diff --git a/.version b/.version index e95590ca..a75b92f1 100644 --- a/.version +++ b/.version @@ -1 +1 @@ -4.16 +5.1 diff --git a/.year b/.year new file mode 100644 index 00000000..80ace6aa --- /dev/null +++ b/.year @@ -0,0 +1 @@ +2019 diff --git a/COPYING b/COPYING index 168a7155..3c57e7f8 100644 --- a/COPYING +++ b/COPYING @@ -3,28 +3,18 @@ Copyright (c) 1993 Branko Lankester Copyright (c) 1993 Ulrich Pegelow Copyright (c) 1995, 1996 Michael Elizabeth Chastain Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey -Copyright (C) 1998-2001 Wichert Akkerman -Copyright (C) 2001-2017 The strace developers. +Copyright (c) 1998-2001 Wichert Akkerman +Copyright (c) 2001-2019 The strace developers. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. +strace is free software; you can redistribute it and/or modify it +under the terms of the GNU Lesser General Public License as published +by the Free Software Foundation; either version 2.1 of the License, +or (at your option) any later version. -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +strace is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See LGPL-2.1-or-later for more details. + +strace test suite is provided under the terms of the GNU General Public License +version 2 or later, see tests/COPYING for more details. diff --git a/CREDITS b/CREDITS index 3bd4be91..179a1320 100644 --- a/CREDITS +++ b/CREDITS @@ -8,57 +8,80 @@ These people have contributed to strace. Some have reported problems, others have contributed improvements to the documentation, actual code, provided information, provided resources, or helped to port strace to new systems. Those contributions are described in the version control logs and ChangeLog-CVS -file. If your name has been left out, if you'd rather not be listed, or if -you'd prefer a different address be used, please send a note to the -strace-devel@lists.sourceforge.net mailing list. +file. If your name has been left out, if you'd rather not be listed, or +if you'd prefer a different address be used, please send a note to the +strace-devel@lists.strace.io mailing list. Aaron Ucko + Abhishek Tiwari Adrien Kunysz + Alexey Brodkin Alexey Neyman Ali Polatel + Anatoly Pugachev Anchit Jain Andi Kleen Andre McCurdy Andreas Schwab + Andrew Guertin + Angelo Castello Anton Blanchard Arkadiusz Miskiewicz + Arturo Borrero Gonzalez Aurelien Jacobs Bai Weidong Bart Van Assche + Baruch Siach Ben Noordhuis Bernhard Reutner-Fischer Bo Kullmar + Bryan Matsuo + Bryce Gibson Cai Fei Carlos O'Donell - Carmelo AMOROSO + Carmelo Amoroso + Chen Jingpiao + Cheolung Lee Chris Dearman + Chris Lamb Chris Metcalf Chris Zankel + Christian Neukirchen Christian Svensson + Christopher Covington D.J. Barrow - Damir Shayhutdinov + DJ Delorie + Damien Profeta + Damir Shayhutdinov Daniel P. Berrange David Daney David Mosberger-Tang + David Robins David S. Miller David Wilder David Woodhouse Denys Vlasenko + Dima Kogan + Dima Krasner Dmitry V. Levin + Dmitry Vyukov Douglas Mencken Dr. David Alan Gilbert Edgar E. Iglesias + Edgar Kaziakhmedov Elliott Hughes - Elvira Khabirova + Elvira Khabirova Erik Johansson Etienne Gemsa Eugene Syromyatnikov + Eugeniy Paltsev Ezequiel Garcia Fabien Siron Fei Jie Felix Janda Fernando Luis Vazquez Cao Florian Lohoff + Fr. Br. George Frederik Schüler Gabor Gombas Gabriel Laskar @@ -68,43 +91,60 @@ strace-devel@lists.sourceforge.net mailing list. Gleb Fotengauer-Malinovskiy Grant Edwards Greg Banks + Guo Ren H.J. Lu + Harald van Dijk + Harsha Sharma Heiko Carstens Helge Deller Henrik Storner Holger Hans Peter Freyther + J. Bruce Fields Jacob Goense Jakub Bogusz Jakub Jelinek + Jamal Hadi Salim James Clarke James Cowgill James Hogan James Yang Jan Kratochvil + Janosch Frank JayRJoshi + Jeff Law Jeff Mahoney Jian Zhen - JingPiao Chen + Jiri Slaby + Joakim Bech Joe Ilacqua + Joe Korty Johannes Stezenbach John Hughes John Spencer - Ju"rgen Fluk - Juergen Weigert + Josef T. Burger + Josh Triplett + Joshua Neal + Jürgen Fluk + Jürgen Weigert Katerina Koukiou Keith Owens Keith Thompson + Khem Raj Kirill A. Shutemov Kyle McMartin Lai JiangShan + Lazar Trsic + Lennart Sorensen Leonard N. Zubkoff + Li Er Linus Torvalds Lubomir Rintel Luca Clementi Lupe Christoph Maarten ter Huurne - Mark Hills + Mark Hills Mark Wielaard + Martin Lau Marty Leisner Masatake YAMATO Matt Day @@ -112,52 +152,71 @@ strace-devel@lists.sourceforge.net mailing list. Max Filippov Maxim Shchetynin Maxin B. John + Md Haris Iqbal + Michael A Fetterman Michael E Chastain Michael Holzheu Michael Shigorin Michail Litvak Michal Ludvig + Michal Simek Mike Frysinger Mike Stroyan Mikulas Patocka + Miroslav Lichvar Muttley Meen - Nahim El Atmani + Nahim El Atmani Namhyung Kim Nate Eldredge Nate Sammons Neil Campbell + Nikolay Marchuk + Orion Poplawski Paolo Bonzini - Patrik Jakobsson + Patrik Jakobsson Paul Mundt Pavel Machek Peter Jones + Peter Zotov + Philipp Marek Philippe De Muyter Philippe Ombredanne + Pierre Marsais Pádraig Brady Quentin Monnet Rajeev V. Pillai Ralf Baechle Randolph Chung + Rasmus Villemoes Reuben Sumner Richard Braakman Richard Henderson Richard Hirst Richard W.M. Jones + Rick Jones + Rishi Bhatt + Robin Hack Roland Borde Roland McGrath + Rolf Eike Beer + Romain Naour Sami Farin + Sandhya Bankar Scott Tsai Sean Stangl Sebastian Pipping Seraphime Kirkovski Sergei Trofimovich + Sergey Bolshakov + Shankara Pailoor Simon Murray Solar Designer Srinivasa Ds Stanislav Brabec Stefan Sørensen Steve Bennett - Steve McIntyre + Steve McIntyre + Steven Honeyman Szabolcs Nagy Thanh Ma Thiemo Seufer @@ -168,16 +227,22 @@ strace-devel@lists.sourceforge.net mailing list. Tom Dyas Tommi Rantala Topi Miettinen + Tuan Hoang Ulrich Drepper Vicente Olivert Riera + Victor Krapivensky Vineet Gupta + Vitaly Chaykovsky Wang Chao + Weichuan Yan Wichert Akkerman - William Manley + William Manley Xiaoning Ding Yang Zhiguo + Yun-Chih Chen Zach Brown Zev Weiss - Zhang Le + Zhang Le + Zhibin Li <08826794brmt@gmail.com> Zubin Mithra Марк Коренберг diff --git a/ChangeLog b/ChangeLog index d0bf7d5b..cc7f2d19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22978 @@ +2019-05-22 Dmitry V. Levin + + Prepare for 5.1 release. + * NEWS: Update for 5.1 release. + + Update copyright headers. + Headers updated automatically using maint/update_copyright_years.sh + script. + +2019-05-22 Eugene Syromyatnikov + + Use xzalloc(sz) instead of xcalloc(1, sz) + * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_OBJ_GET_INFO_BY_FD)): Use xzalloc + instead of xcalloc of one-item-sized array. + * kvm.c (vcpu_alloc): Likewise. + * perf.c (fetch_perf_event_attr): Likewise. + * syscall.c (ptrace_get_scno): Likewise. + +2019-05-22 Eugene Syromyatnikov + + xmalloc: introduce xzalloc. + * xmalloc.h (xmalloc, xcalloc, xreallocarray): Document. + (xzalloc): New function, a thin wrapper around xcalloc with xmalloc + interface. + + Co-Authored-by: Dmitry V. Levin + +2019-05-22 Eugene Syromyatnikov + + Rename the stat struct used internally by strace to strace_stat_t. + * largefile_wrappers.h (struct_stat): Rename to strace_stat_t. + * strace.c (startup_child): Rename struct_stat to strace_stat_t. + * util.c (printdev): Likewise. + + Move open_file to largefile_wrappers.h. + * util.c (open_file): Move it ... + * largefile_wrappers.h: ... here. + +2019-05-21 Dmitry V. Levin + + tests: robustify bpf-obj_get_info_by_fd test against future kernels. + * tests/bpf-obj_get_info_by_fd.c (print_prog_load, main): Change + log_level from 42 to 7, to placate Linux kernels containing commit + v5.2-rc1~133^2~193^2~18^2~9. + + bpf: add support for new fields in struct bpf_prog_info. + * bpf_attr.h (struct bpf_prog_info_struct): Add run_time_ns and run_cnt + fields. + * bpf.c (print_bpf_prog_info): Decode run_time_ns and run_cnt fields + introduced by Linux kernel commit v5.1-rc1~178^2~17^2~15^2~2. + * NEWS: Mention it. + * tests/bpf-obj_get_info_by_fd.c (main): Update expected output. + + xlat: update FAN_* constants. + * xlat/fan_mark_flags.in (FAN_MARK_FILESYSTEM): New constant + introduced by Linux kernel commit v4.20-rc1~75^2~10. + * tests/fanotify_mark.c (main): Update expected output. + + xlat: update IPV6_* constants. + * xlat/sock_ipv6_options.in (IPV6_MULTICAST_ALL): New constant + introduced by Linux kernel commit v4.20-rc1~14^2~384. + (IPV6_ROUTER_ALERT_ISOLATE): New constant introduced + by Linux kernel commit v5.1-rc1~178^2~22. + * NEWS: Mention this. + + xlat: update F_SEAL_* constants. + * xlat/f_seals.in (F_SEAL_FUTURE_WRITE): New constant introduced + by Linux kernel commit v5.1-rc1~152^2~49. + * NEWS: Mention this. + +2019-05-21 Dmitry V. Levin + + btrfs: implement decoding of BTRFS_IOC_FORGET_DEV argument. + ... introduced by Linux kernel commit v5.1-rc1~47^2~47. + + * btrfs.c (btrfs_ioctl) [BTRFS_IOC_FORGET_DEV]: Handle + BTRFS_IOC_FORGET_DEV. + * tests/btrfs.c (btrfs_test_device_ioctls) [BTRFS_IOC_FORGET_DEV]: + Check it. + +2019-05-21 Gleb Fotengauer-Malinovskiy + + Update ioctl entries from linux v5.1. + * linux/32/ioctls_inc_align16.h: Update from linux v5.1 + using ioctls_gen.sh. + * linux/32/ioctls_inc_align32.h: Likewise. + * linux/32/ioctls_inc_align64.h: Likewise. + * linux/64/ioctls_inc.h: Likewise. + * linux/x32/ioctls_inc0.h: Likewise. + * NEWS: Mention this. + * tests/ioctl_random.c (main): Update expected output. + + Co-Authored-by: Dmitry V. Levin + +2019-05-20 Dmitry V. Levin + + xlat: update FAN_* constants. + * xlat/fan_init_flags.in (FAN_REPORT_FID): New constant introduced + by Linux kernel commit v5.1-rc1~139^2~18. + * xlat/fan_event_flags.in (FAN_ATTRIB, FAN_MOVED_FROM, FAN_MOVED_TO, + FAN_CREATE, FAN_DELETE, FAN_DELETE_SELF, FAN_MOVE_SELF): New constants + introduced by Linux kernel commit v5.1-rc1~139^2~9. + * NEWS: Mention this. + * tests/fanotify_init.c (main): Update expected output. + * tests/fanotify_mark.c (main): Likewise. + + xlat: update PR_SPEC_* constants. + * xlat/pr_spec_get_store_bypass_flags.in (PR_SPEC_DISABLE_NOEXEC): + New constant introduced by Linux kernel commit v5.1-rc1~168^2. + * xlat/pr_spec_set_store_bypass_flags.in: Likewise. + * NEWS: Mention this. + * tests/prctl-spec-inject.c (get_strs, set_strs): Update. + + xlat: update BPF_* constants. + * xlat/ebpf_class.in (BPF_JMP32): New constant introduced + by Linux kernel commit v5.1-rc1~178^2~404^2~4^2~15. + * xlat/bpf_map_update_elem_flags.in (BPF_F_LOCK): New constant + introduced by Linux kernel commit v5.1-rc1~178^2~375^2~4^2~3. + * NEWS: Mention this. + + xlat: update V4L2_* constants. + * xlat/v4l2_control_ids.in + (V4L2_CID_MPEG_VIDEO_H264_CONSTRAINED_INTRA_PREDICTION): New constant + introduced by Linux kernel commit v5.1-rc1~88^2~261. + (V4L2_CID_MPEG_VIDEO_H264_CHROMA_QP_INDEX_OFFSET): New constant + introduced by Linux kernel commit v5.1-rc1~88^2~260. + * xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_AYUV32, V4L2_PIX_FMT_XYUV32, + V4L2_PIX_FMT_VUYA32, V4L2_PIX_FMT_VUYX32): New constants + introduced by Linux kernel commit v5.1-rc1~88^2~90. + * NEWS: Mention this. + + xlat: update NT_* constants. + * xlat/nt_descriptor_types.in (NT_ARM_PACA_KEYS, NT_ARM_PACG_KEYS): New + constants introduced by Linux kernel commit v5.1-rc1~82^2~44. + * NEWS: Mention this. + +2019-05-19 Dmitry V. Levin + + Implement decoding of io_uring_* syscalls. + ... introduced by Linux kernel commits v5.1-rc1~99^2~14, + v5.1-rc1~99^2~7, and v5.1-rc7~24^2. + + * configure.ac (AC_CHECK_HEADERS): Add linux/io_uring.h. + * io_uring.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * pathtrace.c (pathtrace_match_set): Add SEN_io_uring_enter, + SEN_io_uring_register, and SEN_io_uring_setup. + * xlat/uring_enter_flags.in: New file. + * xlat/uring_register_opcodes.in: Likewise. + * linux/32/syscallent.h [425, 426, 427]: Wire up io_uring_setup, + io_uring_enter, and io_uring_register. + * linux/64/syscallent.h: Likewise. + * linux/arm/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + * linux/alpha/syscallent.h [535, 536, 537]: Likewise. + * linux/ia64/syscallent.h [1024 + 425, 1024 + 426, 1024 + 427]: Likewise. + * linux/mips/syscallent-n32.h [6425, 6426, 6427]: Likewise. + * linux/mips/syscallent-n64.h [5425, 5426, 5427]: Likewise. + * linux/mips/syscallent-o32.h [4425, 4426, 4427]: Likewise. + * NEWS: Mention this change. + * tests/io_uring_enter.c: New file. + * tests/io_uring_register.c: Likewise. + * tests/io_uring_setup.c: Likewise. + * tests/gen_tests.in (io_uring_enter, io_uring_register, + io_uring_setup): New entries. + * tests/pure_executables.list: Add io_uring_enter, io_uring_register, + and io_uring_setup. + * tests/.gitignore: Likewise. + +2019-05-18 Dmitry V. Levin + + Implement decoding of pidfd_send_signal syscall. + ... introduced by Linux kernel commit v5.1-rc1~6^2~1. + + * signal.c (SYS_FUNC(pidfd_send_signal)): New function. + * linux/32/syscallent.h [424]: Wire up pidfd_send_signal. + * linux/64/syscallent.h: Likewise. + * linux/arm/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + * linux/alpha/syscallent.h [534]: Likewise. + * linux/ia64/syscallent.h [1024 + 424]: Likewise. + * linux/mips/syscallent-n32.h [6424]: Likewise. + * linux/mips/syscallent-n64.h [5424]: Likewise. + * linux/mips/syscallent-o32.h [4424]: Likewise. + * NEWS: Mention this change. + * tests/pidfd_send_signal.c: New file. + * tests/gen_tests.in (pidfd_send_signal): New entry. + * tests/pure_executables.list: Add pidfd_send_signal. + * tests/.gitignore: Likewise. + +2019-05-17 Dmitry V. Levin + + tests: check decoding of SO_TIMESTAMP*_NEW control messages. + * configure.ac (AC_CHECK_TYPES): Check for struct __kernel_timespec + and struct __kernel_sock_timeval. + * tests/msg_control.c [HAVE_STRUCT___KERNEL_SOCK_TIMEVAL || + HAVE_STRUCT___KERNEL_TIMESPEC]: Include . + (test_scm_timestamp): Rename to test_scm_timestamp_old. + (test_scm_timestampns): Rename to test_scm_timestampns_old. + (test_scm_timestamping): Rename to test_scm_timestamping_old. + [HAVE_STRUCT___KERNEL_SOCK_TIMEVAL] (test_scm_timestamp_new): New + function. + [HAVE_STRUCT___KERNEL_TIMESPEC] (test_scm_timestampns_new, + test_scm_timestamping_new): New functions. + (test_sol_socket): Use them. + * tests/sockopt-timestamp.c [HAVE_STRUCT___KERNEL_SOCK_TIMEVAL || + HAVE_STRUCT___KERNEL_TIMESPEC]: Include . + Include "xlat/sock_options.h" in XLAT_MACROS_ONLY mode. + (print_timestampns_old): Define unconditionally. + [HAVE_STRUCT___KERNEL_SOCK_TIMEVAL] (print_timestamp_new): New function. + [HAVE_STRUCT___KERNEL_TIMESPEC] (print_timestampns_new): Likewise. + (main): Test SO_TIMESTAMPNS_OLD unconditionally. + [HAVE_STRUCT___KERNEL_SOCK_TIMEVAL]: Test SO_TIMESTAMP_NEW. + [HAVE_STRUCT___KERNEL_TIMESPEC]: Test SO_TIMESTAMPNS_NEW. + + Implement decoding of SO_TIMESTAMP*_NEW control messages. + * print_timeval64.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * defs.h (print_timeval64_data_size): New prototype. + * msghdr.c (print_scm_timestamp_new, print_scm_timestampns_new, + print_scm_timestamping_new): New functions. + (cmsg_socket_printers): Add SO_TIMESTAMP_NEW, SO_TIMESTAMPNS_NEW, + and SO_TIMESTAMPING_NEW. + * NEWS: Mention this change. + +2019-05-17 Dmitry V. Levin + + print_timespec.h: parametrize TIMESPEC_T.tv_nsec. + This is going to be used to implement a parser of SO_TIMESTAMP_NEW + control message. + + * print_timespec.h [!TIMESPEC_NSEC] (TIMESPEC_NSEC): Define to tv_sec. + (TIMESPEC_TO_SEC_NSEC, timespec_fmt, print_timespec_t_utime): Use + TIMESPEC_NSEC instead of tv_sec. + +2019-05-17 Dmitry V. Levin + + print_timespec.h: conditionalize printers. + This allows to implement a parser of SO_TIMESTAMP_NEW control message + without implementing extra unused printers. + + * print_timespec.h (PRINT_TIMESPEC_DATA_SIZE, + PRINT_TIMESPEC_ARRAY_DATA_SIZE, PRINT_TIMESPEC, SPRINT_TIMESPEC, + PRINT_TIMESPEC_UTIME_PAIR, PRINT_ITIMERSPEC): Conditionalize. + +2019-05-17 Dmitry V. Levin + + xlat: add SO_TIMESTAMP*_NEW constants. + * xlat/sock_options.in (SO_TIMESTAMP_NEW, SO_TIMESTAMPNS_NEW, + SO_TIMESTAMPING_NEW): New constants introduced by Linux commits + v5.1-rc1~178^2~363^2~4 and v5.1-rc1~178^2~363^2~3. + * xlat/scmvals.in: Likewise. + +2019-05-16 Dmitry V. Levin + + Use kernel_timeval64_t in definition of kernel_timex64_t. + * kernel_timex.h: Include "kernel_timeval.h". + (kernel_timex64_t): Change the type of "time" field from a locally + defined structure to its equivalent kernel_timeval64_t. + +2019-05-16 Dmitry V. Levin + + Introduce kernel_timeval64_t type. + This type is going to be used to implement parsers of SO_TIMESTAMP*_NEW + control messages. + + * kernel_timeval.h: New file. + * Makefile.am (strace_SOURCES): Add it. + +2019-05-15 Dmitry V. Levin + + xlat: add _OLD suffixes to SO_RCVTIMEO and SO_SNDTIMEO. + Follow the Linux kernel commit v5.1-rc1~178^2~363^2~1 and rename + these constants. + + * xlat/sock_options.in (SO_RCVTIMEO): Rename to SO_RCVTIMEO_OLD. + (SO_SNDTIMEO): Rename to SO_SNDTIMEO_OLD. + +2019-05-15 Dmitry V. Levin + + Rename SO_TIMESTAMP* to SO_TIMESTAMP*_OLD. + Follow the Linux kernel commit v5.1-rc1~178^2~363^2~8 and rename + these constants everywhere. + + * xlat/scmvals.in (SO_TIMESTAMP): Rename to SO_TIMESTAMP_OLD. + (SO_TIMESTAMPNS): Rename to SO_TIMESTAMPNS_OLD. + (SO_TIMESTAMPING): Rename to SO_TIMESTAMPING_OLD. + * xlat/sock_options.in: Likewise. + * xlat/sock_rds_options.in: Likewise. + * msghdr.c (cmsg_socket_printers): Likewise. + (print_scm_timestamp): Rename to print_scm_timestamp_old. + (print_scm_timestampns): Rename to print_scm_timestampns_old. + (print_scm_timestamping): Rename to print_scm_timestamping_old. + * tests/msg_control.c (test_scm_timestamp): Rename SO_TIMESTAMP + to SO_TIMESTAMP_OLD. + (test_scm_timestampns): Rename SO_TIMESTAMPNS to SO_TIMESTAMPNS_OLD. + (test_scm_timestamping): Rename SO_TIMESTAMPING to SO_TIMESTAMPING_OLD. + * tests/sockopt-timestamp.c (main): Rename SO_TIMESTAMP and + SO_TIMESTAMPNS to SO_TIMESTAMP_OLD and SO_TIMESTAMPNS_OLD, respectively. + +2019-05-15 Dmitry V. Levin + + Replace SCM_TIMESTAMP* constants with SO_TIMESTAMP* + Besides the fact that SO_TIMESTAMP* constants appear to be more + standardized than SCM_TIMESTAMP*, new SO_TIMESTAMP*_OLD and + SO_TIMESTAMP*_NEW constants introduced in Linux 5.1 have no + SCM_TIMESTAMP*_OLD and SCM_TIMESTAMP*_NEW analogues. + + * xlat/scmvals.in: Replace SCM_WIFI_STATUS, SCM_TXTIME, SCM_TIMESTAMP, + SCM_TIMESTAMPNS, and SCM_TIMESTAMPING with SO_WIFI_STATUS, SO_TXTIME, + SO_TIMESTAMP, SO_TIMESTAMPNS, and SO_TIMESTAMPING, respectively. + * msghdr.c: Include "xlat/sock_options.h" in XLAT_MACROS_ONLY mode. + (cmsg_socket_printers): Replace SCM_TIMESTAMP, SCM_TIMESTAMPNS, and + SCM_TIMESTAMPING with SO_TIMESTAMP, SO_TIMESTAMPNS, and SO_TIMESTAMPING, + respectively. + * tests/msg_control.c: Include "xlat/sock_options.h" in XLAT_MACROS_ONLY + mode. + (test_scm_timestamp): Replace SCM_TIMESTAMP with SO_TIMESTAMP. + (test_scm_timestampns): Replace SCM_TIMESTAMPNS with SO_TIMESTAMPNS. + (test_scm_timestamping): Replace SCM_TIMESTAMPING with SO_TIMESTAMPING. + * tests/sockopt-timestamp.c (main): Replace SCM_TIMESTAMP and + SCM_TIMESTAMPNS with SO_TIMESTAMP and SO_TIMESTAMPNS, respectively. + +2019-05-15 Dmitry V. Levin + + tests: add another test of SO_TIMESTAMP and SO_TIMESTAMPNS decoding. + Unlike msg_control test, this new test makes the kernel generate + SO_TIMESTAMP and SO_TIMESTAMPNS messages. + + * tests/sockopt-timestamp.c: New file. + * tests/gen_tests.in (sockopt-timestamp): New entry. + * tests/pure_executables.list: Add sockopt-timestamp. + * tests/.gitignore: Likewise. + +2019-05-12 Dmitry V. Levin + + print_timespec.c: remove unused printers. + * print_timespec.c (PRINT_TIMESPEC, SPRINT_TIMESPEC, + PRINT_TIMESPEC_UTIME_PAIR, PRINT_ITIMERSPEC): Remove. + (print_timespec, sprint_timespec, print_timespec_utime_pair, + print_itimerspec): Remove. + + Implement and use new parsers of utimensat syscall. + * utimes.c (SYS_FUNC(utimensat)): Remove. + [HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(utimensat_time32)): New function. + * pathtrace.c (pathtrace_match_set): Replace SEN_utimensat with + SEN_utimensat_time32. + * linux/64/syscallent.h: Replace SEN(utimensat) with + SEN(utimensat_time64). + * linux/alpha/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/32/syscallent.h: Replace SEN(utimensat) with + SEN(utimensat_time32). + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + + Implement and use new parsers of timerfd_gettime and timerfd_settime syscalls + * time.c (SYS_FUNC(timerfd_gettime), SYS_FUNC(timerfd_settime)): Remove. + [HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(timerfd_gettime32), + SYS_FUNC(timerfd_settime32)): New functions. + * pathtrace.c (pathtrace_match_set): Replace SEN_timerfd_gettime and + SEN_timerfd_settime with SEN_timerfd_gettime32 and + SEN_timerfd_settime32, respectively. + * linux/64/syscallent.h: Replace SEN(timerfd_gettime) and + SEN(timerfd_settime) with SEN(timerfd_gettime64) and + SEN(timerfd_settime64), respectively. + * linux/alpha/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/32/syscallent.h: Replace SEN(timerfd_gettime) and + SEN(timerfd_settime) with SEN(timerfd_gettime32) and + SEN(timerfd_settime32), respectively. + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + + Implement and use new parsers of timer_gettime and timer_settime syscalls + * time.c (SYS_FUNC(timer_gettime), SYS_FUNC(timer_settime)): Remove. + [HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(timer_gettime32), + SYS_FUNC(timer_settime32)): New functions. + * linux/64/syscallent.h: Replace SEN(timer_gettime) and + SEN(timer_settime) with SEN(timer_gettime64) and SEN(timer_settime64), + respectively. + * linux/alpha/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/32/syscallent.h: Replace SEN(timer_gettime) and + SEN(timer_settime) with SEN(timer_gettime32) and SEN(timer_settime32), + respectively. + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + + Implement and use new parsers of nanosleep syscall. + * time.c (SYS_FUNC(nanosleep)): Remove. + [HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS] + (do_nanosleep): New function. + [HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(nanosleep_time32)): Likewise. + [HAVE_ARCH_OLD_TIME64_SYSCALLS] (SYS_FUNC(nanosleep_time64)): Likewise. + * linux/64/syscallent.h: Replace SEN(nanosleep) with + SEN(nanosleep_time64). + * linux/alpha/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/32/syscallent.h: Replace SEN(nanosleep) with + SEN(nanosleep_time32). + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + + Implement and use new parsers of clock_nanosleep syscall. + * time.c (SYS_FUNC(clock_nanosleep)): Remove. + [HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(clock_nanosleep_time32)): New + function. + * linux/64/syscallent.h: Replace SEN(clock_nanosleep) with + SEN(clock_nanosleep_time64). + * linux/alpha/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/32/syscallent.h: Replace SEN(clock_nanosleep) with + SEN(clock_nanosleep_time32). + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + + Implement and use new parsers of clock_gettime and clock_settime syscalls + * time.c (SYS_FUNC(clock_gettime), SYS_FUNC(clock_settime)): Remove. + [HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(clock_gettime32), + SYS_FUNC(clock_settime32)): New functions. + * linux/dummy.h (sys_clock_getres): Remove. + (sys_clock_getres_time32): Redirect to sys_clock_gettime32. + * linux/64/syscallent.h: Replace SEN(clock_gettime), SEN(clock_settime), + and SEN(clock_getres) with SEN(clock_gettime64), SEN(clock_settime64), + and SEN(clock_getres_time64), respectively. + * linux/alpha/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/32/syscallent.h: Replace SEN(clock_gettime), SEN(clock_settime), + and SEN(clock_getres) with SEN(clock_gettime32), SEN(clock_settime32), + and SEN(clock_getres_time32), respectively. + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + + Implement and use new parsers of mq_timedsend and mq_timedreceive syscalls + * mq.c (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive)): Remove. + [HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(mq_timedsend_time32), + SYS_FUNC(mq_timedreceive_time32)): New functions. + * pathtrace.c (pathtrace_match_set): Replace SEN_mq_timedsend and + SEN_mq_timedreceive with SEN_mq_timedsend_time32 and + SEN_mq_timedreceive_time32, respectively. + * syscall.c (dumpio): Likewise. + * linux/64/syscallent.h: Replace SEN(mq_timedsend) and + SEN(mq_timedreceive) with SEN(mq_timedsend_time64) and + SEN(mq_timedreceive_time64), respectively. + * linux/alpha/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/32/syscallent.h: Replace SEN(mq_timedsend) and + SEN(mq_timedreceive) with SEN(mq_timedsend_time32) and + SEN(mq_timedreceive_time32), respectively. + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + + Implement and use new parsers of rt_sigtimedwait syscall. + * signal.c (SYS_FUNC(rt_sigtimedwait)): Remove. + [HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(rt_sigtimedwait_time32)): New + function. + * linux/64/syscallent.h: Replace SEN(rt_sigtimedwait) with + SEN(ppoll_time64). + * linux/alpha/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/32/syscallent.h: Replace SEN(rt_sigtimedwait) with + SEN(ppoll_time32). + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + + Implement and use new parsers of sched_rr_get_interval syscall. + * sched.c (SYS_FUNC(sched_rr_get_interval)): Remove. + [HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(sched_rr_get_interval_time32)): + New function. + * linux/64/syscallent.h: Replace SEN(sched_rr_get_interval) with + SEN(sched_rr_get_interval_time64). + * linux/alpha/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/32/syscallent.h: Replace SEN(sched_rr_get_interval) with + SEN(sched_rr_get_interval_time32). + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + + Implement and use new parsers of poll syscall. + * poll.c (SYS_FUNC(poll)): Remove. + [HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS] (do_poll): + New function. + [HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(poll_time32)): Likewise. + [HAVE_ARCH_OLD_TIME64_SYSCALLS] (SYS_FUNC(poll_time64)): Likewise. + * pathtrace.c (pathtrace_match_set): Replace SEN_poll with + SEN_poll_time32 and SEN_poll_time64. + * linux/aarch64/syscallent.h: Replace SEN(poll) with SEN(poll_time64). + * linux/alpha/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/arm/syscallent.h: Replace SEN(poll) with SEN(poll_time32). + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + + Implement and use new parsers of ppoll syscall. + * poll.c (SYS_FUNC(ppoll)): Remove. + [HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(ppoll_time32)): New function. + * pathtrace.c (pathtrace_match_set): Replace SEN_ppoll with + SEN_ppoll_time32. + * linux/64/syscallent.h: Replace SEN(ppoll) with SEN(ppoll_time64). + * linux/alpha/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/32/syscallent.h: Replace SEN(ppoll) with SEN(ppoll_time32). + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + + Implement and use new parsers of recvmmsg syscall. + * mmsghdr.c (SYS_FUNC(recvmmsg)): Remove. + [HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(recvmmsg_time32)): New function. + * syscall.c (dumpio): Handle SEN_recvmmsg_time32. + * linux/subcall32.h (sys_recvmmsg): Redirect to sys_recvmmsg_time32. + * linux/subcall64.h (sys_recvmmsg): Redirect to sys_recvmmsg_time64. + * linux/64/syscallent.h: Replace SEN(recvmmsg) with SEN(recvmmsg_time64). + * linux/alpha/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/32/syscallent.h: Replace SEN(recvmmsg) with SEN(recvmmsg_time32). + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + + Implement and use new parsers of semtimedop syscall. + * ipc_sem.c (SYS_FUNC(semtimedop)): Remove. + [HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(semtimedop_time32)): New function. + * linux/subcall32.h (sys_semtimedop): Redirect to sys_semtimedop_time32. + * linux/subcall64.h (sys_semtimedop): Redirect to sys_semtimedop_time64. + * linux/64/syscallent.h: Replace SEN(semtimedop) with + SEN(semtimedop_time64). + * linux/alpha/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/32/syscallent.h: Replace SEN(semtimedop) with + SEN(semtimedop_time32). + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + +2019-05-12 Dmitry V. Levin + + Introduce subcall32.h and subcall64.h wrappers. + They are going to be used to implement new parsers for indirect + time-related syscalls. + + * linux/subcall32.h: New file. + * linux/subcall64.h: Likewise. + * Makefile.am (EXTRA_DIST): Add them. + * linux/arm/syscallent.h: Replace "subcall.h" with "subcall32.h". + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/mips/syscallent-n64.h: Replace "subcall.h" with "subcall64.h". + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + +2019-05-12 Dmitry V. Levin + + Implement and use new parsers of futex syscall. + * futex.c (SYS_FUNC(futex)): Remove. + [HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(futex_time32)): New function. + * linux/64/syscallent.h: Replace SEN(futex) with SEN(futex_time64). + * linux/alpha/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/32/syscallent.h: Replace SEN(futex) with SEN(futex_time32). + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + + Implement and use new parsers of pselect6 syscall. + * desc.c (SYS_FUNC(pselect6)): Remove. + [HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(pselect6_time32)): New function. + * pathtrace.c (pathtrace_match_set): Replace SEN_pselect6 with + SEN_pselect6_time32. + * linux/64/syscallent.h: Replace SEN(pselect6) with + SEN(pselect6_time64). + * linux/alpha/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/32/syscallent.h: Replace SEN(pselect6) with + SEN(pselect6_time32). + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + + Implement and use new parsers of io_pgetevents syscall. + * aio.c (SYS_FUNC(io_pgetevents)): Remove. + [HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(io_pgetevents_time32)): New + function. + * linux/64/syscallent.h: Replace SEN(io_pgetevents) with + SEN(io_pgetevents_time64). + * linux/alpha/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/32/syscallent.h: Replace SEN(io_pgetevents) with + SEN(io_pgetevents_time32). + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + + Implement and use new parsers of io_getevents syscall. + * aio.c (SYS_FUNC(io_getevents)): Remove. + [HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(io_getevents_time32)): New + function. + [HAVE_ARCH_OLD_TIME64_SYSCALLS] (SYS_FUNC(io_getevents_time64)): + Likewise. + * linux/64/syscallent.h: Replace SEN(io_getevents) with + SEN(io_getevents_time64). + * linux/alpha/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/32/syscallent.h: Replace SEN(io_getevents) with + SEN(io_getevents_time32). + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + +2019-05-11 Dmitry V. Levin + + Wire up *time64 system calls. + * linux/32/syscallent.h [403...423]: Wire up clock_gettime64, + clock_settime64, clock_adjtime64, clock_getres_time64, + clock_nanosleep_time64, timer_gettime64, timer_settime64, + timerfd_gettime64, timerfd_settime64, utimensat_time64, pselect6_time64, + ppoll_time64, io_pgetevents_time64, recvmmsg_time64, + mq_timedsend_time64, mq_timedreceive_time64, semtimedop_time64, + rt_sigtimedwait_time64, futex_time64, and sched_rr_get_interval_time64 + introduced by linux commit v5.1-rc1~160^2~2^2. + * linux/arm/syscallent.h [403...423]: Likewise. + * linux/hppa/syscallent.h [403...423]: Likewise. + * linux/i386/syscallent.h [403...423]: Likewise. + * linux/m68k/syscallent.h [403...423]: Likewise. + * linux/microblaze/syscallent.h [403...423]: Likewise. + * linux/mips/syscallent-n32.h [6403...6423]: Likewise. + * linux/mips/syscallent-o32.h [4403...4423]: Likewise. + * linux/powerpc/syscallent.h [403...423]: Likewise. + * linux/s390/syscallent.h [403...423]: Likewise. + * linux/sh/syscallent.h [403...423]: Likewise. + * linux/sparc/syscallent.h [403...423]: Likewise. + * linux/xtensa/syscallent.h [403...423]: Likewise. + * linux/64/syscallent.h: Add a comment about syscall numbers + reserved to sync up with other architectures. + * linux/ia64/syscallent.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * pathtrace.c (pathtrace_match_set): Handle SEN_utimensat_time64, + SEN_pselect6_time64, SEN_ppoll_time64, SEN_mq_timedreceive_time64, + SEN_mq_timedsend_time64, SEN_timerfd_gettime64, and + SEN_timerfd_settime64. + * syscall.c (dumpio): Handle SEN_mq_timedsend_time64, + SEN_mq_timedreceive_time64, and SEN_recvmmsg_time64. + * NEWS: Mention this. + + Implement parsers of new *time64 system calls. + * aio.c (SYS_FUNC(io_pgetevents_time64)): New function. + * desc.c (SYS_FUNC(pselect6_time64)): Likewise. + * futex.c (SYS_FUNC(futex_time64)): Likewise. + * ipc_sem.c (SYS_FUNC(semtimedop_time64)): Likewise. + * mmsghdr.c (SYS_FUNC(recvmmsg_time64)): Likewise. + * mq.c (SYS_FUNC(mq_timedsend_time64), + SYS_FUNC(mq_timedreceive_time64)): Likewise. + * poll.c (SYS_FUNC(ppoll_time64)): Likewise. + * sched.c (SYS_FUNC(sched_rr_get_interval_time64)): Likewise. + * signal.c (SYS_FUNC(rt_sigtimedwait_time64)): Likewise. + * time.c (SYS_FUNC(clock_settime64), SYS_FUNC(clock_gettime64), + SYS_FUNC(clock_nanosleep_time64), SYS_FUNC(timer_settime64), + SYS_FUNC(timer_gettime64), SYS_FUNC(timerfd_settime64), + SYS_FUNC(timerfd_gettime64)): Likewise. + * utimes.c (SYS_FUNC(utimensat_time64)): Likewise. + * linux/dummy.h (sys_clock_getres_time64): Redirect + to sys_clock_gettime64. + + Use new parsers of adjtimex and clock_adjtime syscalls. + * print_timex.c (struct_timex, print_timex): Remove. + * time.c (SYS_FUNC(adjtimex), SYS_FUNC(clock_adjtime)): Remove. + * linux/alpha/syscallent.h [303]: Replace SEN(adjtimex) + with SEN(adjtimex32). + [366]: Replace SEN(adjtimex) with SEN(adjtimex64). + [499]: Replace SEN(clock_adjtime) with SEN(clock_adjtime64). + * linux/32/syscallent.h: Replace SEN(adjtimex) and SEN(clock_adjtime) + with SEN(adjtimex32) and SEN(clock_adjtime32), respectively. + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + * linux/64/syscallent.h: Replace SEN(adjtimex) and SEN(clock_adjtime) + with SEN(adjtimex64) and SEN(clock_adjtime64), respectively. + * linux/alpha/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * tests/adjtimex.c: Include . + (main): Print struct timex.tai unconditionally. + + Implement parsers of 64-bit adjtimex and clock_adjtime syscalls. + * time.c (SYS_FUNC(clock_adjtime64)): New function. + [SPARC64] (SYS_FUNC(clock_sparc64_adjtime)): Likewise. + [HAVE_ARCH_OLD_TIME64_SYSCALLS] (SYS_FUNC(adjtimex64)): Likewise. + + Implement parsers of 32-bit adjtimex and clock_adjtime syscalls. + * time.c [HAVE_ARCH_TIME32_SYSCALLS] (SYS_FUNC(adjtimex32), + SYS_FUNC(clock_adjtime32)): New functions. + +2019-05-10 Dmitry V. Levin + + sparc64: implement printer for sparc64-specific struct timex. + According to Linux kernel commit v5.1-rc1~160^2~2^2~8, sparc64 is the + only architecture on Linux that has a 'timeval' definition with a 32-bit + tv_usec but a 64-bit tv_sec. + + * defs.h [SPARC64] (print_sparc64_timex): New prototype. + * kernel_timex.h [SPARC64] (kernel_sparc64_timex_t): New type. + * print_timex.c [SPARC64] (print_sparc64_timex): New function. + +2019-05-10 Dmitry V. Levin + + Implement printer for kernel_timex64_t. + This is going to be used to implement clock_adjtime64 parser. + + * defs.h (kernel_timex64_t): New prototype. + * print_timex.c (print_timex64): New function. + +2019-05-10 Dmitry V. Levin + + Implement printer for kernel_timex32_t. + This is going to be used to re-implement parsers of syscalls that deal + with 32-bit struct timex. + + * print_timex.h: New file. + * Makefile.am (strace_SOURCES): Add it. + * defs.h (print_timex32): New prototype. + * print_timex.c: Include "kernel_timex.h". + [HAVE_ARCH_TIME32_SYSCALLS] (print_timex32): New function. + +2019-05-10 Dmitry V. Levin + + Introduce kernel_timex64_t. + This is going to be used to implement clock_adjtime64 parser. + + * kernel_timex.h (kernel_timex64_t): New type. + +2019-05-10 Dmitry V. Levin + + Introduce kernel_timex32_t. + Currently existing parsers of syscalls that deal with 32-bit timex + rely upon struct timex being defined in libc and match the definition + used by the kernel. Given the upcoming y2038 changes in glibc, + this new type is going to be used instead. + + * kernel_timex.h: New file. + * Makefile.am (strace_SOURCES): Add it. + +2019-05-09 Dmitry V. Levin + + Re-implement mpersified timespec printers using timespec32/timespec64 printers + * print_timespec.c (UTIME_NOW, UTIME_OMIT, TIMESPEC_TO_SEC_NSEC, + timespec_fmt, print_sec_nsec, print_timespec_t, print_timespec_t_utime): + Remove. + (TIMESPEC_IS_32BIT, PRINT_TIMESPEC_DATA_SIZE, + PRINT_TIMESPEC_ARRAY_DATA_SIZE, PRINT_TIMESPEC, SPRINT_TIMESPEC, + PRINT_TIMESPEC_UTIME_PAIR,PRINT_ITIMERSPEC): New macros. + (print_struct_timespec_data_size): Invoke PRINT_TIMESPEC_DATA_SIZE. + (print_struct_timespec_array_data_size): Invoke + PRINT_TIMESPEC_ARRAY_DATA_SIZE. + (print_timespec): Invoke PRINT_TIMESPEC. + (sprint_timespec): Invoke SPRINT_TIMESPEC. + (print_timespec_utime_pair): Invoke PRINT_TIMESPEC_UTIME_PAIR. + (print_itimerspec): Invoke PRINT_ITIMERSPEC. + +2019-05-09 Dmitry V. Levin + + Implement printers for kernel_timespec64_t. + They are going to be used to re-implement parsers of syscalls that deal + with 64-bit timespec, and to implement parsers of new *time64 syscalls. + + * defs.h (print_timespec64_data_size, print_timespec64_array_data_size, + print_timespec64, sprint_timespec64, print_timespec64_utime_pair, + print_itimerspec64): New prototypes. + * print_timespec64.c: New file. + * Makefile.am (strace_SOURCES): Add it. + +2019-05-09 Dmitry V. Levin + + Implement printers for kernel_timespec32_t. + They are going to be used to re-implement parsers of syscalls that deal + with 32-bit timespec. + + * defs.h (print_timespec32_data_size, print_timespec32_array_data_size, + print_timespec32, sprint_timespec32, print_timespec32_utime_pair, + print_itimerspec32): New prototypes. + * print_timespec.h: New file based on print_timespec.c. + * print_timespec32.c: New file. + * Makefile.am (strace_SOURCES): Add them. + +2019-05-09 Dmitry V. Levin + + print_timespec.c: introduce helper macros and functions. + They are going to be used to implement printers of other timespec + flavours, e.g. kernel_timespec32_t and kernel_timespec64_t. + + * print_timespec.c (TIMESPEC_TO_SEC_NSEC): New macro. + (print_timespec_t_utime, sprint_timespec): Use it. + (print_sec_nsec): New function. + (print_timespec_t): Use it. + +2019-05-05 Dmitry V. Levin + + Introduce kernel_timespec64_t type. + This type ais going to be used to implement parsers of syscalls + that deal with 64-bit timespec. + + * kernel_timespec.h (kernel_timespec64_t): New type. + +2019-05-05 Dmitry V. Levin + + Introduce kernel_timespec32_t type. + Currently existing parsers of syscalls that deal with 32-bit timespec + rely upon struct timespec being defined in libc and match the definition + used by the kernel. Given the upcoming y2038 changes in glibc, + this new type is going to be used instead. + + * kernel_timespec.h: New file. + * Makefile.am (strace_SOURCES): Add it. + +2019-05-05 Dmitry V. Levin + + Introduce ARCH_TIMESIZE. + This is going to be used to implement new timespec parsers. + + * linux/arch_defs_.h [!ARCH_TIMESIZE] (ARCH_TIMESIZE): Define + to SIZEOF_LONG. + * linux/x32/arch_defs_.h (ARCH_TIMESIZE): Define to 8. + +2019-05-05 Dmitry V. Levin + + Introduce HAVE_ARCH_TIME32_SYSCALLS and HAVE_ARCH_OLD_TIME64_SYSCALLS. + These are going to control whether to compile parsers of 32-bit and + old 64-bit time syscalls. + + * linux/arch_defs_.h [!MIN_WORDSIZE] (MIN_WORDSIZE): Define. + [!HAVE_ARCH_TIME32_SYSCALLS] (HAVE_ARCH_TIME32_SYSCALLS): Define. + [!HAVE_ARCH_OLD_TIME64_SYSCALLS] (HAVE_ARCH_OLD_TIME64_SYSCALLS): + Define. + * linux/alpha/arch_defs_.h (HAVE_ARCH_TIME32_SYSCALLS): Define. + * linux/x32/arch_defs_.h (HAVE_ARCH_OLD_TIME64_SYSCALLS): Define. + +2019-05-04 Dmitry V. Levin + + time.c: introduce do_timerfd_gettime and do_timerfd_settime. + These are going to be used to implement parsers of timerfd_gettime64 + and timerfd_settime64 syscalls. + + * time.c (do_timerfd_settime, do_timerfd_gettime): New functions. + ((SYS_FUNC(timerfd_settime)): Turn into a thin wrapper around + do_timerfd_settime. + ((SYS_FUNC(timerfd_gettime)): Turn into a thin wrapper around + do_timerfd_gettime. + +2019-05-04 Dmitry V. Levin + + time.c: introduce do_timer_gettime and do_timer_settime. + These are going to be used to implement parsers of timer_gettime64 and + timer_settime64 syscalls. + + * time.c (do_timer_settime, do_timer_gettime): New functions. + ((SYS_FUNC(timer_settime)): Turn into a thin wrapper around + do_timer_settime. + ((SYS_FUNC(timer_gettime)): Turn into a thin wrapper around + do_timer_gettime. + +2019-05-04 Dmitry V. Levin + + time.c: introduce do_clock_gettime, do_clock_settime, and do_clock_nanosleep + These are going to be used to implement parsers of clock_gettime64, + clock_settime64, and clock_nanosleep_time64 syscalls. + + * time.c (do_clock_settime, do_clock_gettime, do_clock_nanosleep): New + functions. + ((SYS_FUNC(clock_settime)): Turn into a thin wrapper around + do_clock_settime. + ((SYS_FUNC(clock_gettime)): Turn into a thin wrapper around + do_clock_gettime. + ((SYS_FUNC(clock_nanosleep)): Turn into a thin wrapper around + do_clock_nanosleep. + +2019-05-04 Dmitry V. Levin + + time.c: introduce do_clock_adjtime. + This is going to be used to implement a parser of clock_adjtime64 + syscall. + + * time.c (do_clock_adjtime): New function. + ((SYS_FUNC(clock_adjtime)): Turn into a thin wrapper around + do_clock_adjtime. + +2019-05-04 Dmitry V. Levin + + do_adjtimex: parametrize print_timex. + This is going to be used to implement a parser of clock_adjtime64 + syscall. + + * time.c (do_adjtimex): Add print_tx argument, invoke it + instead of print_timex. + (SYS_FUNC(adjtimex), SYS_FUNC(clock_adjtime)): Pass print_timex + to do_adjtimex. + +2019-05-04 Dmitry V. Levin + + utimes.c: introduce do_utimensat. + This is going to be used to implement a parser of utimensat_time64 + syscall. + + * utimes.c (do_utimensat): New function. + (SYS_FUNC(utimensat)): Turn into a thin wrapper around do_utimensat. + +2019-05-04 Dmitry V. Levin + + signal.c: introduce do_rt_sigtimedwait. + This is going to be used to implement a parser of rt_sigtimedwait_time64 + syscall. + + * signal.c (do_rt_sigtimedwait): New function. + (SYS_FUNC(rt_sigtimedwait)): Turn into a thin wrapper around + do_rt_sigtimedwait. + +2019-05-04 Dmitry V. Levin + + sched.c: introduce do_sched_rr_get_interval. + This is going to be used to implement a parser of + sched_rr_get_interval_time64 syscall. + + * sched.c (do_sched_rr_get_interval): New function. + (SYS_FUNC(sched_rr_get_interval)): Turn into a thin wrapper around + do_sched_rr_get_interval. + +2019-05-04 Dmitry V. Levin + + poll.c: introduce do_ppoll. + This is going to be used to implement a parser of ppoll_time64 syscall. + + * poll.c (decode_poll_exiting): Add sprint_ts argument. + (SYS_FUNC(poll)): Pass sprint_timespec to decode_poll_exiting. + (do_ppoll): New function. + (SYS_FUNC(ppoll)): Turn into a thin wrapper around do_ppoll. + +2019-05-04 Dmitry V. Levin + + mq.c: introduce do_mq_timedsend and do_mq_timedreceive. + These are going to be used to implement parsers of mq_timedsend_time64 + and mq_timedreceive_time64 syscalls. + + * mq.c (do_mq_timedsend, do_mq_timedreceive): New functions. + (SYS_FUNC(mq_timedsend)): Turn into a thin wrapper around + do_mq_timedsend. + (SYS_FUNC(mq_timedreceive)): Turn into a thin wrapper around + do_mq_timedreceive. + +2019-05-04 Dmitry V. Levin + + mmsghdr.c: introduce do_recvmmsg. + This is going to be used to implement a parser of recvmmsg_time64 + syscall. + + * mmsghdr.c (do_recvmmsg): New function. + (SYS_FUNC(recvmmsg)): Turn into a thin wrapper around do_recvmmsg. + +2019-05-04 Dmitry V. Levin + + ipc_sem.c: introduce do_semtimedop. + This is going to be used to implement a parser of semtimedop_time64 + syscall. + + * ipc_sem.c (do_semtimedop): New function. + (SYS_FUNC(semtimedop)): Turn into a thin wrapper around do_semtimedop. + +2019-05-04 Dmitry V. Levin + + futex.c: introduce do_futex. + This is going to be used to implement a parser of futex_time64 syscall. + + * futex.c (do_futex): New function. + (SYS_FUNC(futex)): Turn into a thin wrapper around do_futex. + +2019-05-04 Dmitry V. Levin + + desc.c: introduce do_pselect6. + This is going to be used to implement a parser of pselect6_time64 + syscall. + + * dec.c (do_pselect6): New function. + (SYS_FUNC(pselect6)): Turn into a thin wrapper around do_pselect6. + +2019-05-04 Dmitry V. Levin + + print_io_getevents: parametrize print_timespec. + This is going to be used to implement a parser of io_pgetevents_time64 + syscall. + + * aio.c (print_io_getevents): Add print_ts argument, invoke it + instead of print_timespec. + (SYS_FUNC(io_getevents), SYS_FUNC(io_pgetevents)): Pass print_timespec + to print_io_getevents. + +2019-05-04 Dmitry V. Levin + + Introduce print_obj_by_addr_fn and sprint_obj_by_addr_fn. + These types are going to be used in signatures of functions that take + print_*time* functions as parameters. + + * defs.h (print_obj_by_addr_fn, sprint_obj_by_addr_fn): New types. + * desc.c (decode_select): Use them. + +2019-05-04 Dmitry V. Levin + + Change signatures of print_*time* functions to match print_timex. + Make all these functions that print time by address return -1 when + umove_or_printaddr() returns non-zero. + + This helps to use these functions as parameters to other functions. + + * defs.h [ALPHA] (print_timeval32, print_timeval32_utimes, + print_itimerval32): Change return type to int. + * desc.c (decode_select): Change return type of print_tv_ts to int. + * print_timespec.c (print_timespec, print_timespec_utime_pair, + print_itimerspec): Change return type to int, return -1 when + umove_or_printaddr() returns non-zero. + * print_timeval.c (print_timeval, print_timeval_utimes, + print_itimerval): Likewise. + [ALPHA] (print_timeval32, print_timeval32_utimes, print_itimerval32): + Likewise. + +2019-04-16 Dmitry V. Levin + + tests: robustify umount and umount2 tests against future kernel changes. + Prepare for the rename of umount syscall to umount2 introduced by linux + kernel commits v5.1-rc1~160^2~3^2~12 and v5.1-rc1~160^2~3^2~16 on alpha + and ia64 architectures, respectively. + + * tests/umount.c: Check for __NR_umount == __NR_umount2. + * tests/umount2.c: Likewise. + +2019-04-15 Dmitry V. Levin + + alpha: wire up getegid, geteuid, and getppid syscalls. + * linux/alpha/syscallent.h [530..532]: Wire up getegid, geteuid, + and getppid syscalls introduced on this architecture by linux commit + v5.1-rc1~160^2~3^2~1. + * NEWS: Mention this. + + alpha: wire up statfs64 and fstatfs64 syscalls. + * linux/alpha/syscallent.h [528..529]: Wire up statfs64 and fstatfs64 + syscalls introduced on this architecture by linux commit + v5.1-rc1~160^2~3^2~2. + * NEWS: Mention this. + + Wire up pkey_* and rseq syscalls on remaining architectures. + * linux/alpha/syscallent.h [524..527]: Wire up pkey_mprotect, + pkey_alloc, pkey_free, and rseq syscalls introduced on this architecture + by linux commit v5.1-rc1~160^2~3^2~3. + * linux/hppa/syscallent.h [351..354]: Likewise. + * linux/ia64/syscallent.h [1024 + 330..333]: Likewise. + * linux/m68k/syscallent.h [381..384]: Likewise. + * linux/sh/syscallent.h [384..387]: Likewise. + * linux/sparc/syscallent.h [362..365]: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/s390/syscallent.h [384..386]: Wire up pkey_mprotect, + pkey_alloc, and pkey_free syscalls introduced on this architecture + by linux commit v5.1-rc1~160^2~3^2~3. + * linux/s390x/syscallent.h: Likewise. + * linux/xtensa/syscallent.h [352]: Wire up rseq syscall introduced + on this architecture by linux commit v5.1-rc1~160^2~3^2~3. + * NEWS: Mention this. + + Wire up direct ipc syscalls on m68k, mips, powerpc*, s390*, sh, sparc*, x86 + * linux/i386/syscallent.h [393..402]: Wire up semget, semctl, shmget, + shmctl, shmat, shmdt, msgget, msgsnd, msgrcv, and msgctl syscalls + introduced on this architecture by linux commit v5.1-rc1~160^2~3^2~4. + * linux/m68k/syscallent.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/mips/syscallent-o32.h [4393..4402]: Wire up semget, semctl, + shmget, shmctl, shmat, shmdt, msgget, msgsnd, msgrcv, and msgctl syscalls + introduced on this architecture by linux commit v5.1-rc1~160^2~3^2~4. + * linux/powerpc64/syscallent.h [392..402]: Wire up semtimedop, semget, + semctl, shmget, shmctl, shmat, shmdt, msgget, msgsnd, msgrcv, and msgctl + syscalls introduced on this architecture by linux commit + v5.1-rc1~160^2~3^2~4. + * linux/s390x/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * NEWS: Mention this. + + powerpc, powerpc64: remove direct ipc syscall entries. + * linux/powerpc/syscallent.h [366..377]: Remove entries reserved for + direct ipc syscalls, they were added by linux kernel commit + v4.4-rc1~98^2~32 and removed by linux kernel commit v4.4-rc6~5^2~2. + * linux/powerpc64/syscallent.h: Likewise. + + sh: wire up statx syscall. + * linux/sh/syscallent.h [380]: Wire up statx syscall + introduced on sh by linux commit v5.1-rc1~160^2~3^2~7. + * NEWS: Mention this. + + m68k: wire up seccomp syscall. + * linux/m68k/syscallent.h [380]: Wire up seccomp syscall + introduced on m68k by linux commit v5.1-rc1~160^2~3^2~9. + * NEWS: Mention this. + + arm: wire up kexec_file_load syscall. + * linux/arm/syscallent.h [401]: Wire up kexec_file_load syscall + introduced on arm by linux commit v5.1-rc1~160^2~3^2~10. + * NEWS: Mention this. + + arm: wire up migrate_pages syscall. + * linux/arm/syscallent.h [400]: Wire up migrate_pages syscall + introduced on arm by linux commit v5.1-rc1~160^2~3^2~11. + * NEWS: Mention this. + + alpha: wire up io_pgetevents syscall. + * linux/alpha/syscallent.h [523]: Wire up io_pgetevents syscall + introduced on alpha by linux commit v5.1-rc1~160^2~3^2~13. + * NEWS: Mention this. + + ia64: wire up perf_event_open and seccomp syscalls. + * linux/ia64/syscallent.h [1024 + 327..328]: Wire up perf_event_open + and seccomp syscalls introduced on ia64 by linux commit + v5.1-rc1~160^2~3^2~14. + * NEWS: Mention this. + + ia64: wire up statx and io_pgetevents syscalls. + * linux/ia64/syscallent.h [1024 + 326..327]: Wire up statx and + io_pgetevents syscalls introduced on ia64 by linux commit + v5.1-rc1~160^2~3^2~15. + * NEWS: Mention this. + + ia64: make syscall entry table numbers more readable. + * linux/ia64/syscallent.h: Format syscall numbers using base+offset form. + * scno.am (SCNO_SED): Update to handle this format. + +2019-03-24 Guo Ren + + Add C-SKY architecture support. + This is port of C-SKY architecture for strace. There is a little + difference between abiv1 and abiv2, we use __CSKYABIV2__ from GCC-csky + to distinguish. + + Reviewed-By: Dmitry V. Levin + + * cacheflush.c [CSKY] (cacheflush_flags, SYS_FUNC(cacheflush)): Define. + * clone.c [CSKY] (ARG_*): Define. + * configure.ac [$host_cpu == csky*]: Define CSKY. + * linux/csky/arch_regs.c: New file. + * linux/csky/get_error.c: Likewise. + * linux/csky/get_scno.c: Likewise. + * linux/csky/get_syscall_args.c: Likewise. + * linux/csky/ioctls_arch0.h: Likewise. + * linux/csky/ioctls_inc0.h: Likewise. + * linux/csky/raw_syscall.h: Likewise. + * linux/csky/set_error.c: Likewise. + * linux/csky/set_scno.c: Likewise. + * linux/csky/syscallent.h: Likewise. + * Makefile.am (EXTRA_DIST): Add them. + * NEWS: Mention this change. + +2019-03-24 Guo Ren + + riscv: Fixup wrong clone's arguments define. + In linux kernel riscv select CLONE_BACKWARDS in + linux/arch/riscv/Kconfig, and in linux/kernel/fork.c: + + ifdef CONFIG_CLONE_BACKWARDS + SYSCALL_DEFINE5(clone, unsigned long, clone_flags, unsigned long, newsp, + int __user *, parent_tidptr, + unsigned long, tls, + int __user *, child_tidptr) + elif ... + + So we must make the riscv clone-arguments' sequence to be: + define ARG_FLAGS 0 + define ARG_STACK 1 + define ARG_PTID 2 + define ARG_TLS 3 + define ARG_CTID 4 + + Reviewed-By: Dmitry V. Levin + + * clone.c [RISCV]: Use default definitions for ARG_* macros. + * NEWS: Mention this fix. + +2019-03-20 Dmitry V. Levin + + Post-release administrivia. + * NEWS: Add a header line for the next release. + * debian/changelog.in: Add a changelog entry for 5.0-1. + * strace.spec.in: Likewise. + +2019-03-19 Dmitry V. Levin + + Prepare for 5.0 release. + * NEWS: Update for 5.0 release. + + .mailmap: add more entries to avoid duplication in CREDITS. + +2019-03-18 Dmitry V. Levin + + strace.spec.in: do not define Group tag for modern distros. + * strace.spec.in (Group): Conditionalize on distro version. + + References: https://fedoraproject.org/wiki/Changes/Remove_Group_Tag + +2019-03-18 Dmitry V. Levin + + strace-log-merge: enhance pid formatting. + * strace-log-merge (max_suffix_length): New variable. + (iterate_logfiles, process_suffix, process_logfile): New functions. + Use them to choose the optimum width for pid column. + * NEWS: Mention this enhancement. + * tests/strace-log-merge-suffix.test: New test. + * tests/Makefile.am (MISC_TESTS): Add it. + +2019-03-18 Dmitry V. Levin + + strace-log-merge: fix error diagnostics. + * strace-log-merge: Print error diagnostics and exit with a non-zero + status in case of no strace output. + * NEWS: Mention this fix. + * tests/strace-log-merge-error.test: New test. + * tests/Makefile.am (MISC_TESTS): Add it. + + Fixes: v4.21~287 "strace-log-merge: work around corner cases of strace -ttt parsing" + +2019-03-18 Eugene Syromyatnikov + + Update NEWS. + +2019-03-18 Dmitry V. Levin + + Update copyright year number range. + * COPYING: Update copyright year number range. + * tests/COPYING: Likewise. + * debian/copyright: Likewise. + + Update copyright headers. + Headers updated automatically using maint/update_copyright_years.sh + script. + +2019-03-18 Dmitry V. Levin + + Fix preprocessor indentation. + Indent the C preprocessor directives to reflect their nesting + using the following script: + + $ cppi -l $(git grep -El '^[[:space:]]*#[[:space:]]*(if|ifdef|ifndef|elif|else|endif|define|pragma)[[:space:]]' |grep -v '\.sh$') |while read f; do + cppi < "$f" > "$f".cppi; mv "$f".cppi "$f" + done + +2019-03-17 Shankara Pailoor + + Honor xlat styles when decoding mac addresses. + * defs.h (print_mac_addr): Add xlat_style support, move ... + * print_mac.c: ... here. + * tests/sockaddr_xlat.c [HAVE_BLUETOOTH_BLUETOOTH_H]: Include + , , + , and . + [HAVE_BLUETOOTH_BLUETOOTH_H] (check_sco, check_rc): New functions. + (main) [HAVE_BLUETOOTH_BLUETOOTH_H]: Call them to verify + new xlat_style support in print_mac_addr(). + * tests/net-packet_mreq.c: Handle XLAT_RAW, XLAT_ABBREV, + and XLAT_VERBOSE macros. + * tests/net-packet_mreq-Xabbrev.c: New test. + * tests/net-packet_mreq-Xraw.c: Likewise. + * tests/net-packet_mreq-Xverbose.c: Likewise. + * tests/gen_tests.in (net-packet_mreq-Xabbrev, net-packet_mreq-Xraw, + net-packet_mreq-Xverbose): New tests. + * tests/pure_executables.list: Add net-packet_mreq-Xabbrev, + net-packet_mreq-Xraw, and et-packet_mreq-Xverbose. + * tests/.gitignore: Likewise. + + Co-Authored-by: Dmitry V. Levin + +2019-03-17 Shankara Pailoor + + net: print mac address consistently. + * net.c (print_packet_mreq): Call PRINT_FIELD_MAC_SZ instead of custom + print. + * tests/net-packet_mreq.c (test_packet_mreq): Update expected output. + + Co-Authored-by: Dmitry V. Levin + +2019-03-17 Dmitry V. Levin + + Change -D option to imply -I4. + * strace.c (init) [daemonized_tracer && !opt_intr]: Set opt_intr + to INTR_BLOCK_TSTP_TOO. + * strace.1.in: Document this. + * NEWS: Mention this change. + + Resolves: https://github.com/strace/strace/issues/96 + +2019-03-15 Tuan Hoang + + s390: fix SIGNAL_FRAMESIZE macro. + Since __SIGNAL_FRAMESIZE is in private name space, it is better not to + use it directly. This macro has been stable on s390/s390x so it is safe + to use the integer value. + + * linux/s390/arch_sigreturn.c [!SIGNAL_FRAMESIZE] (SIGNAL_FRAMESIZE): + Define to 96. + * linux/s390x/arch_sigreturn.c (arch_sigreturn == s390_arch_sigreturn): + Remove S390_SIGNAL_FRAMESIZE and SIGNAL_FRAMESIZE. + (arch_sigreturn == s390x_arch_sigreturn): Define SIGNAL_FRAMESIZE. + * linux/s390/rt_sigframe.h (SIGNAL_FRAMESIZE): Define. + (struct_rt_sigframe): Replace __SIGNAL_FRAMESIZE with SIGNAL_FRAMESIZE. + + Co-Authored-by: Dmitry V. Levin + +2019-03-14 Dmitry V. Levin + + bpf: add support for new seven fields in BPF_PROG_LOAD. + * bpf_attr.h (struct BPF_PROG_LOAD_struct): Add prog_btf_fd, + func_info_rec_size, func_info, func_info_cnt, line_info_rec_size, + line_info, and line_info_cnt fields. + * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Decode these fields + introduced by Linux commits v5.0-rc1~129^2~209^2~16^2~8 and + v5.0-rc1~129^2~114^2~5^2~6. + * tests/bpf.c (BPF_PROG_LOAD_checks): Check it. + * tests/kernel_version.c (print_bpf_attr): Update expected output. + * tests/bpf-obj_get_info_by_fd.c (print_prog_load): Likewise. + +2019-03-13 Dmitry V. Levin + + bpf: implement decoding of BPF_TASK_FD_QUERY command. + BPF_TASK_FD_QUERY command was introduced by Linux commit + v4.18-rc1~114^2~148^2~1^2~5. + + * bpf_attr.h (struct BPF_TASK_FD_QUERY_struct): New type. + (BPF_TASK_FD_QUERY_struct_size, + expected_BPF_TASK_FD_QUERY_struct_size): New macros. + * bpf.c: Include "xlat/bpf_task_fd_type.h". + (BEGIN_BPF_CMD_DECODER(BPF_TASK_FD_QUERY)): New bpf command decoder. + (SYS_FUNC(bpf)) : Add + BPF_CMD_ENTRY(BPF_TASK_FD_QUERY). + * xlat/bpf_task_fd_type.in: New file. + * tests/bpf.c (union bpf_attr_data): Add + BPF_ATTR_DATA_FIELD(BPF_TASK_FD_QUERY). + (BPF_TASK_FD_QUERY_checks): New checks array. + (main) : Add CHK(BPF_TASK_FD_QUERY). + +2019-03-13 Dmitry V. Levin + + bpf: implement decoding of BPF_MAP_LOOKUP_AND_DELETE_ELEM command. + BPF_MAP_LOOKUP_AND_DELETE_ELEM command was introduced by Linux commit + v4.20-rc1~151^2~32^2~11^2~2. + + * bpf.c (decode_BPF_MAP_LOOKUP_AND_DELETE_ELEM): Alias + to decode_BPF_MAP_LOOKUP_ELEM. + (SYS_FUNC(bpf)) : Add + BPF_CMD_ENTRY(BPF_MAP_LOOKUP_AND_DELETE_ELEM). + * tests/bpf.c (BPF_MAP_LOOKUP_AND_DELETE_ELEM_checks): Alias + to BPF_MAP_LOOKUP_ELEM_checks. + (main) : Add CHK(BPF_MAP_LOOKUP_AND_DELETE_ELEM). + +2019-03-13 Dmitry V. Levin + + bpf: implement decoding of BPF_BTF_GET_FD_BY_ID command. + BPF_BTF_GET_FD_BY_ID command was introduced by Linux commit + v4.18-rc1~114^2~223^2~21^2~4. + + * bpf_attr.h (struct BPF_BTF_GET_FD_BY_ID_struct): New type. + (BPF_BTF_GET_FD_BY_ID_struct_size, + expected_BPF_BTF_GET_FD_BY_ID_struct_size): New macros. + * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_BTF_GET_FD_BY_ID)): New bpf command + decoder. + (SYS_FUNC(bpf)) : Add + BPF_CMD_ENTRY(BPF_BTF_GET_FD_BY_ID). + * tests/bpf.c (union bpf_attr_data): Add + BPF_ATTR_DATA_FIELD(BPF_BTF_GET_FD_BY_ID). + (BPF_BTF_GET_FD_BY_ID_checks): New checks array. + (main) : Add CHK(BPF_BTF_GET_FD_BY_ID). + +2019-03-13 Dmitry V. Levin + + bpf: implement decoding of BPF_BTF_LOAD command. + BPF_BTF_LOAD command was introduced by Linux commit + v4.18-rc1~114^2~417^2~1^2~5. + + * bpf_attr.h (struct BPF_BTF_LOAD_struct): New type. + (BPF_BTF_LOAD_struct_size, expected_BPF_BTF_LOAD_struct_size): New + macros. + * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_BTF_LOAD)): New bpf command decoder. + (SYS_FUNC(bpf)) : Add BPF_CMD_ENTRY(BPF_BTF_LOAD). + * tests/bpf.c (union bpf_attr_data): Add + BPF_ATTR_DATA_FIELD(BPF_BTF_LOAD). + (init_BPF_BTF_LOAD_attr): New function. + (BPF_BTF_LOAD_checks): New checks array. + (main) : Add CHK(BPF_BTF_LOAD). + +2019-03-13 Dmitry V. Levin + + bpf: make decoders of BPF_*_GET_FD_BY_ID commands return RVAL_FD. + These bpf commands return file descriptors. + + * bpf.c (BPF_PROG_GET_FD_BY_ID, BPF_MAP_GET_FD_BY_ID): Add RVAL_FD + to END_BPF_CMD_DECODER. + +2019-03-12 Dmitry V. Levin + + bpf: add support for new twelve fields in struct bpf_prog_info. + * bpf_attr.h (struct bpf_prog_info_struct): Add btf_id, + func_info_rec_size, func_info, nr_func_info, nr_line_info, line_info, + jited_line_info, nr_jited_line_info, line_info_rec_size, + jited_line_info_rec_size, nr_prog_tags, and prog_tags fields. + * bpf.c (struct obj_get_info_saved): Add func_info_rec_size, + nr_func_info, nr_line_info, jited_line_info, nr_jited_line_info, + line_info_rec_size, jited_line_info_rec_size, and nr_prog_tags fields. + (print_bpf_prog_info): Decode the twelve fields introduced by Linux + commits v5.0-rc1~129^2~209^2~16^2~8, v5.0-rc1~129^2~114^2~5^2~6, + v5.0-rc1~129^2~114^2^2~2, and v5.0-rc1~129^2~15^2~22. + * NEWS: Mention the latest bpf decoding enhancements. + * tests/bpf-obj_get_info_by_fd.c (main): Update expected output. + + Resolves: https://github.com/strace/strace/issues/94 + +2019-03-12 Dmitry V. Levin + + bpf: add support for *jited_ksyms and *jited_func_lens fields in struct bpf_prog_info + * bpf_attr.h (struct bpf_prog_info_struct): Add nr_jited_ksyms, + nr_jited_func_lens, jited_ksyms, and jited_func_lens fields. + * bpf.c (struct obj_get_info_saved): Likewise. + (print_bpf_prog_info): Decode these fields introduced by Linux commits + v4.18-rc1~114^2~148^2~3^2~6 and v4.18-rc1~114^2~148^2~3^2~2. + * tests/bpf-obj_get_info_by_fd.c (main): Update expected output. + + bpf: add support for btf_* fields in struct bpf_map_info. + * bpf_attr.h (struct bpf_map_info_struct): Add btf_fd, btf_key_type_id, + and btf_value_type_id fields. + * bpf.c (print_bpf_map_info): Decode btf_fd, btf_key_type_id, + and btf_value_type_id fields introduced by Linux commits + v4.18-rc1~114^2~223^2~21^2~4 and v4.18-rc1~114^2~148^2~7^2~2. + * tests/bpf-obj_get_info_by_fd.c (main): Update expected output. + + bpf: add support for btf_* fields in BPF_MAP_CREATE. + * bpf_attr.h (struct BPF_MAP_CREATE_struct): Add btf_fd, + btf_key_type_id, and btf_value_type_id fields. + * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)): Decode btf_fd, + btf_key_type_id, and btf_value_type_id fields introduced by Linux + commits v4.18-rc1~114^2~417^2~1^2~3 and v4.18-rc1~114^2~148^2~7^2~2. + * tests/bpf.c (BPF_MAP_CREATE_checks): Check it. + * tests/bpf-obj_get_info_by_fd.c (print_map_create): Update expected + output. + +2019-03-12 Dmitry V. Levin + + bpf: print struct bpf_prog_info.gpl_compatible. + This bit field was added by Linux commit v4.18-rc1~114^2~376^2~6. + + * bpf_attr.h (struct bpf_prog_info_struct): Add gpl_compatible field. + * bpf.c (print_bpf_prog_info): Print gpl_compatible field. + * tests/bpf-obj_get_info_by_fd.c (main): Update expected output. + +2019-03-12 Dmitry V. Levin + + bpf: exclude bit fields from the check. + Currently we have no instruments to check the size and offsets + of bit fields. + + * gen_bpf_attr_check.sh: Do not print bit fields. + * m4/gen_bpf_attr_m4.awk: Likewise. + +2019-03-06 Eugene Syromyatnikov + + Implement queueing of threads before dispatching them. + It is possible that some tracees call a lot of cheap syscalls too fast, + and that can stress the tracer to the point some tracees are not served + for indefinite amount of time. In order to avoid that unfairness, try + to collect all the pending tracees first along with the relevant + information and only then dispatch the events. + + * defs.h: Include "list.h". + (struct tcb): Add wait_data_idx, delayed_wait_data, and wait_list + fields. + * strace.c (struct tcb_wait_data): Add "msg" field. + (tcb_wait_tab, tcb_wait_tab_size): New static variables. + (alloctcb): Initialize wait_list. + (droptcb): Remove tcp from wait_list. + (maybe_switch_tcbs): Get old pid from + tcb_wait_tab[tcp->wait_data_idx].msg instead of calling + ptrace(PTRACE_GETEVENTMSG). + (trace_wait_data_size, init_trace_wait_data, copy_trace_wait_data, + free_trace_wait_data, tcb_wait_tab_check_size): New functions, in order + to allow the code outside next_event to operate with wait_data as with + an opaque object (needed for dispatch_event and restart_delayed_tcb). + (next_event): Add pending_tcps, extra_tcp, wait_nohang, elem, and + wait_tab_pos variables; check for elements in pending_tcps and skip + waiting if the list is not empty; check for extra_tcp and skip waiting + along with swapping wait_data_idx with wait_extra_data_idx; + after the initial wait4(), call wait4() in loop with WNOHANG flag set; + fetch siginfo on signal and eventmsg on PTRACE_EVENT_EXEC; + return the first tcp in pending_tcps list. + (dispatch_event): Store a pointer to a copy of tcb_wait_data in + tcp->delayed_wait_data if tcp's restart has to be delayed. + (restart_delayed_tcb): Use tcp->delayed_wait_data, create a stub + tcb_wait_data if it is NULL, free temporary trace_wait_data. + * tests/Makefile.am (XFAIL_TEST): Remove looping_threads.test. + + Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=478419 + Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=526740 + Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=851457 + Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1609318 + Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1610774 + Co-Authored-by: Dmitry V. Levin + Co-Authored-by: Denys Vlasenko + Co-Authored-by: Andreas Schwab + Co-Authored-by: Jeff Law + Co-Authored-by: DJ Delorie + +2019-03-06 Eugene Syromyatnikov + + Add a generic list implementation. + Similar to the one used in the Linux kernel. + + * macros.h (cast_ptr, containerof): New macros. + * list.h: New file. + * Makefile.am (strace_SOURCES): Add it. + +2019-03-06 Dmitry V. Levin + + tests: check tracing of looping threads. + * test/many_looping_threads.c: Remove. + * test/.gitignore: Remove many_looping_threads. + * test/Makefile (PROGS): Likewise. + (many_looping_threads): Remove. + * tests/looping_threads.c: New file. + * tests/looping_threads.test: New test. + * tests/.gitignore: Add looping_threads. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (looping_threads_LDADD): New variable. + (MISC_TESTS, XFAIL_TESTS): Add looping_threads.test. + +2019-03-06 Dmitry V. Levin + + Bump SYS_socket_subcall from 400 to 500. + Make room for syscalls that are going to be introduced in Linux 5.1. + + * linux/i386/syscallent.h (SYS_socket_subcall): Raise from 400 to 500. + * linux/m68k/syscallent.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/mips/syscallent-o32.h (SYS_socket_subcall): Raise from 4400 + to 4500. + * linux/mips/syscallent-n64.h (SYS_socket_subcall): Raise from 5400 + to 5500. + * linux/mips/syscallent-n32.h (SYS_socket_subcall): Raise from 6400 + to 6500. + +2019-03-06 Dmitry V. Levin + + tests: check tracing of orphaned process group. + * tests/orphaned_process_group.c: New file. + * tests/.gitignore: Add orphaned_process_group. + * tests/Makefile.am (check_PROGRAMS): Likewise. + * tests/gen_tests.in (orphaned_process_group): New test. + +2019-03-06 Dmitry V. Levin + + tests: move PTRACE_SEIZE check to a separate file. + The check is going to be used by another test soon. + + * tests/PTRACE_SEIZE.sh: New file. + * tests/detach-stopped.test: Use it. + * tests/Makefile.am (EXTRA_DIST): Add PTRACE_SEIZE.sh. + +2019-02-25 Eugene Syromyatnikov + + strace.c: fix up formatting after commit v4.24~48. + The commit v4.24~48 "Implement -e kvm= option on all architectures", + while removing #ifdef, left formatting of the help message string a bit + inconsistent. + + * strace.c (usage): Move "\n\" bit after "kvm", remove double quotes. + + Complements: v4.24~48 "Implement -e kvm= option on all architectures" + +2019-02-25 Eugene Syromyatnikov + + tests: fix xgetrlimit output when syscall returns an error. + * tests/xgetrlimit.c (main): Expect pointer to rlimit as the second + argument when syscall returns an error. Use sprintrc(). + + strace.c: pass signal number to cleanup() + * strace.c (die): Pass 0 as an argument to cleanup(). + (cleanup): Add fatal_sig parameter, remove the local variable + of the same name, do not use interrupted. + (terminate): Initialise a new local variable "sig" with "interrupted", + pass it to cleanup() and use it instead of "interrupted" for exit_code + initialisation. + +2019-02-25 Gleb Fotengauer-Malinovskiy + + Update ioctl entries from linux v5.0. + * linux/32/ioctls_inc_align16.h: Update from linux v5.0-rc8 + using ioctls_gen.sh. + * linux/32/ioctls_inc_align32.h: Likewise. + * linux/32/ioctls_inc_align64.h: Likewise. + * linux/64/ioctls_inc.h: Likewise. + * linux/x32/ioctls_inc0.h: Likewise. + * linux/aarch64/ioctls_arch0.h: Likewise. + * linux/arm/ioctls_arch0.h: Likewise. + * linux/mips/ioctls_arch0.h: Likewise. + * linux/powerpc/ioctls_arch0.h: Likewise. + * linux/s390/ioctls_arch0.h: Likewise. + * linux/s390x/ioctls_arch0.h: Likewise. + * NEWS: Mention this. + + maint: update for linux 5.0-rc8. + * maint/ioctls_sym.sh (x86_list): Add KVM_GET_SUPPORTED_HV_CPUID. + +2019-02-24 Dmitry V. Levin + + xlat/gen.sh: disable file name globbing by default. + As the script uses file name globbing only in one place, + disable it by default and enable it when necessary. + + * xlat/gen.sh: Add -f to shebang. + (main): Enable file name globbing to generate the list of input files. + +2019-02-24 Eugene Syromyatnikov + + xlat/gen.sh: speedup, part 5. + * xlat/gen.sh (gen_header): Process xlat line with sed only when "/*" + substring is present in it. + + Co-Authored-by: Dmitry V. Levin + +2019-02-24 Eugene Syromyatnikov + + xlat/gen.sh: speedup, part 4. + * xlat/gen.sh (cond_xlat): Use read instead of sed for xlat entry + parsing. + + Co-Authored-by: Dmitry V. Levin + +2019-02-24 Eugene Syromyatnikov + + xlat/gen.sh: speedup, part 3. + * xlat/gen.sh (cond_def): Use parameter substitution instead of sed + for xlat line parsing. + + Co-Authored-by: Dmitry V. Levin + +2019-02-24 Eugene Syromyatnikov + + xlat/gen.sh: speedup, part 2. + * xlat/gen.sh (gen_header): Use "grep -q" instead of "grep > /dev/null". + + xlat/gen.sh: speedup, part 1. + * xlat/gen.sh (cond_def, cond_xlat): Use printf builtin instead of cat. + + xlat/gen.sh: cleanup. + * xlat/gen.sh: Export LC_ALL=C so it could be omitted from individual + invocations. + (cond_def): Remove LC_ALL=C from sed invocation. + (gen_header): Remove LC_COLLATE=C. + +2019-02-22 Eugene Syromyatnikov + + Makefile.am: pass D variable to shell scripts' environment. + And set -x if D is set to 1, so the commands called by various shell scripts + are easier to see during debugging. + + * Makefile.am (bpf_attr_check.c, sen.h, mpers-m%.stamp, $(srcdir)/CREDITS): Pass + D variable in the environment to the shell script call. + * gen_bpf_attr_check.sh: Set -x if D is set to 1. + * generate_mpers_am.sh: Likewise. + * generate_sen.sh: Likewise. + * maint/gen-contributors-list.sh: Likewise. + * mpers.sh: Likewise. + * mpers_test.sh: Likewise. + +2019-02-21 Eugene Syromyatnikov + + tests: add checks for dumpstr output into read-write test. + util.c:dumpstr() now aligns offsets in accordance with the total length + of the dump and also may perform only partial dump, so let's add checks + for these cases. + + * tests/fill_memory.c (fill_memory_ex): Change the type of the period + argument from unsigned char to unsigned int. + * tests/tests.h (fill_memory_ex): Likewise. + * tests/read-write.c (dump_str_ex): Rename from dump_str, add idx_w + argument, support len greater than 240 bytes. + (dump_str): New function, wrapper for dump_str_ex with the default index + width. + (print_hex): Add checks for dumpstr output, close fd 1 later. + +2019-02-20 Eugene Syromyatnikov + + util: update dumpstr. + Use a buffer of a limited size, use proper type for dump amount, avoid + hard-coding of byte counts, calculate output buffer size more accurately + and minimise its rewriting, pad offset with zeros in accordance + with expected output amount. + + * defs.h (dumpstr): Change the type of len argument from int to + kernel_ulong_t. + * macros.h (ROUNDUP_DIV): New macro. + (ROUNDUP): Rewrite using ROUNDUP_DIV. + * util.c (ILOG2_ITER_): New macro. + (ilog2_64, ilog2_32): New functions. + (ilog2_klong): New macro, wrapper around ilog2_32/ilog2_64, so (potentially + more expensive) ilog2_64 is not used for ilog2 calculation + of a kernel_ulong_t-typed variable on architectures with 32-bit kernel long. + (dumpstr): Update. + + Co-Authored-by: Dmitry V. Levin + +2019-02-20 Eugene Syromyatnikov + + Generalise UUID printing. + It was open-coded (using yet another open-coded hexadecimal character + printing) in btrfs.c and can be used in other places (like dm.c or + rtnl_link.c). + + * defs.h (print_uuid): New declaration. + * print_fields.h (PRINT_FIELD_UUID): New macro. + * util.c (print_uuid): New function. + * btrfs.c (prnibble, UUID_STRING_SIZE, btrfs_unparse_uuid): Remove. + (btrfs_ioctl): Use PRINT_FIELD_UUID for UUID printing. + +2019-02-20 Eugene Syromyatnikov + + Generalise some printing primitives. + Character class checks and hexadecimal number formatting are open-coded + all over the place, let's try to de-duplicate them a bit. + + * print_utils.h: New file. + * Makefile.am (strace_SOURCES): Add it. + * util.c: Include "print_utils.h". + (string_quote, dumpstr): Use sprint_byte_hex and is_print. + * v4l2.c: Include "print_utils.h". + (print_pixelformat): Use is_print and BYTE_HEX_CHARS_PRINTF_QUOTED, + add a note that the routine is rather generic. + +2019-02-19 Eugene Syromyatnikov + + Move call_summary() from cleanup() to terminate() + cleanup() has exactly two call sites, die() and terminate(), and the + first one resets cflag in order to prevent call_summary() invocation. + Move the call to terminate() in order to avoid bogus cflag reset. + + * strace.c (die): Remove cflag reset. + (cleanup): Move call_summary() call ... + (terminate): ... here. + +2019-02-19 Eugene Syromyatnikov + + defs.h: define stack_trace_enabled to 0 is stack tracing is not enabled. + This allows avoiding ifdefs sometimes. + + * defs.h [!ENABLE_STACKTRACE] (stack_trace_enabled): Define as 0. + * strace.c (init): Remove #ifdef ENABLE_STACKTRACE around -c/-k check. + +2019-02-19 Dmitry V. Levin + + build: fix --with-libiberty. + * m4/st_demangle.m4 (st_DEMANGLE): Move the check for cplus_demangle + out of AC_CHECK_HEADERS because the latter checks for demangle.h in two + different places and an absence of demangle.h in one of these places + would cause a build error in --with-libiberty=yes mode. + * NEWS: Mention this fix. + + Resolves: https://github.com/strace/strace/issues/92 + +2019-02-18 Shankara Pailoor + + Honor xlat styles when decoding ioprio_get and ioprio_set. + * ioprio.c (SYS_FUNC(ioprio_get), SYS_FUNC(ioprio_set)): Add xlat_style + support. + * tests/ioprio-Xabbrev.c: New file. + * tests/ioprio-Xraw.c: Likewise. + * tests/ioprio-Xverbose.c: Likewise. + * tests/ioprio.c: Handle XLAT_RAW, XLAT_ABBREV, and XLAT_VERBOSE macros. + * tests/gen_tests.in (ioprio-Xabbrev, ioprio-Xraw, ioprio-Xverbose): New + tests. + * tests/pure_executables.list: Add ioprio-Xabbrev, ioprio-Xraw, and + ioprio-Xverbose. + * tests/.gitignore: Likewise. + + Co-Authored-by: Dmitry V. Levin + +2019-02-18 Shankara Pailoor + + move_pages: honor xlat styles. + * numa.c (print_status): Add xlat_style support for status argument. + * tests/move_pages-Xabbrev.c: New file. + * tests/move_pages-Xraw.c: Likewise. + * tests/move_pages-Xverbose.c: Likewise. + * tests/move_pages.c: Handle XLAT_RAW, XLAT_ABBREV, and XLAT_VERBOSE + macros. + * tests/gen_tests.in (move_pages-Xabbrev, move_pages-Xraw, + move_pages-Xverbose): New tests. + * tests/pure_executables.list: Add move_pages-Xabbrev, move_pages-Xraw, + and move_pages-Xverbose. + * tests/.gitignore: Likewise. + +2019-02-18 Dmitry V. Levin + + tests: robustify threads-execve test against the odds. + Give threads-execve.test more chances to succeed. + + * tests/threads-execve.test: Retry the test until run out of time. + +2019-02-17 Shankara Pailoor + + Honor xlat styles when decoding resource limits. + * resource.c (sprint_rlim64, sprint_rlim32): Remove. + (print_rlim64_t, print_rlim32_t): New functions. + (print_rlimit64, print_rlimit32): Use them. + * tests/setrlimit-Xabbrev.c: New file. + * tests/setrlimit-Xraw.c: Likewise. + * tests/setrlimit-Xverbose.c: Likewise. + * tests/setrlimit.c (main): Handle XLAT_ABBREV, XLAT_RAW, + and XLAT_VERBOSE macros. + * tests/xgetrlimit.c (sprint_rlim): Likewise. + * tests/gen_tests.in (setrlimit-Xabbrev, setrlimit-Xraw, + setrlimit-Xverbose): New tests. + * tests/pure_executables.list: Add setrlimit-Xabbrev, setrlimit-Xraw, + and setrlimit-Xverbose. + * tests/.gitignore: Likewise. + + Co-Authored-by: Dmitry V. Levin + +2019-02-17 Dmitry V. Levin + + hppa: workaround kernel bug in syscall number tampering. + Linux kernel commit v4.6-rc2~20^2 introduced a regression: + when tracer changes syscall number to -1, the kernel fails + to initialize %r28 with -ENOSYS and subsequently fails + to return the error code of the failed syscall to userspace. + Workaround this by initializing %r28 ourselves. + + * linux/arch_defs_.h (ARCH_NEEDS_SET_ERROR_FOR_SCNO_TAMPERING): Define + to 0. + * linux/hppa/arch_defs_.h (ARCH_NEEDS_SET_ERROR_FOR_SCNO_TAMPERING): + Define to 1. + * syscall.c (tamper_with_syscall_entering) + [ARCH_NEEDS_SET_ERROR_FOR_SCNO_TAMPERING]: When changing syscall number + to -1, set the return value as well. + +2019-02-16 Dmitry V. Levin + + hppa: define PT_* constants as offsets inside struct pt_regs. + Define constants passed to upeek and upoke using a method that works + with different wordsize values. + + * linux/hppa/arch_regs.c (PT_GR26, PT_GR30, PT_IAOQ0, PT_IAOQ1): Remove. + (PT_GR20, PT_GR28, ARCH_PC_PEEK_ADDR, ARCH_SP_PEEK_ADDR): Redefine using + offsets inside struct pt_regs. + * linux/hppa/get_syscall_args.c (arch_get_syscall_args): Replace PT_GR26 + with offsets inside struct pt_regs. + +2019-02-16 Dmitry V. Levin + + hppa: enhance decoding of PTRACE_PEEKUSER and PTRACE_POKEUSER. + Print symbolic constants corresponding to numeric arguments + of PTRACE_PEEKUSER and PTRACE_POKEUSER requests. + + * linux/hppa/userent.h: New file. + * Makefile.am (EXTRA_DIST): Add it. + * NEWS: Mention this. + +2019-02-15 Dmitry V. Levin + + mips o32: fix 7th syscall argument with PTRACE_GET_SYSCALL_INFO API. + As PTRACE_GET_SYSCALL_INFO API supports 6 syscall arguments, + all architectures that have syscalls with more than 6 arguments + (i.e. mips o32) have to fetch extra arguments manually when using + PTRACE_GET_SYSCALL_INFO API. + + * linux/mips/get_syscall_args.c [LINUX_MIPSO32] + (arch_get_syscall_args_extra): New function. + * syscall.c (get_syscall_args) [MAX_ARGS > 6]: Use it. + + Fixes: v4.26~49 "Introduce PTRACE_GET_SYSCALL_INFO support" + +2019-02-15 Dmitry V. Levin + + mips: update comment. + * linux/mips/get_syscall_args.c (decode_syscall_subcall): Update comment. + + Complements: v4.26-27-g2c8b6de91 "mips o32: fix build" + +2019-02-11 Eugene Syromyatnikov + + tests: add kill_child test. + This tests repeatedly creates and kills children, so some corner + cases in handling of not-quite-existing processes can be observed. + + Previously, strace was crashing in the following situation: + + 13994 ????( + ... + 13994 <... ???? resumed>) = ? + + as tcp->s_ent wasn't initialised on syscall entering and + strace.c:print_event_exit segfaulted when tried to access + tcp->s_ent->sys_name. + + * tests/kill_child.c: New file. + * tests/kill_child.test: New test. + * tests/.gitignore: Add kill_child. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (MISC_TESTS): Add kill_child.test. + + Co-Authored-by: Dmitry V. Levin + +2019-02-11 Dmitry V. Levin + + Wire up kexec_file_load syscall on architectures that use generic unistd.h + * linux/32/syscallent.h [294]: Wire up kexec_file_load syscall + introduced by linux commit v5.0-rc1~35^2~41^2~15. + * linux/64/syscallent.h [294]: Likewise. + * NEWS: Mention this. + + Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1676045 + +2019-02-11 Dmitry V. Levin + + Wire up rseq syscall on architectures that use generic unistd.h. + * linux/32/syscallent.h [293]: Wire up rseq syscall introduced by linux + commit v4.19-rc1~109^2~47. + * linux/64/syscallent.h [293]: Likewise. + * NEWS: Mention this. + +2019-02-11 Dmitry V. Levin + + tests: robustify preadv2-pwritev2 test against odd kernels. + The test used to assume that either both preadv2 and pwritev2 syscalls + are implemented or both are not implemented, but, apparently, there are + kernels in the wild that implement just preadv2 syscall without + pwritev2. + + * tests/preadv2-pwritev2.c (main): Skip the dumpio part of the test + if either preadv2 or pwritev2 syscall is not implemented. + + Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1668750 + +2019-02-11 Eugene Syromyatnikov + + ptrace_restart: do not print diagnostics when ptrace returns ESRCH. + After some discussion, it was decided that the situation + when the tracee is gone does not worth reporting. + + * strace.c (ptrace_restart): Return early if ptrace returned ESRCH. + + Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1662936 + +2019-02-11 Eugene Syromyatnikov + + ptrace_restart: use xlat-based approach for printing ptrace requests. + * defs.h (ptrace_cmds): New prototype. + * strace.c (ptrace_op_str): New function. + (ptrace_restart): Use it. + +2019-02-10 Dmitry V. Levin + + Fix whitespace issues. + * Makefile.am (strace_SOURCES, EXTRA_DIST): Replace SPACE symbol followed + by TAB symbol with TAB symbol. + * kvm.c (is_map_for_file): Likewise. + * tests/gen_tests.in (ioctl_ptp, printsignal-Xverbose): Likewise. + * xlat/skf_ad.in: Likewise. + +2019-02-10 Eugene Syromyatnikov + + Make inline message on failed restart attempt more verbose. + Hopefully, now it is less confusing. + + * strace.c (ptrace_restart): Provide intent and pid in the inline error + message. + + References: https://bugzilla.redhat.com/show_bug.cgi?id=1662936 + +2019-02-09 Eugene Syromyatnikov + + syscall.c: set MEMORY_MAPPING_CHANGE in stub sysent. + As unknown syscalls may incur unknown side effects. + + * syscall.c (stub_sysent): Set sys_flags to MEMORY_MAPPING_CHANGE. + +2019-02-09 Eugene Syromyatnikov + + Use accessors for tcp->s_ent, return a stub struct if it is NULL. + Since code paths are non-trivial, it's an attempt to future-proof + and prevent improper access of tcp->s_ent fields. + + * defs.h (struct tcb): Update the description of s_ent field. + (stub_sysent): New declaration. + (tcp_sysent, n_args): New macro functions. + (indirect_ipccall): Use tcp_sysent() instead of tcp->s_ent. + * ipc.c (SYS_FUNC(ipc)): Use n_args() instead of tcp->s_ent->nargs. + * linux/alpha/get_syscall_args.c (get_syscall_args): Likewise. + * linux/bfin/get_syscall_args.c (get_syscall_args): Likewise. + * linux/hppa/get_syscall_args.c (get_syscall_args): Likewise. + * linux/ia64/get_syscall_args.c (get_syscall_args): Likewise. + * linux/microblaze/get_syscall_args.c (get_syscall_args): Likewise. + * linux/mips/get_syscall_args.c (get_syscall_args): Likewise. + * linux/sh/get_syscall_args.c (get_syscall_args): Likewise. + * linux/sh64/get_syscall_args.c (get_syscall_args): Likewise. + * linux/x86_64/get_syscall_args.c (get_syscall_args): Likewise. + * linux/xtensa/get_syscall_args.c (get_syscall_args): Likewise. + * prctl.c (print_prctl_args): Likewise. + * signal.c (SYS_FUNC(sgetmask)): Likewise. + * util.c (printargs, printargs_u, printargs_d): Likewise. + * syscall.c (decode_ipc_subcall, decode_syscall_subcall: Likewise. + (dumpio, tamper_with_syscall_exiting, syscall_entering_decode, + syscall_entering_decode, syscall_entering_trace, syscall_entering_trace, + syscall_exiting_decode, print_syscall_resume, syscall_exiting_trace, + get_syscall_result): Use tcp_sysent() instead of tcp->s_ent. + (stub_sysent): New stub sysent. + (get_scno): Reset scno, s_ent, qual_flg; initialise s->ent from + stub_sysent. + * pathtrace.c (pathtrace_match_set): Use tcp_sysent() instead of + tcp->s_ent. + + Co-Authored-by: Dmitry V. Levin + +2019-02-09 Eugene Syromyatnikov + + syscall.c: remove arch check for SEN_execv usage. + SEN_* declarations are always present and can be used regardless + of architecture. + + * syscall.c (syscall_entering_trace): Remove "#if defined SPARC || + defined SPARC64" guard. + +2019-02-09 Eugene Syromyatnikov + + Merge "<... resumed>" printing. + Apparently, it was slightly different with no apparent reason. + Use a single routine to print this message now. + + * defs.h (print_syscall_resume): New function declaration. + * strace.c (print_event_exit): Replace open-coding of "<... resumed>" + message printing with a print_syscall_resume() call. + * syscall.c (syscall_exiting_trace): Likewise. + (print_syscall_resume): New function. + * tests/threads-execve.c: Update expected output. + +2019-01-09 Shankara Pailoor + + sockaddr: print sin6_flowinfo field before sin6_addr. + The sin6_flowinfo field comes before sin6_addr in the sockaddr_in6 + defintion, but for some reason we switch the order when decoding. + This patch fixes the order of decoding. + + * sockaddr.c (print_sockaddr_data_in6): Print sin6_flowinfo field + before sin6_addr. + * NEWS: Mention this fix. + * tests/group_req.c (main): Update expected output. + * tests/net-sockaddr.c (check_in6_linklocal, check_in6): Likewise. + * tests/net-yy-inet6.c (INADDR_STR, SA_FIELDS): Likewise. + * tests/sockaddr_xlat.c (validate_in6): Likewise. + +2019-01-08 Dmitry V. Levin + + mips o32: fix build. + Commit 917c2ccf3a67 "Refactor stack pointers" moved mips_REG_* macros + from linux/mips/arch_regs.h to linux/mips/arch_regs.c because these + macros are no longer used outside syscall.c or files included by + syscall.c, but this caused a build regression on mips o32 because + decode_syscall_subcall() uses mips_REG_SP prior to its definition. + + * syscall.c (decode_syscall_subcall): Move ... + * linux/mips/get_syscall_args.c: ... here. + * NEWS: Mention this fix. + + Reported-by: Baruch Siach + Fixes: v4.26~61 "Refactor stack pointers" + +2019-01-08 Baruch Siach + + Fix build for no-MMU targets. + Commit 7488ce9e23f1 "Check whether PTRACE_GET_SYSCALL_INFO is supported + by the kernel" added a fork() call in test_ptrace_get_syscall_info() + which is included in the main strace executable code. Although the + test_ptrace_get_syscall_info() routine is not called on no-MMU targets, + the compiler can't optimize it out because it is a global symbol. + So build for no-MMU targets currently fails: + + strace-ptrace_syscall_info.o: In function `test_ptrace_get_syscall_info': + ptrace_syscall_info.c:(.text+0x1c): undefined reference to `fork' + + * ptrace_syscall_info.c (test_ptrace_get_syscall_info): Make + the definition depend on HAVE_FORK. + * strace.c (init): Call test_ptrace_get_syscall_info unconditionally. + * NEWS: Mention this fix. + + Co-Authored-by: Dmitry V. Levin + Fixes: v4.26~50 "Check whether PTRACE_GET_SYSCALL_INFO is supported by the kernel" + +2019-01-08 Baruch Siach + + linux/mips/.gitignore: drop copyright header. + The '/*' in the first line of the copyright header matches all files in + that directory. No other .gitignore file has this header. Drop it. + + * linux/mips/.gitignore: Remove copyright header. + + Fixes: v4.26~23 "Add copyright headers to some files that lack them" + +2019-01-08 Shankara Pailoor + + Honor xlat styles when decoding sockaddr_in, sockaddr_in6, and sockaddr_ll + * print_fields.h (PRINT_FIELD_NET_PORT): Handle xlat styles. + * sockaddr.c (print_sll_protocol): New function. + (print_sockaddr_data_ll, print_inet_addr, print_sockaddr_data_in6): + Handle xlat styles. + * NEWS: Mention this. + * tests/sockaddr_xlat.c: New file. + * tests/sockaddr_xlat-Xabbrev.c: Likewise. + * tests/sockaddr_xlat-Xraw.c: Likewise. + * tests/sockaddr_xlat-Xverbose.c: Likewise. + * tests/Makefile.am (EXTRA_DIST): Add sockaddr_xlat.c. + * tests/gen_tests.in (sockaddr_xlat-Xabbrev, sockaddr_xlat-Xraw, + sockaddr_xlat-Xverbose): New tests. + * tests/pure_executables.list: Add sockaddr_xlat-Xabbrev, + sockaddr_xlat-Xraw, and sockaddr_xlat-Xverbose. + * tests/.gitignore: Likewise. + +2019-01-07 Dmitry V. Levin + + Remove PRINT_FIELD_INET4_ADDR. + Reduce code duplication by removing PRINT_FIELD_INET4_ADDR + and using PRINT_FIELD_INET_ADDR instead. + + * print_fields.h (PRINT_FIELD_INET4_ADDR): Remove. + * msghdr.c (print_cmsg_ip_pktinfo): Use PRINT_FIELD_INET_ADDR + instead of PRINT_FIELD_INET4_ADDR. + * net.c (print_mreq): Likewise. + * sockaddr.c (print_sockaddr_data_in): Likewise. + +2019-01-05 Dmitry V. Levin + + xlat: update REL_* constants. + * xlat/evdev_relative_axes.in (REL_HWHEEL_HI_RES): New constant + introduced by Linux kernel commit v5.0-rc1~18^2^7~7. + * NEWS: Mention this. + + xlat: update UDP_* constants. + * xlat/sock_udp_options.in (UDP_GRO): New constant introduced + by Linux kernel commit v5.0-rc1~129^2~379^2~8. + * NEWS: Mention this. + + xlat: update FAN_* constants. + * xlat/fan_event_flags.in (FAN_OPEN_EXEC, FAN_OPEN_EXEC_PERM): New + constants introduced by Linux kernel commits v5.0-rc1~124^2~5 + and v5.0-rc1~124^2~3, respectively. + * NEWS: Mention this. + * tests/fanotify_mark.c (main): Update expected output. + + xlat: update SCTP_* constants. + * xlat/sock_sctp_options.in (SCTP_EVENT): New constant introduced + by Linux kernel commit v5.0-rc1~129^2~255^2. + * NEWS: Mention this. + + xlat: update IFLA_* constants. + * xlat/rtnl_ifla_info_data_bridge_attrs.in (IFLA_BR_MULTI_BOOLOPT): New + constant introduced by Linux kernel commit v5.0-rc1~129^2~207^2~2. + * NEWS: Mention this. + * tests/nlattr_ifla_linkinfo.c (main): Update. + + xlat: update NETNSA_* constants. + * xlat/rtnl_nsid_attrs.in (NETNSA_TARGET_NSID, NETNSA_CURRENT_NSID): New + constants introduced by Linux kernel commits v5.0-rc1~129^2~201^2~2 + and v5.0-rc1~129^2~201^2, respectively. + * rtnl_nsid.c (rtgenmsg_nla_decoders): Add NETNSA_TARGET_NSID + and NETNSA_CURRENT_NSID. + * NEWS: Mention this. + + xlat: update SECCOMP_* constants. + * xlat/seccomp_ops.in (SECCOMP_GET_NOTIF_SIZES): New constant introduced + by Linux kernel commit v5.0-rc1~66^2~1^2~1. + * xlat/seccomp_ret_action.in (SECCOMP_RET_USER_NOTIF): Likewise. + * xlat/seccomp_filter_flags.in (SECCOMP_FILTER_FLAG_NEW_LISTENER): + Likewise. + * NEWS: Mention this. + * tests/seccomp-filter.c (main): Update expected output. + * tests/seccomp-filter-v.c (main): Likewise. + * tests/seccomp_get_action_avail.c (main): Check SECCOMP_RET_USER_NOTIF. + + xlat: update NT_* constants. + * xlat/nt_descriptor_types.in (NT_ARM_PAC_MASK, NT_MIPS_MSA): New + constants introduced by Linux kernel commits v5.0-rc1~35^2~21 + and v5.0-rc1~30^2~58, respectively. + * NEWS: Mention this. + + xlat: update PR_* constants. + * xlat/prctl_options.in (PR_PAC_RESET_KEYS): New constant introduced + by Linux kernel commit v5.0-rc1~35^2~19. + * NEWS: Mention this. + + xlat: update V4L2_* constants. + * xlat/v4l2_buf_types.in (V4L2_BUF_TYPE_META_OUTPUT): New constant + introduced by Linux kernel commit v5.0-rc1~181^2~21. + * xlat/v4l2_device_capabilities_flags.in (V4L2_CAP_META_OUTPUT): + Likewise. + * xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_CNF4): New constant introduced + by Linux kernel commit v5.0-rc1~182^2~120. + * NEWS: Mention this. + + xlat: update KVM_CAP_* constants. + * xlat/kvm_cap.in (KVM_CAP_MANUAL_DIRTY_LOG_PROTECT, + KVM_CAP_HYPERV_CPUID): New constants introduced by Linux kernel commits + v5.0-rc1~156^2~115 and v5.0-rc1~156^2~74, respectively. + * NEWS: Mention this. + + xlat: update NDA_* constants. + * xlat/rtnl_neigh_attrs.in (NDA_PROTOCOL): New constant introduced + by Linux kernel commit v5.0-rc1~129^2~79. + * rtnl_neigh.c (ndmsg_nla_decoders): Add NDA_PROTOCOL. + * NEWS: Mention this. + + xlat: update BTRFS_FEATURE_INCOMPAT_* constants. + * xlat/btrfs_features_incompat.in + (BTRFS_FEATURE_INCOMPAT_METADATA_UUID): New constant introduced by Linux + kernel commit v5.0-rc1~126^2~64. + * NEWS: Mention this. + + xlat: update *_MAGIC constants. + * xlat/fsmagic.in (BINDERFS_SUPER_MAGIC): New constant introduced + by Linux kernel commit v5.0-rc1~95^2~15. + * NEWS: Mention this. + + xlat: update KERN_* constants. + * xlat/sysctl_kern.in (KERN_PANIC_ON_WARN, KERN_PANIC_PRINT): New + constants introduced by Linux kernel commits v3.19-rc1~135^2~91 + and v5.0-rc1~38^2~16, respectively. + * configure.ac (AC_CHECK_DECLS): Add them. + * NEWS: Mention this. + + xlat: update BPF_F_* constants. + * xlat/bpf_map_flags.in (BPF_F_ZERO_SEED): New constant introduced + by Linux kernel commit v5.0-rc1~129^2~114^2~18^2~3. + * xlat/bpf_prog_flags.in (BPF_F_ANY_ALIGNMENT): New constant introduced + by Linux kernel commit v5.0-rc1~129^2~209^2~17^2~3. + * NEWS: Mention this. + * tests/bpf.c (BPF_MAP_CREATE_checks, BPF_PROG_LOAD_checks, + print_BPF_PROG_LOAD_attr3, print_BPF_PROG_LOAD_attr4): Update. + +2019-01-05 Martin Lau + + tests: fix prog_info initialization in bpf-obj_get_info_by_fd-prog* + The sys_bpf(BPF_OBJ_GET_INFO_BY_FD, &bpf_prog_get_info_attr, ...) is + called in a loop. The bpf_prog_get_info_attr.info object is in size 104 + but bpf_prog_get_info_attr.info_len is in size 168. Hence, if the prog + is jited, the second iteration onwards will have nr_jited_ksyms == 1 + which is asking the kernel to fill the + bpf_prog_get_info_attr.info.jited_ksyms and it is NULL. + + * tests/bpf-obj_get_info_by_fd.c (main): Clear memory beyond prog_info + at the start of every iteration. + + Co-Authored-by: Dmitry V. Levin + +2019-01-05 Dmitry V. Levin + + tests: use tail_alloc instead of calloc in bpf-obj_get_info_by_fd-prog* + This guarantees that map_info and prog_info objects are not accessed + out of bounds. + + * tests/bpf-obj_get_info_by_fd.c: Include . + (main): Use tail_alloc instead of calloc for map_info and prog_info. + +2019-01-02 Dmitry V. Levin + + Bring lists back to the sorted order. + * .gitignore: Make the list sorted again. + * Makefile.am (strace_SOURCES): Likewise. + * tests/.gitignore: Likewise. + * tests/gen_tests.in: Likewise. + * tests/Makefile.am (check_PROGRAMS, DECODER_TESTS, EXTRA_DIST): + Likewise. + +2019-01-01 Dmitry V. Levin + + tests: fix strace-k.test on alpha. + Change strace-k.test to use chdir syscall instead of getpid syscall + because the latter is not universally available, e.g. there is no getpid + syscall on alpha. + + * tests/stack-fcall-3.c (f3) : Replace getpid with chdir. + * tests/strace-k.test: Likewise. + * tests/strace-k.expected: Likewise. + * tests/strace-k-demangle.expected: Likewise. + * NEWS: Mention this. + +2018-12-30 Dmitry V. Levin + + Fix preprocessor indentation. + Indent the C preprocessor directives to reflect their nesting + using the following script: + + $ cppi -l $(git grep -El '^[[:space:]]*#[[:space:]]*(if|ifdef|ifndef|elif|else|endif|define|pragma)[[:space:]]' |grep -v '\.sh$') |while read f; do + cppi < "$f" > "$f".cppi; mv "$f".cppi "$f" + done + +2018-12-30 Dmitry V. Levin + + Post-release administrivia. + * NEWS: Add a header line for the next release. + * debian/changelog.in: Add a changelog entry for 4.26-1. + * strace.spec.in: Likewise. + +2018-12-26 Dmitry V. Levin + + Prepare for 4.26 release. + * NEWS: Update for 4.26 release. + + strace.spec.in: add a comment about the license. + +2018-12-26 Gleb Fotengauer-Malinovskiy + + Update ioctl entries from linux v4.20. + * linux/32/ioctls_inc_align16.h: Update from linux v4.20 + using ioctls_gen.sh. + * linux/32/ioctls_inc_align32.h: Likewise. + * linux/32/ioctls_inc_align64.h: Likewise. + * linux/64/ioctls_inc.h: Likewise. + * linux/x32/ioctls_inc0.h: Likewise. + * linux/mips/ioctls_arch0.h: Likewise. + * linux/powerpc/ioctls_arch0.h: Likewise. + * linux/s390/ioctls_arch0.h: Likewise. + * linux/s390x/ioctls_arch0.h: Likewise. + * NEWS: Mention this. + + maint: update for linux 4.20. + * maint/ioctls_sym.sh: Include linux/compiler_attributes.h in every + processed file. + Use asm/ioctls.h workaround for asm-generic/ioctls.h too. + +2018-12-26 Dmitry V. Levin + + xlat: update BPF_* constants. + * xlat/bpf_map_types.in (BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE): New + constant introduced by Linux kernel commit v4.20-rc1~14^2~124^2~12^2~7. + (BPF_MAP_TYPE_QUEUE, BPF_MAP_TYPE_STACK): New constants introduced + by Linux kernel commit v4.20-rc1~151^2~32^2~11^2~3. + * xlat/bpf_commands.in (BPF_MAP_LOOKUP_AND_DELETE_ELEM): New constant + introduced by Linux kernel commit v4.20-rc1~151^2~32^2~11^2~2. + * tests/bpf.c (BPF_MAP_CREATE_checks): Update. + +2018-12-26 Eugene Syromyatnikov + + xlat: add PR_SPEC_INDIRECT_BRANCH to pr_spec_cmds. + * xlat/pr_spec_cmds.in (PR_SPEC_INDIRECT_BRANCH): New constant, + introduced by Linux commit v4.20-rc5~4^2~3. + * prctl.c (SYS_FUNC(prctl)) : Add PR_SPEC_INDIRECT_BRANCH handling. + * tests/prctl-spec-inject.c (main): Add PR_SPEC_INDIRECT_BRANCH decoding + checks, update expected output. + * NEWS: Mention this. + + Co-Authored-by: Dmitry V. Levin + +2018-12-26 Eugene Syromyatnikov + + xlat: update V4L2_CID_* and V4L2_PIX_FMT_* constants. + * xlat/v4l2_control_ids.in (V4L2_CID_MPEG_VIDEO_MPEG2_SLICE_PARAMS, + V4L2_CID_MPEG_VIDEO_MPEG2_QUANTIZATION): New constants, introduced + by Linux commit v4.20-rc1~51^2~4. + * xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_MPEG2_SLICE): Likewise. + (V4L2_PIX_FMT_SUNXI_TILED_NV12): New constant, introduced by Linux + commit v4.20-rc1~51^2~3. + * NEWS: Mention this. + + Co-Authored-by: Dmitry V. Levin + +2018-12-26 Eugene Syromyatnikov + + xlat: add ABS_RESERVED to evdev_abs. + * xlat/evdev_abs.in (ABS_RESERVED): New constant, introduced by Linux + commit v4.20-rc1~133^2~2^2. + * NEWS: Mention this. + + Co-Authored-by: Dmitry V. Levin + +2018-12-26 Eugene Syromyatnikov + + xlat: add REL_RESERVED and REL_WHEEL_HI_RES to evdev_relative_axes. + * xlat/evdev_relative_axes.in (REL_RESERVED): New constant, introduced + by Linux commit v4.20-rc1~133^2~2^2. + (REL_WHEEL_HI_RES): New constant, introduced by Linux commit + v4.20-rc1~133^2~2^2~6 and updated by Linux commit v4.20-rc1~133^2~2^2. + * NEWS: Mention this. + + Co-Authored-by: Dmitry V. Levin + +2018-12-26 Eugene Syromyatnikov + + xlat: update kvm_cap. + * xlat/kvm_cap.in (KVM_CAP_NESTED_STATE): New constant, introduced + by Linux commit v4.19-rc1~87^2~62. + (KVM_CAP_ARM_INJECT_SERROR_ESR): New constant, introduced by Linux + commit v4.19-rc1~55^2~12^2~14, merged with its final value + in v4.19-rc1~55^2~12. + (KVM_CAP_MSR_PLATFORM_INFO): New constant, introduced by Linux commit + v4.19-rc5~8^2~2. + (KVM_CAP_PPC_NESTED_HV): New constant, introduced by Linux commit + v4.20-rc1~113^2~107^2~1. + (KVM_CAP_HYPERV_SEND_IPI): New constant, introduced by Linux commit + v4.20-rc1~113^2~72. + KVM_CAP_COALESCED_PIO): New constant, introduced by Linux commit + v4.20-rc1~113^2~31. + (KVM_CAP_HYPERV_ENLIGHTENED_VMCS): New constant, introduced by Linux + commit v4.20-rc1~113^2~25. + (KVM_CAP_EXCEPTION_PAYLOAD): New constant, introduced by Linux commit + v4.20-rc1~113^2~8. + (KVM_CAP_ARM_VM_IPA_SIZE): New constant, introduced by Linux commit + v4.20-rc1~113^2~5^2~8 and updated by Linux commit + v4.20-rc1~113^2~5. + * NEWS: Mention this. + + Co-Authored-by: Dmitry V. Levin + +2018-12-26 Eugene Syromyatnikov + + xlat: add IFA_TARGET_NETNSID to rtnl_addr_attrs. + * xlat/rtnl_addr_attrs.in (IFA_TARGET_NETNSID): New constant, introduced + by Linux commit v4.20-rc1~14^2~428^2~7. + * NEWS: Mention this. + + Co-Authored-by: Dmitry V. Levin + +2018-12-26 Eugene Syromyatnikov + + xlat: update neighbor_cache_entry_flags. + * xlat/neighbor_cache_entry_flags.in (NTF_OFFLOADED): New constant, + introduced by Linux commit v4.13-rc1~157^2~252^2~13. + (NTF_STICKY): New constant, introduced by Linux commit + v4.20-rc1~14^2~392. + (NTF_USE, NTF_SELF, NTF_MASTER, NTF_PROXY, NTF_EXT_LEARNED, NTF_ROUTER): + Add fallback definitions. + * NEWS: Mention this. + + Co-Authored-by: Dmitry V. Levin + +2018-12-26 Eugene Syromyatnikov + + xlat: add flow dissector bpf program type constants. + * xlat/bpf_attach_type.in (BPF_FLOW_DISSECTOR): New constant + introduced by Linux commit v4.20-rc1~14^2~259^2~9^2~4. + * xlat/bpf_prog_types.in (BPF_PROG_TYPE_FLOW_DISSECTOR): Likewise. + * NEWS: Mention this. + * tests/bpf.c (BPF_PROG_LOAD_checks, BPF_PROG_QUERY_checks): Update. + * tests/kernel_version.c (print_bpf_attr): Update. + + Co-Authored-by: Dmitry V. Levin + +2018-12-26 Eugene Syromyatnikov + + rtnl_tc: add TCA_STATS_BASIC_HW. + * xlat/rtnl_tca_stats_attrs.in (TCA_STATS_BASIC_HW): New constant, + introduced by Linux commit v4.20-rc1~14^2~274^2~1. + * rtnl_tc.c (tca_stats_nla_decoders): Add TCA_STATS_BASIC_HW. + * NEWS: Mention this. + + Co-Authored-by: Dmitry V. Levin + +2018-12-26 Eugene Syromyatnikov + + xlat: add NETLINK_DUMP_STRICT_CHK to sock_netlink_options. + * xlat/sock_netlink_options.in (NETLINK_DUMP_STRICT_CHK): New constant, + introduced by Linux commit v4.20-rc1~14^2~130^2~17. + * NEWS: Mention this. + + Co-Authored-by: Dmitry V. Levin + +2018-12-26 Eugene Syromyatnikov + + xlat: add IFLA_BR_VLAN_STATS_PER_PORT to rtnl_ifla_info_data_bridge_attrs + * xlat/rtnl_ifla_info_data_bridge_attrs.in + (IFLA_BR_VLAN_STATS_PER_PORT): New constant, introduced by Linux commit + v4.20-rc1~14^2~90. + * rtnl_link.c (ifla_info_data_bridge_nla_decoders): Add + IFLA_BR_VLAN_STATS_PER_PORT. + * NEWS: Mention this. + * tests/nlattr_ifla_linkinfo.c (main): Check it. + + Co-Authored-by: Dmitry V. Levin + +2018-12-26 Eugene Syromyatnikov + + xlat: add TCP_CLOSE to netlink_states. + * xlat/netlink_states.in: Decode state 7 as TCP_CLOSE, since that's what + net core sets socket's initial state to. + + xlat: add fallback definitions to setsock_ipv6_options. + * xlat/setsock_ipv6_options.in: Add fallback definitions. + +2018-12-26 Eugene Syromyatnikov + + xlat: add SOL_CAN_* to socketlayers. + * xlat/socketlayers.in (SOL_CAN_BASE): New constant, introduced by Linux + commit v2.6.25-rc1~1162^2~1414. + (SOL_CAN_RAW): New constant, introduced by Linux commit + v2.6.25-rc1~1162^2~1413. + * NEWS: Mention this. + + Co-Authored-by: Dmitry V. Levin + +2018-12-26 Eugene Syromyatnikov + + xlat: add FAN_ENABLE_AUDIT and FAN_REPORT_TID to fan_init_flags. + * xlat/fan_init_flags.in (FAN_ENABLE_AUDIT): New constant, introduced + by Linux commit v4.15-rc1~130^2^2~11. + (FAN_REPORT_TID): New constant, introduced by Linux commit + v4.20-rc1~75^2~2. + * NEWS: Mention this. + * tests/fanotify_init.c (main): Update expected output. + + Co-Authored-by: Dmitry V. Levin + +2018-12-26 Eugene Syromyatnikov + + xlat: update siginfo_codes. + * xlat/siginfo_codes.in (SI_LWP): Remove, as it is not present on Linux. + (SI_NOINFO): Define only on SPARC, provide fallback value. + +2018-12-26 Eugene Syromyatnikov + + loop: use XLAT_MACROS_ONLY instead of #stop. + As the former allows controlling presence of xlat definitions + during the inclusion and not header generation. + + * xlat/loop_cmds.in: Remove #stop. + * loop.c: Wrap "xlat/loop_cmds.h" inclusion in XLAT_MACROS_ONLY. + * tests/ioctl_loop.c: Likewise. + +2018-12-26 Eugene Syromyatnikov + + syslog: move constant definitions to xlat. + * syslog.c (enum): Remove. + * xlat/syslog_action_type.in: Add fallback definitions. + +2018-12-24 Dmitry V. Levin + + Add copyright headers to some files that lack them. + We do our best to keep copyright headers up to date, yet + git history provides better information on this subject + and is more accurate than copyright headers. + + Update copyright headers. + + Update NEWS. + +2018-12-24 Eugene Syromyatnikov + + strace.1.in: consistently use CTRL-combinations. + + strace.1.in: print names of entities in bold, provide man page sections. + * strace.1.in (.SH DESCRIPTION, .SH OPTIONS): Add man page section + numbers. Make mentions of strace and other entities bold. + +2018-12-24 Dmitry V. Levin + + strace.1.in: document %net. + * strace.1.in: Mention %net as a synonym to %network. + + Complements: v4.25-21-g97c3deca5 "basic_filters: add %net as a possible designation for network syscalls" + +2018-12-24 Shankara Pailoor + + quotactl: add xlat styles support. + * quota.c (print_qcmd): New function. + (SYS_FUNC(quotactl)): Use it to print the quotactl command. + * tests/quotactl.c (print_dqinfo, print_dqfmt): Handle XLAT_RAW + and XLAT_VERBOSE. + (QUOTA_STR, QUOTA_ID_STR, QUOTA_STR_INVALID): New macros. + (gen_quotacmd, gen_quotaid): New functions. + (main): Use them. + * tests/quotactl-Xabbrev.c: New file. + * tests/quotactl-Xraw.c: Likewise. + * tests/quotactl-Xverbose.c: Likewise. + * tests/gen_tests.in (quotactl-Xabbrev, quotactl-Xraw, + quotactl-Xverbose): New tests. + * tests/pure_executables.list: Add quotactl-Xabbrev, quotactl-Xraw, + and quotactl-Xverbose. + * tests/.gitignore: Likewise. + + Co-Authored-by: Dmitry V. Levin + +2018-12-24 Dmitry V. Levin + + xlat_idx: do not issue warnings for holes in indices. + Some xlat indices like evdev_abs have holes, avoid issuing warnings + about them. + + * xlat.c (xlat_idx): Do not issue warnings for holes in the index. + +2018-12-23 Dmitry V. Levin + + rtnl_link: fix off-by-one errors in indexed and sorted xlat lookups. + * rtnl_link.c (decode_nla_tun_type, decode_ifla_xdp_attached, + decode_ifla_inet_conf, decode_ifla_inet6_flags, decode_ifla_inet6_conf, + decode_ifla_inet6_stats, decode_ifla_inet6_icmp6_stats, + decode_ifla_inet6_agm): Decrement xlat size by one to account + for XLAT_END as other users of indexed and sorted xlats do. + + Fixes: v4.25~71 "rtnl_link: decode named constants for IFLA_XDP_ATTACHED attribute value" + Fixes: v4.23~41 "rtnl_link: decode IFLA_AF_SPEC" + Fixes: v4.23~37 "rtnl_link: implement IFLA_INFO_DATA for tun devices" + +2018-12-23 Dmitry V. Levin + + net: fix off-by-one error in sorted xlat lookup. + * net.c (ax25_protocols): Decrement xlat size by one to account + for XLAT_END as other users of sorted xlats do. + + Fixes: v4.25~28 "net: add support for AX.25 protocols and socket option names decoding" + +2018-12-23 Dmitry V. Levin + + netlink_smc_diag: fix off-by-one error in xlat lookup. + * netlink_smc_diag.c (decode_smc_diag_shutdown): Decrement xlat size + by one to account for XLAT_END as other users of xlats do. + + Fixes: v4.25~54 "netlink_smc_diag: decode SMC_DIAG_SHUTDOWN attribute value" + +2018-12-23 Dmitry V. Levin + + aio: fix off-by-one error in indexed xlat lookup. + * aio.c (tprint_lio_opcode): Decrement xlat size by one to account + for XLAT_END as other users of indexed xlats do. + + Fixes: v4.24~71 "aio: print IOCB_CMD_* using xlat" + +2018-12-23 Dmitry V. Levin + + nlattr: fix off-by-one error in indexed xlat lookup. + * nlattr.c (decode_nla_meminfo): Decrement xlat size by one + to account for XLAT_END as other users of indexed xlats do. + + Fixes: v4.23~89 "nlattr: print index names in netlink meminfo array" + +2018-12-23 Eugene Syromiatnikov + + evdev: fix off-by-one error in decode_bitset. + * evdev.c (decode_bitset): Decrement sorted/indexed xlat's size by one + in order to account for guarding XLAT_END, as other sorted/indexed xlat + wrappers do. + + Fixes: v4.23~261 "evdev: support various types of xlats in decode_bitset" + +2018-12-22 Dmitry V. Levin + + strace: terminate itself if interrupted by a signal. + * strace.c (terminate): Terminate itself if interrupted by a signal. + * NEWS: Mention this change. + * tests/detach-running.test: Check it. + * tests/detach-sleeping.test: Likewise. + * tests/detach-stopped.test: Likewise. + +2018-12-17 Shankara Pailoor + + tests: check that printsignal handles xlat styles properly. + * tests/printsignal.c: New file. + * tests/Makefile.am (EXTRA_DIST): Add it. + * tests/printsignal-Xabbrev.c: New file. + * tests/printsignal-Xraw.c: Likewise. + * tests/printsignal-Xverbose.c: Likewise. + * tests/gen_tests.in (printsignal-Xabbrev, printsignal-Xraw, + printsignal-Xverbose): New tests. + * tests/pure_executables.list: Add printsignal-Xabbrev, + * printsignal-Xraw, and printsignal-Xverbose. + * tests/.gitignore: Likewise. + + Co-Authored-by: Dmitry V. Levin + +2018-12-17 Eugene Syromyatnikov + + signal: return NULL if signal number has no string representation. + Also return NULL if signal number is 0. + + * signal.c (signame): Return NULL if signal name has not been found. + + Co-Authored-by: Dmitry V. Levin + +2018-12-17 Dmitry V. Levin + + filter_qualify: prepare for the change of signame semantics. + * filter_qualify.c (sigstr_to_uint): Check signame return value. + +2018-12-17 Eugene Syromyatnikov + + Use sprintsigname for converting signal number to string. + As signame is being converted to an xlookup-like function, a separate + routine is needed in order to get string representation of signal. + + * defs.h (sprintsigname): New prototype. + * signal.c (sprintsigname): New function. + * strace.c (print_debug_info, print_signalled, print_stopped): Use it + instead of signame. + * wait.c (printstatus): Likewise. + + Co-Authored-by: Dmitry V. Levin + +2018-12-17 Eugene Syromyatnikov + + Use printsignal instead of signame. + As the former respects xlat styles while the latter doesn't. + + * clone.c (SYS_FUNC(clone)): Use printsignal for printing termination + signal in printflags. + * fcntl.c (print_fcntl) : Use printsignal. + * prctl.c (SYS_FUNC(prctl)) : Likewise. + * print_sigevent.c (print_sigevent): Likewise. + * s390.c (s390_runtime_instr): Likewise. + * signal.c (SYS_FUNC(kill), SYS_FUNC(tgkill)): Likewise. + +2018-12-17 Eugene Syromyatnikov + + signal: make printisgnal honor xlat style. + * signal.c (printsignal): Respect current xlat style. + +2018-12-17 Eugene Syromyatnikov + + Always define WCOREDUMP. + wait.c does it already, now strace.c also does. + + * wait.h: New file. + * Makefile.am (strace_SOURCES): Add it. + * strace.c: Replace with "wait.h". + [!WCOREDUMP]: Remove. + * wait.c: Replace with "wait.h". + [!WCOREFLAG] (WCOREFLAG), [!WCOREDUMP] (WCOREDUMP): Move to wait.h, + rework. + [!W_STOPCODE] (W_STOPCODE), [!W_EXITCODE] (W_EXITCODE), + [!W_CONTINUED] (W_CONTINUED): Move to wait.h. + + Co-Authored-by: Dmitry V. Levin + +2018-12-17 Masatake YAMATO + + net: enhance decoding of getsockopt(SO_ERROR) + * net.c (print_get_error): New function decoding error + number returned as option value for SO_ERROR option. + (print_getsockopt) : Call print_get_error. + + * tests/so_error.c: New test. + * tests/gen_tests.in (so_error): Likewise. + * tests/pure_executables.list: Add so_error. + * tests/.gitignore: Likewise. + +2018-12-17 Dmitry V. Levin + + ia64: do not clobber r12 for raw syscalls. + According to + https://sourceware.org/ml/libc-alpha/2018-12/msg00470.html + GCC mainline now gives errors for an asm that clobbers the stack + pointer. + + According to + https://gcc.gnu.org/ml/gcc-patches/2018-12/msg00932.html> + GCC previously ignored such a clobber; thus, this patch removes it + from the clobbers for ia64 raw syscalls. + + * linux/ia64/raw_syscall.h (raw_syscall_0): Remove "r12" from clobbers. + +2018-12-17 Dmitry V. Levin + + block: decode BLKGETZONESZ and BLKGETNRZONES ioctls. + These ioctls were introduced by linux kernel commits v4.20-rc1~17^2~16 + and v4.20-rc1~17^2~15, respectively. + + * block.c (block_ioctl): Handle BLKGETZONESZ and BLKGETNRZONES. + * xlat/block_ioctl_cmds.in (BLKGETZONESZ, BLKGETNRZONES): New entries. + +2018-12-13 Dmitry V. Levin + + Implement PTRACE_GET_SYSCALL_INFO decoder. + * defs.h (audit_arch): New prototype. + * process.c: Include "ptrace_syscall_info.h". + (SYS_FUNC(ptrace)) : Call + print_ptrace_syscall_info on exiting syscall. + * ptrace_syscall_info.h (print_ptrace_syscall_info): New prototype. + * ptrace_syscall_info.c: Include "print_fields.h" and + "xlat/ptrace_syscall_info_op.h". + (print_ptrace_syscall_info): New function. + * xlat/ptrace_syscall_info_op.in: New file. + * tests/ptrace_syscall_info.c: New file. + * tests/gen_tests.in (ptrace_syscall_info): New test. + * tests/pure_executables.list: Add ptrace_syscall_info. + * tests/.gitignore: Likewise. + +2018-12-13 Dmitry V. Levin + + Introduce PTRACE_GET_SYSCALL_INFO support. + When PTRACE_GET_SYSCALL_INFO API works, + use it instead of traditional upeek/get_regs API. + + Tested on x86_64 and x86. + + * get_personality.c: New file. + * get_personality.h: Likewise. + * Makefile.am (strace_SOURCES): Add them. + * linux/aarch64/arch_get_personality.c: New file. + * linux/powerpc64/arch_get_personality.c: Likewise. + * linux/riscv/arch_get_personality.c: Likewise. + * linux/s390x/arch_get_personality.c: Likewise. + * linux/sparc64/arch_get_personality.c: Likewise. + * linux/tile/arch_get_personality.c: Likewise. + * linux/x32/arch_get_personality.c: Likewise. + * linux/x86_64/arch_get_personality.c: Likewise. + * linux/check_scno.c: Likewise. + * linux/x32/check_scno.c: Likewise. + * Makefile.am (EXTRA_DIST): Add them. + * linux/ia64/arch_getrval2.c (getrval2): Invoke get_regs() + if ptrace_syscall_info is in use. + * linux/mips/arch_getrval2.c: Likewise. + * linux/sparc/arch_getrval2.c: Likewise. + * defs.h (get_personality_from_syscall_info): New prototype. + * syscall.c: Include "get_personality.h" and "ptrace_syscall_info.h". + (get_regs_error): Define unconditionally. + (ptrace_sci): New static variable. + (clear_regs): Reset ptrace_sci.op. + (ptrace_syscall_info_is_valid, ptrace_get_syscall_info, + get_syscall_regs): New functions. + (get_syscall_result_regs): Change to get_syscall_regs. + (get_instruction_pointer, get_stack_pointer, get_scno, get_syscall_args, + get_error, set_error, set_success): Add ptrace_syscall_info support. + * tests/int_0x80.test: New test. + * tests/Makefile.am (DECODER_TESTS): Add int_0x80.test. + (XFAIL_TESTS_x86_64, XFAIL_TESTS_x32): Remove. + * tests/gen_tests.in (int_0x80): Remove. + +2018-12-13 Dmitry V. Levin + + Check whether PTRACE_GET_SYSCALL_INFO is supported by the kernel. + The result of this check is going to be used by subsequent commits. + + * ptrace_syscall_info.c: New file. + * ptrace_syscall_info.h: Likewise. + * Makefile.am (strace_SOURCES): Add them. + * strace.c: Include "ptrace_syscall_info.h". + (init): Call test_ptrace_get_syscall_info. + +2018-12-13 Dmitry V. Levin + + Add definitions for PTRACE_GET_SYSCALL_INFO API. + Provide fallback definitions for PTRACE_GET_SYSCALL_INFO API. + Add very basic PTRACE_GET_SYSCALL_INFO support in the parser + of ptrace syscall. + + * ptrace.h: Include . + [!PTRACE_GET_SYSCALL_INFO] (PTRACE_GET_SYSCALL_INFO, + PTRACE_SYSCALL_INFO_NONE, PTRACE_SYSCALL_INFO_ENTRY, + PTRACE_SYSCALL_INFO_EXIT, PTRACE_SYSCALL_INFO_SECCOMP, + struct ptrace_syscall_info): Define. + * xlat/ptrace_cmds.in: Add PTRACE_GET_SYSCALL_INFO. + * process.c (SYS_FUNC(ptrace)): Handle it. + +2018-12-10 Dmitry V. Levin + + Change the license of strace to LGPL-2.1-or-later. + strace is now provided under the terms of the GNU Lesser General + Public License version 2.1 or later, see COPYING for more details. + + strace test suite is now provided under the terms of the GNU General + Public License version 2 or later, see tests/COPYING for more details. + +2018-12-10 Dmitry V. Levin + + tests: change the license to GPL-2.0-or-later. + strace test suite is now provided under the terms of the GNU General + Public License version 2 or later, see tests/COPYING for more details. + +2018-12-10 Shankara Pailoor + + bpf: honor xlat styles when printing kernel version. + * print_kernel_version.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * defs.h (print_kernel_version): New prototype. + * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): + Use print_kernel_version. + * tests/kernel_version.c: New file. + * tests/kernel_version-Xabbrev.c: Likewise. + * tests/kernel_version-Xraw.c: Likewise. + * tests/kernel_version-Xverbose.c: Likewise. + * tests/gen_tests.in (kernel_version, kernel_version-Xabbrev, + kernel_version-Xraw, kernel_version-Xverbose): New tests. + * tests/pure_executables.list: Add kernel_version, + kernel_version-Xabbrev, kernel_version-Xraw, and kernel_version-Xverbose. + * tests/.gitignore: Likewise. + + Co-Authored-by: Dmitry V. Levin + +2018-12-10 Shankara Pailoor + + print_dev_t: add xlat styles support. + * print_dev_t.c (print_dev_t): Respect xlat_verbosity. + * tests/btrfs.c (sprint_makedev): New function. + (btrfs_print_balance_args, btrfs_test_dev_info_ioctl, + btrfs_test_dev_replace_ioctl, btrfs_test_get_dev_stats_ioctl, + btrfs_test_scrub_ioctls): Use it to update expected output. + * tests/xstatx.c (print_st_mode, sprint_makedev): New functions. + (print_stat): Use them. + * tests/fstat-Xabbrev.c: New file. + * tests/fstat-Xraw.c: Likewise. + * tests/fstat-Xverbose.c: Likewise. + * tests/fstat64-Xabbrev.c: Likewise. + * tests/fstat64-Xraw.c: Likewise. + * tests/fstat64-Xverbose.c: Likewise. + * tests/gen_tests.in (fstat-Xabbrev, fstat-Xraw, fstat-Xverbose, + fstat64-Xabbrev, fstat64-Xraw, fstat64-Xverbose): New entries. + * tests/trace_fstat.in: Likewise. + * tests/trace_stat_like.in: Likewise. + * tests/pure_executables.list: Add fstat-Xabbrev, fstat-Xraw, + fstat-Xverbose, fstat64-Xabbrev, fstat64-Xraw, and fstat64-Xverbose. + * tests/.gitignore: Likewise. + + Co-Authored-by: Dmitry V. Levin + +2018-12-05 Dmitry V. Levin + + i386, x32: use upoke() instead of set_regs() + This brings i386 and x32 in line with x86_64 + and removes redundant HAVE_GETREGS_OLD checks. + Besides that, use of PTRACE_GET_SYSCALL_INFO would require + an extra get_regs() invocation before set_regs(). + + * syscall.c (ARCH_MIGHT_USE_SET_REGS): Define to 1. + [HAVE_GETREGS_OLD] (ARCH_MIGHT_USE_SET_REGS): Redefine to 0. + (ptrace_setregset_or_setregs): Check ARCH_MIGHT_USE_SET_REGS instead + of HAVE_GETREGS_OLD. + * linux/i386/arch_regs.c (ARCH_MIGHT_USE_SET_REGS): Redefine to 0. + * linux/powerpc/arch_regs.c: Likewise. + * linux/x86_64/arch_regs.c: Likewise. + * linux/i386/set_error.c (arch_set_error, arch_set_success) + [!HAVE_GETREGS_OLD]: Remove. + * linux/i386/set_scno.c (arch_set_scno) [!HAVE_GETREGS_OLD]: Remove. + * linux/powerpc/set_error.c (arch_set_error, arch_set_success) + [!HAVE_GETREGS_OLD]: Remove. + * linux/powerpc/set_scno.c (arch_set_scno) [!HAVE_GETREGS_OLD]: Remove. + * linux/x86_64/set_error.c [!HAVE_GETREGS_OLD]: Remove. + * linux/x86_64/set_scno.c: Likewise. + +2018-12-05 Dmitry V. Levin + + upoke: workaround crippled x32. + As PTRACE_POKEUSER is crippled on x32 by design from the very first + linux kernel commit v3.4-rc1~33^2~2 when it was introduced, + workaround this by using the raw x86_64 syscall instead. + + * linux/ptrace_pokeuser.c: New file. + * linux/x32/ptrace_pokeuser.c: Likewise. + * Makefile.am (EXTRA_DIST): Add them. + * upoke.c: Include "ptrace_pokeuser.c". + (upoke): Use ptrace_pokeuser instead of ptrace. + +2018-12-05 Dmitry V. Levin + + x86_64: remove some annoying pieces of unused code. + * linux/x86_64/get_scno.c (X32_PERSONALITY_NUMBER): Remove. + (arch_get_scno): Remove ifdefed archeological artefacts. + +2018-12-05 Dmitry V. Levin + + Refactor tamper_with_syscall_exiting() + Move the code than deals with updating the return and error values + to separate functions. + + * syscall.c (set_error, set_success): New functions. + (tamper_with_syscall_exiting): Use them. + +2018-12-05 Dmitry V. Levin + + Refactor get_syscall_args() and get_error() + * linux/*/get_error.c: Rename all arch-specific implementations + of get_error() to arch_get_error(). + * linux/*/get_syscall_args.c: Rename all arch-specific implementations + of get_syscall_args() to arch_get_syscall_args(). + * syscall.c (get_syscall_args, get_error): New functions. + (tamper_with_syscall_exiting, get_syscall_result): Do not clear + tcp->u_error before get_error() invocation as the latter does it now. + +2018-12-05 Dmitry V. Levin + + Refactor stack pointers. + Change all linux/*/arch_regs.c to provide either ARCH_SP_REG + or ARCH_SP_PEEK_ADDR. Introduce get_stack_pointer(), rewrite + all code accessing stack pointers to use get_stack_pointer(). + On some architectures stack pointers were referred to as frame pointers, + clean up this confusion. + + * defs.h (get_stack_pointer): New prototype. + * syscall.c (get_stack_pointer): New function. + * linux/arch_rt_sigframe.c: New file. + * linux/aarch64/arch_regs.c (aarch64_sp_ptr, arm_sp_ptr): Remove. + (ARCH_SP_REG): New macro. + * linux/alpha/arch_regs.c: Import linux/alpha/arch_regs.h. + (REG_FP): Rename to REG_SP. + (ARCH_SP_PEEK_ADDR): New macro. + * linux/alpha/arch_sigreturn.c (arch_sigreturn): Use get_stack_pointer. + * linux/arc/arch_regs.c (arc_sp_ptr): Remove. + (ARCH_SP_REG): New macro. + * linux/arm/arch_regs.c (arm_sp_ptr): Remove. + (ARCH_SP_REG): New macro. + * linux/arm/arch_sigreturn.c (arch_sigreturn): Use get_stack_pointer. + * linux/avr32/arch_regs.c (avr32_sp_ptr): Remove. + (ARCH_SP_REG): New macro. + * linux/bfin/arch_regs.c (ARCH_SP_PEEK_ADDR): New macro. + * linux/hppa/arch_regs.c: Import linux/hppa/arch_regs.h. + (PT_GR30, ARCH_SP_PEEK_ADDR): New macros. + * linux/hppa/arch_rt_sigframe.c (FUNC_GET_RT_SIGFRAME_ADDR): Use + get_stack_pointer. + * linux/i386/arch_regs.c (i386_esp_ptr): Remove. + (ARCH_SP_REG): New macro. + * linux/i386/arch_rt_sigframe.c (FUNC_GET_RT_SIGFRAME_ADDR): Use + get_stack_pointer. + * linux/i386/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/ia64/arch_regs.c (ia64_frame_ptr): Remove. + (ARCH_SP_REG): New macro. + * linux/ia64/arch_regs.h (ia64_frame_ptr): Remove. + * linux/ia64/arch_rt_sigframe.c (FUNC_GET_RT_SIGFRAME_ADDR): Use + get_stack_pointer. + * linux/m68k/arch_regs.c (m68k_usp_ptr): Remove. + (ARCH_SP_REG): New macro. + * linux/m68k/arch_rt_sigframe.c: Link to i386/arch_rt_sigframe.c. + * linux/m68k/arch_sigreturn.c (arch_sigreturn): Use get_stack_pointer. + * linux/metag/arch_regs.c (metag_sp_ptr): Remove. + (ARCH_SP_REG): New macro. + * linux/metag/arch_rt_sigframe.c (FUNC_GET_RT_SIGFRAME_ADDR): Use + get_stack_pointer. + * linux/microblaze/arch_regs.c (ARCH_SP_PEEK_ADDR): New macro. + * linux/mips/arch_regs.c: Import linux/mips/arch_regs.h. + (mips_regs): Add static qualifier. + (ARCH_SP_REG): New macro. + * linux/mips/arch_sigreturn.c (arch_sigreturn): Use get_stack_pointer. + * linux/nios2/arch_regs.c (nios2_sp_ptr): Remove. + (ARCH_SP_REG): New macro. + * linux/or1k/arch_regs.c (or1k_sp_ptr): Remove. + (ARCH_SP_REG): New macro. + * linux/powerpc/arch_regs.c (ppc_regs): Add static qualifier. + (ARCH_SP_REG): New macro. + * linux/powerpc/arch_rt_sigframe.c (FUNC_GET_RT_SIGFRAME_ADDR): Use + get_stack_pointer. + * linux/powerpc/arch_sigreturn.c (arch_sigreturn): Use get_stack_pointer. + * linux/powerpc64/arch_rt_sigframe.c (FUNC_GET_RT_SIGFRAME_ADDR): Use + get_stack_pointer. + * linux/riscv/arch_regs.c (riscv_sp_ptr): Remove. + (ARCH_SP_REG): New macro. + * linux/s390/arch_regs.c (s390_frame_ptr): Remove. + (ARCH_SP_REG): New macro. + * linux/s390/arch_sigreturn.c (S390_FRAME_PTR): Remove. + (arch_sigreturn): Use get_stack_pointer. + * linux/s390x/arch_regs.c (s390_frame_ptr, s390x_frame_ptr): Remove. + (ARCH_SP_REG): New macro. + * linux/s390x/arch_sigreturn.c (S390_FRAME_PTR): Remove. + * linux/sh/arch_regs.c (ARCH_SP_PEEK_ADDR): New macro. + * linux/sh64/arch_regs.c: Likewise. + * linux/sparc/arch_regs.c: Import linux/sparc/arch_regs.h. + (sparc_regs): Add static qualifier. + (ARCH_SP_REG): New macro. + * linux/sparc/arch_sigreturn.c (arch_sigreturn): Use get_stack_pointer. + * linux/sparc64/arch_rt_sigframe.c (FUNC_GET_RT_SIGFRAME_ADDR): Use + get_stack_pointer. + * linux/tile/arch_regs.c (tile_regs): Add static qualifier. + (ARCH_SP_REG): New macro. + * linux/tile/arch_sigreturn.c (arch_sigreturn): Use get_stack_pointer. + * linux/x86_64/arch_regs.c (i386_esp_ptr, x86_64_rsp_ptr): Remove. + (ARCH_SP_REG): New macro. + * linux/x86_64/arch_regs.h (i386_esp_ptr, x86_64_rsp_ptr): Remove. + * linux/x86_64/arch_rt_sigframe.c: Link to i386/arch_rt_sigframe.c. + * linux/xtensa/arch_regs.c (ARCH_SP_PEEK_ADDR): New macro. + * linux/aarch64/arch_regs.h: Remove. + * linux/aarch64/arch_rt_sigframe.c: Remove. + * linux/alpha/arch_regs.h: Remove. + * linux/alpha/arch_rt_sigframe.c: Remove. + * linux/arc/arch_regs.h: Remove. + * linux/arc/arch_rt_sigframe.c: Remove. + * linux/arm/arch_regs.h: Remove. + * linux/arm/arch_rt_sigframe.c: Remove. + * linux/avr32/arch_regs.h: Remove. + * linux/avr32/arch_rt_sigframe.c: Remove. + * linux/bfin/arch_rt_sigframe.c: Remove. + * linux/hppa/arch_regs.h: Remove. + * linux/i386/arch_regs.h: Remove. + * linux/m68k/arch_regs.h: Remove. + * linux/metag/arch_regs.h: Remove. + * linux/microblaze/arch_rt_sigframe.c: Remove. + * linux/mips/arch_regs.h: Remove. + * linux/mips/arch_rt_sigframe.c: Remove. + * linux/nios2/arch_regs.h: Remove. + * linux/nios2/arch_rt_sigframe.c: Remove. + * linux/or1k/arch_regs.h: Remove. + * linux/or1k/arch_rt_sigframe.c: Remove. + * linux/powerpc/arch_regs.h: Remove. + * linux/powerpc64/arch_regs.h: Remove. + * linux/riscv/arch_regs.h: Remove. + * linux/riscv/arch_rt_sigframe.c: Remove. + * linux/s390/arch_regs.h: Remove. + * linux/s390/arch_rt_sigframe.c: Remove. + * linux/s390x/arch_regs.h: Remove. + * linux/s390x/arch_rt_sigframe.c: Remove. + * linux/sh/arch_rt_sigframe.c: Remove. + * linux/sh64/arch_rt_sigframe.c: Remove. + * linux/sparc/arch_regs.h: Remove. + * linux/sparc/arch_rt_sigframe.c: Remove. + * linux/sparc64/arch_regs.h: Remove. + * linux/tile/arch_regs.h: Remove. + * linux/tile/arch_rt_sigframe.c: Remove. + * linux/xtensa/arch_rt_sigframe.c: Remove. + * Makefile.am (EXTRA_DIST): Remove them, add linux/arch_rt_sigframe.c. + +2018-12-05 Dmitry V. Levin + + Refactor print_pc() + Split print_pc() into arch-independent print_instruction_pointer() + and arch-specific get_instruction_pointer(). + + * print_instruction_pointer.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * defs.h (print_pc): Remove. + (get_instruction_pointer, print_instruction_pointer): New prototypes. + * syscall.c (print_pc): Remove. + (get_instruction_pointer): New function. + * strace.c (printleader): Replace print_pc with + print_instruction_pointer. + +2018-12-05 Dmitry V. Levin + + ppc64: remove redundant redefinition. + * linux/powerpc64/arch_regs.c (ARCH_PC_REG): Remove. + +2018-12-05 Shankara Pailoor + + print_dev_t: print major and minor numbers in hex like stat(1) + * print_dev_t.c (print_dev_t): Print major and minor numbers in hex. + * strace.1.in: Update makedev example. + * tests/bpf-obj_get_info_by_fd.c (main): Update expected output. + * tests/btrfs.c (btrfs_print_balance_args, btrfs_test_scrub_ioctls, + btrfs_test_dev_info_ioctl, btrfs_test_get_dev_stats_ioctl, + btrfs_test_dev_replace_ioctl): Update expected output. + * tests/ioctl_dm.c (main): Likewise. + * tests/ioctl_loop.c (print_loop_info, print_loop_info64): Likewise. + * tests/mknod.c (main): Likewise. + * tests/mknodat.c (main): Likewise. + * tests/nlattr_unix_diag_msg.c (main): Likewise. + * tests/ustat.c (main): Likewise. + * tests/xstatx.c (print_stat): Likewise. + + Co-Authored-by: Dmitry V. Levin + +2018-12-05 Janosch Frank + + s390x: beautify sthyi data tail prints. + The test already expects a ", " before the print of struct + padding. Let's add it to s390.c to make the output look a bit nicer and + fix test runs on z/VM that have padding at the end of the STHYI structs. + + * s390.c (decode_ebcdic): Add missing comma. + +2018-11-27 Dmitry V. Levin + + Stop using SIG_0. + Number 0 is not a valid signal number, and SIG_0 is not a valid + description for a signal. + + * linux/signalent.h: Replace SIG_0 with 0. + * linux/alpha/signalent.h: Likewise. + * linux/hppa/signalent.h: Likewise. + * linux/mips/signalent.h: Likewise. + * linux/sparc/signalent.h: Likewise. + * filter_qualify.c (sigstr_to_uint): Start iterations with number 1. + * tests/fcntl-common.c (test_fcntl_others): Update expected output. + * tests/kill.c (main): Likewise. + * tests/ptrace.c (test_peeksiginfo): Likewise. + * tests/s390_runtime_instr.c (main): Likewise. + +2018-11-26 Dmitry V. Levin + + mem: fix build on architectures where kernel_ulong_t is bigger than long + * mem.c (print_mmap_flags): Fix format string. + + Fixes: v4.25-26-g0933b3086 "mem: add xlat styles support to print_mmap_flags" + +2018-11-26 Dmitry V. Levin + + tests: add remap_file_pages test variants with different xlat verbosity levels + * tests/remap_file_pages-Xabbrev.c: New file. + * tests/remap_file_pages-Xraw.c: Likewise. + * tests/remap_file_pages-Xverbose.c: Likewise. + * tests/remap_file_pages.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags. + * tests/pure_executables.list: Add remap_file_pages-Xabbrev, + remap_file_pages-Xraw, and remap_file_pages-Xverbose. + * tests/.gitignore: Likewise. + * tests/gen_tests.in (remap_file_pages-Xabbrev, remap_file_pages-Xraw, + remap_file_pages-Xverbose): New tests. + +2018-11-26 Shankara Pailoor + + mem: add xlat styles support to print_mmap_flags. + * mem.c (print_mmap_flags): Respect xlat_verbosity. + * tests/mmap.c (main): Update expected output. + * tests/old_mmap.c (main): Likewise. + + Co-Authored-by: Dmitry V. Levin + +2018-11-26 Dmitry V. Levin + + tests: add memfd_create test variants with different xlat verbosity levels + * tests/memfd_create-Xabbrev.c: New file. + * tests/memfd_create-Xraw.c: Likewise. + * tests/memfd_create-Xverbose.c: Likewise. + * tests/memfd_create.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags. + * tests/pure_executables.list: Add memfd_create-Xabbrev, memfd_create-Xraw, + and memfd_create-Xverbose. + * tests/.gitignore: Likewise. + * tests/gen_tests.in (memfd_create-Xabbrev, memfd_create-Xraw, + memfd_create-Xverbose): New tests. + +2018-11-26 Shankara Pailoor + + memfd_create: add xlat styles support. + * memfd_create.c (SYS_FUNC(memfd_create)): Respect xlat_verbosity. + + Co-Authored-by: Dmitry V. Levin + +2018-11-24 Dmitry V. Levin + + Enhance error diagnostics when the first exec fails. + When the first exec fails, strace used to print the trace of the child + process till its end, producing a lot of confusing output. + Enhance the diagnostics by hiding irrelevant parts of the trace. + + * defs.h (TCB_CHECK_EXEC_SYSCALL): New macro. Change values of TCB_* + macros listed after TCB_CHECK_EXEC_SYSCALL. + (check_exec_syscall): New macro. + * strace.c (dispatch_event) : Clear + TCB_CHECK_EXEC_SYSCALL flag. + * syscall.c (syscall_entering_trace): Do not clear TCB_HIDE_LOG when + TCB_CHECK_EXEC_SYSCALL is set, set TCB_CHECK_EXEC_SYSCALL along with + clearing TCB_HIDE_LOG. + (syscall_exiting_decode): Set TCB_HIDE_LOG if TCB_CHECK_EXEC_SYSCALL + is set. + * tests/first_exec_failure.test: New file. + * tests/Makefile.am (MISC_TESTS): Add first_exec_failure.test. + + Closes: https://github.com/strace/strace/issues/88 + +2018-11-24 Dmitry V. Levin + + build: use more traditional git options. + The support of --no-patch alias to -s option in "git diff" and related + git commands was added in git v1.8.4. + + * copyright-year-gen: Use "git show -s" instead of "git show --no-patch". + * file-date-gen: Use "git log -s" instead of "git log --no-patch". + + Closes: https://github.com/strace/strace/issues/80 + +2018-11-24 Eugene Syromyatnikov + + basic_filters: add %net as a possible designation for network syscalls. + * basic_filters.c (lookup_class) : Add %net as an alias + for TRACE_NETWORK. + +2018-11-24 Eugene Syromyatnikov + + hppa: add a comment about old name of syscall number 102. + Also, remove empty definition. + + * linux/hppa/syscallent.h ([102]): Remove empty definition, + add a comment that it was socketcall. + +2018-11-24 Eugene Syromyatnikov + + mips: update syscall entry for reserved221 syscall. + The syscall number 4221 is actually called "reserved221" on mips. + + * linux/mips/syscallent-o32.h ([4221]): Set to "reserved221". + +2018-11-24 Eugene Syromyatnikov + + arm: add a comment that __ARM_NR_cmpxchg was removed in 4.4. + * linux/arm/syscallent.h: Add a comment about __ARM_NR_cmpxchg. + + arm: replace empty syscall entry definitions with comments. + * linux/arm/syscallent.h ([222]): Remove definition, add a comment + that it was tux syscall. + ([223]): Remove definition, add comment that it was unused. + ([254]): Remove definition, add comment that it was reserved + for set_thread_area. + ([255]): Remove definition, add comment that it was reserved + for get_thread_area. + + linux/dummy.h: remove unused sys_phys definition. + * linux/dummy.h (sys_phys): Remove. + + numa: use already existing array item printing function. + * numa.c (print_int): Remove. + (SYS_FUNC(move_pages)): Use print_int32_array_member instead of + print_int. + + net: use already existing array item printing function. + * net.c (print_uint32): Remove. + (print_getsockopt): Use print_uint32_array_member instead of + print_uint32. + +2018-11-24 Eugene Syromyatnikov + + Remove HAVE_LINUX_GENETLINK_H ifdefs. + is available since Linux 2.6.15 (commit + v2.6.15-rc1~53^2). + + * configure.ac (AC_CHECK_HEADERS): Remove linux/genetlink.h. + * socketutils.c [!HAVE_LINUX_GENETLINK_H]: Remove. + * tests/netlink_generic.c [!HAVE_LINUX_GENETLINK_H]: Likewise. + +2018-11-21 Dmitry V. Levin + + Document -X option in strace -h output. + * strace.c (usage): Mention -X option. + + Reported-by: Dmitry Vyukov + Complements: v4.23~308 "Add user interface for configuring xlat output style" + +2018-11-21 Dmitry V. Levin + + Move kill_save_errno to a separate header file. + This function is going to be used outside strace.c, + so make it globally available and move it to a separate header file. + + * strace.c (kill_save_errno): Add "inline" keyword, change return type + from "void" to "int", move the function ... + * kill_save_errno.h: ... to this new file. + * Makefile.am (strace_SOURCES): Add it. + +2018-11-20 Dmitry V. Levin + + syscall_entering_trace: set TCB_FILTERED along with TCB_HIDE_LOG. + This allows to remove some of hide_log() checks that became redundant. + + * syscall.c (syscall_entering_trace): Set TCB_FILTERED along with + TCB_HIDE_LOG, remove now redundant hide_log(tcp) check. + (syscall_exiting_decode): Replace "filtered(tcp) || hide_log(tcp)" + with "filtered(tcp)". + +2018-11-20 Dmitry V. Levin + + syscall_entering_trace: optimize clearing of TCB_HIDE_LOG flag. + * syscall.c (syscall_entering_trace): Since we check for TCB_HIDE_LOG + flag anyway, do not clean it unless it is set. + +2018-11-12 Dmitry V. Levin + + print_inet_addr: print nameless and named addresses using the same style + * sockaddr.c (print_inet_addr): Handle var_name == NULL case in a more + structured way: use inet_addr("%s") form to print AF_INET addresses + in structureless contexts where no structure field name is available. + Likewise, use inet_pton(AF_INET6, "%s") that case. + * tests/nlattr_ifaddrmsg.c (main): Update expected output. + * tests/nlattr_ifla_af_spec.c (main): Likewise. + + Complements: v4.19~76 "print_inet_addr: add support of invocations without field name" + +2018-11-05 Dmitry V. Levin + + tests: extend test coverage of RND* ioctl commands. + * tests/ioctl_random.c (main): Check the error path of RNDADDENTROPY + parser. Check decoding of unrecognized RND* ioctl commands. + +2018-11-05 Rasmus Villemoes + + Add support for /dev/[u]random ioctls. + * random_ioctl.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * defs.h (DECL_IOCTL): Add random. + * ioctl.c (ioctl_decode): Add 'R' case. + * xlat/random_ioctl_cmds.in: New file. + * tests/ioctl_random.c: New file. + * tests/.gitignore: Add ioctl_random. + * tests/pure_executables.list: Likewise. + * tests/gen_tests.in (ioctl_random): New entry. + +2018-11-01 Eugene Syromyatnikov + + Add dist/INSTALL. + * dist/INSTALL: New file. + * bootstrap: Copy it. + * .gitignore: Add /INSTALL. + + References: https://github.com/strace/strace/issues/17 + References: https://github.com/strace/strace/issues/55 + Closes: https://github.com/strace/strace/issues/67 + +2018-11-01 Eugene Syromyatnikov + + Rename INSTALL to README-configure. + * INSTALL-git.md: Replace INSTALL with README-configure. + * maint/install.texi: Likewise. + * INSTALL: Rename to README-configure, regenerate. + * Makefile.am (EXTRA_DIST): Add README-configure. + + References: https://github.com/strace/strace/issues/85 + Co-Authored-by: Dmitry V. Levin + +2018-11-01 Eugene Syromyatnikov + + dist/README: add more references. + * dist/README: Mention README-hacking, add links to repositories + and the mailing list archive. + + Suggested-by: Jamal Hadi Salim + Co-Authored-by: Dmitry V. Levin + +2018-11-01 Eugene Syromyatnikov + + README.md: add a link to the new contributors guide. + * README.md: Add a link to the Guide of new contributors. + + Suggested-by: Jamal Hadi Salim + +2018-10-30 Dmitry V. Levin + + Post-release administrivia. + * NEWS: Add a header line for the next release. + * debian/changelog.in: Add a changelog entry for 4.25-1. + * strace.spec.in: Likewise. + + Prepare for 4.25 release. + * NEWS: Update for 4.25 release. + + Update copyright headers. + Headers updated automatically using maint/update_copyright_years.sh + script. + +2018-10-25 Dmitry V. Levin + + Update NEWS. + +2018-10-25 Elvira Khabirova + + Implement decoding of NBD_* ioctl commands. + * nbd_ioctl.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * defs.h (DECL_IOCTL): Add nbd. + * ioctl.c (ioctl_decode): Add 0xab (nbd) case. + * xlat/nbd_ioctl_cmds.in: Likewise. + * xlat/nbd_ioctl_flags.in: Likewise. + * tests/ioctl_nbd.c: Likewise. + * tests/.gitignore: Add ioctl_nbd. + * tests/pure_executables.list: Likewise. + * tests/gen_tests.in (ioctl_nbd): New entry. + + Co-Authored-by: Dmitry V. Levin + +2018-10-25 Dmitry V. Levin + + tests: fix build with recent kernel headers. + Linux commit v4.19-rc2-5-g2ecefa0a15fd0ef88b9cd5d15ceb813008136431 + changed the definition of struct keyctl_dh_params in an incompatible + way again. Workaround this issue by using designated initializers. + + * tests/keyctl.c (main): Use designated initializers for + struct keyctl_dh_params. + +2018-10-24 Dmitry V. Levin + + arm, sparc, sparc64: wire up io_pgetevents. + * linux/arm/syscallent.h ([399]): Wire up io_pgetevents syscall + introduced by Linux commit v4.19-rc7~24^2~1. + (ARM_FIRST_SHUFFLED_SYSCALL, SYS_socket_subcall): Raise from 400 to 500, + to make room for new syscalls. + * linux/sparc/syscallent.h ([361]): Wire up io_pgetevents syscall + introduced by Linux commit v4.19~31^2~5. + * linux/sparc64/syscallent.h: Likewise. + +2018-10-24 Gleb Fotengauer-Malinovskiy + + Update ioctl entries from linux v4.19. + * linux/32/ioctls_inc_align16.h: Update from linux v4.19-rc8 + using ioctls_gen.sh. + * linux/32/ioctls_inc_align32.h: Likewise. + * linux/32/ioctls_inc_align64.h: Likewise. + * linux/64/ioctls_inc.h: Likewise. + * linux/x32/ioctls_inc0.h: Likewise. + * linux/i386/ioctls_arch0.h: Likewise. + * linux/x86_64/ioctls_arch0.h: Likewise. + * NEWS: Mention this. + + maint: update for linux 4.19-rc8. + * maint/ioctls_sym.sh (x86_list): Add KVM_[GS]ET_NESTED_STATE. + +2018-10-24 Dmitry V. Levin + + Remove redundant VIDIOC_SUBDEV_* constants. + Remove those of VIDIOC_SUBDEV_* constants are defined exactly the same + way by the Linux kernel as their VIDIOC_* origins. + + Linux kernel commit v4.19-rc1~137^2~248 introduced more of such + duplicates, forward remove them as well. + + * linux/32/ioctls_inc_align16.h: Remove VIDIOC_SUBDEV_DV_TIMINGS_CAP, + VIDIOC_SUBDEV_ENUM_DV_TIMINGS, VIDIOC_SUBDEV_G_DV_TIMINGS, + VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_QUERY_DV_TIMINGS, + VIDIOC_SUBDEV_S_DV_TIMINGS, and VIDIOC_SUBDEV_S_EDID. + * linux/32/ioctls_inc_align32.h: Likewise. + * linux/32/ioctls_inc_align64.h: Likewise. + * linux/64/ioctls_inc.h: Likewise. + * linux/x32/ioctls_inc0.h: Likewise. + * maint/ioctls_sym.sh: Remove VIDIOC_SUBDEV_DV_TIMINGS_CAP, + VIDIOC_SUBDEV_ENUM_DV_TIMINGS, VIDIOC_SUBDEV_ENUMSTD, + VIDIOC_SUBDEV_G_DV_TIMINGS, VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_G_STD, + VIDIOC_SUBDEV_QUERY_DV_TIMINGS, VIDIOC_SUBDEV_QUERYSTD, + VIDIOC_SUBDEV_S_DV_TIMINGS, VIDIOC_SUBDEV_S_EDID, and + VIDIOC_SUBDEV_S_STD. + +2018-09-27 Dmitry V. Levin + + xtensa: fix typo in pkey_alloc syscall number. + * linux/xtensa/syscallent.h (pkey_alloc): Change from 249 to 349. + +2018-09-23 Dmitry V. Levin + + xlat: print _IOC_NONE in symbolic form even if it is equal to 0. + On some architectures _IOC_NONE equals to 1, on others it is 0. + Change the way how ioctl direction flags are printed so that + _IOC_NONE is printed in symbolic form even if it is equal to 0. + + * xlat/ioctl_dirs.in (_IOC_NONE): Move to the head of the list. + * tests/ioctl_inotify.c (main): Update expected output. + * tests/ioctl_loop. (main): Likewise.c + * tests/ioctl_perf.c (main): Likewise. + * tests/ioctl_scsi.c (main): Likewise. + +2018-09-18 Dmitry V. Levin + + Disable git-archive. + Since configure uses git-version-gen which in turn depends + on "git describe" or a .tarball-version file, raw archives + generated by "git archive" cannot be built. + + * .gitattributes: New file. + * README-github_gitlab-autogenerated-archives.txt: Likewise. + +2018-09-16 Dmitry V. Levin + + Workaround signedness bugs in system NLMSG_OK reported by -Wsign-compare + Introduce a replacement for NLMSG_OK provided by since + that system macro contains signedness bugs that are not going to be fixed. + + * netlink.h: Include . + (is_nlmsg_ok): New static inline function. + * socketutils.c (receive_responses): Use it instead of NLMSG_OK. + * tests/netlink_inet_diag.c (check_responses): Likewise. + * tests/netlink_netlink_diag.c (check_responses): Likewise. + * tests/netlink_unix_diag.c (check_responses): Likewise. + + Closes: https://github.com/strace/strace/issues/79 + +2018-09-16 Dmitry V. Levin + + tests/sprintrc.c: drop redundant check. + * tests/sprintrc.c (sprintrc_ex): Remove fmt check, this also fixes the + warning reported by clang -Wtautological-constant-out-of-range-compare. + + build: enable gcc -Woverride-init and clang -Winitializer-overrides. + * m4/st_warn_cflags.m4 (gl_WARN_ADD): Add -Winitializer-overrides + and -Woverride-init. + +2018-09-16 Dmitry V. Levin + + tests: exclude arm_sync_file_range from ksysent test. + arm_sync_file_range is better known as sync_file_range2. + + * tests/ksysent.sed: Filter out arm_sync_file_range. + +2018-09-16 Dmitry V. Levin + + Ignore warnings about overridden initialization of hwaddr_sizes. + As hwaddr_sizes array is explicitly initialized this way, + ignore potential warnings reported by gcc -Woverride-init + and clang -Winitializer-overrides. + + * gcc_compat.h (CLANG_PREREQ): New macro. + (DIAG_PUSH_IGNORE_OVERRIDE_INIT, DIAG_POP_IGNORE_OVERRIDE_INIT): New + macros non-trivially defined for gcc >= 4.2 and clang >= 2.8. + * sock.c (print_ifreq): Use them to ignore warnings about overridden + initialization of hwaddr_sizes array. + + Closes: https://github.com/strace/strace/issues/77 + +2018-09-16 Dmitry V. Levin + + tests: workaround clang -Wunneeded-internal-declaration bug. + * tests/execve.c (main): Explicitly mark q_envp variable as used + to workaround clang -Wunneeded-internal-declaration bug. + * tests/execveat.c (main): Likewise. + * tests/nsyscalls.c (main): Explicitly mark syscallent variable as used + to workaround clang -Wunneeded-internal-declaration bug. + + Closes: https://github.com/strace/strace/issues/78 + +2018-09-04 Eugene Syromyatnikov + + process: honor xlat style in print_user_offset_addr. + * process.c (print_user_offset_addr): Print in accordance with xlat + verbosity setting. + + time: add xlat styles support to printclockname. + * time.c (printclockname): Respectl xlat_verbosity. + + perf: rewrite print_perf_event_attr using PRINT_FIELD_* macros. + * perf.c: Include "print_fields.h". + (PRINT_XLAT): Remove. + (print_perf_event_attr): Use PRINT_FIELD_* macros. + +2018-09-03 Eugene Syromyatnikov + + tests: check stack unwinding for signals. + * tests/stack-fcall-3.c: Include . + (f3): Call getpid or kill depending on the argument, store getpid result. + * tests/stack-fcall.c (main): Remove arguments, call f0(0) and f0(1). + * tests/strace-k-demangle.expected: Update expected output. + * tests/strace-k.expected: Likewise. + * tests/strace-k.test: Rewrite pattern matching code. + + Co-Authored-by: Dmitry V. Levin + +2018-09-03 Eugene Syromyatnikov + + Print stack traces on signals. + I don't know why it hasn't been done earlier. + + * strace.c (print_stopped) [ENABLE_STACKTRACE]: Call unwind_tcb_print + if stack trace printing is enabled. + +2018-09-03 Eugene Syromyatnikov + + xlat: provide fallback definitions for open_access_modes constants. + * xlat/open_access_modes.in: Add fallback values. + + xlat: update resources. + * xlat/resources.in: Declare as #value indexed, provide fallback values. + (RLIMIT_VMEM): Remove. + + nlattr: ignore nla_type flags when selecting nlattr decoder. + * nlattr.c (decode_nlattr_with_data): Apply NLA_TYPE_MASK to nla_type + before decoder selection. + +2018-09-02 Eugene Syromyatnikov + + netlink_packet_diag: assorted decoding fixes. + * xlat/af_packet_versions.in: New file. + * netlink_packet_diag.c: Include "xlat/af_packet_versions.h". + (decode_packet_diag_req): sdiag_protocol shouldn't be decoded as a protocol, + currently it should be set to 0. + (decode_packet_diag_info): Decode pdi_version field using af_packet_versions + xlat; decode pdi_index field as an interface index. + (packet_diag_msg_nla_decoders) : Decode using + decode_nla_uid. + (decode_packet_diag_msg): Decode pdiag_num as an low-level protocol. + * tests/netlink_sock_diag.c: Update expected output. + * tests/nlattr_packet_diag_msg.c: Likewise. + + sockaddr: add X.25 socket address decoding support. + * sockaddr.c: Include . + (print_sockaddr_data_x25): New function. + (sa_printers) <[AF_X25]>: New socket address handler. + * tests/net-sockaddr.c (check_x25): New function. + (main): Use it to check X.25 socket address decoding. + + net: add support for AX.25 protocols and socket option names decoding. + * xlat/ax25_protocols.in: New file. + * xlat/sock_ax25_options.in: Likewise. + * net.c: Include "xlat/ax25_protocols.h" and "xlat/sock_ax25_options.h". + * (SYS_FUNC(socket)): <[AF_AX25]>: Print protocol name using + ax25_protocols xlat. + (print_sockopt_fd_level_name) <[SOL_AX25]>: Print socket option name + using sock_ax25_options xlat. + + sockaddr: decode AX.25 socket addresses. + * defs.h (print_ax25_addr): New prototype. + * print_fields.h (PRINT_FIELD_AX25_ADDR): New macro. + * sockaddr.c: Include . + (check_ax25_address, ax25_addr2str, print_ax25_addr_raw, + print_ax25_addr, print_sockaddr_data_ax25): New functions. + (sa_printers) <[AF_AX25]>: New printer. + * tests/net-sockaddr.c (AX25_ADDR): New macro. + (check_ax25): New function. + (main): Use it to check AX.25 socket address decoding. + + macros: add ROUNDUP macro. + * macros.h (ROUNDUP): New macro. + +2018-09-02 Eugene Syromyatnikov + + futex: recognise FUTEX_BITSET_MATCH_ANY bitmask. + * xlat/futexbitset.in: New file. + * futex.c: Include "xlat/futexbitset.h". + (futex) : Decode val3 using + futexbitset xlat. + * tests/futex.c: Add checks for 0xffffffff bitset mask printing. + + Closes: Linux commit v4.16-rc1~166^2^2~2 + +2018-09-02 Eugene Syromyatnikov + + ioprio: move constant definitions to xlat. + * xlat/ioprio_class.in: Add fallback values. + * xlat/ioprio_who.in: Likewise. + * ioprio.c: Remove IOPRIO_WHO_* and IOPRIO_CLASS_* enums. + + net: decode AF_PACKET protocols in socket syscall. + * net.c: Include "xlat/ethernet_protocols.h" in XLAT_MACROS_ONLY mode. + (SYS_FUNC(socket)) : Decode using ethernet_protocols xlat. + +2018-09-02 Eugene Syromyatnikov + + print_ifindex: add public get_ifname method. + In order to be able to obtain sanitised device name internally. + + * defs.h (get_ifname): New declaration. + * print_ifindex.c (get_ifname): Refactor, leaving out addition + of if_nametoindex("") part. + (sprint_ifname): New function, adds if_nametoindex("") + to get_ifname's output. + (print_ifindex): Use sprint_ifname instead of get_ifname. + +2018-09-02 Eugene Syromyatnikov + + socketutils: introduce get_family_by_proto. + Add a helper function that returns address family based on the internal + notion of the socket protocol using protocols table. + + * defs.h (get_family_by_proto): New declaration. + * socketutils.c (get_family_by_proto): New function. + +2018-09-02 Eugene Syromyatnikov + + socketutils: add more IP/IPv6 transport protocols. + * defs.h (sock_proto): Add SOCK_PROTO_UDPLITE, SOCK_PROTO_DCCP, + SOCK_PROTO_SCTP, SOCK_PROTO_L2TP_IP, SOCK_PROTO_PING, SOCK_PROTO_RAW, + SOCK_PROTO_UDPLITEv6, SOCK_PROTO_DCCPv6, SOCK_PROTO_L2TP_IPv6, + SOCK_PROTO_SCTPv6, SOCK_PROTO_PINGv6, and SOCK_PROTO_RAWv6. + * socketutils.c: Include "xlat/inet_protocols.h" in XLAT_MACROS_ONLY + mode. + (protocols): Add protocol descriptions for them. + +2018-09-02 Eugene Syromyatnikov + + socketutils: store more information in protocols table. + This also allows getting rid of all these *_v[46]_get calls. + + * socketutils.c (unix_get, inet_get, netlink_gen): Add family, protocol, + and proto_name paramteres, use them where appropriate. + (tcp_v4_get, udp_v4_get, tcp_v6_get, udp_v6_get): Remove. + (protocols): Add family and proto fields to the structure, call inet_get + for IP/IPv6 protocols. + (get_sockaddr_by_inode_uncached): Update protocols->get calls. + +2018-09-02 Eugene Syromyatnikov + + sockaddr: whitespace cleanup, fix typo in comment. + * sockaddr.c (print_sockaddr_data_bt): Fix typo, remove excess + indentation from the switch statement. + + tests: add utimensat test variants with different xlat verbosity levels. + * tests/utimensat-Xabbrev.c: New file. + * tests/utimensat-Xraw.c: Likewise. + * tests/utimensat-Xverbose.c: Likewise. + * tests/utimensat.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags. + * tests/pure_executables.list: Add utimensat-Xabbrev, utimensat-Xraw, + and utimensat-Xverbose. + * tests/.gitignore: Likewise. + * tests/gen_tests.in (utimensat-Xabbrev, utimensat-Xraw, utimensat-Xverbose): New + tests. + + print_timespec: make print_timespec_t_utime respect xlat style setting. + * print_timespec.c (print_timespec_t_utime): Print raw timespec value + in accordance with xlat style setting. + +2018-09-02 Eugene Syromyatnikov + + netlink: honor custom xlat style setting during nlmsg flags printing. + Commit v4.23~343 introduced xlat style argument to printflags_ex, but + XLAT_STYLE_DEFAULT was introduced only in the next commit v4.23~342, + which led to missing out fixing the sole external user of this + peculiar extended interface. + + * netlink.c (decode_nlmsg_flags): Use XLAT_STYLE_DEFAULT instead of + XLAT_STYLE_ABBREV in printflags_ex call. + + Fixes: v4.23~342 "Introduce XLAT_STYLE_DEFAULT" + +2018-09-02 Eugene Syromyatnikov + + netlink_netfilter: use xlat styles for res_id workaround printing. + * netlink_netfilter.c (decode_netlink_netfilter): Call print_xlat_ex + in order to respect xlat style setting. + + xlat: provide fallback definitions for epollevents. + * xlat/epollevents.in: Provide fallback definitions, add EPOLLNVAL + constant (introduced by Linux commit v4.16-rc1~3^2~3). + + xlat: provide fallback definitions to pollflags. + * xlat/pollflags.in: Add fallback definitions for POLLWRNORM, + POLLWRBAND, POLLMSG, POLLREMOVE, and POLLRDHUP. + + xlat: provide fallback values for socktypes. + * xlat/socktypes.in: Provide fallback values. + + xlat: provide fallback values to route_nexthop_flags. + * xlat/route_nexthop_flags.in: Add fallback values. + +2018-09-01 Eugene Syromyatnikov + + block: move fallback definitions for ioctl commands to xlat. + * xlat/block_ioctl_cmds.in: New file. + * block.c: Include "xlat/block_ioctl_cmds.h" in XLAT_MACROS_ONLY mode. + (BLKPG, BLKTRACESETUP, BLKTRACESTART, BLKTRACESTOP, BLKTRACETEARDOWN, + BLKDISCARD, BLKIOMIN, BLKIOOPT, BLKALIGNOFF, BLKPBSZGET, + BLKDISCARDZEROES, BLKSECDISCARD, BLKROTATIONAL, BLKZEROOUT): Remove + fallback definitions as those are porvided by block_ioctl_cmds xlat now. + +2018-09-01 Eugene Syromyatnikov + + Decode BLKGETSIZE64 unconditionally. + It is available on all supported kernel versions. + + * block.c (block_ioctl): Remove #ifdef HAVE_BLKGETSIZE64. + * configure.ac: Remove BLKGETSIZE64 check. + +2018-09-01 Eugene Syromyatnikov + + xlat: add ability to specify a default string to print_xlat_ex. + In order to avoid dealing with xlat verbosity styles outside xlat code + as much as possible. + + * defs.h (xlat_style_private_flag_bits): Rename from + print_array_flag_bits, add PXF_DEFAULT_STR_BIT. + (xlat_style_private_flags): Rename from print_array_flags, add + FLAG_(PXF_DEFAULT_STR). + * xlat.c (print_xlat_ex): Handle PXF_DEFAULT_STR by interpreting str + as a default value (print both value and str in XLAT_STYLE_ABBREV). + +2018-09-01 Eugene Syromyatnikov + + nlattr: provide common AF_INET{,6} address decoders. + Rename decode_ifla_inet6_token to decode_nla_in6_addr, + add a sister function decode_nla_in_addr for future use. + + * nlattr.c (decode_nla_in_addr, decode_nla_in6_addr): New functions. + * nlattr.h (DECL_NLA(in_addr), DECL_NLA(in6_addr)): New declarations. + * rtnl_link.c (decode_ifla_inet6_token): Remove. + (ifla_inet6_nla_decoders) <[IFLA_INET6_TOKEN]>: Use decode_nla_in6_addr. + +2018-08-27 Eugene Syromyatnikov + + net: decode SOL_XDP socket option names. + * xlat/sock_xdp_options.in: New file. + * net.c: Include "xlat/sock_xdp_options.h". + (print_sockopt_fd_level_name) : Print SOL_XDP socket + option names. + + xlat: add SOL_XDP to socketlayers.in. + * xlat/socketlayers.in (SOL_XDP): New constant, introduced by Linux + commit v4.18-rc1~114^2~304^2~4^2~14. + + xlat: add AF_XDP to addrfams.in. + * xlat/addrfams.in (AF_XDP): New constant, introduced by Linux commit + v4.18-rc1~114^2~304^2~4^2~14. + + netlink_smc_diag: decode SMC_DIAG_SHUTDOWN attribute value. + * xlat/sock_shutdown_flags.in: New file. + * netlink_smc_diag.c: Include "xlat/sock_shutdown_flags.h". + (decode_smc_diag_shutdown): New function. + (smc_diag_msg_nla_decoders) <[SMC_DIAG_SHUTDOWN]>: Use + decode_smc_diag_shutdown. + * tests/nlattr_smc_diag_msg.c: Add checks for SMC_DIAG_SHUTDOWN. + + tests/ioctl_v4l2: do not calculate page end address each time. + * tests/ioctl_v4l2.c (main): Replace page + size with page_end. + +2018-08-27 Eugene Syromyatnikov + + print_fields: simplify UINT64_MAX printing. + As we have print_xlat_u now. + + * print_fields.h (PRINT_FIELD_U64): Use print_xlat_u for UINT64_MAX + printing. + +2018-08-27 Eugene Syromyatnikov + + nsfs: simplify auxstr logic. + There's no need to check whether non-NULL value is being assigned to + auxstr; syscall_exiting_trace does it itself. + + * nsfs.c (nsfs_ioctl) : Simply assign result of + xlookup to auxstr if syserror(tcp) is false. + +2018-08-27 Eugene Syromyatnikov + + xlat: add BPF_PROG_TYPE_SK_REUSEPORT to bpf_prog_types.in. + * xlat/bpf_prog_types.in (BPF_PROG_TYPE_SK_REUSEPORT): New constant, + introduced by Linux commit v4.19-rc1~140^2~24^2~2^2~5. + * tests/bpf.c: Update expected output. + + xlat: add IPSTATS_MIB_REASM_OVERLAPS to snmp_ip_stats_mib.in. + * xlat/snmp_ip_stats.in (IPSTATS_MIB_REASM_OVERLAPS): New constant, + introduced by Linux commit v4.19-rc1~140^2~128^2~2. + + xlat: update bpf_map_types.in. + * xlat/bpf_map_types.in (BPF_MAP_TYPE_CGROUP_STORAGE): New constant, + introduced by Linux commit v4.19-rc1~140^2~108^2~3^2~12. + (BPF_MAP_TYPE_REUSEPORT_SOCKARRAY): New constant, introduced by Linux + commit v4.19-rc1~140^2~24^2~2^2~6. + * tests/bpf.c: Update expected output. + +2018-08-27 Eugene Syromyatnikov + + rtnl_link: add IFLA_MIN_MTU and IFLA_MAX_MTU attributes. + Introduced by Linux commit v4.19-rc1~140^2~205^2~1. + + * rtnl_link.c (ifinfomsg_nla_decoders) <[IFLA_MIN_MTU], [IFLA_MAX_MTU]>: + New decoder, calls decode_nla_u32. + * xlat/rtnl_link_attrs.in (IFLA_MIN_MTU, IFLA_MAX_MTU): New constant. + +2018-08-27 Eugene Syromyatnikov + + xlat: add IPV4_DEVCONF_BC_FORWARDING-1 to inet_devconf_indices.in. + * xlat/inet_devconf_indices.in (IPV4_DEVCONF_BC_FORWARDING-1): New + constant, introduced by Linux commit v4.19-rc1~140^2~208^2~1. + +2018-08-27 Eugene Syromyatnikov + + rtnl_netconf: add NETCONFA_BC_FORWARDING attribute. + Introduced by Linux commit v4.19-rc1~140^2~208^2~1. + + * rtnl_netconf.c (netconfmsg_nla_decoders) <[NETCONFA_BC_FORWARDING]>: + New decoder, calls decode_nla_s32. + * xlat/rtnl_netconf_attrs.in (NETCONFA_BC_FORWARDING): New constant. + +2018-08-27 Eugene Syromyatnikov + + netlink_smc_diag: add SMC_DIAG_FALLBACK attribute support. + Introduced by Linux commit v4.19-rc1~140^2~253^2~1. + + * linux/smc_diag.h (SMC_DIAG_FALLBACK): New enumeration item. + (struct smc_diag_fallback): New type definition. + * netlink_smc_diag.c: Include "xlat/smc_decl_codes.h". + (decode_smc_diag_fallback): New function. + (smc_diag_msg_nla_decoders) <[SMC_DIAG_FALLBACK]>: New decoder, calls + decode_smc_diag_fallback. + * tests/nlattr_smc_diag_msg.c: Add checks for SMC_DIAG_FALLBACK + attribute decoding. + * xlat/smc_decl_codes.in: New file. + * xlat/smc_diag_attrs.in (SMC_DIAG_FALLBACK): New constant. + +2018-08-27 Eugene Syromyatnikov + + defs.h: add style argument to printxval_search_ex macro. + It is identical to printxval_search otherwise. + + * defs.h (printxval_search_ex): Add style argument. + +2018-08-27 Eugene Syromyatnikov + + xlat: update v4l2_pix_fmts.in. + * xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_FWHT): New constant, introduced by + Linux commit v4.19-rc1~137^2~221. + (V4L2_PIX_FMT_SBGGR14P, V4L2_PIX_FMT_SGBRG14P, V4L2_PIX_FMT_SGRBG14P, + V4L2_PIX_FMT_SRGGB14P): New constants, introduced by Linux commit + v4.19-rc1~137^2~97. + (V4L2_PIX_FMT_Y10P): New constant, introduced by Linux commit + v4.19-rc1~137^2~95. + +2018-08-27 Eugene Syromyatnikov + + netlink_smc_diag: decode smc_diag_msg.diag_fallback constant names. + Introduced by Linux commit v4.19-rc1~140^2~285^2~4. + + * xlat/smc_diag_mode.in: New file. + * netlink_smc_diag.c: Include "xlat/smc_diag_mode.h". + (decode_smc_diag_msg): Print diag_fallback field using smc_diag_mode + xlat. + * tests/netlink_sock_diag.c (test_smc_diag_msg): Update expected output. + * tests/nlattr_smc_diag_msg.c (print_smc_diag_msg): Likewise. + +2018-08-27 Eugene Syromyatnikov + + rtnl_link: add IFLA_BRPORT_BACKUP_PORT attribute. + Introduced by Linux commit v4.19-rc1~140^2~288^2. + + * xlat/rtnl_ifla_brport_attrs.in (IFLA_BRPORT_BACKUP_PORT): New + constant. + * rtnl_link.c (ifla_brport_nla_decoders) <[IFLA_BRPORT_BACKUP_PORT]>: + New decoder. + +2018-08-27 Eugene Syromyatnikov + + xlat: update nt_descriptor_types.in. + * xlat/nt_descriptor_types.in (NT_VMCOREDD): New named constant, + introduced by Linux commit v4.18-rc1~114^2~252^2~2. + (NT_MIPS_DSP): New named constant, introduced by Linux commit + v4.19-rc1~42^2~63. + (NT_MIPS_FP_MODE): New named constant, introduced by Linux commit + v4.19-rc1~42^2~62. + + xlat: add AUDIT_INTEGRITY_POLICY_RULE to nl_audit_types.in. + * xlat/nl_audit_types.in (AUDIT_INTEGRITY_POLICY_RULE): New constant, + introduced by Linux commit v4.19-rc1~124^2~5. + + rtnl_link: decode named constants for IFLA_XDP_ATTACHED attribute value. + * xlat/rtnl_ifla_xdp_attached_mode.in: New file. + * rtnl_link.c: Include "xlat/rtnl_ifla_xdp_attached_mode.h". + (decode_ifla_xdp_attached): New function. + (ifla_xdp_nla_decoders) <[IFLA_XDP_ATTACHED]>: Use + decode_ifla_xdp_attached instead of decode_nla_u8. + * tests/nlattr_ifla_xdp.c: Add checks for IFLA_XDP_ATTACHED decoding. + +2018-08-27 Eugene Syromyatnikov + + rtnl_link: add new IFLA_XDP_* attributes. + Introduced by Linux commit v4.19-rc1~140^2~364^2~6^2~6. + + * xlat/rtnl_ifla_xdp_attrs.in (IFLA_XDP_DRV_PROG_ID, + IFLA_XDP_SKB_PROG_ID, IFLA_XDP_HW_PROG_ID): New constants. + * rtnl_link.c (ifla_xdp_nla_decoders): Add decoders for + IFLA_XDP_DRV_PROG_ID, IFLA_XDP_SKB_PROG_ID, and IFLA_XDP_HW_PROG_ID. + * tests/nlattr_ifla_xdp.c: Add checks for new attributes. + +2018-08-27 Eugene Syromyatnikov + + xlat: update v4l2_control_ids.in. + * xlat/v4l2_control_ids.in (V4L2_CID_MPEG_VIDEO_VP8_PROFILE): Renamed + from V4L2_CID_MPEG_VIDEO_VPX_PROFILE (the latter is now a synonym), + by Linux commit v4.19-rc1~137^2~270. + (V4L2_CID_MPEG_VIDEO_VP9_PROFILE): New constant, introduced by Linux + commit v4.19-rc1~137^2~269. + + xlat: add SO_TXTIME to sock_options.in. + * xlat/sock_options.in (SO_TXTIME): New constant, introduced by Linux + commit v4.19-rc1~140^2~465^2~12. + +2018-08-27 Eugene Syromyatnikov + + netlink_smc_diag: implement SMC_DIAG_DMBINFO decoding. + The message has been added by Linux commit v4.19-rc1~140^2~507^2~1. + + * linux/smc_diag.h: Include "gcc_compat.h". + (enum): Add SMC_DIAG_DMBINFO. + (struct smcd_diag_dmbinfo): New type definition. + * xlat/smc_diag_attrs.in (SMC_DIAG_DMBINFO): New constant. + * netlink_smc_diag.c (decode_smc_diag_dmbinfo): New function. + (smc_diag_msg_nla_decoders) [SMC_DIAG_DMBINFO]: New decoder, calls + decode_smc_diag_dmbinfo. + * tests/nlattr_smc_diag_msg.c: Add SMC_DIAG_DMBINFO check. + +2018-08-27 Eugene Syromyatnikov + + xlat: add SCTP_REUSE_PORT to sock_sctp_options.in. + * xlat/sock_sctp_options.in (SCTP_REUSE_PORT): New constant, introduced + by Linux commit v4.19-rc1~140^2~518. + + xlat: add IN_MASK_CREATE to inotify_flags.in. + * xlat/inotify_flags.in (IN_MASK_CREATE): New constant, introduced by + Linux commit v4.19-rc1~115^2. + * tests/inotify.c (main): Update expected output. + +2018-08-22 Dmitry V. Levin + + tests: workaround systemd-nspawn habit of disabling unimplemented syscalls + * tests/nsyscalls.c (test_syscall): Do not assume that unimplemented + syscalls always fail with ENOSYS. + + tests: workaround systemd-nspawn habit of disabling mlockall syscall. + * tests/mmap.c (main): Do not assume that mlockall syscall always + succeeds. + + tests: workaround systemd-nspawn habit of disabling munlockall syscall. + * tests/munlockall.c (main): Do not assume that munlockall syscall + always succeeds. + +2018-08-21 Eugene Syromyatnikov + + Decode AF_SMC netlink messages unconditionally. + As smc_diag.h is bundled, there is little sense to build AF_SMC support + conditionally. + + * netlink_smc_diag.c [!AF_SMC]: Include xlat/addrfams.h under + XLAT_MACROS_ONLY, enable the rest of file. + * netlink_sock_diag.c: Include xlat/addrfams.h under XLAT_MACROS_ONLY. + (diag_decoders): Remove "ifdef AF_SMC" condition for [AF_SMC], reorder + in accordance with address family values. + * tests/nlattr_smc_diag_msg.c [!AF_SMC]: Define AF_SMC to 43, enable + the rest of test. + +2018-08-19 Dmitry V. Levin + + strace.c: introduce struct tcb_wait_data. + Introduce a new structure to pass information between next_event(), + restart_delayed_tcb(), and dispatch_event(). + + This is going to be used by a subsequent change of next_event(). + + * strace.c (struct tcb_wait_data): New type. + (next_event): Remove parameters, return a pointer + to const struct tcb_wait_data. Return NULL instead of TE_BREAK. + (dispatch_event): Replace all parameters with a pointer + to const struct tcb_wait_data, obtain the trace event, siginfo, + and status from its fields. + (restart_delayed_tcb): Add local struct tcb_wait_data variable + with te field set to TE_RESTART, pass it to dispatch_event(). + (main): Remove status and si variables, update next_event() + and dispatch_event() invocations. + + Co-Authored-by: Eugene Syromyatnikov + +2018-08-19 Eugene Syromyatnikov + + xlat: fix typo in smc_protocols.in. + * xlat/smc_protocols.in: s/^MCPROTO_SMC/SMCPROTO_SMC/. + +2018-08-19 Dmitry V. Levin + + ci: add a test with the latest gcc and mainline headers. + * .gitlab-ci.yml (gcc-x86_64-libdw-mainline): New entry. + * .travis.yml (CC=gcc-8, KHEADERS=torvalds/linux): Likewise. + + ci: update gitlab ubuntu image. + * .gitlab-ci.yml (image): Replace "ubuntu:17.10" with "ubuntu:18.04". + + ci: install kernel headers after compiler dependencies. + * ci/install-dependencies.sh: Install kernel headers after compiler + dependencies to avoid a needless attempt to install $common_packages. + + ci: fix kernel headers version diagnostics. + * ci/run-build-and-tests.sh: Honor $CPPFLAGS when printing + kernel headers version. + +2018-08-19 Zhibin Li <08826794brmt@gmail.com> + + tests: enhance test coverage of evdev ioctl. + * tests/ioctl_evdev.c (main): Test EVIOCGMTSLOTS(8) command. + + tests: check decoding of successful evdev ioctl. + * tests/ioctl_evdev-success.c: New file. + * tests/ioctl_evdev-success-v.c: Likewise. + * tests/ioctl_evdev-success.test: New test. + * tests/ioctl_evdev-success-v.test: Likewise. + * tests/.gitignore: Add ioctl_evdev-success and ioctl_evdev-success-v. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add the two tests mentioned above. + +2018-08-19 Zhibin Li <08826794brmt@gmail.com> + + evdev: fix decoding of EVIOCGBIT(0, ...) + There is a comment in drivers/input/evdev.c which says: + /* EV_SYN==0 is EV_CNT, _not_ SYN_CNT, see EVIOCGBIT */ + + That is, EVIOCGBIT(0, ...) should return a bit mask with supported + event types instead of SYN_* event codes. + + * defs.h (evdev_ev): New prototype. + * evdev.c: Include "xlat/evdev_ev.h" and remove "xlat/evdev_sync.h". + (bit_ioctl) : Replace EV_SYN with 0, use evdev_ev + with XT_SORTED in decode_bitset invocation instead. + * ioctl.c: Do not include "xlat/evdev_ev.h". + (evdev_decode_number): Print nr == 0x20 as "0" instead of "EV_SYN". + * tests/ioctl_evdev.c (main): Use 0 instead of EV_SYN in EVIOCGBIT + output. + * xlat/evdev_sync.in: Remove. + + Co-Authored-by: Dmitry V. Levin + Fixes: v4.10~89 "Add decoding for evdev ioctls" + +2018-08-19 Zhibin Li <08826794brmt@gmail.com> + + evdev: fix decoding of bit sets. + According to drivers/input/evdev.c:bits_to_user(), + the Linux kernel returns the number of bytes, not bits. + + * evdev.c (decode_bitset_): Treat syscall return value as the number + of bytes. + + Co-Authored-by: Dmitry V. Levin + Fixes: v4.10~89 "Add decoding for evdev ioctls" + +2018-08-19 Pierre Marsais + + kvm: decode the argument of KVM_CHECK_EXTENSION. + xlat/kvm_cap.in has been generated using the following command line: + + grep '#define\s\+KVM_CAP' $linux/include/uapi/linux/kvm.h | + sed -E -e 's/^#define\s+([^ \t]+)\s*([0-9]+).*$/printf "%-40s%s\n" \1 \2/e' \ + -e 's/ {8}/\t/g; s/ +/\t/g' + + * xlat/kvm_cap.in: New file. + * kvm.c: Include "xlat/kvm_cap.h". + (kvm_ioctl_decode_check_extension): New function. + (kvm_ioctl): Use it. + * tests/ioctl_kvm_run_common.c (main): Check decoding + of KVM_CHECK_EXTENSION command. + +2018-08-19 Dmitry V. Levin + + xlat: update V4L2_CID_USER_*_BASE constants. + * xlat/v4l2_control_id_bases.in (V4L2_CID_USER_S2255_BASE, + V4L2_CID_USER_SI476X_BASE, V4L2_CID_USER_SAA7134_BASE, + V4L2_CID_USER_ADV7180_BASE, V4L2_CID_USER_TC358743_BASE, + V4L2_CID_USER_MAX217X_BASE): New constants. + +2018-08-19 Dmitry V. Levin + + xlat: workaround V4L2_CID_USER_IMX_BASE Linux kernel ABI breakage. + Linux kernel commit v4.18-rc2-106-g421860b9d47053badce4b247576fa48df9ab4c48 + has changed the value of V4L2_CID_USER_IMX_BASE constant introduced + by commit v4.13-rc1~141^2~121 because the old value was already used + by V4L2_CID_USER_MAX217X_BASE. + + This is of course an ABI breakage that affects Linux kernels starting + with 4.13 and up to 4.18, as well as their LTS derivatives. + + Since the imx driver didn't provide any public control ID definitions, + it looks like the best way to handle this situation is to pretend that + the old value of V4L2_CID_USER_IMX_BASE didn't exist. + + * xlat/v4l2_control_id_bases.in (V4L2_CID_USER_IMX_BASE): Redefine. + + Co-Authored-by: Eugene Syromyatnikov + +2018-08-14 Dmitry V. Levin + + Post-release administrivia. + * NEWS: Add a header line for the next release. + * debian/changelog.in: Add a changelog entry for 4.24-1. + * strace.spec.in: Likewise. + + Prepare for 4.24 release. + * NEWS: Update for 4.24 release. + +2018-08-12 Dmitry V. Levin + + Update copyright headers. + Headers updated automatically using maint/update_copyright_years.sh + script. + +2018-08-12 Gleb Fotengauer-Malinovskiy + + Update ioctl entries from linux v4.18. + * linux/32/ioctls_inc_align16.h: Update from linux v4.18-rc8 + using ioctls_gen.sh. + * linux/32/ioctls_inc_align32.h: Likewise. + * linux/32/ioctls_inc_align64.h: Likewise. + * linux/64/ioctls_inc.h: Likewise. + * linux/x32/ioctls_inc0.h: Likewise. + * linux/s390x/ioctls_arch0.h: Likewise. + * NEWS: Mention this. + + maint: update for linux v4.18. + * maint/ioctls_sym.sh: Add workaround for linux/omap3isp.h file. + +2018-08-12 Dmitry V. Levin + + Replace BTRFS_IOC_[GS]ET_FSLABEL with FS_IOC_[GS]ETFSLABEL. + Linux kernel commit v4.18-rc1~37^2~66 introduced FS_IOC_[GS]ETFSLABEL + ioctl constants as generalized copies of BTRFS_IOC_[GS]ET_FSLABEL. + + * linux/32/ioctls_inc_align16.h: Replace BTRFS_IOC_[GS]ET_FSLABEL + with FS_IOC_[GS]ETFSLABEL. + * linux/32/ioctls_inc_align32.h: Likewise. + * linux/32/ioctls_inc_align64.h: Likewise. + * linux/64/ioctls_inc.h: Likewise. + * linux/x32/ioctls_inc0.h: Likewise. + * maint/ioctls_sym.sh: Remove BTRFS_IOC_[GS]ET_FSLABEL. + * tests/btrfs.c (FS_IOC_GETFSLABEL, FS_IOC_SETFSLABEL): Add fallback + definitions. + (btrfs_test_label_ioctls, btrfs_test_read_ioctls): Replace + BTRFS_IOC_[GS]ET_FSLABEL with FS_IOC_[GS]ETFSLABEL. + +2018-08-08 Eugene Syromyatnikov + + open.c: use __O_TMPFILE. + As it is the flag kernel actually checks against, + and it is now guaranteed to have a fallback definition. + + * open.c (STRACE_O_TMPFILE): Remove. + (decode_open): Use __O_TMPFILE instead of STRACE_O_TMPFILE. + +2018-08-05 Dmitry V. Levin + + xlat: regenerate sock_options.in. + * xlat/sock_options.in: Regenerate using maint/gen_xlat_defs.sh script. + * xlat/sock_options.sh: Remove. + +2018-08-05 Dmitry V. Levin + + xlat: add fallback definitions to open_mode_flags. + * xlat/open_mode_flags.in: Regenerate using maint/gen_xlat_defs.sh script + to provide fallback definitions. Implement a workaround for O_NDELAY. + + Co-Authored-by: Co-Authored-by: Eugene Syromyatnikov + +2018-08-05 Eugene Syromyatnikov + + xlat: remove non-Linux flags from open_mode_flags. + * xlat/open_mode_flags.in (O_PRIV, FNDELAY, FAPPEND, FMARK, FDEFER, + FSHLOCK, FEXLOCK, FCREAT, FTRUNC, FEXCL, FNBIO, FSYNC, FNOCTTY, + O_SHLOCK, O_EXLOCK): Remove flags that are not present in Linux. + + Co-Authored-by: Dmitry V. Levin + +2018-08-05 Dmitry V. Levin + + xlat: add fallback definitions to madvise_cmds. + * xlat/madvise_cmds.in: Regenerate using maint/gen_xlat_defs.sh script + to provide fallback definitions. + + Co-Authored-by: Eugene Syromyatnikov + +2018-08-05 Dmitry V. Levin + + xlat: add fallback definitions to mmap_flags. + * xlat/mmap_flags.in: Regenerate using maint/gen_xlat_defs.sh script + to provide fallback definitions. Implement a workaround for MAP_RENAME. + + Co-Authored-by: Eugene Syromyatnikov + +2018-08-05 Eugene Syromyatnikov + + maint: add a Linux UAPI headers crawler. + This script is going to be used to generate xlat fallback values. + + * maint/gen_xlat_defs.sh: New file. + + Co-Authored-by: Dmitry V. Levin + +2018-08-05 Dmitry V. Levin + + strace.spec.in: use $RPM_OPT_FLAGS when building auxiliary programs. + * strace.spec.in: Set CFLAGS_FOR_BUILD to "$RPM_OPT_FLAGS" so that + $RPM_OPT_FLAGS is honored when building auxiliary programs like + ioctlsort. + +2018-08-05 Dmitry V. Levin + + strace.spec.in: compress changelog files. + Some say uncompressed changelog files are too big. + + * strace.spec.in: Compress ChangeLog and ChangeLog-CVS using gzip -9n. + +2018-08-05 Dmitry V. Levin + + strace.spec.in: use a SUSE-specific group name for SUSE. + Since, apparently, it isn't quite happy with a simple group name + "Development/Debuggers". + + * strace.spec.in (Group): Add %{?suse_version:/Tools}. + +2018-08-05 Eugene Syromyatnikov + + strace.spec.in: use a SUSE-specific license name for SUSE. + Since, apparently, it isn't quite happy with a simple "BSD". + + * strace.spec.in (License): Add %{?suse_version:-3-Clause}. + + Co-Authored-by: Dmitry V. Levin + +2018-08-05 Eugene Syromyatnikov + + tests: allow any error code when trying to set time. + Lower expectations of particular error code numbers when trying to set + time. This helps to workaround issues with unexpected return codes + in some exotic environments where EPERM is returned instead of EINVAL + (e.g. mock that uses systemd-nspawn). + + * tests/clock_xettime.c (main): Do not hardcode EINVAL, print return + codes using sprintrc. + * tests/xettimeofday.c (main): Likewise. + * NEWS: Mention this fix. + + Co-Authored-by: Dmitry V. Levin + +2018-08-05 Eugene Syromyatnikov + + s390x: fix build with old kernel headers. + Avoid defining psw_compat_t and s390_compat_regs if their definitions + are provided by kernel. Before Linux commit v3.10-rc1~201^2~11, + these definition were available in . + + * configure.ac (AC_CHECK_TYPES): Check for s390_compat_regs. + * linux/s390x/arch_regs.c [HAVE_S390_COMPAT_REGS]: Do not define + psw_compat_t and s390_compat_regs. + * NEWS: Mention this fix. + + Co-Authored-by: Dmitry V. Levin + +2018-08-05 Dmitry V. Levin + + strace.spec.in: minor updates here and there. + * strace.spec.in: Add descriptive comments to build requirements. + Introduce %maybe_use_defattr and use it instead of %defattr. + Add output of ld --version to the build environment information. + Use printf instead of echo -e. + +2018-08-05 Dmitry V. Levin + + strace.spec.in: remove strace64 subpackage. + strace64 subpackage used to be installed into ppc32 and sparc32 + userspace running by a 64-bit kernel to trace 64-bit processes. + + As simultaneous decoding of processes running both in 64-bit and 32-bit + personality is fully supported on every architecture with compat kernel + support for quite some time, one can just install a 64-bit strace and + there is no more need for that strace64 kludge. + + * strace.spec.in (strace64_arches, copy64, %ifarch %{strace64_arches}): + Remove. + +2018-08-04 Dmitry V. Levin + + Update NEWS. + + Update NEWS. + + rtnl_route: decode new RTA_* attributes. + * rtnl_route.c (rtmsg_nla_decoders): Add entries for RTA_IP_PROTO, + RTA_SPORT, and RTA_DPORT. + + xlat: update RTA_* constants. + * xlat/rtnl_route_attrs.in: Add RTA_IP_PROTO, RTA_SPORT, and RTA_DPORT + * constants introduced by Linux kernel commit v4.18-rc1~114^2~165^2~2. + + rtnl_link: decode new IFLA_BRPORT_* attributes. + * rtnl_link.c (ifla_brport_nla_decoders): Add entries for + IFLA_BRPORT_GROUP_FWD_MASK, IFLA_BRPORT_NEIGH_SUPPRESS, and + IFLA_BRPORT_ISOLATED. + + xlat: update IFLA_BRPORT_* constants. + * xlat/rtnl_ifla_brport_attrs.in: Add IFLA_BRPORT_GROUP_FWD_MASK + constant introduced by Linux kernel commit v4.15-rc1~84^2~607. + Add IFLA_BRPORT_NEIGH_SUPPRESS constant introduced by Linux kernel + commit v4.15-rc1~84^2~523^2~2. + Add IFLA_BRPORT_ISOLATED constant introduced by Linux kernel commit + v4.18-rc1~114^2~142. + + xlat: update IFA_* constants. + * xlat/rtnl_addr_attrs.in: Add IFA_RT_PRIORITY constant introduced + by Linux kernel commit v4.18-rc1~114^2~108^2~3 + + xlat: update RTPROT_* constants. + * xlat/routing_protocols.in: Add RTPROT_BGP, RTPROT_ISIS, RTPROT_OSPF, + RTPROT_RIP, and RTPROT_EIGRP constants introduced by Linux kernel commit + v4.18-rc1~114^2~90. + +2018-08-01 Dmitry V. Levin + + xlat: save the script used to generate xlat/sock_options.in. + * xlat/sock_options.sh: New file from commit message of commit v4.23~199. + +2018-08-01 Zhibin Li <08826794brmt@gmail.com> + + tests: check decoding of getsockopt(PACKET_STATISTICS) + * tests/net-tpacket_stats.c: New file. + * tests/net-tpacket_stats-success.c: Likewise. + * tests/gen_tests.in (net-tpacket_stats): New test. + * tests/net-tpacket_stats-success.test: Likewise. + * tests/.gitignore: Add net-tpacket_stats and net-tpacket_stats-success. + * tests/Makefile.am (check_PROGRAMS): Add net-tpacket_stats-success. + (DECODER_TESTS): Add net-tpacket_stats-success.test. + * tests/pure_executables.list: Add net-tpacket_stats. + + tests: check decoding of setsockopt(PACKET_[R|T]X_RING) + * tests/net-tpacket_req.c: New file. + * tests/.gitignore: Add net-tpacket_req. + * tests/pure_executables.list: Likewise. + * tests/gen_tests.in (net-tpacket_req): New test. + + tests: check decoding of setsockopt(PACKET_[ADD|DROP]_MEMBERSHIP) + * tests/net-packet_mreq.c: New file. + * tests/.gitignore: Add net-packet_mreq. + * tests/pure_executables.list: Likewise. + * tests/gen_tests.in (net-packet_mreq): New test. + +2018-07-20 Dmitry V. Levin + + tests: bring lists back to the sorted order. + * tests/.gitignore: Make the list sorted again. + * tests/pure_executables.list: Likewise. + * tests/Makefile.am (check_PROGRAMS, DECODER_TESTS, MISC_TESTS): + Likewise. + +2018-07-20 Zhibin Li <08826794brmt@gmail.com> + + tests: check decoding of successful quotactl. + * tests/quotactl-success.c: New file. + * tests/quotactl-success-v.c: Likewise. + * tests/quotactl-xfs-success.c: Likewise. + * tests/quotactl-xfs-success-v.c: Likewise. + * tests/quotactl-success.test: New test. + * tests/quotactl-success-v.test: Likewise. + * tests/quotactl-xfs-success.test: Likewise. + * tests/quotactl-xfs-success-v.test: Likewise. + * tests/.gitignore: Add quotactl-success, quotactl-success-v, + quotactl-xfs-success and quotactl-xfs-success-v. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add four new tests listed above. + * tests/quotactl.h: [INJECT_RETVAL] (check_quota): Use errstr instead of + sprintrc; check that returned value is equivalent to the injected one; + append "(INJECTED)" string to errstr. + * tests/quotactl.c: Changed condition rc != 0 to rc < 0 in callback + functions and value of opaque pointer addr_cb_arg in order to check + successful injection. + * tests/quotactl-xfs.c: Likewise. + +2018-07-18 Dmitry V. Levin + + net: enhance decoding of getsockopt(PACKET_STATISTICS) + * net.c (print_tpacket_stats): Change decoder to match the kernel + behaviour: getsockopt syscall accepts any non-negative *optlen and + writes either MIN(sizeof(struct tpacket_stats), *optlen) or + MIN(sizeof(struct tpacket_stats_v3), *optlen) bytes of data. + + net: compile SO_PEERCRED/SO_ATTACH_FILTER/SO_ATTACH_REUSEPORT_CBPF code unconditionally + * net.c: Remove checks for SO_PEERCRED, SO_ATTACH_FILTER, and + SO_ATTACH_REUSEPORT_CBPF macros as they are defined unconditionally + since commit v4.23~199. + + net: enhance decoding of getsockopt(SO_PEERCRED) + * net.c (print_ucred): Rename to print_get_ucred, change decoder + to match the kernel behaviour: getsockopt syscall accepts any + non-negative *optlen and writes MIN(sizeof(struct ucred), *optlen) + bytes of data. + (print_getsockopt): Replace print_ucred with print_get_ucred. + * tests/so_percred.c: Include . + (main): Update expected output. + + net: enhance decoding of getsockopt(SO_LINGER) + * net.c (print_get_linger): Change decoder to match the kernel + behaviour: getsockopt syscall accepts any non-negative *optlen + and writes MIN(sizeof(struct linger), *optlen) bytes of data. + (print_set_linger): Move after definition of SYS_FUNC(getsockopt). + * tests/so_linger.c: Include and . + (main): Update expected output. + + net: generalize getsockopt length check. + * net.c (print_getsockopt): Apply (ulen < 0 || rlen < 0) check for all + cases. As the kernel neither accepts nor returns a negative length + in case of successful getsockopt syscall invocation, these negative + values must have been forged by userspace. + +2018-07-15 Dmitry V. Levin + + tests: fix build with fresh glibc. + Workaround additional incompatibility between and + introduced by glibc-2.27.9000-566-gfd70af4. + + * tests/xstatx.c (statx, statx_timestamp): Redefine before the inclusion + of to avoid conflicts between definitions provided by the + linux kernel headers and the GNU libc. + +2018-07-15 Eugene Syromyatnikov + + tests/quotactl.h: document check_quota. + * tests/quotactl.h (check_quota): Add a comment describing the function + usage. + +2018-07-15 Zhibin Li <08826794brmt@gmail.com> + + tests/quotactl-xfs.c: fix indentation. + +2018-07-15 Zhibin Li <08826794brmt@gmail.com> + + tests: use check_quota for invalid quotactl commands. + Use check_quota function for invalid commands instead of manual quotactl + syscall invocations. In this way successful injection can also be checked + for these commands in the next commit. + + * tests/quotactl.c (main): Add invalid_cmd_str and invalid_id_str local + variables, remove unused variable rc, use check_quota instead of manual + quotactl syscall invocations. + * tests/quotaclt.c (main): Add invalid_cmd_str variable, remove unused + variable rc, use check_quota instead of manual quotactl syscall invocations. + +2018-07-15 Zhibin Li <08826794brmt@gmail.com> + + tests: enhance test coverage of quotactl syscall parser. + * tests/quotactl.c (print_dqfmt): New function. + (main): Use print_dqfmt to print flags of quota format, improve existing + tests and add more tests for Q_GETFMT. + * tests/quotactl-xfs.c: Improve existing tests and add more tests for + Q_XGETQSTAT and Q_XGETQSTATV. + + tests/quotactl-xfs.c: fix typos in QCMD. + * tests/quotactl-xfs.c (main): fix typos of sub-commands in QCMD. + + Mpersify decoder of struct xfs_dqstats. + * xfs_quota_stat.h: New file. + * fetch_struct_xfs_quotastat.c: Likewise. + * Makefile.am (strace_SOURCES): Add them. + * quota.c: Include xfs_quota_stat.h + (struct fs_qfilestat, struct xfs_dqstats): Moved to xfs_quota_stat.h. + (decode_cmd_data) : Use fetch_struct_quotastat. + + quota: fix disorder of PRINT_FIELD invocations. + * quota.c (decode_cmd_data) : Print fields + of struct xfs_dqstats in the structure order. + +2018-07-12 Zhibin Li <08826794brmt@gmail.com> + + tests: extend coverage for other fcntl flags. + * tests/fcntl-common.c: Include . + (struct fcntl_cmd_check): New structure. + (print_retval_flags, test_other_set_cmd, test_other_get_cmd, + print_flags_getfd, print_flags_getsig, print_flags_getlease, + test_fcntl_others): New functions. + (main): Use test_fcntl_others. + +2018-07-11 Dmitry V. Levin + + Implement -e kvm= option on all architectures. + Make -e kvm= interface available on all architectures by adding a stub + on those architectures that do not have . + + * filter_qualify.c (qualify_kvm): Define unconditionally. + (qual_options): Define qualify_kvm entry unconditionally. + * strace.c (usage): Mention kvm argument of -e option unconditionally. + +2018-07-11 Eugene Syromyatnikov + + xlat: update bpf(2)-related constants. + * xlat/bpf_attach_type.in (BPF_CGROUP_UDP4_SENDMSG, + BPF_CGROUP_UDP6_SENDMSG): New constant, introduced by Linux commit + v4.18-rc1~114^2~9^2~20^2~4. + (BPF_LIRC_MODE2): New constant, introduced by Linux commit + v4.18-rc1~114^2~9^2~15^2~1. + * xlat/bpf_commands.in (BPF_BTF_LOAD): New constant, introduced by Linux + commit v4.18-rc1~114^2~417^2~1^2~5. + (BPF_BTF_GET_FD_BY_ID): New constant, introduced by Linux commit + v4.18-rc1~114^2~223^2~21^2~4. + (BPF_TASK_FD_QUERY): New constant, introduced by Linux commit + v4.18-rc1~114^2~148^2~1^2~5. + * xlat/bpf_map_types.in (BPF_MAP_TYPE_XSKMAP): New constant, introduced + by Linux commit v4.18-rc1~114^2~304^2~4^2~8. + (BPF_MAP_TYPE_SOCKHASH): New constant, introduced by Linux commit + v4.18-rc1~114^2~223^2~5^2~2. + * xlat/bpf_prog_types.in (BPF_PROG_TYPE_LWT_SEG6LOCAL): New constant, + introduced by Linux commit v4.18-rc1~114^2~148^2~2^2~1. + (BPF_PROG_TYPE_LIRC_MODE2): New constant, introduced by Linux commit + v4.18-rc1~114^2~9^2~15^2~1. + * tests/bpf.c: Update expected output. + +2018-07-11 Eugene Syromyatnikov + + Wire up io_pgetevents and rseq on hppa, microblaze, mips, powerpc, and s390 + * linux/hppa/syscallent.h ([350]): Wire up io_pgetevents syscall + introduced by Linux commit v4.18-rc3~7^2~2. + * linux/microblaze/syscallent.h ([399], [400]): Wire up io_pgetevents + and rseq syscalls introduced by Linux commit v4.18-rc3~33^2~2. + * linux/mips/syscallent-n32.h ([6331], [6332]): Wire up rseq and + io_pgetevents syscalls introduced by Linux commits v4.18-rc2~11^2~2 + and v4.18-rc2~11^2, respectively. + * linux/mips/syscallent-n64.h ([5327], [5328]): Likewise. + * linux/mips/syscallent-o32.h ([4367], [4368]): Likewise. + * linux/powerpc/syscallent.h ([388]): Wire up io_pgetevents syscall + introduced by Linux commit v4.18-rc3~14^2~2. + * linux/powerpc64/syscallent.h ([388]): Likewise. + * linux/s390/syscallent.h ([382], [383]): Wire up io_pgetevents + and rseq syscalls introduced by Linux commits v4.18-rc4~18^2~1 + and v4.18-rc4~18^2, respectively. + * linux/s390x/syscallent.h([382], [383]): Likewise. + + Co-Authored-by: Dmitry V. Levin + +2018-07-11 Eugene Syromyatnikov + + maint: improve the tag message. + * maint/gen-tag-message.sh: Align the wording of the changes section + header with the one used in NEWS, add a reference to CREDITS in + "Contributors" section. + + Co-Authored-by: Dmitry V. Levin + +2018-07-10 Dmitry V. Levin + + Upgrade invalid -e kvm= argument to a fatal error. + * filter_qualify.c (qualify_kvm): Call error_msg_and_die instead of + error_msg in case of invalid -e kvm= argument. + * tests/options-syntax.test: Check it. + + Mention -e inject option in "strace -h" output. + * strace.c (usage): Mention inject argument of -e option. + +2018-07-07 Masatake YAMATO + + tests: check decoding of vcpu auxstr. + * tests/ioctl_kvm_run_common.c: Rename from ioctl_kvm_run.c. + (run_kvm): Parametrize printing of KVM_RUN ioctl with print_KVM_RUN + invocation. + (main): Invoke optional KVM_NO_CPUID_CALLBACK macro when the old kernel + behavior is detected. + * tests/Makefile.am (EXTRA_DIST): Add ioctl_kvm_run_common.c. + * tests/ioctl_kvm_run.c: New file, a wrapper around + ioctl_kvm_run_common.c. + * ioctl_kvm_run_auxstr_vcpu.c: Likewise. + * tests/gen_tests.in (ioctl_kvm_run_auxstr_vcpu): New test. + * tests/pure_executables.list: Add ioctl_kvm_run_auxstr_vcpu. + * tests/.gitignore: Likewise. + + Co-Authored-by: Dmitry V. Levin + +2018-07-07 Masatake YAMATO + + strace.1.in: document -e kvm=vcpu option. + * strace.1.in (-e kvm=vcpu): Document new option. + * NEWS: Mention -e kvm=vcpu option. + + Co-Authored-by: Dmitry V. Levin + +2018-07-07 Masatake YAMATO + + kvm: attach the exit reason of vcpu as auxstr to KVM_RUN output. + In KVM, a virtual machine implementation like Qemu can access a vcpu + via ioctl. KVM_RUN is an ioctl command to enter vcpu. The command + returns control for various reasons: needs of device emulation or + consuming time slices are the typical ones. The vmi takes a different + action for the reason. + + We, strace users, want to know the reason to understand kvm. This + change prints the reason as auxstr if "-e kvm=vcpu" option is given, + and if strace runs on Linux 4.16.0 or higher, which includes commit + e46b469278a59781f9b25ff608af84892963821b, "kvm: embed vcpu id to dentry + of vcpu anon inode." + + The way to get the reason is a bit complicated because the ioctl does + not return it to the userspace directly. Instead, the vmi and kvm + communicate via an area of the process virtual memory where the fd of + vcpu is mmap'ed. strace must peek the area to know the reason. + + The change does three things: (1) recording the area for the given vcpu + when the target calls VCPU_CREATE to vcpu_info_list per tcb data field, + (2) verifying the data recorded in vcpu_info_list before doing (3), and + (3) decoding the exit reason field of the area. + + The change is complicated because there is a case that strace + does not have a chance to do (1) if -p option is used. + In this case, vcpu_info data created in the step (2). + + The area has more fields than "exit reason", + dumping them may be implemented in the future. + + * defs.h (struct tcb) [HAVE_LINUX_KVM_H]: Add vcpu_info_list field. + [HAVE_LINUX_KVM_H]: (kvm_run_structure_decoder_init, + kvm_vcpu_info_free): New declarations. + * strace.c (usage): Add "kvm" as a new expression for -e option. + (droptcb): Call kvm_vcpu_info_free. + * filter_qualify.c (qualify_kvm): New function calling + kvm_run_structure_decoder_init to enable for attaching the exit + reason to auxstr. + (qual_options): Add "kvm" as an entry. + * xlat/kvm_exit_reason.in: New file. + * kvm.c: Include xmalloc.h and mmap_cache.h. + (dump_kvm_run_structure): New static variable. + (kvm_run_structure_decoder_init): New function. + (vcpu_info): New struct definition representing the 3-tuple: vcpu file + descriptor, id of the vcpu, and mmap'ed entry. + (vcpu_find, vcpu_alloc, vcpu_register, vcpu_getinfo, + kvm_vcpu_info_free): New functions to access tcb's vcpu_info_list + field and vcpu_info data type. + (is_map_for_file, map_len): New helper functions. + (kvm_ioclt_run_attach_auxstr, kvm_ioctl_decode_run): New functions + decoding vcpu exit reason and attaching the decoded data to auxstr + field of tcb. + (kvm_ioctl_create_vcpu): Call vcpu_register to make an entry mapping + a file descriptor and the vcpu id associated with the fd. + (kvm_ioctl): Call kvm_ioctl_decode_run. + + Co-Authored-by: Dmitry V. Levin + +2018-07-07 Masatake YAMATO + + mmap_cache: add customizable search function. + * mmap_cache.c (mmap_cache_search_custom): New function. + * mmap_cache.h (mmap_cache_search_fn): New type. + (mmap_cache_search_custom): New function prototype. + +2018-07-07 Pierre Marsais + + tests: check verbose decoding of kvm ioctl. + * tests/ioctl_kvm_run-v.c: New file. + * tests/ioctl_kvm_run.c: Include xlat.h and xlat/kvm_cpuid_flags.h. + (print_kvm_segment, print_kvm_sregs, print_kvm_regs): New functions. + (run_kvm): Use them. + (print_cpuid_ioctl) [VERBOSE]: Print verbose ioctl decoding. + * tests/gen_tests.in (ioctl_kvm_run-v): New entry. + * tests/pure_executables.list: Add ioctl_kvm_run-v. + * tests/.gitignore: Likewise. + + tests: check decoding of kvm ioctls related to struct kvm_cpuid2. + * tests/ioctl_kvm_run.c [!HAVE_STRUCT_KVM_CPUID2]: Skip the test. + (KVM_MAX_CPUID_ENTRIES): New macro. + (print_cpuid_ioctl): New function. + (main): Add tests for cpuid related ioctl. + +2018-07-07 Pierre Marsais + + kvm: decode the argument of KVM_SET_CPUID2 and KVM_GET_*_CPUID ioctl commands + * configure.ac (AC_CHECK_TYPES): Add struct kvm_cpuid2. + * xlat/kvm_cpuid_flags.in: New file. + * kvm.c [HAVE_STRUCT_KVM_CPUID2]: Include "xlat/kvm_cpuid_flags.h". + [HAVE_STRUCT_KVM_CPUID2] (print_kvm_cpuid_entry, kvm_ioctl_decode_cpuid2): + New functions. + (kvm_ioctl) [HAVE_STRUCT_KVM_CPUID2]: Use kvm_ioctl_decode_cpuid2. + * NEWS: Mention this improvement. + + Co-Authored-by: Dmitry V. Levin + +2018-07-07 Zhibin Li <08826794brmt@gmail.com> + + net: fix a typo in print_tpacket_stats. + +2018-07-03 Dmitry V. Levin + + tests: fix race condition in aio.test. + * tests/aio.c (main): Print aio_key fields before the io_submit syscall + invocation to avoid races with the kernel. + +2018-07-03 Dmitry V. Levin + + ci: robustify network-related operations. + Reduce false positives by wrapping network-related operations into a loop. + + * ci/install-dependencies.sh (retry_if_failed): New function. + Use it to invoke apt-get update, apt-get install, git clone, + add-apt-repository, and pip install. + +2018-06-29 Zhibin Li <08826794brmt@gmail.com> + + .gitignore: ignore linux/linux. + Ignore directory linux/linux created by workaround from commit + v4.23-11-g15003d4. + + * .gitignore: Add /linux/linux. + +2018-06-18 Dmitry V. Levin + + Fix build on systems where libc relies on + Commit v4.23~10 has broken the build with Android's libc because it + relies on the UAPI headers (such as ) to define various + types, rather than copying them into the libc headers (such as ) + like most other Linux C libraries. + + * linux/linux/signal.h: Rename to linux/signal.h.in. + * Makefile.am (strace_SOURCES): Remove linux/linux/signal.h. + (EXTRA_DIST): Add linux/signal.h.in. + (DISTCLEANFILES): Add linux/linux/signal.h. + * configure.ac (AC_CACHE_CHECK): Check whether + can be used along with , install linux/linux/signal.h + workaround if they cannot be used together. + + Reported-by: Elliott Hughes + Closes: https://github.com/strace/strace/issues/72 + +2018-06-18 Eugene Syromyatnikov + + xlat: add AUDIT_INTEGRITY_EVM_XATTR to nl_audit_types. + * xlat/nl_audit_types.in (AUDIT_INTEGRITY_EVM_XATTR): New constant, + introduced by Linux commit v4.18-rc1~100^2~9. + + xlat: add UDP_SEGMENT to sock_udp_options. + * xlat/sock_udp_options.in (UDP_SEGMENT): New constant, introduced by + Linux commit v4.18-rc1~114^2~377^2~8. + +2018-06-17 Dmitry V. Levin + + Remove redundant range initializers in syscallent files. + * linux/aarch64/syscallent.h: Remove redundant range initializers. + * linux/x32/syscallent.h: Likewise. + +2018-06-17 Chen Jingpiao + + x32: move rseq syscall entry to a suitable place. + As rseq syscall is not x32-specific, move it after the previous one + that is not x32-specific. Fix the unused syscall number range. + + * linux/x32/syscallent.h ([334]): Move it after [333]. + ([335 ... 511]): Update the range. + +2018-06-17 Eugene Syromyatnikov + + aio: make iocb array output more strucutred. + * aio.c (print_iocb): Print curly brackets. + (print_iocbp): Do not print curly brackets. + * tests/aio.c: Update expected output. + + aio: print IOCB_CMD_* using xlat. + * xlat/aio_cmds.in: New file. + * aio.c (tprint_lio_opcode): Change array of structs "cmds" to array of + enums "subs", use printxval_indexn_ex for printing cmd, return sub type + using subs array. + + xlat/sock_tcp_options.in: add #value_indexed. + * xlat/sock_tcp_options.in: Add #value_indexed, provide fallback + definitions. + * net.c (print_sockopt_fd_level_name) : Use + printxval_index instead of printxval. + + xlat/sock_tcp_options.in: update. + * xlat/sock_tcp_options.in (TCP_ZEROCOPY_RECEIVE): New constant, + introduced by Linux commit v4.18-rc1~114^2~351^2~1. + (TCP_INQ): New constant, introduced by Linux commit v4.18-rc1~114^2~330. + + xlat/sigtrap_codes.in: add TRAP_UNK. + * xlat/sigtrap_codes.in (TRAP_UNK): New constant, introduced by Linux + commit v4.17-rc1-15-gdb78e6a. + +2018-06-15 Dmitry V. Levin + + Post-release administrivia. + * NEWS: Add a header line for the next release. + * debian/changelog.in: Add a changelog entry for 4.23-1. + * strace.spec.in: Likewise. + +2018-06-14 Dmitry V. Levin + + Prepare for 4.23 release. + * NEWS: Update for 4.23 release. + + Update copyright headers. + Headers updated automatically using maint/update_copyright_years.sh + script. + + tests: add missing copyright headers. + * tests/prctl-spec-inject.test: Add copyright header. + * tests/qualify_personality.sh: Likewise. + + maint: document release procedure. + * maint/README-release: New file. + * maint/gen-release-notes.sh: Likewise. + * maint/gen-release-github.sh: Likewise. + * maint/gen-release-gitlab.sh: Likewise. + + maint: prepend contributor names in tag messages with an asterisk. + * maint/gen-tag-message.sh: Prepend every line of + gen-contributors-list.sh output with an asterisk. + +2018-06-14 Eugene Syromyatnikov + + Update NEWS. + +2018-06-13 Dmitry V. Levin + + Wire up rseq syscall. + This new syscall was introduced by Linux commit v4.17-1308-gd7822b1. + + * linux/dummy.h (sys_rseq): New macro. + * linux/arm/syscallent.h (398): Add rseq entry. + * linux/i386/syscallent.h (386): Likewise. + * linux/powerpc/syscallent.h (387): Likewise. + * linux/powerpc64/syscallent.h (387): Likewise. + * linux/x32/syscallent.h (334): Likewise. + * linux/x86_64/syscallent.h (334): Likewise. + +2018-06-13 Eugene Syromyatnikov + + tests: check decoding of io_pgetevents syscall. + * configure.ac (AC_CHECK_TYPES): Check for struct __aio_sigset + in . + * tests/aio_pgetevents.c: New file. + * tests/.gitignore: Add aio_pgetevents. + * tests/pure_executables.list: Likewise. + * tests/gen_tests.in (aio_pgetevents): New test. + + Co-Authored-by: Dmitry V. Levin + +2018-06-13 Eugene Syromyatnikov + + Implement io_pgetevents syscall decoding. + Introduced by Linux commit v4.17-rc3-7-g7a074e9. + + * print_aio_sigset.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * aio.c (print_io_getevents): Rename from SYS_FUNC(io_getevents), add + has_usig flag, print user sigset on exiting if has_usig is set to true. + (SYS_FUNC(io_getevents), SYS_FUNC(io_pgetevents)): New functions, + wrappers for print_io_getevents. + * linux/32/syscallent.h ([292]): Wire up io_pgetevents. + * linux/64/syscallent.h ([292]): Likewise. + * linux/i386/syscallent.h ([385]): Likewise. + * linux/x32/syscallent.h ([333]): Likewise. + * linux/x86_64/syscallent.h ([333]): Likewise. + * NEWS: Mention this improvement. + + Co-Authored-by: Dmitry V. Levin + +2018-06-13 Dmitry V. Levin + + travis: re-enable testing with the latest mainline kernel headers. + As is out of the game now, the Linux commit + v4.17-rc3-7-g7a074e9 should not cause harm anymore, so let's enable + testing with the latest mainline kernel headers again. + + * .travis.yml (matrix): Do not specify KBRANCH for KHEADERS=torvalds/linux. + +2018-06-13 Dmitry V. Levin + + Workaround incompatibility between and libc headers. + Override with so that those few linux + headers that include could be included along with libc + headers. + + * linux/linux/signal.h: New file. + * Makefile.am (strace_SOURCES): Add it. + +2018-06-13 Eugene Syromyatnikov + + tests: add personality specification syntax checks. + * tests/options-syntax.test: Add personality specification syntax + checks. + + tests: add basic checks for personality designation support. + * tests/qualify_personality.sh: New file. + * tests/qualify_personality_empty.in: Likewise. + * tests/trace_personality_32.in: Likewise. + * tests/trace_personality_64.in: Likewise. + * tests/trace_personality_regex_32.in: Likewise. + * tests/trace_personality_regex_64.in: Likewise. + * tests/trace_personality_regex_x32.in: Likewise. + * tests/trace_personality_x32.in: Likewise. + * tests/Makefile.am (EXTRA_DIST): Add them. + * tests/gen_tests.in (trace_personality_32, trace_personality_64, + trace_personality_x32, trace_personality_regex_32, + trace_personality_regex_64, trace_personality_regex_x32): New tests. + +2018-06-13 Eugene Syromyatnikov + + Add support for personality designation in regex qualifications. + * basic_filters.c (qualify_syscall_regex): Copy syscall name + to a temporary buffer, append the personality designation to it, + and check it against regular expression if the syscall name + hasn't been matched already. + + References: https://github.com/strace/strace/issues/35 + +2018-06-13 Eugene Syromyatnikov + + Add support for personality designation in syscall qualifications. + * syscall.c (personality_designators): New array. + * defs.h (personality_designators): New declaration. + * basic_filters.c (qualify_syscall_separate_personality, + qualify_syscall_number_personality): New functions. + (qualify_syscall_number): Use qualify_syscall_separate_personality for + checking for a personality specification, call + qualify_syscall_number_personality for setting number set for specific + personality. + (qualify_syscall_name_personality): New function. + (qualify_syscall_name): Use qualify_syscall_separate_personality for + checking for a personality specification, call + qualify_syscall_name_personality for setting number set for specific + personality. + * strace.1.in (.SS Filtering): Document it. + * NEWS: Mention it. + + Co-Authored-by: Dmitry V. Levin + Closes: https://github.com/strace/strace/issues/35 + +2018-06-13 Eugene Syromyatnikov + + tests: add basic checks for inject=SET:syscall= expression syntax. + * tests/qual_fault-syscall.test: New test. + * tests/qual_inject-error-signal-syscall.test: Likewise. + * tests/qual_inject-retval-syscall.test: Likewise. + * tests/qual_inject-signal-syscall.test: Likewise. + * tests/Makefile.am (MISC_TESTS): Add them. + * tests/qual_fault-syntax.test: Add checks for inject=SET:syscall= + expression syntax. + * tests/qual_inject-syntax.test: Likewise. + * tests/qual_fault.test: Append $suffix to -e fault arguments, override + $NAME with $name_override if the latter is set. + * tests/qual_inject-error-signal.test: Append $suffix to -e inject + arguments, override $NAME with $name_override if the latter is set. + * tests/qual_inject-retval.test: Likewise. + * tests/qual_inject-signal.test: Likewise. + +2018-06-13 Eugene Syromyatnikov + + Implement injection of syscalls with no side effects as an alternative to -1 + * defs.h (INJECT_F_SYSCALL, INJECT_ACTION_FLAGS, TCB_TAMPERED_NO_FAIL, + syscall_tampered_nofail): New macros. + (inject_data): Add scno field. + * filter_qualify.c (struct inject_personality_data): New type. + (parse_inject_token): Add "pdata" argument, parse "syscall=" option. + (parse_inject_expression): Add "pdata" argument, forward it to + parse_inject_token. + (qualify_inject_common) : New variable array, pass it to + parse_inject_expression, copy it into inject_vec. + * syscall.c (tamper_with_syscall_entering): Inject the specified syscall + if INJECT_F_SYSCALL is set. + (tamper_with_syscall_exiting): Update the check for a failed syscall + injection. + (get_syscall_result): Update get_error invocation. + * strace.1.in: Document new syscall injection expression. + * NEWS: Mention it. + + Co-Authored-by: Dmitry V. Levin + Closes: https://github.com/strace/strace/issues/26 + +2018-06-13 Dmitry V. Levin + + ia64: remove legacy i386 entries from the syscall entry table. + Remove the last piece of IA-32 mode support. Besides being obsolete, + these bogus syscall entries cause problems with syscall name resolution. + + * linux/ia64/syscallent.h [CST > 0]: Remove. + + Complements: v4.21~17 "linux/ia64: remove IA-32 mode support" + +2018-06-11 Eugene Syromyatnikov + + linux: set error flags in arch_set_error on POWER and Alpha. + * alpha/set_error.c (arch_set_error): Set alpha_r3 to 1, update tracee's + REG_A3. + * powerpc/set_error.c (arch_set_error): Set bit 28 in CCR register, + update tracee's PT_CCR. + + Fixes: v4.15~126 "Implement arch specific methods of changing syscall number and error code" + +2018-06-11 Eugene Syromyatnikov + + tests: check decoding of IFLA_LINKINFO netlink attribute. + * tests/nlattr_ifla_linkinfo.c: New file. + * tests/pure_executables.list: Add nlattr_ifla_linkinfo. + * tests/.gitignore: Likewise. + * tests/gen_tests.in (nlattr_ifla_linkinfo): New test. + + Co-Authored-by: Dmitry V. Levin + +2018-06-11 Eugene Syromyatnikov + + tests: add print_quoted_stringn to print string with a size limit. + This is similar to print_quoted_cstring, but not quite the same. + + * tests/print_quoted_string.c (print_quoted_stringn): New function. + * tests/tests.h (print_quoted_stringn): New declaration. + +2018-06-11 Eugene Syromyatnikov + + tests: add fallback_func argument to TEST_NESTED_NLATTR_OBJECT_EX_ + * tests/test_nlattr.h (TEST_NESTED_NLATTR_OBJECT_EX_): Add fallback_func + argument, call it instead of print_quoted_hex. + (TEST_NESTED_NLATTR_OBJECT_EX, TEST_NESTED_NLATTR_OBJECT): Specify + print_quoted_hex as a fallback_func. + * tests/nlattr_ifla_af_spec.c: Specify print_quoted_hex as + a fallback_func in TEST_NESTED_NLATTR_OBJECT_EX_ calls. + + tests/test_nlattr.h: add ability to provide additional nlattr payload. + * tests/test_nlattr.h (print_nlattr): Add add_data argument, print + opening square bracket if add_data is set to true. + (TEST_NLATTR_EX_): Rename from TEST_NLATTR_, add nla_total_len_ + argument, use it for msg_len calculation, print square brackets + if nla_total_len_ is greater than nla_data_len_. + (TEST_NLATTR_): New macro, a wrapper for TEST_NLATTR_EX_. + +2018-06-11 Eugene Syromyatnikov + + rtnl_link: decode struct ifla_bridge_id unconditionally. + Since it is relatively simple. + + * rtnl_link.c (decode_ifla_bridge_id): Provide struct definition for + the id variable. + [!HAVE_STRUCT_IFLA_BRIDGE_ID] (decode_ifla_bridge_id): Decode struct + ifla_bridge_id. + +2018-06-11 Eugene Syromyatnikov + + nlattr: specify size for ethernet protocol. + Otherwise it tries to decode payload of size 1, which makes little + sense. + + * nlattr.c (decode_nla_ether_proto) : Specify size field. + + Fixes: v4.22-321-gfd0cd65 "nlattr: add ethernet protocol decoder" + +2018-06-11 Eugene Syromyatnikov + + rtnl_link: use ARRSZ_PAIR where appropriate. + It reduces code duplication somewhat and allows avoiding errors like + the one fixed in the previous commit. + + * rtnl_link.c (decode_ifla_protinfo, decode_nla_linkinfo_data_bridge, + decode_nla_linkinfo_data_tun, decode_ifla_linkinfo, decode_ifla_port, + decode_ifla_vf_ports, decode_ifla_xdp, + DECL_NETLINK_ROUTE_DECODER(decode_ifinfomsg)): Use ARRSZ_PAIR in + decode_nlattr call arguments. + +2018-06-11 Eugene Syromyatnikov + + rtnl_link: fix incorrect variable names in ARRAY_SIZE arguments. + * rtnl_link.c (decode_nla_linkinfo_data_bridge): Change + rtnl_ifla_info_data_bridge_attrs to ifla_info_data_bridge_nla_decoders + in ARRAY_SIZE call. + (decode_nla_linkinfo_data_tun): Change rtnl_ifla_info_data_tun_attrs + to ifla_info_data_tun_nla_decoders in ARRAY_SIZE call. + + Fixes: v4.22-328-g1e6d5a8 "rtnl_link: implement IFLA_INFO_DATA for bridges" + Fixes: v4.22-329-g4eab3a4 "rtnl_link: implement IFLA_INFO_DATA for tun devices" + +2018-06-11 Eugene Syromyatnikov + + mips: add missing pure flag to syscall entries. + * linux/mips/syscallent-n32.h ([6038], [6100], [6102], [6105], [6106], + [6108], [6109], [6178]): Add pure flag to getpid, getuid, getgid, geteuid, + getegid, getpgid, getpgrp, and gttid syscall descriptors. + * linux/mips/syscallent-n64.h ([5038], [5100], [5102], [5105], [5106], + [5108], [5109], [5178]): Likewise. + * linux/mips/syscallent-o32.h ([4020], [4024], [4047], [4049], [4050], + [4064], [4065], [4222]): Likewise. + + Complements: v4.21~29 "Add pure syscall flag" + +2018-06-11 Eugene Syromyatnikov + + mips: add missing "never fails" flag to getpgrp syscall entries. + * linux/mips/syscallent-n32.h ([6109]): Add NF flag. + * linux/mips/syscallent-n64.h ([5109]): Likewise. + * linux/mips/syscallent-o32.h ([4065]): Likewise. + + Complements: v4.21~46 "Add SYSCALL_NEVER_FAILS flag to getpgrp" + +2018-06-07 Eugene Syromyatnikov + + Update NEWS. + Co-Authored-by: Dmitry V. Levin + + xlat: describe IPV4_DEVCONF_* weirdness. + * xlat/inet_devconf_indices.in: Add a comment about fallback definitions. + +2018-06-07 Dmitry V. Levin + + configure.ac: fix the check for struct tc_sizespec on old kernel headers + * configure.ac (AC_CHECK_TYPES): Include before + to check for struct tc_sizespec on linux kernel + headers without v2.6.29-rc4~77^2~26 fix. + +2018-06-06 Dmitry V. Levin + + travis: use kernel headers from v4.17. + There is too much noise when using unreleased kernel uapi. + + * ci/install-dependencies.sh (clone_repo): Add optional "branch" + argument, pass it to "git clone". + ($KHEADERS): Pass $KBRANCH as branch argument of clone_repo. + * .travis.yml (matrix): Specify KBRANCH=v4.17 for + KHEADERS=torvalds/linux. + +2018-06-06 Eugene Syromyatnikov + + tests: check decoding of IFLA_AF_SPEC netlink attribute. + * configure.ac (AC_CHECK_TYPES): Check for struct ifla_cacheinfo in + + (AC_CHECK_DECLS): Check for IFLA_AF_SPEC in . + * tests/nlattr_ifla_af_spec.c: New file. + * tests/pure_executables.list: Add nlattr_ifla_af_spec. + * tests/.gitignore: Likewise. + * tests/gen_tests.in (nlattr_ifla_af_spec): New test. + +2018-06-06 Eugene Syromyatnikov + + tests: add TEST_NESTED_NLATTR_ARRAY_EX to test_nlattr.h. + An ability to specify custom depth is going to be needed later to check + IFLA_AF_SPEC decoding. + + * configure.ac (AC_CHECK_DECLS): Check for TCA_STAB_DATA in + . + * tests/test_nlattr.h (TEST_NESTED_NLATTR_ARRAY_EX): Rename from + TEST_NESTED_NLATTR_ARRAY, add depth_ argument, perform padding and + output accordingly. + (TEST_NESTED_NLATTR_ARRAY): New macro, a thin wrapper around + TEST_NESTED_NLATTR_ARRAY_EX. + * tests/nlattr_tca_stab.c [!HAVE_DECL_TCA_STAB_DATA] (TCA_STAB_DATA): + New enumeration declaration. + + Co-Authored-by: Dmitry V. Levin + +2018-06-06 Eugene Syromyatnikov + + tests: pass index to print_elem_ callback in TEST_NLATTR_NESTED_ARRAY. + * tests/test_nlattr.h (TEST_NLATTR_NESTED_ARRAY): Pass array index + to the print_elem_ callback. + * tests/nlattr_tca_stab.c (print_uint16): Add index argument. + + tests: move common ifinfomsg boilerplate into a separate header. + * configure.ac (AC_CHECK_DECLS): Check for IFLA_PORT_SELF, IFLA_PROTINFO, and + IFLA_XDP in . + * tests/nlattr_ifla.h: New file. + * tests/Makefile.am (EXTRA_DIST): Add it. + * tests/nlattr_ifla_brport.c [!HAVE_DECL_IFLA_PROTINFO] (IFLA_PROTINFO): + New declaration. + (hdrlen, init_ifinfomsg, print_ifinfomsg): Remove. + (IFLA_ATTR): Define to IFLA_PROTINFO. + Include nlattr_ifla.h. + * tests/nlattr_ifla_port.c [!HAVE_DECL_IFLA_PORT_SELF] (IFLA_PORT_SELF): + New declaration. + (hdrlen, init_ifinfomsg, print_ifinfomsg): Remove. + (IFLA_ATTR): Define to IFLA_PORT_SELF. + Include nlattr_ifla.h. + * tests/nlattr_ifla_xdp.c + * tests/nlattr_ifla_xdp.c [!HAVE_DECL_IFLA_XDP] (IFLA_XDP): New + declaration. + (hdrlen, init_ifinfomsg, print_ifinfomsg): Remove. + (IFLA_ATTR): Define to IFLA_XDP. + Include nlattr_ifla.h. + + rtnl_link: implement IFLA_INFO_DATA for tun devices. + * xlat/rtnl_ifla_info_data_tun_attrs.in: New file. + * xlat/tun_device_types.in: Likewise. + * rtnl_link.c: Include xlat/rtnl_ifla_info_data_tun_attrs.h and + xlat/tun_device_types.h. + (decode_nla_tun_type, decode_nla_linkinfo_data_tun): New functions. + (ifla_info_data_tun_nla_decoders): New decoder dispatcher table. + (decode_nla_linkinfo_data): Use decode_nla_linkinfo_data_tun if kind + is + "tun". + + rtnl_link: implement IFLA_INFO_DATA for bridges. + * xlat/rtnl_ifla_info_data_bridge_attrs.in: New file. + * rtnl_link.c: Include xlat/rtnl_ifla_info_data_bridge_attrs.h. + (ifla_info_data_bridge_nla_decoders): New decoder dispatcher table. + (decode_nla_linkinfo_data_bridge, decode_nla_linkinfo_data): New + functions. + (ifla_linkinfo_nla_decoders) : Use + decode_nla_linkinfo_data as a decoder. + +2018-06-06 Eugene Syromyatnikov + + rtnl_link: implement IFLA_INFO_XSTATS decoding. + So far, only CAN provides it. + + * rtnl_link.c (decode_nla_linkinfo_xstats_can, + decode_nla_linkinfo_xstats): New function. + (ifla_linkinfo_nla_decoders) : Use + decode_nla_linkinfo_xstats as a decoder. + +2018-06-06 Eugene Syromyatnikov + + rtnl_link: add basic IFLA_INFO_* handling. + Dispatch for IFLA_INFO_* attributes should be performed based on the + string provided in a IFLA_INFO_KIND attribute. + + * nlattr.h (struct ifla_linkinfo_ctx): New type definition. + * rtnl_link.c (decode_nla_linkinfo_kind): New function. + (ifla_linkinfo_nla_decoders) : Use + decode_nla_linkinfo_kind as decoder. + (decode_ifla_linkinfo): Add struct ifla_linkinfo_ctx context, pass it to + the decode_nlattr call as opaque data. + +2018-06-06 Eugene Syromyatnikov + + rtnl_link: decode IFLA_AF_SPEC. + * xlat/in6_addr_gen_mode.in: New file. + * xlat/inet6_devconf_indices.in: Likewise. + * xlat/inet6_if_flags.in: Likewise. + * xlat/inet_devconf_indices.in: Likewise. + * xlat/rtnl_ifla_af_spec_inet6_attrs.in: Likewise. + * xlat/rtnl_ifla_af_spec_inet_attrs.in: Likewise. + * xlat/snmp_icmp6_stats.in: Likewise. + * xlat/snmp_ip_stats.in: Likewise. + * rtnl_link.c: Include netinet/in.h, xlat/in6_addr_gen_mode.h, + xlat/inet_devconf_indices.h, xlat/inet6_devconf_indices.h, + xlat/inet6_if_flags.h, xlat/rtnl_ifla_af_spec_inet_attrs.h, + xlat/rtnl_ifla_af_spec_inet6_attrs.h, xlat/snmp_icmp6_stats.h, + and xlat/snmp_ip_stats.h. + (decode_ifla_inet_conf, decode_ifla_inet6_flags, + decode_ifla_inet6_conf, decode_ifla_inet6_stats, + decode_ifla_inet6_cacheinfo, decode_ifla_inet6_icmp6_stats, + decode_ifla_inet6_token, decode_ifla_inet6_agm, decode_ifla_af, + decode_ifla_af_spec): New functions. + (ifla_inet_nla_decoders, ifla_inet6_nla_decoders, + nla_decoder_table_desc): New static constant variables. + (ifinfomsg_nla_decoders) <[IFLA_AF_SPEC]>: Change value from NULL to + decode_ifla_af_spec. + +2018-06-06 Eugene Syromyatnikov + + nlattr: add size check to decode_nla_xval and decode_nla_flags. + If the field size is known, do not print as valid numbers those + attributes that are too short, and ignore extra data. + + This change puts xval/flags printing in line with the reset of attribute + decoders. + + * nlattr.h (struct decode_nla_xlat_opts): Add size field. + * nlattr.c (decode_nla_xval, decode_nla_flags): Check that len is at + least opts->size, limit len to opts->size. + (decode_nla_ip_proto): Specify size of 1. + + Co-Authored-by: Dmitry V. Levin + +2018-06-06 Eugene Syromyatnikov + + nlattr: add UID/GID netlink attribute decoders. + * nlattr.h (DECL_NLA(uid), DECL_NLA(gid)): New declarations. + * nlattr.c (decode_nla_uid, decode_nla_gid): New functions. + + nlattr: add unsigned int decoders that print in hex form. + * nlattr.h (DECL_NLA(x8), DECL_NLA(x16), DECL_NLA(x32), DECL_NLA(x64)): + New declarations. + * nlattr.c (DECODE_NLA_INTEGER(x8, uint8_t, "%#" PRIx8), + DECODE_NLA_INTEGER(x16, uint16_t, "%#" PRIx16), + DECODE_NLA_INTEGER(x32, uint32_t, "%#" PRIx32), + DECODE_NLA_INTEGER(x64, uint64_t, "%#" PRIx64)): New decoders. + + nlattr: add ethernet protocol decoder. + * nlattr.h (DECL_NLA(ether_proto)): New declaration. + * nlattr.c (process_host_order, decode_nla_ether_proto): New functions. + +2018-06-06 Eugene Syromyatnikov + + nlattr: add value processing support for xlat/flags nlattr decoders. + Needed for upcoming decoder of ethernet proto which is stored in the + host order and has to be converted to the network order before printing + as an xval constant. This change also adds ability to provide + prefix/suffix in order to enclose the printed value in something that + describes the performed conversion. + + * nlattr.h (struct decode_nla_xlat_opts): Add prefix, suffix, and + process_fn fields. + * nlattr.c (decode_nla_xval, decode_nla_flags): Handle process_fn, + prefix, snd uffix parameters. + +2018-06-06 Eugene Syromyatnikov + + nlattr: introduce decode_nla_flags. + Similar to decode_nla_xval. + + * nlattr.c (decode_nla_flags): New function. + * nlattr.h: (DECL_NLA(flags)): New declaration. + +2018-06-06 Eugene Syromyatnikov + + nlattr: add ability to pass nla_type to decoder in decode_nlattr. + As of now, it's impossible to introduce a dispatching nlattr decoder + that performs actions based on the type of the message, so let's use + a combination of zero decoder list size and non-zero decoder pointer + for this. + + This is going to be used later in IFLA_AF_SPEC decoding. + + * nlattr.c (decode_nlattr_with_data): Handle zero size and non-NULL + decoders in a special way. + (decode_nlattr): Add an error message about ignoring of opaque_data + argument when zero size and non-NULL decoders are provided. + * nlattr.h (decode_nlattr): Add a comment about the new special case. + +2018-06-06 Dmitry V. Levin + + tests: use STRINGIFY instead of _STR. + Remove _STR which is essentially the same as STRINGIFY but from + the namespace where we should not introduce new identifiers. + + * tests/tests.h (_STR): Remove. + * tests/add_key.c (main): Replace _STR with STRINGIFY. + * tests/keyctl.c (XARG_STR): Likewise. + * tests/request_key.c (main): Likewise. + +2018-06-06 Eugene Syromyatnikov + + tests: check decoding of IFLA_EVENT netlink attribute. + * tests/nlattr_ifinfomsg.c (main): Add a check for IFLA_EVENT attribute + decoding. + +2018-06-05 Dmitry V. Levin + + xlat: handle xlat constants that are not identifiers. + Extend xlat generator to support such input lines as + IPV4_DEVCONF_FORWARDING-1 0 + + This is going to be used later in IFLA_AF_SPEC decoding. + + * xlat/gen.sh (cond_def): If the xlat value is not an identifier name, + extract an identifier name from the beginning of xlat value. + +2018-06-05 Eugene Syromyatnikov + + xlat.c: handle NULL xlat in lookup routines as incremental search. + This is going to be used later in IFLA_AF_SPEC decoding. + + * xlat.c (xlookup): Add static variable pos, store xlat there when it is + non-NULL, use pos for lookup. + (xlat_search, xlat_idx): Add static variables pos and memb_left, store + xlat and nmemb there when xlat is non-NULL, use them for lookup. + (printxvals_ex): Store the last non-NULL xlat in static variable "last". + If the first xlat argument is NULL, use "last" instead. + + Co-Authored-by: Dmitry V. Levin + +2018-06-05 Eugene Syromyatnikov + + xlat.c: cleanup printxvals_ex a bit. + * xlat.c (printxvals_ex): Change "str" variable visibility to the whole + function, jump to va_end instead of duplicating call and return, return + !!str. + + Leverage the fact that inet_protocols xlat is sorted. + * defs.h (inet_protocols): Move up, add description. + (inet_protocols_size): New declaration. + * net.c (inet_protocols_size): New constant variable. + * nlattr.c (decode_nla_ip_proto): Specify xlat_size, set xt to XT_SORTED. + +2018-06-04 Eugene Syromyatnikov + + Print arp_hardware_types as a sorted xlat. + * rtnl_link.c (DECL_NETLINK_ROUTE_DECODER(decode_ifinfomsg)): Use + PRINT_FIELD_XVAL_SORTED_SIZED instead of PRINT_FIELD_XVAL for + arp_hardware_types. + * sock.c (print_ifreq): Likewise. + + Provide a value for arp_hardware_types_size array. + * defs.h (arp_hardware_types_size): New declaration. + * sockaddr.c (arp_hardware_types_size): New variable. + +2018-06-04 Eugene Syromyatnikov + + print_fields.h: introduce PRINT_FIELD_XVAL_SORTED_SIZED. + For those cases when array definition is not readily available + and should be provided separately. + + * print_fields.h (PRINT_FIELD_XVAL_SORTED_SIZED): New macro. + +2018-06-04 Eugene Syromyatnikov + + tests/opipe.test: remove unneeded run_prog call. + There is no need to invoke grep using run_prog. + + * tests/opipe.test: Remove run_prog decoration for the grep invocation. + +2018-06-04 Eugene Syromyatnikov + + tests: check BPF_OBJ_GET_INFO_BY_FD decoding. + * tests/bpf-obj_get_info_by_fd-prog-v.c: New file. + * tests/bpf-obj_get_info_by_fd-prog.c: Likewise. + * tests/bpf-obj_get_info_by_fd-v.c: Likewise. + * tests/bpf-obj_get_info_by_fd.c: Likewise. + * configure.ac (AC_CHECK_HEADERS): Check for struct bpf_insn, + struct bpf_map_info, and struct bpf_prog_info. + * tests/pure_executables.list: Add bpf-obj_get_info_by_fd, + bpf-obj_get_info_by_fd-v, bpf-obj_get_info_by_fd-prog, and + bpf-obj_get_info_by_fd-prog-v. + * tests/.gitignore: Likewise. + * tests/gen_tests.in (bpf-obj_get_info_by_fd, + bpf-obj_get_info_by_fd-v, bpf-obj_get_info_by_fd-prog, + bpf-obj_get_info_by_fd-prog-v): New tests. + + Co-Authored-by: Dmitry V. Levin + +2018-06-04 Dmitry V. Levin + + bpf: enhance BPF_OBJ_GET_INFO_BY_FD decoder further. + * bpf.c (print_ebpf_prog): Remove "decode" argument, all users updated. + (print_bpf_prog_info): Use the minimum of xlated_prog_len values on + entering and exiting syscall as the size of xlated_prog_insns array + to be decoded. Likewise, use the minimum of nr_map_ids values on entering + and exiting syscall as the size of map_ids array to be decoded. + +2018-06-02 Eugene Syromyatnikov + + bpf: enhance BPF_OBJ_GET_INFO_BY_FD decoder. + * bpf.c (print_bpf_map_info): Print only those fields that are + present in the structure, as it has been growing over time. + (print_bpf_prog_info): Likewise. Print map_ids field as an array + of uint32_t instead of uint64_t; print "name" field. + + Co-Authored-by: Dmitry V. Levin + +2018-06-02 Eugene Syromyatnikov + + bpf: move handling of the saved state to BPF_OBJ_GET_INFO_BY_FD decoder. + As it is needed for proper info_len printing on exiting. + + * bpf.c (print_bpf_obj_info_fn): Change return type to void, add "saved" + argument. + (struct obj_get_info_saved): New type definition. + (print_bpf_map_info, print_bpf_prog_info): Change return type to void, + add "saved" argument, do not handle private tcb data allocation and + obtainment. + (print_bpf_obj_info_addr): Change return type to void, add tcb argument, + print the address only on exiting. + (print_bpf_obj_info): Change return type to void, add "saved" argument. + (BEGIN_BPF_CMD_DECODER(BPF_OBJ_GET_INFO_BY_FD)): Handle private data + allocation/saving/restoring, use it for storing/printing info_len field. + + Co-Authored-by: Dmitry V. Levin + +2018-06-02 Eugene Syromyatnikov + + bpf: print log_buf field as a string. + * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Print log_buf field + as a string. + * tests/bpf.c: Update expected output. + + Co-Authored-by: Dmitry V. Levin + +2018-06-02 Eugene Syromyatnikov + + bpf: print xlated_prog_insns only when xlated_prog_len had not been 0. + If xlated_prog_len is zero on entering syscall and non-zero on exiting, + the program itself is not written into xlated_prog_insns. + + * bpf.c (print_ebpf_prog): Add decode argument, print the address only + if decode is false. + (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Specify decode == true argument + to print_ebpf_prog. + (print_bpf_prog_info): Specify saved xlated_prog_len as decode argument + to print_ebpf_prog. + + Co-Authored-by: Dmitry V. Levin + +2018-06-02 Eugene Syromyatnikov + + bpf: move print_big_u64_addr inside print_ebpf_prog. + * bpf.c (print_ebpf_prog): Add static qualifier. Change the type + of "addr" argument from kernel_ulong_t to uint64_t, print it using + print_big_u64_addr. + (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD), print_bpf_prog_info): Do not call + print_big_u64_addr before print_ebpf_prog. + + Co-Authored-by: Dmitry V. Levin + +2018-06-02 Dmitry V. Levin + + bpf_attr.h: add ATTRIBUTE_ALIGNED(8) to all fields of type uint64_t. + Our policy is that all fields of type uint64_t in this header file + must have this attribute. + + This shouldn't cause any contradictions with + unless the latter is buggy. + + By word "buggy" I mean containing such changes as Linux kernel commit + v4.16-rc1~123^2~109^2~5^2~4. + + * bpf_attr.h (struct BPF_MAP_UPDATE_ELEM_struct): Add + ATTRIBUTE_ALIGNED(8) to "flags" field. + (struct bpf_prog_info_struct): Add ATTRIBUTE_ALIGNED(8) to "load_time" + field. + +2018-06-02 Eugene Syromyatnikov + + tests: cast printf arguments to short when %h format qualifier is used. + Reported by clang. + + * tests/mknod.c (main): Cast printf argument for %#03ho format to short. + * tests/mknodat.c (main): Likewise. + * tests/net-sockaddr.c (main): Cast printf argument for %hu format + to short. + * tests/semop.c (main): Likewise. + +2018-06-02 Eugene Syromyatnikov + + xlat/evdev_keycode.in: remove constants with duplicating values. + Those are used for describing input device category and not specific + button. + + Reported by clang. + + * xlat/evdev_keycode.in (BTN_MOUSE, BTN_JOYSTICK, BTN_GAMEPAD, BTN_DIGI, + BTN_WHEEL, BTN_TRIGGER_HAPPY): Remove. + +2018-06-01 Eugene Syromyatnikov + + configure.ac: include before + This is needed for old Linux UAPI headers that do no contain commit + v3.1-rc2~19^2~29. + + * configure.ac: Include before + in AC_CHECK_* invocations. + +2018-06-01 Eugene Syromyatnikov + + configure.ac: check for linux/rtnetlink.h instead of linux/if_link.h for declarations + Historically, type definitions and declarations related to netlink route + interface attributes were in linux/rtnetlink.h, later they were moved + elsewhere (first linux/if.h, then linux/if_link.h) with the inclusion + of the corresponding header file in linux/rtnetlink.h. + + * configure.ac: Use instead of + in checks for interface netlink attributes-related declarations + and definitions. + +2018-06-01 Eugene Syromyatnikov + + m4: move the gawk script from m4/gen_bpf_attr_m4.sh into a separate file + As it turns out, old versions of gawk do not support -e option. + + * m4/gen_bpf_attr_m4.sh: Move the gawk script ... + * m4/gen_bpf_attr_m4.awk: ... here. + +2018-06-01 Eugene Syromyatnikov + + s390: wire up kexec_file_load syscall. + * linux/s390/syscallent.h ([381]): Add kexec_file_load syscall. + * linux/s390/syscallent.h ([381]): Likewise. + +2018-06-01 Zhibin Li <08826794brmt@gmail.com> + + tests: check short read of struct flock/flock64. + * tests/fcntl-common.c (test_flock_einval): Check short read + of struct flock. + (test_flock64_einval): Check short read of struct flock64. + +2018-06-01 Dmitry V. Levin + + tests: extend struct flock/flock64 decoding checks. + * tests/fcntl-common.c (test_flock_einval, test_flock): Create + struct_kernel_flock object using tail_alloc. + (test_flock64_einval): Create struct_kernel_flock64 object using + tail_alloc. + * tests/fcntl64.c (test_flock64_lk64): Likewise. + +2018-06-01 Dmitry V. Levin + + tests: extend F_OFD_* decoding checks. + Check that non-faulty F_OFD_* fcntl operations are decoded properly. + + * tests/fcntl-common.c: Include . + (test_flock64_ofd): New function. + (test_flock64): Invoke it, remove [F_OFD_SETLK]. + +2018-06-01 Dmitry V. Levin + + tests/fcntl-common.c: define and initialize errstr. + Initialize errstr inside invoke_test_syscall so that its users + won't have to go into trouble of caring about clobbering errno. + + * tests/fcntl-common.c (errstr): New variable. + (invoke_test_syscall): Initialize it. + (test_flock_einval, test_flock64_einval, test_flock, + test_f_owner_ex_type_pid): Use it. + * tests/fcntl.c (test_flock64_undecoded): Likewise. + * tests/fcntl64.c (test_flock64_lk64): Likewise. + +2018-06-01 Dmitry V. Levin + + tests/fcntl-common.c: add fd argument to invoke_test_syscall. + Extend invoke_test_syscall for later use with different file + descriptors. + + * tests/fcntl-common.c (invoke_test_syscall): Add fd argument, pass it + to TEST_SYSCALL_NR syscall. All users updated. + +2018-06-01 Dmitry V. Levin + + tests: move F_OFD_SETLK* checks from fcntl64.c to fcntl-common.c. + This change enables F_OFD_SETLK* tests for fcntl as well. + + * tests/fcntl64.c (test_flock64): Rename to test_flock64_lk64. + [F_OFD_SETLK]: Remove. + (test_flock64_einval): Move ... + * tests/fcntl-common.c: ... here. + (test_flock64_lk64): New protype. + (test_flock64_einval, test_flock64): New functions. + * tests/fcntl.c (test_flock64_einval): Rename to test_flock64_undecoded. + (TEST_FLOCK64_UNDECODED): New macro. + (test_flock64): Rename to test_flock64_lk64, replace TEST_FLOCK64_EINVAL + with TEST_FLOCK64_UNDECODED. + +2018-06-01 Dmitry V. Levin + + tests: move F_OWNER_* tests to fcntl-common.c. + This change enables F_OWNER_* tests for fcntl64 as well. + + * tests/fcntl.c: Move main, [TEST_FLOCK64_EINVAL], + and [TEST_F_OWNER_EX] ... + * tests/fcntl-common.c: ... here. + (test_flock64): New prototype. + * tests/fcntl64.c (main): Remove. + +2018-06-01 Dmitry V. Levin + + tests: rename struct_flock.c to fcntl-common.c. + It is not limited to struct flock, more fcntl tests are going to land + in this file. + + * tests/struct_flock.c: Rename to fcntl-common.c. + * tests/Makefile.am (EXTRA_DIST): Rename struct_flock.c + to fcntl-common.c. + * tests/fcntl.c: Likewise. + * tests/fcntl64.c: Likewise. + +2018-05-30 Eugene Syromyatnikov + + tests: check decoding of new FRA_* netlink attributes. + * configure.ac (AC_CHECK_TYPES): Check for struct fib_rule_port_range + in . + * tests/nlattr_fib_rule_hdr.c: Include . + (FRA_PROTOCOL, FRA_IP_PROTO, FRA_SPORT_RANGE, FRA_DPORT_RANGE): New + macro constants. + [!HAVE_STRUCT_FIB_RULE_PORT_RANGE] (struct fib_rule_port_range): New + type. + (main): Check decoding of new FRA_* netlink attributes. + + Co-Authored-by: Dmitry V. Levin + +2018-05-30 Eugene Syromyatnikov + + rtnl_rule: decode new FRA_* attributes. + * nlattr.h (DECL_NLA(ip_proto), DECL_NLA(rt_proto)): New declarations. + * nlattr.c (decode_nla_ip_proto): New function. + * rtnl_route.c (decode_nla_rt_proto): Likewise. + * rtnl_rule.c (decode_rule_port_rang): Likewise. + (fib_rule_hdr_nla_decoders) <[FRA_PROTOCOL]>: New attribute, introduced + by Linux commit v4.17-rc1~148^2~371. + (fib_rule_hdr_nla_decoders) <[FRA_IP_PROTO], [FRA_SPORT_RANGE], + [FRA_DPORT_RANGE]>: New attributes, introduced by Linux commit + v4.17-rc1~148^2~328^2~4. + * xlat/rtnl_rule_attrs.in (FRA_PROTOCOL, FRA_IP_PROTO, FRA_SPORT_RANGE, + FRA_DPORT_RANGE): New constants. + + Co-Authored-by: Dmitry V. Levin + +2018-05-30 Eugene Syromyatnikov + + nlattr: introduce decode_nla_xval helper. + * nlattr.c (decode_nla_xval): New function. + * nlattr.h: Include "xlat.h". + (struct decode_nla_xlat_opts): New type. + (DECL_NLA(xval)): New declaration. + + Co-Authored-by: Dmitry V. Levin + +2018-05-30 Dmitry V. Levin + + Move definitions of xlat_type and xlat_style from defs.h to xlat.h. + * defs.h (enum xlat_type, enum xlat_style, XLAT_STYLE_FORMAT_SHIFT, + XLAT_STYLE_VERBOSITY_MASK, XLAT_STYLE_FORMAT_MASK, XLAT_STYLE_SPEC_BITS, + XLAT_STYLE_MASK): Move ... + * xlat.h: ... here. + + travis: switch from gcc-7 to gcc-8. + * .travis.yml (matrix): Change gcc-7 to gcc-8. + +2018-05-30 Eugene Syromyatnikov + + tests: use syscall() for ioctl() calls with oversized arguments. + * tests/ioctl_inotify.c (sys_ioctl): New function. + (main): Use sys_ioctl for ioctl calls with oversized arguments. + * tests/ioctl_loop.c: Likewise. + * tests/ioctl_perf.c: Likewise. + +2018-05-30 Eugene Syromyatnikov + + print_ifindex: respect xlat style settings. + Print interface indices according to the preferred xlat style settings. + + * print_ifindex.c (INI_PFX, INI_SFX): New helper macros. + [HAVE_IF_INDEXTONAME] (get_ifname): New function. + [HAVE_IF_INDEXTONAME] (print_ifindex): Implement as a wrapper around + get_ifname and print_xlat_ex. + +2018-05-30 Eugene Syromyatnikov + + tests/test_nlattr.h: fix pointer calculation in TEST_NLATTR_ARRAY, take 2 + The old code works only when an array contains exactly two items. + + * tests/test_nlattr.h (TEST_NLATTR_ARRAY): Fix pointer address + for the case of incomplete read. + +2018-05-30 Eugene Syromyatnikov + + nlattr: print index names in netlink meminfo array. + * xlat/netlink_sk_meminfo_indices.in: New file. + * nlattr.c: Include xlat/netlink_sk_meminfo_indices.h. + (decode_nla_meminfo): Use print_array_ex, pass + netlink_sk_meminfo_indices as index xlat table. + * tests/nlattr_inet_diag_msg.c: Update expected output. + +2018-05-30 Eugene Syromyatnikov + + Introduce ARRSZ_PAIR macro. + A shorthand similar to ARG_STR in its purpose: it provides and ability + to pass an array an its size without variable name duplication. + + * macros.h (ARRSZ_PAIR): New macro. + +2018-05-30 Eugene Syromyatnikov + + print_array: add support for printing array indices. + * defs.h (XLAT_STYLE_SPEC_BITS, XLAT_STYLE_MASK): New macro constants. + (tfetch_mem_fn, print_fn): New typedefs. + (enum print_array_flag_bits, enum print_array_flags): New enumerations. + (print_array_ex): Rename from print_array, add flags, index_xlat, + index_xlat_size, and index_dflt arguments. + (print_array): New static inline function, a thin wrapper around + print_array_ex. + util.c: Include "xlat.h". + (print_array): Rename to print_array_ex, add flags, index_xlat, + index_xlat_size, and index_dflt arguments. Print array indices + according to the style settings specified by flags if PAF_PRINT_INDICES + is set. + +2018-05-29 Dmitry V. Levin + + Enhance printing of unfetchable object addresses in sequences and arrays + * btrfs.c (btrfs_print_tree_search): Print the address of unfetchable + object inside the sequence using printaddr_comment. + * msghdr.c (decode_msg_control): Likewise. + * execve.c (printargv): Print the address of unfetchable object inside + the array using printaddr_comment. + * netlink.c (fetch_nlmsghdr): Add in_array argument. When in_array + is true, print the address of unfetchable object using + printaddr_comment. + * nlattr.c (fetch_nlattr): Likewise. + * tests/execve.c (main): Update expected output. + * tests/execveat.c (main): Likewise. + * tests/msg_control.c (test_scm_rights1, test_scm_rights2, + test_scm_security): Likewise. + * tests/netlink_protocol.c (send_query): Likewise. + * tests/nlattr.c (test_nlattr): Likewise. + +2018-05-29 Dmitry V. Levin + + print_array: enhance printing of unfetchable object addresses. + When umoven_func invocation fails to fetch data, it prints the faulty + address. If this happens to a subsequent umoven_func invocation, + the printed address may be undistinguishable from a valid data printed + by print_func, e.g. when the data is printed in a numeric form like + [0x1, 0x2, 0x3, 0xdefaced]. + + Fix this source of confusion by moving the printing of the faulty + address from umoven_func to print_array itself. This change renames + umoven_func to tfetch_mem_func and changes its semantics, so that + - tfetch_mem_func never prints anything; + - tfetch_mem_func returns true if the fetch succeeded, + and false otherwise. + + * defs.h (print_array): Replace umoven_func argument with + tfetch_mem_func. + * util.c (print_array): Replace umoven_func argument with + tfetch_mem_func, document expected tfetch_mem_func return value + semantics. When tfetch_mem_func returns false, print either addr + or "... /* addr */" depending on the context (inside the array or not). + * bpf.c (print_ebpf_prog, print_bpf_prog_info, + BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)): Replace umoven_or_printaddr + argument of print_array with tfetch_mem. + * bpf_filter.c (print_bpf_fprog): Likewise. + * btrfs.c (btrfs_print_logical_ino_container, + btrfs_print_ino_path_container, btrfs_print_qgroup_inherit, + btrfs_ioctl): Likewise. + * dm.c (dm_decode_dm_target_deps): Likewise. + * epoll.c (epoll_wait_common): Likewise. + * file_ioctl.c (file_ioctl): Likewise. + * ipc_sem.c (tprint_sembuf_array): Likewise. + * kexec.c (print_kexec_segments): Likewise. + * mem.c (SYS_FUNC(subpage_prot)): Likewise. + * net.c (print_getsockopt): Likewise. + * netlink.c (decode_nlmsgerr_attr_cookie): Likewise. + * netlink_netlink_diag.c (decode_netlink_diag_groups): Likewise. + * netlink_packet_diag.c (decode_packet_diag_mclist): Likewise. + * netlink_unix_diag.c (decode_unix_diag_inode): Likewise. + * nlattr.c (decode_nla_meminfo): Likewise. + * numa.c (print_nodemask, SYS_FUNC(move_pages), + * perf_ioctl.c (perf_ioctl_query_bpf): Likewise. + * poll.c (decode_poll_entering): Likewise. + * printsiginfo.c (print_siginfo_array): Likewise. + * rtnl_tc.c (decode_tca_stab_data): Likewise. + * sock.c (decode_ifconf): Likewise. + * uid.c (print_groups): Likewise. + * io.c (SYS_FUNC(io_submit), SYS_FUNC(io_getevents)): Replace + umoven_or_printaddr argument of print_array with tfetch_mem. + (tprint_iov_upto): Replace umoven_or_printaddr_ignore_syserror + with tfetch_mem_ignore_syserror. + * v4l2.c (print_v4l2_format_fmt): Replace umoven_or_printaddr argument + of print_array with tfetch_mem. + (print_v4l2_ext_controls): Replace umoven_or_printaddr_ignore_syserror + with tfetch_mem_ignore_syserror. + * mmsghdr.c (fetch_struct_mmsghdr_or_printaddr): Rename + to fetch_struct_mmsghdr_for_print, do not print address, return bool. + (decode_mmsgvec): Replace fetch_struct_mmsghdr_or_printaddr + with fetch_struct_mmsghdr_for_print. + * tests/aio.c (main): Update expected output. + * tests/bpf.c (print_BPF_PROG_QUERY_attr5): Likewise. + * tests/ioctl_perf-success.c (main): Likewise. + * tests/ioctl_v4l2.c (main): Update expected output. + * tests/kexec_load.c (main): Likewise. + * tests/mmsg_name.c (test_mmsg_name): Update expected output. + * tests/move_pages.c (print_page_array, print_node_array): Likewise. + * tests/poll.c (print_pollfd_array_entering): Likewise. + * tests/preadv-pwritev.c (main): Likewise. + * tests/preadv2-pwritev2.c (dumpio): Likewise. + * tests/process_vm_readv_writev.c (print_iov): Likewise. + * tests/pwritev.c (print_iovec): Likewise. + * tests/readv.c (main): Likewise. + * tests/seccomp-filter-v.c + * tests/semop.c (main): Likewise. + * tests/set_mempolicy.c (print_nodes): Likewise. + * tests/setgroups.c (main): Likewise. + * tests/test_nlattr.h (print_nlattr) Likewise. + + Co-Authored-by: Eugene Syromyatnikov + +2018-05-29 Dmitry V. Levin + + Introduce tfetch_* family of functions and macros. + These new functions are going to be used instead of umove_or_printaddr* + as umoven_func argument of print_array. + + * defs.h (tfetch_mem64, tfetch_mem64_ignore_syserror): New + function prototypes. + (tfetch_mem, tfetch_mem_ignore_syserror): New static inline + wrappers. + (tfetch_obj): New macro wrapper around tfetch_mem. + * util.c (tfetch_mem64, tfetch_mem64_ignore_syserror): New + functions. + (umoven_or_printaddr64, umoven_or_printaddr64_ignore_syserror): Use + them. + +2018-05-29 Dmitry V. Levin + + Introduce printaddr_comment. + * defs.h (printaddr_comment): New static inline wrapper around + tprintf_comment. + + Turn printaddr into a thin wrapper around printaddr64. + * util.c (printaddr): Move ... + * defs.h: ... here, add "static inline" qualifiers. + +2018-05-29 Eugene Syromyatnikov + + defs.h: add comments about umove* return values. + * defs.h (umoven, umoven_or_printaddr64, + umoven_or_printaddr64_ignore_syserror, umovestr): Add comments about + return values. + +2018-05-28 Dmitry V. Levin + + tests: use TAIL_ALLOC_OBJECT_CONST_PTR where appropriate. + * tests/kcmp.c (main): Use TAIL_ALLOC_OBJECT_CONST_PTR. + * tests/modify_ldt.c (main): Likewise. + * tests/netlink_protocol.c (send_query): Likewise. + * tests/ptrace.c (test_peeksiginfo, main): Likewise. + * tests/s390_guarded_storage.c (main): Likewise. + * tests/s390_sthyi.c (main): Likewise. + * tests/xet_thread_area_x86.c (main): Likewise. + +2018-05-28 Eugene Syromyatnikov + + bpf: decode bpf_attr.info field used by BPF_OBJ_GET_INFO_BY_FD command. + * bpf_attr.h [!BPF_TAG_SIZE] (BPF_TAG_SIZE): Define. + [BPF_TAG_SIZE]: Check that BPF_TAG_SIZE is 8. + (struct bpf_map_info_struct, struct bpf_prog_info_struct): New + structures. + (bpf_map_info_struct_size, expected_bpf_map_info_struct_size, + bpf_prog_info_struct_size, expected_bpf_prog_info_struct_size): New + macro constants. + * bpf.c (print_bpf_obj_info_fn): New type. + (print_bpf_map_info, print_bpf_prog_info, fetch_bpf_obj_info, + print_bpf_obj_info_addr, print_bpf_obj_info): New functions. + (BEGIN_BPF_CMD_DECODER(BPF_OBJ_GET_INFO_BY_FD)): Print bpf_fd and info_len + fields only on entering, call print_bpf_obj_info for printing info field. + * tests/bpf.c (BPF_OBJ_GET_INFO_BY_FD_checks): Print info field + as a pointer. + + Co-Authored-by: Dmitry V. Levin + +2018-05-28 Eugene Syromyatnikov + + bpf: add support for checking structures outside union bpf_attr. + struct bpf_prog_info and bpf_map_info need essentially the same handling + as union bpf_attr. + + * gen_bpf_attr_check.sh: Derive type_name from $struct if it doesn't + start with "BPF_", derive TYPE_NAME from type_name, use them in code + generation. + * m4/gen_bpf_attr_m4.sh: Rewrite parsing/generation code into awk, + add support for structures outside union bpf_attr. + + Co-Authored-by: Dmitry V. Levin + +2018-05-28 Dmitry V. Levin + + bpf: remove bpf_priv_data. + As various bpf commands need different data to save between entering + and exiting of the syscall, do not emulate union bpf_attr approach. + + * bpf.c (struct bpf_priv_data): Remove. + (DECL_BPF_CMD_DECODER): Remove "struct bpf_priv_data *" argument. + (BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)): Use set_tcb_priv_ulong + and get_tcb_priv_ulong to keep bpf_attr.query.prog_cnt field. + (SYS_FUNC(bpf)): Remove priv variable, do not initialize it, + and do not pass it to bpf_cmd_decoders. + +2018-05-28 Eugene Syromyatnikov + + tests: add union bpf_attr.query.prog_ids field decoding checks. + * tests/bpf-success-v.c: New file. + * tests/bpf-success.c: Likewise. + * tests/bpf-success-v.test: New test. + * tests/bpf-success.test: Likewise. + * tests/.gitignore: Add bpf-success and bpf-success-v. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add bpf-success.test and bpf-success-v.test. + * tests/bpf.c [INJECT_RETVAL] (sys_bpf): Check that retuned value + is equivalent to the injected one; append "(INJECTED)" string to errstr. + (prog_load_ids, prog_load_ids_ptr): New variables. + (init_BPF_PROG_QUERY_attr4, print_BPF_PROG_QUERY_attr4, + init_BPF_PROG_QUERY_attr5, print_BPF_PROG_QUERY_attr5): New functions. + (BPF_PROG_QUERY_checks): Drop "const" qualifier, add new checks. + + bpf: BPF_PROG_QUERY bpf_attr.query.prog_ids printing fixes. + * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)): Use + print_uint32_array_member instead of print_uint64_array_member for + printing prog_ids elements (and change the type of prog_id_buf from + uint64_t to uint32_t), as they are 32-bit; use common trick with + print_big_u64_addr for handling possible ambiguity with prog_ids + address. + * tests/bpf.c (BIG_ADDR_MAYBE): New macro. + (BPF_PROG_QUERY_checks): Update expected output. + + bpf: add support for instruction decoding. + * xlat/ebpf_regs.in: New file. + * bpf.c (struct ebpf_insn, struct ebpf_insns_data): New type definitions. + (print_ebpf_insn, print_ebpf_prog): New functions. + (DEF_BPF_CMD_DECODER(BPF_PROG_LOAD)): Use them. + +2018-05-28 Eugene Syromyatnikov + + tests: check decoding of successful PERF_EVENT_IOC_{ID,QUERY_BPF} ioctls + As these have some argument output on the exit path. + + * tests/ioctl_perf-success.c: New file. + * tests/ioctl_perf-success.test: New test. + * tests/Makefile.am (DECODER_TESTS): Add it. + (check_PROGRAMS): Add ioctl_perf-success. + * tests/.gitignore: Likewise. + * tests/ioctl_perf.c: Remove TODO. + + Co-Authored-by: Dmitry V. Levin + +2018-05-28 Eugene Syromyatnikov + + Implement PERF_EVENT_IOC_* decoding. + * perf.c (fetch_perf_event_attr, print_perf_event_attr): Remove "static" + qualifier. + * defs.h (fetch_perf_event_attr, print_perf_event_attr): New + declarations. + * perf_event_struct.h (struct perf_event_query_bpf): New type + definition. + * perf_ioctl.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * xlat/perf_ioctl_cmds.in: New file. + * xlat/perf_ioctl_flags.in: Likewise. + * ioctl.c (ioctl_decode) : Call perf_ioctl. + * tests/gen_tests.in (ioctl_perf): New test. + * tests/ioctl_perf.c: New file. + * tests/pure_executables.list: ioctl_perf. + * tests/.gitignore: Likewise. + + Co-Authored-by: Dmitry V. Levin + +2018-05-28 Dmitry V. Levin + + tests: fix ipc_msgbuf.test. + * tests/ipc_msgbuf.test: Fix -a argument. + +2018-05-25 Eugene Syromyatnikov + + xlat: update IPPROTO_* constants. + * xlat/inet_protocols.in (IPPROTO_GGP, IPPROTO_HELLO, IPPROTO_ND): + Remove, not defined in Linux. + (IPPROTO_BEETPH): New constant, introduced by Linux commit + v2.6.19-rc1~33^2. + (IPPROTO_L2TP): New constant, introduced by Linux commit + v2.6.35-rc1~473^2~594. + (IPPROTO_MH): New constant, introduced by Linux commit + v2.6.19-rc1~1272^2~157. + Add default values to constants, sort the file. + + xlat: add fallback definitions to RTPROT_* constants. + * xlat/routing_protocols.in: Add default values to constants. + + xlat: add SECCOMP_FILTER_FLAG_SPEC_ALLOW. + * xlat/seccomp_filter_flags.in (SECCOMP_FILTER_FLAG_SPEC_ALLOW): New + constant, introduced by Linux commit v4.17-rc3-24-g00a02d0. + * tests/seccomp-filter.c: Update expected output. + * tests/seccomp-filter-v.c: Likewise. + + prctl: add PR_GET_SPECULATION_CTRL/PR_SET_SPECULATION_CTRL decoding. + * xlat/pr_spec_cmds.in: New fille. + * xlat/pr_spec_get_store_bypass_flags.in: Likewise. + * xlat/pr_spec_set_store_bypass_flags.in: Likewise. + * xlat/prctl_options.in (PR_GET_SPECULATION_CTRL, + PR_SET_SPECULATION_CTRL): New constants, introduced by Linux commit + v4.17-rc3-15-gb617cfc. + * prctl.c (SYS_FUNC(prctl)) : Implement decoding of new prctl options. + * tests/Makefile.am (check_PROGRAMS): Add prctl-spec-inject. + (DECODER_TESTS): Add prctl-spec-inject.test. + * tests/prctl-spec-inject.c: New file. + * tests/prctl-spec-inject.test: New test. + * tests/.gitignore: Add prctl-spec-inject. + + tests: add keyctl variants with different xlat verbosity levels. + * tests/keyctl-Xabbrev.c: New file. + * tests/keyctl-Xraw.c: Likewise. + * tests/keyctl-Xverbose.c: Likewise. + * tests/keyctl.c (XARG_STR): New macro. + (do_keyctl): Print command in accordance with XLAT_RAW/XLAT_VERBOSE settings. + (main): Update expected output. + * tests/pure_executables.list: Add keyctl-Xabbrev, keyctl-Xraw, + and keyctl-Xverbose. + * tests/.gitignore: Likewise. + * tests/gen_tests.in (keyctl-Xabbrev, keyctl-Xraw, keyctl-Xverbose): New + tests. + + keyctl: print KEYCTL_SET_REQKEY_KEYRING argument as an integer. + * xlat/key_reqkeys.in: Add #val_type int. + * keyctl.c (SYS_FUNC(keyctl)) : Print + arg2 as an integer. + * tests/keyctl.c: Update expected output. + + keyctl: respect xlat style when printing errno. + * keyctl.c (keyctl_reject_key): Use print_xlat_ex for printing error + argument. + +2018-05-25 Eugene Syromyatnikov + + syscall.c: unify error value printing. + There's little reason not to decode error code for syscalls printed in + raw; moreover, it creates inconsistencies for unknown syscall printing. + + Another issue was with error numbers unknown to strace: previously, they + were printed as "... = -1 1234 (Unknown error 1234)" which looked kinda + weird. + + * syscall.c (print_err_ret): New function. + (syscall_exiting_trace): Remove u_error variable, use tcp->u_error + instead. Remove u_error_str variable. + (syscall_exiting_trace) : Call print_err_ret if u_error + is non-zero. + (syscall_exiting_trace) u_error)>: + Use print_err_ret for default error printing. + * tests/nsyscalls.c [!LINUX_MIPSO32] (test_syscall): Update expected + output. + * tests/qual_fault.c (invoke) : Likewise. + * strace.1.in (.SH DESCIPTION): Update unknown syscall example. + +2018-05-25 Eugene Syromyatnikov + + ioctl: implement INOTIFY_IOC_SETNEXTWD decoding. + * inotify_ioctl.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * defs.h (DECL_IOCTL(inotify)): New declaration. + * ioctl.c (ioctl_decode) : Call inotify_ioctl. + * tests/ioctl_inotify.c: New file. + * tests/.gitignore: Add ioctl_inotify. + * tests/pure_executables.list: Likewise. + * tests/gen_tests.in (ioctl_inotify): New test. + + tests/test_nlattr.h: avoid testing cropped objects of size 1. + * tests/test_nlattr.h (TEST_NLATTR_OBJECT_EX_): Check + "len < sizeof(obj_)" case only if "sizeof(obj_) > 1". + + tests: pass index to print_elem_ callback in TEST_NLATTR_ARRAY. + * tests/test_nlattr.h (TEST_NLATTR_ARRAY): Pass array index to the + print_elem_ callback. + * tests/nlattr_inet_diag_msg.c (print_uint): Add index argument. + * tests/nlattr_netlink_diag_msg.c (print_xlong): Likewise. + * tests/nlattr_packet_diag_msg.c (print_packet_diag_mclist, + print_sock_filter): Likewise. + * tests/nlattr_unix_diag_msg.c (print_uint): Likewise. + +2018-05-24 Dmitry V. Levin + + tests: further cleanup bpf big address checks. + Replace BIG_ADDR_IS_64BIT and BIG_ADDR_IS_32BIT with BIG_ADDR(). + + * tests/bpf.c (BIG_ADDR): New macro. + (BIG_ADDR_IS_64BIT, BIG_ADDR_IS_32BIT): Remove. + (BPF_PROG_LOAD_checks, BPF_OBJ_PIN_checks, + BPF_RAW_TRACEPOINT_OPEN_checks): Use BIG_ADDR() instead of + BIG_ADDR_IS_64BIT and BIG_ADDR_IS_32BIT. + +2018-05-23 Dmitry V. Levin + + tests: cleanup bpf big address checks. + Introduce BIG_ADDR_IS_64BIT and BIG_ADDR_IS_32BIT to reduce redundancy. + + * tests/bpf.c (BIG_ADDR_IS_64BIT, BIG_ADDR_IS_32BIT): New macros. + (BPF_PROG_LOAD_checks, BPF_OBJ_PIN_checks, + BPF_RAW_TRACEPOINT_OPEN_checks): Use them. + +2018-05-23 Eugene Syromyatnikov + + bpf: add support for BPF_RAW_TRACEPOINT_OPEN command decoding. + * bpf_attr.h (struct BPF_RAW_TRACEPOINT_OPEN_struct): New type + definition. + (BPF_RAW_TRACEPOINT_OPEN_struct_size, + expected_BPF_RAW_TRACEPOINT_OPEN_struct_size): New macros. + * xlat/bpf_commands.in (BPF_RAW_TRACEPOINT_OPEN): New constant, + introduced by Linux commit v4.17-rc1~148^2~19^2~4^2~3. + * xlat/bpf_prog_types.in (BPF_PROG_TYPE_RAW_TRACEPOINT): Likewise. + * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_RAW_TRACEPOINT_OPEN)): New bpf + command decoder. + (SYS_FUNC(bpf)) : Add + BPF_CMD_ENTRY(BPF_RAW_TRACEPOINT_OPEN). + * tests/bpf.c (union bpf_attr_data): Add + BPF_ATTR_DATA_FIELD(BPF_RAW_TRACEPOINT_OPEN). + (BPF_PROG_LOAD_checks): Update. + (init_BPF_RAW_TRACEPOINT_attr2): New function. + (BPF_RAW_TRACEPOINT_OPEN_checks): New checks array. + (main) : Add CHK(BPF_RAW_TRACEPOINT_OPEN). + + bpf: add support for decoding struct bpf_attr.expected_attach_type field + * bpf_attr.h (struct BPF_PROG_LOAD_struct): Add expected_attach_type + field. + (BPF_PROG_LOAD_struct_size): Update to offsetofend of + expected_attach_type field. + (expected_BPF_PROG_LOAD_struct_size): Update to 72. + * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Decode + expected_attach_type field. + * tests/bpf.c: Update expected output. + +2018-05-23 Eugene Syromyatnikov + + nlattr: do not assume that SK_MEMINFO_VARS is constant. + SK_MEMINFO_VARS changes over time (as it was in Linux commit + v4.7-rc1~154^2~354^2~4, for example), so we cannot use it + for sanity checks. + + * nlattr.c (print_meminfo): Remove. + (decode_nla_meminfo): Use generic print_uint32_array_member element + printer callback. + * tests/nlattr_inet_diag_msg.c (main): Update expected output. + +2018-05-23 Eugene Syromyatnikov + + Introduce print_uint32_array_member helper function. + Analogous to print_int32_array_member, this helper is going to be used + in various decoders, including BPF_PROG_QUERY, PERF_EVENT_IOC_*, + and netlink meminfo. + + * defs.h (print_uint32_array_member): New declaration. + * util.c (print_uint32_array_member): New function. + +2018-05-23 Eugene Syromyatnikov + + Introduce print_int32_array_member helper function. + Analogous to print_uint64_array_member, this helper is going to be used + for IFLA_AF_SPEC decoding. + + * defs.h (print_int32_array_member): New declaration. + * util.c (print_int32_array_member): New function. + +2018-05-23 Eugene Syromyatnikov + + defs.h: move print_uint64_array_member and print_array declarations down + In preparation for the forthcoming changes. + +2018-05-23 Eugene Syromyatnikov + + tests/test_nlattr.h: fix pointer calculation in TEST_NLATTR_ARRAY. + The old code works only when an array contains exactly two items. + + * tests/test_nlattr.h (TEST_NLATTR_ARRAY): Fix pointer address + for the case of incomplete read. + +2018-05-23 Eugene Syromyatnikov + + sockaddr: add support for sockaddr_l2 without l2_bdaddr_type. + Apparently, struct sockaddr_l2 changed over time: the l2_bdaddr_type + field was added only by commit v3.5-rc1~35^2~3^2~18^2^2~39. + + * configure.ac (AC_CHECK_HEADERS): Move bluetooth/bluetooth.h check into + a separate check. + (AC_CHECK_HEADERS([bluetooth/bluetooth.h])): New check, also checks for + struct sockaddr_l2.l2_bdaddr_type member in case of success. + * sockaddr.c (print_sockaddr_data_bt) : Add to sizeof(struct sockaddr_l2) case. Print + l2_bdaddr_type field only if the provided sockaddr is big enough. + * tests/net-sockaddr.c (check_l2): Put l2_bdaddr_type usage/printing + under HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE ifdef, add a check for the + sockaddr_l2 structure without the l2_bdaddr_type field. + +2018-05-23 Eugene Syromyatnikov + + sock: guess ifr_hwaddr size in SIOCSIFHWADDR/SIOCGIFHWADDR. + And make the output more structured. + + * sock.c: Include xlat/arp_hardware_types.h in XLAT_MACROS_ONLY mode. + (print_ifreq) : Introduce + hwaddr_sizes array, print ifr_hwaddr.sa_family, print ifr_hwaddr.sa_data + using hwaddr_sizes and PRINT_FIELD_MAC_SZ. + +2018-05-22 Dmitry V. Levin + + Simplify errnoent and signalent. + Remove personality support for errnoent and signalent as + there is nothing personality-specific in these files. + + * linux/aarch64/errnoent1.h: Remove. + * linux/aarch64/signalent1.h: Likewise. + * linux/powerpc64/errnoent1.h: Likewise. + * linux/powerpc64/signalent1.h: Likewise. + * linux/riscv/errnoent1.h: Likewise. + * linux/riscv/signalent1.h: Likewise. + * linux/s390x/errnoent1.h: Likewise. + * linux/s390x/signalent1.h: Likewise. + * linux/sparc64/errnoent1.h: Likewise. + * linux/sparc64/signalent1.h: Likewise. + * linux/tile/errnoent1.h: Likewise. + * linux/tile/signalent1.h: Likewise. + * linux/x32/errnoent1.h: Likewise. + * linux/x32/signalent1.h: Likewise. + * linux/x86_64/errnoent1.h: Likewise. + * linux/x86_64/errnoent2.h: Likewise. + * linux/x86_64/signalent1.h: Likewise. + * linux/x86_64/signalent2.h: Likewise. + * Makefile.am (EXTRA_DIST): Remove them. + * defs.h (errnoent0): Rename to errnoent. + (signalent0): Rename signalent. + (nerrnos, nsignals): Change to const variables unconditionally. + * syscall.c (errnoent0): Rename to errnoent. + (signalent0): Rename signalent. + (nerrnos, nsignals): Change to const variables unconditionally. + (nerrnos0, nsignals0): Remove. + [SUPPORTED_PERSONALITIES > 1] (errnoent1, signalent1, nerrnos1, + nsignals1): Remove. + [SUPPORTED_PERSONALITIES > 2] (errnoent2, signalent2, nerrnos2, + nsignals2): Likewise. + (set_personality): Do not assign errnoent, signalent, nerrnos, + and nsignals. + +2018-05-21 Eugene Syromyatnikov + + strace.1.in: mention -Xraw in -eraw description. + * strace.1.in (\fB\-e\ raw\fR=\,\fIset\fR): Mention -X raw. + +2018-05-21 Eugene Syromyatnikov + + strace.1.in: display -k option description only if it is enabled. + Leverage the fact that manpage is generated and add condition statements + around mentions of -k option. + + * strace.1.in (.SH SYNOPSIS): Put option list inside an + ".if '@ENABLE_STACKTRACE_TRUE@'#' .ig end_unwind_opt ... .end_unwind_opt" + condition; add a second list of options without -k and put it inside + ".if '@ENABLE_STACKTRACE_FALSE@'#' .ig end_no_unwind_opt ... .end_no_unwind_opt" + condition. + (.SS Output format) <-k>: Put it inside + ".if '@ENABLE_STACKTRACE_TRUE@'#' .ig end_unwind ... .end_unwind" + condition, remove the mention of --enable-stacktrace configuration + option requirement. + +2018-05-21 Eugene Syromyatnikov + + strace.1.in: format a reference to "open" syscall using bold font. + * strace.1.in (.SH DESCRIPTION): Format a reference to "open" syscall + using bold font. + + tests/qual_fault.test: add -efu arguments to the interpreter. + * tests/qual_fault.test (#!/bin/sh): Add -efu arguments. + +2018-05-21 Eugene Syromyatnikov + + tests/qual_fault.test: swap expected/output files in match_diff calls. + match_diff expects the first argument as strace output and the second + argument as expected output. + + * tests/qual_fault.test (check_fault_injection): Swap arguments + in match_diff calls. + +2018-05-21 Dmitry V. Levin + + defs.h: convert some macro wrappers into static inline functions. + * defs.h (pathtrace_select, pathtrace_match, printxval_searchn, + printxval_indexn, sprintxval, sprintflags, printnum_slong, + printnum_ulong, printnum_ptr, printnum_kptr): Convert macro wrappers + into static inline functions. + +2018-05-21 Eugene Syromyatnikov + + xlat: add support for xlat_styles in printxval_dispatch. + * defs.h (printxval_dispatch_ex): Rename from printxval_dispatch, add + style argument. + (printxval_dispatch): New static inline function, a thin wrapper around + printxval_dispatch_ex. + * xlat.c (printxval_dispatch): Rename to printxval_dispatch_ex, add + style argument, handle it. + + Co-Authored-by: Dmitry V. Levin + +2018-05-21 Eugene Syromyatnikov + + Make printxval_dispatch publicly available. + * evdev.c (enum xlat_type, printxval_dispatch): Move elsewhere. + * defs.h (enum_xlat_type): Move from evdev.c. + (printxval_dispatch): New declaration. + * xlat.c (printxval_dispatch): Move from evdev.c, drop static qualifier. + +2018-05-21 Eugene Syromyatnikov + + Revert "evdev: remove XT_NORMAL" + This reverts commit cc52da10c6f13feba577a83088f34916c6350165 + in preparation for printxval_dispatch generalisation. + + * evdev.c (enum xlat_type): Add XT_NORMAL back. + (printxval_dispatch): Handle XT_NORMAL again. + +2018-05-21 Eugene Syromyatnikov + + defs.h: introduce is_bigendian macro. + This macro is going to be used in inline checks. + + * defs.h (is_bigendian): New macro constant. + +2018-05-21 Eugene Syromyatnikov + + util.c: make memory allocation error messages more informative. + As those are pretty unusual, let's add some additional information + that can be reported by users. + + * util.c (print_quoted_string_ex, dumpstr): Add reasons for memory + allocation errors. + (sizeof_iov): Change type from size_t to unsigned int. + (dumpiov_upto): Rewrite size initialisation similarly to the way it's + done in print_quoted_string_ex, add reasons for memory allocation errors. + + Co-Authored-by: Dmitry V. Levin + +2018-05-19 Eugene Syromyatnikov + + strace.1.in: fix -A description. + * strace.1.in (.SS Output format) <-A>: Add missing .B. + + strace.1.in: document x32 64-bit syscall peculiarity. + * strace.1.in (.SH NOTES): Document "#64" suffix for 64-bit syscalls on + x32. + +2018-05-19 Eugene Syromyatnikov + + linux/x32/syscallent.h: change 64-bit syscall designation. + The current way of designation of 64-bit specific syscalls in x32 + personality not only conflicts with fault injection specification + syntax, but also makes it impossible to specify such syscalls at all + (since everything that starts from a digit is considered a syscall + number specification). So, let's change prefix to suffix and use + octothorpe instead of colon as a separator. + + * linux/x32/syscallent.h (13, 15, 16, 19, 20, 45, 46, 47, 54, 55, 59, + 101, 127, 128. 129, 131, 134, 156, 174, 177, 178, 180, 205, 206, 209, + 211, 214, 215, 222, 236, 244, 246, 247, 273, 274, 278, 279, 295, 296, + 297, 299, 307, 310, 311, 32, 327, 328): Change "64:" prefix to "#64" + suffix in syscall name. + + Closes: https://github.com/strace/strace/issues/36 + +2018-05-19 Eugene Syromyatnikov + + xlat: add BPF_PROG_TYPE_SK_MSG. + * xlat/bpf_prog_types.in (BPF_PROG_TYPE_SK_MSG): New constant, + introduced by Linux commit v4.17-rc1~148^2~156^2~1^2~13. + * tests/bpf.c (BPF_PROG_LOAD_checks): Update expected output. + + xlat: update bpf_attach_type constants. + * xlat/bpf_attach_type.in (BPF_SK_MSG_VERDICT): New constant, + introduced by Linux commit v4.17-rc1~148^2~156^2~1^2~13. + (BPF_CGROUP_INET4_BIND, BPF_CGROUP_INET6_BIND): New constants, + introduced by Linux commit v4.17-rc1~148^2~19^2^2~6. + (BPF_CGROUP_INET4_CONNECT, BPF_CGROUP_INET6_CONNECT): New constants, + introduced by Linux commit v4.17-rc1~148^2~19^2^2~3. + (BPF_CGROUP_INET4_POST_BIND, BPF_CGROUP_INET6_POST_BIND): New constants, + introduced by Linux commit v4.17-rc1~148^2~19^2^2~1. + * tests/bpf.c (BPF_PROG_QUERY_checks): Update expected output. + +2018-05-19 Eugene Syromyatnikov + + xlat/sock_rds_options.in: make it sorted. + Define SO_TIMESTAMP twice, for PA-RISC and all the other architectures. + + * xlat/sock_rds_options.in [!__hppa__] (SO_TIMESTAMP): Define to 29. + [__hppa__] (SO_TIMESTAMP): Define to 0x4012. + * net.c (print_sockopt_fd_level_name) : Use + printxval_search instead of printxval. + +2018-05-17 Gleb Fotengauer-Malinovskiy + + Update ioctl entries from linux v4.17. + * linux/32/ioctls_inc_align16.h: Update from linux v4.17-rc5 + using ioctls_gen.sh. + * linux/32/ioctls_inc_align32.h: Likewise. + * linux/32/ioctls_inc_align64.h: Likewise. + * linux/64/ioctls_inc.h: Likewise. + * linux/x32/ioctls_inc0.h: Likewise. + * linux/i386/ioctls_arch0.h: Likewise. + * linux/x86_64/ioctls_arch0.h: Likewise. + * NEWS: Mention this. + + maint: update for linux 4.17-rc5. + * maint/ioctls_sym.sh: (x86_list): Add KVM_HYPERV_EVENTFD. + +2018-05-16 Dmitry V. Levin + + bpf: use indexed lookups where appropriate. + * xlat/bpf_attach_type.in: Add "#value_indexed" directive. + * xlat/bpf_class.in: Likewise. + * xlat/bpf_map_types.in: Likewise. + * xlat/bpf_map_update_elem_flags.in: Likewise. + * xlat/bpf_prog_types.in: Likewise. + * xlat/ebpf_class.in: Likewise. + * bpf_filter.c (print_bpf_filter_code): Use printxval_index + instead of printxval for decoding bpf_class and ebpf_class. + * print_fields.h (PRINT_FIELD_XVAL_INDEX): New macro. + * bpf.c: Use it instead of PRINT_FIELD_XVAL for decoding bpf_attach_type, + bpf_map_types, bpf_map_update_elem_flags, and bpf_prog_types. + +2018-05-15 Dmitry V. Levin + + bpf: use printxval_index lookup instead of printxval. + * xlat/bpf_commands.in: Add "#value_indexed" directive. + * bpf.c (SYS_FUNC(bpf)): Use printxval_index instead of printxval. + + time: use indexed lookups. + * defs.h (xlat_idx): New prototype. + * xlat.c (xlat_idx): Remove static qualifier. + * time.c (do_adjtimex): Use xlat_idx instead of xlookup. + (SYS_FUNC(getitimer), SYS_FUNC(setitimer)): Use printxval_index + instead of printxval. + [ALPHA] (SYS_FUNC(osf_getitimer), SYS_FUNC(osf_setitimer)): Likewise. + (printclockname) [CLOCKID_TO_FD]: Likewise. + * xlat/adjtimex_state.in: Add "#value_indexed" directive. + * xlat/clocknames.in: Likewise. + * xlat/cpuclocknames.in: Add "#value_indexed" directive, add default + values to constants. + * xlat/itimer_which.in: Likewise. + +2018-05-15 Andre McCurdy + + linux/arm/raw_syscall.h: avoid r7 specified register variables with Thumb + If Thumb code is being generated and frame pointers are enabled, the + Thumb frame pointer in r7 clashes with any local variable which may + need to be assigned to r7 (e.g. the syscall NR when making a raw + syscall). + + With gcc, the double use of r7 results in a build error, e.g. + + strace-4.22/tests/inject-nf.c:86:1: error: r7 cannot be used in asm here + + With clang, the double use of r7 can result in the compiler silently + generating broken code which crashes at run time due to frame pointer + corruption: + + https://bugs.llvm.org/show_bug.cgi?id=34165 + + In most cases the problem isn't visible as frame pointers will be + disabled automatically due to optimisation level. However to handle + cases where frame pointers are enabled (e.g. when CFLAGS etc are set + to support a debug build, etc) provide a version of raw_syscall_0 + which manually saves and restores the frame pointer value in r7 + to a temporary register before setting up the syscall NR in r7 + and invoking the syscall. + + * linux/arm/raw_syscall.h (raw_syscall_0) [__thumb__]: Provide + an alternative version. + +2018-05-15 Dmitry V. Levin + + sockaddr: use printxval_index lookup instead of printxval. + * xlat/addrfams.in: Add "#value_indexed" directive. + * xlat/af_packet_types.in: Likewise. + * xlat/hci_channels.in: Likewise. + * sockaddr.c (print_sockaddr_data_bt, print_sockaddr, + * print_sockaddr_data_ll): Use printxval_index instead of printxval. + +2018-05-15 Eugene Syromyatnikov + + sockaddr: use printxval_search for ARPHRD_* constants. + This xlat table is quite big. + + * sockaddr.c (print_sockaddr_data_ll): Replace printxval call with + printxval_search for printing of struct sockaddr_ll.sll_hatype field. + +2018-05-15 Eugene Syromyatnikov + + Add a common MAC address printing routine. + * print_mac.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * defs.h (sprint_mac_addr): New declaration. + (print_mac_addr): New function, a thin wrapper around sprint_mac_addr. + * print_fields.h (PRINT_FIELD_MAC, PRINT_FIELD_MAC_SZ): New macros. + * rtnl_link.c (decode_ifla_bridge_id): Use PRINT_FIELD_MAC for bridge + address printing. + * sock.c (print_ifreq) : Use print_mac_addr for + ifr_hwaddr printing. + * sockaddr.c (print_sockaddr_data_bt): Use print_mac_addr for + {sco,rc,l2}_bdaddr field printing. + + Co-Authored-by: Dmitry V. Levin + +2018-05-15 Eugene Syromyatnikov + + sockaddr: decode Bluetooth L2 CID values. + * xlat/bluetooth_l2_cid.in: New file. + * sockaddr.c: Include xlat/bluetooth_l2_cid.h. + (print_bluetooth_l2_cid): New function. + (print_sockaddr_data_bt): Use it to decode struct sockaddr_l2.l2_cid + field. + * tests/net-sockaddr.c (check_l2): Update expected output. + + Co-Authored-by: Dmitry V. Levin + +2018-05-15 Eugene Syromyatnikov + + sockaddr: decode Bluetooth L2 PSM values. + * xlat/bluetooth_l2_psm.in: New file. + * sockaddr.c: Include xlat/bluetooth_l2_psm.h. + (print_bluetooth_l2_psm): New function. + (print_sockaddr_data_bt): Use it to decode struct sockaddr_l2.l2_psm + field. + * tests/net-sockaddr.c (check_l2): Update expected output. + + sockaddr: decode bluetooth address type names. + * xlat/bdaddr_types.in: New file. + * sockaddr.c: Include xlat/bdaddr_types.h. + (print_sockaddr_data_bt): Decode struct sockaddr_l2.l2_bdaddr_type field + using constants from bdaddr_types xlat. + * tests/net-sockaddr.c (check_l2): Check decoding + of struct sockaddr_l2.l2_bdaddr_type field. + +2018-05-15 Eugene Syromyatnikov + + sockaddr: decode Bluetooth socket address unconditionally. + * sockaddr.c [HAVE_BLUETOOTH_BLUETOOTH_H]: Do not include + bluetooth/bluetooth.h, bluetooth/hci.h, bluetooth/l2cap.h, + bluetooth/rfcomm.h, and bluetooth/sco.h. + [!HAVE_BLUETOOTH_BLUETOOTH_H]: Include xlat/hci_channels.h. + (btohs): New function. + (print_sockaddr_data_bt): Define unconditionally, add definitions + of struct sockaddr_hci, struct bdaddr, struct sockaddr_sco, + struct sockaddr_rc, and struct sockaddr_l2. + (sa_printers) : Define unconditionally. + + Co-Authored-by: Dmitry V. Levin + +2018-05-15 Eugene Syromyatnikov + + Avoid using print_array as a local variable name. + We have a function with the same name. + + * netlink.c (decode_netlink) : Rename to is_array, all + users updated. + * nlattr.c (decode_nlattr) : Likewise. + + Co-Authored-by: Dmitry V. Levin + +2018-05-15 Eugene Syromyatnikov + + xlat: update MSG_* constants. + Sync them with kernel's include/linux/socket.h, since syscalls perform + almost no checks for incorrect flags. + + * xlat/msg_flags.in (MSG_OOB, MSG_PEEK, MSG_DONTROUTE, MSG_CTRUNC, + MSG_PROBE, MSG_TRUNC, MSG_DONTWAIT, MSG_EOR, MSG_WAITALL, MSG_FIN, + MSG_SYN, MSG_CONFIRM, MSG_RST, MSG_ERRQUEUE, MSG_NOSIGNAL, MSG_MORE, + MSG_WAITFORONE, MSG_FASTOPEN, MSG_CMSG_CLOEXEC): Add default values + to all constants. + (MSG_SENDPAGE_NOTLAST, MSG_NO_SHARED_FRAGS): New constants. It is + an internal one, but, apparently, nothing prohibits passing it + to the kernel. + (MSG_CMSG_COMPAT): New constant. Override the value provided + by system headers. + (MSG_EOF): Commented out, as it is a synonym for MSG_FIN. + + Co-Authored-by: Dmitry V. Levin + +2018-05-14 Dmitry V. Levin + + socketutils: use exact match of unix domain sockets on fresh kernels. + * socketutils.c (unix_send_query): Do not add NLM_F_DUMP to nlmsg_flags + when kernel version is 4.4.4 or later, initialize udiag_cookie + unconditionally. + + Complements: v4.12~536 ("Change unix_diag requests back to use full dump instead of exact match") + +2018-05-14 Eugene Syromyatnikov + + socketutils: do not request NDIAG_SHOW_MEMINFO. + This information is not used and it looks like it negatively affects + ability to find the socket under high load. + + * socketutils.c (netlink_send_query) : Remove NDIAG_SHOW_MEMINFO + flag from netlink_diag_req.ndiag_show field. + * tests/netlink_netlink_diag.c (send_query) : Likewise. + + Co-Authored-by: Dmitry V. Levin + +2018-05-09 Eugene Syromyatnikov + + tests: introduce midtail_alloc and use it in netlink tests. + netlink tests happen to access memory located before the tail_malloc'ed + pointers, a practice that doesn't go well with the latest compilers + because tail_malloc is marked with ATTRIBUTE_MALLOC. + For example, glibc in -D_FORTIFY_SOURCE=2 mode and gcc 8 with + -Warray-bounds enabled complain about negative offsets out of bounds. + Fix this issue by introducing midtail_alloc. + + * tests/tests.h (midtail_alloc): New macro. + * tests/netlink_crypto.c: Use it instead of tail_malloc for nlh0 allocation. + * tests/netlink_netfilter.c: Likewise. + * tests/netlink_protocol.c: Likewise. + * tests/netlink_route.c: Likewise. + * tests/netlink_selinux.c: Likewise. + * tests/netlink_sock_diag.c: Likewise. + * tests/nlattr_br_port_msg.c: Likewise. + * tests/nlattr_crypto_user_alg.c: Likewise. + * tests/nlattr_dcbmsg.c: Likewise. + * tests/nlattr_fib_rule_hdr.c: Likewise. + * tests/nlattr_ifaddrlblmsg.c: Likewise. + * tests/nlattr_ifaddrmsg.c: Likewise. + * tests/nlattr_ifinfomsg.c: Likewise. + * tests/nlattr_ifla_brport.c: Likewise. + * tests/nlattr_ifla_port.c: Likewise. + * tests/nlattr_ifla_xdp.c: Likewise. + * tests/nlattr_inet_diag_msg.c: Likewise. + * tests/nlattr_inet_diag_req_compat.c: Likewise. + * tests/nlattr_inet_diag_req_v2.c: Likewise. + * tests/nlattr_mdba_mdb_entry.c: Likewise. + * tests/nlattr_mdba_router_port.c: Likewise. + * tests/nlattr_ndmsg.c: Likewise. + * tests/nlattr_ndtmsg.c: Likewise. + * tests/nlattr_netconfmsg.c: Likewise. + * tests/nlattr_netlink_diag_msg.c: Likewise. + * tests/nlattr_nlmsgerr.c: Likewise. + * tests/nlattr_packet_diag_msg.c: Likewise. + * tests/nlattr_rtgenmsg.c: Likewise. + * tests/nlattr_rtmsg.c: Likewise. + * tests/nlattr_smc_diag_msg.c: Likewise. + * tests/nlattr_tc_stats.c: Likewise. + * tests/nlattr_tca_stab.c: Likewise. + * tests/nlattr_tcamsg.c: Likewise. + * tests/nlattr_tcmsg.c: Likewise. + * tests/nlattr_unix_diag_msg.c: Likewise. + + Co-Authored-by: Dmitry V. Levin + +2018-05-09 Eugene Syromyatnikov + + Use MIN where appropriate. + * netlink.c (decode_nlmsghdr_with_payload): Use MIN. + * netlink_packet_diag.c (print_packet_diag_mclist): Likewise. + * nlattr.c (decode_nlattr_with_data): Likewise. + * rtnl_route.c (decode_rta_multipath): Likewise. + +2018-05-09 Eugene Syromyatnikov + + xlat: add fallback definitions to {msg,sem,shm}ctl command constants. + * xlat/msgctl_flags.in: Add default values to all constants, reorder + to make them sorted by value. + * xlat/semctl_flags.in: Likewise. + * xlat/shmctl_flags.in: Likewise. + + Co-Authored-by: Dmitry V. Levin + +2018-05-09 Eugene Syromyatnikov + + xlat: add MSG_STAT_ANY. + * xlat/msgctl_flags.in (MSG_STAT_ANY): New constant, introduced + by Linux commit v4.17-rc1~52^2~21. + * tests/ipc_msg.c: Check it. + + Co-Authored-by: Dmitry V. Levin + +2018-05-09 Eugene Syromyatnikov + + xlat: add SEM_STAT_ANY. + * xlat/semctl_flags.in (SEM_STAT_ANY): New constant, introduced + by Linux commit v4.17-rc1~52^2~22. + * tests/ipc_sem.c: Check it. + + Co-Authored-by: Dmitry V. Levin + +2018-05-09 Eugene Syromyatnikov + + xlat: add SHM_STAT_ANY. + * xlat/shmctl_flags.in (SHM_STAT_ANY): New constant, introduced + by Linux commit v4.17-rc1~52^2~23. + * tests/ipc_shm.c: Check it. + + Co-Authored-by: Dmitry V. Levin + +2018-05-09 Eugene Syromyatnikov + + net: print SO_GET_FILTER in getsockopt. + SO_ATTACH_FILTER and SO_GET_FILTER have the same value; the former + constant is intended for use in setsockopt, and the latter is for + getsockopt. Handle that the same way as similar SOL_IP/SOL_IPV6 socket + options are handled. + + * xlat/getsock_options.in: New file. + * xlat/setsock_options.in: Likewise. + * xlat/sockoptions.in (SO_ATTACH_FILTER): Move to + xlat/setsock_options.in. + * net.c: Include "xlat/setsock_options.h" and "xlat/getsock_options.h". + (print_sockopt_fd_level_name) : Use + getsock_options or setsock_options as auxiliary xlats based on the value + of is_getsockopt flag. + * tests/sock_filter-v.c: Update expected output. + + Co-Authored-by: Dmitry V. Levin + +2018-05-09 Eugene Syromyatnikov + + tests: add sock_filtrer-v variants with different xlat verbosity levels. + * tests/sock_filter-v-Xabbrev.c: New file. + * tests/sock_filter-v-Xraw.c: Likewise. + * tests/sock_filter-v-Xverbose.c: Likewise. + * tests/sock_filter-v.c (PRINT_STMT_SYM, PRINT_STMT_SYM_, + PRINT_STMT_VAL, PRINT_STMT_VAL_, PRINT_JUMP_): Remove. + (HEX_FMT, XLAT_FMT, XLAT_ARGS, PRINT_STMT): New macros. + (PRINT_JUMP): Rewrite. + (print_filter): Rewrite using PRINT_STMT and new PRINT_JUMP. + (main): Print SOL_SOCKET, SO_ATTACH_FILTER, and SO_ATTACH_REUSEPORT_CBPF + using XLAT_FMT/XLAT_ARGS macros. + * tests/pure_executables.list: Add sock_filter-v-Xabbrev, + sock_filter-v-Xraw, and sock_filter-v-Xverbose. + * tests/.gitignore: Likewise. + * tests/gen_tests.in (sock_filter-v-Xabbrev, sock_filter-v-Xraw, + sock_filter-v-Xverbose): New tests. + + Co-Authored-by: Dmitry V. Levin + +2018-05-08 Eugene Syromyatnikov + + defs.h: fix ethernet_protocols comment. + Starting with commit v4.22~109, sorted xlat tables are terminated + with XLAT_END. + + * defs.h (ethernet_protocols): Remove the "unterminated" part from + description. + +2018-05-08 Dmitry V. Levin + + xlat: rename *sock*options xlat tables. + Such names as sockrxrpcoptions are incomprehensible. + + * xlat/getsockipoptions.in: Rename to xlat/getsock_ip_options.in. + * xlat/getsockipv6options.in: Rename to xlat/getsock_ipv6_options.in. + * xlat/setsockipoptions.in: Rename to xlat/setsock_ip_options.in. + * xlat/setsockipv6options.in: Rename to xlat/setsock_ipv6_options.in. + * xlat/sockalgoptions.in: Rename to xlat/sock_alg_options.in. + * xlat/sockbluetoothoptions.in: Rename to xlat/sock_bluetooth_options.in. + * xlat/sockcaifoptions.in: Rename to xlat/sock_caif_options.in. + * xlat/sockdccpoptions.in: Rename to xlat/sock_dccp_options.in. + * xlat/sockipoptions.in: Rename to xlat/sock_ip_options.in. + * xlat/sockipv6options.in: Rename to xlat/sock_ipv6_options.in. + * xlat/sockipxoptions.in: Rename to xlat/sock_ipx_options.in. + * xlat/sockirdaoptions.in: Rename to xlat/sock_irda_options.in. + * xlat/sockiucvoptions.in: Rename to xlat/sock_iucv_options.in. + * xlat/sockkcmoptions.in: Rename to xlat/sock_kcm_options.in. + * xlat/sockllcoptions.in: Rename to xlat/sock_llc_options.in. + * xlat/socknetlinkoptions.in: Rename to xlat/sock_netlink_options.in. + * xlat/socknfcllcpoptions.in: Rename to xlat/sock_nfcllcp_options.in. + * xlat/sockoptions.in: Rename to xlat/sock_options.in. + * xlat/sockpacketoptions.in: Rename to xlat/sock_packet_options.in. + * xlat/sockpnpoptions.in: Rename to xlat/sock_pnp_options.in. + * xlat/sockpppol2tpoptions.in: Rename to xlat/sock_pppol2tp_options.in. + * xlat/sockrawoptions.in: Rename to xlat/sock_raw_options.in. + * xlat/sockrdsoptions.in: Rename to xlat/sock_rds_options.in. + * xlat/sockrxrpcoptions.in: Rename to xlat/sock_rxrpc_options.in. + * xlat/socksctpoptions.in: Rename to xlat/sock_sctp_options.in. + * xlat/socktcpoptions.in: Rename to xlat/sock_tcp_options.in. + * xlat/socktipcoptions.in: Rename to xlat/sock_tipc_options.in. + * xlat/socktlsoptions.in: Rename to xlat/sock_tls_options.in. + * xlat/sockudpoptions.in: Rename to xlat/sock_udp_options.in. + * net.c: Update. + +2018-05-08 Eugene Syromyatnikov + + net: decode more SOL_* socket options. + * xlat/sockalgoptions.in: New file. + * xlat/sockbluetoothoptions.in: Likewise. + * xlat/sockcaifoptions.in: Likewise. + * xlat/sockdccpoptions.in: Likewise. + * xlat/sockiucvoptions.in: Likewise. + * xlat/sockkcmoptions.in: Likewise. + * xlat/sockllcoptions.in: Likewise. + * xlat/socknfcllcpoptions.in: Likewise. + * xlat/sockpnpoptions.in: Likewise. + * xlat/sockpppol2tpoptions.in: Likewise. + * xlat/sockrdsoptions.in: Likewises. + * xlat/sockrxrpcoptions.in: Likewise. + * xlat/socktipcoptions.in: Likewise. + * xlat/socktlsoptions.in: Likewise. + * xlat/sockudpoptions.in: Likewise. + * net.c: Include "xlat/sockalgoptions.h", "xlat/sockbluetoothoptions.h", + "xlat/sockcaifoptions.h", "xlat/sockdccpoptions.h", + "xlat/sockiucvoptions.h", "xlat/sockkcmoptions.h", + "xlat/sockllcoptions.h", "xlat/socknfcllcpoptions.h", + "xlat/sockpnpoptions.h", "xlat/sockpppol2tpoptions.h", + "xlat/sockrdsoptions.h", "xlat/sockrxrpcoptions.h", + "xlat/socktipcoptions.h", "xlat/socktlsoptions.h", + and "xlat/sockudpoptions.h". + (print_sockopt_fd_level_name): Decode SOL_UDP, SOL_IRDA, SOL_LLC, + SOL_DCCP, SOL_TIPC, SOL_RXRPC, SOL_PPPOL2TP, SOL_BLUETOOTH, SOL_PNPIPE, + SOL_RDS, SOL_IUCV, SOL_CAIF, SOL_ALG, SOL_NFC, SOL_KCM, and SOL_TLS + socket option names. + + Co-Authored-by: Dmitry V. Levin + +2018-05-08 Eugene Syromyatnikov + + net: decode more AF_* protocol names. + * xlat/caif_protocols.in: New file. + * xlat/can_protocols.in: Likewise. + * xlat/irda_protocols.in: Likewise. + * xlat/isdn_protocols.in: Likewise. + * xlat/kcm_protocols.in: Likewise. + * xlat/nfc_protocols.in: Likewise. + * xlat/phonet_protocols.in: Likewise. + * xlat/smc_protocols.in: Likewise. + * net.c: Include "xlat/irda_protocols.h", "xlat/can_protocols.h", + "xlat/isdn_protocols.h", "xlat/phonet_protocols.h", + "xlat/caif_protocols.h", "xlat/nfc_protocols.h", + "xlat/kcm_protocols.h", and "xlat/smc_protocols.h". + (SYS_FUNC(socket)): Decode AF_IRDA, AF_CAN, AF_RXRPC, AF_ISDN, + AF_PHONET, AF_CAIF, AF_NFC, AF_KCM, and AF_SMC protocol names. + + Co-Authored-by: Dmitry V. Levin + +2018-05-08 Eugene Syromyatnikov + + Remove some duplicate fallback definitions. + There is no need to provide duplicate fallback definitions anymore, + inclusion of the appropriate xlat header in XLAT_MACROS_ONLY mode + does the right thing. + + * btrfs.c [!BTRFS_FIRST_FREE_OBJECTID] (BTRFS_FIRST_FREE_OBJECTID): + Remove, a fallback definition is already provided by included + "xlat/btrfs_tree_objectids.h". + * net.c: Include "xlat/addrfams.h" in XLAT_MACROS_ONLY mode. + [!AF_BLUETOOTH] (AF_BLUETOOTH): Remove. + * syscall.c: Include "xlat/nt_descriptor_types.h" in XLAT_MACROS_ONLY + mode. + [!NT_PRSTATUS] (NT_PRSTATUS): Remove. + + Co-Authored-by: Dmitry V. Levin + +2018-05-08 Eugene Syromyatnikov + + xlat/gen.sh: introduce XLAT_MACROS_ONLY macro. + Sometimes we need just fallback definitions and nothing else. + This change adds an interface of skipping xlat table prototypes + and definitions. + + * xlat/gen.sh (gen_header): Place xlat table prototype or definition + under "#ifndef XLAT_MACROS_ONLY" guard. + + Co-Authored-by: Dmitry V. Levin + +2018-05-08 Eugene Syromyatnikov + + rtnl_link: print IFLA_NEW_IFINDEX using decode_nla_ifindex. + As it is an interface index. + + * rtnl_link.c (ifinfomsg_nla_decoders) <[IFLA_NEW_IFINDEX]>: Change + the value from decode_nla_s32 to decode_nla_ifindex. + +2018-05-08 Eugene Syromyatnikov + + ci: install libbluetooth-dev. + * ci/install-dependencies.sh (common_packages): Add libbluetooth-dev. + + xlat: provide fallback definitions for HCI_CHANNEL_* constants. + * xlat/hci_channels.in: Provide fallback definitions. + +2018-05-08 Eugene Syromyatnikov + + s390: simplify s390_runtime_instr command printing. + As the header with command definitions is now a part of UAPI (since + Linux commit v4.16-rc1~21^2~11), there's no need for a very special + printing routine for command names. + + * s390.c (SYS_FUNC(s390_runtime_instr)): Use printxval_d to print + the command argument. + * tests/s390_runtime_instr.c: Update expected output. + +2018-05-08 Eugene Syromyatnikov + + tests/init.sh: add run_prog_match_grep. + * tests/init.sh (run_prog_match_grep): New function, similar + to run_prog_match_diff. + +2018-05-08 Eugene Syromyatnikov + + tests: add so_peercred variants with different xlat verbosity levels. + * tests/so_peercred-Xabbrev.c: New file. + * tests/so_peercred-Xraw.c: Likewise. + * tests/so_peercred-Xverbose.c: Likewise. + * tests/pure_executables.list: Add so_peercred-Xabbrev, + so_peercred-Xraw, and so_peercred-Xverbose. + * tests/.gitignore: Likewise. + * tests/so_peercred.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags. + * tests/gen_tests.in (so_peercred-Xabbrev, so_peercred-Xraw, + so_peercred-Xverbose): New tests. + + Co-Authored-by: Dmitry V. Levin + +2018-05-08 Eugene Syromyatnikov + + tests: add personality variants with different xlat verbosity levels. + * tests/personality-Xabbrev.c: New file. + * tests/personality-Xraw.c: Likewise. + * tests/personality-Xverbose.c: Likewise. + * tests/pure_executables.list: Add personality-Xabbrev, + personality-Xraw, and personality-Xverbose. + * tests/.gitignore: Likewise. + * tests/personality.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags. + * tests/personality.test: Add support for accepting test arguments. + * tests/gen_tests.in (personality-Xabbrev, personality-Xraw, + personality-Xverbose): New tests. + + tests: add fanotify_mark variants with different xlat verbosity levels. + * tests/fanotify_mark-Xabbrev.c: New file. + * tests/fanotify_mark-Xraw.c: Likewise. + * tests/fanotify_mark-Xverbose.c: Likewise. + * tests/pure_executables.list: Add fanotify_mark-Xabbev, + fanotify_mark-Xraw, and fanotify_mark-Xverbose. + * tests/.gitignore: Likewise. + * tests/fanotify_mark.c: Add handling of XLAT_RAW and XLAT_VERBOSE + flags. + * tests/gen_tests.in (fanotify_mark-Xabbev, fanotify_mark-Xraw, + fanotify_mark-Xverbose): New tests. + +2018-05-07 Eugene Syromyatnikov + + xlat: provide fallback definitions for IFF_* constants. + * xlat/iffflags.in: Provide fallback definitions. Mention that + the array is sorted. + + xlat: update IFF_* constants. + * xlat/iffflags.in (IFF_DYNAMIC): New constant, had been introduced + before the current git repository was conceived. + (IFF_LOWER_UP, IFF_DORMANT): New constants, introduced by Linux commit + v2.6.17-rc1~1175^2~206. + (IFF_ECHO): New constant, introduced by Linux commit + v2.6.25-rc1~1162^2~1415. + + xlat: provide fallback definitions for ARPHRD_* constants. + * xlat/arp_hardware_types.in: Provide fallback definitions, sort. + + tests: add more v4l2 checks. + * tests/ioctl_v4l2.c (main): Add more VIDIOC_S_EXT_CTRLS checks. + + tests: add variants of IPC tests with different xlat verbosity levels. + * tests/.gitignore: Add ipc_msg-Xabbrev, ipc_msg-Xraw, ipc_msg-Xverbose, + ipc_msgbuf-Xabbrev, ipc_msgbuf-Xraw, ipc_msgbuf-Xverbose, + ipc_sem-Xabbrev, ipc_sem-Xraw, ipc_sem-Xverbose, ipc_shm-Xabbrev, + ipc_shm-Xraw, and ipc_shm-Xverbose. + * tests/pure_executables.list: Likewise. + * tests/gen_tests.in (ipc_msg-Xabbrev, ipc_msg-Xraw, ipc_msg-Xverbose, + ipc_msgbuf-Xabbrev, ipc_msgbuf-Xraw, ipc_msgbuf-Xverbose, + ipc_sem-Xabbrev, ipc_sem-Xraw, ipc_sem-Xverbose, ipc_shm-Xabbrev, + ipc_shm-Xraw, ipc_shm-Xverbose): New tests. + * tests/ipc_msg-Xabbrev.c: New file. + * tests/ipc_msg-Xraw.c: Likewise. + * tests/ipc_msg-Xverbose.c: Likewise. + * tests/ipc_msgbuf-Xabbrev.c: Likewise. + * tests/ipc_msgbuf-Xraw.c: Likewise. + * tests/ipc_msgbuf-Xverbose.c: Likewise. + * tests/ipc_sem-Xabbrev.c: Likewise. + * tests/ipc_sem-Xraw.c: Likewise. + * tests/ipc_sem-Xverbose.c: Likewise. + * tests/ipc_shm-Xabbrev.c: Likewise. + * tests/ipc_shm-Xraw.c: Likewise. + * tests/ipc_shm-Xverbose.c: Likewise. + * tests/ipc.sh: Add support for accepting test arguments. + * tests/ipc_msgbuf.test: Likewise. + * tests/ipc_msg.c: Add handling of XLAT_RAW and XLAT_VERBOSE flags. + * tests/ipc_msgbuf.c: Likewise. + * tests/ipc_sem.c: Likewise. + * tests/ipc_shm.c: Likewise. + + tests: make ipc tests a bit more strict. + * tests/gen_tests.in (ipc_msg, ipc_sem, ipc_shm): Add -a option. + * tests/ipc_msg.c: Replace " +" with " " in expected output. + * tests/ipc_sem.c: Likewise. + * tests/ipc_shm.c: Likewise. + + ipc_shm: print SHM_HUGE_SHIFT using print_xlat_u. + * ipc_shm.c (SYS_FUNC(shmget)): Print SHM_HUGE_SHIFT using print_xlat_u. + + tests: check all bits of mtype in ipc_msgbuf test. + * tests/ipc_msgbuf.c: Include and . + (sys_msgrcv): New function. + (msgrcv): Use it instead of msgrcv. Add bits to mtype, + check for -mtype in msgrcv. + + tests: print expected output by ipc_msgbuf test itself. + * tests/ipc_msgbuf.expected: Remove. + * tests/Makefile.am (EXTRA_DIST): Remove tests/ipc_msgbuf.expected. + * tests/ipc_msgbuf.c: Add expected output. + * tests/ipc_msgbuf.test: Add -a31. Redirect output to $EXP. Call + match_grep with $LOG and $EXP arguments. + +2018-05-07 Dmitry V. Levin + + xlat: provide fallback definitions for SKF_*_OFF constants. + * xlat/skf_off.in: New file. + * bpf_sock_filter.c: Include "xlat/skf_off.h". + + xlat: provide fallback definitions for BPF_* constants. + * xlat/bpf_class.in: Add default values for constants. + * xlat/bpf_miscop.in: Likewise. + * xlat/bpf_mode.in: Likewise. + * xlat/bpf_op_alu.in: Likewise. + * xlat/bpf_op_jmp.in: Likewise. + * xlat/bpf_rval.in: Likewise. + * xlat/bpf_size.in: Likewise. + * xlat/bpf_src.in: Likewise. + +2018-05-06 Dmitry V. Levin + + xlat: fix F_* fallback definitions on mips64. + * xlat/fcntlcmds.in (F_GETLK64, F_SETLK64, F_SETLKW64) [__mips64]: Fix + default values. + + Fixes: v4.22-122-gfa8f486 ("xlat: fix F_* fallback definitions on alpha, hppa, mips, and sparc") + +2018-05-06 Eugene Syromyatnikov + + xlat: add fallback definitions to SO_* constants. + Regenerate xlat/sockoptions.in using the following script: + + sed -n 's/^\(SO_[^[:space:]]*\).*/\1/p' xlat/sockoptions.in | + uniq | + while read name; do + sed -rn 's/#define[[:space:]]+('"$name"')[[:space:]]+([[:digit:]]+)$/\2\t\1/p' \ + /path/to/linux/include/uapi/asm-generic/socket.h + done | + sort -n | + while read def name; do + grep -EH '#define[[:space:]]+'"$name"'[[:space:]]+(0x[[:xdigit:]]+|[[:digit:]]+)' \ + /path/to/linux/arch/*/include/uapi/asm/socket.h | + sed -rn 's|^[^#]*/arch/([^/]+)/include/uapi/asm/socket\.h:#define[[:space:]]+'"$name"'[[:space:]]+([^[:space:]]+)([[:space:]].*)?$|\1\t\2|p' | + sed s/parisc/hppa/ |sort | + awk -vname="$name" -vdef="$def" ' + { + i=strtonum($2) + if (i == def) next + if (a[i]) + a[i]=a[i] " || defined __" $1 "__" + else + a[i]="defined __" $1 "__" + } + END { + iftext="#if" + for (i in a) { + printf("%s %s\n%s %u\n",iftext,a[i],name,i) + iftext="#elif" + } + if (iftext != "#if") + print "#else" + printf("%s %s\n", name, def) + if (iftext == "#if") + print "" + else + print "#endif\n" + }' + done + + * xlat/sockoptions.in: Add fallback definitions. + + Co-Authored-by: Dmitry V. Levin + +2018-05-06 Eugene Syromyatnikov + + xlat: remove socket options with duplicate names. + * xlat/sockoptions.in (SO_GET_FILTER): Remove as it is defined + to SO_ATTACH_FILTER. + (SO_DETACH_BPF): Remove as it is defined to SO_DETACH_FILTER. + + xlat: remove socket options that do not exist in Linux. + * xlat/sockoptions.in (SO_ALLRAW, SO_ICS, SO_IMASOCKET, SO_LISTENING, + SO_MGMT, SO_ORDREL, SO_PARALLELSVR, SO_PROTOTYPE, SO_RDWRSO_SEMA, + SO_USELOOPBACK): Remove. + + xlat: treat socketlayers as a sorted array. + * xlat/socketlayers.in: Add a comment that the xlat is sorted. + * net.c (print_sockopt_fd_level_name): Use printxval_search + instead of printxval for decoding socket layer name. + +2018-05-06 Eugene Syromyatnikov + + net: decode Bluetooth protocol names unconditionally. + As we have all BTPROTO_* constant definitions now, there is no need + to rely on bluetooth.h header anymore. + + * net.c (AF_BLUETOOTH): Provide a fallback definition. + [HAVE_BLUETOOTH_BLUETOOTH_H]: Do not include . + [!HAVE_BLUETOOTH_BLUETOOTH_H]: Include "xlat/bt_protocols.h". + [!HAVE_BLUETOOTH_BLUETOOTH_H] (decode_sockbuf): Decode AF_BLUETOOTH. + (decode_sockbuf) : Use printxval_index. + * xlat/bt_protocols.in: Add "#value_indexed" directive. + +2018-05-06 Eugene Syromyatnikov + + xlat/gen.sh: invoke the shell interpreter with -e -u options. + * xlat/gen.sh: Change interpreter from "/bin/sh" to "/bin/sh -eu". + + xlat: update FPE_* constants. + * xlat/sigfpe_codes.in (FPE_FLTUNK): New constant, introduced by Linux + commit v4.17-rc1~107^2~2. + (FPE_CONDTRAP): New constant, introduced by Linux commit + v4.17-rc1~31^2~3. + + xlat: add MAP_FIXED_NOREPLACE. + * xlat/mmap_flags.in (MAP_FIXED_NOREPLACE): New constant, introduced + by Linux commit v4.17-rc1~52^2~14. + +2018-05-06 Eugene Syromyatnikov + + xlat: provide fallback definitions for BTPROTO_* constants. + As they are architecture-independent. + + * xlat/bt_protocols.in: Add values to constants. + +2018-05-06 Eugene Syromyatnikov + + xlat: add NETLINK_SMC. + * xlat/netlink_protocols.in (NETLINK_SMC): New constant, introduced + by Linux commit v4.11-rc1~94^2~43^2. + + xlat: provide fallback definitions for V4L2_CID_* constants. + * xlat/v4l2_control_id_bases.in: New file with fallback definitions. + * xlat/v4l2_control_ids.in: Add fallback definitions. + * v4l2.c: Reorder includes, include "xlat/v4l2_control_id_bases.h", + remove legacy V4L2_CID_* constant definitions. + +2018-05-06 Eugene Syromyatnikov + + xlat: update V4L2_CID_* constants. + Synchronise v4l2_control_ids list with the one provided by kernel's + include/uapi/linux/v4l2-controls.h. A few notes: + - V4L2_CID_CHROMA_GAIN and V4L2_CID_COLORFX_CBCR moved in accordance + with their position/values. + - V4L2_CID_WHITENESS is removed as it has the same value as + V4L2_CID_GAMMA. + - V4L2_CID_PRIVATE_BASE is removed. + - V4L2_CID_HCENTER and V4L2_CID_VCENTER that were removed by Linux + commit v3.9-rc1~93^2~237, are retained for historical reasons. + + * xlat/v4l2_control_ids.in: Update. + +2018-05-06 Eugene Syromyatnikov + + xlat: provide fallback definitions for V4L2_CTRL_CLASS_* constants. + As those are architecture-independant. Also note that the xlat + is sorted. + + * xlat/v4l2_control_classes.in: Add values. + +2018-05-06 Eugene Syromyatnikov + + xlat: update V4L2_CTRL_CLASS_* constants. + * xlat/v4l2_control_classes.in (V4L2_CTRL_CLASS_DV): New constant, + introduced by Linux commit v3.7-rc1~101^2^2~322. + (V4L2_CTRL_CLASS_RF_TUNER): New constant, introduced by Linux commit + v3.15-rc1~85^2~192. + (V4L2_CTRL_CLASS_DETECT): New constant, introduced by Linux commit + v3.17-rc1~112^2~340. + +2018-05-06 Eugene Syromyatnikov + + xlat: update BPF_F_* constants. + Apparently, BPF_F_RDONLY and BPF_F_WRONLY are also used in map_flags. + Moreover, set of flags depends on the type of map, but let's leave that + for another day. + + * xlat/bpf_map_flags.in (BPF_F_RDONLY, BPF_F_WRONLY): New constants. + (BPF_F_STACK_BUILD_ID): New constant, introduced by Linux commit + v4.17-rc1~148^2~156^2~3^2~1. + * xlat/bpf_map_flags.in: Update expected output. + +2018-05-06 Eugene Syromyatnikov + + xlat: add V4L2_PIX_FMT_HEVC. + * xlat/v4l2_pix_fmts.in (V4L2_PIX_FMT_HEVC): New constant, introduced + by Linux commit v4.17-rc1~143^2~60. + + xlat: add ETH_P_PREAUTH. + * xlat/ethernet_protocols.in (ETH_P_PREAUTH): New constant, introduced + by Linux commit v4.17-rc1~148^2~379^2~3. + + xlat: update SCTP_* constants. + * xlat/socksctpoptions.in (SCTP_AUTH_DEACTIVATE_KEY): New constant, + introduced by Linux commit v4.17-rc1~148^2~191^2~2. + (SCTP_SENDMSG_CONNECT): New constant, introduced by Linux commit + v4.17-rc1~96^2~9. + + xlat: add SPARC ADI-related SIGSEGV codes. + * xlat/sigsegv_codes.in (SEGV_ACCADI, SEGV_ADIDERR, SEGV_ADIPERR): New + constants, introduced by Linux commit v4.17-rc1~147^2~4^2~10. + + xlat: add PROT_ADI. + * xlat/mmap_prot.in (PROT_ADI): New constant, introduced by Linux commit + v4.17-rc1~147^2~4^2~1. + +2018-05-05 Dmitry V. Levin + + build: rewrite libdw detection without pkg-config. + pkg-config expected to be more convenient way to configure libdw, + but in practice it appeared to be less portable than good old + AC_CHECK_HEADERS and AC_CHECK_LIB. + + * ci/install-dependencies.sh (common_packages): Remove pkg-config. + (STACKTRACE == "libdw"): Do not install libz-dev and liblzma-dev. + * debian/control (Build-Depends): Remove pkg-config. + * m4/st_libdw.m4 (st_ARG_LIBDW, st_LIBDW): Rewrite without pkg-config. + +2018-05-04 Dmitry V. Levin + + ci: add more variants of unwinder to test matrices. + Check x86_64 builds with libdw, with libunwind, and without stacktrace. + As Travis CI doesn't provide a suitable libdw, do not test libdw there. + + * ci/install-dependencies.sh (common_packages): Remove libdw-dev. + Install libdw-dev or libunwind8-dev depending on $STACKTRACE. + * ci/run-build-and-tests.sh: Specify --with-libdw=yes, + --with-libunwind=yes, or --without-stacktrace depending on $STACKTRACE. + * .gitlab-ci.yml (gcc-x86_64): Rename to gcc-x86_64-libdw, + add STACKTRACE=libdw. + (gcc-x86): Rename to gcc-x86-nounwind, add STACKTRACE=no. + (clang-x86_64): Rename to clang-x86_64-libdw, add STACKTRACE=libdw. + (clang-x86): Rename to clang-x86-nounwind, add STACKTRACE=no. + (gcc-x86_64-libunwind, gcc-x86_64-nounwind, gcc-x86-nounwind, + clang-x86_64-libunwind, clang-x86_64-nounwind, clang-x86-nounwind): + New test matrix entries. + * .travis.yml: Add STACKTRACE=libunwind to all x86_64 test matrix + entries except musl-gcc, add STACKTRACE=no to other matrix entries, + add test matrix entries with STACKTRACE=no variants on x86_64. + +2018-05-04 Eugene Syromyatnikov + + xlat: update af_packet_types. + * xlat/af_packet_types.in: Add values. + (PACKET_USER, PACKET_KERNEL): New constants, introduced by Linux commit + v3.14-rc1~94^2~349. + + xlat: add values to adjtimex_state, adjtimex_status, advise xlats. + * xlat/adjtimex_state.in: Add values. + * xlat/adjtimex_status.in: Likewise. + * xlat/advise.in: Likewise. + + xlat: update adjtimex_modes. + * xlat/adjtimex_modes.in: Add values to constants. + (0): Remove. + (ADJ_OFFSET_SS_READ): Move to the first place. + (ADJ_OFFSET_SINGLESHOT): Move to the second place. + +2018-05-04 Dmitry V. Levin + + mmap_cache: do not activate unless requested. + Do not call mmap_cache functions until mmap_cache_enable is invoked. + Change struct mmap_cache_t into a proxy structure, move all mmap_cache + data from struct tcb inside this new structure. + + * Makefile.am (strace_SOURCES): Move mmap_cache.c and mmap_cache.h + to libstrace_a_SOURCES. + * defs.h (struct tcb): Remove mmap_cache_size and mmap_cache_generation + * fields. + * mmap_cache.h (struct mmap_cache_t): Rename + to struct mmap_cache_entry_t, create a new struct mmap_cache_t, + all users updated. + (mmap_cache_delete): Remove. + * mmap_cache.c (mmap_cache_delete): Rename to delete_mmap_cache, + add static qualifier. + (build_mmap_cache): Merge into mmap_cache_rebuild_if_invalid. + * strace.c (droptcb): Replace mmap_cache_delete invocation + with tcp->mmap_cache->free_fn. + +2018-05-03 Dmitry V. Levin + + mmap_cache: remove mmap_cache_is_enabled. + This function is no longer used and could be removed. + + * mmap_cache.c (mmap_cache_is_enabled): Remove. + * mmap_cache.h: Likewise. + +2018-05-03 Masatake YAMATO + + unwind-libdw: use the mmap_notify subsystem. + The unwind subsystem uses the mmap_cache subsystem even it uses + unwind-libdw as backend. unwind-libdw doesn't need the full set of the + mmap_cache subsystem; libdw has a feature for caching a memory + mapping. + + This commit does three things. + + (1) Make the unwind subsystem not use the mmap_cache subsystem. + The unwind subsystem never concern the memory mapping of the target. + It becomes a thin layer. + + (2) Make unwind-libunwind use the mmap_cache subsystem directly. + + (3) Make unwind-libdw use the mmap_notify subsystem to know when it + should call dwfl_linux_proc_report/dwfl_report_end for updating the + cache. + + Here is a subsystem structure that this patch + introduces: + + +-------------------------------------+ + | unwind subsys | + +------------------+------------------+ + | unwind-libunwind | unwind-libdw | + +------------------+------------------+ + | mmap_cache | | + +------------------+ | + | mmap_notify | + +-------------------------------------+ + | syscall | + +-------------------------------------+ + mmap/munmap/mprotect/brk... + + * unwind.c: Don't include "mmap_cache.h". + (unwind_init): Don't call mmap_cache_enable. + (unwind_tcb_print, unwind_tcb_capture): Don't call mmap_cache related + functions, just invoke unwinder.tcb_walk. + * unwind.h (struct unwind_unwinder_t): Remove tcb_flush_cache field. + + * unwind-libdw.c: Include "mmap_notify.h" instead of "mmap_cache.h". + (struct ctx): Add last_proc_updating field to record the generation + of memory mapping that is cached by dwfl_linux_proc_report + and dwfl_report_end. + (mapping_generation): A variable counting how many times the memory + mapping of targets has been changed. + (updating_mapping_generation): New utility function for updating + mapping_generation. + (init): New function for registering updating_mapping_generation + in the mmap_notify subsystem as a callback function. + (tcb_init): Initialize ctx::last_proc_updating. + (tcb_flush_cache): Rename to flush_cache_maybe. Rebuild the cache data + only if the data is stale. + (tcb_walk): Call flush_cache_maybe for avoiding referring staled cache data. + (unwinder): Set init function, remove tcb_flush_cache field. + * unwind-libunwind.c (init): Enable the mmap_cache subsystem. + (tcb_walk): Call mmap_cache_rebuild_if_invalid and unw_flush_cache for + updating the cache of the memory mapping before walking the stack. + (tcb_walk): Rename to walk. + (unwinder): Remove tcb_flush_cache field. + +2018-05-03 Masatake YAMATO + + unwind-libdw: introduce indirect data structure for storing unwinding context + unwind-libdw uses Dwfl as the data structure for storing unwinding + context. It is raw data that come from libdw. + + This commit introduces "struct ctx" file local data type for allowing + unwind-libdw to attach strace side data to the unwinding context. + + * unwind-libdw.c (struct ctx): New struct definition. + (tcb_init, tcb_fin, tcb_walk, tcb_flush_cache): Use struct ctx instead + of Dwfl directly. + +2018-05-03 Masatake YAMATO + + mmap_notify: rename the macro for tracking memory mapping. + * sysent.h (STACKTRACE_INVALIDATE_CACHE): Rename to + MEMORY_MAPPING_CHANGE. All users updated. + + mmap_cache: use the mmap_notify subsystem. + * mmap_cache.c: Include mmap_notify.h. + (mmap_cache_enable): Call mmap_notify_register_client to use + the mmap_notify subsystem, mmap_cache_invalidate is specified + to handle the change of memory mapping. + (mmap_cache_invalidate): Add static qualifier. + * mmap_cache.h (mmap_cache_invalidate): Remove. + * syscall.c: Include mmap_notify.h instead of mmap_cache.h. + (syscall_exiting_decode): Call mmap_notify_report instead + of mmap_cache_invalidate. + +2018-05-03 Masatake YAMATO + + mmap_notify: new subsystem for tracking the changes of memory mappings. + This subsystem is a spin-off of the mmap_cache subsystem. + + The mmap_cache subsystem had two features: (1) tracking the change + of memory mapping, and (2) maintaining the cache of memory mapping. + + mmap_notify is a subsystem specialized to provide feature (2). + unwind-libdw itself has the feature (1). It needs only (2). + + * mmap_notify.h: New file. + * mmap_notify.c: Likewise. + * Makefile.am (strace_SOURCES): Add them. + +2018-05-03 Eugene Syromyatnikov + + btrfs: add missing braces. + Reported by Coverity. + + * btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)) : Add missing braces. + + Fixes: v4.22-76-gf766447 "btrfs: use PRINT_FIELD_*" + +2018-05-03 Eugene Syromyatnikov + + strace.c: check return code of never failing fcntl call. + Because the kernel cannot be trusted. + + * strace.c (set_cloexec_flag): Call perror_msg_and_die if fcntl(F_SETFD) + has failed. + +2018-05-03 Eugene Syromyatnikov + + sock: use error_func_msg for printing function name. + * sock.c (decode_ifconf): Use error_func_msg instead of error_msg with + manual function name printing. + +2018-05-03 Eugene Syromyatnikov + + util.c: add len sanity checks to dumpstr. + Reported by clang. + + * util.c (dumpstr): Check that len is sane. + +2018-05-03 Eugene Syromyatnikov + + mmap_cache: fool-proofing build_mmap_cache. + Let's try to handle better the situation when build_mmap_cache is called + without mmap_cache/mmap_cache_size being reset prior to the call. + + Reported by Coverity scan. + + * mmap_cache.c (build_mmap_cache): Set cache_head to tcp->mmap_cache. + Reset tcp->mmap_cache_size to 0. + +2018-05-03 Eugene Syromyatnikov + + error_prints: add missing va_end() calls. + These missing va_end() calls are followed by die() calls that never + return, so the only practical effect of this change is appeasement + of code checking tools. + + Reported by cppcheck. + + * error_prints.c (error_msg_and_die, error_msg_and_help, + perror_msg_and_die): Add va_end(). + +2018-05-03 Eugene Syromyatnikov + + mem: handle potential error from sysconf(_SC_PAGESIZE) + Reported by Coverity scan. + + * mem.c (get_pagesize): Handle the case when sysconf(_SC_PAGESIZE) + returns an error. + +2018-05-03 Dmitry V. Levin + + xlat: merge fcntl64cmds into fcntlcmds. + Since we don't have to workaround old F_[GS]ETOWN_EX == F_[SG]ETLK64 + kernel bug any longer, there is a room for cleanup. + + * xlat/fcntlcmds.in (F_GETLK64, F_SETLK64, F_SETLKW64): Add from + xlat/fcntl64cmds.in. + * xlat/fcntl64cmds.in: Remove. + * fcntl.c: Do not include "xlat/fcntl64cmds.h". + (SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Do not use fcntl64cmds, call + printxval instead of printxvals. + +2018-05-03 Zhibin Li <08826794brmt@gmail.com> + + tests: check decoding of F_GETOWN_EX and F_SETOWN_EX fcntl commands. + * tests/fcntl.c (TEST_F_OWNER_EX): New macro. + [TEST_F_OWNER_EX]: Include "f_owner_ex.h". + [TEST_F_OWNER_EX] (test_f_owner_ex_type_pid, + test_f_owner_ex_umove_or_printaddr, test_f_owner_ex): New functions. + (main) [TEST_F_OWNER_EX]: Use test_f_owner_ex. + + Co-Authored-by: Dmitry V. Levin + +2018-05-03 Dmitry V. Levin + + Introduce f_owner_ex.h. + Some headers define struct f_owner_ex, some struct __kernel_f_owner_ex, + we have to support both variants. + + * configure.ac (AC_CHECK_TYPES): Check for "struct f_owner_ex" + and "struct __kernel_f_owner_ex" in . + * f_owner_ex.h: New file. + * Makefile.am (strace_SOURCES): Add it. + +2018-05-02 Masatake YAMATO + + tests/ioctl_kvm_run.c: handle cpuid at the end of vcpu dentry. + Since Linux 4.16, kernel appends the cpuid as suffix to the entry + for a kvm vcpu in /proc/$pid/fd like: + + anon_inode:kvm-vcpu:0 + + That was + + anon_inode:kvm-vcpu + + This kernel change causes the test case failure on newer kernels. + Update the test to deal with the new name as well as the old one. + + * tests/ioctl_kvm_run.c: Include unistd.h for using readlink(2). + (vcpu_dev_should_have_cpuid): New function for detecting whether + a proc entry for given fd has the cpuid suffix or not. + (main): Trim vcpu_dev to remove the cpuid suffix if needed. + (vcpu_dev): Remove const modifier. + +2018-04-29 Dmitry V. Levin + + xlat: check that system definitions match fallback definitions. + For each constant that is accompanied by a fallback definition, + generate a sanity check that the definition provided by system headers + matches the fallback definition. + + * gcc_compat.h (DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE, + DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE): New macros. + * xlat/gen.sh (cond_def): Generate a code that checks the system + definition against the default. + (gen_header): Generate a code that includes "gcc_compat.h" and + "static_assert.h". + + Co-Authored-by: Eugene Syromyatnikov + +2018-04-29 Dmitry V. Levin + + xlat: override values of F_SETOWN_EX and F_GETOWN_EX constants. + Linux kernel commit v2.6.32-rc7~23 has changed values of F_SETOWN_EX + and F_GETOWN_EX constants introduced by commit v2.6.32-rc1~96 to fix + the conflict with F_GETLK64 and F_SETLK64 constants. + + Looks like the best way to handle this situation is to pretend that + old values of F_SETOWN_EX and F_GETOWN_EX didn't exist. + + * xlat/fcntlcmds.in (F_SETOWN_EX, F_GETOWN_EX): Undefine. + +2018-04-29 Dmitry V. Levin + + xlat: fix F_* fallback definitions on alpha, hppa, mips, and sparc. + * xlat/fcntlcmds.in (F_GETLK, F_SETLK, F_SETLKW, F_SETOWN, F_GETOWN, + F_SETSIG, F_GETSIG) [alpha || hppa || mips || sparc]: Fix definitions. + * xlat/fcntl64cmds.in (F_GETLK64, F_SETLK64, F_SETLKW64) [hppa || mips]: + Likewise. + + xlat: fix SI_* fallback definitions on mips. + * xlat/siginfo_codes.in [mips] (SI_ASYNCIO, SI_TIMER, SI_MESGQ): Define + to -2, -3, and -4, respectively. + +2018-04-29 Dmitry V. Levin + + xlat: override values of KEY_RFKILL and KEY_BRIGHTNESS_MIN constants. + KEY_RFKILL and KEY_NUMERIC_A constants were introduced by Linux kernel + commits v2.6.33~17^2~2 and v4.1-rc1~150^2~1^10~6, respectively. + Apparently, RHEL6 introduced an alternative KEY_RFKILL constant + with the same value as upstream KEY_NUMERIC_A. + + KEY_BRIGHTNESS_MIN and KEY_BRIGHTNESS_MAX constants were introduced + by Linux kernel commit v3.16-rc1~30^2~6^2~1^2~7. + Apparently, RHEL7 introduced an alternative KEY_BRIGHTNESS_MIN constant + with the same value as upstream KEY_BRIGHTNESS_MAX. + + Downstream vendors are *not* allowed to do this. + Ignore the system value of KEY_RFKILL and KEY_BRIGHTNESS_MIN. + + * xlat/evdev_keycode.in (KEY_RFKILL, KEY_BRIGHTNESS_MIN): Undefine. + +2018-04-29 Dmitry V. Levin + + xlat: override the value of KEY_DATA constant. + Linux kernel commit v4.9-rc8~12^2 has changed the value of KEY_DATA + constant introduced by commit v4.7-rc6~32^2~6^2 because the old value + was already used by KEY_FASTREVERSE. + + Looks like the best way to handle this situation is to pretend that + the old value of KEY_DATA didn't exist. + + * xlat/evdev_keycode.in (KEY_DATA): Undefine. + +2018-04-29 Dmitry V. Levin + + xlat: override the value of AUDIT_FEATURE_CHANGE constant. + Linux kernel commit v3.15-rc1~18^2~1 has changed the value + of AUDIT_FEATURE_CHANGE constant introduced by commit v3.13-rc1~19^2~20 + which is of course an ABI breakage that affected 3.13 and 3.14 kernel + releases as well as their LTS derivatives. + + Linux kernel commit v3.15-rc1~18^2~1 also claims that the old value + of AUDIT_FEATURE_CHANGE was ignored by userspace because of the + established convention how netlink messages for the audit system + are divided into blocks. + + Looks like the best way to handle this situation is to pretend that + the old value of AUDIT_FEATURE_CHANGE didn't exist. + + * xlat/nl_audit_types.in (AUDIT_FEATURE_CHANGE): Undefine. + + Co-Authored-by: Eugene Syromyatnikov + +2018-04-29 Dmitry V. Levin + + xlat: fix MCL_* fallback definitions on alpha, ppc, ppc64, and sparc. + On these architectures, MCL_* constants are different. + + * xlat/socketlayers.in [__alpha__ || __powerpc__ || __powerpc64__ + || __sparc__] (MCL_CURRENT, MCL_FUTURE, MCL_ONFAULT): Define to 0x2000, + 0x4000, and 0x8000, respectively. + +2018-04-28 Eugene Syromyatnikov + + xlat: fix SOL_SOCKET fallback definition on alpha, hppa, mips, and sparc + On these architectures, SOL_SOCKET is 0xffff and not 1. + + * xlat/socketlayers.in [__alpha__ || __hppa__ || __mips__ || __sparc__] + (SOL_SOCKET): Define to 0xffff. + + Co-Authored-by: Dmitry V. Levin + +2018-04-28 Eugene Syromyatnikov + + tests: add more mount checks. + * tests/gen_tests.in (mount, mount-Xabbrev, mount-Xraw, mount-Xverbose): + Add -a33 option. + * tests/mount.c: Check printing of flags and pointers. + + Co-Authored-by: Dmitry V. Levin + +2018-04-28 Dmitry V. Levin + + tests: use sprintrc in mount test. + * tests/mount.c (main): Use sprintrc. + +2018-04-28 Eugene Syromyatnikov + + tests: add mount variants with different xlat verbosity levels. + * tests/mount-Xabbrev.c: New file. + * tests/mount-Xraw.c: Likewise. + * tests/mount-Xverbose.c: Likewise. + * tests/mount.c: Add handling of XLAT_RAW and XLAT_VERBOSE macros. + * tests/pure_executables.list: Add mount-Xabbrev, mount-Xraw, + and mount-Xverbose. + * tests/.gitignore: Likewise. + * tests/gen_tests.in (mount-Xabbrev, mount-Xraw, mount-Xverbose): New + tests. + + tests: add old_mmap variants with different xlat verbosity levels. + * tests/old_mmap-Xabbrev.c: New file. + * tests/old_mmap-Xraw.c: Likewise. + * tests/old_mmap-Xverbose.c: Likewise. + * tests/old_mmap.c (main): Add handling of XLAT_RAW and XLAT_VERBOSE + macros. + * tests/pure_executables.list: Add old_mmap-Xabbrev, old_mmap-Xraw, + and old_mmap-Xverbose. + * tests/.gitignore: Likewise. + * tests/gen_tests.in (old_mmap-Xabbrev, old_mmap-Xraw, + old_mmap-Xverbose): New tests. + +2018-04-28 Eugene Syromyatnikov + + tests: add mmap/mmap64 variants different xlat verbosity levels. + * tests/tests.h [!XLAT_RAW] (XLAT_RAW): Define. + [!XLAT_VERBOSE] (XLAT_VERBOSE): Likewise. + * tests/mmap-Xabbrev.c: New file. + * tests/mmap-Xraw.c: Likewise. + * tests/mmap-Xverbose.c: Likewise. + * tests/mmap64-Xabbrev.c: Likewise. + * tests/mmap64-Xraw.c: Likewise. + * tests/mmap64-Xverbose.c: Likewise. + * tests/mmap.c (main): Add handling of XLAT_RAW and XLAT_VERBOSE macros. + * tests/mmap.test: Add handling of optional test arguments that set + alignment and xlat verbosity options. + * tests/Makefile.am (mmap64_Xabbrev_CPPFLAGS, mmap64_Xraw_CPPFLAGS, + mmap64_Xverbose_CPPFLAGS): New variables, analogous to mmap64_CPPFLAGS. + * tests/pure_executables.list: Add mmap-Xabbrev, mmap-Xraw, + mmap-Xverbose, mmap64-Xabbrev, mmap64-Xraw, and mmap64-Xverbose. + * tests/.gitignore: Likewise. + * tests/gen_tests.in (mmap-Xabbrev, mmap-Xraw, mmap-Xverbose, + mmap64-Xabbrev, mmap64-Xraw, mmap64-Xverbose): New tests. + + Co-Authored-by: Dmitry V. Levin + +2018-04-27 Dmitry V. Levin + + Fix fallback definition of MSG_ZEROCOPY. + * xlat/msg_flags.in (MSG_ZEROCOPY): Set fallback definition to 0x4000000. + + Fixes: v4.21~316 ("Update MSG_* constants") + +2018-04-27 Dmitry V. Levin + + build: try to use _Static_assert if static_assert is not available. + * configure.ac: Check for _Static_assert if static_assert + is not available. + * static_assert.h [!HAVE_STATIC_ASSERT && HAVE__STATIC_ASSERT] + (static_assert): Define to _Static_assert. + +2018-04-27 Eugene Syromyatnikov + + printmode: add xlat style support to print_symbolic_mode_t. + * printmode.c (print_symbolic_mode_t): Set ifmt to an empty string, + print raw and decoded values based on current xlat_verbosity setting. + +2018-04-27 Eugene Syromyatnikov + + evdev: remove XT_NORMAL. + It is no longer used. + + * evdev.c (enum xlat_type) : Remove. + (printxval_dispatch) : Remove. + +2018-04-27 Eugene Syromyatnikov + + Switch to use of value-indexed xlats for evdev constants. + * xlat/evdev_abs.in: Add "#value_indexed" directive. + * xlat/evdev_autorepeat.in: Likewise. + * xlat/evdev_ff_status.in: Likewise. + * xlat/evdev_keycode.in: Likewise. + * xlat/evdev_leds.in: Likewise. + * xlat/evdev_misc.in: Likewise. + * xlat/evdev_prop.in: Likewise. + * xlat/evdev_relative_axes.in: Likewise. + * xlat/evdev_snd.in: Likewise. + * xlat/evdev_switch.in: Likewise. + * xlat/evdev_sync.in: Likewise. + * xlat/evdev_ff_types.in: Add a comment about sorting. + * evdev.c (keycode_ioctl, keycode_V2_ioctl): Use printxval_index + instead of printxval. + (bit_ioctl): Use XT_SORTED for evdev_ff_types, use XT_INDEXED + for other xlats. + (evdev_read_ioctl): Use XT_INDEXED for all xlats. + * ioctl.c (evdev_decode_number): Use printxval_indexn instead of + printxval for evdev_abs. + + evdev: support various types of xlats in decode_bitset. + * evdev.c (enum xlat_type): New enumeration. + (printxval_dispatch): New function. + (decode_bitset_): Rename from decode_bitset, add decode_nr_size + and xt arguments, call printxval_dispatch instead of printxval. + (decode_bitset): Add a decode_bitset_ wrapper that derives + decode_nr_size from the ARRAY_SIZE of decode_nr. + (bit_ioctl, evdev_read_ioctl): Update decode_bitset calls. + +2018-04-27 Eugene Syromyatnikov + + Move xlat/evdev_abs.h inclusion from ioctl.c to evdev.c. + Also introduce evdev_abs_size constant, which will be needed later. + + * defs.h (evdev_abs_size): New declaration. + * ioctl.c: Move xlat/evdev_abs.h inclusion ... + * evdev.c: ... here. + (evdev_abs_size): New constant variable. + +2018-04-27 Eugene Syromyatnikov + + Add support for value-indexed xlats. + There are quite a few xlats that start from 0 and not too sparse, + we can push the search time for them down to O(1). + + * defs.h (printxval_indexn_ex): New declaration. + (printxval_indexn, printxval_index, printxval_index_ex): New macros. + * xlat.c (printxval_sized): Rename from printxval_searchn_ex, + add fn argument, call it instead of xlat_search. + (printxval_searchn_ex): Implement as a thin wrapper around + printxval_sized using xlat_search as a search function. + (xlat_idx): New function. + (printxval_indexn_ex): New function, a thin wrapper around + printxval_sized using xlat_idx as a search function. + * xlat/gen.sh: Add support for "#value_indexed" directive. + +2018-04-27 Eugene Syromyatnikov + + socketcall: use printxval_d for printing call argument. + * socketcall.c (SYS_FUNC(socketcall)): Use printxval_d instead of manual + call argument decoding. + + signal: use print_xlat_ex in print_sa_handler. + * signal.c (print_sa_handler): Call print_xlat_ex instead of tprints + in order to respect current xlat style setting. + + s390: use printxvals_ex for command printing in s390_runtime_instr. + * s390.c (SYS_FUNC(s390_runtime_instr)): Replace manual command argument + decoding with a printxvals_ex call. + +2018-04-27 Eugene Syromyatnikov + + printsiginfo: use print_xlat_ex in print_si_code. + In order to respect current xlat style setting. + + * printsiginfo.c (print_si_code): Use print_xlat_ex instead of manual + string/value printing. + +2018-04-27 Eugene Syromyatnikov + + open: use print_xlat_ex for printing open modes. + In order to respect xlat style setting. + + * open.c (tprint_open_modes): Use print_xlat_ex instead of + tprint_open_modes. + +2018-04-27 Eugene Syromyatnikov + + netlink: use print_xlat_ex in decode_nlmsg_type_netfilter. + In order to respect current xlat style setting. + + * netlink.c (decode_nlmsg_type_netfilter): Use print_xlat_ex + instead of tprints. + +2018-04-27 Eugene Syromyatnikov + + net: use print_xlat_ex in tprint_sock_type. + In order to respect current xlat style setting. + + * next.c (tprint_sock_type): Use print_xlat_ex instead of tprints + for socket type printing. + +2018-04-27 Eugene Syromyatnikov + + keyctl: use printxval_d for printing keyring serial number. + * keyctl.c (print_keyring_serial_number): Use printxval_d instead of + looking up and printing xlat value manually. + * xlat/key_spec.in: Add "#val_type int" so the xlat values have sign + bit propagated. + + ipc: use printxval_u instead of manual xlat value printing. + * ipc.c (SYS_FUNC(ipc)): Decode call argument using printxval_u. + +2018-04-27 Eugene Syromyatnikov + + ioprio: use sprintxval instead of xlookup and string/value printing. + In order to respect current xlat style. + + * ioprio.c (sprint_ioprio): Use sprintxval for producing string + representation of ioprio class, use the produced string representation + in resulting xsprintf. + +2018-04-27 Eugene Syromyatnikov + + xlat: handle NULL str in print_xlat_ex. + It allows to use the following code pattern: + + print_xlat_ex(val, xlookup(xlat, val), XLAT_STYLE_FMT_D); + + * xlat.c (print_xlat_ex): Handle str being NULL: print val instead. + + Co-Authored-by: Dmitry V. Levin + +2018-04-26 Eugene Syromyatnikov + + strace.1.in: fix typo (Ronald -> Roland) + A very unfortunate one, though. + + NEWS: mention that -X option addresses Debian bug #692915. + +2018-04-25 Eugene Syromyatnikov + + ioctl: do not include linux/input.h. + All the ABS_* and EV_* values are now available internally, + there's no need to include the header. + + * ioctl.c [HAVE_LINUX_INPUT_H]: Do not include linux/input.h. + +2018-04-25 Eugene Syromyatnikov + + tests: add more evdev ioctl checks. + tests/ioctl_evdev.c (TEST_NULL_ARG_EX): Rename from TEST_NULL_ARG, add + str argument, print it instead of #cmd. + (TEST_NULL_ARG): Implement as a TEST_NULL_ARG_EX wrapper. + (main): Add checks for EVIOCSABS and EVIOCGBIT ioctls. + + evdev: decode EV_SW unconditionally. + * evdev.c (bit_ioctl): Remove [EV_SW] check. + * tests/ioctl_evdev.c [!EV_SW] (EV_SW): Define. + (main): Remove [EV_SW] check. + +2018-04-25 Eugene Syromyatnikov + + xlat: provide fallback definitions for arch-independent evdev constants. + * xlat/evdev_abs.in: Add constant values. + * xlat/evdev_autorepeat.in: Likewise. + * xlat/evdev_ev.in: Likewise. + * xlat/evdev_ff_status.in: Likewise. + * xlat/evdev_ff_types.in: Likewise. + * xlat/evdev_leds.in: Likewise. + * xlat/evdev_misc.in: Likewise. + * xlat/evdev_prop.in: Likewise. + * xlat/evdev_relative_axes.in: Likewise. + * xlat/evdev_snd.in: Likewise. + * xlat/evdev_switch.in: Likewise. + * xlat/evdev_sync.in: Likewise. + + Co-Authored-by: Dmitry V. Levin + +2018-04-25 Eugene Syromyatnikov + + xlat/evdev_switch.in: update. + * xlat/evdev_switch.in (SW_RADIO): Remove, as it was renamed to + SW_RFKILL_ALL and marked as deprecated by Linux commit v2.6.26-rc5~32^2. + (SW_PEN_INSERTED): New constant, was added by Linux commit v4.7~11^2~7. + +2018-04-24 Eugene Syromyatnikov + + util.c: make "Out of memory" messages a bit more informative. + Since these are emitted in multiple places and are not expected during + any normal operation, it makes sense to report the caller name. + + * util.c (print_quoted_string_ex, print_quoted_string_ex, dumpiov_upto, + dumpstr): Replace error_msg with error_func_msg. + +2018-04-24 Eugene Syromyatnikov + + ci: reorder travis jobs. + Run coverage check first as it is the longest one. + + * .travis.yml (matrix): Reorder. + +2018-04-24 Eugene Syromyatnikov + + xlat: add MS_SUBMOUNT constant. + * xlat/mount_flags.in (MS_SUBMOUNT): New constant, introduced + by Linux commit v4.11-rc1~82^2~7. + +2018-04-24 Eugene Syromyatnikov + + fcntl: replace combinations of xlookup and printxval with printxvals. + After all, that's what printxvals for. + + * fcntl.c (SYS_FUNC(fcntl), SYS_FUNC(fcntl64)): Use printxvals for + printing value with multiple xlat tables as constant sources. + +2018-04-24 Eugene Syromyatnikov + + Move xlat_verbose and xlat_format from xlat.c to defs.h. + As it will be used elsewhere. + + * xlat.c (xlat_verbose, xlat_format): Move... + * defs.h: ...here. + +2018-04-20 Eugene Syromyatnikov + + btrfs: use printxval_u for error types printing. + * btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)) : Use printxval_u for error type printing. + * tests/btrfs.c (btrfs_test_get_dev_stats_ioctl): Update expected output. + + btrfs: print device IDs using PRINT_FIELD_DEV. + * btrfs.c (btrfs_print_balance_args): Print devid field using + PRINT_FIELD_DEV. + (MPERS_PRINTER_DECL(btrfs_ioctl)) : Likewise. + (MPERS_PRINTER_DECL(btrfs_ioctl)) : Print + start.srcdevid field using PRINT_FIELD_DEV. + * tests/btrfs.c: Update expected output. + + btrfs: print cont_reading_from_srcdev_mode as xlat. + * xlat/btrfs_cont_reading_from_srcdev_mode.in: New file. + * btrfs.c: Include "xlat/btrfs_cont_reading_from_srcdev_mode.h". + (MPERS_PRINTER_DECL(btrfs_ioctl)) : Print + named values for the + struct btrfs_ioctl_dev_replace_args.start.cont_reading_from_srcdev_mode + field. + * tests/btrfs.c: Include "xlat/btrfs_cont_reading_from_srcdev_mode.h". + (btrfs_test_dev_replace_ioctl): Update expected output. + + btrfs: use PRINT_FIELD_* + * btrfs.c (btrfs_print_balance_args, btrfs_print_balance, + btrfs_print_features, btrfs_print_qgroup_limit, + btrfs_print_data_container_header, + print_btrfs_data_container_logical_ino, btrfs_print_qgroup_inherit, + btrfs_print_tree_search, print_btrfs_ioctl_space_info, btrfs_ioctl): + Use PRINT_FIELD_* macros for printing structure fields. + + btrfs: make BTRFS_IOC_GET_DEV_STATS error statistics output more structured + * btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)) : Print array index in square brackets before + the value in order to avoid confusion. + * tests/btrfs.c (btrfs_test_get_dev_stats_ioctl): Update expected output. + + ioctl: print ioctl number in accordance with xlat verbosity setting. + * ioctl.c (SYS_FUNC(ioctl)): Print ioctl command name in accordance + with the current xlat_verbosity setting. + * tests/btrfs.c (sprint_xlat_): New function. + (ioc): New macro, a wrapper for sprint_xlat_. + Update expected output. + + file_ioctl: make abbreviated output more structured. + * file_ioctl.c (file_ioctl): Print fm_extents field name only in case + of non-abbreviated output. + * tests/btrfs.c (btrfs_test_ino_path_ioctls): Update expected output. + +2018-04-20 Eugene Syromyatnikov + + btrfs: fix printing of struct btrfs_ioctl_quota_ctl_args. + For some reason, he decoder of BTRFS_IOC_QUOTA_CTL command didn't print + opening curly brace and field name, only the closing curly brace. + + * btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)) : + Print "{cmd=". + * tests/btrfs.c (btrfs_test_quota_ctl_ioctl): Update expected output. + + Fixes: v4.12~100 "ioctl: add decoding support for btrfs ioctls" + +2018-04-20 Eugene Syromyatnikov + + btrfs: consistently use PRINT_FIELD_U64. + * btrfs.c (print_u64, print_member_u64, print_key_value_internal, + print_key_value): Remove. + (btrfs_print_balance_args): Use PRINT_FIELD_U64 instead of + print_member_u64. + (btrfs_print_tree_search): Use PRINT_FIELD_U64 instead of + print_key_value. + (MPERS_PRINTER_DECL(btrfs_ioctl)): Use PRINT_FIELD_U64 instead of manual + UINT64_MAX printing. + * tests/btrfs.c: Update expected output in order to account fields that + are now affected by xlat_verbosity setting. + +2018-04-20 Eugene Syromyatnikov + + btrfs: print {min,max}_{offset,transid} unconditionally. + As it looks like there's no reason to skip their printing. + + * btrfs.c (print_key_value_internal): Do not check value argument + for holding non-zero value. + * tests/btrfs.c (btrfs_print_search_key): Update expected output. + +2018-04-20 Eugene Syromyatnikov + + tests/btrfs.c: accept possible failure of BTRFS_IOC_BALANCE_V2. + BTRFS_IOC_BALANCE_V2 ioctl might fail sometimes (for example, if it + decides that it doesn't have enough free space). + + * tests/btrfs.c (btrfs_test_balance_ioctls): Print expected output for + the BTRFS_IOC_BALANCE_V2 call based on its return code. + +2018-04-20 Eugene Syromyatnikov + + tests/btrfs.c: support volumes with mixed data/metadata in BTRFS_IOC_BALANCE_V2 + For these volumes, pend/vend should be the same for data and meta. + + * tests/btrfs.c (btrfs_test_balance_ioctls): Set args.meta.pend and + args.meta.vend to the same values as args.data.pend and args.data.vend, + respectively. + +2018-04-20 Eugene Syromyatnikov + + tests/btrfs.c: check BTRFS_IOC_SUBVOL_CREATE_V2 result. + Otherwise the subsequent openat call fails with a cryptic message. + + * tests/btrfs.c (btrfs_test_subvol_ioctls): Check return code of the + BTRFS_IOC_SUBVOL_CREATE_V2 ioctl call that is supposed to be successful. + +2018-04-20 Eugene Syromyatnikov + + tests/btrfs.c: add pid suffix to the created directory, remove it on exit + If multiple tests are running simultaneously in the same directory, + conflicts (and test failures) may happen. + + * tests/btrfs.c (path, dir_name_fmt, dir_name): New variables. + (btrfs_test_ino_path_ioctls): Use dir_name for printing directory name. + (rm_test_dir): New function. + (main): Generate dir_name, use it instead of fixed name, add rm_test_dir + as an atexit handler. + +2018-04-20 Eugene Syromyatnikov + + btrfs: duplicate printing of opening braces on entering/exiting. + * btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)): Print opening bracket + on entering and exiting separately. + + btrfs: refactor timespec printing into print_btrfs_timespec. + * btrfs.c (print_btrfs_timespec): New function. + (MPERS_PRINTER_DECL(btrfs_ioctl)) : + Use print_btrfs_timespec for printing stime and rtime fields. + * tests/btrfs.c (btrfs_test_set_received_subvol_ioctl): Update expected + output. + + btrfs: print abbreviations and field names more consistently. + * btrfs.c (btrfs_print_data_container_header): Do not print ", val=". + (btrfs_print_ino_path_container): Print val field name only in case + of non-abbreviated output. + (btrfs_print_qgroup_inherit): Print qgroups field name only in case + of non-abbreviated output. + (btrfs_print_tree_search): Print buf field name only in case + of non-abbreviated output. + (MPERS_PRINTER_DECL(btrfs_ioctl)) : Print + clone_sources field name only in case of non-abbreviated output. + (MPERS_PRINTER_DECL(btrfs_ioctl)) : Print + spaces field name only in case of non-abbreviated output. + * tests/btrfs.c: Update expected output. + + btrfs: move printing of the field name inside btrfs_print_qgroup_limit. + * btrfs.c (btrfs_print_qgroup_limit): Print ", lim=". + (btrfs_print_qgroup_inherit, MPERS_PRINTER_DECL(btrfs_ioctl)): Do not + print ", lim=" before btrfs_print_qgroup_limit call. + + btrfs: convert btrfs_print_{objectid,key_type} to PRINT_FIELD_XVAL_U. + * btrfs.c (btrfs_print_key_type, btrfs_print_objectid): Convert into + thin wrappers around PRINT_FIELD_XVAL_U. + (btrfs_print_data_container_header, btrfs_print_tree_search, + MPERS_PRINTER_DECL(btrfs_ioctl)): Update calls to btrfs_print_key_type + and btrfs_print_objectid in accordance with the new calling convention. + (print_objectid_callback): Use printxvals_ex directly instead of + btrfs_print_objectid call. + * tests/btrfs.c (btrfs_print_objectid, btrfs_print_key_type): Update + expected output. + + tests: add btrfs tests with verbose xlat decoding. + * tests/btrfs-X.test: New test. + * tests/btrfs-vX.test: Likewise. + * tests/btrfs-vwX.test: Likewise. + * tests/btrfs-wX.test: Likewise. + * tests/Makefile.am (DECODER_TESTS): Add them. + * tests/btrfs.c (verbose_xlat): New static variable. + (prfl_btrfs, prxval_btrfs): New function. + (btrfs_print_qgroup_inherit, btrfs_print_vol_args_v2, + btrfs_print_balance_args, btrfs_test_balance_ioctls, + btrfs_test_clone_ioctls, btrfs_test_defrag_ioctls, + btrfs_test_space_info_ioctl, btrfs_print_defrag_range_args, + btrfs_test_scrub_ioctls, btrfs_test_ino_path_ioctls, + btrfs_test_send_ioctl, btrfs_test_send_ioctl, + btrfs_test_quota_ctl_ioctl, btrfs_test_get_dev_stats_ioctl, + btrfs_test_get_dev_stats_ioctl, btrfs_test_dev_replace_ioctl, + btrfs_test_dev_replace_ioctl, btrfs_print_features): Use prfl_btrfs and + prxval_btrfs instead of printflags and printxval, respectively. + (btrfs_test_balance_ioctls, btrfs_test_ino_path_ioctls, + btrfs_test_quota_ctl_ioctl, btrfs_test_dev_replace_ioctl, + btrfs_test_dev_replace_ioctl): Update expected output based on + verbose_xlat setting. + (btrfs_print_defrag_range_args): Add compress_type_known arg, pass it + to prxval_btrfs. + (main): Handle -X option. + +2018-04-20 Eugene Syromyatnikov + + tests: check -X option syntax. + * tests/options-syntax.test: Add checks for -X option with invalid + arguments. + + Co-Authored-by: Dmitry V. Levin + +2018-04-20 Eugene Syromyatnikov + + Add user interface for configuring xlat output style. + * strace.c (init): Handle -X option, set xlat_verbosity + according to -X argument. + * strace.1.in: Document -X option. + * NEWS: Mention it. + + Closes: https://github.com/strace/strace/issues/27 + Co-Authored-by: Dmitry V. Levin + +2018-04-20 Eugene Syromyatnikov + + bpf: print fields that interpreted as pointers using printaddr64. + * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_LOOKUP_ELEM), + BEGIN_BPF_CMD_DECODER(BPF_MAP_UPDATE_ELEM)): Print key and value + fields using PRINT_FIELD_ADDR64. + (BEGIN_BPF_CMD_DECODER(BPF_MAP_DELETE_ELEM)): Print key field using + PRINT_FIELD_ADDR64. + (BEGIN_BPF_CMD_DECODER(BPF_MAP_GET_NEXT_KEY)): Print key and next_key + field using PRINT_FIELD_ADDR64. + (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Print insns and log_buf fields + using PRINT_FIELD_ADDR64. + (BEGIN_BPF_CMD_DECODER(BPF_PROG_TEST_RUN)): Print data_in and data_out + fields using PRINT_FIELD_ADDR64. + * tests/bpf.c: Update expected output. + +2018-04-20 Dmitry V. Levin + + build: make it even more reproducible. + * Makefile.am (today): Consistently print the UTC date in C locale. + * configure.ac (RPM_CHANGELOGTIME, DEB_CHANGELOGTIME): Likewise. + * maint/update_copyright_years.sh: Likewise. + * copyright-year-gen: Likewise. When $SOURCE_DATE_EPOCH is non-empty, + use it as fallback date before the current system date. + + References: https://github.com/strace/strace/pull/68 + +2018-04-19 Dmitry V. Levin + + unwind: move unwind_tcb_init invocation to after_successful_attach. + There is no need to call unwind_tcb_init before the tracee is attached. + + * strace.c (alloctcb) [ENABLE_STACKTRACE]: Move unwind_tcb_init + invocation ... + (after_successful_attach) [ENABLE_STACKTRACE]: ... here. + (init) [ENABLE_STACKTRACE]: Remove unwind_tcb_init invocation loop. + * unwind.c (unwind_tcb_fin): Skip if tcp->unwind_queue is NULL. + +2018-04-19 Dmitry V. Levin + + strace: move setting of post-attach flags inside after_successful_attach + * strace.c (after_successful_attach): Add "flags" argument. + Set TCB_ATTACHED, TCB_STARTUP, and "flags" in tcp->flags. + All users updated. + +2018-04-19 Dmitry V. Levin + + strace: rename newoutf to after_successful_attach. + This function is going to be used for other things that have to be done + right after a successful attach, hence the rename. + + * strace.c (newoutf): Rename to after_successful_attach, + all users updated. + +2018-04-19 Dmitry V. Levin + + unwind: remove stray newline in error diagnostics. + * unwind-libdw.c (tcb_init): Do not pass trailing "\n" to error_msg + as the latter prints newline itself. + +2018-04-19 Dmitry V. Levin + + build: make it more reproducible. + * file-date-gen: Consistently print the UTC date in C locale. + When $SOURCE_DATE_EPOCH is non-empty, use it as fallback date + before the current system date. + + Reported-by: Chris Lamb + Closes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=896016 + Closes: https://github.com/strace/strace/pull/68 + +2018-04-19 Masatake YAMATO + + unwind: initialize unwind context only if given tcb is initialized. + With libdw based unwinder, following warnings are reported + when -p is passed before -k: + + $ ./strace -p 1 -k + ... + ./strace: dwfl_linux_proc_attach returned an error for process 0: No such file or directory + ... + + It seems that commit 54c7792b, "Fix libunwind segfault when -p is + passed before -k" doesn't fix the original issue. + + * strace.c (init) [ENABLE_STACKTRACE]: Initialize unwind context only + if given tcb is initialized. + +2018-04-12 Dmitry V. Levin + + bpf: harmonize length checks. + The rest of the decoder uses offsetof to check the length. + + * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_OBJ_PIN), + BEGIN_BPF_CMD_DECODER(BPF_PROG_GET_NEXT_ID), + BEGIN_BPF_CMD_DECODER(BPF_PROG_GET_FD_BY_ID), + BEGIN_BPF_CMD_DECODER(BPF_MAP_GET_FD_BY_ID)): Use offsetof instead + of offsetofend. + +2018-04-12 Eugene Syromyatnikov + + bpf: add support for map_name and map_ifindex fields in BPF_MAP_CREATE. + * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)): Decode map_name + and map_ifindex fields that were added in Linux commits + v4.15-rc1~84^2~605^2~3 and v4.16-rc1~123^2~145^2~5^2~8, respectively. + * bpf_attr.h (struct BPF_MAP_CREATE_struct): Add map_name + and map_ifindex fields. + * tests/bpf.c (init_BPF_MAP_CREATE_attr7): New function. + (BPF_MAP_CREATE_checks): Remove const qualifier, add two more checks. + + bpf: improve handling of various sizes of BPF_MAP_CREATE attributes. + * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)): Skip printing + the rest of the structure if len is less than the offset of the end + of max_entries, map_flags, or inner_map_fd field. + * tests/bpf.c (BPF_MAP_CREATE_checks): Add two more checks. + + tests: add checks for bpf BPF_MAP_CREATE arguments. + * tests/bpf.c (BPF_MAP_CREATE_checks): Add two more checks. + +2018-04-12 Eugene Syromyatnikov + + bpf: print numa_node using xlat. + As the value of -1 has a special meaning. The issue is complicated + by the fact that this constant is not exported by UAPI. + + * xlat/numa_node.in: New file. + * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE)): Print numa_node field + using printxvals_ex with a special xlat style. + +2018-04-12 Eugene Syromyatnikov + + btrfs: use umove_or_printaddr_ignore_syserror instead of u_error mangling + * btrfs.c (MPERS_PRINTER_DECL(btrfs_ioctl)) : Use umove_or_printaddr_ignore_syserror + instead of tcp->u_error mangling around umove_or_printaddr call. + + defs.h: introduce umove_or_printaddr{,64}_ignore_syserror wrappers. + * defs.h (umove_or_printaddr64_ignore_syserror): New macro, a thin + wrapper around umoven_or_printaddr64_ignore_syserror. + (umove_or_printaddr_ignore_syserror): New macro, a thin wrapper around + umoven_or_printaddr_ignore_syserror. + + print_fields.h: add PRINT_FIELD_XVAL_U for printing xlat in %u format. + * print_fields.h (PRINT_FIELD_XVAL_U): New macro. + + print_fields.h: add PRINT_FIELD_U64 for printing u64 with UINT64_MAX handling + * print_fields.h (PRINT_FIELD_U64): New macro. + +2018-04-12 Eugene Syromyatnikov + + bpf_sock_filter: use print_xlat32. + We can't simply use print_xlat here due to the way those SKF_*_OFF + constants are defined. + + * bpf_sock_filter.c (print_sock_filter_k): Use print_xlat32 for printing + SKF_AD_OFF, SKF_NET_OFF, and SKF_LL_OFF named constants. + +2018-04-12 Eugene Syromyatnikov + + defs.h: add print_xlat32 macro. + For those cases where inadvertent sign extension is possible. + + * defs.h (print_xlat32): New macro, a wrapper for print_xlat_ex. + +2018-04-12 Eugene Syromyatnikov + + open: use print_xlat_d in print_dirfd. + * open.c (print_dirfd): Use print_xlat_d for printing AT_FDCWD named + constant. + + fanotify: use print_xlat_d. + * fanotify.c (SYS_FUNC(fanotify_mark)): Use print_xlat_d for printing + FAN_NOFD named constant. + +2018-04-12 Eugene Syromyatnikov + + Add print_xlat_u and print_xlat_d shorthands. + Add variants of print_xlat with various value printing formats. + + * defs.h (print_xlat_u, print_xlat_d): New macro, a wrapper for + print_xlat_ex. + +2018-04-12 Eugene Syromyatnikov + + xlat: introduce XLAT_STYLE_FMT_D. + As there are some possible users for it, apparently. + + * defs.h (XLAT_STYLE_FORMAT_MASK): Update the value in order to + accommodate XLAT_STYLE_FMT_D. + (enum xlat_style) : New enumeration entity. + (printxval64_d, printxval_d): New function, a shorthand for + printxvals_ex with a single xlat and XLAT_STYLE_FMT_D xlat style. + * xlat.c (sprint_xlat_val): Handle XLAT_STYLE_FMT_D. + +2018-04-12 Eugene Syromyatnikov + + defs.h: add shorthands for printing xval with XLAT_STYLE_FMT_U. + * defs.h (printxval_u, printxval64_u): New function, a shorthand for + printxvals_ex with a single xlat and XLAT_STYLE_FMT_U as a style. + +2018-04-12 Eugene Syromyatnikov + + Add support for various xlat formats. + Since xlat printing routines now have a notion of "style" that should be + used for printing xlat values, we can also employ this argument for + passing information about number printing format (unsigned decimal + or hexadecimal, so far). + + * defs.h (XLAT_STYLE_FORMAT_SHIFT, XLAT_STYLE_FORMAT_MASK): New macro + constant. + (enum xlat_style) : New enumeration + entities. + * xlat.c (xlat_verbose, xlat_format): New macro for checking specific + aspect of style argument. + (get_xlat_style): Use xlat_verbose for checking xlat verbosity style. + (sprint_xlat_val, print_xlat_val): New function, for easing printing + raw constant number with respect to printing format style. + (printxvals_ex, sprintxval_ex, printxval_searchn_ex, + printxval_searchn_ex, sprintflags_ex, printflags_ex, print_xlat_ex): + Use xlat_verbose macro for xlat verbosity style checks. Use + print_xlat_val instead of direct raw xlat value printing. + +2018-04-12 Eugene Syromyatnikov + + v4l2: use print_xlat in print_v4l2_queryctrl. + * v4la.c (print_v4l2_queryctrl): Use print_xlat for printing + V4L2_CTRL_FLAG_NEXT_CTRL named constant. + +2018-04-12 Eugene Syromyatnikov + + prctl: use print_xlat_ex to print PR_SET_PTRACER_ANY. + We cannot simply use print_xlat as PR_SET_PTRACER_ANY is defined + differently in kernel headers. + + * prctl.c (SYS_FUNC(prctl)) : Use print_xlat_ex + for printing PR_SET_PTRACER_ANY named constant. + +2018-04-12 Eugene Syromyatnikov + + nlattr: use print_xlat. + * nlattr.c (print_nlattr): Use print_xlat for printing NLA_F_NESTED and + NLA_F_NET_BYTEORDER named constants. + + ipc_defs.h: use print_xlat. + * ipc_defs.h (PRINTCTL): Use print_xlat for printing IPC_64 named + constant. + + futex: use print_xlat. + * futex.c [!FUTEX_OP_OPARG_SHIFT] (FUTEX_OP_OPARG_SHIFT): New macro + constant. + (SYS_FUNC(futex)): Use print_xlat for printing FUTEX_OP_OPARG_SHIFT + named constant. + +2018-04-12 Eugene Syromyatnikov + + ipc: use printxval for printing key. + Convert explicit constant printing logic into a printxval call in order + to account for xlat style setting. + + * defs.h (ipc_private): New xlat array declaration. + * ipc_msg.c (SYS_FUNC(msgget)): Use printxval for printing IPC_PRIVATE. + * ipc_sem.c (SYS_FUNC(semtimedop)): Likewise. + * ipc_shm.c (SYS_FUNC(shmget)): Likewise. + * xlat/ipc_private.in: New file. + +2018-04-12 Eugene Syromyatnikov + + mount: use print_xlat for printing MS_MGC_VAL. + * mount.c (SYS_FUNC(mount)): Use print_xlat for printing MS_MGC_VAL + named constant. + +2018-04-12 Eugene Syromyatnikov + + Introduce print_xlat and print_xlat_ex. + print_xlat_ex prints a named constant in accordance with xlat style + provided, print_xlat is a thin wrapper around print_xlat_ex that passes + stringified constant name as a string and XLAT_STYLE_DEFAULT as a style. + + * defs.h (print_xlat_ex): New function prototype. + (print_xlat): New macro, a thin wrapper around print_xlat_ex. + * xlat.c (print_xlat_ex): New function. + + Co-Authored-by: Dmitry V. Levin + +2018-04-12 Eugene Syromyatnikov + + Introduce XLAT_STYLE_DEFAULT. + This will be needed later, with the introduction of user-configurable + xlat style setting (stored in xlat_verbosity variable). + + * defs.h (XLAT_STYLE_VERBOSITY_MASK): New macro constant. + (enum xlat_style) : New enumeration entity. + (xlat_verbosity): New external declaration. + (printxvals, printxval_searchn, printxval_search_ex, sprintxval, + sprintflags, printflags64): Use XLAT_STYLE_DEFAULT instead of + XLAT_STYLE_ABBREV. + * strace.c (xlat_verbosity): New variable. + * xlat.c (get_xlat_style): New function. + (printxvals_ex, sprintxval_ex, printxval_searchn_ex, sprintflags_ex, + printflags_ex): Use it. + +2018-04-12 Eugene Syromyatnikov + + Introduce xlat verbosity styles. + * defs.h (printxvals_ex): Rename from printxvals, add style argument. + (enum xlat_style): New enumeration. + (printxvals): New macro, a wrapper for printxvals_ex. + (printxval_searchn_ex): Rename from printxval_searchn, add style + argument. + (printxval_searchn): New macro, a wrapper for printxval_searchn_ex. + (printxval_search_ex): New macro, a wrapper for printxval_searchn_ex. + (sprintxval_ex): Rename from sprintxval, add style argument. + (sprintxval): New macro, a wrapper for sprintxval_ex. + (printflags_ex): Add style argument. + (sprintflags_ex): Rename from sprintflags, add style argument. + (sprintflags): New macro, a wrapper for sprintflags_ex. + (printflags64): Pass XLAT_STYLE_ABBREV as a style in printflags_ex call. + * netlink.c (decode_nlmsg_flags): Pass XLAT_STYLE_ABBREV as a style in + printflags_ex call. + * xlat.c (printxvals_ex): Rename from printxvals, add style argument, + handle it. + (sprintxval_ex): Rename from sprintxval, add style argument, handle it. + (printxval_searchn_ex): Rename from printxval_searchn, add style + argument, handle it. + (sprintflags_ex): Rename from sprintflags, add style argument, + handle it. + (printflags_ex): Add style argument, handle it. + + Co-Authored-by: Dmitry V. Levin + References: https://github.com/strace/strace/issues/27 + +2018-04-11 Dmitry V. Levin + + tests: robustify signal delivery test against kernel bugs. + Recent kernel siginfo changes, namely, v4.14-rc1~60^2^2~1, + v4.16-rc1~159^2~37, and v4.16-rc1~159^2~39, introduced ABI regressions + that render the whole siginfo interface unreliable. + + Looks like the kernel side is not eager to fix the breakage, + so here is a workaround. + + * tests/signal_receive.c (s_sig, s_code, s_pid, s_uid): New volatile + variables. + (handler): Add siginfo_t parameter, save siginfo_t fields. + (sig_print): Remove. + (main): Rewrite. Use variables saved by handler to print expected + siginfo output. Print diagnostics in case of siginfo mismatch. + * strace.spec.in (%check): Extract the diagnostics. + + Closes: https://github.com/strace/strace/issues/21 + +2018-04-11 Dmitry V. Levin + + Lift experimental status from stack tracing feature. + * strace.1.in (.SH OPTIONS) <.B \-k>: Remove " (experimental)". + * strace.c (usage) [ENABLE_STACKTRACE]: Likewise. + +2018-04-11 Dmitry V. Levin + + Enable stack tracing in packages on all architectures. + The stack tracing feature used to be enabled in packages on x86_64 only. + This change enables -k option on all architectures. + + * debian/control (Build-Depends) [!amd64]: Add pkg-config, libdw-dev, + and libiberty-dev. + * strace.spec.in (BuildRequires) [!x86_64]: Add + %buildrequires_stacktrace. + +2018-04-11 Dmitry V. Levin + + Use libdw-based unwinder in ci and packages. + * ci/install-dependencies.sh (common_packages): Add pkg-config, + replace libunwind8-dev with libdw-dev. + * debian/control (Build-Depends) [amd64]: Add pkg-config, + replace libunwind-dev with libdw-dev. + * debian/rules (build-udeb/Makefile): Replace --without-libunwind + with --without-stacktrace. + * strace.spec.in (buildrequires_libunwind_devel): Rename + to buildrequires_stacktrace, replace libunwind-devel with + either elfutils-devel or libdw-devel. + + tests: skip -k tests on unsupported architectures. + * tests/strace-k.test: When actual strace -k output doesn't match the + expected output because of limited architecture support, skip the test + on architectures that are not currently supported by libdw. + +2018-04-11 Masatake YAMATO + + unwind: add libdw as an unwinder. + Implement alternative libdw-based unwinder for stack tracing. + Add --with-libdw configure option to control whether libdw can be used + as an unwinder. + + * m4/st_libdw.m4: New file. + * m4/st_stacktrace.m4 (st_STACKTRACE): Invoke st_ARG_LIBDW and st_LIBDW, + check for mutually exclusive configure options, + (AM_CONDITIONAL): Add USE_LIBDW. + * unwind-libdw.c: New file. + * Makefile.am [USE_LIBDW] (strace_SOURCES): Append unwind-libdw.c. + [USE_LIBDW] (strace_CPPFLAGS): Append $(libdw_CPPFLAGS). + [USE_LIBDW] (strace_CFLAGS): Append $(libdw_CFLAGS). + [USE_LIBDW] (strace_LDFLAGS): Append $(libdw_LDFLAGS). + [USE_LIBDW] (strace_LDADD): Append $(libdw_LIBS). + * NEWS: Mention this improvement. + + Closes: https://github.com/strace/strace/issues/12 + Closes: https://github.com/strace/strace/issues/13 + Co-Authored-by: Mark Wielaard + Co-Authored-by: Dmitry V. Levin + +2018-04-11 Dmitry V. Levin + + tests: check corner cases of udev_monitor_netlink_header decoding. + * tests/netlink_kobject_uevent.c (test_nlmsg_type_kernel): Create + a tail-allocated udev_monitor_netlink_header object and pass it + to sys_send. + (test_nlmsg_type_udev): Likewise. Check decoding of + udev_monitor_netlink_header object that ends in unmapped memory region. + +2018-04-11 Harsha Sharma + + tests: check decoding of udev_monitor_netlink_header. + * tests/netlink_kobject_uevent.c: Include , , + and "netlink_kobject_uevent.h". + (test_nlmsg_type_udev, test_nlmsg_type_kernel): New functions. + (main): Use them. + +2018-04-11 Harsha Sharma + + netlink: decode libudev netlink header. + * defs.h (decode_netlink_kobject_uevent): New prototype. + * netlink.c (decode_netlink): Decode family kobject_uevent. + * netlink_kobject_uevent.h: New file. + * netlink_kobject_uevent.c: Likewise. + * Makefile.am (strace_SOURCES): Add them. + + Co-Authored-by: Dmitry V. Levin + +2018-04-11 Harsha Sharma + + tests: check basic decoding of PTP_* ioctl commands. + * tests/ioctl_ptp.c: New file. + * tests/gen_tests.in (ioctl_ptp): New entry. + * tests/pure_executables.list: Add ioctl_ptp. + * tests/.gitignore: Likewise. + + Co-Authored-by: Dmitry V. Levin + +2018-04-10 Eugene Syromyatnikov + + bpf: decode BPF_PROG_QUERY command. + BPF_PROG_QUERY was introduced in Linux commit v4.15-rc1~84^2~558^2~6. + + * xlat/bpf_commands.in (BPF_PROG_QUERY): New constant. + * xlat/bpf_query_flags.in: New file. + * bpf.c: Include it. + (DECL_BPF_CMD_DECODER): Add priv argument for passing tcb private data. + (BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY)): New function. + (SYS_FUNC(bpf)) : Add BPF_PROG_QUERY entry. + (SYS_FUNC(bpf)): Fetch buf on entering and exiting, pass buf on exiting, + retrieve private data on exiting, pass it to decoder as well, explicitly + rework rc handling logic for size argument printing. + * bpf_attr.h (struct BPF_PROG_QUERY_struct): New structure declaration. + (BPF_PROG_QUERY_struct_size, expected_BPF_PROG_QUERY_struct_size): New + macro. + * tests/bpf.c: Add checks for BPF_PROG_QUERY command. + +2018-04-10 Eugene Syromyatnikov + + Make print_uint64 from btrfs.c globally available. + And rename it to print_uint64_array_member to make the name sensible + without additional context. + + * defs.h (print_uint64_array_member): New function prototype. + * btrfs.c (print_uint64): Move... + * util.c (print_uint64_array_member): ...here, drop "static" qualifier. + +2018-04-10 Eugene Syromyatnikov + + Introduce umoven_or_printaddr64* functions. + Counterparts for umoven_or_printaddr/umoven_or_printaddr_ignore_syserror + that always print 64 bits of addr (as this is needed in bpf and btrfs + decoders). + + * util.c (umoven_or_printaddr64): Rename from umoven_or_printaddr, + change addr argument type to uint64_t, call printaddr64 instead of + printaddr. + (umoven_or_printaddr64_ignore_syserror): Rename from + umoven_or_printaddr_ignore_syserror, change addr argument type to + uint64_t, call printaddr64 instead of printaddr. + * defs.h (umoven_or_printaddr64): Rename from umoven_or_printaddr, + change addr argument type to uint64_t. + (umoven_or_printaddr64_ignore_syserror): Rename from + umoven_or_printaddr_ignore_syserror, change addr argument type to + uint64_t. + (umove_or_printaddr64): New macro, a wrapper for umoven_or_printaddr64. + (umoven_or_printaddr): New function, a wrapper for + umoven_or_printaddr64. + (umoven_or_printaddr_ignore_syserror): New function, a wrapper for + umoven_or_printaddr64_ignore_syserror. + +2018-04-10 Eugene Syromyatnikov + + bpf_filter.c: add support for decoding eBPF instruction codes. + * bpf_filter.c (print_bpf_filter_code): Add extended argument, remove + static qualifier. Add support for decoding eBPF instruction code. + * defs.h (print_bpf_filter_code): New declaration. + * xlat/ebpf_class.in: New file. + * xlat/ebpf_mode.in: Likewise. + * xlat/ebpf_op_alu.in: Likewise. + * xlat/ebpf_op_jmp.in: Likewise. + * xlat/ebpf_size.in: Likewise. + + Co-Authored-by: Dmitry V. Levin + +2018-04-08 Dmitry V. Levin + + unwind: prepare configure subsystem for alternative unwinders. + Introduce --enable-stacktrace configure option to control whether + -k option support is compiled in, --with-libunwind option remains + available to control whether libunwind can be used as an unwinder. + + * m4/st_demangle.m4: New file. + * m4/st_libunwind.m4: Likewise. + * m4/st_stacktrace.m4: Likewise. + * configure.ac: Replace all libunwind and libiberty checks + with a single st_STACKTRACE invocation. + * Makefile.am: Conditionalize checks for USE_LIBUNWIND and USE_DEMANGLE + on ENABLE_STACKTRACE. + [ENABLE_STACKTRACE] (strace_SOURCES): Append unwind.c and unwind.h. + * strace.1.in: Replace libunwind with an unwinder-agnostic wording. + * defs.h: Replace USE_LIBUNWIND with ENABLE_STACKTRACE. + * strace.c: Likewise. + (print_version): Print stack-trace instead of stack-unwind. + * syscall.c: Replace USE_LIBUNWIND with ENABLE_STACKTRACE. + * tests/Makefile.am: Likewise. Replace LIBUNWIND_TESTS + with STACKTRACE_TESTS. + * tests/strace-V.test: Update expected output. + +2018-04-08 Eugene Syromyatnikov + + bpf: implement decoding of prog_name and prog_ifindex fields. + * bpf.c (BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD)): Add support for decoding + of prog_name (introduced in Linux commit v4.15-rc1~84^2~605^2~4) and + prog_ifindex (introduced as prog_target_ifindex in v4.15-rc1~84^2~127^2~13, + renamed in v4.15-rc1~15^2~5^2~3^2~7). + * bpf_attr.h [!BPF_OBJ_NAME_LEN] (BPF_OBJ_NAME_LEN): New macro constant. + [BPF_OBJ_NAME_LEN]: Check that BPF_OBJ_NAME_LEN is equal to 16. + (struct BPF_PROG_LOAD_struct): Add prog_name and prog_ifindex fields. + (BPF_PROG_LOAD_struct_size, expected_BPF_PROG_LOAD_struct_size): Update. + * tests/bpf.c (init_BPF_PROG_LOAD_attr): Rename + to init_BPF_PROG_LOAD_attr3. + (print_BPF_PROG_LOAD_attr): Rename to print_BPF_PROG_LOAD_attr3. + (init_BPF_PROG_LOAD_attr4, print_BPF_PROG_LOAD_attr4): New functions. + (BPF_PROG_LOAD_checks): Check new decoding features. + +2018-04-08 Eugene Syromyatnikov + + bpf: add support for array fields. + * gen_bpf_attr_check.sh: Ignore field array size definition. + * m4/gen_bpf_attr_m4.sh (filter_entries): Likewise. + + Co-Authored-by: Dmitry V. Levin + +2018-04-07 Dmitry V. Levin + + tests: robustify strace -k tests. + Allow __getpid as an alternative name for getpid, + allow __kernel_vsyscall after getpid. + + * tests/strace-k.expected: New file. + * tests/strace-k-demangle.expected: Likewise. + * tests/Makefile.am (EXTRA_DIST): Add them. + * tests/strace-k-demangle.test (expected): Remove. + * tests/strace-k.test: Likewise. Use grep to check the output. + +2018-04-07 Eugene Syromyatnikov + + ipc_msg: sign extend msgtyp in m32 personality. + msgtyp has to be treated as a signed type all the way from fetching + to printing. + + * ipc_msg.c (fetch_msgrcv_args): Sign extend msgtyp when fetching. + +2018-04-05 Dmitry V. Levin + + strace.spec.in: update Source URL. + * strace.spec.in (Source): Change to https://strace.io/files/. + + debian: enable mpers support for ppc64el and s390x. + * debian/control (Build-Depends) [ppc64el, s390x]: Add gcc-multilib. + + Post-release administrivia. + * NEWS: Add a header line for the next release. + * debian/changelog.in: Add a changelog entry for 4.22-1. + * strace.spec.in: Likewise. + + Prepare for 4.22 release. + * NEWS: Update for 4.22 release. + + Update copyright headers. + Headers updated automatically using maint/update_copyright_years.sh + script. + +2018-04-05 Eugene Syromyatnikov + + Update NEWS. + +2018-04-05 Masatake YAMATO + + unwind: split unwind code into front-end and back-end. + This opens the way for alternative unwinder back-ends. + + * unwind.h: New file, defines the unwinder back-end interface. + * unwind.c: Move all libunwind related code ... + * unwind-libunwind.c: ... here. + * Makefile.am [USE_LIBUNWIND] (strace_SOURCES): Add unwind.h + and unwind-libunwind.c. + +2018-04-05 Masatake YAMATO + + unwind: rename public functions in an object-oriented fashion. + This change renames functions exported to strace core part from unwind + subsystem. + + The new names imply that unwind subsystem exports two types of + functions. One is for manipulating back-end itself, "unwind_" prefix + is used for this type. Another is for manipulating back-end private data + structure (unwind_ctx) attached to tcb, "unwind_tcb_" is used for this + type. + + This naming should help people to understand unwind subsystem + and the relation between unwind subsystem and back-ends. + + * defs.h (unwind_print_stacktrace): Rename to unwind_tcb_print. + (unwind_capture_stacktrace): Rename to unwind_tcb_capture. + * unwind.c: Ditto. + * syscall.c (syscall_entering_trace, syscall_exiting_trace): Use + new names. + +2018-04-05 Masatake YAMATO + + unwind: add unwind_ prefix to struct tcb.queue field and its type. + The names given to struct tcb.queue field and its type are too common, + this may cause conflicts in the future if new fields are added + to struct tcb. + + * defs.h (struct tcb): Rename queue field to unwind_queue, + rename its type queue_t to unwind_queue_t. + * unwind.c (struct unwind_queue_t): Rename to unwind_queue_t. + All users updated. + +2018-04-05 Masatake YAMATO + + unwind: make the field type of struct tcb independent from libunwind. + Narrowing the area where the code refers to names associated with + libunwind is needed to utilize libdw of elfutils as an alternative + unwinder. + + * defs.h (struct tcb): Rename libunwind_ui field to unwind_ctx, change + its type to "void *". + * unwind.c (unwind_tcb_init, unwind_tcb_fin, stracetrace_walk): Reflect + * the above field renaming. + +2018-04-04 Dmitry V. Levin + + tests: robustify options-syntax.test against ash. + * tests/options-syntax.test: Do not assume that shell provides $UID, + use "id -u" if it doesn't. + +2018-04-04 Eugene Syromyatnikov + + strace.c: add support for opening output file in append mode. + * strace.c (open_append): New variable. + (init): Handle -A option. + (strace_fopen): Open file in "a" mode if open_append is set to true. + * strace.1.in: Document this. + * NEWS: Mention this. + + Suggested-by: Philipp Marek + Closes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=528488 + +2018-04-04 Eugene Syromyatnikov + + strace.c: support simultaneous usage of -r and -t options. + * strace.c (init): Do not set tflag when rflag is set. + (printleader): Handle rflag and tflag separately. + * strace.1.in (.SH OPTIONS): Add a note about differences between + the monotonic clock time and the wall clock time. + * tests/options-syntax.test: Remove the check for + "-tt has no effect with -r" warning. + * NEWS: Mention this. + + Suggested-by: Josh Triplett + Co-Authored-by: Dmitry V. Levin + Closes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=466195 + +2018-04-04 Eugene Syromyatnikov + + syscall.c: dump write I/O even if error is returned. + It makes sense to try to dump the argument of write syscalls as they can + be readily available despite the fact that error has been returned. + + * syscall.c (dumpio): Move check for syserror and check for fd in + read_set to the end of the function. + * tests/read-write.c: Add a check for this behaviour. + * tests/pread64-pwrite64.c: Update expected output. + * NEWS: Mention this. + + Suggested-by: J. Bruce Fields + Closes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=436284 + +2018-04-04 Eugene Syromyatnikov + + strace: handle possible NULL from localtime() call. + * strace.c (printleader): Print raw tv_sec value if localtime() returned + NULL. + * tests/localtime.c: New file. + * tests/localtime.test: New test. + * tests/Makefile.am (check_PROGRAMS): Add localtime. + (MISC_TESTS): Add localtime.test. + (localtime_LDADD): New variable. + * tests/.gitignore: Add localtime. + * ci/install-dependencies.sh (common_packages): Add faketime. + + Co-Authored-by: Dmitry V. Levin + Closes: https://github.com/strace/strace/issues/42 + +2018-04-04 Eugene Syromyatnikov + + Return RVAL_STR unconditionally. + There is no reason to check for auxstr being non-NULL + because syscall_exiting_trace already does the check. + + * sched.c (SYS_FUNC(sched_getscheduler)): Do not check tcp->auxstr, + return RVAL_STR unconditionally. + * time.c (do_adjtimex): Likewise. + +2018-04-04 Eugene Syromyatnikov + + dist/README: s/linux/Linux/ + * dist/README: Replace "linux" with "Linux". + +2018-04-04 Eugene Syromyatnikov + + strace.1.in: fix formatting of -e trace class descriptions. + Use .TP instead .PP as it is ought to be. + + * strace.1.in (.SS Filtering): Use .TP instead .PP as it is ought to be. + +2018-04-04 Eugene Syromyatnikov + + nlattr: check NLA_TYPE_MASK at compile time. + * nlattr.c: Include "static_assert.h" + (print_nlattr): Check the expectations about NLA_TYPE_MASK. + + Co-Authored-by: Dmitry V. Levin + +2018-04-04 Eugene Syromyatnikov + + bpf: add a comment about bpf_attr decoding. + * bpf.c: Add comment. + +2018-04-04 Dmitry V. Levin + + tests: check decoding of bpf_attr of size 1. + * tests/bpf.c (BPF_PROG_GET_NEXT_ID_checks): New entry. + +2018-04-04 Eugene Syromyatnikov + + bpf: use print_big_u64_addr. + Since pointers stored in the bpf_attr union are 64-bit regardless + of architecture bitness. + + * bpf.c (DEF_BPF_CMD_DECODER(BPF_PROG_LOAD)): Call print_big_u64_addr + for attr.license. + (DEF_BPF_CMD_DECODER(BPF_OBJ_PIN)): Call print_big_u64_addr + for attr.pathname. + * tests/bpf.c (BPF_OBJ_PIN_checks): Check it. + + Co-Authored-by: Dmitry V. Levin + +2018-04-04 Eugene Syromyatnikov + + bpf: add support for file mode flags. + These were introduced by Linux commit v4.15-rc1~84^2~384^2~4. + + * bpf_attr.h (struct BPF_OBJ_PIN_struct): Add file_flags field. + (struct BPF_PROG_GET_NEXT_ID_struct, struct BPF_PROG_GET_FD_BY_ID_struct, + struct BPF_MAP_GET_FD_BY_ID_struct): Add open_flags field. + (BPF_OBJ_PIN_struct_size, expected_BPF_OBJ_PIN_struct_size, + expected_BPF_PROG_GET_NEXT_ID_struct_size, + expected_BPF_PROG_GET_FD_BY_ID_struct_size, + expected_BPF_MAP_GET_FD_BY_ID_struct_size): Update. + * bpf.c (DEF_BPF_CMD_DECODER(BPF_OBJ_PIN)): Check the length, skip + printing the rest of attributes if it is less than offset of the + end of the bpf_fd field, print file_flags field otherwise. + (DEF_BPF_CMD_DECODER(BPF_PROG_GET_NEXT_ID), + DEF_BPF_CMD_DECODER(BPF_PROG_GET_FD_BY_ID), + DEF_BPF_CMD_DECODER(BPF_MAP_GET_FD_BY_ID)): Check the length, skip + printing the rest of attributes if it is less than offset of the + end of the next_id field, print open_flags field otherwise. + * xlat/bpf_file_mode_flags.in: New file. + * tests/bpf.c (BPF_OBJ_PIN_checks, BPF_PROG_GET_NEXT_ID_checks, + BPF_PROG_GET_FD_BY_ID_checks, BPF_MAP_GET_FD_BY_ID_checks): Check it. + + Co-Authored-by: Dmitry V. Levin + +2018-04-04 Eugene Syromyatnikov + + tests: refactor bpf test. + The aim of this change is to introduce an ability to perform multiple + checks for a specific bpf command. In order to achieve so, all the + related data is stored in check descriptor, and test_bpf iterates over + it. There are also some provisions made in regard to future changes + (specifically, the way bpf_attr_data union is defined). + + * tests/bpf.c (print_bpf_attr): New function, a wrapper around + struct bpf_check.printer. + (test_bpf_): Rename to... + (test_bpf): ...this. Replace arguments with struct bpf_check pointer. + Iterate over possible attribute variants. Account for changes in + attribute initialisation routine: provide a pointer to locally defined + union bpf_attr_data and perform memcpy afterwards. Initialise memory + from data each time before a bpf call. + (TEST_BPF, DEF_*, init_*, print_*): Remove. + (init_BPF_PROG_LOAD_attr, print_BPF_PROG_LOAD_attr, + init_BPF_OBJ_PIN_attr): New functions. + (license, pathname): New variables. + (BPF_MAP_CREATE_checks, BPF_MAP_LOOKUP_ELEM_checks, + BPF_MAP_UPDATE_ELEM_checks, BPF_MAP_DELETE_ELEM_checks, + BPF_MAP_GET_NEXT_KEY_checks, BPF_PROG_LOAD_checks, BPF_OBJ_PIN_checks, + BPF_PROG_ATTACH_checks, BPF_PROG_DETACH_checks, + BPF_PROG_TEST_RUN_checks, BPF_PROG_GET_NEXT_ID_checks, + BPF_PROG_GET_FD_BY_ID_checks, BPF_MAP_GET_FD_BY_ID_checks, + BPF_OBJ_GET_INFO_BY_FD_checks): New arrays. + (BPF_OBJ_GET_checks, BPF_MAP_GET_NEXT_ID_checks): New macros. + (CHK): New macro, a shorthand for initialising array of struct bpf_check. + (main): New static constant checks, iterate over checks and run test_bpf + with each element. + + Co-Authored-by: Dmitry V. Levin + +2018-04-04 Eugene Syromyatnikov + + print_fields.h: introduce PRINT_FIELD_ADDR and PRINT_FIELD_ADDR64 macros + * print_fields.h (PRINT_FIELD_ADDR, PRINT_FIELD_ADDR64): New macro. + +2018-04-04 Eugene Syromyatnikov + + print_fields.h: introduce PRINT_FIELD_CSTRING_SZ macro. + A variant of PRINT_FIELD_CSTRING with an ability to pass string size + explicitly. + + * print_fields.h (PRINT_FIELD_CSTRING_SZ): New macro. + +2018-04-04 Eugene Syromyatnikov + + print_fields.h: check whether passed field is an array in PRINT_FIELD_CSTRING + * print_fields.h (PRINT_FIELD_CSTRING): Add MUST_BE_ARRAY to the size + value in order to check whether (where_).field_ is an array in compile + time. + + print_fields.h: whitespace fix in PRINT_FIELD_HEX_ARRAY. + +2018-04-04 Dmitry V. Levin + + bpf_attr: add more size checks. + * bpf_attr.h: Add expected sizes of structures. + * gen_bpf_attr_check.sh: Check them. + + tests: check bpf syscall decoder unconditionally. + * configure.ac (AC_CHECK_HEADERS([linux/bpf.h])): Check for + struct bpf_insn. + * tests/bpf.c: Remove the test guard, include "scno.h", "bpf_attr.h", + "xlat.h", and "xlat/bpf_commands.h". Conditionalize inclusion of + on HAVE_LINUX_BPF_H. Remove all HAVE_UNION_* checks. + (BPF_ATTR_DATA_FIELD): New macro. + (bpf_attr_data): New union. Note that it is larger than modern + union bpf_attr, this allows more checks to be implemented in the future. + (sizeof_attr, test_bpf_): Replace union bpf_attr with + union bpf_attr_data. + (DEF_BPF_INIT_FIRST): Replace union bpf_attr with the corresponding + structure. + (init_BPF_MAP_CREATE_attr): Replace union bpf_attr with + struct BPF_MAP_CREATE_struct. + (init_BPF_MAP_LOOKUP_ELEM_attr): Replace union bpf_attr with + struct BPF_MAP_LOOKUP_ELEM_struct. + (init_BPF_MAP_UPDATE_ELEM_attr): Replace union bpf_attr with + struct BPF_MAP_UPDATE_ELEM_struct. + (init_BPF_MAP_DELETE_ELEM_attr): Replace union bpf_attr with + struct BPF_MAP_DELETE_ELEM_struct. + (init_BPF_MAP_GET_NEXT_KEY_attr): Replace union bpf_attr with + struct BPF_MAP_GET_NEXT_KEY_struct. + (init_BPF_PROG_LOAD_attr): Replace union bpf_attr with + struct BPF_PROG_LOAD_struct. + (init_BPF_OBJ_PIN_attr): Replace union bpf_attr with + struct BPF_OBJ_PIN_struct. + (init_BPF_PROG_ATTACH_attr): Replace union bpf_attr with + struct BPF_PROG_ATTACH_struct. + (init_BPF_PROG_DETACH_attr): Replace union bpf_attr with + struct BPF_PROG_DETACH_struct. + (init_BPF_PROG_GET_NEXT_ID_attr): Replace union bpf_attr with + struct BPF_PROG_GET_NEXT_ID_struct. + (sample_BPF_PROG_TEST_RUN_attr): Change type from union bpf_attr to + struct BPF_PROG_TEST_RUN_struct, all users updated. + (sample_BPF_OBJ_GET_INFO_BY_FD_attr): Change type from union bpf_attr + to struct BPF_OBJ_GET_INFO_BY_FD_struct, all users updated. + + Check that structures defined by bpf_attr.h match system union bpf_attr. + * gen_bpf_attr_check.sh: New file. + * Makefile.am (EXTRA_DIST): Add it. + (strace_SOURCES_check): New variable. + (strace_SOURCES): Add $(strace_SOURCES_check). + (BUILT_SOURCES, CLEANFILES): Add bpf_attr_check.c. + (bpf_attr_check.c): New rule. + (sys_func_h_sources): New variable. + (sys_func.h): Use it instead of strace_SOURCES_c. + * .gitignore: Add /bpf_attr_check.c. + +2018-04-04 Dmitry V. Levin + + build: generate all union bpf_attr checks automatically. + Rather than list by hand some members of union bpf_attr that we check + for availability, automatically list all members of union bpf_attr we + are aware of. + + * m4/gen_bpf_attr_m4.sh: New file. + * bootstrap: Invoke it. + * configure.ac (AC_CHECK_HEADERS([linux/bpf.h])): Use st_BPF_ATTR. + * m4/.gitignore: New file. + +2018-04-04 Dmitry V. Levin + + bpf: move definitions of bpf_attr structures to separate header file. + This also unifies decoders of bpf commands by moving common code + to new macros. + + * bpf_attr.h: New file. + * Makefile.am (strace_SOURCES): Add it. + * bpf.c: Include it. + (DEF_BPF_CMD_DECODER): Rename to BEGIN_BPF_CMD_DECODER, add code common + to all decoders. All users updated. + (END_BPF_CMD_DECODER): New macro, add its invocation to all users + of BEGIN_BPF_CMD_DECODER macro. + +2018-04-04 Eugene Syromyatnikov + + Introduce print_big_u64_addr. + This is needed at least for bpf, btrfs, and sg_io, as 32-bit tracer + cannot figure out whether the kernel is 32-bit or 64-bit, + and its behaviour differs when it handles u64 as a pointer. + + * linux/arch_defs_.h [!CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL] + (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL): New definition, default to 0. + * linux/arm/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL): + Define to 1. + * linux/i386/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL): + Likewise. + * linux/mips/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL): + Likewise. + * linux/powerpc/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL): + Likewise. + * linux/riscv/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL): + Likewise. + * linux/s390/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL): + Likewise. + * linux/sparc/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL): + Likewise. + * linux/tile/arch_defs_.h (CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL): + Likewise. + * defs.h (print_big_u64_addr): New function. + + Co-Authored-by: Dmitry V. Levin + +2018-04-04 Eugene Syromyatnikov + + defs.h: introduce max_addr and max_kaddr macros. + In order to check an address against maximum addr/kaddr value + for the current personality. + + * degs.h (max_addr, max_kaddr): New macros. + +2018-04-04 Dmitry V. Levin + + Introduce static_assert. + We are going to use static_assert provided by or, + if it doesn't work, our cheap imitation that doesn't display + the message specified as the second argument of static_assert. + + * configure.ac (AC_CACHE_CHECK): Check for static_assert in , + define HAVE_STATIC_ASSERT if it is available. + * static_assert.h: New file. + * Makefile.am (strace_SOURCES): Add it. + +2018-04-04 Dmitry V. Levin + + tests: forward SIZEOF_KERNEL_LONG_T and SIZEOF_LONG to C preprocessor. + * tests/Makefile.am (AM_CPPFLAGS): Forward SIZEOF_KERNEL_LONG_T + and SIZEOF_LONG as TESTS_SIZEOF_KERNEL_LONG_T and TESTS_SIZEOF_LONG. + * tests/tests.h [TESTS_SIZEOF_KERNEL_LONG_T] (SIZEOF_KERNEL_LONG_T): + Redefine to TESTS_SIZEOF_KERNEL_LONG_T. + [TESTS_SIZEOF_LONG] (SIZEOF_LONG): Redefine to TESTS_SIZEOF_LONG. + + Complements: v4.21~5 ("Export SIZEOF_LONG and SIZEOF_KERNEL_LONG_T to tests") + +2018-04-04 Dmitry V. Levin + + tests/tests.h: fix indentation. + + tests: fix potential errno clobbering in netlink_kobject_uevent.test. + * tests/netlink_kobject_uevent.c (errstr): New variable. + (sys_send): New function. + (main): Use them. + +2018-04-03 Gleb Fotengauer-Malinovskiy + + Restore kvm ioctl definitions for aarch64 and mips architectures. + * maint/ioctls_sym.sh: Add aarch64 and mips architectures to the list + of kvm-capable architectures. + * linux/aarch64/ioctls_arch0.h: Regenerate. + * linux/mips/ioctls_arch0.h: Regenerate. + + Fixes: v4.15~92 ("Move KVM_* ioctl entries from ioctls_inc*.h to ioctls_arch*.h") + +2018-04-03 Gleb Fotengauer-Malinovskiy + + Update ioctl entries from linux v4.16. + * linux/32/ioctls_inc_align16.h: Update from linux v4.16 + using ioctls_gen.sh. + * linux/32/ioctls_inc_align32.h: Likewise. + * linux/32/ioctls_inc_align64.h: Likewise. + * linux/64/ioctls_inc.h: Likewise. + * linux/x32/ioctls_inc0.h: Likewise. + * linux/arm/ioctls_arch0.h: Likewise. + * linux/i386/ioctls_arch0.h: Likewise. + * linux/powerpc/ioctls_arch0.h: Likewise. + * linux/s390/ioctls_arch0.h: Likewise. + * linux/s390x/ioctls_arch0.h: Likewise. + * linux/x86_64/ioctls_arch0.h: Likewise. + * NEWS: Mention this. + + maint: update for linux 4.16. + * maint/ioctls_sym.sh: Add workaround for linux/ndctl.h file. + Update workaround for media/v4l2-common.h file. + (x86_list): Add KVM_GET_MSR_FEATURE_INDEX_LIST. + +2018-04-01 Eugene Syromyatnikov + + util.c: amend sprinttime_ex description a bit. + * util.c (sprinttime_ex): Document return value. + + tests/bpf.c: add a check for NULL bpf_attr pointer. + * tests/bpf.c (main): Add a check with 0 passed in the third argument. + +2018-04-01 Eugene Syromyatnikov + + bpf: print byte range for extra data. + As it could be not entirely clear what bytes are printed. + + * bpf.c (decode_attr_extra_data): Print a comment about the byte range + to be printed. + * tests/bpf.c: Update expected output. + +2018-04-01 Eugene Syromyatnikov + + Remove addflags. + It has only single user and implementation of xlat styles for it would + lead to lots of code duplication. + + * defs.h (addflags): Remove declaration. + * mem.c (print_mmap_flags): Convert addflags call into printflags64 with + non-zeroeness flags check. + * xlat.c (addflags): Remove. + +2018-04-01 Dmitry V. Levin + + Add i18n support. + Let's make a step towards the growing strace userbase all around + the world and translate something to the language of their choice. + + This change enables translation of error messages corresponding + to errno codes, making it consistent with error diagnostics of other + i18n-aware tools, e.g. + + $ LANG=es_ES strace -qq -a38 -P /missing unlink /missing + unlink("/missing") = -1 ENOENT (No existe el fichero o el directorio) + unlink: no se puede deshacer el enlace '/missing': No existe el fichero o el directorio + + * strace.c: Include . + (main): Invoke setlocale. + * tests/init.sh: Export LC_ALL=C. + * NEWS: Mention this enhancement. + +2018-03-29 Dmitry V. Levin + + Remove RVAL_PRINT_ERR_VAL. + * defs.h (RVAL_PRINT_ERR_VAL): Remove. + * ldt.c (SYS_FUNC(modify_ldt)): Return 0. + * syscall.c (syscall_exiting_trace): When printing an error, + always print struct tcb.u_rval as if RVAL_PRINT_ERR_VAL was set. + +2018-03-29 Dmitry V. Levin + + Treat RVAL_DECIMAL the same way as RVAL_UDECIMAL. + Assuming that syscalls may return negative values only as error codes, + always print non-error syscall return codes as unsigned. + + * defs.h (RVAL_UDECIMAL): Remove. + (RVAL_DECIMAL): Rename to RVAL_UDECIMAL. + * syscall.c (syscall_exiting_trace) : Remove. + * clone.c (SYS_FUNC(fork)): Remove RVAL_UDECIMAL. + * lseek.c (SYS_FUNC(lseek)): Likewise. + * prctl.c (SYS_FUNC(prctl)): Likewise. + * uid.c (SYS_FUNC(getuid), SYS_FUNC(setfsuid)): Likewise. + * times.c (SYS_FUNC(times)): Always return 0. + * tests/inject-nf.c (main): Update expected output. + +2018-03-29 Dmitry V. Levin + + tests: check handling of some invalid delay injection parameters. + * tests/qual_inject-syntax.test: Check for negative delay injection + parameters. Check for overriding delay injection parameters. + +2018-03-29 Eugene Syromyatnikov + + Implement injection of negative return values. + Extend the range of injected return value to the maximum, print warnings + if negative injection value can be clipped in compat personality or can + inadvertently turn into a fault injection. + + * defs.h (INJECT_F_ERROR): New macro. + * filter_qualify.c (parse_inject_token): Revert type of intval local + variable back to int, check INJECT_F_ERROR along with INJECT_F_RETVAL, + use strtoull to parse retval argument, print warnings in case of retval + clipping and inadvertent fault injection. + (qualify_inject_common): Set INJECT_F_ERROR instead of INJECT_F_RETVAL. + * syscall.c (tamper_with_syscall_exiting): Check inject_data.flags + to determine whether a fault injection or retval injection has to be + performed. + (syscall_exiting_trace) : Explicitly print + tcp->u_rval as int if current_klongsize < sizeof(tcp->u_rval). + * tests/inject-nf.c (main): Update. + * tests/inject-nf.test: Test injection of negative return values. + * tests/qual_inject-syntax.test: Remove retval=-1 check as it is now + allowed, add checks for invalid retval parameters. + + Co-Authored-by: Dmitry V. Levin + +2018-03-28 Dmitry V. Levin + + arch_defs.h: fix typo in comment. + + Move delay interface from defs.h to delay.h. + * defs.h (alloc_delay_data, fill_delay_data, is_delay_timer_armed, + delay_timer_expired, arm_delay_timer, delay_tcb): Move... + * delay.h: ... to new file. + * Makefile.am (strace_SOURCES): Add it. + * filter_qualify.c: Include it. + * strace.c: Likewise. + * syscall.c: Likewise. + +2018-03-28 Dmitry V. Levin + + Turn struct inject_data.rval into an index. + Add one level of indirection to decrease the size of struct inject_data + as hundreds of these structures are created for each process when + injection mechanism is activated. + + * retval.h: New file. + * retval.c: Likewise. + * Makefile.am (strace_SOURCES): Add them. + * defs.h (struct inject_data): Replace rval field with rval_idx. + * filter_qualify.c: Include "retval.h". + (parse_inject_token, qualify_inject_common): Initialize + struct inject_data.rval_idx using retval_new. + * syscall.c: Include "retval.h". + (tamper_with_syscall_exiting): Obtain the value that has to be injected + using retval_get. + +2018-03-27 Dmitry V. Levin + + defs.h: update comment. + * defs.h (struct inject_data): Update comment about flags. + + Complements: v4.21-108-gba8e768 ("Implement delay injection") + +2018-03-27 Eugene Syromyatnikov + + xlat: cleanup mmap_flags.in. + * xlat/mmap_flags.in (_MAP_NEW): Remove SunOS-specific comment, add + a comment that this is a SPARC-specific constant (from + arch/sparc/include/uapi/asm/mman.h). + (MAP_GROWSUP): IA-64-specific constant (from + arch/ia64/include/uapi/asm/mman.h). + (MAP_INHERIT): Add a comment that this is a SPARC-specific constant + (from arch/sparc/include/uapi/asm/mman.h). + (_MAP_INHERIT): Add a comment that this is an Alpha-specific constant + (from arch/alpha/include/uapi/asm/mman.h). + (MAP_ANON): Remove, FreeBSD-specific constant. + (MAP_HASSEMAPHORE): Rename to... + (_MAP_HASSEMAPHORE): ...this, add a comment that this is an + Alpha-specific constant (from arch/alpha/include/uapi/asm/mman.h). + (MAP_NOSYNC, MAP_NOCORE): Remove. + (MAP_AUTOGROW, MAP_AUTORSRV, MAP_LOCAL): Add a comment that this is + an architecture-specific constant (from + arch/mips/include/uapi/asm/mman.h, arch/xtensa/include/uapi/asm/mman.h). + (_MAP_UNALIGNED): Add a comment that this is an Alpha-specific constant + (from arch/alpha/include/uapi/asm/mman.h). + +2018-03-27 Eugene Syromyatnikov + + tests: check decoding of kern_features syscall. + * tests/kern_features.c: New file. + * tests/kern_features-fault.test: New test. + * tests/gen_tests.in (kern_features): New entry. + * tests/Makefile.am (DECODER_TESTS): Add kern_features-fault.test. + * tests/pure_executables.list: Add kern_features. + * tests/.gitignore: Likewise. + + Co-Authored-by: Dmitry V. Levin + +2018-03-27 Eugene Syromyatnikov + + sparc, sparc64: implement kern_features decoder. + * sparc.c: New file. + * Makefile.am (EXTRA_DIST): Add it. + * linux/sparc/syscallent.h ([340]): Remove NF flag, set kern_features + decoder. + * linux/sparc64/syscallent.h ([340]): Likewise. + * xlat/sparc_kern_features.in: New file. + * NEWS: Mention this enhancement. + + Co-Authored-by: Dmitry V. Levin + +2018-03-27 Dmitry V. Levin + + evdev: move mpers-specific parsers to a separate file. + This change reduces binary code duplication on mpers platforms + and prepares evdev parsers to use printxval_bsearch. + + * defs.h (evdev_ioctl, print_evdev_ff_type): New prototypes. + * evdev.c (evdev_ioctl): Un-mpersify. + (evdev_write_ioctl) Remove EVIOCSFF case, forward default case + to evdev_write_ioctl_mpers. + (decode_envelope, ff_effect_ioctl): Move to... + * evdev_mpers.c: ... new file. + * Makefile.am (strace_SOURCES): Add evdev_mpers.c. + +2018-03-26 Eugene Syromyatnikov + + ci: install libunwind8-dev. + While in debian/control we use libunwind-dev in Build-Depends, in case + of ci we have to be more conservative and use the name portable across + different ci implementations. + + * ci/install-dependencies.sh (common_packages): Add libunwind8-dev. + + Co-Authored-by: Dmitry V. Levin + +2018-03-23 Eugene Syromyatnikov + + tests: check injection of return values into a "never fails" syscall. + * tests/inject-nf.c: New file. + * tests/inject-nf.test: New test. + * tests/.gitignore: Add inject-nf. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (MISC_TESTS): Add inject-nf.test. + + Co-Authored-by: Dmitry V. Levin + +2018-03-23 Dmitry V. Levin + + Introduce raw syscall invocation wrappers. + Unfortunately, syscall(3) provided by libc is too smart + for some of our needs. + + * linux/raw_syscall.h: New file. + * linux/aarch64/raw_syscall.h: Likewise. + * linux/alpha/raw_syscall.h: Likewise. + * linux/arc/raw_syscall.h: Likewise. + * linux/arm/raw_syscall.h: Likewise. + * linux/avr32/raw_syscall.h: Likewise. + * linux/bfin/raw_syscall.h: Likewise. + * linux/hppa/raw_syscall.h: Likewise. + * linux/i386/raw_syscall.h: Likewise. + * linux/ia64/raw_syscall.h: Likewise. + * linux/m68k/raw_syscall.h: Likewise. + * linux/metag/raw_syscall.h: Likewise. + * linux/microblaze/raw_syscall.h: Likewise. + * linux/mips/raw_syscall.h: Likewise. + * linux/nios2/raw_syscall.h: Likewise. + * linux/or1k/raw_syscall.h: Likewise. + * linux/powerpc/raw_syscall.h: Likewise. + * linux/powerpc64/raw_syscall.h: Likewise. + * linux/riscv/raw_syscall.h: Likewise. + * linux/s390/raw_syscall.h: Likewise. + * linux/s390x/raw_syscall.h: Likewise. + * linux/sh/raw_syscall.h: Likewise. + * linux/sh64/raw_syscall.h: Likewise. + * linux/sparc/raw_syscall.h: Likewise. + * linux/sparc64/raw_syscall.h: Likewise. + * linux/tile/raw_syscall.h: Likewise. + * linux/x32/raw_syscall.h: Likewise. + * linux/x86_64/raw_syscall.h: Likewise. + * linux/xtensa/raw_syscall.h: Likewise. + * Makefile.am (EXTRA_DIST): Add them. + +2018-03-23 Dmitry V. Levin + + tests: fix potentially unbound variable in kernel_version_code. + Fix the following use case: + + $ sh -uc '. tests/init.sh; kernel_version_code 4.5' + tests/init.sh: line 242: 3: unbound variable + + * tests/init.sh (kernel_version_code): Fix potentially unbound variable. + +2018-03-23 Dmitry V. Levin + + strace: further optimize unblocking of the delay signal handler. + Do not unblock the delay signal handler unless the delay timer is armed. + + * defs.h (is_delay_timer_created): Remove. + (is_delay_timer_armed, delay_timer_expired): New prototypes. + * delay.c (delay_timer_is_armed): New static variable. + (is_delay_timer_created): Add static qualifier. + (is_delay_timer_armed, delay_timer_expired): New functions. + (arm_delay_timer): Set delay_timer_is_armed. + * strace.c (next_event): Use is_delay_timer_armed instead of + is_delay_timer_created to check whether the delay signal handler + has to be unblocked. + (timer_sighandler): Invoke delay_timer_expired. + +2018-03-23 Dmitry V. Levin + + strace: rewrite restart error handling without sigsetjmp/siglongjmp. + Further simplify and optimize error handling of the delay signal handler + by replacing sigsetjmp/siglongjmp mechanism with an error flag. + + * strace.c: Do not include . + (restart_failed): New volatile variable. + (timer_jmp_buf): Remove. + (next_event): Cache is_delay_timer_created() return value, + remove sigsetjmp invocation, check restart_failed instead. + (timer_sighandler): Replace siglongjmp with setting restart_failed. + +2018-03-23 Dmitry V. Levin + + strace: do not call sigsetjmp without a delay timer. + As sigsetjmp costs a syscall, do not call it unless a delay timer + is already created and its signal handler is going to be unblocked. + + * strace.c (next_event): Move sigsetjmp invocation under + is_delay_timer_created() condition. + + Optimizes: v4.21-108-gba8e768 ("Implement delay injection") + +2018-03-22 Eugene Syromyatnikov + + tests/bpf.c: convert TEST_BPF_ macro to a function. + As it looks like there's no compelling reason to keep it as a macro and + leaving it so quite complicates modification of the routine and makes + them error-prone. + + * tests/bpf.c (TEST_BPF_): Convert it to... + (test_bpf): ...this. Rename cmd_ to cmd, cmd_str_ to cmd_str, + init_first_ to init_first, print_first_ to print_first, init_attr_ + to init_attr, print_attr_ to print_attr. + (TEST_BPF): Call test_bpf_ instead of TEST_BPF_. + +2018-03-22 Eugene Syromyatnikov + + tests: btrfs.c whitespace cleanup. + * tests/btrfs.c: Add spaces after PRI* format specifiers. + +2018-03-22 Elvira Khabirova + + tests: check delay injection. + * tests/delay.c: New file. + * tests/delay.test: New test. + * tests/.gitignore: Add delay. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (delay_LDADD): New variable. + (MISC_TESTS): Add delay.test. + + Co-Authored-by: Dmitry V. Levin + +2018-03-22 Elvira Khabirova + + Implement delay injection. + Add -e inject=SET:delay_enter= and -e inject=SET:delay_exit= options. + + * configure.ac (AC_SEARCH_LIBS): Check for timer_create -lrt. + * delay.c: New file. + * Makefile.am (strace_SOURCES): Add it. + (strace_LDADD): Add $(timer_LIBS). + * defs.h (INJECT_F_DELAY_ENTER, INJECT_F_DELAY_EXIT, + TCB_INJECT_DELAY_EXIT, TCB_DELAYED, inject_delay_exit, syscall_delayed): + New macros. + (alloc_delay_data, fill_delay_data, is_delay_timer_created, + arm_delay_timer, delay_tcb): New prototypes. + (struct inject_data): Replace reserved field with delay_idx. + (struct tcb): Add delay_expiration_time field. + * filter_qualify.c (parse_delay_token): New function. + (parse_inject_token): Use it. + (qualify_inject_common): Initialize struct inject_opts.data.delay_idx. + * strace.c: Include + (timer_jmp_buf, timer_set): New static variables. + (timer_sighandler, restart_delayed_tcb, restart_delayed_tcbs): New + functions. + (init): Block SIGALRM, set SIGALRM handler. + (dispatch_event): Do not restart delayed syscalls. + (next_event): Unblock SIGALRM during wait4 invocation. + * syscall.c (tamper_with_syscall_entering): Arm delay timer if + INJECT_F_DELAY_ENTER injection flag is set, set TCB_INJECT_DELAY_EXIT + flag if INJECT_F_DELAY_EXIT injection flag is set. + tamper_with_syscall_exiting): Arm delay timer if inject_delay_exit. + (syscall_exiting_trace): Call tamper_with_syscall_exiting in case of + inject_delay_exit. + (syscall_exiting_finish): Clear TCB_INJECT_DELAY_EXIT flag. + * strace.1.in: Document delay injection. + * NEWS: Mention this improvement. + + Co-Authored-by: Dmitry V. Levin + +2018-03-22 Dmitry V. Levin + + Do not block handled signals in interactive mode. + Let these signals be handled asynchronously as they are acted on + only when waiting for process state changes. + + * strace.c (start_set, blocked_set): Remove. + (set_sighandler): Do not update blocked_set. + (startup_attach, init, next_event): Remove all sigprocmask calls. + +2018-03-21 Eugene Syromyatnikov + + bpf: improve handling of various sizes of bpf_prog_attr structure. + As program attributes have been added gradually over kernel versions, + attribute size less than expected should be printed accordingly. + + * bpf.c (DEF_BPF_CMD_DECODER(BPF_PROG_LOAD)): Do not print structure + fields if their size is less than the initially introduced (in Linux + commit v3.18-rc1~52^2~1^2~7) version. Print fields of union bpf_attr + introduced in various kernel versions when the length is big enough + (new fields were introduced in Linux commits v3.18-rc1~52^2~1^2~4, + v4.1-rc1~84^2~50, and v4.12-rc2~34^2~29^2~2). + * tests/bpf.c (print_BPF_PROG_LOAD_first): Update expected output. + + Co-Authored-by: Dmitry V. Levin + +2018-03-20 Eugene Syromyatnikov + + btrfs: print struct btrfs_ioctl_logical_ino_args.reserved if non-zero. + * btrfs.c (btrfs_ioctl) : Print + struct btrfs_ioctl_logical_ino_args.reserved field if it is not zero. + * tests/btrfs.c (btrfs_test_ino_path_ioctls): Check it. + + Co-Authored-by: Dmitry V. Levin + +2018-03-20 Eugene Syromyatnikov + + Move is_filled and IS_ZERO to macros.h, rename IS_ZERO to IS_ARRAY_ZERO. + * s390.c: Replace all IS_ZERO invocations with IS_ARRAY_ZERO. + (is_filled, IS_ZERO): Move... + * macros.h: ...here. + (is_filled): Add inline qualifier, add const qualifier to ptr. + (IS_ZERO): Rename to IS_ARRAY_ZERO, cast arr_ to "const char *". + + Co-Authored-by: Dmitry V. Levin + +2018-03-20 Dmitry V. Levin + + mpers.m4: enhance workaround for missing gnu/stubs-*.h files. + Make generated empty gnu stub files available for mpers_test.sh check. + + * m4/mpers.m4 (st_MPERS): Add $IFLAG to CPPFLAGS for mpers_test.sh + invocation. + + Complements: v4.11~223 ("mpers.m4: workaround missing gnu/stubs-*.h files") + +2018-03-20 Eugene Syromyatnikov + + README.md: add references to binary strace packages. + * README.md: Add references to binary strace packages in OBS, + Fedora rawhide, and Sisyphus. + + Co-Authored-by: Dmitry V. Levin + +2018-03-20 Eugene Syromyatnikov + + INSTALL-git.md: enhance phrasing. + * INSTALL-git.md: Enhance phrasing. + + Co-Authored-by: Dmitry V. Levin + +2018-03-20 Dmitry V. Levin + + bootstrap: distribute README. + * bootstrap: Install README before invoking autoreconf to get README + included into distributed tarball. + + Fixes: v4.21-93-g4bb8454 ("Move README to dist subdirectory") + +2018-03-20 Dmitry V. Levin + + Replace struct timeval with struct timespec in time measurements. + This is required to implement more precise time measurements. + + * Makefile.am (strace_LDADD): Add $(clock_LIBS). + * defs.h (struct tcb): Change the type of stime, dtime, and etime fields + from struct timeval to struct timespec, all users updated. + (syscall_exiting_decode, syscall_exiting_trace, count_syscall): Change + the type of "struct timeval *" argument to "struct timespec *", all + users updated. + (tv_nz, tv_cmp, tv_float, tv_add, tv_sub, tv_div, tv_mul): Rename to + ts_nz, ts_cmp, ts_float, ts_add, ts_sub, ts_div, and ts_mul. Change + the type of all "struct timeval *" arguments to "struct timespec *", + all users updated. + * util.c (tv_nz, tv_cmp, tv_float, tv_add, tv_sub, tv_div, tv_mul): + Rename to ts_nz, ts_cmp, ts_float, ts_add, ts_sub, ts_div, and ts_mul. + Change the type of all "struct timeval *" arguments to "struct timespec *". + * count.c (struct call_counts): Change the type of "time" field + from struct timeval to struct timespec, all users updated. + (overhead): Change type from struct timeval to struct timespec, all + users updated. + (count_syscall): Change the type of "struct timeval *" argument to + "struct timespec *". + * strace.c (printleader): Change the type of struct timeval variables + to struct timespec, call clock_gettime instead of gettimeofday. + (next_event, trace_syscall): Change the type of struct timeval variables + to struct timespec. + * syscall.c (syscall_entering_finish, syscall_exiting_decode): Call + clock_gettime instead of gettimeofday. + +2018-03-20 Dmitry V. Levin + + Fix -O option handling. + Fast syscalls usually take less than a microsecond of system cpu time + nowadays, making -O option almost useless. + + * count.c (call_summary_pers): Avoid negative time counts. + * tests/count.test: Check it. + * NEWS: Mention it. + +2018-03-16 Dmitry V. Levin + + count: cleanup count_syscall. + * count.c (shortest): Remove. + (overhead): Initialize to zero. + (call_summary_pers): Remove shortest handling. + (count_syscall): Remove dead code. The remaining code does the same + wrong calculations as before the change, though. + + printleader: cleanup tflag handling. + * strace.c (printleader): Move declarations of variables closer + to their first use. + +2018-03-16 Dmitry V. Levin + + Move install.texi to maint subdirectory. + This file comes from GNU Autoconf and is used to generate INSTALL file. + + * install.texi: Move... + * maint/install.texi: ...here. + +2018-03-16 Eugene Syromyatnikov + + doc: update commit requirements. + * README-hacking (Requirements): Enhance phrasing. + (Commit log requirements): Rename to "Commit requirements", + describe "absence of whitespace errors" requirement, add references + to the Linux kernel coding style and scripts/checkpatch.pl script. + + Co-Authored-by: Dmitry V. Levin + +2018-03-16 Eugene Syromyatnikov + + Move README to dist subdirectory. + README was originally written for users of distribution tarballs. + Nowadays it appears to be confusing for those who build strace + using a GIT version of strace source code. + + * README: Move... + * dist/README: ...here. + * bootstrap: Copy README from dist subdirectory to the toplevel + directory after successful autoreconf. + + Co-Authored-by: Dmitry V. Levin + References: https://github.com/strace/strace/issues/56 + +2018-03-15 Eugene Syromyatnikov + + README: synchronise with README.md. + * README: Extend description, reference COPYING. + +2018-03-15 Eugene Syromyatnikov + + poll.c: remove special INFTIM handling. + On Linux, poll syscall interprets any negative timeout value as an + infinite timeout, so no need to handle BSD-specific INFTIM. + + * poll.c (SYS_FUNC(poll)): Remove INFTIM handling. + +2018-03-14 Dmitry V. Levin + + build: do not hardcode -lrt. + Depending on libc implementation, various -lrt functions can be + implemented either in -lc or in -lrt. For example, starting with + glibc-2.17 the clock_* suite of functions is available directly in -lc. + + Check whether clock_* and mq_* suites of functions are provided + by -lrt or by the main C library, do not link with -lrt unnecessarily. + + This change affects only tests yet, but this is going to be + more important as soon as strace starts using clock_gettime. + + * configure.ac (AC_SEARCH_LIBS): Check for clock_gettime and mq_open + in -lrt. + (AC_SUBST): Add clock_LIBS and mq_LIBS. + * tests/Makefile.am (mq_LDADD): Replace -lrt with $(mq_LIBS). + (threads_execve_LDADD, times_LDADD): Replace -lrt with $(clock_LIBS). + +2018-03-14 Dmitry V. Levin + + tests: do not link with -lrt unnecessarily. + * tests/Makefile.am (attach_f_p_LDADD): Remove -lrt. + (clock_xettime_LDADD, mq_sendrecv_LDADD, mq_sendrecv_read_LDADD, + mq_sendrecv_write_LDADD): Remove. + +2018-03-13 Dmitry V. Levin + + Optimize pid2tcb. + Introduce an internal cache of pid2tcb translations. + This can save more than 80% of CPU user time spent by strace. + + Tested using the following setup: + + #include + #include + #include + int main() + { + int i; + sleep(1); + for (i = 1; i < 1000; ++i) { + pid_t pid = fork(); + if (pid < 0) + return 2; + if (pid) + return wait(&i) != pid || i; + } + sleep(1); + for (i = 0; i < 10000000; ++i) + umask(0777); + return 0; + } + + old$ ./set_ptracer_any ./pid2tcb >pid2tcb.wait & \ + while [ ! -s pid2tcb.wait ]; do sleep 0.1; done; \ + time -f '%Uuser %Ssystem %eelapsed %PCPU' \ + ../strace -qq -enone -esignal=none -f -p $! + 5.51user 104.90system 122.45elapsed 90%CPU + + new$ ./set_ptracer_any ./pid2tcb >pid2tcb.wait & \ + while [ ! -s pid2tcb.wait ]; do sleep 0.1; done; \ + time -f '%Uuser %Ssystem %eelapsed %PCPU' \ + ../strace -qq -enone -esignal=none -f -p $! + 1.29user 102.78system 114.97elapsed 90%CPU + +2018-03-13 Dmitry V. Levin + + Enable USE_SEIZE code unconditionally. + It is by no means an experimental code. + + * defs.h (USE_SEIZE): Remove. + * strace.c [!USE_SEIZE]: Remove. + +2018-03-13 Dmitry V. Levin + + ci: clone musl from the local server. + Assume that strace project on the local server contains an appropriate + musl repository, use this repository instead of hardcoded github + location. + + * ci/install-dependencies.sh (clone_repo): Use local server by default. + (musl-gcc): Un-hardcode the location of musl repository. + +2018-03-13 Dmitry V. Levin + + ci: refactor cloning of additional repositories. + * ci/install-dependencies.sh (clone_repo): New function. + Use it instead of direct invocations of git clone. + + ci: extend error diagnostics when configure invocation fails. + * ci/run-build-and-tests.sh: Include $CC -dumpspecs output in addition + to config.log when ./configure fails. + + ci: rename travis-build.sh and travis-install.sh scripts. + * travis-build.sh: Rename to ci/run-build-and-tests.sh, all callers + updated. + * travis-install.sh: Rename to ci/install-dependencies.sh, all callers + updated. + + tests: extend ioctl.test libc protection to -y output. + * tests/ioctl.test: Extend the filter of ioctl calls with standard + descriptor arguments to -y output. + +2018-03-12 Harsha Sharma + + ptp.c: print field names and use macros form print_fields.h. + * ptp.c: Include "print_fields.h". + (ptp_ioctl): Print field names with field values for PTP_PEROUT_REQUEST, + use macros from print_fields.h. + +2018-03-11 Chen Jingpiao + + tests: add check for decoding of netfilter subsystem. + * tests/netlink_netfilter.c(test_nfgenmsg): Add check for decoding + of netfilter subsystem. + + nfnetlink: introduce generic netfilter subsystem decoder. + * netlink_netfilter.c: Include "nlattr.h". + (decode_netlink_netfilter): Call decode_nlattr. + +2018-03-11 Chen Jingpiao + + Move nl_netfilter_msg_types definition from netlink.c to netlink_netfilter.c + The side effect of #include "xlat/nl_netfilter_msg_types.h" is + NFNL_MSG_BATCH_* constants properly defined in that header file. + While netlink.c does not use these constants itself, + netlink_netfilter.c is going to need them soon. + + * defs.h (nl_netfilter_msg_types): New xlat prototype. + * netlink.c: Move inclusion of "xlat/nl_netfilter_msg_types.h" ... + * netlink_netfilter.c: ... here. + +2018-03-11 Chen Jingpiao + + tests: add check for NETLINK_NETFILTER parser. + * tests/netlink_netfilter.c: Include , + and . + Replace "netlink.h" with "test_netlink.h". + (NFNL_SUBSYS_NFTABLES, NFT_MSG_NEWTABLE): New macros. + (test_nlmsg_done, test_nfgenmsg): New functions. + (main): Use them. + + netlink: introduce NETLINK_NETFILTER parser. + * netlink_netfilter.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * defs.h (decode_netlink_netfilter): New prototype. + * netlink.c (netlink_decoders): Add NETLINK_NETFILTER. + * xlat/netfilter_versions.in: New file. + +2018-03-11 Chen Jingpiao + + xlat: remove NFNL_SUBSYS_COUNT constant. + NFNL_SUBSYS_COUNT is not a symbol with some constant value, it changes + with time, just print it as an unrecognized number. + + * xlat/nl_netfilter_subsys_ids.in (NFNL_SUBSYS_COUNT): Remove. + +2018-03-10 Dmitry V. Levin + + inject_data: make room for more injection features. + * defs.h (struct inject_data): Squeeze flags and signo fields from + uint16_t to uint8_t to make room for more injection features. + +2018-03-09 Eugene Syromyatnikov + + xlat: sort v4l2_pix_fmts.in and v4l2_sdr_fmts.in. + * xlat/v4l2_pix_fmts.in: Sort by value, add a comment about sorting. + * xlat/v4l2_sdr_fmts.in: Likewise. + +2018-03-09 Dmitry V. Levin + + xlat: add comments to all sorted xlat files. + Add a short comment describing the method used to sort entries. + + * xlat/ethernet_protocols.in: Update the comment about sorting. + * xlat/fsmagic.in: Likewise. + * xlat/evdev_keycode.in: Add a comment about sorting. + * xlat/hw_breakpoint_type.in: Likewise. + * xlat/perf_hw_cache_id.in: Likewise. + * xlat/perf_hw_cache_op_id.in: Likewise. + * xlat/perf_hw_cache_op_result_id.in: Likewise. + * xlat/perf_hw_id.in: Likewise. + * xlat/perf_sw_ids.in: Likewise. + * xlat/perf_type_id.in: Likewise. + +2018-03-09 Eugene Syromyatnikov + + bpf: remove page size caching. + get_pagesize() has a static cache anyway, no need to duplicate it. + + * bpf.c (SYS_FUNC(bpf)): Remove static size_t page_size and its + initialisation, use get_pagesize() as the size of buf directly. + +2018-03-09 Eugene Syromyatnikov + + bpf_filter: fix indentation of the switch clause. + * bpf_filter.c (print_bpf_filter_code): Fix switch clause indentation. + +2018-03-08 Dmitry V. Levin + + xlat: provide fallback definitions for arch-independent mmap flags. + This is important for recently introduced MAP_SHARED_VALIDATE flag. + + * xlat/mmap_flags.in (MAP_SHARED, MAP_PRIVATE, MAP_SHARED_VALIDATE): + Add constant values. + + Fixes: v4.21-67-g8c209d1 ("tests: fix remap_file_pages.test breakage on hppa") + +2018-03-07 Eugene Syromyatnikov + + bpf: print kern_version in the form of KERNEL_VERSION macro. + * bpf.c (DEF_BPF_CMD_DECODER(BPF_PROG_LOAD)): Print + union bpf_attr.kern_version in the form of KERNEL_VERSION macro call. + * tests/bpf.c: Update expected output. + +2018-03-07 Eugene Syromyatnikov + + tests: fix remap_file_pages.test breakage on hppa. + Apparently, hppa is the only architecture that has MAP_TYPE + defined to 0x3 instead of 0xf, and the tests hit that corner case. + + * tests/remap_file_pages.c (main) [MAP_HUGETLB]: Print the value + of mapping type depending on the architecture (MAP_SHARED_VALIDATE + for hppa and unknown value for other architectures). + + Fixes: v4.21~59 ("xlat: update MAP_* constants") + +2018-03-07 Eugene Syromyatnikov + + Sort Ethernet protocols xlat. + * defs.h (ethernet_protocols_size): New declaration. + * netlink_packet_diag.c (decode_packet_diag_req): Use + printxval_searchnn to print Ethernet protocols. + * sockaddr.c (ethernet_protocols_size): New constant, item count + in ethernet_protocols array. + (print_sockaddr_data_ll): Use printxval_search instead of + printxval to print Ethernet protocols. + * xlat/ethernet_protocols.in: Sort it by value, add comment + about the fact. + + Co-Authored-by: Dmitry V. Levin + +2018-03-07 Eugene Syromyatnikov + + Change sorted arrays to be terminated with XLAT_END like unsorted arrays + It is quite unwieldy to have this distinction between sorted and + unsorted arrays when we can just decrement the size in a wrapper. + + * defs.h (printxval_search): Decrement array size. + * xlat/fsmagic.in (#unterminated): Remove. + * xlat/hw_breakpoint_type.in (#unterminated): Remove. + * xlat/perf_hw_cache_id.in (#unterminated): Remove. + * xlat/perf_hw_cache_op_id.in (#unterminated): Remove. + * xlat/perf_hw_cache_op_result_id.in (#unterminated): Remove. + * xlat/perf_hw_id.in (#unterminated): Remove. + * xlat/perf_sw_ids.in (#unterminated): Remove. + * xlat/perf_type_id.in (#unterminated): Remove. + * xlat/gen.sh (gen_header): Remove #unterminated support. + + Co-Authored-by: Dmitry V. Levin + +2018-03-06 Eugene Syromyatnikov + + strace.1.in: add a note about tracing of scripts without shebang. + * strace.1.in (.SH NOTES): Note that tracing of scripts without shebang + won't work. + + Reported-by: Mike Parker + Closes: https://github.com/strace/strace/issues/46 + +2018-03-06 Eugene Syromyatnikov + + strace.1.in: mention that -c suppresses regular output. + As the note that -C makes strace "also print regular output" can be + easily overlooked. + + * strace.1.in (.SS Statistics) <.TP .B \-c>: Mention that -c supresses + regular output. + +2018-03-06 Eugene Syromyatnikov + + errnoent.h: add ERECALLCONFLICT. + * linux/errnoent.h ([530]): Add ERECALLCONFLICT error introduced by + Linux commit v4.7-rc1~40^2~6. + * linux/alpha/errnoent.h ([530]): Likewise. + * linux/hppa/errnoent.h ([530]): Likewise. + * linux/mips/errnoent.h ([530]): Likewise. + * linux/sparc/errnoent.h ([530]): Likewise. + + xlat: add BPF_F_ALLOW_MULTI constant. + * xlat/bpf_attach_flags.in (BPF_F_ALLOW_MULTI): New constant, introduced + by Linux commit v4.15-rc1~84^2~558^2~7. + + xlat: add BPF_MAP_TYPE_CPUMAP constant. + * xlat/bpf_map_types.in (BPF_MAP_TYPE_CPUMAP): New constant, introduced + by Linux commit v4.15-rc1~84^2~427^2~4. + + tests/test_printstrn.c: do not declare i again. + +2018-03-06 Eugene Syromyatnikov + + tests/s390_sthyi.c: make utility functions inline. + When built with --enable-gcc-Werror, s390_sthyi test build fails + with the following error: + + s390_sthyi.c:63:1: error: ‘print_u8’ defined but not used [-Werror=unused-function] + print_u8(const char *prefix, unsigned char *buf, unsigned int offs, bool zero) + ^~~~~~~~ + + Apparently, after some back and forth, all occurrences of printing u8 + values landed under verbose printing, so this function is no longer + used in non-verbose mode. Let's avoid this in the future by inlining + all the utility functions in this test. + + * tests/s390_sthyi.c (print_0x8, print_u8, print_u16, print_x32, + print_weight, ebcdic2ascii, is_empty, print_ebcdic): Add inline + qualifier. + [!VERBOSE] (is_empty): Remove "# if VERBOSE" guard. + +2018-03-06 Eugene Syromyatnikov + + btrfs: print struct btrfs_ioctl_logical_ino_args.flags field. + The field has been introduced in Linux commit v4.15-rc1~135^2~17. + + * btrfs.c: Implement decoding of + struct btrfs_ioctl_logical_ino_args.flags field. + * configure.ac: Check for struct btrfs_ioctl_logical_ino_args.flags + presence in linux/btrfs.h. + * tests/btrfs.c: Update expected output, add additional checks. + * xlat/btrfs_logical_ino_args_flags.in: New file. + +2018-03-06 Eugene Syromyatnikov + + btrfs.c: print __u64 fields with pointer semantics using printaddr64. + * btrfs.c (btrfs_ioctl) : Print fspath field + with printaddr64. + (btrfs_ioctl) : Print inodes field with + printaddr64. + * tests/btrfs.c: Add checks for NULL in fspath and inodes fields. + * NEWS: Mention it. + +2018-03-06 Eugene Syromyatnikov + + util.c: introduce printaddr64. + Sometimes, 64-bit value is expected to be interpreted as an address + (in BTRFS ioctl interface, for example). + + * defs.h (printaddr64): New declaration. + * util.c (printaddr64): Rename from printaddr, change argument type + to uint64_t. + (printaddr): Turn into a thin wrapper around printaddr64. + (printnum_addr_int, printnum_addr_int64): Use printaddr64 instead of + printaddr. printnum_addr_int64 is not used outside the cases where + kernel_long is less or equal than 64 bit currently, so this change + should be safe. + +2018-03-06 Eugene Syromyatnikov + + prctl: add decoding of PR_SVE_SET_VL and PR_SVE_GET_VL commands. + These commands were introduced in Linux commit v4.15-rc1~110^2~9. + + * xlat/pr_sve_vl_flags.in: New file. + * xlat/prctl_options.in: Likewise. + * prctl.c: Include "xstring.h" and "xlat/pr_sve_vl_flags.h". + [!PR_SVE_VL_LEN_MASK] (PR_SVE_VL_LEN_MASK): New macro constant. + (sprint_sve_val): New function. + (SYS_FUNC(prctl)): Add decoding for PR_SVE_GET_VL and PR_SVE_SET_VL + commands. + * NEWS: Mention it. + +2018-03-06 Eugene Syromyatnikov + + Implement PTRACE_SECCOMP_GET_METADATA ptrace request decoding. + * defs.h (seccomp_filter_flags): New declaration. + * process.c (SYS_FUNC(ptrace)): Implement PTRACE_SECCOMP_GET_METADATA + request decoding. + * ptrace.h [!PTRACE_SECCOMP_GET_METADATA] (PTRACE_SECCOMP_GET_METADATA): + New macro constant. + * xlat/ptrace_cmds.in (PTRACE_SECCOMP_GET_METADATA): New constant. + * tests/ptrace.c (main): Add some checks for PTRACE_SECCOMP_GET_METADATA + request decoding. + * NEWS: Mention it. + + Co-Authored-by: Dmitry V. Levin + +2018-03-06 Dmitry V. Levin + + build: prepare for -Wimplicit-fallthrough=5. + * gcc_compat.h (ATTRIBUTE_FALLTHROUGH): New macro. + * block.c (block_ioctl): Use it instead of "fall through" comment. + * btrfs.c (btrfs_ioctl): Likewise. + * loop.c (loop_ioctl): Likewise. + * mtd.c (mtd_ioctl): Likewise. + * rtc.c (rtc_ioctl): Likewise. + * v4l2.c (v4l2_ioctl): Likewise. + * dm.c (dm_decode_values): Likewise. + * process.c (SYS_FUNC(ptrace)): Likewise. + * quota.c (decode_cmd_data): Likewise. + * ucopy.c (umovestr): Likewise. + * unwind.c (unwind_print_stacktrace, unwind_capture_stacktrace)): + Likewise. + * term.c (term_ioctl): Add ATTRIBUTE_FALLTHROUGH. + * ioctl.c (ioctl_decode) [ALPHA || POWERPC]: Likewise. + * m4/st_warn_cflags.m4 (gl_WARN_ADD): Add -Wimplicit-fallthrough=5. + * tests/ioctl_v4l2.c (init_v4l2_format): Reorganize the switch statement + without implicit fallthrough. + +2018-03-05 Eugene Syromyatnikov + + xlat: add eBPF-based device controller constants. + Add new BPF_PROG_TYPE_CGROUP_DEVICE eBPF program type and new + BPF_CGROUP_DEVICE eBPF program attach type, added in Linux commit + v4.15-rc1~84^2~120^2~2. + + * xlat/bpf_attach_type.in (BPF_CGROUP_DEVICE): New constant. + * xlat/bpf_prog_types.in (BPF_PROG_TYPE_CGROUP_DEVICE): Likewise. + * NEWS: Mention it. + +2018-03-02 Eugene Syromyatnikov + + xlat: provide fallback definitions for input event constants. + Values added using the following pair of commands: + + $ cat xlat/evdev_keycode.in | + while read r; do [ -n "$r" ] && + sed -rn 's/^#define[[:space:]]+('$r'[[:space:]]+[^[:space:]]+).*/\1/p' \ + ~/dev/linux/include/uapi/linux/input-event-codes.h || echo; + done > xlat/evdev_keycode.in.new + $ sort -s -n -k1,1 \ + <(awk '{if (NF>1) {last = strtonum($2)}; printf("%d %s\n", last, $0)}' \ + xlat/evdev_keycode.in.new) \ + | sed 's/^[0-9]* //' > xlat/evdev_keycode.in + + It also verifies that the values are sorted and bsearch-ready. + + * xlat/evdev_keycode.in: Add constant values. + +2018-03-02 Eugene Syromyatnikov + + xlat: update the list of input event constants. + Remove some duplicating definitions and add the new ones. + + * xlat/evdev_keycode.in (KEY_HANGUEL): Remove, an alternative name for + KEY_HANGEUL. + (KEY_DIRECTION): Remove, an alternative name for KEY_ROTATE_DISPLAY. + (KEY_BRIGHTNESS_ZERO): Remove, an alternative name for + KEY_BRIGHTNESS_AUTO. + (KEY_WIMAX): Remove, an alternative name for KEY_WWAN. + (BTN_A): Remove, an alternative name for BTN_SOUTH. + (BTN_B): Remove, an alternative name for BTN_EAST. + (BTN_X): Remove, an alternative name for BTN_NORTH. + (BTN_Y): Remove, an alternative name for BTN_WEST. + (BTN_STYLUS3): New constant, added in Linux commit v4.15-rc1~114^2^2~1. + (KEY_BRIGHTNESS_TOGGLE): Remove, an alternative name for + KEY_DISPLAYTOGGLE. + (KEY_ROTATE_LOCK_TOGGLE): New constant, added in Linux commit + v4.16-rc1~54^2~67. + (KEY_DATA): New constant, added in Linux commit v4.9-rc8~12^2. + (KEY_ONSCREEN_KEYBOARD): New constant, added in Linux commit + v4.12-rc1~126^2~2^12~5. + * NEWS: Mention it. + +2018-03-02 Eugene Syromyatnikov + + xlat: provide fallback definitions for SCTP socket option constants. + Values for SCTP_GET_PEER_ADDRS_NUM_OLD, SCTP_GET_PEER_ADDRS_OLD, + SCTP_GET_LOCAL_ADDRS_NUM_OLD, SCTP_GET_LOCAL_ADDRS_OLD are reconstructed + from Linux commit v2.6.33-rc1~388^2~167^2~7. + + xlat/socksctpoptions.in: Add constant values. + +2018-03-02 Eugene Syromyatnikov + + xlat: update the list of SCTP socket option constants. + * xlat/socksctpoptions.in (SCTP_DELAYED_ACK): Rename to... + (SCTP_DELAYED_SACK): ...this, per Linux commit v2.6.38-rc2~33^2. + (SCTP_SOCKOPT_PEELOFF_FLAGS): New constant, introduced in Linux commit + v4.13-rc1~157^2~39. + (SCTP_STREAM_SCHEDULER): New constant, introduced in Linux commit + v4.15-rc1~84^2~567^2~3. + (SCTP_STREAM_SCHEDULER_VALUE): New constant, introduced in Linux commit + v4.15-rc1~84^2~567^2~2. + (SCTP_INTERLEAVING_SUPPORTED): New constant, introduced in Linux commit + v4.16-rc1~123^2~384^2~11. + * NEWS: Mention it. + +2018-03-02 Eugene Syromyatnikov + + xlat: provide fallback definitions for Ethernet protocol constants. + As those are not architecture-specific. + + * xlat/ethernet_protocols.in: Add values to constants. + +2018-03-02 Eugene Syromyatnikov + + xlat: update the list of Ethernet protocol constants. + * xlat/ethernet_protocols.in (ETH_P_ERSPAN2): New constant, introduced + in Linux commit v4.16-rc1~123^2~355^2~2. + (ETH_P_IBOE): New constant, introduced in commit v4.11-rc1~73^2~74. + * NEWS: Mention it. + + v4l2: print known pixel/SDR formats. + * xlat/v4l2_pix_fmts.in: New file. + * xlat/v4l2_sdr_fmts.in: Likewise. + * v4l2.c [!v4l2_fourcc_be] (v4l2_fourcc_be): New macro. + (print_pixelformat): Add xlat parameter, print constant name + as a comment if it has been found in xlat. + (print_v4l2_fmtdesc, print_v4l2_frmivalenum): Pass v4l2_pix_fmts + to print_pixelformat. + (print_v4l2_format_fmt) : Pass v4l2_pix_fmts to print_pixelformat. + (print_v4l2_format_fmt) : Pass v4l2_sdr_fmts to print_pixelformat. + * tests/v4l2.c: Test it, update expected output. + * NEWS: Mention it. + +2018-03-02 Eugene Syromyatnikov + + v4l2: v4l2_fourcc is endianness-agnostic. + v4l2_fourcc(a, b, c, d) is defined as (a | (b << 8) | (c << 16) | (d << 24) + regardless of endianness (no mnemonic on big-endian architectures), + so we don't need special handling for WORDS_BIGENDIAN both in decoder + and in the test. + + * v4l2.c (print_pixelformat): Change initialisation to a simple + assignment of character array. + * tests/ioctl_v4l2.c [WORDS_BIGENDIAN]: Remove. + * NEWS: Mention this fix. + + Co-Authored-by: Dmitry V. Levin + Fixes: v4.10~371 "Implement Video4Linux video-input ioctls decoder" + +2018-03-01 Dmitry V. Levin + + tests: do not include in files that include "tests.h" + Starting with commit v4.21-37-g4f63bc70ca95012d72e288fc3c1eeb3ba26068a4, + is included by tests.h, so all tests that already include + "tests.h" do not need to include . + + * tests/btrfs.c: Do not include . + * tests/file_handle.c: Likewise. + * tests/futex.c: Likewise. + * tests/ioctl_dm.c: Likewise. + * tests/ioctl_loop.c: Likewise. + * tests/ioctl_sock_gifconf.c: Likewise. + * tests/keyctl.c: Likewise. + * tests/mq_sendrecv.c: Likewise. + * tests/perf_event_open.c: Likewise. + * tests/s390_guarded_storage.c: Likewise. + * tests/s390_pci_mmio_read_write.c: Likewise. + * tests/s390_sthyi.c: Likewise. + * tests/xet_thread_area_x86.c: Likewise. + +2018-03-01 Eugene Syromyatnikov + + tests: check printing of block/char device numbers in -yy mode. + * tests/dev-yy.c: New file. + * tests/pure_executables.list: Add dev-yy. + * tests/.gitignore: Likewise. + * tests/gen_tests.in (dev-yy): New test. + +2018-03-01 Eugene Syromyatnikov + + printfd: print character/block device number in -yy mode. + * util.c: Include , , + and "largefile_wrappers.h". + (printsocket, printdev): New functions. + (printfd): Move socket matching/printing logic to printsocket. Check + also for printdev. Escape opening angle bracket in addition to closing angle + bracket as it can show up as a separator in printdev. + * tests/fsync-y.c: Update expected output. + * strace.1.in: Mention this. + * NEWS: Likewise. + + Co-Authored-by: Dmitry V. Levin + +2018-03-01 Eugene Syromyatnikov + + util.c: escape closing angle bracket in printfd. + * util.c (printfd): Use print_quoted_string_ex instead of + print_quoted_string, specify ">" as escape_chars argument. + * tests/fsync-y.c (main): Update expected output. + * NEWS: Mention it. + +2018-03-01 Eugene Syromyatnikov + + util.c: add support for additional escape characters in string_quote. + Quotes are not always used to denote string limits; printfd uses angle + brackets for that, for example. As result, mechanism for supplying + set of additional characters in order to avoid ambiguities regarding + the end of the quoted string is needed. + + * defs.h (string_quote): Add escape_chars parameter. + (print_quoted_string_ex): New function prototype. + * util.c (string_quote): Add escape_chars parameter. + (print_quoted_string_ex): Rename from print_quoted_string, add + escape_chars parameter, pass it to string_quote call. + (print_quoted_string): Turn into a thin wrapper around + print_quoted_string_ex. + (printstr_ex): Pass NULL as escape_chars argument of string_quote call. + * socketutils.c (unix_parse_response): Pass NULL as escape_chars + argument of string_quote call. + * tests/print_quoted_string.c (print_octal): New function. + print_quoted_memory_ex): Use it. Add escape_chars parameter. + (print_quoted_memory): Pass NULL as escape_chars argument + of print_quoted_memory_ex call. + * tests/tests.h (print_quoted_string_ex, print_quoted_memory_ex): Add + escape_chars parameter. + * tests/fsync-y.c: Pass NULL as escape_chars argument of + print_quoted_string_ex call. + + Co-Authored-by: Dmitry V. Levin + +2018-03-01 Eugene Syromyatnikov + + tests: check file name printing in strace -y mode. + * tests/fsync-y.c: New file. + * tests/.gitignore: Add fsync-y. + * tests/Makefile.am (check_PROGRAMS): Likewise. + * tests/gen_tests.in (fsync-y): New test. + + Co-Authored-by: Dmitry V. Levin + +2018-03-01 Eugene Syromyatnikov + + tests: add print_quoted_string_ex and print_quoted_memory_ex functions. + * tests/tests.h (print_quoted_string_ex, print_quoted_memory_ex): New + declarations. + * tests/print_quoted_string.c (print_quoted_string_ex): New function, + a thin wrapper around print_quoted_memory_ex wrapper. + (print_quoted_memory_ex): Rename from print_quoted_memory, add quote + argument. + (print_quoted_memory): Turn into a thin wrapper around + print_quoted_memory_ex. + + tests: check escaping in string printing. + * tests/test_printstrn.c (test_print_memory): New function. + (test_printstrn): Use it. + + Do not go full octal if the next char is '8' or '9' + * util.c (string_quote): Change the upper limit for the next character + in unabbreviated octal printing from '9' to '7'. + * tests/print_quoted_string.c (print_quoted_memory): Likewise. + + tests: fix abbreviated octal escape check in print_quoted_memory. + * tests/print_quoted_string.c (print_quoted_memory): Check the next + character after octal-escaped one instead of the first one in the + string. + +2018-03-01 Eugene Syromyatnikov + + util.c: reduce indentation in non-hexadecimal case in string_quote. + As it is already too deep there. + + * util.c (string_quote): Add string_ended label, jump there + after the loop in "if (usehex)" case. + +2018-03-01 Eugene Syromyatnikov + + util.c: fix switch statement indentation in string_quote. + While we are here, let's also remove unnecessary break statement + in the default case. + +2018-02-27 Dmitry V. Levin + + Replace fopen_for_input and fopen_for_output with fopen_stream. + * largefile_wrappers.h (fopen_for_input, fopen_for_output): Replace + with fopen_stream. + * mmap_cache.c (fopen_for_input) Likewise. + * strace.c (fopen_for_output): Likewise. + +2018-02-27 Eugene Syromyatnikov + + Update the list of INET_DIAG_BC_* operators. + * linux/inet_diag.h (INET_DIAG_BC_S_EQ, INET_DIAG_BC_D_EQ): New + enumeration items introduced by linux kernel commit v4.16-rc1~123^2~259. + * xlat/inet_diag_bytecodes.in (INET_DIAG_BC_S_EQ, INET_DIAG_BC_D_EQ): New + constants. + * NEWS: Mention it. + + xlat: update the list of SCHED_FLAG_* constants. + * xlat/sched_flags.in (SCHED_FLAG_RECLAIM, SCHED_FLAG_DL_OVERRUN): New + constants introduced by linux kernel commits v4.13-rc1~205^2~27 and + v4.16-rc1~164^2~8, respectively. + (SCHED_FLAG_RESET_ON_FORK): Add constant value. + * tests/sched_xetattr.c: Update expected output. + * NEWS: Mention it. + + xlat: provide fallback definitions for arch-independent poll event flags + * xlat/pollflags.in (POLLIN, POLLPRI, POLLOUT, POLLRDNORM, POLLRDBAND, + POLLERR, POLLHUP, POLLNVAL, POLL_BUSY_LOOP): Add constant values. + +2018-02-27 Eugene Syromyatnikov + + xlat: update the list of poll event flags. + POLL_BUSY_LOOP was introduced by linux kernel commit v3.11-rc1~64^2~129 + as POLL_LL and then renamed in v3.11-rc1~64^2~9. POLLRDHUP was + introduced by linux kernel commit v2.6.17-rc1~796. POLLMSG and + POLLREMOVE predate git repository. POLLFREE was introduced by linux + kernel commit v3.3-rc5~8 for internal use only. + + * xlat/pollflags.in (POLLMSG, POLLREMOVE, POLLRDHUP, POLL_BUSY_LOOP): + New constants. + * NEWS: Mention it. + +2018-02-27 Eugene Syromyatnikov + + xlat: add arch-specific si_codes constants. + Based on Linux commits v4.16-rc1~159^2~17, v4.16-rc1~159^2~16, + v4.16-rc1~159^2~15, and v4.16-rc1~159^2~14. + + * xlat/sigbus_codes.in (BUS_OPFETCH): New constant. + * xlat/sigfpe_codes.in (FPE_MDAOVF, __FPE_DECOVF, __FPE_DECDIV, + __FPE_DECERR, __FPE_INVASC, __FPE_INVDEC): New constants. + * xlat/sigill_codes.in (ILL_ILLPARAOP, ILL_ILLEXCPT, ILL_CPLB_VI, + ILL_CPLB_MISS, ILL_CPLB_MULHIT, ILL_DBLFLT, ILL_HARDWALL, ILL_BADIADDR, + __ILL_BREAK, __ILL_BNDMOD): Likewise. + * xlat/sigsegv_codes.in (SEGV_STACKFLOW, __SEGV_PSTKOVF): Likewise. + * xlat/sigtrap_codes.in (TRAP_STEP, TRAP_TRACEFLOW, TRAP_WATCHPT, + TRAP_ILLTRAP): Likewise. + * NEWS: Mention it. + +2018-02-27 Eugene Syromyatnikov + + rtnl_tc: support new TCA_* attributes. + * xlat/rtnl_tc_attrs.in (TCA_HW_OFFLOAD, TCA_INGRESS_BLOCK, + TCA_EGRESS_BLOCK): New constants introduced by linux kernel commits + v4.15-rc4~13^2~5^2~2 and v4.16-rc1~123^2~139^2~5. + * rtnl_tc.c (tcmsg_nla_decoders) : New items. + + rtnl_link: add decoding of new IFLA_* attributes. + * xlat/rtnl_link_attrs.in (IFLA_NEW_NETNSID, IFLA_IF_NETNSID, + IFLA_CARRIER_UP_COUNT, IFLA_CARRIER_DOWN_COUNT, IFLA_NEW_IFINDEX): New + constants introduced by linux kernel commits v4.15-rc1~84^2~557, + v4.15-rc1~84^2~133^2, v4.16-rc1~123^2~91, and v4.16-rc1~123^2~24^2. + * rtnl_link.c (ifinfomsg_nla_decoders) : New items. + + rtnl_link: implement IFLA_EVENT_* decoding. + * rtnl_link.c (decode_ifla_event): New function. + (ifinfomsg_nla_decoders) <[IFLA_EVENT]>: Use it. + * xlat/rtnl_ifla_events.in: New file. + * NEWS: Mention it. + + xlat: update the list of RWF_* constants. + * xlat/rwf_flags.in (RWF_APPEND): New constant introduced by linux + kernel commit v4.16-rc1~145^2~7. + * NEWS: Mention it. + + tests: check decoding of ip6:port pairs associated with socket descriptors + * tests/net-yy-inet.c: Generalise test. + * tests/net-yy-inet6.c: New file. + * tests/pure_executables.list: Add net-yy-inet6. + * tests/.gitignore: Likewise. + * tests/gen_tests.in (net-yy-inet6): New entry. + +2018-02-27 Eugene Syromyatnikov + + Print IPv6 addresses in brackets. + Follow a common practice for printing address:port pair to distinguish + address parts delimiter from address/port delimiter. + + * socketutils.c (inet_parse_response) : New variables, + initialise them to open/closing brackets or empty strings based + on address family. + (inet_parse_response): Print ob and cb around src_buf and dst_buf. + * NEWS: Mention this improvement. + +2018-02-26 Dmitry V. Levin + + strace.spec.in: add gcc to build requirements. + There are rumors in circulation that some rpm-based distributions + are going to exclude gcc from their default build environments. + Workaround this policy silliness by adding gcc to build requirements. + + * strace.spec.in (BuildRequires): Add gcc. + +2018-02-26 Dmitry V. Levin + + Move definitions of fopen_for_input to largefile_wrappers.h. + * largefile_wrappers.h (fopen_for_input): Define along with + fopen_for_output. + * mmap_cache.c: Include "largefile_wrappers.h". + (fopen_for_input): Remove. + +2018-02-26 Dmitry V. Levin + + Introduce mmap_cache.h. + Let's avoid bloating defs.h and introduce a separate header for + mmap_cache. + + * defs.h (struct mmap_cache_t, enum mmap_cache_protection, + enum mmap_cache_rebuild_result, mmap_cache_enable, mmap_cache_is_enabled, + mmap_cache_invalidate, mmap_cache_delete, mmap_cache_rebuild_if_invalid, + mmap_cache_search): Move ... + * mmap_cache.h: ... to this new file. + * Makefile.am (strace_SOURCES): Add mmap_cache.h. + * mmap_cache.c: Include mmap_cache.h. + * strace.c: Likewise. + * syscall.c: Likewise. + * unwind.c: Likewise. + +2018-02-26 Masatake YAMATO + + mmap_cache: record device major and minor numbers. + * defs.h (struct mmap_cache_t): Add major and minor fields. + * mmap_cache.c (build_mmap_cache): Record device major and minor numbers. + +2018-02-26 Masatake YAMATO + + mmap_cache: add function to enable mmap_cache. + mmap_cache was enabled indirectly via unwind feature. As now mmap_cache + can be used by other part of strace, a way to enable mmap_cache directly + is needed. + + * defs.h (mmap_cache_enable, mmap_cache_is_enabled): New function + prototypes. + * mmap_cache.c (use_mmap_cache): New file local variable. + (mmap_cache_enable, mmap_cache_is_enabled): New functions. + * syscall.c (syscall_exiting_decode): Use mmap_cache_is_enabled() + instead of stack_trace_enabled. + * unwind.c (unwind_init): Invoke mmap_cache_enable. + +2018-02-26 Masatake YAMATO + + mmap_cache, unwind: lift up mmap_cache_delete invocation from unwind.c. + mmap_cache_delete function used to be called by destructor of unwind + related code. Now that other parts can use mmap cache, + mmap_cache_delete is called separately from unwind_tcb_fin. + + * unwind.c (unwind_tcb_fin): Move mmap_cache_delete invocation ... + * strace.c (droptcb): ... here. + +2018-02-26 Masatake YAMATO + + mmap_cache: record protection bits. + To make mmap_cache reusable, records protection bits of mmap entries. + + * defs.h (mmap_cache_protection): New enum. + * mmap_cache.c (build_mmpa_cache): Don't ignore entries that are not + executable, just record the protection bits here. + * unwind.c (print_stack_frame): Ignore entries that are not executable. + +2018-02-26 Masatake YAMATO + + mmap_cache: move code for searching a mmap cache from unwind. + print_stack_frame function in unwind.c searches a mmap entry in mmap + cache. The found entry is then used for unwinding. However, a function + searching for a mmap entry may be useful for other purposes than + unwinding. + + This change re-factors the function; code for searching an entry is + now defined as a stand-alone function named mmap_cache_search. + + * defs.h (mmap_cache_search): New function prototype. + print_stack_frame. + * mmap_cached.c (mmap_cache_search): New function derived from + print_stack_frame. + * unwind.c (print_stack_frame): Use it. + +2018-02-26 Masatake YAMATO + + mmap_cache: new subsystem derived from unwind.c. + For making mmap cache code reusable from other areas in strace than + unwind, mmap cache related code and unwind related code should be + separated. + + This change moves the most of mmap cache code from unwind.c + to mmap_cache.c, a new file. + + * unwind.c: Move mmap_cache implementation ... + * mmap_cache.c: ... to this new file. + * Makefile.am (strace_SOURCES): add mmap_cache.c. + * defs.h (struct tcb): Move mmap_cache, mmap_cache_size, and + mmap_cache_generation fields out of [USE_LIBUNWIND] condition. + (mmap_cache_invalidate, mmap_cache_delete, + mmap_cache_rebuild_if_invalid): New function prototypes. + (struct mmap_cache_t, enum mmap_cache_rebuild_result): Move from + unwind.c. + * syscall.c (syscall_exiting_decode): Replace unwind_cache_invalidate + with mmap_cache_invalidate. + +2018-02-26 Masatake YAMATO + + unwind: lift up unw_flush_cache from mmap cache management code. + For making mmap cache code reusable from other areas in strace + than unwind, mmap cache related code and unwind related code + should be separated. + + This change is one of the steps for the separation. It moves + unw_flush_cache function call from the core of mmap cache code + to upper level code. + + * unwind.c (mmap_cache_rebuild_result): New enum. + (rebuild_cache_if_invalid): Return MMAP_CACHE_REBUILD_* instead of + a bool value. + (build_mmap_cache): Don't call unw_flush_cache here. + (unwind_print_stacktrace, unwind_capture_stacktrace): Call + unw_flush_cache here instead. + +2018-02-25 Dmitry V. Levin + + debian: sync with 4.21-1 package. + Versioned dependency on debhelper is not updated for backwards + compatibility. + + * debian/changelog.in: Fix ancient changelog entries. + * debian/control (Build-Depends): Add dependency on libbluetooth-dev. + (Standards-Version): Update to 4.1.3. + (Vcs-Git, Vcs-Browser): Move from alioth to salsa.d.o. + (strace, strace-udeb) : Change to linux-any. + (strace64, strace-udeb) : Change to optional. + * debian/rules: Use /usr/share/dpkg/architecture.mk instead of manually + setting build variables. + (configure): New target. + (build/Makefile, build-udeb/Makefile, build64/Makefile): Depend on it. + (binary-arch): Use build64/strace.1 for strace64 subpackage. + * debian/strace.manpages: Add build/ prefix. + * debian/strace64.manpages: Add build64/ prefix. + +2018-02-24 Eugene Syromyatnikov + + m4/mpers.m4: fix mpers name in comments added to config.h. + * m4/mpers.m4 (st_MPERS_STRUCT_STAT): Use mpers_name instead of + MPERS_NAME in comments generated by AC_DEFINE. + + Fixes: v4.14~169 ("mpers.m4: check for struct stat64, struct stat, and their members") + +2018-02-24 Dmitry V. Levin + + mpers.awk: use stdint.h instead of inttypes.h. + As is included in files generated by mpers.awk to obtain + definitions of uintNN_t types provided by , replace the former + header with the latter. + + * mpers.awk: Use instead of . + * mpers_test.sh: Update expected output. + +2018-02-23 Dmitry V. Levin + + Wipe out references to defunct sourceforge. + The old location of strace-devel mailing list is defunct, it used to + lose email messages and sometimes did not deliver any mails for days. + + The mailing list has been moved to strace-devel@lists.strace.io. + + * CREDITS.in: Update the mailing list address. + (Zhang Le): Update email address. + * README: Update the mailing list address. + * README.md: Likewise. + * configure.ac (AC_INIT): Likewise. + * strace.1.in (.SH REPORTING BUGS): Likewise. + * strace-log-merge.1.in (.SH REPORTING BUGS): Likewise. + * sched.c (SYS_FUNC(sched_getattr)): Update the mailing list reference. + * tests/scno_tampering.sh: Likewise. + * qemu_multiarch_testing/README: Update git repository address. + * NEWS: Mention the change of the mailing list address. + + Closes: https://github.com/strace/strace/issues/38 + +2018-02-21 Dmitry V. Levin + + m68k: fix build. + When is included after , the build fails + on m68k with the following diagnostics: + + In file included from /usr/include/linux/ptrace.h:101:0, + from ptrace.h:51, + from sigreturn.c:2: + /usr/include/m68k-linux-gnu/sys/reg.h:26:3: error: expected identifier + before numeric constant + PT_D1 = 0, + ^ + + Apparently, the only architecture where strace needs definitions + provided by is x86_64, other three (m68k, tile, and x86) + are fine with definitions already provided by . + + Fix the issue by getting rid of and defining necessary + macros in linux/x86_64/arch_regs.h file. + + * configure.ac (AC_CHECK_HEADERS): Remove sys/reg.h. + * regs.h: Do not include . + * linux/x86_64/arch_regs.h (R15, R14, R13, R12, RBP, RBX, R11, R10, + R9, R8, RAX, RCX, RDX, RSI, RDI, ORIG_RAX, RIP, CS, EFLAGS, RSP, SS, + FS_BASE, GS_BASE, DS, ES, FS, GS): New macros. + * NEWS: Mention this fix. + + Fixes: v4.21~21 ("Include early") + +2018-02-15 Dmitry V. Levin + + Demote sourceforge.net. + https://sourceforge.net/p/strace/code/ is defunct: it doesn't accept + new commits for too long. + Likewise, https://sourceforge.net/projects/strace/files/ doesn't accept + new files for too long. + + * README.md: Remove sourceforge.net URL. + * debian/copyright: Replace the sourceforge.net based strace project URL + with a github based one. + * strace.spec.in (Source): Likewise. + +2018-02-15 Dmitry V. Levin + + Update copyright headers. + * COPYING: Update copyright year number range. + * debian/copyright: Sync with COPYING. + +2018-02-14 Dmitry V. Levin + + Post-release administrivia. + * NEWS: Add a header line for the next release. + * debian/changelog.in: Add a changelog entry for 4.21-1. + * strace.spec.in: Likewise. + +2018-02-13 Dmitry V. Levin + + Prepare for 4.21 release. + * NEWS: Update for 4.21 release. + +2018-02-13 Eugene Syromyatnikov + + tests/s390_sthyi.c: skip the test if s390_sthyi returns an error. + tests/s390_sthyi.c (main): replace error_msg_and_fail with + error_msg_and_skip if rc is non-zero. + +2018-02-13 Dmitry V. Levin + + Update copyright headers. + Headers updated automatically using maint/update_copyright_years.sh + script. + +2018-02-13 Eugene Syromyatnikov + + Remove old and unused maintenance scripts. + Firewell, last witnesses of bygone era. + + * linux/sparc/gen.pl: Remove. + * linux/x86_64/gentab.pl: Likewise. + * xlate.el: Likewise. + * Makefile.am (EXTRA_DIST): Remove them. + + Suggested-by: Elvira Khabirova + Co-Authored-by: Dmitry V. Levin + +2018-02-13 Dmitry V. Levin + + Consistently use MAX_ERRNO_VALUE. + * filter_qualify.c (parse_inject_token): Replace 4095 + with MAX_ERRNO_VALUE. + * negated_errno.h (is_negated_errno): Likewise. Remove redundant + comment. + + Export SIZEOF_LONG and SIZEOF_KERNEL_LONG_T to tests. + * configure.ac (AC_SUBST): Add SIZEOF_LONG and SIZEOF_KERNEL_LONG_T. + * tests/Makefile.am (SIZEOF_LONG, SIZEOF_KERNEL_LONG_T): New variables. + (AM_TEST_LOG_FLAGS): Pass them. + * bootstrap: Substitute them. + +2018-02-13 Eugene Syromyatnikov + + tests: avoid ioctl_kvm_run test failure when built with gcc -O0. + When built with -O0, gcc (rightfully) generates function prologue, which + results in writing %rbp to the stack, causing premature KVM_EXIT_MMIO. + It could be possible to avoid such problems by "naked" attribute but, + unfortunately, the latter is not available on x86 with older GCC. + A trick suggested in [1] is used instead: assembly is moved + to the global scope. + + [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50242#c3 + + * tests/ioctl_kvm_run.c (code): Remove function. + Add globally scoped __asm__ with the function code and its size. + (code, code_size): New extern symbols declarations. + (run_kvm): Remove code_size definition and initialization. + + Co-Authored-by: Dmitry V. Levin + +2018-02-13 Eugene Syromyatnikov + + tests/ioctl_kvm_run.c: add KVM_EXIT_MMIO diagnostics. + As it has proven itself useful. + + * tests/ioctl_kvm_run.c (run_kvm) : Fail + on unexpected KVM_EXIT_MMIO, providing relevant diagnostics. + +2018-02-13 Eugene Syromyatnikov + + tests: add compatibility layer for accept call. + Recent glibc (since version 2.26) uses accept4 syscall for implementing + accept call on sparc. Unfortunately, it's impossible to simply fall + back on raw syscall as it had not been wired up until linux commit + v4.4-rc8~4^2~1. + + * tests/accept_compat.h: New file. + * tests/Makefile.am (EXTRA_DIST): Add it. + * tests/net-y-unix.c: Include accept_compat.h, use do_accept() + instead of accept() calls. + * tests/net-yy-inet.c: Likewise. + * tests/net-yy-unix.c: Likewise. + * tests/net.expected: Allow accept4. + +2018-02-12 Dmitry V. Levin + + debian: build strace-udeb separately. + * debian/rules (extra_build_targets): Add build-udeb-stamp. + (build-udeb/Makefile): New rule. + (clean): Remove build-udeb. + * debian/strace-udeb.install: Update. + + Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=826223 + +2018-02-12 Dmitry V. Levin + + Enable symbol demangling in deb- and rpm-driven builds. + * debian/control (Build-Depends) [amd64]: Add libiberty-dev. + * strace.spec.in (buildrequires_libunwind_devel): Add binutils-devel. + +2018-02-12 Dmitry V. Levin + + debian: re-enable -k option on x86_64. + This partially reverts commit v4.13~177. + + * debian/control (Build-Depends) [amd64]: Add libunwind-dev. + +2018-02-12 Dmitry V. Levin + + Add "strace -V" output to build log. + * strace.spec.in (%check): Print "strace -V" output before + running the test suite. + * debian/rules (%-stamp): Likewise. + +2018-02-12 Eugene Syromyatnikov + + xlat: update NT_* constants. + * xlat/nt_descriptor_types.in (NT_PPC_PKEY): New constant introduced + by linux kernel commit v4.16-rc1~93^2~72. + + Update the list of PKEY_* constants. + * xlat/pkey_access.in (PKEY_DISABLE_EXECUTE): New constant introduced + by linux kernel commit v4.16-rc1~93^2~85. + * tests/pkey_alloc.c: Update expected output. + * NEWS: Mention it. + + powerpc, powerpc64: wire up pkey_* syscalls. + * linux/powerpc/syscallent.h [384..386]: Add pkey_alloc, + pkey_free, and pkey_mprotect syscalls introduced by linux kernel + commits v4.16-rc1~93^2~70 and v4.16-rc1~93^2~69, respectively. + * linux/powerpc64/syscallent.h: Likewise. + * NEWS: Mention it. + + Update NEWS. + +2018-02-12 Eugene Syromyatnikov + + linux/ia64: remove IA-32 mode support. + There is no compat support in strace and there are no systems + within reach that would allow to test it. + + * linux/ia64/arch_regs.c (IA64_PSR_IS, ia64_ia32mode): Remove. + * linux/ia64/get_error.c (get_error): Remove ia64_ia32mode branch. + * linux/ia64/get_scno.c (arch_get_scno): Likewise. + * linux/ia64/get_syscall_args.c (get_syscall_args): Likewise. + * linux/ia64/set_error.c (arch_set_error, arch_set_success): Likewise. + * linux/ia64/set_scno.c (arch_set_scno): Likewise. + +2018-02-12 Eugene Syromyatnikov + + syscall.c: parse return code second time after injecting. + In order to have the same view as tracee has, with regards to + "never fail" syscalls. + + * syscall.c (tamper_with_syscall_exiting): Call get_error after the + return value tampering to re-initialise u_rval and u_error fields + of struct tcb. + +2018-02-11 Eugene Syromyatnikov + + sparc: mark as an architecture that has a dedicated error register. + * linux/sparc/arch_defs_.h (HAVE_ARCH_DEDICATED_ERR_REG): New macro, + define to 1. + + strace.1.in: ffix. + +2018-02-11 Dmitry V. Levin + + Include early. + Include "ptrace.h" before any header that can include + because on some architectures the latter may include + which in turn may include with potentially devastating + effect on . + + * process.c: Include "ptrace.h" before "regs.h". + * rt_sigframe.c: Likewise. + * sigreturn.c: Include "ptrace.h" before "nsig.h". + * syscall.c: Likewise. + * wait.c: Include "ptrace.h" before . + * strace.c: Include "ptrace.h" before . + * tests/ptrace.c: Likewise. + * tests/test_ucopy.c: Include before . + +2018-02-11 Dmitry V. Levin + + Include instead of + Do not include unnecessarily as it includes . + + * pathtrace.c: Include instead of . + * strace.c: Likewise. + * syscall.c: Likewise. + * util.c: Likewise. + * tests/getcwd.c: Likewise. + * tests/group_req.c: Likewise. + * tests/inode_of_sockfd.c: Likewise. + * tests/ip_mreq.c: Likewise. + * tests/printpath-umovestr.c: Likewise. + * tests/qual_fault.c: Likewise. + * tests/test_printpath.c: Likewise. + * tests/umovestr3.c: Likewise. + * tests/net-y-unix.c: Do not include . + * tests/net-yy-unix.c: Likewise. + +2018-02-10 Eugene Syromyatnikov + + basic_filters.c: introduce scno_by_name. + As it will be used elsewhere. + + * basic_filters.c (scno_by_name): New function. + (qualify_syscall_name): Use it. + * defs.h (scno_by_name): New declaration. + +2018-02-10 Eugene Syromyatnikov + + xstring.h: rephrase xappendstr description a bit. + +2018-02-10 Eugene Syromyatnikov + + xlat.c: return NULL in sprintflags if there are no flags. + Otherwise the auxstr is rather ugly at times. + + * xlat.c (sprintflags): Return NULL if no flags were printed. + +2018-02-10 Eugene Syromyatnikov + + Change type of injected rval to kernel_long_t. + * defs.h (struct inject_data): Change type of rval field to + kernel_ulong_t. + * filter_qualify.c (parse_inject_token): Use string_to_kulong instead of + string_to_uint for rval parsing. Warn if retval is clipped in compat + personality. + + Mark architectures that indicate syscall error in a dedicated register. + * linux/alpha/arch_defs_.h (HAVE_ARCH_DEDICATED_ERR_REG): New macro, + define to 1. + * linux/ia64/arch_defs_.h: Likewise. + * linux/mips/arch_defs_.h: Likewise. + * linux/powerpc/arch_defs_.h: Likewise. + * linux/powerpc64/arch_defs_.h: Likewise. + * linux/sparc64/arch_defs_.h: Likewise. + * linux/arch_defs_.h [!HAVE_ARCH_DEDICATED_ERR_REG] + (HAVE_ARCH_DEDICATED_ERR_REG): New macro, define to 0. + * linux/nios2/arch_defs_.h: New file. + * Makefile.am (EXTRA_DIST): Add it. + +2018-02-10 Eugene Syromyatnikov + + Make string_to_uint_ex more universal. + And add support for reading of various types. + + * string_to_uint.c (string_to_uint_ex): Change to work with long long. + (string_to_uint): Move it... + * string_to_uint.h (string_to_uint): ...here. + (string_to_uint_upto): Accept long long as max_val, return long long. + (string_to_ulong, string_to_kulong, string_to_ulonglong): New functions, + for completeness. + + Co-Authored-by: Dmitry V. Levin + +2018-02-10 Eugene Syromyatnikov + + Add pure syscall flag. + * basic_filters.c (lookup_class) : Add "%pure" for + TRACE_PURE. + * sysent.h (TRACE_PURE): New syscall flag. + * sysent_shorthand_defs.h (PU): New shorthand macro. + * linux/32/syscallent.h ([172], [173], [174], [175], [176], [177], + [178]): Add PU flag to getpid, getppid, getuid, geteuid, getgid, + getegid, gettid syscalls. + * linux/64/syscallent.h ([172], [173], [174], [175], [176], [177], + [178]): Add PU flag to getpid, getppid, getuid, geteuid, getgid, + getegid, gettid syscalls. + * linux/aarch64/syscallent.h ([1060]): Add PU flag to getpgrp syscalls. + * linux/alpha/syscallent.h ([20], [24], [47], [63], [64], [89], + [378]): Add PU flag to getxpid, getxuid, getxgid, getpgrp, getpagesize, + getdtablesize, gettid syscalls. + * linux/arc/syscallent.h ([246]): Add PU flag to arc_gettls syscalls. + * linux/arm/syscallent.h ([20], [24], [47], [49], [50], [64], [65], + [199], [200], [201], [202], [224], [ARM_FIRST_SHUFFLED_SYSCALL+1+6]): + Add PU flag to getpid, getuid, getgid, geteuid, getegid, getppid, + getpgrp, getuid32, getgid32, geteuid32, getegid32, gettid, get_tls + syscalls. + * linux/avr32/syscallent.h ([20], [24], [47], [49], [50], [64], [65], + [176]): Add PU flag to getpid, getuid, getgid, geteuid, getegid, + getppid, getpgrp, gettid syscalls. + * linux/bfin/syscallent.h ([20], [24], [47], [49], [50], [64], [65], + [199], [200], [201], [202], [224]): Add PU flag to getpid, getuid, + getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32, + geteuid32, getegid32, gettid syscalls. + * linux/hppa/syscallent.h ([20], [24], [47], [49], [50], [64], [65], + [206]): Add PU flag to getpid, getuid, getgid, geteuid, getegid, + getppid, getpgrp, gettid syscalls. + * linux/i386/syscallent.h ([20], [24], [47], [49], [50], [64], [65], + [199], [200], [201], [202], [224]): Add PU flag to getpid, getuid, + getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32, + geteuid32, getegid32, gettid syscalls. + * linux/ia64/syscallent.h ([1041], [1042], [1046], [1047], [1062], + [1063], [1105], [1171]): Add PU flag to getpid, getppid, getuid, + geteuid, getgid, getegid, gettid, getpagesize syscalls. + * linux/m68k/syscallent.h ([20], [24], [47], [49], [50], [64], + [65], [166], [199], [200], [201], [202], [221], [333]): Add PU flag + to getpid, getuid, getgid, geteuid, getegid, getppid, getpgrp, + getpagesize, getuid32, getgid32, geteuid32, getegid32, gettid, + get_thread_area syscalls. + * linux/metag/syscallent.h ([248]): Add PU flag to metag_get_tls + syscalls. + * linux/microblaze/syscallent.h ([20], [24], [47], [49], [50], [64], + [65], [199], [200], [201], [202], [224]): Add PU flag to getpid, + getuid, getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32, + geteuid32, getegid32, gettid syscalls. + * linux/powerpc64/syscallent.h ([20], [24], [47], [49], [50], [64], + [65], [207]): Add PU flag to getpid, getuid, getgid, geteuid, getegid, + getppid, getpgrp, gettid syscalls. + * linux/powerpc/syscallent.h ([20], [24], [47], [49], [50], [64], + [65], [207]): Add PU flag to getpid, getuid, getgid, geteuid, getegid, + getppid, getpgrp, gettid syscalls. + * linux/s390/syscallent.h ([20], [24], [47], [49], [50], [64], [65], + [199], [200], [201], [202], [236]): Add PU flag to getpid, getuid, + getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32, + geteuid32, getegid32, gettid syscalls. + * linux/s390x/syscallent.h ([20], [64], [65], [199], [200], [201], + [202], [236]): Add PU flag to getpid, getppid, getpgrp, getuid, + getgid, geteuid, getegid, gettid syscalls. + * linux/sh64/syscallent.h ([20], [24], [47], [49], [50], [64], [65], + [199], [200], [201], [202], [252]): Add PU flag to getpid, getuid, + getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32, + geteuid32, getegid32, gettid syscalls. + * linux/sh/syscallent.h ([20], [24], [47], [49], [50], [64], [65], + [199], [200], [201], [202], [224]): Add PU flag to getpid, getuid, + getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32, + geteuid32, getegid32, gettid syscalls. + * linux/sparc64/syscallent.h ([20], [24], [47], [49], [50], [64], [81], + [143], [197], [340]): Add PU flag to getpid, getuid, getgid, geteuid, + getegid, getpagesize, getpgrp, gettid, getppid, kern_features syscalls. + * linux/sparc/syscallent.h ([20], [24], [44], [47], [49], [50], [53], + [64], [69], [70], [81], [143], [197], [340]): Add PU flag to getpid, + getuid, getuid32, getgid, geteuid, getegid, getgid32, getpagesize, + geteuid32, getegid32, getpgrp, gettid, getppid, kern_features syscalls. + * linux/x32/syscallent.h ([39], [102], [104], [107], [108], [110], + [111], [186]): Add PU flag to getpid, getuid, getgid, geteuid, getegid, + getppid, getpgrp, gettid syscalls. + * linux/x86_64/syscallent.h ([39], [102], [104], [107], [108], [110], + [111], [186]): Add PU flag to getpid, getuid, getgid, geteuid, getegid, + getppid, getpgrp, gettid syscalls. + * linux/xtensa/syscallent.h ([120], [127], [137], [139], [140], [141], + [150], [151]): Add PU flag to getpid, gettid, getuid, getgid, geteuid, + getegid, getppid, getpgrp syscalls. + * strace.1.in (.SS Filtering): Document it. + * NEWS: Mention it. + + syscall.c: warn if tampering failed. + + syscall.c: set errno if syscall is tampered. + +2018-02-10 Eugene Syromyatnikov + + tests/nsyscall-d.test: swap exp and log in diff calls. + In line with the rest of the tests. + + * tests/nsyscalls-d.test: swap arguments of match_diff calls. + +2018-02-10 Eugene Syromyatnikov + + linux/arm/get_scno.c: use debug_msg. + * linux/arm/get_scno.c (arch_get_scno): replace if (debug_flag) { + error_msg() } with debug_msg() call. + +2018-02-10 Eugene Syromyatnikov + + Do not shuffle scno inside syscall_name. + This makes interface a bit irregular otherwise. + + * defs.h (syscall_name): Clarify description. + * syscall.c (syscall_name): Do not call shuffle_scno. + * printsiginfo.c (print_si_info) : Use shuffle_scno. + +2018-02-10 Eugene Syromyatnikov + + Handle very special __ARM_NR_-prefixed syscalls. + * linux/aarch64/nr_prefix.c: New file. + * linux/arm/nr_prefix.c: Likewise. + * linux/nr_prefix.c: Likewise. + * Makefile.am (EXTRA_DIST): Add them. + * printsiginfo.c: Include nr_prefix.c + (print_si_info): Use nr_prefix. + + Make shuffle_scno globally available. + * syscall.c (shuffle_scno): Move the declaration... + * defs.h (shuffle_scno): ...here. Remove static qualifier. + * linux/aarch64/shuffle_scno.c (shuffle_scno): Remove static qualifier. + * linux/arm/shuffle_scno.c: Likewise. + * linux/shuffle_scno.c: Likewise. + * linux/x32/shuffle_scno.c: Likewise. + * linux/x86_64/shuffle_scno.c: Likewise. + +2018-02-10 Eugene Syromyatnikov + + syscall.c: use shuffle_scno in syscall_name. + syscall_name() is used only in printsiginfo.c:print_si_info currently, + and is supplied with raw syscall number (that's why it has this ugly + __X32_SYSCALL_BIT hack). But since it handled only __X32_SYSCALL_BIT and + not shuffle_scno(), it was broken on ARM. Let's replace it with shuffle_scno + call, as it handles both the case of shuffled ARM syscalls and the + __X32_SYSCALL_BIT. + + * syscall.c (syscall_name): Call shuffle_scno instead of custom + __X32_SYSCALL_BIT handling. + +2018-02-09 Eugene Syromyatnikov + + Use shuffle_scno for x32 syscall numbers. + This changes behaviour of printing of unknown syscall. + + * linux/x32/shuffle_scno.c: New file. + * linux/x86_64/shuffle_scno.c: Likewise. + * Makefile.am (EXTRA_DIST): Add them. + * linux/x86_64/get_scno.c (arch_get_scno): Do not clear + __X32_SYSCALL_BIT. + * tests/nsyscalls.c: Update expected output. + +2018-02-09 Eugene Syromyatnikov + + Move shuffle_scno() invocation to get_scno. + * linux/aarch64/get_scno.c (arch_get_scno): Remove shuffle_scno call. + * linux/arm/get_scno.c (arch_get_scno): Remove shuffle_scno calls. + * syscall.c (get_scno): Call shuffle_scno after arch_get_scno. + +2018-02-09 Eugene Syromyatnikov + + Move shuffle_scno to arch-specific file. + While we are here, let's fix AArch64 by limiting scno shuffling + to compat personality only. + + * syscall.c: Include shuffle_scno.c. + (shuffle_scno): Move it to a... + * linux/arm/shuffle_scno.c: New file. + * linux/aarch64/shuffle_scno.c: New file, define arm's shuffle_scno + as arm_shuffle_scno and call it only for personality 1. + * linux/shuffle_scno.c: New file, fallback trivial shuffle_scno + definition. + * Makefile.am (EXTRA_DIST): Add them. + +2018-02-09 Eugene Syromyatnikov + + Print unknown syscall number in hexadecimal. + * syscall.c (struct sysent_buf): Update buf field size. + (get_scno): Print unknown syscall number in hexadecimal form. + * tests/nsyscalls.c: Update expected output. + * strace.1.in: Document it. + * NEWS: Mention it. + + tests/accept.c: call accept syscall directly, if available. + * tests/accept.c [__NR_accept && !TEST_SYSCALL_NAME]: Define a wrapper that + calls accept directly. + * tests/sockname.c [TEST_SYSCALL_STR]: Do not define TEST_SYSCALL_STR. + + printsiginfo.c: add a comment about personality detection for SIGSYS. + Looks like it is not necessary, after all. + +2018-02-09 Eugene Syromyatnikov + + linux/x86_64/set_error.c: update eax for compat personality. + Since this is where get_error gets the return value from in the compat case. + + linux/x86_64/set_error.c (set_error, set_success): Update i386_regs.eax + if tracee is in compat personality. + +2018-02-09 Eugene Syromyatnikov + + Mark various arch-specific syscalls with SYSCALL_NEVER_FAILS. + * linux/alpha/syscallent.h (getpagesize, getdtablesize): Add NF flag. + * linux/arc/syscallent.h (arc_gettls): Likewise. + * linux/arm/syscallent.h (get_tls): Likewise. + * linux/ia64/syscallent.h (getpagesize): Likewise. + * linux/m68k/syscallent.h (getpagesize, get_thread_area): Likewise. + * linux/sparc/syscallent.h (getpagesize): Likewise. + * linux/sparc64/syscallent.h (getpagesize): Likewise. + +2018-02-09 Eugene Syromyatnikov + + Add SYSCALL_NEVER_FAILS flag to getpgrp. + As glibc, at least, treats it this way. + + * linux/aarch64/syscallent.h (getpgrp): Add NF flag. + * linux/alpha/syscallent.h: Likewise. + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + +2018-02-09 Eugene Syromyatnikov + + linux/x86_64/get_error.c: do not sign-extend if no error happened. + +2018-02-09 Eugene Syromyatnikov + + tests/membarrier.c: fix expected output on nohz_full systems. + If nohz_full is enabled, MEMBARRIER_CMD_GLOBAL is not available. + + * tests/membarrier.c: check availability of MEMBARRIER_CMD_GLOBAL + separately. + +2018-02-09 Eugene Syromyatnikov + + Update MEMBARRIER_CMD_* constants. + * xlat/membarrier_cmds.in: Add new constants, rename + MEMBARRIER_CMD_SHARED to MEMBARRIER_CMD_GLOBAL. + * NEWS: Mention this. + * tests/membarrier.c (main): Update expected output. + + Co-Authored-by: Dmitry V. Levin + +2018-02-07 Eugene Syromyatnikov + + perf.c: print group_fd argument of perf_event_open syscall as fd. + * perf.c (SYS_FUNC(perf_event_open)): Print 4th argument using printfd. + + syscall.c: print higher bits of syscall return value on x32 personality. + * syscall.c (syscall_exiting_trace): Check for current_klongsize instead + of current_wordsize to determine the size of tcp->u_rval. + + strace.1.in: history update. + strace.1.in (.SH HISTORY): Some amendments based on + https://github.com/strace/strace-talks/blob/master/2012-ossdevconf-obninsk-strace_from_upstream_PoV/ossdevconf_2012-slides-strace_from_upstream_PoV.tex + + strace.1.in: minor changes. + * strace.1.in (.SH DESCRIPTION): s/a passion/passion/, + s/Here the/Here, the/, s/Where traditional/Where the traditional/, + s/output has proven/output is proven/, s/In all cases/In most cases,/¸ + embolden st_mode, lstat, SIGCHLD, and SIGTTOU mentions, + s/In some cases /In some cases, / + (.SS Output format) <-o>: de-italicize dot in "filename.pid", convert + the sentence's voice to passive, some other rephrasing. Mention + incompatibility of output piping with -ff mode. + (.SS Output options) <-t>: s/time of day/wall clock time/. + (.SS Statistics) <-c>: Remove "on Linux" mention, -F option mention. + + README.md: add information about git repository location. + * README.md: Mention URLs for SourceForge, GitHub, and GitLab + repositories. + +2018-02-07 Dmitry V. Levin + + tests: rewrite net-accept-connect.c without strncpy. + gcc8 -Wall -Werror rejects our method of struct sockaddr_un.sun_path + initialization because the field lacks __nonstring__ attribute. + + As we calculate the length of the string being copied anyway, + workaround this gcc+glibc bug by changing the code to use this + pre-calculated length and get rid of strncpy completely. + + * tests/net-accept-connect.c (main): Use memcpy to initialize sun_path. + +2018-02-06 Dmitry V. Levin + + Use kernel's fcntl.h header instead of libc's for open_mode_flags. + As definitions of O_* macros provided by various libc implementations + are usually less reliable than those provided by kernel headers, switch + to use kernel's fcntl.h header. + + * open.c: Include instead of . Remove + O_LARGEFILE fallback definitions assuming that the kernel headers + provide them. + * xlat/open_mode_flags.in: Add __O_SYNC after O_SYNC. Add O_TMPFILE + and __O_TMPFILE before O_DIRECTORY. Remove "O_TMPFILE & ~O_DIRECTORY". + * tests/open.c: Include instead of . Remove + workarounds for libc O_TMPFILE implementations. + * tests/openat.c: Include instead of . + (test_mode_flag): New function. + (main): Use it to check decoding of all access modes and file flags. + * tests/gen_tests.in (openat): Add -a option. + + Co-Authored-by: Eugene Syromyatnikov + +2018-02-06 Dmitry V. Levin + + xlat: update TCP_* constants. + * xlat/socktcpoptions.in: Add TCP_FASTOPEN_KEY and + TCP_FASTOPEN_NO_COOKIE introduced by linux kernel commits + v4.15-rc1~84^2~387 and v4.15-rc1~84^2~339, respectively. + * NEWS: Mention this. + + xlat: update IPV6_* constants. + * xlat/sockipv6options.in: Add IPV6_FREEBIND introduced by linux kernel + commit v4.15-rc1~84^2~601. + * NEWS: Mention this. + + xlat: update MAP_* constants. + * xlat/mmap_flags.in: Add MAP_SHARED_VALIDATE and MAP_SYNC introduced + by linux kernel commits v4.15-rc1~71^2^2~23 and v4.15-rc1~71^2^2~12, + respectively. + * NEWS: Mention this. + +2018-02-06 Eugene Syromyatnikov + + tests: avoid triggering -Wstringop-truncation in ioctl_dm.c. + * tests/ioctl_dm.c: Replace strncpy calls with memcpy as the character + arrays being copied are not C strings. + + Makefile.am: minor EXTRA_DIST formatting changes. + + Move large file-related wrappers to a separate header. + * strace.c [_LARGEFILE64_SOURCE]: Move the definitions under it to a... + * largefile_wrappers.h: ... new file. + * Makefile.am (strace_SOURCES): Add it. + +2018-01-29 Dmitry V. Levin + + strace.1: fix wording about setuid installation. + * strace.1.in (SETUID INSTALLATION): Fix wording. + + Closes: https://github.com/strace/strace/issues/24 + +2018-01-29 Gleb Fotengauer-Malinovskiy + + Add KVM_PPC_GET_CPU_CHAR ioctl definition from linux v4.15. + * linux/powerpc/ioctls_arch0.h: Update from linux v4.15 + using ioctls_gen.sh. + +2018-01-29 Eugene Syromyatnikov + + Update NEWS. + + tests: check s390_pci_mmio_read and s390_pci_mmio_write decoders. + * tests/s390_pci_mmio_read_write.c: New file. + * tests/.gitignore: Add s390_pci_mmio_read_write. + * tests/pure_executables.list: Likewise. + * tests/gen_tests.in (s390_pci_mmio_read_write): New test. + + Introduce s390_pci_mmio_read, s390_pci_mmio_write system call decoders. + * linux/s390/syscallent.h ([352]): Change decoder to s390_pci_mmio_write. + ([353]): Change decoder to s390_pci_mmio_read. + * linux/s390x/syscallent.h: Likewise. + * s390.c (SYS_FUNC(s390_pci_mmio_write), SYS_FUNC(s390_pci_mmio_read)): + New function. + + tests: check s390_runtime_instr system call decoder. + * tests/s390_runtime_instr.c: New file. + * tests/.gitignore: Add s390_runtime_instr. + * tests/pure_executables.list: Likewise. + * tests/gen_tests.in (s390_runtime_instr): New test. + + Introduce s390_runtime_instr system call decoder. + * linux/s390/syscallent.h ([342]): Change decoder to s390_runtime_instr. + * linux/s390x/syscallent.h: Likewise. + * s390.c (SYS_FUNC(s390_runtime_instr)): New function. + * xlat/s390_runtime_instr_commands.in: New file. + + tests: check s390_guarded_storage system call decoder. + * configure.ac (AC_CHECK_HEADERS): Add asm/guarded_storage.h. + * tests/s390_guarded_storage-v.c: New file. + * tests/s390_guarded_storage.c: Likewise. + * tests/.gitignore: Add s390_guarded_storage, s390_guarded_storage-v. + * tests/pure_executables.list: Likewise. + * tests/gen_tests.in (s390_guarded_storage, s390_guarded_storage-v): + New tests. + + Introduce s390_guarded_storage system call decoder. + * linux/s390/syscallent.h ([378]): Change decoder to s390_guarded_storage. + * linux/s390x/syscallent.h: Likewise. + * s390.c (struct guard_storage_control_block, + struct guard_storage_event_parameter_list): New structure type + definition. + (guard_storage_print_gsepl, guard_storage_print_gscb, + SYS_FUNC(s390_guarded_storage)): New function. + (DIV_ROUND_UP): New macro. + * xlat/s390_guarded_storage_commands.in: New file. + + tests: check s390_sthyi system call decoder. + * configure.ac (AC_CHECK_FUNCS): Add iconv_open. + (AC_CHECK_HEADERS): Add iconv.h. + * tests/s390_sthyi-v.c: New file. + * tests/s390_sthyi.c: Likewise. + * tests/.gitignore: Add s390_sthyi, s390_sthyi-v. + * tests/pure_executables.list: Likewise. + * tests/gen_tests.in (s390_sthyi, s390_sthyi): New tests. + + Introduce s390_sthyi system call decoder. + * s390.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * linux/s390/syscallent.h ([380]): Change decoder to s390_sthyi. + * linux/s390x/syscallent.h: Likewise. + * xlat/s390_sthyi_function_codes.in: New file. + + print_fields.h: add macro to print hexadecimal array field. + * print_fields.h (PRINT_FIELD_HEX_ARRAY): New macro, prints target + array with QUOTE_FORCE_HEX. + +2018-01-29 Eugene Syromyatnikov + + Add print_quoted_string flag to generate comment. + Because there are never enough print_quoted_string flags. + + * defs.h (QUOTE_EMIT_COMMENT): New quoting flag macro constant. + * util.c (string_quote): Emit " /* " in the beginning and " */" in the + end if QUOTE_EMIT_COMMENT is passed. + (print_quoted_string): Increase alloc_size by 7 if QUOTE_EMIT_COMMENT is + passed. + +2018-01-25 Eugene Syromyatnikov + + tests: make ioctl.test more flexible, use it for the rest of ioctl tests + As the remaining non-generated ioctl tests differ from ioctl.test only + in strace options, and since gen_tests.sh can pass arguments to sourced + tests, replace the remaining non-generated ioctl tests with invocations + of ioctl.test with appropriate parameters. + + * tests/ioctl.test: Pass script arguments to the strace invocation. + * tests/gen_tests.in (ioctl_dm): New entry, invoke ioctl.test with -s9. + (ioctl_dm-v): New entry, invoke ioctl.test with -v -s9. + (ioctl_kvm_run): New entry, invoke ioctl.test with -a36 -y. + (ioctl_loop-nv): New entry, invoke ioctl.test with -a22 -e verbose=none. + (ioctl_nsfs): New entry, invoke ioctl.test with -esignal=none. + (ioctl_sock_gifconf): New entry, invoke ioctl.test with -a28 -s1. + (ioctl_evdev-v, ioctl_loop-v, ioctl_rtc-v): Invoke ioctl.test + with -v option instead of ioctl-v.sh. + * tests/ioctl_dm-v.test: Remove. + * tests/ioctl_dm.test: Likewise. + * tests/ioctl_kvm_run.test: Likewise. + * tests/ioctl_loop-nv.test: Likewise. + * tests/ioctl_nsfs.test: Likewise. + * tests/ioctl_sock_gifconf.test: Likewise. + * tests/ioctl-v.sh: Likewise. + * tests/Makefile.am (DECODER_TESTS, EXTRA_DIST): Remove them. + +2018-01-25 Eugene Syromyatnikov + + tests/gen_tests.sh: enable passing arguments to sourced tests. + * tests/gen_tests.sh: Read first argument separately, put it in $arg0, + and the rest of the arguments in $args. + (case "$arg0" in) <+*)>: Set command line to $args and source $arg0. + + xlat/gen.sh: add some rudimentary support for comments. + * xlat/gen.sh: Trim parts of the string abbreviated in "/*" and "*/" + + configure.ac: sort architectures in lexicographical order. + * configure.ac (case "$host_cpu"): sort architectures in alphabetical + order. + +2018-01-25 Dmitry V. Levin + + Drop non-functional CRIS architecture support. + From the very first commit when CRIS architecture support was introduced + and up to this comment that ends the agony of this non-functional code, + this support was incomplete and could never be compiled. + + * Makefile.am (EXTRA_DIST): Remove linux/crisv*. + * clone.c: Remove CRISV* checks. + * configure.ac ($host_cpu == cris*): Remove. + * linux/crisv10: Remove. + * linux/crisv32: Likewise. + + Fixes: v4.5.18-77-gea0e6e8 ("CRIS support by Hinko Kocevar ...") + +2018-01-25 Eugene Syromyatnikov + + Update futex test in accordance with kernel's v4.15-rc7-202-gfbe0e83. + * futex.c (VALP, VALP_PR, VAL2P, VAL2P_PR): New macro definitions. + (main): Allow EINVAL on *REQUEUE* checks with VAL/VAL2 with higher bit + being set, check that the existing behaviour preserved with VALP/VAL2P + where higher bit is unset. + + tests/futex.c: improve error diagnostics. + * tests/futex.c (futex_error): Add func and line arguments, print them. + (CHECK_FUTEX_GENERIC): Pass __func__ and __LINE__ to futex_error. + + Add syscall entry for ARM-specific get_tls syscall. + * linux/arm/syscallent.h ([ARM_FIRST_SHUFFLED_SYSCALL+1+6]): New entry. + (ARM_LAST_SPECIAL_SYSCALL): Update to 6. + * NEWS: Mention it. + +2018-01-25 Eugene Syromyatnikov + + Fix syscall descriptions for ARM-specific system calls. + Based on an analysis of arm_syscall in arch/arm/kernel/traps.c. + + * linux/arm/syscallent.h ([ARM_FIRST_SHUFFLED_SYSCALL+1+2]): Update + argument number, add TM flag. + ([ARM_FIRST_SHUFFLED_SYSCALL+1+1], [ARM_FIRST_SHUFFLED_SYSCALL+1+3], + [ARM_FIRST_SHUFFLED_SYSCALL+1+4], [ARM_FIRST_SHUFFLED_SYSCALL+1+5]): + Update argument number. + +2018-01-25 Eugene Syromyatnikov + + tests: check riscv_flush_icache syscall decoder. + * tests/riscv_flush_icache.c: New file. + * tests/.gitignore: Add riscv_flush_icache. + * tests/gen_tests.in: Likewise. + * tests/pure_executables.list: Likewise. + + Implement decoding of riscv_flush_icache syscall. + * linux/riscv/syscallent.h ([259]): Add riscv_flush_icache entry. + * riscv.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * xlat/riscv_flush_icache_flags.in: New file. + * NEWS: Mention it. + +2018-01-25 Eugene Syromyatnikov + + Workaround stray PTRACE_EVENT_EXEC. + We (apparently) had a long-standing test failure inside strace-ff.test + with the symptom that it misses exit_group call. As it turned out, it + was PTRACE_EVENT_EXEC followed by execve syscall exiting stop. That + behaviour indeed screwed all the syscall state tracking for the tracee. + Let's try to patch it up by calling trace_syscall when we receive + PTRACE_EVENT_EXEC outside syscall. + + * defs.h (TCB_RECOVERING): New tcb flag. + * strace.c (dispatch_event) : Invoke + trace_syscall with TCB_RECOVERING flag being set for the current_tcp + if the tracee is not on exiting syscall. + * syscall.c (get_scno): Set QUAL_RAW if we are recovering. + (tamper_with_syscall_entering): Do not perform actual tampering during + recovery as it's already too late. + * NEWS: Mention it. + + Co-Authored-by: Dmitry V. Levin + +2018-01-24 Dmitry V. Levin + + tests: robustify set_ptracer_any. + * tests/set_ptracer_any.c (main) [HAVE_PRCTL]: Provide fallback + definitions for PR_SET_PTRACER and PR_SET_PTRACER_ANY constants, + set all unused prctl arguments to 0. + +2018-01-24 Dmitry V. Levin + + ia64: do not bail out in get_syscall_args if umove fails with EPERM. + If the kernel contains commit 84d77d3f06e7e8dea057d10e8ec77ad71f721be3, + both PTRACE_PEEKDATA and process_vm_readv become unavailable when the + process dumpable flag is cleared, on ia64 this results to all syscall + arguments being unavailable. + + Recognize this situation and do not treat it as get_syscall_args error + because the latter leaves the tracee in a ptrace stop. + + This condition used to be triggered by prctl-dumpable test that caused + strace to hang indefinitely. + + * linux/ia64/get_syscall_args.c (get_syscall_args): Do not bail out + if umove fails. + * tests/prctl-dumpable.c [__ia64__]: Skip the test. + +2018-01-24 Eugene Syromyatnikov + + strace.c: reset printing_tcp on print_event_exit. + print_event_exit should have printing_tcp setup analogous to printleader and + syscall_exit_trace before printing its part, otherwise it spuriously resets + curcol in line_ended for the stale printing_tcp if followfork == 2. + + * strace.c (print_event_exit): Set printing_tcp to tcp before printing + exiting event line and calling line_ended. + +2018-01-23 Dmitry V. Levin + + tests: check path tracing of old select syscall. + * tests/xselect.c [xselect] (xselect): Turn into prototype. + * tests/oldselect-P.c: New file. + * tests/oldselect-efault-P.c: Likewise. + * tests/oldselect-efault.c: Likewise. + * tests/oldselect.c: Use xselect.c + * tests/pure_executables.list: Add oldselect-efault. + * tests/gen_tests.in (oldselect, oldselect-P, oldselect-efault, + oldselect-efault-P): New entries. + * tests/oldselect.expected: Remove. + * tests/oldselect.test: Remove. + * tests/Makefile.am (check_PROGRAMS): Add oldselect-P + and oldselect-efault-P. + (DECODER_TESTS): Remove oldselect.test. + (EXTRA_DIST): Remove oldselect.expected. + * tests/.gitignore: Add oldselect-P, oldselect-efault, + and oldselect-efault-P. + + tests: check path tracing of select/_newselect syscalls. + * tests/xselect.c (main) [PATH_TRACING_FD]: Skip if /proc/self/fd/ + is not available. Add test calls that use PATH_TRACING_FD. + (main): Conditionalize expected output for those calls + that do not use PATH_TRACING_FD with [!PATH_TRACING_FD]. + * tests/_newselect-P.c: New file. + * tests/select-P.c: Likewise. + * tests/Makefile.am (check_PROGRAMS): Add _newselect-P and select-P. + * tests/.gitignore: Likewise. + * tests/gen_tests.in (_newselect-P, select-P): New entries. + + tests: extend the check of select/_newselect syscalls decoding. + * tests/xselect.c: Rewrite for better coverage. + +2018-01-23 Dmitry V. Levin + + tests: redirect stdin to /dev/null. + Ensure that stdin descriptor is not available for output + by reopening it to input from /dev/null. + + * tests/run.sh: Redirect test's stdin to /dev/null. + +2018-01-23 Dmitry V. Levin + + tests: add file:line to perror_msg_and_fail/error_msg_and_fail output. + * tests/tests.h [!perror_msg_and_fail] (perror_msg_and_fail): New macro + wrapper around the homonymous function. + [!error_msg_and_fail] (error_msg_and_fail): Likewise. + * tests/error_msg.c (perror_msg_and_fail, error_msg_and_fail): New + macros defined to themselves. + + Rework decoding and pathtrace of old select syscall. + * linux/arch_defs_.h [!HAVE_ARCH_OLD_SELECT] (HAVE_ARCH_OLD_SELECT): New + macro. + * linux/aarch64/arch_defs_.h (HAVE_ARCH_OLD_SELECT): Likewise. + * linux/arm/arch_defs_.h: Likewise. + * linux/bfin/arch_defs_.h: Likewise. + * linux/i386/arch_defs_.h: Likewise. + * linux/m68k/arch_defs_.h: Likewise. + * linux/microblaze/arch_defs_.h: Likewise. + * linux/powerpc64/arch_defs_.h: Likewise. + * linux/sh/arch_defs_.h: Likewise. + * linux/x32/arch_defs_.h: Likewise. + * linux/x86_64/arch_defs_.h: Likewise. + * linux/powerpc/arch_defs_.h: New file. + * Makefile.am (EXTRA_DIST): Add it. + * desc.c (SYS_FUNC(oldselect)): Rewrite using + fetch_indirect_syscall_args, move under [HAVE_ARCH_OLD_SELECT]. + * pathtrace.c (match_xselect_args): New function. + (pathtrace_match_set): Use it. + +2018-01-23 Dmitry V. Levin + + Transform fetch_old_mmap_args into fetch_indirect_syscall_args. + As there are more than one old style syscall that take their arguments + via array, generalize fetch_old_mmap_args into a function that could + fetch variable number of arguments. + + * mem.c (fetch_old_mmap_args): Transform into ... + * fetch_indirect_syscall_args.c: ... fetch_indirect_syscall_args + in this new file. + * Makefile.am (libstrace_a_SOURCES): Add it. + * defs.h [HAVE_ARCH_OLD_MMAP] (fetch_old_mmap_args): Remove. + (fetch_indirect_syscall_args): New prototype. + * pathtrace.c (pathtrace_match_set) [HAVE_ARCH_OLD_MMAP]: Use + fetch_indirect_syscall_args instead of fetch_old_mmap_args. + +2018-01-23 Eugene Syromyatnikov + + signal.c: remove excess semicolon after the end of the function. + * signal.c (rt_sigtimedwait): Remove semicolon after the function body. + + Use char * for pointer arithmetics. + * netlink_inet_diag.c (decode_inet_diag_req_compat, + decode_inet_diag_req_v2, decode_inet_diag_msg): Cast to char * + instead of void *. + * netlink_netlink_diag.c (decode_netlink_diag_req, + decode_netlink_diag_msg): Likewise. + * netlink_packet_diag.c (decode_packet_diag_req, + decode_packet_diag_msg): Likewise. + * netlink_unix_diag.c (decode_unix_diag_req, decode_unix_diag_msg): + Likewise. + * rtnl_addr.c (decode_ifaddrmsg): Likewise. + * rtnl_addrlabel.c (decode_ifaddrlblmsg): Likewise. + * rtnl_dcb.c (decode_dcbmsg): Likewise. + * rtnl_link.c (decode_ifinfomsg): Likewise. + * rtnl_mdb.c (decode_br_port_msg): Likewise. + * rtnl_neigh.c (decode_ndmsg): Likewise. + * rtnl_route.c (decode_rtmsg): Likewise. + * rtnl_rule.c (decode_fib_rule_hdr): Likewise. + * rtnl_tc.c (decode_tcmsg): Likewise. + +2018-01-23 Eugene Syromyatnikov + + netlink_inet_diag.c: remove unnecessary return. + decode_inet_diag_req, as well as the functions it calls, returns void. + + * netlink_inet_diag.c (decode_inet_diag_req): Do not return anything. + +2018-01-21 Dmitry V. Levin + + Move decoder of getpagesize syscall to libstrace. + As only five architectures have getpagesize syscall, moving the decoder + to libstrace allows to get rid of getpagesize related ifdefs and check + build of getpagesize decoder on other architectures. + + * mem.c (SYS_FUNC(getpagesize)): Move ... + * getpagesize.c: ... to this new file. + * Makefile.am (libstrace_a_SOURCES): Add it. + +2018-01-21 Eugene Syromyatnikov + + mpers: implement gawk 3 support. + Some old systems that still make some sense to be supported have only + gawk 3, so let's support them for now. + + In order to achieve that, multiple changes have been implemented: + - Multidimensional arrays are replaced with single-dimensional ones. + In most places it's a "][" -> ", " replacement, as awk allows some + kind of emulation of multidimensional arrays that way, but in several + occasions (specifically for storing name and special fields) we have + to iterate over them later, so we store that information in + additional arrays in order to get the keys. + - "switch" statements are replaced with sets of "if ... else if ... + else" statements. This change is trivial, except we've added + a temporary variable in what_is order to store expression value, for + readability purposes. + - No support for array iteration ordering. This one is most ugly of + them all. Luckily, not that ugly, we've just had to process index a + bit in order to make it lexicographically sortable and add two + temporary arrays containing sorted indices in order to sort over them + instead of those two arrays that we've added in order to work around + lack of multidimensional array support. + + * mpers.awk (compare_indices): Remove unused function. + (array_get, update_upper_bound, /^DW_AT_data_member_location/, + /^DW_AT_byte_size/, /^DW_AT_encoding/): Replace multidimensional array + access with comma-concatenated index. + (norm_idx): New function. + (array_seq): Replace multidimensional array access with + comma-concatenated index. Use comma-concatenated pair of (array_idx, + "seq") in order to check presence of the item in an array. + (what_is): Add enc and i local variables. Store the value of + array[what_idx, "encoding"] in it. Replace "switch" statements with + sets of "if ... else if ... else" statements. Replace multidimensional + array access with comma-concatenated index. Use for (... ; ...; ...) + iteration over aparents_keys instead of iteration over array. + (/^<[[:xdigit:]]+>/): Store idx as norm_idx(matches[2]). Replace + multidimensional array access with comma-concatenated index. Store an + additional flag in array_names array. + (/^DW_AT_name/): Replace multidimensional array access with + comma-concatenated index. Add a flag to array_names for that idx. + (/^DW_AT_type/): Do not capture "0x" as a part of a group, normalise + the captured group. Replace multidimensional array access with + comma-concatenated index. + (/^Abbrev Number:[^(]+\(DW_TAG_/): Replace multidimensional array access + with comma-concatenated index. Store additional flags in + array_special and array_parents arrays. + (END): Remove PROCINFO["sorted_in"] setup. Sort array_parents. Replace + multidimensional array access with comma-concatenated index. Iterate + over array_special to go over all the items that have "special" field. + Iterate over array_names to go over all items that have "name" field. + * NEWS: Mention it. + +2018-01-21 Eugene Syromyatnikov + + dm: add support for event_nr in DM_LIST_DEVICES result. + Commit v4.13-rc1~137^2~13 (and a follow-up fix v4.14-rc4~20^2~3 + that changed alignment) introduced an additional hidden field + in the structure returned by DM_LIST_DEVICES ioctl command + that contains event_nr information. + + Unfortunately, we can't test it for now, but looks like it kinda works: + + # ./strace -v -eioctl -y dmsetup ls + ioctl(3, DM_VERSION, {version=4.0.0, + data_size=16384, flags=DM_EXISTS_FLAG} => {version=4.37.0, + data_size=16384, flags=DM_EXISTS_FLAG}) = 0 + ioctl(3, DM_LIST_DEVICES, {version=4.0.0, + data_size=16384, data_start=312, flags=DM_EXISTS_FLAG} => + {version=4.37.0, data_size=408, data_start=312, flags=DM_EXISTS_FLAG, + {dev=makedev(253, 1), name="fedoratesting--30-swap", event_nr=0}, + {dev=makedev(253, 0), name="fedoratesting--30-root"}}) = 0 + fedoratesting--30-swap (253:1) + fedoratesting--30-root (253:0) + + * dm.c (dm_decode_dm_name_list): Obtain the amount of bytes copied + during printing device name, print event number if there's a suitable + gap present and the DM version is high enough. + * NEWS: Mention it. + +2018-01-21 Eugene Syromyatnikov + + Move definition of personality macros to arch_defs_.h. + * supported_personalities.h: Remove. + * defs.h: Do not include it. + * linux/arch_defs_.h [!DEFAULT_PERSONALITY] (DEFAULT_PERSONALITY): New + macro. + [!SUPPORTED_PERSONALITIES] (SUPPORTED_PERSONALITIES): Likewise. + * linux/aarch64/arch_defs_.h (SUPPORTED_PERSONALITIES): New macro. + * linux/riscv/arch_defs_.h: Likewise. + * linux/s390x/arch_defs_.h: Likewise. + * linux/sparc64/arch_defs_.h: Likewise. + * linux/x32/arch_defs_.h: Likewise. + * linux/x86_64/arch_defs_.h: Likewise. + * linux/powerpc64/arch_defs_.h: New file. + * linux/tile/arch_defs_.h: Likewise. + * Makefile.am (EXTRA_DIST): Add them. + (strace_SOURCES): Remove supported_personalities.h. + + Co-Authored-by: Dmitry V. Levin + +2018-01-21 Eugene Syromyatnikov + + Introduce HAVE_ARCH_SA_RESTORER. + In order to simplify HAVE_SA_RESTORER logic a bit. + + * linux/ia64/arch_defs_.h (HAVE_ARCH_SA_RESTORER): New macro. + * linux/m68k/arch_defs_.h: Likewise. + * linux/sparc/arch_defs_.h: Likewise. + * linux/sparc64/arch_defs_.h: Likewise. + * linux/hppa/arch_defs_.h: New file. + * Makefile.am (EXTRA_DIST): Add it. + * signal.c [HAVE_ARCH_SA_RESTORER]: Define HAVE_SA_RESTORER to it. + [!HAVE_ARCH_SA_RESTORER && SA_RESTORER]: Define HAVE_SA_RESTORER to 1. + [!HAVE_ARCH_SA_RESTORER && !SA_RESTORER]: Define HAVE_SA_RESTORER to 0. + +2018-01-21 Dmitry V. Levin + + Replace NEED_UID16_PARSERS with HAVE_ARCH_UID16_SYSCALLS. + * linux/arch_defs_.h [!HAVE_ARCH_UID16_SYSCALLS] + (HAVE_ARCH_UID16_SYSCALLS): New macro. + * linux/aarch64/arch_defs_.h (HAVE_ARCH_UID16_SYSCALLS): New macro. + * linux/arm/arch_defs_.h: Likewise. + * linux/i386/arch_defs_.h: Likewise. + * linux/ia64/arch_defs_.h: Likewise. + * linux/m68k/arch_defs_.h: Likewise. + * linux/s390/arch_defs_.h: Likewise. + * linux/s390x/arch_defs_.h: Likewise. + * linux/sh/arch_defs_.h: Likewise. + * linux/sparc/arch_defs_.h: Likewise. + * linux/sparc64/arch_defs_.h: Likewise. + * linux/syscall.h: Likewise. + * linux/x32/arch_defs_.h: Likewise. + * linux/x86_64/arch_defs_.h: Likewise. + * linux/bfin/arch_defs_.h: New file. + * linux/microblaze/arch_defs_.h: Likewise. + * linux/riscv/arch_defs_.h: Likewise. + * linux/sh64/arch_defs_.h: Likewise. + * Makefile.am (EXTRA_DIST): Add them. + * defs.h (NEED_UID16_PARSERS): Remove. + * linux/syscall.h: Check for HAVE_ARCH_UID16_SYSCALLS instead of + NEED_UID16_PARSERS. + * uid.c: Likewise. + + Replace HAVE_GETRVAL2 with HAVE_ARCH_GETRVAL2. + * linux/arch_defs_.h [!HAVE_ARCH_GETRVAL2] (HAVE_ARCH_GETRVAL2): New + macro. + * linux/alpha/arch_defs_.h: New file. + * linux/ia64/arch_defs_.h: Likewise. + * linux/mips/arch_defs_.h: Likewise. + * linux/sh/arch_defs_.h: Likewise. + * linux/sparc/arch_defs_.h: Likewise. + * linux/sparc64/arch_defs_.h: Likewise. + * Makefile.am (EXTRA_DIST): Add them. + * defs.h (HAVE_GETRVAL2): Remove. + (getrval2): Check for HAVE_ARCH_GETRVAL2 instead of arch checks. + * net.c (SYS_FUNC(pipe)): Check for HAVE_ARCH_GETRVAL2 instead of + HAVE_GETRVAL2. + * syscall.c: Likewise. + + Use #if idiom instead of #ifdef for HAVE_ARCH_* macros. + * linux/arch_defs_.h [!HAVE_ARCH_OLD_MMAP] (HAVE_ARCH_OLD_MMAP): New + macro. + [!HAVE_ARCH_OLD_MMAP_PGOFF] (HAVE_ARCH_OLD_MMAP_PGOFF): Likewise. + * defs.h: Use #if instead of #ifdef to check HAVE_ARCH_OLD_MMAP. + * mem.c: Use #if instead of #ifdef to check HAVE_ARCH_OLD_MMAP + and HAVE_ARCH_OLD_MMAP_PGOFF + * pathtrace.c: Likewise. + +2018-01-21 Dmitry V. Levin + + Rename arch-specific arch_defs.h files to arch_defs_.h. + Introduce a new arch_defs.h header that includes the corresponding + arch-specific arch_defs_.h file followed by generic arch_defs_.h file. + + * linux/arch_defs.h: Rename to linux/arch_defs_.h. + * linux/aarch64/arch_defs.h: Rename to linux/aarch64/arch_defs_.h. + * linux/arm/arch_defs.h: Rename to linux/arm/arch_defs_.h. + * linux/i386/arch_defs.h: Rename to linux/i386/arch_defs_.h. + * linux/m68k/arch_defs.h: Rename to linux/m68k/arch_defs_.h. + * linux/s390/arch_defs.h: Rename to linux/s390/arch_defs_.h. + * linux/s390x/arch_defs.h: Rename to linux/s390x/arch_defs_.h. + * linux/x32/arch_defs.h: Rename to linux/x32/arch_defs_.h. + * linux/x86_64/arch_defs.h: Rename to linux/x86_64/arch_defs_.h. + * arch_defs.h: New file. + * Makefile.am (strace_SOURCES): Add it. + (EXTRA_DIST): Rename linux/*/arch_defs.h to linux/*/arch_defs_.h. + +2018-01-19 Dmitry V. Levin + + Fix ANY_WORDSIZE_LESS_THAN_KERNEL_LONG definition. + * defs.h (ANY_WORDSIZE_LESS_THAN_KERNEL_LONG): Rewrite without undefined + behaviour. + + Fixes: f916793 ("Introduce ANY_WORDSIZE_LESS_THAN_KERNEL_LONG macro") + +2018-01-19 Eugene Syromyatnikov + + util: return string size in printstr. + As umovestr now returns something useful, let's propagate it further. + + * defs.h (printstr_ex, printpathn, printpath): Change return type from + void to int. + (printstrn, printstr): Change return type from void to int, return + printstr_ex result. + * util.c (printpathn): Return -1 on NULL addr, nul_seen (exit code of + umovestr) on success. + (printpath): Return printpathn result. + (printstr_ex): Return -1 on NULL addr, umoven/umovestr result otherwise. + +2018-01-19 Eugene Syromyatnikov + + ucopy: return string size in umovestr. + We return the size that includes \0 in order to preserve existing + behaviour (return 0 when \0 haven't been seen, return positive number + when it has been seen). + + * ucopy.c (umovestr_peekdata, umovestr): Return string length + including \0 instead of 1 when \0 is found. + +2018-01-19 Dmitry V. Levin + + mpers.awk: avoid redefinition of mpers_ptr_t. + Older versions of gcc like those found in RHEL6 fail with the following + diagnostics: + + In file included from block.c:32: + ./mpers-m32/struct_blk_user_trace_setup.h:2: error: redefinition of typedef ‘mpers_ptr_t’ + mpers_type.h:44: note: previous declaration of ‘mpers_ptr_t’ was here + + * mpers.awk (END): Add #ifndef guard to mpers_ptr_t typedef. + * mpers_test.sh: Update expected output. + +2018-01-19 Eugene Syromyatnikov + + Add support for --enable-mpers=m32|mx32. + * configure.ac (AC_ARG_ENABLE([mpers])): Allow m32 and mx32 values + for --enable-mpers option. + * m4/mpers.m4 (st_MPERS): Check for personality support if personality + name is provided as an option. Fail if the requested personality + support is not available. + + Co-Authored-by: Dmitry V. Levin + +2018-01-19 Eugene Syromyatnikov + + tests: improve setugid error diagnostics a bit. + * tests/setugid.c (main): Print unexpected code returned by syscall. + +2018-01-19 Dmitry V. Levin + + v4l2: do not mpersify struct v4l2_create unless it is used by other code + This fixes build with mpers support on older systems that lack + definition of struct v4l2_create. + + * v4l2.c: Wrap references to struct v4l2_create with + [VIDIOC_CREATE_BUFS]. + +2018-01-18 Dmitry V. Levin + + btrfs: use uint32_t instead of __u32. + * btrfs.c (btrfs_ioctl) [!HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE]: + Replace __u32 with uint32_t. Remove useless cast. + +2018-01-19 Eugene Syromyatnikov + + strace.1.in: clarify mpers flags in strace -V output. + The previous description was a bit dated. + + * strace.1.in (.SH "MULTIPLE PERSONALITY SUPPORT"): Remove "no-m32" and + "no-mx32", describe the situation when some of mpers flags are not + present in strace -V output. + +2018-01-19 Eugene Syromyatnikov + + Add compat support for s390x. + By very popular demand. + + While we are here, let's refactor the condition for old_mmap_pgoff into + an arch-specific one, as it is used more than in one place. + + * NEWS: Mention this. + * strace.1.in (.SH "MULTIPLE PERSONALITY SUPPORT"): Likewise. + * configure.ac (case "$host_cpu" in) : Set arch_m32 to s390, set + cc_flags_m32 to -m31. + (st_MPERS([m32])): Add s390x. + * defs.h [S390X]: Define NEED_UID16_PARSERS. + * linux/s390/arch_sigreturn.c [!S390_FRAME_PTR] (S390_FRAME_PTR): New + macro, define to s390_frame_ptr. + [!SIGNAL_FRAMESIZE] (SIGNAL_FRAMESIZE): New macro, define to + __SIGNAL_FRAMESIZE. + [!PTR_TYPE] (PTR_TYPE): New macro, define to unsigned long. + (arch_sigreturn): Use S390_FRAME_PTR, SIGNAL_FRAMESIZE, and PTR_TYPE + instead of s390_frame_ptr, __SIGNAL_FRAMESIZE, and pointer-sized type, + respectively. + * linux/s390/get_error.c [!ARCH_REGSET] (ARCH_REGSET): New macro, define + * to s390_regset. + (get_error): Use it instead of s390_regset. + * linux/s390/get_scno.c (arch_get_scno): Likewise. + * linux/s390/get_syscall_args.c (get_syscall_args): Likewise. + * linux/s390/set_error.c (arch_set_error, arch_set_success): Likewise. + * linux/s390/set_scno.c (arch_set_scno): Likewise. + * linux/s390x/arch_regs.c (psw_compat_t, s390_compat_regs, + s390x_regs_union, s390_frame_ptr, s390x_frame_ptr, s390x_io): New + variables. + (s390_regset, s390x_regset, ARCH_REGS_FOR_GETREGSET, + ARCH_IOVEC_FOR_GETREGSET, ARCH_PC_REG, ARCH_PERSONALITY_0_IOV_SIZE, + ARCH_PERSONALITY_1_IOV_SIZE): New macros. + * linux/s390x/arch_regs.h (s390_frame_ptr, s390x_frame_ptr): New + prototypes. + * linux/s390x/arch_rt_sigframe.c: Conditionalize on tcp->currpers. + * linux/s390x/arch_sigreturn.c: Likewise. + * linux/s390x/get_error.c: Likewise. + * linux/s390x/get_scno.c: Likewise. + * linux/s390x/get_syscall_args.c: Likewise. + * linux/s390x/set_error.c: Likewise. + * linux/s390x/set_scno.c: Likewise. + * linux/s390x/errnoent1.h: New file. + * linux/s390x/ioctls_arch1.h: Likewise. + * linux/s390x/ioctls_inc1.h: Likewise. + * linux/s390x/signalent1.h: Likewise. + * linux/s390x/syscallent1.h: Likewise. + * Makefile.am (EXTRA_DIST): Add new files added to linux/s390x. + * supported_personalities.h [S390X] (SUPPORTED_PERSONALITIES): Define + to 2. + * tests/strace-V.test: Add s390 to the list of architectures that have + m32 personality. + * linux/s390/arch_defs.h (HAVE_ARCH_OLD_MMAP_PGOFF): New macro. + * linux/s390x/arch_defs.h: Likewise. + * mem.c: Replace #ifdef S390 with #ifdef HAVE_ARCH_OLD_MMAP_PGOFF. + * pathtrace.c: Likewise. + +2018-01-18 Eugene Syromyatnikov + + Update NEWS. + +2018-01-17 Dmitry V. Levin + + tests: check path tracing of ppoll syscall. + * tests/ppoll.c (main) [PATH_TRACING_FD]: Skip if /proc/self/fd/ + is not available. Add a test call that use PATH_TRACING_FD. + (main): Conditionalize expected output for those calls + that do not use PATH_TRACING_FD with [!PATH_TRACING_FD]. + * tests/ppoll-P.c: New file. + * tests/pure_executables.list: Add ppoll-P. + * tests/.gitignore: Likewise. + * tests/gen_tests.in (ppoll-P): New entry. + + tests: check path tracing of poll syscall. + * tests/poll.c (main) [PATH_TRACING_FD]: Skip if /proc/self/fd/ + is not available. Add tests calls that use PATH_TRACING_FD. + (main): Conditionalize expected output for those calls + that do not use PATH_TRACING_FD with [!PATH_TRACING_FD]. + * tests/poll-P.c: New file. + * tests/pure_executables.list: Add poll-P. + * tests/.gitignore: Likewise. + * tests/poll-P.test: New test. + * tests/Makefile.am (DECODER_TESTS): Add poll-P.test. + +2018-01-17 Eugene Syromyatnikov + + tests: enable old_mmap-P.test on s390x. + As s390x is the only 64-bit architecture that has old_mmap, + the test needs some adjustments there. + + * tests/old_mmap.c: Update condition. + (main): Change int types to long, extend numerals to 64 bit, change + printing format qualifiers to corresponding long types. + + Co-Authored-by: Dmitry V. Levin + +2018-01-17 Eugene Syromyatnikov + + tests: check path tracing of old mmap syscall. + * tests/old_mmap.c [!TEST_FD]: Define TEST_FD. + (main) : Replace 5th argument with TEST_FD. + (main): Wrap the output for the calls that do not use TEST_FD + with #ifndef PATH_TRACING. + * tests/old_mmap-P.c: New file. + * tests/pure_executables.list: Add old_mmap-P. + * tests/.gitignore: Likewise. + * tests/gen_tests.in: Add old_mmap-P test. + +2018-01-17 Eugene Syromyatnikov + + Fix pathtrace for old_mmap/old_mmap_pgoff. + As these system calls have only one argument that points to the + location in memory containing actual arguments, current path tracing + implementation is incorrect. In order to fix this, let's use recently + introduced fetch_old_mmap_args in order to get actual arguments suitable + for path matching. + + * pathtrace.c [HAVE_ARCH_OLD_MMAP] : Retrieve actual old_mmap arguments with + fetch_old_mmap_args, pass the value from the retrieved args if it's + available. + +2018-01-17 Eugene Syromyatnikov + + Test non-verbose old_mmap output. + * tests/old_mmap-v-none.c: New file. Include old_mmap.c. + * tests/pure_executables.list: Add old_mmap-v-none. + * tests/.gitignore: Likewise. + * tests/gen_tests.in (old_mmap-v-none): New entry. + +2018-01-17 Eugene Syromyatnikov + + mem.c: use runtime check in fetch_old_mmap_args. + This makes code a bit cleaner and makes it compatible with the upcoming + s390x compat support. + + * mem.c [HAVE_ARCH_OLD_MMAP] (fetch_old_mmap_args): Replace + ANY_WORDSIZE_LESS_THAN_KERNEL_LONG check with current_wordsize == 4 + check. + +2018-01-17 Eugene Syromyatnikov + + mem.c: introduce fetch_old_mmap_args. + Move common old_mmap/old_mmap_pgoff argument fetching code into a + separate function. + + As it is, it also fixes the case of non-verbose printing of old_mmap + arguments (see the new test in the next commit). Also, it is a + preparation for the fix of path tracing for these syscalls. + + * defs.h [HAVE_ARCH_OLD_MMAP] (fetch_old_mmap_args): New prototype. + * mem.c [HAVE_ARCH_OLD_MMAP] (fetch_old_mmap_args): New function. + [HAVE_ARCH_OLD_MMAP] (old_mmap, old_mmap_pgoff): Use it. + + Fixes: 3db07f11 "Fix old_mmap output when mmap arguments are unfetchable" + Suggested-by: Dmitry V. Levin + +2018-01-17 Eugene Syromyatnikov + + Introduce arch-specific define HAVE_ARCH_OLD_MMAP. + * linux/arch_defs.h: New file. + * linux/aarch64/arch_defs.h: New file. Define HAVE_ARCH_OLD_MMAP. + * linux/arm/arch_defs.h: Likewise. + * linux/i386/arch_defs.h: Likewise. + * linux/m68k/arch_defs.h: Likewise. + * linux/s390/arch_defs.h: Likewise. + * linux/s390x/arch_defs.h: Likewise. + * linux/x32/arch_defs.h: Likewise. + * linux/x86_64/arch_defs.h: Likewise. + * Makefile.am (EXTRA_DIST): Add them. + * defs.h: Include "arch_defs.h" + * mem.c: Replace condition for SYS_FUNC(old_mmap) with #ifdef + HAVE_ARCH_OLD_MMAP. + + Suggested-by: Dmitry V. Levin + +2018-01-17 Dmitry V. Levin + Nikolay Marchuk + + tests: improve descriptor set syntax testing. + * tests/filtering_fd-syntax.test: New file. + * tests/options-syntax.test: Move descriptor set syntax testing + to filtering_fd-syntax.test. + * tests/Makefile.am (MISC_TESTS): Add filtering_fd-syntax.test. + +2018-01-16 Eugene Syromyatnikov + + strace.c: print correct out file name in error messages in case of -ff. + * strace.c (outf_perror): New function. + (tvprintf, tprints, flush_tcp_output): Use it. + + aarch64: use ARCH_SET_PERSONALITY_FROM_IOV_SIZE. + * linux/aarch64/arch_regs.c (ARCH_PERSONALITY_0_IOV_SIZE, + ARCH_PERSONALITY_1_IOV_SIZE): New macros. + * linux/aarch64/get_scno.c (arch_get_scno): Do not call + update_personality as it is handled by the generic get_regs code now. + +2018-01-16 Eugene Syromyatnikov + + syscall.c: add ability to set personality based on GETREGSET iov size. + Some architectures (aarch64, s390x) use only PTRACE_GETREGSET interface + and use its size to detect current personality. Let's generalise this + approach and also avoid subtle errors when we get register but forget to + update personality, at least for those architectures. + + Note that in order to employ this behaviour, architecture has to use + PTRACE_GETREGSET exclusively (no HAVE_GETREGS_OLD) and should declare + appropriate ARCH_PERSONALITY_*_IOV_SIZE macros. + + * syscall.c (get_regs) [ptrace_getregset_or_getregs && + !HAVE_GETREGS_OLD]: Call update_personality based on the value returned + in the iov_len field by PTRACE_GETREGSET. Warn once if the returned + iov_len is unknown. + +2018-01-16 Eugene Syromyatnikov + + syscall.c: add sanity check for the target personality number. + We can never be cautious enough. + + * defs.h (set_personality): Change argument type to unsigned int. + * syscall.c (set_personality): Change argument type to unsigned int, + check whether requested personality is sane, die otherwise. + +2018-01-16 Eugene Syromyatnikov + + syscall.c: move current_personality check to set_personality. + As all the personality-dependent entries are initially in sync, we can + move the check whether we are setting the same personality as we + currently are inside set_personality out of update_personality. + + * syscall.c (current_wordsize, current_klongsize): Initialise to 0'th + personality value in order to make the statement about "all the + personality-dependent entries are initially in sync" true. + (set_personality): Check whether requested personality differs from + current_personality. + (update_personality): Call set_personality unconditionally. + +2018-01-16 Eugene Syromyatnikov + + syscall.c: always update tcp->currpers in update_personality. + Sometimes (for example, switching from a process with one personality + to a process that previously had different personality but returning + from execve to that same personality into) it is possible that + current_personality is not changed, but tcp->currpers is different. + So, let's not return from update_personality and always update + tcp->currpers if it differs from the target personality. + + * syscall.c (update_personality): Do not exit early if personality == + current_personality. + +2018-01-16 Eugene Syromyatnikov + + Update current_personality on tcb switch. + * strace.c (set_current_tcp): New function. + (printleader, droptcb, print_event_exit, next_event, dispatch_event): + Call set_current_tcp instead of setting current_tcp manually. + +2018-01-16 Eugene Syromyatnikov + + Add support for specifying compiler options for mpers builds. + Because some architectures are very, very special. + + * configure.ac (cc_flags_m32, cc_flags_mx32): New variables. AC_SUBST + them. + * m4/mpers.m4 (MPERS_CFLAGS): Use instead of CFLAG, pushdef as + $cc_flags_$1. + Use mpers_name instead of CFLAG in AC_CACHE_CHECK messages. + Pass MPERS_CFLAGS as the second argument to mpers_test.sh + * mpers.sh: Add CC_ARCH_FLAGS as the second argument (PARSER_FILE + is moved to the third one). Do not expect leading dash in ARCH_FLAG + anymore. + * mpers_test.sh (mpers_cc_flags): New variable, initialise to the second + command line argument. + Pass $mpers_name without leading dash to mpers.sh. + Pass $mpers_cc_flags as the second argument to mpers.sh ($sample is + the third argument now). + * Makefile.am (mpers-m%.stamp:): Pass $(mpers_CC_FLAGS) as the second + argument to mpers.sh ($$f is now the third argument). + ($(mpers_m32_targets)): Define target variable mpers_CC_FLAGS with the + value of @cc_flags_m32@ + ($(mpers_mx32_targets)): Define target variable mpers_CC_FLAGS with the + value of @cc_flags_mx32@ + * tests/Makefile.am (MERS_CC_FLAGS): New variable. + * bootstrap: Append @cc_flags_$1@ to MPERS_CC_FLAGS. Append + $(MPERS_CC_FLAGS) to ARCH_MFLAGS. + +2018-01-16 Dmitry V. Levin + Nikolay Marchuk + + tests: improve syscall set syntax testing. + * tests/filtering_syscall-syntax.test: New file. + * tests/options-syntax.test: Move syscall set syntax testing + to filtering_syscall-syntax.test. + * tests/qual_fault-syntax.test: Likewise. + * tests/qual_inject-syntax.test: Likewise. + * tests/Makefile.am (MISC_TESTS): Add filtering_syscall-syntax.test. + +2018-01-16 Dmitry V. Levin + + Enhance error diagnostics about invalid syscalls in fault injection syntax + Validate syscall set before the whole fault injection syntax. + + * filter_qualify.c (parse_inject_expression): Add const qualifier to + return type. Return an empty string when no syscall set is specified. + (qualify_inject_common): Add const qualifier to "name". Move + qualify_syscall_tokens invocation right after parse_inject_expression. + * tests/qual_fault-syntax.test: Update expected output. + * tests/qual_inject-syntax.test: Likewise. + +2018-01-16 Dmitry V. Levin + + basic_filters: use loop initial declarations. + * basic_filters.c (qualify_syscall_number, qualify_syscall_regex, + lookup_class, qualify_syscall_class, qualify_syscall_tokens, + qualify_tokens): Use "for" loop initial declarations. + + filter_qualify: use loop initial declarations. + * filter_qualify.c (sigstr_to_uint, find_errno_by_name, + parse_inject_expression, qualify_inject_common, qualify): Use "for" loop + initial declarations. + + configure: try to set the C compiler mode to accept ISO Standard C. + * configure.ac: Use AC_PROG_CC_STDC. + * NEWS: Mention this. + +2018-01-15 Dmitry V. Levin + + pathtrace: update the list of unrelated syscalls. + * pathtrace.c (pathtrace_match_set) : Skip matching. + + basic_filters: move legacy tracing class names to the end of table. + * basic_filters.c (lookup_class) : Move names that do not + start with % to the end of table. + + Enhance decoding of mq_* syscalls. + * mq.c (SYS_FUNC(mq_open)): Add RVAL_FD to return value. + (SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive), SYS_FUNC(mq_notify), + SYS_FUNC(mq_getsetattr)): Print the first argument using printfd. + * NEWS: Mention this change. + * pathtrace.c (pathtrace_match_set) : Skip matching. + * linux/32/syscallent.h (mq_getsetattr, mq_notify, mq_open, + mq_timedreceive, mq_timedsend): Add TD flag. + * linux/64/syscallent.h: Likewise. + * linux/alpha/syscallent.h: Likewise. + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/crisv10/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + + Enhance error diagnostics about invalid syscalls in fault injection syntax + * basic_filters.c (qualify_syscall_tokens): Remove "name" argument, + assume its value is "system call". + * filter.h (qualify_syscall_tokens): Remove "name" argument. + All callers updated. + * tests/qual_fault-syntax.test: Update expected output. + + basic_filters: handle "all" in a more readable way. + * basic_filters.c (qualify_syscall_tokens, qualify_tokens): Remove + handle_inversion label, handle "all" by invoking invert_number_set_array + directly. + + filter: remove redundant braces around single line expressions. + * basic_filters.c (qualify_syscall_class, qualify_syscall_name): + Rearrange the inner loop body. + (qualify_syscall_number, lookup_class, qualify_syscall_tokens, + qualify_tokens): Remove redundant braces around single line expressions. + * filter_qualify.c (qualify_inject_common): Likewise. + + filter_qualify: move memory allocation from parse_inject_expression. + * filter_qualify.c (parse_inject_expression): Replace "s" and "buf" + arguments with "str" argument, use it instead of "s" and "*buf". + (qualify_inject_common): Rename "buf" to "copy", initialize it to a copy + of "str", pass "copy" to parse_inject_expression instead of "str" and + "buf". + +2018-01-14 Eugene Syromyatnikov + + xlat: update NT_* constants. + Update NT_* descriptor types with the values borrowed from + kernel's include/uapi/linux/elf.h and glibc's elf.h. + + * xlat/nt_descriptor_types.in (NT_PRSTATUS, NT_FPREGSET, NT_PRPSINFO, + NT_PRXREG, NT_TASKSTRUCT, NT_PLATFORM, NT_AUXV, NT_GWINDOWS, NT_ASRS, + NT_PSTATUS, NT_PSINFO, NT_PRCRED, NT_UTSNAME, NT_LWPSTATUS, + NT_LWPSINFO, NT_PRFPXREG, NT_PRXFPREG, NT_PPC_VMX, NT_PPC_SPE, + NT_PPC_VSX, NT_386_TLS, NT_386_IOPERM, NT_X86_XSTATE): Add fallback + definitions. + (NT_SIGINFO, NT_FILE, NT_PPC_*, NT_S390_*, NT_ARM_*, NT_METAG_*, + NT_ARC_V2): New constants. + * NEWS: Mention this. + +2018-01-13 Dmitry V. Levin + + configure: use AC_MSG_ERROR and AC_MSG_FAILURE consistently. + * configure.ac [$arch = mips]: Use AC_MSG_FAILURE instead of + AC_MSG_ERROR when _MIPS_SIM cannot be determined. Use AC_MSG_ERROR + instead of AC_MSG_FAILURE when syscallent stubs cannot be generated. + +2018-01-11 Eugene Syromyatnikov + Dmitry V. Levin + + configure: add --disable-mpers and --enable-mpers=check options. + On architectures supporting multiple personalities, multiple + personalities support in strace is required for proper decoding of + structures used by tracees with personalities that differ from the + personality of strace. + + New configure options control whether multiple personalities support + in strace is mandatory, optional, or disabled. + + The default is changed from what is now equivalent of + --enable-mpers=check (automatically detect whether required mpers + support could be enabled) to --enable-mpers (terminate the build + if required mpers support could not be enabled). + + * configure.ac (AC_ARG_ENABLE([mpers])): New option. + * m4/mpers.m4 (st_MPERS): Use enable_mpers. Terminate the build + if mpers could not be enabled and enable_mpers==yes. + * strace.spec.in: Specify --enable-mpers=check to %configure. + * debian/rules (build/Makefile, build64/Makefile): Specify + --enable-mpers=check to configure. + + Suggested-by: DJ Delorie + +2018-01-11 Gleb Fotengauer-Malinovskiy + + Update ioctl entries from linux v4.15-rc7. + * linux/32/ioctls_inc_align16.h: Update from linux v4.15-rc7 using ioctls_gen.sh. + * linux/32/ioctls_inc_align32.h: Likewise. + * linux/32/ioctls_inc_align64.h: Likewise. + * linux/64/ioctls_inc.h: Likewise. + * linux/x32/ioctls_inc0.h: Likewise. + * NEWS: Mention this. + +2018-01-11 Eugene Syromyatnikov + Dmitry V. Levin + + Issue a warning when strace lacks tracee personality support. + * defs.h (HAVE_PERSONALITY_1_MPERS, HAVE_PERSONALITY_2_MPERS): New + macros. + * syscall.c (update_personality): Add need_mpers_warning array + initialized with mpers support data. Use it for printing the mpers + unavailability warning once per personality. + +2018-01-11 Eugene Syromyatnikov + + tests: add more checks of reboot syscall decoding. + In particular, check for the recent fixes in reboot syscall decoder. + + * tests/gen_tests.in (reboot): Provide -s 256 option. + * tests/reboot.c (STR32, STR128): New macros. + (main): Add more checks. + +2018-01-11 Eugene Syromyatnikov + + tests: use sprintrc in reboot.test. + * test/reboot.c (main): Use sprintrc instead of old-style manual + printing of return code. + +2018-01-11 Eugene Syromyatnikov + + reboot.c: limit printing of the fourth argument to 255 bytes. + The size of kernel buffer is 256 bytes and the last byte is always zero. + + * reboot.c (SYS_FUNC(reboot)): Replace printstr call with printstr_ex + with size of 255 and style flag QUOTE_0_TERMINATED. + +2018-01-11 Eugene Syromyatnikov + + reboot.c: use printxval instead of printflags. + Numeric arguments of reboot syscall are not flags but magic values. + + * reboot.c (SYS_FUNC(reboot)): Replace printflags with printxval. + +2018-01-11 Eugene Syromyatnikov + + Search for in addition to + This is the location where this header is installed on Debian-based + systems. + + * configure.ac: Check for libiberty/demangle.h in addition to + demangle.h. + * unwind.c [USE_DEMANGLE]: Include either or + based on the presence of HAVE_DEMANGLE_H and + HAVE_LIBIBERTY_DEMANGLE_H macros. + +2018-01-11 Dmitry V. Levin + + strace.1: fix typo. + * strace.1.in (.SH NOTES): Replace prlimit with prlimit64. + +2018-01-11 Eugene Syromyatnikov + + Document multiple personalities support. + * strace.1.in (.SH "MULTIPLE PERSONALITY SUPPORT"): New section. + + Add indication of mpers support to strace -V output. + * strace.c (print_version): Append information about m32 and mx32 + decoding support. + * tests/strace-V.test: Update expected output. + + Provide strace's native arch to the test framework. + * configure.ac (arch_native): New variable, set to arch. + * tests/Makefile.am (NATIVE_ARCH): New variable, set to @arch_native@. + (AM_TEST_LOG_FLAGS): Pass NATIVE_ARCH as STRACE_NATIVE_ARCH environment + variable. + + Add indication of optional demangle feature strace -V output. + * strace.c (print_version) [USE_DEMANGLE]: Append " stack-demangle" + to the features string. + * tests/strace-V.test: Update expected output. + + configure.ac: check for mpers support on RISC-V. + * confgure.ac (st_MPERS([m32])): Add riscv. + +2018-01-11 Eugene Syromyatnikov + + Use xappendstr instead of xsnprintf where suitable. + Replace occurrences of + + outptr += xsnprintf(outptr, sizeof(outstr) - (outptr - outstr), ...) + + with much more sleek + + outptr = xappendstr(outstr, outptr, ...) + + * desc.c (decode_select): Replace xsnprintf with xappendstr. + * open.c (sprint_open_modes): Likewise. + * poll.c (decode_poll_exiting): Likewise. + * signal.c (sprintsigmask_n): Likewise. + * xlat.c (sprintflags): Likewise. + +2018-01-11 Eugene Syromyatnikov + + xstring.h: add xappendstr. + Introduce a macro for handling common case of partial writes + to a character array. + + * xstring.h (get_pos_diff_): New function. + (xappendstr): New macro. + +2018-01-11 Eugene Syromyatnikov + + Update perf-related flags. + - PERF_SAMPLE_BRANCH_TYPE_SAVE, added in v4.14-rc1~173^2~33^2~6 + - PERF_SAMPLE_PHYS_ADDR, added in v4.14-rc1~173^2~2 + + * xlat/perf_branch_sample_type.in (PERF_SAMPLE_BRANCH_TYPE_SAVE): New + flag. + * xlat/perf_event_sample_format.in (PERF_SAMPLE_PHYS_ADDR): Likewise. + * tests/perf_event_open.c: Update expected output. + +2018-01-11 Eugene Syromyatnikov + + perf.c: add support for struct perf_event_attr.namespaces. + This field was introduced by linux kernel commit v4.12-rc1~152^2~42^2~10. + + * configure.ac (AC_CHECK_MEMBERS): Add perf_event_attr.namespaces. + * perf_event_struct.h (struct perf_event_attr): Add namespaces field. + * perf.c (print_perf_event_attr): Print namespaces field. + Update comment for __reserved_1 field. + * tests/perf_event_open.c (struct pea_flags): Add namespaces field. + (print_event_attr): Update expected output. + +2018-01-11 Eugene Syromyatnikov + + tests: check decoding of [gs]et_thread_area syscalls on x86. + * tests/xet_thread_area_x86.c: New file. + * tests/xet_thread_area_x86.test: New test. + * tests/Makefile.am (DECODER_TESTS): Add it. + * tests/.gitignore: Add xet_thread_area_x86. + * tests/pure_executables.list: Likewise. + +2018-01-10 Eugene Syromyatnikov + + tests: check decoding of modify_ldt with for 4-byte-available user_desc. + Since there is possibility now that strace read only entry_number field + of the user_desc struct, let's check that it doesn't do it with + modify_ldt syscall. + + * tests/modify_ldt.c (main): Add 4-byte-sized tail_alloc'ed variable. + Try to provide it as an argument to modify_ldt. + +2018-01-10 Eugene Syromyatnikov + + Allow separate printing of struct user_desc.entry_number. + Kernel reads only entry_number field in the beginning of the + get_thread_area syscall handler. Let's replicate this behaviour. + + * defs.h (enum user_desc_print_filter): New enumeration. + (print_user_desc): Add an argument for signalling which part of the + structure should be printed. + * clone.c (print_tls_arg): Update print_user_desc call. + * ldt.c (print_user_desc): Add filter argument. Print entry_number on + entering and the rest on exiting. Store entering value of the + entry_number field in order to print the updated value in the impossible + case of changed entry_number value. + (SYS_FUNC(modify_ldt), SYS_FUNC(set_thread_area)): Update + print_user_desc call. + (SYS_FUNC(get_thread_area)): Call print_user_desc with + USER_DESC_ENTERING format argument on entering and with + USER_DESC_EXITING on exiting. + +2018-01-10 Eugene Syromyatnikov + + tests: move struct user_desc printing function into a separate file. + As part of preparation for the introduction of [gs]et_thread_area test. + + * tests/modify_ldt.c (print_user_desc): Move it ... + * tests/print_user_desc.c: ... to new file. + * tests/Makefile.am (EXTRA_DIST): Add print_user_desc.c. + +2018-01-08 Eugene Syromyatnikov + + tests: check decoding of modify_ldt syscall. + * tests/modify_ldt.c: New file. + * tests/gen_tests.in: Add modify_ldt test. + * tests/pure_executables.list: Add modify_ldt. + * tests/.gitignore: Likewise. + + ldt.c: manually set modify_ldt's error code. + * ldt.c (modify_ldt): Move parsing under entering(tcp). Check whether + return code is erroneous and set tcp->u_error appropriately along with + RVAL_PRINT_ERR_VAL flag. + +2018-01-08 Eugene Syromyatnikov + + syscall.c: add support for printing return value and error code. + Some weird syscalls (like modify_ldt) return value that doesn't indicate + an error (less than -4096), but it is, in fact, erroneous (because they + decide to clip the return value to 32-bit, for example). + + Add a flag to print decoded error code along with syscall return value. + + * defs.h (RVAL_PRINT_ERR_VAL): New rval flag. + * syscall.c (syscall_exiting_trace): Handle it. + +2018-01-08 Eugene Syromyatnikov + + ldt.c: print the first argument of modify_ldt as int. + * ldt.c (SYS_FUNC(modify_ldt)): Print the first argument as %d. + + ldt.c: print lm field for 64-bit tracees. + * configure.ac (AC_CHECK_MEMBERS): Add struct user_desc.lm. + * ldt.c (print_user_desc) [HAVE_STRUCT_USER_DESC_LM]: Print lm field + for non-compat tracees (it is ignored for compat ones). + +2018-01-08 Eugene Syromyatnikov + + ldt.c: make struct user_desc output more structured. + Also, while we are here, let's fix print qualifiers (which should be %u + and not %d). + + * ldt.c (print_user_desc): Use PRINT_FIELD_* macros for printing + structure. + (SYS_FUNC(set_thread_area)): Change field key-value separator from ":" + to "=", change print format qualifier from %d to %u. + +2018-01-08 Eugene Syromyatnikov + + print_fields.h: add PRINT_FIELD_U_CAST. + Add a macro for printing fields explicitly casted to specific type. + This is useful for bit fields, as otherwise the magic of *_extend_to_* + macros breaks. + + * print_field.h (PRINT_FIELD_U_CAST): New macro. + +2018-01-08 Eugene Syromyatnikov + + print_fields.h: rename PRINT_FIELD_UID to PRINT_FIELD_ID. + As uid is not the only thing that has a special treatment of the -1 + value (and, as a result, needs special care), let's rename + PRINT_FIELD_UID to PRINT_FIELD_ID and make PRINT_FIELD_UID its alias. + + * print_fields.h (PRINT_FIELD_ID): Rename from PRINT_FIELD_UID. + (PRINT_FIELD_UID): Define to PRINT_FIELD_ID. + +2018-01-07 Dmitry V. Levin + + Fix build on systems without linux/genetlink.h. + * socketutils.c [!HAVE_LINUX_GENETLINK_H] (genl_families_xlat): Add + tcp argument. + + Fixes: v4.20-134-gc46fefc ("Add tcp arguments to netlink calls") + +2018-01-07 Eugene Syromyatnikov + + count.c: whitespace. + + count.c: cleanup types and sizeof usage. + * count.c (call_summary_pers): Change the type of sorted_count + to "unsigned int *". Replace sizeof(int) with sizeof(sorted_count[0]). + Change the type of idx to unsigned int. + +2018-01-07 Eugene Syromyatnikov + + count.c: collect definitions of format strings in one place. + In an attempt to make it more readable. + + * count.c (call_summary_pers): Put all format strings in static + constants. Use them. + +2018-01-07 Eugene Syromiatnikov + + Add tcp arguments to netlink calls. + Since they call tracee-specific socket/sendmsg/recvmsg, we'd like to + pass tcp there. + + * defs.h (genl_families_xlat): Add tcp argument. + * netlink.c (decode_nlmsg_type_default, decode_nlmsg_type_generic, + decode_nlmsg_type_netfilter, typedef nlmsg_types_decoder_t): Likewise. + (decode_nlmsg_type): Add tcp argument. Pass tcp to decoder call. + (print_nlmsghdr): Pass tcp to the decode_nlmsg_type call. + * socketutils.c (send_query, receive_responses): Add tcp argument. + (inet_send_query, unix_send_query, netlink_send_query, ): Add tcp argument. + Pass tcp to the send_query call. + (unix_get): Add tcp argument. Pass tcp to the unix_send_query and + receive_responses calls. + (inet_get): Add tcp argument. Pass tcp to the inet_send_query and + receive_responses calls. + (tcp_v4_get, udp_v4_get, tcp_v6_get, udp_v6_get): Add tcp argument. Pass + tcp to the inet_get call. + (netlink_get): Add tcp argument. Pass tcp to the netlink_send_query and + receive_responses calls. + (protocols): Add tcp argument to the get field. + (get_sockaddr_by_inode_uncached): Add tcp argument. Pass tcp to + the protocols[].get calls. + (print_sockaddr_by_inode_uncached): Add tcp argument. Pass tcp to + the get_sockaddr_by_inode_uncached call. + (get_sockaddr_by_inode): Pass tcp to the get_sockaddr_by_inode_uncached + call. + (print_sockaddr_by_inode): Pass tcp to the + print_sockaddr_by_inode_uncached call. + (genl_send_dump_families): Add tcp argument. Pass tcp to the send_query + call. + (genl_families_xlat): Add tcp argument. Pass tcp to the + genl_send_dump_families and receive_responses calls. + +2018-01-07 Eugene Syromiatnikov + + Add tcp argument to clear_regs. + * defs.h (clear_regs): Add argument struct tcb *tcp. + * syscall.c (clear_regs): Likewise. + * strace.c (next_event): Pass tcp to clear_regs() call. + +2018-01-07 Eugene Syromiatnikov + + Pass tcp argument to get_optmem_max/read_int_from_file. + In preparation to passing tcp to all tracee-related syscalls. + + * defs.h (read_int_from_file): Add "struct tcb *" as the first argument. + * util.c (read_int_from_file): Likewise. + * msghdr.c (get_optmem_max): Add "struct tcb *tcp" as the first + argument, pass it to read_int_from_file call. + (decode_msg_control): Pass tcp to get_optmem_max. + +2018-01-07 Eugene Syromiatnikov + + Include paths.h if it is available. + Use the OS definition of _PATH_BSHELL macro if it is available. + + * configure.ac (AC_CHECK_HEADERS): Add paths.h. + * strace.c [HAVE_PATHS_H]: Include paths.h. + +2018-01-07 Eugene Syromiatnikov + + strace.c: avoid duplication of a format string in attach_tcb. + * strace.c (attach_tcb): Add task_path variable with the output format. + Use it for the procdir declaration and xsprintf format string argument. + +2018-01-07 Elvira Khabirova + + Move syscall_tampered to defs.h. + * syscall.c (syscall_tampered): Move ... + * defs.h: ... here. + +2018-01-07 Elvira Khabirova + + strace.c: rename set_sigaction to set_sighandler. + Since set_sigaction() actually specifies sa_handler and not sa_sigaction, + rename set_sigaction() to set_sighandler() for future definition of + set_sigaction() function as specifying sa_sigaction. + + * strace.c (set_sigaction): Rename to set_sighandler. + All callers updated. + +2018-01-07 Elvira Khabirova + + .gitignore: ignore "gnu" directory created by st_MPERS m4 macro. + + Update .mailmap. + * .mailmap (Elvira Khabirova): Add @altlinux.org. + +2018-01-07 Chen Jingpiao + + .mailmap: add canonical name for Chen Jingpiao. + * .mailmap: Add canonical name for Chen Jingpiao. + +2018-01-07 Dmitry V. Levin + + personality.c: use sprintxval. + * personality.c (SYS_FUNC(personality)): Use sprintxval instead of local + implementation. + +2018-01-07 Eugene Syromiatnikov + + xlat.c: add sprintxval for printing xval to string. + * defs.h (sprintxval): New declaration. + (sprintxval): New function. + +2018-01-07 Dmitry V. Levin + + desc.c: use xsnprintf instead of sprintf. + * desc.c: Include "xstring.h". + (decode_select): Replace sprintf with xsnprintf. + + xlat.c: use xsnprintf instead of sprintf. + * xlat.c: Include "xstring.h". + (sprintflags): Replace sprintf with xsnprintf. + + open.c: use xsnprintf instead of sprintf. + * open.c: Include "xstring.h". + (sprint_open_modes): Replace sprintf with xsnprintf. + + poll.c: use xs*printf instead of sprintf. + * poll.c: Include "xstring.h". + (decode_poll_exiting): Replace sprintf with xsnprintf and xsprintf. + + signal.c: use xs*printf instead of sprintf. + * signal.c: Include "xstring.h". + (signame): Replace sprintf with xsprintf. + (sprintsigmask_n): Replace sprintf with xsnprintf. + + print_timeval.c: use xsprintf instead of snprintf. + * print_timeval.c: Include "xstring.h". + (sprint_timeval, sprint_timeval32): Replace snprintf with xsprintf. + + print_timespec.c: use xsprintf instead of snprintf. + * print_timespec.c: Include "xstring.h". + (sprint_timespec): Replace snprintf with xsprintf. + + mmsghdr.c: use xsprintf instead of snprintf. + * mmsghdr.c: Include "xstring.h". + (SYS_FUNC(recvmmsg)): Replace snprintf with xsprintf. + + socketutils.c: use xsprintf instead of snprintf. + * socketutils.c: Include "xstring.h". + (unix_parse_response): Replace snprintf with xsprintf. + + alpha.c: use xsprintf instead of snprintf. + * alpha.c: Include "xstring.h". + (decode_getxxid): Replace snprintf with xsprintf. + + v4l2.c: use xsprintf instead of sprintf. + * v4l2.c: Include "xstring.h". + (print_v4l2_create_buffers): Replace sprintf with xsprintf. + + util.c: use x*sprintf instead of s*printf. + * util.c: Include "xstring.h". + (sprinttime_ex): Replace snprintf with xsnprintf. + (getfdproto): Replace sprintf with xsprintf. + + unwind.c: use xsprintf instead of sprintf. + * unwind.c: Include "xstring.h". + (build_mmap_cache): Replace sprintf with xsprintf. + + syscall.c: use xsprintf instead of sprintf. + * syscall.c: Include "xstring.h". + (get_scno): Replace sprintf with xsprintf. + + resource.c: use xsprintf instead of sprintf. + * resource.c: Include "xstring.h". + (sprint_rlim64, sprint_rlim32): Replace sprintf with xsprintf. + + pathtrace.c: use xsprintf instead of sprintf. + * pathtrace.c: Include "xstring.h". + (getfdpath): Replace sprintf with xsprintf. + +2018-01-07 Eugene Syromyatnikov + + ldt.c: replace sprintf with xsprintf. + * ldt.c: Include "xstring.h". + (SYS_FUNC(set_thread_area)): Replace sprintf with xsprintf. + +2018-01-05 Dmitry V. Levin + + strace.c: use xsprintf instead of sprintf. + * strace.c: Include "xstring.h". + (strerror, newoutf, attach_tcb, print_debug_info): Replace sprintf + with xsprintf. + +2018-01-05 Eugene Syromyatnikov + + ioprio.c: use xsprintf instead of sprintf. + * ioprio.c: Include "xstring.h". + (sprint_ioprio): Replace sprintf with xsprintf. + +2018-01-05 Eugene Syromyatnikov + + Introduce hardened xsprintf/xsnprintf macros. + Let's try to future/fool-proof code a bit by introducing variants + of sprintf/snprintf that die if an overflow (or an error) occurs. + They are deemed to be the default choice for printing to some local + string buffer where no sensible error handling is implemented. + + * xstring.h: New file. + * Makefile.am (strace_SOURCES): Add it. + +2018-01-05 Eugene Syromyatnikov + + count.c: use %9.u conversion specification. + Instead of printing to a temporary string. This also fixes a subtle bug + when the output for a billion errors and more is cut and shown + incorrectly. + + * count.c (struct call_counts): Change type of calls and errors fields + to unsigned int since they are used and printed as unsigned anyway. + (call_summary_pers): Remove error_str. Print cc->errors + and error_cum using %9.u conversion specification. + +2018-01-05 Eugene Syromyatnikov + + count.c: use personality_names in call_summary report caption. + Otherwise the title is quite misleading for x32 personality. + + * count.c (call_summary): Use personality_names. + +2018-01-05 Victor Krapivensky + + Move personality names to a global variable. + This is a part of "Prepare for adding support for Lua scripting" + commit. + + * defs.h (personality_names): New external constant declaration. + * syscall.c: (personality_names): New global variable. + (update_personality): Use personality_names for reporting personality + name. + + Co-Authored-by: Eugene Syromyatnikov + +2018-01-04 Lubomir Rintel + + strace.spec.in: include Bluetooth headers for AF_BLUETOOTH sockets decoding + * strace.spec.in (BuildRequires): Add pkgconfig(bluez). + +2018-01-04 Dmitry V. Levin + + Lift artificial limit on output file names in -ff mode. + Starting with commit v4.5.19~88 strace imposed an artificial limit + on output file names in -ff mode, leading to the following absurd + behaviour: + + $ strace -ff -o"$(perl -e 'print "/" x 510')/$PWD/log" /bin/true + strace: Can't fopen '////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////.12345': Permission denied + + * strace.c (newoutf): Raise buffer size to PATH_MAX. + (init) = 2>: Check output file name prefix length. + * tests/options-syntax.test: Check it. + +2018-01-04 Dmitry V. Levin + + configure.ac: fix typo. + * configure.ac: Replace CPPFALGS with CPPFLAGS. + + Fixes: v4.20-85-gf9c8e8a ("unwind: demangle symbol names") + +2018-01-03 Eugene Syromiatnikov + + Change the first argument of upeek from pid to tcp. + All users were changed automatically by: + + for i in `git grep -l 'upeek(tcp->pid'`; do \ + sed -i 's/upeek(tcp->pid/upeek(tcp/g' "$i"; \ + done + + * upeek.c (upeek): Change the first argument from pid_t pid to struct + tcb *tcp. Use tcp->pid instead of pid in the function's body. + * defs.h (upeek): Update declaration. + * linux/alpha/arch_getrval2.c: Pass tcp instead of tcp->pid to the + upeek calls. + * linux/alpha/arch_rt_sigframe.c: Likewise. + * linux/alpha/arch_sigreturn.c: Likewise. + * linux/alpha/get_scno.c: Likewise. + * linux/alpha/get_syscall_args.c: Likewise. + * linux/alpha/get_syscall_result.c: Likewise. + * linux/bfin/arch_rt_sigframe.c: Likewise. + * linux/bfin/get_scno.c: Likewise. + * linux/bfin/get_syscall_args.c: Likewise. + * linux/bfin/get_syscall_result.c: Likewise. + * linux/crisv10/arch_rt_sigframe.c: Likewise. + * linux/crisv10/get_scno.c: Likewise. + * linux/crisv10/get_syscall_args.c: Likewise. + * linux/crisv10/get_syscall_result.c: Likewise. + * linux/hppa/arch_rt_sigframe.c: Likewise. + * linux/hppa/get_scno.c: Likewise. + * linux/hppa/get_syscall_args.c: Likewise. + * linux/hppa/get_syscall_result.c: Likewise. + * linux/microblaze/arch_rt_sigframe.c: Likewise. + * linux/microblaze/arch_sigreturn.c: Likewise. + * linux/microblaze/get_scno.c: Likewise. + * linux/microblaze/get_syscall_args.c: Likewise. + * linux/microblaze/get_syscall_result.c: Likewise. + * linux/powerpc/getregs_old.c: Likewise. + * linux/sh/arch_getrval2.c: Likewise. + * linux/sh/arch_rt_sigframe.c: Likewise. + * linux/sh/get_scno.c: Likewise. + * linux/sh/get_syscall_args.c: Likewise. + * linux/sh/get_syscall_result.c: Likewise. + * linux/sh64/get_scno.c: Likewise. + * linux/sh64/get_syscall_args.c: Likewise. + * linux/sh64/get_syscall_result.c: Likewise. + * linux/xtensa/arch_rt_sigframe.c: Likewise. + * linux/xtensa/get_scno.c: Likewise. + * linux/xtensa/get_syscall_args.c: Likewise. + * linux/xtensa/get_syscall_result.c: Likewise. + * syscall.c: Likewise. + +2018-01-03 Eugene Syromiatnikov + + Change argument of getregs_old from pid to tcp. + * linux/powerpc/getregs_old.c (getregs_old): Change the first argument + from pid_t pid to struct tcb *tcp. Replace all instances of pid with + tcp->pid. + * linux/x86_64/getregs_old.c (getregs_old): Likewise. + * linux/x86_64/getregs_old.h (getregs_old): Update declaration. + * syscall.c (get_regs) [HAVE_GETREGS_OLD]: Pass tcp to the getregs_old + call instead of tcp->pid. + +2018-01-03 Eugene Syromiatnikov + + Change the first argument of upoke from pid to tcp. + Users were updated automatically by: + + for i in `git grep -l 'upoke(tcp->pid'`; do \ + sed -i 's/upoke(tcp->pid/upoke(tcp/g' "$i"; \ + done + + * upoke.c (upoke): Change the first argument from pid_t pid to struct + tcb *tcp. Use tcp->pid instead of pid in the function's body. + * defs.h (upoke): Update declaration. + * linux/alpha/set_error.c (arch_set_error, arch_set_success): Provide + tcp in the first argument of the upoke call instead of tcp->pid. + * linux/alpha/set_scno.c (arch_set_scno): Likewise. + * linux/bfin/set_error.c (arch_set_error, arch_set_success): Likewise. + * linux/bfin/set_scno.c (arch_set_scno): Likewise. + * linux/crisv10/set_error.c (arch_set_error, arch_set_success): + Likewise. + * linux/crisv10/set_scno.c (arch_set_scno): Likewise. + * linux/hppa/set_error.c (arch_set_error, arch_set_success): Likewise. + * linux/hppa/set_scno.c (arch_set_scno): Likewise. + * linux/i386/set_error.c (arch_set_error, arch_set_success): Likewise. + * linux/i386/set_scno.c (arch_set_scno): Likewise. + * linux/microblaze/set_error.c (arch_set_error, arch_set_success): + Likewise. + * linux/microblaze/set_scno.c (arch_set_scno): Likewise. + * linux/powerpc/set_error.c (arch_set_error, arch_set_success): + Likewise. + * linux/powerpc/set_scno.c (arch_set_scno): Likewise. + * linux/sh/set_error.c (arch_set_error, arch_set_success): Likewise. + * linux/sh/set_scno.c (arch_set_scno): Likewise. + * linux/sh64/set_error.c (arch_set_error, arch_set_success): Likewise. + * linux/sh64/set_scno.c (arch_set_scno): Likewise. + * linux/x86_64/set_error.c (arch_set_error, arch_set_success): Likewise. + * linux/x86_64/set_scno.c (arch_set_scno): Likewise. + * linux/xtensa/set_error.c (arch_set_error, arch_set_success): Likewise. + * linux/xtensa/set_scno.c (arch_set_scno): Likewise. + +2018-01-03 Eugene Syromiatnikov + + Move enum trace_event into a separate header. + As it will have users outside strace.c in the future. + + * trace_event.h (enum trace_event): Move it from... + * strace.c (enum trace_event): ...here. + (#include "trace_event.h"): New header, for enum trace_event. + * Makefile.am (strace_SOURCES): Add trace_event.h. + +2018-01-03 Eugene Syromyatnikov + + Call get_scno during startup_tcb only for forcibly attached processes. + Otherwise it makes little sense on most arches to try to get syscall + number. + + * defs.h (TCB_GRABBED): New tcb flag. + * strace.c (attach_tcb): Set TCB_GRABBED for the tcb. + (startup_tcb): Call get_scno() only if process is grabbed and its + registers may contain syscall number information. + + Reported-by: Dmitry V. Levin + Closes: https://github.com/strace/strace/issues/22 + +2018-01-01 Eugene Syromyatnikov + + strace.c: sort getopt switch branches alphabetically. + There's no reason to have them out of order. This also (almost) matches + their order in the getopt call argument, introduced in + v4.20-64-g61c03be. + + * strace.c (init): Sort branches in the getopt switch routine. + +2018-01-01 Eugene Syromyatnikov + + strace.c: check for (non)zero argc instead of argv[0] + Since we can never be sure that we have NULL behind the last entry of + the argv array. + + * strace.c (init): Check for non-zero argc before/instead of argv[0]. + +2018-01-01 Eugene Syromyatnikov + + strace.1: advertise strace-log-merge. + In order to raise awareness about strace-log-merge, mention it in + SEE ALSO section and -ff option description. + + * strace.1.in (.SS Filtering) <.TP .B \-ff>: Mention strace-log-merge. + (.SH "SEE ALSO"): Likewise. + +2017-12-29 Dmitry V. Levin + + unwind: demangle function arguments. + * unwind.c (print_stack_frame): Specify demangling style. + * tests/strace-k.test (result): Update regexp. + * tests/strace-k-demangle.test (expected): Update expected output. + + tests: check strace -k symbol names demangling. + * tests/strace-k-demangle.test: New test. + * tests/stack-fcall-mangled.c: New file. + * tests/stack-fcall-mangled-0.c: Likewise. + * tests/stack-fcall-mangled-1.c: Likewise. + * tests/stack-fcall-mangled-2.c: Likewise. + * tests/stack-fcall-mangled-3.c: Likewise. + * tests/stack-fcall.h [MANGLE] (f0, f1, f2, f3): New macros. + * tests/.gitignore: Add stack-fcall-mangled. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (stack_fcall_mangled_SOURCES): New variable. + (EXTRA_DIST): Add strace-k-demangle.test. + [USE_LIBUNWIND && USE_DEMANGLE] (LIBUNWIND_TESTS): Likewise. + +2017-12-29 Dmitry V. Levin + + tests: parametrize strace-k.test. + Prepare for the check of strace -k symbol names demangling. + + * tests/strace-k.test: Parametrize $test_prog and $expected. + * tests/stack-fcall.h: New file. + * tests/stack-fcall.c: Include "stack-fcall.h" + * tests/stack-fcall-0.c: Likewise. + * tests/stack-fcall-1.c: Likewise. + * tests/stack-fcall-2.c: Likewise. + * tests/stack-fcall-3.c: Likewise. + * tests/Makefile.am (EXTRA_DIST): Add stack-fcall.h. + +2017-12-26 Masatake YAMATO + + unwind: demangle symbol names. + Implement demangling of C++ symbol names in stack trace + using cplus_demangle function from GNU libiberty library. + + This is an example demangled stack trace output: + + fstat(5, {st_mode=S_IFREG|0664, st_size=0, ...}) = 0 + > /usr/lib64/libc-2.25.so(__fxstat64+0x12) [0xffd62] + > /usr/lib64/libc-2.25.so(_IO_file_doallocate+0x5f) [0x717ff] + > /usr/lib64/libc-2.25.so(_IO_doallocbuf+0x79) [0x81699] + > /usr/lib64/libc-2.25.so(_IO_file_overflow+0x198) [0x807b8] + > /usr/lib64/libc-2.25.so(_IO_file_xsputn+0xbd) [0x7ed5d] + > /usr/lib64/libc-2.25.so(fwrite_unlocked+0x60) [0x7d800] + > /usr/lib64/libleveldb.so.1.18(leveldb::EnvWrapper::StartThread+0x3b6) [0x48656] + > /usr/lib64/libleveldb.so.1.18(leveldb::log::Writer::EmitPhysicalRecord+0x89) [0x28bc9] + > /usr/lib64/libleveldb.so.1.18(leveldb::log::Writer::AddRecord+0x9e) [0x28d9e] + > /usr/lib64/libleveldb.so.1.18(leveldb::DBImpl::Write+0x208) [0x1ce18] + > /usr/lib64/libleveldb.so.1.18(leveldb::DB::Put+0x59) [0x192b9] + > /usr/lib64/libleveldb.so.1.18(leveldb::DBImpl::Put+0x1d) [0x1931d] + > /home/yamato/var/leveldb/doc/a.out(main+0x120) [0x1107] + > /usr/lib64/libc-2.25.so(__libc_start_main+0xea) [0x2088a] + > /home/yamato/var/leveldb/doc/a.out(_start+0x2a) [0xf3a] + + * Makefile.am [USE_DEMANGLE] (strace_CPPFLAGS, strace_LDFLAGS, + libiberty_LDADD): Append libiberty_CPPFLAGS, strace_LDFLAGS, and + libiberty_LIBS, respectively. + * configure.ac: Add --with-libiberty option. Check cplus_demangle + support in libiberty. + * unwind.c [USE_DEMANGLE]: Include . + (print_stack_frame) [USE_DEMANGLE]: Use cplus_demangle. + +2017-12-26 Masatake YAMATO + + Define macros for renaming xmalloc and xcalloc. + I'm planning to link strace with libiberty for mangling C++ + symbol names in stack trace enabled with -k option. + + Both names, xmalloc and xcalloc, are already defined and used + in libiberty, and they conflict with functions in strace. + Rename xmalloc and xcalloc functions defined in strace + to strace_xmalloc and strace_xcalloc, respectively, + to avoid this conflict. + + * xmalloc.h (xcalloc, xmalloc): New macros. + +2017-12-24 Dmitry V. Levin + + syscall: move a sparc specific include to an arch specific file. + * syscall.c [SPARC64]: Do not include . + [SPARC]: Do not include . + * linux/sparc/get_error.c: Include . + + syscall: move all ia64 specific includes to an arch specific file. + * syscall.c [IA64]: Remove. + * linux/ia64/get_syscall_args.c: Include . + + syscall: simplify get_syscall_result. + * syscall.c [ptrace_getregset_or_getregs] (get_syscall_result_regs): + Define to get_regs. + (get_syscall_result): Use get_syscall_result_regs unconditionally. + +2017-12-24 Dmitry V. Levin + + syscall: change get_regs argument type. + This opens the way for future changes related to get_regs. + + * syscall.c (get_regs): Change argument type from "pid_t" + to "struct tcb *", all callers changed. + +2017-12-24 Dmitry V. Levin + + syscall: move get_regs call from syscall_exiting_decode to get_syscall_result + This make the code less confusing and opens the way for future changes + related to get_regs. + + * syscall.c (syscall_exiting_decode): Move get_regs invocation ... + (get_syscall_result) [ptrace_getregset_or_getregs]: ... here. + +2017-12-24 Dmitry V. Levin + + syscall: rework subcall decoding on mips o32. + Move syscall subcall handling to the same switch statement that + handles ipc and socket subcalls. + + * linux/mips/syscallent-o32.h [LINUX_MIPSO32] (SYS_syscall_subcall): + Define. + * syscall.c (decode_mips_subcall): Rename to decode_syscall_subcall, + conditionalize on SYS_syscall_subcall instead of LINUX_MIPSO32. + (syscall_entering_decode) [LINUX_MIPSO32]: Remove. + (syscall_entering_decode) [SYS_syscall_subcall]: Handle SEN_syscall + using decode_syscall_subcall. + +2017-12-24 Dmitry V. Levin + + syscall: tweak shuffle_scno ifdefery. + * syscall.c (shuffle_scno): Check for ARM_FIRST_SHUFFLED_SYSCALL + instead of ARM || AARCH64. This does not result to any code change + but looks more comprehensible. + + syscall: change get_regs to return an error code. + * syscall.c (get_regs_error) [!ptrace_getregset_or_getregs]: Do not + define. + (clear_regs) [!ptrace_getregset_or_getregs]: Do not set get_regs_error. + (get_regs) [ptrace_getregset_or_getregs]: Return get_regs_error, all + callers changed to test get_regs return code instead of get_regs_error + static variable, which is now internally used by get_regs() and + clear_regs() only. + (USE_GET_SYSCALL_RESULT_REGS): Do not define. + Use "#ifndef ptrace_getregset_or_getregs" + instead of "#ifdef USE_GET_SYSCALL_RESULT_REGS". + +2017-12-24 Harsha Sharma + + tests: enhance run.sh usage error diagnostics. + * tests/run.sh: Execute timeout command only when invoked with + an argument, otherwise print an error message. + +2017-12-23 Dmitry V. Levin + + tests: skip nsyscalls-d.test on mips o32. + On mips o32, nsyscalls test is implemented using syscall #4000, + so nsyscalls-d cannot work there. + + * tests/nsyscalls-d.test: Skip on mips o32. + +2017-12-23 Dmitry V. Levin + + Remove linux/ptp_clock.h. + As linux kernel provides a compatible linux/ptp_clock.h header since + commit v3.8-rc1~139^2~514, there is no need for a local copy. + + * linux/ptp_clock.h: Remove. + * Makefile.am (EXTRA_DIST): Remove it. + * configure.ac (AC_CHECK_TYPES): Check for struct ptp_sys_offset + in . + * ioctl.c (ioctl_decode) : Conditionalize + on HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024. + * ubi.c: Likewise. + +2017-12-23 Dmitry V. Levin + + Remove linux/mtd-abi.h. + As linux kernel provides a compatible mtd/mtd-abi.h header since + commit v3.2-rc1~14^2~33, there is no need for a local copy. + + * linux/mtd-abi.h: Remove. + * Makefile.am (EXTRA_DIST): Remove it. + * configure.ac (AC_CHECK_TYPES): Check for struct mtd_write_req + in . + * ioctl.c (ioctl_decode) : Conditionalize + on [HAVE_STRUCT_MTD_WRITE_REQ]. + * mtd.c: Likewise. + * tests/ioctl_mtd.c: Likewise. + * tests/ioctl.c (main): Likewise. + +2017-12-23 Dmitry V. Levin + + Remove linux/personality.h. + * linux/personality.h: Remove. + * Makefile.am (EXTRA_DIST): Remove it. + * personality.c: Do not include , include + "xlat/personality_flags.h" before "xlat/personality_types.h". + * xlat/personality_flags.in: Provide fallback definitions. + * xlat/personality_types.in: Likewise. + +2017-12-23 Dmitry V. Levin + + travis: switch from clang-3.8 to clang. + As travis provides a relatively fresh clang by default nowadays, + it makes sense to use default clang in clang-based test builds. + + * .travis.yml (matrix): Change clang-3.8 to clang. + +2017-12-21 Eugene Syromyatnikov + + strace.1.in: mention perf and ftrace in SEE ALSO. + * strace.1.in (.SH SEE ALSO): Add references to perf-trace(1) and + trace-cmd(1). + + strace.1.in: clarify -F option behaviour. + * strace.1.in <.TP \-F>: Extend deprecation warning. Describe behaviour + of multiple instances of -F and interoperability of -F and -f. + +2017-12-20 Dmitry V. Levin + + tests: consistently use $STRACE_EXE instead of local alternatives. + * tests/get_regs.test: Replace "${STRACE##* }" with "$STRACE_EXE". + * tests/options-syntax.test: Replace "$strace_exp" with "$STRACE_EXE". + * tests/syntax.sh: Likewise. + +2017-12-20 Eugene Syromyatnikov + Dmitry V. Levin + + strace.c: inform the user about -F option obsolescence. + * strace.c (init): Print an error message if the option is used. + +2017-12-20 Eugene Syromyatnikov + + strace.c: sort option arguments alphabetically. + Except for the ones that enabled by configure options. + + While we are here, let's also change the indentation of while expression + continuation in order to separate it from the following switch clause. + + * strace.c (init): Reorder options in getopt() call. + +2017-12-20 Eugene Syromiatnikov + + strace.c: use _exit() instead of exit() in child's die() + Let's keep child's death routine as minimalistic as possible for the + cases when vfork() is used instead of fork() on systems that lack MMU. + + * strace.c (die) : Call _exit(). + +2017-12-20 Harsha Sharma + + syscall: replace if (debug_flag) ... with debug_msg macro. + * syscall.c (get_scno): Use debug_msg instead of + "if (debug_flag) error_msg". + +2017-12-20 Eugene Syromyatnikov + + tests: check (some) debugging output generated during nsyscalls test. + * tests/nsyscalls-d.c: New file. + * tests/.gitignore: Add it. + * tests/nsyscalls-d.test: New test, variant of nsyscalls.test with debug + output check. + * tests/nsyscalls-nd.test: Likewise. + * tests/nsyscalls.c: Add expected debug output. + * tests/Makefile.am (check_PROGRAMS): Add nsyscalls-d. + (DECODER_TESTS): Add nsyscalls-d.test and nsyscalls-nd.test. + +2017-12-20 Eugene Syromiatnikov + + pathtrace.c: use xgrowarray. + * defs.h : Change type of num_selected field to size_t. + Add size field. + * pathtrace.c (storepath): Rewrite to utilise xgrowarray. + +2017-12-14 Dmitry V. Levin + + dyxlat: use xgrowarray. + * dyxlat.c (dyxlat_alloc): Use xgrowarray instead of xcalloc. + (dyxlat_add_pair): Use xgrowarray instead of xreallocarray. + + unwind: use xgrowarray. + * unwind.c (get_symbol_name): Use xgrowarray instead of manual + dynamic array management using xreallocarray. + +2017-12-14 Eugene Syromiatnikov + + strace.c: use xgrowarray. + * strace.c (tcbtabsize): Change type to size_t. + (expand_tcbtab): Rewrite in order to utilise xgrowarray + instead of manual dynamic array management. + + unwind: use xgrowarray. + * unwind.c (build_mmap_cache): Use xgrowarray instead of manual dynamic + array management. + +2017-12-14 Eugene Syromiatnikov + + xmalloc.c: introduce xgrowarray helper function. + In order to simplify dynamic array management code. + + * xmalloc.h (xgrowarray): New declaration. + * xmalloc.c (xgrowarray): New function. + +2017-12-14 Dmitry V. Levin + + tests: check error diagnostics when exec file name is too long. + * tests/options-syntax.test: Check error diagnostics when + exec file name length equals to PATH_MAX. + +2017-12-13 Eugene Syromiatnikov + + strace.c: minor style fixes. + * strace.c (test_ptrace_seize): Remove excess braces. + (init): Wrap overly long string literal. Add braces + to the else if branch. + +2017-12-13 Eugene Syromiatnikov + + strace.c: use *_func_* message printing macros where appropriate. + In order to provide some additional bits of information in weird error + cases or just replace existing usages of __func__/literal function name. + + * strace.c (detach): Use perror_func_msg() instead of perror_msg(). + (startup_attach, open_dummy_desc, startup_child, test_ptrace_seize): Use + perror_func_msg_and_die() instead of perror_msg_and_die(). + (test_ptrace_seize): Use error_func_msg_and_die() instead of + error_msg_and_die(). + +2017-12-13 Eugene Syromiatnikov + + unwind.c: more verbose mapping overlapping diagnostic message. + * unwind.c (build_mmap_cache): Change error_msg() to debug_msg(), add + information about region names and the respective start and end + addresses. + +2017-12-13 Eugene Syromiatnikov + + unwind.c: non-fatal handling of asprintf error. + An error returned by asprintf is a poor excuse for dying. + + * unwind.c (asprintf_error_str): New string constant. + (sprint_call_or_error): Replace error_msg_and_die() with + perror_func_msg() and usage of asprintf_error_str for a return value. + (queue_print): Free tmp->output line only if it is not + asprintf_error_str. + +2017-12-13 Eugene Syromiatnikov + + unwind.c: eliminate DPRINTF. + Since DPRINTF is simply a macro that provides debugging information + along with some information about printing routine call site, now standard + debug_func_* macros are deemed to be a suitable replacement. + + * unwind.c (DPRINTF): Remove. + (build_mmap_cache, delete_mmap_cache, unwind_cache_invalidate, + unwind_print_stacktrace, unwind_captiure_stacktrace): Replace + DPRINTF(fmt, str, ...) with debug_func_msg(fmt, ...)/ + +2017-12-13 Eugene Syromiatnikov + + strace.c: replace if (debug_flag) ... with suitable debug printing macros + * strace.c (alloc_tcb, droptcb, detach, attach_tcb, test_ptrace_seize, + init, startup_tcb): Replace if (debug_flag) error_msg(...) occurrences + with debug_error_msg(...). + (attach_tcb): Replace if (debug_flag) perror_msg(...) with + debug_perror_msg(...). + (cleanup, startup_tcb): Replace if (debug_flag) error_msg(...) + occurrences with debug_func_msg() in attempt to provide additional + information. + +2017-12-13 Eugene Syromiatnikov + + error_prints.h: add *_func_* printing macros. + In order to reduce boilerplate for the cases when __func__ is desired + to be printed. + + * error_prints.h (error_func_msg, perror_func_msg, debug_func_msg, + debug_func_perror_msg, error_func_msg_and_die, perror_func_msg_and_die): + New macro definitions. + +2017-12-13 Eugene Syromiatnikov + + error_prints.h: add debug print macros. + * defs.h (debug_flag): Move the declaration... + * error_prints.h (debug_flag): ... here. + (debug_msg, debug_perror_msg): New macro definitions. + Include for the debug_flag declaration. + +2017-12-04 Masatake YAMATO + Dmitry V. Levin + + tests: check decoding of KVM ioctl commands. + * tests/ioctl_kvm_run.c: New file. + * tests/ioctl_kvm_run.test: New test. + * tests/Makefile.am (DECODER_TESTS): Add ioctl_kvm_run.test. + * tests/pure_executables.list: Add ioctl_kvm_run. + * tests/.gitignore: Likewise. + +2017-12-04 Masatake YAMATO + + kvm: decode the argument of KVM_{SET, GET}_SREGS ioctl command. + * configure.ac (AC_CHECK_TYPES): Add struct kvm_sregs. + * kvm.c [HAVE_STRUCT_KVM_SREGS] (kvm_ioctl_decode_sregs): New function. + (kvm_ioctl) [HAVE_STRUCT_KVM_SREGS] : + Use it. + * linux/arch_kvm.c (arch_print_kvm_sregs): New function. + * linux/x86_64/arch_kvm.c (PRINT_FIELD_KVM_SREGS_STRUCT): New macro. + (kvm_ioctl_decode_regs_dtable, kvm_ioctl_decode_regs_segment, + arch_print_kvm_sregs): New functions. + + kvm: decode the argument of KVM_{SET, GET}_REGS ioctl command. + * configure.ac (AC_CHECK_TYPES): Add struct kvm_regs. + * linux/arck_kvm.c: New file. + * linux/x86_64/arch_kvm.c: Likewise. + * linux/i386/arch_kvm.c: Likewise. + * linux/x32/arch_kvm.c: Likewise. + * Makefile.am (EXTRA_DIST): Add them. + * kvm.c: Include "arch_kvm.c". + [HAVE_STRUCT_KVM_REGS] (kvm_ioctl_decode_regs): New function. + (kvm_ioctl) [HAVE_STRUCT_KVM_REGS] : Use it. + + kvm: decode the argument of KVM_SET_USER_MEMORY_REGION ioctl command. + * configure.ac (AC_CHECK_TYPES): Add struct kvm_userspace_memory_region. + * xlat/kvm_mem_flags.in: New file. + * kvm.c: Include print_fields.h. + [HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION]: Include xlat/kvm_mem_flags.h, + (kvm_ioctl_set_user_memory_region): New function. + (kvm_ioctl) [HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION] + : Use it. + +2017-12-03 Eugene Syromyatnikov + + Add strace mascot. + * strace.svg: New file. + + Co-Authored-by: Vitaly Chaykovsky + +2017-12-03 Dmitry V. Levin + + tests: robustify attach-p-cmd.test against buggy kernels. + From time to time various kernels, old and new, just go nuts + and fail attach-p-cmd.test with the following diagnostics: + + 12345 --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} --- + -12345 chdir("attach-p-cmd.test -p") = -1 ENOENT (No such file or directory) + +12345 syscall_4294967295(0xffe60934, 0x1c0, 0xffe60934, 0x1, 0xffe609b4, 0xffe60a58) = -1 (errno 38) + +12345 chdir("attach-p-cmd.test -p") = -1 ENOSYS (Function not implemented) + + Let's workaround this kernel madness by rewriting the test + without use of SIGALRM. + + * tests/attach-p-cmd.h: New file. + * tests/Makefile.am (EXTRA_DIST): Add attach-p-cmd.h. + * tests/attach-p-cmd-cmd.c: Include "attach-p-cmd.h". + (write_pidfile, wait_for_peer_invocation): New functions. + (main): Use them. + * tests/attach-p-cmd-p.c: Include and "attach-p-cmd.h". + (wait_for_peer_invocation, wait_for_peer_termination): New functions. + (main): Use them. Do not raise SIGALRM, use nanosleep after peer + termination. + +2017-12-03 Dmitry V. Levin + + tests: robustify ipc_msgbuf.test against broken libc. + glibc between commits glibc-2.25~130 and glibc-2.26~740 had broken + msgctl(IPC_RMID) on hppa: this operation always failed with EINVAL + because of inappropriate use of IPC_64 flag. Similar issues were + fixed on other niche architectures. Let's workaround these issues + by skipping the test in case of msgctl(IPC_RMID) failure. + + * tests/ipc_msgbuf.c (cleanup): Change return type to int, + return 77 in case of msgctl(IPC_RMID) failure. + (main): Explicitly invoke cleanup() at the end. + +2017-12-01 Masatake YAMATO + + kvm: decode the argument of KVM_CREATE_VCPU ioctl command. + * kvm.c (kvm_ioctl_create_vcpu): New function. + (kvm_ioctl) : Use it. + + kvm: handle KVM_CREATE_VM ioctl command. + * kvm.c (kvm_ioctl): Handle KVM_CREATE_VM command. + + kvm: handle KVM_RUN, KVM_GET_VCPU_MMAP_SIZE, and KVM_GET_API_VERSION ioctl commands + * kvm.c (kvm_ioctl): Handle KVM_RUN, KVM_GET_VCPU_MMAP_SIZE, + and KVM_GET_API_VERSION commands. + + ioctl: add a stub for decoding kvm related ioctls. + * kvm.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * configure.ac (AC_CHECK_HEADERS): Add linux/kvm.h. + * defs.h (kvm_ioctl): New prototype. + * ioctl.c (ioctl_decode) HAVE_LINUX_KVM_H]: Use kvm_ioctl. + +2017-11-30 Eugene Syromyatnikov + + strace-log-merge: work around corner cases of strace -ttt parsing. + Employing strace -ttt for the logs destined to be fed to + strace-log-merge is ultimately the best solution except for the logs + that pass the following dates: + + Thu Jan 1 00:00:09 UTC 1970 + Thu Jan 1 00:01:39 UTC 1970 + Thu Jan 1 00:16:39 UTC 1970 + Thu Jan 1 02:46:39 UTC 1970 + Fri Jan 2 03:46:39 UTC 1970 + Mon Jan 12 13:46:39 UTC 1970 + Sun Apr 26 17:46:39 UTC 1970 + Sat Mar 3 09:46:39 UTC 1973 + Sun Sep 9 01:46:39 UTC 2001 + Sat Nov 20 17:46:39 UTC 2286 + Wed Nov 16 09:46:39 UTC 5138 + Fri Sep 27 01:46:39 UTC 33658 + Sun May 20 17:46:39 UTC 318857 + Sat Nov 7 09:46:39 UTC 3170843 + Sun Jul 5 01:46:39 UTC 31690708 + Sat Jan 25 17:46:39 UTC 316889355 + + Let's lift this limitation. + + * strace-log-merge: Generate numeric-only key for sorting, use sort -n + option. + +2017-11-30 Eugene Syromyatnikov + + debian: add strace-log-merge to the list of installed files. + * debian/strace.install: Add strace-log-merge. + + Add strace-log-merge man page. + * strace-log-merge.1.in: New file. + * NEWS: Mention this. + * .gitignore: Add strace-log-merge.1. + * Makefile.am (man_MANS): Likewise. + * configure.ac (AC_CONFIG_FILES): Likewise. + * debian/strace.manpages: Likewise. + + strace-log-merge: add copyright header. + +2017-11-29 Dmitry V. Levin + + Add initial GitLab CI support. + * .gitlab-ci.yml: New file. + * travis-build.sh: Print $CC -print-multi-lib. Print config.log + in case of configure failure. + * travis-install.sh: Check sudo availability. Install autoconf, + automake, file, gawk, gcc-multilib, git, gzip, make, and xz-utils + for all targets. + (musl-gcc): Install ca-certificates. + +2017-11-25 Dmitry V. Levin + + mpers: fix cross-compiling. + In cross builds, a target version of readelf has to be used + instead of a native one. + + * configure.ac (AC_CHECK_TOOL): Add readelf. + * Makefile.am (READELF): New variable. + (mpers-m%.stamp): Pass it to $(srcdir)/mpers.sh. + * m4/mpers.m4 (st_MPERS): Pass READELF environment variable + to $srcdir/mpers_test.sh. + * mpers.sh (READELF): New variable. + Use it instead of readelf. + * maint/ioctls_sym.sh: Likewise. + * NEWS: Mention this fix. + + Reported-by: Rolf Eike Beer + +2017-11-22 Dmitry V. Levin + + tests: fix llseek test. + * tests/llseek.test: Fix typo. + + INSTALL-git.md: fix typo. + + tests: simplify bpf test a bit. + * tests/bpf.c (DEF_BPF_INIT_FIRST): New macro. + (init_BPF_MAP_CREATE_first, init_BPF_MAP_LOOKUP_ELEM_first, + init_BPF_PROG_LOAD_first, init_BPF_OBJ_PIN_first, + init_BPF_PROG_ATTACH_first, init_BPF_PROG_TEST_RUN_first, + init_BPF_PROG_GET_NEXT_ID_first, init_BPF_OBJ_GET_INFO_BY_FD_first): + Use it. + +2017-11-21 Dmitry V. Levin + + Implement decoding of BPF_OBJ_GET_INFO_BY_FD command of bpf syscall. + * configure.ac (AC_CHECK_MEMBERS): Add union bpf_attr.info.info. + * bpf.c (decode_BPF_OBJ_GET_INFO_BY_FD): New function. + (SYS_FUNC(bpf)) : Use it. + * NEWS: Mention this. + * tests/bpf.c: Add macro guard for BPF_OBJ_GET_INFO_BY_FD decoder test. + [HAVE_UNION_BPF_ATTR_INFO_INFO] (sample_BPF_OBJ_GET_INFO_BY_FD_attr): + New variable. + [HAVE_UNION_BPF_ATTR_INFO_INFO] (init_BPF_OBJ_GET_INFO_BY_FD_first, + print_BPF_OBJ_GET_INFO_BY_FD_first, init_BPF_OBJ_GET_INFO_BY_FD_attr, + print_BPF_OBJ_GET_INFO_BY_FD_attr): New functions. + (main) [HAVE_UNION_BPF_ATTR_INFO_INFO]: Use them. + + Simplify union bpf_attr field checks. + * configure.ac: Use AC_CHECK_MEMBERS instead of st_CHECK_UNION_BPF_ATTR + for union bpf_attr field checks as the former seems to be enough + for the case. + * m4/st_bpf.m4: Remove. + + Implement decoding of BPF_*_GET_*_ID commands of bpf syscall. + * configure.ac: Check for union bpf_attr.next_id. + * bpf.c (decode_BPF_PROG_GET_NEXT_ID, decode_BPF_PROG_GET_FD_BY_ID, + * decode_BPF_MAP_GET_FD_BY_ID): New functions. + (decode_BPF_MAP_GET_NEXT_ID): New macro. + (SYS_FUNC(bpf)) : Use them. + * NEWS: Mention this. + * tests/bpf.c: Add macro guard for BPF_*_GET_*_ID decoder tests. + [HAVE_UNION_BPF_ATTR_NEXT_ID] (init_BPF_PROG_GET_NEXT_ID_first, + print_BPF_PROG_GET_NEXT_ID_first, init_BPF_PROG_GET_NEXT_ID_attr, + print_BPF_PROG_GET_NEXT_ID_attr, print_BPF_PROG_GET_FD_BY_ID_first, + print_BPF_PROG_GET_FD_BY_ID_attr, print_BPF_MAP_GET_NEXT_ID_first, + print_BPF_MAP_GET_NEXT_ID_attr): New functions. + (init_BPF_MAP_GET_NEXT_ID_first, print_BPF_MAP_GET_NEXT_ID_first, + init_BPF_MAP_GET_NEXT_ID_attr, print_BPF_MAP_GET_NEXT_ID_attr, + init_BPF_PROG_GET_FD_BY_ID_first, init_BPF_PROG_GET_FD_BY_ID_attr, + init_BPF_MAP_GET_FD_BY_ID_first, init_BPF_MAP_GET_FD_BY_ID_attr): + New macros. + (main) [HAVE_UNION_BPF_ATTR_NEXT_ID]: Use them. + +2017-11-20 Dmitry V. Levin + + Implement decoding of BPF_PROG_TEST_RUN command of bpf syscall. + * configure.ac: Check for union bpf_attr.test.duration. + * bpf.c (decode_BPF_PROG_TEST_RUN): New function. + (SYS_FUNC(bpf)) : Use it. + * NEWS: Mention this. + * tests/bpf.c: Include "print_fields.h". + Add macro guard for BPF_PROG_TEST_RUN decoder test. + [HAVE_UNION_BPF_ATTR_TEST_DURATION] (sample_BPF_PROG_TEST_RUN_attr): + New variable. + [HAVE_UNION_BPF_ATTR_TEST_DURATION] (init_BPF_PROG_TEST_RUN_first, + print_BPF_PROG_TEST_RUN_first, init_BPF_PROG_TEST_RUN_attr, + print_BPF_PROG_TEST_RUN_attr): New functions. + (main) [HAVE_UNION_BPF_ATTR_TEST_DURATION]: Use them. + +2017-11-20 Dmitry V. Levin + + bpf: update BPF_MAP_CREATE decoding. + Implement decoding of union bpf_attr.numa_node field for BPF_MAP_CREATE + command introduced by linux kernel commit v4.14-rc1~130^2~196^2~1. + + * configure.ac: Check for numa_node member of union bpf_attr + instead of inner_map_fd. + (decode_BPF_MAP_CREATE): Add numa_node field to the structure, print it. + * NEWS: Mention this. + * tests/bpf.c: Update macro guards of BPF_MAP_CREATE decoder test. + (init_BPF_MAP_CREATE_first, print_BPF_MAP_CREATE_attr): Update expected + output. + (init_BPF_MAP_CREATE_attr): Initialize numa_node field, update offset. + +2017-11-20 Eugene Syromiatnikov + + unwind.c: cleanup. + * unwind.c (rebuild_cache_if_invalid): Simplify return statement. + + unwind.c: fix typo in comment. + * unwind.c (unwind_cache_invalidate, unwind_print_stacktrace, + unwind_capture_stacktrace): Replace strack with stack. + +2017-11-18 Dmitry V. Levin + + ipc_shm: decode hugetlb page size in shmget flags. + Decode alternative hugetlb page sizes introduced by kernel commit + v3.8-rc1~175^2~36. + + * ipc_shm.c [!SHM_HUGE_SHIFT] (SHM_HUGE_SHIFT): New macro. + [!SHM_HUGE_MASK] (SHM_HUGE_MASK): Likewise. + (SYS_FUNC(shmget)): Print hugetlb page size. + * tests/ipc_shm.c: Check it. + +2017-11-18 Dmitry V. Levin + + memfd_create: decode hugetlb page size. + Decode alternative hugetlb page sizes introduced by kernel commit + v4.14-rc1~126^2~17. + + * configure.ac (AC_CHECK_HEADERS): Add linux/memfd.h. + * memfd_create.c [HAVE_LINUX_MEMFD_H]: Include it. + [!MFD_HUGE_SHIFT] (MFD_HUGE_SHIFT): New macro. + [!MFD_HUGE_MASK] (MFD_HUGE_MASK): Likewise. + (SYS_FUNC(memfd_create)): Print hugetlb page size. + * tests/memfd_create.c: Check it. + +2017-11-18 Dmitry V. Levin + + Print the first argument of memfd_create syscall as a path. + The limit imposed by the kernel on the length of memfd_create first + argument is NAME_MAX - strlen("memfd:"). + + * memfd_create.c (SYS_FUNC(memfd_create)): Print the first argument + using printpathn. + * tests/memfd_create.c: Check it. + +2017-11-17 Dmitry V. Levin + + mem: decode hugetlb page size in mmap flags. + Decode alternative hugetlb page sizes introduced by kernel commit + v3.8-rc1~175^2~36. + + * mem.c [!MAP_HUGE_SHIFT] (MAP_HUGE_SHIFT): New macro. + [!MAP_HUGE_MASK] (MAP_HUGE_MASK): Likewise. + (print_mmap_flags): Print hugetlb page size. + * NEWS: Mention it. + * tests/remap_file_pages.c: Check it. + +2017-11-17 Dmitry V. Levin + + mem: assume that MAP_TYPE is defined. + Since linux kernel provided a definition of MAP_TYPE in + as long ago as in v2.4.0, it's safe to assume that MAP_TYPE is defined. + + * mem.c (print_mmap_flags) [!MAP_TYPE]: Remove. + +2017-11-17 Dmitry V. Levin + + mem: move printing of mmap_flags to a separate function. + * mem.c (print_mmap_flags): New function. + (print_mmap, SYS_FUNC(remap_file_pages)): Use it. + +2017-11-17 Dmitry V. Levin + + Provide fallback definitions for SHM_EXEC constant. + Although SHM_EXEC is available in since kernel commit + v2.6.9-rc2~23^2~93^2~78, the glibc version of did not + provide SHM_EXEC until commit glibc-2.10~238. + + * xlat/shm_flags.in (SHM_EXEC): Add fallback definition. + * tests/shmxt.c (SHM_EXEC): Likewise. + +2017-11-17 Dmitry V. Levin + + Update SHM_* constants. + * xlat/shm_flags.in: Add SHM_EXEC introduced by kernel commit + v2.6.9-rc2~23^2~93^2~78. + * xlat/shm_resource_flags.in: Add SHM_NORESERVE introduced by kernel + commit v2.6.15-rc1~622. + * NEWS: Mention this. + * tests/ipc_shm.c (main): Update expected output. + * tests/shmxt.c (main): Update expected output, check SHM_EXEC decoding. + +2017-11-17 Dmitry V. Levin + + Remove fallback definitions for SHM_STAT and SHM_INFO constants. + These constants are universally available for quite a long time + and are used unconditionally in tests without any complaints. + + * xlat/shmctl_flags.in: Remove fallback definitions. + +2017-11-16 Dmitry V. Levin + + net: fix SOL_NETLINK NETLINK_LIST_MEMBERSHIPS decoding. + NETLINK_LIST_MEMBERSHIPS, unlike all other SOL_NETLINK options, requests + not just a single integer but an array of integers. The kernel also + supports a zero optlen NETLINK_LIST_MEMBERSHIPS request. + + * net.c (print_uint32): New function. + (print_getsockopt): Add ulen argument, rename len argument to rlen, + Handle NETLINK_LIST_MEMBERSHIPS using print_array + and print_uint32. + (SYS_FUNC(getsockopt)): Pass ulen to print_getsockopt. + * tests/sockopt-sol_netlink.c (main): Check NETLINK_LIST_MEMBERSHIPS + decoding. + +2017-11-16 Dmitry V. Levin + + tests: check [gs]etsockopt SOL_NETLINK decoding. + * tests/sockopt-sol_netlink.c: New file. + * tests/gen_tests.in (sockopt-sol_netlink): New entry. + * tests/pure_executables.list: Add sockopt-sol_netlink. + * tests/.gitignore: Likewise. + +2017-11-16 Dmitry V. Levin + + net: fix decoding of optval argument of [gs]etsockopt SOL_NETLINK. + Tweak the parser to follow the kernel behaviour. + + * net.c (print_getsockopt, print_setsockopt) : Fetch and + print returned value as integer iff the length is >= sizeof(int), + otherwise print the address. + * NEWS: Mention this. + +2017-11-15 Dmitry V. Levin + + net: decode optname argument of [gs]etsockopt for SOL_NETLINK level. + * xlat/socknetlinkoptions.in: New file. + * net.c: Include "xlat/socknetlinkoptions.h". + (print_sockopt_fd_level_name) : Print name using + socknetlinkoptions. + * NEWS: Metnion this. + + Update MSG_* constants. + * xlat/msg_flags.in: Add MSG_ZEROCOPY introduced by kernel commit + v4.14-rc1~130^2~376^2~6. + * NEWS: Mention this. + + netlink: print descriptor attributes using printfd. + * nlattr.h (DECL_NLA(fd)): New prototype. + * nlattr.c (decode_nla_fd): New function. + * rtnl_link.c (ifla_xdp_nla_decoders) : Use it. + (ifinfomsg_nla_decoders) : Likewise. + * rtnl_nsid.c (rtgenmsg_nla_decoders) : Likewise. + * NEWS: Mention this. + +2017-11-14 Eugene Syromyatnikov + + maint/update_copyright_years.sh: implement concurrent execution. + Analogous to the way it is done in xlat/gen.sh. + + * maint/update_copyright_years.sh (MAX_JOBS): New variable, initialize + it to double the CPU count. + : Add -j option parsing. + (jobs, pids): New variables. + : + Execute process_file in background, count background jobs and wait + if there are too many. + +2017-11-14 Eugene Syromyatnikov + + maint/update_copyright_years.sh: use -efu shell mode. + * maint/update_copyright_years.sh: Add -efu to shebang. Adjust + the script for -efu shell mode. + +2017-11-14 Dmitry V. Levin + + Post-release administrivia. + * NEWS: Add a header line for the next release. + * debian/changelog.in: Add a changelog entry for 4.20-1. + * strace.spec.in: Likewise. + +2017-11-13 Dmitry V. Levin + + Prepare for 4.20 release. + * NEWS: Update for 4.20 release. + + CREDITS.in: remove entries listed by maint/gen-contributors-list.sh. + +2017-11-13 Eugene Syromyatnikov + + Makefile.am: use gen-contributors-list.sh for CREDITS. + * Makefile.am ($(srcdir)/CREDITS): Employ maint/gen-contributors-list.sh + for the contributor list generation. + +2017-11-13 Eugene Syromyatnikov + + maint: make gen-contributors-list.sh suitable for generation of CREDITS. + Implement various features in order to make it suitable for the + generation of the CREDITS file: + - add an option for including contributor e-mail; + - add an option to read additional list of contributors from stdin; + - add shorthand for referring to the initial commit of the branch; + - document all of the above in a help message. + + * maint/gen-contributors-list.sh (print_help): New function. + (script): Rename to SCRIPT. + (SCRIPT_NORM_EMAILS, MATCH_OUT, OUT_EMAILS, OUT_NO_EMAILS, read_stdin, + include_email): New variables. + Add parsing of options, rewrite input processing. + +2017-11-13 Dmitry V. Levin + + .mailmap: add more entries to avoid duplication in CREDITS. + + .mailmap: sort entries. + +2017-11-13 Eugene Syromyatnikov + + .mailmap: more deduplication. + Of course there are no two persons in the whole world that share + the same name. + +2017-11-13 Dmitry V. Levin + + CREDITS.in: use UTF-8 consistently. + In particular, do not use " symbols in names. + +2017-11-13 Eugene Syromyatnikov + + CREDITS.in: add Jiri Slaby as a contributor. + Unfortunately, he wasn't mentioned in the message of the commit + v4.19-68-g48cb633, so let's fix that omission. + + References: https://github.com/strace/strace/pull/16 + +2017-11-13 Gleb Fotengauer-Malinovskiy + + s390, s390x: update ioctl entries from linux 4.14. + * linux/s390/ioctls_arch0.h: Update from linux v4.14 using ioctls_gen.sh. + * linux/s390x/ioctls_arch0.h: Likewise. + + s390x: remove some of non-s390 KVM ioctls. + * linux/s390x/ioctls_arch0.h: Regenerate. + + maint: remove KVM_PPC_CONFIGURE_V3_MMU ioctl from non-powerpc arches. + * maint/ioctls_sym.sh (ppc_list): Update. + +2017-11-12 Dmitry V. Levin + + Update copyright headers. + Headers updated semi-automatically using + maint/update_copyright_years.sh script. + + * m4/mpers.m4: Update copyright years. + * tests/kcmp.c: Likewise. + * tests/membarrier.c: Likewise. + +2017-11-11 Dmitry V. Levin + + maint/update_copyright_years.sh: fix typo in help output. + * maint/update_copyright_years.sh (print_help): Fix typo, disable + here-document expansion. + +2017-11-10 Eugene Syromiatnikov + + Move MIN, MAX, and CLAMP to macros.h. + We shouldn't have to include the whole defs.h to get them. + + * defs.h (MIN, MAX, CLAMP): Move ... + * macros.h: ... here. + +2017-11-10 Eugene Syromiatnikov + + Update .mailmap. + * .mailmap (Eugene Syromyatnikov): Add work address. + +2017-11-07 Steve McIntyre + + debian: update debhelper compat level to 10, replace -s with -a in some calls + + debian: update Standards-Version to 3.9.8. + +2017-11-06 Dmitry V. Levin + + mpers.m4: check for size of long and kernel_long_t. + The primary purpose of this new check is diagnostics. + + * m4/mpers.m4 (st_MPERS): Check for size of long and kernel_long_t. + +2017-11-06 Eugene Syromyatnikov + + xlat/gen.sh: speedup xlat generation. + This commit implements the following changes: + - increases the number of concurrent jobs to twice the CPU count; + - creates a circular buffer, so instead of running multiple jobs + at once, the generator tries to keep about the same number of jobs + being run concurrently; + - runs gen_git and gen_make concurrently in order to squeeze in + one more bit of concurrency. + + With my deeply scientific measurements, this approach achieves + up to 15% speedup with dash and about 30-40% with bash as /bin/sh + on a 4-core machine. + + * xlat/gen.sh (main): Declare pids local variable, append pid of every + run job to it; increase the limit of jobs to ncpus * 2; when the limit + is reached, wait for the first pid in pids instead of resetting jobs + to zero and waiting for all the run jobs; put gen_git and gen_make + into background. + +2017-11-05 Dmitry V. Levin + + hppa: wire up statx syscall. + * linux/hppa/syscallent.h [349]: Add statx entry. + +2017-11-04 Dmitry V. Levin + + tests: check signal mask transparency. + Starting with commit v4.17-5-gf83b49b strace is expected + to forward the signal mask to tracees unchanged. + + * tests/check_sigblock.c: New file. + * tests/set_sigblock.c: Likewise. + * tests/sigblock.test: New test. + * tests/.gitignore: Add check_sigblock and set_sigblock. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (MISC_TESTS): Add sigblock.test. + +2017-11-03 Dmitry V. Levin + + tests: check signal disposition transparency. + Starting with commit v4.17-8-ge97a66f strace is expected + to forward the signal disposition to tracees unchanged. + + * tests/check_sigign.c: New file. + * tests/list_sigaction_signum.c: Likewise. + * tests/set_sigign.c: Likewise. + * tests/sigign.test: New test. + * tests/.gitignore: Add check_sigign, list_sigaction_signum, + and set_sigign. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (MISC_TESTS): Add sigign.test. + +2017-11-03 Eugene Syromyatnikov + + tests: update futex test to accommodate the recent kernel change. + Kernel commit v4.14-rc1~162^2~8 refactored futex implementation and + introduced checks for invalid shift sizes. Accommodate this change + by allowing EINVAL in the corresponding futex checks. + + * tests/futex.c (CHECK_FUTEX_GENERIC): Reset errno before the syscall. + (main) : Add err2 field, describe err/err2 fields. + Add EINVAL as a possible errno to the checks that contain invalid + shift values. + Update return value check so it checks that values are strictly + as expected. + + Closes: https://github.com/strace/strace/pull/16 + +2017-11-03 Eugene Syromyatnikov + + tests: cleanup futex test. + * tests/futex.c (main) : Remove unused errstr field + from the structure type definition. + +2017-11-02 Dmitry V. Levin + + seccomp: decode SECCOMP_GET_ACTION_AVAIL operation. + * defs.h (seccomp_ret_action): New xlat prototype. + * seccomp.c (decode_seccomp_set_mode_strict): Remove. + (SYS_FUNC(seccomp)): Decode SECCOMP_GET_ACTION_AVAIL operation. + * NEWS: Mention this. + * tests/seccomp_get_action_avail.c: New file. + * tests/gen_tests.in (seccomp_get_action_avail): New entry. + * tests/pure_executables.list: Add seccomp_get_action_avail. + * tests/.gitignore: Likewise. + +2017-11-01 Dmitry V. Levin + + Add SECCOMP_RET_KILL_PROCESS decoding support. + * bpf_seccomp_filter.c [!SECCOMP_RET_ACTION]: Remove. + [!SECCOMP_RET_ACTION_FULL] (SECCOMP_RET_ACTION_FULL): Define. + (print_seccomp_filter_k): Use SECCOMP_RET_ACTION_FULL + instead of SECCOMP_RET_ACTION. + * xlat/seccomp_ret_action.in: Add SECCOMP_RET_KILL_PROCESS introduced + by linux kernel commit v4.14-rc2~15^2~3. + +2017-11-01 Dmitry V. Levin + + Rename SECCOMP_RET_KILL to SECCOMP_RET_KILL_THREAD. + Follow linux kernel commit v4.14-rc2~15^2~4 and rename SECCOMP_RET_KILL + to SECCOMP_RET_KILL_THREAD. + + * xlat/seccomp_ret_action.in (SECCOMP_RET_KILL): Rename + to SECCOMP_RET_KILL_THREAD. + * tests/prctl-seccomp-filter-v.c (main): Update expected output. + * tests/seccomp-filter-v.c (main): Likewise. + +2017-11-01 Dmitry V. Levin + + Update SECCOMP_* constants. + * xlat/seccomp_filter_flags.in: Add SECCOMP_FILTER_FLAG_LOG introduced + by kernel commit v4.14-rc2~15^2~6. + * xlat/seccomp_ops.in: Add SECCOMP_GET_ACTION_AVAIL introduced + by kernel commit v4.14-rc2~15^2~9. + * xlat/seccomp_ret_action.in: Add SECCOMP_RET_LOG introduced + by kernel commit v4.14-rc2~15^2~5. + * NEWS: Mention this. + * tests/seccomp-filter.c (main): Update expected output. + * tests/seccomp-filter-v.c (main): Likewise. + + Provide fallback definitions for SECCOMP_RET_* constants. + * xlat/seccomp_ret_action.in: Add fallback definitions. + +2017-11-01 Dmitry V. Levin + + tests: robustify options-syntax.test against inquisitive musl. + Workaround musl >= 1.1.17 ability to use AT_EXECFN during + program_invocation_name initialization. + + * tests/options-syntax.test: Check for two valid variants + of "zeroargc strace" expected output. + +2017-11-01 Dmitry V. Levin + + Update MEMBARRIER_CMD_* constants. + * xlat/membarrier_cmds.in: Add MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED + introduced by kernel commit v4.14-rc6~26. + * tests/membarrier.c (main): Update expected output. + +2017-10-31 JingPiao Chen + + tests: check decoding of NFNL_SUBSYS_NFT_COMPAT netlink message flags. + * tests/nfnetlink_nft_compat.c (test_nlmsg_flags): New function. + (main): Use it. + + tests: check decoding of NFNL_SUBSYS_NFTABLES netlink message flags. + * tests/nfnetlink_nftables.c (test_nlmsg_flags): New function. + (main): Use it. + + tests: check decoding of NFNL_SUBSYS_CTHELPER netlink message flags. + * tests/nfnetlink_cthelper.c (test_nlmsg_flags): New function. + (main): Use it. + + tests: check decoding of NFNL_SUBSYS_CTNETLINK_TIMEOUT netlink message flags + * tests/nfnetlink_cttimeout.c (test_nlmsg_flags): New function. + (main): Use it. + + tests: check decoding of NFNL_SUBSYS_ACCT netlink message flags. + * tests/nfnetlink_acct.c (test_nlmsg_flags): New function. + (main): Use it. + + tests: check decoding of NFNL_SUBSYS_CTNETLINK_EXP netlink message flags + * tests/nfnetlink_ctnetlink_exp.c (test_nlmsg_flags): New function. + (main): Use it. + + tests: check decoding of NFNL_SUBSYS_CTNETLINK netlink message flags. + * tests/nfnetlink_ctnetlink.c (test_nlmsg_flags): New function. + (main): Use it. + +2017-10-26 JingPiao Chen + + netlink: decode NETLINK_NETFILTER netlink message flags. + * netlink.c (decode_nlmsg_flags_netfilter): New function. + (nlmsg_flags): Add NETLINK_NETFILTER. + * NEWS: Mention this. + + netlink: decode netlink message delete flags. + * netlink.c: Include "xlat/netlink_delete_flags.h". + (decode_nlmsg_flags_crypto, decode_nlmsg_flags_route, + decode_nlmsg_flags_xfrm): Decode delete flags. + * netlink.h (NLM_F_NONREC): New macro. + * xlat/netlink_delete_flags.in: New file. + * tests/netlink_crypto.c (test_nlmsg_flags): Check this. + * tests/netlink_route.c (test_nlmsg_flags): Likewise. + * tests/netlink_xfrm.c (test_nlmsg_flags): Likewise. + +2017-10-26 JingPiao Chen + + netlink: refactor decode_nlmsg_flags. + Refactor decode_nlmsg_flags to make it family-specific, just like + decode_nlmsg_type and decode_payload. + + * netlink.c (decode_nlmsg_flags_crypto, decode_nlmsg_flags_route, + decode_nlmsg_flags_sock_diag, decode_nlmsg_flags_xfrm): New functions. + (nlmsg_flags_decoder_t): New typedef. + (nlmsg_flags): New array. + (decode_nlmsg_flags): Use it. + +2017-10-14 JingPiao Chen + + Workaround historic linux/netfilter/xt_osf.h deficiencies. + When using linux kernel headers without commit v4.5-rc1~128^2~115^2~22 + ("netfilter: fix include files for compilation"), both + and have to be included before . + + * configure.ac (AC_CHECK_HEADERS): Include + and when checking for linux/netfilter/xt_osf.h header. + * tests/nfnetlink_osf.c: Include and + before . + +2017-09-24 JingPiao Chen + + tests: check decoding of NFNL_SUBSYS_NFT_COMPAT netlink message types. + * configure.ac (AC_CHECK_HEADERS): Add + linux/netfilter/nf_tables_compat.h. + * tests/nfnetlink_nft_compat.c: New file. + * tests/gen_tests.in (nfnetlink_nft_compat): New entry. + * tests/pure_executables.list: Add nfnetlink_nft_compat. + * tests/.gitignore: Likewise. + + tests: check decoding of NFNL_SUBSYS_NFTABLES netlink message types. + * configure.ac (AC_CHECK_HEADERS): Add linux/netfilter/nf_tables.h. + * tests/nfnetlink_nftables.c: New file. + * tests/gen_tests.in (nfnetlink_nftables): New entry. + * tests/pure_executables.list: Add nfnetlink_nftables. + * tests/.gitignore: Likewise. + + tests: check decoding of NFNL_SUBSYS_CTHELPER netlink message types. + * configure.ac (AC_CHECK_HEADERS): Add + linux/netfilter/nfnetlink_cthelper.h. + * tests/nfnetlink_cthelper.c: New file. + * tests/gen_tests.in (nfnetlink_cthelper): New entry. + * tests/pure_executables.list: Add nfnetlink_cthelper. + * tests/.gitignore: Likewise. + + tests: check decoding of NFNL_SUBSYS_CTNETLINK_TIMEOUT netlink message types + * configure.ac (AC_CHECK_HEADERS): Add + linux/netfilter/nfnetlink_cttimeout.h. + * tests/nfnetlink_cttimeout.c: New file. + * tests/gen_tests.in (nfnetlink_cttimeout): New entry. + * tests/pure_executables.list: Add nfnetlink_cttimeout. + * tests/.gitignore: Likewise. + + tests: check decoding of NFNL_SUBSYS_ACCT netlink message types. + * configure.ac (AC_CHECK_HEADERS): Add + linux/netfilter/nfnetlink_acct.h. + * tests/nfnetlink_acct.c: New file. + * tests/gen_tests.in (nfnetlink_acct): New entry. + * tests/pure_executables.list: Add nfnetlink_acct. + * tests/.gitignore: Likewise. + + tests: check decoding of NFNL_SUBSYS_IPSET netlink message types. + * configure.ac (AC_CHECK_HEADERS): Add linux/netfilter/ipset/ip_set.h. + * tests/nfnetlink_ipset.c: New file. + * tests/gen_tests.in (nfnetlink_ipset): New entry. + * tests/pure_executables.list: Add nfnetlink_ipset. + * tests/.gitignore: Likewise. + + tests: check decoding of NFNL_SUBSYS_OSF netlink message types. + * configure.ac (AC_CHECK_HEADERS): Add linux/netfilter/xt_osf.h. + * tests/nfnetlink_osf.c: New file. + * tests/gen_tests.in (nfnetlink_osf): New entry. + * tests/pure_executables.list: Add nfnetlink_osf. + * tests/.gitignore: Likewise. + + tests: check decoding of NFNL_SUBSYS_ULOG netlink message types. + * configure.ac (AC_CHECK_HEADERS): Add + linux/netfilter/nfnetlink_log.h. + * tests/nfnetlink_ulog.c: New file. + * tests/gen_tests.in (nfnetlink_ulog): New entry. + * tests/pure_executables.list: Add nfnetlink_ulog. + * tests/.gitignore: Likewise. + + tests: check decoding of NFNL_SUBSYS_QUEUE netlink message types. + * configure.ac (AC_CHECK_HEADERS): Add + linux/netfilter/nfnetlink_queue.h. + * tests/nfnetlink_queue.c: New file. + * tests/gen_tests.in (nfnetlink_queue): New entry. + * tests/pure_executables.list: Add nfnetlink_queue. + * tests/.gitignore: Likewise. + + tests: check decoding of NFNL_SUBSYS_CTNETLINK_EXP netlink message types + * tests/nfnetlink_ctnetlink_exp.c: New file. + * tests/gen_tests.in (nfnetlink_ctnetlink_exp): New entry. + * tests/pure_executables.list: Add nfnetlink_ctnetlink_exp. + * tests/.gitignore: Likewise. + + tests: check decoding of NFNL_SUBSYS_CTNETLINK netlink message types. + * configure.ac (AC_CHECK_HEADERS): Add + linux/netfilter/nfnetlink_conntrack.h. + * tests/nfnetlink_ctnetlink.c: New file. + * tests/gen_tests.in (nfnetlink_ctnetlink): New entry. + * tests/pure_executables.list: Add nfnetlink_ctnetlink. + * tests/.gitignore: Likewise. + + netlink: decode NETLINK_NETFILTER netlink message types. + * netlink.c: Include "xlat/nf_acct_msg_types.h", + "xlat/nf_cthelper_msg_types.h", "xlat/nf_ctnetlink_exp_msg_types.h", + "xlat/nf_ctnetlink_msg_types.h", "xlat/nf_cttimeout_msg_types.h", + "xlat/nf_ipset_msg_types.h", "xlat/nf_nft_compat_msg_types.h", + "xlat/nf_nftables_msg_types.h", "xlat/nf_osf_msg_types.h", + "xlat/nf_queue_msg_types.h", and "xlat/nf_ulog_msg_types.h". + (nf_nlmsg_types): New array. + (decode_nlmsg_type_netfilter): Use it. + * NEWS: Mention this. + * xlat/nf_acct_msg_types.in: New file. + * xlat/nf_cthelper_msg_types.in: Likewise. + * xlat/nf_ctnetlink_exp_msg_types.in: Likewise. + * xlat/nf_ctnetlink_msg_types.in: Likewise. + * xlat/nf_cttimeout_msg_types.in: Likewise. + * xlat/nf_ipset_msg_types.in: Likewise. + * xlat/nf_nft_compat_msg_types.in: Likewise. + * xlat/nf_nftables_msg_types.in: Likewise. + * xlat/nf_osf_msg_types.in: Likewise. + * xlat/nf_queue_msg_types.in: Likewise. + * xlat/nf_ulog_msg_types.in: Likewise. + * tests/netlink_netfilter.c (test_nlmsg_type): Update expected output. + +2017-09-20 Dmitry V. Levin + + ppc64: fix sigreturn parser for ppc personality. + * linux/powerpc/arch_sigreturn.c (arch_sigreturn) [POWERPC64]: Rewrite. + + ppc64: truncate syscall args for 32-bit personality tracees. + * linux/powerpc/get_syscall_args.c (get_syscall_args): Clear upper + 32 bits of syscall args for 32-bit personality tracees. + * NEWS: Mention this fix. + + ppc64: fix PRI__64 macro definition when compiled with -m32. + * kernel_types.h [SIZEOF_LONG != 4]: Check for __powerpc64__ instead + of POWERPC to handle -m32 case properly. + +2017-09-19 Dmitry V. Levin + + loop: decode LOOP_SET_BLOCK_SIZE. + * loop.c (loop_ioctl) : Handle LOOP_SET_BLOCK_SIZE. + * tests/ioctl_loop.c (main): Check it. + + Update ioctl entries from linux v4.14-rc1. + * linux/32/ioctls_inc_align16.h: Update from linux v4.14-rc1 + using ioctls_gen.sh. + * linux/32/ioctls_inc_align32.h: Likewise. + * linux/32/ioctls_inc_align64.h: Likewise. + * linux/64/ioctls_inc.h: Likewise. + * linux/x32/ioctls_inc0.h: Likewise. + * xlat/loop_cmds.in: Add LOOP_SET_BLOCK_SIZE introduced + by kernel commit v4.13-rc7-176-g89e4fde. + * NEWS: Mention this. + * tests/ioctl_loop.c (main): Update. + +2017-09-19 Gleb Fotengauer-Malinovskiy + + maint: generate ioctl entries without target architecture code execution + ioctls_sym.sh used to generate and invoke target architecture + executables that limited its applicability. + After this change, the generated code is just compiled to the target + architecture object files and all required information is obtained + from the dwarf sections. + This approach allows to generate ioctl entries for any target + architecture supported by compiler. + + * maint/ioctls_sym.awk: New file. + * maint/ioctls_sym.sh (LC_ALL): Define to C and export. + (uname_m): Make configurable. + (CFLAGS): Add -gdwarf-2. + (LDFLAGS): Remove. + Do not use print_ioctlent.c. + Change asm-generic/ioctl.h and asm/ioctl.h hook. + Dump and process dwarf sections of generated object files. + * maint/print_ioctlent.c: Remove. + +2017-09-18 Dmitry V. Levin + + Remove KVM_S390_* ioctls from non-s390 architectures. + * maint/ioctls_sym.sh (s390_list): New variable. + Use it to exclude KVM_S390_* ioctls on non-s390 architectures. + * linux/arm/ioctls_arch0.h: Regenerate. + * linux/i386/ioctls_arch0.h: Likewise. + * linux/powerpc/ioctls_arch0.h: Likewise. + * linux/s390/ioctls_arch0.h: Likewise. + * linux/x86_64/ioctls_arch0.h: Likewise. + +2017-09-17 Dmitry V. Levin + + Remove some of arch-specific KVM ioctls from non-matching architectures. + * maint/ioctls_sym.sh (arm_list, ppc_list, x86_list): Use bracket + expressions to generalize arch-specific regular expressions. + * linux/arm/ioctls_arch0.h: Regenerate. + * linux/i386/ioctls_arch0.h: Likewise. + * linux/powerpc/ioctls_arch0.h: Likewise. + * linux/s390/ioctls_arch0.h: Likewise. + * linux/x86_64/ioctls_arch0.h: Likewise. + +2017-09-17 Eugene Syromyatnikov + + dm: add support for DM_DEV_ARM_POLL. + Added in Linux commit v4.13-rc1~137^2~14. + + * dm.c [!DM_LIST_VERSIONS] (DM_LIST_VERSIONS): Add leading zero. + [!DM_TARGET_MSG] (DM_TARGET_MSG): Likewise. + [!DM_DEV_SET_GEOMETRY_CMD] (DM_DEV_SET_GEOMETRY_CMD): Likewise. + [!DM_DEV_ARM_POLL] (DM_DEV_ARM_POLL): New macro. + (dm_ioctl_has_params, dm_ioctl): Handle DM_DEV_ARM_POLL. + * tests/ioctl_dm.c [!DM_DEV_ARM_POLL] (DM_DEV_ARM_POLL): New macro. + (main) : Add DM_DEV_ARM_POLL. + +2017-09-17 Eugene Syromyatnikov + + kcmp: add KCMP_EPOLL_TFD support. + * configure.ac (AC_CHECK_TYPES): Add check for struct kcmp_epoll_slot. + * kcmp.c (SYS_FUNC(kcmp)) : Implement idx1/idx2 + argument parsing. + * tests/kcmp.c: Update test. + * xlat/kcmp_types.in (KCMP_EPOLL_TFD): New entry. + +2017-09-17 Eugene Syromyatnikov + + tests: add kcmp-y test. + It is not very useful as of now, but it will allow tracking changes + in fd output once they are implemented. + + * tests/gen_tests.in (kcmp-y): New test. + * tests/kcmp-y.c: New file, wrapper for kcmp.c + * tests/kcmp.c: Add opening of some files for which info may be printed + in the future. + * tests/pure_executables.list: Add kcmp-y. + * tests/.gitignore: Likewise. + +2017-09-17 Eugene Syromyatnikov + + kcmp: output fds using a separate function. + This is a preparation for the future introduction of cross-NS PID + derivation, which would enable us to print fd information for fds + related to all processes, not just traced ones. + + Note the change in output type for idx1/idx2 in KCMP_FILE command from + unsigned to int, it follows printfd output format. + + * kcmp.c (printpidfd): New function. + (PRINT_FIELD_PIDFD): New macro. + (SYS_FUNC(kcmp)) : Use printpidfd for printing + idx1/idx2, as they are fds, after all. + +2017-09-17 Eugene Syromyatnikov + + tests/kcmp: add more checks. + Let's check all kcmp commands that they indeed do not print idx1/idx2. + Also, check that upper bits of pid arguments are ignored. + + * tests/gen_tests.in (kcmp): Decrease -a argument's value from 27 to 22. + * tests/kcmp.c: Add checks for upper bits of pid1/pid2 and for all + kcmp types not tested before. + +2017-09-17 Eugene Syromyatnikov + + tests/kcmp: use if it is available. + I see it as a good idea to stick to system headers whenever possible + in order to also check for possible discrepancies between strace's + internal definitions and definitions present in the system headers. + + * configure.ac (AC_CHECK_HEADERS): Add linux/kcmp.h. + * tests/kcmp.h [HAVE_LINUX_KCMP_H]: Include , + do not define KCMP_FILE and KCMP_SYSVSEM. + +2017-09-17 JingPiao Chen + + tests: check decoding of MDBA_ROUTER_PORT netlink attribute. + * tests/nlattr_mdba_router_port.c: New file. + * tests/gen_tests.in (nlattr_mdba_router_port): New entry. + * tests/pure_executables.list: Add nlattr_mdba_router_port. + * tests/.gitignore: Likewise. + + tests: check decoding of MDBA_MDB_ENTRY_INFO netlink attributes. + * tests/nlattr_mdba_mdb_entry.c: New file. + * tests/gen_tests.in (nlattr_mdba_mdb_entry): New entry. + * tests/pure_executables.list: Add nlattr_mdba_mdb_entry. + * tests/.gitignore: Likewise. + +2017-09-17 JingPiao Chen + + tests: extend TEST_NESTED_NLATTR_OBJECT macro. + Extend TEST_NESTED_NLATTR_OBJECT macro for multi-nested netlink + attributes, such as + + [MDBA_MDB] = { + [MDBA_MDB_ENTRY] = { + [MDBA_MDB_ENTRY_INFO] { + struct br_mdb_entry + [MDBA_MDB_EATTR attributes] + } + } + } + + * tests/test_nlattr.h (TEST_NESTED_NLATTR_OBJECT_EX_, + TEST_NESTED_NLATTR_OBJECT_EX): New macros. + (TEST_NESTED_NLATTR_OBJECT): Use TEST_NESTED_NLATTR_OBJECT_EX_. + +2017-09-17 JingPiao Chen + + rtnl_mdb: decode br_port_msg netlink attributes. + * configure.ac (AC_CHECK_TYPES): Check for struct br_mdb_entry + in . + (AC_CHECK_MEMBERS): Check for flags and vid fields in struct br_mdb_entry. + * rtnl_mdb.c: Include "xlat/mdb_flags.h", "xlat/mdb_states.h", + "xlat/rtnl_mdba_mdb_attrs.h", "xlat/rtnl_mdba_mdb_eattr_attrs.h", + "xlat/rtnl_mdba_mdb_entry_attrs.h" ,"xlat/rtnl_mdba_router_attrs.h" + and "xlat/rtnl_mdba_router_pattr_attrs.h". + (decode_mdba_mdb_entry_info, decode_mdba_mdb_entry, + decode_mdba_mdb, decode_multicast_router_type, + decode_mdba_router_port, decode_mdba_router): New functions. + (mdba_mdb_eattr_nla_decoders, mdba_mdb_entry_nla_decoders, + mdba_mdb_nla_decoders, mdba_router_pattr_nla_decoders, + mdba_router_nla_decoders, br_port_msg_nla_decoders): New arrays. + (decode_br_port_msg): Use br_port_msg_nla_decoders. + * xlat/mdb_flags.in: New file. + * xlat/mdb_states.in: Likewise. + * xlat/multicast_router_types.in: Likewise. + * xlat/rtnl_mdba_mdb_attrs.in: Likewise. + * xlat/rtnl_mdba_mdb_eattr_attrs.in: Likewise. + * xlat/rtnl_mdba_mdb_entry_attrs.in: Likewise. + * xlat/rtnl_mdba_router_attrs.in: Likewise. + * xlat/rtnl_mdba_router_pattr_attrs.in: Likewise. + +2017-09-17 Dmitry V. Levin + + netlink: implement decoding of INET_DIAG_CLASS_ID attribute. + This is a new netlink attribute introduced by linux kernel commit + v4.14-rc1~130^2~207. + + * linux/inet_diag.h (INET_DIAG_CLASS_ID): New enum. + * netlink_inet_diag.c (inet_diag_msg_nla_decoders): Add + INET_DIAG_CLASS_ID. + * xlat/inet_diag_attrs.in: Add INET_DIAG_CLASS_ID. + * xlat/inet_diag_extended_flags.in: Add 1<<(INET_DIAG_CLASS_ID-1). + * tests/nlattr_inet_diag_msg.c (main): Check INET_DIAG_CLASS_ID + decoding. + +2017-09-17 Dmitry V. Levin + + Update MEMBARRIER_CMD_* constants. + * xlat/membarrier_cmds.in: Add MEMBARRIER_CMD_PRIVATE_EXPEDITED + introduced by kernel commit v4.14-rc1~174^2^2^4. + * NEWS: Mention this. + * tests/membarrier.c (main): Update expected output. + + Update UFFD_FEATURE_* constants. + * xlat/memfd_create_flags.in: Remove UFFD_FEATURE_EVENT_EXIT removed + by kernel commit v4.11-rc2~15^2~18. + Add UFFD_FEATURE_SIGBUS and UFFD_FEATURE_THREAD_ID introduced by kernel + commits v4.14-rc1~126^2~28 and v4.14-rc1~126^2~23, repsectively. + * NEWS: Mention this. + + Update MFD_* constants. + * xlat/memfd_create_flags.in: Add MFD_HUGETLB introduced + by kernel commit v4.14-rc1~126^2~17. + * NEWS: Mention this. + * tests/memfd_create.c (main): Update expected output. + + Update ETH_P_* constants. + * xlat/ethernet_protocols.in: Add ETH_P_ERSPAN, ETH_P_NSH, ETH_P_IFE, + and ETH_P_MAP introduced by kernel commits v4.14-rc1~130^2~164, + v4.14-rc1~130^2~89^2~3, v4.14-rc1~130^2~90^2~2, and + v4.14-rc1~130^2~78^2~2, respectively. + * NEWS: Mention this. + + Update ARPHRD_* constants. + * xlat/arp_hardware_types.in: Add ARPHRD_RAWIP introduced + by kernel commit v4.14-rc1~130^2~78^2~1. + * NEWS: Mention this. + + Update BPF_* constants. + * xlat/bpf_attach_type.in: Add BPF_SK_SKB_STREAM_PARSER + and BPF_SK_SKB_STREAM_VERDICT introduced by kernel commit + v4.14-rc1~130^2~123^2~8. + * xlat/bpf_map_flags.in: Add BPF_F_NO_COMMON_LRU and BPF_F_NUMA_NODE + introduced by kernel commits v4.10-rc1~202^2~271^2~2 + and v4.14-rc1~130^2~196^2~1, respectively. + * xlat/bpf_map_types.in: Add BPF_MAP_TYPE_DEVMAP + and BPF_MAP_TYPE_SOCKMAP introduced by kernel commits + v4.14-rc1~130^2~497^2~4 and v4.14-rc1~130^2~234^2~4, + respectively. + * xlat/bpf_op_jmp.in: Add BPF_JLT, BPF_JLE, BPF_JSLT, and BPF_JSLE + introduced by kernel commit v4.14-rc1~130^2~309^2~8. + * xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_SK_SKB introduced + by kernel commit v4.14-rc1~130^2~234^2~6. + * NEWS: Mention this. + + Update SO_* constants. + * xlat/sockoptions.in: Add SO_ZEROCOPY introduced by kernel commit + v4.14-rc1~130^2~376^2~5. + * NEWS: Mention this. + + Update MADV_* constants. + * xlat/madvise_cmds.in: Add MADV_WIPEONFORK and MADV_KEEPONFORK + introduced by kernel commit v4.14-rc1~126^2. + * NEWS: Mention this. + +2017-09-08 Baruch Siach + + error_prints: fix potential program_invocation_name type conflict. + uClibc-ng declares program_invocation_name as const. + This causes the build failure below: + + error_prints.c:40:14: error: conflicting types for ‘program_invocation_name’ + extern char *program_invocation_name; + ^~~~~~~~~~~~~~~~~~~~~~~ + In file included from error_prints.c:32:0: + .../output/host/x86_64-buildroot-linux-uclibc/sysroot/usr/include/errno.h:54:20: note: previous declaration of ‘program_invocation_name’ was here + extern const char *program_invocation_name, *program_invocation_short_name; + ^~~~~~~~~~~~~~~~~~~~~~~ + + * error_prints.c (program_invocation_name): Declare only in case + of [!HAVE_PROGRAM_INVOCATION_NAME]. + +2017-09-07 JingPiao Chen + + rtnl_tc_action: decode tcamsg netlink attributes. + * rtnl_tc_action.c (tcamsg_nla_decoders): New array. + (decode_tcamsg): Use it. + + tests: check decoding of TCA_STAB netlink attribute of tcmsg. + * tests/test_nlattr.h (TEST_NESTED_NLATTR_ARRAY): New macro. + * tests/nlattr_tca_stab.c: New file. + * tests/gen_tests.in (nlattr_tca_stab): New entry. + * tests/pure_executables.list: Add nlattr_tca_stab. + * tests/.gitignore: Likewise. + + tests: check decoding of TCA_STATS2 netlink attribute of tcmsg. + * tests/nlattr_tc_stats.c: New file. + * tests/gen_tests.in (nlattr_tc_stats): New entry. + * tests/pure_executables.list: Add nlattr_tc_stats. + * tests/.gitignore: Likewise. + + tests: check decoding of tcmsg netlink attributes. + * tests/nlattr_tcmsg.c: Include and . + (main): Check decoding of TCA_STATS and TCA_RATE. + + rtnl_tc: decode tcmsg netlink attributes. + * configure.ac (AC_CHECK_TYPES): Check for gnet_stats_basic, + gnet_stats_queue, gnet_stats_rate_est, + and gnet_stats_rate_est64 structures in . + And check for struct tc_sizespec in . + * nlattr.h (tc_stats): New prototype. + * rtnl_tc.c: Include , , + "xlat/rtnl_tca_stab_attrs.h" and "xlat/rtnl_tca_stats_attrs.h". + (decode_tc_stats, decode_tc_estimator, decode_gnet_stats_basic, + decode_gnet_stats_rate_est, decode_gnet_stats_queue, + decode_gnet_stats_rate_est64, decode_nla_tc_stats, + decode_tc_sizespec, print_stab_data, decode_tca_stab_data, + decode_tca_stab): New functions. + (tca_stats_nla_decoders, tca_stab_nla_decoders, + tcmsg_nla_decoders): New arrays. + (decode_tcmsg): Use tcmsg_nla_decoders. + * xlat/rtnl_tca_stab_attrs.in: New file. + * xlat/rtnl_tca_stats_attrs.in: Likewise. + +2017-09-07 Dmitry V. Levin + + Update TCP_* constants. + * xlat/socktcpoptions.in: Add TCP_ULP and TCP_MD5SIG_EXT. + * NEWS: Mention this. + + Update SOL_* constants. + * xlat/socketlayers.in: Add SOL_TLS. + * NEWS: Mention this. + +2017-09-06 Dmitry V. Levin + + Post-release administrivia. + * NEWS: Add a header line for the next release. + * debian/changelog.in: Add a changelog entry for 4.19-1. + * strace.spec.in: Likewise. + +2017-09-05 Dmitry V. Levin + + Prepare for 4.19 release. + * NEWS: Update for 4.19 release. + + .mailmap: add canonical name and address of Edgar Kaziakhmedov. + * .mailmap: Add canonical name and address of Edgar Kaziakhmedov here + to avoid duplications in CREDITS file. + + maint: add gen-tag-message.sh script. + * maint/gen-tag-message.sh: New file. + + maint: add gen-contributors-list.sh script. + * maint/gen-contributors-list.sh: New file. + +2017-09-05 Eugene Syromyatnikov + + Update copyright headers. + Headers updated automatically with + + maint/update_copyright_headers.sh -c + +2017-09-05 Eugene Syromyatnikov + + update_copyright_years.sh: add ability to automatically commit results. + * maint/update_copyright_years.sh (DEFAULT_GIT_COMMIT_MESSAGE, + GIT_COMMIT_MESSAGE): New variables. + <-c>: New option, implies -a, calls git commit with GIT_COMMIT_TEMPLATE string + as a template. + +2017-09-04 Eugene Syromyatnikov + + configure.ac: specify minimal GNU Automake version. + In order to provide better diagnostics. + + * configure.ac (AM_INIT_AUTOMAKE): Specify minimal GNU Automake version as + 1.13 due to usage of AM_EXTRA_RECURSIVE_TARGETS macro. + + Closes: https://github.com/strace/strace/issues/11 + +2017-09-04 Eugene Syromyatnikov + + Update NEWS. + +2017-09-03 JingPiao Chen + + tests: check decoding of IFLA_XDP netlink attribute of ifinfomsg. + * tests/nlattr_ifla_xdp.c: New file. + * tests/gen_tests.in (nlattr_ifla_xdp): New entry. + * tests/pure_executables.list: Add nlattr_ifla_xdp. + * tests/.gitignore: Likewise. + + tests: check decoding of IFLA_PORT_SELF netlink attribute of ifinfomsg. + * tests/nlattr_ifla_port.c: New file. + * tests/gen_tests.in (nlattr_ifla_port): New entry. + * tests/pure_executables.list: Add nlattr_ifla_port. + * tests/.gitignore: Likewise. + + tests: check decoding of more ifinfomsg netlink attributes. + * tests/nlattr_ifinfomsg.c (IFLA_LINKINFO, IFLA_VF_PORTS, + IFLA_INFO_KIND, IFLA_VF_PORT): New macros. + (main): Check decoding of IFLA_LINKINFO and IFLA_VF_PORTS. + + rtnl_link: decode more ifinfomsg netlink attributes. + * configure.ac (AC_CHECK_TYPES): Check for struct ifla_port_vsi + in . + * rtnl_link.c: Include "xlat/rtnl_ifla_info_attrs.h", + "xlat/rtnl_ifla_port_attrs.h", "xlat/rtnl_ifla_port_attrs.h", + "xlat/rtnl_ifla_xdp_attrs.h", and "xlat/xdp_flags.h". + (decode_ifla_linkinfo, decode_ifla_port_vsi, + decode_ifla_port, decode_ifla_vf_ports, + decode_ifla_xdp_flags, decode_ifla_xdp): New functions. + (ifla_linkinfo_nla_decoders, ifla_port_nla_decoders, + ifla_vf_port_nla_decoders, ifla_xdp_nla_decoders): New arrays. + (ifinfomsg_nla_decoders) : Use decode_ifla_linkinfo. + : Use decode_ifla_vf_ports. + : Use decode_ifla_port. + : Use decode_ifla_xdp. + * xlat/rtnl_ifla_info_attrs.in: New file. + * xlat/rtnl_ifla_port_attrs.in: Likewise. + * xlat/rtnl_ifla_vf_port_attrs.in: Likewise. + * xlat/rtnl_ifla_xdp_attrs.in: Likewise. + * xlat/xdp_flags.in: Likewise. + +2017-09-02 Eugene Syromyatnikov + + keyctl: add support for KDF parameters decoding in KEYCTL_DH_COMPUTE. + * fetch_struct_keyctl_kdf_params.c: New file. + * keyctl_kdf_params.h: Likewise. + * Makefile.am (strace_SOURCES): Add them. + * configure.ac: Add check for struct keyctl_kdf_params presence in + . + * defs.h (struct strace_keyctl_kdf_params): Add forward declaration. + * keyctl.c (keyctl_dh_compute): Add new parameter kdf_addr, print it + on exiting. + (SYS_FUNC(keyctl)) : Pass arg5 to + keyctl_dh_compute. + * tests/keyctl.c: Include assert.h. + (struct keyctl_kdf_params) [!HAVE_STRUCT_KEYCTL_KDF_PARAMS]: New + definition. + (STR32): New definition, copied from ioctl_dm.c. + (append_str, kckdfp_to_str): New functions. + (main): Update expected output, add checks for struct keyctl_kdf_params + decoding. + + tests/keyctl: improve readability. + * tests/keyctl.c: Since do_keyctl() has so convoluted calling convention + and keyctl test is so complex, let's try to improve readability a bit + with some conventions regarding do_keyctl() call formatting: arguments + representing single keyctl argument should be put on the separate line, + continuations of arguments related to the same keyctl argument should + have additional indentation and termination 0UL should always be + on a separate line. Also, while we are here, let's add spaces + to two type casts that are missing them. + +2017-09-01 Gleb Fotengauer-Malinovskiy + + s390: update ioctl entries from linux 4.13. + * linux/s390/ioctls_arch0.h: Update from linux v4.13-rc7 using ioctls_gen.sh. + +2017-09-01 Dmitry V. Levin + + mpers.awk: fix regression introduced by the previous cleanup. + * mpers.awk (what_is): Remove returned_size from local variables. + + Fixes: v4.18-308-gfd3447b5 ("mpers.awk: declare local variables consistently") + +2017-09-01 Dmitry V. Levin + + rtnl_link: enhance decoding of struct rtnl_link_stats{,64} + Enhance runtime detection of struct rtnl_link_stats.rx_nohandler + and struct rtnl_link_stats64.rx_nohandler. + + * rtnl_link.c (decode_rtnl_link_stats): Do not accept structure length + greater than min_size but less than sizeof(struct rtnl_link_stats). + (decode_rtnl_link_stats64): Likewise, so not accept structure length + greater than min_size but less than sizeof(struct rtnl_link_stats64). + +2017-09-01 Dmitry V. Levin + + rtnl_neightbl: enhance decoding of struct ndt_stats. + Add support of kernels that operate with older definition of + struct ndt_stats than the definition used to build strace. + + * rtnl_neightbl.c (decode_ndt_stats): Add runtime detection + of struct ndt_stats.ndts_table_fulls field, print the field + when it is available. + +2017-09-01 JingPiao Chen + + tests: check decoding of IFLA_PROTINFO netlink attribute of ifinfomsg. + * tests/nlattr_ifla_brport.c: New file. + * tests/gen_tests.in (nlattr_ifla_brport): New entry. + * tests/pure_executables.list: Add nlattr_ifla_brport. + * tests/.gitignore: Likewise. + * tests/test_nlattr.h (TEST_NESTED_NLATTR_OBJECT): New macro. + + rtnl_link: decode IFLA_PROTINFO netlink attribute of ifinfomsg. + * configure.ac (AC_CHECK_TYPES): Check for ifla_bridge_id + and rtnl_link_stats64 structures in . + * rtnl_link.c: Include "xlat/rtnl_ifla_brport_attrs.h". + (decode_ifla_bridge_id, decode_ifla_protinfo): New functions. + (ifla_brport_nla_decoders): New array. + (ifinfomsg_nla_decoders) : Use decode_ifla_protinfo. + * xlat/rtnl_ifla_brport_attrs.in: New file. + + tests: check decoding of ndtmsg netlink attributes. + * tests/nlattr_ndtmsg.c (NDTA_PARMS, NDTPA_IFINDEX): New macros. + (main): Check decoding of NDTA_CONFIG, NDTA_PARMS and NDTA_STATS. + + rtnl_neightbl: decode ndtmsg netlink attributes. + * configure.ac (AC_CHECK_TYPES): Check for ndt_config + and ndt_stats structures in . + (AC_CHECK_MEMBERS): Check for ndts_table_fulls field in struct ndt_stats. + * rtnl_neightbl.c: Include "xlat/rtnl_neightbl_parms_attrs.h". + (decode_ndt_config, decode_ndta_parms, decode_ndta_parms): New functions. + (ndt_parms_nla_decoders, ndtmsg_nla_decoders): New arrays. + (decode_ndtmsg): Use ndtmsg_nla_decoders. + * xlat/rtnl_neightbl_parms_attrs.in: New file. + + tests: check decoding of ifaddrlblmsg netlink attributes. + * tests/nlattr_ifaddrlblmsg.c (main): Check decoding of IFAL_ADDRESS. + + rtnl_addrlabel: decode ifaddrlblmsg netlink attributes. + * rtnl_addrlabel.c (decode_ifal_address): New function. + (ifaddrlblmsg_nla_decoders): New array. + (decode_ifaddrlblmsg): Use it. + +2017-09-01 Dmitry V. Levin + + alpha: wire up new syscalls. + * linux/alpha/syscallent.h [514..522]: New entries. + +2017-08-31 JingPiao Chen + + tests/.gitignore: add missing files that should be ignored. + * tests/.gitignore: Add is_linux_mips_n64. + +2017-08-31 Dmitry V. Levin + + mpers.awk: declare local variables consistently. + * mpers.awk (compare_indices): Make c1 and c2 variables local. + (enter): Make item variable local. + (what_is): Make loc_diff, returned_size, and to_return local. + +2017-08-30 Dmitry V. Levin + + mpers.awk: separate local variables from real parameters by newline. + * mpers.awk (array_get, update_upper_bound): Separate local variables + from real parameters by newline. + +2017-08-29 Dmitry V. Levin + + rtnl_rule: enhance FRA_TABLE decoding. + The attribute of FRA_TABLE is not just a 32-bit integer, some constants + have well-known symbolic names like RT_TABLE_DEFAULT. + + * rtnl_rule.c (fib_rule_hdr_nla_decoders) : + Use decode_nla_rt_class. + * tests/nlattr_fib_rule_hdr.c (FRA_TABLE): New macro. + (main): Check FRA_TABLE decoding. + +2017-08-29 Dmitry V. Levin + + rtnl_route: enhance RTA_TABLE decoding. + The attribute of RTA_TABLE is not just a 32-bit integer, some constants + have well-known symbolic names like RT_TABLE_DEFAULT. + + * nlattr.h (decode_nla_rt_class): New prototype. + * rtnl_route.c (decode_nla_rt_class): New function. + (rtmsg_nla_decoders) : Use it. + * tests/nlattr_rtmsg.c (main): Check RTA_TABLE decoding. + +2017-08-29 JingPiao Chen + + rtnl_nsid: decode rtgenmsg netlink attributes. + * rtnl_nsid.c (rtgenmsg_nla_decoders): New array. + (decode_rtgenmsg): Use it. + + rtnl_netconf: decode netconfmsg netlink attributes. + * rtnl_netconf.c (netconfmsg_nla_decoders): New array. + (decode_netconfmsg): Use it. + + tests: check decoding of ndmsg netlink attributes. + * tests/nlattr_ndmsg.c: Include and . + (NDA_PORT): New macro. + (main): Check decoding of NDA_DST, NDA_CACHEINFO and NDA_PORT. + + rtnl_neigh: decode ndmsg netlink attributes. + * nlattr.c: Include and . + (decode_nla_be16): New function. + * nlattr.h (decode_nla_be16): New prototype. + * rtnl_neigh.c (decode_neigh_addr, + decode_nda_cacheinfo): New functions. + (ndmsg_nla_decoders): New array. + (decode_ndmsg): Use it. + + tests: check decoding of fib_rule_hdr netlink attributes. + * tests/nlattr_fib_rule_hdr.c: Include . + (FRA_TUN_ID, FRA_UID_RANGE): New macros. + (main): Check decoding of FRA_DST, FRA_UID_RANGE and FRA_TUN_ID. + + rtnl_rule: decode fib_rule_hdr netlink attributes. + * configure.ac (AC_CHECK_FUNCS): Add be64toh. + (AC_CHECK_TYPES): Check for struct fib_rule_uid_range + in . + * nlattr.c: Include . + (decode_nla_be64): New function. + * nlattr.h (decode_nla_be64): New prototype. + * rtnl_rule.c (decode_rule_addr, + decode_fib_rule_uid_range): New functions. + (fib_rule_hdr_nla_decoders): New array. + (decode_fib_rule_hdr): Use it. + + rtnl_neigh: fix ndm_type field decode in struct ndmsg. + * defs.h (routing_types): New xlat prototype. + * rtnl_neigh.c (decode_ndmsg): Fix ndm_type decode. + * xlat/nda_types.in: Remove it. + * tests/netlink_route.c (test_rtnl_neigh): Update the test. + * tests/nlattr_ndmsg.c (init_ndmsg, print_ndmsg): Likewise. + +2017-08-28 Dmitry V. Levin + + Disallow more than one signal= specification in an injection expression. + Specifying several signal= specifications in an injection expressions + makes no sense. + + * filter_qualify.c (parse_inject_token): Disallow second + signal= specification. + * strace.1.in: Document it. + * tests/qual_inject-syntax.test: Check it. + +2017-08-28 Dmitry V. Levin + + Add "flags" field to struct inject_data. + Introduce "flags" field to struct inject_data and use it instead + of magic rval and signo constants. + Due to layout of struct inject_data, this new field does not change + sizeof(struct inject_data). + + * defs.h (INJECT_F_RETVAL, INJECT_F_SIGNAL): New macros. + (INJECT_OPTS_RVAL_DEFAULT): Remove macro. + (struct inject_data): Add "flags" field. + * filter_qualify.c (parse_inject_token, qualify_inject_common): Check + struct inject_data.flags instead of inject_data.rval + and inject_data.signo, do not initialize inject_opts.data. + * syscall.c (tamper_with_syscall_entering): Check struct + inject_data.flags instead of inject_data.rval and inject_data.signo. + +2017-08-28 Dmitry V. Levin + Victor Krapivensky + + Move inject data of struct inject_opts to inject_data substructure. + * defs.h (inject_data): New structure. + (struct inject_opts): Replace "signo" and "rval" fields with "data" + field of type "struct inject_data". + * filter_qualify.c (parse_inject_token, qualify_inject_common): Update + for the new layout of struct inject_opts. + * syscall.c (tamper_with_syscall_entering, tamper_with_syscall_exiting): + Likewise. + +2017-08-28 Gleb Fotengauer-Malinovskiy + + Update ioctl entries from linux v4.13-rc7. + * linux/32/ioctls_inc_align16.h: Update from linux v4.13-rc7 using ioctls_gen.sh. + * linux/32/ioctls_inc_align32.h: Likewise. + * linux/32/ioctls_inc_align64.h: Likewise. + * linux/64/ioctls_inc.h: Likewise. + * linux/x32/ioctls_inc0.h: Likewise. + * linux/arm/ioctls_arch0.h: Likewise. + * linux/i386/ioctls_arch0.h: Likewise. + * linux/powerpc/ioctls_arch0.h: Likewise. + * linux/s390x/ioctls_arch0.h: Likewise. + * linux/x86_64/ioctls_arch0.h: Likewise. + * NEWS: Mention this. + +2017-08-28 JingPiao Chen + + tests: check decoding of ifinfomsg netlink attributes. + * tests/nlattr_ifinfomsg.c: Include and . + (IFLA_LINK_NETNSID): New macro. + (main): Check decoding of IFLA_LINK_NETNSID, + IFLA_STATS, IFLA_MAP and IFLA_STATS64. + + rtnl_link: decode ifinfomsg netlink attributes. + * configure.ac (AC_CHECK_HEADERS): Add linux/if_link.h. + (AC_CHECK_TYPES): Check for struct rtnl_link_stats64 + in . + (AC_CHECK_MEMBERS): Check for rx_nohandler field + in struct rtnl_link_stats/rtnl_link_stats64. + * rtnl_link.c: Include . + (decode_rtnl_link_stats, decode_rtnl_link_ifmap, + decode_rtnl_link_stats64): New functions. + (ifinfomsg_nla_decoders): New array. + (decode_ifinfomsg): Use it. + +2017-08-28 Dmitry V. Levin + Eugene Syromyatnikov + + Imply RVAL_DECODED when RVAL_IOCTL_PARSED is returned on entering. + Also, rename RVAL_IOCTL_PARSED to RVAL_IOCTL_DECODED as the latter + is a more suitable name. + + * defs.h (RVAL_IOCTL_PARSED): Rename to RVAL_IOCTL_DECODED. + * ioctl.c (ioctl_decode): Update comment. + (SYS_FUNC(ioctl)): Replace RVAL_IOCTL_PARSED with RVAL_IOCTL_DECODED, + add convertation of RVAL_IOCTL_DECODED to RVAL_DECODED. + * block.c (block_ioctl): Replace RVAL_DECODED | RVAL_IOCTL_PARSED + with RVAL_IOCTL_DECODED on entering. Replace RVAL_IOCTL_PARSED + with RVAL_IOCTL_DECODED on exiting. + * btrfs.c (btrfs_ioctl): Likewise. + * evdev.c: Likewise. + * file_ioctl.c: Likewise. + * fs_x_ioctl.c: Likewise. + * hdio.c: Likewise. + * loop.c: Likewise. + * mtd.c: Likewise. + * nsfs.c: Likewise. + * print_sg_req_info.c: Likewise. + * ptp.c: Likewise. + * rtc.c: Likewise. + * scsi.c: Likewise. + * sg_io_v3.c: Likewise. + * sg_io_v4.c: Likewise. + * sock.c: Likewise. + * term.c: Likewise. + * ubi.c: Likewise. + * userfaultfd.c: Likewise. + * dm.c (dm_known_ioctl): Return RVAL_IOCTL_DECODED on exiting and 0 + on entering. Replace RVAL_IOCTL_PARSED with RVAL_IOCTL_DECODED + on exiting. + * v4l2.c: Likewise. + +2017-08-28 Eugene Syromyatnikov + + Replace return 1 ioctl sub-decoder hack with proper flag. + * defs.h (RVAL_IOCTL_PARSED): Introduce new flag for ioctl sub-decoders + * to signalise that they have successfully printed argument. + * ioctl.c (SYS_FUNC(ioctl)): Check for RVAL_IOCTL_PARSED flag, remove + un-set it before returning the value. + * block.c: Use RVAL_IOCTL_PARSED instead of 1. + * btrfs.c: Likewise. + * dm.c: Likewise. + * evdev.c: Likewise. + * file_ioctl.c: Likewise. + * fs_x_ioctl.c: Likewise. + * hdio.c: Likewise. + * loop.c: Likewise. + * mtd.c: Likewise. + * nsfs.c: Likewise. + * print_sg_req_info.c: Likewise. + * ptp.c: Likewise. + * rtc.c: Likewise. + * scsi.c: Likewise. + * sg_io_v3.c: Likewise. + * sg_io_v4.c: Likewise. + * sock.c: Likewise. + * term.c: Likewise. + * ubi.c: Likewise. + * userfaultfd.c: Likewise. + * v4l2.c: Likewise. + +2017-08-28 Eugene Syromyatnikov + + v4l2: streamline logic. + Move exiting path out of if (entering(tcp)) { ... return 0; } else, + provide common exit point in v4l2_ioctl handler, use break instead of + return in specific command handlers. + + * v4l2.c (print_v4l2_format, print_v4l2_buffer, print_v4l2_standard, + print_v4l2_input, print_v4l2_frmivalenum): Move exiting path out of else + par of the entering(tcp) condition. + (v4l2_ioctl): Add return RVAL_DECODED | 1 at the end of function. + (v4l2_ioctl) : Replace return + with break. + +2017-08-28 Eugene Syromyatnikov + + v4l2: reorder field printing in order to avoid auxstr usage. + Also rework flow a little in order to reduce amount of indentation. + + * v4l2.c (print_v4l2_requestbuffers): Print count as the last field on + entering, append it with updated value on exiting. + * tests/ioctl_v4l2.c: Update expected output. + +2017-08-28 Eugene Syromyatnikov + + userfaultfd: streamline logic. + Make userfaultfd ioctl handling more in line with other ioctl decoders. + + * userfaultfd.c (uffdio_ioctl): Return RVAL_DECODED | 1, break instead + of returning in specific command handlers, return 0 on entering paths, + move exiting paths out of else branch of entering(tcp) condition. + +2017-08-28 Eugene Syromyatnikov + + Do not return RVAL_DECODED on exiting path of ioctl decoders. + * print_sg_req_info.c (decode_sg_req_info): Return 1 instead of + RVAL_DECODED | 1 on exiting path. + * scsi.c (decode_sg_scsi_id): Likewise. + * sg_io_v3.c (decode_response): Likewise. + * sg_io_v4.c (decode_response): Likewise. + +2017-08-28 Eugene Syromyatnikov + + dm: return RVAL_DECODED instead of 0 if we can't decode command. + Return RVAL_DECODED if we can't decode command in order to avoid being + called on exiting. + + * dm.c (dm_ioctl): Return RVAL_DECODED instead of 0 if command can't be + decoded. + +2017-08-28 Eugene Syromyatnikov + Dmitry V. Levin + + Return 0 instead of 1 on entering path of ioctl decoders. + As returning 1 (without RVAL_DECODED) on entering makes no sense. + + * block.c (block_ioctl) : Replace return 1 with + return 0 on entering path. + * ptp.c (ptp_ioctl) : Likewise. + * sg_io_v3.c (decode_request): Likewise. + * sg_io_v4.c (decode_request): Likewise. + * sock.c (decode)ifconf, sock_ioctl) : Likewise. + * ubi.c (ubi_ioctl) : Likewise. + * v4l2.c (print_v4l2_ext_controls): Likewise. + +2017-08-28 Eugene Syromyatnikov + + ioctl: simplify ioctl_decode handling, document its return value semantics + * ioctl.s (SYS_FUNC(ioctl.c)): Unconditionally unset 1, simply print arg + when (ret & RVAL_DECODED) && !(ret & 1). + +2017-08-28 Eugene Syromyatnikov + Dmitry V. Levin + + syscall.c: define personality names for all multi-personality architectures + I see no reason for not having these definitions for SPARC64 and RISC-V. + Also, borrow the check template from supported_personalities.h. + + * syscall.c (update_personality) [defined RISCV, defined SPARC64] + : Define it for these architectures. + +2017-08-28 Eugene Syromyatnikov + + copyright-year-gen: workaround for old git versions. + Apply the same treatment to this script as the one in + v4.18-278-g295cf32. + + * copyright-year-gen : Change format to format:%cD, remove --date, + supply output as a -d option argument to date +%Y. + +2017-08-27 Eugene Syromyatnikov + + ubi: trim overly long lines. + + term: use print_quoted_string. + * term.c (decode_termios): Use print_quoted_string for printing c_cc field + instead of writing the printing code by hand. + +2017-08-27 Eugene Syromyatnikov + + update_copyright_years.sh: workaround for old git versions. + Old git versions (like the one shipped in Debian 8) do not support setting + date format with --date, working this around by processing git log output + with date +%Y. + + * main/update_copyright_years.sh (process_file) : Change format to format:%aD, remove --date, supply + output as a -d option argument to date +%Y. + +2017-08-27 Eugene Syromyatnikov + + syscall: use spaces in tile personality names, de-duplicate definition. + As Chris Metcalf, the author of v4.7-40-g0b99a8a, told in private, there + is no strong reason for having tile's personality name different from + personality names on other architectures, so let's use spaces instead of + dashes here. And, while we are here, remove duplication of personality + name definitions for various architectures. + + * syscall.c (update_personality) [defined TILE]: Change dashes to spaces + in personality names. + +2017-08-26 JingPiao Chen + Dmitry V. Levin + + tests: check decoding of rtmsg netlink attributes. + * tests/nlattr_rtmsg.c: Include and . + (LWTUNNEL_ENCAP_NONE, RTA_ENCAP_TYPE): New macros. + (main): Check decoding of RTA_DST, RTA_OIF, RTA_METRICS, RTA_MULTIPATH, + RTA_CACHEINFO, RTA_MFC_STATS, RTA_VIA, and RTA_ENCAP_TYPE. + + rtnl_route: decode rtmsg netlink attributes. + * configure.ac (AC_CHECK_TYPES): Check for + rta_mfc_stats and rtvia structures in . + * nlattr.c (decode_nla_ifindex): New function. + * nlattr.h (decode_nla_ifindex): New prototype. + * rtnl_route.c (decode_route_addr, decode_rta_metrics, + decode_rta_multipath, decode_rta_cacheinfo, + decode_rta_mfc_stats, decode_rtvia, + decode_rta_encap_type): New functions. + (rta_metrics_nla_decoders, rtmsg_nla_decoders): New arrays. + (decode_rtmsg): Use rtmsg_nla_decoders. + * xlat/lwtunnel_encap_types.in: New file. + * xlat/route_nexthop_flags.in: Likewise. + * xlat/rtnl_rta_metrics_attrs.in: Likewise. + +2017-08-25 Dmitry V. Levin + + s390: wire up s390_guarded_storage syscall. + * linux/s390/syscallent.h [378]: Add s390_guarded_storage entry. + * linux/s390x/syscallent.h: Likewise. + + microblaze: wire up statx syscall. + * linux/microblaze/syscallent.h [398]: Add statx entry. + +2017-08-24 Dmitry V. Levin + + alloc_number_set_array: add ATTRIBUTE_MALLOC. + * number_set.h: Include "gcc_compat.h". + (alloc_number_set_array): Add ATTRIBUTE_MALLOC. + +2017-08-24 Nikolay Marchuk + + Add macros for testing QUAL_* flags. + * defs.h (traced, raw, inject): Add macros for testing QUAL_TRACE, + QUAL_RAW, and QUAL_INJECT flags. + * syscall.c (syscall_entering_trace, syscall_exiting_trace): Use them. + +2017-08-24 Dmitry V. Levin + + Remove QUAL_SIGNAL, QUAL_READ and QUAL_WRITE. + Remove these flags that are unused since commit v4.15~26. + They might be introduced later with a different meaning. + + * defs.h (QUAL_SIGNAL, QUAL_READ, QUAL_WRITE): Remove. + +2017-08-24 Eugene Syromiatnikov + + xstrdup, xtrndup: allow NULL argument. + Accept NULL argument in xstrdup and xtrndup functions to allow use + of "xstrdup(str)" instead of "str ? xstrdup(str) : NULL". + + * xmalloc.c (xstrdup, xstrndup): Handle NULL argument. + * xmalloc.h: Add comment regarding this deviation from the behaviour + of the POSIX counterparts of these functions. + +2017-08-23 Dmitry V. Levin + + tests: really skip mips o32 scno tampering tests on mips n64. + * tests/is_linux_mips_n64.c: New file. + * tests/Makefile.am (check_PROGRAMS): Add it. + * tests/scno_tampering.sh <$STRACE_ARCH == mips>: + In case of mips o32 abi, skip the test if is_linux_mips_n64 says + that the kernel is mips n64, even if "uname -m" claims it's mips. + +2017-08-22 Dmitry V. Levin + + Hide struct number_set implementation details from users. + * number_set.h (number_slot_t, struct number_set): Move to number_set.c. + (struct number_set): Add forward declaration. + (read_set, write_set, signal_set): Change prototypes from objects + to pointers. + * filter_qualify.c (read_set, write_set, signal_set): Change definitions + from objects to pointers. + (abbrev_set, inject_set, raw_set, trace_set, verbose_set): Change + definitions from arrays to pointers. + (qualify_read): Initialize read_set before first use. + (qualify_write): Initialize write_set before first use. + (qualify_signals): Initialize signal_set before first use. + (qualify_trace): Initialize trace_set before first use. + (qualify_abbrev): Initialize abbrev_set before first use. + (qualify_verbose): Initialize verbose_set before first use. + (qualify_raw): Initialize raw_set before first use. + (qualify_inject_common): Initialize inject_set before first use. + * strace.c (print_signalled, print_stopped): Update signal_set usage. + * syscall.c (dumpio): Update usage of read_set and write_set. + + Extend number_set interface. + * number_set.h (number_set_array_is_empty, is_number_in_set_array, + add_number_to_set_array, clear_number_set_array, + invert_number_set_array, alloc_number_set_array, free_number_set_array): + New function prototypes. + * number_set.c (number_set_array_is_empty, is_number_in_set_array, + add_number_to_set_array, clear_number_set_array, + invert_number_set_array, alloc_number_set_array, free_number_set_array): + New functions. + * basic_filters.c (qualify_syscall_number, qualify_syscall_regex, + qualify_syscall_class, qualify_syscall_name): Use + add_number_to_set_array. + (qualify_syscall_tokens, qualify_tokens): Use + clear_number_set_array and invert_number_set_array. + * filter_qualify.c (qualify_inject_common): Use alloc_number_set_array, + number_set_array_is_empty, is_number_in_set_array, + add_number_to_set_array, and free_number_set_array. + (qual_flags): Use is_number_in_set_array. + + Move number_set interface to separate files. + * number_set.c: New file. + * number_set.h: Likewise. + * Makefile.am (strace_SOURCES): Add them. + * basic_filters.c: Include "number_set.h". + (number_slot_t, struct number_set): Move to number_set.h. + (BITS_PER_SLOT, number_setbit, number_isset, reallocate_number_set, + add_number_to_set, is_number_in_set): Move to number_set.c. + * defs.h (struct number_set): Remove forward declaration. + (read_set, write_set, signal_set, is_number_in_set): Move to number_set.h. + * filter.h (add_number_to_set): Move to number_set.h. + * filter_qualify.c: Include "number_set.h". + (number_slot_t, struct number_set): Remove. + * strace.c: Include "number_set.h". + * syscall.c: Likewise. + +2017-08-22 Edgar Kaziakhmedov + + Move SUPPORTED_PERSONALITIES to a separate file. + Since the defs.h contains unrelated declarations which are + redundant (and sometimes conflicting) for other binaries included + in the strace package, move SUPPORTED_PERSONALITIES defintions + to a separate file. + + * defs.h: Include "supported_personalities.h". + (SUPPORTED_PERSONALITIES): Move ... + * supported_personalities.h: ... to the new file. + * Makefile.am (strace_SOURCES): Add it. + +2017-08-22 Edgar Kaziakhmedov + + Move string_to_uint* functions to a separate file. + Make string_to_uint* functions available to other binaries + included in the strace package. + + * string_to_uint.h: New file. + * defs.h: Include it. + (string_to_uint_ex, string_to_uint_upto, string_to_uint): Move + to string_to_uint.h. + * util.c (string_to_uint_ex, string_to_uint): Move ... + * string_to_uint.c: ... to the new file. + * Makefile.am (strace_SOURCES): Add string_to_uint.h and string_to_uint.c. + +2017-08-22 JingPiao Chen + + tests: check decoding of ifaddrmsg netlink attributes. + * tests/nlattr_ifaddrmsg.c: Include . + (IFA_FLAGS, SET_IFA_FAMILY): New macros. + (init_ifaddrmsg): Set ifaddrmsg.ifa_family field from ifa_family. + (print_ifaddrmsg): Print ifaddrmsg.ifa_family field using ifa_family_str. + (main): Check decoding of IFA_ADDRESS, IFA_CACHEINFO, and IFA_FLAGS. + + rtnl_addr: decode ifaddrmsg netlink attributes. + * rtnl_addr.c (decode_ifa_address, + decode_ifa_cacheinfo, decode_ifa_flags): New functions. + (ifaddrmsg_nla_decoders): New array. + (decode_ifaddrmsg): Use it. + +2017-08-22 Dmitry V. Levin + + Export decode_inet_addr. + * defs.h (decode_inet_addr): New prototype. + * netlink_inet_diag.c (decode_inet_addr): Remove static keyword, move ... + * sockaddr.c: ... here. + + netlink_inet_diag: prepare decode_inet_addr for export. + * netlink_inet_diag.c (decode_inet_addr): Change return type to bool, + parametrize field name using new var_name argument. + (decode_inet_diag_hostcond): Specify "addr" field name + to decode_inet_addr. + +2017-08-20 Dmitry V. Levin + + print_inet_addr: add support of invocations without field name. + Prepare print_inet_addr for use in structureless contexts where + no structure field name is available. + + * sockaddr.c (print_inet_addr): Handle var_name == NULL. + +2017-08-19 Dmitry V. Levin + + print_inet_addr: print address of unsupported family in hex. + * sockaddr.c (print_inet_addr): Specify QUOTE_FORCE_HEX + to print_quoted_string. + +2017-08-18 Dmitry V. Levin + + mips o32: do not bail out in get_syscall_args if umoven fails. + If the kernel contains commit 84d77d3f06e7e8dea057d10e8ec77ad71f721be3, + both PTRACE_PEEKDATA and process_vm_readv become unavailable when the + process dumpable flag is cleared. As the first 4 syscall arguments are + still available via registers, do not treat this as get_syscall_args + error. + + This condition is triggered and therefore tested by prctl-dumpable test. + + * linux/mips/get_syscall_args.c (get_syscall_args) [LINUX_MIPSO32]: + Do not bail out if umoven fails. + +2017-08-17 Dmitry V. Levin + + configure: cleanup struct statfs/statfs64 member checks. + * configure.ac : Merge several + AC_CHECK_MEMBERS checks of struct statfs members into a single check. + : Likewise, for checks + of struct statfs64 members. + +2017-08-16 Dmitry V. Levin + + tests: fix a few harmless -Woverflow compilation warnings. + Fix the following compilation warnings on platforms where + sizeof(struct timeval.tv_usec) < sizeof(long): + + xettimeofday.c: In function ‘main’: + xettimeofday.c:76:16: warning: overflow in implicit constant conversion [-Woverflow] + tv->tv_usec = (long) 0xbadc0dedfacefeedLL; + xetitimer.c: In function ‘main’: + xetitimer.c:170:28: warning: overflow in implicit constant conversion [-Woverflow] + p_new->it_value.tv_usec = (long) 0xbadc0dedfacefeedLL; + In file included from utimes.c:38:0: + xutimes.c: In function ‘main’: + xutimes.c:110:18: warning: overflow in implicit constant conversion [-Woverflow] + tv[1].tv_usec = (long) 0xbadc0dedfacefeedLL; + futimesat.c: In function ‘main’: + futimesat.c:121:18: warning: overflow in implicit constant conversion [-Woverflow] + tv[1].tv_usec = (long) 0xbadc0dedfacefeedLL; + In file included from _newselect.c:35:0: + xselect.c: In function ‘main’: + xselect.c:94:16: warning: overflow in implicit constant conversion [-Woverflow] + tv->tv_usec = (long) 0xbadc0dedfacefeedLL; + ^ + * tests/futimesat.c (main): In initialization of struct timeval.tv_usec, + change explicit cast from (long) to (suseconds_t). + * tests/xetitimer.c: Likewise. + * tests/xettimeofday.c: Likewise. + * tests/xselect.c: Likewise. + * tests/xutimes.c: Likewise. + + Reported-by: Anatoly Pugachev + +2017-08-16 Dmitry V. Levin + + tests: fix sigaction.test on sparc. + On sparc, the first argument of old sigaction syscall has negated + semantics, compared to other architectures. While sigaction.test + was aware about this arch-specific detail from the beginning, in one + of many sigaction syscall invocations a non-negative signal number + was erroneously passed on sparc. + + * tests/sigaction.c (ADDR_INT, SIGNO_INT): New arch-specific macros. + (signo, addr): Use them. + +2017-08-16 Dmitry V. Levin + + nlattr: fix printing of unrecognized attribute data. + Do not print more than "nlattr.nla_len - NLA_HDRLEN" bytes + of unrecognized attribute data. + + * nlattr.c (decode_nlattr_with_data): Specify "nla_len - NLA_HDRLEN" + instead of "len - NLA_HDRLEN" as the size of unrecognized attribute + data. + * tests/nlattr.c (test_nlattr): Check it. + +2017-08-15 JingPiao Chen + + tests: check decoding of NETLINK_ROUTE rtgenmsg attributes. + * tests/nlattr_rtgenmsg.c: New file. + * tests/gen_tests.in (nlattr_rtgenmsg): New entry. + * tests/pure_executables.list: Add nlattr_rtgenmsg. + * tests/.gitignore: Likewise. + +2017-08-15 JingPiao Chen + Fabien Siron + + netlink: add basic decoding of NETLINK_ROUTE rtgenmsg attributes. + * rtnl_nsid.c: Include "nlattr.h" and "xlat/rtnl_nsid_attrs.h". + (decode_rtgenmsg): Call decode_nlattr. + * xlat/rtnl_nsid_attrs.in: New file. + +2017-08-15 JingPiao Chen + + tests: check decoding of NETLINK_ROUTE br_port_msg attributes. + * tests/nlattr_br_port_msg.c: New file. + * tests/gen_tests.in (nlattr_br_port_msg): New entry. + * tests/pure_executables.list: Add nlattr_br_port_msg. + * tests/.gitignore: Likewise. + +2017-08-15 JingPiao Chen + Fabien Siron + + netlink: add basic decoding of NETLINK_ROUTE br_port_msg attributes. + * rtnl_mdb.c: Include "netlink.h", "nlattr.h". + and "xlat/rtnl_mdb_attrs.h". + (decode_br_port_msg): Call decode_nlattr. + * xlat/rtnl_mdb_attrs.in: New file. + +2017-08-15 JingPiao Chen + + tests: check decoding of NETLINK_ROUTE netconfmsg attributes. + * tests/nlattr_netconfmsg.c: New file. + * tests/gen_tests.in (nlattr_netconfmsg): New entry. + * tests/pure_executables.list: Add nlattr_netconfmsg. + * tests/.gitignore: Likewise. + +2017-08-15 JingPiao Chen + Fabien Siron + + netlink: add basic decoding of NETLINK_ROUTE netconfmsg attributes. + * rtnl_netconf.c: Include "netlink.h", "nlattr.h", + and "xlat/rtnl_netconf_attrs.h". + (decode_netconfmsg): Call decode_nlattr. + * xlat/rtnl_netconf_attrs.in: New file. + +2017-08-15 JingPiao Chen + + tests: check decoding of NETLINK_ROUTE dcbmsg attributes. + * tests/nlattr_dcbmsg.c: New file. + * tests/gen_tests.in (nlattr_dcbmsg): New entry. + * tests/pure_executables.list: Add nlattr_dcbmsg. + * tests/.gitignore: Likewise. + +2017-08-15 JingPiao Chen + Fabien Siron + + netlink: add basic decoding of NETLINK_ROUTE dcbmsg attributes. + * rtnl_dcb.c: Include "netlink.h", "nlattr.h", + and "xlat/rtnl_dcb_attrs.h". + (decode_dcbmsg): Call decode_nlattr. + * xlat/rtnl_dcb_attrs.in: New file. + +2017-08-15 JingPiao Chen + + tests: check decoding of NETLINK_ROUTE ifaddrlblmsg attributes. + * tests/nlattr_ifaddrlblmsg.c: New file. + * tests/gen_tests.in (nlattr_ifaddrlblmsg): New entry. + * tests/pure_executables.list: Add nlattr_ifaddrlblmsg. + * tests/.gitignore: Likewise. + +2017-08-15 JingPiao Chen + Fabien Siron + + netlink: add basic decoding of NETLINK_ROUTE ifaddrlblmsg attributes. + * rtnl_addrlabel.c: Include "netlink.h", "nlattr.h", + and "xlat/rtnl_addrlabel_attrs.h". + (decode_ifaddrlblmsg): Call decode_nlattr. + * xlat/rtnl_addrlabel_attrs.in: New file. + +2017-08-15 JingPiao Chen + + tests: check decoding of NETLINK_ROUTE tcamsg attributes. + * tests/nlattr_tcamsg.c: New file. + * tests/gen_tests.in (nlattr_tcamsg): New entry. + * tests/pure_executables.list: Add nlattr_tcamsg. + * tests/.gitignore: Likewise. + +2017-08-15 JingPiao Chen + Fabien Siron + + netlink: add basic decoding of NETLINK_ROUTE tcamsg attributes. + * rtnl_tc_action.c: Include "nlattr.h" and "xlat/rtnl_tc_action_attrs.h". + (decode_tcamsg): Call decode_nlattr. + * xlat/rtnl_tc_action_attrs.in: New file. + +2017-08-15 JingPiao Chen + + tests: check decoding of NETLINK_ROUTE tcmsg attributes. + * tests/nlattr_tcmsg.c: New file. + * tests/gen_tests.in (nlattr_tcmsg): New entry. + * tests/pure_executables.list: Add nlattr_tcmsg. + * tests/.gitignore: Likewise. + +2017-08-15 JingPiao Chen + Fabien Siron + + netlink: add basic decoding of NETLINK_ROUTE tcmsg attributes. + * rtnl_tc.c: Include "nlattr.h" and "xlat/rtnl_tc_attrs.h". + (decode_tcmsg): Call decode_nlattr. + * xlat/rtnl_tc_attrs.in: New file. + +2017-08-15 JingPiao Chen + + tests: check decoding of NETLINK_ROUTE ndtmsg attributes. + * tests/nlattr_ndtmsg.c: New file. + * tests/gen_tests.in (nlattr_ndtmsg): New entry. + * tests/pure_executables.list: Add nlattr_ndtmsg. + * tests/.gitignore: Likewise. + +2017-08-15 JingPiao Chen + Fabien Siron + + netlink: add basic decoding of NETLINK_ROUTE ndtmsg attributes. + * rtnl_neightbl.c: Include "nlattr.h" and "xlat/rtnl_neightbl_attrs.h". + (decode_ndtmsg): Call decode_nlattr. + * xlat/rtnl_neightbl_attrs.in: New file. + +2017-08-15 JingPiao Chen + + tests: check decoding of NETLINK_ROUTE ndmsg attributes. + * tests/nlattr_ndmsg.c: New file. + * tests/gen_tests.in (nlattr_ndmsg): New entry. + * tests/pure_executables.list: Add nlattr_ndmsg. + * tests/.gitignore: Likewise. + +2017-08-15 JingPiao Chen + Fabien Siron + + netlink: add basic decoding of NETLINK_ROUTE ndmsg attributes. + * rtnl_neigh.c: Include "nlattr.h" and "xlat/rtnl_neigh_attrs.h". + (decode_ndmsg): Call decode_nlattr. + * xlat/rtnl_neigh_attrs.in: New file. + +2017-08-15 JingPiao Chen + + tests: check decoding of NETLINK_ROUTE fib_rule_hdr attributes. + * tests/nlattr_fib_rule_hdr.c: New file. + * tests/gen_tests.in (nlattr_fib_rule_hdr): New entry. + * tests/pure_executables.list: Add nlattr_fib_rule_hdr. + * tests/.gitignore: Likewise. + +2017-08-15 JingPiao Chen + Fabien Siron + + netlink: add basic decoding of NETLINK_ROUTE fib_rule_hdr attributes. + * rtnl_rule.c: Include "nlattr.h" and "xlat/rtnl_rule_attrs.h". + (decode_fib_rule_hdr): Call decode_nlattr. + * xlat/rtnl_rule_attrs.in: New file. + +2017-08-15 JingPiao Chen + + tests: check decoding of NETLINK_ROUTE rtmsg attributes. + * tests/nlattr_rtmsg.c: New file. + * tests/gen_tests.in (nlattr_rtmsg): New entry. + * tests/pure_executables.list: Add nlattr_rtmsg. + * tests/.gitignore: Likewise. + +2017-08-15 JingPiao Chen + Fabien Siron + + netlink: add basic decoding of NETLINK_ROUTE rtmsg attributes. + * rtnl_route.c: Include "nlattr.h" and "xlat/rtnl_route_attrs.h". + (decode_rtmsg): Call decode_nlattr. + * xlat/rtnl_route_attrs.in: New file. + +2017-08-15 JingPiao Chen + + tests: check decoding of NETLINK_ROUTE ifaddrmsg attributes. + * tests/nlattr_ifaddrmsg.c: New file. + * tests/gen_tests.in (nlattr_ifaddrmsg): New entry. + * tests/pure_executables.list: Add nlattr_ifaddrmsg. + * tests/.gitignore: Likewise. + +2017-08-15 JingPiao Chen + Fabien Siron + + netlink: add basic decoding of NETLINK_ROUTE ifaddrmsg attributes. + * rtnl_addr.c: Include "nlattr.h" and "xlat/rtnl_addr_attrs.h". + (decode_ifaddrmsg): Call decode_nlattr. + * xlat/rtnl_addr_attrs.in: New file. + +2017-08-15 JingPiao Chen + + tests: check decoding of NETLINK_ROUTE ifinfomsg attributes. + * tests/nlattr_ifinfomsg.c: New file. + * tests/gen_tests.in (nlattr_ifinfomsg): New entry. + * tests/pure_executables.list: Add nlattr_ifinfomsg. + * tests/.gitignore: Likewise. + +2017-08-15 JingPiao Chen + Fabien Siron + + netlink: add basic decoding of NETLINK_ROUTE ifinfomsg attributes. + * rtnl_link.c: Include "nlattr.h" and "xlat/rtnl_link_attrs.h". + (decode_ifinfomsg): Call decode_nlattr. + * xlat/rtnl_link_attrs.in: New file. + +2017-08-15 Dmitry V. Levin + + tests/test_nlattr.h: include + * tests/test_nlattr.h: Include for definition of uint16_t + used by init_nlattr. + + tests: use ifindex_lo and IFINDEX_LO_STR. + * tests/netlink_route.c: Do not check for HAVE_IF_INDEXTONAME. + (if_nametoindex, IFINDEX_LO): Remove. + (test_rtnl_link, test_rtnl_addr, test_rtnl_neigh, test_rtnl_tc, + test_rtnl_addrlabel, test_rtnl_mdb): Use ifindex_lo instead + of if_nametoindex, use IFINDEX_LO_STR instead of hardcoded string. + * tests/netlink_sock_diag.c: Do not check for HAVE_IF_INDEXTONAME. + (if_nametoindex, IFINDEX_LO): Remove. + (test_inet_diag_sockid, test_inet_diag_req, test_inet_diag_req_v2, + test_inet_diag_msg, test_smc_diag_req): Use ifindex_lo instead + of if_nametoindex, use IFINDEX_LO_STR instead of hardcoded string. + * tests/nlattr_inet_diag_msg.c: Do not check for HAVE_IF_INDEXTONAME. + (if_nametoindex, IFINDEX_LO): Remove. + (init_inet_diag_msg): Use ifindex_lo instead of if_nametoindex. + (print_inet_diag_msg): Use IFINDEX_LO_STR instead of hardcoded string. + * tests/nlattr_inet_diag_req_compat.c: Do not check + for HAVE_IF_INDEXTONAME. + (if_nametoindex, IFINDEX_LO): Remove. + (init_inet_diag_req): Use ifindex_lo instead of if_nametoindex. + (print_inet_diag_req): Use IFINDEX_LO_STR instead of hardcoded string. + * tests/nlattr_inet_diag_req_v2.c: Do not check for HAVE_IF_INDEXTONAME. + (if_nametoindex, IFINDEX_LO): Remove. + (init_inet_diag_req_v2, print_inet_diag_req_v2, + test_inet_diag_bc_dev_cond): Use ifindex_lo instead of if_nametoindex, + use IFINDEX_LO_STR instead of hardcoded string. + * tests/nlattr_packet_diag_msg.c: Do not check for HAVE_IF_INDEXTONAME. + (if_nametoindex, IFINDEX_LO): Remove. + (main): Use ifindex_lo instead of if_nametoindex. + (print_packet_diag_mclist): Use IFINDEX_LO_STR instead of hardcoded + string. + + tests/net-sockaddr: use ifindex_lo and IFINDEX_LO_STR. + * tests/net-sockaddr.c (if_nametoindex): Remove declaration. + (check_in6_linklocal, check_ll): Remove HAVE_IF_INDEXTONAME checks, + Use ifindex_lo instead of if_nametoindex, use IFINDEX_LO_STR instead + of hardcoded string. + + tests/msg_control: use ifindex_lo and IFINDEX_LO_STR. + * tests/msg_control.c (test_ip_pktinfo): Use ifindex_lo instead + of if_nametoindex, use IFINDEX_LO_STR instead of hardcoded string. + + tests/inet-cmsg: use IFINDEX_LO_STR. + * tests/inet-cmsg.c (print_pktinfo): Use IFINDEX_LO_STR instead + of hardcoded string. + + tests/ip_mreq: use ifindex_lo and IFINDEX_LO_STR. + * tests/ip_mreq.c: Do not check for HAVE_IF_INDEXTONAME. + (main): Use ifindex_lo instead of if_nametoindex, use IFINDEX_LO_STR + instead of hardcoded string. + + tests/group_req: use ifindex_lo and IFINDEX_LO_STR. + * tests/group_req.c: Do not check for HAVE_IF_INDEXTONAME. + (main): Use ifindex_lo instead of if_nametoindex, use IFINDEX_LO_STR + instead of hardcoded string. + + tests: add ifindex_lo function and IFINDEX_LO_STR macro to libtests. + * tests/ifindex.c: New file. + * tests/Makefile.am (libtests_a_SOURCES): Add it. + * tests/tests.h (ifindex_lo): New prototype. + (IFINDEX_LO_STR): New macro. + +2017-08-15 JingPiao Chen + + configure.ac: remove redundant linux/dcbnl.h header check. + * configure.ac (AC_CHECK_HEADERS): Remove linux/dcbnl.h. + * rtnl_dcb.c: Replace HAVE_LINUX_DCBNL_H with HAVE_STRUCT_DCBMSG. + * tests/netlink_route.c: Likewise. + +2017-08-14 Eugene Syromyatnikov + + pathtrace: fix typo in comment. + + pathtrace: limit amount of checked poll fds similarly to select limit. + * pathtrace.c (pathtrace_match_set): Limit the maximum descriptor number + checked for fd match in poll family syscalls to 1024 * 1024. + + pathtrace: fail poll path match on first failed umove. + * pathtrace.c (pathtrace_match_set): When checking descriptors of poll + family syscalls for fd match, break the loop on first failed umove call. + +2017-08-14 JingPiao Chen + + Update NEWS. + +2017-08-14 JingPiao Chen + Fabien Siron + + tests: check decoding of rtnetlink nsid messages. + * tests/netlink_route.c (test_rtnl_nsid): New function. + (main): Use it. + + netlink: add a basic rtnetlink parser of nsid messages. + * rtnl_nsid.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * netlink_route.h (decode_rtgenmsg): New prototype. + * netlink_route.c (route_decoders): Add RTM_DELNSID, RTM_GETNSID, + and RTM_NEWNSID. + + tests: check decoding of rtnetlink mdb messages. + * tests/netlink_route.c: Include + and . + (test_rtnl_mdb): New function. + (main): Use it. + + netlink: add a basic rtnetlink parser of mdb messages. + * rtnl_mdb.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * netlink_route.h (decode_br_port_msg): New prototype. + * configure.ac (AC_CHECK_TYPES): Check for struct br_port_msg + in . + * netlink_route.c (route_decoders): Add RTM_DELMDB, RTM_GETMDB, + and RTM_NEWMDB. + + tests: check decoding of rtnetlink netconf messages. + * tests/netlink_route.c: Include . + (test_rtnl_netconf): New function. + (main): Use it. + + netlink: add a basic rtnetlink parser of netconf messages. + * rtnl_netconf.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * netlink_route.h (decode_netconfmsg): New prototype. + * configure.ac (AC_CHECK_TYPES): Check for struct netconfmsg + in . + * netlink_route.c (route_decoders): Add RTM_GETNETCONF + and RTM_NEWNETCONF. + + tests: check decoding of rtnetlink dcb messages. + * tests/netlink_route.c: Include . + (test_rtnl_dcb): New function. + (main): Use it. + + netlink: add a basic rtnetlink parser of dcb messages. + * rtnl_dcb.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * netlink_route.h (decode_dcbmsg): New prototype. + * configure.ac (AC_CHECK_HEADERS): Add linux/dcbnl.h. + (AC_CHECK_TYPES): Check for struct dcbmsg in . + * netlink_route.c (route_decoders): Add RTM_GETDCB and RTM_SETDCB. + * xlat/dcb_commands.in: New file. + + tests: check decoding of rtnetlink addrlabel messages. + * tests/netlink_route.c: Include . + (test_rtnl_addrlabel): New function. + (main): Use it. + + netlink: add a basic rtnetlink parser of addrlabel messages. + * rtnl_addrlabel.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * netlink_route.h (decode_ifaddrlblmsg): New prototype. + * configure.ac (AC_CHECK_TYPES): Check for struct ifaddrlblmsg + in . + * netlink_route.c (route_decoders): Add RTM_DELADDRLABEL, + RTM_GETADDRLABEL, and RTM_NEWADDRLABEL. + + tests: check decoding of rtnetlink tc action messages. + * tests/netlink_route.c (test_rtnl_tca): New function. + (main): Use it. + + netlink: add a basic rtnetlink parser of tc action messages. + * rtnl_tc_action.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * netlink_route.h (decode_tcamsg): New prototype. + * netlink_route.c (route_decoders): Add RTM_DELACTION, RTM_GETACTION, + and RTM_NEWACTION. + + tests: check decoding of rtnetlink tc messages. + * tests/netlink_route.c (test_rtnl_tc): New function. + (main): Use it. + + netlink: add a basic rtnetlink parser of tc messages. + * rtnl_tc.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * netlink_route.h (decode_tcmsg): New prototype. + * netlink_route.c (route_decoders): Add RTM_DELQDISC, + RTM_GETQDISC, RTM_NEWQDISC, RTM_DELTCLASS, RTM_GETTCLASS, + RTM_NEWTCLASS, RTM_DELTFILTER, RTM_GETTFILTER, and RTM_NEWTFILTER. + + tests: check decoding of rtnetlink neightbl messages. + * tests/netlink_route.c (test_rtnl_neightbl): New function. + (main): Use it. + + netlink: add a basic rtnetlink parser of neightbl messages. + * rtnl_neightbl.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * netlink_route.h (decode_ndtmsg): New prototype. + * netlink_route.c (route_decoders): Add RTM_GETNEIGHTBL, + RTM_NEWNEIGHTBL, and RTM_SETNEIGHTBL. + + tests: check decoding of rtnetlink neigh messages. + * tests/netlink_route.c: Include . + (test_rtnl_neigh): New function. + (main): Use it. + + netlink: add a basic rtnetlink parser of neigh messages. + * rtnl_neigh.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * netlink_route.h (decode_ndmsg, decode_rtm_getneigh): New prototypes. + * configure.ac (AC_CHECK_HEADERS): Add linux/neighbour.h. + * netlink_route.c (route_decoders): Add RTM_DELNEIGH, RTM_DELNEIGH, + and RTM_NEWNEIGH. + * xlat/nda_types.in: New file. + * xlat/neighbor_cache_entry_flags.in: Likewise. + * xlat/neighbor_cache_entry_states.in: Likewise. + + tests: check decoding of rtnetlink rule messages. + * tests/netlink_route.c: Include . + (test_rtnl_rule): New function. + (main): Use it. + + netlink: add a basic rtnetlink parser of rule messages. + * defs.h (routing_table_ids): New xlat prototype. + * rtnl_rule.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * defs.h (ip_type_of_services, routing_table_ids): New xlat prototypes. + * netlink_route.h (decode_fib_rule_hdr): New prototype. + * configure.ac (AC_CHECK_HEADERS): Add linux/fib_rules.h. + * netlink_route.c (route_decoders): Add RTM_DELRULE, RTM_GETRULE, + and RTM_NEWRULE. + * xlat/fib_rule_actions.in: New file. + * xlat/fib_rule_flags.in: Likewise. + + tests: check decoding of rtnetlink route messages. + * tests/netlink_route.c: Include . + (test_rtnl_route): New function. + (main): Use it. + + netlink: add a basic rtnetlink parser of route messages. + * defs.h (routing_scopes): New xlat prototype. + * rtnl_route.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * netlink_route.h (decode_rtmsg): New prototype. + * netlink_route.c (route_decoders): Add RTM_DELROUTE, RTM_GETROUTE, + and RTM_NEWROUTE. + * xlat/ip_type_of_services.in: New file. + * xlat/routing_flags.in: Likewise. + * xlat/routing_protocols.in: Likewise. + * xlat/routing_table_ids.in: Likewise. + * xlat/routing_types.in: Likewise. + + tests: check decoding of rtnetlink addr messages. + * tests/netlink_route.c: Include . + (test_rtnl_addr): New function. + (main): Use it. + +2017-08-13 JingPiao Chen + Fabien Siron + + netlink: add a basic rtnetlink parser of addr messages. + * rtnl_addr.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * configure.ac (AC_CHECK_HEADERS): Add linux/if_addr.h. + * netlink_route.h (decode_ifaddrmsg): New prototype. + * netlink_route.c (route_decoders): Add RTM_DELADDR, + RTM_GETADDR, RTM_GETANYCAST, RTM_GETMULTICAST, and RTM_NEWADDR. + * xlat/ifaddrflags.in: New file. + * xlat/routing_scopes.in: Likewise. + +2017-08-13 Eugene Syromyatnikov + + Make description of discrepancies between libc and kernel APIs more relevant + Looks like this part was untouched since the days strace supported OSes + other than Linux. Well, it's time to make it more contemporary. + + * strace.1.in (.SH NOTES): Use faccessat(2) and setrlimit(2)/prlimit(2) + instead of time(2) and stat(2)/xstat(2) as examples of libc/kernel API + discrepancies. + +2017-08-11 JingPiao Chen + + tests: check decoding of NLMSG_DONE messages of NETLINK_ROUTE. + * tests/netlink_route.c (test_nlmsg_done): New function. + (main): Use it. + +2017-08-11 Nikolay Marchuk + + Add TF flag to inotify_add_watch syscall entries. + The second argument of the inotify_add_watch syscall is a file name, + but inotify_add_watch has no TF flag set. + + * linux/32/syscallent.h (inotify_add_watch): Add TF flag. + * linux/64/syscallent.h: Likewise. + * linux/alpha/syscallent.h: Likewise. + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/crisv10/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + +2017-08-11 Nikolay Marchuk + + pathtrace: fix matching of execveat syscall. + * pathtrace.c (pathtrace_match_set): Add testing of SEN_execveat. + +2017-08-10 Eugene Syromyatnikov + + strace.1: add indentation to examples. + * strace.1 (.de CW): Add .in +4n. + (.de CE): Add .in. + + Generate date for the man page. + * Makefile.am (dist-hook): Add .strace.1.in.date generation. + * strace.spec.in (%setup): Likewise. + * configure.ac (manpage_date): New m4 define. + (MANPAGE_DATE): New define/subst. + * strace.1 (.TH): Add manpage date and strace's version. + + Add script for generating date of the last commit for specific file. + * file-date-gen: New auxiliary script. + + Make strace.1 generated. + * .gitignore (/strace.1): New entry. + * configure.ac (AC_CONFIG_FILES): Add strace.1. + * strace.1.in: Rename from strace.1. + +2017-08-10 Eugene Syromyatnikov + + strace.1: format synopsis using .SY/.OP macros. + Also, add .OM and .OR macros and use { ... | ... } syntax for indicating + possible options regarding mandatory arguments. + + * strace.1 (.OM, .OR): New macro definitions, based on .OP + (.SH SYNOPSYS): Format using .SY/.OP/.OM/.OR. Put -p/command inside + { ... | ... } block. + +2017-08-10 Eugene Syromyatnikov + + strace.1: remove date from .TH, as it is no longer relevant. + * strace.1 (.TH): Remove date. + +2017-08-10 Eugene Syromyatnikov + + strace.1: remove .IX definition. + It is present in groff macros nowadays. + + * strace.1 (.de IX): Remove. + +2017-08-10 Eugene Syromyatnikov + + strace.1: replace .TP with .TQ between command-line option variants. + In order to eliminate unneeded space between them. + + * strace.1 (Filtering): Replace .TP with .TQ between different variants + of the same option. + +2017-08-09 Dmitry V. Levin + + rtnl_link: include "netlink.h" before + has to be included before because + the latter used to be incomplete in older kernel headers. + + As a local wrapper file called netlink.h was introduced earlier + to workaround this and related portability issues, include it before + that in turn includes . + + This fixes build on systems with older kernel headers. + + * rtnl_link.c: Include "netlink.h" before . + +2017-08-09 JingPiao Chen + Fabien Siron + + tests: check decoding of rtnetlink link messages. + * tests/netlink_route.c: Include . + (TEST_NL_ROUTE): New macro. + (test_rtnl_link): New function. + (main): Use it. + + netlink: add a basic rtnetlink parser of link messages. + * netlink_route.h: New file. + * rtnl_link.c: Likewise. + * Makefile.am (strace_SOURCES): Add them. + * defs.h (arp_hardware_types, iffflags): New xlat prototypes. + * netlink_route.c: Include "netlink_route.h" + and . + (netlink_route_decoder_t): New typedef. + (route_decoders): New array. + (decode_netlink_route): Use it. + +2017-08-09 JingPiao Chen + + Move nl_route_types definition from netlink.c to netlink_route.c. + The side effect of #include "xlat/nl_route_types.h" is + RTM_* constants properly defined in that header file. + While netlink.c does not use these constants itself, + netlink_route.c is going to need them soon. + + * defs.h (nl_route_types): New xlat prototype. + * netlink.c: Move inclusion of "xlat/nl_route_types.h" ... + * netlink_route.c: ... here. + +2017-08-09 JingPiao Chen + Fabien Siron + + tests: check netlink family specific decoder of NETLINK_ROUTE. + * tests/netlink_route.c: Include , + include "test_netlink.h" instead of "netlink.h". + (test_rtnl_unspec): New function. + (main): Use it. + + netlink: introduce family specific decoder of NETLINK_ROUTE. + * netlink_route.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * defs.h (decode_netlink_route): New prototype. + * netlink.c (netlink_decoders): Add NETLINK_ROUTE. + +2017-08-08 JingPiao Chen + Dmitry V. Levin + + tests: check decoding of NETLINK_KOBJECT_UEVENT messages. + * tests/netlink_kobject_uevent.c: New file. + * tests/gen_tests.in (netlink_kobject_uevent): New entry. + * tests/pure_executables.list: Add netlink_kobject_uevent. + * tests/.gitignore: Likewise. + +2017-08-08 JingPiao Chen + + netlink: add decoding of NETLINK_KOBJECT_UEVENT messages. + * netlink.c (decode_netlink): Print NETLINK_KOBJECT_UEVENT messages + as a string using printstrn. + +2017-08-08 JingPiao Chen + + netlink: call get_fd_nl_family before nlmsghdr decoding. + Prepare for decoding of NETLINK_KOBJECT_UEVENT. Messages of the latter, + unlike traditional netlink families, don't contain a header at all. + + * netlink.c (NL_FAMILY_*): Remove enum. + (get_fd_nl_family): Replace NL_FAMILY_ERROR with -1. + (decode_nlmsg_type): Update the comment. + Skip family specific type decoders for type < NLMSG_MIN_TYPE. + (decode_nlmsghdr_with_payload): Skip family specific decoders + for type < NLMSG_MIN_TYPE && type != NLMSG_DONE. + (print_nlmsghdr): Move get_fd_nl_family invocation ... + (decode_nlmsghdr_with_payload): ... here. + +2017-08-07 Dmitry V. Levin + + Make sysent_shorthand_defs.h suitable for tests. + * sysent_shorthand_defs.h [STRACE_TESTS_H]: Add shorthand notations from + tests/ksysent.c and tests/nsyscalls.c. + * tests/ksysent.c: Remove shorthand notations. + * tests/nsyscalls.c: Likewise. + +2017-08-07 Edgar Kaziakhmedov + + Move sysent shorthand notations to separate files. + Avoid proliferation of exactly the same definitions of shorthand + notations for macros defined in sysent.h by moving definitions + and undefs of these shorthand notations to separate files. + + * sysent_shorthand_defs.h: New file. + * sysent_shorthand_undefs.h: Likewise. + * Makefile.am (strace_SOURCES): Add them. + * syscall.c: Use them. + +2017-08-07 JingPiao Chen + + netlink.c: fix indentation. + * netlink.c (print_cookie): Fix indentation. + +2017-08-07 Edgar Kaziakhmedov + + Move err/mem subroutines to separate files. + In order to allow usage of utility functions by other binaries + included in the strace package (like the upcoming asinfo utility), + these functions should be moved to separate files. + + * error_prints.h: New file. + * xmalloc.h: Likewise. + * defs.h: Include "xmalloc.h" and "error_prints.h". + (error_msg, error_msg_and_die, error_msg_and_help, perror_msg, + perror_msg_and_die): Move to error_prints.h. + (xcalloc, xmalloc, xreallocarray, xstrdup, xstrndup): Move to xmalloc.h. + * strace.c (die): Remove static quialifier to make visible + by error_prints.c. + (error_msg, error_msg_and_die, error_msg_and_help, perror_msg, + perror_msg_and_die, verror_msg): Move ... + * error_prints.c: ... to the new file. + * xmalloc.c: Include "config.h", , , + "error_prints.h", and "xmalloc.h" instead of "defs.h". + Use int instead of bool. Fix codestyle. + * Makefile.am (strace_SOURCES): Add error_prints.c, error_prints.h, + and xmalloc.h. + +2017-08-07 Nikolay Marchuk + + tests: move check_* functions from options-syntax.test to separate file. + * tests/options-syntax.test: Move check_* functions to ... + * tests/syntax.sh: ... new file. + * tests/Makefile.am (EXTRA_DIST): Add syntax.sh. + +2017-08-07 Nikolay Marchuk + + Split qualify.c into basic_filters.c and filter_qualify.c. + This change also exports add_number_to_set, qualify_tokens, + and qualify_syscall_tokens. + + * basic_filters.c: New file, part of qualify.c. + * filter_qualify.c: Likewise. + * filter.h: New file. + * qualify.c: Remove. + * Makefile.am (strace_SOURCES): Add new files, remove qualify.c. + +2017-08-06 Dmitry V. Levin + + Simplify handling of unexpected tracees. + * strace.c (maybe_allocate_tcb) : + Remove the dance around possible re-injection of WSTOPSIG(status) + as the only observable stop here is the initial ptrace-stop. + + Fix handling of unexpected tracees when PTRACE_SEIZE is not in use. + * strace.c (maybe_allocate_tcb) : + The expected ptrace stop signal in case of !use seize is not + syscall_trap_sig but SIGSTOP. An idea of using PTRACE_GETSIGINFO to + distinguish signal stops that should be re-injected from other kinds + of stops didn't work out due to kernel implementation peculiarities + of initial ptrace-stop. + + pathtrace: fix matching of symlinkat syscall. + * pathtrace.c (pathtrace_match_set) : The first argument + of symlinkat syscall is not a path but an arbitrary string, ignore it. + +2017-08-06 Nikolay Marchuk + + pathtrace: fix missing syscalls. + * pathtrace.c (pathtrace_match_set): Fix symlink decoding, + disable pathtracing for inotify_init. + +2017-08-06 Dmitry V. Levin + + Enhance fflush error diagnostics. + * strace.c (flush_tcp_output): New function. + (line_ended, droptcb, print_event_exit): Use it to flush tcp->outf. + * tests/fflush.c: New file. + * tests/fflush.test: New test. + * tests/Makefile.am (MISC_TESTS): Add it. + * tests/.gitignore: Add fflush. + * tests/pure_executables.list: Likewise. + + tests: check handling of CLONE_PARENT'ed and CLONE_PTRACE'ed processes. + * tests/clone_parent.c: New file. + * tests/clone_ptrace.c: Likewise. + * tests/clone_parent.test: New test. + * tests/clone_ptrace.test: Likewise. + * tests/.gitignore: Add clone_parent and clone_ptrace. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (MISC_TESTS): Add clone_parent.test and clone_ptrace.test. + + tests: export a path to the trace executable to check_PROGRAMS. + * tests/init.sh (STRACE_EXE): Initialize from $STRACE and export. + +2017-08-05 Eugene Syromyatnikov + + Makefile.am: build top directory first. + This solves potential issues when tests run first and strace is rebuilt + only after they have finished. As noted in [1], providing the current + directory explicitly should help. + + [1] https://www.gnu.org/software/automake/manual/html_node/Subdirectories.html + + * Makefile.am (SUBDIRS): Prepend the current directory. + +2017-08-05 Eugene Syromyatnikov + + Improve handling of unexpected tracees. + When receiving a ptrace stop of an unexpected child, handle it + in the most transparent way possible: + - detach it instead of PTRACE_CONT'ing; + - send it the signal with which it has been stopped. + This should hopefully help to deal with processes that have been created + with misused CLONE_PTRACE flag set. + + * strace.c (maybe_allocate_tcb) : + Calculate the signal similarly to the way next_event does, + forward it to the unexpected tracee, and detach the tracee. + +2017-08-04 Dmitry V. Levin + + tests: fix unaligned access in nlattr.test. + * tests/nlattr.c (test_nlattr): Use SET_STRUCT + to initialize potentially unaligned struct nlattr. + + tests: fix unaligned access in nlattr_packet_diag_msg.test. + * tests/nlattr_packet_diag_msg.c (init_packet_diag_msg): Use SET_STRUCT + to initialize potentially unaligned struct packet_diag_msg. + +2017-08-04 Dmitry V. Levin + + sparc64: do not bail out in get_scno if PTRACE_PEEKTEXT fails. + If the kernel contains commit 84d77d3f06e7e8dea057d10e8ec77ad71f721be3, + PTRACE_PEEKTEXT becames unavailable when the process dumpable flag is + cleared. As this is not a fatal condition for get_scno, do not bail out + if PTRACE_PEEKTEXT fails. + + This condition is triggered and therefore tested by prctl-dumpable test. + + * linux/sparc64/get_scno.c (arch_get_scno): Do not bail out + if PTRACE_PEEKTEXT fails. + +2017-08-02 Dmitry V. Levin + + tests: enhance test coverage of printstrn and umoven. + * tests/printstrn-umoven.c: New file. + * tests/printstrn-umoven-peekdata.c: Likewise. + * tests/printstrn-umoven-undumpable.c: Likewise. + * tests/printstrn-umoven-legacy.test: New test. + * tests/Makefile.am (MISC_TESTS): Add printstrn-umoven-legacy.test. + * tests/gen_tests.in (printstrn-umoven, printstrn-umoven-peekdata, + printstrn-umoven-undumpable): New entries. + * tests/pure_executables.list: Add printstrn-umoven, + printstrn-umoven-peekdata, and printstrn-umoven-undumpable. + * tests/.gitignore: Likewise. + + tests: add test_printstrn function to libtests. + * tests/test_ucopy.h (test_printstrn): New prototype. + * tests/test_printstrn.c: New file. + * tests/Makefile.am (libtests_a_SOURCES): Add it. + +2017-08-01 Dmitry V. Levin + + tests: enhance test coverage of printpath and umovestr. + * tests/init.sh (TIMEOUT_DURATION): Raise from 300 to 600. + * tests/printpath-umovestr.c: New file. + * tests/printpath-umovestr-peekdata.c: Likewise. + * tests/printpath-umovestr-undumpable.c: Likewise. + * tests/printpath-umovestr-legacy.test: New test. + * tests/Makefile.am (MISC_TESTS): Add printpath-umovestr-legacy.test. + * tests/gen_tests.in (printpath-umovestr, printpath-umovestr-peekdata, + printpath-umovestr-undumpable): New entries. + * tests/pure_executables.list: Add printpath-umovestr, + printpath-umovestr-peekdata, and printpath-umovestr-undumpable. + * tests/.gitignore: Likewise. + + tests: add test_printpath function to libtests. + * tests/test_ucopy.h (test_printpath): New prototype. + * tests/test_printpath.c: New file. + * tests/Makefile.am (libtests_a_SOURCES): Add it. + + tests: add test_process_vm_readv and test_ptrace_peekdata to libtests. + * tests/test_ucopy.c: New file. + * tests/test_ucopy.h: Likewise. + * tests/Makefile.am (libtests_a_SOURCES): Add them. + +2017-08-01 Dmitry V. Levin + + printpath: do not fetch more than PATH_MAX bytes from tracee's memory. + The kernel does not copy more than PATH_MAX bytes from userspace + pathnames, treating non-NUL-terminated pathnames as ENAMETOOLONG. + + * util.c (printpathn): Decrease buffer size to PATH_MAX. + (printpath): Specify PATH_MAX - 1 as the maximum pathname length + to match the kernel behaviour. The underlying umovestr call will fetch + up to PATH_MAX bytes from tracee's memory, but no more than first + PATH_MAX - 1 bytes will be printed. + +2017-07-31 Dmitry V. Levin + + ucopy: cleanup umoven_peekdata and umovestr_peekdata. + * ucopy.c (umoven_peekdata, umovestr_peekdata): Merge aligned + and unaligned tracee address cases. + +2017-07-31 Dmitry V. Levin + + ucopy: move legacy fallbacks of umoven and umovestr to separate functions + Move legacy PTRACE_PEEKDATA-based support to separate functions. + + * ucopy.c (umoven_peekdata, umovestr_peekdata): New functions. + (umoven, umovestr): Use them. + +2017-07-31 Dmitry V. Levin + + ucopy: move process_vm_readv ENOSYS check to vm_read_mem. + * ucopy.c (vm_read_mem): Set process_vm_readv_not_supported in case + of ENOSYS. + * ucopy.c (umoven, umovestr): Do not set process_vm_readv_not_supported. + +2017-07-31 Eugene Syromyatnikov + + Print enabled optional features in strace version output. + In order to provide information to user what optionally built features + are available. + + * strace.c (print_version): New variable "features". Print features string + after non-liability disclaimer (or "(none)" in case it is empty). + (print_version) [USE_LIBUNWIND]: Concatenate "stack-unwind" into features + string. + * tests/strace-V.tests (getoption): New function. + Update check in accordance with updated output. + +2017-07-31 Eugene Syromyatnikov + + tests/strace-V.test: rename getval to getstr. + As this name is more suitable. + + * tests/strace-V (getval): Rename to getstr, update all call sites. + +2017-07-30 Dmitry V. Levin + + ucopy: refactor the check for invalid tracee addresses. + * ucopy.c (tracee_addr_is_invalid): New function. + * ucopy.c (umoven, umovestr): Use it. + + ucopy: enhance vm_read_mem error diagnostics. + * ucopy.c (umoven, umovestr): Enhance vm_read_mem error diagnostics + to match PTRACE_PEEKDATA case. + +2017-07-29 Dmitry V. Levin + + ucopy: skip redundant tracee address truncation check. + * ucopy.c (vm_read_mem): Skip raddr != truncated_raddr check + if these variables have the same data size. + +2017-07-28 Dmitry V. Levin + + util: move umoven and umovestr to a separate file. + These functions are more kernel-specific compared to all other functions + defined in util.c. + + * ucopy.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * util.c (umoven, umovestr): Move to ucopy.c. + +2017-07-27 Dmitry V. Levin + + bpf: enhance decoding of BPF_MAP_LOOKUP_ELEM and BPF_MAP_GET_NEXT_KEY. + Print union bpf_attr.value field of BPF_MAP_LOOKUP_ELEM command + and union bpf_attr.next_key field of BPF_MAP_GET_NEXT_KEY command + on entering syscall. These fields are addresses specified to the + kernel from userspace. The amount of data written by the kernel + to these addresses is specified at the map creation time + by BPF_MAP_CREATE command and is not available at this point. + + * bpf.c (decode_BPF_MAP_LOOKUP_ELEM): Print union bpf_attr.value + on entering syscall. + (decode_BPF_MAP_GET_NEXT_KEY): Print union bpf_attr.next_key + on entering syscall. + (bpf_map_io): Remove. + * tests/bpf.c (print_BPF_MAP_DELETE_ELEM_first, + print_BPF_MAP_DELETE_ELEM_attr, print_BPF_MAP_GET_NEXT_KEY_first, + print_BPF_MAP_GET_NEXT_KEY_attr): Replace macro redirects with + new functions. + (print_BPF_MAP_LOOKUP_ELEM_first, print_BPF_MAP_LOOKUP_ELEM_attr, + +2017-07-27 Dmitry V. Levin + + bpf: update BPF_MAP_CREATE decoding. + Implement decoding of map_flags and inner_map_fd fields of union bpf_attr + for BPF_MAP_CREATE command introduced by linux kernel commits + v4.6-rc1~91^2~108^2~6 and v4.12-rc1~64^3~373^2~2, respectively. + + * configure.ac: Check for inner_map_fd member of union bpf_attr + instead of max_entries. + * xlat/bpf_map_flags.in: New file. + * bpf.c: Include "xlat/bpf_map_flags.h". + (decode_BPF_MAP_CREATE): Add map_flags and inner_map_fd fields + to the structure, print them. + * tests/bpf.c: Update macro guards of BPF_MAP_CREATE decoder test. + (init_BPF_MAP_CREATE_first, print_BPF_MAP_CREATE_attr): Update expected + output. + (init_BPF_MAP_CREATE_attr): Initialize map_flags and inner_map_fd + fields, update offset. + +2017-07-27 Dmitry V. Levin + + bpf: update BPF_PROG_LOAD decoding. + Implement decoding of union bpf_attr.prog_flags field for BPF_PROG_LOAD + command introduced by linux kernel commit v4.12-rc2~34^2~29^2~2. + + * configure.ac: Check for prog_flags member of union bpf_attr + instead of kern_version. + * xlat/bpf_prog_flags.in: New file. + * bpf.c: Include "xlat/bpf_prog_flags.h". + (decode_BPF_PROG_LOAD): Add prog_flags field to the structure, print it. + * tests/bpf.c: Update macro guards of BPF_PROG_LOAD decoder test. + (init_BPF_PROG_LOAD_first, print_BPF_PROG_LOAD_attr): Update expected + output. + (init_BPF_PROG_LOAD_attr): Initialize prog_flags field, update offset. + +2017-07-26 Dmitry V. Levin + + tests: enhance test coverage of bpf syscall parser. + * configure.ac: Update union bpf_attr member checks. + * tests/bpf.c: Rewrite. + * tests/bpf-v.c: New file. + * tests/gen_tests.in (bpf-v): New entry. + * tests/pure_executables.list: Add bpf-v. + * tests/.gitignore: Likewise. + + m4: macroize union bpf_attr field checks. + * m4/st_bpf.m4: New file. + * configure.ac: Use st_CHECK_UNION_BPF_ATTR. + + Move offsetofend from defs.h to macros.h. + * defs.h (offsetofend): Move ... + * macros.h: ... here. + +2017-07-26 Dmitry V. Levin + + bpf: print unused fields of union bpf_attr if one of them is non-zero. + When the size argument specifies more data than necessary for the given + command, kernel checks that all unused fields of union bpf_attr are + zero. Print this extra data when it contains non-zero bytes to enhance + debugging experience. + + * bpf.c (decode_attr_extra_data): New function. + (decode_BPF_MAP_CREATE, decode_BPF_MAP_UPDATE_ELEM, + decode_BPF_MAP_DELETE_ELEM, bpf_map_io, decode_BPF_PROG_LOAD, + decode_BPF_OBJ_PIN, decode_BPF_OBJ_GET, decode_BPF_PROG_ATTACH, + decode_BPF_PROG_DETACH): Use it to print extra data passed + via bpf_attr pointer. + (bpf_obj_manage, bpf_prog_attach_detach): Remove. + * tests/bpf.c (map_delete_elem): New function. + (main): Use it. + +2017-07-26 Dmitry V. Levin + + bpf: change handling of big and unaccessible data to match the kernel. + When the size argument exceeds PAGE_SIZE, the kernel fails with E2BIG + without parsing union bpf_attr. + When the whole chunk of memory specified by addr and size arguments is + not readable, the kernel fails with EFAULT. + + * bpf.c (DECL_BPF_CMD_DECODER) : Add const qualifier + to size argument, add data argument. + (decode_BPF_MAP_CREATE, decode_BPF_MAP_UPDATE_ELEM, + decode_BPF_MAP_DELETE_ELEM, bpf_map_io, decode_BPF_PROG_LOAD, + bpf_obj_manage, bpf_prog_attach_detach): Move size argument check and + memory fetching ... + (SYS_FUNC(bpf)) ... here, add PAGE_SIZE check, pass fetched memory + to command-specific parsers. + +2017-07-25 Dmitry V. Levin + + bpf: replace big switch statement with a dispatch table. + * bpf.c (DECL_BPF_CMD_DECODER, DEF_BPF_CMD_DECODER, BPF_CMD_ENTRY): + New macros. + (bpf_cmd_decoder_t): New typedef. + Rename static parser functions using DEF_BPF_CMD_DECODER. + (decode_BPF_MAP_LOOKUP_ELEM, decode_BPF_MAP_GET_NEXT_KEY): New proxy + functions. + (SYS_FUNC(bpf)): Replace big switch statement with a dispatch table. + + bpf: use PRINT_FIELD_* macros. + * print_fields.h (PRINT_FIELD_STR, PRINT_FIELD_PATH): New macros. + * bpf.c: Include "print_fields.h". + (bpf_map_create): Use PRINT_FIELD_U and PRINT_FIELD_XVAL. + (bpf_map_update_elem): Use PRINT_FIELD_FD, PRINT_FIELD_X, and + PRINT_FIELD_XVAL. + (bpf_map_delete_elem, bpf_map_io): Use PRINT_FIELD_FD and PRINT_FIELD_X. + (bpf_prog_load): Use PRINT_FIELD_STR, PRINT_FIELD_U, PRINT_FIELD_X, + and PRINT_FIELD_XVAL. + (bpf_obj_manage): Use PRINT_FIELD_FD and PRINT_FIELD_PATH. + (bpf_prog_attach_detach): Use PRINT_FIELD_FD, PRINT_FIELD_FLAGS, + and PRINT_FIELD_XVAL. + +2017-07-25 Eugene Syromyatnikov + + Add terminating comment after each DECL_* macro definition. + In an attempt to improve readability. + + * defs.h (DECL_IOCTL, DECL_NETLINK, DECL_PRINTNUM, DECL_PRINTNUM_ADDR, + ATTRIBUTE_FORMAT): Add comment that marks end of macro definition. + * netlink_sock_diag (DECL_NETLINK_DIAG_DECODER): Likewise. + * nlattr.h (DECL_NLA): Likewise. + +2017-07-24 Dmitry V. Levin + + Introduce print_quoted_cstring. + In many places where kernel expects a NUL-terminated string of length + up to a known fixed limit, e.g. when a NUL-terminated string is + a fixed-size field of a structure, strace does not print the last byte + assuming it is NUL, which is not always the case. + + Change output format for such strings to distinguish NUL-terminated + strings from non-NUL-terminated ones: append ellipsis to the output + when the string is not NUL-terminated. + + * defs.h (print_quoted_cstring): New prototype. + * util.c (print_quoted_cstring): New function. + (printpathn): Use it instead of print_quoted_string with + QUOTE_0_TERMINATED argument. + * print_fields.h (PRINT_FIELD_CSTRING): Likewise. + * btrfs.c (btrfs_ioctl): Likewise. + * dirent.c (SYS_FUNC(getdents)): Likewise. + * dirent64.c (SYS_FUNC(getdents64)): Likewise. + * print_ifindex.c (print_ifindex): Likewise. + * sysmips.c (SYS_FUNC(sysmips)): Likewise. + * ubi.c (ubi_ioctl): Likewise. + * tests/tests.h (print_quoted_cstring): New prototype. + * tests/print_quoted_string.c (print_quoted_cstring): New function. + * tests/ioctl_block.c (main): Update expected output. + * tests/ioctl_dm.c (main): Likewise. + * tests/ioctl_loop.c (print_loop_info, print_loop_info64): Likewise. + * tests/netlink_crypto.c (test_crypto_msg_newalg): Likewise. + +2017-07-24 JingPiao Chen + + tests: check decoding of NETLINK_CRYPTO crypto_user_alg attributes. + * tests/nlattr_crypto_user_alg.c: New file. + * tests/gen_tests.in (nlattr_crypto_user_alg): New entry. + * tests/pure_executables.list: Add nlattr_crypto_user_alg. + * tests/.gitignore: Likewise. + + tests: extend TEST_NLATTR_OBJECT macro. + * tests/test_nlattr.h (TEST_NLATTR_OBJECT_EX_, + TEST_NLATTR_OBJECT_EX): New macros. + (TEST_NLATTR_OBJECT): Use TEST_NLATTR_OBJECT_EX_. + + netlink: decode NETLINK_CRYPTO crypto_user_alg netlink attributes. + * configure.ac (AC_CHECK_TYPES): Check for crypto_report_aead, + crypto_report_blkcipher, crypto_report_cipher, crypto_report_hash, + and crypto_report_rng structures in . + * netlink_crypto.c (decode_crypto_report_generic, + decode_crypto_report_hash, decode_crypto_report_blkcipher, + decode_crypto_report_aead, decode_crypto_report_rng, + decode_crypto_report_cipher): New functions. + (crypto_user_alg_nla_decoders): New array. + (decode_crypto_user_alg): Use it. + * xlat/crypto_nl_attrs.in: New file. + * NEWS: Mention this. + + tests: check decoding of NETLINK_CRYPTO messages. + * tests/netlink_crypto.c: Include "test_netlink.h" + instead of "netlink.h". + (test_crypto_msg_newalg, test_crypto_msg_unspec): New functions. + (main): Use them. + +2017-07-24 JingPiao Chen + + tests: extend TEST_NETLINK_OBJECT macro. + As the first field of NETLINK_CRYPTO messages is a string, print + unrecognized data as a string. Extend TEST_NETLINK_OBJECT macro + to test this case. + + * tests/test_netlink.h (TEST_NETLINK_OBJECT_EX_, + TEST_NETLINK_OBJECT_EX): New macros. + (TEST_NETLINK_OBJECT): Use TEST_NETLINK_OBJECT_EX_. + +2017-07-24 JingPiao Chen + + netlink: add a basic parser of NETLINK_CRYPTO messages. + * netlink_crypto.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * defs.h (decode_netlink_crypto): New prototype. + * netlink.c (netlink_decoders): Add NETLINK_CRYPTO. + * NEWS: Mention this. + +2017-07-23 Dmitry V. Levin + + Unify PRINT_FIELD_XVAL and PRINT_FIELD_XVAL64. + * print_fields.h (PRINT_FIELD_XVAL64): Unify with PRINT_FIELD_XVAL. + + Unify PRINT_FIELD_FLAGS and PRINT_FIELD_FLAGS64. + * print_fields.h (PRINT_FIELD_FLAGS64): Unify with PRINT_FIELD_FLAGS. + * userfaultfd.c (uffdio_ioctl): Replace PRINT_FIELD_FLAGS64 with + PRINT_FIELD_FLAGS. + +2017-07-23 Nikolay Marchuk + + pathtrace: fix fanotify_mark path tracing on 32-bit architectures. + The fanotify_mark syscall takes a 64-bit mask, and on 32-bit + architectures it is split up into two syscall arguments. + + * pathtrace.c (pathtrace_match_set): Use getllval to properly decode + arguments after mask. + +2017-07-22 Dmitry V. Levin + + travis: add valgrind check support. + * travis-build.sh [CHECK == valgrind]: Pass --enable-valgrind + to configure and appropriate check-valgrind-* to make. + * travis-install.sh [CHECK == valgrind]: Install valgrind. + +2017-07-22 JingPiao Chen + + netlink_sock_diag: replace NLA_ALIGN with NLMSG_ALIGN. + In several netlink_sock_diag parsers NLA_ALIGN was used instead of + NLMSG_ALIGN to align the length of netlink messages. Fortunately, + both macros round the given length to the closest multiple of 4, + so technically there is no difference, but the use of wrong macro + is misleading. + + * netlink_inet_diag.c (decode_inet_diag_req_compat, + decode_inet_diag_req_v2, decode_inet_diag_msg): Replace + NLA_ALIGN with NLMSG_ALIGN. + * netlink_netlink_diag.c (decode_netlink_diag_msg): Likewise. + * netlink_packet_diag.c (decode_packet_diag_msg): Likewise. + * netlink_smc_diag.c (decode_smc_diag_msg): Likewise. + +2017-07-22 Dmitry V. Levin + + travis: configure build with dependency tracking disabled. + Dependency tracking is completely useless for one-time builds, + so configure build with dependency tracking disabled. + + * travis-build.sh (DISTCHECK_CONFIGURE_FLAGS): Add + --disable-dependency-tracking. + +2017-07-22 Eugene Syromyatnikov + + m4: remove equal sign from define directive in ax_valgrind_check.m4. + Support for providing equal sign in define directives has been added + only in GNU Make 3.82 [1] and it provides the same semantics (variables + should be recursively expanded) as when it is omitted at all, so let's + remove it in order to preserve compatibility with older GNU Make + versions (like the one used on Travis). + + [1] https://git.savannah.gnu.org/cgit/make.git/tree/ChangeLog?h=3.82#n766 + + * m4/ax_valgrind_check.m4 : Remove equal + sign. + +2017-07-21 Dmitry V. Levin + + keyctl: add support for KEYCTL_RESTRICT_KEYRING operation. + * keyctl.c (keyctl_restrict_keyring): New function. + (SYS_FUNC(keyctl)): Use it to implement KEYCTL_RESTRICT_KEYRING support. + * NEWS: Mention this. + * tests/keyctl.c (main): Check KEYCTL_RESTRICT_KEYRING decoding. + +2017-07-21 Dmitry V. Levin + + tests: robustify strace-t.test. + If strace -t is running too long, it might happen that time stamps + before and after its invocation differ for more than a second. + Adjust expected output to handle this rare but possible case. + + * tests/strace-t.test: Allow any time stamp between start and finish + of strace invocation. + +2017-07-21 Dmitry V. Levin + + x86: wire up arch_prctl syscall. + * linux/i386/syscallent.h [384]: Add arch_prctl entry. + * xlat/archvals.in: Add fallback definitions for constants. + * prctl.c: Stop including . + (SYS_FUNC(arch_prctl)): Enable for [I386]. + * NEWS: Mention this. + +2017-07-21 Dmitry V. Levin + + tests: tweak strace-ff.test for slow startup case. + strace starts up much slower when invoked under valgrind control. + Increase the tracee's sleep delay to let strace more time to attach. + + * tests/strace-ff.test: Increase sleep delay. + +2017-07-21 Dmitry V. Levin + + tests: update valgrind suppressions. + * tests/strace.supp: Add a suppression for the memleak before + error_msg_and_die in qualify_tokens. + +2017-07-21 Dmitry V. Levin + + Do not copy optarg unnecessarily. + There is no need to copy the optarg string since it is a pointer + into the original argv array, not into a static area + that might be overwritten. + + * strace.c (username, outfname): Add const qualifier. + (init): Do not xstrdup optarg to initialize outfname and username. + +2017-07-20 Dmitry V. Levin + + travis: add build environment information to the travis log. + * travis-build.sh: Print build environment information. + +2017-07-20 Dmitry V. Levin + + build: add check-valgrind-* to recursive targets. + As make -j$N check-valgrind cannot parallelize properly, add + recursive targets for each of valgrind checks. This way one can run + for t in $valgrind_enabled_tools; do + make -k check-valgrind-$n || rc=$? + done + in $top_builddir. + + * configure.ac (AM_EXTRA_RECURSIVE_TARGETS): Remove. + * m4/ax_valgrind_check.m4 (AX_VALGRIND_CHECK): Add check-valgrind + and check-valgrind-* to AM_EXTRA_RECURSIVE_TARGETS. + +2017-07-20 Dmitry V. Levin + + tests: add check-valgrind-local make rule. + This guarantees that $(check_LIBRARIES) and $(check_PROGRAMS) + are made on 'make check-valgrind' before its recipe is processed. + + * tests/Makefile.am (check-valgrind-local): New rule. + (.PHONY): Add it. + +2017-07-20 Dmitry V. Levin + + Add ksysent.h and scno.h to BUILT_SOURCES. + This guarantees that ksysent.h and scno.h, along with other targets + listed in BUILT_SOURCES, are made on 'make all', 'make check', + and 'make check-valgrind' before other targets are processed. + + * scno.am (BUILT_SOURCES): Add scno.h. + * tests/Makefile.am (BUILT_SOURCES): Add ksysent.h. + +2017-07-20 Dmitry V. Levin + + tests: fix valgrind suppression file path. + * tests/Makefile.am (VALGRIND_SUPPRESSIONS_FILES): Replace srcdir + with abs_srcdir. + + Fixes: v4.16-74-g16036030 ("tests: run every test except ksysent.test in its own subdirectory") + +2017-07-19 Dmitry V. Levin + + Update AX_VALGRIND_CHECK. + * m4/ax_valgrind_check.m4: Update to serial 15. In particular, + this version does not eat check-valgrind errors. + + Update AX_CODE_COVERAGE. + * m4/ax_code_coverage.m4: Update to serial 24. In particular, + this version has no lcov version check. + * Makefile.am (strace_LDADD): Rename CODE_COVERAGE_LDFLAGS + to CODE_COVERAGE_LIBS. + + Update input event KEY_* constants. + * xlat/evdev_keycode.in: Add KEY_ASSISTANT introduced by linux kernel + commit v4.13-rc1~13^2~1^2~1. + * NEWS: Mention this. + + Update fs *_MAGIC constants. + * xlat/fsmagic.in: Add AAFS_MAGIC introduced by linux kernel commit + v4.13-rc1~161^2~87. + * NEWS: Mention this. + +2017-07-19 Dmitry V. Levin + + Move family-specific NETLINK_SOCK_DIAG parsers to separate files. + Split netlink_sock_diag.c that grew too big. + + * defs.h (tcp_states, tcp_state_flags): New xlat prototypes. + * netlink_sock_diag.h: New file. + * netlink_inet_diag.c: Likewise. + * netlink_netlink_diag.c: Likewise. + * netlink_packet_diag.c: Likewise. + * netlink_smc_diag.c: Likewise. + * netlink_unix_diag.c: Likewise. + * Makefile.am (strace_SOURCES): Add them. + * netlink_sock_diag.c: Move family-specific parsers and associated + header includes to separate files. + * nlattr.h (DECL_NLA(meminfo)): New prototype. + * nlattr.c: Include . + (print_meminfo, decode_nla_meminfo): New functions from + netlink_sock_diag.c. + +2017-07-19 Dmitry V. Levin + + Adjust prototypes of netlink parsing functions. + Change the type of "len" argument that is based + on struct nlmsghdr.nlmsg_len from kernel_ulong_t to unsigned int. + + * defs.h (netlink_decoder_t, DECL_NETLINK): Change "len" argument type + from kernel_ulong_t to unsigned int. + * netlink.c (decode_nlmsgerr_attr_cookie, decode_nlmsgerr, + decode_payload): Likewise. + * netlink_selinux.c (decode_netlink_selinux): Likewise. + * netlink_sock_diag.c (decode_family, decode_unix_diag_req, + decode_meminfo, decode_unix_diag_vfs, decode_unix_diag_inode, + decode_unix_diag_rqlen, decode_unix_diag_msg, decode_netlink_diag_req, + print_group, decode_netlink_diag_ring, decode_netlink_diag_flags, + decode_netlink_diag_msg, decode_packet_diag_req, + decode_packet_diag_info, decode_packet_diag_mclist, + decode_packet_diag_ring, decode_packet_diag_filter, + decode_packet_diag_msg, decode_inet_addr, decode_inet_diag_hostcond, + decode_inet_diag_markcond, decode_bytecode_data, decode_inet_diag_bc_op, + decode_inet_diag_req_compat, decode_inet_diag_req_v2, + decode_inet_diag_req, decode_inet_diag_meminfo, decode_tcpvegas_info, + decode_tcp_dctcp_info, decode_tcp_bbr_info, decode_inet_diag_msg, + decode_smc_diag_req, decode_smc_diag_conninfo, decode_smc_diag_lgrinfo, + decode_smc_diag_msg, netlink_diag_decoder_t, decode_netlink_sock_diag): + Likewise. + * nlattr.c (fetch_nlattr, decode_nlattr_with_data, decode_nlattr, + decode_nla_str, decode_nla_strn, DECODE_NLA_INTEGER): Likewise. + * nlattr.h (nla_decoder_t, DECL_NLA, decode_nlattr): Likewise. + +2017-07-19 JingPiao Chen + + tests: check decoding of nlmsgerr attributes. + * tests/nlattr_nlmsgerr.c: New file. + * tests/gen_tests.in (nlattr_nlmsgerr): New entry. + * tests/pure_executables.list: Add nlattr_nlmsgerr. + * tests/.gitignore: Likewise. + + netlink: decode nlmsgerr attributes. + * netlink.c: Include "nlattr.h" and "xlat/nlmsgerr_attrs.h". + (print_cookie, decode_nlmsgerr_attr_cookie): New functions. + (nlmsgerr_nla_decoders): New array. + (decode_nlmsgerr): Use it. + * xlat/nlmsgerr_attrs.in: New file. + * NEWS: Mention this. + +2017-07-19 JingPiao Chen + + netlink: adjust decode_nlmsgerr for extended ACK reporting. + Extended ACK reporting introduced by linux kernel commit + v4.11-rc5-1382-g2d4bc93. + + * netlink.h (NLM_F_CAPPED): New macro. + * netlink.c (decode_payload): Pass + nlmsghdr->nlmsg_flags & NLM_F_CAPPED to decode_nlmsgerr. + (decode_nlmsgerr): Adjust the length pass to + decode_nlmsghdr_with_payload. + +2017-07-19 JingPiao Chen + + netlink: decode netlink message ack flags. + * netlink.c: Include "xlat/netlink_ack_flags.h". + (decode_nlmsg_flags): Decode ack flags when type == NLMSG_ERROR. + * xlat/netlink_ack_flags.in: New file. + * NEWS: Mention this. + * tests/netlink_protocol.c (test_ack_flags): New function, check this. + (main): Use it. + +2017-07-19 Dmitry V. Levin + + tests: enhance error diagnostics. + * tests/init.sh (dump_log_and_fail_with): Dump $LOG to stderr instead + of stdout as the latter is more likely to be redirected to a temporary + file in the context where this function is called. + + tests: enhance timeout diagnostics. + * tests/init.sh: Trap SIGXCPU. + * tests/run.sh: Send SIGXCPU instead of SIGKILL in case of timeout, send + SIGKILL if the command is still running 5 seconds after SIGXCPU. + + userfaultfd: decode struct uffdio_api.features as flags. + * xlat/uffd_api_features.in: New file. + * userfaultfd.c: Include "xlat/uffd_api_features.h". + (uffdio_ioctl): Print struct uffdio_api.features using + PRINT_FIELD_FLAGS64 and uffd_api_features. + * NEWS: Mention this. + * tests/ioctl_uffdio.c: Include "xlat.h" and "xlat/uffd_api_features.h". + (main): Update expected output. + +2017-07-19 Dmitry V. Levin + + userfaultfd: enhance decoding of struct uffdio_api.features. + As struct uffdio_api.features has read-write semantics, + print the value returned by the kernel only when it differs + from the value passed to the kernel. + + * userfaultfd.c (uffdio_ioctl) : On entering syscall, + save the value of struct uffdio_api.features. On exiting syscall, do + not print struct uffdio_api.features when it's the same as on entering. + * tests/ioctl_uffdio.c (main): Update expected output. + +2017-07-18 Dmitry V. Levin + + userfaultfd: use PRINT_FIELD_* macros. + This also fixes output correctness for struct uffdio_api.features. + + * userfaultfd.c: Include "print_fields.h". + (tprintf_uffdio_range): Use PRINT_FIELD_X. + (PRINT_FIELD_UFFDIO_RANGE): New macro. + (uffdio_ioctl): Use it, PRINT_FIELD_FLAGS64, and PRINT_FIELD_X. + * tests/ioctl_uffdio.c (main): Update expected output. + +2017-07-18 Dmitry V. Levin + + Introduce PRINT_FIELD_FLAGS64 and PRINT_FIELD_XVAL64. + * print_fields.h (PRINT_FIELD_FLAGS64, PRINT_FIELD_XVAL64): New macros. + +2017-07-17 Dmitry V. Levin + + Update NEWS. + + aio: change struct iocb.aio_lio_opcode output format. + * aio.c (tprint_lio_opcode): Change opcode output format to match + the kernel. + * tests/aio.c (main): Update expected output. + +2017-07-17 Dmitry V. Levin + + aio: use PRINT_FIELD_* macros. + This also fixes output correctness for struct iocb. + + * aio.c: Include "print_fields.h". + (print_common_flags, print_iocb_header, print_iocb, print_io_event): + Use PRINT_FIELD_D, PRINT_FIELD_U, PRINT_FIELD_X, PRINT_FIELD_FD, + and PRINT_FIELD_STRN. + * tests/aio.c (main): Update expected output. + +2017-07-17 Dmitry V. Levin + + Introduce PRINT_FIELD_FD and PRINT_FIELD_STRN. + * print_fields.h (PRINT_FIELD_FD, PRINT_FIELD_STRN): New macros. + +2017-07-16 Dmitry V. Levin + + Update BPF_* constants. + * xlat/bpf_commands.in: Add BPF_PROG_TEST_RUN, BPF_PROG_GET_NEXT_ID, + BPF_MAP_GET_NEXT_ID, BPF_PROG_GET_FD_BY_ID, BPF_MAP_GET_FD_BY_ID, + and BPF_OBJ_GET_INFO_BY_FD introduced by linux kernel commits + v4.12-rc1~64^3~287^2~5, v4.13-rc1~157^2~271^2~5, + v4.13-rc1~157^2~271^2~4, v4.13-rc1~157^2~271^2~3, and + v4.13-rc1~157^2~271^2~1, respectively. + * xlat/bpf_attach_type.in: Add BPF_CGROUP_SOCK_OPS introduced + by linux kernel commit v4.13-rc1~157^2~37^2~15. + * xlat/bpf_prog_types.in: Add BPF_PROG_TYPE_SOCK_OPS introduced + by the same commit. + + Update SO_* constants. + * xlat/sockoptions.in: Add SO_PEERGROUPS introduced by linux kernel + commit v4.13-rc1~157^2~124. + + Update SCM_* constants. + * xlat/scmvals.in: Add SCM_TIMESTAMPING_PKTINFO introduced + by linux kernel commit v4.13-rc1~157^2~405^2~3. + +2017-07-16 JingPiao Chen + + tests: check decoding of NETLINK_SELINUX protocol. + * test_netlink.h (TEST_NETLINK_OBJECT): New macro. + * tests/netlink_selinux.c: Include "test_netlink.h" + instead of "netlink.h". + (test_selnl_msg_unspec, test_selnl_msg_setenforce, + test_selnl_msg_policyload): New functions. + (main): Use them. + + netlink: decode NETLINK_SELINUX protocol. + * netlink_selinux.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * defs.h (decode_netlink_selinux): New prototype. + * netlink.c (netlink_decoders): Add NETLINK_SELINUX. + +2017-07-15 Dmitry V. Levin + + sg_io_v3: use PRINT_FIELD_* macros. + * sg_io_v3.c: Include "print_fields.h". + (PRINT_FIELD_SG_IO_BUFFER): New macro. + (decode_request, decode_response): Use it, PRINT_FIELD_D, PRINT_FIELD_U, + PRINT_FIELD_X, PRINT_FIELD_PTR, PRINT_FIELD_FLAGS, and PRINT_FIELD_XVAL. + + Introduce PRINT_FIELD_PTR. + * print_fields.h (PRINT_FIELD_PTR): New macro. + +2017-07-15 Dmitry V. Levin + + Provide mpers_ptr_t definition for non-mpers case. + In mpers case, mpers_ptr_t is already defined by DEF_MPERS_TYPE(...). + This allows use of mpers_ptr_t regardless of IN_MPERS state. + + * mpers_type.h [!IN_MPERS] (mpers_ptr_t): New typedef. + +2017-07-14 Lazar Trsic + + Move is_negated_errno() to new header negated_errno.h. + Move is_negated_errno() to a separate new header file negated_errno.h + and include it just for architectures which require it. + + is_negated_errno() is not used on those architectures + that have a dedicated register to signal a syscall error. + + The issue was raised when compiling with clang, which is more + strict regarding semantics of unused static inline functions + defined in C files and will issue a -Wunused-function warrning + if they are not used anywhere. + + * syscall.c (is_negated_errno): Move to ... + * negated_errno.h: ... new file. + * Makefile.am (strace_SOURCES): Add it. + * linux/aarch64/get_error.c: Include it. + * linux/arc/get_error.c: Likewise. + * linux/arm/get_error.c: Likewise. + * linux/avr32/get_error.c: Likewise. + * linux/bfin/get_error.c: Likewise. + * linux/crisv10/get_error.c: Likewise. + * linux/hppa/get_error.c: Likewise. + * linux/i386/get_error.c: Likewise. + * linux/ia64/get_error.c: Likewise. + * linux/m68k/get_error.c: Likewise. + * linux/metag/get_error.c: Likewise. + * linux/microblaze/get_error.c: Likewise. + * linux/or1k/get_error.c: Likewise. + * linux/riscv/get_error.c: Likewise. + * linux/s390/get_error.c: Likewise. + * linux/sh/get_error.c: Likewise. + * linux/sh64/get_error.c: Likewise. + * linux/tile/get_error.c: Likewise. + * linux/x86_64/get_error.c: Likewise. + * linux/xtensa/get_error.c: Likewise. + +2017-07-14 Dmitry V. Levin + + sg_io_v4: use PRINT_FIELD_* macros. + * sg_io_v4.c: Include "print_fields.h". + (PRINT_FIELD_SG_IO_BUFFER): New macro. + (decode_request, decode_response): Use it, PRINT_FIELD_D, PRINT_FIELD_U, + PRINT_FIELD_X, PRINT_FIELD_FLAGS, and PRINT_FIELD_XVAL. + + dm: use PRINT_FIELD_* macros. + * dm.c (dm_decode_values, dm_decode_dm_target_spec, + dm_decode_dm_target_deps, dm_decode_dm_target_msg, dm_known_ioctl): Use + PRINT_FIELD_D, PRINT_FIELD_U, and PRINT_FIELD_FLAGS. + +2017-07-13 Dmitry V. Levin + + Move macros related to kernel types to kernel_types.h. + Some macros related to kernel types are defined both in defs.h and + tests/tests.h. Avoid this redundancy by moving these definitions + to kernel_types.h. + + * defs.h (PRI_kl, PRI_kld, PRI_klu, PRI_klx, PRI__64, PRI__d64, + PRI__u64, PRI__x64): Move ... + * kernel_types.h: ... here. + * tests/tests.h (PRI__64, PRI__d64, PRI__u64, PRI__x64): Remove. + +2017-07-13 Lazar Trsic + + mips64: fix PRI__64 macro definition when compiled for Android. + By default for MIPS64 in Android __u64 type is exported + as unsigned long long. This caused compilation -Wformat warnings + and would break the build if -Werror is used. + + * defs.h [SIZEOF_LONG != 4 && MIPS && __ANDROID__] (PRI__64): Change + from "l" to "ll". + +2017-07-13 Dmitry V. Levin + + block: use PRINT_FIELD_* macros. + This also fixes output correctness for struct blkpg_ioctl_arg. + + * block.c (print_blkpg_req): Use PRINT_FIELD_D and PRINT_FIELD_XVAL. + (block_ioctl): Use PRINT_FIELD_U. + * tests/ioctl_block.c (main): Update expected output. + +2017-07-12 Dmitry V. Levin + + netlink_sock_diag: enhance decoding of long meminfo arrays. + Print trailing dots instead of silent truncation if the array + is too long. + + * netlink_sock_diag.c (decode_meminfo): Do not apply SK_MEMINFO_VARS + limit to nmemb, specify element count to print_array instead. + (print_meminfo): Check element count and terminate printing + if the element count exceeds SK_MEMINFO_VARS. + * tests/nlattr_inet_diag_msg.c (main): Check it. + +2017-07-12 Dmitry V. Levin + + tests: extend coverage of netlink_diag_req decoder. + Add one more NETLINK_SOCK_DIAG check to ressurrect full coverage + of netlink_diag_req decoder that was lost after commit + v4.18-58-g37ef2d0d. + + * tests/netlink_sock_diag.c (test_netlink_diag_req): Add a check for + sdiag_protocol != NDIAG_PROTO_ALL. + +2017-07-12 JingPiao Chen + + tests: check decoding of NETLINK_CRYPTO nlmsg_flags. + * tests/netlink_crypto.c (test_nlmsg_flags): New function. + (main): Use it. + + netlink: add decoding of NETLINK_CRYPTO nlmsg_flags. + * netlink.c (decode_nlmsg_flags): Add NETLINK_CRYPTO. + + tests: check decoding of NETLINK_CRYPTO message types. + * configure.ac (AC_CHECK_HEADERS): Add linux/cryptouser.h. + * tests/netlink_crypto.c: New file. + * tests/gen_tests.in (netlink_crypto): New entry. + * tests/pure_executables.list: Add netlink_crypto. + * tests/.gitignore: Likewise. + + netlink: add decoding of NETLINK_CRYPTO message types. + * xlat/nl_crypto_types.in: New file. + * netlink.c: Include "xlat/nl_crypto_types.h". + (nlmsg_types): Add NETLINK_CRYPTO. + + tests: introduce TEST_NETLINK and TEST_NETLINK_ macros. + * tests/test_netlink.h: New file. + * tests/Makefile.am (libtests_a_SOURCES): Add it. + * tests/netlink_sock_diag.c: Include "test_netlink.h" + instead of "netlink.h". + (TEST_SOCK_DIAG): New macro. + (test_unix_diag_req, test_unix_diag_msg, + test_netlink_diag_req, test_netlink_diag_msg, + test_packet_diag_req, test_packet_diag_msg, + test_inet_diag_req, test_inet_diag_req_v2, + test_inet_diag_msg, test_smc_diag_req, + test_smc_diag_msg): Use it. + (test_odd_family_req, test_odd_family_msg, + test_inet_diag_sockid): Use TEST_NETLINK macro. + +2017-07-11 JingPiao Chen + + tests: check decoding of nlattr_inet_diag_req_v2 attributes. + * tests/nlattr_inet_diag_req_v2.c: New file. + * tests/gen_tests.in (nlattr_inet_diag_req_v2): New entry. + * tests/pure_executables.list: Add nlattr_inet_diag_req_v2. + * tests/.gitignore: Likewise. + + tests: check decoding of nlattr_inet_diag_req_compat attributes. + * tests/nlattr_inet_diag_req_compat.c: New file. + * tests/gen_tests.in (nlattr_inet_diag_req_compat): New entry. + * tests/pure_executables.list: Add nlattr_inet_diag_req_compat. + * tests/.gitignore: Likewise. + + netlink: decode AF_INET inet_diag_req_* attributes. + * linux/inet_diag.h (inet_diag_bc_op, inet_diag_hostcond, + inet_diag_markcond): New structures. + (INET_DIAG_BC_*): New enum. + * netlink_sock_diag.c: Include "xlat/inet_diag_bytecodes.h". + (decode_inet_addr, decode_inet_diag_hostcond, + print_inet_diag_bc_op, decode_inet_diag_markcond, + decode_bytecode_data, decode_inet_diag_bc_op): New functions. + (inet_diag_req_nla_decoders): New array. + (decode_inet_diag_req_compat, decode_inet_diag_req_v2): Use it. + * xlat/inet_diag_bytecodes.in: New file. + +2017-07-11 Dmitry V. Levin + + Introduce PRINT_FIELD_CSTRING. + * print_fields.h (PRINT_FIELD_CSTRING): New macro. + * block.c (print_blkpg_req, block_ioctl): Use PRINT_FIELD_CSTRING + instead of print_quoted_string. + * btrfs.c (btrfs_ioctl): Likewise. + * dm.c (dm_decode_device, dm_decode_dm_target_spec): Likewise. + * loop.c (decode_loop_info, decode_loop_info64): Likewise. + * v4l2.c (print_v4l2_capability, print_v4l2_fmtdesc, + print_v4l2_standard, print_v4l2_input, print_v4l2_tuner, + print_v4l2_queryctrl): Likewise. + * netlink_sock_diag.c (decode_smc_diag_lgrinfo): Use PRINT_FIELD_CSTRING + instead of PRINT_FIELD_STRING. + * uname.c (PRINT_UTS_MEMBER): Remove. + (SYS_FUNC(uname)): Use PRINT_FIELD_CSTRING instead of PRINT_UTS_MEMBER. + +2017-07-11 Dmitry V. Levin + + Rename PRINT_FIELD_QUOTED_STRING to PRINT_FIELD_STRING. + As string fields are always qouted when printed, choose a shorter name + for the helper macro. + + * print_fields.h (PRINT_FIELD_QUOTED_STRING): Rename + to PRINT_FIELD_STRING. All callers updated. + +2017-07-10 Dmitry V. Levin + + Update RWF_* constants. + * xlat/rwf_flags.in: Add RWF_NOWAIT introduced by linux kernel + commit v4.12-rc5-150-gb745fafa. + + Intorduce PRINT_FIELD_0X. + * print_fields.h (PRINT_FIELD_0X): New macro. + * sockaddr.c (print_sockaddr_data_ipx, print_sockaddr_data_nl): Use it + instead of manual tprintf statements. + * netlink_sock_diag.c (PRINT_FIELD_SMC_DIAG_CONNINFO_FLAGS): Remove. + (decode_smc_diag_conninfo): Replace it with PRINT_FIELD_0X. + + print_inet_addr: use inet_addr-based output format for IPv4. + * sockaddr.c (print_inet_addr): Remove af_name variable. + : Use inet_addr-based output format. + * tests/netlink_sock_diag.c (test_inet_diag_sockid, test_inet_diag_req, + test_inet_diag_req_v2, test_inet_diag_msg, test_smc_diag_req, + test_smc_diag_msg): Update expected output. + * tests/nlattr_inet_diag_msg.c (print_inet_diag_msg): Likewise. + * tests/nlattr_smc_diag_msg.c (print_smc_diag_msg): Likewise. + +2017-07-10 JingPiao Chen + + tests: check decoding of netlink smc_diag_msg attributes. + * tests/nlattr_smc_diag_msg.c: New file. + * tests/gen_tests.in (nlattr_smc_diag_msg): New entry. + * tests/pure_executables.list: Add nlattr_smc_diag_msg. + * tests/.gitignore: Likewise. + + netlink: decode AF_SMC smc_diag_msg attributes. + * linux/smc_diag.h (smc_diag_cursor, smc_diag_conninfo + smc_diag_linkinfo, smc_diag_lgrinfo): New structures. + * netlink_sock_diag.c: Include "xlat/smc_link_group_roles.h". + (decode_smc_diag_conninfo, decode_smc_diag_lgrinfo): New functions. + (smc_diag_msg_nla_decoders): New array. + (decode_smc_diag_msg): Use it. + * xlat/smc_link_group_roles.in: New file. + +2017-07-10 Nikolay Marchuk + + pathtrace.c: introduce user-provided sets of paths. + * defs.h (struct path_set): New structure. + (global_path_set): New variable prototype. + (tracing_paths): Change macro body to use global_path_set variable. + (pathtrace_select_set): Add "struct path_set *" argument. + (pathtrace_match_set): Likewise. Change return type to bool. + (pathtrace_select, pathtrace_match): Change into thin macro wrappers + around pathtrace_select_set and pathtrace_match_set, repsectively. + * pathtrace.c (global_path_set): New variable. + (storepath, pathtrace_select_set): Add "struct path_set *" argument. + (pathmatch, upathmatch, fdmatch, pathtrace_match_set): Likewise. + Change return type to bool. + +2017-07-09 Dmitry V. Levin + + tests: check decoding of MCAST_JOIN_GROUP/MCAST_LEAVE_GROUP. + * tests/group_req.c: New file. + * tests/gen_tests.in (group_req): New entry. + * tests/pure_executables.list: Add group_req. + * tests/.gitignore: Likewise. + +2017-07-09 Dmitry V. Levin + + Mpersify struct group_req. + The size of struct group_req depends on alignment of long and therefore + has to be mpersified. + + * print_group_req.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * net.c (print_group_req): Move to print_group_req.c, wrap into + MPERS_PRINTER_DECL. + +2017-07-09 Dmitry V. Levin + + net: enhance decoding of MCAST_JOIN_GROUP/MCAST_LEAVE_GROUP. + * net.c (print_group_req): Allow option length greater than + sizeof(struct group_req) to match the kernel behaviour. + When the option length is invalid, print the address. + * NEWS: Mention this. + +2017-07-09 Dmitry V. Levin + + net: hook up MCAST_JOIN_GROUP/MCAST_LEAVE_GROUP decoding for SOL_IPV6. + As multicast socket options are shared between IPv4 and IPv6, + they should be decoded both for SOL_IP and SOL_IPV6. + + * net.c (print_setsockopt) [MCAST_JOIN_GROUP]: Handle + MCAST_JOIN_GROUP and MCAST_LEAVE_GROUP. + +2017-07-09 Dmitry V. Levin + + xlat: add MCAST_* to sockipv6options. + Multicast socket options are shared between IPv4 and IPv6. + + * xlat/sockipv6options.in: Add MCAST_JOIN_GROUP, MCAST_BLOCK_SOURCE, + MCAST_UNBLOCK_SOURCE, MCAST_LEAVE_GROUP, MCAST_JOIN_SOURCE_GROUP, + MCAST_LEAVE_SOURCE_GROUP, and MCAST_MSFILTER. + +2017-07-09 Dmitry V. Levin + + net: enhance decoding of IP_ADD_MEMBERSHIP et al socket options. + * net.c (print_mreq, print_mreq6): Treat negative option length + as invalid to match the kernel behaviour. When the option length + is invalid, print the address. + * NEWS: Mention it. + * tests/ip_mreq.c (main): Check it. Update expected output. + + net: enhance decoding of setsockopt's SO_LINGER negative option length. + * net.c (print_set_linger): Treat negative option length as invalid + to match the kernel behaviour. + * tests/so_linger.c (main): Check it. + + msghdr: use PRINT_FIELD_* macros. + * msghdr.c (print_scm_creds): Use PRINT_FIELD_U and PRINT_FIELD_UID. + (print_cmsg_ip_recverr): Use PRINT_FIELD_U. + (print_struct_msghdr): Use PRINT_FIELD_U and PRINT_FIELD_FLAGS. + + Intorduce PRINT_FIELD_SOCKADDR. + * print_fields.h (PRINT_FIELD_SOCKADDR): New macro. + * msghdr.c (print_cmsg_ip_recverr): Use it instead of print_sockaddr. + * net.c (print_group_req): Likewise. + * sock.c (PRINT_IFREQ_ADDR): Remove. + (print_ifreq, print_ifconf_ifreq): Use PRINT_FIELD_SOCKADDR + instead of PRINT_IFREQ_ADDR. + +2017-07-09 Dmitry V. Levin + + print_sockaddr: remove "struct tcb *" argument. + print_sockaddr does not use its first argument, remove it. + + * defs.h (print_sockaddr): Remove argument. + * sockaddr.c (print_sockaddr): Remove argument. All callers updated. + * sock.c (PRINT_IFREQ_ADDR): Likewise. + +2017-07-09 Dmitry V. Levin + + net: use PRINT_FIELD_* macros. + * net.c (print_tpacket_stats, print_tpacket_req): Use PRINT_FIELD_U. + (print_group_req): Use PRINT_FIELD_IFINDEX. + (print_packet_mreq): Use PRINT_FIELD_IFINDEX, PRINT_FIELD_U, + and PRINT_FIELD_XVAL. + + netlink_sock_diag: introduce PRINT_FIELD_INET_DIAG_SOCKID. + * netlink_sock_diag.c (PRINT_FIELD_INET_DIAG_SOCKID): New macro. + (decode_inet_diag_req_compat, decode_inet_diag_req_v2, + decode_inet_diag_msg, decode_smc_diag_req, decode_smc_diag_msg): Use it + instead of print_inet_diag_sockid. + + Intorduce PRINT_FIELD_DEV. + * print_fields.h (PRINT_FIELD_DEV): New macro. + * dm.c (dm_decode_device, dm_decode_dm_name_list): Use it + instead of print_dev_t. + * loop.c (decode_loop_info, decode_loop_info64): Likewise. + * netlink_sock_diag.c (decode_unix_diag_vfs): Likewise. + + Intorduce PRINT_FIELD_INET4_ADDR. + * print_fields.h (PRINT_FIELD_INET4_ADDR): New macro. + * msghdr.c (print_cmsg_ip_pktinfo): Use it instead of manual + tprintf statements. + * net.c (print_mreq): Likewise. + * sockaddr.c (print_sockaddr_data_in): Likewise. + + Intorduce PRINT_FIELD_NET_PORT. + * print_fields.h (PRINT_FIELD_NET_PORT): New macro. + * netlink_sock_diag.c (print_inet_diag_sockid): Use it + instead of a manual tprintf statement. + * sockaddr.c (print_sockaddr_data_in, print_sockaddr_data_in6, + print_sockaddr_data_ipx): Likewise. + + Intorduce PRINT_FIELD_IFINDEX. + * print_fields.h (PRINT_FIELD_IFINDEX): New macro. + * msghdr.c (print_cmsg_ip_pktinfo): Use it instead of print_ifindex. + * net.c (print_mreq6): Likewise. + * netlink_sock_diag.c (print_packet_diag_mclist, + print_inet_diag_sockid): Likewise. + * sockaddr.c (print_sockaddr_data_in6, print_sockaddr_data_ll): + Likewise. + + Intorduce PRINT_FIELD_INET_ADDR. + * print_fields.h (PRINT_FIELD_INET_ADDR): New macro. + * net.c (print_mreq6): Use it instead of print_inet_addr. + * netlink_sock_diag.c (print_inet_diag_sockid): Likewise. + * sockaddr.c (print_sockaddr_data_in6): Likewise. + + net: move print_ifindex to a separate file. + * print_ifindex.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * net.c (print_ifindex): Move to print_ifindex.c. + + net: move parsers of bind, listen, and shutdown to separate files. + * bind.c: New file. + * listen.c: Likewise. + * shutdown.c: Likewise. + * Makefile.am (strace_SOURCES): Add them. + * net.c (SYS_FUNC(bind)): Move to bind.c. + (SYS_FUNC(listen)): Move to listen.c. + (SYS_FUNC(shutdown)): Move to shutdown.c. + +2017-07-09 JingPiao Chen + Dmitry V. Levin + + tests: check decoding of packet_diag_msg attributes. + * tests/netlink_sock_diag-v.sh: New file. + * tests/Makefile.am (EXTRA_DIST): Add it. + * tests/nlattr_packet_diag_msg.c: New file. + * tests/gen_tests.in (nlattr_packet_diag_msg): New entry. + * tests/pure_executables.list: Add nlattr_packet_diag_msg. + * tests/.gitignore: Likewise. + + netlink: decode AF_PACKET packet_diag_msg attributes. + * linux/packet_diag.h (packet_diag_info, packet_diag_mclist, + packet_diag_ring): New structures. + (PDI_*): New macros. + * netlink_sock_diag.c: Include + and "xlat/packet_diag_info_flags.h". + (decode_packet_diag_info, decode_packet_diag_mclist, + decode_packet_diag_ring, decode_packet_diag_filter): New functions. + (packet_diag_msg_nla_decoders): New array. + (decode_packet_diag_msg): Use it. + * print_fields.h (PRINT_FIELD_QUOTED_STRING): New macro. + * xlat/packet_diag_info_flags.in: New file. + +2017-07-09 JingPiao Chen + + tests: fix TEST_NLATTR_OBJECT and TEST_NLATTR_ARRAY for large objects. + commit v4.17-161-gdbd0605 that adjusted TEST_NLATTR_OBJECT and + TEST_NLATTR_ARRAY for large objects, only changed the pattern + print length, large length still can be specified as nla_data_len, + resulting to output mismatch. + + * tests/test_nlattr.h (TEST_NLATTR_OBJECT): Pass "plen" + both as nla_data_len and slen arguments of TEST_NLATTR_ + in len < sizeof(object) case. + (TEST_NLATTR_ARRAY): Likewise, Pass "plen" both as nla_data_len + and slen arguments of TEST_NLATTR_ in len < sizeof(object[0]) case. + +2017-07-09 JingPiao Chen + + tests: introduce TEST_NLATTR_nla macro in test_nlattr.h. + Explicitly make struct nlattr * pointer which is internal + to TEST_NLATTR_ macro available to its varadic arguments. + + * tests/test_nlattr.h (TEST_NLATTR_): Rename nla to TEST_NLATTR_nla. + +2017-07-08 Dmitry V. Levin + + tests: check decoding of SO_PEERCRED socket option. + * tests/so_peercred.c: New file. + * tests/gen_tests.in (so_peercred): New entry. + * tests/pure_executables.list: Add so_peercred. + * tests/.gitignore: Likewise. + + net: accept arbitrary option length for getsockopt's SO_PEERCRED. + * print_fields.h (PRINT_FIELD_UID): New macro. + * net.c (print_ucred): Rewrite to match the kernel behaviour. + * NEWS: Mention this. + + tests: check decoding of socket filters. + * tests/sock_filter-v.c: New file. + * tests/gen_tests.in (sock_filter-v): New entry. + * tests/pure_executables.list: Add sock_filter-v. + * tests/.gitignore: Likewise. + + Implement decoding of linux socket filter programs. + * bpf_sock_filter.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * xlat/skf_ad.in: New file. + * defs.h (decode_sock_fprog, print_sock_fprog): New prototypes. + * fetch_bpf_fprog.c (get_bpf_fprog_size): New mpers printer. + * net.c (print_getsockopt): Use decode_sock_fprog to print + socket filter programs for SO_GET_FILTER socket option. + (print_setsockopt): Use decode_sock_fprog and get_bpf_fprog_size + to print socket filter programs for SO_ATTACH_FILTER + and SO_ATTACH_REUSEPORT_CBPF socket options. + * NEWS: Mention this. + + tests: check decoding of SO_LINGER socket option. + * tests/so_linger.c: New file. + * tests/gen_tests.in (so_linger): New entry. + * tests/pure_executables.list: Add so_linger. + * tests/.gitignore: Likewise. + + tests: fix print_quoted_hex output of bytes with high bit set. + * tests/tests.h (print_quoted_memory, print_quoted_hex): Change the type + of first argument from "const char *" to "const void *". + * tests/print_quoted_string.c: Likewise. + (print_quoted_hex): Print bytes as unsigned char objects to avoid + unwanted sign extension. + * tests/netlink_protocol.c (send_query): Remove the cast of print_quoted_hex + first argument which is now redundant. + + net: accept arbitrary option length for getsockopt's SO_LINGER. + * net.c (print_linger): Rename to print_set_linger. + (print_setsockopt): Replace print_linger with print_set_linger. + (print_get_linger): New function that accepts arbitrary option length + to match the kernel behaviour. + (print_getsockopt): Replace print_linger with print_get_linger. + * NEWS: Mention this. + + net: accept large option length for SO_LINGER. + * net.c (print_linger): Allow len > sizeof(struct linger) to match + the kernel behaviour. + + net: fix printing of struct linger's field names. + * net.c: Include "print_fields.h". + (print_linger): Print fields of struct linger using PRINT_FIELD_D. + +2017-07-08 Dmitry V. Levin + + net: enhance decoding of getsockopt's optlen argument. + As the last argument of getsockopt syscall has read-write semantics, + print both user and kernel values when they differ. + + * net.c (SYS_FUNC(getsockopt)): On entering syscall, fetch and save + the length specified to the kernel. On error, print the length saved + on entering. When the saved length and the length returned by the + kernel differ, print both values. + * NEWS: Mention this. + * tests/net-icmp_filter.c (main): Update expected output. + +2017-07-08 Dmitry V. Levin + + net: move printing of [gs]etsockopt's socklen argument to toplevel parsers + * net.c (print_getsockopt, print_setsockopt): Remove "done" label, + replace "goto done" statement with "return". + Move printing of "len" argument ... + (SYS_FUNC(getsockopt), SYS_FUNC(setsockopt)): ... here. + +2017-07-08 Dmitry V. Levin + + Generalize seccomp filter parser. + Linux socket filter uses almost the same classic BPF as seccomp filter, + The only difference noticeable from strace PoV is the meaning of generic + multiuse field. + + Transform the parser of seccomp filters to a more generic parser + of classic BPF, parametrized with a method of parsing the generic + multiuse field in BPF_STMT. + + * bpf_filter.c: New file. + * bpf_filter.h: Likewise. + * bpf_fprog.h: Likewise. + * bpf_seccomp_filter.c: Likewise. + * fetch_bpf_fprog.c: Likewise. + * fetch_seccomp_fprog.c: Remove. + * seccomp_fprog.h: Likewise. + * Makefile.am (strace_SOURCES): Add bpf_filter.c, bpf_filter.h, + bpf_fprog.h, bpf_seccomp_filter.c, and fetch_bpf_fprog.c. + Remove fetch_seccomp_fprog.c and seccomp_fprog.h. + * seccomp.c: Do not include linux/filter.h and xlat header files. + Do not define SECCOMP_RET_ACTION. + (bpf_filter, decode_bpf_code, decode_bpf_stmt, decode_bpf_jump, + print_bpf_filter, print_seccomp_fprog, print_seccomp_filter): Remove. + * defs.h (print_seccomp_filter): Rename to decode_seccomp_fprog. + (SYS_FUNC(seccomp)): Replace print_seccomp_filter + with decode_seccomp_fprog. + * prctl.c (SYS_FUNC(prctl)): Likewise. + +2017-07-08 Dmitry V. Levin + + Assume that is always available. + was introduced in linux 2.1.75, way before + the minimal kernel version supported by strace. + + * configure.ac (AC_CHECK_HEADERS): Remove linux/filter.h. + * seccomp.c: Assume HAVE_LINUX_FILTER_H. + * tests/prctl-seccomp-filter-v.c: Likewise. + * tests/seccomp-filter-v.c: Likewise. + * tests/seccomp-filter.c: Likewise. + +2017-07-07 Dmitry V. Levin + + xlat: add BPF_END to BPF_ALU opcode list. + BPF_END is one of three eBPF-only opcodes for BPF_ALU class. + Other two (BPF_MOV and BPF_ARSH) has been added earlier. + + * xlat/bpf_op_alu.in: Add BPF_END. + +2017-07-07 JingPiao Chen + + netlink_sock_diag: print unrecognized data in hex. + * netlink_sock_diag.c (decode_family): Replace printstrn with + printstr_ex and set QUOTE_FORCE_HEX flag. + * tests/netlink_sock_diag.c (test_odd_family_req, + test_odd_family_msg): Update expected output. + + netlink: print unrecognized nlattr in hex. + * nlattr.c (fetch_nlattr): Replace printstrn + with printstr_ex and set QUOTE_FORCE_HEX flag. + * tests/nlattr.c (test_nlattr): Update expected output. + + netlink: print unrecognized netlink messages in hex. + * netlink.c (fetch_nlmsghdr): Replace printstrn + with printstr_ex and set QUOTE_FORCE_HEX flag. + * tests/netlink_protocol.c (send_query): Update expected output. + + netlink: print unrecognized netlink payload in hex. + * netlink.c (decode_payload): Replace printstrn + with printstr_ex and set QUOTE_FORCE_HEX flag. + * tests/netlink_protocol.c (send_query, test_nlmsgerr, + test_nlmsg_done): Update expected output. + * tests/netlink_generic.c (test_nlmsg_type): Likewise. + + netlink: print unrecognized nlmsgerr in hex. + * netlink.c (decode_nlmsgerr): Replace printstrn + with printstr_ex and set QUOTE_FORCE_HEX flag. + * tests/netlink_protocol.c (test_nlmsgerr): Update expected output. + + netlink: print unrecognized attribute data in hex. + * nlattr.c (decode_nlattr_with_data): Replace printstrn + with printstr_ex and set QUOTE_FORCE_HEX flag. + * tests/tests.h (print_quoted_hex): New prototype. + * tests/print_quoted_string.c (print_quoted_hex): New function. + * tests/test_nlattr.h (TEST_NLATTR_OBJECT, TEST_NLATTR_ARRAY): Use it + for updated expected output. Change the type of "plen" variable + to unsigned int. + * tests/nlattr.c (test_nlattr): Update expected output. + + tests: print quotation marks in print_quoted_memory. + * tests/print_quoted_string.c (print_quoted_memory): Print opening + and closing quotation marks. + * tests/getcwd.c (main): Do not print quotation marks around + print_quoted_string. + * tests/uname.c (main): Likewise. + * tests/keyctl.c (print_quoted_string_limit): Do not print quotation + marks around print_quoted_memory. + * tests/netlink_protocol.c (send_query): Likewise. + * tests/xattr.c (main): Likewise. + +2017-07-06 Dmitry V. Levin + + strace.1: remove misleading remark that -i option is weakly supported. + Given that -i functionality is covered by pc.test, the remark that + it is weakly supported is wrong. + + * strace.1 (BUGS): Remove the remark about weakly supported -i option. + +2017-07-06 Dmitry V. Levin + + Post-release administrivia. + * NEWS: Add a header line for the next release. + * debian/changelog.in: Add a changelog entry for 4.18-1. + * strace.spec.in: Likewise. + +2017-07-05 Dmitry V. Levin + + Prepare for 4.18 release. + * NEWS: Update for 4.18 release. + +2017-07-04 Dmitry V. Levin + + tests: robustify create_nl_socket based tests against the race condition + There is a race condition between the moment a netlink socket is created + and the moment it is reported via SOCK_DIAG_BY_FAMILY interface. + Add one more operation on the socket created by create_nl_socket + to increase chances of winning the race. + + * tests/create_nl_socket.c (create_nl_socket_ext): Add a getsockopt call + with the created socket. + +2017-07-04 Dmitry V. Levin + + Update NEWS. + +2017-07-04 Romain Naour + + nios2: fix wrong access to "SP" register in user_pt_regs. + Starting with linux commit v4.0-rc4~21^2, "SP" register + is available via regs[PTR_SP] member of struct user_pt_regs. + + * linux/nios2/arch_regs.h (nios2_sp_ptr): Change type + to "unsigned int *". + * linux/nios2/arch_regs.c (nios2_sp_ptr): Likewise. + Replace .sp with .regs[PTR_SP]. + + Fixes: http://autobuild.buildroot.net/results/b9f/b9fc25b82f3280872fe1593ac252a8529ba83576 + Fixes: v4.16-34-g6117728a ("nios2: export nios2_sp_ptr") + +2017-07-03 Eugene Syromyatnikov + Dmitry V. Levin + + tests: add multi-process check to qual_fault.test. + Check that syscall counters used for tampering are per-tcb. + + * tests/qual_fault.c: Include for open(), + for PATH_MAX, and for wait(). + (expfd): Rename to exp_fd, remove const qualifier and initialization. + (gotfd): Rename to got_fd, remove const qualifier and initialization. + (out_fd): New variable, for the expected strace output. + (open_file): New helper function. + (main): Remove st, add num_procs, proc, exp_prefix, got_prefix, + out_prefix, pid_prefix. Remove stat asserts, update argc assert. + Add num_procs, exp_prefix, got_prefix, out_prefix, pid_prefix + initialization. Add per-process loop, open expfd, gotfd, out_fd, pidfd + in each one, print process's pid to pidfd, print exit message to out_fd. + Add wait() call for each forked process. + * tests/qual_fault.test (N): increase to 100 in order to check + concurrent process execution. + (check_fault_injection): Take additional argument for the process + count, pass it to qual_fault, add filename variables for expected strace + output and pid file, pass them to qual_fault. + Specify -ff parameter to strace invocation. + Compare write and strace output for the each process. + Update all check_fault_injection invocation with process count argument, + add an invocation with 4 concurrent processes. + * tests/init.sh (TIMEOUT_DURATION): Raise from 120 to 300. + +2017-07-03 Dmitry V. Levin + + tests: adjust TEST_NLATTR_OBJECT and TEST_NLATTR_ARRAY for large objects + * tests/test_nlattr.h (TEST_NLATTR_OBJECT, TEST_NLATTR_ARRAY): Add + support for objects larger than DEFAULT_STRLEN. + * tests/nlattr_inet_diag_msg.c (main): Change pattern size + from DEFAULT_STRLEN to 4096. + * tests/nlattr_netlink_diag_msg.c: Likewise. + * tests/nlattr_unix_diag_msg.c: Likewise. + + Reported-by: JingPiao Chen + +2017-07-03 Dmitry V. Levin + + tests: move DEFAULT_STRLEN macro to tests.h. + * tests/tests.h [!DEFAULT_STRLEN] (DEFAULT_STRLEN): New macro. + * tests/mincore.c (DEFAULT_STRLEN): Remove. + * tests/mmsg_name.c: Likewise. + * tests/msg_control.c: Likewise. + * tests/netlink_protocol.c: Likewise. + * tests/nlattr.c: Likewise. + * tests/nlattr_inet_diag_msg.c: Likewise. + * tests/nlattr_netlink_diag_msg.c: Likewise. + * tests/nlattr_unix_diag_msg.c: Likewise. + * tests/printstr.c: Likewise. + * tests/xattr.c: Likewise. + * tests/execve.c: Likewise. + (main): Initialize str_a and str_b arrays at run time. + * tests/execveat.c: Likewise. + + Suggested-by: JingPiao Chen + +2017-07-03 Eugene Syromyatnikov + + tests: use unified diff in order to improve test log readability. + * tests/init.sh (match_diff): Add -u option to the diff invocation. + +2017-07-02 Dmitry V. Levin + + Fix error diagnostics in case of zero argc. + * strace.c (init): Adjust argc along with argv, + check that adjusted argc is sane. + * tests/zeroargc.c: New file. + * tests/.gitignore: Add zeroargc. + * tests/Makefile.am (check_PROGRAMS): Likewise. + * tests/options-syntax.test: Check strace error diagnostics + in case of zero argc. + +2017-07-02 Dmitry V. Levin + + Use program_invocation_name instead of a local progname variable. + Emulate program_invocation_name only if it is not provided by libc. + + * configure.ac: Check for program_invocation_name variable. + * strace.c (progname): Remove. + [!HAVE_PROGRAM_INVOCATION_NAME] (program_invocation_name): New variable. + (verror_msg, error_msg_and_help): Use it instead of progname. + (init): Initialize program_invocation_name instead of progname. + +2017-07-02 Dmitry V. Levin + Victor Krapivensky + + Introduce generic STRINGIFY and STRINGIFY_VAL macros. + * macros.h (STRINGIFY, STRINGIFY_VAL): New macros. + * mpers_type.h: Include "macros.h". + [IN_MPERS] (STRINGIFY): Remove. + * tests/sockname.c (TEST_SYSCALL_STR__, TEST_SYSCALL_STR_): Remove. + (TEST_SYSCALL_STR): Use STRINGIFY_VAL. + +2017-07-02 Dmitry V. Levin + + Introduce macros.h. + Introduce a separate header file for generic macros shared between + strace and its tests. Start this unification with ARRAY_SIZE macro. + + * defs.h: Include "macros.h". + (ARRAY_SIZE): Move ... + * macros.h: ... to new file. + * Makefile.am (strace_SOURCES): Add it. + * tests/tests.h: Include "macros.h". + (ARRAY_SIZE): Remove. All callers updated. + +2017-07-01 Dmitry V. Levin + + quota: use PRINT_FIELD_FLAGS. + * quota.c (struct xfs_dqblk): Change d_flags field's type from int8_t + to uint8_t. + (decode_cmd_data): Use PRINT_FIELD_FLAGS. + +2017-07-01 Dmitry V. Levin + + Unify different generic PRINT_FIELD_* implementations. + Create a new header print_fields.h and move generic PRINT_FIELD_* + macros there. + + * print_fields.h: New file. + * Makefile.am (strace_SOURCES): Add it. + * netlink_sock_diag.c: Include "print_fields.h". + (PRINT_FIELD_U, PRINT_FIELD_X, PRINT_FIELD_COOKIE, PRINT_FIELD_FLAGS, + PRINT_FIELD_XVAL): Move to print_fields.h file. + * quota.c: Include "print_fields.h". + (PRINT_FIELD_D): Move to print_fields.h file. + (PRINT_FIELD_U, PRINT_FIELD_X): Remove. + * statx.c: Include "print_fields.h". + (PRINT_FIELD_U): Remove. + (SYS_FUNC(statx)): Update PRINT_FIELD_U callers. + * tests/quotactl.h: Include "print_fields.h". + * tests/quotactl-xfs.c: Update callers of PRINT_FIELD_* macros. + * tests/quotactl.c: Likewise. + (PRINT_FIELD_D, PRINT_FIELD_U, PRINT_FIELD_X): Remove. + * tests/test_nlattr.h: Include "print_fields.h". + (PRINT_FIELD_U, PRINT_FIELD_X): Remove. + * tests/xstatx.c: Include "print_fields.h". + (PRINT_FIELD_U): Remove. + (print_stat): Update PRINT_FIELD_U callers. + * tests/tests.h [!STRACE_PRINTF] (STRACE_PRINTF): Define to printf. + +2017-07-01 Eugeniy Paltsev + + arc: fix wrong access to "sp" member in user_regs_struct. + "sp" register is a member of "scratch" structure (which is nested + in user_regs_struct) + + * linux/arc/arch_regs.c: Replace .sp with .scratch.sp . + + Fixes: v4.16-31-g134042a5 ("arc: export arc_sp_ptr") + +2017-07-01 Khem Raj + + aarch64, tile: replace struct ucontext with ucontext_t. + glibc >= 2.26 has dropped the tag struct ucontext from ucontext_t type. + + * linux/arm/arch_sigreturn.c (arch_sigreturn) [AARCH64]: Replace + struct ucontext with ucontext_t. + * linux/tile/arch_sigreturn.c (arch_sigreturn): Likewise. + +2017-07-01 Dmitry V. Levin + + tests: enhance nlattr_unix_diag_msg test. + * tests/nlattr_unix_diag_msg.c: Include "test_nlattr.h". + (test_unix_diag_vfs, test_unix_diag_icons, test_unix_diag_rqlen): + Remove. + (init_unix_diag_msg): Add const qualifier to arguments and variables. + (print_unix_diag_msg, print_uint): New functions. + (main): Use them and macros from test_nlattr.h file. + +2017-07-01 JingPiao Chen + + tests: check decoding of netlink unix_diag_msg attributes. + * tests/nlattr_unix_diag_msg.c: New file. + * tests/gen_tests.in (nlattr_unix_diag_msg): New entry. + * tests/pure_executables.list: Add nlattr_unix_diag_msg. + * tests/.gitignore: Likewise. + +2017-07-01 Dmitry V. Levin + + netlink_sock_diag: ensure that structure field names are printed properly + * netlink_sock_diag.c (decode_unix_diag_vfs, decode_unix_diag_rqlen): + Use PRINT_FIELD_U to print structure fields. + +2017-07-01 Dmitry V. Levin + + netlink_sock_diag: add const qualifiers. + Add const qualifiers to auto variables and function arguments. + This change does not affect the code generated by the compiler, + the purpose of these "const" qualifiers is to highlight the intent. + + * netlink_sock_diag.c (decode_unix_diag_vfs, decode_unix_diag_inode, + decode_unix_diag_rqlen): Add const qualifier to tcp, addr, and len + arguments. + +2017-07-01 JingPiao Chen + + netlink: decode AF_UNIX unix_diag_msg attributes. + * netlink_sock_diag.c (unix_diag_msg_nla_decoders): New array. + (decode_unix_diag_msg): Use it. + * linux/unix_diag.h (unix_diag_vfs, unix_diag_rqlen): New structures. + +2017-07-01 Dmitry V. Levin + + tests: enhance nlattr_netlink_diag_msg test. + * tests/nlattr_netlink_diag_msg.c: Include "test_nlattr.h". + (test_netlink_diag_groups, test_netlink_diag_rx_ring, + test_netlink_diag_flags): Remove. + (init_netlink_diag_msg): Add const qualifier to arguments and variables. + (print_netlink_diag_msg, print_xlong): New functions. + (main): Use them and macros from test_nlattr.h file. + +2017-07-01 JingPiao Chen + + tests: check decoding of netlink_diag_msg attributes. + * tests/nlattr_netlink_diag_msg.c: New file. + * tests/gen_tests.in (nlattr_netlink_diag_msg): New entry. + * tests/pure_executables.list: Add nlattr_netlink_diag_msg. + * tests/.gitignore: Likewise. + +2017-07-01 Dmitry V. Levin + + netlink_sock_diag: ensure that structure field names are printed properly + * netlink_sock_diag.c (decode_netlink_diag_ring): Use PRINT_FIELD_U + to print structure fields. + +2017-07-01 Dmitry V. Levin + + netlink_sock_diag: add const qualifiers. + Add const qualifiers to auto variables and function arguments. + This change does not affect the code generated by the compiler, + the purpose of these "const" qualifiers is to highlight the intent. + + * netlink_sock_diag.c (print_group, decode_netlink_diag_groups, + decode_netlink_diag_ring, decode_netlink_diag_flags): Add const + qualifier to tcp, addr, and len arguments. + +2017-07-01 JingPiao Chen + + netlink: decode AF_NETLINK netlink_diag_msg attributes. + * linux/netlink_diag.h (netlink_diag_ring): New structure. + (NDIAG_FLAG_*): New macros. + * netlink_sock_diag.c: Include "xlat/netlink_socket_flags.h". + (print_group, decode_netlink_diag_groups, decode_netlink_diag_ring, + decode_netlink_diag_flags): New functions. + (netlink_diag_msg_nla_decoders): New array. + (decode_netlink_diag_msg): Use it. + * xlat/netlink_socket_flags.in: New file. + +2017-07-01 Dmitry V. Levin + + netlink_sock_diag: print inet_diag_sockid.idiag_if as an interface index + * netlink_sock_diag.c (print_inet_diag_sockid): Print idiag_if field + using print_ifindex. + * tests/nlattr_inet_diag_msg.c: Include . + (IFINDEX_LO): New macro. + (init_inet_diag_msg): Set inet_diag_sockid.idiag_if field. + (print_inet_diag_msg): Update expected output. + +2017-07-01 Dmitry V. Levin + JingPiao Chen + + tests: check decoding of several standard netlink attributes. + * tests/nlattr_inet_diag_msg.c (main): Check decoding of uint32_t, + uint8_t, and zero-terminated string attributes. + +2017-06-30 Dmitry V. Levin + + tests: enhance nlattr_inet_diag_msg test. + * tests/test_nlattr.h: New file. + * tests/Makefile.am (libtests_a_SOURCES): Add it. + * tests/nlattr_inet_diag_msg.c: Include "test_nlattr.h". + (test_inet_diag_meminfo, test_inet_diag_vegasinfo, + test_inet_diag_dctcpinfo, test_inet_diag_bbrinfo): Remove. + (address): New variable. + (init_inet_diag_msg): Remove "address" argument, add const qualifier + to all remaining arguments. + (print_inet_diag_msg, print_uint): New functions. + (main): Use macros from test_nlattr.h file. + +2017-06-30 JingPiao Chen + + tests: check decoding of netlink inet_diag_msg attributes. + * tests/nlattr_inet_diag_msg.c: New file. + * tests/gen_tests.in (nlattr_inet_diag_msg): New entry. + * tests/pure_executables.list: Add nlattr_inet_diag_msg. + * tests/.gitignore: Likewise. + +2017-06-30 Dmitry V. Levin + + netlink_sock_diag: ensure that structure field names are printed properly + * netlink_sock_diag.c (PRINT_FIELD_X): New macro. + (decode_inet_diag_meminfo, decode_tcpvegas_info, decode_tcp_dctcp_info, + decode_tcp_bbr_info): Use it and PRINT_FIELD_U to print structure + fields. + +2017-06-30 Dmitry V. Levin + + netlink_sock_diag: add const qualifiers. + Add const qualifiers to auto variables and function arguments. + This change does not affect the code generated by the compiler, + the purpose of these "const" qualifiers is to highlight the intent. + + * netlink_sock_diag.c (print_meminfo, decode_meminfo, + decode_inet_diag_meminfo, decode_tcpvegas_info, decode_tcp_dctcp_info, + decode_tcp_bbr_info): Add const qualifier to tcp, addr, and len + arguments. + +2017-06-30 JingPiao Chen + + netlink: decode AF_INET inet_diag_msg attributes. + * linux/inet_diag.h (inet_diag_meminfo, tcpvegas_info, + tcp_dctcp_info, tcp_bbr_info): New structures. + * linux/sock_diag.h (SK_MEMINFO_VARS): New macro. + * netlink_sock_diag.c: Include . + (print_meminfo, decode_meminfo, decode_inet_diag_meminfo, + decode_tcpvegas_info, decode_tcp_dctcp_info, decode_tcp_bbr_info): + New functions. + (inet_diag_msg_nla_decoders): New array. + (decode_inet_diag_msg): Use it. + +2017-06-30 Dmitry V. Levin + + nlattr: add const qualifiers to auto variables and function arguments. + This change does not affect the code generated by the compiler, + the purpose of these "const" qualifiers is to highlight the intent. + + * nlattr.c (decode_nlattr_with_data, decode_nla_str, decode_nla_strn, + decode_nla_##name): Add const qualifier to tcp, addr, and len arguments. + +2017-06-30 JingPiao Chen + Fabien Siron + + netlink: introduce nla_decoder_t to parse netlink attributes data. + * nlattr.h (nla_decoder_t): New typedef. + (DECL_NLA): New macro. + (decode_nlattr): Add decoders, size and opaque_data argument. + * nlattr.c: (decode_nlattr_with_data): Likewise. + (decode_nla_*): New functions. + * netlink_sock_diag.c (decode_inet_diag_req_compat) + (decode_inet_diag_req_v2, decode_inet_diag_msg) + (decode_netlink_diag_msg, (decode_packet_diag_msg) + (decode_smc_diag_msg, decode_unix_diag_msg): Add decoders, + size and opaque_data arguments. All callers updated. + +2017-06-30 JingPiao Chen + + netlink: add a basic netlink attribute parser of AF_SMC diag. + * netlink_sock_diag.c: Include "xlat/smc_diag_attrs.h". + (decode_smc_diag_msg): Use decode_nlattr. + * xlat/smc_diag_attrs.in: New file. + +2017-06-30 JingPiao Chen + Fabien Siron + + netlink: add a basic netlink attribute parser of AF_INET diag. + * linux/inet_diag.h (INET_DIAG_REQ_*): New enum. + * netlink_sock_diag.c: Include "xlat/inet_diag_attrs.h" + and "xlat/inet_diag_req_attrs.h". + (decode_inet_diag_req_compat, decode_inet_diag_req_v2, + decode_inet_diag_msg): Use decode_nlattr. + * xlat/inet_diag_attrs.in: New file. + * xlat/inet_diag_req_attrs.in: Likewise. + + netlink: add a basic netlink attribute parser of AF_PACKET diag. + * linux/packet_diag.h (PACKET_DIAG_*): New enum. + * netlink_sock_diag.c: Include "xlat/packet_diag_attrs.h". + (decode_packet_diag_msg): Use decode_nlattr. + * xlat/packet_diag_attrs.in: New file. + + netlink: add a basic netlink attribute parser of AF_NETLINK diag. + * linux/netlink_diag.h (NETLINK_DIAG_*): New enum. + * netlink_sock_diag.c: Include "xlat/netlink_diag_attrs.h". + (decode_netlink_diag_msg): Use decode_nlattr. + * xlat/netlink_diag_attrs.in: New file. + +2017-06-29 Dmitry V. Levin + + netlink_sock_diag: ensure that structure field names are printed properly + * netlink_sock_diag.c (PRINT_FIELD_U, PRINT_FIELD_COOKIE, + PRINT_FIELD_FLAGS, PRINT_FIELD_XVAL): New macros. + (decode_unix_diag_req, decode_unix_diag_msg, decode_netlink_diag_req, + decode_netlink_diag_msg, decode_packet_diag_req, decode_packet_diag_msg, + print_inet_diag_sockid, decode_inet_diag_req_compat, + decode_inet_diag_req_v2, decode_inet_diag_msg, decode_smc_diag_req, + decode_smc_diag_msg): Use them to print structure fields. + +2017-06-29 Gleb Fotengauer-Malinovskiy + + Update ioctl entries from linux v4.12-rc7. + * linux/32/ioctls_inc_align16.h: Update from linux v4.12-rc7 + (with f7a320ff commit applied on top) using ioctls_gen.sh. + * linux/32/ioctls_inc_align32.h: Likewise. + * linux/32/ioctls_inc_align64.h: Likewise. + * linux/64/ioctls_inc.h: Likewise. + * linux/x32/ioctls_inc0.h: Likewise. + * NEWS: Mention this. + +2017-06-29 Gleb Fotengauer-Malinovskiy + + maint: fix ioctls_sym.sh premature termination. + When the list of headers do not fit into the command line, xargs splits + it into several lists and then passes them to grep. If no headers from + a list match the grep pattern, grep exits with a non-zero status that + causes xargs to exit with a non-zero status, too. + + * maint/ioctls_sym.sh: Use "find -exec +" instead of xargs, + ignore its exit status. + +2017-06-27 JingPiao Chen + + tests: introduce NLMSG_ATTR macro. + * tests/tests.h (NLMSG_ATTR): New macro. + * tests/nlattr.c (test_nlattr, test_nla_type): Use it. + +2017-06-27 JingPiao Chen + + netlink: pass NLMSG_DONE messages to family specific payload decoders. + While many NLMSG_DONE messages indeed have payload containing + just one integer, there are exceptions. Handle this by passing + payloads of NLMSG_DONE messages to family specific netlink + payload decoders. + + * netlink.c (print_nlmsghdr): Do not skip family detection + for nlmsg_type == NLMSG_DONE. + (decode_nlmsg_type): Skip family specific type decoders + for type == NLMSG_DONE. + (decode_nlmsg_flags): Skip family specific decoding of flags + for type == NLMSG_DONE. + (decode_netlink_sock_diag): Skip for nlmsg_type == NLMSG_DONE. + +2017-06-26 Dmitry V. Levin + + Unexport die_out_of_memory. + Print more specific error diagnostics than a generic "Out of memory" + when an error happens outside xmalloc.c. + + * defs.h (die_out_of_memory): Remove prototype. + * strace.c (strace_popen, init): Call perror_msg_and_die instead + of die_out_of_memory. + * unwind.c (unwind_tcb_init): Likewise. + * xmalloc.c (die_out_of_memory): Add static qualifier. + +2017-06-26 Dmitry V. Levin + + Check -s argument early. + * util.c (printstr_ex): Move the check that -s argument + does not exceed -1U / 4 ... + * strace.c (init): ... here. + * tests/options-syntax.test: Check it. + +2017-06-25 Dmitry V. Levin + + Include "netlink.h" instead of + * net.c: Include "netlink.h" instead of . + * sockaddr.c: Likewise. + * tests/create_nl_socket.c: Likewise. + * tests/net-sockaddr.c: Likewise. + * tests/netlink_audit.c: Likewise. + * tests/netlink_generic.c: Likewise. + * tests/netlink_inet_diag.c: Likewise. + * tests/netlink_netfilter.c: Likewise. + * tests/netlink_route.c: Likewise. + * tests/netlink_selinux.c: Likewise. + * tests/netlink_xfrm.c: Likewise. + * tests/net-yy-netlink.c: Include "netlink.h" instead + of , remove fallback definition of NETLINK_SOCK_DIAG. + * tests/netlink_netlink_diag.c: Likewise. + * tests/netlink_protocol.c: Likewise. + * tests/netlink_sock_diag.c: Likewise. + * tests/netlink_unix_diag.c: Likewise. + * tests/nlattr.c: Likewise. + +2017-06-24 Dmitry V. Levin + + netlink: provide a fallback definition of NETLINK_SOCK_DIAG. + Add a fallback definition of NETLINK_SOCK_DIAG to netlink.h + instead of adding these fallback definitions to every file. + + * netlink.h: Provide a fallback definition of NETLINK_SOCK_DIAG. + * socketutils.c: Include "netlink.h" instead of , + remove fallback definition of NETLINK_SOCK_DIAG. + +2017-06-23 Dmitry V. Levin + + Update prctl ARCH_* constants. + * xlat/archvals.in: Add ARCH_GET_CPUID and ARCH_SET_CPUID + introduced by linux kernel commit v4.12-rc1~153^2~2. + +2017-06-22 Dmitry V. Levin + + Update V4L2_* constants. + * xlat/v4l2_buf_types.in: Add V4L2_BUF_TYPE_META_CAPTURE introduced + by linux kernel commit v4.12-rc1~85^2~71. + * xlat/v4l2_device_capabilities_flags.in: Add V4L2_CAP_META_CAPTURE + introduced by the same commit. + * xlat/v4l2_control_flags.in: Add V4L2_CTRL_FLAG_HAS_PAYLOAD, + V4L2_CTRL_FLAG_EXECUTE_ON_WRITE, and V4L2_CTRL_FLAG_MODIFY_LAYOUT + introduced by linux kernel commits v3.17-rc1~112^2~363, + v4.1-rc1~59^2~1^2~63, and v4.12-rc1~85^2~62, respectively. + * xlat/v4l2_control_types.in: Add V4L2_CTRL_TYPE_U8, V4L2_CTRL_TYPE_U16, + and V4L2_CTRL_TYPE_U32 introduced by linux kernel commits + v3.17-rc1~112^2~343 and v3.17-rc1~112^2~112. + + Update SCTP_* constants. + * xlat/socksctpoptions.in: Add SCTP_ENABLE_STREAM_RESET, + SCTP_RESET_STREAMS, SCTP_RESET_ASSOC, SCTP_ADD_STREAMS, + SCTP_RECONFIG_SUPPORTED, and SCTP_PR_STREAM_STATUS introduced + by linux kernel commits v4.11-rc1~124^2~387^2~1, v4.11-rc1~124^2~387^2, + v4.11-rc1~124^2~166^2~2, v4.11-rc1~124^2~166^2, v4.12-rc1~64^3~469^2, + and v4.12-rc1~64^3~276, respectively. + + Update RTM_* constants. + * xlat/nl_route_types.in: Add RTM_DELNETCONF introduced + by linux kernel commit v4.12-rc1~64^3~312^2~6. + + Update NDIAG_SHOW_* constants. + * linux/netlink_diag.h (NDIAG_SHOW_FLAGS): New constant introduced + by linux kernel commit v4.12-rc1~64^3~260. + * xlat/netlink_diag_show.in: Add it. + + Update KEYCTL_* constants. + * xlat/keyctl_commands.in: Add KEYCTL_RESTRICT_KEYRING introduced + by linux kernel commit v4.12-rc1~123^2~7^2~2^2~3. + + Update ARPHRD_* constants. + * xlat/arp_hardware_types.in: Add ARPHRD_VSOCKMON introduced + by linux kernel commit v4.12-rc1~129^2~118^2~2. + + Update SO_* constants. + * xlat/sockoptions.in: Add SO_MEMINFO, SO_INCOMING_NAPI_ID, + and SO_COOKIE introduced by linux kernel commits v4.12-rc1~64^3~389, + v4.12-rc1~64^3~341^2, and v4.12-rc1~64^3~221^2~1, respectively. + +2017-06-21 Dmitry V. Levin + + tests: check more corner cases of nlattr decoding. + * tests/nlattr.c (test_nlattr): Check decoding in case of invalid + struct nlattr.nla_len. + +2017-06-21 JingPiao Chen + + tests: check decoding of netlink attribute. + * tests/nlattr.c: New file. + * tests/gen_tests.in (nlattr): New entry. + * tests/pure_executables.list: Add nlattr. + * tests/.gitignore: Likewise. + +2017-06-21 JingPiao Chen + Fabien Siron + + netlink: introduce a basic netlink attributes parser. + * linux/unix_diag.h (UNIX_DIAG_*): New enum. + * nlattr.c: New file. + * nlattr.h: Likewise. + * Makefile.am (strace_SOURCES): Add them. + * netlink_sock_diag.c: Include "nlattr.h" and "xlat/unix_diag_attrs.h". + (decode_unix_diag_msg): Use decode_nlattr. + * xlat/unix_diag_attrs.in: New file. + +2017-06-21 JingPiao Chen + + netlink: introduce netlink.h. + * netlink.h: New file. + * Makefile.am (strace_SOURCES): Add it. + * netlink_sock_diag.c: Include "netlink.h", + remove and . + * netlink.c: Likewise. + (NLMSG_HDRLEN): Move to netlink.h. + * tests/netlink_protocol.c: Replace with "netlink.h". + * tests/netlink_sock_diag.c: Likewise. + +2017-06-20 Dmitry V. Levin + + tests: add SET_STRUCT macro to tests.h. + * tests/netlink_sock_diag.c (INIT_STRUCT): Rename to SET_STRUCT, + all callers updated. Move ... + * tests/tests.h: ... here. + +2017-06-19 Dmitry V. Levin + + tests: fix potential unaligned access in netlink_sock_diag.test. + Despite our efforts made to avoid unaligned access, gcc appears to be + generating instructions that might cause unaligned access when copying + structures to unaligned addresses. + + Fix this issue by replacing copying of structures to unaligned addresses + with memcpy calls. + + * tests/netlink_sock_diag.c (INIT_STRUCT): New macro. + (test_odd_family_req, test_odd_family_msg, test_unix_diag_req, + test_unix_diag_msg, test_netlink_diag_req, test_netlink_diag_msg, + test_packet_diag_req, test_packet_diag_msg, test_inet_diag_sockid, + test_inet_diag_req, test_inet_diag_req_v2, test_inet_diag_msg, + test_smc_diag_req, test_smc_diag_msg): Use it to initialize potentially + unaligned struct nlmsghdr. Do not access nlh->nlmsg_len. + +2017-06-19 Masatake YAMATO + + tests: check decoding of NETLINK_GENERIC message types. + * tests/netlink_generic.c: New file. + * tests/gen_tests.in (netlink_generic): New entry. + * tests/pure_executables.list: Add netlink_generic. + * tests/.gitignore: Likewise. + +2017-06-19 Masatake YAMATO + + netlink: add decoding of NETLINK_GENERIC protocol families. + NETLINK_GENERIC is a protocol stacked on netlink protocol. + + When a NETLINK_GENERIC subsystem registers its "family" name in the + kernel at run time, an integer value associated with this name is + assigned by the kernel. This integer value is specified in struct + nlmsghdr.nlmsg_type of subsequent communications with the + NETLINK_GENERIC subsystem. + + This change implements decoding of NETLINK_GENERIC message types in + symbolic form, for example: + + $ ./strace -yy -e 'sendto' ip tcp_metrics > /dev/null + sendto(4, {{len=20, type=tcp_metrics, ... + +++ exited with 0 +++ + + Note that type= specifying the NETLINK_GENERIC protocol family + is decoded properly. + + * netlink.c (decode_nlmsg_type_generic): New function. + (nlmsg_types): Add NETLINK_GENERIC entry. + +2017-06-19 Masatake YAMATO + + socketutils: build a dynamic xlat table for NETLINK_GENERIC decoding. + * configure.ac (AC_CHECK_HEADERS): Add linux/genetlink.h. + * defs.h (genl_families_xlat): New prototype. + * socketutils.c [HAVE_LINUX_GENETLINK_H]: Include . + [HAVE_LINUX_GENETLINK_H] (genl_send_dump_families, + genl_parse_families_response): New helper functions. + (genl_families_xlat): New function for building the xlat table + for NETLINK_GENERIC decoding. + +2017-06-19 Masatake YAMATO + + dyxlat: new interface for building xlat tables dynamically. + xlat tables are usually generated at build time. + + printxval is suitable for printing struct nlmsghdr.nlmsg_type for + NETLINK_GENERIC protocol. However, the corresponding xlat table + cannot be defined at build time because the values are registered + by the kernel at run time. + + This change introduces dyxlat functions for building xlat tables + dynamically. The primary use case is decoding nlmsg_type but this + interface can be used for other purposes. + + * defs.h (struct dyxlat): New opaque data type. + (dyxlat_alloc, dyxlat_free, dyxlat_add_pair): New function declarations. + * dyxlat.c: New file. + * Makefile.am (strace_SOURCES): Add it. + +2017-06-19 Masatake YAMATO + + Introduce xstrndup function. + * configure.ac (AC_CHECK_FUNCS): Add strndup. + * defs.h (xstrndup): New prototype. + * xmalloc.c (xstrndup): New function. + +2017-06-18 Dmitry V. Levin + + netlink: do not print extra braces around payloadless nlmsghdr. + * netlink.c (decode_nlmsghdr_with_payload): Print braces before + print_nlmsghdr and after decode_payload iff decode_payload is invoked. + * tests/netlink_audit.c (test_nlmsg_type): Update expected output. + * tests/netlink_netfilter.c: Likewise. + * tests/netlink_selinux.c: Likewise. + * tests/netlink_protocol.c (send_query): Likewise. + * tests/netlink_route.c (test_nlmsg_type, test_nlmsg_flags): Likewise. + * tests/netlink_sock_diag.c: Likewise. + * tests/netlink_xfrm.c: Likewise. + +2017-06-17 Dmitry V. Levin + + Strip argument name of type "struct tcb *" from function prototypes. + "struct tcb *" was used in most prototypes along with "struct tcb *tcp", + this change converts the latter form to the former for consistency. + + Fix a few spacing style issues. + Reported by kernel's checkpatch.pl script. + +2017-06-17 Dmitry V. Levin + + Strip redundant trailing semicolons. + Strip trailing semicolons from macro definitions. + Strip extra semicolons from statements terminations. + + Reported by kernel's checkpatch.pl script. + +2017-06-17 Dmitry V. Levin + + Fix macros encosure in a do/while loop. + Enclose macros with multiple statements and macros starting + with "if" statement in a do/while loop. + Do not enclose single statement macros in a do/while loop. + + Reported by kernel's checkpatch.pl script. + +2017-06-17 Dmitry V. Levin + + Use __func__ instead of gcc specific __FUNCTION__ + Reported by kernel's checkpatch.pl script. + +2017-06-17 Dmitry V. Levin + + Fix a few initialization style issues. + Do not initialise statics and globals to 0, NULL, or false. + + Reported by kernel's checkpatch.pl script. + +2017-06-17 Dmitry V. Levin + + Fix function prototypes with unspecified arguments. + Change functions declared as taking unspecified number of arguments + of unspecified type to functions that take no arguments. + + Reported by kernel's checkpatch.pl script. + +2017-06-17 Dmitry V. Levin + + Fix a few sizeof style issues. + Reported by kernel's checkpatch.pl script. + + Fix a few misspellings in comments. + Reported by kernel's checkpatch.pl script. + +2017-06-16 Dmitry V. Levin + + print_mreq: remove superfluous print_quoted_string calls. + The string returned by inet_ntoa(3) has IPv4 dotted-decimal notation, + no need to quote it. + + * net.c (print_mreq): Remove print_quoted_string calls. + +2017-06-15 Dmitry V. Levin + + tests: check decoding of incomplete SCM_TIMESTAMP* control messages. + * tests/msg_control.c (test_scm_timestamp, test_scm_timestampns, + test_scm_timestamping): Check decoding of incomplete control messages. + +2017-06-15 Miroslav Lichvar + + msghdr: print SCM_TIMESTAMP* control messages. + Add support for printing control messages containing software and/or + hardware timestamps, which are typically enabled by NTP and PTP + implementations. + + * print_timeval.c (print_struct_timeval_data_size): New mpers printer. + * print_timespec.c (print_struct_timespec_data_size, + print_struct_timespec_array_data_size): Likewise. + * msghdr.c (print_scm_timestamp, print_scm_timestampns, + print_scm_timestamping): New functions. + (cmsg_socket_printers): Add them. + * NEWS: Mention this change. + * tests/msg_control.c: Include "xlat.h" and "xlat/scmvals.h". + (test_scm_timestamp, test_scm_timestampns, test_scm_timestamping): + New functions. + (test_sol_socket): Use them. + +2017-06-15 JingPiao Chen + + tests: check decoding of NETLINK_SOCK_DIAG AF_SMC messages. + * tests/netlink_sock_diag.c: Include . + (SMC_ACTIVE): New macro. + (test_smc_diag_req, test_smc_diag_msg): New functions. + (main): Use them. + + netlink: add a basic socket diag parser of AF_SMC messages. + * linux/smc_diag.h: New file. + * Makefile.am (EXTRA_DIST): Add it. + * netlink_sock_diag.c: Include , + "xlat/smc_diag_extended_flags.h" and "xlat/smc_states.h". + (decode_smc_diag_req, decode_smc_diag_msg): New functions. + (diag_decoders): Add AF_SMC. + * xlat/smc_diag_extended_flags.in: New file. + * xlat/smc_states.in: Likewise. + +2017-06-15 JingPiao Chen + Fabien Siron + + tests: check decoding of NETLINK_SOCK_DIAG AF_INET messages. + * tests/netlink_sock_diag.c: Include + and . + (test_inet_diag_sockid, test_inet_diag_req, test_inet_diag_req_v2, + test_inet_diag_msg): New functions. + (mian): Use them. + + netlink: add a basic socket diag parser of AF_INET and AF_INET6 messages + * defs.h (inet_protocols): New xlat prototype. + * linux/inet_diag.h (inet_diag_req): New structure. + (INET_DIAG_*): New enum. + * netlink_sock_diag.c: Include , + and "xlat/inet_diag_extended_flags.h". + (print_inet_diag_sockid, decode_inet_diag_req_compat) + (decode_inet_diag_req_v2, decode_inet_diag_req) + (decode_inet_diag_msg): New functions. + (diag_decoders): Add AF_INET and AF_INET6; + * xlat/inet_diag_extended_flags.in: New file. + +2017-06-15 Dmitry V. Levin + + Introduce print_inet_addr. + * defs.h (print_inet_addr): New prototype. + * sockaddr.c (print_inet_addr): New function. + (print_sockaddr_data_in6): Use it. + * net.c (print_mreq6): Likewise. + * tests/ip_mreq.c (main): Update expected output. + +2017-06-15 JingPiao Chen + Fabien Siron + + tests: check decoding of NETLINK_SOCK_DIAG AF_PACKET messages. + * tests/netlink_sock_diag.c: Include + and . + (test_packet_diag_req, test_packet_diag_msg): New functions. + (main): Use them. + + netlink: add a basic socket diag parser of AF_PACKET messages. + * linux/packet_diag.h: New file. + * Makefile.am (EXTRA_DIST): Add it. + * defs.h (ethernet_protocols): New xlat prototype. + * netlink_sock_diag.c: Include + and "xlat/packet_diag_show.h". + (decode_packet_diag_req, decode_packet_diag_msg): New functions. + (diag_decoders): Add AF_PACKET. + * xlat/packet_diag_show.in: New file. + + tests: check decoding of NETLINK_SOCK_DIAG AF_NETLINK messages. + * tests/netlink_sock_diag.c: Include . + (test_netlink_diag_req, test_netlink_diag_msg): New functions. + (main): Use them. + + netlink: add a basic socket diag parser of AF_NETLINK messages. + * linux/netlink_diag.h (NDIAG_SHOW_GROUPS, NDIAG_SHOW_RING_CFG): + New macros. + * netlink_sock_diag.c: Include , + "xlat/netlink_diag_show.h" and "xlat/netlink_states.h". + (decode_netlink_diag_req, decode_netlink_diag_msg): New functions. + (diag_decoders): Add AF_NETLINK. + * xlat/netlink_diag_show.in: New file. + * xlat/netlink_states.in: Likewise. + +2017-06-15 Dmitry V. Levin + Fabien Siron + JingPiao Chen + + tests: check decoding of NETLINK_SOCK_DIAG AF_UNIX messages. + * tests/netlink_sock_diag.c: Include + and . + (test_odd_family_req, test_odd_family_msg, test_unix_diag_req, + test_unix_diag_msg): New functions. + (main): Use them. + + netlink: add a basic socket diag parser of AF_UNIX messages. + * defs.h (socktypes): New xlat prototype. + * linux/unix_diag.h (UDIAG_SHOW_VFS, UDIAG_SHOW_ICONS, UDIAG_SHOW_RQLEN, + UDIAG_SHOW_MEMINFO): New macros. + * netlink_sock_diag.c: Include , , + , "xlat/tcp_states.h", "xlat/tcp_state_flags.h", + and "xlat/unix_diag_show.h". + (decode_unix_diag_req, decode_unix_diag_msg): New functions. + (netlink_diag_decoder_t): New typedef. + (diag_decoders): New array. + (decode_netlink_sock_diag): Use it. + * xlat/tcp_state_flags.in: New file. + * xlat/tcp_states.in: Likewise. + * xlat/unix_diag_show.in: Likewise. + + netlink: introduce family specific payload decoders. + * defs.h (netlink_decoder_t): New typedef. + (DECL_NETLINK): New macro. + (decode_netlink_sock_diag): New prototype. + * netlink.c (netlink_decoders): New array. + (decode_payload): Use it to invoke netlink family specific decoders. + * netlink_sock_diag.c: New file. + * Makefile.am (strace_SOURCES): Add it. + +2017-06-15 Dmitry V. Levin + + Update SCM_* constants. + * xlat/scmvals.in: Add SCM_TIMESTAMP, SCM_TIMESTAMPNS, SCM_TIMESTAMPING, + SCM_WIFI_STATUS, and SCM_TIMESTAMPING_OPT_STATS. + +2017-06-14 Dmitry V. Levin + + netlink: refactor decode_nlmsg_type. + * netlink.c (decode_nlmsg_type_default, decode_nlmsg_type_netfilter): + New functions. + (nlmsg_types_decoder_t): New typedef. + (nlmsg_types): Add decoder field. + (decode_nlmsg_type): Use it. + +2017-06-14 JingPiao Chen + + tests: extend printstr test. + * tests/printstr.c (main): Add a case for short read. + +2017-06-13 Dmitry V. Levin + + v4l2: fix preprocessor checks. + Fix checks for struct v4l2_window.global_alpha and struct + v4l2_sdr_format.buffersize. + + * v4l2.c (print_v4l2_format_fmt): Do not assume that + HAVE_STRUCT_V4L2_WINDOW_GLOBAL_ALPHA and + HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE are defined. + * tests/ioctl_v4l2.c (init_v4l2_format, dprint_ioctl_v4l2): Likewise. + +2017-06-12 Dmitry V. Levin + + Move xlat related functions to a separate file. + * util.c (xlookup, xlat_bsearch_compare, xlat_search, printxvals, + printxval_searchn, addflags, sprintflags, printflags_ex): Move ... + * xlat.c: ... to this new file. + * Makefile.am (strace_SOURCES): Add it. + +2017-06-12 Masatake YAMATO + + socketeutils: extend receive_responses further. + This is the second patch in series of implementing NETLINK_GENERIC + protocol decoder. + + This change allows passing of opaque user data to the callback function. + + * socketutils.c (receive_responses): Change the type of proto_name + argument from "const char *" to "void *" to allow passing + of arbitrary data to the callback function. + Rename proto_name to opaque_data, make it the last argument. + Pass it to the callback function as the last argument. + (inet_parse_response, unix_parse_response, netlink_parse_response): + Change the type of proto_name argument from "const char *" to "void *", + rename it to opaque_data, make it the last argument. + Introduce a local variable proto_name to convert the type + of opaque_data argument from "void *" to "const char *". + (unix_get, inet_get, netlink_get): Cast the protocol name from + "const char *" to "void *" for passing to the callback function. + +2017-06-12 Masatake YAMATO + + socketeutils: extend receive_responses to handle other netlink types. + This is the first patch in series of implementing NETLINK_GENERIC + protocol decoder. + + receive_responses was written for decoding kernel responses of type + SOCK_DIAG_BY_FAMILY, other types were ignored. + + This change makes the type of netlink response a parameter + so the function can be used for other types of communication. + + * socketutils.c (receive_responses): add a new parameter + expected_msg_type to handle types other than SOCK_DIAG_BY_FAMILY. + +2017-06-12 JingPiao Chen + + tests: fix typo. + * tests/dup3.c (SKIP_MAIN_UNDEFINED): Remove duplicated &&. + +2017-06-08 Dmitry V. Levin + + Introduce printflags_ex function. + Add printflags_ex extension over printflags64 that, similar + to printxvals, takes a NULL-terminated sequence of xlat pointers. + + * defs.h (printflags_ex): New prototype. + (printflags64): Turn into a thin wrapper around printflags_ex. + * netlink.c (decode_nlmsg_flags): Use printflags_ex. + * util.c (printflags_ex): New function. + (printflags64): Remove. + * xlat/netlink_get_flags.in: Remove entries listed + in xlat/netlink_flags.in file. + * xlat/netlink_new_flags.in: Likewise. + +2017-06-08 JingPiao Chen + + tests: add check for decoding netlink get and new flags. + * tests/netlink_route.c (test_nlmsg_flags): New function, checks + decoding of NETLINK_ROUTE get and new flags. + (main): Use it. + * tests/netlink_sock_diag.c (test_nlmsg_flags): New function, checks + decoding of NETLINK_SOCK_DIAG get flags. + (main): Use it. + * tests/netlink_xfrm.c: (test_nlmsg_flags): New function, checks + decoding of NETLINK_XFRM get and new flags. + (main): Use it. + +2017-06-08 JingPiao Chen + Fabien Siron + Dmitry V. Levin + + netlink: implement generic nlmsg_flags decoding. + * netlink.c: Include "xlat/netlink_get_flags.h" + and "xlat/netlink_new_flags.h". + (decode_nlmsg_flags): New function. + (print_nlmsghdr): Use it. + * xlat/netlink_get_flags.in: New file. + * xlat/netlink_new_flags.in: Likewise. + +2017-06-08 Dmitry V. Levin + + xlat: provide fallback definitions for XFRM_MSG_* constants. + Some of XFRM_MSG_* constants were introduced later than the header file + where they are defined. + + * xlat/nl_xfrm_types.in: Add default values for constants. + +2017-06-05 Victor Krapivensky + + syscall.c: split trace_syscall() into 6 functions. + This change removes the trace_syscall function. Now, the code that uses + syscall.c trace functions is expected to check whether it is a syscall + entry or exit (with entering(tcp)/exiting(tcp)) itself, and then make + an appropriate sequence of function calls. + + * defs.h: Update comment on TCB_INSYSCALL. + (trace_syscall): Remove prototype. + (syscall_entering_decode, syscall_entering_trace, + syscall_entering_finish, syscall_exiting_decode, syscall_exiting_trace, + syscall_exiting_finish): New prototypes. + * strace.c (trace_syscall): New static replacement for old trace_syscall. + * syscall.c (trace_syscall): Remove. + (trace_syscall_entering): Split into ... + (syscall_entering_decode, syscall_entering_trace, + syscall_entering_finish): ... new functions. + (trace_syscall_exiting): Split into ... + (syscall_exiting_decode, syscall_exiting_trace, + syscall_exiting_finish): ... new functions. + +2017-06-05 Dmitry V. Levin + + tests: guard against missing linux/netfilter/nfnetlink.h. + nfnetlink was introduced in linux by commit v2.6.14-rc1~1035^2~217, + add a guard for the case when system headers are not fresh enough. + + * configure.ac (AC_CHECK_HEADERS): Add linux/netfilter/nfnetlink.h. + * tests/netlink_netfilter.c: Check for HAVE_LINUX_NETFILTER_NFNETLINK_H. + +2017-06-05 JingPiao Chen + + tests: check decoding of NETLINK_XFRM message types. + * tests/netlink_xfrm.c: New file. + * tests/gen_tests.in (netlink_xfrm): New entry. + * tests/pure_executables.list: Add netlink_xfrm. + * tests/.gitignore: Likewise. + + tests: check decoding of NETLINK_SELINUX message types. + * tests/netlink_selinux.c: New file. + * tests/gen_tests.in (netlink_selinux): New entry. + * tests/pure_executables.list: Add netlink_selinux. + * tests/.gitignore: Likewise. + + tests: check decoding of NETLINK_NETFILTER message types. + * tests/netlink_netfilter.c: New file. + * tests/gen_tests.in (netlink_netfilter): New entry. + * tests/pure_executables.list: Add netlink_netfilter. + * tests/.gitignore: Likewise. + + tests: check decoding of NETLINK_AUDIT message types. + * tests/netlink_audit.c: New file. + * tests/gen_tests.in (netlink_audit): New entry. + * tests/pure_executables.list: Add netlink_audit. + * tests/.gitignore: Likewise. + + tests: check decoding of NETLINK_ROUTE message types. + * tests/netlink_route.c: New file. + * tests/gen_tests.in (netlink_route): New entry. + * tests/pure_executables.list: Add netlink_route. + * tests/.gitignore: Likewise. + + tests: check decoding of NETLINK_SOCK_DIAG message types. + * tests/netlink_sock_diag.c: New file. + * tests/netlink_sock_diag.test: New test. + * tests/pure_executables.list: Add netlink_sock_diag. + * tests/.gitignore: Likewise. + * tests/Makefile.am (DECODER_TESTS): Add netlink_sock_diag.test. + +2017-06-05 Dmitry V. Levin + + tests: use create_nl_socket in netlink_protocol.test. + * tests/netlink_protocol.c (main): Use create_nl_socket. + + tests: change netlink_protocol.test to trace sendto syscalls only. + * tests/gen_tests.in (netlink_protocol): Replace %network with sendto. + * tests/netlink_protocol.c (main): Update expected output. + + tests: enhance create_nl_socket diagnostics messages. + * tests/tests.h (create_nl_socket): Rename to create_nl_socket_ext, + add a string argument. + (create_nl_socket): New macro wrapper around create_nl_socket_ext. + * tests/create_nl_socket.c (create_nl_socket): Rename + to create_nl_socket_ext, add a string argument, include it + in diagnostic messages. + + tests: use const and designated initializers in create_nl_socket.c. + * tests/create_nl_socket.c: Stop including . + (create_nl_socket): Use const and designated initializers. + +2017-06-05 JingPiao Chen + + tests: add create_nl_socket function to libtests. + * tests/create_nl_socket.c: New file. + * tests/tests.h (create_nl_socket): New prototype. + * tests/Makefile.am (libtests_a_SOURCES): Add create_nl_socket.c. + +2017-06-05 Dmitry V. Levin + Fabien Siron + + netlink: add decoding of NETLINK_NETFILTER message types. + * xlat/nl_netfilter_msg_types.in: New file. + * xlat/nl_netfilter_subsys_ids.in: Likewise. + * netlink.c: Include "xlat/nl_netfilter_msg_types.h" + and "xlat/nl_netfilter_subsys_ids.h". + (nlmsg_types): Add NETLINK_NETFILTER. + (decode_nlmsg_type): Handle NETLINK_NETFILTER. + + netlink: add decoding of NETLINK_XFRM message types. + * xlat/nl_xfrm_types.in: New file. + * netlink.c: Include "xlat/nl_xfrm_types.h". + (nlmsg_types): Add NETLINK_XFRM. + + netlink: add decoding of NETLINK_SELINUX message types. + * xlat/nl_selinux_types.in: New file. + * netlink.c: Include "xlat/nl_selinux_types.h". + (nlmsg_types): Add NETLINK_SELINUX. + + netlink: add decoding of NETLINK_ROUTE message types. + * xlat/nl_route_types.in: New file. + * netlink.c: Include and "xlat/nl_route_types.h". + (nlmsg_types): Add NETLINK_ROUTE. + + netlink: add decoding of NETLINK_AUDIT message types. + * xlat/nl_audit_types.in: New file. + * netlink.c: Include and "xlat/nl_audit_types.h". + (nlmsg_types): Add NETLINK_AUDIT. + +2017-06-05 Dmitry V. Levin + Fabien Siron + + netlink: implement generic nlmsg_type decoding. + Implement a pluggable mechanism of nlmsg_type decoding. + Add decoding of NETLINK_SOCK_DIAG types. + + * linux/sock_diag.h (SOCK_DESTROY): New macro. + * xlat/nl_sock_diag_types.in: New file. + * netlink.c: Include xlat/nl_sock_diag_types.h. + (get_fd_nl_family, decode_nlmsg_type): New functions. + (print_nlmsghdr): Use them for nlmsg_type decoding. + +2017-06-05 Dmitry V. Levin + + netlink: add netlink family argument to printers and decoders. + * netlink.c (NL_FAMILY_ERROR, NL_FAMILY_DEFAULT): New constants. + (print_nlmsghdr): Add netlink family argument, change return type + to int, return family. + (decode_nlmsghdr_with_payload, decode_nlmsgerr, decode_payload): Add + netlink family argument. All callers updated. + +2017-06-05 Fabien Siron + Dmitry V. Levin + + Add file descriptor argument to decode_netlink. + * defs.h (decode_netlink): Add file descriptor argument. + * io.c (print_iovec): Specify file descriptor to decode_netlink. + * net.c (decode_sockbuf): Likewise. + * netlink.c (print_nlmsghdr, decode_nlmsghdr_with_payload, + decode_nlmsgerr, decode_payload, decode_nlmsghdr_with_payload, + decode_netlink): Likewise. + All callers updated. + + Introduce getfdinode to obtain inode from fd. + * defs.h (getfdinode): New prototype. + * utils.c (getfdinode): New function. + +2017-06-05 Fabien Siron + Dmitry V. Levin + + Introduce get_sockaddr_by_inode. + Add a way to get socket information without printing it. + + * defs.h (get_sockaddr_by_inode): New prototype. + * socketutils.c (get_sockaddr_by_inode): New function. + +2017-06-05 Dmitry V. Levin + + socketutils.c: introduce get_sockaddr_by_inode_uncached. + * socketutils.c (get_sockaddr_by_inode_uncached): New function. + (print_sockaddr_by_inode_uncached): Use it. + +2017-06-05 Fabien Siron + Dmitry V. Levin + + socketutils.c: use get_sockaddr_by_inode_cached. + * socketutils.c (unix_print, inet_print, tcp_v4_print, tcp_v6_print, + udp_v4_print, udp_v6_print, netlink_print): Remove. + (unix_get, inet_get, tcp_v4_get, tcp_v6_get, udp_v4_get, + udp_v6_get, netlink_get): New functions. + (protocols): Update. + +2017-06-05 Dmitry V. Levin + + socketutils.c: move inet_print closer to its first use. + * socketutils.c (inet_print): Move right before tcp_v4_print. + +2017-06-05 Fabien Siron + Dmitry V. Levin + + socketutils.c: introduce cache_inode_details. + cache_inode_details gives a way to obtain cache information without + printing it. + + * socketutils.c (cache_and_print_inode_details): Rename + to cache_inode_details. Do not print cached information. + (inet_parse_response, unix_parse_response, netlink_parse_response): + Use cache_inode_details instead of cache_and_print_inode_details. + (inet_print, unix_print, netlink_print): Call + print_sockaddr_by_inode_cached. + +2017-06-05 Victor Krapivensky + + strace.c: move termination code to a separate function. + This will be needed for the pull-style API. + + * strace.c (terminate): New function. + (main): Use it. + +2017-06-04 Dmitry V. Levin + + tests: avoid hitting SO_SNDBUF limit in sendfile/sendfile64 tests. + Do not assume that an executable is small enough and SO_SNDBUF is large + enough so that the executable could be sendfile'ed into a socket pair. + + * tests/sendfile.c (main): Create a regular file of the right size + to avoid hitting SO_SNDBUF limit. + * tests/sendfile64.c: Likewise. + + Reported-by: Andreas Schwab + +2017-06-04 Dmitry V. Levin + + Move netlink_protocols definition from net.c to netlink.c. + The side effect of #include "xlat/netlink_protocols.h" is + NETLINK_* constants properly defined in that header file. + While net.c does not use these constants itself, netlink.c + is going to need them soon. + + * net.c: Move inclusion of "xlat/netlink_protocols.h" ... + * netlink.c: ... here. + +2017-06-04 Dmitry V. Levin + + travis: switch from gcc-6 to gcc-7. + * .travis.yml (matrix): Change gcc-6 to gcc-7. + + tests: extend checking of NLMSG_DONE decoding. + * tests/netlink_protocol.c (test_nlmsg_done): Use designated + initializers. Check decoding of messages with non-integer payload. + +2017-06-04 JingPiao Chen + + netlink: decode NLMSG_DONE messages. + * netlink.c (decode_payload): Decode NLMSG_DONE messages. + * tests/netlink_protocol.c (test_nlmsg_done): New function + for checking decoding of NLMSG_DONE messages. + (main): Use it. + +2017-06-04 Dmitry V. Levin + + socketutils.c: introduce get_sockaddr_by_inode_cached. + * socketutils.c (get_sockaddr_by_inode_cached): New function. + (print_sockaddr_by_inode_cached): Use it. + +2017-06-03 Dmitry V. Levin + + Unexport print_sockaddr_by_inode_cached. + Change print_sockaddr_by_inode to be the only function exposed, + hide print_sockaddr_by_inode_cached as a part of implementation. + + * defs.h (print_sockaddr_by_inode_cached): Remove prototype. + (print_sockaddr_by_inode): Add struct tcb * and descriptor arguments. + * socketutils.c (print_sockaddr_by_inode_cached): Make static. + (print_sockaddr_by_inode): Rename to print_sockaddr_by_inode_uncached, + make static. + (print_sockaddr_by_inode): New function. + * util.c (printfd): Update to use new print_sockaddr_by_inode. + +2017-06-03 Dmitry V. Levin + + Introduce str_strip_prefix_len function and STR_STRIP_PREFIX macro. + Address proliferation of string prefix check implementations. + + * defs.h (str_strip_prefix_len): New inline function. + (STR_STRIP_PREFIX): New macro. + * qualify.c (strip_prefix): Remove. + (parse_inject_token): Use STR_STRIP_PREFIX instead of strip_prefix. + (qualify): Use str_strip_prefix_len. + * socketutils.c (netlink_parse_response): Likewise. + * util.c (printfd): Likewise. + +2017-06-02 Dmitry V. Levin + + netlink: move NLMSG_ERROR payload length check to nlmsgerr decoder. + Move decoder specific check to the decoder. + + * netlink.c (decode_payload): Move NLMSG_ERROR payload length check ... + (decode_nlmsgerr): ... here. + +2017-06-02 Dmitry V. Levin + + strace.c: handle PTRACE_EVENT_EXEC like other events. + There is nothing unusual about PTRACE_EVENT_EXEC that would require + a special treatment. + + * strace.c (next_event): Move PTRACE_EVENT_EXEC handling to the main + switch statement. + +2017-06-02 Dmitry V. Levin + + strace.c: remove dead code. + As strace does not use WCONTINUED flag, there is no need to handle + WIFCONTINUED status. + + * strace.c (print_debug_info) [WIFCONTINUED]: Remove. + (next_event): Remove redundant !WIFSTOPPED check. + +2017-06-02 Victor Krapivensky + + strace.c: refactor trace into two functions. + This change decouples waiting for next event from reacting to it. This + makes the control flow easier to understand, and serves as a preparation + for implementing a pull-style API for LuaJIT. + + * strace.c (enum trace_event): New enum. + (trace): Split into ... + (next_event, dispatch_event): ... new functions. + (main): Use them. + +2017-05-30 Dmitry V. Levin + + scno.am: include config.h before syscallent.h. + This fixes generation of syscallent.i and subsequent scno.h files + on mips where syscallent.h checks macros defined in config.h. + + * scno.am (syscallent.i): Add $(top_builddir)/config.h + to prerequisites, include it. + * NEWS: Mention this fix. + + Reported-by: David Robins + +2017-05-28 Dmitry V. Levin + + tests: check decoding of sigaction syscall. + * tests/sigaction.c: New file. + * tests/gen_tests.in (sigaction): New entry. + * tests/pure_executables.list: Add sigaction. + * tests/.gitignore: Likewise. + + tests: rename sigaction.test to rt_sigaction.test. + * tests/sigaction.awk: Rename to rt_sigaction.awk. + * tests/sigaction.c: Rename to tests/rt_sigaction.c. + * tests/sigaction.test: Rename to tests/rt_sigaction.test. + * tests/.gitignore: Replace sigaction with rt_sigaction. + * tests/pure_executables.list: Likewise. + * tests/Makefile.am (DECODER_TESTS): Replace sigaction.test + with rt_sigaction.test. + (EXTRA_DIST): Replace sigaction.awk with rt_sigaction.awk. + +2017-05-28 Dmitry V. Levin + + sparc: enhance decoding of signal number argument of sigaction syscall. + On sparc, unlike all other architectures, old sigaction syscall takes + a negated signal number. + + * signal.c (SYS_FUNC(sigaction)) [SPARC || SPARC64]: Enhance printing + of negative signal number argument. + +2017-05-28 Dmitry V. Levin + + signal: enhance printing of old_sigaction.mask. + * signal.c (decode_old_sigaction): Print old_sigaction.mask + using tprint_old_sigmask_val. + + signal: limit scope of struct old_sigaction32 definition. + * signal.c (struct old_sigaction32): Define only if [!current_wordsize]. + +2017-05-28 Dmitry V. Levin + + signal: fix decoding of struct old_sigaction on some architectures. + On alpha, struct old_sigaction.sa_flags has a 32-bit type. + + On mips, only first word of old_sigaction.sa_mask is read. + + On all architectures except alpha and mips that have old sigaction + syscall, struct old_sigaction has sa_restorer field that has to be + decoded. + + * signal.c (struct old_sigaction) [ALPHA]: Change sa_flags type + to unsigned int, add ATTRIBUTE_PACKED. + [MIPS]: Dhrink sa_mask array to 1 element. + [!ALPHA && !MIPS]: Define sa_restorer field unconditionally. + (struct old_sigaction32): Likewise. + (decode_old_sigaction) [!current_wordsize]: Initialize sa_restorer field + from old_sigaction32.sa_restorer unconditionally. + [!ALPHA && !MIPS]: Print old_sigaction.sa_restorer if SA_RESTORER flag + is set. + * NEWS: Mention this change. + +2017-05-28 Dmitry V. Levin + + xlat: rename SA_STACK to SA_ONSTACK. + SA_ONSTACK is the standard name while its alias SA_STACK is not even + defined on many platforms. + + * xlat/sigact_flags.in (SA_STACK): Rename to SA_ONSTACK. + +2017-05-28 Dmitry V. Levin + + tests: check decoding of sigpending syscall. + * tests/sigpending.c: New file. + * tests/gen_tests.in (sigpending): New entry. + * tests/pure_executables.list: Add sigpending. + * tests/.gitignore: Likewise. + + tests: check decoding of sigprocmask syscall. + * tests/sigprocmask.c: New file. + * tests/gen_tests.in (sigprocmask): New entry. + * tests/pure_executables.list: Add sigprocmask. + * tests/.gitignore: Likewise. + +2017-05-28 Dmitry V. Levin + + alpha: rename sys_sigprocmask to sys_osf_sigprocmask. + Parsers of sigprocmask and osf_sigprocmask syscalls are different + anyway, so rename the function to match the syscall name. + + * signal.c [ALPHA] (SYS_FUNC(sigprocmask)): Rename + to SYS_FUNC(osf_sigprocmask). + * linux/alpha/syscallent.h: Update sys_func. + +2017-05-27 Dmitry V. Levin + + Enable coverage when strace is self terminated by signal. + The data collected by -fprofile-arcs during program run is saved + on program exit. When program is terminated by signal, the data + is not saved. However, libgcov provides an interface to dump + the data at runtime. + + * m4/ax_code_coverage.m4 (AX_CODE_COVERAGE): Add -DENABLE_COVERAGE_GCOV + to CODE_COVERAGE_CPPFLAGS. + * strace.c [ENABLE_COVERAGE_GCOV] (__gcov_flush): New prototype. + (main) [ENABLE_COVERAGE_GCOV]: Call __gcov_flush() before raise() + and sigprocmask() calls that might cause program termination. + +2017-05-27 Dmitry V. Levin + + tests: check termination signal forwarding. + * tests/run_expect_termsig.c: New file. + * tests/unblock_reset_raise.c: Likewise. + * tests/termsig.test: New test. + * tests/.gitignore: Add run_expect_termsig and unblock_reset_raise. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (MISC_TESTS): Add termsig.test. + +2017-05-27 Dmitry V. Levin + + Fix termination signal forwarding. + When traced command is terminated by a blocked signal, unblock + that signal to ensure strace termination with the same signal. + + * strace.c (main): Unblock the signal raised for strace termination. + * NEWS: Mention this change. + +2017-05-27 Dmitry V. Levin + + Do not reset SIGCHLD handler in tracees to SIG_DFL. + While strace resets SIGCHLD handler to the default action so that + waitpid definitely works without losing track of children, tracees + should not inherit this change. + + * strace.c (struct exec_params): Add child_sa field. + (init): When setting SIGCHLD handler to SIG_DFL, save the old handler. + (exec_or_die): Restore SIGCHLD handler if it was different from SIG_DFL + at startup. + * NEWS: Mention this change. + +2017-05-27 Dmitry V. Levin + + Refactor setting of signal handlers to reduce redundancy. + * strace.c (set_sigaction): New function. + (init): Use it instead of sigaction with sigaddset. + + tests: check how signals are unblocked in interactive mode. + * tests/block_reset_raise_run.c: New file. + * tests/interactive_block.test: New test. + * tests/.gitignore: Add block_reset_raise_run. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (MISC_TESTS): Add interactive_block.test. + +2017-05-27 Dmitry V. Levin + + Fix unblocking of signals in interactive mode. + In interactive mode (-I2), those signals that were blocked at startup + will remain blocked for the whole period of strace execution. + + * strace.c (empty_set): Rename to start_set. All users changed. + (init): Initialize start_set and blocked_set to the set of currently + blocked signals. + (startup_attach, trace): Use SIG_SETMASK instead of SIG_BLOCK. + * NEWS: Mention this change. + +2017-05-26 Dmitry V. Levin + + Cleanup interactive check. + * strace.c (init): Check for INTR_WHILE_WAIT mode the same way + as in other places. + + tests: check decoding of signal syscall. + * tests/signal.c: New file. + * tests/gen_tests.in (signal): New entry. + * tests/pure_executables.list: Add signal. + * tests/.gitignore: Likewise. + +2017-05-26 Eugene Syromyatnikov + + Unify capitalisation of (c) in copyright notices. + +2017-05-25 Dmitry V. Levin + + Post-release administrivia. + * NEWS: Add a header line for the next release. + * debian/changelog.in: Add a changelog entry for 4.17-1. + * strace.spec.in: Likewise. + +2017-05-24 Dmitry V. Levin + + Prepare for 4.17 release. + * NEWS: Update for 4.17 release. + + powerpc64, sparc, sparc64: wire up statx syscall. + * linux/powerpc64/syscallent.h [383]: Add statx entry. + * linux/sparc/syscallent.h [360]: Likewise. + * linux/sparc64/syscallent.h [360]: Likewise. + +2017-05-23 Dmitry V. Levin + + Fix compat personality support for sgetmask syscall. + * signal.c (SYS_FUNC(sgetmask)): Replace sprintsigmask_val + with sprint_old_sigmask_val. + * tests/sxetmask.c (main): Check decoding of signal mask containing + RT signals. + +2017-05-22 Dmitry V. Levin + + Fix decoding of sgetmask and ssetmask syscalls. + Old ssetmask syscall takes an argument and returns a value of type int. + Old sgetmask syscall may return an error. + + * signal.c (SYS_FUNC(ssetmask)): Explicitly convert the argument + and return value to unsigned int, print it using sprint_old_sigmask_val. + (SYS_FUNC(sgetmask)): Do not print the mask in case of syserror. + * tests/sxetmask.c: New file. + * tests/gen_tests.in (sxetmask): New entry. + * tests/pure_executables.list: Add sxetmask. + * tests/.gitignore: Likewise. + * NEWS: Mention this fix. + +2017-05-22 Eugene Syromyatnikov + + Add copyright headers. + +2017-05-22 Eugene Syromyatnikov + Elvira Khabirova + + Add scripts for automating copyright notices update. + * maint/update_copyright_years.awk: New file. + * maint/update_copyright_years.sh: Likewise. + +2017-05-22 Eugene Syromyatnikov + + Fix typos in copyright notices. + + unwind.c: remove non-ASCII character from comment. + +2017-05-21 Dmitry V. Levin + + Rename sys_sig[gs]etmask to sys_s[gs]etmask to match syscall names. + * signal.c (SYS_FUNC(sigsetmask)): Rename to SYS_FUNC(ssetmask). + (SYS_FUNC(siggetmask)): Rename to SYS_FUNC(sgetmask). + * linux/arm/syscallent.h (sgetmask, ssetmask): Update sys_func. + * linux/bfin/syscallent.h: Likewise. + * linux/crisv10/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + + tests: enhance sigsuspend.test. + * tests/sigsuspend.c (sigtxt): New variable. + (main): Change signal masks to contain all signals except USR1 and USR2. + +2017-05-20 Dmitry V. Levin + + Fix compat personality support for old sigsuspend syscall. + * signal.c (sprint_old_sigmask_val): New function. + (tprint_old_sigmask_val): New macro. + (SYS_FUNC(sigsuspend)): Use it. + +2017-05-16 Dmitry V. Levin + + Move errnoent.sh, signalent.sh, and syscallent.sh to maint subdirectory. + Also do not include them into release tarballs. These files are + intended for developers who are expected to use a git repository. + + * errnoent.sh: Move to maint subdirectory. + * signalent.sh: Likewise. + * syscallent.sh: Likewise. + * HACKING-scripts: Update. + * Makefile.am (EXTRA_DIST): Remove errnoent.sh, signalent.sh, + and syscallent.sh. + +2017-05-16 Dmitry V. Levin + + Do not include maint subdirectory into release tarballs. + These files are intended for developers who are expected to use + a git repository. + + * Makefile.am (EXTRA_DIST): Remove maint/ioctls_gen.sh, + maint/ioctls_hex.sh, maint/ioctls_sym.sh, and maint/print_ioctlent.c. + +2017-05-01 Eugene Syromyatnikov + + linux/ia64/syscallent.h: remove tabulation, add spaces in file comment. + + linux/mtd-abi.h: remove non-ASCII character from file comment. + +2017-05-01 Dmitry V. Levin + + alpha, cris, mips, ppc, sh, sparc: fix decoding of sigsuspend syscall. + On some architectures old sigsuspend syscall takes the signal mask from + the 3rd argument, on some from the 1st. And, if it wasn't peculiar + enough, the signal mask is passed by value on all architectures except + mips where it's passed by reference. + + * signal.c (SYS_FUNC(sigsuspend)): Take the signal mask from the last + argument. + * linux/alpha/syscallent.h (sigsuspend): Set nargs to 1. + * linux/crisv10/syscallent.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * tests/sigsuspend.c: New file. + * tests/gen_tests.in (sigsuspend): New entry. + * tests/pure_executables.list: Add sigsuspend. + * tests/.gitignore: Likewise. + * NEWS: Mention this fix. + +2017-05-01 Dmitry V. Levin + + tests: raise default timeout for individual tests. + Recently added tests based on pure_executables.list are quite slow + by their nature, the one minute default timeout is no longer enough + for some of not so fast architectures. + + * tests/init.sh (TIMEOUT_DURATION): Raise from 60 to 120. + +2017-05-01 Eugene Syromyatnikov + + Update NEWS. + +2017-04-29 Dmitry V. Levin + + Update TCP_* constants. + * xlat/socktcpoptions.in: Add TCP_FASTOPEN_CONNECT introduced + by linux kernel commit v4.11-rc1~124^2~321^2. + +2017-04-28 Dmitry V. Levin + + Update AF_* constants. + * xlat/addrfams.in: Add AF_SMC introduced by linux kernel + commit v4.11-rc1~94^2~43^2~13. + +2017-04-27 Dmitry V. Levin + + tests: enhance madvise decoder check. + * tests/mmap.c (main): Remove madvise check. + * tests/madvise.c: New file. + * tests/gen_tests.in (madvise): New entry. + * tests/.gitignore: Add madvise. + * tests/pure_executables.list: Likewise. + +2017-04-25 Eugene Syromyatnikov + + tests: add -etrace=?... test. + Check for some architecture-specific syscalls which are not present + on most architectures. + + * gen_tests.in: Add trace_question test. + * tests/trace_question.in: New file. + * tests/Makefile.am (EXTRA_DIST): Add it. + +2017-04-25 Eugene Syromyatnikov + + tests: add more information to generated header comments. + * tests/gen_tests.sh: Update header comment with the source string + used for test generation. + + tests: move generated common header comment into a variable. + * tests/gen_tests.sh: Move generated file header comment + into a variable, use it in all cases. + +2017-04-25 Dmitry V. Levin + + tests: use TAIL_ALLOC_OBJECT_CONST_PTR in v4l2 test. + * tests/ioctl_v4l2.c (main): Use TAIL_ALLOC_OBJECT_CONST_PTR. + +2017-04-25 Edgar Kaziahmedov + + tests: Check decoding of VIDIOC_G/S_TUNER's arg. + * tests/ioctl_v4l2.c (main): Add checks for VIDIOC_G/S_TUNER's arg. + + v4l2: Add decoding for VIDIOC_G/S_TUNER's arg. + * v4l2.c: Include "xlat/v4l2_tuner_types.h", "xlat/v4l2_tuner_capabilities.h", + "xlat/v4l2_tuner_rxsubchanses.h", and "xlat/v4l2_tuner_audmodes.h". + (print_v4l2_tuner): New function. Add decoding for VIDIOC_G/S_TUNER's arg. + (v4l2_ioctl): Add new cases for decoding VIDIOC_G/S_TUNER's arg. + * xlat/v4l2_tuner_types.in: Add V4L2_TUNER_RADIO and + V4L2_TUNER_ANALOG_TV introduced by linux kernel commit + 2.5.46~39^2~23^2~4. + Add V4L2_TUNER_DIGITAL_TV introduced by linux kernel + commit v2.6.11-rc4~55^2~20. + Add V4L2_TUNER_ADC and V4L2_TUNER_RF introduced by linux kernel commit + v3.15-rc1~85^2~215. + Add V4L2_TUNER_SDR introduced by linux kernel commit v4.4-rc1~118^2~17 + (as the replacement of V4L2_TUNER_ADC). + * xlat/v4l2_tuner_capabilities.in: Add V4L2_TUNER_CAP_LOW, + V4L2_TUNER_CAP_NORM, V4L2_TUNER_CAP_STEREO, V4L2_TUNER_CAP_LANG2, + V4L2_TUNER_CAP_SAP, and V4L2_TUNER_CAP_LANG1 introduced by linux kernel + commit 2.5.46~39^2~23^2~4. + Add V4L2_TUNER_CAP_HWSEEK_BOUNDED and V4L2_TUNER_CAP_HWSEEK_WRAP + introduced by linux kernel commit v3.6-rc1~28^2~306. + Add V4L2_TUNER_CAP_RDS introduced by linux commit v2.6.32-rc1~679^2~189. + Add V4L2_TUNER_CAP_RDS_BLOCK_IO and V4L2_TUNER_CAP_RDS_CONTROLS + introduced by linux kernel commit v2.6.37-rc1~64^2~110. + Add V4L2_TUNER_CAP_FREQ_BANDS introduced by linux kernel commit + v3.6-rc1~28^2~46. + Add V4L2_TUNER_CAP_HWSEEK_PROG_LIM introduced by linux kernel commit + v3.6-rc1~28^2~40. + Add V4L2_TUNER_CAP_1HZ introduced by linux kernel commit + v3.15-rc1~85^2~214. + * xlat/v4l2_tuner_audmodes.in: Add V4L2_TUNER_MODE_MONO, + V4L2_TUNER_MODE_STEREO, V4L2_TUNER_MODE_LANG2, V4L2_TUNER_MODE_SAP, and + V4L2_TUNER_MODE_LANG1 introduced by linux kernel commit + 2.5.46~39^2~23^2~4. + Add V4L2_TUNER_MODE_LANG1_LANG2 introduced by linux kernel commit + v2.6.17-rc1~739^2~9. + * xlat/v4l2_tuner_rxsubchanses.in: Add V4L2_TUNER_SUB_MONO, + V4L2_TUNER_SUB_STEREO, V4L2_TUNER_SUB_LANG2, V4L2_TUNER_SUB_SAP, and + V4L2_TUNER_SUB_LANG1 introduced by linux kernel commit + 2.5.46~39^2~23^2~4. + Add V4L2_TUNER_SUB_RDS introduced by linux kernel commit + v2.6.32-rc1~679^2~189. + +2017-04-24 Dmitry V. Levin + + tests: check decoding of invalid tv_sec and tv_usec values. + * tests/futimesat.c (main): Check decoding of invalid tv_sec and tv_usec + values. + * tests/xetitimer.c (main): Likewise. + * tests/xettimeofday.c (main): Likewise. + * tests/xselect.c (main): Likewise. + * tests/xutimes.c (main): Likewise. + + tests: check decoding of invalid tv_sec and tv_nsec values. + * tests/aio.c (main): Check decoding of invalid tv_sec and tv_nsec + values. + * tests/clock_nanosleep.c (main): Likewise. + * tests/clock_xettime.c (main): Likewise. + * tests/futex.c (main): Likewise. + * tests/nanosleep.c (main): Likewise. + * tests/ppoll.c (main): Likewise. + * tests/pselect6.c (main): Likewise. + * tests/recvmmsg-timeout.c (main): Likewise. + * tests/rt_sigtimedwait.c (main): Likewise. + * tests/semop.c (main): Likewise. + * tests/timer_xettime.c (main): Likewise. + * tests/timerfd_xettime.c (main): Likewise. + * tests/utimensat.c (main): Likewise. + +2017-04-24 Eugene Syromyatnikov + + Print time in ISO 8601 format in time syscall decoder. + * print_time.c (SYS_FUNC(time)): Print timestamp stringification + (via sprinttime) for the value stored in the argument and return value + (return RVAL_STR in the latter case). + * tests/time.c (main): Update expected output. + +2017-04-24 Eugene Syromyatnikov + Dmitry V. Levin + + Print string representation of timestamps in parsers of *utime* syscalls + * print_timespec.c (print_timespec_t_utime): Use sprinttime_nsec + to format a string representation of time, use tprints_comment + to print it as a comment. + * print_timeval.c (print_timeval_t_utime): New function. + (print_timeval_utimes): Use it instead of print_timeval_t. + [ALPHA] (print_timeval32_t_utime): New function. + [ALPHA] (print_timeval32_utimes): Use it instead of print_timeval32_t. + * tests/futimesat.c (print_tv): Update expected output. + * tests/utimensat.c (print_ts): Likewise. + * tests/xutimes.c (print_tv): Likewise. + +2017-04-24 Eugene Syromyatnikov + + tests: add support for printing timestamp with microsecond precision. + It will be needed later. + + * tests/tests.h (print_time_t_usec): New prototype. + * tests/print_time.c (print_time_t_usec): New function, a thin wrapper + around print_time_t_ex. + +2017-04-24 Eugene Syromyatnikov + Dmitry V. Levin + + Print microseconds/nanoseconds as non-negative. + Negative micro/nanoseconds values are treated as invalid by kernel + anyway, and in one case (timespec_valid in include/linux/time.h) + it is even checked by conversion to unsigned long. + + * print_timespec.c (timespec_fmt): Change tv_sec format to %lld and + tv_nsec format to %llu. + (print_timespec_t): Cast tv_sec to long long and process tv_nsec with + zero_extend_signed_to_ull. + (sprint_timespec): Likewise. + * print_timeval.c (timeval_fmt): Change tv_sec format to %lld and + tv_usec format to %llu. + (print_timeval_t): Cast tv_sec to long long and process tv_nsec with + zero_extend_signed_to_ull. + (sprint_timeval, print_timeval32_t, sprint_timeval32): Likewise. + * defs.h (TIMESPEC_TEXT_BUFSIZE): Update. + * tests/adjtimex.c (main): Change tv_sec printing format to %lld, cast + it to long long; change tv_usec printing format to %llu, process it with + zero_extend_signed_to_ull. + * tests/clock_nanosleep.c (main): Change tv_sec printing format to %lld, + cast it to long long; change tv_nsec printing format to %llu, process it + with zero_extend_signed_to_ull. + * tests/clock_xettime.c (main): Likewise. + * tests/futex.c (main): Likewise. + * tests/futimesat.c (print_tv): Likewise. + * tests/getrusage.c (invoke_print): Likewise. + * tests/mq_sendrecv.c (do_send, do_recv, main): Likewise. + * tests/nanosleep.c (main): Likewise. + * tests/pselect6.c (main): Likewise. + * tests/restart_syscall.c (main): Likewise. + * tests/rt_sigtimedwait.c (iterate, main): Likewise. + * tests/sched_rr_get_interval.c (main): Likewise. + * tests/semop.c (main): Likewise. + * tests/timer_xettime.c (main): Likewise. + * tests/timerfd_xettime.c (main): Likewise. + * tests/waitid.c (main): Likewise. + * tests/xetitimer.c (main): Likewise. + * tests/xettimeofday.c (main): Likewise. + * tests/xselect.c (main): Likewise. + * tests/xutimes.c (print_tv): Likewise. + * tests/wait4.c (sprint_rusage): Likewise. + * tests/waitid.c (sprint_rusage): Likewise. + * tests/utimensat.c (print_ts): Likewise. + (main): Add check for higher bits of tv_sec/tv_nsec. + +2017-04-24 Eugene Syromyatnikov + Dmitry V. Levin + + Always print raw values of time data fields. + Refactor sprinttime: implement sprinttime_nsec and sprinttime_usec + that handle nanoseconds and microseconds, respectively. + Always print raw values of time data fields, format string + representations of time as comments. + + * defs.h (sprinttime): Change argument type from time_t to long long. + (sprinttime_nsec, sprinttime_usec): New prototypes. + * util.c (sprinttime_ex, sprinttime_nsec, sprinttime_usec): New + functions. + (sprinttime): Turn into a thin wrapper around sprinttime_ex. + * stat.h (struct strace_stat): Add has_nsec field. + * fetch_struct_stat.c (HAVE_NSEC): New macro. + (fetch_struct_stat): Initialize has_nsec field with HAVE_NSEC. + * fetch_struct_stat64.c (HAVE_NSEC): New macro. + (fetch_struct_stat64): Initialize has_nsec field with HAVE_NSEC. + * print_struct_stat.c (print_struct_stat) : + Print raw values of time fields, use sprinttime_nsec to format a string + representation of time, use tprints_comment to print it as a comment. + * statx.c (SYS_FUNC(statx)) : Likewise. + * utime.c (SYS_FUNC(utime)): Print raw values of struct utimbuf.actime + and struct utimbuf.modtime fields, use sprinttime to format a string + representation of time, use tprints_comment to print it as a comment. + * tests/tests.h (print_time_t_nsec): Add int argument. + * tests/print_time.c (print_time_t_ex): New function. + (print_time_t_nsec): Add int argument, turn into a thin wrapper around + print_time_t_ex. + * tests/utime.c (main): Update expected output. + * tests/xstatx.c [!IS_STATX] (HAVE_NSEC): New macro. + [!IS_STATX] (PRINT_ST_TIME), [IS_STATX] (PRINT_FIELD_TIME): Update + expected output. + * NEWS: Mention this timestamps representation improvement. + +2017-04-24 Dmitry V. Levin + + Introduce tprintf_comment and tprints_comment functions. + * defs.h (tprintf_comment, tprints_comment): New prototypes. + * strace.c (tvprintf): New function. + (tprintf): Use it. + (tprintf_comment, tprints_comment): New functions. + * aio.c (tprint_lio_opcode): Use tprints_comment. + * dm.c (dm_decode_dm_target_spec, dm_decode_dm_target_deps, + dm_decode_dm_name_list, dm_decode_dm_target_versions, + dm_decode_dm_target_msg, dm_decode_string, dm_known_ioctl): Likewise. + * futex.c (SYS_FUNC(futex)): Likewise. + * perf.c (print_perf_event_attr): Likewise. + * seccomp.c (decode_bpf_code): Likewise. + * util.c (printxvals, printxval_searchn, printflags64): Likewise. + * btrfs.c (print_u64, btrfs_print_key_type, btrfs_print_objectid, + print_key_value_internal): Likewise. + (btrfs_ioctl): Use tprints_comment and tprintf_comment. + * dirent.c (SYS_FUNC(getdents)): Likewise. + * dirent64.c (SYS_FUNC(getdents64)): Likewise. + * execve.c (printargc): Use tprintf_comment. + * tests/btrfs.c (btrfs_test_get_dev_stats_ioctl, + btrfs_test_features_ioctls): Update expected output. + + Make output of execve/execveat syscall parsers more structured. + * execve.c (printargc): Always print the address, format the number + of variables as a comment. + * tests/execve.c: Update expected output. + * tests/execveat.c: Likewise. + * tests/qual_syscall.test: Likewise. + * tests/strace-r.expected: Likewise. + * tests/strace-t.test: Likewise. + * tests/strace-tt.test: Likewise. + * tests/strace-ttt.test: Likewise. + * tests/threads-execve.c: Likewise. + * tests/threads-execve.test: Likewise. + + dm: fix diagnostics about misplaced parts of struct dm_ioctl. + * dm.c (dm_decode_dm_target_spec, dm_decode_dm_target_deps, + dm_decode_dm_name_list, dm_decode_dm_target_versions, + dm_decode_dm_target_msg, dm_decode_string, dm_known_ioctl): Fix + diagnostics about various misplaced parts of struct dm_ioctl. + * tests/ioctl_dm.c: Update expected output. + + print_mq_attr: fix typo. + * print_mq_attr.c (printmqattr): Fix the last argument of printflags64. + +2017-04-23 Eugene Syromyatnikov + + tests: add faulty pointer check to time test. + * tests/time.c (main): Add check for an inaccessible pointer. + +2017-04-22 Dmitry V. Levin + + tests: fix print_time_t_nsec usage in xstatx.c. + * tests/xstatx.c (print_stat): Pass tv_nsec field through + zero_extend_signed_to_ull before feeding it to print_time_t_nsec. + +2017-04-21 Dmitry V. Levin + + tests: fix netlink_protocol on sparc. + * tests/netlink_protocol.c (test_nlmsgerr): Do not access fields of an + unaligned structure, this makes architectures like sparc very unhappy. + +2017-04-21 Eugene Syromyatnikov + + util: return pointer to string literal directly in sprinttime. + There is no sense to copy it to static buffer first. + + * util.c (sprinttime): Just return "0", do not copy it to internal + buffer first. + +2017-04-21 Dmitry V. Levin + + tests: remove stat.sample creation from gen_tests.in. + stat.sample is created by appropriate executables and never removed. + + * tests/gen_tests.in (trace_fstat, trace_lstat, trace_stat, + trace_stat_like): Remove stat.sample creation. + +2017-04-21 Dmitry V. Levin + + tests: tabulate fstat.test. + * tests/gen_tests.in (fstat): New entry. + (fstat64, oldfstat): Update. + * tests/fstat.test: Remove. + * tests/Makefile.am (DECODER_TESTS): Remove fstat.test. + +2017-04-21 Eugene Syromyatnikov + + Implement -e trace=%stat option. + linux/*/syscallent*.h part is updated automatically by: + + sed -i '/statx/! s/TF|TSTA,/TF|TST|TSTA,/' linux/*/syscallent*.h + + * sysent.h (TRACE_STAT): New macro. + * syscall.c: Alias LST to TRACE_STAT around syscallent.h inclusion. + * qualify.c (lookup_class): Add TRACE_STAT for "%stat". + * strace.1 (.SS Filtering): Add information about %stat syscall class. + * NEWS: Mention this change. + * linux/aarch64/syscallent.h (stat): Add TST flag. + * linux/ia64/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/arm/syscallent.h (oldstat, stat, stat64): Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/crisv10/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/avr32/syscallent.h (stat, stat64): Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + * linux/powerpc64/syscallent.h (oldstat, stat): Likewise. + * linux/alpha/syscallent.h (osf_old_stat, osf_stat, stat, stat64): Likewise. + * linux/mips/syscallent-compat.h (bsd43_oldstat, bsd43_stat, posix_stat, + svr4_stat, svr4_xstat, sysv_stat, sysv_xstat): Likewise. + * tests/gen_tests.in (trace_stat): New entry. + * tests/trace_stat.in: New file. + * tests/Makefile.am (EXTRA_DIST): Add it. + * tests/ksysent.c (TST): New macro, defined to 0. + * tests/nsyscalls.c: Likewise. + +2017-04-21 Eugene Syromyatnikov + + Implement -e trace=%lstat option. + linux/*/syscallent*.h part is updated automatically by: + + sed -i '/TSTA,.*lx\?stat/ s/TSTA,/TLST|&/' linux/*/syscallent*.h + + * sysent.h (TRACE_LSTAT): New macro. + * syscall.c: Alias TLST to TRACE_LSTAT around syscallent.h inclusion. + * qualify.c (lookup_class): Add TRACE_LSTAT for "%lstat". + * strace.1 (.SS Filtering): Add information about %lstat syscall class. + * NEWS: Mention this change. + * linux/aarch64/syscallent.h (lstat): Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/arm/syscallent.h (lstat, lstat64, oldlstat): Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/crisv10/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/avr32/syscallent.h (lstat, lstat64): Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + * linux/alpha/syscallent.h (lstat, lstat64, osf_lstat, osf_old_lstat): Likewise. + * linux/mips/syscallent-compat.h (bsd43_lstat, posix_lstat, svr4_lstat, + sysv_lstat): Likewise. + * tests/gen_tests.in (trace_lstat): New entry. + * tests/trace_lstat.in: New file. + * tests/Makefile.am (EXTRA_DIST): Add it. + * tests/ksysent.c (TLST): New macro, defined to 0. + * tests/nsyscalls.c: Likewise. + +2017-04-21 Eugene Syromyatnikov + + Implement -e trace=%fstat option. + linux/*/syscallent*.h part is updated automatically by: + + sed -i -e '/TSTA.*fx\?stat/ s/TSTA,/TFST|&/' \ + -e 's/\(TD|TF|TFST|TSTA,\)[[:space:]]/\1/' linux/*/syscallent*.h + + * sysent.h (TRACE_FSTAT): New macro. + * syscall.c: Alias TFST to TRACE_FSTAT around syscallent.h inclusion. + * qualify.c (lookup_class): Add TRACE_FSTAT for "%fstat". + * strace.1 (.SS Filtering): Add information about %fstat syscall class. + * NEWS: Mention this change. + * linux/32/syscallent.h (fstat64, fstatat64): Add TFST flag. + * linux/64/syscallent.h (fstat, newfstatat): Likewise. + * linux/aarch64/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/arm/syscallent.h (fstat, fstat64, fstatat64, oldfstat): Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/crisv10/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/avr32/syscallent.h (fstat, fstat64, fstatat64): Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + * linux/alpha/syscallent.h (fstat, fstat64, fstatat64, osf_fstat, + osf_old_fstat): Likewise. + * linux/powerpc64/syscallent.h (fstat, newfstatat, oldfstat): Likewise. + * linux/mips/syscallent-compat.h (bsd43_fstat, bsd43_oldfstat, posix_fstat, + svr4_fstat, sysv_fstat): Likewise. + * tests/gen_tests.in (trace_fstat): New entry. + * tests/trace_fstat.in: New file. + * tests/Makefile.am (EXTRA_DIST): Add it. + * tests/ksysent.c (TFST): New macro, defined to 0. + * tests/nsyscalls.c: Likewise. + +2017-04-21 Eugene Syromyatnikov + + Implement -e trace=%%stat option. + linux/*/syscallent*.h part is updated automatically by: + + sed -i '/TSFA\|stat[iu]s/! s/,[[:space:]]\?\([[:space:]]*SEN(.*stat\)/|TSTA,\1/' \ + linux/*/syscallent*.h + + * sysent.h (TRACE_STAT_LIKE): New macro. + * syscall.c: Alias TSTA to TRACE_STAT_LIKE around syscallent.h inclusion. + * qualify.c (lookup_class): Add TRACE_STAT_LIKE for "%%stat". + * strace.1 (.SS Filtering): Add information about %%stat syscall class. + * NEWS: Mention this change. + * linux/32/syscallent.h (fstat64, fstatat64, statx): Add TSTA flag. + * linux/64/syscallent.h (fstat, newfstatat, statx): Likewise. + * linux/aarch64/syscallent.h (fstat, lstat, newfstatat, stat): Likewise. + * linux/alpha/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, + osf_fstat, osf_lstat, osf_old_fstat, osf_old_lstat, osf_old_stat, osf_stat, + stat, stat64): Likewise. + * linux/arm/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat, + oldlstat, oldstat, stat, stat64, statx): Likewise. + * linux/avr32/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, stat, + stat64): Likewise. + * linux/bfin/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, + oldfstat, oldlstat, oldstat, stat, stat64): Likewise. + * linux/crisv10/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, + oldfstat, oldlstat, oldstat, stat, stat64): Likewise. + * linux/hppa/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, stat, + stat64): Likewise. + * linux/i386/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat, + oldlstat, oldstat, stat, stat64, statx): Likewise. + * linux/ia64/syscallent.h (fstat, lstat, newfstatat, stat): Likewise. + * linux/m68k/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat, + oldlstat, oldstat, stat, stat64, statx): Likewise. + * linux/microblaze/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, + oldfstat, oldlstat, oldstat, stat, stat64): Likewise. + * linux/mips/syscallent-compat.h (bsd43_fstat, bsd43_lstat, bsd43_oldfstat, + bsd43_oldstat, bsd43_stat, posix_fstat, posix_lstat, posix_stat, svr4_fstat, + svr4_fxstat, svr4_lstat, svr4_lxstat, svr4_stat, svr4_xstat, sysv_fstat, + sysv_fxstat, sysv_lstat, sysv_lxstat, sysv_stat, sysv_xstat): Likewise. + * linux/mips/syscallent-n32.h (fstat, lstat, newfstatat, stat, statx): Likewise. + * linux/mips/syscallent-n64.h (fstat, lstat, newfstatat, stat, statx): Likewise. + * linux/mips/syscallent-o32.h (fstat, fstat64, fstatat64, lstat, lstat64, + oldfstat, oldlstat, oldstat, stat, stat64, statx): Likewise. + * linux/powerpc64/syscallent.h (fstat, lstat, newfstatat, oldfstat, oldlstat, + oldstat, stat): Likewise. + * linux/powerpc/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, + oldfstat, oldlstat, oldstat, stat, stat64, statx): Likewise. + * linux/s390/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, stat, + stat64, statx): Likewise. + * linux/s390x/syscallent.h (fstat, lstat, newfstatat, stat, statx): Likewise. + * linux/sh64/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat, + oldlstat, oldstat, stat, stat64): Likewise. + * linux/sh/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, oldfstat, + oldlstat, oldstat, stat, stat64): Likewise. + * linux/sparc64/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, + oldlstat, stat, stat64): Likewise. + * linux/sparc/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, + oldlstat, stat, stat64): Likewise. + * linux/x32/syscallent.h (fstat, lstat, newfstatat, stat, statx): Likewise. + * linux/x86_64/syscallent.h (fstat, lstat, newfstatat, stat, statx): Likewise. + * linux/xtensa/syscallent.h (fstat, fstat64, fstatat64, lstat, lstat64, stat, + stat64, statx): Likewise. + * tests/gen_tests.in (trace_stat_like): New entry. + * tests/trace_stat_like.in: New file. + * tests/Makefile.am (EXTRA_DIST): Add it. + * tests/ksysent.c (TSTA): New macro, defined to 0. + * tests/nsyscalls.c: Likewise. + +2017-04-21 Eugene Syromyatnikov + + qualify: add syntax for optional non-matching syscall qualification. + It may be useful in case syscall is not present on the target + architecture. + + * qualify.c (qualify_syscall): Add ignore_fail flag, set it to true + in case syscall qualification is led by a question mark(s). + * strace.1 (.SS Filtering): Document ability to use question marks + in syscall qualification. + +2017-04-21 Eugene Syromyatnikov + + linux/alpha/syscallent.h: add TSFA flag to osf_getfsstat. + In accordance with [1]. + + [1] https://www.freebsd.org/cgi/man.cgi?query=getfsstat&sektion=2 + + * linux/alpha/syscallent.h (osf_getfsstat): Add TSFA flag. + * strace.1 (.SS Filtering) <%%statfs>: Update equivalent regexp. + +2017-04-21 Eugene Syromyatnikov + + linux/mips/syscallent-compat.h: add some TD/TF flags for *stat* variants + *xstat syscalls are, according to [1], like their *stat counterparts, + but with additional argument with fixed value. + + [1] http://math-atlas.sourceforge.net/devel/assembly/mipsabi32.pdf + + * linux/mips/syscallent-compat.h (*_xstat, *_lxstat, bsd43_oldstat): + Add TF flag. + (*_fxstat, bsd43_oldfstat): Add TD flag. + +2017-04-21 Eugene Syromyatnikov + + Implement -e trace=%%statfs option. + linux/*/syscallent*.h part is updated automatically by: + + sed -i 's/\(TSF\),[[:space:]]\?/\1|TSFA,/' linux/*/syscallent*.h + sed -i 's/\(TFSF\),/\1|TSFA,/' linux/*/syscallent*.h + sed -i 's/0\(,.*ustat\)/TSFA\1/' linux/*/syscallent*.h + + * sysent.h (TRACE_STATFS_LIKE): New macro. + * syscall.c: Alias TSFA to TRACE_STATFS_LIKE around syscallent.h inclusion. + * qualify.c (lookup_class): Add SCHED_STATFS_LIKE for "%%statfs". + * strace.1 (.SS Filtering): Add information about %%statfs syscall class. + * NEWS: Mention this change. + * linux/32/syscallent.h (statfs64, fstatfs64): Add TSFA flag. + * linux/64/syscallent.h (statfs, fstatfs): Likewise. + * linux/aarch64/syscallent.h (statfs, fstatfs, ustat): Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/arm/syscallent.h (statfs, statfs64, fstatfs, fstatfs64, ustat): + Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/crisv10/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + * linux/alpha/syscallent.h (osf_statfs, osf_statfs64, statfs, + ofs_fstatfs, osf_fstatfs64, ustat): Likewise. + * linux/mips/syscallent-compat.h (*_statfs, *_statvfs, *_fstatfs): Likewise. + * tests/gen_tests.in (trace_statfs_like): New entry. + * tests/trace_statfs_like.in: New file. + * tests/Makefile.am (EXTRA_DIST): Add it. + * tests/ksysent.c (TSFA): New macro, defined to 0. + * tests/nsyscalls.c: Likewise. + +2017-04-21 Eugene Syromyatnikov + + Implement -e trace=%fstatfs option. + linux/*/syscallent*.h part is updated automatically by: + + sed -i 's/TD,[[:space:]]\([[:space:]]*SEN.*[_"]fstatv\?fs\)/TD|TFSF,\1/' \ + linux/*/syscallent*.h + + * sysent.h (TRACE_FSTATFS): New macro. + * syscall.c: Alias TFSF to TRACE_FSTATFS around syscallent.h inclusion. + * qualify.c (lookup_class): Add SCHED_FSTATFS for "%fstatfs". + * strace.1 (.SS Filtering): Add information about %fstatfs syscall class. + * NEWS: Mention this change. + * linux/32/syscallent.h (fstatfs64): Add TFSF flag. + * linux/64/syscallent.h (fstatfs): Likewise. + * linux/aarch64/syscallent.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/arm/syscallent.h (fstatfs, fstatfs64): + Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/crisv10/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + * linux/alpha/syscallent.h (ofs_fstatfs, osf_fstatfs64): Likewise. + * linux/mips/syscallent-compat.h (*_fstatfs, *_fstatvfs): Likewise. + * tests/gen_tests.in (trace_fstatfs): New entry. + * tests/trace_fstatfs.in: New file. + * tests/Makefile.am (EXTRA_DIST): Add it. + * tests/ksysent.c (TFSF): New macro, defined to 0. + * tests/nsyscalls.c: Likewise. + +2017-04-21 Eugene Syromyatnikov + + sysent.h: format syscall flag macros. + Add some tabulation and leading zeroes to the values. + +2017-04-21 Dmitry V. Levin + + tests: tabulate sched.test. + Rewrite sched.test using test_trace_expr(). + + * tests/gen_tests.in (sched): New entry. + * tests/sched.in: New file, derived from a set of tests in sched.test. + * tests/sched.test: Remove. + * tests/Makefile.am (DECODER_TESTS): Remove sched.test. + (EXTRA_DIST): Add sched.in. + +2017-04-21 Dmitry V. Levin + + tests: tabulate regex.test. + Rewrite regex.test using test_trace_expr(). + + * tests/gen_tests.in (regex): New entry. + * tests/regex.in: New file, derived from a set of tests in regex.test. + * tests/regex.test: Remove. + * tests/Makefile.am (DECODER_TESTS): Remove regex.test. + (EXTRA_DIST): Add regex.in. + +2017-04-21 Dmitry V. Levin + + tests: tabulate clock.test. + Rewrite clock.test using test_trace_expr(). + + * tests/gen_tests.in (clock): New entry. + * tests/clock.in: New file, derived from a set of tests in clock.test. + * tests/clock.test: Remove. + * tests/Makefile.am (DECODER_TESTS): Remove clock.test. + (EXTRA_DIST): Add clock.in. + +2017-04-21 Eugene Syromyatnikov + + tests: tabulate trace_statfs.test. + Rewrite trace_statfs.test using test_trace_expr(). + + * tests/gen_tests.in (trace_statfs): New entry. + * tests/trace_statfs.in: New file, derived from a set of tests + in trace_statfs.test. + * tests/trace_statfs.test: Remove. + * tests/Makefile.am (DECODER_TESTS): Remove trace_statfs.test. + (EXTRA_DIST): Add trace_statfs.in. + +2017-04-21 Eugene Syromyatnikov + + tests/init.sh: add helpers for running set of programs. + This introduces three new helpers: + prog_set_subtract subtracts one program set from another, + test_pure_prog_set runs strace check on a set of programs, + test_trace_expr tests trace expressions. + + * tests/init.sh (prog_set_subtract, test_pure_prog_set, + test_trace_expr): New functions. + +2017-04-20 Dmitry V. Levin + + tests: extend gen_tests.sh further. + * tests/gen_tests.sh: Extend support of arbitrary rules. + +2017-04-20 Eugene Syromyatnikov + + tests/xstat.c: do not remove sample file after test. + As tests are executed in separate directories now, there is no need to + remove sample file. + + * tests/xstat.c (main): Remove unlink calls. + +2017-04-20 Eugene Syromyatnikov + + tests: use fixed name for stat tests sample file. + As tests are now run in separate directories. + + * tests/xstatx.c: Use fixed "stat.sample" name for sample file. + * tests/fstat.test: Use it as an argument for -P option. + * tests/gen_tests.in (fstat64, lstat, lstat64, newfstatat, oldlstat, + oldstat, stat, stat64, statx): Likewise. + +2017-04-19 Eugene Syromyatnikov + + Derive copyright year from the git commit date. + This solves problems like the need to update test suite on every + New Year's Eve. + + * Makefile.am (dist-hook): Generate .year. + * copyright-year-gen: New file. + * configure.ac (copyright_year): New m4 variable, defined as the output + of copyright-year-gen script. + (AC_COPYRIGHT): Use it. + (COPYRIGHT_YEAR): New output variable and preprocessor macro. + * strace.c (print_version): Use COPYRIGHT_YEAR. + * strace.spec.in (%prep): Save the value of COPYRIGHT_YEAR autoconf + variable to .year file. + * tests/strace-V.test (config_year): New variable, derived from config.h. + Add sanity checks for $config_year and use it in expected output. + + Reported-by: Andreas Schwab + +2017-04-19 Dmitry V. Levin + + tests: move /proc/ checks from scripts to executables. + Move most of /proc/self/task/ and /proc/self/fd/ checks from scripts + to xecutables. + + * tests/attach-f-p.test: Move /proc/self/task/ check ... + * tests/attach-f-p-cmd.c (main): ... here. + * tests/fstat.test: Move /proc/self/fd/ check ... + * tests/xstatx.c (main): ... here. + * tests/net-y-unix.test: Move /proc/self/fd/ check ... + * tests/net-y-unix.c (main): ... here. + * tests/net-yy-inet.test: Move /proc/self/fd/ check ... + * tests/net-yy-inet.c (main): ... here. + * tests/net-yy-netlink.test: Move /proc/self/fd/ check ... + * tests/net-yy-netlink.c (main): ... here. + * tests/net-yy-unix.test: Move /proc/self/fd/ check ... + * tests/net-yy-unix.c (main): ... here. + +2017-04-19 Dmitry V. Levin + + tests: tabulate pread64-pwrite64.test. + * tests/gen_tests.in (pread64-pwrite64): New entry. + * tests/pread64-pwrite64.c: (main): Skip the test if /proc/self/fd/ + is not available. + * tests/pread64-pwrite64.test: Remove. + * tests/Makefile.am (DECODER_TESTS): Remove pread64-pwrite64.test. + + tests: tabulate read-write.test. + * tests/gen_tests.in (read-write): New entry. + * tests/read-write.c: (main): Skip the test if /proc/self/fd/ + is not available. + * tests/read-write.test: Remove. + * tests/Makefile.am (DECODER_TESTS): Remove read-write.test. + + tests: add skip_if_unavailable function to libtests. + * tests/skip_unavailable.c: New file. + * tests/tests.h (skip_if_unavailable): New prototype. + * tests/Makefile.am (libtests_a_SOURCES): Add skip_unavailable.c. + + tests: tabulate netlink_protocol.test. + * tests/gen_tests.in (netlink_protocol): New entry. + * tests/netlink_protocol.test: Remove. + * tests/Makefile.am (DECODER_TESTS): Remove netlink_protocol.test. + + tests: tabulate statfs.test. + * tests/gen_tests.in (statfs): New entry. + (fstatfs, fstatfs64, statfs64): Update. + * tests/statfs.test: Remove. + * tests/Makefile.am (DECODER_TESTS): Remove statfs.test. + +2017-04-18 Dmitry V. Levin + + tests: skip statfs related tests if their sample files are not available + * tests/xstatfsx.c (print_statfs): Skip the test if open failed. + + tests: extend gen_tests.sh to support arbitrary test_* rules. + * tests/gen_tests.sh: Add support of arbitrary test_* rules. + + tests: change gen_tests.sh to read its input as raw input. + * tests/gen_tests.sh: Specify -r option to read. + * tests/gen_tests.in (shmxt): Update. + +2017-04-18 Eugene Syromyatnikov + + strace.1: s/regex expression/regular expression/ + +2017-04-17 Dmitry V. Levin + + strace.1: enhance %statfs description. + * strace.1 (.SS Filtering) <%statfs>: Fix the list of syscalls, + add an equivalent regex expression. + + netlink: decode NLMSG_ERROR messages. + * netlink.c (decode_nlmsgerr, decode_payload): New functions. + (decode_nlmsghdr_with_payload): Use decode_payload. + * tests/netlink_protocol.c (send_query): Check decoding + of NLMSG_ERROR messages. + * NEWS: Mention this change. + + netlink: avoid using unaligned sizeof(struct nlmsghdr) unnecessarily. + * netlink.c (NLMSG_HDRLEN): Redefine. + (decode_nlmsghdr_with_payload, decode_netlink): Use it instead + of sizeof(struct nlmsghdr). + + Fix the length argument passed from print_iovec to decode_netlink. + * io.c (print_iovec): Pass the actual length to decode_netlink + instead of the original length. + * NEWS: Mention this fix. + + numa: fix printing of error values in move_pages status array. + * numa.c (print_status): Do not lose a minus sign when printing + a symbolic error code. + * tests/move_pages.c (print_status_array): Update expected output. + + tests: generate pure_executables part of check_PROGRAMS automatically. + * tests/gen_pure_executables.sh: New file. + * bootstrap: Invoke it. + * tests/Makefile.am: Include pure_executables.am. + (check_PROGRAMS): Add $(PURE_EXECUTABLES). Remove everything listed + in pure_executables.list. + (EXTRA_DIST): Add gen_pure_executables.sh. + * tests/.gitignore: Add pure_executables.am. + + tests: make EXTRA_DIST sorted. + * tests/Makefile.am (EXTRA_DIST): Sort. + + tests: check decoding of alpha specific osf_utimes syscall. + * tests/osf_utimes.c: New file. + * tests/gen_tests.in (osf_utimes): New entry. + * tests/Makefile.am (check_PROGRAMS): Add osf_utimes. + * tests/pure_executables.list: Likewise. + * tests/.gitignore: Likewise. + + tests: parametrize utimes.c. + * tests/xutimes.c: New file, based on utimes.c. + * tests/utimes.c [__NR_utimes] (TEST_SYSCALL_NR, TEST_SYSCALL_STR, + TEST_STRUCT): New macros. + [__NR_utimes]: Replace all the rest with include "xutimes.c". + * tests/Makefile.am (EXTRA_DIST): Add xutimes.c. + +2017-04-16 Dmitry V. Levin + + alpha: fix tracing flags of osf_select and osf_utimes syscalls. + * linux/alpha/syscallent.h (osf_select): Add TD flag. + (osf_utimes): Add TF flag. + * NEWS: Mention alpha specific fixes. + +2017-04-16 Dmitry V. Levin + + alpha: rename print_timeval32_pair to print_timeval32_utimes. + This follows the rename of print_timeval_item to print_timeval_utimes. + + * defs.h [ALPHA] (print_timeval32_pair): Rename + to print_timeval32_utimes. + * print_timeval.c [ALPHA] (print_timeval32_pair): Likewise. + * utimes.c [ALPHA] (SYS_FUNC(osf_utimes)): Replace print_timeval32_pair + with print_timeval32_utimes. + +2017-04-16 Dmitry V. Levin + + tests: do more rigorous testing of utimes syscall parser. + * tests/utimes.c (errstr): New variable. + (print_ts, k_utimes): New functions. + (main): Use them to do more rigorous testing of utimes syscall parser. + * tests/gen_tests.in (utimes): Update -a option. + + tests: do more rigorous testing of futimesat syscall parser. + * tests/futimesat.c (errstr): New variable. + (print_ts, k_futimesat): New functions. + (main): Use them to do more rigorous testing of futimesat syscall parser. + +2017-04-16 Dmitry V. Levin + + Fix printing of inaccessible times argument of utimes and futimesat syscalls + When the whole pair of struct timeval structures cannot be fetched from + tracee's memory, print the address. This behavior follows the kernel's + that uses copy_from_user for the whole pair, too. + + * print_timeval.c (print_timeval_item): Remove. + (print_timeval_pair): Rename to print_timeval_utimes, all callers + updated. Fetch the whole timeval_t array with a single + umove_or_printaddr call. + * tests/futimesat.c (main): Update expected output. + * tests/utimes.c (main): Likewise. + +2017-04-16 Dmitry V. Levin + + tests: rewrite utimensat.test without relying on libc utimensat wrapper. + The new test also does more rigorous testing. + + * tests/utimensat.c: Stop including and , include + and , check __NR_utimensat instead + of HAVE_UTIMENSAT. + (errstr): New variable. + (k_utimensat): New function, a thin wrapper around + syscall(__NR_utimensat). + (main): Use them instead of utimensat. + * tests/gen_tests.in (utimensat): New entry. + * tests/utimensat.test: Remove. + * tests/Makefile.am (DECODER_TESTS): Remove it. + +2017-04-16 Dmitry V. Levin + + tests: use fixed timestamps in utime related tests. + * tests/clock.test: Remove futimesat, utime, utimensat, and utimes tests + from the list of exceptions. + * tests/utime.c (main): Do not use time(), use fixed timestamp instead. + * tests/futimesat.c (main): Do not use gettimeofday(), use fixed + timestamps instead. + * tests/utimensat.c (main): Likewise. + * tests/utimes.c (main): Likewise. + +2017-04-15 Dmitry V. Levin + + xtensa: wire up new syscalls. + * linux/xtensa/syscallent.h [348..350]: New pkey_* entries. + + Reported-by: Victor Krapivensky + +2017-04-15 Victor Krapivensky + + Update statx parser and syscall entries lists to the upstream. + * linux/32/syscallent.h [291]: Add statx entry. + * linux/64/syscallent.h [291]: Likewise. + * linux/arm/syscallent.h [397]: Likewise. + * linux/m68k/syscallent.h [379]: Likewise. + * linux/mips/syscallent-n32.h [6330]: Likewise. + * linux/mips/syscallent-n64.h [5326]: Likewise. + * linux/mips/syscallent-o32.h [4366]: Likewise. + * linux/powerpc/syscallent.h [383]: Likewise. + * linux/s390/syscallent.h [379]: Likewise. + * linux/s390x/syscallent.h [379]: Likewise. + * linux/xtensa/syscallent.h [351]: Likewise. + * statx.h (struct_statx): Update. + * statx.c (SYS_FUNC(statx)): Print struct_statx.stx_attributes_mask. + * tests/xstatx.c (print_stat, main): Update to test decoding + of struct_statx.stx_attributes_mask. + +2017-04-14 Dmitry V. Levin + + tests: add more regex match checks. + * tests/qual_syscall.test: Add regex match checks. + + tests: make mq_sendrecv* test executables reenterable. + * tests/mq_sendrecv.c (MQ_NAME): Remove. + (mq_name): New static variable. + (cleanup): Use it instead of MQ_NAME. + (main): Initialize it dynamically using the pid of process. Use it + instead of MQ_NAME. + + tests: make mq test executable reenterable. + * tests/mq.c (NAME): Remove. + (main): Replace the fixed message queue name with a dynamically + made name containing the pid of process. + * tests/gen_tests.in (mq): Update -a option. + + tests: make net-yy-netlink test executable reenterable. + * tests/net-yy-netlink.c (main): Use getpid() instead of a fixed + magic number. + + tests: tabulate shmxt.test. + * tests/gen_tests.in (shmxt): New entry. + * tests/shmxt.test: Remove. + * tests/Makefile.am (DECODER_TESTS): Remove shmxt.test. + +2017-04-14 Dmitry V. Levin + + Revert "Implement -e trace=%sched option" + -e trace=%sched became redundant as -e trace=/sched does the same. + + This reverts commit 811638e9c1805438a63c14f9704b8b00ac922623. + + * syscall.c (TSC): Remove. + * sysent.h (TRACE_SCHED): Remove. + * qualify.c (lookup_class): Remove %sched. + * strace.1 (.SS Filtering): Likewise. + * NEWS: Likewise. + * linux/32/syscallent.h: Remove TSC flag from sched* syscalls. + * linux/64/syscallent.h: Likewise. + * linux/alpha/syscallent.h: Likewise. + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/crisv10/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + * tests/sched.test: Replace trace=%sched with trace=/sched. + * tests/ksysent.c (TSC): Remove. + * tests/nsyscalls.c: Likewise. + +2017-04-14 Dmitry V. Levin + + Revert "Implement -e trace=%clock option" + -e trace=%clock became redundant as -e trace=/clock does the same. + + This reverts commit 0a13d2391c413e3847b71ec0c1d38f56e353b1b5. + + * syscall.c (TCL): Remove. + * sysent.h (TRACE_CLOCK): Remove. + * qualify.c (lookup_class): Remove %clock. + * strace.1 (.SS Filtering): Likewise. + * NEWS: Likewise. + * linux/32/syscallent.h: Remove TCL flag from clock_* syscalls. + * linux/64/syscallent.h: Likewise. + * linux/alpha/syscallent.h: Likewise. + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/crisv10/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + * tests/clock.test: Replace trace=%clock with trace=/clock. + * tests/ksysent.c (TCL): Remove. + * tests/nsyscalls.c: Likewise. + +2017-04-14 Dmitry V. Levin + + tests: robustify regex.test. + * tests/regex.test: Use trace_statfs.test as a template instead + of clock.test and sched.test, not because of more interesting + regular expressions but to fix build on platforms where + clock.test and sched.test are not reenterable. + +2017-04-14 JingPiao Chen + + Implement -e trace=/regex option. + * qualify.c: Include . + (qualify_syscall_regex): New function. + (qualify_syscall): Use it. + * strace.1: Document -e trace=/regex option. + * NEWS: Mention -e trace=/regex option. + * tests/regex.test: New test. + * tests/Makefile.am (DECODER_TESTS): Add it. + * tests/options-syntax.test: Add checks for invaild regexp + and for regexp that doesn't match a syscall. + +2017-04-14 Dmitry V. Levin + + tests: fix ioctl_nsfs.test on hppa. + * tests/ioctl_nsfs.c (test_user_namespace): Specify an address + in the middle of a mapped page as child_stack address argument + of the clone call. + [IA64] (clone): Update. + +2017-04-14 Dmitry V. Levin + + tests: fix ioctl_nsfs.test on ia64. + glibc on ia64 provides no clone() function, but there is a __clone2 + function instead. It is documented but no prototype is provided by + glibc. + + * tests/ioctl_nsfs.c [IA64] (__clone2): New prototype. + [IA64] (clone): New macro wrapper around __clone2. + +2017-04-13 Edgar Kaziahmedov + + tests: check decoding of the remaining V4L2_BUF_TYPE_* types. + * tests/ioctl_v4l2.c (init_v4l2_format, print_ioctl_v4l2): New functions + to avoid code duplication in VIDIOC_S_FMT and VIDIOC_TRY_FMT tests. + (main) : Use them. Add + checks for remaining V4L2_BUF_TYPE_* types. + + v4l2: Implement decoding of the remaining V4L2_BUF_TYPE_* types. + * v4l2.c: Include "xlat/v4l2_vbi_flags.h" and "xlat/v4l2_sliced_flags.h". + (struct_v4l2_clip): New typedef. Mpersify it. + (print_v4l2_clip): New function. + (print_v4l2_format_fmt): Use it. Add struct tcb argument. Implement + decoding of the remaining V4L2_BUF_TYPE_* types. + * xlat/v4l2_vbi_flags.in: Add V4L2_VBI_UNSYNC and V4L2_VBI_INTERLACED + introduced by linux kernel commit v2.5.46~39^2~23^2~4. + Add V4L2_VBI_ITU_525_F1_START, V4L2_VBI_ITU_525_F2_START, + V4L2_VBI_ITU_625_F1_START, and V4L2_VBI_ITU_625_F2_START introduced by + linux kernel commit v3.17-rc1~112^2~217. + * xlat/v4l2_sliced_flags.in: Add V4L2_SLICED_TELETEXT_B, V4L2_SLICED_VPS, + V4L2_SLICED_CAPTION_525, V4L2_SLICED_WSS_625, V4L2_SLICED_VBI_525, and + V4L2_SLICED_VBI_625 introduced by linux kernel commit v2.6.14-rc2~64. + * configure.ac (AC_CHECK_DECLS): Add V4L2_BUF_TYPE_SDR_CAPTURE and + V4L2_BUF_TYPE_SDR_OUTPUT. + (AC_CHECK_MEMBERS): Add struct v4l2_window.global_alpha and + struct v4l2_sdr_format.buffersize. + * NEWS: Mention this change. + +2017-04-13 Dmitry V. Levin + + travis: use mainline kernel uapi headers for coverage. + * .travis.yml (matrix) : Add KHEADERS=torvalds/linux. + * travis-build.sh: Handle $KHEADERS. + * travis-install.sh: Likewise. + + travis: switch from clang-3.6 to clang-3.8. + * .travis.yml (matrix): Change clang-3.6 to clang-3.8. + +2017-04-13 Nikolay Marchuk + + Implement decoding of NS_* ioctl commands. + * configure.ac (AC_CHECK_HEADERS): Add linux/nsfs.h. + * defs.h (DECL_IOCTL(nsfs)): New prototype. + (setns_types): Make global. + * ioctl.c (ioctl_decode): Call nsfs_ioctl for 0xb7 code. + * nsfs.c: New file. + * nsfs.h: Likewise. + * Makefile.am (strace_SOURCES): Add them. + * tests/ioctl_nsfs.c: New file. + * tests/ioctl_nsfs.test: Likewise. + * tests/.gitignore: Add ioctl_nsfs. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add ioctl_nsfs.test. + * NEWS: Mention this change. + +2017-04-13 Dmitry V. Levin + + travis: copy coverage test suite log to the travis log. + * travis-build.sh (coverage): Print tests*/test-suite.log + and tests*/ksysent.log. + +2017-04-12 Dmitry V. Levin + + travis: add gcc-6. + * .travis.yml (matrix): Add gcc-6 entries. + * travis-build.sh: Handle gcc*. + * travis-install.sh: Handle gcc-*. + +2017-04-11 Dmitry V. Levin + + tests: robustify gen_tests.sh against in-tree builds. + * tests/gen_tests.sh: Use abs_srcdir instead of srcdir to construct + a path to gen_tests.sh in implicit make rules. + +2017-04-11 Dmitry V. Levin + + trace_syscall_exiting: do not call get_regs for filtered syscalls. + This saves up to 25% of ptrace syscalls in case of trace filtering. + + * syscall.c (trace_syscall_exiting): Do not call gettimeofday + and get_regs for filtered syscalls. + * NEWS: Mention this change. + * tests/get_regs.test: New test. + * tests/Makefile.am (MISC_TESTS): Add it. + +2017-04-11 Dmitry V. Levin + + Delay get_regs invocation. + strace used to call get_regs on every stop of a tracee, including cases + when the result is going to be discarded. Prepare to change this lavish + practice by delaying get_regs invocation until its result is actually + needed. + + * defs.h (get_regs): Remove. + * strace.c (trace): Do not call get_regs. + * syscall.c (get_regs): Add static qualifier. + (trace_syscall_exiting, print_pc, get_scno): Call get_regs. + +2017-04-11 Dmitry V. Levin + + startup_tcb: move get_scno invocation to a more convenient place. + * strace.c (trace): Move get_scno invocation ... + (startup_tcb): ... here. This is a no-op change that slightly improves + readability. + +2017-04-11 Dmitry V. Levin + + get_regs: guard against subsequent invocations. + At this moment there is only one call to get_regs, + but there is going to be more of them, so a guard is needed. + + This change also adds a clear_regs call before get_regs, + which essentially reverts commit v4.9-288-ge9bfff6. + + * strace.c (trace): Call clear_regs before get_regs. + * syscall.c (get_regs): Skip if get_regs_error != -1. + +2017-04-11 Dmitry V. Levin + + syscall: move definitions of automatic variables closer to their use. + * syscall.c (trace_syscall_entering, trace_syscall_exiting): Move + definitions of automatic variables closer to their first use. This + change slightly improves readability. + + tests: check decoding of gettid syscall. + * tests/gettid.c: New file. + * tests/.gitignore: Add gettid. + * tests/Makefile.am (check_PROGRAMS): Likewise. + * tests/gen_tests.in (gettid): New entry. + +2017-04-11 Dmitry V. Levin + + tests: fix build on alpha. + * tests/getpid.c: Skip if __NR_getpid is not defined. + * tests/getppid.c: Skip if __NR_getppid is not defined. + + Fixes: fd1041f6 ("tests: add tests for getpid and getppid syscalls") + +2017-04-11 Dmitry V. Levin + + Fix build with old linux/netlink.h. + * socketutils.c: Provide a fallback definition of NETLINK_SOCK_DIAG. + + Fixes: 5c256356 ("Do not include xlat/netlink_protocols.h twice") + +2017-04-10 Dmitry V. Levin + + Do not include xlat/netlink_protocols.h twice. + Make netlink_protocols a global xlat array defined in net.c file. + + * defs.h (netlink_protocols): New prototype. + * socketutils.c: Stop including "xlat/netlink_protocols.h". + +2017-04-10 Dmitry V. Levin + + Do not include xlat/clocknames.h twice. + Make clocknames a global xlat array defined in time.c file. + + * defs.h (clocknames): New prototype. + * perf.c: Stop including "xlat/clocknames.h". + +2017-04-10 Dmitry V. Levin + + Remove unused xlat/openmodessol.in. + * xlat/openmodessol.in: Remove file unused since commit + v4.10-45-gdf4dd8b. + + Remove unused xlat/aclipc.in. + * xlat/aclipc.in: Remove file unused since commit v4.9-46-g681452b. + +2017-04-07 Dmitry V. Levin + + tests: remove statfs.expected. + statfs.expected is unused since commit v4.11-515-g67c2f67. + + * tests/statfs.expected: Remove. + * tests/Makefile.am (EXTRA_DIST): Remove it. + +2017-04-07 Sandhya Bankar + + tests: add tests for getpid and getppid syscalls. + + [ldv: rewritten everything] + + * tests/getpid.c: New file. + * tests/getppid.c: Likewise. + * tests/.gitignore: Add getpid and getppid. + * tests/pure_executables.list: Likewise. + * tests/Makefile.am (check_PROGRAMS): Likewise. + * tests/gen_tests.in (getpid, getppid): New entries. + +2017-04-07 Edgar Kaziahmedov + + Update V4L2_* constants. + * xlat/v4l2_buf_flags.in: Add V4L2_BUF_FLAG_PREPARED, + V4L2_BUF_FLAG_NO_CACHE_INVALIDATE, and V4L2_BUF_FLAG_NO_CACHE_CLEAN + introduced by linux kernel commit v3.2-rc1~63^2~55. + Add V4L2_BUF_FLAG_TIMESTAMP_MASK, V4L2_BUF_FLAG_TIMESTAMP_UNKNOWN, + and V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC introduced by linux kernel commit + v3.9-rc1~93^2~536. + Add V4L2_BUF_FLAG_TIMESTAMP_COPY introduced by linux kernel commit + v3.10-rc1~136^2~560. + Add V4L2_BUF_FLAG_TSTAMP_SRC_MASK, V4L2_BUF_FLAG_TSTAMP_SRC_EOF, + and V4L2_BUF_FLAG_TSTAMP_SRC_SOE introduced by linux kernel commit + v3.15-rc1~85^2~186. + Add V4L2_BUF_FLAG_LAST introduced by linux kernel commit + v4.2-rc1~107^2~389. + * xlat/v4l2_buf_types.in: Add V4L2_BUF_TYPE_SDR_CAPTURE + and V4L2_BUF_TYPE_SDR_OUTPUT introduced by linux kernel commits + v3.15-rc1~85^2~213 and v4.4-rc1~118^2~14, respectively. + * xlat/xlat/v4l2_colorspaces.in: Add V4L2_COLORSPACE_ADOBERGB + and V4L2_COLORSPACE_BT2020 introduced by linux kernel commit + v3.19-rc1~29^2~72. + Add V4L2_COLORSPACE_RAW and V4L2_COLORSPACE_DCI_P3 introduced by linux + kernel commits v4.2-rc1~107^2~182 and v4.4-rc1~118^2~120, respectively. + * xlat/v4l2_device_capabilities_flags.in: Add V4L2_CAP_SDR_CAPTURE, + V4L2_CAP_EXT_PIX_FORMAT, and V4L2_CAP_SDR_OUTPUT introduced by linux + kernel commits v3.15-rc1~85^2~210, v3.17-rc1~112^2~327, + and v4.4-rc1~118^2~14, respectively. + * xlat/v4l2_memories.in: Add V4L2_MEMORY_OVERLAY introduced + in linux 2.5.46. Add V4L2_MEMORY_DMABUF introduced by linux kernel + commit v3.8-rc1~115^2^2~52. + +2017-04-07 Abhishek Tiwari + + Implement -e trace=%statfs option. + linux/*/syscallent*.h part is modified automatically by: + + sed -i 's/TF\(,[[:space:]]*SEN.*[_"]statv\?fs\)/TF|TSF\1/' \ + linux/*/syscallent*.h + + [ldv: rewritten trace_statfs.test using sched.test as a template] + + * sysent.h (TRACE_STATFS): New macro. + * syscall.c: Alias TSF to TRACE_STATFS around syscallent.h inclusion. + * qualify.c (lookup_class): Add SCHED_STATFS for "%statfs". + * strace.1 (.SS Filtering): Add information about %statfs syscall class. + * NEWS: Mention this change. + * linux/64/syscallent.h (statfs): Add TSF flag. + * linux/aarch64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/32/syscallent.h (statfs64): Likewise. + * linux/arm/syscallent.h (statfs, statfs64): Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/crisv10/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + * linux/alpha/syscallent.h (osf_statfs, osf_statfs64, statfs): Likewise. + * linux/mips/syscallent-compat.h (*_statfs, *_statvfs): Likewise. + * tests/trace_statfs.test: New test. + * tests/Makefile.am (DECODER_TESTS): Add it. + * tests/ksysent.c (TSF): New macro, defined to 0. + * tests/nsyscalls.c: Likewise. + +2017-04-06 Rishi Bhatt + + Implement -e trace=%clock option. + linux/*/syscallent.h part is modified automatically by + sed -i 's/0\(,[[:space:]]*SEN(clock_\)/TCL\1/' linux/*/syscallent*.h + + [ldv: rewritten clock.test using sched.test as a template] + + * sysent.h (TRACE_CLOCK): New macro. + * syscall.c: Alias TCL to TRACE_CLOCK around syscallent.h inclusion. + * qualify.c (lookup_class): Add TRACE_CLOCK for "%clock". + * strace.1 (.SS Filtering): Add information about %clock syscall class. + * NEWS: Mention this change. + * linux/32/syscallent.h: Add TCL flag for clock_* syscalls. + * linux/64/syscallent.h: Likewise. + * linux/alpha/syscallent.h: Likewise. + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/crisv10/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + * tests/clock.test: New test. + * tests/Makefile.am (DECODER_TESTS): Add it. + * tests/ksysent.c (TCL): New macro, defined to 0. + * tests/nsyscalls.c: Likewise. + +2017-04-06 Dmitry V. Levin + + tests: tabulate xattr.test. + * tests/gen_tests.in (xattr): New entry. + * tests/xattr.test: Remove. + * tests/Makefile.am (DECODER_TESTS): Remove xattr.test. + +2017-04-05 Dmitry V. Levin + + tests: generalize scripts that check non-abbreviated decoding of ioctls. + * tests/ioctl-v.sh: New file. + * tests/Makefile.am (EXTRA_DIST): Add it. + (DECODER_TESTS): Remove ioctl_evdev-v.test, ioctl_loop-v.test, + and ioctl_rtc-v.test. + * tests/gen_tests.in (ioctl_evdev-v, ioctl_loop-v, ioctl_rtc-v): + New entries. + * tests/ioctl_evdev-v.test: Remove. + * tests/ioctl_loop-v.test: Ditto. + * tests/ioctl_rtc-v.test: Ditto. + +2017-04-05 Dmitry V. Levin + + tests: tabulate stereotypical test scripts. + Convert test scripts that follow simple testing patterns to a table. + Generate all these scripts from gen_tests.in file using gen_tests.sh + script at bootstrap time. + + The largest set of test scripts has been converted using + the following command: + + grep -l ^run_strace_match_diff *.test |while read f; do + n="${f%.test}" + grep '^[^#]' "$f" | + grep -Evq '^(\. "\${srcdir=\.}/init\.sh"|run_strace_match_diff)' || + sed -n 's/^run_strace_match_diff\(.*\)/'$n'\1/p' "$f" + done + + The second largest set of test scripts has been converted using + the following command: + + grep -l srcdir= *.test |while read f; do + n="${f%.test}" + grep '^[^#]' "$f" | + grep -Fvq srcdir= || + sed -n 's/^. "\${srcdir=.}\/\([^"]\+\)".*/'$n'\t+\1/p' "$f" + done + + * tests/gen_tests.in: New file. + * tests/gen_tests.sh: New file. + * bootstrap: Invoke it. + * tests/.gitignore: Add *.gen.test and gen_tests.am. + * tests/_newselect.test: Remove. + * tests/accept.test: Ditto. + * tests/accept4.test: Ditto. + * tests/access.test: Ditto. + * tests/acct.test: Ditto. + * tests/add_key.test: Ditto. + * tests/adjtimex.test: Ditto. + * tests/aio.test: Ditto. + * tests/alarm.test: Ditto. + * tests/bpf.test: Ditto. + * tests/btrfs.test: Ditto. + * tests/chmod.test: Ditto. + * tests/chown.test: Ditto. + * tests/chown32.test: Ditto. + * tests/chroot.test: Ditto. + * tests/clock_adjtime.test: Ditto. + * tests/clock_nanosleep.test: Ditto. + * tests/clock_xettime.test: Ditto. + * tests/copy_file_range.test: Ditto. + * tests/creat.test: Ditto. + * tests/delete_module.test: Ditto. + * tests/dup.test: Ditto. + * tests/dup2.test: Ditto. + * tests/dup3.test: Ditto. + * tests/epoll_create.test: Ditto. + * tests/epoll_create1.test: Ditto. + * tests/epoll_ctl.test: Ditto. + * tests/epoll_pwait.test: Ditto. + * tests/epoll_wait.test: Ditto. + * tests/erestartsys.test: Ditto. + * tests/execveat-v.test: Ditto. + * tests/execveat.test: Ditto. + * tests/faccessat.test: Ditto. + * tests/fadvise64_64.test: Ditto. + * tests/fallocate.test: Ditto. + * tests/fanotify_init.test: Ditto. + * tests/fanotify_mark.test: Ditto. + * tests/fchdir.test: Ditto. + * tests/fchmod.test: Ditto. + * tests/fchmodat.test: Ditto. + * tests/fchown.test: Ditto. + * tests/fchown32.test: Ditto. + * tests/fchownat.test: Ditto. + * tests/fcntl.test: Ditto. + * tests/fcntl64.test: Ditto. + * tests/fdatasync.test: Ditto. + * tests/file_handle.test: Ditto. + * tests/file_ioctl.test: Ditto. + * tests/finit_module.test: Ditto. + * tests/flock.test: Ditto. + * tests/fork-f.test: Ditto. + * tests/fstat64.test: Ditto. + * tests/fstatat64.test: Ditto. + * tests/fstatfs.test: Ditto. + * tests/fstatfs64.test: Ditto. + * tests/fsync.test: Ditto. + * tests/ftruncate.test: Ditto. + * tests/ftruncate64.test: Ditto. + * tests/futimesat.test: Ditto. + * tests/get_mempolicy.test: Ditto. + * tests/getcpu.test: Ditto. + * tests/getcwd.test: Ditto. + * tests/getdents.test: Ditto. + * tests/getdents64.test: Ditto. + * tests/getegid.test: Ditto. + * tests/getegid32.test: Ditto. + * tests/geteuid.test: Ditto. + * tests/geteuid32.test: Ditto. + * tests/getgid.test: Ditto. + * tests/getgid32.test: Ditto. + * tests/getgroups.test: Ditto. + * tests/getgroups32.test: Ditto. + * tests/getpeername.test: Ditto. + * tests/getpgrp.test: Ditto. + * tests/getrandom.test: Ditto. + * tests/getresgid.test: Ditto. + * tests/getresgid32.test: Ditto. + * tests/getresuid.test: Ditto. + * tests/getresuid32.test: Ditto. + * tests/getrlimit.test: Ditto. + * tests/getrusage.test: Ditto. + * tests/getsid.test: Ditto. + * tests/getsockname.test: Ditto. + * tests/getuid32.test: Ditto. + * tests/getxxid.test: Ditto. + * tests/inet-cmsg.test: Ditto. + * tests/init_module.test: Ditto. + * tests/inotify.test: Ditto. + * tests/inotify_init1.test: Ditto. + * tests/int_0x80.test: Ditto. + * tests/ioctl_block.test: Ditto. + * tests/ioctl_evdev.test: Ditto. + * tests/ioctl_loop.test: Ditto. + * tests/ioctl_mtd.test: Ditto. + * tests/ioctl_rtc.test: Ditto. + * tests/ioctl_scsi.test: Ditto. + * tests/ioctl_sg_io_v3.test: Ditto. + * tests/ioctl_sg_io_v4.test: Ditto. + * tests/ioctl_uffdio.test: Ditto. + * tests/ioctl_v4l2.test: Ditto. + * tests/ioperm.test: Ditto. + * tests/iopl.test: Ditto. + * tests/ioprio.test: Ditto. + * tests/ip_mreq.test: Ditto. + * tests/ipc.test: Ditto. + * tests/ipc_msg.test: Ditto. + * tests/ipc_sem.test: Ditto. + * tests/ipc_shm.test: Ditto. + * tests/kcmp.test: Ditto. + * tests/kexec_file_load.test: Ditto. + * tests/kexec_load.test: Ditto. + * tests/keyctl.test: Ditto. + * tests/kill.test: Ditto. + * tests/lchown.test: Ditto. + * tests/lchown32.test: Ditto. + * tests/link.test: Ditto. + * tests/linkat.test: Ditto. + * tests/lookup_dcookie.test: Ditto. + * tests/lstat.test: Ditto. + * tests/lstat64.test: Ditto. + * tests/mbind.test: Ditto. + * tests/membarrier.test: Ditto. + * tests/memfd_create.test: Ditto. + * tests/migrate_pages.test: Ditto. + * tests/mincore.test: Ditto. + * tests/mkdir.test: Ditto. + * tests/mkdirat.test: Ditto. + * tests/mknod.test: Ditto. + * tests/mknodat.test: Ditto. + * tests/mlock.test: Ditto. + * tests/mlock2.test: Ditto. + * tests/mlockall.test: Ditto. + * tests/mmap64.test: Ditto. + * tests/mmsg-silent.test: Ditto. + * tests/mmsg.test: Ditto. + * tests/mmsg_name-v.test: Ditto. + * tests/mmsg_name.test: Ditto. + * tests/mount.test: Ditto. + * tests/move_pages.test: Ditto. + * tests/mq.test: Ditto. + * tests/mq_sendrecv-read.test: Ditto. + * tests/mq_sendrecv-write.test: Ditto. + * tests/mq_sendrecv.test: Ditto. + * tests/msg_control-v.test: Ditto. + * tests/msg_control.test: Ditto. + * tests/msg_name.test: Ditto. + * tests/munlockall.test: Ditto. + * tests/nanosleep.test: Ditto. + * tests/net-icmp_filter.test: Ditto. + * tests/net-sockaddr.test: Ditto. + * tests/newfstatat.test: Ditto. + * tests/old_mmap.test: Ditto. + * tests/oldfstat.test: Ditto. + * tests/oldlstat.test: Ditto. + * tests/oldstat.test: Ditto. + * tests/open.test: Ditto. + * tests/openat.test: Ditto. + * tests/pause.test: Ditto. + * tests/perf_event_open.test: Ditto. + * tests/perf_event_open_nonverbose.test: Ditto. + * tests/perf_event_open_unabbrev.test: Ditto. + * tests/pipe2.test: Ditto. + * tests/pkey_alloc.test: Ditto. + * tests/pkey_free.test: Ditto. + * tests/pkey_mprotect.test: Ditto. + * tests/ppoll-v.test: Ditto. + * tests/ppoll.test: Ditto. + * tests/preadv-pwritev.test: Ditto. + * tests/preadv.test: Ditto. + * tests/preadv2-pwritev2.test: Ditto. + * tests/printstr.test: Ditto. + * tests/prlimit64.test: Ditto. + * tests/process_vm_readv.test: Ditto. + * tests/process_vm_writev.test: Ditto. + * tests/pselect6.test: Ditto. + * tests/ptrace.test: Ditto. + * tests/pwritev.test: Ditto. + * tests/quotactl-v.test: Ditto. + * tests/quotactl-xfs-v.test: Ditto. + * tests/quotactl-xfs.test: Ditto. + * tests/quotactl.test: Ditto. + * tests/readahead.test: Ditto. + * tests/readdir.test: Ditto. + * tests/readlink.test: Ditto. + * tests/readlinkat.test: Ditto. + * tests/reboot.test: Ditto. + * tests/recvfrom.test: Ditto. + * tests/recvmmsg-timeout.test: Ditto. + * tests/recvmsg.test: Ditto. + * tests/remap_file_pages.test: Ditto. + * tests/rename.test: Ditto. + * tests/renameat.test: Ditto. + * tests/renameat2.test: Ditto. + * tests/request_key.test: Ditto. + * tests/rmdir.test: Ditto. + * tests/rt_sigpending.test: Ditto. + * tests/rt_sigprocmask.test: Ditto. + * tests/rt_sigqueueinfo.test: Ditto. + * tests/rt_sigreturn.test: Ditto. + * tests/rt_sigsuspend.test: Ditto. + * tests/rt_sigtimedwait.test: Ditto. + * tests/rt_tgsigqueueinfo.test: Ditto. + * tests/sched_get_priority_mxx.test: Ditto. + * tests/sched_rr_get_interval.test: Ditto. + * tests/sched_xetaffinity.test: Ditto. + * tests/sched_xetattr.test: Ditto. + * tests/sched_xetparam.test: Ditto. + * tests/sched_xetscheduler.test: Ditto. + * tests/sched_yield.test: Ditto. + * tests/seccomp-filter-v.test: Ditto. + * tests/seccomp-filter.test: Ditto. + * tests/select.test: Ditto. + * tests/semop.test: Ditto. + * tests/sendfile.test: Ditto. + * tests/sendfile64.test: Ditto. + * tests/set_mempolicy.test: Ditto. + * tests/setdomainname.test: Ditto. + * tests/setfsgid.test: Ditto. + * tests/setfsgid32.test: Ditto. + * tests/setfsuid.test: Ditto. + * tests/setfsuid32.test: Ditto. + * tests/setgid.test: Ditto. + * tests/setgid32.test: Ditto. + * tests/setgroups.test: Ditto. + * tests/setgroups32.test: Ditto. + * tests/sethostname.test: Ditto. + * tests/setns.test: Ditto. + * tests/setregid.test: Ditto. + * tests/setregid32.test: Ditto. + * tests/setresgid.test: Ditto. + * tests/setresgid32.test: Ditto. + * tests/setresuid.test: Ditto. + * tests/setresuid32.test: Ditto. + * tests/setreuid.test: Ditto. + * tests/setreuid32.test: Ditto. + * tests/setrlimit.test: Ditto. + * tests/setuid.test: Ditto. + * tests/setuid32.test: Ditto. + * tests/shutdown.test: Ditto. + * tests/siginfo.test: Ditto. + * tests/signal_receive.test: Ditto. + * tests/signalfd4.test: Ditto. + * tests/sigreturn.test: Ditto. + * tests/socketcall.test: Ditto. + * tests/splice.test: Ditto. + * tests/stat.test: Ditto. + * tests/stat64.test: Ditto. + * tests/statfs64.test: Ditto. + * tests/statx.sh: Ditto. + * tests/statx.test: Ditto. + * tests/swap.test: Ditto. + * tests/symlink.test: Ditto. + * tests/symlinkat.test: Ditto. + * tests/sync.test: Ditto. + * tests/sync_file_range.test: Ditto. + * tests/sync_file_range2.test: Ditto. + * tests/sysinfo.test: Ditto. + * tests/syslog.test: Ditto. + * tests/tee.test: Ditto. + * tests/time.test: Ditto. + * tests/timer_create.test: Ditto. + * tests/timer_xettime.test: Ditto. + * tests/timerfd_xettime.test: Ditto. + * tests/times-fail.test: Ditto. + * tests/times.test: Ditto. + * tests/truncate.test: Ditto. + * tests/truncate64.test: Ditto. + * tests/ugetrlimit.test: Ditto. + * tests/umask.test: Ditto. + * tests/umoven-illptr.test: Ditto. + * tests/umovestr-illptr.test: Ditto. + * tests/umovestr3.test: Ditto. + * tests/unlink.test: Ditto. + * tests/unlinkat.test: Ditto. + * tests/unshare.test: Ditto. + * tests/userfaultfd.test: Ditto. + * tests/ustat.test: Ditto. + * tests/utime.test: Ditto. + * tests/utimes.test: Ditto. + * tests/vfork-f.test: Ditto. + * tests/vhangup.test: Ditto. + * tests/vmsplice.test: Ditto. + * tests/wait4-v.test: Ditto. + * tests/wait4.test: Ditto. + * tests/waitid-v.test: Ditto. + * tests/waitid.test: Ditto. + * tests/waitpid.test: Ditto. + * tests/xattr-strings.test: Ditto. + * tests/xet_robust_list.test: Ditto. + * tests/xetitimer.test: Ditto. + * tests/xetpgid.test: Ditto. + * tests/xetpriority.test: Ditto. + * tests/xettimeofday.test: Ditto. + * tests/Makefile.am (DECODER_TESTS, MISC_TESTS): Remove them. + Include gen_tests.am. + (TESTS): Add $(GEN_TESTS). + (XFAIL_TESTS_x86_64, XFAIL_TESTS_x32): Rename int_0x80.test + to int_0x80.gen.test. + (EXTRA_DIST): Add gen_tests.in and gen_tests.sh, remove statx.sh. + (clean-local-check): Remove $(GEN_TESTS:.gen.test=.dir). + +2017-04-04 Dmitry V. Levin + + tests: handle test scripts with .gen.test suffix. + * tests/init.sh: If script name ends with .gen.test, + set NAME variable with .gen.test suffix stripped. + +2017-04-04 Eugene Syromyatnikov + + mpers.awk: add support for multidimensional arrays. + * mpers.awk (update_upper_bound): New function, which maintains new "count" + property for storing total element count and updates "upper_bound" + property which now contains string with array dimensions. + (/^DW_AT_upper_bound/, /^DW_AT_count/): Use it. + (what_is) : Use "count" property in order to calculate + returned_size, do not embody returned string in square brackets. + * mpers_test.sh: Add checks for multidimensional arrays. + +2017-04-04 Dmitry V. Levin + + mpers.awk: prepare for adding support of multidimensional arrays. + * mpers.awk (what_is) : + Move formatting of array upper_bound ... + : ... here. + +2017-04-03 Dmitry V. Levin + + tests: cleanup temporary files removals. + As every test now runs in its own subdirectory, there is no need + to remove leftover files manually by each test. + + * tests/init.sh (run_strace_match_diff): Do not remove $EXP. + * tests/brk.test: Likewise. + * tests/options-syntax.test: Likewise. + * tests/qual_inject-retval.test (check_injection): Likewise. + * tests/qual_signal.test (test_one_sig): Likewise. + * tests/sched.test: Likewise. + * tests/seccomp-strict.test: Likewise. + * tests/strace-V.test: Likewise. + * tests/strace-tt.test: Likewise. + * tests/strace-ttt.test: Likewise. + * tests/threads-execve.test: Likewise. + * tests/attach-f-p.test: Use $EXP instead of $OUT, do not remove it. + * tests/personality.test: Likewise. + * tests/poll.test: Likewise. + * tests/fstat.test: Likewise. + * tests/ipc.sh: Likewise. + * tests/restart_syscall.test: Likewise. + * tests/utimensat.test: Likewise. + * tests/attach-p-cmd.test: Likewise. Do not remove + attach-p-cmd.test-lock. + * tests/detach-running.test: Do not remove $LOG. + * tests/detach-sleeping.test: Likewise. + * tests/detach-stopped.test: Likewise. + * tests/redirect.test: Do not remove $OUT. + * tests/strace-S.test: Likewise. + * tests/getdents.test: Do not remove $LOG.dir. + * tests/getdents64.test: Likewise. + * tests/readdir.test: Likewise. + * tests/btrfs-v.test: Do not remove $EXP and $OUT. + * tests/btrfs-vw.test: Likewise. + * tests/btrfs-w.test: Likewise. + * tests/execve-v.test: Likewise. + * tests/execve.test: Likewise. + * tests/fadvise64.test: Likewise. + * tests/getuid.test: Likewise. + * tests/ioctl.test: Likewise. + * tests/ioctl_dm-v.test: Likewise. + * tests/ioctl_dm.test: Likewise. + * tests/ioctl_evdev-v.test: Likewise. + * tests/ioctl_loop-nv.test: Likewise. + * tests/ioctl_loop-v.test: Likewise. + * tests/ioctl_loop.test: Likewise. + * tests/ioctl_rtc-v.test: Likewise. + * tests/ioctl_sock_gifconf.test: Likewise. + * tests/llseek.test: Likewise. + * tests/lseek.test: Likewise. + * tests/mmap.test: Likewise. + * tests/net-y-unix.test: Likewise. + * tests/net-yy-inet.test: Likewise. + * tests/net-yy-netlink.test: Likewise. + * tests/net-yy-unix.test: Likewise. + * tests/opipe.test: Likewise. + * tests/prctl-arg2-intptr.test: Likewise. + * tests/prctl-dumpable.test: Likewise. + * tests/prctl-name.test: Likewise. + * tests/prctl-no-args.test: Likewise. + * tests/prctl-pdeathsig.test: Likewise. + * tests/prctl-seccomp-filter-v.test: Likewise. + * tests/prctl-seccomp-strict.test: Likewise. + * tests/prctl-securebits.test: Likewise. + * tests/prctl-tid_address.test: Likewise. + * tests/prctl-tsc.test: Likewise. + * tests/umovestr2.test: Likewise. + * tests/uname.test: Likewise. + * tests/pread64-pwrite64.test: Do nore remove pread64-pwrite64-tmpfile. + * tests/read-write.test: Do nore remove read-write-tmpfile. + * tests/qual_fault.test (check_fault_injection): Do not remove $EXP, + $outexp, and $outgot. + * tests/redirect-fds.test (check_fd): Reorder removal of work files. + * tests/pc.test: Use $EXP instead of $EXPECTED, do not remove it. + * tests/strace-t.test: Likewise. + * tests/scm_rights-fd.test: Likewise. Use dir instead of $LOG.dir, + do not remove it. + * tests/strace-ff.test: Do not remove $OUT and $LOG.* files. + +2017-04-03 Dmitry V. Levin + + tests: enhance sched.test negative check. + * tests/sched.test: Test that trace=%sched doesn't match + anything besides sched_* syscalls by checking it against all test + executables without side effects listed in pure_executables.list + except sched_* and times. + +2017-04-03 Dmitry V. Levin + + tests: add a list of executables without side effects. + These are executables that could be used by several different tests + simultaneously. + + * tests/pure_executables.list: New file. + * tests/Makefile.am (EXTRA_DIST): Add it. + +2017-04-03 Dmitry V. Levin + + tests: use fixed socket address in net-yy-unix.test. + This allows net-yy-unix invocation without arguments. + + * tests/net-yy-unix.c (TEST_SOCKET): New macro. + (void): Use it instead of av[1]. + * tests/net-yy-unix.test: Do not specify arguments for the test + executable. + +2017-04-03 Dmitry V. Levin + + tests: use fixed socket address in net-y-unix.test. + This allows net-y-unix invocation without arguments. + + * tests/net-y-unix.c (TEST_SOCKET): New macro. + (void): Use it instead of av[1]. + * tests/net-y-unix.test: Do not specify arguments for the test + executable. + +2017-04-03 Dmitry V. Levin + + tests: run every test except ksysent.test in its own subdirectory. + Many test executables create temporary files in the current work + directory for the duration of their execution. + This level of test isolation allows more test executables to be invoked + several times simultaneously. + + * tests/.gitignore: Add *.dir, remove *.log.*, *.tmp, *.tmp-*, + and *.tmp.* patterns. + * tests/Makefile.am (clean-local, clean-local-check): New rules. + (.PHONY): Add clean-local-check. + (CLEANFILES): Remove all but ksysent.h. + * tests/init.sh: Strip test-specific prefix from LOG, OUT, and EXP + variables. When invoked from a test, create a new test-specific + directory, chdir into it, and add more ../ prefix to STRACE variable. + (run_prog): Replace "./" with "../". + * tests/attach-f-p.test: Replace "./" with "../". + * tests/attach-p-cmd.test: Likewise. + * tests/bexecve.test: Likewise. + * tests/btrfs-v.test: Likewise. + * tests/btrfs-vw.test: Likewise. + * tests/btrfs-w.test: Likewise. + * tests/count.test: Likewise. + * tests/detach-running.test: Likewise. + * tests/detach-sleeping.test: Likewise. + * tests/detach-stopped.test: Likewise. + * tests/mmap.test: Likewise. + * tests/net-y-unix.test: Likewise. + * tests/net-yy-inet.test: Likewise. + * tests/net-yy-netlink.test: Likewise. + * tests/net-yy-unix.test: Likewise. + * tests/net.test: Likewise. + * tests/opipe.test: Likewise. + * tests/poll.test: Likewise. + * tests/prctl-seccomp-strict.test: Likewise. + * tests/qual_fault-exit_group.test: Likewise. + * tests/qual_fault.test: Likewise. + * tests/qual_inject-error-signal.test: Likewise. + * tests/qual_inject-retval.test: Likewise. + * tests/qual_inject-signal.test: Likewise. + * tests/qual_signal.test: Likewise. + * tests/qual_syscall.test: Likewise. + * tests/readv.test: Likewise. + * tests/redirect-fds.test: Likewise. + * tests/sched.test: Likewise. + * tests/scm_rights-fd.test: Likewise. + * tests/seccomp-strict.test: Likewise. + * tests/strace-C.test: Likewise. + * tests/strace-E.expected: Likewise. + * tests/strace-E.test: Likewise. + * tests/strace-S.test: Likewise. + * tests/strace-T.test: Likewise. + * tests/strace-V.test: Likewise. + * tests/strace-ff.test: Likewise. + * tests/strace-k.test: Likewise. + * tests/strace-r.expected: Likewise. + * tests/strace-r.test: Likewise. + * tests/strace-t.test: Likewise. + * tests/strace-tt.test: Likewise. + * tests/strace-ttt.test: Likewise. + * tests/sun_path.test: Likewise. + * tests/uname.test: Likewise. + * tests/unix-pair-send-recv.test: Likewise. + * tests/unix-pair-sendto-recvfrom.test: Likewise. + +2017-04-03 Dmitry V. Levin + + tests: make test executables invocable outside current work directory. + Most of test executables were ready for the upcoming change, + this change prepares all the rest. + + * tests/getdents.c (main): Use fixed name for the sample directory. + * tests/getdents64.c (main): Likewise. + * tests/readdir.c (main): Likewise. + * tests/mknod.c (sample): Change to a pointer. + (main): Use av[0] as a sample. + * tests/symlink.c (main): Use av[0] as a linkpath. + * tests/umode_t.c (sample): Change to a pointer. + (test_syscall): Fix expected output. + (main): Use av[0] as a sample. + +2017-03-31 Dmitry V. Levin + + tests: cleanup access.test. + * tests/access.test: Use run_strace_match_diff. + * tests/access.c (main): Update expected output. + +2017-03-30 Dmitry V. Levin + + tests: cleanup oldfstat.test. + * tests/oldfstat.test: Use fstat.test. + +2017-03-29 Dmitry V. Levin + + aarch64: workaround gcc+kernel bug. + Due to a subtle gcc bug that leads to miscompiled aarch64 kernels, + the 3rd argument of sched_getattr syscall is not quite 32-bit + on aarch64 as on other architectures. For more details see + https://sourceforge.net/p/strace/mailman/message/35721703/ + + * defs.h (print_abnormal_hi): New prototype. + * util.c (print_abnormal_hi): New function. + * sched.c (SYS_FUNC(sched_getattr)) [AARCH64]: Use it. + * tests/sched_xetattr.c (main) [__arm64__ || __aarch64__]: Test it. + +2017-03-29 Abhishek Tiwari + + alpha, mips: fix missing flags in stat related compatibility syscalls. + Following commands do the fix: + + Add TF flag, fixed by: + git grep -Fl '_stat' linux/*/syscallent* | xargs sed -i \ + 's/0\(,[[:space:]]*SEN(.*_l\?stat[^i]\)/TF\1/' + + Add TD flag, fixed by: + git grep -Fl '_stat' linux/*/syscallent* | xargs sed -i \ + 's/0\(,[[:space:]]*SEN(.*_fstat\)/TD\1/' + + * linux/alpha/syscallent.h: Add TF and TD flags to stat related + compat syscall entries. + * linux/mips/syscallent-compat.h: Likewise. + +2017-03-24 Dmitry V. Levin + + alpha: fix the number of arguments in alpha specific syscalls. + * linux/alpha/syscallent.h (getxgid, osf_stat, osf_lstat, osf_fstat, + osf_sysinfo, sethae): Set nargs according to arch/alpha/kernel/osf_sys.c + from linux v4.10. + + alpha: update comments about not implemented syscalls. + * linux/alpha/syscallent.h: Sync "not implemented" comments + with arch/alpha/kernel/systbls.S from linux v4.10. + +2017-03-23 Quentin Monnet + + Update BPF_MAP_TYPE_* constants. + * xlat/bpf_map_types.in: Add BPF_MAP_TYPE_ARRAY_OF_MAPS + and BPF_MAP_TYPE_HASH_OF_MAPS constants. + +2017-03-23 Gleb Fotengauer-Malinovskiy + + Update ioctl entries from linux v4.11-rc3. + * linux/32/ioctls_inc_align16.h: Update from linux v4.11-rc3 using ioctls_gen.sh. + * linux/32/ioctls_inc_align32.h: Likewise. + * linux/32/ioctls_inc_align64.h: Likewise. + * linux/64/ioctls_inc.h: Likewise. + * linux/x32/ioctls_inc0.h: Likewise. + * linux/arm/ioctls_arch0.h: Likewise. + * linux/i386/ioctls_arch0.h: Likewise. + * linux/powerpc/ioctls_arch0.h: Likewise. + * linux/s390/ioctls_arch0.h: Likewise. + * linux/s390x/ioctls_arch0.h: Likewise. + * linux/x86_64/ioctls_arch0.h: Likewise. + * NEWS: Mention this. + + maint: update for linux 4.11. + * maint/ioctls_sym.sh (ppc_list): Add KVM_PPC_GET_RMMU_INFO + and KVM_PPC_CONFIGURE_V3_MMU. + +2017-03-19 Dmitry V. Levin + + test: rename README to README.md. + * test/README: Rename to README.md, turn ../tests reference into an URL. + + test: update README. + * test/README: Tell the reader what this directory is actually for. + + test: rewrite skodic.c demo. + * test/skodic.c: Rewrite this demo to simplify its use. + +2017-03-18 Victor Krapivensky + + Implement decoding of statx syscall. + * linux/i386/syscallent.h [383]: Add statx entry. + * linux/x32/syscallent.h [332]: Likewise. + * linux/x86_64/syscallent.h [332]: Likewise. + * pathtrace.c (pathtrace_match): Handle SEN_statx. + * statx.c: New file. + * statx.h: Likewise. + * Makefile.am (strace_SOURCES): Add them. + * tests/.gitignore: Add statx. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add statx.test. + * tests/statx.c: New file. + * tests/statx.test: Likewise. + * tests/xstatx.c: Modify to support statx. + * xlat/at_statx_sync_types.in: New file. + * xlat/statx_attrs.in: Likewise. + * xlat/statx_masks.in: Likewise. + * NEWS: Mention this change. + +2017-03-17 Dmitry V. Levin + + tests: check for out of bounds fetch in parsers of stat family syscalls. + * tests/xstatx.c (main): Create STRUCT_STAT object using + TAIL_ALLOC_OBJECT_CONST_PTR. + + tests: check unexpected syscall errors returned by stat family syscalls. + * tests/xstatx.c (main) [!OLD_STAT]: Do not skip the test + in case of EOVERFLOW. + Treat errors other than ENOSYS and EOVERFLOW as fatal. + +2017-03-17 Eugene Syromyatnikov + + tests: move try_run_prog to init.sh. + Looks like try_run_prog may be of general use by other syscall class + tests. + + * tests/sched.test (try_run_prog): Move it... + * tests/init: ... here. + +2017-03-17 Eugene Syromyatnikov + + tests/sched.test: rc should be a local variable in try_run_prog. + * tests/sched.test (try_run_prog): Add local rc. + +2017-03-16 Dmitry V. Levin + + tests: check decoding of int 0x80 on x86_64, x32, and x86. + * tests/int_0x80.c: New file. + * tests/int_0x80.test: New test. + * tests/.gitignore: Add int_0x80. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (MISC_TESTS, XFAIL_TESTS_x86_64, XFAIL_TESTS_x32): Add int_0x80.test. + (XFAIL_TESTS): Add $(XFAIL_TESTS_$(ARCH)). + (CLEANFILES): Add $(TESTS:=.tmp.out) and $(TESTS:=.tmp.exp). + +2017-03-16 Damien Profeta + + strace-graph: handle pid looping. + * strace-graph: On long running process or heavily forking one (like + compilation), it can happen that a parent get 2 different children with + the same pid. By tracking the currently runnig pid and adding the start + timestamp to the pid, the graph can now handle that case. + + Closes: https://github.com/strace/strace/pull/7 + +2017-03-16 Dmitry V. Levin + + tests: use TAIL_ALLOC_OBJECT_CONST_PTR. + Automatically convert tests to use TAIL_ALLOC_OBJECT_CONST_PTR macro + with the following sed expression: + + sed -ri \ + 's/^([[:space:]]*)(([^*]+[[:alnum:]_])( \*)?) *\*( *const )?([^ =]+) = tail_alloc\(sizeof\((\2|\*\6)\)\);/\1TAIL_ALLOC_OBJECT_CONST_PTR(\2, \6);/' \ + tests/*.c + +2017-03-16 Dmitry V. Levin + + tests: use TAIL_ALLOC_OBJECT_VAR_PTR. + Automatically convert tests to use TAIL_ALLOC_OBJECT_VAR_PTR macro + with the following sed expression: + + sed -ri \ + 's/^([[:space:]]*)(([^*]+[[:alnum:]_])( \*)?) *\*([^ =]+) = tail_alloc\(sizeof\((\2|\*\5)\)\);/\1TAIL_ALLOC_OBJECT_VAR_PTR(\2, \5);/' \ + tests/{move_pages,net-sockaddr,sendfile}.c + +2017-03-16 Dmitry V. Levin + + tests: add TAIL_ALLOC_OBJECT_{CONST,VAR}_PTR to tests.h. + Introduce a new macros for the most widespread use of tail_alloc. + + * tests/tests.h (TAIL_ALLOC_OBJECT_CONST_PTR, + TAIL_ALLOC_OBJECT_VAR_PTR): New macros. + +2017-03-16 Victor Krapivensky + + Decode RUSAGE_THREAD. + * xlat/usagewho.in: Add values for existing entities, add + RUSAGE_THREAD. + * tests/getrusage.c: Test decoding of RUSAGE_THREAD. + +2017-03-15 Eugene Syromyatnikov + + tests/sched.test: use heredoc in order to avoid spawning of subprocess. + Pipelined commands executed in subprocesses (some shells have special + provision for last command in the pipeline, but it is not guaranteed + and not POSIX), so exit codes of these subprocesses can be lost. + In order to avoid creating subprocesses, input for read commands + is better to supply via heredoc and not pipe. + + * tests/sched.test: Move test cases to heredoc. + +2017-03-15 Dmitry V. Levin + + tests: do not skip sched.test if one of its subtests skips. + * tests/sched.test (try_run_prog): New function. + Use it instead of run_prog. + +2017-03-15 Dmitry V. Levin + + tests: do not check decoding of setitimer syscall outside xetitimer.test + xetitimer.test already implements a comprehensive test of setitimer + syscall parser, no need to duplicate its parts in other tests. + + * tests/clock_nanosleep.c (main): Remove setitimer expected output. + * tests/nanosleep.c (main): Likewise. + * tests/clock_nanosleep.test: Remove setitimer from the trace set. + * tests/nanosleep.test: Likewise. + +2017-03-14 Dmitry V. Levin + + tests: check decoding of getitimer and setitimer corner cases. + * tests/sched_xetattr.c: Include and . + (main): Check that pointer and integer arguments of getitimer + and setitimer syscalls are decoded properly. + * tests/xetitimer.test: Add -a option. + +2017-03-13 Dmitry V. Levin + + tests: rewrite sigreturn syscall decoding check from match_grep to match_diff + Unlike the former test that was based on match_grep, + the new one uses match_diff and does more rigorous testing. + + * tests/sigreturn.c: Rewrite. + * tests/sigreturn.test: Likewise. + +2017-03-13 Dmitry V. Levin + + ia64, mips, x86_64: remove no longer used parsers of sigreturn syscalls. + As there is no sigreturn syscall on ia64, mips n32, mips n64, x32, + and x86_64, no longer used parsers could be safely removed. + + * linux/ia64/arch_sigreturn.c: Remove. + * Makefile.am (EXTRA_DIST): Remove it. + * linux/mips/arch_sigreturn.c (arch_sigreturn): Remove [!LINUX_MIPSO32]. + * linux/x86_64/arch_sigreturn.c (arch_sigreturn): Remove. + +2017-03-13 Dmitry V. Levin + + Move sigreturn parser to libstrace. + All architectures have rt_sigreturn, but only old ones also have + sigreturn. Since not all architectures need a parser of sigreturn + syscall, remove the warning and move the parser to libstrace. + + * Makefile.am (strace_SOURCES): Move sigreturn.c ... + (libstrace_a_SOURCES): ... here. + * linux/arch_sigreturn.c: Remove warning. + +2017-03-13 Dmitry V. Levin + + tests: check decoding of rt_sigreturn syscall. + * tests/rt_sigreturn.c: New file. + * tests/rt_sigreturn.test: New test. + * tests/.gitignore: Add rt_sigreturn. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add rt_sigreturn.test. + + Implement proper decoding of rt_sigreturn syscall. + * rt_sigreturn.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * linux/dummy.h (sys_rt_sigreturn): Remove. + * linux/64/syscallent.h (rt_sigreturn): Change sys_func to rt_sigreturn. + * linux/hppa/syscallent.h (rt_sigreturn): Likewise. + * linux/ia64/syscallent.h (rt_sigreturn): Likewise. + * linux/s390/syscallent.h (rt_sigreturn): Likewise. + * linux/s390x/syscallent.h (rt_sigreturn): Likewise. + * linux/x86_64/syscallent.h (rt_sigreturn): Likewise. + * linux/x32/syscallent.h (rt_sigreturn, 64:rt_sigreturn): Likewise. + * NEWS: Mention this change. + +2017-03-13 Dmitry V. Levin + + Introduce get_rt_sigframe_addr function. + Add get_rt_sigframe_addr function for all supported architectures. + It is going to be used in a parser of rt_sigreturn syscall. + + * defs.h (get_rt_sigframe_addr): New function prototype. + * rt_sigframe.c: New file. + * Makefile.am (strace_SOURCES): Add it. + * linux/aarch64/arch_rt_sigframe.c: New file. + * linux/alpha/arch_rt_sigframe.c: Likewise. + * linux/arc/arch_rt_sigframe.c: Likewise. + * linux/arm/arch_rt_sigframe.c: Likewise. + * linux/avr32/arch_rt_sigframe.c: Likewise. + * linux/bfin/arch_rt_sigframe.c: Likewise. + * linux/crisv10/arch_rt_sigframe.c: Likewise. + * linux/crisv32/arch_rt_sigframe.c: Likewise. + * linux/hppa/arch_rt_sigframe.c: Likewise. + * linux/i386/arch_rt_sigframe.c: Likewise. + * linux/ia64/arch_rt_sigframe.c: Likewise. + * linux/m68k/arch_rt_sigframe.c: Likewise. + * linux/metag/arch_rt_sigframe.c: Likewise. + * linux/microblaze/arch_rt_sigframe.c: Likewise. + * linux/mips/arch_rt_sigframe.c: Likewise. + * linux/nios2/arch_rt_sigframe.c: Likewise. + * linux/or1k/arch_rt_sigframe.c: Likewise. + * linux/powerpc/arch_rt_sigframe.c: Likewise. + * linux/powerpc64/arch_rt_sigframe.c: Likewise. + * linux/riscv/arch_rt_sigframe.c: Likewise. + * linux/s390/arch_rt_sigframe.c: Likewise. + * linux/s390x/arch_rt_sigframe.c: Likewise. + * linux/sh/arch_rt_sigframe.c: Likewise. + * linux/sh64/arch_rt_sigframe.c: Likewise. + * linux/sparc/arch_rt_sigframe.c: Likewise. + * linux/sparc64/arch_rt_sigframe.c: Likewise. + * linux/tile/arch_rt_sigframe.c: Likewise. + * linux/x32/arch_rt_sigframe.c: Likewise. + * linux/x86_64/arch_rt_sigframe.c: Likewise. + * linux/xtensa/arch_rt_sigframe.c: Likewise. + * Makefile.am (EXTRA_DIST): Add them. + +2017-03-13 Dmitry V. Levin + + Introduce struct_rt_sigframe type. + Add rt_sigframe.h files with definitions of struct_rt_sigframe type + for all supported architectures. + These definitions are going to be used in a parser of rt_sigreturn + syscall. + + * linux/rt_sigframe.h: New file. + * linux/bfin/rt_sigframe.h: Likewise. + * linux/crisv10/rt_sigframe.h: Likewise. + * linux/crisv32/rt_sigframe.h: Likewise. + * linux/hppa/rt_sigframe.h: Likewise. + * linux/i386/rt_sigframe.h: Likewise. + * linux/ia64/rt_sigframe.h: Likewise. + * linux/m68k/rt_sigframe.h: Likewise. + * linux/mips/rt_sigframe.h: Likewise. + * linux/powerpc64/rt_sigframe.h: Likewise. + * linux/s390/rt_sigframe.h: Likewise. + * linux/s390x/rt_sigframe.h: Likewise. + * linux/sh64/rt_sigframe.h: Likewise. + * linux/sparc/rt_sigframe.h: Likewise. + * linux/sparc64/rt_sigframe.h: Likewise. + * linux/tile/rt_sigframe.h: Likewise. + * linux/x32/rt_sigframe.h: Likewise. + * linux/x86_64/rt_sigframe.h: Likewise. + * Makefile.am (EXTRA_DIST): Add them. + +2017-03-13 Victor Krapivensky + + unwind.c: fix a possible buffer overflow. + Linux does not prevent a user from creating a lot of nested directories + with length of the absolute path of the deepest one exceeding PATH_MAX, + then chdir'ing into it, creating a file there and mmap'ing it. Since the + length of the prefix preceding the pathname in /proc/[pid]/maps is not + necessary 80 (it's 73 on my machine), an overflow is possible. + + * unwind.c (build_mmap_cache): Fix a possible buffer overflow. + +2017-03-13 Victor Krapivensky + + util.c: remove a wrong comment. + 4924dbd6d750665cf383b20ab4fd67e48219ab91 modified the return type, but + not the comment. + +2017-03-10 Dmitry V. Levin + + riscv: export riscv_sp_ptr. + Export SP register for later use by get_rt_sigframe_addr. + + * linux/riscv/arch_regs.h: New file. + * Makefile.am (EXTRA_DIST): Add it. + * linux/riscv/arch_regs.c (riscv_sp_ptr): New variable. + +2017-03-10 Dmitry V. Levin + + or1k: export or1k_sp_ptr. + Export SP register for later use by get_rt_sigframe_addr. + + * linux/or1k/arch_regs.h: New file. + * Makefile.am (EXTRA_DIST): Add it. + * linux/or1k/arch_regs.c (or1k_sp_ptr): New variable. + +2017-03-10 Dmitry V. Levin + + nios2: export nios2_sp_ptr. + Export SP register for later use by get_rt_sigframe_addr. + + * linux/nios2/arch_regs.h: New file. + * Makefile.am (EXTRA_DIST): Add it. + * linux/nios2/arch_regs.c (nios2_sp_ptr): New variable. + +2017-03-10 Dmitry V. Levin + + metag: export metag_sp_ptr. + Export SP register for later use by get_rt_sigframe_addr. + + * linux/metag/arch_regs.h: New file. + * Makefile.am (EXTRA_DIST): Add it. + * linux/metag/arch_regs.c (metag_sp_ptr): New variable. + +2017-03-10 Dmitry V. Levin + + avr32: export avr32_sp_ptr. + Export SP register for later use by get_rt_sigframe_addr. + + * linux/avr32/arch_regs.h: New file. + * Makefile.am (EXTRA_DIST): Add it. + * linux/avr32/arch_regs.c (avr32_sp_ptr): New variable. + +2017-03-10 Dmitry V. Levin + + arc: export arc_sp_ptr. + Export SP register for later use by get_rt_sigframe_addr. + + * linux/arc/arch_regs.h: New file. + * Makefile.am (EXTRA_DIST): Add it. + * linux/arc/arch_regs.c (arc_sp_ptr): New variable. + +2017-03-09 Dmitry V. Levin + + Introduce print_sigset_addr function. + As the definition of NSIG_BYTES is based on NSIG defined in , + NSIG_BYTES cannot be used in files that use kernel sigset_t. + + Add another wrapper around print_sigset_addr_len_limit function that + takes one argument less than print_sigset_addr_len wrapper. This new + wrapper is going to be used in cases when the length argument is equal + to NSIG_BYTES. + + * defs.h (print_sigset_addr): New function prototype. + * signal.c (print_sigset_addr): New function. + * linux/alpha/arch_sigreturn.c (arch_sigreturn): Replace + print_sigset_addr_len with print_sigset_addr. + * linux/arm/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/crisv10/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/ia64/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/microblaze/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/mips/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/tile/arch_sigreturn.c (arch_sigreturn): Likewise. + * linux/x86_64/arch_sigreturn.c (arch_sigreturn): Likewise. + +2017-03-08 Dmitry V. Levin + + README.md: rework guidelines about sending bug reports. + +2017-03-08 Abhishek Tiwari + + Update information on how to build strace from git repository. + * INSTALL-git.md: Describe how to build strace from git repository. + * README.md: Add reference to INSTALL-git.md. + * README-hacking: Likewise. + +2017-03-05 Dmitry V. Levin + + README.md: fix references to in-tree files. + * README.md: Change references to COPYING and NEWS files from absolute + to relative. + +2017-03-05 Dmitry V. Levin + + INSTALL: regenerate from install.texi. + Regenerate INSTALL from install.texi using the following command: + makeinfo --plaintext install.texi > INSTALL + + * INSTALL: Regenerate from install.texi. + +2017-03-05 Dmitry V. Levin + + install.texi: remove irrelevant sections. + Remove "Multiple Architectures" and "Particular Systems" sections using + the following filter script: + + awk '/^@node (Multiple Architectures|Particular Systems)/{skip=1;next} + /^@node/{skip=0} {if(!skip)print}' + + * install.texi (Multiple Architectures, Particular Systems): Remove. + +2017-03-05 Dmitry V. Levin + + install.texi: import from GNU Autoconf. + install.texi from GNU Autoconf is the ultimate source of INSTALL file. + This edition of install.texi has been downloaded from + https://git.savannah.gnu.org/cgit/autoconf.git/plain/doc/install.texi?id=63f3c78cdb0ccc85751543e387ef2a7252d5f0a2 + + * install.texi: Import from GNU Autoconf. + +2017-03-05 Eugene Syromyatnikov + Md Haris Iqbal + + Implement -e trace=%sched option for tracing sched_* syscalls. + Based on the patch by Md Haris Iqbal + (https://sourceforge.net/p/strace/mailman/message/35111320/) + + linux/*/syscallent.h part is modified automatically by: + + git grep -Fl 'SEN(sched_' linux/ | xargs sed -i \ + 's/0\(,[[:space:]]*SEN(sched_\)/TSC\1/' + + * sysent.h (TRACE_SCHED): New definition. + * syscall.c: Alias TSC to TRACE_SCHED around syscallent.h inclusion. + * linux/32/syscallent.h: Add TSC flag for sched_* sycalls. + * linux/64/syscallent.h: Likewise. + * linux/alpha/syscallent.h: Likewise. + * linux/arm/syscallent.h: Likewise. + * linux/avr32/syscallent.h: Likewise. + * linux/bfin/syscallent.h: Likewise. + * linux/crisv10/syscallent.h: Likewise. + * linux/hppa/syscallent.h: Likewise. + * linux/i386/syscallent.h: Likewise. + * linux/ia64/syscallent.h: Likewise. + * linux/m68k/syscallent.h: Likewise. + * linux/microblaze/syscallent.h: Likewise. + * linux/mips/syscallent-n32.h: Likewise. + * linux/mips/syscallent-n64.h: Likewise. + * linux/mips/syscallent-o32.h: Likewise. + * linux/powerpc/syscallent.h: Likewise. + * linux/powerpc64/syscallent.h: Likewise. + * linux/s390/syscallent.h: Likewise. + * linux/s390x/syscallent.h: Likewise. + * linux/sh/syscallent.h: Likewise. + * linux/sh64/syscallent.h: Likewise. + * linux/sparc/syscallent.h: Likewise. + * linux/sparc64/syscallent.h: Likewise. + * linux/x32/syscallent.h: Likewise. + * linux/x86_64/syscallent.h: Likewise. + * linux/xtensa/syscallent.h: Likewise. + * qualify.c (lookup_class): Add TRACE_SCHED for "%sched". + * tests/ksysent.c: Define TSC to 0. + * tests/nsyscalls.c: Likewise. + * tests/sched.test: New test. + * tests/Makefile.am (DECODER_TESTS): Add sched.test. + * strace.1 (.SS Filtering): Add information about %sched syscall class. + * NEWS: Mention this change. + +2017-03-04 Eugene Syromyatnikov + + Add "%" prefix for syscall classes in qualify. + (as suggested in + https://www.mail-archive.com/strace-devel@lists.sourceforge.net/msg05147.html ) + + In order to move them to a different namespace than syscall names. This is + already a problem in case of ipc class which shadows ipc syscall. + + Old behaviour is retained in order to preserve backwards compatibility. + + * qualify.c (lookup_class) : Add %-prefixed class definitions. + * strace.1 (.SS Filtering): Add information regarding %-prefixed class + syntax, declare legacy class syntax deprecated. + * tests/net.test: Update to use %-prefixed syscall class name. + * tests/netlink_protocol.test: Likewise. + * tests/qual_fault-exit_group.test: Likewise. + * tests/qual_syscall.test: Likewise. + * tests/scm_rights-fd.test: Likewise. + * tests/sigreturn.test: Likewise. + * tests/uio.test: Likewise. + * NEWS: Mention this change. + +2017-02-28 Dmitry V. Levin + + tests: simplify print_time_t. + * tests/print_time.c (print_time_t): Treat localtime errors as fatal. + +2017-02-27 Dmitry V. Levin + + Update homepage URL. + * README: Change homepage URL to https://strace.io + * debian/control: Likewise. + * strace.spec.in: Likewise. + +2017-02-26 Dmitry V. Levin + + tests: transform print_time_t into print_time_t_nsec. + * tests/print_time.c (print_time_t): Rename to print_time_t_nsec, + take second argument and print it. + * tests/tests.h (print_time_t): Rename to print_time_t_nsec, + add second argument. + * tests/utime.c (main): Use print_time_t_nsec instead of print_time_t. + * tests/xstatx.c (print_stat): Likewise. Pass nanoseconds + to print_time_t_nsec instead of printing them. + + tests: use print_time_t in utime.test. + * tests/utime.c (print_tm): Remove. + (main): Use print_time_t instead of print_tm. + +2017-02-26 Dmitry V. Levin + + tests: move print_time function to libtests. + Rename print_time function to print_time_t and move it to libtests. + + * tests/print_time.c: New file. + * tests/Makefile.am (libtests_a_SOURCES): Add it. + * tests/tests.h (print_time_t): New prototype. + * tests/print_time.c (print_time): Remove. + (print_stat): Replace print_time with print_time_t. + +2017-02-26 Dmitry V. Levin + + tests: macroize printing of atime, mtime, and ctime fields in xstatx.c. + Introduce a macro for printing similar time related fields. + + * print_struct_stat.c (PRINT_ST_TIME): New macro. + (print_stat): Use it. + +2017-02-26 Dmitry V. Levin + + print_struct_stat.c: macroize printing of atime, mtime, and ctime fields + Introduce a macro for printing similar time related fields. + + * print_struct_stat.c (PRINT_ST_TIME): New macro. + (print_struct_stat): Use it. + +2017-02-25 Dmitry V. Levin + + x32: fix decoding of flags argument of preadv2 and pwritev2 syscalls. + x32 is the only linux architecture where preadv2 and pwritev2 syscalls + take 5 arguments instead of 6. + + * io.c (PREADV2_PWRITEV2_FLAGS_ARG_NO): New macro. + (SYS_FUNC(preadv2), SYS_FUNC(pwritev2)): Use it. + * linux/x32/syscallent.h (preadv2, pwritev2): Change nargs to 5. + * NEWS: Mention this fix. + * tests/preadv2-pwritev2.c (main): Fix invocation of preadv2 + and pwritev2 syscalls on x32. + +2017-02-21 Dmitry V. Levin + + tests: rewrite ppoll syscall decoding check from match_grep to match_diff + Unlike the former test that was based on match_grep, + the new one uses match_diff and does more rigorous testing. + + * tests/ppoll-v.c: New file. + * tests/ppoll-v.test: New test. + * tests/ppoll.c: Rewrite. + * tests/ppoll.test: Likewise. + * tests/ppoll.expected: Remove. + * tests/ppoll-v.expected: Remove. + * tests/.gitignore: Add ppoll-v. + * tests/Makefile.am (check_PROGRAMS): Likewise. + (DECODER_TESTS): Add ppoll-v.test. + (EXTRA_DIST): Remove ppoll.expected and ppoll-v.expected. + +2017-02-20 Dmitry V. Levin + + tests: move get_sigset_size function to libtests. + * tests/get_sigset_size.c: New file. + * tests/Makefile.am (libtests_a_SOURCES): Add it. + * tests/tests.h (get_sigset_size): New prototype. + * tests/ptrace.c: Do not check for __NR_rt_sigprocmask. + (main): Use get_sigset_size. + * tests/signalfd4.c: Do not check for __NR_rt_sigprocmask. + (get_sigset_size): Remove. + +2017-02-19 Dmitry V. Levin + + sched: enhance decoding of sched_setattr syscall. + Implement read/write semantics of struct sched_attr.size argument + of sched_setattr syscall. Do not print members of struct sched_attr + besides sched_attr.size when the specified structure size is less than + the minimal size allowed by the kernel. + + * sched.c (print_sched_attr): Fetch struct sched_attr.size and use it + as the structure size. Print struct sched_attr.size only when the + structure size is less than SCHED_ATTR_MIN_SIZE. + (SYS_FUNC(sched_setattr)): Call print_sched_attr with zero size + argument. Print struct sched_attr.size returned by the kernel + on exiting syscall in case of E2BIG. Print the last syscall argument + on exiting syscall. + (SYS_FUNC(sched_getattr)): Do not call print_sched_attr with zero size + argument. + * NEWS: Mention it. + * tests/sched_xetattr.c (main): Check it. + +2017-02-18 Dmitry V. Levin + + tests: check decoding of sched_[gs]etattr corner cases. + * tests/sched_xetattr.c (main): Check that integer arguments + of sched_getattr and sched_setattr syscalls are decoded properly + by adding a few cases with filled higher 32 bits. + Check that pointer argument is decoded properly + on F8ILL_KULONG_SUPPORTED architectures. + +2017-02-18 Dmitry V. Levin + + Move definition of struct sched_attr to a separate header file. + Avoid multiple defintions of struct sched_attr by creating a separate + header file with its definition and using it in other places. + + * sched_attr.h: New file. + * Makefile.am (strace_SOURCES): Add it. + * sched.c: Include it. + (print_sched_attr): Use it. + * tests/sched_xetattr.c: Include it. + (main): Use it. + +2017-02-18 Dmitry V. Levin + + tests: rewrite sched_xetattr.test from match_grep to match_diff. + Unlike the previous edition of the test that was based on match_grep, + the new one is match_diff based and does more rigorous testing. + + * tests/adjtimex.c: Include "xlat.h" and "xlat/schedulers.h", + (sys_sched_getattr, sys_sched_setattr): New functions. + (main): Use them. Update expected output. + * tests/adjtimex.test: Use run_strace_match_diff. + +2017-02-17 Dmitry V. Levin + + Use tprints instead of tprintf in a few more places. + * bpf.c (bpf_obj_manage, bpf_prog_attach_detach): Replace tprintf + with tprints for printing strings without format specifiers. + * dm.c (dm_decode_dm_target_spec): Likewise. + * mq.c (SYS_FUNC(mq_timedreceive)): Likewise. + * perf.c (print_perf_event_attr): Likewise. + * syscall.c (trace_syscall_exiting): Likewise. + +2017-02-17 Dmitry V. Levin + + bpf: update BPF_PROG_ATTACH decoding. + Implement decoding of BPF_F_ALLOW_OVERRIDE flag of BPF_PROG_ATTACH + command introduced by linux kernel commit v4.10-rc7-174-g7f67763. + + * configure.ac: Check for union bpf_attr.attach_flags + instead of union bpf_attr.attach_type. + * xlat/bpf_attach_flags.in: New file. + * bpf.c: Include "xlat/bpf_attach_flags.h". + (bpf_prog_attach_detach): Rename print_attach_bpf_fd argument + to print_attach. Add attach_flags field to the structure, + print it in case of BPF_PROG_ATTACH. + * tests/bpf.c: Check for HAVE_UNION_BPF_ATTR_ATTACH_FLAGS + instead of HAVE_UNION_BPF_ATTR_ATTACH_TYPE. + (prog_cgroup): Initialize attach_flags field. + (main): Update expected output. + +2017-02-16 Dmitry V. Levin + + tests: rewrite adjtimex.test from match_grep to match_diff. + Unlike the previous edition of the test that was based on match_grep, + the new one is match_diff based and does more rigorous testing. + + * tests/adjtimex.c: Include "xlat.h", "xlat/adjtimex_state.h", + and "xlat/adjtimex_status.h". + (main): Update expected output. + * tests/adjtimex.test: Use run_strace_match_diff. + +2017-02-16 Dmitry V. Levin + + tests: replace casts of 0xffffffff00000000ULL with F8ILL_KULONG_MASK. + * tests/init_delete_module.h (bogus_zero): Remove. + * tests/delete_module.c (main): Replace bogus_zero and + (kernel_ulong_t) 0xffffffff00000000ULL with F8ILL_KULONG_MASK. + * tests/finit_module.c (main): Replace bogus_zero + with F8ILL_KULONG_MASK. + * tests/init_module.c (main): Likewise. + * tests/pipe2.c (main): Likewise. + * tests/epoll_ctl.c (invoke_syscall): Replace + (unsigned long) 0xffffffff00000000ULL with F8ILL_KULONG_MASK. + * tests/rt_tgsigqueueinfo.c (k_tgsigqueueinfo): Likewise. + * tests/fanotify_init.c (main): Likewise. + * tests/xetpgid.c (main): Likewise. + * tests/xetpriority.c (main): Likewise. + (kernel_ulong_t) 0xffffffff00000000ULL with F8ILL_KULONG_MASK. + * tests/fanotify_mark.c (main): Likewise. + * tests/file_handle.c (main): Likewise. + * tests/kexec_load.c (main): Likewise. + * tests/setfsugid.c (main): Likewise. + * tests/getgroups.c (main): Replace (long) 0xffffffff00000000ULL + with F8ILL_KULONG_MASK. + * tests/setgroups.c (main): Replace (long) 0xffffffff00000000ULL + and (unsigned long) 0xffffffff00000000ULL with F8ILL_KULONG_MASK. + +2017-02-16 Dmitry V. Levin + + tests: fill higher bits of integer arguments of fcntl* syscalls. + Check that integer arguments of fcntl and fcntl64 syscalls are decoded + properly by casting them to kernel_ulong_t and filling higher bits. + + * tests/struct_flock.c (invoke_test_syscall): Cast "fd" and "cmd" + syscall arguments to kernel_ulong_t, fill their higher 32 bits. + +2017-02-16 Dmitry V. Levin + + tests: use sprintrc in tests of fcntl and fcntl64 syscalls. + * tests/struct_flock.c (EINVAL_STR): Remove. + (test_flock_einval, test_flock): Use sprintrc instead of EINVAL_STR. + * tests/fcntl.c (test_flock64_einval): Likewise. + * tests/fcntl64.c (test_flock64_einval, test_flock64): Likewise. + +2017-02-15 Dmitry V. Levin + + Post-release administrivia. + * NEWS: Add a header line for the next release. + * debian/changelog.in: Add a changelog entry for 4.16-1. + * strace.spec.in: Likewise. + 2017-02-14 Dmitry V. Levin Prepare for 4.16 release. diff --git a/INSTALL b/INSTALL index 0fad6410..0d22512b 100644 --- a/INSTALL +++ b/INSTALL @@ -1,302 +1,134 @@ -Installation Instructions -************************* - -Copyright (C) 1994-1996, 1999-2002, 2004-2012 Free Software Foundation, -Inc. - -Copying and distribution of this file, with or without modification, are -permitted in any medium without royalty provided the copyright notice -and this notice are preserved. This file is offered as-is, without -warranty of any kind. - -Basic Installation -================== - -Briefly, the shell commands `./configure; make; make install' should -configure, build, and install this package. The following -more-detailed instructions are generic; see the `README' file for -instructions specific to this package. Some packages provide this -`INSTALL' file but do not implement all of the features documented -below. The lack of an optional feature in a given package is not -necessarily a bug. More recommendations for GNU packages can be found -in *note Makefile Conventions: (standards)Makefile Conventions. - - The `configure' shell script attempts to guess correct values for -various system-dependent variables used during compilation. It uses -those values to create a `Makefile' in each directory of the package. -It may also create one or more `.h' files containing system-dependent -definitions. Finally, it creates a shell script `config.status' that -you can run in the future to recreate the current configuration, and a -file `config.log' containing compiler output (useful mainly for -debugging `configure'). - - It can also use an optional file (typically called `config.cache' -and enabled with `--cache-file=config.cache' or simply `-C') that saves -the results of its tests to speed up reconfiguring. Caching is -disabled by default to prevent problems with accidental use of stale -cache files. - - If you need to do unusual things to compile the package, please try -to figure out how `configure' could check whether to do them, and mail -diffs or instructions to the address given in the `README' so they can -be considered for the next release. If you are using the cache, and at -some point `config.cache' contains results you don't want to keep, you -may remove or edit it. - - The file `configure.ac' (or `configure.in') is used to create -`configure' by a program called `autoconf'. You need `configure.ac' if -you want to change it or regenerate `configure' using a newer version -of `autoconf'. - -The simplest way to compile this package is: - - 1. `cd' to the directory containing the package's source code and type - `./configure' to configure the package for your system. - - Running `configure' might take a while. While running, it prints - some messages telling which features it is checking for. - - 2. Type `make' to compile the package. - - 3. Optionally, type `make check' to run any self-tests that come with - the package, generally using the just-built uninstalled binaries. - - 4. Type `make install' to install the programs and any data files and - documentation. When installing into a prefix owned by root, it is - recommended that the package be configured and built as a regular - user, and only the `make install' phase executed with root - privileges. - - 5. Optionally, type `make installcheck' to repeat any self-tests, but - this time using the binaries in their final installed location. - This target does not install anything. Running this target as a - regular user, particularly if the prior `make install' required - root privileges, verifies that the installation completed - correctly. - - 6. You can remove the program binaries and object files from the - source code directory by typing `make clean'. To also remove the - files that `configure' created (so you can compile the package for - a different kind of computer), type `make distclean'. There is - also a `make maintainer-clean' target, but that is intended mainly - for the package's developers. If you use it, you may have to get - all sorts of other programs in order to regenerate files that came - with the distribution. - - 7. Often, you can also type `make uninstall' to remove the installed - files again. In practice, not all packages have tested that - uninstallation works correctly, even though it is required by the - GNU Coding Standards. - - 8. Some packages, particularly those that use Automake, provide `make - distcheck', which can by used by developers to test that all other - targets like `make install' and `make uninstall' work correctly. - This target is generally not run by end users. - -Compilers and Options -===================== - -Some systems require unusual options for compilation or linking that the -`configure' script does not know about. Run `./configure --help' for -details on some of the pertinent environment variables. - - You can give `configure' initial values for configuration parameters -by setting variables in the command line or in the environment. Here -is an example: - - ./configure CC=c99 CFLAGS=-g LIBS=-lposix - - *Note Defining Variables::, for more details. - -Installation Names -================== - -By default, `make install' installs the package's commands under -`/usr/local/bin', include files under `/usr/local/include', etc. You -can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX', where PREFIX must be an -absolute file name. - - You can specify separate installation prefixes for -architecture-specific files and architecture-independent files. If you -pass the option `--exec-prefix=PREFIX' to `configure', the package uses -PREFIX as the prefix for installing programs and libraries. -Documentation and other data files still use the regular prefix. - - In addition, if you use an unusual directory layout you can give -options like `--bindir=DIR' to specify different values for particular -kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. In general, the -default for these options is expressed in terms of `${prefix}', so that -specifying just `--prefix' will affect all of the other directory -specifications that were not explicitly provided. - - The most portable way to affect installation locations is to pass the -correct locations to `configure'; however, many packages provide one or -both of the following shortcuts of passing variable assignments to the -`make install' command line to change installation locations without -having to reconfigure or recompile. - - The first method involves providing an override variable for each -affected directory. For example, `make install -prefix=/alternate/directory' will choose an alternate location for all -directory configuration variables that were expressed in terms of -`${prefix}'. Any directories that were specified during `configure', -but not in terms of `${prefix}', must each be overridden at install -time for the entire installation to be relocated. The approach of -makefile variable overrides for each directory variable is required by -the GNU Coding Standards, and ideally causes no recompilation. -However, some platforms have known limitations with the semantics of -shared libraries that end up requiring recompilation when using this -method, particularly noticeable in packages that use GNU Libtool. - - The second method involves providing the `DESTDIR' variable. For -example, `make install DESTDIR=/alternate/directory' will prepend -`/alternate/directory' before all installation names. The approach of -`DESTDIR' overrides is not required by the GNU Coding Standards, and -does not work on platforms that have drive letters. On the other hand, -it does better at avoiding recompilation issues, and works well even -when some directory options were not specified in terms of `${prefix}' -at `configure' time. - -Optional Features -================= - -If the package supports it, you can cause programs to be installed with -an extra prefix or suffix on their names by giving `configure' the -option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. - - Some packages pay attention to `--enable-FEATURE' options to -`configure', where FEATURE indicates an optional part of the package. -They may also pay attention to `--with-PACKAGE' options, where PACKAGE -is something like `gnu-as' or `x' (for the X Window System). The -`README' should mention any `--enable-' and `--with-' options that the -package recognizes. - - For packages that use the X Window System, `configure' can usually -find the X include and library files automatically, but if it doesn't, -you can use the `configure' options `--x-includes=DIR' and -`--x-libraries=DIR' to specify their locations. - - Some packages offer the ability to configure how verbose the -execution of `make' will be. For these packages, running `./configure ---enable-silent-rules' sets the default to minimal output, which can be -overridden with `make V=1'; while running `./configure ---disable-silent-rules' sets the default to verbose, which can be -overridden with `make V=0'. - -Specifying the System Type -========================== - -There may be some features `configure' cannot figure out automatically, -but needs to determine by the type of machine the package will run on. -Usually, assuming the package is built to be run on the _same_ -architectures, `configure' can figure that out, but if it prints a -message saying it cannot guess the machine type, give it the -`--build=TYPE' option. TYPE can either be a short name for the system -type, such as `sun4', or a canonical name which has the form: - - CPU-COMPANY-SYSTEM - -where SYSTEM can have one of these forms: - - OS - KERNEL-OS - -See the file `config.sub' for the possible values of each field. If -`config.sub' isn't included in this package, then this package doesn't -need to know the machine type. - - If you are _building_ compiler tools for cross-compiling, you should -use the option `--target=TYPE' to select the type of system they will -produce code for. - - If you want to _use_ a cross compiler, that generates code for a -platform different from the build platform, you should specify the -"host" platform (i.e., that on which the generated programs will -eventually be run) with `--host=TYPE'. - -Sharing Defaults -================ - -If you want to set default values for `configure' scripts to share, you -can create a site shell script called `config.site' that gives default -values for variables like `CC', `cache_file', and `prefix'. -`configure' looks for `PREFIX/share/config.site' if it exists, then -`PREFIX/etc/config.site' if it exists. Or, you can set the -`CONFIG_SITE' environment variable to the location of the site script. -A warning: not all `configure' scripts look for a site script. - -Defining Variables -================== - -Variables not defined in a site shell script can be set in the -environment passed to `configure'. However, some packages may run -configure again during the build, and the customized values of these -variables may be lost. In order to avoid this problem, you should set -them in the `configure' command line, using `VAR=value'. For example: - - ./configure CC=/usr/local2/bin/gcc - -causes the specified `gcc' to be used as the C compiler (unless it is -overridden in the site shell script). - -Unfortunately, this technique does not work for `CONFIG_SHELL' due to -an Autoconf limitation. Until the limitation is lifted, you can use -this workaround: - - CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash - -`configure' Invocation -====================== - -`configure' recognizes the following options to control how it operates. - -`--help' -`-h' - Print a summary of all of the options to `configure', and exit. - -`--help=short' -`--help=recursive' - Print a summary of the options unique to this package's - `configure', and exit. The `short' variant lists options used - only in the top level, while the `recursive' variant lists options - also present in any nested packages. - -`--version' -`-V' - Print the version of Autoconf used to generate the `configure' - script, and exit. - -`--cache-file=FILE' - Enable the cache: use and save the results of the tests in FILE, - traditionally `config.cache'. FILE defaults to `/dev/null' to - disable caching. - -`--config-cache' -`-C' - Alias for `--cache-file=config.cache'. - -`--quiet' -`--silent' -`-q' - Do not print messages saying which checks are being made. To - suppress all normal output, redirect it to `/dev/null' (any error - messages will still be shown). - -`--srcdir=DIR' - Look for the package's source code in directory DIR. Usually - `configure' can determine that directory automatically. - -`--prefix=DIR' - Use DIR as the installation prefix. *note Installation Names:: - for more details, including other options available for fine-tuning - the installation locations. - -`--no-create' -`-n' - Run the configure checks, but stop before creating any output - files. +0. BUILD REQUIREMENTS + + - Sane POSIX shell. + - gcc-like compiler that supports C99 and some GNU extensions (namely, empty + structures, empty definitions, zero length arrays, ranged designated + initialisers). + - libc. GNU libc and musl are supported. + - Linux UAPI headers. + - GNU Make. + - GNU coreutils. + - For running test suite: gawk, grep, sed, runtime environment for all + personalities. + - Requirements for optional features are documented in their description. -`configure' also accepts some other, not widely useful, options. Run -`configure --help' for more details. +1. CONFIGURATION AND OPTIONAL FEATURES + +Configuration is done using GNU Autoconf-generated configure script. +Please refer to the README-configure file for generic information regarding +configure usage. + +In addition to standard configure options, strace's configure file provides +the following options: + +1.1. Additional build and testing hardening + + --enable-gcc-Werror turn on gcc's -Werror option + --enable-code-coverage Whether to enable code coverage support + --with-gcov=GCOV use given GCOV for coverage (GCOV=gcov). + --enable-valgrind Whether to enable Valgrind on the unit tests + --disable-valgrind-memcheck + Whether to skip memcheck during the Valgrind tests + --disable-valgrind-helgrind + Whether to skip helgrind during the Valgrind tests + --disable-valgrind-drd Whether to skip drd during the Valgrind tests + --enable-valgrind-sgcheck + Whether to use sgcheck during the Valgrind tests + +1.2. Optional features + +1.2.1. Multiple personalities support + + --enable-mpers=yes|no|check|m32|mx32 + whether to enable multiple personalities support + required for proper decoding of structures used by + tracees with personalities that differ from the + personality of strace, default is yes. + +Personality is a way system call is performed (in terms of ABI). For example, +Linux kernel on multiple 64-bit architectures that evolve from their 32-bit +counterparts have support for running 32-bit binaries with 32-bit system call +ABI, and that system call ABI constitutes a separate personality in strace's +terms. Another example is 32-on-64 bit ABI; while exploiting the same way for +performing system calls as native 64-bit system calls, this ABI has different +type sizes and, as a result, also constitutes a separate personality; the only +such ABI that is currently supported by strace is x32 on x86_64. This is +important as different ABIs use different alignments and type sizes, as a +result, fields in structures in unions have different offsets on different +ABIs. In order to be able to correctly parse all the structures used in various +system calls and ioctl commands, strace compiles these structure definitions +for these different ABI and then parses DWARF of these compiled definitions in +order to generate proper structure definitions that compiled with decoder code. +Taking the aforementioned into account, there are the following requirements: + + - gawk (at least version 3) + - Ability to compile for m32 personality (on architectures where it is supported) + - On x86_64, x32, powerpc64, sparc64, riscv64, tile64: gcc -m32 + - s390x: gcc -m31 + - AArch64: a separate compiler for armv7 EABI + - See information about configuration in "1.3.2. AArch64: AArch32 support" + - Ability to compile for mx32 personality (on architectures where it is supported) + - On x86_64: gcc -mx32 + - For tests: runtime support (linker, libc, and loader) + +1.2.2. Stack unwinding (-k option) + + --with-libunwind use libunwind to implement stack tracing support + --with-libiberty use libiberty to demangle symbols in stack trace + +1.3. Architecture-specific features + +1.3.1. ARMv7: OABI support + + --enable-arm-oabi enable OABI support on ARM EABI + +1.3.2. AArch64: AArch32 support + + CC_FOR_M32 + CPP_FOR_M32 + CFLAGS_FOR_M32 + CPPFLAGS_FOR_M32 + +1.4. Miscellanea + +1.4.1. Static build configuration + +For static linking, provide LDFLAGS='-static -pthread'. + +1.4.2. Cross-compilation configuration + +2. BUILDING + +make +make V=1 + +3. TESTING + +make check + +TESTS='list of tests' +VALGRIND_FLAGS +TIMEOUT_DURATION + +BTRFS_MOUNTPOINT + +4. ADDITIONAL TARGETS + + make code-coverage-capture + make code-coverage-capture CODE_COVERAGE_BRANCH_COVERAGE= + +5. INSTALLATION + +make install + +6. PACKAGING + +6.1. Distribution tarball + +./make-dist + +Requires git + +6.2. dpkg package + +6.3. RPM package diff --git a/LGPL-2.1-or-later b/LGPL-2.1-or-later new file mode 100644 index 00000000..dfb1e918 --- /dev/null +++ b/LGPL-2.1-or-later @@ -0,0 +1,501 @@ +GNU LESSER GENERAL PUBLIC LICENSE + +Version 2.1, February 1999 + +Copyright (C) 1991, 1999 Free Software Foundation, Inc. + +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts +as the successor of the GNU Library Public License, version 2, hence +the version number 2.1.] + +Preamble + +The licenses for most software are designed to take away your freedom +to share and change it. By contrast, the GNU General Public Licenses are +intended to guarantee your freedom to share and change free software--to +make sure the software is free for all its users. + +This license, the Lesser General Public License, applies to some specially +designated software packages--typically libraries--of the Free Software +Foundation and other authors who decide to use it. You can use it too, +but we suggest you first think carefully about whether this license or +the ordinary General Public License is the better strategy to use in +any particular case, based on the explanations below. + +When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get it +if you want it; that you can change the software and use pieces of it in +new free programs; and that you are informed that you can do these things. + +To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + +For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide complete +object files to the recipients, so that they can relink them with the +library after making changes to the library and recompiling it. And you +must show them these terms so they know their rights. + +We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + +To protect each distributor, we want to make it very clear that there +is no warranty for the free library. Also, if the library is modified +by someone else and passed on, the recipients should know that what they +have is not the original version, so that the original author's reputation +will not be affected by problems that might be introduced by others. + +Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot effectively +restrict the users of a free program by obtaining a restrictive license +from a patent holder. Therefore, we insist that any patent license +obtained for a version of the library must be consistent with the full +freedom of use specified in this license. + +Most GNU software, including some libraries, is covered by the ordinary +GNU General Public License. This license, the GNU Lesser General +Public License, applies to certain designated libraries, and is quite +different from the ordinary General Public License. We use this license +for certain libraries in order to permit linking those libraries into +non-free programs. + +When a program is linked with a library, whether statically or using a +shared library, the combination of the two is legally speaking a combined +work, a derivative of the original library. The ordinary General Public +License therefore permits such linking only if the entire combination +fits its criteria of freedom. The Lesser General Public License permits +more lax criteria for linking other code with the library. + +We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + +For example, on rare occasions, there may be a special need to encourage +the widest possible use of a certain library, so that it becomes a +de-facto standard. To achieve this, non-free programs must be allowed +to use the library. A more frequent case is that a free library does +the same job as widely used non-free libraries. In this case, there +is little to gain by limiting the free library to free software only, +so we use the Lesser General Public License. + +In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of free +software. For example, permission to use the GNU C Library in non-free +programs enables many more people to use the whole GNU operating system, +as well as its variant, the GNU/Linux operating system. + +Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is linked +with the Library has the freedom and the wherewithal to run that program +using a modified version of the Library. + +The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other + program which contains a notice placed by the copyright holder or + other authorized party saying it may be distributed under the terms of + this Lesser General Public License (also called "this License"). Each + licensee is addressed as "you". + + A "library" means a collection of software functions and/or data + prepared so as to be conveniently linked with application programs + (which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work + which has been distributed under these terms. A "work based on + the Library" means either the Library or any derivative work under + copyright law: that is to say, a work containing the Library or a + portion of it, either verbatim or with modifications and/or translated + straightforwardly into another language. (Hereinafter, translation + is included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for + making modifications to it. For a library, complete source code + means all the source code for all modules it contains, plus any + associated interface definition files, plus the scripts used to + control compilation and installation of the library. + + Activities other than copying, distribution and modification are not + covered by this License; they are outside its scope. The act of running + a program using the Library is not restricted, and output from such + a program is covered only if its contents constitute a work based + on the Library (independent of the use of the Library in a tool for + writing it). Whether that is true depends on what the Library does + and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's + complete source code as you receive it, in any medium, provided + that you conspicuously and appropriately publish on each copy an + appropriate copyright notice and disclaimer of warranty; keep intact + all the notices that refer to this License and to the absence of any + warranty; and distribute a copy of this License along with the Library. + + You may charge a fee for the physical act of transferring a copy, and + you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Library or any portion of + it, thus forming a work based on the Library, and copy and distribute + such modifications or work under the terms of Section 1 above, + provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no charge + to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or table, + the facility still operates, and performs whatever part of its + purpose remains meaningful. + + (For example, a function in a library to compute square roots + has a purpose that is entirely well-defined independent of + the application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square root + function must still compute square roots.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the Library, + and can be reasonably considered independent and separate works in + themselves, then this License, and its terms, do not apply to those + sections when you distribute them as separate works. But when you + distribute the same sections as part of a whole which is a work + based on the Library, the distribution of the whole must be on the + terms of this License, whose permissions for other licensees extend + to the entire whole, and thus to each and every part regardless of + who wrote it. + + Thus, it is not the intent of this section to claim rights or contest + your rights to work written entirely by you; rather, the intent is + to exercise the right to control the distribution of derivative or + collective works based on the Library. + + In addition, mere aggregation of another work not based on the Library + with the Library (or with a work based on the Library) on a volume + of a storage or distribution medium does not bring the other work + under the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public + License instead of this License to a given copy of the Library. To + do this, you must alter all the notices that refer to this License, + so that they refer to the ordinary GNU General Public License, + version 2, instead of to this License. (If a newer version than + version 2 of the ordinary GNU General Public License has appeared, + then you can specify that version instead if you wish.) Do not make + any other change in these notices. + + Once this change is made in a given copy, it is irreversible for + that copy, so the ordinary GNU General Public License applies to all + subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of the + Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or derivative + of it, under Section 2) in object code or executable form under the + terms of Sections 1 and 2 above provided that you accompany it with + the complete corresponding machine-readable source code, which must + be distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange. + + If distribution of object code is made by offering access to copy from + a designated place, then offering equivalent access to copy the source + code from the same place satisfies the requirement to distribute the + source code, even though third parties are not compelled to copy the + source along with the object code. + + 5. A program that contains no derivative of any portion of the Library, + but is designed to work with the Library by being compiled or linked + with it, is called a "work that uses the Library". Such a work, in + isolation, is not a derivative work of the Library, and therefore + falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library + creates an executable that is a derivative of the Library (because it + contains portions of the Library), rather than a "work that uses the + library". The executable is therefore covered by this License. Section + 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header + file that is part of the Library, the object code for the work may + be a derivative work of the Library even though the source code is + not. Whether this is true is especially significant if the work can + be linked without the Library, or if the work is itself a library. The + threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data structure + layouts and accessors, and small macros and small inline functions + (ten lines or less in length), then the use of the object file + is unrestricted, regardless of whether it is legally a derivative + work. (Executables containing this object code plus portions of the + Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may + distribute the object code for the work under the terms of Section + 6. Any executables containing that work also fall under Section 6, + whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or link + a "work that uses the Library" with the Library to produce a work + containing portions of the Library, and distribute that work under + terms of your choice, provided that the terms permit modification + of the work for the customer's own use and reverse engineering for + debugging such modifications. + + You must give prominent notice with each copy of the work that the + Library is used in it and that the Library and its use are covered + by this License. You must supply a copy of this License. If the work + during execution displays copyright notices, you must include the + copyright notice for the Library among them, as well as a reference + directing the user to the copy of this License. Also, you must do + one of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and + (2) will operate properly with a modified version of the library, + if the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at least three + years, to give the same user the materials specified in Subsection + 6a, above, for a charge no more than the cost of performing this + distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the + Library" must include any data and utility programs needed for + reproducing the executable from it. However, as a special exception, + the materials to be distributed need not include anything that is + normally distributed (in either source or binary form) with the major + components (compiler, kernel, and so on) of the operating system on + which the executable runs, unless that component itself accompanies + the executable. + + It may happen that this requirement contradicts the license + restrictions of other proprietary libraries that do not normally + accompany the operating system. Such a contradiction means you + cannot use both them and the Library together in an executable that + you distribute. + + 7. You may place library facilities that are a work based on the + Library side-by-side in a single library together with other library + facilities not covered by this License, and distribute such a combined + library, provided that the separate distribution of the work based on + the Library and of the other library facilities is otherwise permitted, + and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities. This + must be distributed under the terms of the Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute the + Library except as expressly provided under this License. Any attempt + otherwise to copy, modify, sublicense, link with, or distribute the + Library is void, and will automatically terminate your rights under + this License. However, parties who have received copies, or rights, + from you under this License will not have their licenses terminated + so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify + or distribute the Library or its derivative works. These actions + are prohibited by law if you do not accept this License. Therefore, + by modifying or distributing the Library (or any work based on the + Library), you indicate your acceptance of this License to do so, and + all its terms and conditions for copying, distributing or modifying + the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on + the Library), the recipient automatically receives a license from + the original licensor to copy, distribute, link with or modify the + Library subject to these terms and conditions. You may not impose + any further restrictions on the recipients' exercise of the rights + granted herein. You are not responsible for enforcing compliance by + third parties with this License. + + 11. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent issues), + conditions are imposed on you (whether by court order, agreement + or otherwise) that contradict the conditions of this License, they + do not excuse you from the conditions of this License. If you cannot + distribute so as to satisfy simultaneously your obligations under this + License and any other pertinent obligations, then as a consequence + you may not distribute the Library at all. For example, if a patent + license would not permit royalty-free redistribution of the Library + by all those who receive copies directly or indirectly through you, + then the only way you could satisfy both it and this License would + be to refrain entirely from distribution of the Library. + + If any portion of this section is held invalid or unenforceable under + any particular circumstance, the balance of the section is intended + to apply, and the section as a whole is intended to apply in other + circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of + any such claims; this section has the sole purpose of protecting + the integrity of the free software distribution system which + is implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is willing + to distribute software through any other system and a licensee cannot + impose that choice. + + This section is intended to make thoroughly clear what is believed + to be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in + certain countries either by patents or by copyrighted interfaces, the + original copyright holder who places the Library under this License + may add an explicit geographical distribution limitation excluding + those countries, so that distribution is permitted only in or among + countries not thus excluded. In such case, this License incorporates + the limitation as if written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new + versions of the Lesser General Public License from time to time. Such + new versions will be similar in spirit to the present version, but + may differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the Library + specifies a version number of this License which applies to it and + "any later version", you have the option of following the terms and + conditions either of that version or of any later version published + by the Free Software Foundation. If the Library does not specify a + license version number, you may choose any version ever published by + the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free + programs whose distribution conditions are incompatible with these, + write to the author to ask for permission. For software which is + copyrighted by the Free Software Foundation, write to the Free Software + Foundation; we sometimes make exceptions for this. Our decision will + be guided by the two goals of preserving the free status of all + derivatives of our free software and of promoting the sharing and + reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO + WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE + LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS + AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF + ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE + LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME + THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO + IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY + MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE + TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR + CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE + THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING + RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR + A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN + IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF + SUCH DAMAGES. END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Libraries + +If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of +the ordinary General Public License). + +To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + +Copyright (C) + +This library is free software; you can redistribute it and/or modify it +under the terms of the GNU Lesser General Public License as published +by the Free Software Foundation; either version 2.1 of the License, or +(at your option) any later version. + +This library is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public +License for more details. + +You should have received a copy of the GNU Lesser General Public License +along with this library; if not, write to the Free Software Foundation, +Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or +your school, if any, to sign a "copyright disclaimer" for the library, +if necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in + +the library `Frob' (a library for tweaking knobs) written + +by James Random Hacker. + +< signature of Ty Coon > , 1 April 1990 + +Ty Coon, President of Vice + +That's all there is to it! diff --git a/Makefile.am b/Makefile.am index 9b00481d..a8ace321 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,29 +4,10 @@ # Copyright (c) 2006-2016 Dmitry V. Levin # Copyright (c) 2008-2015 Mike Frysinger # Copyright (c) 2015 Elvira Khabirova +# Copyright (c) 2002-2019 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: LGPL-2.1-or-later if HAVE_M32_RUNTIME TESTS_M32 = tests-m32 @@ -34,16 +15,18 @@ endif if HAVE_MX32_RUNTIME TESTS_MX32 = tests-mx32 endif -SUBDIRS = tests $(TESTS_M32) $(TESTS_MX32) +SUBDIRS = . tests $(TESTS_M32) $(TESTS_MX32) bin_PROGRAMS = strace -man_MANS = strace.1 +man_MANS = strace.1 strace-log-merge.1 bin_SCRIPTS = strace-graph strace-log-merge OS = linux # ARCH is `i386', `m68k', `sparc', etc. ARCH = @arch@ +READELF = @READELF@ + ACLOCAL_AMFLAGS = -I m4 AM_CFLAGS = $(WARN_CFLAGS) AM_CPPFLAGS = -I$(builddir)/$(OS)/$(ARCH) \ @@ -61,15 +44,20 @@ include xlat/Makemodule.am strace_CPPFLAGS = $(AM_CPPFLAGS) strace_CFLAGS = $(AM_CFLAGS) strace_LDFLAGS = -strace_LDADD = libstrace.a +strace_LDADD = libstrace.a $(clock_LIBS) $(timer_LIBS) noinst_LIBRARIES = libstrace.a libstrace_a_CPPFLAGS = $(strace_CPPFLAGS) libstrace_a_CFLAGS = $(strace_CFLAGS) libstrace_a_SOURCES = \ + fetch_indirect_syscall_args.c \ fstatfs.c \ fstatfs64.c \ + getpagesize.c \ ipc.c \ + mmap_cache.c \ + mmap_cache.h \ + sigreturn.c \ socketcall.c \ statfs.c \ statfs64.c \ @@ -84,9 +72,18 @@ strace_SOURCES = \ affinity.c \ aio.c \ alpha.c \ + arch_defs.h \ + basic_filters.c \ + bind.c \ bjm.c \ block.c \ bpf.c \ + bpf_attr.h \ + bpf_filter.c \ + bpf_filter.h \ + bpf_fprog.h \ + bpf_seccomp_filter.c \ + bpf_sock_filter.c \ btrfs.c \ cacheflush.c \ capability.c \ @@ -98,34 +95,47 @@ strace_SOURCES = \ copy_file_range.c \ count.c \ defs.h \ + delay.c \ + delay.h \ desc.c \ dirent.c \ dirent64.c \ dm.c \ + dyxlat.c \ empty.h \ epoll.c \ + error_prints.c \ + error_prints.h \ evdev.c \ + evdev_mpers.c \ eventfd.c \ execve.c \ + f_owner_ex.h \ fadvise.c \ fallocate.c \ fanotify.c \ fchownat.c \ fcntl.c \ - fetch_seccomp_fprog.c \ + fetch_bpf_fprog.c \ fetch_struct_flock.c \ + fetch_struct_keyctl_kdf_params.c \ fetch_struct_mmsghdr.c \ fetch_struct_msghdr.c \ fetch_struct_stat.c \ fetch_struct_stat64.c \ fetch_struct_statfs.c \ + fetch_struct_xfs_quotastat.c \ file_handle.c \ file_ioctl.c \ - fs_x_ioctl.c \ + filter.h \ + filter_qualify.c \ flock.c \ flock.h \ + fs_x_ioctl.c \ futex.c \ gcc_compat.h \ + get_personality.c \ + get_personality.h \ get_robust_list.c \ getcpu.c \ getcwd.c \ @@ -133,7 +143,9 @@ strace_SOURCES = \ hdio.c \ hostname.c \ inotify.c \ + inotify_ioctl.c \ io.c \ + io_uring.c \ ioctl.c \ ioperm.c \ iopl.c \ @@ -145,21 +157,33 @@ strace_SOURCES = \ ipc_shm.c \ ipc_shmctl.c \ kcmp.c \ + kernel_timespec.h \ + kernel_timeval.h \ + kernel_timex.h \ kernel_types.h \ kexec.c \ keyctl.c \ + keyctl_kdf_params.h \ + kill_save_errno.h \ + kvm.c \ + largefile_wrappers.h \ ldt.c \ link.c \ linux/asm_stat.h \ linux/x32/asm_stat.h \ linux/x86_64/asm_stat.h \ + list.h \ + listen.c \ lookup_dcookie.c \ loop.c \ lseek.c \ + macros.h \ mem.c \ membarrier.c \ memfd_create.c \ mknod.c \ + mmap_notify.c \ + mmap_notify.h \ mmsghdr.c \ mount.c \ mpers_type.h \ @@ -168,21 +192,52 @@ strace_SOURCES = \ msghdr.h \ mtd.c \ native_defs.h \ + nbd_ioctl.c \ + negated_errno.h \ net.c \ netlink.c \ + netlink.h \ + netlink_crypto.c \ + netlink_inet_diag.c \ + netlink_kobject_uevent.c \ + netlink_kobject_uevent.h \ + netlink_netfilter.c \ + netlink_netlink_diag.c \ + netlink_packet_diag.c \ + netlink_route.c \ + netlink_route.h \ + netlink_selinux.c \ + netlink_smc_diag.c \ + netlink_sock_diag.c \ + netlink_sock_diag.h \ + netlink_unix_diag.c \ + nlattr.c \ + nlattr.h \ + nsfs.c \ + nsfs.h \ nsig.h \ numa.c \ + number_set.c \ + number_set.h \ oldstat.c \ open.c \ or1k_atomic.c \ pathtrace.c \ perf.c \ perf_event_struct.h \ + perf_ioctl.c \ personality.c \ pkeys.c \ poll.c \ prctl.c \ + print_aio_sigset.c \ print_dev_t.c \ + print_fields.h \ + print_group_req.c \ + print_ifindex.c \ + print_instruction_pointer.c \ + print_kernel_version.c \ + print_mac.c \ print_mq_attr.c \ print_msgbuf.c \ print_sg_req_info.c \ @@ -191,8 +246,14 @@ strace_SOURCES = \ print_struct_stat.c \ print_time.c \ print_timespec.c \ + print_timespec.h \ + print_timespec32.c \ + print_timespec64.c \ print_timeval.c \ + print_timeval64.c \ print_timex.c \ + print_timex.h \ + print_utils.h \ printmode.c \ printrusage.c \ printsiginfo.c \ @@ -201,49 +262,80 @@ strace_SOURCES = \ process_vm.c \ ptp.c \ ptrace.h \ - qualify.c \ + ptrace_syscall_info.c \ + ptrace_syscall_info.h \ quota.c \ + random_ioctl.c \ readahead.c \ readlink.c \ reboot.c \ regs.h \ renameat.c \ resource.c \ + retval.c \ + retval.h \ + riscv.c \ + rt_sigframe.c \ + rt_sigreturn.c \ rtc.c \ + rtnl_addr.c \ + rtnl_addrlabel.c \ + rtnl_dcb.c \ + rtnl_link.c \ + rtnl_mdb.c \ + rtnl_neigh.c \ + rtnl_neightbl.c \ + rtnl_netconf.c \ + rtnl_nsid.c \ + rtnl_route.c \ + rtnl_rule.c \ + rtnl_tc.c \ + rtnl_tc_action.c \ + s390.c \ sched.c \ + sched_attr.h \ scsi.c \ seccomp.c \ - seccomp_fprog.h \ sendfile.c \ sg_io_v3.c \ sg_io_v4.c \ + shutdown.c \ sigaltstack.c \ sigevent.h \ signal.c \ signalfd.c \ - sigreturn.c \ sock.c \ sockaddr.c \ socketutils.c \ + sparc.c \ sram_alloc.c \ stat.c \ stat.h \ stat64.c \ statfs.c \ statfs.h \ + static_assert.h \ + statx.c \ + statx.h \ strace.c \ + string_to_uint.c \ + string_to_uint.h \ swapon.c \ syscall.c \ sysctl.c \ sysent.h \ + sysent_shorthand_defs.h \ + sysent_shorthand_undefs.h \ sysinfo.c \ syslog.c \ sysmips.c \ term.c \ time.c \ times.c \ + trace_event.h \ truncate.c \ ubi.c \ + ucopy.c \ uid.c \ uid16.c \ umask.c \ @@ -256,17 +348,40 @@ strace_SOURCES = \ utimes.c \ v4l2.c \ wait.c \ + wait.h \ xattr.c \ + xfs_quota_stat.h \ + xlat.c \ xlat.h \ xmalloc.c \ + xmalloc.h \ + xstring.h \ + $(strace_SOURCES_check) \ # end of strace_SOURCES +strace_SOURCES_check = bpf_attr_check.c + +if ENABLE_STACKTRACE +strace_SOURCES += unwind.c unwind.h +if USE_LIBDW +strace_SOURCES += unwind-libdw.c +strace_CPPFLAGS += $(libdw_CPPFLAGS) +strace_CFLAGS += $(libdw_CFLAGS) +strace_LDFLAGS += $(libdw_LDFLAGS) +strace_LDADD += $(libdw_LIBS) +endif if USE_LIBUNWIND -strace_SOURCES += unwind.c +strace_SOURCES += unwind-libunwind.c strace_CPPFLAGS += $(libunwind_CPPFLAGS) strace_LDFLAGS += $(libunwind_LDFLAGS) strace_LDADD += $(libunwind_LIBS) endif +if USE_DEMANGLE +strace_CPPFLAGS += $(libiberty_CPPFLAGS) +strace_LDFLAGS += $(libiberty_LDFLAGS) +strace_LDADD += $(libiberty_LIBS) +endif +endif @CODE_COVERAGE_RULES@ CODE_COVERAGE_BRANCH_COVERAGE = 1 @@ -275,7 +390,7 @@ CODE_COVERAGE_GENHTML_OPTIONS = $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) \ CODE_COVERAGE_IGNORE_PATTERN = '/usr/include/*' strace_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS) strace_CFLAGS += $(CODE_COVERAGE_CFLAGS) -strace_LDADD += $(CODE_COVERAGE_LDFLAGS) +strace_LDADD += $(CODE_COVERAGE_LIBS) # Enable this to get link map generated #strace_LDFLAGS += -Wl,-Map=strace.mapfile @@ -287,6 +402,8 @@ EXTRA_DIST = \ CREDITS \ ChangeLog \ ChangeLog-CVS \ + LGPL-2.1-or-later \ + README-configure \ README-linux-ptrace \ debian/changelog \ debian/compat \ @@ -302,7 +419,7 @@ EXTRA_DIST = \ debian/strace64.install \ debian/strace64.manpages \ debian/watch \ - errnoent.sh \ + gen_bpf_attr_check.sh \ generate_sen.sh \ ioctl_iocdef.c \ ioctlsort.c \ @@ -313,33 +430,36 @@ EXTRA_DIST = \ linux/32/syscallent.h \ linux/64/ioctls_inc.h \ linux/64/syscallent.h \ + linux/aarch64/arch_defs_.h \ + linux/aarch64/arch_get_personality.c \ linux/aarch64/arch_regs.c \ - linux/aarch64/arch_regs.h \ linux/aarch64/arch_sigreturn.c \ - linux/aarch64/errnoent1.h \ linux/aarch64/get_error.c \ linux/aarch64/get_scno.c \ - linux/aarch64/get_syscall_args.c\ + linux/aarch64/get_syscall_args.c \ linux/aarch64/ioctls_arch0.h \ linux/aarch64/ioctls_arch1.h \ linux/aarch64/ioctls_inc0.h \ linux/aarch64/ioctls_inc1.h \ + linux/aarch64/nr_prefix.c \ + linux/aarch64/raw_syscall.h \ linux/aarch64/set_error.c \ linux/aarch64/set_scno.c \ - linux/aarch64/signalent1.h \ + linux/aarch64/shuffle_scno.c \ linux/aarch64/syscallent.h \ linux/aarch64/syscallent1.h \ + linux/alpha/arch_defs_.h \ linux/alpha/arch_getrval2.c \ linux/alpha/arch_regs.c \ - linux/alpha/arch_regs.h \ linux/alpha/arch_sigreturn.c \ linux/alpha/errnoent.h \ linux/alpha/get_error.c \ linux/alpha/get_scno.c \ linux/alpha/get_syscall_args.c \ - linux/alpha/get_syscall_result.c\ + linux/alpha/get_syscall_result.c \ linux/alpha/ioctls_arch0.h \ linux/alpha/ioctls_inc0.h \ + linux/alpha/raw_syscall.h \ linux/alpha/set_error.c \ linux/alpha/set_scno.c \ linux/alpha/signalent.h \ @@ -351,21 +471,28 @@ EXTRA_DIST = \ linux/arc/get_syscall_args.c \ linux/arc/ioctls_arch0.h \ linux/arc/ioctls_inc0.h \ + linux/arc/raw_syscall.h \ linux/arc/set_error.c \ linux/arc/set_scno.c \ linux/arc/syscallent.h \ + linux/arch_defs_.h \ + linux/arch_kvm.c \ linux/arch_regs.h \ + linux/arch_rt_sigframe.c \ linux/arch_sigreturn.c \ + linux/arm/arch_defs_.h \ linux/arm/arch_regs.c \ - linux/arm/arch_regs.h \ linux/arm/arch_sigreturn.c \ linux/arm/get_error.c \ linux/arm/get_scno.c \ linux/arm/get_syscall_args.c \ linux/arm/ioctls_arch0.h \ linux/arm/ioctls_inc0.h \ + linux/arm/nr_prefix.c \ + linux/arm/raw_syscall.h \ linux/arm/set_error.c \ linux/arm/set_scno.c \ + linux/arm/shuffle_scno.c \ linux/arm/syscallent.h \ linux/arm/userent.h \ linux/avr32/arch_regs.c \ @@ -374,10 +501,12 @@ EXTRA_DIST = \ linux/avr32/get_syscall_args.c \ linux/avr32/ioctls_arch0.h \ linux/avr32/ioctls_inc0.h \ + linux/avr32/raw_syscall.h \ linux/avr32/set_error.c \ linux/avr32/set_scno.c \ linux/avr32/syscallent.h \ linux/avr32/userent.h \ + linux/bfin/arch_defs_.h \ linux/bfin/arch_regs.c \ linux/bfin/get_error.c \ linux/bfin/get_scno.c \ @@ -385,35 +514,29 @@ EXTRA_DIST = \ linux/bfin/get_syscall_result.c \ linux/bfin/ioctls_arch0.h \ linux/bfin/ioctls_inc0.h \ + linux/bfin/raw_syscall.h \ + linux/bfin/rt_sigframe.h \ linux/bfin/set_error.c \ linux/bfin/set_scno.c \ linux/bfin/syscallent.h \ + linux/csky/arch_regs.c \ + linux/csky/get_error.c \ + linux/csky/get_scno.c \ + linux/csky/get_syscall_args.c \ + linux/csky/ioctls_arch0.h \ + linux/csky/ioctls_inc0.h \ + linux/csky/raw_syscall.h \ + linux/csky/set_error.c \ + linux/csky/set_scno.c \ + linux/csky/syscallent.h \ linux/bfin/userent.h \ - linux/crisv10/arch_regs.c \ - linux/crisv10/arch_sigreturn.c \ - linux/crisv10/get_error.c \ - linux/crisv10/get_scno.c \ - linux/crisv10/get_syscall_args.c \ - linux/crisv10/get_syscall_result.c \ - linux/crisv10/set_error.c \ - linux/crisv10/set_scno.c \ - linux/crisv10/syscallent.h \ - linux/crisv10/userent.h \ - linux/crisv32/arch_regs.c \ - linux/crisv32/arch_sigreturn.c \ - linux/crisv32/get_error.c \ - linux/crisv32/get_scno.c \ - linux/crisv32/get_syscall_args.c \ - linux/crisv32/get_syscall_result.c \ - linux/crisv32/set_error.c \ - linux/crisv32/set_scno.c \ - linux/crisv32/syscallent.h \ - linux/crisv32/userent.h \ + linux/check_scno.c \ linux/dummy.h \ linux/errnoent.h \ linux/getregs_old.h \ + linux/hppa/arch_defs_.h \ linux/hppa/arch_regs.c \ - linux/hppa/arch_regs.h \ + linux/hppa/arch_rt_sigframe.c \ linux/hppa/errnoent.h \ linux/hppa/get_error.c \ linux/hppa/get_scno.c \ @@ -421,58 +544,74 @@ EXTRA_DIST = \ linux/hppa/get_syscall_result.c \ linux/hppa/ioctls_arch0.h \ linux/hppa/ioctls_inc0.h \ + linux/hppa/raw_syscall.h \ + linux/hppa/rt_sigframe.h \ linux/hppa/set_error.c \ linux/hppa/set_scno.c \ linux/hppa/signalent.h \ linux/hppa/syscallent.h \ + linux/hppa/userent.h \ + linux/i386/arch_defs_.h \ + linux/i386/arch_kvm.c \ linux/i386/arch_regs.c \ - linux/i386/arch_regs.h \ + linux/i386/arch_rt_sigframe.c \ linux/i386/arch_sigreturn.c \ linux/i386/get_error.c \ linux/i386/get_scno.c \ linux/i386/get_syscall_args.c \ linux/i386/ioctls_arch0.h \ linux/i386/ioctls_inc0.h \ + linux/i386/raw_syscall.h \ + linux/i386/rt_sigframe.h \ linux/i386/set_error.c \ linux/i386/set_scno.c \ linux/i386/syscallent.h \ linux/i386/userent.h \ linux/i386/userent0.h \ + linux/ia64/arch_defs_.h \ linux/ia64/arch_getrval2.c \ linux/ia64/arch_regs.c \ linux/ia64/arch_regs.h \ - linux/ia64/arch_sigreturn.c \ + linux/ia64/arch_rt_sigframe.c \ linux/ia64/get_error.c \ linux/ia64/get_scno.c \ linux/ia64/get_syscall_args.c \ linux/ia64/ioctls_arch0.h \ linux/ia64/ioctls_inc0.h \ + linux/ia64/raw_syscall.h \ + linux/ia64/rt_sigframe.h \ linux/ia64/set_error.c \ linux/ia64/set_scno.c \ linux/ia64/syscallent.h \ linux/ia64/userent.h \ linux/inet_diag.h \ + linux/m68k/arch_defs_.h \ linux/m68k/arch_regs.c \ - linux/m68k/arch_regs.h \ + linux/m68k/arch_rt_sigframe.c \ linux/m68k/arch_sigreturn.c \ linux/m68k/get_error.c \ linux/m68k/get_scno.c \ linux/m68k/get_syscall_args.c \ linux/m68k/ioctls_arch0.h \ linux/m68k/ioctls_inc0.h \ + linux/m68k/raw_syscall.h \ + linux/m68k/rt_sigframe.h \ linux/m68k/set_error.c \ linux/m68k/set_scno.c \ linux/m68k/syscallent.h \ linux/m68k/userent.h \ linux/metag/arch_regs.c \ + linux/metag/arch_rt_sigframe.c \ linux/metag/get_error.c \ linux/metag/get_scno.c \ linux/metag/get_syscall_args.c \ linux/metag/ioctls_arch0.h \ linux/metag/ioctls_inc0.h \ + linux/metag/raw_syscall.h \ linux/metag/set_error.c \ linux/metag/set_scno.c \ linux/metag/syscallent.h \ + linux/microblaze/arch_defs_.h \ linux/microblaze/arch_regs.c \ linux/microblaze/arch_sigreturn.c \ linux/microblaze/get_error.c \ @@ -481,13 +620,14 @@ EXTRA_DIST = \ linux/microblaze/get_syscall_result.c \ linux/microblaze/ioctls_arch0.h \ linux/microblaze/ioctls_inc0.h \ + linux/microblaze/raw_syscall.h \ linux/microblaze/set_error.c \ linux/microblaze/set_scno.c \ linux/microblaze/syscallent.h \ linux/microblaze/userent.h \ + linux/mips/arch_defs_.h \ linux/mips/arch_getrval2.c \ linux/mips/arch_regs.c \ - linux/mips/arch_regs.h \ linux/mips/arch_sigreturn.c \ linux/mips/errnoent.h \ linux/mips/genstub.sh \ @@ -496,6 +636,8 @@ EXTRA_DIST = \ linux/mips/get_syscall_args.c \ linux/mips/ioctls_arch0.h \ linux/mips/ioctls_inc0.h \ + linux/mips/raw_syscall.h \ + linux/mips/rt_sigframe.h \ linux/mips/set_error.c \ linux/mips/set_scno.c \ linux/mips/signalent.h \ @@ -505,30 +647,34 @@ EXTRA_DIST = \ linux/mips/syscallent-o32.h \ linux/mips/syscallent.h \ linux/mips/userent.h \ - linux/mtd-abi.h \ linux/netlink_diag.h \ + linux/nios2/arch_defs_.h \ linux/nios2/arch_regs.c \ linux/nios2/get_error.c \ linux/nios2/get_scno.c \ linux/nios2/get_syscall_args.c \ linux/nios2/ioctls_arch0.h \ linux/nios2/ioctls_inc0.h \ + linux/nios2/raw_syscall.h \ linux/nios2/set_error.c \ linux/nios2/set_scno.c \ linux/nios2/syscallent.h \ + linux/nr_prefix.c \ linux/or1k/arch_regs.c \ linux/or1k/get_error.c \ linux/or1k/get_scno.c \ linux/or1k/get_syscall_args.c \ linux/or1k/ioctls_arch0.h \ linux/or1k/ioctls_inc0.h \ + linux/or1k/raw_syscall.h \ linux/or1k/set_error.c \ linux/or1k/set_scno.c \ linux/or1k/syscallent.h \ linux/or1k/userent.h \ - linux/personality.h \ + linux/packet_diag.h \ + linux/powerpc/arch_defs_.h \ linux/powerpc/arch_regs.c \ - linux/powerpc/arch_regs.h \ + linux/powerpc/arch_rt_sigframe.c \ linux/powerpc/arch_sigreturn.c \ linux/powerpc/errnoent.h \ linux/powerpc/get_error.c \ @@ -538,15 +684,17 @@ EXTRA_DIST = \ linux/powerpc/getregs_old.h \ linux/powerpc/ioctls_arch0.h \ linux/powerpc/ioctls_inc0.h \ + linux/powerpc/raw_syscall.h \ linux/powerpc/set_error.c \ linux/powerpc/set_scno.c \ linux/powerpc/syscallent.h \ linux/powerpc/userent.h \ + linux/powerpc64/arch_defs_.h \ + linux/powerpc64/arch_get_personality.c \ linux/powerpc64/arch_regs.c \ - linux/powerpc64/arch_regs.h \ + linux/powerpc64/arch_rt_sigframe.c \ linux/powerpc64/arch_sigreturn.c \ linux/powerpc64/errnoent.h \ - linux/powerpc64/errnoent1.h \ linux/powerpc64/get_error.c \ linux/powerpc64/get_scno.c \ linux/powerpc64/get_syscall_args.c \ @@ -556,15 +704,18 @@ EXTRA_DIST = \ linux/powerpc64/ioctls_arch1.h \ linux/powerpc64/ioctls_inc0.h \ linux/powerpc64/ioctls_inc1.h \ + linux/powerpc64/raw_syscall.h \ + linux/powerpc64/rt_sigframe.h \ linux/powerpc64/set_error.c \ linux/powerpc64/set_scno.c \ - linux/powerpc64/signalent1.h \ linux/powerpc64/syscallent.h \ linux/powerpc64/syscallent1.h \ linux/powerpc64/userent.h \ - linux/ptp_clock.h \ + linux/ptrace_pokeuser.c \ + linux/raw_syscall.h \ + linux/riscv/arch_defs_.h \ + linux/riscv/arch_get_personality.c \ linux/riscv/arch_regs.c \ - linux/riscv/errnoent1.h \ linux/riscv/get_error.c \ linux/riscv/get_scno.c \ linux/riscv/get_syscall_args.c \ @@ -572,37 +723,47 @@ EXTRA_DIST = \ linux/riscv/ioctls_arch1.h \ linux/riscv/ioctls_inc0.h \ linux/riscv/ioctls_inc1.h \ + linux/riscv/raw_syscall.h \ linux/riscv/set_error.c \ linux/riscv/set_scno.c \ - linux/riscv/signalent1.h \ linux/riscv/syscallent.h \ linux/riscv/syscallent1.h \ + linux/rt_sigframe.h \ + linux/s390/arch_defs_.h \ linux/s390/arch_regs.c \ - linux/s390/arch_regs.h \ linux/s390/arch_sigreturn.c \ linux/s390/get_error.c \ linux/s390/get_scno.c \ linux/s390/get_syscall_args.c \ linux/s390/ioctls_arch0.h \ linux/s390/ioctls_inc0.h \ + linux/s390/raw_syscall.h \ + linux/s390/rt_sigframe.h \ linux/s390/set_error.c \ linux/s390/set_scno.c \ linux/s390/syscallent.h \ linux/s390/userent.h \ linux/s390/userent0.h \ linux/s390/userent1.h \ + linux/s390x/arch_defs_.h \ + linux/s390x/arch_get_personality.c \ linux/s390x/arch_regs.c \ - linux/s390x/arch_regs.h \ linux/s390x/arch_sigreturn.c \ linux/s390x/get_error.c \ linux/s390x/get_scno.c \ linux/s390x/get_syscall_args.c \ linux/s390x/ioctls_arch0.h \ + linux/s390x/ioctls_arch1.h \ linux/s390x/ioctls_inc0.h \ + linux/s390x/ioctls_inc1.h \ + linux/s390x/raw_syscall.h \ + linux/s390x/rt_sigframe.h \ linux/s390x/set_error.c \ linux/s390x/set_scno.c \ linux/s390x/syscallent.h \ + linux/s390x/syscallent1.h \ linux/s390x/userent.h \ + linux/sh/arch_defs_.h \ linux/sh/arch_getrval2.c \ linux/sh/arch_regs.c \ linux/sh/get_error.c \ @@ -611,11 +772,13 @@ EXTRA_DIST = \ linux/sh/get_syscall_result.c \ linux/sh/ioctls_arch0.h \ linux/sh/ioctls_inc0.h \ + linux/sh/raw_syscall.h \ linux/sh/set_error.c \ linux/sh/set_scno.c \ linux/sh/syscallent.h \ linux/sh/userent.h \ linux/sh/userent0.h \ + linux/sh64/arch_defs_.h \ linux/sh64/arch_regs.c \ linux/sh64/arch_regs.h \ linux/sh64/get_error.c \ @@ -624,54 +787,64 @@ EXTRA_DIST = \ linux/sh64/get_syscall_result.c \ linux/sh64/ioctls_arch0.h \ linux/sh64/ioctls_inc0.h \ + linux/sh64/raw_syscall.h \ + linux/sh64/rt_sigframe.h \ linux/sh64/set_error.c \ linux/sh64/set_scno.c \ linux/sh64/syscallent.h \ linux/sh64/userent.h \ + linux/shuffle_scno.c \ + linux/signal.h.in \ linux/signalent.h \ + linux/smc_diag.h \ linux/sock_diag.h \ + linux/sparc/arch_defs_.h \ linux/sparc/arch_getrval2.c \ linux/sparc/arch_regs.c \ - linux/sparc/arch_regs.h \ linux/sparc/arch_sigreturn.c \ linux/sparc/errnoent.h \ - linux/sparc/gen.pl \ linux/sparc/get_error.c \ linux/sparc/get_scno.c \ linux/sparc/get_syscall_args.c \ linux/sparc/ioctls_arch0.h \ linux/sparc/ioctls_inc0.h \ + linux/sparc/raw_syscall.h \ + linux/sparc/rt_sigframe.h \ linux/sparc/set_error.c \ linux/sparc/set_scno.c \ linux/sparc/signalent.h \ linux/sparc/syscallent.h \ linux/sparc/userent.h \ + linux/sparc64/arch_defs_.h \ + linux/sparc64/arch_get_personality.c \ linux/sparc64/arch_getrval2.c \ linux/sparc64/arch_regs.c \ - linux/sparc64/arch_regs.h \ + linux/sparc64/arch_rt_sigframe.c \ linux/sparc64/arch_sigreturn.c \ linux/sparc64/errnoent.h \ - linux/sparc64/errnoent1.h \ linux/sparc64/get_error.c \ linux/sparc64/get_scno.c \ - linux/sparc64/get_syscall_args.c\ + linux/sparc64/get_syscall_args.c \ linux/sparc64/ioctls_arch0.h \ linux/sparc64/ioctls_arch1.h \ linux/sparc64/ioctls_inc0.h \ linux/sparc64/ioctls_inc1.h \ + linux/sparc64/raw_syscall.h \ + linux/sparc64/rt_sigframe.h \ linux/sparc64/set_error.c \ linux/sparc64/set_scno.c \ linux/sparc64/signalent.h \ - linux/sparc64/signalent1.h \ linux/sparc64/syscallent.h \ linux/sparc64/syscallent1.h \ linux/sparc64/userent.h \ linux/subcall.h \ + linux/subcall32.h \ + linux/subcall64.h \ linux/syscall.h \ + linux/tile/arch_defs_.h \ + linux/tile/arch_get_personality.c \ linux/tile/arch_regs.c \ - linux/tile/arch_regs.h \ linux/tile/arch_sigreturn.c \ - linux/tile/errnoent1.h \ linux/tile/get_error.c \ linux/tile/get_scno.c \ linux/tile/get_syscall_args.c \ @@ -679,20 +852,24 @@ EXTRA_DIST = \ linux/tile/ioctls_arch1.h \ linux/tile/ioctls_inc0.h \ linux/tile/ioctls_inc1.h \ + linux/tile/raw_syscall.h \ + linux/tile/rt_sigframe.h \ linux/tile/set_error.c \ linux/tile/set_scno.c \ - linux/tile/signalent1.h \ linux/tile/syscallent.h \ linux/tile/syscallent1.h \ linux/tile/userent.h \ - linux/ubi-user.h \ linux/unix_diag.h \ linux/userent.h \ linux/userent0.h \ + linux/x32/arch_defs_.h \ + linux/x32/arch_get_personality.c \ + linux/x32/arch_kvm.c \ linux/x32/arch_regs.c \ linux/x32/arch_regs.h \ + linux/x32/arch_rt_sigframe.c \ linux/x32/arch_sigreturn.c \ - linux/x32/errnoent1.h \ + linux/x32/check_scno.c \ linux/x32/get_error.c \ linux/x32/get_scno.c \ linux/x32/get_syscall_args.c \ @@ -700,18 +877,22 @@ EXTRA_DIST = \ linux/x32/ioctls_arch1.h \ linux/x32/ioctls_inc0.h \ linux/x32/ioctls_inc1.h \ + linux/x32/ptrace_pokeuser.c \ + linux/x32/raw_syscall.h \ + linux/x32/rt_sigframe.h \ linux/x32/set_error.c \ linux/x32/set_scno.c \ - linux/x32/signalent1.h \ + linux/x32/shuffle_scno.c \ linux/x32/syscallent.h \ linux/x32/syscallent1.h \ linux/x32/userent.h \ + linux/x86_64/arch_defs_.h \ + linux/x86_64/arch_get_personality.c \ + linux/x86_64/arch_kvm.c \ linux/x86_64/arch_regs.c \ linux/x86_64/arch_regs.h \ + linux/x86_64/arch_rt_sigframe.c \ linux/x86_64/arch_sigreturn.c \ - linux/x86_64/errnoent1.h \ - linux/x86_64/errnoent2.h \ - linux/x86_64/gentab.pl \ linux/x86_64/get_error.c \ linux/x86_64/get_scno.c \ linux/x86_64/get_syscall_args.c \ @@ -723,10 +904,11 @@ EXTRA_DIST = \ linux/x86_64/ioctls_inc0.h \ linux/x86_64/ioctls_inc1.h \ linux/x86_64/ioctls_inc2.h \ + linux/x86_64/raw_syscall.h \ + linux/x86_64/rt_sigframe.h \ linux/x86_64/set_error.c \ linux/x86_64/set_scno.c \ - linux/x86_64/signalent1.h \ - linux/x86_64/signalent2.h \ + linux/x86_64/shuffle_scno.c \ linux/x86_64/syscallent.h \ linux/x86_64/syscallent1.h \ linux/x86_64/syscallent2.h \ @@ -738,28 +920,23 @@ EXTRA_DIST = \ linux/xtensa/get_syscall_result.c \ linux/xtensa/ioctls_arch0.h \ linux/xtensa/ioctls_inc0.h \ + linux/xtensa/raw_syscall.h \ linux/xtensa/set_error.c \ linux/xtensa/set_scno.c \ linux/xtensa/syscallent.h \ linux/xtensa/userent.h \ - maint/ioctls_gen.sh \ - maint/ioctls_hex.sh \ - maint/ioctls_sym.sh \ - maint/print_ioctlent.c \ mpers.awk \ mpers.sh \ mpers_test.sh \ mpers_xlat.h \ scno.head \ - signalent.sh \ strace-graph \ strace-log-merge \ strace.spec \ - syscallent.sh \ $(XLAT_INPUT_FILES) \ $(XLAT_HEADER_FILES) \ xlat/gen.sh \ - xlate.el + # end of EXTRA_DIST .PHONY: check-valgrind-local check-valgrind-local: @@ -771,10 +948,16 @@ srpm: dist-xz $(srcdir)/.version: $(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@ +bpf_attr_check.c: $(srcdir)/bpf_attr.h $(srcdir)/gen_bpf_attr_check.sh + D="$(D)" \ + $(srcdir)/gen_bpf_attr_check.sh $< > $@-t && mv $@-t $@ + strace_SOURCES_c = \ $(filter %.c,$(strace_SOURCES)) $(filter %.c,$(libstrace_a_SOURCES)) -sys_func.h: $(patsubst %,$(srcdir)/%,$(strace_SOURCES_c)) +sys_func_h_sources = $(filter-out $(strace_SOURCES_check),$(strace_SOURCES_c)) + +sys_func.h: $(patsubst %,$(srcdir)/%,$(sys_func_h_sources)) for f in $^; do \ sed -n 's/^SYS_FUNC(.*/extern &;/p' $$f; \ done | sort -u > $@ @@ -786,12 +969,15 @@ syscallent_files = $(filter $(syscallent_patterns),$(EXTRA_DIST)) sen.h: $(patsubst %,$(srcdir)/%,$(syscallent_files)) for f in $^; do cat -- $$f; done | \ + D="$(D)" \ $(srcdir)/generate_sen.sh > $@ dist-hook: $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version + ${AM_V_GEN}echo $(COPYRIGHT_YEAR) > $(distdir)/.year + ${AM_V_GEN}echo $(MANPAGE_DATE) > $(distdir)/.strace.1.in.date -today = $(shell date +%Y-%m-%d) +today = $(shell LC_TIME=C date -u +%Y-%m-%d) version_regexp = $(subst .,\.,$(VERSION)) news_check_regexp = 'Noteworthy changes in release $(version_regexp) ($(today))' @@ -845,11 +1031,13 @@ ioctls_all%.h: $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%.h $(srcdir)/$(OS)/$(ARCH)/ioc cat $^ > $@ BUILT_SOURCES = $(ioctl_redefs_h) $(ioctlent_h) \ - native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h .version + bpf_attr_check.c native_printer_decls.h native_printer_defs.h \ + printers.h sen.h sys_func.h .version CLEANFILES = $(ioctl_redefs_h) $(ioctlent_h) $(mpers_preproc_files) \ ioctl_iocdef.h ioctl_iocdef.i \ - native_printer_decls.h native_printer_defs.h printers.h sen.h sys_func.h -DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h + bpf_attr_check.c native_printer_decls.h native_printer_defs.h \ + printers.h sen.h sys_func.h +DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h linux/linux/signal.h include scno.am @@ -873,9 +1061,13 @@ libmpers_CFLAGS = $(strace_CFLAGS) mpers-m%.stamp: $(srcdir_mpers_source_files) | printers.h for f in $^; do \ - CC="$(CC)" CFLAGS="$(mpers_sh_opts) -DMPERS_IS_$(mpers_NAME)" \ - CPP="$(CPP)" CPPFLAGS="$(mpers_sh_opts) -DIN_MPERS -DMPERS_IS_$(mpers_NAME)" \ - $(srcdir)/mpers.sh -$(mpers_NAME) $$f || exit; \ + D="$(D)" \ + READELF="$(READELF)" \ + CC="$(CC)" \ + CFLAGS="$(mpers_sh_opts) -DMPERS_IS_$(mpers_NAME)" \ + CPP="$(CPP)" \ + CPPFLAGS="$(mpers_sh_opts) -DIN_MPERS -DMPERS_IS_$(mpers_NAME)" \ + $(srcdir)/mpers.sh $(mpers_NAME) $(mpers_CC_FLAGS) $$f || exit; \ done > $@ @@ -946,6 +1138,7 @@ BUILT_SOURCES += $(mpers_m32_targets) CLEANFILES += $(mpers_m32_targets) $(mpers_m32_targets): mpers_NAME = m32 +$(mpers_m32_targets): mpers_CC_FLAGS = @cc_flags_m32@ endif # HAVE_M32_MPERS @@ -962,6 +1155,7 @@ BUILT_SOURCES += $(mpers_mx32_targets) CLEANFILES += $(mpers_mx32_targets) $(mpers_mx32_targets): mpers_NAME = mx32 +$(mpers_mx32_targets): mpers_CC_FLAGS = @cc_flags_mx32@ endif # HAVE_MX32_MPERS @@ -986,12 +1180,13 @@ $(srcdir)/CREDITS: $(srcdir)/CREDITS.in $(srcdir)/.mailmap \ $(srcdir)/Makefile.in $(srcdir)/.version $(AM_V_GEN) \ ( \ + D="$(D)"; \ + export D; \ cd $(srcdir); \ sed '/^##/,$$d' CREDITS.in; \ - { sed -n '1,/^##>/d; s/ */\t/; s/^./&/p' CREDITS.in; \ - git log --pretty=format:'%aN %aE'; \ - } | LC_ALL=C sort -u \ - | awk -F'\t' '{printf("\t%s <%s>\n",$$1,$$2)}'; \ + sed -n '1,/^##>/d; s/ */\t/; s/^./&/p' CREDITS.in \ + | maint/gen-contributors-list.sh - -e HEAD --initial \ + | sed 's/\t/ /g; s/^/\t/' \ ) > $@-t && mv $@-t $@ export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner --mode=go-w,go+rX diff --git a/Makefile.in b/Makefile.in index d0a31adc..6485a588 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,61 +20,32 @@ # Copyright (c) 2006-2016 Dmitry V. Levin # Copyright (c) 2008-2015 Mike Frysinger # Copyright (c) 2015 Elvira Khabirova +# Copyright (c) 2002-2019 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: LGPL-2.1-or-later # scno.h make rules for strace. # -# Copyright (c) 2017 Dmitry V. Levin +# Copyright (c) 2017-2019 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: LGPL-2.1-or-later VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -138,42 +109,53 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = strace$(EXEEXT) -DIST_COMMON = $(srcdir)/xlat/Makemodule.am $(srcdir)/scno.am \ - $(srcdir)/mpers.am $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ - $(top_srcdir)/configure $(am__configure_deps) \ - $(srcdir)/config.h.in $(srcdir)/strace.spec.in \ - $(top_srcdir)/debian/changelog.in depcomp AUTHORS COPYING \ - INSTALL NEWS README compile config.guess config.sub install-sh \ - missing -@USE_LIBUNWIND_TRUE@am__append_1 = unwind.c -@USE_LIBUNWIND_TRUE@am__append_2 = $(libunwind_CPPFLAGS) -@USE_LIBUNWIND_TRUE@am__append_3 = $(libunwind_LDFLAGS) -@USE_LIBUNWIND_TRUE@am__append_4 = $(libunwind_LIBS) -@HAVE_M32_MPERS_TRUE@am__append_5 = libmpers-m32.a -@HAVE_M32_MPERS_TRUE@am__append_6 = libmpers-m32.a -@HAVE_M32_MPERS_TRUE@am__append_7 = $(mpers_m32_targets) -@HAVE_M32_MPERS_TRUE@am__append_8 = $(mpers_m32_targets) -@HAVE_MX32_MPERS_TRUE@am__append_9 = libmpers-mx32.a -@HAVE_MX32_MPERS_TRUE@am__append_10 = libmpers-mx32.a -@HAVE_MX32_MPERS_TRUE@am__append_11 = $(mpers_mx32_targets) -@HAVE_MX32_MPERS_TRUE@am__append_12 = $(mpers_mx32_targets) +@ENABLE_STACKTRACE_TRUE@am__append_1 = unwind.c unwind.h +@ENABLE_STACKTRACE_TRUE@@USE_LIBDW_TRUE@am__append_2 = unwind-libdw.c +@ENABLE_STACKTRACE_TRUE@@USE_LIBDW_TRUE@am__append_3 = $(libdw_CPPFLAGS) +@ENABLE_STACKTRACE_TRUE@@USE_LIBDW_TRUE@am__append_4 = $(libdw_CFLAGS) +@ENABLE_STACKTRACE_TRUE@@USE_LIBDW_TRUE@am__append_5 = $(libdw_LDFLAGS) +@ENABLE_STACKTRACE_TRUE@@USE_LIBDW_TRUE@am__append_6 = $(libdw_LIBS) +@ENABLE_STACKTRACE_TRUE@@USE_LIBUNWIND_TRUE@am__append_7 = unwind-libunwind.c +@ENABLE_STACKTRACE_TRUE@@USE_LIBUNWIND_TRUE@am__append_8 = $(libunwind_CPPFLAGS) +@ENABLE_STACKTRACE_TRUE@@USE_LIBUNWIND_TRUE@am__append_9 = $(libunwind_LDFLAGS) +@ENABLE_STACKTRACE_TRUE@@USE_LIBUNWIND_TRUE@am__append_10 = $(libunwind_LIBS) +@ENABLE_STACKTRACE_TRUE@@USE_DEMANGLE_TRUE@am__append_11 = $(libiberty_CPPFLAGS) +@ENABLE_STACKTRACE_TRUE@@USE_DEMANGLE_TRUE@am__append_12 = $(libiberty_LDFLAGS) +@ENABLE_STACKTRACE_TRUE@@USE_DEMANGLE_TRUE@am__append_13 = $(libiberty_LIBS) +@HAVE_M32_MPERS_TRUE@am__append_14 = libmpers-m32.a +@HAVE_M32_MPERS_TRUE@am__append_15 = libmpers-m32.a +@HAVE_M32_MPERS_TRUE@am__append_16 = $(mpers_m32_targets) +@HAVE_M32_MPERS_TRUE@am__append_17 = $(mpers_m32_targets) +@HAVE_MX32_MPERS_TRUE@am__append_18 = libmpers-mx32.a +@HAVE_MX32_MPERS_TRUE@am__append_19 = libmpers-mx32.a +@HAVE_MX32_MPERS_TRUE@am__append_20 = $(mpers_mx32_targets) +@HAVE_MX32_MPERS_TRUE@am__append_21 = $(mpers_mx32_targets) subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ $(top_srcdir)/m4/ax_valgrind_check.m4 \ - $(top_srcdir)/m4/mpers.m4 \ + $(top_srcdir)/m4/bpf_attr.m4 $(top_srcdir)/m4/mpers.m4 \ + $(top_srcdir)/m4/st_demangle.m4 $(top_srcdir)/m4/st_libdw.m4 \ + $(top_srcdir)/m4/st_libunwind.m4 \ $(top_srcdir)/m4/st_save_restore_var.m4 \ + $(top_srcdir)/m4/st_stacktrace.m4 \ $(top_srcdir)/m4/st_warn_cflags.m4 \ $(top_srcdir)/m4/warnings.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ + $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = strace.spec debian/changelog +CONFIG_CLEAN_FILES = strace.1 strace-log-merge.1 strace.spec \ + debian/changelog CONFIG_CLEAN_VPATH_FILES = +am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" \ + "$(DESTDIR)$(man1dir)" +PROGRAMS = $(bin_PROGRAMS) LIBRARIES = $(noinst_LIBRARIES) AR = ar ARFLAGS = cru @@ -183,29 +165,36 @@ am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libmpers_m32_a_AR = $(AR) $(ARFLAGS) libmpers_m32_a_LIBADD = -am__libmpers_m32_a_SOURCES_DIST = block.c btrfs.c dirent.c evdev.c \ - fetch_seccomp_fprog.c fetch_struct_flock.c \ - fetch_struct_mmsghdr.c fetch_struct_msghdr.c \ - fetch_struct_stat.c fetch_struct_stat64.c \ - fetch_struct_statfs.c hdio.c ipc_msgctl.c ipc_shmctl.c loop.c \ - mtd.c print_mq_attr.c print_msgbuf.c print_sg_req_info.c \ +am__libmpers_m32_a_SOURCES_DIST = block.c btrfs.c dirent.c \ + evdev_mpers.c fetch_bpf_fprog.c fetch_struct_flock.c \ + fetch_struct_keyctl_kdf_params.c fetch_struct_mmsghdr.c \ + fetch_struct_msghdr.c fetch_struct_stat.c \ + fetch_struct_stat64.c fetch_struct_statfs.c \ + fetch_struct_xfs_quotastat.c hdio.c ipc_msgctl.c ipc_shmctl.c \ + loop.c mtd.c perf_ioctl.c print_aio_sigset.c print_group_req.c \ + print_mq_attr.c print_msgbuf.c print_sg_req_info.c \ print_sigevent.c print_time.c print_timespec.c print_timeval.c \ - print_timex.c printrusage.c printsiginfo.c rtc.c sg_io_v3.c \ + printrusage.c printsiginfo.c rt_sigreturn.c rtc.c sg_io_v3.c \ sigaltstack.c sock.c sysinfo.c times.c ustat.c utime.c v4l2.c am__objects_1 = libmpers_m32_a-block.$(OBJEXT) \ libmpers_m32_a-btrfs.$(OBJEXT) libmpers_m32_a-dirent.$(OBJEXT) \ - libmpers_m32_a-evdev.$(OBJEXT) \ - libmpers_m32_a-fetch_seccomp_fprog.$(OBJEXT) \ + libmpers_m32_a-evdev_mpers.$(OBJEXT) \ + libmpers_m32_a-fetch_bpf_fprog.$(OBJEXT) \ libmpers_m32_a-fetch_struct_flock.$(OBJEXT) \ + libmpers_m32_a-fetch_struct_keyctl_kdf_params.$(OBJEXT) \ libmpers_m32_a-fetch_struct_mmsghdr.$(OBJEXT) \ libmpers_m32_a-fetch_struct_msghdr.$(OBJEXT) \ libmpers_m32_a-fetch_struct_stat.$(OBJEXT) \ libmpers_m32_a-fetch_struct_stat64.$(OBJEXT) \ libmpers_m32_a-fetch_struct_statfs.$(OBJEXT) \ + libmpers_m32_a-fetch_struct_xfs_quotastat.$(OBJEXT) \ libmpers_m32_a-hdio.$(OBJEXT) \ libmpers_m32_a-ipc_msgctl.$(OBJEXT) \ libmpers_m32_a-ipc_shmctl.$(OBJEXT) \ libmpers_m32_a-loop.$(OBJEXT) libmpers_m32_a-mtd.$(OBJEXT) \ + libmpers_m32_a-perf_ioctl.$(OBJEXT) \ + libmpers_m32_a-print_aio_sigset.$(OBJEXT) \ + libmpers_m32_a-print_group_req.$(OBJEXT) \ libmpers_m32_a-print_mq_attr.$(OBJEXT) \ libmpers_m32_a-print_msgbuf.$(OBJEXT) \ libmpers_m32_a-print_sg_req_info.$(OBJEXT) \ @@ -213,9 +202,9 @@ am__objects_1 = libmpers_m32_a-block.$(OBJEXT) \ libmpers_m32_a-print_time.$(OBJEXT) \ libmpers_m32_a-print_timespec.$(OBJEXT) \ libmpers_m32_a-print_timeval.$(OBJEXT) \ - libmpers_m32_a-print_timex.$(OBJEXT) \ libmpers_m32_a-printrusage.$(OBJEXT) \ libmpers_m32_a-printsiginfo.$(OBJEXT) \ + libmpers_m32_a-rt_sigreturn.$(OBJEXT) \ libmpers_m32_a-rtc.$(OBJEXT) libmpers_m32_a-sg_io_v3.$(OBJEXT) \ libmpers_m32_a-sigaltstack.$(OBJEXT) \ libmpers_m32_a-sock.$(OBJEXT) libmpers_m32_a-sysinfo.$(OBJEXT) \ @@ -225,30 +214,37 @@ am__objects_1 = libmpers_m32_a-block.$(OBJEXT) \ libmpers_m32_a_OBJECTS = $(am_libmpers_m32_a_OBJECTS) libmpers_mx32_a_AR = $(AR) $(ARFLAGS) libmpers_mx32_a_LIBADD = -am__libmpers_mx32_a_SOURCES_DIST = block.c btrfs.c dirent.c evdev.c \ - fetch_seccomp_fprog.c fetch_struct_flock.c \ - fetch_struct_mmsghdr.c fetch_struct_msghdr.c \ - fetch_struct_stat.c fetch_struct_stat64.c \ - fetch_struct_statfs.c hdio.c ipc_msgctl.c ipc_shmctl.c loop.c \ - mtd.c print_mq_attr.c print_msgbuf.c print_sg_req_info.c \ +am__libmpers_mx32_a_SOURCES_DIST = block.c btrfs.c dirent.c \ + evdev_mpers.c fetch_bpf_fprog.c fetch_struct_flock.c \ + fetch_struct_keyctl_kdf_params.c fetch_struct_mmsghdr.c \ + fetch_struct_msghdr.c fetch_struct_stat.c \ + fetch_struct_stat64.c fetch_struct_statfs.c \ + fetch_struct_xfs_quotastat.c hdio.c ipc_msgctl.c ipc_shmctl.c \ + loop.c mtd.c perf_ioctl.c print_aio_sigset.c print_group_req.c \ + print_mq_attr.c print_msgbuf.c print_sg_req_info.c \ print_sigevent.c print_time.c print_timespec.c print_timeval.c \ - print_timex.c printrusage.c printsiginfo.c rtc.c sg_io_v3.c \ + printrusage.c printsiginfo.c rt_sigreturn.c rtc.c sg_io_v3.c \ sigaltstack.c sock.c sysinfo.c times.c ustat.c utime.c v4l2.c am__objects_2 = libmpers_mx32_a-block.$(OBJEXT) \ libmpers_mx32_a-btrfs.$(OBJEXT) \ libmpers_mx32_a-dirent.$(OBJEXT) \ - libmpers_mx32_a-evdev.$(OBJEXT) \ - libmpers_mx32_a-fetch_seccomp_fprog.$(OBJEXT) \ + libmpers_mx32_a-evdev_mpers.$(OBJEXT) \ + libmpers_mx32_a-fetch_bpf_fprog.$(OBJEXT) \ libmpers_mx32_a-fetch_struct_flock.$(OBJEXT) \ + libmpers_mx32_a-fetch_struct_keyctl_kdf_params.$(OBJEXT) \ libmpers_mx32_a-fetch_struct_mmsghdr.$(OBJEXT) \ libmpers_mx32_a-fetch_struct_msghdr.$(OBJEXT) \ libmpers_mx32_a-fetch_struct_stat.$(OBJEXT) \ libmpers_mx32_a-fetch_struct_stat64.$(OBJEXT) \ libmpers_mx32_a-fetch_struct_statfs.$(OBJEXT) \ + libmpers_mx32_a-fetch_struct_xfs_quotastat.$(OBJEXT) \ libmpers_mx32_a-hdio.$(OBJEXT) \ libmpers_mx32_a-ipc_msgctl.$(OBJEXT) \ libmpers_mx32_a-ipc_shmctl.$(OBJEXT) \ libmpers_mx32_a-loop.$(OBJEXT) libmpers_mx32_a-mtd.$(OBJEXT) \ + libmpers_mx32_a-perf_ioctl.$(OBJEXT) \ + libmpers_mx32_a-print_aio_sigset.$(OBJEXT) \ + libmpers_mx32_a-print_group_req.$(OBJEXT) \ libmpers_mx32_a-print_mq_attr.$(OBJEXT) \ libmpers_mx32_a-print_msgbuf.$(OBJEXT) \ libmpers_mx32_a-print_sg_req_info.$(OBJEXT) \ @@ -256,9 +252,9 @@ am__objects_2 = libmpers_mx32_a-block.$(OBJEXT) \ libmpers_mx32_a-print_time.$(OBJEXT) \ libmpers_mx32_a-print_timespec.$(OBJEXT) \ libmpers_mx32_a-print_timeval.$(OBJEXT) \ - libmpers_mx32_a-print_timex.$(OBJEXT) \ libmpers_mx32_a-printrusage.$(OBJEXT) \ libmpers_mx32_a-printsiginfo.$(OBJEXT) \ + libmpers_mx32_a-rt_sigreturn.$(OBJEXT) \ libmpers_mx32_a-rtc.$(OBJEXT) \ libmpers_mx32_a-sg_io_v3.$(OBJEXT) \ libmpers_mx32_a-sigaltstack.$(OBJEXT) \ @@ -271,139 +267,225 @@ am__objects_2 = libmpers_mx32_a-block.$(OBJEXT) \ libmpers_mx32_a_OBJECTS = $(am_libmpers_mx32_a_OBJECTS) libstrace_a_AR = $(AR) $(ARFLAGS) libstrace_a_LIBADD = -am_libstrace_a_OBJECTS = libstrace_a-fstatfs.$(OBJEXT) \ - libstrace_a-fstatfs64.$(OBJEXT) libstrace_a-ipc.$(OBJEXT) \ +am_libstrace_a_OBJECTS = \ + libstrace_a-fetch_indirect_syscall_args.$(OBJEXT) \ + libstrace_a-fstatfs.$(OBJEXT) libstrace_a-fstatfs64.$(OBJEXT) \ + libstrace_a-getpagesize.$(OBJEXT) libstrace_a-ipc.$(OBJEXT) \ + libstrace_a-mmap_cache.$(OBJEXT) \ + libstrace_a-sigreturn.$(OBJEXT) \ libstrace_a-socketcall.$(OBJEXT) libstrace_a-statfs.$(OBJEXT) \ libstrace_a-statfs64.$(OBJEXT) \ libstrace_a-sync_file_range.$(OBJEXT) \ libstrace_a-sync_file_range2.$(OBJEXT) \ libstrace_a-upeek.$(OBJEXT) libstrace_a-upoke.$(OBJEXT) libstrace_a_OBJECTS = $(am_libstrace_a_OBJECTS) -am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" \ - "$(DESTDIR)$(man1dir)" -PROGRAMS = $(bin_PROGRAMS) -am__strace_SOURCES_DIST = access.c affinity.c aio.c alpha.c bjm.c \ - block.c bpf.c btrfs.c cacheflush.c capability.c caps0.h \ - caps1.h chdir.c chmod.c clone.c copy_file_range.c count.c \ - defs.h desc.c dirent.c dirent64.c dm.c empty.h epoll.c evdev.c \ - eventfd.c execve.c fadvise.c fallocate.c fanotify.c fchownat.c \ - fcntl.c fetch_seccomp_fprog.c fetch_struct_flock.c \ - fetch_struct_mmsghdr.c fetch_struct_msghdr.c \ - fetch_struct_stat.c fetch_struct_stat64.c \ - fetch_struct_statfs.c file_handle.c file_ioctl.c fs_x_ioctl.c \ - flock.c flock.h futex.c gcc_compat.h get_robust_list.c \ - getcpu.c getcwd.c getrandom.c hdio.c hostname.c inotify.c io.c \ - ioctl.c ioperm.c iopl.c ioprio.c ipc_defs.h ipc_msg.c \ - ipc_msgctl.c ipc_sem.c ipc_shm.c ipc_shmctl.c kcmp.c \ - kernel_types.h kexec.c keyctl.c ldt.c link.c linux/asm_stat.h \ - linux/x32/asm_stat.h linux/x86_64/asm_stat.h lookup_dcookie.c \ - loop.c lseek.c mem.c membarrier.c memfd_create.c mknod.c \ - mmsghdr.c mount.c mpers_type.h mq.c msghdr.c msghdr.h mtd.c \ - native_defs.h net.c netlink.c nsig.h numa.c oldstat.c open.c \ - or1k_atomic.c pathtrace.c perf.c perf_event_struct.h \ - personality.c pkeys.c poll.c prctl.c print_dev_t.c \ - print_mq_attr.c print_msgbuf.c print_sg_req_info.c \ - print_sigevent.c print_statfs.c print_struct_stat.c \ - print_time.c print_timespec.c print_timeval.c print_timex.c \ - printmode.c printrusage.c printsiginfo.c printsiginfo.h \ - process.c process_vm.c ptp.c ptrace.h qualify.c quota.c \ - readahead.c readlink.c reboot.c regs.h renameat.c resource.c \ - rtc.c sched.c scsi.c seccomp.c seccomp_fprog.h sendfile.c \ - sg_io_v3.c sg_io_v4.c sigaltstack.c sigevent.h signal.c \ - signalfd.c sigreturn.c sock.c sockaddr.c socketutils.c \ - sram_alloc.c stat.c stat.h stat64.c statfs.c statfs.h strace.c \ - swapon.c syscall.c sysctl.c sysent.h sysinfo.c syslog.c \ - sysmips.c term.c time.c times.c truncate.c ubi.c uid.c uid16.c \ - umask.c umount.c uname.c userfaultfd.c ustat.c util.c utime.c \ - utimes.c v4l2.c wait.c xattr.c xlat.h xmalloc.c unwind.c -@USE_LIBUNWIND_TRUE@am__objects_3 = strace-unwind.$(OBJEXT) +am__strace_SOURCES_DIST = access.c affinity.c aio.c alpha.c \ + arch_defs.h basic_filters.c bind.c bjm.c block.c bpf.c \ + bpf_attr.h bpf_filter.c bpf_filter.h bpf_fprog.h \ + bpf_seccomp_filter.c bpf_sock_filter.c btrfs.c cacheflush.c \ + capability.c caps0.h caps1.h chdir.c chmod.c clone.c \ + copy_file_range.c count.c defs.h delay.c delay.h desc.c \ + dirent.c dirent64.c dm.c dyxlat.c empty.h epoll.c \ + error_prints.c error_prints.h evdev.c evdev_mpers.c eventfd.c \ + execve.c f_owner_ex.h fadvise.c fallocate.c fanotify.c \ + fchownat.c fcntl.c fetch_bpf_fprog.c fetch_struct_flock.c \ + fetch_struct_keyctl_kdf_params.c fetch_struct_mmsghdr.c \ + fetch_struct_msghdr.c fetch_struct_stat.c \ + fetch_struct_stat64.c fetch_struct_statfs.c \ + fetch_struct_xfs_quotastat.c file_handle.c file_ioctl.c \ + filter.h filter_qualify.c flock.c flock.h fs_x_ioctl.c futex.c \ + gcc_compat.h get_personality.c get_personality.h \ + get_robust_list.c getcpu.c getcwd.c getrandom.c hdio.c \ + hostname.c inotify.c inotify_ioctl.c io.c io_uring.c ioctl.c \ + ioperm.c iopl.c ioprio.c ipc_defs.h ipc_msg.c ipc_msgctl.c \ + ipc_sem.c ipc_shm.c ipc_shmctl.c kcmp.c kernel_timespec.h \ + kernel_timeval.h kernel_timex.h kernel_types.h kexec.c \ + keyctl.c keyctl_kdf_params.h kill_save_errno.h kvm.c \ + largefile_wrappers.h ldt.c link.c linux/asm_stat.h \ + linux/x32/asm_stat.h linux/x86_64/asm_stat.h list.h listen.c \ + lookup_dcookie.c loop.c lseek.c macros.h mem.c membarrier.c \ + memfd_create.c mknod.c mmap_notify.c mmap_notify.h mmsghdr.c \ + mount.c mpers_type.h mq.c msghdr.c msghdr.h mtd.c \ + native_defs.h nbd_ioctl.c negated_errno.h net.c netlink.c \ + netlink.h netlink_crypto.c netlink_inet_diag.c \ + netlink_kobject_uevent.c netlink_kobject_uevent.h \ + netlink_netfilter.c netlink_netlink_diag.c \ + netlink_packet_diag.c netlink_route.c netlink_route.h \ + netlink_selinux.c netlink_smc_diag.c netlink_sock_diag.c \ + netlink_sock_diag.h netlink_unix_diag.c nlattr.c nlattr.h \ + nsfs.c nsfs.h nsig.h numa.c number_set.c number_set.h \ + oldstat.c open.c or1k_atomic.c pathtrace.c perf.c \ + perf_event_struct.h perf_ioctl.c personality.c pkeys.c poll.c \ + prctl.c print_aio_sigset.c print_dev_t.c print_fields.h \ + print_group_req.c print_ifindex.c print_instruction_pointer.c \ + print_kernel_version.c print_mac.c print_mq_attr.c \ + print_msgbuf.c print_sg_req_info.c print_sigevent.c \ + print_statfs.c print_struct_stat.c print_time.c \ + print_timespec.c print_timespec.h print_timespec32.c \ + print_timespec64.c print_timeval.c print_timeval64.c \ + print_timex.c print_timex.h print_utils.h printmode.c \ + printrusage.c printsiginfo.c printsiginfo.h process.c \ + process_vm.c ptp.c ptrace.h ptrace_syscall_info.c \ + ptrace_syscall_info.h quota.c random_ioctl.c readahead.c \ + readlink.c reboot.c regs.h renameat.c resource.c retval.c \ + retval.h riscv.c rt_sigframe.c rt_sigreturn.c rtc.c \ + rtnl_addr.c rtnl_addrlabel.c rtnl_dcb.c rtnl_link.c rtnl_mdb.c \ + rtnl_neigh.c rtnl_neightbl.c rtnl_netconf.c rtnl_nsid.c \ + rtnl_route.c rtnl_rule.c rtnl_tc.c rtnl_tc_action.c s390.c \ + sched.c sched_attr.h scsi.c seccomp.c sendfile.c sg_io_v3.c \ + sg_io_v4.c shutdown.c sigaltstack.c sigevent.h signal.c \ + signalfd.c sock.c sockaddr.c socketutils.c sparc.c \ + sram_alloc.c stat.c stat.h stat64.c statfs.c statfs.h \ + static_assert.h statx.c statx.h strace.c string_to_uint.c \ + string_to_uint.h swapon.c syscall.c sysctl.c sysent.h \ + sysent_shorthand_defs.h sysent_shorthand_undefs.h sysinfo.c \ + syslog.c sysmips.c term.c time.c times.c trace_event.h \ + truncate.c ubi.c ucopy.c uid.c uid16.c umask.c umount.c \ + uname.c userfaultfd.c ustat.c util.c utime.c utimes.c v4l2.c \ + wait.c wait.h xattr.c xfs_quota_stat.h xlat.c xlat.h xmalloc.c \ + xmalloc.h xstring.h bpf_attr_check.c unwind.c unwind.h \ + unwind-libdw.c unwind-libunwind.c +am__objects_3 = strace-bpf_attr_check.$(OBJEXT) +@ENABLE_STACKTRACE_TRUE@am__objects_4 = strace-unwind.$(OBJEXT) +@ENABLE_STACKTRACE_TRUE@@USE_LIBDW_TRUE@am__objects_5 = strace-unwind-libdw.$(OBJEXT) +@ENABLE_STACKTRACE_TRUE@@USE_LIBUNWIND_TRUE@am__objects_6 = strace-unwind-libunwind.$(OBJEXT) am_strace_OBJECTS = strace-access.$(OBJEXT) strace-affinity.$(OBJEXT) \ strace-aio.$(OBJEXT) strace-alpha.$(OBJEXT) \ + strace-basic_filters.$(OBJEXT) strace-bind.$(OBJEXT) \ strace-bjm.$(OBJEXT) strace-block.$(OBJEXT) \ - strace-bpf.$(OBJEXT) strace-btrfs.$(OBJEXT) \ + strace-bpf.$(OBJEXT) strace-bpf_filter.$(OBJEXT) \ + strace-bpf_seccomp_filter.$(OBJEXT) \ + strace-bpf_sock_filter.$(OBJEXT) strace-btrfs.$(OBJEXT) \ strace-cacheflush.$(OBJEXT) strace-capability.$(OBJEXT) \ strace-chdir.$(OBJEXT) strace-chmod.$(OBJEXT) \ strace-clone.$(OBJEXT) strace-copy_file_range.$(OBJEXT) \ - strace-count.$(OBJEXT) strace-desc.$(OBJEXT) \ - strace-dirent.$(OBJEXT) strace-dirent64.$(OBJEXT) \ - strace-dm.$(OBJEXT) strace-epoll.$(OBJEXT) \ - strace-evdev.$(OBJEXT) strace-eventfd.$(OBJEXT) \ + strace-count.$(OBJEXT) strace-delay.$(OBJEXT) \ + strace-desc.$(OBJEXT) strace-dirent.$(OBJEXT) \ + strace-dirent64.$(OBJEXT) strace-dm.$(OBJEXT) \ + strace-dyxlat.$(OBJEXT) strace-epoll.$(OBJEXT) \ + strace-error_prints.$(OBJEXT) strace-evdev.$(OBJEXT) \ + strace-evdev_mpers.$(OBJEXT) strace-eventfd.$(OBJEXT) \ strace-execve.$(OBJEXT) strace-fadvise.$(OBJEXT) \ strace-fallocate.$(OBJEXT) strace-fanotify.$(OBJEXT) \ strace-fchownat.$(OBJEXT) strace-fcntl.$(OBJEXT) \ - strace-fetch_seccomp_fprog.$(OBJEXT) \ + strace-fetch_bpf_fprog.$(OBJEXT) \ strace-fetch_struct_flock.$(OBJEXT) \ + strace-fetch_struct_keyctl_kdf_params.$(OBJEXT) \ strace-fetch_struct_mmsghdr.$(OBJEXT) \ strace-fetch_struct_msghdr.$(OBJEXT) \ strace-fetch_struct_stat.$(OBJEXT) \ strace-fetch_struct_stat64.$(OBJEXT) \ strace-fetch_struct_statfs.$(OBJEXT) \ + strace-fetch_struct_xfs_quotastat.$(OBJEXT) \ strace-file_handle.$(OBJEXT) strace-file_ioctl.$(OBJEXT) \ - strace-fs_x_ioctl.$(OBJEXT) strace-flock.$(OBJEXT) \ - strace-futex.$(OBJEXT) strace-get_robust_list.$(OBJEXT) \ - strace-getcpu.$(OBJEXT) strace-getcwd.$(OBJEXT) \ - strace-getrandom.$(OBJEXT) strace-hdio.$(OBJEXT) \ - strace-hostname.$(OBJEXT) strace-inotify.$(OBJEXT) \ - strace-io.$(OBJEXT) strace-ioctl.$(OBJEXT) \ - strace-ioperm.$(OBJEXT) strace-iopl.$(OBJEXT) \ - strace-ioprio.$(OBJEXT) strace-ipc_msg.$(OBJEXT) \ - strace-ipc_msgctl.$(OBJEXT) strace-ipc_sem.$(OBJEXT) \ - strace-ipc_shm.$(OBJEXT) strace-ipc_shmctl.$(OBJEXT) \ - strace-kcmp.$(OBJEXT) strace-kexec.$(OBJEXT) \ - strace-keyctl.$(OBJEXT) strace-ldt.$(OBJEXT) \ - strace-link.$(OBJEXT) strace-lookup_dcookie.$(OBJEXT) \ - strace-loop.$(OBJEXT) strace-lseek.$(OBJEXT) \ - strace-mem.$(OBJEXT) strace-membarrier.$(OBJEXT) \ - strace-memfd_create.$(OBJEXT) strace-mknod.$(OBJEXT) \ + strace-filter_qualify.$(OBJEXT) strace-flock.$(OBJEXT) \ + strace-fs_x_ioctl.$(OBJEXT) strace-futex.$(OBJEXT) \ + strace-get_personality.$(OBJEXT) \ + strace-get_robust_list.$(OBJEXT) strace-getcpu.$(OBJEXT) \ + strace-getcwd.$(OBJEXT) strace-getrandom.$(OBJEXT) \ + strace-hdio.$(OBJEXT) strace-hostname.$(OBJEXT) \ + strace-inotify.$(OBJEXT) strace-inotify_ioctl.$(OBJEXT) \ + strace-io.$(OBJEXT) strace-io_uring.$(OBJEXT) \ + strace-ioctl.$(OBJEXT) strace-ioperm.$(OBJEXT) \ + strace-iopl.$(OBJEXT) strace-ioprio.$(OBJEXT) \ + strace-ipc_msg.$(OBJEXT) strace-ipc_msgctl.$(OBJEXT) \ + strace-ipc_sem.$(OBJEXT) strace-ipc_shm.$(OBJEXT) \ + strace-ipc_shmctl.$(OBJEXT) strace-kcmp.$(OBJEXT) \ + strace-kexec.$(OBJEXT) strace-keyctl.$(OBJEXT) \ + strace-kvm.$(OBJEXT) strace-ldt.$(OBJEXT) \ + strace-link.$(OBJEXT) strace-listen.$(OBJEXT) \ + strace-lookup_dcookie.$(OBJEXT) strace-loop.$(OBJEXT) \ + strace-lseek.$(OBJEXT) strace-mem.$(OBJEXT) \ + strace-membarrier.$(OBJEXT) strace-memfd_create.$(OBJEXT) \ + strace-mknod.$(OBJEXT) strace-mmap_notify.$(OBJEXT) \ strace-mmsghdr.$(OBJEXT) strace-mount.$(OBJEXT) \ strace-mq.$(OBJEXT) strace-msghdr.$(OBJEXT) \ - strace-mtd.$(OBJEXT) strace-net.$(OBJEXT) \ - strace-netlink.$(OBJEXT) strace-numa.$(OBJEXT) \ - strace-oldstat.$(OBJEXT) strace-open.$(OBJEXT) \ - strace-or1k_atomic.$(OBJEXT) strace-pathtrace.$(OBJEXT) \ - strace-perf.$(OBJEXT) strace-personality.$(OBJEXT) \ + strace-mtd.$(OBJEXT) strace-nbd_ioctl.$(OBJEXT) \ + strace-net.$(OBJEXT) strace-netlink.$(OBJEXT) \ + strace-netlink_crypto.$(OBJEXT) \ + strace-netlink_inet_diag.$(OBJEXT) \ + strace-netlink_kobject_uevent.$(OBJEXT) \ + strace-netlink_netfilter.$(OBJEXT) \ + strace-netlink_netlink_diag.$(OBJEXT) \ + strace-netlink_packet_diag.$(OBJEXT) \ + strace-netlink_route.$(OBJEXT) \ + strace-netlink_selinux.$(OBJEXT) \ + strace-netlink_smc_diag.$(OBJEXT) \ + strace-netlink_sock_diag.$(OBJEXT) \ + strace-netlink_unix_diag.$(OBJEXT) strace-nlattr.$(OBJEXT) \ + strace-nsfs.$(OBJEXT) strace-numa.$(OBJEXT) \ + strace-number_set.$(OBJEXT) strace-oldstat.$(OBJEXT) \ + strace-open.$(OBJEXT) strace-or1k_atomic.$(OBJEXT) \ + strace-pathtrace.$(OBJEXT) strace-perf.$(OBJEXT) \ + strace-perf_ioctl.$(OBJEXT) strace-personality.$(OBJEXT) \ strace-pkeys.$(OBJEXT) strace-poll.$(OBJEXT) \ - strace-prctl.$(OBJEXT) strace-print_dev_t.$(OBJEXT) \ - strace-print_mq_attr.$(OBJEXT) strace-print_msgbuf.$(OBJEXT) \ + strace-prctl.$(OBJEXT) strace-print_aio_sigset.$(OBJEXT) \ + strace-print_dev_t.$(OBJEXT) strace-print_group_req.$(OBJEXT) \ + strace-print_ifindex.$(OBJEXT) \ + strace-print_instruction_pointer.$(OBJEXT) \ + strace-print_kernel_version.$(OBJEXT) \ + strace-print_mac.$(OBJEXT) strace-print_mq_attr.$(OBJEXT) \ + strace-print_msgbuf.$(OBJEXT) \ strace-print_sg_req_info.$(OBJEXT) \ strace-print_sigevent.$(OBJEXT) strace-print_statfs.$(OBJEXT) \ strace-print_struct_stat.$(OBJEXT) strace-print_time.$(OBJEXT) \ - strace-print_timespec.$(OBJEXT) strace-print_timeval.$(OBJEXT) \ - strace-print_timex.$(OBJEXT) strace-printmode.$(OBJEXT) \ - strace-printrusage.$(OBJEXT) strace-printsiginfo.$(OBJEXT) \ - strace-process.$(OBJEXT) strace-process_vm.$(OBJEXT) \ - strace-ptp.$(OBJEXT) strace-qualify.$(OBJEXT) \ - strace-quota.$(OBJEXT) strace-readahead.$(OBJEXT) \ + strace-print_timespec.$(OBJEXT) \ + strace-print_timespec32.$(OBJEXT) \ + strace-print_timespec64.$(OBJEXT) \ + strace-print_timeval.$(OBJEXT) \ + strace-print_timeval64.$(OBJEXT) strace-print_timex.$(OBJEXT) \ + strace-printmode.$(OBJEXT) strace-printrusage.$(OBJEXT) \ + strace-printsiginfo.$(OBJEXT) strace-process.$(OBJEXT) \ + strace-process_vm.$(OBJEXT) strace-ptp.$(OBJEXT) \ + strace-ptrace_syscall_info.$(OBJEXT) strace-quota.$(OBJEXT) \ + strace-random_ioctl.$(OBJEXT) strace-readahead.$(OBJEXT) \ strace-readlink.$(OBJEXT) strace-reboot.$(OBJEXT) \ strace-renameat.$(OBJEXT) strace-resource.$(OBJEXT) \ - strace-rtc.$(OBJEXT) strace-sched.$(OBJEXT) \ + strace-retval.$(OBJEXT) strace-riscv.$(OBJEXT) \ + strace-rt_sigframe.$(OBJEXT) strace-rt_sigreturn.$(OBJEXT) \ + strace-rtc.$(OBJEXT) strace-rtnl_addr.$(OBJEXT) \ + strace-rtnl_addrlabel.$(OBJEXT) strace-rtnl_dcb.$(OBJEXT) \ + strace-rtnl_link.$(OBJEXT) strace-rtnl_mdb.$(OBJEXT) \ + strace-rtnl_neigh.$(OBJEXT) strace-rtnl_neightbl.$(OBJEXT) \ + strace-rtnl_netconf.$(OBJEXT) strace-rtnl_nsid.$(OBJEXT) \ + strace-rtnl_route.$(OBJEXT) strace-rtnl_rule.$(OBJEXT) \ + strace-rtnl_tc.$(OBJEXT) strace-rtnl_tc_action.$(OBJEXT) \ + strace-s390.$(OBJEXT) strace-sched.$(OBJEXT) \ strace-scsi.$(OBJEXT) strace-seccomp.$(OBJEXT) \ strace-sendfile.$(OBJEXT) strace-sg_io_v3.$(OBJEXT) \ - strace-sg_io_v4.$(OBJEXT) strace-sigaltstack.$(OBJEXT) \ - strace-signal.$(OBJEXT) strace-signalfd.$(OBJEXT) \ - strace-sigreturn.$(OBJEXT) strace-sock.$(OBJEXT) \ + strace-sg_io_v4.$(OBJEXT) strace-shutdown.$(OBJEXT) \ + strace-sigaltstack.$(OBJEXT) strace-signal.$(OBJEXT) \ + strace-signalfd.$(OBJEXT) strace-sock.$(OBJEXT) \ strace-sockaddr.$(OBJEXT) strace-socketutils.$(OBJEXT) \ - strace-sram_alloc.$(OBJEXT) strace-stat.$(OBJEXT) \ - strace-stat64.$(OBJEXT) strace-statfs.$(OBJEXT) \ - strace-strace.$(OBJEXT) strace-swapon.$(OBJEXT) \ - strace-syscall.$(OBJEXT) strace-sysctl.$(OBJEXT) \ - strace-sysinfo.$(OBJEXT) strace-syslog.$(OBJEXT) \ - strace-sysmips.$(OBJEXT) strace-term.$(OBJEXT) \ - strace-time.$(OBJEXT) strace-times.$(OBJEXT) \ - strace-truncate.$(OBJEXT) strace-ubi.$(OBJEXT) \ + strace-sparc.$(OBJEXT) strace-sram_alloc.$(OBJEXT) \ + strace-stat.$(OBJEXT) strace-stat64.$(OBJEXT) \ + strace-statfs.$(OBJEXT) strace-statx.$(OBJEXT) \ + strace-strace.$(OBJEXT) strace-string_to_uint.$(OBJEXT) \ + strace-swapon.$(OBJEXT) strace-syscall.$(OBJEXT) \ + strace-sysctl.$(OBJEXT) strace-sysinfo.$(OBJEXT) \ + strace-syslog.$(OBJEXT) strace-sysmips.$(OBJEXT) \ + strace-term.$(OBJEXT) strace-time.$(OBJEXT) \ + strace-times.$(OBJEXT) strace-truncate.$(OBJEXT) \ + strace-ubi.$(OBJEXT) strace-ucopy.$(OBJEXT) \ strace-uid.$(OBJEXT) strace-uid16.$(OBJEXT) \ strace-umask.$(OBJEXT) strace-umount.$(OBJEXT) \ strace-uname.$(OBJEXT) strace-userfaultfd.$(OBJEXT) \ strace-ustat.$(OBJEXT) strace-util.$(OBJEXT) \ strace-utime.$(OBJEXT) strace-utimes.$(OBJEXT) \ strace-v4l2.$(OBJEXT) strace-wait.$(OBJEXT) \ - strace-xattr.$(OBJEXT) strace-xmalloc.$(OBJEXT) \ - $(am__objects_3) + strace-xattr.$(OBJEXT) strace-xlat.$(OBJEXT) \ + strace-xmalloc.$(OBJEXT) $(am__objects_3) $(am__objects_4) \ + $(am__objects_5) $(am__objects_6) strace_OBJECTS = $(am_strace_OBJECTS) am__DEPENDENCIES_1 = -@USE_LIBUNWIND_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) -strace_DEPENDENCIES = libstrace.a $(am__DEPENDENCIES_2) \ - $(am__DEPENDENCIES_1) $(am__append_5) $(am__append_9) +@ENABLE_STACKTRACE_TRUE@@USE_LIBDW_TRUE@am__DEPENDENCIES_2 = \ +@ENABLE_STACKTRACE_TRUE@@USE_LIBDW_TRUE@ $(am__DEPENDENCIES_1) +@ENABLE_STACKTRACE_TRUE@@USE_LIBUNWIND_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) +@ENABLE_STACKTRACE_TRUE@@USE_DEMANGLE_TRUE@am__DEPENDENCIES_4 = $(am__DEPENDENCIES_1) +strace_DEPENDENCIES = libstrace.a $(am__DEPENDENCIES_1) \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ + $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_4) \ + $(am__DEPENDENCIES_1) $(am__append_14) $(am__append_18) strace_LINK = $(CCLD) $(strace_CFLAGS) $(CFLAGS) $(strace_LDFLAGS) \ $(LDFLAGS) -o $@ am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; @@ -448,7 +530,251 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/libmpers_m32_a-block.Po \ + ./$(DEPDIR)/libmpers_m32_a-btrfs.Po \ + ./$(DEPDIR)/libmpers_m32_a-dirent.Po \ + ./$(DEPDIR)/libmpers_m32_a-evdev_mpers.Po \ + ./$(DEPDIR)/libmpers_m32_a-fetch_bpf_fprog.Po \ + ./$(DEPDIR)/libmpers_m32_a-fetch_struct_flock.Po \ + ./$(DEPDIR)/libmpers_m32_a-fetch_struct_keyctl_kdf_params.Po \ + ./$(DEPDIR)/libmpers_m32_a-fetch_struct_mmsghdr.Po \ + ./$(DEPDIR)/libmpers_m32_a-fetch_struct_msghdr.Po \ + ./$(DEPDIR)/libmpers_m32_a-fetch_struct_stat.Po \ + ./$(DEPDIR)/libmpers_m32_a-fetch_struct_stat64.Po \ + ./$(DEPDIR)/libmpers_m32_a-fetch_struct_statfs.Po \ + ./$(DEPDIR)/libmpers_m32_a-fetch_struct_xfs_quotastat.Po \ + ./$(DEPDIR)/libmpers_m32_a-hdio.Po \ + ./$(DEPDIR)/libmpers_m32_a-ipc_msgctl.Po \ + ./$(DEPDIR)/libmpers_m32_a-ipc_shmctl.Po \ + ./$(DEPDIR)/libmpers_m32_a-loop.Po \ + ./$(DEPDIR)/libmpers_m32_a-mtd.Po \ + ./$(DEPDIR)/libmpers_m32_a-perf_ioctl.Po \ + ./$(DEPDIR)/libmpers_m32_a-print_aio_sigset.Po \ + ./$(DEPDIR)/libmpers_m32_a-print_group_req.Po \ + ./$(DEPDIR)/libmpers_m32_a-print_mq_attr.Po \ + ./$(DEPDIR)/libmpers_m32_a-print_msgbuf.Po \ + ./$(DEPDIR)/libmpers_m32_a-print_sg_req_info.Po \ + ./$(DEPDIR)/libmpers_m32_a-print_sigevent.Po \ + ./$(DEPDIR)/libmpers_m32_a-print_time.Po \ + ./$(DEPDIR)/libmpers_m32_a-print_timespec.Po \ + ./$(DEPDIR)/libmpers_m32_a-print_timeval.Po \ + ./$(DEPDIR)/libmpers_m32_a-printrusage.Po \ + ./$(DEPDIR)/libmpers_m32_a-printsiginfo.Po \ + ./$(DEPDIR)/libmpers_m32_a-rt_sigreturn.Po \ + ./$(DEPDIR)/libmpers_m32_a-rtc.Po \ + ./$(DEPDIR)/libmpers_m32_a-sg_io_v3.Po \ + ./$(DEPDIR)/libmpers_m32_a-sigaltstack.Po \ + ./$(DEPDIR)/libmpers_m32_a-sock.Po \ + ./$(DEPDIR)/libmpers_m32_a-sysinfo.Po \ + ./$(DEPDIR)/libmpers_m32_a-times.Po \ + ./$(DEPDIR)/libmpers_m32_a-ustat.Po \ + ./$(DEPDIR)/libmpers_m32_a-utime.Po \ + ./$(DEPDIR)/libmpers_m32_a-v4l2.Po \ + ./$(DEPDIR)/libmpers_mx32_a-block.Po \ + ./$(DEPDIR)/libmpers_mx32_a-btrfs.Po \ + ./$(DEPDIR)/libmpers_mx32_a-dirent.Po \ + ./$(DEPDIR)/libmpers_mx32_a-evdev_mpers.Po \ + ./$(DEPDIR)/libmpers_mx32_a-fetch_bpf_fprog.Po \ + ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_flock.Po \ + ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_keyctl_kdf_params.Po \ + ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_mmsghdr.Po \ + ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_msghdr.Po \ + ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_stat.Po \ + ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_stat64.Po \ + ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_statfs.Po \ + ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_xfs_quotastat.Po \ + ./$(DEPDIR)/libmpers_mx32_a-hdio.Po \ + ./$(DEPDIR)/libmpers_mx32_a-ipc_msgctl.Po \ + ./$(DEPDIR)/libmpers_mx32_a-ipc_shmctl.Po \ + ./$(DEPDIR)/libmpers_mx32_a-loop.Po \ + ./$(DEPDIR)/libmpers_mx32_a-mtd.Po \ + ./$(DEPDIR)/libmpers_mx32_a-perf_ioctl.Po \ + ./$(DEPDIR)/libmpers_mx32_a-print_aio_sigset.Po \ + ./$(DEPDIR)/libmpers_mx32_a-print_group_req.Po \ + ./$(DEPDIR)/libmpers_mx32_a-print_mq_attr.Po \ + ./$(DEPDIR)/libmpers_mx32_a-print_msgbuf.Po \ + ./$(DEPDIR)/libmpers_mx32_a-print_sg_req_info.Po \ + ./$(DEPDIR)/libmpers_mx32_a-print_sigevent.Po \ + ./$(DEPDIR)/libmpers_mx32_a-print_time.Po \ + ./$(DEPDIR)/libmpers_mx32_a-print_timespec.Po \ + ./$(DEPDIR)/libmpers_mx32_a-print_timeval.Po \ + ./$(DEPDIR)/libmpers_mx32_a-printrusage.Po \ + ./$(DEPDIR)/libmpers_mx32_a-printsiginfo.Po \ + ./$(DEPDIR)/libmpers_mx32_a-rt_sigreturn.Po \ + ./$(DEPDIR)/libmpers_mx32_a-rtc.Po \ + ./$(DEPDIR)/libmpers_mx32_a-sg_io_v3.Po \ + ./$(DEPDIR)/libmpers_mx32_a-sigaltstack.Po \ + ./$(DEPDIR)/libmpers_mx32_a-sock.Po \ + ./$(DEPDIR)/libmpers_mx32_a-sysinfo.Po \ + ./$(DEPDIR)/libmpers_mx32_a-times.Po \ + ./$(DEPDIR)/libmpers_mx32_a-ustat.Po \ + ./$(DEPDIR)/libmpers_mx32_a-utime.Po \ + ./$(DEPDIR)/libmpers_mx32_a-v4l2.Po \ + ./$(DEPDIR)/libstrace_a-fetch_indirect_syscall_args.Po \ + ./$(DEPDIR)/libstrace_a-fstatfs.Po \ + ./$(DEPDIR)/libstrace_a-fstatfs64.Po \ + ./$(DEPDIR)/libstrace_a-getpagesize.Po \ + ./$(DEPDIR)/libstrace_a-ipc.Po \ + ./$(DEPDIR)/libstrace_a-mmap_cache.Po \ + ./$(DEPDIR)/libstrace_a-sigreturn.Po \ + ./$(DEPDIR)/libstrace_a-socketcall.Po \ + ./$(DEPDIR)/libstrace_a-statfs.Po \ + ./$(DEPDIR)/libstrace_a-statfs64.Po \ + ./$(DEPDIR)/libstrace_a-sync_file_range.Po \ + ./$(DEPDIR)/libstrace_a-sync_file_range2.Po \ + ./$(DEPDIR)/libstrace_a-upeek.Po \ + ./$(DEPDIR)/libstrace_a-upoke.Po ./$(DEPDIR)/strace-access.Po \ + ./$(DEPDIR)/strace-affinity.Po ./$(DEPDIR)/strace-aio.Po \ + ./$(DEPDIR)/strace-alpha.Po \ + ./$(DEPDIR)/strace-basic_filters.Po ./$(DEPDIR)/strace-bind.Po \ + ./$(DEPDIR)/strace-bjm.Po ./$(DEPDIR)/strace-block.Po \ + ./$(DEPDIR)/strace-bpf.Po ./$(DEPDIR)/strace-bpf_attr_check.Po \ + ./$(DEPDIR)/strace-bpf_filter.Po \ + ./$(DEPDIR)/strace-bpf_seccomp_filter.Po \ + ./$(DEPDIR)/strace-bpf_sock_filter.Po \ + ./$(DEPDIR)/strace-btrfs.Po ./$(DEPDIR)/strace-cacheflush.Po \ + ./$(DEPDIR)/strace-capability.Po ./$(DEPDIR)/strace-chdir.Po \ + ./$(DEPDIR)/strace-chmod.Po ./$(DEPDIR)/strace-clone.Po \ + ./$(DEPDIR)/strace-copy_file_range.Po \ + ./$(DEPDIR)/strace-count.Po ./$(DEPDIR)/strace-delay.Po \ + ./$(DEPDIR)/strace-desc.Po ./$(DEPDIR)/strace-dirent.Po \ + ./$(DEPDIR)/strace-dirent64.Po ./$(DEPDIR)/strace-dm.Po \ + ./$(DEPDIR)/strace-dyxlat.Po ./$(DEPDIR)/strace-epoll.Po \ + ./$(DEPDIR)/strace-error_prints.Po ./$(DEPDIR)/strace-evdev.Po \ + ./$(DEPDIR)/strace-evdev_mpers.Po \ + ./$(DEPDIR)/strace-eventfd.Po ./$(DEPDIR)/strace-execve.Po \ + ./$(DEPDIR)/strace-fadvise.Po ./$(DEPDIR)/strace-fallocate.Po \ + ./$(DEPDIR)/strace-fanotify.Po ./$(DEPDIR)/strace-fchownat.Po \ + ./$(DEPDIR)/strace-fcntl.Po \ + ./$(DEPDIR)/strace-fetch_bpf_fprog.Po \ + ./$(DEPDIR)/strace-fetch_struct_flock.Po \ + ./$(DEPDIR)/strace-fetch_struct_keyctl_kdf_params.Po \ + ./$(DEPDIR)/strace-fetch_struct_mmsghdr.Po \ + ./$(DEPDIR)/strace-fetch_struct_msghdr.Po \ + ./$(DEPDIR)/strace-fetch_struct_stat.Po \ + ./$(DEPDIR)/strace-fetch_struct_stat64.Po \ + ./$(DEPDIR)/strace-fetch_struct_statfs.Po \ + ./$(DEPDIR)/strace-fetch_struct_xfs_quotastat.Po \ + ./$(DEPDIR)/strace-file_handle.Po \ + ./$(DEPDIR)/strace-file_ioctl.Po \ + ./$(DEPDIR)/strace-filter_qualify.Po \ + ./$(DEPDIR)/strace-flock.Po ./$(DEPDIR)/strace-fs_x_ioctl.Po \ + ./$(DEPDIR)/strace-futex.Po \ + ./$(DEPDIR)/strace-get_personality.Po \ + ./$(DEPDIR)/strace-get_robust_list.Po \ + ./$(DEPDIR)/strace-getcpu.Po ./$(DEPDIR)/strace-getcwd.Po \ + ./$(DEPDIR)/strace-getrandom.Po ./$(DEPDIR)/strace-hdio.Po \ + ./$(DEPDIR)/strace-hostname.Po ./$(DEPDIR)/strace-inotify.Po \ + ./$(DEPDIR)/strace-inotify_ioctl.Po ./$(DEPDIR)/strace-io.Po \ + ./$(DEPDIR)/strace-io_uring.Po ./$(DEPDIR)/strace-ioctl.Po \ + ./$(DEPDIR)/strace-ioperm.Po ./$(DEPDIR)/strace-iopl.Po \ + ./$(DEPDIR)/strace-ioprio.Po ./$(DEPDIR)/strace-ipc_msg.Po \ + ./$(DEPDIR)/strace-ipc_msgctl.Po ./$(DEPDIR)/strace-ipc_sem.Po \ + ./$(DEPDIR)/strace-ipc_shm.Po ./$(DEPDIR)/strace-ipc_shmctl.Po \ + ./$(DEPDIR)/strace-kcmp.Po ./$(DEPDIR)/strace-kexec.Po \ + ./$(DEPDIR)/strace-keyctl.Po ./$(DEPDIR)/strace-kvm.Po \ + ./$(DEPDIR)/strace-ldt.Po ./$(DEPDIR)/strace-link.Po \ + ./$(DEPDIR)/strace-listen.Po \ + ./$(DEPDIR)/strace-lookup_dcookie.Po \ + ./$(DEPDIR)/strace-loop.Po ./$(DEPDIR)/strace-lseek.Po \ + ./$(DEPDIR)/strace-mem.Po ./$(DEPDIR)/strace-membarrier.Po \ + ./$(DEPDIR)/strace-memfd_create.Po ./$(DEPDIR)/strace-mknod.Po \ + ./$(DEPDIR)/strace-mmap_notify.Po \ + ./$(DEPDIR)/strace-mmsghdr.Po ./$(DEPDIR)/strace-mount.Po \ + ./$(DEPDIR)/strace-mq.Po ./$(DEPDIR)/strace-msghdr.Po \ + ./$(DEPDIR)/strace-mtd.Po ./$(DEPDIR)/strace-nbd_ioctl.Po \ + ./$(DEPDIR)/strace-net.Po ./$(DEPDIR)/strace-netlink.Po \ + ./$(DEPDIR)/strace-netlink_crypto.Po \ + ./$(DEPDIR)/strace-netlink_inet_diag.Po \ + ./$(DEPDIR)/strace-netlink_kobject_uevent.Po \ + ./$(DEPDIR)/strace-netlink_netfilter.Po \ + ./$(DEPDIR)/strace-netlink_netlink_diag.Po \ + ./$(DEPDIR)/strace-netlink_packet_diag.Po \ + ./$(DEPDIR)/strace-netlink_route.Po \ + ./$(DEPDIR)/strace-netlink_selinux.Po \ + ./$(DEPDIR)/strace-netlink_smc_diag.Po \ + ./$(DEPDIR)/strace-netlink_sock_diag.Po \ + ./$(DEPDIR)/strace-netlink_unix_diag.Po \ + ./$(DEPDIR)/strace-nlattr.Po ./$(DEPDIR)/strace-nsfs.Po \ + ./$(DEPDIR)/strace-numa.Po ./$(DEPDIR)/strace-number_set.Po \ + ./$(DEPDIR)/strace-oldstat.Po ./$(DEPDIR)/strace-open.Po \ + ./$(DEPDIR)/strace-or1k_atomic.Po \ + ./$(DEPDIR)/strace-pathtrace.Po ./$(DEPDIR)/strace-perf.Po \ + ./$(DEPDIR)/strace-perf_ioctl.Po \ + ./$(DEPDIR)/strace-personality.Po ./$(DEPDIR)/strace-pkeys.Po \ + ./$(DEPDIR)/strace-poll.Po ./$(DEPDIR)/strace-prctl.Po \ + ./$(DEPDIR)/strace-print_aio_sigset.Po \ + ./$(DEPDIR)/strace-print_dev_t.Po \ + ./$(DEPDIR)/strace-print_group_req.Po \ + ./$(DEPDIR)/strace-print_ifindex.Po \ + ./$(DEPDIR)/strace-print_instruction_pointer.Po \ + ./$(DEPDIR)/strace-print_kernel_version.Po \ + ./$(DEPDIR)/strace-print_mac.Po \ + ./$(DEPDIR)/strace-print_mq_attr.Po \ + ./$(DEPDIR)/strace-print_msgbuf.Po \ + ./$(DEPDIR)/strace-print_sg_req_info.Po \ + ./$(DEPDIR)/strace-print_sigevent.Po \ + ./$(DEPDIR)/strace-print_statfs.Po \ + ./$(DEPDIR)/strace-print_struct_stat.Po \ + ./$(DEPDIR)/strace-print_time.Po \ + ./$(DEPDIR)/strace-print_timespec.Po \ + ./$(DEPDIR)/strace-print_timespec32.Po \ + ./$(DEPDIR)/strace-print_timespec64.Po \ + ./$(DEPDIR)/strace-print_timeval.Po \ + ./$(DEPDIR)/strace-print_timeval64.Po \ + ./$(DEPDIR)/strace-print_timex.Po \ + ./$(DEPDIR)/strace-printmode.Po \ + ./$(DEPDIR)/strace-printrusage.Po \ + ./$(DEPDIR)/strace-printsiginfo.Po \ + ./$(DEPDIR)/strace-process.Po ./$(DEPDIR)/strace-process_vm.Po \ + ./$(DEPDIR)/strace-ptp.Po \ + ./$(DEPDIR)/strace-ptrace_syscall_info.Po \ + ./$(DEPDIR)/strace-quota.Po ./$(DEPDIR)/strace-random_ioctl.Po \ + ./$(DEPDIR)/strace-readahead.Po ./$(DEPDIR)/strace-readlink.Po \ + ./$(DEPDIR)/strace-reboot.Po ./$(DEPDIR)/strace-renameat.Po \ + ./$(DEPDIR)/strace-resource.Po ./$(DEPDIR)/strace-retval.Po \ + ./$(DEPDIR)/strace-riscv.Po ./$(DEPDIR)/strace-rt_sigframe.Po \ + ./$(DEPDIR)/strace-rt_sigreturn.Po ./$(DEPDIR)/strace-rtc.Po \ + ./$(DEPDIR)/strace-rtnl_addr.Po \ + ./$(DEPDIR)/strace-rtnl_addrlabel.Po \ + ./$(DEPDIR)/strace-rtnl_dcb.Po ./$(DEPDIR)/strace-rtnl_link.Po \ + ./$(DEPDIR)/strace-rtnl_mdb.Po \ + ./$(DEPDIR)/strace-rtnl_neigh.Po \ + ./$(DEPDIR)/strace-rtnl_neightbl.Po \ + ./$(DEPDIR)/strace-rtnl_netconf.Po \ + ./$(DEPDIR)/strace-rtnl_nsid.Po \ + ./$(DEPDIR)/strace-rtnl_route.Po \ + ./$(DEPDIR)/strace-rtnl_rule.Po ./$(DEPDIR)/strace-rtnl_tc.Po \ + ./$(DEPDIR)/strace-rtnl_tc_action.Po \ + ./$(DEPDIR)/strace-s390.Po ./$(DEPDIR)/strace-sched.Po \ + ./$(DEPDIR)/strace-scsi.Po ./$(DEPDIR)/strace-seccomp.Po \ + ./$(DEPDIR)/strace-sendfile.Po ./$(DEPDIR)/strace-sg_io_v3.Po \ + ./$(DEPDIR)/strace-sg_io_v4.Po ./$(DEPDIR)/strace-shutdown.Po \ + ./$(DEPDIR)/strace-sigaltstack.Po ./$(DEPDIR)/strace-signal.Po \ + ./$(DEPDIR)/strace-signalfd.Po ./$(DEPDIR)/strace-sock.Po \ + ./$(DEPDIR)/strace-sockaddr.Po \ + ./$(DEPDIR)/strace-socketutils.Po ./$(DEPDIR)/strace-sparc.Po \ + ./$(DEPDIR)/strace-sram_alloc.Po ./$(DEPDIR)/strace-stat.Po \ + ./$(DEPDIR)/strace-stat64.Po ./$(DEPDIR)/strace-statfs.Po \ + ./$(DEPDIR)/strace-statx.Po ./$(DEPDIR)/strace-strace.Po \ + ./$(DEPDIR)/strace-string_to_uint.Po \ + ./$(DEPDIR)/strace-swapon.Po ./$(DEPDIR)/strace-syscall.Po \ + ./$(DEPDIR)/strace-sysctl.Po ./$(DEPDIR)/strace-sysinfo.Po \ + ./$(DEPDIR)/strace-syslog.Po ./$(DEPDIR)/strace-sysmips.Po \ + ./$(DEPDIR)/strace-term.Po ./$(DEPDIR)/strace-time.Po \ + ./$(DEPDIR)/strace-times.Po ./$(DEPDIR)/strace-truncate.Po \ + ./$(DEPDIR)/strace-ubi.Po ./$(DEPDIR)/strace-ucopy.Po \ + ./$(DEPDIR)/strace-uid.Po ./$(DEPDIR)/strace-uid16.Po \ + ./$(DEPDIR)/strace-umask.Po ./$(DEPDIR)/strace-umount.Po \ + ./$(DEPDIR)/strace-uname.Po ./$(DEPDIR)/strace-unwind-libdw.Po \ + ./$(DEPDIR)/strace-unwind-libunwind.Po \ + ./$(DEPDIR)/strace-unwind.Po ./$(DEPDIR)/strace-userfaultfd.Po \ + ./$(DEPDIR)/strace-ustat.Po ./$(DEPDIR)/strace-util.Po \ + ./$(DEPDIR)/strace-utime.Po ./$(DEPDIR)/strace-utimes.Po \ + ./$(DEPDIR)/strace-v4l2.Po ./$(DEPDIR)/strace-wait.Po \ + ./$(DEPDIR)/strace-xattr.Po ./$(DEPDIR)/strace-xlat.Po \ + ./$(DEPDIR)/strace-xmalloc.Po am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -494,8 +820,11 @@ am__recursive_targets = \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ - cscope distdir dist dist-all distcheck -am__extra_recursive_targets = check-valgrind-recursive + cscope distdir distdir-am dist dist-all distcheck +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config.h.in # Read a list of newline-separated strings from the standard input, @@ -517,7 +846,14 @@ am__define_uniq_tagged_files = \ ETAGS = etags CTAGS = ctags CSCOPE = cscope -DIST_SUBDIRS = tests tests-m32 tests-mx32 +DIST_SUBDIRS = . tests tests-m32 tests-mx32 +am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(srcdir)/mpers.am $(srcdir)/scno.am \ + $(srcdir)/strace-log-merge.1.in $(srcdir)/strace.1.in \ + $(srcdir)/strace.spec.in $(srcdir)/xlat/Makemodule.am \ + $(top_srcdir)/debian/changelog.in AUTHORS COPYING INSTALL NEWS \ + README compile config.guess config.sub depcomp install-sh \ + missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) @@ -579,6 +915,8 @@ CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ +COPYRIGHT_YEAR = @COPYRIGHT_YEAR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ @@ -612,6 +950,7 @@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANPAGE_DATE = @MANPAGE_DATE@ MIPS_ABI = @MIPS_ABI@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ @@ -625,10 +964,13 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ +READELF = @READELF@ RPM_CHANGELOGTIME = @RPM_CHANGELOGTIME@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIZEOF_KERNEL_LONG_T = @SIZEOF_KERNEL_LONG_T@ +SIZEOF_LONG = @SIZEOF_LONG@ STRIP = @STRIP@ VALGRIND = @VALGRIND@ VALGRIND_ENABLED = @VALGRIND_ENABLED@ @@ -649,6 +991,7 @@ am__untar = @am__untar@ arch = @arch@ arch_m32 = @arch_m32@ arch_mx32 = @arch_mx32@ +arch_native = @arch_native@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -656,6 +999,9 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +cc_flags_m32 = @cc_flags_m32@ +cc_flags_mx32 = @cc_flags_mx32@ +clock_LIBS = @clock_LIBS@ datadir = @datadir@ datarootdir = @datarootdir@ dl_LIBS = @dl_LIBS@ @@ -672,7 +1018,14 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ +libdw_CFLAGS = @libdw_CFLAGS@ +libdw_CPPFLAGS = @libdw_CPPFLAGS@ +libdw_LDFLAGS = @libdw_LDFLAGS@ +libdw_LIBS = @libdw_LIBS@ libexecdir = @libexecdir@ +libiberty_CPPFLAGS = @libiberty_CPPFLAGS@ +libiberty_LDFLAGS = @libiberty_LDFLAGS@ +libiberty_LIBS = @libiberty_LIBS@ libunwind_CPPFLAGS = @libunwind_CPPFLAGS@ libunwind_LDFLAGS = @libunwind_LDFLAGS@ libunwind_LIBS = @libunwind_LIBS@ @@ -680,6 +1033,7 @@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ +mq_LIBS = @mq_LIBS@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ @@ -690,6 +1044,7 @@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +timer_LIBS = @timer_LIBS@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @@ -697,8 +1052,8 @@ valgrind_enabled_tools = @valgrind_enabled_tools@ valgrind_tools = @valgrind_tools@ @HAVE_M32_RUNTIME_TRUE@TESTS_M32 = tests-m32 @HAVE_MX32_RUNTIME_TRUE@TESTS_MX32 = tests-mx32 -SUBDIRS = tests $(TESTS_M32) $(TESTS_MX32) -man_MANS = strace.1 +SUBDIRS = . tests $(TESTS_M32) $(TESTS_MX32) +man_MANS = strace.1 strace-log-merge.1 bin_SCRIPTS = strace-graph strace-log-merge OS = linux # ARCH is `i386', `m68k', `sparc', etc. @@ -714,39 +1069,52 @@ AM_CPPFLAGS = -I$(builddir)/$(OS)/$(ARCH) \ AM_CFLAGS_FOR_BUILD = $(WARN_CFLAGS_FOR_BUILD) AM_CPPFLAGS_FOR_BUILD = $(AM_CPPFLAGS) -XLAT_INPUT_FILES = xlat/access_flags.in xlat/aclipc.in \ - xlat/addrfams.in xlat/adjtimex_modes.in xlat/adjtimex_state.in \ +XLAT_INPUT_FILES = xlat/access_flags.in xlat/addrfams.in \ + xlat/adjtimex_modes.in xlat/adjtimex_state.in \ xlat/adjtimex_status.in xlat/advise.in xlat/af_packet_types.in \ - xlat/archvals.in xlat/arp_hardware_types.in xlat/at_flags.in \ - xlat/atomic_ops.in xlat/audit_arch.in xlat/baud_options.in \ - xlat/blkpg_ops.in xlat/bootflags1.in xlat/bootflags2.in \ - xlat/bootflags3.in xlat/bpf_attach_type.in xlat/bpf_class.in \ - xlat/bpf_commands.in xlat/bpf_map_types.in \ - xlat/bpf_map_update_elem_flags.in xlat/bpf_miscop.in \ - xlat/bpf_mode.in xlat/bpf_op_alu.in xlat/bpf_op_jmp.in \ - xlat/bpf_prog_types.in xlat/bpf_rval.in xlat/bpf_size.in \ - xlat/bpf_src.in xlat/bsg_flags.in xlat/bsg_protocol.in \ - xlat/bsg_subprotocol.in xlat/bt_protocols.in \ - xlat/btrfs_balance_args.in xlat/btrfs_balance_ctl_cmds.in \ - xlat/btrfs_balance_flags.in xlat/btrfs_balance_state.in \ - xlat/btrfs_compress_types.in xlat/btrfs_defrag_flags.in \ - xlat/btrfs_dev_replace_cmds.in \ + xlat/af_packet_versions.in xlat/aio_cmds.in xlat/archvals.in \ + xlat/arp_hardware_types.in xlat/at_flags.in \ + xlat/at_statx_sync_types.in xlat/atomic_ops.in \ + xlat/audit_arch.in xlat/ax25_protocols.in xlat/baud_options.in \ + xlat/bdaddr_types.in xlat/blkpg_ops.in \ + xlat/block_ioctl_cmds.in xlat/bluetooth_l2_cid.in \ + xlat/bluetooth_l2_psm.in xlat/bootflags1.in xlat/bootflags2.in \ + xlat/bootflags3.in xlat/bpf_attach_flags.in \ + xlat/bpf_attach_type.in xlat/bpf_class.in xlat/bpf_commands.in \ + xlat/bpf_file_mode_flags.in xlat/bpf_map_flags.in \ + xlat/bpf_map_types.in xlat/bpf_map_update_elem_flags.in \ + xlat/bpf_miscop.in xlat/bpf_mode.in xlat/bpf_op_alu.in \ + xlat/bpf_op_jmp.in xlat/bpf_prog_flags.in \ + xlat/bpf_prog_types.in xlat/bpf_query_flags.in \ + xlat/bpf_rval.in xlat/bpf_size.in xlat/bpf_src.in \ + xlat/bpf_task_fd_type.in xlat/bsg_flags.in \ + xlat/bsg_protocol.in xlat/bsg_subprotocol.in \ + xlat/bt_protocols.in xlat/btrfs_balance_args.in \ + xlat/btrfs_balance_ctl_cmds.in xlat/btrfs_balance_flags.in \ + xlat/btrfs_balance_state.in xlat/btrfs_compress_types.in \ + xlat/btrfs_cont_reading_from_srcdev_mode.in \ + xlat/btrfs_defrag_flags.in xlat/btrfs_dev_replace_cmds.in \ xlat/btrfs_dev_replace_results.in \ xlat/btrfs_dev_replace_state.in xlat/btrfs_dev_stats_flags.in \ xlat/btrfs_dev_stats_values.in xlat/btrfs_features_compat.in \ xlat/btrfs_features_compat_ro.in \ xlat/btrfs_features_incompat.in xlat/btrfs_key_types.in \ + xlat/btrfs_logical_ino_args_flags.in \ xlat/btrfs_qgroup_ctl_cmds.in \ xlat/btrfs_qgroup_inherit_flags.in \ xlat/btrfs_qgroup_limit_flags.in \ xlat/btrfs_qgroup_status_flags.in xlat/btrfs_scrub_flags.in \ xlat/btrfs_send_flags.in xlat/btrfs_snap_flags_v2.in \ xlat/btrfs_space_info_flags.in xlat/btrfs_tree_objectids.in \ - xlat/cacheflush_scope.in xlat/cap.in xlat/cap_mask0.in \ + xlat/cacheflush_scope.in xlat/caif_protocols.in \ + xlat/can_protocols.in xlat/cap.in xlat/cap_mask0.in \ xlat/cap_mask1.in xlat/cap_version.in xlat/clockflags.in \ xlat/clocknames.in xlat/clone_flags.in xlat/cpuclocknames.in \ + xlat/crypto_nl_attrs.in xlat/dcb_commands.in \ xlat/delete_module_flags.in xlat/dirent_types.in \ - xlat/dm_flags.in xlat/efd_flags.in xlat/epollctls.in \ + xlat/dm_flags.in xlat/ebpf_class.in xlat/ebpf_mode.in \ + xlat/ebpf_op_alu.in xlat/ebpf_op_jmp.in xlat/ebpf_regs.in \ + xlat/ebpf_size.in xlat/efd_flags.in xlat/epollctls.in \ xlat/epollevents.in xlat/epollflags.in \ xlat/ethernet_protocols.in xlat/evdev_abs.in \ xlat/evdev_autorepeat.in xlat/evdev_ev.in \ @@ -754,255 +1122,453 @@ XLAT_INPUT_FILES = xlat/access_flags.in xlat/aclipc.in \ xlat/evdev_keycode.in xlat/evdev_leds.in xlat/evdev_misc.in \ xlat/evdev_mtslots.in xlat/evdev_prop.in \ xlat/evdev_relative_axes.in xlat/evdev_snd.in \ - xlat/evdev_switch.in xlat/evdev_sync.in xlat/f_owner_types.in \ - xlat/f_seals.in xlat/falloc_flags.in xlat/fan_classes.in \ + xlat/evdev_switch.in xlat/f_owner_types.in xlat/f_seals.in \ + xlat/falloc_flags.in xlat/fan_classes.in \ xlat/fan_event_flags.in xlat/fan_init_flags.in \ - xlat/fan_mark_flags.in xlat/fcntl64cmds.in xlat/fcntlcmds.in \ - xlat/fdflags.in xlat/fiemap_extent_flags.in \ - xlat/fiemap_flags.in xlat/flockcmds.in xlat/fsmagic.in \ + xlat/fan_mark_flags.in xlat/fcntlcmds.in xlat/fdflags.in \ + xlat/fib_rule_actions.in xlat/fib_rule_flags.in \ + xlat/fiemap_extent_flags.in xlat/fiemap_flags.in \ + xlat/flockcmds.in xlat/fsmagic.in xlat/futexbitset.in \ xlat/futexops.in xlat/futexwakecmps.in xlat/futexwakeops.in \ - xlat/getrandom_flags.in xlat/getsockipoptions.in \ - xlat/getsockipv6options.in xlat/hci_channels.in \ - xlat/hw_breakpoint_len.in xlat/hw_breakpoint_type.in \ - xlat/icmpfilterflags.in xlat/if_dqblk_valid.in \ - xlat/if_dqinfo_flags.in xlat/if_dqinfo_valid.in \ - xlat/iffflags.in xlat/inet_protocols.in xlat/inotify_flags.in \ + xlat/getrandom_flags.in xlat/getsock_ip_options.in \ + xlat/getsock_ipv6_options.in xlat/getsock_options.in \ + xlat/hci_channels.in xlat/hw_breakpoint_len.in \ + xlat/hw_breakpoint_type.in xlat/icmpfilterflags.in \ + xlat/if_dqblk_valid.in xlat/if_dqinfo_flags.in \ + xlat/if_dqinfo_valid.in xlat/ifaddrflags.in xlat/iffflags.in \ + xlat/in6_addr_gen_mode.in xlat/inet6_devconf_indices.in \ + xlat/inet6_if_flags.in xlat/inet_devconf_indices.in \ + xlat/inet_diag_attrs.in xlat/inet_diag_bytecodes.in \ + xlat/inet_diag_extended_flags.in xlat/inet_diag_req_attrs.in \ + xlat/inet_protocols.in xlat/inotify_flags.in \ xlat/inotify_init_flags.in xlat/ioctl_dirs.in \ xlat/ioprio_class.in xlat/ioprio_who.in xlat/ip_cmsg_types.in \ - xlat/ipc_msg_flags.in xlat/ipccalls.in xlat/itimer_which.in \ - xlat/kcmp_types.in xlat/kexec_arch_values.in \ - xlat/kexec_file_load_flags.in xlat/kexec_load_flags.in \ - xlat/key_perms.in xlat/key_reqkeys.in xlat/key_spec.in \ - xlat/keyctl_commands.in xlat/lockfcmds.in xlat/loop_cmds.in \ + xlat/ip_type_of_services.in xlat/ipc_msg_flags.in \ + xlat/ipc_private.in xlat/ipccalls.in xlat/irda_protocols.in \ + xlat/isdn_protocols.in xlat/itimer_which.in \ + xlat/kcm_protocols.in xlat/kcmp_types.in \ + xlat/kexec_arch_values.in xlat/kexec_file_load_flags.in \ + xlat/kexec_load_flags.in xlat/key_perms.in xlat/key_reqkeys.in \ + xlat/key_spec.in xlat/keyctl_commands.in xlat/kvm_cap.in \ + xlat/kvm_cpuid_flags.in xlat/kvm_exit_reason.in \ + xlat/kvm_mem_flags.in xlat/lockfcmds.in xlat/loop_cmds.in \ xlat/loop_crypt_type_options.in xlat/loop_flags_options.in \ - xlat/madvise_cmds.in xlat/mbindflags.in xlat/mctl_sync.in \ - xlat/membarrier_cmds.in xlat/memfd_create_flags.in \ - xlat/mempolicyflags.in xlat/mlock_flags.in \ - xlat/mlockall_flags.in xlat/mmap_flags.in xlat/mmap_prot.in \ - xlat/modem_flags.in xlat/modetypes.in \ + xlat/lwtunnel_encap_types.in xlat/madvise_cmds.in \ + xlat/mbindflags.in xlat/mctl_sync.in xlat/mdb_flags.in \ + xlat/mdb_states.in xlat/membarrier_cmds.in \ + xlat/memfd_create_flags.in xlat/mempolicyflags.in \ + xlat/mlock_flags.in xlat/mlockall_flags.in xlat/mmap_flags.in \ + xlat/mmap_prot.in xlat/modem_flags.in xlat/modetypes.in \ xlat/module_init_flags.in xlat/mount_flags.in \ xlat/move_pages_flags.in xlat/mq_attr_flags.in \ xlat/mremap_flags.in xlat/msg_flags.in xlat/msgctl_flags.in \ xlat/mtd_file_mode_options.in xlat/mtd_flags_options.in \ xlat/mtd_mode_options.in xlat/mtd_nandecc_options.in \ xlat/mtd_otp_options.in xlat/mtd_type_options.in \ - xlat/name_to_handle_at_flags.in xlat/netlink_flags.in \ - xlat/netlink_protocols.in xlat/netlink_types.in \ + xlat/multicast_router_types.in xlat/name_to_handle_at_flags.in \ + xlat/nbd_ioctl_cmds.in xlat/nbd_ioctl_flags.in \ + xlat/neighbor_cache_entry_flags.in \ + xlat/neighbor_cache_entry_states.in xlat/netfilter_versions.in \ + xlat/netlink_ack_flags.in xlat/netlink_delete_flags.in \ + xlat/netlink_diag_attrs.in xlat/netlink_diag_show.in \ + xlat/netlink_flags.in xlat/netlink_get_flags.in \ + xlat/netlink_new_flags.in xlat/netlink_protocols.in \ + xlat/netlink_sk_meminfo_indices.in \ + xlat/netlink_socket_flags.in xlat/netlink_states.in \ + xlat/netlink_types.in xlat/nf_acct_msg_types.in \ + xlat/nf_cthelper_msg_types.in \ + xlat/nf_ctnetlink_exp_msg_types.in \ + xlat/nf_ctnetlink_msg_types.in xlat/nf_cttimeout_msg_types.in \ + xlat/nf_ipset_msg_types.in xlat/nf_nft_compat_msg_types.in \ + xlat/nf_nftables_msg_types.in xlat/nf_osf_msg_types.in \ + xlat/nf_queue_msg_types.in xlat/nf_ulog_msg_types.in \ + xlat/nfc_protocols.in xlat/nl_audit_types.in \ + xlat/nl_crypto_types.in xlat/nl_netfilter_msg_types.in \ + xlat/nl_netfilter_subsys_ids.in xlat/nl_route_types.in \ + xlat/nl_selinux_types.in xlat/nl_sock_diag_types.in \ + xlat/nl_xfrm_types.in xlat/nlmsgerr_attrs.in \ xlat/notifyflags.in xlat/nt_descriptor_types.in \ - xlat/open_access_modes.in xlat/open_mode_flags.in \ - xlat/openmodessol.in xlat/packet_mreq_type.in \ - xlat/perf_attr_size.in xlat/perf_branch_sample_type.in \ - xlat/perf_event_open_flags.in xlat/perf_event_read_format.in \ + xlat/numa_node.in xlat/open_access_modes.in \ + xlat/open_mode_flags.in xlat/packet_diag_attrs.in \ + xlat/packet_diag_info_flags.in xlat/packet_diag_show.in \ + xlat/packet_mreq_type.in xlat/perf_attr_size.in \ + xlat/perf_branch_sample_type.in xlat/perf_event_open_flags.in \ + xlat/perf_event_read_format.in \ xlat/perf_event_sample_format.in xlat/perf_hw_cache_id.in \ xlat/perf_hw_cache_op_id.in xlat/perf_hw_cache_op_result_id.in \ - xlat/perf_hw_id.in xlat/perf_sw_ids.in xlat/perf_type_id.in \ - xlat/personality_flags.in xlat/personality_types.in \ + xlat/perf_hw_id.in xlat/perf_ioctl_cmds.in \ + xlat/perf_ioctl_flags.in xlat/perf_sw_ids.in \ + xlat/perf_type_id.in xlat/personality_flags.in \ + xlat/personality_types.in xlat/phonet_protocols.in \ xlat/pkey_access.in xlat/policies.in xlat/pollflags.in \ xlat/pr_cap_ambient.in xlat/pr_dumpable.in xlat/pr_fp_mode.in \ xlat/pr_mce_kill.in xlat/pr_mce_kill_policy.in \ - xlat/pr_set_mm.in xlat/pr_tsc.in xlat/pr_unalign_flags.in \ - xlat/prctl_options.in xlat/priorities.in \ - xlat/ptp_flags_options.in xlat/ptrace_cmds.in \ - xlat/ptrace_events.in xlat/ptrace_peeksiginfo_flags.in \ - xlat/ptrace_setoptions_flags.in xlat/quota_formats.in \ - xlat/quotacmds.in xlat/quotatypes.in xlat/rename_flags.in \ - xlat/resource_flags.in xlat/resources.in xlat/rwf_flags.in \ - xlat/sa_handler_values.in xlat/sched_flags.in \ - xlat/schedulers.in xlat/scmvals.in xlat/scsi_sg_commands.in \ - xlat/secbits.in xlat/seccomp_filter_flags.in \ - xlat/seccomp_mode.in xlat/seccomp_ops.in \ - xlat/seccomp_ret_action.in xlat/semctl_flags.in \ - xlat/semop_flags.in xlat/setns_types.in \ - xlat/setsockipoptions.in xlat/setsockipv6options.in \ - xlat/sfd_flags.in xlat/sg_io_dxfer_direction.in \ - xlat/sg_io_flags.in xlat/sg_io_info.in xlat/sg_scsi_reset.in \ - xlat/shm_flags.in xlat/shm_resource_flags.in \ - xlat/shmctl_flags.in xlat/shutdown_modes.in \ - xlat/sigact_flags.in xlat/sigaltstack_flags.in \ - xlat/sigbus_codes.in xlat/sigchld_codes.in \ - xlat/sigemt_codes.in xlat/sigev_value.in xlat/sigfpe_codes.in \ - xlat/sigill_codes.in xlat/siginfo_codes.in \ - xlat/sigpoll_codes.in xlat/sigprocmaskcmds.in \ - xlat/sigprof_codes.in xlat/sigsegv_codes.in \ - xlat/sigsys_codes.in xlat/sigtrap_codes.in \ - xlat/sock_type_flags.in xlat/socketcalls.in \ - xlat/socketlayers.in xlat/sockipoptions.in \ - xlat/sockipv6options.in xlat/sockipxoptions.in \ - xlat/sockoptions.in xlat/sockpacketoptions.in \ - xlat/sockrawoptions.in xlat/socksctpoptions.in \ - xlat/socktcpoptions.in xlat/socktypes.in xlat/splice_flags.in \ + xlat/pr_set_mm.in xlat/pr_spec_cmds.in \ + xlat/pr_spec_get_store_bypass_flags.in \ + xlat/pr_spec_set_store_bypass_flags.in xlat/pr_sve_vl_flags.in \ + xlat/pr_tsc.in xlat/pr_unalign_flags.in xlat/prctl_options.in \ + xlat/priorities.in xlat/ptp_flags_options.in \ + xlat/ptrace_cmds.in xlat/ptrace_events.in \ + xlat/ptrace_peeksiginfo_flags.in \ + xlat/ptrace_setoptions_flags.in xlat/ptrace_syscall_info_op.in \ + xlat/quota_formats.in xlat/quotacmds.in xlat/quotatypes.in \ + xlat/random_ioctl_cmds.in xlat/rename_flags.in \ + xlat/resource_flags.in xlat/resources.in \ + xlat/riscv_flush_icache_flags.in xlat/route_nexthop_flags.in \ + xlat/routing_flags.in xlat/routing_protocols.in \ + xlat/routing_scopes.in xlat/routing_table_ids.in \ + xlat/routing_types.in xlat/rtnl_addr_attrs.in \ + xlat/rtnl_addrlabel_attrs.in xlat/rtnl_dcb_attrs.in \ + xlat/rtnl_ifla_af_spec_inet6_attrs.in \ + xlat/rtnl_ifla_af_spec_inet_attrs.in \ + xlat/rtnl_ifla_brport_attrs.in xlat/rtnl_ifla_events.in \ + xlat/rtnl_ifla_info_attrs.in \ + xlat/rtnl_ifla_info_data_bridge_attrs.in \ + xlat/rtnl_ifla_info_data_tun_attrs.in \ + xlat/rtnl_ifla_port_attrs.in xlat/rtnl_ifla_vf_port_attrs.in \ + xlat/rtnl_ifla_xdp_attached_mode.in \ + xlat/rtnl_ifla_xdp_attrs.in xlat/rtnl_link_attrs.in \ + xlat/rtnl_mdb_attrs.in xlat/rtnl_mdba_mdb_attrs.in \ + xlat/rtnl_mdba_mdb_eattr_attrs.in \ + xlat/rtnl_mdba_mdb_entry_attrs.in \ + xlat/rtnl_mdba_router_attrs.in \ + xlat/rtnl_mdba_router_pattr_attrs.in xlat/rtnl_neigh_attrs.in \ + xlat/rtnl_neightbl_attrs.in xlat/rtnl_neightbl_parms_attrs.in \ + xlat/rtnl_netconf_attrs.in xlat/rtnl_nsid_attrs.in \ + xlat/rtnl_route_attrs.in xlat/rtnl_rta_metrics_attrs.in \ + xlat/rtnl_rule_attrs.in xlat/rtnl_tc_action_attrs.in \ + xlat/rtnl_tc_attrs.in xlat/rtnl_tca_stab_attrs.in \ + xlat/rtnl_tca_stats_attrs.in xlat/rwf_flags.in \ + xlat/s390_guarded_storage_commands.in \ + xlat/s390_runtime_instr_commands.in \ + xlat/s390_sthyi_function_codes.in xlat/sa_handler_values.in \ + xlat/sched_flags.in xlat/schedulers.in xlat/scmvals.in \ + xlat/scsi_sg_commands.in xlat/secbits.in \ + xlat/seccomp_filter_flags.in xlat/seccomp_mode.in \ + xlat/seccomp_ops.in xlat/seccomp_ret_action.in \ + xlat/semctl_flags.in xlat/semop_flags.in xlat/setns_types.in \ + xlat/setsock_ip_options.in xlat/setsock_ipv6_options.in \ + xlat/setsock_options.in xlat/sfd_flags.in \ + xlat/sg_io_dxfer_direction.in xlat/sg_io_flags.in \ + xlat/sg_io_info.in xlat/sg_scsi_reset.in xlat/shm_flags.in \ + xlat/shm_resource_flags.in xlat/shmctl_flags.in \ + xlat/shutdown_modes.in xlat/sigact_flags.in \ + xlat/sigaltstack_flags.in xlat/sigbus_codes.in \ + xlat/sigchld_codes.in xlat/sigemt_codes.in xlat/sigev_value.in \ + xlat/sigfpe_codes.in xlat/sigill_codes.in \ + xlat/siginfo_codes.in xlat/sigpoll_codes.in \ + xlat/sigprocmaskcmds.in xlat/sigprof_codes.in \ + xlat/sigsegv_codes.in xlat/sigsys_codes.in \ + xlat/sigtrap_codes.in xlat/skf_ad.in xlat/skf_off.in \ + xlat/smc_decl_codes.in xlat/smc_diag_attrs.in \ + xlat/smc_diag_extended_flags.in xlat/smc_diag_mode.in \ + xlat/smc_link_group_roles.in xlat/smc_protocols.in \ + xlat/smc_states.in xlat/snmp_icmp6_stats.in \ + xlat/snmp_ip_stats.in xlat/sock_alg_options.in \ + xlat/sock_ax25_options.in xlat/sock_bluetooth_options.in \ + xlat/sock_caif_options.in xlat/sock_dccp_options.in \ + xlat/sock_ip_options.in xlat/sock_ipv6_options.in \ + xlat/sock_ipx_options.in xlat/sock_irda_options.in \ + xlat/sock_iucv_options.in xlat/sock_kcm_options.in \ + xlat/sock_llc_options.in xlat/sock_netlink_options.in \ + xlat/sock_nfcllcp_options.in xlat/sock_options.in \ + xlat/sock_packet_options.in xlat/sock_pnp_options.in \ + xlat/sock_pppol2tp_options.in xlat/sock_raw_options.in \ + xlat/sock_rds_options.in xlat/sock_rxrpc_options.in \ + xlat/sock_sctp_options.in xlat/sock_shutdown_flags.in \ + xlat/sock_tcp_options.in xlat/sock_tipc_options.in \ + xlat/sock_tls_options.in xlat/sock_type_flags.in \ + xlat/sock_udp_options.in xlat/sock_xdp_options.in \ + xlat/socketcalls.in xlat/socketlayers.in xlat/socktypes.in \ + xlat/sparc_kern_features.in xlat/splice_flags.in \ xlat/sram_alloc_flags.in xlat/statfs_flags.in \ - xlat/swap_flags.in xlat/sync_file_range_flags.in \ - xlat/sysctl_kern.in xlat/sysctl_net.in xlat/sysctl_net_core.in \ + xlat/statx_attrs.in xlat/statx_masks.in xlat/swap_flags.in \ + xlat/sync_file_range_flags.in xlat/sysctl_kern.in \ + xlat/sysctl_net.in xlat/sysctl_net_core.in \ xlat/sysctl_net_ipv4.in xlat/sysctl_net_ipv4_conf.in \ xlat/sysctl_net_ipv4_route.in xlat/sysctl_net_ipv6.in \ xlat/sysctl_net_ipv6_route.in xlat/sysctl_net_unix.in \ xlat/sysctl_root.in xlat/sysctl_vm.in \ xlat/syslog_action_type.in xlat/sysmips_operations.in \ - xlat/tcflsh_options.in xlat/tcxonc_options.in \ - xlat/timerfdflags.in xlat/ubi_volume_props.in \ - xlat/ubi_volume_types.in xlat/uffd_api_flags.in \ - xlat/uffd_copy_flags.in xlat/uffd_flags.in \ - xlat/uffd_register_ioctl_flags.in \ + xlat/tcflsh_options.in xlat/tcp_state_flags.in \ + xlat/tcp_states.in xlat/tcxonc_options.in xlat/timerfdflags.in \ + xlat/tun_device_types.in xlat/ubi_volume_props.in \ + xlat/ubi_volume_types.in xlat/uffd_api_features.in \ + xlat/uffd_api_flags.in xlat/uffd_copy_flags.in \ + xlat/uffd_flags.in xlat/uffd_register_ioctl_flags.in \ xlat/uffd_register_mode_flags.in xlat/uffd_zeropage_flags.in \ - xlat/umount_flags.in xlat/unshare_flags.in xlat/usagewho.in \ + xlat/umount_flags.in xlat/unix_diag_attrs.in \ + xlat/unix_diag_show.in xlat/unshare_flags.in \ + xlat/uring_enter_flags.in xlat/uring_register_opcodes.in \ + xlat/uring_setup_flags.in xlat/usagewho.in \ xlat/v4l2_buf_flags.in xlat/v4l2_buf_types.in \ xlat/v4l2_capture_modes.in xlat/v4l2_colorspaces.in \ xlat/v4l2_control_classes.in xlat/v4l2_control_flags.in \ - xlat/v4l2_control_ids.in xlat/v4l2_control_types.in \ + xlat/v4l2_control_id_bases.in xlat/v4l2_control_ids.in \ + xlat/v4l2_control_types.in \ xlat/v4l2_device_capabilities_flags.in xlat/v4l2_fields.in \ xlat/v4l2_format_description_flags.in \ xlat/v4l2_frameinterval_types.in xlat/v4l2_framesize_types.in \ xlat/v4l2_input_types.in xlat/v4l2_memories.in \ - xlat/v4l2_streaming_capabilities.in xlat/wait4_options.in \ + xlat/v4l2_pix_fmts.in xlat/v4l2_sdr_fmts.in \ + xlat/v4l2_sliced_flags.in xlat/v4l2_streaming_capabilities.in \ + xlat/v4l2_tuner_audmodes.in xlat/v4l2_tuner_capabilities.in \ + xlat/v4l2_tuner_rxsubchanses.in xlat/v4l2_tuner_types.in \ + xlat/v4l2_vbi_flags.in xlat/wait4_options.in \ xlat/waitid_types.in xlat/whence_codes.in xlat/xattrflags.in \ - xlat/xfs_dqblk_flags.in xlat/xfs_quota_flags.in -XLAT_HEADER_FILES = xlat/access_flags.h xlat/aclipc.h xlat/addrfams.h \ + xlat/xdp_flags.in xlat/xfs_dqblk_flags.in \ + xlat/xfs_quota_flags.in +XLAT_HEADER_FILES = xlat/access_flags.h xlat/addrfams.h \ xlat/adjtimex_modes.h xlat/adjtimex_state.h \ xlat/adjtimex_status.h xlat/advise.h xlat/af_packet_types.h \ - xlat/archvals.h xlat/arp_hardware_types.h xlat/at_flags.h \ - xlat/atomic_ops.h xlat/audit_arch.h xlat/baud_options.h \ - xlat/blkpg_ops.h xlat/bootflags1.h xlat/bootflags2.h \ - xlat/bootflags3.h xlat/bpf_attach_type.h xlat/bpf_class.h \ - xlat/bpf_commands.h xlat/bpf_map_types.h \ - xlat/bpf_map_update_elem_flags.h xlat/bpf_miscop.h \ - xlat/bpf_mode.h xlat/bpf_op_alu.h xlat/bpf_op_jmp.h \ - xlat/bpf_prog_types.h xlat/bpf_rval.h xlat/bpf_size.h \ - xlat/bpf_src.h xlat/bsg_flags.h xlat/bsg_protocol.h \ - xlat/bsg_subprotocol.h xlat/bt_protocols.h \ + xlat/af_packet_versions.h xlat/aio_cmds.h xlat/archvals.h \ + xlat/arp_hardware_types.h xlat/at_flags.h \ + xlat/at_statx_sync_types.h xlat/atomic_ops.h xlat/audit_arch.h \ + xlat/ax25_protocols.h xlat/baud_options.h xlat/bdaddr_types.h \ + xlat/blkpg_ops.h xlat/block_ioctl_cmds.h \ + xlat/bluetooth_l2_cid.h xlat/bluetooth_l2_psm.h \ + xlat/bootflags1.h xlat/bootflags2.h xlat/bootflags3.h \ + xlat/bpf_attach_flags.h xlat/bpf_attach_type.h \ + xlat/bpf_class.h xlat/bpf_commands.h \ + xlat/bpf_file_mode_flags.h xlat/bpf_map_flags.h \ + xlat/bpf_map_types.h xlat/bpf_map_update_elem_flags.h \ + xlat/bpf_miscop.h xlat/bpf_mode.h xlat/bpf_op_alu.h \ + xlat/bpf_op_jmp.h xlat/bpf_prog_flags.h xlat/bpf_prog_types.h \ + xlat/bpf_query_flags.h xlat/bpf_rval.h xlat/bpf_size.h \ + xlat/bpf_src.h xlat/bpf_task_fd_type.h xlat/bsg_flags.h \ + xlat/bsg_protocol.h xlat/bsg_subprotocol.h xlat/bt_protocols.h \ xlat/btrfs_balance_args.h xlat/btrfs_balance_ctl_cmds.h \ xlat/btrfs_balance_flags.h xlat/btrfs_balance_state.h \ - xlat/btrfs_compress_types.h xlat/btrfs_defrag_flags.h \ - xlat/btrfs_dev_replace_cmds.h xlat/btrfs_dev_replace_results.h \ + xlat/btrfs_compress_types.h \ + xlat/btrfs_cont_reading_from_srcdev_mode.h \ + xlat/btrfs_defrag_flags.h xlat/btrfs_dev_replace_cmds.h \ + xlat/btrfs_dev_replace_results.h \ xlat/btrfs_dev_replace_state.h xlat/btrfs_dev_stats_flags.h \ xlat/btrfs_dev_stats_values.h xlat/btrfs_features_compat.h \ xlat/btrfs_features_compat_ro.h xlat/btrfs_features_incompat.h \ - xlat/btrfs_key_types.h xlat/btrfs_qgroup_ctl_cmds.h \ - xlat/btrfs_qgroup_inherit_flags.h \ + xlat/btrfs_key_types.h xlat/btrfs_logical_ino_args_flags.h \ + xlat/btrfs_qgroup_ctl_cmds.h xlat/btrfs_qgroup_inherit_flags.h \ xlat/btrfs_qgroup_limit_flags.h \ xlat/btrfs_qgroup_status_flags.h xlat/btrfs_scrub_flags.h \ xlat/btrfs_send_flags.h xlat/btrfs_snap_flags_v2.h \ xlat/btrfs_space_info_flags.h xlat/btrfs_tree_objectids.h \ - xlat/cacheflush_scope.h xlat/cap.h xlat/cap_mask0.h \ + xlat/cacheflush_scope.h xlat/caif_protocols.h \ + xlat/can_protocols.h xlat/cap.h xlat/cap_mask0.h \ xlat/cap_mask1.h xlat/cap_version.h xlat/clockflags.h \ xlat/clocknames.h xlat/clone_flags.h xlat/cpuclocknames.h \ + xlat/crypto_nl_attrs.h xlat/dcb_commands.h \ xlat/delete_module_flags.h xlat/dirent_types.h xlat/dm_flags.h \ + xlat/ebpf_class.h xlat/ebpf_mode.h xlat/ebpf_op_alu.h \ + xlat/ebpf_op_jmp.h xlat/ebpf_regs.h xlat/ebpf_size.h \ xlat/efd_flags.h xlat/epollctls.h xlat/epollevents.h \ xlat/epollflags.h xlat/ethernet_protocols.h xlat/evdev_abs.h \ xlat/evdev_autorepeat.h xlat/evdev_ev.h xlat/evdev_ff_status.h \ xlat/evdev_ff_types.h xlat/evdev_keycode.h xlat/evdev_leds.h \ xlat/evdev_misc.h xlat/evdev_mtslots.h xlat/evdev_prop.h \ xlat/evdev_relative_axes.h xlat/evdev_snd.h \ - xlat/evdev_switch.h xlat/evdev_sync.h xlat/f_owner_types.h \ - xlat/f_seals.h xlat/falloc_flags.h xlat/fan_classes.h \ - xlat/fan_event_flags.h xlat/fan_init_flags.h \ - xlat/fan_mark_flags.h xlat/fcntl64cmds.h xlat/fcntlcmds.h \ - xlat/fdflags.h xlat/fiemap_extent_flags.h xlat/fiemap_flags.h \ - xlat/flockcmds.h xlat/fsmagic.h xlat/futexops.h \ - xlat/futexwakecmps.h xlat/futexwakeops.h \ - xlat/getrandom_flags.h xlat/getsockipoptions.h \ - xlat/getsockipv6options.h xlat/hci_channels.h \ - xlat/hw_breakpoint_len.h xlat/hw_breakpoint_type.h \ - xlat/icmpfilterflags.h xlat/if_dqblk_valid.h \ - xlat/if_dqinfo_flags.h xlat/if_dqinfo_valid.h xlat/iffflags.h \ + xlat/evdev_switch.h xlat/f_owner_types.h xlat/f_seals.h \ + xlat/falloc_flags.h xlat/fan_classes.h xlat/fan_event_flags.h \ + xlat/fan_init_flags.h xlat/fan_mark_flags.h xlat/fcntlcmds.h \ + xlat/fdflags.h xlat/fib_rule_actions.h xlat/fib_rule_flags.h \ + xlat/fiemap_extent_flags.h xlat/fiemap_flags.h \ + xlat/flockcmds.h xlat/fsmagic.h xlat/futexbitset.h \ + xlat/futexops.h xlat/futexwakecmps.h xlat/futexwakeops.h \ + xlat/getrandom_flags.h xlat/getsock_ip_options.h \ + xlat/getsock_ipv6_options.h xlat/getsock_options.h \ + xlat/hci_channels.h xlat/hw_breakpoint_len.h \ + xlat/hw_breakpoint_type.h xlat/icmpfilterflags.h \ + xlat/if_dqblk_valid.h xlat/if_dqinfo_flags.h \ + xlat/if_dqinfo_valid.h xlat/ifaddrflags.h xlat/iffflags.h \ + xlat/in6_addr_gen_mode.h xlat/inet6_devconf_indices.h \ + xlat/inet6_if_flags.h xlat/inet_devconf_indices.h \ + xlat/inet_diag_attrs.h xlat/inet_diag_bytecodes.h \ + xlat/inet_diag_extended_flags.h xlat/inet_diag_req_attrs.h \ xlat/inet_protocols.h xlat/inotify_flags.h \ xlat/inotify_init_flags.h xlat/ioctl_dirs.h \ xlat/ioprio_class.h xlat/ioprio_who.h xlat/ip_cmsg_types.h \ - xlat/ipc_msg_flags.h xlat/ipccalls.h xlat/itimer_which.h \ + xlat/ip_type_of_services.h xlat/ipc_msg_flags.h \ + xlat/ipc_private.h xlat/ipccalls.h xlat/irda_protocols.h \ + xlat/isdn_protocols.h xlat/itimer_which.h xlat/kcm_protocols.h \ xlat/kcmp_types.h xlat/kexec_arch_values.h \ xlat/kexec_file_load_flags.h xlat/kexec_load_flags.h \ xlat/key_perms.h xlat/key_reqkeys.h xlat/key_spec.h \ - xlat/keyctl_commands.h xlat/lockfcmds.h xlat/loop_cmds.h \ - xlat/loop_crypt_type_options.h xlat/loop_flags_options.h \ + xlat/keyctl_commands.h xlat/kvm_cap.h xlat/kvm_cpuid_flags.h \ + xlat/kvm_exit_reason.h xlat/kvm_mem_flags.h xlat/lockfcmds.h \ + xlat/loop_cmds.h xlat/loop_crypt_type_options.h \ + xlat/loop_flags_options.h xlat/lwtunnel_encap_types.h \ xlat/madvise_cmds.h xlat/mbindflags.h xlat/mctl_sync.h \ - xlat/membarrier_cmds.h xlat/memfd_create_flags.h \ - xlat/mempolicyflags.h xlat/mlock_flags.h xlat/mlockall_flags.h \ - xlat/mmap_flags.h xlat/mmap_prot.h xlat/modem_flags.h \ - xlat/modetypes.h xlat/module_init_flags.h xlat/mount_flags.h \ + xlat/mdb_flags.h xlat/mdb_states.h xlat/membarrier_cmds.h \ + xlat/memfd_create_flags.h xlat/mempolicyflags.h \ + xlat/mlock_flags.h xlat/mlockall_flags.h xlat/mmap_flags.h \ + xlat/mmap_prot.h xlat/modem_flags.h xlat/modetypes.h \ + xlat/module_init_flags.h xlat/mount_flags.h \ xlat/move_pages_flags.h xlat/mq_attr_flags.h \ xlat/mremap_flags.h xlat/msg_flags.h xlat/msgctl_flags.h \ xlat/mtd_file_mode_options.h xlat/mtd_flags_options.h \ xlat/mtd_mode_options.h xlat/mtd_nandecc_options.h \ xlat/mtd_otp_options.h xlat/mtd_type_options.h \ - xlat/name_to_handle_at_flags.h xlat/netlink_flags.h \ - xlat/netlink_protocols.h xlat/netlink_types.h \ - xlat/notifyflags.h xlat/nt_descriptor_types.h \ + xlat/multicast_router_types.h xlat/name_to_handle_at_flags.h \ + xlat/nbd_ioctl_cmds.h xlat/nbd_ioctl_flags.h \ + xlat/neighbor_cache_entry_flags.h \ + xlat/neighbor_cache_entry_states.h xlat/netfilter_versions.h \ + xlat/netlink_ack_flags.h xlat/netlink_delete_flags.h \ + xlat/netlink_diag_attrs.h xlat/netlink_diag_show.h \ + xlat/netlink_flags.h xlat/netlink_get_flags.h \ + xlat/netlink_new_flags.h xlat/netlink_protocols.h \ + xlat/netlink_sk_meminfo_indices.h xlat/netlink_socket_flags.h \ + xlat/netlink_states.h xlat/netlink_types.h \ + xlat/nf_acct_msg_types.h xlat/nf_cthelper_msg_types.h \ + xlat/nf_ctnetlink_exp_msg_types.h \ + xlat/nf_ctnetlink_msg_types.h xlat/nf_cttimeout_msg_types.h \ + xlat/nf_ipset_msg_types.h xlat/nf_nft_compat_msg_types.h \ + xlat/nf_nftables_msg_types.h xlat/nf_osf_msg_types.h \ + xlat/nf_queue_msg_types.h xlat/nf_ulog_msg_types.h \ + xlat/nfc_protocols.h xlat/nl_audit_types.h \ + xlat/nl_crypto_types.h xlat/nl_netfilter_msg_types.h \ + xlat/nl_netfilter_subsys_ids.h xlat/nl_route_types.h \ + xlat/nl_selinux_types.h xlat/nl_sock_diag_types.h \ + xlat/nl_xfrm_types.h xlat/nlmsgerr_attrs.h xlat/notifyflags.h \ + xlat/nt_descriptor_types.h xlat/numa_node.h \ xlat/open_access_modes.h xlat/open_mode_flags.h \ - xlat/openmodessol.h xlat/packet_mreq_type.h \ + xlat/packet_diag_attrs.h xlat/packet_diag_info_flags.h \ + xlat/packet_diag_show.h xlat/packet_mreq_type.h \ xlat/perf_attr_size.h xlat/perf_branch_sample_type.h \ xlat/perf_event_open_flags.h xlat/perf_event_read_format.h \ xlat/perf_event_sample_format.h xlat/perf_hw_cache_id.h \ xlat/perf_hw_cache_op_id.h xlat/perf_hw_cache_op_result_id.h \ - xlat/perf_hw_id.h xlat/perf_sw_ids.h xlat/perf_type_id.h \ + xlat/perf_hw_id.h xlat/perf_ioctl_cmds.h \ + xlat/perf_ioctl_flags.h xlat/perf_sw_ids.h xlat/perf_type_id.h \ xlat/personality_flags.h xlat/personality_types.h \ - xlat/pkey_access.h xlat/policies.h xlat/pollflags.h \ - xlat/pr_cap_ambient.h xlat/pr_dumpable.h xlat/pr_fp_mode.h \ - xlat/pr_mce_kill.h xlat/pr_mce_kill_policy.h xlat/pr_set_mm.h \ + xlat/phonet_protocols.h xlat/pkey_access.h xlat/policies.h \ + xlat/pollflags.h xlat/pr_cap_ambient.h xlat/pr_dumpable.h \ + xlat/pr_fp_mode.h xlat/pr_mce_kill.h xlat/pr_mce_kill_policy.h \ + xlat/pr_set_mm.h xlat/pr_spec_cmds.h \ + xlat/pr_spec_get_store_bypass_flags.h \ + xlat/pr_spec_set_store_bypass_flags.h xlat/pr_sve_vl_flags.h \ xlat/pr_tsc.h xlat/pr_unalign_flags.h xlat/prctl_options.h \ xlat/priorities.h xlat/ptp_flags_options.h xlat/ptrace_cmds.h \ xlat/ptrace_events.h xlat/ptrace_peeksiginfo_flags.h \ - xlat/ptrace_setoptions_flags.h xlat/quota_formats.h \ - xlat/quotacmds.h xlat/quotatypes.h xlat/rename_flags.h \ - xlat/resource_flags.h xlat/resources.h xlat/rwf_flags.h \ - xlat/sa_handler_values.h xlat/sched_flags.h xlat/schedulers.h \ - xlat/scmvals.h xlat/scsi_sg_commands.h xlat/secbits.h \ + xlat/ptrace_setoptions_flags.h xlat/ptrace_syscall_info_op.h \ + xlat/quota_formats.h xlat/quotacmds.h xlat/quotatypes.h \ + xlat/random_ioctl_cmds.h xlat/rename_flags.h \ + xlat/resource_flags.h xlat/resources.h \ + xlat/riscv_flush_icache_flags.h xlat/route_nexthop_flags.h \ + xlat/routing_flags.h xlat/routing_protocols.h \ + xlat/routing_scopes.h xlat/routing_table_ids.h \ + xlat/routing_types.h xlat/rtnl_addr_attrs.h \ + xlat/rtnl_addrlabel_attrs.h xlat/rtnl_dcb_attrs.h \ + xlat/rtnl_ifla_af_spec_inet6_attrs.h \ + xlat/rtnl_ifla_af_spec_inet_attrs.h \ + xlat/rtnl_ifla_brport_attrs.h xlat/rtnl_ifla_events.h \ + xlat/rtnl_ifla_info_attrs.h \ + xlat/rtnl_ifla_info_data_bridge_attrs.h \ + xlat/rtnl_ifla_info_data_tun_attrs.h \ + xlat/rtnl_ifla_port_attrs.h xlat/rtnl_ifla_vf_port_attrs.h \ + xlat/rtnl_ifla_xdp_attached_mode.h xlat/rtnl_ifla_xdp_attrs.h \ + xlat/rtnl_link_attrs.h xlat/rtnl_mdb_attrs.h \ + xlat/rtnl_mdba_mdb_attrs.h xlat/rtnl_mdba_mdb_eattr_attrs.h \ + xlat/rtnl_mdba_mdb_entry_attrs.h xlat/rtnl_mdba_router_attrs.h \ + xlat/rtnl_mdba_router_pattr_attrs.h xlat/rtnl_neigh_attrs.h \ + xlat/rtnl_neightbl_attrs.h xlat/rtnl_neightbl_parms_attrs.h \ + xlat/rtnl_netconf_attrs.h xlat/rtnl_nsid_attrs.h \ + xlat/rtnl_route_attrs.h xlat/rtnl_rta_metrics_attrs.h \ + xlat/rtnl_rule_attrs.h xlat/rtnl_tc_action_attrs.h \ + xlat/rtnl_tc_attrs.h xlat/rtnl_tca_stab_attrs.h \ + xlat/rtnl_tca_stats_attrs.h xlat/rwf_flags.h \ + xlat/s390_guarded_storage_commands.h \ + xlat/s390_runtime_instr_commands.h \ + xlat/s390_sthyi_function_codes.h xlat/sa_handler_values.h \ + xlat/sched_flags.h xlat/schedulers.h xlat/scmvals.h \ + xlat/scsi_sg_commands.h xlat/secbits.h \ xlat/seccomp_filter_flags.h xlat/seccomp_mode.h \ xlat/seccomp_ops.h xlat/seccomp_ret_action.h \ xlat/semctl_flags.h xlat/semop_flags.h xlat/setns_types.h \ - xlat/setsockipoptions.h xlat/setsockipv6options.h \ - xlat/sfd_flags.h xlat/sg_io_dxfer_direction.h \ - xlat/sg_io_flags.h xlat/sg_io_info.h xlat/sg_scsi_reset.h \ - xlat/shm_flags.h xlat/shm_resource_flags.h xlat/shmctl_flags.h \ + xlat/setsock_ip_options.h xlat/setsock_ipv6_options.h \ + xlat/setsock_options.h xlat/sfd_flags.h \ + xlat/sg_io_dxfer_direction.h xlat/sg_io_flags.h \ + xlat/sg_io_info.h xlat/sg_scsi_reset.h xlat/shm_flags.h \ + xlat/shm_resource_flags.h xlat/shmctl_flags.h \ xlat/shutdown_modes.h xlat/sigact_flags.h \ xlat/sigaltstack_flags.h xlat/sigbus_codes.h \ xlat/sigchld_codes.h xlat/sigemt_codes.h xlat/sigev_value.h \ xlat/sigfpe_codes.h xlat/sigill_codes.h xlat/siginfo_codes.h \ xlat/sigpoll_codes.h xlat/sigprocmaskcmds.h \ xlat/sigprof_codes.h xlat/sigsegv_codes.h xlat/sigsys_codes.h \ - xlat/sigtrap_codes.h xlat/sock_type_flags.h xlat/socketcalls.h \ - xlat/socketlayers.h xlat/sockipoptions.h \ - xlat/sockipv6options.h xlat/sockipxoptions.h \ - xlat/sockoptions.h xlat/sockpacketoptions.h \ - xlat/sockrawoptions.h xlat/socksctpoptions.h \ - xlat/socktcpoptions.h xlat/socktypes.h xlat/splice_flags.h \ - xlat/sram_alloc_flags.h xlat/statfs_flags.h xlat/swap_flags.h \ - xlat/sync_file_range_flags.h xlat/sysctl_kern.h \ - xlat/sysctl_net.h xlat/sysctl_net_core.h \ + xlat/sigtrap_codes.h xlat/skf_ad.h xlat/skf_off.h \ + xlat/smc_decl_codes.h xlat/smc_diag_attrs.h \ + xlat/smc_diag_extended_flags.h xlat/smc_diag_mode.h \ + xlat/smc_link_group_roles.h xlat/smc_protocols.h \ + xlat/smc_states.h xlat/snmp_icmp6_stats.h xlat/snmp_ip_stats.h \ + xlat/sock_alg_options.h xlat/sock_ax25_options.h \ + xlat/sock_bluetooth_options.h xlat/sock_caif_options.h \ + xlat/sock_dccp_options.h xlat/sock_ip_options.h \ + xlat/sock_ipv6_options.h xlat/sock_ipx_options.h \ + xlat/sock_irda_options.h xlat/sock_iucv_options.h \ + xlat/sock_kcm_options.h xlat/sock_llc_options.h \ + xlat/sock_netlink_options.h xlat/sock_nfcllcp_options.h \ + xlat/sock_options.h xlat/sock_packet_options.h \ + xlat/sock_pnp_options.h xlat/sock_pppol2tp_options.h \ + xlat/sock_raw_options.h xlat/sock_rds_options.h \ + xlat/sock_rxrpc_options.h xlat/sock_sctp_options.h \ + xlat/sock_shutdown_flags.h xlat/sock_tcp_options.h \ + xlat/sock_tipc_options.h xlat/sock_tls_options.h \ + xlat/sock_type_flags.h xlat/sock_udp_options.h \ + xlat/sock_xdp_options.h xlat/socketcalls.h xlat/socketlayers.h \ + xlat/socktypes.h xlat/sparc_kern_features.h \ + xlat/splice_flags.h xlat/sram_alloc_flags.h \ + xlat/statfs_flags.h xlat/statx_attrs.h xlat/statx_masks.h \ + xlat/swap_flags.h xlat/sync_file_range_flags.h \ + xlat/sysctl_kern.h xlat/sysctl_net.h xlat/sysctl_net_core.h \ xlat/sysctl_net_ipv4.h xlat/sysctl_net_ipv4_conf.h \ xlat/sysctl_net_ipv4_route.h xlat/sysctl_net_ipv6.h \ xlat/sysctl_net_ipv6_route.h xlat/sysctl_net_unix.h \ xlat/sysctl_root.h xlat/sysctl_vm.h xlat/syslog_action_type.h \ xlat/sysmips_operations.h xlat/tcflsh_options.h \ - xlat/tcxonc_options.h xlat/timerfdflags.h \ + xlat/tcp_state_flags.h xlat/tcp_states.h xlat/tcxonc_options.h \ + xlat/timerfdflags.h xlat/tun_device_types.h \ xlat/ubi_volume_props.h xlat/ubi_volume_types.h \ - xlat/uffd_api_flags.h xlat/uffd_copy_flags.h xlat/uffd_flags.h \ + xlat/uffd_api_features.h xlat/uffd_api_flags.h \ + xlat/uffd_copy_flags.h xlat/uffd_flags.h \ xlat/uffd_register_ioctl_flags.h \ xlat/uffd_register_mode_flags.h xlat/uffd_zeropage_flags.h \ - xlat/umount_flags.h xlat/unshare_flags.h xlat/usagewho.h \ - xlat/v4l2_buf_flags.h xlat/v4l2_buf_types.h \ - xlat/v4l2_capture_modes.h xlat/v4l2_colorspaces.h \ - xlat/v4l2_control_classes.h xlat/v4l2_control_flags.h \ + xlat/umount_flags.h xlat/unix_diag_attrs.h \ + xlat/unix_diag_show.h xlat/unshare_flags.h \ + xlat/uring_enter_flags.h xlat/uring_register_opcodes.h \ + xlat/uring_setup_flags.h xlat/usagewho.h xlat/v4l2_buf_flags.h \ + xlat/v4l2_buf_types.h xlat/v4l2_capture_modes.h \ + xlat/v4l2_colorspaces.h xlat/v4l2_control_classes.h \ + xlat/v4l2_control_flags.h xlat/v4l2_control_id_bases.h \ xlat/v4l2_control_ids.h xlat/v4l2_control_types.h \ xlat/v4l2_device_capabilities_flags.h xlat/v4l2_fields.h \ xlat/v4l2_format_description_flags.h \ xlat/v4l2_frameinterval_types.h xlat/v4l2_framesize_types.h \ xlat/v4l2_input_types.h xlat/v4l2_memories.h \ - xlat/v4l2_streaming_capabilities.h xlat/wait4_options.h \ - xlat/waitid_types.h xlat/whence_codes.h xlat/xattrflags.h \ + xlat/v4l2_pix_fmts.h xlat/v4l2_sdr_fmts.h \ + xlat/v4l2_sliced_flags.h xlat/v4l2_streaming_capabilities.h \ + xlat/v4l2_tuner_audmodes.h xlat/v4l2_tuner_capabilities.h \ + xlat/v4l2_tuner_rxsubchanses.h xlat/v4l2_tuner_types.h \ + xlat/v4l2_vbi_flags.h xlat/wait4_options.h xlat/waitid_types.h \ + xlat/whence_codes.h xlat/xattrflags.h xlat/xdp_flags.h \ xlat/xfs_dqblk_flags.h xlat/xfs_quota_flags.h -strace_CPPFLAGS = $(AM_CPPFLAGS) $(am__append_2) \ - $(CODE_COVERAGE_CPPFLAGS) -strace_CFLAGS = $(AM_CFLAGS) $(CODE_COVERAGE_CFLAGS) -strace_LDFLAGS = $(am__append_3) -strace_LDADD = libstrace.a $(am__append_4) $(CODE_COVERAGE_LDFLAGS) \ - $(am__append_5) $(am__append_9) -noinst_LIBRARIES = libstrace.a $(am__append_6) $(am__append_10) +strace_CPPFLAGS = $(AM_CPPFLAGS) $(am__append_3) $(am__append_8) \ + $(am__append_11) $(CODE_COVERAGE_CPPFLAGS) +strace_CFLAGS = $(AM_CFLAGS) $(am__append_4) $(CODE_COVERAGE_CFLAGS) +strace_LDFLAGS = $(am__append_5) $(am__append_9) $(am__append_12) +strace_LDADD = libstrace.a $(clock_LIBS) $(timer_LIBS) $(am__append_6) \ + $(am__append_10) $(am__append_13) $(CODE_COVERAGE_LIBS) \ + $(am__append_14) $(am__append_18) +noinst_LIBRARIES = libstrace.a $(am__append_15) $(am__append_19) libstrace_a_CPPFLAGS = $(strace_CPPFLAGS) libstrace_a_CFLAGS = $(strace_CFLAGS) libstrace_a_SOURCES = \ + fetch_indirect_syscall_args.c \ fstatfs.c \ fstatfs64.c \ + getpagesize.c \ ipc.c \ + mmap_cache.c \ + mmap_cache.h \ + sigreturn.c \ socketcall.c \ statfs.c \ statfs64.c \ @@ -1012,41 +1578,72 @@ libstrace_a_SOURCES = \ upoke.c \ # end of libstrace_a_SOURCES -strace_SOURCES = access.c affinity.c aio.c alpha.c bjm.c block.c bpf.c \ - btrfs.c cacheflush.c capability.c caps0.h caps1.h chdir.c \ - chmod.c clone.c copy_file_range.c count.c defs.h desc.c \ - dirent.c dirent64.c dm.c empty.h epoll.c evdev.c eventfd.c \ - execve.c fadvise.c fallocate.c fanotify.c fchownat.c fcntl.c \ - fetch_seccomp_fprog.c fetch_struct_flock.c \ +strace_SOURCES = access.c affinity.c aio.c alpha.c arch_defs.h \ + basic_filters.c bind.c bjm.c block.c bpf.c bpf_attr.h \ + bpf_filter.c bpf_filter.h bpf_fprog.h bpf_seccomp_filter.c \ + bpf_sock_filter.c btrfs.c cacheflush.c capability.c caps0.h \ + caps1.h chdir.c chmod.c clone.c copy_file_range.c count.c \ + defs.h delay.c delay.h desc.c dirent.c dirent64.c dm.c \ + dyxlat.c empty.h epoll.c error_prints.c error_prints.h evdev.c \ + evdev_mpers.c eventfd.c execve.c f_owner_ex.h fadvise.c \ + fallocate.c fanotify.c fchownat.c fcntl.c fetch_bpf_fprog.c \ + fetch_struct_flock.c fetch_struct_keyctl_kdf_params.c \ fetch_struct_mmsghdr.c fetch_struct_msghdr.c \ fetch_struct_stat.c fetch_struct_stat64.c \ - fetch_struct_statfs.c file_handle.c file_ioctl.c fs_x_ioctl.c \ - flock.c flock.h futex.c gcc_compat.h get_robust_list.c \ - getcpu.c getcwd.c getrandom.c hdio.c hostname.c inotify.c io.c \ - ioctl.c ioperm.c iopl.c ioprio.c ipc_defs.h ipc_msg.c \ - ipc_msgctl.c ipc_sem.c ipc_shm.c ipc_shmctl.c kcmp.c \ - kernel_types.h kexec.c keyctl.c ldt.c link.c linux/asm_stat.h \ - linux/x32/asm_stat.h linux/x86_64/asm_stat.h lookup_dcookie.c \ - loop.c lseek.c mem.c membarrier.c memfd_create.c mknod.c \ - mmsghdr.c mount.c mpers_type.h mq.c msghdr.c msghdr.h mtd.c \ - native_defs.h net.c netlink.c nsig.h numa.c oldstat.c open.c \ - or1k_atomic.c pathtrace.c perf.c perf_event_struct.h \ - personality.c pkeys.c poll.c prctl.c print_dev_t.c \ - print_mq_attr.c print_msgbuf.c print_sg_req_info.c \ - print_sigevent.c print_statfs.c print_struct_stat.c \ - print_time.c print_timespec.c print_timeval.c print_timex.c \ - printmode.c printrusage.c printsiginfo.c printsiginfo.h \ - process.c process_vm.c ptp.c ptrace.h qualify.c quota.c \ - readahead.c readlink.c reboot.c regs.h renameat.c resource.c \ - rtc.c sched.c scsi.c seccomp.c seccomp_fprog.h sendfile.c \ - sg_io_v3.c sg_io_v4.c sigaltstack.c sigevent.h signal.c \ - signalfd.c sigreturn.c sock.c sockaddr.c socketutils.c \ - sram_alloc.c stat.c stat.h stat64.c statfs.c statfs.h strace.c \ - swapon.c syscall.c sysctl.c sysent.h sysinfo.c syslog.c \ - sysmips.c term.c time.c times.c truncate.c ubi.c uid.c uid16.c \ - umask.c umount.c uname.c userfaultfd.c ustat.c util.c utime.c \ - utimes.c v4l2.c wait.c xattr.c xlat.h xmalloc.c \ - $(am__append_1) + fetch_struct_statfs.c fetch_struct_xfs_quotastat.c \ + file_handle.c file_ioctl.c filter.h filter_qualify.c flock.c \ + flock.h fs_x_ioctl.c futex.c gcc_compat.h get_personality.c \ + get_personality.h get_robust_list.c getcpu.c getcwd.c \ + getrandom.c hdio.c hostname.c inotify.c inotify_ioctl.c io.c \ + io_uring.c ioctl.c ioperm.c iopl.c ioprio.c ipc_defs.h \ + ipc_msg.c ipc_msgctl.c ipc_sem.c ipc_shm.c ipc_shmctl.c kcmp.c \ + kernel_timespec.h kernel_timeval.h kernel_timex.h \ + kernel_types.h kexec.c keyctl.c keyctl_kdf_params.h \ + kill_save_errno.h kvm.c largefile_wrappers.h ldt.c link.c \ + linux/asm_stat.h linux/x32/asm_stat.h linux/x86_64/asm_stat.h \ + list.h listen.c lookup_dcookie.c loop.c lseek.c macros.h mem.c \ + membarrier.c memfd_create.c mknod.c mmap_notify.c \ + mmap_notify.h mmsghdr.c mount.c mpers_type.h mq.c msghdr.c \ + msghdr.h mtd.c native_defs.h nbd_ioctl.c negated_errno.h net.c \ + netlink.c netlink.h netlink_crypto.c netlink_inet_diag.c \ + netlink_kobject_uevent.c netlink_kobject_uevent.h \ + netlink_netfilter.c netlink_netlink_diag.c \ + netlink_packet_diag.c netlink_route.c netlink_route.h \ + netlink_selinux.c netlink_smc_diag.c netlink_sock_diag.c \ + netlink_sock_diag.h netlink_unix_diag.c nlattr.c nlattr.h \ + nsfs.c nsfs.h nsig.h numa.c number_set.c number_set.h \ + oldstat.c open.c or1k_atomic.c pathtrace.c perf.c \ + perf_event_struct.h perf_ioctl.c personality.c pkeys.c poll.c \ + prctl.c print_aio_sigset.c print_dev_t.c print_fields.h \ + print_group_req.c print_ifindex.c print_instruction_pointer.c \ + print_kernel_version.c print_mac.c print_mq_attr.c \ + print_msgbuf.c print_sg_req_info.c print_sigevent.c \ + print_statfs.c print_struct_stat.c print_time.c \ + print_timespec.c print_timespec.h print_timespec32.c \ + print_timespec64.c print_timeval.c print_timeval64.c \ + print_timex.c print_timex.h print_utils.h printmode.c \ + printrusage.c printsiginfo.c printsiginfo.h process.c \ + process_vm.c ptp.c ptrace.h ptrace_syscall_info.c \ + ptrace_syscall_info.h quota.c random_ioctl.c readahead.c \ + readlink.c reboot.c regs.h renameat.c resource.c retval.c \ + retval.h riscv.c rt_sigframe.c rt_sigreturn.c rtc.c \ + rtnl_addr.c rtnl_addrlabel.c rtnl_dcb.c rtnl_link.c rtnl_mdb.c \ + rtnl_neigh.c rtnl_neightbl.c rtnl_netconf.c rtnl_nsid.c \ + rtnl_route.c rtnl_rule.c rtnl_tc.c rtnl_tc_action.c s390.c \ + sched.c sched_attr.h scsi.c seccomp.c sendfile.c sg_io_v3.c \ + sg_io_v4.c shutdown.c sigaltstack.c sigevent.h signal.c \ + signalfd.c sock.c sockaddr.c socketutils.c sparc.c \ + sram_alloc.c stat.c stat.h stat64.c statfs.c statfs.h \ + static_assert.h statx.c statx.h strace.c string_to_uint.c \ + string_to_uint.h swapon.c syscall.c sysctl.c sysent.h \ + sysent_shorthand_defs.h sysent_shorthand_undefs.h sysinfo.c \ + syslog.c sysmips.c term.c time.c times.c trace_event.h \ + truncate.c ubi.c ucopy.c uid.c uid16.c umask.c umount.c \ + uname.c userfaultfd.c ustat.c util.c utime.c utimes.c v4l2.c \ + wait.c wait.h xattr.c xfs_quota_stat.h xlat.c xlat.h xmalloc.c \ + xmalloc.h xstring.h $(strace_SOURCES_check) $(am__append_1) \ + $(am__append_2) $(am__append_7) +strace_SOURCES_check = bpf_attr_check.c CODE_COVERAGE_BRANCH_COVERAGE = 1 CODE_COVERAGE_GENHTML_OPTIONS = $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) \ --prefix $(shell cd $(abs_top_srcdir)/.. && pwd || echo .) @@ -1062,6 +1659,8 @@ EXTRA_DIST = \ CREDITS \ ChangeLog \ ChangeLog-CVS \ + LGPL-2.1-or-later \ + README-configure \ README-linux-ptrace \ debian/changelog \ debian/compat \ @@ -1077,7 +1676,7 @@ EXTRA_DIST = \ debian/strace64.install \ debian/strace64.manpages \ debian/watch \ - errnoent.sh \ + gen_bpf_attr_check.sh \ generate_sen.sh \ ioctl_iocdef.c \ ioctlsort.c \ @@ -1088,33 +1687,36 @@ EXTRA_DIST = \ linux/32/syscallent.h \ linux/64/ioctls_inc.h \ linux/64/syscallent.h \ + linux/aarch64/arch_defs_.h \ + linux/aarch64/arch_get_personality.c \ linux/aarch64/arch_regs.c \ - linux/aarch64/arch_regs.h \ linux/aarch64/arch_sigreturn.c \ - linux/aarch64/errnoent1.h \ linux/aarch64/get_error.c \ linux/aarch64/get_scno.c \ - linux/aarch64/get_syscall_args.c\ + linux/aarch64/get_syscall_args.c \ linux/aarch64/ioctls_arch0.h \ linux/aarch64/ioctls_arch1.h \ linux/aarch64/ioctls_inc0.h \ linux/aarch64/ioctls_inc1.h \ + linux/aarch64/nr_prefix.c \ + linux/aarch64/raw_syscall.h \ linux/aarch64/set_error.c \ linux/aarch64/set_scno.c \ - linux/aarch64/signalent1.h \ + linux/aarch64/shuffle_scno.c \ linux/aarch64/syscallent.h \ linux/aarch64/syscallent1.h \ + linux/alpha/arch_defs_.h \ linux/alpha/arch_getrval2.c \ linux/alpha/arch_regs.c \ - linux/alpha/arch_regs.h \ linux/alpha/arch_sigreturn.c \ linux/alpha/errnoent.h \ linux/alpha/get_error.c \ linux/alpha/get_scno.c \ linux/alpha/get_syscall_args.c \ - linux/alpha/get_syscall_result.c\ + linux/alpha/get_syscall_result.c \ linux/alpha/ioctls_arch0.h \ linux/alpha/ioctls_inc0.h \ + linux/alpha/raw_syscall.h \ linux/alpha/set_error.c \ linux/alpha/set_scno.c \ linux/alpha/signalent.h \ @@ -1126,21 +1728,28 @@ EXTRA_DIST = \ linux/arc/get_syscall_args.c \ linux/arc/ioctls_arch0.h \ linux/arc/ioctls_inc0.h \ + linux/arc/raw_syscall.h \ linux/arc/set_error.c \ linux/arc/set_scno.c \ linux/arc/syscallent.h \ + linux/arch_defs_.h \ + linux/arch_kvm.c \ linux/arch_regs.h \ + linux/arch_rt_sigframe.c \ linux/arch_sigreturn.c \ + linux/arm/arch_defs_.h \ linux/arm/arch_regs.c \ - linux/arm/arch_regs.h \ linux/arm/arch_sigreturn.c \ linux/arm/get_error.c \ linux/arm/get_scno.c \ linux/arm/get_syscall_args.c \ linux/arm/ioctls_arch0.h \ linux/arm/ioctls_inc0.h \ + linux/arm/nr_prefix.c \ + linux/arm/raw_syscall.h \ linux/arm/set_error.c \ linux/arm/set_scno.c \ + linux/arm/shuffle_scno.c \ linux/arm/syscallent.h \ linux/arm/userent.h \ linux/avr32/arch_regs.c \ @@ -1149,10 +1758,12 @@ EXTRA_DIST = \ linux/avr32/get_syscall_args.c \ linux/avr32/ioctls_arch0.h \ linux/avr32/ioctls_inc0.h \ + linux/avr32/raw_syscall.h \ linux/avr32/set_error.c \ linux/avr32/set_scno.c \ linux/avr32/syscallent.h \ linux/avr32/userent.h \ + linux/bfin/arch_defs_.h \ linux/bfin/arch_regs.c \ linux/bfin/get_error.c \ linux/bfin/get_scno.c \ @@ -1160,35 +1771,29 @@ EXTRA_DIST = \ linux/bfin/get_syscall_result.c \ linux/bfin/ioctls_arch0.h \ linux/bfin/ioctls_inc0.h \ + linux/bfin/raw_syscall.h \ + linux/bfin/rt_sigframe.h \ linux/bfin/set_error.c \ linux/bfin/set_scno.c \ linux/bfin/syscallent.h \ + linux/csky/arch_regs.c \ + linux/csky/get_error.c \ + linux/csky/get_scno.c \ + linux/csky/get_syscall_args.c \ + linux/csky/ioctls_arch0.h \ + linux/csky/ioctls_inc0.h \ + linux/csky/raw_syscall.h \ + linux/csky/set_error.c \ + linux/csky/set_scno.c \ + linux/csky/syscallent.h \ linux/bfin/userent.h \ - linux/crisv10/arch_regs.c \ - linux/crisv10/arch_sigreturn.c \ - linux/crisv10/get_error.c \ - linux/crisv10/get_scno.c \ - linux/crisv10/get_syscall_args.c \ - linux/crisv10/get_syscall_result.c \ - linux/crisv10/set_error.c \ - linux/crisv10/set_scno.c \ - linux/crisv10/syscallent.h \ - linux/crisv10/userent.h \ - linux/crisv32/arch_regs.c \ - linux/crisv32/arch_sigreturn.c \ - linux/crisv32/get_error.c \ - linux/crisv32/get_scno.c \ - linux/crisv32/get_syscall_args.c \ - linux/crisv32/get_syscall_result.c \ - linux/crisv32/set_error.c \ - linux/crisv32/set_scno.c \ - linux/crisv32/syscallent.h \ - linux/crisv32/userent.h \ + linux/check_scno.c \ linux/dummy.h \ linux/errnoent.h \ linux/getregs_old.h \ + linux/hppa/arch_defs_.h \ linux/hppa/arch_regs.c \ - linux/hppa/arch_regs.h \ + linux/hppa/arch_rt_sigframe.c \ linux/hppa/errnoent.h \ linux/hppa/get_error.c \ linux/hppa/get_scno.c \ @@ -1196,58 +1801,74 @@ EXTRA_DIST = \ linux/hppa/get_syscall_result.c \ linux/hppa/ioctls_arch0.h \ linux/hppa/ioctls_inc0.h \ + linux/hppa/raw_syscall.h \ + linux/hppa/rt_sigframe.h \ linux/hppa/set_error.c \ linux/hppa/set_scno.c \ linux/hppa/signalent.h \ linux/hppa/syscallent.h \ + linux/hppa/userent.h \ + linux/i386/arch_defs_.h \ + linux/i386/arch_kvm.c \ linux/i386/arch_regs.c \ - linux/i386/arch_regs.h \ + linux/i386/arch_rt_sigframe.c \ linux/i386/arch_sigreturn.c \ linux/i386/get_error.c \ linux/i386/get_scno.c \ linux/i386/get_syscall_args.c \ linux/i386/ioctls_arch0.h \ linux/i386/ioctls_inc0.h \ + linux/i386/raw_syscall.h \ + linux/i386/rt_sigframe.h \ linux/i386/set_error.c \ linux/i386/set_scno.c \ linux/i386/syscallent.h \ linux/i386/userent.h \ linux/i386/userent0.h \ + linux/ia64/arch_defs_.h \ linux/ia64/arch_getrval2.c \ linux/ia64/arch_regs.c \ linux/ia64/arch_regs.h \ - linux/ia64/arch_sigreturn.c \ + linux/ia64/arch_rt_sigframe.c \ linux/ia64/get_error.c \ linux/ia64/get_scno.c \ linux/ia64/get_syscall_args.c \ linux/ia64/ioctls_arch0.h \ linux/ia64/ioctls_inc0.h \ + linux/ia64/raw_syscall.h \ + linux/ia64/rt_sigframe.h \ linux/ia64/set_error.c \ linux/ia64/set_scno.c \ linux/ia64/syscallent.h \ linux/ia64/userent.h \ linux/inet_diag.h \ + linux/m68k/arch_defs_.h \ linux/m68k/arch_regs.c \ - linux/m68k/arch_regs.h \ + linux/m68k/arch_rt_sigframe.c \ linux/m68k/arch_sigreturn.c \ linux/m68k/get_error.c \ linux/m68k/get_scno.c \ linux/m68k/get_syscall_args.c \ linux/m68k/ioctls_arch0.h \ linux/m68k/ioctls_inc0.h \ + linux/m68k/raw_syscall.h \ + linux/m68k/rt_sigframe.h \ linux/m68k/set_error.c \ linux/m68k/set_scno.c \ linux/m68k/syscallent.h \ linux/m68k/userent.h \ linux/metag/arch_regs.c \ + linux/metag/arch_rt_sigframe.c \ linux/metag/get_error.c \ linux/metag/get_scno.c \ linux/metag/get_syscall_args.c \ linux/metag/ioctls_arch0.h \ linux/metag/ioctls_inc0.h \ + linux/metag/raw_syscall.h \ linux/metag/set_error.c \ linux/metag/set_scno.c \ linux/metag/syscallent.h \ + linux/microblaze/arch_defs_.h \ linux/microblaze/arch_regs.c \ linux/microblaze/arch_sigreturn.c \ linux/microblaze/get_error.c \ @@ -1256,13 +1877,14 @@ EXTRA_DIST = \ linux/microblaze/get_syscall_result.c \ linux/microblaze/ioctls_arch0.h \ linux/microblaze/ioctls_inc0.h \ + linux/microblaze/raw_syscall.h \ linux/microblaze/set_error.c \ linux/microblaze/set_scno.c \ linux/microblaze/syscallent.h \ linux/microblaze/userent.h \ + linux/mips/arch_defs_.h \ linux/mips/arch_getrval2.c \ linux/mips/arch_regs.c \ - linux/mips/arch_regs.h \ linux/mips/arch_sigreturn.c \ linux/mips/errnoent.h \ linux/mips/genstub.sh \ @@ -1271,6 +1893,8 @@ EXTRA_DIST = \ linux/mips/get_syscall_args.c \ linux/mips/ioctls_arch0.h \ linux/mips/ioctls_inc0.h \ + linux/mips/raw_syscall.h \ + linux/mips/rt_sigframe.h \ linux/mips/set_error.c \ linux/mips/set_scno.c \ linux/mips/signalent.h \ @@ -1280,30 +1904,34 @@ EXTRA_DIST = \ linux/mips/syscallent-o32.h \ linux/mips/syscallent.h \ linux/mips/userent.h \ - linux/mtd-abi.h \ linux/netlink_diag.h \ + linux/nios2/arch_defs_.h \ linux/nios2/arch_regs.c \ linux/nios2/get_error.c \ linux/nios2/get_scno.c \ linux/nios2/get_syscall_args.c \ linux/nios2/ioctls_arch0.h \ linux/nios2/ioctls_inc0.h \ + linux/nios2/raw_syscall.h \ linux/nios2/set_error.c \ linux/nios2/set_scno.c \ linux/nios2/syscallent.h \ + linux/nr_prefix.c \ linux/or1k/arch_regs.c \ linux/or1k/get_error.c \ linux/or1k/get_scno.c \ linux/or1k/get_syscall_args.c \ linux/or1k/ioctls_arch0.h \ linux/or1k/ioctls_inc0.h \ + linux/or1k/raw_syscall.h \ linux/or1k/set_error.c \ linux/or1k/set_scno.c \ linux/or1k/syscallent.h \ linux/or1k/userent.h \ - linux/personality.h \ + linux/packet_diag.h \ + linux/powerpc/arch_defs_.h \ linux/powerpc/arch_regs.c \ - linux/powerpc/arch_regs.h \ + linux/powerpc/arch_rt_sigframe.c \ linux/powerpc/arch_sigreturn.c \ linux/powerpc/errnoent.h \ linux/powerpc/get_error.c \ @@ -1313,15 +1941,17 @@ EXTRA_DIST = \ linux/powerpc/getregs_old.h \ linux/powerpc/ioctls_arch0.h \ linux/powerpc/ioctls_inc0.h \ + linux/powerpc/raw_syscall.h \ linux/powerpc/set_error.c \ linux/powerpc/set_scno.c \ linux/powerpc/syscallent.h \ linux/powerpc/userent.h \ + linux/powerpc64/arch_defs_.h \ + linux/powerpc64/arch_get_personality.c \ linux/powerpc64/arch_regs.c \ - linux/powerpc64/arch_regs.h \ + linux/powerpc64/arch_rt_sigframe.c \ linux/powerpc64/arch_sigreturn.c \ linux/powerpc64/errnoent.h \ - linux/powerpc64/errnoent1.h \ linux/powerpc64/get_error.c \ linux/powerpc64/get_scno.c \ linux/powerpc64/get_syscall_args.c \ @@ -1331,15 +1961,18 @@ EXTRA_DIST = \ linux/powerpc64/ioctls_arch1.h \ linux/powerpc64/ioctls_inc0.h \ linux/powerpc64/ioctls_inc1.h \ + linux/powerpc64/raw_syscall.h \ + linux/powerpc64/rt_sigframe.h \ linux/powerpc64/set_error.c \ linux/powerpc64/set_scno.c \ - linux/powerpc64/signalent1.h \ linux/powerpc64/syscallent.h \ linux/powerpc64/syscallent1.h \ linux/powerpc64/userent.h \ - linux/ptp_clock.h \ + linux/ptrace_pokeuser.c \ + linux/raw_syscall.h \ + linux/riscv/arch_defs_.h \ + linux/riscv/arch_get_personality.c \ linux/riscv/arch_regs.c \ - linux/riscv/errnoent1.h \ linux/riscv/get_error.c \ linux/riscv/get_scno.c \ linux/riscv/get_syscall_args.c \ @@ -1347,37 +1980,47 @@ EXTRA_DIST = \ linux/riscv/ioctls_arch1.h \ linux/riscv/ioctls_inc0.h \ linux/riscv/ioctls_inc1.h \ + linux/riscv/raw_syscall.h \ linux/riscv/set_error.c \ linux/riscv/set_scno.c \ - linux/riscv/signalent1.h \ linux/riscv/syscallent.h \ linux/riscv/syscallent1.h \ + linux/rt_sigframe.h \ + linux/s390/arch_defs_.h \ linux/s390/arch_regs.c \ - linux/s390/arch_regs.h \ linux/s390/arch_sigreturn.c \ linux/s390/get_error.c \ linux/s390/get_scno.c \ linux/s390/get_syscall_args.c \ linux/s390/ioctls_arch0.h \ linux/s390/ioctls_inc0.h \ + linux/s390/raw_syscall.h \ + linux/s390/rt_sigframe.h \ linux/s390/set_error.c \ linux/s390/set_scno.c \ linux/s390/syscallent.h \ linux/s390/userent.h \ linux/s390/userent0.h \ linux/s390/userent1.h \ + linux/s390x/arch_defs_.h \ + linux/s390x/arch_get_personality.c \ linux/s390x/arch_regs.c \ - linux/s390x/arch_regs.h \ linux/s390x/arch_sigreturn.c \ linux/s390x/get_error.c \ linux/s390x/get_scno.c \ linux/s390x/get_syscall_args.c \ linux/s390x/ioctls_arch0.h \ + linux/s390x/ioctls_arch1.h \ linux/s390x/ioctls_inc0.h \ + linux/s390x/ioctls_inc1.h \ + linux/s390x/raw_syscall.h \ + linux/s390x/rt_sigframe.h \ linux/s390x/set_error.c \ linux/s390x/set_scno.c \ linux/s390x/syscallent.h \ + linux/s390x/syscallent1.h \ linux/s390x/userent.h \ + linux/sh/arch_defs_.h \ linux/sh/arch_getrval2.c \ linux/sh/arch_regs.c \ linux/sh/get_error.c \ @@ -1386,11 +2029,13 @@ EXTRA_DIST = \ linux/sh/get_syscall_result.c \ linux/sh/ioctls_arch0.h \ linux/sh/ioctls_inc0.h \ + linux/sh/raw_syscall.h \ linux/sh/set_error.c \ linux/sh/set_scno.c \ linux/sh/syscallent.h \ linux/sh/userent.h \ linux/sh/userent0.h \ + linux/sh64/arch_defs_.h \ linux/sh64/arch_regs.c \ linux/sh64/arch_regs.h \ linux/sh64/get_error.c \ @@ -1399,54 +2044,64 @@ EXTRA_DIST = \ linux/sh64/get_syscall_result.c \ linux/sh64/ioctls_arch0.h \ linux/sh64/ioctls_inc0.h \ + linux/sh64/raw_syscall.h \ + linux/sh64/rt_sigframe.h \ linux/sh64/set_error.c \ linux/sh64/set_scno.c \ linux/sh64/syscallent.h \ linux/sh64/userent.h \ + linux/shuffle_scno.c \ + linux/signal.h.in \ linux/signalent.h \ + linux/smc_diag.h \ linux/sock_diag.h \ + linux/sparc/arch_defs_.h \ linux/sparc/arch_getrval2.c \ linux/sparc/arch_regs.c \ - linux/sparc/arch_regs.h \ linux/sparc/arch_sigreturn.c \ linux/sparc/errnoent.h \ - linux/sparc/gen.pl \ linux/sparc/get_error.c \ linux/sparc/get_scno.c \ linux/sparc/get_syscall_args.c \ linux/sparc/ioctls_arch0.h \ linux/sparc/ioctls_inc0.h \ + linux/sparc/raw_syscall.h \ + linux/sparc/rt_sigframe.h \ linux/sparc/set_error.c \ linux/sparc/set_scno.c \ linux/sparc/signalent.h \ linux/sparc/syscallent.h \ linux/sparc/userent.h \ + linux/sparc64/arch_defs_.h \ + linux/sparc64/arch_get_personality.c \ linux/sparc64/arch_getrval2.c \ linux/sparc64/arch_regs.c \ - linux/sparc64/arch_regs.h \ + linux/sparc64/arch_rt_sigframe.c \ linux/sparc64/arch_sigreturn.c \ linux/sparc64/errnoent.h \ - linux/sparc64/errnoent1.h \ linux/sparc64/get_error.c \ linux/sparc64/get_scno.c \ - linux/sparc64/get_syscall_args.c\ + linux/sparc64/get_syscall_args.c \ linux/sparc64/ioctls_arch0.h \ linux/sparc64/ioctls_arch1.h \ linux/sparc64/ioctls_inc0.h \ linux/sparc64/ioctls_inc1.h \ + linux/sparc64/raw_syscall.h \ + linux/sparc64/rt_sigframe.h \ linux/sparc64/set_error.c \ linux/sparc64/set_scno.c \ linux/sparc64/signalent.h \ - linux/sparc64/signalent1.h \ linux/sparc64/syscallent.h \ linux/sparc64/syscallent1.h \ linux/sparc64/userent.h \ linux/subcall.h \ + linux/subcall32.h \ + linux/subcall64.h \ linux/syscall.h \ + linux/tile/arch_defs_.h \ + linux/tile/arch_get_personality.c \ linux/tile/arch_regs.c \ - linux/tile/arch_regs.h \ linux/tile/arch_sigreturn.c \ - linux/tile/errnoent1.h \ linux/tile/get_error.c \ linux/tile/get_scno.c \ linux/tile/get_syscall_args.c \ @@ -1454,20 +2109,24 @@ EXTRA_DIST = \ linux/tile/ioctls_arch1.h \ linux/tile/ioctls_inc0.h \ linux/tile/ioctls_inc1.h \ + linux/tile/raw_syscall.h \ + linux/tile/rt_sigframe.h \ linux/tile/set_error.c \ linux/tile/set_scno.c \ - linux/tile/signalent1.h \ linux/tile/syscallent.h \ linux/tile/syscallent1.h \ linux/tile/userent.h \ - linux/ubi-user.h \ linux/unix_diag.h \ linux/userent.h \ linux/userent0.h \ + linux/x32/arch_defs_.h \ + linux/x32/arch_get_personality.c \ + linux/x32/arch_kvm.c \ linux/x32/arch_regs.c \ linux/x32/arch_regs.h \ + linux/x32/arch_rt_sigframe.c \ linux/x32/arch_sigreturn.c \ - linux/x32/errnoent1.h \ + linux/x32/check_scno.c \ linux/x32/get_error.c \ linux/x32/get_scno.c \ linux/x32/get_syscall_args.c \ @@ -1475,18 +2134,22 @@ EXTRA_DIST = \ linux/x32/ioctls_arch1.h \ linux/x32/ioctls_inc0.h \ linux/x32/ioctls_inc1.h \ + linux/x32/ptrace_pokeuser.c \ + linux/x32/raw_syscall.h \ + linux/x32/rt_sigframe.h \ linux/x32/set_error.c \ linux/x32/set_scno.c \ - linux/x32/signalent1.h \ + linux/x32/shuffle_scno.c \ linux/x32/syscallent.h \ linux/x32/syscallent1.h \ linux/x32/userent.h \ + linux/x86_64/arch_defs_.h \ + linux/x86_64/arch_get_personality.c \ + linux/x86_64/arch_kvm.c \ linux/x86_64/arch_regs.c \ linux/x86_64/arch_regs.h \ + linux/x86_64/arch_rt_sigframe.c \ linux/x86_64/arch_sigreturn.c \ - linux/x86_64/errnoent1.h \ - linux/x86_64/errnoent2.h \ - linux/x86_64/gentab.pl \ linux/x86_64/get_error.c \ linux/x86_64/get_scno.c \ linux/x86_64/get_syscall_args.c \ @@ -1498,10 +2161,11 @@ EXTRA_DIST = \ linux/x86_64/ioctls_inc0.h \ linux/x86_64/ioctls_inc1.h \ linux/x86_64/ioctls_inc2.h \ + linux/x86_64/raw_syscall.h \ + linux/x86_64/rt_sigframe.h \ linux/x86_64/set_error.c \ linux/x86_64/set_scno.c \ - linux/x86_64/signalent1.h \ - linux/x86_64/signalent2.h \ + linux/x86_64/shuffle_scno.c \ linux/x86_64/syscallent.h \ linux/x86_64/syscallent1.h \ linux/x86_64/syscallent2.h \ @@ -1513,38 +2177,34 @@ EXTRA_DIST = \ linux/xtensa/get_syscall_result.c \ linux/xtensa/ioctls_arch0.h \ linux/xtensa/ioctls_inc0.h \ + linux/xtensa/raw_syscall.h \ linux/xtensa/set_error.c \ linux/xtensa/set_scno.c \ linux/xtensa/syscallent.h \ linux/xtensa/userent.h \ - maint/ioctls_gen.sh \ - maint/ioctls_hex.sh \ - maint/ioctls_sym.sh \ - maint/print_ioctlent.c \ mpers.awk \ mpers.sh \ mpers_test.sh \ mpers_xlat.h \ scno.head \ - signalent.sh \ strace-graph \ strace-log-merge \ strace.spec \ - syscallent.sh \ $(XLAT_INPUT_FILES) \ $(XLAT_HEADER_FILES) \ xlat/gen.sh \ - xlate.el + # end of EXTRA_DIST strace_SOURCES_c = \ $(filter %.c,$(strace_SOURCES)) $(filter %.c,$(libstrace_a_SOURCES)) +sys_func_h_sources = $(filter-out $(strace_SOURCES_check),$(strace_SOURCES_c)) syscallent_names = subcall.h syscallent.h syscallent1.h \ syscallent-n32.h syscallent-n64.h syscallent-o32.h syscallent_patterns = $(patsubst %,\%/%,$(syscallent_names)) syscallent_files = $(filter $(syscallent_patterns),$(EXTRA_DIST)) -today = $(shell date +%Y-%m-%d) +today = $(shell LC_TIME=C date -u +%Y-%m-%d) version_regexp = $(subst .,\.,$(VERSION)) news_check_regexp = 'Noteworthy changes in release $(version_regexp) ($(today))' ioctlsort_CC = $(CC_FOR_BUILD) @@ -1556,23 +2216,24 @@ ioctlsort_LDFLAGS = $(AM_LDFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) ioctls_inc_h = $(wildcard $(srcdir)/$(OS)/$(ARCH)/ioctls_inc*.h) ioctlent_h = $(patsubst $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%,ioctlent%,$(ioctls_inc_h)) ioctl_redefs_h = $(filter-out ioctl_redefs0.h,$(subst ioctlent,ioctl_redefs,$(ioctlent_h))) -BUILT_SOURCES = $(ioctl_redefs_h) $(ioctlent_h) native_printer_decls.h \ - native_printer_defs.h printers.h sen.h sys_func.h .version \ - $(am__append_7) $(am__append_11) +BUILT_SOURCES = $(ioctl_redefs_h) $(ioctlent_h) bpf_attr_check.c \ + native_printer_decls.h native_printer_defs.h printers.h sen.h \ + sys_func.h .version scno.h $(am__append_16) $(am__append_20) CLEANFILES = $(ioctl_redefs_h) $(ioctlent_h) $(mpers_preproc_files) \ - ioctl_iocdef.h ioctl_iocdef.i native_printer_decls.h \ - native_printer_defs.h printers.h sen.h sys_func.h syscallent.i \ - scno.h $(am__append_8) $(am__append_12) -DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h + ioctl_iocdef.h ioctl_iocdef.i bpf_attr_check.c \ + native_printer_decls.h native_printer_defs.h printers.h sen.h \ + sys_func.h syscallent.i scno.h $(am__append_17) \ + $(am__append_21) +DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h linux/linux/signal.h SCNO_CPPFLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(ARCH_MFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) digits = [[:digit:]][[:digit:]]* al_nums = [[:alnum:]_][[:alnum:]_]* -SCNO_SED = /TRACE_INDIRECT_SUBCALL/d; s/^\[[[:space:]]*\($(digits)\)\][[:space:]]*=[[:space:]]*{[^,]*,[^,]*,[^,]*,[[:space:]]*"\($(al_nums)\)"[[:space:]]*},.*/\#ifndef __NR_\2\n\# define __NR_\2 (SYSCALL_BIT | \1)\n\#endif/p +SCNO_SED = /TRACE_INDIRECT_SUBCALL/d; s/^\[[[:space:]]*\($(digits)\([[:space:]]*+[[:space:]]*$(digits)\)\?\)\][[:space:]]*=[[:space:]]*{[^,]*,[^,]*,[^,]*,[[:space:]]*"\($(al_nums)\)"[[:space:]]*},.*/\#ifndef __NR_\3\n\# define __NR_\3 (SYSCALL_BIT | (\1))\n\#endif/p # Generated by ./generate_mpers_am.sh; do not edit. -mpers_source_files = block.c btrfs.c dirent.c evdev.c fetch_seccomp_fprog.c fetch_struct_flock.c fetch_struct_mmsghdr.c fetch_struct_msghdr.c fetch_struct_stat.c fetch_struct_stat64.c fetch_struct_statfs.c hdio.c ipc_msgctl.c ipc_shmctl.c loop.c mtd.c print_mq_attr.c print_msgbuf.c print_sg_req_info.c print_sigevent.c print_time.c print_timespec.c print_timeval.c print_timex.c printrusage.c printsiginfo.c rtc.c sg_io_v3.c sigaltstack.c sock.c sysinfo.c times.c ustat.c utime.c v4l2.c +mpers_source_files = block.c btrfs.c dirent.c evdev_mpers.c fetch_bpf_fprog.c fetch_struct_flock.c fetch_struct_keyctl_kdf_params.c fetch_struct_mmsghdr.c fetch_struct_msghdr.c fetch_struct_stat.c fetch_struct_stat64.c fetch_struct_statfs.c fetch_struct_xfs_quotastat.c hdio.c ipc_msgctl.c ipc_shmctl.c loop.c mtd.c perf_ioctl.c print_aio_sigset.c print_group_req.c print_mq_attr.c print_msgbuf.c print_sg_req_info.c print_sigevent.c print_time.c print_timespec.c print_timeval.c printrusage.c printsiginfo.c rt_sigreturn.c rtc.c sg_io_v3.c sigaltstack.c sock.c sysinfo.c times.c ustat.c utime.c v4l2.c # defines mpers_source_files srcdir_mpers_source_files = $(patsubst %,$(srcdir)/%,$(mpers_source_files)) @@ -1615,17 +2276,16 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/xl echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__maybe_remake_depfiles);; \ esac; -$(srcdir)/xlat/Makemodule.am $(srcdir)/scno.am $(srcdir)/mpers.am: +$(srcdir)/xlat/Makemodule.am $(srcdir)/scno.am $(srcdir)/mpers.am $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck @@ -1650,28 +2310,14 @@ $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) distclean-hdr: -rm -f config.h stamp-h1 +strace.1: $(top_builddir)/config.status $(srcdir)/strace.1.in + cd $(top_builddir) && $(SHELL) ./config.status $@ +strace-log-merge.1: $(top_builddir)/config.status $(srcdir)/strace-log-merge.1.in + cd $(top_builddir) && $(SHELL) ./config.status $@ strace.spec: $(top_builddir)/config.status $(srcdir)/strace.spec.in cd $(top_builddir) && $(SHELL) ./config.status $@ debian/changelog: $(top_builddir)/config.status $(top_srcdir)/debian/changelog.in cd $(top_builddir) && $(SHELL) ./config.status $@ - -clean-noinstLIBRARIES: - -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) - -libmpers-m32.a: $(libmpers_m32_a_OBJECTS) $(libmpers_m32_a_DEPENDENCIES) $(EXTRA_libmpers_m32_a_DEPENDENCIES) - $(AM_V_at)-rm -f libmpers-m32.a - $(AM_V_AR)$(libmpers_m32_a_AR) libmpers-m32.a $(libmpers_m32_a_OBJECTS) $(libmpers_m32_a_LIBADD) - $(AM_V_at)$(RANLIB) libmpers-m32.a - -libmpers-mx32.a: $(libmpers_mx32_a_OBJECTS) $(libmpers_mx32_a_DEPENDENCIES) $(EXTRA_libmpers_mx32_a_DEPENDENCIES) - $(AM_V_at)-rm -f libmpers-mx32.a - $(AM_V_AR)$(libmpers_mx32_a_AR) libmpers-mx32.a $(libmpers_mx32_a_OBJECTS) $(libmpers_mx32_a_LIBADD) - $(AM_V_at)$(RANLIB) libmpers-mx32.a - -libstrace.a: $(libstrace_a_OBJECTS) $(libstrace_a_DEPENDENCIES) $(EXTRA_libstrace_a_DEPENDENCIES) - $(AM_V_at)-rm -f libstrace.a - $(AM_V_AR)$(libstrace_a_AR) libstrace.a $(libstrace_a_OBJECTS) $(libstrace_a_LIBADD) - $(AM_V_at)$(RANLIB) libstrace.a install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ @@ -1715,6 +2361,24 @@ uninstall-binPROGRAMS: clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) + +libmpers-m32.a: $(libmpers_m32_a_OBJECTS) $(libmpers_m32_a_DEPENDENCIES) $(EXTRA_libmpers_m32_a_DEPENDENCIES) + $(AM_V_at)-rm -f libmpers-m32.a + $(AM_V_AR)$(libmpers_m32_a_AR) libmpers-m32.a $(libmpers_m32_a_OBJECTS) $(libmpers_m32_a_LIBADD) + $(AM_V_at)$(RANLIB) libmpers-m32.a + +libmpers-mx32.a: $(libmpers_mx32_a_OBJECTS) $(libmpers_mx32_a_DEPENDENCIES) $(EXTRA_libmpers_mx32_a_DEPENDENCIES) + $(AM_V_at)-rm -f libmpers-mx32.a + $(AM_V_AR)$(libmpers_mx32_a_AR) libmpers-mx32.a $(libmpers_mx32_a_OBJECTS) $(libmpers_mx32_a_LIBADD) + $(AM_V_at)$(RANLIB) libmpers-mx32.a + +libstrace.a: $(libstrace_a_OBJECTS) $(libstrace_a_DEPENDENCIES) $(EXTRA_libstrace_a_DEPENDENCIES) + $(AM_V_at)-rm -f libstrace.a + $(AM_V_AR)$(libstrace_a_AR) libstrace.a $(libstrace_a_OBJECTS) $(libstrace_a_LIBADD) + $(AM_V_at)$(RANLIB) libstrace.a + strace$(EXEEXT): $(strace_OBJECTS) $(strace_DEPENDENCIES) $(EXTRA_strace_DEPENDENCIES) @rm -f strace$(EXEEXT) $(AM_V_CCLD)$(strace_LINK) $(strace_OBJECTS) $(strace_LDADD) $(LIBS) @@ -1760,241 +2424,331 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-block.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-btrfs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-dirent.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-evdev.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-fetch_seccomp_fprog.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-fetch_struct_flock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-fetch_struct_mmsghdr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-fetch_struct_msghdr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-fetch_struct_stat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-fetch_struct_stat64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-fetch_struct_statfs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-hdio.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-ipc_msgctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-ipc_shmctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-loop.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-mtd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_mq_attr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_msgbuf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_sg_req_info.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_sigevent.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_time.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_timespec.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_timeval.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_timex.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-printrusage.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-printsiginfo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-rtc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-sg_io_v3.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-sigaltstack.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-sock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-sysinfo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-times.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-ustat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-utime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-v4l2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-block.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-btrfs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-dirent.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-evdev.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-fetch_seccomp_fprog.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-fetch_struct_flock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-fetch_struct_mmsghdr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-fetch_struct_msghdr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-fetch_struct_stat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-fetch_struct_stat64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-fetch_struct_statfs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-hdio.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-ipc_msgctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-ipc_shmctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-loop.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-mtd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_mq_attr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_msgbuf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_sg_req_info.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_sigevent.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_time.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_timespec.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_timeval.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_timex.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-printrusage.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-printsiginfo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-rtc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-sg_io_v3.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-sigaltstack.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-sock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-sysinfo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-times.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-ustat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-utime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-v4l2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-fstatfs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-fstatfs64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-ipc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-socketcall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-statfs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-statfs64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-sync_file_range.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-sync_file_range2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-upeek.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-upoke.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-access.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-affinity.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-aio.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-alpha.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-bjm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-block.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-bpf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-btrfs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-cacheflush.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-capability.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-chdir.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-chmod.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-clone.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-copy_file_range.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-count.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-desc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-dirent.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-dirent64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-dm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-epoll.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-evdev.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-eventfd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-execve.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fadvise.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fallocate.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fanotify.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fchownat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fcntl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fetch_seccomp_fprog.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fetch_struct_flock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fetch_struct_mmsghdr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fetch_struct_msghdr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fetch_struct_stat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fetch_struct_stat64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fetch_struct_statfs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-file_handle.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-file_ioctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-flock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fs_x_ioctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-futex.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-get_robust_list.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-getcpu.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-getcwd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-getrandom.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-hdio.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-hostname.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-inotify.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-io.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ioctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ioperm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-iopl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ioprio.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ipc_msg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ipc_msgctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ipc_sem.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ipc_shm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ipc_shmctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-kcmp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-kexec.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-keyctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ldt.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-link.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-lookup_dcookie.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-loop.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-lseek.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-mem.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-membarrier.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-memfd_create.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-mknod.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-mmsghdr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-mount.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-mq.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-msghdr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-mtd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-net.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-netlink.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-numa.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-oldstat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-open.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-or1k_atomic.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-pathtrace.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-perf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-personality.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-pkeys.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-poll.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-prctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_dev_t.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_mq_attr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_msgbuf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_sg_req_info.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_sigevent.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_statfs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_struct_stat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_time.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_timespec.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_timeval.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_timex.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-printmode.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-printrusage.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-printsiginfo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-process.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-process_vm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ptp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-qualify.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-quota.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-readahead.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-readlink.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-reboot.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-renameat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-resource.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rtc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sched.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-scsi.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-seccomp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sendfile.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sg_io_v3.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sg_io_v4.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sigaltstack.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-signal.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-signalfd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sigreturn.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sockaddr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-socketutils.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sram_alloc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-stat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-stat64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-statfs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-strace.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-swapon.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-syscall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sysctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sysinfo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-syslog.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sysmips.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-term.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-time.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-times.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-truncate.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ubi.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-uid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-uid16.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-umask.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-umount.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-uname.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-unwind.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-userfaultfd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ustat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-util.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-utime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-utimes.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-v4l2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-wait.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-xattr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-xmalloc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-block.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-btrfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-dirent.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-evdev_mpers.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-fetch_bpf_fprog.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-fetch_struct_flock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-fetch_struct_keyctl_kdf_params.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-fetch_struct_mmsghdr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-fetch_struct_msghdr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-fetch_struct_stat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-fetch_struct_stat64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-fetch_struct_statfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-fetch_struct_xfs_quotastat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-hdio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-ipc_msgctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-ipc_shmctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-loop.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-mtd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-perf_ioctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_aio_sigset.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_group_req.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_mq_attr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_msgbuf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_sg_req_info.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_sigevent.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_time.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_timespec.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-print_timeval.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-printrusage.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-printsiginfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-rt_sigreturn.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-rtc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-sg_io_v3.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-sigaltstack.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-sock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-sysinfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-times.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-ustat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-utime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_m32_a-v4l2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-block.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-btrfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-dirent.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-evdev_mpers.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-fetch_bpf_fprog.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-fetch_struct_flock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-fetch_struct_keyctl_kdf_params.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-fetch_struct_mmsghdr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-fetch_struct_msghdr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-fetch_struct_stat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-fetch_struct_stat64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-fetch_struct_statfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-fetch_struct_xfs_quotastat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-hdio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-ipc_msgctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-ipc_shmctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-loop.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-mtd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-perf_ioctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_aio_sigset.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_group_req.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_mq_attr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_msgbuf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_sg_req_info.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_sigevent.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_time.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_timespec.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-print_timeval.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-printrusage.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-printsiginfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-rt_sigreturn.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-rtc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-sg_io_v3.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-sigaltstack.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-sock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-sysinfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-times.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-ustat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-utime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-v4l2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-fetch_indirect_syscall_args.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-fstatfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-fstatfs64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-getpagesize.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-ipc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-mmap_cache.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-sigreturn.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-socketcall.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-statfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-statfs64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-sync_file_range.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-sync_file_range2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-upeek.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-upoke.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-access.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-affinity.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-aio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-alpha.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-basic_filters.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-bind.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-bjm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-block.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-bpf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-bpf_attr_check.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-bpf_filter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-bpf_seccomp_filter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-bpf_sock_filter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-btrfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-cacheflush.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-capability.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-chdir.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-chmod.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-clone.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-copy_file_range.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-count.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-delay.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-desc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-dirent.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-dirent64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-dm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-dyxlat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-epoll.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-error_prints.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-evdev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-evdev_mpers.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-eventfd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-execve.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fadvise.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fallocate.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fanotify.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fchownat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fcntl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fetch_bpf_fprog.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fetch_struct_flock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fetch_struct_keyctl_kdf_params.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fetch_struct_mmsghdr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fetch_struct_msghdr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fetch_struct_stat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fetch_struct_stat64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fetch_struct_statfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fetch_struct_xfs_quotastat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-file_handle.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-file_ioctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-filter_qualify.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-flock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-fs_x_ioctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-futex.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-get_personality.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-get_robust_list.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-getcpu.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-getcwd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-getrandom.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-hdio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-hostname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-inotify.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-inotify_ioctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-io.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-io_uring.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ioctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ioperm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-iopl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ioprio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ipc_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ipc_msgctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ipc_sem.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ipc_shm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ipc_shmctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-kcmp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-kexec.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-keyctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-kvm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ldt.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-link.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-listen.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-lookup_dcookie.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-loop.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-lseek.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-mem.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-membarrier.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-memfd_create.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-mknod.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-mmap_notify.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-mmsghdr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-mount.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-mq.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-msghdr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-mtd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-nbd_ioctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-net.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-netlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-netlink_crypto.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-netlink_inet_diag.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-netlink_kobject_uevent.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-netlink_netfilter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-netlink_netlink_diag.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-netlink_packet_diag.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-netlink_route.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-netlink_selinux.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-netlink_smc_diag.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-netlink_sock_diag.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-netlink_unix_diag.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-nlattr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-nsfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-numa.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-number_set.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-oldstat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-open.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-or1k_atomic.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-pathtrace.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-perf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-perf_ioctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-personality.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-pkeys.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-poll.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-prctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_aio_sigset.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_dev_t.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_group_req.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_ifindex.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_instruction_pointer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_kernel_version.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_mac.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_mq_attr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_msgbuf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_sg_req_info.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_sigevent.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_statfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_struct_stat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_time.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_timespec.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_timespec32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_timespec64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_timeval.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_timeval64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-print_timex.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-printmode.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-printrusage.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-printsiginfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-process.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-process_vm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ptp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ptrace_syscall_info.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-quota.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-random_ioctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-readahead.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-readlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-reboot.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-renameat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-resource.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-retval.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-riscv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rt_sigframe.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rt_sigreturn.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rtc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rtnl_addr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rtnl_addrlabel.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rtnl_dcb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rtnl_link.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rtnl_mdb.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rtnl_neigh.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rtnl_neightbl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rtnl_netconf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rtnl_nsid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rtnl_route.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rtnl_rule.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rtnl_tc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rtnl_tc_action.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-s390.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sched.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-scsi.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-seccomp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sendfile.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sg_io_v3.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sg_io_v4.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-shutdown.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sigaltstack.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-signal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-signalfd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sockaddr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-socketutils.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sparc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sram_alloc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-stat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-stat64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-statfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-statx.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-strace.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-string_to_uint.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-swapon.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-syscall.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sysctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sysinfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-syslog.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sysmips.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-term.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-time.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-times.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-truncate.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ubi.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ucopy.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-uid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-uid16.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-umask.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-umount.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-uname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-unwind-libdw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-unwind-libunwind.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-unwind.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-userfaultfd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ustat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-util.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-utime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-utimes.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-v4l2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-wait.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-xattr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-xlat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-xmalloc.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -2052,33 +2806,33 @@ libmpers_m32_a-dirent.obj: dirent.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-dirent.obj `if test -f 'dirent.c'; then $(CYGPATH_W) 'dirent.c'; else $(CYGPATH_W) '$(srcdir)/dirent.c'; fi` -libmpers_m32_a-evdev.o: evdev.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-evdev.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-evdev.Tpo -c -o libmpers_m32_a-evdev.o `test -f 'evdev.c' || echo '$(srcdir)/'`evdev.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-evdev.Tpo $(DEPDIR)/libmpers_m32_a-evdev.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='evdev.c' object='libmpers_m32_a-evdev.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-evdev_mpers.o: evdev_mpers.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-evdev_mpers.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-evdev_mpers.Tpo -c -o libmpers_m32_a-evdev_mpers.o `test -f 'evdev_mpers.c' || echo '$(srcdir)/'`evdev_mpers.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-evdev_mpers.Tpo $(DEPDIR)/libmpers_m32_a-evdev_mpers.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='evdev_mpers.c' object='libmpers_m32_a-evdev_mpers.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-evdev.o `test -f 'evdev.c' || echo '$(srcdir)/'`evdev.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-evdev_mpers.o `test -f 'evdev_mpers.c' || echo '$(srcdir)/'`evdev_mpers.c -libmpers_m32_a-evdev.obj: evdev.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-evdev.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-evdev.Tpo -c -o libmpers_m32_a-evdev.obj `if test -f 'evdev.c'; then $(CYGPATH_W) 'evdev.c'; else $(CYGPATH_W) '$(srcdir)/evdev.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-evdev.Tpo $(DEPDIR)/libmpers_m32_a-evdev.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='evdev.c' object='libmpers_m32_a-evdev.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-evdev_mpers.obj: evdev_mpers.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-evdev_mpers.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-evdev_mpers.Tpo -c -o libmpers_m32_a-evdev_mpers.obj `if test -f 'evdev_mpers.c'; then $(CYGPATH_W) 'evdev_mpers.c'; else $(CYGPATH_W) '$(srcdir)/evdev_mpers.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-evdev_mpers.Tpo $(DEPDIR)/libmpers_m32_a-evdev_mpers.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='evdev_mpers.c' object='libmpers_m32_a-evdev_mpers.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-evdev.obj `if test -f 'evdev.c'; then $(CYGPATH_W) 'evdev.c'; else $(CYGPATH_W) '$(srcdir)/evdev.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-evdev_mpers.obj `if test -f 'evdev_mpers.c'; then $(CYGPATH_W) 'evdev_mpers.c'; else $(CYGPATH_W) '$(srcdir)/evdev_mpers.c'; fi` -libmpers_m32_a-fetch_seccomp_fprog.o: fetch_seccomp_fprog.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_seccomp_fprog.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_seccomp_fprog.Tpo -c -o libmpers_m32_a-fetch_seccomp_fprog.o `test -f 'fetch_seccomp_fprog.c' || echo '$(srcdir)/'`fetch_seccomp_fprog.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-fetch_seccomp_fprog.Tpo $(DEPDIR)/libmpers_m32_a-fetch_seccomp_fprog.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_seccomp_fprog.c' object='libmpers_m32_a-fetch_seccomp_fprog.o' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-fetch_bpf_fprog.o: fetch_bpf_fprog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_bpf_fprog.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_bpf_fprog.Tpo -c -o libmpers_m32_a-fetch_bpf_fprog.o `test -f 'fetch_bpf_fprog.c' || echo '$(srcdir)/'`fetch_bpf_fprog.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-fetch_bpf_fprog.Tpo $(DEPDIR)/libmpers_m32_a-fetch_bpf_fprog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_bpf_fprog.c' object='libmpers_m32_a-fetch_bpf_fprog.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_seccomp_fprog.o `test -f 'fetch_seccomp_fprog.c' || echo '$(srcdir)/'`fetch_seccomp_fprog.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_bpf_fprog.o `test -f 'fetch_bpf_fprog.c' || echo '$(srcdir)/'`fetch_bpf_fprog.c -libmpers_m32_a-fetch_seccomp_fprog.obj: fetch_seccomp_fprog.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_seccomp_fprog.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_seccomp_fprog.Tpo -c -o libmpers_m32_a-fetch_seccomp_fprog.obj `if test -f 'fetch_seccomp_fprog.c'; then $(CYGPATH_W) 'fetch_seccomp_fprog.c'; else $(CYGPATH_W) '$(srcdir)/fetch_seccomp_fprog.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-fetch_seccomp_fprog.Tpo $(DEPDIR)/libmpers_m32_a-fetch_seccomp_fprog.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_seccomp_fprog.c' object='libmpers_m32_a-fetch_seccomp_fprog.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_m32_a-fetch_bpf_fprog.obj: fetch_bpf_fprog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_bpf_fprog.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_bpf_fprog.Tpo -c -o libmpers_m32_a-fetch_bpf_fprog.obj `if test -f 'fetch_bpf_fprog.c'; then $(CYGPATH_W) 'fetch_bpf_fprog.c'; else $(CYGPATH_W) '$(srcdir)/fetch_bpf_fprog.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-fetch_bpf_fprog.Tpo $(DEPDIR)/libmpers_m32_a-fetch_bpf_fprog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_bpf_fprog.c' object='libmpers_m32_a-fetch_bpf_fprog.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_seccomp_fprog.obj `if test -f 'fetch_seccomp_fprog.c'; then $(CYGPATH_W) 'fetch_seccomp_fprog.c'; else $(CYGPATH_W) '$(srcdir)/fetch_seccomp_fprog.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_bpf_fprog.obj `if test -f 'fetch_bpf_fprog.c'; then $(CYGPATH_W) 'fetch_bpf_fprog.c'; else $(CYGPATH_W) '$(srcdir)/fetch_bpf_fprog.c'; fi` libmpers_m32_a-fetch_struct_flock.o: fetch_struct_flock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_struct_flock.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_struct_flock.Tpo -c -o libmpers_m32_a-fetch_struct_flock.o `test -f 'fetch_struct_flock.c' || echo '$(srcdir)/'`fetch_struct_flock.c @@ -2094,6 +2848,20 @@ libmpers_m32_a-fetch_struct_flock.obj: fetch_struct_flock.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_struct_flock.obj `if test -f 'fetch_struct_flock.c'; then $(CYGPATH_W) 'fetch_struct_flock.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_flock.c'; fi` +libmpers_m32_a-fetch_struct_keyctl_kdf_params.o: fetch_struct_keyctl_kdf_params.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_struct_keyctl_kdf_params.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_struct_keyctl_kdf_params.Tpo -c -o libmpers_m32_a-fetch_struct_keyctl_kdf_params.o `test -f 'fetch_struct_keyctl_kdf_params.c' || echo '$(srcdir)/'`fetch_struct_keyctl_kdf_params.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-fetch_struct_keyctl_kdf_params.Tpo $(DEPDIR)/libmpers_m32_a-fetch_struct_keyctl_kdf_params.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_keyctl_kdf_params.c' object='libmpers_m32_a-fetch_struct_keyctl_kdf_params.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_struct_keyctl_kdf_params.o `test -f 'fetch_struct_keyctl_kdf_params.c' || echo '$(srcdir)/'`fetch_struct_keyctl_kdf_params.c + +libmpers_m32_a-fetch_struct_keyctl_kdf_params.obj: fetch_struct_keyctl_kdf_params.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_struct_keyctl_kdf_params.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_struct_keyctl_kdf_params.Tpo -c -o libmpers_m32_a-fetch_struct_keyctl_kdf_params.obj `if test -f 'fetch_struct_keyctl_kdf_params.c'; then $(CYGPATH_W) 'fetch_struct_keyctl_kdf_params.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_keyctl_kdf_params.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-fetch_struct_keyctl_kdf_params.Tpo $(DEPDIR)/libmpers_m32_a-fetch_struct_keyctl_kdf_params.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_keyctl_kdf_params.c' object='libmpers_m32_a-fetch_struct_keyctl_kdf_params.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_struct_keyctl_kdf_params.obj `if test -f 'fetch_struct_keyctl_kdf_params.c'; then $(CYGPATH_W) 'fetch_struct_keyctl_kdf_params.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_keyctl_kdf_params.c'; fi` + libmpers_m32_a-fetch_struct_mmsghdr.o: fetch_struct_mmsghdr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_struct_mmsghdr.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_struct_mmsghdr.Tpo -c -o libmpers_m32_a-fetch_struct_mmsghdr.o `test -f 'fetch_struct_mmsghdr.c' || echo '$(srcdir)/'`fetch_struct_mmsghdr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-fetch_struct_mmsghdr.Tpo $(DEPDIR)/libmpers_m32_a-fetch_struct_mmsghdr.Po @@ -2164,6 +2932,20 @@ libmpers_m32_a-fetch_struct_statfs.obj: fetch_struct_statfs.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_struct_statfs.obj `if test -f 'fetch_struct_statfs.c'; then $(CYGPATH_W) 'fetch_struct_statfs.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_statfs.c'; fi` +libmpers_m32_a-fetch_struct_xfs_quotastat.o: fetch_struct_xfs_quotastat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_struct_xfs_quotastat.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_struct_xfs_quotastat.Tpo -c -o libmpers_m32_a-fetch_struct_xfs_quotastat.o `test -f 'fetch_struct_xfs_quotastat.c' || echo '$(srcdir)/'`fetch_struct_xfs_quotastat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-fetch_struct_xfs_quotastat.Tpo $(DEPDIR)/libmpers_m32_a-fetch_struct_xfs_quotastat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_xfs_quotastat.c' object='libmpers_m32_a-fetch_struct_xfs_quotastat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_struct_xfs_quotastat.o `test -f 'fetch_struct_xfs_quotastat.c' || echo '$(srcdir)/'`fetch_struct_xfs_quotastat.c + +libmpers_m32_a-fetch_struct_xfs_quotastat.obj: fetch_struct_xfs_quotastat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-fetch_struct_xfs_quotastat.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-fetch_struct_xfs_quotastat.Tpo -c -o libmpers_m32_a-fetch_struct_xfs_quotastat.obj `if test -f 'fetch_struct_xfs_quotastat.c'; then $(CYGPATH_W) 'fetch_struct_xfs_quotastat.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_xfs_quotastat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-fetch_struct_xfs_quotastat.Tpo $(DEPDIR)/libmpers_m32_a-fetch_struct_xfs_quotastat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_xfs_quotastat.c' object='libmpers_m32_a-fetch_struct_xfs_quotastat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-fetch_struct_xfs_quotastat.obj `if test -f 'fetch_struct_xfs_quotastat.c'; then $(CYGPATH_W) 'fetch_struct_xfs_quotastat.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_xfs_quotastat.c'; fi` + libmpers_m32_a-hdio.o: hdio.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-hdio.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-hdio.Tpo -c -o libmpers_m32_a-hdio.o `test -f 'hdio.c' || echo '$(srcdir)/'`hdio.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-hdio.Tpo $(DEPDIR)/libmpers_m32_a-hdio.Po @@ -2234,6 +3016,48 @@ libmpers_m32_a-mtd.obj: mtd.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-mtd.obj `if test -f 'mtd.c'; then $(CYGPATH_W) 'mtd.c'; else $(CYGPATH_W) '$(srcdir)/mtd.c'; fi` +libmpers_m32_a-perf_ioctl.o: perf_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-perf_ioctl.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-perf_ioctl.Tpo -c -o libmpers_m32_a-perf_ioctl.o `test -f 'perf_ioctl.c' || echo '$(srcdir)/'`perf_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-perf_ioctl.Tpo $(DEPDIR)/libmpers_m32_a-perf_ioctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='perf_ioctl.c' object='libmpers_m32_a-perf_ioctl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-perf_ioctl.o `test -f 'perf_ioctl.c' || echo '$(srcdir)/'`perf_ioctl.c + +libmpers_m32_a-perf_ioctl.obj: perf_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-perf_ioctl.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-perf_ioctl.Tpo -c -o libmpers_m32_a-perf_ioctl.obj `if test -f 'perf_ioctl.c'; then $(CYGPATH_W) 'perf_ioctl.c'; else $(CYGPATH_W) '$(srcdir)/perf_ioctl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-perf_ioctl.Tpo $(DEPDIR)/libmpers_m32_a-perf_ioctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='perf_ioctl.c' object='libmpers_m32_a-perf_ioctl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-perf_ioctl.obj `if test -f 'perf_ioctl.c'; then $(CYGPATH_W) 'perf_ioctl.c'; else $(CYGPATH_W) '$(srcdir)/perf_ioctl.c'; fi` + +libmpers_m32_a-print_aio_sigset.o: print_aio_sigset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-print_aio_sigset.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-print_aio_sigset.Tpo -c -o libmpers_m32_a-print_aio_sigset.o `test -f 'print_aio_sigset.c' || echo '$(srcdir)/'`print_aio_sigset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-print_aio_sigset.Tpo $(DEPDIR)/libmpers_m32_a-print_aio_sigset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_aio_sigset.c' object='libmpers_m32_a-print_aio_sigset.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-print_aio_sigset.o `test -f 'print_aio_sigset.c' || echo '$(srcdir)/'`print_aio_sigset.c + +libmpers_m32_a-print_aio_sigset.obj: print_aio_sigset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-print_aio_sigset.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-print_aio_sigset.Tpo -c -o libmpers_m32_a-print_aio_sigset.obj `if test -f 'print_aio_sigset.c'; then $(CYGPATH_W) 'print_aio_sigset.c'; else $(CYGPATH_W) '$(srcdir)/print_aio_sigset.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-print_aio_sigset.Tpo $(DEPDIR)/libmpers_m32_a-print_aio_sigset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_aio_sigset.c' object='libmpers_m32_a-print_aio_sigset.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-print_aio_sigset.obj `if test -f 'print_aio_sigset.c'; then $(CYGPATH_W) 'print_aio_sigset.c'; else $(CYGPATH_W) '$(srcdir)/print_aio_sigset.c'; fi` + +libmpers_m32_a-print_group_req.o: print_group_req.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-print_group_req.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-print_group_req.Tpo -c -o libmpers_m32_a-print_group_req.o `test -f 'print_group_req.c' || echo '$(srcdir)/'`print_group_req.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-print_group_req.Tpo $(DEPDIR)/libmpers_m32_a-print_group_req.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_group_req.c' object='libmpers_m32_a-print_group_req.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-print_group_req.o `test -f 'print_group_req.c' || echo '$(srcdir)/'`print_group_req.c + +libmpers_m32_a-print_group_req.obj: print_group_req.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-print_group_req.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-print_group_req.Tpo -c -o libmpers_m32_a-print_group_req.obj `if test -f 'print_group_req.c'; then $(CYGPATH_W) 'print_group_req.c'; else $(CYGPATH_W) '$(srcdir)/print_group_req.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-print_group_req.Tpo $(DEPDIR)/libmpers_m32_a-print_group_req.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_group_req.c' object='libmpers_m32_a-print_group_req.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-print_group_req.obj `if test -f 'print_group_req.c'; then $(CYGPATH_W) 'print_group_req.c'; else $(CYGPATH_W) '$(srcdir)/print_group_req.c'; fi` + libmpers_m32_a-print_mq_attr.o: print_mq_attr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-print_mq_attr.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-print_mq_attr.Tpo -c -o libmpers_m32_a-print_mq_attr.o `test -f 'print_mq_attr.c' || echo '$(srcdir)/'`print_mq_attr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-print_mq_attr.Tpo $(DEPDIR)/libmpers_m32_a-print_mq_attr.Po @@ -2332,20 +3156,6 @@ libmpers_m32_a-print_timeval.obj: print_timeval.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-print_timeval.obj `if test -f 'print_timeval.c'; then $(CYGPATH_W) 'print_timeval.c'; else $(CYGPATH_W) '$(srcdir)/print_timeval.c'; fi` -libmpers_m32_a-print_timex.o: print_timex.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-print_timex.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-print_timex.Tpo -c -o libmpers_m32_a-print_timex.o `test -f 'print_timex.c' || echo '$(srcdir)/'`print_timex.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-print_timex.Tpo $(DEPDIR)/libmpers_m32_a-print_timex.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timex.c' object='libmpers_m32_a-print_timex.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-print_timex.o `test -f 'print_timex.c' || echo '$(srcdir)/'`print_timex.c - -libmpers_m32_a-print_timex.obj: print_timex.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-print_timex.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-print_timex.Tpo -c -o libmpers_m32_a-print_timex.obj `if test -f 'print_timex.c'; then $(CYGPATH_W) 'print_timex.c'; else $(CYGPATH_W) '$(srcdir)/print_timex.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-print_timex.Tpo $(DEPDIR)/libmpers_m32_a-print_timex.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timex.c' object='libmpers_m32_a-print_timex.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-print_timex.obj `if test -f 'print_timex.c'; then $(CYGPATH_W) 'print_timex.c'; else $(CYGPATH_W) '$(srcdir)/print_timex.c'; fi` - libmpers_m32_a-printrusage.o: printrusage.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-printrusage.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-printrusage.Tpo -c -o libmpers_m32_a-printrusage.o `test -f 'printrusage.c' || echo '$(srcdir)/'`printrusage.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-printrusage.Tpo $(DEPDIR)/libmpers_m32_a-printrusage.Po @@ -2374,6 +3184,20 @@ libmpers_m32_a-printsiginfo.obj: printsiginfo.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-printsiginfo.obj `if test -f 'printsiginfo.c'; then $(CYGPATH_W) 'printsiginfo.c'; else $(CYGPATH_W) '$(srcdir)/printsiginfo.c'; fi` +libmpers_m32_a-rt_sigreturn.o: rt_sigreturn.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-rt_sigreturn.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-rt_sigreturn.Tpo -c -o libmpers_m32_a-rt_sigreturn.o `test -f 'rt_sigreturn.c' || echo '$(srcdir)/'`rt_sigreturn.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-rt_sigreturn.Tpo $(DEPDIR)/libmpers_m32_a-rt_sigreturn.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rt_sigreturn.c' object='libmpers_m32_a-rt_sigreturn.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-rt_sigreturn.o `test -f 'rt_sigreturn.c' || echo '$(srcdir)/'`rt_sigreturn.c + +libmpers_m32_a-rt_sigreturn.obj: rt_sigreturn.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-rt_sigreturn.obj -MD -MP -MF $(DEPDIR)/libmpers_m32_a-rt_sigreturn.Tpo -c -o libmpers_m32_a-rt_sigreturn.obj `if test -f 'rt_sigreturn.c'; then $(CYGPATH_W) 'rt_sigreturn.c'; else $(CYGPATH_W) '$(srcdir)/rt_sigreturn.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-rt_sigreturn.Tpo $(DEPDIR)/libmpers_m32_a-rt_sigreturn.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rt_sigreturn.c' object='libmpers_m32_a-rt_sigreturn.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -c -o libmpers_m32_a-rt_sigreturn.obj `if test -f 'rt_sigreturn.c'; then $(CYGPATH_W) 'rt_sigreturn.c'; else $(CYGPATH_W) '$(srcdir)/rt_sigreturn.c'; fi` + libmpers_m32_a-rtc.o: rtc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_m32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_m32_a_CFLAGS) $(CFLAGS) -MT libmpers_m32_a-rtc.o -MD -MP -MF $(DEPDIR)/libmpers_m32_a-rtc.Tpo -c -o libmpers_m32_a-rtc.o `test -f 'rtc.c' || echo '$(srcdir)/'`rtc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_m32_a-rtc.Tpo $(DEPDIR)/libmpers_m32_a-rtc.Po @@ -2542,33 +3366,33 @@ libmpers_mx32_a-dirent.obj: dirent.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-dirent.obj `if test -f 'dirent.c'; then $(CYGPATH_W) 'dirent.c'; else $(CYGPATH_W) '$(srcdir)/dirent.c'; fi` -libmpers_mx32_a-evdev.o: evdev.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-evdev.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-evdev.Tpo -c -o libmpers_mx32_a-evdev.o `test -f 'evdev.c' || echo '$(srcdir)/'`evdev.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-evdev.Tpo $(DEPDIR)/libmpers_mx32_a-evdev.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='evdev.c' object='libmpers_mx32_a-evdev.o' libtool=no @AMDEPBACKSLASH@ +libmpers_mx32_a-evdev_mpers.o: evdev_mpers.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-evdev_mpers.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-evdev_mpers.Tpo -c -o libmpers_mx32_a-evdev_mpers.o `test -f 'evdev_mpers.c' || echo '$(srcdir)/'`evdev_mpers.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-evdev_mpers.Tpo $(DEPDIR)/libmpers_mx32_a-evdev_mpers.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='evdev_mpers.c' object='libmpers_mx32_a-evdev_mpers.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-evdev.o `test -f 'evdev.c' || echo '$(srcdir)/'`evdev.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-evdev_mpers.o `test -f 'evdev_mpers.c' || echo '$(srcdir)/'`evdev_mpers.c -libmpers_mx32_a-evdev.obj: evdev.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-evdev.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-evdev.Tpo -c -o libmpers_mx32_a-evdev.obj `if test -f 'evdev.c'; then $(CYGPATH_W) 'evdev.c'; else $(CYGPATH_W) '$(srcdir)/evdev.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-evdev.Tpo $(DEPDIR)/libmpers_mx32_a-evdev.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='evdev.c' object='libmpers_mx32_a-evdev.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_mx32_a-evdev_mpers.obj: evdev_mpers.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-evdev_mpers.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-evdev_mpers.Tpo -c -o libmpers_mx32_a-evdev_mpers.obj `if test -f 'evdev_mpers.c'; then $(CYGPATH_W) 'evdev_mpers.c'; else $(CYGPATH_W) '$(srcdir)/evdev_mpers.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-evdev_mpers.Tpo $(DEPDIR)/libmpers_mx32_a-evdev_mpers.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='evdev_mpers.c' object='libmpers_mx32_a-evdev_mpers.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-evdev.obj `if test -f 'evdev.c'; then $(CYGPATH_W) 'evdev.c'; else $(CYGPATH_W) '$(srcdir)/evdev.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-evdev_mpers.obj `if test -f 'evdev_mpers.c'; then $(CYGPATH_W) 'evdev_mpers.c'; else $(CYGPATH_W) '$(srcdir)/evdev_mpers.c'; fi` -libmpers_mx32_a-fetch_seccomp_fprog.o: fetch_seccomp_fprog.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_seccomp_fprog.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_seccomp_fprog.Tpo -c -o libmpers_mx32_a-fetch_seccomp_fprog.o `test -f 'fetch_seccomp_fprog.c' || echo '$(srcdir)/'`fetch_seccomp_fprog.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-fetch_seccomp_fprog.Tpo $(DEPDIR)/libmpers_mx32_a-fetch_seccomp_fprog.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_seccomp_fprog.c' object='libmpers_mx32_a-fetch_seccomp_fprog.o' libtool=no @AMDEPBACKSLASH@ +libmpers_mx32_a-fetch_bpf_fprog.o: fetch_bpf_fprog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_bpf_fprog.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_bpf_fprog.Tpo -c -o libmpers_mx32_a-fetch_bpf_fprog.o `test -f 'fetch_bpf_fprog.c' || echo '$(srcdir)/'`fetch_bpf_fprog.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-fetch_bpf_fprog.Tpo $(DEPDIR)/libmpers_mx32_a-fetch_bpf_fprog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_bpf_fprog.c' object='libmpers_mx32_a-fetch_bpf_fprog.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_seccomp_fprog.o `test -f 'fetch_seccomp_fprog.c' || echo '$(srcdir)/'`fetch_seccomp_fprog.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_bpf_fprog.o `test -f 'fetch_bpf_fprog.c' || echo '$(srcdir)/'`fetch_bpf_fprog.c -libmpers_mx32_a-fetch_seccomp_fprog.obj: fetch_seccomp_fprog.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_seccomp_fprog.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_seccomp_fprog.Tpo -c -o libmpers_mx32_a-fetch_seccomp_fprog.obj `if test -f 'fetch_seccomp_fprog.c'; then $(CYGPATH_W) 'fetch_seccomp_fprog.c'; else $(CYGPATH_W) '$(srcdir)/fetch_seccomp_fprog.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-fetch_seccomp_fprog.Tpo $(DEPDIR)/libmpers_mx32_a-fetch_seccomp_fprog.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_seccomp_fprog.c' object='libmpers_mx32_a-fetch_seccomp_fprog.obj' libtool=no @AMDEPBACKSLASH@ +libmpers_mx32_a-fetch_bpf_fprog.obj: fetch_bpf_fprog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_bpf_fprog.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_bpf_fprog.Tpo -c -o libmpers_mx32_a-fetch_bpf_fprog.obj `if test -f 'fetch_bpf_fprog.c'; then $(CYGPATH_W) 'fetch_bpf_fprog.c'; else $(CYGPATH_W) '$(srcdir)/fetch_bpf_fprog.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-fetch_bpf_fprog.Tpo $(DEPDIR)/libmpers_mx32_a-fetch_bpf_fprog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_bpf_fprog.c' object='libmpers_mx32_a-fetch_bpf_fprog.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_seccomp_fprog.obj `if test -f 'fetch_seccomp_fprog.c'; then $(CYGPATH_W) 'fetch_seccomp_fprog.c'; else $(CYGPATH_W) '$(srcdir)/fetch_seccomp_fprog.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_bpf_fprog.obj `if test -f 'fetch_bpf_fprog.c'; then $(CYGPATH_W) 'fetch_bpf_fprog.c'; else $(CYGPATH_W) '$(srcdir)/fetch_bpf_fprog.c'; fi` libmpers_mx32_a-fetch_struct_flock.o: fetch_struct_flock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_struct_flock.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_struct_flock.Tpo -c -o libmpers_mx32_a-fetch_struct_flock.o `test -f 'fetch_struct_flock.c' || echo '$(srcdir)/'`fetch_struct_flock.c @@ -2584,6 +3408,20 @@ libmpers_mx32_a-fetch_struct_flock.obj: fetch_struct_flock.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_struct_flock.obj `if test -f 'fetch_struct_flock.c'; then $(CYGPATH_W) 'fetch_struct_flock.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_flock.c'; fi` +libmpers_mx32_a-fetch_struct_keyctl_kdf_params.o: fetch_struct_keyctl_kdf_params.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_struct_keyctl_kdf_params.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_struct_keyctl_kdf_params.Tpo -c -o libmpers_mx32_a-fetch_struct_keyctl_kdf_params.o `test -f 'fetch_struct_keyctl_kdf_params.c' || echo '$(srcdir)/'`fetch_struct_keyctl_kdf_params.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-fetch_struct_keyctl_kdf_params.Tpo $(DEPDIR)/libmpers_mx32_a-fetch_struct_keyctl_kdf_params.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_keyctl_kdf_params.c' object='libmpers_mx32_a-fetch_struct_keyctl_kdf_params.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_struct_keyctl_kdf_params.o `test -f 'fetch_struct_keyctl_kdf_params.c' || echo '$(srcdir)/'`fetch_struct_keyctl_kdf_params.c + +libmpers_mx32_a-fetch_struct_keyctl_kdf_params.obj: fetch_struct_keyctl_kdf_params.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_struct_keyctl_kdf_params.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_struct_keyctl_kdf_params.Tpo -c -o libmpers_mx32_a-fetch_struct_keyctl_kdf_params.obj `if test -f 'fetch_struct_keyctl_kdf_params.c'; then $(CYGPATH_W) 'fetch_struct_keyctl_kdf_params.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_keyctl_kdf_params.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-fetch_struct_keyctl_kdf_params.Tpo $(DEPDIR)/libmpers_mx32_a-fetch_struct_keyctl_kdf_params.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_keyctl_kdf_params.c' object='libmpers_mx32_a-fetch_struct_keyctl_kdf_params.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_struct_keyctl_kdf_params.obj `if test -f 'fetch_struct_keyctl_kdf_params.c'; then $(CYGPATH_W) 'fetch_struct_keyctl_kdf_params.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_keyctl_kdf_params.c'; fi` + libmpers_mx32_a-fetch_struct_mmsghdr.o: fetch_struct_mmsghdr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_struct_mmsghdr.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_struct_mmsghdr.Tpo -c -o libmpers_mx32_a-fetch_struct_mmsghdr.o `test -f 'fetch_struct_mmsghdr.c' || echo '$(srcdir)/'`fetch_struct_mmsghdr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-fetch_struct_mmsghdr.Tpo $(DEPDIR)/libmpers_mx32_a-fetch_struct_mmsghdr.Po @@ -2654,6 +3492,20 @@ libmpers_mx32_a-fetch_struct_statfs.obj: fetch_struct_statfs.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_struct_statfs.obj `if test -f 'fetch_struct_statfs.c'; then $(CYGPATH_W) 'fetch_struct_statfs.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_statfs.c'; fi` +libmpers_mx32_a-fetch_struct_xfs_quotastat.o: fetch_struct_xfs_quotastat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_struct_xfs_quotastat.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_struct_xfs_quotastat.Tpo -c -o libmpers_mx32_a-fetch_struct_xfs_quotastat.o `test -f 'fetch_struct_xfs_quotastat.c' || echo '$(srcdir)/'`fetch_struct_xfs_quotastat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-fetch_struct_xfs_quotastat.Tpo $(DEPDIR)/libmpers_mx32_a-fetch_struct_xfs_quotastat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_xfs_quotastat.c' object='libmpers_mx32_a-fetch_struct_xfs_quotastat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_struct_xfs_quotastat.o `test -f 'fetch_struct_xfs_quotastat.c' || echo '$(srcdir)/'`fetch_struct_xfs_quotastat.c + +libmpers_mx32_a-fetch_struct_xfs_quotastat.obj: fetch_struct_xfs_quotastat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-fetch_struct_xfs_quotastat.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-fetch_struct_xfs_quotastat.Tpo -c -o libmpers_mx32_a-fetch_struct_xfs_quotastat.obj `if test -f 'fetch_struct_xfs_quotastat.c'; then $(CYGPATH_W) 'fetch_struct_xfs_quotastat.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_xfs_quotastat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-fetch_struct_xfs_quotastat.Tpo $(DEPDIR)/libmpers_mx32_a-fetch_struct_xfs_quotastat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_xfs_quotastat.c' object='libmpers_mx32_a-fetch_struct_xfs_quotastat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-fetch_struct_xfs_quotastat.obj `if test -f 'fetch_struct_xfs_quotastat.c'; then $(CYGPATH_W) 'fetch_struct_xfs_quotastat.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_xfs_quotastat.c'; fi` + libmpers_mx32_a-hdio.o: hdio.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-hdio.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-hdio.Tpo -c -o libmpers_mx32_a-hdio.o `test -f 'hdio.c' || echo '$(srcdir)/'`hdio.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-hdio.Tpo $(DEPDIR)/libmpers_mx32_a-hdio.Po @@ -2724,6 +3576,48 @@ libmpers_mx32_a-mtd.obj: mtd.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-mtd.obj `if test -f 'mtd.c'; then $(CYGPATH_W) 'mtd.c'; else $(CYGPATH_W) '$(srcdir)/mtd.c'; fi` +libmpers_mx32_a-perf_ioctl.o: perf_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-perf_ioctl.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-perf_ioctl.Tpo -c -o libmpers_mx32_a-perf_ioctl.o `test -f 'perf_ioctl.c' || echo '$(srcdir)/'`perf_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-perf_ioctl.Tpo $(DEPDIR)/libmpers_mx32_a-perf_ioctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='perf_ioctl.c' object='libmpers_mx32_a-perf_ioctl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-perf_ioctl.o `test -f 'perf_ioctl.c' || echo '$(srcdir)/'`perf_ioctl.c + +libmpers_mx32_a-perf_ioctl.obj: perf_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-perf_ioctl.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-perf_ioctl.Tpo -c -o libmpers_mx32_a-perf_ioctl.obj `if test -f 'perf_ioctl.c'; then $(CYGPATH_W) 'perf_ioctl.c'; else $(CYGPATH_W) '$(srcdir)/perf_ioctl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-perf_ioctl.Tpo $(DEPDIR)/libmpers_mx32_a-perf_ioctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='perf_ioctl.c' object='libmpers_mx32_a-perf_ioctl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-perf_ioctl.obj `if test -f 'perf_ioctl.c'; then $(CYGPATH_W) 'perf_ioctl.c'; else $(CYGPATH_W) '$(srcdir)/perf_ioctl.c'; fi` + +libmpers_mx32_a-print_aio_sigset.o: print_aio_sigset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-print_aio_sigset.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-print_aio_sigset.Tpo -c -o libmpers_mx32_a-print_aio_sigset.o `test -f 'print_aio_sigset.c' || echo '$(srcdir)/'`print_aio_sigset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-print_aio_sigset.Tpo $(DEPDIR)/libmpers_mx32_a-print_aio_sigset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_aio_sigset.c' object='libmpers_mx32_a-print_aio_sigset.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-print_aio_sigset.o `test -f 'print_aio_sigset.c' || echo '$(srcdir)/'`print_aio_sigset.c + +libmpers_mx32_a-print_aio_sigset.obj: print_aio_sigset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-print_aio_sigset.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-print_aio_sigset.Tpo -c -o libmpers_mx32_a-print_aio_sigset.obj `if test -f 'print_aio_sigset.c'; then $(CYGPATH_W) 'print_aio_sigset.c'; else $(CYGPATH_W) '$(srcdir)/print_aio_sigset.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-print_aio_sigset.Tpo $(DEPDIR)/libmpers_mx32_a-print_aio_sigset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_aio_sigset.c' object='libmpers_mx32_a-print_aio_sigset.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-print_aio_sigset.obj `if test -f 'print_aio_sigset.c'; then $(CYGPATH_W) 'print_aio_sigset.c'; else $(CYGPATH_W) '$(srcdir)/print_aio_sigset.c'; fi` + +libmpers_mx32_a-print_group_req.o: print_group_req.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-print_group_req.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-print_group_req.Tpo -c -o libmpers_mx32_a-print_group_req.o `test -f 'print_group_req.c' || echo '$(srcdir)/'`print_group_req.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-print_group_req.Tpo $(DEPDIR)/libmpers_mx32_a-print_group_req.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_group_req.c' object='libmpers_mx32_a-print_group_req.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-print_group_req.o `test -f 'print_group_req.c' || echo '$(srcdir)/'`print_group_req.c + +libmpers_mx32_a-print_group_req.obj: print_group_req.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-print_group_req.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-print_group_req.Tpo -c -o libmpers_mx32_a-print_group_req.obj `if test -f 'print_group_req.c'; then $(CYGPATH_W) 'print_group_req.c'; else $(CYGPATH_W) '$(srcdir)/print_group_req.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-print_group_req.Tpo $(DEPDIR)/libmpers_mx32_a-print_group_req.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_group_req.c' object='libmpers_mx32_a-print_group_req.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-print_group_req.obj `if test -f 'print_group_req.c'; then $(CYGPATH_W) 'print_group_req.c'; else $(CYGPATH_W) '$(srcdir)/print_group_req.c'; fi` + libmpers_mx32_a-print_mq_attr.o: print_mq_attr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-print_mq_attr.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-print_mq_attr.Tpo -c -o libmpers_mx32_a-print_mq_attr.o `test -f 'print_mq_attr.c' || echo '$(srcdir)/'`print_mq_attr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-print_mq_attr.Tpo $(DEPDIR)/libmpers_mx32_a-print_mq_attr.Po @@ -2822,20 +3716,6 @@ libmpers_mx32_a-print_timeval.obj: print_timeval.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-print_timeval.obj `if test -f 'print_timeval.c'; then $(CYGPATH_W) 'print_timeval.c'; else $(CYGPATH_W) '$(srcdir)/print_timeval.c'; fi` -libmpers_mx32_a-print_timex.o: print_timex.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-print_timex.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-print_timex.Tpo -c -o libmpers_mx32_a-print_timex.o `test -f 'print_timex.c' || echo '$(srcdir)/'`print_timex.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-print_timex.Tpo $(DEPDIR)/libmpers_mx32_a-print_timex.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timex.c' object='libmpers_mx32_a-print_timex.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-print_timex.o `test -f 'print_timex.c' || echo '$(srcdir)/'`print_timex.c - -libmpers_mx32_a-print_timex.obj: print_timex.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-print_timex.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-print_timex.Tpo -c -o libmpers_mx32_a-print_timex.obj `if test -f 'print_timex.c'; then $(CYGPATH_W) 'print_timex.c'; else $(CYGPATH_W) '$(srcdir)/print_timex.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-print_timex.Tpo $(DEPDIR)/libmpers_mx32_a-print_timex.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timex.c' object='libmpers_mx32_a-print_timex.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-print_timex.obj `if test -f 'print_timex.c'; then $(CYGPATH_W) 'print_timex.c'; else $(CYGPATH_W) '$(srcdir)/print_timex.c'; fi` - libmpers_mx32_a-printrusage.o: printrusage.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-printrusage.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-printrusage.Tpo -c -o libmpers_mx32_a-printrusage.o `test -f 'printrusage.c' || echo '$(srcdir)/'`printrusage.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-printrusage.Tpo $(DEPDIR)/libmpers_mx32_a-printrusage.Po @@ -2864,6 +3744,20 @@ libmpers_mx32_a-printsiginfo.obj: printsiginfo.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-printsiginfo.obj `if test -f 'printsiginfo.c'; then $(CYGPATH_W) 'printsiginfo.c'; else $(CYGPATH_W) '$(srcdir)/printsiginfo.c'; fi` +libmpers_mx32_a-rt_sigreturn.o: rt_sigreturn.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-rt_sigreturn.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-rt_sigreturn.Tpo -c -o libmpers_mx32_a-rt_sigreturn.o `test -f 'rt_sigreturn.c' || echo '$(srcdir)/'`rt_sigreturn.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-rt_sigreturn.Tpo $(DEPDIR)/libmpers_mx32_a-rt_sigreturn.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rt_sigreturn.c' object='libmpers_mx32_a-rt_sigreturn.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-rt_sigreturn.o `test -f 'rt_sigreturn.c' || echo '$(srcdir)/'`rt_sigreturn.c + +libmpers_mx32_a-rt_sigreturn.obj: rt_sigreturn.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-rt_sigreturn.obj -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-rt_sigreturn.Tpo -c -o libmpers_mx32_a-rt_sigreturn.obj `if test -f 'rt_sigreturn.c'; then $(CYGPATH_W) 'rt_sigreturn.c'; else $(CYGPATH_W) '$(srcdir)/rt_sigreturn.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-rt_sigreturn.Tpo $(DEPDIR)/libmpers_mx32_a-rt_sigreturn.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rt_sigreturn.c' object='libmpers_mx32_a-rt_sigreturn.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-rt_sigreturn.obj `if test -f 'rt_sigreturn.c'; then $(CYGPATH_W) 'rt_sigreturn.c'; else $(CYGPATH_W) '$(srcdir)/rt_sigreturn.c'; fi` + libmpers_mx32_a-rtc.o: rtc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -MT libmpers_mx32_a-rtc.o -MD -MP -MF $(DEPDIR)/libmpers_mx32_a-rtc.Tpo -c -o libmpers_mx32_a-rtc.o `test -f 'rtc.c' || echo '$(srcdir)/'`rtc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libmpers_mx32_a-rtc.Tpo $(DEPDIR)/libmpers_mx32_a-rtc.Po @@ -2990,6 +3884,20 @@ libmpers_mx32_a-v4l2.obj: v4l2.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-v4l2.obj `if test -f 'v4l2.c'; then $(CYGPATH_W) 'v4l2.c'; else $(CYGPATH_W) '$(srcdir)/v4l2.c'; fi` +libstrace_a-fetch_indirect_syscall_args.o: fetch_indirect_syscall_args.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-fetch_indirect_syscall_args.o -MD -MP -MF $(DEPDIR)/libstrace_a-fetch_indirect_syscall_args.Tpo -c -o libstrace_a-fetch_indirect_syscall_args.o `test -f 'fetch_indirect_syscall_args.c' || echo '$(srcdir)/'`fetch_indirect_syscall_args.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-fetch_indirect_syscall_args.Tpo $(DEPDIR)/libstrace_a-fetch_indirect_syscall_args.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_indirect_syscall_args.c' object='libstrace_a-fetch_indirect_syscall_args.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-fetch_indirect_syscall_args.o `test -f 'fetch_indirect_syscall_args.c' || echo '$(srcdir)/'`fetch_indirect_syscall_args.c + +libstrace_a-fetch_indirect_syscall_args.obj: fetch_indirect_syscall_args.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-fetch_indirect_syscall_args.obj -MD -MP -MF $(DEPDIR)/libstrace_a-fetch_indirect_syscall_args.Tpo -c -o libstrace_a-fetch_indirect_syscall_args.obj `if test -f 'fetch_indirect_syscall_args.c'; then $(CYGPATH_W) 'fetch_indirect_syscall_args.c'; else $(CYGPATH_W) '$(srcdir)/fetch_indirect_syscall_args.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-fetch_indirect_syscall_args.Tpo $(DEPDIR)/libstrace_a-fetch_indirect_syscall_args.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_indirect_syscall_args.c' object='libstrace_a-fetch_indirect_syscall_args.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-fetch_indirect_syscall_args.obj `if test -f 'fetch_indirect_syscall_args.c'; then $(CYGPATH_W) 'fetch_indirect_syscall_args.c'; else $(CYGPATH_W) '$(srcdir)/fetch_indirect_syscall_args.c'; fi` + libstrace_a-fstatfs.o: fstatfs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-fstatfs.o -MD -MP -MF $(DEPDIR)/libstrace_a-fstatfs.Tpo -c -o libstrace_a-fstatfs.o `test -f 'fstatfs.c' || echo '$(srcdir)/'`fstatfs.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-fstatfs.Tpo $(DEPDIR)/libstrace_a-fstatfs.Po @@ -3018,6 +3926,20 @@ libstrace_a-fstatfs64.obj: fstatfs64.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-fstatfs64.obj `if test -f 'fstatfs64.c'; then $(CYGPATH_W) 'fstatfs64.c'; else $(CYGPATH_W) '$(srcdir)/fstatfs64.c'; fi` +libstrace_a-getpagesize.o: getpagesize.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-getpagesize.o -MD -MP -MF $(DEPDIR)/libstrace_a-getpagesize.Tpo -c -o libstrace_a-getpagesize.o `test -f 'getpagesize.c' || echo '$(srcdir)/'`getpagesize.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-getpagesize.Tpo $(DEPDIR)/libstrace_a-getpagesize.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getpagesize.c' object='libstrace_a-getpagesize.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-getpagesize.o `test -f 'getpagesize.c' || echo '$(srcdir)/'`getpagesize.c + +libstrace_a-getpagesize.obj: getpagesize.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-getpagesize.obj -MD -MP -MF $(DEPDIR)/libstrace_a-getpagesize.Tpo -c -o libstrace_a-getpagesize.obj `if test -f 'getpagesize.c'; then $(CYGPATH_W) 'getpagesize.c'; else $(CYGPATH_W) '$(srcdir)/getpagesize.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-getpagesize.Tpo $(DEPDIR)/libstrace_a-getpagesize.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='getpagesize.c' object='libstrace_a-getpagesize.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-getpagesize.obj `if test -f 'getpagesize.c'; then $(CYGPATH_W) 'getpagesize.c'; else $(CYGPATH_W) '$(srcdir)/getpagesize.c'; fi` + libstrace_a-ipc.o: ipc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-ipc.o -MD -MP -MF $(DEPDIR)/libstrace_a-ipc.Tpo -c -o libstrace_a-ipc.o `test -f 'ipc.c' || echo '$(srcdir)/'`ipc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-ipc.Tpo $(DEPDIR)/libstrace_a-ipc.Po @@ -3032,6 +3954,34 @@ libstrace_a-ipc.obj: ipc.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-ipc.obj `if test -f 'ipc.c'; then $(CYGPATH_W) 'ipc.c'; else $(CYGPATH_W) '$(srcdir)/ipc.c'; fi` +libstrace_a-mmap_cache.o: mmap_cache.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-mmap_cache.o -MD -MP -MF $(DEPDIR)/libstrace_a-mmap_cache.Tpo -c -o libstrace_a-mmap_cache.o `test -f 'mmap_cache.c' || echo '$(srcdir)/'`mmap_cache.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-mmap_cache.Tpo $(DEPDIR)/libstrace_a-mmap_cache.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap_cache.c' object='libstrace_a-mmap_cache.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-mmap_cache.o `test -f 'mmap_cache.c' || echo '$(srcdir)/'`mmap_cache.c + +libstrace_a-mmap_cache.obj: mmap_cache.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-mmap_cache.obj -MD -MP -MF $(DEPDIR)/libstrace_a-mmap_cache.Tpo -c -o libstrace_a-mmap_cache.obj `if test -f 'mmap_cache.c'; then $(CYGPATH_W) 'mmap_cache.c'; else $(CYGPATH_W) '$(srcdir)/mmap_cache.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-mmap_cache.Tpo $(DEPDIR)/libstrace_a-mmap_cache.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap_cache.c' object='libstrace_a-mmap_cache.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-mmap_cache.obj `if test -f 'mmap_cache.c'; then $(CYGPATH_W) 'mmap_cache.c'; else $(CYGPATH_W) '$(srcdir)/mmap_cache.c'; fi` + +libstrace_a-sigreturn.o: sigreturn.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-sigreturn.o -MD -MP -MF $(DEPDIR)/libstrace_a-sigreturn.Tpo -c -o libstrace_a-sigreturn.o `test -f 'sigreturn.c' || echo '$(srcdir)/'`sigreturn.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-sigreturn.Tpo $(DEPDIR)/libstrace_a-sigreturn.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sigreturn.c' object='libstrace_a-sigreturn.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-sigreturn.o `test -f 'sigreturn.c' || echo '$(srcdir)/'`sigreturn.c + +libstrace_a-sigreturn.obj: sigreturn.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-sigreturn.obj -MD -MP -MF $(DEPDIR)/libstrace_a-sigreturn.Tpo -c -o libstrace_a-sigreturn.obj `if test -f 'sigreturn.c'; then $(CYGPATH_W) 'sigreturn.c'; else $(CYGPATH_W) '$(srcdir)/sigreturn.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-sigreturn.Tpo $(DEPDIR)/libstrace_a-sigreturn.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sigreturn.c' object='libstrace_a-sigreturn.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-sigreturn.obj `if test -f 'sigreturn.c'; then $(CYGPATH_W) 'sigreturn.c'; else $(CYGPATH_W) '$(srcdir)/sigreturn.c'; fi` + libstrace_a-socketcall.o: socketcall.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-socketcall.o -MD -MP -MF $(DEPDIR)/libstrace_a-socketcall.Tpo -c -o libstrace_a-socketcall.o `test -f 'socketcall.c' || echo '$(srcdir)/'`socketcall.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-socketcall.Tpo $(DEPDIR)/libstrace_a-socketcall.Po @@ -3186,6 +4136,34 @@ strace-alpha.obj: alpha.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-alpha.obj `if test -f 'alpha.c'; then $(CYGPATH_W) 'alpha.c'; else $(CYGPATH_W) '$(srcdir)/alpha.c'; fi` +strace-basic_filters.o: basic_filters.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-basic_filters.o -MD -MP -MF $(DEPDIR)/strace-basic_filters.Tpo -c -o strace-basic_filters.o `test -f 'basic_filters.c' || echo '$(srcdir)/'`basic_filters.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-basic_filters.Tpo $(DEPDIR)/strace-basic_filters.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='basic_filters.c' object='strace-basic_filters.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-basic_filters.o `test -f 'basic_filters.c' || echo '$(srcdir)/'`basic_filters.c + +strace-basic_filters.obj: basic_filters.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-basic_filters.obj -MD -MP -MF $(DEPDIR)/strace-basic_filters.Tpo -c -o strace-basic_filters.obj `if test -f 'basic_filters.c'; then $(CYGPATH_W) 'basic_filters.c'; else $(CYGPATH_W) '$(srcdir)/basic_filters.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-basic_filters.Tpo $(DEPDIR)/strace-basic_filters.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='basic_filters.c' object='strace-basic_filters.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-basic_filters.obj `if test -f 'basic_filters.c'; then $(CYGPATH_W) 'basic_filters.c'; else $(CYGPATH_W) '$(srcdir)/basic_filters.c'; fi` + +strace-bind.o: bind.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-bind.o -MD -MP -MF $(DEPDIR)/strace-bind.Tpo -c -o strace-bind.o `test -f 'bind.c' || echo '$(srcdir)/'`bind.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-bind.Tpo $(DEPDIR)/strace-bind.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bind.c' object='strace-bind.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-bind.o `test -f 'bind.c' || echo '$(srcdir)/'`bind.c + +strace-bind.obj: bind.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-bind.obj -MD -MP -MF $(DEPDIR)/strace-bind.Tpo -c -o strace-bind.obj `if test -f 'bind.c'; then $(CYGPATH_W) 'bind.c'; else $(CYGPATH_W) '$(srcdir)/bind.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-bind.Tpo $(DEPDIR)/strace-bind.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bind.c' object='strace-bind.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-bind.obj `if test -f 'bind.c'; then $(CYGPATH_W) 'bind.c'; else $(CYGPATH_W) '$(srcdir)/bind.c'; fi` + strace-bjm.o: bjm.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-bjm.o -MD -MP -MF $(DEPDIR)/strace-bjm.Tpo -c -o strace-bjm.o `test -f 'bjm.c' || echo '$(srcdir)/'`bjm.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-bjm.Tpo $(DEPDIR)/strace-bjm.Po @@ -3228,6 +4206,48 @@ strace-bpf.obj: bpf.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-bpf.obj `if test -f 'bpf.c'; then $(CYGPATH_W) 'bpf.c'; else $(CYGPATH_W) '$(srcdir)/bpf.c'; fi` +strace-bpf_filter.o: bpf_filter.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-bpf_filter.o -MD -MP -MF $(DEPDIR)/strace-bpf_filter.Tpo -c -o strace-bpf_filter.o `test -f 'bpf_filter.c' || echo '$(srcdir)/'`bpf_filter.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-bpf_filter.Tpo $(DEPDIR)/strace-bpf_filter.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bpf_filter.c' object='strace-bpf_filter.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-bpf_filter.o `test -f 'bpf_filter.c' || echo '$(srcdir)/'`bpf_filter.c + +strace-bpf_filter.obj: bpf_filter.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-bpf_filter.obj -MD -MP -MF $(DEPDIR)/strace-bpf_filter.Tpo -c -o strace-bpf_filter.obj `if test -f 'bpf_filter.c'; then $(CYGPATH_W) 'bpf_filter.c'; else $(CYGPATH_W) '$(srcdir)/bpf_filter.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-bpf_filter.Tpo $(DEPDIR)/strace-bpf_filter.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bpf_filter.c' object='strace-bpf_filter.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-bpf_filter.obj `if test -f 'bpf_filter.c'; then $(CYGPATH_W) 'bpf_filter.c'; else $(CYGPATH_W) '$(srcdir)/bpf_filter.c'; fi` + +strace-bpf_seccomp_filter.o: bpf_seccomp_filter.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-bpf_seccomp_filter.o -MD -MP -MF $(DEPDIR)/strace-bpf_seccomp_filter.Tpo -c -o strace-bpf_seccomp_filter.o `test -f 'bpf_seccomp_filter.c' || echo '$(srcdir)/'`bpf_seccomp_filter.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-bpf_seccomp_filter.Tpo $(DEPDIR)/strace-bpf_seccomp_filter.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bpf_seccomp_filter.c' object='strace-bpf_seccomp_filter.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-bpf_seccomp_filter.o `test -f 'bpf_seccomp_filter.c' || echo '$(srcdir)/'`bpf_seccomp_filter.c + +strace-bpf_seccomp_filter.obj: bpf_seccomp_filter.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-bpf_seccomp_filter.obj -MD -MP -MF $(DEPDIR)/strace-bpf_seccomp_filter.Tpo -c -o strace-bpf_seccomp_filter.obj `if test -f 'bpf_seccomp_filter.c'; then $(CYGPATH_W) 'bpf_seccomp_filter.c'; else $(CYGPATH_W) '$(srcdir)/bpf_seccomp_filter.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-bpf_seccomp_filter.Tpo $(DEPDIR)/strace-bpf_seccomp_filter.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bpf_seccomp_filter.c' object='strace-bpf_seccomp_filter.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-bpf_seccomp_filter.obj `if test -f 'bpf_seccomp_filter.c'; then $(CYGPATH_W) 'bpf_seccomp_filter.c'; else $(CYGPATH_W) '$(srcdir)/bpf_seccomp_filter.c'; fi` + +strace-bpf_sock_filter.o: bpf_sock_filter.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-bpf_sock_filter.o -MD -MP -MF $(DEPDIR)/strace-bpf_sock_filter.Tpo -c -o strace-bpf_sock_filter.o `test -f 'bpf_sock_filter.c' || echo '$(srcdir)/'`bpf_sock_filter.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-bpf_sock_filter.Tpo $(DEPDIR)/strace-bpf_sock_filter.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bpf_sock_filter.c' object='strace-bpf_sock_filter.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-bpf_sock_filter.o `test -f 'bpf_sock_filter.c' || echo '$(srcdir)/'`bpf_sock_filter.c + +strace-bpf_sock_filter.obj: bpf_sock_filter.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-bpf_sock_filter.obj -MD -MP -MF $(DEPDIR)/strace-bpf_sock_filter.Tpo -c -o strace-bpf_sock_filter.obj `if test -f 'bpf_sock_filter.c'; then $(CYGPATH_W) 'bpf_sock_filter.c'; else $(CYGPATH_W) '$(srcdir)/bpf_sock_filter.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-bpf_sock_filter.Tpo $(DEPDIR)/strace-bpf_sock_filter.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bpf_sock_filter.c' object='strace-bpf_sock_filter.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-bpf_sock_filter.obj `if test -f 'bpf_sock_filter.c'; then $(CYGPATH_W) 'bpf_sock_filter.c'; else $(CYGPATH_W) '$(srcdir)/bpf_sock_filter.c'; fi` + strace-btrfs.o: btrfs.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-btrfs.o -MD -MP -MF $(DEPDIR)/strace-btrfs.Tpo -c -o strace-btrfs.o `test -f 'btrfs.c' || echo '$(srcdir)/'`btrfs.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-btrfs.Tpo $(DEPDIR)/strace-btrfs.Po @@ -3340,6 +4360,20 @@ strace-count.obj: count.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-count.obj `if test -f 'count.c'; then $(CYGPATH_W) 'count.c'; else $(CYGPATH_W) '$(srcdir)/count.c'; fi` +strace-delay.o: delay.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-delay.o -MD -MP -MF $(DEPDIR)/strace-delay.Tpo -c -o strace-delay.o `test -f 'delay.c' || echo '$(srcdir)/'`delay.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-delay.Tpo $(DEPDIR)/strace-delay.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='delay.c' object='strace-delay.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-delay.o `test -f 'delay.c' || echo '$(srcdir)/'`delay.c + +strace-delay.obj: delay.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-delay.obj -MD -MP -MF $(DEPDIR)/strace-delay.Tpo -c -o strace-delay.obj `if test -f 'delay.c'; then $(CYGPATH_W) 'delay.c'; else $(CYGPATH_W) '$(srcdir)/delay.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-delay.Tpo $(DEPDIR)/strace-delay.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='delay.c' object='strace-delay.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-delay.obj `if test -f 'delay.c'; then $(CYGPATH_W) 'delay.c'; else $(CYGPATH_W) '$(srcdir)/delay.c'; fi` + strace-desc.o: desc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-desc.o -MD -MP -MF $(DEPDIR)/strace-desc.Tpo -c -o strace-desc.o `test -f 'desc.c' || echo '$(srcdir)/'`desc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-desc.Tpo $(DEPDIR)/strace-desc.Po @@ -3396,6 +4430,20 @@ strace-dm.obj: dm.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-dm.obj `if test -f 'dm.c'; then $(CYGPATH_W) 'dm.c'; else $(CYGPATH_W) '$(srcdir)/dm.c'; fi` +strace-dyxlat.o: dyxlat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-dyxlat.o -MD -MP -MF $(DEPDIR)/strace-dyxlat.Tpo -c -o strace-dyxlat.o `test -f 'dyxlat.c' || echo '$(srcdir)/'`dyxlat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-dyxlat.Tpo $(DEPDIR)/strace-dyxlat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dyxlat.c' object='strace-dyxlat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-dyxlat.o `test -f 'dyxlat.c' || echo '$(srcdir)/'`dyxlat.c + +strace-dyxlat.obj: dyxlat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-dyxlat.obj -MD -MP -MF $(DEPDIR)/strace-dyxlat.Tpo -c -o strace-dyxlat.obj `if test -f 'dyxlat.c'; then $(CYGPATH_W) 'dyxlat.c'; else $(CYGPATH_W) '$(srcdir)/dyxlat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-dyxlat.Tpo $(DEPDIR)/strace-dyxlat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='dyxlat.c' object='strace-dyxlat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-dyxlat.obj `if test -f 'dyxlat.c'; then $(CYGPATH_W) 'dyxlat.c'; else $(CYGPATH_W) '$(srcdir)/dyxlat.c'; fi` + strace-epoll.o: epoll.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-epoll.o -MD -MP -MF $(DEPDIR)/strace-epoll.Tpo -c -o strace-epoll.o `test -f 'epoll.c' || echo '$(srcdir)/'`epoll.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-epoll.Tpo $(DEPDIR)/strace-epoll.Po @@ -3410,6 +4458,20 @@ strace-epoll.obj: epoll.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-epoll.obj `if test -f 'epoll.c'; then $(CYGPATH_W) 'epoll.c'; else $(CYGPATH_W) '$(srcdir)/epoll.c'; fi` +strace-error_prints.o: error_prints.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-error_prints.o -MD -MP -MF $(DEPDIR)/strace-error_prints.Tpo -c -o strace-error_prints.o `test -f 'error_prints.c' || echo '$(srcdir)/'`error_prints.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-error_prints.Tpo $(DEPDIR)/strace-error_prints.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='error_prints.c' object='strace-error_prints.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-error_prints.o `test -f 'error_prints.c' || echo '$(srcdir)/'`error_prints.c + +strace-error_prints.obj: error_prints.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-error_prints.obj -MD -MP -MF $(DEPDIR)/strace-error_prints.Tpo -c -o strace-error_prints.obj `if test -f 'error_prints.c'; then $(CYGPATH_W) 'error_prints.c'; else $(CYGPATH_W) '$(srcdir)/error_prints.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-error_prints.Tpo $(DEPDIR)/strace-error_prints.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='error_prints.c' object='strace-error_prints.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-error_prints.obj `if test -f 'error_prints.c'; then $(CYGPATH_W) 'error_prints.c'; else $(CYGPATH_W) '$(srcdir)/error_prints.c'; fi` + strace-evdev.o: evdev.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-evdev.o -MD -MP -MF $(DEPDIR)/strace-evdev.Tpo -c -o strace-evdev.o `test -f 'evdev.c' || echo '$(srcdir)/'`evdev.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-evdev.Tpo $(DEPDIR)/strace-evdev.Po @@ -3424,6 +4486,20 @@ strace-evdev.obj: evdev.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-evdev.obj `if test -f 'evdev.c'; then $(CYGPATH_W) 'evdev.c'; else $(CYGPATH_W) '$(srcdir)/evdev.c'; fi` +strace-evdev_mpers.o: evdev_mpers.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-evdev_mpers.o -MD -MP -MF $(DEPDIR)/strace-evdev_mpers.Tpo -c -o strace-evdev_mpers.o `test -f 'evdev_mpers.c' || echo '$(srcdir)/'`evdev_mpers.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-evdev_mpers.Tpo $(DEPDIR)/strace-evdev_mpers.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='evdev_mpers.c' object='strace-evdev_mpers.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-evdev_mpers.o `test -f 'evdev_mpers.c' || echo '$(srcdir)/'`evdev_mpers.c + +strace-evdev_mpers.obj: evdev_mpers.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-evdev_mpers.obj -MD -MP -MF $(DEPDIR)/strace-evdev_mpers.Tpo -c -o strace-evdev_mpers.obj `if test -f 'evdev_mpers.c'; then $(CYGPATH_W) 'evdev_mpers.c'; else $(CYGPATH_W) '$(srcdir)/evdev_mpers.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-evdev_mpers.Tpo $(DEPDIR)/strace-evdev_mpers.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='evdev_mpers.c' object='strace-evdev_mpers.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-evdev_mpers.obj `if test -f 'evdev_mpers.c'; then $(CYGPATH_W) 'evdev_mpers.c'; else $(CYGPATH_W) '$(srcdir)/evdev_mpers.c'; fi` + strace-eventfd.o: eventfd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-eventfd.o -MD -MP -MF $(DEPDIR)/strace-eventfd.Tpo -c -o strace-eventfd.o `test -f 'eventfd.c' || echo '$(srcdir)/'`eventfd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-eventfd.Tpo $(DEPDIR)/strace-eventfd.Po @@ -3522,19 +4598,19 @@ strace-fcntl.obj: fcntl.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fcntl.obj `if test -f 'fcntl.c'; then $(CYGPATH_W) 'fcntl.c'; else $(CYGPATH_W) '$(srcdir)/fcntl.c'; fi` -strace-fetch_seccomp_fprog.o: fetch_seccomp_fprog.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_seccomp_fprog.o -MD -MP -MF $(DEPDIR)/strace-fetch_seccomp_fprog.Tpo -c -o strace-fetch_seccomp_fprog.o `test -f 'fetch_seccomp_fprog.c' || echo '$(srcdir)/'`fetch_seccomp_fprog.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fetch_seccomp_fprog.Tpo $(DEPDIR)/strace-fetch_seccomp_fprog.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_seccomp_fprog.c' object='strace-fetch_seccomp_fprog.o' libtool=no @AMDEPBACKSLASH@ +strace-fetch_bpf_fprog.o: fetch_bpf_fprog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_bpf_fprog.o -MD -MP -MF $(DEPDIR)/strace-fetch_bpf_fprog.Tpo -c -o strace-fetch_bpf_fprog.o `test -f 'fetch_bpf_fprog.c' || echo '$(srcdir)/'`fetch_bpf_fprog.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fetch_bpf_fprog.Tpo $(DEPDIR)/strace-fetch_bpf_fprog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_bpf_fprog.c' object='strace-fetch_bpf_fprog.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_seccomp_fprog.o `test -f 'fetch_seccomp_fprog.c' || echo '$(srcdir)/'`fetch_seccomp_fprog.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_bpf_fprog.o `test -f 'fetch_bpf_fprog.c' || echo '$(srcdir)/'`fetch_bpf_fprog.c -strace-fetch_seccomp_fprog.obj: fetch_seccomp_fprog.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_seccomp_fprog.obj -MD -MP -MF $(DEPDIR)/strace-fetch_seccomp_fprog.Tpo -c -o strace-fetch_seccomp_fprog.obj `if test -f 'fetch_seccomp_fprog.c'; then $(CYGPATH_W) 'fetch_seccomp_fprog.c'; else $(CYGPATH_W) '$(srcdir)/fetch_seccomp_fprog.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fetch_seccomp_fprog.Tpo $(DEPDIR)/strace-fetch_seccomp_fprog.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_seccomp_fprog.c' object='strace-fetch_seccomp_fprog.obj' libtool=no @AMDEPBACKSLASH@ +strace-fetch_bpf_fprog.obj: fetch_bpf_fprog.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_bpf_fprog.obj -MD -MP -MF $(DEPDIR)/strace-fetch_bpf_fprog.Tpo -c -o strace-fetch_bpf_fprog.obj `if test -f 'fetch_bpf_fprog.c'; then $(CYGPATH_W) 'fetch_bpf_fprog.c'; else $(CYGPATH_W) '$(srcdir)/fetch_bpf_fprog.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fetch_bpf_fprog.Tpo $(DEPDIR)/strace-fetch_bpf_fprog.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_bpf_fprog.c' object='strace-fetch_bpf_fprog.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_seccomp_fprog.obj `if test -f 'fetch_seccomp_fprog.c'; then $(CYGPATH_W) 'fetch_seccomp_fprog.c'; else $(CYGPATH_W) '$(srcdir)/fetch_seccomp_fprog.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_bpf_fprog.obj `if test -f 'fetch_bpf_fprog.c'; then $(CYGPATH_W) 'fetch_bpf_fprog.c'; else $(CYGPATH_W) '$(srcdir)/fetch_bpf_fprog.c'; fi` strace-fetch_struct_flock.o: fetch_struct_flock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_struct_flock.o -MD -MP -MF $(DEPDIR)/strace-fetch_struct_flock.Tpo -c -o strace-fetch_struct_flock.o `test -f 'fetch_struct_flock.c' || echo '$(srcdir)/'`fetch_struct_flock.c @@ -3550,6 +4626,20 @@ strace-fetch_struct_flock.obj: fetch_struct_flock.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_struct_flock.obj `if test -f 'fetch_struct_flock.c'; then $(CYGPATH_W) 'fetch_struct_flock.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_flock.c'; fi` +strace-fetch_struct_keyctl_kdf_params.o: fetch_struct_keyctl_kdf_params.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_struct_keyctl_kdf_params.o -MD -MP -MF $(DEPDIR)/strace-fetch_struct_keyctl_kdf_params.Tpo -c -o strace-fetch_struct_keyctl_kdf_params.o `test -f 'fetch_struct_keyctl_kdf_params.c' || echo '$(srcdir)/'`fetch_struct_keyctl_kdf_params.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fetch_struct_keyctl_kdf_params.Tpo $(DEPDIR)/strace-fetch_struct_keyctl_kdf_params.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_keyctl_kdf_params.c' object='strace-fetch_struct_keyctl_kdf_params.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_struct_keyctl_kdf_params.o `test -f 'fetch_struct_keyctl_kdf_params.c' || echo '$(srcdir)/'`fetch_struct_keyctl_kdf_params.c + +strace-fetch_struct_keyctl_kdf_params.obj: fetch_struct_keyctl_kdf_params.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_struct_keyctl_kdf_params.obj -MD -MP -MF $(DEPDIR)/strace-fetch_struct_keyctl_kdf_params.Tpo -c -o strace-fetch_struct_keyctl_kdf_params.obj `if test -f 'fetch_struct_keyctl_kdf_params.c'; then $(CYGPATH_W) 'fetch_struct_keyctl_kdf_params.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_keyctl_kdf_params.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fetch_struct_keyctl_kdf_params.Tpo $(DEPDIR)/strace-fetch_struct_keyctl_kdf_params.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_keyctl_kdf_params.c' object='strace-fetch_struct_keyctl_kdf_params.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_struct_keyctl_kdf_params.obj `if test -f 'fetch_struct_keyctl_kdf_params.c'; then $(CYGPATH_W) 'fetch_struct_keyctl_kdf_params.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_keyctl_kdf_params.c'; fi` + strace-fetch_struct_mmsghdr.o: fetch_struct_mmsghdr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_struct_mmsghdr.o -MD -MP -MF $(DEPDIR)/strace-fetch_struct_mmsghdr.Tpo -c -o strace-fetch_struct_mmsghdr.o `test -f 'fetch_struct_mmsghdr.c' || echo '$(srcdir)/'`fetch_struct_mmsghdr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fetch_struct_mmsghdr.Tpo $(DEPDIR)/strace-fetch_struct_mmsghdr.Po @@ -3620,6 +4710,20 @@ strace-fetch_struct_statfs.obj: fetch_struct_statfs.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_struct_statfs.obj `if test -f 'fetch_struct_statfs.c'; then $(CYGPATH_W) 'fetch_struct_statfs.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_statfs.c'; fi` +strace-fetch_struct_xfs_quotastat.o: fetch_struct_xfs_quotastat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_struct_xfs_quotastat.o -MD -MP -MF $(DEPDIR)/strace-fetch_struct_xfs_quotastat.Tpo -c -o strace-fetch_struct_xfs_quotastat.o `test -f 'fetch_struct_xfs_quotastat.c' || echo '$(srcdir)/'`fetch_struct_xfs_quotastat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fetch_struct_xfs_quotastat.Tpo $(DEPDIR)/strace-fetch_struct_xfs_quotastat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_xfs_quotastat.c' object='strace-fetch_struct_xfs_quotastat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_struct_xfs_quotastat.o `test -f 'fetch_struct_xfs_quotastat.c' || echo '$(srcdir)/'`fetch_struct_xfs_quotastat.c + +strace-fetch_struct_xfs_quotastat.obj: fetch_struct_xfs_quotastat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fetch_struct_xfs_quotastat.obj -MD -MP -MF $(DEPDIR)/strace-fetch_struct_xfs_quotastat.Tpo -c -o strace-fetch_struct_xfs_quotastat.obj `if test -f 'fetch_struct_xfs_quotastat.c'; then $(CYGPATH_W) 'fetch_struct_xfs_quotastat.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_xfs_quotastat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fetch_struct_xfs_quotastat.Tpo $(DEPDIR)/strace-fetch_struct_xfs_quotastat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fetch_struct_xfs_quotastat.c' object='strace-fetch_struct_xfs_quotastat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fetch_struct_xfs_quotastat.obj `if test -f 'fetch_struct_xfs_quotastat.c'; then $(CYGPATH_W) 'fetch_struct_xfs_quotastat.c'; else $(CYGPATH_W) '$(srcdir)/fetch_struct_xfs_quotastat.c'; fi` + strace-file_handle.o: file_handle.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-file_handle.o -MD -MP -MF $(DEPDIR)/strace-file_handle.Tpo -c -o strace-file_handle.o `test -f 'file_handle.c' || echo '$(srcdir)/'`file_handle.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-file_handle.Tpo $(DEPDIR)/strace-file_handle.Po @@ -3648,19 +4752,19 @@ strace-file_ioctl.obj: file_ioctl.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-file_ioctl.obj `if test -f 'file_ioctl.c'; then $(CYGPATH_W) 'file_ioctl.c'; else $(CYGPATH_W) '$(srcdir)/file_ioctl.c'; fi` -strace-fs_x_ioctl.o: fs_x_ioctl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fs_x_ioctl.o -MD -MP -MF $(DEPDIR)/strace-fs_x_ioctl.Tpo -c -o strace-fs_x_ioctl.o `test -f 'fs_x_ioctl.c' || echo '$(srcdir)/'`fs_x_ioctl.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fs_x_ioctl.Tpo $(DEPDIR)/strace-fs_x_ioctl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fs_x_ioctl.c' object='strace-fs_x_ioctl.o' libtool=no @AMDEPBACKSLASH@ +strace-filter_qualify.o: filter_qualify.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-filter_qualify.o -MD -MP -MF $(DEPDIR)/strace-filter_qualify.Tpo -c -o strace-filter_qualify.o `test -f 'filter_qualify.c' || echo '$(srcdir)/'`filter_qualify.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-filter_qualify.Tpo $(DEPDIR)/strace-filter_qualify.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='filter_qualify.c' object='strace-filter_qualify.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fs_x_ioctl.o `test -f 'fs_x_ioctl.c' || echo '$(srcdir)/'`fs_x_ioctl.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-filter_qualify.o `test -f 'filter_qualify.c' || echo '$(srcdir)/'`filter_qualify.c -strace-fs_x_ioctl.obj: fs_x_ioctl.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fs_x_ioctl.obj -MD -MP -MF $(DEPDIR)/strace-fs_x_ioctl.Tpo -c -o strace-fs_x_ioctl.obj `if test -f 'fs_x_ioctl.c'; then $(CYGPATH_W) 'fs_x_ioctl.c'; else $(CYGPATH_W) '$(srcdir)/fs_x_ioctl.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fs_x_ioctl.Tpo $(DEPDIR)/strace-fs_x_ioctl.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fs_x_ioctl.c' object='strace-fs_x_ioctl.obj' libtool=no @AMDEPBACKSLASH@ +strace-filter_qualify.obj: filter_qualify.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-filter_qualify.obj -MD -MP -MF $(DEPDIR)/strace-filter_qualify.Tpo -c -o strace-filter_qualify.obj `if test -f 'filter_qualify.c'; then $(CYGPATH_W) 'filter_qualify.c'; else $(CYGPATH_W) '$(srcdir)/filter_qualify.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-filter_qualify.Tpo $(DEPDIR)/strace-filter_qualify.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='filter_qualify.c' object='strace-filter_qualify.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fs_x_ioctl.obj `if test -f 'fs_x_ioctl.c'; then $(CYGPATH_W) 'fs_x_ioctl.c'; else $(CYGPATH_W) '$(srcdir)/fs_x_ioctl.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-filter_qualify.obj `if test -f 'filter_qualify.c'; then $(CYGPATH_W) 'filter_qualify.c'; else $(CYGPATH_W) '$(srcdir)/filter_qualify.c'; fi` strace-flock.o: flock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-flock.o -MD -MP -MF $(DEPDIR)/strace-flock.Tpo -c -o strace-flock.o `test -f 'flock.c' || echo '$(srcdir)/'`flock.c @@ -3676,6 +4780,20 @@ strace-flock.obj: flock.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-flock.obj `if test -f 'flock.c'; then $(CYGPATH_W) 'flock.c'; else $(CYGPATH_W) '$(srcdir)/flock.c'; fi` +strace-fs_x_ioctl.o: fs_x_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fs_x_ioctl.o -MD -MP -MF $(DEPDIR)/strace-fs_x_ioctl.Tpo -c -o strace-fs_x_ioctl.o `test -f 'fs_x_ioctl.c' || echo '$(srcdir)/'`fs_x_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fs_x_ioctl.Tpo $(DEPDIR)/strace-fs_x_ioctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fs_x_ioctl.c' object='strace-fs_x_ioctl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fs_x_ioctl.o `test -f 'fs_x_ioctl.c' || echo '$(srcdir)/'`fs_x_ioctl.c + +strace-fs_x_ioctl.obj: fs_x_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-fs_x_ioctl.obj -MD -MP -MF $(DEPDIR)/strace-fs_x_ioctl.Tpo -c -o strace-fs_x_ioctl.obj `if test -f 'fs_x_ioctl.c'; then $(CYGPATH_W) 'fs_x_ioctl.c'; else $(CYGPATH_W) '$(srcdir)/fs_x_ioctl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-fs_x_ioctl.Tpo $(DEPDIR)/strace-fs_x_ioctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='fs_x_ioctl.c' object='strace-fs_x_ioctl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-fs_x_ioctl.obj `if test -f 'fs_x_ioctl.c'; then $(CYGPATH_W) 'fs_x_ioctl.c'; else $(CYGPATH_W) '$(srcdir)/fs_x_ioctl.c'; fi` + strace-futex.o: futex.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-futex.o -MD -MP -MF $(DEPDIR)/strace-futex.Tpo -c -o strace-futex.o `test -f 'futex.c' || echo '$(srcdir)/'`futex.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-futex.Tpo $(DEPDIR)/strace-futex.Po @@ -3690,6 +4808,20 @@ strace-futex.obj: futex.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-futex.obj `if test -f 'futex.c'; then $(CYGPATH_W) 'futex.c'; else $(CYGPATH_W) '$(srcdir)/futex.c'; fi` +strace-get_personality.o: get_personality.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-get_personality.o -MD -MP -MF $(DEPDIR)/strace-get_personality.Tpo -c -o strace-get_personality.o `test -f 'get_personality.c' || echo '$(srcdir)/'`get_personality.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-get_personality.Tpo $(DEPDIR)/strace-get_personality.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='get_personality.c' object='strace-get_personality.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-get_personality.o `test -f 'get_personality.c' || echo '$(srcdir)/'`get_personality.c + +strace-get_personality.obj: get_personality.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-get_personality.obj -MD -MP -MF $(DEPDIR)/strace-get_personality.Tpo -c -o strace-get_personality.obj `if test -f 'get_personality.c'; then $(CYGPATH_W) 'get_personality.c'; else $(CYGPATH_W) '$(srcdir)/get_personality.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-get_personality.Tpo $(DEPDIR)/strace-get_personality.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='get_personality.c' object='strace-get_personality.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-get_personality.obj `if test -f 'get_personality.c'; then $(CYGPATH_W) 'get_personality.c'; else $(CYGPATH_W) '$(srcdir)/get_personality.c'; fi` + strace-get_robust_list.o: get_robust_list.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-get_robust_list.o -MD -MP -MF $(DEPDIR)/strace-get_robust_list.Tpo -c -o strace-get_robust_list.o `test -f 'get_robust_list.c' || echo '$(srcdir)/'`get_robust_list.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-get_robust_list.Tpo $(DEPDIR)/strace-get_robust_list.Po @@ -3788,6 +4920,20 @@ strace-inotify.obj: inotify.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-inotify.obj `if test -f 'inotify.c'; then $(CYGPATH_W) 'inotify.c'; else $(CYGPATH_W) '$(srcdir)/inotify.c'; fi` +strace-inotify_ioctl.o: inotify_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-inotify_ioctl.o -MD -MP -MF $(DEPDIR)/strace-inotify_ioctl.Tpo -c -o strace-inotify_ioctl.o `test -f 'inotify_ioctl.c' || echo '$(srcdir)/'`inotify_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-inotify_ioctl.Tpo $(DEPDIR)/strace-inotify_ioctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inotify_ioctl.c' object='strace-inotify_ioctl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-inotify_ioctl.o `test -f 'inotify_ioctl.c' || echo '$(srcdir)/'`inotify_ioctl.c + +strace-inotify_ioctl.obj: inotify_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-inotify_ioctl.obj -MD -MP -MF $(DEPDIR)/strace-inotify_ioctl.Tpo -c -o strace-inotify_ioctl.obj `if test -f 'inotify_ioctl.c'; then $(CYGPATH_W) 'inotify_ioctl.c'; else $(CYGPATH_W) '$(srcdir)/inotify_ioctl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-inotify_ioctl.Tpo $(DEPDIR)/strace-inotify_ioctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='inotify_ioctl.c' object='strace-inotify_ioctl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-inotify_ioctl.obj `if test -f 'inotify_ioctl.c'; then $(CYGPATH_W) 'inotify_ioctl.c'; else $(CYGPATH_W) '$(srcdir)/inotify_ioctl.c'; fi` + strace-io.o: io.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-io.o -MD -MP -MF $(DEPDIR)/strace-io.Tpo -c -o strace-io.o `test -f 'io.c' || echo '$(srcdir)/'`io.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-io.Tpo $(DEPDIR)/strace-io.Po @@ -3802,6 +4948,20 @@ strace-io.obj: io.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-io.obj `if test -f 'io.c'; then $(CYGPATH_W) 'io.c'; else $(CYGPATH_W) '$(srcdir)/io.c'; fi` +strace-io_uring.o: io_uring.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-io_uring.o -MD -MP -MF $(DEPDIR)/strace-io_uring.Tpo -c -o strace-io_uring.o `test -f 'io_uring.c' || echo '$(srcdir)/'`io_uring.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-io_uring.Tpo $(DEPDIR)/strace-io_uring.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='io_uring.c' object='strace-io_uring.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-io_uring.o `test -f 'io_uring.c' || echo '$(srcdir)/'`io_uring.c + +strace-io_uring.obj: io_uring.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-io_uring.obj -MD -MP -MF $(DEPDIR)/strace-io_uring.Tpo -c -o strace-io_uring.obj `if test -f 'io_uring.c'; then $(CYGPATH_W) 'io_uring.c'; else $(CYGPATH_W) '$(srcdir)/io_uring.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-io_uring.Tpo $(DEPDIR)/strace-io_uring.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='io_uring.c' object='strace-io_uring.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-io_uring.obj `if test -f 'io_uring.c'; then $(CYGPATH_W) 'io_uring.c'; else $(CYGPATH_W) '$(srcdir)/io_uring.c'; fi` + strace-ioctl.o: ioctl.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ioctl.o -MD -MP -MF $(DEPDIR)/strace-ioctl.Tpo -c -o strace-ioctl.o `test -f 'ioctl.c' || echo '$(srcdir)/'`ioctl.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ioctl.Tpo $(DEPDIR)/strace-ioctl.Po @@ -3970,6 +5130,20 @@ strace-keyctl.obj: keyctl.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-keyctl.obj `if test -f 'keyctl.c'; then $(CYGPATH_W) 'keyctl.c'; else $(CYGPATH_W) '$(srcdir)/keyctl.c'; fi` +strace-kvm.o: kvm.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-kvm.o -MD -MP -MF $(DEPDIR)/strace-kvm.Tpo -c -o strace-kvm.o `test -f 'kvm.c' || echo '$(srcdir)/'`kvm.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-kvm.Tpo $(DEPDIR)/strace-kvm.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kvm.c' object='strace-kvm.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-kvm.o `test -f 'kvm.c' || echo '$(srcdir)/'`kvm.c + +strace-kvm.obj: kvm.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-kvm.obj -MD -MP -MF $(DEPDIR)/strace-kvm.Tpo -c -o strace-kvm.obj `if test -f 'kvm.c'; then $(CYGPATH_W) 'kvm.c'; else $(CYGPATH_W) '$(srcdir)/kvm.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-kvm.Tpo $(DEPDIR)/strace-kvm.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='kvm.c' object='strace-kvm.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-kvm.obj `if test -f 'kvm.c'; then $(CYGPATH_W) 'kvm.c'; else $(CYGPATH_W) '$(srcdir)/kvm.c'; fi` + strace-ldt.o: ldt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ldt.o -MD -MP -MF $(DEPDIR)/strace-ldt.Tpo -c -o strace-ldt.o `test -f 'ldt.c' || echo '$(srcdir)/'`ldt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ldt.Tpo $(DEPDIR)/strace-ldt.Po @@ -3998,6 +5172,20 @@ strace-link.obj: link.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-link.obj `if test -f 'link.c'; then $(CYGPATH_W) 'link.c'; else $(CYGPATH_W) '$(srcdir)/link.c'; fi` +strace-listen.o: listen.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-listen.o -MD -MP -MF $(DEPDIR)/strace-listen.Tpo -c -o strace-listen.o `test -f 'listen.c' || echo '$(srcdir)/'`listen.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-listen.Tpo $(DEPDIR)/strace-listen.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='listen.c' object='strace-listen.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-listen.o `test -f 'listen.c' || echo '$(srcdir)/'`listen.c + +strace-listen.obj: listen.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-listen.obj -MD -MP -MF $(DEPDIR)/strace-listen.Tpo -c -o strace-listen.obj `if test -f 'listen.c'; then $(CYGPATH_W) 'listen.c'; else $(CYGPATH_W) '$(srcdir)/listen.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-listen.Tpo $(DEPDIR)/strace-listen.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='listen.c' object='strace-listen.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-listen.obj `if test -f 'listen.c'; then $(CYGPATH_W) 'listen.c'; else $(CYGPATH_W) '$(srcdir)/listen.c'; fi` + strace-lookup_dcookie.o: lookup_dcookie.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-lookup_dcookie.o -MD -MP -MF $(DEPDIR)/strace-lookup_dcookie.Tpo -c -o strace-lookup_dcookie.o `test -f 'lookup_dcookie.c' || echo '$(srcdir)/'`lookup_dcookie.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-lookup_dcookie.Tpo $(DEPDIR)/strace-lookup_dcookie.Po @@ -4096,6 +5284,20 @@ strace-mknod.obj: mknod.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-mknod.obj `if test -f 'mknod.c'; then $(CYGPATH_W) 'mknod.c'; else $(CYGPATH_W) '$(srcdir)/mknod.c'; fi` +strace-mmap_notify.o: mmap_notify.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-mmap_notify.o -MD -MP -MF $(DEPDIR)/strace-mmap_notify.Tpo -c -o strace-mmap_notify.o `test -f 'mmap_notify.c' || echo '$(srcdir)/'`mmap_notify.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-mmap_notify.Tpo $(DEPDIR)/strace-mmap_notify.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap_notify.c' object='strace-mmap_notify.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-mmap_notify.o `test -f 'mmap_notify.c' || echo '$(srcdir)/'`mmap_notify.c + +strace-mmap_notify.obj: mmap_notify.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-mmap_notify.obj -MD -MP -MF $(DEPDIR)/strace-mmap_notify.Tpo -c -o strace-mmap_notify.obj `if test -f 'mmap_notify.c'; then $(CYGPATH_W) 'mmap_notify.c'; else $(CYGPATH_W) '$(srcdir)/mmap_notify.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-mmap_notify.Tpo $(DEPDIR)/strace-mmap_notify.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap_notify.c' object='strace-mmap_notify.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-mmap_notify.obj `if test -f 'mmap_notify.c'; then $(CYGPATH_W) 'mmap_notify.c'; else $(CYGPATH_W) '$(srcdir)/mmap_notify.c'; fi` + strace-mmsghdr.o: mmsghdr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-mmsghdr.o -MD -MP -MF $(DEPDIR)/strace-mmsghdr.Tpo -c -o strace-mmsghdr.o `test -f 'mmsghdr.c' || echo '$(srcdir)/'`mmsghdr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-mmsghdr.Tpo $(DEPDIR)/strace-mmsghdr.Po @@ -4166,6 +5368,20 @@ strace-mtd.obj: mtd.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-mtd.obj `if test -f 'mtd.c'; then $(CYGPATH_W) 'mtd.c'; else $(CYGPATH_W) '$(srcdir)/mtd.c'; fi` +strace-nbd_ioctl.o: nbd_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-nbd_ioctl.o -MD -MP -MF $(DEPDIR)/strace-nbd_ioctl.Tpo -c -o strace-nbd_ioctl.o `test -f 'nbd_ioctl.c' || echo '$(srcdir)/'`nbd_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-nbd_ioctl.Tpo $(DEPDIR)/strace-nbd_ioctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nbd_ioctl.c' object='strace-nbd_ioctl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-nbd_ioctl.o `test -f 'nbd_ioctl.c' || echo '$(srcdir)/'`nbd_ioctl.c + +strace-nbd_ioctl.obj: nbd_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-nbd_ioctl.obj -MD -MP -MF $(DEPDIR)/strace-nbd_ioctl.Tpo -c -o strace-nbd_ioctl.obj `if test -f 'nbd_ioctl.c'; then $(CYGPATH_W) 'nbd_ioctl.c'; else $(CYGPATH_W) '$(srcdir)/nbd_ioctl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-nbd_ioctl.Tpo $(DEPDIR)/strace-nbd_ioctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nbd_ioctl.c' object='strace-nbd_ioctl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-nbd_ioctl.obj `if test -f 'nbd_ioctl.c'; then $(CYGPATH_W) 'nbd_ioctl.c'; else $(CYGPATH_W) '$(srcdir)/nbd_ioctl.c'; fi` + strace-net.o: net.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-net.o -MD -MP -MF $(DEPDIR)/strace-net.Tpo -c -o strace-net.o `test -f 'net.c' || echo '$(srcdir)/'`net.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-net.Tpo $(DEPDIR)/strace-net.Po @@ -4194,40 +5410,236 @@ strace-netlink.obj: netlink.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink.obj `if test -f 'netlink.c'; then $(CYGPATH_W) 'netlink.c'; else $(CYGPATH_W) '$(srcdir)/netlink.c'; fi` -strace-numa.o: numa.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-numa.o -MD -MP -MF $(DEPDIR)/strace-numa.Tpo -c -o strace-numa.o `test -f 'numa.c' || echo '$(srcdir)/'`numa.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-numa.Tpo $(DEPDIR)/strace-numa.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='numa.c' object='strace-numa.o' libtool=no @AMDEPBACKSLASH@ +strace-netlink_crypto.o: netlink_crypto.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink_crypto.o -MD -MP -MF $(DEPDIR)/strace-netlink_crypto.Tpo -c -o strace-netlink_crypto.o `test -f 'netlink_crypto.c' || echo '$(srcdir)/'`netlink_crypto.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink_crypto.Tpo $(DEPDIR)/strace-netlink_crypto.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink_crypto.c' object='strace-netlink_crypto.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-numa.o `test -f 'numa.c' || echo '$(srcdir)/'`numa.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink_crypto.o `test -f 'netlink_crypto.c' || echo '$(srcdir)/'`netlink_crypto.c -strace-numa.obj: numa.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-numa.obj -MD -MP -MF $(DEPDIR)/strace-numa.Tpo -c -o strace-numa.obj `if test -f 'numa.c'; then $(CYGPATH_W) 'numa.c'; else $(CYGPATH_W) '$(srcdir)/numa.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-numa.Tpo $(DEPDIR)/strace-numa.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='numa.c' object='strace-numa.obj' libtool=no @AMDEPBACKSLASH@ +strace-netlink_crypto.obj: netlink_crypto.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink_crypto.obj -MD -MP -MF $(DEPDIR)/strace-netlink_crypto.Tpo -c -o strace-netlink_crypto.obj `if test -f 'netlink_crypto.c'; then $(CYGPATH_W) 'netlink_crypto.c'; else $(CYGPATH_W) '$(srcdir)/netlink_crypto.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink_crypto.Tpo $(DEPDIR)/strace-netlink_crypto.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink_crypto.c' object='strace-netlink_crypto.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-numa.obj `if test -f 'numa.c'; then $(CYGPATH_W) 'numa.c'; else $(CYGPATH_W) '$(srcdir)/numa.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink_crypto.obj `if test -f 'netlink_crypto.c'; then $(CYGPATH_W) 'netlink_crypto.c'; else $(CYGPATH_W) '$(srcdir)/netlink_crypto.c'; fi` -strace-oldstat.o: oldstat.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-oldstat.o -MD -MP -MF $(DEPDIR)/strace-oldstat.Tpo -c -o strace-oldstat.o `test -f 'oldstat.c' || echo '$(srcdir)/'`oldstat.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-oldstat.Tpo $(DEPDIR)/strace-oldstat.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='oldstat.c' object='strace-oldstat.o' libtool=no @AMDEPBACKSLASH@ +strace-netlink_inet_diag.o: netlink_inet_diag.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink_inet_diag.o -MD -MP -MF $(DEPDIR)/strace-netlink_inet_diag.Tpo -c -o strace-netlink_inet_diag.o `test -f 'netlink_inet_diag.c' || echo '$(srcdir)/'`netlink_inet_diag.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink_inet_diag.Tpo $(DEPDIR)/strace-netlink_inet_diag.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink_inet_diag.c' object='strace-netlink_inet_diag.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-oldstat.o `test -f 'oldstat.c' || echo '$(srcdir)/'`oldstat.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink_inet_diag.o `test -f 'netlink_inet_diag.c' || echo '$(srcdir)/'`netlink_inet_diag.c -strace-oldstat.obj: oldstat.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-oldstat.obj -MD -MP -MF $(DEPDIR)/strace-oldstat.Tpo -c -o strace-oldstat.obj `if test -f 'oldstat.c'; then $(CYGPATH_W) 'oldstat.c'; else $(CYGPATH_W) '$(srcdir)/oldstat.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-oldstat.Tpo $(DEPDIR)/strace-oldstat.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='oldstat.c' object='strace-oldstat.obj' libtool=no @AMDEPBACKSLASH@ +strace-netlink_inet_diag.obj: netlink_inet_diag.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink_inet_diag.obj -MD -MP -MF $(DEPDIR)/strace-netlink_inet_diag.Tpo -c -o strace-netlink_inet_diag.obj `if test -f 'netlink_inet_diag.c'; then $(CYGPATH_W) 'netlink_inet_diag.c'; else $(CYGPATH_W) '$(srcdir)/netlink_inet_diag.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink_inet_diag.Tpo $(DEPDIR)/strace-netlink_inet_diag.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink_inet_diag.c' object='strace-netlink_inet_diag.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-oldstat.obj `if test -f 'oldstat.c'; then $(CYGPATH_W) 'oldstat.c'; else $(CYGPATH_W) '$(srcdir)/oldstat.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink_inet_diag.obj `if test -f 'netlink_inet_diag.c'; then $(CYGPATH_W) 'netlink_inet_diag.c'; else $(CYGPATH_W) '$(srcdir)/netlink_inet_diag.c'; fi` -strace-open.o: open.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-open.o -MD -MP -MF $(DEPDIR)/strace-open.Tpo -c -o strace-open.o `test -f 'open.c' || echo '$(srcdir)/'`open.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-open.Tpo $(DEPDIR)/strace-open.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='open.c' object='strace-open.o' libtool=no @AMDEPBACKSLASH@ +strace-netlink_kobject_uevent.o: netlink_kobject_uevent.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink_kobject_uevent.o -MD -MP -MF $(DEPDIR)/strace-netlink_kobject_uevent.Tpo -c -o strace-netlink_kobject_uevent.o `test -f 'netlink_kobject_uevent.c' || echo '$(srcdir)/'`netlink_kobject_uevent.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink_kobject_uevent.Tpo $(DEPDIR)/strace-netlink_kobject_uevent.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink_kobject_uevent.c' object='strace-netlink_kobject_uevent.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-open.o `test -f 'open.c' || echo '$(srcdir)/'`open.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink_kobject_uevent.o `test -f 'netlink_kobject_uevent.c' || echo '$(srcdir)/'`netlink_kobject_uevent.c + +strace-netlink_kobject_uevent.obj: netlink_kobject_uevent.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink_kobject_uevent.obj -MD -MP -MF $(DEPDIR)/strace-netlink_kobject_uevent.Tpo -c -o strace-netlink_kobject_uevent.obj `if test -f 'netlink_kobject_uevent.c'; then $(CYGPATH_W) 'netlink_kobject_uevent.c'; else $(CYGPATH_W) '$(srcdir)/netlink_kobject_uevent.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink_kobject_uevent.Tpo $(DEPDIR)/strace-netlink_kobject_uevent.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink_kobject_uevent.c' object='strace-netlink_kobject_uevent.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink_kobject_uevent.obj `if test -f 'netlink_kobject_uevent.c'; then $(CYGPATH_W) 'netlink_kobject_uevent.c'; else $(CYGPATH_W) '$(srcdir)/netlink_kobject_uevent.c'; fi` + +strace-netlink_netfilter.o: netlink_netfilter.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink_netfilter.o -MD -MP -MF $(DEPDIR)/strace-netlink_netfilter.Tpo -c -o strace-netlink_netfilter.o `test -f 'netlink_netfilter.c' || echo '$(srcdir)/'`netlink_netfilter.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink_netfilter.Tpo $(DEPDIR)/strace-netlink_netfilter.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink_netfilter.c' object='strace-netlink_netfilter.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink_netfilter.o `test -f 'netlink_netfilter.c' || echo '$(srcdir)/'`netlink_netfilter.c + +strace-netlink_netfilter.obj: netlink_netfilter.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink_netfilter.obj -MD -MP -MF $(DEPDIR)/strace-netlink_netfilter.Tpo -c -o strace-netlink_netfilter.obj `if test -f 'netlink_netfilter.c'; then $(CYGPATH_W) 'netlink_netfilter.c'; else $(CYGPATH_W) '$(srcdir)/netlink_netfilter.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink_netfilter.Tpo $(DEPDIR)/strace-netlink_netfilter.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink_netfilter.c' object='strace-netlink_netfilter.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink_netfilter.obj `if test -f 'netlink_netfilter.c'; then $(CYGPATH_W) 'netlink_netfilter.c'; else $(CYGPATH_W) '$(srcdir)/netlink_netfilter.c'; fi` + +strace-netlink_netlink_diag.o: netlink_netlink_diag.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink_netlink_diag.o -MD -MP -MF $(DEPDIR)/strace-netlink_netlink_diag.Tpo -c -o strace-netlink_netlink_diag.o `test -f 'netlink_netlink_diag.c' || echo '$(srcdir)/'`netlink_netlink_diag.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink_netlink_diag.Tpo $(DEPDIR)/strace-netlink_netlink_diag.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink_netlink_diag.c' object='strace-netlink_netlink_diag.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink_netlink_diag.o `test -f 'netlink_netlink_diag.c' || echo '$(srcdir)/'`netlink_netlink_diag.c + +strace-netlink_netlink_diag.obj: netlink_netlink_diag.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink_netlink_diag.obj -MD -MP -MF $(DEPDIR)/strace-netlink_netlink_diag.Tpo -c -o strace-netlink_netlink_diag.obj `if test -f 'netlink_netlink_diag.c'; then $(CYGPATH_W) 'netlink_netlink_diag.c'; else $(CYGPATH_W) '$(srcdir)/netlink_netlink_diag.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink_netlink_diag.Tpo $(DEPDIR)/strace-netlink_netlink_diag.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink_netlink_diag.c' object='strace-netlink_netlink_diag.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink_netlink_diag.obj `if test -f 'netlink_netlink_diag.c'; then $(CYGPATH_W) 'netlink_netlink_diag.c'; else $(CYGPATH_W) '$(srcdir)/netlink_netlink_diag.c'; fi` + +strace-netlink_packet_diag.o: netlink_packet_diag.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink_packet_diag.o -MD -MP -MF $(DEPDIR)/strace-netlink_packet_diag.Tpo -c -o strace-netlink_packet_diag.o `test -f 'netlink_packet_diag.c' || echo '$(srcdir)/'`netlink_packet_diag.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink_packet_diag.Tpo $(DEPDIR)/strace-netlink_packet_diag.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink_packet_diag.c' object='strace-netlink_packet_diag.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink_packet_diag.o `test -f 'netlink_packet_diag.c' || echo '$(srcdir)/'`netlink_packet_diag.c + +strace-netlink_packet_diag.obj: netlink_packet_diag.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink_packet_diag.obj -MD -MP -MF $(DEPDIR)/strace-netlink_packet_diag.Tpo -c -o strace-netlink_packet_diag.obj `if test -f 'netlink_packet_diag.c'; then $(CYGPATH_W) 'netlink_packet_diag.c'; else $(CYGPATH_W) '$(srcdir)/netlink_packet_diag.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink_packet_diag.Tpo $(DEPDIR)/strace-netlink_packet_diag.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink_packet_diag.c' object='strace-netlink_packet_diag.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink_packet_diag.obj `if test -f 'netlink_packet_diag.c'; then $(CYGPATH_W) 'netlink_packet_diag.c'; else $(CYGPATH_W) '$(srcdir)/netlink_packet_diag.c'; fi` + +strace-netlink_route.o: netlink_route.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink_route.o -MD -MP -MF $(DEPDIR)/strace-netlink_route.Tpo -c -o strace-netlink_route.o `test -f 'netlink_route.c' || echo '$(srcdir)/'`netlink_route.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink_route.Tpo $(DEPDIR)/strace-netlink_route.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink_route.c' object='strace-netlink_route.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink_route.o `test -f 'netlink_route.c' || echo '$(srcdir)/'`netlink_route.c + +strace-netlink_route.obj: netlink_route.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink_route.obj -MD -MP -MF $(DEPDIR)/strace-netlink_route.Tpo -c -o strace-netlink_route.obj `if test -f 'netlink_route.c'; then $(CYGPATH_W) 'netlink_route.c'; else $(CYGPATH_W) '$(srcdir)/netlink_route.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink_route.Tpo $(DEPDIR)/strace-netlink_route.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink_route.c' object='strace-netlink_route.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink_route.obj `if test -f 'netlink_route.c'; then $(CYGPATH_W) 'netlink_route.c'; else $(CYGPATH_W) '$(srcdir)/netlink_route.c'; fi` + +strace-netlink_selinux.o: netlink_selinux.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink_selinux.o -MD -MP -MF $(DEPDIR)/strace-netlink_selinux.Tpo -c -o strace-netlink_selinux.o `test -f 'netlink_selinux.c' || echo '$(srcdir)/'`netlink_selinux.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink_selinux.Tpo $(DEPDIR)/strace-netlink_selinux.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink_selinux.c' object='strace-netlink_selinux.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink_selinux.o `test -f 'netlink_selinux.c' || echo '$(srcdir)/'`netlink_selinux.c + +strace-netlink_selinux.obj: netlink_selinux.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink_selinux.obj -MD -MP -MF $(DEPDIR)/strace-netlink_selinux.Tpo -c -o strace-netlink_selinux.obj `if test -f 'netlink_selinux.c'; then $(CYGPATH_W) 'netlink_selinux.c'; else $(CYGPATH_W) '$(srcdir)/netlink_selinux.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink_selinux.Tpo $(DEPDIR)/strace-netlink_selinux.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink_selinux.c' object='strace-netlink_selinux.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink_selinux.obj `if test -f 'netlink_selinux.c'; then $(CYGPATH_W) 'netlink_selinux.c'; else $(CYGPATH_W) '$(srcdir)/netlink_selinux.c'; fi` + +strace-netlink_smc_diag.o: netlink_smc_diag.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink_smc_diag.o -MD -MP -MF $(DEPDIR)/strace-netlink_smc_diag.Tpo -c -o strace-netlink_smc_diag.o `test -f 'netlink_smc_diag.c' || echo '$(srcdir)/'`netlink_smc_diag.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink_smc_diag.Tpo $(DEPDIR)/strace-netlink_smc_diag.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink_smc_diag.c' object='strace-netlink_smc_diag.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink_smc_diag.o `test -f 'netlink_smc_diag.c' || echo '$(srcdir)/'`netlink_smc_diag.c + +strace-netlink_smc_diag.obj: netlink_smc_diag.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink_smc_diag.obj -MD -MP -MF $(DEPDIR)/strace-netlink_smc_diag.Tpo -c -o strace-netlink_smc_diag.obj `if test -f 'netlink_smc_diag.c'; then $(CYGPATH_W) 'netlink_smc_diag.c'; else $(CYGPATH_W) '$(srcdir)/netlink_smc_diag.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink_smc_diag.Tpo $(DEPDIR)/strace-netlink_smc_diag.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink_smc_diag.c' object='strace-netlink_smc_diag.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink_smc_diag.obj `if test -f 'netlink_smc_diag.c'; then $(CYGPATH_W) 'netlink_smc_diag.c'; else $(CYGPATH_W) '$(srcdir)/netlink_smc_diag.c'; fi` + +strace-netlink_sock_diag.o: netlink_sock_diag.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink_sock_diag.o -MD -MP -MF $(DEPDIR)/strace-netlink_sock_diag.Tpo -c -o strace-netlink_sock_diag.o `test -f 'netlink_sock_diag.c' || echo '$(srcdir)/'`netlink_sock_diag.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink_sock_diag.Tpo $(DEPDIR)/strace-netlink_sock_diag.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink_sock_diag.c' object='strace-netlink_sock_diag.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink_sock_diag.o `test -f 'netlink_sock_diag.c' || echo '$(srcdir)/'`netlink_sock_diag.c + +strace-netlink_sock_diag.obj: netlink_sock_diag.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink_sock_diag.obj -MD -MP -MF $(DEPDIR)/strace-netlink_sock_diag.Tpo -c -o strace-netlink_sock_diag.obj `if test -f 'netlink_sock_diag.c'; then $(CYGPATH_W) 'netlink_sock_diag.c'; else $(CYGPATH_W) '$(srcdir)/netlink_sock_diag.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink_sock_diag.Tpo $(DEPDIR)/strace-netlink_sock_diag.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink_sock_diag.c' object='strace-netlink_sock_diag.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink_sock_diag.obj `if test -f 'netlink_sock_diag.c'; then $(CYGPATH_W) 'netlink_sock_diag.c'; else $(CYGPATH_W) '$(srcdir)/netlink_sock_diag.c'; fi` + +strace-netlink_unix_diag.o: netlink_unix_diag.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink_unix_diag.o -MD -MP -MF $(DEPDIR)/strace-netlink_unix_diag.Tpo -c -o strace-netlink_unix_diag.o `test -f 'netlink_unix_diag.c' || echo '$(srcdir)/'`netlink_unix_diag.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink_unix_diag.Tpo $(DEPDIR)/strace-netlink_unix_diag.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink_unix_diag.c' object='strace-netlink_unix_diag.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink_unix_diag.o `test -f 'netlink_unix_diag.c' || echo '$(srcdir)/'`netlink_unix_diag.c + +strace-netlink_unix_diag.obj: netlink_unix_diag.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-netlink_unix_diag.obj -MD -MP -MF $(DEPDIR)/strace-netlink_unix_diag.Tpo -c -o strace-netlink_unix_diag.obj `if test -f 'netlink_unix_diag.c'; then $(CYGPATH_W) 'netlink_unix_diag.c'; else $(CYGPATH_W) '$(srcdir)/netlink_unix_diag.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-netlink_unix_diag.Tpo $(DEPDIR)/strace-netlink_unix_diag.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='netlink_unix_diag.c' object='strace-netlink_unix_diag.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-netlink_unix_diag.obj `if test -f 'netlink_unix_diag.c'; then $(CYGPATH_W) 'netlink_unix_diag.c'; else $(CYGPATH_W) '$(srcdir)/netlink_unix_diag.c'; fi` + +strace-nlattr.o: nlattr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-nlattr.o -MD -MP -MF $(DEPDIR)/strace-nlattr.Tpo -c -o strace-nlattr.o `test -f 'nlattr.c' || echo '$(srcdir)/'`nlattr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-nlattr.Tpo $(DEPDIR)/strace-nlattr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nlattr.c' object='strace-nlattr.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-nlattr.o `test -f 'nlattr.c' || echo '$(srcdir)/'`nlattr.c + +strace-nlattr.obj: nlattr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-nlattr.obj -MD -MP -MF $(DEPDIR)/strace-nlattr.Tpo -c -o strace-nlattr.obj `if test -f 'nlattr.c'; then $(CYGPATH_W) 'nlattr.c'; else $(CYGPATH_W) '$(srcdir)/nlattr.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-nlattr.Tpo $(DEPDIR)/strace-nlattr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nlattr.c' object='strace-nlattr.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-nlattr.obj `if test -f 'nlattr.c'; then $(CYGPATH_W) 'nlattr.c'; else $(CYGPATH_W) '$(srcdir)/nlattr.c'; fi` + +strace-nsfs.o: nsfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-nsfs.o -MD -MP -MF $(DEPDIR)/strace-nsfs.Tpo -c -o strace-nsfs.o `test -f 'nsfs.c' || echo '$(srcdir)/'`nsfs.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-nsfs.Tpo $(DEPDIR)/strace-nsfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nsfs.c' object='strace-nsfs.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-nsfs.o `test -f 'nsfs.c' || echo '$(srcdir)/'`nsfs.c + +strace-nsfs.obj: nsfs.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-nsfs.obj -MD -MP -MF $(DEPDIR)/strace-nsfs.Tpo -c -o strace-nsfs.obj `if test -f 'nsfs.c'; then $(CYGPATH_W) 'nsfs.c'; else $(CYGPATH_W) '$(srcdir)/nsfs.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-nsfs.Tpo $(DEPDIR)/strace-nsfs.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='nsfs.c' object='strace-nsfs.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-nsfs.obj `if test -f 'nsfs.c'; then $(CYGPATH_W) 'nsfs.c'; else $(CYGPATH_W) '$(srcdir)/nsfs.c'; fi` + +strace-numa.o: numa.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-numa.o -MD -MP -MF $(DEPDIR)/strace-numa.Tpo -c -o strace-numa.o `test -f 'numa.c' || echo '$(srcdir)/'`numa.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-numa.Tpo $(DEPDIR)/strace-numa.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='numa.c' object='strace-numa.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-numa.o `test -f 'numa.c' || echo '$(srcdir)/'`numa.c + +strace-numa.obj: numa.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-numa.obj -MD -MP -MF $(DEPDIR)/strace-numa.Tpo -c -o strace-numa.obj `if test -f 'numa.c'; then $(CYGPATH_W) 'numa.c'; else $(CYGPATH_W) '$(srcdir)/numa.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-numa.Tpo $(DEPDIR)/strace-numa.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='numa.c' object='strace-numa.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-numa.obj `if test -f 'numa.c'; then $(CYGPATH_W) 'numa.c'; else $(CYGPATH_W) '$(srcdir)/numa.c'; fi` + +strace-number_set.o: number_set.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-number_set.o -MD -MP -MF $(DEPDIR)/strace-number_set.Tpo -c -o strace-number_set.o `test -f 'number_set.c' || echo '$(srcdir)/'`number_set.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-number_set.Tpo $(DEPDIR)/strace-number_set.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='number_set.c' object='strace-number_set.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-number_set.o `test -f 'number_set.c' || echo '$(srcdir)/'`number_set.c + +strace-number_set.obj: number_set.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-number_set.obj -MD -MP -MF $(DEPDIR)/strace-number_set.Tpo -c -o strace-number_set.obj `if test -f 'number_set.c'; then $(CYGPATH_W) 'number_set.c'; else $(CYGPATH_W) '$(srcdir)/number_set.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-number_set.Tpo $(DEPDIR)/strace-number_set.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='number_set.c' object='strace-number_set.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-number_set.obj `if test -f 'number_set.c'; then $(CYGPATH_W) 'number_set.c'; else $(CYGPATH_W) '$(srcdir)/number_set.c'; fi` + +strace-oldstat.o: oldstat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-oldstat.o -MD -MP -MF $(DEPDIR)/strace-oldstat.Tpo -c -o strace-oldstat.o `test -f 'oldstat.c' || echo '$(srcdir)/'`oldstat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-oldstat.Tpo $(DEPDIR)/strace-oldstat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='oldstat.c' object='strace-oldstat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-oldstat.o `test -f 'oldstat.c' || echo '$(srcdir)/'`oldstat.c + +strace-oldstat.obj: oldstat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-oldstat.obj -MD -MP -MF $(DEPDIR)/strace-oldstat.Tpo -c -o strace-oldstat.obj `if test -f 'oldstat.c'; then $(CYGPATH_W) 'oldstat.c'; else $(CYGPATH_W) '$(srcdir)/oldstat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-oldstat.Tpo $(DEPDIR)/strace-oldstat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='oldstat.c' object='strace-oldstat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-oldstat.obj `if test -f 'oldstat.c'; then $(CYGPATH_W) 'oldstat.c'; else $(CYGPATH_W) '$(srcdir)/oldstat.c'; fi` + +strace-open.o: open.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-open.o -MD -MP -MF $(DEPDIR)/strace-open.Tpo -c -o strace-open.o `test -f 'open.c' || echo '$(srcdir)/'`open.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-open.Tpo $(DEPDIR)/strace-open.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='open.c' object='strace-open.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-open.o `test -f 'open.c' || echo '$(srcdir)/'`open.c strace-open.obj: open.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-open.obj -MD -MP -MF $(DEPDIR)/strace-open.Tpo -c -o strace-open.obj `if test -f 'open.c'; then $(CYGPATH_W) 'open.c'; else $(CYGPATH_W) '$(srcdir)/open.c'; fi` @@ -4278,6 +5690,20 @@ strace-perf.obj: perf.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-perf.obj `if test -f 'perf.c'; then $(CYGPATH_W) 'perf.c'; else $(CYGPATH_W) '$(srcdir)/perf.c'; fi` +strace-perf_ioctl.o: perf_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-perf_ioctl.o -MD -MP -MF $(DEPDIR)/strace-perf_ioctl.Tpo -c -o strace-perf_ioctl.o `test -f 'perf_ioctl.c' || echo '$(srcdir)/'`perf_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-perf_ioctl.Tpo $(DEPDIR)/strace-perf_ioctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='perf_ioctl.c' object='strace-perf_ioctl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-perf_ioctl.o `test -f 'perf_ioctl.c' || echo '$(srcdir)/'`perf_ioctl.c + +strace-perf_ioctl.obj: perf_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-perf_ioctl.obj -MD -MP -MF $(DEPDIR)/strace-perf_ioctl.Tpo -c -o strace-perf_ioctl.obj `if test -f 'perf_ioctl.c'; then $(CYGPATH_W) 'perf_ioctl.c'; else $(CYGPATH_W) '$(srcdir)/perf_ioctl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-perf_ioctl.Tpo $(DEPDIR)/strace-perf_ioctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='perf_ioctl.c' object='strace-perf_ioctl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-perf_ioctl.obj `if test -f 'perf_ioctl.c'; then $(CYGPATH_W) 'perf_ioctl.c'; else $(CYGPATH_W) '$(srcdir)/perf_ioctl.c'; fi` + strace-personality.o: personality.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-personality.o -MD -MP -MF $(DEPDIR)/strace-personality.Tpo -c -o strace-personality.o `test -f 'personality.c' || echo '$(srcdir)/'`personality.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-personality.Tpo $(DEPDIR)/strace-personality.Po @@ -4334,6 +5760,20 @@ strace-prctl.obj: prctl.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-prctl.obj `if test -f 'prctl.c'; then $(CYGPATH_W) 'prctl.c'; else $(CYGPATH_W) '$(srcdir)/prctl.c'; fi` +strace-print_aio_sigset.o: print_aio_sigset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_aio_sigset.o -MD -MP -MF $(DEPDIR)/strace-print_aio_sigset.Tpo -c -o strace-print_aio_sigset.o `test -f 'print_aio_sigset.c' || echo '$(srcdir)/'`print_aio_sigset.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_aio_sigset.Tpo $(DEPDIR)/strace-print_aio_sigset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_aio_sigset.c' object='strace-print_aio_sigset.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_aio_sigset.o `test -f 'print_aio_sigset.c' || echo '$(srcdir)/'`print_aio_sigset.c + +strace-print_aio_sigset.obj: print_aio_sigset.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_aio_sigset.obj -MD -MP -MF $(DEPDIR)/strace-print_aio_sigset.Tpo -c -o strace-print_aio_sigset.obj `if test -f 'print_aio_sigset.c'; then $(CYGPATH_W) 'print_aio_sigset.c'; else $(CYGPATH_W) '$(srcdir)/print_aio_sigset.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_aio_sigset.Tpo $(DEPDIR)/strace-print_aio_sigset.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_aio_sigset.c' object='strace-print_aio_sigset.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_aio_sigset.obj `if test -f 'print_aio_sigset.c'; then $(CYGPATH_W) 'print_aio_sigset.c'; else $(CYGPATH_W) '$(srcdir)/print_aio_sigset.c'; fi` + strace-print_dev_t.o: print_dev_t.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_dev_t.o -MD -MP -MF $(DEPDIR)/strace-print_dev_t.Tpo -c -o strace-print_dev_t.o `test -f 'print_dev_t.c' || echo '$(srcdir)/'`print_dev_t.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_dev_t.Tpo $(DEPDIR)/strace-print_dev_t.Po @@ -4348,6 +5788,76 @@ strace-print_dev_t.obj: print_dev_t.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_dev_t.obj `if test -f 'print_dev_t.c'; then $(CYGPATH_W) 'print_dev_t.c'; else $(CYGPATH_W) '$(srcdir)/print_dev_t.c'; fi` +strace-print_group_req.o: print_group_req.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_group_req.o -MD -MP -MF $(DEPDIR)/strace-print_group_req.Tpo -c -o strace-print_group_req.o `test -f 'print_group_req.c' || echo '$(srcdir)/'`print_group_req.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_group_req.Tpo $(DEPDIR)/strace-print_group_req.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_group_req.c' object='strace-print_group_req.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_group_req.o `test -f 'print_group_req.c' || echo '$(srcdir)/'`print_group_req.c + +strace-print_group_req.obj: print_group_req.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_group_req.obj -MD -MP -MF $(DEPDIR)/strace-print_group_req.Tpo -c -o strace-print_group_req.obj `if test -f 'print_group_req.c'; then $(CYGPATH_W) 'print_group_req.c'; else $(CYGPATH_W) '$(srcdir)/print_group_req.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_group_req.Tpo $(DEPDIR)/strace-print_group_req.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_group_req.c' object='strace-print_group_req.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_group_req.obj `if test -f 'print_group_req.c'; then $(CYGPATH_W) 'print_group_req.c'; else $(CYGPATH_W) '$(srcdir)/print_group_req.c'; fi` + +strace-print_ifindex.o: print_ifindex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_ifindex.o -MD -MP -MF $(DEPDIR)/strace-print_ifindex.Tpo -c -o strace-print_ifindex.o `test -f 'print_ifindex.c' || echo '$(srcdir)/'`print_ifindex.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_ifindex.Tpo $(DEPDIR)/strace-print_ifindex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_ifindex.c' object='strace-print_ifindex.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_ifindex.o `test -f 'print_ifindex.c' || echo '$(srcdir)/'`print_ifindex.c + +strace-print_ifindex.obj: print_ifindex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_ifindex.obj -MD -MP -MF $(DEPDIR)/strace-print_ifindex.Tpo -c -o strace-print_ifindex.obj `if test -f 'print_ifindex.c'; then $(CYGPATH_W) 'print_ifindex.c'; else $(CYGPATH_W) '$(srcdir)/print_ifindex.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_ifindex.Tpo $(DEPDIR)/strace-print_ifindex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_ifindex.c' object='strace-print_ifindex.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_ifindex.obj `if test -f 'print_ifindex.c'; then $(CYGPATH_W) 'print_ifindex.c'; else $(CYGPATH_W) '$(srcdir)/print_ifindex.c'; fi` + +strace-print_instruction_pointer.o: print_instruction_pointer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_instruction_pointer.o -MD -MP -MF $(DEPDIR)/strace-print_instruction_pointer.Tpo -c -o strace-print_instruction_pointer.o `test -f 'print_instruction_pointer.c' || echo '$(srcdir)/'`print_instruction_pointer.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_instruction_pointer.Tpo $(DEPDIR)/strace-print_instruction_pointer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_instruction_pointer.c' object='strace-print_instruction_pointer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_instruction_pointer.o `test -f 'print_instruction_pointer.c' || echo '$(srcdir)/'`print_instruction_pointer.c + +strace-print_instruction_pointer.obj: print_instruction_pointer.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_instruction_pointer.obj -MD -MP -MF $(DEPDIR)/strace-print_instruction_pointer.Tpo -c -o strace-print_instruction_pointer.obj `if test -f 'print_instruction_pointer.c'; then $(CYGPATH_W) 'print_instruction_pointer.c'; else $(CYGPATH_W) '$(srcdir)/print_instruction_pointer.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_instruction_pointer.Tpo $(DEPDIR)/strace-print_instruction_pointer.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_instruction_pointer.c' object='strace-print_instruction_pointer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_instruction_pointer.obj `if test -f 'print_instruction_pointer.c'; then $(CYGPATH_W) 'print_instruction_pointer.c'; else $(CYGPATH_W) '$(srcdir)/print_instruction_pointer.c'; fi` + +strace-print_kernel_version.o: print_kernel_version.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_kernel_version.o -MD -MP -MF $(DEPDIR)/strace-print_kernel_version.Tpo -c -o strace-print_kernel_version.o `test -f 'print_kernel_version.c' || echo '$(srcdir)/'`print_kernel_version.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_kernel_version.Tpo $(DEPDIR)/strace-print_kernel_version.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_kernel_version.c' object='strace-print_kernel_version.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_kernel_version.o `test -f 'print_kernel_version.c' || echo '$(srcdir)/'`print_kernel_version.c + +strace-print_kernel_version.obj: print_kernel_version.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_kernel_version.obj -MD -MP -MF $(DEPDIR)/strace-print_kernel_version.Tpo -c -o strace-print_kernel_version.obj `if test -f 'print_kernel_version.c'; then $(CYGPATH_W) 'print_kernel_version.c'; else $(CYGPATH_W) '$(srcdir)/print_kernel_version.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_kernel_version.Tpo $(DEPDIR)/strace-print_kernel_version.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_kernel_version.c' object='strace-print_kernel_version.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_kernel_version.obj `if test -f 'print_kernel_version.c'; then $(CYGPATH_W) 'print_kernel_version.c'; else $(CYGPATH_W) '$(srcdir)/print_kernel_version.c'; fi` + +strace-print_mac.o: print_mac.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_mac.o -MD -MP -MF $(DEPDIR)/strace-print_mac.Tpo -c -o strace-print_mac.o `test -f 'print_mac.c' || echo '$(srcdir)/'`print_mac.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_mac.Tpo $(DEPDIR)/strace-print_mac.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_mac.c' object='strace-print_mac.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_mac.o `test -f 'print_mac.c' || echo '$(srcdir)/'`print_mac.c + +strace-print_mac.obj: print_mac.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_mac.obj -MD -MP -MF $(DEPDIR)/strace-print_mac.Tpo -c -o strace-print_mac.obj `if test -f 'print_mac.c'; then $(CYGPATH_W) 'print_mac.c'; else $(CYGPATH_W) '$(srcdir)/print_mac.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_mac.Tpo $(DEPDIR)/strace-print_mac.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_mac.c' object='strace-print_mac.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_mac.obj `if test -f 'print_mac.c'; then $(CYGPATH_W) 'print_mac.c'; else $(CYGPATH_W) '$(srcdir)/print_mac.c'; fi` + strace-print_mq_attr.o: print_mq_attr.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_mq_attr.o -MD -MP -MF $(DEPDIR)/strace-print_mq_attr.Tpo -c -o strace-print_mq_attr.o `test -f 'print_mq_attr.c' || echo '$(srcdir)/'`print_mq_attr.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_mq_attr.Tpo $(DEPDIR)/strace-print_mq_attr.Po @@ -4460,6 +5970,34 @@ strace-print_timespec.obj: print_timespec.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_timespec.obj `if test -f 'print_timespec.c'; then $(CYGPATH_W) 'print_timespec.c'; else $(CYGPATH_W) '$(srcdir)/print_timespec.c'; fi` +strace-print_timespec32.o: print_timespec32.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_timespec32.o -MD -MP -MF $(DEPDIR)/strace-print_timespec32.Tpo -c -o strace-print_timespec32.o `test -f 'print_timespec32.c' || echo '$(srcdir)/'`print_timespec32.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_timespec32.Tpo $(DEPDIR)/strace-print_timespec32.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timespec32.c' object='strace-print_timespec32.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_timespec32.o `test -f 'print_timespec32.c' || echo '$(srcdir)/'`print_timespec32.c + +strace-print_timespec32.obj: print_timespec32.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_timespec32.obj -MD -MP -MF $(DEPDIR)/strace-print_timespec32.Tpo -c -o strace-print_timespec32.obj `if test -f 'print_timespec32.c'; then $(CYGPATH_W) 'print_timespec32.c'; else $(CYGPATH_W) '$(srcdir)/print_timespec32.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_timespec32.Tpo $(DEPDIR)/strace-print_timespec32.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timespec32.c' object='strace-print_timespec32.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_timespec32.obj `if test -f 'print_timespec32.c'; then $(CYGPATH_W) 'print_timespec32.c'; else $(CYGPATH_W) '$(srcdir)/print_timespec32.c'; fi` + +strace-print_timespec64.o: print_timespec64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_timespec64.o -MD -MP -MF $(DEPDIR)/strace-print_timespec64.Tpo -c -o strace-print_timespec64.o `test -f 'print_timespec64.c' || echo '$(srcdir)/'`print_timespec64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_timespec64.Tpo $(DEPDIR)/strace-print_timespec64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timespec64.c' object='strace-print_timespec64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_timespec64.o `test -f 'print_timespec64.c' || echo '$(srcdir)/'`print_timespec64.c + +strace-print_timespec64.obj: print_timespec64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_timespec64.obj -MD -MP -MF $(DEPDIR)/strace-print_timespec64.Tpo -c -o strace-print_timespec64.obj `if test -f 'print_timespec64.c'; then $(CYGPATH_W) 'print_timespec64.c'; else $(CYGPATH_W) '$(srcdir)/print_timespec64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_timespec64.Tpo $(DEPDIR)/strace-print_timespec64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timespec64.c' object='strace-print_timespec64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_timespec64.obj `if test -f 'print_timespec64.c'; then $(CYGPATH_W) 'print_timespec64.c'; else $(CYGPATH_W) '$(srcdir)/print_timespec64.c'; fi` + strace-print_timeval.o: print_timeval.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_timeval.o -MD -MP -MF $(DEPDIR)/strace-print_timeval.Tpo -c -o strace-print_timeval.o `test -f 'print_timeval.c' || echo '$(srcdir)/'`print_timeval.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_timeval.Tpo $(DEPDIR)/strace-print_timeval.Po @@ -4474,6 +6012,20 @@ strace-print_timeval.obj: print_timeval.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_timeval.obj `if test -f 'print_timeval.c'; then $(CYGPATH_W) 'print_timeval.c'; else $(CYGPATH_W) '$(srcdir)/print_timeval.c'; fi` +strace-print_timeval64.o: print_timeval64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_timeval64.o -MD -MP -MF $(DEPDIR)/strace-print_timeval64.Tpo -c -o strace-print_timeval64.o `test -f 'print_timeval64.c' || echo '$(srcdir)/'`print_timeval64.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_timeval64.Tpo $(DEPDIR)/strace-print_timeval64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timeval64.c' object='strace-print_timeval64.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_timeval64.o `test -f 'print_timeval64.c' || echo '$(srcdir)/'`print_timeval64.c + +strace-print_timeval64.obj: print_timeval64.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_timeval64.obj -MD -MP -MF $(DEPDIR)/strace-print_timeval64.Tpo -c -o strace-print_timeval64.obj `if test -f 'print_timeval64.c'; then $(CYGPATH_W) 'print_timeval64.c'; else $(CYGPATH_W) '$(srcdir)/print_timeval64.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_timeval64.Tpo $(DEPDIR)/strace-print_timeval64.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_timeval64.c' object='strace-print_timeval64.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-print_timeval64.obj `if test -f 'print_timeval64.c'; then $(CYGPATH_W) 'print_timeval64.c'; else $(CYGPATH_W) '$(srcdir)/print_timeval64.c'; fi` + strace-print_timex.o: print_timex.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-print_timex.o -MD -MP -MF $(DEPDIR)/strace-print_timex.Tpo -c -o strace-print_timex.o `test -f 'print_timex.c' || echo '$(srcdir)/'`print_timex.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-print_timex.Tpo $(DEPDIR)/strace-print_timex.Po @@ -4572,19 +6124,19 @@ strace-ptp.obj: ptp.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ptp.obj `if test -f 'ptp.c'; then $(CYGPATH_W) 'ptp.c'; else $(CYGPATH_W) '$(srcdir)/ptp.c'; fi` -strace-qualify.o: qualify.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-qualify.o -MD -MP -MF $(DEPDIR)/strace-qualify.Tpo -c -o strace-qualify.o `test -f 'qualify.c' || echo '$(srcdir)/'`qualify.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-qualify.Tpo $(DEPDIR)/strace-qualify.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qualify.c' object='strace-qualify.o' libtool=no @AMDEPBACKSLASH@ +strace-ptrace_syscall_info.o: ptrace_syscall_info.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ptrace_syscall_info.o -MD -MP -MF $(DEPDIR)/strace-ptrace_syscall_info.Tpo -c -o strace-ptrace_syscall_info.o `test -f 'ptrace_syscall_info.c' || echo '$(srcdir)/'`ptrace_syscall_info.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ptrace_syscall_info.Tpo $(DEPDIR)/strace-ptrace_syscall_info.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ptrace_syscall_info.c' object='strace-ptrace_syscall_info.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-qualify.o `test -f 'qualify.c' || echo '$(srcdir)/'`qualify.c +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ptrace_syscall_info.o `test -f 'ptrace_syscall_info.c' || echo '$(srcdir)/'`ptrace_syscall_info.c -strace-qualify.obj: qualify.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-qualify.obj -MD -MP -MF $(DEPDIR)/strace-qualify.Tpo -c -o strace-qualify.obj `if test -f 'qualify.c'; then $(CYGPATH_W) 'qualify.c'; else $(CYGPATH_W) '$(srcdir)/qualify.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-qualify.Tpo $(DEPDIR)/strace-qualify.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='qualify.c' object='strace-qualify.obj' libtool=no @AMDEPBACKSLASH@ +strace-ptrace_syscall_info.obj: ptrace_syscall_info.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ptrace_syscall_info.obj -MD -MP -MF $(DEPDIR)/strace-ptrace_syscall_info.Tpo -c -o strace-ptrace_syscall_info.obj `if test -f 'ptrace_syscall_info.c'; then $(CYGPATH_W) 'ptrace_syscall_info.c'; else $(CYGPATH_W) '$(srcdir)/ptrace_syscall_info.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ptrace_syscall_info.Tpo $(DEPDIR)/strace-ptrace_syscall_info.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ptrace_syscall_info.c' object='strace-ptrace_syscall_info.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-qualify.obj `if test -f 'qualify.c'; then $(CYGPATH_W) 'qualify.c'; else $(CYGPATH_W) '$(srcdir)/qualify.c'; fi` +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ptrace_syscall_info.obj `if test -f 'ptrace_syscall_info.c'; then $(CYGPATH_W) 'ptrace_syscall_info.c'; else $(CYGPATH_W) '$(srcdir)/ptrace_syscall_info.c'; fi` strace-quota.o: quota.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-quota.o -MD -MP -MF $(DEPDIR)/strace-quota.Tpo -c -o strace-quota.o `test -f 'quota.c' || echo '$(srcdir)/'`quota.c @@ -4600,6 +6152,20 @@ strace-quota.obj: quota.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-quota.obj `if test -f 'quota.c'; then $(CYGPATH_W) 'quota.c'; else $(CYGPATH_W) '$(srcdir)/quota.c'; fi` +strace-random_ioctl.o: random_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-random_ioctl.o -MD -MP -MF $(DEPDIR)/strace-random_ioctl.Tpo -c -o strace-random_ioctl.o `test -f 'random_ioctl.c' || echo '$(srcdir)/'`random_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-random_ioctl.Tpo $(DEPDIR)/strace-random_ioctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='random_ioctl.c' object='strace-random_ioctl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-random_ioctl.o `test -f 'random_ioctl.c' || echo '$(srcdir)/'`random_ioctl.c + +strace-random_ioctl.obj: random_ioctl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-random_ioctl.obj -MD -MP -MF $(DEPDIR)/strace-random_ioctl.Tpo -c -o strace-random_ioctl.obj `if test -f 'random_ioctl.c'; then $(CYGPATH_W) 'random_ioctl.c'; else $(CYGPATH_W) '$(srcdir)/random_ioctl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-random_ioctl.Tpo $(DEPDIR)/strace-random_ioctl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='random_ioctl.c' object='strace-random_ioctl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-random_ioctl.obj `if test -f 'random_ioctl.c'; then $(CYGPATH_W) 'random_ioctl.c'; else $(CYGPATH_W) '$(srcdir)/random_ioctl.c'; fi` + strace-readahead.o: readahead.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-readahead.o -MD -MP -MF $(DEPDIR)/strace-readahead.Tpo -c -o strace-readahead.o `test -f 'readahead.c' || echo '$(srcdir)/'`readahead.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-readahead.Tpo $(DEPDIR)/strace-readahead.Po @@ -4670,6 +6236,62 @@ strace-resource.obj: resource.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-resource.obj `if test -f 'resource.c'; then $(CYGPATH_W) 'resource.c'; else $(CYGPATH_W) '$(srcdir)/resource.c'; fi` +strace-retval.o: retval.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-retval.o -MD -MP -MF $(DEPDIR)/strace-retval.Tpo -c -o strace-retval.o `test -f 'retval.c' || echo '$(srcdir)/'`retval.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-retval.Tpo $(DEPDIR)/strace-retval.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='retval.c' object='strace-retval.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-retval.o `test -f 'retval.c' || echo '$(srcdir)/'`retval.c + +strace-retval.obj: retval.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-retval.obj -MD -MP -MF $(DEPDIR)/strace-retval.Tpo -c -o strace-retval.obj `if test -f 'retval.c'; then $(CYGPATH_W) 'retval.c'; else $(CYGPATH_W) '$(srcdir)/retval.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-retval.Tpo $(DEPDIR)/strace-retval.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='retval.c' object='strace-retval.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-retval.obj `if test -f 'retval.c'; then $(CYGPATH_W) 'retval.c'; else $(CYGPATH_W) '$(srcdir)/retval.c'; fi` + +strace-riscv.o: riscv.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-riscv.o -MD -MP -MF $(DEPDIR)/strace-riscv.Tpo -c -o strace-riscv.o `test -f 'riscv.c' || echo '$(srcdir)/'`riscv.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-riscv.Tpo $(DEPDIR)/strace-riscv.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='riscv.c' object='strace-riscv.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-riscv.o `test -f 'riscv.c' || echo '$(srcdir)/'`riscv.c + +strace-riscv.obj: riscv.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-riscv.obj -MD -MP -MF $(DEPDIR)/strace-riscv.Tpo -c -o strace-riscv.obj `if test -f 'riscv.c'; then $(CYGPATH_W) 'riscv.c'; else $(CYGPATH_W) '$(srcdir)/riscv.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-riscv.Tpo $(DEPDIR)/strace-riscv.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='riscv.c' object='strace-riscv.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-riscv.obj `if test -f 'riscv.c'; then $(CYGPATH_W) 'riscv.c'; else $(CYGPATH_W) '$(srcdir)/riscv.c'; fi` + +strace-rt_sigframe.o: rt_sigframe.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rt_sigframe.o -MD -MP -MF $(DEPDIR)/strace-rt_sigframe.Tpo -c -o strace-rt_sigframe.o `test -f 'rt_sigframe.c' || echo '$(srcdir)/'`rt_sigframe.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rt_sigframe.Tpo $(DEPDIR)/strace-rt_sigframe.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rt_sigframe.c' object='strace-rt_sigframe.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rt_sigframe.o `test -f 'rt_sigframe.c' || echo '$(srcdir)/'`rt_sigframe.c + +strace-rt_sigframe.obj: rt_sigframe.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rt_sigframe.obj -MD -MP -MF $(DEPDIR)/strace-rt_sigframe.Tpo -c -o strace-rt_sigframe.obj `if test -f 'rt_sigframe.c'; then $(CYGPATH_W) 'rt_sigframe.c'; else $(CYGPATH_W) '$(srcdir)/rt_sigframe.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rt_sigframe.Tpo $(DEPDIR)/strace-rt_sigframe.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rt_sigframe.c' object='strace-rt_sigframe.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rt_sigframe.obj `if test -f 'rt_sigframe.c'; then $(CYGPATH_W) 'rt_sigframe.c'; else $(CYGPATH_W) '$(srcdir)/rt_sigframe.c'; fi` + +strace-rt_sigreturn.o: rt_sigreturn.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rt_sigreturn.o -MD -MP -MF $(DEPDIR)/strace-rt_sigreturn.Tpo -c -o strace-rt_sigreturn.o `test -f 'rt_sigreturn.c' || echo '$(srcdir)/'`rt_sigreturn.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rt_sigreturn.Tpo $(DEPDIR)/strace-rt_sigreturn.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rt_sigreturn.c' object='strace-rt_sigreturn.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rt_sigreturn.o `test -f 'rt_sigreturn.c' || echo '$(srcdir)/'`rt_sigreturn.c + +strace-rt_sigreturn.obj: rt_sigreturn.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rt_sigreturn.obj -MD -MP -MF $(DEPDIR)/strace-rt_sigreturn.Tpo -c -o strace-rt_sigreturn.obj `if test -f 'rt_sigreturn.c'; then $(CYGPATH_W) 'rt_sigreturn.c'; else $(CYGPATH_W) '$(srcdir)/rt_sigreturn.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rt_sigreturn.Tpo $(DEPDIR)/strace-rt_sigreturn.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rt_sigreturn.c' object='strace-rt_sigreturn.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rt_sigreturn.obj `if test -f 'rt_sigreturn.c'; then $(CYGPATH_W) 'rt_sigreturn.c'; else $(CYGPATH_W) '$(srcdir)/rt_sigreturn.c'; fi` + strace-rtc.o: rtc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtc.o -MD -MP -MF $(DEPDIR)/strace-rtc.Tpo -c -o strace-rtc.o `test -f 'rtc.c' || echo '$(srcdir)/'`rtc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtc.Tpo $(DEPDIR)/strace-rtc.Po @@ -4684,6 +6306,202 @@ strace-rtc.obj: rtc.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtc.obj `if test -f 'rtc.c'; then $(CYGPATH_W) 'rtc.c'; else $(CYGPATH_W) '$(srcdir)/rtc.c'; fi` +strace-rtnl_addr.o: rtnl_addr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_addr.o -MD -MP -MF $(DEPDIR)/strace-rtnl_addr.Tpo -c -o strace-rtnl_addr.o `test -f 'rtnl_addr.c' || echo '$(srcdir)/'`rtnl_addr.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_addr.Tpo $(DEPDIR)/strace-rtnl_addr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_addr.c' object='strace-rtnl_addr.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_addr.o `test -f 'rtnl_addr.c' || echo '$(srcdir)/'`rtnl_addr.c + +strace-rtnl_addr.obj: rtnl_addr.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_addr.obj -MD -MP -MF $(DEPDIR)/strace-rtnl_addr.Tpo -c -o strace-rtnl_addr.obj `if test -f 'rtnl_addr.c'; then $(CYGPATH_W) 'rtnl_addr.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_addr.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_addr.Tpo $(DEPDIR)/strace-rtnl_addr.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_addr.c' object='strace-rtnl_addr.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_addr.obj `if test -f 'rtnl_addr.c'; then $(CYGPATH_W) 'rtnl_addr.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_addr.c'; fi` + +strace-rtnl_addrlabel.o: rtnl_addrlabel.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_addrlabel.o -MD -MP -MF $(DEPDIR)/strace-rtnl_addrlabel.Tpo -c -o strace-rtnl_addrlabel.o `test -f 'rtnl_addrlabel.c' || echo '$(srcdir)/'`rtnl_addrlabel.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_addrlabel.Tpo $(DEPDIR)/strace-rtnl_addrlabel.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_addrlabel.c' object='strace-rtnl_addrlabel.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_addrlabel.o `test -f 'rtnl_addrlabel.c' || echo '$(srcdir)/'`rtnl_addrlabel.c + +strace-rtnl_addrlabel.obj: rtnl_addrlabel.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_addrlabel.obj -MD -MP -MF $(DEPDIR)/strace-rtnl_addrlabel.Tpo -c -o strace-rtnl_addrlabel.obj `if test -f 'rtnl_addrlabel.c'; then $(CYGPATH_W) 'rtnl_addrlabel.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_addrlabel.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_addrlabel.Tpo $(DEPDIR)/strace-rtnl_addrlabel.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_addrlabel.c' object='strace-rtnl_addrlabel.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_addrlabel.obj `if test -f 'rtnl_addrlabel.c'; then $(CYGPATH_W) 'rtnl_addrlabel.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_addrlabel.c'; fi` + +strace-rtnl_dcb.o: rtnl_dcb.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_dcb.o -MD -MP -MF $(DEPDIR)/strace-rtnl_dcb.Tpo -c -o strace-rtnl_dcb.o `test -f 'rtnl_dcb.c' || echo '$(srcdir)/'`rtnl_dcb.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_dcb.Tpo $(DEPDIR)/strace-rtnl_dcb.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_dcb.c' object='strace-rtnl_dcb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_dcb.o `test -f 'rtnl_dcb.c' || echo '$(srcdir)/'`rtnl_dcb.c + +strace-rtnl_dcb.obj: rtnl_dcb.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_dcb.obj -MD -MP -MF $(DEPDIR)/strace-rtnl_dcb.Tpo -c -o strace-rtnl_dcb.obj `if test -f 'rtnl_dcb.c'; then $(CYGPATH_W) 'rtnl_dcb.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_dcb.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_dcb.Tpo $(DEPDIR)/strace-rtnl_dcb.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_dcb.c' object='strace-rtnl_dcb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_dcb.obj `if test -f 'rtnl_dcb.c'; then $(CYGPATH_W) 'rtnl_dcb.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_dcb.c'; fi` + +strace-rtnl_link.o: rtnl_link.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_link.o -MD -MP -MF $(DEPDIR)/strace-rtnl_link.Tpo -c -o strace-rtnl_link.o `test -f 'rtnl_link.c' || echo '$(srcdir)/'`rtnl_link.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_link.Tpo $(DEPDIR)/strace-rtnl_link.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_link.c' object='strace-rtnl_link.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_link.o `test -f 'rtnl_link.c' || echo '$(srcdir)/'`rtnl_link.c + +strace-rtnl_link.obj: rtnl_link.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_link.obj -MD -MP -MF $(DEPDIR)/strace-rtnl_link.Tpo -c -o strace-rtnl_link.obj `if test -f 'rtnl_link.c'; then $(CYGPATH_W) 'rtnl_link.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_link.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_link.Tpo $(DEPDIR)/strace-rtnl_link.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_link.c' object='strace-rtnl_link.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_link.obj `if test -f 'rtnl_link.c'; then $(CYGPATH_W) 'rtnl_link.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_link.c'; fi` + +strace-rtnl_mdb.o: rtnl_mdb.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_mdb.o -MD -MP -MF $(DEPDIR)/strace-rtnl_mdb.Tpo -c -o strace-rtnl_mdb.o `test -f 'rtnl_mdb.c' || echo '$(srcdir)/'`rtnl_mdb.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_mdb.Tpo $(DEPDIR)/strace-rtnl_mdb.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_mdb.c' object='strace-rtnl_mdb.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_mdb.o `test -f 'rtnl_mdb.c' || echo '$(srcdir)/'`rtnl_mdb.c + +strace-rtnl_mdb.obj: rtnl_mdb.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_mdb.obj -MD -MP -MF $(DEPDIR)/strace-rtnl_mdb.Tpo -c -o strace-rtnl_mdb.obj `if test -f 'rtnl_mdb.c'; then $(CYGPATH_W) 'rtnl_mdb.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_mdb.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_mdb.Tpo $(DEPDIR)/strace-rtnl_mdb.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_mdb.c' object='strace-rtnl_mdb.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_mdb.obj `if test -f 'rtnl_mdb.c'; then $(CYGPATH_W) 'rtnl_mdb.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_mdb.c'; fi` + +strace-rtnl_neigh.o: rtnl_neigh.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_neigh.o -MD -MP -MF $(DEPDIR)/strace-rtnl_neigh.Tpo -c -o strace-rtnl_neigh.o `test -f 'rtnl_neigh.c' || echo '$(srcdir)/'`rtnl_neigh.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_neigh.Tpo $(DEPDIR)/strace-rtnl_neigh.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_neigh.c' object='strace-rtnl_neigh.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_neigh.o `test -f 'rtnl_neigh.c' || echo '$(srcdir)/'`rtnl_neigh.c + +strace-rtnl_neigh.obj: rtnl_neigh.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_neigh.obj -MD -MP -MF $(DEPDIR)/strace-rtnl_neigh.Tpo -c -o strace-rtnl_neigh.obj `if test -f 'rtnl_neigh.c'; then $(CYGPATH_W) 'rtnl_neigh.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_neigh.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_neigh.Tpo $(DEPDIR)/strace-rtnl_neigh.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_neigh.c' object='strace-rtnl_neigh.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_neigh.obj `if test -f 'rtnl_neigh.c'; then $(CYGPATH_W) 'rtnl_neigh.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_neigh.c'; fi` + +strace-rtnl_neightbl.o: rtnl_neightbl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_neightbl.o -MD -MP -MF $(DEPDIR)/strace-rtnl_neightbl.Tpo -c -o strace-rtnl_neightbl.o `test -f 'rtnl_neightbl.c' || echo '$(srcdir)/'`rtnl_neightbl.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_neightbl.Tpo $(DEPDIR)/strace-rtnl_neightbl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_neightbl.c' object='strace-rtnl_neightbl.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_neightbl.o `test -f 'rtnl_neightbl.c' || echo '$(srcdir)/'`rtnl_neightbl.c + +strace-rtnl_neightbl.obj: rtnl_neightbl.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_neightbl.obj -MD -MP -MF $(DEPDIR)/strace-rtnl_neightbl.Tpo -c -o strace-rtnl_neightbl.obj `if test -f 'rtnl_neightbl.c'; then $(CYGPATH_W) 'rtnl_neightbl.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_neightbl.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_neightbl.Tpo $(DEPDIR)/strace-rtnl_neightbl.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_neightbl.c' object='strace-rtnl_neightbl.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_neightbl.obj `if test -f 'rtnl_neightbl.c'; then $(CYGPATH_W) 'rtnl_neightbl.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_neightbl.c'; fi` + +strace-rtnl_netconf.o: rtnl_netconf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_netconf.o -MD -MP -MF $(DEPDIR)/strace-rtnl_netconf.Tpo -c -o strace-rtnl_netconf.o `test -f 'rtnl_netconf.c' || echo '$(srcdir)/'`rtnl_netconf.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_netconf.Tpo $(DEPDIR)/strace-rtnl_netconf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_netconf.c' object='strace-rtnl_netconf.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_netconf.o `test -f 'rtnl_netconf.c' || echo '$(srcdir)/'`rtnl_netconf.c + +strace-rtnl_netconf.obj: rtnl_netconf.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_netconf.obj -MD -MP -MF $(DEPDIR)/strace-rtnl_netconf.Tpo -c -o strace-rtnl_netconf.obj `if test -f 'rtnl_netconf.c'; then $(CYGPATH_W) 'rtnl_netconf.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_netconf.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_netconf.Tpo $(DEPDIR)/strace-rtnl_netconf.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_netconf.c' object='strace-rtnl_netconf.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_netconf.obj `if test -f 'rtnl_netconf.c'; then $(CYGPATH_W) 'rtnl_netconf.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_netconf.c'; fi` + +strace-rtnl_nsid.o: rtnl_nsid.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_nsid.o -MD -MP -MF $(DEPDIR)/strace-rtnl_nsid.Tpo -c -o strace-rtnl_nsid.o `test -f 'rtnl_nsid.c' || echo '$(srcdir)/'`rtnl_nsid.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_nsid.Tpo $(DEPDIR)/strace-rtnl_nsid.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_nsid.c' object='strace-rtnl_nsid.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_nsid.o `test -f 'rtnl_nsid.c' || echo '$(srcdir)/'`rtnl_nsid.c + +strace-rtnl_nsid.obj: rtnl_nsid.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_nsid.obj -MD -MP -MF $(DEPDIR)/strace-rtnl_nsid.Tpo -c -o strace-rtnl_nsid.obj `if test -f 'rtnl_nsid.c'; then $(CYGPATH_W) 'rtnl_nsid.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_nsid.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_nsid.Tpo $(DEPDIR)/strace-rtnl_nsid.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_nsid.c' object='strace-rtnl_nsid.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_nsid.obj `if test -f 'rtnl_nsid.c'; then $(CYGPATH_W) 'rtnl_nsid.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_nsid.c'; fi` + +strace-rtnl_route.o: rtnl_route.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_route.o -MD -MP -MF $(DEPDIR)/strace-rtnl_route.Tpo -c -o strace-rtnl_route.o `test -f 'rtnl_route.c' || echo '$(srcdir)/'`rtnl_route.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_route.Tpo $(DEPDIR)/strace-rtnl_route.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_route.c' object='strace-rtnl_route.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_route.o `test -f 'rtnl_route.c' || echo '$(srcdir)/'`rtnl_route.c + +strace-rtnl_route.obj: rtnl_route.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_route.obj -MD -MP -MF $(DEPDIR)/strace-rtnl_route.Tpo -c -o strace-rtnl_route.obj `if test -f 'rtnl_route.c'; then $(CYGPATH_W) 'rtnl_route.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_route.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_route.Tpo $(DEPDIR)/strace-rtnl_route.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_route.c' object='strace-rtnl_route.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_route.obj `if test -f 'rtnl_route.c'; then $(CYGPATH_W) 'rtnl_route.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_route.c'; fi` + +strace-rtnl_rule.o: rtnl_rule.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_rule.o -MD -MP -MF $(DEPDIR)/strace-rtnl_rule.Tpo -c -o strace-rtnl_rule.o `test -f 'rtnl_rule.c' || echo '$(srcdir)/'`rtnl_rule.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_rule.Tpo $(DEPDIR)/strace-rtnl_rule.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_rule.c' object='strace-rtnl_rule.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_rule.o `test -f 'rtnl_rule.c' || echo '$(srcdir)/'`rtnl_rule.c + +strace-rtnl_rule.obj: rtnl_rule.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_rule.obj -MD -MP -MF $(DEPDIR)/strace-rtnl_rule.Tpo -c -o strace-rtnl_rule.obj `if test -f 'rtnl_rule.c'; then $(CYGPATH_W) 'rtnl_rule.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_rule.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_rule.Tpo $(DEPDIR)/strace-rtnl_rule.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_rule.c' object='strace-rtnl_rule.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_rule.obj `if test -f 'rtnl_rule.c'; then $(CYGPATH_W) 'rtnl_rule.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_rule.c'; fi` + +strace-rtnl_tc.o: rtnl_tc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_tc.o -MD -MP -MF $(DEPDIR)/strace-rtnl_tc.Tpo -c -o strace-rtnl_tc.o `test -f 'rtnl_tc.c' || echo '$(srcdir)/'`rtnl_tc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_tc.Tpo $(DEPDIR)/strace-rtnl_tc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_tc.c' object='strace-rtnl_tc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_tc.o `test -f 'rtnl_tc.c' || echo '$(srcdir)/'`rtnl_tc.c + +strace-rtnl_tc.obj: rtnl_tc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_tc.obj -MD -MP -MF $(DEPDIR)/strace-rtnl_tc.Tpo -c -o strace-rtnl_tc.obj `if test -f 'rtnl_tc.c'; then $(CYGPATH_W) 'rtnl_tc.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_tc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_tc.Tpo $(DEPDIR)/strace-rtnl_tc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_tc.c' object='strace-rtnl_tc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_tc.obj `if test -f 'rtnl_tc.c'; then $(CYGPATH_W) 'rtnl_tc.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_tc.c'; fi` + +strace-rtnl_tc_action.o: rtnl_tc_action.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_tc_action.o -MD -MP -MF $(DEPDIR)/strace-rtnl_tc_action.Tpo -c -o strace-rtnl_tc_action.o `test -f 'rtnl_tc_action.c' || echo '$(srcdir)/'`rtnl_tc_action.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_tc_action.Tpo $(DEPDIR)/strace-rtnl_tc_action.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_tc_action.c' object='strace-rtnl_tc_action.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_tc_action.o `test -f 'rtnl_tc_action.c' || echo '$(srcdir)/'`rtnl_tc_action.c + +strace-rtnl_tc_action.obj: rtnl_tc_action.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rtnl_tc_action.obj -MD -MP -MF $(DEPDIR)/strace-rtnl_tc_action.Tpo -c -o strace-rtnl_tc_action.obj `if test -f 'rtnl_tc_action.c'; then $(CYGPATH_W) 'rtnl_tc_action.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_tc_action.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-rtnl_tc_action.Tpo $(DEPDIR)/strace-rtnl_tc_action.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='rtnl_tc_action.c' object='strace-rtnl_tc_action.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_tc_action.obj `if test -f 'rtnl_tc_action.c'; then $(CYGPATH_W) 'rtnl_tc_action.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_tc_action.c'; fi` + +strace-s390.o: s390.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-s390.o -MD -MP -MF $(DEPDIR)/strace-s390.Tpo -c -o strace-s390.o `test -f 's390.c' || echo '$(srcdir)/'`s390.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-s390.Tpo $(DEPDIR)/strace-s390.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='s390.c' object='strace-s390.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-s390.o `test -f 's390.c' || echo '$(srcdir)/'`s390.c + +strace-s390.obj: s390.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-s390.obj -MD -MP -MF $(DEPDIR)/strace-s390.Tpo -c -o strace-s390.obj `if test -f 's390.c'; then $(CYGPATH_W) 's390.c'; else $(CYGPATH_W) '$(srcdir)/s390.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-s390.Tpo $(DEPDIR)/strace-s390.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='s390.c' object='strace-s390.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-s390.obj `if test -f 's390.c'; then $(CYGPATH_W) 's390.c'; else $(CYGPATH_W) '$(srcdir)/s390.c'; fi` + strace-sched.o: sched.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sched.o -MD -MP -MF $(DEPDIR)/strace-sched.Tpo -c -o strace-sched.o `test -f 'sched.c' || echo '$(srcdir)/'`sched.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sched.Tpo $(DEPDIR)/strace-sched.Po @@ -4768,6 +6586,20 @@ strace-sg_io_v4.obj: sg_io_v4.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sg_io_v4.obj `if test -f 'sg_io_v4.c'; then $(CYGPATH_W) 'sg_io_v4.c'; else $(CYGPATH_W) '$(srcdir)/sg_io_v4.c'; fi` +strace-shutdown.o: shutdown.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-shutdown.o -MD -MP -MF $(DEPDIR)/strace-shutdown.Tpo -c -o strace-shutdown.o `test -f 'shutdown.c' || echo '$(srcdir)/'`shutdown.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-shutdown.Tpo $(DEPDIR)/strace-shutdown.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shutdown.c' object='strace-shutdown.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-shutdown.o `test -f 'shutdown.c' || echo '$(srcdir)/'`shutdown.c + +strace-shutdown.obj: shutdown.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-shutdown.obj -MD -MP -MF $(DEPDIR)/strace-shutdown.Tpo -c -o strace-shutdown.obj `if test -f 'shutdown.c'; then $(CYGPATH_W) 'shutdown.c'; else $(CYGPATH_W) '$(srcdir)/shutdown.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-shutdown.Tpo $(DEPDIR)/strace-shutdown.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='shutdown.c' object='strace-shutdown.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-shutdown.obj `if test -f 'shutdown.c'; then $(CYGPATH_W) 'shutdown.c'; else $(CYGPATH_W) '$(srcdir)/shutdown.c'; fi` + strace-sigaltstack.o: sigaltstack.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sigaltstack.o -MD -MP -MF $(DEPDIR)/strace-sigaltstack.Tpo -c -o strace-sigaltstack.o `test -f 'sigaltstack.c' || echo '$(srcdir)/'`sigaltstack.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sigaltstack.Tpo $(DEPDIR)/strace-sigaltstack.Po @@ -4810,20 +6642,6 @@ strace-signalfd.obj: signalfd.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-signalfd.obj `if test -f 'signalfd.c'; then $(CYGPATH_W) 'signalfd.c'; else $(CYGPATH_W) '$(srcdir)/signalfd.c'; fi` -strace-sigreturn.o: sigreturn.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sigreturn.o -MD -MP -MF $(DEPDIR)/strace-sigreturn.Tpo -c -o strace-sigreturn.o `test -f 'sigreturn.c' || echo '$(srcdir)/'`sigreturn.c -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sigreturn.Tpo $(DEPDIR)/strace-sigreturn.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sigreturn.c' object='strace-sigreturn.o' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sigreturn.o `test -f 'sigreturn.c' || echo '$(srcdir)/'`sigreturn.c - -strace-sigreturn.obj: sigreturn.c -@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sigreturn.obj -MD -MP -MF $(DEPDIR)/strace-sigreturn.Tpo -c -o strace-sigreturn.obj `if test -f 'sigreturn.c'; then $(CYGPATH_W) 'sigreturn.c'; else $(CYGPATH_W) '$(srcdir)/sigreturn.c'; fi` -@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sigreturn.Tpo $(DEPDIR)/strace-sigreturn.Po -@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sigreturn.c' object='strace-sigreturn.obj' libtool=no @AMDEPBACKSLASH@ -@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ -@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sigreturn.obj `if test -f 'sigreturn.c'; then $(CYGPATH_W) 'sigreturn.c'; else $(CYGPATH_W) '$(srcdir)/sigreturn.c'; fi` - strace-sock.o: sock.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sock.o -MD -MP -MF $(DEPDIR)/strace-sock.Tpo -c -o strace-sock.o `test -f 'sock.c' || echo '$(srcdir)/'`sock.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sock.Tpo $(DEPDIR)/strace-sock.Po @@ -4866,6 +6684,20 @@ strace-socketutils.obj: socketutils.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-socketutils.obj `if test -f 'socketutils.c'; then $(CYGPATH_W) 'socketutils.c'; else $(CYGPATH_W) '$(srcdir)/socketutils.c'; fi` +strace-sparc.o: sparc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sparc.o -MD -MP -MF $(DEPDIR)/strace-sparc.Tpo -c -o strace-sparc.o `test -f 'sparc.c' || echo '$(srcdir)/'`sparc.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sparc.Tpo $(DEPDIR)/strace-sparc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sparc.c' object='strace-sparc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sparc.o `test -f 'sparc.c' || echo '$(srcdir)/'`sparc.c + +strace-sparc.obj: sparc.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sparc.obj -MD -MP -MF $(DEPDIR)/strace-sparc.Tpo -c -o strace-sparc.obj `if test -f 'sparc.c'; then $(CYGPATH_W) 'sparc.c'; else $(CYGPATH_W) '$(srcdir)/sparc.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sparc.Tpo $(DEPDIR)/strace-sparc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='sparc.c' object='strace-sparc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-sparc.obj `if test -f 'sparc.c'; then $(CYGPATH_W) 'sparc.c'; else $(CYGPATH_W) '$(srcdir)/sparc.c'; fi` + strace-sram_alloc.o: sram_alloc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sram_alloc.o -MD -MP -MF $(DEPDIR)/strace-sram_alloc.Tpo -c -o strace-sram_alloc.o `test -f 'sram_alloc.c' || echo '$(srcdir)/'`sram_alloc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-sram_alloc.Tpo $(DEPDIR)/strace-sram_alloc.Po @@ -4922,6 +6754,20 @@ strace-statfs.obj: statfs.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-statfs.obj `if test -f 'statfs.c'; then $(CYGPATH_W) 'statfs.c'; else $(CYGPATH_W) '$(srcdir)/statfs.c'; fi` +strace-statx.o: statx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-statx.o -MD -MP -MF $(DEPDIR)/strace-statx.Tpo -c -o strace-statx.o `test -f 'statx.c' || echo '$(srcdir)/'`statx.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-statx.Tpo $(DEPDIR)/strace-statx.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='statx.c' object='strace-statx.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-statx.o `test -f 'statx.c' || echo '$(srcdir)/'`statx.c + +strace-statx.obj: statx.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-statx.obj -MD -MP -MF $(DEPDIR)/strace-statx.Tpo -c -o strace-statx.obj `if test -f 'statx.c'; then $(CYGPATH_W) 'statx.c'; else $(CYGPATH_W) '$(srcdir)/statx.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-statx.Tpo $(DEPDIR)/strace-statx.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='statx.c' object='strace-statx.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-statx.obj `if test -f 'statx.c'; then $(CYGPATH_W) 'statx.c'; else $(CYGPATH_W) '$(srcdir)/statx.c'; fi` + strace-strace.o: strace.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-strace.o -MD -MP -MF $(DEPDIR)/strace-strace.Tpo -c -o strace-strace.o `test -f 'strace.c' || echo '$(srcdir)/'`strace.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-strace.Tpo $(DEPDIR)/strace-strace.Po @@ -4936,6 +6782,20 @@ strace-strace.obj: strace.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-strace.obj `if test -f 'strace.c'; then $(CYGPATH_W) 'strace.c'; else $(CYGPATH_W) '$(srcdir)/strace.c'; fi` +strace-string_to_uint.o: string_to_uint.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-string_to_uint.o -MD -MP -MF $(DEPDIR)/strace-string_to_uint.Tpo -c -o strace-string_to_uint.o `test -f 'string_to_uint.c' || echo '$(srcdir)/'`string_to_uint.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-string_to_uint.Tpo $(DEPDIR)/strace-string_to_uint.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='string_to_uint.c' object='strace-string_to_uint.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-string_to_uint.o `test -f 'string_to_uint.c' || echo '$(srcdir)/'`string_to_uint.c + +strace-string_to_uint.obj: string_to_uint.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-string_to_uint.obj -MD -MP -MF $(DEPDIR)/strace-string_to_uint.Tpo -c -o strace-string_to_uint.obj `if test -f 'string_to_uint.c'; then $(CYGPATH_W) 'string_to_uint.c'; else $(CYGPATH_W) '$(srcdir)/string_to_uint.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-string_to_uint.Tpo $(DEPDIR)/strace-string_to_uint.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='string_to_uint.c' object='strace-string_to_uint.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-string_to_uint.obj `if test -f 'string_to_uint.c'; then $(CYGPATH_W) 'string_to_uint.c'; else $(CYGPATH_W) '$(srcdir)/string_to_uint.c'; fi` + strace-swapon.o: swapon.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-swapon.o -MD -MP -MF $(DEPDIR)/strace-swapon.Tpo -c -o strace-swapon.o `test -f 'swapon.c' || echo '$(srcdir)/'`swapon.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-swapon.Tpo $(DEPDIR)/strace-swapon.Po @@ -5090,6 +6950,20 @@ strace-ubi.obj: ubi.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ubi.obj `if test -f 'ubi.c'; then $(CYGPATH_W) 'ubi.c'; else $(CYGPATH_W) '$(srcdir)/ubi.c'; fi` +strace-ucopy.o: ucopy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ucopy.o -MD -MP -MF $(DEPDIR)/strace-ucopy.Tpo -c -o strace-ucopy.o `test -f 'ucopy.c' || echo '$(srcdir)/'`ucopy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ucopy.Tpo $(DEPDIR)/strace-ucopy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ucopy.c' object='strace-ucopy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ucopy.o `test -f 'ucopy.c' || echo '$(srcdir)/'`ucopy.c + +strace-ucopy.obj: ucopy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ucopy.obj -MD -MP -MF $(DEPDIR)/strace-ucopy.Tpo -c -o strace-ucopy.obj `if test -f 'ucopy.c'; then $(CYGPATH_W) 'ucopy.c'; else $(CYGPATH_W) '$(srcdir)/ucopy.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-ucopy.Tpo $(DEPDIR)/strace-ucopy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ucopy.c' object='strace-ucopy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-ucopy.obj `if test -f 'ucopy.c'; then $(CYGPATH_W) 'ucopy.c'; else $(CYGPATH_W) '$(srcdir)/ucopy.c'; fi` + strace-uid.o: uid.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-uid.o -MD -MP -MF $(DEPDIR)/strace-uid.Tpo -c -o strace-uid.o `test -f 'uid.c' || echo '$(srcdir)/'`uid.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-uid.Tpo $(DEPDIR)/strace-uid.Po @@ -5272,6 +7146,20 @@ strace-xattr.obj: xattr.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-xattr.obj `if test -f 'xattr.c'; then $(CYGPATH_W) 'xattr.c'; else $(CYGPATH_W) '$(srcdir)/xattr.c'; fi` +strace-xlat.o: xlat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-xlat.o -MD -MP -MF $(DEPDIR)/strace-xlat.Tpo -c -o strace-xlat.o `test -f 'xlat.c' || echo '$(srcdir)/'`xlat.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-xlat.Tpo $(DEPDIR)/strace-xlat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xlat.c' object='strace-xlat.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-xlat.o `test -f 'xlat.c' || echo '$(srcdir)/'`xlat.c + +strace-xlat.obj: xlat.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-xlat.obj -MD -MP -MF $(DEPDIR)/strace-xlat.Tpo -c -o strace-xlat.obj `if test -f 'xlat.c'; then $(CYGPATH_W) 'xlat.c'; else $(CYGPATH_W) '$(srcdir)/xlat.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-xlat.Tpo $(DEPDIR)/strace-xlat.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='xlat.c' object='strace-xlat.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-xlat.obj `if test -f 'xlat.c'; then $(CYGPATH_W) 'xlat.c'; else $(CYGPATH_W) '$(srcdir)/xlat.c'; fi` + strace-xmalloc.o: xmalloc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-xmalloc.o -MD -MP -MF $(DEPDIR)/strace-xmalloc.Tpo -c -o strace-xmalloc.o `test -f 'xmalloc.c' || echo '$(srcdir)/'`xmalloc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-xmalloc.Tpo $(DEPDIR)/strace-xmalloc.Po @@ -5286,6 +7174,20 @@ strace-xmalloc.obj: xmalloc.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-xmalloc.obj `if test -f 'xmalloc.c'; then $(CYGPATH_W) 'xmalloc.c'; else $(CYGPATH_W) '$(srcdir)/xmalloc.c'; fi` +strace-bpf_attr_check.o: bpf_attr_check.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-bpf_attr_check.o -MD -MP -MF $(DEPDIR)/strace-bpf_attr_check.Tpo -c -o strace-bpf_attr_check.o `test -f 'bpf_attr_check.c' || echo '$(srcdir)/'`bpf_attr_check.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-bpf_attr_check.Tpo $(DEPDIR)/strace-bpf_attr_check.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bpf_attr_check.c' object='strace-bpf_attr_check.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-bpf_attr_check.o `test -f 'bpf_attr_check.c' || echo '$(srcdir)/'`bpf_attr_check.c + +strace-bpf_attr_check.obj: bpf_attr_check.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-bpf_attr_check.obj -MD -MP -MF $(DEPDIR)/strace-bpf_attr_check.Tpo -c -o strace-bpf_attr_check.obj `if test -f 'bpf_attr_check.c'; then $(CYGPATH_W) 'bpf_attr_check.c'; else $(CYGPATH_W) '$(srcdir)/bpf_attr_check.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-bpf_attr_check.Tpo $(DEPDIR)/strace-bpf_attr_check.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='bpf_attr_check.c' object='strace-bpf_attr_check.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-bpf_attr_check.obj `if test -f 'bpf_attr_check.c'; then $(CYGPATH_W) 'bpf_attr_check.c'; else $(CYGPATH_W) '$(srcdir)/bpf_attr_check.c'; fi` + strace-unwind.o: unwind.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-unwind.o -MD -MP -MF $(DEPDIR)/strace-unwind.Tpo -c -o strace-unwind.o `test -f 'unwind.c' || echo '$(srcdir)/'`unwind.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-unwind.Tpo $(DEPDIR)/strace-unwind.Po @@ -5299,6 +7201,34 @@ strace-unwind.obj: unwind.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unwind.c' object='strace-unwind.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-unwind.obj `if test -f 'unwind.c'; then $(CYGPATH_W) 'unwind.c'; else $(CYGPATH_W) '$(srcdir)/unwind.c'; fi` + +strace-unwind-libdw.o: unwind-libdw.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-unwind-libdw.o -MD -MP -MF $(DEPDIR)/strace-unwind-libdw.Tpo -c -o strace-unwind-libdw.o `test -f 'unwind-libdw.c' || echo '$(srcdir)/'`unwind-libdw.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-unwind-libdw.Tpo $(DEPDIR)/strace-unwind-libdw.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unwind-libdw.c' object='strace-unwind-libdw.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-unwind-libdw.o `test -f 'unwind-libdw.c' || echo '$(srcdir)/'`unwind-libdw.c + +strace-unwind-libdw.obj: unwind-libdw.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-unwind-libdw.obj -MD -MP -MF $(DEPDIR)/strace-unwind-libdw.Tpo -c -o strace-unwind-libdw.obj `if test -f 'unwind-libdw.c'; then $(CYGPATH_W) 'unwind-libdw.c'; else $(CYGPATH_W) '$(srcdir)/unwind-libdw.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-unwind-libdw.Tpo $(DEPDIR)/strace-unwind-libdw.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unwind-libdw.c' object='strace-unwind-libdw.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-unwind-libdw.obj `if test -f 'unwind-libdw.c'; then $(CYGPATH_W) 'unwind-libdw.c'; else $(CYGPATH_W) '$(srcdir)/unwind-libdw.c'; fi` + +strace-unwind-libunwind.o: unwind-libunwind.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-unwind-libunwind.o -MD -MP -MF $(DEPDIR)/strace-unwind-libunwind.Tpo -c -o strace-unwind-libunwind.o `test -f 'unwind-libunwind.c' || echo '$(srcdir)/'`unwind-libunwind.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-unwind-libunwind.Tpo $(DEPDIR)/strace-unwind-libunwind.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unwind-libunwind.c' object='strace-unwind-libunwind.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-unwind-libunwind.o `test -f 'unwind-libunwind.c' || echo '$(srcdir)/'`unwind-libunwind.c + +strace-unwind-libunwind.obj: unwind-libunwind.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-unwind-libunwind.obj -MD -MP -MF $(DEPDIR)/strace-unwind-libunwind.Tpo -c -o strace-unwind-libunwind.obj `if test -f 'unwind-libunwind.c'; then $(CYGPATH_W) 'unwind-libunwind.c'; else $(CYGPATH_W) '$(srcdir)/unwind-libunwind.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/strace-unwind-libunwind.Tpo $(DEPDIR)/strace-unwind-libunwind.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unwind-libunwind.c' object='strace-unwind-libunwind.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-unwind-libunwind.obj `if test -f 'unwind-libunwind.c'; then $(CYGPATH_W) 'unwind-libunwind.c'; else $(CYGPATH_W) '$(srcdir)/unwind-libunwind.c'; fi` install-man1: $(man_MANS) @$(NORMAL_INSTALL) @list1=''; \ @@ -5377,6 +7307,10 @@ $(am__recursive_targets): $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -5450,7 +7384,10 @@ distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ @@ -5518,7 +7455,7 @@ distdir: $(DISTFILES) ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir - tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir @@ -5533,17 +7470,17 @@ dist-xz: distdir $(am__post_remove_distdir) dist-tarZ: distdir - @echo WARNING: "Support for shar distribution archives is" \ - "deprecated." >&2 + @echo WARNING: "Support for distribution archives compressed with" \ + "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir - @echo WARNING: "Support for distribution archives compressed with" \ - "legacy program 'compress' is deprecated." >&2 + @echo WARNING: "Support for shar distribution archives is" \ + "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 - shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir @@ -5561,7 +7498,7 @@ dist dist-all: distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ @@ -5571,23 +7508,23 @@ distcheck: dist *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ - GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ + eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) - mkdir $(distdir)/_build $(distdir)/_inst + mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ - && $(am__cd) $(distdir)/_build \ - && ../configure \ + && $(am__cd) $(distdir)/_build/sub \ + && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ - --srcdir=.. --prefix="$$dc_install_base" \ + --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ @@ -5643,7 +7580,7 @@ distcleancheck: distclean check-am: all-am check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-recursive -all-am: Makefile $(LIBRARIES) $(PROGRAMS) $(SCRIPTS) $(MANS) config.h +all-am: Makefile $(PROGRAMS) $(LIBRARIES) $(SCRIPTS) $(MANS) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)"; do \ @@ -5687,6 +7624,22 @@ check-valgrind: check-valgrind-recursive check-valgrind-am: check-valgrind-local +check-valgrind-drd: check-valgrind-drd-recursive + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-recursive + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-recursive + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-recursive + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic clean-local \ @@ -5694,7 +7647,325 @@ clean-am: clean-binPROGRAMS clean-generic clean-local \ distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/libmpers_m32_a-block.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-btrfs.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-dirent.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-evdev_mpers.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-fetch_bpf_fprog.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-fetch_struct_flock.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-fetch_struct_keyctl_kdf_params.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-fetch_struct_mmsghdr.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-fetch_struct_msghdr.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-fetch_struct_stat.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-fetch_struct_stat64.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-fetch_struct_statfs.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-fetch_struct_xfs_quotastat.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-hdio.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-ipc_msgctl.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-ipc_shmctl.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-loop.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-mtd.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-perf_ioctl.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-print_aio_sigset.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-print_group_req.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-print_mq_attr.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-print_msgbuf.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-print_sg_req_info.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-print_sigevent.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-print_time.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-print_timespec.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-print_timeval.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-printrusage.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-printsiginfo.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-rt_sigreturn.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-rtc.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-sg_io_v3.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-sigaltstack.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-sock.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-sysinfo.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-times.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-ustat.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-utime.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-v4l2.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-block.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-btrfs.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-dirent.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-evdev_mpers.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-fetch_bpf_fprog.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_flock.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_keyctl_kdf_params.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_mmsghdr.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_msghdr.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_stat.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_stat64.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_statfs.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_xfs_quotastat.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-hdio.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-ipc_msgctl.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-ipc_shmctl.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-loop.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-mtd.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-perf_ioctl.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-print_aio_sigset.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-print_group_req.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-print_mq_attr.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-print_msgbuf.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-print_sg_req_info.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-print_sigevent.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-print_time.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-print_timespec.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-print_timeval.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-printrusage.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-printsiginfo.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-rt_sigreturn.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-rtc.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-sg_io_v3.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-sigaltstack.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-sock.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-sysinfo.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-times.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-ustat.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-utime.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-v4l2.Po + -rm -f ./$(DEPDIR)/libstrace_a-fetch_indirect_syscall_args.Po + -rm -f ./$(DEPDIR)/libstrace_a-fstatfs.Po + -rm -f ./$(DEPDIR)/libstrace_a-fstatfs64.Po + -rm -f ./$(DEPDIR)/libstrace_a-getpagesize.Po + -rm -f ./$(DEPDIR)/libstrace_a-ipc.Po + -rm -f ./$(DEPDIR)/libstrace_a-mmap_cache.Po + -rm -f ./$(DEPDIR)/libstrace_a-sigreturn.Po + -rm -f ./$(DEPDIR)/libstrace_a-socketcall.Po + -rm -f ./$(DEPDIR)/libstrace_a-statfs.Po + -rm -f ./$(DEPDIR)/libstrace_a-statfs64.Po + -rm -f ./$(DEPDIR)/libstrace_a-sync_file_range.Po + -rm -f ./$(DEPDIR)/libstrace_a-sync_file_range2.Po + -rm -f ./$(DEPDIR)/libstrace_a-upeek.Po + -rm -f ./$(DEPDIR)/libstrace_a-upoke.Po + -rm -f ./$(DEPDIR)/strace-access.Po + -rm -f ./$(DEPDIR)/strace-affinity.Po + -rm -f ./$(DEPDIR)/strace-aio.Po + -rm -f ./$(DEPDIR)/strace-alpha.Po + -rm -f ./$(DEPDIR)/strace-basic_filters.Po + -rm -f ./$(DEPDIR)/strace-bind.Po + -rm -f ./$(DEPDIR)/strace-bjm.Po + -rm -f ./$(DEPDIR)/strace-block.Po + -rm -f ./$(DEPDIR)/strace-bpf.Po + -rm -f ./$(DEPDIR)/strace-bpf_attr_check.Po + -rm -f ./$(DEPDIR)/strace-bpf_filter.Po + -rm -f ./$(DEPDIR)/strace-bpf_seccomp_filter.Po + -rm -f ./$(DEPDIR)/strace-bpf_sock_filter.Po + -rm -f ./$(DEPDIR)/strace-btrfs.Po + -rm -f ./$(DEPDIR)/strace-cacheflush.Po + -rm -f ./$(DEPDIR)/strace-capability.Po + -rm -f ./$(DEPDIR)/strace-chdir.Po + -rm -f ./$(DEPDIR)/strace-chmod.Po + -rm -f ./$(DEPDIR)/strace-clone.Po + -rm -f ./$(DEPDIR)/strace-copy_file_range.Po + -rm -f ./$(DEPDIR)/strace-count.Po + -rm -f ./$(DEPDIR)/strace-delay.Po + -rm -f ./$(DEPDIR)/strace-desc.Po + -rm -f ./$(DEPDIR)/strace-dirent.Po + -rm -f ./$(DEPDIR)/strace-dirent64.Po + -rm -f ./$(DEPDIR)/strace-dm.Po + -rm -f ./$(DEPDIR)/strace-dyxlat.Po + -rm -f ./$(DEPDIR)/strace-epoll.Po + -rm -f ./$(DEPDIR)/strace-error_prints.Po + -rm -f ./$(DEPDIR)/strace-evdev.Po + -rm -f ./$(DEPDIR)/strace-evdev_mpers.Po + -rm -f ./$(DEPDIR)/strace-eventfd.Po + -rm -f ./$(DEPDIR)/strace-execve.Po + -rm -f ./$(DEPDIR)/strace-fadvise.Po + -rm -f ./$(DEPDIR)/strace-fallocate.Po + -rm -f ./$(DEPDIR)/strace-fanotify.Po + -rm -f ./$(DEPDIR)/strace-fchownat.Po + -rm -f ./$(DEPDIR)/strace-fcntl.Po + -rm -f ./$(DEPDIR)/strace-fetch_bpf_fprog.Po + -rm -f ./$(DEPDIR)/strace-fetch_struct_flock.Po + -rm -f ./$(DEPDIR)/strace-fetch_struct_keyctl_kdf_params.Po + -rm -f ./$(DEPDIR)/strace-fetch_struct_mmsghdr.Po + -rm -f ./$(DEPDIR)/strace-fetch_struct_msghdr.Po + -rm -f ./$(DEPDIR)/strace-fetch_struct_stat.Po + -rm -f ./$(DEPDIR)/strace-fetch_struct_stat64.Po + -rm -f ./$(DEPDIR)/strace-fetch_struct_statfs.Po + -rm -f ./$(DEPDIR)/strace-fetch_struct_xfs_quotastat.Po + -rm -f ./$(DEPDIR)/strace-file_handle.Po + -rm -f ./$(DEPDIR)/strace-file_ioctl.Po + -rm -f ./$(DEPDIR)/strace-filter_qualify.Po + -rm -f ./$(DEPDIR)/strace-flock.Po + -rm -f ./$(DEPDIR)/strace-fs_x_ioctl.Po + -rm -f ./$(DEPDIR)/strace-futex.Po + -rm -f ./$(DEPDIR)/strace-get_personality.Po + -rm -f ./$(DEPDIR)/strace-get_robust_list.Po + -rm -f ./$(DEPDIR)/strace-getcpu.Po + -rm -f ./$(DEPDIR)/strace-getcwd.Po + -rm -f ./$(DEPDIR)/strace-getrandom.Po + -rm -f ./$(DEPDIR)/strace-hdio.Po + -rm -f ./$(DEPDIR)/strace-hostname.Po + -rm -f ./$(DEPDIR)/strace-inotify.Po + -rm -f ./$(DEPDIR)/strace-inotify_ioctl.Po + -rm -f ./$(DEPDIR)/strace-io.Po + -rm -f ./$(DEPDIR)/strace-io_uring.Po + -rm -f ./$(DEPDIR)/strace-ioctl.Po + -rm -f ./$(DEPDIR)/strace-ioperm.Po + -rm -f ./$(DEPDIR)/strace-iopl.Po + -rm -f ./$(DEPDIR)/strace-ioprio.Po + -rm -f ./$(DEPDIR)/strace-ipc_msg.Po + -rm -f ./$(DEPDIR)/strace-ipc_msgctl.Po + -rm -f ./$(DEPDIR)/strace-ipc_sem.Po + -rm -f ./$(DEPDIR)/strace-ipc_shm.Po + -rm -f ./$(DEPDIR)/strace-ipc_shmctl.Po + -rm -f ./$(DEPDIR)/strace-kcmp.Po + -rm -f ./$(DEPDIR)/strace-kexec.Po + -rm -f ./$(DEPDIR)/strace-keyctl.Po + -rm -f ./$(DEPDIR)/strace-kvm.Po + -rm -f ./$(DEPDIR)/strace-ldt.Po + -rm -f ./$(DEPDIR)/strace-link.Po + -rm -f ./$(DEPDIR)/strace-listen.Po + -rm -f ./$(DEPDIR)/strace-lookup_dcookie.Po + -rm -f ./$(DEPDIR)/strace-loop.Po + -rm -f ./$(DEPDIR)/strace-lseek.Po + -rm -f ./$(DEPDIR)/strace-mem.Po + -rm -f ./$(DEPDIR)/strace-membarrier.Po + -rm -f ./$(DEPDIR)/strace-memfd_create.Po + -rm -f ./$(DEPDIR)/strace-mknod.Po + -rm -f ./$(DEPDIR)/strace-mmap_notify.Po + -rm -f ./$(DEPDIR)/strace-mmsghdr.Po + -rm -f ./$(DEPDIR)/strace-mount.Po + -rm -f ./$(DEPDIR)/strace-mq.Po + -rm -f ./$(DEPDIR)/strace-msghdr.Po + -rm -f ./$(DEPDIR)/strace-mtd.Po + -rm -f ./$(DEPDIR)/strace-nbd_ioctl.Po + -rm -f ./$(DEPDIR)/strace-net.Po + -rm -f ./$(DEPDIR)/strace-netlink.Po + -rm -f ./$(DEPDIR)/strace-netlink_crypto.Po + -rm -f ./$(DEPDIR)/strace-netlink_inet_diag.Po + -rm -f ./$(DEPDIR)/strace-netlink_kobject_uevent.Po + -rm -f ./$(DEPDIR)/strace-netlink_netfilter.Po + -rm -f ./$(DEPDIR)/strace-netlink_netlink_diag.Po + -rm -f ./$(DEPDIR)/strace-netlink_packet_diag.Po + -rm -f ./$(DEPDIR)/strace-netlink_route.Po + -rm -f ./$(DEPDIR)/strace-netlink_selinux.Po + -rm -f ./$(DEPDIR)/strace-netlink_smc_diag.Po + -rm -f ./$(DEPDIR)/strace-netlink_sock_diag.Po + -rm -f ./$(DEPDIR)/strace-netlink_unix_diag.Po + -rm -f ./$(DEPDIR)/strace-nlattr.Po + -rm -f ./$(DEPDIR)/strace-nsfs.Po + -rm -f ./$(DEPDIR)/strace-numa.Po + -rm -f ./$(DEPDIR)/strace-number_set.Po + -rm -f ./$(DEPDIR)/strace-oldstat.Po + -rm -f ./$(DEPDIR)/strace-open.Po + -rm -f ./$(DEPDIR)/strace-or1k_atomic.Po + -rm -f ./$(DEPDIR)/strace-pathtrace.Po + -rm -f ./$(DEPDIR)/strace-perf.Po + -rm -f ./$(DEPDIR)/strace-perf_ioctl.Po + -rm -f ./$(DEPDIR)/strace-personality.Po + -rm -f ./$(DEPDIR)/strace-pkeys.Po + -rm -f ./$(DEPDIR)/strace-poll.Po + -rm -f ./$(DEPDIR)/strace-prctl.Po + -rm -f ./$(DEPDIR)/strace-print_aio_sigset.Po + -rm -f ./$(DEPDIR)/strace-print_dev_t.Po + -rm -f ./$(DEPDIR)/strace-print_group_req.Po + -rm -f ./$(DEPDIR)/strace-print_ifindex.Po + -rm -f ./$(DEPDIR)/strace-print_instruction_pointer.Po + -rm -f ./$(DEPDIR)/strace-print_kernel_version.Po + -rm -f ./$(DEPDIR)/strace-print_mac.Po + -rm -f ./$(DEPDIR)/strace-print_mq_attr.Po + -rm -f ./$(DEPDIR)/strace-print_msgbuf.Po + -rm -f ./$(DEPDIR)/strace-print_sg_req_info.Po + -rm -f ./$(DEPDIR)/strace-print_sigevent.Po + -rm -f ./$(DEPDIR)/strace-print_statfs.Po + -rm -f ./$(DEPDIR)/strace-print_struct_stat.Po + -rm -f ./$(DEPDIR)/strace-print_time.Po + -rm -f ./$(DEPDIR)/strace-print_timespec.Po + -rm -f ./$(DEPDIR)/strace-print_timespec32.Po + -rm -f ./$(DEPDIR)/strace-print_timespec64.Po + -rm -f ./$(DEPDIR)/strace-print_timeval.Po + -rm -f ./$(DEPDIR)/strace-print_timeval64.Po + -rm -f ./$(DEPDIR)/strace-print_timex.Po + -rm -f ./$(DEPDIR)/strace-printmode.Po + -rm -f ./$(DEPDIR)/strace-printrusage.Po + -rm -f ./$(DEPDIR)/strace-printsiginfo.Po + -rm -f ./$(DEPDIR)/strace-process.Po + -rm -f ./$(DEPDIR)/strace-process_vm.Po + -rm -f ./$(DEPDIR)/strace-ptp.Po + -rm -f ./$(DEPDIR)/strace-ptrace_syscall_info.Po + -rm -f ./$(DEPDIR)/strace-quota.Po + -rm -f ./$(DEPDIR)/strace-random_ioctl.Po + -rm -f ./$(DEPDIR)/strace-readahead.Po + -rm -f ./$(DEPDIR)/strace-readlink.Po + -rm -f ./$(DEPDIR)/strace-reboot.Po + -rm -f ./$(DEPDIR)/strace-renameat.Po + -rm -f ./$(DEPDIR)/strace-resource.Po + -rm -f ./$(DEPDIR)/strace-retval.Po + -rm -f ./$(DEPDIR)/strace-riscv.Po + -rm -f ./$(DEPDIR)/strace-rt_sigframe.Po + -rm -f ./$(DEPDIR)/strace-rt_sigreturn.Po + -rm -f ./$(DEPDIR)/strace-rtc.Po + -rm -f ./$(DEPDIR)/strace-rtnl_addr.Po + -rm -f ./$(DEPDIR)/strace-rtnl_addrlabel.Po + -rm -f ./$(DEPDIR)/strace-rtnl_dcb.Po + -rm -f ./$(DEPDIR)/strace-rtnl_link.Po + -rm -f ./$(DEPDIR)/strace-rtnl_mdb.Po + -rm -f ./$(DEPDIR)/strace-rtnl_neigh.Po + -rm -f ./$(DEPDIR)/strace-rtnl_neightbl.Po + -rm -f ./$(DEPDIR)/strace-rtnl_netconf.Po + -rm -f ./$(DEPDIR)/strace-rtnl_nsid.Po + -rm -f ./$(DEPDIR)/strace-rtnl_route.Po + -rm -f ./$(DEPDIR)/strace-rtnl_rule.Po + -rm -f ./$(DEPDIR)/strace-rtnl_tc.Po + -rm -f ./$(DEPDIR)/strace-rtnl_tc_action.Po + -rm -f ./$(DEPDIR)/strace-s390.Po + -rm -f ./$(DEPDIR)/strace-sched.Po + -rm -f ./$(DEPDIR)/strace-scsi.Po + -rm -f ./$(DEPDIR)/strace-seccomp.Po + -rm -f ./$(DEPDIR)/strace-sendfile.Po + -rm -f ./$(DEPDIR)/strace-sg_io_v3.Po + -rm -f ./$(DEPDIR)/strace-sg_io_v4.Po + -rm -f ./$(DEPDIR)/strace-shutdown.Po + -rm -f ./$(DEPDIR)/strace-sigaltstack.Po + -rm -f ./$(DEPDIR)/strace-signal.Po + -rm -f ./$(DEPDIR)/strace-signalfd.Po + -rm -f ./$(DEPDIR)/strace-sock.Po + -rm -f ./$(DEPDIR)/strace-sockaddr.Po + -rm -f ./$(DEPDIR)/strace-socketutils.Po + -rm -f ./$(DEPDIR)/strace-sparc.Po + -rm -f ./$(DEPDIR)/strace-sram_alloc.Po + -rm -f ./$(DEPDIR)/strace-stat.Po + -rm -f ./$(DEPDIR)/strace-stat64.Po + -rm -f ./$(DEPDIR)/strace-statfs.Po + -rm -f ./$(DEPDIR)/strace-statx.Po + -rm -f ./$(DEPDIR)/strace-strace.Po + -rm -f ./$(DEPDIR)/strace-string_to_uint.Po + -rm -f ./$(DEPDIR)/strace-swapon.Po + -rm -f ./$(DEPDIR)/strace-syscall.Po + -rm -f ./$(DEPDIR)/strace-sysctl.Po + -rm -f ./$(DEPDIR)/strace-sysinfo.Po + -rm -f ./$(DEPDIR)/strace-syslog.Po + -rm -f ./$(DEPDIR)/strace-sysmips.Po + -rm -f ./$(DEPDIR)/strace-term.Po + -rm -f ./$(DEPDIR)/strace-time.Po + -rm -f ./$(DEPDIR)/strace-times.Po + -rm -f ./$(DEPDIR)/strace-truncate.Po + -rm -f ./$(DEPDIR)/strace-ubi.Po + -rm -f ./$(DEPDIR)/strace-ucopy.Po + -rm -f ./$(DEPDIR)/strace-uid.Po + -rm -f ./$(DEPDIR)/strace-uid16.Po + -rm -f ./$(DEPDIR)/strace-umask.Po + -rm -f ./$(DEPDIR)/strace-umount.Po + -rm -f ./$(DEPDIR)/strace-uname.Po + -rm -f ./$(DEPDIR)/strace-unwind-libdw.Po + -rm -f ./$(DEPDIR)/strace-unwind-libunwind.Po + -rm -f ./$(DEPDIR)/strace-unwind.Po + -rm -f ./$(DEPDIR)/strace-userfaultfd.Po + -rm -f ./$(DEPDIR)/strace-ustat.Po + -rm -f ./$(DEPDIR)/strace-util.Po + -rm -f ./$(DEPDIR)/strace-utime.Po + -rm -f ./$(DEPDIR)/strace-utimes.Po + -rm -f ./$(DEPDIR)/strace-v4l2.Po + -rm -f ./$(DEPDIR)/strace-wait.Po + -rm -f ./$(DEPDIR)/strace-xattr.Po + -rm -f ./$(DEPDIR)/strace-xlat.Po + -rm -f ./$(DEPDIR)/strace-xmalloc.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags @@ -5742,7 +8013,325 @@ installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/libmpers_m32_a-block.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-btrfs.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-dirent.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-evdev_mpers.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-fetch_bpf_fprog.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-fetch_struct_flock.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-fetch_struct_keyctl_kdf_params.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-fetch_struct_mmsghdr.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-fetch_struct_msghdr.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-fetch_struct_stat.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-fetch_struct_stat64.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-fetch_struct_statfs.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-fetch_struct_xfs_quotastat.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-hdio.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-ipc_msgctl.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-ipc_shmctl.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-loop.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-mtd.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-perf_ioctl.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-print_aio_sigset.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-print_group_req.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-print_mq_attr.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-print_msgbuf.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-print_sg_req_info.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-print_sigevent.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-print_time.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-print_timespec.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-print_timeval.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-printrusage.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-printsiginfo.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-rt_sigreturn.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-rtc.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-sg_io_v3.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-sigaltstack.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-sock.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-sysinfo.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-times.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-ustat.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-utime.Po + -rm -f ./$(DEPDIR)/libmpers_m32_a-v4l2.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-block.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-btrfs.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-dirent.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-evdev_mpers.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-fetch_bpf_fprog.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_flock.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_keyctl_kdf_params.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_mmsghdr.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_msghdr.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_stat.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_stat64.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_statfs.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-fetch_struct_xfs_quotastat.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-hdio.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-ipc_msgctl.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-ipc_shmctl.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-loop.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-mtd.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-perf_ioctl.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-print_aio_sigset.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-print_group_req.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-print_mq_attr.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-print_msgbuf.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-print_sg_req_info.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-print_sigevent.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-print_time.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-print_timespec.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-print_timeval.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-printrusage.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-printsiginfo.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-rt_sigreturn.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-rtc.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-sg_io_v3.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-sigaltstack.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-sock.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-sysinfo.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-times.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-ustat.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-utime.Po + -rm -f ./$(DEPDIR)/libmpers_mx32_a-v4l2.Po + -rm -f ./$(DEPDIR)/libstrace_a-fetch_indirect_syscall_args.Po + -rm -f ./$(DEPDIR)/libstrace_a-fstatfs.Po + -rm -f ./$(DEPDIR)/libstrace_a-fstatfs64.Po + -rm -f ./$(DEPDIR)/libstrace_a-getpagesize.Po + -rm -f ./$(DEPDIR)/libstrace_a-ipc.Po + -rm -f ./$(DEPDIR)/libstrace_a-mmap_cache.Po + -rm -f ./$(DEPDIR)/libstrace_a-sigreturn.Po + -rm -f ./$(DEPDIR)/libstrace_a-socketcall.Po + -rm -f ./$(DEPDIR)/libstrace_a-statfs.Po + -rm -f ./$(DEPDIR)/libstrace_a-statfs64.Po + -rm -f ./$(DEPDIR)/libstrace_a-sync_file_range.Po + -rm -f ./$(DEPDIR)/libstrace_a-sync_file_range2.Po + -rm -f ./$(DEPDIR)/libstrace_a-upeek.Po + -rm -f ./$(DEPDIR)/libstrace_a-upoke.Po + -rm -f ./$(DEPDIR)/strace-access.Po + -rm -f ./$(DEPDIR)/strace-affinity.Po + -rm -f ./$(DEPDIR)/strace-aio.Po + -rm -f ./$(DEPDIR)/strace-alpha.Po + -rm -f ./$(DEPDIR)/strace-basic_filters.Po + -rm -f ./$(DEPDIR)/strace-bind.Po + -rm -f ./$(DEPDIR)/strace-bjm.Po + -rm -f ./$(DEPDIR)/strace-block.Po + -rm -f ./$(DEPDIR)/strace-bpf.Po + -rm -f ./$(DEPDIR)/strace-bpf_attr_check.Po + -rm -f ./$(DEPDIR)/strace-bpf_filter.Po + -rm -f ./$(DEPDIR)/strace-bpf_seccomp_filter.Po + -rm -f ./$(DEPDIR)/strace-bpf_sock_filter.Po + -rm -f ./$(DEPDIR)/strace-btrfs.Po + -rm -f ./$(DEPDIR)/strace-cacheflush.Po + -rm -f ./$(DEPDIR)/strace-capability.Po + -rm -f ./$(DEPDIR)/strace-chdir.Po + -rm -f ./$(DEPDIR)/strace-chmod.Po + -rm -f ./$(DEPDIR)/strace-clone.Po + -rm -f ./$(DEPDIR)/strace-copy_file_range.Po + -rm -f ./$(DEPDIR)/strace-count.Po + -rm -f ./$(DEPDIR)/strace-delay.Po + -rm -f ./$(DEPDIR)/strace-desc.Po + -rm -f ./$(DEPDIR)/strace-dirent.Po + -rm -f ./$(DEPDIR)/strace-dirent64.Po + -rm -f ./$(DEPDIR)/strace-dm.Po + -rm -f ./$(DEPDIR)/strace-dyxlat.Po + -rm -f ./$(DEPDIR)/strace-epoll.Po + -rm -f ./$(DEPDIR)/strace-error_prints.Po + -rm -f ./$(DEPDIR)/strace-evdev.Po + -rm -f ./$(DEPDIR)/strace-evdev_mpers.Po + -rm -f ./$(DEPDIR)/strace-eventfd.Po + -rm -f ./$(DEPDIR)/strace-execve.Po + -rm -f ./$(DEPDIR)/strace-fadvise.Po + -rm -f ./$(DEPDIR)/strace-fallocate.Po + -rm -f ./$(DEPDIR)/strace-fanotify.Po + -rm -f ./$(DEPDIR)/strace-fchownat.Po + -rm -f ./$(DEPDIR)/strace-fcntl.Po + -rm -f ./$(DEPDIR)/strace-fetch_bpf_fprog.Po + -rm -f ./$(DEPDIR)/strace-fetch_struct_flock.Po + -rm -f ./$(DEPDIR)/strace-fetch_struct_keyctl_kdf_params.Po + -rm -f ./$(DEPDIR)/strace-fetch_struct_mmsghdr.Po + -rm -f ./$(DEPDIR)/strace-fetch_struct_msghdr.Po + -rm -f ./$(DEPDIR)/strace-fetch_struct_stat.Po + -rm -f ./$(DEPDIR)/strace-fetch_struct_stat64.Po + -rm -f ./$(DEPDIR)/strace-fetch_struct_statfs.Po + -rm -f ./$(DEPDIR)/strace-fetch_struct_xfs_quotastat.Po + -rm -f ./$(DEPDIR)/strace-file_handle.Po + -rm -f ./$(DEPDIR)/strace-file_ioctl.Po + -rm -f ./$(DEPDIR)/strace-filter_qualify.Po + -rm -f ./$(DEPDIR)/strace-flock.Po + -rm -f ./$(DEPDIR)/strace-fs_x_ioctl.Po + -rm -f ./$(DEPDIR)/strace-futex.Po + -rm -f ./$(DEPDIR)/strace-get_personality.Po + -rm -f ./$(DEPDIR)/strace-get_robust_list.Po + -rm -f ./$(DEPDIR)/strace-getcpu.Po + -rm -f ./$(DEPDIR)/strace-getcwd.Po + -rm -f ./$(DEPDIR)/strace-getrandom.Po + -rm -f ./$(DEPDIR)/strace-hdio.Po + -rm -f ./$(DEPDIR)/strace-hostname.Po + -rm -f ./$(DEPDIR)/strace-inotify.Po + -rm -f ./$(DEPDIR)/strace-inotify_ioctl.Po + -rm -f ./$(DEPDIR)/strace-io.Po + -rm -f ./$(DEPDIR)/strace-io_uring.Po + -rm -f ./$(DEPDIR)/strace-ioctl.Po + -rm -f ./$(DEPDIR)/strace-ioperm.Po + -rm -f ./$(DEPDIR)/strace-iopl.Po + -rm -f ./$(DEPDIR)/strace-ioprio.Po + -rm -f ./$(DEPDIR)/strace-ipc_msg.Po + -rm -f ./$(DEPDIR)/strace-ipc_msgctl.Po + -rm -f ./$(DEPDIR)/strace-ipc_sem.Po + -rm -f ./$(DEPDIR)/strace-ipc_shm.Po + -rm -f ./$(DEPDIR)/strace-ipc_shmctl.Po + -rm -f ./$(DEPDIR)/strace-kcmp.Po + -rm -f ./$(DEPDIR)/strace-kexec.Po + -rm -f ./$(DEPDIR)/strace-keyctl.Po + -rm -f ./$(DEPDIR)/strace-kvm.Po + -rm -f ./$(DEPDIR)/strace-ldt.Po + -rm -f ./$(DEPDIR)/strace-link.Po + -rm -f ./$(DEPDIR)/strace-listen.Po + -rm -f ./$(DEPDIR)/strace-lookup_dcookie.Po + -rm -f ./$(DEPDIR)/strace-loop.Po + -rm -f ./$(DEPDIR)/strace-lseek.Po + -rm -f ./$(DEPDIR)/strace-mem.Po + -rm -f ./$(DEPDIR)/strace-membarrier.Po + -rm -f ./$(DEPDIR)/strace-memfd_create.Po + -rm -f ./$(DEPDIR)/strace-mknod.Po + -rm -f ./$(DEPDIR)/strace-mmap_notify.Po + -rm -f ./$(DEPDIR)/strace-mmsghdr.Po + -rm -f ./$(DEPDIR)/strace-mount.Po + -rm -f ./$(DEPDIR)/strace-mq.Po + -rm -f ./$(DEPDIR)/strace-msghdr.Po + -rm -f ./$(DEPDIR)/strace-mtd.Po + -rm -f ./$(DEPDIR)/strace-nbd_ioctl.Po + -rm -f ./$(DEPDIR)/strace-net.Po + -rm -f ./$(DEPDIR)/strace-netlink.Po + -rm -f ./$(DEPDIR)/strace-netlink_crypto.Po + -rm -f ./$(DEPDIR)/strace-netlink_inet_diag.Po + -rm -f ./$(DEPDIR)/strace-netlink_kobject_uevent.Po + -rm -f ./$(DEPDIR)/strace-netlink_netfilter.Po + -rm -f ./$(DEPDIR)/strace-netlink_netlink_diag.Po + -rm -f ./$(DEPDIR)/strace-netlink_packet_diag.Po + -rm -f ./$(DEPDIR)/strace-netlink_route.Po + -rm -f ./$(DEPDIR)/strace-netlink_selinux.Po + -rm -f ./$(DEPDIR)/strace-netlink_smc_diag.Po + -rm -f ./$(DEPDIR)/strace-netlink_sock_diag.Po + -rm -f ./$(DEPDIR)/strace-netlink_unix_diag.Po + -rm -f ./$(DEPDIR)/strace-nlattr.Po + -rm -f ./$(DEPDIR)/strace-nsfs.Po + -rm -f ./$(DEPDIR)/strace-numa.Po + -rm -f ./$(DEPDIR)/strace-number_set.Po + -rm -f ./$(DEPDIR)/strace-oldstat.Po + -rm -f ./$(DEPDIR)/strace-open.Po + -rm -f ./$(DEPDIR)/strace-or1k_atomic.Po + -rm -f ./$(DEPDIR)/strace-pathtrace.Po + -rm -f ./$(DEPDIR)/strace-perf.Po + -rm -f ./$(DEPDIR)/strace-perf_ioctl.Po + -rm -f ./$(DEPDIR)/strace-personality.Po + -rm -f ./$(DEPDIR)/strace-pkeys.Po + -rm -f ./$(DEPDIR)/strace-poll.Po + -rm -f ./$(DEPDIR)/strace-prctl.Po + -rm -f ./$(DEPDIR)/strace-print_aio_sigset.Po + -rm -f ./$(DEPDIR)/strace-print_dev_t.Po + -rm -f ./$(DEPDIR)/strace-print_group_req.Po + -rm -f ./$(DEPDIR)/strace-print_ifindex.Po + -rm -f ./$(DEPDIR)/strace-print_instruction_pointer.Po + -rm -f ./$(DEPDIR)/strace-print_kernel_version.Po + -rm -f ./$(DEPDIR)/strace-print_mac.Po + -rm -f ./$(DEPDIR)/strace-print_mq_attr.Po + -rm -f ./$(DEPDIR)/strace-print_msgbuf.Po + -rm -f ./$(DEPDIR)/strace-print_sg_req_info.Po + -rm -f ./$(DEPDIR)/strace-print_sigevent.Po + -rm -f ./$(DEPDIR)/strace-print_statfs.Po + -rm -f ./$(DEPDIR)/strace-print_struct_stat.Po + -rm -f ./$(DEPDIR)/strace-print_time.Po + -rm -f ./$(DEPDIR)/strace-print_timespec.Po + -rm -f ./$(DEPDIR)/strace-print_timespec32.Po + -rm -f ./$(DEPDIR)/strace-print_timespec64.Po + -rm -f ./$(DEPDIR)/strace-print_timeval.Po + -rm -f ./$(DEPDIR)/strace-print_timeval64.Po + -rm -f ./$(DEPDIR)/strace-print_timex.Po + -rm -f ./$(DEPDIR)/strace-printmode.Po + -rm -f ./$(DEPDIR)/strace-printrusage.Po + -rm -f ./$(DEPDIR)/strace-printsiginfo.Po + -rm -f ./$(DEPDIR)/strace-process.Po + -rm -f ./$(DEPDIR)/strace-process_vm.Po + -rm -f ./$(DEPDIR)/strace-ptp.Po + -rm -f ./$(DEPDIR)/strace-ptrace_syscall_info.Po + -rm -f ./$(DEPDIR)/strace-quota.Po + -rm -f ./$(DEPDIR)/strace-random_ioctl.Po + -rm -f ./$(DEPDIR)/strace-readahead.Po + -rm -f ./$(DEPDIR)/strace-readlink.Po + -rm -f ./$(DEPDIR)/strace-reboot.Po + -rm -f ./$(DEPDIR)/strace-renameat.Po + -rm -f ./$(DEPDIR)/strace-resource.Po + -rm -f ./$(DEPDIR)/strace-retval.Po + -rm -f ./$(DEPDIR)/strace-riscv.Po + -rm -f ./$(DEPDIR)/strace-rt_sigframe.Po + -rm -f ./$(DEPDIR)/strace-rt_sigreturn.Po + -rm -f ./$(DEPDIR)/strace-rtc.Po + -rm -f ./$(DEPDIR)/strace-rtnl_addr.Po + -rm -f ./$(DEPDIR)/strace-rtnl_addrlabel.Po + -rm -f ./$(DEPDIR)/strace-rtnl_dcb.Po + -rm -f ./$(DEPDIR)/strace-rtnl_link.Po + -rm -f ./$(DEPDIR)/strace-rtnl_mdb.Po + -rm -f ./$(DEPDIR)/strace-rtnl_neigh.Po + -rm -f ./$(DEPDIR)/strace-rtnl_neightbl.Po + -rm -f ./$(DEPDIR)/strace-rtnl_netconf.Po + -rm -f ./$(DEPDIR)/strace-rtnl_nsid.Po + -rm -f ./$(DEPDIR)/strace-rtnl_route.Po + -rm -f ./$(DEPDIR)/strace-rtnl_rule.Po + -rm -f ./$(DEPDIR)/strace-rtnl_tc.Po + -rm -f ./$(DEPDIR)/strace-rtnl_tc_action.Po + -rm -f ./$(DEPDIR)/strace-s390.Po + -rm -f ./$(DEPDIR)/strace-sched.Po + -rm -f ./$(DEPDIR)/strace-scsi.Po + -rm -f ./$(DEPDIR)/strace-seccomp.Po + -rm -f ./$(DEPDIR)/strace-sendfile.Po + -rm -f ./$(DEPDIR)/strace-sg_io_v3.Po + -rm -f ./$(DEPDIR)/strace-sg_io_v4.Po + -rm -f ./$(DEPDIR)/strace-shutdown.Po + -rm -f ./$(DEPDIR)/strace-sigaltstack.Po + -rm -f ./$(DEPDIR)/strace-signal.Po + -rm -f ./$(DEPDIR)/strace-signalfd.Po + -rm -f ./$(DEPDIR)/strace-sock.Po + -rm -f ./$(DEPDIR)/strace-sockaddr.Po + -rm -f ./$(DEPDIR)/strace-socketutils.Po + -rm -f ./$(DEPDIR)/strace-sparc.Po + -rm -f ./$(DEPDIR)/strace-sram_alloc.Po + -rm -f ./$(DEPDIR)/strace-stat.Po + -rm -f ./$(DEPDIR)/strace-stat64.Po + -rm -f ./$(DEPDIR)/strace-statfs.Po + -rm -f ./$(DEPDIR)/strace-statx.Po + -rm -f ./$(DEPDIR)/strace-strace.Po + -rm -f ./$(DEPDIR)/strace-string_to_uint.Po + -rm -f ./$(DEPDIR)/strace-swapon.Po + -rm -f ./$(DEPDIR)/strace-syscall.Po + -rm -f ./$(DEPDIR)/strace-sysctl.Po + -rm -f ./$(DEPDIR)/strace-sysinfo.Po + -rm -f ./$(DEPDIR)/strace-syslog.Po + -rm -f ./$(DEPDIR)/strace-sysmips.Po + -rm -f ./$(DEPDIR)/strace-term.Po + -rm -f ./$(DEPDIR)/strace-time.Po + -rm -f ./$(DEPDIR)/strace-times.Po + -rm -f ./$(DEPDIR)/strace-truncate.Po + -rm -f ./$(DEPDIR)/strace-ubi.Po + -rm -f ./$(DEPDIR)/strace-ucopy.Po + -rm -f ./$(DEPDIR)/strace-uid.Po + -rm -f ./$(DEPDIR)/strace-uid16.Po + -rm -f ./$(DEPDIR)/strace-umask.Po + -rm -f ./$(DEPDIR)/strace-umount.Po + -rm -f ./$(DEPDIR)/strace-uname.Po + -rm -f ./$(DEPDIR)/strace-unwind-libdw.Po + -rm -f ./$(DEPDIR)/strace-unwind-libunwind.Po + -rm -f ./$(DEPDIR)/strace-unwind.Po + -rm -f ./$(DEPDIR)/strace-userfaultfd.Po + -rm -f ./$(DEPDIR)/strace-ustat.Po + -rm -f ./$(DEPDIR)/strace-util.Po + -rm -f ./$(DEPDIR)/strace-utime.Po + -rm -f ./$(DEPDIR)/strace-utimes.Po + -rm -f ./$(DEPDIR)/strace-v4l2.Po + -rm -f ./$(DEPDIR)/strace-wait.Po + -rm -f ./$(DEPDIR)/strace-xattr.Po + -rm -f ./$(DEPDIR)/strace-xlat.Po + -rm -f ./$(DEPDIR)/strace-xmalloc.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -5766,10 +8355,14 @@ uninstall-man: uninstall-man1 install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ - am--refresh check check-am check-valgrind-am \ - check-valgrind-local clean clean-binPROGRAMS clean-cscope \ - clean-generic clean-local clean-noinstLIBRARIES cscope \ - cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ + am--depfiles am--refresh check check-am check-valgrind-am \ + check-valgrind-drd-am check-valgrind-drd-local \ + check-valgrind-helgrind-am check-valgrind-helgrind-local \ + check-valgrind-local check-valgrind-memcheck-am \ + check-valgrind-memcheck-local check-valgrind-sgcheck-am \ + check-valgrind-sgcheck-local clean clean-binPROGRAMS \ + clean-cscope clean-generic clean-local clean-noinstLIBRARIES \ + cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-hook dist-lzip dist-shar dist-tarZ dist-xz \ dist-zip distcheck distclean distclean-compile \ distclean-generic distclean-hdr distclean-tags distcleancheck \ @@ -5786,10 +8379,10 @@ uninstall-man: uninstall-man1 uninstall-am uninstall-binPROGRAMS uninstall-binSCRIPTS \ uninstall-man uninstall-man1 +.PRECIOUS: Makefile + $(top_srcdir)/xlat/access_flags.h: $(top_srcdir)/xlat/access_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/aclipc.h: $(top_srcdir)/xlat/aclipc.in $(top_srcdir)/xlat/gen.sh - $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/addrfams.h: $(top_srcdir)/xlat/addrfams.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/adjtimex_modes.h: $(top_srcdir)/xlat/adjtimex_modes.in $(top_srcdir)/xlat/gen.sh @@ -5802,32 +8395,54 @@ $(top_srcdir)/xlat/advise.h: $(top_srcdir)/xlat/advise.in $(top_srcdir)/xlat/gen $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/af_packet_types.h: $(top_srcdir)/xlat/af_packet_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/af_packet_versions.h: $(top_srcdir)/xlat/af_packet_versions.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/aio_cmds.h: $(top_srcdir)/xlat/aio_cmds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/archvals.h: $(top_srcdir)/xlat/archvals.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/arp_hardware_types.h: $(top_srcdir)/xlat/arp_hardware_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/at_flags.h: $(top_srcdir)/xlat/at_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/at_statx_sync_types.h: $(top_srcdir)/xlat/at_statx_sync_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/atomic_ops.h: $(top_srcdir)/xlat/atomic_ops.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/audit_arch.h: $(top_srcdir)/xlat/audit_arch.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ax25_protocols.h: $(top_srcdir)/xlat/ax25_protocols.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/baud_options.h: $(top_srcdir)/xlat/baud_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bdaddr_types.h: $(top_srcdir)/xlat/bdaddr_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/blkpg_ops.h: $(top_srcdir)/xlat/blkpg_ops.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/block_ioctl_cmds.h: $(top_srcdir)/xlat/block_ioctl_cmds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bluetooth_l2_cid.h: $(top_srcdir)/xlat/bluetooth_l2_cid.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bluetooth_l2_psm.h: $(top_srcdir)/xlat/bluetooth_l2_psm.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bootflags1.h: $(top_srcdir)/xlat/bootflags1.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bootflags2.h: $(top_srcdir)/xlat/bootflags2.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bootflags3.h: $(top_srcdir)/xlat/bootflags3.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_attach_flags.h: $(top_srcdir)/xlat/bpf_attach_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bpf_attach_type.h: $(top_srcdir)/xlat/bpf_attach_type.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bpf_class.h: $(top_srcdir)/xlat/bpf_class.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bpf_commands.h: $(top_srcdir)/xlat/bpf_commands.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_file_mode_flags.h: $(top_srcdir)/xlat/bpf_file_mode_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_map_flags.h: $(top_srcdir)/xlat/bpf_map_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bpf_map_types.h: $(top_srcdir)/xlat/bpf_map_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bpf_map_update_elem_flags.h: $(top_srcdir)/xlat/bpf_map_update_elem_flags.in $(top_srcdir)/xlat/gen.sh @@ -5840,14 +8455,20 @@ $(top_srcdir)/xlat/bpf_op_alu.h: $(top_srcdir)/xlat/bpf_op_alu.in $(top_srcdir)/ $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bpf_op_jmp.h: $(top_srcdir)/xlat/bpf_op_jmp.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_prog_flags.h: $(top_srcdir)/xlat/bpf_prog_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bpf_prog_types.h: $(top_srcdir)/xlat/bpf_prog_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_query_flags.h: $(top_srcdir)/xlat/bpf_query_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bpf_rval.h: $(top_srcdir)/xlat/bpf_rval.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bpf_size.h: $(top_srcdir)/xlat/bpf_size.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bpf_src.h: $(top_srcdir)/xlat/bpf_src.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_task_fd_type.h: $(top_srcdir)/xlat/bpf_task_fd_type.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bsg_flags.h: $(top_srcdir)/xlat/bsg_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bsg_protocol.h: $(top_srcdir)/xlat/bsg_protocol.in $(top_srcdir)/xlat/gen.sh @@ -5866,6 +8487,8 @@ $(top_srcdir)/xlat/btrfs_balance_state.h: $(top_srcdir)/xlat/btrfs_balance_state $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/btrfs_compress_types.h: $(top_srcdir)/xlat/btrfs_compress_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_cont_reading_from_srcdev_mode.h: $(top_srcdir)/xlat/btrfs_cont_reading_from_srcdev_mode.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/btrfs_defrag_flags.h: $(top_srcdir)/xlat/btrfs_defrag_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/btrfs_dev_replace_cmds.h: $(top_srcdir)/xlat/btrfs_dev_replace_cmds.in $(top_srcdir)/xlat/gen.sh @@ -5886,6 +8509,8 @@ $(top_srcdir)/xlat/btrfs_features_incompat.h: $(top_srcdir)/xlat/btrfs_features_ $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/btrfs_key_types.h: $(top_srcdir)/xlat/btrfs_key_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_logical_ino_args_flags.h: $(top_srcdir)/xlat/btrfs_logical_ino_args_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/btrfs_qgroup_ctl_cmds.h: $(top_srcdir)/xlat/btrfs_qgroup_ctl_cmds.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/btrfs_qgroup_inherit_flags.h: $(top_srcdir)/xlat/btrfs_qgroup_inherit_flags.in $(top_srcdir)/xlat/gen.sh @@ -5906,6 +8531,10 @@ $(top_srcdir)/xlat/btrfs_tree_objectids.h: $(top_srcdir)/xlat/btrfs_tree_objecti $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/cacheflush_scope.h: $(top_srcdir)/xlat/cacheflush_scope.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/caif_protocols.h: $(top_srcdir)/xlat/caif_protocols.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/can_protocols.h: $(top_srcdir)/xlat/can_protocols.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/cap.h: $(top_srcdir)/xlat/cap.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/cap_mask0.h: $(top_srcdir)/xlat/cap_mask0.in $(top_srcdir)/xlat/gen.sh @@ -5922,12 +8551,28 @@ $(top_srcdir)/xlat/clone_flags.h: $(top_srcdir)/xlat/clone_flags.in $(top_srcdir $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/cpuclocknames.h: $(top_srcdir)/xlat/cpuclocknames.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/crypto_nl_attrs.h: $(top_srcdir)/xlat/crypto_nl_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/dcb_commands.h: $(top_srcdir)/xlat/dcb_commands.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/delete_module_flags.h: $(top_srcdir)/xlat/delete_module_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/dirent_types.h: $(top_srcdir)/xlat/dirent_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/dm_flags.h: $(top_srcdir)/xlat/dm_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ebpf_class.h: $(top_srcdir)/xlat/ebpf_class.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ebpf_mode.h: $(top_srcdir)/xlat/ebpf_mode.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ebpf_op_alu.h: $(top_srcdir)/xlat/ebpf_op_alu.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ebpf_op_jmp.h: $(top_srcdir)/xlat/ebpf_op_jmp.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ebpf_regs.h: $(top_srcdir)/xlat/ebpf_regs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ebpf_size.h: $(top_srcdir)/xlat/ebpf_size.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/efd_flags.h: $(top_srcdir)/xlat/efd_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/epollctls.h: $(top_srcdir)/xlat/epollctls.in $(top_srcdir)/xlat/gen.sh @@ -5964,8 +8609,6 @@ $(top_srcdir)/xlat/evdev_snd.h: $(top_srcdir)/xlat/evdev_snd.in $(top_srcdir)/xl $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/evdev_switch.h: $(top_srcdir)/xlat/evdev_switch.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/evdev_sync.h: $(top_srcdir)/xlat/evdev_sync.in $(top_srcdir)/xlat/gen.sh - $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/f_owner_types.h: $(top_srcdir)/xlat/f_owner_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/f_seals.h: $(top_srcdir)/xlat/f_seals.in $(top_srcdir)/xlat/gen.sh @@ -5980,12 +8623,14 @@ $(top_srcdir)/xlat/fan_init_flags.h: $(top_srcdir)/xlat/fan_init_flags.in $(top_ $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/fan_mark_flags.h: $(top_srcdir)/xlat/fan_mark_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/fcntl64cmds.h: $(top_srcdir)/xlat/fcntl64cmds.in $(top_srcdir)/xlat/gen.sh - $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/fcntlcmds.h: $(top_srcdir)/xlat/fcntlcmds.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/fdflags.h: $(top_srcdir)/xlat/fdflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/fib_rule_actions.h: $(top_srcdir)/xlat/fib_rule_actions.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/fib_rule_flags.h: $(top_srcdir)/xlat/fib_rule_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/fiemap_extent_flags.h: $(top_srcdir)/xlat/fiemap_extent_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/fiemap_flags.h: $(top_srcdir)/xlat/fiemap_flags.in $(top_srcdir)/xlat/gen.sh @@ -5994,6 +8639,8 @@ $(top_srcdir)/xlat/flockcmds.h: $(top_srcdir)/xlat/flockcmds.in $(top_srcdir)/xl $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/fsmagic.h: $(top_srcdir)/xlat/fsmagic.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/futexbitset.h: $(top_srcdir)/xlat/futexbitset.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/futexops.h: $(top_srcdir)/xlat/futexops.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/futexwakecmps.h: $(top_srcdir)/xlat/futexwakecmps.in $(top_srcdir)/xlat/gen.sh @@ -6002,9 +8649,11 @@ $(top_srcdir)/xlat/futexwakeops.h: $(top_srcdir)/xlat/futexwakeops.in $(top_srcd $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/getrandom_flags.h: $(top_srcdir)/xlat/getrandom_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/getsockipoptions.h: $(top_srcdir)/xlat/getsockipoptions.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/getsock_ip_options.h: $(top_srcdir)/xlat/getsock_ip_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/getsock_ipv6_options.h: $(top_srcdir)/xlat/getsock_ipv6_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/getsockipv6options.h: $(top_srcdir)/xlat/getsockipv6options.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/getsock_options.h: $(top_srcdir)/xlat/getsock_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/hci_channels.h: $(top_srcdir)/xlat/hci_channels.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ @@ -6020,8 +8669,26 @@ $(top_srcdir)/xlat/if_dqinfo_flags.h: $(top_srcdir)/xlat/if_dqinfo_flags.in $(to $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/if_dqinfo_valid.h: $(top_srcdir)/xlat/if_dqinfo_valid.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ifaddrflags.h: $(top_srcdir)/xlat/ifaddrflags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/iffflags.h: $(top_srcdir)/xlat/iffflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/in6_addr_gen_mode.h: $(top_srcdir)/xlat/in6_addr_gen_mode.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/inet6_devconf_indices.h: $(top_srcdir)/xlat/inet6_devconf_indices.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/inet6_if_flags.h: $(top_srcdir)/xlat/inet6_if_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/inet_devconf_indices.h: $(top_srcdir)/xlat/inet_devconf_indices.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/inet_diag_attrs.h: $(top_srcdir)/xlat/inet_diag_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/inet_diag_bytecodes.h: $(top_srcdir)/xlat/inet_diag_bytecodes.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/inet_diag_extended_flags.h: $(top_srcdir)/xlat/inet_diag_extended_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/inet_diag_req_attrs.h: $(top_srcdir)/xlat/inet_diag_req_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/inet_protocols.h: $(top_srcdir)/xlat/inet_protocols.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/inotify_flags.h: $(top_srcdir)/xlat/inotify_flags.in $(top_srcdir)/xlat/gen.sh @@ -6036,12 +8703,22 @@ $(top_srcdir)/xlat/ioprio_who.h: $(top_srcdir)/xlat/ioprio_who.in $(top_srcdir)/ $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/ip_cmsg_types.h: $(top_srcdir)/xlat/ip_cmsg_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ip_type_of_services.h: $(top_srcdir)/xlat/ip_type_of_services.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/ipc_msg_flags.h: $(top_srcdir)/xlat/ipc_msg_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ipc_private.h: $(top_srcdir)/xlat/ipc_private.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/ipccalls.h: $(top_srcdir)/xlat/ipccalls.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/irda_protocols.h: $(top_srcdir)/xlat/irda_protocols.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/isdn_protocols.h: $(top_srcdir)/xlat/isdn_protocols.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/itimer_which.h: $(top_srcdir)/xlat/itimer_which.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/kcm_protocols.h: $(top_srcdir)/xlat/kcm_protocols.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/kcmp_types.h: $(top_srcdir)/xlat/kcmp_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/kexec_arch_values.h: $(top_srcdir)/xlat/kexec_arch_values.in $(top_srcdir)/xlat/gen.sh @@ -6058,6 +8735,14 @@ $(top_srcdir)/xlat/key_spec.h: $(top_srcdir)/xlat/key_spec.in $(top_srcdir)/xlat $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/keyctl_commands.h: $(top_srcdir)/xlat/keyctl_commands.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/kvm_cap.h: $(top_srcdir)/xlat/kvm_cap.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/kvm_cpuid_flags.h: $(top_srcdir)/xlat/kvm_cpuid_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/kvm_exit_reason.h: $(top_srcdir)/xlat/kvm_exit_reason.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/kvm_mem_flags.h: $(top_srcdir)/xlat/kvm_mem_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/lockfcmds.h: $(top_srcdir)/xlat/lockfcmds.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/loop_cmds.h: $(top_srcdir)/xlat/loop_cmds.in $(top_srcdir)/xlat/gen.sh @@ -6066,12 +8751,18 @@ $(top_srcdir)/xlat/loop_crypt_type_options.h: $(top_srcdir)/xlat/loop_crypt_type $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/loop_flags_options.h: $(top_srcdir)/xlat/loop_flags_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/lwtunnel_encap_types.h: $(top_srcdir)/xlat/lwtunnel_encap_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/madvise_cmds.h: $(top_srcdir)/xlat/madvise_cmds.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/mbindflags.h: $(top_srcdir)/xlat/mbindflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/mctl_sync.h: $(top_srcdir)/xlat/mctl_sync.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/mdb_flags.h: $(top_srcdir)/xlat/mdb_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/mdb_states.h: $(top_srcdir)/xlat/mdb_states.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/membarrier_cmds.h: $(top_srcdir)/xlat/membarrier_cmds.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/memfd_create_flags.h: $(top_srcdir)/xlat/memfd_create_flags.in $(top_srcdir)/xlat/gen.sh @@ -6116,23 +8807,101 @@ $(top_srcdir)/xlat/mtd_otp_options.h: $(top_srcdir)/xlat/mtd_otp_options.in $(to $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/mtd_type_options.h: $(top_srcdir)/xlat/mtd_type_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/multicast_router_types.h: $(top_srcdir)/xlat/multicast_router_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/name_to_handle_at_flags.h: $(top_srcdir)/xlat/name_to_handle_at_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nbd_ioctl_cmds.h: $(top_srcdir)/xlat/nbd_ioctl_cmds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nbd_ioctl_flags.h: $(top_srcdir)/xlat/nbd_ioctl_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/neighbor_cache_entry_flags.h: $(top_srcdir)/xlat/neighbor_cache_entry_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/neighbor_cache_entry_states.h: $(top_srcdir)/xlat/neighbor_cache_entry_states.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netfilter_versions.h: $(top_srcdir)/xlat/netfilter_versions.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netlink_ack_flags.h: $(top_srcdir)/xlat/netlink_ack_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netlink_delete_flags.h: $(top_srcdir)/xlat/netlink_delete_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netlink_diag_attrs.h: $(top_srcdir)/xlat/netlink_diag_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netlink_diag_show.h: $(top_srcdir)/xlat/netlink_diag_show.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/netlink_flags.h: $(top_srcdir)/xlat/netlink_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netlink_get_flags.h: $(top_srcdir)/xlat/netlink_get_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netlink_new_flags.h: $(top_srcdir)/xlat/netlink_new_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/netlink_protocols.h: $(top_srcdir)/xlat/netlink_protocols.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netlink_sk_meminfo_indices.h: $(top_srcdir)/xlat/netlink_sk_meminfo_indices.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netlink_socket_flags.h: $(top_srcdir)/xlat/netlink_socket_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netlink_states.h: $(top_srcdir)/xlat/netlink_states.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/netlink_types.h: $(top_srcdir)/xlat/netlink_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nf_acct_msg_types.h: $(top_srcdir)/xlat/nf_acct_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nf_cthelper_msg_types.h: $(top_srcdir)/xlat/nf_cthelper_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nf_ctnetlink_exp_msg_types.h: $(top_srcdir)/xlat/nf_ctnetlink_exp_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nf_ctnetlink_msg_types.h: $(top_srcdir)/xlat/nf_ctnetlink_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nf_cttimeout_msg_types.h: $(top_srcdir)/xlat/nf_cttimeout_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nf_ipset_msg_types.h: $(top_srcdir)/xlat/nf_ipset_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nf_nft_compat_msg_types.h: $(top_srcdir)/xlat/nf_nft_compat_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nf_nftables_msg_types.h: $(top_srcdir)/xlat/nf_nftables_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nf_osf_msg_types.h: $(top_srcdir)/xlat/nf_osf_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nf_queue_msg_types.h: $(top_srcdir)/xlat/nf_queue_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nf_ulog_msg_types.h: $(top_srcdir)/xlat/nf_ulog_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nfc_protocols.h: $(top_srcdir)/xlat/nfc_protocols.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nl_audit_types.h: $(top_srcdir)/xlat/nl_audit_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nl_crypto_types.h: $(top_srcdir)/xlat/nl_crypto_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nl_netfilter_msg_types.h: $(top_srcdir)/xlat/nl_netfilter_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nl_netfilter_subsys_ids.h: $(top_srcdir)/xlat/nl_netfilter_subsys_ids.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nl_route_types.h: $(top_srcdir)/xlat/nl_route_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nl_selinux_types.h: $(top_srcdir)/xlat/nl_selinux_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nl_sock_diag_types.h: $(top_srcdir)/xlat/nl_sock_diag_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nl_xfrm_types.h: $(top_srcdir)/xlat/nl_xfrm_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nlmsgerr_attrs.h: $(top_srcdir)/xlat/nlmsgerr_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/notifyflags.h: $(top_srcdir)/xlat/notifyflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/nt_descriptor_types.h: $(top_srcdir)/xlat/nt_descriptor_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/numa_node.h: $(top_srcdir)/xlat/numa_node.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/open_access_modes.h: $(top_srcdir)/xlat/open_access_modes.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/open_mode_flags.h: $(top_srcdir)/xlat/open_mode_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/openmodessol.h: $(top_srcdir)/xlat/openmodessol.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/packet_diag_attrs.h: $(top_srcdir)/xlat/packet_diag_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/packet_diag_info_flags.h: $(top_srcdir)/xlat/packet_diag_info_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/packet_diag_show.h: $(top_srcdir)/xlat/packet_diag_show.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/packet_mreq_type.h: $(top_srcdir)/xlat/packet_mreq_type.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ @@ -6154,6 +8923,10 @@ $(top_srcdir)/xlat/perf_hw_cache_op_result_id.h: $(top_srcdir)/xlat/perf_hw_cach $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/perf_hw_id.h: $(top_srcdir)/xlat/perf_hw_id.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/perf_ioctl_cmds.h: $(top_srcdir)/xlat/perf_ioctl_cmds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/perf_ioctl_flags.h: $(top_srcdir)/xlat/perf_ioctl_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/perf_sw_ids.h: $(top_srcdir)/xlat/perf_sw_ids.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/perf_type_id.h: $(top_srcdir)/xlat/perf_type_id.in $(top_srcdir)/xlat/gen.sh @@ -6162,6 +8935,8 @@ $(top_srcdir)/xlat/personality_flags.h: $(top_srcdir)/xlat/personality_flags.in $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/personality_types.h: $(top_srcdir)/xlat/personality_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/phonet_protocols.h: $(top_srcdir)/xlat/phonet_protocols.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/pkey_access.h: $(top_srcdir)/xlat/pkey_access.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/policies.h: $(top_srcdir)/xlat/policies.in $(top_srcdir)/xlat/gen.sh @@ -6180,6 +8955,14 @@ $(top_srcdir)/xlat/pr_mce_kill_policy.h: $(top_srcdir)/xlat/pr_mce_kill_policy.i $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/pr_set_mm.h: $(top_srcdir)/xlat/pr_set_mm.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_spec_cmds.h: $(top_srcdir)/xlat/pr_spec_cmds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_spec_get_store_bypass_flags.h: $(top_srcdir)/xlat/pr_spec_get_store_bypass_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_spec_set_store_bypass_flags.h: $(top_srcdir)/xlat/pr_spec_set_store_bypass_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_sve_vl_flags.h: $(top_srcdir)/xlat/pr_sve_vl_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/pr_tsc.h: $(top_srcdir)/xlat/pr_tsc.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/pr_unalign_flags.h: $(top_srcdir)/xlat/pr_unalign_flags.in $(top_srcdir)/xlat/gen.sh @@ -6198,20 +8981,110 @@ $(top_srcdir)/xlat/ptrace_peeksiginfo_flags.h: $(top_srcdir)/xlat/ptrace_peeksig $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/ptrace_setoptions_flags.h: $(top_srcdir)/xlat/ptrace_setoptions_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ptrace_syscall_info_op.h: $(top_srcdir)/xlat/ptrace_syscall_info_op.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/quota_formats.h: $(top_srcdir)/xlat/quota_formats.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/quotacmds.h: $(top_srcdir)/xlat/quotacmds.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/quotatypes.h: $(top_srcdir)/xlat/quotatypes.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/random_ioctl_cmds.h: $(top_srcdir)/xlat/random_ioctl_cmds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/rename_flags.h: $(top_srcdir)/xlat/rename_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/resource_flags.h: $(top_srcdir)/xlat/resource_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/resources.h: $(top_srcdir)/xlat/resources.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/riscv_flush_icache_flags.h: $(top_srcdir)/xlat/riscv_flush_icache_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/route_nexthop_flags.h: $(top_srcdir)/xlat/route_nexthop_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/routing_flags.h: $(top_srcdir)/xlat/routing_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/routing_protocols.h: $(top_srcdir)/xlat/routing_protocols.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/routing_scopes.h: $(top_srcdir)/xlat/routing_scopes.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/routing_table_ids.h: $(top_srcdir)/xlat/routing_table_ids.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/routing_types.h: $(top_srcdir)/xlat/routing_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_addr_attrs.h: $(top_srcdir)/xlat/rtnl_addr_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_addrlabel_attrs.h: $(top_srcdir)/xlat/rtnl_addrlabel_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_dcb_attrs.h: $(top_srcdir)/xlat/rtnl_dcb_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_ifla_af_spec_inet6_attrs.h: $(top_srcdir)/xlat/rtnl_ifla_af_spec_inet6_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_ifla_af_spec_inet_attrs.h: $(top_srcdir)/xlat/rtnl_ifla_af_spec_inet_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_ifla_brport_attrs.h: $(top_srcdir)/xlat/rtnl_ifla_brport_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_ifla_events.h: $(top_srcdir)/xlat/rtnl_ifla_events.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_ifla_info_attrs.h: $(top_srcdir)/xlat/rtnl_ifla_info_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_ifla_info_data_bridge_attrs.h: $(top_srcdir)/xlat/rtnl_ifla_info_data_bridge_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_ifla_info_data_tun_attrs.h: $(top_srcdir)/xlat/rtnl_ifla_info_data_tun_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_ifla_port_attrs.h: $(top_srcdir)/xlat/rtnl_ifla_port_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_ifla_vf_port_attrs.h: $(top_srcdir)/xlat/rtnl_ifla_vf_port_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_ifla_xdp_attached_mode.h: $(top_srcdir)/xlat/rtnl_ifla_xdp_attached_mode.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_ifla_xdp_attrs.h: $(top_srcdir)/xlat/rtnl_ifla_xdp_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_link_attrs.h: $(top_srcdir)/xlat/rtnl_link_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_mdb_attrs.h: $(top_srcdir)/xlat/rtnl_mdb_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_mdba_mdb_attrs.h: $(top_srcdir)/xlat/rtnl_mdba_mdb_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_mdba_mdb_eattr_attrs.h: $(top_srcdir)/xlat/rtnl_mdba_mdb_eattr_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_mdba_mdb_entry_attrs.h: $(top_srcdir)/xlat/rtnl_mdba_mdb_entry_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_mdba_router_attrs.h: $(top_srcdir)/xlat/rtnl_mdba_router_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_mdba_router_pattr_attrs.h: $(top_srcdir)/xlat/rtnl_mdba_router_pattr_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_neigh_attrs.h: $(top_srcdir)/xlat/rtnl_neigh_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_neightbl_attrs.h: $(top_srcdir)/xlat/rtnl_neightbl_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_neightbl_parms_attrs.h: $(top_srcdir)/xlat/rtnl_neightbl_parms_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_netconf_attrs.h: $(top_srcdir)/xlat/rtnl_netconf_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_nsid_attrs.h: $(top_srcdir)/xlat/rtnl_nsid_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_route_attrs.h: $(top_srcdir)/xlat/rtnl_route_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_rta_metrics_attrs.h: $(top_srcdir)/xlat/rtnl_rta_metrics_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_rule_attrs.h: $(top_srcdir)/xlat/rtnl_rule_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_tc_action_attrs.h: $(top_srcdir)/xlat/rtnl_tc_action_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_tc_attrs.h: $(top_srcdir)/xlat/rtnl_tc_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_tca_stab_attrs.h: $(top_srcdir)/xlat/rtnl_tca_stab_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_tca_stats_attrs.h: $(top_srcdir)/xlat/rtnl_tca_stats_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/rwf_flags.h: $(top_srcdir)/xlat/rwf_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/s390_guarded_storage_commands.h: $(top_srcdir)/xlat/s390_guarded_storage_commands.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/s390_runtime_instr_commands.h: $(top_srcdir)/xlat/s390_runtime_instr_commands.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/s390_sthyi_function_codes.h: $(top_srcdir)/xlat/s390_sthyi_function_codes.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/sa_handler_values.h: $(top_srcdir)/xlat/sa_handler_values.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/sched_flags.h: $(top_srcdir)/xlat/sched_flags.in $(top_srcdir)/xlat/gen.sh @@ -6238,9 +9111,11 @@ $(top_srcdir)/xlat/semop_flags.h: $(top_srcdir)/xlat/semop_flags.in $(top_srcdir $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/setns_types.h: $(top_srcdir)/xlat/setns_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/setsockipoptions.h: $(top_srcdir)/xlat/setsockipoptions.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/setsock_ip_options.h: $(top_srcdir)/xlat/setsock_ip_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/setsock_ipv6_options.h: $(top_srcdir)/xlat/setsock_ipv6_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/setsockipv6options.h: $(top_srcdir)/xlat/setsockipv6options.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/setsock_options.h: $(top_srcdir)/xlat/setsock_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/sfd_flags.h: $(top_srcdir)/xlat/sfd_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ @@ -6290,36 +9165,104 @@ $(top_srcdir)/xlat/sigsys_codes.h: $(top_srcdir)/xlat/sigsys_codes.in $(top_srcd $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/sigtrap_codes.h: $(top_srcdir)/xlat/sigtrap_codes.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/sock_type_flags.h: $(top_srcdir)/xlat/sock_type_flags.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/skf_ad.h: $(top_srcdir)/xlat/skf_ad.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/socketcalls.h: $(top_srcdir)/xlat/socketcalls.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/skf_off.h: $(top_srcdir)/xlat/skf_off.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/socketlayers.h: $(top_srcdir)/xlat/socketlayers.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/smc_decl_codes.h: $(top_srcdir)/xlat/smc_decl_codes.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/sockipoptions.h: $(top_srcdir)/xlat/sockipoptions.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/smc_diag_attrs.h: $(top_srcdir)/xlat/smc_diag_attrs.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/sockipv6options.h: $(top_srcdir)/xlat/sockipv6options.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/smc_diag_extended_flags.h: $(top_srcdir)/xlat/smc_diag_extended_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/sockipxoptions.h: $(top_srcdir)/xlat/sockipxoptions.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/smc_diag_mode.h: $(top_srcdir)/xlat/smc_diag_mode.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/sockoptions.h: $(top_srcdir)/xlat/sockoptions.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/smc_link_group_roles.h: $(top_srcdir)/xlat/smc_link_group_roles.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/sockpacketoptions.h: $(top_srcdir)/xlat/sockpacketoptions.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/smc_protocols.h: $(top_srcdir)/xlat/smc_protocols.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/sockrawoptions.h: $(top_srcdir)/xlat/sockrawoptions.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/smc_states.h: $(top_srcdir)/xlat/smc_states.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/socksctpoptions.h: $(top_srcdir)/xlat/socksctpoptions.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/snmp_icmp6_stats.h: $(top_srcdir)/xlat/snmp_icmp6_stats.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/socktcpoptions.h: $(top_srcdir)/xlat/socktcpoptions.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/snmp_ip_stats.h: $(top_srcdir)/xlat/snmp_ip_stats.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_alg_options.h: $(top_srcdir)/xlat/sock_alg_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_ax25_options.h: $(top_srcdir)/xlat/sock_ax25_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_bluetooth_options.h: $(top_srcdir)/xlat/sock_bluetooth_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_caif_options.h: $(top_srcdir)/xlat/sock_caif_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_dccp_options.h: $(top_srcdir)/xlat/sock_dccp_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_ip_options.h: $(top_srcdir)/xlat/sock_ip_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_ipv6_options.h: $(top_srcdir)/xlat/sock_ipv6_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_ipx_options.h: $(top_srcdir)/xlat/sock_ipx_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_irda_options.h: $(top_srcdir)/xlat/sock_irda_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_iucv_options.h: $(top_srcdir)/xlat/sock_iucv_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_kcm_options.h: $(top_srcdir)/xlat/sock_kcm_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_llc_options.h: $(top_srcdir)/xlat/sock_llc_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_netlink_options.h: $(top_srcdir)/xlat/sock_netlink_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_nfcllcp_options.h: $(top_srcdir)/xlat/sock_nfcllcp_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_options.h: $(top_srcdir)/xlat/sock_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_packet_options.h: $(top_srcdir)/xlat/sock_packet_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_pnp_options.h: $(top_srcdir)/xlat/sock_pnp_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_pppol2tp_options.h: $(top_srcdir)/xlat/sock_pppol2tp_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_raw_options.h: $(top_srcdir)/xlat/sock_raw_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_rds_options.h: $(top_srcdir)/xlat/sock_rds_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_rxrpc_options.h: $(top_srcdir)/xlat/sock_rxrpc_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_sctp_options.h: $(top_srcdir)/xlat/sock_sctp_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_shutdown_flags.h: $(top_srcdir)/xlat/sock_shutdown_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_tcp_options.h: $(top_srcdir)/xlat/sock_tcp_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_tipc_options.h: $(top_srcdir)/xlat/sock_tipc_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_tls_options.h: $(top_srcdir)/xlat/sock_tls_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_type_flags.h: $(top_srcdir)/xlat/sock_type_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_udp_options.h: $(top_srcdir)/xlat/sock_udp_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_xdp_options.h: $(top_srcdir)/xlat/sock_xdp_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/socketcalls.h: $(top_srcdir)/xlat/socketcalls.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/socketlayers.h: $(top_srcdir)/xlat/socketlayers.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/socktypes.h: $(top_srcdir)/xlat/socktypes.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sparc_kern_features.h: $(top_srcdir)/xlat/sparc_kern_features.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/splice_flags.h: $(top_srcdir)/xlat/splice_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/sram_alloc_flags.h: $(top_srcdir)/xlat/sram_alloc_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/statfs_flags.h: $(top_srcdir)/xlat/statfs_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/statx_attrs.h: $(top_srcdir)/xlat/statx_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/statx_masks.h: $(top_srcdir)/xlat/statx_masks.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/swap_flags.h: $(top_srcdir)/xlat/swap_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/sync_file_range_flags.h: $(top_srcdir)/xlat/sync_file_range_flags.in $(top_srcdir)/xlat/gen.sh @@ -6352,14 +9295,22 @@ $(top_srcdir)/xlat/sysmips_operations.h: $(top_srcdir)/xlat/sysmips_operations.i $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/tcflsh_options.h: $(top_srcdir)/xlat/tcflsh_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/tcp_state_flags.h: $(top_srcdir)/xlat/tcp_state_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/tcp_states.h: $(top_srcdir)/xlat/tcp_states.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/tcxonc_options.h: $(top_srcdir)/xlat/tcxonc_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/timerfdflags.h: $(top_srcdir)/xlat/timerfdflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/tun_device_types.h: $(top_srcdir)/xlat/tun_device_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/ubi_volume_props.h: $(top_srcdir)/xlat/ubi_volume_props.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/ubi_volume_types.h: $(top_srcdir)/xlat/ubi_volume_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/uffd_api_features.h: $(top_srcdir)/xlat/uffd_api_features.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/uffd_api_flags.h: $(top_srcdir)/xlat/uffd_api_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/uffd_copy_flags.h: $(top_srcdir)/xlat/uffd_copy_flags.in $(top_srcdir)/xlat/gen.sh @@ -6374,8 +9325,18 @@ $(top_srcdir)/xlat/uffd_zeropage_flags.h: $(top_srcdir)/xlat/uffd_zeropage_flags $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/umount_flags.h: $(top_srcdir)/xlat/umount_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/unix_diag_attrs.h: $(top_srcdir)/xlat/unix_diag_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/unix_diag_show.h: $(top_srcdir)/xlat/unix_diag_show.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/unshare_flags.h: $(top_srcdir)/xlat/unshare_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/uring_enter_flags.h: $(top_srcdir)/xlat/uring_enter_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/uring_register_opcodes.h: $(top_srcdir)/xlat/uring_register_opcodes.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/uring_setup_flags.h: $(top_srcdir)/xlat/uring_setup_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/usagewho.h: $(top_srcdir)/xlat/usagewho.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/v4l2_buf_flags.h: $(top_srcdir)/xlat/v4l2_buf_flags.in $(top_srcdir)/xlat/gen.sh @@ -6390,6 +9351,8 @@ $(top_srcdir)/xlat/v4l2_control_classes.h: $(top_srcdir)/xlat/v4l2_control_class $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/v4l2_control_flags.h: $(top_srcdir)/xlat/v4l2_control_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_control_id_bases.h: $(top_srcdir)/xlat/v4l2_control_id_bases.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/v4l2_control_ids.h: $(top_srcdir)/xlat/v4l2_control_ids.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/v4l2_control_types.h: $(top_srcdir)/xlat/v4l2_control_types.in $(top_srcdir)/xlat/gen.sh @@ -6408,8 +9371,24 @@ $(top_srcdir)/xlat/v4l2_input_types.h: $(top_srcdir)/xlat/v4l2_input_types.in $( $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/v4l2_memories.h: $(top_srcdir)/xlat/v4l2_memories.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_pix_fmts.h: $(top_srcdir)/xlat/v4l2_pix_fmts.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_sdr_fmts.h: $(top_srcdir)/xlat/v4l2_sdr_fmts.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_sliced_flags.h: $(top_srcdir)/xlat/v4l2_sliced_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/v4l2_streaming_capabilities.h: $(top_srcdir)/xlat/v4l2_streaming_capabilities.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_tuner_audmodes.h: $(top_srcdir)/xlat/v4l2_tuner_audmodes.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_tuner_capabilities.h: $(top_srcdir)/xlat/v4l2_tuner_capabilities.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_tuner_rxsubchanses.h: $(top_srcdir)/xlat/v4l2_tuner_rxsubchanses.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_tuner_types.h: $(top_srcdir)/xlat/v4l2_tuner_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_vbi_flags.h: $(top_srcdir)/xlat/v4l2_vbi_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/wait4_options.h: $(top_srcdir)/xlat/wait4_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/waitid_types.h: $(top_srcdir)/xlat/waitid_types.in $(top_srcdir)/xlat/gen.sh @@ -6418,6 +9397,8 @@ $(top_srcdir)/xlat/whence_codes.h: $(top_srcdir)/xlat/whence_codes.in $(top_srcd $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/xattrflags.h: $(top_srcdir)/xlat/xattrflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/xdp_flags.h: $(top_srcdir)/xlat/xdp_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/xfs_dqblk_flags.h: $(top_srcdir)/xlat/xfs_dqblk_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/xfs_quota_flags.h: $(top_srcdir)/xlat/xfs_quota_flags.in $(top_srcdir)/xlat/gen.sh @@ -6435,17 +9416,24 @@ srpm: dist-xz $(srcdir)/.version: $(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@ -sys_func.h: $(patsubst %,$(srcdir)/%,$(strace_SOURCES_c)) +bpf_attr_check.c: $(srcdir)/bpf_attr.h $(srcdir)/gen_bpf_attr_check.sh + D="$(D)" \ + $(srcdir)/gen_bpf_attr_check.sh $< > $@-t && mv $@-t $@ + +sys_func.h: $(patsubst %,$(srcdir)/%,$(sys_func_h_sources)) for f in $^; do \ sed -n 's/^SYS_FUNC(.*/extern &;/p' $$f; \ done | sort -u > $@ sen.h: $(patsubst %,$(srcdir)/%,$(syscallent_files)) for f in $^; do cat -- $$f; done | \ + D="$(D)" \ $(srcdir)/generate_sen.sh > $@ dist-hook: $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version + ${AM_V_GEN}echo $(COPYRIGHT_YEAR) > $(distdir)/.year + ${AM_V_GEN}echo $(MANPAGE_DATE) > $(distdir)/.strace.1.in.date news-check: NEWS $(AM_V_GEN)if head -1 $< | \ @@ -6485,8 +9473,8 @@ ioctlsort%.o: ioctls_all%.h ioctl_iocdef.h $(srcdir)/ioctlsort.c ioctls_all%.h: $(srcdir)/$(OS)/$(ARCH)/ioctls_inc%.h $(srcdir)/$(OS)/$(ARCH)/ioctls_arch%.h cat $^ > $@ -syscallent.i: $(top_srcdir)/$(OS)/$(ARCH)/syscallent.h - $(CPP) -P $(SCNO_CPPFLAGS) $^ -o $@ +syscallent.i: $(top_builddir)/config.h $(top_srcdir)/$(OS)/$(ARCH)/syscallent.h + $(CPP) -P $(SCNO_CPPFLAGS) -include $^ -o $@ scno.h: $(top_srcdir)/scno.head syscallent.i echo '/* Generated by Makefile from $^; do not edit. */' > $@-t @@ -6500,9 +9488,13 @@ $(strace_OBJECTS): scno.h mpers-m%.stamp: $(srcdir_mpers_source_files) | printers.h for f in $^; do \ - CC="$(CC)" CFLAGS="$(mpers_sh_opts) -DMPERS_IS_$(mpers_NAME)" \ - CPP="$(CPP)" CPPFLAGS="$(mpers_sh_opts) -DIN_MPERS -DMPERS_IS_$(mpers_NAME)" \ - $(srcdir)/mpers.sh -$(mpers_NAME) $$f || exit; \ + D="$(D)" \ + READELF="$(READELF)" \ + CC="$(CC)" \ + CFLAGS="$(mpers_sh_opts) -DMPERS_IS_$(mpers_NAME)" \ + CPP="$(CPP)" \ + CPPFLAGS="$(mpers_sh_opts) -DIN_MPERS -DMPERS_IS_$(mpers_NAME)" \ + $(srcdir)/mpers.sh $(mpers_NAME) $(mpers_CC_FLAGS) $$f || exit; \ done > $@ @@ -6559,8 +9551,10 @@ printers.h: $(mpers_preproc_files) native_printer_decls.h native_printer_defs.h: mpers_PREFIX = @HAVE_M32_MPERS_TRUE@$(mpers_m32_targets): mpers_NAME = m32 +@HAVE_M32_MPERS_TRUE@$(mpers_m32_targets): mpers_CC_FLAGS = @cc_flags_m32@ @HAVE_MX32_MPERS_TRUE@$(mpers_mx32_targets): mpers_NAME = mx32 +@HAVE_MX32_MPERS_TRUE@$(mpers_mx32_targets): mpers_CC_FLAGS = @cc_flags_mx32@ clean-local: -rm -rf mpers-m32 mpers-mx32 @@ -6579,12 +9573,13 @@ clean-local: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(srcdir)/.version @MAINTAINER_MODE_TRUE@ $(AM_V_GEN) \ @MAINTAINER_MODE_TRUE@ ( \ +@MAINTAINER_MODE_TRUE@ D="$(D)"; \ +@MAINTAINER_MODE_TRUE@ export D; \ @MAINTAINER_MODE_TRUE@ cd $(srcdir); \ @MAINTAINER_MODE_TRUE@ sed '/^##/,$$d' CREDITS.in; \ -@MAINTAINER_MODE_TRUE@ { sed -n '1,/^##>/d; s/ */\t/; s/^./&/p' CREDITS.in; \ -@MAINTAINER_MODE_TRUE@ git log --pretty=format:'%aN %aE'; \ -@MAINTAINER_MODE_TRUE@ } | LC_ALL=C sort -u \ -@MAINTAINER_MODE_TRUE@ | awk -F'\t' '{printf("\t%s <%s>\n",$$1,$$2)}'; \ +@MAINTAINER_MODE_TRUE@ sed -n '1,/^##>/d; s/ */\t/; s/^./&/p' CREDITS.in \ +@MAINTAINER_MODE_TRUE@ | maint/gen-contributors-list.sh - -e HEAD --initial \ +@MAINTAINER_MODE_TRUE@ | sed 's/\t/ /g; s/^/\t/' \ @MAINTAINER_MODE_TRUE@ ) > $@-t && mv $@-t $@ @MAINTAINER_MODE_TRUE@export TAR_OPTIONS = --owner=0 --group=0 --numeric-owner --mode=go-w,go+rX diff --git a/NEWS b/NEWS index e5d01a36..0e5bfa26 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,512 @@ +Noteworthy changes in release 5.1 (2019-05-22) +============================================== + +* Bug fixes + * Fixed decoding of last two arguments of clone syscall on riscv. + +* Improvements + * Added C-SKY architecture support. + * Implemented decoding of SO_TIMESTAMP*_NEW control messages. + * Implemented decoding of clock_gettime64, clock_settime64, clock_adjtime64, + clock_getres_time64, clock_nanosleep_time64, timer_gettime64, + timer_settime64, timerfd_gettime64, timerfd_settime64, utimensat_time64, + pselect6_time64, ppoll_time64, io_pgetevents_time64, recvmmsg_time64, + mq_timedsend_time64, mq_timedreceive_time64, semtimedop_time64, + rt_sigtimedwait_time64, futex_time64, sched_rr_get_interval_time64, + pidfd_send_signal, io_uring_setup, io_uring_enter, and io_uring_register + syscalls. + * Enhanced decoding of bpf syscall. + * Wired up getegid, geteuid, getppid, io_pgetevents, statfs64, and fstatfs64 + syscalls on alpha. + * Wired up kexec_file_load and migrate_pages syscalls on arm. + * Wired up io_pgetevents, perf_event_open, seccomp, and statx syscalls + on ia64. + * Wired up seccomp syscall on m68k. + * Wired up statx syscall on sh. + * Wired up pkey_mprotect, pkey_alloc, and pkey_free syscalls on alpha, hppa, + ia64, m68k, s390, s390x, sh, sparc, and sparc64. + * Wired up rseq syscall on alpha, hppa, ia64, m68k, sh, sparc, sparc64, + and xtensa. + * Wired up direct ipc syscalls on m68k, mips o32, powerpc, powerpc64, + s390, s390x, sh, sparc, sparc64, and x86. + * Updated lists of BPF_*, FAN_*, F_SEAL_*, IPV6_*, NT_*, PR_SPEC_*, SO_*, + and V4L2_* constants. + * Updated lists of ioctl commands from Linux 5.1. + +Noteworthy changes in release 5.0 (2019-03-19) +============================================== + +* Changes in behavior + * -D option now implies -I4: by default strace ignores SIGHUP, SIGINT, + SIGQUIT, SIGPIPE, SIGTERM, SIGTTIN, SIGTTOU, and SIGTSTP when -D option + is used. + * Diagnostic message is no longer printed if an attempt to restart a process + has failed with ESRCH. (Addresses RHBZ bug #1662936.) + * ASCII dump no longer tries to read the whole buffer at once. As result, + it can fail with a diagnostic message after dumping only a part. + Amount of preceding zeroes printed for offset is now chosen in a way + to accommodate all the digits of all the offsets being printed. + +* Improvements + * Changed the way tracees are handled: all pending tracees are now waited for + before further processing, this improves fairness of tracee processing. + (Addresses RHBZ bugs #478419, #526740, #851457, #1609318, #1610774, + and maybe some others.) + * Enhanced xlat styles support configured by -X option. + * Enhanced decoding of bpf syscall. + * Enhanced decoding of PTRACE_PEEKUSER and PTRACE_POKEUSER on hppa. + * Enhanced pid formatting in strace-log-merge output. + * Wired up kexec_file_load and rseq syscalls on aarch64, arc, metag, nios2, + or1k, riscv, and tile architectures. + * Updated lists of BPF_*, BTRFS_*, FAN_*, IFLA_*, KERN_*, KVM_CAP_*, NDA_*, + NETNSA_*, NT_*, PR_*, REL_*, SECCOMP_*, SCTP_*, UDP_*, V4L2_*, and *_MAGIC + constants. + * Updated lists of ioctl commands from Linux 5.0. + +* Bug fixes + * Fixed ordering of sockaddr_in6 fields. + * Fixed strace-k test on alpha. + * Fixed build on mips o32. + * Fixed build on NOMMU architectures. + * Fixed build in --with-libiberty=yes mode. + * Fixed potential NULL dereference during printing of line continuation + for syscalls that haven't been decoded. + * Fixed strace-log-merge error diagnostics. + +Noteworthy changes in release 4.26 (2018-12-26) +=============================================== + +* License + * The test suite is now provided under the terms of + the GNU General Public License version 2 or later. + * All the rest of strace is now provided under the terms of + the GNU Lesser General Public License version 2.1 or later. + +* Changes in behavior + * If strace is interrupted by a signal it handles (currently + one of HUP, INT, QUIT, PIPE, or TERM), strace terminates + itself with this signal. + +* Improvements + * Implemented obtainment of system call information using + PTRACE_GET_SYSCALL_INFO ptrace API. + * Implemented decoding of PTRACE_GET_SYSCALL_INFO ptrace request. + * Implemented decoding of BLKGETZONESZ, BLKGETNRZONES, and RND* ioctl + commands. + * Enhanced xlat styles support configured by -X option. + * Enhanced internet address formatting in structureless contexts. + * Enhanced decoding of getsockopt SO_ERROR option. + * Enhanced error diagnostics when the first exec fails. + * Added %net as a short form of %network in syscall specifications. + * Updated lists of ABS_*, BPF_*, FAN_*, IFA_*, IFLA_*, KVM_CAP_*, NETLINK_*, + NTF_*, PR_SPEC_*, REL_*, SOL_*, TCA_*, and V4L2_* constants. + * Updated lists of ioctl commands from Linux 4.20. + * Enhanced manual page. + +* Bug fixes + * Fixed "xlat_idx: Unexpected xlat value 0" warnings. + * Fixed sthyi output format on s390. + * Documented -X option in strace -h output. + +Noteworthy changes in release 4.25 (2018-10-30) +=============================================== + +* Improvements + * Implemented decoding of KVM_CHECK_EXTENSION and NBD_* ioctl commands. + * Implemented decoding of SOL_XDP socket option names. + * Implemented decoding of AF_PACKET protocols in socket syscall. + * Implemented decoding of AF_AX25 and AF_X25 addresses, protocols, + and options. + * Implemented stack trace printing on receiving signals. + * Enhanced xlat styles support configured by -X option. + * Enhanced decoding of IFLA_*, NETCONFA_*, and SMC_DIAG_* netlink attributes. + * Wired up io_pgetevents syscall on arm, sparc, and sparc64. + * Updated lists of AF_*, AUDIT_*, BPF_*, IFLA_*, IN_*, IPSTATS_*, + IPV4_DEVCONF_*, NT_*, SCTP_*, SO_*, SOCK_*, SOL_*, and V4L2_* constants. + * Updated lists of ioctl commands from Linux 4.19. + +* Bug fixes + * Fixed decoding of bit sets in evdev ioctl commands. + * Fixed decoding of EVIOCGBIT(0, ...) ioctl commands. + * Fixed test suite for the case when mlockall and unimplemented syscalls + are explicitly disabled by a seccomp filter. + +Noteworthy changes in release 4.24 (2018-08-14) +=============================================== + +* Improvements + * Implemented decoding of kvm vcpu exit reason (-e kvm=vcpu option), + requires Linux kernel version 4.16.0 or higher. + * Implemented decoding of KVM_SET_CPUID2 and KVM_GET_*_CPUID ioctl commands. + * Enhanced decoding of corner cases of SO_LINGER, SO_PEERCRED, + and PACKET_STATISTICS getsockopt options. + * Wired up io_pgetevents and rseq syscalls on hppa, microblaze, mips, powerpc, + and s390. + * Updated lists of AUDIT_*, BPF_*, IFA_*, IFLA_*, RTA_*, RTPROT_*, TCP_*, + TRAP_*, and UDP_* constants. + * Updated lists of ioctl commands from Linux 4.18. + +* Bug fixes + * Fixed decoding of Q_XGETQSTAT on non-native personalities. + * Fixed race condition in aio test. + * Fixed build with Bionic libc. + * Fixed build with glibc-2.28. + * Fixed build in exotic systemd-nspawn based environments. + * Fixed build on s390 with kernel headers that do not contain Linux commit + v3.10-rc1~201^2~11. + +Noteworthy changes in release 4.23 (2018-06-14) +=============================================== + +* Changes in behaviour + * On x32 personality, 64-bit syscalls (such as readv) are now shown with "#64" + suffix instead of "64:" prefix. Unlike the old names, these new names + can be used in syscall qualification expressions. + * Changed error number output format: error numbers are consistently + printed as "-1 ECONST (Error description)" + for known errors and as "-1 (errno 123)" for unknown errors, + regardless of -e raw qualification settings. One can specify + -X raw for displaying raw error numbers unconditionally. + * Unfetchable addresses inside arrays are now printed as comments. + * Obsolete IA-32 mode syscall names are no longer printed on ia64. + +* Improvements + * Implemented libdw backend for -k option, configured at build time + using --with-libdw option. + Whether -k option is compiled is now configured at build time + using --enable-stacktrace option. + * Added -X option for configuring xlat output formatting (addresses + Debian bug #692915). + * Added support for personality designation ("64", "32", or "x32") to syscall + qualifications in -e trace expressions. + * Implemented injection of syscalls with no side effects as an alternative + to injection of an invalid syscall (-e inject=SET:syscall= expression). + * Improved support for reproducible builds (addresses Debian bug #896016). + * Implemented decoding of BPF_PROG_QUERY and BPF_RAW_TRACEPOINT_OPEN bpf + syscall commands. + * Implemented decoding of INOTIFY_IOC_SETNEXTWD and PERF_EVENT_IOC_* ioctl + commands. + * Implemented decoding of PR_GET_SPECULATION_CTRL and PR_SET_SPECULATION_CTRL + prctl syscall options. + * Enhanced decoding of bpf, getsockopt, setsockopt, and socket syscalls. + * Enhanced decoding of NETLINK_KOBJECT_UEVENT and NETLINK_ROUTE protocols. + * Enhanced decoding of *_DIAG_MEMINFO netlink attributes. + * Enhanced decoding of BTRFS_*, FS_IOC_*, SIOCGIFHWADDR, and SIOCSIFHWADDR + ioctl commands. + * Enhanced decoding of AF_BLUETOOTH socket addresses. + * Implemented decoding of io_pgetevent syscall. + * Wired up rseq syscall. + * Updated lists of ADJ_*, BPF_*, BPF_F_*, BPF_PROG_TYPE_*, ETH_P_*, FPE_*, + IFF_*, IPPROTO_*, MAP_*, MS_*, MSG_*, NETLINK_*, PACKET_*, PROT_*, SCTP_*, + SECCOMP_FILTER_FLAG_*, SEGV_*, SEM_*, SHM_*, SW_*, V4L2_CID_*, + V4L2_CTRL_CLASS_*, and V4L2_PIX_FMT_* constants. + * Updated lists of ioctl commands from Linux 4.17. + +* Bug fixes + * Fixed decoding of msgtyp argument of msgrcv syscall. + * Fixed fallback definitions for F_*, MCL_*, MSG_ZEROCOPY, SI_*, + and SOL_SOCKET constants. + * Fixed -e trace=%pure expression on mips. + +Noteworthy changes in release 4.22 (2018-04-05) +=============================================== + +* Changes in infrastructure + * The mailing list was moved to strace-devel@lists.strace.io. + * SourceForge git repository + (https://sourceforge.net/p/strace/code/ci/master/tree/) is no longer + maintained. Please use GitLab (https://gitlab.com/strace/strace/) + or GitHub (https://github.com/strace/strace/) repository instead. + +* Changes in behaviour + * When printing string data, '8' and '9' following an octal escape sequence + no longer lead to unabbreviated octal escape sequence output, as they used + to do. + * Angle brackets are now printed as octal number escape sequences + in the output of paths associated with file descriptors. + * Data dump for write syscalls (-e write) is performed regardless + of successfulness of these syscall (addresses Debian bug #436284). + * -r and -t options are now affect output independently. Previously, + -r option led to ignoring of the -t option (addresses Debian bug #466195). + +* Improvements + * Implemented delay injection (-e inject=SET:delay_enter= and + -e inject=SET:delay_exit= options). + * Added -A option for opening output files in append mode + (addresses Debian bug #528488). + * IPv6 addresses shown in socket information in -yy mode are now printed + in brackets. + * Enhanced decoding of bpf, prctl and ptrace syscalls. + * Enhanced decoding of BTRFS_IOC_INO_PATHS, BTRFS_IOC_LOGICAL_INO, and PTP_* + ioctl commands. + * Enhanced NETLINK_ROUTE protocol decoding. + * Updated lists of signal codes. + * Updated lists of BPF_*, BTN_*, ETH_P_*, INET_DIAG_BC_*, KEY_*, POLL*, RWF_*, + SCHED_FLAG_*, SCTP_* and error constants. + * Implemented block/character device number printing in -yy mode. + * Known pixel/SDR format names are printed as comments for pixelformat fields + in v4l2 structures. + * Enhanced decoding of kern_features syscall. + * Enhanced NETLINK_NETFILTER netlink protocol decoder. + * Optimized handling of large number of tracees. + * Improved wall clock time measurement in syscall count statistics + (-c -w option). + * Extended the range of allowed values in -e inject=...:retval= expression. + * Added i18n support. + * Updated lists of ioctl commands from Linux 4.16. + * Enhanced manual page. + +* Bug fixes + * Fixed build on m68k. + * Fixed v4l2 pixelformat decoding on big-endian architectures. + * Fixed -O option. + +Noteworthy changes in release 4.21 (2018-02-13) +=============================================== + +* Changes in behaviour + * Warning is now issued when -F option is used. + * Warning is now issued when a tracee with unsupported personality + is attached. + * Unknown syscall numbers are now printed in hexadecimal form. + +* Improvements + * Implemented decoding of netlink descriptor attributes as file descriptors. + * Implemented decoding of hugetlb page size selection flags. + * Implemented decoding of BPF_PROG_TEST_RUN, BPF_PROG_GET_NEXT_ID, + BPF_MAP_GET_NEXT_ID, BPF_PROG_GET_FD_BY_ID, BPF_MAP_GET_FD_BY_ID, + and BPF_OBJ_GET_INFO_BY_FD commands of bpf syscall. + * Enhanced decoding of get_thread_area, memfd_create, modify_ldt, + perf_event_open, reboot, s390_guarded_storage, s390_pcio_mmio_read, + s390_pci_mmio_write, s390_runtime_instr, s390_sthyi, set_thread_area, + and shmget syscalls. + * Implemented decoding of KVM_* and DM_LIST_DEVICES ioctl commands. + * Implemented decoding of riscv_flush_icache syscall. + * Enhanced decoding of getsockopt and setsockopt syscalls for SOL_NETLINK + level. + * Enhanced decoding of BPF_MAP_CREATE command of bpf syscall. + * Print values returned by mq_open syscall and first arguments + of mq_getsetattr, mq_notify, mq_timedreceive, and mq_timedsend syscalls + as file descriptors. + * Added decoding of get_tls syscall on arm. + * Added -e trace=%pure option for tracing system calls with no arguments that + never fail. + * Updated lists of IPV6_*, MAP_*, MEMBARRIER_CMD_*, MSG_*, NT_*, PKEY_*, + SHM_*, and TCP_* constants. + * Added manual page for the strace-log-merge command. + * Updated lists of ioctl commands from Linux 4.15. + * Implemented biarch support for s390x. + * Implemented an optional support for symbol demangling in strace -k output + (activated by --with-libiberty configure option). + * Information about availability of demangling and reliable personality + decoding (on architectures with multiple personalities) is now available + in strace -V output. + * Added decoding of pkey_alloc, pkey_free, and pkey_mprotect syscalls on + powerpc and powerpc64. + * Enhanced manual page. + +* Bug fixes + * Fixed multi-personality support in cross builds. + * Added mq_getsetattr, mq_notify, mq_open, mq_timedreceive, and mq_timedsend + syscalls to %desc tracing set. + * Fixed path tracing support for mmap syscalls with indirect arguments and + for old select syscall. + * Fixed decoding of arm-specific (__ARM_NR_*) syscalls. + * Fixed open mode flags decoding. + * Fixed corner cases in handling of strace -ff -ttt logs by strace-log-merge. + * Error counts that exceed one billion are now printed correctly in call + summary output. + * Fixed call summary header for x32 personality. + * Changes of tracee personalities are reported more reliably. + * Fixed the case when strace attaches to a tracee being inside exec and its + first syscall stop is syscall-exit-stop instead of syscall-enter-stop, + which messed up all the syscall state tracking. + * Fixed printing of higher 32 bits of the return value for x32 personality. + +* Portability + * A C compiler that supports "for" loop initial declarations is now required. + * Inability to configure multiple personality support on architectures where + multiple personalities are supported leads to configuration failure during + build now. Use --enable-mpers=check to revert to the old behaviour. + * Build-time requirement for the mpers support has been lowered from gawk 4 + to gawk 3. + * Removed incomplete and non-functional support for the CRIS architecture. + * Removed incomplete and unused support for IA-32 mode on the IA-64 + architecture. + +Noteworthy changes in release 4.20 (2017-11-13) +=============================================== + +* Improvements + * Implemented decoding of NETLINK_NETFILTER netlink message types and flags. + * Implemented decoding of SECCOMP_GET_ACTION_AVAIL operation of seccomp + syscall. + * Updated lists of ARPHRD_*, BPF_*, ETH_P_*, LOOP_*, MADV_*, + MEMBARRIER_CMD_*, MFD_*, SECCOMP_*, SO_*, SOL_*, TCP_*, and UFFD_FEATURE_* + constants. + * Added decoding of statx syscall on hppa. + * Updated lists of ioctl commands from Linux 4.14. + +* Bug fixes + * Fixed powerpc personality support on powerpc64. + +Noteworthy changes in release 4.19 (2017-09-05) +=============================================== + +* Changes in behaviour + * Changed formatting of personality names on tile architecture in order + to make it in line with other multi-personality architectures. + * Changed field output order in struct v4l2_requestbuffers to improve in/out + field formatting. + * Changed handling of multiple signal= specifications in an injection + expression: multiple specification now leads to error instead of implicit + usage the last specification. + +* Improvements + * Enhanced decoding of optlen argument of getsockopt syscall. + * Enhanced decoding of SO_LINGER option of getsockopt and setsockopt syscalls. + * Enhanced decoding of SO_PEERCRED option of getsockopt syscall. + * Enhanced decoding of IP_ADD_MEMBERSHIP, IP_DROP_MEMBERSHIP, + IPV6_ADD_MEMBERSHIP, IPV6_DROP_MEMBERSHIP, IPV6_JOIN_ANYCAST, + IPV6_LEAVE_ANYCAST, MCAST_JOIN_GROUP, and MCAST_LEAVE_GROUP options + of setsockopt syscall. + * Enhanced decoding of KEYCTL_DH_COMPUTE operation of keyctl syscall + (KDF parameters decoding). + * Implemented decoding of KEYCTL_RESTRICT_KEYRING operation of keyctl syscall. + * Enhanced decoding of UFFDIO_API ioctl command. + * Enhanced decoding of BPF_PROG_LOAD, BPF_MAP_CREATE, BPF_MAP_LOOKUP_ELEM, + and BPF_MAP_GET_NEXT_KEY commands of bpf syscall. + * Implemented decoding of linux socket filter programs specified + for SO_ATTACH_FILTER and SO_ATTACH_REUSEPORT_CBPF socket options. + * Implemented decoding of inet_diag_req_v2, inet_diag_req_compat, + packet_diag_msg, and smc_diag_msg netlink attributes of NETLINK_SOCK_DIAG. + * Implemented NETLINK_SELINUX protocol specific decoding. + * Implemented decoding of netlink message ack flags. + * Implemented decoding of nlmsgerr netlink attributes. + * Implemented basic protocol specific decoding of NETLINK_CRYPTO. + * Implemented decoding of crypto_user_alg netlink attributes + of NETLINK_CRYPTO. + * Implemented basic protocol specific decoding of addr, addrlabel, dcb, link, + mdb, neigh, neightbl, netconf, nsid, route, rule, tc, and tca messages + of NETLINK_ROUTE. + * Implemented decoding of NETLINK_KOBJECT_UEVENT messages. + * Improved handling of unexpected tracees (the ones that cloned with + CLONE_PARENT/CLONE_PTRACE or called PTRACE_TRACEME on themselves): they + are now PTRACE_DETACH'ed instead of PTRACE_CONT'ed. + * Updated lists of BPF_*, KEY_*, RWF_*, SCM_*, SO_*, and *_MAGIC constants. + * Added decoding of arch_prctl syscall on x86. + * Added decoding of seccomp, bpf, userfaultfd, membarrier, mlock2, + copy_file_range, preadv2, pwritev2, and statx on alpha. + * Added decoding of statx syscall on microblaze. + * Added decoding of s390_guarded_storage syscall on s390. + * Updated lists of ioctl commands from Linux 4.13. + * Enhanced manual page. + +* Bug fixes + * Fixed printing of group_req structure on non-native personalities. + * Fixed output formatting of blkpg_ioctl_arg, dm_name_list, and iocb + structures. + * Fixed formatting of nul-terminated strings which have kernel-imposed size + limit. + * Fixed printing of paths that hit PATM_MAX limit in order to match kernel's + behaviour. + * Fixed build warnings on Android mips64. + * Fixed unused function "is_negated_errno" build warning when built + with clang. + * Fixed syscall number and arguments retrieval behaviour on sparc64 and + mips o32 after prctl(PR_SET_DUMPABLE, 0) makes PTRACE_PEEKTEXT impossible + to use if Linux kernel has commit v4.10-rc1~114^2~2. + * Fixed path tracing for execveat, symlink, symlinkat, inotify_add_watch, + and inotify_init syscalls. + * Fixed personality switch printing on sparc64 and risc-v. + +Noteworthy changes in release 4.18 (2017-07-05) +=============================================== + +* Improvements + * Implemented decoding of SCM_TIMESTAMP* control messages. + * Implemented decoding of netlink NLMSG_DONE messages. + * Implemented decoding of netlink generic nlmsg_type and nlmsg_flags. + * Implemented decoding of NETLINK_AUDIT, NETLINK_NETFILTER, NETLINK_ROUTE, + NETLINK_SELINUX, NETLINK_SOCK_DIAG, and NETLINK_XFRM message types. + * Implemented decoding of NETLINK_GENERIC protocol families. + * Implemented basic protocol specific decoding of AF_INET, AF_INET6, + AF_NETLINK, AF_PACKET, AF_SMC, and AF_UNIX messages of NETLINK_SOCK_DIAG. + * Implemented basic decoding of netlink attributes. + * Implemented basic protocol specific decoding of AF_INET, AF_NETLINK, + AF_PACKET, AF_SMC, and AF_UNIX netlink attributes of NETLINK_SOCK_DIAG. + * Implemented decoding of inet_diag_msg, netlink_diag_msg, and unix_diag_msg + netlink attributes of NETLINK_SOCK_DIAG. + * Updated lists of ARPHRD_*, KEYCTL_*, NDIAG_SHOW_*, RTM_*, SCM_*, SCTP_*, + SO_*, V4L2_*, and prctl ARCH_* constants. + * Updated lists of ioctl commands from Linux 4.12. + +* Bug fixes + * In interactive mode (-I2), those signals that were blocked at startup + will remain blocked for the whole period of strace execution. + * strace no longer resets SIGCHLD handler in tracees to the default action. + * When traced command is terminated by a blocked signal, strace unblocks + that signal to ensure its own termination with the same signal. + * Fixed corner cases in decoding of old sigaction syscall. + * Fixed build with old kernel headers on mips. + * Fixed build on aarch64 and tile with glibc >= 2.26. + * Fixed build on arc and nios2. + +Noteworthy changes in release 4.17 (2017-05-24) +=============================================== + +* Changes in command line syntax + * Syscall classes specified in -e trace= option now have % prefix (like + -e trace=%process). Old style class names without leading % are still + supported, but considered deprecated now. + +* Improvements + * Optimized syscall filtering. + * Improved representation of timestamps. + * Enhanced decoding of sched_setattr syscall. + * Added -e trace=%stat option for tracing variants of stat syscall. + * Added -e trace=%lstat option for tracing variants of lstat syscall. + * Added -e trace=%fstat option for tracing variants of fstat and fstatat + syscalls. + * Added -e trace=%%stat option for tracing syscalls used for querying file + status information (stat, lstat, fstat, fstatat, statx, and their + variations). + * Added -e trace=%statfs option for tracing statfs, statfs64 and statvfs + syscalls. + * Added -e trace=%fstatfs option for tracing fstatfs, fstatfs64 and fstatvfs + syscalls. + * Added -e trace=%%statfs option for tracing syscalls used for querying file + system statistics information (statfs-like, fstatfs-like and ustat). + * Added -e trace=/regex option for filtering syscalls using regular + expressions. + * Added support for prepending of question mark before syscall qualification + in -e trace expressions in order to suppress error in case no syscalls + matched the provided qualification. + * Implemented decoding of signal mask in rt_sigreturn syscall on alpha, arc, + arm, avr32, bfin, cris, hppa, m68k, metag, microblaze, mips, nios2, or1k, + powerpc, powerpc64, riscv, sh, sh64, sparc, sparc64, tile, x86, and xtensa + architectures. + * Implemented decoding of statx syscall. + * Implemented decoding of NS_* ioctl commands. + * Implemented decoding of the remaining V4L2_BUF_TYPE_* types. + * Implemented decoding of VIDIOC_[SG]_TUNER ioctl commands. + * Implemented decoding of NLMSG_ERROR netlink messages. + * Improved decoding of BPF_PROG_ATTACH command of bpf syscall. + * Improved decoding of misplaced parts in DM_* ioctl commands. + * Updated lists of ioctl commands from Linux 4.11. + +* Bug fixes + * Fixed decoding of flags argument of preadv2 and pwritev2 syscalls on x32. + * Fixed the number of arguments and tracing flags of alpha specific syscalls. + * Fixed decoding of old sigsuspend syscall on alpha, cris, mips, powerpc, + powerpc64, sh, sh64, sparc, and sparc64. + * Fixed decoding of sgetmask and ssetmask syscalls on 64-bit architectures. + * Fixed decoding of netlink messages received within struct msghdr. + * Worked around a bug in miscompiled aarch64 kernels leading to the 3rd + argument of sched_getattr syscall being not quite 32-bit. + * Fixed corner cases of printing inaccessible times argument of utimes + and futimesat syscalls. + Noteworthy changes in release 4.16 (2017-02-14) =============================================== @@ -777,7 +1286,7 @@ Changes in 4.4 ============== * Fix Linux/ia64 support, looks like someone renamed a few things on us * Fix the ioctl setup for Linux, turned out it did not really work. - Improve the ioctl extracter as well so we decode some more ones. + Improve the ioctl extractor as well so we decode some more ones. Changes in 4.3.1 ================ @@ -869,7 +1378,7 @@ New Features in version 3.0 =========================== * non-ascii strings can be optionally printed entirely in hex -* the output format is readable when mutiple processes are generating output +* the output format is readable when multiple processes are generating output * exit values are printed in an alignment column * is is possible to suppress messages about attaching and detaching * various tracing features can be enabled on a per syscall/signal/desc basis diff --git a/README b/README index ae808005..3304afbb 100644 --- a/README +++ b/README @@ -1,24 +1,38 @@ -This is strace, a system call tracer for Linux. +This is strace - a diagnostic, debugging and instructional userspace utility +with a traditional command-line interface for Linux. It is used to monitor +and tamper with interactions between processes and the Linux kernel, which +include system calls, signal deliveries, and changes of process state. +The operation of strace is made possible by the kernel feature known as ptrace. -strace is released under a Berkeley-style license at the request -of Paul Kranenburg. +strace is released under the terms of the GNU Lesser General Public License +version 2.1 or later; see the file COPYING for details. +strace test suite is released under the terms of the GNU General Public License +version 2 or later; see the file tests/COPYING for details. See the file CREDITS for a list of authors and other contributors. See the file INSTALL for compilation and installation instructions. See the file NEWS for information on what has changed in recent versions. +See the file README-hacking for information related to strace development. The project's homepage is at - https://sourceforge.net/projects/strace/ + https://strace.io + +The GIT repository of strace is available at + https://github.com/strace/strace/ and https://gitlab.com/strace/strace/ strace has a mailing list: - strace-devel@lists.sourceforge.net. + strace-devel@lists.strace.io + +Everyone is welcome to post bug reports, feature requests, comments +and patches to the list. The mailing list archives are available at + https://lists.strace.io/pipermail/strace-devel/ System requirements: * Linux kernel >= 2.6.18 is recommended. Older versions might still work but they haven't been thoroughly tested with this release. * Linux kernel >= 2.5.46 is required. Older versions without a decent PTRACE_SETOPTIONS support will not work. - * On mips, linux kernel >= 2.6.15 is required. + * On mips, Linux kernel >= 2.6.15 is required. Older versions without a decent PTRACE_GETREGS support will not work. - * On s390 and s390x, linux kernel >= 2.6.27 is required. + * On s390 and s390x, Linux kernel >= 2.6.27 is required. Older versions without a decent PTRACE_GETREGSET support will not work. diff --git a/README-configure b/README-configure new file mode 100644 index 00000000..c39085af --- /dev/null +++ b/README-configure @@ -0,0 +1,301 @@ +Installation Instructions +************************* + +Copyright (C) 1994-1996, 1999-2002, 2004-2013 Free Software Foundation, +Inc. + + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. + +Basic Installation +================== + +Briefly, the shell command './configure && make && make install' should +configure, build, and install this package. The following more-detailed +instructions are generic; see the 'README' file for instructions +specific to this package. Some packages provide this 'README-configure' +file but do not implement all of the features documented below. The +lack of an optional feature in a given package is not necessarily a bug. +More recommendations for GNU packages can be found in *note Makefile +Conventions: (standards)Makefile Conventions. + + The 'configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a 'Makefile' in each directory of the package. +It may also create one or more '.h' files containing system-dependent +definitions. Finally, it creates a shell script 'config.status' that +you can run in the future to recreate the current configuration, and a +file 'config.log' containing compiler output (useful mainly for +debugging 'configure'). + + It can also use an optional file (typically called 'config.cache' and +enabled with '--cache-file=config.cache' or simply '-C') that saves the +results of its tests to speed up reconfiguring. Caching is disabled by +default to prevent problems with accidental use of stale cache files. + + If you need to do unusual things to compile the package, please try +to figure out how 'configure' could check whether to do them, and mail +diffs or instructions to the address given in the 'README' so they can +be considered for the next release. If you are using the cache, and at +some point 'config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file 'configure.ac' (or 'configure.in') is used to create +'configure' by a program called 'autoconf'. You need 'configure.ac' if +you want to change it or regenerate 'configure' using a newer version of +'autoconf'. + + The simplest way to compile this package is: + + 1. 'cd' to the directory containing the package's source code and type + './configure' to configure the package for your system. + + Running 'configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type 'make' to compile the package. + + 3. Optionally, type 'make check' to run any self-tests that come with + the package, generally using the just-built uninstalled binaries. + + 4. Type 'make install' to install the programs and any data files and + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the 'make install' phase executed with root + privileges. + + 5. Optionally, type 'make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior 'make install' required + root privileges, verifies that the installation completed + correctly. + + 6. You can remove the program binaries and object files from the + source code directory by typing 'make clean'. To also remove the + files that 'configure' created (so you can compile the package for + a different kind of computer), type 'make distclean'. There is + also a 'make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 7. Often, you can also type 'make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide 'make + distcheck', which can by used by developers to test that all other + targets like 'make install' and 'make uninstall' work correctly. + This target is generally not run by end users. + +Compilers and Options +===================== + +Some systems require unusual options for compilation or linking that the +'configure' script does not know about. Run './configure --help' for +details on some of the pertinent environment variables. + + You can give 'configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here is +an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Installation Names +================== + +By default, 'make install' installs the package's commands under +'/usr/local/bin', include files under '/usr/local/include', etc. You +can specify an installation prefix other than '/usr/local' by giving +'configure' the option '--prefix=PREFIX', where PREFIX must be an +absolute file name. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option '--exec-prefix=PREFIX' to 'configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like '--bindir=DIR' to specify different values for particular +kinds of files. Run 'configure --help' for a list of the directories +you can set and what kinds of files go in them. In general, the default +for these options is expressed in terms of '${prefix}', so that +specifying just '--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to 'configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +'make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, 'make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +'${prefix}'. Any directories that were specified during 'configure', +but not in terms of '${prefix}', must each be overridden at install time +for the entire installation to be relocated. The approach of makefile +variable overrides for each directory variable is required by the GNU +Coding Standards, and ideally causes no recompilation. However, some +platforms have known limitations with the semantics of shared libraries +that end up requiring recompilation when using this method, particularly +noticeable in packages that use GNU Libtool. + + The second method involves providing the 'DESTDIR' variable. For +example, 'make install DESTDIR=/alternate/directory' will prepend +'/alternate/directory' before all installation names. The approach of +'DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of '${prefix}' +at 'configure' time. + +Optional Features +================= + +If the package supports it, you can cause programs to be installed with +an extra prefix or suffix on their names by giving 'configure' the +option '--program-prefix=PREFIX' or '--program-suffix=SUFFIX'. + + Some packages pay attention to '--enable-FEATURE' options to +'configure', where FEATURE indicates an optional part of the package. +They may also pay attention to '--with-PACKAGE' options, where PACKAGE +is something like 'gnu-as' or 'x' (for the X Window System). The +'README' should mention any '--enable-' and '--with-' options that the +package recognizes. + + For packages that use the X Window System, 'configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the 'configure' options '--x-includes=DIR' and +'--x-libraries=DIR' to specify their locations. + + Some packages offer the ability to configure how verbose the +execution of 'make' will be. For these packages, running './configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with 'make V=1'; while running './configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with 'make V=0'. + +Specifying the System Type +========================== + +There may be some features 'configure' cannot figure out automatically, +but needs to determine by the type of machine the package will run on. +Usually, assuming the package is built to be run on the _same_ +architectures, 'configure' can figure that out, but if it prints a +message saying it cannot guess the machine type, give it the +'--build=TYPE' option. TYPE can either be a short name for the system +type, such as 'sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS + KERNEL-OS + + See the file 'config.sub' for the possible values of each field. If +'config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option '--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with '--host=TYPE'. + +Sharing Defaults +================ + +If you want to set default values for 'configure' scripts to share, you +can create a site shell script called 'config.site' that gives default +values for variables like 'CC', 'cache_file', and 'prefix'. 'configure' +looks for 'PREFIX/share/config.site' if it exists, then +'PREFIX/etc/config.site' if it exists. Or, you can set the +'CONFIG_SITE' environment variable to the location of the site script. +A warning: not all 'configure' scripts look for a site script. + +Defining Variables +================== + +Variables not defined in a site shell script can be set in the +environment passed to 'configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the 'configure' command line, using 'VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified 'gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for 'CONFIG_SHELL' due to an +Autoconf limitation. Until the limitation is lifted, you can use this +workaround: + + CONFIG_SHELL=/bin/bash ./configure CONFIG_SHELL=/bin/bash + +'configure' Invocation +====================== + +'configure' recognizes the following options to control how it operates. + +'--help' +'-h' + Print a summary of all of the options to 'configure', and exit. + +'--help=short' +'--help=recursive' + Print a summary of the options unique to this package's + 'configure', and exit. The 'short' variant lists options used only + in the top level, while the 'recursive' variant lists options also + present in any nested packages. + +'--version' +'-V' + Print the version of Autoconf used to generate the 'configure' + script, and exit. + +'--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally 'config.cache'. FILE defaults to '/dev/null' to + disable caching. + +'--config-cache' +'-C' + Alias for '--cache-file=config.cache'. + +'--quiet' +'--silent' +'-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to '/dev/null' (any error + messages will still be shown). + +'--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + 'configure' can determine that directory automatically. + +'--prefix=DIR' + Use DIR as the installation prefix. *note Installation Names:: for + more details, including other options available for fine-tuning the + installation locations. + +'--no-create' +'-n' + Run the configure checks, but stop before creating any output + files. + +'configure' also accepts some other, not widely useful, options. Run +'configure --help' for more details. diff --git a/access.c b/access.c index a9663dc1..5c2e6e99 100644 --- a/access.c +++ b/access.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" #include diff --git a/aclocal.m4 b/aclocal.m4 index cca8cf2a..ce4cb716 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.14.1 -*- Autoconf -*- +# generated automatically by aclocal 1.16.1 -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -20,7 +20,7 @@ You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) -# Copyright (C) 2002-2013 Free Software Foundation, Inc. +# Copyright (C) 2002-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.]) # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], -[am__api_version='1.14' +[am__api_version='1.16' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. -m4_if([$1], [1.14.1], [], +m4_if([$1], [1.16.1], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) @@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], []) # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], -[AM_AUTOMAKE_VERSION([1.14.1])dnl +[AM_AUTOMAKE_VERSION([1.16.1])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -103,15 +103,14 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], -[dnl Rely on autoconf to set up CDPATH properly. -AC_PREREQ([2.50])dnl -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -142,7 +141,7 @@ AC_CONFIG_COMMANDS_PRE( Usually this means the macro was only invoked conditionally.]]) fi])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -333,13 +332,12 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl # Generate code to set up dependency tracking. -*- Autoconf -*- -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. - # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], @@ -347,49 +345,41 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + AS_CASE([$CONFIG_FILES], + [*\'*], [eval set x "$CONFIG_FILES"], + [*], [set x $CONFIG_FILES]) shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`AS_ECHO(["$am_mf"]) | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`AS_DIRNAME("$mf")` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`AS_DIRNAME(["$file"])` - AS_MKDIR_P([$dirpart/$fdir]) - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`AS_DIRNAME(["$am_mf"])` + am_filepart=`AS_BASENAME(["$am_mf"])` + AM_RUN_LOG([cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles]) || am_rc=$? done + if test $am_rc -ne 0; then + AC_MSG_FAILURE([Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking).]) + fi + AS_UNSET([am_dirpart]) + AS_UNSET([am_filepart]) + AS_UNSET([am_mf]) + AS_UNSET([am_rc]) + rm -f conftest-deps.mk } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS @@ -398,18 +388,17 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # -# This code is only required when automatic dependency tracking -# is enabled. FIXME. This creates each '.P' file that we will -# need in order to bootstrap the dependency handling code. +# This code is only required when automatic dependency tracking is enabled. +# This creates each '.Po' and '.Plo' makefile fragment that we'll need in +# order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], - [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) -]) + [AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}"])]) # AM_EXTRA_RECURSIVE_TARGETS -*- Autoconf -*- -# Copyright (C) 2012-2013 Free Software Foundation, Inc. +# Copyright (C) 2012-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -426,7 +415,7 @@ AC_DEFUN([AM_EXTRA_RECURSIVE_TARGETS], []) # Do all the work for Automake. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -513,11 +502,11 @@ AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# AC_SUBST([mkdir_p], ['$(MKDIR_P)']) -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl @@ -581,7 +570,7 @@ END Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . +that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM @@ -590,7 +579,11 @@ to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi -fi]) +fi +dnl The trailing newline in this macro's definition is deliberate, for +dnl backward compatibility and to allow trailing 'dnl'-style comments +dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. +]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further @@ -619,7 +612,7 @@ for _am_header in $config_headers :; do done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -630,7 +623,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -640,7 +633,7 @@ if test x"${install_sh}" != xset; then fi AC_SUBST([install_sh])]) -# Copyright (C) 2003-2013 Free Software Foundation, Inc. +# Copyright (C) 2003-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -662,7 +655,7 @@ AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -697,7 +690,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) # Check to see how 'make' treats includes. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -705,49 +698,42 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) # AM_MAKE_INCLUDE() # ----------------- -# Check to see how make treats includes. +# Check whether make has an 'include' directive that can support all +# the idioms we need for our automatic dependency tracking code. AC_DEFUN([AM_MAKE_INCLUDE], -[am_make=${MAKE-make} -cat > confinc << 'END' +[AC_MSG_CHECKING([whether ${MAKE-make} supports the include directive]) +cat > confinc.mk << 'END' am__doit: - @echo this is the am__doit target + @echo this is the am__doit target >confinc.out .PHONY: am__doit END -# If we don't find an include directive, just comment out the code. -AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD - ;; - esac -fi -AC_SUBST([am__include]) -AC_SUBST([am__quote]) -AC_MSG_RESULT([$_am_result]) -rm -f confinc confmf -]) +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + AM_RUN_LOG([${MAKE-make} -f confmf.$s && cat confinc.out]) + AS_CASE([$?:`cat confinc.out 2>/dev/null`], + ['0:this is the am__doit target'], + [AS_CASE([$s], + [BSD], [am__include='.include' am__quote='"'], + [am__include='include' am__quote=''])]) + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +AC_MSG_RESULT([${_am_result}]) +AC_SUBST([am__include])]) +AC_SUBST([am__quote])]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- -# Copyright (C) 1997-2013 Free Software Foundation, Inc. +# Copyright (C) 1997-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -786,7 +772,7 @@ fi # Helper functions for option handling. -*- Autoconf -*- -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -815,7 +801,7 @@ AC_DEFUN([_AM_SET_OPTIONS], AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -862,7 +848,7 @@ AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -881,7 +867,7 @@ AC_DEFUN([AM_RUN_LOG], # Check to make sure that the build environment is sane. -*- Autoconf -*- -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -962,7 +948,7 @@ AC_CONFIG_COMMANDS_PRE( rm -f conftest.file ]) -# Copyright (C) 2009-2013 Free Software Foundation, Inc. +# Copyright (C) 2009-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1022,7 +1008,7 @@ AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) -# Copyright (C) 2001-2013 Free Software Foundation, Inc. +# Copyright (C) 2001-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1050,7 +1036,7 @@ fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) -# Copyright (C) 2006-2013 Free Software Foundation, Inc. +# Copyright (C) 2006-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1069,7 +1055,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- -# Copyright (C) 2004-2013 Free Software Foundation, Inc. +# Copyright (C) 2004-2018 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -1203,7 +1189,12 @@ AC_SUBST([am__untar]) m4_include([m4/ax_code_coverage.m4]) m4_include([m4/ax_prog_cc_for_build.m4]) m4_include([m4/ax_valgrind_check.m4]) +m4_include([m4/bpf_attr.m4]) m4_include([m4/mpers.m4]) +m4_include([m4/st_demangle.m4]) +m4_include([m4/st_libdw.m4]) +m4_include([m4/st_libunwind.m4]) m4_include([m4/st_save_restore_var.m4]) +m4_include([m4/st_stacktrace.m4]) m4_include([m4/st_warn_cflags.m4]) m4_include([m4/warnings.m4]) diff --git a/affinity.c b/affinity.c index 0eb10940..eb3158b7 100644 --- a/affinity.c +++ b/affinity.c @@ -1,29 +1,9 @@ /* * Copyright (c) 2002-2004 Roland McGrath - * Copyright (c) 2009-2016 Dmitry V. Levin + * Copyright (c) 2009-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/aio.c b/aio.c index e246b353..a825cae3 100644 --- a/aio.c +++ b/aio.c @@ -3,34 +3,18 @@ * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 1999-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" +#include "print_fields.h" #include +#include "xlat/aio_cmds.h" + SYS_FUNC(io_setup) { if (entering(tcp)) @@ -52,29 +36,24 @@ enum iocb_sub { }; static enum iocb_sub -tprint_lio_opcode(unsigned cmd) +tprint_lio_opcode(unsigned int cmd) { - static const struct { - const char *name; - enum iocb_sub sub; - } cmds[] = { - { "pread", SUB_COMMON }, - { "pwrite", SUB_COMMON }, - { "fsync", SUB_NONE }, - { "fdsync", SUB_NONE }, - { "preadx", SUB_NONE }, - { "poll", SUB_NONE }, - { "noop", SUB_NONE }, - { "preadv", SUB_VECTOR }, - { "pwritev", SUB_VECTOR }, + static const enum iocb_sub subs[] = { + [IOCB_CMD_PREAD] = SUB_COMMON, + [IOCB_CMD_PWRITE] = SUB_COMMON, + [IOCB_CMD_FSYNC] = SUB_NONE, + [IOCB_CMD_FDSYNC] = SUB_NONE, + [IOCB_CMD_PREADX] = SUB_NONE, + [IOCB_CMD_POLL] = SUB_NONE, + [IOCB_CMD_NOOP] = SUB_NONE, + [IOCB_CMD_PREADV] = SUB_VECTOR, + [IOCB_CMD_PWRITEV] = SUB_VECTOR, }; - if (cmd < ARRAY_SIZE(cmds)) { - tprints(cmds[cmd].name); - return cmds[cmd].sub; - } - tprintf("%u /* SUB_??? */", cmd); - return SUB_NONE; + printxval_indexn_ex(ARRSZ_PAIR(aio_cmds) - 1, cmd, "IOCB_CMD_???", + XLAT_STYLE_FMT_U); + + return cmd < ARRAY_SIZE(subs) ? subs[cmd] : SUB_NONE; } static void @@ -82,12 +61,11 @@ print_common_flags(struct tcb *tcp, const struct iocb *cb) { /* IOCB_FLAG_RESFD is available since v2.6.22-rc1~47 */ #ifdef IOCB_FLAG_RESFD - if (cb->aio_flags & IOCB_FLAG_RESFD) { - tprints(", resfd="); - printfd(tcp, cb->aio_resfd); - } + if (cb->aio_flags & IOCB_FLAG_RESFD) + PRINT_FIELD_FD(", ", *cb, aio_resfd, tcp); + if (cb->aio_flags & ~IOCB_FLAG_RESFD) - tprintf(", flags=%#x", cb->aio_flags); + PRINT_FIELD_X(", ", *cb, aio_flags); #endif } @@ -104,19 +82,22 @@ print_iocb_header(struct tcb *tcp, const struct iocb *cb) { enum iocb_sub sub; - if (cb->aio_data) - tprintf("data=%#" PRIx64 ", ", - (uint64_t) cb->aio_data); + if (cb->aio_data){ + PRINT_FIELD_X("", *cb, aio_data); + tprints(", "); + } - if (cb->aio_key) - tprintf("key=%u, ", cb->aio_key); + if (cb->aio_key) { + PRINT_FIELD_U("", *cb, aio_key); + tprints(", "); + } + tprints("aio_lio_opcode="); sub = tprint_lio_opcode(cb->aio_lio_opcode); if (cb->aio_reqprio) - tprintf(", reqprio=%hd", cb->aio_reqprio); + PRINT_FIELD_D(", ", *cb, aio_reqprio); - tprints(", fildes="); - printfd(tcp, cb->aio_fildes); + PRINT_FIELD_FD(", ", *cb, aio_fildes, tcp); return sub; } @@ -124,38 +105,41 @@ print_iocb_header(struct tcb *tcp, const struct iocb *cb) static void print_iocb(struct tcb *tcp, const struct iocb *cb) { + tprints("{"); + enum iocb_sub sub = print_iocb_header(tcp, cb); switch (sub) { case SUB_COMMON: if (cb->aio_lio_opcode == 1 && iocb_is_valid(cb)) { - tprints(", str="); - printstrn(tcp, cb->aio_buf, cb->aio_nbytes); + PRINT_FIELD_STRN(", ", *cb, aio_buf, + cb->aio_nbytes, tcp); } else { - tprintf(", buf=%#" PRIx64, (uint64_t) cb->aio_buf); + PRINT_FIELD_X(", ", *cb, aio_buf); } - tprintf(", nbytes=%" PRIu64 ", offset=%" PRId64, - (uint64_t) cb->aio_nbytes, (int64_t) cb->aio_offset); + PRINT_FIELD_U(", ", *cb, aio_nbytes); + PRINT_FIELD_D(", ", *cb, aio_offset); print_common_flags(tcp, cb); break; case SUB_VECTOR: if (iocb_is_valid(cb)) { - tprints(", iovec="); + tprints(", aio_buf="); tprint_iov(tcp, cb->aio_nbytes, cb->aio_buf, cb->aio_lio_opcode == 8 ? IOV_DECODE_STR : IOV_DECODE_ADDR); } else { - tprintf(", buf=%#" PRIx64 ", nbytes=%" PRIu64, - (uint64_t) cb->aio_buf, - (uint64_t) cb->aio_nbytes); + PRINT_FIELD_X(", ", *cb, aio_buf); + PRINT_FIELD_U(", ", *cb, aio_nbytes); } - tprintf(", offset=%" PRId64, (int64_t) cb->aio_offset); + PRINT_FIELD_D(", ", *cb, aio_offset); print_common_flags(tcp, cb); break; case SUB_NONE: break; } + + tprints("}"); } static bool @@ -165,15 +149,13 @@ print_iocbp(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) struct iocb cb; if (elem_size < sizeof(kernel_ulong_t)) { - addr = * (unsigned int *) elem_buf; + addr = *(unsigned int *) elem_buf; } else { - addr = * (kernel_ulong_t *) elem_buf; + addr = *(kernel_ulong_t *) elem_buf; } - tprints("{"); if (!umove_or_printaddr(tcp, addr, &cb)) print_iocb(tcp, &cb); - tprints("}"); return true; } @@ -192,7 +174,7 @@ SYS_FUNC(io_submit) printaddr(addr); else print_array(tcp, addr, nr, &iocbp, current_wordsize, - umoven_or_printaddr, print_iocbp, 0); + tfetch_mem, print_iocbp, 0); return RVAL_DECODED; } @@ -202,10 +184,11 @@ print_io_event(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) { struct io_event *event = elem_buf; - tprintf("{data=%#" PRIx64 ", obj=%#" PRIx64 - ", res=%" PRId64 ", res2=%" PRId64 "}", - (uint64_t) event->data, (uint64_t) event->obj, - (int64_t) event->res, (int64_t) event->res2); + PRINT_FIELD_X("{", *event, data); + PRINT_FIELD_X(", ", *event, obj); + PRINT_FIELD_D(", ", *event, res); + PRINT_FIELD_D(", ", *event, res2); + tprints("}"); return true; } @@ -233,7 +216,9 @@ SYS_FUNC(io_cancel) return 0; } -SYS_FUNC(io_getevents) +static int +print_io_getevents(struct tcb *const tcp, const print_obj_by_addr_fn print_ts, + const bool has_usig) { if (entering(tcp)) { printaddr(tcp->u_arg[0]); @@ -243,16 +228,46 @@ SYS_FUNC(io_getevents) } else { struct io_event buf; print_array(tcp, tcp->u_arg[3], tcp->u_rval, &buf, sizeof(buf), - umoven_or_printaddr, print_io_event, 0); + tfetch_mem, print_io_event, 0); tprints(", "); /* - * Since the timeout parameter is read by the kernel + * Since the timeout and usig parameters are read by the kernel * on entering syscall, it has to be decoded the same way * whether the syscall has failed or not. */ temporarily_clear_syserror(tcp); - print_timespec(tcp, tcp->u_arg[4]); + print_ts(tcp, tcp->u_arg[4]); + if (has_usig) { + tprints(", "); + print_aio_sigset(tcp, tcp->u_arg[5]); + } restore_cleared_syserror(tcp); } return 0; } + +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(io_getevents_time32) +{ + return print_io_getevents(tcp, print_timespec32, false); +} +#endif + +#if HAVE_ARCH_OLD_TIME64_SYSCALLS +SYS_FUNC(io_getevents_time64) +{ + return print_io_getevents(tcp, print_timespec64, false); +} +#endif + +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(io_pgetevents_time32) +{ + return print_io_getevents(tcp, print_timespec32, true); +} +#endif + +SYS_FUNC(io_pgetevents_time64) +{ + return print_io_getevents(tcp, print_timespec64, true); +} diff --git a/alpha.c b/alpha.c index 70d4ca5a..c972a7d3 100644 --- a/alpha.c +++ b/alpha.c @@ -1,34 +1,17 @@ /* * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" #ifdef ALPHA +# include "xstring.h" + static int decode_getxxid(struct tcb *tcp, const char *what) { @@ -40,7 +23,7 @@ decode_getxxid(struct tcb *tcp, const char *what) return 0; static const char const fmt[] = "%s %ld"; static char outstr[sizeof(fmt) + 3 * sizeof(rval)]; - snprintf(outstr, sizeof(outstr), fmt, what, rval); + xsprintf(outstr, fmt, what, rval); tcp->auxstr = outstr; return RVAL_STR; } diff --git a/arch_defs.h b/arch_defs.h new file mode 100644 index 00000000..40e675f3 --- /dev/null +++ b/arch_defs.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +/* Architecture-specific definitions. */ +#ifndef STRACE_ARCH_DEFS_H +# define STRACE_ARCH_DEFS_H + +# include "arch_defs_.h" +# include "linux/arch_defs_.h" + +#endif /* !STRACE_ARCH_DEFS_H */ diff --git a/basic_filters.c b/basic_filters.c new file mode 100644 index 00000000..5f691eae --- /dev/null +++ b/basic_filters.c @@ -0,0 +1,385 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#include + +#include "filter.h" +#include "number_set.h" +#include "xstring.h" + + +/** + * Checks whether a @-separated personality specification suffix is present. + * Personality suffix is a one of strings stored in personality_designators + * array. + * + * @param[in] s Specification string to check. + * @param[out] p Where to store personality number if it is found. + * @return If personality is found, the provided string is copied without + * suffix and returned as a result (callee should de-alllocate it + * with free() after use), and personality number is written to p. + * Otherwise, NULL is returned and p is untouched. + */ +static char * +qualify_syscall_separate_personality(const char *s, unsigned int *p) +{ + char *pos = strchr(s, '@'); + + if (!pos) + return NULL; + + for (unsigned int i = 0; i < SUPPORTED_PERSONALITIES; i++) { + if (!strcmp(pos + 1, personality_designators[i])) { + *p = i; + return xstrndup(s, pos - s); + } + } + + error_msg_and_help("incorrect personality designator '%s'" + " in qualification '%s'", pos + 1, s); +} + +static bool +qualify_syscall_number_personality(int n, unsigned int p, + struct number_set *set) +{ + if ((unsigned int) n >= nsyscall_vec[p]) + return false; + + add_number_to_set_array(n, set, p); + + return true; +} + +static bool +qualify_syscall_number(const char *s, struct number_set *set) +{ + unsigned int p; + char *num_str = qualify_syscall_separate_personality(s, &p); + int n; + + if (num_str) { + n = string_to_uint(num_str); + free(num_str); + + if (n < 0) + return false; + + return qualify_syscall_number_personality(n, p, set); + } + + n = string_to_uint(s); + if (n < 0) + return false; + + bool done = false; + + for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) + done |= qualify_syscall_number_personality(n, p, set); + + return done; +} + +static void +regerror_msg_and_die(int errcode, const regex_t *preg, + const char *str, const char *pattern) +{ + char buf[512]; + + regerror(errcode, preg, buf, sizeof(buf)); + error_msg_and_die("%s: %s: %s", str, pattern, buf); +} + +static bool +qualify_syscall_regex(const char *s, struct number_set *set) +{ + regex_t preg; + int rc; + + if ((rc = regcomp(&preg, s, REG_EXTENDED | REG_NOSUB)) != 0) + regerror_msg_and_die(rc, &preg, "regcomp", s); + + bool found = false; + + for (unsigned int p = 0; p < SUPPORTED_PERSONALITIES; ++p) { + for (unsigned int i = 0; i < nsyscall_vec[p]; ++i) { + if (!sysent_vec[p][i].sys_name) + continue; + + rc = regexec(&preg, sysent_vec[p][i].sys_name, + 0, NULL, 0); + + if (rc == REG_NOMATCH) { + char name_buf[128]; + char *pos = stpcpy(name_buf, + sysent_vec[p][i].sys_name); + + (void) xappendstr(name_buf, pos, "@%s", + personality_designators[p]); + + rc = regexec(&preg, name_buf, 0, NULL, 0); + } + + if (rc == REG_NOMATCH) + continue; + else if (rc) + regerror_msg_and_die(rc, &preg, "regexec", s); + + add_number_to_set_array(i, set, p); + found = true; + } + } + + regfree(&preg); + return found; +} + +static unsigned int +lookup_class(const char *s) +{ + static const struct { + const char *name; + unsigned int value; + } syscall_class[] = { + { "%desc", TRACE_DESC }, + { "%file", TRACE_FILE }, + { "%memory", TRACE_MEMORY }, + { "%process", TRACE_PROCESS }, + { "%signal", TRACE_SIGNAL }, + { "%ipc", TRACE_IPC }, + { "%net", TRACE_NETWORK }, + { "%network", TRACE_NETWORK }, + { "%stat", TRACE_STAT }, + { "%lstat", TRACE_LSTAT }, + { "%fstat", TRACE_FSTAT }, + { "%%stat", TRACE_STAT_LIKE }, + { "%statfs", TRACE_STATFS }, + { "%fstatfs", TRACE_FSTATFS }, + { "%%statfs", TRACE_STATFS_LIKE }, + { "%pure", TRACE_PURE }, + /* legacy class names */ + { "desc", TRACE_DESC }, + { "file", TRACE_FILE }, + { "memory", TRACE_MEMORY }, + { "process", TRACE_PROCESS }, + { "signal", TRACE_SIGNAL }, + { "ipc", TRACE_IPC }, + { "network", TRACE_NETWORK }, + }; + + for (unsigned int i = 0; i < ARRAY_SIZE(syscall_class); ++i) { + if (strcmp(s, syscall_class[i].name) == 0) + return syscall_class[i].value; + } + + return 0; +} + +static bool +qualify_syscall_class(const char *s, struct number_set *set) +{ + const unsigned int n = lookup_class(s); + if (!n) + return false; + + for (unsigned int p = 0; p < SUPPORTED_PERSONALITIES; ++p) { + for (unsigned int i = 0; i < nsyscall_vec[p]; ++i) { + if (sysent_vec[p][i].sys_name && + (sysent_vec[p][i].sys_flags & n) == n) + add_number_to_set_array(i, set, p); + } + } + + return true; +} + +kernel_long_t +scno_by_name(const char *s, unsigned int p, kernel_long_t start) +{ + if (p >= SUPPORTED_PERSONALITIES) + return -1; + + for (kernel_ulong_t i = start; i < nsyscall_vec[p]; ++i) { + if (sysent_vec[p][i].sys_name && + strcmp(s, sysent_vec[p][i].sys_name) == 0) + return i; + } + + return -1; +} + +static bool +qualify_syscall_name_personality(const char *s, unsigned int p, + struct number_set *set) +{ + bool found = false; + + for (kernel_long_t scno = 0; (scno = scno_by_name(s, p, scno)) >= 0; + ++scno) { + add_number_to_set_array(scno, set, p); + found = true; + } + + return found; +} + +static bool +qualify_syscall_name(const char *s, struct number_set *set) +{ + unsigned int p; + char *name_str = qualify_syscall_separate_personality(s, &p); + bool found = false; + + if (name_str) { + found = qualify_syscall_name_personality(name_str, p, set); + free(name_str); + + return found; + } + + for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) + found |= qualify_syscall_name_personality(s, p, set); + + return found; +} + +static bool +qualify_syscall(const char *token, struct number_set *set) +{ + bool ignore_fail = false; + + while (*token == '?') { + token++; + ignore_fail = true; + } + if (*token >= '0' && *token <= '9') + return qualify_syscall_number(token, set) || ignore_fail; + if (*token == '/') + return qualify_syscall_regex(token + 1, set) || ignore_fail; + return qualify_syscall_class(token, set) + || qualify_syscall_name(token, set) + || ignore_fail; +} + +/* + * Add syscall numbers to SETs for each supported personality + * according to STR specification. + */ +void +qualify_syscall_tokens(const char *const str, struct number_set *const set) +{ + /* Clear all sets. */ + clear_number_set_array(set, SUPPORTED_PERSONALITIES); + + /* + * Each leading ! character means inversion + * of the remaining specification. + */ + const char *s = str; + while (*s == '!') { + invert_number_set_array(set, SUPPORTED_PERSONALITIES); + ++s; + } + + if (strcmp(s, "none") == 0) { + /* + * No syscall numbers are added to sets. + * Subsequent is_number_in_set* invocations + * will return set[p]->not. + */ + return; + } else if (strcmp(s, "all") == 0) { + /* "all" == "!none" */ + invert_number_set_array(set, SUPPORTED_PERSONALITIES); + return; + } + + /* + * Split the string into comma separated tokens. + * For each token, call qualify_syscall that will take care + * if adding appropriate syscall numbers to sets. + * The absence of tokens or a negative return code + * from qualify_syscall is a fatal error. + */ + char *copy = xstrdup(s); + char *saveptr = NULL; + bool done = false; + + for (const char *token = strtok_r(copy, ",", &saveptr); + token; token = strtok_r(NULL, ",", &saveptr)) { + done = qualify_syscall(token, set); + if (!done) + error_msg_and_die("invalid system call '%s'", token); + } + + free(copy); + + if (!done) + error_msg_and_die("invalid system call '%s'", str); +} + +/* + * Add numbers to SET according to STR specification. + */ +void +qualify_tokens(const char *const str, struct number_set *const set, + string_to_uint_func func, const char *const name) +{ + /* Clear the set. */ + clear_number_set_array(set, 1); + + /* + * Each leading ! character means inversion + * of the remaining specification. + */ + const char *s = str; + while (*s == '!') { + invert_number_set_array(set, 1); + ++s; + } + + if (strcmp(s, "none") == 0) { + /* + * No numbers are added to the set. + * Subsequent is_number_in_set* invocations + * will return set->not. + */ + return; + } else if (strcmp(s, "all") == 0) { + /* "all" == "!none" */ + invert_number_set_array(set, 1); + return; + } + + /* + * Split the string into comma separated tokens. + * For each token, find out the corresponding number + * by calling FUNC, and add that number to the set. + * The absence of tokens or a negative answer + * from FUNC is a fatal error. + */ + char *copy = xstrdup(s); + char *saveptr = NULL; + int number = -1; + + for (const char *token = strtok_r(copy, ",", &saveptr); + token; token = strtok_r(NULL, ",", &saveptr)) { + number = func(token); + if (number < 0) + error_msg_and_die("invalid %s '%s'", name, token); + + add_number_to_set(number, set); + } + + free(copy); + + if (number < 0) + error_msg_and_die("invalid %s '%s'", name, str); +} diff --git a/bind.c b/bind.c new file mode 100644 index 00000000..ff773fd9 --- /dev/null +++ b/bind.c @@ -0,0 +1,23 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-2000 Wichert Akkerman + * Copyright (c) 1999-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +SYS_FUNC(bind) +{ + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + const int addrlen = tcp->u_arg[2]; + decode_sockaddr(tcp, tcp->u_arg[1], addrlen); + tprintf(", %d", addrlen); + + return RVAL_DECODED; +} diff --git a/bjm.c b/bjm.c index 926add3c..fb5af8bd 100644 --- a/bjm.c +++ b/bjm.c @@ -3,29 +3,10 @@ * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 1999-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/block.c b/block.c index 4d1a965b..893269d0 100644 --- a/block.c +++ b/block.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2009, 2010 Jeff Mahoney * Copyright (c) 2011-2016 Dmitry V. Levin + * Copyright (c) 2011-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -64,57 +45,14 @@ typedef struct blk_user_trace_setup { uint32_t pid; } struct_blk_user_trace_setup; -#include MPERS_DEFS - -#ifndef BLKPG -# define BLKPG _IO(0x12,105) -#endif +/* Provide fall-back definitions for BLK* ioctls */ +#define XLAT_MACROS_ONLY +#include "xlat/block_ioctl_cmds.h" +#undef XLAT_MACROS_ONLY -/* - * ioctl numbers <= 114 are present in Linux 2.4. The following ones have been - * added since then and headers containing them may not be available on every - * system. - */ +#include MPERS_DEFS -#ifndef BLKTRACESETUP -# define BLKTRACESETUP _IOWR(0x12, 115, struct_blk_user_trace_setup) -#endif -#ifndef BLKTRACESTART -# define BLKTRACESTART _IO(0x12,116) -#endif -#ifndef BLKTRACESTOP -# define BLKTRACESTOP _IO(0x12,117) -#endif -#ifndef BLKTRACETEARDOWN -# define BLKTRACETEARDOWN _IO(0x12,118) -#endif -#ifndef BLKDISCARD -# define BLKDISCARD _IO(0x12,119) -#endif -#ifndef BLKIOMIN -# define BLKIOMIN _IO(0x12,120) -#endif -#ifndef BLKIOOPT -# define BLKIOOPT _IO(0x12,121) -#endif -#ifndef BLKALIGNOFF -# define BLKALIGNOFF _IO(0x12,122) -#endif -#ifndef BLKPBSZGET -# define BLKPBSZGET _IO(0x12,123) -#endif -#ifndef BLKDISCARDZEROES -# define BLKDISCARDZEROES _IO(0x12,124) -#endif -#ifndef BLKSECDISCARD -# define BLKSECDISCARD _IO(0x12,125) -#endif -#ifndef BLKROTATIONAL -# define BLKROTATIONAL _IO(0x12,126) -#endif -#ifndef BLKZEROOUT -# define BLKZEROOUT _IO(0x12,127) -#endif +#include "print_fields.h" #include "xlat/blkpg_ops.h" @@ -123,21 +61,17 @@ print_blkpg_req(struct tcb *tcp, const struct_blkpg_ioctl_arg *blkpg) { struct_blkpg_partition p; - tprints("{"); - printxval(blkpg_ops, blkpg->op, "BLKPG_???"); - - tprintf(", flags=%d, datalen=%d, data=", - blkpg->flags, blkpg->datalen); + PRINT_FIELD_XVAL("{", *blkpg, op, blkpg_ops, "BLKPG_???"); + PRINT_FIELD_D(", ", *blkpg, flags); + PRINT_FIELD_D(", ", *blkpg, datalen); + tprints(", data="); if (!umove_or_printaddr(tcp, ptr_to_kulong(blkpg->data), &p)) { - tprintf("{start=%" PRId64 ", length=%" PRId64 - ", pno=%d, devname=", - p.start, p.length, p.pno); - print_quoted_string(p.devname, sizeof(p.devname), - QUOTE_0_TERMINATED); - tprints(", volname="); - print_quoted_string(p.volname, sizeof(p.volname), - QUOTE_0_TERMINATED); + PRINT_FIELD_D("{", p, start); + PRINT_FIELD_D(", ", p, length); + PRINT_FIELD_D(", ", p, pno); + PRINT_FIELD_CSTRING(", ", p, devname); + PRINT_FIELD_CSTRING(", ", p, volname); tprints("}"); } tprints("}"); @@ -169,7 +103,7 @@ MPERS_PRINTER_DECL(int, block_ioctl, struct tcb *const tcp, case BLKALIGNOFF: if (entering(tcp)) return 0; - /* fall through */ + ATTRIBUTE_FALLTHROUGH; /* take a signed int */ case BLKROSET: case BLKBSZSET: @@ -182,6 +116,8 @@ MPERS_PRINTER_DECL(int, block_ioctl, struct tcb *const tcp, case BLKIOMIN: case BLKIOOPT: case BLKDISCARDZEROES: + case BLKGETZONESZ: + case BLKGETNRZONES: if (entering(tcp)) return 0; tprints(", "); @@ -205,7 +141,6 @@ MPERS_PRINTER_DECL(int, block_ioctl, struct tcb *const tcp, printnum_ulong(tcp, arg); break; -#ifdef HAVE_BLKGETSIZE64 /* returns an uint64_t */ case BLKGETSIZE64: if (entering(tcp)) @@ -213,7 +148,6 @@ MPERS_PRINTER_DECL(int, block_ioctl, struct tcb *const tcp, tprints(", "); printnum_int64(tcp, arg, "%" PRIu64); break; -#endif /* takes a pair of uint64_t */ case BLKDISCARD: @@ -240,21 +174,18 @@ MPERS_PRINTER_DECL(int, block_ioctl, struct tcb *const tcp, tprints(", "); if (umove_or_printaddr(tcp, arg, &buts)) break; - tprintf("{act_mask=%u, buf_size=%u, " - "buf_nr=%u, start_lba=%" PRIu64 ", " - "end_lba=%" PRIu64 ", pid=%u", - (unsigned)buts.act_mask, buts.buf_size, - buts.buf_nr, buts.start_lba, - buts.end_lba, buts.pid); - return 1; + PRINT_FIELD_U("{", buts, act_mask); + PRINT_FIELD_U(", ", buts, buf_size); + PRINT_FIELD_U(", ", buts, buf_nr); + PRINT_FIELD_U(", ", buts, start_lba); + PRINT_FIELD_U(", ", buts, end_lba); + PRINT_FIELD_U(", ", buts, pid); + return 0; } else { struct_blk_user_trace_setup buts; - if (!syserror(tcp) && !umove(tcp, arg, &buts)) { - tprints(", name="); - print_quoted_string(buts.name, sizeof(buts.name), - QUOTE_0_TERMINATED); - } + if (!syserror(tcp) && !umove(tcp, arg, &buts)) + PRINT_FIELD_CSTRING(", ", buts, name); tprints("}"); break; } @@ -270,5 +201,5 @@ MPERS_PRINTER_DECL(int, block_ioctl, struct tcb *const tcp, return RVAL_DECODED; } - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } diff --git a/bpf.c b/bpf.c index 99410183..420b4402 100644 --- a/bpf.c +++ b/bpf.c @@ -1,304 +1,960 @@ /* - * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2017 Dmitry V. Levin * Copyright (c) 2017 Quentin Monnet + * Copyright (c) 2015-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" +#include "print_fields.h" #ifdef HAVE_LINUX_BPF_H # include #endif +#include + +#include "bpf_attr.h" #include "xlat/bpf_commands.h" +#include "xlat/bpf_file_mode_flags.h" #include "xlat/bpf_map_types.h" +#include "xlat/bpf_map_flags.h" #include "xlat/bpf_prog_types.h" +#include "xlat/bpf_prog_flags.h" #include "xlat/bpf_map_update_elem_flags.h" #include "xlat/bpf_attach_type.h" +#include "xlat/bpf_attach_flags.h" +#include "xlat/bpf_query_flags.h" +#include "xlat/bpf_task_fd_type.h" +#include "xlat/ebpf_regs.h" +#include "xlat/numa_node.h" + +#define DECL_BPF_CMD_DECODER(bpf_cmd_decoder) \ +int \ +bpf_cmd_decoder(struct tcb *const tcp, \ + const kernel_ulong_t addr, \ + const unsigned int size, \ + void *const data) \ +/* End of DECL_BPF_CMD_DECODER definition. */ + +#define BEGIN_BPF_CMD_DECODER(bpf_cmd) \ + static DECL_BPF_CMD_DECODER(decode_ ## bpf_cmd) \ + { \ + struct bpf_cmd ## _struct attr = {}; \ + const size_t attr_size = bpf_cmd ## _struct_size; \ + const unsigned int len = MIN(size, attr_size); \ + memcpy(&attr, data, len); \ + do { \ +/* End of BEGIN_BPF_CMD_DECODER definition. */ + +#define END_BPF_CMD_DECODER(rval) \ + decode_attr_extra_data(tcp, data, size, attr_size); \ + } while (0); \ + tprints("}"); \ + return (rval); \ + } \ +/* End of END_BPF_CMD_DECODER definition. */ + +#define BPF_CMD_ENTRY(bpf_cmd) \ + [bpf_cmd] = decode_ ## bpf_cmd + +typedef DECL_BPF_CMD_DECODER((*bpf_cmd_decoder_t)); + +/* + * A note about bpf syscall decoder: it doesn't perform any size sanity checks, + * so even if it leads to partial copying of one of the fields, the command + * handler will still use the (partially-copied-from-userspace, partially + * zeroed) field value. That's why we stop decoding and check for known sizes + * that correspond to released versions of the structure used by the specific + * command - it looks like the most sensible way to parse this insanity. + */ static int -bpf_map_create(struct tcb *const tcp, const kernel_ulong_t addr, - unsigned int size) +decode_attr_extra_data(struct tcb *const tcp, + const char *data, + unsigned int size, + const size_t attr_size) +{ + if (size <= attr_size) + return 0; + + data += attr_size; + size -= attr_size; + + unsigned int i; + for (i = 0; i < size; ++i) { + if (data[i]) { + tprints(", "); + if (abbrev(tcp)) { + tprints("..."); + } else { + tprintf("/* bytes %zu..%zu */ ", + attr_size, attr_size + size - 1); + print_quoted_string(data, size, + QUOTE_FORCE_HEX); + } + return RVAL_DECODED; + } + } + + return 0; +} + +struct ebpf_insn { + uint8_t code; + uint8_t dst_reg:4; + uint8_t src_reg:4; + int16_t off; + int32_t imm; +}; + +struct ebpf_insns_data { + unsigned int count; +}; + +static bool +print_ebpf_insn(struct tcb * const tcp, void * const elem_buf, + const size_t elem_size, void * const data) { - struct { - uint32_t map_type, key_size, value_size, max_entries; - } attr = {}; + struct ebpf_insns_data *eid = data; + struct ebpf_insn *insn = elem_buf; - if (!size) { - printaddr(addr); - return RVAL_DECODED | RVAL_FD; + if (eid->count++ >= BPF_MAXINSNS) { + tprints("..."); + return false; } - if (size > sizeof(attr)) - size = sizeof(attr); - if (umoven_or_printaddr(tcp, addr, size, &attr)) - return RVAL_DECODED | RVAL_FD; - tprints("{map_type="); - printxval(bpf_map_types, attr.map_type, "BPF_MAP_TYPE_???"); - tprintf(", key_size=%u, value_size=%u, max_entries=%u}", - attr.key_size, attr.value_size, attr.max_entries); + tprints("{code="); + print_bpf_filter_code(insn->code, true); - return RVAL_DECODED | RVAL_FD; + /* We can't use PRINT_FIELD_XVAL on bit fields */ + tprints(", dst_reg="); + printxval_index(ebpf_regs, insn->dst_reg, "BPF_REG_???"); + tprints(", src_reg="); + printxval_index(ebpf_regs, insn->src_reg, "BPF_REG_???"); + + PRINT_FIELD_D(", ", *insn, off); + PRINT_FIELD_X(", ", *insn, imm); + tprints("}"); + + return true; } static void -bpf_map_update_elem(struct tcb *const tcp, const kernel_ulong_t addr, - unsigned int size) +print_ebpf_prog(struct tcb *const tcp, const uint64_t addr, const uint32_t len) { - struct { - uint32_t map_fd; - uint64_t ATTRIBUTE_ALIGNED(8) key; - uint64_t ATTRIBUTE_ALIGNED(8) value; - uint64_t flags; - } attr = {}; - - if (!size) { + print_big_u64_addr(addr); + if (abbrev(tcp)) { printaddr(addr); - return; + } else { + struct ebpf_insns_data eid = {}; + struct ebpf_insn insn; + + print_array(tcp, addr, len, &insn, sizeof(insn), + tfetch_mem, print_ebpf_insn, &eid); + } +} + +BEGIN_BPF_CMD_DECODER(BPF_MAP_CREATE) +{ + PRINT_FIELD_XVAL_INDEX("{", attr, map_type, bpf_map_types, + "BPF_MAP_TYPE_???"); + PRINT_FIELD_U(", ", attr, key_size); + PRINT_FIELD_U(", ", attr, value_size); + PRINT_FIELD_U(", ", attr, max_entries); + + /* map_flags field was added in Linux commit v4.6-rc1~91^2~108^2~6. */ + if (len <= offsetof(struct BPF_MAP_CREATE_struct, map_flags)) + break; + PRINT_FIELD_FLAGS(", ", attr, map_flags, bpf_map_flags, "BPF_F_???"); + + /* + * inner_map_fd field was added in Linux commit + * v4.12-rc1~64^3~373^2~2. + */ + if (len <= offsetof(struct BPF_MAP_CREATE_struct, inner_map_fd)) + break; + PRINT_FIELD_FD(", ", attr, inner_map_fd, tcp); + + /* numa_node field was added in Linux commit v4.14-rc1~130^2~196^2~1. */ + if (len <= offsetof(struct BPF_MAP_CREATE_struct, numa_node)) + break; + if (attr.map_flags & BPF_F_NUMA_NODE) { + /* + * Kernel uses the value of -1 as a designation for "no NUMA + * node specified", and even uses NUMA_NO_NODE constant; + * however, the constant definition is not a part of UAPI + * headers, thus we can't simply print this named constant + * instead of the value. Let's force verbose xlat style instead + * in order to provide the information for the user while + * not hampering the availability to derive the actual value + * without the access to the kernel headers. + */ + tprints(", numa_node="); + printxvals_ex(attr.numa_node, NULL, + XLAT_STYLE_FMT_U | XLAT_STYLE_VERBOSE, + numa_node, NULL); } - if (size > sizeof(attr)) - size = sizeof(attr); - if (umoven_or_printaddr(tcp, addr, size, &attr)) + + /* map_name field was added in Linux commit v4.15-rc1~84^2~605^2~3. */ + if (len <= offsetof(struct BPF_MAP_CREATE_struct, map_name)) + break; + PRINT_FIELD_CSTRING_SZ(", ", attr, map_name, + MIN(sizeof(attr.map_name), + len - offsetof(struct BPF_MAP_CREATE_struct, + map_name))); + + /* + * map_ifindex field was added in Linux commit + * v4.16-rc1~123^2~145^2~5^2~8. + */ + if (len <= offsetof(struct BPF_MAP_CREATE_struct, map_ifindex)) + break; + PRINT_FIELD_IFINDEX(", ", attr, map_ifindex); + + /* + * The following three fields were introduced by Linux commits + * v4.18-rc1~114^2~417^2~1^2~3 and v4.18-rc1~114^2~148^2~7^2~2. + */ + if (len <= offsetof(struct BPF_MAP_CREATE_struct, btf_fd)) + break; + PRINT_FIELD_FD(", ", attr, btf_fd, tcp); + PRINT_FIELD_U(", ", attr, btf_key_type_id); + PRINT_FIELD_U(", ", attr, btf_value_type_id); +} +END_BPF_CMD_DECODER(RVAL_DECODED | RVAL_FD) + +BEGIN_BPF_CMD_DECODER(BPF_MAP_LOOKUP_ELEM) +{ + PRINT_FIELD_FD("{", attr, map_fd, tcp); + PRINT_FIELD_ADDR64(", ", attr, key); + PRINT_FIELD_ADDR64(", ", attr, value); +} +END_BPF_CMD_DECODER(RVAL_DECODED) + +#define decode_BPF_MAP_LOOKUP_AND_DELETE_ELEM decode_BPF_MAP_LOOKUP_ELEM + +BEGIN_BPF_CMD_DECODER(BPF_MAP_UPDATE_ELEM) +{ + PRINT_FIELD_FD("{", attr, map_fd, tcp); + PRINT_FIELD_ADDR64(", ", attr, key); + PRINT_FIELD_ADDR64(", ", attr, value); + PRINT_FIELD_XVAL_INDEX(", ", attr, flags, bpf_map_update_elem_flags, + "BPF_???"); +} +END_BPF_CMD_DECODER(RVAL_DECODED) + +BEGIN_BPF_CMD_DECODER(BPF_MAP_DELETE_ELEM) +{ + PRINT_FIELD_FD("{", attr, map_fd, tcp); + PRINT_FIELD_ADDR64(", ", attr, key); +} +END_BPF_CMD_DECODER(RVAL_DECODED) + +BEGIN_BPF_CMD_DECODER(BPF_MAP_GET_NEXT_KEY) +{ + PRINT_FIELD_FD("{", attr, map_fd, tcp); + PRINT_FIELD_ADDR64(", ", attr, key); + PRINT_FIELD_ADDR64(", ", attr, next_key); +} +END_BPF_CMD_DECODER(RVAL_DECODED) + +BEGIN_BPF_CMD_DECODER(BPF_PROG_LOAD) +{ + PRINT_FIELD_XVAL_INDEX("{", attr, prog_type, bpf_prog_types, + "BPF_PROG_TYPE_???"); + PRINT_FIELD_U(", ", attr, insn_cnt); + tprints(", insns="); + print_ebpf_prog(tcp, attr.insns, attr.insn_cnt); + + tprintf(", license="); + print_big_u64_addr(attr.license); + printstr(tcp, attr.license); + + /* log_* fields were added in Linux commit v3.18-rc1~52^2~1^2~4. */ + if (len <= offsetof(struct BPF_PROG_LOAD_struct, log_level)) + break; + PRINT_FIELD_U(", ", attr, log_level); + PRINT_FIELD_U(", ", attr, log_size); + tprintf(", log_buf="); + print_big_u64_addr(attr.log_buf); + printstr_ex(tcp, attr.log_buf, attr.log_size, QUOTE_0_TERMINATED); + + /* kern_version field was added in Linux commit v4.1-rc1~84^2~50. */ + if (len <= offsetof(struct BPF_PROG_LOAD_struct, kern_version)) + break; + tprints(", kern_version="); + print_kernel_version(attr.kern_version); + /* prog_flags field was added in Linux commit v4.12-rc2~34^2~29^2~2. */ + if (len <= offsetof(struct BPF_PROG_LOAD_struct, prog_flags)) + break; + PRINT_FIELD_FLAGS(", ", attr, prog_flags, bpf_prog_flags, "BPF_F_???"); + + /* prog_name field was added in Linux commit v4.15-rc1~84^2~605^2~4. */ + if (len <= offsetof(struct BPF_PROG_LOAD_struct, prog_name)) + break; + PRINT_FIELD_CSTRING_SZ(", ", attr, prog_name, + MIN(sizeof(attr.prog_name), + len - offsetof(struct BPF_PROG_LOAD_struct, + prog_name))); + + /* + * prog_ifindex field was added as prog_target_ifindex in Linux commit + * v4.15-rc1~84^2~127^2~13 and renamed to its current name in + * v4.15-rc1~15^2~5^2~3^2~7. + */ + if (len <= offsetof(struct BPF_PROG_LOAD_struct, prog_ifindex)) + break; + PRINT_FIELD_IFINDEX(", ", attr, prog_ifindex); + + /* + * expected_attach_type was added in Linux commit + * v4.17-rc1~148^2~19^2^2~8. + */ + if (len <= offsetof(struct BPF_PROG_LOAD_struct, expected_attach_type)) + break; + PRINT_FIELD_XVAL(", ", attr, expected_attach_type, bpf_attach_type, + "BPF_???"); + + /* + * The following seven fields were introduced by Linux commits + * v5.0-rc1~129^2~209^2~16^2~8 and v5.0-rc1~129^2~114^2~5^2~6. + */ + if (len <= offsetof(struct BPF_PROG_LOAD_struct, prog_btf_fd)) + break; + PRINT_FIELD_FD(", ", attr, prog_btf_fd, tcp); + PRINT_FIELD_U(", ", attr, func_info_rec_size); + PRINT_FIELD_ADDR64(", ", attr, func_info); + PRINT_FIELD_U(", ", attr, func_info_cnt); + PRINT_FIELD_U(", ", attr, line_info_rec_size); + PRINT_FIELD_ADDR64(", ", attr, line_info); + PRINT_FIELD_U(", ", attr, line_info_cnt); +} +END_BPF_CMD_DECODER(RVAL_DECODED | RVAL_FD) + +BEGIN_BPF_CMD_DECODER(BPF_OBJ_PIN) +{ + tprintf("{pathname="); + print_big_u64_addr(attr.pathname); + printpath(tcp, attr.pathname); + + PRINT_FIELD_FD(", ", attr, bpf_fd, tcp); + + /* file_flags field was added in Linux v4.15-rc1~84^2~384^2~4 */ + if (len <= offsetof(struct BPF_OBJ_PIN_struct, file_flags)) + break; + PRINT_FIELD_FLAGS(", ", attr, file_flags, bpf_file_mode_flags, + "BPF_F_???"); +} +END_BPF_CMD_DECODER(RVAL_DECODED | RVAL_FD) + +#define decode_BPF_OBJ_GET decode_BPF_OBJ_PIN + +BEGIN_BPF_CMD_DECODER(BPF_PROG_ATTACH) +{ + PRINT_FIELD_FD("{", attr, target_fd, tcp); + PRINT_FIELD_FD(", ", attr, attach_bpf_fd, tcp); + PRINT_FIELD_XVAL_INDEX(", ", attr, attach_type, bpf_attach_type, + "BPF_???"); + PRINT_FIELD_FLAGS(", ", attr, attach_flags, bpf_attach_flags, + "BPF_F_???"); +} +END_BPF_CMD_DECODER(RVAL_DECODED) + +BEGIN_BPF_CMD_DECODER(BPF_PROG_DETACH) +{ + PRINT_FIELD_FD("{", attr, target_fd, tcp); + PRINT_FIELD_XVAL_INDEX(", ", attr, attach_type, bpf_attach_type, + "BPF_???"); +} +END_BPF_CMD_DECODER(RVAL_DECODED) + +BEGIN_BPF_CMD_DECODER(BPF_PROG_TEST_RUN) +{ + PRINT_FIELD_FD("{test={", attr, prog_fd, tcp); + PRINT_FIELD_U(", ", attr, retval); + PRINT_FIELD_U(", ", attr, data_size_in); + PRINT_FIELD_U(", ", attr, data_size_out); + PRINT_FIELD_ADDR64(", ", attr, data_in); + PRINT_FIELD_ADDR64(", ", attr, data_out); + PRINT_FIELD_U(", ", attr, repeat); + PRINT_FIELD_U(", ", attr, duration); + tprints("}"); +} +END_BPF_CMD_DECODER(RVAL_DECODED) + +BEGIN_BPF_CMD_DECODER(BPF_PROG_GET_NEXT_ID) +{ + PRINT_FIELD_U("{", attr, start_id); + PRINT_FIELD_U(", ", attr, next_id); + + /* open_flags field has been added in Linux v4.15-rc1~84^2~384^2~4 */ + if (len <= offsetof(struct BPF_PROG_GET_NEXT_ID_struct, open_flags)) + break; + PRINT_FIELD_FLAGS(", ", attr, open_flags, bpf_file_mode_flags, + "BPF_F_???"); +} +END_BPF_CMD_DECODER(RVAL_DECODED) + +#define decode_BPF_MAP_GET_NEXT_ID decode_BPF_PROG_GET_NEXT_ID + +BEGIN_BPF_CMD_DECODER(BPF_PROG_GET_FD_BY_ID) +{ + PRINT_FIELD_U("{", attr, prog_id); + PRINT_FIELD_U(", ", attr, next_id); + + /* open_flags field has been added in Linux v4.15-rc1~84^2~384^2~4 */ + if (len <= offsetof(struct BPF_PROG_GET_FD_BY_ID_struct, open_flags)) + break; + PRINT_FIELD_FLAGS(", ", attr, open_flags, bpf_file_mode_flags, + "BPF_F_???"); +} +END_BPF_CMD_DECODER(RVAL_DECODED | RVAL_FD) + +BEGIN_BPF_CMD_DECODER(BPF_MAP_GET_FD_BY_ID) +{ + PRINT_FIELD_U("{", attr, map_id); + PRINT_FIELD_U(", ", attr, next_id); + + /* open_flags field has been added in Linux v4.15-rc1~84^2~384^2~4 */ + if (len <= offsetof(struct BPF_MAP_GET_FD_BY_ID_struct, open_flags)) + break; + PRINT_FIELD_FLAGS(", ", attr, open_flags, bpf_file_mode_flags, + "BPF_F_???"); +} +END_BPF_CMD_DECODER(RVAL_DECODED | RVAL_FD) + +struct obj_get_info_saved; +typedef void (*print_bpf_obj_info_fn)(struct tcb *, + uint32_t bpf_fd, + const char *info_buf, + uint32_t size, + struct obj_get_info_saved *saved); + +struct obj_get_info_saved { + print_bpf_obj_info_fn print_fn; + + uint32_t info_len; + + uint32_t jited_prog_len; + uint32_t xlated_prog_len; + uint32_t nr_map_ids; + + uint32_t nr_jited_ksyms; + uint32_t nr_jited_func_lens; + uint64_t jited_ksyms; + uint64_t jited_func_lens; + + uint32_t func_info_rec_size; + uint32_t nr_func_info; + uint32_t nr_line_info; + uint32_t nr_jited_line_info; + uint64_t jited_line_info; + uint32_t line_info_rec_size; + uint32_t jited_line_info_rec_size; + uint32_t nr_prog_tags; +}; + +static void +print_bpf_map_info(struct tcb * const tcp, uint32_t bpf_fd, + const char *info_buf, uint32_t size, + struct obj_get_info_saved *saved) +{ + if (entering(tcp)) return; - tprints("{map_fd="); - printfd(tcp, attr.map_fd); - tprintf(", key=%#" PRIx64 ", value=%#" PRIx64 ", flags=", - attr.key, attr.value); - printxval64(bpf_map_update_elem_flags, attr.flags, "BPF_???"); + struct bpf_map_info_struct info = { 0 }; + const unsigned int len = MIN(size, bpf_map_info_struct_size); + + memcpy(&info, info_buf, len); + + PRINT_FIELD_XVAL("{", info, type, bpf_map_types, "BPF_MAP_TYPE_???"); + PRINT_FIELD_U(", ", info, id); + PRINT_FIELD_U(", ", info, key_size); + PRINT_FIELD_U(", ", info, value_size); + PRINT_FIELD_U(", ", info, max_entries); + PRINT_FIELD_FLAGS(", ", info, map_flags, bpf_map_flags, "BPF_F_???"); + + /* + * "name" field was introduced by Linux commit v4.15-rc1~84^2~605^2~3. + */ + if (len <= offsetof(struct bpf_map_info_struct, name)) + goto print_bpf_map_info_end; + PRINT_FIELD_CSTRING(", ", info, name); + + /* + * ifindex, netns_dev, and netns_ino fields were introduced + * by Linux commit v4.16-rc1~123^2~109^2~5^2~4. + */ + if (len <= offsetof(struct bpf_map_info_struct, ifindex)) + goto print_bpf_map_info_end; + PRINT_FIELD_IFINDEX(", ", info, ifindex); + PRINT_FIELD_DEV(", ", info, netns_dev); + PRINT_FIELD_U(", ", info, netns_ino); + + /* + * The next three fields were introduced by Linux commits + * v4.18-rc1~114^2~223^2~21^2~4 and v4.18-rc1~114^2~148^2~7^2~2. + */ + if (len <= offsetof(struct bpf_map_info_struct, btf_id)) + goto print_bpf_map_info_end; + PRINT_FIELD_U(", ", info, btf_id); + PRINT_FIELD_U(", ", info, btf_key_type_id); + PRINT_FIELD_U(", ", info, btf_value_type_id); + + decode_attr_extra_data(tcp, info_buf, size, bpf_map_info_struct_size); + +print_bpf_map_info_end: tprints("}"); } static void -bpf_map_delete_elem(struct tcb *const tcp, const kernel_ulong_t addr, - unsigned int size) +print_bpf_prog_info(struct tcb * const tcp, uint32_t bpf_fd, + const char *info_buf, uint32_t size, + struct obj_get_info_saved *saved) { - struct { - uint32_t map_fd; - uint64_t ATTRIBUTE_ALIGNED(8) key; - } attr = {}; + struct bpf_prog_info_struct info = { 0 }; + const unsigned int len = MIN(size, bpf_prog_info_struct_size); + uint64_t map_id_buf; + + memcpy(&info, info_buf, len); + + if (entering(tcp)) { + saved->jited_prog_len = info.jited_prog_len; + saved->xlated_prog_len = info.xlated_prog_len; + saved->nr_map_ids = info.nr_map_ids; + saved->nr_jited_ksyms = info.nr_jited_ksyms; + saved->nr_jited_func_lens = info.nr_jited_func_lens; + saved->jited_ksyms = info.jited_ksyms; + saved->jited_func_lens = info.jited_func_lens; + + saved->func_info_rec_size = info.func_info_rec_size; + saved->nr_func_info = info.nr_func_info; + saved->nr_line_info = info.nr_line_info; + saved->nr_jited_line_info = info.nr_jited_line_info; + saved->jited_line_info = info.jited_line_info; + saved->line_info_rec_size = info.line_info_rec_size; + saved->jited_line_info_rec_size = info.jited_line_info_rec_size; + saved->nr_prog_tags = info.nr_prog_tags; - if (!size) { - printaddr(addr); return; } - if (size > sizeof(attr)) - size = sizeof(attr); - if (umoven_or_printaddr(tcp, addr, size, &attr)) - return; - tprints("{map_fd="); - printfd(tcp, attr.map_fd); - tprintf(", key=%#" PRIx64 "}", attr.key); + PRINT_FIELD_XVAL("{", info, type, bpf_prog_types, "BPF_PROG_TYPE_???"); + PRINT_FIELD_U(", ", info, id); + PRINT_FIELD_HEX_ARRAY(", ", info, tag); + + tprints(", jited_prog_len="); + if (saved->jited_prog_len != info.jited_prog_len) + tprintf("%" PRIu32 " => ", saved->jited_prog_len); + tprintf("%" PRIu32, info.jited_prog_len); + + tprints(", jited_prog_insns="); + print_big_u64_addr(info.jited_prog_insns); + printstr_ex(tcp, info.jited_prog_insns, info.jited_prog_len, + QUOTE_FORCE_HEX); + + tprints(", xlated_prog_len="); + if (saved->xlated_prog_len != info.xlated_prog_len) + tprintf("%" PRIu32 " => ", saved->xlated_prog_len); + tprintf("%" PRIu32, info.xlated_prog_len); + + tprints(", xlated_prog_insns="); + print_ebpf_prog(tcp, info.xlated_prog_insns, + MIN(saved->xlated_prog_len, info.xlated_prog_len) / 8); + + /* + * load_time, created_by_uid, nr_map_ids, map_ids, and name fields + * were introduced by Linux commit v4.15-rc1~84^2~605^2~4. + */ + if (len <= offsetof(struct bpf_prog_info_struct, load_time)) + goto print_bpf_prog_info_end; + PRINT_FIELD_U(", ", info, load_time); + PRINT_FIELD_UID(", ", info, created_by_uid); + + tprints(", nr_map_ids="); + if (saved->nr_map_ids != info.nr_map_ids) + tprintf("%" PRIu32 " => ", saved->nr_map_ids); + tprintf("%" PRIu32, info.nr_map_ids); + + tprints(", map_ids="); + print_big_u64_addr(info.map_ids); + print_array(tcp, info.map_ids, MIN(saved->nr_map_ids, info.nr_map_ids), + &map_id_buf, sizeof(map_id_buf), + tfetch_mem, print_uint32_array_member, 0); + + PRINT_FIELD_CSTRING(", ", info, name); + + /* + * ifindex, netns_dev, and netns_ino fields were introduced + * by Linux commit v4.16-rc1~123^2~227^2~5^2~2, and + * gpl_compatible was added later by Linux commit + * v4.18-rc1~114^2~376^2~6. + */ + if (len <= offsetof(struct bpf_prog_info_struct, ifindex)) + goto print_bpf_prog_info_end; + PRINT_FIELD_IFINDEX(", ", info, ifindex); + tprintf(", gpl_compatible=%u", info.gpl_compatible); + PRINT_FIELD_DEV(", ", info, netns_dev); + PRINT_FIELD_U(", ", info, netns_ino); + + /* + * The next four fields were introduced by Linux commits + * v4.18-rc1~114^2~148^2~3^2~6 and v4.18-rc1~114^2~148^2~3^2~2. + */ + if (len <= offsetof(struct bpf_prog_info_struct, nr_jited_ksyms)) + goto print_bpf_prog_info_end; + + tprints(", nr_jited_ksyms="); + if (saved->nr_jited_ksyms != info.nr_jited_ksyms) + tprintf("%" PRIu32 " => ", saved->nr_jited_ksyms); + tprintf("%" PRIu32, info.nr_jited_ksyms); + + tprints(", nr_jited_func_lens="); + if (saved->nr_jited_func_lens != info.nr_jited_func_lens) + tprintf("%" PRIu32 " => ", saved->nr_jited_func_lens); + tprintf("%" PRIu32, info.nr_jited_func_lens); + + tprints(", jited_ksyms="); + if (saved->jited_ksyms != info.jited_ksyms) { + printaddr64(saved->jited_ksyms); + tprints(" => "); + } + printaddr64(info.jited_ksyms); + + tprints(", jited_func_lens="); + if (saved->jited_func_lens != info.jited_func_lens) { + printaddr64(saved->jited_func_lens); + tprints(" => "); + } + printaddr64(info.jited_func_lens); + + /* + * The next twelve fields were introduced by Linux commits + * v5.0-rc1~129^2~209^2~16^2~8 + * v5.0-rc1~129^2~114^2~5^2~6 + * v5.0-rc1~129^2~114^2^2~2 + * v5.0-rc1~129^2~15^2~22 + */ + if (len <= offsetof(struct bpf_prog_info_struct, btf_id)) + goto print_bpf_prog_info_end; + + PRINT_FIELD_U(", ", info, btf_id); + + tprints(", func_info_rec_size="); + if (saved->func_info_rec_size != info.func_info_rec_size) + tprintf("%" PRIu32 " => ", saved->func_info_rec_size); + tprintf("%" PRIu32, info.func_info_rec_size); + + PRINT_FIELD_ADDR64(", ", info, func_info); + + tprints(", nr_func_info="); + if (saved->nr_func_info != info.nr_func_info) + tprintf("%" PRIu32 " => ", saved->nr_func_info); + tprintf("%" PRIu32, info.nr_func_info); + + tprints(", nr_line_info="); + if (saved->nr_line_info != info.nr_line_info) + tprintf("%" PRIu32 " => ", saved->nr_line_info); + tprintf("%" PRIu32, info.nr_line_info); + + PRINT_FIELD_ADDR64(", ", info, line_info); + + tprints(", jited_line_info="); + if (saved->jited_line_info != info.jited_line_info) { + printaddr64(saved->jited_line_info); + tprints(" => "); + } + printaddr64(info.jited_line_info); + + tprints(", nr_jited_line_info="); + if (saved->nr_jited_line_info != info.nr_jited_line_info) + tprintf("%" PRIu32 " => ", saved->nr_jited_line_info); + tprintf("%" PRIu32, info.nr_jited_line_info); + + tprints(", line_info_rec_size="); + if (saved->line_info_rec_size != info.line_info_rec_size) + tprintf("%" PRIu32 " => ", saved->line_info_rec_size); + tprintf("%" PRIu32, info.line_info_rec_size); + + tprints(", jited_line_info_rec_size="); + if (saved->jited_line_info_rec_size != info.jited_line_info_rec_size) + tprintf("%" PRIu32 " => ", saved->jited_line_info_rec_size); + tprintf("%" PRIu32, info.jited_line_info_rec_size); + + tprints(", nr_prog_tags="); + if (saved->nr_prog_tags != info.nr_prog_tags) + tprintf("%" PRIu32 " => ", saved->nr_prog_tags); + tprintf("%" PRIu32, info.nr_prog_tags); + + PRINT_FIELD_ADDR64(", ", info, prog_tags); + + /* + * run_time_ns and run_cnt fields were introduced + * by Linux commit v5.1-rc1~178^2~17^2~15^2~2. + */ + if (len <= offsetof(struct bpf_prog_info_struct, run_time_ns)) + goto print_bpf_prog_info_end; + + PRINT_FIELD_U(", ", info, run_time_ns); + PRINT_FIELD_U(", ", info, run_cnt); + + decode_attr_extra_data(tcp, info_buf, size, bpf_prog_info_struct_size); + +print_bpf_prog_info_end: + tprints("}"); } -static int -bpf_map_io(struct tcb *const tcp, const kernel_ulong_t addr, unsigned int size, - const char *const text) +static const char * +fetch_bpf_obj_info(struct tcb * const tcp, uint64_t info, uint32_t size) +{ + static char *info_buf; + + if (!info_buf) + info_buf = xmalloc(get_pagesize()); + + memset(info_buf, 0, get_pagesize()); + + if (size > 0 && size <= get_pagesize() + && !umoven(tcp, info, size, info_buf)) + return info_buf; + + return NULL; +} + +static void +print_bpf_obj_info_addr(struct tcb * const tcp, uint64_t addr) +{ + if (exiting(tcp)) + printaddr64(addr); +} + +static void +print_bpf_obj_info(struct tcb * const tcp, uint32_t bpf_fd, uint64_t info, + uint32_t size, struct obj_get_info_saved *saved) { - struct bpf_io_elem_struct { - uint32_t map_fd; - uint64_t ATTRIBUTE_ALIGNED(8) key; - uint64_t ATTRIBUTE_ALIGNED(8) value; - } attr = {}; - - if (exiting(tcp)) { - if (!syserror(tcp) && !umove_or_printaddr(tcp, addr, &attr)) - tprintf(", %s=%#" PRIx64, text, attr.value); - tprints("}"); - return RVAL_DECODED; + if (abbrev(tcp)) { + print_bpf_obj_info_addr(tcp, info); + return; } - if (!size) { - printaddr(addr); - return RVAL_DECODED; + static struct { + const char *id; + print_bpf_obj_info_fn print_fn; + } obj_printers[] = { + { "anon_inode:bpf-map", print_bpf_map_info }, + { "anon_inode:bpf-prog", print_bpf_prog_info } + }; + + if (entering(tcp)) { + char path[PATH_MAX + 1]; + + if (getfdpath(tcp, bpf_fd, path, sizeof(path)) > 0) { + for (size_t i = 0; i < ARRAY_SIZE(obj_printers); ++i) { + if (!strcmp(path, obj_printers[i].id)) { + saved->print_fn = + obj_printers[i].print_fn; + break; + } + } + } + } + + if (!saved || !saved->print_fn) { + print_bpf_obj_info_addr(tcp, info); + return; } - if (size > sizeof(attr)) - size = sizeof(attr); - if (umoven_or_printaddr(tcp, addr, size, &attr)) - return RVAL_DECODED; - tprints("{map_fd="); - printfd(tcp, attr.map_fd); - tprintf(", key=%#" PRIx64, attr.key); + const char *info_buf = fetch_bpf_obj_info(tcp, info, size); - return 0; + if (info_buf) + saved->print_fn(tcp, bpf_fd, info_buf, size, saved); + else + print_bpf_obj_info_addr(tcp, info); } -static int -bpf_prog_load(struct tcb *const tcp, const kernel_ulong_t addr, - unsigned int size) +BEGIN_BPF_CMD_DECODER(BPF_OBJ_GET_INFO_BY_FD) { - struct { - uint32_t prog_type, insn_cnt; - uint64_t ATTRIBUTE_ALIGNED(8) insns, license; - uint32_t log_level, log_size; - uint64_t ATTRIBUTE_ALIGNED(8) log_buf; - uint32_t kern_version; - } attr = {}; - - if (!size) { - printaddr(addr); - return RVAL_DECODED | RVAL_FD; + struct obj_get_info_saved *saved; + + if (entering(tcp)) { + saved = xzalloc(sizeof(*saved)); + saved->info_len = attr.info_len; + set_tcb_priv_data(tcp, saved, free); + + PRINT_FIELD_FD("{info={", attr, bpf_fd, tcp); + PRINT_FIELD_U(", ", attr, info_len); + } else { + saved = get_tcb_priv_data(tcp); + + if (saved && (saved->info_len != attr.info_len)) + tprintf(" => %u", attr.info_len); + + tprintf(", info="); } - if (size > sizeof(attr)) - size = sizeof(attr); - if (umoven_or_printaddr(tcp, addr, size, &attr)) - return RVAL_DECODED | RVAL_FD; - - tprints("{prog_type="); - printxval(bpf_prog_types, attr.prog_type, "BPF_PROG_TYPE_???"); - tprintf(", insn_cnt=%u, insns=%#" PRIx64 ", license=", - attr.insn_cnt, attr.insns); - printstr(tcp, attr.license); - tprintf(", log_level=%u, log_size=%u, log_buf=%#" PRIx64 ", kern_version=%u}", - attr.log_level, attr.log_size, attr.log_buf, attr.kern_version); - return RVAL_DECODED | RVAL_FD; + print_bpf_obj_info(tcp, attr.bpf_fd, attr.info, attr.info_len, saved); + + if (entering(tcp)) + return 0; + + tprints("}"); } +END_BPF_CMD_DECODER(RVAL_DECODED) -static int -bpf_obj_manage(struct tcb *const tcp, const kernel_ulong_t addr, - unsigned int size) +BEGIN_BPF_CMD_DECODER(BPF_PROG_QUERY) { - struct { - uint64_t ATTRIBUTE_ALIGNED(8) pathname; - uint32_t bpf_fd; - } attr = {}; + uint32_t prog_id_buf; - if (!size) { - printaddr(addr); - return RVAL_DECODED | RVAL_FD; + if (entering(tcp)) { + PRINT_FIELD_FD("{query={", attr, target_fd, tcp); + PRINT_FIELD_XVAL_INDEX(", ", attr, attach_type, bpf_attach_type, + "BPF_???"); + PRINT_FIELD_FLAGS(", ", attr, query_flags, bpf_query_flags, + "BPF_F_QUERY_???"); + PRINT_FIELD_FLAGS(", ", attr, attach_flags, bpf_attach_flags, + "BPF_F_???"); + + tprints(", prog_ids="); + + set_tcb_priv_ulong(tcp, attr.prog_cnt); + + return 0; } - if (size > sizeof(attr)) - size = sizeof(attr); - if (umoven_or_printaddr(tcp, addr, size, &attr)) - return RVAL_DECODED | RVAL_FD; - tprintf("{pathname="); - printpath(tcp, attr.pathname); - tprints(", bpf_fd="); - printfd(tcp, attr.bpf_fd); - tprintf("}"); + print_big_u64_addr(attr.prog_ids); + print_array(tcp, attr.prog_ids, attr.prog_cnt, &prog_id_buf, + sizeof(prog_id_buf), tfetch_mem, + print_uint32_array_member, 0); - return RVAL_DECODED | RVAL_FD; + tprints(", prog_cnt="); + const uint32_t prog_cnt_entering = get_tcb_priv_ulong(tcp); + if (prog_cnt_entering != attr.prog_cnt) + tprintf("%" PRIu32 " => ", prog_cnt_entering); + tprintf("%" PRIu32, attr.prog_cnt); + tprints("}"); } +END_BPF_CMD_DECODER(RVAL_DECODED) -static int -bpf_prog_attach_detach(struct tcb *const tcp, const kernel_ulong_t addr, - unsigned int size, bool print_attach_bpf_fd) +BEGIN_BPF_CMD_DECODER(BPF_RAW_TRACEPOINT_OPEN) { - struct { - uint32_t target_fd, attach_bpf_fd, attach_type; - } attr = {}; + enum { TP_NAME_SIZE = 128 }; - if (!size) { - printaddr(addr); - return RVAL_DECODED; - } - if (size > sizeof(attr)) - size = sizeof(attr); - if (umoven_or_printaddr(tcp, addr, size, &attr)) - return RVAL_DECODED; - - tprintf("{target_fd="); - printfd(tcp, attr.target_fd); - if (print_attach_bpf_fd) { - tprintf(", attach_bpf_fd="); - printfd(tcp, attr.attach_bpf_fd); - } - tprintf(", attach_type="); - printxval(bpf_attach_type, attr.attach_type, "BPF_???"); - tprintf("}"); + tprintf("{raw_tracepoint={name="); + print_big_u64_addr(attr.name); + printstr_ex(tcp, attr.name, TP_NAME_SIZE, QUOTE_0_TERMINATED); + + PRINT_FIELD_FD(", ", attr, prog_fd, tcp); - return RVAL_DECODED; + tprints("}"); } +END_BPF_CMD_DECODER(RVAL_DECODED) -static int -bpf_prog_attach(struct tcb *const tcp, const kernel_ulong_t addr, - unsigned int size) +BEGIN_BPF_CMD_DECODER(BPF_BTF_LOAD) { - return bpf_prog_attach_detach(tcp, addr, size, true); + tprints("{btf="); + print_big_u64_addr(attr.btf); + printstrn(tcp, attr.btf, attr.btf_size); + PRINT_FIELD_ADDR64(", ", attr, btf_log_buf); + PRINT_FIELD_U(", ", attr, btf_size); + PRINT_FIELD_U(", ", attr, btf_log_size); + PRINT_FIELD_U(", ", attr, btf_log_level); } +END_BPF_CMD_DECODER(RVAL_DECODED | RVAL_FD) -static int -bpf_prog_detach(struct tcb *const tcp, const kernel_ulong_t addr, - unsigned int size) +BEGIN_BPF_CMD_DECODER(BPF_BTF_GET_FD_BY_ID) { - return bpf_prog_attach_detach(tcp, addr, size, false); + PRINT_FIELD_U("{", attr, btf_id); } +END_BPF_CMD_DECODER(RVAL_DECODED | RVAL_FD) + +BEGIN_BPF_CMD_DECODER(BPF_TASK_FD_QUERY) +{ + if (entering(tcp)) { + set_tcb_priv_ulong(tcp, attr.buf_len); + + PRINT_FIELD_U("{task_fd_query={", attr, pid); + PRINT_FIELD_FD(", ", attr, fd, tcp); + PRINT_FIELD_U(", ", attr, flags); + PRINT_FIELD_U(", ", attr, buf_len); + + return 0; + } + + unsigned int saved_buf_len = get_tcb_priv_ulong(tcp); + + if (saved_buf_len != attr.buf_len) + tprintf(" => %u", attr.buf_len); + + const unsigned int buf_len = MIN(saved_buf_len, attr.buf_len); + tprintf(", buf="); + print_big_u64_addr(attr.buf); + printstr_ex(tcp, attr.buf, buf_len, QUOTE_0_TERMINATED); + PRINT_FIELD_U(", ", attr, prog_id); + PRINT_FIELD_XVAL_INDEX(", ", attr, fd_type, bpf_task_fd_type, + "BPF_FD_TYPE_???"); + PRINT_FIELD_X(", ", attr, probe_offset); + PRINT_FIELD_X(", ", attr, probe_addr); + + tprints("}"); +} +END_BPF_CMD_DECODER(RVAL_DECODED) SYS_FUNC(bpf) { + static const bpf_cmd_decoder_t bpf_cmd_decoders[] = { + BPF_CMD_ENTRY(BPF_MAP_CREATE), + BPF_CMD_ENTRY(BPF_MAP_LOOKUP_ELEM), + BPF_CMD_ENTRY(BPF_MAP_UPDATE_ELEM), + BPF_CMD_ENTRY(BPF_MAP_DELETE_ELEM), + BPF_CMD_ENTRY(BPF_MAP_GET_NEXT_KEY), + BPF_CMD_ENTRY(BPF_PROG_LOAD), + BPF_CMD_ENTRY(BPF_OBJ_PIN), + BPF_CMD_ENTRY(BPF_OBJ_GET), + BPF_CMD_ENTRY(BPF_PROG_ATTACH), + BPF_CMD_ENTRY(BPF_PROG_DETACH), + BPF_CMD_ENTRY(BPF_PROG_TEST_RUN), + BPF_CMD_ENTRY(BPF_PROG_GET_NEXT_ID), + BPF_CMD_ENTRY(BPF_MAP_GET_NEXT_ID), + BPF_CMD_ENTRY(BPF_PROG_GET_FD_BY_ID), + BPF_CMD_ENTRY(BPF_MAP_GET_FD_BY_ID), + BPF_CMD_ENTRY(BPF_OBJ_GET_INFO_BY_FD), + BPF_CMD_ENTRY(BPF_PROG_QUERY), + BPF_CMD_ENTRY(BPF_RAW_TRACEPOINT_OPEN), + BPF_CMD_ENTRY(BPF_BTF_LOAD), + BPF_CMD_ENTRY(BPF_BTF_GET_FD_BY_ID), + BPF_CMD_ENTRY(BPF_TASK_FD_QUERY), + BPF_CMD_ENTRY(BPF_MAP_LOOKUP_AND_DELETE_ELEM), + }; + const unsigned int cmd = tcp->u_arg[0]; const kernel_ulong_t addr = tcp->u_arg[1]; const unsigned int size = tcp->u_arg[2]; int rc = RVAL_DECODED; if (entering(tcp)) { - printxval(bpf_commands, cmd, "BPF_???"); + printxval_index(bpf_commands, cmd, "BPF_???"); tprints(", "); } - switch (cmd) { - case BPF_MAP_CREATE: - rc = bpf_map_create(tcp, addr, size); - break; - case BPF_MAP_LOOKUP_ELEM: - rc = bpf_map_io(tcp, addr, size, "value"); - break; - case BPF_MAP_UPDATE_ELEM: - bpf_map_update_elem(tcp, addr, size); - break; - case BPF_MAP_DELETE_ELEM: - bpf_map_delete_elem(tcp, addr, size); - break; - case BPF_MAP_GET_NEXT_KEY: - rc = bpf_map_io(tcp, addr, size, "next_key"); - break; - case BPF_PROG_LOAD: - rc = bpf_prog_load(tcp, addr, size); - break; - case BPF_OBJ_PIN: - rc = bpf_obj_manage(tcp, addr, size); - break; - case BPF_OBJ_GET: - rc = bpf_obj_manage(tcp, addr, size); - break; - case BPF_PROG_ATTACH: - rc = bpf_prog_attach(tcp, addr, size); - break; - case BPF_PROG_DETACH: - rc = bpf_prog_detach(tcp, addr, size); - break; - default: + if (size > 0 + && size <= get_pagesize() + && cmd < ARRAY_SIZE(bpf_cmd_decoders) + && bpf_cmd_decoders[cmd]) { + static char *buf; + + if (!buf) + buf = xmalloc(get_pagesize()); + + if (!umoven_or_printaddr_ignore_syserror(tcp, addr, size, buf)) + rc = bpf_cmd_decoders[cmd](tcp, addr, size, buf); + } else { printaddr(addr); - break; } - if (rc & RVAL_DECODED) + if (exiting(tcp) || (rc & RVAL_DECODED)) tprintf(", %u", size); return rc; diff --git a/bpf_attr.h b/bpf_attr.h new file mode 100644 index 00000000..5c5eee41 --- /dev/null +++ b/bpf_attr.h @@ -0,0 +1,343 @@ +/* + * Copyright (c) 2015-2018 Dmitry V. Levin + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_BPF_ATTR_H +# define STRACE_BPF_ATTR_H + +/* + * The policy is that all fields of type uint64_t in this header file + * must have ATTRIBUTE_ALIGNED(8). + * + * This should not cause any contradictions with + * unless the latter is buggy. + * + * By word "buggy" I mean containing such changes as Linux kernel commit + * v4.16-rc1~123^2~109^2~5^2~4. + */ + +# ifndef BPF_OBJ_NAME_LEN +# define BPF_OBJ_NAME_LEN 16U +# else +# if BPF_OBJ_NAME_LEN != 16U +# error "Unexpected value of BPF_OBJ_NAME_LEN" +# endif +# endif + +# ifndef BPF_TAG_SIZE +# define BPF_TAG_SIZE 8 +# else +# if BPF_TAG_SIZE != 8 +# error "Unexpected value of BPF_TAG_SIZE" +# endif +# endif + +struct BPF_MAP_CREATE_struct { + uint32_t map_type; + uint32_t key_size; + uint32_t value_size; + uint32_t max_entries; + uint32_t map_flags; + uint32_t inner_map_fd; + uint32_t numa_node; + char map_name[BPF_OBJ_NAME_LEN]; + uint32_t map_ifindex; + uint32_t btf_fd; + uint32_t btf_key_type_id; + uint32_t btf_value_type_id; +}; + +# define BPF_MAP_CREATE_struct_size \ + sizeof(struct BPF_MAP_CREATE_struct) +# define expected_BPF_MAP_CREATE_struct_size 60 + +struct BPF_MAP_LOOKUP_ELEM_struct { + uint32_t map_fd; + uint64_t ATTRIBUTE_ALIGNED(8) key; + uint64_t ATTRIBUTE_ALIGNED(8) value; +}; + +# define BPF_MAP_LOOKUP_ELEM_struct_size \ + sizeof(struct BPF_MAP_LOOKUP_ELEM_struct) +# define expected_BPF_MAP_LOOKUP_ELEM_struct_size 24 + +struct BPF_MAP_UPDATE_ELEM_struct { + uint32_t map_fd; + uint64_t ATTRIBUTE_ALIGNED(8) key; + uint64_t ATTRIBUTE_ALIGNED(8) value; + uint64_t ATTRIBUTE_ALIGNED(8) flags; +}; + +# define BPF_MAP_UPDATE_ELEM_struct_size \ + sizeof(struct BPF_MAP_UPDATE_ELEM_struct) +# define expected_BPF_MAP_UPDATE_ELEM_struct_size 32 + +struct BPF_MAP_DELETE_ELEM_struct { + uint32_t map_fd; + uint64_t ATTRIBUTE_ALIGNED(8) key; +}; + +# define BPF_MAP_DELETE_ELEM_struct_size \ + sizeof(struct BPF_MAP_DELETE_ELEM_struct) +# define expected_BPF_MAP_DELETE_ELEM_struct_size 16 + +struct BPF_MAP_GET_NEXT_KEY_struct { + uint32_t map_fd; + uint64_t ATTRIBUTE_ALIGNED(8) key; + uint64_t ATTRIBUTE_ALIGNED(8) next_key; +}; + +# define BPF_MAP_GET_NEXT_KEY_struct_size \ + sizeof(struct BPF_MAP_GET_NEXT_KEY_struct) +# define expected_BPF_MAP_GET_NEXT_KEY_struct_size 24 + +struct BPF_PROG_LOAD_struct { + uint32_t prog_type; + uint32_t insn_cnt; + uint64_t ATTRIBUTE_ALIGNED(8) insns; + uint64_t ATTRIBUTE_ALIGNED(8) license; + uint32_t log_level; + uint32_t log_size; + uint64_t ATTRIBUTE_ALIGNED(8) log_buf; + uint32_t kern_version; + uint32_t prog_flags; + char prog_name[BPF_OBJ_NAME_LEN]; + uint32_t prog_ifindex; + uint32_t expected_attach_type; + uint32_t prog_btf_fd; + uint32_t func_info_rec_size; + uint64_t ATTRIBUTE_ALIGNED(8) func_info; + uint32_t func_info_cnt; + uint32_t line_info_rec_size; + uint64_t ATTRIBUTE_ALIGNED(8) line_info; + uint32_t line_info_cnt; +}; + +# define BPF_PROG_LOAD_struct_size \ + offsetofend(struct BPF_PROG_LOAD_struct, line_info_cnt) +# define expected_BPF_PROG_LOAD_struct_size 108 + +struct BPF_OBJ_PIN_struct { + uint64_t ATTRIBUTE_ALIGNED(8) pathname; + uint32_t bpf_fd; + uint32_t file_flags; +}; + +# define BPF_OBJ_PIN_struct_size \ + sizeof(struct BPF_OBJ_PIN_struct) +# define expected_BPF_OBJ_PIN_struct_size 16 + +# define BPF_OBJ_GET_struct BPF_OBJ_PIN_struct +# define BPF_OBJ_GET_struct_size BPF_OBJ_PIN_struct_size + +struct BPF_PROG_ATTACH_struct { + uint32_t target_fd; + uint32_t attach_bpf_fd; + uint32_t attach_type; + uint32_t attach_flags; +}; + +# define BPF_PROG_ATTACH_struct_size \ + sizeof(struct BPF_PROG_ATTACH_struct) +# define expected_BPF_PROG_ATTACH_struct_size 16 + +struct BPF_PROG_DETACH_struct { + uint32_t target_fd; + uint32_t dummy; + uint32_t attach_type; +}; + +# define BPF_PROG_DETACH_struct_size \ + sizeof(struct BPF_PROG_DETACH_struct) +# define expected_BPF_PROG_DETACH_struct_size 12 + +struct BPF_PROG_TEST_RUN_struct /* test */ { + uint32_t prog_fd; + uint32_t retval; + uint32_t data_size_in; + uint32_t data_size_out; + uint64_t ATTRIBUTE_ALIGNED(8) data_in; + uint64_t ATTRIBUTE_ALIGNED(8) data_out; + uint32_t repeat; + uint32_t duration; +}; + +# define BPF_PROG_TEST_RUN_struct_size \ + sizeof(struct BPF_PROG_TEST_RUN_struct) +# define expected_BPF_PROG_TEST_RUN_struct_size 40 + +struct BPF_PROG_GET_NEXT_ID_struct { + uint32_t start_id; + uint32_t next_id; + uint32_t open_flags; +}; + +# define BPF_PROG_GET_NEXT_ID_struct_size \ + sizeof(struct BPF_PROG_GET_NEXT_ID_struct) +# define expected_BPF_PROG_GET_NEXT_ID_struct_size 12 + +# define BPF_MAP_GET_NEXT_ID_struct BPF_PROG_GET_NEXT_ID_struct +# define BPF_MAP_GET_NEXT_ID_struct_size BPF_PROG_GET_NEXT_ID_struct_size + +struct BPF_PROG_GET_FD_BY_ID_struct { + uint32_t prog_id; + uint32_t next_id; + uint32_t open_flags; +}; + +# define BPF_PROG_GET_FD_BY_ID_struct_size \ + sizeof(struct BPF_PROG_GET_FD_BY_ID_struct) +# define expected_BPF_PROG_GET_FD_BY_ID_struct_size 12 + +struct BPF_MAP_GET_FD_BY_ID_struct { + uint32_t map_id; + uint32_t next_id; + uint32_t open_flags; +}; + +# define BPF_MAP_GET_FD_BY_ID_struct_size \ + sizeof(struct BPF_MAP_GET_FD_BY_ID_struct) +# define expected_BPF_MAP_GET_FD_BY_ID_struct_size 12 + +struct BPF_OBJ_GET_INFO_BY_FD_struct /* info */ { + uint32_t bpf_fd; + uint32_t info_len; + uint64_t ATTRIBUTE_ALIGNED(8) info; +}; + +# define BPF_OBJ_GET_INFO_BY_FD_struct_size \ + sizeof(struct BPF_OBJ_GET_INFO_BY_FD_struct) +# define expected_BPF_OBJ_GET_INFO_BY_FD_struct_size 16 + +struct BPF_PROG_QUERY_struct /* query */ { + uint32_t target_fd; + uint32_t attach_type; + uint32_t query_flags; + uint32_t attach_flags; + uint64_t ATTRIBUTE_ALIGNED(8) prog_ids; + uint32_t prog_cnt; +}; + +# define BPF_PROG_QUERY_struct_size \ + offsetofend(struct BPF_PROG_QUERY_struct, prog_cnt) +# define expected_BPF_PROG_QUERY_struct_size 28 + +struct BPF_RAW_TRACEPOINT_OPEN_struct /* raw_tracepoint */ { + uint64_t ATTRIBUTE_ALIGNED(8) name; + uint32_t prog_fd; +}; + +# define BPF_RAW_TRACEPOINT_OPEN_struct_size \ + offsetofend(struct BPF_RAW_TRACEPOINT_OPEN_struct, prog_fd) +# define expected_BPF_RAW_TRACEPOINT_OPEN_struct_size 12 + +struct BPF_BTF_LOAD_struct { + uint64_t ATTRIBUTE_ALIGNED(8) btf; + uint64_t ATTRIBUTE_ALIGNED(8) btf_log_buf; + uint32_t btf_size; + uint32_t btf_log_size; + uint32_t btf_log_level; +}; + +# define BPF_BTF_LOAD_struct_size \ + offsetofend(struct BPF_BTF_LOAD_struct, btf_log_level) +# define expected_BPF_BTF_LOAD_struct_size 28 + +struct BPF_BTF_GET_FD_BY_ID_struct { + uint32_t btf_id; +}; + +# define BPF_BTF_GET_FD_BY_ID_struct_size \ + sizeof(struct BPF_BTF_GET_FD_BY_ID_struct) +# define expected_BPF_BTF_GET_FD_BY_ID_struct_size 4 + +struct BPF_TASK_FD_QUERY_struct /* task_fd_query */ { + uint32_t pid; + uint32_t fd; + uint32_t flags; + uint32_t buf_len; + uint64_t ATTRIBUTE_ALIGNED(8) buf; + uint32_t prog_id; + uint32_t fd_type; + uint64_t ATTRIBUTE_ALIGNED(8) probe_offset; + uint64_t ATTRIBUTE_ALIGNED(8) probe_addr; +}; + +# define BPF_TASK_FD_QUERY_struct_size \ + sizeof(struct BPF_TASK_FD_QUERY_struct) +# define expected_BPF_TASK_FD_QUERY_struct_size 48 + +struct bpf_map_info_struct { + uint32_t type; + uint32_t id; + uint32_t key_size; + uint32_t value_size; + uint32_t max_entries; + uint32_t map_flags; + char name[BPF_OBJ_NAME_LEN]; + uint32_t ifindex; + /* + * The kernel UAPI is broken by Linux commit + * v4.16-rc1~123^2~109^2~5^2~4 . + */ + uint64_t ATTRIBUTE_ALIGNED(8) netns_dev; /* skip check */ + uint64_t ATTRIBUTE_ALIGNED(8) netns_ino; /* skip check */ + uint32_t btf_id; + uint32_t btf_key_type_id; + uint32_t btf_value_type_id; +}; + +# define bpf_map_info_struct_size \ + offsetofend(struct bpf_map_info_struct, btf_value_type_id) +# define expected_bpf_map_info_struct_size 76 + +struct bpf_prog_info_struct { + uint32_t type; + uint32_t id; + uint8_t tag[BPF_TAG_SIZE]; + uint32_t jited_prog_len; + uint32_t xlated_prog_len; + uint64_t ATTRIBUTE_ALIGNED(8) jited_prog_insns; + uint64_t ATTRIBUTE_ALIGNED(8) xlated_prog_insns; + uint64_t ATTRIBUTE_ALIGNED(8) load_time; + uint32_t created_by_uid; + uint32_t nr_map_ids; + uint64_t ATTRIBUTE_ALIGNED(8) map_ids; + char name[BPF_OBJ_NAME_LEN]; + uint32_t ifindex; + uint32_t gpl_compatible:1; + /* + * The kernel UAPI is broken by Linux commit + * v4.16-rc1~123^2~227^2~5^2~2 . + */ + uint64_t ATTRIBUTE_ALIGNED(8) netns_dev; /* skip check */ + uint64_t ATTRIBUTE_ALIGNED(8) netns_ino; /* skip check */ + uint32_t nr_jited_ksyms; + uint32_t nr_jited_func_lens; + uint64_t ATTRIBUTE_ALIGNED(8) jited_ksyms; + uint64_t ATTRIBUTE_ALIGNED(8) jited_func_lens; + uint32_t btf_id; + uint32_t func_info_rec_size; + uint64_t ATTRIBUTE_ALIGNED(8) func_info; + uint32_t nr_func_info; + uint32_t nr_line_info; + uint64_t ATTRIBUTE_ALIGNED(8) line_info; + uint64_t ATTRIBUTE_ALIGNED(8) jited_line_info; + uint32_t nr_jited_line_info; + uint32_t line_info_rec_size; + uint32_t jited_line_info_rec_size; + uint32_t nr_prog_tags; + uint64_t ATTRIBUTE_ALIGNED(8) prog_tags; + uint64_t ATTRIBUTE_ALIGNED(8) run_time_ns; + uint64_t ATTRIBUTE_ALIGNED(8) run_cnt; +}; + +# define bpf_prog_info_struct_size \ + sizeof(struct bpf_prog_info_struct) +# define expected_bpf_prog_info_struct_size 208 + +#endif /* !STRACE_BPF_ATTR_H */ diff --git a/bpf_attr_check.c b/bpf_attr_check.c new file mode 100644 index 00000000..a88c07c0 --- /dev/null +++ b/bpf_attr_check.c @@ -0,0 +1,1039 @@ +/* Generated by ./gen_bpf_attr_check.sh from bpf_attr.h; do not edit. */ +#include "defs.h" +#ifdef HAVE_LINUX_BPF_H +# include +# include "bpf_attr.h" +# include "static_assert.h" + +# define SoM(type_, member_) (sizeof(((type_ *)0)->member_)) + +# ifdef HAVE_UNION_BPF_ATTR_MAP_TYPE + static_assert(SoM(struct BPF_MAP_CREATE_struct, map_type) == SoM(union bpf_attr, map_type), + "BPF_MAP_CREATE_struct.map_type size mismatch"); + static_assert(offsetof(struct BPF_MAP_CREATE_struct, map_type) == offsetof(union bpf_attr, map_type), + "BPF_MAP_CREATE_struct.map_type offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_MAP_TYPE */ + +# ifdef HAVE_UNION_BPF_ATTR_KEY_SIZE + static_assert(SoM(struct BPF_MAP_CREATE_struct, key_size) == SoM(union bpf_attr, key_size), + "BPF_MAP_CREATE_struct.key_size size mismatch"); + static_assert(offsetof(struct BPF_MAP_CREATE_struct, key_size) == offsetof(union bpf_attr, key_size), + "BPF_MAP_CREATE_struct.key_size offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_KEY_SIZE */ + +# ifdef HAVE_UNION_BPF_ATTR_VALUE_SIZE + static_assert(SoM(struct BPF_MAP_CREATE_struct, value_size) == SoM(union bpf_attr, value_size), + "BPF_MAP_CREATE_struct.value_size size mismatch"); + static_assert(offsetof(struct BPF_MAP_CREATE_struct, value_size) == offsetof(union bpf_attr, value_size), + "BPF_MAP_CREATE_struct.value_size offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_VALUE_SIZE */ + +# ifdef HAVE_UNION_BPF_ATTR_MAX_ENTRIES + static_assert(SoM(struct BPF_MAP_CREATE_struct, max_entries) == SoM(union bpf_attr, max_entries), + "BPF_MAP_CREATE_struct.max_entries size mismatch"); + static_assert(offsetof(struct BPF_MAP_CREATE_struct, max_entries) == offsetof(union bpf_attr, max_entries), + "BPF_MAP_CREATE_struct.max_entries offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_MAX_ENTRIES */ + +# ifdef HAVE_UNION_BPF_ATTR_MAP_FLAGS + static_assert(SoM(struct BPF_MAP_CREATE_struct, map_flags) == SoM(union bpf_attr, map_flags), + "BPF_MAP_CREATE_struct.map_flags size mismatch"); + static_assert(offsetof(struct BPF_MAP_CREATE_struct, map_flags) == offsetof(union bpf_attr, map_flags), + "BPF_MAP_CREATE_struct.map_flags offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_MAP_FLAGS */ + +# ifdef HAVE_UNION_BPF_ATTR_INNER_MAP_FD + static_assert(SoM(struct BPF_MAP_CREATE_struct, inner_map_fd) == SoM(union bpf_attr, inner_map_fd), + "BPF_MAP_CREATE_struct.inner_map_fd size mismatch"); + static_assert(offsetof(struct BPF_MAP_CREATE_struct, inner_map_fd) == offsetof(union bpf_attr, inner_map_fd), + "BPF_MAP_CREATE_struct.inner_map_fd offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_INNER_MAP_FD */ + +# ifdef HAVE_UNION_BPF_ATTR_NUMA_NODE + static_assert(SoM(struct BPF_MAP_CREATE_struct, numa_node) == SoM(union bpf_attr, numa_node), + "BPF_MAP_CREATE_struct.numa_node size mismatch"); + static_assert(offsetof(struct BPF_MAP_CREATE_struct, numa_node) == offsetof(union bpf_attr, numa_node), + "BPF_MAP_CREATE_struct.numa_node offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_NUMA_NODE */ + +# ifdef HAVE_UNION_BPF_ATTR_MAP_NAME + static_assert(SoM(struct BPF_MAP_CREATE_struct, map_name) == SoM(union bpf_attr, map_name), + "BPF_MAP_CREATE_struct.map_name size mismatch"); + static_assert(offsetof(struct BPF_MAP_CREATE_struct, map_name) == offsetof(union bpf_attr, map_name), + "BPF_MAP_CREATE_struct.map_name offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_MAP_NAME */ + +# ifdef HAVE_UNION_BPF_ATTR_MAP_IFINDEX + static_assert(SoM(struct BPF_MAP_CREATE_struct, map_ifindex) == SoM(union bpf_attr, map_ifindex), + "BPF_MAP_CREATE_struct.map_ifindex size mismatch"); + static_assert(offsetof(struct BPF_MAP_CREATE_struct, map_ifindex) == offsetof(union bpf_attr, map_ifindex), + "BPF_MAP_CREATE_struct.map_ifindex offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_MAP_IFINDEX */ + +# ifdef HAVE_UNION_BPF_ATTR_BTF_FD + static_assert(SoM(struct BPF_MAP_CREATE_struct, btf_fd) == SoM(union bpf_attr, btf_fd), + "BPF_MAP_CREATE_struct.btf_fd size mismatch"); + static_assert(offsetof(struct BPF_MAP_CREATE_struct, btf_fd) == offsetof(union bpf_attr, btf_fd), + "BPF_MAP_CREATE_struct.btf_fd offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_BTF_FD */ + +# ifdef HAVE_UNION_BPF_ATTR_BTF_KEY_TYPE_ID + static_assert(SoM(struct BPF_MAP_CREATE_struct, btf_key_type_id) == SoM(union bpf_attr, btf_key_type_id), + "BPF_MAP_CREATE_struct.btf_key_type_id size mismatch"); + static_assert(offsetof(struct BPF_MAP_CREATE_struct, btf_key_type_id) == offsetof(union bpf_attr, btf_key_type_id), + "BPF_MAP_CREATE_struct.btf_key_type_id offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_BTF_KEY_TYPE_ID */ + +# ifdef HAVE_UNION_BPF_ATTR_BTF_VALUE_TYPE_ID + static_assert(SoM(struct BPF_MAP_CREATE_struct, btf_value_type_id) == SoM(union bpf_attr, btf_value_type_id), + "BPF_MAP_CREATE_struct.btf_value_type_id size mismatch"); + static_assert(offsetof(struct BPF_MAP_CREATE_struct, btf_value_type_id) == offsetof(union bpf_attr, btf_value_type_id), + "BPF_MAP_CREATE_struct.btf_value_type_id offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_BTF_VALUE_TYPE_ID */ + +static_assert(BPF_MAP_CREATE_struct_size == expected_BPF_MAP_CREATE_struct_size, + "BPF_MAP_CREATE_struct_size mismatch"); + +# ifdef HAVE_UNION_BPF_ATTR_MAP_FD + static_assert(SoM(struct BPF_MAP_LOOKUP_ELEM_struct, map_fd) == SoM(union bpf_attr, map_fd), + "BPF_MAP_LOOKUP_ELEM_struct.map_fd size mismatch"); + static_assert(offsetof(struct BPF_MAP_LOOKUP_ELEM_struct, map_fd) == offsetof(union bpf_attr, map_fd), + "BPF_MAP_LOOKUP_ELEM_struct.map_fd offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_MAP_FD */ + +# ifdef HAVE_UNION_BPF_ATTR_KEY + static_assert(SoM(struct BPF_MAP_LOOKUP_ELEM_struct, key) == SoM(union bpf_attr, key), + "BPF_MAP_LOOKUP_ELEM_struct.key size mismatch"); + static_assert(offsetof(struct BPF_MAP_LOOKUP_ELEM_struct, key) == offsetof(union bpf_attr, key), + "BPF_MAP_LOOKUP_ELEM_struct.key offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_KEY */ + +# ifdef HAVE_UNION_BPF_ATTR_VALUE + static_assert(SoM(struct BPF_MAP_LOOKUP_ELEM_struct, value) == SoM(union bpf_attr, value), + "BPF_MAP_LOOKUP_ELEM_struct.value size mismatch"); + static_assert(offsetof(struct BPF_MAP_LOOKUP_ELEM_struct, value) == offsetof(union bpf_attr, value), + "BPF_MAP_LOOKUP_ELEM_struct.value offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_VALUE */ + +static_assert(BPF_MAP_LOOKUP_ELEM_struct_size == expected_BPF_MAP_LOOKUP_ELEM_struct_size, + "BPF_MAP_LOOKUP_ELEM_struct_size mismatch"); + +# ifdef HAVE_UNION_BPF_ATTR_MAP_FD + static_assert(SoM(struct BPF_MAP_UPDATE_ELEM_struct, map_fd) == SoM(union bpf_attr, map_fd), + "BPF_MAP_UPDATE_ELEM_struct.map_fd size mismatch"); + static_assert(offsetof(struct BPF_MAP_UPDATE_ELEM_struct, map_fd) == offsetof(union bpf_attr, map_fd), + "BPF_MAP_UPDATE_ELEM_struct.map_fd offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_MAP_FD */ + +# ifdef HAVE_UNION_BPF_ATTR_KEY + static_assert(SoM(struct BPF_MAP_UPDATE_ELEM_struct, key) == SoM(union bpf_attr, key), + "BPF_MAP_UPDATE_ELEM_struct.key size mismatch"); + static_assert(offsetof(struct BPF_MAP_UPDATE_ELEM_struct, key) == offsetof(union bpf_attr, key), + "BPF_MAP_UPDATE_ELEM_struct.key offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_KEY */ + +# ifdef HAVE_UNION_BPF_ATTR_VALUE + static_assert(SoM(struct BPF_MAP_UPDATE_ELEM_struct, value) == SoM(union bpf_attr, value), + "BPF_MAP_UPDATE_ELEM_struct.value size mismatch"); + static_assert(offsetof(struct BPF_MAP_UPDATE_ELEM_struct, value) == offsetof(union bpf_attr, value), + "BPF_MAP_UPDATE_ELEM_struct.value offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_VALUE */ + +# ifdef HAVE_UNION_BPF_ATTR_FLAGS + static_assert(SoM(struct BPF_MAP_UPDATE_ELEM_struct, flags) == SoM(union bpf_attr, flags), + "BPF_MAP_UPDATE_ELEM_struct.flags size mismatch"); + static_assert(offsetof(struct BPF_MAP_UPDATE_ELEM_struct, flags) == offsetof(union bpf_attr, flags), + "BPF_MAP_UPDATE_ELEM_struct.flags offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_FLAGS */ + +static_assert(BPF_MAP_UPDATE_ELEM_struct_size == expected_BPF_MAP_UPDATE_ELEM_struct_size, + "BPF_MAP_UPDATE_ELEM_struct_size mismatch"); + +# ifdef HAVE_UNION_BPF_ATTR_MAP_FD + static_assert(SoM(struct BPF_MAP_DELETE_ELEM_struct, map_fd) == SoM(union bpf_attr, map_fd), + "BPF_MAP_DELETE_ELEM_struct.map_fd size mismatch"); + static_assert(offsetof(struct BPF_MAP_DELETE_ELEM_struct, map_fd) == offsetof(union bpf_attr, map_fd), + "BPF_MAP_DELETE_ELEM_struct.map_fd offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_MAP_FD */ + +# ifdef HAVE_UNION_BPF_ATTR_KEY + static_assert(SoM(struct BPF_MAP_DELETE_ELEM_struct, key) == SoM(union bpf_attr, key), + "BPF_MAP_DELETE_ELEM_struct.key size mismatch"); + static_assert(offsetof(struct BPF_MAP_DELETE_ELEM_struct, key) == offsetof(union bpf_attr, key), + "BPF_MAP_DELETE_ELEM_struct.key offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_KEY */ + +static_assert(BPF_MAP_DELETE_ELEM_struct_size == expected_BPF_MAP_DELETE_ELEM_struct_size, + "BPF_MAP_DELETE_ELEM_struct_size mismatch"); + +# ifdef HAVE_UNION_BPF_ATTR_MAP_FD + static_assert(SoM(struct BPF_MAP_GET_NEXT_KEY_struct, map_fd) == SoM(union bpf_attr, map_fd), + "BPF_MAP_GET_NEXT_KEY_struct.map_fd size mismatch"); + static_assert(offsetof(struct BPF_MAP_GET_NEXT_KEY_struct, map_fd) == offsetof(union bpf_attr, map_fd), + "BPF_MAP_GET_NEXT_KEY_struct.map_fd offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_MAP_FD */ + +# ifdef HAVE_UNION_BPF_ATTR_KEY + static_assert(SoM(struct BPF_MAP_GET_NEXT_KEY_struct, key) == SoM(union bpf_attr, key), + "BPF_MAP_GET_NEXT_KEY_struct.key size mismatch"); + static_assert(offsetof(struct BPF_MAP_GET_NEXT_KEY_struct, key) == offsetof(union bpf_attr, key), + "BPF_MAP_GET_NEXT_KEY_struct.key offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_KEY */ + +# ifdef HAVE_UNION_BPF_ATTR_NEXT_KEY + static_assert(SoM(struct BPF_MAP_GET_NEXT_KEY_struct, next_key) == SoM(union bpf_attr, next_key), + "BPF_MAP_GET_NEXT_KEY_struct.next_key size mismatch"); + static_assert(offsetof(struct BPF_MAP_GET_NEXT_KEY_struct, next_key) == offsetof(union bpf_attr, next_key), + "BPF_MAP_GET_NEXT_KEY_struct.next_key offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_NEXT_KEY */ + +static_assert(BPF_MAP_GET_NEXT_KEY_struct_size == expected_BPF_MAP_GET_NEXT_KEY_struct_size, + "BPF_MAP_GET_NEXT_KEY_struct_size mismatch"); + +# ifdef HAVE_UNION_BPF_ATTR_PROG_TYPE + static_assert(SoM(struct BPF_PROG_LOAD_struct, prog_type) == SoM(union bpf_attr, prog_type), + "BPF_PROG_LOAD_struct.prog_type size mismatch"); + static_assert(offsetof(struct BPF_PROG_LOAD_struct, prog_type) == offsetof(union bpf_attr, prog_type), + "BPF_PROG_LOAD_struct.prog_type offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_PROG_TYPE */ + +# ifdef HAVE_UNION_BPF_ATTR_INSN_CNT + static_assert(SoM(struct BPF_PROG_LOAD_struct, insn_cnt) == SoM(union bpf_attr, insn_cnt), + "BPF_PROG_LOAD_struct.insn_cnt size mismatch"); + static_assert(offsetof(struct BPF_PROG_LOAD_struct, insn_cnt) == offsetof(union bpf_attr, insn_cnt), + "BPF_PROG_LOAD_struct.insn_cnt offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_INSN_CNT */ + +# ifdef HAVE_UNION_BPF_ATTR_INSNS + static_assert(SoM(struct BPF_PROG_LOAD_struct, insns) == SoM(union bpf_attr, insns), + "BPF_PROG_LOAD_struct.insns size mismatch"); + static_assert(offsetof(struct BPF_PROG_LOAD_struct, insns) == offsetof(union bpf_attr, insns), + "BPF_PROG_LOAD_struct.insns offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_INSNS */ + +# ifdef HAVE_UNION_BPF_ATTR_LICENSE + static_assert(SoM(struct BPF_PROG_LOAD_struct, license) == SoM(union bpf_attr, license), + "BPF_PROG_LOAD_struct.license size mismatch"); + static_assert(offsetof(struct BPF_PROG_LOAD_struct, license) == offsetof(union bpf_attr, license), + "BPF_PROG_LOAD_struct.license offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_LICENSE */ + +# ifdef HAVE_UNION_BPF_ATTR_LOG_LEVEL + static_assert(SoM(struct BPF_PROG_LOAD_struct, log_level) == SoM(union bpf_attr, log_level), + "BPF_PROG_LOAD_struct.log_level size mismatch"); + static_assert(offsetof(struct BPF_PROG_LOAD_struct, log_level) == offsetof(union bpf_attr, log_level), + "BPF_PROG_LOAD_struct.log_level offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_LOG_LEVEL */ + +# ifdef HAVE_UNION_BPF_ATTR_LOG_SIZE + static_assert(SoM(struct BPF_PROG_LOAD_struct, log_size) == SoM(union bpf_attr, log_size), + "BPF_PROG_LOAD_struct.log_size size mismatch"); + static_assert(offsetof(struct BPF_PROG_LOAD_struct, log_size) == offsetof(union bpf_attr, log_size), + "BPF_PROG_LOAD_struct.log_size offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_LOG_SIZE */ + +# ifdef HAVE_UNION_BPF_ATTR_LOG_BUF + static_assert(SoM(struct BPF_PROG_LOAD_struct, log_buf) == SoM(union bpf_attr, log_buf), + "BPF_PROG_LOAD_struct.log_buf size mismatch"); + static_assert(offsetof(struct BPF_PROG_LOAD_struct, log_buf) == offsetof(union bpf_attr, log_buf), + "BPF_PROG_LOAD_struct.log_buf offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_LOG_BUF */ + +# ifdef HAVE_UNION_BPF_ATTR_KERN_VERSION + static_assert(SoM(struct BPF_PROG_LOAD_struct, kern_version) == SoM(union bpf_attr, kern_version), + "BPF_PROG_LOAD_struct.kern_version size mismatch"); + static_assert(offsetof(struct BPF_PROG_LOAD_struct, kern_version) == offsetof(union bpf_attr, kern_version), + "BPF_PROG_LOAD_struct.kern_version offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_KERN_VERSION */ + +# ifdef HAVE_UNION_BPF_ATTR_PROG_FLAGS + static_assert(SoM(struct BPF_PROG_LOAD_struct, prog_flags) == SoM(union bpf_attr, prog_flags), + "BPF_PROG_LOAD_struct.prog_flags size mismatch"); + static_assert(offsetof(struct BPF_PROG_LOAD_struct, prog_flags) == offsetof(union bpf_attr, prog_flags), + "BPF_PROG_LOAD_struct.prog_flags offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_PROG_FLAGS */ + +# ifdef HAVE_UNION_BPF_ATTR_PROG_NAME + static_assert(SoM(struct BPF_PROG_LOAD_struct, prog_name) == SoM(union bpf_attr, prog_name), + "BPF_PROG_LOAD_struct.prog_name size mismatch"); + static_assert(offsetof(struct BPF_PROG_LOAD_struct, prog_name) == offsetof(union bpf_attr, prog_name), + "BPF_PROG_LOAD_struct.prog_name offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_PROG_NAME */ + +# ifdef HAVE_UNION_BPF_ATTR_PROG_IFINDEX + static_assert(SoM(struct BPF_PROG_LOAD_struct, prog_ifindex) == SoM(union bpf_attr, prog_ifindex), + "BPF_PROG_LOAD_struct.prog_ifindex size mismatch"); + static_assert(offsetof(struct BPF_PROG_LOAD_struct, prog_ifindex) == offsetof(union bpf_attr, prog_ifindex), + "BPF_PROG_LOAD_struct.prog_ifindex offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_PROG_IFINDEX */ + +# ifdef HAVE_UNION_BPF_ATTR_EXPECTED_ATTACH_TYPE + static_assert(SoM(struct BPF_PROG_LOAD_struct, expected_attach_type) == SoM(union bpf_attr, expected_attach_type), + "BPF_PROG_LOAD_struct.expected_attach_type size mismatch"); + static_assert(offsetof(struct BPF_PROG_LOAD_struct, expected_attach_type) == offsetof(union bpf_attr, expected_attach_type), + "BPF_PROG_LOAD_struct.expected_attach_type offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_EXPECTED_ATTACH_TYPE */ + +# ifdef HAVE_UNION_BPF_ATTR_PROG_BTF_FD + static_assert(SoM(struct BPF_PROG_LOAD_struct, prog_btf_fd) == SoM(union bpf_attr, prog_btf_fd), + "BPF_PROG_LOAD_struct.prog_btf_fd size mismatch"); + static_assert(offsetof(struct BPF_PROG_LOAD_struct, prog_btf_fd) == offsetof(union bpf_attr, prog_btf_fd), + "BPF_PROG_LOAD_struct.prog_btf_fd offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_PROG_BTF_FD */ + +# ifdef HAVE_UNION_BPF_ATTR_FUNC_INFO_REC_SIZE + static_assert(SoM(struct BPF_PROG_LOAD_struct, func_info_rec_size) == SoM(union bpf_attr, func_info_rec_size), + "BPF_PROG_LOAD_struct.func_info_rec_size size mismatch"); + static_assert(offsetof(struct BPF_PROG_LOAD_struct, func_info_rec_size) == offsetof(union bpf_attr, func_info_rec_size), + "BPF_PROG_LOAD_struct.func_info_rec_size offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_FUNC_INFO_REC_SIZE */ + +# ifdef HAVE_UNION_BPF_ATTR_FUNC_INFO + static_assert(SoM(struct BPF_PROG_LOAD_struct, func_info) == SoM(union bpf_attr, func_info), + "BPF_PROG_LOAD_struct.func_info size mismatch"); + static_assert(offsetof(struct BPF_PROG_LOAD_struct, func_info) == offsetof(union bpf_attr, func_info), + "BPF_PROG_LOAD_struct.func_info offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_FUNC_INFO */ + +# ifdef HAVE_UNION_BPF_ATTR_FUNC_INFO_CNT + static_assert(SoM(struct BPF_PROG_LOAD_struct, func_info_cnt) == SoM(union bpf_attr, func_info_cnt), + "BPF_PROG_LOAD_struct.func_info_cnt size mismatch"); + static_assert(offsetof(struct BPF_PROG_LOAD_struct, func_info_cnt) == offsetof(union bpf_attr, func_info_cnt), + "BPF_PROG_LOAD_struct.func_info_cnt offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_FUNC_INFO_CNT */ + +# ifdef HAVE_UNION_BPF_ATTR_LINE_INFO_REC_SIZE + static_assert(SoM(struct BPF_PROG_LOAD_struct, line_info_rec_size) == SoM(union bpf_attr, line_info_rec_size), + "BPF_PROG_LOAD_struct.line_info_rec_size size mismatch"); + static_assert(offsetof(struct BPF_PROG_LOAD_struct, line_info_rec_size) == offsetof(union bpf_attr, line_info_rec_size), + "BPF_PROG_LOAD_struct.line_info_rec_size offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_LINE_INFO_REC_SIZE */ + +# ifdef HAVE_UNION_BPF_ATTR_LINE_INFO + static_assert(SoM(struct BPF_PROG_LOAD_struct, line_info) == SoM(union bpf_attr, line_info), + "BPF_PROG_LOAD_struct.line_info size mismatch"); + static_assert(offsetof(struct BPF_PROG_LOAD_struct, line_info) == offsetof(union bpf_attr, line_info), + "BPF_PROG_LOAD_struct.line_info offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_LINE_INFO */ + +# ifdef HAVE_UNION_BPF_ATTR_LINE_INFO_CNT + static_assert(SoM(struct BPF_PROG_LOAD_struct, line_info_cnt) == SoM(union bpf_attr, line_info_cnt), + "BPF_PROG_LOAD_struct.line_info_cnt size mismatch"); + static_assert(offsetof(struct BPF_PROG_LOAD_struct, line_info_cnt) == offsetof(union bpf_attr, line_info_cnt), + "BPF_PROG_LOAD_struct.line_info_cnt offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_LINE_INFO_CNT */ + +static_assert(BPF_PROG_LOAD_struct_size == expected_BPF_PROG_LOAD_struct_size, + "BPF_PROG_LOAD_struct_size mismatch"); + +# ifdef HAVE_UNION_BPF_ATTR_PATHNAME + static_assert(SoM(struct BPF_OBJ_PIN_struct, pathname) == SoM(union bpf_attr, pathname), + "BPF_OBJ_PIN_struct.pathname size mismatch"); + static_assert(offsetof(struct BPF_OBJ_PIN_struct, pathname) == offsetof(union bpf_attr, pathname), + "BPF_OBJ_PIN_struct.pathname offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_PATHNAME */ + +# ifdef HAVE_UNION_BPF_ATTR_BPF_FD + static_assert(SoM(struct BPF_OBJ_PIN_struct, bpf_fd) == SoM(union bpf_attr, bpf_fd), + "BPF_OBJ_PIN_struct.bpf_fd size mismatch"); + static_assert(offsetof(struct BPF_OBJ_PIN_struct, bpf_fd) == offsetof(union bpf_attr, bpf_fd), + "BPF_OBJ_PIN_struct.bpf_fd offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_BPF_FD */ + +# ifdef HAVE_UNION_BPF_ATTR_FILE_FLAGS + static_assert(SoM(struct BPF_OBJ_PIN_struct, file_flags) == SoM(union bpf_attr, file_flags), + "BPF_OBJ_PIN_struct.file_flags size mismatch"); + static_assert(offsetof(struct BPF_OBJ_PIN_struct, file_flags) == offsetof(union bpf_attr, file_flags), + "BPF_OBJ_PIN_struct.file_flags offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_FILE_FLAGS */ + +static_assert(BPF_OBJ_PIN_struct_size == expected_BPF_OBJ_PIN_struct_size, + "BPF_OBJ_PIN_struct_size mismatch"); + +# ifdef HAVE_UNION_BPF_ATTR_TARGET_FD + static_assert(SoM(struct BPF_PROG_ATTACH_struct, target_fd) == SoM(union bpf_attr, target_fd), + "BPF_PROG_ATTACH_struct.target_fd size mismatch"); + static_assert(offsetof(struct BPF_PROG_ATTACH_struct, target_fd) == offsetof(union bpf_attr, target_fd), + "BPF_PROG_ATTACH_struct.target_fd offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_TARGET_FD */ + +# ifdef HAVE_UNION_BPF_ATTR_ATTACH_BPF_FD + static_assert(SoM(struct BPF_PROG_ATTACH_struct, attach_bpf_fd) == SoM(union bpf_attr, attach_bpf_fd), + "BPF_PROG_ATTACH_struct.attach_bpf_fd size mismatch"); + static_assert(offsetof(struct BPF_PROG_ATTACH_struct, attach_bpf_fd) == offsetof(union bpf_attr, attach_bpf_fd), + "BPF_PROG_ATTACH_struct.attach_bpf_fd offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_ATTACH_BPF_FD */ + +# ifdef HAVE_UNION_BPF_ATTR_ATTACH_TYPE + static_assert(SoM(struct BPF_PROG_ATTACH_struct, attach_type) == SoM(union bpf_attr, attach_type), + "BPF_PROG_ATTACH_struct.attach_type size mismatch"); + static_assert(offsetof(struct BPF_PROG_ATTACH_struct, attach_type) == offsetof(union bpf_attr, attach_type), + "BPF_PROG_ATTACH_struct.attach_type offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_ATTACH_TYPE */ + +# ifdef HAVE_UNION_BPF_ATTR_ATTACH_FLAGS + static_assert(SoM(struct BPF_PROG_ATTACH_struct, attach_flags) == SoM(union bpf_attr, attach_flags), + "BPF_PROG_ATTACH_struct.attach_flags size mismatch"); + static_assert(offsetof(struct BPF_PROG_ATTACH_struct, attach_flags) == offsetof(union bpf_attr, attach_flags), + "BPF_PROG_ATTACH_struct.attach_flags offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_ATTACH_FLAGS */ + +static_assert(BPF_PROG_ATTACH_struct_size == expected_BPF_PROG_ATTACH_struct_size, + "BPF_PROG_ATTACH_struct_size mismatch"); + +# ifdef HAVE_UNION_BPF_ATTR_TARGET_FD + static_assert(SoM(struct BPF_PROG_DETACH_struct, target_fd) == SoM(union bpf_attr, target_fd), + "BPF_PROG_DETACH_struct.target_fd size mismatch"); + static_assert(offsetof(struct BPF_PROG_DETACH_struct, target_fd) == offsetof(union bpf_attr, target_fd), + "BPF_PROG_DETACH_struct.target_fd offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_TARGET_FD */ + +# ifdef HAVE_UNION_BPF_ATTR_DUMMY + static_assert(SoM(struct BPF_PROG_DETACH_struct, dummy) == SoM(union bpf_attr, dummy), + "BPF_PROG_DETACH_struct.dummy size mismatch"); + static_assert(offsetof(struct BPF_PROG_DETACH_struct, dummy) == offsetof(union bpf_attr, dummy), + "BPF_PROG_DETACH_struct.dummy offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_DUMMY */ + +# ifdef HAVE_UNION_BPF_ATTR_ATTACH_TYPE + static_assert(SoM(struct BPF_PROG_DETACH_struct, attach_type) == SoM(union bpf_attr, attach_type), + "BPF_PROG_DETACH_struct.attach_type size mismatch"); + static_assert(offsetof(struct BPF_PROG_DETACH_struct, attach_type) == offsetof(union bpf_attr, attach_type), + "BPF_PROG_DETACH_struct.attach_type offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_ATTACH_TYPE */ + +static_assert(BPF_PROG_DETACH_struct_size == expected_BPF_PROG_DETACH_struct_size, + "BPF_PROG_DETACH_struct_size mismatch"); + +# ifdef HAVE_UNION_BPF_ATTR_TEST_PROG_FD + static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, prog_fd) == SoM(union bpf_attr, test.prog_fd), + "BPF_PROG_TEST_RUN_struct.prog_fd size mismatch"); + static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, prog_fd) == offsetof(union bpf_attr, test.prog_fd), + "BPF_PROG_TEST_RUN_struct.prog_fd offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_TEST_PROG_FD */ + +# ifdef HAVE_UNION_BPF_ATTR_TEST_RETVAL + static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, retval) == SoM(union bpf_attr, test.retval), + "BPF_PROG_TEST_RUN_struct.retval size mismatch"); + static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, retval) == offsetof(union bpf_attr, test.retval), + "BPF_PROG_TEST_RUN_struct.retval offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_TEST_RETVAL */ + +# ifdef HAVE_UNION_BPF_ATTR_TEST_DATA_SIZE_IN + static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, data_size_in) == SoM(union bpf_attr, test.data_size_in), + "BPF_PROG_TEST_RUN_struct.data_size_in size mismatch"); + static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, data_size_in) == offsetof(union bpf_attr, test.data_size_in), + "BPF_PROG_TEST_RUN_struct.data_size_in offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_TEST_DATA_SIZE_IN */ + +# ifdef HAVE_UNION_BPF_ATTR_TEST_DATA_SIZE_OUT + static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, data_size_out) == SoM(union bpf_attr, test.data_size_out), + "BPF_PROG_TEST_RUN_struct.data_size_out size mismatch"); + static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, data_size_out) == offsetof(union bpf_attr, test.data_size_out), + "BPF_PROG_TEST_RUN_struct.data_size_out offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_TEST_DATA_SIZE_OUT */ + +# ifdef HAVE_UNION_BPF_ATTR_TEST_DATA_IN + static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, data_in) == SoM(union bpf_attr, test.data_in), + "BPF_PROG_TEST_RUN_struct.data_in size mismatch"); + static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, data_in) == offsetof(union bpf_attr, test.data_in), + "BPF_PROG_TEST_RUN_struct.data_in offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_TEST_DATA_IN */ + +# ifdef HAVE_UNION_BPF_ATTR_TEST_DATA_OUT + static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, data_out) == SoM(union bpf_attr, test.data_out), + "BPF_PROG_TEST_RUN_struct.data_out size mismatch"); + static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, data_out) == offsetof(union bpf_attr, test.data_out), + "BPF_PROG_TEST_RUN_struct.data_out offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_TEST_DATA_OUT */ + +# ifdef HAVE_UNION_BPF_ATTR_TEST_REPEAT + static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, repeat) == SoM(union bpf_attr, test.repeat), + "BPF_PROG_TEST_RUN_struct.repeat size mismatch"); + static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, repeat) == offsetof(union bpf_attr, test.repeat), + "BPF_PROG_TEST_RUN_struct.repeat offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_TEST_REPEAT */ + +# ifdef HAVE_UNION_BPF_ATTR_TEST_DURATION + static_assert(SoM(struct BPF_PROG_TEST_RUN_struct, duration) == SoM(union bpf_attr, test.duration), + "BPF_PROG_TEST_RUN_struct.duration size mismatch"); + static_assert(offsetof(struct BPF_PROG_TEST_RUN_struct, duration) == offsetof(union bpf_attr, test.duration), + "BPF_PROG_TEST_RUN_struct.duration offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_TEST_DURATION */ + +static_assert(BPF_PROG_TEST_RUN_struct_size == expected_BPF_PROG_TEST_RUN_struct_size, + "BPF_PROG_TEST_RUN_struct_size mismatch"); + +# ifdef HAVE_UNION_BPF_ATTR_START_ID + static_assert(SoM(struct BPF_PROG_GET_NEXT_ID_struct, start_id) == SoM(union bpf_attr, start_id), + "BPF_PROG_GET_NEXT_ID_struct.start_id size mismatch"); + static_assert(offsetof(struct BPF_PROG_GET_NEXT_ID_struct, start_id) == offsetof(union bpf_attr, start_id), + "BPF_PROG_GET_NEXT_ID_struct.start_id offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_START_ID */ + +# ifdef HAVE_UNION_BPF_ATTR_NEXT_ID + static_assert(SoM(struct BPF_PROG_GET_NEXT_ID_struct, next_id) == SoM(union bpf_attr, next_id), + "BPF_PROG_GET_NEXT_ID_struct.next_id size mismatch"); + static_assert(offsetof(struct BPF_PROG_GET_NEXT_ID_struct, next_id) == offsetof(union bpf_attr, next_id), + "BPF_PROG_GET_NEXT_ID_struct.next_id offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_NEXT_ID */ + +# ifdef HAVE_UNION_BPF_ATTR_OPEN_FLAGS + static_assert(SoM(struct BPF_PROG_GET_NEXT_ID_struct, open_flags) == SoM(union bpf_attr, open_flags), + "BPF_PROG_GET_NEXT_ID_struct.open_flags size mismatch"); + static_assert(offsetof(struct BPF_PROG_GET_NEXT_ID_struct, open_flags) == offsetof(union bpf_attr, open_flags), + "BPF_PROG_GET_NEXT_ID_struct.open_flags offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_OPEN_FLAGS */ + +static_assert(BPF_PROG_GET_NEXT_ID_struct_size == expected_BPF_PROG_GET_NEXT_ID_struct_size, + "BPF_PROG_GET_NEXT_ID_struct_size mismatch"); + +# ifdef HAVE_UNION_BPF_ATTR_PROG_ID + static_assert(SoM(struct BPF_PROG_GET_FD_BY_ID_struct, prog_id) == SoM(union bpf_attr, prog_id), + "BPF_PROG_GET_FD_BY_ID_struct.prog_id size mismatch"); + static_assert(offsetof(struct BPF_PROG_GET_FD_BY_ID_struct, prog_id) == offsetof(union bpf_attr, prog_id), + "BPF_PROG_GET_FD_BY_ID_struct.prog_id offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_PROG_ID */ + +# ifdef HAVE_UNION_BPF_ATTR_NEXT_ID + static_assert(SoM(struct BPF_PROG_GET_FD_BY_ID_struct, next_id) == SoM(union bpf_attr, next_id), + "BPF_PROG_GET_FD_BY_ID_struct.next_id size mismatch"); + static_assert(offsetof(struct BPF_PROG_GET_FD_BY_ID_struct, next_id) == offsetof(union bpf_attr, next_id), + "BPF_PROG_GET_FD_BY_ID_struct.next_id offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_NEXT_ID */ + +# ifdef HAVE_UNION_BPF_ATTR_OPEN_FLAGS + static_assert(SoM(struct BPF_PROG_GET_FD_BY_ID_struct, open_flags) == SoM(union bpf_attr, open_flags), + "BPF_PROG_GET_FD_BY_ID_struct.open_flags size mismatch"); + static_assert(offsetof(struct BPF_PROG_GET_FD_BY_ID_struct, open_flags) == offsetof(union bpf_attr, open_flags), + "BPF_PROG_GET_FD_BY_ID_struct.open_flags offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_OPEN_FLAGS */ + +static_assert(BPF_PROG_GET_FD_BY_ID_struct_size == expected_BPF_PROG_GET_FD_BY_ID_struct_size, + "BPF_PROG_GET_FD_BY_ID_struct_size mismatch"); + +# ifdef HAVE_UNION_BPF_ATTR_MAP_ID + static_assert(SoM(struct BPF_MAP_GET_FD_BY_ID_struct, map_id) == SoM(union bpf_attr, map_id), + "BPF_MAP_GET_FD_BY_ID_struct.map_id size mismatch"); + static_assert(offsetof(struct BPF_MAP_GET_FD_BY_ID_struct, map_id) == offsetof(union bpf_attr, map_id), + "BPF_MAP_GET_FD_BY_ID_struct.map_id offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_MAP_ID */ + +# ifdef HAVE_UNION_BPF_ATTR_NEXT_ID + static_assert(SoM(struct BPF_MAP_GET_FD_BY_ID_struct, next_id) == SoM(union bpf_attr, next_id), + "BPF_MAP_GET_FD_BY_ID_struct.next_id size mismatch"); + static_assert(offsetof(struct BPF_MAP_GET_FD_BY_ID_struct, next_id) == offsetof(union bpf_attr, next_id), + "BPF_MAP_GET_FD_BY_ID_struct.next_id offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_NEXT_ID */ + +# ifdef HAVE_UNION_BPF_ATTR_OPEN_FLAGS + static_assert(SoM(struct BPF_MAP_GET_FD_BY_ID_struct, open_flags) == SoM(union bpf_attr, open_flags), + "BPF_MAP_GET_FD_BY_ID_struct.open_flags size mismatch"); + static_assert(offsetof(struct BPF_MAP_GET_FD_BY_ID_struct, open_flags) == offsetof(union bpf_attr, open_flags), + "BPF_MAP_GET_FD_BY_ID_struct.open_flags offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_OPEN_FLAGS */ + +static_assert(BPF_MAP_GET_FD_BY_ID_struct_size == expected_BPF_MAP_GET_FD_BY_ID_struct_size, + "BPF_MAP_GET_FD_BY_ID_struct_size mismatch"); + +# ifdef HAVE_UNION_BPF_ATTR_INFO_BPF_FD + static_assert(SoM(struct BPF_OBJ_GET_INFO_BY_FD_struct, bpf_fd) == SoM(union bpf_attr, info.bpf_fd), + "BPF_OBJ_GET_INFO_BY_FD_struct.bpf_fd size mismatch"); + static_assert(offsetof(struct BPF_OBJ_GET_INFO_BY_FD_struct, bpf_fd) == offsetof(union bpf_attr, info.bpf_fd), + "BPF_OBJ_GET_INFO_BY_FD_struct.bpf_fd offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_INFO_BPF_FD */ + +# ifdef HAVE_UNION_BPF_ATTR_INFO_INFO_LEN + static_assert(SoM(struct BPF_OBJ_GET_INFO_BY_FD_struct, info_len) == SoM(union bpf_attr, info.info_len), + "BPF_OBJ_GET_INFO_BY_FD_struct.info_len size mismatch"); + static_assert(offsetof(struct BPF_OBJ_GET_INFO_BY_FD_struct, info_len) == offsetof(union bpf_attr, info.info_len), + "BPF_OBJ_GET_INFO_BY_FD_struct.info_len offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_INFO_INFO_LEN */ + +# ifdef HAVE_UNION_BPF_ATTR_INFO_INFO + static_assert(SoM(struct BPF_OBJ_GET_INFO_BY_FD_struct, info) == SoM(union bpf_attr, info.info), + "BPF_OBJ_GET_INFO_BY_FD_struct.info size mismatch"); + static_assert(offsetof(struct BPF_OBJ_GET_INFO_BY_FD_struct, info) == offsetof(union bpf_attr, info.info), + "BPF_OBJ_GET_INFO_BY_FD_struct.info offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_INFO_INFO */ + +static_assert(BPF_OBJ_GET_INFO_BY_FD_struct_size == expected_BPF_OBJ_GET_INFO_BY_FD_struct_size, + "BPF_OBJ_GET_INFO_BY_FD_struct_size mismatch"); + +# ifdef HAVE_UNION_BPF_ATTR_QUERY_TARGET_FD + static_assert(SoM(struct BPF_PROG_QUERY_struct, target_fd) == SoM(union bpf_attr, query.target_fd), + "BPF_PROG_QUERY_struct.target_fd size mismatch"); + static_assert(offsetof(struct BPF_PROG_QUERY_struct, target_fd) == offsetof(union bpf_attr, query.target_fd), + "BPF_PROG_QUERY_struct.target_fd offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_QUERY_TARGET_FD */ + +# ifdef HAVE_UNION_BPF_ATTR_QUERY_ATTACH_TYPE + static_assert(SoM(struct BPF_PROG_QUERY_struct, attach_type) == SoM(union bpf_attr, query.attach_type), + "BPF_PROG_QUERY_struct.attach_type size mismatch"); + static_assert(offsetof(struct BPF_PROG_QUERY_struct, attach_type) == offsetof(union bpf_attr, query.attach_type), + "BPF_PROG_QUERY_struct.attach_type offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_QUERY_ATTACH_TYPE */ + +# ifdef HAVE_UNION_BPF_ATTR_QUERY_QUERY_FLAGS + static_assert(SoM(struct BPF_PROG_QUERY_struct, query_flags) == SoM(union bpf_attr, query.query_flags), + "BPF_PROG_QUERY_struct.query_flags size mismatch"); + static_assert(offsetof(struct BPF_PROG_QUERY_struct, query_flags) == offsetof(union bpf_attr, query.query_flags), + "BPF_PROG_QUERY_struct.query_flags offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_QUERY_QUERY_FLAGS */ + +# ifdef HAVE_UNION_BPF_ATTR_QUERY_ATTACH_FLAGS + static_assert(SoM(struct BPF_PROG_QUERY_struct, attach_flags) == SoM(union bpf_attr, query.attach_flags), + "BPF_PROG_QUERY_struct.attach_flags size mismatch"); + static_assert(offsetof(struct BPF_PROG_QUERY_struct, attach_flags) == offsetof(union bpf_attr, query.attach_flags), + "BPF_PROG_QUERY_struct.attach_flags offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_QUERY_ATTACH_FLAGS */ + +# ifdef HAVE_UNION_BPF_ATTR_QUERY_PROG_IDS + static_assert(SoM(struct BPF_PROG_QUERY_struct, prog_ids) == SoM(union bpf_attr, query.prog_ids), + "BPF_PROG_QUERY_struct.prog_ids size mismatch"); + static_assert(offsetof(struct BPF_PROG_QUERY_struct, prog_ids) == offsetof(union bpf_attr, query.prog_ids), + "BPF_PROG_QUERY_struct.prog_ids offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_QUERY_PROG_IDS */ + +# ifdef HAVE_UNION_BPF_ATTR_QUERY_PROG_CNT + static_assert(SoM(struct BPF_PROG_QUERY_struct, prog_cnt) == SoM(union bpf_attr, query.prog_cnt), + "BPF_PROG_QUERY_struct.prog_cnt size mismatch"); + static_assert(offsetof(struct BPF_PROG_QUERY_struct, prog_cnt) == offsetof(union bpf_attr, query.prog_cnt), + "BPF_PROG_QUERY_struct.prog_cnt offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_QUERY_PROG_CNT */ + +static_assert(BPF_PROG_QUERY_struct_size == expected_BPF_PROG_QUERY_struct_size, + "BPF_PROG_QUERY_struct_size mismatch"); + +# ifdef HAVE_UNION_BPF_ATTR_RAW_TRACEPOINT_NAME + static_assert(SoM(struct BPF_RAW_TRACEPOINT_OPEN_struct, name) == SoM(union bpf_attr, raw_tracepoint.name), + "BPF_RAW_TRACEPOINT_OPEN_struct.name size mismatch"); + static_assert(offsetof(struct BPF_RAW_TRACEPOINT_OPEN_struct, name) == offsetof(union bpf_attr, raw_tracepoint.name), + "BPF_RAW_TRACEPOINT_OPEN_struct.name offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_RAW_TRACEPOINT_NAME */ + +# ifdef HAVE_UNION_BPF_ATTR_RAW_TRACEPOINT_PROG_FD + static_assert(SoM(struct BPF_RAW_TRACEPOINT_OPEN_struct, prog_fd) == SoM(union bpf_attr, raw_tracepoint.prog_fd), + "BPF_RAW_TRACEPOINT_OPEN_struct.prog_fd size mismatch"); + static_assert(offsetof(struct BPF_RAW_TRACEPOINT_OPEN_struct, prog_fd) == offsetof(union bpf_attr, raw_tracepoint.prog_fd), + "BPF_RAW_TRACEPOINT_OPEN_struct.prog_fd offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_RAW_TRACEPOINT_PROG_FD */ + +static_assert(BPF_RAW_TRACEPOINT_OPEN_struct_size == expected_BPF_RAW_TRACEPOINT_OPEN_struct_size, + "BPF_RAW_TRACEPOINT_OPEN_struct_size mismatch"); + +# ifdef HAVE_UNION_BPF_ATTR_BTF + static_assert(SoM(struct BPF_BTF_LOAD_struct, btf) == SoM(union bpf_attr, btf), + "BPF_BTF_LOAD_struct.btf size mismatch"); + static_assert(offsetof(struct BPF_BTF_LOAD_struct, btf) == offsetof(union bpf_attr, btf), + "BPF_BTF_LOAD_struct.btf offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_BTF */ + +# ifdef HAVE_UNION_BPF_ATTR_BTF_LOG_BUF + static_assert(SoM(struct BPF_BTF_LOAD_struct, btf_log_buf) == SoM(union bpf_attr, btf_log_buf), + "BPF_BTF_LOAD_struct.btf_log_buf size mismatch"); + static_assert(offsetof(struct BPF_BTF_LOAD_struct, btf_log_buf) == offsetof(union bpf_attr, btf_log_buf), + "BPF_BTF_LOAD_struct.btf_log_buf offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_BTF_LOG_BUF */ + +# ifdef HAVE_UNION_BPF_ATTR_BTF_SIZE + static_assert(SoM(struct BPF_BTF_LOAD_struct, btf_size) == SoM(union bpf_attr, btf_size), + "BPF_BTF_LOAD_struct.btf_size size mismatch"); + static_assert(offsetof(struct BPF_BTF_LOAD_struct, btf_size) == offsetof(union bpf_attr, btf_size), + "BPF_BTF_LOAD_struct.btf_size offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_BTF_SIZE */ + +# ifdef HAVE_UNION_BPF_ATTR_BTF_LOG_SIZE + static_assert(SoM(struct BPF_BTF_LOAD_struct, btf_log_size) == SoM(union bpf_attr, btf_log_size), + "BPF_BTF_LOAD_struct.btf_log_size size mismatch"); + static_assert(offsetof(struct BPF_BTF_LOAD_struct, btf_log_size) == offsetof(union bpf_attr, btf_log_size), + "BPF_BTF_LOAD_struct.btf_log_size offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_BTF_LOG_SIZE */ + +# ifdef HAVE_UNION_BPF_ATTR_BTF_LOG_LEVEL + static_assert(SoM(struct BPF_BTF_LOAD_struct, btf_log_level) == SoM(union bpf_attr, btf_log_level), + "BPF_BTF_LOAD_struct.btf_log_level size mismatch"); + static_assert(offsetof(struct BPF_BTF_LOAD_struct, btf_log_level) == offsetof(union bpf_attr, btf_log_level), + "BPF_BTF_LOAD_struct.btf_log_level offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_BTF_LOG_LEVEL */ + +static_assert(BPF_BTF_LOAD_struct_size == expected_BPF_BTF_LOAD_struct_size, + "BPF_BTF_LOAD_struct_size mismatch"); + +# ifdef HAVE_UNION_BPF_ATTR_BTF_ID + static_assert(SoM(struct BPF_BTF_GET_FD_BY_ID_struct, btf_id) == SoM(union bpf_attr, btf_id), + "BPF_BTF_GET_FD_BY_ID_struct.btf_id size mismatch"); + static_assert(offsetof(struct BPF_BTF_GET_FD_BY_ID_struct, btf_id) == offsetof(union bpf_attr, btf_id), + "BPF_BTF_GET_FD_BY_ID_struct.btf_id offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_BTF_ID */ + +static_assert(BPF_BTF_GET_FD_BY_ID_struct_size == expected_BPF_BTF_GET_FD_BY_ID_struct_size, + "BPF_BTF_GET_FD_BY_ID_struct_size mismatch"); + +# ifdef HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_PID + static_assert(SoM(struct BPF_TASK_FD_QUERY_struct, pid) == SoM(union bpf_attr, task_fd_query.pid), + "BPF_TASK_FD_QUERY_struct.pid size mismatch"); + static_assert(offsetof(struct BPF_TASK_FD_QUERY_struct, pid) == offsetof(union bpf_attr, task_fd_query.pid), + "BPF_TASK_FD_QUERY_struct.pid offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_PID */ + +# ifdef HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_FD + static_assert(SoM(struct BPF_TASK_FD_QUERY_struct, fd) == SoM(union bpf_attr, task_fd_query.fd), + "BPF_TASK_FD_QUERY_struct.fd size mismatch"); + static_assert(offsetof(struct BPF_TASK_FD_QUERY_struct, fd) == offsetof(union bpf_attr, task_fd_query.fd), + "BPF_TASK_FD_QUERY_struct.fd offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_FD */ + +# ifdef HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_FLAGS + static_assert(SoM(struct BPF_TASK_FD_QUERY_struct, flags) == SoM(union bpf_attr, task_fd_query.flags), + "BPF_TASK_FD_QUERY_struct.flags size mismatch"); + static_assert(offsetof(struct BPF_TASK_FD_QUERY_struct, flags) == offsetof(union bpf_attr, task_fd_query.flags), + "BPF_TASK_FD_QUERY_struct.flags offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_FLAGS */ + +# ifdef HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_BUF_LEN + static_assert(SoM(struct BPF_TASK_FD_QUERY_struct, buf_len) == SoM(union bpf_attr, task_fd_query.buf_len), + "BPF_TASK_FD_QUERY_struct.buf_len size mismatch"); + static_assert(offsetof(struct BPF_TASK_FD_QUERY_struct, buf_len) == offsetof(union bpf_attr, task_fd_query.buf_len), + "BPF_TASK_FD_QUERY_struct.buf_len offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_BUF_LEN */ + +# ifdef HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_BUF + static_assert(SoM(struct BPF_TASK_FD_QUERY_struct, buf) == SoM(union bpf_attr, task_fd_query.buf), + "BPF_TASK_FD_QUERY_struct.buf size mismatch"); + static_assert(offsetof(struct BPF_TASK_FD_QUERY_struct, buf) == offsetof(union bpf_attr, task_fd_query.buf), + "BPF_TASK_FD_QUERY_struct.buf offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_BUF */ + +# ifdef HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_PROG_ID + static_assert(SoM(struct BPF_TASK_FD_QUERY_struct, prog_id) == SoM(union bpf_attr, task_fd_query.prog_id), + "BPF_TASK_FD_QUERY_struct.prog_id size mismatch"); + static_assert(offsetof(struct BPF_TASK_FD_QUERY_struct, prog_id) == offsetof(union bpf_attr, task_fd_query.prog_id), + "BPF_TASK_FD_QUERY_struct.prog_id offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_PROG_ID */ + +# ifdef HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_FD_TYPE + static_assert(SoM(struct BPF_TASK_FD_QUERY_struct, fd_type) == SoM(union bpf_attr, task_fd_query.fd_type), + "BPF_TASK_FD_QUERY_struct.fd_type size mismatch"); + static_assert(offsetof(struct BPF_TASK_FD_QUERY_struct, fd_type) == offsetof(union bpf_attr, task_fd_query.fd_type), + "BPF_TASK_FD_QUERY_struct.fd_type offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_FD_TYPE */ + +# ifdef HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_PROBE_OFFSET + static_assert(SoM(struct BPF_TASK_FD_QUERY_struct, probe_offset) == SoM(union bpf_attr, task_fd_query.probe_offset), + "BPF_TASK_FD_QUERY_struct.probe_offset size mismatch"); + static_assert(offsetof(struct BPF_TASK_FD_QUERY_struct, probe_offset) == offsetof(union bpf_attr, task_fd_query.probe_offset), + "BPF_TASK_FD_QUERY_struct.probe_offset offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_PROBE_OFFSET */ + +# ifdef HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_PROBE_ADDR + static_assert(SoM(struct BPF_TASK_FD_QUERY_struct, probe_addr) == SoM(union bpf_attr, task_fd_query.probe_addr), + "BPF_TASK_FD_QUERY_struct.probe_addr size mismatch"); + static_assert(offsetof(struct BPF_TASK_FD_QUERY_struct, probe_addr) == offsetof(union bpf_attr, task_fd_query.probe_addr), + "BPF_TASK_FD_QUERY_struct.probe_addr offset mismatch"); +# endif /* HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_PROBE_ADDR */ + +static_assert(BPF_TASK_FD_QUERY_struct_size == expected_BPF_TASK_FD_QUERY_struct_size, + "BPF_TASK_FD_QUERY_struct_size mismatch"); + +# ifdef HAVE_STRUCT_BPF_MAP_INFO_TYPE + static_assert(SoM(struct bpf_map_info_struct, type) == SoM(struct bpf_map_info, type), + "bpf_map_info_struct.type size mismatch"); + static_assert(offsetof(struct bpf_map_info_struct, type) == offsetof(struct bpf_map_info, type), + "bpf_map_info_struct.type offset mismatch"); +# endif /* HAVE_STRUCT_BPF_MAP_INFO_TYPE */ + +# ifdef HAVE_STRUCT_BPF_MAP_INFO_ID + static_assert(SoM(struct bpf_map_info_struct, id) == SoM(struct bpf_map_info, id), + "bpf_map_info_struct.id size mismatch"); + static_assert(offsetof(struct bpf_map_info_struct, id) == offsetof(struct bpf_map_info, id), + "bpf_map_info_struct.id offset mismatch"); +# endif /* HAVE_STRUCT_BPF_MAP_INFO_ID */ + +# ifdef HAVE_STRUCT_BPF_MAP_INFO_KEY_SIZE + static_assert(SoM(struct bpf_map_info_struct, key_size) == SoM(struct bpf_map_info, key_size), + "bpf_map_info_struct.key_size size mismatch"); + static_assert(offsetof(struct bpf_map_info_struct, key_size) == offsetof(struct bpf_map_info, key_size), + "bpf_map_info_struct.key_size offset mismatch"); +# endif /* HAVE_STRUCT_BPF_MAP_INFO_KEY_SIZE */ + +# ifdef HAVE_STRUCT_BPF_MAP_INFO_VALUE_SIZE + static_assert(SoM(struct bpf_map_info_struct, value_size) == SoM(struct bpf_map_info, value_size), + "bpf_map_info_struct.value_size size mismatch"); + static_assert(offsetof(struct bpf_map_info_struct, value_size) == offsetof(struct bpf_map_info, value_size), + "bpf_map_info_struct.value_size offset mismatch"); +# endif /* HAVE_STRUCT_BPF_MAP_INFO_VALUE_SIZE */ + +# ifdef HAVE_STRUCT_BPF_MAP_INFO_MAX_ENTRIES + static_assert(SoM(struct bpf_map_info_struct, max_entries) == SoM(struct bpf_map_info, max_entries), + "bpf_map_info_struct.max_entries size mismatch"); + static_assert(offsetof(struct bpf_map_info_struct, max_entries) == offsetof(struct bpf_map_info, max_entries), + "bpf_map_info_struct.max_entries offset mismatch"); +# endif /* HAVE_STRUCT_BPF_MAP_INFO_MAX_ENTRIES */ + +# ifdef HAVE_STRUCT_BPF_MAP_INFO_MAP_FLAGS + static_assert(SoM(struct bpf_map_info_struct, map_flags) == SoM(struct bpf_map_info, map_flags), + "bpf_map_info_struct.map_flags size mismatch"); + static_assert(offsetof(struct bpf_map_info_struct, map_flags) == offsetof(struct bpf_map_info, map_flags), + "bpf_map_info_struct.map_flags offset mismatch"); +# endif /* HAVE_STRUCT_BPF_MAP_INFO_MAP_FLAGS */ + +# ifdef HAVE_STRUCT_BPF_MAP_INFO_NAME + static_assert(SoM(struct bpf_map_info_struct, name) == SoM(struct bpf_map_info, name), + "bpf_map_info_struct.name size mismatch"); + static_assert(offsetof(struct bpf_map_info_struct, name) == offsetof(struct bpf_map_info, name), + "bpf_map_info_struct.name offset mismatch"); +# endif /* HAVE_STRUCT_BPF_MAP_INFO_NAME */ + +# ifdef HAVE_STRUCT_BPF_MAP_INFO_IFINDEX + static_assert(SoM(struct bpf_map_info_struct, ifindex) == SoM(struct bpf_map_info, ifindex), + "bpf_map_info_struct.ifindex size mismatch"); + static_assert(offsetof(struct bpf_map_info_struct, ifindex) == offsetof(struct bpf_map_info, ifindex), + "bpf_map_info_struct.ifindex offset mismatch"); +# endif /* HAVE_STRUCT_BPF_MAP_INFO_IFINDEX */ + +# ifdef HAVE_STRUCT_BPF_MAP_INFO_BTF_ID + static_assert(SoM(struct bpf_map_info_struct, btf_id) == SoM(struct bpf_map_info, btf_id), + "bpf_map_info_struct.btf_id size mismatch"); + static_assert(offsetof(struct bpf_map_info_struct, btf_id) == offsetof(struct bpf_map_info, btf_id), + "bpf_map_info_struct.btf_id offset mismatch"); +# endif /* HAVE_STRUCT_BPF_MAP_INFO_BTF_ID */ + +# ifdef HAVE_STRUCT_BPF_MAP_INFO_BTF_KEY_TYPE_ID + static_assert(SoM(struct bpf_map_info_struct, btf_key_type_id) == SoM(struct bpf_map_info, btf_key_type_id), + "bpf_map_info_struct.btf_key_type_id size mismatch"); + static_assert(offsetof(struct bpf_map_info_struct, btf_key_type_id) == offsetof(struct bpf_map_info, btf_key_type_id), + "bpf_map_info_struct.btf_key_type_id offset mismatch"); +# endif /* HAVE_STRUCT_BPF_MAP_INFO_BTF_KEY_TYPE_ID */ + +# ifdef HAVE_STRUCT_BPF_MAP_INFO_BTF_VALUE_TYPE_ID + static_assert(SoM(struct bpf_map_info_struct, btf_value_type_id) == SoM(struct bpf_map_info, btf_value_type_id), + "bpf_map_info_struct.btf_value_type_id size mismatch"); + static_assert(offsetof(struct bpf_map_info_struct, btf_value_type_id) == offsetof(struct bpf_map_info, btf_value_type_id), + "bpf_map_info_struct.btf_value_type_id offset mismatch"); +# endif /* HAVE_STRUCT_BPF_MAP_INFO_BTF_VALUE_TYPE_ID */ + +static_assert(bpf_map_info_struct_size == expected_bpf_map_info_struct_size, + "bpf_map_info_struct_size mismatch"); + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_TYPE + static_assert(SoM(struct bpf_prog_info_struct, type) == SoM(struct bpf_prog_info, type), + "bpf_prog_info_struct.type size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, type) == offsetof(struct bpf_prog_info, type), + "bpf_prog_info_struct.type offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_TYPE */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_ID + static_assert(SoM(struct bpf_prog_info_struct, id) == SoM(struct bpf_prog_info, id), + "bpf_prog_info_struct.id size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, id) == offsetof(struct bpf_prog_info, id), + "bpf_prog_info_struct.id offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_ID */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_TAG + static_assert(SoM(struct bpf_prog_info_struct, tag) == SoM(struct bpf_prog_info, tag), + "bpf_prog_info_struct.tag size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, tag) == offsetof(struct bpf_prog_info, tag), + "bpf_prog_info_struct.tag offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_TAG */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_JITED_PROG_LEN + static_assert(SoM(struct bpf_prog_info_struct, jited_prog_len) == SoM(struct bpf_prog_info, jited_prog_len), + "bpf_prog_info_struct.jited_prog_len size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, jited_prog_len) == offsetof(struct bpf_prog_info, jited_prog_len), + "bpf_prog_info_struct.jited_prog_len offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_JITED_PROG_LEN */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_XLATED_PROG_LEN + static_assert(SoM(struct bpf_prog_info_struct, xlated_prog_len) == SoM(struct bpf_prog_info, xlated_prog_len), + "bpf_prog_info_struct.xlated_prog_len size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, xlated_prog_len) == offsetof(struct bpf_prog_info, xlated_prog_len), + "bpf_prog_info_struct.xlated_prog_len offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_XLATED_PROG_LEN */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_JITED_PROG_INSNS + static_assert(SoM(struct bpf_prog_info_struct, jited_prog_insns) == SoM(struct bpf_prog_info, jited_prog_insns), + "bpf_prog_info_struct.jited_prog_insns size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, jited_prog_insns) == offsetof(struct bpf_prog_info, jited_prog_insns), + "bpf_prog_info_struct.jited_prog_insns offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_JITED_PROG_INSNS */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_XLATED_PROG_INSNS + static_assert(SoM(struct bpf_prog_info_struct, xlated_prog_insns) == SoM(struct bpf_prog_info, xlated_prog_insns), + "bpf_prog_info_struct.xlated_prog_insns size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, xlated_prog_insns) == offsetof(struct bpf_prog_info, xlated_prog_insns), + "bpf_prog_info_struct.xlated_prog_insns offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_XLATED_PROG_INSNS */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_LOAD_TIME + static_assert(SoM(struct bpf_prog_info_struct, load_time) == SoM(struct bpf_prog_info, load_time), + "bpf_prog_info_struct.load_time size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, load_time) == offsetof(struct bpf_prog_info, load_time), + "bpf_prog_info_struct.load_time offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_LOAD_TIME */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_CREATED_BY_UID + static_assert(SoM(struct bpf_prog_info_struct, created_by_uid) == SoM(struct bpf_prog_info, created_by_uid), + "bpf_prog_info_struct.created_by_uid size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, created_by_uid) == offsetof(struct bpf_prog_info, created_by_uid), + "bpf_prog_info_struct.created_by_uid offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_CREATED_BY_UID */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_NR_MAP_IDS + static_assert(SoM(struct bpf_prog_info_struct, nr_map_ids) == SoM(struct bpf_prog_info, nr_map_ids), + "bpf_prog_info_struct.nr_map_ids size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, nr_map_ids) == offsetof(struct bpf_prog_info, nr_map_ids), + "bpf_prog_info_struct.nr_map_ids offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_NR_MAP_IDS */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_MAP_IDS + static_assert(SoM(struct bpf_prog_info_struct, map_ids) == SoM(struct bpf_prog_info, map_ids), + "bpf_prog_info_struct.map_ids size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, map_ids) == offsetof(struct bpf_prog_info, map_ids), + "bpf_prog_info_struct.map_ids offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_MAP_IDS */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_NAME + static_assert(SoM(struct bpf_prog_info_struct, name) == SoM(struct bpf_prog_info, name), + "bpf_prog_info_struct.name size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, name) == offsetof(struct bpf_prog_info, name), + "bpf_prog_info_struct.name offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_NAME */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_IFINDEX + static_assert(SoM(struct bpf_prog_info_struct, ifindex) == SoM(struct bpf_prog_info, ifindex), + "bpf_prog_info_struct.ifindex size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, ifindex) == offsetof(struct bpf_prog_info, ifindex), + "bpf_prog_info_struct.ifindex offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_IFINDEX */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_NR_JITED_KSYMS + static_assert(SoM(struct bpf_prog_info_struct, nr_jited_ksyms) == SoM(struct bpf_prog_info, nr_jited_ksyms), + "bpf_prog_info_struct.nr_jited_ksyms size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, nr_jited_ksyms) == offsetof(struct bpf_prog_info, nr_jited_ksyms), + "bpf_prog_info_struct.nr_jited_ksyms offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_NR_JITED_KSYMS */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_NR_JITED_FUNC_LENS + static_assert(SoM(struct bpf_prog_info_struct, nr_jited_func_lens) == SoM(struct bpf_prog_info, nr_jited_func_lens), + "bpf_prog_info_struct.nr_jited_func_lens size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, nr_jited_func_lens) == offsetof(struct bpf_prog_info, nr_jited_func_lens), + "bpf_prog_info_struct.nr_jited_func_lens offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_NR_JITED_FUNC_LENS */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_JITED_KSYMS + static_assert(SoM(struct bpf_prog_info_struct, jited_ksyms) == SoM(struct bpf_prog_info, jited_ksyms), + "bpf_prog_info_struct.jited_ksyms size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, jited_ksyms) == offsetof(struct bpf_prog_info, jited_ksyms), + "bpf_prog_info_struct.jited_ksyms offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_JITED_KSYMS */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_JITED_FUNC_LENS + static_assert(SoM(struct bpf_prog_info_struct, jited_func_lens) == SoM(struct bpf_prog_info, jited_func_lens), + "bpf_prog_info_struct.jited_func_lens size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, jited_func_lens) == offsetof(struct bpf_prog_info, jited_func_lens), + "bpf_prog_info_struct.jited_func_lens offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_JITED_FUNC_LENS */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_BTF_ID + static_assert(SoM(struct bpf_prog_info_struct, btf_id) == SoM(struct bpf_prog_info, btf_id), + "bpf_prog_info_struct.btf_id size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, btf_id) == offsetof(struct bpf_prog_info, btf_id), + "bpf_prog_info_struct.btf_id offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_BTF_ID */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_FUNC_INFO_REC_SIZE + static_assert(SoM(struct bpf_prog_info_struct, func_info_rec_size) == SoM(struct bpf_prog_info, func_info_rec_size), + "bpf_prog_info_struct.func_info_rec_size size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, func_info_rec_size) == offsetof(struct bpf_prog_info, func_info_rec_size), + "bpf_prog_info_struct.func_info_rec_size offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_FUNC_INFO_REC_SIZE */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_FUNC_INFO + static_assert(SoM(struct bpf_prog_info_struct, func_info) == SoM(struct bpf_prog_info, func_info), + "bpf_prog_info_struct.func_info size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, func_info) == offsetof(struct bpf_prog_info, func_info), + "bpf_prog_info_struct.func_info offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_FUNC_INFO */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_NR_FUNC_INFO + static_assert(SoM(struct bpf_prog_info_struct, nr_func_info) == SoM(struct bpf_prog_info, nr_func_info), + "bpf_prog_info_struct.nr_func_info size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, nr_func_info) == offsetof(struct bpf_prog_info, nr_func_info), + "bpf_prog_info_struct.nr_func_info offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_NR_FUNC_INFO */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_NR_LINE_INFO + static_assert(SoM(struct bpf_prog_info_struct, nr_line_info) == SoM(struct bpf_prog_info, nr_line_info), + "bpf_prog_info_struct.nr_line_info size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, nr_line_info) == offsetof(struct bpf_prog_info, nr_line_info), + "bpf_prog_info_struct.nr_line_info offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_NR_LINE_INFO */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_LINE_INFO + static_assert(SoM(struct bpf_prog_info_struct, line_info) == SoM(struct bpf_prog_info, line_info), + "bpf_prog_info_struct.line_info size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, line_info) == offsetof(struct bpf_prog_info, line_info), + "bpf_prog_info_struct.line_info offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_LINE_INFO */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_JITED_LINE_INFO + static_assert(SoM(struct bpf_prog_info_struct, jited_line_info) == SoM(struct bpf_prog_info, jited_line_info), + "bpf_prog_info_struct.jited_line_info size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, jited_line_info) == offsetof(struct bpf_prog_info, jited_line_info), + "bpf_prog_info_struct.jited_line_info offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_JITED_LINE_INFO */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_NR_JITED_LINE_INFO + static_assert(SoM(struct bpf_prog_info_struct, nr_jited_line_info) == SoM(struct bpf_prog_info, nr_jited_line_info), + "bpf_prog_info_struct.nr_jited_line_info size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, nr_jited_line_info) == offsetof(struct bpf_prog_info, nr_jited_line_info), + "bpf_prog_info_struct.nr_jited_line_info offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_NR_JITED_LINE_INFO */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_LINE_INFO_REC_SIZE + static_assert(SoM(struct bpf_prog_info_struct, line_info_rec_size) == SoM(struct bpf_prog_info, line_info_rec_size), + "bpf_prog_info_struct.line_info_rec_size size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, line_info_rec_size) == offsetof(struct bpf_prog_info, line_info_rec_size), + "bpf_prog_info_struct.line_info_rec_size offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_LINE_INFO_REC_SIZE */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_JITED_LINE_INFO_REC_SIZE + static_assert(SoM(struct bpf_prog_info_struct, jited_line_info_rec_size) == SoM(struct bpf_prog_info, jited_line_info_rec_size), + "bpf_prog_info_struct.jited_line_info_rec_size size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, jited_line_info_rec_size) == offsetof(struct bpf_prog_info, jited_line_info_rec_size), + "bpf_prog_info_struct.jited_line_info_rec_size offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_JITED_LINE_INFO_REC_SIZE */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_NR_PROG_TAGS + static_assert(SoM(struct bpf_prog_info_struct, nr_prog_tags) == SoM(struct bpf_prog_info, nr_prog_tags), + "bpf_prog_info_struct.nr_prog_tags size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, nr_prog_tags) == offsetof(struct bpf_prog_info, nr_prog_tags), + "bpf_prog_info_struct.nr_prog_tags offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_NR_PROG_TAGS */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_PROG_TAGS + static_assert(SoM(struct bpf_prog_info_struct, prog_tags) == SoM(struct bpf_prog_info, prog_tags), + "bpf_prog_info_struct.prog_tags size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, prog_tags) == offsetof(struct bpf_prog_info, prog_tags), + "bpf_prog_info_struct.prog_tags offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_PROG_TAGS */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_RUN_TIME_NS + static_assert(SoM(struct bpf_prog_info_struct, run_time_ns) == SoM(struct bpf_prog_info, run_time_ns), + "bpf_prog_info_struct.run_time_ns size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, run_time_ns) == offsetof(struct bpf_prog_info, run_time_ns), + "bpf_prog_info_struct.run_time_ns offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_RUN_TIME_NS */ + +# ifdef HAVE_STRUCT_BPF_PROG_INFO_RUN_CNT + static_assert(SoM(struct bpf_prog_info_struct, run_cnt) == SoM(struct bpf_prog_info, run_cnt), + "bpf_prog_info_struct.run_cnt size mismatch"); + static_assert(offsetof(struct bpf_prog_info_struct, run_cnt) == offsetof(struct bpf_prog_info, run_cnt), + "bpf_prog_info_struct.run_cnt offset mismatch"); +# endif /* HAVE_STRUCT_BPF_PROG_INFO_RUN_CNT */ + +static_assert(bpf_prog_info_struct_size == expected_bpf_prog_info_struct_size, + "bpf_prog_info_struct_size mismatch"); + +#endif /* HAVE_LINUX_BPF_H */ diff --git a/bpf_filter.c b/bpf_filter.c new file mode 100644 index 00000000..fbd26a5c --- /dev/null +++ b/bpf_filter.c @@ -0,0 +1,181 @@ +/* + * Decoder of classic BPF programs. + * + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#include "bpf_filter.h" +#include "bpf_fprog.h" + +#include + +#include "xlat/bpf_class.h" +#include "xlat/bpf_miscop.h" +#include "xlat/bpf_mode.h" +#include "xlat/bpf_op_alu.h" +#include "xlat/bpf_op_jmp.h" +#include "xlat/bpf_rval.h" +#include "xlat/bpf_size.h" +#include "xlat/bpf_src.h" + +#include "xlat/ebpf_class.h" +#include "xlat/ebpf_mode.h" +#include "xlat/ebpf_op_alu.h" +#include "xlat/ebpf_op_jmp.h" +#include "xlat/ebpf_size.h" + +void +print_bpf_filter_code(const uint16_t code, bool extended) +{ + const struct xlat *mode = extended ? ebpf_mode : bpf_mode; + uint16_t i = code & ~BPF_CLASS(code); + + if (extended) + printxval_index(ebpf_class, BPF_CLASS(code), "BPF_???"); + else + printxval_index(bpf_class, BPF_CLASS(code), "BPF_???"); + switch (BPF_CLASS(code)) { + case BPF_ST: + case BPF_STX: + if (!extended) { + if (i) { + tprintf("|%#x", i); + tprints_comment("BPF_???"); + } + break; + } + ATTRIBUTE_FALLTHROUGH; /* extended == true */ + + case BPF_LD: + case BPF_LDX: + tprints("|"); + printxvals(BPF_SIZE(code), "BPF_???", + bpf_size, extended ? ebpf_size : NULL, NULL); + tprints("|"); + printxval(mode, BPF_MODE(code), "BPF_???"); + break; + + case BPF_MISC: /* BPF_ALU64 in eBPF */ + if (!extended) { + tprints("|"); + printxval(bpf_miscop, BPF_MISCOP(code), "BPF_???"); + i &= ~BPF_MISCOP(code); + if (i) { + tprintf("|%#x", i); + tprints_comment("BPF_???"); + } + break; + } + ATTRIBUTE_FALLTHROUGH; /* extended == true */ + + case BPF_ALU: + tprints("|"); + printxval(bpf_src, BPF_SRC(code), "BPF_???"); + tprints("|"); + printxvals(BPF_OP(code), "BPF_???", + bpf_op_alu, + extended ? ebpf_op_alu : NULL, NULL); + break; + + case BPF_JMP: + tprints("|"); + printxval(bpf_src, BPF_SRC(code), "BPF_???"); + tprints("|"); + printxvals(BPF_OP(code), "BPF_???", + bpf_op_jmp, extended ? ebpf_op_jmp : NULL, NULL); + break; + + case BPF_RET: /* Reserved in eBPF */ + if (!extended) { + tprints("|"); + printxval(bpf_rval, BPF_RVAL(code), "BPF_???"); + i &= ~BPF_RVAL(code); + } + + if (i) { + tprintf("|%#x", i); + tprints_comment("BPF_???"); + } + + break; + } +} + +static void +print_bpf_filter_stmt(const struct bpf_filter_block *const filter, + const print_bpf_filter_fn print_k) +{ + tprints("BPF_STMT("); + print_bpf_filter_code(filter->code, false); + tprints(", "); + if (!print_k || !print_k(filter)) + tprintf("%#x", filter->k); + tprints(")"); +} + +static void +print_bpf_filter_jump(const struct bpf_filter_block *const filter) +{ + tprints("BPF_JUMP("); + print_bpf_filter_code(filter->code, false); + tprintf(", %#x, %#x, %#x)", filter->k, filter->jt, filter->jf); +} + +struct bpf_filter_block_data { + const print_bpf_filter_fn fn; + unsigned int count; +}; + +static bool +print_bpf_filter_block(struct tcb *const tcp, void *const elem_buf, + const size_t elem_size, void *const data) +{ + const struct bpf_filter_block *const filter = elem_buf; + struct bpf_filter_block_data *const fbd = data; + + if (fbd->count++ >= BPF_MAXINSNS) { + tprints("..."); + return false; + } + + if (filter->jt || filter->jf) + print_bpf_filter_jump(filter); + else + print_bpf_filter_stmt(filter, fbd->fn); + + return true; +} + +void +print_bpf_fprog(struct tcb *const tcp, const kernel_ulong_t addr, + const unsigned short len, const print_bpf_filter_fn print_k) +{ + if (abbrev(tcp)) { + printaddr(addr); + } else { + struct bpf_filter_block_data fbd = { .fn = print_k }; + struct bpf_filter_block filter; + + print_array(tcp, addr, len, &filter, sizeof(filter), + tfetch_mem, print_bpf_filter_block, &fbd); + } +} + +void +decode_bpf_fprog(struct tcb *const tcp, const kernel_ulong_t addr, + const print_bpf_filter_fn print_k) +{ + struct bpf_fprog fprog; + + if (fetch_bpf_fprog(tcp, addr, &fprog)) { + tprintf("{len=%hu, filter=", fprog.len); + print_bpf_fprog(tcp, fprog.filter, fprog.len, print_k); + tprints("}"); + } +} diff --git a/bpf_filter.h b/bpf_filter.h new file mode 100644 index 00000000..b19384f8 --- /dev/null +++ b/bpf_filter.h @@ -0,0 +1,30 @@ +/* + * Classic BPF filter block. + * + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_BPF_FILTER_H +# define STRACE_BPF_FILTER_H + +struct bpf_filter_block { + uint16_t code; + uint8_t jt; + uint8_t jf; + uint32_t k; +}; + +typedef bool (*print_bpf_filter_fn)(const struct bpf_filter_block *); + +extern void +print_bpf_fprog(struct tcb *const tcp, const kernel_ulong_t addr, + const unsigned short len, const print_bpf_filter_fn print_k); + +extern void +decode_bpf_fprog(struct tcb *const tcp, const kernel_ulong_t addr, + const print_bpf_filter_fn print_k); + +#endif /* !STRACE_BPF_FILTER_H */ diff --git a/bpf_fprog.h b/bpf_fprog.h new file mode 100644 index 00000000..3321531e --- /dev/null +++ b/bpf_fprog.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_BPF_FPROG_H +# define STRACE_BPF_FPROG_H + +struct bpf_fprog { + unsigned short len; + kernel_ulong_t filter; +}; + +#endif /* !STRACE_BPF_FPROG_H */ diff --git a/bpf_seccomp_filter.c b/bpf_seccomp_filter.c new file mode 100644 index 00000000..4db71b16 --- /dev/null +++ b/bpf_seccomp_filter.c @@ -0,0 +1,51 @@ +/* + * Decoder of seccomp filter programs. + * + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#include "bpf_filter.h" + +#include +#ifdef HAVE_LINUX_SECCOMP_H +# include +#endif +#ifndef SECCOMP_RET_ACTION_FULL +# define SECCOMP_RET_ACTION_FULL 0xffff0000U +#endif +#include "xlat/seccomp_ret_action.h" + +static bool +print_seccomp_filter_k(const struct bpf_filter_block *const fp) +{ + if (BPF_CLASS(fp->code) == BPF_RET) { + unsigned int action = SECCOMP_RET_ACTION_FULL & fp->k; + unsigned int data = fp->k & ~action; + + printxval(seccomp_ret_action, action, "SECCOMP_RET_???"); + if (data) + tprintf("|%#x", data); + + return true; + } + + return false; +} + +void +print_seccomp_fprog(struct tcb *const tcp, const kernel_ulong_t addr, + const unsigned short len) +{ + print_bpf_fprog(tcp, addr, len, print_seccomp_filter_k); +} + +void +decode_seccomp_fprog(struct tcb *const tcp, const kernel_ulong_t addr) +{ + decode_bpf_fprog(tcp, addr, print_seccomp_filter_k); +} diff --git a/bpf_sock_filter.c b/bpf_sock_filter.c new file mode 100644 index 00000000..e66faa8e --- /dev/null +++ b/bpf_sock_filter.c @@ -0,0 +1,54 @@ +/* + * Decoder of socket filter programs. + * + * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#include "bpf_filter.h" + +#include +#include "xlat/skf_ad.h" +#include "xlat/skf_off.h" + +static bool +print_sock_filter_k(const struct bpf_filter_block *const fp) +{ + if (BPF_CLASS(fp->code) == BPF_LD && BPF_MODE(fp->code) == BPF_ABS) { + if (fp->k >= (unsigned int) SKF_AD_OFF) { + print_xlat32(SKF_AD_OFF); + tprints("+"); + printxval(skf_ad, fp->k - (unsigned int) SKF_AD_OFF, + "SKF_AD_???"); + return true; + } else if (fp->k >= (unsigned int) SKF_NET_OFF) { + print_xlat32(SKF_NET_OFF); + tprintf("+%u", fp->k - (unsigned int) SKF_NET_OFF); + return true; + } else if (fp->k >= (unsigned int) SKF_LL_OFF) { + print_xlat32(SKF_LL_OFF); + tprintf("+%u", fp->k - (unsigned int) SKF_LL_OFF); + return true; + } + } + + return false; +} + +void +print_sock_fprog(struct tcb *const tcp, const kernel_ulong_t addr, + const unsigned short len) +{ + print_bpf_fprog(tcp, addr, len, print_sock_filter_k); +} + +void +decode_sock_fprog(struct tcb *const tcp, const kernel_ulong_t addr) +{ + decode_bpf_fprog(tcp, addr, print_sock_filter_k); +} diff --git a/btrfs.c b/btrfs.c index e007040f..dc5eff1a 100644 --- a/btrfs.c +++ b/btrfs.c @@ -1,38 +1,19 @@ /* * Copyright (c) 2016 Jeff Mahoney + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" #ifdef HAVE_LINUX_BTRFS_H -#include DEF_MPERS_TYPE(struct_btrfs_ioctl_dev_replace_args) -#include DEF_MPERS_TYPE(struct_btrfs_ioctl_send_args) -#include DEF_MPERS_TYPE(struct_btrfs_ioctl_received_subvol_args) -#include DEF_MPERS_TYPE(struct_btrfs_ioctl_vol_args_v2) +# include DEF_MPERS_TYPE(struct_btrfs_ioctl_dev_replace_args) +# include DEF_MPERS_TYPE(struct_btrfs_ioctl_send_args) +# include DEF_MPERS_TYPE(struct_btrfs_ioctl_received_subvol_args) +# include DEF_MPERS_TYPE(struct_btrfs_ioctl_vol_args_v2) # include @@ -51,7 +32,8 @@ typedef struct btrfs_ioctl_vol_args_v2 #ifdef HAVE_LINUX_BTRFS_H -#include +# include "print_fields.h" +# include /* * Prior to Linux 3.12, the BTRFS_IOC_DEFAULT_SUBVOL used u64 in @@ -59,15 +41,15 @@ typedef struct btrfs_ioctl_vol_args_v2 */ typedef __u64 u64; -#ifndef HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS +# ifndef HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS struct btrfs_ioctl_feature_flags { uint64_t compat_flags; uint64_t compat_ro_flags; uint64_t incompat_flags; }; -#endif +# endif -#ifndef HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START +# ifndef HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START struct btrfs_ioctl_defrag_range_args { uint64_t start; uint64_t len; @@ -76,41 +58,37 @@ struct btrfs_ioctl_defrag_range_args { uint32_t compress_type; uint32_t unused[4]; }; -#endif - -#ifndef BTRFS_LABEL_SIZE -# define BTRFS_LABEL_SIZE 256 -#endif +# endif -#ifndef BTRFS_FIRST_FREE_OBJECTID -# define BTRFS_FIRST_FREE_OBJECTID 256ULL -#endif +# ifndef BTRFS_LABEL_SIZE +# define BTRFS_LABEL_SIZE 256 +# endif -#ifndef BTRFS_IOC_QUOTA_RESCAN +# ifndef BTRFS_IOC_QUOTA_RESCAN struct btrfs_ioctl_quota_rescan_args { uint64_t flags, progress, reserved[6]; }; -# define BTRFS_IOC_QUOTA_RESCAN _IOW(BTRFS_IOCTL_MAGIC, 44, \ +# define BTRFS_IOC_QUOTA_RESCAN _IOW(BTRFS_IOCTL_MAGIC, 44, \ struct btrfs_ioctl_quota_rescan_args) -# define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \ +# define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \ struct btrfs_ioctl_quota_rescan_args) -#endif +# endif -#ifndef BTRFS_IOC_QUOTA_RESCAN_WAIT -# define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46) -#endif +# ifndef BTRFS_IOC_QUOTA_RESCAN_WAIT +# define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46) +# endif -#ifndef BTRFS_IOC_GET_FEATURES -# define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \ +# ifndef BTRFS_IOC_GET_FEATURES +# define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \ struct btrfs_ioctl_feature_flags) -# define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, \ +# define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, \ struct btrfs_ioctl_feature_flags[2]) -# define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \ +# define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \ struct btrfs_ioctl_feature_flags[3]) -#endif +# endif -#ifndef BTRFS_IOC_TREE_SEARCH_V2 -# define BTRFS_IOC_TREE_SEARCH_V2 _IOWR(BTRFS_IOCTL_MAGIC, 17, \ +# ifndef BTRFS_IOC_TREE_SEARCH_V2 +# define BTRFS_IOC_TREE_SEARCH_V2 _IOWR(BTRFS_IOCTL_MAGIC, 17, \ struct btrfs_ioctl_search_args_v2) struct btrfs_ioctl_search_args_v2 { struct btrfs_ioctl_search_key key; /* in/out - search parameters */ @@ -119,87 +97,50 @@ struct btrfs_ioctl_search_args_v2 { * to store item */ uint64_t buf[0]; /* out - found items */ }; -#endif - -#include "xlat/btrfs_balance_args.h" -#include "xlat/btrfs_balance_ctl_cmds.h" -#include "xlat/btrfs_balance_flags.h" -#include "xlat/btrfs_balance_state.h" -#include "xlat/btrfs_compress_types.h" -#include "xlat/btrfs_defrag_flags.h" -#include "xlat/btrfs_dev_replace_cmds.h" -#include "xlat/btrfs_dev_replace_results.h" -#include "xlat/btrfs_dev_replace_state.h" -#include "xlat/btrfs_dev_stats_flags.h" -#include "xlat/btrfs_dev_stats_values.h" -#include "xlat/btrfs_features_compat.h" -#include "xlat/btrfs_features_compat_ro.h" -#include "xlat/btrfs_features_incompat.h" -#include "xlat/btrfs_key_types.h" -#include "xlat/btrfs_qgroup_ctl_cmds.h" -#include "xlat/btrfs_qgroup_inherit_flags.h" -#include "xlat/btrfs_qgroup_limit_flags.h" -#include "xlat/btrfs_qgroup_status_flags.h" -#include "xlat/btrfs_scrub_flags.h" -#include "xlat/btrfs_send_flags.h" -#include "xlat/btrfs_snap_flags_v2.h" -#include "xlat/btrfs_space_info_flags.h" -#include "xlat/btrfs_tree_objectids.h" - -static inline char -prnibble(char v) -{ - if (v >= 10) - return 'a' + (v - 10); - return '0' + v; -} - -/* 8-4-4-4-12 = 36 characters */ -#define UUID_STRING_SIZE 36 - -/* Formats uuid, returns 0 if it's all zeroes */ -static int -btrfs_unparse_uuid(unsigned char *uuid, char *out) -{ - int i; - int ret = 0; - for (i = 0; i < BTRFS_UUID_SIZE; i++) { - if (i == 4 || i == 6 || i == 8 || i == 10) - *out++ = '-'; - *out++ = prnibble(uuid[i] >> 4); - *out++ = prnibble(uuid[i] & 0xf); - if (uuid[i]) - ret = 1; - } - *out = '\0'; - return ret; -} - -static void -print_u64(const char *name, uint64_t value) -{ - tprintf(", %s=%" PRIu64, name, value); - if (value == UINT64_MAX) - tprints(" /* UINT64_MAX */"); -} - -#define print_member_u64(obj, name) print_u64(#name, obj->name) +# endif + +# include "xlat/btrfs_balance_args.h" +# include "xlat/btrfs_balance_ctl_cmds.h" +# include "xlat/btrfs_balance_flags.h" +# include "xlat/btrfs_balance_state.h" +# include "xlat/btrfs_compress_types.h" +# include "xlat/btrfs_cont_reading_from_srcdev_mode.h" +# include "xlat/btrfs_defrag_flags.h" +# include "xlat/btrfs_dev_replace_cmds.h" +# include "xlat/btrfs_dev_replace_results.h" +# include "xlat/btrfs_dev_replace_state.h" +# include "xlat/btrfs_dev_stats_flags.h" +# include "xlat/btrfs_dev_stats_values.h" +# include "xlat/btrfs_features_compat.h" +# include "xlat/btrfs_features_compat_ro.h" +# include "xlat/btrfs_features_incompat.h" +# include "xlat/btrfs_key_types.h" +# include "xlat/btrfs_logical_ino_args_flags.h" +# include "xlat/btrfs_qgroup_ctl_cmds.h" +# include "xlat/btrfs_qgroup_inherit_flags.h" +# include "xlat/btrfs_qgroup_limit_flags.h" +# include "xlat/btrfs_qgroup_status_flags.h" +# include "xlat/btrfs_scrub_flags.h" +# include "xlat/btrfs_send_flags.h" +# include "xlat/btrfs_snap_flags_v2.h" +# include "xlat/btrfs_space_info_flags.h" +# include "xlat/btrfs_tree_objectids.h" static void btrfs_print_balance_args(const char *name, const struct btrfs_balance_args *bba) { - tprintf(", %s={profiles=", name); - printflags64(btrfs_space_info_flags, bba->profiles, - "BTRFS_BLOCK_GROUP_???"); - print_member_u64(bba, usage); - print_member_u64(bba, devid); - print_member_u64(bba, pstart); - print_member_u64(bba, pend); - print_member_u64(bba, vstart); - print_member_u64(bba, vend); - print_member_u64(bba, target); - tprints(", flags="); - printflags64(btrfs_balance_args, bba->flags, "BTRFS_BALANCE_ARGS_???"); + tprintf(", %s=", name); + PRINT_FIELD_FLAGS("{", *bba, profiles, btrfs_space_info_flags, + "BTRFS_BLOCK_GROUP_???"); + PRINT_FIELD_U64(", ", *bba, usage); + PRINT_FIELD_DEV(", ", *bba, devid); + PRINT_FIELD_U64(", ", *bba, pstart); + PRINT_FIELD_U64(", ", *bba, pend); + PRINT_FIELD_U64(", ", *bba, vstart); + PRINT_FIELD_U64(", ", *bba, vend); + PRINT_FIELD_U64(", ", *bba, target); + PRINT_FIELD_FLAGS(", ", *bba, flags, btrfs_balance_args, + "BTRFS_BALANCE_ARGS_???"); tprints("}"); } @@ -211,14 +152,12 @@ btrfs_print_balance(struct tcb *const tcp, const kernel_ulong_t arg, bool out) if (umove_or_printaddr(tcp, arg, &balance_args)) return; - tprints("{flags="); - printflags64(btrfs_balance_flags, balance_args.flags, - "BTRFS_BALANCE_???"); - if (out) { - tprints(", state="); - printflags64(btrfs_balance_state, balance_args.state, - "BTRFS_BALANCE_STATE_???"); - } + PRINT_FIELD_FLAGS("{", balance_args, flags, btrfs_balance_flags, + "BTRFS_BALANCE_???"); + if (out) + PRINT_FIELD_FLAGS(", ", balance_args, state, + btrfs_balance_state, + "BTRFS_BALANCE_STATE_???"); if (balance_args.flags & BTRFS_BALANCE_DATA) btrfs_print_balance_args("data", &balance_args.data); @@ -232,57 +171,41 @@ btrfs_print_balance(struct tcb *const tcp, const kernel_ulong_t arg, bool out) static void btrfs_print_features(const struct btrfs_ioctl_feature_flags *flags) { - tprints("{compat_flags="); - printflags64(btrfs_features_compat, flags->compat_flags, - "BTRFS_FEATURE_COMPAT_???"); - - tprints(", compat_ro_flags="); - printflags64(btrfs_features_compat_ro, flags->compat_ro_flags, - "BTRFS_FEATURE_COMPAT_RO_???"); - - tprints(", incompat_flags="); - printflags64(btrfs_features_incompat, flags->incompat_flags, - "BTRFS_FEATURE_INCOMPAT_???"); + PRINT_FIELD_FLAGS("{", *flags, compat_flags, btrfs_features_compat, + "BTRFS_FEATURE_COMPAT_???"); + PRINT_FIELD_FLAGS(", ", *flags, compat_ro_flags, + btrfs_features_compat_ro, + "BTRFS_FEATURE_COMPAT_RO_???"); + PRINT_FIELD_FLAGS(", ", *flags, incompat_flags, btrfs_features_incompat, + "BTRFS_FEATURE_INCOMPAT_???"); tprints("}"); } static void btrfs_print_qgroup_limit(const struct btrfs_qgroup_limit *lim) { - tprints("{flags="); - printflags64(btrfs_qgroup_limit_flags, lim->flags, - "BTRFS_QGROUP_LIMIT_???"); - tprintf(", max_rfer=%" PRI__u64 ", max_excl=%" PRI__u64 - ", rsv_rfer=%" PRI__u64 ", rsv_excl=%" PRI__u64 "}", - lim->max_rfer, lim->max_excl, - lim->rsv_rfer, lim->rsv_excl); -} - -static void -btrfs_print_key_type(uint32_t type) -{ - const char *str = xlookup(btrfs_key_types, type); - tprintf("%u", type); - if (str) - tprintf(" /* %s */", str); + PRINT_FIELD_FLAGS(", lim={", *lim, flags, btrfs_qgroup_limit_flags, + "BTRFS_QGROUP_LIMIT_???"); + PRINT_FIELD_U(", ", *lim, max_rfer); + PRINT_FIELD_U(", ", *lim, max_excl); + PRINT_FIELD_U(", ", *lim, rsv_rfer); + PRINT_FIELD_U(", ", *lim, rsv_excl); + tprints("}"); } -static void -btrfs_print_objectid(uint64_t objectid) -{ - const char *str = xlookup(btrfs_tree_objectids, objectid); - tprintf("%" PRIu64, objectid); - if (str) - tprintf(" /* %s */", str); -} +# define btrfs_print_key_type(prefix_, where_, field_) \ + PRINT_FIELD_XVAL_U((prefix_), (where_), field_, btrfs_key_types, NULL) +# define btrfs_print_objectid(prefix_, where_, field_) \ + PRINT_FIELD_XVAL_U((prefix_), (where_), field_, btrfs_tree_objectids, \ + NULL) static void btrfs_print_data_container_header(const struct btrfs_data_container *container) { - tprintf("{bytes_left=%u, bytes_missing=%u" - ", elem_cnt=%u, elem_missed=%u, val=", - container->bytes_left, container->bytes_missing, - container->elem_cnt, container->elem_missed); + PRINT_FIELD_U("{", *container, bytes_left); + PRINT_FIELD_U(", ", *container, bytes_missing); + PRINT_FIELD_U(", ", *container, elem_cnt); + PRINT_FIELD_U(", ", *container, elem_missed); } static void @@ -295,10 +218,16 @@ static bool print_btrfs_data_container_logical_ino(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) { - const uint64_t *const record = elem_buf; + const struct { + uint64_t inum; + uint64_t offset; + uint64_t root; + } *const record = elem_buf; - tprintf("{inum=%" PRIu64 ", offset=%" PRIu64 ", root=%" PRIu64 "}", - record[0], record[1], record[2]); + PRINT_FIELD_U("{", *record, inum); + PRINT_FIELD_U(", ", *record, offset); + PRINT_FIELD_U(", ", *record, root); + tprints("}"); return true; } @@ -315,14 +244,15 @@ btrfs_print_logical_ino_container(struct tcb *tcp, btrfs_print_data_container_header(&container); if (abbrev(tcp)) { - tprints("..."); + tprints(", ..."); } else { const uint64_t val_addr = inodes_addr + offsetof(typeof(container), val); uint64_t record[3]; + tprints(", val="); print_array(tcp, val_addr, container.elem_cnt / 3, record, sizeof(record), - umoven_or_printaddr, + tfetch_mem, print_btrfs_data_container_logical_ino, 0); } @@ -353,28 +283,21 @@ btrfs_print_ino_path_container(struct tcb *tcp, btrfs_print_data_container_header(&container); if (abbrev(tcp)) { - tprints("..."); + tprints(", ..."); } else { uint64_t val_addr = fspath_addr + offsetof(typeof(container), val); uint64_t offset; + tprints(", val="); print_array(tcp, val_addr, container.elem_cnt, &offset, sizeof(offset), - umoven_or_printaddr, + tfetch_mem, print_btrfs_data_container_ino_path, &val_addr); } btrfs_print_data_container_footer(); } -static bool -print_uint64(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) -{ - tprintf("%" PRIu64, * (uint64_t *) elem_buf); - - return true; -} - static void btrfs_print_qgroup_inherit(struct tcb *const tcp, const kernel_ulong_t qgi_addr) { @@ -383,101 +306,84 @@ btrfs_print_qgroup_inherit(struct tcb *const tcp, const kernel_ulong_t qgi_addr) if (umove_or_printaddr(tcp, qgi_addr, &inherit)) return; - tprints("{flags="); - printflags64(btrfs_qgroup_inherit_flags, inherit.flags, - "BTRFS_QGROUP_INHERIT_???"); - tprintf(", num_qgroups=%" PRI__u64 ", num_ref_copies=%" PRI__u64 - ", num_excl_copies=%" PRI__u64 ", lim=", - inherit.num_qgroups, inherit.num_ref_copies, - inherit.num_excl_copies); + PRINT_FIELD_FLAGS("{", inherit, flags, btrfs_qgroup_inherit_flags, + "BTRFS_QGROUP_INHERIT_???"); + PRINT_FIELD_U(", ", inherit, num_qgroups); + PRINT_FIELD_U(", ", inherit, num_ref_copies); + PRINT_FIELD_U(", ", inherit, num_excl_copies); btrfs_print_qgroup_limit(&inherit.lim); - tprints(", qgroups="); - if (abbrev(tcp)) { - tprints("..."); + tprints(", ..."); } else { uint64_t record; + tprints(", qgroups="); print_array(tcp, qgi_addr + offsetof(typeof(inherit), qgroups), inherit.num_qgroups, &record, sizeof(record), - umoven_or_printaddr, print_uint64, 0); + tfetch_mem, print_uint64_array_member, 0); } tprints("}"); } -static void -print_key_value_internal(struct tcb *tcp, const char *name, uint64_t value) -{ - if (value) { - tprintf(", %s=%" PRIu64, name, value); - if (value == UINT64_MAX) - tprints(" /* UINT64_MAX */"); - } -} -#define print_key_value(tcp, key, name) \ - print_key_value_internal((tcp), #name, (key)->name) - static void btrfs_print_tree_search(struct tcb *tcp, struct btrfs_ioctl_search_key *key, uint64_t buf_addr, uint64_t buf_size, bool print_size) { if (entering(tcp)) { - tprints("{key={tree_id="); - btrfs_print_objectid(key->tree_id); + btrfs_print_objectid("{key={", *key, tree_id); if (key->min_objectid != BTRFS_FIRST_FREE_OBJECTID || - !abbrev(tcp)) { - tprints(", min_objectid="); - btrfs_print_objectid(key->min_objectid); - } + !abbrev(tcp)) + btrfs_print_objectid(", ", *key, min_objectid); if (key->max_objectid != BTRFS_LAST_FREE_OBJECTID || - !abbrev(tcp)) { - tprints(", max_objectid="); - btrfs_print_objectid(key->max_objectid); - } + !abbrev(tcp)) + btrfs_print_objectid(", ", *key, max_objectid); - print_key_value(tcp, key, min_offset); - print_key_value(tcp, key, max_offset); - print_key_value(tcp, key, min_transid); - print_key_value(tcp, key, max_transid); + PRINT_FIELD_U64(", ", *key, min_offset); + PRINT_FIELD_U64(", ", *key, max_offset); + PRINT_FIELD_U64(", ", *key, min_transid); + PRINT_FIELD_U64(", ", *key, max_transid); - tprints(", min_type="); - btrfs_print_key_type(key->min_type); - tprints(", max_type="); - btrfs_print_key_type(key->max_type); - tprintf(", nr_items=%u}", key->nr_items); + btrfs_print_key_type(", ", *key, min_type); + btrfs_print_key_type(", ", *key, max_type); + PRINT_FIELD_U(", ", *key, nr_items); + tprints("}"); if (print_size) tprintf(", buf_size=%" PRIu64, buf_size); tprints("}"); } else { - tprintf("{key={nr_items=%u}", key->nr_items); + PRINT_FIELD_U("{key={", *key, nr_items); + tprints("}"); if (print_size) tprintf(", buf_size=%" PRIu64, buf_size); - tprints(", buf="); - if (abbrev(tcp)) - tprints("..."); - else { + if (abbrev(tcp)) { + tprints(", ..."); + } else { uint64_t i; uint64_t off = 0; - tprints("["); + tprints(", buf=["); for (i = 0; i < key->nr_items; i++) { struct btrfs_ioctl_search_header sh; uint64_t addr = buf_addr + off; if (i) tprints(", "); - if (i > max_strlen || - umove(tcp, addr, &sh)) { + if (i > max_strlen) { + tprints("..."); + break; + } + if (umove(tcp, addr, &sh)) { tprints("..."); + printaddr_comment(addr); break; } - tprintf("{transid=%" PRI__u64 ", objectid=", - sh.transid); - btrfs_print_objectid(sh.objectid); - tprintf(", offset=%" PRI__u64 ", type=", sh.offset); - btrfs_print_key_type(sh.type); - tprintf(", len=%u}", sh.len); + PRINT_FIELD_U("{", sh, transid); + btrfs_print_objectid(", ", sh, objectid); + PRINT_FIELD_U(", ", sh, offset); + btrfs_print_key_type(", ", sh, type); + PRINT_FIELD_U(", ", sh, len); + tprints("}"); off += sizeof(sh) + sh.len; } @@ -491,7 +397,8 @@ static bool print_objectid_callback(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) { - btrfs_print_objectid(* (uint64_t *) elem_buf); + printxvals_ex(*(uint64_t *) elem_buf, NULL, XLAT_STYLE_FMT_U, + btrfs_tree_objectids, NULL); return true; } @@ -502,15 +409,22 @@ print_btrfs_ioctl_space_info(struct tcb *tcp, void *elem_buf, { const struct btrfs_ioctl_space_info *info = elem_buf; - tprints("{flags="); - printflags64(btrfs_space_info_flags, info->flags, - "BTRFS_SPACE_INFO_???"); - tprintf(", total_bytes=%" PRI__u64 ", used_bytes=%" PRI__u64 "}", - info->total_bytes, info->used_bytes); + PRINT_FIELD_FLAGS("{", *info, flags, btrfs_space_info_flags, + "BTRFS_SPACE_INFO_???"); + PRINT_FIELD_U(", ", *info, total_bytes); + PRINT_FIELD_U(", ", *info, used_bytes); + tprints("}"); return true; } +static void +print_btrfs_timespec(const char *prefix, uint64_t sec, uint32_t nsec) +{ + tprintf("%s{sec=%" PRIu64 ", nsec=%u}", prefix, sec, nsec); + tprints_comment(sprinttime_nsec(sec, nsec)); +} + MPERS_PRINTER_DECL(int, btrfs_ioctl, struct tcb *const tcp, const unsigned int code, const kernel_ulong_t arg) @@ -540,7 +454,7 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, case BTRFS_IOC_START_SYNC: /* R */ if (entering(tcp)) return 0; - /* fall through */ + ATTRIBUTE_FALLTHROUGH; /* takes a u64 */ case BTRFS_IOC_DEFAULT_SUBVOL: /* W */ case BTRFS_IOC_WAIT_SYNC: /* W */ @@ -606,27 +520,20 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, if (umove_or_printaddr(tcp, arg, &args)) break; - tprintf("{start=%" PRIu64 ", len=", (uint64_t)args.start); + PRINT_FIELD_U("{", args, start); + PRINT_FIELD_U64(", ", args, len); - tprintf("%" PRIu64, (uint64_t) args.len); - if (args.len == UINT64_MAX) - tprints(" /* UINT64_MAX */"); - - tprints(", flags="); - printflags64(btrfs_defrag_flags, args.flags, - "BTRFS_DEFRAG_RANGE_???"); - tprintf(", extent_thresh=%u, compress_type=", - args.extent_thresh); - printxval(btrfs_compress_types, args.compress_type, - "BTRFS_COMPRESS_???"); + PRINT_FIELD_FLAGS(", ", args, flags, btrfs_defrag_flags, + "BTRFS_DEFRAG_RANGE_???"); + PRINT_FIELD_U(", ", args, extent_thresh); + PRINT_FIELD_XVAL(", ", args, compress_type, + btrfs_compress_types, "BTRFS_COMPRESS_???"); tprints("}"); break; } case BTRFS_IOC_DEV_INFO: { /* RW */ struct btrfs_ioctl_dev_info_args args; - char uuid[UUID_STRING_SIZE+1]; - int valid; if (entering(tcp)) tprints(", "); @@ -636,24 +543,27 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, tprints(" => "); if (umove_or_printaddr(tcp, arg, &args)) break; - tprints("{"); - valid = btrfs_unparse_uuid(args.uuid, uuid); if (entering(tcp)) { - tprintf("devid=%" PRI__u64, args.devid); - if (valid) - tprintf(", uuid=%s", uuid); + PRINT_FIELD_DEV("{", args, devid); + if (!IS_ARRAY_ZERO(args.uuid)) + PRINT_FIELD_UUID(", ", args, uuid); tprints("}"); return 0; } - if (valid) - tprintf("uuid=%s, ", uuid); - tprintf("bytes_used=%" PRI__u64 - ", total_bytes=%" PRI__u64 ", path=", - args.bytes_used, args.total_bytes); - print_quoted_string((const char *)args.path, sizeof(args.path), - QUOTE_0_TERMINATED); + + tprints("{"); + + if (!IS_ARRAY_ZERO(args.uuid)) { + PRINT_FIELD_UUID("", args, uuid); + tprints(", "); + } + + PRINT_FIELD_U("", args, bytes_used); + PRINT_FIELD_U(", ", args, total_bytes); + PRINT_FIELD_CSTRING(", ", args, path); tprints("}"); + break; } @@ -671,26 +581,20 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, break; if (entering(tcp)) { - tprints("{cmd="); - printxval64(btrfs_dev_replace_cmds, args.cmd, - "BTRFS_IOCTL_DEV_REPLACE_CMD_???"); + PRINT_FIELD_XVAL("{", args, cmd, btrfs_dev_replace_cmds, + "BTRFS_IOCTL_DEV_REPLACE_CMD_???"); if (args.cmd == BTRFS_IOCTL_DEV_REPLACE_CMD_START) { - const char *str; - tprintf(", start={srcdevid=%" PRIu64 - ", cont_reading_from_srcdev_mode=%" PRIu64 - ", srcdev_name=", - (uint64_t) args.start.srcdevid, - (uint64_t) args.start.cont_reading_from_srcdev_mode); - - str = (const char*) args.start.srcdev_name; - print_quoted_string(str, - sizeof(args.start.srcdev_name), - QUOTE_0_TERMINATED); - tprints(", tgtdev_name="); - str = (const char*) args.start.tgtdev_name; - print_quoted_string(str, - sizeof(args.start.tgtdev_name), - QUOTE_0_TERMINATED); + PRINT_FIELD_DEV(", start={", args.start, + srcdevid); + PRINT_FIELD_XVAL(", ", args.start, + cont_reading_from_srcdev_mode, + btrfs_cont_reading_from_srcdev_mode, + "BTRFS_IOCTL_DEV_REPLACE_CONT_READING" + "_FROM_SRCDEV_MODE_???"); + PRINT_FIELD_CSTRING(", ", args.start, + srcdev_name); + PRINT_FIELD_CSTRING(", ", args.start, + tgtdev_name); tprints("}"); } @@ -698,42 +602,28 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, return 0; } - tprints("{result="); - printxval64(btrfs_dev_replace_results, args.result, - "BTRFS_IOCTL_DEV_REPLACE_RESULT_???"); + PRINT_FIELD_XVAL("{", args, result, btrfs_dev_replace_results, + "BTRFS_IOCTL_DEV_REPLACE_RESULT_???"); if (args.cmd == BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS) { - char buf[sizeof("HH:MM:SS") + 1]; - time_t time; - tprints(", "); - printxval64(btrfs_dev_replace_state, - args.status.replace_state, - "BTRFS_IOCTL_DEV_REPLACE_STATE_???"); - tprintf(", progress_1000=%" PRIu64 " /* ", - (uint64_t) args.status.progress_1000); + PRINT_FIELD_XVAL(", status={", args.status, + replace_state, btrfs_dev_replace_state, + "BTRFS_IOCTL_DEV_REPLACE_STATE_???"); + + PRINT_FIELD_U(", ", args.status, progress_1000); if (args.status.progress_1000 <= 1000) - tprintf("%" PRIu64 ".%.2" PRIu64 "%%", - (uint64_t) args.status.progress_1000 / 10, - (uint64_t) args.status.progress_1000 % 10); - else - tprints("???"); - tprints(" */ ,"); - - time = args.status.time_started; - strftime(buf, sizeof(buf), "%T", - localtime(&time)); - tprintf("time_started=%" PRIu64" /* %s */, ", - (uint64_t) args.status.time_started, buf); - - time = args.status.time_stopped; - strftime(buf, sizeof(buf), "%T", - localtime(&time)); - tprintf("time_stopped=%" PRIu64" /* %s */, ", - (uint64_t) args.status.time_stopped, buf); - - tprintf("num_write_errors=%" PRIu64 - ", num_uncorrectable_read_errors=%" PRIu64, - (uint64_t) args.status.num_write_errors, - (uint64_t) args.status.num_uncorrectable_read_errors); + tprintf_comment("%u.%u%%", + (unsigned) args.status.progress_1000 / 10, + (unsigned) args.status.progress_1000 % 10); + + PRINT_FIELD_U(", ", args.status, time_started); + tprints_comment(sprinttime(args.status.time_started)); + + PRINT_FIELD_U(", ", args.status, time_stopped); + tprints_comment(sprinttime(args.status.time_stopped)); + + PRINT_FIELD_U(", ", args.status, num_write_errors); + PRINT_FIELD_U(", ", args.status, + num_uncorrectable_read_errors); } tprints("}"); break; @@ -779,14 +669,17 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, if (umove_or_printaddr(tcp, arg, &flarg)) break; - tprints("[ /* supported */ "); + tprints("["); btrfs_print_features(&flarg[0]); + tprints_comment("supported"); - tprints(", /* safe to set */ "); + tprints(", "); btrfs_print_features(&flarg[1]); + tprints_comment("safe to set"); - tprints(", /* safe to clear */ "); + tprints(", "); btrfs_print_features(&flarg[2]); + tprints_comment("safe to clear"); tprints("]"); break; @@ -794,11 +687,10 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, case BTRFS_IOC_FS_INFO: { /* R */ struct btrfs_ioctl_fs_info_args args; - char uuid[UUID_STRING_SIZE+1]; uint32_t nodesize, sectorsize, clone_alignment; -#ifndef HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE - __u32 *reserved32; -#endif +# ifndef HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE + uint32_t *reserved32; +# endif if (entering(tcp)) return 0; @@ -807,23 +699,20 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, if (umove_or_printaddr(tcp, arg, &args)) break; -#ifdef HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE +# ifdef HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE nodesize = args.nodesize, sectorsize = args.sectorsize, clone_alignment = args.clone_alignment; -#else - reserved32 = (__u32 *) (void *) args.reserved; +# else + reserved32 = (void *) args.reserved; nodesize = reserved32[0]; sectorsize = reserved32[1]; clone_alignment = reserved32[2]; -#endif - btrfs_unparse_uuid(args.fsid, uuid); - - tprints("{"); - tprintf("max_id=%" PRI__u64 ", num_devices=%" PRI__u64 - ", fsid=%s, nodesize=%u, sectorsize=%u" - ", clone_alignment=%u", - args.max_id, args.num_devices, uuid, +# endif + PRINT_FIELD_U("{", args, max_id); + PRINT_FIELD_U(", ", args, num_devices); + PRINT_FIELD_UUID(", ", args, fsid); + tprintf(", nodesize=%u, sectorsize=%u, clone_alignment=%u", nodesize, sectorsize, clone_alignment); tprints("}"); break; @@ -844,12 +733,14 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, tprints("{"); - if (entering(tcp)) - tprintf("devid=%" PRI__u64 ", ", args.devid); + if (entering(tcp)) { + PRINT_FIELD_DEV("", args, devid); + tprints(", "); + } - tprintf("nr_items=%" PRI__u64 ", flags=", args.nr_items); - printflags64(btrfs_dev_stats_flags, args.flags, - "BTRFS_DEV_STATS_???"); + PRINT_FIELD_U("", args, nr_items); + PRINT_FIELD_FLAGS(", ", args, flags, btrfs_dev_stats_flags, + "BTRFS_DEV_STATS_???"); if (entering(tcp)) { tprints("}"); @@ -869,10 +760,10 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, tprints("..."); break; } - const char *name = xlookup(btrfs_dev_stats_values, i); - if (name) - tprintf("/* %s */ ", name); - tprintf("%" PRI__u64, args.values[i]); + + tprints("["); + printxval_u(btrfs_dev_stats_values, i, NULL); + tprintf("] = %" PRI__u64, args.values[i]); } tprints("]}"); break; @@ -896,24 +787,19 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, if (args.treeid == 0) set_tcb_priv_ulong(tcp, 1); - tprints("{treeid="); - btrfs_print_objectid(args.treeid); - tprints(", objectid="); - btrfs_print_objectid(args.objectid); + btrfs_print_objectid("{", args, treeid); + btrfs_print_objectid(", ", args, objectid); tprints("}"); return 0; } tprints("{"); if (get_tcb_priv_ulong(tcp)) { - tprints("treeid="); - btrfs_print_objectid(args.treeid); + btrfs_print_objectid("", args, treeid); tprints(", "); } - tprints("name="); - print_quoted_string(args.name, sizeof(args.name), - QUOTE_0_TERMINATED); + PRINT_FIELD_CSTRING("", args, name); tprints("}"); break; } @@ -931,16 +817,15 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, if (umove_or_printaddr(tcp, arg, &args)) break; - tprints("{"); - if (entering(tcp)) { - tprintf("inum=%" PRI__u64 ", size=%" PRI__u64, - args.inum, args.size); - tprintf(", fspath=0x%" PRI__x64 "}", args.fspath); + PRINT_FIELD_U("{", args, inum); + PRINT_FIELD_U(", ", args, size); + PRINT_FIELD_ADDR64(", ", args, fspath); + tprints("}"); return 0; } - tprints("fspath="); + tprints("{fspath="); btrfs_print_ino_path_container(tcp, args.fspath); tprints("}"); @@ -960,16 +845,33 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, if (umove_or_printaddr(tcp, arg, &args)) break; - tprints("{"); - if (entering(tcp)) { - tprintf("logical=%" PRI__u64 ", size=%" PRI__u64, - args.logical, args.size); - tprintf(", inodes=0x%" PRI__x64 "}", args.inodes); + PRINT_FIELD_U("{", args, logical); + PRINT_FIELD_U(", ", args, size); + + if (!IS_ARRAY_ZERO(args.reserved)) { + tprints(", reserved=["); + for (size_t i = 0; i < 3; ++i) + tprintf("%s%#" PRI__x64, + i ? ", " : "", + args.reserved[i]); + tprints("]"); + } + + tprintf(", flags="); + printflags64(btrfs_logical_ino_args_flags, +# ifdef HAVE_STRUCT_BTRFS_IOCTL_LOGICAL_INO_ARGS_FLAGS + args.flags +# else + args.reserved[3] +# endif + , "BTRFS_LOGICAL_INO_ARGS_???"); + PRINT_FIELD_ADDR64(", ", args, inodes); + tprints("}"); return 0; } - tprints("inodes="); + tprints("{inodes="); btrfs_print_logical_ino_container(tcp, args.inodes); tprints("}"); @@ -983,9 +885,10 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, if (umove_or_printaddr(tcp, arg, &args)) break; - tprintf("{assign=%" PRI__u64 ", src=%" PRI__u64 - ", dst=%" PRI__u64 "}", - args.assign, args.src, args.dst); + PRINT_FIELD_U("{", args, assign); + PRINT_FIELD_U(", ", args, src); + PRINT_FIELD_U(", ", args, dst); + tprints("}"); break; } @@ -996,8 +899,9 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, if (umove_or_printaddr(tcp, arg, &args)) break; - tprintf("{create=%" PRI__u64 ", qgroupid=%" PRI__u64 "}", - args.create, args.qgroupid); + PRINT_FIELD_U("{", args, create); + PRINT_FIELD_U(", ", args, qgroupid); + tprints("}"); break; } @@ -1011,7 +915,7 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, if (umove_or_printaddr(tcp, arg, &args)) break; - tprintf("{qgroupid=%" PRI__u64 ", lim=", args.qgroupid); + PRINT_FIELD_U("{", args, qgroupid); btrfs_print_qgroup_limit(&args.lim); tprints("}"); break; @@ -1024,8 +928,8 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, if (umove_or_printaddr(tcp, arg, &args)) break; - printxval64(btrfs_qgroup_ctl_cmds, args.cmd, - "BTRFS_QUOTA_CTL_???"); + PRINT_FIELD_XVAL("{", args, cmd, btrfs_qgroup_ctl_cmds, + "BTRFS_QUOTA_CTL_???"); tprints("}"); break; @@ -1038,7 +942,8 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, if (umove_or_printaddr(tcp, arg, &args)) break; - tprintf("{flags=%" PRIu64 "}", (uint64_t) args.flags); + PRINT_FIELD_U("{", args, flags); + tprints("}"); break; } @@ -1052,15 +957,14 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, if (umove_or_printaddr(tcp, arg, &args)) break; - tprintf("{flags=%" PRIu64 ", progress=", (uint64_t) args.flags); - btrfs_print_objectid(args.progress); + PRINT_FIELD_U("{", args, flags); + btrfs_print_objectid(", ", args, progress); tprints("}"); break; } case BTRFS_IOC_SET_RECEIVED_SUBVOL: { /* RW */ struct_btrfs_ioctl_received_subvol_args args; - char uuid[UUID_STRING_SIZE+1]; if (entering(tcp)) tprints(", "); @@ -1073,17 +977,18 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, break; if (entering(tcp)) { - btrfs_unparse_uuid((unsigned char *)args.uuid, uuid); - tprintf("{uuid=%s, stransid=%" PRIu64 - ", stime=%" PRIu64 ".%u, flags=%" PRIu64 - "}", uuid, (uint64_t) args.stransid, - (uint64_t) args.stime.sec, args.stime.nsec, - (uint64_t) args.flags); + PRINT_FIELD_UUID("{", args, uuid); + PRINT_FIELD_U(", ", args, stransid); + print_btrfs_timespec(", stime=", + args.stime.sec, args.stime.nsec); + PRINT_FIELD_U(", ", args, flags); + tprints("}"); return 0; } - tprintf("{rtransid=%" PRIu64 ", rtime=%" PRIu64 ".%u}", - (uint64_t) args.rtransid, (uint64_t) args.rtime.sec, - args.rtime.nsec); + PRINT_FIELD_U("{", args, rtransid); + print_btrfs_timespec(", rtime=", + args.rtime.sec, args.rtime.nsec); + tprints("}"); break; } @@ -1102,50 +1007,34 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, break; if (entering(tcp)) { - tprintf("{devid=%" PRI__u64, args.devid); + PRINT_FIELD_DEV("{", args, devid); if (code == BTRFS_IOC_SCRUB) { - tprintf(", start=%" PRI__u64 ", end=", - args.start); - tprintf("%" PRI__u64, args.end); - if (args.end == UINT64_MAX) - tprints(" /* UINT64_MAX */"); - tprints(", flags="); - printflags64(btrfs_scrub_flags, args.flags, - "BTRFS_SCRUB_???"); + PRINT_FIELD_U(", ", args, start); + PRINT_FIELD_U64(", ", args, end); + PRINT_FIELD_FLAGS(", ", args, flags, + btrfs_scrub_flags, + "BTRFS_SCRUB_???"); } tprints("}"); return 0; } - tprintf("{data_extents_scrubbed=%" PRI__u64 - ", tree_extents_scrubbed=%" PRI__u64 - ", data_bytes_scrubbed=%" PRI__u64 - ", tree_bytes_scrubbed=%" PRI__u64 - ", read_errors=%" PRI__u64 - ", csum_errors=%" PRI__u64 - ", verify_errors=%" PRI__u64 - ", no_csum=%" PRI__u64 - ", csum_discards=%" PRI__u64 - ", super_errors=%" PRI__u64 - ", malloc_errors=%" PRI__u64 - ", uncorrectable_errors=%" PRI__u64 - ", corrected_errors=%" PRI__u64 - ", last_physical=%" PRI__u64 - ", unverified_errors=%" PRI__u64 "}", - args.progress.data_extents_scrubbed, - args.progress.tree_extents_scrubbed, - args.progress.data_bytes_scrubbed, - args.progress.tree_bytes_scrubbed, - args.progress.read_errors, - args.progress.csum_errors, - args.progress.verify_errors, - args.progress.no_csum, - args.progress.csum_discards, - args.progress.super_errors, - args.progress.malloc_errors, - args.progress.uncorrectable_errors, - args.progress.corrected_errors, - args.progress.last_physical, - args.progress.unverified_errors); + PRINT_FIELD_U("{progress={", args.progress, + data_extents_scrubbed); + PRINT_FIELD_U(", ", args.progress, tree_extents_scrubbed); + PRINT_FIELD_U(", ", args.progress, data_bytes_scrubbed); + PRINT_FIELD_U(", ", args.progress, tree_bytes_scrubbed); + PRINT_FIELD_U(", ", args.progress, read_errors); + PRINT_FIELD_U(", ", args.progress, csum_errors); + PRINT_FIELD_U(", ", args.progress, verify_errors); + PRINT_FIELD_U(", ", args.progress, no_csum); + PRINT_FIELD_U(", ", args.progress, csum_discards); + PRINT_FIELD_U(", ", args.progress, super_errors); + PRINT_FIELD_U(", ", args.progress, malloc_errors); + PRINT_FIELD_U(", ", args.progress, uncorrectable_errors); + PRINT_FIELD_U(", ", args.progress, corrected_errors); + PRINT_FIELD_U(", ", args.progress, last_physical); + PRINT_FIELD_U(", ", args.progress, unverified_errors); + tprints("}}"); break; } @@ -1180,11 +1069,11 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, else if (syserror(tcp)) { if (tcp->u_error == EOVERFLOW) { tprints(" => "); - tcp->u_error = 0; - if (!umove_or_printaddr(tcp, arg, &args)) - tprintf("{buf_size=%" PRIu64 "}", - (uint64_t)args.buf_size); - tcp->u_error = EOVERFLOW; + if (!umove_or_printaddr_ignore_syserror(tcp, + arg, &args)) { + PRINT_FIELD_U("{", args, buf_size); + tprints("}"); + } } break; } else @@ -1208,26 +1097,23 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, if (umove_or_printaddr(tcp, arg, &args)) break; - tprints("{send_fd="); - printfd(tcp, args.send_fd); - tprintf(", clone_sources_count=%" PRIu64 ", clone_sources=", - (uint64_t) args.clone_sources_count); + PRINT_FIELD_FD("{", args, send_fd, tcp); + PRINT_FIELD_U(", ", args, clone_sources_count); + tprints(", clone_sources="); if (abbrev(tcp)) - tprints("..."); + printaddr((uintptr_t) args.clone_sources); else { uint64_t record; print_array(tcp, ptr_to_kulong(args.clone_sources), args.clone_sources_count, &record, sizeof(record), - umoven_or_printaddr, + tfetch_mem, print_objectid_callback, 0); } - tprints(", parent_root="); - btrfs_print_objectid(args.parent_root); - tprints(", flags="); - printflags64(btrfs_send_flags, args.flags, - "BTRFS_SEND_FLAGS_???"); + btrfs_print_objectid(", ", args, parent_root); + PRINT_FIELD_FLAGS(", ", args, flags, btrfs_send_flags, + "BTRFS_SEND_FLAGS_???"); tprints("}"); break; } @@ -1245,28 +1131,27 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, if (umove_or_printaddr(tcp, arg, &args)) break; - tprints("{"); if (entering(tcp)) { - tprintf("space_slots=%" PRI__u64 "}", args.space_slots); + PRINT_FIELD_U("{", args, space_slots); + tprints("}"); return 0; } - tprintf("total_spaces=%" PRI__u64, args.total_spaces); + PRINT_FIELD_U("{", args, total_spaces); if (args.space_slots == 0 && args.total_spaces) { tprints("}"); break; } - tprints(", spaces="); - - if (abbrev(tcp)) - tprints("..."); - else { + if (abbrev(tcp)) { + tprints(", ..."); + } else { struct btrfs_ioctl_space_info info; + tprints(", spaces="); print_array(tcp, arg + offsetof(typeof(args), spaces), args.total_spaces, - &info, sizeof(info), umoven_or_printaddr, + &info, sizeof(info), tfetch_mem, print_btrfs_ioctl_space_info, 0); } tprints("}"); @@ -1276,6 +1161,9 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, case BTRFS_IOC_SNAP_CREATE: case BTRFS_IOC_RESIZE: case BTRFS_IOC_SCAN_DEV: +# ifdef BTRFS_IOC_FORGET_DEV + case BTRFS_IOC_FORGET_DEV: +# endif case BTRFS_IOC_ADD_DEV: case BTRFS_IOC_RM_DEV: case BTRFS_IOC_SUBVOL_CREATE: @@ -1287,11 +1175,8 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, if (umove_or_printaddr(tcp, arg, &args)) break; - tprints("{fd="); - printfd(tcp, args.fd); - tprints(", name="); - print_quoted_string(args.name, sizeof(args.name), - QUOTE_0_TERMINATED); + PRINT_FIELD_FD("{", args, fd, tcp); + PRINT_FIELD_CSTRING(", ", args, name); tprints("}"); break; } @@ -1311,47 +1196,44 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, break; if (entering(tcp)) { - tprints("{fd="); - printfd(tcp, args.fd); - tprints(", flags="); - printflags64(btrfs_snap_flags_v2, args.flags, - "BTRFS_SUBVOL_???"); + PRINT_FIELD_FD("{", args, fd, tcp); + PRINT_FIELD_FLAGS(", ", args, flags, + btrfs_snap_flags_v2, + "BTRFS_SUBVOL_???"); if (args.flags & BTRFS_SUBVOL_QGROUP_INHERIT) { - tprintf(", size=%" PRIu64 ", qgroup_inherit=", - (uint64_t) args.size); - + PRINT_FIELD_U(", ", args, size); + tprints(", qgroup_inherit="); btrfs_print_qgroup_inherit(tcp, ptr_to_kulong(args.qgroup_inherit)); } - tprints(", name="); - print_quoted_string(args.name, sizeof(args.name), - QUOTE_0_TERMINATED); + PRINT_FIELD_CSTRING(", ", args, name); tprints("}"); return 0; } - tprintf("{transid=%" PRIu64 "}", (uint64_t) args.transid); + PRINT_FIELD_U("{", args, transid); + tprints("}"); break; } case BTRFS_IOC_GET_FSLABEL: /* R */ if (entering(tcp)) return 0; - /* fall through */ + ATTRIBUTE_FALLTHROUGH; case BTRFS_IOC_SET_FSLABEL: { /* W */ char label[BTRFS_LABEL_SIZE]; tprints(", "); if (umove_or_printaddr(tcp, arg, &label)) break; - print_quoted_string(label, sizeof(label), QUOTE_0_TERMINATED); + print_quoted_cstring(label, sizeof(label)); break; } case BTRFS_IOC_CLONE: /* FICLONE */ case BTRFS_IOC_CLONE_RANGE: /* FICLONERANGE */ -#ifdef BTRFS_IOC_FILE_EXTENT_SAME +# ifdef BTRFS_IOC_FILE_EXTENT_SAME case BTRFS_IOC_FILE_EXTENT_SAME: /* FIDEDUPERANGE */ -#endif +# endif /* * FICLONE, FICLONERANGE, and FIDEDUPERANGE started out as * btrfs ioctls and the code was kept for the generic @@ -1363,6 +1245,6 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl, default: return RVAL_DECODED; }; - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } #endif /* HAVE_LINUX_BTRFS_H */ diff --git a/cacheflush.c b/cacheflush.c index 8c2c05c3..ac53745e 100644 --- a/cacheflush.c +++ b/cacheflush.c @@ -4,29 +4,10 @@ * Copyright (c) 2010 Carmelo Amoroso * Copyright (c) 2015 Ezequiel Garcia * Copyright (c) 2014-2015 Dmitry V. Levin + * Copyright (c) 2014-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -39,15 +20,15 @@ # include "xlat/cacheflush_scope.h" static const struct xlat cacheflush_flags[] = { -#ifdef FLUSH_CACHE_BOTH +# ifdef FLUSH_CACHE_BOTH XLAT(FLUSH_CACHE_BOTH), -#endif -#ifdef FLUSH_CACHE_DATA +# endif +# ifdef FLUSH_CACHE_DATA XLAT(FLUSH_CACHE_DATA), -#endif -#ifdef FLUSH_CACHE_INSN +# endif +# ifdef FLUSH_CACHE_INSN XLAT(FLUSH_CACHE_INSN), -#endif +# endif XLAT_END }; @@ -68,7 +49,7 @@ SYS_FUNC(cacheflush) } #endif /* M68K */ -#ifdef BFIN +#if defined(BFIN) || defined(CSKY) static const struct xlat cacheflush_flags[] = { XLAT(ICACHE), XLAT(DCACHE), @@ -87,22 +68,22 @@ SYS_FUNC(cacheflush) return RVAL_DECODED; } -#endif /* BFIN */ +#endif /* BFIN || CSKY */ #ifdef SH static const struct xlat cacheflush_flags[] = { -#ifdef CACHEFLUSH_D_INVAL +# ifdef CACHEFLUSH_D_INVAL XLAT(CACHEFLUSH_D_INVAL), -#endif -#ifdef CACHEFLUSH_D_WB +# endif +# ifdef CACHEFLUSH_D_WB XLAT(CACHEFLUSH_D_WB), -#endif -#ifdef CACHEFLUSH_D_PURGE +# endif +# ifdef CACHEFLUSH_D_PURGE XLAT(CACHEFLUSH_D_PURGE), -#endif -#ifdef CACHEFLUSH_I +# endif +# ifdef CACHEFLUSH_I XLAT(CACHEFLUSH_I), -#endif +# endif XLAT_END }; diff --git a/capability.c b/capability.c index a3f06ea3..0e763ee1 100644 --- a/capability.c +++ b/capability.c @@ -2,29 +2,10 @@ * Copyright (c) 2000 Wichert Akkerman * Copyright (c) 2011 Denys Vlasenko * Copyright (c) 2005-2015 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/caps0.h b/caps0.h index ad206ffa..4398236a 100644 --- a/caps0.h +++ b/caps0.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + CAP_CHOWN, CAP_DAC_OVERRIDE, CAP_DAC_READ_SEARCH, diff --git a/caps1.h b/caps1.h index d8fa6f47..7c36160e 100644 --- a/caps1.h +++ b/caps1.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + CAP_MAC_OVERRIDE, CAP_MAC_ADMIN, CAP_SYSLOG, diff --git a/chdir.c b/chdir.c index e8ac2858..b07d164e 100644 --- a/chdir.c +++ b/chdir.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" SYS_FUNC(chdir) diff --git a/chmod.c b/chmod.c index fd76490c..7668e746 100644 --- a/chmod.c +++ b/chmod.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" static void diff --git a/clone.c b/clone.c index 5c60fbe4..406838c4 100644 --- a/clone.c +++ b/clone.c @@ -4,29 +4,10 @@ * Copyright (c) 2008 Jan Kratochvil * Copyright (c) 2009-2013 Denys Vlasenko * Copyright (c) 2006-2015 Dmitry V. Levin + * Copyright (c) 2014-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -48,7 +29,7 @@ # define ARG_PTID (tcp->scno == __NR_clone2 ? 3 : 2) # define ARG_CTID (tcp->scno == __NR_clone2 ? 4 : 3) # define ARG_TLS (tcp->scno == __NR_clone2 ? 5 : 4) -#elif defined S390 || defined S390X || defined CRISV10 || defined CRISV32 +#elif defined S390 || defined S390X # define ARG_STACK 0 # define ARG_FLAGS 1 # define ARG_PTID 2 @@ -61,7 +42,7 @@ # define ARG_PTID 2 # define ARG_CTID ((current_personality != 1) ? 3 : 4) # define ARG_TLS ((current_personality != 1) ? 4 : 3) -#elif defined ALPHA || defined TILE || defined OR1K || defined RISCV +#elif defined ALPHA || defined TILE || defined OR1K || defined CSKY # define ARG_FLAGS 0 # define ARG_STACK 1 # define ARG_PTID 2 @@ -83,7 +64,7 @@ print_tls_arg(struct tcb *const tcp, const kernel_ulong_t addr) if (current_personality == 1) # endif { - print_user_desc(tcp, tcp->u_arg[ARG_TLS]); + print_user_desc(tcp, tcp->u_arg[ARG_TLS], USER_DESC_BOTH); } # if SUPPORTED_PERSONALITIES > 1 else @@ -108,10 +89,12 @@ SYS_FUNC(clone) tcp->u_arg[ARG_STACKSIZE]); #endif tprints("flags="); - if (!printflags64(clone_flags, flags &~ CSIGNAL, NULL)) + if (!printflags64(clone_flags, flags & ~CSIGNAL, NULL)) sep = ""; - if ((flags & CSIGNAL) != 0) - tprintf("%s%s", sep, signame(flags & CSIGNAL)); + if ((flags & CSIGNAL) != 0) { + tprints(sep); + printsignal(flags & CSIGNAL); + } if ((flags & (CLONE_PARENT_SETTID|CLONE_CHILD_SETTID |CLONE_CHILD_CLEARTID|CLONE_SETTLS)) == 0) return 0; @@ -160,5 +143,5 @@ SYS_FUNC(unshare) SYS_FUNC(fork) { - return RVAL_DECODED | RVAL_UDECIMAL; + return RVAL_DECODED; } diff --git a/compile b/compile index 531136b0..99e50524 100755 --- a/compile +++ b/compile @@ -1,9 +1,9 @@ #! /bin/sh # Wrapper for compilers which do not understand '-c -o'. -scriptversion=2012-10-14.11; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ scriptversion=2012-10-14.11; # UTC # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -255,7 +255,8 @@ EOF echo "compile $scriptversion" exit $? ;; - cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe | \ + icl | *[/\\]icl | icl.exe | *[/\\]icl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac @@ -339,9 +340,9 @@ exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/config.guess b/config.guess index 3c022c5b..28bec27b 100755 --- a/config.guess +++ b/config.guess @@ -1,8 +1,8 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2015 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2015-09-14' +timestamp='2018-12-07' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ timestamp='2015-09-14' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -27,7 +27,7 @@ timestamp='2015-09-14' # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess # # Please send patches to . @@ -39,7 +39,7 @@ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -50,7 +50,7 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -84,8 +84,6 @@ if test $# != 0; then exit 1 fi -trap 'exit 1' 1 2 15 - # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a @@ -96,34 +94,38 @@ trap 'exit 1' 1 2 15 # Portable tmp directory creation inspired by the Autoconf team. -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD="$driver" + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then +if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi @@ -132,14 +134,14 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "${UNAME_SYSTEM}" in +case "$UNAME_SYSTEM" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu - eval $set_cc_for_build - cat <<-EOF > $dummy.c + set_cc_for_build + cat <<-EOF > "$dummy.c" #include #if defined(__UCLIBC__) LIBC=uclibc @@ -149,13 +151,20 @@ Linux|GNU|GNU/*) LIBC=gnu #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`" + + # If ldd exists, use it to detect musl libc. + if command -v ldd >/dev/null && \ + ldd --version 2>&1 | grep -q ^musl + then + LIBC=musl + fi ;; esac # Note: order is significant - the case branches are not exclusive. -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -169,27 +178,30 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - /sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || \ + "/sbin/$sysctl" 2>/dev/null || \ + "/usr/sbin/$sysctl" 2>/dev/null || \ echo unknown)` - case "${UNAME_MACHINE_ARCH}" in + case "$UNAME_MACHINE_ARCH" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) - arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'` - endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` - machine=${arch}${endian}-unknown + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` + machine="${arch}${endian}"-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + *) machine="$UNAME_MACHINE_ARCH"-unknown ;; esac # The Operating System including object format, if it has switched - # to ELF recently, or will in the future. - case "${UNAME_MACHINE_ARCH}" in - arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build + # to ELF recently (or will in the future) and ABI. + case "$UNAME_MACHINE_ARCH" in + earm*) + os=netbsdelf + ;; + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -205,10 +217,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ;; esac # Determine ABI tags. - case "${UNAME_MACHINE_ARCH}" in + case "$UNAME_MACHINE_ARCH" in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' - abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release @@ -216,42 +228,55 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in + case "$UNAME_VERSION" in Debian*) release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2` + release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}${abi}" + echo "$machine-${os}${release}${abi-}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-bitrig"$UNAME_RELEASE" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE_ARCH"-unknown-openbsd"$UNAME_RELEASE" + exit ;; + *:LibertyBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` + echo "$UNAME_MACHINE_ARCH"-unknown-libertybsd"$UNAME_RELEASE" + exit ;; + *:MidnightBSD:*:*) + echo "$UNAME_MACHINE"-unknown-midnightbsd"$UNAME_RELEASE" exit ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-ekkobsd"$UNAME_RELEASE" exit ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-solidbsd"$UNAME_RELEASE" exit ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} + echo powerpc-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-mirbsd"$UNAME_RELEASE" exit ;; *:Sortix:*:*) - echo ${UNAME_MACHINE}-unknown-sortix + echo "$UNAME_MACHINE"-unknown-sortix + exit ;; + *:Redox:*:*) + echo "$UNAME_MACHINE"-unknown-redox exit ;; + mips:OSF1:*.*) + echo mips-dec-osf1 + exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) @@ -268,63 +293,54 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV4.5 (21064)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") - UNAME_MACHINE="alpha" ;; + UNAME_MACHINE=alpha ;; "EV5 (21164)") - UNAME_MACHINE="alphaev5" ;; + UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") - UNAME_MACHINE="alphaev56" ;; + UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") - UNAME_MACHINE="alphapca56" ;; + UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") - UNAME_MACHINE="alphapca57" ;; + UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") - UNAME_MACHINE="alphaev6" ;; + UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") - UNAME_MACHINE="alphaev67" ;; + UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") - UNAME_MACHINE="alphaev68" ;; + UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") - UNAME_MACHINE="alphaev69" ;; + UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") - UNAME_MACHINE="alphaev7" ;; + UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") - UNAME_MACHINE="alphaev79" ;; + UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + echo "$UNAME_MACHINE"-dec-osf"`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`" # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos + echo "$UNAME_MACHINE"-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) - echo ${UNAME_MACHINE}-unknown-morphos + echo "$UNAME_MACHINE"-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition @@ -336,7 +352,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) - echo arm-acorn-riscix${UNAME_RELEASE} + echo arm-acorn-riscix"$UNAME_RELEASE" exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos @@ -363,38 +379,38 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$UNAME_MACHINE"-ibm-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-hal-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris2"`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`" exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} + echo i386-pc-auroraux"$UNAME_RELEASE" exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build - SUN_ARCH="i386" + set_cc_for_build + SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then - SUN_ARCH="x86_64" + SUN_ARCH=x86_64 fi fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo "$SUN_ARCH"-pc-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo sparc-sun-solaris3"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in @@ -403,25 +419,25 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + echo sparc-sun-sunos"`echo "$UNAME_RELEASE"|sed -e 's/-/_/'`" exit ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) - echo m68k-sun-sunos${UNAME_RELEASE} + echo m68k-sun-sunos"$UNAME_RELEASE" ;; sun4) - echo sparc-sun-sunos${UNAME_RELEASE} + echo sparc-sun-sunos"$UNAME_RELEASE" ;; esac exit ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} + echo sparc-auspex-sunos"$UNAME_RELEASE" exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not @@ -432,44 +448,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint"$UNAME_RELEASE" exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} + echo m68k-milan-mint"$UNAME_RELEASE" exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} + echo m68k-hades-mint"$UNAME_RELEASE" exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} + echo m68k-unknown-mint"$UNAME_RELEASE" exit ;; m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} + echo m68k-apple-machten"$UNAME_RELEASE" exit ;; powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} + echo powerpc-apple-machten"$UNAME_RELEASE" exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} + echo mips-dec-ultrix"$UNAME_RELEASE" exit ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} + echo vax-dec-ultrix"$UNAME_RELEASE" exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} + echo clipper-intergraph-clix"$UNAME_RELEASE" exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { @@ -478,23 +494,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} + echo mips-mips-riscos"$UNAME_RELEASE" exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax @@ -520,17 +536,17 @@ EOF AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + if [ "$UNAME_PROCESSOR" = mc88100 ] || [ "$UNAME_PROCESSOR" = mc88110 ] then - if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ - [ ${TARGET_BINARY_INTERFACE}x = x ] + if [ "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx ] || \ + [ "$TARGET_BINARY_INTERFACE"x = x ] then - echo m88k-dg-dgux${UNAME_RELEASE} + echo m88k-dg-dgux"$UNAME_RELEASE" else - echo m88k-dg-dguxbcs${UNAME_RELEASE} + echo m88k-dg-dguxbcs"$UNAME_RELEASE" fi else - echo i586-dg-dgux${UNAME_RELEASE} + echo i586-dg-dgux"$UNAME_RELEASE" fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) @@ -547,7 +563,7 @@ EOF echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + echo mips-sgi-irix"`echo "$UNAME_RELEASE"|sed -e 's/-/_/g'`" exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id @@ -559,14 +575,14 @@ EOF if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + echo "$UNAME_MACHINE"-ibm-aix"$IBM_REV" exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include main() @@ -577,7 +593,7 @@ EOF exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then echo "$SYSTEM_NAME" else @@ -591,7 +607,7 @@ EOF exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc @@ -600,18 +616,18 @@ EOF IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV="$UNAME_VERSION.$UNAME_RELEASE" fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} + echo "$IBM_ARCH"-ibm-aix"$IBM_REV" exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + echo romp-ibm-bsd"$UNAME_RELEASE" # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx @@ -626,28 +642,28 @@ EOF echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/[34]?? ) HP_ARCH=m68k ;; + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + case "$UNAME_MACHINE" in + 9000/31?) HP_ARCH=m68000 ;; + 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in - 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 - 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + case "$sc_cpu_version" in + 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 + 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in - 32) HP_ARCH="hppa2.0n" ;; - 64) HP_ARCH="hppa2.0w" ;; - '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + case "$sc_kernel_bits" in + 32) HP_ARCH=hppa2.0n ;; + 64) HP_ARCH=hppa2.0w ;; + '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if [ "${HP_ARCH}" = "" ]; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + if [ "$HP_ARCH" = "" ]; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include @@ -680,13 +696,13 @@ EOF exit (0); } EOF - (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if [ ${HP_ARCH} = "hppa2.0w" ] + if [ "$HP_ARCH" = hppa2.0w ] then - eval $set_cc_for_build + set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -697,23 +713,23 @@ EOF # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 - if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then - HP_ARCH="hppa2.0w" + HP_ARCH=hppa2.0w else - HP_ARCH="hppa64" + HP_ARCH=hppa64 fi fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} + echo "$HP_ARCH"-hp-hpux"$HPUX_REV" exit ;; ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo ia64-hp-hpux${HPUX_REV} + HPUX_REV=`echo "$UNAME_RELEASE"|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux"$HPUX_REV" exit ;; 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include int main () @@ -738,11 +754,11 @@ EOF exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) @@ -751,7 +767,7 @@ EOF *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; - hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) @@ -759,9 +775,9 @@ EOF exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then - echo ${UNAME_MACHINE}-unknown-osf1mk + echo "$UNAME_MACHINE"-unknown-osf1mk else - echo ${UNAME_MACHINE}-unknown-osf1 + echo "$UNAME_MACHINE"-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) @@ -786,127 +802,120 @@ EOF echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo ymp-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo t90-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo alphaev5-cray-unicosmk"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo sv1-cray-unicos"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + echo craynv-cray-unicosmp"$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) - FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-pc-bsdi"$UNAME_RELEASE" exit ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} + echo sparc-unknown-bsdi"$UNAME_RELEASE" exit ;; *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + echo "$UNAME_MACHINE"-unknown-bsdi"$UNAME_RELEASE" + exit ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabi + else + echo "${UNAME_PROCESSOR}"-unknown-freebsd"`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`"-gnueabihf + fi exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + case "$UNAME_PROCESSOR" in amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac + echo "$UNAME_PROCESSOR"-unknown-freebsd"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin + echo "$UNAME_MACHINE"-pc-cygwin exit ;; *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 + echo "$UNAME_MACHINE"-pc-mingw64 exit ;; *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 + echo "$UNAME_MACHINE"-pc-mingw32 exit ;; *:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + echo "$UNAME_MACHINE"-pc-msys exit ;; i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 + echo "$UNAME_MACHINE"-pc-pw32 exit ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case "$UNAME_MACHINE" in x86) - echo i586-pc-interix${UNAME_RELEASE} + echo i586-pc-interix"$UNAME_RELEASE" exit ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} + echo x86_64-unknown-interix"$UNAME_RELEASE" exit ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} + echo ia64-unknown-interix"$UNAME_RELEASE" exit ;; esac ;; - [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin + echo "$UNAME_MACHINE"-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin + echo x86_64-pc-cygwin exit ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + echo powerpcle-unknown-solaris2"`echo "$UNAME_RELEASE"|sed -e 's/[^.]*//'`" exit ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + echo "`echo "$UNAME_MACHINE"|sed -e 's,[-/].*$,,'`-unknown-$LIBC`echo "$UNAME_RELEASE"|sed -e 's,/.*$,,'`" exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} + echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC" exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix + *:Minix:*:*) + echo "$UNAME_MACHINE"-unknown-minix exit ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in @@ -919,64 +928,64 @@ EOF EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="gnulibc1" ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + if test "$?" = 0 ; then LIBC=gnulibc1 ; fi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; arm*:Linux:*:*) - eval $set_cc_for_build + set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabi else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"eabihf fi fi exit ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} + echo "$UNAME_MACHINE"-axis-linux-"$LIBC" exit ;; e2k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; k1om:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el @@ -990,64 +999,70 @@ EOF #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + eval "`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU'`" + test "x$CPU" != x && { echo "$CPU-unknown-linux-$LIBC"; exit; } ;; + mips64el:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" + exit ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-${LIBC} + echo or1k-unknown-linux-"$LIBC" exit ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} + echo sparc-unknown-linux-"$LIBC" exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} + echo hppa64-unknown-linux-"$LIBC" exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; + PA7*) echo hppa1.1-unknown-linux-"$LIBC" ;; + PA8*) echo hppa2.0-unknown-linux-"$LIBC" ;; + *) echo hppa-unknown-linux-"$LIBC" ;; esac exit ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} + echo powerpc64-unknown-linux-"$LIBC" exit ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} + echo powerpc-unknown-linux-"$LIBC" exit ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} + echo powerpc64le-unknown-linux-"$LIBC" exit ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} + echo powerpcle-unknown-linux-"$LIBC" + exit ;; + riscv32:Linux:*:* | riscv64:Linux:*:*) + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} + echo "$UNAME_MACHINE"-ibm-linux-"$LIBC" exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} + echo "$UNAME_MACHINE"-dec-linux-"$LIBC" exit ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} + echo "$UNAME_MACHINE"-pc-linux-"$LIBC" exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + echo "$UNAME_MACHINE"-unknown-linux-"$LIBC" exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. @@ -1061,34 +1076,34 @@ EOF # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + echo "$UNAME_MACHINE"-pc-sysv4.2uw"$UNAME_VERSION" exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx + echo "$UNAME_MACHINE"-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop + echo "$UNAME_MACHINE"-unknown-stop exit ;; i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos + echo "$UNAME_MACHINE"-unknown-atheos exit ;; i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable + echo "$UNAME_MACHINE"-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} + echo i386-unknown-lynxos"$UNAME_RELEASE" exit ;; i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp + echo "$UNAME_MACHINE"-pc-msdosdjgpp exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-univel-sysv"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + echo "$UNAME_MACHINE"-pc-sysv"$UNAME_REL" fi exit ;; i*86:*:5:[678]*) @@ -1098,12 +1113,12 @@ EOF *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + echo "$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}{$UNAME_VERSION}" exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1113,9 +1128,9 @@ EOF && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + echo "$UNAME_MACHINE"-pc-sco"$UNAME_REL" else - echo ${UNAME_MACHINE}-pc-sysv32 + echo "$UNAME_MACHINE"-pc-sysv32 fi exit ;; pc:*:*:*) @@ -1123,7 +1138,7 @@ EOF # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub - # prints for the "djgpp" host, or else GDB configury will decide that + # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; @@ -1135,9 +1150,9 @@ EOF exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + echo i860-stardent-sysv"$UNAME_RELEASE" # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + echo i860-unknown-sysv"$UNAME_RELEASE" # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) @@ -1157,9 +1172,9 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; @@ -1168,28 +1183,28 @@ EOF test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} + echo m68k-unknown-lynxos"$UNAME_RELEASE" exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} + echo sparc-unknown-lynxos"$UNAME_RELEASE" exit ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} + echo rs6000-unknown-lynxos"$UNAME_RELEASE" exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} + echo powerpc-unknown-lynxos"$UNAME_RELEASE" exit ;; SM[BE]S:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} + echo mips-dde-sysv"$UNAME_RELEASE" exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 @@ -1200,7 +1215,7 @@ EOF *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 + echo "$UNAME_MACHINE"-sni-sysv4 else echo ns32k-sni-sysv fi @@ -1220,23 +1235,23 @@ EOF exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos + echo "$UNAME_MACHINE"-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} + echo m68k-apple-aux"$UNAME_RELEASE" exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then - echo mips-nec-sysv${UNAME_RELEASE} + echo mips-nec-sysv"$UNAME_RELEASE" else - echo mips-unknown-sysv${UNAME_RELEASE} + echo mips-unknown-sysv"$UNAME_RELEASE" fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. @@ -1255,46 +1270,56 @@ EOF echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} + echo sx4-nec-superux"$UNAME_RELEASE" exit ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} + echo sx5-nec-superux"$UNAME_RELEASE" exit ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} + echo sx6-nec-superux"$UNAME_RELEASE" exit ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} + echo sx7-nec-superux"$UNAME_RELEASE" exit ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} + echo sx8-nec-superux"$UNAME_RELEASE" exit ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} + echo sx8r-nec-superux"$UNAME_RELEASE" + exit ;; + SX-ACE:SUPER-UX:*:*) + echo sxace-nec-superux"$UNAME_RELEASE" exit ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} + echo powerpc-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + echo "$UNAME_MACHINE"-apple-rhapsody"$UNAME_RELEASE" exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build + set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi - if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if test "`echo "$UNAME_RELEASE" | sed -e 's/\..*//'`" -le 10 ; then + if [ "$CC_FOR_BUILD" != no_compiler_found ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc + fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub @@ -1305,27 +1330,33 @@ EOF # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + echo "$UNAME_PROCESSOR"-apple-darwin"$UNAME_RELEASE" exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` - if test "$UNAME_PROCESSOR" = "x86"; then + if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + echo "$UNAME_PROCESSOR"-"$UNAME_MACHINE"-nto-qnx"$UNAME_RELEASE" exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} + NEO-*:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk"$UNAME_RELEASE" exit ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} + echo nse-tandem-nsk"$UNAME_RELEASE" exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} + NSR-*:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSV-*:NONSTOP_KERNEL:*:*) + echo nsv-tandem-nsk"$UNAME_RELEASE" + exit ;; + NSX-*:NONSTOP_KERNEL:*:*) + echo nsx-tandem-nsk"$UNAME_RELEASE" exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux @@ -1334,18 +1365,19 @@ EOF echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + echo "$UNAME_MACHINE"-"$UNAME_SYSTEM"-"$UNAME_RELEASE" exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = "386"; then + # shellcheck disable=SC2154 + if test "$cputype" = 386; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi - echo ${UNAME_MACHINE}-unknown-plan9 + echo "$UNAME_MACHINE"-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 @@ -1366,14 +1398,14 @@ EOF echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux"$UNAME_RELEASE" exit ;; *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + echo "$UNAME_MACHINE"-unknown-dragonfly"`echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`" exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in + case "$UNAME_MACHINE" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; @@ -1382,34 +1414,51 @@ EOF echo i386-pc-xenix exit ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + echo "$UNAME_MACHINE"-pc-skyos"`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`" exit ;; i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos + echo "$UNAME_MACHINE"-pc-rdos exit ;; i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros + echo "$UNAME_MACHINE"-pc-aros exit ;; x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx + echo "$UNAME_MACHINE"-unknown-esx + exit ;; + amd64:Isilon\ OneFS:*:*) + echo x86_64-unknown-onefs exit ;; + *:Unleashed:*:*) + echo "$UNAME_MACHINE"-unknown-unleashed"$UNAME_RELEASE" + exit ;; +esac + +echo "$0: unable to guess system type" >&2 + +case "$UNAME_MACHINE:$UNAME_SYSTEM" in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <&2 < in order to provide the needed -information to handle your system. +If $0 has already been updated, send the following data and any +information you think might be pertinent to config-patches@gnu.org to +provide the necessary information to handle your system. config.guess timestamp = $timestamp @@ -1428,16 +1477,16 @@ hostinfo = `(hostinfo) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" EOF exit 1 # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/config.h.in b/config.h.in index 8b335f8b..10fc4831 100644 --- a/config.h.in +++ b/config.h.in @@ -27,29 +27,35 @@ /* Define for the Blackfin architecture. */ #undef BFIN -/* Define for the CRISv10 architecture. */ -#undef CRISV10 +/* Current copyright year. */ +#undef COPYRIGHT_YEAR -/* Define for the CRISv32 architecture. */ -#undef CRISV32 +/* Define for the C-SKY architecture */ +#undef CSKY /* Define to 1 if you want OABI support on ARM EABI. */ #undef ENABLE_ARM_OABI +/* Define to enable stack tracing support */ +#undef ENABLE_STACKTRACE + /* Define to 1 if you have the `accept4' function. */ #undef HAVE_ACCEPT4 /* Define to 1 if you have the header file. */ #undef HAVE_ASM_CACHECTL_H +/* Define to 1 if you have the header file. */ +#undef HAVE_ASM_GUARDED_STORAGE_H + /* Define to 1 if you have the header file. */ #undef HAVE_ASM_SIGCONTEXT_H /* Define to 1 if you have the header file. */ #undef HAVE_ASM_SYSMIPS_H -/* Define to 1 if you have BLKGETSIZE64. */ -#undef HAVE_BLKGETSIZE64 +/* Define to 1 if you have the `be64toh' function. */ +#undef HAVE_BE64TOH /* Define to 1 if you have the header file. */ #undef HAVE_BLUETOOTH_BLUETOOTH_H @@ -90,6 +96,22 @@ don't. */ #undef HAVE_DECL_CTL_SUNRPC +/* Define to 1 if you have the declaration of `IFLA_AF_SPEC', and to 0 if you + don't. */ +#undef HAVE_DECL_IFLA_AF_SPEC + +/* Define to 1 if you have the declaration of `IFLA_PORT_SELF', and to 0 if + you don't. */ +#undef HAVE_DECL_IFLA_PORT_SELF + +/* Define to 1 if you have the declaration of `IFLA_PROTINFO', and to 0 if you + don't. */ +#undef HAVE_DECL_IFLA_PROTINFO + +/* Define to 1 if you have the declaration of `IFLA_XDP', and to 0 if you + don't. */ +#undef HAVE_DECL_IFLA_XDP + /* Define to 1 if you have the declaration of `KERN_ACPI_VIDEO_FLAGS', and to 0 if you don't. */ #undef HAVE_DECL_KERN_ACPI_VIDEO_FLAGS @@ -126,6 +148,14 @@ you don't. */ #undef HAVE_DECL_KERN_PANIC_ON_NMI +/* Define to 1 if you have the declaration of `KERN_PANIC_ON_WARN', and to 0 + if you don't. */ +#undef HAVE_DECL_KERN_PANIC_ON_WARN + +/* Define to 1 if you have the declaration of `KERN_PANIC_PRINT', and to 0 if + you don't. */ +#undef HAVE_DECL_KERN_PANIC_PRINT + /* Define to 1 if you have the declaration of `KERN_PRINTK_RATELIMIT', and to 0 if you don't. */ #undef HAVE_DECL_KERN_PRINTK_RATELIMIT @@ -390,6 +420,18 @@ don't. */ #undef HAVE_DECL_SYS_ERRLIST +/* Define to 1 if you have the declaration of `TCA_STAB_DATA', and to 0 if you + don't. */ +#undef HAVE_DECL_TCA_STAB_DATA + +/* Define to 1 if you have the declaration of `V4L2_BUF_TYPE_SDR_CAPTURE', and + to 0 if you don't. */ +#undef HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE + +/* Define to 1 if you have the declaration of `V4L2_BUF_TYPE_SDR_OUTPUT', and + to 0 if you don't. */ +#undef HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT + /* Define to 1 if you have the declaration of `V4L2_BUF_TYPE_SLICED_VBI_CAPTURE', and to 0 if you don't. */ #undef HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE @@ -634,9 +676,15 @@ 0 if you don't. */ #undef HAVE_DECL_VM_VFS_CACHE_PRESSURE +/* Define to 1 if you have the header file. */ +#undef HAVE_DEMANGLE_H + /* Define to 1 if the system provides dladdr */ #undef HAVE_DLADDR +/* Define to 1 if you have the header file. */ +#undef HAVE_ELFUTILS_LIBDWFL_H + /* Define to 1 if you have the header file. */ #undef HAVE_ELF_H @@ -673,12 +721,21 @@ /* Define to 1 if you have the header file. */ #undef HAVE_GNU_STUBS_X32_H +/* Define to 1 if you have the header file. */ +#undef HAVE_ICONV_H + +/* Define to 1 if you have the `iconv_open' function. */ +#undef HAVE_ICONV_OPEN + /* Define to 1 if you have the `if_indextoname' function. */ #undef HAVE_IF_INDEXTONAME /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBIBERTY_DEMANGLE_H + /* Define to 1 if you have the header file. */ #undef HAVE_LIBUNWIND_PTRACE_H @@ -691,6 +748,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_BTRFS_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_CRYPTOUSER_H + /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_DM_IOCTL_H @@ -700,24 +760,42 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_FALLOC_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_FIB_RULES_H + /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_FIEMAP_H -/* Define to 1 if you have the header file. */ -#undef HAVE_LINUX_FILTER_H - /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_HIDDEV_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_IF_ADDR_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_IF_LINK_H + /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_INPUT_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_IO_URING_H + /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_IPC_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_IP_VS_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_KCMP_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_KVM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_MEMFD_H + /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_MMTIMER_H @@ -727,6 +805,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_MSG_H +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_NEIGHBOUR_H + /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_NETFILTER_ARP_ARP_TABLES_H @@ -735,6 +816,10 @@ file. */ #undef HAVE_LINUX_NETFILTER_BRIDGE_EBTABLES_H +/* Define to 1 if you have the header file. + */ +#undef HAVE_LINUX_NETFILTER_IPSET_IP_SET_H + /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_NETFILTER_IPV4_IP_TABLES_H @@ -743,6 +828,46 @@ file. */ #undef HAVE_LINUX_NETFILTER_IPV6_IP6_TABLES_H +/* Define to 1 if you have the header file. + */ +#undef HAVE_LINUX_NETFILTER_NFNETLINK_ACCT_H + +/* Define to 1 if you have the header + file. */ +#undef HAVE_LINUX_NETFILTER_NFNETLINK_CONNTRACK_H + +/* Define to 1 if you have the header + file. */ +#undef HAVE_LINUX_NETFILTER_NFNETLINK_CTHELPER_H + +/* Define to 1 if you have the header + file. */ +#undef HAVE_LINUX_NETFILTER_NFNETLINK_CTTIMEOUT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_NETFILTER_NFNETLINK_H + +/* Define to 1 if you have the header file. + */ +#undef HAVE_LINUX_NETFILTER_NFNETLINK_LOG_H + +/* Define to 1 if you have the header + file. */ +#undef HAVE_LINUX_NETFILTER_NFNETLINK_QUEUE_H + +/* Define to 1 if you have the header + file. */ +#undef HAVE_LINUX_NETFILTER_NF_TABLES_COMPAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_NETFILTER_NF_TABLES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_NETFILTER_XT_OSF_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_NSFS_H + /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_PERF_EVENT_H @@ -767,20 +892,19 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_UTSNAME_H -/* Define to 1 if you have CFLAG mpers support */ +/* Define to 1 if you have mpers_name mpers support */ #undef HAVE_M32_MPERS -/* Define to 1 if MPERS_NAME has the type 'struct stat'. */ +/* Define to 1 if m32 has the type 'struct stat'. */ #undef HAVE_M32_STRUCT_STAT -/* Define to 1 if MPERS_NAME has the type 'struct stat64'. */ +/* Define to 1 if m32 has the type 'struct stat64'. */ #undef HAVE_M32_STRUCT_STAT64 -/* Define to 1 if 'st_mtime_nsec' is a member of MPERS_NAME 'struct stat64'. - */ +/* Define to 1 if 'st_mtime_nsec' is a member of m32 'struct stat64'. */ #undef HAVE_M32_STRUCT_STAT64_ST_MTIME_NSEC -/* Define to 1 if 'st_mtime_nsec' is a member of MPERS_NAME 'struct stat'. */ +/* Define to 1 if 'st_mtime_nsec' is a member of m32 'struct stat'. */ #undef HAVE_M32_STRUCT_STAT_ST_MTIME_NSEC /* Define to 1 if you have the header file. */ @@ -789,20 +913,19 @@ /* Define to 1 if you have the header file. */ #undef HAVE_MQUEUE_H -/* Define to 1 if you have CFLAG mpers support */ +/* Define to 1 if you have mpers_name mpers support */ #undef HAVE_MX32_MPERS -/* Define to 1 if MPERS_NAME has the type 'struct stat'. */ +/* Define to 1 if mx32 has the type 'struct stat'. */ #undef HAVE_MX32_STRUCT_STAT -/* Define to 1 if MPERS_NAME has the type 'struct stat64'. */ +/* Define to 1 if mx32 has the type 'struct stat64'. */ #undef HAVE_MX32_STRUCT_STAT64 -/* Define to 1 if 'st_mtime_nsec' is a member of MPERS_NAME 'struct stat64'. - */ +/* Define to 1 if 'st_mtime_nsec' is a member of mx32 'struct stat64'. */ #undef HAVE_MX32_STRUCT_STAT64_ST_MTIME_NSEC -/* Define to 1 if 'st_mtime_nsec' is a member of MPERS_NAME 'struct stat'. */ +/* Define to 1 if 'st_mtime_nsec' is a member of mx32 'struct stat'. */ #undef HAVE_MX32_STRUCT_STAT_ST_MTIME_NSEC /* Define to 1 if you have the header file. */ @@ -820,6 +943,9 @@ /* Define to 1 if you have the `open64' function. */ #undef HAVE_OPEN64 +/* Define to 1 if you have the header file. */ +#undef HAVE_PATHS_H + /* Define to 1 if you have the `prctl' function. */ #undef HAVE_PRCTL @@ -829,12 +955,18 @@ /* Define to 1 if you have the `process_vm_readv' function. */ #undef HAVE_PROCESS_VM_READV +/* Define to 1 if the system provides program_invocation_name variable */ +#undef HAVE_PROGRAM_INVOCATION_NAME + /* Define to 1 if you have the `pwritev' function. */ #undef HAVE_PWRITEV /* Define to 1 if you have the `readahead' function. */ #undef HAVE_READAHEAD +/* Define to 1 if the system has the type `s390_compat_regs'. */ +#undef HAVE_S390_COMPAT_REGS + /* Define to 1 if you have the header file. */ #undef HAVE_SCSI_SG_H @@ -853,6 +985,9 @@ /* Define to 1 if the system has the type `sig_atomic_t'. */ #undef HAVE_SIG_ATOMIC_T +/* Define to 1 if the system provides static_assert */ +#undef HAVE_STATIC_ASSERT + /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H @@ -871,6 +1006,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H +/* Define to 1 if you have the `strndup' function. */ +#undef HAVE_STRNDUP + /* Define to 1 if you have the header file. */ #undef HAVE_STROPTS_H @@ -880,6 +1018,159 @@ /* Define to 1 if the system has the type `struct blk_user_trace_setup'. */ #undef HAVE_STRUCT_BLK_USER_TRACE_SETUP +/* Define to 1 if the system has the type `struct bpf_insn'. */ +#undef HAVE_STRUCT_BPF_INSN + +/* Define to 1 if the system has the type `struct bpf_map_info'. */ +#undef HAVE_STRUCT_BPF_MAP_INFO + +/* Define to 1 if `btf_id' is a member of `struct bpf_map_info'. */ +#undef HAVE_STRUCT_BPF_MAP_INFO_BTF_ID + +/* Define to 1 if `btf_key_type_id' is a member of `struct bpf_map_info'. */ +#undef HAVE_STRUCT_BPF_MAP_INFO_BTF_KEY_TYPE_ID + +/* Define to 1 if `btf_value_type_id' is a member of `struct bpf_map_info'. */ +#undef HAVE_STRUCT_BPF_MAP_INFO_BTF_VALUE_TYPE_ID + +/* Define to 1 if `id' is a member of `struct bpf_map_info'. */ +#undef HAVE_STRUCT_BPF_MAP_INFO_ID + +/* Define to 1 if `ifindex' is a member of `struct bpf_map_info'. */ +#undef HAVE_STRUCT_BPF_MAP_INFO_IFINDEX + +/* Define to 1 if `key_size' is a member of `struct bpf_map_info'. */ +#undef HAVE_STRUCT_BPF_MAP_INFO_KEY_SIZE + +/* Define to 1 if `map_flags' is a member of `struct bpf_map_info'. */ +#undef HAVE_STRUCT_BPF_MAP_INFO_MAP_FLAGS + +/* Define to 1 if `max_entries' is a member of `struct bpf_map_info'. */ +#undef HAVE_STRUCT_BPF_MAP_INFO_MAX_ENTRIES + +/* Define to 1 if `name' is a member of `struct bpf_map_info'. */ +#undef HAVE_STRUCT_BPF_MAP_INFO_NAME + +/* Define to 1 if `type' is a member of `struct bpf_map_info'. */ +#undef HAVE_STRUCT_BPF_MAP_INFO_TYPE + +/* Define to 1 if `value_size' is a member of `struct bpf_map_info'. */ +#undef HAVE_STRUCT_BPF_MAP_INFO_VALUE_SIZE + +/* Define to 1 if the system has the type `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO + +/* Define to 1 if `btf_id' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_BTF_ID + +/* Define to 1 if `created_by_uid' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_CREATED_BY_UID + +/* Define to 1 if `func_info' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_FUNC_INFO + +/* Define to 1 if `func_info_rec_size' is a member of `struct bpf_prog_info'. + */ +#undef HAVE_STRUCT_BPF_PROG_INFO_FUNC_INFO_REC_SIZE + +/* Define to 1 if `id' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_ID + +/* Define to 1 if `ifindex' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_IFINDEX + +/* Define to 1 if `jited_func_lens' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_JITED_FUNC_LENS + +/* Define to 1 if `jited_ksyms' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_JITED_KSYMS + +/* Define to 1 if `jited_line_info' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_JITED_LINE_INFO + +/* Define to 1 if `jited_line_info_rec_size' is a member of `struct + bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_JITED_LINE_INFO_REC_SIZE + +/* Define to 1 if `jited_prog_insns' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_JITED_PROG_INSNS + +/* Define to 1 if `jited_prog_len' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_JITED_PROG_LEN + +/* Define to 1 if `line_info' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_LINE_INFO + +/* Define to 1 if `line_info_rec_size' is a member of `struct bpf_prog_info'. + */ +#undef HAVE_STRUCT_BPF_PROG_INFO_LINE_INFO_REC_SIZE + +/* Define to 1 if `load_time' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_LOAD_TIME + +/* Define to 1 if `map_ids' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_MAP_IDS + +/* Define to 1 if `name' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_NAME + +/* Define to 1 if `nr_func_info' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_NR_FUNC_INFO + +/* Define to 1 if `nr_jited_func_lens' is a member of `struct bpf_prog_info'. + */ +#undef HAVE_STRUCT_BPF_PROG_INFO_NR_JITED_FUNC_LENS + +/* Define to 1 if `nr_jited_ksyms' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_NR_JITED_KSYMS + +/* Define to 1 if `nr_jited_line_info' is a member of `struct bpf_prog_info'. + */ +#undef HAVE_STRUCT_BPF_PROG_INFO_NR_JITED_LINE_INFO + +/* Define to 1 if `nr_line_info' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_NR_LINE_INFO + +/* Define to 1 if `nr_map_ids' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_NR_MAP_IDS + +/* Define to 1 if `nr_prog_tags' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_NR_PROG_TAGS + +/* Define to 1 if `prog_tags' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_PROG_TAGS + +/* Define to 1 if `run_cnt' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_RUN_CNT + +/* Define to 1 if `run_time_ns' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_RUN_TIME_NS + +/* Define to 1 if `tag' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_TAG + +/* Define to 1 if `type' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_TYPE + +/* Define to 1 if `xlated_prog_insns' is a member of `struct bpf_prog_info'. + */ +#undef HAVE_STRUCT_BPF_PROG_INFO_XLATED_PROG_INSNS + +/* Define to 1 if `xlated_prog_len' is a member of `struct bpf_prog_info'. */ +#undef HAVE_STRUCT_BPF_PROG_INFO_XLATED_PROG_LEN + +/* Define to 1 if the system has the type `struct br_mdb_entry'. */ +#undef HAVE_STRUCT_BR_MDB_ENTRY + +/* Define to 1 if `flags' is a member of `struct br_mdb_entry'. */ +#undef HAVE_STRUCT_BR_MDB_ENTRY_FLAGS + +/* Define to 1 if `vid' is a member of `struct br_mdb_entry'. */ +#undef HAVE_STRUCT_BR_MDB_ENTRY_VID + +/* Define to 1 if the system has the type `struct br_port_msg'. */ +#undef HAVE_STRUCT_BR_PORT_MSG + /* Define to 1 if `start' is a member of `struct btrfs_ioctl_defrag_range_args'. */ #undef HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START @@ -892,25 +1183,114 @@ */ #undef HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE +/* Define to 1 if `flags' is a member of `struct + btrfs_ioctl_logical_ino_args'. */ +#undef HAVE_STRUCT_BTRFS_IOCTL_LOGICAL_INO_ARGS_FLAGS + /* Define to 1 if `buf_size' is a member of `struct btrfs_ioctl_search_args_v2'. */ #undef HAVE_STRUCT_BTRFS_IOCTL_SEARCH_ARGS_V2_BUF_SIZE +/* Define to 1 if the system has the type `struct crypto_report_aead'. */ +#undef HAVE_STRUCT_CRYPTO_REPORT_AEAD + +/* Define to 1 if the system has the type `struct crypto_report_blkcipher'. */ +#undef HAVE_STRUCT_CRYPTO_REPORT_BLKCIPHER + +/* Define to 1 if the system has the type `struct crypto_report_cipher'. */ +#undef HAVE_STRUCT_CRYPTO_REPORT_CIPHER + +/* Define to 1 if the system has the type `struct crypto_report_hash'. */ +#undef HAVE_STRUCT_CRYPTO_REPORT_HASH + +/* Define to 1 if the system has the type `struct crypto_report_rng'. */ +#undef HAVE_STRUCT_CRYPTO_REPORT_RNG + +/* Define to 1 if the system has the type `struct dcbmsg'. */ +#undef HAVE_STRUCT_DCBMSG + +/* Define to 1 if the system has the type `struct fib_rule_port_range'. */ +#undef HAVE_STRUCT_FIB_RULE_PORT_RANGE + +/* Define to 1 if the system has the type `struct fib_rule_uid_range'. */ +#undef HAVE_STRUCT_FIB_RULE_UID_RANGE + /* Define to 1 if the system has the type `struct flock'. */ #undef HAVE_STRUCT_FLOCK /* Define to 1 if the system has the type `struct flock64'. */ #undef HAVE_STRUCT_FLOCK64 +/* Define to 1 if the system has the type `struct f_owner_ex'. */ +#undef HAVE_STRUCT_F_OWNER_EX + +/* Define to 1 if the system has the type `struct gnet_stats_basic'. */ +#undef HAVE_STRUCT_GNET_STATS_BASIC + +/* Define to 1 if the system has the type `struct gnet_stats_queue'. */ +#undef HAVE_STRUCT_GNET_STATS_QUEUE + +/* Define to 1 if the system has the type `struct gnet_stats_rate_est'. */ +#undef HAVE_STRUCT_GNET_STATS_RATE_EST + +/* Define to 1 if the system has the type `struct gnet_stats_rate_est64'. */ +#undef HAVE_STRUCT_GNET_STATS_RATE_EST64 + /* Define to 1 if the system has the type `struct ia64_fpreg'. */ #undef HAVE_STRUCT_IA64_FPREG +/* Define to 1 if the system has the type `struct ifaddrlblmsg'. */ +#undef HAVE_STRUCT_IFADDRLBLMSG + +/* Define to 1 if the system has the type `struct ifla_bridge_id'. */ +#undef HAVE_STRUCT_IFLA_BRIDGE_ID + +/* Define to 1 if the system has the type `struct ifla_cacheinfo'. */ +#undef HAVE_STRUCT_IFLA_CACHEINFO + +/* Define to 1 if the system has the type `struct ifla_port_vsi'. */ +#undef HAVE_STRUCT_IFLA_PORT_VSI + /* Define to 1 if `resolution' is a member of `struct input_absinfo'. */ #undef HAVE_STRUCT_INPUT_ABSINFO_RESOLUTION +/* Define to 1 if the system has the type `struct kcmp_epoll_slot'. */ +#undef HAVE_STRUCT_KCMP_EPOLL_SLOT + +/* Define to 1 if the system has the type `struct keyctl_kdf_params'. */ +#undef HAVE_STRUCT_KEYCTL_KDF_PARAMS + +/* Define to 1 if the system has the type `struct kvm_cpuid2'. */ +#undef HAVE_STRUCT_KVM_CPUID2 + +/* Define to 1 if the system has the type `struct kvm_regs'. */ +#undef HAVE_STRUCT_KVM_REGS + +/* Define to 1 if the system has the type `struct kvm_sregs'. */ +#undef HAVE_STRUCT_KVM_SREGS + +/* Define to 1 if the system has the type `struct + kvm_userspace_memory_region'. */ +#undef HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION + /* Define to 1 if the system has the type `struct mmsghdr'. */ #undef HAVE_STRUCT_MMSGHDR +/* Define to 1 if the system has the type `struct mtd_write_req'. */ +#undef HAVE_STRUCT_MTD_WRITE_REQ + +/* Define to 1 if the system has the type `struct ndt_config'. */ +#undef HAVE_STRUCT_NDT_CONFIG + +/* Define to 1 if the system has the type `struct ndt_stats'. */ +#undef HAVE_STRUCT_NDT_STATS + +/* Define to 1 if `ndts_table_fulls' is a member of `struct ndt_stats'. */ +#undef HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS + +/* Define to 1 if the system has the type `struct netconfmsg'. */ +#undef HAVE_STRUCT_NETCONFMSG + /* Define to 1 if `aux_watermark' is a member of `struct perf_event_attr'. */ #undef HAVE_STRUCT_PERF_EVENT_ATTR_AUX_WATERMARK @@ -953,6 +1333,9 @@ /* Define to 1 if `mmap_data' is a member of `struct perf_event_attr'. */ #undef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP_DATA +/* Define to 1 if `namespaces' is a member of `struct perf_event_attr'. */ +#undef HAVE_STRUCT_PERF_EVENT_ATTR_NAMESPACES + /* Define to 1 if `precise_ip' is a member of `struct perf_event_attr'. */ #undef HAVE_STRUCT_PERF_EVENT_ATTR_PRECISE_IP @@ -981,15 +1364,36 @@ /* Define to 1 if `write_backward' is a member of `struct perf_event_attr'. */ #undef HAVE_STRUCT_PERF_EVENT_ATTR_WRITE_BACKWARD +/* Define to 1 if the system has the type `struct ptp_sys_offset'. */ +#undef HAVE_STRUCT_PTP_SYS_OFFSET + /* Define to 1 if the system has the type `struct ptrace_peeksiginfo_args'. */ #undef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS /* Define to 1 if the system has the type `struct pt_all_user_regs'. */ #undef HAVE_STRUCT_PT_ALL_USER_REGS +/* Define to 1 if the system has the type `struct rta_mfc_stats'. */ +#undef HAVE_STRUCT_RTA_MFC_STATS + +/* Define to 1 if the system has the type `struct rtnl_link_stats64'. */ +#undef HAVE_STRUCT_RTNL_LINK_STATS64 + +/* Define to 1 if `rx_nohandler' is a member of `struct rtnl_link_stats64'. */ +#undef HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER + +/* Define to 1 if `rx_nohandler' is a member of `struct rtnl_link_stats'. */ +#undef HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER + +/* Define to 1 if the system has the type `struct rtvia'. */ +#undef HAVE_STRUCT_RTVIA + /* Define to 1 if the system has the type `struct sigcontext'. */ #undef HAVE_STRUCT_SIGCONTEXT +/* Define to 1 if `l2_bdaddr_type' is a member of `struct sockaddr_l2'. */ +#undef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE + /* Define to 1 if the system has the type `struct stat64'. */ #undef HAVE_STRUCT_STAT64 @@ -1029,21 +1433,48 @@ /* Define to 1 if `st_mtime_nsec' is a member of `struct stat'. */ #undef HAVE_STRUCT_STAT_ST_MTIME_NSEC +/* Define to 1 if the system has the type `struct tc_sizespec'. */ +#undef HAVE_STRUCT_TC_SIZESPEC + /* Define to 1 if `tai' is a member of `struct timex'. */ #undef HAVE_STRUCT_TIMEX_TAI +/* Define to 1 if `max_beb_per1024' is a member of `struct ubi_attach_req'. */ +#undef HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024 + /* Define to 1 if the system has the type `struct user_desc'. */ #undef HAVE_STRUCT_USER_DESC +/* Define to 1 if `lm' is a member of `struct user_desc'. */ +#undef HAVE_STRUCT_USER_DESC_LM + /* Define to 1 if `domainname' is a member of `struct utsname'. */ #undef HAVE_STRUCT_UTSNAME_DOMAINNAME +/* Define to 1 if `buffersize' is a member of `struct v4l2_sdr_format'. */ +#undef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE + +/* Define to 1 if `global_alpha' is a member of `struct v4l2_window'. */ +#undef HAVE_STRUCT_V4L2_WINDOW_GLOBAL_ALPHA + +/* Define to 1 if the system has the type `struct __aio_sigset'. */ +#undef HAVE_STRUCT___AIO_SIGSET + /* Define to 1 if the system has the type `struct __kernel_flock'. */ #undef HAVE_STRUCT___KERNEL_FLOCK /* Define to 1 if the system has the type `struct __kernel_flock64'. */ #undef HAVE_STRUCT___KERNEL_FLOCK64 +/* Define to 1 if the system has the type `struct __kernel_f_owner_ex'. */ +#undef HAVE_STRUCT___KERNEL_F_OWNER_EX + +/* Define to 1 if the system has the type `struct __kernel_sock_timeval'. */ +#undef HAVE_STRUCT___KERNEL_SOCK_TIMEVAL + +/* Define to 1 if the system has the type `struct __kernel_timespec'. */ +#undef HAVE_STRUCT___KERNEL_TIMESPEC + /* Define to 1 if the system has the type `struct __old_kernel_stat'. */ #undef HAVE_STRUCT___OLD_KERNEL_STAT @@ -1068,9 +1499,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_SYS_QUOTA_H -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_REG_H - /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SEM_H @@ -1092,15 +1520,257 @@ /* Define to 1 if typeof works with your compiler. */ #undef HAVE_TYPEOF -/* Define to 1 if union bpf_attr.attach_type initialization works */ +/* Define to 1 if `attach_bpf_fd' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_ATTACH_BPF_FD + +/* Define to 1 if `attach_flags' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_ATTACH_FLAGS + +/* Define to 1 if `attach_type' is a member of `union bpf_attr'. */ #undef HAVE_UNION_BPF_ATTR_ATTACH_TYPE -/* Define to 1 if union bpf_attr.bpf_fd initialization works */ +/* Define to 1 if `bpf_fd' is a member of `union bpf_attr'. */ #undef HAVE_UNION_BPF_ATTR_BPF_FD -/* Define to 1 if union bpf_attr.log_buf initialization works */ +/* Define to 1 if `btf' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_BTF + +/* Define to 1 if `btf_fd' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_BTF_FD + +/* Define to 1 if `btf_id' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_BTF_ID + +/* Define to 1 if `btf_key_type_id' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_BTF_KEY_TYPE_ID + +/* Define to 1 if `btf_log_buf' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_BTF_LOG_BUF + +/* Define to 1 if `btf_log_level' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_BTF_LOG_LEVEL + +/* Define to 1 if `btf_log_size' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_BTF_LOG_SIZE + +/* Define to 1 if `btf_size' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_BTF_SIZE + +/* Define to 1 if `btf_value_type_id' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_BTF_VALUE_TYPE_ID + +/* Define to 1 if `dummy' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_DUMMY + +/* Define to 1 if `expected_attach_type' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_EXPECTED_ATTACH_TYPE + +/* Define to 1 if `file_flags' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_FILE_FLAGS + +/* Define to 1 if `flags' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_FLAGS + +/* Define to 1 if `func_info' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_FUNC_INFO + +/* Define to 1 if `func_info_cnt' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_FUNC_INFO_CNT + +/* Define to 1 if `func_info_rec_size' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_FUNC_INFO_REC_SIZE + +/* Define to 1 if `info.bpf_fd' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_INFO_BPF_FD + +/* Define to 1 if `info.info' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_INFO_INFO + +/* Define to 1 if `info.info_len' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_INFO_INFO_LEN + +/* Define to 1 if `inner_map_fd' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_INNER_MAP_FD + +/* Define to 1 if `insns' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_INSNS + +/* Define to 1 if `insn_cnt' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_INSN_CNT + +/* Define to 1 if `kern_version' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_KERN_VERSION + +/* Define to 1 if `key' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_KEY + +/* Define to 1 if `key_size' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_KEY_SIZE + +/* Define to 1 if `license' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_LICENSE + +/* Define to 1 if `line_info' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_LINE_INFO + +/* Define to 1 if `line_info_cnt' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_LINE_INFO_CNT + +/* Define to 1 if `line_info_rec_size' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_LINE_INFO_REC_SIZE + +/* Define to 1 if `log_buf' is a member of `union bpf_attr'. */ #undef HAVE_UNION_BPF_ATTR_LOG_BUF +/* Define to 1 if `log_level' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_LOG_LEVEL + +/* Define to 1 if `log_size' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_LOG_SIZE + +/* Define to 1 if `map_fd' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_MAP_FD + +/* Define to 1 if `map_flags' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_MAP_FLAGS + +/* Define to 1 if `map_id' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_MAP_ID + +/* Define to 1 if `map_ifindex' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_MAP_IFINDEX + +/* Define to 1 if `map_name' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_MAP_NAME + +/* Define to 1 if `map_type' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_MAP_TYPE + +/* Define to 1 if `max_entries' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_MAX_ENTRIES + +/* Define to 1 if `next_id' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_NEXT_ID + +/* Define to 1 if `next_key' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_NEXT_KEY + +/* Define to 1 if `numa_node' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_NUMA_NODE + +/* Define to 1 if `open_flags' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_OPEN_FLAGS + +/* Define to 1 if `pathname' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_PATHNAME + +/* Define to 1 if `prog_btf_fd' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_PROG_BTF_FD + +/* Define to 1 if `prog_flags' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_PROG_FLAGS + +/* Define to 1 if `prog_id' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_PROG_ID + +/* Define to 1 if `prog_ifindex' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_PROG_IFINDEX + +/* Define to 1 if `prog_name' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_PROG_NAME + +/* Define to 1 if `prog_type' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_PROG_TYPE + +/* Define to 1 if `query.attach_flags' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_QUERY_ATTACH_FLAGS + +/* Define to 1 if `query.attach_type' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_QUERY_ATTACH_TYPE + +/* Define to 1 if `query.prog_cnt' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_QUERY_PROG_CNT + +/* Define to 1 if `query.prog_ids' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_QUERY_PROG_IDS + +/* Define to 1 if `query.query_flags' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_QUERY_QUERY_FLAGS + +/* Define to 1 if `query.target_fd' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_QUERY_TARGET_FD + +/* Define to 1 if `raw_tracepoint.name' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_RAW_TRACEPOINT_NAME + +/* Define to 1 if `raw_tracepoint.prog_fd' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_RAW_TRACEPOINT_PROG_FD + +/* Define to 1 if `start_id' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_START_ID + +/* Define to 1 if `target_fd' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_TARGET_FD + +/* Define to 1 if `task_fd_query.buf' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_BUF + +/* Define to 1 if `task_fd_query.buf_len' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_BUF_LEN + +/* Define to 1 if `task_fd_query.fd' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_FD + +/* Define to 1 if `task_fd_query.fd_type' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_FD_TYPE + +/* Define to 1 if `task_fd_query.flags' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_FLAGS + +/* Define to 1 if `task_fd_query.pid' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_PID + +/* Define to 1 if `task_fd_query.probe_addr' is a member of `union bpf_attr'. + */ +#undef HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_PROBE_ADDR + +/* Define to 1 if `task_fd_query.probe_offset' is a member of `union + bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_PROBE_OFFSET + +/* Define to 1 if `task_fd_query.prog_id' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_PROG_ID + +/* Define to 1 if `test.data_in' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_TEST_DATA_IN + +/* Define to 1 if `test.data_out' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_TEST_DATA_OUT + +/* Define to 1 if `test.data_size_in' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_TEST_DATA_SIZE_IN + +/* Define to 1 if `test.data_size_out' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_TEST_DATA_SIZE_OUT + +/* Define to 1 if `test.duration' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_TEST_DURATION + +/* Define to 1 if `test.prog_fd' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_TEST_PROG_FD + +/* Define to 1 if `test.repeat' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_TEST_REPEAT + +/* Define to 1 if `test.retval' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_TEST_RETVAL + +/* Define to 1 if `value' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_VALUE + +/* Define to 1 if `value_size' is a member of `union bpf_attr'. */ +#undef HAVE_UNION_BPF_ATTR_VALUE_SIZE + /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H @@ -1110,6 +1780,9 @@ /* Define to 1 if you have the `utimensat' function. */ #undef HAVE_UTIMENSAT +/* Define to 1 if the system provides _Static_assert */ +#undef HAVE__STATIC_ASSERT + /* Define to 1 if the system provides __builtin_popcount function */ #undef HAVE___BUILTIN_POPCOUNT @@ -1137,9 +1810,18 @@ /* Define for _ABIO32. */ #undef LINUX_MIPSO32 +/* The size of `kernel_long_t', as computed by sizeof. */ +#undef M32_SIZEOF_KERNEL_LONG_T + +/* The size of `long', as computed by sizeof. */ +#undef M32_SIZEOF_LONG + /* Define for the m68k architecture. */ #undef M68K +/* Date */ +#undef MANPAGE_DATE + /* Define for the Meta architecture. */ #undef METAG @@ -1149,6 +1831,12 @@ /* Define for the MIPS architecture. */ #undef MIPS +/* The size of `kernel_long_t', as computed by sizeof. */ +#undef MX32_SIZEOF_KERNEL_LONG_T + +/* The size of `long', as computed by sizeof. */ +#undef MX32_SIZEOF_LONG + /* Define for the Nios-II architecture. */ #undef NIOS2 @@ -1224,7 +1912,13 @@ /* Define for the Tile architecture */ #undef TILE -/* Compile stack tracing functionality */ +/* Do symbols demangling in stack trace */ +#undef USE_DEMANGLE + +/* Whether to use libdw for stack tracing */ +#undef USE_LIBDW + +/* Whether to use libunwind for stack tracing */ #undef USE_LIBUNWIND /* Enable extensions on AIX 3, Interix. */ @@ -1249,6 +1943,9 @@ #endif +/* The unwinder to use for stack tracing support */ +#undef USE_UNWINDER + /* Version number of package */ #undef VERSION diff --git a/config.sub b/config.sub index 7a8ce3e6..9542f985 100755 --- a/config.sub +++ b/config.sub @@ -1,8 +1,8 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2015 Free Software Foundation, Inc. +# Copyright 1992-2018 Free Software Foundation, Inc. -timestamp='2015-08-20' +timestamp='2018-12-16' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -15,7 +15,7 @@ timestamp='2015-08-20' # General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, see . +# along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -33,7 +33,7 @@ timestamp='2015-08-20' # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD +# https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -53,12 +53,11 @@ timestamp='2015-08-20' me=`echo "$0" | sed -e 's,.*/,,'` usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS +Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -68,7 +67,7 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright 1992-2015 Free Software Foundation, Inc. +Copyright 1992-2018 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -90,12 +89,12 @@ while test $# -gt 0 ; do - ) # Use stdin as input. break ;; -* ) - echo "$me: invalid option $1$help" + echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. - echo $1 + echo "$1" exit ;; * ) @@ -111,1234 +110,1160 @@ case $# in exit 1;; esac -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac +# Split fields of configuration type +IFS="-" read field1 field2 field3 field4 <&2 + exit 1 ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + *-*-*-*) + basic_machine=$field1-$field2 + os=$field3-$field4 ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc \ + | linux-newlib* | linux-musl* | linux-uclibc* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova*) + basic_machine=$field1 + os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + os=linux-android + ;; + *) + basic_machine=$field1-$field2 + os=$field3 + ;; + esac ;; - -psos*) - os=-psos + *-*) + # A lone config we happen to match not fitting any pattern + case $field1-$field2 in + decstation-3100) + basic_machine=mips-dec + os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ + | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ + | unicom* | ibm* | next | hp | isi* | apollo | altos* \ + | convergent* | ncr* | news | 32* | 3600* | 3100* \ + | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ + | ultra | tti* | harris | dolphin | highlevel | gould \ + | cbm | ns | masscomp | apple | axis | knuth | cray \ + | microblaze* | sim | cisco \ + | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + os= + ;; + *) + basic_machine=$field1 + os=$field2 + ;; + esac + ;; + esac ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + os=bsd + ;; + a29khif) + basic_machine=a29k-amd + os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=scout + ;; + alliant) + basic_machine=fx80-alliant + os= + ;; + altos | altos3068) + basic_machine=m68k-altos + os= + ;; + am29k) + basic_machine=a29k-none + os=bsd + ;; + amdahl) + basic_machine=580-amdahl + os=sysv + ;; + amiga) + basic_machine=m68k-unknown + os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=bsd + ;; + aros) + basic_machine=i386-pc + os=aros + ;; + aux) + basic_machine=m68k-apple + os=aux + ;; + balance) + basic_machine=ns32k-sequent + os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=linux + ;; + cegcc) + basic_machine=arm-unknown + os=cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=bsd + ;; + convex-c2) + basic_machine=c2-convex + os=bsd + ;; + convex-c32) + basic_machine=c32-convex + os=bsd + ;; + convex-c34) + basic_machine=c34-convex + os=bsd + ;; + convex-c38) + basic_machine=c38-convex + os=bsd + ;; + cray) + basic_machine=j90-cray + os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + os= + ;; + da30) + basic_machine=m68k-da30 + os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + os= + ;; + delta88) + basic_machine=m88k-motorola + os=sysv3 + ;; + dicos) + basic_machine=i686-pc + os=dicos + ;; + djgpp) + basic_machine=i586-pc + os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=ose + ;; + gmicro) + basic_machine=tron-gmicro + os=sysv + ;; + go32) + basic_machine=i386-pc + os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=hms + ;; + harris) + basic_machine=m88k-harris + os=sysv3 + ;; + hp300) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=hpux + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=proelf + ;; + i386mach) + basic_machine=i386-mach + os=mach + ;; + vsta) + basic_machine=i386-pc + os=vsta + ;; + isi68 | isi) + basic_machine=m68k-isi + os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + os=sysv + ;; + merlin) + basic_machine=ns32k-utek + os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + os=coff + ;; + morphos) + basic_machine=powerpc-unknown + os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + os=moxiebox + ;; + msdos) + basic_machine=i386-pc + os=msdos + ;; + msys) + basic_machine=i686-pc + os=msys + ;; + mvs) + basic_machine=i370-ibm + os=mvs + ;; + nacl) + basic_machine=le32-unknown + os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=newsos + ;; + news1000) + basic_machine=m68030-sony + os=newsos + ;; + necv70) + basic_machine=v70-nec + os=sysv + ;; + nh3000) + basic_machine=m68k-harris + os=cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=cxux + ;; + nindy960) + basic_machine=i960-intel + os=nindy + ;; + mon960) + basic_machine=i960-intel + os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=ose + ;; + os68k) + basic_machine=m68k-none + os=os68k + ;; + paragon) + basic_machine=i860-intel + os=osf + ;; + parisc) + basic_machine=hppa-unknown + os=linux + ;; + pw32) + basic_machine=i586-unknown + os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + os=rdos + ;; + rdos32) + basic_machine=i386-pc + os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=coff + ;; + sa29200) + basic_machine=a29k-amd + os=udi + ;; + sei) + basic_machine=mips-sei + os=seiux + ;; + sequent) + basic_machine=i386-sequent + os= + ;; + sps7) + basic_machine=m68k-bull + os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + os= + ;; + stratus) + basic_machine=i860-stratus + os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + os= + ;; + sun2os3) + basic_machine=m68000-sun + os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + os= + ;; + sun3os3) + basic_machine=m68k-sun + os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + os= + ;; + sun4os3) + basic_machine=sparc-sun + os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + os= + ;; + sv1) + basic_machine=sv1-cray + os=unicos + ;; + symmetry) + basic_machine=i386-sequent + os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=unicos + ;; + t90) + basic_machine=t90-cray + os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + os=tpf + ;; + udi29k) + basic_machine=a29k-amd + os=udi + ;; + ultra3) + basic_machine=a29k-nyu + os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=none + ;; + vaxv) + basic_machine=vax-dec + os=sysv + ;; + vms) + basic_machine=vax-dec + os=vms + ;; + vxworks960) + basic_machine=i960-wrs + os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=vxworks + ;; + xbox) + basic_machine=i686-pc + os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + os=unicos + ;; + *) + basic_machine=$1 + os= + ;; + esac ;; esac -# Decode aliases for certain CPU-COMPANY combinations. +# Decode 1-component or ad-hoc basic machines case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arceb \ - | arm | armh | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ - | avr | avr32 \ - | ba \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | e2k | epiphany \ - | fido | fr30 | frv | ft32 \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 | or1k | or1knd | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ - | riscv32 | riscv64 \ - | rl78 | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | visium \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - leon|leon[3-9]) - basic_machine=sparc-$basic_machine - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=-none + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) + cpu=hppa1.1 + vendor=winbond ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + op50n) + cpu=hppa1.1 + vendor=oki ;; - ms1) - basic_machine=mt-unknown + op60c) + cpu=hppa1.1 + vendor=oki ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown + ibm*) + cpu=i370 + vendor=ibm ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none + orion105) + cpu=clipper + vendor=highlevel ;; - xscaleeb) - basic_machine=armeb-unknown + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple ;; - - xscaleel) - basic_machine=armel-unknown + pmac | pmac-mpw) + cpu=powerpc + vendor=apple ;; - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ - | arm-* | armh-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | ba-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | e2k-* | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa32r6-* | mipsisa32r6el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64r6-* | mipsisa64r6el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | or1k*-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pyramid-* \ - | riscv32-* | riscv64-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | visium-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att + cpu=m68000 + vendor=att ;; 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - asmjs) - basic_machine=asmjs-unknown - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux + cpu=we32k + vendor=att ;; bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec + cpu=powerpc + vendor=ibm + os=cnk ;; decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 + cpu=pdp10 + vendor=dec + os=tops10 ;; decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 + cpu=pdp10 + vendor=dec + os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos + cpu=m68k + vendor=motorola ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd + dpx2*) + cpu=m68k + vendor=bull + os=sysv3 ;; encore | umax | mmax) - basic_machine=ns32k-encore + cpu=ns32k + vendor=encore ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose + elxsi) + cpu=elxsi + vendor=elxsi + os=${os:-bsd} ;; fx2800) - basic_machine=i860-alliant + cpu=i860 + vendor=alliant ;; genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 + cpu=ns32k + vendor=ns ;; h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux + cpu=hppa1.1 + vendor=hitachi + os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp + cpu=hppa1.0 + vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp + cpu=m68000 + vendor=hp ;; hp9k3[2-9][0-9]) - basic_machine=m68k-hp + cpu=m68k + vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp + cpu=hppa1.0 + vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm + cpu=hppa1.0 + vendor=hp ;; i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=sysv32 ;; i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=sysv4 ;; i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=sysv ;; i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + os=solaris2 ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta + j90 | j90-cray) + cpu=j90 + vendor=cray + os=${os:-unicos} ;; iris | iris4d) - basic_machine=mips-sgi + cpu=mips + vendor=sgi case $os in - -irix*) + irix*) ;; *) - os=-irix4 + os=irix4 ;; esac ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - leon-*|leon[3-9]-*) - basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=-moxiebox - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs + cpu=m68000 + vendor=convergent ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos + *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) + cpu=m68k + vendor=atari + os=mint ;; news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv + cpu=mips + vendor=sony + os=newsos ;; - next | m*-next ) - basic_machine=m68k-next + next | m*-next) + cpu=m68k + vendor=next case $os in - -nextstep* ) + nextstep* ) ;; - -ns2*) - os=-nextstep2 + ns2*) + os=nextstep2 ;; *) - os=-nextstep3 + os=nextstep3 ;; esac ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem + cpu=np1 + vendor=gould ;; op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k + cpu=hppa1.1 + vendor=oki + os=proelf ;; pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux + cpu=hppa1.1 + vendor=hitachi + os=hiuxwe2 ;; pbd) - basic_machine=sparc-tti + cpu=sparc + vendor=tti ;; pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 + cpu=m68k + vendor=tti ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + pc532) + cpu=ns32k + vendor=pc532 ;; pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm + cpu=pn + vendor=gould ;; - ppc | ppcbe) basic_machine=powerpc-unknown - ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + power) + cpu=power + vendor=ibm ;; ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff + cpu=i386 + vendor=ibm ;; rm[46]00) - basic_machine=mips-siemens + cpu=mips + vendor=siemens ;; rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm + cpu=romp + vendor=ibm ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi + sde) + cpu=mipsisa32 + vendor=sde + os=${os:-elf} ;; - sb1) - basic_machine=mipsisa64sb1-unknown + simso-wrs) + cpu=sparclite + vendor=wrs + os=vxworks ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown + tower | tower-32) + cpu=m68k + vendor=ncr ;; - sde) - basic_machine=mipsisa32-sde - os=-elf + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu ;; - sei) - basic_machine=mips-sei - os=-seiux + w65) + cpu=w65 + vendor=wdc ;; - sequent) - basic_machine=i386-sequent + w89k-*) + cpu=hppa1.1 + vendor=winbond + os=proelf ;; - sh) - basic_machine=sh-hitachi - os=-hms + none) + cpu=none + vendor=none ;; - sh5el) - basic_machine=sh5le-unknown + leon|leon[3-9]) + cpu=sparc + vendor=$basic_machine ;; - sh64) - basic_machine=sh64-unknown + leon-*|leon[3-9]-*) + cpu=sparc + vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks + + *-*) + IFS="-" read cpu vendor <&2 - exit 1 + # Recognize the canonical CPU types that are allowed with any + # company name. + case $cpu in + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | abacus \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \ + | alphapca5[67] | alpha64pca5[67] \ + | am33_2.0 \ + | amdgcn \ + | arc | arceb \ + | arm | armh | arm[lb]e | arme[lb] | armv* \ + | avr | avr32 \ + | asmjs \ + | ba \ + | be32 | be64 \ + | bfin | bs2000 \ + | c[123]* | c30 | [cjt]90 | c4x \ + | c8051 | clipper | craynv | csky | cydra \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | elxsi | epiphany \ + | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \ + | h8300 | h8500 \ + | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | hexagon \ + | i370 | i*86 | i860 | i960 | ia16 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | m32c | m32r | m32rle \ + | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k | v70 | w65 \ + | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip \ + | m88110 | m88k | maxq | mb | mcore | mep | metag \ + | microblaze | microblazeel \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mmix \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nfp \ + | nios | nios2 | nios2eb | nios2el \ + | none | np1 | ns16k | ns32k \ + | open8 \ + | or1k* \ + | or32 \ + | orion \ + | pdp10 | pdp11 | pj | pjl | pn | power \ + | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ + | pru \ + | pyramid \ + | riscv | riscv32 | riscv64 \ + | rl78 | romp | rs6000 | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \ + | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \ + | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ + | spu \ + | tahoe \ + | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ + | tron \ + | ubicom32 \ + | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ + | vax \ + | visium \ + | wasm32 \ + | we32k \ + | x86 | x86_64 | xc16x | xgate | xps100 \ + | xstormy16 | xtensa* \ + | ymp \ + | z8k | z80) + ;; + + *) + echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2 + exit 1 + ;; + esac ;; esac # Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` +case $vendor in + digital*) + vendor=dec ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + commodore*) + vendor=cbm ;; *) ;; @@ -1346,197 +1271,246 @@ esac # Decode manufacturer-specific aliases for certain operating systems. -if [ x"$os" != x"" ] +if [ x$os != x ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux + # First match some system type aliases that might get confused + # with valid system types. + # solaris* is a basic system type, with this one exception. + auroraux) + os=auroraux ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` + bluegene*) + os=cnk ;; - -solaris) - os=-solaris2 + solaris1 | solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; - -svr4*) - os=-sysv4 + solaris) + os=solaris2 ;; - -unixware*) - os=-sysv4.2uw + unixware*) + os=sysv4.2uw ;; - -gnu/linux*) + gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; - # First accept the basic system types. + # es1800 is here to avoid being matched by es* (a different OS) + es1800*) + os=ose + ;; + # Some version numbers need modification + chorusos*) + os=chorusos + ;; + isc) + os=isc2.2 + ;; + sco6) + os=sco5v6 + ;; + sco5) + os=sco3.2v5 + ;; + sco4) + os=sco3.2v4 + ;; + sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + ;; + sco3.2v[4-9]* | sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + ;; + scout) + # Don't match below + ;; + sco*) + os=sco3.2v2 + ;; + psos*) + os=psos + ;; + # Now accept the basic system types. # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* | -plan9* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* | -cloudabi* | -sortix* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) + # Each alternative MUST end in a * to match a version number. + # sysv* is not here because it comes later, after sysvr4. + gnu* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos[34]*\ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | kopensolaris* | plan9* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* \ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ + | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ + | knetbsd* | mirbsd* | netbsd* \ + | bitrig* | openbsd* | solidbsd* | libertybsd* \ + | ekkobsd* | kfreebsd* | freebsd* | riscix* | lynxos* \ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | udi* | eabi* | lites* | ieee* | go32* | aux* | hcos* \ + | chorusrdb* | cegcc* | glidix* \ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | midipix* | mingw32* | mingw64* | linux-gnu* | linux-android* \ + | linux-newlib* | linux-musl* | linux-uclibc* \ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \ + | interix* | uwin* | mks* | rhapsody* | darwin* \ + | openstep* | oskit* | conix* | pw32* | nonstopux* \ + | storm-chaos* | tops10* | tenex* | tops20* | its* \ + | os2* | vos* | palmos* | uclinux* | nucleus* \ + | morphos* | superux* | rtmk* | windiss* \ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd* | amdhsa* | unleashed*) # Remember, each alternative MUST END IN *, to match a version number. ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) + qnx*) + case $cpu in + x86 | i*86) ;; *) - os=-nto$os + os=nto-$os ;; esac ;; - -nto-qnx*) + hiux*) + os=hiuxwe2 ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` + nto-qnx*) ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` + sim | xray | os68k* | v88r* \ + | windows* | osx | abug | netware* | os9* \ + | macos* | mpw* | magic* | mmixware* | mon960* | lnews*) ;; - -linux-dietlibc) - os=-linux-dietlibc + linux-dietlibc) + os=linux-dietlibc ;; - -linux*) + linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` + lynx*178) + os=lynxos178 + ;; + lynx*5) + os=lynxos5 + ;; + lynx*) + os=lynxos ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` + mac*) + os=`echo "$os" | sed -e 's|mac|macos|'` ;; - -opened*) - os=-openedition + opened*) + os=openedition ;; - -os400*) - os=-os400 + os400*) + os=os400 ;; - -wince*) - os=-wince + sunos5*) + os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; - -osfrose*) - os=-osfrose + sunos6*) + os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; - -osf*) - os=-osf + wince*) + os=wince ;; - -utek*) - os=-bsd + utek*) + os=bsd ;; - -dynix*) - os=-bsd + dynix*) + os=bsd ;; - -acis*) - os=-aos + acis*) + os=aos ;; - -atheos*) - os=-atheos + atheos*) + os=atheos ;; - -syllable*) - os=-syllable + syllable*) + os=syllable ;; - -386bsd) - os=-bsd + 386bsd) + os=bsd ;; - -ctix* | -uts*) - os=-sysv + ctix* | uts*) + os=sysv ;; - -nova*) - os=-rtmk-nova + nova*) + os=rtmk-nova ;; - -ns2 ) - os=-nextstep2 + ns2) + os=nextstep2 ;; - -nsk*) - os=-nsk + nsk*) + os=nsk ;; # Preserve the version number of sinix5. - -sinix5.*) + sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; - -sinix*) - os=-sysv4 + sinix*) + os=sysv4 ;; - -tpf*) - os=-tpf + tpf*) + os=tpf ;; - -triton*) - os=-sysv3 + triton*) + os=sysv3 ;; - -oss*) - os=-sysv3 + oss*) + os=sysv3 ;; - -svr4) - os=-sysv4 + svr4*) + os=sysv4 ;; - -svr3) - os=-sysv3 + svr3) + os=sysv3 ;; - -sysvr4) - os=-sysv4 + sysvr4) + os=sysv4 ;; - # This must come after -sysvr4. - -sysv*) + # This must come after sysvr4. + sysv*) ;; - -ose*) - os=-ose + ose*) + os=ose ;; - -es1800*) - os=-ose + *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) + os=mint ;; - -xenix) - os=-xenix + zvmoe) + os=zvmoe ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint + dicos*) + os=dicos ;; - -aros*) - os=-aros + pikeos*) + # Until real need of OS specific support for + # particular features comes up, bare metal + # configurations are quite functional. + case $cpu in + arm*) + os=eabi + ;; + *) + os=elf + ;; + esac ;; - -zvmoe) - os=-zvmoe + nacl*) ;; - -dicos*) - os=-dicos + ios) ;; - -nacl*) + none) ;; - -none) + *-eabi) ;; *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + echo Invalid configuration \`"$1"\': system \`"$os"\' not recognized 1>&2 exit 1 ;; esac @@ -1552,261 +1526,265 @@ else # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. -case $basic_machine in +case $cpu-$vendor in score-*) - os=-elf + os=elf ;; spu-*) - os=-elf + os=elf ;; *-acorn) - os=-riscix1.2 + os=riscix1.2 ;; arm*-rebel) - os=-linux + os=linux ;; arm*-semi) - os=-aout + os=aout ;; c4x-* | tic4x-*) - os=-coff + os=coff ;; c8051-*) - os=-elf + os=elf + ;; + clipper-intergraph) + os=clix ;; hexagon-*) - os=-elf + os=elf ;; tic54x-*) - os=-coff + os=coff ;; tic55x-*) - os=-coff + os=coff ;; tic6x-*) - os=-coff + os=coff ;; # This must come before the *-dec entry. pdp10-*) - os=-tops20 + os=tops20 ;; pdp11-*) - os=-none + os=none ;; *-dec | vax-*) - os=-ultrix4.2 + os=ultrix4.2 ;; m68*-apollo) - os=-domain + os=domain ;; i386-sun) - os=-sunos4.0.2 + os=sunos4.0.2 ;; m68000-sun) - os=-sunos3 + os=sunos3 ;; m68*-cisco) - os=-aout + os=aout ;; mep-*) - os=-elf + os=elf ;; mips*-cisco) - os=-elf + os=elf ;; mips*-*) - os=-elf + os=elf ;; or32-*) - os=-coff + os=coff ;; *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 + os=sysv3 ;; sparc-* | *-sun) - os=-sunos4.1.1 + os=sunos4.1.1 ;; - *-be) - os=-beos + pru-*) + os=elf ;; - *-haiku) - os=-haiku + *-be) + os=beos ;; *-ibm) - os=-aix + os=aix ;; *-knuth) - os=-mmixware + os=mmixware ;; *-wec) - os=-proelf + os=proelf ;; *-winbond) - os=-proelf + os=proelf ;; *-oki) - os=-proelf + os=proelf ;; *-hp) - os=-hpux + os=hpux ;; *-hitachi) - os=-hiux + os=hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv + os=sysv ;; *-cbm) - os=-amigaos + os=amigaos ;; *-dg) - os=-dgux + os=dgux ;; *-dolphin) - os=-sysv3 + os=sysv3 ;; m68k-ccur) - os=-rtu + os=rtu ;; m88k-omron*) - os=-luna + os=luna ;; - *-next ) - os=-nextstep + *-next) + os=nextstep ;; *-sequent) - os=-ptx + os=ptx ;; *-crds) - os=-unos + os=unos ;; *-ns) - os=-genix + os=genix ;; i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 + os=mvs ;; *-gould) - os=-sysv + os=sysv ;; *-highlevel) - os=-bsd + os=bsd ;; *-encore) - os=-bsd + os=bsd ;; *-sgi) - os=-irix + os=irix ;; *-siemens) - os=-sysv4 + os=sysv4 ;; *-masscomp) - os=-rtu + os=rtu ;; f30[01]-fujitsu | f700-fujitsu) - os=-uxpv + os=uxpv ;; *-rom68k) - os=-coff + os=coff ;; *-*bug) - os=-coff + os=coff ;; *-apple) - os=-macos + os=macos ;; *-atari*) - os=-mint + os=mint + ;; + *-wrs) + os=vxworks ;; *) - os=-none + os=none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) +case $vendor in + unknown) case $os in - -riscix*) + riscix*) vendor=acorn ;; - -sunos*) + sunos*) vendor=sun ;; - -cnk*|-aix*) + cnk*|-aix*) vendor=ibm ;; - -beos*) + beos*) vendor=be ;; - -hpux*) + hpux*) vendor=hp ;; - -mpeix*) + mpeix*) vendor=hp ;; - -hiux*) + hiux*) vendor=hitachi ;; - -unos*) + unos*) vendor=crds ;; - -dgux*) + dgux*) vendor=dg ;; - -luna*) + luna*) vendor=omron ;; - -genix*) + genix*) vendor=ns ;; - -mvs* | -opened*) + clix*) + vendor=intergraph + ;; + mvs* | opened*) vendor=ibm ;; - -os400*) + os400*) vendor=ibm ;; - -ptx*) + ptx*) vendor=sequent ;; - -tpf*) + tpf*) vendor=ibm ;; - -vxsim* | -vxworks* | -windiss*) + vxsim* | vxworks* | windiss*) vendor=wrs ;; - -aux*) + aux*) vendor=apple ;; - -hms*) + hms*) vendor=hitachi ;; - -mpw* | -macos*) + mpw* | macos*) vendor=apple ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + *mint | mint[0-9]* | *MiNT | MiNT[0-9]*) vendor=atari ;; - -vos*) + vos*) vendor=stratus ;; esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac -echo $basic_machine$os +echo "$cpu-$vendor-$os" exit # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" diff --git a/configure b/configure index 36905ea1..7b378b92 100755 --- a/configure +++ b/configure @@ -1,8 +1,8 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for strace 4.16. +# Generated by GNU Autoconf 2.69 for strace 5.1. # -# Report bugs to . +# Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. @@ -11,7 +11,7 @@ # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # -# Copyright (C) 1999-2017 The strace developers. +# Copyright (c) 1999-2019 The strace developers. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## @@ -269,7 +269,7 @@ fi $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and -$0: strace-devel@lists.sourceforge.net about your system, +$0: strace-devel@lists.strace.io about your system, $0: including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." @@ -582,9 +582,9 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='strace' PACKAGE_TARNAME='strace' -PACKAGE_VERSION='4.16' -PACKAGE_STRING='strace 4.16' -PACKAGE_BUGREPORT='strace-devel@lists.sourceforge.net' +PACKAGE_VERSION='5.1' +PACKAGE_STRING='strace 5.1' +PACKAGE_BUGREPORT='strace-devel@lists.strace.io' PACKAGE_URL='https://strace.io' ac_unique_file="strace.c" @@ -647,19 +647,44 @@ HAVE_M32_MPERS_FALSE HAVE_M32_MPERS_TRUE HAVE_M32_RUNTIME_FALSE HAVE_M32_RUNTIME_TRUE +USE_DEMANGLE_FALSE +USE_DEMANGLE_TRUE +libiberty_CPPFLAGS +libiberty_LDFLAGS +libiberty_LIBS USE_LIBUNWIND_FALSE USE_LIBUNWIND_TRUE +USE_LIBDW_FALSE +USE_LIBDW_TRUE +ENABLE_STACKTRACE_FALSE +ENABLE_STACKTRACE_TRUE libunwind_CPPFLAGS libunwind_LDFLAGS libunwind_LIBS +libdw_LIBS +libdw_LDFLAGS +libdw_CFLAGS +libdw_CPPFLAGS +READELF PERL +mq_LIBS +clock_LIBS +timer_LIBS dl_LIBS +SIZEOF_KERNEL_LONG_T +SIZEOF_LONG MIPS_ABI +arch_native +cc_flags_mx32 +cc_flags_m32 arch_mx32 arch_m32 arch +MANPAGE_DATE +COPYRIGHT_YEAR CODE_COVERAGE_RULES CODE_COVERAGE_LDFLAGS +CODE_COVERAGE_LIBS CODE_COVERAGE_CXXFLAGS CODE_COVERAGE_CFLAGS CODE_COVERAGE_CPPFLAGS @@ -691,7 +716,6 @@ am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE -am__quote am__include DEPDIR OBJEXT @@ -778,7 +802,8 @@ PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR -SHELL' +SHELL +am__quote' ac_subst_files='' ac_user_opts=' enable_option_checking @@ -789,7 +814,11 @@ enable_gcc_Werror with_gcov enable_code_coverage enable_arm_oabi +enable_stacktrace +with_libdw with_libunwind +with_libiberty +enable_mpers enable_valgrind enable_valgrind_memcheck enable_valgrind_helgrind @@ -1345,7 +1374,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures strace 4.16 to adapt to many kinds of systems. +\`configure' configures strace 5.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1415,7 +1444,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of strace 4.16:";; + short | recursive ) echo "Configuration of strace 5.1:";; esac cat <<\_ACEOF @@ -1435,6 +1464,14 @@ Optional Features: --enable-gcc-Werror turn on gcc's -Werror option --enable-code-coverage Whether to enable code coverage support --enable-arm-oabi enable OABI support on ARM EABI + --enable-stacktrace=yes|no|check + whether to enable stack tracing support, default is + check + --enable-mpers=yes|no|check|m32|mx32 + whether to enable multiple personalities support + required for proper decoding of structures used by + tracees with personalities that differ from the + personality of strace, default is yes. --enable-valgrind Whether to enable Valgrind on the unit tests --disable-valgrind-memcheck Whether to skip memcheck during the Valgrind tests @@ -1448,7 +1485,10 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gcov=GCOV use given GCOV for coverage (GCOV=gcov). + --with-libdw use libdw to implement stack tracing support + --with-libunwind use libunwind to implement stack tracing support + --with-libiberty use libiberty to demangle symbols in stack trace Some influential environment variables: CC C compiler command @@ -1463,7 +1503,7 @@ Some influential environment variables: Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. -Report bugs to . +Report bugs to . strace home page: . _ACEOF ac_status=$? @@ -1527,14 +1567,14 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -strace configure 4.16 +strace configure 5.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. -Copyright (C) 1999-2017 The strace developers. +Copyright (c) 1999-2019 The strace developers. _ACEOF exit fi @@ -1734,9 +1774,9 @@ $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ------------------------------------------------- ## -## Report this to strace-devel@lists.sourceforge.net ## -## ------------------------------------------------- ##" +( $as_echo "## ------------------------------------------- ## +## Report this to strace-devel@lists.strace.io ## +## ------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac @@ -2267,7 +2307,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by strace $as_me 4.16, which was +It was created by strace $as_me 5.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2619,6 +2659,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu + + ac_aux_dir= for ac_dir in . "$srcdir"/.; do if test -f "$ac_dir/install-sh"; then @@ -2650,7 +2692,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. ac_config_headers="$ac_config_headers config.h" -am__api_version='1.14' +am__api_version='1.16' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -2822,8 +2864,8 @@ test "$program_suffix" != NONE && ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` -# expand $ac_aux_dir to an absolute path -am_aux_dir=`cd $ac_aux_dir && pwd` +# Expand $ac_aux_dir to an absolute path. +am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in @@ -2842,7 +2884,7 @@ else $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi -if test x"${install_sh}" != xset; then +if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; @@ -3136,7 +3178,7 @@ fi # Define the identity of the package. PACKAGE='strace' - VERSION='4.16' + VERSION='5.1' cat >>confdefs.h <<_ACEOF @@ -3166,12 +3208,12 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: -# -# +# +# mkdir_p='$(MKDIR_P)' -# We need awk for the "check" target. The system "awk" is bad on -# some platforms. +# We need awk for the "check" target (and possibly the TAP driver). The +# system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' @@ -3218,7 +3260,7 @@ END Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation -that behaves properly: . +that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM @@ -3324,9 +3366,9 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -RPM_CHANGELOGTIME="$(LC_TIME=C date '+%a %b %d %Y')" +RPM_CHANGELOGTIME="$(LC_TIME=C date -u '+%a %b %d %Y')" -DEB_CHANGELOGTIME="$(LC_TIME=C date -R)" +DEB_CHANGELOGTIME="$(LC_TIME=C date -u -R)" ac_ext=c @@ -4180,45 +4222,45 @@ DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" - -am_make=${MAKE-make} -cat > confinc << 'END' +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} supports the include directive" >&5 +$as_echo_n "checking whether ${MAKE-make} supports the include directive... " >&6; } +cat > confinc.mk << 'END' am__doit: - @echo this is the am__doit target + @echo this is the am__doit target >confinc.out .PHONY: am__doit END -# If we don't find an include directive, just comment out the code. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 -$as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= -_am_result=none -# First try GNU make style include. -echo "include confinc" > confmf -# Ignore all kinds of additional output from 'make'. -case `$am_make -s -f confmf 2> /dev/null` in #( -*the\ am__doit\ target*) - am__include=include - am__quote= - _am_result=GNU - ;; -esac -# Now try BSD make style include. -if test "$am__include" = "#"; then - echo '.include "confinc"' > confmf - case `$am_make -s -f confmf 2> /dev/null` in #( - *the\ am__doit\ target*) - am__include=.include - am__quote="\"" - _am_result=BSD +# BSD make does it like this. +echo '.include "confinc.mk" # ignored' > confmf.BSD +# Other make implementations (GNU, Solaris 10, AIX) do it like this. +echo 'include confinc.mk # ignored' > confmf.GNU +_am_result=no +for s in GNU BSD; do + { echo "$as_me:$LINENO: ${MAKE-make} -f confmf.$s && cat confinc.out" >&5 + (${MAKE-make} -f confmf.$s && cat confinc.out) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + case $?:`cat confinc.out 2>/dev/null` in #( + '0:this is the am__doit target') : + case $s in #( + BSD) : + am__include='.include' am__quote='"' ;; #( + *) : + am__include='include' am__quote='' ;; +esac ;; #( + *) : ;; - esac -fi - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 -$as_echo "$_am_result" >&6; } -rm -f confinc confmf +esac + if test "$am__include" != "#"; then + _am_result="yes ($s style)" + break + fi +done +rm -f confinc.* confmf.* +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${_am_result}" >&5 +$as_echo "${_am_result}" >&6; } # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : @@ -4368,6 +4410,298 @@ else fi + case $ac_cv_prog_cc_stdc in #( + no) : + ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #( + *) : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 +$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } +if ${ac_cv_prog_cc_c99+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +#include + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +#define debug(...) fprintf (stderr, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + your preprocessor is broken; +#endif +#if BIG_OK +#else + your preprocessor is broken; +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\0'; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static void +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str; + int number; + float fnumber; + + while (*format) + { + switch (*format++) + { + case 's': // string + str = va_arg (args_copy, const char *); + break; + case 'd': // int + number = va_arg (args_copy, int); + break; + case 'f': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); +} + +int +main () +{ + + // Check bool. + _Bool success = false; + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + test_varargs ("s, d' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' + || dynamic_array[ni.number - 1] != 543); + + ; + return 0; +} +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c99" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c99" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c99" != xno; then : + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 +else + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if ${ac_cv_prog_cc_c89+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +struct stat; +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 +else + ac_cv_prog_cc_stdc=no +fi + +fi + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5 +$as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; } + if ${ac_cv_prog_cc_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +fi + + case $ac_cv_prog_cc_stdc in #( + no) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; #( + '') : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; #( + *) : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5 +$as_echo "$ac_cv_prog_cc_stdc" >&6; } ;; +esac + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -4855,14 +5189,14 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Winit-self" >&5 -$as_echo_n "checking whether $CC handles -Winit-self... " >&6; } -if ${gl_cv_warn_CFLAGS__Winit_self+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Wimplicit-fallthrough=5" >&5 +$as_echo_n "checking whether $CC handles -Wimplicit-fallthrough=5... " >&6; } +if ${gl_cv_warn_CFLAGS__Wimplicit_fallthrough_5+:} false; then : $as_echo_n "(cached) " >&6 else gl_save_compiler_FLAGS="$CFLAGS" - as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Winit-self" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wimplicit-fallthrough=5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4875,19 +5209,19 @@ main () } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - gl_cv_warn_CFLAGS__Winit_self=yes + gl_cv_warn_CFLAGS__Wimplicit_fallthrough_5=yes else - gl_cv_warn_CFLAGS__Winit_self=no + gl_cv_warn_CFLAGS__Wimplicit_fallthrough_5=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$gl_save_compiler_FLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Winit_self" >&5 -$as_echo "$gl_cv_warn_CFLAGS__Winit_self" >&6; } -if test "x$gl_cv_warn_CFLAGS__Winit_self" = xyes; then : - as_fn_append WARN_CFLAGS " -Winit-self" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Wimplicit_fallthrough_5" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Wimplicit_fallthrough_5" >&6; } +if test "x$gl_cv_warn_CFLAGS__Wimplicit_fallthrough_5" = xyes; then : + as_fn_append WARN_CFLAGS " -Wimplicit-fallthrough=5" fi @@ -4932,14 +5266,14 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Wlogical-op" >&5 -$as_echo_n "checking whether $CC handles -Wlogical-op... " >&6; } -if ${gl_cv_warn_CFLAGS__Wlogical_op+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Winit-self" >&5 +$as_echo_n "checking whether $CC handles -Winit-self... " >&6; } +if ${gl_cv_warn_CFLAGS__Winit_self+:} false; then : $as_echo_n "(cached) " >&6 else gl_save_compiler_FLAGS="$CFLAGS" - as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wlogical-op" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Winit-self" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -4952,19 +5286,19 @@ main () } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - gl_cv_warn_CFLAGS__Wlogical_op=yes + gl_cv_warn_CFLAGS__Winit_self=yes else - gl_cv_warn_CFLAGS__Wlogical_op=no + gl_cv_warn_CFLAGS__Winit_self=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$gl_save_compiler_FLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Wlogical_op" >&5 -$as_echo "$gl_cv_warn_CFLAGS__Wlogical_op" >&6; } -if test "x$gl_cv_warn_CFLAGS__Wlogical_op" = xyes; then : - as_fn_append WARN_CFLAGS " -Wlogical-op" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Winit_self" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Winit_self" >&6; } +if test "x$gl_cv_warn_CFLAGS__Winit_self" = xyes; then : + as_fn_append WARN_CFLAGS " -Winit-self" fi @@ -5009,14 +5343,14 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Wmissing-parameter-type" >&5 -$as_echo_n "checking whether $CC handles -Wmissing-parameter-type... " >&6; } -if ${gl_cv_warn_CFLAGS__Wmissing_parameter_type+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Winitializer-overrides" >&5 +$as_echo_n "checking whether $CC handles -Winitializer-overrides... " >&6; } +if ${gl_cv_warn_CFLAGS__Winitializer_overrides+:} false; then : $as_echo_n "(cached) " >&6 else gl_save_compiler_FLAGS="$CFLAGS" - as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wmissing-parameter-type" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Winitializer-overrides" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5029,19 +5363,19 @@ main () } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - gl_cv_warn_CFLAGS__Wmissing_parameter_type=yes + gl_cv_warn_CFLAGS__Winitializer_overrides=yes else - gl_cv_warn_CFLAGS__Wmissing_parameter_type=no + gl_cv_warn_CFLAGS__Winitializer_overrides=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$gl_save_compiler_FLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Wmissing_parameter_type" >&5 -$as_echo "$gl_cv_warn_CFLAGS__Wmissing_parameter_type" >&6; } -if test "x$gl_cv_warn_CFLAGS__Wmissing_parameter_type" = xyes; then : - as_fn_append WARN_CFLAGS " -Wmissing-parameter-type" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Winitializer_overrides" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Winitializer_overrides" >&6; } +if test "x$gl_cv_warn_CFLAGS__Winitializer_overrides" = xyes; then : + as_fn_append WARN_CFLAGS " -Winitializer-overrides" fi @@ -5086,14 +5420,14 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Wnested-externs" >&5 -$as_echo_n "checking whether $CC handles -Wnested-externs... " >&6; } -if ${gl_cv_warn_CFLAGS__Wnested_externs+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Wlogical-op" >&5 +$as_echo_n "checking whether $CC handles -Wlogical-op... " >&6; } +if ${gl_cv_warn_CFLAGS__Wlogical_op+:} false; then : $as_echo_n "(cached) " >&6 else gl_save_compiler_FLAGS="$CFLAGS" - as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wnested-externs" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wlogical-op" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5106,19 +5440,19 @@ main () } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - gl_cv_warn_CFLAGS__Wnested_externs=yes + gl_cv_warn_CFLAGS__Wlogical_op=yes else - gl_cv_warn_CFLAGS__Wnested_externs=no + gl_cv_warn_CFLAGS__Wlogical_op=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext CFLAGS="$gl_save_compiler_FLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Wnested_externs" >&5 -$as_echo "$gl_cv_warn_CFLAGS__Wnested_externs" >&6; } -if test "x$gl_cv_warn_CFLAGS__Wnested_externs" = xyes; then : - as_fn_append WARN_CFLAGS " -Wnested-externs" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Wlogical_op" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Wlogical_op" >&6; } +if test "x$gl_cv_warn_CFLAGS__Wlogical_op" = xyes; then : + as_fn_append WARN_CFLAGS " -Wlogical-op" fi @@ -5163,14 +5497,14 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Wold-style-declaration" >&5 -$as_echo_n "checking whether $CC handles -Wold-style-declaration... " >&6; } -if ${gl_cv_warn_CFLAGS__Wold_style_declaration+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Wmissing-parameter-type" >&5 +$as_echo_n "checking whether $CC handles -Wmissing-parameter-type... " >&6; } +if ${gl_cv_warn_CFLAGS__Wmissing_parameter_type+:} false; then : $as_echo_n "(cached) " >&6 else gl_save_compiler_FLAGS="$CFLAGS" - as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wold-style-declaration" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wmissing-parameter-type" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5183,7 +5517,161 @@ main () } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - gl_cv_warn_CFLAGS__Wold_style_declaration=yes + gl_cv_warn_CFLAGS__Wmissing_parameter_type=yes +else + gl_cv_warn_CFLAGS__Wmissing_parameter_type=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Wmissing_parameter_type" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Wmissing_parameter_type" >&6; } +if test "x$gl_cv_warn_CFLAGS__Wmissing_parameter_type" = xyes; then : + as_fn_append WARN_CFLAGS " -Wmissing-parameter-type" +fi + + +if test x${gl_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=yes +else + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" = xyes; then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_unknown_warnings_are_errors= +fi + + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Wnested-externs" >&5 +$as_echo_n "checking whether $CC handles -Wnested-externs... " >&6; } +if ${gl_cv_warn_CFLAGS__Wnested_externs+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wnested-externs" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Wnested_externs=yes +else + gl_cv_warn_CFLAGS__Wnested_externs=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Wnested_externs" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Wnested_externs" >&6; } +if test "x$gl_cv_warn_CFLAGS__Wnested_externs" = xyes; then : + as_fn_append WARN_CFLAGS " -Wnested-externs" +fi + + +if test x${gl_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=yes +else + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" = xyes; then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_unknown_warnings_are_errors= +fi + + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Wold-style-declaration" >&5 +$as_echo_n "checking whether $CC handles -Wold-style-declaration... " >&6; } +if ${gl_cv_warn_CFLAGS__Wold_style_declaration+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Wold-style-declaration" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Wold_style_declaration=yes else gl_cv_warn_CFLAGS__Wold_style_declaration=no fi @@ -5315,6 +5803,83 @@ else fi +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Woverride-init" >&5 +$as_echo_n "checking whether $CC handles -Woverride-init... " >&6; } +if ${gl_cv_warn_CFLAGS__Woverride_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Woverride-init" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Woverride_init=yes +else + gl_cv_warn_CFLAGS__Woverride_init=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Woverride_init" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Woverride_init" >&6; } +if test "x$gl_cv_warn_CFLAGS__Woverride_init" = xyes; then : + as_fn_append WARN_CFLAGS " -Woverride-init" +fi + + +if test x${gl_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS" + as_fn_append CFLAGS " $gl_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=yes +else + gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + CFLAGS="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS__Werror__Wunknown_warning_option" = xyes; then : + gl_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_unknown_warnings_are_errors= +fi + + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC handles -Wsign-compare" >&5 @@ -6860,14 +7425,14 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Winit-self" >&5 -$as_echo_n "checking whether $CC_FOR_BUILD handles -Winit-self... " >&6; } -if ${gl_cv_warn_CFLAGS_FOR_BUILD__Winit_self+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Wimplicit-fallthrough=5" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Wimplicit-fallthrough=5... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Wimplicit_fallthrough_5+:} false; then : $as_echo_n "(cached) " >&6 else gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" - as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Winit-self" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Wimplicit-fallthrough=5" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6880,19 +7445,19 @@ main () } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - gl_cv_warn_CFLAGS_FOR_BUILD__Winit_self=yes + gl_cv_warn_CFLAGS_FOR_BUILD__Wimplicit_fallthrough_5=yes else - gl_cv_warn_CFLAGS_FOR_BUILD__Winit_self=no + gl_cv_warn_CFLAGS_FOR_BUILD__Wimplicit_fallthrough_5=no fi rm -f core conftest.err conftest.$ac_build_objext \ conftest$ac_build_exeext conftest.$ac_ext CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Winit_self" >&5 -$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Winit_self" >&6; } -if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Winit_self" = xyes; then : - as_fn_append WARN_CFLAGS_FOR_BUILD " -Winit-self" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Wimplicit_fallthrough_5" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Wimplicit_fallthrough_5" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Wimplicit_fallthrough_5" = xyes; then : + as_fn_append WARN_CFLAGS_FOR_BUILD " -Wimplicit-fallthrough=5" fi @@ -6937,14 +7502,14 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Wlogical-op" >&5 -$as_echo_n "checking whether $CC_FOR_BUILD handles -Wlogical-op... " >&6; } -if ${gl_cv_warn_CFLAGS_FOR_BUILD__Wlogical_op+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Winit-self" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Winit-self... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Winit_self+:} false; then : $as_echo_n "(cached) " >&6 else gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" - as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Wlogical-op" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Winit-self" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6957,19 +7522,19 @@ main () } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - gl_cv_warn_CFLAGS_FOR_BUILD__Wlogical_op=yes + gl_cv_warn_CFLAGS_FOR_BUILD__Winit_self=yes else - gl_cv_warn_CFLAGS_FOR_BUILD__Wlogical_op=no + gl_cv_warn_CFLAGS_FOR_BUILD__Winit_self=no fi rm -f core conftest.err conftest.$ac_build_objext \ conftest$ac_build_exeext conftest.$ac_ext CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Wlogical_op" >&5 -$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Wlogical_op" >&6; } -if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Wlogical_op" = xyes; then : - as_fn_append WARN_CFLAGS_FOR_BUILD " -Wlogical-op" +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Winit_self" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Winit_self" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Winit_self" = xyes; then : + as_fn_append WARN_CFLAGS_FOR_BUILD " -Winit-self" fi @@ -7014,14 +7579,168 @@ fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Wmissing-parameter-type" >&5 -$as_echo_n "checking whether $CC_FOR_BUILD handles -Wmissing-parameter-type... " >&6; } -if ${gl_cv_warn_CFLAGS_FOR_BUILD__Wmissing_parameter_type+:} false; then : +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Winitializer-overrides" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Winitializer-overrides... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Winitializer_overrides+:} false; then : $as_echo_n "(cached) " >&6 else gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" - as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Wmissing-parameter-type" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Winitializer-overrides" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Winitializer_overrides=yes +else + gl_cv_warn_CFLAGS_FOR_BUILD__Winitializer_overrides=no +fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Winitializer_overrides" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Winitializer_overrides" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Winitializer_overrides" = xyes; then : + as_fn_append WARN_CFLAGS_FOR_BUILD " -Winitializer-overrides" +fi + + +if test x${gl_build_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=yes +else + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=no +fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" = xyes; then : + gl_build_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_build_unknown_warnings_are_errors= +fi + + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Wlogical-op" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Wlogical-op... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Wlogical_op+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Wlogical-op" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Wlogical_op=yes +else + gl_cv_warn_CFLAGS_FOR_BUILD__Wlogical_op=no +fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Wlogical_op" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Wlogical_op" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Wlogical_op" = xyes; then : + as_fn_append WARN_CFLAGS_FOR_BUILD " -Wlogical-op" +fi + + +if test x${gl_build_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=yes +else + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=no +fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" = xyes; then : + gl_build_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_build_unknown_warnings_are_errors= +fi + + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Wmissing-parameter-type" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Wmissing-parameter-type... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Wmissing_parameter_type+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Wmissing-parameter-type" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -7320,6 +8039,83 @@ else fi +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Woverride-init" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Woverride-init... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Woverride_init+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Woverride-init" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Woverride_init=yes +else + gl_cv_warn_CFLAGS_FOR_BUILD__Woverride_init=no +fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Woverride_init" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Woverride_init" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Woverride_init" = xyes; then : + as_fn_append WARN_CFLAGS_FOR_BUILD " -Woverride-init" +fi + + +if test x${gl_build_unknown_warnings_are_errors+set} = x; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option" >&5 +$as_echo_n "checking whether $CC_FOR_BUILD handles -Werror -Wunknown-warning-option... " >&6; } +if ${gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else + + gl_save_compiler_FLAGS="$CFLAGS_FOR_BUILD" + as_fn_append CFLAGS_FOR_BUILD " $gl_build_unknown_warnings_are_errors -Werror -Wunknown-warning-option" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=yes +else + gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option=no +fi +rm -f core conftest.err conftest.$ac_build_objext \ + conftest$ac_build_exeext conftest.$ac_ext + CFLAGS_FOR_BUILD="$gl_save_compiler_FLAGS" + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&5 +$as_echo "$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" >&6; } +if test "x$gl_cv_warn_CFLAGS_FOR_BUILD__Werror__Wunknown_warning_option" = xyes; then : + gl_build_unknown_warnings_are_errors='-Wunknown-warning-option -Werror' +else + gl_build_unknown_warnings_are_errors= +fi + + fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC_FOR_BUILD handles -Wsign-compare" >&5 @@ -8276,9 +9072,6 @@ fi fi - # List of supported lcov versions. - lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11 1.12" - # Extract the first word of "lcov", so it can be a program name with args. set dummy lcov; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -8354,56 +9147,57 @@ fi - if test "$LCOV" ; then : - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lcov version" >&5 -$as_echo_n "checking for lcov version... " >&6; } -if ${ax_cv_lcov_version+:} false; then : - $as_echo_n "(cached) " >&6 -else - - ax_cv_lcov_version=invalid - lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'` - for lcov_check_version in $lcov_version_list; do - if test "$lcov_version" = "$lcov_check_version"; then - ax_cv_lcov_version="$lcov_check_version (ok)" - fi - done - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_lcov_version" >&5 -$as_echo "$ax_cv_lcov_version" >&6; } - -else + if test -z "$LCOV" ; then : - lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list" - as_fn_error $? "$lcov_msg" "$LINENO" 5 + as_fn_error $? "To enable code coverage reporting you must have lcov installed" "$LINENO" 5 fi - case $ax_cv_lcov_version in - ""|invalid) - lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)." - as_fn_error $? "$lcov_msg" "$LINENO" 5 - LCOV="exit 0;" - ;; - esac - if test -z "$GENHTML" ; then : as_fn_error $? "Could not find genhtml from the lcov package" "$LINENO" 5 fi - CODE_COVERAGE_CPPFLAGS="-DNDEBUG" + CODE_COVERAGE_CPPFLAGS="-DENABLE_COVERAGE_GCOV -DNDEBUG" CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" - CODE_COVERAGE_LDFLAGS="-lgcov" + CODE_COVERAGE_LIBS="-lgcov" + CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS" + + + + CODE_COVERAGE_RULES_CHECK=' + -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check + $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture +' + CODE_COVERAGE_RULES_CAPTURE=' + $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS) + $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS) + -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp + $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) + @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" +' + CODE_COVERAGE_RULES_CLEAN=' +clean: code-coverage-clean +distclean: code-coverage-clean +code-coverage-clean: + -$(LCOV) --directory $(top_builddir) -z + -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) + -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete +' + +else + CODE_COVERAGE_RULES_CHECK=' + @echo "Need to reconfigure with --enable-code-coverage" +' + CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK" + CODE_COVERAGE_RULES_CLEAN='' fi @@ -8462,7 +9256,7 @@ CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\ $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ --rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) -CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULTS) +CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) CODE_COVERAGE_IGNORE_PATTERN ?= code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V)) @@ -8484,37 +9278,15 @@ code_coverage_quiet_0 = --quiet code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1))) # Use recursive makes in order to ignore errors during check -check-code-coverage: -ifeq ($(CODE_COVERAGE_ENABLED),yes) - -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check - $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture -else - @echo "Need to reconfigure with --enable-code-coverage" -endif +check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"' # Capture code coverage data -code-coverage-capture: code-coverage-capture-hook -ifeq ($(CODE_COVERAGE_ENABLED),yes) - $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS) - $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS) - -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp - $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) - @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" -else - @echo "Need to reconfigure with --enable-code-coverage" -endif +code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"' # Hook rule executed before code-coverage-capture, overridable by the user code-coverage-capture-hook: -ifeq ($(CODE_COVERAGE_ENABLED),yes) -clean: code-coverage-clean -distclean: code-coverage-clean -code-coverage-clean: - -$(LCOV) --directory $(top_builddir) -z - -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) - -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete -endif +'"$CODE_COVERAGE_RULES_CLEAN"' GITIGNOREFILES ?= GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY) @@ -8529,16 +9301,73 @@ A''M_DISTCHECK_CONFIGURE_FLAGS += --disable-code-coverage + +$as_echo "#define COPYRIGHT_YEAR \"2019\"" >>confdefs.h + +COPYRIGHT_YEAR=2019 + + + +$as_echo "#define MANPAGE_DATE \"2019-03-17\"" >>confdefs.h + +MANPAGE_DATE=2019-03-17 + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for supported architecture" >&5 $as_echo_n "checking for supported architecture... " >&6; } arch_m32= arch_mx32= +cc_flags_m32=-m32 +cc_flags_mx32=-mx32 case "$host_cpu" in +aarch64*) + arch=aarch64 + arch_m32=arm + +$as_echo "#define AARCH64 1" >>confdefs.h + + ;; +alpha*) + arch=alpha + +$as_echo "#define ALPHA 1" >>confdefs.h + + ;; +arc*) + arch=arc + +$as_echo "#define ARC 1" >>confdefs.h + + ;; +arm*) + arch=arm + +$as_echo "#define ARM 1" >>confdefs.h + + ;; +avr32*) + arch=avr32 + +$as_echo "#define AVR32 1" >>confdefs.h + + ;; bfin) arch=bfin $as_echo "#define BFIN 1" >>confdefs.h + ;; +csky*) + arch=csky + +$as_echo "#define CSKY 1" >>confdefs.h + + ;; +hppa*|parisc*) + arch=hppa + +$as_echo "#define HPPA 1" >>confdefs.h + ;; i[3456]86|pentium) arch=i386 @@ -8557,25 +9386,18 @@ m68k) $as_echo "#define M68K 1" >>confdefs.h - ;; -sparc64*) - arch=sparc64 - arch_m32=sparc - -$as_echo "#define SPARC64 1" >>confdefs.h - - ;; -sparc*) - arch=sparc - -$as_echo "#define SPARC 1" >>confdefs.h - ;; metag*) arch=metag $as_echo "#define METAG 1" >>confdefs.h + ;; +microblaze*) + arch=microblaze + +$as_echo "#define MICROBLAZE 1" >>confdefs.h + ;; mips*) arch=mips @@ -8583,10 +9405,16 @@ mips*) $as_echo "#define MIPS 1" >>confdefs.h ;; -alpha*) - arch=alpha +nios2*) + arch=nios2 -$as_echo "#define ALPHA 1" >>confdefs.h +$as_echo "#define NIOS2 1" >>confdefs.h + + ;; +or1k*) + arch=or1k + +$as_echo "#define OR1K 1" >>confdefs.h ;; powerpc*) @@ -8619,29 +9447,10 @@ $as_echo "#define POWERPC64 1" >>confdefs.h fi ;; -arm*) - arch=arm - -$as_echo "#define ARM 1" >>confdefs.h - - ;; -aarch64*) - arch=aarch64 - arch_m32=arm - -$as_echo "#define AARCH64 1" >>confdefs.h - - ;; -avr32*) - arch=avr32 - -$as_echo "#define AVR32 1" >>confdefs.h - - ;; -arc*) - arch=arc +riscv*) + arch=riscv -$as_echo "#define ARC 1" >>confdefs.h +$as_echo "#define RISCV 1" >>confdefs.h ;; s390) @@ -8652,15 +9461,11 @@ $as_echo "#define S390 1" >>confdefs.h ;; s390x) arch=s390x + arch_m32=s390 + cc_flags_m32=-m31 $as_echo "#define S390X 1" >>confdefs.h - ;; -hppa*|parisc*) - arch=hppa - -$as_echo "#define HPPA 1" >>confdefs.h - ;; sh64*) arch=sh64 @@ -8673,6 +9478,25 @@ sh*) $as_echo "#define SH 1" >>confdefs.h + ;; +sparc64*) + arch=sparc64 + arch_m32=sparc + +$as_echo "#define SPARC64 1" >>confdefs.h + + ;; +sparc*) + arch=sparc + +$as_echo "#define SPARC 1" >>confdefs.h + + ;; +tile*) + arch=tile + +$as_echo "#define TILE 1" >>confdefs.h + ;; x86?64*) arch_m32=i386 @@ -8706,58 +9530,12 @@ $as_echo "#define X32 1" >>confdefs.h fi ;; -cris|crisv10) - arch=crisv10 - -$as_echo "#define CRISV10 1" >>confdefs.h - - ;; -crisv32) - arch=crisv32 - -$as_echo "#define CRISV32 1" >>confdefs.h - - ;; -tile*) - arch=tile - -$as_echo "#define TILE 1" >>confdefs.h - - ;; -microblaze*) - arch=microblaze - -$as_echo "#define MICROBLAZE 1" >>confdefs.h - - ;; -nios2*) - arch=nios2 - -$as_echo "#define NIOS2 1" >>confdefs.h - - ;; - -or1k*) - arch=or1k - -$as_echo "#define OR1K 1" >>confdefs.h - - ;; - xtensa*) arch=xtensa $as_echo "#define XTENSA 1" >>confdefs.h ;; - -riscv*) - arch=riscv - -$as_echo "#define RISCV 1" >>confdefs.h - - ;; - *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: NO!" >&5 $as_echo "NO!" >&6; } @@ -8767,6 +9545,8 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: result: $arch" >&5 $as_echo "$arch" >&6; } +arch_native=$arch + test -n "$arch_m32" || arch_m32=$arch test -n "$arch_mx32" || @@ -8775,6 +9555,9 @@ test -n "$arch_mx32" || + + + MIPS_ABI= if test "$arch" = mips; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _MIPS_SIM" >&5 @@ -8785,7 +9568,10 @@ else if ac_fn_c_compute_int "$LINENO" "_MIPS_SIM" "st_cv__MIPS_SIM" ""; then : else - as_fn_error $? "_MIPS_SIM cannot be determined" "$LINENO" 5 + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "_MIPS_SIM cannot be determined +See \`config.log' for more details" "$LINENO" 5; } fi fi @@ -9195,7 +9981,7 @@ $as_echo "#define gid_t int" >>confdefs.h fi -for ac_func in accept4 fallocate fanotify_mark fopen64 fork fputs_unlocked fstatat ftruncate futimens if_indextoname open64 prctl preadv process_vm_readv pwritev readahead signalfd stpcpy strerror strsignal sync_file_range utimensat +for ac_func in accept4 be64toh fallocate fanotify_mark fopen64 fork fputs_unlocked fstatat ftruncate futimens iconv_open if_indextoname open64 prctl preadv process_vm_readv pwritev readahead signalfd stpcpy strerror strndup strsignal sync_file_range utimensat do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -9264,6 +10050,28 @@ _ACEOF fi +ac_fn_c_check_type "$LINENO" "struct __kernel_timespec" "ac_cv_type_struct___kernel_timespec" "#include +" +if test "x$ac_cv_type_struct___kernel_timespec" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT___KERNEL_TIMESPEC 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "struct __kernel_sock_timeval" "ac_cv_type_struct___kernel_sock_timeval" "#include +" +if test "x$ac_cv_type_struct___kernel_sock_timeval" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT___KERNEL_SOCK_TIMEVAL 1 +_ACEOF + + +fi + + ac_fn_c_check_type "$LINENO" "struct stat64" "ac_cv_type_struct_stat64" "#include #include " @@ -9296,6 +10104,16 @@ cat >>confdefs.h <<_ACEOF #define HAVE_STRUCT_USER_DESC 1 _ACEOF +ac_fn_c_check_member "$LINENO" "struct user_desc" "lm" "ac_cv_member_struct_user_desc_lm" "#include +" +if test "x$ac_cv_member_struct_user_desc_lm" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_USER_DESC_LM 1 +_ACEOF + + +fi fi @@ -9356,6 +10174,19 @@ _ACEOF fi +# For kernels that do not have v3.10-rc1~201^2~11 +ac_fn_c_check_type "$LINENO" "s390_compat_regs" "ac_cv_type_s390_compat_regs" "#include +" +if test "x$ac_cv_type_s390_compat_regs" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_S390_COMPAT_REGS 1 +_ACEOF + + +fi + + ac_fn_c_check_type "$LINENO" "struct flock" "ac_cv_type_struct_flock" "#include #include " @@ -9400,96 +10231,194 @@ _ACEOF fi - - -ac_fn_c_check_member "$LINENO" "struct timex" "tai" "ac_cv_member_struct_timex_tai" "#include +ac_fn_c_check_type "$LINENO" "struct f_owner_ex" "ac_cv_type_struct_f_owner_ex" "#include +#include " -if test "x$ac_cv_member_struct_timex_tai" = xyes; then : +if test "x$ac_cv_type_struct_f_owner_ex" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_TIMEX_TAI 1 +#define HAVE_STRUCT_F_OWNER_EX 1 _ACEOF fi - - -ac_fn_c_check_member "$LINENO" "struct utsname" "domainname" "ac_cv_member_struct_utsname_domainname" "#include +ac_fn_c_check_type "$LINENO" "struct __kernel_f_owner_ex" "ac_cv_type_struct___kernel_f_owner_ex" "#include +#include " -if test "x$ac_cv_member_struct_utsname_domainname" = xyes; then : +if test "x$ac_cv_type_struct___kernel_f_owner_ex" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_UTSNAME_DOMAINNAME 1 +#define HAVE_STRUCT___KERNEL_F_OWNER_EX 1 _ACEOF fi -ac_fn_c_check_member "$LINENO" "siginfo_t" "si_syscall" "ac_cv_member_siginfo_t_si_syscall" "#include +ac_fn_c_check_type "$LINENO" "struct crypto_report_aead" "ac_cv_type_struct_crypto_report_aead" "#include " -if test "x$ac_cv_member_siginfo_t_si_syscall" = xyes; then : +if test "x$ac_cv_type_struct_crypto_report_aead" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_SIGINFO_T_SI_SYSCALL 1 +#define HAVE_STRUCT_CRYPTO_REPORT_AEAD 1 _ACEOF fi -ac_fn_c_check_member "$LINENO" "siginfo_t" "si_timerid" "ac_cv_member_siginfo_t_si_timerid" "#include +ac_fn_c_check_type "$LINENO" "struct crypto_report_blkcipher" "ac_cv_type_struct_crypto_report_blkcipher" "#include " -if test "x$ac_cv_member_siginfo_t_si_timerid" = xyes; then : +if test "x$ac_cv_type_struct_crypto_report_blkcipher" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_SIGINFO_T_SI_TIMERID 1 +#define HAVE_STRUCT_CRYPTO_REPORT_BLKCIPHER 1 _ACEOF fi -ac_fn_c_check_member "$LINENO" "siginfo_t" "si_overrun" "ac_cv_member_siginfo_t_si_overrun" "#include +ac_fn_c_check_type "$LINENO" "struct crypto_report_cipher" "ac_cv_type_struct_crypto_report_cipher" "#include " -if test "x$ac_cv_member_siginfo_t_si_overrun" = xyes; then : +if test "x$ac_cv_type_struct_crypto_report_cipher" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_SIGINFO_T_SI_OVERRUN 1 +#define HAVE_STRUCT_CRYPTO_REPORT_CIPHER 1 _ACEOF fi - - -ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "precise_ip" "ac_cv_member_struct_perf_event_attr_precise_ip" "#include +ac_fn_c_check_type "$LINENO" "struct crypto_report_hash" "ac_cv_type_struct_crypto_report_hash" "#include " -if test "x$ac_cv_member_struct_perf_event_attr_precise_ip" = xyes; then : +if test "x$ac_cv_type_struct_crypto_report_hash" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_PERF_EVENT_ATTR_PRECISE_IP 1 +#define HAVE_STRUCT_CRYPTO_REPORT_HASH 1 _ACEOF fi -ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "mmap_data" "ac_cv_member_struct_perf_event_attr_mmap_data" "#include +ac_fn_c_check_type "$LINENO" "struct crypto_report_rng" "ac_cv_type_struct_crypto_report_rng" "#include " -if test "x$ac_cv_member_struct_perf_event_attr_mmap_data" = xyes; then : +if test "x$ac_cv_type_struct_crypto_report_rng" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_PERF_EVENT_ATTR_MMAP_DATA 1 +#define HAVE_STRUCT_CRYPTO_REPORT_RNG 1 _ACEOF fi -ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "sample_id_all" "ac_cv_member_struct_perf_event_attr_sample_id_all" "#include + + +ac_fn_c_check_type "$LINENO" "struct kcmp_epoll_slot" "ac_cv_type_struct_kcmp_epoll_slot" "#include " -if test "x$ac_cv_member_struct_perf_event_attr_sample_id_all" = xyes; then : +if test "x$ac_cv_type_struct_kcmp_epoll_slot" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_ID_ALL 1 +#define HAVE_STRUCT_KCMP_EPOLL_SLOT 1 _ACEOF fi -ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "exclude_host" "ac_cv_member_struct_perf_event_attr_exclude_host" "#include -" + + +ac_fn_c_check_type "$LINENO" "struct keyctl_kdf_params" "ac_cv_type_struct_keyctl_kdf_params" "#include +" +if test "x$ac_cv_type_struct_keyctl_kdf_params" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_KEYCTL_KDF_PARAMS 1 +_ACEOF + + +fi + + +ac_fn_c_check_member "$LINENO" "struct timex" "tai" "ac_cv_member_struct_timex_tai" "#include +" +if test "x$ac_cv_member_struct_timex_tai" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_TIMEX_TAI 1 +_ACEOF + + +fi + + +ac_fn_c_check_member "$LINENO" "struct utsname" "domainname" "ac_cv_member_struct_utsname_domainname" "#include +" +if test "x$ac_cv_member_struct_utsname_domainname" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_UTSNAME_DOMAINNAME 1 +_ACEOF + + +fi + + +ac_fn_c_check_member "$LINENO" "siginfo_t" "si_syscall" "ac_cv_member_siginfo_t_si_syscall" "#include +" +if test "x$ac_cv_member_siginfo_t_si_syscall" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_SIGINFO_T_SI_SYSCALL 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "siginfo_t" "si_timerid" "ac_cv_member_siginfo_t_si_timerid" "#include +" +if test "x$ac_cv_member_siginfo_t_si_timerid" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_SIGINFO_T_SI_TIMERID 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "siginfo_t" "si_overrun" "ac_cv_member_siginfo_t_si_overrun" "#include +" +if test "x$ac_cv_member_siginfo_t_si_overrun" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_SIGINFO_T_SI_OVERRUN 1 +_ACEOF + + +fi + + +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "precise_ip" "ac_cv_member_struct_perf_event_attr_precise_ip" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_precise_ip" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_PRECISE_IP 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "mmap_data" "ac_cv_member_struct_perf_event_attr_mmap_data" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_mmap_data" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_MMAP_DATA 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "sample_id_all" "ac_cv_member_struct_perf_event_attr_sample_id_all" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_sample_id_all" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_ID_ALL 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "exclude_host" "ac_cv_member_struct_perf_event_attr_exclude_host" "#include +" if test "x$ac_cv_member_struct_perf_event_attr_exclude_host" = xyes; then : cat >>confdefs.h <<_ACEOF @@ -9577,6 +10506,16 @@ cat >>confdefs.h <<_ACEOF _ACEOF +fi +ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "namespaces" "ac_cv_member_struct_perf_event_attr_namespaces" "#include +" +if test "x$ac_cv_member_struct_perf_event_attr_namespaces" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PERF_EVENT_ATTR_NAMESPACES 1 +_ACEOF + + fi ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "bp_type" "ac_cv_member_struct_perf_event_attr_bp_type" "#include " @@ -9670,7 +10609,7 @@ _ACEOF fi -for ac_header in asm/cachectl.h asm/sysmips.h bluetooth/bluetooth.h elf.h inttypes.h linux/bsg.h linux/dm-ioctl.h linux/dqblk_xfs.h linux/falloc.h linux/fiemap.h linux/filter.h linux/hiddev.h linux/ip_vs.h linux/ipc.h linux/mmtimer.h linux/msg.h linux/perf_event.h linux/quota.h linux/seccomp.h linux/securebits.h linux/sem.h linux/shm.h linux/userfaultfd.h linux/utsname.h mqueue.h netinet/sctp.h netipx/ipx.h scsi/sg.h stropts.h sys/conf.h sys/eventfd.h sys/fanotify.h sys/ipc.h sys/msg.h sys/quota.h sys/reg.h sys/sem.h sys/shm.h sys/signalfd.h sys/xattr.h ustat.h +for ac_header in asm/cachectl.h asm/guarded_storage.h asm/sysmips.h elf.h iconv.h inttypes.h linux/bsg.h linux/cryptouser.h linux/dm-ioctl.h linux/dqblk_xfs.h linux/falloc.h linux/fib_rules.h linux/fiemap.h linux/hiddev.h linux/if_addr.h linux/if_link.h linux/io_uring.h linux/ip_vs.h linux/ipc.h linux/kcmp.h linux/kvm.h linux/memfd.h linux/mmtimer.h linux/msg.h linux/neighbour.h linux/netfilter/ipset/ip_set.h linux/netfilter/nf_tables.h linux/netfilter/nf_tables_compat.h linux/netfilter/nfnetlink.h linux/netfilter/nfnetlink_acct.h linux/netfilter/nfnetlink_conntrack.h linux/netfilter/nfnetlink_cthelper.h linux/netfilter/nfnetlink_cttimeout.h linux/netfilter/nfnetlink_log.h linux/netfilter/nfnetlink_queue.h linux/nsfs.h linux/perf_event.h linux/quota.h linux/seccomp.h linux/securebits.h linux/sem.h linux/shm.h linux/userfaultfd.h linux/utsname.h mqueue.h netinet/sctp.h netipx/ipx.h paths.h scsi/sg.h stropts.h sys/conf.h sys/eventfd.h sys/fanotify.h sys/ipc.h sys/msg.h sys/quota.h sys/sem.h sys/shm.h sys/signalfd.h sys/xattr.h ustat.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" @@ -9727,6 +10666,21 @@ fi done +for ac_header in linux/netfilter/xt_osf.h +do : + ac_fn_c_check_header_compile "$LINENO" "linux/netfilter/xt_osf.h" "ac_cv_header_linux_netfilter_xt_osf_h" "#include +#include +" +if test "x$ac_cv_header_linux_netfilter_xt_osf_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LINUX_NETFILTER_XT_OSF_H 1 +_ACEOF + +fi + +done + + for ac_header in linux/netfilter_arp/arp_tables.h linux/netfilter_bridge/ebtables.h linux/netfilter_ipv4/ip_tables.h linux/netfilter_ipv6/ip6_tables.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` @@ -9776,2418 +10730,4926 @@ if test "x$ac_cv_header_linux_bpf_h" = xyes; then : #define HAVE_LINUX_BPF_H 1 _ACEOF - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether union bpf_attr.log_buf initialization works" >&5 -$as_echo_n "checking whether union bpf_attr.log_buf initialization works... " >&6; } -if ${st_cv_have_union_bpf_attr_log_buf+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -union bpf_attr a = { .log_buf = 0 }; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - st_cv_have_union_bpf_attr_log_buf=yes -else - st_cv_have_union_bpf_attr_log_buf=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_have_union_bpf_attr_log_buf" >&5 -$as_echo "$st_cv_have_union_bpf_attr_log_buf" >&6; } - if test $st_cv_have_union_bpf_attr_log_buf = yes; then - -$as_echo "#define HAVE_UNION_BPF_ATTR_LOG_BUF 1" >>confdefs.h + ac_fn_c_check_type "$LINENO" "struct bpf_insn" "ac_cv_type_struct_bpf_insn" "#include +" +if test "x$ac_cv_type_struct_bpf_insn" = xyes; then : - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether union bpf_attr.bpf_fd initialization works" >&5 -$as_echo_n "checking whether union bpf_attr.bpf_fd initialization works... " >&6; } -if ${st_cv_have_union_bpf_attr_bpf_fd+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -union bpf_attr a = { .bpf_fd = 0 }; - ; - return 0; -} +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_BPF_INSN 1 _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - st_cv_have_union_bpf_attr_bpf_fd=yes -else - st_cv_have_union_bpf_attr_bpf_fd=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_have_union_bpf_attr_bpf_fd" >&5 -$as_echo "$st_cv_have_union_bpf_attr_bpf_fd" >&6; } - if test $st_cv_have_union_bpf_attr_bpf_fd = yes; then -$as_echo "#define HAVE_UNION_BPF_ATTR_BPF_FD 1" >>confdefs.h - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether union bpf_attr.attach_type initialization works" >&5 -$as_echo_n "checking whether union bpf_attr.attach_type initialization works... " >&6; } -if ${st_cv_have_union_bpf_attr_attach_type+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -union bpf_attr a = { .attach_type = 0 }; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - st_cv_have_union_bpf_attr_attach_type=yes -else - st_cv_have_union_bpf_attr_attach_type=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_have_union_bpf_attr_attach_type" >&5 -$as_echo "$st_cv_have_union_bpf_attr_attach_type" >&6; } - if test $st_cv_have_union_bpf_attr_attach_type = yes; then +ac_fn_c_check_type "$LINENO" "struct bpf_map_info" "ac_cv_type_struct_bpf_map_info" "#include +" +if test "x$ac_cv_type_struct_bpf_map_info" = xyes; then : -$as_echo "#define HAVE_UNION_BPF_ATTR_ATTACH_TYPE 1" >>confdefs.h +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_BPF_MAP_INFO 1 +_ACEOF - fi fi - -done - - -ac_fn_c_check_type "$LINENO" "struct statfs" "ac_cv_type_struct_statfs" "#include -#include +ac_fn_c_check_type "$LINENO" "struct bpf_prog_info" "ac_cv_type_struct_bpf_prog_info" "#include " -if test "x$ac_cv_type_struct_statfs" = xyes; then : +if test "x$ac_cv_type_struct_bpf_prog_info" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STATFS 1 +#define HAVE_STRUCT_BPF_PROG_INFO 1 _ACEOF - ac_fn_c_check_member "$LINENO" "struct statfs" "f_frsize" "ac_cv_member_struct_statfs_f_frsize" "#include -#include +fi + + ac_fn_c_check_member "$LINENO" "struct bpf_map_info" "btf_id" "ac_cv_member_struct_bpf_map_info_btf_id" "#include " -if test "x$ac_cv_member_struct_statfs_f_frsize" = xyes; then : +if test "x$ac_cv_member_struct_bpf_map_info_btf_id" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STATFS_F_FRSIZE 1 +#define HAVE_STRUCT_BPF_MAP_INFO_BTF_ID 1 _ACEOF fi - - ac_fn_c_check_member "$LINENO" "struct statfs" "f_flags" "ac_cv_member_struct_statfs_f_flags" "#include -#include +ac_fn_c_check_member "$LINENO" "struct bpf_map_info" "btf_key_type_id" "ac_cv_member_struct_bpf_map_info_btf_key_type_id" "#include " -if test "x$ac_cv_member_struct_statfs_f_flags" = xyes; then : +if test "x$ac_cv_member_struct_bpf_map_info_btf_key_type_id" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STATFS_F_FLAGS 1 +#define HAVE_STRUCT_BPF_MAP_INFO_BTF_KEY_TYPE_ID 1 _ACEOF fi - - ac_fn_c_check_member "$LINENO" "struct statfs" "f_fsid.val" "ac_cv_member_struct_statfs_f_fsid_val" "#include -#include +ac_fn_c_check_member "$LINENO" "struct bpf_map_info" "btf_value_type_id" "ac_cv_member_struct_bpf_map_info_btf_value_type_id" "#include " -if test "x$ac_cv_member_struct_statfs_f_fsid_val" = xyes; then : +if test "x$ac_cv_member_struct_bpf_map_info_btf_value_type_id" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STATFS_F_FSID_VAL 1 +#define HAVE_STRUCT_BPF_MAP_INFO_BTF_VALUE_TYPE_ID 1 _ACEOF fi - - ac_fn_c_check_member "$LINENO" "struct statfs" "f_fsid.__val" "ac_cv_member_struct_statfs_f_fsid___val" "#include -#include +ac_fn_c_check_member "$LINENO" "struct bpf_map_info" "id" "ac_cv_member_struct_bpf_map_info_id" "#include " -if test "x$ac_cv_member_struct_statfs_f_fsid___val" = xyes; then : +if test "x$ac_cv_member_struct_bpf_map_info_id" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STATFS_F_FSID___VAL 1 +#define HAVE_STRUCT_BPF_MAP_INFO_ID 1 _ACEOF fi +ac_fn_c_check_member "$LINENO" "struct bpf_map_info" "ifindex" "ac_cv_member_struct_bpf_map_info_ifindex" "#include +" +if test "x$ac_cv_member_struct_bpf_map_info_ifindex" = xyes; then : - -fi +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_BPF_MAP_INFO_IFINDEX 1 +_ACEOF -ac_fn_c_check_type "$LINENO" "struct statfs64" "ac_cv_type_struct_statfs64" "#include -#include +fi +ac_fn_c_check_member "$LINENO" "struct bpf_map_info" "key_size" "ac_cv_member_struct_bpf_map_info_key_size" "#include " -if test "x$ac_cv_type_struct_statfs64" = xyes; then : +if test "x$ac_cv_member_struct_bpf_map_info_key_size" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STATFS64 1 +#define HAVE_STRUCT_BPF_MAP_INFO_KEY_SIZE 1 _ACEOF - ac_fn_c_check_member "$LINENO" "struct statfs64" "f_frsize" "ac_cv_member_struct_statfs64_f_frsize" "#include -#include +fi +ac_fn_c_check_member "$LINENO" "struct bpf_map_info" "map_flags" "ac_cv_member_struct_bpf_map_info_map_flags" "#include " -if test "x$ac_cv_member_struct_statfs64_f_frsize" = xyes; then : +if test "x$ac_cv_member_struct_bpf_map_info_map_flags" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STATFS64_F_FRSIZE 1 +#define HAVE_STRUCT_BPF_MAP_INFO_MAP_FLAGS 1 _ACEOF fi - - ac_fn_c_check_member "$LINENO" "struct statfs64" "f_flags" "ac_cv_member_struct_statfs64_f_flags" "#include -#include +ac_fn_c_check_member "$LINENO" "struct bpf_map_info" "max_entries" "ac_cv_member_struct_bpf_map_info_max_entries" "#include " -if test "x$ac_cv_member_struct_statfs64_f_flags" = xyes; then : +if test "x$ac_cv_member_struct_bpf_map_info_max_entries" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STATFS64_F_FLAGS 1 +#define HAVE_STRUCT_BPF_MAP_INFO_MAX_ENTRIES 1 _ACEOF fi - - ac_fn_c_check_member "$LINENO" "struct statfs64" "f_fsid.val" "ac_cv_member_struct_statfs64_f_fsid_val" "#include -#include +ac_fn_c_check_member "$LINENO" "struct bpf_map_info" "name" "ac_cv_member_struct_bpf_map_info_name" "#include " -if test "x$ac_cv_member_struct_statfs64_f_fsid_val" = xyes; then : +if test "x$ac_cv_member_struct_bpf_map_info_name" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STATFS64_F_FSID_VAL 1 +#define HAVE_STRUCT_BPF_MAP_INFO_NAME 1 _ACEOF fi - - ac_fn_c_check_member "$LINENO" "struct statfs64" "f_fsid.__val" "ac_cv_member_struct_statfs64_f_fsid___val" "#include -#include +ac_fn_c_check_member "$LINENO" "struct bpf_map_info" "type" "ac_cv_member_struct_bpf_map_info_type" "#include " -if test "x$ac_cv_member_struct_statfs64_f_fsid___val" = xyes; then : +if test "x$ac_cv_member_struct_bpf_map_info_type" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_STATFS64_F_FSID___VAL 1 +#define HAVE_STRUCT_BPF_MAP_INFO_TYPE 1 _ACEOF fi +ac_fn_c_check_member "$LINENO" "struct bpf_map_info" "value_size" "ac_cv_member_struct_bpf_map_info_value_size" "#include +" +if test "x$ac_cv_member_struct_bpf_map_info_value_size" = xyes; then : - -fi +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_BPF_MAP_INFO_VALUE_SIZE 1 +_ACEOF -ac_fn_c_check_type "$LINENO" "struct blk_user_trace_setup" "ac_cv_type_struct_blk_user_trace_setup" "#include +fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "btf_id" "ac_cv_member_struct_bpf_prog_info_btf_id" "#include " -if test "x$ac_cv_type_struct_blk_user_trace_setup" = xyes; then : +if test "x$ac_cv_member_struct_bpf_prog_info_btf_id" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_BLK_USER_TRACE_SETUP 1 +#define HAVE_STRUCT_BPF_PROG_INFO_BTF_ID 1 _ACEOF fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "created_by_uid" "ac_cv_member_struct_bpf_prog_info_created_by_uid" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_created_by_uid" = xyes; then : - -for ac_header in linux/btrfs.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "linux/btrfs.h" "ac_cv_header_linux_btrfs_h" "$ac_includes_default" -if test "x$ac_cv_header_linux_btrfs_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LINUX_BTRFS_H 1 +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_BPF_PROG_INFO_CREATED_BY_UID 1 _ACEOF - ac_fn_c_check_member "$LINENO" "struct btrfs_ioctl_feature_flags" "compat_flags" "ac_cv_member_struct_btrfs_ioctl_feature_flags_compat_flags" " #include -#include + +fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "func_info" "ac_cv_member_struct_bpf_prog_info_func_info" "#include " -if test "x$ac_cv_member_struct_btrfs_ioctl_feature_flags_compat_flags" = xyes; then : +if test "x$ac_cv_member_struct_bpf_prog_info_func_info" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS 1 +#define HAVE_STRUCT_BPF_PROG_INFO_FUNC_INFO 1 _ACEOF fi -ac_fn_c_check_member "$LINENO" "struct btrfs_ioctl_fs_info_args" "nodesize" "ac_cv_member_struct_btrfs_ioctl_fs_info_args_nodesize" " #include -#include +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "func_info_rec_size" "ac_cv_member_struct_bpf_prog_info_func_info_rec_size" "#include " -if test "x$ac_cv_member_struct_btrfs_ioctl_fs_info_args_nodesize" = xyes; then : +if test "x$ac_cv_member_struct_bpf_prog_info_func_info_rec_size" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE 1 +#define HAVE_STRUCT_BPF_PROG_INFO_FUNC_INFO_REC_SIZE 1 _ACEOF fi -ac_fn_c_check_member "$LINENO" "struct btrfs_ioctl_defrag_range_args" "start" "ac_cv_member_struct_btrfs_ioctl_defrag_range_args_start" " #include -#include +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "id" "ac_cv_member_struct_bpf_prog_info_id" "#include " -if test "x$ac_cv_member_struct_btrfs_ioctl_defrag_range_args_start" = xyes; then : +if test "x$ac_cv_member_struct_bpf_prog_info_id" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START 1 +#define HAVE_STRUCT_BPF_PROG_INFO_ID 1 _ACEOF fi -ac_fn_c_check_member "$LINENO" "struct btrfs_ioctl_search_args_v2" "buf_size" "ac_cv_member_struct_btrfs_ioctl_search_args_v2_buf_size" " #include -#include +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "ifindex" "ac_cv_member_struct_bpf_prog_info_ifindex" "#include " -if test "x$ac_cv_member_struct_btrfs_ioctl_search_args_v2_buf_size" = xyes; then : +if test "x$ac_cv_member_struct_bpf_prog_info_ifindex" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_STRUCT_BTRFS_IOCTL_SEARCH_ARGS_V2_BUF_SIZE 1 +#define HAVE_STRUCT_BPF_PROG_INFO_IFINDEX 1 _ACEOF fi - - ac_fn_c_check_decl "$LINENO" "BTRFS_COMPRESS_NONE" "ac_cv_have_decl_BTRFS_COMPRESS_NONE" " #include -#include +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "jited_func_lens" "ac_cv_member_struct_bpf_prog_info_jited_func_lens" "#include " -if test "x$ac_cv_have_decl_BTRFS_COMPRESS_NONE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi +if test "x$ac_cv_member_struct_bpf_prog_info_jited_func_lens" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_BTRFS_COMPRESS_NONE $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_JITED_FUNC_LENS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "BTRFS_COMPRESS_ZLIB" "ac_cv_have_decl_BTRFS_COMPRESS_ZLIB" " #include -#include -" -if test "x$ac_cv_have_decl_BTRFS_COMPRESS_ZLIB" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "jited_ksyms" "ac_cv_member_struct_bpf_prog_info_jited_ksyms" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_jited_ksyms" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_BTRFS_COMPRESS_ZLIB $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_JITED_KSYMS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "BTRFS_COMPRESS_LZO" "ac_cv_have_decl_BTRFS_COMPRESS_LZO" " #include -#include -" -if test "x$ac_cv_have_decl_BTRFS_COMPRESS_LZO" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "jited_line_info" "ac_cv_member_struct_bpf_prog_info_jited_line_info" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_jited_line_info" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_BTRFS_COMPRESS_LZO $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_JITED_LINE_INFO 1 _ACEOF + fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "jited_line_info_rec_size" "ac_cv_member_struct_bpf_prog_info_jited_line_info_rec_size" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_jited_line_info_rec_size" = xyes; then : -done +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_BPF_PROG_INFO_JITED_LINE_INFO_REC_SIZE 1 +_ACEOF -ac_fn_c_check_decl "$LINENO" "sys_errlist" "ac_cv_have_decl_sys_errlist" "$ac_includes_default" -if test "x$ac_cv_have_decl_sys_errlist" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "jited_prog_insns" "ac_cv_member_struct_bpf_prog_info_jited_prog_insns" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_jited_prog_insns" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_SYS_ERRLIST $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_JITED_PROG_INSNS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "PTRACE_PEEKUSER" "ac_cv_have_decl_PTRACE_PEEKUSER" "#include -" -if test "x$ac_cv_have_decl_PTRACE_PEEKUSER" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "jited_prog_len" "ac_cv_member_struct_bpf_prog_info_jited_prog_len" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_jited_prog_len" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PTRACE_PEEKUSER $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_JITED_PROG_LEN 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "PTRACE_POKEUSER" "ac_cv_have_decl_PTRACE_POKEUSER" "#include -" -if test "x$ac_cv_have_decl_PTRACE_POKEUSER" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "line_info" "ac_cv_member_struct_bpf_prog_info_line_info" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_line_info" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_PTRACE_POKEUSER $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_LINE_INFO 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "P_PID" "ac_cv_have_decl_P_PID" "#include -" -if test "x$ac_cv_have_decl_P_PID" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "line_info_rec_size" "ac_cv_member_struct_bpf_prog_info_line_info_rec_size" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_line_info_rec_size" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_P_PID $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_LINE_INFO_REC_SIZE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "P_PPID" "ac_cv_have_decl_P_PPID" "#include -" -if test "x$ac_cv_have_decl_P_PPID" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "load_time" "ac_cv_member_struct_bpf_prog_info_load_time" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_load_time" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_P_PPID $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_LOAD_TIME 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "P_PGID" "ac_cv_have_decl_P_PGID" "#include -" -if test "x$ac_cv_have_decl_P_PGID" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "map_ids" "ac_cv_member_struct_bpf_prog_info_map_ids" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_map_ids" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_P_PGID $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_MAP_IDS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "P_SID" "ac_cv_have_decl_P_SID" "#include -" -if test "x$ac_cv_have_decl_P_SID" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "name" "ac_cv_member_struct_bpf_prog_info_name" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_name" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_P_SID $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_NAME 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "P_CID" "ac_cv_have_decl_P_CID" "#include -" -if test "x$ac_cv_have_decl_P_CID" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "nr_func_info" "ac_cv_member_struct_bpf_prog_info_nr_func_info" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_nr_func_info" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_P_CID $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_NR_FUNC_INFO 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "P_UID" "ac_cv_have_decl_P_UID" "#include -" -if test "x$ac_cv_have_decl_P_UID" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "nr_jited_func_lens" "ac_cv_member_struct_bpf_prog_info_nr_jited_func_lens" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_nr_jited_func_lens" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_P_UID $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_NR_JITED_FUNC_LENS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "P_GID" "ac_cv_have_decl_P_GID" "#include -" -if test "x$ac_cv_have_decl_P_GID" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "nr_jited_ksyms" "ac_cv_member_struct_bpf_prog_info_nr_jited_ksyms" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_nr_jited_ksyms" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_P_GID $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_NR_JITED_KSYMS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "P_ALL" "ac_cv_have_decl_P_ALL" "#include -" -if test "x$ac_cv_have_decl_P_ALL" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "nr_jited_line_info" "ac_cv_member_struct_bpf_prog_info_nr_jited_line_info" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_nr_jited_line_info" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_P_ALL $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_NR_JITED_LINE_INFO 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "P_LWPID" "ac_cv_have_decl_P_LWPID" "#include -" -if test "x$ac_cv_have_decl_P_LWPID" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "nr_line_info" "ac_cv_member_struct_bpf_prog_info_nr_line_info" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_nr_line_info" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_P_LWPID $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_NR_LINE_INFO 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "LO_FLAGS_READ_ONLY" "ac_cv_have_decl_LO_FLAGS_READ_ONLY" "#include -" -if test "x$ac_cv_have_decl_LO_FLAGS_READ_ONLY" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "nr_map_ids" "ac_cv_member_struct_bpf_prog_info_nr_map_ids" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_nr_map_ids" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_LO_FLAGS_READ_ONLY $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_NR_MAP_IDS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "LO_FLAGS_USE_AOPS" "ac_cv_have_decl_LO_FLAGS_USE_AOPS" "#include -" -if test "x$ac_cv_have_decl_LO_FLAGS_USE_AOPS" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "nr_prog_tags" "ac_cv_member_struct_bpf_prog_info_nr_prog_tags" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_nr_prog_tags" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_LO_FLAGS_USE_AOPS $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_NR_PROG_TAGS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "LO_FLAGS_AUTOCLEAR" "ac_cv_have_decl_LO_FLAGS_AUTOCLEAR" "#include -" -if test "x$ac_cv_have_decl_LO_FLAGS_AUTOCLEAR" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "prog_tags" "ac_cv_member_struct_bpf_prog_info_prog_tags" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_prog_tags" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_LO_FLAGS_AUTOCLEAR $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_PROG_TAGS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "LO_FLAGS_PARTSCAN" "ac_cv_have_decl_LO_FLAGS_PARTSCAN" "#include -" -if test "x$ac_cv_have_decl_LO_FLAGS_PARTSCAN" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "run_cnt" "ac_cv_member_struct_bpf_prog_info_run_cnt" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_run_cnt" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_LO_FLAGS_PARTSCAN $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_RUN_CNT 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "LO_FLAGS_DIRECT_IO" "ac_cv_have_decl_LO_FLAGS_DIRECT_IO" "#include -" -if test "x$ac_cv_have_decl_LO_FLAGS_DIRECT_IO" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "run_time_ns" "ac_cv_member_struct_bpf_prog_info_run_time_ns" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_run_time_ns" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_LO_FLAGS_DIRECT_IO $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_RUN_TIME_NS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "CTL_PROC" "ac_cv_have_decl_CTL_PROC" "#include -#include -" -if test "x$ac_cv_have_decl_CTL_PROC" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "tag" "ac_cv_member_struct_bpf_prog_info_tag" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_tag" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CTL_PROC $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_TAG 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "CTL_ARLAN" "ac_cv_have_decl_CTL_ARLAN" "#include -#include -" -if test "x$ac_cv_have_decl_CTL_ARLAN" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "type" "ac_cv_member_struct_bpf_prog_info_type" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_type" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CTL_ARLAN $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_TYPE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "CTL_S390DBF" "ac_cv_have_decl_CTL_S390DBF" "#include -#include -" -if test "x$ac_cv_have_decl_CTL_S390DBF" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "xlated_prog_insns" "ac_cv_member_struct_bpf_prog_info_xlated_prog_insns" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_xlated_prog_insns" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CTL_S390DBF $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_XLATED_PROG_INSNS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "CTL_SUNRPC" "ac_cv_have_decl_CTL_SUNRPC" "#include -#include -" -if test "x$ac_cv_have_decl_CTL_SUNRPC" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct bpf_prog_info" "xlated_prog_len" "ac_cv_member_struct_bpf_prog_info_xlated_prog_len" "#include +" +if test "x$ac_cv_member_struct_bpf_prog_info_xlated_prog_len" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CTL_SUNRPC $ac_have_decl +#define HAVE_STRUCT_BPF_PROG_INFO_XLATED_PROG_LEN 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "CTL_PM" "ac_cv_have_decl_CTL_PM" "#include -#include -" -if test "x$ac_cv_have_decl_CTL_PM" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "attach_bpf_fd" "ac_cv_member_union_bpf_attr_attach_bpf_fd" "#include +" +if test "x$ac_cv_member_union_bpf_attr_attach_bpf_fd" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CTL_PM $ac_have_decl +#define HAVE_UNION_BPF_ATTR_ATTACH_BPF_FD 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "CTL_FRV" "ac_cv_have_decl_CTL_FRV" "#include -#include -" -if test "x$ac_cv_have_decl_CTL_FRV" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "attach_flags" "ac_cv_member_union_bpf_attr_attach_flags" "#include +" +if test "x$ac_cv_member_union_bpf_attr_attach_flags" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_CTL_FRV $ac_have_decl +#define HAVE_UNION_BPF_ATTR_ATTACH_FLAGS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_PRINTK_RATELIMIT" "ac_cv_have_decl_KERN_PRINTK_RATELIMIT" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_PRINTK_RATELIMIT" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "attach_type" "ac_cv_member_union_bpf_attr_attach_type" "#include +" +if test "x$ac_cv_member_union_bpf_attr_attach_type" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_PRINTK_RATELIMIT $ac_have_decl +#define HAVE_UNION_BPF_ATTR_ATTACH_TYPE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_PRINTK_RATELIMIT_BURST" "ac_cv_have_decl_KERN_PRINTK_RATELIMIT_BURST" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_PRINTK_RATELIMIT_BURST" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "bpf_fd" "ac_cv_member_union_bpf_attr_bpf_fd" "#include +" +if test "x$ac_cv_member_union_bpf_attr_bpf_fd" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_PRINTK_RATELIMIT_BURST $ac_have_decl +#define HAVE_UNION_BPF_ATTR_BPF_FD 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_PTY" "ac_cv_have_decl_KERN_PTY" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_PTY" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "btf" "ac_cv_member_union_bpf_attr_btf" "#include +" +if test "x$ac_cv_member_union_bpf_attr_btf" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_PTY $ac_have_decl +#define HAVE_UNION_BPF_ATTR_BTF 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_NGROUPS_MAX" "ac_cv_have_decl_KERN_NGROUPS_MAX" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_NGROUPS_MAX" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "btf_fd" "ac_cv_member_union_bpf_attr_btf_fd" "#include +" +if test "x$ac_cv_member_union_bpf_attr_btf_fd" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_NGROUPS_MAX $ac_have_decl +#define HAVE_UNION_BPF_ATTR_BTF_FD 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_SPARC_SCONS_PWROFF" "ac_cv_have_decl_KERN_SPARC_SCONS_PWROFF" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_SPARC_SCONS_PWROFF" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "btf_id" "ac_cv_member_union_bpf_attr_btf_id" "#include +" +if test "x$ac_cv_member_union_bpf_attr_btf_id" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_SPARC_SCONS_PWROFF $ac_have_decl +#define HAVE_UNION_BPF_ATTR_BTF_ID 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_HZ_TIMER" "ac_cv_have_decl_KERN_HZ_TIMER" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_HZ_TIMER" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "btf_key_type_id" "ac_cv_member_union_bpf_attr_btf_key_type_id" "#include +" +if test "x$ac_cv_member_union_bpf_attr_btf_key_type_id" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_HZ_TIMER $ac_have_decl +#define HAVE_UNION_BPF_ATTR_BTF_KEY_TYPE_ID 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_UNKNOWN_NMI_PANIC" "ac_cv_have_decl_KERN_UNKNOWN_NMI_PANIC" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_UNKNOWN_NMI_PANIC" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "btf_log_buf" "ac_cv_member_union_bpf_attr_btf_log_buf" "#include +" +if test "x$ac_cv_member_union_bpf_attr_btf_log_buf" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_UNKNOWN_NMI_PANIC $ac_have_decl +#define HAVE_UNION_BPF_ATTR_BTF_LOG_BUF 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_BOOTLOADER_TYPE" "ac_cv_have_decl_KERN_BOOTLOADER_TYPE" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_BOOTLOADER_TYPE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "btf_log_level" "ac_cv_member_union_bpf_attr_btf_log_level" "#include +" +if test "x$ac_cv_member_union_bpf_attr_btf_log_level" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_BOOTLOADER_TYPE $ac_have_decl +#define HAVE_UNION_BPF_ATTR_BTF_LOG_LEVEL 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_RANDOMIZE" "ac_cv_have_decl_KERN_RANDOMIZE" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_RANDOMIZE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "btf_log_size" "ac_cv_member_union_bpf_attr_btf_log_size" "#include +" +if test "x$ac_cv_member_union_bpf_attr_btf_log_size" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_RANDOMIZE $ac_have_decl +#define HAVE_UNION_BPF_ATTR_BTF_LOG_SIZE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_SETUID_DUMPABLE" "ac_cv_have_decl_KERN_SETUID_DUMPABLE" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_SETUID_DUMPABLE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "btf_size" "ac_cv_member_union_bpf_attr_btf_size" "#include +" +if test "x$ac_cv_member_union_bpf_attr_btf_size" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_SETUID_DUMPABLE $ac_have_decl +#define HAVE_UNION_BPF_ATTR_BTF_SIZE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_SPIN_RETRY" "ac_cv_have_decl_KERN_SPIN_RETRY" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_SPIN_RETRY" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "btf_value_type_id" "ac_cv_member_union_bpf_attr_btf_value_type_id" "#include +" +if test "x$ac_cv_member_union_bpf_attr_btf_value_type_id" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_SPIN_RETRY $ac_have_decl +#define HAVE_UNION_BPF_ATTR_BTF_VALUE_TYPE_ID 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_ACPI_VIDEO_FLAGS" "ac_cv_have_decl_KERN_ACPI_VIDEO_FLAGS" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_ACPI_VIDEO_FLAGS" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "dummy" "ac_cv_member_union_bpf_attr_dummy" "#include +" +if test "x$ac_cv_member_union_bpf_attr_dummy" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_ACPI_VIDEO_FLAGS $ac_have_decl +#define HAVE_UNION_BPF_ATTR_DUMMY 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_IA64_UNALIGNED" "ac_cv_have_decl_KERN_IA64_UNALIGNED" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_IA64_UNALIGNED" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "expected_attach_type" "ac_cv_member_union_bpf_attr_expected_attach_type" "#include +" +if test "x$ac_cv_member_union_bpf_attr_expected_attach_type" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_IA64_UNALIGNED $ac_have_decl +#define HAVE_UNION_BPF_ATTR_EXPECTED_ATTACH_TYPE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_COMPAT_LOG" "ac_cv_have_decl_KERN_COMPAT_LOG" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_COMPAT_LOG" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "file_flags" "ac_cv_member_union_bpf_attr_file_flags" "#include +" +if test "x$ac_cv_member_union_bpf_attr_file_flags" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_COMPAT_LOG $ac_have_decl +#define HAVE_UNION_BPF_ATTR_FILE_FLAGS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_MAX_LOCK_DEPTH" "ac_cv_have_decl_KERN_MAX_LOCK_DEPTH" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_MAX_LOCK_DEPTH" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "flags" "ac_cv_member_union_bpf_attr_flags" "#include +" +if test "x$ac_cv_member_union_bpf_attr_flags" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_MAX_LOCK_DEPTH $ac_have_decl +#define HAVE_UNION_BPF_ATTR_FLAGS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_NMI_WATCHDOG" "ac_cv_have_decl_KERN_NMI_WATCHDOG" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_NMI_WATCHDOG" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "func_info" "ac_cv_member_union_bpf_attr_func_info" "#include +" +if test "x$ac_cv_member_union_bpf_attr_func_info" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_NMI_WATCHDOG $ac_have_decl +#define HAVE_UNION_BPF_ATTR_FUNC_INFO 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "KERN_PANIC_ON_NMI" "ac_cv_have_decl_KERN_PANIC_ON_NMI" "#include -#include -" -if test "x$ac_cv_have_decl_KERN_PANIC_ON_NMI" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "func_info_cnt" "ac_cv_member_union_bpf_attr_func_info_cnt" "#include +" +if test "x$ac_cv_member_union_bpf_attr_func_info_cnt" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_KERN_PANIC_ON_NMI $ac_have_decl +#define HAVE_UNION_BPF_ATTR_FUNC_INFO_CNT 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_LLC" "ac_cv_have_decl_NET_LLC" "#include -#include -" -if test "x$ac_cv_have_decl_NET_LLC" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "func_info_rec_size" "ac_cv_member_union_bpf_attr_func_info_rec_size" "#include +" +if test "x$ac_cv_member_union_bpf_attr_func_info_rec_size" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_LLC $ac_have_decl +#define HAVE_UNION_BPF_ATTR_FUNC_INFO_REC_SIZE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_NETFILTER" "ac_cv_have_decl_NET_NETFILTER" "#include -#include -" -if test "x$ac_cv_have_decl_NET_NETFILTER" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "info.bpf_fd" "ac_cv_member_union_bpf_attr_info_bpf_fd" "#include +" +if test "x$ac_cv_member_union_bpf_attr_info_bpf_fd" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_NETFILTER $ac_have_decl +#define HAVE_UNION_BPF_ATTR_INFO_BPF_FD 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_DCCP" "ac_cv_have_decl_NET_DCCP" "#include -#include -" -if test "x$ac_cv_have_decl_NET_DCCP" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "info.info" "ac_cv_member_union_bpf_attr_info_info" "#include +" +if test "x$ac_cv_member_union_bpf_attr_info_info" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_DCCP $ac_have_decl +#define HAVE_UNION_BPF_ATTR_INFO_INFO 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IRDA" "ac_cv_have_decl_NET_IRDA" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IRDA" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "info.info_len" "ac_cv_member_union_bpf_attr_info_info_len" "#include +" +if test "x$ac_cv_member_union_bpf_attr_info_info_len" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IRDA $ac_have_decl +#define HAVE_UNION_BPF_ATTR_INFO_INFO_LEN 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_DESTROY_DELAY" "ac_cv_have_decl_NET_CORE_DESTROY_DELAY" "#include -#include -" -if test "x$ac_cv_have_decl_NET_CORE_DESTROY_DELAY" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "inner_map_fd" "ac_cv_member_union_bpf_attr_inner_map_fd" "#include +" +if test "x$ac_cv_member_union_bpf_attr_inner_map_fd" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_DESTROY_DELAY $ac_have_decl +#define HAVE_UNION_BPF_ATTR_INNER_MAP_FD 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_BUDGET" "ac_cv_have_decl_NET_CORE_BUDGET" "#include -#include + + +fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "insn_cnt" "ac_cv_member_union_bpf_attr_insn_cnt" "#include " -if test "x$ac_cv_have_decl_NET_CORE_BUDGET" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi +if test "x$ac_cv_member_union_bpf_attr_insn_cnt" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_BUDGET $ac_have_decl +#define HAVE_UNION_BPF_ATTR_INSN_CNT 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_AEVENT_ETIME" "ac_cv_have_decl_NET_CORE_AEVENT_ETIME" "#include -#include -" -if test "x$ac_cv_have_decl_NET_CORE_AEVENT_ETIME" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "insns" "ac_cv_member_union_bpf_attr_insns" "#include +" +if test "x$ac_cv_member_union_bpf_attr_insns" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_AEVENT_ETIME $ac_have_decl +#define HAVE_UNION_BPF_ATTR_INSNS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_AEVENT_RSEQTH" "ac_cv_have_decl_NET_CORE_AEVENT_RSEQTH" "#include -#include -" -if test "x$ac_cv_have_decl_NET_CORE_AEVENT_RSEQTH" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "kern_version" "ac_cv_member_union_bpf_attr_kern_version" "#include +" +if test "x$ac_cv_member_union_bpf_attr_kern_version" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_AEVENT_RSEQTH $ac_have_decl +#define HAVE_UNION_BPF_ATTR_KERN_VERSION 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CORE_WARNINGS" "ac_cv_have_decl_NET_CORE_WARNINGS" "#include -#include -" -if test "x$ac_cv_have_decl_NET_CORE_WARNINGS" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "key" "ac_cv_member_union_bpf_attr_key" "#include +" +if test "x$ac_cv_member_union_bpf_attr_key" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CORE_WARNINGS $ac_have_decl +#define HAVE_UNION_BPF_ATTR_KEY 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_IGMP_MAX_MSF" "ac_cv_have_decl_NET_IPV4_IGMP_MAX_MSF" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_IGMP_MAX_MSF" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "key_size" "ac_cv_member_union_bpf_attr_key_size" "#include +" +if test "x$ac_cv_member_union_bpf_attr_key_size" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_IGMP_MAX_MSF $ac_have_decl +#define HAVE_UNION_BPF_ATTR_KEY_SIZE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_NO_METRICS_SAVE" "ac_cv_have_decl_NET_TCP_NO_METRICS_SAVE" "#include -#include -" -if test "x$ac_cv_have_decl_NET_TCP_NO_METRICS_SAVE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "license" "ac_cv_member_union_bpf_attr_license" "#include +" +if test "x$ac_cv_member_union_bpf_attr_license" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_NO_METRICS_SAVE $ac_have_decl +#define HAVE_UNION_BPF_ATTR_LICENSE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_DEFAULT_WIN_SCALE" "ac_cv_have_decl_NET_TCP_DEFAULT_WIN_SCALE" "#include -#include -" -if test "x$ac_cv_have_decl_NET_TCP_DEFAULT_WIN_SCALE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "line_info" "ac_cv_member_union_bpf_attr_line_info" "#include +" +if test "x$ac_cv_member_union_bpf_attr_line_info" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_DEFAULT_WIN_SCALE $ac_have_decl +#define HAVE_UNION_BPF_ATTR_LINE_INFO 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_MODERATE_RCVBUF" "ac_cv_have_decl_NET_TCP_MODERATE_RCVBUF" "#include -#include -" -if test "x$ac_cv_have_decl_NET_TCP_MODERATE_RCVBUF" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "line_info_cnt" "ac_cv_member_union_bpf_attr_line_info_cnt" "#include +" +if test "x$ac_cv_member_union_bpf_attr_line_info_cnt" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_MODERATE_RCVBUF $ac_have_decl +#define HAVE_UNION_BPF_ATTR_LINE_INFO_CNT 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_TSO_WIN_DIVISOR" "ac_cv_have_decl_NET_TCP_TSO_WIN_DIVISOR" "#include -#include -" -if test "x$ac_cv_have_decl_NET_TCP_TSO_WIN_DIVISOR" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "line_info_rec_size" "ac_cv_member_union_bpf_attr_line_info_rec_size" "#include +" +if test "x$ac_cv_member_union_bpf_attr_line_info_rec_size" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_TSO_WIN_DIVISOR $ac_have_decl +#define HAVE_UNION_BPF_ATTR_LINE_INFO_REC_SIZE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_BIC_BETA" "ac_cv_have_decl_NET_TCP_BIC_BETA" "#include -#include -" -if test "x$ac_cv_have_decl_NET_TCP_BIC_BETA" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "log_buf" "ac_cv_member_union_bpf_attr_log_buf" "#include +" +if test "x$ac_cv_member_union_bpf_attr_log_buf" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_BIC_BETA $ac_have_decl +#define HAVE_UNION_BPF_ATTR_LOG_BUF 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR" "ac_cv_have_decl_NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "log_level" "ac_cv_member_union_bpf_attr_log_level" "#include +" +if test "x$ac_cv_member_union_bpf_attr_log_level" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR $ac_have_decl +#define HAVE_UNION_BPF_ATTR_LOG_LEVEL 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_CONG_CONTROL" "ac_cv_have_decl_NET_TCP_CONG_CONTROL" "#include -#include -" -if test "x$ac_cv_have_decl_NET_TCP_CONG_CONTROL" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "log_size" "ac_cv_member_union_bpf_attr_log_size" "#include +" +if test "x$ac_cv_member_union_bpf_attr_log_size" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_CONG_CONTROL $ac_have_decl +#define HAVE_UNION_BPF_ATTR_LOG_SIZE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_ABC" "ac_cv_have_decl_NET_TCP_ABC" "#include -#include -" -if test "x$ac_cv_have_decl_NET_TCP_ABC" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "map_fd" "ac_cv_member_union_bpf_attr_map_fd" "#include +" +if test "x$ac_cv_member_union_bpf_attr_map_fd" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_ABC $ac_have_decl +#define HAVE_UNION_BPF_ATTR_MAP_FD 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_IPFRAG_MAX_DIST" "ac_cv_have_decl_NET_IPV4_IPFRAG_MAX_DIST" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_IPFRAG_MAX_DIST" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "map_flags" "ac_cv_member_union_bpf_attr_map_flags" "#include +" +if test "x$ac_cv_member_union_bpf_attr_map_flags" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_IPFRAG_MAX_DIST $ac_have_decl +#define HAVE_UNION_BPF_ATTR_MAP_FLAGS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_MTU_PROBING" "ac_cv_have_decl_NET_TCP_MTU_PROBING" "#include -#include -" -if test "x$ac_cv_have_decl_NET_TCP_MTU_PROBING" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "map_id" "ac_cv_member_union_bpf_attr_map_id" "#include +" +if test "x$ac_cv_member_union_bpf_attr_map_id" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_MTU_PROBING $ac_have_decl +#define HAVE_UNION_BPF_ATTR_MAP_ID 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_BASE_MSS" "ac_cv_have_decl_NET_TCP_BASE_MSS" "#include -#include -" -if test "x$ac_cv_have_decl_NET_TCP_BASE_MSS" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "map_ifindex" "ac_cv_member_union_bpf_attr_map_ifindex" "#include +" +if test "x$ac_cv_member_union_bpf_attr_map_ifindex" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_BASE_MSS $ac_have_decl +#define HAVE_UNION_BPF_ATTR_MAP_IFINDEX 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS" "ac_cv_have_decl_NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "map_name" "ac_cv_member_union_bpf_attr_map_name" "#include +" +if test "x$ac_cv_member_union_bpf_attr_map_name" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS $ac_have_decl +#define HAVE_UNION_BPF_ATTR_MAP_NAME 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_DMA_COPYBREAK" "ac_cv_have_decl_NET_TCP_DMA_COPYBREAK" "#include -#include -" -if test "x$ac_cv_have_decl_NET_TCP_DMA_COPYBREAK" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "map_type" "ac_cv_member_union_bpf_attr_map_type" "#include +" +if test "x$ac_cv_member_union_bpf_attr_map_type" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_DMA_COPYBREAK $ac_have_decl +#define HAVE_UNION_BPF_ATTR_MAP_TYPE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_SLOW_START_AFTER_IDLE" "ac_cv_have_decl_NET_TCP_SLOW_START_AFTER_IDLE" "#include -#include -" -if test "x$ac_cv_have_decl_NET_TCP_SLOW_START_AFTER_IDLE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "max_entries" "ac_cv_member_union_bpf_attr_max_entries" "#include +" +if test "x$ac_cv_member_union_bpf_attr_max_entries" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_SLOW_START_AFTER_IDLE $ac_have_decl +#define HAVE_UNION_BPF_ATTR_MAX_ENTRIES 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CIPSOV4_CACHE_ENABLE" "ac_cv_have_decl_NET_CIPSOV4_CACHE_ENABLE" "#include -#include -" -if test "x$ac_cv_have_decl_NET_CIPSOV4_CACHE_ENABLE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "next_id" "ac_cv_member_union_bpf_attr_next_id" "#include +" +if test "x$ac_cv_member_union_bpf_attr_next_id" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CIPSOV4_CACHE_ENABLE $ac_have_decl +#define HAVE_UNION_BPF_ATTR_NEXT_ID 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CIPSOV4_CACHE_BUCKET_SIZE" "ac_cv_have_decl_NET_CIPSOV4_CACHE_BUCKET_SIZE" "#include -#include -" -if test "x$ac_cv_have_decl_NET_CIPSOV4_CACHE_BUCKET_SIZE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "next_key" "ac_cv_member_union_bpf_attr_next_key" "#include +" +if test "x$ac_cv_member_union_bpf_attr_next_key" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CIPSOV4_CACHE_BUCKET_SIZE $ac_have_decl +#define HAVE_UNION_BPF_ATTR_NEXT_KEY 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CIPSOV4_RBM_OPTFMT" "ac_cv_have_decl_NET_CIPSOV4_RBM_OPTFMT" "#include -#include -" -if test "x$ac_cv_have_decl_NET_CIPSOV4_RBM_OPTFMT" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "numa_node" "ac_cv_member_union_bpf_attr_numa_node" "#include +" +if test "x$ac_cv_member_union_bpf_attr_numa_node" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CIPSOV4_RBM_OPTFMT $ac_have_decl +#define HAVE_UNION_BPF_ATTR_NUMA_NODE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_CIPSOV4_RBM_STRICTVALID" "ac_cv_have_decl_NET_CIPSOV4_RBM_STRICTVALID" "#include -#include -" -if test "x$ac_cv_have_decl_NET_CIPSOV4_RBM_STRICTVALID" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "open_flags" "ac_cv_member_union_bpf_attr_open_flags" "#include +" +if test "x$ac_cv_member_union_bpf_attr_open_flags" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_CIPSOV4_RBM_STRICTVALID $ac_have_decl +#define HAVE_UNION_BPF_ATTR_OPEN_FLAGS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_AVAIL_CONG_CONTROL" "ac_cv_have_decl_NET_TCP_AVAIL_CONG_CONTROL" "#include -#include -" -if test "x$ac_cv_have_decl_NET_TCP_AVAIL_CONG_CONTROL" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi + + +fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "pathname" "ac_cv_member_union_bpf_attr_pathname" "#include +" +if test "x$ac_cv_member_union_bpf_attr_pathname" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_AVAIL_CONG_CONTROL $ac_have_decl +#define HAVE_UNION_BPF_ATTR_PATHNAME 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_ALLOWED_CONG_CONTROL" "ac_cv_have_decl_NET_TCP_ALLOWED_CONG_CONTROL" "#include -#include -" -if test "x$ac_cv_have_decl_NET_TCP_ALLOWED_CONG_CONTROL" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "prog_btf_fd" "ac_cv_member_union_bpf_attr_prog_btf_fd" "#include +" +if test "x$ac_cv_member_union_bpf_attr_prog_btf_fd" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_ALLOWED_CONG_CONTROL $ac_have_decl +#define HAVE_UNION_BPF_ATTR_PROG_BTF_FD 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_MAX_SSTHRESH" "ac_cv_have_decl_NET_TCP_MAX_SSTHRESH" "#include -#include -" -if test "x$ac_cv_have_decl_NET_TCP_MAX_SSTHRESH" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "prog_flags" "ac_cv_member_union_bpf_attr_prog_flags" "#include +" +if test "x$ac_cv_member_union_bpf_attr_prog_flags" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_MAX_SSTHRESH $ac_have_decl +#define HAVE_UNION_BPF_ATTR_PROG_FLAGS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_TCP_FRTO_RESPONSE" "ac_cv_have_decl_NET_TCP_FRTO_RESPONSE" "#include -#include -" -if test "x$ac_cv_have_decl_NET_TCP_FRTO_RESPONSE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "prog_id" "ac_cv_member_union_bpf_attr_prog_id" "#include +" +if test "x$ac_cv_member_union_bpf_attr_prog_id" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_TCP_FRTO_RESPONSE $ac_have_decl +#define HAVE_UNION_BPF_ATTR_PROG_ID 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS" "ac_cv_have_decl_NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "prog_ifindex" "ac_cv_member_union_bpf_attr_prog_ifindex" "#include +" +if test "x$ac_cv_member_union_bpf_attr_prog_ifindex" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS $ac_have_decl +#define HAVE_UNION_BPF_ATTR_PROG_IFINDEX 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_FORCE_IGMP_VERSION" "ac_cv_have_decl_NET_IPV4_CONF_FORCE_IGMP_VERSION" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_FORCE_IGMP_VERSION" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "prog_name" "ac_cv_member_union_bpf_attr_prog_name" "#include +" +if test "x$ac_cv_member_union_bpf_attr_prog_name" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_FORCE_IGMP_VERSION $ac_have_decl +#define HAVE_UNION_BPF_ATTR_PROG_NAME 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_ARP_ANNOUNCE" "ac_cv_have_decl_NET_IPV4_CONF_ARP_ANNOUNCE" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_ARP_ANNOUNCE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "prog_type" "ac_cv_member_union_bpf_attr_prog_type" "#include +" +if test "x$ac_cv_member_union_bpf_attr_prog_type" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_ARP_ANNOUNCE $ac_have_decl +#define HAVE_UNION_BPF_ATTR_PROG_TYPE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_ARP_IGNORE" "ac_cv_have_decl_NET_IPV4_CONF_ARP_IGNORE" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_ARP_IGNORE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "query.attach_flags" "ac_cv_member_union_bpf_attr_query_attach_flags" "#include +" +if test "x$ac_cv_member_union_bpf_attr_query_attach_flags" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_ARP_IGNORE $ac_have_decl +#define HAVE_UNION_BPF_ATTR_QUERY_ATTACH_FLAGS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_PROMOTE_SECONDARIES" "ac_cv_have_decl_NET_IPV4_CONF_PROMOTE_SECONDARIES" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_PROMOTE_SECONDARIES" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "query.attach_type" "ac_cv_member_union_bpf_attr_query_attach_type" "#include +" +if test "x$ac_cv_member_union_bpf_attr_query_attach_type" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_PROMOTE_SECONDARIES $ac_have_decl +#define HAVE_UNION_BPF_ATTR_QUERY_ATTACH_TYPE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_ARP_ACCEPT" "ac_cv_have_decl_NET_IPV4_CONF_ARP_ACCEPT" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_ARP_ACCEPT" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "query.prog_cnt" "ac_cv_member_union_bpf_attr_query_prog_cnt" "#include +" +if test "x$ac_cv_member_union_bpf_attr_query_prog_cnt" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_ARP_ACCEPT $ac_have_decl +#define HAVE_UNION_BPF_ATTR_QUERY_PROG_CNT 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_ARP_NOTIFY" "ac_cv_have_decl_NET_IPV4_CONF_ARP_NOTIFY" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV4_CONF_ARP_NOTIFY" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "query.prog_ids" "ac_cv_member_union_bpf_attr_query_prog_ids" "#include +" +if test "x$ac_cv_member_union_bpf_attr_query_prog_ids" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV4_CONF_ARP_NOTIFY $ac_have_decl +#define HAVE_UNION_BPF_ATTR_QUERY_PROG_IDS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV6_MLD_MAX_MSF" "ac_cv_have_decl_NET_IPV6_MLD_MAX_MSF" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV6_MLD_MAX_MSF" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "query.query_flags" "ac_cv_member_union_bpf_attr_query_query_flags" "#include +" +if test "x$ac_cv_member_union_bpf_attr_query_query_flags" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV6_MLD_MAX_MSF $ac_have_decl +#define HAVE_UNION_BPF_ATTR_QUERY_QUERY_FLAGS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS" "ac_cv_have_decl_NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS" "#include -#include -" -if test "x$ac_cv_have_decl_NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "query.target_fd" "ac_cv_member_union_bpf_attr_query_target_fd" "#include +" +if test "x$ac_cv_member_union_bpf_attr_query_target_fd" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS $ac_have_decl +#define HAVE_UNION_BPF_ATTR_QUERY_TARGET_FD 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "VM_MAX_MAP_COUNT" "ac_cv_have_decl_VM_MAX_MAP_COUNT" "#include -#include -" -if test "x$ac_cv_have_decl_VM_MAX_MAP_COUNT" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "raw_tracepoint.name" "ac_cv_member_union_bpf_attr_raw_tracepoint_name" "#include +" +if test "x$ac_cv_member_union_bpf_attr_raw_tracepoint_name" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_MAX_MAP_COUNT $ac_have_decl +#define HAVE_UNION_BPF_ATTR_RAW_TRACEPOINT_NAME 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "VM_LAPTOP_MODE" "ac_cv_have_decl_VM_LAPTOP_MODE" "#include -#include -" -if test "x$ac_cv_have_decl_VM_LAPTOP_MODE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "raw_tracepoint.prog_fd" "ac_cv_member_union_bpf_attr_raw_tracepoint_prog_fd" "#include +" +if test "x$ac_cv_member_union_bpf_attr_raw_tracepoint_prog_fd" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_LAPTOP_MODE $ac_have_decl +#define HAVE_UNION_BPF_ATTR_RAW_TRACEPOINT_PROG_FD 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "VM_BLOCK_DUMP" "ac_cv_have_decl_VM_BLOCK_DUMP" "#include -#include -" -if test "x$ac_cv_have_decl_VM_BLOCK_DUMP" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "start_id" "ac_cv_member_union_bpf_attr_start_id" "#include +" +if test "x$ac_cv_member_union_bpf_attr_start_id" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_BLOCK_DUMP $ac_have_decl +#define HAVE_UNION_BPF_ATTR_START_ID 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "VM_HUGETLB_GROUP" "ac_cv_have_decl_VM_HUGETLB_GROUP" "#include -#include -" -if test "x$ac_cv_have_decl_VM_HUGETLB_GROUP" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "target_fd" "ac_cv_member_union_bpf_attr_target_fd" "#include +" +if test "x$ac_cv_member_union_bpf_attr_target_fd" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_HUGETLB_GROUP $ac_have_decl +#define HAVE_UNION_BPF_ATTR_TARGET_FD 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "VM_VFS_CACHE_PRESSURE" "ac_cv_have_decl_VM_VFS_CACHE_PRESSURE" "#include -#include -" -if test "x$ac_cv_have_decl_VM_VFS_CACHE_PRESSURE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "task_fd_query.buf" "ac_cv_member_union_bpf_attr_task_fd_query_buf" "#include +" +if test "x$ac_cv_member_union_bpf_attr_task_fd_query_buf" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_VFS_CACHE_PRESSURE $ac_have_decl +#define HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_BUF 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "VM_LEGACY_VA_LAYOUT" "ac_cv_have_decl_VM_LEGACY_VA_LAYOUT" "#include -#include -" -if test "x$ac_cv_have_decl_VM_LEGACY_VA_LAYOUT" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "task_fd_query.buf_len" "ac_cv_member_union_bpf_attr_task_fd_query_buf_len" "#include +" +if test "x$ac_cv_member_union_bpf_attr_task_fd_query_buf_len" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_LEGACY_VA_LAYOUT $ac_have_decl +#define HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_BUF_LEN 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "VM_SWAP_TOKEN_TIMEOUT" "ac_cv_have_decl_VM_SWAP_TOKEN_TIMEOUT" "#include -#include -" -if test "x$ac_cv_have_decl_VM_SWAP_TOKEN_TIMEOUT" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "task_fd_query.fd" "ac_cv_member_union_bpf_attr_task_fd_query_fd" "#include +" +if test "x$ac_cv_member_union_bpf_attr_task_fd_query_fd" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_VM_SWAP_TOKEN_TIMEOUT $ac_have_decl +#define HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_FD 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_ANY" "ac_cv_have_decl_V4L2_FIELD_ANY" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_FIELD_ANY" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "task_fd_query.fd_type" "ac_cv_member_union_bpf_attr_task_fd_query_fd_type" "#include +" +if test "x$ac_cv_member_union_bpf_attr_task_fd_query_fd_type" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_FIELD_ANY $ac_have_decl +#define HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_FD_TYPE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_NONE" "ac_cv_have_decl_V4L2_FIELD_NONE" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_FIELD_NONE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "task_fd_query.flags" "ac_cv_member_union_bpf_attr_task_fd_query_flags" "#include +" +if test "x$ac_cv_member_union_bpf_attr_task_fd_query_flags" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_FIELD_NONE $ac_have_decl +#define HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_FLAGS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_TOP" "ac_cv_have_decl_V4L2_FIELD_TOP" "#include -#include -#include -#include + + +fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "task_fd_query.pid" "ac_cv_member_union_bpf_attr_task_fd_query_pid" "#include " -if test "x$ac_cv_have_decl_V4L2_FIELD_TOP" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test "x$ac_cv_member_union_bpf_attr_task_fd_query_pid" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_PID 1 +_ACEOF + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "task_fd_query.probe_addr" "ac_cv_member_union_bpf_attr_task_fd_query_probe_addr" "#include +" +if test "x$ac_cv_member_union_bpf_attr_task_fd_query_probe_addr" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_FIELD_TOP $ac_have_decl +#define HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_PROBE_ADDR 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_BOTTOM" "ac_cv_have_decl_V4L2_FIELD_BOTTOM" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_FIELD_BOTTOM" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "task_fd_query.probe_offset" "ac_cv_member_union_bpf_attr_task_fd_query_probe_offset" "#include +" +if test "x$ac_cv_member_union_bpf_attr_task_fd_query_probe_offset" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_FIELD_BOTTOM $ac_have_decl +#define HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_PROBE_OFFSET 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_INTERLACED" "ac_cv_have_decl_V4L2_FIELD_INTERLACED" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_FIELD_INTERLACED" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "task_fd_query.prog_id" "ac_cv_member_union_bpf_attr_task_fd_query_prog_id" "#include +" +if test "x$ac_cv_member_union_bpf_attr_task_fd_query_prog_id" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_FIELD_INTERLACED $ac_have_decl +#define HAVE_UNION_BPF_ATTR_TASK_FD_QUERY_PROG_ID 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_SEQ_TB" "ac_cv_have_decl_V4L2_FIELD_SEQ_TB" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_FIELD_SEQ_TB" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "test.data_in" "ac_cv_member_union_bpf_attr_test_data_in" "#include +" +if test "x$ac_cv_member_union_bpf_attr_test_data_in" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_FIELD_SEQ_TB $ac_have_decl +#define HAVE_UNION_BPF_ATTR_TEST_DATA_IN 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_SEQ_BT" "ac_cv_have_decl_V4L2_FIELD_SEQ_BT" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_FIELD_SEQ_BT" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "test.data_out" "ac_cv_member_union_bpf_attr_test_data_out" "#include +" +if test "x$ac_cv_member_union_bpf_attr_test_data_out" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_FIELD_SEQ_BT $ac_have_decl +#define HAVE_UNION_BPF_ATTR_TEST_DATA_OUT 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_ALTERNATE" "ac_cv_have_decl_V4L2_FIELD_ALTERNATE" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_FIELD_ALTERNATE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "test.data_size_in" "ac_cv_member_union_bpf_attr_test_data_size_in" "#include +" +if test "x$ac_cv_member_union_bpf_attr_test_data_size_in" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_FIELD_ALTERNATE $ac_have_decl +#define HAVE_UNION_BPF_ATTR_TEST_DATA_SIZE_IN 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_INTERLACED_TB" "ac_cv_have_decl_V4L2_FIELD_INTERLACED_TB" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_FIELD_INTERLACED_TB" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "test.data_size_out" "ac_cv_member_union_bpf_attr_test_data_size_out" "#include +" +if test "x$ac_cv_member_union_bpf_attr_test_data_size_out" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_FIELD_INTERLACED_TB $ac_have_decl +#define HAVE_UNION_BPF_ATTR_TEST_DATA_SIZE_OUT 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_INTERLACED_BT" "ac_cv_have_decl_V4L2_FIELD_INTERLACED_BT" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_FIELD_INTERLACED_BT" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "test.duration" "ac_cv_member_union_bpf_attr_test_duration" "#include +" +if test "x$ac_cv_member_union_bpf_attr_test_duration" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_FIELD_INTERLACED_BT $ac_have_decl +#define HAVE_UNION_BPF_ATTR_TEST_DURATION 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VIDEO_CAPTURE" "ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_CAPTURE" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_CAPTURE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "test.prog_fd" "ac_cv_member_union_bpf_attr_test_prog_fd" "#include +" +if test "x$ac_cv_member_union_bpf_attr_test_prog_fd" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE $ac_have_decl +#define HAVE_UNION_BPF_ATTR_TEST_PROG_FD 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE" "ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "test.repeat" "ac_cv_member_union_bpf_attr_test_repeat" "#include +" +if test "x$ac_cv_member_union_bpf_attr_test_repeat" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE $ac_have_decl +#define HAVE_UNION_BPF_ATTR_TEST_REPEAT 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VIDEO_OUTPUT" "ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OUTPUT" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OUTPUT" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "test.retval" "ac_cv_member_union_bpf_attr_test_retval" "#include +" +if test "x$ac_cv_member_union_bpf_attr_test_retval" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT $ac_have_decl +#define HAVE_UNION_BPF_ATTR_TEST_RETVAL 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE" "ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "value" "ac_cv_member_union_bpf_attr_value" "#include +" +if test "x$ac_cv_member_union_bpf_attr_value" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE $ac_have_decl +#define HAVE_UNION_BPF_ATTR_VALUE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VIDEO_OVERLAY" "ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OVERLAY" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OVERLAY" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "value_size" "ac_cv_member_union_bpf_attr_value_size" "#include +" +if test "x$ac_cv_member_union_bpf_attr_value_size" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OVERLAY $ac_have_decl +#define HAVE_UNION_BPF_ATTR_VALUE_SIZE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VBI_CAPTURE" "ac_cv_have_decl_V4L2_BUF_TYPE_VBI_CAPTURE" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VBI_CAPTURE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "union bpf_attr" "dummy" "ac_cv_member_union_bpf_attr_dummy" "#include +" +if test "x$ac_cv_member_union_bpf_attr_dummy" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_BUF_TYPE_VBI_CAPTURE $ac_have_decl +#define HAVE_UNION_BPF_ATTR_DUMMY 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VBI_OUTPUT" "ac_cv_have_decl_V4L2_BUF_TYPE_VBI_OUTPUT" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VBI_OUTPUT" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_BUF_TYPE_VBI_OUTPUT $ac_have_decl + + +fi + +done + + +for ac_header in bluetooth/bluetooth.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "bluetooth/bluetooth.h" "ac_cv_header_bluetooth_bluetooth_h" "$ac_includes_default" +if test "x$ac_cv_header_bluetooth_bluetooth_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_BLUETOOTH_BLUETOOTH_H 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_SLICED_VBI_CAPTURE" "ac_cv_have_decl_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE" "#include -#include -#include -#include + + ac_fn_c_check_member "$LINENO" "struct sockaddr_l2" "l2_bdaddr_type" "ac_cv_member_struct_sockaddr_l2_l2_bdaddr_type" "#include + #include " -if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi +if test "x$ac_cv_member_struct_sockaddr_l2_l2_bdaddr_type" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE $ac_have_decl +#define HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_SLICED_VBI_OUTPUT" "ac_cv_have_decl_V4L2_BUF_TYPE_SLICED_VBI_OUTPUT" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_SLICED_VBI_OUTPUT" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + +fi + + fi +done + + +ac_fn_c_check_type "$LINENO" "struct br_mdb_entry" "ac_cv_type_struct_br_mdb_entry" "#include +" +if test "x$ac_cv_type_struct_br_mdb_entry" = xyes; then : + cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_OUTPUT $ac_have_decl +#define HAVE_STRUCT_BR_MDB_ENTRY 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY" "ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_type "$LINENO" "struct br_port_msg" "ac_cv_type_struct_br_port_msg" "#include +" +if test "x$ac_cv_type_struct_br_port_msg" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY $ac_have_decl +#define HAVE_STRUCT_BR_PORT_MSG 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_TUNER_RADIO" "ac_cv_have_decl_V4L2_TUNER_RADIO" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_TUNER_RADIO" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct br_mdb_entry" "flags" "ac_cv_member_struct_br_mdb_entry_flags" "#include +" +if test "x$ac_cv_member_struct_br_mdb_entry_flags" = xyes; then : + cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_TUNER_RADIO $ac_have_decl +#define HAVE_STRUCT_BR_MDB_ENTRY_FLAGS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_TUNER_ANALOG_TV" "ac_cv_have_decl_V4L2_TUNER_ANALOG_TV" "#include -#include -#include -#include + + +fi +ac_fn_c_check_member "$LINENO" "struct br_mdb_entry" "vid" "ac_cv_member_struct_br_mdb_entry_vid" "#include " -if test "x$ac_cv_have_decl_V4L2_TUNER_ANALOG_TV" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi +if test "x$ac_cv_member_struct_br_mdb_entry_vid" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_TUNER_ANALOG_TV $ac_have_decl +#define HAVE_STRUCT_BR_MDB_ENTRY_VID 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_TUNER_DIGITAL_TV" "ac_cv_have_decl_V4L2_TUNER_DIGITAL_TV" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_TUNER_DIGITAL_TV" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi + +ac_fn_c_check_type "$LINENO" "struct dcbmsg" "ac_cv_type_struct_dcbmsg" "#include +" +if test "x$ac_cv_type_struct_dcbmsg" = xyes; then : + cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_TUNER_DIGITAL_TV $ac_have_decl +#define HAVE_STRUCT_DCBMSG 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_MEMORY_MMAP" "ac_cv_have_decl_V4L2_MEMORY_MMAP" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_MEMORY_MMAP" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_type "$LINENO" "struct ifaddrlblmsg" "ac_cv_type_struct_ifaddrlblmsg" "#include +" +if test "x$ac_cv_type_struct_ifaddrlblmsg" = xyes; then : + cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_MEMORY_MMAP $ac_have_decl +#define HAVE_STRUCT_IFADDRLBLMSG 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_MEMORY_USERPTR" "ac_cv_have_decl_V4L2_MEMORY_USERPTR" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_MEMORY_USERPTR" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_type "$LINENO" "struct netconfmsg" "ac_cv_type_struct_netconfmsg" "#include +" +if test "x$ac_cv_type_struct_netconfmsg" = xyes; then : + cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_MEMORY_USERPTR $ac_have_decl +#define HAVE_STRUCT_NETCONFMSG 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_MEMORY_OVERLAY" "ac_cv_have_decl_V4L2_MEMORY_OVERLAY" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_MEMORY_OVERLAY" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi + +ac_fn_c_check_type "$LINENO" "struct rta_mfc_stats" "ac_cv_type_struct_rta_mfc_stats" "#include +#include +" +if test "x$ac_cv_type_struct_rta_mfc_stats" = xyes; then : + cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_MEMORY_OVERLAY $ac_have_decl +#define HAVE_STRUCT_RTA_MFC_STATS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_MEMORY_DMABUF" "ac_cv_have_decl_V4L2_MEMORY_DMABUF" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_MEMORY_DMABUF" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_type "$LINENO" "struct rtvia" "ac_cv_type_struct_rtvia" "#include +#include +" +if test "x$ac_cv_type_struct_rtvia" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_MEMORY_DMABUF $ac_have_decl +#define HAVE_STRUCT_RTVIA 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_SMPTE170M" "ac_cv_have_decl_V4L2_COLORSPACE_SMPTE170M" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_COLORSPACE_SMPTE170M" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi + +ac_fn_c_check_member "$LINENO" "struct ndt_stats" "ndts_table_fulls" "ac_cv_member_struct_ndt_stats_ndts_table_fulls" "#include +" +if test "x$ac_cv_member_struct_ndt_stats_ndts_table_fulls" = xyes; then : + cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_COLORSPACE_SMPTE170M $ac_have_decl +#define HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_SMPTE240M" "ac_cv_have_decl_V4L2_COLORSPACE_SMPTE240M" "#include -#include -#include -#include + + +fi + +ac_fn_c_check_type "$LINENO" "struct ndt_config" "ac_cv_type_struct_ndt_config" "#include " -if test "x$ac_cv_have_decl_V4L2_COLORSPACE_SMPTE240M" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test "x$ac_cv_type_struct_ndt_config" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_NDT_CONFIG 1 +_ACEOF + + fi +ac_fn_c_check_type "$LINENO" "struct ndt_stats" "ac_cv_type_struct_ndt_stats" "#include +" +if test "x$ac_cv_type_struct_ndt_stats" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_COLORSPACE_SMPTE240M $ac_have_decl +#define HAVE_STRUCT_NDT_STATS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_REC709" "ac_cv_have_decl_V4L2_COLORSPACE_REC709" "#include -#include -#include -#include + + +fi + + +ac_fn_c_check_type "$LINENO" "struct ifla_bridge_id" "ac_cv_type_struct_ifla_bridge_id" "#include +#include " -if test "x$ac_cv_have_decl_V4L2_COLORSPACE_REC709" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test "x$ac_cv_type_struct_ifla_bridge_id" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_IFLA_BRIDGE_ID 1 +_ACEOF + + fi +ac_fn_c_check_type "$LINENO" "struct ifla_cacheinfo" "ac_cv_type_struct_ifla_cacheinfo" "#include +#include +" +if test "x$ac_cv_type_struct_ifla_cacheinfo" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_COLORSPACE_REC709 $ac_have_decl +#define HAVE_STRUCT_IFLA_CACHEINFO 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_BT878" "ac_cv_have_decl_V4L2_COLORSPACE_BT878" "#include -#include -#include -#include + + +fi +ac_fn_c_check_type "$LINENO" "struct ifla_port_vsi" "ac_cv_type_struct_ifla_port_vsi" "#include +#include " -if test "x$ac_cv_have_decl_V4L2_COLORSPACE_BT878" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test "x$ac_cv_type_struct_ifla_port_vsi" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_IFLA_PORT_VSI 1 +_ACEOF + + fi +ac_fn_c_check_type "$LINENO" "struct rtnl_link_stats64" "ac_cv_type_struct_rtnl_link_stats64" "#include +#include +" +if test "x$ac_cv_type_struct_rtnl_link_stats64" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_COLORSPACE_BT878 $ac_have_decl +#define HAVE_STRUCT_RTNL_LINK_STATS64 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_470_SYSTEM_M" "ac_cv_have_decl_V4L2_COLORSPACE_470_SYSTEM_M" "#include -#include -#include -#include + + +fi + +ac_fn_c_check_member "$LINENO" "struct rtnl_link_stats" "rx_nohandler" "ac_cv_member_struct_rtnl_link_stats_rx_nohandler" "#include +#include " -if test "x$ac_cv_have_decl_V4L2_COLORSPACE_470_SYSTEM_M" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test "x$ac_cv_member_struct_rtnl_link_stats_rx_nohandler" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER 1 +_ACEOF + + fi +ac_fn_c_check_member "$LINENO" "struct rtnl_link_stats64" "rx_nohandler" "ac_cv_member_struct_rtnl_link_stats64_rx_nohandler" "#include +#include +" +if test "x$ac_cv_member_struct_rtnl_link_stats64_rx_nohandler" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_COLORSPACE_470_SYSTEM_M $ac_have_decl +#define HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_470_SYSTEM_BG" "ac_cv_have_decl_V4L2_COLORSPACE_470_SYSTEM_BG" "#include -#include -#include -#include + + +fi + +ac_fn_c_check_decl "$LINENO" "IFLA_PORT_SELF" "ac_cv_have_decl_IFLA_PORT_SELF" "#include +#include " -if test "x$ac_cv_have_decl_V4L2_COLORSPACE_470_SYSTEM_BG" = xyes; then : +if test "x$ac_cv_have_decl_IFLA_PORT_SELF" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_COLORSPACE_470_SYSTEM_BG $ac_have_decl +#define HAVE_DECL_IFLA_PORT_SELF $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_JPEG" "ac_cv_have_decl_V4L2_COLORSPACE_JPEG" "#include -#include -#include -#include +ac_fn_c_check_decl "$LINENO" "IFLA_PROTINFO" "ac_cv_have_decl_IFLA_PROTINFO" "#include +#include " -if test "x$ac_cv_have_decl_V4L2_COLORSPACE_JPEG" = xyes; then : +if test "x$ac_cv_have_decl_IFLA_PROTINFO" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_COLORSPACE_JPEG $ac_have_decl +#define HAVE_DECL_IFLA_PROTINFO $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_SRGB" "ac_cv_have_decl_V4L2_COLORSPACE_SRGB" "#include -#include -#include -#include +ac_fn_c_check_decl "$LINENO" "IFLA_AF_SPEC" "ac_cv_have_decl_IFLA_AF_SPEC" "#include +#include " -if test "x$ac_cv_have_decl_V4L2_COLORSPACE_SRGB" = xyes; then : +if test "x$ac_cv_have_decl_IFLA_AF_SPEC" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_COLORSPACE_SRGB $ac_have_decl +#define HAVE_DECL_IFLA_AF_SPEC $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_PRIORITY_UNSET" "ac_cv_have_decl_V4L2_PRIORITY_UNSET" "#include -#include -#include -#include +ac_fn_c_check_decl "$LINENO" "IFLA_XDP" "ac_cv_have_decl_IFLA_XDP" "#include +#include " -if test "x$ac_cv_have_decl_V4L2_PRIORITY_UNSET" = xyes; then : +if test "x$ac_cv_have_decl_IFLA_XDP" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_PRIORITY_UNSET $ac_have_decl +#define HAVE_DECL_IFLA_XDP $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_PRIORITY_BACKGROUND" "ac_cv_have_decl_V4L2_PRIORITY_BACKGROUND" "#include -#include -#include -#include + + +ac_fn_c_check_type "$LINENO" "struct gnet_stats_basic" "ac_cv_type_struct_gnet_stats_basic" "#include " -if test "x$ac_cv_have_decl_V4L2_PRIORITY_BACKGROUND" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi +if test "x$ac_cv_type_struct_gnet_stats_basic" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_PRIORITY_BACKGROUND $ac_have_decl +#define HAVE_STRUCT_GNET_STATS_BASIC 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_PRIORITY_INTERACTIVE" "ac_cv_have_decl_V4L2_PRIORITY_INTERACTIVE" "#include -#include -#include -#include + + +fi +ac_fn_c_check_type "$LINENO" "struct gnet_stats_queue" "ac_cv_type_struct_gnet_stats_queue" "#include " -if test "x$ac_cv_have_decl_V4L2_PRIORITY_INTERACTIVE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test "x$ac_cv_type_struct_gnet_stats_queue" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_GNET_STATS_QUEUE 1 +_ACEOF + + fi +ac_fn_c_check_type "$LINENO" "struct gnet_stats_rate_est" "ac_cv_type_struct_gnet_stats_rate_est" "#include +" +if test "x$ac_cv_type_struct_gnet_stats_rate_est" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_PRIORITY_INTERACTIVE $ac_have_decl +#define HAVE_STRUCT_GNET_STATS_RATE_EST 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_PRIORITY_RECORD" "ac_cv_have_decl_V4L2_PRIORITY_RECORD" "#include -#include -#include -#include + + +fi +ac_fn_c_check_type "$LINENO" "struct gnet_stats_rate_est64" "ac_cv_type_struct_gnet_stats_rate_est64" "#include " -if test "x$ac_cv_have_decl_V4L2_PRIORITY_RECORD" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 +if test "x$ac_cv_type_struct_gnet_stats_rate_est64" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_GNET_STATS_RATE_EST64 1 +_ACEOF + + fi + +ac_fn_c_check_type "$LINENO" "struct tc_sizespec" "ac_cv_type_struct_tc_sizespec" "#include +#include +" +if test "x$ac_cv_type_struct_tc_sizespec" = xyes; then : + cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_PRIORITY_RECORD $ac_have_decl +#define HAVE_STRUCT_TC_SIZESPEC 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_FRMSIZE_TYPE_DISCRETE" "ac_cv_have_decl_V4L2_FRMSIZE_TYPE_DISCRETE" "#include -#include -#include -#include + + +fi + +ac_fn_c_check_decl "$LINENO" "TCA_STAB_DATA" "ac_cv_have_decl_TCA_STAB_DATA" "#include +#include " -if test "x$ac_cv_have_decl_V4L2_FRMSIZE_TYPE_DISCRETE" = xyes; then : +if test "x$ac_cv_have_decl_TCA_STAB_DATA" = xyes; then : ac_have_decl=1 else ac_have_decl=0 fi cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_FRMSIZE_TYPE_DISCRETE $ac_have_decl +#define HAVE_DECL_TCA_STAB_DATA $ac_have_decl _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_FRMSIZE_TYPE_CONTINUOUS" "ac_cv_have_decl_V4L2_FRMSIZE_TYPE_CONTINUOUS" "#include -#include -#include -#include + + +ac_fn_c_check_type "$LINENO" "struct fib_rule_uid_range" "ac_cv_type_struct_fib_rule_uid_range" "#include " -if test "x$ac_cv_have_decl_V4L2_FRMSIZE_TYPE_CONTINUOUS" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi +if test "x$ac_cv_type_struct_fib_rule_uid_range" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_FRMSIZE_TYPE_CONTINUOUS $ac_have_decl +#define HAVE_STRUCT_FIB_RULE_UID_RANGE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_FRMSIZE_TYPE_STEPWISE" "ac_cv_have_decl_V4L2_FRMSIZE_TYPE_STEPWISE" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_FRMSIZE_TYPE_STEPWISE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_type "$LINENO" "struct fib_rule_port_range" "ac_cv_type_struct_fib_rule_port_range" "#include +" +if test "x$ac_cv_type_struct_fib_rule_port_range" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_FRMSIZE_TYPE_STEPWISE $ac_have_decl +#define HAVE_STRUCT_FIB_RULE_PORT_RANGE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_FRMIVAL_TYPE_DISCRETE" "ac_cv_have_decl_V4L2_FRMIVAL_TYPE_DISCRETE" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_FRMIVAL_TYPE_DISCRETE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_FRMIVAL_TYPE_DISCRETE $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_FRMIVAL_TYPE_CONTINUOUS" "ac_cv_have_decl_V4L2_FRMIVAL_TYPE_CONTINUOUS" "#include -#include -#include -#include + +ac_fn_c_check_type "$LINENO" "struct statfs" "ac_cv_type_struct_statfs" "#include +#include " -if test "x$ac_cv_have_decl_V4L2_FRMIVAL_TYPE_CONTINUOUS" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi +if test "x$ac_cv_type_struct_statfs" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_FRMIVAL_TYPE_CONTINUOUS $ac_have_decl +#define HAVE_STRUCT_STATFS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_FRMIVAL_TYPE_STEPWISE" "ac_cv_have_decl_V4L2_FRMIVAL_TYPE_STEPWISE" "#include -#include -#include -#include + + + ac_fn_c_check_member "$LINENO" "struct statfs" "f_frsize" "ac_cv_member_struct_statfs_f_frsize" "#include +#include " -if test "x$ac_cv_have_decl_V4L2_FRMIVAL_TYPE_STEPWISE" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi +if test "x$ac_cv_member_struct_statfs_f_frsize" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_FRMIVAL_TYPE_STEPWISE $ac_have_decl +#define HAVE_STRUCT_STATFS_F_FRSIZE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_INTEGER" "ac_cv_have_decl_V4L2_CTRL_TYPE_INTEGER" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_INTEGER" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct statfs" "f_flags" "ac_cv_member_struct_statfs_f_flags" "#include +#include +" +if test "x$ac_cv_member_struct_statfs_f_flags" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_CTRL_TYPE_INTEGER $ac_have_decl +#define HAVE_STRUCT_STATFS_F_FLAGS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_BOOLEAN" "ac_cv_have_decl_V4L2_CTRL_TYPE_BOOLEAN" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_BOOLEAN" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct statfs" "f_fsid.val" "ac_cv_member_struct_statfs_f_fsid_val" "#include +#include +" +if test "x$ac_cv_member_struct_statfs_f_fsid_val" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_CTRL_TYPE_BOOLEAN $ac_have_decl +#define HAVE_STRUCT_STATFS_F_FSID_VAL 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_MENU" "ac_cv_have_decl_V4L2_CTRL_TYPE_MENU" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_MENU" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct statfs" "f_fsid.__val" "ac_cv_member_struct_statfs_f_fsid___val" "#include +#include +" +if test "x$ac_cv_member_struct_statfs_f_fsid___val" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_CTRL_TYPE_MENU $ac_have_decl +#define HAVE_STRUCT_STATFS_F_FSID___VAL 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_BUTTON" "ac_cv_have_decl_V4L2_CTRL_TYPE_BUTTON" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_BUTTON" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_CTRL_TYPE_BUTTON $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_INTEGER64" "ac_cv_have_decl_V4L2_CTRL_TYPE_INTEGER64" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_INTEGER64" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + fi -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_CTRL_TYPE_INTEGER64 $ac_have_decl -_ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_CTRL_CLASS" "ac_cv_have_decl_V4L2_CTRL_TYPE_CTRL_CLASS" "#include -#include -#include -#include + +ac_fn_c_check_type "$LINENO" "struct statfs64" "ac_cv_type_struct_statfs64" "#include +#include " -if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_CTRL_CLASS" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi +if test "x$ac_cv_type_struct_statfs64" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_CTRL_TYPE_CTRL_CLASS $ac_have_decl +#define HAVE_STRUCT_STATFS64 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_STRING" "ac_cv_have_decl_V4L2_CTRL_TYPE_STRING" "#include -#include -#include -#include + + + ac_fn_c_check_member "$LINENO" "struct statfs64" "f_frsize" "ac_cv_member_struct_statfs64_f_frsize" "#include +#include " -if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_STRING" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi +if test "x$ac_cv_member_struct_statfs64_f_frsize" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_CTRL_TYPE_STRING $ac_have_decl +#define HAVE_STRUCT_STATFS64_F_FRSIZE 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_BITMASK" "ac_cv_have_decl_V4L2_CTRL_TYPE_BITMASK" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_BITMASK" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct statfs64" "f_flags" "ac_cv_member_struct_statfs64_f_flags" "#include +#include +" +if test "x$ac_cv_member_struct_statfs64_f_flags" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_CTRL_TYPE_BITMASK $ac_have_decl +#define HAVE_STRUCT_STATFS64_F_FLAGS 1 _ACEOF -ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_INTEGER_MENU" "ac_cv_have_decl_V4L2_CTRL_TYPE_INTEGER_MENU" "#include -#include -#include -#include -" -if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_INTEGER_MENU" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 + + fi +ac_fn_c_check_member "$LINENO" "struct statfs64" "f_fsid.val" "ac_cv_member_struct_statfs64_f_fsid_val" "#include +#include +" +if test "x$ac_cv_member_struct_statfs64_f_fsid_val" = xyes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_V4L2_CTRL_TYPE_INTEGER_MENU $ac_have_decl +#define HAVE_STRUCT_STATFS64_F_FSID_VAL 1 _ACEOF -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BLKGETSIZE64" >&5 -$as_echo_n "checking for BLKGETSIZE64... " >&6; } -if ${ac_cv_have_blkgetsize64+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ +fi +ac_fn_c_check_member "$LINENO" "struct statfs64" "f_fsid.__val" "ac_cv_member_struct_statfs64_f_fsid___val" "#include +#include +" +if test "x$ac_cv_member_struct_statfs64_f_fsid___val" = xyes; then : -#include -#include -int -main () -{ -return !BLKGETSIZE64; - ; - return 0; -} +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_STATFS64_F_FSID___VAL 1 _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_have_blkgetsize64=yes -else - ac_cv_have_blkgetsize64=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $ac_cv_have_blkgetsize64 = yes; then -$as_echo "#define HAVE_BLKGETSIZE64 1" >>confdefs.h - fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_blkgetsize64" >&5 -$as_echo "$ac_cv_have_blkgetsize64" >&6; } - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 -$as_echo_n "checking size of long... " >&6; } -if ${ac_cv_sizeof_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : -else - if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (long) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_long=0 - fi -fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 -$as_echo "$ac_cv_sizeof_long" >&6; } +ac_fn_c_check_type "$LINENO" "struct blk_user_trace_setup" "ac_cv_type_struct_blk_user_trace_setup" "#include +" +if test "x$ac_cv_type_struct_blk_user_trace_setup" = xyes; then : cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long +#define HAVE_STRUCT_BLK_USER_TRACE_SETUP 1 _ACEOF -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 -$as_echo_n "checking size of long long... " >&6; } -if ${ac_cv_sizeof_long_long+:} false; then : - $as_echo_n "(cached) " >&6 -else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : +fi + + +ac_fn_c_check_type "$LINENO" "struct mtd_write_req" "ac_cv_type_struct_mtd_write_req" "#include +" +if test "x$ac_cv_type_struct_mtd_write_req" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_MTD_WRITE_REQ 1 +_ACEOF + + +fi + + +ac_fn_c_check_member "$LINENO" "struct ubi_attach_req" "max_beb_per1024" "ac_cv_member_struct_ubi_attach_req_max_beb_per1024" "#include +" +if test "x$ac_cv_member_struct_ubi_attach_req_max_beb_per1024" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024 1 +_ACEOF + -else - if test "$ac_cv_type_long_long" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (long long) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_long_long=0 - fi fi + +ac_fn_c_check_type "$LINENO" "struct ptp_sys_offset" "ac_cv_type_struct_ptp_sys_offset" "#include +" +if test "x$ac_cv_type_struct_ptp_sys_offset" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_PTP_SYS_OFFSET 1 +_ACEOF + + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 -$as_echo "$ac_cv_sizeof_long_long" >&6; } +ac_fn_c_check_type "$LINENO" "struct kvm_cpuid2" "ac_cv_type_struct_kvm_cpuid2" "#include +" +if test "x$ac_cv_type_struct_kvm_cpuid2" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_KVM_CPUID2 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "struct kvm_regs" "ac_cv_type_struct_kvm_regs" "#include +" +if test "x$ac_cv_type_struct_kvm_regs" = xyes; then : cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long +#define HAVE_STRUCT_KVM_REGS 1 _ACEOF -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 -$as_echo_n "checking size of off_t... " >&6; } -if ${ac_cv_sizeof_off_t+:} false; then : +fi +ac_fn_c_check_type "$LINENO" "struct kvm_sregs" "ac_cv_type_struct_kvm_sregs" "#include +" +if test "x$ac_cv_type_struct_kvm_sregs" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_KVM_SREGS 1 +_ACEOF + + +fi +ac_fn_c_check_type "$LINENO" "struct kvm_userspace_memory_region" "ac_cv_type_struct_kvm_userspace_memory_region" "#include +" +if test "x$ac_cv_type_struct_kvm_userspace_memory_region" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION 1 +_ACEOF + + +fi + + +saved_CPPFLAGS="$CPPFLAGS" + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether can be used along with " >&5 +$as_echo_n "checking whether can be used along with ... " >&6; } +if ${st_cv_linux_signal+:} false; then : $as_echo_n "(cached) " >&6 else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "#include -"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + st_cv_linux_signal=yes else - if test "$ac_cv_type_off_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (off_t) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_off_t=0 - fi + st_cv_linux_signal=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_linux_signal" >&5 +$as_echo "$st_cv_linux_signal" >&6; } +if test "x$st_cv_linux_signal" = xno; then + mkdir -p linux/linux + cp $srcdir/linux/signal.h.in linux/linux/signal.h + CPPFLAGS="$CPPFLAGS -Ilinux" fi +ac_fn_c_check_type "$LINENO" "struct __aio_sigset" "ac_cv_type_struct___aio_sigset" "#include +" +if test "x$ac_cv_type_struct___aio_sigset" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT___AIO_SIGSET 1 +_ACEOF + + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 -$as_echo "$ac_cv_sizeof_off_t" >&6; } +CPPFLAGS="$saved_CPPFLAGS" + +for ac_header in linux/btrfs.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "linux/btrfs.h" "ac_cv_header_linux_btrfs_h" "$ac_includes_default" +if test "x$ac_cv_header_linux_btrfs_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LINUX_BTRFS_H 1 +_ACEOF + + ac_fn_c_check_member "$LINENO" "struct btrfs_ioctl_feature_flags" "compat_flags" "ac_cv_member_struct_btrfs_ioctl_feature_flags_compat_flags" " #include +#include +" +if test "x$ac_cv_member_struct_btrfs_ioctl_feature_flags_compat_flags" = xyes; then : cat >>confdefs.h <<_ACEOF -#define SIZEOF_OFF_T $ac_cv_sizeof_off_t +#define HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS 1 _ACEOF -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of kernel_long_t" >&5 -$as_echo_n "checking size of kernel_long_t... " >&6; } -if ${ac_cv_sizeof_kernel_long_t+:} false; then : - $as_echo_n "(cached) " >&6 +fi +ac_fn_c_check_member "$LINENO" "struct btrfs_ioctl_fs_info_args" "nodesize" "ac_cv_member_struct_btrfs_ioctl_fs_info_args_nodesize" " #include +#include +" +if test "x$ac_cv_member_struct_btrfs_ioctl_fs_info_args_nodesize" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct btrfs_ioctl_defrag_range_args" "start" "ac_cv_member_struct_btrfs_ioctl_defrag_range_args_start" " #include +#include +" +if test "x$ac_cv_member_struct_btrfs_ioctl_defrag_range_args_start" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct btrfs_ioctl_search_args_v2" "buf_size" "ac_cv_member_struct_btrfs_ioctl_search_args_v2_buf_size" " #include +#include +" +if test "x$ac_cv_member_struct_btrfs_ioctl_search_args_v2_buf_size" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_BTRFS_IOCTL_SEARCH_ARGS_V2_BUF_SIZE 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct btrfs_ioctl_logical_ino_args" "flags" "ac_cv_member_struct_btrfs_ioctl_logical_ino_args_flags" " #include +#include +" +if test "x$ac_cv_member_struct_btrfs_ioctl_logical_ino_args_flags" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_BTRFS_IOCTL_LOGICAL_INO_ARGS_FLAGS 1 +_ACEOF + + +fi + + ac_fn_c_check_decl "$LINENO" "BTRFS_COMPRESS_NONE" "ac_cv_have_decl_BTRFS_COMPRESS_NONE" " #include +#include +" +if test "x$ac_cv_have_decl_BTRFS_COMPRESS_NONE" = xyes; then : + ac_have_decl=1 else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (kernel_long_t))" "ac_cv_sizeof_kernel_long_t" "#include \"$srcdir/kernel_types.h\" -"; then : + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_BTRFS_COMPRESS_NONE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "BTRFS_COMPRESS_ZLIB" "ac_cv_have_decl_BTRFS_COMPRESS_ZLIB" " #include +#include +" +if test "x$ac_cv_have_decl_BTRFS_COMPRESS_ZLIB" = xyes; then : + ac_have_decl=1 else - if test "$ac_cv_type_kernel_long_t" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (kernel_long_t) -See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_kernel_long_t=0 - fi + ac_have_decl=0 fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_BTRFS_COMPRESS_ZLIB $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "BTRFS_COMPRESS_LZO" "ac_cv_have_decl_BTRFS_COMPRESS_LZO" " #include +#include +" +if test "x$ac_cv_have_decl_BTRFS_COMPRESS_LZO" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_kernel_long_t" >&5 -$as_echo "$ac_cv_sizeof_kernel_long_t" >&6; } + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_BTRFS_COMPRESS_LZO $ac_have_decl +_ACEOF + +fi + +done +ac_fn_c_check_decl "$LINENO" "sys_errlist" "ac_cv_have_decl_sys_errlist" "$ac_includes_default" +if test "x$ac_cv_have_decl_sys_errlist" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi cat >>confdefs.h <<_ACEOF -#define SIZEOF_KERNEL_LONG_T $ac_cv_sizeof_kernel_long_t +#define HAVE_DECL_SYS_ERRLIST $ac_have_decl _ACEOF - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of struct i64_i32" >&5 -$as_echo_n "checking size of struct i64_i32... " >&6; } -if ${ac_cv_sizeof_struct_i64_i32+:} false; then : - $as_echo_n "(cached) " >&6 +ac_fn_c_check_decl "$LINENO" "PTRACE_PEEKUSER" "ac_cv_have_decl_PTRACE_PEEKUSER" "#include +" +if test "x$ac_cv_have_decl_PTRACE_PEEKUSER" = xyes; then : + ac_have_decl=1 else - if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct i64_i32))" "ac_cv_sizeof_struct_i64_i32" "struct i64_i32 {long long i64; int i32;}; -"; then : + ac_have_decl=0 +fi +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PTRACE_PEEKUSER $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "PTRACE_POKEUSER" "ac_cv_have_decl_PTRACE_POKEUSER" "#include +" +if test "x$ac_cv_have_decl_PTRACE_POKEUSER" = xyes; then : + ac_have_decl=1 else - if test "$ac_cv_type_struct_i64_i32" = yes; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_PTRACE_POKEUSER $ac_have_decl +_ACEOF + + +ac_fn_c_check_decl "$LINENO" "P_PID" "ac_cv_have_decl_P_PID" "#include +" +if test "x$ac_cv_have_decl_P_PID" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_P_PID $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "P_PPID" "ac_cv_have_decl_P_PPID" "#include +" +if test "x$ac_cv_have_decl_P_PPID" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_P_PPID $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "P_PGID" "ac_cv_have_decl_P_PGID" "#include +" +if test "x$ac_cv_have_decl_P_PGID" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_P_PGID $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "P_SID" "ac_cv_have_decl_P_SID" "#include +" +if test "x$ac_cv_have_decl_P_SID" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_P_SID $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "P_CID" "ac_cv_have_decl_P_CID" "#include +" +if test "x$ac_cv_have_decl_P_CID" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_P_CID $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "P_UID" "ac_cv_have_decl_P_UID" "#include +" +if test "x$ac_cv_have_decl_P_UID" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_P_UID $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "P_GID" "ac_cv_have_decl_P_GID" "#include +" +if test "x$ac_cv_have_decl_P_GID" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_P_GID $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "P_ALL" "ac_cv_have_decl_P_ALL" "#include +" +if test "x$ac_cv_have_decl_P_ALL" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_P_ALL $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "P_LWPID" "ac_cv_have_decl_P_LWPID" "#include +" +if test "x$ac_cv_have_decl_P_LWPID" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_P_LWPID $ac_have_decl +_ACEOF + + +ac_fn_c_check_decl "$LINENO" "LO_FLAGS_READ_ONLY" "ac_cv_have_decl_LO_FLAGS_READ_ONLY" "#include +" +if test "x$ac_cv_have_decl_LO_FLAGS_READ_ONLY" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_LO_FLAGS_READ_ONLY $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "LO_FLAGS_USE_AOPS" "ac_cv_have_decl_LO_FLAGS_USE_AOPS" "#include +" +if test "x$ac_cv_have_decl_LO_FLAGS_USE_AOPS" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_LO_FLAGS_USE_AOPS $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "LO_FLAGS_AUTOCLEAR" "ac_cv_have_decl_LO_FLAGS_AUTOCLEAR" "#include +" +if test "x$ac_cv_have_decl_LO_FLAGS_AUTOCLEAR" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_LO_FLAGS_AUTOCLEAR $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "LO_FLAGS_PARTSCAN" "ac_cv_have_decl_LO_FLAGS_PARTSCAN" "#include +" +if test "x$ac_cv_have_decl_LO_FLAGS_PARTSCAN" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_LO_FLAGS_PARTSCAN $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "LO_FLAGS_DIRECT_IO" "ac_cv_have_decl_LO_FLAGS_DIRECT_IO" "#include +" +if test "x$ac_cv_have_decl_LO_FLAGS_DIRECT_IO" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_LO_FLAGS_DIRECT_IO $ac_have_decl +_ACEOF + + +ac_fn_c_check_decl "$LINENO" "CTL_PROC" "ac_cv_have_decl_CTL_PROC" "#include +#include +" +if test "x$ac_cv_have_decl_CTL_PROC" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CTL_PROC $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "CTL_ARLAN" "ac_cv_have_decl_CTL_ARLAN" "#include +#include +" +if test "x$ac_cv_have_decl_CTL_ARLAN" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CTL_ARLAN $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "CTL_S390DBF" "ac_cv_have_decl_CTL_S390DBF" "#include +#include +" +if test "x$ac_cv_have_decl_CTL_S390DBF" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CTL_S390DBF $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "CTL_SUNRPC" "ac_cv_have_decl_CTL_SUNRPC" "#include +#include +" +if test "x$ac_cv_have_decl_CTL_SUNRPC" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CTL_SUNRPC $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "CTL_PM" "ac_cv_have_decl_CTL_PM" "#include +#include +" +if test "x$ac_cv_have_decl_CTL_PM" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CTL_PM $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "CTL_FRV" "ac_cv_have_decl_CTL_FRV" "#include +#include +" +if test "x$ac_cv_have_decl_CTL_FRV" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_CTL_FRV $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "KERN_PRINTK_RATELIMIT" "ac_cv_have_decl_KERN_PRINTK_RATELIMIT" "#include +#include +" +if test "x$ac_cv_have_decl_KERN_PRINTK_RATELIMIT" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_KERN_PRINTK_RATELIMIT $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "KERN_PRINTK_RATELIMIT_BURST" "ac_cv_have_decl_KERN_PRINTK_RATELIMIT_BURST" "#include +#include +" +if test "x$ac_cv_have_decl_KERN_PRINTK_RATELIMIT_BURST" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_KERN_PRINTK_RATELIMIT_BURST $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "KERN_PTY" "ac_cv_have_decl_KERN_PTY" "#include +#include +" +if test "x$ac_cv_have_decl_KERN_PTY" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_KERN_PTY $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "KERN_NGROUPS_MAX" "ac_cv_have_decl_KERN_NGROUPS_MAX" "#include +#include +" +if test "x$ac_cv_have_decl_KERN_NGROUPS_MAX" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_KERN_NGROUPS_MAX $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "KERN_SPARC_SCONS_PWROFF" "ac_cv_have_decl_KERN_SPARC_SCONS_PWROFF" "#include +#include +" +if test "x$ac_cv_have_decl_KERN_SPARC_SCONS_PWROFF" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_KERN_SPARC_SCONS_PWROFF $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "KERN_HZ_TIMER" "ac_cv_have_decl_KERN_HZ_TIMER" "#include +#include +" +if test "x$ac_cv_have_decl_KERN_HZ_TIMER" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_KERN_HZ_TIMER $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "KERN_UNKNOWN_NMI_PANIC" "ac_cv_have_decl_KERN_UNKNOWN_NMI_PANIC" "#include +#include +" +if test "x$ac_cv_have_decl_KERN_UNKNOWN_NMI_PANIC" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_KERN_UNKNOWN_NMI_PANIC $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "KERN_BOOTLOADER_TYPE" "ac_cv_have_decl_KERN_BOOTLOADER_TYPE" "#include +#include +" +if test "x$ac_cv_have_decl_KERN_BOOTLOADER_TYPE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_KERN_BOOTLOADER_TYPE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "KERN_RANDOMIZE" "ac_cv_have_decl_KERN_RANDOMIZE" "#include +#include +" +if test "x$ac_cv_have_decl_KERN_RANDOMIZE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_KERN_RANDOMIZE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "KERN_SETUID_DUMPABLE" "ac_cv_have_decl_KERN_SETUID_DUMPABLE" "#include +#include +" +if test "x$ac_cv_have_decl_KERN_SETUID_DUMPABLE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_KERN_SETUID_DUMPABLE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "KERN_SPIN_RETRY" "ac_cv_have_decl_KERN_SPIN_RETRY" "#include +#include +" +if test "x$ac_cv_have_decl_KERN_SPIN_RETRY" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_KERN_SPIN_RETRY $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "KERN_ACPI_VIDEO_FLAGS" "ac_cv_have_decl_KERN_ACPI_VIDEO_FLAGS" "#include +#include +" +if test "x$ac_cv_have_decl_KERN_ACPI_VIDEO_FLAGS" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_KERN_ACPI_VIDEO_FLAGS $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "KERN_IA64_UNALIGNED" "ac_cv_have_decl_KERN_IA64_UNALIGNED" "#include +#include +" +if test "x$ac_cv_have_decl_KERN_IA64_UNALIGNED" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_KERN_IA64_UNALIGNED $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "KERN_COMPAT_LOG" "ac_cv_have_decl_KERN_COMPAT_LOG" "#include +#include +" +if test "x$ac_cv_have_decl_KERN_COMPAT_LOG" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_KERN_COMPAT_LOG $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "KERN_MAX_LOCK_DEPTH" "ac_cv_have_decl_KERN_MAX_LOCK_DEPTH" "#include +#include +" +if test "x$ac_cv_have_decl_KERN_MAX_LOCK_DEPTH" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_KERN_MAX_LOCK_DEPTH $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "KERN_NMI_WATCHDOG" "ac_cv_have_decl_KERN_NMI_WATCHDOG" "#include +#include +" +if test "x$ac_cv_have_decl_KERN_NMI_WATCHDOG" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_KERN_NMI_WATCHDOG $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "KERN_PANIC_ON_NMI" "ac_cv_have_decl_KERN_PANIC_ON_NMI" "#include +#include +" +if test "x$ac_cv_have_decl_KERN_PANIC_ON_NMI" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_KERN_PANIC_ON_NMI $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "KERN_PANIC_ON_WARN" "ac_cv_have_decl_KERN_PANIC_ON_WARN" "#include +#include +" +if test "x$ac_cv_have_decl_KERN_PANIC_ON_WARN" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_KERN_PANIC_ON_WARN $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "KERN_PANIC_PRINT" "ac_cv_have_decl_KERN_PANIC_PRINT" "#include +#include +" +if test "x$ac_cv_have_decl_KERN_PANIC_PRINT" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_KERN_PANIC_PRINT $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_LLC" "ac_cv_have_decl_NET_LLC" "#include +#include +" +if test "x$ac_cv_have_decl_NET_LLC" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_LLC $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_NETFILTER" "ac_cv_have_decl_NET_NETFILTER" "#include +#include +" +if test "x$ac_cv_have_decl_NET_NETFILTER" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_NETFILTER $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_DCCP" "ac_cv_have_decl_NET_DCCP" "#include +#include +" +if test "x$ac_cv_have_decl_NET_DCCP" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_DCCP $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_IRDA" "ac_cv_have_decl_NET_IRDA" "#include +#include +" +if test "x$ac_cv_have_decl_NET_IRDA" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_IRDA $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_CORE_DESTROY_DELAY" "ac_cv_have_decl_NET_CORE_DESTROY_DELAY" "#include +#include +" +if test "x$ac_cv_have_decl_NET_CORE_DESTROY_DELAY" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_CORE_DESTROY_DELAY $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_CORE_BUDGET" "ac_cv_have_decl_NET_CORE_BUDGET" "#include +#include +" +if test "x$ac_cv_have_decl_NET_CORE_BUDGET" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_CORE_BUDGET $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_CORE_AEVENT_ETIME" "ac_cv_have_decl_NET_CORE_AEVENT_ETIME" "#include +#include +" +if test "x$ac_cv_have_decl_NET_CORE_AEVENT_ETIME" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_CORE_AEVENT_ETIME $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_CORE_AEVENT_RSEQTH" "ac_cv_have_decl_NET_CORE_AEVENT_RSEQTH" "#include +#include +" +if test "x$ac_cv_have_decl_NET_CORE_AEVENT_RSEQTH" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_CORE_AEVENT_RSEQTH $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_CORE_WARNINGS" "ac_cv_have_decl_NET_CORE_WARNINGS" "#include +#include +" +if test "x$ac_cv_have_decl_NET_CORE_WARNINGS" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_CORE_WARNINGS $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_IPV4_IGMP_MAX_MSF" "ac_cv_have_decl_NET_IPV4_IGMP_MAX_MSF" "#include +#include +" +if test "x$ac_cv_have_decl_NET_IPV4_IGMP_MAX_MSF" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_IPV4_IGMP_MAX_MSF $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_TCP_NO_METRICS_SAVE" "ac_cv_have_decl_NET_TCP_NO_METRICS_SAVE" "#include +#include +" +if test "x$ac_cv_have_decl_NET_TCP_NO_METRICS_SAVE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_TCP_NO_METRICS_SAVE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_TCP_DEFAULT_WIN_SCALE" "ac_cv_have_decl_NET_TCP_DEFAULT_WIN_SCALE" "#include +#include +" +if test "x$ac_cv_have_decl_NET_TCP_DEFAULT_WIN_SCALE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_TCP_DEFAULT_WIN_SCALE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_TCP_MODERATE_RCVBUF" "ac_cv_have_decl_NET_TCP_MODERATE_RCVBUF" "#include +#include +" +if test "x$ac_cv_have_decl_NET_TCP_MODERATE_RCVBUF" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_TCP_MODERATE_RCVBUF $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_TCP_TSO_WIN_DIVISOR" "ac_cv_have_decl_NET_TCP_TSO_WIN_DIVISOR" "#include +#include +" +if test "x$ac_cv_have_decl_NET_TCP_TSO_WIN_DIVISOR" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_TCP_TSO_WIN_DIVISOR $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_TCP_BIC_BETA" "ac_cv_have_decl_NET_TCP_BIC_BETA" "#include +#include +" +if test "x$ac_cv_have_decl_NET_TCP_BIC_BETA" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_TCP_BIC_BETA $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR" "ac_cv_have_decl_NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR" "#include +#include +" +if test "x$ac_cv_have_decl_NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_TCP_CONG_CONTROL" "ac_cv_have_decl_NET_TCP_CONG_CONTROL" "#include +#include +" +if test "x$ac_cv_have_decl_NET_TCP_CONG_CONTROL" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_TCP_CONG_CONTROL $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_TCP_ABC" "ac_cv_have_decl_NET_TCP_ABC" "#include +#include +" +if test "x$ac_cv_have_decl_NET_TCP_ABC" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_TCP_ABC $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_IPV4_IPFRAG_MAX_DIST" "ac_cv_have_decl_NET_IPV4_IPFRAG_MAX_DIST" "#include +#include +" +if test "x$ac_cv_have_decl_NET_IPV4_IPFRAG_MAX_DIST" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_IPV4_IPFRAG_MAX_DIST $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_TCP_MTU_PROBING" "ac_cv_have_decl_NET_TCP_MTU_PROBING" "#include +#include +" +if test "x$ac_cv_have_decl_NET_TCP_MTU_PROBING" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_TCP_MTU_PROBING $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_TCP_BASE_MSS" "ac_cv_have_decl_NET_TCP_BASE_MSS" "#include +#include +" +if test "x$ac_cv_have_decl_NET_TCP_BASE_MSS" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_TCP_BASE_MSS $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS" "ac_cv_have_decl_NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS" "#include +#include +" +if test "x$ac_cv_have_decl_NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_TCP_DMA_COPYBREAK" "ac_cv_have_decl_NET_TCP_DMA_COPYBREAK" "#include +#include +" +if test "x$ac_cv_have_decl_NET_TCP_DMA_COPYBREAK" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_TCP_DMA_COPYBREAK $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_TCP_SLOW_START_AFTER_IDLE" "ac_cv_have_decl_NET_TCP_SLOW_START_AFTER_IDLE" "#include +#include +" +if test "x$ac_cv_have_decl_NET_TCP_SLOW_START_AFTER_IDLE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_TCP_SLOW_START_AFTER_IDLE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_CIPSOV4_CACHE_ENABLE" "ac_cv_have_decl_NET_CIPSOV4_CACHE_ENABLE" "#include +#include +" +if test "x$ac_cv_have_decl_NET_CIPSOV4_CACHE_ENABLE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_CIPSOV4_CACHE_ENABLE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_CIPSOV4_CACHE_BUCKET_SIZE" "ac_cv_have_decl_NET_CIPSOV4_CACHE_BUCKET_SIZE" "#include +#include +" +if test "x$ac_cv_have_decl_NET_CIPSOV4_CACHE_BUCKET_SIZE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_CIPSOV4_CACHE_BUCKET_SIZE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_CIPSOV4_RBM_OPTFMT" "ac_cv_have_decl_NET_CIPSOV4_RBM_OPTFMT" "#include +#include +" +if test "x$ac_cv_have_decl_NET_CIPSOV4_RBM_OPTFMT" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_CIPSOV4_RBM_OPTFMT $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_CIPSOV4_RBM_STRICTVALID" "ac_cv_have_decl_NET_CIPSOV4_RBM_STRICTVALID" "#include +#include +" +if test "x$ac_cv_have_decl_NET_CIPSOV4_RBM_STRICTVALID" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_CIPSOV4_RBM_STRICTVALID $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_TCP_AVAIL_CONG_CONTROL" "ac_cv_have_decl_NET_TCP_AVAIL_CONG_CONTROL" "#include +#include +" +if test "x$ac_cv_have_decl_NET_TCP_AVAIL_CONG_CONTROL" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_TCP_AVAIL_CONG_CONTROL $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_TCP_ALLOWED_CONG_CONTROL" "ac_cv_have_decl_NET_TCP_ALLOWED_CONG_CONTROL" "#include +#include +" +if test "x$ac_cv_have_decl_NET_TCP_ALLOWED_CONG_CONTROL" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_TCP_ALLOWED_CONG_CONTROL $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_TCP_MAX_SSTHRESH" "ac_cv_have_decl_NET_TCP_MAX_SSTHRESH" "#include +#include +" +if test "x$ac_cv_have_decl_NET_TCP_MAX_SSTHRESH" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_TCP_MAX_SSTHRESH $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_TCP_FRTO_RESPONSE" "ac_cv_have_decl_NET_TCP_FRTO_RESPONSE" "#include +#include +" +if test "x$ac_cv_have_decl_NET_TCP_FRTO_RESPONSE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_TCP_FRTO_RESPONSE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS" "ac_cv_have_decl_NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS" "#include +#include +" +if test "x$ac_cv_have_decl_NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_FORCE_IGMP_VERSION" "ac_cv_have_decl_NET_IPV4_CONF_FORCE_IGMP_VERSION" "#include +#include +" +if test "x$ac_cv_have_decl_NET_IPV4_CONF_FORCE_IGMP_VERSION" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_IPV4_CONF_FORCE_IGMP_VERSION $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_ARP_ANNOUNCE" "ac_cv_have_decl_NET_IPV4_CONF_ARP_ANNOUNCE" "#include +#include +" +if test "x$ac_cv_have_decl_NET_IPV4_CONF_ARP_ANNOUNCE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_IPV4_CONF_ARP_ANNOUNCE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_ARP_IGNORE" "ac_cv_have_decl_NET_IPV4_CONF_ARP_IGNORE" "#include +#include +" +if test "x$ac_cv_have_decl_NET_IPV4_CONF_ARP_IGNORE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_IPV4_CONF_ARP_IGNORE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_PROMOTE_SECONDARIES" "ac_cv_have_decl_NET_IPV4_CONF_PROMOTE_SECONDARIES" "#include +#include +" +if test "x$ac_cv_have_decl_NET_IPV4_CONF_PROMOTE_SECONDARIES" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_IPV4_CONF_PROMOTE_SECONDARIES $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_ARP_ACCEPT" "ac_cv_have_decl_NET_IPV4_CONF_ARP_ACCEPT" "#include +#include +" +if test "x$ac_cv_have_decl_NET_IPV4_CONF_ARP_ACCEPT" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_IPV4_CONF_ARP_ACCEPT $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_IPV4_CONF_ARP_NOTIFY" "ac_cv_have_decl_NET_IPV4_CONF_ARP_NOTIFY" "#include +#include +" +if test "x$ac_cv_have_decl_NET_IPV4_CONF_ARP_NOTIFY" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_IPV4_CONF_ARP_NOTIFY $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_IPV6_MLD_MAX_MSF" "ac_cv_have_decl_NET_IPV6_MLD_MAX_MSF" "#include +#include +" +if test "x$ac_cv_have_decl_NET_IPV6_MLD_MAX_MSF" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_IPV6_MLD_MAX_MSF $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS" "ac_cv_have_decl_NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS" "#include +#include +" +if test "x$ac_cv_have_decl_NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "VM_MAX_MAP_COUNT" "ac_cv_have_decl_VM_MAX_MAP_COUNT" "#include +#include +" +if test "x$ac_cv_have_decl_VM_MAX_MAP_COUNT" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VM_MAX_MAP_COUNT $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "VM_LAPTOP_MODE" "ac_cv_have_decl_VM_LAPTOP_MODE" "#include +#include +" +if test "x$ac_cv_have_decl_VM_LAPTOP_MODE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VM_LAPTOP_MODE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "VM_BLOCK_DUMP" "ac_cv_have_decl_VM_BLOCK_DUMP" "#include +#include +" +if test "x$ac_cv_have_decl_VM_BLOCK_DUMP" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VM_BLOCK_DUMP $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "VM_HUGETLB_GROUP" "ac_cv_have_decl_VM_HUGETLB_GROUP" "#include +#include +" +if test "x$ac_cv_have_decl_VM_HUGETLB_GROUP" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VM_HUGETLB_GROUP $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "VM_VFS_CACHE_PRESSURE" "ac_cv_have_decl_VM_VFS_CACHE_PRESSURE" "#include +#include +" +if test "x$ac_cv_have_decl_VM_VFS_CACHE_PRESSURE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VM_VFS_CACHE_PRESSURE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "VM_LEGACY_VA_LAYOUT" "ac_cv_have_decl_VM_LEGACY_VA_LAYOUT" "#include +#include +" +if test "x$ac_cv_have_decl_VM_LEGACY_VA_LAYOUT" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VM_LEGACY_VA_LAYOUT $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "VM_SWAP_TOKEN_TIMEOUT" "ac_cv_have_decl_VM_SWAP_TOKEN_TIMEOUT" "#include +#include +" +if test "x$ac_cv_have_decl_VM_SWAP_TOKEN_TIMEOUT" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_VM_SWAP_TOKEN_TIMEOUT $ac_have_decl +_ACEOF + + +ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_ANY" "ac_cv_have_decl_V4L2_FIELD_ANY" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_FIELD_ANY" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_FIELD_ANY $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_NONE" "ac_cv_have_decl_V4L2_FIELD_NONE" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_FIELD_NONE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_FIELD_NONE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_TOP" "ac_cv_have_decl_V4L2_FIELD_TOP" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_FIELD_TOP" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_FIELD_TOP $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_BOTTOM" "ac_cv_have_decl_V4L2_FIELD_BOTTOM" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_FIELD_BOTTOM" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_FIELD_BOTTOM $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_INTERLACED" "ac_cv_have_decl_V4L2_FIELD_INTERLACED" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_FIELD_INTERLACED" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_FIELD_INTERLACED $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_SEQ_TB" "ac_cv_have_decl_V4L2_FIELD_SEQ_TB" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_FIELD_SEQ_TB" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_FIELD_SEQ_TB $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_SEQ_BT" "ac_cv_have_decl_V4L2_FIELD_SEQ_BT" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_FIELD_SEQ_BT" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_FIELD_SEQ_BT $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_ALTERNATE" "ac_cv_have_decl_V4L2_FIELD_ALTERNATE" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_FIELD_ALTERNATE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_FIELD_ALTERNATE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_INTERLACED_TB" "ac_cv_have_decl_V4L2_FIELD_INTERLACED_TB" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_FIELD_INTERLACED_TB" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_FIELD_INTERLACED_TB $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_FIELD_INTERLACED_BT" "ac_cv_have_decl_V4L2_FIELD_INTERLACED_BT" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_FIELD_INTERLACED_BT" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_FIELD_INTERLACED_BT $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VIDEO_CAPTURE" "ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_CAPTURE" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_CAPTURE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE" "ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VIDEO_OUTPUT" "ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OUTPUT" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OUTPUT" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE" "ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VIDEO_OVERLAY" "ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OVERLAY" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OVERLAY" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OVERLAY $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VBI_CAPTURE" "ac_cv_have_decl_V4L2_BUF_TYPE_VBI_CAPTURE" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VBI_CAPTURE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_BUF_TYPE_VBI_CAPTURE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VBI_OUTPUT" "ac_cv_have_decl_V4L2_BUF_TYPE_VBI_OUTPUT" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VBI_OUTPUT" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_BUF_TYPE_VBI_OUTPUT $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_SLICED_VBI_CAPTURE" "ac_cv_have_decl_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_SLICED_VBI_OUTPUT" "ac_cv_have_decl_V4L2_BUF_TYPE_SLICED_VBI_OUTPUT" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_SLICED_VBI_OUTPUT" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_OUTPUT $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY" "ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_SDR_CAPTURE" "ac_cv_have_decl_V4L2_BUF_TYPE_SDR_CAPTURE" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_SDR_CAPTURE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_BUF_TYPE_SDR_OUTPUT" "ac_cv_have_decl_V4L2_BUF_TYPE_SDR_OUTPUT" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_BUF_TYPE_SDR_OUTPUT" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_TUNER_RADIO" "ac_cv_have_decl_V4L2_TUNER_RADIO" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_TUNER_RADIO" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_TUNER_RADIO $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_TUNER_ANALOG_TV" "ac_cv_have_decl_V4L2_TUNER_ANALOG_TV" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_TUNER_ANALOG_TV" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_TUNER_ANALOG_TV $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_TUNER_DIGITAL_TV" "ac_cv_have_decl_V4L2_TUNER_DIGITAL_TV" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_TUNER_DIGITAL_TV" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_TUNER_DIGITAL_TV $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_MEMORY_MMAP" "ac_cv_have_decl_V4L2_MEMORY_MMAP" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_MEMORY_MMAP" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_MEMORY_MMAP $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_MEMORY_USERPTR" "ac_cv_have_decl_V4L2_MEMORY_USERPTR" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_MEMORY_USERPTR" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_MEMORY_USERPTR $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_MEMORY_OVERLAY" "ac_cv_have_decl_V4L2_MEMORY_OVERLAY" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_MEMORY_OVERLAY" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_MEMORY_OVERLAY $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_MEMORY_DMABUF" "ac_cv_have_decl_V4L2_MEMORY_DMABUF" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_MEMORY_DMABUF" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_MEMORY_DMABUF $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_SMPTE170M" "ac_cv_have_decl_V4L2_COLORSPACE_SMPTE170M" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_COLORSPACE_SMPTE170M" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_COLORSPACE_SMPTE170M $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_SMPTE240M" "ac_cv_have_decl_V4L2_COLORSPACE_SMPTE240M" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_COLORSPACE_SMPTE240M" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_COLORSPACE_SMPTE240M $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_REC709" "ac_cv_have_decl_V4L2_COLORSPACE_REC709" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_COLORSPACE_REC709" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_COLORSPACE_REC709 $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_BT878" "ac_cv_have_decl_V4L2_COLORSPACE_BT878" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_COLORSPACE_BT878" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_COLORSPACE_BT878 $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_470_SYSTEM_M" "ac_cv_have_decl_V4L2_COLORSPACE_470_SYSTEM_M" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_COLORSPACE_470_SYSTEM_M" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_COLORSPACE_470_SYSTEM_M $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_470_SYSTEM_BG" "ac_cv_have_decl_V4L2_COLORSPACE_470_SYSTEM_BG" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_COLORSPACE_470_SYSTEM_BG" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_COLORSPACE_470_SYSTEM_BG $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_JPEG" "ac_cv_have_decl_V4L2_COLORSPACE_JPEG" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_COLORSPACE_JPEG" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_COLORSPACE_JPEG $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_COLORSPACE_SRGB" "ac_cv_have_decl_V4L2_COLORSPACE_SRGB" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_COLORSPACE_SRGB" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_COLORSPACE_SRGB $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_PRIORITY_UNSET" "ac_cv_have_decl_V4L2_PRIORITY_UNSET" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_PRIORITY_UNSET" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_PRIORITY_UNSET $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_PRIORITY_BACKGROUND" "ac_cv_have_decl_V4L2_PRIORITY_BACKGROUND" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_PRIORITY_BACKGROUND" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_PRIORITY_BACKGROUND $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_PRIORITY_INTERACTIVE" "ac_cv_have_decl_V4L2_PRIORITY_INTERACTIVE" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_PRIORITY_INTERACTIVE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_PRIORITY_INTERACTIVE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_PRIORITY_RECORD" "ac_cv_have_decl_V4L2_PRIORITY_RECORD" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_PRIORITY_RECORD" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_PRIORITY_RECORD $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_FRMSIZE_TYPE_DISCRETE" "ac_cv_have_decl_V4L2_FRMSIZE_TYPE_DISCRETE" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_FRMSIZE_TYPE_DISCRETE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_FRMSIZE_TYPE_DISCRETE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_FRMSIZE_TYPE_CONTINUOUS" "ac_cv_have_decl_V4L2_FRMSIZE_TYPE_CONTINUOUS" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_FRMSIZE_TYPE_CONTINUOUS" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_FRMSIZE_TYPE_CONTINUOUS $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_FRMSIZE_TYPE_STEPWISE" "ac_cv_have_decl_V4L2_FRMSIZE_TYPE_STEPWISE" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_FRMSIZE_TYPE_STEPWISE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_FRMSIZE_TYPE_STEPWISE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_FRMIVAL_TYPE_DISCRETE" "ac_cv_have_decl_V4L2_FRMIVAL_TYPE_DISCRETE" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_FRMIVAL_TYPE_DISCRETE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_FRMIVAL_TYPE_DISCRETE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_FRMIVAL_TYPE_CONTINUOUS" "ac_cv_have_decl_V4L2_FRMIVAL_TYPE_CONTINUOUS" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_FRMIVAL_TYPE_CONTINUOUS" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_FRMIVAL_TYPE_CONTINUOUS $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_FRMIVAL_TYPE_STEPWISE" "ac_cv_have_decl_V4L2_FRMIVAL_TYPE_STEPWISE" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_FRMIVAL_TYPE_STEPWISE" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_FRMIVAL_TYPE_STEPWISE $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_INTEGER" "ac_cv_have_decl_V4L2_CTRL_TYPE_INTEGER" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_INTEGER" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_CTRL_TYPE_INTEGER $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_BOOLEAN" "ac_cv_have_decl_V4L2_CTRL_TYPE_BOOLEAN" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_BOOLEAN" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_CTRL_TYPE_BOOLEAN $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_MENU" "ac_cv_have_decl_V4L2_CTRL_TYPE_MENU" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_MENU" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_CTRL_TYPE_MENU $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_BUTTON" "ac_cv_have_decl_V4L2_CTRL_TYPE_BUTTON" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_BUTTON" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_CTRL_TYPE_BUTTON $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_INTEGER64" "ac_cv_have_decl_V4L2_CTRL_TYPE_INTEGER64" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_INTEGER64" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_CTRL_TYPE_INTEGER64 $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_CTRL_CLASS" "ac_cv_have_decl_V4L2_CTRL_TYPE_CTRL_CLASS" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_CTRL_CLASS" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_CTRL_TYPE_CTRL_CLASS $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_STRING" "ac_cv_have_decl_V4L2_CTRL_TYPE_STRING" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_STRING" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_CTRL_TYPE_STRING $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_BITMASK" "ac_cv_have_decl_V4L2_CTRL_TYPE_BITMASK" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_BITMASK" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_CTRL_TYPE_BITMASK $ac_have_decl +_ACEOF +ac_fn_c_check_decl "$LINENO" "V4L2_CTRL_TYPE_INTEGER_MENU" "ac_cv_have_decl_V4L2_CTRL_TYPE_INTEGER_MENU" "#include +#include +#include +#include +" +if test "x$ac_cv_have_decl_V4L2_CTRL_TYPE_INTEGER_MENU" = xyes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_V4L2_CTRL_TYPE_INTEGER_MENU $ac_have_decl +_ACEOF + + +ac_fn_c_check_member "$LINENO" "struct v4l2_window" "global_alpha" "ac_cv_member_struct_v4l2_window_global_alpha" "#include +#include +#include +#include +" +if test "x$ac_cv_member_struct_v4l2_window_global_alpha" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_V4L2_WINDOW_GLOBAL_ALPHA 1 +_ACEOF + + +fi +ac_fn_c_check_member "$LINENO" "struct v4l2_sdr_format" "buffersize" "ac_cv_member_struct_v4l2_sdr_format_buffersize" "#include +#include +#include +#include +" +if test "x$ac_cv_member_struct_v4l2_sdr_format_buffersize" = xyes; then : + +cat >>confdefs.h <<_ACEOF +#define HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE 1 +_ACEOF + + +fi + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } +if ${ac_cv_sizeof_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + +SIZEOF_LONG="$ac_cv_sizeof_long" + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long" >&5 +$as_echo_n "checking size of long long... " >&6; } +if ${ac_cv_sizeof_long_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long))" "ac_cv_sizeof_long_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long_long" >&5 +$as_echo "$ac_cv_sizeof_long_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of off_t" >&5 +$as_echo_n "checking size of off_t... " >&6; } +if ${ac_cv_sizeof_off_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (off_t))" "ac_cv_sizeof_off_t" "#include +"; then : + +else + if test "$ac_cv_type_off_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (off_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_off_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_off_t" >&5 +$as_echo "$ac_cv_sizeof_off_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_OFF_T $ac_cv_sizeof_off_t +_ACEOF + + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of kernel_long_t" >&5 +$as_echo_n "checking size of kernel_long_t... " >&6; } +if ${ac_cv_sizeof_kernel_long_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (kernel_long_t))" "ac_cv_sizeof_kernel_long_t" "#include \"$srcdir/kernel_types.h\" +"; then : + +else + if test "$ac_cv_type_kernel_long_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (kernel_long_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_kernel_long_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_kernel_long_t" >&5 +$as_echo "$ac_cv_sizeof_kernel_long_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_KERNEL_LONG_T $ac_cv_sizeof_kernel_long_t +_ACEOF + + +SIZEOF_KERNEL_LONG_T="$ac_cv_sizeof_kernel_long_t" + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of struct i64_i32" >&5 +$as_echo_n "checking size of struct i64_i32... " >&6; } +if ${ac_cv_sizeof_struct_i64_i32+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (struct i64_i32))" "ac_cv_sizeof_struct_i64_i32" "struct i64_i32 {long long i64; int i32;}; +"; then : + +else + if test "$ac_cv_type_struct_i64_i32" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (struct i64_i32) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_struct_i64_i32=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_struct_i64_i32" >&5 +$as_echo "$ac_cv_sizeof_struct_i64_i32" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define SIZEOF_STRUCT_I64_I32 $ac_cv_sizeof_struct_i64_i32 +_ACEOF + + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIGRTMIN" >&5 +$as_echo_n "checking for SIGRTMIN... " >&6; } +if ${st_cv_SIGRTMIN+:} false; then : + $as_echo_n "(cached) " >&6 +else + st_cv_SIGRTMIN="$(echo SIGRTMIN | + $CPP $CPPFLAGS -P -imacros asm/signal.h - | + grep '^[0-9]')" + test -n "$st_cv_SIGRTMIN" || st_cv_SIGRTMIN=no +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_SIGRTMIN" >&5 +$as_echo "$st_cv_SIGRTMIN" >&6; } +if test "x$st_cv_SIGRTMIN" != xno; then + +cat >>confdefs.h <<_ACEOF +#define ASM_SIGRTMIN $st_cv_SIGRTMIN +_ACEOF + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SA_RESTORER" >&5 +$as_echo_n "checking for SA_RESTORER... " >&6; } +if ${st_cv_SA_RESTORER+:} false; then : + $as_echo_n "(cached) " >&6 +else + st_cv_SA_RESTORER="$(echo SA_RESTORER | + $CPP $CPPFLAGS -P -imacros asm/signal.h - | + grep ^0x)" + test -n "$st_cv_SA_RESTORER" || st_cv_SA_RESTORER=no +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_SA_RESTORER" >&5 +$as_echo "$st_cv_SA_RESTORER" >&6; } +if test "x$st_cv_SA_RESTORER" != xno; then + +cat >>confdefs.h <<_ACEOF +#define ASM_SA_RESTORER $st_cv_SA_RESTORER +_ACEOF + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_popcount" >&5 +$as_echo_n "checking for __builtin_popcount... " >&6; } +if ${st_cv_have___builtin_popcount+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +__builtin_popcount(0) + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + st_cv_have___builtin_popcount=yes +else + st_cv_have___builtin_popcount=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_have___builtin_popcount" >&5 +$as_echo "$st_cv_have___builtin_popcount" >&6; } +if test "x$st_cv_have___builtin_popcount" = xyes; then + +$as_echo "#define HAVE___BUILTIN_POPCOUNT 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for program_invocation_name" >&5 +$as_echo_n "checking for program_invocation_name... " >&6; } +if ${st_cv_have_program_invocation_name+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +return !*program_invocation_name + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + st_cv_have_program_invocation_name=yes +else + st_cv_have_program_invocation_name=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_have_program_invocation_name" >&5 +$as_echo "$st_cv_have_program_invocation_name" >&6; } +if test "x$st_cv_have_program_invocation_name" = xyes; then + +$as_echo "#define HAVE_PROGRAM_INVOCATION_NAME 1" >>confdefs.h + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for static_assert" >&5 +$as_echo_n "checking for static_assert... " >&6; } +if ${st_cv_have_static_assert+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +static_assert(1,"") + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + st_cv_have_static_assert=yes +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +_Static_assert(1,"") + + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + st_cv_have_static_assert=_Static_assert +else + st_cv_have_static_assert=no + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_have_static_assert" >&5 +$as_echo "$st_cv_have_static_assert" >&6; } +case "x$st_cv_have_static_assert" in + xyes) + +$as_echo "#define HAVE_STATIC_ASSERT 1" >>confdefs.h + + ;; + x_Static_assert) + +$as_echo "#define HAVE__STATIC_ASSERT 1" >>confdefs.h + + ;; +esac + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dladdr in -ldl" >&5 +$as_echo_n "checking for dladdr in -ldl... " >&6; } +if ${ac_cv_lib_dl_dladdr+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dladdr (); +int +main () +{ +return dladdr (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dl_dladdr=yes +else + ac_cv_lib_dl_dladdr=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dladdr" >&5 +$as_echo "$ac_cv_lib_dl_dladdr" >&6; } +if test "x$ac_cv_lib_dl_dladdr" = xyes; then : + dl_LIBS='-ldl' +else + dl_LIBS= +fi + +if test "x$ac_cv_lib_dl_dladdr" = xyes; then + +$as_echo "#define HAVE_DLADDR 1" >>confdefs.h + +fi + + +saved_LIBS="$LIBS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing timer_create" >&5 +$as_echo_n "checking for library containing timer_create... " >&6; } +if ${ac_cv_search_timer_create+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char timer_create (); +int +main () +{ +return timer_create (); + ; + return 0; +} +_ACEOF +for ac_lib in '' rt; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_timer_create=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_timer_create+:} false; then : + break +fi +done +if ${ac_cv_search_timer_create+:} false; then : + +else + ac_cv_search_timer_create=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_timer_create" >&5 +$as_echo "$ac_cv_search_timer_create" >&6; } +ac_res=$ac_cv_search_timer_create +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +LIBS="$saved_LIBS" +case "$ac_cv_search_timer_create" in + no) { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to find timer_create +See \`config.log' for more details" "$LINENO" 5; } ;; + -l*) timer_LIBS="$ac_cv_search_timer_create" ;; + *) timer_LIBS= ;; +esac + + +saved_LIBS="$LIBS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing clock_gettime" >&5 +$as_echo_n "checking for library containing clock_gettime... " >&6; } +if ${ac_cv_search_clock_gettime+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char clock_gettime (); +int +main () +{ +return clock_gettime (); + ; + return 0; +} +_ACEOF +for ac_lib in '' rt; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_clock_gettime=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_clock_gettime+:} false; then : + break +fi +done +if ${ac_cv_search_clock_gettime+:} false; then : + +else + ac_cv_search_clock_gettime=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_clock_gettime" >&5 +$as_echo "$ac_cv_search_clock_gettime" >&6; } +ac_res=$ac_cv_search_clock_gettime +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +LIBS="$saved_LIBS" +case "$ac_cv_search_clock_gettime" in + no) { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to find clock_gettime +See \`config.log' for more details" "$LINENO" 5; } ;; + -l*) clock_LIBS="$ac_cv_search_clock_gettime" ;; + *) clock_LIBS= ;; +esac + + +saved_LIBS="$LIBS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing mq_open" >&5 +$as_echo_n "checking for library containing mq_open... " >&6; } +if ${ac_cv_search_mq_open+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char mq_open (); +int +main () +{ +return mq_open (); + ; + return 0; +} +_ACEOF +for ac_lib in '' rt; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_c_try_link "$LINENO"; then : + ac_cv_search_mq_open=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if ${ac_cv_search_mq_open+:} false; then : + break +fi +done +if ${ac_cv_search_mq_open+:} false; then : + +else + ac_cv_search_mq_open=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_mq_open" >&5 +$as_echo "$ac_cv_search_mq_open" >&6; } +ac_res=$ac_cv_search_mq_open +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +LIBS="$saved_LIBS" +case "$ac_cv_search_mq_open" in + -l*) mq_LIBS="$ac_cv_search_mq_open" ;; + *) mq_LIBS= ;; +esac + + +# Extract the first word of "perl", so it can be a program name with args. +set dummy perl; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PERL+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PERL in + [\\/]* | ?:[\\/]*) + ac_cv_path_PERL="$PERL" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PERL=$ac_cv_path_PERL +if test -n "$PERL"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 +$as_echo "$PERL" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}readelf", so it can be a program name with args. +set dummy ${ac_tool_prefix}readelf; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_READELF+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$READELF"; then + ac_cv_prog_READELF="$READELF" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_READELF="${ac_tool_prefix}readelf" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +READELF=$ac_cv_prog_READELF +if test -n "$READELF"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5 +$as_echo "$READELF" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_READELF"; then + ac_ct_READELF=$READELF + # Extract the first word of "readelf", so it can be a program name with args. +set dummy readelf; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_READELF+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_READELF"; then + ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_READELF="readelf" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_READELF=$ac_cv_prog_ac_ct_READELF +if test -n "$ac_ct_READELF"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_READELF" >&5 +$as_echo "$ac_ct_READELF" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_READELF" = x; then + READELF="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + READELF=$ac_ct_READELF + fi +else + READELF="$ac_cv_prog_READELF" +fi + + + +# Check whether --enable-stacktrace was given. +if test "${enable_stacktrace+set}" = set; then : + enableval=$enable_stacktrace; case "$enableval" in + yes|no|check) enable_stacktrace="$enableval" ;; + *) as_fn_error $? "bad value $enableval for enable-stacktrace option. + Valid options are: yes, no, check." "$LINENO" 5 + ;; + esac +else + enable_stacktrace=check +fi + + +use_unwinder= + +if test x"$enable_stacktrace" != xno; then : + +: ${libdw_CPPFLAGS=} +: ${libdw_CFLAGS=} +: ${libdw_LDFLAGS=} +: ${libdw_LIBS=} + + +# Check whether --with-libdw was given. +if test "${with_libdw+set}" = set; then : + withval=$with_libdw; case "${withval}" in + yes|no|check) ;; + *) libdw_CPPFLAGS="-I${withval}/include" + libdw_LDFLAGS="-L${withval}/lib" + with_libdw=yes ;; + esac + +else + with_libdw=check + +fi + + + + + +# Check whether --with-libunwind was given. +if test "${with_libunwind+set}" = set; then : + withval=$with_libunwind; case "${withval}" in + yes|no|check) ;; + *) with_libunwind=yes + libunwind_CPPFLAGS="-I${withval}/include" + libunwind_LDFLAGS="-L${withval}/lib" ;; + esac +else + with_libunwind=check + +fi + + + + if test "x$with_libdw" = xyes && test "x$with_libunwind" = xyes; then : + as_fn_error $? "--with-libdw=yes and --with-libunwind=yes are mutually exclusive" "$LINENO" 5 +elif test "x$with_libdw" = xyes; then : + with_libunwind=no +elif test "x$with_libunwind" = xyes; then : + with_libdw=no + +fi + if test "x$use_unwinder" = x; then : + +have_libdw= + +if test "x$with_libdw" != xno && test "x$use_unwinder" = x; then : + saved_CPPFLAGS="$CPPFLAGS" + saved_CFLAGS="$CFLAGS" + CPPFLAGS="$CPPFLAGS $libdw_CPPFLAGS" + CFLAGS="$CFLAGS $libdw_CFLAGS" + + for ac_header in elfutils/libdwfl.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "elfutils/libdwfl.h" "ac_cv_header_elfutils_libdwfl_h" "$ac_includes_default" +if test "x$ac_cv_header_elfutils_libdwfl_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_ELFUTILS_LIBDWFL_H 1 +_ACEOF + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dwfl_linux_proc_attach in -ldw" >&5 +$as_echo_n "checking for dwfl_linux_proc_attach in -ldw... " >&6; } +if ${ac_cv_lib_dw_dwfl_linux_proc_attach+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldw $libdw_LDFLAGS $libdw_LIBS + $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dwfl_linux_proc_attach (); +int +main () +{ +return dwfl_linux_proc_attach (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dw_dwfl_linux_proc_attach=yes +else + ac_cv_lib_dw_dwfl_linux_proc_attach=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dw_dwfl_linux_proc_attach" >&5 +$as_echo "$ac_cv_lib_dw_dwfl_linux_proc_attach" >&6; } +if test "x$ac_cv_lib_dw_dwfl_linux_proc_attach" = xyes; then : + libdw_LIBS="-ldw $libdw_LIBS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for elfutils version" >&5 +$as_echo_n "checking for elfutils version... " >&6; } +if ${st_cv_ELFUTILS_VERSION+:} false; then : + $as_echo_n "(cached) " >&6 +else + st_cv_ELFUTILS_VERSION="$(echo _ELFUTILS_VERSION | + $CPP $CPPFLAGS -P -imacros elfutils/version.h - | + grep '^[0-9]')" + test -n "$st_cv_ELFUTILS_VERSION" || + st_cv_ELFUTILS_VERSION=0 + + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_ELFUTILS_VERSION" >&5 +$as_echo "$st_cv_ELFUTILS_VERSION" >&6; } + if test "$st_cv_ELFUTILS_VERSION" -ge 164; then : + have_libdw=yes +else + if test "x$with_libdw" = xyes; then : + as_fn_error $? "elfutils version >= 164 is required for stack tracing support" "$LINENO" 5 +else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: elfutils version >= 164 is required for stack tracing support" >&5 +$as_echo "$as_me: WARNING: elfutils version >= 164 is required for stack tracing support" >&2;} + +fi + + +fi + +else + if test "x$with_libdw" = xyes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to find dwfl_linux_proc_attach in libdw +See \`config.log' for more details" "$LINENO" 5; } +fi + +fi + + +else + if test "x$with_libdw" = xyes; then : + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error 77 "cannot compute sizeof (struct i64_i32) +as_fn_error $? "failed to find elfutils/libdwfl.h See \`config.log' for more details" "$LINENO" 5; } - else - ac_cv_sizeof_struct_i64_i32=0 - fi -fi fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_struct_i64_i32" >&5 -$as_echo "$ac_cv_sizeof_struct_i64_i32" >&6; } +fi -cat >>confdefs.h <<_ACEOF -#define SIZEOF_STRUCT_I64_I32 $ac_cv_sizeof_struct_i64_i32 -_ACEOF +done + CFLAGS="$saved_CFLAGS" + CPPFLAGS="$saved_CPPFLAGS" + -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIGRTMIN" >&5 -$as_echo_n "checking for SIGRTMIN... " >&6; } -if ${st_cv_SIGRTMIN+:} false; then : - $as_echo_n "(cached) " >&6 -else - st_cv_SIGRTMIN="$(echo SIGRTMIN | - $CPP $CPPFLAGS -P -imacros asm/signal.h - | - grep '^[0-9]')" - test -n "$st_cv_SIGRTMIN" || st_cv_SIGRTMIN=no fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_SIGRTMIN" >&5 -$as_echo "$st_cv_SIGRTMIN" >&6; } -if test "x$st_cv_SIGRTMIN" != xno; then -cat >>confdefs.h <<_ACEOF -#define ASM_SIGRTMIN $st_cv_SIGRTMIN -_ACEOF +if test "x$have_libdw" = xyes; then : + use_unwinder=libdw + +$as_echo "#define USE_LIBDW 1" >>confdefs.h + + + + + + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SA_RESTORER" >&5 -$as_echo_n "checking for SA_RESTORER... " >&6; } -if ${st_cv_SA_RESTORER+:} false; then : - $as_echo_n "(cached) " >&6 -else - st_cv_SA_RESTORER="$(echo SA_RESTORER | - $CPP $CPPFLAGS -P -imacros asm/signal.h - | - grep ^0x)" - test -n "$st_cv_SA_RESTORER" || st_cv_SA_RESTORER=no -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_SA_RESTORER" >&5 -$as_echo "$st_cv_SA_RESTORER" >&6; } -if test "x$st_cv_SA_RESTORER" != xno; then -cat >>confdefs.h <<_ACEOF -#define ASM_SA_RESTORER $st_cv_SA_RESTORER -_ACEOF fi + if test "x$use_unwinder" = x; then : -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for __builtin_popcount" >&5 -$as_echo_n "checking for __builtin_popcount... " >&6; } -if ${st_cv_have___builtin_popcount+:} false; then : +libunwind_CPPFLAGS= +libunwind_LDFLAGS= +libunwind_LIBS= + +if test "x$with_libunwind" != xno && test "x$use_unwinder" = x; then : + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $libunwind_CPPFLAGS" + + for ac_header in libunwind-ptrace.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "libunwind-ptrace.h" "ac_cv_header_libunwind_ptrace_h" "$ac_includes_default" +if test "x$ac_cv_header_libunwind_ptrace_h" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBUNWIND_PTRACE_H 1 +_ACEOF + saved_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $libunwind_LDFLAGS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for backtrace in -lunwind" >&5 +$as_echo_n "checking for backtrace in -lunwind... " >&6; } +if ${ac_cv_lib_unwind_backtrace+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_check_lib_save_LIBS=$LIBS +LIBS="-lunwind $libunwind_LIBS + $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char backtrace (); int main () { -__builtin_popcount(0) +return backtrace (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - st_cv_have___builtin_popcount=yes + ac_cv_lib_unwind_backtrace=yes else - st_cv_have___builtin_popcount=no + ac_cv_lib_unwind_backtrace=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_have___builtin_popcount" >&5 -$as_echo "$st_cv_have___builtin_popcount" >&6; } -if test "x$st_cv_have___builtin_popcount" = xyes; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_unwind_backtrace" >&5 +$as_echo "$ac_cv_lib_unwind_backtrace" >&6; } +if test "x$ac_cv_lib_unwind_backtrace" = xyes; then : + libunwind_LIBS="-lunwind $libunwind_LIBS" -$as_echo "#define HAVE___BUILTIN_POPCOUNT 1" >>confdefs.h + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unw_create_addr_space in libunwind-generic" >&5 +$as_echo_n "checking for unw_create_addr_space in libunwind-generic... " >&6; } + saved_LIBS="$LIBS" + LIBS="-lunwind-generic $libunwind_LIBS $LIBS" -fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +return !unw_create_addr_space(0, 0) + ; + return 0; +} -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dladdr in -ldl" >&5 -$as_echo_n "checking for dladdr in -ldl... " >&6; } -if ${ac_cv_lib_dl_dladdr+:} false; then : +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + libunwind_LIBS="-lunwind-generic $libunwind_LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _UPT_create in -lunwind-ptrace" >&5 +$as_echo_n "checking for _UPT_create in -lunwind-ptrace... " >&6; } +if ${ac_cv_lib_unwind_ptrace__UPT_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-ldl $LIBS" +LIBS="-lunwind-ptrace $libunwind_LIBS + $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12197,183 +15659,197 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char dladdr (); +char _UPT_create (); int main () { -return dladdr (); +return _UPT_create (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_dl_dladdr=yes + ac_cv_lib_unwind_ptrace__UPT_create=yes else - ac_cv_lib_dl_dladdr=no + ac_cv_lib_unwind_ptrace__UPT_create=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dladdr" >&5 -$as_echo "$ac_cv_lib_dl_dladdr" >&6; } -if test "x$ac_cv_lib_dl_dladdr" = xyes; then : - dl_LIBS='-ldl' +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_unwind_ptrace__UPT_create" >&5 +$as_echo "$ac_cv_lib_unwind_ptrace__UPT_create" >&6; } +if test "x$ac_cv_lib_unwind_ptrace__UPT_create" = xyes; then : + libunwind_LIBS="-lunwind-ptrace $libunwind_LIBS" + use_unwinder=libunwind + else - dl_LIBS= + if test "x$with_libunwind" != xcheck; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to find _UPT_create in libunwind-ptrace +See \`config.log' for more details" "$LINENO" 5; } + fi + fi -if test "x$ac_cv_lib_dl_dladdr" = xyes; then -$as_echo "#define HAVE_DLADDR 1" >>confdefs.h +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + if test "x$with_libunwind" != xcheck; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to find unw_create_addr_space in libunwind-generic +See \`config.log' for more details" "$LINENO" 5; } + fi + fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + LIBS="$saved_LIBS" -# Extract the first word of "perl", so it can be a program name with args. -set dummy perl; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PERL+:} false; then : - $as_echo_n "(cached) " >&6 else - case $PERL in - [\\/]* | ?:[\\/]*) - ac_cv_path_PERL="$PERL" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PERL="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS + if test "x$with_libunwind" != xcheck; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to find libunwind +See \`config.log' for more details" "$LINENO" 5; } + fi - ;; -esac fi -PERL=$ac_cv_path_PERL -if test -n "$PERL"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PERL" >&5 -$as_echo "$PERL" >&6; } + + + LDFLAGS="$saved_LDFLAGS" + else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + if test "x$with_libunwind" != xcheck; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to find libunwind-ptrace.h +See \`config.log' for more details" "$LINENO" 5; } + fi + + fi +done -libunwind_CPPFLAGS= -libunwind_LDFLAGS= -libunwind_LIBS= + CPPFLAGS="$saved_CPPFLAGS" -# Check whether --with-libunwind was given. -if test "${with_libunwind+set}" = set; then : - withval=$with_libunwind; case "${withval}" in - yes|no|check) ;; - *) with_libunwind=yes - libunwind_CPPFLAGS="-I${withval}/include" - libunwind_LDFLAGS="-L${withval}/lib" ;; - esac -else - with_libunwind=check fi +if test "x$use_unwinder" = xlibunwind; then -use_libunwind=no -if test "x$with_libunwind" != xno; then : - saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $libunwind_CPPFLAGS" +$as_echo "#define USE_LIBUNWIND 1" >>confdefs.h - for ac_header in libunwind-ptrace.h -do : - ac_fn_c_check_header_mongrel "$LINENO" "libunwind-ptrace.h" "ac_cv_header_libunwind_ptrace_h" "$ac_includes_default" -if test "x$ac_cv_header_libunwind_ptrace_h" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBUNWIND_PTRACE_H 1 -_ACEOF - saved_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $libunwind_LDFLAGS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for backtrace in -lunwind" >&5 -$as_echo_n "checking for backtrace in -lunwind... " >&6; } -if ${ac_cv_lib_unwind_backtrace+:} false; then : - $as_echo_n "(cached) " >&6 + + +fi + + +fi + if test x"$enable_stacktrace$use_unwinder" = xyes; then : + as_fn_error $? "stack tracing support requires an unwinder" "$LINENO" 5 + +fi + + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable stack tracing support" >&5 +$as_echo_n "checking whether to enable stack tracing support... " >&6; } + if test "x$use_unwinder" != x; then + ENABLE_STACKTRACE_TRUE= + ENABLE_STACKTRACE_FALSE='#' else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lunwind $libunwind_LIBS - $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ + ENABLE_STACKTRACE_TRUE='#' + ENABLE_STACKTRACE_FALSE= +fi + + if test "x$use_unwinder" = xlibdw; then + USE_LIBDW_TRUE= + USE_LIBDW_FALSE='#' +else + USE_LIBDW_TRUE='#' + USE_LIBDW_FALSE= +fi + + if test "x$use_unwinder" = xlibunwind; then + USE_LIBUNWIND_TRUE= + USE_LIBUNWIND_FALSE='#' +else + USE_LIBUNWIND_TRUE='#' + USE_LIBUNWIND_FALSE= +fi + + +use_libiberty= +if test "x$use_unwinder" != x; then : -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char backtrace (); -int -main () -{ -return backtrace (); - ; - return 0; -} +$as_echo "#define ENABLE_STACKTRACE 1" >>confdefs.h + + +cat >>confdefs.h <<_ACEOF +#define USE_UNWINDER "$use_unwinder" _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_unwind_backtrace=yes + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, using $use_unwinder" >&5 +$as_echo "yes, using $use_unwinder" >&6; } + + +# Check whether --with-libiberty was given. +if test "${with_libiberty+set}" = set; then : + withval=$with_libiberty; case "${withval}" in + yes|no|check) ;; + *) with_libiberty=yes + libiberty_CPPFLAGS="-I${withval}/include" + libiberty_LDFLAGS="-L${withval}/lib" ;; + esac else - ac_cv_lib_unwind_backtrace=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS + with_libiberty=check + fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_unwind_backtrace" >&5 -$as_echo "$ac_cv_lib_unwind_backtrace" >&6; } -if test "x$ac_cv_lib_unwind_backtrace" = xyes; then : - libunwind_LIBS="-lunwind $libunwind_LIBS" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for unw_create_addr_space in libunwind-generic" >&5 -$as_echo_n "checking for unw_create_addr_space in libunwind-generic... " >&6; } - saved_LIBS="$LIBS" - LIBS="-lunwind-generic $libunwind_LIBS $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -int -main () -{ -return !unw_create_addr_space(0, 0) - ; - return 0; -} +libiberty_CPPFLAGS= +libiberty_LDFLAGS= +libiberty_LIBS= +use_libiberty=no +if test "x$with_libiberty" != xno; then : + saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $libiberty_CPPFLAGS" + found_demangle_h=no + for ac_header in demangle.h libiberty/demangle.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF -if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - libunwind_LIBS="-lunwind-generic $libunwind_LIBS" + found_demangle_h=yes +fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _UPT_create in -lunwind-ptrace" >&5 -$as_echo_n "checking for _UPT_create in -lunwind-ptrace... " >&6; } -if ${ac_cv_lib_unwind_ptrace__UPT_create+:} false; then : +done + + CPPFLAGS="$saved_CPPFLAGS" + if test "x$found_demangle_h" = xyes; then : + saved_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $libiberty_LDFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cplus_demangle in -liberty" >&5 +$as_echo_n "checking for cplus_demangle in -liberty... " >&6; } +if ${ac_cv_lib_iberty_cplus_demangle+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lunwind-ptrace $libunwind_LIBS - $LIBS" +LIBS="-liberty $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -12383,110 +15859,86 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext #ifdef __cplusplus extern "C" #endif -char _UPT_create (); +char cplus_demangle (); int main () { -return _UPT_create (); +return cplus_demangle (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_unwind_ptrace__UPT_create=yes + ac_cv_lib_iberty_cplus_demangle=yes else - ac_cv_lib_unwind_ptrace__UPT_create=no + ac_cv_lib_iberty_cplus_demangle=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_unwind_ptrace__UPT_create" >&5 -$as_echo "$ac_cv_lib_unwind_ptrace__UPT_create" >&6; } -if test "x$ac_cv_lib_unwind_ptrace__UPT_create" = xyes; then : - libunwind_LIBS="-lunwind-ptrace $libunwind_LIBS" - use_libunwind=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iberty_cplus_demangle" >&5 +$as_echo "$ac_cv_lib_iberty_cplus_demangle" >&6; } +if test "x$ac_cv_lib_iberty_cplus_demangle" = xyes; then : + libiberty_LIBS="-liberty" + use_libiberty=yes else - if test "x$with_libunwind" != xcheck; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + if test "x$with_libiberty" != xcheck; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to find _UPT_create in libunwind-ptrace +as_fn_error $? "failed to find cplus_demangle in libiberty See \`config.log' for more details" "$LINENO" 5; } - fi + fi + fi + LDFLAGS="$saved_LDFLAGS" else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - if test "x$with_libunwind" != xcheck; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 + if test "x$with_libiberty" != xcheck; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to find unw_create_addr_space in libunwind-generic +as_fn_error $? "failed to find demangle.h See \`config.log' for more details" "$LINENO" 5; } - fi + fi fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - - LIBS="$saved_LIBS" -else - if test "x$with_libunwind" != xcheck; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to find libunwind -See \`config.log' for more details" "$LINENO" 5; } - fi fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable symbols demangling in stack trace" >&5 +$as_echo_n "checking whether to enable symbols demangling in stack trace... " >&6; } +if test "x$use_libiberty" = xyes; then - LDFLAGS="$saved_LDFLAGS" - -else - if test "x$with_libunwind" != xcheck; then - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "failed to find libunwind-ptrace.h -See \`config.log' for more details" "$LINENO" 5; } - fi - - -fi - -done +$as_echo "#define USE_DEMANGLE 1" >>confdefs.h - CPPFLAGS="$saved_CPPFLAGS" fi - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable stack tracing support using libunwind" >&5 -$as_echo_n "checking whether to enable stack tracing support using libunwind... " >&6; } -if test "x$use_libunwind" = xyes; then - -$as_echo "#define USE_LIBUNWIND 1" >>confdefs.h - - +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_libiberty" >&5 +$as_echo "$use_libiberty" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi - if test "x$use_libunwind" = xyes; then - USE_LIBUNWIND_TRUE= - USE_LIBUNWIND_FALSE='#' + + if test "x$use_libiberty" = xyes; then + USE_DEMANGLE_TRUE= + USE_DEMANGLE_FALSE='#' else - USE_LIBUNWIND_TRUE='#' - USE_LIBUNWIND_FALSE= + USE_DEMANGLE_TRUE='#' + USE_DEMANGLE_FALSE= fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_libunwind" >&5 -$as_echo "$use_libunwind" >&6; } + + if test "$arch" = mips && test "$no_create" != yes; then mkdir -p linux/mips @@ -12494,13 +15946,23 @@ if test "$arch" = mips && test "$no_create" != yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: Generated MIPS syscallent stubs" >&5 $as_echo "Generated MIPS syscallent stubs" >&6; } else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error $? "Failed to generate syscallent stubs -See \`config.log' for more details" "$LINENO" 5; } + as_fn_error $? "Failed to generate syscallent stubs" "$LINENO" 5 fi fi +# Check whether --enable-mpers was given. +if test "${enable_mpers+set}" = set; then : + enableval=$enable_mpers; case "$enableval" in + yes|no|check|m32|mx32) enable_mpers="$enableval" ;; + *) as_fn_error $? "bad value $enableval for enable-mpers option. + Valid options are: yes, no, check, m32, mx32." "$LINENO" 5 + ;; + esac +else + enable_mpers=yes +fi + + @@ -12513,7 +15975,10 @@ fi case "$arch" in - aarch64|powerpc64|sparc64|tile|x32|x86_64) + aarch64|powerpc64|riscv|s390x|sparc64|tile|x32|x86_64) + case "$enable_mpers" in + yes|check|m32) + @@ -12537,9 +16002,9 @@ done saved_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -m32 $IFLAG" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -m32 compile support" >&5 -$as_echo_n "checking for -m32 compile support... " >&6; } + CFLAGS="$CFLAGS $cc_flags_m32 $IFLAG" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for m32 personality compile support" >&5 +$as_echo_n "checking for m32 personality compile support... " >&6; } if ${st_cv_m32_cc+:} false; then : $as_echo_n "(cached) " >&6 else @@ -12558,8 +16023,8 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_m32_cc" >&5 $as_echo "$st_cv_m32_cc" >&6; } if test $st_cv_m32_cc = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -m32 runtime support" >&5 -$as_echo_n "checking for -m32 runtime support... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for m32 personality runtime support" >&5 +$as_echo_n "checking for m32 personality runtime support... " >&6; } if ${st_cv_m32_runtime+:} false; then : $as_echo_n "(cached) " >&6 else @@ -12583,13 +16048,14 @@ fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_m32_runtime" >&5 $as_echo "$st_cv_m32_runtime" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mpers.sh -m32 works" >&5 -$as_echo_n "checking whether mpers.sh -m32 works... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mpers.sh m32 $cc_flags_m32 works" >&5 +$as_echo_n "checking whether mpers.sh m32 $cc_flags_m32 works... " >&6; } if ${st_cv_m32_mpers+:} false; then : $as_echo_n "(cached) " >&6 else - if CC="$CC" CPP="$CPP" CPPFLAGS="$CPPFLAGS" \ - $srcdir/mpers_test.sh m32; then + if READELF="$READELF" \ + CC="$CC" CPP="$CPP" CPPFLAGS="$CPPFLAGS $IFLAG" \ + $srcdir/mpers_test.sh m32 $cc_flags_m32; then st_cv_m32_mpers=yes else st_cv_m32_mpers=no @@ -12700,15 +16166,162 @@ fi - - - - -if test -n "${ac_cv_type_struct_stat64+set}"; then : - saved_ac_cv_type_struct_stat64="${ac_cv_type_struct_stat64}"; unset ac_cv_type_struct_stat64 + + + + +if test -n "${ac_cv_type_struct_stat64+set}"; then : + saved_ac_cv_type_struct_stat64="${ac_cv_type_struct_stat64}"; unset ac_cv_type_struct_stat64 +fi +if test -n "${ac_cv_m32_type_struct_stat64+set}"; then : + ac_cv_type_struct_stat64="${ac_cv_m32_type_struct_stat64}" +fi + + + + + + +ac_fn_c_check_type "$LINENO" "struct stat64" "ac_cv_type_struct_stat64" "#include +#include +" +if test "x$ac_cv_type_struct_stat64" = xyes; then : + +$as_echo "#define HAVE_M32_STRUCT_STAT64 1" >>confdefs.h + +fi + + + + + + + +if test -n "${ac_cv_type_struct_stat64+set}"; then : + ac_cv_m32_type_struct_stat64="${ac_cv_type_struct_stat64}" +fi +if test -n "${saved_ac_cv_type_struct_stat64+set}"; then : + ac_cv_type_struct_stat64="${saved_ac_cv_type_struct_stat64}"; unset saved_ac_cv_type_struct_stat64 +fi + + + + + + + + + + + + + +if test -n "${ac_cv_member_struct_stat64_st_mtime_nsec+set}"; then : + saved_ac_cv_member_struct_stat64_st_mtime_nsec="${ac_cv_member_struct_stat64_st_mtime_nsec}"; unset ac_cv_member_struct_stat64_st_mtime_nsec +fi +if test -n "${ac_cv_m32_member_struct_stat64_st_mtime_nsec+set}"; then : + ac_cv_member_struct_stat64_st_mtime_nsec="${ac_cv_m32_member_struct_stat64_st_mtime_nsec}" +fi + + + + + + +ac_fn_c_check_member "$LINENO" "struct stat64" "st_mtime_nsec" "ac_cv_member_struct_stat64_st_mtime_nsec" "#include +#include +" +if test "x$ac_cv_member_struct_stat64_st_mtime_nsec" = xyes; then : + +$as_echo "#define HAVE_M32_STRUCT_STAT64_ST_MTIME_NSEC 1" >>confdefs.h + +fi + + + + + + + +if test -n "${ac_cv_member_struct_stat64_st_mtime_nsec+set}"; then : + ac_cv_m32_member_struct_stat64_st_mtime_nsec="${ac_cv_member_struct_stat64_st_mtime_nsec}" +fi +if test -n "${saved_ac_cv_member_struct_stat64_st_mtime_nsec+set}"; then : + ac_cv_member_struct_stat64_st_mtime_nsec="${saved_ac_cv_member_struct_stat64_st_mtime_nsec}"; unset saved_ac_cv_member_struct_stat64_st_mtime_nsec +fi + + + + + + + + + + if test $st_cv_m32_runtime = yes; then + + + + + + + +if test -n "${ac_cv_sizeof_long+set}"; then : + saved_ac_cv_sizeof_long="${ac_cv_sizeof_long}"; unset ac_cv_sizeof_long +fi +if test -n "${ac_cv_m32_sizeof_long+set}"; then : + ac_cv_sizeof_long="${ac_cv_m32_sizeof_long}" +fi + + + + + + + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } +if ${ac_cv_sizeof_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define M32_SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + + + + + + + +if test -n "${ac_cv_sizeof_long+set}"; then : + ac_cv_m32_sizeof_long="${ac_cv_sizeof_long}" fi -if test -n "${ac_cv_m32_type_struct_stat64+set}"; then : - ac_cv_type_struct_stat64="${ac_cv_m32_type_struct_stat64}" +if test -n "${saved_ac_cv_sizeof_long+set}"; then : + ac_cv_sizeof_long="${saved_ac_cv_sizeof_long}"; unset saved_ac_cv_sizeof_long fi @@ -12716,14 +16329,8 @@ fi -ac_fn_c_check_type "$LINENO" "struct stat64" "ac_cv_type_struct_stat64" "#include -#include -" -if test "x$ac_cv_type_struct_stat64" = xyes; then : -$as_echo "#define HAVE_M32_STRUCT_STAT64 1" >>confdefs.h -fi @@ -12731,11 +16338,11 @@ fi -if test -n "${ac_cv_type_struct_stat64+set}"; then : - ac_cv_m32_type_struct_stat64="${ac_cv_type_struct_stat64}" +if test -n "${ac_cv_sizeof_kernel_long_t+set}"; then : + saved_ac_cv_sizeof_kernel_long_t="${ac_cv_sizeof_kernel_long_t}"; unset ac_cv_sizeof_kernel_long_t fi -if test -n "${saved_ac_cv_type_struct_stat64+set}"; then : - ac_cv_type_struct_stat64="${saved_ac_cv_type_struct_stat64}"; unset saved_ac_cv_type_struct_stat64 +if test -n "${ac_cv_m32_sizeof_kernel_long_t+set}"; then : + ac_cv_sizeof_kernel_long_t="${ac_cv_m32_sizeof_kernel_long_t}" fi @@ -12743,45 +16350,51 @@ fi + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of kernel_long_t" >&5 +$as_echo_n "checking size of kernel_long_t... " >&6; } +if ${ac_cv_sizeof_kernel_long_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (kernel_long_t))" "ac_cv_sizeof_kernel_long_t" "#include \"$srcdir/kernel_types.h\" +"; then : - - - - - - -if test -n "${ac_cv_member_struct_stat64_st_mtime_nsec+set}"; then : - saved_ac_cv_member_struct_stat64_st_mtime_nsec="${ac_cv_member_struct_stat64_st_mtime_nsec}"; unset ac_cv_member_struct_stat64_st_mtime_nsec -fi -if test -n "${ac_cv_m32_member_struct_stat64_st_mtime_nsec+set}"; then : - ac_cv_member_struct_stat64_st_mtime_nsec="${ac_cv_m32_member_struct_stat64_st_mtime_nsec}" +else + if test "$ac_cv_type_kernel_long_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (kernel_long_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_kernel_long_t=0 + fi fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_kernel_long_t" >&5 +$as_echo "$ac_cv_sizeof_kernel_long_t" >&6; } +cat >>confdefs.h <<_ACEOF +#define M32_SIZEOF_KERNEL_LONG_T $ac_cv_sizeof_kernel_long_t +_ACEOF -ac_fn_c_check_member "$LINENO" "struct stat64" "st_mtime_nsec" "ac_cv_member_struct_stat64_st_mtime_nsec" "#include -#include -" -if test "x$ac_cv_member_struct_stat64_st_mtime_nsec" = xyes; then : - -$as_echo "#define HAVE_M32_STRUCT_STAT64_ST_MTIME_NSEC 1" >>confdefs.h - -fi - -if test -n "${ac_cv_member_struct_stat64_st_mtime_nsec+set}"; then : - ac_cv_m32_member_struct_stat64_st_mtime_nsec="${ac_cv_member_struct_stat64_st_mtime_nsec}" +if test -n "${ac_cv_sizeof_kernel_long_t+set}"; then : + ac_cv_m32_sizeof_kernel_long_t="${ac_cv_sizeof_kernel_long_t}" fi -if test -n "${saved_ac_cv_member_struct_stat64_st_mtime_nsec+set}"; then : - ac_cv_member_struct_stat64_st_mtime_nsec="${saved_ac_cv_member_struct_stat64_st_mtime_nsec}"; unset saved_ac_cv_member_struct_stat64_st_mtime_nsec +if test -n "${saved_ac_cv_sizeof_kernel_long_t+set}"; then : + ac_cv_sizeof_kernel_long_t="${saved_ac_cv_sizeof_kernel_long_t}"; unset saved_ac_cv_sizeof_kernel_long_t fi @@ -12790,13 +16403,33 @@ fi - + fi fi fi CFLAGS="$saved_CFLAGS" ;; - *) + *) # case "$enable_mpers" + st_cv_m32_runtime=no + st_cv_m32_mpers=no + ;; + esac + + test "$st_cv_m32_mpers" = yes || + st_cv_m32_mpers=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable m32 personality support" >&5 +$as_echo_n "checking whether to enable m32 personality support... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_m32_mpers" >&5 +$as_echo "$st_cv_m32_mpers" >&6; } + + case "$enable_mpers,$st_cv_m32_mpers" in + yes,no|m32,no) + as_fn_error $? "Cannot enable m32 personality support" "$LINENO" 5 + ;; + esac + ;; + + *) # case "$arch" st_cv_m32_runtime=no st_cv_m32_mpers=no ;; @@ -12842,6 +16475,9 @@ fi case "$arch" in x86_64) + case "$enable_mpers" in + yes|check|mx32) + @@ -12865,9 +16501,9 @@ done saved_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -mx32 $IFLAG" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -mx32 compile support" >&5 -$as_echo_n "checking for -mx32 compile support... " >&6; } + CFLAGS="$CFLAGS $cc_flags_mx32 $IFLAG" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mx32 personality compile support" >&5 +$as_echo_n "checking for mx32 personality compile support... " >&6; } if ${st_cv_mx32_cc+:} false; then : $as_echo_n "(cached) " >&6 else @@ -12886,8 +16522,8 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_mx32_cc" >&5 $as_echo "$st_cv_mx32_cc" >&6; } if test $st_cv_mx32_cc = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -mx32 runtime support" >&5 -$as_echo_n "checking for -mx32 runtime support... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mx32 personality runtime support" >&5 +$as_echo_n "checking for mx32 personality runtime support... " >&6; } if ${st_cv_mx32_runtime+:} false; then : $as_echo_n "(cached) " >&6 else @@ -12911,13 +16547,14 @@ fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_mx32_runtime" >&5 $as_echo "$st_cv_mx32_runtime" >&6; } - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mpers.sh -mx32 works" >&5 -$as_echo_n "checking whether mpers.sh -mx32 works... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mpers.sh mx32 $cc_flags_mx32 works" >&5 +$as_echo_n "checking whether mpers.sh mx32 $cc_flags_mx32 works... " >&6; } if ${st_cv_mx32_mpers+:} false; then : $as_echo_n "(cached) " >&6 else - if CC="$CC" CPP="$CPP" CPPFLAGS="$CPPFLAGS" \ - $srcdir/mpers_test.sh mx32; then + if READELF="$READELF" \ + CC="$CC" CPP="$CPP" CPPFLAGS="$CPPFLAGS $IFLAG" \ + $srcdir/mpers_test.sh mx32 $cc_flags_mx32; then st_cv_mx32_mpers=yes else st_cv_mx32_mpers=no @@ -13119,12 +16756,179 @@ fi + + if test $st_cv_mx32_runtime = yes; then + + + + + + + +if test -n "${ac_cv_sizeof_long+set}"; then : + saved_ac_cv_sizeof_long="${ac_cv_sizeof_long}"; unset ac_cv_sizeof_long +fi +if test -n "${ac_cv_mx32_sizeof_long+set}"; then : + ac_cv_sizeof_long="${ac_cv_mx32_sizeof_long}" +fi + + + + + + + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } +if ${ac_cv_sizeof_long+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long))" "ac_cv_sizeof_long" "$ac_includes_default"; then : + +else + if test "$ac_cv_type_long" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (long) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_long=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define MX32_SIZEOF_LONG $ac_cv_sizeof_long +_ACEOF + + + + + + + + +if test -n "${ac_cv_sizeof_long+set}"; then : + ac_cv_mx32_sizeof_long="${ac_cv_sizeof_long}" +fi +if test -n "${saved_ac_cv_sizeof_long+set}"; then : + ac_cv_sizeof_long="${saved_ac_cv_sizeof_long}"; unset saved_ac_cv_sizeof_long +fi + + + + + + + + + + + + + + + +if test -n "${ac_cv_sizeof_kernel_long_t+set}"; then : + saved_ac_cv_sizeof_kernel_long_t="${ac_cv_sizeof_kernel_long_t}"; unset ac_cv_sizeof_kernel_long_t +fi +if test -n "${ac_cv_mx32_sizeof_kernel_long_t+set}"; then : + ac_cv_sizeof_kernel_long_t="${ac_cv_mx32_sizeof_kernel_long_t}" +fi + + + + + + + # The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking size of kernel_long_t" >&5 +$as_echo_n "checking size of kernel_long_t... " >&6; } +if ${ac_cv_sizeof_kernel_long_t+:} false; then : + $as_echo_n "(cached) " >&6 +else + if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (kernel_long_t))" "ac_cv_sizeof_kernel_long_t" "#include \"$srcdir/kernel_types.h\" +"; then : + +else + if test "$ac_cv_type_kernel_long_t" = yes; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error 77 "cannot compute sizeof (kernel_long_t) +See \`config.log' for more details" "$LINENO" 5; } + else + ac_cv_sizeof_kernel_long_t=0 + fi +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sizeof_kernel_long_t" >&5 +$as_echo "$ac_cv_sizeof_kernel_long_t" >&6; } + + + +cat >>confdefs.h <<_ACEOF +#define MX32_SIZEOF_KERNEL_LONG_T $ac_cv_sizeof_kernel_long_t +_ACEOF + + + + + + + + +if test -n "${ac_cv_sizeof_kernel_long_t+set}"; then : + ac_cv_mx32_sizeof_kernel_long_t="${ac_cv_sizeof_kernel_long_t}" +fi +if test -n "${saved_ac_cv_sizeof_kernel_long_t+set}"; then : + ac_cv_sizeof_kernel_long_t="${saved_ac_cv_sizeof_kernel_long_t}"; unset saved_ac_cv_sizeof_kernel_long_t +fi + + + + + + + + fi fi fi CFLAGS="$saved_CFLAGS" ;; - *) + *) # case "$enable_mpers" + st_cv_mx32_runtime=no + st_cv_mx32_mpers=no + ;; + esac + + test "$st_cv_mx32_mpers" = yes || + st_cv_mx32_mpers=no + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable mx32 personality support" >&5 +$as_echo_n "checking whether to enable mx32 personality support... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_mx32_mpers" >&5 +$as_echo "$st_cv_mx32_mpers" >&6; } + + case "$enable_mpers,$st_cv_mx32_mpers" in + yes,no|mx32,no) + as_fn_error $? "Cannot enable mx32 personality support" "$LINENO" 5 + ;; + esac + ;; + + *) # case "$arch" st_cv_mx32_runtime=no st_cv_mx32_mpers=no ;; @@ -13241,6 +17045,7 @@ fi VALGRIND_ENABLED=$enable_valgrind + # Check for Valgrind tools we care about. valgrind_enabled_tools= @@ -13300,6 +17105,7 @@ fi ENABLE_VALGRIND_memcheck=$enable_valgrind_memcheck + # Check whether --enable-valgrind-helgrind was given. if test "${enable_valgrind_helgrind+set}" = set; then : enableval=$enable_valgrind_helgrind; enable_valgrind_helgrind=$enableval @@ -13356,6 +17162,7 @@ fi ENABLE_VALGRIND_helgrind=$enable_valgrind_helgrind + # Check whether --enable-valgrind-drd was given. if test "${enable_valgrind_drd+set}" = set; then : enableval=$enable_valgrind_drd; enable_valgrind_drd=$enableval @@ -13412,6 +17219,7 @@ fi ENABLE_VALGRIND_drd=$enable_valgrind_drd + # Check whether --enable-valgrind-sgcheck was given. if test "${enable_valgrind_sgcheck+set}" = set; then : enableval=$enable_valgrind_sgcheck; enable_valgrind_sgcheck=$enableval @@ -13468,6 +17276,7 @@ fi ENABLE_VALGRIND_sgcheck=$enable_valgrind_sgcheck + valgrind_tools="memcheck helgrind drd sgcheck" valgrind_enabled_tools=$valgrind_enabled_tools @@ -13517,9 +17326,8 @@ endif # Use recursive makes in order to ignore errors during check check-valgrind: ifeq ($(VALGRIND_ENABLED),yes) - -$(A''M_V_at)$(foreach tool,$(valgrind_enabled_tools), \ - $(MAKE) $(AM_MAKEFLAGS) -k check-valgrind-$(tool); \ - ) + $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k \ + $(foreach tool, $(valgrind_enabled_tools), check-valgrind-$(tool)) else @echo "Need to reconfigure with --enable-valgrind" endif @@ -13535,7 +17343,7 @@ VALGRIND_LOG_COMPILER = \ $(valgrind_lt) \ $(VALGRIND) $(VALGRIND_SUPPRESSIONS) --error-exitcode=1 $(VALGRIND_FLAGS) -define valgrind_tool_rule = +define valgrind_tool_rule check-valgrind-$(1): $$(BUILT_SOURCES) ifeq ($$(VALGRIND_ENABLED)-$$(ENABLE_VALGRIND_$(1)),yes-yes) $$(valgrind_v_use)$$(MAKE) $$(AM_MAKEFLAGS) check-am \ @@ -13565,7 +17373,7 @@ MOSTLYCLEANFILES += $(valgrind_log_files) -ac_config_files="$ac_config_files Makefile tests/Makefile tests-m32/Makefile tests-mx32/Makefile strace.spec debian/changelog" +ac_config_files="$ac_config_files Makefile tests/Makefile tests-m32/Makefile tests-mx32/Makefile strace.1 strace-log-merge.1 strace.spec debian/changelog" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -13713,10 +17521,22 @@ if test -z "${CODE_COVERAGE_ENABLED_TRUE}" && test -z "${CODE_COVERAGE_ENABLED_F Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${ENABLE_STACKTRACE_TRUE}" && test -z "${ENABLE_STACKTRACE_FALSE}"; then + as_fn_error $? "conditional \"ENABLE_STACKTRACE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${USE_LIBDW_TRUE}" && test -z "${USE_LIBDW_FALSE}"; then + as_fn_error $? "conditional \"USE_LIBDW\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${USE_LIBUNWIND_TRUE}" && test -z "${USE_LIBUNWIND_FALSE}"; then as_fn_error $? "conditional \"USE_LIBUNWIND\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${USE_DEMANGLE_TRUE}" && test -z "${USE_DEMANGLE_FALSE}"; then + as_fn_error $? "conditional \"USE_DEMANGLE\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${HAVE_M32_RUNTIME_TRUE}" && test -z "${HAVE_M32_RUNTIME_FALSE}"; then as_fn_error $? "conditional \"HAVE_M32_RUNTIME\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -14134,7 +17954,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by strace $as_me 4.16, which was +This file was extended by strace $as_me 5.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14194,14 +18014,14 @@ $config_headers Configuration commands: $config_commands -Report bugs to . +Report bugs to . strace home page: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -strace config.status 4.16 +strace config.status 5.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -14320,7 +18140,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # -AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" +AMDEP_TRUE="$AMDEP_TRUE" MAKE="${MAKE-make}" _ACEOF @@ -14336,6 +18156,8 @@ do "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; "tests-m32/Makefile") CONFIG_FILES="$CONFIG_FILES tests-m32/Makefile" ;; "tests-mx32/Makefile") CONFIG_FILES="$CONFIG_FILES tests-mx32/Makefile" ;; + "strace.1") CONFIG_FILES="$CONFIG_FILES strace.1" ;; + "strace-log-merge.1") CONFIG_FILES="$CONFIG_FILES strace-log-merge.1" ;; "strace.spec") CONFIG_FILES="$CONFIG_FILES strace.spec" ;; "debian/changelog") CONFIG_FILES="$CONFIG_FILES debian/changelog" ;; @@ -14933,29 +18755,35 @@ $as_echo "$as_me: executing $ac_file commands" >&6;} # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. - case $CONFIG_FILES in - *\'*) eval set x "$CONFIG_FILES" ;; - *) set x $CONFIG_FILES ;; - esac + # TODO: see whether this extra hack can be removed once we start + # requiring Autoconf 2.70 or later. + case $CONFIG_FILES in #( + *\'*) : + eval set x "$CONFIG_FILES" ;; #( + *) : + set x $CONFIG_FILES ;; #( + *) : + ;; +esac shift - for mf + # Used to flag and report bootstrapping failures. + am_rc=0 + for am_mf do # Strip MF so we end up with the name of the file. - mf=`echo "$mf" | sed -e 's/:.*$//'` - # Check whether this is an Automake generated Makefile or not. - # We used to match only the files named 'Makefile.in', but - # some people rename them; so instead we look at the file content. - # Grep'ing the first line is not enough: some people post-process - # each Makefile.in and add a new line on top of each file to say so. - # Grep'ing the whole file is not good either: AIX grep has a line + am_mf=`$as_echo "$am_mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile which includes + # dependency-tracking related rules and includes. + # Grep'ing the whole file directly is not great: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. - if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then - dirpart=`$as_dirname -- "$mf" || -$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$mf" : 'X\(//\)[^/]' \| \ - X"$mf" : 'X\(//\)$' \| \ - X"$mf" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$mf" | + sed -n 's,^am--depfiles:.*,X,p' "$am_mf" | grep X >/dev/null 2>&1 \ + || continue + am_dirpart=`$as_dirname -- "$am_mf" || +$as_expr X"$am_mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$am_mf" : 'X\(//\)[^/]' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$am_mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -14973,53 +18801,48 @@ $as_echo X"$mf" | q } s/.*/./; q'` - else - continue - fi - # Extract the definition of DEPDIR, am__include, and am__quote - # from the Makefile without running 'make'. - DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` - test -z "$DEPDIR" && continue - am__include=`sed -n 's/^am__include = //p' < "$mf"` - test -z "$am__include" && continue - am__quote=`sed -n 's/^am__quote = //p' < "$mf"` - # Find all dependency output files, they are included files with - # $(DEPDIR) in their names. We invoke sed twice because it is the - # simplest approach to changing $(DEPDIR) to its actual value in the - # expansion. - for file in `sed -n " - s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ - sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do - # Make sure the directory exists. - test -f "$dirpart/$file" && continue - fdir=`$as_dirname -- "$file" || -$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$file" : 'X\(//\)[^/]' \| \ - X"$file" : 'X\(//\)$' \| \ - X"$file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ + am_filepart=`$as_basename -- "$am_mf" || +$as_expr X/"$am_mf" : '.*/\([^/][^/]*\)/*$' \| \ + X"$am_mf" : 'X\(//\)$' \| \ + X"$am_mf" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$am_mf" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } - /^X\(\/\/\)$/{ + /^X\/\(\/\/\)$/{ s//\1/ q } - /^X\(\/\).*/{ + /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` - as_dir=$dirpart/$fdir; as_fn_mkdir_p - # echo "creating $dirpart/$file" - echo '# dummy' > "$dirpart/$file" - done + { echo "$as_me:$LINENO: cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles" >&5 + (cd "$am_dirpart" \ + && sed -e '/# am--include-marker/d' "$am_filepart" \ + | $MAKE -f - am--depfiles) >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } || am_rc=$? done + if test $am_rc -ne 0; then + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "Something went wrong bootstrapping makefile fragments + for automatic dependency tracking. Try re-running configure with the + '--disable-dependency-tracking' option to at least be able to build + the package (albeit without support for automatic dependency tracking). +See \`config.log' for more details" "$LINENO" 5; } + fi + { am_dirpart=; unset am_dirpart;} + { am_filepart=; unset am_filepart;} + { am_mf=; unset am_mf;} + { am_rc=; unset am_rc;} + rm -f conftest-deps.mk } ;; diff --git a/configure.ac b/configure.ac index 7004bd3f..621312ac 100644 --- a/configure.ac +++ b/configure.ac @@ -5,51 +5,34 @@ # Copyright (c) 2006-2016 Dmitry V. Levin # Copyright (c) 2008-2015 Mike Frysinger # Copyright (c) 2015 Elvira Khabirova +# Copyright (c) 2002-2019 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: LGPL-2.1-or-later AC_PREREQ(2.57) AC_INIT([strace], m4_esyscmd([./git-version-gen .tarball-version]), - [strace-devel@lists.sourceforge.net], + [strace-devel@lists.strace.io], [strace], [https://strace.io]) -AC_COPYRIGHT([Copyright (C) 1999-2017 The strace developers.]) +m4_define([copyright_year], m4_esyscmd([./copyright-year-gen .year])) +m4_define([manpage_date], m4_esyscmd([./file-date-gen strace.1.in])) +AC_COPYRIGHT([Copyright (c) 1999-]copyright_year[ The strace developers.]) AC_CONFIG_SRCDIR([strace.c]) AC_CONFIG_AUX_DIR([.]) AC_CONFIG_HEADERS([config.h]) -AM_INIT_AUTOMAKE([foreign nostdinc dist-xz silent-rules parallel-tests]) -AM_EXTRA_RECURSIVE_TARGETS([check-valgrind]) +AM_INIT_AUTOMAKE([foreign nostdinc dist-xz silent-rules parallel-tests 1.13]) AM_MAINTAINER_MODE AC_CANONICAL_HOST -RPM_CHANGELOGTIME="$(LC_TIME=C date '+%a %b %d %Y')" +RPM_CHANGELOGTIME="$(LC_TIME=C date -u '+%a %b %d %Y')" AC_SUBST(RPM_CHANGELOGTIME) -DEB_CHANGELOGTIME="$(LC_TIME=C date -R)" +DEB_CHANGELOGTIME="$(LC_TIME=C date -u -R)" AC_SUBST(DEB_CHANGELOGTIME) AC_PROG_CC +AC_PROG_CC_STDC AC_PROG_CPP st_WARN_CFLAGS AX_PROG_CC_FOR_BUILD @@ -59,14 +42,51 @@ AC_PROG_RANLIB AC_USE_SYSTEM_EXTENSIONS AX_CODE_COVERAGE +AC_DEFINE([COPYRIGHT_YEAR], "[copyright_year]", [Current copyright year.]) +AC_SUBST([COPYRIGHT_YEAR], [copyright_year]) + +AC_DEFINE([MANPAGE_DATE], "[manpage_date]", [Date]) +AC_SUBST([MANPAGE_DATE], [manpage_date]) + AC_MSG_CHECKING([for supported architecture]) arch_m32= arch_mx32= +cc_flags_m32=-m32 +cc_flags_mx32=-mx32 case "$host_cpu" in +aarch64*) + arch=aarch64 + arch_m32=arm + AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.]) + ;; +alpha*) + arch=alpha + AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.]) + ;; +arc*) + arch=arc + AC_DEFINE([ARC], 1, [Define for the ARC architecture.]) + ;; +arm*) + arch=arm + AC_DEFINE([ARM], 1, [Define for the ARM architecture.]) + ;; +avr32*) + arch=avr32 + AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.]) + ;; bfin) arch=bfin AC_DEFINE([BFIN], 1, [Define for the Blackfin architecture.]) ;; +csky*) + arch=csky + AC_DEFINE([CSKY], 1, [Define for the C-SKY architecture]) + ;; +hppa*|parisc*) + arch=hppa + AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.]) + ;; i[[3456]]86|pentium) arch=i386 AC_DEFINE([I386], 1, [Define for the i386 architecture.]) @@ -79,26 +99,25 @@ m68k) arch=m68k AC_DEFINE([M68K], 1, [Define for the m68k architecture.]) ;; -sparc64*) - arch=sparc64 - arch_m32=sparc - AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.]) - ;; -sparc*) - arch=sparc - AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.]) - ;; metag*) arch=metag AC_DEFINE([METAG], 1, [Define for the Meta architecture.]) ;; +microblaze*) + arch=microblaze + AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.]) + ;; mips*) arch=mips AC_DEFINE([MIPS], 1, [Define for the MIPS architecture.]) ;; -alpha*) - arch=alpha - AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.]) +nios2*) + arch=nios2 + AC_DEFINE([NIOS2], 1, [Define for the Nios-II architecture.]) + ;; +or1k*) + arch=or1k + AC_DEFINE([OR1K], 1, [Define for the OpenRISC 1000 architecture.]) ;; powerpc*) AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.]) @@ -111,22 +130,9 @@ powerpc*) AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.]) fi ;; -arm*) - arch=arm - AC_DEFINE([ARM], 1, [Define for the ARM architecture.]) - ;; -aarch64*) - arch=aarch64 - arch_m32=arm - AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.]) - ;; -avr32*) - arch=avr32 - AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.]) - ;; -arc*) - arch=arc - AC_DEFINE([ARC], 1, [Define for the ARC architecture.]) +riscv*) + arch=riscv + AC_DEFINE([RISCV], 1, [Define for the RISC-V architecture]) ;; s390) arch=s390 @@ -134,12 +140,10 @@ s390) ;; s390x) arch=s390x + arch_m32=s390 + cc_flags_m32=-m31 AC_DEFINE([S390X], 1, [Define for the S390x architecture.]) ;; -hppa*|parisc*) - arch=hppa - AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.]) - ;; sh64*) arch=sh64 AC_DEFINE([SH64], 1, [Define for the SH64 architecture.]) @@ -148,6 +152,19 @@ sh*) arch=sh AC_DEFINE([SH], 1, [Define for the SH architecture.]) ;; +sparc64*) + arch=sparc64 + arch_m32=sparc + AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.]) + ;; +sparc*) + arch=sparc + AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.]) + ;; +tile*) + arch=tile + AC_DEFINE([TILE], 1, [Define for the Tile architecture]) + ;; x86?64*) arch_m32=i386 AC_TRY_COMPILE( @@ -161,42 +178,10 @@ x86?64*) AC_DEFINE([X32], 1, [Define for the 32bit AMD x86-64 architecture.]) fi ;; -cris|crisv10) - arch=crisv10 - AC_DEFINE([CRISV10], 1, [Define for the CRISv10 architecture.]) - ;; -crisv32) - arch=crisv32 - AC_DEFINE([CRISV32], 1, [Define for the CRISv32 architecture.]) - ;; -tile*) - arch=tile - AC_DEFINE([TILE], 1, [Define for the Tile architecture]) - ;; -microblaze*) - arch=microblaze - AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.]) - ;; -nios2*) - arch=nios2 - AC_DEFINE([NIOS2], 1, [Define for the Nios-II architecture.]) - ;; - -or1k*) - arch=or1k - AC_DEFINE([OR1K], 1, [Define for the OpenRISC 1000 architecture.]) - ;; - xtensa*) arch=xtensa AC_DEFINE([XTENSA], 1, [Define for the Xtensa architecture]) ;; - -riscv*) - arch=riscv - AC_DEFINE([RISCV], 1, [Define for the RISC-V architecture]) - ;; - *) AC_MSG_RESULT([NO!]) AC_MSG_ERROR([architecture $host_cpu is not supported by strace]) @@ -204,6 +189,8 @@ riscv*) esac AC_MSG_RESULT($arch) +arch_native=$arch + test -n "$arch_m32" || arch_m32=$arch test -n "$arch_mx32" || @@ -211,12 +198,15 @@ test -n "$arch_mx32" || AC_SUBST(arch) AC_SUBST(arch_m32) AC_SUBST(arch_mx32) +AC_SUBST(cc_flags_m32) +AC_SUBST(cc_flags_mx32) +AC_SUBST(arch_native) MIPS_ABI= if test "$arch" = mips; then AC_CACHE_CHECK([for _MIPS_SIM], [st_cv__MIPS_SIM], [AC_COMPUTE_INT([st_cv__MIPS_SIM], [_MIPS_SIM], , - [AC_MSG_ERROR([_MIPS_SIM cannot be determined])])]) + [AC_MSG_FAILURE([_MIPS_SIM cannot be determined])])]) # requires GCC >= 3.4 AC_CACHE_CHECK([for MIPS ABI], [st_cv_mips_abi], @@ -260,6 +250,7 @@ AC_TYPE_UID_T AC_CHECK_FUNCS(m4_normalize([ accept4 + be64toh fallocate fanotify_mark fopen64 @@ -268,6 +259,7 @@ AC_CHECK_FUNCS(m4_normalize([ fstatat ftruncate futimens + iconv_open if_indextoname open64 prctl @@ -278,6 +270,7 @@ AC_CHECK_FUNCS(m4_normalize([ signalfd stpcpy strerror + strndup strsignal sync_file_range utimensat @@ -290,11 +283,17 @@ AC_CHECK_TYPES([struct mmsghdr],,, [#include ]) AC_CHECK_TYPES([__kernel_long_t, __kernel_ulong_t],,, [#include ]) +AC_CHECK_TYPES([struct __kernel_timespec, struct __kernel_sock_timeval],,, +[#include ]) + AC_CHECK_TYPES([struct stat64, struct __old_kernel_stat],,, [#include #include ]) -AC_CHECK_TYPES([struct user_desc],,, [#include ]) +AC_CHECK_TYPES([struct user_desc], + [AC_CHECK_MEMBERS([struct user_desc.lm],,, + [#include ])],, + [#include ]) AC_CHECK_MEMBERS([struct stat.st_mtime_nsec, struct stat64.st_mtime_nsec],,, [#include @@ -306,15 +305,36 @@ AC_CHECK_TYPES(m4_normalize([ struct ptrace_peeksiginfo_args ]),,, [#include ]) +# For kernels that do not have v3.10-rc1~201^2~11 +AC_CHECK_TYPES([s390_compat_regs],,, [#include ]) + AC_CHECK_TYPES(m4_normalize([ struct flock, struct flock64, struct __kernel_flock, - struct __kernel_flock64 + struct __kernel_flock64, + struct f_owner_ex, + struct __kernel_f_owner_ex ]),,, [#include #include ]) +AC_CHECK_TYPES(m4_normalize([ + struct crypto_report_aead, + struct crypto_report_blkcipher, + struct crypto_report_cipher, + struct crypto_report_hash, + struct crypto_report_rng +]),,, [#include ]) + +AC_CHECK_TYPES(m4_normalize([ + struct kcmp_epoll_slot +]),,, [#include ]) + +AC_CHECK_TYPES(m4_normalize([ + struct keyctl_kdf_params +]),,, [#include ]) + AC_CHECK_MEMBERS([struct timex.tai],,, [#include ]) AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include ]) @@ -338,6 +358,7 @@ AC_CHECK_MEMBERS(m4_normalize([ struct perf_event_attr.use_clockid, struct perf_event_attr.context_switch, struct perf_event_attr.write_backward, + struct perf_event_attr.namespaces, struct perf_event_attr.bp_type, struct perf_event_attr.config1, struct perf_event_attr.config2, @@ -351,21 +372,41 @@ AC_CHECK_MEMBERS(m4_normalize([ AC_CHECK_HEADERS(m4_normalize([ asm/cachectl.h + asm/guarded_storage.h asm/sysmips.h - bluetooth/bluetooth.h elf.h + iconv.h inttypes.h linux/bsg.h + linux/cryptouser.h linux/dm-ioctl.h linux/dqblk_xfs.h linux/falloc.h + linux/fib_rules.h linux/fiemap.h - linux/filter.h linux/hiddev.h + linux/if_addr.h + linux/if_link.h + linux/io_uring.h linux/ip_vs.h linux/ipc.h + linux/kcmp.h + linux/kvm.h + linux/memfd.h linux/mmtimer.h linux/msg.h + linux/neighbour.h + linux/netfilter/ipset/ip_set.h + linux/netfilter/nf_tables.h + linux/netfilter/nf_tables_compat.h + linux/netfilter/nfnetlink.h + linux/netfilter/nfnetlink_acct.h + linux/netfilter/nfnetlink_conntrack.h + linux/netfilter/nfnetlink_cthelper.h + linux/netfilter/nfnetlink_cttimeout.h + linux/netfilter/nfnetlink_log.h + linux/netfilter/nfnetlink_queue.h + linux/nsfs.h linux/perf_event.h linux/quota.h linux/seccomp.h @@ -377,6 +418,7 @@ AC_CHECK_HEADERS(m4_normalize([ mqueue.h netinet/sctp.h netipx/ipx.h + paths.h scsi/sg.h stropts.h sys/conf.h @@ -385,7 +427,6 @@ AC_CHECK_HEADERS(m4_normalize([ sys/ipc.h sys/msg.h sys/quota.h - sys/reg.h sys/sem.h sys/shm.h sys/signalfd.h @@ -399,6 +440,9 @@ AC_CHECK_HEADERS([netinet/tcp.h netinet/udp.h],,, [#include ]) AC_CHECK_HEADERS([linux/mqueue.h],,, [#include ]) +AC_CHECK_HEADERS([linux/netfilter/xt_osf.h],,, [#include +#include ]) + AC_CHECK_HEADERS(m4_normalize([ linux/netfilter_arp/arp_tables.h linux/netfilter_bridge/ebtables.h @@ -412,77 +456,151 @@ AC_CHECK_HEADERS([linux/input.h], [ ]) AC_CHECK_HEADERS([linux/bpf.h], [ - AC_CACHE_CHECK([whether union bpf_attr.log_buf initialization works], - [st_cv_have_union_bpf_attr_log_buf], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[#include ]], - [[union bpf_attr a = { .log_buf = 0 };]])], - [st_cv_have_union_bpf_attr_log_buf=yes], - [st_cv_have_union_bpf_attr_log_buf=no])]) - if test $st_cv_have_union_bpf_attr_log_buf = yes; then - AC_DEFINE(HAVE_UNION_BPF_ATTR_LOG_BUF, [1], - [Define to 1 if union bpf_attr.log_buf initialization works]) - fi - AC_CACHE_CHECK([whether union bpf_attr.bpf_fd initialization works], - [st_cv_have_union_bpf_attr_bpf_fd], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[#include ]], - [[union bpf_attr a = { .bpf_fd = 0 };]])], - [st_cv_have_union_bpf_attr_bpf_fd=yes], - [st_cv_have_union_bpf_attr_bpf_fd=no])]) - if test $st_cv_have_union_bpf_attr_bpf_fd = yes; then - AC_DEFINE(HAVE_UNION_BPF_ATTR_BPF_FD, [1], - [Define to 1 if union bpf_attr.bpf_fd initialization works]) - fi - AC_CACHE_CHECK([whether union bpf_attr.attach_type initialization works], - [st_cv_have_union_bpf_attr_attach_type], - [AC_COMPILE_IFELSE( - [AC_LANG_PROGRAM([[#include ]], - [[union bpf_attr a = { .attach_type = 0 };]])], - [st_cv_have_union_bpf_attr_attach_type=yes], - [st_cv_have_union_bpf_attr_attach_type=no])]) - if test $st_cv_have_union_bpf_attr_attach_type = yes; then - AC_DEFINE(HAVE_UNION_BPF_ATTR_ATTACH_TYPE, [1], - [Define to 1 if union bpf_attr.attach_type initialization works]) - fi + AC_CHECK_TYPES(m4_normalize([ + struct bpf_insn, + struct bpf_map_info, + struct bpf_prog_info + ]),,, [#include ]) + st_BPF_ATTR +]) + +AC_CHECK_HEADERS([bluetooth/bluetooth.h], [ + AC_CHECK_MEMBERS([struct sockaddr_l2.l2_bdaddr_type],,, + [#include + #include ]) ]) +AC_CHECK_TYPES(m4_normalize([ + struct br_mdb_entry, + struct br_port_msg +]),,, [#include ]) +AC_CHECK_MEMBERS(m4_normalize([ + struct br_mdb_entry.flags, + struct br_mdb_entry.vid +]),,, [#include ]) + +AC_CHECK_TYPES([struct dcbmsg],,, [#include ]) +AC_CHECK_TYPES([struct ifaddrlblmsg],,, [#include ]) +AC_CHECK_TYPES([struct netconfmsg],,, [#include ]) + +AC_CHECK_TYPES(m4_normalize([ + struct rta_mfc_stats, + struct rtvia +]),,, [#include +#include ]) + +AC_CHECK_MEMBERS([struct ndt_stats.ndts_table_fulls],,, [#include ]) +AC_CHECK_TYPES(m4_normalize([ + struct ndt_config, + struct ndt_stats +]),,, [#include ]) + +AC_CHECK_TYPES(m4_normalize([ + struct ifla_bridge_id, + struct ifla_cacheinfo, + struct ifla_port_vsi, + struct rtnl_link_stats64 +]),,, [#include +#include ]) +AC_CHECK_MEMBERS(m4_normalize([ + struct rtnl_link_stats.rx_nohandler, + struct rtnl_link_stats64.rx_nohandler +]),,, [#include +#include ]) +AC_CHECK_DECLS(m4_normalize([ + IFLA_PORT_SELF, + IFLA_PROTINFO, + IFLA_AF_SPEC, + IFLA_XDP +]),,, [#include +#include ]) + +AC_CHECK_TYPES(m4_normalize([ + struct gnet_stats_basic, + struct gnet_stats_queue, + struct gnet_stats_rate_est, + struct gnet_stats_rate_est64 +]),,, [#include ]) + +AC_CHECK_TYPES([struct tc_sizespec],,, [#include +#include ]) +AC_CHECK_DECLS([TCA_STAB_DATA],,, [#include +#include ]) + +AC_CHECK_TYPES(m4_normalize([ + struct fib_rule_uid_range, + struct fib_rule_port_range +]),,, [#include ]) + AC_CHECK_TYPES([struct statfs], [ - AC_CHECK_MEMBERS([struct statfs.f_frsize],,, [#include -#include ]) - AC_CHECK_MEMBERS([struct statfs.f_flags],,, [#include -#include ]) - AC_CHECK_MEMBERS([struct statfs.f_fsid.val],,, [#include -#include ]) - AC_CHECK_MEMBERS([struct statfs.f_fsid.__val],,, [#include + AC_CHECK_MEMBERS(m4_normalize([ + struct statfs.f_frsize, + struct statfs.f_flags, + struct statfs.f_fsid.val, + struct statfs.f_fsid.__val + ]),,, [#include #include ]) ],, [#include #include ]) AC_CHECK_TYPES([struct statfs64], [ - AC_CHECK_MEMBERS([struct statfs64.f_frsize],,, [#include -#include ]) - AC_CHECK_MEMBERS([struct statfs64.f_flags],,, [#include -#include ]) - AC_CHECK_MEMBERS([struct statfs64.f_fsid.val],,, [#include -#include ]) - AC_CHECK_MEMBERS([struct statfs64.f_fsid.__val],,, [#include + AC_CHECK_MEMBERS(m4_normalize([ + struct statfs64.f_frsize, + struct statfs64.f_flags, + struct statfs64.f_fsid.val, + struct statfs64.f_fsid.__val + ]),,, [#include #include ]) ],, [#include #include ]) AC_CHECK_TYPES([struct blk_user_trace_setup],,, [#include ]) +AC_CHECK_TYPES([struct mtd_write_req],,, [#include ]) + +AC_CHECK_MEMBERS([struct ubi_attach_req.max_beb_per1024],,, [#include ]) + +AC_CHECK_TYPES(m4_normalize([ + struct ptp_sys_offset +]),,, [#include ]) + +AC_CHECK_TYPES(m4_normalize([ + struct kvm_cpuid2, + struct kvm_regs, + struct kvm_sregs, + struct kvm_userspace_memory_region +]),,, [#include ]) + +saved_CPPFLAGS="$CPPFLAGS" + +AC_CACHE_CHECK([whether can be used along with ], + [st_cv_linux_signal], + [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ +#include +#include ]],[])], + [st_cv_linux_signal=yes], + [st_cv_linux_signal=no])]) +if test "x$st_cv_linux_signal" = xno; then + mkdir -p linux/linux + cp $srcdir/linux/signal.h.in linux/linux/signal.h + CPPFLAGS="$CPPFLAGS -Ilinux" +fi + +AC_CHECK_TYPES([struct __aio_sigset],,, [#include ]) + +CPPFLAGS="$saved_CPPFLAGS" + AC_CHECK_HEADERS([linux/btrfs.h], [ AC_CHECK_MEMBERS(m4_normalize([ struct btrfs_ioctl_feature_flags.compat_flags, struct btrfs_ioctl_fs_info_args.nodesize, struct btrfs_ioctl_defrag_range_args.start, - struct btrfs_ioctl_search_args_v2.buf_size + struct btrfs_ioctl_search_args_v2.buf_size, + struct btrfs_ioctl_logical_ino_args.flags ]),,, [ #include #include ]) - AC_CHECK_DECLS(m4_normalize([BTRFS_COMPRESS_NONE, BTRFS_COMPRESS_ZLIB, - BTRFS_COMPRESS_LZO]),,,[ #include + AC_CHECK_DECLS(m4_normalize([BTRFS_COMPRESS_NONE, BTRFS_COMPRESS_ZLIB, + BTRFS_COMPRESS_LZO]),,,[ #include #include ])]) AC_CHECK_DECLS([sys_errlist]) @@ -535,6 +653,8 @@ AC_CHECK_DECLS(m4_normalize([ KERN_MAX_LOCK_DEPTH, KERN_NMI_WATCHDOG, KERN_PANIC_ON_NMI, + KERN_PANIC_ON_WARN, + KERN_PANIC_PRINT, NET_LLC, NET_NETFILTER, NET_DCCP, @@ -608,6 +728,8 @@ AC_CHECK_DECLS(m4_normalize([ V4L2_BUF_TYPE_SLICED_VBI_CAPTURE, V4L2_BUF_TYPE_SLICED_VBI_OUTPUT, V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY, + V4L2_BUF_TYPE_SDR_CAPTURE, + V4L2_BUF_TYPE_SDR_OUTPUT, V4L2_TUNER_RADIO, V4L2_TUNER_ANALOG_TV, V4L2_TUNER_DIGITAL_TV, @@ -647,26 +769,30 @@ AC_CHECK_DECLS(m4_normalize([ #include #include ]) -AC_CACHE_CHECK([for BLKGETSIZE64], [ac_cv_have_blkgetsize64], - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ -#include -#include ], [return !BLKGETSIZE64;])], - [ac_cv_have_blkgetsize64=yes], [ac_cv_have_blkgetsize64=no])] - if test $ac_cv_have_blkgetsize64 = yes; then - AC_DEFINE([HAVE_BLKGETSIZE64], [1], [Define to 1 if you have BLKGETSIZE64.]) - fi) +AC_CHECK_MEMBERS(m4_normalize([ + struct v4l2_window.global_alpha, + struct v4l2_sdr_format.buffersize +]),,, [#include +#include +#include +#include ]) AC_CHECK_SIZEOF([long]) +SIZEOF_LONG="$ac_cv_sizeof_long" +AC_SUBST(SIZEOF_LONG) AC_CHECK_SIZEOF([long long]) AC_CHECK_SIZEOF([off_t],,[#include ]) AC_CHECK_SIZEOF([kernel_long_t],,[#include "$srcdir/kernel_types.h"]) +SIZEOF_KERNEL_LONG_T="$ac_cv_sizeof_kernel_long_t" +AC_SUBST(SIZEOF_KERNEL_LONG_T) AC_CHECK_SIZEOF([struct i64_i32],,[struct i64_i32 {long long i64; int i32;};]) + AC_CACHE_CHECK([for SIGRTMIN], [st_cv_SIGRTMIN], [[st_cv_SIGRTMIN="$(echo SIGRTMIN | $CPP $CPPFLAGS -P -imacros asm/signal.h - | grep '^[0-9]')" - test -n "$st_cv_SIGRTMIN" || st_cv_SIGRTMIN=no]]) + test -n "$st_cv_SIGRTMIN" || st_cv_SIGRTMIN=no]]) if test "x$st_cv_SIGRTMIN" != xno; then AC_DEFINE_UNQUOTED([ASM_SIGRTMIN], [$st_cv_SIGRTMIN], [SIGRTMIN defined in ]) @@ -675,7 +801,7 @@ AC_CACHE_CHECK([for SA_RESTORER], [st_cv_SA_RESTORER], [st_cv_SA_RESTORER="$(echo SA_RESTORER | $CPP $CPPFLAGS -P -imacros asm/signal.h - | grep ^0x)" - test -n "$st_cv_SA_RESTORER" || st_cv_SA_RESTORER=no]) + test -n "$st_cv_SA_RESTORER" || st_cv_SA_RESTORER=no]) if test "x$st_cv_SA_RESTORER" != xno; then AC_DEFINE_UNQUOTED([ASM_SA_RESTORER], [$st_cv_SA_RESTORER], [SA_RESTORER defined in ]) @@ -690,113 +816,109 @@ if test "x$st_cv_have___builtin_popcount" = xyes; then [Define to 1 if the system provides __builtin_popcount function]) fi +AC_CACHE_CHECK([for program_invocation_name], [st_cv_have_program_invocation_name], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[return !*program_invocation_name]])], + [st_cv_have_program_invocation_name=yes], + [st_cv_have_program_invocation_name=no])]) +if test "x$st_cv_have_program_invocation_name" = xyes; then + AC_DEFINE([HAVE_PROGRAM_INVOCATION_NAME], [1], + [Define to 1 if the system provides program_invocation_name variable]) +fi + +AC_CACHE_CHECK([for static_assert], [st_cv_have_static_assert], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[static_assert(1,"")]] + ) + ], + [st_cv_have_static_assert=yes], + [AC_LINK_IFELSE([AC_LANG_PROGRAM([], + [[_Static_assert(1,"")]] + ) + ], + [st_cv_have_static_assert=_Static_assert], + [st_cv_have_static_assert=no] + ) + ] + ) + ] + ) +case "x$st_cv_have_static_assert" in + xyes) + AC_DEFINE([HAVE_STATIC_ASSERT], [1], + [Define to 1 if the system provides static_assert]) + ;; + x_Static_assert) + AC_DEFINE([HAVE__STATIC_ASSERT], [1], + [Define to 1 if the system provides _Static_assert]) + ;; +esac + AC_CHECK_LIB([dl], [dladdr], [dl_LIBS='-ldl'], [dl_LIBS=]) if test "x$ac_cv_lib_dl_dladdr" = xyes; then AC_DEFINE([HAVE_DLADDR], [1], [Define to 1 if the system provides dladdr]) fi AC_SUBST(dl_LIBS) +saved_LIBS="$LIBS" +AC_SEARCH_LIBS([timer_create], [rt]) +LIBS="$saved_LIBS" +case "$ac_cv_search_timer_create" in + no) AC_MSG_FAILURE([failed to find timer_create]) ;; + -l*) timer_LIBS="$ac_cv_search_timer_create" ;; + *) timer_LIBS= ;; +esac +AC_SUBST(timer_LIBS) + +saved_LIBS="$LIBS" +AC_SEARCH_LIBS([clock_gettime], [rt]) +LIBS="$saved_LIBS" +case "$ac_cv_search_clock_gettime" in + no) AC_MSG_FAILURE([failed to find clock_gettime]) ;; + -l*) clock_LIBS="$ac_cv_search_clock_gettime" ;; + *) clock_LIBS= ;; +esac +AC_SUBST(clock_LIBS) + +saved_LIBS="$LIBS" +AC_SEARCH_LIBS([mq_open], [rt]) +LIBS="$saved_LIBS" +case "$ac_cv_search_mq_open" in + -l*) mq_LIBS="$ac_cv_search_mq_open" ;; + *) mq_LIBS= ;; +esac +AC_SUBST(mq_LIBS) + AC_PATH_PROG([PERL], [perl]) -dnl stack trace with libunwind -libunwind_CPPFLAGS= -libunwind_LDFLAGS= -libunwind_LIBS= -AC_ARG_WITH([libunwind], - [AS_HELP_STRING([--with-libunwind], - [use libunwind to implement stack tracing support])], - [case "${withval}" in - yes|no|check) ;; - *) with_libunwind=yes - libunwind_CPPFLAGS="-I${withval}/include" - libunwind_LDFLAGS="-L${withval}/lib" ;; - esac], - [with_libunwind=check] -) - -use_libunwind=no -AS_IF([test "x$with_libunwind" != xno], - [saved_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="$CPPFLAGS $libunwind_CPPFLAGS" - - AC_CHECK_HEADERS([libunwind-ptrace.h], - [saved_LDFLAGS="$LDFLAGS" - LDFLAGS="$LDFLAGS $libunwind_LDFLAGS" - - AC_CHECK_LIB([unwind], [backtrace], - [libunwind_LIBS="-lunwind $libunwind_LIBS" - - AC_MSG_CHECKING([for unw_create_addr_space in libunwind-generic]) - saved_LIBS="$LIBS" - LIBS="-lunwind-generic $libunwind_LIBS $LIBS" - - AC_LINK_IFELSE( - [AC_LANG_PROGRAM([[#include ]], - [[return !unw_create_addr_space(0, 0)]]) - ], - [AC_MSG_RESULT([yes]) - libunwind_LIBS="-lunwind-generic $libunwind_LIBS" - - AC_CHECK_LIB([unwind-ptrace], [_UPT_create], - [libunwind_LIBS="-lunwind-ptrace $libunwind_LIBS" - use_libunwind=yes - ], - [if test "x$with_libunwind" != xcheck; then - AC_MSG_FAILURE([failed to find _UPT_create in libunwind-ptrace]) - fi - ], - [$libunwind_LIBS] - ) - ], - [AC_MSG_RESULT([no]) - if test "x$with_libunwind" != xcheck; then - AC_MSG_FAILURE([failed to find unw_create_addr_space in libunwind-generic]) - fi - ] - ) - - LIBS="$saved_LIBS" - ], - [if test "x$with_libunwind" != xcheck; then - AC_MSG_FAILURE([failed to find libunwind]) - fi - ], - [$libunwind_LIBS] - ) - - LDFLAGS="$saved_LDFLAGS" - ], - [if test "x$with_libunwind" != xcheck; then - AC_MSG_FAILURE([failed to find libunwind-ptrace.h]) - fi - ] - ) - - CPPFLAGS="$saved_CPPFLAGS" - ] -) - -dnl enable libunwind -AC_MSG_CHECKING([whether to enable stack tracing support using libunwind]) -if test "x$use_libunwind" = xyes; then - AC_DEFINE([USE_LIBUNWIND], 1, [Compile stack tracing functionality]) - AC_SUBST(libunwind_LIBS) - AC_SUBST(libunwind_LDFLAGS) - AC_SUBST(libunwind_CPPFLAGS) -fi -AM_CONDITIONAL([USE_LIBUNWIND], [test "x$use_libunwind" = xyes]) -AC_MSG_RESULT([$use_libunwind]) +AC_CHECK_TOOL([READELF], [readelf]) + +st_STACKTRACE if test "$arch" = mips && test "$no_create" != yes; then mkdir -p linux/mips if $srcdir/linux/mips/genstub.sh linux/mips; then AC_MSG_RESULT([Generated MIPS syscallent stubs]) else - AC_MSG_FAILURE([Failed to generate syscallent stubs]) + AC_MSG_ERROR([Failed to generate syscallent stubs]) fi fi -st_MPERS([m32], [aarch64|powerpc64|sparc64|tile|x32|x86_64]) +AC_ARG_ENABLE([mpers], + [AS_HELP_STRING([--enable-mpers=yes|no|check|m32|mx32], + [whether to enable multiple personalities support required + for proper decoding of structures used by tracees with + personalities that differ from the personality of strace, + default is yes.])], + [case "$enableval" in + yes|no|check|m32|mx32) enable_mpers="$enableval" ;; + *) AC_MSG_ERROR([bad value $enableval for enable-mpers option. + Valid options are: yes, no, check, m32, mx32.]) + ;; + esac], + [enable_mpers=yes]) + +st_MPERS([m32], [aarch64|powerpc64|riscv|s390x|sparc64|tile|x32|x86_64]) st_MPERS([mx32], [x86_64]) AX_VALGRIND_DFLT([sgcheck], [off]) @@ -806,6 +928,8 @@ AC_CONFIG_FILES([Makefile tests/Makefile tests-m32/Makefile tests-mx32/Makefile + strace.1 + strace-log-merge.1 strace.spec debian/changelog]) AC_OUTPUT diff --git a/copy_file_range.c b/copy_file_range.c index ad858a99..2065830c 100644 --- a/copy_file_range.c +++ b/copy_file_range.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/count.c b/count.c index 4b333bf3..561afe44 100644 --- a/count.c +++ b/count.c @@ -8,29 +8,10 @@ * * Copyright (c) 2004 Roland McGrath * Copyright (c) 2006 Dmitry V. Levin + * Copyright (c) 2006-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -38,73 +19,45 @@ /* Per-syscall stats structure */ struct call_counts { /* time may be total latency or system time */ - struct timeval time; - int calls, errors; + struct timespec time; + unsigned int calls, errors; }; static struct call_counts *countv[SUPPORTED_PERSONALITIES]; #define counts (countv[current_personality]) -static struct timeval shortest = { 1000000, 0 }; +static struct timespec overhead; void -count_syscall(struct tcb *tcp, const struct timeval *syscall_exiting_tv) +count_syscall(struct tcb *tcp, const struct timespec *syscall_exiting_ts) { - struct timeval wtv; - struct timeval *tv = &wtv; - struct call_counts *cc; - if (!scno_in_range(tcp->scno)) return; if (!counts) counts = xcalloc(nsyscalls, sizeof(*counts)); - cc = &counts[tcp->scno]; + struct call_counts *cc = &counts[tcp->scno]; cc->calls++; if (syserror(tcp)) cc->errors++; - /* tv = wall clock time spent while in syscall */ - tv_sub(tv, syscall_exiting_tv, &tcp->etime); - - /* Spent more wall clock time than spent system time? (usually yes) */ - if (tv_cmp(tv, &tcp->dtime) > 0) { - static struct timeval one_tick = { -1, 0 }; - - if (one_tick.tv_sec == -1) { - /* Initialize it. */ - struct itimerval it; - - memset(&it, 0, sizeof it); - it.it_interval.tv_usec = 1; - setitimer(ITIMER_REAL, &it, NULL); - getitimer(ITIMER_REAL, &it); - one_tick = it.it_interval; -//FIXME: this hack doesn't work (tested on linux-3.6.11): one_tick = 0.000000 -//tprintf(" one_tick.tv_usec:%u\n", (unsigned)one_tick.tv_usec); - } + if (count_wallclock) { + /* wall clock time spent while in syscall */ + struct timespec wts; + ts_sub(&wts, syscall_exiting_ts, &tcp->etime); - if (tv_nz(&tcp->dtime)) - /* tv = system time spent, if it isn't 0 */ - tv = &tcp->dtime; - else if (tv_cmp(tv, &one_tick) > 0) { - /* tv = smallest "sane" time interval */ - if (tv_cmp(&shortest, &one_tick) < 0) - tv = &shortest; - else - tv = &one_tick; - } + ts_add(&cc->time, &cc->time, &wts); + } else { + /* system CPU time spent while in syscall */ + ts_add(&cc->time, &cc->time, &tcp->dtime); } - if (tv_cmp(tv, &shortest) < 0) - shortest = *tv; - tv_add(&cc->time, &cc->time, count_wallclock ? &wtv : tv); } static int time_cmp(void *a, void *b) { - return -tv_cmp(&counts[*((int *) a)].time, + return -ts_cmp(&counts[*((int *) a)].time, &counts[*((int *) b)].time); } @@ -126,7 +79,6 @@ count_cmp(void *a, void *b) } static int (*sortfun)(); -static struct timeval overhead = { -1, -1 }; void set_sortby(const char *sortby) @@ -147,79 +99,72 @@ set_sortby(const char *sortby) void set_overhead(int n) { overhead.tv_sec = n / 1000000; - overhead.tv_usec = n % 1000000; + overhead.tv_nsec = n % 1000000 * 1000; } static void call_summary_pers(FILE *outf) { + static const char dashes[] = "----------------"; + static const char header[] = "%6.6s %11.11s %11.11s %9.9s %9.9s %s\n"; + static const char data[] = "%6.2f %11.6f %11lu %9u %9.u %s\n"; + static const char summary[] = "%6.6s %11.6f %11.11s %9u %9.u %s\n"; + unsigned int i; - int call_cum, error_cum; - struct timeval tv_cum, dtv; + unsigned int call_cum, error_cum; + struct timespec tv_cum, dtv; double float_tv_cum; double percent; - const char *dashes = "----------------"; - char error_str[sizeof(int)*3]; - int *sorted_count; + unsigned int *sorted_count; - fprintf(outf, "%6.6s %11.11s %11.11s %9.9s %9.9s %s\n", + fprintf(outf, header, "% time", "seconds", "usecs/call", "calls", "errors", "syscall"); - fprintf(outf, "%6.6s %11.11s %11.11s %9.9s %9.9s %s\n", - dashes, dashes, dashes, dashes, dashes, dashes); - - sorted_count = xcalloc(sizeof(int), nsyscalls); - call_cum = error_cum = tv_cum.tv_sec = tv_cum.tv_usec = 0; - if (overhead.tv_sec == -1) { - tv_mul(&overhead, &shortest, 8); - tv_div(&overhead, &overhead, 10); - } + fprintf(outf, header, dashes, dashes, dashes, dashes, dashes, dashes); + + sorted_count = xcalloc(sizeof(sorted_count[0]), nsyscalls); + call_cum = error_cum = tv_cum.tv_sec = tv_cum.tv_nsec = 0; for (i = 0; i < nsyscalls; i++) { sorted_count[i] = i; if (counts == NULL || counts[i].calls == 0) continue; - tv_mul(&dtv, &overhead, counts[i].calls); - tv_sub(&counts[i].time, &counts[i].time, &dtv); + ts_mul(&dtv, &overhead, counts[i].calls); + ts_sub(&counts[i].time, &counts[i].time, &dtv); + if (counts[i].time.tv_sec < 0 || counts[i].time.tv_nsec < 0) + counts[i].time.tv_sec = counts[i].time.tv_nsec = 0; call_cum += counts[i].calls; error_cum += counts[i].errors; - tv_add(&tv_cum, &tv_cum, &counts[i].time); + ts_add(&tv_cum, &tv_cum, &counts[i].time); } - float_tv_cum = tv_float(&tv_cum); + float_tv_cum = ts_float(&tv_cum); if (counts) { if (sortfun) - qsort((void *) sorted_count, nsyscalls, sizeof(int), sortfun); + qsort((void *) sorted_count, nsyscalls, + sizeof(sorted_count[0]), sortfun); for (i = 0; i < nsyscalls; i++) { double float_syscall_time; - int idx = sorted_count[i]; + unsigned int idx = sorted_count[i]; struct call_counts *cc = &counts[idx]; if (cc->calls == 0) continue; - tv_div(&dtv, &cc->time, cc->calls); - error_str[0] = '\0'; - if (cc->errors) - sprintf(error_str, "%u", cc->errors); - float_syscall_time = tv_float(&cc->time); + ts_div(&dtv, &cc->time, cc->calls); + float_syscall_time = ts_float(&cc->time); percent = (100.0 * float_syscall_time); if (percent != 0.0) percent /= float_tv_cum; /* else: float_tv_cum can be 0.0 too and we get 0/0 = NAN */ - fprintf(outf, "%6.2f %11.6f %11lu %9u %9.9s %s\n", + fprintf(outf, data, percent, float_syscall_time, - (long) (1000000 * dtv.tv_sec + dtv.tv_usec), - cc->calls, - error_str, sysent[idx].sys_name); + (long) (1000000 * dtv.tv_sec + dtv.tv_nsec / 1000), + cc->calls, cc->errors, sysent[idx].sys_name); } } free(sorted_count); - fprintf(outf, "%6.6s %11.11s %11.11s %9.9s %9.9s %s\n", - dashes, dashes, dashes, dashes, dashes, dashes); - error_str[0] = '\0'; - if (error_cum) - sprintf(error_str, "%u", error_cum); - fprintf(outf, "%6.6s %11.6f %11.11s %9u %9.9s %s\n", + fprintf(outf, header, dashes, dashes, dashes, dashes, dashes, dashes); + fprintf(outf, summary, "100.00", float_tv_cum, "", - call_cum, error_str, "total"); + call_cum, error_cum, "total"); } void @@ -235,8 +180,8 @@ call_summary(FILE *outf) set_personality(i); if (i) fprintf(outf, - "System call usage summary for %d bit mode:\n", - current_wordsize * 8); + "System call usage summary for %s mode:\n", + personality_names[i]); call_summary_pers(outf); } diff --git a/debian/changelog b/debian/changelog index 28bd52d2..b2c835a5 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,14 +1,86 @@ -strace (4.16-1) experimental; urgency=low +strace (5.1-1) experimental; urgency=low - * strace 4.16 snapshot. + * strace 5.1 snapshot. - -- Strace Tue, 14 Feb 2017 10:49:36 +0000 + -- Strace Wed, 22 May 2019 13:08:43 +0000 + +strace (5.0-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Tue, 19 Mar 2019 03:04:05 +0000 + +strace (4.26-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Wed, 26 Dec 2018 18:25:10 +0000 + +strace (4.25-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Tue, 30 Oct 2018 08:09:10 +0000 + +strace (4.24-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Tue, 14 Aug 2018 00:01:02 +0000 + +strace (4.23-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Thu, 14 Jun 2018 11:00:00 +0000 + +strace (4.22-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Thu, 05 Apr 2018 04:05:06 +0000 + +strace (4.21-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Tue, 13 Feb 2018 23:24:25 +0000 + +strace (4.20-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Mon, 13 Nov 2017 20:21:22 +0000 + +strace (4.19-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Wed, 05 Sep 2017 12:13:14 +0000 + +strace (4.18-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Wed, 05 Jul 2017 07:08:09 +0000 + +strace (4.17-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Wed, 24 May 2017 16:17:18 +0000 + +strace (4.16-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Tue, 14 Feb 2017 10:11:12 +0000 strace (4.15-1) unstable; urgency=medium * New upstream version. - -- Dmitry V. Levin Tue, 14 Dec 2016 08:09:10 +0000 + -- Dmitry V. Levin Wed, 14 Dec 2016 08:09:10 +0000 strace (4.14-1) unstable; urgency=medium @@ -899,23 +971,24 @@ strace (3.1-4) unstable; urgency=low * Fixed changestemplate - -- Wichert Akkerman , Thu Sep 12 14:59:44 MET DST 1996 + -- Wichert Akkerman Thu, 12 Sep 1996 14:59:44 +0200 strace (3.1-3) unstable; urgency=low * Revamped debian files - -- Wichert Akkerman , Thu Jul 11 20:19:11 MET DST 1996 + -- Wichert Akkerman Thu, 11 Jul 1996 20:19:11 +0200 strace (3.1-2) unstable; urgency=low + * Added some #ifdef's around IPX stuff to make it compilable on non-Linux systems. * changed debian.control and debian.rules to conform to new debian naming schemes * added architecture-option to debian.rules and debian.control - -- Wichert Akkerman + -- Wichert Akkerman Thu, 1 Jul 1996 00:00:00 +0000 strace (3.1-1) unstable; urgency=low @@ -928,4 +1001,4 @@ strace (3.1-1) unstable; urgency=low * added IP, IPX and TCP support to get-/setsockopt() * added IPX support - -- Wichert Akkerman + -- Wichert Akkerman Thu, 1 Jun 1996 00:00:00 +0000 diff --git a/debian/changelog.in b/debian/changelog.in index 288cef98..51e2fda7 100644 --- a/debian/changelog.in +++ b/debian/changelog.in @@ -4,11 +4,83 @@ strace (@PACKAGE_VERSION@-1) experimental; urgency=low -- Strace <@PACKAGE_BUGREPORT@> @DEB_CHANGELOGTIME@ +strace (5.0-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Tue, 19 Mar 2019 03:04:05 +0000 + +strace (4.26-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Wed, 26 Dec 2018 18:25:10 +0000 + +strace (4.25-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Tue, 30 Oct 2018 08:09:10 +0000 + +strace (4.24-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Tue, 14 Aug 2018 00:01:02 +0000 + +strace (4.23-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Thu, 14 Jun 2018 11:00:00 +0000 + +strace (4.22-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Thu, 05 Apr 2018 04:05:06 +0000 + +strace (4.21-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Tue, 13 Feb 2018 23:24:25 +0000 + +strace (4.20-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Mon, 13 Nov 2017 20:21:22 +0000 + +strace (4.19-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Wed, 05 Sep 2017 12:13:14 +0000 + +strace (4.18-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Wed, 05 Jul 2017 07:08:09 +0000 + +strace (4.17-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Wed, 24 May 2017 16:17:18 +0000 + +strace (4.16-1) unstable; urgency=medium + + * New upstream version. + + -- Dmitry V. Levin Tue, 14 Feb 2017 10:11:12 +0000 + strace (4.15-1) unstable; urgency=medium * New upstream version. - -- Dmitry V. Levin Tue, 14 Dec 2016 08:09:10 +0000 + -- Dmitry V. Levin Wed, 14 Dec 2016 08:09:10 +0000 strace (4.14-1) unstable; urgency=medium @@ -899,23 +971,24 @@ strace (3.1-4) unstable; urgency=low * Fixed changestemplate - -- Wichert Akkerman , Thu Sep 12 14:59:44 MET DST 1996 + -- Wichert Akkerman Thu, 12 Sep 1996 14:59:44 +0200 strace (3.1-3) unstable; urgency=low * Revamped debian files - -- Wichert Akkerman , Thu Jul 11 20:19:11 MET DST 1996 + -- Wichert Akkerman Thu, 11 Jul 1996 20:19:11 +0200 strace (3.1-2) unstable; urgency=low + * Added some #ifdef's around IPX stuff to make it compilable on non-Linux systems. * changed debian.control and debian.rules to conform to new debian naming schemes * added architecture-option to debian.rules and debian.control - -- Wichert Akkerman + -- Wichert Akkerman Thu, 1 Jul 1996 00:00:00 +0000 strace (3.1-1) unstable; urgency=low @@ -928,4 +1001,4 @@ strace (3.1-1) unstable; urgency=low * added IP, IPX and TCP support to get-/setsockopt() * added IPX support - -- Wichert Akkerman + -- Wichert Akkerman Thu, 1 Jun 1996 00:00:00 +0000 diff --git a/debian/compat b/debian/compat index 7f8f011e..f599e28b 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -7 +10 diff --git a/debian/control b/debian/control index 79773c33..38e13a13 100644 --- a/debian/control +++ b/debian/control @@ -2,14 +2,14 @@ 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 [amd64 i386 powerpc ppc64 s390 sparc sparc64 x32], debhelper (>= 7.0.0), gawk -Standards-Version: 3.9.6 -Homepage: http://sourceforge.net/projects/strace/ -Vcs-Git: https://anonscm.debian.org/git/collab-maint/strace.git -Vcs-Browser: https://anonscm.debian.org/git/collab-maint/strace.git +Build-Depends: libc6-dev (>= 2.2.2) [!alpha !ia64], libc6.1-dev (>= 2.2.2) [alpha ia64], gcc-multilib [amd64 i386 powerpc ppc64 ppc64el s390 s390x sparc sparc64 x32], debhelper (>= 7.0.0), gawk, libdw-dev, libiberty-dev, libbluetooth-dev +Standards-Version: 4.1.3 +Homepage: https://strace.io +Vcs-Git: https://salsa.debian.org/debian/strace.git +Vcs-Browser: https://salsa.debian.org/debian/strace Package: strace -Architecture: alpha amd64 arm64 armeb armel armhf hppa i386 ia64 m68k mips mipsel mips64 mips64el or1k powerpc powerpcspe ppc64 ppc64el s390 s390x sh4 sparc sparc64 x32 +Architecture: linux-any Depends: ${shlibs:Depends}, ${misc:Depends} Description: System call tracer strace is a system call tracer, i.e. a debugging tool which prints out @@ -23,7 +23,7 @@ Description: System call tracer Package: strace64 Architecture: i386 powerpc s390 sparc -Priority: extra +Priority: optional Depends: ${shlibs:Depends}, ${misc:Depends} Description: System call tracer for 64bit binaries strace is a system call tracer, i.e. a debugging tool which prints out @@ -41,8 +41,8 @@ Description: System call tracer for 64bit binaries Package: strace-udeb Section: debian-installer XC-Package-Type: udeb -Priority: extra -Architecture: alpha amd64 arm64 armeb armel armhf hppa i386 ia64 m68k mips mipsel mips64 mips64el or1k powerpc powerpcspe ppc64 ppc64el s390 sh4 sparc sparc64 x32 +Priority: optional +Architecture: linux-any Depends: ${shlibs:Depends}, ${misc:Depends} Description: System call tracer strace is a system call tracer, i.e. a debugging tool which prints out diff --git a/debian/copyright b/debian/copyright index fd355077..abaa28b6 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,7 +1,7 @@ This is the Debian packaged version of strace. For a complete list of changes from the upstream version please see the changelog. -The upstream sources can be found at http://sourceforge.net/projects/strace/ +The upstream sources can be found at https://github.com/strace/strace/ This is the copyright as found in the upstream sources: @@ -10,30 +10,18 @@ Copyright (c) 1993 Branko Lankester Copyright (c) 1993 Ulrich Pegelow Copyright (c) 1995, 1996 Michael Elizabeth Chastain Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey -Copyright (C) 1998-2003 Wichert Akkerman -Copyright (c) 2002-2008 Roland McGrath -Copyright (c) 2003-2008 Dmitry V. Levin -Copyright (c) 2007-2008 Jan Kratochvil +Copyright (c) 1998-2001 Wichert Akkerman +Copyright (c) 2001-2019 The strace developers. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions -are met: -1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. +strace is free software; you can redistribute it and/or modify it +under the terms of the GNU Lesser General Public License as published +by the Free Software Foundation; either version 2.1 of the License, +or (at your option) any later version. -THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +strace is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See LGPL-2.1-or-later for more details. + +strace test suite is provided under the terms of the GNU General Public License +version 2 or later, see tests/COPYING for more details. diff --git a/debian/rules b/debian/rules index 4b556a73..b22767ac 100755 --- a/debian/rules +++ b/debian/rules @@ -5,6 +5,7 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk +include /usr/share/dpkg/architecture.mk CFLAGS += -Wall -g @@ -19,9 +20,7 @@ ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) MAKEFLAGS += -j$(NUMJOBS) endif -DEB_BUILD_GNU_TYPE := $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) -DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) -DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) +extra_build_targets += build-udeb-stamp arch64_map = i386=x86_64 powerpc=powerpc64 sparc=sparc64 s390=s390x ifneq (,$(filter $(DEB_HOST_ARCH)=%, $(arch64_map))) @@ -44,25 +43,34 @@ build: build-arch build-indep build-arch: build-stamp $(extra_build_targets) build-indep: build-stamp $(extra_build_targets) +configure: + ./bootstrap + %-stamp: %/Makefile $(MAKE) -C $* ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) + $*/strace -V $(MAKE) -C $* check VERBOSE=1 endif touch $@ -build/Makefile: +build/Makefile: configure + mkdir -p $(@D) + cd $(@D); sh ../configure --enable-mpers=check --prefix=/usr $(CONFIG_OPTS) + +build-udeb/Makefile: configure mkdir -p $(@D) - cd $(@D); sh ../configure --prefix=/usr $(CONFIG_OPTS) + cd $(@D); sh ../configure --enable-mpers=check --prefix=/usr \ + --without-stacktrace --without-libiberty $(CONFIG_OPTS) -build64/Makefile: +build64/Makefile: configure mkdir -p $(@D) - cd $(@D); CC="$(CC64)" sh ../configure --prefix=/usr --build=$(DEB_BUILD_GNU_TYPE) --host=$(HOST64) + cd $(@D); CC="$(CC64)" sh ../configure --enable-mpers=check --prefix=/usr --build=$(DEB_BUILD_GNU_TYPE) --host=$(HOST64) clean: dh_testdir dh_testroot - rm -rf build build64 strace64.1 debian/strace64.substvars + rm -rf build build-udeb build64 strace64.1 debian/strace64.substvars dh_clean binary: binary-indep binary-arch @@ -74,22 +82,22 @@ binary-arch: build # prepare 64bit executable and manpage, if it has been built test -f build64-stamp && ( mv build64/strace build64/strace64 ; \ - cp strace.1 strace64.1 ) || true - - dh_testdir -s - dh_testroot -s - dh_installdirs -s - dh_installdocs -s - dh_installman -s - dh_installexamples -s - dh_installchangelogs -s - dh_install -s - dh_link -s - dh_strip -s - dh_compress -s - dh_fixperms -s - dh_installdeb -s - dh_shlibdeps -s - dh_gencontrol -s - dh_md5sums -s - dh_builddeb -s + mv build64/strace.1 build64/strace64.1 ) || true + + dh_testdir -a + dh_testroot -a + dh_installdirs -a + dh_installdocs -a + dh_installman -a + dh_installexamples -a + dh_installchangelogs -a + dh_install -a + dh_link -a + dh_strip -a + dh_compress -a + dh_fixperms -a + dh_installdeb -a + dh_shlibdeps -a + dh_gencontrol -a + dh_md5sums -a + dh_builddeb -a diff --git a/debian/strace-udeb.install b/debian/strace-udeb.install index 1f419282..d823419a 100644 --- a/debian/strace-udeb.install +++ b/debian/strace-udeb.install @@ -1 +1 @@ -build/strace usr/bin +build-udeb/strace usr/bin diff --git a/debian/strace.install b/debian/strace.install index 1f419282..30b0a6b0 100644 --- a/debian/strace.install +++ b/debian/strace.install @@ -1 +1,2 @@ build/strace usr/bin +strace-log-merge usr/bin diff --git a/debian/strace.manpages b/debian/strace.manpages index 5e74dd72..9fb376b3 100644 --- a/debian/strace.manpages +++ b/debian/strace.manpages @@ -1 +1,2 @@ -strace.1 +build/strace.1 +build/strace-log-merge.1 diff --git a/debian/strace64.manpages b/debian/strace64.manpages index e3adc937..fb5fb240 100644 --- a/debian/strace64.manpages +++ b/debian/strace64.manpages @@ -1 +1 @@ -strace64.1 +build64/strace64.1 diff --git a/defs.h b/defs.h index b333a221..512ad51f 100644 --- a/defs.h +++ b/defs.h @@ -2,210 +2,192 @@ * Copyright (c) 1991, 1992 Paul Kranenburg * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 2001-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #ifndef STRACE_DEFS_H -#define STRACE_DEFS_H - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include +# define STRACE_DEFS_H + +# ifdef HAVE_CONFIG_H +# include "config.h" +# endif + +# include +# include +# include +# include +# include +# include +# include +# include +# include /* Open-coding isprint(ch) et al proved more efficient than calling * generalized libc interface. We don't *want* to do non-ASCII anyway. */ /* #include */ -#include -#include -#include -#include - -#include "kernel_types.h" -#include "mpers_type.h" -#include "gcc_compat.h" -#include "sysent.h" - -#ifndef HAVE_STRERROR +# include +# include +# include +# include + +# include "arch_defs.h" +# include "error_prints.h" +# include "gcc_compat.h" +# include "kernel_types.h" +# include "list.h" +# include "macros.h" +# include "mpers_type.h" +# include "string_to_uint.h" +# include "sysent.h" +# include "xmalloc.h" + +# ifndef HAVE_STRERROR const char *strerror(int); -#endif -#ifndef HAVE_STPCPY +# endif +# ifndef HAVE_STPCPY /* Some libc have stpcpy, some don't. Sigh... * Roll our private implementation... */ -#undef stpcpy -#define stpcpy strace_stpcpy +# undef stpcpy +# define stpcpy strace_stpcpy extern char *stpcpy(char *dst, const char *src); -#endif - -#ifndef offsetofend -# define offsetofend(type, member) \ - (offsetof(type, member) + sizeof(((type *)NULL)->member)) -#endif - -#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]) + MUST_BE_ARRAY(a)) - -/* macros */ -#ifndef MAX -# define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif -#ifndef MIN -# define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif -#define CLAMP(val, min, max) MIN(MAX(min, val), max) +# endif /* Glibc has an efficient macro for sigemptyset * (it just does one or two assignments of 0 to internal vector of longs). */ -#if defined(__GLIBC__) && defined(__sigemptyset) && !defined(sigemptyset) -# define sigemptyset __sigemptyset -#endif +# if defined(__GLIBC__) && defined(__sigemptyset) && !defined(sigemptyset) +# define sigemptyset __sigemptyset +# endif /* Configuration section */ -#ifndef DEFAULT_STRLEN +# ifndef DEFAULT_STRLEN /* default maximum # of bytes printed in `printstr', change with -s switch */ -# define DEFAULT_STRLEN 32 -#endif -#ifndef DEFAULT_ACOLUMN -# define DEFAULT_ACOLUMN 40 /* default alignment column for results */ -#endif +# define DEFAULT_STRLEN 32 +# endif +# ifndef DEFAULT_ACOLUMN +# define DEFAULT_ACOLUMN 40 /* default alignment column for results */ +# endif /* * Maximum number of args to a syscall. * * Make sure that all entries in all syscallent.h files have nargs <= MAX_ARGS! * linux//syscallent*.h: - * all have nargs <= 6 except mips o32 which has nargs <= 7. + * all have nargs <= 6 except mips o32 which has nargs <= 7. */ -#ifndef MAX_ARGS -# ifdef LINUX_MIPSO32 -# define MAX_ARGS 7 -# else -# define MAX_ARGS 6 +# ifndef MAX_ARGS +# ifdef LINUX_MIPSO32 +# define MAX_ARGS 7 +# else +# define MAX_ARGS 6 +# endif # endif -#endif /* default sorting method for call profiling */ -#ifndef DEFAULT_SORTBY -# define DEFAULT_SORTBY "time" -#endif -/* - * Experimental code using PTRACE_SEIZE can be enabled here. - * This needs Linux kernel 3.4.x or later to work. - */ -#define USE_SEIZE 1 +# ifndef DEFAULT_SORTBY +# define DEFAULT_SORTBY "time" +# endif + /* To force NOMMU build, set to 1 */ -#define NOMMU_SYSTEM 0 - -#ifndef ERESTARTSYS -# define ERESTARTSYS 512 -#endif -#ifndef ERESTARTNOINTR -# define ERESTARTNOINTR 513 -#endif -#ifndef ERESTARTNOHAND -# define ERESTARTNOHAND 514 -#endif -#ifndef ERESTART_RESTARTBLOCK -# define ERESTART_RESTARTBLOCK 516 -#endif - -#if defined X86_64 -# define SUPPORTED_PERSONALITIES 3 -# define PERSONALITY2_WORDSIZE 4 -# define PERSONALITY2_KLONGSIZE PERSONALITY0_KLONGSIZE -#elif defined AARCH64 \ - || defined POWERPC64 \ - || defined RISCV \ - || defined SPARC64 \ - || defined TILE \ - || defined X32 -# define SUPPORTED_PERSONALITIES 2 -#else -# define SUPPORTED_PERSONALITIES 1 -#endif - -#if defined TILE && defined __tilepro__ -# define DEFAULT_PERSONALITY 1 -#else -# define DEFAULT_PERSONALITY 0 -#endif - -#define PERSONALITY0_WORDSIZE SIZEOF_LONG -#define PERSONALITY0_KLONGSIZE SIZEOF_KERNEL_LONG_T -#define PERSONALITY0_INCLUDE_PRINTERS_DECLS "native_printer_decls.h" -#define PERSONALITY0_INCLUDE_PRINTERS_DEFS "native_printer_defs.h" - -#if SUPPORTED_PERSONALITIES > 1 -# define PERSONALITY1_WORDSIZE 4 -# define PERSONALITY1_KLONGSIZE PERSONALITY1_WORDSIZE -#endif - -#if SUPPORTED_PERSONALITIES > 1 && defined HAVE_M32_MPERS -# define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h" -# define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h" -# define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h" -# define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h" -#else -# define PERSONALITY1_INCLUDE_PRINTERS_DECLS "native_printer_decls.h" -# define PERSONALITY1_INCLUDE_PRINTERS_DEFS "native_printer_defs.h" -# define PERSONALITY1_INCLUDE_FUNCS "empty.h" -#endif - -#if SUPPORTED_PERSONALITIES > 2 && defined HAVE_MX32_MPERS -# define PERSONALITY2_INCLUDE_FUNCS "mx32_funcs.h" -# define PERSONALITY2_INCLUDE_PRINTERS_DECLS "mx32_printer_decls.h" -# define PERSONALITY2_INCLUDE_PRINTERS_DEFS "mx32_printer_defs.h" -# define MPERS_mx32_IOCTL_MACROS "ioctl_redefs2.h" -#else -# define PERSONALITY2_INCLUDE_PRINTERS_DECLS "native_printer_decls.h" -# define PERSONALITY2_INCLUDE_PRINTERS_DEFS "native_printer_defs.h" -# define PERSONALITY2_INCLUDE_FUNCS "empty.h" -#endif +# define NOMMU_SYSTEM 0 + +# ifndef ERESTARTSYS +# define ERESTARTSYS 512 +# endif +# ifndef ERESTARTNOINTR +# define ERESTARTNOINTR 513 +# endif +# ifndef ERESTARTNOHAND +# define ERESTARTNOHAND 514 +# endif +# ifndef ERESTART_RESTARTBLOCK +# define ERESTART_RESTARTBLOCK 516 +# endif + +# define PERSONALITY0_WORDSIZE SIZEOF_LONG +# define PERSONALITY0_KLONGSIZE SIZEOF_KERNEL_LONG_T +# define PERSONALITY0_INCLUDE_PRINTERS_DECLS "native_printer_decls.h" +# define PERSONALITY0_INCLUDE_PRINTERS_DEFS "native_printer_defs.h" + +# if SUPPORTED_PERSONALITIES > 1 +# define PERSONALITY1_WORDSIZE 4 +# define PERSONALITY1_KLONGSIZE PERSONALITY1_WORDSIZE +# endif + +# if SUPPORTED_PERSONALITIES > 2 +# define PERSONALITY2_WORDSIZE 4 +# define PERSONALITY2_KLONGSIZE PERSONALITY0_KLONGSIZE +# endif + +# if SUPPORTED_PERSONALITIES > 1 && defined HAVE_M32_MPERS +# define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h" +# define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h" +# define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h" +# define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h" +# define HAVE_PERSONALITY_1_MPERS 1 +# else +# define PERSONALITY1_INCLUDE_PRINTERS_DECLS "native_printer_decls.h" +# define PERSONALITY1_INCLUDE_PRINTERS_DEFS "native_printer_defs.h" +# define PERSONALITY1_INCLUDE_FUNCS "empty.h" +# define HAVE_PERSONALITY_1_MPERS 0 +# endif + +# if SUPPORTED_PERSONALITIES > 2 && defined HAVE_MX32_MPERS +# define PERSONALITY2_INCLUDE_FUNCS "mx32_funcs.h" +# define PERSONALITY2_INCLUDE_PRINTERS_DECLS "mx32_printer_decls.h" +# define PERSONALITY2_INCLUDE_PRINTERS_DEFS "mx32_printer_defs.h" +# define MPERS_mx32_IOCTL_MACROS "ioctl_redefs2.h" +# define HAVE_PERSONALITY_2_MPERS 1 +# else +# define PERSONALITY2_INCLUDE_PRINTERS_DECLS "native_printer_decls.h" +# define PERSONALITY2_INCLUDE_PRINTERS_DEFS "native_printer_defs.h" +# define PERSONALITY2_INCLUDE_FUNCS "empty.h" +# define HAVE_PERSONALITY_2_MPERS 0 +# endif + +# ifdef WORDS_BIGENDIAN +# define is_bigendian true +# else +# define is_bigendian false +# endif typedef struct ioctlent { const char *symbol; unsigned int code; } struct_ioctlent; +# define INJECT_F_SIGNAL 0x01 +# define INJECT_F_ERROR 0x02 +# define INJECT_F_RETVAL 0x04 +# define INJECT_F_DELAY_ENTER 0x08 +# define INJECT_F_DELAY_EXIT 0x10 +# define INJECT_F_SYSCALL 0x20 + +# define INJECT_ACTION_FLAGS \ + (INJECT_F_SIGNAL \ + |INJECT_F_ERROR \ + |INJECT_F_RETVAL \ + |INJECT_F_DELAY_ENTER \ + |INJECT_F_DELAY_EXIT \ + ) + +struct inject_data { + uint8_t flags; /* 6 of 8 flags are used so far */ + uint8_t signo; /* NSIG <= 128 */ + uint16_t rval_idx; /* index in retval_vec */ + uint16_t delay_idx; /* index in delay_data_vec */ + uint16_t scno; /* syscall to be injected instead of -1 */ +}; + struct inject_opts { uint16_t first; uint16_t step; - uint16_t signo; - int rval; + struct inject_data data; }; -#define MAX_ERRNO_VALUE 4095 -#define INJECT_OPTS_RVAL_DEFAULT (-(MAX_ERRNO_VALUE + 1)) +# define MAX_ERRNO_VALUE 4095 /* Trace Control Block */ struct tcb { @@ -216,137 +198,207 @@ struct tcb { kernel_ulong_t scno; /* System call number */ kernel_ulong_t u_arg[MAX_ARGS]; /* System call arguments */ kernel_long_t u_rval; /* Return value */ -#if SUPPORTED_PERSONALITIES > 1 +# if SUPPORTED_PERSONALITIES > 1 unsigned int currpers; /* Personality at the time of scno update */ -#endif +# endif int sys_func_rval; /* Syscall entry parser's return value */ int curcol; /* Output column for this process */ FILE *outf; /* Output file for this process */ const char *auxstr; /* Auxiliary info from syscall (see RVAL_STR) */ void *_priv_data; /* Private data for syscall decoding functions */ void (*_free_priv_data)(void *); /* Callback for freeing priv_data */ - const struct_sysent *s_ent; /* sysent[scno] or dummy struct for bad scno */ + const struct_sysent *s_ent; /* sysent[scno] or a stub struct for bad + * scno. Use tcp_sysent() macro for access. + */ const struct_sysent *s_prev_ent; /* for "resuming interrupted SYSCALL" msg */ struct inject_opts *inject_vec[SUPPORTED_PERSONALITIES]; - struct timeval stime; /* System time usage as of last process wait */ - struct timeval dtime; /* Delta for system time usage */ - struct timeval etime; /* Syscall entry time */ - -#ifdef USE_LIBUNWIND - struct UPT_info* libunwind_ui; - struct mmap_cache_t* mmap_cache; - unsigned int mmap_cache_size; - unsigned int mmap_cache_generation; - struct queue_t* queue; -#endif + struct timespec stime; /* System time usage as of last process wait */ + struct timespec dtime; /* Delta for system time usage */ + struct timespec etime; /* Syscall entry time */ + struct timespec delay_expiration_time; /* When does the delay end */ + + struct mmap_cache_t *mmap_cache; + + /* + * Data that is stored during process wait traversal. + * We use indices as the actual data is stored in an array + * that is realloc'ed at runtime. + */ + size_t wait_data_idx; + /** Wait data storage for a delayed process. */ + struct tcb_wait_data *delayed_wait_data; + struct list_item wait_list; + + +# ifdef HAVE_LINUX_KVM_H + struct vcpu_info *vcpu_info_list; +# endif + +# ifdef ENABLE_STACKTRACE + void *unwind_ctx; + struct unwind_queue_t *unwind_queue; +# endif }; /* TCB flags */ /* We have attached to this process, but did not see it stopping yet */ -#define TCB_STARTUP 0x01 -#define TCB_IGNORE_ONE_SIGSTOP 0x02 /* Next SIGSTOP is to be ignored */ +# define TCB_STARTUP 0x01 +# define TCB_IGNORE_ONE_SIGSTOP 0x02 /* Next SIGSTOP is to be ignored */ /* * Are we in system call entry or in syscall exit? * - * This bit is set after all syscall entry processing is done. - * Therefore, this bit will be set when next ptrace stop occurs, - * which should be syscall exit stop. Other stops which are possible - * directly after syscall entry (death, ptrace event stop) - * are simpler and handled without calling trace_syscall(), therefore - * the places where TCB_INSYSCALL can be set but we aren't in syscall stop - * are limited to trace(), this condition is never observed in trace_syscall() - * and below. - * The bit is cleared after all syscall exit processing is done. + * This bit is set in syscall_entering_finish() and cleared in + * syscall_exiting_finish(). + * Other stops which are possible directly after syscall entry (death, ptrace + * event stop) are handled without calling syscall_{entering,exiting}_*(). * - * Use entering(tcp) / exiting(tcp) to check this bit to make code more readable. + * Use entering(tcp) / exiting(tcp) to check this bit to make code more + * readable. */ -#define TCB_INSYSCALL 0x04 -#define TCB_ATTACHED 0x08 /* We attached to it already */ -#define TCB_REPRINT 0x10 /* We should reprint this syscall on exit */ -#define TCB_FILTERED 0x20 /* This system call has been filtered out */ -#define TCB_TAMPERED 0x40 /* A syscall has been tampered with */ -#define TCB_HIDE_LOG 0x80 /* We should hide everything (until execve) */ -#define TCB_SKIP_DETACH_ON_FIRST_EXEC 0x100 /* -b execve should skip detach on first execve */ +# define TCB_INSYSCALL 0x04 +# define TCB_ATTACHED 0x08 /* We attached to it already */ +# define TCB_REPRINT 0x10 /* We should reprint this syscall on exit */ +# define TCB_FILTERED 0x20 /* This system call has been filtered out */ +# define TCB_TAMPERED 0x40 /* A syscall has been tampered with */ +# define TCB_HIDE_LOG 0x80 /* We should hide everything (until execve) */ +# define TCB_CHECK_EXEC_SYSCALL 0x100 /* Check whether this execve syscall succeeded */ +# define TCB_SKIP_DETACH_ON_FIRST_EXEC 0x200 /* -b execve should skip detach on first execve */ +# define TCB_GRABBED 0x400 /* We grab the process and can catch it + * in the middle of a syscall */ +# define TCB_RECOVERING 0x800 /* We try to recover after detecting incorrect + * syscall entering/exiting state */ +# define TCB_INJECT_DELAY_EXIT 0x1000 /* Current syscall needs to be delayed + on exit */ +# define TCB_DELAYED 0x2000 /* Current syscall has been delayed */ +# define TCB_TAMPERED_NO_FAIL 0x4000 /* We tamper tcb with syscall + that should not fail. */ /* qualifier flags */ -#define QUAL_TRACE 0x001 /* this system call should be traced */ -#define QUAL_ABBREV 0x002 /* abbreviate the structures of this syscall */ -#define QUAL_VERBOSE 0x004 /* decode the structures of this syscall */ -#define QUAL_RAW 0x008 /* print all args in hex for this syscall */ -#define QUAL_INJECT 0x010 /* tamper with this system call on purpose */ -#define QUAL_SIGNAL 0x100 /* report events with this signal */ -#define QUAL_READ 0x200 /* dump data read from this file descriptor */ -#define QUAL_WRITE 0x400 /* dump data written to this file descriptor */ - -#define DEFAULT_QUAL_FLAGS (QUAL_TRACE | QUAL_ABBREV | QUAL_VERBOSE) - -#define entering(tcp) (!((tcp)->flags & TCB_INSYSCALL)) -#define exiting(tcp) ((tcp)->flags & TCB_INSYSCALL) -#define syserror(tcp) ((tcp)->u_error != 0) -#define verbose(tcp) ((tcp)->qual_flg & QUAL_VERBOSE) -#define abbrev(tcp) ((tcp)->qual_flg & QUAL_ABBREV) -#define filtered(tcp) ((tcp)->flags & TCB_FILTERED) -#define hide_log(tcp) ((tcp)->flags & TCB_HIDE_LOG) - -#include "xlat.h" +# define QUAL_TRACE 0x001 /* this system call should be traced */ +# define QUAL_ABBREV 0x002 /* abbreviate the structures of this syscall */ +# define QUAL_VERBOSE 0x004 /* decode the structures of this syscall */ +# define QUAL_RAW 0x008 /* print all args in hex for this syscall */ +# define QUAL_INJECT 0x010 /* tamper with this system call on purpose */ + +# define DEFAULT_QUAL_FLAGS (QUAL_TRACE | QUAL_ABBREV | QUAL_VERBOSE) + +# define entering(tcp) (!((tcp)->flags & TCB_INSYSCALL)) +# define exiting(tcp) ((tcp)->flags & TCB_INSYSCALL) +# define syserror(tcp) ((tcp)->u_error != 0) +# define traced(tcp) ((tcp)->qual_flg & QUAL_TRACE) +# define verbose(tcp) ((tcp)->qual_flg & QUAL_VERBOSE) +# define abbrev(tcp) ((tcp)->qual_flg & QUAL_ABBREV) +# define raw(tcp) ((tcp)->qual_flg & QUAL_RAW) +# define inject(tcp) ((tcp)->qual_flg & QUAL_INJECT) +# define filtered(tcp) ((tcp)->flags & TCB_FILTERED) +# define hide_log(tcp) ((tcp)->flags & TCB_HIDE_LOG) +# define check_exec_syscall(tcp) ((tcp)->flags & TCB_CHECK_EXEC_SYSCALL) +# define syscall_tampered(tcp) ((tcp)->flags & TCB_TAMPERED) +# define recovering(tcp) ((tcp)->flags & TCB_RECOVERING) +# define inject_delay_exit(tcp) ((tcp)->flags & TCB_INJECT_DELAY_EXIT) +# define syscall_delayed(tcp) ((tcp)->flags & TCB_DELAYED) +# define syscall_tampered_nofail(tcp) ((tcp)->flags & TCB_TAMPERED_NO_FAIL) + +extern const struct_sysent stub_sysent; +# define tcp_sysent(tcp) (tcp->s_ent ?: &stub_sysent) +# define n_args(tcp) (tcp_sysent(tcp)->nargs) + +# include "xlat.h" extern const struct xlat addrfams[]; + +/** Protocol hardware identifiers array, sorted, defined in sockaddr.c. */ +extern const struct xlat arp_hardware_types[]; +/** Protocol hardware identifiers array size without terminating record. */ +extern const size_t arp_hardware_types_size; + extern const struct xlat at_flags[]; +extern const struct xlat clocknames[]; extern const struct xlat dirent_types[]; + +/** Ethernet protocols list, sorted, defined in sockaddr.c. */ +extern const struct xlat ethernet_protocols[]; +/** Ethernet protocols array size without terminating record. */ +extern const size_t ethernet_protocols_size; + +/** IP protocols list, sorted, defined in net.c. */ +extern const struct xlat inet_protocols[]; +/** IP protocols array size without terminating record. */ +extern const size_t inet_protocols_size; + extern const struct xlat evdev_abs[]; +/** Number of elements in evdev_abs array without the terminating record. */ +extern const size_t evdev_abs_size; + +extern const struct xlat audit_arch[]; +extern const struct xlat evdev_ev[]; +extern const struct xlat iffflags[]; +extern const struct xlat ip_type_of_services[]; +extern const struct xlat ipc_private[]; extern const struct xlat msg_flags[]; +extern const struct xlat netlink_protocols[]; +extern const struct xlat nl_netfilter_msg_types[]; +extern const struct xlat nl_route_types[]; extern const struct xlat open_access_modes[]; extern const struct xlat open_mode_flags[]; +extern const struct xlat ptrace_cmds[]; extern const struct xlat resource_flags[]; +extern const struct xlat routing_scopes[]; +extern const struct xlat routing_table_ids[]; +extern const struct xlat routing_types[]; +extern const struct xlat seccomp_filter_flags[]; +extern const struct xlat seccomp_ret_action[]; +extern const struct xlat setns_types[]; extern const struct xlat sg_io_info[]; extern const struct xlat socketlayers[]; +extern const struct xlat socktypes[]; +extern const struct xlat tcp_state_flags[]; +extern const struct xlat tcp_states[]; extern const struct xlat whence_codes[]; /* Format of syscall return values */ -#define RVAL_DECIMAL 000 /* decimal format */ -#define RVAL_HEX 001 /* hex format */ -#define RVAL_OCTAL 002 /* octal format */ -#define RVAL_UDECIMAL 003 /* unsigned decimal format */ -#define RVAL_FD 010 /* file descriptor */ -#define RVAL_MASK 013 /* mask for these values */ - -#define RVAL_STR 020 /* Print `auxstr' field after return val */ -#define RVAL_NONE 040 /* Print nothing */ - -#define RVAL_DECODED 0100 /* syscall decoding finished */ - -#define IOCTL_NUMBER_UNKNOWN 0 -#define IOCTL_NUMBER_HANDLED 1 -#define IOCTL_NUMBER_STOP_LOOKUP 010 - -#define indirect_ipccall(tcp) (tcp->s_ent->sys_flags & TRACE_INDIRECT_SUBCALL) - -#if defined(ARM) || defined(AARCH64) \ - || defined(I386) || defined(X32) || defined(X86_64) \ - || defined(IA64) \ - || defined(BFIN) \ - || defined(M68K) \ - || defined(MICROBLAZE) \ - || defined(RISCV) \ - || defined(S390) \ - || defined(SH) || defined(SH64) \ - || defined(SPARC) || defined(SPARC64) \ - /**/ -# define NEED_UID16_PARSERS 1 -#else -# define NEED_UID16_PARSERS 0 -#endif +# define RVAL_UDECIMAL 000 /* unsigned decimal format */ +# define RVAL_HEX 001 /* hex format */ +# define RVAL_OCTAL 002 /* octal format */ +# define RVAL_FD 010 /* file descriptor */ +# define RVAL_MASK 013 /* mask for these values */ + +# define RVAL_STR 020 /* Print `auxstr' field after return val */ +# define RVAL_NONE 040 /* Print nothing */ + +# define RVAL_DECODED 0100 /* syscall decoding finished */ +# define RVAL_IOCTL_DECODED 0200 /* ioctl sub-parser successfully decoded + the argument */ + +# define IOCTL_NUMBER_UNKNOWN 0 +# define IOCTL_NUMBER_HANDLED 1 +# define IOCTL_NUMBER_STOP_LOOKUP 010 + +# define indirect_ipccall(tcp) (tcp_sysent(tcp)->sys_flags & TRACE_INDIRECT_SUBCALL) enum sock_proto { SOCK_PROTO_UNKNOWN, SOCK_PROTO_UNIX, SOCK_PROTO_TCP, SOCK_PROTO_UDP, + SOCK_PROTO_UDPLITE, + SOCK_PROTO_DCCP, + SOCK_PROTO_SCTP, + SOCK_PROTO_L2TP_IP, + SOCK_PROTO_PING, + SOCK_PROTO_RAW, SOCK_PROTO_TCPv6, SOCK_PROTO_UDPv6, - SOCK_PROTO_NETLINK + SOCK_PROTO_UDPLITEv6, + SOCK_PROTO_DCCPv6, + SOCK_PROTO_L2TP_IPv6, + SOCK_PROTO_SCTPv6, + SOCK_PROTO_PINGv6, + SOCK_PROTO_RAWv6, + SOCK_PROTO_NETLINK, }; extern enum sock_proto get_proto_by_name(const char *); +extern int get_family_by_proto(enum sock_proto proto); enum iov_decode { IOV_DECODE_ADDR, @@ -360,7 +412,6 @@ typedef enum { CFLAG_BOTH } cflag_t; extern cflag_t cflag; -extern bool debug_flag; extern bool Tflag; extern bool iflag; extern bool count_wallclock; @@ -368,57 +419,79 @@ extern unsigned int qflag; extern bool not_failing_only; extern unsigned int show_fd_path; /* are we filtering traces based on paths? */ -extern const char **paths_selected; -#define tracing_paths (paths_selected != NULL) +extern struct path_set { + const char **paths_selected; + size_t num_selected; + size_t size; +} global_path_set; +# define tracing_paths (global_path_set.num_selected != 0) extern unsigned xflag; extern unsigned followfork; -#ifdef USE_LIBUNWIND +# ifdef ENABLE_STACKTRACE /* if this is true do the stack trace for every system call */ extern bool stack_trace_enabled; -#endif +# else +# define stack_trace_enabled 0 +# endif extern unsigned ptrace_setoptions; extern unsigned max_strlen; extern unsigned os_release; -#undef KERNEL_VERSION -#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) - -void error_msg(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2)); -void perror_msg(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2)); -void error_msg_and_die(const char *fmt, ...) - ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; -void error_msg_and_help(const char *fmt, ...) - ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; -void perror_msg_and_die(const char *fmt, ...) - ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; -void die_out_of_memory(void) ATTRIBUTE_NORETURN; - -void *xmalloc(size_t size) ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((1)); -void *xcalloc(size_t nmemb, size_t size) - ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((1, 2)); -void *xreallocarray(void *ptr, size_t nmemb, size_t size) - ATTRIBUTE_ALLOC_SIZE((2, 3)); -char *xstrdup(const char *str) ATTRIBUTE_MALLOC; - -extern int read_int_from_file(const char *, int *); +# undef KERNEL_VERSION +# define KERNEL_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c)) + +extern int read_int_from_file(struct tcb *, const char *, int *); extern void set_sortby(const char *); extern void set_overhead(int); -extern void print_pc(struct tcb *); -extern int trace_syscall(struct tcb *, unsigned int *); -extern void count_syscall(struct tcb *, const struct timeval *); + +extern bool get_instruction_pointer(struct tcb *, kernel_ulong_t *); +extern bool get_stack_pointer(struct tcb *, kernel_ulong_t *); +extern void print_instruction_pointer(struct tcb *); + +extern void print_syscall_resume(struct tcb *tcp); + +extern int syscall_entering_decode(struct tcb *); +extern int syscall_entering_trace(struct tcb *, unsigned int *); +extern void syscall_entering_finish(struct tcb *, int); + +extern int syscall_exiting_decode(struct tcb *, struct timespec *); +extern int syscall_exiting_trace(struct tcb *, struct timespec *, int); +extern void syscall_exiting_finish(struct tcb *); + +extern void count_syscall(struct tcb *, const struct timespec *); extern void call_summary(FILE *); -extern void clear_regs(void); -extern void get_regs(pid_t pid); -extern int get_scno(struct tcb *tcp); +extern void clear_regs(struct tcb *tcp); +extern int get_scno(struct tcb *); +extern kernel_ulong_t get_rt_sigframe_addr(struct tcb *); + /** - * Convert syscall number to syscall name. + * Convert a (shuffled) syscall number to the corresponding syscall name. * * @param scno Syscall number. * @return String literal corresponding to the syscall number in case latter * is valid; NULL otherwise. */ extern const char *syscall_name(kernel_ulong_t scno); +/** + * Convert a syscall name to the corresponding (shuffled) syscall number. + * + * @param s Syscall name. + * @param p Personality. + * @param start From which position in syscall entry table resume the search. + * @return Shuffled syscall number (ready to use against sysent_vec) + * if syscall name is found; -1 otherwise. + */ +extern kernel_long_t scno_by_name(const char *s, unsigned p, + kernel_long_t start); +/** + * Shuffle syscall numbers so that we don't have huge gaps in syscall table. + * The shuffling should be an involution: shuffle_scno(shuffle_scno(n)) == n. + * + * @param scno Raw or shuffled syscall number. + * @return Shuffled or raw syscall number, respectively. + */ +extern kernel_ulong_t shuffle_scno(kernel_ulong_t scno); extern const char *err_name(unsigned long err); extern bool is_erestart(struct tcb *); @@ -440,113 +513,369 @@ static inline int set_tcb_priv_ulong(struct tcb *tcp, unsigned long val) return set_tcb_priv_data(tcp, (void *) val, 0); } +/** + * @return 0 on success, -1 on error. + */ extern int -umoven(struct tcb *tcp, kernel_ulong_t addr, unsigned int len, void *laddr); -#define umove(pid, addr, objp) \ +umoven(struct tcb *, kernel_ulong_t addr, unsigned int len, void *laddr); +# define umove(pid, addr, objp) \ umoven((pid), (addr), sizeof(*(objp)), (void *) (objp)) +/** + * @return true on success, false on error. + */ +extern bool +tfetch_mem64(struct tcb *, uint64_t addr, unsigned int len, void *laddr); + +static inline bool +tfetch_mem(struct tcb *tcp, const kernel_ulong_t addr, + unsigned int len, void *laddr) +{ + return tfetch_mem64(tcp, addr, len, laddr); +} +# define tfetch_obj(pid, addr, objp) \ + tfetch_mem((pid), (addr), sizeof(*(objp)), (void *) (objp)) + +/** + * @return true on success, false on error. + */ +extern bool +tfetch_mem64_ignore_syserror(struct tcb *, uint64_t addr, + unsigned int len, void *laddr); + +static inline bool +tfetch_mem_ignore_syserror(struct tcb *tcp, const kernel_ulong_t addr, + unsigned int len, void *laddr) +{ + return tfetch_mem64_ignore_syserror(tcp, addr, len, laddr); +} + +/** + * @return 0 on success, -1 on error (and print addr). + */ extern int -umoven_or_printaddr(struct tcb *tcp, kernel_ulong_t addr, - unsigned int len, void *laddr); -#define umove_or_printaddr(pid, addr, objp) \ +umoven_or_printaddr64(struct tcb *, uint64_t addr, + unsigned int len, void *laddr); +# define umove_or_printaddr64(pid, addr, objp) \ + umoven_or_printaddr64((pid), (addr), sizeof(*(objp)), (void *) (objp)) + +static inline int +umoven_or_printaddr(struct tcb *tcp, const kernel_ulong_t addr, + unsigned int len, void *laddr) +{ + return umoven_or_printaddr64(tcp, addr, len, laddr); +} +# define umove_or_printaddr(pid, addr, objp) \ umoven_or_printaddr((pid), (addr), sizeof(*(objp)), (void *) (objp)) +/** + * @return 0 on success, -1 on error (and print addr). + */ extern int -umoven_or_printaddr_ignore_syserror(struct tcb *tcp, kernel_ulong_t addr, - unsigned int len, void *laddr); +umoven_or_printaddr64_ignore_syserror(struct tcb *, uint64_t addr, + unsigned int len, void *laddr); +# define umove_or_printaddr64_ignore_syserror(pid, addr, objp) \ + umoven_or_printaddr64_ignore_syserror((pid), (addr), sizeof(*(objp)), \ + (void *) (objp)) + +static inline int +umoven_or_printaddr_ignore_syserror(struct tcb *tcp, const kernel_ulong_t addr, + unsigned int len, void *laddr) +{ + return umoven_or_printaddr64_ignore_syserror(tcp, addr, len, laddr); +} +# define umove_or_printaddr_ignore_syserror(pid, addr, objp) \ + umoven_or_printaddr_ignore_syserror((pid), (addr), sizeof(*(objp)), \ + (void *) (objp)) +/** + * @return strlen + 1 on success, 0 on success and no NUL seen, -1 on error. + */ extern int -umovestr(struct tcb *tcp, kernel_ulong_t addr, unsigned int len, char *laddr); +umovestr(struct tcb *, kernel_ulong_t addr, unsigned int len, char *laddr); -extern int upeek(int pid, unsigned long, kernel_ulong_t *); -extern int upoke(int pid, unsigned long, kernel_ulong_t); +extern int upeek(struct tcb *tcp, unsigned long, kernel_ulong_t *); +extern int upoke(struct tcb *tcp, unsigned long, kernel_ulong_t); -extern bool -print_array(struct tcb *tcp, - kernel_ulong_t start_addr, - size_t nmemb, - void *elem_buf, - size_t elem_size, - int (*umoven_func)(struct tcb *, - kernel_ulong_t, - unsigned int, - void *), - bool (*print_func)(struct tcb *, - void *elem_buf, - size_t elem_size, - void *opaque_data), - void *opaque_data); - -#if defined ALPHA || defined IA64 || defined MIPS \ - || defined SH || defined SPARC || defined SPARC64 -# define HAVE_GETRVAL2 +# if HAVE_ARCH_GETRVAL2 extern long getrval2(struct tcb *); -#else -# undef HAVE_GETRVAL2 -#endif +# endif extern const char *signame(const int); -extern void pathtrace_select(const char *); -extern int pathtrace_match(struct tcb *); +extern const char *sprintsigname(const int); +extern void pathtrace_select_set(const char *, struct path_set *); +extern bool pathtrace_match_set(struct tcb *, struct path_set *); + +static inline void +pathtrace_select(const char *path) +{ + return pathtrace_select_set(path, &global_path_set); +} + +static inline bool +pathtrace_match(struct tcb *tcp) +{ + return pathtrace_match_set(tcp, &global_path_set); +} + extern int getfdpath(struct tcb *, int, char *, unsigned); +extern unsigned long getfdinode(struct tcb *, int); extern enum sock_proto getfdproto(struct tcb *, int); extern const char *xlookup(const struct xlat *, const uint64_t); extern const char *xlat_search(const struct xlat *, const size_t, const uint64_t); +extern const char *xlat_idx(const struct xlat *xlat, size_t nmemb, uint64_t val); + +struct dyxlat; +struct dyxlat *dyxlat_alloc(size_t nmemb); +void dyxlat_free(struct dyxlat *); +const struct xlat *dyxlat_get(const struct dyxlat *); +void dyxlat_add_pair(struct dyxlat *, uint64_t val, const char *str, size_t len); + +const struct xlat *genl_families_xlat(struct tcb *tcp); extern unsigned long get_pagesize(void); -extern int -string_to_uint_ex(const char *str, char **endptr, - unsigned int max_val, const char *accepted_ending); -extern int string_to_uint(const char *str); -static inline int -string_to_uint_upto(const char *const str, unsigned int max_val) +extern int next_set_bit(const void *bit_array, unsigned cur_bit, unsigned size_bits); + +/* + * Returns STR if it does not start with PREFIX, + * or a pointer to the first char in STR after PREFIX. + * The length of PREFIX is specified by PREFIX_LEN. + */ +static inline const char * +str_strip_prefix_len(const char *str, const char *prefix, size_t prefix_len) { - return string_to_uint_ex(str, NULL, max_val, NULL); + return strncmp(str, prefix, prefix_len) ? str : str + prefix_len; } -extern int next_set_bit(const void *bit_array, unsigned cur_bit, unsigned size_bits); -#define QUOTE_0_TERMINATED 0x01 -#define QUOTE_OMIT_LEADING_TRAILING_QUOTES 0x02 -#define QUOTE_OMIT_TRAILING_0 0x08 -#define QUOTE_FORCE_HEX 0x10 +# define STR_STRIP_PREFIX(str, prefix) \ + str_strip_prefix_len((str), (prefix), sizeof(prefix) - 1) -extern int string_quote(const char *, char *, unsigned int, unsigned int); +# define QUOTE_0_TERMINATED 0x01 +# define QUOTE_OMIT_LEADING_TRAILING_QUOTES 0x02 +# define QUOTE_OMIT_TRAILING_0 0x08 +# define QUOTE_FORCE_HEX 0x10 +# define QUOTE_EMIT_COMMENT 0x20 + +extern int string_quote(const char *, char *, unsigned int, unsigned int, + const char *escape_chars); +extern int print_quoted_string_ex(const char *, unsigned int, unsigned int, + const char *escape_chars); extern int print_quoted_string(const char *, unsigned int, unsigned int); +extern int print_quoted_cstring(const char *, unsigned int); /* a refers to the lower numbered u_arg, * b refers to the higher numbered u_arg */ -#ifdef WORDS_BIGENDIAN -# define ULONG_LONG(a,b) \ +# ifdef WORDS_BIGENDIAN +# define ULONG_LONG(a, b) \ ((unsigned long long)(unsigned)(b) | ((unsigned long long)(a)<<32)) -#else -# define ULONG_LONG(a,b) \ +# else +# define ULONG_LONG(a, b) \ ((unsigned long long)(unsigned)(a) | ((unsigned long long)(b)<<32)) -#endif +# endif extern int getllval(struct tcb *, unsigned long long *, int); extern int printllval(struct tcb *, const char *, int) ATTRIBUTE_FORMAT((printf, 2, 0)); -extern void printaddr(kernel_ulong_t addr); -extern int printxvals(const uint64_t, const char *, const struct xlat *, ...) +extern void printaddr64(uint64_t addr); + +static inline void +printaddr(const kernel_ulong_t addr) +{ + printaddr64(addr); +} + +# define xlat_verbose(style_) ((style_) & XLAT_STYLE_VERBOSITY_MASK) +# define xlat_format(style_) ((style_) & XLAT_STYLE_FORMAT_MASK) + +extern enum xlat_style xlat_verbosity; + +extern int printxvals_ex(uint64_t val, const char *dflt, + enum xlat_style, const struct xlat *, ...) ATTRIBUTE_SENTINEL; -extern int printxval_searchn(const struct xlat *xlat, size_t xlat_size, - uint64_t val, const char *dflt); -#define printxval_search(xlat__, val__, dflt__) \ - printxval_searchn(xlat__, ARRAY_SIZE(xlat__), val__, dflt__) +# define printxvals(val_, dflt_, ...) \ + printxvals_ex((val_), (dflt_), XLAT_STYLE_DEFAULT, __VA_ARGS__) + +extern int printxval_searchn_ex(const struct xlat *, size_t xlat_size, + uint64_t val, const char *dflt, + enum xlat_style); + +static inline int +printxval_searchn(const struct xlat *xlat, size_t xlat_size, uint64_t val, + const char *dflt) +{ + return printxval_searchn_ex(xlat, xlat_size, val, dflt, + XLAT_STYLE_DEFAULT); +} + +/** + * Wrapper around printxval_searchn that passes ARRAY_SIZE - 1 + * as the array size, as all arrays are XLAT_END-terminated and + * printxval_searchn expects a size without the terminating record. + */ +# define printxval_search(xlat__, val__, dflt__) \ + printxval_searchn(xlat__, ARRAY_SIZE(xlat__) - 1, val__, dflt__) +# define printxval_search_ex(xlat__, val__, dflt__, style__) \ + printxval_searchn_ex((xlat__), ARRAY_SIZE(xlat__) - 1, (val__), \ + (dflt__), (style__)) + +extern int printxval_indexn_ex(const struct xlat *, size_t xlat_size, + uint64_t val, const char *dflt, enum xlat_style); + +static inline int +printxval_indexn(const struct xlat *xlat, size_t xlat_size, uint64_t val, + const char *dflt) +{ + return printxval_indexn_ex(xlat, xlat_size, val, dflt, + XLAT_STYLE_DEFAULT); +} + +# define printxval_index(xlat__, val__, dflt__) \ + printxval_indexn(xlat__, ARRAY_SIZE(xlat__) - 1, val__, dflt__) +# define printxval_index_ex(xlat__, val__, dflt__) \ + printxval_indexn_ex((xlat__), ARRAY_SIZE(xlat__) - 1, (val__), \ + (dflt__), XLAT_STYLE_DEFAULT) + +extern int sprintxval_ex(char *buf, size_t size, const struct xlat *, + unsigned int val, const char *dflt, enum xlat_style); + +static inline int +sprintxval(char *buf, size_t size, const struct xlat *xlat, unsigned int val, + const char *dflt) +{ + return sprintxval_ex(buf, size, xlat, val, dflt, XLAT_STYLE_DEFAULT); +} + +extern void printxval_dispatch_ex(const struct xlat *, size_t xlat_size, + uint64_t val, const char *dflt, + enum xlat_type, enum xlat_style); +static inline void +printxval_dispatch(const struct xlat *xlat, size_t xlat_size, uint64_t val, + const char *dflt, enum xlat_type xt) +{ + return printxval_dispatch_ex(xlat, xlat_size, val, dflt, xt, + XLAT_STYLE_DEFAULT); +} + +enum xlat_style_private_flag_bits { + /* print_array */ + PAF_PRINT_INDICES_BIT = XLAT_STYLE_SPEC_BITS + 1, + PAF_INDEX_XLAT_SORTED_BIT, + PAF_INDEX_XLAT_VALUE_INDEXED_BIT, + + /* print_xlat */ + PXF_DEFAULT_STR_BIT, +}; + +# define FLAG_(name_) name_ = 1 << name_##_BIT + +enum xlat_style_private_flags { + /* print_array */ + FLAG_(PAF_PRINT_INDICES), + FLAG_(PAF_INDEX_XLAT_SORTED), + FLAG_(PAF_INDEX_XLAT_VALUE_INDEXED), + + /* print_xlat */ + FLAG_(PXF_DEFAULT_STR), +}; + +# undef FLAG_ + +/** Print a value in accordance with xlat formatting settings. */ +extern void print_xlat_ex(uint64_t val, const char *str, enum xlat_style style); +# define print_xlat(val_) \ + print_xlat_ex((val_), #val_, XLAT_STYLE_DEFAULT) +# define print_xlat32(val_) \ + print_xlat_ex((uint32_t) (val_), #val_, XLAT_STYLE_DEFAULT) +# define print_xlat_u(val_) \ + print_xlat_ex((val_), #val_, XLAT_STYLE_FMT_U) +# define print_xlat_d(val_) \ + print_xlat_ex((val_), #val_, XLAT_STYLE_FMT_D) + extern int printargs(struct tcb *); extern int printargs_u(struct tcb *); extern int printargs_d(struct tcb *); -extern void addflags(const struct xlat *, uint64_t); -extern int printflags64(const struct xlat *, uint64_t, const char *); -extern const char *sprintflags(const char *, const struct xlat *, uint64_t); -extern const char *sprinttime(time_t); +extern int printflags_ex(uint64_t flags, const char *dflt, + enum xlat_style, const struct xlat *, ...) + ATTRIBUTE_SENTINEL; +extern const char *sprintflags_ex(const char *prefix, const struct xlat *, + uint64_t flags, enum xlat_style); + +static inline const char * +sprintflags(const char *prefix, const struct xlat *xlat, uint64_t flags) +{ + return sprintflags_ex(prefix, xlat, flags, XLAT_STYLE_DEFAULT); +} + +extern const char *sprinttime(long long sec); +extern const char *sprinttime_nsec(long long sec, unsigned long long nsec); +extern const char *sprinttime_usec(long long sec, unsigned long long usec); + +extern const char *sprint_mac_addr(const uint8_t addr[], size_t size); +extern void print_mac_addr(const char *prefix, + const uint8_t addr[], size_t size); + +extern void print_uuid(const unsigned char *uuid); + extern void print_symbolic_mode_t(unsigned int); extern void print_numeric_umode_t(unsigned short); extern void print_numeric_long_umask(unsigned long); extern void print_dev_t(unsigned long long dev); +extern void print_kernel_version(unsigned long version); +extern void print_abnormal_hi(kernel_ulong_t); + +extern bool print_int32_array_member(struct tcb *, void *elem_buf, + size_t elem_size, void *data); +extern bool print_uint32_array_member(struct tcb *, void *elem_buf, + size_t elem_size, void *data); +extern bool print_uint64_array_member(struct tcb *, void *elem_buf, + size_t elem_size, void *data); + +typedef bool (*tfetch_mem_fn)(struct tcb *, kernel_ulong_t addr, + unsigned int size, void *dest); +typedef bool (*print_fn)(struct tcb *, void *elem_buf, + size_t elem_size, void *opaque_data); +typedef int (*print_obj_by_addr_fn)(struct tcb *, kernel_ulong_t); +typedef const char * (*sprint_obj_by_addr_fn)(struct tcb *, kernel_ulong_t); + + +/** + * @param flags Combination of xlat style settings and additional flags from + * enum print_array_flags. + */ +extern bool +print_array_ex(struct tcb *, + kernel_ulong_t start_addr, + size_t nmemb, + void *elem_buf, + size_t elem_size, + tfetch_mem_fn tfetch_mem_func, + print_fn print_func, + void *opaque_data, + unsigned int flags, + const struct xlat *index_xlat, + size_t index_xlat_size, + const char *index_dflt); + +static inline bool +print_array(struct tcb *const tcp, + const kernel_ulong_t start_addr, + const size_t nmemb, + void *const elem_buf, + const size_t elem_size, + tfetch_mem_fn tfetch_mem_func, + print_fn print_func, + void *const opaque_data) +{ + return print_array_ex(tcp, start_addr, nmemb, elem_buf, elem_size, + tfetch_mem_func, print_func, opaque_data, + 0, NULL, 0, NULL); +} + +extern kernel_ulong_t * +fetch_indirect_syscall_args(struct tcb *, kernel_ulong_t addr, unsigned int n_args); extern void dumpiov_in_msghdr(struct tcb *, kernel_ulong_t addr, kernel_ulong_t data_size); @@ -558,24 +887,31 @@ extern void dumpiov_upto(struct tcb *, int len, kernel_ulong_t addr, kernel_ulong_t data_size); extern void -dumpstr(struct tcb *, kernel_ulong_t addr, int len); +dumpstr(struct tcb *, kernel_ulong_t addr, kernel_ulong_t len); -extern void +extern int printstr_ex(struct tcb *, kernel_ulong_t addr, kernel_ulong_t len, unsigned int user_style); -extern void +extern int printpathn(struct tcb *, kernel_ulong_t addr, unsigned int n); -extern void +extern int printpath(struct tcb *, kernel_ulong_t addr); -#define TIMESPEC_TEXT_BUFSIZE \ - (sizeof(intmax_t)*3 * 2 + sizeof("{tv_sec=%jd, tv_nsec=%jd}")) +# define TIMESPEC_TEXT_BUFSIZE \ + (sizeof(long long) * 3 * 2 + sizeof("{tv_sec=-, tv_nsec=}")) extern void printfd(struct tcb *, int); -extern void print_sockaddr(struct tcb *tcp, const void *, int); -extern bool print_sockaddr_by_inode(const unsigned long, const enum sock_proto); -extern bool print_sockaddr_by_inode_cached(const unsigned long); +extern void print_sockaddr(const void *sa, int len); +extern bool +print_inet_addr(int af, const void *addr, unsigned int len, const char *var_name); +extern bool +decode_inet_addr(struct tcb *, kernel_ulong_t addr, + unsigned int len, int family, const char *var_name); +extern void print_ax25_addr(const void /* ax25_address */ *addr); +extern void print_x25_addr(const void /* struct x25_address */ *addr); +extern const char *get_sockaddr_by_inode(struct tcb *, int fd, unsigned long inode); +extern bool print_sockaddr_by_inode(struct tcb *, int fd, unsigned long inode); extern void print_dirfd(struct tcb *, int); extern int @@ -585,9 +921,11 @@ extern void printuid(const char *, const unsigned int); extern void print_sigset_addr_len(struct tcb *, kernel_ulong_t addr, kernel_ulong_t len); +extern void +print_sigset_addr(struct tcb *, kernel_ulong_t addr); extern const char *sprintsigmask_n(const char *, const void *, unsigned int); -#define tprintsigmask_addr(prefix, mask) \ +# define tprintsigmask_addr(prefix, mask) \ tprints(sprintsigmask_n((prefix), (mask), sizeof(mask))) extern void printsignal(int); @@ -596,21 +934,28 @@ tprint_iov_upto(struct tcb *, kernel_ulong_t len, kernel_ulong_t addr, enum iov_decode, kernel_ulong_t data_size); extern void -decode_netlink(struct tcb *, kernel_ulong_t addr, kernel_ulong_t len); +decode_netlink(struct tcb *, int fd, kernel_ulong_t addr, kernel_ulong_t len); extern void tprint_open_modes(unsigned int); extern const char *sprint_open_modes(unsigned int); extern void -print_seccomp_filter(struct tcb *, kernel_ulong_t addr); +decode_seccomp_fprog(struct tcb *, kernel_ulong_t addr); extern void print_seccomp_fprog(struct tcb *, kernel_ulong_t addr, unsigned short len); +extern void +decode_sock_fprog(struct tcb *, kernel_ulong_t addr); + +extern void +print_sock_fprog(struct tcb *, kernel_ulong_t addr, unsigned short len); + struct strace_stat; -extern void print_struct_stat(struct tcb *tcp, const struct strace_stat *const st); +extern void print_struct_stat(struct tcb *, const struct strace_stat *const st); struct strace_statfs; +struct strace_keyctl_kdf_params; extern void print_struct_statfs(struct tcb *, kernel_ulong_t addr); @@ -618,59 +963,101 @@ print_struct_statfs(struct tcb *, kernel_ulong_t addr); extern void print_struct_statfs64(struct tcb *, kernel_ulong_t addr, kernel_ulong_t size); +extern int +fetch_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr); +extern void +print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr); + +extern const char *get_ifname(const unsigned int ifindex); extern void print_ifindex(unsigned int); -struct number_set; -extern struct number_set read_set; -extern struct number_set write_set; -extern struct number_set signal_set; +extern void print_bpf_filter_code(const uint16_t code, bool extended); -extern bool is_number_in_set(unsigned int number, const struct number_set *); extern void qualify(const char *); extern unsigned int qual_flags(const unsigned int); -#define DECL_IOCTL(name) \ +# define DECL_IOCTL(name) \ extern int \ -name ## _ioctl(struct tcb *, unsigned int request, kernel_ulong_t arg) +name ## _ioctl(struct tcb *, unsigned int request, kernel_ulong_t arg) \ +/* End of DECL_IOCTL definition. */ + DECL_IOCTL(dm); +DECL_IOCTL(evdev); DECL_IOCTL(file); DECL_IOCTL(fs_x); +DECL_IOCTL(inotify); +DECL_IOCTL(kvm); +DECL_IOCTL(nbd); +DECL_IOCTL(nsfs); DECL_IOCTL(ptp); +DECL_IOCTL(random); DECL_IOCTL(scsi); DECL_IOCTL(term); DECL_IOCTL(ubi); DECL_IOCTL(uffdio); -#undef DECL_IOCTL +# undef DECL_IOCTL extern int decode_sg_io_v4(struct tcb *, const kernel_ulong_t arg); +extern void print_evdev_ff_type(const kernel_ulong_t val); + +struct nlmsghdr; -extern int tv_nz(const struct timeval *); -extern int tv_cmp(const struct timeval *, const struct timeval *); -extern double tv_float(const struct timeval *); -extern void tv_add(struct timeval *, const struct timeval *, const struct timeval *); -extern void tv_sub(struct timeval *, const struct timeval *, const struct timeval *); -extern void tv_mul(struct timeval *, const struct timeval *, int); -extern void tv_div(struct timeval *, const struct timeval *, int); +typedef bool (*netlink_decoder_t)(struct tcb *, const struct nlmsghdr *, + kernel_ulong_t addr, unsigned int len); + +# define DECL_NETLINK(name) \ +extern bool \ +decode_netlink_ ## name(struct tcb *, const struct nlmsghdr *, \ + kernel_ulong_t addr, unsigned int len) \ +/* End of DECL_NETLINK definition. */ -#ifdef USE_LIBUNWIND +DECL_NETLINK(crypto); +DECL_NETLINK(netfilter); +DECL_NETLINK(route); +DECL_NETLINK(selinux); +DECL_NETLINK(sock_diag); + +extern void +decode_netlink_kobject_uevent(struct tcb *, kernel_ulong_t addr, + kernel_ulong_t len); + +extern int ts_nz(const struct timespec *); +extern int ts_cmp(const struct timespec *, const struct timespec *); +extern double ts_float(const struct timespec *); +extern void ts_add(struct timespec *, const struct timespec *, const struct timespec *); +extern void ts_sub(struct timespec *, const struct timespec *, const struct timespec *); +extern void ts_mul(struct timespec *, const struct timespec *, int); +extern void ts_div(struct timespec *, const struct timespec *, int); + +# ifdef ENABLE_STACKTRACE extern void unwind_init(void); -extern void unwind_tcb_init(struct tcb *tcp); -extern void unwind_tcb_fin(struct tcb *tcp); -extern void unwind_cache_invalidate(struct tcb* tcp); -extern void unwind_print_stacktrace(struct tcb* tcp); -extern void unwind_capture_stacktrace(struct tcb* tcp); -#endif +extern void unwind_tcb_init(struct tcb *); +extern void unwind_tcb_fin(struct tcb *); +extern void unwind_tcb_print(struct tcb *); +extern void unwind_tcb_capture(struct tcb *); +# endif -static inline void +# ifdef HAVE_LINUX_KVM_H +extern void kvm_run_structure_decoder_init(void); +extern void kvm_vcpu_info_free(struct tcb *); +# endif + +static inline int printstrn(struct tcb *tcp, kernel_ulong_t addr, kernel_ulong_t len) { - printstr_ex(tcp, addr, len, 0); + return printstr_ex(tcp, addr, len, 0); } -static inline void +static inline int printstr(struct tcb *tcp, kernel_ulong_t addr) { - printstr_ex(tcp, addr, -1, QUOTE_0_TERMINATED); + return printstr_ex(tcp, addr, -1, QUOTE_0_TERMINATED); +} + +static inline int +printflags64(const struct xlat *x, uint64_t flags, const char *dflt) +{ + return printflags_ex(flags, dflt, XLAT_STYLE_DEFAULT, x, NULL); } static inline int @@ -691,6 +1078,30 @@ printxval(const struct xlat *x, const unsigned int val, const char *dflt) return printxvals(val, dflt, x, NULL); } +static inline int +printxval64_u(const struct xlat *x, const uint64_t val, const char *dflt) +{ + return printxvals_ex(val, dflt, XLAT_STYLE_FMT_U, x, NULL); +} + +static inline int +printxval_u(const struct xlat *x, const unsigned int val, const char *dflt) +{ + return printxvals_ex(val, dflt, XLAT_STYLE_FMT_U, x, NULL); +} + +static inline int +printxval64_d(const struct xlat *x, const int64_t val, const char *dflt) +{ + return printxvals_ex(val, dflt, XLAT_STYLE_FMT_D, x, NULL); +} + +static inline int +printxval_d(const struct xlat *x, const int val, const char *dflt) +{ + return printxvals_ex(val, dflt, XLAT_STYLE_FMT_D, x, NULL); +} + static inline void tprint_iov(struct tcb *tcp, kernel_ulong_t len, kernel_ulong_t addr, enum iov_decode decode_iov) @@ -698,22 +1109,65 @@ tprint_iov(struct tcb *tcp, kernel_ulong_t len, kernel_ulong_t addr, tprint_iov_upto(tcp, len, addr, decode_iov, -1); } -#ifdef ALPHA +# if HAVE_ARCH_TIME32_SYSCALLS +extern bool print_timespec32_data_size(const void *arg, size_t size); +extern bool print_timespec32_array_data_size(const void *arg, + unsigned int nmemb, + size_t size); +extern int print_timespec32(struct tcb *, kernel_ulong_t); +extern const char *sprint_timespec32(struct tcb *, kernel_ulong_t); +extern int print_timespec32_utime_pair(struct tcb *, kernel_ulong_t); +extern int print_itimerspec32(struct tcb *, kernel_ulong_t); +extern int print_timex32(struct tcb *, kernel_ulong_t); +# endif /* HAVE_ARCH_TIME32_SYSCALLS */ + +extern bool print_timespec64_data_size(const void *arg, size_t size); +extern bool print_timespec64_array_data_size(const void *arg, + unsigned int nmemb, + size_t size); +extern int print_timespec64(struct tcb *, kernel_ulong_t); +extern const char *sprint_timespec64(struct tcb *, kernel_ulong_t); +extern int print_timespec64_utime_pair(struct tcb *, kernel_ulong_t); +extern int print_itimerspec64(struct tcb *, kernel_ulong_t); + +extern bool print_timeval64_data_size(const void *arg, size_t size); + +extern int print_timex64(struct tcb *, kernel_ulong_t); + +# ifdef SPARC64 +extern int print_sparc64_timex(struct tcb *, kernel_ulong_t); +# endif + +# ifdef ALPHA typedef struct { int tv_sec, tv_usec; } timeval32_t; extern void print_timeval32_t(const timeval32_t *); extern void printrusage32(struct tcb *, kernel_ulong_t); -extern const char *sprint_timeval32(struct tcb *tcp, kernel_ulong_t); -extern void print_timeval32(struct tcb *tcp, kernel_ulong_t); -extern void print_timeval32_pair(struct tcb *tcp, kernel_ulong_t); -extern void print_itimerval32(struct tcb *tcp, kernel_ulong_t); -#endif +extern const char *sprint_timeval32(struct tcb *, kernel_ulong_t addr); +extern int print_timeval32(struct tcb *, kernel_ulong_t addr); +extern int print_timeval32_utimes(struct tcb *, kernel_ulong_t addr); +extern int print_itimerval32(struct tcb *, kernel_ulong_t addr); +# endif -#ifdef HAVE_STRUCT_USER_DESC -extern void print_user_desc(struct tcb *, kernel_ulong_t addr); -#endif +# ifdef HAVE_STRUCT_USER_DESC +/** + * Filter what to print from the point of view of the get_thread_area syscall. + * Kernel copies only entry_number field at first and then tries to write the + * whole structure. + */ +enum user_desc_print_filter { + /* Print the "entering" part of struct user_desc - entry_number. */ + USER_DESC_ENTERING = 1, + /* Print the "exiting" part of the structure. */ + USER_DESC_EXITING = 2, + USER_DESC_BOTH = USER_DESC_ENTERING | USER_DESC_EXITING, +}; + +extern void print_user_desc(struct tcb *, kernel_ulong_t addr, + enum user_desc_print_filter filter); +# endif /* Strace log generation machinery. * @@ -738,108 +1192,208 @@ extern void line_ended(void); extern void tabto(void); extern void tprintf(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2)); extern void tprints(const char *str); +extern void tprintf_comment(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2)); +extern void tprints_comment(const char *str); -#if SUPPORTED_PERSONALITIES > 1 -extern void set_personality(int personality); +static inline void +printaddr_comment(const kernel_ulong_t addr) +{ + tprintf_comment("%#llx", (unsigned long long) addr); +} + +# if SUPPORTED_PERSONALITIES > 1 +extern void set_personality(unsigned int personality); extern unsigned current_personality; -#else -# define set_personality(personality) ((void)0) -# define current_personality 0 -#endif - -#if SUPPORTED_PERSONALITIES == 1 -# define current_wordsize PERSONALITY0_WORDSIZE -# define current_klongsize PERSONALITY0_KLONGSIZE -#else -# if SUPPORTED_PERSONALITIES == 2 && PERSONALITY0_WORDSIZE == PERSONALITY1_WORDSIZE -# define current_wordsize PERSONALITY0_WORDSIZE # else -extern unsigned current_wordsize; +# define set_personality(personality) ((void)0) +# define current_personality 0 # endif -# if SUPPORTED_PERSONALITIES == 2 && PERSONALITY0_KLONGSIZE == PERSONALITY1_KLONGSIZE + +# if SUPPORTED_PERSONALITIES == 1 +# define current_wordsize PERSONALITY0_WORDSIZE # define current_klongsize PERSONALITY0_KLONGSIZE # else +# if SUPPORTED_PERSONALITIES == 2 && PERSONALITY0_WORDSIZE == PERSONALITY1_WORDSIZE +# define current_wordsize PERSONALITY0_WORDSIZE +# else +extern unsigned current_wordsize; +# endif +# if SUPPORTED_PERSONALITIES == 2 && PERSONALITY0_KLONGSIZE == PERSONALITY1_KLONGSIZE +# define current_klongsize PERSONALITY0_KLONGSIZE +# else extern unsigned current_klongsize; +# endif # endif -#endif -#define ANY_WORDSIZE_LESS_THAN_KERNEL_LONG \ - (SIZEOF_KERNEL_LONG_T > 4 \ - && (SIZEOF_LONG < SIZEOF_KERNEL_LONG_T || !defined(current_wordsize))) +# define max_addr() (~0ULL >> ((8 - current_wordsize) * 8)) +# define max_kaddr() (~0ULL >> ((8 - current_klongsize) * 8)) + +/* + * When u64 is interpreted by the kernel as an address, there is a difference + * in behaviour between 32-bit and 64-bit kernel in the way u64_to_user_ptr + * works (32-bit kernel trims higher bits during conversion which may result + * to a valid address). Since 32-bit strace cannot figure out what kind of + * kernel the tracee is running on, it has to account for both possibilities. + */ +# if CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL + +/** + * Print raw 64-bit value as an address if it's too big to fit in strace's + * kernel_long_t. + */ +static inline void +print_big_u64_addr(const uint64_t addr) +{ + if (sizeof(kernel_long_t) < 8 && addr > max_kaddr()) { + printaddr64(addr); + tprints(" or "); + } +} +# else /* !CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL */ +# define print_big_u64_addr(addr_) ((void) 0) +# endif /* CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL */ + +# if SIZEOF_KERNEL_LONG_T > 4 \ + && (SIZEOF_LONG < SIZEOF_KERNEL_LONG_T || !defined(current_wordsize)) +# define ANY_WORDSIZE_LESS_THAN_KERNEL_LONG 1 +# else +# define ANY_WORDSIZE_LESS_THAN_KERNEL_LONG 0 +# endif -#define DECL_PRINTNUM(name) \ +# define DECL_PRINTNUM(name) \ extern bool \ printnum_ ## name(struct tcb *, kernel_ulong_t addr, const char *fmt) \ - ATTRIBUTE_FORMAT((printf, 3, 0)) + ATTRIBUTE_FORMAT((printf, 3, 0)) \ +/* End of DECL_PRINTNUM definition. */ + DECL_PRINTNUM(short); DECL_PRINTNUM(int); DECL_PRINTNUM(int64); -#undef DECL_PRINTNUM +# undef DECL_PRINTNUM -#define DECL_PRINTNUM_ADDR(name) \ +# define DECL_PRINTNUM_ADDR(name) \ extern bool \ -printnum_addr_ ## name(struct tcb *, kernel_ulong_t addr) +printnum_addr_ ## name(struct tcb *, kernel_ulong_t addr) \ +/* End of DECL_PRINTNUM_ADDR definition. */ + DECL_PRINTNUM_ADDR(int); DECL_PRINTNUM_ADDR(int64); -#undef DECL_PRINTNUM_ADDR +# undef DECL_PRINTNUM_ADDR -#ifndef current_wordsize +# ifndef current_wordsize extern bool printnum_long_int(struct tcb *, kernel_ulong_t addr, const char *fmt_long, const char *fmt_int) ATTRIBUTE_FORMAT((printf, 3, 0)) ATTRIBUTE_FORMAT((printf, 4, 0)); + extern bool printnum_addr_long_int(struct tcb *, kernel_ulong_t addr); -# define printnum_slong(tcp, addr) \ - printnum_long_int((tcp), (addr), "%" PRId64, "%d") -# define printnum_ulong(tcp, addr) \ - printnum_long_int((tcp), (addr), "%" PRIu64, "%u") -# define printnum_ptr(tcp, addr) \ - printnum_addr_long_int((tcp), (addr)) -#elif current_wordsize > 4 -# define printnum_slong(tcp, addr) \ - printnum_int64((tcp), (addr), "%" PRId64) -# define printnum_ulong(tcp, addr) \ - printnum_int64((tcp), (addr), "%" PRIu64) -# define printnum_ptr(tcp, addr) \ - printnum_addr_int64((tcp), (addr)) -#else /* current_wordsize == 4 */ -# define printnum_slong(tcp, addr) \ - printnum_int((tcp), (addr), "%d") -# define printnum_ulong(tcp, addr) \ - printnum_int((tcp), (addr), "%u") -# define printnum_ptr(tcp, addr) \ - printnum_addr_int((tcp), (addr)) -#endif - -#ifndef current_klongsize + +static inline bool +printnum_slong(struct tcb *tcp, kernel_ulong_t addr) +{ + return printnum_long_int(tcp, addr, "%" PRId64, "%d"); +} + +static inline bool +printnum_ulong(struct tcb *tcp, kernel_ulong_t addr) +{ + return printnum_long_int(tcp, addr, "%" PRIu64, "%u"); +} + +static inline bool +printnum_ptr(struct tcb *tcp, kernel_ulong_t addr) +{ + return printnum_addr_long_int(tcp, addr); +} + +# elif current_wordsize > 4 + +static inline bool +printnum_slong(struct tcb *tcp, kernel_ulong_t addr) +{ + return printnum_int64(tcp, addr, "%" PRId64); +} + +static inline bool +printnum_ulong(struct tcb *tcp, kernel_ulong_t addr) +{ + return printnum_int64(tcp, addr, "%" PRIu64); +} + +static inline bool +printnum_ptr(struct tcb *tcp, kernel_ulong_t addr) +{ + return printnum_addr_int64(tcp, addr); +} + +# else /* current_wordsize == 4 */ + +static inline bool +printnum_slong(struct tcb *tcp, kernel_ulong_t addr) +{ + return printnum_int(tcp, addr, "%d"); +} + +static inline bool +printnum_ulong(struct tcb *tcp, kernel_ulong_t addr) +{ + return printnum_int(tcp, addr, "%u"); +} + +static inline bool +printnum_ptr(struct tcb *tcp, kernel_ulong_t addr) +{ + return printnum_addr_int(tcp, addr); +} + +# endif + +# ifndef current_klongsize extern bool printnum_addr_klong_int(struct tcb *, kernel_ulong_t addr); -# define printnum_kptr(tcp, addr) \ - printnum_addr_klong_int((tcp), (addr)) -#elif current_klongsize > 4 -# define printnum_kptr(tcp, addr) \ - printnum_addr_int64((tcp), (addr)) -#else /* current_klongsize == 4 */ -# define printnum_kptr(tcp, addr) \ - printnum_addr_int((tcp), (addr)) -#endif - -#define DECL_PRINTPAIR(name) \ + +static inline bool +printnum_kptr(struct tcb *tcp, kernel_ulong_t addr) +{ + return printnum_addr_klong_int(tcp, addr); +} + +# elif current_klongsize > 4 + +static inline bool +printnum_kptr(struct tcb *tcp, kernel_ulong_t addr) +{ + return printnum_addr_int64(tcp, addr); +} + +# else /* current_klongsize == 4 */ + +static inline bool +printnum_kptr(struct tcb *tcp, kernel_ulong_t addr) +{ + return printnum_addr_int(tcp, addr); +} + +# endif + +# define DECL_PRINTPAIR(name) \ extern bool \ printpair_ ## name(struct tcb *, kernel_ulong_t addr, const char *fmt) \ - ATTRIBUTE_FORMAT((printf, 3, 0)) + ATTRIBUTE_FORMAT((printf, 3, 0)) \ +/* End of DECL_PRINTPAIR definition. */ + DECL_PRINTPAIR(int); DECL_PRINTPAIR(int64); -#undef DECL_PRINTPAIR +# undef DECL_PRINTPAIR static inline kernel_long_t truncate_klong_to_current_wordsize(const kernel_long_t v) { -#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG +# if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG if (current_wordsize < sizeof(v)) { return (int) v; } else -#endif +# endif { return v; } @@ -848,11 +1402,11 @@ truncate_klong_to_current_wordsize(const kernel_long_t v) static inline kernel_ulong_t truncate_kulong_to_current_wordsize(const kernel_ulong_t v) { -#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG +# if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG if (current_wordsize < sizeof(v)) { return (unsigned int) v; } else -#endif +# endif { return v; } @@ -861,12 +1415,12 @@ truncate_kulong_to_current_wordsize(const kernel_ulong_t v) /* * Cast a pointer or a pointer-sized integer to kernel_ulong_t. */ -#define ptr_to_kulong(v) ((kernel_ulong_t) (unsigned long) (v)) +# define ptr_to_kulong(v) ((kernel_ulong_t) (unsigned long) (v)) /* * Zero-extend a signed integer type to unsigned long long. */ -#define zero_extend_signed_to_ull(v) \ +# define zero_extend_signed_to_ull(v) \ (sizeof(v) == sizeof(char) ? (unsigned long long) (unsigned char) (v) : \ sizeof(v) == sizeof(short) ? (unsigned long long) (unsigned short) (v) : \ sizeof(v) == sizeof(int) ? (unsigned long long) (unsigned int) (v) : \ @@ -876,50 +1430,51 @@ truncate_kulong_to_current_wordsize(const kernel_ulong_t v) /* * Sign-extend an unsigned integer type to long long. */ -#define sign_extend_unsigned_to_ll(v) \ +# define sign_extend_unsigned_to_ll(v) \ (sizeof(v) == sizeof(char) ? (long long) (char) (v) : \ sizeof(v) == sizeof(short) ? (long long) (short) (v) : \ sizeof(v) == sizeof(int) ? (long long) (int) (v) : \ sizeof(v) == sizeof(long) ? (long long) (long) (v) : \ (long long) (v)) +extern const char *const errnoent[]; +extern const char *const signalent[]; +extern const unsigned int nerrnos; +extern const unsigned int nsignals; + extern const struct_sysent sysent0[]; -extern const char *const errnoent0[]; -extern const char *const signalent0[]; extern const struct_ioctlent ioctlent0[]; -#if SUPPORTED_PERSONALITIES > 1 +extern const char *const personality_names[]; +/* Personality designators to be used for specifying personality */ +extern const char *const personality_designators[]; + +# if SUPPORTED_PERSONALITIES > 1 extern const struct_sysent *sysent; -extern const char *const *errnoent; -extern const char *const *signalent; extern const struct_ioctlent *ioctlent; -#else -# define sysent sysent0 -# define errnoent errnoent0 -# define signalent signalent0 -# define ioctlent ioctlent0 -#endif +# else +# define sysent sysent0 +# define ioctlent ioctlent0 +# endif extern unsigned nsyscalls; -extern unsigned nerrnos; -extern unsigned nsignals; extern unsigned nioctlents; extern const unsigned int nsyscall_vec[SUPPORTED_PERSONALITIES]; extern const struct_sysent *const sysent_vec[SUPPORTED_PERSONALITIES]; extern struct inject_opts *inject_vec[SUPPORTED_PERSONALITIES]; -#ifdef IN_MPERS_BOOTSTRAP +# ifdef IN_MPERS_BOOTSTRAP /* Transform multi-line MPERS_PRINTER_DECL statements to one-liners. */ -# define MPERS_PRINTER_DECL(type, name, ...) MPERS_PRINTER_DECL(type, name, __VA_ARGS__) -#else /* !IN_MPERS_BOOTSTRAP */ -# if SUPPORTED_PERSONALITIES > 1 -# include "printers.h" -# else -# include "native_printer_decls.h" -# endif -# define MPERS_PRINTER_DECL(type, name, ...) type MPERS_FUNC_NAME(name)(__VA_ARGS__) -#endif /* !IN_MPERS_BOOTSTRAP */ +# define MPERS_PRINTER_DECL(type, name, ...) MPERS_PRINTER_DECL(type, name, __VA_ARGS__) +# else /* !IN_MPERS_BOOTSTRAP */ +# if SUPPORTED_PERSONALITIES > 1 +# include "printers.h" +# else +# include "native_printer_decls.h" +# endif +# define MPERS_PRINTER_DECL(type, name, ...) type MPERS_FUNC_NAME(name)(__VA_ARGS__) +# endif /* !IN_MPERS_BOOTSTRAP */ /* Checks that sysent[scno] is not out of range. */ static inline bool @@ -941,42 +1496,12 @@ scno_is_valid(kernel_ulong_t scno) && !(sysent[scno].sys_flags & TRACE_INDIRECT_SUBCALL); } -#define MPERS_FUNC_NAME__(prefix, name) prefix ## name -#define MPERS_FUNC_NAME_(prefix, name) MPERS_FUNC_NAME__(prefix, name) -#define MPERS_FUNC_NAME(name) MPERS_FUNC_NAME_(MPERS_PREFIX, name) +# define MPERS_FUNC_NAME__(prefix, name) prefix ## name +# 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(syscall_name) +# define SYS_FUNC_NAME(syscall_name) MPERS_FUNC_NAME(syscall_name) -#define SYS_FUNC(syscall_name) int SYS_FUNC_NAME(sys_ ## syscall_name)(struct tcb *tcp) - -#if SIZEOF_KERNEL_LONG_T > SIZEOF_LONG -# define PRI_kl "ll" -#else -# define PRI_kl "l" -#endif - -#define PRI_kld PRI_kl"d" -#define PRI_klu PRI_kl"u" -#define PRI_klx PRI_kl"x" - -/* - * The kernel used to define 64-bit types on 64-bit systems on a per-arch - * basis. Some architectures would use unsigned long and others would use - * unsigned long long. These types were exported as part of the - * kernel-userspace ABI and now must be maintained forever. This matches - * what the kernel exports for each architecture so we don't need to cast - * every printing of __u64 or __s64 to stdint types. - */ -#if SIZEOF_LONG == 4 -# define PRI__64 "ll" -#elif defined ALPHA || defined IA64 || defined MIPS || defined POWERPC -# define PRI__64 "l" -#else -# define PRI__64 "ll" -#endif - -#define PRI__d64 PRI__64"d" -#define PRI__u64 PRI__64"u" -#define PRI__x64 PRI__64"x" +# define SYS_FUNC(syscall_name) int SYS_FUNC_NAME(sys_ ## syscall_name)(struct tcb *tcp) #endif /* !STRACE_DEFS_H */ diff --git a/delay.c b/delay.c new file mode 100644 index 00000000..e32dc502 --- /dev/null +++ b/delay.c @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +struct inject_delay_data { + struct timespec ts_enter; + struct timespec ts_exit; +}; + +static struct inject_delay_data *delay_data_vec; +static size_t delay_data_vec_capacity; /* size of the arena */ +static size_t delay_data_vec_size; /* size of the used arena */ + +static timer_t delay_timer = (timer_t) -1; +static bool delay_timer_is_armed; + +static void +expand_delay_data_vec(void) +{ + const size_t old_capacity = delay_data_vec_capacity; + delay_data_vec = xgrowarray(delay_data_vec, &delay_data_vec_capacity, + sizeof(*delay_data_vec)); + memset(delay_data_vec + old_capacity, 0, + (delay_data_vec_capacity - old_capacity) + * sizeof(*delay_data_vec)); +} + +uint16_t +alloc_delay_data(void) +{ + const uint16_t rval = delay_data_vec_size; + + if (rval < delay_data_vec_size) + error_func_msg_and_die("delay index overflow"); + + if (delay_data_vec_size == delay_data_vec_capacity) + expand_delay_data_vec(); + + ++delay_data_vec_size; + return rval; +} + +void +fill_delay_data(uint16_t delay_idx, int intval, bool isenter) +{ + if (delay_idx >= delay_data_vec_size) + error_func_msg_and_die("delay_idx >= delay_data_vec_size"); + + struct timespec *ts; + if (isenter) + ts = &(delay_data_vec[delay_idx].ts_enter); + else + ts = &(delay_data_vec[delay_idx].ts_exit); + + ts->tv_sec = intval / 1000000; + ts->tv_nsec = intval % 1000000 * 1000; +} + +static bool +is_delay_timer_created(void) +{ + return delay_timer != (timer_t) -1; +} + +bool +is_delay_timer_armed(void) +{ + return delay_timer_is_armed; +} + +void +delay_timer_expired(void) +{ + delay_timer_is_armed = false; +} + +void +arm_delay_timer(const struct tcb *const tcp) +{ + const struct itimerspec its = { + .it_value = tcp->delay_expiration_time + }; + + if (timer_settime(delay_timer, TIMER_ABSTIME, &its, NULL)) + perror_msg_and_die("timer_settime"); + + delay_timer_is_armed = true; + + debug_func_msg("timer set to %lld.%09ld for pid %d", + (long long) tcp->delay_expiration_time.tv_sec, + (long) tcp->delay_expiration_time.tv_nsec, + tcp->pid); +} + +void +delay_tcb(struct tcb *tcp, uint16_t delay_idx, bool isenter) +{ + if (delay_idx >= delay_data_vec_size) + error_func_msg_and_die("delay_idx >= delay_data_vec_size"); + + debug_func_msg("delaying pid %d on %s", + tcp->pid, isenter ? "enter" : "exit"); + tcp->flags |= TCB_DELAYED; + + struct timespec *ts_diff; + if (isenter) + ts_diff = &(delay_data_vec[delay_idx].ts_enter); + else + ts_diff = &(delay_data_vec[delay_idx].ts_exit); + + struct timespec ts_now; + clock_gettime(CLOCK_MONOTONIC, &ts_now); + ts_add(&tcp->delay_expiration_time, &ts_now, ts_diff); + + if (is_delay_timer_created()) { + struct itimerspec its; + if (timer_gettime(delay_timer, &its)) + perror_msg_and_die("timer_gettime"); + + const struct timespec *const ts_old = &its.it_value; + if (ts_nz(ts_old) && ts_cmp(ts_diff, ts_old) > 0) + return; + } else { + if (timer_create(CLOCK_MONOTONIC, NULL, &delay_timer)) + perror_msg_and_die("timer_create"); + } + + arm_delay_timer(tcp); +} diff --git a/delay.h b/delay.h new file mode 100644 index 00000000..fa111c76 --- /dev/null +++ b/delay.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_DELAY_H +# define STRACE_DELAY_H + +uint16_t alloc_delay_data(void); +void fill_delay_data(uint16_t delay_idx, int intval, bool isenter); +bool is_delay_timer_armed(void); +void delay_timer_expired(void); +void arm_delay_timer(const struct tcb *); +void delay_tcb(struct tcb *, uint16_t delay_idx, bool isenter); + +#endif /* !STRACE_DELAY_H */ diff --git a/depcomp b/depcomp index 4ebd5b3a..65cbf709 100755 --- a/depcomp +++ b/depcomp @@ -1,9 +1,9 @@ #! /bin/sh # depcomp - compile a program generating dependencies as side-effects -scriptversion=2013-05-30.07; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Copyright (C) 1999-2018 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ scriptversion=2013-05-30.07; # UTC # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -783,9 +783,9 @@ exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/desc.c b/desc.c index 48824697..92e6fe16 100644 --- a/desc.c +++ b/desc.c @@ -3,32 +3,14 @@ * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 1999-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" +#include "xstring.h" SYS_FUNC(close) { @@ -70,8 +52,8 @@ SYS_FUNC(dup3) static int decode_select(struct tcb *const tcp, const kernel_ulong_t *const args, - void (*const print_tv_ts) (struct tcb *, kernel_ulong_t), - const char * (*const sprint_tv_ts) (struct tcb *, kernel_ulong_t)) + const print_obj_by_addr_fn print_tv_ts, + const sprint_obj_by_addr_fn sprint_tv_ts) { int i, j; int nfds, fdsize; @@ -156,16 +138,19 @@ decode_select(struct tcb *const tcp, const kernel_ulong_t *const args, /* +2 chars needed at the end: ']',NUL */ if (outptr < end_outstr - (sizeof(", except [") + sizeof(int)*3 + 2)) { if (first) { - outptr += sprintf(outptr, "%s%s [%u", + outptr = xappendstr(outstr, + outptr, + "%s%s [%u", sep, i == 0 ? "in" : i == 1 ? "out" : "except", j ); first = 0; sep = ", "; - } - else { - outptr += sprintf(outptr, " %u", j); + } else { + outptr = xappendstr(outstr, + outptr, + " %u", j); } } if (--ready_fds == 0) @@ -179,7 +164,8 @@ decode_select(struct tcb *const tcp, const kernel_ulong_t *const args, if (args[4]) { const char *str = sprint_tv_ts(tcp, args[4]); if (outptr + sizeof("left ") + strlen(sep) + strlen(str) < end_outstr) { - outptr += sprintf(outptr, "%sleft %s", sep, str); + outptr = xappendstr(outstr, outptr, + "%sleft %s", sep, str); } } *outptr = '\0'; @@ -190,29 +176,21 @@ decode_select(struct tcb *const tcp, const kernel_ulong_t *const args, return 0; } +#if HAVE_ARCH_OLD_SELECT SYS_FUNC(oldselect) { - kernel_ulong_t select_args[5]; - unsigned int oldselect_args[5]; + kernel_ulong_t *args = + fetch_indirect_syscall_args(tcp, tcp->u_arg[0], 5); - if (sizeof(*select_args) == sizeof(*oldselect_args)) { - if (umove_or_printaddr(tcp, tcp->u_arg[0], &select_args)) { - return 0; - } + if (args) { + return decode_select(tcp, args, print_timeval, sprint_timeval); } else { - unsigned int i; - - if (umove_or_printaddr(tcp, tcp->u_arg[0], &oldselect_args)) { - return 0; - } - - for (i = 0; i < 5; ++i) { - select_args[i] = oldselect_args[i]; - } + if (entering(tcp)) + printaddr(tcp->u_arg[0]); + return RVAL_DECODED; } - - return decode_select(tcp, select_args, print_timeval, sprint_timeval); } +#endif /* HAVE_ARCH_OLD_SELECT */ #ifdef ALPHA SYS_FUNC(osf_select) @@ -246,9 +224,11 @@ umove_kulong_array_or_printaddr(struct tcb *const tcp, const kernel_ulong_t addr return umoven_or_printaddr(tcp, addr, n * sizeof(*ptr), ptr); } -SYS_FUNC(pselect6) +static int +do_pselect6(struct tcb *const tcp, const print_obj_by_addr_fn print_ts, + const sprint_obj_by_addr_fn sprint_ts) { - int rc = decode_select(tcp, tcp->u_arg, print_timespec, sprint_timespec); + int rc = decode_select(tcp, tcp->u_arg, print_ts, sprint_ts); if (entering(tcp)) { kernel_ulong_t data[2]; @@ -264,3 +244,15 @@ SYS_FUNC(pselect6) return rc; } + +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(pselect6_time32) +{ + return do_pselect6(tcp, print_timespec32, sprint_timespec32); +} +#endif + +SYS_FUNC(pselect6_time64) +{ + return do_pselect6(tcp, print_timespec64, sprint_timespec64); +} diff --git a/dirent.c b/dirent.c index 2ba6fe7a..5c0a09dd 100644 --- a/dirent.c +++ b/dirent.c @@ -4,29 +4,10 @@ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman * Copyright (c) 2005-2015 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -78,13 +59,13 @@ SYS_FUNC(getdents) if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); - tprints(", "); return 0; } const unsigned int count = tcp->u_arg[2]; if (syserror(tcp) || !verbose(tcp)) { + tprints(", "); printaddr(tcp->u_arg[1]); tprintf(", %u", count); return 0; @@ -101,6 +82,7 @@ SYS_FUNC(getdents) if (len) { buf = malloc(len); if (!buf || umoven(tcp, tcp->u_arg[1], len, buf) < 0) { + tprints(", "); printaddr(tcp->u_arg[1]); tprintf(", %u", count); free(buf); @@ -110,8 +92,9 @@ SYS_FUNC(getdents) buf = NULL; } + tprints(","); if (!abbrev(tcp)) - tprints("["); + tprints(" ["); for (i = 0; len && i <= len - sizeof(kernel_dirent); ) { kernel_dirent *d = (kernel_dirent *) &buf[i]; @@ -129,10 +112,7 @@ SYS_FUNC(getdents) zero_extend_signed_to_ull(d->d_off), d->d_reclen); - if (print_quoted_string(d->d_name, d_name_len, - QUOTE_0_TERMINATED) > 0) { - tprints("..."); - } + print_quoted_cstring(d->d_name, d_name_len); tprints(", d_type="); if (oob) @@ -143,7 +123,7 @@ SYS_FUNC(getdents) } dents++; if (d->d_reclen < sizeof(kernel_dirent)) { - tprints("/* d_reclen < sizeof(struct dirent) */"); + tprints_comment("d_reclen < sizeof(struct dirent)"); break; } i += d->d_reclen; @@ -151,7 +131,7 @@ SYS_FUNC(getdents) if (!abbrev(tcp)) tprints("]"); else - tprintf("/* %u entries */", dents); + tprintf_comment("%u entries", dents); tprintf(", %u", count); free(buf); return 0; diff --git a/dirent64.c b/dirent64.c index 448a2f1a..f7d68daa 100644 --- a/dirent64.c +++ b/dirent64.c @@ -4,29 +4,10 @@ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman * Copyright (c) 2005-2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -46,13 +27,13 @@ SYS_FUNC(getdents64) if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); - tprints(", "); return 0; } const unsigned int count = tcp->u_arg[2]; if (syserror(tcp) || !verbose(tcp)) { + tprints(", "); printaddr(tcp->u_arg[1]); tprintf(", %u", count); return 0; @@ -69,6 +50,7 @@ SYS_FUNC(getdents64) if (len) { buf = malloc(len); if (!buf || umoven(tcp, tcp->u_arg[1], len, buf) < 0) { + tprints(", "); printaddr(tcp->u_arg[1]); tprintf(", %u", count); free(buf); @@ -78,8 +60,9 @@ SYS_FUNC(getdents64) buf = NULL; } + tprints(","); if (!abbrev(tcp)) - tprints("["); + tprints(" ["); for (i = 0; len && i <= len - d_name_offset; ) { struct dirent64 *d = (struct dirent64 *) &buf[i]; if (!abbrev(tcp)) { @@ -102,15 +85,12 @@ SYS_FUNC(getdents64) printxval(dirent_types, d->d_type, "DT_???"); tprints(", d_name="); - if (print_quoted_string(d->d_name, d_name_len, - QUOTE_0_TERMINATED) > 0) { - tprints("..."); - } + print_quoted_cstring(d->d_name, d_name_len); tprints("}"); } if (d->d_reclen < d_name_offset) { - tprints("/* d_reclen < offsetof(struct dirent64, d_name) */"); + tprints_comment("d_reclen < offsetof(struct dirent64, d_name)"); break; } i += d->d_reclen; @@ -119,7 +99,7 @@ SYS_FUNC(getdents64) if (!abbrev(tcp)) tprints("]"); else - tprintf("/* %u entries */", dents); + tprintf_comment("%u entries", dents); tprintf(", %u", count); free(buf); return 0; diff --git a/dm.c b/dm.c index 7f856895..dbeca335 100644 --- a/dm.c +++ b/dm.c @@ -5,35 +5,17 @@ * Copyright (c) 2016 Masatake Yamato * Copyright (c) 2016 Dmitry V. Levin * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" #ifdef HAVE_LINUX_DM_IOCTL_H +# include "print_fields.h" # include # include @@ -42,13 +24,16 @@ /* Definitions for command which have been added later */ # ifndef DM_LIST_VERSIONS -# define DM_LIST_VERSIONS _IOWR(DM_IOCTL, 0xd, struct dm_ioctl) +# define DM_LIST_VERSIONS _IOWR(DM_IOCTL, 0x0d, struct dm_ioctl) # endif # ifndef DM_TARGET_MSG -# define DM_TARGET_MSG _IOWR(DM_IOCTL, 0xe, struct dm_ioctl) +# define DM_TARGET_MSG _IOWR(DM_IOCTL, 0x0e, struct dm_ioctl) # endif # ifndef DM_DEV_SET_GEOMETRY -# define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, 0xf, struct dm_ioctl) +# define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, 0x0f, struct dm_ioctl) +# endif +# ifndef DM_DEV_ARM_POLL +# define DM_DEV_ARM_POLL _IOWR(DM_IOCTL, 0x10, struct dm_ioctl) # endif @@ -61,20 +46,15 @@ dm_decode_device(const unsigned int code, const struct dm_ioctl *ioc) case DM_LIST_VERSIONS: break; default: - if (ioc->dev) { - tprints(", dev="); - print_dev_t(ioc->dev); - } - if (ioc->name[0]) { - tprints(", name="); - print_quoted_string(ioc->name, DM_NAME_LEN, - QUOTE_0_TERMINATED); - } - if (ioc->uuid[0]) { - tprints(", uuid="); - print_quoted_string(ioc->uuid, DM_UUID_LEN, - QUOTE_0_TERMINATED); - } + if (ioc->dev) + PRINT_FIELD_DEV(", ", *ioc, dev); + + if (ioc->name[0]) + PRINT_FIELD_CSTRING(", ", *ioc, name); + + if (ioc->uuid[0]) + PRINT_FIELD_CSTRING(", ", *ioc, uuid); + break; } } @@ -86,18 +66,16 @@ dm_decode_values(struct tcb *tcp, const unsigned int code, if (entering(tcp)) { switch (code) { case DM_TABLE_LOAD: - tprintf(", target_count=%" PRIu32, - ioc->target_count); + PRINT_FIELD_U(", ", *ioc, target_count); break; case DM_DEV_SUSPEND: if (ioc->flags & DM_SUSPEND_FLAG) break; - /* Fall through */ + ATTRIBUTE_FALLTHROUGH; case DM_DEV_RENAME: case DM_DEV_REMOVE: case DM_DEV_WAIT: - tprintf(", event_nr=%" PRIu32, - ioc->event_nr); + PRINT_FIELD_U(", ", *ioc, event_nr); break; } } else if (!syserror(tcp)) { @@ -112,24 +90,20 @@ dm_decode_values(struct tcb *tcp, const unsigned int code, case DM_TABLE_DEPS: case DM_TABLE_STATUS: case DM_TARGET_MSG: - tprintf(", target_count=%" PRIu32, - ioc->target_count); - tprintf(", open_count=%" PRIu32, - ioc->open_count); - tprintf(", event_nr=%" PRIu32, - ioc->event_nr); + PRINT_FIELD_U(", ", *ioc, target_count); + PRINT_FIELD_U(", ", *ioc, open_count); + PRINT_FIELD_U(", ", *ioc, event_nr); break; } } } -#include "xlat/dm_flags.h" +# include "xlat/dm_flags.h" static void dm_decode_flags(const struct dm_ioctl *ioc) { - tprints(", flags="); - printflags(dm_flags, ioc->flags, "DM_???"); + PRINT_FIELD_FLAGS(", ", *ioc, flags, dm_flags, "DM_???"); } static void @@ -140,7 +114,7 @@ dm_decode_dm_target_spec(struct tcb *const tcp, const kernel_ulong_t addr, sizeof(struct dm_target_spec); uint32_t i; uint32_t offset = ioc->data_start; - uint32_t offset_end; + uint32_t offset_end = 0; if (abbrev(tcp)) { if (ioc->target_count) @@ -150,51 +124,50 @@ dm_decode_dm_target_spec(struct tcb *const tcp, const kernel_ulong_t addr, } for (i = 0; i < ioc->target_count; i++) { - struct dm_target_spec s; + tprints(", "); + + if (i && offset <= offset_end) + goto misplaced; offset_end = offset + target_spec_size; if (offset_end <= offset || offset_end > ioc->data_size) goto misplaced; - tprints(", "); - if (i >= max_strlen) { tprints("..."); break; } + struct dm_target_spec s; + if (umove_or_printaddr(tcp, addr + offset, &s)) break; - tprintf("{sector_start=%" PRI__u64 ", length=%" PRI__u64, - s.sector_start, s.length); + PRINT_FIELD_U("{", s, sector_start); + PRINT_FIELD_U(", ", s, length); if (exiting(tcp)) - tprintf(", status=%" PRId32, s.status); + PRINT_FIELD_D(", ", s, status); - tprints(", target_type="); - print_quoted_string(s.target_type, DM_MAX_TYPE_NAME, - QUOTE_0_TERMINATED); + PRINT_FIELD_CSTRING(", ", s, target_type); tprints(", string="); printstr_ex(tcp, addr + offset_end, ioc->data_size - offset_end, QUOTE_0_TERMINATED); - tprintf("}"); + tprints("}"); if (entering(tcp)) offset += s.next; else offset = ioc->data_start + s.next; - - if (offset <= offset_end) - goto misplaced; } return; misplaced: - tprints(", /* misplaced struct dm_target_spec */ ..."); + tprints("???"); + tprints_comment("misplaced struct dm_target_spec"); } bool @@ -211,6 +184,16 @@ static void dm_decode_dm_target_deps(struct tcb *const tcp, const kernel_ulong_t addr, const struct dm_ioctl *const ioc) { + if (ioc->data_start == ioc->data_size) + return; + + tprints(", "); + + if (abbrev(tcp)) { + tprints("..."); + return; + } + static const uint32_t target_deps_dev_offs = offsetof(struct dm_target_deps, dev); uint64_t dev_buf; @@ -219,13 +202,6 @@ dm_decode_dm_target_deps(struct tcb *const tcp, const kernel_ulong_t addr, uint32_t offset_end = offset + target_deps_dev_offs; uint32_t space; - if (abbrev(tcp)) { - tprints(", ..."); - return; - } - - tprints(", "); - if (offset_end <= offset || offset_end > ioc->data_size) goto misplaced; @@ -237,17 +213,19 @@ dm_decode_dm_target_deps(struct tcb *const tcp, const kernel_ulong_t addr, if (s.count > space) goto misplaced; - tprintf("{count=%u, deps=", s.count); + PRINT_FIELD_U("{", s, count); + tprints(", deps="); print_array(tcp, addr + offset_end, s.count, &dev_buf, sizeof(dev_buf), - umoven_or_printaddr, dm_print_dev, NULL); + tfetch_mem, dm_print_dev, NULL); tprints("}"); return; misplaced: - tprints("/* misplaced struct dm_target_deps */ ..."); + tprints("???"); + tprints_comment("misplaced struct dm_target_deps"); } static void @@ -258,8 +236,12 @@ dm_decode_dm_name_list(struct tcb *const tcp, const kernel_ulong_t addr, offsetof(struct dm_name_list, name); struct dm_name_list s; uint32_t offset = ioc->data_start; - uint32_t offset_end; + uint32_t offset_end = 0; uint32_t count; + int rc; + + if (ioc->data_start == ioc->data_size) + return; if (abbrev(tcp)) { tprints(", ..."); @@ -267,13 +249,16 @@ dm_decode_dm_name_list(struct tcb *const tcp, const kernel_ulong_t addr, } for (count = 0;; count++) { + tprints(", "); + + if (count && offset <= offset_end) + goto misplaced; + offset_end = offset + name_list_name_offs; if (offset_end <= offset || offset_end > ioc->data_size) goto misplaced; - tprints(", "); - if (count >= max_strlen) { tprints("..."); break; @@ -281,31 +266,52 @@ dm_decode_dm_name_list(struct tcb *const tcp, const kernel_ulong_t addr, if (umove_or_printaddr(tcp, addr + offset, &s)) break; - if (!count && !s.dev) { - tprints("/* no devices present */"); - break; - } - tprints("{dev="); - print_dev_t(s.dev); + PRINT_FIELD_DEV("{", s, dev); + tprints(", name="); + rc = printstr_ex(tcp, addr + offset_end, + ioc->data_size - offset_end, + QUOTE_0_TERMINATED); + + /* + * In Linux v4.13-rc1~137^2~13 it has been decided to cram in + * one more undocumented field after the device name, as if the + * format decoding was not twisted enough already. So, we have + * to check "next" now, and if it _looks like_ that there is + * a space for one additional integer, let's print it. As if the + * perversity with "name string going further than pointer to + * the next one" wasn't enough. Moreover, the calculation was + * broken for m32 on 64-bit kernels until v4.14-rc4~20^2~3, and + * we have no ability to detect kernel bit-ness (on x86, at + * least), so refrain from printing it for the DM versions below + * 4.37 (the original version was also aligned differently than + * now even on 64 bit). + */ + + if ((rc > 0) && ioc->version[1] >= 37) { + kernel_ulong_t event_addr = + (addr + offset_end + rc + 7) & ~7; + uint32_t event_nr; + + if ((event_addr + sizeof(event_nr)) <= + (addr + offset + s.next) && + !umove(tcp, event_addr, &event_nr)) + tprintf(", event_nr=%" PRIu32, event_nr); + } - tprints("name="); - printstr_ex(tcp, addr + offset_end, ioc->data_size - offset_end, - QUOTE_0_TERMINATED); tprints("}"); if (!s.next) break; offset += s.next; - if (offset <= offset_end) - goto misplaced; } return; misplaced: - tprints(", /* misplaced struct dm_name_list */ ..."); + tprints("???"); + tprints_comment("misplaced struct dm_name_list"); } static void @@ -316,22 +322,28 @@ dm_decode_dm_target_versions(struct tcb *const tcp, const kernel_ulong_t addr, offsetof(struct dm_target_versions, name); struct dm_target_versions s; uint32_t offset = ioc->data_start; - uint32_t offset_end; + uint32_t offset_end = 0; uint32_t count; + if (ioc->data_start == ioc->data_size) + return; + if (abbrev(tcp)) { tprints(", ..."); return; } for (count = 0;; count++) { + tprints(", "); + + if (count && offset <= offset_end) + goto misplaced; + offset_end = offset + target_vers_name_offs; if (offset_end <= offset || offset_end > ioc->data_size) goto misplaced; - tprints(", "); - if (count >= max_strlen) { tprints("..."); break; @@ -350,44 +362,48 @@ dm_decode_dm_target_versions(struct tcb *const tcp, const kernel_ulong_t addr, break; offset += s.next; - if (offset <= offset_end) - goto misplaced; } return; misplaced: - tprints(", /* misplaced struct dm_target_versions */ ..."); + tprints("???"); + tprints_comment("misplaced struct dm_target_versions"); } static void dm_decode_dm_target_msg(struct tcb *const tcp, const kernel_ulong_t addr, - const struct dm_ioctl *const ioc) + const struct dm_ioctl *const ioc) { - static const uint32_t target_msg_message_offs = - offsetof(struct dm_target_msg, message); - uint32_t offset = ioc->data_start; - uint32_t offset_end = offset + target_msg_message_offs; + if (ioc->data_start == ioc->data_size) + return; + + tprints(", "); if (abbrev(tcp)) { - tprints(", ..."); + tprints("..."); return; } + static const uint32_t target_msg_message_offs = + offsetof(struct dm_target_msg, message); + uint32_t offset = ioc->data_start; + uint32_t offset_end = offset + target_msg_message_offs; + if (offset_end > offset && offset_end <= ioc->data_size) { struct dm_target_msg s; - tprints(", "); - if (umove_or_printaddr(tcp, addr + offset, &s)) return; - tprintf("{sector=%" PRI__u64 ", message=", s.sector); + PRINT_FIELD_U("{", s, sector); + tprints(", message="); printstr_ex(tcp, addr + offset_end, ioc->data_size - offset_end, QUOTE_0_TERMINATED); tprints("}"); } else { - tprints(", /* misplaced struct dm_target_msg */"); + tprints("???"); + tprints_comment("misplaced struct dm_target_msg"); } } @@ -395,19 +411,22 @@ static void dm_decode_string(struct tcb *const tcp, const kernel_ulong_t addr, const struct dm_ioctl *const ioc) { - uint32_t offset = ioc->data_start; + tprints(", "); if (abbrev(tcp)) { - tprints(", ..."); + tprints("..."); return; } - if (offset < ioc->data_size) { - tprints(", string="); + uint32_t offset = ioc->data_start; + + if (offset <= ioc->data_size) { + tprints("string="); printstr_ex(tcp, addr + offset, ioc->data_size - offset, QUOTE_0_TERMINATED); } else { - tprints(", /* misplaced string */"); + tprints("???"); + tprints_comment("misplaced string"); } } @@ -422,6 +441,7 @@ dm_ioctl_has_params(const unsigned int code) case DM_DEV_SUSPEND: case DM_DEV_STATUS: case DM_TABLE_CLEAR: + case DM_DEV_ARM_POLL: return false; } @@ -472,7 +492,7 @@ dm_known_ioctl(struct tcb *const tcp, const unsigned int code, } if (exiting(tcp) && syserror(tcp) && !ioc_changed) - return 1; + return RVAL_IOCTL_DECODED; /* * device mapper code uses %d in some places and %u in another, but @@ -485,20 +505,20 @@ dm_known_ioctl(struct tcb *const tcp, const unsigned int code, * ioctl fields */ if (ioc->version[0] != DM_VERSION_MAJOR) { - tprints(", /* Unsupported device mapper ABI version */ ..."); + tprints_comment("unsupported device mapper ABI version"); goto skip; } - tprintf(", data_size=%u", ioc->data_size); - - if (dm_ioctl_has_params(code)) - tprintf(", data_start=%u", ioc->data_start); + PRINT_FIELD_U(", ", *ioc, data_size); if (ioc->data_size < offsetof(struct dm_ioctl, data)) { - tprints(", /* Incorrect data_size */ ..."); + tprints_comment("data_size too small"); goto skip; } + if (dm_ioctl_has_params(code)) + PRINT_FIELD_U(", ", *ioc, data_start); + dm_decode_device(code, ioc); dm_decode_values(tcp, code, ioc); dm_decode_flags(ioc); @@ -546,7 +566,7 @@ dm_known_ioctl(struct tcb *const tcp, const unsigned int code, skip: tprints("}"); - return 1; + return entering(tcp) ? 0 : RVAL_IOCTL_DECODED; } int @@ -569,9 +589,10 @@ dm_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t ar case DM_LIST_VERSIONS: case DM_TARGET_MSG: case DM_DEV_SET_GEOMETRY: + case DM_DEV_ARM_POLL: return dm_known_ioctl(tcp, code, arg); default: - return 0; + return RVAL_DECODED; } } @@ -580,7 +601,7 @@ dm_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t ar int dm_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t arg) { - return 0; + return RVAL_DECODED; } # endif /* DM_VERSION_MAJOR == 4 */ diff --git a/dyxlat.c b/dyxlat.c new file mode 100644 index 00000000..d575d460 --- /dev/null +++ b/dyxlat.c @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +struct dyxlat { + size_t used; + size_t allocated; + struct xlat *xlat; +}; + +#define MARK_END(xlat) \ + do { \ + (xlat).val = 0; \ + (xlat).str = 0; \ + } while (0) + +struct dyxlat * +dyxlat_alloc(const size_t nmemb) +{ + struct dyxlat *const dyxlat = xmalloc(sizeof(*dyxlat)); + + dyxlat->used = 1; + dyxlat->allocated = nmemb; + dyxlat->xlat = xgrowarray(NULL, &dyxlat->allocated, sizeof(struct xlat)); + MARK_END(dyxlat->xlat[0]); + + return dyxlat; +} + +void +dyxlat_free(struct dyxlat *const dyxlat) +{ + size_t i; + + for (i = 0; i < dyxlat->used - 1; ++i) { + free((void *) dyxlat->xlat[i].str); + dyxlat->xlat[i].str = NULL; + } + + free(dyxlat->xlat); + dyxlat->xlat = NULL; + free(dyxlat); +} + +const struct xlat * +dyxlat_get(const struct dyxlat *const dyxlat) +{ + return dyxlat->xlat; +} + +void +dyxlat_add_pair(struct dyxlat *const dyxlat, const uint64_t val, + const char *const str, const size_t len) +{ + size_t i; + + for (i = 0; i < dyxlat->used - 1; ++i) { + if (dyxlat->xlat[i].val == val) { + if (strncmp(dyxlat->xlat[i].str, str, len) == 0 + && dyxlat->xlat[i].str[len] == '\0') + return; + + free((void *) dyxlat->xlat[i].str); + dyxlat->xlat[i].str = xstrndup(str, len); + return; + } + } + + if (dyxlat->used >= dyxlat->allocated) + dyxlat->xlat = xgrowarray(dyxlat->xlat, &dyxlat->allocated, + sizeof(struct xlat)); + + dyxlat->xlat[dyxlat->used - 1].val = val; + dyxlat->xlat[dyxlat->used - 1].str = xstrndup(str, len); + MARK_END(dyxlat->xlat[dyxlat->used]); + dyxlat->used++; +} diff --git a/epoll.c b/epoll.c index 8dc7ab09..a3b7b863 100644 --- a/epoll.c +++ b/epoll.c @@ -2,29 +2,10 @@ * Copyright (c) 2004-2007 Ulrich Drepper * Copyright (c) 2004 Roland McGrath * Copyright (c) 2005-2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -93,7 +74,7 @@ epoll_wait_common(struct tcb *tcp) } else { struct epoll_event ev; print_array(tcp, tcp->u_arg[1], tcp->u_rval, &ev, sizeof(ev), - umoven_or_printaddr, print_epoll_event, 0); + tfetch_mem, print_epoll_event, 0); tprintf(", %d, %d", (int) tcp->u_arg[2], (int) tcp->u_arg[3]); } } diff --git a/errnoent.sh b/errnoent.sh deleted file mode 100755 index 0b1b06a3..00000000 --- a/errnoent.sh +++ /dev/null @@ -1,38 +0,0 @@ -#!/bin/sh -# Copyright (c) 1993, 1994, 1995 Rick Sladkey -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -awk ' -$1 == "#define" && $2 ~ /^E[A-Z0-9_]+$/ && $3 ~ /^[0-9]+$/ { - errno[$3] = $2 - if ($3 > max) - max = $3 -} -END { - for (i = 0; i <= max; i++) - if (errno[i]) - printf("[%3d] = \"%s\",\n", i, errno[i]) -} -' "$@" diff --git a/error_prints.c b/error_prints.c new file mode 100644 index 00000000..d14268df --- /dev/null +++ b/error_prints.c @@ -0,0 +1,108 @@ +/* + * Copyright (c) 1999-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include +#include +#include + +#include "error_prints.h" + +#ifndef HAVE_PROGRAM_INVOCATION_NAME +extern char *program_invocation_name; +#endif + +static void +verror_msg(int err_no, const char *fmt, va_list p) +{ + char *msg; + + fflush(NULL); + + /* We want to print entire message with single fprintf to ensure + * message integrity if stderr is shared with other programs. + * Thus we use vasprintf + single fprintf. + */ + msg = NULL; + if (vasprintf(&msg, fmt, p) >= 0) { + if (err_no) + fprintf(stderr, "%s: %s: %s\n", + program_invocation_name, msg, strerror(err_no)); + else + fprintf(stderr, "%s: %s\n", + program_invocation_name, msg); + free(msg); + } else { + /* malloc in vasprintf failed, try it without malloc */ + fprintf(stderr, "%s: ", program_invocation_name); + vfprintf(stderr, fmt, p); + if (err_no) + fprintf(stderr, ": %s\n", strerror(err_no)); + else + putc('\n', stderr); + } + /* We don't switch stderr to buffered, thus fprintf(stderr) + * always flushes its output and this is not necessary: */ + /* fflush(stderr); */ +} + +void +error_msg(const char *fmt, ...) +{ + va_list p; + va_start(p, fmt); + verror_msg(0, fmt, p); + va_end(p); +} + +void +error_msg_and_die(const char *fmt, ...) +{ + va_list p; + va_start(p, fmt); + verror_msg(0, fmt, p); + va_end(p); + die(); +} + +void +error_msg_and_help(const char *fmt, ...) +{ + if (fmt != NULL) { + va_list p; + va_start(p, fmt); + verror_msg(0, fmt, p); + va_end(p); + } + fprintf(stderr, "Try '%s -h' for more information.\n", + program_invocation_name); + die(); +} + +void +perror_msg(const char *fmt, ...) +{ + va_list p; + va_start(p, fmt); + verror_msg(errno, fmt, p); + va_end(p); +} + +void +perror_msg_and_die(const char *fmt, ...) +{ + va_list p; + va_start(p, fmt); + verror_msg(errno, fmt, p); + va_end(p); + die(); +} diff --git a/error_prints.h b/error_prints.h new file mode 100644 index 00000000..678c1d15 --- /dev/null +++ b/error_prints.h @@ -0,0 +1,59 @@ +/* + * This file contains error printing functions. + * These functions can be used by various binaries included in the strace + * package. Variable 'program_invocation_name' and function 'die()' + * have to be defined globally. + * + * Copyright (c) 2001-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_ERROR_PRINTS_H +# define STRACE_ERROR_PRINTS_H + +# include + +# include "gcc_compat.h" + +extern bool debug_flag; + +void die(void) ATTRIBUTE_NORETURN; + +void error_msg(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2)); +void perror_msg(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2)); +void perror_msg_and_die(const char *fmt, ...) + ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; +void error_msg_and_help(const char *fmt, ...) + ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; +void error_msg_and_die(const char *fmt, ...) + ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; + +/* Wrappers for if (debug_flag) error_msg(...) */ +# define debug_msg(...) \ + do { \ + if (debug_flag) \ + error_msg(__VA_ARGS__); \ + } while (0) +# define debug_perror_msg(...) \ + do { \ + if (debug_flag) \ + perror_msg(__VA_ARGS__); \ + } while (0) + +/* Simple wrappers for providing function name in error messages */ +# define error_func_msg(fmt_, ...) \ + error_msg("%s: " fmt_, __func__, ##__VA_ARGS__) +# define perror_func_msg(fmt_, ...) \ + perror_msg("%s: " fmt_, __func__, ##__VA_ARGS__) +# define debug_func_msg(fmt_, ...) \ + debug_msg("%s: " fmt_, __func__, ##__VA_ARGS__) +# define debug_func_perror_msg(fmt_, ...) \ + debug_perror_msg("%s: " fmt_, __func__, ##__VA_ARGS__) +# define error_func_msg_and_die(fmt_, ...) \ + error_msg_and_die("%s: " fmt_, __func__, ##__VA_ARGS__) +# define perror_func_msg_and_die(fmt_, ...) \ + perror_msg_and_die("%s: " fmt_, __func__, ##__VA_ARGS__) + +#endif /* !STRACE_ERROR_PRINTS_H */ diff --git a/evdev.c b/evdev.c index 68745515..e402d26e 100644 --- a/evdev.c +++ b/evdev.c @@ -1,48 +1,22 @@ /* * Copyright (c) 2015 Etienne Gemsa * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" -#ifdef HAVE_LINUX_INPUT_H +#include "xlat/evdev_abs.h" +#include "xlat/evdev_ev.h" -#include DEF_MPERS_TYPE(struct_ff_effect) +#ifdef HAVE_LINUX_INPUT_H # include # include -typedef struct ff_effect struct_ff_effect; - -#endif /* HAVE_LINUX_INPUT_H */ - -#include MPERS_DEFS - -#ifdef HAVE_LINUX_INPUT_H - # include "xlat/evdev_autorepeat.h" # include "xlat/evdev_ff_status.h" # include "xlat/evdev_ff_types.h" @@ -54,104 +28,12 @@ typedef struct ff_effect struct_ff_effect; # include "xlat/evdev_relative_axes.h" # include "xlat/evdev_snd.h" # include "xlat/evdev_switch.h" -# include "xlat/evdev_sync.h" # ifndef SYN_MAX # define SYN_MAX 0xf # endif -static void -decode_envelope(void *const data) -{ - const struct ff_envelope *const envelope = data; - - tprintf(", envelope={attack_length=%" PRIu16 - ", attack_level=%" PRIu16 - ", fade_length=%" PRIu16 - ", fade_level=%#x}", - envelope->attack_length, - envelope->attack_level, - envelope->fade_length, - envelope->fade_level); -} - -static int -ff_effect_ioctl(struct tcb *const tcp, const kernel_ulong_t arg) -{ - tprints(", "); - - struct_ff_effect ffe; - - if (umove_or_printaddr(tcp, arg, &ffe)) - return 1; - - tprints("{type="); - printxval(evdev_ff_types, ffe.type, "FF_???"); - tprintf(", id=%" PRIu16 - ", direction=%" PRIu16 ", ", - ffe.id, - ffe.direction); - - if (abbrev(tcp)) { - tprints("...}"); - return 1; - } - - tprintf("trigger={button=%" PRIu16 - ", interval=%" PRIu16 "}" - ", replay={length=%" PRIu16 - ", delay=%" PRIu16 "}", - ffe.trigger.button, - ffe.trigger.interval, - ffe.replay.length, - ffe.replay.delay); - - switch (ffe.type) { - case FF_CONSTANT: - tprintf(", constant={level=%" PRId16, - ffe.u.constant.level); - decode_envelope(&ffe.u.constant.envelope); - tprints("}"); - break; - case FF_RAMP: - tprintf(", ramp={start_level=%" PRId16 - ", end_level=%" PRId16, - ffe.u.ramp.start_level, - ffe.u.ramp.end_level); - decode_envelope(&ffe.u.ramp.envelope); - tprints("}"); - break; - case FF_PERIODIC: - tprintf(", periodic={waveform=%" PRIu16 - ", period=%" PRIu16 - ", magnitude=%" PRId16 - ", offset=%" PRId16 - ", phase=%" PRIu16, - ffe.u.periodic.waveform, - ffe.u.periodic.period, - ffe.u.periodic.magnitude, - ffe.u.periodic.offset, - ffe.u.periodic.phase); - decode_envelope(&ffe.u.periodic.envelope); - tprintf(", custom_len=%u, custom_data=", - ffe.u.periodic.custom_len); - printaddr(ptr_to_kulong(ffe.u.periodic.custom_data)); - tprints("}"); - break; - case FF_RUMBLE: - tprintf(", rumble={strong_magnitude=%" PRIu16 - ", weak_magnitude=%" PRIu16 "}", - ffe.u.rumble.strong_magnitude, - ffe.u.rumble.weak_magnitude); - break; - default: - break; - } - - tprints("}"); - - return 1; -} +const size_t evdev_abs_size = ARRAY_SIZE(evdev_abs) - 1; static int abs_ioctl(struct tcb *const tcp, const kernel_ulong_t arg) @@ -184,7 +66,7 @@ abs_ioctl(struct tcb *const tcp, const kernel_ulong_t arg) tprints("}"); } - return 1; + return RVAL_IOCTL_DECODED; } static int @@ -196,11 +78,11 @@ keycode_ioctl(struct tcb *const tcp, const kernel_ulong_t arg) if (!umove_or_printaddr(tcp, arg, &keycode)) { tprintf("[%u, ", keycode[0]); - printxval(evdev_keycode, keycode[1], "KEY_???"); + printxval_index(evdev_keycode, keycode[1], "KEY_???"); tprints("]"); } - return 1; + return RVAL_IOCTL_DECODED; } # ifdef EVIOCGKEYCODE_V2 @@ -212,7 +94,7 @@ keycode_V2_ioctl(struct tcb *const tcp, const kernel_ulong_t arg) struct input_keymap_entry ike; if (umove_or_printaddr(tcp, arg, &ike)) - return 1; + return RVAL_IOCTL_DECODED; tprintf("{flags=%" PRIu8 ", len=%" PRIu8 ", ", @@ -223,7 +105,7 @@ keycode_V2_ioctl(struct tcb *const tcp, const kernel_ulong_t arg) unsigned int i; tprintf("index=%" PRIu16 ", keycode=", ike.index); - printxval(evdev_keycode, ike.keycode, "KEY_???"); + printxval_index(evdev_keycode, ike.keycode, "KEY_???"); tprints(", scancode=["); for (i = 0; i < ARRAY_SIZE(ike.scancode); i++) { if (i > 0) @@ -237,7 +119,7 @@ keycode_V2_ioctl(struct tcb *const tcp, const kernel_ulong_t arg) tprints("}"); - return 1; + return RVAL_IOCTL_DECODED; } # endif /* EVIOCGKEYCODE_V2 */ @@ -258,25 +140,25 @@ getid_ioctl(struct tcb *const tcp, const kernel_ulong_t arg) id.product, id.version); - return 1; + return RVAL_IOCTL_DECODED; } static int -decode_bitset(struct tcb *const tcp, const kernel_ulong_t arg, - const struct xlat decode_nr[], const unsigned int max_nr, - const char *const dflt) +decode_bitset_(struct tcb *const tcp, const kernel_ulong_t arg, + const struct xlat decode_nr[], const unsigned int max_nr, + const char *const dflt, size_t decode_nr_size, enum xlat_type xt) { tprints(", "); unsigned int size; - if ((kernel_ulong_t) tcp->u_rval > max_nr) + if ((kernel_ulong_t) tcp->u_rval > max_nr / 8) size = max_nr; else - size = tcp->u_rval; + size = tcp->u_rval * 8; char decoded_arg[size]; if (umove_or_printaddr(tcp, arg, &decoded_arg)) - return 1; + return RVAL_IOCTL_DECODED; tprints("["); @@ -285,7 +167,7 @@ decode_bitset(struct tcb *const tcp, const kernel_ulong_t arg, if (i < 0) { tprints(" 0 "); } else { - printxval(decode_nr, i, dflt); + printxval_dispatch(decode_nr, decode_nr_size, i, dflt, xt); while ((i = next_set_bit(decoded_arg, i + 1, size)) > 0) { if (abbrev(tcp) && bit_displayed >= 3) { @@ -293,16 +175,21 @@ decode_bitset(struct tcb *const tcp, const kernel_ulong_t arg, break; } tprints(", "); - printxval(decode_nr, i, dflt); + printxval_dispatch(decode_nr, decode_nr_size, i, dflt, + xt); bit_displayed++; } } tprints("]"); - return 1; + return RVAL_IOCTL_DECODED; } +# define decode_bitset(tcp_, arg_, decode_nr_, max_nr_, dflt_, xt_) \ + decode_bitset_((tcp_), (arg_), (decode_nr_), (max_nr_), \ + (dflt_), ARRAY_SIZE(decode_nr_) - 1, (xt_)) + # ifdef EVIOCGMTSLOTS static int mtslots_ioctl(struct tcb *const tcp, const unsigned int code, @@ -313,13 +200,13 @@ mtslots_ioctl(struct tcb *const tcp, const unsigned int code, const size_t size = _IOC_SIZE(code) / sizeof(int); if (!size) { printaddr(arg); - return 1; + return RVAL_IOCTL_DECODED; } int buffer[size]; if (umove_or_printaddr(tcp, arg, &buffer)) - return 1; + return RVAL_IOCTL_DECODED; tprints("{code="); printxval(evdev_mtslots, buffer[0], "ABS_MT_???"); @@ -332,7 +219,7 @@ mtslots_ioctl(struct tcb *const tcp, const unsigned int code, tprints("]}"); - return 1; + return RVAL_IOCTL_DECODED; } # endif /* EVIOCGMTSLOTS */ @@ -342,7 +229,7 @@ repeat_ioctl(struct tcb *const tcp, const kernel_ulong_t arg) { tprints(", "); printpair_int(tcp, arg, "%u"); - return 1; + return RVAL_IOCTL_DECODED; } # endif /* EVIOCGREP || EVIOCSREP */ @@ -351,49 +238,48 @@ bit_ioctl(struct tcb *const tcp, const unsigned int ev_nr, const kernel_ulong_t arg) { switch (ev_nr) { - case EV_SYN: - return decode_bitset(tcp, arg, evdev_sync, - SYN_MAX, "SYN_???"); + case 0: + return decode_bitset(tcp, arg, evdev_ev, + EV_MAX, "EV_???", XT_SORTED); case EV_KEY: return decode_bitset(tcp, arg, evdev_keycode, - KEY_MAX, "KEY_???"); + KEY_MAX, "KEY_???", XT_INDEXED); case EV_REL: return decode_bitset(tcp, arg, evdev_relative_axes, - REL_MAX, "REL_???"); + REL_MAX, "REL_???", XT_INDEXED); case EV_ABS: return decode_bitset(tcp, arg, evdev_abs, - ABS_MAX, "ABS_???"); + ABS_MAX, "ABS_???", XT_INDEXED); case EV_MSC: return decode_bitset(tcp, arg, evdev_misc, - MSC_MAX, "MSC_???"); -# ifdef EV_SW + MSC_MAX, "MSC_???", XT_INDEXED); case EV_SW: return decode_bitset(tcp, arg, evdev_switch, - SW_MAX, "SW_???"); -# endif + SW_MAX, "SW_???", XT_INDEXED); case EV_LED: return decode_bitset(tcp, arg, evdev_leds, - LED_MAX, "LED_???"); + LED_MAX, "LED_???", XT_INDEXED); case EV_SND: return decode_bitset(tcp, arg, evdev_snd, - SND_MAX, "SND_???"); + SND_MAX, "SND_???", XT_INDEXED); case EV_REP: return decode_bitset(tcp, arg, evdev_autorepeat, - REP_MAX, "REP_???"); + REP_MAX, "REP_???", XT_INDEXED); case EV_FF: return decode_bitset(tcp, arg, evdev_ff_types, - FF_MAX, "FF_???"); + FF_MAX, "FF_???", XT_SORTED); case EV_PWR: tprints(", "); printnum_int(tcp, arg, "%d"); - return 1; + return RVAL_IOCTL_DECODED; case EV_FF_STATUS: return decode_bitset(tcp, arg, evdev_ff_status, - FF_STATUS_MAX, "FF_STATUS_???"); + FF_STATUS_MAX, "FF_STATUS_???", + XT_INDEXED); default: tprints(", "); printaddr(arg); - return 1; + return RVAL_IOCTL_DECODED; } } @@ -406,11 +292,11 @@ evdev_read_ioctl(struct tcb *const tcp, const unsigned int code, case EVIOCGVERSION: tprints(", "); printnum_int(tcp, arg, "%#x"); - return 1; + return RVAL_IOCTL_DECODED; case EVIOCGEFFECTS: tprints(", "); printnum_int(tcp, arg, "%u"); - return 1; + return RVAL_IOCTL_DECODED; case EVIOCGID: return getid_ioctl(tcp, arg); # ifdef EVIOCGREP @@ -439,26 +325,27 @@ evdev_read_ioctl(struct tcb *const tcp, const unsigned int code, printaddr(arg); else printstrn(tcp, arg, tcp->u_rval); - return 1; + return RVAL_IOCTL_DECODED; # ifdef EVIOCGPROP case _IOC_NR(EVIOCGPROP(0)): return decode_bitset(tcp, arg, evdev_prop, - INPUT_PROP_MAX, "PROP_???"); + INPUT_PROP_MAX, "PROP_???", + XT_INDEXED); # endif case _IOC_NR(EVIOCGSND(0)): return decode_bitset(tcp, arg, evdev_snd, - SND_MAX, "SND_???"); + SND_MAX, "SND_???", XT_INDEXED); # ifdef EVIOCGSW case _IOC_NR(EVIOCGSW(0)): return decode_bitset(tcp, arg, evdev_switch, - SW_MAX, "SW_???"); + SW_MAX, "SW_???", XT_INDEXED); # endif case _IOC_NR(EVIOCGKEY(0)): return decode_bitset(tcp, arg, evdev_keycode, - KEY_MAX, "KEY_???"); + KEY_MAX, "KEY_???", XT_INDEXED); case _IOC_NR(EVIOCGLED(0)): return decode_bitset(tcp, arg, evdev_leds, - LED_MAX, "LED_???"); + LED_MAX, "LED_???", XT_INDEXED); } /* multi-number fixed-length commands */ @@ -488,23 +375,27 @@ evdev_write_ioctl(struct tcb *const tcp, const unsigned int code, case EVIOCSKEYCODE_V2: return keycode_V2_ioctl(tcp, arg); # endif - case EVIOCSFF: - return ff_effect_ioctl(tcp, arg); case EVIOCRMFF: tprintf(", %d", (int) arg); - return 1; + return RVAL_IOCTL_DECODED; case EVIOCGRAB: # ifdef EVIOCREVOKE case EVIOCREVOKE: # endif tprintf(", %" PRI_klu, arg); - return 1; + return RVAL_IOCTL_DECODED; # ifdef EVIOCSCLOCKID case EVIOCSCLOCKID: tprints(", "); printnum_int(tcp, arg, "%u"); - return 1; + return RVAL_IOCTL_DECODED; # endif + default: { + int rc = evdev_write_ioctl_mpers(tcp, code, arg); + + if (rc != RVAL_DECODED) + return rc; + } } /* multi-number fixed-length commands */ @@ -514,10 +405,17 @@ evdev_write_ioctl(struct tcb *const tcp, const unsigned int code, return 0; } -MPERS_PRINTER_DECL(int, evdev_ioctl, struct tcb *const tcp, - const unsigned int code, const kernel_ulong_t arg) +void +print_evdev_ff_type(const kernel_ulong_t val) +{ + printxval(evdev_ff_types, val, "FF_???"); +} + +int +evdev_ioctl(struct tcb *const tcp, + const unsigned int code, const kernel_ulong_t arg) { - switch(_IOC_DIR(code)) { + switch (_IOC_DIR(code)) { case _IOC_READ: if (entering(tcp)) return 0; diff --git a/evdev_mpers.c b/evdev_mpers.c new file mode 100644 index 00000000..ff99544b --- /dev/null +++ b/evdev_mpers.c @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2015 Etienne Gemsa + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#ifdef HAVE_LINUX_INPUT_H + +# include DEF_MPERS_TYPE(struct_ff_effect) + +# include +# include + +typedef struct ff_effect struct_ff_effect; + +#endif /* HAVE_LINUX_INPUT_H */ + +#include MPERS_DEFS + +#ifdef HAVE_LINUX_INPUT_H + +static void +decode_envelope(void *const data) +{ + const struct ff_envelope *const envelope = data; + + tprintf(", envelope={attack_length=%" PRIu16 + ", attack_level=%" PRIu16 + ", fade_length=%" PRIu16 + ", fade_level=%#x}", + envelope->attack_length, + envelope->attack_level, + envelope->fade_length, + envelope->fade_level); +} + +static int +ff_effect_ioctl(struct tcb *const tcp, const kernel_ulong_t arg) +{ + tprints(", "); + + struct_ff_effect ffe; + + if (umove_or_printaddr(tcp, arg, &ffe)) + return RVAL_IOCTL_DECODED; + + tprints("{type="); + print_evdev_ff_type(ffe.type); + tprintf(", id=%" PRIu16 + ", direction=%" PRIu16 ", ", + ffe.id, + ffe.direction); + + if (abbrev(tcp)) { + tprints("...}"); + return RVAL_IOCTL_DECODED; + } + + tprintf("trigger={button=%" PRIu16 + ", interval=%" PRIu16 "}" + ", replay={length=%" PRIu16 + ", delay=%" PRIu16 "}", + ffe.trigger.button, + ffe.trigger.interval, + ffe.replay.length, + ffe.replay.delay); + + switch (ffe.type) { + case FF_CONSTANT: + tprintf(", constant={level=%" PRId16, + ffe.u.constant.level); + decode_envelope(&ffe.u.constant.envelope); + tprints("}"); + break; + case FF_RAMP: + tprintf(", ramp={start_level=%" PRId16 + ", end_level=%" PRId16, + ffe.u.ramp.start_level, + ffe.u.ramp.end_level); + decode_envelope(&ffe.u.ramp.envelope); + tprints("}"); + break; + case FF_PERIODIC: + tprintf(", periodic={waveform=%" PRIu16 + ", period=%" PRIu16 + ", magnitude=%" PRId16 + ", offset=%" PRId16 + ", phase=%" PRIu16, + ffe.u.periodic.waveform, + ffe.u.periodic.period, + ffe.u.periodic.magnitude, + ffe.u.periodic.offset, + ffe.u.periodic.phase); + decode_envelope(&ffe.u.periodic.envelope); + tprintf(", custom_len=%u, custom_data=", + ffe.u.periodic.custom_len); + printaddr(ptr_to_kulong(ffe.u.periodic.custom_data)); + tprints("}"); + break; + case FF_RUMBLE: + tprintf(", rumble={strong_magnitude=%" PRIu16 + ", weak_magnitude=%" PRIu16 "}", + ffe.u.rumble.strong_magnitude, + ffe.u.rumble.weak_magnitude); + break; + default: + break; + } + + tprints("}"); + + return RVAL_IOCTL_DECODED; +} + +MPERS_PRINTER_DECL(int, evdev_write_ioctl_mpers, struct tcb *const tcp, + const unsigned int code, const kernel_ulong_t arg) +{ + switch (code) { + case EVIOCSFF: + return ff_effect_ioctl(tcp, arg); + default: + return RVAL_DECODED; + } +} + +#endif /* HAVE_LINUX_INPUT_H */ diff --git a/eventfd.c b/eventfd.c index 0e7babcc..e23aa10e 100644 --- a/eventfd.c +++ b/eventfd.c @@ -1,29 +1,9 @@ /* * Copyright (c) 2007 Ulrich Drepper - * Copyright (c) 2008-2015 Dmitry V. Levin + * Copyright (c) 2008-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/execve.c b/execve.c index 6e45b11b..b675cd26 100644 --- a/execve.c +++ b/execve.c @@ -6,29 +6,10 @@ * Copyright (c) 2007 Roland McGrath * Copyright (c) 2011-2012 Denys Vlasenko * Copyright (c) 2010-2015 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -56,8 +37,11 @@ printargv(struct tcb *const tcp, kernel_ulong_t addr) if (umoven(tcp, addr, wordsize, cp.data)) { if (sep == start_sep) printaddr(addr); - else - tprints(", ???]"); + else { + tprints(", ..."); + printaddr_comment(addr); + tprints("]"); + } return; } if (!(wordsize < sizeof(cp.p64) ? cp.p32 : cp.p64)) { @@ -78,10 +62,10 @@ printargv(struct tcb *const tcp, kernel_ulong_t addr) static void printargc(struct tcb *const tcp, kernel_ulong_t addr) { - if (!addr || !verbose(tcp)) { - printaddr(addr); + printaddr(addr); + + if (!addr || !verbose(tcp)) return; - } bool unterminated = false; unsigned int count = 0; @@ -89,17 +73,16 @@ printargc(struct tcb *const tcp, kernel_ulong_t addr) for (; addr; addr += current_wordsize, ++count) { if (umoven(tcp, addr, current_wordsize, &cp)) { - if (count) { - unterminated = true; - break; - } - printaddr(addr); - return; + if (!count) + return; + + unterminated = true; + break; } if (!cp) break; } - tprintf("[/* %u var%s%s */]", + tprintf_comment("%u var%s%s", count, count == 1 ? "" : "s", unterminated ? ", unterminated" : ""); } diff --git a/f_owner_ex.h b/f_owner_ex.h new file mode 100644 index 00000000..1499bc07 --- /dev/null +++ b/f_owner_ex.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_F_OWNER_EX_H +# define STRACE_F_OWNER_EX_H + +# include + +# if defined HAVE_STRUCT_F_OWNER_EX +typedef struct f_owner_ex struct_kernel_f_owner_ex; +# elif defined HAVE_STRUCT___KERNEL_F_OWNER_EX +typedef struct __kernel_f_owner_ex struct_kernel_f_owner_ex; +# else +# error struct f_owner_ex definition not found in +# endif + +#endif /* !STRACE_F_OWNER_EX_H */ diff --git a/fadvise.c b/fadvise.c index f0d057b7..15f70b0e 100644 --- a/fadvise.c +++ b/fadvise.c @@ -5,29 +5,10 @@ * Copyright (c) 2009 Andreas Schwab * Copyright (c) 2009 Kirill A. Shutemov * Copyright (c) 2011-2015 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/fallocate.c b/fallocate.c index b707279c..82c0d642 100644 --- a/fallocate.c +++ b/fallocate.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" #ifdef HAVE_LINUX_FALLOC_H diff --git a/fanotify.c b/fanotify.c index 203e9d29..9a0d5c62 100644 --- a/fanotify.c +++ b/fanotify.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2014-2015 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -74,10 +55,12 @@ SYS_FUNC(fanotify_mark) #endif printflags64(fan_event_flags, mask, "FAN_???"); tprints(", "); - if ((int) tcp->u_arg[argn] == FAN_NOFD) - tprints("FAN_NOFD, "); - else + if ((int) tcp->u_arg[argn] == FAN_NOFD) { + print_xlat_d(FAN_NOFD); + tprints(", "); + } else { print_dirfd(tcp, tcp->u_arg[argn]); + } printpath(tcp, tcp->u_arg[argn + 1]); return RVAL_DECODED; diff --git a/fchownat.c b/fchownat.c index 6aed51d0..15fcb063 100644 --- a/fchownat.c +++ b/fchownat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" SYS_FUNC(fchownat) diff --git a/fcntl.c b/fcntl.c index 74168c6a..0b4221ce 100644 --- a/fcntl.c +++ b/fcntl.c @@ -3,29 +3,10 @@ * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 1999-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -34,7 +15,6 @@ #include "xlat/f_owner_types.h" #include "xlat/f_seals.h" #include "xlat/fcntlcmds.h" -#include "xlat/fcntl64cmds.h" #include "xlat/fdflags.h" #include "xlat/lockfcmds.h" #include "xlat/notifyflags.h" @@ -134,7 +114,7 @@ print_fcntl(struct tcb *tcp) break; case F_SETSIG: tprints(", "); - tprints(signame(tcp->u_arg[2])); + printsignal(tcp->u_arg[2]); break; case F_GETOWN: case F_GETPIPE_SZ: @@ -196,18 +176,7 @@ SYS_FUNC(fcntl) if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); tprints(", "); - const unsigned int cmd = tcp->u_arg[1]; - const char *str = xlookup(fcntlcmds, cmd); - if (str) { - tprints(str); - } else { - /* - * fcntl syscall does not recognize these - * constants, but we would like to show them - * for better debugging experience. - */ - printxval(fcntl64cmds, cmd, "F_???"); - } + printxval(fcntlcmds, tcp->u_arg[1], "F_???"); } return print_fcntl(tcp); } @@ -218,12 +187,7 @@ SYS_FUNC(fcntl64) if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); tprints(", "); - const char *str = xlookup(fcntl64cmds, cmd); - if (str) { - tprints(str); - } else { - printxval(fcntlcmds, cmd, "F_???"); - } + printxval(fcntlcmds, cmd, "F_???"); } switch (cmd) { case F_SETLK64: diff --git a/fetch_bpf_fprog.c b/fetch_bpf_fprog.c new file mode 100644 index 00000000..6775bea1 --- /dev/null +++ b/fetch_bpf_fprog.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(struct_sock_fprog) + +#include +typedef struct sock_fprog struct_sock_fprog; + +#include MPERS_DEFS +#include "bpf_fprog.h" + +MPERS_PRINTER_DECL(unsigned int, get_sock_fprog_size, void) +{ + return sizeof(struct_sock_fprog); +} + +MPERS_PRINTER_DECL(bool, fetch_bpf_fprog, struct tcb *const tcp, + const kernel_ulong_t addr, void *const p) +{ + struct bpf_fprog *pfp = p; + struct_sock_fprog mfp; + + if ((sizeof(*pfp) == sizeof(mfp)) + && (offsetof(struct bpf_fprog, filter) == + offsetof(struct_sock_fprog, filter))) + return !umove_or_printaddr(tcp, addr, pfp); + + if (umove_or_printaddr(tcp, addr, &mfp)) + return false; + + pfp->len = mfp.len; + pfp->filter = +#ifndef IN_MPERS + (uintptr_t) +#endif + mfp.filter; + return true; +} diff --git a/fetch_indirect_syscall_args.c b/fetch_indirect_syscall_args.c new file mode 100644 index 00000000..10d0c847 --- /dev/null +++ b/fetch_indirect_syscall_args.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +/* + * Fetch indirect syscall arguments that are provided as an array. + * Return a pointer to a static array of kernel_ulong_t elements, + * or NULL in case of fetch failure. + */ +kernel_ulong_t * +fetch_indirect_syscall_args(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int n_args) +{ + static kernel_ulong_t u_arg[MAX_ARGS]; + + if (current_wordsize == sizeof(*u_arg)) { + if (umoven(tcp, addr, sizeof(*u_arg) * n_args, u_arg)) + return NULL; + } else { + uint32_t narrow_arg[ARRAY_SIZE(u_arg)]; + + if (umoven(tcp, addr, sizeof(*narrow_arg) * n_args, narrow_arg)) + return NULL; + for (unsigned int i = 0; i < n_args; ++i) + u_arg[i] = narrow_arg[i]; + } + + return u_arg; +} diff --git a/fetch_seccomp_fprog.c b/fetch_seccomp_fprog.c deleted file mode 100644 index e483e816..00000000 --- a/fetch_seccomp_fprog.c +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2015 Dmitry V. Levin - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (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) - -#include "seccomp_fprog.h" -typedef struct seccomp_fprog seccomp_fprog_t; - -#include MPERS_DEFS - -MPERS_PRINTER_DECL(bool, fetch_seccomp_fprog, struct tcb *const tcp, - const kernel_ulong_t addr, void *const p) -{ - struct seccomp_fprog *pfp = p; - seccomp_fprog_t mfp; - - if (sizeof(*pfp) == sizeof(mfp)) - return !umove_or_printaddr(tcp, addr, pfp); - - if (umove_or_printaddr(tcp, addr, &mfp)) - return false; - - pfp->len = mfp.len; - pfp->filter = mfp.filter; - return true; -} diff --git a/fetch_struct_flock.c b/fetch_struct_flock.c index bb248761..ab3f1956 100644 --- a/fetch_struct_flock.c +++ b/fetch_struct_flock.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/fetch_struct_keyctl_kdf_params.c b/fetch_struct_keyctl_kdf_params.c new file mode 100644 index 00000000..63eadb2e --- /dev/null +++ b/fetch_struct_keyctl_kdf_params.c @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2016-2018 Eugene Syromyatnikov + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(struct_keyctl_kdf_params) + +#include "keyctl_kdf_params.h" +typedef struct keyctl_kdf_params struct_keyctl_kdf_params; + +#include MPERS_DEFS + +MPERS_PRINTER_DECL(int, fetch_keyctl_kdf_params, struct tcb *const tcp, + kernel_ulong_t addr, struct strace_keyctl_kdf_params *p) +{ + struct_keyctl_kdf_params kdf; + int ret; + + if ((ret = umove(tcp, addr, &kdf))) + return ret; + + p->hashname = (kernel_ulong_t) +#ifndef IN_MPERS + (uintptr_t) +#endif + kdf.hashname; + p->otherinfo = (kernel_ulong_t) +#ifndef IN_MPERS + (uintptr_t) +#endif + kdf.otherinfo; + p->otherinfolen = kdf.otherinfolen; + + memcpy(p->__spare, kdf.__spare, sizeof(kdf.__spare)); + + return 0; +} diff --git a/fetch_struct_mmsghdr.c b/fetch_struct_mmsghdr.c index 04f98aba..e412ba0b 100644 --- a/fetch_struct_mmsghdr.c +++ b/fetch_struct_mmsghdr.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/fetch_struct_msghdr.c b/fetch_struct_msghdr.c index d5f5adc5..368b674e 100644 --- a/fetch_struct_msghdr.c +++ b/fetch_struct_msghdr.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/fetch_struct_stat.c b/fetch_struct_stat.c index 50d10284..8387259b 100644 --- a/fetch_struct_stat.c +++ b/fetch_struct_stat.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -65,8 +46,10 @@ typedef struct stat struct_stat; #ifdef HAVE_STRUCT_STAT_ST_MTIME_NSEC # define TIME_NSEC(arg) zero_extend_signed_to_ull(arg) +# define HAVE_NSEC true #else # define TIME_NSEC(arg) 0 +# define HAVE_NSEC false #endif MPERS_PRINTER_DECL(bool, fetch_struct_stat, @@ -94,6 +77,7 @@ MPERS_PRINTER_DECL(bool, fetch_struct_stat, dst->atime_nsec = TIME_NSEC(buf.st_atime_nsec); dst->ctime_nsec = TIME_NSEC(buf.st_ctime_nsec); dst->mtime_nsec = TIME_NSEC(buf.st_mtime_nsec); + dst->has_nsec = HAVE_NSEC; return true; #else /* !HAVE_STRUCT_STAT */ printaddr(addr); diff --git a/fetch_struct_stat64.c b/fetch_struct_stat64.c index b7e48057..8b445ba3 100644 --- a/fetch_struct_stat64.c +++ b/fetch_struct_stat64.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -63,8 +44,10 @@ typedef struct stat64 struct_stat64; #ifdef HAVE_STRUCT_STAT64_ST_MTIME_NSEC # define TIME_NSEC(arg) zero_extend_signed_to_ull(arg) +# define HAVE_NSEC true #else # define TIME_NSEC(arg) 0 +# define HAVE_NSEC false #endif MPERS_PRINTER_DECL(bool, fetch_struct_stat64, @@ -92,6 +75,7 @@ MPERS_PRINTER_DECL(bool, fetch_struct_stat64, dst->atime_nsec = TIME_NSEC(buf.st_atime_nsec); dst->ctime_nsec = TIME_NSEC(buf.st_ctime_nsec); dst->mtime_nsec = TIME_NSEC(buf.st_mtime_nsec); + dst->has_nsec = HAVE_NSEC; return true; #else /* !HAVE_STRUCT_STAT64 */ printaddr(addr); diff --git a/fetch_struct_statfs.c b/fetch_struct_statfs.c index 454e5b4e..413d0dee 100644 --- a/fetch_struct_statfs.c +++ b/fetch_struct_statfs.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -84,7 +65,7 @@ MPERS_PRINTER_DECL(bool, fetch_struct_statfs64, { struct_statfs64 b; - if (sizeof(b) != size + if (sizeof(b) != size #ifdef COMPAT_STATFS64_PADDED_SIZE && sizeof(b) != COMPAT_STATFS64_PADDED_SIZE #endif diff --git a/fetch_struct_xfs_quotastat.c b/fetch_struct_xfs_quotastat.c new file mode 100644 index 00000000..d7876758 --- /dev/null +++ b/fetch_struct_xfs_quotastat.c @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(struct_xfs_dqstats) + +#include "xfs_quota_stat.h" +typedef struct xfs_dqstats struct_xfs_dqstats; + +#include MPERS_DEFS + +MPERS_PRINTER_DECL(bool, fetch_struct_quotastat, struct tcb *const tcp, + const kernel_ulong_t data, void *p) +{ + struct xfs_dqstats *dq = p; + struct_xfs_dqstats dqstat; + + if (umove_or_printaddr(tcp, data, &dqstat)) + return false; + + dq->qs_version = dqstat.qs_version; + dq->qs_flags = dqstat.qs_flags; + dq->qs_pad = dqstat.qs_pad; + dq->qs_uquota.qfs_ino = dqstat.qs_uquota.qfs_ino; + dq->qs_uquota.qfs_nblks = dqstat.qs_uquota.qfs_nblks; + dq->qs_uquota.qfs_nextents = dqstat.qs_uquota.qfs_nextents; + dq->qs_gquota.qfs_ino = dqstat.qs_gquota.qfs_ino; + dq->qs_gquota.qfs_nblks = dqstat.qs_gquota.qfs_nblks; + dq->qs_gquota.qfs_nextents = dqstat.qs_gquota.qfs_nextents; + dq->qs_incoredqs = dqstat.qs_incoredqs; + dq->qs_btimelimit = dqstat.qs_btimelimit; + dq->qs_itimelimit = dqstat.qs_itimelimit; + dq->qs_rtbtimelimit = dqstat.qs_rtbtimelimit; + dq->qs_bwarnlimit = dqstat.qs_bwarnlimit; + dq->qs_iwarnlimit = dqstat.qs_iwarnlimit; + return true; +} diff --git a/file_handle.c b/file_handle.c index f2f0b22d..7ac135b0 100644 --- a/file_handle.c +++ b/file_handle.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/file_ioctl.c b/file_ioctl.c index fec2f69b..27ba4c82 100644 --- a/file_ioctl.c +++ b/file_ioctl.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2016 Jeff Mahoney + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -36,11 +17,11 @@ #endif #ifndef FICLONE -# define FICLONE _IOW(0x94, 9, int) +# define FICLONE _IOW(0x94, 9, int) #endif #ifndef FICLONERANGE -# define FICLONERANGE _IOW(0x94, 13, struct file_clone_range) +# define FICLONERANGE _IOW(0x94, 13, struct file_clone_range) struct file_clone_range { int64_t src_fd; uint64_t src_offset; @@ -50,7 +31,7 @@ struct file_clone_range { #endif #ifndef FIDEDUPERANGE -# define FIDEDUPERANGE _IOWR(0x94, 54, struct file_dedupe_range) +# define FIDEDUPERANGE _IOWR(0x94, 54, struct file_dedupe_range) struct file_dedupe_range_info { int64_t dest_fd; /* in - destination file */ uint64_t dest_offset; /* in - start of extent in destination */ @@ -184,7 +165,7 @@ file_ioctl(struct tcb *const tcp, const unsigned int code, rc = print_array(tcp, arg + offsetof(typeof(args), info), args.dest_count, &info, sizeof(info), - umoven_or_printaddr, + tfetch_mem, print_file_dedupe_range_info, limit); tprints("}"); @@ -224,15 +205,15 @@ file_ioctl(struct tcb *const tcp, const unsigned int code, "FIEMAP_FLAG_???"); tprintf(", fm_mapped_extents=%u", args.fm_mapped_extents); - tprints(", fm_extents="); if (abbrev(tcp)) { - tprints("..."); + tprints(", ..."); } else { struct fiemap_extent fe; + tprints(", fm_extents="); print_array(tcp, arg + offsetof(typeof(args), fm_extents), args.fm_mapped_extents, &fe, sizeof(fe), - umoven_or_printaddr, + tfetch_mem, print_fiemap_extent, 0); } tprints("}"); @@ -245,5 +226,5 @@ file_ioctl(struct tcb *const tcp, const unsigned int code, return RVAL_DECODED; }; - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } diff --git a/filter.h b/filter.h new file mode 100644 index 00000000..54b0a72b --- /dev/null +++ b/filter.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2017 Nikolay Marchuk + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_FILTER_H +# define STRACE_FILTER_H + +struct number_set; +typedef int (*string_to_uint_func)(const char *); + +void qualify_tokens(const char *str, struct number_set *set, + string_to_uint_func func, const char *name); +void qualify_syscall_tokens(const char *str, struct number_set *set); + +#endif /* !STRACE_FILTER_H */ diff --git a/filter_qualify.c b/filter_qualify.c new file mode 100644 index 00000000..4a05f1b2 --- /dev/null +++ b/filter_qualify.c @@ -0,0 +1,469 @@ +/* + * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "nsig.h" +#include "number_set.h" +#include "filter.h" +#include "delay.h" +#include "retval.h" + +struct number_set *read_set; +struct number_set *write_set; +struct number_set *signal_set; + +static struct number_set *abbrev_set; +static struct number_set *inject_set; +static struct number_set *raw_set; +static struct number_set *trace_set; +static struct number_set *verbose_set; + +/* Only syscall numbers are personality-specific so far. */ +struct inject_personality_data { + uint16_t scno; +}; + +static int +sigstr_to_uint(const char *s) +{ + if (*s >= '0' && *s <= '9') + return string_to_uint_upto(s, 255); + + if (strncasecmp(s, "SIG", 3) == 0) + s += 3; + + for (int i = 1; i <= 255; ++i) { + const char *name = signame(i); + + if (!name) + continue; + + if (strncasecmp(name, "SIG", 3) != 0) + continue; + + name += 3; + + if (strcasecmp(name, s) != 0) + continue; + + return i; + } + + return -1; +} + +static int +find_errno_by_name(const char *name) +{ + for (unsigned int i = 1; i < nerrnos; ++i) { + if (errnoent[i] && (strcasecmp(name, errnoent[i]) == 0)) + return i; + } + + return -1; +} + +static bool +parse_delay_token(const char *input, struct inject_opts *fopts, bool isenter) +{ + unsigned flag = isenter ? INJECT_F_DELAY_ENTER : INJECT_F_DELAY_EXIT; + + if (fopts->data.flags & flag) /* duplicate */ + return false; + long long intval = string_to_ulonglong(input); + if (intval < 0) /* couldn't parse */ + return false; + + if (fopts->data.delay_idx == (uint16_t) -1) + fopts->data.delay_idx = alloc_delay_data(); + /* populate .ts_enter or .ts_exit */ + fill_delay_data(fopts->data.delay_idx, intval, isenter); + fopts->data.flags |= flag; + + return true; +} + +static bool +parse_inject_token(const char *const token, struct inject_opts *const fopts, + struct inject_personality_data *const pdata, + const bool fault_tokens_only) +{ + const char *val; + int intval; + + if ((val = STR_STRIP_PREFIX(token, "when=")) != token) { + /* + * == 1+1 + * F == F+0 + * F+ == F+1 + * F+S + */ + char *end; + intval = string_to_uint_ex(val, &end, 0xffff, "+"); + if (intval < 1) + return false; + + fopts->first = intval; + + if (*end) { + val = end + 1; + if (*val) { + /* F+S */ + intval = string_to_uint_upto(val, 0xffff); + if (intval < 1) + return false; + fopts->step = intval; + } else { + /* F+ == F+1 */ + fopts->step = 1; + } + } else { + /* F == F+0 */ + fopts->step = 0; + } + } else if ((val = STR_STRIP_PREFIX(token, "syscall=")) != token) { + if (fopts->data.flags & INJECT_F_SYSCALL) + return false; + + for (unsigned int p = 0; p < SUPPORTED_PERSONALITIES; ++p) { + kernel_long_t scno = scno_by_name(val, p, 0); + + if (scno < 0) + return false; + + /* + * We want to inject only pure system calls with no side + * effects. + */ + if (!(sysent_vec[p][scno].sys_flags & TRACE_PURE)) + return false; + + pdata[p].scno = scno; + } + + fopts->data.flags |= INJECT_F_SYSCALL; + } else if ((val = STR_STRIP_PREFIX(token, "error=")) != token) { + if (fopts->data.flags & (INJECT_F_ERROR | INJECT_F_RETVAL)) + return false; + intval = string_to_uint_upto(val, MAX_ERRNO_VALUE); + if (intval < 0) + intval = find_errno_by_name(val); + if (intval < 1) + return false; + fopts->data.rval_idx = retval_new(intval); + fopts->data.flags |= INJECT_F_ERROR; + } else if (!fault_tokens_only + && (val = STR_STRIP_PREFIX(token, "retval=")) != token) { + + if (fopts->data.flags & (INJECT_F_ERROR | INJECT_F_RETVAL)) + return false; + + errno = 0; + char *endp; + unsigned long long ullval = strtoull(val, &endp, 0); + if (endp == val || *endp || (kernel_ulong_t) ullval != ullval + || ((ullval == 0 || ullval == ULLONG_MAX) && errno)) + return false; + +#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG + bool inadvertent_fault_injection = false; +#endif + +#if !HAVE_ARCH_DEDICATED_ERR_REG + if ((kernel_long_t) ullval < 0 + && (kernel_long_t) ullval >= -MAX_ERRNO_VALUE) { +# if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG + inadvertent_fault_injection = true; +# endif + error_msg("Inadvertent injection of error %" PRI_kld + " is possible for retval=%llu", + -(kernel_long_t) ullval, ullval); + } +# if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG + else if ((int) ullval < 0 && (int) ullval >= -MAX_ERRNO_VALUE) { + inadvertent_fault_injection = true; + error_msg("Inadvertent injection of error %d is" + " possible in compat personality for" + " retval=%llu", + -(int) ullval, ullval); + } +# endif +#endif + +#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG + if (!inadvertent_fault_injection + && (unsigned int) ullval != ullval) { + error_msg("Injected return value %llu will be" + " clipped to %u in compat personality", + ullval, (unsigned int) ullval); + } +#endif + + fopts->data.rval_idx = retval_new(ullval); + fopts->data.flags |= INJECT_F_RETVAL; + } else if (!fault_tokens_only + && (val = STR_STRIP_PREFIX(token, "signal=")) != token) { + if (fopts->data.flags & INJECT_F_SIGNAL) + return false; + intval = sigstr_to_uint(val); + if (intval < 1 || intval > NSIG_BYTES * 8) + return false; + fopts->data.signo = intval; + fopts->data.flags |= INJECT_F_SIGNAL; + } else if (!fault_tokens_only + && (val = STR_STRIP_PREFIX(token, "delay_enter=")) != token) { + if (!parse_delay_token(val, fopts, true)) + return false; + } else if (!fault_tokens_only + && (val = STR_STRIP_PREFIX(token, "delay_exit=")) != token) { + if (!parse_delay_token(val, fopts, false)) + return false; + } else { + return false; + } + + return true; +} + +static const char * +parse_inject_expression(char *const str, + struct inject_opts *const fopts, + struct inject_personality_data *const pdata, + const bool fault_tokens_only) +{ + if (str[0] == '\0' || str[0] == ':') + return ""; + + char *saveptr = NULL; + const char *name = strtok_r(str, ":", &saveptr); + + char *token; + while ((token = strtok_r(NULL, ":", &saveptr))) { + if (!parse_inject_token(token, fopts, pdata, fault_tokens_only)) + return NULL; + } + + return name; +} + +static void +qualify_read(const char *const str) +{ + if (!read_set) + read_set = alloc_number_set_array(1); + qualify_tokens(str, read_set, string_to_uint, "descriptor"); +} + +static void +qualify_write(const char *const str) +{ + if (!write_set) + write_set = alloc_number_set_array(1); + qualify_tokens(str, write_set, string_to_uint, "descriptor"); +} + +static void +qualify_signals(const char *const str) +{ + if (!signal_set) + signal_set = alloc_number_set_array(1); + qualify_tokens(str, signal_set, sigstr_to_uint, "signal"); +} + +static void +qualify_trace(const char *const str) +{ + if (!trace_set) + trace_set = alloc_number_set_array(SUPPORTED_PERSONALITIES); + qualify_syscall_tokens(str, trace_set); +} + +static void +qualify_abbrev(const char *const str) +{ + if (!abbrev_set) + abbrev_set = alloc_number_set_array(SUPPORTED_PERSONALITIES); + qualify_syscall_tokens(str, abbrev_set); +} + +static void +qualify_verbose(const char *const str) +{ + if (!verbose_set) + verbose_set = alloc_number_set_array(SUPPORTED_PERSONALITIES); + qualify_syscall_tokens(str, verbose_set); +} + +static void +qualify_raw(const char *const str) +{ + if (!raw_set) + raw_set = alloc_number_set_array(SUPPORTED_PERSONALITIES); + qualify_syscall_tokens(str, raw_set); +} + +static void +qualify_inject_common(const char *const str, + const bool fault_tokens_only, + const char *const description) +{ + struct inject_opts opts = { + .first = 1, + .step = 1, + .data = { + .delay_idx = -1 + } + }; + struct inject_personality_data pdata[SUPPORTED_PERSONALITIES] = { { 0 } }; + char *copy = xstrdup(str); + const char *name = + parse_inject_expression(copy, &opts, pdata, fault_tokens_only); + if (!name) + error_msg_and_die("invalid %s '%s'", description, str); + + struct number_set *tmp_set = + alloc_number_set_array(SUPPORTED_PERSONALITIES); + qualify_syscall_tokens(name, tmp_set); + + free(copy); + + /* If neither of retval, error, signal or delay is specified, then ... */ + if (!(opts.data.flags & INJECT_ACTION_FLAGS)) { + if (fault_tokens_only) { + /* in fault= syntax the default error code is ENOSYS. */ + opts.data.rval_idx = retval_new(ENOSYS); + opts.data.flags |= INJECT_F_ERROR; + } else { + /* in inject= syntax this is not allowed. */ + error_msg_and_die("invalid %s '%s'", description, str); + } + } + + /* + * Initialize inject_vec according to tmp_set. + * Merge tmp_set into inject_set. + */ + for (unsigned int p = 0; p < SUPPORTED_PERSONALITIES; ++p) { + if (number_set_array_is_empty(tmp_set, p)) + continue; + + if (!inject_set) { + inject_set = + alloc_number_set_array(SUPPORTED_PERSONALITIES); + } + if (!inject_vec[p]) { + inject_vec[p] = xcalloc(nsyscall_vec[p], + sizeof(*inject_vec[p])); + } + + for (unsigned int i = 0; i < nsyscall_vec[p]; ++i) { + if (is_number_in_set_array(i, tmp_set, p)) { + add_number_to_set_array(i, inject_set, p); + inject_vec[p][i] = opts; + + /* Copy per-personality data. */ + inject_vec[p][i].data.scno = + pdata[p].scno; + } + } + } + + free_number_set_array(tmp_set, SUPPORTED_PERSONALITIES); +} + +static void +qualify_fault(const char *const str) +{ + qualify_inject_common(str, true, "fault argument"); +} + +static void +qualify_inject(const char *const str) +{ + qualify_inject_common(str, false, "inject argument"); +} + +static void +qualify_kvm(const char *const str) +{ + if (strcmp(str, "vcpu") == 0) { +#ifdef HAVE_LINUX_KVM_H + if (os_release >= KERNEL_VERSION(4, 16, 0)) + kvm_run_structure_decoder_init(); + else + error_msg("-e kvm=vcpu option needs" + " Linux 4.16.0 or higher"); +#else + error_msg("-e kvm=vcpu option is not implemented" + " for this architecture"); +#endif + } else { + error_msg_and_die("invalid -e kvm= argument: '%s'", str); + } +} + +static const struct qual_options { + const char *name; + void (*qualify)(const char *); +} qual_options[] = { + { "trace", qualify_trace }, + { "t", qualify_trace }, + { "abbrev", qualify_abbrev }, + { "a", qualify_abbrev }, + { "verbose", qualify_verbose }, + { "v", qualify_verbose }, + { "raw", qualify_raw }, + { "x", qualify_raw }, + { "signal", qualify_signals }, + { "signals", qualify_signals }, + { "s", qualify_signals }, + { "read", qualify_read }, + { "reads", qualify_read }, + { "r", qualify_read }, + { "write", qualify_write }, + { "writes", qualify_write }, + { "w", qualify_write }, + { "fault", qualify_fault }, + { "inject", qualify_inject }, + { "kvm", qualify_kvm }, +}; + +void +qualify(const char *str) +{ + const struct qual_options *opt = qual_options; + + for (unsigned int i = 0; i < ARRAY_SIZE(qual_options); ++i) { + const char *name = qual_options[i].name; + const size_t len = strlen(name); + const char *val = str_strip_prefix_len(str, name, len); + + if (val == str || *val != '=') + continue; + str = val + 1; + opt = &qual_options[i]; + break; + } + + opt->qualify(str); +} + +unsigned int +qual_flags(const unsigned int scno) +{ + return (is_number_in_set_array(scno, trace_set, current_personality) + ? QUAL_TRACE : 0) + | (is_number_in_set_array(scno, abbrev_set, current_personality) + ? QUAL_ABBREV : 0) + | (is_number_in_set_array(scno, verbose_set, current_personality) + ? QUAL_VERBOSE : 0) + | (is_number_in_set_array(scno, raw_set, current_personality) + ? QUAL_RAW : 0) + | (is_number_in_set_array(scno, inject_set, current_personality) + ? QUAL_INJECT : 0); +} diff --git a/flock.c b/flock.c index 6ec43db4..b3f2b3b5 100644 --- a/flock.c +++ b/flock.c @@ -3,29 +3,10 @@ * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 1999-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/flock.h b/flock.h index afa51482..c7c13519 100644 --- a/flock.h +++ b/flock.h @@ -1,49 +1,30 @@ /* * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #ifndef STRACE_FLOCK_H -#define STRACE_FLOCK_H +# define STRACE_FLOCK_H -#include +# include -#if defined HAVE_STRUCT_FLOCK +# if defined HAVE_STRUCT_FLOCK typedef struct flock struct_kernel_flock; -#elif defined HAVE_STRUCT___KERNEL_FLOCK +# elif defined HAVE_STRUCT___KERNEL_FLOCK typedef struct __kernel_flock struct_kernel_flock; -#else -# error struct flock definition not found in -#endif +# else +# error struct flock definition not found in +# endif -#if defined HAVE_STRUCT_FLOCK64 +# if defined HAVE_STRUCT_FLOCK64 typedef struct flock64 struct_kernel_flock64; -#elif defined HAVE_STRUCT___KERNEL_FLOCK64 +# elif defined HAVE_STRUCT___KERNEL_FLOCK64 typedef struct __kernel_flock64 struct_kernel_flock64; -#else -# error struct flock64 definition not found in -#endif +# else +# error struct flock64 definition not found in +# endif #endif /* !STRACE_FLOCK_H */ diff --git a/fs_x_ioctl.c b/fs_x_ioctl.c index 2fa30f56..f7f7d746 100644 --- a/fs_x_ioctl.c +++ b/fs_x_ioctl.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2014 Mike Frysinger * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -62,5 +43,5 @@ fs_x_ioctl(struct tcb *const tcp, const unsigned int code, return RVAL_DECODED; } - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } diff --git a/fstatfs.c b/fstatfs.c index 1f358240..e5029f32 100644 --- a/fstatfs.c +++ b/fstatfs.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" SYS_FUNC(fstatfs) diff --git a/fstatfs64.c b/fstatfs64.c index 166fc63d..0aac13d2 100644 --- a/fstatfs64.c +++ b/fstatfs64.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" SYS_FUNC(fstatfs64) diff --git a/futex.c b/futex.c index 5267dc48..f59d96a1 100644 --- a/futex.c +++ b/futex.c @@ -3,29 +3,10 @@ * Copyright (c) 2007-2008 Ulrich Drepper * Copyright (c) 2009 Andreas Schwab * Copyright (c) 2014-2015 Dmitry V. Levin + * Copyright (c) 2014-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -36,12 +17,17 @@ #ifndef FUTEX_CLOCK_REALTIME # define FUTEX_CLOCK_REALTIME 256 #endif +#ifndef FUTEX_OP_OPARG_SHIFT +# define FUTEX_OP_OPARG_SHIFT 8 +#endif +#include "xlat/futexbitset.h" #include "xlat/futexops.h" #include "xlat/futexwakeops.h" #include "xlat/futexwakecmps.h" -SYS_FUNC(futex) +static int +do_futex(struct tcb *const tcp, const print_obj_by_addr_fn print_ts) { const kernel_ulong_t uaddr = tcp->u_arg[0]; const int op = tcp->u_arg[1]; @@ -51,6 +37,7 @@ SYS_FUNC(futex) const unsigned int val = tcp->u_arg[2]; const unsigned int val2 = tcp->u_arg[3]; const unsigned int val3 = tcp->u_arg[5]; + const char *comment; printaddr(uaddr); tprints(", "); @@ -59,21 +46,23 @@ SYS_FUNC(futex) case FUTEX_WAIT: tprintf(", %u", val); tprints(", "); - print_timespec(tcp, timeout); + print_ts(tcp, timeout); break; case FUTEX_LOCK_PI: tprints(", "); - print_timespec(tcp, timeout); + print_ts(tcp, timeout); break; case FUTEX_WAIT_BITSET: tprintf(", %u", val); tprints(", "); - print_timespec(tcp, timeout); - tprintf(", %#x", val3); + print_ts(tcp, timeout); + tprints(", "); + printxval(futexbitset, val3, NULL); break; case FUTEX_WAKE_BITSET: tprintf(", %u", val); - tprintf(", %#x", val3); + tprints(", "); + printxval(futexbitset, val3, NULL); break; case FUTEX_REQUEUE: tprintf(", %u", val); @@ -92,23 +81,25 @@ SYS_FUNC(futex) tprintf(", %u, ", val2); printaddr(uaddr2); tprints(", "); - if ((val3 >> 28) & 8) - tprints("FUTEX_OP_OPARG_SHIFT<<28|"); - if (printxval(futexwakeops, (val3 >> 28) & 0x7, NULL)) - tprints("<<28"); - else - tprints("<<28 /* FUTEX_OP_??? */"); + if ((val3 >> 28) & FUTEX_OP_OPARG_SHIFT) { + print_xlat(FUTEX_OP_OPARG_SHIFT); + tprints("<<28|"); + } + comment = printxval(futexwakeops, (val3 >> 28) & 0x7, NULL) + ? NULL : "FUTEX_OP_???"; + tprints("<<28"); + tprints_comment(comment); tprintf("|%#x<<12|", (val3 >> 12) & 0xfff); - if (printxval(futexwakecmps, (val3 >> 24) & 0xf, NULL)) - tprints("<<24"); - else - tprints("<<24 /* FUTEX_OP_CMP_??? */"); + comment = printxval(futexwakecmps, (val3 >> 24) & 0xf, NULL) + ? NULL : "FUTEX_OP_CMP_???"; + tprints("<<24"); + tprints_comment(comment); tprintf("|%#x", val3 & 0xfff); break; case FUTEX_WAIT_REQUEUE_PI: tprintf(", %u", val); tprints(", "); - print_timespec(tcp, timeout); + print_ts(tcp, timeout); tprints(", "); printaddr(uaddr2); break; @@ -131,3 +122,15 @@ SYS_FUNC(futex) return RVAL_DECODED; } + +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(futex_time32) +{ + return do_futex(tcp, print_timespec32); +} +#endif + +SYS_FUNC(futex_time64) +{ + return do_futex(tcp, print_timespec64); +} diff --git a/gcc_compat.h b/gcc_compat.h index fe3f9048..2d5d7f9e 100644 --- a/gcc_compat.h +++ b/gcc_compat.h @@ -1,95 +1,120 @@ /* * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #ifndef STRACE_GCC_COMPAT_H -#define STRACE_GCC_COMPAT_H +# define STRACE_GCC_COMPAT_H -#if defined __GNUC__ && defined __GNUC_MINOR__ -# define GNUC_PREREQ(maj, min) \ +# 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 SAME_TYPE(x, y) __builtin_types_compatible_p(typeof(x), typeof(y)) -# define FAIL_BUILD_ON_ZERO(expr) (sizeof(int[-1 + 2 * !!(expr)]) * 0) +# else +# define GNUC_PREREQ(maj, min) 0 +# endif + +# if defined __clang__ && defined __clang_major__ && defined __clang_minor__ +# define CLANG_PREREQ(maj, min) \ + ((__clang_major__ << 16) + __clang_minor__ >= ((maj) << 16) + (min)) +# else +# define CLANG_PREREQ(maj, min) 0 +# endif + +# if !(GNUC_PREREQ(2, 0) || CLANG_PREREQ(1, 0)) +# define __attribute__(x) /* empty */ +# 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 SAME_TYPE(x, y) __builtin_types_compatible_p(typeof(x), typeof(y)) +# define FAIL_BUILD_ON_ZERO(expr) (sizeof(int[-1 + 2 * !!(expr)]) * 0) /* &(a)[0] is a pointer and not an array, shouldn't be treated as the same */ -# define MUST_BE_ARRAY(a) FAIL_BUILD_ON_ZERO(!SAME_TYPE((a), &(a)[0])) -#else -# define SAME_TYPE(x, y) 0 -# define MUST_BE_ARRAY(a) 0 -#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, 0) -# define ATTRIBUTE_SENTINEL __attribute__((__sentinel__)) -#else -# define ATTRIBUTE_SENTINEL /* empty */ -#endif - -#if GNUC_PREREQ(4, 1) -# define ALIGNOF(t_) __alignof__(t_) -#else -# define ALIGNOF(t_) (sizeof(struct {char x_; t_ y_;}) - sizeof(t_)) -#endif - -#if GNUC_PREREQ(4, 3) -# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args)) -#else -# define ATTRIBUTE_ALLOC_SIZE(args) /* empty */ -#endif +# define MUST_BE_ARRAY(a) FAIL_BUILD_ON_ZERO(!SAME_TYPE((a), &(a)[0])) +# else +# define SAME_TYPE(x, y) 0 +# define MUST_BE_ARRAY(a) 0 +# 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, 0) +# define ATTRIBUTE_SENTINEL __attribute__((__sentinel__)) +# else +# define ATTRIBUTE_SENTINEL /* empty */ +# endif + +# if GNUC_PREREQ(4, 1) +# define ALIGNOF(t_) __alignof__(t_) +# else +# define ALIGNOF(t_) (sizeof(struct { char x_; t_ y_; }) - sizeof(t_)) +# endif + +# if GNUC_PREREQ(4, 3) +# define ATTRIBUTE_ALLOC_SIZE(args) __attribute__((__alloc_size__ args)) +# else +# define ATTRIBUTE_ALLOC_SIZE(args) /* empty */ +# endif + +# if GNUC_PREREQ(7, 0) +# define ATTRIBUTE_FALLTHROUGH __attribute__((__fallthrough__)) +# else +# define ATTRIBUTE_FALLTHROUGH ((void) 0) +# endif + +# if CLANG_PREREQ(2, 8) +# define DIAG_PUSH_IGNORE_OVERRIDE_INIT \ + _Pragma("clang diagnostic push"); \ + _Pragma("clang diagnostic ignored \"-Winitializer-overrides\""); +# define DIAG_POP_IGNORE_OVERRIDE_INIT \ + _Pragma("clang diagnostic pop"); +# elif GNUC_PREREQ(4, 2) +# define DIAG_PUSH_IGNORE_OVERRIDE_INIT \ + _Pragma("GCC diagnostic push"); \ + _Pragma("GCC diagnostic ignored \"-Woverride-init\""); +# define DIAG_POP_IGNORE_OVERRIDE_INIT \ + _Pragma("GCC diagnostic pop"); +# else +# define DIAG_PUSH_IGNORE_OVERRIDE_INIT /* empty */ +# define DIAG_POP_IGNORE_OVERRIDE_INIT /* empty */ +# endif + +# if GNUC_PREREQ(6, 0) +# define DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE \ + _Pragma("GCC diagnostic push"); \ + _Pragma("GCC diagnostic ignored \"-Wtautological-compare\""); +# define DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE \ + _Pragma("GCC diagnostic pop"); +# else +# define DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE /* empty */ +# define DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE /* empty */ +# endif #endif /* !STRACE_GCC_COMPAT_H */ diff --git a/gen_bpf_attr_check.sh b/gen_bpf_attr_check.sh new file mode 100755 index 00000000..76c12ca6 --- /dev/null +++ b/gen_bpf_attr_check.sh @@ -0,0 +1,60 @@ +#!/bin/sh -efu +# Copyright (c) 2018 Dmitry V. Levin +# Copyright (c) 2018-2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: LGPL-2.1-or-later + +[ "x${D:-0}" != x1 ] || set -x + +input="$1" +shift + +cat < +# include "bpf_attr.h" +# include "static_assert.h" + +# define SoM(type_, member_) (sizeof(((type_ *)0)->member_)) +EOF + +for struct in $(sed -n 's/^struct \([^[:space:]]\+_struct\) .*/\1/p' < "$input"); do + case "$struct" in + BPF_*) type_name='union bpf_attr' ;; + *) type_name="struct ${struct%_struct}" ;; + esac + TYPE_NAME="$(printf %s "$type_name" |tr '[:lower:] ' '[:upper:]_')" + + enum="$(sed -n 's/^struct '"$struct"' \/\* \([^[:space:]]\+\) \*\/ {.*/\1/p' < "$input")" + ENUM="$(printf %s "$enum" |tr '[:lower:]' '[:upper:]')" + enum="$enum${enum:+.}" + ENUM="$ENUM${ENUM:+_}" + sed -n '/^struct '"$struct"' [^{]*{/,/^};$/p' < "$input" | + sed -n 's/^[[:space:]]\+[^][;:]*[[:space:]]\([^][[:space:];:]\+\)\(\[[^;:]*\]\)\?;$/\1/p' | + while read field; do + FIELD="$(printf %s "$field" |tr '[:lower:]' '[:upper:]')" + cat < + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#if SUPPORTED_PERSONALITIES > 1 +# include "get_personality.h" +# include +# include "arch_get_personality.c" +#endif diff --git a/get_personality.h b/get_personality.h new file mode 100644 index 00000000..ab018154 --- /dev/null +++ b/get_personality.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_GET_PERSONALITY_H +# define STRACE_GET_PERSONALITY_H + +# include "ptrace.h" + +extern int +get_personality_from_syscall_info(const struct ptrace_syscall_info *); + +#endif /* !STRACE_GET_PERSONALITY_H */ diff --git a/get_robust_list.c b/get_robust_list.c index 1977023a..b5aebaff 100644 --- a/get_robust_list.c +++ b/get_robust_list.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2012-2015 Dmitry V. Levin + * Copyright (c) 2012-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/getcpu.c b/getcpu.c index 5d0f52d1..e91c76ff 100644 --- a/getcpu.c +++ b/getcpu.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" SYS_FUNC(getcpu) diff --git a/getcwd.c b/getcwd.c index a8ef591b..7c6de9af 100644 --- a/getcwd.c +++ b/getcwd.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" SYS_FUNC(getcwd) diff --git a/getpagesize.c b/getpagesize.c new file mode 100644 index 00000000..6dae186d --- /dev/null +++ b/getpagesize.c @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +SYS_FUNC(getpagesize) +{ + return RVAL_DECODED | RVAL_HEX; +} diff --git a/getrandom.c b/getrandom.c index ea9ad572..4fe26455 100644 --- a/getrandom.c +++ b/getrandom.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" #include "xlat/getrandom_flags.h" diff --git a/hdio.c b/hdio.c index 6e256d94..6a0a8027 100644 --- a/hdio.c +++ b/hdio.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2009, 2010 Jeff Mahoney * Copyright (c) 2011-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -60,5 +41,5 @@ MPERS_PRINTER_DECL(int, hdio_ioctl, struct tcb *const tcp, return RVAL_DECODED; } - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } diff --git a/hostname.c b/hostname.c index 75f96ba6..c13cf1d2 100644 --- a/hostname.c +++ b/hostname.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" #ifdef HAVE_LINUX_UTSNAME_H diff --git a/inotify.c b/inotify.c index 5ada8a86..e12df34b 100644 --- a/inotify.c +++ b/inotify.c @@ -1,29 +1,9 @@ /* * Copyright (c) 2006 Bernhard Kaindl - * Copyright (c) 2006-2015 Dmitry V. Levin + * Copyright (c) 2006-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/inotify_ioctl.c b/inotify_ioctl.c new file mode 100644 index 00000000..7e06dcb0 --- /dev/null +++ b/inotify_ioctl.c @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#include + +#ifndef INOTIFY_IOC_SETNEXTWD +# define INOTIFY_IOC_SETNEXTWD _IOW('I', 0, int32_t) +#endif + +int +inotify_ioctl(struct tcb *const tcp, const unsigned int code, + const kernel_ulong_t arg) +{ + switch (code) { + case INOTIFY_IOC_SETNEXTWD: + tprintf(", %d", (int) arg); + + return RVAL_IOCTL_DECODED; + } + + return RVAL_DECODED; +} diff --git a/install-sh b/install-sh index 377bb868..8175c640 100755 --- a/install-sh +++ b/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2011-11-20.07; # UTC +scriptversion=2018-03-11.20; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -41,19 +41,15 @@ scriptversion=2011-11-20.07; # UTC # This script is compatible with the BSD install script, but was written # from scratch. +tab=' ' nl=' ' -IFS=" "" $nl" +IFS=" $tab$nl" -# set DOITPROG to echo to test this script +# Set DOITPROG to "echo" to test this script. -# Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} -if test -z "$doit"; then - doit_exec=exec -else - doit_exec=$doit -fi +doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. @@ -68,17 +64,6 @@ mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} -posix_glob='?' -initialize_posix_glob=' - test "$posix_glob" != "?" || { - if (set -f) 2>/dev/null; then - posix_glob= - else - posix_glob=: - fi - } -' - posix_mkdir= # Desired mode of installed file. @@ -97,7 +82,7 @@ dir_arg= dst_arg= copy_on_change=false -no_target_directory= +is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE @@ -137,46 +122,57 @@ while test $# -ne 0; do -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" - shift;; + shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 - case $mode in - *' '* | *' '* | *' -'* | *'*'* | *'?'* | *'['*) - echo "$0: invalid mode: $mode" >&2 - exit 1;; - esac - shift;; + case $mode in + *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -o) chowncmd="$chownprog $2" - shift;; + shift;; -s) stripcmd=$stripprog;; - -t) dst_arg=$2 - # Protect names problematic for 'test' and other utilities. - case $dst_arg in - -* | [=\(\)!]) dst_arg=./$dst_arg;; - esac - shift;; + -t) + is_target_a_directory=always + dst_arg=$2 + # Protect names problematic for 'test' and other utilities. + case $dst_arg in + -* | [=\(\)!]) dst_arg=./$dst_arg;; + esac + shift;; - -T) no_target_directory=true;; + -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; - --) shift - break;; + --) shift + break;; - -*) echo "$0: invalid option: $1" >&2 - exit 1;; + -*) echo "$0: invalid option: $1" >&2 + exit 1;; *) break;; esac shift done +# We allow the use of options -d and -T together, by making -d +# take the precedence; this is for compatibility with GNU install. + +if test -n "$dir_arg"; then + if test -n "$dst_arg"; then + echo "$0: target directory not allowed when installing a directory." >&2 + exit 1 + fi +fi + if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. @@ -207,6 +203,15 @@ if test $# -eq 0; then exit 0 fi +if test -z "$dir_arg"; then + if test $# -gt 1 || test "$is_target_a_directory" = always; then + if test ! -d "$dst_arg"; then + echo "$0: $dst_arg: Is not a directory." >&2 + exit 1 + fi + fi +fi + if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 @@ -223,16 +228,16 @@ if test -z "$dir_arg"; then *[0-7]) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw='% 200' + u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then - u_plus_rw= + u_plus_rw= else - u_plus_rw=,u+rw + u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac @@ -266,122 +271,113 @@ do fi dst=$dst_arg - # If destination is a directory, append the input filename; won't work - # if double slashes aren't ignored. + # If destination is a directory, append the input filename. if test -d "$dst"; then - if test -n "$no_target_directory"; then - echo "$0: $dst_arg: Is a directory" >&2 - exit 1 + if test "$is_target_a_directory" = never; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 fi dstdir=$dst - dst=$dstdir/`basename "$src"` + dstbase=`basename "$src"` + case $dst in + */) dst=$dst$dstbase;; + *) dst=$dst/$dstbase;; + esac dstdir_status=0 else - # Prefer dirname, but fall back on a substitute if dirname fails. - dstdir=` - (dirname "$dst") 2>/dev/null || - expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$dst" : 'X\(//\)[^/]' \| \ - X"$dst" : 'X\(//\)$' \| \ - X"$dst" : 'X\(/\)' \| . 2>/dev/null || - echo X"$dst" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q' - ` - + dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi + case $dstdir in + */) dstdirslash=$dstdir;; + *) dstdirslash=$dstdir/;; + esac + obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') - # Create intermediate dirs using mode 755 as modified by the umask. - # This is like FreeBSD 'install' as of 1997-10-28. - umask=`umask` - case $stripcmd.$umask in - # Optimize common cases. - *[2367][2367]) mkdir_umask=$umask;; - .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; - - *[0-7]) - mkdir_umask=`expr $umask + 22 \ - - $umask % 100 % 40 + $umask % 20 \ - - $umask % 10 % 4 + $umask % 2 - `;; - *) mkdir_umask=$umask,go-w;; - esac - - # With -d, create the new directory with the user-specified mode. - # Otherwise, rely on $mkdir_umask. - if test -n "$dir_arg"; then - mkdir_mode=-m$mode - else - mkdir_mode= - fi - - posix_mkdir=false - case $umask in - *[123567][0-7][0-7]) - # POSIX mkdir -p sets u+wx bits regardless of umask, which - # is incompatible with FreeBSD 'install' when (umask & 300) != 0. - ;; - *) - tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ - trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 - - if (umask $mkdir_umask && - exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 - then - if test -z "$dir_arg" || { - # Check for POSIX incompatibilities with -m. - # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or - # other-writable bit of parent directory when it shouldn't. - # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. - ls_ld_tmpdir=`ls -ld "$tmpdir"` - case $ls_ld_tmpdir in - d????-?r-*) different_mode=700;; - d????-?--*) different_mode=755;; - *) false;; - esac && - $mkdirprog -m$different_mode -p -- "$tmpdir" && { - ls_ld_tmpdir_1=`ls -ld "$tmpdir"` - test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" - } - } - then posix_mkdir=: - fi - rmdir "$tmpdir/d" "$tmpdir" - else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null - fi - trap '' 0;; - esac;; + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + # Note that $RANDOM variable is not portable (e.g. dash); Use it + # here however when possible just to lower collision chance. + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + + trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0 + + # Because "mkdir -p" follows existing symlinks and we likely work + # directly in world-writeable /tmp, make sure that the '$tmpdir' + # directory is successfully created first before we actually test + # 'mkdir -p' feature. + if (umask $mkdir_umask && + $mkdirprog $mkdir_mode "$tmpdir" && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + test_tmpdir="$tmpdir/a" + ls_ld_tmpdir=`ls -ld "$test_tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null + fi + trap '' 0;; + esac;; esac if $posix_mkdir && ( - umask $mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else @@ -391,53 +387,51 @@ do # directory the slow way, step by step, checking for races as we go. case $dstdir in - /*) prefix='/';; - [-=\(\)!]*) prefix='./';; - *) prefix='';; + /*) prefix='/';; + [-=\(\)!]*) prefix='./';; + *) prefix='';; esac - eval "$initialize_posix_glob" - oIFS=$IFS IFS=/ - $posix_glob set -f + set -f set fnord $dstdir shift - $posix_glob set +f + set +f IFS=$oIFS prefixes= for d do - test X"$d" = X && continue - - prefix=$prefix$d - if test -d "$prefix"; then - prefixes= - else - if $posix_mkdir; then - (umask=$mkdir_umask && - $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break - # Don't fail if two instances are running concurrently. - test -d "$prefix" || exit 1 - else - case $prefix in - *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; - *) qprefix=$prefix;; - esac - prefixes="$prefixes '$qprefix'" - fi - fi - prefix=$prefix/ + test X"$d" = X && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ done if test -n "$prefixes"; then - # Don't fail if two instances are running concurrently. - (umask $mkdir_umask && - eval "\$doit_exec \$mkdirprog $prefixes") || - test -d "$dstdir" || exit 1 - obsolete_mkdir_used=true + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true fi fi fi @@ -450,8 +444,8 @@ do else # Make a couple of temp file names in the proper directory. - dsttmp=$dstdir/_inst.$$_ - rmtmp=$dstdir/_rm.$$_ + dsttmp=${dstdirslash}_inst.$$_ + rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 @@ -472,15 +466,12 @@ do # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && - old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && - new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - - eval "$initialize_posix_glob" && - $posix_glob set -f && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && - $posix_glob set +f && - + set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then @@ -493,24 +484,24 @@ do # to itself, or perhaps because mv is so ancient that it does not # support -f. { - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - test ! -f "$dst" || - $doit $rmcmd -f "$dst" 2>/dev/null || - { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && - { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } - } || - { echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - } && - - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 @@ -519,9 +510,9 @@ do done # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/io.c b/io.c index c41b66fa..4fd6cf06 100644 --- a/io.c +++ b/io.c @@ -3,29 +3,10 @@ * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 1999-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -69,7 +50,7 @@ print_iovec(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) kernel_ulong_t iov_buf[2], len; struct print_iovec_config *c = data; - if (elem_size < sizeof(iov_buf)) { + if (elem_size < sizeof(iov_buf)) { iov_buf[0] = ((unsigned int *) elem_buf)[0]; iov_buf[1] = ((unsigned int *) elem_buf)[1]; iov = iov_buf; @@ -94,7 +75,8 @@ print_iovec(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) len = c->data_size; if (c->data_size != (kernel_ulong_t) -1) c->data_size -= len; - decode_netlink(tcp, iov[0], iov[1]); + /* assume that the descriptor is 1st syscall argument */ + decode_netlink(tcp, tcp->u_arg[0], iov[0], len); break; default: printaddr(iov[0]); @@ -116,11 +98,12 @@ tprint_iov_upto(struct tcb *const tcp, const kernel_ulong_t len, const kernel_ulong_t data_size) { kernel_ulong_t iov[2]; - struct print_iovec_config config = - { .decode_iov = decode_iov, .data_size = data_size }; + struct print_iovec_config config = { + .decode_iov = decode_iov, .data_size = data_size + }; print_array(tcp, addr, len, iov, current_wordsize * 2, - umoven_or_printaddr_ignore_syserror, print_iovec, &config); + tfetch_mem_ignore_syserror, print_iovec, &config); } SYS_FUNC(readv) @@ -224,11 +207,6 @@ SYS_FUNC(preadv) return do_preadv(tcp, -1); } -SYS_FUNC(preadv2) -{ - return do_preadv(tcp, 5); -} - static int do_pwritev(struct tcb *tcp, const int flags_arg) { @@ -253,9 +231,29 @@ SYS_FUNC(pwritev) return do_pwritev(tcp, -1); } +/* + * x32 is the only architecture where preadv2 takes 5 arguments + * instead of 6, see preadv64v2 in kernel sources. + * Likewise, x32 is the only architecture where pwritev2 takes 5 arguments + * instead of 6, see pwritev64v2 in kernel sources. + */ + +#if defined X86_64 +# define PREADV2_PWRITEV2_FLAGS_ARG_NO (current_personality == 2 ? 4 : 5) +#elif defined X32 +# define PREADV2_PWRITEV2_FLAGS_ARG_NO (current_personality == 0 ? 4 : 5) +#else +# define PREADV2_PWRITEV2_FLAGS_ARG_NO 5 +#endif + +SYS_FUNC(preadv2) +{ + return do_preadv(tcp, PREADV2_PWRITEV2_FLAGS_ARG_NO); +} + SYS_FUNC(pwritev2) { - return do_pwritev(tcp, 5); + return do_pwritev(tcp, PREADV2_PWRITEV2_FLAGS_ARG_NO); } #include "xlat/splice_flags.h" diff --git a/io_uring.c b/io_uring.c new file mode 100644 index 00000000..0b82a075 --- /dev/null +++ b/io_uring.c @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2019 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#ifdef HAVE_LINUX_IO_URING_H +# include "print_fields.h" +# include +#endif + +#include "xlat/uring_setup_flags.h" +#include "xlat/uring_enter_flags.h" +#include "xlat/uring_register_opcodes.h" + +SYS_FUNC(io_uring_setup) +{ + const uint32_t nentries = tcp->u_arg[0]; + const kernel_ulong_t params_addr = tcp->u_arg[1]; + +#ifdef HAVE_LINUX_IO_URING_H + struct io_uring_params params; + + if (entering(tcp)) { + tprintf("%u, ", nentries); + + if (umove_or_printaddr(tcp, params_addr, ¶ms)) + return RVAL_DECODED | RVAL_FD; + + PRINT_FIELD_FLAGS("{", params, flags, uring_setup_flags, + "IORING_SETUP_???"); + PRINT_FIELD_X(", ", params, sq_thread_cpu); + PRINT_FIELD_U(", ", params, sq_thread_idle); + for (unsigned int i = 0; i < ARRAY_SIZE(params.resv); ++i) { + if (params.resv[i]) { + for (i = 0; i < ARRAY_SIZE(params.resv); ++i) + tprintf("%s%#x", + (i ? ", " : ", resv={"), + params.resv[i]); + tprints("}"); + break; + } + } + return 0; + } else { + if (syserror(tcp)) { + /* The remaining part of params is irrelevant. */ + } else if (umove(tcp, params_addr, ¶ms)) { + tprints(", ???"); + } else { + PRINT_FIELD_U(", ", params, sq_entries); + PRINT_FIELD_U(", ", params, cq_entries); + PRINT_FIELD_U(", sq_off={", params.sq_off, head); + PRINT_FIELD_U(", ", params.sq_off, tail); + PRINT_FIELD_U(", ", params.sq_off, ring_mask); + PRINT_FIELD_U(", ", params.sq_off, ring_entries); + PRINT_FIELD_U(", ", params.sq_off, flags); + PRINT_FIELD_U(", ", params.sq_off, dropped); + PRINT_FIELD_U(", ", params.sq_off, array); + PRINT_FIELD_U("}, cq_off={", params.cq_off, head); + PRINT_FIELD_U(", ", params.cq_off, tail); + PRINT_FIELD_U(", ", params.cq_off, ring_mask); + PRINT_FIELD_U(", ", params.cq_off, ring_entries); + PRINT_FIELD_U(", ", params.cq_off, overflow); + PRINT_FIELD_U(", ", params.cq_off, cqes); + tprints("}"); + } + tprints("}"); + } +#else /* !HAVE_LINUX_IO_URING_H */ + tprintf("%u, ", nentries); + printaddr(params_addr); +#endif + + return RVAL_DECODED | RVAL_FD; +} + +SYS_FUNC(io_uring_enter) +{ + const int fd = tcp->u_arg[0]; + const uint32_t to_submit = tcp->u_arg[1]; + const uint32_t min_complete = tcp->u_arg[2]; + const uint32_t flags = tcp->u_arg[3]; + const kernel_ulong_t sigset_addr = tcp->u_arg[4]; + const kernel_ulong_t sigset_size = tcp->u_arg[5]; + + printfd(tcp, fd); + tprintf(", %u, %u, ", to_submit, min_complete); + printflags(uring_enter_flags, flags, "IORING_ENTER_???"); + tprints(", "); + print_sigset_addr_len(tcp, sigset_addr, sigset_size); + tprintf(", %" PRI_klu, sigset_size); + + return RVAL_DECODED; +} + +static bool +print_fd_array_member(struct tcb *tcp, void *elem_buf, size_t elem_size, + void *data) +{ + printfd(tcp, *(int *) elem_buf); + return true; +} + +SYS_FUNC(io_uring_register) +{ + const int fd = tcp->u_arg[0]; + const unsigned int opcode = tcp->u_arg[1]; + const kernel_ulong_t arg = tcp->u_arg[2]; + const unsigned int nargs = tcp->u_arg[3]; + int buf; + + printfd(tcp, fd); + tprints(", "); + printxval(uring_register_opcodes, opcode, "IORING_REGISTER_???"); + tprints(", "); + switch (opcode) { + case IORING_REGISTER_BUFFERS: + tprint_iov(tcp, nargs, arg, IOV_DECODE_ADDR); + break; + case IORING_REGISTER_FILES: + print_array(tcp, arg, nargs, &buf, sizeof(buf), + tfetch_mem, print_fd_array_member, NULL); + break; + default: + printaddr(arg); + break; + } + tprintf(", %u", nargs); + + return RVAL_DECODED; +} diff --git a/ioctl.c b/ioctl.c index aa1880f8..d3205b22 100644 --- a/ioctl.c +++ b/ioctl.c @@ -3,42 +3,16 @@ * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-2001 Wichert Akkerman + * Copyright (c) 1999-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" #include #include "xlat/ioctl_dirs.h" -#ifdef HAVE_LINUX_INPUT_H -# include -#endif - -#include "xlat/evdev_abs.h" -#include "xlat/evdev_ev.h" - static int compare(const void *a, const void *b) { @@ -91,7 +65,8 @@ evdev_decode_number(const unsigned int code) if (_IOC_DIR(code) == _IOC_WRITE) { if (nr >= 0xc0 && nr <= 0xc0 + 0x3f) { tprints("EVIOCSABS("); - printxval(evdev_abs, nr - 0xc0, "ABS_???"); + printxval_indexn(evdev_abs, evdev_abs_size, nr - 0xc0, + "ABS_???"); tprints(")"); return 1; } @@ -102,12 +77,16 @@ evdev_decode_number(const unsigned int code) if (nr >= 0x20 && nr <= 0x20 + 0x1f) { tprints("EVIOCGBIT("); - printxval(evdev_ev, nr - 0x20, "EV_???"); + if (nr == 0x20) + tprintf("0"); + else + printxval(evdev_ev, nr - 0x20, "EV_???"); tprintf(", %u)", _IOC_SIZE(code)); return 1; } else if (nr >= 0x40 && nr <= 0x40 + 0x3f) { tprints("EVIOCGABS("); - printxval(evdev_abs, nr - 0x40, "ABS_???"); + printxval_indexn(evdev_abs, evdev_abs_size, nr - 0x40, + "ABS_???"); tprints(")"); return 1; } @@ -223,6 +202,33 @@ ioctl_decode_command_number(struct tcb *tcp) } } +/** + * Decode arg parameter of the ioctl call. + * + * @return There are two flags of the return value important for the purposes of + * processing by SYS_FUNC(ioctl): + * - RVAL_IOCTL_DECODED: indicates that ioctl decoder code + * has printed arg parameter; + * - RVAL_DECODED: indicates that decoding is done. + * As a result, the following behaviour is expected: + * - on entering: + * - 0: decoding should be continued on exiting; + * - RVAL_IOCTL_DECODED: decoding on exiting is not needed + * and decoder has printed arg value; + * - RVAL_DECODED: decoding on exiting is not needed + * and generic handler should print arg value. + * - on exiting: + * - 0: generic handler should print arg value; + * - RVAL_IOCTL_DECODED: decoder has printed arg value. + * + * Note that it makes no sense to return just RVAL_DECODED on exiting, + * but, of course, it is not prohibited (for example, it may be useful + * in cases where the return path is common on entering and on exiting + * the syscall). + * + * SYS_FUNC(ioctl) converts RVAL_IOCTL_DECODED flag to RVAL_DECODED, + * and passes all other bits of ioctl_decode return value unchanged. + */ static int ioctl_decode(struct tcb *tcp) { @@ -230,11 +236,14 @@ ioctl_decode(struct tcb *tcp) const kernel_ulong_t arg = tcp->u_arg[2]; switch (_IOC_TYPE(code)) { + case '$': + return perf_ioctl(tcp, code, arg); #if defined(ALPHA) || defined(POWERPC) case 'f': { int ret = file_ioctl(tcp, code, arg); if (ret != RVAL_DECODED) return ret; + ATTRIBUTE_FALLTHROUGH; } case 't': case 'T': @@ -259,15 +268,21 @@ ioctl_decode(struct tcb *tcp) return scsi_ioctl(tcp, code, arg); case 'L': return loop_ioctl(tcp, code, arg); +#ifdef HAVE_STRUCT_MTD_WRITE_REQ case 'M': return mtd_ioctl(tcp, code, arg); +#endif +#ifdef HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024 case 'o': case 'O': return ubi_ioctl(tcp, code, arg); +#endif case 'V': return v4l2_ioctl(tcp, code, arg); +#ifdef HAVE_STRUCT_PTP_SYS_OFFSET case '=': return ptp_ioctl(tcp, code, arg); +#endif #ifdef HAVE_LINUX_INPUT_H case 'E': return evdev_ioctl(tcp, code, arg); @@ -280,10 +295,22 @@ ioctl_decode(struct tcb *tcp) case 0x94: return btrfs_ioctl(tcp, code, arg); #endif + case 0xb7: + return nsfs_ioctl(tcp, code, arg); #ifdef HAVE_LINUX_DM_IOCTL_H case 0xfd: return dm_ioctl(tcp, code, arg); #endif +#ifdef HAVE_LINUX_KVM_H + case 0xae: + return kvm_ioctl(tcp, code, arg); +#endif + case 'I': + return inotify_ioctl(tcp, code, arg); + case 0xab: + return nbd_ioctl(tcp, code, arg); + case 'R': + return random_ioctl(tcp, code, arg); default: break; } @@ -298,34 +325,39 @@ SYS_FUNC(ioctl) if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); tprints(", "); - ret = ioctl_decode_command_number(tcp); - if (!(ret & IOCTL_NUMBER_STOP_LOOKUP)) { - iop = ioctl_lookup(tcp->u_arg[1]); - if (iop) { - if (ret) - tprints(" or "); - tprints(iop->symbol); - while ((iop = ioctl_next_match(iop))) - tprintf(" or %s", iop->symbol); - } else if (!ret) { - ioctl_print_code(tcp->u_arg[1]); + + if (xlat_verbosity != XLAT_STYLE_ABBREV) + tprintf("%#x", (unsigned int) tcp->u_arg[1]); + if (xlat_verbosity == XLAT_STYLE_VERBOSE) + tprints(" /* "); + if (xlat_verbosity != XLAT_STYLE_RAW) { + ret = ioctl_decode_command_number(tcp); + if (!(ret & IOCTL_NUMBER_STOP_LOOKUP)) { + iop = ioctl_lookup(tcp->u_arg[1]); + if (iop) { + if (ret) + tprints(" or "); + tprints(iop->symbol); + while ((iop = ioctl_next_match(iop))) + tprintf(" or %s", iop->symbol); + } else if (!ret) { + ioctl_print_code(tcp->u_arg[1]); + } } } + if (xlat_verbosity == XLAT_STYLE_VERBOSE) + tprints(" */"); + ret = ioctl_decode(tcp); } else { ret = ioctl_decode(tcp) | RVAL_DECODED; } - if (ret & RVAL_DECODED) { - ret &= ~RVAL_DECODED; - if (ret) - --ret; - else - tprintf(", %#" PRI_klx, tcp->u_arg[2]); + if (ret & RVAL_IOCTL_DECODED) { + ret &= ~RVAL_IOCTL_DECODED; ret |= RVAL_DECODED; - } else { - if (ret) - --ret; + } else if (ret & RVAL_DECODED) { + tprintf(", %#" PRI_klx, tcp->u_arg[2]); } return ret; diff --git a/ioctl_iocdef.c b/ioctl_iocdef.c index accbbedd..1f43fc41 100644 --- a/ioctl_iocdef.c +++ b/ioctl_iocdef.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2017 Alexey Neyman + * Copyright (c) 2017-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ /* diff --git a/ioctlsort.c b/ioctlsort.c index 079f21e5..b090d162 100644 --- a/ioctlsort.c +++ b/ioctlsort.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2001 Wichert Akkerman * Copyright (c) 2004-2015 Dmitry V. Levin + * Copyright (c) 1999-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #ifdef HAVE_CONFIG_H @@ -55,7 +36,7 @@ is_prefix(const char *s1, const char *s2) } static int -compare_name_info(const void* a, const void* b) +compare_name_info(const void *a, const void *b) { int rc; @@ -92,7 +73,7 @@ code(const struct ioctlent *e) } static int -compare_code_name(const void* a, const void* b) +compare_code_name(const void *a, const void *b) { unsigned int code1 = code((struct ioctlent *) a); unsigned int code2 = code((struct ioctlent *) b); diff --git a/ioperm.c b/ioperm.c index e9eea7f6..73f9fa9f 100644 --- a/ioperm.c +++ b/ioperm.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" SYS_FUNC(ioperm) diff --git a/iopl.c b/iopl.c index 0f2bb322..e4712f13 100644 --- a/iopl.c +++ b/iopl.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" SYS_FUNC(iopl) diff --git a/ioprio.c b/ioprio.c index 0b83be7a..d4770ef2 100644 --- a/ioprio.c +++ b/ioprio.c @@ -1,47 +1,15 @@ /* * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2014-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" - -enum { - IOPRIO_WHO_PROCESS = 1, - IOPRIO_WHO_PGRP, - IOPRIO_WHO_USER -}; +#include "xstring.h" #include "xlat/ioprio_who.h" - -enum { - IOPRIO_CLASS_NONE, - IOPRIO_CLASS_RT, - IOPRIO_CLASS_BE, - IOPRIO_CLASS_IDLE -}; - #include "xlat/ioprio_class.h" #define IOPRIO_CLASS_SHIFT (13) @@ -54,17 +22,14 @@ static const char * sprint_ioprio(unsigned int ioprio) { static char outstr[256]; - const char *str; + char class_buf[64]; unsigned int class, data; class = IOPRIO_PRIO_CLASS(ioprio); data = IOPRIO_PRIO_DATA(ioprio); - str = xlookup(ioprio_class, class); - if (str) - sprintf(outstr, "IOPRIO_PRIO_VALUE(%s, %d)", str, data); - else - sprintf(outstr, "IOPRIO_PRIO_VALUE(%#x /* %s */, %d)", - class, "IOPRIO_CLASS_???", data); + sprintxval(class_buf, sizeof(class_buf), ioprio_class, class, + "IOPRIO_CLASS_???"); + xsprintf(outstr, "IOPRIO_PRIO_VALUE(%s, %d)", class_buf, data); return outstr; } @@ -80,8 +45,10 @@ SYS_FUNC(ioprio_get) } else { if (syserror(tcp)) return 0; - - tcp->auxstr = sprint_ioprio(tcp->u_rval); + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) + tcp->auxstr = NULL; + else + tcp->auxstr = sprint_ioprio(tcp->u_rval); return RVAL_STR; } } @@ -93,7 +60,14 @@ SYS_FUNC(ioprio_set) /* int who */ tprintf(", %d, ", (int) tcp->u_arg[1]); /* int ioprio */ - tprints(sprint_ioprio(tcp->u_arg[2])); + if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) + tprintf("%d", (int) tcp->u_arg[2]); + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) + return RVAL_DECODED; + + (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE + ? tprints_comment : tprints)(sprint_ioprio(tcp->u_arg[2])); return RVAL_DECODED; } diff --git a/ipc.c b/ipc.c index bd23a4ed..d24450c4 100644 --- a/ipc.c +++ b/ipc.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 1999-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -33,18 +14,14 @@ SYS_FUNC(ipc) unsigned int call = tcp->u_arg[0]; unsigned int version = call >> 16; call &= 0xffff; - const char *str = xlookup(ipccalls, call); if (version) tprintf("%u<<16|", version); - if (str) - tprints(str); - else - tprintf("%u", call); + printxval_u(ipccalls, call, NULL); unsigned int i; - for (i = 1; i < tcp->s_ent->nargs; ++i) + for (i = 1; i < n_args(tcp); ++i) tprintf(", %#" PRI_klx, tcp->u_arg[i]); return RVAL_DECODED; diff --git a/ipc_defs.h b/ipc_defs.h index e0043ced..b5900e0b 100644 --- a/ipc_defs.h +++ b/ipc_defs.h @@ -1,47 +1,33 @@ /* * Copyright (c) 2003 Roland McGrath + * Copyright (c) 2003-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #ifndef STRACE_IPC_DEFS_H -#define STRACE_IPC_DEFS_H +# define STRACE_IPC_DEFS_H -#ifdef HAVE_SYS_IPC_H -# include -#elif defined HAVE_LINUX_IPC_H -# include +# ifdef HAVE_SYS_IPC_H +# include +# elif defined HAVE_LINUX_IPC_H +# include /* While glibc uses __key, the kernel uses key. */ -# define __key key -#endif +# define __key key +# endif -#if !defined IPC_64 -# define IPC_64 0x100 -#endif +# if !defined IPC_64 +# define IPC_64 0x100 +# endif -#define PRINTCTL(flagset, arg, dflt) \ - if ((arg) & IPC_64) tprints("IPC_64|"); \ - printxval((flagset), (arg) &~ IPC_64, dflt) +# define PRINTCTL(flagset, arg, dflt) \ + do { \ + if ((arg) & IPC_64) { \ + print_xlat(IPC_64); \ + tprints("|"); \ + } \ + printxval((flagset), (arg) & ~IPC_64, dflt); \ + } while (0) #endif /* !STRACE_IPC_DEFS_H */ diff --git a/ipc_msg.c b/ipc_msg.c index a5f9e83e..d5703557 100644 --- a/ipc_msg.c +++ b/ipc_msg.c @@ -5,29 +5,10 @@ * Copyright (c) 1996-1999 Wichert Akkerman * Copyright (c) 2003-2006 Roland McGrath * Copyright (c) 2006-2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -40,15 +21,12 @@ #endif #include "xlat/ipc_msg_flags.h" +#include "xlat/ipc_private.h" #include "xlat/resource_flags.h" SYS_FUNC(msgget) { - const int key = (int) tcp->u_arg[0]; - if (key) - tprintf("%#x", key); - else - tprints("IPC_PRIVATE"); + printxval(ipc_private, (unsigned int) tcp->u_arg[0], NULL); tprints(", "); if (printflags(resource_flags, tcp->u_arg[1] & ~0777, NULL) != 0) tprints("|"); @@ -98,7 +76,7 @@ fetch_msgrcv_args(struct tcb *const tcp, const kernel_ulong_t addr, if (umove_or_printaddr(tcp, addr, &tmp)) return -1; pair[0] = tmp[0]; - pair[1] = tmp[1]; + pair[1] = (int) tmp[1]; } return 0; } diff --git a/ipc_msgctl.c b/ipc_msgctl.c index f289c301..8c5337cf 100644 --- a/ipc_msgctl.c +++ b/ipc_msgctl.c @@ -5,29 +5,10 @@ * Copyright (c) 1996-1999 Wichert Akkerman * Copyright (c) 2003-2006 Roland McGrath * Copyright (c) 2006-2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/ipc_sem.c b/ipc_sem.c index 4a703783..0be29666 100644 --- a/ipc_sem.c +++ b/ipc_sem.c @@ -5,29 +5,10 @@ * Copyright (c) 1996-1999 Wichert Akkerman * Copyright (c) 2003-2006 Roland McGrath * Copyright (c) 2006-2015 Dmitry V. Levin + * Copyright (c) 2015-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -63,7 +44,7 @@ tprint_sembuf_array(struct tcb *const tcp, const kernel_ulong_t addr, #if defined HAVE_SYS_SEM_H || defined HAVE_LINUX_SEM_H struct sembuf sb; print_array(tcp, addr, count, &sb, sizeof(sb), - umoven_or_printaddr, print_sembuf, 0); + tfetch_mem, print_sembuf, 0); #else printaddr(addr); #endif @@ -81,32 +62,41 @@ SYS_FUNC(semop) return RVAL_DECODED; } -SYS_FUNC(semtimedop) +static int +do_semtimedop(struct tcb *const tcp, const print_obj_by_addr_fn print_ts) { tprintf("%d, ", (int) tcp->u_arg[0]); if (indirect_ipccall(tcp)) { tprint_sembuf_array(tcp, tcp->u_arg[3], tcp->u_arg[1]); tprints(", "); #if defined(S390) || defined(S390X) - print_timespec(tcp, tcp->u_arg[2]); + print_ts(tcp, tcp->u_arg[2]); #else - print_timespec(tcp, tcp->u_arg[4]); + print_ts(tcp, tcp->u_arg[4]); #endif } else { tprint_sembuf_array(tcp, tcp->u_arg[1], tcp->u_arg[2]); tprints(", "); - print_timespec(tcp, tcp->u_arg[3]); + print_ts(tcp, tcp->u_arg[3]); } return RVAL_DECODED; } +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(semtimedop_time32) +{ + return do_semtimedop(tcp, print_timespec32); +} +#endif + +SYS_FUNC(semtimedop_time64) +{ + return do_semtimedop(tcp, print_timespec64); +} + SYS_FUNC(semget) { - const int key = (int) tcp->u_arg[0]; - if (key) - tprintf("%#x", key); - else - tprints("IPC_PRIVATE"); + printxval(ipc_private, (unsigned int) tcp->u_arg[0], NULL); tprintf(", %d, ", (int) tcp->u_arg[1]); if (printflags(resource_flags, tcp->u_arg[2] & ~0777, NULL) != 0) tprints("|"); diff --git a/ipc_shm.c b/ipc_shm.c index c4bdb87a..b54cd8c4 100644 --- a/ipc_shm.c +++ b/ipc_shm.c @@ -5,29 +5,10 @@ * Copyright (c) 1996-1999 Wichert Akkerman * Copyright (c) 2003-2006 Roland McGrath * Copyright (c) 2006-2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -38,20 +19,41 @@ # include #endif +#ifndef SHM_HUGE_SHIFT +# define SHM_HUGE_SHIFT 26 +#endif + +#ifndef SHM_HUGE_MASK +# define SHM_HUGE_MASK 0x3f +#endif + #include "xlat/shm_resource_flags.h" #include "xlat/shm_flags.h" SYS_FUNC(shmget) { - const int key = (int) tcp->u_arg[0]; - if (key) - tprintf("%#x", key); - else - tprints("IPC_PRIVATE"); + printxval(ipc_private, (unsigned int) tcp->u_arg[0], NULL); tprintf(", %" PRI_klu ", ", tcp->u_arg[1]); - if (printflags(shm_resource_flags, tcp->u_arg[2] & ~0777, NULL) != 0) + + unsigned int flags = tcp->u_arg[2] & ~0777; + const unsigned int mask = SHM_HUGE_MASK << SHM_HUGE_SHIFT; + const unsigned int hugetlb_value = flags & mask; + + flags &= ~mask; + if (flags || !hugetlb_value) + printflags(shm_resource_flags, flags, NULL); + + if (hugetlb_value) { + tprintf("%s%u<<", + flags ? "|" : "", + hugetlb_value >> SHM_HUGE_SHIFT); + print_xlat_u(SHM_HUGE_SHIFT); + } + + if (flags || hugetlb_value) tprints("|"); print_numeric_umode_t(tcp->u_arg[2] & 0777); + return RVAL_DECODED; } diff --git a/ipc_shmctl.c b/ipc_shmctl.c index ff76af8c..25f44716 100644 --- a/ipc_shmctl.c +++ b/ipc_shmctl.c @@ -5,29 +5,10 @@ * Copyright (c) 1996-1999 Wichert Akkerman * Copyright (c) 2003-2006 Roland McGrath * Copyright (c) 2006-2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/kcmp.c b/kcmp.c index 97795e63..6722d774 100644 --- a/kcmp.c +++ b/kcmp.c @@ -1,33 +1,37 @@ /* * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" +#include "print_fields.h" #include "xlat/kcmp_types.h" +struct strace_kcmp_epoll_slot { + uint32_t efd; + uint32_t tfd; + uint32_t toff; +}; + +static void +printpidfd(struct tcb *tcp, pid_t pid, int fd) +{ + /* + * XXX We want to use printfd here, but we should figure out which + * process in strace's PID NS is referred to first. + */ + tprintf("%d", fd); +} + +#define PRINT_FIELD_PIDFD(prefix_, where_, field_, tcp_, pid_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + printpidfd((tcp_), (pid_), (where_).field_); \ + } while (0) + SYS_FUNC(kcmp) { pid_t pid1 = tcp->u_arg[0]; @@ -39,10 +43,33 @@ SYS_FUNC(kcmp) tprintf("%d, %d, ", pid1, pid2); printxval(kcmp_types, type, "KCMP_???"); - switch(type) { + switch (type) { case KCMP_FILE: - tprintf(", %u, %u", (unsigned) idx1, (unsigned) idx2); + tprints(", "); + printpidfd(tcp, pid1, idx1); + tprints(", "); + printpidfd(tcp, pid1, idx2); + break; + + case KCMP_EPOLL_TFD: { + struct strace_kcmp_epoll_slot slot; + + tprints(", "); + printpidfd(tcp, pid1, idx1); + tprints(", "); + + if (umove_or_printaddr(tcp, idx2, &slot)) + break; + + PRINT_FIELD_PIDFD("{", slot, efd, tcp, pid2); + PRINT_FIELD_PIDFD(", ", slot, tfd, tcp, pid2); + PRINT_FIELD_U(", ", slot, toff); + tprints("}"); + + break; + } + case KCMP_FILES: case KCMP_FS: case KCMP_IO: diff --git a/kernel_timespec.h b/kernel_timespec.h new file mode 100644 index 00000000..99fb2c6c --- /dev/null +++ b/kernel_timespec.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2019 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_KERNEL_TIMESPEC_H +# define STRACE_KERNEL_TIMESPEC_H + +typedef struct { + long long tv_sec; + long long tv_nsec; +} kernel_timespec64_t; + +# if HAVE_ARCH_TIME32_SYSCALLS + +typedef struct { + int tv_sec; + int tv_nsec; +} kernel_timespec32_t; + +# endif /* HAVE_ARCH_TIME32_SYSCALLS */ + +#endif /* !STRACE_KERNEL_TIMESPEC_H */ diff --git a/kernel_timeval.h b/kernel_timeval.h new file mode 100644 index 00000000..4170937a --- /dev/null +++ b/kernel_timeval.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2019 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_KERNEL_TIMEVAL_H +# define STRACE_KERNEL_TIMEVAL_H + +typedef struct { + long long tv_sec; + long long tv_usec; +} kernel_timeval64_t; + +#endif /* !STRACE_KERNEL_TIMEVAL_H */ diff --git a/kernel_timex.h b/kernel_timex.h new file mode 100644 index 00000000..a597e353 --- /dev/null +++ b/kernel_timex.h @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2019 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_KERNEL_TIMEX_H +# define STRACE_KERNEL_TIMEX_H + +# include "kernel_timeval.h" + +typedef struct { + unsigned int modes; + int pad0; + long long offset; + long long freq; + long long maxerror; + long long esterror; + int status; + int pad1; + long long constant; + long long precision; + long long tolerance; + kernel_timeval64_t time; + long long tick; + long long ppsfreq; + long long jitter; + int shift; + int pad2; + long long stabil; + long long jitcnt; + long long calcnt; + long long errcnt; + long long stbcnt; + int tai; + int pad3[11]; +} kernel_timex64_t; + +#ifdef SPARC64 + +typedef struct { + unsigned int modes; + int pad0; + long long offset; + long long freq; + long long maxerror; + long long esterror; + int status; + int pad1; + long long constant; + long long precision; + long long tolerance; + struct { + long long tv_sec; + int tv_usec; + } time; + long long tick; + long long ppsfreq; + long long jitter; + int shift; + int pad2; + long long stabil; + long long jitcnt; + long long calcnt; + long long errcnt; + long long stbcnt; + int tai; + int pad3[11]; +} kernel_sparc64_timex_t; + +#endif /* SPARC64 */ + +# if HAVE_ARCH_TIME32_SYSCALLS + +typedef struct { + unsigned int modes; + int offset; + int freq; + int maxerror; + int esterror; + int status; + int constant; + int precision; + int tolerance; + struct { + int tv_sec; + int tv_usec; + } time; + int tick; + int ppsfreq; + int jitter; + int shift; + int stabil; + int jitcnt; + int calcnt; + int errcnt; + int stbcnt; + int tai; + int pad0[11]; +} kernel_timex32_t; + +# endif /* HAVE_ARCH_TIME32_SYSCALLS */ + +#endif /* !STRACE_KERNEL_TIMEX_H */ diff --git a/kernel_types.h b/kernel_types.h index 5a276135..f7c2aedb 100644 --- a/kernel_types.h +++ b/kernel_types.h @@ -1,36 +1,17 @@ /* * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #ifndef STRACE_KERNEL_TYPES_H -#define STRACE_KERNEL_TYPES_H +# define STRACE_KERNEL_TYPES_H # if defined HAVE___KERNEL_LONG_T && defined HAVE___KERNEL_ULONG_T -# include +# include typedef __kernel_long_t kernel_long_t; typedef __kernel_ulong_t kernel_ulong_t; @@ -54,4 +35,36 @@ typedef struct { char d_name[1]; } kernel_dirent; +# if SIZEOF_KERNEL_LONG_T > SIZEOF_LONG +# define PRI_kl "ll" +# else +# define PRI_kl "l" +# endif + +# define PRI_kld PRI_kl"d" +# define PRI_klu PRI_kl"u" +# define PRI_klx PRI_kl"x" + +/* + * The kernel used to define 64-bit types on 64-bit systems on a per-arch + * basis. Some architectures would use unsigned long and others would use + * unsigned long long. These types were exported as part of the + * kernel-userspace ABI and now must be maintained forever. This matches + * what the kernel exports for each architecture so we don't need to cast + * every printing of __u64 or __s64 to stdint types. + * The exception is Android, where for MIPS64 unsigned long long is used. + */ +# if SIZEOF_LONG == 4 +# define PRI__64 "ll" +# elif defined ALPHA || defined IA64 || defined __powerpc64__ \ + || (defined MIPS && !defined __ANDROID__) +# define PRI__64 "l" +# else +# define PRI__64 "ll" +# endif + +# define PRI__d64 PRI__64"d" +# define PRI__u64 PRI__64"u" +# define PRI__x64 PRI__64"x" + #endif /* !STRACE_KERNEL_TYPES_H */ diff --git a/kexec.c b/kexec.c index 44d5bd18..07257609 100644 --- a/kexec.c +++ b/kexec.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2014-2015 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -43,7 +24,7 @@ print_seg(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) const kernel_ulong_t *seg; kernel_ulong_t seg_buf[4]; - if (elem_size < sizeof(seg_buf)) { + if (elem_size < sizeof(seg_buf)) { unsigned int i; for (i = 0; i < ARRAY_SIZE(seg_buf); ++i) @@ -75,7 +56,7 @@ print_kexec_segments(struct tcb *const tcp, const kernel_ulong_t addr, const size_t sizeof_seg = ARRAY_SIZE(seg) * current_wordsize; print_array(tcp, addr, len, seg, sizeof_seg, - umoven_or_printaddr, print_seg, 0); + tfetch_mem, print_seg, 0); } SYS_FUNC(kexec_load) diff --git a/keyctl.c b/keyctl.c index c270221f..e880410c 100644 --- a/keyctl.c +++ b/keyctl.c @@ -1,32 +1,16 @@ /* * Copyright (c) 2014-2015 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" +#include "keyctl_kdf_params.h" +#include "print_fields.h" + typedef int32_t key_serial_t; #include "xlat/key_spec.h" @@ -40,12 +24,7 @@ struct keyctl_dh_params { static void print_keyring_serial_number(key_serial_t id) { - const char *str = xlookup(key_spec, (unsigned int) id); - - if (str) - tprints(str); - else - tprintf("%d", id); + printxval_d(key_spec, id, NULL); } SYS_FUNC(add_key) @@ -191,12 +170,8 @@ keyctl_reject_key(struct tcb *tcp, key_serial_t id1, unsigned timeout, print_keyring_serial_number(id1); tprintf(", %u, ", timeout); - - if (err_str) - tprintf("%s, ", err_str); - else - tprintf("%u, ", error); - + print_xlat_ex(error, err_str, XLAT_STYLE_FMT_U); + tprints(", "); print_keyring_serial_number(id2); } @@ -244,12 +219,14 @@ print_dh_params(struct tcb *tcp, kernel_ulong_t addr) static void keyctl_dh_compute(struct tcb *tcp, kernel_ulong_t params, kernel_ulong_t buf, - kernel_ulong_t len) + kernel_ulong_t len, kernel_ulong_t kdf_addr) { if (entering(tcp)) { print_dh_params(tcp, params); tprints(", "); } else { + struct strace_keyctl_kdf_params kdf; + if (syserror(tcp)) { printaddr(buf); } else { @@ -258,10 +235,64 @@ keyctl_dh_compute(struct tcb *tcp, kernel_ulong_t params, kernel_ulong_t buf, (kernel_ulong_t) tcp->u_rval; printstrn(tcp, buf, rval); } - tprintf(", %llu", zero_extend_signed_to_ull(len)); + tprintf(", %llu, ", zero_extend_signed_to_ull(len)); + + if (fetch_keyctl_kdf_params(tcp, kdf_addr, &kdf)) { + printaddr(kdf_addr); + } else { + size_t i; + + PRINT_FIELD_STR("{", kdf, hashname, tcp); + + /* + * Kernel doesn't touch otherinfo + * if otherinfolen is zero. + */ + if (kdf.otherinfolen) + PRINT_FIELD_STRN(", ", kdf, otherinfo, + kdf.otherinfolen, tcp); + else + PRINT_FIELD_PTR(", ", kdf, otherinfo); + + PRINT_FIELD_U(", ", kdf, otherinfolen); + + /* Some future-proofing */ + for (i = 0; i < ARRAY_SIZE(kdf.__spare); i++) { + if (kdf.__spare[i]) + break; + } + + if (i < ARRAY_SIZE(kdf.__spare)) { + tprints(", __spare=["); + + for (i = 0; i < ARRAY_SIZE(kdf.__spare); i++) { + if (i) + tprints(", "); + + tprintf("%#x", kdf.__spare[i]); + } + + tprints("]"); + } + + tprints("}"); + } } } +static void +keyctl_restrict_keyring(struct tcb *const tcp, + const key_serial_t id, + const kernel_ulong_t addr1, + const kernel_ulong_t addr2) +{ + print_keyring_serial_number(id); + tprints(", "); + printstr(tcp, addr1); + tprints(", "); + printstr(tcp, addr2); +} + #include "xlat/key_reqkeys.h" #include "xlat/keyctl_commands.h" @@ -336,7 +367,8 @@ SYS_FUNC(keyctl) break; case KEYCTL_SET_REQKEY_KEYRING: - printxval(key_reqkeys, arg2, "KEY_REQKEY_DEFL_???"); + printxvals_ex((int) arg2, "KEY_REQKEY_DEFL_???", + XLAT_STYLE_FMT_D, key_reqkeys, NULL); break; case KEYCTL_SET_TIMEOUT: @@ -359,9 +391,13 @@ SYS_FUNC(keyctl) break; case KEYCTL_DH_COMPUTE: - keyctl_dh_compute(tcp, arg2, arg3, arg4); + keyctl_dh_compute(tcp, arg2, arg3, arg4, arg5); return 0; + case KEYCTL_RESTRICT_KEYRING: + keyctl_restrict_keyring(tcp, arg2, arg3, arg4); + break; + default: tprintf("%#" PRI_klx ", %#" PRI_klx ", %#" PRI_klx ", %#" PRI_klx, diff --git a/keyctl_kdf_params.h b/keyctl_kdf_params.h new file mode 100644 index 00000000..80fff1a6 --- /dev/null +++ b/keyctl_kdf_params.h @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2017-2018 Eugene Syromyatnikov + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_KEYCTL_KDF_PARAMS_H +# define STRACE_KEYCTL_KDF_PARAMS_H + +# include +# include "kernel_types.h" + +/* from include/linux/crypto.h */ +# define CRYPTO_MAX_ALG_NAME 128 + +/* from security/keys/internal.h */ +# define KEYCTL_KDF_MAX_OI_LEN 64 /* max length of otherinfo */ + +struct keyctl_kdf_params { + char *hashname; + char *otherinfo; + uint32_t otherinfolen; + uint32_t __spare[8]; +}; + +struct strace_keyctl_kdf_params { + kernel_ulong_t hashname; + kernel_ulong_t otherinfo; + uint32_t otherinfolen; + uint32_t __spare[8]; +}; + +#endif /* STRACE_KEYCTL_KDF_PARAMS_H */ diff --git a/kill_save_errno.h b/kill_save_errno.h new file mode 100644 index 00000000..a777b9a4 --- /dev/null +++ b/kill_save_errno.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2012-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_KILL_SAVE_ERRNO_H +# define STRACE_KILL_SAVE_ERRNO_H + +# include +# include +# include + +static inline int +kill_save_errno(pid_t pid, int sig) +{ + int saved_errno = errno; + int rc = kill(pid, sig); + errno = saved_errno; + return rc; +} + +#endif /* !STRACE_KILL_SAVE_ERRNO_H */ diff --git a/kvm.c b/kvm.c new file mode 100644 index 00000000..984a75e8 --- /dev/null +++ b/kvm.c @@ -0,0 +1,419 @@ +/* + * Support for decoding of KVM_* ioctl commands. + * + * Copyright (c) 2017 Masatake YAMATO + * Copyright (c) 2017 Red Hat, Inc. + * Copyright (c) 2017-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#ifdef HAVE_LINUX_KVM_H +# include +# include "print_fields.h" +# include "arch_kvm.c" +# include "xmalloc.h" +# include "mmap_cache.h" + +struct vcpu_info { + struct vcpu_info *next; + int fd; + int cpuid; + long mmap_addr; + unsigned long mmap_len; + bool resolved; +}; + +static bool dump_kvm_run_structure; + +static struct vcpu_info * +vcpu_find(struct tcb *const tcp, int fd) +{ + for (struct vcpu_info *vcpu_info = tcp->vcpu_info_list; + vcpu_info; + vcpu_info = vcpu_info->next) + if (vcpu_info->fd == fd) + return vcpu_info; + + return NULL; +} + +static struct vcpu_info * +vcpu_alloc(struct tcb *const tcp, int fd, int cpuid) +{ + struct vcpu_info *vcpu_info = xzalloc(sizeof(*vcpu_info)); + + vcpu_info->fd = fd; + vcpu_info->cpuid = cpuid; + + vcpu_info->next = tcp->vcpu_info_list; + tcp->vcpu_info_list = vcpu_info; + + return vcpu_info; +} + +void +kvm_vcpu_info_free(struct tcb *tcp) +{ + struct vcpu_info *head, *next; + + for (head = tcp->vcpu_info_list; head; head = next) { + next = head->next; + free(head); + } + + tcp->vcpu_info_list = NULL; +} + +static void +vcpu_register(struct tcb *const tcp, int fd, int cpuid) +{ + if (fd < 0) + return; + + struct vcpu_info *vcpu_info = vcpu_find(tcp, fd); + + if (!vcpu_info) + vcpu_info = vcpu_alloc(tcp, fd, cpuid); + else if (vcpu_info->cpuid != cpuid) + { + vcpu_info->cpuid = cpuid; + vcpu_info->resolved = false; + } +} + +static bool +is_map_for_file(struct mmap_cache_entry_t *map_info, void *data) +{ + /* major version for anon inode may be given in get_anon_bdev() + * in linux kernel. + * + * *p = MKDEV(0, dev & MINORMASK); + *-----------------^ + */ + return map_info->binary_filename && + map_info->major == 0 && + strcmp(map_info->binary_filename, data) == 0; +} + +static unsigned long +map_len(struct mmap_cache_entry_t *map_info) +{ + return map_info->start_addr < map_info->end_addr + ? map_info->end_addr - map_info->start_addr + : 0; +} + +# define VCPU_DENTRY_PREFIX "anon_inode:kvm-vcpu:" + +static struct vcpu_info* +vcpu_get_info(struct tcb *const tcp, int fd) +{ + struct vcpu_info *vcpu_info = vcpu_find(tcp, fd); + struct mmap_cache_entry_t *map_info; + const char *cpuid_str; + + enum mmap_cache_rebuild_result mc_stat = + mmap_cache_rebuild_if_invalid(tcp, __func__); + if (mc_stat == MMAP_CACHE_REBUILD_NOCACHE) + return NULL; + + if (vcpu_info && vcpu_info->resolved) { + if (mc_stat == MMAP_CACHE_REBUILD_READY) + return vcpu_info; + else { + map_info = mmap_cache_search(tcp, vcpu_info->mmap_addr); + if (map_info) { + cpuid_str = + STR_STRIP_PREFIX(map_info->binary_filename, + VCPU_DENTRY_PREFIX); + if (cpuid_str != map_info->binary_filename) { + int cpuid = string_to_uint(cpuid_str); + if (cpuid < 0) + return NULL; + if (vcpu_info->cpuid == cpuid) + return vcpu_info; + } + } + + /* The vcpu vma may be mremap'ed. */ + vcpu_info->resolved = false; + } + } + + /* Slow path: !vcpu_info || !vcpu_info->resolved */ + char path[PATH_MAX + 1]; + cpuid_str = path; + if (getfdpath(tcp, fd, path, sizeof(path)) >= 0) + cpuid_str = STR_STRIP_PREFIX(path, VCPU_DENTRY_PREFIX); + if (cpuid_str == path) + map_info = NULL; + else + map_info = mmap_cache_search_custom(tcp, is_map_for_file, path); + + if (map_info) { + int cpuid = string_to_uint(cpuid_str); + if (cpuid < 0) + return NULL; + if (!vcpu_info) + vcpu_info = vcpu_alloc(tcp, fd, cpuid); + else if (vcpu_info->cpuid != cpuid) + vcpu_info->cpuid = cpuid; + vcpu_info->mmap_addr = map_info->start_addr; + vcpu_info->mmap_len = map_len(map_info); + vcpu_info->resolved = true; + return vcpu_info; + } + + return NULL; +} + +static int +kvm_ioctl_create_vcpu(struct tcb *const tcp, const kernel_ulong_t arg) +{ + uint32_t cpuid = arg; + + if (entering(tcp)) { + tprintf(", %u", cpuid); + if (dump_kvm_run_structure) + return 0; + } else if (!syserror(tcp)) { + vcpu_register(tcp, tcp->u_rval, cpuid); + } + + return RVAL_IOCTL_DECODED | RVAL_FD; +} + +# ifdef HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION +# include "xlat/kvm_mem_flags.h" +static int +kvm_ioctl_set_user_memory_region(struct tcb *const tcp, const kernel_ulong_t arg) +{ + struct kvm_userspace_memory_region u_memory_region; + + tprints(", "); + if (umove_or_printaddr(tcp, arg, &u_memory_region)) + return RVAL_IOCTL_DECODED; + + PRINT_FIELD_U("{", u_memory_region, slot); + PRINT_FIELD_FLAGS(", ", u_memory_region, flags, kvm_mem_flags, + "KVM_MEM_???"); + PRINT_FIELD_X(", ", u_memory_region, guest_phys_addr); + PRINT_FIELD_U(", ", u_memory_region, memory_size); + PRINT_FIELD_X(", ", u_memory_region, userspace_addr); + tprints("}"); + + return RVAL_IOCTL_DECODED; +} +# endif /* HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION */ + +# ifdef HAVE_STRUCT_KVM_REGS +static int +kvm_ioctl_decode_regs(struct tcb *const tcp, const unsigned int code, + const kernel_ulong_t arg) +{ + struct kvm_regs regs; + + if (code == KVM_GET_REGS && entering(tcp)) + return 0; + + tprints(", "); + if (!umove_or_printaddr(tcp, arg, ®s)) + arch_print_kvm_regs(tcp, arg, ®s); + + return RVAL_IOCTL_DECODED; +} +# endif /* HAVE_STRUCT_KVM_REGS */ + +# ifdef HAVE_STRUCT_KVM_CPUID2 +# include "xlat/kvm_cpuid_flags.h" +static bool +print_kvm_cpuid_entry(struct tcb *const tcp, + void* elem_buf, size_t elem_size, void* data) +{ + const struct kvm_cpuid_entry2 *entry = elem_buf; + PRINT_FIELD_X("{", *entry, function); + PRINT_FIELD_X(", ", *entry, index); + PRINT_FIELD_FLAGS(", ", *entry, flags, kvm_cpuid_flags, + "KVM_CPUID_FLAG_???"); + PRINT_FIELD_X(", ", *entry, eax); + PRINT_FIELD_X(", ", *entry, ebx); + PRINT_FIELD_X(", ", *entry, ecx); + PRINT_FIELD_X(", ", *entry, edx); + tprints("}"); + + return true; +} + +static int +kvm_ioctl_decode_cpuid2(struct tcb *const tcp, const unsigned int code, + const kernel_ulong_t arg) +{ + struct kvm_cpuid2 cpuid; + + if (entering(tcp) && (code == KVM_GET_SUPPORTED_CPUID +# ifdef KVM_GET_EMULATED_CPUID + || code == KVM_GET_EMULATED_CPUID +# endif + )) + return 0; + + tprints(", "); + if (!umove_or_printaddr(tcp, arg, &cpuid)) { + PRINT_FIELD_U("{", cpuid, nent); + + tprints(", entries="); + if (abbrev(tcp)) { + tprints("["); + if (cpuid.nent) + tprints("..."); + tprints("]"); + + } else { + struct kvm_cpuid_entry2 entry; + print_array(tcp, arg + sizeof(cpuid), cpuid.nent, + &entry, sizeof(entry), tfetch_mem, + print_kvm_cpuid_entry, NULL); + } + tprints("}"); + } + + return RVAL_IOCTL_DECODED; +} +# endif /* HAVE_STRUCT_KVM_CPUID2 */ + +# ifdef HAVE_STRUCT_KVM_SREGS +static int +kvm_ioctl_decode_sregs(struct tcb *const tcp, const unsigned int code, + const kernel_ulong_t arg) +{ + struct kvm_sregs sregs; + + if (code == KVM_GET_SREGS && entering(tcp)) + return 0; + + tprints(", "); + if (!umove_or_printaddr(tcp, arg, &sregs)) + arch_print_kvm_sregs(tcp, arg, &sregs); + + return RVAL_IOCTL_DECODED; +} +# endif /* HAVE_STRUCT_KVM_SREGS */ + +# include "xlat/kvm_cap.h" +static int +kvm_ioctl_decode_check_extension(struct tcb *const tcp, const unsigned int code, + const kernel_ulong_t arg) +{ + tprints(", "); + printxval_index(kvm_cap, arg, "KVM_CAP_???"); + return RVAL_IOCTL_DECODED; +} + +# include "xlat/kvm_exit_reason.h" +static void +kvm_ioctl_run_attach_auxstr(struct tcb *const tcp, + struct vcpu_info *info) + +{ + static struct kvm_run vcpu_run_struct; + + if (info->mmap_len < sizeof(vcpu_run_struct)) + return; + + if (umove(tcp, info->mmap_addr, &vcpu_run_struct) < 0) + return; + + tcp->auxstr = xlat_idx(kvm_exit_reason, ARRAY_SIZE(kvm_exit_reason) - 1, + vcpu_run_struct.exit_reason); + if (!tcp->auxstr) + tcp->auxstr = "KVM_EXIT_???"; +} + +static int +kvm_ioctl_decode_run(struct tcb *const tcp) +{ + + if (entering(tcp)) + return 0; + + int r = RVAL_DECODED; + + if (syserror(tcp)) + return r; + + if (dump_kvm_run_structure) { + tcp->auxstr = NULL; + int fd = tcp->u_arg[0]; + struct vcpu_info *info = vcpu_get_info(tcp, fd); + + if (info) { + kvm_ioctl_run_attach_auxstr(tcp, info); + if (tcp->auxstr) + r |= RVAL_STR; + } + } + + return r; +} + +int +kvm_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t arg) +{ + switch (code) { + case KVM_CREATE_VCPU: + return kvm_ioctl_create_vcpu(tcp, arg); + +# ifdef HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION + case KVM_SET_USER_MEMORY_REGION: + return kvm_ioctl_set_user_memory_region(tcp, arg); +# endif + +# ifdef HAVE_STRUCT_KVM_REGS + case KVM_SET_REGS: + case KVM_GET_REGS: + return kvm_ioctl_decode_regs(tcp, code, arg); +# endif + +# ifdef HAVE_STRUCT_KVM_SREGS + case KVM_SET_SREGS: + case KVM_GET_SREGS: + return kvm_ioctl_decode_sregs(tcp, code, arg); +# endif + +# ifdef HAVE_STRUCT_KVM_CPUID2 + case KVM_SET_CPUID2: + case KVM_GET_SUPPORTED_CPUID: +# ifdef KVM_GET_EMULATED_CPUID + case KVM_GET_EMULATED_CPUID: +# endif + return kvm_ioctl_decode_cpuid2(tcp, code, arg); +# endif + + case KVM_CHECK_EXTENSION: + return kvm_ioctl_decode_check_extension(tcp, code, arg); + + case KVM_CREATE_VM: + return RVAL_DECODED | RVAL_FD; + + case KVM_RUN: + return kvm_ioctl_decode_run(tcp); + + case KVM_GET_VCPU_MMAP_SIZE: + case KVM_GET_API_VERSION: + default: + return RVAL_DECODED; + } +} + +void +kvm_run_structure_decoder_init(void) +{ + dump_kvm_run_structure = true; + mmap_cache_enable(); +} + +#endif /* HAVE_LINUX_KVM_H */ diff --git a/largefile_wrappers.h b/largefile_wrappers.h new file mode 100644 index 00000000..902dc98a --- /dev/null +++ b/largefile_wrappers.h @@ -0,0 +1,44 @@ +/* + * Wrappers for handling discrepancies in LF64-themed syscalls availability and + * necessity between verious architectures and kernel veriosns. + * + * Copyright (c) 2012-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_LARGEFILE_WRAPPERS_H +# define STRACE_LARGEFILE_WRAPPERS_H + +# include "defs.h" + +# ifdef _LARGEFILE64_SOURCE +# ifdef HAVE_OPEN64 +# define open_file open64 +# else +# define open_file open +# endif +# ifdef HAVE_FOPEN64 +# define fopen_stream fopen64 +# else +# define fopen_stream fopen +# endif +# define strace_stat_t struct stat64 +# define stat_file stat64 +# define struct_dirent struct dirent64 +# define read_dir readdir64 +# define struct_rlimit struct rlimit64 +# define set_rlimit setrlimit64 +# else +# define open_file open +# define fopen_stream fopen +# define strace_stat_t struct stat +# define stat_file stat +# define struct_dirent struct dirent +# define read_dir readdir +# define struct_rlimit struct rlimit +# define set_rlimit setrlimit +# endif + +#endif /* STRACE_LARGEFILE_WRAPPERS_H */ diff --git a/ldt.c b/ldt.c index 91bdf15d..1d226f4b 100644 --- a/ldt.c +++ b/ldt.c @@ -6,29 +6,10 @@ * Copyright (c) 2002-2004 Roland McGrath * Copyright (c) 2010 Andreas Schwab * Copyright (c) 2014-2015 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -37,50 +18,130 @@ # include +# include "print_fields.h" +# include "xstring.h" + void -print_user_desc(struct tcb *const tcp, const kernel_ulong_t addr) +print_user_desc(struct tcb *const tcp, const kernel_ulong_t addr, + enum user_desc_print_filter filter) { struct user_desc desc; + unsigned *entry_number = get_tcb_priv_data(tcp); + + switch (filter) { + case USER_DESC_ENTERING: + if (umove_or_printaddr(tcp, addr, &desc.entry_number)) + return; + + break; + + case USER_DESC_EXITING: + if (!addr || !verbose(tcp)) + return; + if (syserror(tcp) || umove(tcp, addr, &desc)) { + if (entry_number) + tprints(", ...}"); + + return; + } + + break; + + case USER_DESC_BOTH: + if (umove_or_printaddr(tcp, addr, &desc)) + return; + + break; + } + + if (filter & USER_DESC_ENTERING) { + PRINT_FIELD_ID("{", desc, entry_number); + + /* + * If we don't print the whole structure now, let's save it for + * later. + */ + if (filter == USER_DESC_ENTERING) { + entry_number = xmalloc(sizeof(*entry_number)); - if (umove_or_printaddr(tcp, addr, &desc)) - return; - - tprintf("{entry_number:%d, " - "base_addr:%#08x, " - "limit:%d, " - "seg_32bit:%d, " - "contents:%d, " - "read_exec_only:%d, " - "limit_in_pages:%d, " - "seg_not_present:%d, " - "useable:%d}", - desc.entry_number, - desc.base_addr, - desc.limit, - desc.seg_32bit, - desc.contents, - desc.read_exec_only, - desc.limit_in_pages, - desc.seg_not_present, - desc.useable); + *entry_number = desc.entry_number; + set_tcb_priv_data(tcp, entry_number, free); + } + } + + if (filter & USER_DESC_EXITING) { + /* + * It should be the same in case of get_thread_area, but we can + * never be sure... + */ + if (filter == USER_DESC_EXITING) { + if (entry_number) { + if (*entry_number != desc.entry_number) { + if ((int) desc.entry_number == -1) + tprints(" => -1"); + else + tprintf(" => %u", + desc.entry_number); + } + } else { + /* + * This is really strange. If we are here, it + * means that we failed on entering but somehow + * succeeded on exiting. + */ + PRINT_FIELD_ID(" => {", desc, entry_number); + } + } + + PRINT_FIELD_0X(", ", desc, base_addr); + PRINT_FIELD_0X(", ", desc, limit); + PRINT_FIELD_U_CAST(", ", desc, seg_32bit, unsigned int); + PRINT_FIELD_U_CAST(", ", desc, contents, unsigned int); + PRINT_FIELD_U_CAST(", ", desc, read_exec_only, unsigned int); + PRINT_FIELD_U_CAST(", ", desc, limit_in_pages, unsigned int); + PRINT_FIELD_U_CAST(", ", desc, seg_not_present, unsigned int); + PRINT_FIELD_U_CAST(", ", desc, useable, unsigned int); + +# ifdef HAVE_STRUCT_USER_DESC_LM + /* lm is totally ignored for 32-bit processes */ + if (current_klongsize == 8) + PRINT_FIELD_U_CAST(", ", desc, lm, unsigned int); +# endif /* HAVE_STRUCT_USER_DESC_LM */ + + tprints("}"); + } } SYS_FUNC(modify_ldt) { - tprintf("%" PRI_kld ", ", tcp->u_arg[0]); - if (tcp->u_arg[2] != sizeof(struct user_desc)) - printaddr(tcp->u_arg[1]); - else - print_user_desc(tcp, tcp->u_arg[1]); - tprintf(", %" PRI_klu, tcp->u_arg[2]); + if (entering(tcp)) { + tprintf("%d, ", (int) tcp->u_arg[0]); + if (tcp->u_arg[2] != sizeof(struct user_desc)) + printaddr(tcp->u_arg[1]); + else + print_user_desc(tcp, tcp->u_arg[1], USER_DESC_BOTH); + tprintf(", %" PRI_klu, tcp->u_arg[2]); + + return 0; + } - return RVAL_DECODED; + /* + * For some reason ("tht ABI for sys_modify_ldt() expects + * 'int'"), modify_ldt clips higher bits on x86_64. + */ + + if (syserror(tcp) || (kernel_ulong_t) tcp->u_rval < 0xfffff000) + return 0; + + tcp->u_error = -(unsigned int) tcp->u_rval; + + return 0; } SYS_FUNC(set_thread_area) { if (entering(tcp)) { - print_user_desc(tcp, tcp->u_arg[0]); + print_user_desc(tcp, tcp->u_arg[0], USER_DESC_BOTH); } else { struct user_desc desc; @@ -90,7 +151,7 @@ SYS_FUNC(set_thread_area) } else { static char outstr[32]; - sprintf(outstr, "entry_number:%d", desc.entry_number); + xsprintf(outstr, "entry_number=%u", desc.entry_number); tcp->auxstr = outstr; return RVAL_STR; } @@ -100,8 +161,8 @@ SYS_FUNC(set_thread_area) SYS_FUNC(get_thread_area) { - if (exiting(tcp)) - print_user_desc(tcp, tcp->u_arg[0]); + print_user_desc(tcp, tcp->u_arg[0], + entering(tcp) ? USER_DESC_ENTERING : USER_DESC_EXITING); return 0; } diff --git a/link.c b/link.c index 68a13044..3171f9f9 100644 --- a/link.c +++ b/link.c @@ -5,30 +5,10 @@ * Copyright (c) 1996-1999 Wichert Akkerman * Copyright (c) 2006 Ulrich Drepper * Copyright (c) 2006 Bernhard Kaindl - * Copyright (c) 2006-2015 Dmitry V. Levin + * Copyright (c) 2006-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/linux/32/ioctls_inc.h b/linux/32/ioctls_inc.h index 27ae3f5c..84294ba0 100644 --- a/linux/32/ioctls_inc.h +++ b/linux/32/ioctls_inc.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #if defined M68K # include "32/ioctls_inc_align16.h" #elif defined X86_64 || defined X32 \ diff --git a/linux/32/ioctls_inc_align16.h b/linux/32/ioctls_inc_align16.h index 71c9d187..a58d10d9 100644 --- a/linux/32/ioctls_inc_align16.h +++ b/linux/32/ioctls_inc_align16.h @@ -34,11 +34,13 @@ { "asm-generic/ioctls.h", "TIOCGETD", 0, 0x5424, 0 }, { "asm-generic/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 }, { "asm-generic/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 }, +{ "asm-generic/ioctls.h", "TIOCGISO7816", _IOC_READ, 0x5442, 0x28 }, { "asm-generic/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 }, { "asm-generic/ioctls.h", "TIOCGPGRP", 0, 0x540F, 0 }, { "asm-generic/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 }, { "asm-generic/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 }, { "asm-generic/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGPTPEER", _IOC_NONE, 0x5441, 0x00 }, { "asm-generic/ioctls.h", "TIOCGRS485", 0, 0x542E, 0 }, { "asm-generic/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 }, { "asm-generic/ioctls.h", "TIOCGSID", 0, 0x5429, 0 }, @@ -65,6 +67,7 @@ { "asm-generic/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 }, { "asm-generic/ioctls.h", "TIOCSETD", 0, 0x5423, 0 }, { "asm-generic/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCSISO7816", _IOC_READ|_IOC_WRITE, 0x5443, 0x28 }, { "asm-generic/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 }, { "asm-generic/ioctls.h", "TIOCSPGRP", 0, 0x5410, 0 }, { "asm-generic/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 }, @@ -84,6 +87,7 @@ { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x6454, 0x20 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x11c }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 }, @@ -92,6 +96,8 @@ { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_SCHED", _IOC_WRITE, 0x6455, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_VM", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 }, { "drm/drm.h", "DRM_IOCTL_ADD_BUFS", _IOC_READ|_IOC_WRITE, 0x6416, 0x18 }, @@ -109,6 +115,8 @@ { "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 }, { "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 }, { "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_CRTC_GET_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643b, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_CRTC_QUEUE_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643c, 0x18 }, { "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x28 }, { "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 }, { "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 }, @@ -136,6 +144,7 @@ { "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 }, { "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 }, { "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c6, 0x18 }, { "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c }, { "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 }, { "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 }, @@ -152,10 +161,13 @@ { "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 }, { "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 }, { "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GET_LEASE", _IOC_READ|_IOC_WRITE, 0x64c8, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_LIST_LESSEES", _IOC_READ|_IOC_WRITE, 0x64c7, 0x10 }, { "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 }, { "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x1c }, { "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x14 }, { "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_REVOKE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c9, 0x04 }, { "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 }, { "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 }, { "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 }, @@ -177,6 +189,13 @@ { "drm/drm.h", "DRM_IOCTL_SG_ALLOC", _IOC_READ|_IOC_WRITE, 0x6438, 0x08 }, { "drm/drm.h", "DRM_IOCTL_SG_FREE", _IOC_WRITE, 0x6439, 0x08 }, { "drm/drm.h", "DRM_IOCTL_SWITCH_CTX", _IOC_WRITE, 0x6424, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_CREATE", _IOC_READ|_IOC_WRITE, 0x64bf, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_DESTROY", _IOC_READ|_IOC_WRITE, 0x64c0, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x64c2, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD", _IOC_READ|_IOC_WRITE, 0x64c1, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_RESET", _IOC_READ|_IOC_WRITE, 0x64c4, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_SIGNAL", _IOC_READ|_IOC_WRITE, 0x64c5, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_WAIT", _IOC_READ|_IOC_WRITE, 0x64c3, 0x20 }, { "drm/drm.h", "DRM_IOCTL_UNBLOCK", _IOC_READ|_IOC_WRITE, 0x6413, 0x04 }, { "drm/drm.h", "DRM_IOCTL_UNLOCK", _IOC_WRITE, 0x642b, 0x08 }, { "drm/drm.h", "DRM_IOCTL_UPDATE_DRAW", _IOC_WRITE, 0x643f, 0x14 }, @@ -186,10 +205,12 @@ { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, -{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x30 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_DOM", _IOC_READ|_IOC_WRITE, 0x644a, 0x48 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_SIG", _IOC_READ|_IOC_WRITE, 0x644b, 0x4a }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 }, @@ -197,10 +218,10 @@ { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_GET", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, -{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_CMD_CTRL", _IOC_READ|_IOC_WRITE, 0x6473, 0x08 }, -{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY", _IOC_READ|_IOC_WRITE, 0x6470, 0x50 }, -{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_QUEUE_BUF", _IOC_READ|_IOC_WRITE, 0x6472, 0x28 }, -{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY", _IOC_READ|_IOC_WRITE, 0x6471, 0x60 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_COMMIT", _IOC_READ|_IOC_WRITE, 0x6483, 0x20 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6481, 0x18 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_LIMITS", _IOC_READ|_IOC_WRITE, 0x6482, 0x20 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_RESOURCES", _IOC_READ|_IOC_WRITE, 0x6480, 0x10 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_VIDI_CONNECTION", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, { "drm/i810_drm.h", "DRM_IOCTL_I810_CLEAR", _IOC_WRITE, 0x6442, 0x0c }, { "drm/i810_drm.h", "DRM_IOCTL_I810_COPY", _IOC_WRITE, 0x6447, 0x0c }, @@ -233,6 +254,7 @@ { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_ENTERVT", _IOC_NONE, 0x6459, 0x00 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER", _IOC_WRITE, 0x6454, 0x28 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2", _IOC_WRITE, 0x6469, 0x40 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2_WR", _IOC_READ|_IOC_WRITE, 0x6469, 0x40 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_APERTURE", _IOC_READ, 0x6463, 0x10 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_CACHING", _IOC_READ|_IOC_WRITE, 0x6470, 0x08 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6462, 0x10 }, @@ -264,11 +286,17 @@ { "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_WAIT", _IOC_WRITE, 0x6445, 0x04 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_ATTRS", _IOC_READ|_IOC_WRITE, 0x6468, 0x2c }, { "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_PUT_IMAGE", _IOC_WRITE, 0x6467, 0x2c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_ADD_CONFIG", _IOC_WRITE, 0x6477, 0x48 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_OPEN", _IOC_WRITE, 0x6476, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_REMOVE_CONFIG", _IOC_WRITE, 0x6478, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_QUERY", _IOC_READ|_IOC_WRITE, 0x6479, 0x10 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_REG_READ", _IOC_READ|_IOC_WRITE, 0x6471, 0x10 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_SETPARAM", _IOC_WRITE, 0x6447, 0x08 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_SET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646b, 0x14 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_SET_VBLANK_PIPE", _IOC_WRITE, 0x644d, 0x04 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_VBLANK_SWAP", _IOC_READ|_IOC_WRITE, 0x644f, 0x0c }, +{ "drm/i915_drm.h", "I915_PERF_IOCTL_DISABLE", _IOC_NONE, 0x6901, 0x00 }, +{ "drm/i915_drm.h", "I915_PERF_IOCTL_ENABLE", _IOC_NONE, 0x6900, 0x00 }, { "drm/mga_drm.h", "DRM_IOCTL_MGA_BLIT", _IOC_WRITE, 0x6448, 0x34 }, { "drm/mga_drm.h", "DRM_IOCTL_MGA_CLEAR", _IOC_WRITE, 0x6444, 0x14 }, { "drm/mga_drm.h", "DRM_IOCTL_MGA_DMA_BOOTSTRAP", _IOC_READ|_IOC_WRITE, 0x644c, 0x1a }, @@ -284,17 +312,21 @@ { "drm/mga_drm.h", "DRM_IOCTL_MGA_WAIT_FENCE", _IOC_READ|_IOC_WRITE, 0x644b, 0x04 }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x04 }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 }, -{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, -{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x24 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x28 }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, -{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x18 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE", _IOC_WRITE, 0x644b, 0x04 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_NEW", _IOC_READ|_IOC_WRITE, 0x644a, 0x0c }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x1c }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6480, 0x30 }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_PUSHBUF", _IOC_READ|_IOC_WRITE, 0x6481, 0x40 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_SVM_BIND", _IOC_READ|_IOC_WRITE, 0x6449, 0x40 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_SVM_INIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 }, { "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x10 }, { "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x08 }, { "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 }, @@ -377,7 +409,7 @@ { "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_ALLOC", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, { "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_FREE", _IOC_WRITE, 0x6445, 0x10 }, { "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_INIT", _IOC_WRITE, 0x6456, 0x08 }, -{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_CLOSE_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6446, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_CLOSE_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6446, 0x08 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644d, 0x08 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 }, @@ -391,12 +423,26 @@ { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_INCR", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_READ", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_GET_BO_OFFSET", _IOC_READ|_IOC_WRITE, 0x6445, 0x08 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0x38 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_TFU", _IOC_WRITE, 0x6446, 0x44 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_LABEL_BO", _IOC_READ|_IOC_WRITE, 0x644a, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, -{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0xa0 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_CREATE", _IOC_READ|_IOC_WRITE, 0x644c, 0x18 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_DESTROY", _IOC_READ|_IOC_WRITE, 0x644d, 0x04 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_GET_VALUES", _IOC_READ|_IOC_WRITE, 0x644e, 0x0c }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0xb0 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_SEQNO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, { "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_ATTACH", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, @@ -415,7 +461,7 @@ { "drm/via_drm.h", "DRM_IOCTL_VIA_MAP_INIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x14 }, { "drm/via_drm.h", "DRM_IOCTL_VIA_PCICMD", _IOC_WRITE, 0x644a, 0x08 }, { "drm/via_drm.h", "DRM_IOCTL_VIA_WAIT_IRQ", _IOC_READ|_IOC_WRITE, 0x644d, 0x10 }, -{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_EXECBUFFER", _IOC_WRITE, 0x6442, 0x20 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_EXECBUFFER", _IOC_READ|_IOC_WRITE, 0x6442, 0x20 }, { "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, { "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6449, 0x18 }, { "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, @@ -451,9 +497,14 @@ { "linux/android/binder.h", "BC_REGISTER_LOOPER", _IOC_NONE, 0x630b, 0x00 }, { "linux/android/binder.h", "BC_RELEASE", _IOC_WRITE, 0x6306, 0x04 }, { "linux/android/binder.h", "BC_REPLY", _IOC_WRITE, 0x6301, 0x40 }, +{ "linux/android/binder.h", "BC_REPLY_SG", _IOC_WRITE, 0x6312, 0x48 }, { "linux/android/binder.h", "BC_REQUEST_DEATH_NOTIFICATION", _IOC_WRITE, 0x630e, 0x0c }, { "linux/android/binder.h", "BC_TRANSACTION", _IOC_WRITE, 0x6300, 0x40 }, +{ "linux/android/binder.h", "BC_TRANSACTION_SG", _IOC_WRITE, 0x6311, 0x48 }, +{ "linux/android/binder.h", "BINDER_GET_NODE_DEBUG_INFO", _IOC_READ|_IOC_WRITE, 0x620b, 0x18 }, +{ "linux/android/binder.h", "BINDER_GET_NODE_INFO_FOR_REF", _IOC_READ|_IOC_WRITE, 0x620c, 0x18 }, { "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR", _IOC_WRITE, 0x6207, 0x04 }, +{ "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR_EXT", _IOC_WRITE, 0x620d, 0x18 }, { "linux/android/binder.h", "BINDER_SET_IDLE_PRIORITY", _IOC_WRITE, 0x6206, 0x04 }, { "linux/android/binder.h", "BINDER_SET_IDLE_TIMEOUT", _IOC_WRITE, 0x6203, 0x08 }, { "linux/android/binder.h", "BINDER_SET_MAX_THREADS", _IOC_WRITE, 0x6205, 0x04 }, @@ -478,10 +529,14 @@ { "linux/android/binder.h", "BR_SPAWN_LOOPER", _IOC_NONE, 0x720d, 0x00 }, { "linux/android/binder.h", "BR_TRANSACTION", _IOC_READ, 0x7202, 0x40 }, { "linux/android/binder.h", "BR_TRANSACTION_COMPLETE", _IOC_NONE, 0x7206, 0x00 }, +{ "linux/android/binder.h", "BR_TRANSACTION_SEC_CTX", _IOC_READ, 0x7202, 0x48 }, +{ "linux/android/binderfs.h", "BINDER_CTL_ADD", _IOC_READ|_IOC_WRITE, 0x6201, 0x108 }, { "linux/apm_bios.h", "APM_IOC_STANDBY", _IOC_NONE, 0x4101, 0x00 }, { "linux/apm_bios.h", "APM_IOC_SUSPEND", _IOC_NONE, 0x4102, 0x00 }, { "linux/arcfb.h", "FBIO_GETCONTROL2", _IOC_READ, 0x4689, 0x04 }, { "linux/arcfb.h", "FBIO_WAITEVENT", _IOC_NONE, 0x4688, 0x00 }, +{ "linux/aspeed-lpc-ctrl.h", "ASPEED_LPC_CTRL_IOCTL_GET_SIZE", _IOC_READ|_IOC_WRITE, 0xb200, 0x10 }, +{ "linux/aspeed-lpc-ctrl.h", "ASPEED_LPC_CTRL_IOCTL_MAP", _IOC_WRITE, 0xb201, 0x10 }, { "linux/atm_eni.h", "ENI_MEMDUMP", _IOC_WRITE, 0x6160, 0x0c }, { "linux/atm_eni.h", "ENI_SETMULT", _IOC_WRITE, 0x6167, 0x0c }, { "linux/atm_he.h", "HE_GET_REG", _IOC_WRITE, 0x6160, 0x0c }, @@ -547,17 +602,19 @@ { "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_SETPIPEFD", _IOC_READ|_IOC_WRITE, 0x9378, 0x18 }, { "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_TIMEOUT", _IOC_READ|_IOC_WRITE, 0x937a, 0x18 }, { "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x9371, 0x18 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_ASKUMOUNT", _IOC_READ, 0x9370, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_CATATONIC", _IOC_NONE, 0x9362, 0x00 }, { "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE", _IOC_READ, 0x9365, 0x10c }, +{ "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE_MULTI", _IOC_WRITE, 0x9366, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_FAIL", _IOC_NONE, 0x9361, 0x00 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_PROTOSUBVER", _IOC_READ, 0x9367, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_PROTOVER", _IOC_READ, 0x9363, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_READY", _IOC_NONE, 0x9360, 0x00 }, { "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT", _IOC_READ|_IOC_WRITE, 0x9364, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT32", _IOC_READ|_IOC_WRITE, 0x9364, 0x04 }, -{ "linux/auto_fs4.h", "AUTOFS_IOC_ASKUMOUNT", _IOC_READ, 0x9370, 0x04 }, -{ "linux/auto_fs4.h", "AUTOFS_IOC_EXPIRE_MULTI", _IOC_WRITE, 0x9366, 0x04 }, -{ "linux/auto_fs4.h", "AUTOFS_IOC_PROTOSUBVER", _IOC_READ, 0x9367, 0x04 }, { "linux/blkpg.h", "BLKPG", _IOC_NONE, 0x1269, 0x00 }, +{ "linux/blkzoned.h", "BLKGETNRZONES", _IOC_READ, 0x1285, 0x04 }, +{ "linux/blkzoned.h", "BLKGETZONESZ", _IOC_READ, 0x1284, 0x04 }, { "linux/blkzoned.h", "BLKREPORTZONE", _IOC_READ|_IOC_WRITE, 0x1282, 0x10 }, { "linux/blkzoned.h", "BLKRESETZONE", _IOC_WRITE, 0x1283, 0x10 }, { "linux/bt-bmc.h", "BT_BMC_IOCTL_SMS_ATN", _IOC_NONE, 0xb100, 0x00 }, @@ -575,14 +632,18 @@ { "linux/btrfs.h", "BTRFS_IOC_DEV_INFO", _IOC_READ|_IOC_WRITE, 0x941e, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_DEV_REPLACE", _IOC_READ|_IOC_WRITE, 0x9435, 0xa22 }, { "linux/btrfs.h", "BTRFS_IOC_FILE_EXTENT_SAME", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 }, +{ "linux/btrfs.h", "BTRFS_IOC_FORGET_DEV", _IOC_WRITE, 0x9405, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_FS_INFO", _IOC_READ, 0x941f, 0x400 }, { "linux/btrfs.h", "BTRFS_IOC_GET_DEV_STATS", _IOC_READ|_IOC_WRITE, 0x9434, 0x408 }, { "linux/btrfs.h", "BTRFS_IOC_GET_FEATURES", _IOC_READ, 0x9439, 0x18 }, -{ "linux/btrfs.h", "BTRFS_IOC_GET_FSLABEL", _IOC_READ, 0x9431, 0x100 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_SUBVOL_INFO", _IOC_READ, 0x943c, 0x1e8 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_SUBVOL_ROOTREF", _IOC_READ|_IOC_WRITE, 0x943d, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_GET_SUPPORTED_FEATURES", _IOC_READ, 0x9439, 0x48 }, { "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP_USER", _IOC_READ|_IOC_WRITE, 0x943e, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 }, { "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 }, +{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO_V2", _IOC_READ|_IOC_WRITE, 0x943b, 0x38 }, { "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 }, { "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 }, { "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 }, @@ -599,7 +660,6 @@ { "linux/btrfs.h", "BTRFS_IOC_SCRUB_PROGRESS", _IOC_READ|_IOC_WRITE, 0x941d, 0x400 }, { "linux/btrfs.h", "BTRFS_IOC_SEND", _IOC_WRITE, 0x9426, 0x44 }, { "linux/btrfs.h", "BTRFS_IOC_SET_FEATURES", _IOC_WRITE, 0x9439, 0x30 }, -{ "linux/btrfs.h", "BTRFS_IOC_SET_FSLABEL", _IOC_WRITE, 0x9432, 0x100 }, { "linux/btrfs.h", "BTRFS_IOC_SET_RECEIVED_SUBVOL", _IOC_READ|_IOC_WRITE, 0x9425, 0xc0 }, { "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE", _IOC_WRITE, 0x9401, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE_V2", _IOC_WRITE, 0x9417, 0x1000 }, @@ -719,6 +779,7 @@ { "linux/cm4000_cs.h", "CM_IOCSRDR", _IOC_NONE, 0x6303, 0x00 }, { "linux/cm4000_cs.h", "CM_IOSDBGLVL", _IOC_WRITE, 0x63fa, 0x04 }, { "linux/coda.h", "CIOC_KERNEL_VERSION", _IOC_READ|_IOC_WRITE, 0x630a, 0x04 }, +{ "linux/dm-ioctl.h", "DM_DEV_ARM_POLL", _IOC_READ|_IOC_WRITE, 0xfd10, 0x138 }, { "linux/dm-ioctl.h", "DM_DEV_CREATE", _IOC_READ|_IOC_WRITE, 0xfd03, 0x138 }, { "linux/dm-ioctl.h", "DM_DEV_REMOVE", _IOC_READ|_IOC_WRITE, 0xfd04, 0x138 }, { "linux/dm-ioctl.h", "DM_DEV_RENAME", _IOC_READ|_IOC_WRITE, 0xfd05, 0x138 }, @@ -745,17 +806,13 @@ { "linux/dvb/audio.h", "AUDIO_CLEAR_BUFFER", _IOC_NONE, 0x6f0c, 0x00 }, { "linux/dvb/audio.h", "AUDIO_CONTINUE", _IOC_NONE, 0x6f04, 0x00 }, { "linux/dvb/audio.h", "AUDIO_GET_CAPABILITIES", _IOC_READ, 0x6f0b, 0x04 }, -{ "linux/dvb/audio.h", "AUDIO_GET_PTS", _IOC_READ, 0x6f13, 0x08 }, { "linux/dvb/audio.h", "AUDIO_GET_STATUS", _IOC_READ, 0x6f0a, 0x20 }, { "linux/dvb/audio.h", "AUDIO_PAUSE", _IOC_NONE, 0x6f03, 0x00 }, { "linux/dvb/audio.h", "AUDIO_PLAY", _IOC_NONE, 0x6f02, 0x00 }, { "linux/dvb/audio.h", "AUDIO_SELECT_SOURCE", _IOC_NONE, 0x6f05, 0x00 }, -{ "linux/dvb/audio.h", "AUDIO_SET_ATTRIBUTES", _IOC_WRITE, 0x6f11, 0x02 }, { "linux/dvb/audio.h", "AUDIO_SET_AV_SYNC", _IOC_NONE, 0x6f07, 0x00 }, { "linux/dvb/audio.h", "AUDIO_SET_BYPASS_MODE", _IOC_NONE, 0x6f08, 0x00 }, -{ "linux/dvb/audio.h", "AUDIO_SET_EXT_ID", _IOC_NONE, 0x6f10, 0x00 }, { "linux/dvb/audio.h", "AUDIO_SET_ID", _IOC_NONE, 0x6f0d, 0x00 }, -{ "linux/dvb/audio.h", "AUDIO_SET_KARAOKE", _IOC_WRITE, 0x6f12, 0x0c }, { "linux/dvb/audio.h", "AUDIO_SET_MIXER", _IOC_WRITE, 0x6f0e, 0x08 }, { "linux/dvb/audio.h", "AUDIO_SET_MUTE", _IOC_NONE, 0x6f06, 0x00 }, { "linux/dvb/audio.h", "AUDIO_SET_STREAMTYPE", _IOC_NONE, 0x6f0f, 0x00 }, @@ -767,16 +824,18 @@ { "linux/dvb/ca.h", "CA_RESET", _IOC_NONE, 0x6f80, 0x00 }, { "linux/dvb/ca.h", "CA_SEND_MSG", _IOC_WRITE, 0x6f85, 0x10c }, { "linux/dvb/ca.h", "CA_SET_DESCR", _IOC_WRITE, 0x6f86, 0x10 }, -{ "linux/dvb/ca.h", "CA_SET_PID", _IOC_WRITE, 0x6f87, 0x08 }, { "linux/dvb/dmx.h", "DMX_ADD_PID", _IOC_WRITE, 0x6f33, 0x02 }, -{ "linux/dvb/dmx.h", "DMX_GET_CAPS", _IOC_READ, 0x6f30, 0x08 }, +{ "linux/dvb/dmx.h", "DMX_DQBUF", _IOC_READ|_IOC_WRITE, 0x6f40, 0x18 }, +{ "linux/dvb/dmx.h", "DMX_EXPBUF", _IOC_READ|_IOC_WRITE, 0x6f3e, 0x0c }, { "linux/dvb/dmx.h", "DMX_GET_PES_PIDS", _IOC_READ, 0x6f2f, 0x0a }, { "linux/dvb/dmx.h", "DMX_GET_STC", _IOC_READ|_IOC_WRITE, 0x6f32, 0x10 }, +{ "linux/dvb/dmx.h", "DMX_QBUF", _IOC_READ|_IOC_WRITE, 0x6f3f, 0x18 }, +{ "linux/dvb/dmx.h", "DMX_QUERYBUF", _IOC_READ|_IOC_WRITE, 0x6f3d, 0x18 }, { "linux/dvb/dmx.h", "DMX_REMOVE_PID", _IOC_WRITE, 0x6f34, 0x02 }, +{ "linux/dvb/dmx.h", "DMX_REQBUFS", _IOC_READ|_IOC_WRITE, 0x6f3c, 0x08 }, { "linux/dvb/dmx.h", "DMX_SET_BUFFER_SIZE", _IOC_NONE, 0x6f2d, 0x00 }, { "linux/dvb/dmx.h", "DMX_SET_FILTER", _IOC_WRITE, 0x6f2b, 0x3a }, { "linux/dvb/dmx.h", "DMX_SET_PES_FILTER", _IOC_WRITE, 0x6f2c, 0x12 }, -{ "linux/dvb/dmx.h", "DMX_SET_SOURCE", _IOC_WRITE, 0x6f31, 0x04 }, { "linux/dvb/dmx.h", "DMX_START", _IOC_NONE, 0x6f29, 0x00 }, { "linux/dvb/dmx.h", "DMX_STOP", _IOC_NONE, 0x6f2a, 0x00 }, { "linux/dvb/frontend.h", "FE_DISEQC_RECV_SLAVE_REPLY", _IOC_READ, 0x6f40, 0x0a }, @@ -812,23 +871,15 @@ { "linux/dvb/video.h", "VIDEO_GET_CAPABILITIES", _IOC_READ, 0x6f21, 0x04 }, { "linux/dvb/video.h", "VIDEO_GET_EVENT", _IOC_READ, 0x6f1c, 0x14 }, { "linux/dvb/video.h", "VIDEO_GET_FRAME_COUNT", _IOC_READ, 0x6f3a, 0x08 }, -{ "linux/dvb/video.h", "VIDEO_GET_FRAME_RATE", _IOC_READ, 0x6f38, 0x04 }, -{ "linux/dvb/video.h", "VIDEO_GET_NAVI", _IOC_READ, 0x6f34, 0x404 }, { "linux/dvb/video.h", "VIDEO_GET_PTS", _IOC_READ, 0x6f39, 0x08 }, { "linux/dvb/video.h", "VIDEO_GET_SIZE", _IOC_READ, 0x6f37, 0x0c }, { "linux/dvb/video.h", "VIDEO_GET_STATUS", _IOC_READ, 0x6f1b, 0x14 }, { "linux/dvb/video.h", "VIDEO_PLAY", _IOC_NONE, 0x6f16, 0x00 }, { "linux/dvb/video.h", "VIDEO_SELECT_SOURCE", _IOC_NONE, 0x6f19, 0x00 }, -{ "linux/dvb/video.h", "VIDEO_SET_ATTRIBUTES", _IOC_NONE, 0x6f35, 0x00 }, { "linux/dvb/video.h", "VIDEO_SET_BLANK", _IOC_NONE, 0x6f1a, 0x00 }, { "linux/dvb/video.h", "VIDEO_SET_DISPLAY_FORMAT", _IOC_NONE, 0x6f1d, 0x00 }, { "linux/dvb/video.h", "VIDEO_SET_FORMAT", _IOC_NONE, 0x6f25, 0x00 }, -{ "linux/dvb/video.h", "VIDEO_SET_HIGHLIGHT", _IOC_WRITE, 0x6f27, 0x10 }, -{ "linux/dvb/video.h", "VIDEO_SET_ID", _IOC_NONE, 0x6f23, 0x00 }, -{ "linux/dvb/video.h", "VIDEO_SET_SPU", _IOC_WRITE, 0x6f32, 0x08 }, -{ "linux/dvb/video.h", "VIDEO_SET_SPU_PALETTE", _IOC_WRITE, 0x6f33, 0x08 }, { "linux/dvb/video.h", "VIDEO_SET_STREAMTYPE", _IOC_NONE, 0x6f24, 0x00 }, -{ "linux/dvb/video.h", "VIDEO_SET_SYSTEM", _IOC_NONE, 0x6f26, 0x00 }, { "linux/dvb/video.h", "VIDEO_SLOWMOTION", _IOC_NONE, 0x6f20, 0x00 }, { "linux/dvb/video.h", "VIDEO_STILLPICTURE", _IOC_WRITE, 0x6f1e, 0x08 }, { "linux/dvb/video.h", "VIDEO_STOP", _IOC_NONE, 0x6f15, 0x00 }, @@ -901,6 +952,14 @@ { "linux/firewire-cdev.h", "FW_CDEV_IOC_SET_ISO_CHANNELS", _IOC_WRITE, 0x2317, 0x0c }, { "linux/firewire-cdev.h", "FW_CDEV_IOC_START_ISO", _IOC_WRITE, 0x230a, 0x10 }, { "linux/firewire-cdev.h", "FW_CDEV_IOC_STOP_ISO", _IOC_WRITE, 0x230b, 0x04 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_CHECK_EXTENSION", _IOC_NONE, 0xb601, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_PR", _IOC_NONE, 0xb680, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_GET_API_VERSION", _IOC_NONE, 0xb600, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_MAP", _IOC_NONE, 0xb643, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_UNMAP", _IOC_NONE, 0xb644, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_INFO", _IOC_NONE, 0xb641, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_REGION_INFO", _IOC_NONE, 0xb642, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_RESET", _IOC_NONE, 0xb640, 0x00 }, { "linux/fs.h", "BLKALIGNOFF", _IOC_NONE, 0x127a, 0x00 }, { "linux/fs.h", "BLKBSZGET", _IOC_READ, 0x1270, 0x04 }, { "linux/fs.h", "BLKBSZSET", _IOC_WRITE, 0x1271, 0x04 }, @@ -945,12 +1004,18 @@ { "linux/fs.h", "FS_IOC_FSGETXATTR", _IOC_READ, 0x581f, 0x1c }, { "linux/fs.h", "FS_IOC_FSSETXATTR", _IOC_WRITE, 0x5820, 0x1c }, { "linux/fs.h", "FS_IOC_GETFLAGS", _IOC_READ, 0x6601, 0x04 }, +{ "linux/fs.h", "FS_IOC_GETFSLABEL", _IOC_READ, 0x9431, 0x100 }, { "linux/fs.h", "FS_IOC_GETVERSION", _IOC_READ, 0x7601, 0x04 }, { "linux/fs.h", "FS_IOC_GET_ENCRYPTION_POLICY", _IOC_WRITE, 0x6615, 0x0c }, { "linux/fs.h", "FS_IOC_GET_ENCRYPTION_PWSALT", _IOC_WRITE, 0x6614, 0x10 }, { "linux/fs.h", "FS_IOC_SETFLAGS", _IOC_WRITE, 0x6602, 0x04 }, +{ "linux/fs.h", "FS_IOC_SETFSLABEL", _IOC_WRITE, 0x9432, 0x100 }, { "linux/fs.h", "FS_IOC_SETVERSION", _IOC_WRITE, 0x7602, 0x04 }, { "linux/fs.h", "FS_IOC_SET_ENCRYPTION_POLICY", _IOC_READ, 0x6613, 0x0c }, +{ "linux/fsi.h", "FSI_SCOM_CHECK", _IOC_READ, 0x7300, 0x04 }, +{ "linux/fsi.h", "FSI_SCOM_READ", _IOC_READ|_IOC_WRITE, 0x7301, 0x1e }, +{ "linux/fsi.h", "FSI_SCOM_RESET", _IOC_WRITE, 0x7303, 0x04 }, +{ "linux/fsi.h", "FSI_SCOM_WRITE", _IOC_READ|_IOC_WRITE, 0x7302, 0x1e }, { "linux/fsl-diu-fb.h", "MFB_GET_ALPHA", _IOC_READ, 0x4d00, 0x01 }, { "linux/fsl-diu-fb.h", "MFB_GET_AOID", _IOC_READ, 0x4d04, 0x08 }, { "linux/fsl-diu-fb.h", "MFB_GET_GAMMA", _IOC_READ, 0x4d01, 0x01 }, @@ -969,6 +1034,7 @@ { "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_START", _IOC_READ|_IOC_WRITE, 0xaf03, 0x10 }, { "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_STOP", _IOC_READ|_IOC_WRITE, 0xaf04, 0x08 }, { "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_SETPROP", _IOC_READ|_IOC_WRITE, 0xaf08, 0x28 }, +{ "linux/fsmap.h", "FS_IOC_GETFSMAP", _IOC_READ|_IOC_WRITE, 0x583b, 0xc0 }, { "linux/fuse.h", "FUSE_DEV_IOC_CLONE", _IOC_READ, 0xe500, 0x04 }, { "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_DDCB", _IOC_READ|_IOC_WRITE, 0xa532, 0xe8 }, { "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_RAW_DDCB", _IOC_READ|_IOC_WRITE, 0xa533, 0xe8 }, @@ -1105,7 +1171,9 @@ { "linux/if_tun.h", "TUNGETVNETBE", _IOC_READ, 0x54df, 0x04 }, { "linux/if_tun.h", "TUNGETVNETHDRSZ", _IOC_READ, 0x54d7, 0x04 }, { "linux/if_tun.h", "TUNGETVNETLE", _IOC_READ, 0x54dd, 0x04 }, +{ "linux/if_tun.h", "TUNSETCARRIER", _IOC_WRITE, 0x54e2, 0x04 }, { "linux/if_tun.h", "TUNSETDEBUG", _IOC_WRITE, 0x54c9, 0x04 }, +{ "linux/if_tun.h", "TUNSETFILTEREBPF", _IOC_READ, 0x54e1, 0x04 }, { "linux/if_tun.h", "TUNSETGROUP", _IOC_WRITE, 0x54ce, 0x04 }, { "linux/if_tun.h", "TUNSETIFF", _IOC_WRITE, 0x54ca, 0x04 }, { "linux/if_tun.h", "TUNSETIFINDEX", _IOC_WRITE, 0x54da, 0x04 }, @@ -1116,11 +1184,13 @@ { "linux/if_tun.h", "TUNSETPERSIST", _IOC_WRITE, 0x54cb, 0x04 }, { "linux/if_tun.h", "TUNSETQUEUE", _IOC_WRITE, 0x54d9, 0x04 }, { "linux/if_tun.h", "TUNSETSNDBUF", _IOC_WRITE, 0x54d4, 0x04 }, +{ "linux/if_tun.h", "TUNSETSTEERINGEBPF", _IOC_READ, 0x54e0, 0x04 }, { "linux/if_tun.h", "TUNSETTXFILTER", _IOC_WRITE, 0x54d1, 0x04 }, { "linux/if_tun.h", "TUNSETVNETBE", _IOC_WRITE, 0x54de, 0x04 }, { "linux/if_tun.h", "TUNSETVNETHDRSZ", _IOC_WRITE, 0x54d8, 0x04 }, { "linux/if_tun.h", "TUNSETVNETLE", _IOC_WRITE, 0x54dc, 0x04 }, { "linux/iio/events.h", "IIO_GET_EVENT_FD_IOCTL", _IOC_READ, 0x6990, 0x04 }, +{ "linux/inotify.h", "INOTIFY_IOC_SETNEXTWD", _IOC_WRITE, 0x4900, 0x04 }, { "linux/input.h", "EVIOCGEFFECTS", _IOC_READ, 0x4584, 0x04 }, { "linux/input.h", "EVIOCGID", _IOC_READ, 0x4502, 0x08 }, { "linux/input.h", "EVIOCGKEYCODE", _IOC_READ, 0x4504, 0x08 }, @@ -1158,6 +1228,9 @@ { "linux/ipmi.h", "IPMICTL_SET_TIMING_PARMS_CMD", _IOC_READ, 0x6916, 0x08 }, { "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD", _IOC_READ, 0x690f, 0x02 }, { "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691d, 0x0c }, +{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_CLEAR_SMS_ATN", _IOC_NONE, 0xb101, 0x00 }, +{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_FORCE_ABORT", _IOC_NONE, 0xb102, 0x00 }, +{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_SET_SMS_ATN", _IOC_NONE, 0xb100, 0x00 }, { "linux/isdn.h", "IIOCDBGVAR", _IOC_NONE, 0x497f, 0x00 }, { "linux/isdn.h", "IIOCDRVCTL", _IOC_NONE, 0x4980, 0x00 }, { "linux/isdn.h", "IIOCGETCPS", _IOC_NONE, 0x4915, 0x00 }, @@ -1199,48 +1272,6 @@ { "linux/ivtv.h", "IVTV_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x38 }, { "linux/ivtv.h", "IVTV_IOC_PASSTHROUGH_MODE", _IOC_WRITE, 0x56c1, 0x04 }, { "linux/ivtvfb.h", "IVTVFB_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x0c }, -{ "linux/ixjuser.h", "IXJCTL_AEC_GET_LEVEL", _IOC_NONE, 0x71cd, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_AEC_START", _IOC_WRITE, 0x71cb, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_AEC_STOP", _IOC_NONE, 0x71cc, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_CARDTYPE", _IOC_READ, 0x71c1, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_CID", _IOC_READ, 0x71d4, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_CIDCW", _IOC_WRITE, 0x71d9, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DAA_AGAIN", _IOC_WRITE, 0x71d2, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DAA_COEFF_SET", _IOC_WRITE, 0x71d0, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DRYBUFFER_CLEAR", _IOC_NONE, 0x71e7, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_DRYBUFFER_READ", _IOC_READ, 0x71e6, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DSP_IDLE", _IOC_NONE, 0x71c5, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_DSP_RESET", _IOC_NONE, 0x71c0, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_DSP_TYPE", _IOC_READ, 0x71c3, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DSP_VERSION", _IOC_READ, 0x71c4, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DTMF_PRESCALE", _IOC_WRITE, 0x71e8, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_FILTER_CADENCE", _IOC_WRITE, 0x71d6, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_FRAMES_READ", _IOC_READ, 0x71e2, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_FRAMES_WRITTEN", _IOC_READ, 0x71e3, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_GET_FILTER_HIST", _IOC_WRITE, 0x71c8, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_HZ", _IOC_WRITE, 0x71e0, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_INIT_TONE", _IOC_WRITE, 0x71c9, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_INTERCOM_START", _IOC_WRITE, 0x71fd, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_INTERCOM_STOP", _IOC_WRITE, 0x71fe, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_MIXER", _IOC_WRITE, 0x71cf, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_PLAY_CID", _IOC_NONE, 0x71d7, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_PORT", _IOC_WRITE, 0x71d1, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_POTS_PSTN", _IOC_WRITE, 0x71d5, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_PSTN_LINETEST", _IOC_NONE, 0x71d3, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_RATE", _IOC_WRITE, 0x71e1, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_READ_WAIT", _IOC_READ, 0x71e4, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SC_RXG", _IOC_WRITE, 0x71ea, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SC_TXG", _IOC_WRITE, 0x71eb, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SERIAL", _IOC_READ, 0x71c2, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SET_FILTER", _IOC_WRITE, 0x71c7, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SET_FILTER_RAW", _IOC_WRITE, 0x71dd, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SET_LED", _IOC_WRITE, 0x71ce, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SIGCTL", _IOC_WRITE, 0x71e9, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_TESTRAM", _IOC_NONE, 0x71c6, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_TONE_CADENCE", _IOC_WRITE, 0x71ca, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_VERSION", _IOC_READ, 0x71da, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_VMWI", _IOC_READ, 0x71d8, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_WRITE_WAIT", _IOC_READ, 0x71e5, 0x04 }, { "linux/joystick.h", "JSIOCGAXES", _IOC_READ, 0x6a11, 0x01 }, { "linux/joystick.h", "JSIOCGAXMAP", _IOC_READ, 0x6a32, 0x40 }, { "linux/joystick.h", "JSIOCGBTNMAP", _IOC_READ, 0x6a34, 0x400 }, @@ -1299,6 +1330,8 @@ { "linux/kd.h", "PIO_UNIMAP", 0, 0x4B67, 0 }, { "linux/kd.h", "PIO_UNIMAPCLR", 0, 0x4B68, 0 }, { "linux/kd.h", "PIO_UNISCRNMAP", 0, 0x4B6A, 0 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ACQUIRE_VM", _IOC_WRITE, 0x4b15, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ALLOC_MEMORY_OF_GPU", _IOC_READ|_IOC_WRITE, 0x4b16, 0x28 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_EVENT", _IOC_READ|_IOC_WRITE, 0x4b08, 0x20 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b02, 0x58 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_ADDRESS_WATCH", _IOC_WRITE, 0x4b0f, 0x10 }, @@ -1307,14 +1340,28 @@ { "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_WAVE_CONTROL", _IOC_WRITE, 0x4b10, 0x10 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_EVENT", _IOC_WRITE, 0x4b09, 0x08 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b03, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_FREE_MEMORY_OF_GPU", _IOC_WRITE, 0x4b17, 0x08 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_CLOCK_COUNTERS", _IOC_READ|_IOC_WRITE, 0x4b05, 0x28 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_DMABUF_INFO", _IOC_READ|_IOC_WRITE, 0x4b1c, 0x20 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES", _IOC_READ, 0x4b06, 0x190 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES_NEW", _IOC_READ|_IOC_WRITE, 0x4b14, 0x10 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_QUEUE_WAVE_STATE", _IOC_READ|_IOC_WRITE, 0x4b1b, 0x18 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_TILE_CONFIG", _IOC_READ|_IOC_WRITE, 0x4b12, 0x28 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_VERSION", _IOC_READ, 0x4b01, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_IMPORT_DMABUF", _IOC_READ|_IOC_WRITE, 0x4b1d, 0x18 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_MAP_MEMORY_TO_GPU", _IOC_READ|_IOC_WRITE, 0x4b18, 0x18 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_RESET_EVENT", _IOC_WRITE, 0x4b0b, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_CU_MASK", _IOC_WRITE, 0x4b1a, 0x10 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_EVENT", _IOC_WRITE, 0x4b0a, 0x08 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_MEMORY_POLICY", _IOC_WRITE, 0x4b04, 0x20 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_SCRATCH_BACKING_VA", _IOC_READ|_IOC_WRITE, 0x4b11, 0x10 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_TRAP_HANDLER", _IOC_WRITE, 0x4b13, 0x18 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_UNMAP_MEMORY_FROM_GPU", _IOC_READ|_IOC_WRITE, 0x4b19, 0x18 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_UPDATE_QUEUE", _IOC_WRITE, 0x4b07, 0x18 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_WAIT_EVENTS", _IOC_READ|_IOC_WRITE, 0x4b0c, 0x18 }, +{ "linux/lightnvm.h", "NVME_NVM_IOCTL_ADMIN_VIO", _IOC_READ|_IOC_WRITE, 0x4c41, 0x50 }, +{ "linux/lightnvm.h", "NVME_NVM_IOCTL_IO_VIO", _IOC_READ|_IOC_WRITE, 0x4c43, 0x50 }, +{ "linux/lightnvm.h", "NVME_NVM_IOCTL_SUBMIT_VIO", _IOC_READ|_IOC_WRITE, 0x4c42, 0x40 }, { "linux/lightnvm.h", "NVM_DEV_CREATE", _IOC_WRITE, 0x4c22, 0x80 }, { "linux/lightnvm.h", "NVM_DEV_FACTORY", _IOC_WRITE, 0x4c25, 0x24 }, { "linux/lightnvm.h", "NVM_DEV_INIT", _IOC_WRITE, 0x4c24, 0x2c }, @@ -1327,6 +1374,7 @@ { "linux/lirc.h", "LIRC_GET_MIN_TIMEOUT", _IOC_READ, 0x6908, 0x04 }, { "linux/lirc.h", "LIRC_GET_REC_MODE", _IOC_READ, 0x6902, 0x04 }, { "linux/lirc.h", "LIRC_GET_REC_RESOLUTION", _IOC_READ, 0x6907, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_REC_TIMEOUT", _IOC_READ, 0x6924, 0x04 }, { "linux/lirc.h", "LIRC_GET_SEND_MODE", _IOC_READ, 0x6901, 0x04 }, { "linux/lirc.h", "LIRC_SET_MEASURE_CARRIER_MODE", _IOC_WRITE, 0x691d, 0x04 }, { "linux/lirc.h", "LIRC_SET_REC_CARRIER", _IOC_WRITE, 0x6914, 0x04 }, @@ -1346,11 +1394,13 @@ { "linux/loop.h", "LOOP_CTL_REMOVE", 0, 0x4C81, 0 }, { "linux/loop.h", "LOOP_GET_STATUS", 0, 0x4C03, 0 }, { "linux/loop.h", "LOOP_GET_STATUS64", 0, 0x4C05, 0 }, +{ "linux/loop.h", "LOOP_SET_BLOCK_SIZE", 0, 0x4C09, 0 }, { "linux/loop.h", "LOOP_SET_CAPACITY", 0, 0x4C07, 0 }, { "linux/loop.h", "LOOP_SET_DIRECT_IO", 0, 0x4C08, 0 }, { "linux/loop.h", "LOOP_SET_FD", 0, 0x4C00, 0 }, { "linux/loop.h", "LOOP_SET_STATUS", 0, 0x4C02, 0 }, { "linux/loop.h", "LOOP_SET_STATUS64", 0, 0x4C04, 0 }, +{ "linux/lp.h", "LPSETTIMEOUT_NEW", _IOC_WRITE, 0x060f, 0x10 }, { "linux/mISDNif.h", "IMADDTIMER", _IOC_READ, 0x4940, 0x04 }, { "linux/mISDNif.h", "IMCLEAR_L2", _IOC_READ, 0x4946, 0x04 }, { "linux/mISDNif.h", "IMCTRLREQ", _IOC_READ, 0x4945, 0x04 }, @@ -1370,7 +1420,10 @@ { "linux/media.h", "MEDIA_IOC_ENUM_ENTITIES", _IOC_READ|_IOC_WRITE, 0x7c01, 0x100 }, { "linux/media.h", "MEDIA_IOC_ENUM_LINKS", _IOC_READ|_IOC_WRITE, 0x7c02, 0x1c }, { "linux/media.h", "MEDIA_IOC_G_TOPOLOGY", _IOC_READ|_IOC_WRITE, 0x7c04, 0x48 }, +{ "linux/media.h", "MEDIA_IOC_REQUEST_ALLOC", _IOC_READ, 0x7c05, 0x04 }, { "linux/media.h", "MEDIA_IOC_SETUP_LINK", _IOC_READ|_IOC_WRITE, 0x7c03, 0x30 }, +{ "linux/media.h", "MEDIA_REQUEST_IOC_QUEUE", _IOC_NONE, 0x7c80, 0x00 }, +{ "linux/media.h", "MEDIA_REQUEST_IOC_REINIT", _IOC_NONE, 0x7c81, 0x00 }, { "linux/mei.h", "IOCTL_MEI_CONNECT_CLIENT", _IOC_READ|_IOC_WRITE, 0x4801, 0x10 }, { "linux/mei.h", "IOCTL_MEI_NOTIFY_GET", _IOC_READ, 0x4803, 0x04 }, { "linux/mei.h", "IOCTL_MEI_NOTIFY_SET", _IOC_WRITE, 0x4802, 0x04 }, @@ -1410,26 +1463,6 @@ { "linux/nbd.h", "NBD_SET_SIZE_BLOCKS", _IOC_NONE, 0xab07, 0x00 }, { "linux/nbd.h", "NBD_SET_SOCK", _IOC_NONE, 0xab00, 0x00 }, { "linux/nbd.h", "NBD_SET_TIMEOUT", _IOC_NONE, 0xab09, 0x00 }, -{ "linux/ncp_fs.h", "NCP_IOC_CONN_LOGGED_IN", _IOC_NONE, 0x6e03, 0x00 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETCHARSETS", _IOC_READ|_IOC_WRITE, 0x6e0b, 0x2a }, -{ "linux/ncp_fs.h", "NCP_IOC_GETDENTRYTTL", _IOC_WRITE, 0x6e0c, 0x04 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID", _IOC_WRITE, 0x6e02, 0x02 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID2", _IOC_WRITE, 0x6e02, 0x04 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETOBJECTNAME", _IOC_READ|_IOC_WRITE, 0x6e09, 0x0c }, -{ "linux/ncp_fs.h", "NCP_IOC_GETPRIVATEDATA", _IOC_READ|_IOC_WRITE, 0x6e0a, 0x08 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETROOT", _IOC_WRITE, 0x6e08, 0x0c }, -{ "linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO", _IOC_READ|_IOC_WRITE, 0x6e04, 0x26 }, -{ "linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO_V2", _IOC_READ|_IOC_WRITE, 0x6e04, 0x24 }, -{ "linux/ncp_fs.h", "NCP_IOC_LOCKUNLOCK", _IOC_READ, 0x6e07, 0x14 }, -{ "linux/ncp_fs.h", "NCP_IOC_NCPREQUEST", _IOC_READ, 0x6e01, 0x0c }, -{ "linux/ncp_fs.h", "NCP_IOC_SETCHARSETS", _IOC_READ, 0x6e0b, 0x2a }, -{ "linux/ncp_fs.h", "NCP_IOC_SETDENTRYTTL", _IOC_READ, 0x6e0c, 0x04 }, -{ "linux/ncp_fs.h", "NCP_IOC_SETOBJECTNAME", _IOC_READ, 0x6e09, 0x0c }, -{ "linux/ncp_fs.h", "NCP_IOC_SETPRIVATEDATA", _IOC_READ, 0x6e0a, 0x08 }, -{ "linux/ncp_fs.h", "NCP_IOC_SETROOT", _IOC_READ, 0x6e08, 0x0c }, -{ "linux/ncp_fs.h", "NCP_IOC_SET_SIGN_WANTED", _IOC_WRITE, 0x6e06, 0x04 }, -{ "linux/ncp_fs.h", "NCP_IOC_SIGN_INIT", _IOC_READ, 0x6e05, 0x18 }, -{ "linux/ncp_fs.h", "NCP_IOC_SIGN_WANTED", _IOC_READ, 0x6e06, 0x04 }, { "linux/ndctl.h", "ND_IOCTL_ARS_CAP", _IOC_READ|_IOC_WRITE, 0x4e01, 0x20 }, { "linux/ndctl.h", "ND_IOCTL_ARS_START", _IOC_READ|_IOC_WRITE, 0x4e02, 0x20 }, { "linux/ndctl.h", "ND_IOCTL_ARS_STATUS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x30 }, @@ -1439,8 +1472,6 @@ { "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e05, 0x0c }, { "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_SIZE", _IOC_READ|_IOC_WRITE, 0x4e04, 0x0c }, { "linux/ndctl.h", "ND_IOCTL_SET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e06, 0x08 }, -{ "linux/ndctl.h", "ND_IOCTL_SMART", _IOC_READ|_IOC_WRITE, 0x4e01, 0x84 }, -{ "linux/ndctl.h", "ND_IOCTL_SMART_THRESHOLD", _IOC_READ|_IOC_WRITE, 0x4e02, 0x0c }, { "linux/ndctl.h", "ND_IOCTL_VENDOR", _IOC_READ|_IOC_WRITE, 0x4e09, 0x08 }, { "linux/nilfs2_api.h", "NILFS_IOCTL_CHANGE_CPMODE", _IOC_WRITE, 0x6e80, 0x10 }, { "linux/nilfs2_api.h", "NILFS_IOCTL_CLEAN_SEGMENTS", _IOC_WRITE, 0x6e88, 0x78 }, @@ -1455,6 +1486,8 @@ { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 }, { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 }, { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 }, +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 }, +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 }, { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 }, { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 }, { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 0x4e41, 0x48 }, @@ -1473,6 +1506,7 @@ { "linux/omap3isp.h", "VIDIOC_OMAP3ISP_PRV_CFG", _IOC_READ|_IOC_WRITE, 0x56c2, 0x3c }, { "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_EN", _IOC_READ|_IOC_WRITE, 0x56c7, 0x04 }, { "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_REQ", _IOC_READ|_IOC_WRITE, 0x56c6, 0x16 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_REQ_TIME32", _IOC_READ|_IOC_WRITE, 0x56c6, 0x16 }, { "linux/omapfb.h", "OMAPFB_CTRL_TEST", _IOC_WRITE, 0x4f2e, 0x04 }, { "linux/omapfb.h", "OMAPFB_GET_CAPS", _IOC_READ, 0x4f2a, 0x0c }, { "linux/omapfb.h", "OMAPFB_GET_COLOR_KEY", _IOC_WRITE, 0x4f33, 0x0c }, @@ -1496,11 +1530,22 @@ { "linux/omapfb.h", "OMAPFB_VSYNC", _IOC_NONE, 0x4f26, 0x00 }, { "linux/omapfb.h", "OMAPFB_WAITFORGO", _IOC_NONE, 0x4f3c, 0x00 }, { "linux/omapfb.h", "OMAPFB_WAITFORVSYNC", _IOC_NONE, 0x4f39, 0x00 }, +{ "linux/pcitest.h", "PCITEST_BAR", _IOC_NONE, 0x5001, 0x00 }, +{ "linux/pcitest.h", "PCITEST_COPY", _IOC_WRITE, 0x5006, 0x04 }, +{ "linux/pcitest.h", "PCITEST_GET_IRQTYPE", _IOC_NONE, 0x5009, 0x00 }, +{ "linux/pcitest.h", "PCITEST_LEGACY_IRQ", _IOC_NONE, 0x5002, 0x00 }, +{ "linux/pcitest.h", "PCITEST_MSI", _IOC_WRITE, 0x5003, 0x04 }, +{ "linux/pcitest.h", "PCITEST_MSIX", _IOC_WRITE, 0x5007, 0x04 }, +{ "linux/pcitest.h", "PCITEST_READ", _IOC_WRITE, 0x5005, 0x04 }, +{ "linux/pcitest.h", "PCITEST_SET_IRQTYPE", _IOC_WRITE, 0x5008, 0x04 }, +{ "linux/pcitest.h", "PCITEST_WRITE", _IOC_WRITE, 0x5004, 0x04 }, { "linux/perf_event.h", "PERF_EVENT_IOC_DISABLE", _IOC_NONE, 0x2401, 0x00 }, { "linux/perf_event.h", "PERF_EVENT_IOC_ENABLE", _IOC_NONE, 0x2400, 0x00 }, { "linux/perf_event.h", "PERF_EVENT_IOC_ID", _IOC_READ, 0x2407, 0x04 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_MODIFY_ATTRIBUTES", _IOC_WRITE, 0x240b, 0x04 }, { "linux/perf_event.h", "PERF_EVENT_IOC_PAUSE_OUTPUT", _IOC_WRITE, 0x2409, 0x04 }, { "linux/perf_event.h", "PERF_EVENT_IOC_PERIOD", _IOC_WRITE, 0x2404, 0x08 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_QUERY_BPF", _IOC_READ|_IOC_WRITE, 0x240a, 0x04 }, { "linux/perf_event.h", "PERF_EVENT_IOC_REFRESH", _IOC_NONE, 0x2402, 0x00 }, { "linux/perf_event.h", "PERF_EVENT_IOC_RESET", _IOC_NONE, 0x2403, 0x00 }, { "linux/perf_event.h", "PERF_EVENT_IOC_SET_BPF", _IOC_WRITE, 0x2408, 0x04 }, @@ -1588,6 +1633,7 @@ { "linux/pr.h", "IOC_PR_REGISTER", _IOC_WRITE, 0x70c8, 0x18 }, { "linux/pr.h", "IOC_PR_RELEASE", _IOC_WRITE, 0x70ca, 0x10 }, { "linux/pr.h", "IOC_PR_RESERVE", _IOC_WRITE, 0x70c9, 0x10 }, +{ "linux/psp-sev.h", "SEV_ISSUE_CMD", _IOC_READ|_IOC_WRITE, 0x5300, 0x10 }, { "linux/ptp_clock.h", "PTP_CLOCK_GETCAPS", _IOC_READ, 0x3d01, 0x50 }, { "linux/ptp_clock.h", "PTP_ENABLE_PPS", _IOC_WRITE, 0x3d04, 0x04 }, { "linux/ptp_clock.h", "PTP_EXTTS_REQUEST", _IOC_WRITE, 0x3d02, 0x10 }, @@ -1595,6 +1641,7 @@ { "linux/ptp_clock.h", "PTP_PIN_GETFUNC", _IOC_READ|_IOC_WRITE, 0x3d06, 0x60 }, { "linux/ptp_clock.h", "PTP_PIN_SETFUNC", _IOC_WRITE, 0x3d07, 0x60 }, { "linux/ptp_clock.h", "PTP_SYS_OFFSET", _IOC_WRITE, 0x3d05, 0x340 }, +{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_EXTENDED", _IOC_READ|_IOC_WRITE, 0x3d09, 0x4c0 }, { "linux/ptp_clock.h", "PTP_SYS_OFFSET_PRECISE", _IOC_READ|_IOC_WRITE, 0x3d08, 0x40 }, { "linux/radeonfb.h", "FBIO_RADEON_GET_MIRROR", _IOC_READ, 0x4003, 0x04 }, { "linux/radeonfb.h", "FBIO_RADEON_SET_MIRROR", _IOC_WRITE, 0x4004, 0x04 }, @@ -1625,6 +1672,7 @@ { "linux/random.h", "RNDCLEARPOOL", _IOC_NONE, 0x5206, 0x00 }, { "linux/random.h", "RNDGETENTCNT", _IOC_READ, 0x5200, 0x04 }, { "linux/random.h", "RNDGETPOOL", _IOC_READ, 0x5202, 0x08 }, +{ "linux/random.h", "RNDRESEEDCRNG", _IOC_NONE, 0x5207, 0x00 }, { "linux/random.h", "RNDZAPENTCNT", _IOC_NONE, 0x5204, 0x00 }, { "linux/raw.h", "RAW_GETBIND", _IOC_NONE, 0xac01, 0x00 }, { "linux/raw.h", "RAW_SETBIND", _IOC_NONE, 0xac00, 0x00 }, @@ -1665,6 +1713,8 @@ { "linux/rio_mport_cdev.h", "RIO_UNMAP_INBOUND", _IOC_WRITE, 0x6d12, 0x08 }, { "linux/rio_mport_cdev.h", "RIO_UNMAP_OUTBOUND", _IOC_WRITE, 0x6d10, 0x28 }, { "linux/rio_mport_cdev.h", "RIO_WAIT_FOR_ASYNC", _IOC_WRITE, 0x6d16, 0x08 }, +{ "linux/rpmsg.h", "RPMSG_CREATE_EPT_IOCTL", _IOC_WRITE, 0xb501, 0x28 }, +{ "linux/rpmsg.h", "RPMSG_DESTROY_EPT_IOCTL", _IOC_NONE, 0xb502, 0x00 }, { "linux/rtc.h", "RTC_AIE_OFF", _IOC_NONE, 0x7002, 0x00 }, { "linux/rtc.h", "RTC_AIE_ON", _IOC_NONE, 0x7001, 0x00 }, { "linux/rtc.h", "RTC_ALM_READ", _IOC_READ, 0x7008, 0x24 }, @@ -1704,6 +1754,21 @@ { "linux/scif_ioctl.h", "SCIF_VREADFROM", _IOC_READ|_IOC_WRITE, 0x730c, 0x24 }, { "linux/scif_ioctl.h", "SCIF_VWRITETO", _IOC_READ|_IOC_WRITE, 0x730d, 0x24 }, { "linux/scif_ioctl.h", "SCIF_WRITETO", _IOC_READ|_IOC_WRITE, 0x730b, 0x24 }, +{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_ID_VALID", _IOC_READ, 0x2102, 0x08 }, +{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_RECV", _IOC_READ|_IOC_WRITE, 0x2100, 0x50 }, +{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_SEND", _IOC_READ|_IOC_WRITE, 0x2101, 0x18 }, +{ "linux/sed-opal.h", "IOC_OPAL_ACTIVATE_LSP", _IOC_WRITE, 0x70df, 0x118 }, +{ "linux/sed-opal.h", "IOC_OPAL_ACTIVATE_USR", _IOC_WRITE, 0x70e1, 0x110 }, +{ "linux/sed-opal.h", "IOC_OPAL_ADD_USR_TO_LR", _IOC_WRITE, 0x70e4, 0x118 }, +{ "linux/sed-opal.h", "IOC_OPAL_ENABLE_DISABLE_MBR", _IOC_WRITE, 0x70e5, 0x110 }, +{ "linux/sed-opal.h", "IOC_OPAL_ERASE_LR", _IOC_WRITE, 0x70e6, 0x110 }, +{ "linux/sed-opal.h", "IOC_OPAL_LOCK_UNLOCK", _IOC_WRITE, 0x70dd, 0x118 }, +{ "linux/sed-opal.h", "IOC_OPAL_LR_SETUP", _IOC_WRITE, 0x70e3, 0x128 }, +{ "linux/sed-opal.h", "IOC_OPAL_REVERT_TPR", _IOC_WRITE, 0x70e2, 0x108 }, +{ "linux/sed-opal.h", "IOC_OPAL_SAVE", _IOC_WRITE, 0x70dc, 0x118 }, +{ "linux/sed-opal.h", "IOC_OPAL_SECURE_ERASE_LR", _IOC_WRITE, 0x70e7, 0x110 }, +{ "linux/sed-opal.h", "IOC_OPAL_SET_PW", _IOC_WRITE, 0x70e0, 0x220 }, +{ "linux/sed-opal.h", "IOC_OPAL_TAKE_OWNERSHIP", _IOC_WRITE, 0x70de, 0x108 }, { "linux/serio.h", "SPIOCSTYPE", _IOC_WRITE, 0x7101, 0x04 }, { "linux/sockios.h", "SIOCADDDLCI", 0, 0x8980, 0 }, { "linux/sockios.h", "SIOCADDMULTI", 0, 0x8931, 0 }, @@ -1916,6 +1981,12 @@ { "linux/suspend_ioctls.h", "SNAPSHOT_S2RAM", _IOC_NONE, 0x330b, 0x00 }, { "linux/suspend_ioctls.h", "SNAPSHOT_SET_SWAP_AREA", _IOC_WRITE, 0x330d, 0x0c }, { "linux/suspend_ioctls.h", "SNAPSHOT_UNFREEZE", _IOC_NONE, 0x3302, 0x00 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_CTL", _IOC_READ|_IOC_WRITE, 0x5743, 0x28 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_SUMMARY", _IOC_READ, 0x5742, 0x198 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_FLASH_INFO", _IOC_READ, 0x5740, 0x10 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_FLASH_PART_INFO", _IOC_READ|_IOC_WRITE, 0x5741, 0x10 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_PFF_TO_PORT", _IOC_READ|_IOC_WRITE, 0x5744, 0x0c }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_PORT_TO_PFF", _IOC_READ|_IOC_WRITE, 0x5745, 0x0c }, { "linux/sync_file.h", "SYNC_IOC_FILE_INFO", _IOC_READ|_IOC_WRITE, 0x3e04, 0x38 }, { "linux/sync_file.h", "SYNC_IOC_MERGE", _IOC_READ|_IOC_WRITE, 0x3e03, 0x30 }, { "linux/synclink.h", "MGSL_IOCCLRMODCOUNT", _IOC_NONE, 0x6d0f, 0x00 }, @@ -1938,53 +2009,15 @@ { "linux/synclink.h", "MGSL_IOCTXENABLE", _IOC_NONE, 0x6d04, 0x00 }, { "linux/synclink.h", "MGSL_IOCWAITEVENT", _IOC_READ|_IOC_WRITE, 0x6d08, 0x04 }, { "linux/synclink.h", "MGSL_IOCWAITGPIO", _IOC_READ|_IOC_WRITE, 0x6d12, 0x10 }, -{ "linux/telephony.h", "OLD_PHONE_RING_START", _IOC_NONE, 0x7187, 0x00 }, -{ "linux/telephony.h", "PHONE_BUSY", _IOC_NONE, 0x71a1, 0x00 }, -{ "linux/telephony.h", "PHONE_CAPABILITIES", _IOC_NONE, 0x7180, 0x00 }, -{ "linux/telephony.h", "PHONE_CAPABILITIES_CHECK", _IOC_WRITE, 0x7182, 0x04 }, -{ "linux/telephony.h", "PHONE_CAPABILITIES_LIST", _IOC_READ, 0x7181, 0x04 }, -{ "linux/telephony.h", "PHONE_CPT_STOP", _IOC_NONE, 0x71a4, 0x00 }, -{ "linux/telephony.h", "PHONE_DIALTONE", _IOC_NONE, 0x71a3, 0x00 }, -{ "linux/telephony.h", "PHONE_DTMF_OOB", _IOC_WRITE, 0x7199, 0x04 }, -{ "linux/telephony.h", "PHONE_DTMF_READY", _IOC_READ, 0x7196, 0x04 }, -{ "linux/telephony.h", "PHONE_EXCEPTION", _IOC_READ, 0x719a, 0x04 }, -{ "linux/telephony.h", "PHONE_FRAME", _IOC_WRITE, 0x718d, 0x04 }, -{ "linux/telephony.h", "PHONE_GET_DTMF", _IOC_READ, 0x7197, 0x04 }, -{ "linux/telephony.h", "PHONE_GET_DTMF_ASCII", _IOC_READ, 0x7198, 0x04 }, -{ "linux/telephony.h", "PHONE_GET_TONE_OFF_TIME", _IOC_NONE, 0x719f, 0x00 }, -{ "linux/telephony.h", "PHONE_GET_TONE_ON_TIME", _IOC_NONE, 0x719e, 0x00 }, -{ "linux/telephony.h", "PHONE_GET_TONE_STATE", _IOC_NONE, 0x71a0, 0x00 }, -{ "linux/telephony.h", "PHONE_HOOKSTATE", _IOC_NONE, 0x7184, 0x00 }, -{ "linux/telephony.h", "PHONE_MAXRINGS", _IOC_WRITE, 0x7185, 0x01 }, -{ "linux/telephony.h", "PHONE_PLAY_CODEC", _IOC_WRITE, 0x7190, 0x04 }, -{ "linux/telephony.h", "PHONE_PLAY_DEPTH", _IOC_WRITE, 0x7193, 0x04 }, -{ "linux/telephony.h", "PHONE_PLAY_LEVEL", _IOC_NONE, 0x7195, 0x00 }, -{ "linux/telephony.h", "PHONE_PLAY_START", _IOC_NONE, 0x7191, 0x00 }, -{ "linux/telephony.h", "PHONE_PLAY_STOP", _IOC_NONE, 0x7192, 0x00 }, -{ "linux/telephony.h", "PHONE_PLAY_TONE", _IOC_WRITE, 0x719b, 0x01 }, -{ "linux/telephony.h", "PHONE_PLAY_VOLUME", _IOC_WRITE, 0x7194, 0x04 }, -{ "linux/telephony.h", "PHONE_PLAY_VOLUME_LINEAR", _IOC_WRITE, 0x71dc, 0x04 }, -{ "linux/telephony.h", "PHONE_PSTN_GET_STATE", _IOC_NONE, 0x71a5, 0x00 }, -{ "linux/telephony.h", "PHONE_PSTN_LINETEST", _IOC_NONE, 0x71a8, 0x00 }, -{ "linux/telephony.h", "PHONE_PSTN_SET_STATE", _IOC_WRITE, 0x71a4, 0x04 }, -{ "linux/telephony.h", "PHONE_QUERY_CODEC", _IOC_READ|_IOC_WRITE, 0x71a7, 0x04 }, -{ "linux/telephony.h", "PHONE_REC_CODEC", _IOC_WRITE, 0x7189, 0x04 }, -{ "linux/telephony.h", "PHONE_REC_DEPTH", _IOC_WRITE, 0x718c, 0x04 }, -{ "linux/telephony.h", "PHONE_REC_LEVEL", _IOC_NONE, 0x718f, 0x00 }, -{ "linux/telephony.h", "PHONE_REC_START", _IOC_NONE, 0x718a, 0x00 }, -{ "linux/telephony.h", "PHONE_REC_STOP", _IOC_NONE, 0x718b, 0x00 }, -{ "linux/telephony.h", "PHONE_REC_VOLUME", _IOC_WRITE, 0x718e, 0x04 }, -{ "linux/telephony.h", "PHONE_REC_VOLUME_LINEAR", _IOC_WRITE, 0x71db, 0x04 }, -{ "linux/telephony.h", "PHONE_RING", _IOC_NONE, 0x7183, 0x00 }, -{ "linux/telephony.h", "PHONE_RINGBACK", _IOC_NONE, 0x71a2, 0x00 }, -{ "linux/telephony.h", "PHONE_RING_CADENCE", _IOC_WRITE, 0x7186, 0x02 }, -{ "linux/telephony.h", "PHONE_RING_START", _IOC_WRITE, 0x7187, 0x04 }, -{ "linux/telephony.h", "PHONE_RING_STOP", _IOC_NONE, 0x7188, 0x00 }, -{ "linux/telephony.h", "PHONE_SET_TONE_OFF_TIME", _IOC_WRITE, 0x719d, 0x04 }, -{ "linux/telephony.h", "PHONE_SET_TONE_ON_TIME", _IOC_WRITE, 0x719c, 0x04 }, -{ "linux/telephony.h", "PHONE_VAD", _IOC_WRITE, 0x71a9, 0x04 }, -{ "linux/telephony.h", "PHONE_WINK", _IOC_WRITE, 0x71aa, 0x04 }, -{ "linux/telephony.h", "PHONE_WINK_DURATION", _IOC_WRITE, 0x71a6, 0x04 }, +{ "linux/tee.h", "TEE_IOC_CANCEL", _IOC_READ, 0xa404, 0x08 }, +{ "linux/tee.h", "TEE_IOC_CLOSE_SESSION", _IOC_READ, 0xa405, 0x04 }, +{ "linux/tee.h", "TEE_IOC_INVOKE", _IOC_READ, 0xa403, 0x10 }, +{ "linux/tee.h", "TEE_IOC_OPEN_SESSION", _IOC_READ, 0xa402, 0x10 }, +{ "linux/tee.h", "TEE_IOC_SHM_ALLOC", _IOC_READ|_IOC_WRITE, 0xa401, 0x10 }, +{ "linux/tee.h", "TEE_IOC_SHM_REGISTER", _IOC_READ|_IOC_WRITE, 0xa409, 0x18 }, +{ "linux/tee.h", "TEE_IOC_SUPPL_RECV", _IOC_READ, 0xa406, 0x10 }, +{ "linux/tee.h", "TEE_IOC_SUPPL_SEND", _IOC_READ, 0xa407, 0x10 }, +{ "linux/tee.h", "TEE_IOC_VERSION", _IOC_READ, 0xa400, 0x0c }, { "linux/timerfd.h", "TFD_IOC_SET_TICKS", _IOC_WRITE, 0x5400, 0x08 }, { "linux/toshiba.h", "TOSHIBA_ACPI_SCI", _IOC_READ|_IOC_WRITE, 0x7491, 0x18 }, { "linux/toshiba.h", "TOSH_SMM", _IOC_READ|_IOC_WRITE, 0x7490, 0x18 }, @@ -1992,6 +2025,8 @@ { "linux/udf_fs_i.h", "UDF_GETEASIZE", _IOC_READ, 0x6c40, 0x04 }, { "linux/udf_fs_i.h", "UDF_GETVOLIDENT", _IOC_READ, 0x6c42, 0x04 }, { "linux/udf_fs_i.h", "UDF_RELOCATE_BLOCKS", _IOC_READ|_IOC_WRITE, 0x6c43, 0x04 }, +{ "linux/udmabuf.h", "UDMABUF_CREATE", _IOC_WRITE, 0x7542, 0x18 }, +{ "linux/udmabuf.h", "UDMABUF_CREATE_LIST", _IOC_WRITE, 0x7543, 0x08 }, { "linux/uinput.h", "UI_ABS_SETUP", _IOC_WRITE, 0x5504, 0x1a }, { "linux/uinput.h", "UI_BEGIN_FF_ERASE", _IOC_READ|_IOC_WRITE, 0x55ca, 0x0c }, { "linux/uinput.h", "UI_BEGIN_FF_UPLOAD", _IOC_READ|_IOC_WRITE, 0x55c8, 0x58 }, @@ -2021,6 +2056,7 @@ { "linux/usb/functionfs.h", "FUNCTIONFS_INTERFACE_REVMAP", _IOC_NONE, 0x6780, 0x00 }, { "linux/usb/g_printer.h", "GADGET_GET_PRINTER_STATUS", _IOC_READ, 0x6721, 0x01 }, { "linux/usb/g_printer.h", "GADGET_SET_PRINTER_STATUS", _IOC_READ|_IOC_WRITE, 0x6722, 0x01 }, +{ "linux/usb/g_uvc.h", "UVCIOC_SEND_RESPONSE", _IOC_WRITE, 0x5501, 0x40 }, { "linux/usb/gadgetfs.h", "GADGETFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 }, { "linux/usb/gadgetfs.h", "GADGETFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 }, { "linux/usb/gadgetfs.h", "GADGETFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 }, @@ -2032,12 +2068,27 @@ { "linux/usb/tmc.h", "USBTMC488_IOCTL_LOCAL_LOCKOUT", _IOC_NONE, 0x5b15, 0x00 }, { "linux/usb/tmc.h", "USBTMC488_IOCTL_READ_STB", _IOC_READ, 0x5b12, 0x01 }, { "linux/usb/tmc.h", "USBTMC488_IOCTL_REN_CONTROL", _IOC_WRITE, 0x5b13, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_TRIGGER", _IOC_NONE, 0x5b16, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_WAIT_SRQ", _IOC_WRITE, 0x5b17, 0x04 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_IN", _IOC_NONE, 0x5b04, 0x00 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_OUT", _IOC_NONE, 0x5b03, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_API_VERSION", _IOC_READ, 0x5b10, 0x04 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_AUTO_ABORT", _IOC_WRITE, 0x5b19, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CANCEL_IO", _IOC_NONE, 0x5b23, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEANUP_IO", _IOC_NONE, 0x5b24, 0x00 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR", _IOC_NONE, 0x5b02, 0x00 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_IN_HALT", _IOC_NONE, 0x5b07, 0x00 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_OUT_HALT", _IOC_NONE, 0x5b06, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CONFIG_TERMCHAR", _IOC_WRITE, 0x5b0c, 0x02 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CTRL_REQUEST", _IOC_READ|_IOC_WRITE, 0x5b08, 0x0c }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_EOM_ENABLE", _IOC_WRITE, 0x5b0b, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_GET_TIMEOUT", _IOC_READ, 0x5b09, 0x04 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_INDICATOR_PULSE", _IOC_NONE, 0x5b01, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_MSG_IN_ATTR", _IOC_READ, 0x5b18, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_READ", _IOC_READ|_IOC_WRITE, 0x5b0e, 0x10 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_SET_TIMEOUT", _IOC_WRITE, 0x5b0a, 0x04 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_WRITE", _IOC_READ|_IOC_WRITE, 0x5b0d, 0x10 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_WRITE_RESULT", _IOC_READ|_IOC_WRITE, 0x5b0f, 0x04 }, { "linux/usbdevice_fs.h", "USBDEVFS_ALLOC_STREAMS", _IOC_READ, 0x551c, 0x08 }, { "linux/usbdevice_fs.h", "USBDEVFS_BULK", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 }, { "linux/usbdevice_fs.h", "USBDEVFS_BULK32", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 }, @@ -2057,6 +2108,7 @@ { "linux/usbdevice_fs.h", "USBDEVFS_FREE_STREAMS", _IOC_READ, 0x551d, 0x08 }, { "linux/usbdevice_fs.h", "USBDEVFS_GETDRIVER", _IOC_WRITE, 0x5508, 0x104 }, { "linux/usbdevice_fs.h", "USBDEVFS_GET_CAPABILITIES", _IOC_READ, 0x551a, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_GET_SPEED", _IOC_NONE, 0x551f, 0x00 }, { "linux/usbdevice_fs.h", "USBDEVFS_HUB_PORTINFO", _IOC_READ, 0x5513, 0x80 }, { "linux/usbdevice_fs.h", "USBDEVFS_IOCTL", _IOC_READ|_IOC_WRITE, 0x5512, 0x0c }, { "linux/usbdevice_fs.h", "USBDEVFS_IOCTL32", _IOC_READ|_IOC_WRITE, 0x5512, 0x0c }, @@ -2080,30 +2132,36 @@ { "linux/userfaultfd.h", "UFFDIO_ZEROPAGE", _IOC_READ|_IOC_WRITE, 0xaa04, 0x20 }, { "linux/uvcvideo.h", "UVCIOC_CTRL_MAP", _IOC_READ|_IOC_WRITE, 0x7520, 0x58 }, { "linux/uvcvideo.h", "UVCIOC_CTRL_QUERY", _IOC_READ|_IOC_WRITE, 0x7521, 0x0a }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x564b, 0x40 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_SIZE", _IOC_READ|_IOC_WRITE, 0x564a, 0x40 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_MBUS_CODE", _IOC_READ|_IOC_WRITE, 0x5602, 0x30 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x38 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x24 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0x58 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5615, 0x30 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x563d, 0x40 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_CROP", _IOC_READ|_IOC_WRITE, 0x563c, 0x38 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x24 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0x58 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5616, 0x30 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x563e, 0x40 }, +{ "linux/vboxguest.h", "VBG_IOCTL_CHANGE_FILTER_MASK", _IOC_READ|_IOC_WRITE, 0x560c, 0x20 }, +{ "linux/vboxguest.h", "VBG_IOCTL_CHANGE_GUEST_CAPABILITIES", _IOC_READ|_IOC_WRITE, 0x560e, 0x20 }, +{ "linux/vboxguest.h", "VBG_IOCTL_CHECK_BALLOON", _IOC_READ|_IOC_WRITE, 0x5611, 0x20 }, +{ "linux/vboxguest.h", "VBG_IOCTL_DRIVER_VERSION_INFO", _IOC_READ|_IOC_WRITE, 0x5600, 0x2c }, +{ "linux/vboxguest.h", "VBG_IOCTL_HGCM_CONNECT", _IOC_READ|_IOC_WRITE, 0x5604, 0x9c }, +{ "linux/vboxguest.h", "VBG_IOCTL_HGCM_DISCONNECT", _IOC_READ|_IOC_WRITE, 0x5605, 0x1c }, +{ "linux/vboxguest.h", "VBG_IOCTL_INTERRUPT_ALL_WAIT_FOR_EVENTS", _IOC_READ|_IOC_WRITE, 0x560b, 0x18 }, +{ "linux/vboxguest.h", "VBG_IOCTL_VMMDEV_REQUEST_BIG", _IOC_READ|_IOC_WRITE, 0x5603, 0x00 }, +{ "linux/vboxguest.h", "VBG_IOCTL_WAIT_FOR_EVENTS", _IOC_READ|_IOC_WRITE, 0x560a, 0x20 }, +{ "linux/vboxguest.h", "VBG_IOCTL_WRITE_CORE_DUMP", _IOC_READ|_IOC_WRITE, 0x5613, 0x1c }, { "linux/vfio.h", "VFIO_CHECK_EXTENSION", _IOC_NONE, 0x3b65, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_GFX_DMABUF", _IOC_NONE, 0x3b73, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_GET_INFO", _IOC_NONE, 0x3b6b, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_GET_IRQ_INFO", _IOC_NONE, 0x3b6d, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_GET_PCI_HOT_RESET_INFO", _IOC_NONE, 0x3b70, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_GET_REGION_INFO", _IOC_NONE, 0x3b6c, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_IOEVENTFD", _IOC_NONE, 0x3b74, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_PCI_HOT_RESET", _IOC_NONE, 0x3b71, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_QUERY_GFX_PLANE", _IOC_NONE, 0x3b72, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_RESET", _IOC_NONE, 0x3b6f, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_SET_IRQS", _IOC_NONE, 0x3b6e, 0x00 }, { "linux/vfio.h", "VFIO_EEH_PE_OP", _IOC_NONE, 0x3b79, 0x00 }, @@ -2123,6 +2181,7 @@ { "linux/vfio.h", "VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY", _IOC_NONE, 0x3b76, 0x00 }, { "linux/vfio.h", "VFIO_IOMMU_UNMAP_DMA", _IOC_NONE, 0x3b72, 0x00 }, { "linux/vfio.h", "VFIO_SET_IOMMU", _IOC_NONE, 0x3b66, 0x00 }, +{ "linux/vhost.h", "VHOST_GET_BACKEND_FEATURES", _IOC_READ, 0xaf26, 0x08 }, { "linux/vhost.h", "VHOST_GET_FEATURES", _IOC_READ, 0xaf00, 0x08 }, { "linux/vhost.h", "VHOST_GET_VRING_BASE", _IOC_READ|_IOC_WRITE, 0xaf12, 0x08 }, { "linux/vhost.h", "VHOST_GET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf24, 0x08 }, @@ -2134,6 +2193,7 @@ { "linux/vhost.h", "VHOST_SCSI_GET_EVENTS_MISSED", _IOC_WRITE, 0xaf44, 0x04 }, { "linux/vhost.h", "VHOST_SCSI_SET_ENDPOINT", _IOC_WRITE, 0xaf40, 0xe8 }, { "linux/vhost.h", "VHOST_SCSI_SET_EVENTS_MISSED", _IOC_WRITE, 0xaf43, 0x04 }, +{ "linux/vhost.h", "VHOST_SET_BACKEND_FEATURES", _IOC_WRITE, 0xaf25, 0x08 }, { "linux/vhost.h", "VHOST_SET_FEATURES", _IOC_WRITE, 0xaf00, 0x08 }, { "linux/vhost.h", "VHOST_SET_LOG_BASE", _IOC_WRITE, 0xaf04, 0x08 }, { "linux/vhost.h", "VHOST_SET_LOG_FD", _IOC_WRITE, 0xaf07, 0x04 }, @@ -2203,7 +2263,6 @@ { "linux/videodev2.h", "VIDIOC_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 }, { "linux/videodev2.h", "VIDIOC_QUERY_EXT_CTRL", _IOC_READ|_IOC_WRITE, 0x5667, 0xe8 }, { "linux/videodev2.h", "VIDIOC_REQBUFS", _IOC_READ|_IOC_WRITE, 0x5608, 0x14 }, -{ "linux/videodev2.h", "VIDIOC_RESERVED", _IOC_NONE, 0x5601, 0x00 }, { "linux/videodev2.h", "VIDIOC_STREAMOFF", _IOC_WRITE, 0x5613, 0x04 }, { "linux/videodev2.h", "VIDIOC_STREAMON", _IOC_WRITE, 0x5612, 0x04 }, { "linux/videodev2.h", "VIDIOC_SUBSCRIBE_EVENT", _IOC_WRITE, 0x565a, 0x20 }, @@ -2335,7 +2394,7 @@ { "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 }, { "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 }, { "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 }, -{ "media/davinci/vpfe_capture.h", "VPFE_CMD_S_CCDC_RAW_PARAMS", _IOC_WRITE, 0x56c1, 0x04 }, +{ "linux/wmi.h", "DELL_WMI_SMBIOS_CMD", _IOC_READ|_IOC_WRITE, 0x5700, 0x34 }, { "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 }, { "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 }, { "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 }, @@ -2353,6 +2412,23 @@ { "misc/cxl.h", "CXL_IOCTL_GET_PROCESS_ELEMENT", _IOC_READ, 0xca01, 0x04 }, { "misc/cxl.h", "CXL_IOCTL_START_WORK", _IOC_WRITE, 0xca00, 0x40 }, { "misc/cxl.h", "CXL_IOCTL_VALIDATE_IMAGE", _IOC_WRITE, 0xca0b, 0x40 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_ALLOC_DMA_BUFF", _IOC_READ|_IOC_WRITE, 0x5201, 0x10 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_FREE_DMA_BUFF", _IOC_READ|_IOC_WRITE, 0x5202, 0x04 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_ATTACH", _IOC_NONE, 0x5204, 0x00 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_CREATE", _IOC_READ|_IOC_WRITE, 0x5205, 0x18 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_INVOKE", _IOC_READ|_IOC_WRITE, 0x5203, 0x10 }, +{ "misc/habanalabs.h", "HL_IOCTL_CB", _IOC_READ|_IOC_WRITE, 0x4802, 0x18 }, +{ "misc/habanalabs.h", "HL_IOCTL_CS", _IOC_READ|_IOC_WRITE, 0x4803, 0x2c }, +{ "misc/habanalabs.h", "HL_IOCTL_INFO", _IOC_READ|_IOC_WRITE, 0x4801, 0x18 }, +{ "misc/habanalabs.h", "HL_IOCTL_MEMORY", _IOC_READ|_IOC_WRITE, 0x4805, 0x28 }, +{ "misc/habanalabs.h", "HL_IOCTL_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x4804, 0x18 }, +{ "misc/ocxl.h", "OCXL_IOCTL_ATTACH", _IOC_WRITE, 0xca10, 0x20 }, +{ "misc/ocxl.h", "OCXL_IOCTL_ENABLE_P9_WAIT", _IOC_READ, 0xca15, 0x20 }, +{ "misc/ocxl.h", "OCXL_IOCTL_GET_FEATURES", _IOC_READ, 0xca16, 0x20 }, +{ "misc/ocxl.h", "OCXL_IOCTL_GET_METADATA", _IOC_READ, 0xca14, 0x80 }, +{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_ALLOC", _IOC_READ, 0xca11, 0x08 }, +{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_FREE", _IOC_WRITE, 0xca12, 0x08 }, +{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_SET_FD", _IOC_WRITE, 0xca13, 0x10 }, { "mtd/mtd-abi.h", "ECCGETLAYOUT", _IOC_READ, 0x4d11, 0x148 }, { "mtd/mtd-abi.h", "ECCGETSTATS", _IOC_READ, 0x4d12, 0x10 }, { "mtd/mtd-abi.h", "MEMERASE", _IOC_WRITE, 0x4d02, 0x08 }, @@ -2386,8 +2462,10 @@ { "mtd/ubi-user.h", "UBI_IOCMKVOL", _IOC_WRITE, 0x6f00, 0x98 }, { "mtd/ubi-user.h", "UBI_IOCRMVOL", _IOC_WRITE, 0x6f01, 0x04 }, { "mtd/ubi-user.h", "UBI_IOCRNVOL", _IOC_WRITE, 0x6f03, 0x1110 }, +{ "mtd/ubi-user.h", "UBI_IOCRPEB", _IOC_WRITE, 0x6f04, 0x04 }, { "mtd/ubi-user.h", "UBI_IOCRSVOL", _IOC_WRITE, 0x6f02, 0x0c }, { "mtd/ubi-user.h", "UBI_IOCSETVOLPROP", _IOC_WRITE, 0x4f06, 0x10 }, +{ "mtd/ubi-user.h", "UBI_IOCSPEB", _IOC_WRITE, 0x6f05, 0x04 }, { "mtd/ubi-user.h", "UBI_IOCVOLCRBLK", _IOC_WRITE, 0x4f07, 0x80 }, { "mtd/ubi-user.h", "UBI_IOCVOLRMBLK", _IOC_NONE, 0x4f08, 0x00 }, { "mtd/ubi-user.h", "UBI_IOCVOLUP", _IOC_WRITE, 0x4f00, 0x08 }, @@ -2418,23 +2496,24 @@ { "net/bluetooth/rfcomm.h", "RFCOMMRELEASEDEV", _IOC_WRITE, 0x52c9, 0x04 }, { "net/bluetooth/rfcomm.h", "RFCOMMSTEALDLC", _IOC_WRITE, 0x52dc, 0x04 }, { "net/nfc/nci_core.h", "NCIUARTSETDRIVER", _IOC_WRITE, 0x5500, 0x04 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_ACK_EVENT", _IOC_WRITE, 0x1bea, 0x04 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_ASSIGN_CTXT", _IOC_READ|_IOC_WRITE, 0x1be1, 0x1c }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CREDIT_UPD", _IOC_NONE, 0x1be6, 0x00 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CTXT_INFO", _IOC_WRITE, 0x1be2, 0x26 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CTXT_RESET", _IOC_NONE, 0x1bec, 0x00 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_GET_VERS", _IOC_READ, 0x1bee, 0x04 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_POLL_TYPE", _IOC_WRITE, 0x1be9, 0x04 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_RECV_CTRL", _IOC_WRITE, 0x1be8, 0x04 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_SET_PKEY", _IOC_WRITE, 0x1beb, 0x02 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_FREE", _IOC_READ|_IOC_WRITE, 0x1be5, 0x18 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_INVAL_READ", _IOC_READ|_IOC_WRITE, 0x1bed, 0x18 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_UPDATE", _IOC_READ|_IOC_WRITE, 0x1be4, 0x18 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_USER_INFO", _IOC_WRITE, 0x1be3, 0x78 }, -{ "rdma/ib_user_mad.h", "IB_USER_MAD_ENABLE_PKEY", _IOC_NONE, 0x1b03, 0x00 }, -{ "rdma/ib_user_mad.h", "IB_USER_MAD_REGISTER_AGENT", _IOC_READ|_IOC_WRITE, 0x1b01, 0x1c }, -{ "rdma/ib_user_mad.h", "IB_USER_MAD_REGISTER_AGENT2", _IOC_READ|_IOC_WRITE, 0x1b04, 0x28 }, -{ "rdma/ib_user_mad.h", "IB_USER_MAD_UNREGISTER_AGENT", _IOC_WRITE, 0x1b02, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_ACK_EVENT", _IOC_WRITE, 0x1bea, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_ASSIGN_CTXT", _IOC_READ|_IOC_WRITE, 0x1be1, 0x1c }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CREDIT_UPD", _IOC_NONE, 0x1be6, 0x00 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CTXT_INFO", _IOC_WRITE, 0x1be2, 0x28 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CTXT_RESET", _IOC_NONE, 0x1bec, 0x00 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_GET_VERS", _IOC_READ, 0x1bee, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_POLL_TYPE", _IOC_WRITE, 0x1be9, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_RECV_CTRL", _IOC_WRITE, 0x1be8, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_SET_PKEY", _IOC_WRITE, 0x1beb, 0x02 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_FREE", _IOC_READ|_IOC_WRITE, 0x1be5, 0x18 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_INVAL_READ", _IOC_READ|_IOC_WRITE, 0x1bed, 0x18 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_UPDATE", _IOC_READ|_IOC_WRITE, 0x1be4, 0x18 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_USER_INFO", _IOC_WRITE, 0x1be3, 0x78 }, +{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_ENABLE_PKEY", _IOC_NONE, 0x1b03, 0x00 }, +{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_REGISTER_AGENT", _IOC_READ|_IOC_WRITE, 0x1b01, 0x1c }, +{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_REGISTER_AGENT2", _IOC_READ|_IOC_WRITE, 0x1b04, 0x28 }, +{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_UNREGISTER_AGENT", _IOC_WRITE, 0x1b02, 0x04 }, +{ "rdma/rdma_user_ioctl_cmds.h", "RDMA_VERBS_IOCTL", _IOC_READ|_IOC_WRITE, 0x1b01, 0x18 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_ATTACH", _IOC_READ|_IOC_WRITE, 0xca80, 0x90 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_DETACH", _IOC_READ|_IOC_WRITE, 0xca83, 0x60 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_MANAGE_LUN", _IOC_READ|_IOC_WRITE, 0xca86, 0x68 }, @@ -2445,6 +2524,8 @@ { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VERIFY", _IOC_READ|_IOC_WRITE, 0xca84, 0x90 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_CLONE", _IOC_READ|_IOC_WRITE, 0xca89, 0x70 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_RESIZE", _IOC_READ|_IOC_WRITE, 0xca88, 0x78 }, +{ "scsi/cxlflash_ioctl.h", "HT_CXLFLASH_AFU_DEBUG", _IOC_READ|_IOC_WRITE, 0xcabe, 0x78 }, +{ "scsi/cxlflash_ioctl.h", "HT_CXLFLASH_LUN_PROVISION", _IOC_READ|_IOC_WRITE, 0xcabf, 0xa0 }, { "scsi/scsi.h", "SCSI_IOCTL_GET_BUS_NUMBER", 0, 0x5386, 0 }, { "scsi/scsi.h", "SCSI_IOCTL_GET_IDLUN", 0, 0x5382, 0 }, { "scsi/scsi.h", "SCSI_IOCTL_GET_PCI", 0, 0x5387, 0 }, @@ -2563,6 +2644,7 @@ { "sound/asound.h", "SNDRV_PCM_IOCTL_TSTAMP", _IOC_WRITE, 0x4102, 0x04 }, { "sound/asound.h", "SNDRV_PCM_IOCTL_TTSTAMP", _IOC_WRITE, 0x4103, 0x04 }, { "sound/asound.h", "SNDRV_PCM_IOCTL_UNLINK", _IOC_NONE, 0x4161, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_USER_PVERSION", _IOC_WRITE, 0x4104, 0x04 }, { "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEI_FRAMES", _IOC_WRITE, 0x4150, 0x0c }, { "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEN_FRAMES", _IOC_WRITE, 0x4152, 0x0c }, { "sound/asound.h", "SNDRV_PCM_IOCTL_XRUN", _IOC_NONE, 0x4148, 0x00 }, @@ -2626,6 +2708,7 @@ { "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER", _IOC_NONE, 0x4882, 0x00 }, { "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_GET_INFO", _IOC_READ, 0x48f8, 0x20 }, { "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_LOCK", _IOC_NONE, 0x48f9, 0x00 }, +{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_TASCAM_STATE", _IOC_READ, 0x48fb, 0x100 }, { "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_UNLOCK", _IOC_NONE, 0x48fa, 0x00 }, { "sound/hda_hwdep.h", "HDA_IOCTL_GET_WCAP", _IOC_READ|_IOC_WRITE, 0x4812, 0x08 }, { "sound/hda_hwdep.h", "HDA_IOCTL_PVERSION", _IOC_READ, 0x4810, 0x04 }, @@ -2666,17 +2749,17 @@ { "staging/android/ashmem.h", "ASHMEM_SET_PROT_MASK", _IOC_WRITE, 0x7705, 0x04 }, { "staging/android/ashmem.h", "ASHMEM_SET_SIZE", _IOC_WRITE, 0x7703, 0x04 }, { "staging/android/ashmem.h", "ASHMEM_UNPIN", _IOC_WRITE, 0x7708, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_ALLOC", _IOC_READ|_IOC_WRITE, 0x4900, 0x14 }, -{ "staging/android/ion.h", "ION_IOC_CUSTOM", _IOC_READ|_IOC_WRITE, 0x4906, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_FREE", _IOC_READ|_IOC_WRITE, 0x4901, 0x04 }, +{ "staging/android/ion.h", "ION_IOC_ALLOC", _IOC_READ|_IOC_WRITE, 0x4900, 0x18 }, { "staging/android/ion.h", "ION_IOC_HEAP_QUERY", _IOC_READ|_IOC_WRITE, 0x4908, 0x18 }, -{ "staging/android/ion.h", "ION_IOC_IMPORT", _IOC_READ|_IOC_WRITE, 0x4905, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_MAP", _IOC_READ|_IOC_WRITE, 0x4902, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_SHARE", _IOC_READ|_IOC_WRITE, 0x4904, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_SYNC", _IOC_READ|_IOC_WRITE, 0x4907, 0x08 }, -{ "staging/android/ion_test.h", "ION_IOC_TEST_DMA_MAPPING", _IOC_WRITE, 0x49f1, 0x20 }, -{ "staging/android/ion_test.h", "ION_IOC_TEST_KERNEL_MAPPING", _IOC_WRITE, 0x49f2, 0x20 }, -{ "staging/android/ion_test.h", "ION_IOC_TEST_SET_FD", _IOC_NONE, 0x49f0, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_COND_WAIT", _IOC_READ|_IOC_WRITE, 0xf507, 0x20 }, +{ "staging/android/vsoc_shm.h", "VSOC_COND_WAKE", _IOC_NONE, 0xf508, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_CREATE_FD_SCOPED_PERMISSION", _IOC_WRITE, 0xf500, 0x10 }, +{ "staging/android/vsoc_shm.h", "VSOC_DESCRIBE_REGION", _IOC_READ, 0xf504, 0x3c }, +{ "staging/android/vsoc_shm.h", "VSOC_GET_FD_SCOPED_PERMISSION", _IOC_READ, 0xf501, 0x10 }, +{ "staging/android/vsoc_shm.h", "VSOC_MAYBE_SEND_INTERRUPT_TO_HOST", _IOC_NONE, 0xf502, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_SELF_INTERRUPT", _IOC_NONE, 0xf505, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_SEND_INTERRUPT_TO_HOST", _IOC_NONE, 0xf506, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_WAIT_FOR_INCOMING_INTERRUPT", _IOC_NONE, 0xf503, 0x00 }, { "video/da8xx-fb.h", "FBIGET_BRIGHTNESS", _IOC_READ, 0x4603, 0x04 }, { "video/da8xx-fb.h", "FBIGET_COLOR", _IOC_READ, 0x4605, 0x04 }, { "video/da8xx-fb.h", "FBIOGET_CONTRAST", _IOC_READ, 0x4601, 0x04 }, @@ -2719,6 +2802,10 @@ { "xen/evtchn.h", "IOCTL_EVTCHN_RESET", _IOC_NONE, 0x4505, 0x00 }, { "xen/evtchn.h", "IOCTL_EVTCHN_RESTRICT_DOMID", _IOC_NONE, 0x4506, 0x02 }, { "xen/evtchn.h", "IOCTL_EVTCHN_UNBIND", _IOC_NONE, 0x4503, 0x04 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS", _IOC_NONE, 0x4709, 0x14 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_WAIT_RELEASED", _IOC_NONE, 0x470a, 0x08 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_RELEASE", _IOC_NONE, 0x470c, 0x08 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_TO_REFS", _IOC_NONE, 0x470b, 0x14 }, { "xen/gntdev.h", "IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR", _IOC_NONE, 0x4702, 0x18 }, { "xen/gntdev.h", "IOCTL_GNTDEV_GRANT_COPY", _IOC_NONE, 0x4708, 0x08 }, { "xen/gntdev.h", "IOCTL_GNTDEV_MAP_GRANT_REF", _IOC_NONE, 0x4700, 0x18 }, diff --git a/linux/32/ioctls_inc_align32.h b/linux/32/ioctls_inc_align32.h index 699eb905..92c8c186 100644 --- a/linux/32/ioctls_inc_align32.h +++ b/linux/32/ioctls_inc_align32.h @@ -34,11 +34,13 @@ { "asm-generic/ioctls.h", "TIOCGETD", 0, 0x5424, 0 }, { "asm-generic/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 }, { "asm-generic/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 }, +{ "asm-generic/ioctls.h", "TIOCGISO7816", _IOC_READ, 0x5442, 0x28 }, { "asm-generic/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 }, { "asm-generic/ioctls.h", "TIOCGPGRP", 0, 0x540F, 0 }, { "asm-generic/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 }, { "asm-generic/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 }, { "asm-generic/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGPTPEER", _IOC_NONE, 0x5441, 0x00 }, { "asm-generic/ioctls.h", "TIOCGRS485", 0, 0x542E, 0 }, { "asm-generic/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 }, { "asm-generic/ioctls.h", "TIOCGSID", 0, 0x5429, 0 }, @@ -65,6 +67,7 @@ { "asm-generic/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 }, { "asm-generic/ioctls.h", "TIOCSETD", 0, 0x5423, 0 }, { "asm-generic/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCSISO7816", _IOC_READ|_IOC_WRITE, 0x5443, 0x28 }, { "asm-generic/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 }, { "asm-generic/ioctls.h", "TIOCSPGRP", 0, 0x5410, 0 }, { "asm-generic/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 }, @@ -84,6 +87,7 @@ { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x6454, 0x20 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x11c }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 }, @@ -92,6 +96,8 @@ { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_SCHED", _IOC_WRITE, 0x6455, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_VM", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 }, { "drm/drm.h", "DRM_IOCTL_ADD_BUFS", _IOC_READ|_IOC_WRITE, 0x6416, 0x18 }, @@ -109,6 +115,8 @@ { "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 }, { "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 }, { "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_CRTC_GET_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643b, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_CRTC_QUEUE_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643c, 0x18 }, { "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x28 }, { "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 }, { "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 }, @@ -136,6 +144,7 @@ { "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 }, { "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 }, { "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c6, 0x18 }, { "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c }, { "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 }, { "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 }, @@ -152,10 +161,13 @@ { "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 }, { "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 }, { "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GET_LEASE", _IOC_READ|_IOC_WRITE, 0x64c8, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_LIST_LESSEES", _IOC_READ|_IOC_WRITE, 0x64c7, 0x10 }, { "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 }, { "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x1c }, { "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x14 }, { "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_REVOKE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c9, 0x04 }, { "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 }, { "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 }, { "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 }, @@ -177,6 +189,13 @@ { "drm/drm.h", "DRM_IOCTL_SG_ALLOC", _IOC_READ|_IOC_WRITE, 0x6438, 0x08 }, { "drm/drm.h", "DRM_IOCTL_SG_FREE", _IOC_WRITE, 0x6439, 0x08 }, { "drm/drm.h", "DRM_IOCTL_SWITCH_CTX", _IOC_WRITE, 0x6424, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_CREATE", _IOC_READ|_IOC_WRITE, 0x64bf, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_DESTROY", _IOC_READ|_IOC_WRITE, 0x64c0, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x64c2, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD", _IOC_READ|_IOC_WRITE, 0x64c1, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_RESET", _IOC_READ|_IOC_WRITE, 0x64c4, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_SIGNAL", _IOC_READ|_IOC_WRITE, 0x64c5, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_WAIT", _IOC_READ|_IOC_WRITE, 0x64c3, 0x20 }, { "drm/drm.h", "DRM_IOCTL_UNBLOCK", _IOC_READ|_IOC_WRITE, 0x6413, 0x04 }, { "drm/drm.h", "DRM_IOCTL_UNLOCK", _IOC_WRITE, 0x642b, 0x08 }, { "drm/drm.h", "DRM_IOCTL_UPDATE_DRAW", _IOC_WRITE, 0x643f, 0x14 }, @@ -186,10 +205,12 @@ { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, -{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x30 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_DOM", _IOC_READ|_IOC_WRITE, 0x644a, 0x48 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_SIG", _IOC_READ|_IOC_WRITE, 0x644b, 0x4c }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 }, @@ -197,10 +218,10 @@ { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_GET", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, -{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_CMD_CTRL", _IOC_READ|_IOC_WRITE, 0x6473, 0x08 }, -{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY", _IOC_READ|_IOC_WRITE, 0x6470, 0x50 }, -{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_QUEUE_BUF", _IOC_READ|_IOC_WRITE, 0x6472, 0x28 }, -{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY", _IOC_READ|_IOC_WRITE, 0x6471, 0x60 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_COMMIT", _IOC_READ|_IOC_WRITE, 0x6483, 0x20 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6481, 0x18 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_LIMITS", _IOC_READ|_IOC_WRITE, 0x6482, 0x20 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_RESOURCES", _IOC_READ|_IOC_WRITE, 0x6480, 0x10 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_VIDI_CONNECTION", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, { "drm/i810_drm.h", "DRM_IOCTL_I810_CLEAR", _IOC_WRITE, 0x6442, 0x0c }, { "drm/i810_drm.h", "DRM_IOCTL_I810_COPY", _IOC_WRITE, 0x6447, 0x0c }, @@ -233,6 +254,7 @@ { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_ENTERVT", _IOC_NONE, 0x6459, 0x00 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER", _IOC_WRITE, 0x6454, 0x28 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2", _IOC_WRITE, 0x6469, 0x40 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2_WR", _IOC_READ|_IOC_WRITE, 0x6469, 0x40 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_APERTURE", _IOC_READ, 0x6463, 0x10 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_CACHING", _IOC_READ|_IOC_WRITE, 0x6470, 0x08 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6462, 0x10 }, @@ -264,11 +286,17 @@ { "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_WAIT", _IOC_WRITE, 0x6445, 0x04 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_ATTRS", _IOC_READ|_IOC_WRITE, 0x6468, 0x2c }, { "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_PUT_IMAGE", _IOC_WRITE, 0x6467, 0x2c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_ADD_CONFIG", _IOC_WRITE, 0x6477, 0x48 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_OPEN", _IOC_WRITE, 0x6476, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_REMOVE_CONFIG", _IOC_WRITE, 0x6478, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_QUERY", _IOC_READ|_IOC_WRITE, 0x6479, 0x10 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_REG_READ", _IOC_READ|_IOC_WRITE, 0x6471, 0x10 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_SETPARAM", _IOC_WRITE, 0x6447, 0x08 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_SET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646b, 0x14 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_SET_VBLANK_PIPE", _IOC_WRITE, 0x644d, 0x04 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_VBLANK_SWAP", _IOC_READ|_IOC_WRITE, 0x644f, 0x0c }, +{ "drm/i915_drm.h", "I915_PERF_IOCTL_DISABLE", _IOC_NONE, 0x6901, 0x00 }, +{ "drm/i915_drm.h", "I915_PERF_IOCTL_ENABLE", _IOC_NONE, 0x6900, 0x00 }, { "drm/mga_drm.h", "DRM_IOCTL_MGA_BLIT", _IOC_WRITE, 0x6448, 0x34 }, { "drm/mga_drm.h", "DRM_IOCTL_MGA_CLEAR", _IOC_WRITE, 0x6444, 0x14 }, { "drm/mga_drm.h", "DRM_IOCTL_MGA_DMA_BOOTSTRAP", _IOC_READ|_IOC_WRITE, 0x644c, 0x1c }, @@ -284,17 +312,21 @@ { "drm/mga_drm.h", "DRM_IOCTL_MGA_WAIT_FENCE", _IOC_READ|_IOC_WRITE, 0x644b, 0x04 }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x04 }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 }, -{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, -{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x24 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x28 }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, -{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x18 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE", _IOC_WRITE, 0x644b, 0x04 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_NEW", _IOC_READ|_IOC_WRITE, 0x644a, 0x0c }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x1c }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6480, 0x30 }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_PUSHBUF", _IOC_READ|_IOC_WRITE, 0x6481, 0x40 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_SVM_BIND", _IOC_READ|_IOC_WRITE, 0x6449, 0x40 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_SVM_INIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 }, { "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x10 }, { "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x08 }, { "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 }, @@ -377,7 +409,7 @@ { "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_ALLOC", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, { "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_FREE", _IOC_WRITE, 0x6445, 0x10 }, { "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_INIT", _IOC_WRITE, 0x6456, 0x08 }, -{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_CLOSE_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6446, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_CLOSE_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6446, 0x08 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644d, 0x08 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 }, @@ -391,12 +423,26 @@ { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_INCR", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_READ", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_GET_BO_OFFSET", _IOC_READ|_IOC_WRITE, 0x6445, 0x08 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0x38 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_TFU", _IOC_WRITE, 0x6446, 0x44 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_LABEL_BO", _IOC_READ|_IOC_WRITE, 0x644a, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, -{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0xa0 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_CREATE", _IOC_READ|_IOC_WRITE, 0x644c, 0x18 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_DESTROY", _IOC_READ|_IOC_WRITE, 0x644d, 0x04 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_GET_VALUES", _IOC_READ|_IOC_WRITE, 0x644e, 0x0c }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0xb0 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_SEQNO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, { "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_ATTACH", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, @@ -415,7 +461,7 @@ { "drm/via_drm.h", "DRM_IOCTL_VIA_MAP_INIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x14 }, { "drm/via_drm.h", "DRM_IOCTL_VIA_PCICMD", _IOC_WRITE, 0x644a, 0x08 }, { "drm/via_drm.h", "DRM_IOCTL_VIA_WAIT_IRQ", _IOC_READ|_IOC_WRITE, 0x644d, 0x10 }, -{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_EXECBUFFER", _IOC_WRITE, 0x6442, 0x20 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_EXECBUFFER", _IOC_READ|_IOC_WRITE, 0x6442, 0x20 }, { "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, { "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6449, 0x18 }, { "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, @@ -451,9 +497,14 @@ { "linux/android/binder.h", "BC_REGISTER_LOOPER", _IOC_NONE, 0x630b, 0x00 }, { "linux/android/binder.h", "BC_RELEASE", _IOC_WRITE, 0x6306, 0x04 }, { "linux/android/binder.h", "BC_REPLY", _IOC_WRITE, 0x6301, 0x40 }, +{ "linux/android/binder.h", "BC_REPLY_SG", _IOC_WRITE, 0x6312, 0x48 }, { "linux/android/binder.h", "BC_REQUEST_DEATH_NOTIFICATION", _IOC_WRITE, 0x630e, 0x0c }, { "linux/android/binder.h", "BC_TRANSACTION", _IOC_WRITE, 0x6300, 0x40 }, +{ "linux/android/binder.h", "BC_TRANSACTION_SG", _IOC_WRITE, 0x6311, 0x48 }, +{ "linux/android/binder.h", "BINDER_GET_NODE_DEBUG_INFO", _IOC_READ|_IOC_WRITE, 0x620b, 0x18 }, +{ "linux/android/binder.h", "BINDER_GET_NODE_INFO_FOR_REF", _IOC_READ|_IOC_WRITE, 0x620c, 0x18 }, { "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR", _IOC_WRITE, 0x6207, 0x04 }, +{ "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR_EXT", _IOC_WRITE, 0x620d, 0x18 }, { "linux/android/binder.h", "BINDER_SET_IDLE_PRIORITY", _IOC_WRITE, 0x6206, 0x04 }, { "linux/android/binder.h", "BINDER_SET_IDLE_TIMEOUT", _IOC_WRITE, 0x6203, 0x08 }, { "linux/android/binder.h", "BINDER_SET_MAX_THREADS", _IOC_WRITE, 0x6205, 0x04 }, @@ -478,10 +529,14 @@ { "linux/android/binder.h", "BR_SPAWN_LOOPER", _IOC_NONE, 0x720d, 0x00 }, { "linux/android/binder.h", "BR_TRANSACTION", _IOC_READ, 0x7202, 0x40 }, { "linux/android/binder.h", "BR_TRANSACTION_COMPLETE", _IOC_NONE, 0x7206, 0x00 }, +{ "linux/android/binder.h", "BR_TRANSACTION_SEC_CTX", _IOC_READ, 0x7202, 0x48 }, +{ "linux/android/binderfs.h", "BINDER_CTL_ADD", _IOC_READ|_IOC_WRITE, 0x6201, 0x108 }, { "linux/apm_bios.h", "APM_IOC_STANDBY", _IOC_NONE, 0x4101, 0x00 }, { "linux/apm_bios.h", "APM_IOC_SUSPEND", _IOC_NONE, 0x4102, 0x00 }, { "linux/arcfb.h", "FBIO_GETCONTROL2", _IOC_READ, 0x4689, 0x04 }, { "linux/arcfb.h", "FBIO_WAITEVENT", _IOC_NONE, 0x4688, 0x00 }, +{ "linux/aspeed-lpc-ctrl.h", "ASPEED_LPC_CTRL_IOCTL_GET_SIZE", _IOC_READ|_IOC_WRITE, 0xb200, 0x10 }, +{ "linux/aspeed-lpc-ctrl.h", "ASPEED_LPC_CTRL_IOCTL_MAP", _IOC_WRITE, 0xb201, 0x10 }, { "linux/atm_eni.h", "ENI_MEMDUMP", _IOC_WRITE, 0x6160, 0x0c }, { "linux/atm_eni.h", "ENI_SETMULT", _IOC_WRITE, 0x6167, 0x0c }, { "linux/atm_he.h", "HE_GET_REG", _IOC_WRITE, 0x6160, 0x0c }, @@ -547,17 +602,19 @@ { "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_SETPIPEFD", _IOC_READ|_IOC_WRITE, 0x9378, 0x18 }, { "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_TIMEOUT", _IOC_READ|_IOC_WRITE, 0x937a, 0x18 }, { "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x9371, 0x18 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_ASKUMOUNT", _IOC_READ, 0x9370, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_CATATONIC", _IOC_NONE, 0x9362, 0x00 }, { "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE", _IOC_READ, 0x9365, 0x10c }, +{ "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE_MULTI", _IOC_WRITE, 0x9366, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_FAIL", _IOC_NONE, 0x9361, 0x00 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_PROTOSUBVER", _IOC_READ, 0x9367, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_PROTOVER", _IOC_READ, 0x9363, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_READY", _IOC_NONE, 0x9360, 0x00 }, { "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT", _IOC_READ|_IOC_WRITE, 0x9364, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT32", _IOC_READ|_IOC_WRITE, 0x9364, 0x04 }, -{ "linux/auto_fs4.h", "AUTOFS_IOC_ASKUMOUNT", _IOC_READ, 0x9370, 0x04 }, -{ "linux/auto_fs4.h", "AUTOFS_IOC_EXPIRE_MULTI", _IOC_WRITE, 0x9366, 0x04 }, -{ "linux/auto_fs4.h", "AUTOFS_IOC_PROTOSUBVER", _IOC_READ, 0x9367, 0x04 }, { "linux/blkpg.h", "BLKPG", _IOC_NONE, 0x1269, 0x00 }, +{ "linux/blkzoned.h", "BLKGETNRZONES", _IOC_READ, 0x1285, 0x04 }, +{ "linux/blkzoned.h", "BLKGETZONESZ", _IOC_READ, 0x1284, 0x04 }, { "linux/blkzoned.h", "BLKREPORTZONE", _IOC_READ|_IOC_WRITE, 0x1282, 0x10 }, { "linux/blkzoned.h", "BLKRESETZONE", _IOC_WRITE, 0x1283, 0x10 }, { "linux/bt-bmc.h", "BT_BMC_IOCTL_SMS_ATN", _IOC_NONE, 0xb100, 0x00 }, @@ -575,14 +632,18 @@ { "linux/btrfs.h", "BTRFS_IOC_DEV_INFO", _IOC_READ|_IOC_WRITE, 0x941e, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_DEV_REPLACE", _IOC_READ|_IOC_WRITE, 0x9435, 0xa24 }, { "linux/btrfs.h", "BTRFS_IOC_FILE_EXTENT_SAME", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 }, +{ "linux/btrfs.h", "BTRFS_IOC_FORGET_DEV", _IOC_WRITE, 0x9405, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_FS_INFO", _IOC_READ, 0x941f, 0x400 }, { "linux/btrfs.h", "BTRFS_IOC_GET_DEV_STATS", _IOC_READ|_IOC_WRITE, 0x9434, 0x408 }, { "linux/btrfs.h", "BTRFS_IOC_GET_FEATURES", _IOC_READ, 0x9439, 0x18 }, -{ "linux/btrfs.h", "BTRFS_IOC_GET_FSLABEL", _IOC_READ, 0x9431, 0x100 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_SUBVOL_INFO", _IOC_READ, 0x943c, 0x1e8 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_SUBVOL_ROOTREF", _IOC_READ|_IOC_WRITE, 0x943d, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_GET_SUPPORTED_FEATURES", _IOC_READ, 0x9439, 0x48 }, { "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP_USER", _IOC_READ|_IOC_WRITE, 0x943e, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 }, { "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 }, +{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO_V2", _IOC_READ|_IOC_WRITE, 0x943b, 0x38 }, { "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 }, { "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 }, { "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 }, @@ -599,7 +660,6 @@ { "linux/btrfs.h", "BTRFS_IOC_SCRUB_PROGRESS", _IOC_READ|_IOC_WRITE, 0x941d, 0x400 }, { "linux/btrfs.h", "BTRFS_IOC_SEND", _IOC_WRITE, 0x9426, 0x44 }, { "linux/btrfs.h", "BTRFS_IOC_SET_FEATURES", _IOC_WRITE, 0x9439, 0x30 }, -{ "linux/btrfs.h", "BTRFS_IOC_SET_FSLABEL", _IOC_WRITE, 0x9432, 0x100 }, { "linux/btrfs.h", "BTRFS_IOC_SET_RECEIVED_SUBVOL", _IOC_READ|_IOC_WRITE, 0x9425, 0xc0 }, { "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE", _IOC_WRITE, 0x9401, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE_V2", _IOC_WRITE, 0x9417, 0x1000 }, @@ -719,6 +779,7 @@ { "linux/cm4000_cs.h", "CM_IOCSRDR", _IOC_NONE, 0x6303, 0x00 }, { "linux/cm4000_cs.h", "CM_IOSDBGLVL", _IOC_WRITE, 0x63fa, 0x04 }, { "linux/coda.h", "CIOC_KERNEL_VERSION", _IOC_READ|_IOC_WRITE, 0x630a, 0x04 }, +{ "linux/dm-ioctl.h", "DM_DEV_ARM_POLL", _IOC_READ|_IOC_WRITE, 0xfd10, 0x138 }, { "linux/dm-ioctl.h", "DM_DEV_CREATE", _IOC_READ|_IOC_WRITE, 0xfd03, 0x138 }, { "linux/dm-ioctl.h", "DM_DEV_REMOVE", _IOC_READ|_IOC_WRITE, 0xfd04, 0x138 }, { "linux/dm-ioctl.h", "DM_DEV_RENAME", _IOC_READ|_IOC_WRITE, 0xfd05, 0x138 }, @@ -745,17 +806,13 @@ { "linux/dvb/audio.h", "AUDIO_CLEAR_BUFFER", _IOC_NONE, 0x6f0c, 0x00 }, { "linux/dvb/audio.h", "AUDIO_CONTINUE", _IOC_NONE, 0x6f04, 0x00 }, { "linux/dvb/audio.h", "AUDIO_GET_CAPABILITIES", _IOC_READ, 0x6f0b, 0x04 }, -{ "linux/dvb/audio.h", "AUDIO_GET_PTS", _IOC_READ, 0x6f13, 0x08 }, { "linux/dvb/audio.h", "AUDIO_GET_STATUS", _IOC_READ, 0x6f0a, 0x20 }, { "linux/dvb/audio.h", "AUDIO_PAUSE", _IOC_NONE, 0x6f03, 0x00 }, { "linux/dvb/audio.h", "AUDIO_PLAY", _IOC_NONE, 0x6f02, 0x00 }, { "linux/dvb/audio.h", "AUDIO_SELECT_SOURCE", _IOC_NONE, 0x6f05, 0x00 }, -{ "linux/dvb/audio.h", "AUDIO_SET_ATTRIBUTES", _IOC_WRITE, 0x6f11, 0x02 }, { "linux/dvb/audio.h", "AUDIO_SET_AV_SYNC", _IOC_NONE, 0x6f07, 0x00 }, { "linux/dvb/audio.h", "AUDIO_SET_BYPASS_MODE", _IOC_NONE, 0x6f08, 0x00 }, -{ "linux/dvb/audio.h", "AUDIO_SET_EXT_ID", _IOC_NONE, 0x6f10, 0x00 }, { "linux/dvb/audio.h", "AUDIO_SET_ID", _IOC_NONE, 0x6f0d, 0x00 }, -{ "linux/dvb/audio.h", "AUDIO_SET_KARAOKE", _IOC_WRITE, 0x6f12, 0x0c }, { "linux/dvb/audio.h", "AUDIO_SET_MIXER", _IOC_WRITE, 0x6f0e, 0x08 }, { "linux/dvb/audio.h", "AUDIO_SET_MUTE", _IOC_NONE, 0x6f06, 0x00 }, { "linux/dvb/audio.h", "AUDIO_SET_STREAMTYPE", _IOC_NONE, 0x6f0f, 0x00 }, @@ -767,16 +824,18 @@ { "linux/dvb/ca.h", "CA_RESET", _IOC_NONE, 0x6f80, 0x00 }, { "linux/dvb/ca.h", "CA_SEND_MSG", _IOC_WRITE, 0x6f85, 0x10c }, { "linux/dvb/ca.h", "CA_SET_DESCR", _IOC_WRITE, 0x6f86, 0x10 }, -{ "linux/dvb/ca.h", "CA_SET_PID", _IOC_WRITE, 0x6f87, 0x08 }, { "linux/dvb/dmx.h", "DMX_ADD_PID", _IOC_WRITE, 0x6f33, 0x02 }, -{ "linux/dvb/dmx.h", "DMX_GET_CAPS", _IOC_READ, 0x6f30, 0x08 }, +{ "linux/dvb/dmx.h", "DMX_DQBUF", _IOC_READ|_IOC_WRITE, 0x6f40, 0x18 }, +{ "linux/dvb/dmx.h", "DMX_EXPBUF", _IOC_READ|_IOC_WRITE, 0x6f3e, 0x0c }, { "linux/dvb/dmx.h", "DMX_GET_PES_PIDS", _IOC_READ, 0x6f2f, 0x0a }, { "linux/dvb/dmx.h", "DMX_GET_STC", _IOC_READ|_IOC_WRITE, 0x6f32, 0x10 }, +{ "linux/dvb/dmx.h", "DMX_QBUF", _IOC_READ|_IOC_WRITE, 0x6f3f, 0x18 }, +{ "linux/dvb/dmx.h", "DMX_QUERYBUF", _IOC_READ|_IOC_WRITE, 0x6f3d, 0x18 }, { "linux/dvb/dmx.h", "DMX_REMOVE_PID", _IOC_WRITE, 0x6f34, 0x02 }, +{ "linux/dvb/dmx.h", "DMX_REQBUFS", _IOC_READ|_IOC_WRITE, 0x6f3c, 0x08 }, { "linux/dvb/dmx.h", "DMX_SET_BUFFER_SIZE", _IOC_NONE, 0x6f2d, 0x00 }, { "linux/dvb/dmx.h", "DMX_SET_FILTER", _IOC_WRITE, 0x6f2b, 0x3c }, { "linux/dvb/dmx.h", "DMX_SET_PES_FILTER", _IOC_WRITE, 0x6f2c, 0x14 }, -{ "linux/dvb/dmx.h", "DMX_SET_SOURCE", _IOC_WRITE, 0x6f31, 0x04 }, { "linux/dvb/dmx.h", "DMX_START", _IOC_NONE, 0x6f29, 0x00 }, { "linux/dvb/dmx.h", "DMX_STOP", _IOC_NONE, 0x6f2a, 0x00 }, { "linux/dvb/frontend.h", "FE_DISEQC_RECV_SLAVE_REPLY", _IOC_READ, 0x6f40, 0x0c }, @@ -812,23 +871,15 @@ { "linux/dvb/video.h", "VIDEO_GET_CAPABILITIES", _IOC_READ, 0x6f21, 0x04 }, { "linux/dvb/video.h", "VIDEO_GET_EVENT", _IOC_READ, 0x6f1c, 0x14 }, { "linux/dvb/video.h", "VIDEO_GET_FRAME_COUNT", _IOC_READ, 0x6f3a, 0x08 }, -{ "linux/dvb/video.h", "VIDEO_GET_FRAME_RATE", _IOC_READ, 0x6f38, 0x04 }, -{ "linux/dvb/video.h", "VIDEO_GET_NAVI", _IOC_READ, 0x6f34, 0x404 }, { "linux/dvb/video.h", "VIDEO_GET_PTS", _IOC_READ, 0x6f39, 0x08 }, { "linux/dvb/video.h", "VIDEO_GET_SIZE", _IOC_READ, 0x6f37, 0x0c }, { "linux/dvb/video.h", "VIDEO_GET_STATUS", _IOC_READ, 0x6f1b, 0x14 }, { "linux/dvb/video.h", "VIDEO_PLAY", _IOC_NONE, 0x6f16, 0x00 }, { "linux/dvb/video.h", "VIDEO_SELECT_SOURCE", _IOC_NONE, 0x6f19, 0x00 }, -{ "linux/dvb/video.h", "VIDEO_SET_ATTRIBUTES", _IOC_NONE, 0x6f35, 0x00 }, { "linux/dvb/video.h", "VIDEO_SET_BLANK", _IOC_NONE, 0x6f1a, 0x00 }, { "linux/dvb/video.h", "VIDEO_SET_DISPLAY_FORMAT", _IOC_NONE, 0x6f1d, 0x00 }, { "linux/dvb/video.h", "VIDEO_SET_FORMAT", _IOC_NONE, 0x6f25, 0x00 }, -{ "linux/dvb/video.h", "VIDEO_SET_HIGHLIGHT", _IOC_WRITE, 0x6f27, 0x10 }, -{ "linux/dvb/video.h", "VIDEO_SET_ID", _IOC_NONE, 0x6f23, 0x00 }, -{ "linux/dvb/video.h", "VIDEO_SET_SPU", _IOC_WRITE, 0x6f32, 0x08 }, -{ "linux/dvb/video.h", "VIDEO_SET_SPU_PALETTE", _IOC_WRITE, 0x6f33, 0x08 }, { "linux/dvb/video.h", "VIDEO_SET_STREAMTYPE", _IOC_NONE, 0x6f24, 0x00 }, -{ "linux/dvb/video.h", "VIDEO_SET_SYSTEM", _IOC_NONE, 0x6f26, 0x00 }, { "linux/dvb/video.h", "VIDEO_SLOWMOTION", _IOC_NONE, 0x6f20, 0x00 }, { "linux/dvb/video.h", "VIDEO_STILLPICTURE", _IOC_WRITE, 0x6f1e, 0x08 }, { "linux/dvb/video.h", "VIDEO_STOP", _IOC_NONE, 0x6f15, 0x00 }, @@ -901,6 +952,14 @@ { "linux/firewire-cdev.h", "FW_CDEV_IOC_SET_ISO_CHANNELS", _IOC_WRITE, 0x2317, 0x0c }, { "linux/firewire-cdev.h", "FW_CDEV_IOC_START_ISO", _IOC_WRITE, 0x230a, 0x10 }, { "linux/firewire-cdev.h", "FW_CDEV_IOC_STOP_ISO", _IOC_WRITE, 0x230b, 0x04 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_CHECK_EXTENSION", _IOC_NONE, 0xb601, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_PR", _IOC_NONE, 0xb680, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_GET_API_VERSION", _IOC_NONE, 0xb600, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_MAP", _IOC_NONE, 0xb643, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_UNMAP", _IOC_NONE, 0xb644, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_INFO", _IOC_NONE, 0xb641, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_REGION_INFO", _IOC_NONE, 0xb642, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_RESET", _IOC_NONE, 0xb640, 0x00 }, { "linux/fs.h", "BLKALIGNOFF", _IOC_NONE, 0x127a, 0x00 }, { "linux/fs.h", "BLKBSZGET", _IOC_READ, 0x1270, 0x04 }, { "linux/fs.h", "BLKBSZSET", _IOC_WRITE, 0x1271, 0x04 }, @@ -945,12 +1004,18 @@ { "linux/fs.h", "FS_IOC_FSGETXATTR", _IOC_READ, 0x581f, 0x1c }, { "linux/fs.h", "FS_IOC_FSSETXATTR", _IOC_WRITE, 0x5820, 0x1c }, { "linux/fs.h", "FS_IOC_GETFLAGS", _IOC_READ, 0x6601, 0x04 }, +{ "linux/fs.h", "FS_IOC_GETFSLABEL", _IOC_READ, 0x9431, 0x100 }, { "linux/fs.h", "FS_IOC_GETVERSION", _IOC_READ, 0x7601, 0x04 }, { "linux/fs.h", "FS_IOC_GET_ENCRYPTION_POLICY", _IOC_WRITE, 0x6615, 0x0c }, { "linux/fs.h", "FS_IOC_GET_ENCRYPTION_PWSALT", _IOC_WRITE, 0x6614, 0x10 }, { "linux/fs.h", "FS_IOC_SETFLAGS", _IOC_WRITE, 0x6602, 0x04 }, +{ "linux/fs.h", "FS_IOC_SETFSLABEL", _IOC_WRITE, 0x9432, 0x100 }, { "linux/fs.h", "FS_IOC_SETVERSION", _IOC_WRITE, 0x7602, 0x04 }, { "linux/fs.h", "FS_IOC_SET_ENCRYPTION_POLICY", _IOC_READ, 0x6613, 0x0c }, +{ "linux/fsi.h", "FSI_SCOM_CHECK", _IOC_READ, 0x7300, 0x04 }, +{ "linux/fsi.h", "FSI_SCOM_READ", _IOC_READ|_IOC_WRITE, 0x7301, 0x20 }, +{ "linux/fsi.h", "FSI_SCOM_RESET", _IOC_WRITE, 0x7303, 0x04 }, +{ "linux/fsi.h", "FSI_SCOM_WRITE", _IOC_READ|_IOC_WRITE, 0x7302, 0x20 }, { "linux/fsl-diu-fb.h", "MFB_GET_ALPHA", _IOC_READ, 0x4d00, 0x01 }, { "linux/fsl-diu-fb.h", "MFB_GET_AOID", _IOC_READ, 0x4d04, 0x08 }, { "linux/fsl-diu-fb.h", "MFB_GET_GAMMA", _IOC_READ, 0x4d01, 0x01 }, @@ -969,6 +1034,7 @@ { "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_START", _IOC_READ|_IOC_WRITE, 0xaf03, 0x10 }, { "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_STOP", _IOC_READ|_IOC_WRITE, 0xaf04, 0x08 }, { "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_SETPROP", _IOC_READ|_IOC_WRITE, 0xaf08, 0x28 }, +{ "linux/fsmap.h", "FS_IOC_GETFSMAP", _IOC_READ|_IOC_WRITE, 0x583b, 0xc0 }, { "linux/fuse.h", "FUSE_DEV_IOC_CLONE", _IOC_READ, 0xe500, 0x04 }, { "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_DDCB", _IOC_READ|_IOC_WRITE, 0xa532, 0xe8 }, { "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_RAW_DDCB", _IOC_READ|_IOC_WRITE, 0xa533, 0xe8 }, @@ -1105,7 +1171,9 @@ { "linux/if_tun.h", "TUNGETVNETBE", _IOC_READ, 0x54df, 0x04 }, { "linux/if_tun.h", "TUNGETVNETHDRSZ", _IOC_READ, 0x54d7, 0x04 }, { "linux/if_tun.h", "TUNGETVNETLE", _IOC_READ, 0x54dd, 0x04 }, +{ "linux/if_tun.h", "TUNSETCARRIER", _IOC_WRITE, 0x54e2, 0x04 }, { "linux/if_tun.h", "TUNSETDEBUG", _IOC_WRITE, 0x54c9, 0x04 }, +{ "linux/if_tun.h", "TUNSETFILTEREBPF", _IOC_READ, 0x54e1, 0x04 }, { "linux/if_tun.h", "TUNSETGROUP", _IOC_WRITE, 0x54ce, 0x04 }, { "linux/if_tun.h", "TUNSETIFF", _IOC_WRITE, 0x54ca, 0x04 }, { "linux/if_tun.h", "TUNSETIFINDEX", _IOC_WRITE, 0x54da, 0x04 }, @@ -1116,11 +1184,13 @@ { "linux/if_tun.h", "TUNSETPERSIST", _IOC_WRITE, 0x54cb, 0x04 }, { "linux/if_tun.h", "TUNSETQUEUE", _IOC_WRITE, 0x54d9, 0x04 }, { "linux/if_tun.h", "TUNSETSNDBUF", _IOC_WRITE, 0x54d4, 0x04 }, +{ "linux/if_tun.h", "TUNSETSTEERINGEBPF", _IOC_READ, 0x54e0, 0x04 }, { "linux/if_tun.h", "TUNSETTXFILTER", _IOC_WRITE, 0x54d1, 0x04 }, { "linux/if_tun.h", "TUNSETVNETBE", _IOC_WRITE, 0x54de, 0x04 }, { "linux/if_tun.h", "TUNSETVNETHDRSZ", _IOC_WRITE, 0x54d8, 0x04 }, { "linux/if_tun.h", "TUNSETVNETLE", _IOC_WRITE, 0x54dc, 0x04 }, { "linux/iio/events.h", "IIO_GET_EVENT_FD_IOCTL", _IOC_READ, 0x6990, 0x04 }, +{ "linux/inotify.h", "INOTIFY_IOC_SETNEXTWD", _IOC_WRITE, 0x4900, 0x04 }, { "linux/input.h", "EVIOCGEFFECTS", _IOC_READ, 0x4584, 0x04 }, { "linux/input.h", "EVIOCGID", _IOC_READ, 0x4502, 0x08 }, { "linux/input.h", "EVIOCGKEYCODE", _IOC_READ, 0x4504, 0x08 }, @@ -1158,6 +1228,9 @@ { "linux/ipmi.h", "IPMICTL_SET_TIMING_PARMS_CMD", _IOC_READ, 0x6916, 0x08 }, { "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD", _IOC_READ, 0x690f, 0x02 }, { "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691d, 0x0c }, +{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_CLEAR_SMS_ATN", _IOC_NONE, 0xb101, 0x00 }, +{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_FORCE_ABORT", _IOC_NONE, 0xb102, 0x00 }, +{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_SET_SMS_ATN", _IOC_NONE, 0xb100, 0x00 }, { "linux/isdn.h", "IIOCDBGVAR", _IOC_NONE, 0x497f, 0x00 }, { "linux/isdn.h", "IIOCDRVCTL", _IOC_NONE, 0x4980, 0x00 }, { "linux/isdn.h", "IIOCGETCPS", _IOC_NONE, 0x4915, 0x00 }, @@ -1199,48 +1272,6 @@ { "linux/ivtv.h", "IVTV_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x38 }, { "linux/ivtv.h", "IVTV_IOC_PASSTHROUGH_MODE", _IOC_WRITE, 0x56c1, 0x04 }, { "linux/ivtvfb.h", "IVTVFB_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x0c }, -{ "linux/ixjuser.h", "IXJCTL_AEC_GET_LEVEL", _IOC_NONE, 0x71cd, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_AEC_START", _IOC_WRITE, 0x71cb, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_AEC_STOP", _IOC_NONE, 0x71cc, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_CARDTYPE", _IOC_READ, 0x71c1, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_CID", _IOC_READ, 0x71d4, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_CIDCW", _IOC_WRITE, 0x71d9, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DAA_AGAIN", _IOC_WRITE, 0x71d2, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DAA_COEFF_SET", _IOC_WRITE, 0x71d0, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DRYBUFFER_CLEAR", _IOC_NONE, 0x71e7, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_DRYBUFFER_READ", _IOC_READ, 0x71e6, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DSP_IDLE", _IOC_NONE, 0x71c5, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_DSP_RESET", _IOC_NONE, 0x71c0, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_DSP_TYPE", _IOC_READ, 0x71c3, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DSP_VERSION", _IOC_READ, 0x71c4, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DTMF_PRESCALE", _IOC_WRITE, 0x71e8, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_FILTER_CADENCE", _IOC_WRITE, 0x71d6, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_FRAMES_READ", _IOC_READ, 0x71e2, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_FRAMES_WRITTEN", _IOC_READ, 0x71e3, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_GET_FILTER_HIST", _IOC_WRITE, 0x71c8, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_HZ", _IOC_WRITE, 0x71e0, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_INIT_TONE", _IOC_WRITE, 0x71c9, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_INTERCOM_START", _IOC_WRITE, 0x71fd, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_INTERCOM_STOP", _IOC_WRITE, 0x71fe, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_MIXER", _IOC_WRITE, 0x71cf, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_PLAY_CID", _IOC_NONE, 0x71d7, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_PORT", _IOC_WRITE, 0x71d1, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_POTS_PSTN", _IOC_WRITE, 0x71d5, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_PSTN_LINETEST", _IOC_NONE, 0x71d3, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_RATE", _IOC_WRITE, 0x71e1, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_READ_WAIT", _IOC_READ, 0x71e4, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SC_RXG", _IOC_WRITE, 0x71ea, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SC_TXG", _IOC_WRITE, 0x71eb, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SERIAL", _IOC_READ, 0x71c2, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SET_FILTER", _IOC_WRITE, 0x71c7, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SET_FILTER_RAW", _IOC_WRITE, 0x71dd, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SET_LED", _IOC_WRITE, 0x71ce, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SIGCTL", _IOC_WRITE, 0x71e9, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_TESTRAM", _IOC_NONE, 0x71c6, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_TONE_CADENCE", _IOC_WRITE, 0x71ca, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_VERSION", _IOC_READ, 0x71da, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_VMWI", _IOC_READ, 0x71d8, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_WRITE_WAIT", _IOC_READ, 0x71e5, 0x04 }, { "linux/joystick.h", "JSIOCGAXES", _IOC_READ, 0x6a11, 0x01 }, { "linux/joystick.h", "JSIOCGAXMAP", _IOC_READ, 0x6a32, 0x40 }, { "linux/joystick.h", "JSIOCGBTNMAP", _IOC_READ, 0x6a34, 0x400 }, @@ -1299,6 +1330,8 @@ { "linux/kd.h", "PIO_UNIMAP", 0, 0x4B67, 0 }, { "linux/kd.h", "PIO_UNIMAPCLR", 0, 0x4B68, 0 }, { "linux/kd.h", "PIO_UNISCRNMAP", 0, 0x4B6A, 0 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ACQUIRE_VM", _IOC_WRITE, 0x4b15, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ALLOC_MEMORY_OF_GPU", _IOC_READ|_IOC_WRITE, 0x4b16, 0x28 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_EVENT", _IOC_READ|_IOC_WRITE, 0x4b08, 0x20 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b02, 0x58 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_ADDRESS_WATCH", _IOC_WRITE, 0x4b0f, 0x10 }, @@ -1307,14 +1340,28 @@ { "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_WAVE_CONTROL", _IOC_WRITE, 0x4b10, 0x10 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_EVENT", _IOC_WRITE, 0x4b09, 0x08 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b03, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_FREE_MEMORY_OF_GPU", _IOC_WRITE, 0x4b17, 0x08 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_CLOCK_COUNTERS", _IOC_READ|_IOC_WRITE, 0x4b05, 0x28 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_DMABUF_INFO", _IOC_READ|_IOC_WRITE, 0x4b1c, 0x20 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES", _IOC_READ, 0x4b06, 0x190 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES_NEW", _IOC_READ|_IOC_WRITE, 0x4b14, 0x10 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_QUEUE_WAVE_STATE", _IOC_READ|_IOC_WRITE, 0x4b1b, 0x18 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_TILE_CONFIG", _IOC_READ|_IOC_WRITE, 0x4b12, 0x28 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_VERSION", _IOC_READ, 0x4b01, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_IMPORT_DMABUF", _IOC_READ|_IOC_WRITE, 0x4b1d, 0x18 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_MAP_MEMORY_TO_GPU", _IOC_READ|_IOC_WRITE, 0x4b18, 0x18 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_RESET_EVENT", _IOC_WRITE, 0x4b0b, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_CU_MASK", _IOC_WRITE, 0x4b1a, 0x10 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_EVENT", _IOC_WRITE, 0x4b0a, 0x08 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_MEMORY_POLICY", _IOC_WRITE, 0x4b04, 0x20 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_SCRATCH_BACKING_VA", _IOC_READ|_IOC_WRITE, 0x4b11, 0x10 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_TRAP_HANDLER", _IOC_WRITE, 0x4b13, 0x18 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_UNMAP_MEMORY_FROM_GPU", _IOC_READ|_IOC_WRITE, 0x4b19, 0x18 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_UPDATE_QUEUE", _IOC_WRITE, 0x4b07, 0x18 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_WAIT_EVENTS", _IOC_READ|_IOC_WRITE, 0x4b0c, 0x18 }, +{ "linux/lightnvm.h", "NVME_NVM_IOCTL_ADMIN_VIO", _IOC_READ|_IOC_WRITE, 0x4c41, 0x50 }, +{ "linux/lightnvm.h", "NVME_NVM_IOCTL_IO_VIO", _IOC_READ|_IOC_WRITE, 0x4c43, 0x50 }, +{ "linux/lightnvm.h", "NVME_NVM_IOCTL_SUBMIT_VIO", _IOC_READ|_IOC_WRITE, 0x4c42, 0x40 }, { "linux/lightnvm.h", "NVM_DEV_CREATE", _IOC_WRITE, 0x4c22, 0x80 }, { "linux/lightnvm.h", "NVM_DEV_FACTORY", _IOC_WRITE, 0x4c25, 0x24 }, { "linux/lightnvm.h", "NVM_DEV_INIT", _IOC_WRITE, 0x4c24, 0x2c }, @@ -1327,6 +1374,7 @@ { "linux/lirc.h", "LIRC_GET_MIN_TIMEOUT", _IOC_READ, 0x6908, 0x04 }, { "linux/lirc.h", "LIRC_GET_REC_MODE", _IOC_READ, 0x6902, 0x04 }, { "linux/lirc.h", "LIRC_GET_REC_RESOLUTION", _IOC_READ, 0x6907, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_REC_TIMEOUT", _IOC_READ, 0x6924, 0x04 }, { "linux/lirc.h", "LIRC_GET_SEND_MODE", _IOC_READ, 0x6901, 0x04 }, { "linux/lirc.h", "LIRC_SET_MEASURE_CARRIER_MODE", _IOC_WRITE, 0x691d, 0x04 }, { "linux/lirc.h", "LIRC_SET_REC_CARRIER", _IOC_WRITE, 0x6914, 0x04 }, @@ -1346,11 +1394,13 @@ { "linux/loop.h", "LOOP_CTL_REMOVE", 0, 0x4C81, 0 }, { "linux/loop.h", "LOOP_GET_STATUS", 0, 0x4C03, 0 }, { "linux/loop.h", "LOOP_GET_STATUS64", 0, 0x4C05, 0 }, +{ "linux/loop.h", "LOOP_SET_BLOCK_SIZE", 0, 0x4C09, 0 }, { "linux/loop.h", "LOOP_SET_CAPACITY", 0, 0x4C07, 0 }, { "linux/loop.h", "LOOP_SET_DIRECT_IO", 0, 0x4C08, 0 }, { "linux/loop.h", "LOOP_SET_FD", 0, 0x4C00, 0 }, { "linux/loop.h", "LOOP_SET_STATUS", 0, 0x4C02, 0 }, { "linux/loop.h", "LOOP_SET_STATUS64", 0, 0x4C04, 0 }, +{ "linux/lp.h", "LPSETTIMEOUT_NEW", _IOC_WRITE, 0x060f, 0x10 }, { "linux/mISDNif.h", "IMADDTIMER", _IOC_READ, 0x4940, 0x04 }, { "linux/mISDNif.h", "IMCLEAR_L2", _IOC_READ, 0x4946, 0x04 }, { "linux/mISDNif.h", "IMCTRLREQ", _IOC_READ, 0x4945, 0x04 }, @@ -1370,7 +1420,10 @@ { "linux/media.h", "MEDIA_IOC_ENUM_ENTITIES", _IOC_READ|_IOC_WRITE, 0x7c01, 0x100 }, { "linux/media.h", "MEDIA_IOC_ENUM_LINKS", _IOC_READ|_IOC_WRITE, 0x7c02, 0x1c }, { "linux/media.h", "MEDIA_IOC_G_TOPOLOGY", _IOC_READ|_IOC_WRITE, 0x7c04, 0x48 }, +{ "linux/media.h", "MEDIA_IOC_REQUEST_ALLOC", _IOC_READ, 0x7c05, 0x04 }, { "linux/media.h", "MEDIA_IOC_SETUP_LINK", _IOC_READ|_IOC_WRITE, 0x7c03, 0x34 }, +{ "linux/media.h", "MEDIA_REQUEST_IOC_QUEUE", _IOC_NONE, 0x7c80, 0x00 }, +{ "linux/media.h", "MEDIA_REQUEST_IOC_REINIT", _IOC_NONE, 0x7c81, 0x00 }, { "linux/mei.h", "IOCTL_MEI_CONNECT_CLIENT", _IOC_READ|_IOC_WRITE, 0x4801, 0x10 }, { "linux/mei.h", "IOCTL_MEI_NOTIFY_GET", _IOC_READ, 0x4803, 0x04 }, { "linux/mei.h", "IOCTL_MEI_NOTIFY_SET", _IOC_WRITE, 0x4802, 0x04 }, @@ -1410,26 +1463,6 @@ { "linux/nbd.h", "NBD_SET_SIZE_BLOCKS", _IOC_NONE, 0xab07, 0x00 }, { "linux/nbd.h", "NBD_SET_SOCK", _IOC_NONE, 0xab00, 0x00 }, { "linux/nbd.h", "NBD_SET_TIMEOUT", _IOC_NONE, 0xab09, 0x00 }, -{ "linux/ncp_fs.h", "NCP_IOC_CONN_LOGGED_IN", _IOC_NONE, 0x6e03, 0x00 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETCHARSETS", _IOC_READ|_IOC_WRITE, 0x6e0b, 0x2a }, -{ "linux/ncp_fs.h", "NCP_IOC_GETDENTRYTTL", _IOC_WRITE, 0x6e0c, 0x04 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID", _IOC_WRITE, 0x6e02, 0x02 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID2", _IOC_WRITE, 0x6e02, 0x04 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETOBJECTNAME", _IOC_READ|_IOC_WRITE, 0x6e09, 0x0c }, -{ "linux/ncp_fs.h", "NCP_IOC_GETPRIVATEDATA", _IOC_READ|_IOC_WRITE, 0x6e0a, 0x08 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETROOT", _IOC_WRITE, 0x6e08, 0x0c }, -{ "linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO", _IOC_READ|_IOC_WRITE, 0x6e04, 0x28 }, -{ "linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO_V2", _IOC_READ|_IOC_WRITE, 0x6e04, 0x24 }, -{ "linux/ncp_fs.h", "NCP_IOC_LOCKUNLOCK", _IOC_READ, 0x6e07, 0x14 }, -{ "linux/ncp_fs.h", "NCP_IOC_NCPREQUEST", _IOC_READ, 0x6e01, 0x0c }, -{ "linux/ncp_fs.h", "NCP_IOC_SETCHARSETS", _IOC_READ, 0x6e0b, 0x2a }, -{ "linux/ncp_fs.h", "NCP_IOC_SETDENTRYTTL", _IOC_READ, 0x6e0c, 0x04 }, -{ "linux/ncp_fs.h", "NCP_IOC_SETOBJECTNAME", _IOC_READ, 0x6e09, 0x0c }, -{ "linux/ncp_fs.h", "NCP_IOC_SETPRIVATEDATA", _IOC_READ, 0x6e0a, 0x08 }, -{ "linux/ncp_fs.h", "NCP_IOC_SETROOT", _IOC_READ, 0x6e08, 0x0c }, -{ "linux/ncp_fs.h", "NCP_IOC_SET_SIGN_WANTED", _IOC_WRITE, 0x6e06, 0x04 }, -{ "linux/ncp_fs.h", "NCP_IOC_SIGN_INIT", _IOC_READ, 0x6e05, 0x18 }, -{ "linux/ncp_fs.h", "NCP_IOC_SIGN_WANTED", _IOC_READ, 0x6e06, 0x04 }, { "linux/ndctl.h", "ND_IOCTL_ARS_CAP", _IOC_READ|_IOC_WRITE, 0x4e01, 0x20 }, { "linux/ndctl.h", "ND_IOCTL_ARS_START", _IOC_READ|_IOC_WRITE, 0x4e02, 0x20 }, { "linux/ndctl.h", "ND_IOCTL_ARS_STATUS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x30 }, @@ -1439,8 +1472,6 @@ { "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e05, 0x0c }, { "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_SIZE", _IOC_READ|_IOC_WRITE, 0x4e04, 0x0c }, { "linux/ndctl.h", "ND_IOCTL_SET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e06, 0x08 }, -{ "linux/ndctl.h", "ND_IOCTL_SMART", _IOC_READ|_IOC_WRITE, 0x4e01, 0x84 }, -{ "linux/ndctl.h", "ND_IOCTL_SMART_THRESHOLD", _IOC_READ|_IOC_WRITE, 0x4e02, 0x0c }, { "linux/ndctl.h", "ND_IOCTL_VENDOR", _IOC_READ|_IOC_WRITE, 0x4e09, 0x08 }, { "linux/nilfs2_api.h", "NILFS_IOCTL_CHANGE_CPMODE", _IOC_WRITE, 0x6e80, 0x10 }, { "linux/nilfs2_api.h", "NILFS_IOCTL_CLEAN_SEGMENTS", _IOC_WRITE, 0x6e88, 0x78 }, @@ -1455,6 +1486,8 @@ { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 }, { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 }, { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 }, +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 }, +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 }, { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 }, { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 }, { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 0x4e41, 0x48 }, @@ -1473,6 +1506,7 @@ { "linux/omap3isp.h", "VIDIOC_OMAP3ISP_PRV_CFG", _IOC_READ|_IOC_WRITE, 0x56c2, 0x3c }, { "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_EN", _IOC_READ|_IOC_WRITE, 0x56c7, 0x04 }, { "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_REQ", _IOC_READ|_IOC_WRITE, 0x56c6, 0x18 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_REQ_TIME32", _IOC_READ|_IOC_WRITE, 0x56c6, 0x18 }, { "linux/omapfb.h", "OMAPFB_CTRL_TEST", _IOC_WRITE, 0x4f2e, 0x04 }, { "linux/omapfb.h", "OMAPFB_GET_CAPS", _IOC_READ, 0x4f2a, 0x0c }, { "linux/omapfb.h", "OMAPFB_GET_COLOR_KEY", _IOC_WRITE, 0x4f33, 0x10 }, @@ -1496,11 +1530,22 @@ { "linux/omapfb.h", "OMAPFB_VSYNC", _IOC_NONE, 0x4f26, 0x00 }, { "linux/omapfb.h", "OMAPFB_WAITFORGO", _IOC_NONE, 0x4f3c, 0x00 }, { "linux/omapfb.h", "OMAPFB_WAITFORVSYNC", _IOC_NONE, 0x4f39, 0x00 }, +{ "linux/pcitest.h", "PCITEST_BAR", _IOC_NONE, 0x5001, 0x00 }, +{ "linux/pcitest.h", "PCITEST_COPY", _IOC_WRITE, 0x5006, 0x04 }, +{ "linux/pcitest.h", "PCITEST_GET_IRQTYPE", _IOC_NONE, 0x5009, 0x00 }, +{ "linux/pcitest.h", "PCITEST_LEGACY_IRQ", _IOC_NONE, 0x5002, 0x00 }, +{ "linux/pcitest.h", "PCITEST_MSI", _IOC_WRITE, 0x5003, 0x04 }, +{ "linux/pcitest.h", "PCITEST_MSIX", _IOC_WRITE, 0x5007, 0x04 }, +{ "linux/pcitest.h", "PCITEST_READ", _IOC_WRITE, 0x5005, 0x04 }, +{ "linux/pcitest.h", "PCITEST_SET_IRQTYPE", _IOC_WRITE, 0x5008, 0x04 }, +{ "linux/pcitest.h", "PCITEST_WRITE", _IOC_WRITE, 0x5004, 0x04 }, { "linux/perf_event.h", "PERF_EVENT_IOC_DISABLE", _IOC_NONE, 0x2401, 0x00 }, { "linux/perf_event.h", "PERF_EVENT_IOC_ENABLE", _IOC_NONE, 0x2400, 0x00 }, { "linux/perf_event.h", "PERF_EVENT_IOC_ID", _IOC_READ, 0x2407, 0x04 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_MODIFY_ATTRIBUTES", _IOC_WRITE, 0x240b, 0x04 }, { "linux/perf_event.h", "PERF_EVENT_IOC_PAUSE_OUTPUT", _IOC_WRITE, 0x2409, 0x04 }, { "linux/perf_event.h", "PERF_EVENT_IOC_PERIOD", _IOC_WRITE, 0x2404, 0x08 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_QUERY_BPF", _IOC_READ|_IOC_WRITE, 0x240a, 0x04 }, { "linux/perf_event.h", "PERF_EVENT_IOC_REFRESH", _IOC_NONE, 0x2402, 0x00 }, { "linux/perf_event.h", "PERF_EVENT_IOC_RESET", _IOC_NONE, 0x2403, 0x00 }, { "linux/perf_event.h", "PERF_EVENT_IOC_SET_BPF", _IOC_WRITE, 0x2408, 0x04 }, @@ -1588,6 +1633,7 @@ { "linux/pr.h", "IOC_PR_REGISTER", _IOC_WRITE, 0x70c8, 0x18 }, { "linux/pr.h", "IOC_PR_RELEASE", _IOC_WRITE, 0x70ca, 0x10 }, { "linux/pr.h", "IOC_PR_RESERVE", _IOC_WRITE, 0x70c9, 0x10 }, +{ "linux/psp-sev.h", "SEV_ISSUE_CMD", _IOC_READ|_IOC_WRITE, 0x5300, 0x10 }, { "linux/ptp_clock.h", "PTP_CLOCK_GETCAPS", _IOC_READ, 0x3d01, 0x50 }, { "linux/ptp_clock.h", "PTP_ENABLE_PPS", _IOC_WRITE, 0x3d04, 0x04 }, { "linux/ptp_clock.h", "PTP_EXTTS_REQUEST", _IOC_WRITE, 0x3d02, 0x10 }, @@ -1595,6 +1641,7 @@ { "linux/ptp_clock.h", "PTP_PIN_GETFUNC", _IOC_READ|_IOC_WRITE, 0x3d06, 0x60 }, { "linux/ptp_clock.h", "PTP_PIN_SETFUNC", _IOC_WRITE, 0x3d07, 0x60 }, { "linux/ptp_clock.h", "PTP_SYS_OFFSET", _IOC_WRITE, 0x3d05, 0x340 }, +{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_EXTENDED", _IOC_READ|_IOC_WRITE, 0x3d09, 0x4c0 }, { "linux/ptp_clock.h", "PTP_SYS_OFFSET_PRECISE", _IOC_READ|_IOC_WRITE, 0x3d08, 0x40 }, { "linux/radeonfb.h", "FBIO_RADEON_GET_MIRROR", _IOC_READ, 0x4003, 0x04 }, { "linux/radeonfb.h", "FBIO_RADEON_SET_MIRROR", _IOC_WRITE, 0x4004, 0x04 }, @@ -1625,6 +1672,7 @@ { "linux/random.h", "RNDCLEARPOOL", _IOC_NONE, 0x5206, 0x00 }, { "linux/random.h", "RNDGETENTCNT", _IOC_READ, 0x5200, 0x04 }, { "linux/random.h", "RNDGETPOOL", _IOC_READ, 0x5202, 0x08 }, +{ "linux/random.h", "RNDRESEEDCRNG", _IOC_NONE, 0x5207, 0x00 }, { "linux/random.h", "RNDZAPENTCNT", _IOC_NONE, 0x5204, 0x00 }, { "linux/raw.h", "RAW_GETBIND", _IOC_NONE, 0xac01, 0x00 }, { "linux/raw.h", "RAW_SETBIND", _IOC_NONE, 0xac00, 0x00 }, @@ -1665,6 +1713,8 @@ { "linux/rio_mport_cdev.h", "RIO_UNMAP_INBOUND", _IOC_WRITE, 0x6d12, 0x08 }, { "linux/rio_mport_cdev.h", "RIO_UNMAP_OUTBOUND", _IOC_WRITE, 0x6d10, 0x28 }, { "linux/rio_mport_cdev.h", "RIO_WAIT_FOR_ASYNC", _IOC_WRITE, 0x6d16, 0x08 }, +{ "linux/rpmsg.h", "RPMSG_CREATE_EPT_IOCTL", _IOC_WRITE, 0xb501, 0x28 }, +{ "linux/rpmsg.h", "RPMSG_DESTROY_EPT_IOCTL", _IOC_NONE, 0xb502, 0x00 }, { "linux/rtc.h", "RTC_AIE_OFF", _IOC_NONE, 0x7002, 0x00 }, { "linux/rtc.h", "RTC_AIE_ON", _IOC_NONE, 0x7001, 0x00 }, { "linux/rtc.h", "RTC_ALM_READ", _IOC_READ, 0x7008, 0x24 }, @@ -1704,6 +1754,21 @@ { "linux/scif_ioctl.h", "SCIF_VREADFROM", _IOC_READ|_IOC_WRITE, 0x730c, 0x24 }, { "linux/scif_ioctl.h", "SCIF_VWRITETO", _IOC_READ|_IOC_WRITE, 0x730d, 0x24 }, { "linux/scif_ioctl.h", "SCIF_WRITETO", _IOC_READ|_IOC_WRITE, 0x730b, 0x24 }, +{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_ID_VALID", _IOC_READ, 0x2102, 0x08 }, +{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_RECV", _IOC_READ|_IOC_WRITE, 0x2100, 0x50 }, +{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_SEND", _IOC_READ|_IOC_WRITE, 0x2101, 0x18 }, +{ "linux/sed-opal.h", "IOC_OPAL_ACTIVATE_LSP", _IOC_WRITE, 0x70df, 0x118 }, +{ "linux/sed-opal.h", "IOC_OPAL_ACTIVATE_USR", _IOC_WRITE, 0x70e1, 0x110 }, +{ "linux/sed-opal.h", "IOC_OPAL_ADD_USR_TO_LR", _IOC_WRITE, 0x70e4, 0x118 }, +{ "linux/sed-opal.h", "IOC_OPAL_ENABLE_DISABLE_MBR", _IOC_WRITE, 0x70e5, 0x110 }, +{ "linux/sed-opal.h", "IOC_OPAL_ERASE_LR", _IOC_WRITE, 0x70e6, 0x110 }, +{ "linux/sed-opal.h", "IOC_OPAL_LOCK_UNLOCK", _IOC_WRITE, 0x70dd, 0x118 }, +{ "linux/sed-opal.h", "IOC_OPAL_LR_SETUP", _IOC_WRITE, 0x70e3, 0x128 }, +{ "linux/sed-opal.h", "IOC_OPAL_REVERT_TPR", _IOC_WRITE, 0x70e2, 0x108 }, +{ "linux/sed-opal.h", "IOC_OPAL_SAVE", _IOC_WRITE, 0x70dc, 0x118 }, +{ "linux/sed-opal.h", "IOC_OPAL_SECURE_ERASE_LR", _IOC_WRITE, 0x70e7, 0x110 }, +{ "linux/sed-opal.h", "IOC_OPAL_SET_PW", _IOC_WRITE, 0x70e0, 0x220 }, +{ "linux/sed-opal.h", "IOC_OPAL_TAKE_OWNERSHIP", _IOC_WRITE, 0x70de, 0x108 }, { "linux/serio.h", "SPIOCSTYPE", _IOC_WRITE, 0x7101, 0x04 }, { "linux/sockios.h", "SIOCADDDLCI", 0, 0x8980, 0 }, { "linux/sockios.h", "SIOCADDMULTI", 0, 0x8931, 0 }, @@ -1916,6 +1981,12 @@ { "linux/suspend_ioctls.h", "SNAPSHOT_S2RAM", _IOC_NONE, 0x330b, 0x00 }, { "linux/suspend_ioctls.h", "SNAPSHOT_SET_SWAP_AREA", _IOC_WRITE, 0x330d, 0x0c }, { "linux/suspend_ioctls.h", "SNAPSHOT_UNFREEZE", _IOC_NONE, 0x3302, 0x00 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_CTL", _IOC_READ|_IOC_WRITE, 0x5743, 0x28 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_SUMMARY", _IOC_READ, 0x5742, 0x198 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_FLASH_INFO", _IOC_READ, 0x5740, 0x10 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_FLASH_PART_INFO", _IOC_READ|_IOC_WRITE, 0x5741, 0x10 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_PFF_TO_PORT", _IOC_READ|_IOC_WRITE, 0x5744, 0x0c }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_PORT_TO_PFF", _IOC_READ|_IOC_WRITE, 0x5745, 0x0c }, { "linux/sync_file.h", "SYNC_IOC_FILE_INFO", _IOC_READ|_IOC_WRITE, 0x3e04, 0x38 }, { "linux/sync_file.h", "SYNC_IOC_MERGE", _IOC_READ|_IOC_WRITE, 0x3e03, 0x30 }, { "linux/synclink.h", "MGSL_IOCCLRMODCOUNT", _IOC_NONE, 0x6d0f, 0x00 }, @@ -1938,53 +2009,15 @@ { "linux/synclink.h", "MGSL_IOCTXENABLE", _IOC_NONE, 0x6d04, 0x00 }, { "linux/synclink.h", "MGSL_IOCWAITEVENT", _IOC_READ|_IOC_WRITE, 0x6d08, 0x04 }, { "linux/synclink.h", "MGSL_IOCWAITGPIO", _IOC_READ|_IOC_WRITE, 0x6d12, 0x10 }, -{ "linux/telephony.h", "OLD_PHONE_RING_START", _IOC_NONE, 0x7187, 0x00 }, -{ "linux/telephony.h", "PHONE_BUSY", _IOC_NONE, 0x71a1, 0x00 }, -{ "linux/telephony.h", "PHONE_CAPABILITIES", _IOC_NONE, 0x7180, 0x00 }, -{ "linux/telephony.h", "PHONE_CAPABILITIES_CHECK", _IOC_WRITE, 0x7182, 0x04 }, -{ "linux/telephony.h", "PHONE_CAPABILITIES_LIST", _IOC_READ, 0x7181, 0x04 }, -{ "linux/telephony.h", "PHONE_CPT_STOP", _IOC_NONE, 0x71a4, 0x00 }, -{ "linux/telephony.h", "PHONE_DIALTONE", _IOC_NONE, 0x71a3, 0x00 }, -{ "linux/telephony.h", "PHONE_DTMF_OOB", _IOC_WRITE, 0x7199, 0x04 }, -{ "linux/telephony.h", "PHONE_DTMF_READY", _IOC_READ, 0x7196, 0x04 }, -{ "linux/telephony.h", "PHONE_EXCEPTION", _IOC_READ, 0x719a, 0x04 }, -{ "linux/telephony.h", "PHONE_FRAME", _IOC_WRITE, 0x718d, 0x04 }, -{ "linux/telephony.h", "PHONE_GET_DTMF", _IOC_READ, 0x7197, 0x04 }, -{ "linux/telephony.h", "PHONE_GET_DTMF_ASCII", _IOC_READ, 0x7198, 0x04 }, -{ "linux/telephony.h", "PHONE_GET_TONE_OFF_TIME", _IOC_NONE, 0x719f, 0x00 }, -{ "linux/telephony.h", "PHONE_GET_TONE_ON_TIME", _IOC_NONE, 0x719e, 0x00 }, -{ "linux/telephony.h", "PHONE_GET_TONE_STATE", _IOC_NONE, 0x71a0, 0x00 }, -{ "linux/telephony.h", "PHONE_HOOKSTATE", _IOC_NONE, 0x7184, 0x00 }, -{ "linux/telephony.h", "PHONE_MAXRINGS", _IOC_WRITE, 0x7185, 0x01 }, -{ "linux/telephony.h", "PHONE_PLAY_CODEC", _IOC_WRITE, 0x7190, 0x04 }, -{ "linux/telephony.h", "PHONE_PLAY_DEPTH", _IOC_WRITE, 0x7193, 0x04 }, -{ "linux/telephony.h", "PHONE_PLAY_LEVEL", _IOC_NONE, 0x7195, 0x00 }, -{ "linux/telephony.h", "PHONE_PLAY_START", _IOC_NONE, 0x7191, 0x00 }, -{ "linux/telephony.h", "PHONE_PLAY_STOP", _IOC_NONE, 0x7192, 0x00 }, -{ "linux/telephony.h", "PHONE_PLAY_TONE", _IOC_WRITE, 0x719b, 0x01 }, -{ "linux/telephony.h", "PHONE_PLAY_VOLUME", _IOC_WRITE, 0x7194, 0x04 }, -{ "linux/telephony.h", "PHONE_PLAY_VOLUME_LINEAR", _IOC_WRITE, 0x71dc, 0x04 }, -{ "linux/telephony.h", "PHONE_PSTN_GET_STATE", _IOC_NONE, 0x71a5, 0x00 }, -{ "linux/telephony.h", "PHONE_PSTN_LINETEST", _IOC_NONE, 0x71a8, 0x00 }, -{ "linux/telephony.h", "PHONE_PSTN_SET_STATE", _IOC_WRITE, 0x71a4, 0x04 }, -{ "linux/telephony.h", "PHONE_QUERY_CODEC", _IOC_READ|_IOC_WRITE, 0x71a7, 0x04 }, -{ "linux/telephony.h", "PHONE_REC_CODEC", _IOC_WRITE, 0x7189, 0x04 }, -{ "linux/telephony.h", "PHONE_REC_DEPTH", _IOC_WRITE, 0x718c, 0x04 }, -{ "linux/telephony.h", "PHONE_REC_LEVEL", _IOC_NONE, 0x718f, 0x00 }, -{ "linux/telephony.h", "PHONE_REC_START", _IOC_NONE, 0x718a, 0x00 }, -{ "linux/telephony.h", "PHONE_REC_STOP", _IOC_NONE, 0x718b, 0x00 }, -{ "linux/telephony.h", "PHONE_REC_VOLUME", _IOC_WRITE, 0x718e, 0x04 }, -{ "linux/telephony.h", "PHONE_REC_VOLUME_LINEAR", _IOC_WRITE, 0x71db, 0x04 }, -{ "linux/telephony.h", "PHONE_RING", _IOC_NONE, 0x7183, 0x00 }, -{ "linux/telephony.h", "PHONE_RINGBACK", _IOC_NONE, 0x71a2, 0x00 }, -{ "linux/telephony.h", "PHONE_RING_CADENCE", _IOC_WRITE, 0x7186, 0x02 }, -{ "linux/telephony.h", "PHONE_RING_START", _IOC_WRITE, 0x7187, 0x04 }, -{ "linux/telephony.h", "PHONE_RING_STOP", _IOC_NONE, 0x7188, 0x00 }, -{ "linux/telephony.h", "PHONE_SET_TONE_OFF_TIME", _IOC_WRITE, 0x719d, 0x04 }, -{ "linux/telephony.h", "PHONE_SET_TONE_ON_TIME", _IOC_WRITE, 0x719c, 0x04 }, -{ "linux/telephony.h", "PHONE_VAD", _IOC_WRITE, 0x71a9, 0x04 }, -{ "linux/telephony.h", "PHONE_WINK", _IOC_WRITE, 0x71aa, 0x04 }, -{ "linux/telephony.h", "PHONE_WINK_DURATION", _IOC_WRITE, 0x71a6, 0x04 }, +{ "linux/tee.h", "TEE_IOC_CANCEL", _IOC_READ, 0xa404, 0x08 }, +{ "linux/tee.h", "TEE_IOC_CLOSE_SESSION", _IOC_READ, 0xa405, 0x04 }, +{ "linux/tee.h", "TEE_IOC_INVOKE", _IOC_READ, 0xa403, 0x10 }, +{ "linux/tee.h", "TEE_IOC_OPEN_SESSION", _IOC_READ, 0xa402, 0x10 }, +{ "linux/tee.h", "TEE_IOC_SHM_ALLOC", _IOC_READ|_IOC_WRITE, 0xa401, 0x10 }, +{ "linux/tee.h", "TEE_IOC_SHM_REGISTER", _IOC_READ|_IOC_WRITE, 0xa409, 0x18 }, +{ "linux/tee.h", "TEE_IOC_SUPPL_RECV", _IOC_READ, 0xa406, 0x10 }, +{ "linux/tee.h", "TEE_IOC_SUPPL_SEND", _IOC_READ, 0xa407, 0x10 }, +{ "linux/tee.h", "TEE_IOC_VERSION", _IOC_READ, 0xa400, 0x0c }, { "linux/timerfd.h", "TFD_IOC_SET_TICKS", _IOC_WRITE, 0x5400, 0x08 }, { "linux/toshiba.h", "TOSHIBA_ACPI_SCI", _IOC_READ|_IOC_WRITE, 0x7491, 0x18 }, { "linux/toshiba.h", "TOSH_SMM", _IOC_READ|_IOC_WRITE, 0x7490, 0x18 }, @@ -1992,6 +2025,8 @@ { "linux/udf_fs_i.h", "UDF_GETEASIZE", _IOC_READ, 0x6c40, 0x04 }, { "linux/udf_fs_i.h", "UDF_GETVOLIDENT", _IOC_READ, 0x6c42, 0x04 }, { "linux/udf_fs_i.h", "UDF_RELOCATE_BLOCKS", _IOC_READ|_IOC_WRITE, 0x6c43, 0x04 }, +{ "linux/udmabuf.h", "UDMABUF_CREATE", _IOC_WRITE, 0x7542, 0x18 }, +{ "linux/udmabuf.h", "UDMABUF_CREATE_LIST", _IOC_WRITE, 0x7543, 0x08 }, { "linux/uinput.h", "UI_ABS_SETUP", _IOC_WRITE, 0x5504, 0x1c }, { "linux/uinput.h", "UI_BEGIN_FF_ERASE", _IOC_READ|_IOC_WRITE, 0x55ca, 0x0c }, { "linux/uinput.h", "UI_BEGIN_FF_UPLOAD", _IOC_READ|_IOC_WRITE, 0x55c8, 0x60 }, @@ -2021,6 +2056,7 @@ { "linux/usb/functionfs.h", "FUNCTIONFS_INTERFACE_REVMAP", _IOC_NONE, 0x6780, 0x00 }, { "linux/usb/g_printer.h", "GADGET_GET_PRINTER_STATUS", _IOC_READ, 0x6721, 0x01 }, { "linux/usb/g_printer.h", "GADGET_SET_PRINTER_STATUS", _IOC_READ|_IOC_WRITE, 0x6722, 0x01 }, +{ "linux/usb/g_uvc.h", "UVCIOC_SEND_RESPONSE", _IOC_WRITE, 0x5501, 0x40 }, { "linux/usb/gadgetfs.h", "GADGETFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 }, { "linux/usb/gadgetfs.h", "GADGETFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 }, { "linux/usb/gadgetfs.h", "GADGETFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 }, @@ -2032,12 +2068,27 @@ { "linux/usb/tmc.h", "USBTMC488_IOCTL_LOCAL_LOCKOUT", _IOC_NONE, 0x5b15, 0x00 }, { "linux/usb/tmc.h", "USBTMC488_IOCTL_READ_STB", _IOC_READ, 0x5b12, 0x01 }, { "linux/usb/tmc.h", "USBTMC488_IOCTL_REN_CONTROL", _IOC_WRITE, 0x5b13, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_TRIGGER", _IOC_NONE, 0x5b16, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_WAIT_SRQ", _IOC_WRITE, 0x5b17, 0x04 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_IN", _IOC_NONE, 0x5b04, 0x00 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_OUT", _IOC_NONE, 0x5b03, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_API_VERSION", _IOC_READ, 0x5b10, 0x04 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_AUTO_ABORT", _IOC_WRITE, 0x5b19, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CANCEL_IO", _IOC_NONE, 0x5b23, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEANUP_IO", _IOC_NONE, 0x5b24, 0x00 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR", _IOC_NONE, 0x5b02, 0x00 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_IN_HALT", _IOC_NONE, 0x5b07, 0x00 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_OUT_HALT", _IOC_NONE, 0x5b06, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CONFIG_TERMCHAR", _IOC_WRITE, 0x5b0c, 0x02 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CTRL_REQUEST", _IOC_READ|_IOC_WRITE, 0x5b08, 0x0c }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_EOM_ENABLE", _IOC_WRITE, 0x5b0b, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_GET_TIMEOUT", _IOC_READ, 0x5b09, 0x04 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_INDICATOR_PULSE", _IOC_NONE, 0x5b01, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_MSG_IN_ATTR", _IOC_READ, 0x5b18, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_READ", _IOC_READ|_IOC_WRITE, 0x5b0e, 0x10 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_SET_TIMEOUT", _IOC_WRITE, 0x5b0a, 0x04 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_WRITE", _IOC_READ|_IOC_WRITE, 0x5b0d, 0x10 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_WRITE_RESULT", _IOC_READ|_IOC_WRITE, 0x5b0f, 0x04 }, { "linux/usbdevice_fs.h", "USBDEVFS_ALLOC_STREAMS", _IOC_READ, 0x551c, 0x08 }, { "linux/usbdevice_fs.h", "USBDEVFS_BULK", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 }, { "linux/usbdevice_fs.h", "USBDEVFS_BULK32", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 }, @@ -2057,6 +2108,7 @@ { "linux/usbdevice_fs.h", "USBDEVFS_FREE_STREAMS", _IOC_READ, 0x551d, 0x08 }, { "linux/usbdevice_fs.h", "USBDEVFS_GETDRIVER", _IOC_WRITE, 0x5508, 0x104 }, { "linux/usbdevice_fs.h", "USBDEVFS_GET_CAPABILITIES", _IOC_READ, 0x551a, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_GET_SPEED", _IOC_NONE, 0x551f, 0x00 }, { "linux/usbdevice_fs.h", "USBDEVFS_HUB_PORTINFO", _IOC_READ, 0x5513, 0x80 }, { "linux/usbdevice_fs.h", "USBDEVFS_IOCTL", _IOC_READ|_IOC_WRITE, 0x5512, 0x0c }, { "linux/usbdevice_fs.h", "USBDEVFS_IOCTL32", _IOC_READ|_IOC_WRITE, 0x5512, 0x0c }, @@ -2080,30 +2132,36 @@ { "linux/userfaultfd.h", "UFFDIO_ZEROPAGE", _IOC_READ|_IOC_WRITE, 0xaa04, 0x20 }, { "linux/uvcvideo.h", "UVCIOC_CTRL_MAP", _IOC_READ|_IOC_WRITE, 0x7520, 0x58 }, { "linux/uvcvideo.h", "UVCIOC_CTRL_QUERY", _IOC_READ|_IOC_WRITE, 0x7521, 0x0c }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x564b, 0x40 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_SIZE", _IOC_READ|_IOC_WRITE, 0x564a, 0x40 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_MBUS_CODE", _IOC_READ|_IOC_WRITE, 0x5602, 0x30 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x38 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x24 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0x58 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5615, 0x30 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x563d, 0x40 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_CROP", _IOC_READ|_IOC_WRITE, 0x563c, 0x38 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x24 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0x58 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5616, 0x30 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x563e, 0x40 }, +{ "linux/vboxguest.h", "VBG_IOCTL_CHANGE_FILTER_MASK", _IOC_READ|_IOC_WRITE, 0x560c, 0x20 }, +{ "linux/vboxguest.h", "VBG_IOCTL_CHANGE_GUEST_CAPABILITIES", _IOC_READ|_IOC_WRITE, 0x560e, 0x20 }, +{ "linux/vboxguest.h", "VBG_IOCTL_CHECK_BALLOON", _IOC_READ|_IOC_WRITE, 0x5611, 0x20 }, +{ "linux/vboxguest.h", "VBG_IOCTL_DRIVER_VERSION_INFO", _IOC_READ|_IOC_WRITE, 0x5600, 0x2c }, +{ "linux/vboxguest.h", "VBG_IOCTL_HGCM_CONNECT", _IOC_READ|_IOC_WRITE, 0x5604, 0x9c }, +{ "linux/vboxguest.h", "VBG_IOCTL_HGCM_DISCONNECT", _IOC_READ|_IOC_WRITE, 0x5605, 0x1c }, +{ "linux/vboxguest.h", "VBG_IOCTL_INTERRUPT_ALL_WAIT_FOR_EVENTS", _IOC_READ|_IOC_WRITE, 0x560b, 0x18 }, +{ "linux/vboxguest.h", "VBG_IOCTL_VMMDEV_REQUEST_BIG", _IOC_READ|_IOC_WRITE, 0x5603, 0x00 }, +{ "linux/vboxguest.h", "VBG_IOCTL_WAIT_FOR_EVENTS", _IOC_READ|_IOC_WRITE, 0x560a, 0x20 }, +{ "linux/vboxguest.h", "VBG_IOCTL_WRITE_CORE_DUMP", _IOC_READ|_IOC_WRITE, 0x5613, 0x1c }, { "linux/vfio.h", "VFIO_CHECK_EXTENSION", _IOC_NONE, 0x3b65, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_GFX_DMABUF", _IOC_NONE, 0x3b73, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_GET_INFO", _IOC_NONE, 0x3b6b, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_GET_IRQ_INFO", _IOC_NONE, 0x3b6d, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_GET_PCI_HOT_RESET_INFO", _IOC_NONE, 0x3b70, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_GET_REGION_INFO", _IOC_NONE, 0x3b6c, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_IOEVENTFD", _IOC_NONE, 0x3b74, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_PCI_HOT_RESET", _IOC_NONE, 0x3b71, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_QUERY_GFX_PLANE", _IOC_NONE, 0x3b72, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_RESET", _IOC_NONE, 0x3b6f, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_SET_IRQS", _IOC_NONE, 0x3b6e, 0x00 }, { "linux/vfio.h", "VFIO_EEH_PE_OP", _IOC_NONE, 0x3b79, 0x00 }, @@ -2123,6 +2181,7 @@ { "linux/vfio.h", "VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY", _IOC_NONE, 0x3b76, 0x00 }, { "linux/vfio.h", "VFIO_IOMMU_UNMAP_DMA", _IOC_NONE, 0x3b72, 0x00 }, { "linux/vfio.h", "VFIO_SET_IOMMU", _IOC_NONE, 0x3b66, 0x00 }, +{ "linux/vhost.h", "VHOST_GET_BACKEND_FEATURES", _IOC_READ, 0xaf26, 0x08 }, { "linux/vhost.h", "VHOST_GET_FEATURES", _IOC_READ, 0xaf00, 0x08 }, { "linux/vhost.h", "VHOST_GET_VRING_BASE", _IOC_READ|_IOC_WRITE, 0xaf12, 0x08 }, { "linux/vhost.h", "VHOST_GET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf24, 0x08 }, @@ -2134,6 +2193,7 @@ { "linux/vhost.h", "VHOST_SCSI_GET_EVENTS_MISSED", _IOC_WRITE, 0xaf44, 0x04 }, { "linux/vhost.h", "VHOST_SCSI_SET_ENDPOINT", _IOC_WRITE, 0xaf40, 0xe8 }, { "linux/vhost.h", "VHOST_SCSI_SET_EVENTS_MISSED", _IOC_WRITE, 0xaf43, 0x04 }, +{ "linux/vhost.h", "VHOST_SET_BACKEND_FEATURES", _IOC_WRITE, 0xaf25, 0x08 }, { "linux/vhost.h", "VHOST_SET_FEATURES", _IOC_WRITE, 0xaf00, 0x08 }, { "linux/vhost.h", "VHOST_SET_LOG_BASE", _IOC_WRITE, 0xaf04, 0x08 }, { "linux/vhost.h", "VHOST_SET_LOG_FD", _IOC_WRITE, 0xaf07, 0x04 }, @@ -2203,7 +2263,6 @@ { "linux/videodev2.h", "VIDIOC_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 }, { "linux/videodev2.h", "VIDIOC_QUERY_EXT_CTRL", _IOC_READ|_IOC_WRITE, 0x5667, 0xe8 }, { "linux/videodev2.h", "VIDIOC_REQBUFS", _IOC_READ|_IOC_WRITE, 0x5608, 0x14 }, -{ "linux/videodev2.h", "VIDIOC_RESERVED", _IOC_NONE, 0x5601, 0x00 }, { "linux/videodev2.h", "VIDIOC_STREAMOFF", _IOC_WRITE, 0x5613, 0x04 }, { "linux/videodev2.h", "VIDIOC_STREAMON", _IOC_WRITE, 0x5612, 0x04 }, { "linux/videodev2.h", "VIDIOC_SUBSCRIBE_EVENT", _IOC_WRITE, 0x565a, 0x20 }, @@ -2335,7 +2394,7 @@ { "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 }, { "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 }, { "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 }, -{ "media/davinci/vpfe_capture.h", "VPFE_CMD_S_CCDC_RAW_PARAMS", _IOC_WRITE, 0x56c1, 0x04 }, +{ "linux/wmi.h", "DELL_WMI_SMBIOS_CMD", _IOC_READ|_IOC_WRITE, 0x5700, 0x34 }, { "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 }, { "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 }, { "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 }, @@ -2353,6 +2412,23 @@ { "misc/cxl.h", "CXL_IOCTL_GET_PROCESS_ELEMENT", _IOC_READ, 0xca01, 0x04 }, { "misc/cxl.h", "CXL_IOCTL_START_WORK", _IOC_WRITE, 0xca00, 0x40 }, { "misc/cxl.h", "CXL_IOCTL_VALIDATE_IMAGE", _IOC_WRITE, 0xca0b, 0x40 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_ALLOC_DMA_BUFF", _IOC_READ|_IOC_WRITE, 0x5201, 0x10 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_FREE_DMA_BUFF", _IOC_READ|_IOC_WRITE, 0x5202, 0x04 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_ATTACH", _IOC_NONE, 0x5204, 0x00 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_CREATE", _IOC_READ|_IOC_WRITE, 0x5205, 0x18 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_INVOKE", _IOC_READ|_IOC_WRITE, 0x5203, 0x10 }, +{ "misc/habanalabs.h", "HL_IOCTL_CB", _IOC_READ|_IOC_WRITE, 0x4802, 0x18 }, +{ "misc/habanalabs.h", "HL_IOCTL_CS", _IOC_READ|_IOC_WRITE, 0x4803, 0x2c }, +{ "misc/habanalabs.h", "HL_IOCTL_INFO", _IOC_READ|_IOC_WRITE, 0x4801, 0x18 }, +{ "misc/habanalabs.h", "HL_IOCTL_MEMORY", _IOC_READ|_IOC_WRITE, 0x4805, 0x28 }, +{ "misc/habanalabs.h", "HL_IOCTL_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x4804, 0x18 }, +{ "misc/ocxl.h", "OCXL_IOCTL_ATTACH", _IOC_WRITE, 0xca10, 0x20 }, +{ "misc/ocxl.h", "OCXL_IOCTL_ENABLE_P9_WAIT", _IOC_READ, 0xca15, 0x20 }, +{ "misc/ocxl.h", "OCXL_IOCTL_GET_FEATURES", _IOC_READ, 0xca16, 0x20 }, +{ "misc/ocxl.h", "OCXL_IOCTL_GET_METADATA", _IOC_READ, 0xca14, 0x80 }, +{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_ALLOC", _IOC_READ, 0xca11, 0x08 }, +{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_FREE", _IOC_WRITE, 0xca12, 0x08 }, +{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_SET_FD", _IOC_WRITE, 0xca13, 0x10 }, { "mtd/mtd-abi.h", "ECCGETLAYOUT", _IOC_READ, 0x4d11, 0x148 }, { "mtd/mtd-abi.h", "ECCGETSTATS", _IOC_READ, 0x4d12, 0x10 }, { "mtd/mtd-abi.h", "MEMERASE", _IOC_WRITE, 0x4d02, 0x08 }, @@ -2386,8 +2462,10 @@ { "mtd/ubi-user.h", "UBI_IOCMKVOL", _IOC_WRITE, 0x6f00, 0x98 }, { "mtd/ubi-user.h", "UBI_IOCRMVOL", _IOC_WRITE, 0x6f01, 0x04 }, { "mtd/ubi-user.h", "UBI_IOCRNVOL", _IOC_WRITE, 0x6f03, 0x1110 }, +{ "mtd/ubi-user.h", "UBI_IOCRPEB", _IOC_WRITE, 0x6f04, 0x04 }, { "mtd/ubi-user.h", "UBI_IOCRSVOL", _IOC_WRITE, 0x6f02, 0x0c }, { "mtd/ubi-user.h", "UBI_IOCSETVOLPROP", _IOC_WRITE, 0x4f06, 0x10 }, +{ "mtd/ubi-user.h", "UBI_IOCSPEB", _IOC_WRITE, 0x6f05, 0x04 }, { "mtd/ubi-user.h", "UBI_IOCVOLCRBLK", _IOC_WRITE, 0x4f07, 0x80 }, { "mtd/ubi-user.h", "UBI_IOCVOLRMBLK", _IOC_NONE, 0x4f08, 0x00 }, { "mtd/ubi-user.h", "UBI_IOCVOLUP", _IOC_WRITE, 0x4f00, 0x08 }, @@ -2418,23 +2496,24 @@ { "net/bluetooth/rfcomm.h", "RFCOMMRELEASEDEV", _IOC_WRITE, 0x52c9, 0x04 }, { "net/bluetooth/rfcomm.h", "RFCOMMSTEALDLC", _IOC_WRITE, 0x52dc, 0x04 }, { "net/nfc/nci_core.h", "NCIUARTSETDRIVER", _IOC_WRITE, 0x5500, 0x04 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_ACK_EVENT", _IOC_WRITE, 0x1bea, 0x04 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_ASSIGN_CTXT", _IOC_READ|_IOC_WRITE, 0x1be1, 0x1c }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CREDIT_UPD", _IOC_NONE, 0x1be6, 0x00 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CTXT_INFO", _IOC_WRITE, 0x1be2, 0x28 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CTXT_RESET", _IOC_NONE, 0x1bec, 0x00 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_GET_VERS", _IOC_READ, 0x1bee, 0x04 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_POLL_TYPE", _IOC_WRITE, 0x1be9, 0x04 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_RECV_CTRL", _IOC_WRITE, 0x1be8, 0x04 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_SET_PKEY", _IOC_WRITE, 0x1beb, 0x02 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_FREE", _IOC_READ|_IOC_WRITE, 0x1be5, 0x18 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_INVAL_READ", _IOC_READ|_IOC_WRITE, 0x1bed, 0x18 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_UPDATE", _IOC_READ|_IOC_WRITE, 0x1be4, 0x18 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_USER_INFO", _IOC_WRITE, 0x1be3, 0x78 }, -{ "rdma/ib_user_mad.h", "IB_USER_MAD_ENABLE_PKEY", _IOC_NONE, 0x1b03, 0x00 }, -{ "rdma/ib_user_mad.h", "IB_USER_MAD_REGISTER_AGENT", _IOC_READ|_IOC_WRITE, 0x1b01, 0x1c }, -{ "rdma/ib_user_mad.h", "IB_USER_MAD_REGISTER_AGENT2", _IOC_READ|_IOC_WRITE, 0x1b04, 0x28 }, -{ "rdma/ib_user_mad.h", "IB_USER_MAD_UNREGISTER_AGENT", _IOC_WRITE, 0x1b02, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_ACK_EVENT", _IOC_WRITE, 0x1bea, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_ASSIGN_CTXT", _IOC_READ|_IOC_WRITE, 0x1be1, 0x1c }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CREDIT_UPD", _IOC_NONE, 0x1be6, 0x00 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CTXT_INFO", _IOC_WRITE, 0x1be2, 0x28 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CTXT_RESET", _IOC_NONE, 0x1bec, 0x00 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_GET_VERS", _IOC_READ, 0x1bee, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_POLL_TYPE", _IOC_WRITE, 0x1be9, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_RECV_CTRL", _IOC_WRITE, 0x1be8, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_SET_PKEY", _IOC_WRITE, 0x1beb, 0x02 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_FREE", _IOC_READ|_IOC_WRITE, 0x1be5, 0x18 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_INVAL_READ", _IOC_READ|_IOC_WRITE, 0x1bed, 0x18 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_UPDATE", _IOC_READ|_IOC_WRITE, 0x1be4, 0x18 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_USER_INFO", _IOC_WRITE, 0x1be3, 0x78 }, +{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_ENABLE_PKEY", _IOC_NONE, 0x1b03, 0x00 }, +{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_REGISTER_AGENT", _IOC_READ|_IOC_WRITE, 0x1b01, 0x1c }, +{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_REGISTER_AGENT2", _IOC_READ|_IOC_WRITE, 0x1b04, 0x28 }, +{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_UNREGISTER_AGENT", _IOC_WRITE, 0x1b02, 0x04 }, +{ "rdma/rdma_user_ioctl_cmds.h", "RDMA_VERBS_IOCTL", _IOC_READ|_IOC_WRITE, 0x1b01, 0x18 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_ATTACH", _IOC_READ|_IOC_WRITE, 0xca80, 0x90 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_DETACH", _IOC_READ|_IOC_WRITE, 0xca83, 0x60 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_MANAGE_LUN", _IOC_READ|_IOC_WRITE, 0xca86, 0x68 }, @@ -2445,6 +2524,8 @@ { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VERIFY", _IOC_READ|_IOC_WRITE, 0xca84, 0x90 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_CLONE", _IOC_READ|_IOC_WRITE, 0xca89, 0x70 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_RESIZE", _IOC_READ|_IOC_WRITE, 0xca88, 0x78 }, +{ "scsi/cxlflash_ioctl.h", "HT_CXLFLASH_AFU_DEBUG", _IOC_READ|_IOC_WRITE, 0xcabe, 0x78 }, +{ "scsi/cxlflash_ioctl.h", "HT_CXLFLASH_LUN_PROVISION", _IOC_READ|_IOC_WRITE, 0xcabf, 0xa0 }, { "scsi/scsi.h", "SCSI_IOCTL_GET_BUS_NUMBER", 0, 0x5386, 0 }, { "scsi/scsi.h", "SCSI_IOCTL_GET_IDLUN", 0, 0x5382, 0 }, { "scsi/scsi.h", "SCSI_IOCTL_GET_PCI", 0, 0x5387, 0 }, @@ -2563,6 +2644,7 @@ { "sound/asound.h", "SNDRV_PCM_IOCTL_TSTAMP", _IOC_WRITE, 0x4102, 0x04 }, { "sound/asound.h", "SNDRV_PCM_IOCTL_TTSTAMP", _IOC_WRITE, 0x4103, 0x04 }, { "sound/asound.h", "SNDRV_PCM_IOCTL_UNLINK", _IOC_NONE, 0x4161, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_USER_PVERSION", _IOC_WRITE, 0x4104, 0x04 }, { "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEI_FRAMES", _IOC_WRITE, 0x4150, 0x0c }, { "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEN_FRAMES", _IOC_WRITE, 0x4152, 0x0c }, { "sound/asound.h", "SNDRV_PCM_IOCTL_XRUN", _IOC_NONE, 0x4148, 0x00 }, @@ -2626,6 +2708,7 @@ { "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER", _IOC_NONE, 0x4882, 0x00 }, { "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_GET_INFO", _IOC_READ, 0x48f8, 0x20 }, { "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_LOCK", _IOC_NONE, 0x48f9, 0x00 }, +{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_TASCAM_STATE", _IOC_READ, 0x48fb, 0x100 }, { "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_UNLOCK", _IOC_NONE, 0x48fa, 0x00 }, { "sound/hda_hwdep.h", "HDA_IOCTL_GET_WCAP", _IOC_READ|_IOC_WRITE, 0x4812, 0x08 }, { "sound/hda_hwdep.h", "HDA_IOCTL_PVERSION", _IOC_READ, 0x4810, 0x04 }, @@ -2666,17 +2749,17 @@ { "staging/android/ashmem.h", "ASHMEM_SET_PROT_MASK", _IOC_WRITE, 0x7705, 0x04 }, { "staging/android/ashmem.h", "ASHMEM_SET_SIZE", _IOC_WRITE, 0x7703, 0x04 }, { "staging/android/ashmem.h", "ASHMEM_UNPIN", _IOC_WRITE, 0x7708, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_ALLOC", _IOC_READ|_IOC_WRITE, 0x4900, 0x14 }, -{ "staging/android/ion.h", "ION_IOC_CUSTOM", _IOC_READ|_IOC_WRITE, 0x4906, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_FREE", _IOC_READ|_IOC_WRITE, 0x4901, 0x04 }, +{ "staging/android/ion.h", "ION_IOC_ALLOC", _IOC_READ|_IOC_WRITE, 0x4900, 0x18 }, { "staging/android/ion.h", "ION_IOC_HEAP_QUERY", _IOC_READ|_IOC_WRITE, 0x4908, 0x18 }, -{ "staging/android/ion.h", "ION_IOC_IMPORT", _IOC_READ|_IOC_WRITE, 0x4905, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_MAP", _IOC_READ|_IOC_WRITE, 0x4902, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_SHARE", _IOC_READ|_IOC_WRITE, 0x4904, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_SYNC", _IOC_READ|_IOC_WRITE, 0x4907, 0x08 }, -{ "staging/android/ion_test.h", "ION_IOC_TEST_DMA_MAPPING", _IOC_WRITE, 0x49f1, 0x20 }, -{ "staging/android/ion_test.h", "ION_IOC_TEST_KERNEL_MAPPING", _IOC_WRITE, 0x49f2, 0x20 }, -{ "staging/android/ion_test.h", "ION_IOC_TEST_SET_FD", _IOC_NONE, 0x49f0, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_COND_WAIT", _IOC_READ|_IOC_WRITE, 0xf507, 0x20 }, +{ "staging/android/vsoc_shm.h", "VSOC_COND_WAKE", _IOC_NONE, 0xf508, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_CREATE_FD_SCOPED_PERMISSION", _IOC_WRITE, 0xf500, 0x10 }, +{ "staging/android/vsoc_shm.h", "VSOC_DESCRIBE_REGION", _IOC_READ, 0xf504, 0x3c }, +{ "staging/android/vsoc_shm.h", "VSOC_GET_FD_SCOPED_PERMISSION", _IOC_READ, 0xf501, 0x10 }, +{ "staging/android/vsoc_shm.h", "VSOC_MAYBE_SEND_INTERRUPT_TO_HOST", _IOC_NONE, 0xf502, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_SELF_INTERRUPT", _IOC_NONE, 0xf505, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_SEND_INTERRUPT_TO_HOST", _IOC_NONE, 0xf506, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_WAIT_FOR_INCOMING_INTERRUPT", _IOC_NONE, 0xf503, 0x00 }, { "video/da8xx-fb.h", "FBIGET_BRIGHTNESS", _IOC_READ, 0x4603, 0x04 }, { "video/da8xx-fb.h", "FBIGET_COLOR", _IOC_READ, 0x4605, 0x04 }, { "video/da8xx-fb.h", "FBIOGET_CONTRAST", _IOC_READ, 0x4601, 0x04 }, @@ -2719,6 +2802,10 @@ { "xen/evtchn.h", "IOCTL_EVTCHN_RESET", _IOC_NONE, 0x4505, 0x00 }, { "xen/evtchn.h", "IOCTL_EVTCHN_RESTRICT_DOMID", _IOC_NONE, 0x4506, 0x02 }, { "xen/evtchn.h", "IOCTL_EVTCHN_UNBIND", _IOC_NONE, 0x4503, 0x04 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS", _IOC_NONE, 0x4709, 0x14 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_WAIT_RELEASED", _IOC_NONE, 0x470a, 0x08 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_RELEASE", _IOC_NONE, 0x470c, 0x08 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_TO_REFS", _IOC_NONE, 0x470b, 0x14 }, { "xen/gntdev.h", "IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR", _IOC_NONE, 0x4702, 0x18 }, { "xen/gntdev.h", "IOCTL_GNTDEV_GRANT_COPY", _IOC_NONE, 0x4708, 0x08 }, { "xen/gntdev.h", "IOCTL_GNTDEV_MAP_GRANT_REF", _IOC_NONE, 0x4700, 0x18 }, diff --git a/linux/32/ioctls_inc_align64.h b/linux/32/ioctls_inc_align64.h index fcd9d8c2..7df239e1 100644 --- a/linux/32/ioctls_inc_align64.h +++ b/linux/32/ioctls_inc_align64.h @@ -34,11 +34,13 @@ { "asm-generic/ioctls.h", "TIOCGETD", 0, 0x5424, 0 }, { "asm-generic/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 }, { "asm-generic/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 }, +{ "asm-generic/ioctls.h", "TIOCGISO7816", _IOC_READ, 0x5442, 0x28 }, { "asm-generic/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 }, { "asm-generic/ioctls.h", "TIOCGPGRP", 0, 0x540F, 0 }, { "asm-generic/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 }, { "asm-generic/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 }, { "asm-generic/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGPTPEER", _IOC_NONE, 0x5441, 0x00 }, { "asm-generic/ioctls.h", "TIOCGRS485", 0, 0x542E, 0 }, { "asm-generic/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 }, { "asm-generic/ioctls.h", "TIOCGSID", 0, 0x5429, 0 }, @@ -65,6 +67,7 @@ { "asm-generic/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 }, { "asm-generic/ioctls.h", "TIOCSETD", 0, 0x5423, 0 }, { "asm-generic/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCSISO7816", _IOC_READ|_IOC_WRITE, 0x5443, 0x28 }, { "asm-generic/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 }, { "asm-generic/ioctls.h", "TIOCSPGRP", 0, 0x5410, 0 }, { "asm-generic/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 }, @@ -84,6 +87,7 @@ { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x6454, 0x20 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x120 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 }, @@ -92,6 +96,8 @@ { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_SCHED", _IOC_WRITE, 0x6455, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_VM", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 }, { "drm/drm.h", "DRM_IOCTL_ADD_BUFS", _IOC_READ|_IOC_WRITE, 0x6416, 0x18 }, @@ -109,6 +115,8 @@ { "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 }, { "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 }, { "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_CRTC_GET_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643b, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_CRTC_QUEUE_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643c, 0x18 }, { "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x28 }, { "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 }, { "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 }, @@ -136,6 +144,7 @@ { "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 }, { "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 }, { "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c6, 0x18 }, { "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c }, { "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 }, { "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 }, @@ -152,10 +161,13 @@ { "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 }, { "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 }, { "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GET_LEASE", _IOC_READ|_IOC_WRITE, 0x64c8, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_LIST_LESSEES", _IOC_READ|_IOC_WRITE, 0x64c7, 0x10 }, { "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 }, { "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x20 }, { "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x18 }, { "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_REVOKE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c9, 0x04 }, { "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 }, { "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 }, { "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 }, @@ -177,6 +189,13 @@ { "drm/drm.h", "DRM_IOCTL_SG_ALLOC", _IOC_READ|_IOC_WRITE, 0x6438, 0x08 }, { "drm/drm.h", "DRM_IOCTL_SG_FREE", _IOC_WRITE, 0x6439, 0x08 }, { "drm/drm.h", "DRM_IOCTL_SWITCH_CTX", _IOC_WRITE, 0x6424, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_CREATE", _IOC_READ|_IOC_WRITE, 0x64bf, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_DESTROY", _IOC_READ|_IOC_WRITE, 0x64c0, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x64c2, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD", _IOC_READ|_IOC_WRITE, 0x64c1, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_RESET", _IOC_READ|_IOC_WRITE, 0x64c4, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_SIGNAL", _IOC_READ|_IOC_WRITE, 0x64c5, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_WAIT", _IOC_READ|_IOC_WRITE, 0x64c3, 0x20 }, { "drm/drm.h", "DRM_IOCTL_UNBLOCK", _IOC_READ|_IOC_WRITE, 0x6413, 0x04 }, { "drm/drm.h", "DRM_IOCTL_UNLOCK", _IOC_WRITE, 0x642b, 0x08 }, { "drm/drm.h", "DRM_IOCTL_UPDATE_DRAW", _IOC_WRITE, 0x643f, 0x18 }, @@ -186,10 +205,12 @@ { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, -{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x30 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_DOM", _IOC_READ|_IOC_WRITE, 0x644a, 0x48 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_SIG", _IOC_READ|_IOC_WRITE, 0x644b, 0x4c }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 }, @@ -197,10 +218,10 @@ { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_GET", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, -{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_CMD_CTRL", _IOC_READ|_IOC_WRITE, 0x6473, 0x08 }, -{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY", _IOC_READ|_IOC_WRITE, 0x6470, 0x50 }, -{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_QUEUE_BUF", _IOC_READ|_IOC_WRITE, 0x6472, 0x28 }, -{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY", _IOC_READ|_IOC_WRITE, 0x6471, 0x60 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_COMMIT", _IOC_READ|_IOC_WRITE, 0x6483, 0x20 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6481, 0x18 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_LIMITS", _IOC_READ|_IOC_WRITE, 0x6482, 0x20 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_RESOURCES", _IOC_READ|_IOC_WRITE, 0x6480, 0x10 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_VIDI_CONNECTION", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, { "drm/i810_drm.h", "DRM_IOCTL_I810_CLEAR", _IOC_WRITE, 0x6442, 0x0c }, { "drm/i810_drm.h", "DRM_IOCTL_I810_COPY", _IOC_WRITE, 0x6447, 0x0c }, @@ -233,6 +254,7 @@ { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_ENTERVT", _IOC_NONE, 0x6459, 0x00 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER", _IOC_WRITE, 0x6454, 0x28 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2", _IOC_WRITE, 0x6469, 0x40 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2_WR", _IOC_READ|_IOC_WRITE, 0x6469, 0x40 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_APERTURE", _IOC_READ, 0x6463, 0x10 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_CACHING", _IOC_READ|_IOC_WRITE, 0x6470, 0x08 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6462, 0x10 }, @@ -264,11 +286,17 @@ { "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_WAIT", _IOC_WRITE, 0x6445, 0x04 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_ATTRS", _IOC_READ|_IOC_WRITE, 0x6468, 0x2c }, { "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_PUT_IMAGE", _IOC_WRITE, 0x6467, 0x2c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_ADD_CONFIG", _IOC_WRITE, 0x6477, 0x48 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_OPEN", _IOC_WRITE, 0x6476, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_REMOVE_CONFIG", _IOC_WRITE, 0x6478, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_QUERY", _IOC_READ|_IOC_WRITE, 0x6479, 0x10 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_REG_READ", _IOC_READ|_IOC_WRITE, 0x6471, 0x10 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_SETPARAM", _IOC_WRITE, 0x6447, 0x08 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_SET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646b, 0x14 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_SET_VBLANK_PIPE", _IOC_WRITE, 0x644d, 0x04 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_VBLANK_SWAP", _IOC_READ|_IOC_WRITE, 0x644f, 0x0c }, +{ "drm/i915_drm.h", "I915_PERF_IOCTL_DISABLE", _IOC_NONE, 0x6901, 0x00 }, +{ "drm/i915_drm.h", "I915_PERF_IOCTL_ENABLE", _IOC_NONE, 0x6900, 0x00 }, { "drm/mga_drm.h", "DRM_IOCTL_MGA_BLIT", _IOC_WRITE, 0x6448, 0x34 }, { "drm/mga_drm.h", "DRM_IOCTL_MGA_CLEAR", _IOC_WRITE, 0x6444, 0x14 }, { "drm/mga_drm.h", "DRM_IOCTL_MGA_DMA_BOOTSTRAP", _IOC_READ|_IOC_WRITE, 0x644c, 0x1c }, @@ -284,17 +312,21 @@ { "drm/mga_drm.h", "DRM_IOCTL_MGA_WAIT_FENCE", _IOC_READ|_IOC_WRITE, 0x644b, 0x04 }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x04 }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 }, -{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x28 }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, -{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x18 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE", _IOC_WRITE, 0x644b, 0x04 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_NEW", _IOC_READ|_IOC_WRITE, 0x644a, 0x0c }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6480, 0x30 }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_PUSHBUF", _IOC_READ|_IOC_WRITE, 0x6481, 0x40 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_SVM_BIND", _IOC_READ|_IOC_WRITE, 0x6449, 0x40 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_SVM_INIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 }, { "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x10 }, { "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x08 }, { "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 }, @@ -377,7 +409,7 @@ { "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_ALLOC", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, { "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_FREE", _IOC_WRITE, 0x6445, 0x10 }, { "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_INIT", _IOC_WRITE, 0x6456, 0x08 }, -{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_CLOSE_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6446, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_CLOSE_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6446, 0x08 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644d, 0x08 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 }, @@ -391,12 +423,26 @@ { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_INCR", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_READ", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_GET_BO_OFFSET", _IOC_READ|_IOC_WRITE, 0x6445, 0x08 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0x38 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_TFU", _IOC_WRITE, 0x6446, 0x44 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_LABEL_BO", _IOC_READ|_IOC_WRITE, 0x644a, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, -{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0xa0 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_CREATE", _IOC_READ|_IOC_WRITE, 0x644c, 0x18 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_DESTROY", _IOC_READ|_IOC_WRITE, 0x644d, 0x04 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_GET_VALUES", _IOC_READ|_IOC_WRITE, 0x644e, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0xb0 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_SEQNO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, { "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_ATTACH", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, @@ -415,7 +461,7 @@ { "drm/via_drm.h", "DRM_IOCTL_VIA_MAP_INIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x14 }, { "drm/via_drm.h", "DRM_IOCTL_VIA_PCICMD", _IOC_WRITE, 0x644a, 0x08 }, { "drm/via_drm.h", "DRM_IOCTL_VIA_WAIT_IRQ", _IOC_READ|_IOC_WRITE, 0x644d, 0x10 }, -{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_EXECBUFFER", _IOC_WRITE, 0x6442, 0x20 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_EXECBUFFER", _IOC_READ|_IOC_WRITE, 0x6442, 0x20 }, { "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, { "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6449, 0x18 }, { "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, @@ -451,9 +497,14 @@ { "linux/android/binder.h", "BC_REGISTER_LOOPER", _IOC_NONE, 0x630b, 0x00 }, { "linux/android/binder.h", "BC_RELEASE", _IOC_WRITE, 0x6306, 0x04 }, { "linux/android/binder.h", "BC_REPLY", _IOC_WRITE, 0x6301, 0x40 }, +{ "linux/android/binder.h", "BC_REPLY_SG", _IOC_WRITE, 0x6312, 0x48 }, { "linux/android/binder.h", "BC_REQUEST_DEATH_NOTIFICATION", _IOC_WRITE, 0x630e, 0x0c }, { "linux/android/binder.h", "BC_TRANSACTION", _IOC_WRITE, 0x6300, 0x40 }, +{ "linux/android/binder.h", "BC_TRANSACTION_SG", _IOC_WRITE, 0x6311, 0x48 }, +{ "linux/android/binder.h", "BINDER_GET_NODE_DEBUG_INFO", _IOC_READ|_IOC_WRITE, 0x620b, 0x18 }, +{ "linux/android/binder.h", "BINDER_GET_NODE_INFO_FOR_REF", _IOC_READ|_IOC_WRITE, 0x620c, 0x18 }, { "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR", _IOC_WRITE, 0x6207, 0x04 }, +{ "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR_EXT", _IOC_WRITE, 0x620d, 0x18 }, { "linux/android/binder.h", "BINDER_SET_IDLE_PRIORITY", _IOC_WRITE, 0x6206, 0x04 }, { "linux/android/binder.h", "BINDER_SET_IDLE_TIMEOUT", _IOC_WRITE, 0x6203, 0x08 }, { "linux/android/binder.h", "BINDER_SET_MAX_THREADS", _IOC_WRITE, 0x6205, 0x04 }, @@ -478,10 +529,14 @@ { "linux/android/binder.h", "BR_SPAWN_LOOPER", _IOC_NONE, 0x720d, 0x00 }, { "linux/android/binder.h", "BR_TRANSACTION", _IOC_READ, 0x7202, 0x40 }, { "linux/android/binder.h", "BR_TRANSACTION_COMPLETE", _IOC_NONE, 0x7206, 0x00 }, +{ "linux/android/binder.h", "BR_TRANSACTION_SEC_CTX", _IOC_READ, 0x7202, 0x48 }, +{ "linux/android/binderfs.h", "BINDER_CTL_ADD", _IOC_READ|_IOC_WRITE, 0x6201, 0x108 }, { "linux/apm_bios.h", "APM_IOC_STANDBY", _IOC_NONE, 0x4101, 0x00 }, { "linux/apm_bios.h", "APM_IOC_SUSPEND", _IOC_NONE, 0x4102, 0x00 }, { "linux/arcfb.h", "FBIO_GETCONTROL2", _IOC_READ, 0x4689, 0x04 }, { "linux/arcfb.h", "FBIO_WAITEVENT", _IOC_NONE, 0x4688, 0x00 }, +{ "linux/aspeed-lpc-ctrl.h", "ASPEED_LPC_CTRL_IOCTL_GET_SIZE", _IOC_READ|_IOC_WRITE, 0xb200, 0x10 }, +{ "linux/aspeed-lpc-ctrl.h", "ASPEED_LPC_CTRL_IOCTL_MAP", _IOC_WRITE, 0xb201, 0x10 }, { "linux/atm_eni.h", "ENI_MEMDUMP", _IOC_WRITE, 0x6160, 0x0c }, { "linux/atm_eni.h", "ENI_SETMULT", _IOC_WRITE, 0x6167, 0x0c }, { "linux/atm_he.h", "HE_GET_REG", _IOC_WRITE, 0x6160, 0x0c }, @@ -547,17 +602,19 @@ { "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_SETPIPEFD", _IOC_READ|_IOC_WRITE, 0x9378, 0x18 }, { "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_TIMEOUT", _IOC_READ|_IOC_WRITE, 0x937a, 0x18 }, { "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x9371, 0x18 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_ASKUMOUNT", _IOC_READ, 0x9370, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_CATATONIC", _IOC_NONE, 0x9362, 0x00 }, { "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE", _IOC_READ, 0x9365, 0x10c }, +{ "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE_MULTI", _IOC_WRITE, 0x9366, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_FAIL", _IOC_NONE, 0x9361, 0x00 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_PROTOSUBVER", _IOC_READ, 0x9367, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_PROTOVER", _IOC_READ, 0x9363, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_READY", _IOC_NONE, 0x9360, 0x00 }, { "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT", _IOC_READ|_IOC_WRITE, 0x9364, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT32", _IOC_READ|_IOC_WRITE, 0x9364, 0x04 }, -{ "linux/auto_fs4.h", "AUTOFS_IOC_ASKUMOUNT", _IOC_READ, 0x9370, 0x04 }, -{ "linux/auto_fs4.h", "AUTOFS_IOC_EXPIRE_MULTI", _IOC_WRITE, 0x9366, 0x04 }, -{ "linux/auto_fs4.h", "AUTOFS_IOC_PROTOSUBVER", _IOC_READ, 0x9367, 0x04 }, { "linux/blkpg.h", "BLKPG", _IOC_NONE, 0x1269, 0x00 }, +{ "linux/blkzoned.h", "BLKGETNRZONES", _IOC_READ, 0x1285, 0x04 }, +{ "linux/blkzoned.h", "BLKGETZONESZ", _IOC_READ, 0x1284, 0x04 }, { "linux/blkzoned.h", "BLKREPORTZONE", _IOC_READ|_IOC_WRITE, 0x1282, 0x10 }, { "linux/blkzoned.h", "BLKRESETZONE", _IOC_WRITE, 0x1283, 0x10 }, { "linux/bt-bmc.h", "BT_BMC_IOCTL_SMS_ATN", _IOC_NONE, 0xb100, 0x00 }, @@ -575,14 +632,18 @@ { "linux/btrfs.h", "BTRFS_IOC_DEV_INFO", _IOC_READ|_IOC_WRITE, 0x941e, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_DEV_REPLACE", _IOC_READ|_IOC_WRITE, 0x9435, 0xa28 }, { "linux/btrfs.h", "BTRFS_IOC_FILE_EXTENT_SAME", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 }, +{ "linux/btrfs.h", "BTRFS_IOC_FORGET_DEV", _IOC_WRITE, 0x9405, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_FS_INFO", _IOC_READ, 0x941f, 0x400 }, { "linux/btrfs.h", "BTRFS_IOC_GET_DEV_STATS", _IOC_READ|_IOC_WRITE, 0x9434, 0x408 }, { "linux/btrfs.h", "BTRFS_IOC_GET_FEATURES", _IOC_READ, 0x9439, 0x18 }, -{ "linux/btrfs.h", "BTRFS_IOC_GET_FSLABEL", _IOC_READ, 0x9431, 0x100 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_SUBVOL_INFO", _IOC_READ, 0x943c, 0x1f8 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_SUBVOL_ROOTREF", _IOC_READ|_IOC_WRITE, 0x943d, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_GET_SUPPORTED_FEATURES", _IOC_READ, 0x9439, 0x48 }, { "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP_USER", _IOC_READ|_IOC_WRITE, 0x943e, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 }, { "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 }, +{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO_V2", _IOC_READ|_IOC_WRITE, 0x943b, 0x38 }, { "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 }, { "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 }, { "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 }, @@ -599,7 +660,6 @@ { "linux/btrfs.h", "BTRFS_IOC_SCRUB_PROGRESS", _IOC_READ|_IOC_WRITE, 0x941d, 0x400 }, { "linux/btrfs.h", "BTRFS_IOC_SEND", _IOC_WRITE, 0x9426, 0x48 }, { "linux/btrfs.h", "BTRFS_IOC_SET_FEATURES", _IOC_WRITE, 0x9439, 0x30 }, -{ "linux/btrfs.h", "BTRFS_IOC_SET_FSLABEL", _IOC_WRITE, 0x9432, 0x100 }, { "linux/btrfs.h", "BTRFS_IOC_SET_RECEIVED_SUBVOL", _IOC_READ|_IOC_WRITE, 0x9425, 0xc8 }, { "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE", _IOC_WRITE, 0x9401, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE_V2", _IOC_WRITE, 0x9417, 0x1000 }, @@ -719,6 +779,7 @@ { "linux/cm4000_cs.h", "CM_IOCSRDR", _IOC_NONE, 0x6303, 0x00 }, { "linux/cm4000_cs.h", "CM_IOSDBGLVL", _IOC_WRITE, 0x63fa, 0x04 }, { "linux/coda.h", "CIOC_KERNEL_VERSION", _IOC_READ|_IOC_WRITE, 0x630a, 0x04 }, +{ "linux/dm-ioctl.h", "DM_DEV_ARM_POLL", _IOC_READ|_IOC_WRITE, 0xfd10, 0x138 }, { "linux/dm-ioctl.h", "DM_DEV_CREATE", _IOC_READ|_IOC_WRITE, 0xfd03, 0x138 }, { "linux/dm-ioctl.h", "DM_DEV_REMOVE", _IOC_READ|_IOC_WRITE, 0xfd04, 0x138 }, { "linux/dm-ioctl.h", "DM_DEV_RENAME", _IOC_READ|_IOC_WRITE, 0xfd05, 0x138 }, @@ -745,17 +806,13 @@ { "linux/dvb/audio.h", "AUDIO_CLEAR_BUFFER", _IOC_NONE, 0x6f0c, 0x00 }, { "linux/dvb/audio.h", "AUDIO_CONTINUE", _IOC_NONE, 0x6f04, 0x00 }, { "linux/dvb/audio.h", "AUDIO_GET_CAPABILITIES", _IOC_READ, 0x6f0b, 0x04 }, -{ "linux/dvb/audio.h", "AUDIO_GET_PTS", _IOC_READ, 0x6f13, 0x08 }, { "linux/dvb/audio.h", "AUDIO_GET_STATUS", _IOC_READ, 0x6f0a, 0x20 }, { "linux/dvb/audio.h", "AUDIO_PAUSE", _IOC_NONE, 0x6f03, 0x00 }, { "linux/dvb/audio.h", "AUDIO_PLAY", _IOC_NONE, 0x6f02, 0x00 }, { "linux/dvb/audio.h", "AUDIO_SELECT_SOURCE", _IOC_NONE, 0x6f05, 0x00 }, -{ "linux/dvb/audio.h", "AUDIO_SET_ATTRIBUTES", _IOC_WRITE, 0x6f11, 0x02 }, { "linux/dvb/audio.h", "AUDIO_SET_AV_SYNC", _IOC_NONE, 0x6f07, 0x00 }, { "linux/dvb/audio.h", "AUDIO_SET_BYPASS_MODE", _IOC_NONE, 0x6f08, 0x00 }, -{ "linux/dvb/audio.h", "AUDIO_SET_EXT_ID", _IOC_NONE, 0x6f10, 0x00 }, { "linux/dvb/audio.h", "AUDIO_SET_ID", _IOC_NONE, 0x6f0d, 0x00 }, -{ "linux/dvb/audio.h", "AUDIO_SET_KARAOKE", _IOC_WRITE, 0x6f12, 0x0c }, { "linux/dvb/audio.h", "AUDIO_SET_MIXER", _IOC_WRITE, 0x6f0e, 0x08 }, { "linux/dvb/audio.h", "AUDIO_SET_MUTE", _IOC_NONE, 0x6f06, 0x00 }, { "linux/dvb/audio.h", "AUDIO_SET_STREAMTYPE", _IOC_NONE, 0x6f0f, 0x00 }, @@ -767,16 +824,18 @@ { "linux/dvb/ca.h", "CA_RESET", _IOC_NONE, 0x6f80, 0x00 }, { "linux/dvb/ca.h", "CA_SEND_MSG", _IOC_WRITE, 0x6f85, 0x10c }, { "linux/dvb/ca.h", "CA_SET_DESCR", _IOC_WRITE, 0x6f86, 0x10 }, -{ "linux/dvb/ca.h", "CA_SET_PID", _IOC_WRITE, 0x6f87, 0x08 }, { "linux/dvb/dmx.h", "DMX_ADD_PID", _IOC_WRITE, 0x6f33, 0x02 }, -{ "linux/dvb/dmx.h", "DMX_GET_CAPS", _IOC_READ, 0x6f30, 0x08 }, +{ "linux/dvb/dmx.h", "DMX_DQBUF", _IOC_READ|_IOC_WRITE, 0x6f40, 0x18 }, +{ "linux/dvb/dmx.h", "DMX_EXPBUF", _IOC_READ|_IOC_WRITE, 0x6f3e, 0x0c }, { "linux/dvb/dmx.h", "DMX_GET_PES_PIDS", _IOC_READ, 0x6f2f, 0x0a }, { "linux/dvb/dmx.h", "DMX_GET_STC", _IOC_READ|_IOC_WRITE, 0x6f32, 0x10 }, +{ "linux/dvb/dmx.h", "DMX_QBUF", _IOC_READ|_IOC_WRITE, 0x6f3f, 0x18 }, +{ "linux/dvb/dmx.h", "DMX_QUERYBUF", _IOC_READ|_IOC_WRITE, 0x6f3d, 0x18 }, { "linux/dvb/dmx.h", "DMX_REMOVE_PID", _IOC_WRITE, 0x6f34, 0x02 }, +{ "linux/dvb/dmx.h", "DMX_REQBUFS", _IOC_READ|_IOC_WRITE, 0x6f3c, 0x08 }, { "linux/dvb/dmx.h", "DMX_SET_BUFFER_SIZE", _IOC_NONE, 0x6f2d, 0x00 }, { "linux/dvb/dmx.h", "DMX_SET_FILTER", _IOC_WRITE, 0x6f2b, 0x3c }, { "linux/dvb/dmx.h", "DMX_SET_PES_FILTER", _IOC_WRITE, 0x6f2c, 0x14 }, -{ "linux/dvb/dmx.h", "DMX_SET_SOURCE", _IOC_WRITE, 0x6f31, 0x04 }, { "linux/dvb/dmx.h", "DMX_START", _IOC_NONE, 0x6f29, 0x00 }, { "linux/dvb/dmx.h", "DMX_STOP", _IOC_NONE, 0x6f2a, 0x00 }, { "linux/dvb/frontend.h", "FE_DISEQC_RECV_SLAVE_REPLY", _IOC_READ, 0x6f40, 0x0c }, @@ -812,23 +871,15 @@ { "linux/dvb/video.h", "VIDEO_GET_CAPABILITIES", _IOC_READ, 0x6f21, 0x04 }, { "linux/dvb/video.h", "VIDEO_GET_EVENT", _IOC_READ, 0x6f1c, 0x14 }, { "linux/dvb/video.h", "VIDEO_GET_FRAME_COUNT", _IOC_READ, 0x6f3a, 0x08 }, -{ "linux/dvb/video.h", "VIDEO_GET_FRAME_RATE", _IOC_READ, 0x6f38, 0x04 }, -{ "linux/dvb/video.h", "VIDEO_GET_NAVI", _IOC_READ, 0x6f34, 0x404 }, { "linux/dvb/video.h", "VIDEO_GET_PTS", _IOC_READ, 0x6f39, 0x08 }, { "linux/dvb/video.h", "VIDEO_GET_SIZE", _IOC_READ, 0x6f37, 0x0c }, { "linux/dvb/video.h", "VIDEO_GET_STATUS", _IOC_READ, 0x6f1b, 0x14 }, { "linux/dvb/video.h", "VIDEO_PLAY", _IOC_NONE, 0x6f16, 0x00 }, { "linux/dvb/video.h", "VIDEO_SELECT_SOURCE", _IOC_NONE, 0x6f19, 0x00 }, -{ "linux/dvb/video.h", "VIDEO_SET_ATTRIBUTES", _IOC_NONE, 0x6f35, 0x00 }, { "linux/dvb/video.h", "VIDEO_SET_BLANK", _IOC_NONE, 0x6f1a, 0x00 }, { "linux/dvb/video.h", "VIDEO_SET_DISPLAY_FORMAT", _IOC_NONE, 0x6f1d, 0x00 }, { "linux/dvb/video.h", "VIDEO_SET_FORMAT", _IOC_NONE, 0x6f25, 0x00 }, -{ "linux/dvb/video.h", "VIDEO_SET_HIGHLIGHT", _IOC_WRITE, 0x6f27, 0x10 }, -{ "linux/dvb/video.h", "VIDEO_SET_ID", _IOC_NONE, 0x6f23, 0x00 }, -{ "linux/dvb/video.h", "VIDEO_SET_SPU", _IOC_WRITE, 0x6f32, 0x08 }, -{ "linux/dvb/video.h", "VIDEO_SET_SPU_PALETTE", _IOC_WRITE, 0x6f33, 0x08 }, { "linux/dvb/video.h", "VIDEO_SET_STREAMTYPE", _IOC_NONE, 0x6f24, 0x00 }, -{ "linux/dvb/video.h", "VIDEO_SET_SYSTEM", _IOC_NONE, 0x6f26, 0x00 }, { "linux/dvb/video.h", "VIDEO_SLOWMOTION", _IOC_NONE, 0x6f20, 0x00 }, { "linux/dvb/video.h", "VIDEO_STILLPICTURE", _IOC_WRITE, 0x6f1e, 0x08 }, { "linux/dvb/video.h", "VIDEO_STOP", _IOC_NONE, 0x6f15, 0x00 }, @@ -901,6 +952,14 @@ { "linux/firewire-cdev.h", "FW_CDEV_IOC_SET_ISO_CHANNELS", _IOC_WRITE, 0x2317, 0x10 }, { "linux/firewire-cdev.h", "FW_CDEV_IOC_START_ISO", _IOC_WRITE, 0x230a, 0x10 }, { "linux/firewire-cdev.h", "FW_CDEV_IOC_STOP_ISO", _IOC_WRITE, 0x230b, 0x04 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_CHECK_EXTENSION", _IOC_NONE, 0xb601, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_PR", _IOC_NONE, 0xb680, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_GET_API_VERSION", _IOC_NONE, 0xb600, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_MAP", _IOC_NONE, 0xb643, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_UNMAP", _IOC_NONE, 0xb644, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_INFO", _IOC_NONE, 0xb641, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_REGION_INFO", _IOC_NONE, 0xb642, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_RESET", _IOC_NONE, 0xb640, 0x00 }, { "linux/fs.h", "BLKALIGNOFF", _IOC_NONE, 0x127a, 0x00 }, { "linux/fs.h", "BLKBSZGET", _IOC_READ, 0x1270, 0x04 }, { "linux/fs.h", "BLKBSZSET", _IOC_WRITE, 0x1271, 0x04 }, @@ -945,12 +1004,18 @@ { "linux/fs.h", "FS_IOC_FSGETXATTR", _IOC_READ, 0x581f, 0x1c }, { "linux/fs.h", "FS_IOC_FSSETXATTR", _IOC_WRITE, 0x5820, 0x1c }, { "linux/fs.h", "FS_IOC_GETFLAGS", _IOC_READ, 0x6601, 0x04 }, +{ "linux/fs.h", "FS_IOC_GETFSLABEL", _IOC_READ, 0x9431, 0x100 }, { "linux/fs.h", "FS_IOC_GETVERSION", _IOC_READ, 0x7601, 0x04 }, { "linux/fs.h", "FS_IOC_GET_ENCRYPTION_POLICY", _IOC_WRITE, 0x6615, 0x0c }, { "linux/fs.h", "FS_IOC_GET_ENCRYPTION_PWSALT", _IOC_WRITE, 0x6614, 0x10 }, { "linux/fs.h", "FS_IOC_SETFLAGS", _IOC_WRITE, 0x6602, 0x04 }, +{ "linux/fs.h", "FS_IOC_SETFSLABEL", _IOC_WRITE, 0x9432, 0x100 }, { "linux/fs.h", "FS_IOC_SETVERSION", _IOC_WRITE, 0x7602, 0x04 }, { "linux/fs.h", "FS_IOC_SET_ENCRYPTION_POLICY", _IOC_READ, 0x6613, 0x0c }, +{ "linux/fsi.h", "FSI_SCOM_CHECK", _IOC_READ, 0x7300, 0x04 }, +{ "linux/fsi.h", "FSI_SCOM_READ", _IOC_READ|_IOC_WRITE, 0x7301, 0x20 }, +{ "linux/fsi.h", "FSI_SCOM_RESET", _IOC_WRITE, 0x7303, 0x04 }, +{ "linux/fsi.h", "FSI_SCOM_WRITE", _IOC_READ|_IOC_WRITE, 0x7302, 0x20 }, { "linux/fsl-diu-fb.h", "MFB_GET_ALPHA", _IOC_READ, 0x4d00, 0x01 }, { "linux/fsl-diu-fb.h", "MFB_GET_AOID", _IOC_READ, 0x4d04, 0x08 }, { "linux/fsl-diu-fb.h", "MFB_GET_GAMMA", _IOC_READ, 0x4d01, 0x01 }, @@ -969,6 +1034,7 @@ { "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_START", _IOC_READ|_IOC_WRITE, 0xaf03, 0x10 }, { "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_STOP", _IOC_READ|_IOC_WRITE, 0xaf04, 0x08 }, { "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_SETPROP", _IOC_READ|_IOC_WRITE, 0xaf08, 0x28 }, +{ "linux/fsmap.h", "FS_IOC_GETFSMAP", _IOC_READ|_IOC_WRITE, 0x583b, 0xc0 }, { "linux/fuse.h", "FUSE_DEV_IOC_CLONE", _IOC_READ, 0xe500, 0x04 }, { "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_DDCB", _IOC_READ|_IOC_WRITE, 0xa532, 0xe8 }, { "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_RAW_DDCB", _IOC_READ|_IOC_WRITE, 0xa533, 0xe8 }, @@ -1105,7 +1171,9 @@ { "linux/if_tun.h", "TUNGETVNETBE", _IOC_READ, 0x54df, 0x04 }, { "linux/if_tun.h", "TUNGETVNETHDRSZ", _IOC_READ, 0x54d7, 0x04 }, { "linux/if_tun.h", "TUNGETVNETLE", _IOC_READ, 0x54dd, 0x04 }, +{ "linux/if_tun.h", "TUNSETCARRIER", _IOC_WRITE, 0x54e2, 0x04 }, { "linux/if_tun.h", "TUNSETDEBUG", _IOC_WRITE, 0x54c9, 0x04 }, +{ "linux/if_tun.h", "TUNSETFILTEREBPF", _IOC_READ, 0x54e1, 0x04 }, { "linux/if_tun.h", "TUNSETGROUP", _IOC_WRITE, 0x54ce, 0x04 }, { "linux/if_tun.h", "TUNSETIFF", _IOC_WRITE, 0x54ca, 0x04 }, { "linux/if_tun.h", "TUNSETIFINDEX", _IOC_WRITE, 0x54da, 0x04 }, @@ -1116,11 +1184,13 @@ { "linux/if_tun.h", "TUNSETPERSIST", _IOC_WRITE, 0x54cb, 0x04 }, { "linux/if_tun.h", "TUNSETQUEUE", _IOC_WRITE, 0x54d9, 0x04 }, { "linux/if_tun.h", "TUNSETSNDBUF", _IOC_WRITE, 0x54d4, 0x04 }, +{ "linux/if_tun.h", "TUNSETSTEERINGEBPF", _IOC_READ, 0x54e0, 0x04 }, { "linux/if_tun.h", "TUNSETTXFILTER", _IOC_WRITE, 0x54d1, 0x04 }, { "linux/if_tun.h", "TUNSETVNETBE", _IOC_WRITE, 0x54de, 0x04 }, { "linux/if_tun.h", "TUNSETVNETHDRSZ", _IOC_WRITE, 0x54d8, 0x04 }, { "linux/if_tun.h", "TUNSETVNETLE", _IOC_WRITE, 0x54dc, 0x04 }, { "linux/iio/events.h", "IIO_GET_EVENT_FD_IOCTL", _IOC_READ, 0x6990, 0x04 }, +{ "linux/inotify.h", "INOTIFY_IOC_SETNEXTWD", _IOC_WRITE, 0x4900, 0x04 }, { "linux/input.h", "EVIOCGEFFECTS", _IOC_READ, 0x4584, 0x04 }, { "linux/input.h", "EVIOCGID", _IOC_READ, 0x4502, 0x08 }, { "linux/input.h", "EVIOCGKEYCODE", _IOC_READ, 0x4504, 0x08 }, @@ -1158,6 +1228,9 @@ { "linux/ipmi.h", "IPMICTL_SET_TIMING_PARMS_CMD", _IOC_READ, 0x6916, 0x08 }, { "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD", _IOC_READ, 0x690f, 0x02 }, { "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691d, 0x0c }, +{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_CLEAR_SMS_ATN", _IOC_NONE, 0xb101, 0x00 }, +{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_FORCE_ABORT", _IOC_NONE, 0xb102, 0x00 }, +{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_SET_SMS_ATN", _IOC_NONE, 0xb100, 0x00 }, { "linux/isdn.h", "IIOCDBGVAR", _IOC_NONE, 0x497f, 0x00 }, { "linux/isdn.h", "IIOCDRVCTL", _IOC_NONE, 0x4980, 0x00 }, { "linux/isdn.h", "IIOCGETCPS", _IOC_NONE, 0x4915, 0x00 }, @@ -1199,48 +1272,6 @@ { "linux/ivtv.h", "IVTV_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x38 }, { "linux/ivtv.h", "IVTV_IOC_PASSTHROUGH_MODE", _IOC_WRITE, 0x56c1, 0x04 }, { "linux/ivtvfb.h", "IVTVFB_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x0c }, -{ "linux/ixjuser.h", "IXJCTL_AEC_GET_LEVEL", _IOC_NONE, 0x71cd, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_AEC_START", _IOC_WRITE, 0x71cb, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_AEC_STOP", _IOC_NONE, 0x71cc, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_CARDTYPE", _IOC_READ, 0x71c1, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_CID", _IOC_READ, 0x71d4, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_CIDCW", _IOC_WRITE, 0x71d9, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DAA_AGAIN", _IOC_WRITE, 0x71d2, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DAA_COEFF_SET", _IOC_WRITE, 0x71d0, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DRYBUFFER_CLEAR", _IOC_NONE, 0x71e7, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_DRYBUFFER_READ", _IOC_READ, 0x71e6, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DSP_IDLE", _IOC_NONE, 0x71c5, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_DSP_RESET", _IOC_NONE, 0x71c0, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_DSP_TYPE", _IOC_READ, 0x71c3, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DSP_VERSION", _IOC_READ, 0x71c4, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DTMF_PRESCALE", _IOC_WRITE, 0x71e8, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_FILTER_CADENCE", _IOC_WRITE, 0x71d6, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_FRAMES_READ", _IOC_READ, 0x71e2, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_FRAMES_WRITTEN", _IOC_READ, 0x71e3, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_GET_FILTER_HIST", _IOC_WRITE, 0x71c8, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_HZ", _IOC_WRITE, 0x71e0, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_INIT_TONE", _IOC_WRITE, 0x71c9, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_INTERCOM_START", _IOC_WRITE, 0x71fd, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_INTERCOM_STOP", _IOC_WRITE, 0x71fe, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_MIXER", _IOC_WRITE, 0x71cf, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_PLAY_CID", _IOC_NONE, 0x71d7, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_PORT", _IOC_WRITE, 0x71d1, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_POTS_PSTN", _IOC_WRITE, 0x71d5, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_PSTN_LINETEST", _IOC_NONE, 0x71d3, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_RATE", _IOC_WRITE, 0x71e1, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_READ_WAIT", _IOC_READ, 0x71e4, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SC_RXG", _IOC_WRITE, 0x71ea, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SC_TXG", _IOC_WRITE, 0x71eb, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SERIAL", _IOC_READ, 0x71c2, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SET_FILTER", _IOC_WRITE, 0x71c7, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SET_FILTER_RAW", _IOC_WRITE, 0x71dd, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SET_LED", _IOC_WRITE, 0x71ce, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SIGCTL", _IOC_WRITE, 0x71e9, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_TESTRAM", _IOC_NONE, 0x71c6, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_TONE_CADENCE", _IOC_WRITE, 0x71ca, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_VERSION", _IOC_READ, 0x71da, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_VMWI", _IOC_READ, 0x71d8, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_WRITE_WAIT", _IOC_READ, 0x71e5, 0x04 }, { "linux/joystick.h", "JSIOCGAXES", _IOC_READ, 0x6a11, 0x01 }, { "linux/joystick.h", "JSIOCGAXMAP", _IOC_READ, 0x6a32, 0x40 }, { "linux/joystick.h", "JSIOCGBTNMAP", _IOC_READ, 0x6a34, 0x400 }, @@ -1299,6 +1330,8 @@ { "linux/kd.h", "PIO_UNIMAP", 0, 0x4B67, 0 }, { "linux/kd.h", "PIO_UNIMAPCLR", 0, 0x4B68, 0 }, { "linux/kd.h", "PIO_UNISCRNMAP", 0, 0x4B6A, 0 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ACQUIRE_VM", _IOC_WRITE, 0x4b15, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ALLOC_MEMORY_OF_GPU", _IOC_READ|_IOC_WRITE, 0x4b16, 0x28 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_EVENT", _IOC_READ|_IOC_WRITE, 0x4b08, 0x20 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b02, 0x58 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_ADDRESS_WATCH", _IOC_WRITE, 0x4b0f, 0x10 }, @@ -1307,14 +1340,28 @@ { "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_WAVE_CONTROL", _IOC_WRITE, 0x4b10, 0x10 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_EVENT", _IOC_WRITE, 0x4b09, 0x08 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b03, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_FREE_MEMORY_OF_GPU", _IOC_WRITE, 0x4b17, 0x08 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_CLOCK_COUNTERS", _IOC_READ|_IOC_WRITE, 0x4b05, 0x28 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_DMABUF_INFO", _IOC_READ|_IOC_WRITE, 0x4b1c, 0x20 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES", _IOC_READ, 0x4b06, 0x190 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES_NEW", _IOC_READ|_IOC_WRITE, 0x4b14, 0x10 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_QUEUE_WAVE_STATE", _IOC_READ|_IOC_WRITE, 0x4b1b, 0x18 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_TILE_CONFIG", _IOC_READ|_IOC_WRITE, 0x4b12, 0x28 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_VERSION", _IOC_READ, 0x4b01, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_IMPORT_DMABUF", _IOC_READ|_IOC_WRITE, 0x4b1d, 0x18 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_MAP_MEMORY_TO_GPU", _IOC_READ|_IOC_WRITE, 0x4b18, 0x18 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_RESET_EVENT", _IOC_WRITE, 0x4b0b, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_CU_MASK", _IOC_WRITE, 0x4b1a, 0x10 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_EVENT", _IOC_WRITE, 0x4b0a, 0x08 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_MEMORY_POLICY", _IOC_WRITE, 0x4b04, 0x20 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_SCRATCH_BACKING_VA", _IOC_READ|_IOC_WRITE, 0x4b11, 0x10 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_TRAP_HANDLER", _IOC_WRITE, 0x4b13, 0x18 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_UNMAP_MEMORY_FROM_GPU", _IOC_READ|_IOC_WRITE, 0x4b19, 0x18 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_UPDATE_QUEUE", _IOC_WRITE, 0x4b07, 0x18 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_WAIT_EVENTS", _IOC_READ|_IOC_WRITE, 0x4b0c, 0x18 }, +{ "linux/lightnvm.h", "NVME_NVM_IOCTL_ADMIN_VIO", _IOC_READ|_IOC_WRITE, 0x4c41, 0x50 }, +{ "linux/lightnvm.h", "NVME_NVM_IOCTL_IO_VIO", _IOC_READ|_IOC_WRITE, 0x4c43, 0x50 }, +{ "linux/lightnvm.h", "NVME_NVM_IOCTL_SUBMIT_VIO", _IOC_READ|_IOC_WRITE, 0x4c42, 0x40 }, { "linux/lightnvm.h", "NVM_DEV_CREATE", _IOC_WRITE, 0x4c22, 0x80 }, { "linux/lightnvm.h", "NVM_DEV_FACTORY", _IOC_WRITE, 0x4c25, 0x24 }, { "linux/lightnvm.h", "NVM_DEV_INIT", _IOC_WRITE, 0x4c24, 0x2c }, @@ -1327,6 +1374,7 @@ { "linux/lirc.h", "LIRC_GET_MIN_TIMEOUT", _IOC_READ, 0x6908, 0x04 }, { "linux/lirc.h", "LIRC_GET_REC_MODE", _IOC_READ, 0x6902, 0x04 }, { "linux/lirc.h", "LIRC_GET_REC_RESOLUTION", _IOC_READ, 0x6907, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_REC_TIMEOUT", _IOC_READ, 0x6924, 0x04 }, { "linux/lirc.h", "LIRC_GET_SEND_MODE", _IOC_READ, 0x6901, 0x04 }, { "linux/lirc.h", "LIRC_SET_MEASURE_CARRIER_MODE", _IOC_WRITE, 0x691d, 0x04 }, { "linux/lirc.h", "LIRC_SET_REC_CARRIER", _IOC_WRITE, 0x6914, 0x04 }, @@ -1346,11 +1394,13 @@ { "linux/loop.h", "LOOP_CTL_REMOVE", 0, 0x4C81, 0 }, { "linux/loop.h", "LOOP_GET_STATUS", 0, 0x4C03, 0 }, { "linux/loop.h", "LOOP_GET_STATUS64", 0, 0x4C05, 0 }, +{ "linux/loop.h", "LOOP_SET_BLOCK_SIZE", 0, 0x4C09, 0 }, { "linux/loop.h", "LOOP_SET_CAPACITY", 0, 0x4C07, 0 }, { "linux/loop.h", "LOOP_SET_DIRECT_IO", 0, 0x4C08, 0 }, { "linux/loop.h", "LOOP_SET_FD", 0, 0x4C00, 0 }, { "linux/loop.h", "LOOP_SET_STATUS", 0, 0x4C02, 0 }, { "linux/loop.h", "LOOP_SET_STATUS64", 0, 0x4C04, 0 }, +{ "linux/lp.h", "LPSETTIMEOUT_NEW", _IOC_WRITE, 0x060f, 0x10 }, { "linux/mISDNif.h", "IMADDTIMER", _IOC_READ, 0x4940, 0x04 }, { "linux/mISDNif.h", "IMCLEAR_L2", _IOC_READ, 0x4946, 0x04 }, { "linux/mISDNif.h", "IMCTRLREQ", _IOC_READ, 0x4945, 0x04 }, @@ -1370,7 +1420,10 @@ { "linux/media.h", "MEDIA_IOC_ENUM_ENTITIES", _IOC_READ|_IOC_WRITE, 0x7c01, 0x100 }, { "linux/media.h", "MEDIA_IOC_ENUM_LINKS", _IOC_READ|_IOC_WRITE, 0x7c02, 0x1c }, { "linux/media.h", "MEDIA_IOC_G_TOPOLOGY", _IOC_READ|_IOC_WRITE, 0x7c04, 0x48 }, +{ "linux/media.h", "MEDIA_IOC_REQUEST_ALLOC", _IOC_READ, 0x7c05, 0x04 }, { "linux/media.h", "MEDIA_IOC_SETUP_LINK", _IOC_READ|_IOC_WRITE, 0x7c03, 0x34 }, +{ "linux/media.h", "MEDIA_REQUEST_IOC_QUEUE", _IOC_NONE, 0x7c80, 0x00 }, +{ "linux/media.h", "MEDIA_REQUEST_IOC_REINIT", _IOC_NONE, 0x7c81, 0x00 }, { "linux/mei.h", "IOCTL_MEI_CONNECT_CLIENT", _IOC_READ|_IOC_WRITE, 0x4801, 0x10 }, { "linux/mei.h", "IOCTL_MEI_NOTIFY_GET", _IOC_READ, 0x4803, 0x04 }, { "linux/mei.h", "IOCTL_MEI_NOTIFY_SET", _IOC_WRITE, 0x4802, 0x04 }, @@ -1410,26 +1463,6 @@ { "linux/nbd.h", "NBD_SET_SIZE_BLOCKS", _IOC_NONE, 0xab07, 0x00 }, { "linux/nbd.h", "NBD_SET_SOCK", _IOC_NONE, 0xab00, 0x00 }, { "linux/nbd.h", "NBD_SET_TIMEOUT", _IOC_NONE, 0xab09, 0x00 }, -{ "linux/ncp_fs.h", "NCP_IOC_CONN_LOGGED_IN", _IOC_NONE, 0x6e03, 0x00 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETCHARSETS", _IOC_READ|_IOC_WRITE, 0x6e0b, 0x2a }, -{ "linux/ncp_fs.h", "NCP_IOC_GETDENTRYTTL", _IOC_WRITE, 0x6e0c, 0x04 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID", _IOC_WRITE, 0x6e02, 0x02 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID2", _IOC_WRITE, 0x6e02, 0x04 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETOBJECTNAME", _IOC_READ|_IOC_WRITE, 0x6e09, 0x0c }, -{ "linux/ncp_fs.h", "NCP_IOC_GETPRIVATEDATA", _IOC_READ|_IOC_WRITE, 0x6e0a, 0x08 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETROOT", _IOC_WRITE, 0x6e08, 0x0c }, -{ "linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO", _IOC_READ|_IOC_WRITE, 0x6e04, 0x28 }, -{ "linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO_V2", _IOC_READ|_IOC_WRITE, 0x6e04, 0x24 }, -{ "linux/ncp_fs.h", "NCP_IOC_LOCKUNLOCK", _IOC_READ, 0x6e07, 0x14 }, -{ "linux/ncp_fs.h", "NCP_IOC_NCPREQUEST", _IOC_READ, 0x6e01, 0x0c }, -{ "linux/ncp_fs.h", "NCP_IOC_SETCHARSETS", _IOC_READ, 0x6e0b, 0x2a }, -{ "linux/ncp_fs.h", "NCP_IOC_SETDENTRYTTL", _IOC_READ, 0x6e0c, 0x04 }, -{ "linux/ncp_fs.h", "NCP_IOC_SETOBJECTNAME", _IOC_READ, 0x6e09, 0x0c }, -{ "linux/ncp_fs.h", "NCP_IOC_SETPRIVATEDATA", _IOC_READ, 0x6e0a, 0x08 }, -{ "linux/ncp_fs.h", "NCP_IOC_SETROOT", _IOC_READ, 0x6e08, 0x0c }, -{ "linux/ncp_fs.h", "NCP_IOC_SET_SIGN_WANTED", _IOC_WRITE, 0x6e06, 0x04 }, -{ "linux/ncp_fs.h", "NCP_IOC_SIGN_INIT", _IOC_READ, 0x6e05, 0x18 }, -{ "linux/ncp_fs.h", "NCP_IOC_SIGN_WANTED", _IOC_READ, 0x6e06, 0x04 }, { "linux/ndctl.h", "ND_IOCTL_ARS_CAP", _IOC_READ|_IOC_WRITE, 0x4e01, 0x20 }, { "linux/ndctl.h", "ND_IOCTL_ARS_START", _IOC_READ|_IOC_WRITE, 0x4e02, 0x20 }, { "linux/ndctl.h", "ND_IOCTL_ARS_STATUS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x30 }, @@ -1439,8 +1472,6 @@ { "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e05, 0x0c }, { "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_SIZE", _IOC_READ|_IOC_WRITE, 0x4e04, 0x0c }, { "linux/ndctl.h", "ND_IOCTL_SET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e06, 0x08 }, -{ "linux/ndctl.h", "ND_IOCTL_SMART", _IOC_READ|_IOC_WRITE, 0x4e01, 0x84 }, -{ "linux/ndctl.h", "ND_IOCTL_SMART_THRESHOLD", _IOC_READ|_IOC_WRITE, 0x4e02, 0x0c }, { "linux/ndctl.h", "ND_IOCTL_VENDOR", _IOC_READ|_IOC_WRITE, 0x4e09, 0x08 }, { "linux/nilfs2_api.h", "NILFS_IOCTL_CHANGE_CPMODE", _IOC_WRITE, 0x6e80, 0x10 }, { "linux/nilfs2_api.h", "NILFS_IOCTL_CLEAN_SEGMENTS", _IOC_WRITE, 0x6e88, 0x78 }, @@ -1455,6 +1486,8 @@ { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 }, { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 }, { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 }, +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 }, +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 }, { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 }, { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 }, { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 0x4e41, 0x48 }, @@ -1473,6 +1506,7 @@ { "linux/omap3isp.h", "VIDIOC_OMAP3ISP_PRV_CFG", _IOC_READ|_IOC_WRITE, 0x56c2, 0x3c }, { "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_EN", _IOC_READ|_IOC_WRITE, 0x56c7, 0x04 }, { "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_REQ", _IOC_READ|_IOC_WRITE, 0x56c6, 0x18 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_REQ_TIME32", _IOC_READ|_IOC_WRITE, 0x56c6, 0x18 }, { "linux/omapfb.h", "OMAPFB_CTRL_TEST", _IOC_WRITE, 0x4f2e, 0x04 }, { "linux/omapfb.h", "OMAPFB_GET_CAPS", _IOC_READ, 0x4f2a, 0x0c }, { "linux/omapfb.h", "OMAPFB_GET_COLOR_KEY", _IOC_WRITE, 0x4f33, 0x10 }, @@ -1496,11 +1530,22 @@ { "linux/omapfb.h", "OMAPFB_VSYNC", _IOC_NONE, 0x4f26, 0x00 }, { "linux/omapfb.h", "OMAPFB_WAITFORGO", _IOC_NONE, 0x4f3c, 0x00 }, { "linux/omapfb.h", "OMAPFB_WAITFORVSYNC", _IOC_NONE, 0x4f39, 0x00 }, +{ "linux/pcitest.h", "PCITEST_BAR", _IOC_NONE, 0x5001, 0x00 }, +{ "linux/pcitest.h", "PCITEST_COPY", _IOC_WRITE, 0x5006, 0x04 }, +{ "linux/pcitest.h", "PCITEST_GET_IRQTYPE", _IOC_NONE, 0x5009, 0x00 }, +{ "linux/pcitest.h", "PCITEST_LEGACY_IRQ", _IOC_NONE, 0x5002, 0x00 }, +{ "linux/pcitest.h", "PCITEST_MSI", _IOC_WRITE, 0x5003, 0x04 }, +{ "linux/pcitest.h", "PCITEST_MSIX", _IOC_WRITE, 0x5007, 0x04 }, +{ "linux/pcitest.h", "PCITEST_READ", _IOC_WRITE, 0x5005, 0x04 }, +{ "linux/pcitest.h", "PCITEST_SET_IRQTYPE", _IOC_WRITE, 0x5008, 0x04 }, +{ "linux/pcitest.h", "PCITEST_WRITE", _IOC_WRITE, 0x5004, 0x04 }, { "linux/perf_event.h", "PERF_EVENT_IOC_DISABLE", _IOC_NONE, 0x2401, 0x00 }, { "linux/perf_event.h", "PERF_EVENT_IOC_ENABLE", _IOC_NONE, 0x2400, 0x00 }, { "linux/perf_event.h", "PERF_EVENT_IOC_ID", _IOC_READ, 0x2407, 0x04 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_MODIFY_ATTRIBUTES", _IOC_WRITE, 0x240b, 0x04 }, { "linux/perf_event.h", "PERF_EVENT_IOC_PAUSE_OUTPUT", _IOC_WRITE, 0x2409, 0x04 }, { "linux/perf_event.h", "PERF_EVENT_IOC_PERIOD", _IOC_WRITE, 0x2404, 0x08 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_QUERY_BPF", _IOC_READ|_IOC_WRITE, 0x240a, 0x04 }, { "linux/perf_event.h", "PERF_EVENT_IOC_REFRESH", _IOC_NONE, 0x2402, 0x00 }, { "linux/perf_event.h", "PERF_EVENT_IOC_RESET", _IOC_NONE, 0x2403, 0x00 }, { "linux/perf_event.h", "PERF_EVENT_IOC_SET_BPF", _IOC_WRITE, 0x2408, 0x04 }, @@ -1588,6 +1633,7 @@ { "linux/pr.h", "IOC_PR_REGISTER", _IOC_WRITE, 0x70c8, 0x18 }, { "linux/pr.h", "IOC_PR_RELEASE", _IOC_WRITE, 0x70ca, 0x10 }, { "linux/pr.h", "IOC_PR_RESERVE", _IOC_WRITE, 0x70c9, 0x10 }, +{ "linux/psp-sev.h", "SEV_ISSUE_CMD", _IOC_READ|_IOC_WRITE, 0x5300, 0x10 }, { "linux/ptp_clock.h", "PTP_CLOCK_GETCAPS", _IOC_READ, 0x3d01, 0x50 }, { "linux/ptp_clock.h", "PTP_ENABLE_PPS", _IOC_WRITE, 0x3d04, 0x04 }, { "linux/ptp_clock.h", "PTP_EXTTS_REQUEST", _IOC_WRITE, 0x3d02, 0x10 }, @@ -1595,6 +1641,7 @@ { "linux/ptp_clock.h", "PTP_PIN_GETFUNC", _IOC_READ|_IOC_WRITE, 0x3d06, 0x60 }, { "linux/ptp_clock.h", "PTP_PIN_SETFUNC", _IOC_WRITE, 0x3d07, 0x60 }, { "linux/ptp_clock.h", "PTP_SYS_OFFSET", _IOC_WRITE, 0x3d05, 0x340 }, +{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_EXTENDED", _IOC_READ|_IOC_WRITE, 0x3d09, 0x4c0 }, { "linux/ptp_clock.h", "PTP_SYS_OFFSET_PRECISE", _IOC_READ|_IOC_WRITE, 0x3d08, 0x40 }, { "linux/radeonfb.h", "FBIO_RADEON_GET_MIRROR", _IOC_READ, 0x4003, 0x04 }, { "linux/radeonfb.h", "FBIO_RADEON_SET_MIRROR", _IOC_WRITE, 0x4004, 0x04 }, @@ -1625,6 +1672,7 @@ { "linux/random.h", "RNDCLEARPOOL", _IOC_NONE, 0x5206, 0x00 }, { "linux/random.h", "RNDGETENTCNT", _IOC_READ, 0x5200, 0x04 }, { "linux/random.h", "RNDGETPOOL", _IOC_READ, 0x5202, 0x08 }, +{ "linux/random.h", "RNDRESEEDCRNG", _IOC_NONE, 0x5207, 0x00 }, { "linux/random.h", "RNDZAPENTCNT", _IOC_NONE, 0x5204, 0x00 }, { "linux/raw.h", "RAW_GETBIND", _IOC_NONE, 0xac01, 0x00 }, { "linux/raw.h", "RAW_SETBIND", _IOC_NONE, 0xac00, 0x00 }, @@ -1665,6 +1713,8 @@ { "linux/rio_mport_cdev.h", "RIO_UNMAP_INBOUND", _IOC_WRITE, 0x6d12, 0x08 }, { "linux/rio_mport_cdev.h", "RIO_UNMAP_OUTBOUND", _IOC_WRITE, 0x6d10, 0x28 }, { "linux/rio_mport_cdev.h", "RIO_WAIT_FOR_ASYNC", _IOC_WRITE, 0x6d16, 0x08 }, +{ "linux/rpmsg.h", "RPMSG_CREATE_EPT_IOCTL", _IOC_WRITE, 0xb501, 0x28 }, +{ "linux/rpmsg.h", "RPMSG_DESTROY_EPT_IOCTL", _IOC_NONE, 0xb502, 0x00 }, { "linux/rtc.h", "RTC_AIE_OFF", _IOC_NONE, 0x7002, 0x00 }, { "linux/rtc.h", "RTC_AIE_ON", _IOC_NONE, 0x7001, 0x00 }, { "linux/rtc.h", "RTC_ALM_READ", _IOC_READ, 0x7008, 0x24 }, @@ -1704,6 +1754,21 @@ { "linux/scif_ioctl.h", "SCIF_VREADFROM", _IOC_READ|_IOC_WRITE, 0x730c, 0x28 }, { "linux/scif_ioctl.h", "SCIF_VWRITETO", _IOC_READ|_IOC_WRITE, 0x730d, 0x28 }, { "linux/scif_ioctl.h", "SCIF_WRITETO", _IOC_READ|_IOC_WRITE, 0x730b, 0x28 }, +{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_ID_VALID", _IOC_READ, 0x2102, 0x08 }, +{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_RECV", _IOC_READ|_IOC_WRITE, 0x2100, 0x50 }, +{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_SEND", _IOC_READ|_IOC_WRITE, 0x2101, 0x18 }, +{ "linux/sed-opal.h", "IOC_OPAL_ACTIVATE_LSP", _IOC_WRITE, 0x70df, 0x118 }, +{ "linux/sed-opal.h", "IOC_OPAL_ACTIVATE_USR", _IOC_WRITE, 0x70e1, 0x110 }, +{ "linux/sed-opal.h", "IOC_OPAL_ADD_USR_TO_LR", _IOC_WRITE, 0x70e4, 0x118 }, +{ "linux/sed-opal.h", "IOC_OPAL_ENABLE_DISABLE_MBR", _IOC_WRITE, 0x70e5, 0x110 }, +{ "linux/sed-opal.h", "IOC_OPAL_ERASE_LR", _IOC_WRITE, 0x70e6, 0x110 }, +{ "linux/sed-opal.h", "IOC_OPAL_LOCK_UNLOCK", _IOC_WRITE, 0x70dd, 0x118 }, +{ "linux/sed-opal.h", "IOC_OPAL_LR_SETUP", _IOC_WRITE, 0x70e3, 0x128 }, +{ "linux/sed-opal.h", "IOC_OPAL_REVERT_TPR", _IOC_WRITE, 0x70e2, 0x108 }, +{ "linux/sed-opal.h", "IOC_OPAL_SAVE", _IOC_WRITE, 0x70dc, 0x118 }, +{ "linux/sed-opal.h", "IOC_OPAL_SECURE_ERASE_LR", _IOC_WRITE, 0x70e7, 0x110 }, +{ "linux/sed-opal.h", "IOC_OPAL_SET_PW", _IOC_WRITE, 0x70e0, 0x220 }, +{ "linux/sed-opal.h", "IOC_OPAL_TAKE_OWNERSHIP", _IOC_WRITE, 0x70de, 0x108 }, { "linux/serio.h", "SPIOCSTYPE", _IOC_WRITE, 0x7101, 0x04 }, { "linux/sockios.h", "SIOCADDDLCI", 0, 0x8980, 0 }, { "linux/sockios.h", "SIOCADDMULTI", 0, 0x8931, 0 }, @@ -1916,6 +1981,12 @@ { "linux/suspend_ioctls.h", "SNAPSHOT_S2RAM", _IOC_NONE, 0x330b, 0x00 }, { "linux/suspend_ioctls.h", "SNAPSHOT_SET_SWAP_AREA", _IOC_WRITE, 0x330d, 0x0c }, { "linux/suspend_ioctls.h", "SNAPSHOT_UNFREEZE", _IOC_NONE, 0x3302, 0x00 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_CTL", _IOC_READ|_IOC_WRITE, 0x5743, 0x28 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_SUMMARY", _IOC_READ, 0x5742, 0x198 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_FLASH_INFO", _IOC_READ, 0x5740, 0x10 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_FLASH_PART_INFO", _IOC_READ|_IOC_WRITE, 0x5741, 0x10 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_PFF_TO_PORT", _IOC_READ|_IOC_WRITE, 0x5744, 0x0c }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_PORT_TO_PFF", _IOC_READ|_IOC_WRITE, 0x5745, 0x0c }, { "linux/sync_file.h", "SYNC_IOC_FILE_INFO", _IOC_READ|_IOC_WRITE, 0x3e04, 0x38 }, { "linux/sync_file.h", "SYNC_IOC_MERGE", _IOC_READ|_IOC_WRITE, 0x3e03, 0x30 }, { "linux/synclink.h", "MGSL_IOCCLRMODCOUNT", _IOC_NONE, 0x6d0f, 0x00 }, @@ -1938,53 +2009,15 @@ { "linux/synclink.h", "MGSL_IOCTXENABLE", _IOC_NONE, 0x6d04, 0x00 }, { "linux/synclink.h", "MGSL_IOCWAITEVENT", _IOC_READ|_IOC_WRITE, 0x6d08, 0x04 }, { "linux/synclink.h", "MGSL_IOCWAITGPIO", _IOC_READ|_IOC_WRITE, 0x6d12, 0x10 }, -{ "linux/telephony.h", "OLD_PHONE_RING_START", _IOC_NONE, 0x7187, 0x00 }, -{ "linux/telephony.h", "PHONE_BUSY", _IOC_NONE, 0x71a1, 0x00 }, -{ "linux/telephony.h", "PHONE_CAPABILITIES", _IOC_NONE, 0x7180, 0x00 }, -{ "linux/telephony.h", "PHONE_CAPABILITIES_CHECK", _IOC_WRITE, 0x7182, 0x04 }, -{ "linux/telephony.h", "PHONE_CAPABILITIES_LIST", _IOC_READ, 0x7181, 0x04 }, -{ "linux/telephony.h", "PHONE_CPT_STOP", _IOC_NONE, 0x71a4, 0x00 }, -{ "linux/telephony.h", "PHONE_DIALTONE", _IOC_NONE, 0x71a3, 0x00 }, -{ "linux/telephony.h", "PHONE_DTMF_OOB", _IOC_WRITE, 0x7199, 0x04 }, -{ "linux/telephony.h", "PHONE_DTMF_READY", _IOC_READ, 0x7196, 0x04 }, -{ "linux/telephony.h", "PHONE_EXCEPTION", _IOC_READ, 0x719a, 0x04 }, -{ "linux/telephony.h", "PHONE_FRAME", _IOC_WRITE, 0x718d, 0x04 }, -{ "linux/telephony.h", "PHONE_GET_DTMF", _IOC_READ, 0x7197, 0x04 }, -{ "linux/telephony.h", "PHONE_GET_DTMF_ASCII", _IOC_READ, 0x7198, 0x04 }, -{ "linux/telephony.h", "PHONE_GET_TONE_OFF_TIME", _IOC_NONE, 0x719f, 0x00 }, -{ "linux/telephony.h", "PHONE_GET_TONE_ON_TIME", _IOC_NONE, 0x719e, 0x00 }, -{ "linux/telephony.h", "PHONE_GET_TONE_STATE", _IOC_NONE, 0x71a0, 0x00 }, -{ "linux/telephony.h", "PHONE_HOOKSTATE", _IOC_NONE, 0x7184, 0x00 }, -{ "linux/telephony.h", "PHONE_MAXRINGS", _IOC_WRITE, 0x7185, 0x01 }, -{ "linux/telephony.h", "PHONE_PLAY_CODEC", _IOC_WRITE, 0x7190, 0x04 }, -{ "linux/telephony.h", "PHONE_PLAY_DEPTH", _IOC_WRITE, 0x7193, 0x04 }, -{ "linux/telephony.h", "PHONE_PLAY_LEVEL", _IOC_NONE, 0x7195, 0x00 }, -{ "linux/telephony.h", "PHONE_PLAY_START", _IOC_NONE, 0x7191, 0x00 }, -{ "linux/telephony.h", "PHONE_PLAY_STOP", _IOC_NONE, 0x7192, 0x00 }, -{ "linux/telephony.h", "PHONE_PLAY_TONE", _IOC_WRITE, 0x719b, 0x01 }, -{ "linux/telephony.h", "PHONE_PLAY_VOLUME", _IOC_WRITE, 0x7194, 0x04 }, -{ "linux/telephony.h", "PHONE_PLAY_VOLUME_LINEAR", _IOC_WRITE, 0x71dc, 0x04 }, -{ "linux/telephony.h", "PHONE_PSTN_GET_STATE", _IOC_NONE, 0x71a5, 0x00 }, -{ "linux/telephony.h", "PHONE_PSTN_LINETEST", _IOC_NONE, 0x71a8, 0x00 }, -{ "linux/telephony.h", "PHONE_PSTN_SET_STATE", _IOC_WRITE, 0x71a4, 0x04 }, -{ "linux/telephony.h", "PHONE_QUERY_CODEC", _IOC_READ|_IOC_WRITE, 0x71a7, 0x04 }, -{ "linux/telephony.h", "PHONE_REC_CODEC", _IOC_WRITE, 0x7189, 0x04 }, -{ "linux/telephony.h", "PHONE_REC_DEPTH", _IOC_WRITE, 0x718c, 0x04 }, -{ "linux/telephony.h", "PHONE_REC_LEVEL", _IOC_NONE, 0x718f, 0x00 }, -{ "linux/telephony.h", "PHONE_REC_START", _IOC_NONE, 0x718a, 0x00 }, -{ "linux/telephony.h", "PHONE_REC_STOP", _IOC_NONE, 0x718b, 0x00 }, -{ "linux/telephony.h", "PHONE_REC_VOLUME", _IOC_WRITE, 0x718e, 0x04 }, -{ "linux/telephony.h", "PHONE_REC_VOLUME_LINEAR", _IOC_WRITE, 0x71db, 0x04 }, -{ "linux/telephony.h", "PHONE_RING", _IOC_NONE, 0x7183, 0x00 }, -{ "linux/telephony.h", "PHONE_RINGBACK", _IOC_NONE, 0x71a2, 0x00 }, -{ "linux/telephony.h", "PHONE_RING_CADENCE", _IOC_WRITE, 0x7186, 0x02 }, -{ "linux/telephony.h", "PHONE_RING_START", _IOC_WRITE, 0x7187, 0x04 }, -{ "linux/telephony.h", "PHONE_RING_STOP", _IOC_NONE, 0x7188, 0x00 }, -{ "linux/telephony.h", "PHONE_SET_TONE_OFF_TIME", _IOC_WRITE, 0x719d, 0x04 }, -{ "linux/telephony.h", "PHONE_SET_TONE_ON_TIME", _IOC_WRITE, 0x719c, 0x04 }, -{ "linux/telephony.h", "PHONE_VAD", _IOC_WRITE, 0x71a9, 0x04 }, -{ "linux/telephony.h", "PHONE_WINK", _IOC_WRITE, 0x71aa, 0x04 }, -{ "linux/telephony.h", "PHONE_WINK_DURATION", _IOC_WRITE, 0x71a6, 0x04 }, +{ "linux/tee.h", "TEE_IOC_CANCEL", _IOC_READ, 0xa404, 0x08 }, +{ "linux/tee.h", "TEE_IOC_CLOSE_SESSION", _IOC_READ, 0xa405, 0x04 }, +{ "linux/tee.h", "TEE_IOC_INVOKE", _IOC_READ, 0xa403, 0x10 }, +{ "linux/tee.h", "TEE_IOC_OPEN_SESSION", _IOC_READ, 0xa402, 0x10 }, +{ "linux/tee.h", "TEE_IOC_SHM_ALLOC", _IOC_READ|_IOC_WRITE, 0xa401, 0x10 }, +{ "linux/tee.h", "TEE_IOC_SHM_REGISTER", _IOC_READ|_IOC_WRITE, 0xa409, 0x18 }, +{ "linux/tee.h", "TEE_IOC_SUPPL_RECV", _IOC_READ, 0xa406, 0x10 }, +{ "linux/tee.h", "TEE_IOC_SUPPL_SEND", _IOC_READ, 0xa407, 0x10 }, +{ "linux/tee.h", "TEE_IOC_VERSION", _IOC_READ, 0xa400, 0x0c }, { "linux/timerfd.h", "TFD_IOC_SET_TICKS", _IOC_WRITE, 0x5400, 0x08 }, { "linux/toshiba.h", "TOSHIBA_ACPI_SCI", _IOC_READ|_IOC_WRITE, 0x7491, 0x18 }, { "linux/toshiba.h", "TOSH_SMM", _IOC_READ|_IOC_WRITE, 0x7490, 0x18 }, @@ -1992,6 +2025,8 @@ { "linux/udf_fs_i.h", "UDF_GETEASIZE", _IOC_READ, 0x6c40, 0x04 }, { "linux/udf_fs_i.h", "UDF_GETVOLIDENT", _IOC_READ, 0x6c42, 0x04 }, { "linux/udf_fs_i.h", "UDF_RELOCATE_BLOCKS", _IOC_READ|_IOC_WRITE, 0x6c43, 0x04 }, +{ "linux/udmabuf.h", "UDMABUF_CREATE", _IOC_WRITE, 0x7542, 0x18 }, +{ "linux/udmabuf.h", "UDMABUF_CREATE_LIST", _IOC_WRITE, 0x7543, 0x08 }, { "linux/uinput.h", "UI_ABS_SETUP", _IOC_WRITE, 0x5504, 0x1c }, { "linux/uinput.h", "UI_BEGIN_FF_ERASE", _IOC_READ|_IOC_WRITE, 0x55ca, 0x0c }, { "linux/uinput.h", "UI_BEGIN_FF_UPLOAD", _IOC_READ|_IOC_WRITE, 0x55c8, 0x60 }, @@ -2021,6 +2056,7 @@ { "linux/usb/functionfs.h", "FUNCTIONFS_INTERFACE_REVMAP", _IOC_NONE, 0x6780, 0x00 }, { "linux/usb/g_printer.h", "GADGET_GET_PRINTER_STATUS", _IOC_READ, 0x6721, 0x01 }, { "linux/usb/g_printer.h", "GADGET_SET_PRINTER_STATUS", _IOC_READ|_IOC_WRITE, 0x6722, 0x01 }, +{ "linux/usb/g_uvc.h", "UVCIOC_SEND_RESPONSE", _IOC_WRITE, 0x5501, 0x40 }, { "linux/usb/gadgetfs.h", "GADGETFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 }, { "linux/usb/gadgetfs.h", "GADGETFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 }, { "linux/usb/gadgetfs.h", "GADGETFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 }, @@ -2032,12 +2068,27 @@ { "linux/usb/tmc.h", "USBTMC488_IOCTL_LOCAL_LOCKOUT", _IOC_NONE, 0x5b15, 0x00 }, { "linux/usb/tmc.h", "USBTMC488_IOCTL_READ_STB", _IOC_READ, 0x5b12, 0x01 }, { "linux/usb/tmc.h", "USBTMC488_IOCTL_REN_CONTROL", _IOC_WRITE, 0x5b13, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_TRIGGER", _IOC_NONE, 0x5b16, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_WAIT_SRQ", _IOC_WRITE, 0x5b17, 0x04 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_IN", _IOC_NONE, 0x5b04, 0x00 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_OUT", _IOC_NONE, 0x5b03, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_API_VERSION", _IOC_READ, 0x5b10, 0x04 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_AUTO_ABORT", _IOC_WRITE, 0x5b19, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CANCEL_IO", _IOC_NONE, 0x5b23, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEANUP_IO", _IOC_NONE, 0x5b24, 0x00 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR", _IOC_NONE, 0x5b02, 0x00 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_IN_HALT", _IOC_NONE, 0x5b07, 0x00 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_OUT_HALT", _IOC_NONE, 0x5b06, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CONFIG_TERMCHAR", _IOC_WRITE, 0x5b0c, 0x02 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CTRL_REQUEST", _IOC_READ|_IOC_WRITE, 0x5b08, 0x0c }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_EOM_ENABLE", _IOC_WRITE, 0x5b0b, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_GET_TIMEOUT", _IOC_READ, 0x5b09, 0x04 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_INDICATOR_PULSE", _IOC_NONE, 0x5b01, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_MSG_IN_ATTR", _IOC_READ, 0x5b18, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_READ", _IOC_READ|_IOC_WRITE, 0x5b0e, 0x10 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_SET_TIMEOUT", _IOC_WRITE, 0x5b0a, 0x04 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_WRITE", _IOC_READ|_IOC_WRITE, 0x5b0d, 0x10 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_WRITE_RESULT", _IOC_READ|_IOC_WRITE, 0x5b0f, 0x04 }, { "linux/usbdevice_fs.h", "USBDEVFS_ALLOC_STREAMS", _IOC_READ, 0x551c, 0x08 }, { "linux/usbdevice_fs.h", "USBDEVFS_BULK", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 }, { "linux/usbdevice_fs.h", "USBDEVFS_BULK32", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 }, @@ -2057,6 +2108,7 @@ { "linux/usbdevice_fs.h", "USBDEVFS_FREE_STREAMS", _IOC_READ, 0x551d, 0x08 }, { "linux/usbdevice_fs.h", "USBDEVFS_GETDRIVER", _IOC_WRITE, 0x5508, 0x104 }, { "linux/usbdevice_fs.h", "USBDEVFS_GET_CAPABILITIES", _IOC_READ, 0x551a, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_GET_SPEED", _IOC_NONE, 0x551f, 0x00 }, { "linux/usbdevice_fs.h", "USBDEVFS_HUB_PORTINFO", _IOC_READ, 0x5513, 0x80 }, { "linux/usbdevice_fs.h", "USBDEVFS_IOCTL", _IOC_READ|_IOC_WRITE, 0x5512, 0x0c }, { "linux/usbdevice_fs.h", "USBDEVFS_IOCTL32", _IOC_READ|_IOC_WRITE, 0x5512, 0x0c }, @@ -2080,30 +2132,36 @@ { "linux/userfaultfd.h", "UFFDIO_ZEROPAGE", _IOC_READ|_IOC_WRITE, 0xaa04, 0x20 }, { "linux/uvcvideo.h", "UVCIOC_CTRL_MAP", _IOC_READ|_IOC_WRITE, 0x7520, 0x58 }, { "linux/uvcvideo.h", "UVCIOC_CTRL_QUERY", _IOC_READ|_IOC_WRITE, 0x7521, 0x0c }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x564b, 0x40 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_SIZE", _IOC_READ|_IOC_WRITE, 0x564a, 0x40 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_MBUS_CODE", _IOC_READ|_IOC_WRITE, 0x5602, 0x30 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x38 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x24 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0x58 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5615, 0x30 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x563d, 0x40 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_CROP", _IOC_READ|_IOC_WRITE, 0x563c, 0x38 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x24 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0x58 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5616, 0x30 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x563e, 0x40 }, +{ "linux/vboxguest.h", "VBG_IOCTL_CHANGE_FILTER_MASK", _IOC_READ|_IOC_WRITE, 0x560c, 0x20 }, +{ "linux/vboxguest.h", "VBG_IOCTL_CHANGE_GUEST_CAPABILITIES", _IOC_READ|_IOC_WRITE, 0x560e, 0x20 }, +{ "linux/vboxguest.h", "VBG_IOCTL_CHECK_BALLOON", _IOC_READ|_IOC_WRITE, 0x5611, 0x20 }, +{ "linux/vboxguest.h", "VBG_IOCTL_DRIVER_VERSION_INFO", _IOC_READ|_IOC_WRITE, 0x5600, 0x2c }, +{ "linux/vboxguest.h", "VBG_IOCTL_HGCM_CONNECT", _IOC_READ|_IOC_WRITE, 0x5604, 0x9c }, +{ "linux/vboxguest.h", "VBG_IOCTL_HGCM_DISCONNECT", _IOC_READ|_IOC_WRITE, 0x5605, 0x1c }, +{ "linux/vboxguest.h", "VBG_IOCTL_INTERRUPT_ALL_WAIT_FOR_EVENTS", _IOC_READ|_IOC_WRITE, 0x560b, 0x18 }, +{ "linux/vboxguest.h", "VBG_IOCTL_VMMDEV_REQUEST_BIG", _IOC_READ|_IOC_WRITE, 0x5603, 0x00 }, +{ "linux/vboxguest.h", "VBG_IOCTL_WAIT_FOR_EVENTS", _IOC_READ|_IOC_WRITE, 0x560a, 0x20 }, +{ "linux/vboxguest.h", "VBG_IOCTL_WRITE_CORE_DUMP", _IOC_READ|_IOC_WRITE, 0x5613, 0x1c }, { "linux/vfio.h", "VFIO_CHECK_EXTENSION", _IOC_NONE, 0x3b65, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_GFX_DMABUF", _IOC_NONE, 0x3b73, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_GET_INFO", _IOC_NONE, 0x3b6b, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_GET_IRQ_INFO", _IOC_NONE, 0x3b6d, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_GET_PCI_HOT_RESET_INFO", _IOC_NONE, 0x3b70, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_GET_REGION_INFO", _IOC_NONE, 0x3b6c, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_IOEVENTFD", _IOC_NONE, 0x3b74, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_PCI_HOT_RESET", _IOC_NONE, 0x3b71, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_QUERY_GFX_PLANE", _IOC_NONE, 0x3b72, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_RESET", _IOC_NONE, 0x3b6f, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_SET_IRQS", _IOC_NONE, 0x3b6e, 0x00 }, { "linux/vfio.h", "VFIO_EEH_PE_OP", _IOC_NONE, 0x3b79, 0x00 }, @@ -2123,6 +2181,7 @@ { "linux/vfio.h", "VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY", _IOC_NONE, 0x3b76, 0x00 }, { "linux/vfio.h", "VFIO_IOMMU_UNMAP_DMA", _IOC_NONE, 0x3b72, 0x00 }, { "linux/vfio.h", "VFIO_SET_IOMMU", _IOC_NONE, 0x3b66, 0x00 }, +{ "linux/vhost.h", "VHOST_GET_BACKEND_FEATURES", _IOC_READ, 0xaf26, 0x08 }, { "linux/vhost.h", "VHOST_GET_FEATURES", _IOC_READ, 0xaf00, 0x08 }, { "linux/vhost.h", "VHOST_GET_VRING_BASE", _IOC_READ|_IOC_WRITE, 0xaf12, 0x08 }, { "linux/vhost.h", "VHOST_GET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf24, 0x08 }, @@ -2134,6 +2193,7 @@ { "linux/vhost.h", "VHOST_SCSI_GET_EVENTS_MISSED", _IOC_WRITE, 0xaf44, 0x04 }, { "linux/vhost.h", "VHOST_SCSI_SET_ENDPOINT", _IOC_WRITE, 0xaf40, 0xe8 }, { "linux/vhost.h", "VHOST_SCSI_SET_EVENTS_MISSED", _IOC_WRITE, 0xaf43, 0x04 }, +{ "linux/vhost.h", "VHOST_SET_BACKEND_FEATURES", _IOC_WRITE, 0xaf25, 0x08 }, { "linux/vhost.h", "VHOST_SET_FEATURES", _IOC_WRITE, 0xaf00, 0x08 }, { "linux/vhost.h", "VHOST_SET_LOG_BASE", _IOC_WRITE, 0xaf04, 0x08 }, { "linux/vhost.h", "VHOST_SET_LOG_FD", _IOC_WRITE, 0xaf07, 0x04 }, @@ -2203,7 +2263,6 @@ { "linux/videodev2.h", "VIDIOC_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 }, { "linux/videodev2.h", "VIDIOC_QUERY_EXT_CTRL", _IOC_READ|_IOC_WRITE, 0x5667, 0xe8 }, { "linux/videodev2.h", "VIDIOC_REQBUFS", _IOC_READ|_IOC_WRITE, 0x5608, 0x14 }, -{ "linux/videodev2.h", "VIDIOC_RESERVED", _IOC_NONE, 0x5601, 0x00 }, { "linux/videodev2.h", "VIDIOC_STREAMOFF", _IOC_WRITE, 0x5613, 0x04 }, { "linux/videodev2.h", "VIDIOC_STREAMON", _IOC_WRITE, 0x5612, 0x04 }, { "linux/videodev2.h", "VIDIOC_SUBSCRIBE_EVENT", _IOC_WRITE, 0x565a, 0x20 }, @@ -2335,7 +2394,7 @@ { "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 }, { "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 }, { "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 }, -{ "media/davinci/vpfe_capture.h", "VPFE_CMD_S_CCDC_RAW_PARAMS", _IOC_WRITE, 0x56c1, 0x04 }, +{ "linux/wmi.h", "DELL_WMI_SMBIOS_CMD", _IOC_READ|_IOC_WRITE, 0x5700, 0x34 }, { "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 }, { "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 }, { "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 }, @@ -2353,6 +2412,23 @@ { "misc/cxl.h", "CXL_IOCTL_GET_PROCESS_ELEMENT", _IOC_READ, 0xca01, 0x04 }, { "misc/cxl.h", "CXL_IOCTL_START_WORK", _IOC_WRITE, 0xca00, 0x40 }, { "misc/cxl.h", "CXL_IOCTL_VALIDATE_IMAGE", _IOC_WRITE, 0xca0b, 0x40 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_ALLOC_DMA_BUFF", _IOC_READ|_IOC_WRITE, 0x5201, 0x10 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_FREE_DMA_BUFF", _IOC_READ|_IOC_WRITE, 0x5202, 0x04 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_ATTACH", _IOC_NONE, 0x5204, 0x00 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_CREATE", _IOC_READ|_IOC_WRITE, 0x5205, 0x18 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_INVOKE", _IOC_READ|_IOC_WRITE, 0x5203, 0x10 }, +{ "misc/habanalabs.h", "HL_IOCTL_CB", _IOC_READ|_IOC_WRITE, 0x4802, 0x18 }, +{ "misc/habanalabs.h", "HL_IOCTL_CS", _IOC_READ|_IOC_WRITE, 0x4803, 0x30 }, +{ "misc/habanalabs.h", "HL_IOCTL_INFO", _IOC_READ|_IOC_WRITE, 0x4801, 0x18 }, +{ "misc/habanalabs.h", "HL_IOCTL_MEMORY", _IOC_READ|_IOC_WRITE, 0x4805, 0x28 }, +{ "misc/habanalabs.h", "HL_IOCTL_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x4804, 0x18 }, +{ "misc/ocxl.h", "OCXL_IOCTL_ATTACH", _IOC_WRITE, 0xca10, 0x20 }, +{ "misc/ocxl.h", "OCXL_IOCTL_ENABLE_P9_WAIT", _IOC_READ, 0xca15, 0x20 }, +{ "misc/ocxl.h", "OCXL_IOCTL_GET_FEATURES", _IOC_READ, 0xca16, 0x20 }, +{ "misc/ocxl.h", "OCXL_IOCTL_GET_METADATA", _IOC_READ, 0xca14, 0x80 }, +{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_ALLOC", _IOC_READ, 0xca11, 0x08 }, +{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_FREE", _IOC_WRITE, 0xca12, 0x08 }, +{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_SET_FD", _IOC_WRITE, 0xca13, 0x10 }, { "mtd/mtd-abi.h", "ECCGETLAYOUT", _IOC_READ, 0x4d11, 0x148 }, { "mtd/mtd-abi.h", "ECCGETSTATS", _IOC_READ, 0x4d12, 0x10 }, { "mtd/mtd-abi.h", "MEMERASE", _IOC_WRITE, 0x4d02, 0x08 }, @@ -2386,8 +2462,10 @@ { "mtd/ubi-user.h", "UBI_IOCMKVOL", _IOC_WRITE, 0x6f00, 0x98 }, { "mtd/ubi-user.h", "UBI_IOCRMVOL", _IOC_WRITE, 0x6f01, 0x04 }, { "mtd/ubi-user.h", "UBI_IOCRNVOL", _IOC_WRITE, 0x6f03, 0x1110 }, +{ "mtd/ubi-user.h", "UBI_IOCRPEB", _IOC_WRITE, 0x6f04, 0x04 }, { "mtd/ubi-user.h", "UBI_IOCRSVOL", _IOC_WRITE, 0x6f02, 0x0c }, { "mtd/ubi-user.h", "UBI_IOCSETVOLPROP", _IOC_WRITE, 0x4f06, 0x10 }, +{ "mtd/ubi-user.h", "UBI_IOCSPEB", _IOC_WRITE, 0x6f05, 0x04 }, { "mtd/ubi-user.h", "UBI_IOCVOLCRBLK", _IOC_WRITE, 0x4f07, 0x80 }, { "mtd/ubi-user.h", "UBI_IOCVOLRMBLK", _IOC_NONE, 0x4f08, 0x00 }, { "mtd/ubi-user.h", "UBI_IOCVOLUP", _IOC_WRITE, 0x4f00, 0x08 }, @@ -2418,23 +2496,24 @@ { "net/bluetooth/rfcomm.h", "RFCOMMRELEASEDEV", _IOC_WRITE, 0x52c9, 0x04 }, { "net/bluetooth/rfcomm.h", "RFCOMMSTEALDLC", _IOC_WRITE, 0x52dc, 0x04 }, { "net/nfc/nci_core.h", "NCIUARTSETDRIVER", _IOC_WRITE, 0x5500, 0x04 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_ACK_EVENT", _IOC_WRITE, 0x1bea, 0x04 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_ASSIGN_CTXT", _IOC_READ|_IOC_WRITE, 0x1be1, 0x1c }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CREDIT_UPD", _IOC_NONE, 0x1be6, 0x00 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CTXT_INFO", _IOC_WRITE, 0x1be2, 0x28 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CTXT_RESET", _IOC_NONE, 0x1bec, 0x00 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_GET_VERS", _IOC_READ, 0x1bee, 0x04 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_POLL_TYPE", _IOC_WRITE, 0x1be9, 0x04 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_RECV_CTRL", _IOC_WRITE, 0x1be8, 0x04 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_SET_PKEY", _IOC_WRITE, 0x1beb, 0x02 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_FREE", _IOC_READ|_IOC_WRITE, 0x1be5, 0x18 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_INVAL_READ", _IOC_READ|_IOC_WRITE, 0x1bed, 0x18 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_UPDATE", _IOC_READ|_IOC_WRITE, 0x1be4, 0x18 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_USER_INFO", _IOC_WRITE, 0x1be3, 0x78 }, -{ "rdma/ib_user_mad.h", "IB_USER_MAD_ENABLE_PKEY", _IOC_NONE, 0x1b03, 0x00 }, -{ "rdma/ib_user_mad.h", "IB_USER_MAD_REGISTER_AGENT", _IOC_READ|_IOC_WRITE, 0x1b01, 0x1c }, -{ "rdma/ib_user_mad.h", "IB_USER_MAD_REGISTER_AGENT2", _IOC_READ|_IOC_WRITE, 0x1b04, 0x28 }, -{ "rdma/ib_user_mad.h", "IB_USER_MAD_UNREGISTER_AGENT", _IOC_WRITE, 0x1b02, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_ACK_EVENT", _IOC_WRITE, 0x1bea, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_ASSIGN_CTXT", _IOC_READ|_IOC_WRITE, 0x1be1, 0x1c }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CREDIT_UPD", _IOC_NONE, 0x1be6, 0x00 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CTXT_INFO", _IOC_WRITE, 0x1be2, 0x28 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CTXT_RESET", _IOC_NONE, 0x1bec, 0x00 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_GET_VERS", _IOC_READ, 0x1bee, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_POLL_TYPE", _IOC_WRITE, 0x1be9, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_RECV_CTRL", _IOC_WRITE, 0x1be8, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_SET_PKEY", _IOC_WRITE, 0x1beb, 0x02 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_FREE", _IOC_READ|_IOC_WRITE, 0x1be5, 0x18 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_INVAL_READ", _IOC_READ|_IOC_WRITE, 0x1bed, 0x18 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_UPDATE", _IOC_READ|_IOC_WRITE, 0x1be4, 0x18 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_USER_INFO", _IOC_WRITE, 0x1be3, 0x78 }, +{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_ENABLE_PKEY", _IOC_NONE, 0x1b03, 0x00 }, +{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_REGISTER_AGENT", _IOC_READ|_IOC_WRITE, 0x1b01, 0x1c }, +{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_REGISTER_AGENT2", _IOC_READ|_IOC_WRITE, 0x1b04, 0x28 }, +{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_UNREGISTER_AGENT", _IOC_WRITE, 0x1b02, 0x04 }, +{ "rdma/rdma_user_ioctl_cmds.h", "RDMA_VERBS_IOCTL", _IOC_READ|_IOC_WRITE, 0x1b01, 0x18 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_ATTACH", _IOC_READ|_IOC_WRITE, 0xca80, 0x90 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_DETACH", _IOC_READ|_IOC_WRITE, 0xca83, 0x60 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_MANAGE_LUN", _IOC_READ|_IOC_WRITE, 0xca86, 0x68 }, @@ -2445,6 +2524,8 @@ { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VERIFY", _IOC_READ|_IOC_WRITE, 0xca84, 0x90 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_CLONE", _IOC_READ|_IOC_WRITE, 0xca89, 0x70 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_RESIZE", _IOC_READ|_IOC_WRITE, 0xca88, 0x78 }, +{ "scsi/cxlflash_ioctl.h", "HT_CXLFLASH_AFU_DEBUG", _IOC_READ|_IOC_WRITE, 0xcabe, 0x78 }, +{ "scsi/cxlflash_ioctl.h", "HT_CXLFLASH_LUN_PROVISION", _IOC_READ|_IOC_WRITE, 0xcabf, 0xa0 }, { "scsi/scsi.h", "SCSI_IOCTL_GET_BUS_NUMBER", 0, 0x5386, 0 }, { "scsi/scsi.h", "SCSI_IOCTL_GET_IDLUN", 0, 0x5382, 0 }, { "scsi/scsi.h", "SCSI_IOCTL_GET_PCI", 0, 0x5387, 0 }, @@ -2563,6 +2644,7 @@ { "sound/asound.h", "SNDRV_PCM_IOCTL_TSTAMP", _IOC_WRITE, 0x4102, 0x04 }, { "sound/asound.h", "SNDRV_PCM_IOCTL_TTSTAMP", _IOC_WRITE, 0x4103, 0x04 }, { "sound/asound.h", "SNDRV_PCM_IOCTL_UNLINK", _IOC_NONE, 0x4161, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_USER_PVERSION", _IOC_WRITE, 0x4104, 0x04 }, { "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEI_FRAMES", _IOC_WRITE, 0x4150, 0x0c }, { "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEN_FRAMES", _IOC_WRITE, 0x4152, 0x0c }, { "sound/asound.h", "SNDRV_PCM_IOCTL_XRUN", _IOC_NONE, 0x4148, 0x00 }, @@ -2626,6 +2708,7 @@ { "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER", _IOC_NONE, 0x4882, 0x00 }, { "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_GET_INFO", _IOC_READ, 0x48f8, 0x20 }, { "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_LOCK", _IOC_NONE, 0x48f9, 0x00 }, +{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_TASCAM_STATE", _IOC_READ, 0x48fb, 0x100 }, { "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_UNLOCK", _IOC_NONE, 0x48fa, 0x00 }, { "sound/hda_hwdep.h", "HDA_IOCTL_GET_WCAP", _IOC_READ|_IOC_WRITE, 0x4812, 0x08 }, { "sound/hda_hwdep.h", "HDA_IOCTL_PVERSION", _IOC_READ, 0x4810, 0x04 }, @@ -2666,17 +2749,17 @@ { "staging/android/ashmem.h", "ASHMEM_SET_PROT_MASK", _IOC_WRITE, 0x7705, 0x04 }, { "staging/android/ashmem.h", "ASHMEM_SET_SIZE", _IOC_WRITE, 0x7703, 0x04 }, { "staging/android/ashmem.h", "ASHMEM_UNPIN", _IOC_WRITE, 0x7708, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_ALLOC", _IOC_READ|_IOC_WRITE, 0x4900, 0x14 }, -{ "staging/android/ion.h", "ION_IOC_CUSTOM", _IOC_READ|_IOC_WRITE, 0x4906, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_FREE", _IOC_READ|_IOC_WRITE, 0x4901, 0x04 }, +{ "staging/android/ion.h", "ION_IOC_ALLOC", _IOC_READ|_IOC_WRITE, 0x4900, 0x18 }, { "staging/android/ion.h", "ION_IOC_HEAP_QUERY", _IOC_READ|_IOC_WRITE, 0x4908, 0x18 }, -{ "staging/android/ion.h", "ION_IOC_IMPORT", _IOC_READ|_IOC_WRITE, 0x4905, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_MAP", _IOC_READ|_IOC_WRITE, 0x4902, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_SHARE", _IOC_READ|_IOC_WRITE, 0x4904, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_SYNC", _IOC_READ|_IOC_WRITE, 0x4907, 0x08 }, -{ "staging/android/ion_test.h", "ION_IOC_TEST_DMA_MAPPING", _IOC_WRITE, 0x49f1, 0x20 }, -{ "staging/android/ion_test.h", "ION_IOC_TEST_KERNEL_MAPPING", _IOC_WRITE, 0x49f2, 0x20 }, -{ "staging/android/ion_test.h", "ION_IOC_TEST_SET_FD", _IOC_NONE, 0x49f0, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_COND_WAIT", _IOC_READ|_IOC_WRITE, 0xf507, 0x20 }, +{ "staging/android/vsoc_shm.h", "VSOC_COND_WAKE", _IOC_NONE, 0xf508, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_CREATE_FD_SCOPED_PERMISSION", _IOC_WRITE, 0xf500, 0x10 }, +{ "staging/android/vsoc_shm.h", "VSOC_DESCRIBE_REGION", _IOC_READ, 0xf504, 0x3c }, +{ "staging/android/vsoc_shm.h", "VSOC_GET_FD_SCOPED_PERMISSION", _IOC_READ, 0xf501, 0x10 }, +{ "staging/android/vsoc_shm.h", "VSOC_MAYBE_SEND_INTERRUPT_TO_HOST", _IOC_NONE, 0xf502, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_SELF_INTERRUPT", _IOC_NONE, 0xf505, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_SEND_INTERRUPT_TO_HOST", _IOC_NONE, 0xf506, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_WAIT_FOR_INCOMING_INTERRUPT", _IOC_NONE, 0xf503, 0x00 }, { "video/da8xx-fb.h", "FBIGET_BRIGHTNESS", _IOC_READ, 0x4603, 0x04 }, { "video/da8xx-fb.h", "FBIGET_COLOR", _IOC_READ, 0x4605, 0x04 }, { "video/da8xx-fb.h", "FBIOGET_CONTRAST", _IOC_READ, 0x4601, 0x04 }, @@ -2719,6 +2802,10 @@ { "xen/evtchn.h", "IOCTL_EVTCHN_RESET", _IOC_NONE, 0x4505, 0x00 }, { "xen/evtchn.h", "IOCTL_EVTCHN_RESTRICT_DOMID", _IOC_NONE, 0x4506, 0x02 }, { "xen/evtchn.h", "IOCTL_EVTCHN_UNBIND", _IOC_NONE, 0x4503, 0x04 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS", _IOC_NONE, 0x4709, 0x14 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_WAIT_RELEASED", _IOC_NONE, 0x470a, 0x08 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_RELEASE", _IOC_NONE, 0x470c, 0x08 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_TO_REFS", _IOC_NONE, 0x470b, 0x14 }, { "xen/gntdev.h", "IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR", _IOC_NONE, 0x4702, 0x18 }, { "xen/gntdev.h", "IOCTL_GNTDEV_GRANT_COPY", _IOC_NONE, 0x4708, 0x08 }, { "xen/gntdev.h", "IOCTL_GNTDEV_MAP_GRANT_REF", _IOC_NONE, 0x4700, 0x18 }, diff --git a/linux/32/syscallent.h b/linux/32/syscallent.h index 63162356..01a5009d 100644 --- a/linux/32/syscallent.h +++ b/linux/32/syscallent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #ifndef sys_ARCH_mmap # define sys_ARCH_mmap sys_mmap #endif @@ -5,7 +12,7 @@ [ 1] = { 1, TM, SEN(io_destroy), "io_destroy" }, [ 2] = { 3, 0, SEN(io_submit), "io_submit" }, [ 3] = { 3, 0, SEN(io_cancel), "io_cancel" }, -[ 4] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[ 4] = { 5, 0, SEN(io_getevents_time32), "io_getevents" }, [ 5] = { 5, TF, SEN(setxattr), "setxattr" }, [ 6] = { 5, TF, SEN(setxattr), "lsetxattr" }, [ 7] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, @@ -28,7 +35,7 @@ [ 24] = { 3, TD, SEN(dup3), "dup3" }, [ 25] = { 3, TD, SEN(fcntl64), "fcntl64" }, [ 26] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, -[ 27] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[ 27] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, [ 28] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, [ 29] = { 3, TD, SEN(ioctl), "ioctl" }, [ 30] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, @@ -44,8 +51,8 @@ [ 40] = { 5, TF, SEN(mount), "mount" }, [ 41] = { 2, TF, SEN(pivotroot), "pivot_root" }, [ 42] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, -[ 43] = { 3, TF, SEN(statfs64), "statfs64" }, -[ 44] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[ 43] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, +[ 44] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, [ 45] = { 3, TF, SEN(truncate64), "truncate64" }, [ 46] = { 3, TD, SEN(ftruncate64), "ftruncate64" }, [ 47] = { 6, TD, SEN(fallocate), "fallocate" }, @@ -73,15 +80,15 @@ [ 69] = { 5, TD, SEN(preadv), "preadv" }, [ 70] = { 5, TD, SEN(pwritev), "pwritev" }, [ 71] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, -[ 72] = { 6, TD, SEN(pselect6), "pselect6" }, -[ 73] = { 5, TD, SEN(ppoll), "ppoll" }, +[ 72] = { 6, TD, SEN(pselect6_time32), "pselect6" }, +[ 73] = { 5, TD, SEN(ppoll_time32), "ppoll" }, [ 74] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, [ 75] = { 4, TD, SEN(vmsplice), "vmsplice" }, [ 76] = { 6, TD, SEN(splice), "splice" }, [ 77] = { 4, TD, SEN(tee), "tee" }, [ 78] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, -[ 79] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, -[ 80] = { 2, TD, SEN(fstat64), "fstat64" }, +[ 79] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" }, +[ 80] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" }, [ 81] = { 0, 0, SEN(sync), "sync" }, [ 82] = { 1, TD, SEN(fsync), "fsync" }, [ 83] = { 1, TD, SEN(fdatasync), "fdatasync" }, @@ -91,9 +98,9 @@ [ 84] = { 6, TD, SEN(sync_file_range), "sync_file_range" }, #endif [ 85] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, -[ 86] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, -[ 87] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, -[ 88] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[ 86] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" }, +[ 87] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" }, +[ 88] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [ 89] = { 1, TF, SEN(acct), "acct" }, [ 90] = { 2, 0, SEN(capget), "capget" }, [ 91] = { 2, 0, SEN(capset), "capset" }, @@ -103,24 +110,24 @@ [ 95] = { 5, TP, SEN(waitid), "waitid" }, [ 96] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [ 97] = { 1, TP, SEN(unshare), "unshare" }, -[ 98] = { 6, 0, SEN(futex), "futex" }, +[ 98] = { 6, 0, SEN(futex_time32), "futex" }, [ 99] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, [100] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, -[101] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[101] = { 2, 0, SEN(nanosleep_time32), "nanosleep" }, [102] = { 2, 0, SEN(getitimer), "getitimer" }, [103] = { 3, 0, SEN(setitimer), "setitimer" }, [104] = { 4, 0, SEN(kexec_load), "kexec_load" }, [105] = { 3, 0, SEN(init_module), "init_module" }, [106] = { 2, 0, SEN(delete_module), "delete_module" }, [107] = { 3, 0, SEN(timer_create), "timer_create" }, -[108] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[108] = { 2, 0, SEN(timer_gettime32), "timer_gettime" }, [109] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, -[110] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[110] = { 4, 0, SEN(timer_settime32), "timer_settime" }, [111] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[112] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[113] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[114] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[115] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[112] = { 2, 0, SEN(clock_settime32), "clock_settime" }, +[113] = { 2, 0, SEN(clock_gettime32), "clock_gettime" }, +[114] = { 2, 0, SEN(clock_getres_time32), "clock_getres" }, +[115] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" }, [116] = { 3, 0, SEN(syslog), "syslog" }, [117] = { 4, 0, SEN(ptrace), "ptrace" }, [118] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, @@ -132,7 +139,7 @@ [124] = { 0, 0, SEN(sched_yield), "sched_yield" }, [125] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [126] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[127] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[127] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"}, [128] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, [129] = { 2, TS, SEN(kill), "kill" }, [130] = { 2, TS, SEN(kill), "tkill" }, @@ -142,7 +149,7 @@ [134] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, [135] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, [136] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[137] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[137] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" }, [138] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, [139] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, [140] = { 3, 0, SEN(setpriority), "setpriority" }, @@ -176,28 +183,28 @@ [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, NF, SEN(getpid), "getpid" }, -[173] = { 0, NF, SEN(getppid), "getppid" }, -[174] = { 0, NF, SEN(getuid), "getuid" }, -[175] = { 0, NF, SEN(geteuid), "geteuid" }, -[176] = { 0, NF, SEN(getgid), "getgid" }, -[177] = { 0, NF, SEN(getegid), "getegid" }, -[178] = { 0, NF, SEN(gettid), "gettid" }, +[171] = { 1, 0, SEN(adjtimex32), "adjtimex" }, +[172] = { 0, PU|NF, SEN(getpid), "getpid" }, +[173] = { 0, PU|NF, SEN(getppid), "getppid" }, +[174] = { 0, PU|NF, SEN(getuid), "getuid" }, +[175] = { 0, PU|NF, SEN(geteuid), "geteuid" }, +[176] = { 0, PU|NF, SEN(getgid), "getgid" }, +[177] = { 0, PU|NF, SEN(getegid), "getegid" }, +[178] = { 0, PU|NF, SEN(gettid), "gettid" }, [179] = { 1, 0, SEN(sysinfo), "sysinfo" }, -[180] = { 4, 0, SEN(mq_open), "mq_open" }, +[180] = { 4, TD, SEN(mq_open), "mq_open" }, [181] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[182] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[183] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[184] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[185] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[182] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" }, +[183] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" }, +[184] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[185] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, [186] = { 2, TI, SEN(msgget), "msgget" }, [187] = { 3, TI, SEN(msgctl), "msgctl" }, [188] = { 5, TI, SEN(msgrcv), "msgrcv" }, [189] = { 4, TI, SEN(msgsnd), "msgsnd" }, [190] = { 3, TI, SEN(semget), "semget" }, [191] = { 4, TI, SEN(semctl), "semctl" }, -[192] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[192] = { 4, TI, SEN(semtimedop_time32), "semtimedop" }, [193] = { 3, TI, SEN(semop), "semop" }, [194] = { 3, TI, SEN(shmget), "shmget" }, [195] = { 3, TI, SEN(shmctl), "shmctl" }, @@ -248,7 +255,7 @@ [240] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, [241] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, [242] = { 4, TN, SEN(accept4), "accept4" }, -[243] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[243] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" }, /* [244 ... 259] are arch specific */ [260] = { 4, TP, SEN(wait4), "wait4" }, [261] = { 4, 0, SEN(prlimit64), "prlimit64" }, @@ -256,7 +263,7 @@ [263] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, [264] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, [265] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[266] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[266] = { 2, 0, SEN(clock_adjtime32), "clock_adjtime" }, [267] = { 1, TD, SEN(syncfs), "syncfs" }, [268] = { 2, TD, SEN(setns), "setns" }, [269] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, @@ -281,6 +288,34 @@ [288] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, [289] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, [290] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[291] = { 5, TD|TF|TSTA, SEN(statx), "statx" }, +[292] = { 6, 0, SEN(io_pgetevents_time32), "io_pgetevents" }, +[293] = { 4, 0, SEN(rseq), "rseq" }, +[294] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" }, +[403] = { 2, 0, SEN(clock_gettime64), "clock_gettime64" }, +[404] = { 2, 0, SEN(clock_settime64), "clock_settime64" }, +[405] = { 2, 0, SEN(clock_adjtime64), "clock_adjtime64" }, +[406] = { 2, 0, SEN(clock_getres_time64), "clock_getres_time64" }, +[407] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep_time64"}, +[408] = { 2, 0, SEN(timer_gettime64), "timer_gettime64" }, +[409] = { 4, 0, SEN(timer_settime64), "timer_settime64" }, +[410] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime64" }, +[411] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime64" }, +[412] = { 4, TD|TF, SEN(utimensat_time64), "utimensat_time64" }, +[413] = { 6, TD, SEN(pselect6_time64), "pselect6_time64" }, +[414] = { 5, TD, SEN(ppoll_time64), "ppoll_time64" }, +[416] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents_time64" }, +[417] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg_time64" }, +[418] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend_time64" }, +[419] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive_time64"}, +[420] = { 4, TI, SEN(semtimedop_time64), "semtimedop_time64" }, +[421] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait_time64"}, +[422] = { 6, 0, SEN(futex_time64), "futex_time64" }, +[423] = { 2, 0, SEN(sched_rr_get_interval_time64), "sched_rr_get_interval_time64" }, +[424] = { 4, TD|TS, SEN(pidfd_send_signal), "pidfd_send_signal" }, +[425] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" }, +[426] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" }, +[427] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" }, #undef sys_ARCH_mmap #undef ARCH_WANT_SYNC_FILE_RANGE2 diff --git a/linux/64/ioctls_inc.h b/linux/64/ioctls_inc.h index f59fe111..bc5ba746 100644 --- a/linux/64/ioctls_inc.h +++ b/linux/64/ioctls_inc.h @@ -34,11 +34,13 @@ { "asm-generic/ioctls.h", "TIOCGETD", 0, 0x5424, 0 }, { "asm-generic/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 }, { "asm-generic/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 }, +{ "asm-generic/ioctls.h", "TIOCGISO7816", _IOC_READ, 0x5442, 0x28 }, { "asm-generic/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 }, { "asm-generic/ioctls.h", "TIOCGPGRP", 0, 0x540F, 0 }, { "asm-generic/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 }, { "asm-generic/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 }, { "asm-generic/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGPTPEER", _IOC_NONE, 0x5441, 0x00 }, { "asm-generic/ioctls.h", "TIOCGRS485", 0, 0x542E, 0 }, { "asm-generic/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 }, { "asm-generic/ioctls.h", "TIOCGSID", 0, 0x5429, 0 }, @@ -65,6 +67,7 @@ { "asm-generic/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 }, { "asm-generic/ioctls.h", "TIOCSETD", 0, 0x5423, 0 }, { "asm-generic/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCSISO7816", _IOC_READ|_IOC_WRITE, 0x5443, 0x28 }, { "asm-generic/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 }, { "asm-generic/ioctls.h", "TIOCSPGRP", 0, 0x5410, 0 }, { "asm-generic/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 }, @@ -84,6 +87,7 @@ { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x6454, 0x20 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x120 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 }, @@ -92,6 +96,8 @@ { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_SCHED", _IOC_WRITE, 0x6455, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_VM", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 }, { "drm/drm.h", "DRM_IOCTL_ADD_BUFS", _IOC_READ|_IOC_WRITE, 0x6416, 0x20 }, @@ -109,6 +115,8 @@ { "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 }, { "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 }, { "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_CRTC_GET_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643b, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_CRTC_QUEUE_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643c, 0x18 }, { "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x40 }, { "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 }, { "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 }, @@ -136,6 +144,7 @@ { "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 }, { "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 }, { "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c6, 0x18 }, { "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c }, { "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 }, { "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 }, @@ -152,10 +161,13 @@ { "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 }, { "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 }, { "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GET_LEASE", _IOC_READ|_IOC_WRITE, 0x64c8, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_LIST_LESSEES", _IOC_READ|_IOC_WRITE, 0x64c7, 0x10 }, { "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 }, { "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x20 }, { "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x18 }, { "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_REVOKE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c9, 0x04 }, { "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 }, { "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 }, { "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 }, @@ -177,6 +189,13 @@ { "drm/drm.h", "DRM_IOCTL_SG_ALLOC", _IOC_READ|_IOC_WRITE, 0x6438, 0x10 }, { "drm/drm.h", "DRM_IOCTL_SG_FREE", _IOC_WRITE, 0x6439, 0x10 }, { "drm/drm.h", "DRM_IOCTL_SWITCH_CTX", _IOC_WRITE, 0x6424, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_CREATE", _IOC_READ|_IOC_WRITE, 0x64bf, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_DESTROY", _IOC_READ|_IOC_WRITE, 0x64c0, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x64c2, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD", _IOC_READ|_IOC_WRITE, 0x64c1, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_RESET", _IOC_READ|_IOC_WRITE, 0x64c4, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_SIGNAL", _IOC_READ|_IOC_WRITE, 0x64c5, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_WAIT", _IOC_READ|_IOC_WRITE, 0x64c3, 0x20 }, { "drm/drm.h", "DRM_IOCTL_UNBLOCK", _IOC_READ|_IOC_WRITE, 0x6413, 0x04 }, { "drm/drm.h", "DRM_IOCTL_UNLOCK", _IOC_WRITE, 0x642b, 0x08 }, { "drm/drm.h", "DRM_IOCTL_UPDATE_DRAW", _IOC_WRITE, 0x643f, 0x18 }, @@ -186,10 +205,12 @@ { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, -{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x30 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_DOM", _IOC_READ|_IOC_WRITE, 0x644a, 0x48 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_SIG", _IOC_READ|_IOC_WRITE, 0x644b, 0x4c }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 }, @@ -197,10 +218,10 @@ { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_GET", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, -{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_CMD_CTRL", _IOC_READ|_IOC_WRITE, 0x6473, 0x08 }, -{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY", _IOC_READ|_IOC_WRITE, 0x6470, 0x50 }, -{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_QUEUE_BUF", _IOC_READ|_IOC_WRITE, 0x6472, 0x28 }, -{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY", _IOC_READ|_IOC_WRITE, 0x6471, 0x60 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_COMMIT", _IOC_READ|_IOC_WRITE, 0x6483, 0x20 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6481, 0x18 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_LIMITS", _IOC_READ|_IOC_WRITE, 0x6482, 0x20 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_RESOURCES", _IOC_READ|_IOC_WRITE, 0x6480, 0x10 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_VIDI_CONNECTION", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, { "drm/i810_drm.h", "DRM_IOCTL_I810_CLEAR", _IOC_WRITE, 0x6442, 0x0c }, { "drm/i810_drm.h", "DRM_IOCTL_I810_COPY", _IOC_WRITE, 0x6447, 0x10 }, @@ -233,6 +254,7 @@ { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_ENTERVT", _IOC_NONE, 0x6459, 0x00 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER", _IOC_WRITE, 0x6454, 0x28 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2", _IOC_WRITE, 0x6469, 0x40 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2_WR", _IOC_READ|_IOC_WRITE, 0x6469, 0x40 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_APERTURE", _IOC_READ, 0x6463, 0x10 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_CACHING", _IOC_READ|_IOC_WRITE, 0x6470, 0x08 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6462, 0x10 }, @@ -264,11 +286,17 @@ { "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_WAIT", _IOC_WRITE, 0x6445, 0x04 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_ATTRS", _IOC_READ|_IOC_WRITE, 0x6468, 0x2c }, { "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_PUT_IMAGE", _IOC_WRITE, 0x6467, 0x2c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_ADD_CONFIG", _IOC_WRITE, 0x6477, 0x48 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_OPEN", _IOC_WRITE, 0x6476, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_REMOVE_CONFIG", _IOC_WRITE, 0x6478, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_QUERY", _IOC_READ|_IOC_WRITE, 0x6479, 0x10 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_REG_READ", _IOC_READ|_IOC_WRITE, 0x6471, 0x10 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_SETPARAM", _IOC_WRITE, 0x6447, 0x08 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_SET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646b, 0x14 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_SET_VBLANK_PIPE", _IOC_WRITE, 0x644d, 0x04 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_VBLANK_SWAP", _IOC_READ|_IOC_WRITE, 0x644f, 0x0c }, +{ "drm/i915_drm.h", "I915_PERF_IOCTL_DISABLE", _IOC_NONE, 0x6901, 0x00 }, +{ "drm/i915_drm.h", "I915_PERF_IOCTL_ENABLE", _IOC_NONE, 0x6900, 0x00 }, { "drm/mga_drm.h", "DRM_IOCTL_MGA_BLIT", _IOC_WRITE, 0x6448, 0x34 }, { "drm/mga_drm.h", "DRM_IOCTL_MGA_CLEAR", _IOC_WRITE, 0x6444, 0x14 }, { "drm/mga_drm.h", "DRM_IOCTL_MGA_DMA_BOOTSTRAP", _IOC_READ|_IOC_WRITE, 0x644c, 0x20 }, @@ -284,17 +312,21 @@ { "drm/mga_drm.h", "DRM_IOCTL_MGA_WAIT_FENCE", _IOC_READ|_IOC_WRITE, 0x644b, 0x04 }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x04 }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 }, -{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x28 }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, -{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x18 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE", _IOC_WRITE, 0x644b, 0x04 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_NEW", _IOC_READ|_IOC_WRITE, 0x644a, 0x0c }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6480, 0x30 }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_PUSHBUF", _IOC_READ|_IOC_WRITE, 0x6481, 0x40 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_SVM_BIND", _IOC_READ|_IOC_WRITE, 0x6449, 0x40 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_SVM_INIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 }, { "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x10 }, { "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x08 }, { "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 }, @@ -377,7 +409,7 @@ { "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_ALLOC", _IOC_READ|_IOC_WRITE, 0x6444, 0x20 }, { "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_FREE", _IOC_WRITE, 0x6445, 0x20 }, { "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_INIT", _IOC_WRITE, 0x6456, 0x10 }, -{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_CLOSE_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6446, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_CLOSE_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6446, 0x08 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644d, 0x08 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 }, @@ -391,12 +423,26 @@ { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_INCR", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_READ", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_GET_BO_OFFSET", _IOC_READ|_IOC_WRITE, 0x6445, 0x08 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0x38 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_TFU", _IOC_WRITE, 0x6446, 0x44 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_LABEL_BO", _IOC_READ|_IOC_WRITE, 0x644a, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, -{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0xa0 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_CREATE", _IOC_READ|_IOC_WRITE, 0x644c, 0x18 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_DESTROY", _IOC_READ|_IOC_WRITE, 0x644d, 0x04 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_GET_VALUES", _IOC_READ|_IOC_WRITE, 0x644e, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0xb0 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_SEQNO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, { "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_ATTACH", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, @@ -415,7 +461,7 @@ { "drm/via_drm.h", "DRM_IOCTL_VIA_MAP_INIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x28 }, { "drm/via_drm.h", "DRM_IOCTL_VIA_PCICMD", _IOC_WRITE, 0x644a, 0x10 }, { "drm/via_drm.h", "DRM_IOCTL_VIA_WAIT_IRQ", _IOC_READ|_IOC_WRITE, 0x644d, 0x18 }, -{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_EXECBUFFER", _IOC_WRITE, 0x6442, 0x20 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_EXECBUFFER", _IOC_READ|_IOC_WRITE, 0x6442, 0x20 }, { "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, { "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6449, 0x18 }, { "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, @@ -451,9 +497,14 @@ { "linux/android/binder.h", "BC_REGISTER_LOOPER", _IOC_NONE, 0x630b, 0x00 }, { "linux/android/binder.h", "BC_RELEASE", _IOC_WRITE, 0x6306, 0x04 }, { "linux/android/binder.h", "BC_REPLY", _IOC_WRITE, 0x6301, 0x40 }, +{ "linux/android/binder.h", "BC_REPLY_SG", _IOC_WRITE, 0x6312, 0x48 }, { "linux/android/binder.h", "BC_REQUEST_DEATH_NOTIFICATION", _IOC_WRITE, 0x630e, 0x0c }, { "linux/android/binder.h", "BC_TRANSACTION", _IOC_WRITE, 0x6300, 0x40 }, +{ "linux/android/binder.h", "BC_TRANSACTION_SG", _IOC_WRITE, 0x6311, 0x48 }, +{ "linux/android/binder.h", "BINDER_GET_NODE_DEBUG_INFO", _IOC_READ|_IOC_WRITE, 0x620b, 0x18 }, +{ "linux/android/binder.h", "BINDER_GET_NODE_INFO_FOR_REF", _IOC_READ|_IOC_WRITE, 0x620c, 0x18 }, { "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR", _IOC_WRITE, 0x6207, 0x04 }, +{ "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR_EXT", _IOC_WRITE, 0x620d, 0x18 }, { "linux/android/binder.h", "BINDER_SET_IDLE_PRIORITY", _IOC_WRITE, 0x6206, 0x04 }, { "linux/android/binder.h", "BINDER_SET_IDLE_TIMEOUT", _IOC_WRITE, 0x6203, 0x08 }, { "linux/android/binder.h", "BINDER_SET_MAX_THREADS", _IOC_WRITE, 0x6205, 0x04 }, @@ -478,10 +529,14 @@ { "linux/android/binder.h", "BR_SPAWN_LOOPER", _IOC_NONE, 0x720d, 0x00 }, { "linux/android/binder.h", "BR_TRANSACTION", _IOC_READ, 0x7202, 0x40 }, { "linux/android/binder.h", "BR_TRANSACTION_COMPLETE", _IOC_NONE, 0x7206, 0x00 }, +{ "linux/android/binder.h", "BR_TRANSACTION_SEC_CTX", _IOC_READ, 0x7202, 0x48 }, +{ "linux/android/binderfs.h", "BINDER_CTL_ADD", _IOC_READ|_IOC_WRITE, 0x6201, 0x108 }, { "linux/apm_bios.h", "APM_IOC_STANDBY", _IOC_NONE, 0x4101, 0x00 }, { "linux/apm_bios.h", "APM_IOC_SUSPEND", _IOC_NONE, 0x4102, 0x00 }, { "linux/arcfb.h", "FBIO_GETCONTROL2", _IOC_READ, 0x4689, 0x08 }, { "linux/arcfb.h", "FBIO_WAITEVENT", _IOC_NONE, 0x4688, 0x00 }, +{ "linux/aspeed-lpc-ctrl.h", "ASPEED_LPC_CTRL_IOCTL_GET_SIZE", _IOC_READ|_IOC_WRITE, 0xb200, 0x10 }, +{ "linux/aspeed-lpc-ctrl.h", "ASPEED_LPC_CTRL_IOCTL_MAP", _IOC_WRITE, 0xb201, 0x10 }, { "linux/atm_eni.h", "ENI_MEMDUMP", _IOC_WRITE, 0x6160, 0x10 }, { "linux/atm_eni.h", "ENI_SETMULT", _IOC_WRITE, 0x6167, 0x10 }, { "linux/atm_he.h", "HE_GET_REG", _IOC_WRITE, 0x6160, 0x10 }, @@ -547,17 +602,19 @@ { "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_SETPIPEFD", _IOC_READ|_IOC_WRITE, 0x9378, 0x18 }, { "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_TIMEOUT", _IOC_READ|_IOC_WRITE, 0x937a, 0x18 }, { "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x9371, 0x18 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_ASKUMOUNT", _IOC_READ, 0x9370, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_CATATONIC", _IOC_NONE, 0x9362, 0x00 }, { "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE", _IOC_READ, 0x9365, 0x10c }, +{ "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE_MULTI", _IOC_WRITE, 0x9366, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_FAIL", _IOC_NONE, 0x9361, 0x00 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_PROTOSUBVER", _IOC_READ, 0x9367, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_PROTOVER", _IOC_READ, 0x9363, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_READY", _IOC_NONE, 0x9360, 0x00 }, { "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT", _IOC_READ|_IOC_WRITE, 0x9364, 0x08 }, { "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT32", _IOC_READ|_IOC_WRITE, 0x9364, 0x04 }, -{ "linux/auto_fs4.h", "AUTOFS_IOC_ASKUMOUNT", _IOC_READ, 0x9370, 0x04 }, -{ "linux/auto_fs4.h", "AUTOFS_IOC_EXPIRE_MULTI", _IOC_WRITE, 0x9366, 0x04 }, -{ "linux/auto_fs4.h", "AUTOFS_IOC_PROTOSUBVER", _IOC_READ, 0x9367, 0x04 }, { "linux/blkpg.h", "BLKPG", _IOC_NONE, 0x1269, 0x00 }, +{ "linux/blkzoned.h", "BLKGETNRZONES", _IOC_READ, 0x1285, 0x04 }, +{ "linux/blkzoned.h", "BLKGETZONESZ", _IOC_READ, 0x1284, 0x04 }, { "linux/blkzoned.h", "BLKREPORTZONE", _IOC_READ|_IOC_WRITE, 0x1282, 0x10 }, { "linux/blkzoned.h", "BLKRESETZONE", _IOC_WRITE, 0x1283, 0x10 }, { "linux/bt-bmc.h", "BT_BMC_IOCTL_SMS_ATN", _IOC_NONE, 0xb100, 0x00 }, @@ -575,14 +632,18 @@ { "linux/btrfs.h", "BTRFS_IOC_DEV_INFO", _IOC_READ|_IOC_WRITE, 0x941e, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_DEV_REPLACE", _IOC_READ|_IOC_WRITE, 0x9435, 0xa28 }, { "linux/btrfs.h", "BTRFS_IOC_FILE_EXTENT_SAME", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 }, +{ "linux/btrfs.h", "BTRFS_IOC_FORGET_DEV", _IOC_WRITE, 0x9405, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_FS_INFO", _IOC_READ, 0x941f, 0x400 }, { "linux/btrfs.h", "BTRFS_IOC_GET_DEV_STATS", _IOC_READ|_IOC_WRITE, 0x9434, 0x408 }, { "linux/btrfs.h", "BTRFS_IOC_GET_FEATURES", _IOC_READ, 0x9439, 0x18 }, -{ "linux/btrfs.h", "BTRFS_IOC_GET_FSLABEL", _IOC_READ, 0x9431, 0x100 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_SUBVOL_INFO", _IOC_READ, 0x943c, 0x1f8 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_SUBVOL_ROOTREF", _IOC_READ|_IOC_WRITE, 0x943d, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_GET_SUPPORTED_FEATURES", _IOC_READ, 0x9439, 0x48 }, { "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP_USER", _IOC_READ|_IOC_WRITE, 0x943e, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 }, { "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 }, +{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO_V2", _IOC_READ|_IOC_WRITE, 0x943b, 0x38 }, { "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 }, { "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 }, { "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 }, @@ -599,7 +660,6 @@ { "linux/btrfs.h", "BTRFS_IOC_SCRUB_PROGRESS", _IOC_READ|_IOC_WRITE, 0x941d, 0x400 }, { "linux/btrfs.h", "BTRFS_IOC_SEND", _IOC_WRITE, 0x9426, 0x48 }, { "linux/btrfs.h", "BTRFS_IOC_SET_FEATURES", _IOC_WRITE, 0x9439, 0x30 }, -{ "linux/btrfs.h", "BTRFS_IOC_SET_FSLABEL", _IOC_WRITE, 0x9432, 0x100 }, { "linux/btrfs.h", "BTRFS_IOC_SET_RECEIVED_SUBVOL", _IOC_READ|_IOC_WRITE, 0x9425, 0xc8 }, { "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE", _IOC_WRITE, 0x9401, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE_V2", _IOC_WRITE, 0x9417, 0x1000 }, @@ -719,6 +779,7 @@ { "linux/cm4000_cs.h", "CM_IOCSRDR", _IOC_NONE, 0x6303, 0x00 }, { "linux/cm4000_cs.h", "CM_IOSDBGLVL", _IOC_WRITE, 0x63fa, 0x08 }, { "linux/coda.h", "CIOC_KERNEL_VERSION", _IOC_READ|_IOC_WRITE, 0x630a, 0x08 }, +{ "linux/dm-ioctl.h", "DM_DEV_ARM_POLL", _IOC_READ|_IOC_WRITE, 0xfd10, 0x138 }, { "linux/dm-ioctl.h", "DM_DEV_CREATE", _IOC_READ|_IOC_WRITE, 0xfd03, 0x138 }, { "linux/dm-ioctl.h", "DM_DEV_REMOVE", _IOC_READ|_IOC_WRITE, 0xfd04, 0x138 }, { "linux/dm-ioctl.h", "DM_DEV_RENAME", _IOC_READ|_IOC_WRITE, 0xfd05, 0x138 }, @@ -745,17 +806,13 @@ { "linux/dvb/audio.h", "AUDIO_CLEAR_BUFFER", _IOC_NONE, 0x6f0c, 0x00 }, { "linux/dvb/audio.h", "AUDIO_CONTINUE", _IOC_NONE, 0x6f04, 0x00 }, { "linux/dvb/audio.h", "AUDIO_GET_CAPABILITIES", _IOC_READ, 0x6f0b, 0x04 }, -{ "linux/dvb/audio.h", "AUDIO_GET_PTS", _IOC_READ, 0x6f13, 0x08 }, { "linux/dvb/audio.h", "AUDIO_GET_STATUS", _IOC_READ, 0x6f0a, 0x20 }, { "linux/dvb/audio.h", "AUDIO_PAUSE", _IOC_NONE, 0x6f03, 0x00 }, { "linux/dvb/audio.h", "AUDIO_PLAY", _IOC_NONE, 0x6f02, 0x00 }, { "linux/dvb/audio.h", "AUDIO_SELECT_SOURCE", _IOC_NONE, 0x6f05, 0x00 }, -{ "linux/dvb/audio.h", "AUDIO_SET_ATTRIBUTES", _IOC_WRITE, 0x6f11, 0x02 }, { "linux/dvb/audio.h", "AUDIO_SET_AV_SYNC", _IOC_NONE, 0x6f07, 0x00 }, { "linux/dvb/audio.h", "AUDIO_SET_BYPASS_MODE", _IOC_NONE, 0x6f08, 0x00 }, -{ "linux/dvb/audio.h", "AUDIO_SET_EXT_ID", _IOC_NONE, 0x6f10, 0x00 }, { "linux/dvb/audio.h", "AUDIO_SET_ID", _IOC_NONE, 0x6f0d, 0x00 }, -{ "linux/dvb/audio.h", "AUDIO_SET_KARAOKE", _IOC_WRITE, 0x6f12, 0x0c }, { "linux/dvb/audio.h", "AUDIO_SET_MIXER", _IOC_WRITE, 0x6f0e, 0x08 }, { "linux/dvb/audio.h", "AUDIO_SET_MUTE", _IOC_NONE, 0x6f06, 0x00 }, { "linux/dvb/audio.h", "AUDIO_SET_STREAMTYPE", _IOC_NONE, 0x6f0f, 0x00 }, @@ -767,16 +824,18 @@ { "linux/dvb/ca.h", "CA_RESET", _IOC_NONE, 0x6f80, 0x00 }, { "linux/dvb/ca.h", "CA_SEND_MSG", _IOC_WRITE, 0x6f85, 0x10c }, { "linux/dvb/ca.h", "CA_SET_DESCR", _IOC_WRITE, 0x6f86, 0x10 }, -{ "linux/dvb/ca.h", "CA_SET_PID", _IOC_WRITE, 0x6f87, 0x08 }, { "linux/dvb/dmx.h", "DMX_ADD_PID", _IOC_WRITE, 0x6f33, 0x02 }, -{ "linux/dvb/dmx.h", "DMX_GET_CAPS", _IOC_READ, 0x6f30, 0x08 }, +{ "linux/dvb/dmx.h", "DMX_DQBUF", _IOC_READ|_IOC_WRITE, 0x6f40, 0x18 }, +{ "linux/dvb/dmx.h", "DMX_EXPBUF", _IOC_READ|_IOC_WRITE, 0x6f3e, 0x0c }, { "linux/dvb/dmx.h", "DMX_GET_PES_PIDS", _IOC_READ, 0x6f2f, 0x0a }, { "linux/dvb/dmx.h", "DMX_GET_STC", _IOC_READ|_IOC_WRITE, 0x6f32, 0x10 }, +{ "linux/dvb/dmx.h", "DMX_QBUF", _IOC_READ|_IOC_WRITE, 0x6f3f, 0x18 }, +{ "linux/dvb/dmx.h", "DMX_QUERYBUF", _IOC_READ|_IOC_WRITE, 0x6f3d, 0x18 }, { "linux/dvb/dmx.h", "DMX_REMOVE_PID", _IOC_WRITE, 0x6f34, 0x02 }, +{ "linux/dvb/dmx.h", "DMX_REQBUFS", _IOC_READ|_IOC_WRITE, 0x6f3c, 0x08 }, { "linux/dvb/dmx.h", "DMX_SET_BUFFER_SIZE", _IOC_NONE, 0x6f2d, 0x00 }, { "linux/dvb/dmx.h", "DMX_SET_FILTER", _IOC_WRITE, 0x6f2b, 0x3c }, { "linux/dvb/dmx.h", "DMX_SET_PES_FILTER", _IOC_WRITE, 0x6f2c, 0x14 }, -{ "linux/dvb/dmx.h", "DMX_SET_SOURCE", _IOC_WRITE, 0x6f31, 0x04 }, { "linux/dvb/dmx.h", "DMX_START", _IOC_NONE, 0x6f29, 0x00 }, { "linux/dvb/dmx.h", "DMX_STOP", _IOC_NONE, 0x6f2a, 0x00 }, { "linux/dvb/frontend.h", "FE_DISEQC_RECV_SLAVE_REPLY", _IOC_READ, 0x6f40, 0x0c }, @@ -812,23 +871,15 @@ { "linux/dvb/video.h", "VIDEO_GET_CAPABILITIES", _IOC_READ, 0x6f21, 0x04 }, { "linux/dvb/video.h", "VIDEO_GET_EVENT", _IOC_READ, 0x6f1c, 0x20 }, { "linux/dvb/video.h", "VIDEO_GET_FRAME_COUNT", _IOC_READ, 0x6f3a, 0x08 }, -{ "linux/dvb/video.h", "VIDEO_GET_FRAME_RATE", _IOC_READ, 0x6f38, 0x04 }, -{ "linux/dvb/video.h", "VIDEO_GET_NAVI", _IOC_READ, 0x6f34, 0x404 }, { "linux/dvb/video.h", "VIDEO_GET_PTS", _IOC_READ, 0x6f39, 0x08 }, { "linux/dvb/video.h", "VIDEO_GET_SIZE", _IOC_READ, 0x6f37, 0x0c }, { "linux/dvb/video.h", "VIDEO_GET_STATUS", _IOC_READ, 0x6f1b, 0x14 }, { "linux/dvb/video.h", "VIDEO_PLAY", _IOC_NONE, 0x6f16, 0x00 }, { "linux/dvb/video.h", "VIDEO_SELECT_SOURCE", _IOC_NONE, 0x6f19, 0x00 }, -{ "linux/dvb/video.h", "VIDEO_SET_ATTRIBUTES", _IOC_NONE, 0x6f35, 0x00 }, { "linux/dvb/video.h", "VIDEO_SET_BLANK", _IOC_NONE, 0x6f1a, 0x00 }, { "linux/dvb/video.h", "VIDEO_SET_DISPLAY_FORMAT", _IOC_NONE, 0x6f1d, 0x00 }, { "linux/dvb/video.h", "VIDEO_SET_FORMAT", _IOC_NONE, 0x6f25, 0x00 }, -{ "linux/dvb/video.h", "VIDEO_SET_HIGHLIGHT", _IOC_WRITE, 0x6f27, 0x10 }, -{ "linux/dvb/video.h", "VIDEO_SET_ID", _IOC_NONE, 0x6f23, 0x00 }, -{ "linux/dvb/video.h", "VIDEO_SET_SPU", _IOC_WRITE, 0x6f32, 0x08 }, -{ "linux/dvb/video.h", "VIDEO_SET_SPU_PALETTE", _IOC_WRITE, 0x6f33, 0x10 }, { "linux/dvb/video.h", "VIDEO_SET_STREAMTYPE", _IOC_NONE, 0x6f24, 0x00 }, -{ "linux/dvb/video.h", "VIDEO_SET_SYSTEM", _IOC_NONE, 0x6f26, 0x00 }, { "linux/dvb/video.h", "VIDEO_SLOWMOTION", _IOC_NONE, 0x6f20, 0x00 }, { "linux/dvb/video.h", "VIDEO_STILLPICTURE", _IOC_WRITE, 0x6f1e, 0x10 }, { "linux/dvb/video.h", "VIDEO_STOP", _IOC_NONE, 0x6f15, 0x00 }, @@ -901,6 +952,14 @@ { "linux/firewire-cdev.h", "FW_CDEV_IOC_SET_ISO_CHANNELS", _IOC_WRITE, 0x2317, 0x10 }, { "linux/firewire-cdev.h", "FW_CDEV_IOC_START_ISO", _IOC_WRITE, 0x230a, 0x10 }, { "linux/firewire-cdev.h", "FW_CDEV_IOC_STOP_ISO", _IOC_WRITE, 0x230b, 0x04 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_CHECK_EXTENSION", _IOC_NONE, 0xb601, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_PR", _IOC_NONE, 0xb680, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_GET_API_VERSION", _IOC_NONE, 0xb600, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_MAP", _IOC_NONE, 0xb643, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_UNMAP", _IOC_NONE, 0xb644, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_INFO", _IOC_NONE, 0xb641, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_REGION_INFO", _IOC_NONE, 0xb642, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_RESET", _IOC_NONE, 0xb640, 0x00 }, { "linux/fs.h", "BLKALIGNOFF", _IOC_NONE, 0x127a, 0x00 }, { "linux/fs.h", "BLKBSZGET", _IOC_READ, 0x1270, 0x08 }, { "linux/fs.h", "BLKBSZSET", _IOC_WRITE, 0x1271, 0x08 }, @@ -945,12 +1004,18 @@ { "linux/fs.h", "FS_IOC_FSGETXATTR", _IOC_READ, 0x581f, 0x1c }, { "linux/fs.h", "FS_IOC_FSSETXATTR", _IOC_WRITE, 0x5820, 0x1c }, { "linux/fs.h", "FS_IOC_GETFLAGS", _IOC_READ, 0x6601, 0x08 }, +{ "linux/fs.h", "FS_IOC_GETFSLABEL", _IOC_READ, 0x9431, 0x100 }, { "linux/fs.h", "FS_IOC_GETVERSION", _IOC_READ, 0x7601, 0x08 }, { "linux/fs.h", "FS_IOC_GET_ENCRYPTION_POLICY", _IOC_WRITE, 0x6615, 0x0c }, { "linux/fs.h", "FS_IOC_GET_ENCRYPTION_PWSALT", _IOC_WRITE, 0x6614, 0x10 }, { "linux/fs.h", "FS_IOC_SETFLAGS", _IOC_WRITE, 0x6602, 0x08 }, +{ "linux/fs.h", "FS_IOC_SETFSLABEL", _IOC_WRITE, 0x9432, 0x100 }, { "linux/fs.h", "FS_IOC_SETVERSION", _IOC_WRITE, 0x7602, 0x08 }, { "linux/fs.h", "FS_IOC_SET_ENCRYPTION_POLICY", _IOC_READ, 0x6613, 0x0c }, +{ "linux/fsi.h", "FSI_SCOM_CHECK", _IOC_READ, 0x7300, 0x04 }, +{ "linux/fsi.h", "FSI_SCOM_READ", _IOC_READ|_IOC_WRITE, 0x7301, 0x20 }, +{ "linux/fsi.h", "FSI_SCOM_RESET", _IOC_WRITE, 0x7303, 0x04 }, +{ "linux/fsi.h", "FSI_SCOM_WRITE", _IOC_READ|_IOC_WRITE, 0x7302, 0x20 }, { "linux/fsl-diu-fb.h", "MFB_GET_ALPHA", _IOC_READ, 0x4d00, 0x01 }, { "linux/fsl-diu-fb.h", "MFB_GET_AOID", _IOC_READ, 0x4d04, 0x08 }, { "linux/fsl-diu-fb.h", "MFB_GET_GAMMA", _IOC_READ, 0x4d01, 0x01 }, @@ -969,6 +1034,7 @@ { "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_START", _IOC_READ|_IOC_WRITE, 0xaf03, 0x10 }, { "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_STOP", _IOC_READ|_IOC_WRITE, 0xaf04, 0x08 }, { "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_SETPROP", _IOC_READ|_IOC_WRITE, 0xaf08, 0x28 }, +{ "linux/fsmap.h", "FS_IOC_GETFSMAP", _IOC_READ|_IOC_WRITE, 0x583b, 0xc0 }, { "linux/fuse.h", "FUSE_DEV_IOC_CLONE", _IOC_READ, 0xe500, 0x04 }, { "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_DDCB", _IOC_READ|_IOC_WRITE, 0xa532, 0xe8 }, { "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_RAW_DDCB", _IOC_READ|_IOC_WRITE, 0xa533, 0xe8 }, @@ -1105,7 +1171,9 @@ { "linux/if_tun.h", "TUNGETVNETBE", _IOC_READ, 0x54df, 0x04 }, { "linux/if_tun.h", "TUNGETVNETHDRSZ", _IOC_READ, 0x54d7, 0x04 }, { "linux/if_tun.h", "TUNGETVNETLE", _IOC_READ, 0x54dd, 0x04 }, +{ "linux/if_tun.h", "TUNSETCARRIER", _IOC_WRITE, 0x54e2, 0x04 }, { "linux/if_tun.h", "TUNSETDEBUG", _IOC_WRITE, 0x54c9, 0x04 }, +{ "linux/if_tun.h", "TUNSETFILTEREBPF", _IOC_READ, 0x54e1, 0x04 }, { "linux/if_tun.h", "TUNSETGROUP", _IOC_WRITE, 0x54ce, 0x04 }, { "linux/if_tun.h", "TUNSETIFF", _IOC_WRITE, 0x54ca, 0x04 }, { "linux/if_tun.h", "TUNSETIFINDEX", _IOC_WRITE, 0x54da, 0x04 }, @@ -1116,11 +1184,13 @@ { "linux/if_tun.h", "TUNSETPERSIST", _IOC_WRITE, 0x54cb, 0x04 }, { "linux/if_tun.h", "TUNSETQUEUE", _IOC_WRITE, 0x54d9, 0x04 }, { "linux/if_tun.h", "TUNSETSNDBUF", _IOC_WRITE, 0x54d4, 0x04 }, +{ "linux/if_tun.h", "TUNSETSTEERINGEBPF", _IOC_READ, 0x54e0, 0x04 }, { "linux/if_tun.h", "TUNSETTXFILTER", _IOC_WRITE, 0x54d1, 0x04 }, { "linux/if_tun.h", "TUNSETVNETBE", _IOC_WRITE, 0x54de, 0x04 }, { "linux/if_tun.h", "TUNSETVNETHDRSZ", _IOC_WRITE, 0x54d8, 0x04 }, { "linux/if_tun.h", "TUNSETVNETLE", _IOC_WRITE, 0x54dc, 0x04 }, { "linux/iio/events.h", "IIO_GET_EVENT_FD_IOCTL", _IOC_READ, 0x6990, 0x04 }, +{ "linux/inotify.h", "INOTIFY_IOC_SETNEXTWD", _IOC_WRITE, 0x4900, 0x04 }, { "linux/input.h", "EVIOCGEFFECTS", _IOC_READ, 0x4584, 0x04 }, { "linux/input.h", "EVIOCGID", _IOC_READ, 0x4502, 0x08 }, { "linux/input.h", "EVIOCGKEYCODE", _IOC_READ, 0x4504, 0x08 }, @@ -1158,6 +1228,9 @@ { "linux/ipmi.h", "IPMICTL_SET_TIMING_PARMS_CMD", _IOC_READ, 0x6916, 0x08 }, { "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD", _IOC_READ, 0x690f, 0x02 }, { "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691d, 0x0c }, +{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_CLEAR_SMS_ATN", _IOC_NONE, 0xb101, 0x00 }, +{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_FORCE_ABORT", _IOC_NONE, 0xb102, 0x00 }, +{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_SET_SMS_ATN", _IOC_NONE, 0xb100, 0x00 }, { "linux/isdn.h", "IIOCDBGVAR", _IOC_NONE, 0x497f, 0x00 }, { "linux/isdn.h", "IIOCDRVCTL", _IOC_NONE, 0x4980, 0x00 }, { "linux/isdn.h", "IIOCGETCPS", _IOC_NONE, 0x4915, 0x00 }, @@ -1199,48 +1272,6 @@ { "linux/ivtv.h", "IVTV_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x40 }, { "linux/ivtv.h", "IVTV_IOC_PASSTHROUGH_MODE", _IOC_WRITE, 0x56c1, 0x04 }, { "linux/ivtvfb.h", "IVTVFB_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x18 }, -{ "linux/ixjuser.h", "IXJCTL_AEC_GET_LEVEL", _IOC_NONE, 0x71cd, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_AEC_START", _IOC_WRITE, 0x71cb, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_AEC_STOP", _IOC_NONE, 0x71cc, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_CARDTYPE", _IOC_READ, 0x71c1, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_CID", _IOC_READ, 0x71d4, 0x08 }, -{ "linux/ixjuser.h", "IXJCTL_CIDCW", _IOC_WRITE, 0x71d9, 0x08 }, -{ "linux/ixjuser.h", "IXJCTL_DAA_AGAIN", _IOC_WRITE, 0x71d2, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DAA_COEFF_SET", _IOC_WRITE, 0x71d0, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DRYBUFFER_CLEAR", _IOC_NONE, 0x71e7, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_DRYBUFFER_READ", _IOC_READ, 0x71e6, 0x08 }, -{ "linux/ixjuser.h", "IXJCTL_DSP_IDLE", _IOC_NONE, 0x71c5, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_DSP_RESET", _IOC_NONE, 0x71c0, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_DSP_TYPE", _IOC_READ, 0x71c3, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DSP_VERSION", _IOC_READ, 0x71c4, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DTMF_PRESCALE", _IOC_WRITE, 0x71e8, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_FILTER_CADENCE", _IOC_WRITE, 0x71d6, 0x08 }, -{ "linux/ixjuser.h", "IXJCTL_FRAMES_READ", _IOC_READ, 0x71e2, 0x08 }, -{ "linux/ixjuser.h", "IXJCTL_FRAMES_WRITTEN", _IOC_READ, 0x71e3, 0x08 }, -{ "linux/ixjuser.h", "IXJCTL_GET_FILTER_HIST", _IOC_WRITE, 0x71c8, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_HZ", _IOC_WRITE, 0x71e0, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_INIT_TONE", _IOC_WRITE, 0x71c9, 0x08 }, -{ "linux/ixjuser.h", "IXJCTL_INTERCOM_START", _IOC_WRITE, 0x71fd, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_INTERCOM_STOP", _IOC_WRITE, 0x71fe, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_MIXER", _IOC_WRITE, 0x71cf, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_PLAY_CID", _IOC_NONE, 0x71d7, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_PORT", _IOC_WRITE, 0x71d1, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_POTS_PSTN", _IOC_WRITE, 0x71d5, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_PSTN_LINETEST", _IOC_NONE, 0x71d3, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_RATE", _IOC_WRITE, 0x71e1, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_READ_WAIT", _IOC_READ, 0x71e4, 0x08 }, -{ "linux/ixjuser.h", "IXJCTL_SC_RXG", _IOC_WRITE, 0x71ea, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SC_TXG", _IOC_WRITE, 0x71eb, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SERIAL", _IOC_READ, 0x71c2, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SET_FILTER", _IOC_WRITE, 0x71c7, 0x08 }, -{ "linux/ixjuser.h", "IXJCTL_SET_FILTER_RAW", _IOC_WRITE, 0x71dd, 0x08 }, -{ "linux/ixjuser.h", "IXJCTL_SET_LED", _IOC_WRITE, 0x71ce, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SIGCTL", _IOC_WRITE, 0x71e9, 0x08 }, -{ "linux/ixjuser.h", "IXJCTL_TESTRAM", _IOC_NONE, 0x71c6, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_TONE_CADENCE", _IOC_WRITE, 0x71ca, 0x08 }, -{ "linux/ixjuser.h", "IXJCTL_VERSION", _IOC_READ, 0x71da, 0x08 }, -{ "linux/ixjuser.h", "IXJCTL_VMWI", _IOC_READ, 0x71d8, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_WRITE_WAIT", _IOC_READ, 0x71e5, 0x08 }, { "linux/joystick.h", "JSIOCGAXES", _IOC_READ, 0x6a11, 0x01 }, { "linux/joystick.h", "JSIOCGAXMAP", _IOC_READ, 0x6a32, 0x40 }, { "linux/joystick.h", "JSIOCGBTNMAP", _IOC_READ, 0x6a34, 0x400 }, @@ -1299,6 +1330,8 @@ { "linux/kd.h", "PIO_UNIMAP", 0, 0x4B67, 0 }, { "linux/kd.h", "PIO_UNIMAPCLR", 0, 0x4B68, 0 }, { "linux/kd.h", "PIO_UNISCRNMAP", 0, 0x4B6A, 0 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ACQUIRE_VM", _IOC_WRITE, 0x4b15, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ALLOC_MEMORY_OF_GPU", _IOC_READ|_IOC_WRITE, 0x4b16, 0x28 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_EVENT", _IOC_READ|_IOC_WRITE, 0x4b08, 0x20 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b02, 0x58 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_ADDRESS_WATCH", _IOC_WRITE, 0x4b0f, 0x10 }, @@ -1307,14 +1340,28 @@ { "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_WAVE_CONTROL", _IOC_WRITE, 0x4b10, 0x10 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_EVENT", _IOC_WRITE, 0x4b09, 0x08 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b03, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_FREE_MEMORY_OF_GPU", _IOC_WRITE, 0x4b17, 0x08 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_CLOCK_COUNTERS", _IOC_READ|_IOC_WRITE, 0x4b05, 0x28 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_DMABUF_INFO", _IOC_READ|_IOC_WRITE, 0x4b1c, 0x20 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES", _IOC_READ, 0x4b06, 0x190 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES_NEW", _IOC_READ|_IOC_WRITE, 0x4b14, 0x10 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_QUEUE_WAVE_STATE", _IOC_READ|_IOC_WRITE, 0x4b1b, 0x18 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_TILE_CONFIG", _IOC_READ|_IOC_WRITE, 0x4b12, 0x28 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_VERSION", _IOC_READ, 0x4b01, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_IMPORT_DMABUF", _IOC_READ|_IOC_WRITE, 0x4b1d, 0x18 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_MAP_MEMORY_TO_GPU", _IOC_READ|_IOC_WRITE, 0x4b18, 0x18 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_RESET_EVENT", _IOC_WRITE, 0x4b0b, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_CU_MASK", _IOC_WRITE, 0x4b1a, 0x10 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_EVENT", _IOC_WRITE, 0x4b0a, 0x08 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_MEMORY_POLICY", _IOC_WRITE, 0x4b04, 0x20 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_SCRATCH_BACKING_VA", _IOC_READ|_IOC_WRITE, 0x4b11, 0x10 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_TRAP_HANDLER", _IOC_WRITE, 0x4b13, 0x18 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_UNMAP_MEMORY_FROM_GPU", _IOC_READ|_IOC_WRITE, 0x4b19, 0x18 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_UPDATE_QUEUE", _IOC_WRITE, 0x4b07, 0x18 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_WAIT_EVENTS", _IOC_READ|_IOC_WRITE, 0x4b0c, 0x18 }, +{ "linux/lightnvm.h", "NVME_NVM_IOCTL_ADMIN_VIO", _IOC_READ|_IOC_WRITE, 0x4c41, 0x50 }, +{ "linux/lightnvm.h", "NVME_NVM_IOCTL_IO_VIO", _IOC_READ|_IOC_WRITE, 0x4c43, 0x50 }, +{ "linux/lightnvm.h", "NVME_NVM_IOCTL_SUBMIT_VIO", _IOC_READ|_IOC_WRITE, 0x4c42, 0x40 }, { "linux/lightnvm.h", "NVM_DEV_CREATE", _IOC_WRITE, 0x4c22, 0x80 }, { "linux/lightnvm.h", "NVM_DEV_FACTORY", _IOC_WRITE, 0x4c25, 0x24 }, { "linux/lightnvm.h", "NVM_DEV_INIT", _IOC_WRITE, 0x4c24, 0x2c }, @@ -1327,6 +1374,7 @@ { "linux/lirc.h", "LIRC_GET_MIN_TIMEOUT", _IOC_READ, 0x6908, 0x04 }, { "linux/lirc.h", "LIRC_GET_REC_MODE", _IOC_READ, 0x6902, 0x04 }, { "linux/lirc.h", "LIRC_GET_REC_RESOLUTION", _IOC_READ, 0x6907, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_REC_TIMEOUT", _IOC_READ, 0x6924, 0x04 }, { "linux/lirc.h", "LIRC_GET_SEND_MODE", _IOC_READ, 0x6901, 0x04 }, { "linux/lirc.h", "LIRC_SET_MEASURE_CARRIER_MODE", _IOC_WRITE, 0x691d, 0x04 }, { "linux/lirc.h", "LIRC_SET_REC_CARRIER", _IOC_WRITE, 0x6914, 0x04 }, @@ -1346,11 +1394,13 @@ { "linux/loop.h", "LOOP_CTL_REMOVE", 0, 0x4C81, 0 }, { "linux/loop.h", "LOOP_GET_STATUS", 0, 0x4C03, 0 }, { "linux/loop.h", "LOOP_GET_STATUS64", 0, 0x4C05, 0 }, +{ "linux/loop.h", "LOOP_SET_BLOCK_SIZE", 0, 0x4C09, 0 }, { "linux/loop.h", "LOOP_SET_CAPACITY", 0, 0x4C07, 0 }, { "linux/loop.h", "LOOP_SET_DIRECT_IO", 0, 0x4C08, 0 }, { "linux/loop.h", "LOOP_SET_FD", 0, 0x4C00, 0 }, { "linux/loop.h", "LOOP_SET_STATUS", 0, 0x4C02, 0 }, { "linux/loop.h", "LOOP_SET_STATUS64", 0, 0x4C04, 0 }, +{ "linux/lp.h", "LPSETTIMEOUT_NEW", _IOC_WRITE, 0x060f, 0x10 }, { "linux/mISDNif.h", "IMADDTIMER", _IOC_READ, 0x4940, 0x04 }, { "linux/mISDNif.h", "IMCLEAR_L2", _IOC_READ, 0x4946, 0x04 }, { "linux/mISDNif.h", "IMCTRLREQ", _IOC_READ, 0x4945, 0x04 }, @@ -1370,7 +1420,10 @@ { "linux/media.h", "MEDIA_IOC_ENUM_ENTITIES", _IOC_READ|_IOC_WRITE, 0x7c01, 0x100 }, { "linux/media.h", "MEDIA_IOC_ENUM_LINKS", _IOC_READ|_IOC_WRITE, 0x7c02, 0x28 }, { "linux/media.h", "MEDIA_IOC_G_TOPOLOGY", _IOC_READ|_IOC_WRITE, 0x7c04, 0x48 }, +{ "linux/media.h", "MEDIA_IOC_REQUEST_ALLOC", _IOC_READ, 0x7c05, 0x04 }, { "linux/media.h", "MEDIA_IOC_SETUP_LINK", _IOC_READ|_IOC_WRITE, 0x7c03, 0x34 }, +{ "linux/media.h", "MEDIA_REQUEST_IOC_QUEUE", _IOC_NONE, 0x7c80, 0x00 }, +{ "linux/media.h", "MEDIA_REQUEST_IOC_REINIT", _IOC_NONE, 0x7c81, 0x00 }, { "linux/mei.h", "IOCTL_MEI_CONNECT_CLIENT", _IOC_READ|_IOC_WRITE, 0x4801, 0x10 }, { "linux/mei.h", "IOCTL_MEI_NOTIFY_GET", _IOC_READ, 0x4803, 0x04 }, { "linux/mei.h", "IOCTL_MEI_NOTIFY_SET", _IOC_WRITE, 0x4802, 0x04 }, @@ -1410,26 +1463,6 @@ { "linux/nbd.h", "NBD_SET_SIZE_BLOCKS", _IOC_NONE, 0xab07, 0x00 }, { "linux/nbd.h", "NBD_SET_SOCK", _IOC_NONE, 0xab00, 0x00 }, { "linux/nbd.h", "NBD_SET_TIMEOUT", _IOC_NONE, 0xab09, 0x00 }, -{ "linux/ncp_fs.h", "NCP_IOC_CONN_LOGGED_IN", _IOC_NONE, 0x6e03, 0x00 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETCHARSETS", _IOC_READ|_IOC_WRITE, 0x6e0b, 0x2a }, -{ "linux/ncp_fs.h", "NCP_IOC_GETDENTRYTTL", _IOC_WRITE, 0x6e0c, 0x04 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID", _IOC_WRITE, 0x6e02, 0x02 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID2", _IOC_WRITE, 0x6e02, 0x08 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETOBJECTNAME", _IOC_READ|_IOC_WRITE, 0x6e09, 0x18 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETPRIVATEDATA", _IOC_READ|_IOC_WRITE, 0x6e0a, 0x10 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETROOT", _IOC_WRITE, 0x6e08, 0x0c }, -{ "linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO", _IOC_READ|_IOC_WRITE, 0x6e04, 0x28 }, -{ "linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO_V2", _IOC_READ|_IOC_WRITE, 0x6e04, 0x30 }, -{ "linux/ncp_fs.h", "NCP_IOC_LOCKUNLOCK", _IOC_READ, 0x6e07, 0x14 }, -{ "linux/ncp_fs.h", "NCP_IOC_NCPREQUEST", _IOC_READ, 0x6e01, 0x10 }, -{ "linux/ncp_fs.h", "NCP_IOC_SETCHARSETS", _IOC_READ, 0x6e0b, 0x2a }, -{ "linux/ncp_fs.h", "NCP_IOC_SETDENTRYTTL", _IOC_READ, 0x6e0c, 0x04 }, -{ "linux/ncp_fs.h", "NCP_IOC_SETOBJECTNAME", _IOC_READ, 0x6e09, 0x18 }, -{ "linux/ncp_fs.h", "NCP_IOC_SETPRIVATEDATA", _IOC_READ, 0x6e0a, 0x10 }, -{ "linux/ncp_fs.h", "NCP_IOC_SETROOT", _IOC_READ, 0x6e08, 0x0c }, -{ "linux/ncp_fs.h", "NCP_IOC_SET_SIGN_WANTED", _IOC_WRITE, 0x6e06, 0x04 }, -{ "linux/ncp_fs.h", "NCP_IOC_SIGN_INIT", _IOC_READ, 0x6e05, 0x18 }, -{ "linux/ncp_fs.h", "NCP_IOC_SIGN_WANTED", _IOC_READ, 0x6e06, 0x04 }, { "linux/ndctl.h", "ND_IOCTL_ARS_CAP", _IOC_READ|_IOC_WRITE, 0x4e01, 0x20 }, { "linux/ndctl.h", "ND_IOCTL_ARS_START", _IOC_READ|_IOC_WRITE, 0x4e02, 0x20 }, { "linux/ndctl.h", "ND_IOCTL_ARS_STATUS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x30 }, @@ -1439,8 +1472,6 @@ { "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e05, 0x0c }, { "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_SIZE", _IOC_READ|_IOC_WRITE, 0x4e04, 0x0c }, { "linux/ndctl.h", "ND_IOCTL_SET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e06, 0x08 }, -{ "linux/ndctl.h", "ND_IOCTL_SMART", _IOC_READ|_IOC_WRITE, 0x4e01, 0x84 }, -{ "linux/ndctl.h", "ND_IOCTL_SMART_THRESHOLD", _IOC_READ|_IOC_WRITE, 0x4e02, 0x0c }, { "linux/ndctl.h", "ND_IOCTL_VENDOR", _IOC_READ|_IOC_WRITE, 0x4e09, 0x08 }, { "linux/nilfs2_api.h", "NILFS_IOCTL_CHANGE_CPMODE", _IOC_WRITE, 0x6e80, 0x10 }, { "linux/nilfs2_api.h", "NILFS_IOCTL_CLEAN_SEGMENTS", _IOC_WRITE, 0x6e88, 0x78 }, @@ -1455,6 +1486,8 @@ { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 }, { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 }, { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 }, +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 }, +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 }, { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 }, { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 }, { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 0x4e41, 0x48 }, @@ -1473,6 +1506,7 @@ { "linux/omap3isp.h", "VIDIOC_OMAP3ISP_PRV_CFG", _IOC_READ|_IOC_WRITE, 0x56c2, 0x70 }, { "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_EN", _IOC_READ|_IOC_WRITE, 0x56c7, 0x08 }, { "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_REQ", _IOC_READ|_IOC_WRITE, 0x56c6, 0x28 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_REQ_TIME32", _IOC_READ|_IOC_WRITE, 0x56c6, 0x18 }, { "linux/omapfb.h", "OMAPFB_CTRL_TEST", _IOC_WRITE, 0x4f2e, 0x04 }, { "linux/omapfb.h", "OMAPFB_GET_CAPS", _IOC_READ, 0x4f2a, 0x0c }, { "linux/omapfb.h", "OMAPFB_GET_COLOR_KEY", _IOC_WRITE, 0x4f33, 0x10 }, @@ -1496,11 +1530,22 @@ { "linux/omapfb.h", "OMAPFB_VSYNC", _IOC_NONE, 0x4f26, 0x00 }, { "linux/omapfb.h", "OMAPFB_WAITFORGO", _IOC_NONE, 0x4f3c, 0x00 }, { "linux/omapfb.h", "OMAPFB_WAITFORVSYNC", _IOC_NONE, 0x4f39, 0x00 }, +{ "linux/pcitest.h", "PCITEST_BAR", _IOC_NONE, 0x5001, 0x00 }, +{ "linux/pcitest.h", "PCITEST_COPY", _IOC_WRITE, 0x5006, 0x08 }, +{ "linux/pcitest.h", "PCITEST_GET_IRQTYPE", _IOC_NONE, 0x5009, 0x00 }, +{ "linux/pcitest.h", "PCITEST_LEGACY_IRQ", _IOC_NONE, 0x5002, 0x00 }, +{ "linux/pcitest.h", "PCITEST_MSI", _IOC_WRITE, 0x5003, 0x04 }, +{ "linux/pcitest.h", "PCITEST_MSIX", _IOC_WRITE, 0x5007, 0x04 }, +{ "linux/pcitest.h", "PCITEST_READ", _IOC_WRITE, 0x5005, 0x08 }, +{ "linux/pcitest.h", "PCITEST_SET_IRQTYPE", _IOC_WRITE, 0x5008, 0x04 }, +{ "linux/pcitest.h", "PCITEST_WRITE", _IOC_WRITE, 0x5004, 0x08 }, { "linux/perf_event.h", "PERF_EVENT_IOC_DISABLE", _IOC_NONE, 0x2401, 0x00 }, { "linux/perf_event.h", "PERF_EVENT_IOC_ENABLE", _IOC_NONE, 0x2400, 0x00 }, { "linux/perf_event.h", "PERF_EVENT_IOC_ID", _IOC_READ, 0x2407, 0x08 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_MODIFY_ATTRIBUTES", _IOC_WRITE, 0x240b, 0x08 }, { "linux/perf_event.h", "PERF_EVENT_IOC_PAUSE_OUTPUT", _IOC_WRITE, 0x2409, 0x04 }, { "linux/perf_event.h", "PERF_EVENT_IOC_PERIOD", _IOC_WRITE, 0x2404, 0x08 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_QUERY_BPF", _IOC_READ|_IOC_WRITE, 0x240a, 0x08 }, { "linux/perf_event.h", "PERF_EVENT_IOC_REFRESH", _IOC_NONE, 0x2402, 0x00 }, { "linux/perf_event.h", "PERF_EVENT_IOC_RESET", _IOC_NONE, 0x2403, 0x00 }, { "linux/perf_event.h", "PERF_EVENT_IOC_SET_BPF", _IOC_WRITE, 0x2408, 0x04 }, @@ -1588,6 +1633,7 @@ { "linux/pr.h", "IOC_PR_REGISTER", _IOC_WRITE, 0x70c8, 0x18 }, { "linux/pr.h", "IOC_PR_RELEASE", _IOC_WRITE, 0x70ca, 0x10 }, { "linux/pr.h", "IOC_PR_RESERVE", _IOC_WRITE, 0x70c9, 0x10 }, +{ "linux/psp-sev.h", "SEV_ISSUE_CMD", _IOC_READ|_IOC_WRITE, 0x5300, 0x10 }, { "linux/ptp_clock.h", "PTP_CLOCK_GETCAPS", _IOC_READ, 0x3d01, 0x50 }, { "linux/ptp_clock.h", "PTP_ENABLE_PPS", _IOC_WRITE, 0x3d04, 0x04 }, { "linux/ptp_clock.h", "PTP_EXTTS_REQUEST", _IOC_WRITE, 0x3d02, 0x10 }, @@ -1595,6 +1641,7 @@ { "linux/ptp_clock.h", "PTP_PIN_GETFUNC", _IOC_READ|_IOC_WRITE, 0x3d06, 0x60 }, { "linux/ptp_clock.h", "PTP_PIN_SETFUNC", _IOC_WRITE, 0x3d07, 0x60 }, { "linux/ptp_clock.h", "PTP_SYS_OFFSET", _IOC_WRITE, 0x3d05, 0x340 }, +{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_EXTENDED", _IOC_READ|_IOC_WRITE, 0x3d09, 0x4c0 }, { "linux/ptp_clock.h", "PTP_SYS_OFFSET_PRECISE", _IOC_READ|_IOC_WRITE, 0x3d08, 0x40 }, { "linux/radeonfb.h", "FBIO_RADEON_GET_MIRROR", _IOC_READ, 0x4003, 0x08 }, { "linux/radeonfb.h", "FBIO_RADEON_SET_MIRROR", _IOC_WRITE, 0x4004, 0x08 }, @@ -1625,6 +1672,7 @@ { "linux/random.h", "RNDCLEARPOOL", _IOC_NONE, 0x5206, 0x00 }, { "linux/random.h", "RNDGETENTCNT", _IOC_READ, 0x5200, 0x04 }, { "linux/random.h", "RNDGETPOOL", _IOC_READ, 0x5202, 0x08 }, +{ "linux/random.h", "RNDRESEEDCRNG", _IOC_NONE, 0x5207, 0x00 }, { "linux/random.h", "RNDZAPENTCNT", _IOC_NONE, 0x5204, 0x00 }, { "linux/raw.h", "RAW_GETBIND", _IOC_NONE, 0xac01, 0x00 }, { "linux/raw.h", "RAW_SETBIND", _IOC_NONE, 0xac00, 0x00 }, @@ -1665,6 +1713,8 @@ { "linux/rio_mport_cdev.h", "RIO_UNMAP_INBOUND", _IOC_WRITE, 0x6d12, 0x08 }, { "linux/rio_mport_cdev.h", "RIO_UNMAP_OUTBOUND", _IOC_WRITE, 0x6d10, 0x28 }, { "linux/rio_mport_cdev.h", "RIO_WAIT_FOR_ASYNC", _IOC_WRITE, 0x6d16, 0x08 }, +{ "linux/rpmsg.h", "RPMSG_CREATE_EPT_IOCTL", _IOC_WRITE, 0xb501, 0x28 }, +{ "linux/rpmsg.h", "RPMSG_DESTROY_EPT_IOCTL", _IOC_NONE, 0xb502, 0x00 }, { "linux/rtc.h", "RTC_AIE_OFF", _IOC_NONE, 0x7002, 0x00 }, { "linux/rtc.h", "RTC_AIE_ON", _IOC_NONE, 0x7001, 0x00 }, { "linux/rtc.h", "RTC_ALM_READ", _IOC_READ, 0x7008, 0x24 }, @@ -1704,6 +1754,21 @@ { "linux/scif_ioctl.h", "SCIF_VREADFROM", _IOC_READ|_IOC_WRITE, 0x730c, 0x28 }, { "linux/scif_ioctl.h", "SCIF_VWRITETO", _IOC_READ|_IOC_WRITE, 0x730d, 0x28 }, { "linux/scif_ioctl.h", "SCIF_WRITETO", _IOC_READ|_IOC_WRITE, 0x730b, 0x28 }, +{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_ID_VALID", _IOC_READ, 0x2102, 0x08 }, +{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_RECV", _IOC_READ|_IOC_WRITE, 0x2100, 0x50 }, +{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_SEND", _IOC_READ|_IOC_WRITE, 0x2101, 0x18 }, +{ "linux/sed-opal.h", "IOC_OPAL_ACTIVATE_LSP", _IOC_WRITE, 0x70df, 0x118 }, +{ "linux/sed-opal.h", "IOC_OPAL_ACTIVATE_USR", _IOC_WRITE, 0x70e1, 0x110 }, +{ "linux/sed-opal.h", "IOC_OPAL_ADD_USR_TO_LR", _IOC_WRITE, 0x70e4, 0x118 }, +{ "linux/sed-opal.h", "IOC_OPAL_ENABLE_DISABLE_MBR", _IOC_WRITE, 0x70e5, 0x110 }, +{ "linux/sed-opal.h", "IOC_OPAL_ERASE_LR", _IOC_WRITE, 0x70e6, 0x110 }, +{ "linux/sed-opal.h", "IOC_OPAL_LOCK_UNLOCK", _IOC_WRITE, 0x70dd, 0x118 }, +{ "linux/sed-opal.h", "IOC_OPAL_LR_SETUP", _IOC_WRITE, 0x70e3, 0x128 }, +{ "linux/sed-opal.h", "IOC_OPAL_REVERT_TPR", _IOC_WRITE, 0x70e2, 0x108 }, +{ "linux/sed-opal.h", "IOC_OPAL_SAVE", _IOC_WRITE, 0x70dc, 0x118 }, +{ "linux/sed-opal.h", "IOC_OPAL_SECURE_ERASE_LR", _IOC_WRITE, 0x70e7, 0x110 }, +{ "linux/sed-opal.h", "IOC_OPAL_SET_PW", _IOC_WRITE, 0x70e0, 0x220 }, +{ "linux/sed-opal.h", "IOC_OPAL_TAKE_OWNERSHIP", _IOC_WRITE, 0x70de, 0x108 }, { "linux/serio.h", "SPIOCSTYPE", _IOC_WRITE, 0x7101, 0x08 }, { "linux/sockios.h", "SIOCADDDLCI", 0, 0x8980, 0 }, { "linux/sockios.h", "SIOCADDMULTI", 0, 0x8931, 0 }, @@ -1916,6 +1981,12 @@ { "linux/suspend_ioctls.h", "SNAPSHOT_S2RAM", _IOC_NONE, 0x330b, 0x00 }, { "linux/suspend_ioctls.h", "SNAPSHOT_SET_SWAP_AREA", _IOC_WRITE, 0x330d, 0x0c }, { "linux/suspend_ioctls.h", "SNAPSHOT_UNFREEZE", _IOC_NONE, 0x3302, 0x00 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_CTL", _IOC_READ|_IOC_WRITE, 0x5743, 0x28 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_SUMMARY", _IOC_READ, 0x5742, 0x198 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_FLASH_INFO", _IOC_READ, 0x5740, 0x10 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_FLASH_PART_INFO", _IOC_READ|_IOC_WRITE, 0x5741, 0x10 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_PFF_TO_PORT", _IOC_READ|_IOC_WRITE, 0x5744, 0x0c }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_PORT_TO_PFF", _IOC_READ|_IOC_WRITE, 0x5745, 0x0c }, { "linux/sync_file.h", "SYNC_IOC_FILE_INFO", _IOC_READ|_IOC_WRITE, 0x3e04, 0x38 }, { "linux/sync_file.h", "SYNC_IOC_MERGE", _IOC_READ|_IOC_WRITE, 0x3e03, 0x30 }, { "linux/synclink.h", "MGSL_IOCCLRMODCOUNT", _IOC_NONE, 0x6d0f, 0x00 }, @@ -1938,53 +2009,15 @@ { "linux/synclink.h", "MGSL_IOCTXENABLE", _IOC_NONE, 0x6d04, 0x00 }, { "linux/synclink.h", "MGSL_IOCWAITEVENT", _IOC_READ|_IOC_WRITE, 0x6d08, 0x04 }, { "linux/synclink.h", "MGSL_IOCWAITGPIO", _IOC_READ|_IOC_WRITE, 0x6d12, 0x10 }, -{ "linux/telephony.h", "OLD_PHONE_RING_START", _IOC_NONE, 0x7187, 0x00 }, -{ "linux/telephony.h", "PHONE_BUSY", _IOC_NONE, 0x71a1, 0x00 }, -{ "linux/telephony.h", "PHONE_CAPABILITIES", _IOC_NONE, 0x7180, 0x00 }, -{ "linux/telephony.h", "PHONE_CAPABILITIES_CHECK", _IOC_WRITE, 0x7182, 0x08 }, -{ "linux/telephony.h", "PHONE_CAPABILITIES_LIST", _IOC_READ, 0x7181, 0x08 }, -{ "linux/telephony.h", "PHONE_CPT_STOP", _IOC_NONE, 0x71a4, 0x00 }, -{ "linux/telephony.h", "PHONE_DIALTONE", _IOC_NONE, 0x71a3, 0x00 }, -{ "linux/telephony.h", "PHONE_DTMF_OOB", _IOC_WRITE, 0x7199, 0x04 }, -{ "linux/telephony.h", "PHONE_DTMF_READY", _IOC_READ, 0x7196, 0x04 }, -{ "linux/telephony.h", "PHONE_EXCEPTION", _IOC_READ, 0x719a, 0x04 }, -{ "linux/telephony.h", "PHONE_FRAME", _IOC_WRITE, 0x718d, 0x04 }, -{ "linux/telephony.h", "PHONE_GET_DTMF", _IOC_READ, 0x7197, 0x04 }, -{ "linux/telephony.h", "PHONE_GET_DTMF_ASCII", _IOC_READ, 0x7198, 0x04 }, -{ "linux/telephony.h", "PHONE_GET_TONE_OFF_TIME", _IOC_NONE, 0x719f, 0x00 }, -{ "linux/telephony.h", "PHONE_GET_TONE_ON_TIME", _IOC_NONE, 0x719e, 0x00 }, -{ "linux/telephony.h", "PHONE_GET_TONE_STATE", _IOC_NONE, 0x71a0, 0x00 }, -{ "linux/telephony.h", "PHONE_HOOKSTATE", _IOC_NONE, 0x7184, 0x00 }, -{ "linux/telephony.h", "PHONE_MAXRINGS", _IOC_WRITE, 0x7185, 0x01 }, -{ "linux/telephony.h", "PHONE_PLAY_CODEC", _IOC_WRITE, 0x7190, 0x04 }, -{ "linux/telephony.h", "PHONE_PLAY_DEPTH", _IOC_WRITE, 0x7193, 0x04 }, -{ "linux/telephony.h", "PHONE_PLAY_LEVEL", _IOC_NONE, 0x7195, 0x00 }, -{ "linux/telephony.h", "PHONE_PLAY_START", _IOC_NONE, 0x7191, 0x00 }, -{ "linux/telephony.h", "PHONE_PLAY_STOP", _IOC_NONE, 0x7192, 0x00 }, -{ "linux/telephony.h", "PHONE_PLAY_TONE", _IOC_WRITE, 0x719b, 0x01 }, -{ "linux/telephony.h", "PHONE_PLAY_VOLUME", _IOC_WRITE, 0x7194, 0x04 }, -{ "linux/telephony.h", "PHONE_PLAY_VOLUME_LINEAR", _IOC_WRITE, 0x71dc, 0x04 }, -{ "linux/telephony.h", "PHONE_PSTN_GET_STATE", _IOC_NONE, 0x71a5, 0x00 }, -{ "linux/telephony.h", "PHONE_PSTN_LINETEST", _IOC_NONE, 0x71a8, 0x00 }, -{ "linux/telephony.h", "PHONE_PSTN_SET_STATE", _IOC_WRITE, 0x71a4, 0x04 }, -{ "linux/telephony.h", "PHONE_QUERY_CODEC", _IOC_READ|_IOC_WRITE, 0x71a7, 0x08 }, -{ "linux/telephony.h", "PHONE_REC_CODEC", _IOC_WRITE, 0x7189, 0x04 }, -{ "linux/telephony.h", "PHONE_REC_DEPTH", _IOC_WRITE, 0x718c, 0x04 }, -{ "linux/telephony.h", "PHONE_REC_LEVEL", _IOC_NONE, 0x718f, 0x00 }, -{ "linux/telephony.h", "PHONE_REC_START", _IOC_NONE, 0x718a, 0x00 }, -{ "linux/telephony.h", "PHONE_REC_STOP", _IOC_NONE, 0x718b, 0x00 }, -{ "linux/telephony.h", "PHONE_REC_VOLUME", _IOC_WRITE, 0x718e, 0x04 }, -{ "linux/telephony.h", "PHONE_REC_VOLUME_LINEAR", _IOC_WRITE, 0x71db, 0x04 }, -{ "linux/telephony.h", "PHONE_RING", _IOC_NONE, 0x7183, 0x00 }, -{ "linux/telephony.h", "PHONE_RINGBACK", _IOC_NONE, 0x71a2, 0x00 }, -{ "linux/telephony.h", "PHONE_RING_CADENCE", _IOC_WRITE, 0x7186, 0x02 }, -{ "linux/telephony.h", "PHONE_RING_START", _IOC_WRITE, 0x7187, 0x08 }, -{ "linux/telephony.h", "PHONE_RING_STOP", _IOC_NONE, 0x7188, 0x00 }, -{ "linux/telephony.h", "PHONE_SET_TONE_OFF_TIME", _IOC_WRITE, 0x719d, 0x04 }, -{ "linux/telephony.h", "PHONE_SET_TONE_ON_TIME", _IOC_WRITE, 0x719c, 0x04 }, -{ "linux/telephony.h", "PHONE_VAD", _IOC_WRITE, 0x71a9, 0x04 }, -{ "linux/telephony.h", "PHONE_WINK", _IOC_WRITE, 0x71aa, 0x04 }, -{ "linux/telephony.h", "PHONE_WINK_DURATION", _IOC_WRITE, 0x71a6, 0x04 }, +{ "linux/tee.h", "TEE_IOC_CANCEL", _IOC_READ, 0xa404, 0x08 }, +{ "linux/tee.h", "TEE_IOC_CLOSE_SESSION", _IOC_READ, 0xa405, 0x04 }, +{ "linux/tee.h", "TEE_IOC_INVOKE", _IOC_READ, 0xa403, 0x10 }, +{ "linux/tee.h", "TEE_IOC_OPEN_SESSION", _IOC_READ, 0xa402, 0x10 }, +{ "linux/tee.h", "TEE_IOC_SHM_ALLOC", _IOC_READ|_IOC_WRITE, 0xa401, 0x10 }, +{ "linux/tee.h", "TEE_IOC_SHM_REGISTER", _IOC_READ|_IOC_WRITE, 0xa409, 0x18 }, +{ "linux/tee.h", "TEE_IOC_SUPPL_RECV", _IOC_READ, 0xa406, 0x10 }, +{ "linux/tee.h", "TEE_IOC_SUPPL_SEND", _IOC_READ, 0xa407, 0x10 }, +{ "linux/tee.h", "TEE_IOC_VERSION", _IOC_READ, 0xa400, 0x0c }, { "linux/timerfd.h", "TFD_IOC_SET_TICKS", _IOC_WRITE, 0x5400, 0x08 }, { "linux/toshiba.h", "TOSHIBA_ACPI_SCI", _IOC_READ|_IOC_WRITE, 0x7491, 0x18 }, { "linux/toshiba.h", "TOSH_SMM", _IOC_READ|_IOC_WRITE, 0x7490, 0x18 }, @@ -1992,6 +2025,8 @@ { "linux/udf_fs_i.h", "UDF_GETEASIZE", _IOC_READ, 0x6c40, 0x04 }, { "linux/udf_fs_i.h", "UDF_GETVOLIDENT", _IOC_READ, 0x6c42, 0x08 }, { "linux/udf_fs_i.h", "UDF_RELOCATE_BLOCKS", _IOC_READ|_IOC_WRITE, 0x6c43, 0x08 }, +{ "linux/udmabuf.h", "UDMABUF_CREATE", _IOC_WRITE, 0x7542, 0x18 }, +{ "linux/udmabuf.h", "UDMABUF_CREATE_LIST", _IOC_WRITE, 0x7543, 0x08 }, { "linux/uinput.h", "UI_ABS_SETUP", _IOC_WRITE, 0x5504, 0x1c }, { "linux/uinput.h", "UI_BEGIN_FF_ERASE", _IOC_READ|_IOC_WRITE, 0x55ca, 0x0c }, { "linux/uinput.h", "UI_BEGIN_FF_UPLOAD", _IOC_READ|_IOC_WRITE, 0x55c8, 0x68 }, @@ -2021,6 +2056,7 @@ { "linux/usb/functionfs.h", "FUNCTIONFS_INTERFACE_REVMAP", _IOC_NONE, 0x6780, 0x00 }, { "linux/usb/g_printer.h", "GADGET_GET_PRINTER_STATUS", _IOC_READ, 0x6721, 0x01 }, { "linux/usb/g_printer.h", "GADGET_SET_PRINTER_STATUS", _IOC_READ|_IOC_WRITE, 0x6722, 0x01 }, +{ "linux/usb/g_uvc.h", "UVCIOC_SEND_RESPONSE", _IOC_WRITE, 0x5501, 0x40 }, { "linux/usb/gadgetfs.h", "GADGETFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 }, { "linux/usb/gadgetfs.h", "GADGETFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 }, { "linux/usb/gadgetfs.h", "GADGETFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 }, @@ -2032,12 +2068,27 @@ { "linux/usb/tmc.h", "USBTMC488_IOCTL_LOCAL_LOCKOUT", _IOC_NONE, 0x5b15, 0x00 }, { "linux/usb/tmc.h", "USBTMC488_IOCTL_READ_STB", _IOC_READ, 0x5b12, 0x01 }, { "linux/usb/tmc.h", "USBTMC488_IOCTL_REN_CONTROL", _IOC_WRITE, 0x5b13, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_TRIGGER", _IOC_NONE, 0x5b16, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_WAIT_SRQ", _IOC_WRITE, 0x5b17, 0x04 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_IN", _IOC_NONE, 0x5b04, 0x00 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_OUT", _IOC_NONE, 0x5b03, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_API_VERSION", _IOC_READ, 0x5b10, 0x04 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_AUTO_ABORT", _IOC_WRITE, 0x5b19, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CANCEL_IO", _IOC_NONE, 0x5b23, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEANUP_IO", _IOC_NONE, 0x5b24, 0x00 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR", _IOC_NONE, 0x5b02, 0x00 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_IN_HALT", _IOC_NONE, 0x5b07, 0x00 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_OUT_HALT", _IOC_NONE, 0x5b06, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CONFIG_TERMCHAR", _IOC_WRITE, 0x5b0c, 0x02 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CTRL_REQUEST", _IOC_READ|_IOC_WRITE, 0x5b08, 0x10 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_EOM_ENABLE", _IOC_WRITE, 0x5b0b, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_GET_TIMEOUT", _IOC_READ, 0x5b09, 0x04 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_INDICATOR_PULSE", _IOC_NONE, 0x5b01, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_MSG_IN_ATTR", _IOC_READ, 0x5b18, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_READ", _IOC_READ|_IOC_WRITE, 0x5b0e, 0x14 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_SET_TIMEOUT", _IOC_WRITE, 0x5b0a, 0x04 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_WRITE", _IOC_READ|_IOC_WRITE, 0x5b0d, 0x14 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_WRITE_RESULT", _IOC_READ|_IOC_WRITE, 0x5b0f, 0x04 }, { "linux/usbdevice_fs.h", "USBDEVFS_ALLOC_STREAMS", _IOC_READ, 0x551c, 0x08 }, { "linux/usbdevice_fs.h", "USBDEVFS_BULK", _IOC_READ|_IOC_WRITE, 0x5502, 0x18 }, { "linux/usbdevice_fs.h", "USBDEVFS_BULK32", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 }, @@ -2057,6 +2108,7 @@ { "linux/usbdevice_fs.h", "USBDEVFS_FREE_STREAMS", _IOC_READ, 0x551d, 0x08 }, { "linux/usbdevice_fs.h", "USBDEVFS_GETDRIVER", _IOC_WRITE, 0x5508, 0x104 }, { "linux/usbdevice_fs.h", "USBDEVFS_GET_CAPABILITIES", _IOC_READ, 0x551a, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_GET_SPEED", _IOC_NONE, 0x551f, 0x00 }, { "linux/usbdevice_fs.h", "USBDEVFS_HUB_PORTINFO", _IOC_READ, 0x5513, 0x80 }, { "linux/usbdevice_fs.h", "USBDEVFS_IOCTL", _IOC_READ|_IOC_WRITE, 0x5512, 0x10 }, { "linux/usbdevice_fs.h", "USBDEVFS_IOCTL32", _IOC_READ|_IOC_WRITE, 0x5512, 0x0c }, @@ -2080,30 +2132,36 @@ { "linux/userfaultfd.h", "UFFDIO_ZEROPAGE", _IOC_READ|_IOC_WRITE, 0xaa04, 0x20 }, { "linux/uvcvideo.h", "UVCIOC_CTRL_MAP", _IOC_READ|_IOC_WRITE, 0x7520, 0x60 }, { "linux/uvcvideo.h", "UVCIOC_CTRL_QUERY", _IOC_READ|_IOC_WRITE, 0x7521, 0x10 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x564b, 0x40 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_SIZE", _IOC_READ|_IOC_WRITE, 0x564a, 0x40 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_MBUS_CODE", _IOC_READ|_IOC_WRITE, 0x5602, 0x30 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x38 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x28 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0x58 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5615, 0x30 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x563d, 0x40 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_CROP", _IOC_READ|_IOC_WRITE, 0x563c, 0x38 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x28 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0x58 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5616, 0x30 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x563e, 0x40 }, +{ "linux/vboxguest.h", "VBG_IOCTL_CHANGE_FILTER_MASK", _IOC_READ|_IOC_WRITE, 0x560c, 0x20 }, +{ "linux/vboxguest.h", "VBG_IOCTL_CHANGE_GUEST_CAPABILITIES", _IOC_READ|_IOC_WRITE, 0x560e, 0x20 }, +{ "linux/vboxguest.h", "VBG_IOCTL_CHECK_BALLOON", _IOC_READ|_IOC_WRITE, 0x5611, 0x20 }, +{ "linux/vboxguest.h", "VBG_IOCTL_DRIVER_VERSION_INFO", _IOC_READ|_IOC_WRITE, 0x5600, 0x2c }, +{ "linux/vboxguest.h", "VBG_IOCTL_HGCM_CONNECT", _IOC_READ|_IOC_WRITE, 0x5604, 0x9c }, +{ "linux/vboxguest.h", "VBG_IOCTL_HGCM_DISCONNECT", _IOC_READ|_IOC_WRITE, 0x5605, 0x1c }, +{ "linux/vboxguest.h", "VBG_IOCTL_INTERRUPT_ALL_WAIT_FOR_EVENTS", _IOC_READ|_IOC_WRITE, 0x560b, 0x18 }, +{ "linux/vboxguest.h", "VBG_IOCTL_VMMDEV_REQUEST_BIG", _IOC_READ|_IOC_WRITE, 0x5603, 0x00 }, +{ "linux/vboxguest.h", "VBG_IOCTL_WAIT_FOR_EVENTS", _IOC_READ|_IOC_WRITE, 0x560a, 0x20 }, +{ "linux/vboxguest.h", "VBG_IOCTL_WRITE_CORE_DUMP", _IOC_READ|_IOC_WRITE, 0x5613, 0x1c }, { "linux/vfio.h", "VFIO_CHECK_EXTENSION", _IOC_NONE, 0x3b65, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_GFX_DMABUF", _IOC_NONE, 0x3b73, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_GET_INFO", _IOC_NONE, 0x3b6b, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_GET_IRQ_INFO", _IOC_NONE, 0x3b6d, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_GET_PCI_HOT_RESET_INFO", _IOC_NONE, 0x3b70, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_GET_REGION_INFO", _IOC_NONE, 0x3b6c, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_IOEVENTFD", _IOC_NONE, 0x3b74, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_PCI_HOT_RESET", _IOC_NONE, 0x3b71, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_QUERY_GFX_PLANE", _IOC_NONE, 0x3b72, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_RESET", _IOC_NONE, 0x3b6f, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_SET_IRQS", _IOC_NONE, 0x3b6e, 0x00 }, { "linux/vfio.h", "VFIO_EEH_PE_OP", _IOC_NONE, 0x3b79, 0x00 }, @@ -2123,6 +2181,7 @@ { "linux/vfio.h", "VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY", _IOC_NONE, 0x3b76, 0x00 }, { "linux/vfio.h", "VFIO_IOMMU_UNMAP_DMA", _IOC_NONE, 0x3b72, 0x00 }, { "linux/vfio.h", "VFIO_SET_IOMMU", _IOC_NONE, 0x3b66, 0x00 }, +{ "linux/vhost.h", "VHOST_GET_BACKEND_FEATURES", _IOC_READ, 0xaf26, 0x08 }, { "linux/vhost.h", "VHOST_GET_FEATURES", _IOC_READ, 0xaf00, 0x08 }, { "linux/vhost.h", "VHOST_GET_VRING_BASE", _IOC_READ|_IOC_WRITE, 0xaf12, 0x08 }, { "linux/vhost.h", "VHOST_GET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf24, 0x08 }, @@ -2134,6 +2193,7 @@ { "linux/vhost.h", "VHOST_SCSI_GET_EVENTS_MISSED", _IOC_WRITE, 0xaf44, 0x04 }, { "linux/vhost.h", "VHOST_SCSI_SET_ENDPOINT", _IOC_WRITE, 0xaf40, 0xe8 }, { "linux/vhost.h", "VHOST_SCSI_SET_EVENTS_MISSED", _IOC_WRITE, 0xaf43, 0x04 }, +{ "linux/vhost.h", "VHOST_SET_BACKEND_FEATURES", _IOC_WRITE, 0xaf25, 0x08 }, { "linux/vhost.h", "VHOST_SET_FEATURES", _IOC_WRITE, 0xaf00, 0x08 }, { "linux/vhost.h", "VHOST_SET_LOG_BASE", _IOC_WRITE, 0xaf04, 0x08 }, { "linux/vhost.h", "VHOST_SET_LOG_FD", _IOC_WRITE, 0xaf07, 0x04 }, @@ -2203,7 +2263,6 @@ { "linux/videodev2.h", "VIDIOC_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 }, { "linux/videodev2.h", "VIDIOC_QUERY_EXT_CTRL", _IOC_READ|_IOC_WRITE, 0x5667, 0xe8 }, { "linux/videodev2.h", "VIDIOC_REQBUFS", _IOC_READ|_IOC_WRITE, 0x5608, 0x14 }, -{ "linux/videodev2.h", "VIDIOC_RESERVED", _IOC_NONE, 0x5601, 0x00 }, { "linux/videodev2.h", "VIDIOC_STREAMOFF", _IOC_WRITE, 0x5613, 0x04 }, { "linux/videodev2.h", "VIDIOC_STREAMON", _IOC_WRITE, 0x5612, 0x04 }, { "linux/videodev2.h", "VIDIOC_SUBSCRIBE_EVENT", _IOC_WRITE, 0x565a, 0x20 }, @@ -2335,7 +2394,7 @@ { "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 }, { "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 }, { "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 }, -{ "media/davinci/vpfe_capture.h", "VPFE_CMD_S_CCDC_RAW_PARAMS", _IOC_WRITE, 0x56c1, 0x08 }, +{ "linux/wmi.h", "DELL_WMI_SMBIOS_CMD", _IOC_READ|_IOC_WRITE, 0x5700, 0x34 }, { "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 }, { "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 }, { "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 }, @@ -2353,6 +2412,23 @@ { "misc/cxl.h", "CXL_IOCTL_GET_PROCESS_ELEMENT", _IOC_READ, 0xca01, 0x04 }, { "misc/cxl.h", "CXL_IOCTL_START_WORK", _IOC_WRITE, 0xca00, 0x40 }, { "misc/cxl.h", "CXL_IOCTL_VALIDATE_IMAGE", _IOC_WRITE, 0xca0b, 0x40 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_ALLOC_DMA_BUFF", _IOC_READ|_IOC_WRITE, 0x5201, 0x10 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_FREE_DMA_BUFF", _IOC_READ|_IOC_WRITE, 0x5202, 0x04 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_ATTACH", _IOC_NONE, 0x5204, 0x00 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_CREATE", _IOC_READ|_IOC_WRITE, 0x5205, 0x18 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_INVOKE", _IOC_READ|_IOC_WRITE, 0x5203, 0x10 }, +{ "misc/habanalabs.h", "HL_IOCTL_CB", _IOC_READ|_IOC_WRITE, 0x4802, 0x18 }, +{ "misc/habanalabs.h", "HL_IOCTL_CS", _IOC_READ|_IOC_WRITE, 0x4803, 0x30 }, +{ "misc/habanalabs.h", "HL_IOCTL_INFO", _IOC_READ|_IOC_WRITE, 0x4801, 0x18 }, +{ "misc/habanalabs.h", "HL_IOCTL_MEMORY", _IOC_READ|_IOC_WRITE, 0x4805, 0x28 }, +{ "misc/habanalabs.h", "HL_IOCTL_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x4804, 0x18 }, +{ "misc/ocxl.h", "OCXL_IOCTL_ATTACH", _IOC_WRITE, 0xca10, 0x20 }, +{ "misc/ocxl.h", "OCXL_IOCTL_ENABLE_P9_WAIT", _IOC_READ, 0xca15, 0x20 }, +{ "misc/ocxl.h", "OCXL_IOCTL_GET_FEATURES", _IOC_READ, 0xca16, 0x20 }, +{ "misc/ocxl.h", "OCXL_IOCTL_GET_METADATA", _IOC_READ, 0xca14, 0x80 }, +{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_ALLOC", _IOC_READ, 0xca11, 0x08 }, +{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_FREE", _IOC_WRITE, 0xca12, 0x08 }, +{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_SET_FD", _IOC_WRITE, 0xca13, 0x10 }, { "mtd/mtd-abi.h", "ECCGETLAYOUT", _IOC_READ, 0x4d11, 0x148 }, { "mtd/mtd-abi.h", "ECCGETSTATS", _IOC_READ, 0x4d12, 0x10 }, { "mtd/mtd-abi.h", "MEMERASE", _IOC_WRITE, 0x4d02, 0x08 }, @@ -2386,8 +2462,10 @@ { "mtd/ubi-user.h", "UBI_IOCMKVOL", _IOC_WRITE, 0x6f00, 0x98 }, { "mtd/ubi-user.h", "UBI_IOCRMVOL", _IOC_WRITE, 0x6f01, 0x04 }, { "mtd/ubi-user.h", "UBI_IOCRNVOL", _IOC_WRITE, 0x6f03, 0x1110 }, +{ "mtd/ubi-user.h", "UBI_IOCRPEB", _IOC_WRITE, 0x6f04, 0x04 }, { "mtd/ubi-user.h", "UBI_IOCRSVOL", _IOC_WRITE, 0x6f02, 0x0c }, { "mtd/ubi-user.h", "UBI_IOCSETVOLPROP", _IOC_WRITE, 0x4f06, 0x10 }, +{ "mtd/ubi-user.h", "UBI_IOCSPEB", _IOC_WRITE, 0x6f05, 0x04 }, { "mtd/ubi-user.h", "UBI_IOCVOLCRBLK", _IOC_WRITE, 0x4f07, 0x80 }, { "mtd/ubi-user.h", "UBI_IOCVOLRMBLK", _IOC_NONE, 0x4f08, 0x00 }, { "mtd/ubi-user.h", "UBI_IOCVOLUP", _IOC_WRITE, 0x4f00, 0x08 }, @@ -2418,23 +2496,24 @@ { "net/bluetooth/rfcomm.h", "RFCOMMRELEASEDEV", _IOC_WRITE, 0x52c9, 0x04 }, { "net/bluetooth/rfcomm.h", "RFCOMMSTEALDLC", _IOC_WRITE, 0x52dc, 0x04 }, { "net/nfc/nci_core.h", "NCIUARTSETDRIVER", _IOC_WRITE, 0x5500, 0x08 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_ACK_EVENT", _IOC_WRITE, 0x1bea, 0x08 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_ASSIGN_CTXT", _IOC_READ|_IOC_WRITE, 0x1be1, 0x1c }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CREDIT_UPD", _IOC_NONE, 0x1be6, 0x00 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CTXT_INFO", _IOC_WRITE, 0x1be2, 0x28 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CTXT_RESET", _IOC_NONE, 0x1bec, 0x00 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_GET_VERS", _IOC_READ, 0x1bee, 0x04 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_POLL_TYPE", _IOC_WRITE, 0x1be9, 0x04 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_RECV_CTRL", _IOC_WRITE, 0x1be8, 0x04 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_SET_PKEY", _IOC_WRITE, 0x1beb, 0x02 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_FREE", _IOC_READ|_IOC_WRITE, 0x1be5, 0x18 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_INVAL_READ", _IOC_READ|_IOC_WRITE, 0x1bed, 0x18 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_UPDATE", _IOC_READ|_IOC_WRITE, 0x1be4, 0x18 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_USER_INFO", _IOC_WRITE, 0x1be3, 0x78 }, -{ "rdma/ib_user_mad.h", "IB_USER_MAD_ENABLE_PKEY", _IOC_NONE, 0x1b03, 0x00 }, -{ "rdma/ib_user_mad.h", "IB_USER_MAD_REGISTER_AGENT", _IOC_READ|_IOC_WRITE, 0x1b01, 0x1c }, -{ "rdma/ib_user_mad.h", "IB_USER_MAD_REGISTER_AGENT2", _IOC_READ|_IOC_WRITE, 0x1b04, 0x28 }, -{ "rdma/ib_user_mad.h", "IB_USER_MAD_UNREGISTER_AGENT", _IOC_WRITE, 0x1b02, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_ACK_EVENT", _IOC_WRITE, 0x1bea, 0x08 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_ASSIGN_CTXT", _IOC_READ|_IOC_WRITE, 0x1be1, 0x1c }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CREDIT_UPD", _IOC_NONE, 0x1be6, 0x00 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CTXT_INFO", _IOC_WRITE, 0x1be2, 0x28 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CTXT_RESET", _IOC_NONE, 0x1bec, 0x00 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_GET_VERS", _IOC_READ, 0x1bee, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_POLL_TYPE", _IOC_WRITE, 0x1be9, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_RECV_CTRL", _IOC_WRITE, 0x1be8, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_SET_PKEY", _IOC_WRITE, 0x1beb, 0x02 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_FREE", _IOC_READ|_IOC_WRITE, 0x1be5, 0x18 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_INVAL_READ", _IOC_READ|_IOC_WRITE, 0x1bed, 0x18 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_UPDATE", _IOC_READ|_IOC_WRITE, 0x1be4, 0x18 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_USER_INFO", _IOC_WRITE, 0x1be3, 0x78 }, +{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_ENABLE_PKEY", _IOC_NONE, 0x1b03, 0x00 }, +{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_REGISTER_AGENT", _IOC_READ|_IOC_WRITE, 0x1b01, 0x1c }, +{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_REGISTER_AGENT2", _IOC_READ|_IOC_WRITE, 0x1b04, 0x28 }, +{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_UNREGISTER_AGENT", _IOC_WRITE, 0x1b02, 0x04 }, +{ "rdma/rdma_user_ioctl_cmds.h", "RDMA_VERBS_IOCTL", _IOC_READ|_IOC_WRITE, 0x1b01, 0x18 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_ATTACH", _IOC_READ|_IOC_WRITE, 0xca80, 0x90 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_DETACH", _IOC_READ|_IOC_WRITE, 0xca83, 0x60 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_MANAGE_LUN", _IOC_READ|_IOC_WRITE, 0xca86, 0x68 }, @@ -2445,6 +2524,8 @@ { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VERIFY", _IOC_READ|_IOC_WRITE, 0xca84, 0x90 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_CLONE", _IOC_READ|_IOC_WRITE, 0xca89, 0x70 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_RESIZE", _IOC_READ|_IOC_WRITE, 0xca88, 0x78 }, +{ "scsi/cxlflash_ioctl.h", "HT_CXLFLASH_AFU_DEBUG", _IOC_READ|_IOC_WRITE, 0xcabe, 0x78 }, +{ "scsi/cxlflash_ioctl.h", "HT_CXLFLASH_LUN_PROVISION", _IOC_READ|_IOC_WRITE, 0xcabf, 0xa0 }, { "scsi/scsi.h", "SCSI_IOCTL_GET_BUS_NUMBER", 0, 0x5386, 0 }, { "scsi/scsi.h", "SCSI_IOCTL_GET_IDLUN", 0, 0x5382, 0 }, { "scsi/scsi.h", "SCSI_IOCTL_GET_PCI", 0, 0x5387, 0 }, @@ -2563,6 +2644,7 @@ { "sound/asound.h", "SNDRV_PCM_IOCTL_TSTAMP", _IOC_WRITE, 0x4102, 0x04 }, { "sound/asound.h", "SNDRV_PCM_IOCTL_TTSTAMP", _IOC_WRITE, 0x4103, 0x04 }, { "sound/asound.h", "SNDRV_PCM_IOCTL_UNLINK", _IOC_NONE, 0x4161, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_USER_PVERSION", _IOC_WRITE, 0x4104, 0x04 }, { "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEI_FRAMES", _IOC_WRITE, 0x4150, 0x18 }, { "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEN_FRAMES", _IOC_WRITE, 0x4152, 0x18 }, { "sound/asound.h", "SNDRV_PCM_IOCTL_XRUN", _IOC_NONE, 0x4148, 0x00 }, @@ -2626,6 +2708,7 @@ { "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER", _IOC_NONE, 0x4882, 0x00 }, { "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_GET_INFO", _IOC_READ, 0x48f8, 0x20 }, { "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_LOCK", _IOC_NONE, 0x48f9, 0x00 }, +{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_TASCAM_STATE", _IOC_READ, 0x48fb, 0x100 }, { "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_UNLOCK", _IOC_NONE, 0x48fa, 0x00 }, { "sound/hda_hwdep.h", "HDA_IOCTL_GET_WCAP", _IOC_READ|_IOC_WRITE, 0x4812, 0x08 }, { "sound/hda_hwdep.h", "HDA_IOCTL_PVERSION", _IOC_READ, 0x4810, 0x04 }, @@ -2666,17 +2749,17 @@ { "staging/android/ashmem.h", "ASHMEM_SET_PROT_MASK", _IOC_WRITE, 0x7705, 0x08 }, { "staging/android/ashmem.h", "ASHMEM_SET_SIZE", _IOC_WRITE, 0x7703, 0x08 }, { "staging/android/ashmem.h", "ASHMEM_UNPIN", _IOC_WRITE, 0x7708, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_ALLOC", _IOC_READ|_IOC_WRITE, 0x4900, 0x20 }, -{ "staging/android/ion.h", "ION_IOC_CUSTOM", _IOC_READ|_IOC_WRITE, 0x4906, 0x10 }, -{ "staging/android/ion.h", "ION_IOC_FREE", _IOC_READ|_IOC_WRITE, 0x4901, 0x04 }, +{ "staging/android/ion.h", "ION_IOC_ALLOC", _IOC_READ|_IOC_WRITE, 0x4900, 0x18 }, { "staging/android/ion.h", "ION_IOC_HEAP_QUERY", _IOC_READ|_IOC_WRITE, 0x4908, 0x18 }, -{ "staging/android/ion.h", "ION_IOC_IMPORT", _IOC_READ|_IOC_WRITE, 0x4905, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_MAP", _IOC_READ|_IOC_WRITE, 0x4902, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_SHARE", _IOC_READ|_IOC_WRITE, 0x4904, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_SYNC", _IOC_READ|_IOC_WRITE, 0x4907, 0x08 }, -{ "staging/android/ion_test.h", "ION_IOC_TEST_DMA_MAPPING", _IOC_WRITE, 0x49f1, 0x20 }, -{ "staging/android/ion_test.h", "ION_IOC_TEST_KERNEL_MAPPING", _IOC_WRITE, 0x49f2, 0x20 }, -{ "staging/android/ion_test.h", "ION_IOC_TEST_SET_FD", _IOC_NONE, 0x49f0, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_COND_WAIT", _IOC_READ|_IOC_WRITE, 0xf507, 0x20 }, +{ "staging/android/vsoc_shm.h", "VSOC_COND_WAKE", _IOC_NONE, 0xf508, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_CREATE_FD_SCOPED_PERMISSION", _IOC_WRITE, 0xf500, 0x10 }, +{ "staging/android/vsoc_shm.h", "VSOC_DESCRIBE_REGION", _IOC_READ, 0xf504, 0x3c }, +{ "staging/android/vsoc_shm.h", "VSOC_GET_FD_SCOPED_PERMISSION", _IOC_READ, 0xf501, 0x10 }, +{ "staging/android/vsoc_shm.h", "VSOC_MAYBE_SEND_INTERRUPT_TO_HOST", _IOC_NONE, 0xf502, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_SELF_INTERRUPT", _IOC_NONE, 0xf505, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_SEND_INTERRUPT_TO_HOST", _IOC_NONE, 0xf506, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_WAIT_FOR_INCOMING_INTERRUPT", _IOC_NONE, 0xf503, 0x00 }, { "video/da8xx-fb.h", "FBIGET_BRIGHTNESS", _IOC_READ, 0x4603, 0x04 }, { "video/da8xx-fb.h", "FBIGET_COLOR", _IOC_READ, 0x4605, 0x04 }, { "video/da8xx-fb.h", "FBIOGET_CONTRAST", _IOC_READ, 0x4601, 0x04 }, @@ -2719,6 +2802,10 @@ { "xen/evtchn.h", "IOCTL_EVTCHN_RESET", _IOC_NONE, 0x4505, 0x00 }, { "xen/evtchn.h", "IOCTL_EVTCHN_RESTRICT_DOMID", _IOC_NONE, 0x4506, 0x02 }, { "xen/evtchn.h", "IOCTL_EVTCHN_UNBIND", _IOC_NONE, 0x4503, 0x04 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS", _IOC_NONE, 0x4709, 0x14 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_WAIT_RELEASED", _IOC_NONE, 0x470a, 0x08 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_RELEASE", _IOC_NONE, 0x470c, 0x08 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_TO_REFS", _IOC_NONE, 0x470b, 0x14 }, { "xen/gntdev.h", "IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR", _IOC_NONE, 0x4702, 0x18 }, { "xen/gntdev.h", "IOCTL_GNTDEV_GRANT_COPY", _IOC_NONE, 0x4708, 0x10 }, { "xen/gntdev.h", "IOCTL_GNTDEV_MAP_GRANT_REF", _IOC_NONE, 0x4700, 0x18 }, diff --git a/linux/64/syscallent.h b/linux/64/syscallent.h index 598d942c..294da690 100644 --- a/linux/64/syscallent.h +++ b/linux/64/syscallent.h @@ -1,8 +1,15 @@ +/* + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + [ 0] = { 2, TM, SEN(io_setup), "io_setup" }, [ 1] = { 1, TM, SEN(io_destroy), "io_destroy" }, [ 2] = { 3, 0, SEN(io_submit), "io_submit" }, [ 3] = { 3, 0, SEN(io_cancel), "io_cancel" }, -[ 4] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[ 4] = { 5, 0, SEN(io_getevents_time64), "io_getevents" }, [ 5] = { 5, TF, SEN(setxattr), "setxattr" }, [ 6] = { 5, TF, SEN(setxattr), "lsetxattr" }, [ 7] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, @@ -25,7 +32,7 @@ [ 24] = { 3, TD, SEN(dup3), "dup3" }, [ 25] = { 3, TD, SEN(fcntl), "fcntl" }, [ 26] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, -[ 27] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[ 27] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, [ 28] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, [ 29] = { 3, TD, SEN(ioctl), "ioctl" }, [ 30] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, @@ -41,8 +48,8 @@ [ 40] = { 5, TF, SEN(mount), "mount" }, [ 41] = { 2, TF, SEN(pivotroot), "pivot_root" }, [ 42] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, -[ 43] = { 2, TF, SEN(statfs), "statfs" }, -[ 44] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[ 43] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[ 44] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, [ 45] = { 2, TF, SEN(truncate), "truncate" }, [ 46] = { 2, TD, SEN(ftruncate), "ftruncate" }, [ 47] = { 4, TD, SEN(fallocate), "fallocate" }, @@ -70,23 +77,23 @@ [ 69] = { 4, TD, SEN(preadv), "preadv" }, [ 70] = { 4, TD, SEN(pwritev), "pwritev" }, [ 71] = { 4, TD|TN, SEN(sendfile64), "sendfile" }, -[ 72] = { 6, TD, SEN(pselect6), "pselect6" }, -[ 73] = { 5, TD, SEN(ppoll), "ppoll" }, +[ 72] = { 6, TD, SEN(pselect6_time64), "pselect6" }, +[ 73] = { 5, TD, SEN(ppoll_time64), "ppoll" }, [ 74] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, [ 75] = { 4, TD, SEN(vmsplice), "vmsplice" }, [ 76] = { 6, TD, SEN(splice), "splice" }, [ 77] = { 4, TD, SEN(tee), "tee" }, [ 78] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, -[ 79] = { 4, TD|TF, SEN(newfstatat), "newfstatat" }, -[ 80] = { 2, TD, SEN(fstat), "fstat" }, +[ 79] = { 4, TD|TF|TFST|TSTA,SEN(newfstatat), "newfstatat" }, +[ 80] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, [ 81] = { 0, 0, SEN(sync), "sync" }, [ 82] = { 1, TD, SEN(fsync), "fsync" }, [ 83] = { 1, TD, SEN(fdatasync), "fdatasync" }, [ 84] = { 4, TD, SEN(sync_file_range), "sync_file_range" }, [ 85] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, -[ 86] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, -[ 87] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, -[ 88] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[ 86] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime" }, +[ 87] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime" }, +[ 88] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" }, [ 89] = { 1, TF, SEN(acct), "acct" }, [ 90] = { 2, 0, SEN(capget), "capget" }, [ 91] = { 2, 0, SEN(capset), "capset" }, @@ -96,24 +103,24 @@ [ 95] = { 5, TP, SEN(waitid), "waitid" }, [ 96] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [ 97] = { 1, TP, SEN(unshare), "unshare" }, -[ 98] = { 6, 0, SEN(futex), "futex" }, +[ 98] = { 6, 0, SEN(futex_time64), "futex" }, [ 99] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, [100] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, -[101] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[101] = { 2, 0, SEN(nanosleep_time64), "nanosleep" }, [102] = { 2, 0, SEN(getitimer), "getitimer" }, [103] = { 3, 0, SEN(setitimer), "setitimer" }, [104] = { 4, 0, SEN(kexec_load), "kexec_load" }, [105] = { 3, 0, SEN(init_module), "init_module" }, [106] = { 2, 0, SEN(delete_module), "delete_module" }, [107] = { 3, 0, SEN(timer_create), "timer_create" }, -[108] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[108] = { 2, 0, SEN(timer_gettime64), "timer_gettime" }, [109] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, -[110] = { 4, 0, SEN(timer_settime), "timer_settime" }, +[110] = { 4, 0, SEN(timer_settime64), "timer_settime" }, [111] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[112] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[113] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[114] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[115] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[112] = { 2, 0, SEN(clock_settime64), "clock_settime" }, +[113] = { 2, 0, SEN(clock_gettime64), "clock_gettime" }, +[114] = { 2, 0, SEN(clock_getres_time64), "clock_getres" }, +[115] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep" }, [116] = { 3, 0, SEN(syslog), "syslog" }, [117] = { 4, 0, SEN(ptrace), "ptrace" }, [118] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, @@ -125,7 +132,7 @@ [124] = { 0, 0, SEN(sched_yield), "sched_yield" }, [125] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [126] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[127] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[127] = { 2, 0, SEN(sched_rr_get_interval_time64),"sched_rr_get_interval"}, [128] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, [129] = { 2, TS, SEN(kill), "kill" }, [130] = { 2, TS, SEN(kill), "tkill" }, @@ -135,9 +142,9 @@ [134] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, [135] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, [136] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[137] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[137] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait" }, [138] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, -[139] = { 0, TS, SEN(sigreturn), "rt_sigreturn" }, +[139] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, [140] = { 3, 0, SEN(setpriority), "setpriority" }, [141] = { 2, 0, SEN(getpriority), "getpriority" }, [142] = { 4, 0, SEN(reboot), "reboot" }, @@ -169,28 +176,28 @@ [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, NF, SEN(getpid), "getpid" }, -[173] = { 0, NF, SEN(getppid), "getppid" }, -[174] = { 0, NF, SEN(getuid), "getuid" }, -[175] = { 0, NF, SEN(geteuid), "geteuid" }, -[176] = { 0, NF, SEN(getgid), "getgid" }, -[177] = { 0, NF, SEN(getegid), "getegid" }, -[178] = { 0, NF, SEN(gettid), "gettid" }, +[171] = { 1, 0, SEN(adjtimex64), "adjtimex" }, +[172] = { 0, PU|NF, SEN(getpid), "getpid" }, +[173] = { 0, PU|NF, SEN(getppid), "getppid" }, +[174] = { 0, PU|NF, SEN(getuid), "getuid" }, +[175] = { 0, PU|NF, SEN(geteuid), "geteuid" }, +[176] = { 0, PU|NF, SEN(getgid), "getgid" }, +[177] = { 0, PU|NF, SEN(getegid), "getegid" }, +[178] = { 0, PU|NF, SEN(gettid), "gettid" }, [179] = { 1, 0, SEN(sysinfo), "sysinfo" }, -[180] = { 4, 0, SEN(mq_open), "mq_open" }, +[180] = { 4, TD, SEN(mq_open), "mq_open" }, [181] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[182] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[183] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[184] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[185] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[182] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend" }, +[183] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive" }, +[184] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[185] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, [186] = { 2, TI, SEN(msgget), "msgget" }, [187] = { 3, TI, SEN(msgctl), "msgctl" }, [188] = { 5, TI, SEN(msgrcv), "msgrcv" }, [189] = { 4, TI, SEN(msgsnd), "msgsnd" }, [190] = { 3, TI, SEN(semget), "semget" }, [191] = { 4, TI, SEN(semctl), "semctl" }, -[192] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[192] = { 4, TI, SEN(semtimedop_time64), "semtimedop" }, [193] = { 3, TI, SEN(semop), "semop" }, [194] = { 3, TI, SEN(shmget), "shmget" }, [195] = { 3, TI, SEN(shmctl), "shmctl" }, @@ -241,7 +248,7 @@ [240] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, [241] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, [242] = { 4, TN, SEN(accept4), "accept4" }, -[243] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[243] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg" }, /* [244 ... 259] are arch specific */ [260] = { 4, TP, SEN(wait4), "wait4" }, [261] = { 4, 0, SEN(prlimit64), "prlimit64" }, @@ -249,7 +256,7 @@ [263] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, [264] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, [265] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[266] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[266] = { 2, 0, SEN(clock_adjtime64), "clock_adjtime" }, [267] = { 1, TD, SEN(syncfs), "syncfs" }, [268] = { 2, TD, SEN(setns), "setns" }, [269] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, @@ -274,3 +281,12 @@ [288] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, [289] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, [290] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[291] = { 5, TD|TF|TSTA, SEN(statx), "statx" }, +[292] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents" }, +[293] = { 4, 0, SEN(rseq), "rseq" }, +[294] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" }, +/* [295 ... 423] - reserved to sync up with other architectures */ +[424] = { 4, TD|TS, SEN(pidfd_send_signal), "pidfd_send_signal" }, +[425] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" }, +[426] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" }, +[427] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" }, diff --git a/linux/aarch64/arch_defs_.h b/linux/aarch64/arch_defs_.h new file mode 100644 index 00000000..ed9261f5 --- /dev/null +++ b/linux/aarch64/arch_defs_.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define HAVE_ARCH_OLD_MMAP 1 +#define HAVE_ARCH_OLD_SELECT 1 +#define HAVE_ARCH_UID16_SYSCALLS 1 +#define SUPPORTED_PERSONALITIES 2 diff --git a/linux/aarch64/arch_get_personality.c b/linux/aarch64/arch_get_personality.c new file mode 100644 index 00000000..534d7f4f --- /dev/null +++ b/linux/aarch64/arch_get_personality.c @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef AUDIT_ARCH_ARM +# define AUDIT_ARCH_ARM 0x40000028 +#endif + +int +get_personality_from_syscall_info(const struct ptrace_syscall_info *sci) +{ + return sci->arch == AUDIT_ARCH_ARM; +} diff --git a/linux/aarch64/arch_regs.c b/linux/aarch64/arch_regs.c index 4ccb1f5b..f88067db 100644 --- a/linux/aarch64/arch_regs.c +++ b/linux/aarch64/arch_regs.c @@ -1,38 +1,49 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + struct arm_pt_regs { - uint32_t uregs[18]; + uint32_t uregs[18]; }; -#define ARM_cpsr uregs[16] -#define ARM_pc uregs[15] -#define ARM_lr uregs[14] -#define ARM_sp uregs[13] -#define ARM_ip uregs[12] -#define ARM_fp uregs[11] -#define ARM_r10 uregs[10] -#define ARM_r9 uregs[9] -#define ARM_r8 uregs[8] -#define ARM_r7 uregs[7] -#define ARM_r6 uregs[6] -#define ARM_r5 uregs[5] -#define ARM_r4 uregs[4] -#define ARM_r3 uregs[3] -#define ARM_r2 uregs[2] -#define ARM_r1 uregs[1] -#define ARM_r0 uregs[0] -#define ARM_ORIG_r0 uregs[17] +#define ARM_cpsr uregs[16] +#define ARM_pc uregs[15] +#define ARM_lr uregs[14] +#define ARM_sp uregs[13] +#define ARM_ip uregs[12] +#define ARM_fp uregs[11] +#define ARM_r10 uregs[10] +#define ARM_r9 uregs[9] +#define ARM_r8 uregs[8] +#define ARM_r7 uregs[7] +#define ARM_r6 uregs[6] +#define ARM_r5 uregs[5] +#define ARM_r4 uregs[4] +#define ARM_r3 uregs[3] +#define ARM_r2 uregs[2] +#define ARM_r1 uregs[1] +#define ARM_r0 uregs[0] +#define ARM_ORIG_r0 uregs[17] static union { struct user_pt_regs aarch64_r; struct arm_pt_regs arm_r; } arm_regs_union; -#define aarch64_regs arm_regs_union.aarch64_r -#define arm_regs arm_regs_union.arm_r +#define aarch64_regs arm_regs_union.aarch64_r +#define arm_regs arm_regs_union.arm_r -uint64_t *const aarch64_sp_ptr = (uint64_t *) &aarch64_regs.sp; -uint32_t *const arm_sp_ptr = &arm_regs.ARM_sp; static struct iovec aarch64_io = { .iov_base = &arm_regs_union }; #define ARCH_REGS_FOR_GETREGSET arm_regs_union #define ARCH_IOVEC_FOR_GETREGSET aarch64_io -#define ARCH_PC_REG ((aarch64_io.iov_len == sizeof(arm_regs)) ? arm_regs.ARM_pc : aarch64_regs.pc) +#define ARCH_PC_REG \ + ((aarch64_io.iov_len == sizeof(arm_regs)) ? arm_regs.ARM_pc : aarch64_regs.pc) +#define ARCH_SP_REG \ + ((aarch64_io.iov_len == sizeof(arm_regs)) ? arm_regs.ARM_sp : aarch64_regs.sp) + +#define ARCH_PERSONALITY_0_IOV_SIZE sizeof(aarch64_regs) +#define ARCH_PERSONALITY_1_IOV_SIZE sizeof(arm_regs) diff --git a/linux/aarch64/arch_regs.h b/linux/aarch64/arch_regs.h deleted file mode 100644 index 9a5e33e0..00000000 --- a/linux/aarch64/arch_regs.h +++ /dev/null @@ -1,2 +0,0 @@ -extern uint64_t *const aarch64_sp_ptr; -extern uint32_t *const arm_sp_ptr; diff --git a/linux/aarch64/errnoent1.h b/linux/aarch64/errnoent1.h deleted file mode 100644 index a0394d45..00000000 --- a/linux/aarch64/errnoent1.h +++ /dev/null @@ -1,2 +0,0 @@ -/* ARM personality */ -#include "errnoent.h" diff --git a/linux/aarch64/get_error.c b/linux/aarch64/get_error.c index a3aa1272..38856a97 100644 --- a/linux/aarch64/get_error.c +++ b/linux/aarch64/get_error.c @@ -1,9 +1,18 @@ -#define get_error arm_get_error +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "negated_errno.h" + +#define arch_get_error arm_get_error #include "arm/get_error.c" -#undef get_error +#undef arch_get_error static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { if (tcp->currpers == 1) { arm_get_error(tcp, check_errno); diff --git a/linux/aarch64/get_scno.c b/linux/aarch64/get_scno.c index 569aea09..af758aee 100644 --- a/linux/aarch64/get_scno.c +++ b/linux/aarch64/get_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) @@ -8,14 +15,11 @@ arch_get_scno(struct tcb *tcp) case sizeof(aarch64_regs): /* We are in 64-bit mode */ scno = aarch64_regs.regs[8]; - update_personality(tcp, 0); break; case sizeof(arm_regs): /* We are in 32-bit mode */ /* Note: we don't support OABI, unlike 32-bit ARM build */ scno = arm_regs.ARM_r7; - scno = shuffle_scno(scno); - update_personality(tcp, 1); break; } diff --git a/linux/aarch64/get_syscall_args.c b/linux/aarch64/get_syscall_args.c index ea6e497d..fce96273 100644 --- a/linux/aarch64/get_syscall_args.c +++ b/linux/aarch64/get_syscall_args.c @@ -1,10 +1,17 @@ -#define get_syscall_args arm_get_syscall_args +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define arch_get_syscall_args arm_get_syscall_args #include "arm/get_syscall_args.c" -#undef get_syscall_args +#undef arch_get_syscall_args /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { if (tcp->currpers == 1) return arm_get_syscall_args(tcp); diff --git a/linux/aarch64/ioctls_arch0.h b/linux/aarch64/ioctls_arch0.h index 6a674ccd..ef5f78c8 100644 --- a/linux/aarch64/ioctls_arch0.h +++ b/linux/aarch64/ioctls_arch0.h @@ -1 +1,73 @@ /* Generated by ioctls_gen.sh from definitions found in $linux/arch/arm64/include/ tree. */ +{ "linux/kvm.h", "KVM_ARM_PREFERRED_TARGET", _IOC_READ, 0xaeaf, 0x20 }, +{ "linux/kvm.h", "KVM_ARM_SET_DEVICE_ADDR", _IOC_WRITE, 0xaeab, 0x10 }, +{ "linux/kvm.h", "KVM_ARM_VCPU_INIT", _IOC_WRITE, 0xaeae, 0x20 }, +{ "linux/kvm.h", "KVM_ASSIGN_DEV_IRQ", _IOC_WRITE, 0xae70, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_PCI_DEVICE", _IOC_READ, 0xae69, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_INTX_MASK", _IOC_WRITE, 0xaea4, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_ENTRY", _IOC_WRITE, 0xae74, 0x10 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_NR", _IOC_WRITE, 0xae73, 0x08 }, +{ "linux/kvm.h", "KVM_CHECK_EXTENSION", _IOC_NONE, 0xae03, 0x00 }, +{ "linux/kvm.h", "KVM_CLEAR_DIRTY_LOG", _IOC_READ|_IOC_WRITE, 0xaec0, 0x18 }, +{ "linux/kvm.h", "KVM_CREATE_DEVICE", _IOC_READ|_IOC_WRITE, 0xaee0, 0x0c }, +{ "linux/kvm.h", "KVM_CREATE_IRQCHIP", _IOC_NONE, 0xae60, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_PIT", _IOC_NONE, 0xae64, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_PIT2", _IOC_WRITE, 0xae77, 0x40 }, +{ "linux/kvm.h", "KVM_CREATE_VCPU", _IOC_NONE, 0xae41, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_VM", _IOC_NONE, 0xae01, 0x00 }, +{ "linux/kvm.h", "KVM_DEASSIGN_DEV_IRQ", _IOC_WRITE, 0xae75, 0x40 }, +{ "linux/kvm.h", "KVM_DEASSIGN_PCI_DEVICE", _IOC_WRITE, 0xae72, 0x40 }, +{ "linux/kvm.h", "KVM_DIRTY_TLB", _IOC_WRITE, 0xaeaa, 0x10 }, +{ "linux/kvm.h", "KVM_ENABLE_CAP", _IOC_WRITE, 0xaea3, 0x68 }, +{ "linux/kvm.h", "KVM_GET_API_VERSION", _IOC_NONE, 0xae00, 0x00 }, +{ "linux/kvm.h", "KVM_GET_CLOCK", _IOC_READ, 0xae7c, 0x30 }, +{ "linux/kvm.h", "KVM_GET_DEVICE_ATTR", _IOC_WRITE, 0xaee2, 0x18 }, +{ "linux/kvm.h", "KVM_GET_DIRTY_LOG", _IOC_WRITE, 0xae42, 0x10 }, +{ "linux/kvm.h", "KVM_GET_FPU", _IOC_READ, 0xae8c, 0x00 }, +{ "linux/kvm.h", "KVM_GET_IRQCHIP", _IOC_READ|_IOC_WRITE, 0xae62, 0x208 }, +{ "linux/kvm.h", "KVM_GET_MP_STATE", _IOC_READ, 0xae98, 0x04 }, +{ "linux/kvm.h", "KVM_GET_NR_MMU_PAGES", _IOC_NONE, 0xae45, 0x00 }, +{ "linux/kvm.h", "KVM_GET_ONE_REG", _IOC_WRITE, 0xaeab, 0x10 }, +{ "linux/kvm.h", "KVM_GET_REGS", _IOC_READ, 0xae81, 0x360 }, +{ "linux/kvm.h", "KVM_GET_REG_LIST", _IOC_READ|_IOC_WRITE, 0xaeb0, 0x08 }, +{ "linux/kvm.h", "KVM_GET_SREGS", _IOC_READ, 0xae83, 0x00 }, +{ "linux/kvm.h", "KVM_GET_TSC_KHZ", _IOC_NONE, 0xaea3, 0x00 }, +{ "linux/kvm.h", "KVM_GET_VCPU_MMAP_SIZE", _IOC_NONE, 0xae04, 0x00 }, +{ "linux/kvm.h", "KVM_HAS_DEVICE_ATTR", _IOC_WRITE, 0xaee3, 0x18 }, +{ "linux/kvm.h", "KVM_INTERRUPT", _IOC_WRITE, 0xae86, 0x04 }, +{ "linux/kvm.h", "KVM_IOEVENTFD", _IOC_WRITE, 0xae79, 0x40 }, +{ "linux/kvm.h", "KVM_IRQFD", _IOC_WRITE, 0xae76, 0x20 }, +{ "linux/kvm.h", "KVM_IRQ_LINE", _IOC_WRITE, 0xae61, 0x08 }, +{ "linux/kvm.h", "KVM_IRQ_LINE_STATUS", _IOC_READ|_IOC_WRITE, 0xae67, 0x08 }, +{ "linux/kvm.h", "KVM_KVMCLOCK_CTRL", _IOC_NONE, 0xaead, 0x00 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_OP", _IOC_READ|_IOC_WRITE, 0xaeba, 0x08 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_REG_REGION", _IOC_READ, 0xaebb, 0x10 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_UNREG_REGION", _IOC_READ, 0xaebc, 0x10 }, +{ "linux/kvm.h", "KVM_NMI", _IOC_NONE, 0xae9a, 0x00 }, +{ "linux/kvm.h", "KVM_REGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae67, 0x10 }, +{ "linux/kvm.h", "KVM_REINJECT_CONTROL", _IOC_NONE, 0xae71, 0x00 }, +{ "linux/kvm.h", "KVM_RUN", _IOC_NONE, 0xae80, 0x00 }, +{ "linux/kvm.h", "KVM_SET_BOOT_CPU_ID", _IOC_NONE, 0xae78, 0x00 }, +{ "linux/kvm.h", "KVM_SET_CLOCK", _IOC_WRITE, 0xae7b, 0x30 }, +{ "linux/kvm.h", "KVM_SET_DEVICE_ATTR", _IOC_WRITE, 0xaee1, 0x18 }, +{ "linux/kvm.h", "KVM_SET_FPU", _IOC_WRITE, 0xae8d, 0x00 }, +{ "linux/kvm.h", "KVM_SET_GSI_ROUTING", _IOC_WRITE, 0xae6a, 0x08 }, +{ "linux/kvm.h", "KVM_SET_GUEST_DEBUG", _IOC_WRITE, 0xae9b, 0x208 }, +{ "linux/kvm.h", "KVM_SET_IDENTITY_MAP_ADDR", _IOC_WRITE, 0xae48, 0x08 }, +{ "linux/kvm.h", "KVM_SET_IRQCHIP", _IOC_READ, 0xae63, 0x208 }, +{ "linux/kvm.h", "KVM_SET_MEMORY_REGION", _IOC_WRITE, 0xae40, 0x18 }, +{ "linux/kvm.h", "KVM_SET_MP_STATE", _IOC_WRITE, 0xae99, 0x04 }, +{ "linux/kvm.h", "KVM_SET_NR_MMU_PAGES", _IOC_NONE, 0xae44, 0x00 }, +{ "linux/kvm.h", "KVM_SET_ONE_REG", _IOC_WRITE, 0xaeac, 0x10 }, +{ "linux/kvm.h", "KVM_SET_REGS", _IOC_WRITE, 0xae82, 0x360 }, +{ "linux/kvm.h", "KVM_SET_SIGNAL_MASK", _IOC_WRITE, 0xae8b, 0x04 }, +{ "linux/kvm.h", "KVM_SET_SREGS", _IOC_WRITE, 0xae84, 0x00 }, +{ "linux/kvm.h", "KVM_SET_TSC_KHZ", _IOC_NONE, 0xaea2, 0x00 }, +{ "linux/kvm.h", "KVM_SET_TSS_ADDR", _IOC_NONE, 0xae47, 0x00 }, +{ "linux/kvm.h", "KVM_SET_USER_MEMORY_REGION", _IOC_WRITE, 0xae46, 0x20 }, +{ "linux/kvm.h", "KVM_SET_VAPIC_ADDR", _IOC_WRITE, 0xae93, 0x08 }, +{ "linux/kvm.h", "KVM_SIGNAL_MSI", _IOC_WRITE, 0xaea5, 0x20 }, +{ "linux/kvm.h", "KVM_SMI", _IOC_NONE, 0xaeb7, 0x00 }, +{ "linux/kvm.h", "KVM_TPR_ACCESS_REPORTING", _IOC_READ|_IOC_WRITE, 0xae92, 0x28 }, +{ "linux/kvm.h", "KVM_TRANSLATE", _IOC_READ|_IOC_WRITE, 0xae85, 0x18 }, +{ "linux/kvm.h", "KVM_UNREGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae68, 0x10 }, diff --git a/linux/aarch64/nr_prefix.c b/linux/aarch64/nr_prefix.c new file mode 100644 index 00000000..49fe77ae --- /dev/null +++ b/linux/aarch64/nr_prefix.c @@ -0,0 +1 @@ +#include "../arm/nr_prefix.c" diff --git a/linux/aarch64/raw_syscall.h b/linux/aarch64/raw_syscall.h new file mode 100644 index 00000000..aa27e1d5 --- /dev/null +++ b/linux/aarch64/raw_syscall.h @@ -0,0 +1,29 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + *err = 0; + register kernel_ulong_t x8 __asm__("x8") = nr; + register kernel_ulong_t x0 __asm__("x0"); + __asm__ __volatile__("svc 0" + : "=r"(x0) + : "r"(x8) + : "memory"); + return x0; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/aarch64/set_error.c b/linux/aarch64/set_error.c index 03686092..bb04450d 100644 --- a/linux/aarch64/set_error.c +++ b/linux/aarch64/set_error.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #define arch_set_error arm_set_error #define arch_set_success arm_set_success #include "arm/set_error.c" diff --git a/linux/aarch64/set_scno.c b/linux/aarch64/set_scno.c index fe44672b..e2b5d8a2 100644 --- a/linux/aarch64/set_scno.c +++ b/linux/aarch64/set_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #ifndef NT_ARM_SYSTEM_CALL # define NT_ARM_SYSTEM_CALL 0x404 #endif diff --git a/linux/aarch64/shuffle_scno.c b/linux/aarch64/shuffle_scno.c new file mode 100644 index 00000000..a4c0d3be --- /dev/null +++ b/linux/aarch64/shuffle_scno.c @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define shuffle_scno arm_shuffle_scno +#include "../arm/shuffle_scno.c" +#undef shuffle_scno + +kernel_ulong_t +shuffle_scno(kernel_ulong_t scno) +{ + if (current_personality == 1) + return arm_shuffle_scno(scno); + + return scno; +} diff --git a/linux/aarch64/signalent1.h b/linux/aarch64/signalent1.h deleted file mode 100644 index 093cba7f..00000000 --- a/linux/aarch64/signalent1.h +++ /dev/null @@ -1 +0,0 @@ -#include "signalent.h" diff --git a/linux/aarch64/syscallent.h b/linux/aarch64/syscallent.h index 6b23f8c2..c4bb9f67 100644 --- a/linux/aarch64/syscallent.h +++ b/linux/aarch64/syscallent.h @@ -1,7 +1,16 @@ +/* + * Copyright (c) 2012-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "64/syscallent.h" -/* Arch-specific block, not used on AArch64 */ -[244 ... 259] = { }, +/* + * Arch-specific block, not used on AArch64. + * [244 ... 259] = { }, + */ /* Quote from asm-generic/unistd.h: * @@ -27,8 +36,8 @@ [1035] = { 3, TF, SEN(readlink), "readlink" }, [1036] = { 2, TF, SEN(symlink), "symlink" }, [1037] = { 2, TF, SEN(utimes), "utimes" }, -[1038] = { 2, TF, SEN(stat), "stat" }, -[1039] = { 2, TF, SEN(lstat), "lstat" }, +[1038] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, +[1039] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, [1040] = { 1, TD, SEN(pipe), "pipe" }, [1041] = { 2, TD, SEN(dup2), "dup2" }, [1042] = { 1, TD, SEN(epoll_create), "epoll_create" }, @@ -38,18 +47,18 @@ [1046] = { 4, TD|TN, SEN(sendfile64), "sendfile" }, [1047] = { 2, TD, SEN(ftruncate), "ftruncate" }, [1048] = { 2, TF, SEN(truncate), "truncate" }, -[1049] = { 2, TF, SEN(stat), "stat" }, -[1050] = { 2, TF, SEN(lstat), "lstat" }, -[1051] = { 2, TD, SEN(fstat), "fstat" }, +[1049] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, +[1050] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, +[1051] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, [1052] = { 3, TD, SEN(fcntl), "fcntl" }, [1053] = { 4, TD, SEN(fadvise64), "fadvise64" }, -[1054] = { 4, TD|TF, SEN(newfstatat), "newfstatat" }, -[1055] = { 2, TD, SEN(fstatfs), "fstatfs" }, -[1056] = { 2, TF, SEN(statfs), "statfs" }, +[1054] = { 4, TD|TF|TFST|TSTA,SEN(newfstatat), "newfstatat" }, +[1055] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, +[1056] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, [1057] = { 3, TD, SEN(lseek), "lseek" }, [1058] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, [1059] = { 1, 0, SEN(alarm), "alarm" }, -[1060] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[1060] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, [1061] = { 0, TS, SEN(pause), "pause" }, [1062] = { 1, 0, SEN(time), "time" }, [1063] = { 2, TF, SEN(utime), "utime" }, @@ -57,9 +66,9 @@ [1065] = { 3, TD, SEN(getdents), "getdents" }, [1066] = { 3, TD|TF, SEN(futimesat), "futimesat" }, [1067] = { 5, TD, SEN(select), "select" }, -[1068] = { 3, TD, SEN(poll), "poll" }, +[1068] = { 3, TD, SEN(poll_time64), "poll" }, [1069] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, -[1070] = { 2, 0, SEN(ustat), "ustat" }, +[1070] = { 2, TSFA, SEN(ustat), "ustat" }, [1071] = { 0, TP, SEN(vfork), "vfork" }, [1072] = { 4, TP, SEN(wait4), "wait4" }, [1073] = { 4, TN, SEN(recv), "recv" }, diff --git a/linux/alpha/arch_defs_.h b/linux/alpha/arch_defs_.h new file mode 100644 index 00000000..78227c79 --- /dev/null +++ b/linux/alpha/arch_defs_.h @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define HAVE_ARCH_GETRVAL2 1 +#define HAVE_ARCH_DEDICATED_ERR_REG 1 +#define HAVE_ARCH_TIME32_SYSCALLS 1 diff --git a/linux/alpha/arch_getrval2.c b/linux/alpha/arch_getrval2.c index f78a9f0f..6232f6fc 100644 --- a/linux/alpha/arch_getrval2.c +++ b/linux/alpha/arch_getrval2.c @@ -1,8 +1,15 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + long getrval2(struct tcb *tcp) { unsigned long r20; - if (upeek(tcp->pid, 20, &r20) < 0) + if (upeek(tcp, 20, &r20) < 0) return -1; return r20; } diff --git a/linux/alpha/arch_regs.c b/linux/alpha/arch_regs.c index 4d397996..ac6c35f2 100644 --- a/linux/alpha/arch_regs.c +++ b/linux/alpha/arch_regs.c @@ -1,3 +1,18 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static unsigned long alpha_r0; static unsigned long alpha_a3; + +#define REG_R0 0 +#define REG_A0 16 +#define REG_A3 19 +#define REG_SP 30 +#define REG_PC 64 + #define ARCH_PC_PEEK_ADDR REG_PC +#define ARCH_SP_PEEK_ADDR REG_SP diff --git a/linux/alpha/arch_regs.h b/linux/alpha/arch_regs.h deleted file mode 100644 index 66277fd8..00000000 --- a/linux/alpha/arch_regs.h +++ /dev/null @@ -1,5 +0,0 @@ -#define REG_R0 0 -#define REG_A0 16 -#define REG_A3 19 -#define REG_FP 30 -#define REG_PC 64 diff --git a/linux/alpha/arch_sigreturn.c b/linux/alpha/arch_sigreturn.c index 3317a954..57dc7c41 100644 --- a/linux/alpha/arch_sigreturn.c +++ b/linux/alpha/arch_sigreturn.c @@ -1,13 +1,20 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static void arch_sigreturn(struct tcb *tcp) { unsigned long addr; - if (upeek(tcp->pid, REG_FP, &addr) < 0) + if (!get_stack_pointer(tcp, &addr)) return; addr += offsetof(struct sigcontext, sc_mask); tprints("{mask="); - print_sigset_addr_len(tcp, addr, NSIG_BYTES); + print_sigset_addr(tcp, addr); tprints("}"); } diff --git a/linux/alpha/errnoent.h b/linux/alpha/errnoent.h index b9157cfe..4f3ec926 100644 --- a/linux/alpha/errnoent.h +++ b/linux/alpha/errnoent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 1999-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + [ 1] = "EPERM", [ 2] = "ENOENT", [ 3] = "ESRCH", @@ -146,3 +153,4 @@ [527] = "EBADTYPE", [528] = "EJUKEBOX", [529] = "EIOCBQUEUED", +[530] = "ERECALLCONFLICT", diff --git a/linux/alpha/get_error.c b/linux/alpha/get_error.c index d4928d4b..3c8e8ebf 100644 --- a/linux/alpha/get_error.c +++ b/linux/alpha/get_error.c @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { if (alpha_a3) { tcp->u_rval = -1; diff --git a/linux/alpha/get_scno.c b/linux/alpha/get_scno.c index 3ffd78a6..2d5c6d6a 100644 --- a/linux/alpha/get_scno.c +++ b/linux/alpha/get_scno.c @@ -1,12 +1,19 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) { kernel_ulong_t scno = 0; - if (upeek(tcp->pid, REG_A3, &alpha_a3) < 0) + if (upeek(tcp, REG_A3, &alpha_a3) < 0) return -1; - if (upeek(tcp->pid, REG_R0, &scno) < 0) + if (upeek(tcp, REG_R0, &scno) < 0) return -1; /* diff --git a/linux/alpha/get_syscall_args.c b/linux/alpha/get_syscall_args.c index a3857263..83f4d454 100644 --- a/linux/alpha/get_syscall_args.c +++ b/linux/alpha/get_syscall_args.c @@ -1,11 +1,18 @@ +/* + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { unsigned int i; - for (i = 0; i < tcp->s_ent->nargs; ++i) - if (upeek(tcp->pid, REG_A0+i, &tcp->u_arg[i]) < 0) + for (i = 0; i < n_args(tcp); ++i) + if (upeek(tcp, REG_A0+i, &tcp->u_arg[i]) < 0) return -1; return 1; } diff --git a/linux/alpha/get_syscall_result.c b/linux/alpha/get_syscall_result.c index f4c504f1..85fef4f9 100644 --- a/linux/alpha/get_syscall_result.c +++ b/linux/alpha/get_syscall_result.c @@ -1,6 +1,13 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int get_syscall_result_regs(struct tcb *tcp) { - return (upeek(tcp->pid, REG_A3, &alpha_a3) < 0 || - upeek(tcp->pid, REG_R0, &alpha_r0) < 0) ? -1 : 0; + return (upeek(tcp, REG_A3, &alpha_a3) < 0 || + upeek(tcp, REG_R0, &alpha_r0) < 0) ? -1 : 0; } diff --git a/linux/alpha/raw_syscall.h b/linux/alpha/raw_syscall.h new file mode 100644 index 00000000..f44dd27f --- /dev/null +++ b/linux/alpha/raw_syscall.h @@ -0,0 +1,31 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + kernel_ulong_t sc_0 = nr; + register kernel_ulong_t sc_19 __asm__("$19"); + __asm__ __volatile__("callsys" + : "+v"(sc_0), "=r"(sc_19) + : + : "memory", "$1", "$2", "$3", "$4", "$5", "$6", + "$7", "$8", "$16", "$17", "$18", "$20", "$21", + "$22", "$23", "$24", "$25", "$27", "$28"); + *err = sc_19; + return sc_0; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/alpha/set_error.c b/linux/alpha/set_error.c index bcc5ff86..2136e994 100644 --- a/linux/alpha/set_error.c +++ b/linux/alpha/set_error.c @@ -1,13 +1,20 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_error(struct tcb *tcp) { - alpha_r0 = tcp->u_error; - return upoke(tcp->pid, REG_R0, alpha_r0); + return upoke(tcp, REG_A3, (alpha_a3 = 1)) + || upoke(tcp, REG_R0, (alpha_r0 = tcp->u_error)); } static int arch_set_success(struct tcb *tcp) { - return upoke(tcp->pid, REG_A3, (alpha_a3 = 0)) - || upoke(tcp->pid, REG_R0, (alpha_r0 = tcp->u_rval)); + return upoke(tcp, REG_A3, (alpha_a3 = 0)) + || upoke(tcp, REG_R0, (alpha_r0 = tcp->u_rval)); } diff --git a/linux/alpha/set_scno.c b/linux/alpha/set_scno.c index d5bcfb6d..09059a38 100644 --- a/linux/alpha/set_scno.c +++ b/linux/alpha/set_scno.c @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { - return upoke(tcp->pid, REG_R0, scno); + return upoke(tcp, REG_R0, scno); } diff --git a/linux/alpha/signalent.h b/linux/alpha/signalent.h index 174b17b8..f086a42a 100644 --- a/linux/alpha/signalent.h +++ b/linux/alpha/signalent.h @@ -1,4 +1,11 @@ - "SIG_0", /* 0 */ +/* + * Copyright (c) 1999-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + + "0", /* 0 */ "SIGHUP", /* 1 */ "SIGINT", /* 2 */ "SIGQUIT", /* 3 */ diff --git a/linux/alpha/syscallent.h b/linux/alpha/syscallent.h index b55f23ad..d569fa67 100644 --- a/linux/alpha/syscallent.h +++ b/linux/alpha/syscallent.h @@ -1,126 +1,107 @@ /* * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995 Rick Sladkey + * Copyright (c) 1995-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ -[ 0] = { 6, 0, SEN(printargs), "osf_syscall" }, /*not implemented */ +[ 0] = { 6, 0, SEN(printargs), "osf_syscall" }, /* not implemented */ [ 1] = { 1, TP|SE, SEN(exit), "exit" }, [ 2] = { 0, TP, SEN(fork), "fork" }, [ 3] = { 3, TD, SEN(read), "read" }, [ 4] = { 3, TD, SEN(write), "write" }, -[ 5] = { 5, 0, SEN(printargs), "osf_old_open" }, /*not implemented */ +[ 5] = { 5, 0, SEN(printargs), "osf_old_open" }, /* not implemented */ [ 6] = { 1, TD, SEN(close), "close" }, [ 7] = { 4, TP, SEN(osf_wait4), "osf_wait4" }, -[ 8] = { 5, 0, SEN(printargs), "osf_old_creat" }, /*not implemented */ +[ 8] = { 5, 0, SEN(printargs), "osf_old_creat" }, /* not implemented */ [ 9] = { 2, TF, SEN(link), "link" }, [ 10] = { 1, TF, SEN(unlink), "unlink" }, -[ 11] = { 5, 0, SEN(printargs), "osf_execve" }, /*not implemented */ +[ 11] = { 5, 0, SEN(printargs), "osf_execve" }, /* not implemented */ [ 12] = { 1, TF, SEN(chdir), "chdir" }, [ 13] = { 1, TD, SEN(fchdir), "fchdir" }, [ 14] = { 3, TF, SEN(mknod), "mknod" }, [ 15] = { 2, TF, SEN(chmod), "chmod" }, [ 16] = { 3, TF, SEN(chown), "chown" }, [ 17] = { 1, TM|SI, SEN(brk), "brk" }, -[ 18] = { 5, 0, SEN(printargs), "osf_getfsstat" }, /*not implemented */ +[ 18] = { 5, TSFA, SEN(printargs), "osf_getfsstat" }, /* not implemented */ [ 19] = { 3, TD, SEN(lseek), "lseek" }, -[ 20] = { 0, NF, SEN(getxpid), "getxpid" }, +[ 20] = { 0, PU|NF, SEN(getxpid), "getxpid" }, [ 21] = { 4, 0, SEN(printargs), "osf_mount" }, [ 22] = { 2, TF, SEN(umount2), "umount" }, [ 23] = { 1, 0, SEN(setuid), "setuid" }, -[ 24] = { 0, NF, SEN(getxuid), "getxuid" }, -[ 25] = { 5, 0, SEN(printargs), "exec_with_loader" }, /*not implemented */ +[ 24] = { 0, PU|NF, SEN(getxuid), "getxuid" }, +[ 25] = { 5, 0, SEN(printargs), "exec_with_loader" }, /* not implemented */ [ 26] = { 4, 0, SEN(ptrace), "ptrace" }, -[ 27] = { 5, 0, SEN(printargs), "osf_nrecvmsg" }, /*not implemented */ -[ 28] = { 5, 0, SEN(printargs), "osf_nsendmsg" }, /*not implemented */ -[ 29] = { 5, 0, SEN(printargs), "osf_nrecvfrom" }, /*not implemented */ -[ 30] = { 5, 0, SEN(printargs), "osf_naccept" }, /*not implemented */ -[ 31] = { 5, 0, SEN(printargs), "osf_ngetpeername" }, /*not implemented */ -[ 32] = { 5, 0, SEN(printargs), "osf_ngetsockname" }, /*not implemented */ +[ 27] = { 5, 0, SEN(printargs), "osf_nrecvmsg" }, /* not implemented */ +[ 28] = { 5, 0, SEN(printargs), "osf_nsendmsg" }, /* not implemented */ +[ 29] = { 5, 0, SEN(printargs), "osf_nrecvfrom" }, /* not implemented */ +[ 30] = { 5, 0, SEN(printargs), "osf_naccept" }, /* not implemented */ +[ 31] = { 5, 0, SEN(printargs), "osf_ngetpeername" }, /* not implemented */ +[ 32] = { 5, 0, SEN(printargs), "osf_ngetsockname" }, /* not implemented */ [ 33] = { 2, TF, SEN(access), "access" }, -[ 34] = { 5, 0, SEN(printargs), "osf_chflags" }, /*not implemented */ -[ 35] = { 5, 0, SEN(printargs), "osf_fchflags" }, /*not implemented */ +[ 34] = { 5, 0, SEN(printargs), "osf_chflags" }, /* not implemented */ +[ 35] = { 5, 0, SEN(printargs), "osf_fchflags" }, /* not implemented */ [ 36] = { 0, 0, SEN(sync), "sync" }, [ 37] = { 2, TS, SEN(kill), "kill" }, -[ 38] = { 5, 0, SEN(printargs), "osf_old_stat" }, /*not implemented */ +[ 38] = { 5, TF|TST|TSTA, SEN(printargs), "osf_old_stat" }, /* not implemented */ [ 39] = { 2, 0, SEN(setpgid), "setpgid" }, -[ 40] = { 5, 0, SEN(printargs), "osf_old_lstat" }, /*not implemented */ +[ 40] = { 5, TF|TLST|TSTA, SEN(printargs), "osf_old_lstat" }, /* not implemented */ [ 41] = { 1, TD, SEN(dup), "dup" }, [ 42] = { 0, TD, SEN(pipe), "pipe" }, [ 43] = { 4, 0, SEN(printargs), "osf_set_program_attributes" }, -[ 44] = { 5, 0, SEN(printargs), "osf_profil" }, /*not implemented */ +[ 44] = { 5, 0, SEN(printargs), "osf_profil" }, /* not implemented */ [ 45] = { 3, TD|TF, SEN(open), "open" }, -[ 46] = { 5, 0, SEN(printargs), "osf_old_sigaction" }, /*not implemented */ -[ 47] = { 1, NF, SEN(getxgid), "getxgid" }, -[ 48] = { 2, TS, SEN(sigprocmask), "osf_sigprocmask" }, -[ 49] = { 5, 0, SEN(printargs), "osf_getlogin" }, /*not implemented */ -[ 50] = { 5, 0, SEN(printargs), "osf_setlogin" }, /*not implemented */ +[ 46] = { 5, 0, SEN(printargs), "osf_old_sigaction" }, /* not implemented */ +[ 47] = { 0, PU|NF, SEN(getxgid), "getxgid" }, +[ 48] = { 2, TS, SEN(osf_sigprocmask), "osf_sigprocmask" }, +[ 49] = { 5, 0, SEN(printargs), "osf_getlogin" }, /* not implemented */ +[ 50] = { 5, 0, SEN(printargs), "osf_setlogin" }, /* not implemented */ [ 51] = { 1, TF, SEN(acct), "acct" }, [ 52] = { 1, TS, SEN(sigpending), "sigpending" }, [ 53] = { }, [ 54] = { 3, TD, SEN(ioctl), "ioctl" }, -[ 55] = { 5, 0, SEN(printargs), "osf_reboot" }, /*not implemented */ -[ 56] = { 5, 0, SEN(printargs), "osf_revoke" }, /*not implemented */ +[ 55] = { 5, 0, SEN(printargs), "osf_reboot" }, /* not implemented */ +[ 56] = { 5, 0, SEN(printargs), "osf_revoke" }, /* not implemented */ [ 57] = { 2, TF, SEN(symlink), "symlink" }, [ 58] = { 3, TF, SEN(readlink), "readlink" }, [ 59] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, [ 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" }, -[ 64] = { 0, 0, SEN(getpagesize), "getpagesize" }, -[ 65] = { 5, TM, SEN(printargs), "osf_mremap" }, /*not implemented */ +[ 62] = { 5, TD|TFST|TSTA, SEN(printargs), "osf_old_fstat" }, /* not implemented */ +[ 63] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, +[ 64] = { 0, PU|NF, SEN(getpagesize), "getpagesize" }, +[ 65] = { 5, TM, SEN(printargs), "osf_mremap" }, /* not implemented */ [ 66] = { 0, TP, SEN(vfork), "vfork" }, -[ 67] = { 2, TF, SEN(stat), "stat" }, -[ 68] = { 2, TF, SEN(lstat), "lstat" }, -[ 69] = { 5, TM, SEN(printargs), "osf_sbrk" }, /*not implemented */ -[ 70] = { 5, 0, SEN(printargs), "osf_sstk" }, /*not implemented */ +[ 67] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, +[ 68] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, +[ 69] = { 5, TM, SEN(printargs), "osf_sbrk" }, /* not implemented */ +[ 70] = { 5, 0, SEN(printargs), "osf_sstk" }, /* not implemented */ [ 71] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, -[ 72] = { 5, 0, SEN(printargs), "osf_old_vadvise" }, /*not implemented */ +[ 72] = { 5, 0, SEN(printargs), "osf_old_vadvise" }, /* not implemented */ [ 73] = { 2, TM|SI, SEN(munmap), "munmap" }, [ 74] = { 3, TM|SI, SEN(mprotect), "mprotect" }, [ 75] = { 3, TM, SEN(madvise), "madvise" }, [ 76] = { 0, 0, SEN(vhangup), "vhangup" }, -[ 77] = { 5, 0, SEN(printargs), "osf_kmodcall" }, /*not implemented */ -[ 78] = { 5, TM, SEN(printargs), "osf_mincore" }, /*not implemented */ +[ 77] = { 5, 0, SEN(printargs), "osf_kmodcall" }, /* not implemented */ +[ 78] = { 5, TM, SEN(printargs), "osf_mincore" }, /* not implemented */ [ 79] = { 2, 0, SEN(getgroups), "getgroups" }, [ 80] = { 2, 0, SEN(setgroups), "setgroups" }, -[ 81] = { 5, 0, SEN(printargs), "osf_old_getpgrp" }, /*not implemented */ +[ 81] = { 5, 0, SEN(printargs), "osf_old_getpgrp" }, /* not implemented */ [ 82] = { 2, 0, SEN(setpgrp), "setpgrp" }, [ 83] = { 3, 0, SEN(osf_setitimer), "osf_setitimer" }, -[ 84] = { 5, 0, SEN(printargs), "osf_old_wait" }, /*not implemented */ -[ 85] = { 5, 0, SEN(printargs), "osf_table" }, /*not implemented */ +[ 84] = { 5, 0, SEN(printargs), "osf_old_wait" }, /* not implemented */ +[ 85] = { 5, 0, SEN(printargs), "osf_table" }, /* not implemented */ [ 86] = { 2, 0, SEN(osf_getitimer), "osf_getitimer" }, [ 87] = { 2, 0, SEN(gethostname), "gethostname" }, [ 88] = { 2, 0, SEN(sethostname), "sethostname" }, -[ 89] = { 0, 0, SEN(getdtablesize), "getdtablesize" }, +[ 89] = { 0, PU|NF, SEN(getdtablesize), "getdtablesize" }, [ 90] = { 2, TD, SEN(dup2), "dup2" }, -[ 91] = { 2, TD, SEN(fstat), "fstat" }, +[ 91] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, [ 92] = { 3, TD, SEN(fcntl), "fcntl" }, -[ 93] = { 5, 0, SEN(osf_select), "osf_select" }, -[ 94] = { 3, TD, SEN(poll), "poll" }, +[ 93] = { 5, TD, SEN(osf_select), "osf_select" }, +[ 94] = { 3, TD, SEN(poll_time64), "poll" }, [ 95] = { 1, TD, SEN(fsync), "fsync" }, [ 96] = { 3, 0, SEN(setpriority), "setpriority" }, [ 97] = { 3, TN, SEN(socket), "socket" }, @@ -133,15 +114,15 @@ [104] = { 3, TN, SEN(bind), "bind" }, [105] = { 5, TN, SEN(setsockopt), "setsockopt" }, [106] = { 2, TN, SEN(listen), "listen" }, -[107] = { 5, 0, SEN(printargs), "osf_plock" }, /*not implemented */ -[108] = { 5, 0, SEN(printargs), "osf_old_sigvec" }, /*not implemented */ -[109] = { 5, 0, SEN(printargs), "osf_old_sigblock" }, /*not implemented */ -[110] = { 5, 0, SEN(printargs), "osf_old_sigsetmask" }, /*not implemented */ -[111] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, +[107] = { 5, 0, SEN(printargs), "osf_plock" }, /* not implemented */ +[108] = { 5, 0, SEN(printargs), "osf_old_sigvec" }, /* not implemented */ +[109] = { 5, 0, SEN(printargs), "osf_old_sigblock" }, /* not implemented */ +[110] = { 5, 0, SEN(printargs), "osf_old_sigsetmask" }, /* not implemented */ +[111] = { 1, TS, SEN(sigsuspend), "sigsuspend" }, [112] = { 2, 0, SEN(printargs), "osf_sigstack" }, [113] = { 3, TN, SEN(recvmsg), "recvmsg" }, [114] = { 3, TN, SEN(sendmsg), "sendmsg" }, -[115] = { 5, 0, SEN(printargs), "osf_old_vtrace" }, /*not implemented */ +[115] = { 5, 0, SEN(printargs), "osf_old_vtrace" }, /* not implemented */ [116] = { 2, 0, SEN(osf_gettimeofday), "osf_gettimeofday" }, [117] = { 2, 0, SEN(osf_getrusage), "osf_getrusage" }, [118] = { 5, TN, SEN(getsockopt), "getsockopt" }, @@ -164,43 +145,43 @@ [135] = { 4, TN, SEN(socketpair), "socketpair" }, [136] = { 2, TF, SEN(mkdir), "mkdir" }, [137] = { 1, TF, SEN(rmdir), "rmdir" }, -[138] = { 2, 0, SEN(osf_utimes), "osf_utimes" }, -[139] = { 5, 0, SEN(printargs), "osf_old_sigreturn" }, -[140] = { 5, 0, SEN(printargs), "osf_adjtime" }, /*not implemented */ +[138] = { 2, TF, SEN(osf_utimes), "osf_utimes" }, +[139] = { 5, 0, SEN(printargs), "osf_old_sigreturn" }, /* not implemented */ +[140] = { 5, 0, SEN(printargs), "osf_adjtime" }, /* not implemented */ [141] = { 3, TN, SEN(getpeername), "getpeername" }, -[142] = { 5, 0, SEN(printargs), "osf_gethostid" }, /*not implemented */ -[143] = { 5, 0, SEN(printargs), "osf_sethostid" }, /*not implemented */ +[142] = { 5, 0, SEN(printargs), "osf_gethostid" }, /* not implemented */ +[143] = { 5, 0, SEN(printargs), "osf_sethostid" }, /* not implemented */ [144] = { 2, 0, SEN(getrlimit), "getrlimit" }, [145] = { 2, 0, SEN(setrlimit), "setrlimit" }, -[146] = { 5, 0, SEN(printargs), "osf_old_killpg" }, /*not implemented */ +[146] = { 5, 0, SEN(printargs), "osf_old_killpg" }, /* not implemented */ [147] = { 0, 0, SEN(setsid), "setsid" }, [148] = { 4, TF, SEN(quotactl), "quotactl" }, -[149] = { 5, 0, SEN(printargs), "osf_oldquota" }, /*not implemented */ +[149] = { 5, 0, SEN(printargs), "osf_oldquota" }, /* not implemented */ [150] = { 3, TN, SEN(getsockname), "getsockname" }, [151 ... 152] = { }, -[153] = { 5, 0, SEN(printargs), "osf_pid_block" }, /*not implemented */ -[154] = { 5, 0, SEN(printargs), "osf_pid_unblock" }, /*not implemented */ +[153] = { 5, 0, SEN(printargs), "osf_pid_block" }, /* not implemented */ +[154] = { 5, 0, SEN(printargs), "osf_pid_unblock" }, /* not implemented */ [155] = { }, [156] = { 3, TS, SEN(sigaction), "sigaction" }, -[157] = { 5, 0, SEN(printargs), "osf_sigwaitprim" }, /*not implemented */ -[158] = { 5, 0, SEN(printargs), "osf_nfssvc" }, /*not implemented */ +[157] = { 5, 0, SEN(printargs), "osf_sigwaitprim" }, /* not implemented */ +[158] = { 5, 0, SEN(printargs), "osf_nfssvc" }, /* not implemented */ [159] = { 4, 0, SEN(printargs), "osf_getdirentries" }, -[160] = { 3, 0, SEN(osf_statfs), "osf_statfs" }, -[161] = { 3, 0, SEN(osf_fstatfs), "osf_fstatfs" }, +[160] = { 3, TF|TSF|TSFA, SEN(osf_statfs), "osf_statfs" }, +[161] = { 3, TD|TFSF|TSFA, SEN(osf_fstatfs), "osf_fstatfs" }, [162] = { }, -[163] = { 5, 0, SEN(printargs), "osf_asynch_daemon" }, /*not implemented */ -[164] = { 5, 0, SEN(printargs), "osf_getfh" }, /*not implemented */ +[163] = { 5, 0, SEN(printargs), "osf_asynch_daemon" }, /* not implemented */ +[164] = { 5, 0, SEN(printargs), "osf_getfh" }, /* not implemented */ [165] = { 2, 0, SEN(printargs), "osf_getdomainname" }, [166] = { 2, 0, SEN(setdomainname), "setdomainname" }, [167 ... 168] = { }, -[169] = { 5, 0, SEN(printargs), "osf_exportfs" }, /*not implemented */ +[169] = { 5, 0, SEN(printargs), "osf_exportfs" }, /* not implemented */ [170 ... 180] = { }, -[181] = { 5, 0, SEN(printargs), "osf_alt_plock" }, /*not implemented */ +[181] = { 5, 0, SEN(printargs), "osf_alt_plock" }, /* not implemented */ [182 ... 183] = { }, -[184] = { 5, 0, SEN(printargs), "osf_getmnt" }, /*not implemented */ +[184] = { 5, 0, SEN(printargs), "osf_getmnt" }, /* not implemented */ [185 ... 186] = { }, -[187] = { 5, 0, SEN(printargs), "osf_alt_sigpending" }, /*not implemented */ -[188] = { 5, 0, SEN(printargs), "osf_alt_setsid" }, /*not implemented */ +[187] = { 5, 0, SEN(printargs), "osf_alt_sigpending" }, /* not implemented */ +[188] = { 5, 0, SEN(printargs), "osf_alt_setsid" }, /* not implemented */ [189 ... 198] = { }, [199] = { 4, 0, SEN(printargs), "osf_swapon" }, [200] = { 3, TI, SEN(msgctl), "msgctl" }, @@ -216,63 +197,63 @@ [210] = { 3, TI, SEN(shmctl), "shmctl" }, [211] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, [212] = { 3, TI, SEN(shmget), "shmget" }, -[213] = { 5, 0, SEN(printargs), "osf_mvalid" }, /*not implemented */ -[214] = { 5, 0, SEN(printargs), "osf_getaddressconf" }, /*not implemented */ -[215] = { 5, 0, SEN(printargs), "osf_msleep" }, /*not implemented */ -[216] = { 5, 0, SEN(printargs), "osf_mwakeup" }, /*not implemented */ +[213] = { 5, 0, SEN(printargs), "osf_mvalid" }, /* not implemented */ +[214] = { 5, 0, SEN(printargs), "osf_getaddressconf" }, /* not implemented */ +[215] = { 5, 0, SEN(printargs), "osf_msleep" }, /* not implemented */ +[216] = { 5, 0, SEN(printargs), "osf_mwakeup" }, /* not implemented */ [217] = { 3, TM, SEN(msync), "msync" }, -[218] = { 5, 0, SEN(printargs), "osf_signal" }, /*not implemented */ -[219] = { 5, 0, SEN(printargs), "osf_utc_gettime" }, /*not implemented */ -[220] = { 5, 0, SEN(printargs), "osf_utc_adjtime" }, /*not implemented */ +[218] = { 5, 0, SEN(printargs), "osf_signal" }, /* not implemented */ +[219] = { 5, 0, SEN(printargs), "osf_utc_gettime" }, /* not implemented */ +[220] = { 5, 0, SEN(printargs), "osf_utc_adjtime" }, /* not implemented */ [221] = { }, -[222] = { 5, 0, SEN(printargs), "osf_security" }, /*not implemented */ -[223] = { 5, 0, SEN(printargs), "osf_kloadcall" }, /*not implemented */ -[224] = { 5, 0, SEN(printargs), "osf_stat" }, /*not implemented */ -[225] = { 5, 0, SEN(printargs), "osf_lstat" }, /*not implemented */ -[226] = { 5, 0, SEN(printargs), "osf_fstat" }, /*not implemented */ -[227] = { 3, 0, SEN(osf_statfs), "osf_statfs64" }, /*not implemented */ -[228] = { 3, 0, SEN(osf_fstatfs), "osf_fstatfs64" }, /*not implemented */ +[222] = { 5, 0, SEN(printargs), "osf_security" }, /* not implemented */ +[223] = { 5, 0, SEN(printargs), "osf_kloadcall" }, /* not implemented */ +[224] = { 2, TF|TST|TSTA, SEN(printargs), "osf_stat" }, +[225] = { 2, TF|TLST|TSTA, SEN(printargs), "osf_lstat" }, +[226] = { 2, TD|TFST|TSTA, SEN(printargs), "osf_fstat" }, +[227] = { 3, TF|TSF|TSFA, SEN(osf_statfs), "osf_statfs64" }, +[228] = { 3, TD|TFSF|TSFA, SEN(osf_fstatfs), "osf_fstatfs64" }, [229 ... 232] = { }, [233] = { 1, 0, SEN(getpgid), "getpgid" }, [234] = { 1, 0, SEN(getsid), "getsid" }, [235] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, -[236] = { 5, 0, SEN(printargs), "osf_waitid" }, /*not implemented */ -[237] = { 5, 0, SEN(printargs), "osf_priocntlset" }, /*not implemented */ -[238] = { 5, 0, SEN(printargs), "osf_sigsendset" }, /*not implemented */ -[239] = { 5, 0, SEN(printargs), "osf_set_speculative" }, /*not implemented */ -[240] = { 5, 0, SEN(printargs), "osf_msfs_syscall" }, /*not implemented */ -[241] = { 5, 0, SEN(printargs), "osf_sysinfo" }, -[242] = { 5, 0, SEN(printargs), "osf_uadmin" }, /*not implemented */ -[243] = { 5, 0, SEN(printargs), "osf_fuser" }, /*not implemented */ +[236] = { 5, 0, SEN(printargs), "osf_waitid" }, /* not implemented */ +[237] = { 5, 0, SEN(printargs), "osf_priocntlset" }, /* not implemented */ +[238] = { 5, 0, SEN(printargs), "osf_sigsendset" }, /* not implemented */ +[239] = { 5, 0, SEN(printargs), "osf_set_speculative" }, /* not implemented */ +[240] = { 5, 0, SEN(printargs), "osf_msfs_syscall" }, /* not implemented */ +[241] = { 3, 0, SEN(printargs), "osf_sysinfo" }, +[242] = { 5, 0, SEN(printargs), "osf_uadmin" }, /* not implemented */ +[243] = { 5, 0, SEN(printargs), "osf_fuser" }, /* not implemented */ [244] = { 2, 0, SEN(printargs), "osf_proplist_syscall" }, -[245] = { 5, 0, SEN(printargs), "osf_ntp_adjtime" }, /*not implemented */ -[246] = { 5, 0, SEN(printargs), "osf_ntp_gettime" }, /*not implemented */ -[247] = { 5, 0, SEN(printargs), "osf_pathconf" }, /*not implemented */ -[248] = { 5, 0, SEN(printargs), "osf_fpathconf" }, /*not implemented */ +[245] = { 5, 0, SEN(printargs), "osf_ntp_adjtime" }, /* not implemented */ +[246] = { 5, 0, SEN(printargs), "osf_ntp_gettime" }, /* not implemented */ +[247] = { 5, 0, SEN(printargs), "osf_pathconf" }, /* not implemented */ +[248] = { 5, 0, SEN(printargs), "osf_fpathconf" }, /* not implemented */ [249] = { }, -[250] = { 5, 0, SEN(printargs), "osf_uswitch" }, /*not implemented */ +[250] = { 5, 0, SEN(printargs), "osf_uswitch" }, /* not implemented */ [251] = { 2, 0, SEN(printargs), "osf_usleep_thread" }, -[252] = { 5, 0, SEN(printargs), "osf_audcntl" }, /*not implemented */ -[253] = { 5, 0, SEN(printargs), "osf_audgen" }, /*not implemented */ +[252] = { 5, 0, SEN(printargs), "osf_audcntl" }, /* not implemented */ +[253] = { 5, 0, SEN(printargs), "osf_audgen" }, /* not implemented */ [254] = { 3, 0, SEN(sysfs), "sysfs" }, -[255] = { 5, 0, SEN(printargs), "osf_subsys_info" }, /*not implemented */ +[255] = { 5, 0, SEN(printargs), "osf_subsys_info" }, /* not implemented */ [256] = { 5, 0, SEN(printargs), "osf_getsysinfo" }, [257] = { 5, 0, SEN(printargs), "osf_setsysinfo" }, -[258] = { 5, 0, SEN(printargs), "osf_afs_syscall" }, /*not implemented */ -[259] = { 5, 0, SEN(printargs), "osf_swapctl" }, /*not implemented */ -[260] = { 5, 0, SEN(printargs), "osf_memcntl" }, /*not implemented */ -[261] = { 5, 0, SEN(printargs), "osf_fdatasync" }, /*not implemented */ +[258] = { 5, 0, SEN(printargs), "osf_afs_syscall" }, /* not implemented */ +[259] = { 5, 0, SEN(printargs), "osf_swapctl" }, /* not implemented */ +[260] = { 5, 0, SEN(printargs), "osf_memcntl" }, /* not implemented */ +[261] = { 5, 0, SEN(printargs), "osf_fdatasync" }, /* not implemented */ [262 ... 299] = { }, [300] = { 2, 0, SEN(bdflush), "bdflush" }, -[301] = { 3, 0, SEN(printargs), "sethae" }, +[301] = { 1, 0, SEN(printargs), "sethae" }, [302] = { 5, TF, SEN(mount), "mount" }, -[303] = { 1, 0, SEN(adjtimex), "old_adjtimex" }, +[303] = { 1, 0, SEN(adjtimex32), "old_adjtimex" }, [304] = { 1, TF, SEN(swapoff), "swapoff" }, [305] = { 3, TD, SEN(getdents), "getdents" }, -[306] = { 2, 0, SEN(create_module), "create_module" }, +[306] = { 2, 0, SEN(create_module), "create_module" }, /* not implemented */ [307] = { 3, 0, SEN(init_module), "init_module" }, [308] = { 2, 0, SEN(delete_module), "delete_module" }, -[309] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, +[309] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, /* not implemented */ [310] = { 3, 0, SEN(syslog), "syslog" }, [311] = { 4, 0, SEN(reboot), "reboot" }, [312] = { 5, TP, SEN(clone), "clone" }, @@ -290,9 +271,9 @@ [324] = { 1, NF, SEN(personality), "personality" }, [325] = { 1, NF, SEN(setfsuid), "setfsuid" }, [326] = { 1, NF, SEN(setfsgid), "setfsgid" }, -[327] = { 2, 0, SEN(ustat), "ustat" }, -[328] = { 2, TF, SEN(statfs), "statfs" }, -[329] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[327] = { 2, TSFA, SEN(ustat), "ustat" }, +[328] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[329] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, [330] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, [331] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, [332] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, @@ -300,17 +281,17 @@ [334] = { 0, 0, SEN(sched_yield), "sched_yield" }, [335] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [336] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[337] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, -[338] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, +[337] = { 2, 0, SEN(sched_rr_get_interval_time64),"sched_rr_get_interval"}, +[338] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, /* not implemented */ [339] = { 1, 0, SEN(uname), "uname" }, -[340] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[340] = { 2, 0, SEN(nanosleep_time64), "nanosleep" }, [341] = { 5, TM|SI, SEN(mremap), "mremap" }, -[342] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[342] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, /* not implemented */ [343] = { 3, 0, SEN(setresuid), "setresuid" }, [344] = { 3, 0, SEN(getresuid), "getresuid" }, [345] = { 5, 0, SEN(printargs), "pciconfig_read" }, [346] = { 5, 0, SEN(printargs), "pciconfig_write" }, -[347] = { 5, 0, SEN(query_module), "query_module" }, +[347] = { 5, 0, SEN(query_module), "query_module" }, /* not implemented */ [348] = { 5, 0, SEN(prctl), "prctl" }, [349] = { 4, TD, SEN(pread), "pread64" }, [350] = { 4, TD, SEN(pwrite), "pwrite64" }, @@ -318,7 +299,7 @@ [352] = { 5, TS, SEN(rt_sigaction), "rt_sigaction" }, [353] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, [354] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[355] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[355] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait" }, [356] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, [357] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, [358] = { 5, TD, SEN(select), "select" }, @@ -329,19 +310,19 @@ [363] = { 2, TF, SEN(utimes), "utimes" }, [364] = { 2, 0, SEN(getrusage), "getrusage" }, [365] = { 4, TP, SEN(wait4), "wait4" }, -[366] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[366] = { 1, 0, SEN(adjtimex64), "adjtimex" }, [367] = { 2, TF, SEN(getcwd), "getcwd" }, [368] = { 2, 0, SEN(capget), "capget" }, [369] = { 2, 0, SEN(capset), "capset" }, [370] = { 4, TD|TN, SEN(sendfile), "sendfile" }, [371] = { 3, 0, SEN(setresgid), "setresgid" }, [372] = { 3, 0, SEN(getresgid), "getresgid" }, -[373] = { 4, 0, SEN(printargs), "dipc" }, /*not implemented */ +[373] = { 4, 0, SEN(printargs), "dipc" }, /* not implemented */ [374] = { 2, TF, SEN(pivotroot), "pivot_root" }, [375] = { 3, TM, SEN(mincore), "mincore" }, [376] = { 3, 0, SEN(printargs), "pciconfig_iobase" }, [377] = { 3, TD, SEN(getdents64), "getdents64" }, -[378] = { 0, NF, SEN(gettid), "gettid" }, +[378] = { 0, PU|NF, SEN(gettid), "gettid" }, [379] = { 3, TD, SEN(readahead), "readahead" }, [380] = { }, [381] = { 2, TS, SEN(kill), "tkill" }, @@ -357,13 +338,13 @@ [391] = { 2, TF, SEN(removexattr), "removexattr" }, [392] = { 2, TF, SEN(removexattr), "lremovexattr" }, [393] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, -[394] = { 6, 0, SEN(futex), "futex" }, +[394] = { 6, 0, SEN(futex_time64), "futex" }, [395] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [396] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, -[397] = { 5, 0, SEN(tuxcall), "tuxcall" }, +[397] = { 5, 0, SEN(tuxcall), "tuxcall" }, /* not implemented */ [398] = { 2, TM, SEN(io_setup), "io_setup" }, [399] = { 1, TM, SEN(io_destroy), "io_destroy" }, -[400] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[400] = { 5, 0, SEN(io_getevents_time64), "io_getevents" }, [401] = { 3, 0, SEN(io_submit), "io_submit" }, [402] = { 3, 0, SEN(io_cancel), "io_cancel" }, [403 ... 404] = { }, @@ -377,29 +358,29 @@ [412] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, [413] = { 4, TD, SEN(fadvise64), "fadvise64" }, [414] = { 3, 0, SEN(timer_create), "timer_create" }, -[415] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[416] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[415] = { 4, 0, SEN(timer_settime64), "timer_settime" }, +[416] = { 2, 0, SEN(timer_gettime64), "timer_gettime" }, [417] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, [418] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[419] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[420] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[421] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[422] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, -[423] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[419] = { 2, 0, SEN(clock_settime64), "clock_settime" }, +[420] = { 2, 0, SEN(clock_gettime64), "clock_gettime" }, +[421] = { 2, 0, SEN(clock_getres_time64), "clock_getres" }, +[422] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep" }, +[423] = { 4, TI, SEN(semtimedop_time64), "semtimedop" }, [424] = { 3, TS, SEN(tgkill), "tgkill" }, -[425] = { 2, TF, SEN(stat64), "stat64" }, -[426] = { 2, TF, SEN(lstat64), "lstat64" }, -[427] = { 2, TD, SEN(fstat64), "fstat64" }, -[428] = { 5, 0, SEN(vserver), "vserver" }, -[429] = { 6, TM, SEN(mbind), "mbind" }, -[430] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, -[431] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, -[432] = { 4, 0, SEN(mq_open), "mq_open" }, +[425] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" }, +[426] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" }, +[427] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" }, +[428] = { 5, 0, SEN(vserver), "vserver" }, /* not implemented */ +[429] = { 6, TM, SEN(mbind), "mbind" }, /* not implemented */ +[430] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, /* not implemented */ +[431] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, /* not implemented */ +[432] = { 4, TD, SEN(mq_open), "mq_open" }, [433] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[434] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[435] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[436] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[437] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[434] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend" }, +[435] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive" }, +[436] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[437] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, [438] = { 5, TP, SEN(waitid), "waitid" }, [439] = { 5, 0, SEN(add_key), "add_key" }, [440] = { 4, 0, SEN(request_key), "request_key" }, @@ -407,7 +388,7 @@ [442] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, [443] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, [444] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[445] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[445] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, [446] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, [447] = { 1, TD, SEN(fdatasync), "fdatasync" }, [448] = { 4, 0, SEN(kexec_load), "kexec_load" }, @@ -417,7 +398,7 @@ [452] = { 4, TD|TF, SEN(mknodat), "mknodat" }, [453] = { 5, TD|TF, SEN(fchownat), "fchownat" }, [454] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[455] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[455] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" }, [456] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, [457] = { 4, TD|TF, SEN(renameat), "renameat" }, [458] = { 5, TD|TF, SEN(linkat), "linkat" }, @@ -425,8 +406,8 @@ [460] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, [461] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, [462] = { 3, TD|TF, SEN(faccessat), "faccessat" }, -[463] = { 6, TD, SEN(pselect6), "pselect6" }, -[464] = { 5, TD, SEN(ppoll), "ppoll" }, +[463] = { 6, TD, SEN(pselect6_time64), "pselect6" }, +[464] = { 5, TD, SEN(ppoll_time64), "ppoll" }, [465] = { 1, TP, SEN(unshare), "unshare" }, [466] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, [467] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, @@ -437,15 +418,15 @@ [472] = { 6, TM, SEN(move_pages), "move_pages" }, [473] = { 3, 0, SEN(getcpu), "getcpu" }, [474] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[475] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[475] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" }, [476] = { 3, TD|TS, SEN(signalfd), "signalfd" }, -[477] = { 4, TD, SEN(timerfd), "timerfd" }, +[477] = { 4, TD, SEN(timerfd), "timerfd" }, /* not implemented */ [478] = { 1, TD, SEN(eventfd), "eventfd" }, -[479] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[479] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg" }, [480] = { 4, TD, SEN(fallocate), "fallocate" }, [481] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, -[482] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, -[483] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[482] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime" }, +[483] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime" }, [484] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, [485] = { 2, TD, SEN(eventfd2), "eventfd2" }, [486] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, @@ -461,7 +442,7 @@ [496] = { 4, 0, SEN(prlimit64), "prlimit64" }, [497] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, [498] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[499] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[499] = { 2, 0, SEN(clock_adjtime64), "clock_adjtime" }, [500] = { 1, TD, SEN(syncfs), "syncfs" }, [501] = { 2, TD, SEN(setns), "setns" }, [502] = { 4, TN, SEN(accept4), "accept4" }, @@ -476,3 +457,27 @@ [511] = { 3, 0, SEN(getrandom), "getrandom" }, [512] = { 2, TD, SEN(memfd_create), "memfd_create" }, [513] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[514] = { 3, 0, SEN(seccomp), "seccomp" }, +[515] = { 3, TD, SEN(bpf), "bpf" }, +[516] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[517] = { 2, 0, SEN(membarrier), "membarrier" }, +[518] = { 3, TM, SEN(mlock2), "mlock2" }, +[519] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[520] = { 6, TD, SEN(preadv2), "preadv2" }, +[521] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[522] = { 5, TD|TF|TSTA, SEN(statx), "statx" }, +[523] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents" }, +[524] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, +[525] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, +[526] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[527] = { 4, 0, SEN(rseq), "rseq" }, +[528] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, +[529] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, +[530] = { 0, PU|NF, SEN(getegid), "getegid" }, +[531] = { 0, PU|NF, SEN(geteuid), "geteuid" }, +[532] = { 0, PU|NF, SEN(getppid), "getppid" }, +/* all other architectures have common numbers for new syscalls, alpha is the exception */ +[534] = { 4, TD|TS, SEN(pidfd_send_signal), "pidfd_send_signal" }, +[535] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" }, +[536] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" }, +[537] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" }, diff --git a/linux/alpha/userent.h b/linux/alpha/userent.h index 3a043b56..fa5240f3 100644 --- a/linux/alpha/userent.h +++ b/linux/alpha/userent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + { 0, "r0" }, { 1, "r1" }, { 2, "r2" }, diff --git a/linux/arc/arch_regs.c b/linux/arc/arch_regs.c index 18460080..ee11f21b 100644 --- a/linux/arc/arch_regs.c +++ b/linux/arc/arch_regs.c @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static struct user_regs_struct arc_regs; #define ARCH_REGS_FOR_GETREGSET arc_regs #define ARCH_PC_REG arc_regs.efa +#define ARCH_SP_REG arc_regs.scratch.sp diff --git a/linux/arc/get_error.c b/linux/arc/get_error.c index e19debc1..791a0aab 100644 --- a/linux/arc/get_error.c +++ b/linux/arc/get_error.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "negated_errno.h" + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { if (check_errno && is_negated_errno(arc_regs.scratch.r0)) { tcp->u_rval = -1; diff --git a/linux/arc/get_scno.c b/linux/arc/get_scno.c index d2046b2d..4d9a93e6 100644 --- a/linux/arc/get_scno.c +++ b/linux/arc/get_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) diff --git a/linux/arc/get_syscall_args.c b/linux/arc/get_syscall_args.c index 85e867f0..94b886ea 100644 --- a/linux/arc/get_syscall_args.c +++ b/linux/arc/get_syscall_args.c @@ -1,6 +1,13 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { unsigned long *arc_args = &arc_regs.scratch.r0; unsigned int i; diff --git a/linux/arc/raw_syscall.h b/linux/arc/raw_syscall.h new file mode 100644 index 00000000..f51c84ec --- /dev/null +++ b/linux/arc/raw_syscall.h @@ -0,0 +1,41 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + *err = 0; + register kernel_ulong_t r8 __asm__("r8") = nr; + register kernel_ulong_t r0 __asm__("r0"); + +# ifdef __A7__ +# define ARC_TRAP_INSN "trap0" +# elif defined __HS__ +# define ARC_TRAP_INSN "trap_s 0 " +# else +# error unrecognized arc +# endif + + __asm__ __volatile__(ARC_TRAP_INSN + : "=r"(r0) + : "r"(r8) + : "memory"); + +# undef ARC_TRAP_INSN + + return r0; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/arc/set_error.c b/linux/arc/set_error.c index afc9bd50..546362e4 100644 --- a/linux/arc/set_error.c +++ b/linux/arc/set_error.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_error(struct tcb *tcp) { diff --git a/linux/arc/set_scno.c b/linux/arc/set_scno.c index ea25d74d..adbf218e 100644 --- a/linux/arc/set_scno.c +++ b/linux/arc/set_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { diff --git a/linux/arc/syscallent.h b/linux/arc/syscallent.h index edcdff2e..aed2e55a 100644 --- a/linux/arc/syscallent.h +++ b/linux/arc/syscallent.h @@ -1,8 +1,15 @@ +/* + * Copyright (c) 2013-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #define sys_ARCH_mmap sys_mmap_pgoff #include "32/syscallent.h" /* [244 ... 259] are arch specific */ [244] = { 3, 0, SEN(printargs), "cacheflush" }, [245] = { 1, 0, SEN(printargs), "arc_settls" }, -[246] = { 0, 0, SEN(printargs), "arc_gettls" }, +[246] = { 0, PU|NF, SEN(printargs), "arc_gettls" }, [247] = { 3, 0, SEN(sysfs), "sysfs" }, [248] = { 3, 0, SEN(printargs), "arc_usr_cmpxchg"}, diff --git a/linux/arch_defs_.h b/linux/arch_defs_.h new file mode 100644 index 00000000..5baf3f91 --- /dev/null +++ b/linux/arch_defs_.h @@ -0,0 +1,68 @@ +/* + * Fallback file for arch-specific definitions. + * + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef ARCH_TIMESIZE +# define ARCH_TIMESIZE SIZEOF_LONG +#endif + +#ifndef HAVE_ARCH_GETRVAL2 +# define HAVE_ARCH_GETRVAL2 0 +#endif + +#ifndef HAVE_ARCH_OLD_MMAP +# define HAVE_ARCH_OLD_MMAP 0 +#endif + +#ifndef HAVE_ARCH_OLD_MMAP_PGOFF +# define HAVE_ARCH_OLD_MMAP_PGOFF 0 +#endif + +#ifndef HAVE_ARCH_OLD_SELECT +# define HAVE_ARCH_OLD_SELECT 0 +#endif + +#ifndef HAVE_ARCH_UID16_SYSCALLS +# define HAVE_ARCH_UID16_SYSCALLS 0 +#endif + +#ifndef DEFAULT_PERSONALITY +# define DEFAULT_PERSONALITY 0 +#endif + +#ifndef SUPPORTED_PERSONALITIES +# define SUPPORTED_PERSONALITIES 1 +#endif + +#ifndef HAVE_ARCH_DEDICATED_ERR_REG +# define HAVE_ARCH_DEDICATED_ERR_REG 0 +#endif + +#ifndef CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL +# define CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL 0 +#endif + +#ifndef ARCH_NEEDS_SET_ERROR_FOR_SCNO_TAMPERING +# define ARCH_NEEDS_SET_ERROR_FOR_SCNO_TAMPERING 0 +#endif + +#ifndef MIN_WORDSIZE +# if SUPPORTED_PERSONALITIES > 1 +# define MIN_WORDSIZE 4 +# else +# define MIN_WORDSIZE SIZEOF_LONG +# endif +#endif + +#ifndef HAVE_ARCH_TIME32_SYSCALLS +# define HAVE_ARCH_TIME32_SYSCALLS (MIN_WORDSIZE == 4) +#endif + +#ifndef HAVE_ARCH_OLD_TIME64_SYSCALLS +# define HAVE_ARCH_OLD_TIME64_SYSCALLS (SIZEOF_LONG == 8) +#endif diff --git a/linux/arch_kvm.c b/linux/arch_kvm.c new file mode 100644 index 00000000..c7ae7b7b --- /dev/null +++ b/linux/arch_kvm.c @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifdef HAVE_STRUCT_KVM_REGS +static void +arch_print_kvm_regs(struct tcb *const tcp, + const kernel_ulong_t addr, + const struct kvm_regs *const regs) +{ + printaddr(addr); +} +#endif /* HAVE_STRUCT_KVM_REGS */ + +#ifdef HAVE_STRUCT_KVM_SREGS +static void +arch_print_kvm_sregs(struct tcb *const tcp, + const kernel_ulong_t addr, + const struct kvm_sregs *const sregs) +{ + printaddr(addr); +} +#endif /* HAVE_STRUCT_KVM_SREGS */ diff --git a/linux/arch_rt_sigframe.c b/linux/arch_rt_sigframe.c new file mode 100644 index 00000000..32d1c638 --- /dev/null +++ b/linux/arch_rt_sigframe.c @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +/* This is a generic definition for compatible architectures. */ + +FUNC_GET_RT_SIGFRAME_ADDR +{ + kernel_ulong_t sp; + return get_stack_pointer(tcp, &sp) ? sp : 0; +} diff --git a/linux/arch_sigreturn.c b/linux/arch_sigreturn.c index 73a2b103..318901a9 100644 --- a/linux/arch_sigreturn.c +++ b/linux/arch_sigreturn.c @@ -1,4 +1,9 @@ -#warning sigreturn/rt_sigreturn signal mask decoding is not implemented for this architecture +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ static void arch_sigreturn(struct tcb *tcp) diff --git a/linux/arm/arch_defs_.h b/linux/arm/arch_defs_.h new file mode 100644 index 00000000..0b2f3b0d --- /dev/null +++ b/linux/arm/arch_defs_.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define HAVE_ARCH_OLD_MMAP 1 +#define HAVE_ARCH_OLD_SELECT 1 +#define HAVE_ARCH_UID16_SYSCALLS 1 +#define CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL 1 diff --git a/linux/arm/arch_regs.c b/linux/arm/arch_regs.c index 8b73cb86..bc453bb7 100644 --- a/linux/arm/arch_regs.c +++ b/linux/arm/arch_regs.c @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static struct pt_regs arm_regs; -unsigned long *const arm_sp_ptr = (unsigned long *) &arm_regs.ARM_sp; #define ARCH_REGS_FOR_GETREGS arm_regs #define ARCH_PC_REG arm_regs.ARM_pc +#define ARCH_SP_REG arm_regs.ARM_sp diff --git a/linux/arm/arch_regs.h b/linux/arm/arch_regs.h deleted file mode 100644 index 4edd50c7..00000000 --- a/linux/arm/arch_regs.h +++ /dev/null @@ -1 +0,0 @@ -extern unsigned long *const arm_sp_ptr; diff --git a/linux/arm/arch_sigreturn.c b/linux/arm/arch_sigreturn.c index 378ba67f..c26405d3 100644 --- a/linux/arm/arch_sigreturn.c +++ b/linux/arm/arch_sigreturn.c @@ -1,19 +1,29 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static void arch_sigreturn(struct tcb *tcp) { + kernel_ulong_t sp; + if (!get_stack_pointer(tcp, &sp)) + return; + #define SIZEOF_STRUCT_SIGINFO 128 #define SIZEOF_STRUCT_SIGCONTEXT (21 * 4) #define OFFSETOF_STRUCT_UCONTEXT_UC_SIGMASK (5 * 4 + SIZEOF_STRUCT_SIGCONTEXT) - const unsigned long addr = + const kernel_ulong_t addr = #ifdef AARCH64 tcp->currpers == 0 ? - (*aarch64_sp_ptr + SIZEOF_STRUCT_SIGINFO + - offsetof(struct ucontext, uc_sigmask)) : + (sp + SIZEOF_STRUCT_SIGINFO + + offsetof(ucontext_t, uc_sigmask)) : #endif - (*arm_sp_ptr + - OFFSETOF_STRUCT_UCONTEXT_UC_SIGMASK); + (sp + OFFSETOF_STRUCT_UCONTEXT_UC_SIGMASK); tprints("{mask="); - print_sigset_addr_len(tcp, addr, NSIG_BYTES); + print_sigset_addr(tcp, addr); tprints("}"); } diff --git a/linux/arm/get_error.c b/linux/arm/get_error.c index fa81dd76..df0571c9 100644 --- a/linux/arm/get_error.c +++ b/linux/arm/get_error.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "negated_errno.h" + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { if (check_errno && is_negated_errno(arm_regs.ARM_r0)) { tcp->u_rval = -1; diff --git a/linux/arm/get_scno.c b/linux/arm/get_scno.c index d2bc0682..443a47e0 100644 --- a/linux/arm/get_scno.c +++ b/linux/arm/get_scno.c @@ -2,29 +2,10 @@ * Copyright (c) 2003 Russell King * Copyright (c) 2011-2013 Denys Vlasenko * Copyright (c) 2011-2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ /* Return codes: 1 - ok, 0 - ignore, other - error. */ @@ -57,7 +38,7 @@ arch_get_scno(struct tcb *tcp) /* Fixup the syscall number */ scno &= 0x000fffff; } else { - scno_in_r7: +scno_in_r7: scno = arm_regs.ARM_r7; } #else /* __ARM_EABI__ || !ENABLE_ARM_OABI */ @@ -66,18 +47,13 @@ arch_get_scno(struct tcb *tcp) #endif - scno = shuffle_scno(scno); - /* * Do some sanity checks to figure out * whether it's really a syscall entry. */ if (arm_regs.ARM_ip && !scno_in_range(scno)) { - if (debug_flag) - error_msg("pid %d stray syscall exit:" - " ARM_ip = %ld, scno = %ld", - tcp->pid, arm_regs.ARM_ip, - shuffle_scno(scno)); + debug_msg("pid %d stray syscall exit: ARM_ip = %ld, scno = %ld", + tcp->pid, arm_regs.ARM_ip, scno); return 0; } diff --git a/linux/arm/get_syscall_args.c b/linux/arm/get_syscall_args.c index 6be17501..bc8e9c4a 100644 --- a/linux/arm/get_syscall_args.c +++ b/linux/arm/get_syscall_args.c @@ -1,6 +1,13 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { tcp->u_arg[0] = arm_regs.uregs[0]; tcp->u_arg[1] = arm_regs.uregs[1]; diff --git a/linux/arm/ioctls_arch0.h b/linux/arm/ioctls_arch0.h index f44b4a34..2393ba42 100644 --- a/linux/arm/ioctls_arch0.h +++ b/linux/arm/ioctls_arch0.h @@ -9,6 +9,7 @@ { "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_ENTRY", _IOC_WRITE, 0xae74, 0x10 }, { "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_NR", _IOC_WRITE, 0xae73, 0x08 }, { "linux/kvm.h", "KVM_CHECK_EXTENSION", _IOC_NONE, 0xae03, 0x00 }, +{ "linux/kvm.h", "KVM_CLEAR_DIRTY_LOG", _IOC_READ|_IOC_WRITE, 0xaec0, 0x18 }, { "linux/kvm.h", "KVM_CREATE_DEVICE", _IOC_READ|_IOC_WRITE, 0xaee0, 0x0c }, { "linux/kvm.h", "KVM_CREATE_IRQCHIP", _IOC_NONE, 0xae60, 0x00 }, { "linux/kvm.h", "KVM_CREATE_PIT", _IOC_NONE, 0xae64, 0x00 }, @@ -40,27 +41,13 @@ { "linux/kvm.h", "KVM_IRQ_LINE", _IOC_WRITE, 0xae61, 0x08 }, { "linux/kvm.h", "KVM_IRQ_LINE_STATUS", _IOC_READ|_IOC_WRITE, 0xae67, 0x08 }, { "linux/kvm.h", "KVM_KVMCLOCK_CTRL", _IOC_NONE, 0xaead, 0x00 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_OP", _IOC_READ|_IOC_WRITE, 0xaeba, 0x04 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_REG_REGION", _IOC_READ, 0xaebb, 0x10 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_UNREG_REGION", _IOC_READ, 0xaebc, 0x10 }, { "linux/kvm.h", "KVM_NMI", _IOC_NONE, 0xae9a, 0x00 }, -{ "linux/kvm.h", "KVM_PPC_ALLOCATE_HTAB", _IOC_READ|_IOC_WRITE, 0xaea7, 0x04 }, -{ "linux/kvm.h", "KVM_PPC_GET_PVINFO", _IOC_WRITE, 0xaea1, 0x80 }, -{ "linux/kvm.h", "KVM_PPC_GET_SMMU_INFO", _IOC_READ, 0xaea6, 0x250 }, { "linux/kvm.h", "KVM_REGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae67, 0x10 }, { "linux/kvm.h", "KVM_REINJECT_CONTROL", _IOC_NONE, 0xae71, 0x00 }, { "linux/kvm.h", "KVM_RUN", _IOC_NONE, 0xae80, 0x00 }, -{ "linux/kvm.h", "KVM_S390_ENABLE_SIE", _IOC_NONE, 0xae06, 0x00 }, -{ "linux/kvm.h", "KVM_S390_GET_IRQ_STATE", _IOC_WRITE, 0xaeb6, 0x20 }, -{ "linux/kvm.h", "KVM_S390_GET_SKEYS", _IOC_WRITE, 0xaeb2, 0x40 }, -{ "linux/kvm.h", "KVM_S390_INITIAL_RESET", _IOC_NONE, 0xae97, 0x00 }, -{ "linux/kvm.h", "KVM_S390_INTERRUPT", _IOC_WRITE, 0xae94, 0x10 }, -{ "linux/kvm.h", "KVM_S390_IRQ", _IOC_WRITE, 0xaeb4, 0x48 }, -{ "linux/kvm.h", "KVM_S390_MEM_OP", _IOC_WRITE, 0xaeb1, 0x40 }, -{ "linux/kvm.h", "KVM_S390_SET_INITIAL_PSW", _IOC_WRITE, 0xae96, 0x10 }, -{ "linux/kvm.h", "KVM_S390_SET_IRQ_STATE", _IOC_WRITE, 0xaeb5, 0x20 }, -{ "linux/kvm.h", "KVM_S390_SET_SKEYS", _IOC_WRITE, 0xaeb3, 0x40 }, -{ "linux/kvm.h", "KVM_S390_STORE_STATUS", _IOC_WRITE, 0xae95, 0x04 }, -{ "linux/kvm.h", "KVM_S390_UCAS_MAP", _IOC_WRITE, 0xae50, 0x18 }, -{ "linux/kvm.h", "KVM_S390_UCAS_UNMAP", _IOC_WRITE, 0xae51, 0x18 }, -{ "linux/kvm.h", "KVM_S390_VCPU_FAULT", _IOC_WRITE, 0xae52, 0x04 }, { "linux/kvm.h", "KVM_SET_BOOT_CPU_ID", _IOC_NONE, 0xae78, 0x00 }, { "linux/kvm.h", "KVM_SET_CLOCK", _IOC_WRITE, 0xae7b, 0x30 }, { "linux/kvm.h", "KVM_SET_DEVICE_ATTR", _IOC_WRITE, 0xaee1, 0x18 }, @@ -85,5 +72,3 @@ { "linux/kvm.h", "KVM_TPR_ACCESS_REPORTING", _IOC_READ|_IOC_WRITE, 0xae92, 0x28 }, { "linux/kvm.h", "KVM_TRANSLATE", _IOC_READ|_IOC_WRITE, 0xae85, 0x18 }, { "linux/kvm.h", "KVM_UNREGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae68, 0x10 }, -{ "linux/kvm.h", "KVM_X86_GET_MCE_CAP_SUPPORTED", _IOC_READ, 0xae9d, 0x08 }, -{ "linux/kvm.h", "KVM_X86_SETUP_MCE", _IOC_WRITE, 0xae9c, 0x08 }, diff --git a/linux/arm/nr_prefix.c b/linux/arm/nr_prefix.c new file mode 100644 index 00000000..bbbcf80b --- /dev/null +++ b/linux/arm/nr_prefix.c @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +static inline const char * +nr_prefix(kernel_ulong_t scno) +{ + /* + * For now, the set of syscalls that are shuffled is equivalent to the + * set of syscalls that have __ARM_NR_ prefix. + */ + if (shuffle_scno(scno) != scno) + return "__ARM_NR_"; + else + return "__NR_"; +} diff --git a/linux/arm/raw_syscall.h b/linux/arm/raw_syscall.h new file mode 100644 index 00000000..c052a298 --- /dev/null +++ b/linux/arm/raw_syscall.h @@ -0,0 +1,44 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + *err = 0; + +# ifdef __thumb__ /* && FRAME_POINTERS_ENABLED */ + + register kernel_ulong_t rt; + register kernel_ulong_t r0 __asm__("r0"); + __asm__ __volatile__("mov %1,r7; mov r7,%2; swi 0x0; mov r7,%1" + : "=r"(r0), "=&r"(rt) + : "r"(nr) + : "memory"); + +# else + + register kernel_ulong_t r7 __asm__("r7") = nr; + register kernel_ulong_t r0 __asm__("r0"); + __asm__ __volatile__("swi 0x0" + : "=r"(r0) + : "r"(r7) + : "memory"); + +# endif + + return r0; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/arm/set_error.c b/linux/arm/set_error.c index 9b303d5c..8b754dca 100644 --- a/linux/arm/set_error.c +++ b/linux/arm/set_error.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_error(struct tcb *tcp) { diff --git a/linux/arm/set_scno.c b/linux/arm/set_scno.c index 015ed066..0c4de440 100644 --- a/linux/arm/set_scno.c +++ b/linux/arm/set_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #ifndef PTRACE_SET_SYSCALL # define PTRACE_SET_SYSCALL 23 #endif diff --git a/linux/arm/shuffle_scno.c b/linux/arm/shuffle_scno.c new file mode 100644 index 00000000..68199cfc --- /dev/null +++ b/linux/arm/shuffle_scno.c @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +kernel_ulong_t +shuffle_scno(kernel_ulong_t scno) +{ + if (scno < ARM_FIRST_SHUFFLED_SYSCALL) + return scno; + + /* __ARM_NR_cmpxchg? Swap with LAST_ORDINARY+1 */ + if (scno == ARM_FIRST_SHUFFLED_SYSCALL) + return 0x000ffff0; + if (scno == 0x000ffff0) + return ARM_FIRST_SHUFFLED_SYSCALL; + +#define ARM_SECOND_SHUFFLED_SYSCALL (ARM_FIRST_SHUFFLED_SYSCALL + 1) + /* + * Is it ARM specific syscall? + * Swap [0x000f0000, 0x000f0000 + LAST_SPECIAL] range + * with [SECOND_SHUFFLED, SECOND_SHUFFLED + LAST_SPECIAL] range. + */ + if (scno >= 0x000f0000 && + scno <= 0x000f0000 + ARM_LAST_SPECIAL_SYSCALL) { + return scno - 0x000f0000 + ARM_SECOND_SHUFFLED_SYSCALL; + } + if (scno <= ARM_SECOND_SHUFFLED_SYSCALL + ARM_LAST_SPECIAL_SYSCALL) { + return scno + 0x000f0000 - ARM_SECOND_SHUFFLED_SYSCALL; + } + + return scno; +} diff --git a/linux/arm/syscallent.h b/linux/arm/syscallent.h index 23e57f63..065e79f3 100644 --- a/linux/arm/syscallent.h +++ b/linux/arm/syscallent.h @@ -1,29 +1,10 @@ /* * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995 Rick Sladkey + * Copyright (c) 1995-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ [ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, @@ -44,17 +25,17 @@ [ 15] = { 2, TF, SEN(chmod), "chmod" }, [ 16] = { 3, TF, SEN(chown16), "lchown" }, [ 17] = { 0, TM, SEN(break), "break" }, -[ 18] = { 2, TF, SEN(oldstat), "oldstat" }, +[ 18] = { 2, TF|TST|TSTA, SEN(oldstat), "oldstat" }, [ 19] = { 3, TD, SEN(lseek), "lseek" }, -[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 20] = { 0, PU|NF, SEN(getpid), "getpid" }, [ 21] = { 5, TF, SEN(mount), "mount" }, [ 22] = { 1, TF, SEN(umount), "umount" }, [ 23] = { 1, 0, SEN(setuid16), "setuid" }, -[ 24] = { 0, NF, SEN(getuid16), "getuid" }, +[ 24] = { 0, PU|NF, SEN(getuid16), "getuid" }, [ 25] = { 1, 0, SEN(stime), "stime" }, [ 26] = { 4, 0, SEN(ptrace), "ptrace" }, [ 27] = { 1, 0, SEN(alarm), "alarm" }, -[ 28] = { 2, TD, SEN(oldfstat), "oldfstat" }, +[ 28] = { 2, TD|TFST|TSTA, SEN(oldfstat), "oldfstat" }, [ 29] = { 0, TS, SEN(pause), "pause" }, [ 30] = { 2, TF, SEN(utime), "utime" }, [ 31] = { 2, 0, SEN(stty), "stty" }, @@ -73,10 +54,10 @@ [ 44] = { 0, 0, SEN(prof), "prof" }, [ 45] = { 1, TM|SI, SEN(brk), "brk" }, [ 46] = { 1, 0, SEN(setgid16), "setgid" }, -[ 47] = { 0, NF, SEN(getgid16), "getgid" }, +[ 47] = { 0, PU|NF, SEN(getgid16), "getgid" }, [ 48] = { 2, TS, SEN(signal), "signal" }, -[ 49] = { 0, NF, SEN(geteuid16), "geteuid" }, -[ 50] = { 0, NF, SEN(getegid16), "getegid" }, +[ 49] = { 0, PU|NF, SEN(geteuid16), "geteuid" }, +[ 50] = { 0, PU|NF, SEN(getegid16), "getegid" }, [ 51] = { 1, TF, SEN(acct), "acct" }, [ 52] = { 2, TF, SEN(umount2), "umount2" }, [ 53] = { 0, 0, SEN(lock), "lock" }, @@ -88,14 +69,14 @@ [ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, [ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, -[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 62] = { 2, TSFA, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, -[ 64] = { 0, NF, SEN(getppid), "getppid" }, -[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 64] = { 0, PU|NF, SEN(getppid), "getppid" }, +[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, [ 66] = { 0, 0, SEN(setsid), "setsid" }, [ 67] = { 3, TS, SEN(sigaction), "sigaction" }, -[ 68] = { 0, TS, SEN(siggetmask), "sgetmask" }, -[ 69] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[ 68] = { 0, TS, SEN(sgetmask), "sgetmask" }, +[ 69] = { 1, TS, SEN(ssetmask), "ssetmask" }, [ 70] = { 2, 0, SEN(setreuid16), "setreuid" }, [ 71] = { 2, 0, SEN(setregid16), "setregid" }, [ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, @@ -110,7 +91,7 @@ [ 81] = { 2, 0, SEN(setgroups16), "setgroups" }, [ 82] = { 1, TD, SEN(oldselect), "select" }, [ 83] = { 2, TF, SEN(symlink), "symlink" }, -[ 84] = { 2, TF, SEN(oldlstat), "oldlstat" }, +[ 84] = { 2, TF|TLST|TSTA, SEN(oldlstat), "oldlstat" }, [ 85] = { 3, TF, SEN(readlink), "readlink" }, [ 86] = { 1, TF, SEN(uselib), "uselib" }, [ 87] = { 2, TF, SEN(swapon), "swapon" }, @@ -125,16 +106,16 @@ [ 96] = { 2, 0, SEN(getpriority), "getpriority" }, [ 97] = { 3, 0, SEN(setpriority), "setpriority" }, [ 98] = { 4, 0, SEN(profil), "profil" }, -[ 99] = { 2, TF, SEN(statfs), "statfs" }, -[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, [101] = { 3, 0, SEN(ioperm), "ioperm" }, [102] = { 2, TD, SEN(socketcall), "socketcall" }, [103] = { 3, 0, SEN(syslog), "syslog" }, [104] = { 3, 0, SEN(setitimer), "setitimer" }, [105] = { 2, 0, SEN(getitimer), "getitimer" }, -[106] = { 2, TF, SEN(stat), "stat" }, -[107] = { 2, TF, SEN(lstat), "lstat" }, -[108] = { 2, TD, SEN(fstat), "fstat" }, +[106] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, +[107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, +[108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, [109] = { 1, 0, SEN(olduname), "olduname" }, [110] = { 1, 0, SEN(iopl), "iopl" }, [111] = { 0, 0, SEN(vhangup), "vhangup" }, @@ -150,7 +131,7 @@ [121] = { 2, 0, SEN(setdomainname), "setdomainname" }, [122] = { 1, 0, SEN(uname), "uname" }, [123] = { 3, 0, SEN(modify_ldt), "modify_ldt" }, -[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[124] = { 1, 0, SEN(adjtimex32), "adjtimex" }, [125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, [126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, [127] = { 2, 0, SEN(create_module), "create_module" }, @@ -187,14 +168,14 @@ [158] = { 0, 0, SEN(sched_yield), "sched_yield" }, [159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, -[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[161] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"}, +[162] = { 2, 0, SEN(nanosleep_time32), "nanosleep" }, [163] = { 5, TM|SI, SEN(mremap), "mremap" }, [164] = { 3, 0, SEN(setresuid16), "setresuid" }, [165] = { 3, 0, SEN(getresuid16), "getresuid" }, [166] = { 5, 0, SEN(vm86), "vm86" }, [167] = { 5, 0, SEN(query_module), "query_module" }, -[168] = { 3, TD, SEN(poll), "poll" }, +[168] = { 3, TD, SEN(poll_time32), "poll" }, [169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, [170] = { 3, 0, SEN(setresgid16), "setresgid" }, [171] = { 3, 0, SEN(getresgid16), "getresgid" }, @@ -203,7 +184,7 @@ [174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, [175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, [176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[177] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[177] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" }, [178] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, [179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, [180] = { 6, TD, SEN(pread), "pread64" }, @@ -221,14 +202,14 @@ [192] = { 6, TD|TM|SI, SEN(mmap_4koff), "mmap2" }, [193] = { 4, TF, SEN(truncate64), "truncate64" }, [194] = { 4, TD, SEN(ftruncate64), "ftruncate64" }, -[195] = { 2, TF, SEN(stat64), "stat64" }, -[196] = { 2, TF, SEN(lstat64), "lstat64" }, -[197] = { 2, TD, SEN(fstat64), "fstat64" }, +[195] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" }, +[196] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" }, +[197] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" }, [198] = { 3, TF, SEN(chown), "lchown32" }, -[199] = { 0, NF, SEN(getuid), "getuid32" }, -[200] = { 0, NF, SEN(getgid), "getgid32" }, -[201] = { 0, NF, SEN(geteuid), "geteuid32" }, -[202] = { 0, NF, SEN(geteuid), "getegid32" }, +[199] = { 0, PU|NF, SEN(getuid), "getuid32" }, +[200] = { 0, PU|NF, SEN(getgid), "getgid32" }, +[201] = { 0, PU|NF, SEN(geteuid), "geteuid32" }, +[202] = { 0, PU|NF, SEN(geteuid), "getegid32" }, [203] = { 2, 0, SEN(setreuid), "setreuid32" }, [204] = { 2, 0, SEN(setregid), "setregid32" }, [205] = { 2, 0, SEN(getgroups), "getgroups32" }, @@ -248,8 +229,9 @@ [219] = { 3, TM, SEN(mincore), "mincore" }, [220] = { 3, TM, SEN(madvise), "madvise" }, [221] = { 3, TD, SEN(fcntl64), "fcntl64" }, -[222 ... 223] = { }, -[224] = { 0, NF, SEN(gettid), "gettid" }, +/* [222] - tux */ +/* [223] - unused */ +[224] = { 0, PU|NF, SEN(gettid), "gettid" }, [225] = { 5, TD, SEN(readahead), "readahead" }, [226] = { 5, TF, SEN(setxattr), "setxattr" }, [227] = { 5, TF, SEN(setxattr), "lsetxattr" }, @@ -265,12 +247,12 @@ [237] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [238] = { 2, TS, SEN(kill), "tkill" }, [239] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, -[240] = { 6, 0, SEN(futex), "futex" }, +[240] = { 6, 0, SEN(futex_time32), "futex" }, [241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [243] = { 2, TM, SEN(io_setup), "io_setup" }, [244] = { 1, TM, SEN(io_destroy), "io_destroy" }, -[245] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[245] = { 5, 0, SEN(io_getevents_time32), "io_getevents" }, [246] = { 3, 0, SEN(io_submit), "io_submit" }, [247] = { 3, 0, SEN(io_cancel), "io_cancel" }, [248] = { 1, TP|SE, SEN(exit), "exit_group" }, @@ -279,31 +261,32 @@ [251] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, [252] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, [253] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, -[254 ... 255] = { }, +/* [254] - set_thread_area */ +/* [255] - get_thread_area */ [256] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [257] = { 3, 0, SEN(timer_create), "timer_create" }, -[258] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[259] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[258] = { 4, 0, SEN(timer_settime32), "timer_settime" }, +[259] = { 2, 0, SEN(timer_gettime32), "timer_gettime" }, [260] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, [261] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[262] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[263] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[264] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[265] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, -[266] = { 3, TF, SEN(statfs64), "statfs64" }, -[267] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[262] = { 2, 0, SEN(clock_settime32), "clock_settime" }, +[263] = { 2, 0, SEN(clock_gettime32), "clock_gettime" }, +[264] = { 2, 0, SEN(clock_getres_time32), "clock_getres" }, +[265] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" }, +[266] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, +[267] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, [268] = { 3, TS, SEN(tgkill), "tgkill" }, [269] = { 2, TF, SEN(utimes), "utimes" }, [270] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, [271] = { 3, 0, SEN(printargs), "pciconfig_iobase" }, [272] = { 5, 0, SEN(printargs), "pciconfig_read" }, [273] = { 5, 0, SEN(printargs), "pciconfig_write" }, -[274] = { 4, 0, SEN(mq_open), "mq_open" }, +[274] = { 4, TD, SEN(mq_open), "mq_open" }, [275] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[276] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[277] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[278] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[279] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[276] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" }, +[277] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" }, +[278] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[279] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, [280] = { 5, TP, SEN(waitid), "waitid" }, [281] = { 3, TN, SEN(socket), "socket" }, [282] = { 3, TN, SEN(bind), "bind" }, @@ -336,12 +319,12 @@ [309] = { 5, 0, SEN(add_key), "add_key" }, [310] = { 4, 0, SEN(request_key), "request_key" }, [311] = { 5, 0, SEN(keyctl), "keyctl" }, -[312] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[312] = { 4, TI, SEN(semtimedop_time32), "semtimedop" }, [313] = { 5, 0, SEN(vserver), "vserver" }, [314] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, [315] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, [316] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[317] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[317] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, [318] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, [319] = { 6, TM, SEN(mbind), "mbind" }, [320] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, @@ -351,7 +334,7 @@ [324] = { 4, TD|TF, SEN(mknodat), "mknodat" }, [325] = { 5, TD|TF, SEN(fchownat), "fchownat" }, [326] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[327] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[327] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" }, [328] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, [329] = { 4, TD|TF, SEN(renameat), "renameat" }, [330] = { 5, TD|TF, SEN(linkat), "linkat" }, @@ -359,8 +342,8 @@ [332] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, [333] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, [334] = { 3, TD|TF, SEN(faccessat), "faccessat" }, -[335] = { 6, TD, SEN(pselect6), "pselect6" }, -[336] = { 5, TD, SEN(ppoll), "ppoll" }, +[335] = { 6, TD, SEN(pselect6_time32), "pselect6" }, +[336] = { 5, TD, SEN(ppoll_time32), "ppoll" }, [337] = { 1, TP, SEN(unshare), "unshare" }, [338] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, [339] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, @@ -372,13 +355,13 @@ [345] = { 3, 0, SEN(getcpu), "getcpu" }, [346] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, [347] = { 4, 0, SEN(kexec_load), "kexec_load" }, -[348] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[348] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [349] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [350] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [351] = { 1, TD, SEN(eventfd), "eventfd" }, [352] = { 6, TD, SEN(fallocate), "fallocate" }, -[353] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, -[354] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[353] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" }, +[354] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" }, [355] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, [356] = { 2, TD, SEN(eventfd2), "eventfd2" }, [357] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, @@ -389,14 +372,14 @@ [362] = { 5, TD, SEN(pwritev), "pwritev" }, [363] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, [364] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, -[365] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[365] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" }, [366] = { 4, TN, SEN(accept4), "accept4" }, [367] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, [368] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, [369] = { 4, 0, SEN(prlimit64), "prlimit64" }, [370] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, [371] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[372] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[372] = { 2, 0, SEN(clock_adjtime32), "clock_adjtime" }, [373] = { 1, TD, SEN(syncfs), "syncfs" }, [374] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, [375] = { 2, TD, SEN(setns), "setns" }, @@ -421,12 +404,42 @@ [394] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, [395] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, [396] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[397] = { 5, TD|TF|TSTA, SEN(statx), "statx" }, +[398] = { 4, 0, SEN(rseq), "rseq" }, +[399] = { 6, 0, SEN(io_pgetevents_time32), "io_pgetevents" }, +[400] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[401] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" }, +/* [402] - unused */ +[403] = { 2, 0, SEN(clock_gettime64), "clock_gettime64" }, +[404] = { 2, 0, SEN(clock_settime64), "clock_settime64" }, +[405] = { 2, 0, SEN(clock_adjtime64), "clock_adjtime64" }, +[406] = { 2, 0, SEN(clock_getres_time64), "clock_getres_time64" }, +[407] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep_time64"}, +[408] = { 2, 0, SEN(timer_gettime64), "timer_gettime64" }, +[409] = { 4, 0, SEN(timer_settime64), "timer_settime64" }, +[410] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime64" }, +[411] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime64" }, +[412] = { 4, TD|TF, SEN(utimensat_time64), "utimensat_time64" }, +[413] = { 6, TD, SEN(pselect6_time64), "pselect6_time64" }, +[414] = { 5, TD, SEN(ppoll_time64), "ppoll_time64" }, +[416] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents_time64" }, +[417] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg_time64" }, +[418] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend_time64" }, +[419] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive_time64"}, +[420] = { 4, TI, SEN(semtimedop_time64), "semtimedop_time64" }, +[421] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait_time64"}, +[422] = { 6, 0, SEN(futex_time64), "futex_time64" }, +[423] = { 2, 0, SEN(sched_rr_get_interval_time64), "sched_rr_get_interval_time64" }, +[424] = { 4, TD|TS, SEN(pidfd_send_signal), "pidfd_send_signal" }, +[425] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" }, +[426] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" }, +[427] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" }, #ifdef __ARM_EABI__ -# define ARM_FIRST_SHUFFLED_SYSCALL 400 +# define ARM_FIRST_SHUFFLED_SYSCALL 500 #else -# define SYS_socket_subcall 400 -# include "subcall.h" +# define SYS_socket_subcall 500 +# include "subcall32.h" # define ARM_FIRST_SHUFFLED_SYSCALL (SYS_ipc_subcall + SYS_ipc_nsubcalls) #endif /* !__ARM_EABI__ */ @@ -434,6 +447,7 @@ * __ARM_NR_cmpxchg (0x000ffff0). * Remapped by shuffle_scno() to be directly after ordinary syscalls * in this table. + * Removed in v4.4-rc1~163^2^3~13. */ [ARM_FIRST_SHUFFLED_SYSCALL ] = { 5, 0, SEN(printargs), "cmpxchg" }, @@ -442,9 +456,10 @@ * Remapped by shuffle_scno() to be directly after __ARM_NR_cmpxchg. */ [ARM_FIRST_SHUFFLED_SYSCALL+1+0] = { }, -[ARM_FIRST_SHUFFLED_SYSCALL+1+1] = { 5, 0, SEN(printargs), "breakpoint" }, -[ARM_FIRST_SHUFFLED_SYSCALL+1+2] = { 5, 0, SEN(printargs), "cacheflush" }, -[ARM_FIRST_SHUFFLED_SYSCALL+1+3] = { 5, 0, SEN(printargs), "usr26" }, -[ARM_FIRST_SHUFFLED_SYSCALL+1+4] = { 5, 0, SEN(printargs), "usr32" }, -[ARM_FIRST_SHUFFLED_SYSCALL+1+5] = { 5, 0, SEN(printargs), "set_tls" }, -#define ARM_LAST_SPECIAL_SYSCALL 5 +[ARM_FIRST_SHUFFLED_SYSCALL+1+1] = { 0, 0, SEN(printargs), "breakpoint" }, +[ARM_FIRST_SHUFFLED_SYSCALL+1+2] = { 3, TM, SEN(printargs), "cacheflush" }, +[ARM_FIRST_SHUFFLED_SYSCALL+1+3] = { 0, 0, SEN(printargs), "usr26" }, +[ARM_FIRST_SHUFFLED_SYSCALL+1+4] = { 0, 0, SEN(printargs), "usr32" }, +[ARM_FIRST_SHUFFLED_SYSCALL+1+5] = { 1, 0, SEN(printargs), "set_tls" }, +[ARM_FIRST_SHUFFLED_SYSCALL+1+6] = { 0, PU|NF, SEN(printargs), "get_tls" }, +#define ARM_LAST_SPECIAL_SYSCALL 6 diff --git a/linux/arm/userent.h b/linux/arm/userent.h index bd36a6fa..a3555def 100644 --- a/linux/arm/userent.h +++ b/linux/arm/userent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + { uoff(regs.ARM_r0), "r0" }, { uoff(regs.ARM_r1), "r1" }, { uoff(regs.ARM_r2), "r2" }, diff --git a/linux/asm_stat.h b/linux/asm_stat.h index a9266020..b3510a5d 100644 --- a/linux/asm_stat.h +++ b/linux/asm_stat.h @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #ifndef STRACE_ASM_STAT_H -#define STRACE_ASM_STAT_H +# define STRACE_ASM_STAT_H # undef dev_t # undef gid_t diff --git a/linux/avr32/arch_regs.c b/linux/avr32/arch_regs.c index 8b52a8d0..f3d60dac 100644 --- a/linux/avr32/arch_regs.c +++ b/linux/avr32/arch_regs.c @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static struct pt_regs avr32_regs; #define ARCH_REGS_FOR_GETREGS avr32_regs #define ARCH_PC_REG avr32_regs.pc +#define ARCH_SP_REG avr32_regs.sp diff --git a/linux/avr32/get_error.c b/linux/avr32/get_error.c index 75e7f67f..bd1013f1 100644 --- a/linux/avr32/get_error.c +++ b/linux/avr32/get_error.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "negated_errno.h" + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { if (check_errno && is_negated_errno(avr32_regs.r12)) { tcp->u_rval = -1; diff --git a/linux/avr32/get_scno.c b/linux/avr32/get_scno.c index 092dad30..22ace6f4 100644 --- a/linux/avr32/get_scno.c +++ b/linux/avr32/get_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) diff --git a/linux/avr32/get_syscall_args.c b/linux/avr32/get_syscall_args.c index e8c41198..796b68a8 100644 --- a/linux/avr32/get_syscall_args.c +++ b/linux/avr32/get_syscall_args.c @@ -1,6 +1,13 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { tcp->u_arg[0] = avr32_regs.r12; tcp->u_arg[1] = avr32_regs.r11; diff --git a/linux/avr32/raw_syscall.h b/linux/avr32/raw_syscall.h new file mode 100644 index 00000000..518adb11 --- /dev/null +++ b/linux/avr32/raw_syscall.h @@ -0,0 +1,29 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + *err = 0; + register kernel_ulong_t r8 __asm__("r8") = nr; + register kernel_ulong_t r12 __asm__("r12"); + __asm__ __volatile__("scall" + : "=r"(r12) + : "r"(r8) + : "memory", "cc"); + return r12; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/avr32/set_error.c b/linux/avr32/set_error.c index f4ef41d6..5b7137c7 100644 --- a/linux/avr32/set_error.c +++ b/linux/avr32/set_error.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_error(struct tcb *tcp) { diff --git a/linux/avr32/set_scno.c b/linux/avr32/set_scno.c index 66c4db7e..da218f4a 100644 --- a/linux/avr32/set_scno.c +++ b/linux/avr32/set_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { diff --git a/linux/avr32/syscallent.h b/linux/avr32/syscallent.h index d18902f1..81d18d6b 100644 --- a/linux/avr32/syscallent.h +++ b/linux/avr32/syscallent.h @@ -1,28 +1,9 @@ /* * Copyright (c) 2004-2009 Atmel Corporation + * Copyright (c) 2009-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ [ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, @@ -45,19 +26,19 @@ [ 17] = { 3, TF, SEN(chown), "lchown" }, [ 18] = { 3, TD, SEN(lseek), "lseek" }, [ 19] = { 5, TD, SEN(llseek), "_llseek" }, -[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 20] = { 0, PU|NF, SEN(getpid), "getpid" }, [ 21] = { 5, TF, SEN(mount), "mount" }, [ 22] = { 1, TF, SEN(umount2), "umount2" }, [ 23] = { 1, 0, SEN(setuid), "setuid" }, -[ 24] = { 0, NF, SEN(getuid), "getuid" }, +[ 24] = { 0, PU|NF, SEN(getuid), "getuid" }, [ 25] = { 1, 0, SEN(stime), "stime" }, [ 26] = { 4, 0, SEN(ptrace), "ptrace" }, [ 27] = { 1, 0, SEN(alarm), "alarm" }, [ 28] = { 0, TS, SEN(pause), "pause" }, [ 29] = { 2, TF, SEN(utime), "utime" }, -[ 30] = { 2, TF, SEN(stat), "stat" }, -[ 31] = { 2, TD, SEN(fstat), "fstat" }, -[ 32] = { 2, TF, SEN(lstat), "lstat" }, +[ 30] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, +[ 31] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, +[ 32] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, [ 33] = { 2, TF, SEN(access), "access" }, [ 34] = { 1, TF, SEN(chroot), "chroot" }, [ 35] = { 0, 0, SEN(sync), "sync" }, @@ -72,10 +53,10 @@ [ 44] = { 5, TP, SEN(clone), "clone" }, [ 45] = { 1, TM|SI, SEN(brk), "brk" }, [ 46] = { 1, 0, SEN(setgid), "setgid" }, -[ 47] = { 0, NF, SEN(getgid), "getgid" }, +[ 47] = { 0, PU|NF, SEN(getgid), "getgid" }, [ 48] = { 2, TF, SEN(getcwd), "getcwd" }, -[ 49] = { 0, NF, SEN(geteuid), "geteuid" }, -[ 50] = { 0, NF, SEN(getegid), "getegid" }, +[ 49] = { 0, PU|NF, SEN(geteuid), "geteuid" }, +[ 50] = { 0, PU|NF, SEN(getegid), "getegid" }, [ 51] = { 1, TF, SEN(acct), "acct" }, [ 52] = { 1, NF, SEN(setfsuid), "setfsuid" }, [ 53] = { 1, NF, SEN(setfsgid), "setfsgid" }, @@ -87,16 +68,16 @@ [ 59] = { 3, 0, SEN(getresuid), "getresuid" }, [ 60] = { 2, 0, SEN(setreuid), "setreuid" }, [ 61] = { 2, 0, SEN(setregid), "setregid" }, -[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 62] = { 2, TSFA, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, -[ 64] = { 0, NF, SEN(getppid), "getppid" }, -[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 64] = { 0, PU|NF, SEN(getppid), "getppid" }, +[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, [ 66] = { 0, 0, SEN(setsid), "setsid" }, [ 67] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, [ 68] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, [ 69] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, [ 70] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[ 71] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[ 71] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" }, [ 72] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, [ 73] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, [ 74] = { 2, 0, SEN(sethostname), "sethostname" }, @@ -124,8 +105,8 @@ [ 96] = { 2, 0, SEN(getpriority), "getpriority" }, [ 97] = { 3, 0, SEN(setpriority), "setpriority" }, [ 98] = { 4, TP, SEN(wait4), "wait4" }, -[ 99] = { 2, TF, SEN(statfs), "statfs" }, -[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, [101] = { 0, 0, SEN(vhangup), "vhangup" }, [102] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, [103] = { 3, 0, SEN(syslog), "syslog" }, @@ -137,7 +118,7 @@ [109] = { 4, TD|TN, SEN(sendfile), "sendfile" }, [110] = { 2, 0, SEN(setdomainname), "setdomainname" }, [111] = { 1, 0, SEN(uname), "uname" }, -[112] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[112] = { 1, 0, SEN(adjtimex32), "adjtimex" }, [113] = { 3, TM|SI, SEN(mprotect), "mprotect" }, [114] = { 0, TP, SEN(vfork), "vfork" }, [115] = { 3, 0, SEN(init_module), "init_module" }, @@ -167,9 +148,9 @@ [139] = { 0, 0, SEN(sched_yield), "sched_yield" }, [140] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [141] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[142] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, -[143] = { 2, 0, SEN(nanosleep), "nanosleep" }, -[144] = { 3, TD, SEN(poll), "poll" }, +[142] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"}, +[143] = { 2, 0, SEN(nanosleep_time32), "nanosleep" }, +[144] = { 3, TD, SEN(poll_time32), "poll" }, [145] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, [146] = { 3, 0, SEN(setresgid), "setresgid" }, [147] = { 3, 0, SEN(getresgid), "getresgid" }, @@ -193,15 +174,15 @@ [165] = { 3, TN, SEN(recvmsg), "recvmsg" }, [166] = { 3, TF, SEN(truncate64), "truncate64" }, [167] = { 3, TD, SEN(ftruncate64), "ftruncate64" }, -[168] = { 2, TF, SEN(stat64), "stat64" }, -[169] = { 2, TF, SEN(lstat64), "lstat64" }, -[170] = { 2, TD, SEN(fstat64), "fstat64" }, +[168] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" }, +[169] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" }, +[170] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" }, [171] = { 2, TF, SEN(pivotroot), "pivot_root" }, [172] = { 3, TM, SEN(mincore), "mincore" }, [173] = { 3, TM, SEN(madvise), "madvise" }, [174] = { 3, TD, SEN(getdents64), "getdents64" }, [175] = { 3, TD, SEN(fcntl64), "fcntl64" }, -[176] = { 0, NF, SEN(gettid), "gettid" }, +[176] = { 0, PU|NF, SEN(gettid), "gettid" }, [177] = { 4, TD, SEN(readahead), "readahead" }, [178] = { 5, TF, SEN(setxattr), "setxattr" }, [179] = { 5, TF, SEN(setxattr), "lsetxattr" }, @@ -217,14 +198,14 @@ [189] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [190] = { 2, TS, SEN(kill), "tkill" }, [191] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, -[192] = { 6, 0, SEN(futex), "futex" }, +[192] = { 6, 0, SEN(futex_time32), "futex" }, [193] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [194] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [195] = { 2, 0, SEN(capget), "capget" }, [196] = { 2, 0, SEN(capset), "capset" }, [197] = { 2, TM, SEN(io_setup), "io_setup" }, [198] = { 1, TM, SEN(io_destroy), "io_destroy" }, -[199] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[199] = { 5, 0, SEN(io_getevents_time32), "io_getevents" }, [200] = { 3, 0, SEN(io_submit), "io_submit" }, [201] = { 3, 0, SEN(io_cancel), "io_cancel" }, [202] = { 5, TD, SEN(fadvise64), "fadvise64" }, @@ -236,28 +217,28 @@ [208] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, [209] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [210] = { 3, 0, SEN(timer_create), "timer_create" }, -[211] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[212] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[211] = { 4, 0, SEN(timer_settime32), "timer_settime" }, +[212] = { 2, 0, SEN(timer_gettime32), "timer_gettime" }, [213] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, [214] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[215] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[216] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[217] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[218] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, -[219] = { 3, TF, SEN(statfs64), "statfs64" }, -[220] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[215] = { 2, 0, SEN(clock_settime32), "clock_settime" }, +[216] = { 2, 0, SEN(clock_gettime32), "clock_gettime" }, +[217] = { 2, 0, SEN(clock_getres_time32), "clock_getres" }, +[218] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" }, +[219] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, +[220] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, [221] = { 3, TS, SEN(tgkill), "tgkill" }, [222] = { }, [223] = { 2, TF, SEN(utimes), "utimes" }, [224] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, [225] = { 3, 0, SEN(printargs), "cacheflush" }, [226] = { 5, 0, SEN(vserver), "vserver" }, -[227] = { 4, 0, SEN(mq_open), "mq_open" }, +[227] = { 4, TD, SEN(mq_open), "mq_open" }, [228] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[229] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[230] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[231] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[232] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[229] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" }, +[230] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" }, +[231] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[232] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, [233] = { 4, 0, SEN(kexec_load), "kexec_load" }, [234] = { 5, TP, SEN(waitid), "waitid" }, [235] = { 5, 0, SEN(add_key), "add_key" }, @@ -266,14 +247,14 @@ [238] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, [239] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, [240] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[241] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[241] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, [242] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, [243] = { 4, TD|TF, SEN(openat), "openat" }, [244] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, [245] = { 4, TD|TF, SEN(mknodat), "mknodat" }, [246] = { 5, TD|TF, SEN(fchownat), "fchownat" }, [247] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[248] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[248] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" }, [249] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, [250] = { 4, TD|TF, SEN(renameat), "renameat" }, [251] = { 5, TD|TF, SEN(linkat), "linkat" }, @@ -281,8 +262,8 @@ [253] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, [254] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, [255] = { 3, TD|TF, SEN(faccessat), "faccessat" }, -[256] = { 6, TD, SEN(pselect6), "pselect6" }, -[257] = { 5, TD, SEN(ppoll), "ppoll" }, +[256] = { 6, TD, SEN(pselect6_time32), "pselect6" }, +[257] = { 5, TD, SEN(ppoll_time32), "ppoll" }, [258] = { 1, TP, SEN(unshare), "unshare" }, [259] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, [260] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, @@ -298,12 +279,12 @@ [270] = { 3, TI, SEN(semget), "semget" }, [271] = { 3, TI, SEN(semop), "semop" }, [272] = { 4, TI, SEN(semctl), "semctl" }, -[273] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[273] = { 4, TI, SEN(semtimedop_time32), "semtimedop" }, [274] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, [275] = { 3, TI, SEN(shmget), "shmget" }, [276] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, [277] = { 3, TI, SEN(shmctl), "shmctl" }, -[278] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[278] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [279] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [280] = { 4, TD, SEN(timerfd), "timerfd" }, [281] = { 1, TD, SEN(eventfd), "eventfd" }, @@ -313,8 +294,8 @@ [285] = { 5, TD, SEN(pwrite), "pwrite64" }, [286] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [287] = { 6, TD, SEN(fallocate), "fallocate" }, -[288] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, -[289] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[288] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" }, +[289] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" }, [290] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, [291] = { 2, TD, SEN(eventfd2), "eventfd2" }, [292] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, @@ -325,13 +306,13 @@ [297] = { 5, TD, SEN(pwritev), "pwritev" }, [298] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, [299] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, -[300] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[300] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" }, [301] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, [302] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, [303] = { 4, 0, SEN(prlimit64), "prlimit64" }, [304] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, [305] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[306] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[306] = { 2, 0, SEN(clock_adjtime32), "clock_adjtime" }, [307] = { 1, TD, SEN(syncfs), "syncfs" }, [308] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, [309] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, diff --git a/linux/avr32/userent.h b/linux/avr32/userent.h index 4fbfc142..b1b52fe5 100644 --- a/linux/avr32/userent.h +++ b/linux/avr32/userent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + { uoff(regs.sr), "sr" }, { uoff(regs.pc), "pc" }, { uoff(regs.lr), "lr" }, diff --git a/linux/bfin/arch_defs_.h b/linux/bfin/arch_defs_.h new file mode 100644 index 00000000..309d8e7e --- /dev/null +++ b/linux/bfin/arch_defs_.h @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define HAVE_ARCH_OLD_SELECT 1 +#define HAVE_ARCH_UID16_SYSCALLS 1 diff --git a/linux/bfin/arch_regs.c b/linux/bfin/arch_regs.c index ea76cb98..426e589c 100644 --- a/linux/bfin/arch_regs.c +++ b/linux/bfin/arch_regs.c @@ -1,2 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static unsigned long bfin_r0; #define ARCH_PC_PEEK_ADDR PT_PC +#define ARCH_SP_PEEK_ADDR PT_USP diff --git a/linux/bfin/get_error.c b/linux/bfin/get_error.c index 80aeb377..2d1059a1 100644 --- a/linux/bfin/get_error.c +++ b/linux/bfin/get_error.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "negated_errno.h" + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { if (check_errno && is_negated_errno(bfin_r0)) { tcp->u_rval = -1; diff --git a/linux/bfin/get_scno.c b/linux/bfin/get_scno.c index 8c3a7d21..6968e480 100644 --- a/linux/bfin/get_scno.c +++ b/linux/bfin/get_scno.c @@ -1,6 +1,13 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) { - return upeek(tcp->pid, PT_ORIG_P0, &tcp->scno) < 0 ? -1 : 1; + return upeek(tcp, PT_ORIG_P0, &tcp->scno) < 0 ? -1 : 1; } diff --git a/linux/bfin/get_syscall_args.c b/linux/bfin/get_syscall_args.c index 13d58bd7..c0eb7a5b 100644 --- a/linux/bfin/get_syscall_args.c +++ b/linux/bfin/get_syscall_args.c @@ -1,13 +1,21 @@ +/* + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { - static const int argreg[MAX_ARGS] = - { PT_R0, PT_R1, PT_R2, PT_R3, PT_R4, PT_R5 }; + static const int argreg[MAX_ARGS] = { + PT_R0, PT_R1, PT_R2, PT_R3, PT_R4, PT_R5 + }; unsigned int i; - for (i = 0; i < tcp->s_ent->nargs; ++i) - if (upeek(tcp->pid, argreg[i], &tcp->u_arg[i]) < 0) + for (i = 0; i < n_args(tcp); ++i) + if (upeek(tcp, argreg[i], &tcp->u_arg[i]) < 0) return -1; return 1; } diff --git a/linux/bfin/get_syscall_result.c b/linux/bfin/get_syscall_result.c index c189a5fd..923542f9 100644 --- a/linux/bfin/get_syscall_result.c +++ b/linux/bfin/get_syscall_result.c @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int get_syscall_result_regs(struct tcb *tcp) { - return upeek(tcp->pid, PT_R0, &bfin_r0) < 0 ? -1 : 0; + return upeek(tcp, PT_R0, &bfin_r0) < 0 ? -1 : 0; } diff --git a/linux/bfin/raw_syscall.h b/linux/bfin/raw_syscall.h new file mode 100644 index 00000000..8ac705cc --- /dev/null +++ b/linux/bfin/raw_syscall.h @@ -0,0 +1,28 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + *err = 0; + register kernel_ulong_t ret; + __asm__ __volatile__("excpt 0" + : "=q0"(ret) + : "qA"(nr) + : "memory", "cc"); + return ret; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/bfin/rt_sigframe.h b/linux/bfin/rt_sigframe.h new file mode 100644 index 00000000..fa2ca4b3 --- /dev/null +++ b/linux/bfin/rt_sigframe.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RT_SIGFRAME_H +# define STRACE_RT_SIGFRAME_H + +# include + +typedef struct { + int sig; + siginfo_t *pinfo; + void *puc; + char retcode[8]; + siginfo_t info; + ucontext_t uc; +} struct_rt_sigframe; + +#endif /* !STRACE_RT_SIGFRAME_H */ diff --git a/linux/bfin/set_error.c b/linux/bfin/set_error.c index 2bfecda0..c39cde27 100644 --- a/linux/bfin/set_error.c +++ b/linux/bfin/set_error.c @@ -1,13 +1,20 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_error(struct tcb *tcp) { bfin_r0 = -tcp->u_error; - return upoke(tcp->pid, PT_R0, bfin_r0); + return upoke(tcp, PT_R0, bfin_r0); } static int arch_set_success(struct tcb *tcp) { bfin_r0 = tcp->u_rval; - return upoke(tcp->pid, PT_R0, bfin_r0); + return upoke(tcp, PT_R0, bfin_r0); } diff --git a/linux/bfin/set_scno.c b/linux/bfin/set_scno.c index 4508be1a..00a325b4 100644 --- a/linux/bfin/set_scno.c +++ b/linux/bfin/set_scno.c @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { - return upoke(tcp->pid, PT_ORIG_P0, scno); + return upoke(tcp, PT_ORIG_P0, scno); } diff --git a/linux/bfin/syscallent.h b/linux/bfin/syscallent.h index f4b88716..8a3209d1 100644 --- a/linux/bfin/syscallent.h +++ b/linux/bfin/syscallent.h @@ -1,29 +1,10 @@ /* * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995 Rick Sladkey + * Copyright (c) 1995-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ [ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, @@ -44,17 +25,17 @@ [ 15] = { 2, TF, SEN(chmod), "chmod" }, [ 16] = { 3, TF, SEN(chown16), "chown" }, [ 17] = { 0, TM, SEN(break), "break" }, -[ 18] = { 2, TF, SEN(oldstat), "oldstat" }, +[ 18] = { 2, TF|TST|TSTA, SEN(oldstat), "oldstat" }, [ 19] = { 3, TD, SEN(lseek), "lseek" }, -[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 20] = { 0, PU|NF, SEN(getpid), "getpid" }, [ 21] = { 5, TF, SEN(mount), "mount" }, [ 22] = { 1, TF, SEN(umount), "umount" }, [ 23] = { 1, 0, SEN(setuid16), "setuid" }, -[ 24] = { 0, NF, SEN(getuid16), "getuid" }, +[ 24] = { 0, PU|NF, SEN(getuid16), "getuid" }, [ 25] = { 1, 0, SEN(stime), "stime" }, [ 26] = { 4, 0, SEN(ptrace), "ptrace" }, [ 27] = { 1, 0, SEN(alarm), "alarm" }, -[ 28] = { 2, TD, SEN(oldfstat), "oldfstat" }, +[ 28] = { 2, TD|TFST|TSTA, SEN(oldfstat), "oldfstat" }, [ 29] = { 0, TS, SEN(pause), "pause" }, [ 30] = { 2, TF, SEN(utime), "utime" }, [ 31] = { 2, 0, SEN(stty), "stty" }, @@ -73,10 +54,10 @@ [ 44] = { 0, 0, SEN(prof), "prof" }, [ 45] = { 1, TM|SI, SEN(brk), "brk" }, [ 46] = { 1, 0, SEN(setgid16), "setgid" }, -[ 47] = { 0, NF, SEN(getgid16), "getgid" }, +[ 47] = { 0, PU|NF, SEN(getgid16), "getgid" }, [ 48] = { 2, TS, SEN(signal), "signal" }, -[ 49] = { 0, NF, SEN(geteuid16), "geteuid" }, -[ 50] = { 0, NF, SEN(getegid16), "getegid" }, +[ 49] = { 0, PU|NF, SEN(geteuid16), "geteuid" }, +[ 50] = { 0, PU|NF, SEN(getegid16), "getegid" }, [ 51] = { 1, TF, SEN(acct), "acct" }, [ 52] = { 2, TF, SEN(umount2), "umount2" }, [ 53] = { 0, 0, SEN(lock), "lock" }, @@ -88,14 +69,14 @@ [ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, [ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, -[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 62] = { 2, TSFA, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, -[ 64] = { 0, NF, SEN(getppid), "getppid" }, -[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 64] = { 0, PU|NF, SEN(getppid), "getppid" }, +[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, [ 66] = { 0, 0, SEN(setsid), "setsid" }, [ 67] = { 3, TS, SEN(sigaction), "sigaction" }, -[ 68] = { 0, TS, SEN(siggetmask), "sgetmask" }, -[ 69] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[ 68] = { 0, TS, SEN(sgetmask), "sgetmask" }, +[ 69] = { 1, TS, SEN(ssetmask), "ssetmask" }, [ 70] = { 2, 0, SEN(setreuid16), "setreuid" }, [ 71] = { 2, 0, SEN(setregid16), "setregid" }, [ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, @@ -110,7 +91,7 @@ [ 81] = { 2, 0, SEN(setgroups16), "setgroups" }, [ 82] = { 1, TD, SEN(oldselect), "select" }, [ 83] = { 2, TF, SEN(symlink), "symlink" }, -[ 84] = { 2, TF, SEN(oldlstat), "oldlstat" }, +[ 84] = { 2, TF|TLST|TSTA, SEN(oldlstat), "oldlstat" }, [ 85] = { 3, TF, SEN(readlink), "readlink" }, [ 86] = { 1, TF, SEN(uselib), "uselib" }, [ 87] = { 2, TF, SEN(swapon), "swapon" }, @@ -125,16 +106,16 @@ [ 96] = { 2, 0, SEN(getpriority), "getpriority" }, [ 97] = { 3, 0, SEN(setpriority), "setpriority" }, [ 98] = { 4, 0, SEN(profil), "profil" }, -[ 99] = { 2, TF, SEN(statfs), "statfs" }, -[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, [101] = { 3, 0, SEN(ioperm), "ioperm" }, [102] = { 2, TD, SEN(socketcall), "socketcall" }, [103] = { 3, 0, SEN(syslog), "syslog" }, [104] = { 3, 0, SEN(setitimer), "setitimer" }, [105] = { 2, 0, SEN(getitimer), "getitimer" }, -[106] = { 2, TF, SEN(stat), "stat" }, -[107] = { 2, TF, SEN(lstat), "lstat" }, -[108] = { 2, TD, SEN(fstat), "fstat" }, +[106] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, +[107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, +[108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, [109] = { 1, 0, SEN(olduname), "olduname" }, [110] = { 1, 0, SEN(iopl), "iopl" }, [111] = { 0, 0, SEN(vhangup), "vhangup" }, @@ -150,7 +131,7 @@ [121] = { 2, 0, SEN(setdomainname), "setdomainname" }, [122] = { 1, 0, SEN(uname), "uname" }, [123] = { 3, 0, SEN(modify_ldt), "modify_ldt" }, -[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[124] = { 1, 0, SEN(adjtimex32), "adjtimex" }, [125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, [126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, [127] = { 2, 0, SEN(create_module), "create_module" }, @@ -187,14 +168,14 @@ [158] = { 0, 0, SEN(sched_yield), "sched_yield" }, [159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, -[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[161] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"}, +[162] = { 2, 0, SEN(nanosleep_time32), "nanosleep" }, [163] = { 5, TM|SI, SEN(mremap), "mremap" }, [164] = { 3, 0, SEN(setresuid16), "setresuid" }, [165] = { 3, 0, SEN(getresuid16), "getresuid" }, [166] = { 5, 0, SEN(vm86), "vm86" }, [167] = { 5, 0, SEN(query_module), "query_module" }, -[168] = { 3, TD, SEN(poll), "poll" }, +[168] = { 3, TD, SEN(poll_time32), "poll" }, [169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, [170] = { 3, 0, SEN(setresgid16), "setresgid" }, [171] = { 3, 0, SEN(getresgid16), "getresgid" }, @@ -203,7 +184,7 @@ [174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, [175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, [176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[177] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[177] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" }, [178] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, [179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, [180] = { 5, TD, SEN(pread), "pread" }, @@ -221,14 +202,14 @@ [192] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" }, [193] = { 3, TF, SEN(truncate64), "truncate64" }, [194] = { 3, TD, SEN(ftruncate64), "ftruncate64" }, -[195] = { 2, TF, SEN(stat64), "stat64" }, -[196] = { 2, TF, SEN(lstat64), "lstat64" }, -[197] = { 2, TD, SEN(fstat64), "fstat64" }, +[195] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" }, +[196] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" }, +[197] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" }, [198] = { 3, TF, SEN(chown), "chown32" }, -[199] = { 0, NF, SEN(getuid), "getuid32" }, -[200] = { 0, NF, SEN(getgid), "getgid32" }, -[201] = { 0, NF, SEN(geteuid), "geteuid32" }, -[202] = { 0, NF, SEN(geteuid), "getegid32" }, +[199] = { 0, PU|NF, SEN(getuid), "getuid32" }, +[200] = { 0, PU|NF, SEN(getgid), "getgid32" }, +[201] = { 0, PU|NF, SEN(geteuid), "geteuid32" }, +[202] = { 0, PU|NF, SEN(geteuid), "getegid32" }, [203] = { 2, 0, SEN(setreuid), "setreuid32" }, [204] = { 2, 0, SEN(setregid), "setregid32" }, [205] = { 2, 0, SEN(getgroups), "getgroups32" }, @@ -249,7 +230,7 @@ [220] = { 3, TD, SEN(getdents64), "getdents64" }, [221] = { 3, TD, SEN(fcntl64), "fcntl64" }, [222 ... 223] = { }, -[224] = { 0, NF, SEN(gettid), "gettid" }, +[224] = { 0, PU|NF, SEN(gettid), "gettid" }, [225] = { 4, TD, SEN(readahead), "readahead" }, [226] = { 5, TF, SEN(setxattr), "setxattr" }, [227] = { 5, TF, SEN(setxattr), "lsetxattr" }, @@ -265,14 +246,14 @@ [237] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [238] = { 2, TS, SEN(kill), "tkill" }, [239] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, -[240] = { 6, 0, SEN(futex), "futex" }, +[240] = { 6, 0, SEN(futex_time32), "futex" }, [241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [243] = { 1, 0, SEN(set_thread_area), "set_thread_area" }, [244] = { 1, 0, SEN(get_thread_area), "get_thread_area" }, [245] = { 2, TM, SEN(io_setup), "io_setup" }, [246] = { 1, TM, SEN(io_destroy), "io_destroy" }, -[247] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[247] = { 5, 0, SEN(io_getevents_time32), "io_getevents" }, [248] = { 3, 0, SEN(io_submit), "io_submit" }, [249] = { 3, 0, SEN(io_cancel), "io_cancel" }, [250] = { 5, 0, SEN(printargs), "alloc_hugepages" }, @@ -286,16 +267,16 @@ [258] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, [259] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [260] = { 3, 0, SEN(timer_create), "timer_create" }, -[261] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[262] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[261] = { 4, 0, SEN(timer_settime32), "timer_settime" }, +[262] = { 2, 0, SEN(timer_gettime32), "timer_gettime" }, [263] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, [264] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[265] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[266] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[267] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[268] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, -[269] = { 3, TF, SEN(statfs64), "statfs64" }, -[270] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[265] = { 2, 0, SEN(clock_settime32), "clock_settime" }, +[266] = { 2, 0, SEN(clock_gettime32), "clock_gettime" }, +[267] = { 2, 0, SEN(clock_getres_time32), "clock_getres" }, +[268] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" }, +[269] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, +[270] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, [271] = { 3, TS, SEN(tgkill), "tgkill" }, [272] = { 2, TF, SEN(utimes), "utimes" }, [273] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, @@ -303,12 +284,12 @@ [275] = { 6, TM, SEN(mbind), "mbind" }, [276] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, [277] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, -[278] = { 4, 0, SEN(mq_open), "mq_open" }, +[278] = { 4, TD, SEN(mq_open), "mq_open" }, [279] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[280] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[281] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[282] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[283] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[280] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" }, +[281] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" }, +[282] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[283] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, [284] = { 4, 0, SEN(kexec_load), "kexec_load" }, [285] = { 5, TP, SEN(waitid), "waitid" }, [286] = { 5, 0, SEN(add_key), "add_key" }, @@ -317,7 +298,7 @@ [289] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, [290] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, [291] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[292] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[292] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, [293] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, [294] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, [295] = { 4, TD|TF, SEN(openat), "openat" }, @@ -325,7 +306,7 @@ [297] = { 4, TD|TF, SEN(mknodat), "mknodat" }, [298] = { 5, TD|TF, SEN(fchownat), "fchownat" }, [299] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[300] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[300] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" }, [301] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, [302] = { 4, TD|TF, SEN(renameat), "renameat" }, [303] = { 5, TD|TF, SEN(linkat), "linkat" }, @@ -333,8 +314,8 @@ [305] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, [306] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, [307] = { 3, TD|TF, SEN(faccessat), "faccessat" }, -[308] = { 6, TD, SEN(pselect6), "pselect6" }, -[309] = { 5, TD, SEN(ppoll), "ppoll" }, +[308] = { 6, TD, SEN(pselect6_time32), "pselect6" }, +[309] = { 5, TD, SEN(ppoll_time32), "ppoll" }, [310] = { 1, TP, SEN(unshare), "unshare" }, [311] = { 2, 0, SEN(sram_alloc), "sram_alloc" }, [312] = { 1, 0, SEN(printargs), "sram_free" }, @@ -372,7 +353,7 @@ [344] = { 4, TD, SEN(tee), "tee" }, [345] = { 4, TD, SEN(vmsplice), "vmsplice" }, [346] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[347] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[347] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [348] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [349] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [350] = { 1, TD, SEN(eventfd), "eventfd" }, @@ -382,9 +363,9 @@ [354] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, [355] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, [356] = { 6, TD, SEN(fallocate), "fallocate" }, -[357] = { 4, TI, SEN(semtimedop), "semtimedop" }, -[358] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, -[359] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[357] = { 4, TI, SEN(semtimedop_time32), "semtimedop" }, +[358] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" }, +[359] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" }, [360] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, [361] = { 2, TD, SEN(eventfd2), "eventfd2" }, [362] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, @@ -395,14 +376,14 @@ [367] = { 5, TD, SEN(pwritev), "pwritev" }, [368] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, [369] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, -[370] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[370] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" }, [371] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, [372] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, [373] = { 4, 0, SEN(prlimit64), "prlimit64" }, [374] = { 3, 0, SEN(cacheflush), "cacheflush" }, [375] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, [376] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[377] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[377] = { 2, 0, SEN(clock_adjtime32), "clock_adjtime" }, [378] = { 1, TD, SEN(syncfs), "syncfs" }, [379] = { 2, TD, SEN(setns), "setns" }, [380] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, diff --git a/linux/bfin/userent.h b/linux/bfin/userent.h index f7a7ca63..a35ba9fd 100644 --- a/linux/bfin/userent.h +++ b/linux/bfin/userent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + XLAT_UOFF(u_tsize), XLAT_UOFF(u_dsize), XLAT_UOFF(u_ssize), diff --git a/linux/check_scno.c b/linux/check_scno.c new file mode 100644 index 00000000..acadab25 --- /dev/null +++ b/linux/check_scno.c @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_check_scno(struct tcb *tcp) +{ + return 1; +} diff --git a/linux/crisv10/arch_regs.c b/linux/crisv10/arch_regs.c deleted file mode 100644 index 9c372a36..00000000 --- a/linux/crisv10/arch_regs.c +++ /dev/null @@ -1,2 +0,0 @@ -static unsigned long cris_r10; -#define ARCH_PC_PEEK_ADDR (4 * PT_IRP) diff --git a/linux/crisv10/arch_sigreturn.c b/linux/crisv10/arch_sigreturn.c deleted file mode 100644 index b449d41e..00000000 --- a/linux/crisv10/arch_sigreturn.c +++ /dev/null @@ -1,16 +0,0 @@ -static void -arch_sigreturn(struct tcb *tcp) -{ - unsigned long regs[PT_MAX + 1]; - - if (ptrace(PTRACE_GETREGS, tcp->pid, NULL, regs) < 0) { - perror_msg("sigreturn: PTRACE_GETREGS"); - return; - } - const unsigned long addr = - regs[PT_USP] + offsetof(struct sigcontext, oldmask); - - tprints("{mask="); - print_sigset_addr_len(tcp, addr, NSIG_BYTES); - tprints("}"); -} diff --git a/linux/crisv10/get_error.c b/linux/crisv10/get_error.c deleted file mode 100644 index b9da923f..00000000 --- a/linux/crisv10/get_error.c +++ /dev/null @@ -1,10 +0,0 @@ -static void -get_error(struct tcb *tcp, const bool check_errno) -{ - if (check_errno && is_negated_errno(cris_r10)) { - tcp->u_rval = -1; - tcp->u_error = -cris_r10; - } else { - tcp->u_rval = cris_r10; - } -} diff --git a/linux/crisv10/get_scno.c b/linux/crisv10/get_scno.c deleted file mode 100644 index 14ff3386..00000000 --- a/linux/crisv10/get_scno.c +++ /dev/null @@ -1,6 +0,0 @@ -/* Return codes: 1 - ok, 0 - ignore, other - error. */ -static int -arch_get_scno(struct tcb *tcp) -{ - return upeek(tcp->pid, 4 * PT_R9, &tcp->scno) < 0 ? -1 : 1; -} diff --git a/linux/crisv10/get_syscall_args.c b/linux/crisv10/get_syscall_args.c deleted file mode 100644 index bdd05746..00000000 --- a/linux/crisv10/get_syscall_args.c +++ /dev/null @@ -1,15 +0,0 @@ -/* Return -1 on error or 1 on success (never 0!). */ -static int -get_syscall_args(struct tcb *tcp) -{ - static const int crisregs[MAX_ARGS] = { - 4*PT_ORIG_R10, 4*PT_R11, 4*PT_R12, - 4*PT_R13 , 4*PT_MOF, 4*PT_SRP - }; - unsigned int i; - - for (i = 0; i < tcp->s_ent->nargs; ++i) - if (upeek(tcp->pid, crisregs[i], &tcp->u_arg[i]) < 0) - return -1; - return 1; -} diff --git a/linux/crisv10/get_syscall_result.c b/linux/crisv10/get_syscall_result.c deleted file mode 100644 index 6b3679c1..00000000 --- a/linux/crisv10/get_syscall_result.c +++ /dev/null @@ -1,5 +0,0 @@ -static int -get_syscall_result_regs(struct tcb *tcp) -{ - return upeek(tcp->pid, 4 * PT_R10, &cris_r10) < 0 ? -1 : 0; -} diff --git a/linux/crisv10/set_error.c b/linux/crisv10/set_error.c deleted file mode 100644 index 3a14a87a..00000000 --- a/linux/crisv10/set_error.c +++ /dev/null @@ -1,13 +0,0 @@ -static int -arch_set_error(struct tcb *tcp) -{ - cris_r10 = -tcp->u_error; - return upoke(tcp->pid, 4 * PT_R10, cris_r10); -} - -static int -arch_set_success(struct tcb *tcp) -{ - cris_r10 = tcp->u_rval; - return upoke(tcp->pid, 4 * PT_R10, cris_r10); -} diff --git a/linux/crisv10/set_scno.c b/linux/crisv10/set_scno.c deleted file mode 100644 index 0de38fa7..00000000 --- a/linux/crisv10/set_scno.c +++ /dev/null @@ -1,5 +0,0 @@ -static int -arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) -{ - return upoke(tcp->pid, 4 * PT_R9, scno); -} diff --git a/linux/crisv10/syscallent.h b/linux/crisv10/syscallent.h deleted file mode 100644 index d411fe71..00000000 --- a/linux/crisv10/syscallent.h +++ /dev/null @@ -1,358 +0,0 @@ -[ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, -[ 1] = { 1, TP|SE, SEN(exit), "exit" }, -[ 2] = { 0, TP, SEN(fork), "fork" }, -[ 3] = { 3, TD, SEN(read), "read" }, -[ 4] = { 3, TD, SEN(write), "write" }, -[ 5] = { 3, TD|TF, SEN(open), "open" }, -[ 6] = { 1, TD, SEN(close), "close" }, -[ 7] = { 3, TP, SEN(waitpid), "waitpid" }, -[ 8] = { 2, TD|TF, SEN(creat), "creat" }, -[ 9] = { 2, TF, SEN(link), "link" }, -[ 10] = { 1, TF, SEN(unlink), "unlink" }, -[ 11] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, -[ 12] = { 1, TF, SEN(chdir), "chdir" }, -[ 13] = { 1, 0, SEN(time), "time" }, -[ 14] = { 3, TF, SEN(mknod), "mknod" }, -[ 15] = { 2, TF, SEN(chmod), "chmod" }, -[ 16] = { 3, TF, SEN(chown16), "lchown" }, -[ 17] = { 0, TM, SEN(break), "break" }, -[ 18] = { 2, TF, SEN(oldstat), "oldstat" }, -[ 19] = { 3, TD, SEN(lseek), "lseek" }, -[ 20] = { 0, NF, SEN(getpid), "getpid" }, -[ 21] = { 5, TF, SEN(mount), "mount" }, -[ 22] = { 1, TF, SEN(umount), "umount" }, -[ 23] = { 1, 0, SEN(setuid16), "setuid" }, -[ 24] = { 0, NF, SEN(getuid16), "getuid" }, -[ 25] = { 1, 0, SEN(stime), "stime" }, -[ 26] = { 4, 0, SEN(ptrace), "ptrace" }, -[ 27] = { 1, 0, SEN(alarm), "alarm" }, -[ 28] = { 2, TD, SEN(oldfstat), "oldfstat" }, -[ 29] = { 0, TS, SEN(pause), "pause" }, -[ 30] = { 2, TF, SEN(utime), "utime" }, -[ 31] = { 2, 0, SEN(stty), "stty" }, -[ 32] = { 2, 0, SEN(gtty), "gtty" }, -[ 33] = { 2, TF, SEN(access), "access" }, -[ 34] = { 1, 0, SEN(nice), "nice" }, -[ 35] = { 0, 0, SEN(ftime), "ftime" }, -[ 36] = { 0, 0, SEN(sync), "sync" }, -[ 37] = { 2, TS, SEN(kill), "kill" }, -[ 38] = { 2, TF, SEN(rename), "rename" }, -[ 39] = { 2, TF, SEN(mkdir), "mkdir" }, -[ 40] = { 1, TF, SEN(rmdir), "rmdir" }, -[ 41] = { 1, TD, SEN(dup), "dup" }, -[ 42] = { 1, TD, SEN(pipe), "pipe" }, -[ 43] = { 1, 0, SEN(times), "times" }, -[ 44] = { 0, 0, SEN(prof), "prof" }, -[ 45] = { 1, TM|SI, SEN(brk), "brk" }, -[ 46] = { 1, 0, SEN(setgid16), "setgid" }, -[ 47] = { 0, NF, SEN(getgid16), "getgid" }, -[ 48] = { 2, TS, SEN(signal), "signal" }, -[ 49] = { 0, NF, SEN(geteuid16), "geteuid" }, -[ 50] = { 0, NF, SEN(getegid16), "getegid" }, -[ 51] = { 1, TF, SEN(acct), "acct" }, -[ 52] = { 2, TF, SEN(umount2), "umount2" }, -[ 53] = { 0, 0, SEN(lock), "lock" }, -[ 54] = { 3, TD, SEN(ioctl), "ioctl" }, -[ 55] = { 3, TD, SEN(fcntl), "fcntl" }, -[ 56] = { 0, 0, SEN(mpx), "mpx" }, -[ 57] = { 2, 0, SEN(setpgid), "setpgid" }, -[ 58] = { 2, 0, SEN(ulimit), "ulimit" }, -[ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, -[ 60] = { 1, NF, SEN(umask), "umask" }, -[ 61] = { 1, TF, SEN(chroot), "chroot" }, -[ 62] = { 2, 0, SEN(ustat), "ustat" }, -[ 63] = { 2, TD, SEN(dup2), "dup2" }, -[ 64] = { 0, NF, SEN(getppid), "getppid" }, -[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, -[ 66] = { 0, 0, SEN(setsid), "setsid" }, -[ 67] = { 3, TS, SEN(sigaction), "sigaction" }, -[ 68] = { 0, TS, SEN(siggetmask), "sgetmask" }, -[ 69] = { 1, TS, SEN(sigsetmask), "ssetmask" }, -[ 70] = { 2, 0, SEN(setreuid16), "setreuid" }, -[ 71] = { 2, 0, SEN(setregid16), "setregid" }, -[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, -[ 73] = { 1, TS, SEN(sigpending), "sigpending" }, -[ 74] = { 2, 0, SEN(sethostname), "sethostname" }, -[ 75] = { 2, 0, SEN(setrlimit), "setrlimit" }, -[ 76] = { 2, 0, SEN(getrlimit), "getrlimit" }, -[ 77] = { 2, 0, SEN(getrusage), "getrusage" }, -[ 78] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, -[ 79] = { 2, 0, SEN(settimeofday), "settimeofday" }, -[ 80] = { 2, 0, SEN(getgroups16), "getgroups" }, -[ 81] = { 2, 0, SEN(setgroups16), "setgroups" }, -[ 82] = { 1, TD, SEN(oldselect), "select" }, -[ 83] = { 2, TF, SEN(symlink), "symlink" }, -[ 84] = { 2, TF, SEN(oldlstat), "oldlstat" }, -[ 85] = { 3, TF, SEN(readlink), "readlink" }, -[ 86] = { 1, TF, SEN(uselib), "uselib" }, -[ 87] = { 2, TF, SEN(swapon), "swapon" }, -[ 88] = { 4, 0, SEN(reboot), "reboot" }, -[ 89] = { 3, TD, SEN(readdir), "readdir" }, -[ 90] = { 1, TD|TM|SI, SEN(old_mmap), "mmap" }, -[ 91] = { 2, TM|SI, SEN(munmap), "munmap" }, -[ 92] = { 2, TF, SEN(truncate), "truncate" }, -[ 93] = { 2, TD, SEN(ftruncate), "ftruncate" }, -[ 94] = { 2, TD, SEN(fchmod), "fchmod" }, -[ 95] = { 3, TD, SEN(fchown16), "fchown" }, -[ 96] = { 2, 0, SEN(getpriority), "getpriority" }, -[ 97] = { 3, 0, SEN(setpriority), "setpriority" }, -[ 98] = { 4, 0, SEN(profil), "profil" }, -[ 99] = { 2, TF, SEN(statfs), "statfs" }, -[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, -[101] = { 3, 0, SEN(ioperm), "ioperm" }, -[102] = { 2, TD, SEN(socketcall), "socketcall" }, -[103] = { 3, 0, SEN(syslog), "syslog" }, -[104] = { 3, 0, SEN(setitimer), "setitimer" }, -[105] = { 2, 0, SEN(getitimer), "getitimer" }, -[106] = { 2, TF, SEN(stat), "stat" }, -[107] = { 2, TF, SEN(lstat), "lstat" }, -[108] = { 2, TD, SEN(fstat), "fstat" }, -[109] = { 1, 0, SEN(olduname), "olduname" }, -[110] = { 1, 0, SEN(iopl), "iopl" }, -[111] = { 0, 0, SEN(vhangup), "vhangup" }, -[112] = { 0, 0, SEN(idle), "idle" }, -[113] = { 5, 0, SEN(vm86), "vm86" }, -[114] = { 4, TP, SEN(wait4), "wait4" }, -[115] = { 1, TF, SEN(swapoff), "swapoff" }, -[116] = { 1, 0, SEN(sysinfo), "sysinfo" }, -[117] = { 6, TI, SEN(ipc), "ipc" }, -[118] = { 1, TD, SEN(fsync), "fsync" }, -[119] = { 0, TS, SEN(sigreturn), "sigreturn" }, -[120] = { 5, TP, SEN(clone), "clone" }, -[121] = { 2, 0, SEN(setdomainname), "setdomainname" }, -[122] = { 1, 0, SEN(uname), "uname" }, -[123] = { 3, 0, SEN(modify_ldt), "modify_ldt" }, -[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, -[125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, -[126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, -[127] = { 2, 0, SEN(create_module), "create_module" }, -[128] = { 3, 0, SEN(init_module), "init_module" }, -[129] = { 2, 0, SEN(delete_module), "delete_module" }, -[130] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, -[131] = { 4, TF, SEN(quotactl), "quotactl" }, -[132] = { 1, 0, SEN(getpgid), "getpgid" }, -[133] = { 1, TD, SEN(fchdir), "fchdir" }, -[134] = { 2, 0, SEN(bdflush), "bdflush" }, -[135] = { 3, 0, SEN(sysfs), "sysfs" }, -[136] = { 1, NF, SEN(personality), "personality" }, -[137] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, -[138] = { 1, NF, SEN(setfsuid16), "setfsuid" }, -[139] = { 1, NF, SEN(setfsgid16), "setfsgid" }, -[140] = { 5, TD, SEN(llseek), "_llseek" }, -[141] = { 3, TD, SEN(getdents), "getdents" }, -[142] = { 5, TD, SEN(select), "_newselect" }, -[143] = { 2, TD, SEN(flock), "flock" }, -[144] = { 3, TM, SEN(msync), "msync" }, -[145] = { 3, TD, SEN(readv), "readv" }, -[146] = { 3, TD, SEN(writev), "writev" }, -[147] = { 1, 0, SEN(getsid), "getsid" }, -[148] = { 1, TD, SEN(fdatasync), "fdatasync" }, -[149] = { 1, 0, SEN(sysctl), "_sysctl" }, -[150] = { 2, TM, SEN(mlock), "mlock" }, -[151] = { 2, TM, SEN(munlock), "munlock" }, -[152] = { 1, TM, SEN(mlockall), "mlockall" }, -[153] = { 0, TM, SEN(munlockall), "munlockall" }, -[154] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, -[155] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, -[156] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, -[157] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, -[158] = { 0, 0, SEN(sched_yield), "sched_yield" }, -[159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, -[160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, -[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, -[163] = { 5, TM|SI, SEN(mremap), "mremap" }, -[164] = { 3, 0, SEN(setresuid16), "setresuid" }, -[165] = { 3, 0, SEN(getresuid16), "getresuid" }, -[167] = { 5, 0, SEN(query_module), "query_module" }, -[168] = { 3, TD, SEN(poll), "poll" }, -[169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, -[170] = { 3, 0, SEN(setresgid16), "setresgid" }, -[171] = { 3, 0, SEN(getresgid16), "getresgid" }, -[172] = { 5, 0, SEN(prctl), "prctl" }, -[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, -[174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, -[175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, -[176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[177] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, -[178] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, -[179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, -[180] = { 5, TD, SEN(pread), "pread64" }, -[181] = { 5, TD, SEN(pwrite), "pwrite64" }, -[182] = { 3, TF, SEN(chown16), "chown" }, -[183] = { 2, TF, SEN(getcwd), "getcwd" }, -[184] = { 2, 0, SEN(capget), "capget" }, -[185] = { 2, 0, SEN(capset), "capset" }, -[186] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, -[187] = { 4, TD|TN, SEN(sendfile), "sendfile" }, -[188] = { 5, TN, SEN(getpmsg), "getpmsg" }, -[189] = { 5, TN, SEN(putpmsg), "putpmsg" }, -[190] = { 0, TP, SEN(vfork), "vfork" }, -[191] = { 2, 0, SEN(getrlimit), "ugetrlimit" }, -[192] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" }, -[193] = { 3, TF, SEN(truncate64), "truncate64" }, -[194] = { 3, TD, SEN(ftruncate64), "ftruncate64" }, -[195] = { 2, TF, SEN(stat64), "stat64" }, -[196] = { 2, TF, SEN(lstat64), "lstat64" }, -[197] = { 2, TD, SEN(fstat64), "fstat64" }, -[198] = { 3, TF, SEN(chown), "lchown32" }, -[199] = { 0, NF, SEN(getuid), "getuid32" }, -[200] = { 0, NF, SEN(getgid), "getgid32" }, -[201] = { 0, NF, SEN(geteuid), "geteuid32" }, -[202] = { 0, NF, SEN(getegid), "getegid32" }, -[203] = { 2, 0, SEN(setreuid), "setreuid32" }, -[204] = { 2, 0, SEN(setregid), "setregid32" }, -[205] = { 2, 0, SEN(getgroups), "getgroups32" }, -[206] = { 2, 0, SEN(setgroups), "setgroups32" }, -[207] = { 3, TD, SEN(fchown), "fchown32" }, -[208] = { 3, 0, SEN(setresuid), "setresuid32" }, -[209] = { 3, 0, SEN(getresuid), "getresuid32" }, -[210] = { 3, 0, SEN(setresgid), "setresgid32" }, -[211] = { 3, 0, SEN(getresgid), "getresgid32" }, -[212] = { 3, TF, SEN(chown), "chown32" }, -[213] = { 1, 0, SEN(setuid), "setuid32" }, -[214] = { 1, 0, SEN(setgid), "setgid32" }, -[215] = { 1, NF, SEN(setfsuid), "setfsuid32" }, -[216] = { 1, NF, SEN(setfsgid), "setfsgid32" }, -[217] = { 2, TF, SEN(pivotroot), "pivot_root" }, -[218] = { 3, TM, SEN(mincore), "mincore" }, -[219] = { 3, TM, SEN(madvise), "madvise" }, -[220] = { 3, TD, SEN(getdents64), "getdents64" }, -[221] = { 3, TD, SEN(fcntl64), "fcntl64" }, -[224] = { 0, NF, SEN(gettid), "gettid" }, -[225] = { 4, TD, SEN(readahead), "readahead" }, -[226] = { 5, TF, SEN(setxattr), "setxattr" }, -[227] = { 5, TF, SEN(setxattr), "lsetxattr" }, -[228] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, -[229] = { 4, TF, SEN(getxattr), "getxattr" }, -[230] = { 4, TF, SEN(getxattr), "lgetxattr" }, -[231] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, -[232] = { 3, TF, SEN(listxattr), "listxattr" }, -[233] = { 3, TF, SEN(listxattr), "llistxattr" }, -[234] = { 3, TD, SEN(flistxattr), "flistxattr" }, -[235] = { 2, TF, SEN(removexattr), "removexattr" }, -[236] = { 2, TF, SEN(removexattr), "lremovexattr" }, -[237] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, -[238] = { 2, TS, SEN(kill), "tkill" }, -[239] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, -[240] = { 6, 0, SEN(futex), "futex" }, -[241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, -[242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, -[243] = { 1, 0, SEN(set_thread_area), "set_thread_area" }, -[244] = { 1, 0, SEN(get_thread_area), "get_thread_area" }, -[245] = { 2, TM, SEN(io_setup), "io_setup" }, -[246] = { 1, TM, SEN(io_destroy), "io_destroy" }, -[247] = { 5, 0, SEN(io_getevents), "io_getevents" }, -[248] = { 3, 0, SEN(io_submit), "io_submit" }, -[249] = { 3, 0, SEN(io_cancel), "io_cancel" }, -[250] = { 5, TD, SEN(fadvise64), "fadvise64" }, -[252] = { 1, TP|SE, SEN(exit), "exit_group" }, -[253] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" }, -[254] = { 1, TD, SEN(epoll_create), "epoll_create" }, -[255] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, -[256] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, -[257] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, -[258] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, -[259] = { 3, 0, SEN(timer_create), "timer_create" }, -[260] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[261] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, -[262] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, -[263] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[264] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[265] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[266] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[267] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, -[268] = { 3, TF, SEN(statfs64), "statfs64" }, -[269] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, -[270] = { 3, TS, SEN(tgkill), "tgkill" }, -[271] = { 2, TF, SEN(utimes), "utimes" }, -[272] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, -[273] = { 5, 0, SEN(vserver), "vserver" }, -[274] = { 6, TM, SEN(mbind), "mbind" }, -[275] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, -[276] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, -[277] = { 4, 0, SEN(mq_open), "mq_open" }, -[278] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[279] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[280] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[281] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[282] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, -[283] = { 4, 0, SEN(kexec_load), "kexec_load" }, -[284] = { 5, TP, SEN(waitid), "waitid" }, -[286] = { 5, 0, SEN(add_key), "add_key" }, -[287] = { 4, 0, SEN(request_key), "request_key" }, -[288] = { 5, 0, SEN(keyctl), "keyctl" }, -[289] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, -[290] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, -[291] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[292] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, -[293] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, -[294] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, -[295] = { 4, TD|TF, SEN(openat), "openat" }, -[296] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, -[297] = { 4, TD|TF, SEN(mknodat), "mknodat" }, -[298] = { 5, TD|TF, SEN(fchownat), "fchownat" }, -[299] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[300] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, -[301] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, -[302] = { 4, TD|TF, SEN(renameat), "renameat" }, -[303] = { 5, TD|TF, SEN(linkat), "linkat" }, -[304] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, -[305] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, -[306] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, -[307] = { 3, TD|TF, SEN(faccessat), "faccessat" }, -[308] = { 6, TD, SEN(pselect6), "pselect6" }, -[309] = { 5, TD, SEN(ppoll), "ppoll" }, -[310] = { 1, TP, SEN(unshare), "unshare" }, -[311] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, -[312] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, -[313] = { 6, TD, SEN(splice), "splice" }, -[314] = { 6, TD, SEN(sync_file_range), "sync_file_range" }, -[315] = { 4, TD, SEN(tee), "tee" }, -[316] = { 4, TD, SEN(vmsplice), "vmsplice" }, -[317] = { 6, TM, SEN(move_pages), "move_pages" }, -[318] = { 3, 0, SEN(getcpu), "getcpu" }, -[319] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[320] = { 4, TD|TF, SEN(utimensat), "utimensat" }, -[321] = { 3, TD|TS, SEN(signalfd), "signalfd" }, -[322] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, -[323] = { 1, TD, SEN(eventfd), "eventfd" }, -[324] = { 6, TD, SEN(fallocate), "fallocate" }, -[325] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, -[326] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, -[327] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, -[328] = { 2, TD, SEN(eventfd2), "eventfd2" }, -[329] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, -[330] = { 3, TD, SEN(dup3), "dup3" }, -[331] = { 2, TD, SEN(pipe2), "pipe2" }, -[332] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, -[333] = { 5, TD, SEN(preadv), "preadv" }, -[334] = { 5, TD, SEN(pwritev), "pwritev" }, -[335] = { 2, TD, SEN(setns), "setns" }, -[336] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, -[337] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[338] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, -[339] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, -[340] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, -[341] = { 4, TN, SEN(accept4), "accept4" }, -[342] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, -[343] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, -[344] = { 4, 0, SEN(prlimit64), "prlimit64" }, -[345] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, -[346] = { 1, TD, SEN(syncfs), "syncfs" }, -[347] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, -[348] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, -[349] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, -[350] = { 5, 0, SEN(kcmp), "kcmp" }, -[351] = { 3, TD, SEN(finit_module), "finit_module" }, -[352] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, -[353] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, -[354] = { 5, TD|TF, SEN(renameat2), "renameat2" }, -[355] = { 3, 0, SEN(seccomp), "seccomp" }, -[356] = { 3, 0, SEN(getrandom), "getrandom" }, -[357] = { 2, TD, SEN(memfd_create), "memfd_create" }, -[358] = { 3, TD, SEN(bpf), "bpf" }, -[359] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, - -#define SYS_socket_subcall 400 -#include "subcall.h" diff --git a/linux/crisv10/userent.h b/linux/crisv10/userent.h deleted file mode 100644 index bea16aea..00000000 --- a/linux/crisv10/userent.h +++ /dev/null @@ -1,26 +0,0 @@ -XLAT(4*PT_FRAMETYPE), -XLAT(4*PT_ORIG_R10), -XLAT(4*PT_R13), -XLAT(4*PT_R12), -XLAT(4*PT_R11), -XLAT(4*PT_R10), -XLAT(4*PT_R9), -XLAT(4*PT_R8), -XLAT(4*PT_R7), -XLAT(4*PT_R6), -XLAT(4*PT_R5), -XLAT(4*PT_R4), -XLAT(4*PT_R3), -XLAT(4*PT_R2), -XLAT(4*PT_R1), -XLAT(4*PT_R0), -XLAT(4*PT_MOF), -XLAT(4*PT_DCCR), -XLAT(4*PT_SRP), -XLAT(4*PT_IRP), -XLAT(4*PT_CSRINSTR), -XLAT(4*PT_CSRADDR), -XLAT(4*PT_CSRDATA), -XLAT(4*PT_USP), -/* Other fields in "struct user" */ -#include "../userent0.h" diff --git a/linux/crisv32/arch_regs.c b/linux/crisv32/arch_regs.c deleted file mode 100644 index 8e59c156..00000000 --- a/linux/crisv32/arch_regs.c +++ /dev/null @@ -1,2 +0,0 @@ -#include "crisv10/arch_regs.c" -#define ARCH_PC_PEEK_ADDR (4 * PT_ERP) diff --git a/linux/crisv32/arch_sigreturn.c b/linux/crisv32/arch_sigreturn.c deleted file mode 100644 index 6c0fc03b..00000000 --- a/linux/crisv32/arch_sigreturn.c +++ /dev/null @@ -1 +0,0 @@ -#include "crisv10/arch_sigreturn.c" diff --git a/linux/crisv32/get_error.c b/linux/crisv32/get_error.c deleted file mode 100644 index f7bb1e01..00000000 --- a/linux/crisv32/get_error.c +++ /dev/null @@ -1 +0,0 @@ -#include "crisv10/get_error.c" diff --git a/linux/crisv32/get_scno.c b/linux/crisv32/get_scno.c deleted file mode 100644 index edfd60f8..00000000 --- a/linux/crisv32/get_scno.c +++ /dev/null @@ -1 +0,0 @@ -#include "crisv10/get_scno.c" diff --git a/linux/crisv32/get_syscall_args.c b/linux/crisv32/get_syscall_args.c deleted file mode 100644 index 4d984659..00000000 --- a/linux/crisv32/get_syscall_args.c +++ /dev/null @@ -1 +0,0 @@ -#include "crisv10/get_syscall_args.c" diff --git a/linux/crisv32/get_syscall_result.c b/linux/crisv32/get_syscall_result.c deleted file mode 100644 index ebefdb20..00000000 --- a/linux/crisv32/get_syscall_result.c +++ /dev/null @@ -1 +0,0 @@ -#include "crisv10/get_syscall_result.c" diff --git a/linux/crisv32/set_error.c b/linux/crisv32/set_error.c deleted file mode 100644 index 18a5ee8c..00000000 --- a/linux/crisv32/set_error.c +++ /dev/null @@ -1 +0,0 @@ -#include "crisv10/set_error.c" diff --git a/linux/crisv32/set_scno.c b/linux/crisv32/set_scno.c deleted file mode 100644 index b021adf1..00000000 --- a/linux/crisv32/set_scno.c +++ /dev/null @@ -1 +0,0 @@ -#include "crisv10/set_scno.c" diff --git a/linux/crisv32/syscallent.h b/linux/crisv32/syscallent.h deleted file mode 100644 index ce4e5284..00000000 --- a/linux/crisv32/syscallent.h +++ /dev/null @@ -1 +0,0 @@ -#include "crisv10/syscallent.h" diff --git a/linux/crisv32/userent.h b/linux/crisv32/userent.h deleted file mode 100644 index 3c5949eb..00000000 --- a/linux/crisv32/userent.h +++ /dev/null @@ -1,43 +0,0 @@ -XLAT(4*PT_ORIG_R10), -XLAT(4*PT_R0), -XLAT(4*PT_R1), -XLAT(4*PT_R2), -XLAT(4*PT_R3), -XLAT(4*PT_R4), -XLAT(4*PT_R5), -XLAT(4*PT_R6), -XLAT(4*PT_R7), -XLAT(4*PT_R8), -XLAT(4*PT_R9), -XLAT(4*PT_R10), -XLAT(4*PT_R11), -XLAT(4*PT_R12), -XLAT(4*PT_R13), -XLAT(4*PT_ACR), -XLAT(4*PT_SRS), -XLAT(4*PT_MOF), -XLAT(4*PT_SPC), -XLAT(4*PT_CCS), -XLAT(4*PT_SRP), -XLAT(4*PT_ERP), -XLAT(4*PT_EXS), -XLAT(4*PT_EDA), -XLAT(4*PT_USP), -XLAT(4*PT_PPC), -XLAT(4*PT_BP_CTRL), -XLAT(4*PT_BP+4), -XLAT(4*PT_BP+8), -XLAT(4*PT_BP+12), -XLAT(4*PT_BP+16), -XLAT(4*PT_BP+20), -XLAT(4*PT_BP+24), -XLAT(4*PT_BP+28), -XLAT(4*PT_BP+32), -XLAT(4*PT_BP+36), -XLAT(4*PT_BP+40), -XLAT(4*PT_BP+44), -XLAT(4*PT_BP+48), -XLAT(4*PT_BP+52), -XLAT(4*PT_BP+56), -/* Other fields in "struct user" */ -#include "../userent0.h" diff --git a/linux/csky/arch_regs.c b/linux/csky/arch_regs.c new file mode 100644 index 00000000..3caed7b1 --- /dev/null +++ b/linux/csky/arch_regs.c @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +static struct pt_regs csky_regs; + +#define ARCH_REGS_FOR_GETREGSET csky_regs +#define ARCH_PC_REG csky_regs.pc +#define ARCH_SP_REG csky_regs.usp diff --git a/linux/csky/get_error.c b/linux/csky/get_error.c new file mode 100644 index 00000000..c21a9248 --- /dev/null +++ b/linux/csky/get_error.c @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ +#include "negated_errno.h" + +static void +arch_get_error(struct tcb *tcp, const bool check_errno) +{ + if (check_errno && is_negated_errno(csky_regs.a0)) { + tcp->u_rval = -1; + tcp->u_error = -csky_regs.a0; + } else { + tcp->u_rval = csky_regs.a0; + } +} diff --git a/linux/csky/get_scno.c b/linux/csky/get_scno.c new file mode 100644 index 00000000..9efb2020 --- /dev/null +++ b/linux/csky/get_scno.c @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_get_scno(struct tcb *tcp) +{ +#if defined(__CSKYABIV2__) + tcp->scno = csky_regs.regs[3]; +#else + tcp->scno = csky_regs.r1; +#endif + return 1; +} diff --git a/linux/csky/get_syscall_args.c b/linux/csky/get_syscall_args.c new file mode 100644 index 00000000..05dbfb4f --- /dev/null +++ b/linux/csky/get_syscall_args.c @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +/* Return -1 on error or 1 on success (never 0!). */ +static int +arch_get_syscall_args(struct tcb *tcp) +{ + tcp->u_arg[0] = csky_regs.orig_a0; + tcp->u_arg[1] = csky_regs.a1; + tcp->u_arg[2] = csky_regs.a2; + tcp->u_arg[3] = csky_regs.a3; + tcp->u_arg[4] = csky_regs.regs[0]; + tcp->u_arg[5] = csky_regs.regs[1]; + return 1; +} diff --git a/linux/csky/ioctls_arch0.h b/linux/csky/ioctls_arch0.h new file mode 100644 index 00000000..8b7ac89b --- /dev/null +++ b/linux/csky/ioctls_arch0.h @@ -0,0 +1 @@ +/* Generated by ioctls_gen.sh from definitions found in $linux/arch/csky/include/ tree. */ diff --git a/linux/csky/ioctls_inc0.h b/linux/csky/ioctls_inc0.h new file mode 100644 index 00000000..4aecf983 --- /dev/null +++ b/linux/csky/ioctls_inc0.h @@ -0,0 +1 @@ +#include "32/ioctls_inc.h" diff --git a/linux/csky/raw_syscall.h b/linux/csky/raw_syscall.h new file mode 100644 index 00000000..aad0abdc --- /dev/null +++ b/linux/csky/raw_syscall.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +#define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ +#if defined(__CSKYABIV2__) + register kernel_ulong_t scno __asm__("r7") = nr; +#else + register kernel_ulong_t scno __asm__("r1") = nr; +#endif + register kernel_ulong_t a0 __asm__("a0"); + asm volatile("trap 0" + : "+r"(scno), "=r"(a0) + : + : "memory"); + + *err = 0; + return a0; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/csky/set_error.c b/linux/csky/set_error.c new file mode 100644 index 00000000..f8cb6333 --- /dev/null +++ b/linux/csky/set_error.c @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2016-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +static int +arch_set_error(struct tcb *tcp) +{ + csky_regs.a0 = -tcp->u_error; + return set_regs(tcp->pid); +} + +static int +arch_set_success(struct tcb *tcp) +{ + csky_regs.a0 = tcp->u_rval; + return set_regs(tcp->pid); +} diff --git a/linux/csky/set_scno.c b/linux/csky/set_scno.c new file mode 100644 index 00000000..1f043caf --- /dev/null +++ b/linux/csky/set_scno.c @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2016-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ +#if defined(__CSKYABIV2__) + csky_regs.regs[3] = scno; +#else + csky_regs.r1 = scno; +#endif + return set_regs(tcp->pid); +} diff --git a/linux/csky/syscallent.h b/linux/csky/syscallent.h new file mode 100644 index 00000000..33e3e73f --- /dev/null +++ b/linux/csky/syscallent.h @@ -0,0 +1,4 @@ +#include "32/syscallent.h" +/* [244 ... 259] are arch specific */ +[244] = {1, 0, SEN(set_thread_area), "set_thread_area"}, +[245] = {3, 0, SEN(cacheflush), "cacheflush"}, diff --git a/linux/dummy.h b/linux/dummy.h index 2758cfb2..15621bd5 100644 --- a/linux/dummy.h +++ b/linux/dummy.h @@ -1,167 +1,148 @@ /* * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995 Rick Sladkey + * Copyright (c) 1995-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #ifndef STRACE_LINUX_DUMMY_H -#define STRACE_LINUX_DUMMY_H +# define STRACE_LINUX_DUMMY_H -#ifndef HAVE_STRUCT___OLD_KERNEL_STAT -#define sys_oldfstat printargs -#define sys_oldstat printargs -#endif +# ifndef HAVE_STRUCT___OLD_KERNEL_STAT +# define sys_oldfstat printargs +# define sys_oldstat printargs +# endif /* still unfinished */ -#define sys_vm86 printargs -#define sys_vm86old printargs +# define sys_rseq printargs +# define sys_vm86 printargs +# define sys_vm86old printargs /* machine-specific */ -#ifndef HAVE_STRUCT_USER_DESC -# define sys_modify_ldt printargs -#endif +# ifndef HAVE_STRUCT_USER_DESC +# define sys_modify_ldt printargs +# endif -#if !(defined HAVE_STRUCT_USER_DESC || defined M68K || defined MIPS) -# define sys_set_thread_area printargs -#endif +# if !(defined HAVE_STRUCT_USER_DESC || defined M68K || defined MIPS) +# define sys_set_thread_area printargs +# endif -#if !(defined HAVE_STRUCT_USER_DESC || defined M68K) -# define sys_get_thread_area printargs -#endif +# if !(defined HAVE_STRUCT_USER_DESC || defined M68K) +# define sys_get_thread_area printargs +# endif -#ifdef ALPHA -# define sys_getdtablesize printargs -#endif +# ifdef ALPHA +# define sys_getdtablesize printargs +# endif /* like another call */ -#define sys_acct sys_chdir -#define sys_chroot sys_chdir -#define sys_clock_getres sys_clock_gettime -#define sys_connect sys_bind -#define sys_fchdir sys_close -#define sys_fdatasync sys_close -#define sys_fsync sys_close -#define sys_getegid sys_getuid -#define sys_getegid16 sys_geteuid16 -#define sys_geteuid sys_getuid -#define sys_geteuid16 sys_getuid16 -#define sys_getgid sys_getuid -#define sys_getgid16 sys_getuid16 -#define sys_getpeername sys_getsockname -#define sys_getresgid sys_getresuid -#define sys_getresgid16 sys_getresuid16 -#define sys_lstat sys_stat -#define sys_lstat64 sys_stat64 -#define sys_mkdir sys_chmod -#define sys_mkdirat sys_fchmodat -#define sys_mlock sys_munmap -#define sys_mq_unlink sys_chdir -#define sys_munlock sys_munmap -#define sys_oldlstat sys_oldstat -#define sys_pivotroot sys_link -#define sys_rename sys_link -#define sys_rmdir sys_chdir -#define sys_sched_get_priority_max sys_sched_get_priority_min -#define sys_set_robust_list sys_munmap -#define sys_setdomainname sys_sethostname -#define sys_setfsgid sys_setfsuid -#define sys_setfsgid16 sys_setfsuid16 -#define sys_setgid sys_setuid -#define sys_setgid16 sys_setuid16 -#define sys_setregid sys_setreuid -#define sys_setregid16 sys_setreuid16 -#define sys_setresgid sys_setresuid -#define sys_setresgid16 sys_setresuid16 -#define sys_stime sys_time -#define sys_swapoff sys_chdir -#define sys_symlink sys_link -#define sys_syncfs sys_close -#define sys_umount sys_chdir -#define sys_unlink sys_chdir -#define sys_uselib sys_chdir -#define sys_vfork sys_fork +# define sys_acct sys_chdir +# define sys_chroot sys_chdir +# define sys_clock_getres_time32 sys_clock_gettime32 +# define sys_clock_getres_time64 sys_clock_gettime64 +# define sys_connect sys_bind +# define sys_fchdir sys_close +# define sys_fdatasync sys_close +# define sys_fsync sys_close +# define sys_getegid sys_getuid +# define sys_getegid16 sys_geteuid16 +# define sys_geteuid sys_getuid +# define sys_geteuid16 sys_getuid16 +# define sys_getgid sys_getuid +# define sys_getgid16 sys_getuid16 +# define sys_getpeername sys_getsockname +# define sys_getresgid sys_getresuid +# define sys_getresgid16 sys_getresuid16 +# define sys_lstat sys_stat +# define sys_lstat64 sys_stat64 +# define sys_mkdir sys_chmod +# define sys_mkdirat sys_fchmodat +# define sys_mlock sys_munmap +# define sys_mq_unlink sys_chdir +# define sys_munlock sys_munmap +# define sys_oldlstat sys_oldstat +# define sys_pivotroot sys_link +# define sys_rename sys_link +# define sys_rmdir sys_chdir +# define sys_sched_get_priority_max sys_sched_get_priority_min +# define sys_set_robust_list sys_munmap +# define sys_setdomainname sys_sethostname +# define sys_setfsgid sys_setfsuid +# define sys_setfsgid16 sys_setfsuid16 +# define sys_setgid sys_setuid +# define sys_setgid16 sys_setuid16 +# define sys_setregid sys_setreuid +# define sys_setregid16 sys_setreuid16 +# define sys_setresgid sys_setresuid +# define sys_setresgid16 sys_setresuid16 +# define sys_stime sys_time +# define sys_swapoff sys_chdir +# define sys_symlink sys_link +# define sys_syncfs sys_close +# define sys_umount sys_chdir +# define sys_unlink sys_chdir +# define sys_uselib sys_chdir +# define sys_vfork sys_fork /* printargs does the right thing */ -#define sys_getpgrp printargs -#define sys_getpid printargs -#define sys_getppid printargs -#define sys_gettid printargs -#define sys_idle printargs -#define sys_inotify_init printargs -#define sys_munlockall printargs -#define sys_pause printargs -#define sys_printargs printargs -#define sys_rt_sigreturn printargs -#define sys_sched_yield printargs -#define sys_setsid printargs -#define sys_set_tid_address printargs -#define sys_setup printargs -#define sys_sync printargs -#define sys_syscall printargs -#define sys_vhangup printargs +# define sys_getpgrp printargs +# define sys_getpid printargs +# define sys_getppid printargs +# define sys_gettid printargs +# define sys_idle printargs +# define sys_inotify_init printargs +# define sys_munlockall printargs +# define sys_pause printargs +# define sys_printargs printargs +# define sys_sched_yield printargs +# define sys_setsid printargs +# define sys_set_tid_address printargs +# define sys_setup printargs +# define sys_sync printargs +# define sys_syscall printargs +# define sys_vhangup printargs /* printargs_u does the right thing */ -#define sys_alarm printargs_u +# define sys_alarm printargs_u /* printargs_d does the right thing */ -#define sys_exit printargs_d -#define sys_getpgid printargs_d -#define sys_getsid printargs_d -#define sys_nice printargs_d -#define sys_setpgid printargs_d -#define sys_setpgrp printargs_d -#define sys_timer_delete printargs_d -#define sys_timer_getoverrun printargs_d +# define sys_exit printargs_d +# define sys_getpgid printargs_d +# define sys_getsid printargs_d +# define sys_nice printargs_d +# define sys_setpgid printargs_d +# define sys_setpgrp printargs_d +# define sys_timer_delete printargs_d +# define sys_timer_getoverrun printargs_d /* unimplemented */ -#define sys_afs_syscall printargs -#define sys_break printargs -#define sys_create_module printargs -#define sys_ftime printargs -#define sys_get_kernel_syms printargs -#define sys_getpmsg printargs -#define sys_gtty printargs -#define sys_lock printargs -#define sys_mpx printargs -#define sys_nfsservctl printargs -#define sys_phys printargs -#define sys_prof printargs -#define sys_profil printargs -#define sys_putpmsg printargs -#define sys_query_module printargs -#define sys_security printargs -#define sys_stty printargs -#define sys_timerfd printargs -#define sys_tuxcall printargs -#define sys_ulimit printargs -#define sys_vserver printargs +# define sys_afs_syscall printargs +# define sys_break printargs +# define sys_create_module printargs +# define sys_ftime printargs +# define sys_get_kernel_syms printargs +# define sys_getpmsg printargs +# define sys_gtty printargs +# define sys_lock printargs +# define sys_mpx printargs +# define sys_nfsservctl printargs +# define sys_prof printargs +# define sys_profil printargs +# define sys_putpmsg printargs +# define sys_query_module printargs +# define sys_security printargs +# define sys_stty printargs +# define sys_timerfd printargs +# define sys_tuxcall printargs +# define sys_ulimit printargs +# define sys_vserver printargs /* deprecated */ -#define sys_bdflush printargs -#define sys_oldolduname printargs -#define sys_olduname printargs -#define sys_sysfs printargs +# define sys_bdflush printargs +# define sys_oldolduname printargs +# define sys_olduname printargs +# define sys_sysfs printargs #endif /* !STRACE_LINUX_DUMMY_H */ diff --git a/linux/errnoent.h b/linux/errnoent.h index 012f0999..1b1dbbed 100644 --- a/linux/errnoent.h +++ b/linux/errnoent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 1999-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + [ 1] = "EPERM", [ 2] = "ENOENT", [ 3] = "ESRCH", @@ -145,3 +152,4 @@ [527] = "EBADTYPE", [528] = "EJUKEBOX", [529] = "EIOCBQUEUED", +[530] = "ERECALLCONFLICT", diff --git a/linux/getregs_old.h b/linux/getregs_old.h index fd2c3a3d..5c73c9f9 100644 --- a/linux/getregs_old.h +++ b/linux/getregs_old.h @@ -1 +1,8 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #undef HAVE_GETREGS_OLD diff --git a/linux/hppa/arch_defs_.h b/linux/hppa/arch_defs_.h new file mode 100644 index 00000000..1bc3590b --- /dev/null +++ b/linux/hppa/arch_defs_.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define HAVE_ARCH_SA_RESTORER 0 +/* + * Linux kernel commit v4.6-rc2~20^2 introduced a regression: + * when tracer changes syscall number to -1, the kernel fails + * to initialize %r28 with -ENOSYS and subsequently fails + * to return the error code of the failed syscall to userspace. + * Workaround this by initializing %r28 ourselves. + */ +#define ARCH_NEEDS_SET_ERROR_FOR_SCNO_TAMPERING 1 diff --git a/linux/hppa/arch_regs.c b/linux/hppa/arch_regs.c index 7113bdb6..6d427e5c 100644 --- a/linux/hppa/arch_regs.c +++ b/linux/hppa/arch_regs.c @@ -1,2 +1,14 @@ +/* + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static unsigned long hppa_r28; -#define ARCH_PC_PEEK_ADDR PT_IAOQ0 + +#define PT_GR20 offsetof(struct pt_regs, gr[20]) +#define PT_GR28 offsetof(struct pt_regs, gr[28]) + +#define ARCH_PC_PEEK_ADDR offsetof(struct pt_regs, iaoq[0]) +#define ARCH_SP_PEEK_ADDR offsetof(struct pt_regs, gr[30]) diff --git a/linux/hppa/arch_regs.h b/linux/hppa/arch_regs.h deleted file mode 100644 index d42fc149..00000000 --- a/linux/hppa/arch_regs.h +++ /dev/null @@ -1,5 +0,0 @@ -#define PT_GR20 (20*4) -#define PT_GR26 (26*4) -#define PT_GR28 (28*4) -#define PT_IAOQ0 (106*4) -#define PT_IAOQ1 (107*4) diff --git a/linux/hppa/arch_rt_sigframe.c b/linux/hppa/arch_rt_sigframe.c new file mode 100644 index 00000000..56f74eb8 --- /dev/null +++ b/linux/hppa/arch_rt_sigframe.c @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "rt_sigframe.h" + +#define SIGFRAME (sizeof(long) * 16) +#define FUNCTIONCALLFRAME (sizeof(long) * 12) +#define RT_SIGFRAME_SIZE \ + (((sizeof(struct_rt_sigframe) + FUNCTIONCALLFRAME)) & -SIGFRAME) + +FUNC_GET_RT_SIGFRAME_ADDR +{ + unsigned long addr; + + return get_stack_pointer(tcp, &addr) + ? (addr & ~1UL) - RT_SIGFRAME_SIZE : 0; +} diff --git a/linux/hppa/errnoent.h b/linux/hppa/errnoent.h index 896980be..3c8b06fd 100644 --- a/linux/hppa/errnoent.h +++ b/linux/hppa/errnoent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2001-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + [ 1] = "EPERM", [ 2] = "ENOENT", [ 3] = "ESRCH", @@ -149,3 +156,4 @@ [527] = "EBADTYPE", [528] = "EJUKEBOX", [529] = "EIOCBQUEUED", +[530] = "ERECALLCONFLICT", diff --git a/linux/hppa/get_error.c b/linux/hppa/get_error.c index a2a7c0ea..0a2d5a86 100644 --- a/linux/hppa/get_error.c +++ b/linux/hppa/get_error.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "negated_errno.h" + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { if (check_errno && is_negated_errno(hppa_r28)) { tcp->u_rval = -1; diff --git a/linux/hppa/get_scno.c b/linux/hppa/get_scno.c index 7da2fc40..fe0fb5e3 100644 --- a/linux/hppa/get_scno.c +++ b/linux/hppa/get_scno.c @@ -1,6 +1,13 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) { - return upeek(tcp->pid, PT_GR20, &tcp->scno) < 0 ? -1 : 1; + return upeek(tcp, PT_GR20, &tcp->scno) < 0 ? -1 : 1; } diff --git a/linux/hppa/get_syscall_args.c b/linux/hppa/get_syscall_args.c index 2258ea87..186533b8 100644 --- a/linux/hppa/get_syscall_args.c +++ b/linux/hppa/get_syscall_args.c @@ -1,11 +1,19 @@ +/* + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { - unsigned int i; + for (unsigned int i = 0; i < n_args(tcp); ++i) { + unsigned int addr = offsetof(struct pt_regs, gr[26 - i]); - for (i = 0; i < tcp->s_ent->nargs; ++i) - if (upeek(tcp->pid, PT_GR26-4*i, &tcp->u_arg[i]) < 0) + if (upeek(tcp, addr, &tcp->u_arg[i]) < 0) return -1; + } return 1; } diff --git a/linux/hppa/get_syscall_result.c b/linux/hppa/get_syscall_result.c index 0d15d4db..af130b06 100644 --- a/linux/hppa/get_syscall_result.c +++ b/linux/hppa/get_syscall_result.c @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int get_syscall_result_regs(struct tcb *tcp) { - return upeek(tcp->pid, PT_GR28, &hppa_r28) < 0 ? -1 : 0; + return upeek(tcp, PT_GR28, &hppa_r28) < 0 ? -1 : 0; } diff --git a/linux/hppa/raw_syscall.h b/linux/hppa/raw_syscall.h new file mode 100644 index 00000000..82a4de94 --- /dev/null +++ b/linux/hppa/raw_syscall.h @@ -0,0 +1,32 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + *err = 0; + register kernel_ulong_t r28 __asm__("r28"); + __asm__ __volatile__("copy %%r19, %%r4\n\t" + "ble 0x100(%%sr2, %%r0)\n\t" + "copy %1, %%r20\n\t" + "copy %%r4, %%r19\n\t" + : "=r"(r28) + : "r"(nr) + : "memory", "%r1", "%r2", "%r4", + "%r21", "%r22", "%r23", "%r24", "%r25", "%r26" ); + return r28; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/hppa/rt_sigframe.h b/linux/hppa/rt_sigframe.h new file mode 100644 index 00000000..8338cab2 --- /dev/null +++ b/linux/hppa/rt_sigframe.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RT_SIGFRAME_H +# define STRACE_RT_SIGFRAME_H + +# include + +typedef struct { + unsigned int tramp[9]; + siginfo_t info; + ucontext_t uc; +} struct_rt_sigframe; + +#endif /* !STRACE_RT_SIGFRAME_H */ diff --git a/linux/hppa/set_error.c b/linux/hppa/set_error.c index 92a7979f..288d6f0a 100644 --- a/linux/hppa/set_error.c +++ b/linux/hppa/set_error.c @@ -1,13 +1,20 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_error(struct tcb *tcp) { hppa_r28 = -tcp->u_error; - return upoke(tcp->pid, PT_GR28, hppa_r28); + return upoke(tcp, PT_GR28, hppa_r28); } static int arch_set_success(struct tcb *tcp) { hppa_r28 = tcp->u_rval; - return upoke(tcp->pid, PT_GR28, hppa_r28); + return upoke(tcp, PT_GR28, hppa_r28); } diff --git a/linux/hppa/set_scno.c b/linux/hppa/set_scno.c index d4d873be..635e9b33 100644 --- a/linux/hppa/set_scno.c +++ b/linux/hppa/set_scno.c @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { - return upoke(tcp->pid, PT_GR20, scno); + return upoke(tcp, PT_GR20, scno); } diff --git a/linux/hppa/signalent.h b/linux/hppa/signalent.h index 6d699876..7f38ee49 100644 --- a/linux/hppa/signalent.h +++ b/linux/hppa/signalent.h @@ -1,4 +1,11 @@ - "SIG_0", /* 0 */ +/* + * Copyright (c) 2001-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + + "0", /* 0 */ "SIGHUP", /* 1 */ "SIGINT", /* 2 */ "SIGQUIT", /* 3 */ diff --git a/linux/hppa/syscallent.h b/linux/hppa/syscallent.h index 97e2a327..72f15190 100644 --- a/linux/hppa/syscallent.h +++ b/linux/hppa/syscallent.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2001 Hewlett-Packard, Matthew Wilcox + * Copyright (c) 2001-2019 The strace developers. */ [ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, @@ -20,17 +21,17 @@ [ 15] = { 2, TF, SEN(chmod), "chmod" }, [ 16] = { 3, TF, SEN(chown), "lchown" }, [ 17] = { 3, TN, SEN(socket), "socket" }, -[ 18] = { 2, TF, SEN(stat), "stat" }, +[ 18] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, [ 19] = { 3, TD, SEN(lseek), "lseek" }, -[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 20] = { 0, PU|NF, SEN(getpid), "getpid" }, [ 21] = { 5, TF, SEN(mount), "mount" }, [ 22] = { 3, TN, SEN(bind), "bind" }, [ 23] = { 1, 0, SEN(setuid), "setuid" }, -[ 24] = { 0, NF, SEN(getuid), "getuid" }, +[ 24] = { 0, PU|NF, SEN(getuid), "getuid" }, [ 25] = { 1, 0, SEN(stime), "stime" }, [ 26] = { 4, 0, SEN(ptrace), "ptrace" }, [ 27] = { 1, 0, SEN(alarm), "alarm" }, -[ 28] = { 2, TD, SEN(fstat), "fstat" }, +[ 28] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, [ 29] = { 0, TS, SEN(pause), "pause" }, [ 30] = { 2, TF, SEN(utime), "utime" }, [ 31] = { 3, TN, SEN(connect), "connect" }, @@ -49,10 +50,10 @@ [ 44] = { 3, TN, SEN(getsockname), "getsockname" }, [ 45] = { 1, TM|SI, SEN(brk), "brk" }, [ 46] = { 1, 0, SEN(setgid), "setgid" }, -[ 47] = { 0, NF, SEN(getgid), "getgid" }, +[ 47] = { 0, PU|NF, SEN(getgid), "getgid" }, [ 48] = { 2, TS, SEN(signal), "signal" }, -[ 49] = { 0, NF, SEN(geteuid), "geteuid" }, -[ 50] = { 0, NF, SEN(getegid), "getegid" }, +[ 49] = { 0, PU|NF, SEN(geteuid), "geteuid" }, +[ 50] = { 0, PU|NF, SEN(getegid), "getegid" }, [ 51] = { 1, TF, SEN(acct), "acct" }, [ 52] = { 2, TF, SEN(umount2), "umount2" }, [ 53] = { 3, TN, SEN(getpeername), "getpeername" }, @@ -64,14 +65,14 @@ [ 59] = { 1, 0, SEN(uname), "uname" }, [ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, -[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 62] = { 2, TSFA, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, -[ 64] = { 0, NF, SEN(getppid), "getppid" }, -[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 64] = { 0, PU|NF, SEN(getppid), "getppid" }, +[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, [ 66] = { 0, 0, SEN(setsid), "setsid" }, [ 67] = { 2, TF, SEN(pivotroot), "pivot_root" }, -[ 68] = { 0, TS, SEN(siggetmask), "sgetmask" }, -[ 69] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[ 68] = { 0, TS, SEN(sgetmask), "sgetmask" }, +[ 69] = { 1, TS, SEN(ssetmask), "ssetmask" }, [ 70] = { 2, 0, SEN(setreuid), "setreuid" }, [ 71] = { 2, 0, SEN(setregid), "setregid" }, [ 72] = { 3, TM, SEN(mincore), "mincore" }, @@ -86,7 +87,7 @@ [ 81] = { 2, 0, SEN(setgroups), "setgroups" }, [ 82] = { 6, TN, SEN(sendto), "sendto" }, [ 83] = { 2, TF, SEN(symlink), "symlink" }, -[ 84] = { 2, TF, SEN(lstat), "lstat" }, +[ 84] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, [ 85] = { 3, TF, SEN(readlink), "readlink" }, [ 86] = { 1, TF, SEN(uselib), "uselib" }, [ 87] = { 2, TF, SEN(swapon), "swapon" }, @@ -101,10 +102,10 @@ [ 96] = { 2, 0, SEN(getpriority), "getpriority" }, [ 97] = { 3, 0, SEN(setpriority), "setpriority" }, [ 98] = { 4, TN, SEN(recv), "recv" }, -[ 99] = { 2, TF, SEN(statfs), "statfs" }, -[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, -[101] = { 2, TF, SEN(stat64), "stat64" }, -[102] = { }, +[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, +[101] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" }, +/* [102] - was socketcall */ [103] = { 3, 0, SEN(syslog), "syslog" }, [104] = { 3, 0, SEN(setitimer), "setitimer" }, [105] = { 2, 0, SEN(getitimer), "getitimer" }, @@ -114,7 +115,7 @@ [109] = { 5, TD, SEN(pwrite), "pwrite64" }, [110] = { 2, TF, SEN(getcwd), "getcwd" }, [111] = { 0, 0, SEN(vhangup), "vhangup" }, -[112] = { 2, TD, SEN(fstat64), "fstat64" }, +[112] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" }, [113] = { 0, TP, SEN(vfork), "vfork" }, [114] = { 4, TP, SEN(wait4), "wait4" }, [115] = { 1, TF, SEN(swapoff), "swapoff" }, @@ -126,7 +127,7 @@ [121] = { 2, 0, SEN(setdomainname), "setdomainname" }, [122] = { 4, TD|TN, SEN(sendfile), "sendfile" }, [123] = { 6, TN, SEN(recvfrom), "recvfrom" }, -[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[124] = { 1, 0, SEN(adjtimex32), "adjtimex" }, [125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, [126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, [127] = { 2, 0, SEN(create_module), "create_module" }, @@ -163,23 +164,23 @@ [158] = { 0, 0, SEN(sched_yield), "sched_yield" }, [159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, -[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[161] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"}, +[162] = { 2, 0, SEN(nanosleep_time32), "nanosleep" }, [163] = { 5, TM|SI, SEN(mremap), "mremap" }, [164] = { 3, 0, SEN(setresuid), "setresuid" }, [165] = { 3, 0, SEN(getresuid), "getresuid" }, [166] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, [167] = { 5, 0, SEN(query_module), "query_module" }, -[168] = { 3, TD, SEN(poll), "poll" }, +[168] = { 3, TD, SEN(poll_time32), "poll" }, [169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, [170] = { 3, 0, SEN(setresgid), "setresgid" }, [171] = { 3, 0, SEN(getresgid), "getresgid" }, [172] = { 5, 0, SEN(prctl), "prctl" }, -[173] = { 0, TS, SEN(sigreturn), "rt_sigreturn" }, +[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, [174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, [175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, [176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[177] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[177] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" }, [178] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, [179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, [180] = { 3, TF, SEN(chown), "chown" }, @@ -200,7 +201,7 @@ [195] = { 3, TI, SEN(shmctl), "shmctl" }, [196] = { 5, TN, SEN(getpmsg), "getpmsg" }, [197] = { 5, TN, SEN(putpmsg), "putpmsg" }, -[198] = { 2, TF, SEN(lstat64), "lstat64" }, +[198] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" }, [199] = { 3, TF, SEN(truncate64), "truncate64" }, [200] = { 3, TD, SEN(ftruncate64), "ftruncate64" }, [201] = { 3, TD, SEN(getdents64), "getdents64" }, @@ -208,18 +209,18 @@ [203] = { 5, 0, SEN(printargs), "attrctl" }, [204] = { 5, 0, SEN(printargs), "acl_get" }, [205] = { 5, 0, SEN(printargs), "acl_set" }, -[206] = { 0, NF, SEN(gettid), "gettid" }, +[206] = { 0, PU|NF, SEN(gettid), "gettid" }, [207] = { 4, TD, SEN(readahead), "readahead" }, [208] = { 2, TS, SEN(kill), "tkill" }, [209] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, -[210] = { 6, 0, SEN(futex), "futex" }, +[210] = { 6, 0, SEN(futex_time32), "futex" }, [211] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [212] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [213] = { 5, 0, SEN(printargs), "set_thread_area" }, [214] = { 5, 0, SEN(printargs), "get_thread_area" }, [215] = { 2, TM, SEN(io_setup), "io_setup" }, [216] = { 1, TM, SEN(io_destroy), "io_destroy" }, -[217] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[217] = { 5, 0, SEN(io_getevents_time32), "io_getevents" }, [218] = { 3, 0, SEN(io_submit), "io_submit" }, [219] = { 3, 0, SEN(io_cancel), "io_cancel" }, [220] = { 5, 0, SEN(printargs), "alloc_hugepages" }, @@ -230,13 +231,13 @@ [225] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, [226] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, [227] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, -[228] = { 4, TI, SEN(semtimedop), "semtimedop" }, -[229] = { 4, 0, SEN(mq_open), "mq_open" }, +[228] = { 4, TI, SEN(semtimedop_time32), "semtimedop" }, +[229] = { 4, TD, SEN(mq_open), "mq_open" }, [230] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[231] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[232] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[233] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[234] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[231] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" }, +[232] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" }, +[233] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[234] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, [235] = { 5, TP, SEN(waitid), "waitid" }, [236] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, [237] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, @@ -253,14 +254,14 @@ [248] = { 2, TF, SEN(removexattr), "lremovexattr" }, [249] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [250] = { 3, 0, SEN(timer_create), "timer_create" }, -[251] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[252] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[251] = { 4, 0, SEN(timer_settime32), "timer_settime" }, +[252] = { 2, 0, SEN(timer_gettime32), "timer_gettime" }, [253] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, [254] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[255] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[256] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[257] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[258] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[255] = { 2, 0, SEN(clock_settime32), "clock_settime" }, +[256] = { 2, 0, SEN(clock_gettime32), "clock_gettime" }, +[257] = { 2, 0, SEN(clock_getres_time32), "clock_getres" }, +[258] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" }, [259] = { 3, TS, SEN(tgkill), "tgkill" }, [260] = { 6, TM, SEN(mbind), "mbind" }, [261] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, @@ -272,17 +273,17 @@ [267] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, [268] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, [269] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[270] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[270] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, [271] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, [272] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, -[273] = { 6, TD, SEN(pselect6), "pselect6" }, -[274] = { 5, TD, SEN(ppoll), "ppoll" }, +[273] = { 6, TD, SEN(pselect6_time32), "pselect6" }, +[274] = { 5, TD, SEN(ppoll_time32), "ppoll" }, [275] = { 4, TD|TF, SEN(openat), "openat" }, [276] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, [277] = { 4, TD|TF, SEN(mknodat), "mknodat" }, [278] = { 5, TD|TF, SEN(fchownat), "fchownat" }, [279] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[280] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[280] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" }, [281] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, [282] = { 4, TD|TF, SEN(renameat), "renameat" }, [283] = { 5, TD|TF, SEN(linkat), "linkat" }, @@ -300,17 +301,17 @@ [295] = { 6, TM, SEN(move_pages), "move_pages" }, [296] = { 3, 0, SEN(getcpu), "getcpu" }, [297] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[298] = { 3, TF, SEN(statfs64), "statfs64" }, -[299] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[298] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, +[299] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, [300] = { 4, 0, SEN(kexec_load), "kexec_load" }, -[301] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[301] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [302] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [303] = { 4, TD, SEN(timerfd), "timerfd" }, [304] = { 1, TD, SEN(eventfd), "eventfd" }, [305] = { 6, TD, SEN(fallocate), "fallocate" }, [306] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, -[307] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, -[308] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[307] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" }, +[308] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" }, [309] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, [310] = { 2, TD, SEN(eventfd2), "eventfd2" }, [311] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, @@ -321,12 +322,12 @@ [316] = { 5, TD, SEN(pwritev), "pwritev" }, [317] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, [318] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, -[319] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[319] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" }, [320] = { 4, TN, SEN(accept4), "accept4" }, [321] = { 4, 0, SEN(prlimit64), "prlimit64" }, [322] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, [323] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, -[324] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[324] = { 2, 0, SEN(clock_adjtime32), "clock_adjtime" }, [325] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, [326] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, [327] = { 1, TD, SEN(syncfs), "syncfs" }, @@ -351,3 +352,34 @@ [346] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, [347] = { 6, TD, SEN(preadv2), "preadv2" }, [348] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[349] = { 5, TD|TF|TSTA, SEN(statx), "statx" }, +[350] = { 6, 0, SEN(io_pgetevents_time32), "io_pgetevents" }, +[351] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, +[352] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, +[353] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[354] = { 4, 0, SEN(rseq), "rseq" }, +/* [355 ... 402] - reserved to sync up with other architectures */ +[403] = { 2, 0, SEN(clock_gettime64), "clock_gettime64" }, +[404] = { 2, 0, SEN(clock_settime64), "clock_settime64" }, +[405] = { 2, 0, SEN(clock_adjtime64), "clock_adjtime64" }, +[406] = { 2, 0, SEN(clock_getres_time64), "clock_getres_time64" }, +[407] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep_time64"}, +[408] = { 2, 0, SEN(timer_gettime64), "timer_gettime64" }, +[409] = { 4, 0, SEN(timer_settime64), "timer_settime64" }, +[410] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime64" }, +[411] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime64" }, +[412] = { 4, TD|TF, SEN(utimensat_time64), "utimensat_time64" }, +[413] = { 6, TD, SEN(pselect6_time64), "pselect6_time64" }, +[414] = { 5, TD, SEN(ppoll_time64), "ppoll_time64" }, +[416] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents_time64" }, +[417] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg_time64" }, +[418] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend_time64" }, +[419] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive_time64"}, +[420] = { 4, TI, SEN(semtimedop_time64), "semtimedop_time64" }, +[421] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait_time64"}, +[422] = { 6, 0, SEN(futex_time64), "futex_time64" }, +[423] = { 2, 0, SEN(sched_rr_get_interval_time64), "sched_rr_get_interval_time64" }, +[424] = { 4, TD|TS, SEN(pidfd_send_signal), "pidfd_send_signal" }, +[425] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" }, +[426] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" }, +[427] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" }, diff --git a/linux/hppa/userent.h b/linux/hppa/userent.h new file mode 100644 index 00000000..454b95a4 --- /dev/null +++ b/linux/hppa/userent.h @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define XLAT_PT_REGS_OFF(member) \ + { offsetof(struct pt_regs, member), \ + "offsetof(struct pt_regs, " #member ")" } + +XLAT_PT_REGS_OFF(gr[0]), +XLAT_PT_REGS_OFF(gr[1]), +XLAT_PT_REGS_OFF(gr[2]), +XLAT_PT_REGS_OFF(gr[3]), +XLAT_PT_REGS_OFF(gr[4]), +XLAT_PT_REGS_OFF(gr[5]), +XLAT_PT_REGS_OFF(gr[6]), +XLAT_PT_REGS_OFF(gr[7]), +XLAT_PT_REGS_OFF(gr[8]), +XLAT_PT_REGS_OFF(gr[9]), +XLAT_PT_REGS_OFF(gr[10]), +XLAT_PT_REGS_OFF(gr[11]), +XLAT_PT_REGS_OFF(gr[12]), +XLAT_PT_REGS_OFF(gr[13]), +XLAT_PT_REGS_OFF(gr[14]), +XLAT_PT_REGS_OFF(gr[15]), +XLAT_PT_REGS_OFF(gr[16]), +XLAT_PT_REGS_OFF(gr[17]), +XLAT_PT_REGS_OFF(gr[18]), +XLAT_PT_REGS_OFF(gr[19]), +XLAT_PT_REGS_OFF(gr[20]), +XLAT_PT_REGS_OFF(gr[21]), +XLAT_PT_REGS_OFF(gr[22]), +XLAT_PT_REGS_OFF(gr[23]), +XLAT_PT_REGS_OFF(gr[24]), +XLAT_PT_REGS_OFF(gr[25]), +XLAT_PT_REGS_OFF(gr[26]), +XLAT_PT_REGS_OFF(gr[27]), +XLAT_PT_REGS_OFF(gr[28]), +XLAT_PT_REGS_OFF(gr[29]), +XLAT_PT_REGS_OFF(gr[30]), +XLAT_PT_REGS_OFF(gr[31]), + +XLAT_PT_REGS_OFF(sr[0]), +XLAT_PT_REGS_OFF(sr[1]), +XLAT_PT_REGS_OFF(sr[2]), +XLAT_PT_REGS_OFF(sr[3]), +XLAT_PT_REGS_OFF(sr[4]), +XLAT_PT_REGS_OFF(sr[5]), +XLAT_PT_REGS_OFF(sr[6]), + +XLAT_PT_REGS_OFF(iasq[0]), +XLAT_PT_REGS_OFF(iasq[1]), + +XLAT_PT_REGS_OFF(iaoq[0]), +XLAT_PT_REGS_OFF(iaoq[1]), + +XLAT_PT_REGS_OFF(cr27), +XLAT_PT_REGS_OFF(orig_r28), +XLAT_PT_REGS_OFF(ksp), +XLAT_PT_REGS_OFF(kpc), +XLAT_PT_REGS_OFF(sar), +XLAT_PT_REGS_OFF(iir), +XLAT_PT_REGS_OFF(isr), +XLAT_PT_REGS_OFF(ior), +XLAT_PT_REGS_OFF(ipsw), + +#undef XLAT_PT_REGS_OFF diff --git a/linux/i386/arch_defs_.h b/linux/i386/arch_defs_.h new file mode 100644 index 00000000..0b2f3b0d --- /dev/null +++ b/linux/i386/arch_defs_.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define HAVE_ARCH_OLD_MMAP 1 +#define HAVE_ARCH_OLD_SELECT 1 +#define HAVE_ARCH_UID16_SYSCALLS 1 +#define CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL 1 diff --git a/linux/i386/arch_kvm.c b/linux/i386/arch_kvm.c new file mode 100644 index 00000000..e8e982ee --- /dev/null +++ b/linux/i386/arch_kvm.c @@ -0,0 +1 @@ +#include "x86_64/arch_kvm.c" diff --git a/linux/i386/arch_regs.c b/linux/i386/arch_regs.c index 0dcea1f0..fac42744 100644 --- a/linux/i386/arch_regs.c +++ b/linux/i386/arch_regs.c @@ -1,5 +1,15 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static struct user_regs_struct i386_regs; -unsigned long *const i386_esp_ptr = (unsigned long *) &i386_regs.esp; #define ARCH_REGS_FOR_GETREGS i386_regs #define ARCH_PC_REG i386_regs.eip +#define ARCH_SP_REG i386_regs.esp + +#undef ARCH_MIGHT_USE_SET_REGS +#define ARCH_MIGHT_USE_SET_REGS 0 diff --git a/linux/i386/arch_regs.h b/linux/i386/arch_regs.h deleted file mode 100644 index 6f622092..00000000 --- a/linux/i386/arch_regs.h +++ /dev/null @@ -1 +0,0 @@ -extern unsigned long *const i386_esp_ptr; diff --git a/linux/i386/arch_rt_sigframe.c b/linux/i386/arch_rt_sigframe.c new file mode 100644 index 00000000..b178a198 --- /dev/null +++ b/linux/i386/arch_rt_sigframe.c @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +FUNC_GET_RT_SIGFRAME_ADDR +{ + kernel_ulong_t sp; + return get_stack_pointer(tcp, &sp) ? sp - current_klongsize : 0; +} diff --git a/linux/i386/arch_sigreturn.c b/linux/i386/arch_sigreturn.c index 9446994e..67df3fee 100644 --- a/linux/i386/arch_sigreturn.c +++ b/linux/i386/arch_sigreturn.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static void arch_sigreturn(struct tcb *tcp) { @@ -13,10 +20,10 @@ arch_sigreturn(struct tcb *tcp) uint32_t struct_fpstate_padding[156]; uint32_t extramask; } frame; + kernel_ulong_t sp; - if (umove(tcp, *i386_esp_ptr, &frame) < 0) { - tprintf("{mask=%#lx}", (unsigned long) *i386_esp_ptr); - } else { + if (get_stack_pointer(tcp, &sp) && + !umove_or_printaddr(tcp, sp, &frame)) { uint32_t mask[2] = { frame.oldmask, frame.extramask }; tprintsigmask_addr("{mask=", mask); tprints("}"); diff --git a/linux/i386/get_error.c b/linux/i386/get_error.c index 1f63605e..c5e95c17 100644 --- a/linux/i386/get_error.c +++ b/linux/i386/get_error.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "negated_errno.h" + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { if (check_errno && is_negated_errno(i386_regs.eax)) { tcp->u_rval = -1; diff --git a/linux/i386/get_scno.c b/linux/i386/get_scno.c index c2e55510..980952f3 100644 --- a/linux/i386/get_scno.c +++ b/linux/i386/get_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) diff --git a/linux/i386/get_syscall_args.c b/linux/i386/get_syscall_args.c index d5de1d95..c048285a 100644 --- a/linux/i386/get_syscall_args.c +++ b/linux/i386/get_syscall_args.c @@ -1,6 +1,13 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { tcp->u_arg[0] = i386_regs.ebx; tcp->u_arg[1] = i386_regs.ecx; diff --git a/linux/i386/ioctls_arch0.h b/linux/i386/ioctls_arch0.h index e5b81a9d..adeef5d4 100644 --- a/linux/i386/ioctls_arch0.h +++ b/linux/i386/ioctls_arch0.h @@ -14,13 +14,13 @@ { "asm/mtrr.h", "MTRRIOC_KILL_PAGE_ENTRY", _IOC_WRITE, 0x4d09, 0x0c }, { "asm/mtrr.h", "MTRRIOC_SET_ENTRY", _IOC_WRITE, 0x4d01, 0x0c }, { "asm/mtrr.h", "MTRRIOC_SET_PAGE_ENTRY", _IOC_WRITE, 0x4d06, 0x0c }, -{ "linux/kvm.h", "KVM_ARM_SET_DEVICE_ADDR", _IOC_WRITE, 0xaeab, 0x10 }, { "linux/kvm.h", "KVM_ASSIGN_DEV_IRQ", _IOC_WRITE, 0xae70, 0x40 }, { "linux/kvm.h", "KVM_ASSIGN_PCI_DEVICE", _IOC_READ, 0xae69, 0x40 }, { "linux/kvm.h", "KVM_ASSIGN_SET_INTX_MASK", _IOC_WRITE, 0xaea4, 0x40 }, { "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_ENTRY", _IOC_WRITE, 0xae74, 0x10 }, { "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_NR", _IOC_WRITE, 0xae73, 0x08 }, { "linux/kvm.h", "KVM_CHECK_EXTENSION", _IOC_NONE, 0xae03, 0x00 }, +{ "linux/kvm.h", "KVM_CLEAR_DIRTY_LOG", _IOC_READ|_IOC_WRITE, 0xaec0, 0x18 }, { "linux/kvm.h", "KVM_CREATE_DEVICE", _IOC_READ|_IOC_WRITE, 0xaee0, 0x0c }, { "linux/kvm.h", "KVM_CREATE_IRQCHIP", _IOC_NONE, 0xae60, 0x00 }, { "linux/kvm.h", "KVM_CREATE_PIT", _IOC_NONE, 0xae64, 0x00 }, @@ -43,7 +43,9 @@ { "linux/kvm.h", "KVM_GET_LAPIC", _IOC_READ, 0xae8e, 0x400 }, { "linux/kvm.h", "KVM_GET_MP_STATE", _IOC_READ, 0xae98, 0x04 }, { "linux/kvm.h", "KVM_GET_MSRS", _IOC_READ|_IOC_WRITE, 0xae88, 0x08 }, +{ "linux/kvm.h", "KVM_GET_MSR_FEATURE_INDEX_LIST", _IOC_READ|_IOC_WRITE, 0xae0a, 0x04 }, { "linux/kvm.h", "KVM_GET_MSR_INDEX_LIST", _IOC_READ|_IOC_WRITE, 0xae02, 0x04 }, +{ "linux/kvm.h", "KVM_GET_NESTED_STATE", _IOC_READ|_IOC_WRITE, 0xaebe, 0x80 }, { "linux/kvm.h", "KVM_GET_NR_MMU_PAGES", _IOC_NONE, 0xae45, 0x00 }, { "linux/kvm.h", "KVM_GET_ONE_REG", _IOC_WRITE, 0xaeab, 0x10 }, { "linux/kvm.h", "KVM_GET_PIT", _IOC_READ|_IOC_WRITE, 0xae65, 0x48 }, @@ -52,39 +54,27 @@ { "linux/kvm.h", "KVM_GET_REG_LIST", _IOC_READ|_IOC_WRITE, 0xaeb0, 0x08 }, { "linux/kvm.h", "KVM_GET_SREGS", _IOC_READ, 0xae83, 0x138 }, { "linux/kvm.h", "KVM_GET_SUPPORTED_CPUID", _IOC_READ|_IOC_WRITE, 0xae05, 0x08 }, +{ "linux/kvm.h", "KVM_GET_SUPPORTED_HV_CPUID", _IOC_READ|_IOC_WRITE, 0xaec1, 0x08 }, { "linux/kvm.h", "KVM_GET_TSC_KHZ", _IOC_NONE, 0xaea3, 0x00 }, { "linux/kvm.h", "KVM_GET_VCPU_EVENTS", _IOC_READ, 0xae9f, 0x40 }, { "linux/kvm.h", "KVM_GET_VCPU_MMAP_SIZE", _IOC_NONE, 0xae04, 0x00 }, { "linux/kvm.h", "KVM_GET_XCRS", _IOC_READ, 0xaea6, 0x188 }, { "linux/kvm.h", "KVM_GET_XSAVE", _IOC_READ, 0xaea4, 0x1000 }, { "linux/kvm.h", "KVM_HAS_DEVICE_ATTR", _IOC_WRITE, 0xaee3, 0x18 }, +{ "linux/kvm.h", "KVM_HYPERV_EVENTFD", _IOC_WRITE, 0xaebd, 0x18 }, { "linux/kvm.h", "KVM_INTERRUPT", _IOC_WRITE, 0xae86, 0x04 }, { "linux/kvm.h", "KVM_IOEVENTFD", _IOC_WRITE, 0xae79, 0x40 }, { "linux/kvm.h", "KVM_IRQFD", _IOC_WRITE, 0xae76, 0x20 }, { "linux/kvm.h", "KVM_IRQ_LINE", _IOC_WRITE, 0xae61, 0x08 }, { "linux/kvm.h", "KVM_IRQ_LINE_STATUS", _IOC_READ|_IOC_WRITE, 0xae67, 0x08 }, { "linux/kvm.h", "KVM_KVMCLOCK_CTRL", _IOC_NONE, 0xaead, 0x00 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_OP", _IOC_READ|_IOC_WRITE, 0xaeba, 0x04 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_REG_REGION", _IOC_READ, 0xaebb, 0x10 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_UNREG_REGION", _IOC_READ, 0xaebc, 0x10 }, { "linux/kvm.h", "KVM_NMI", _IOC_NONE, 0xae9a, 0x00 }, -{ "linux/kvm.h", "KVM_PPC_ALLOCATE_HTAB", _IOC_READ|_IOC_WRITE, 0xaea7, 0x04 }, -{ "linux/kvm.h", "KVM_PPC_GET_PVINFO", _IOC_WRITE, 0xaea1, 0x80 }, -{ "linux/kvm.h", "KVM_PPC_GET_SMMU_INFO", _IOC_READ, 0xaea6, 0x250 }, { "linux/kvm.h", "KVM_REGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae67, 0x10 }, { "linux/kvm.h", "KVM_REINJECT_CONTROL", _IOC_NONE, 0xae71, 0x00 }, { "linux/kvm.h", "KVM_RUN", _IOC_NONE, 0xae80, 0x00 }, -{ "linux/kvm.h", "KVM_S390_ENABLE_SIE", _IOC_NONE, 0xae06, 0x00 }, -{ "linux/kvm.h", "KVM_S390_GET_IRQ_STATE", _IOC_WRITE, 0xaeb6, 0x20 }, -{ "linux/kvm.h", "KVM_S390_GET_SKEYS", _IOC_WRITE, 0xaeb2, 0x40 }, -{ "linux/kvm.h", "KVM_S390_INITIAL_RESET", _IOC_NONE, 0xae97, 0x00 }, -{ "linux/kvm.h", "KVM_S390_INTERRUPT", _IOC_WRITE, 0xae94, 0x10 }, -{ "linux/kvm.h", "KVM_S390_IRQ", _IOC_WRITE, 0xaeb4, 0x48 }, -{ "linux/kvm.h", "KVM_S390_MEM_OP", _IOC_WRITE, 0xaeb1, 0x40 }, -{ "linux/kvm.h", "KVM_S390_SET_INITIAL_PSW", _IOC_WRITE, 0xae96, 0x10 }, -{ "linux/kvm.h", "KVM_S390_SET_IRQ_STATE", _IOC_WRITE, 0xaeb5, 0x20 }, -{ "linux/kvm.h", "KVM_S390_SET_SKEYS", _IOC_WRITE, 0xaeb3, 0x40 }, -{ "linux/kvm.h", "KVM_S390_STORE_STATUS", _IOC_WRITE, 0xae95, 0x04 }, -{ "linux/kvm.h", "KVM_S390_UCAS_MAP", _IOC_WRITE, 0xae50, 0x18 }, -{ "linux/kvm.h", "KVM_S390_UCAS_UNMAP", _IOC_WRITE, 0xae51, 0x18 }, -{ "linux/kvm.h", "KVM_S390_VCPU_FAULT", _IOC_WRITE, 0xae52, 0x04 }, { "linux/kvm.h", "KVM_SET_BOOT_CPU_ID", _IOC_NONE, 0xae78, 0x00 }, { "linux/kvm.h", "KVM_SET_CLOCK", _IOC_WRITE, 0xae7b, 0x30 }, { "linux/kvm.h", "KVM_SET_CPUID", _IOC_WRITE, 0xae8a, 0x08 }, @@ -101,6 +91,7 @@ { "linux/kvm.h", "KVM_SET_MEMORY_REGION", _IOC_WRITE, 0xae40, 0x18 }, { "linux/kvm.h", "KVM_SET_MP_STATE", _IOC_WRITE, 0xae99, 0x04 }, { "linux/kvm.h", "KVM_SET_MSRS", _IOC_WRITE, 0xae89, 0x08 }, +{ "linux/kvm.h", "KVM_SET_NESTED_STATE", _IOC_WRITE, 0xaebf, 0x80 }, { "linux/kvm.h", "KVM_SET_NR_MMU_PAGES", _IOC_NONE, 0xae44, 0x00 }, { "linux/kvm.h", "KVM_SET_ONE_REG", _IOC_WRITE, 0xaeac, 0x10 }, { "linux/kvm.h", "KVM_SET_PIT", _IOC_READ, 0xae66, 0x48 }, diff --git a/linux/i386/raw_syscall.h b/linux/i386/raw_syscall.h new file mode 100644 index 00000000..71160397 --- /dev/null +++ b/linux/i386/raw_syscall.h @@ -0,0 +1,28 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + *err = 0; + kernel_ulong_t ret; + __asm__ __volatile__("int $0x80" + : "=a"(ret) + : "a"(nr) + : "memory", "cc"); + return ret; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/i386/rt_sigframe.h b/linux/i386/rt_sigframe.h new file mode 100644 index 00000000..e0ed10d2 --- /dev/null +++ b/linux/i386/rt_sigframe.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RT_SIGFRAME_H +# define STRACE_RT_SIGFRAME_H + +# include + +typedef struct { + uint32_t pretcode; + int sig; + uint32_t pinfo; + uint32_t puc; + siginfo_t info; + ucontext_t uc; + /* more data follows */ +} struct_rt_sigframe; + +#endif /* !STRACE_RT_SIGFRAME_H */ diff --git a/linux/i386/set_error.c b/linux/i386/set_error.c index 92b0a8d7..07861ac3 100644 --- a/linux/i386/set_error.c +++ b/linux/i386/set_error.c @@ -1,21 +1,20 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_error(struct tcb *tcp) { i386_regs.eax = -tcp->u_error; -#ifdef HAVE_GETREGS_OLD - return upoke(tcp->pid, 4 * EAX, i386_regs.eax); -#else - return set_regs(tcp->pid); -#endif + return upoke(tcp, 4 * EAX, i386_regs.eax); } static int arch_set_success(struct tcb *tcp) { i386_regs.eax = tcp->u_rval; -#ifdef HAVE_GETREGS_OLD - return upoke(tcp->pid, 4 * EAX, i386_regs.eax); -#else - return set_regs(tcp->pid); -#endif + return upoke(tcp, 4 * EAX, i386_regs.eax); } diff --git a/linux/i386/set_scno.c b/linux/i386/set_scno.c index 3abe7768..fcff8aeb 100644 --- a/linux/i386/set_scno.c +++ b/linux/i386/set_scno.c @@ -1,10 +1,12 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { -#ifdef HAVE_GETREGS_OLD - return upoke(tcp->pid, 4 * ORIG_EAX, scno); -#else - i386_regs.orig_eax = scno; - return set_regs(tcp->pid); -#endif + return upoke(tcp, 4 * ORIG_EAX, scno); } diff --git a/linux/i386/syscallent.h b/linux/i386/syscallent.h index 31023c20..98866f3d 100644 --- a/linux/i386/syscallent.h +++ b/linux/i386/syscallent.h @@ -1,29 +1,10 @@ /* * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995 Rick Sladkey + * Copyright (c) 1995-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ [ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, @@ -44,17 +25,17 @@ [ 15] = { 2, TF, SEN(chmod), "chmod" }, [ 16] = { 3, TF, SEN(chown16), "lchown" }, [ 17] = { 0, TM, SEN(break), "break" }, -[ 18] = { 2, TF, SEN(oldstat), "oldstat" }, +[ 18] = { 2, TF|TST|TSTA, SEN(oldstat), "oldstat" }, [ 19] = { 3, TD, SEN(lseek), "lseek" }, -[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 20] = { 0, PU|NF, SEN(getpid), "getpid" }, [ 21] = { 5, TF, SEN(mount), "mount" }, [ 22] = { 1, TF, SEN(umount), "umount" }, [ 23] = { 1, 0, SEN(setuid16), "setuid" }, -[ 24] = { 0, NF, SEN(getuid16), "getuid" }, +[ 24] = { 0, PU|NF, SEN(getuid16), "getuid" }, [ 25] = { 1, 0, SEN(stime), "stime" }, [ 26] = { 4, 0, SEN(ptrace), "ptrace" }, [ 27] = { 1, 0, SEN(alarm), "alarm" }, -[ 28] = { 2, TD, SEN(oldfstat), "oldfstat" }, +[ 28] = { 2, TD|TFST|TSTA, SEN(oldfstat), "oldfstat" }, [ 29] = { 0, TS, SEN(pause), "pause" }, [ 30] = { 2, TF, SEN(utime), "utime" }, [ 31] = { 2, 0, SEN(stty), "stty" }, @@ -73,10 +54,10 @@ [ 44] = { 0, 0, SEN(prof), "prof" }, [ 45] = { 1, TM|SI, SEN(brk), "brk" }, [ 46] = { 1, 0, SEN(setgid16), "setgid" }, -[ 47] = { 0, NF, SEN(getgid16), "getgid" }, +[ 47] = { 0, PU|NF, SEN(getgid16), "getgid" }, [ 48] = { 2, TS, SEN(signal), "signal" }, -[ 49] = { 0, NF, SEN(geteuid16), "geteuid" }, -[ 50] = { 0, NF, SEN(getegid16), "getegid" }, +[ 49] = { 0, PU|NF, SEN(geteuid16), "geteuid" }, +[ 50] = { 0, PU|NF, SEN(getegid16), "getegid" }, [ 51] = { 1, TF, SEN(acct), "acct" }, [ 52] = { 2, TF, SEN(umount2), "umount2" }, [ 53] = { 0, 0, SEN(lock), "lock" }, @@ -88,14 +69,14 @@ [ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, [ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, -[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 62] = { 2, TSFA, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, -[ 64] = { 0, NF, SEN(getppid), "getppid" }, -[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 64] = { 0, PU|NF, SEN(getppid), "getppid" }, +[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, [ 66] = { 0, 0, SEN(setsid), "setsid" }, [ 67] = { 3, TS, SEN(sigaction), "sigaction" }, -[ 68] = { 0, TS, SEN(siggetmask), "sgetmask" }, -[ 69] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[ 68] = { 0, TS, SEN(sgetmask), "sgetmask" }, +[ 69] = { 1, TS, SEN(ssetmask), "ssetmask" }, [ 70] = { 2, 0, SEN(setreuid16), "setreuid" }, [ 71] = { 2, 0, SEN(setregid16), "setregid" }, [ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, @@ -110,7 +91,7 @@ [ 81] = { 2, 0, SEN(setgroups16), "setgroups" }, [ 82] = { 1, TD, SEN(oldselect), "select" }, [ 83] = { 2, TF, SEN(symlink), "symlink" }, -[ 84] = { 2, TF, SEN(oldlstat), "oldlstat" }, +[ 84] = { 2, TF|TLST|TSTA, SEN(oldlstat), "oldlstat" }, [ 85] = { 3, TF, SEN(readlink), "readlink" }, [ 86] = { 1, TF, SEN(uselib), "uselib" }, [ 87] = { 2, TF, SEN(swapon), "swapon" }, @@ -125,16 +106,16 @@ [ 96] = { 2, 0, SEN(getpriority), "getpriority" }, [ 97] = { 3, 0, SEN(setpriority), "setpriority" }, [ 98] = { 4, 0, SEN(profil), "profil" }, -[ 99] = { 2, TF, SEN(statfs), "statfs" }, -[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, [101] = { 3, 0, SEN(ioperm), "ioperm" }, [102] = { 2, TD, SEN(socketcall), "socketcall" }, [103] = { 3, 0, SEN(syslog), "syslog" }, [104] = { 3, 0, SEN(setitimer), "setitimer" }, [105] = { 2, 0, SEN(getitimer), "getitimer" }, -[106] = { 2, TF, SEN(stat), "stat" }, -[107] = { 2, TF, SEN(lstat), "lstat" }, -[108] = { 2, TD, SEN(fstat), "fstat" }, +[106] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, +[107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, +[108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, [109] = { 1, 0, SEN(olduname), "olduname" }, [110] = { 1, 0, SEN(iopl), "iopl" }, [111] = { 0, 0, SEN(vhangup), "vhangup" }, @@ -150,7 +131,7 @@ [121] = { 2, 0, SEN(setdomainname), "setdomainname" }, [122] = { 1, 0, SEN(uname), "uname" }, [123] = { 3, 0, SEN(modify_ldt), "modify_ldt" }, -[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[124] = { 1, 0, SEN(adjtimex32), "adjtimex" }, [125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, [126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, [127] = { 2, 0, SEN(create_module), "create_module" }, @@ -187,14 +168,14 @@ [158] = { 0, 0, SEN(sched_yield), "sched_yield" }, [159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, -[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[161] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"}, +[162] = { 2, 0, SEN(nanosleep_time32), "nanosleep" }, [163] = { 5, TM|SI, SEN(mremap), "mremap" }, [164] = { 3, 0, SEN(setresuid16), "setresuid" }, [165] = { 3, 0, SEN(getresuid16), "getresuid" }, [166] = { 5, 0, SEN(vm86), "vm86" }, [167] = { 5, 0, SEN(query_module), "query_module" }, -[168] = { 3, TD, SEN(poll), "poll" }, +[168] = { 3, TD, SEN(poll_time32), "poll" }, [169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, [170] = { 3, 0, SEN(setresgid16), "setresgid" }, [171] = { 3, 0, SEN(getresgid16), "getresgid" }, @@ -203,7 +184,7 @@ [174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, [175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, [176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[177] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[177] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" }, [178] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, [179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, [180] = { 5, TD, SEN(pread), "pread64" }, @@ -221,14 +202,14 @@ [192] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" }, [193] = { 3, TF, SEN(truncate64), "truncate64" }, [194] = { 3, TD, SEN(ftruncate64), "ftruncate64" }, -[195] = { 2, TF, SEN(stat64), "stat64" }, -[196] = { 2, TF, SEN(lstat64), "lstat64" }, -[197] = { 2, TD, SEN(fstat64), "fstat64" }, +[195] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" }, +[196] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" }, +[197] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" }, [198] = { 3, TF, SEN(chown), "lchown32" }, -[199] = { 0, NF, SEN(getuid), "getuid32" }, -[200] = { 0, NF, SEN(getgid), "getgid32" }, -[201] = { 0, NF, SEN(geteuid), "geteuid32" }, -[202] = { 0, NF, SEN(getegid), "getegid32" }, +[199] = { 0, PU|NF, SEN(getuid), "getuid32" }, +[200] = { 0, PU|NF, SEN(getgid), "getgid32" }, +[201] = { 0, PU|NF, SEN(geteuid), "geteuid32" }, +[202] = { 0, PU|NF, SEN(getegid), "getegid32" }, [203] = { 2, 0, SEN(setreuid), "setreuid32" }, [204] = { 2, 0, SEN(setregid), "setregid32" }, [205] = { 2, 0, SEN(getgroups), "getgroups32" }, @@ -249,7 +230,7 @@ [220] = { 3, TD, SEN(getdents64), "getdents64" }, [221] = { 3, TD, SEN(fcntl64), "fcntl64" }, [222 ... 223] = { }, -[224] = { 0, NF, SEN(gettid), "gettid" }, +[224] = { 0, PU|NF, SEN(gettid), "gettid" }, [225] = { 4, TD, SEN(readahead), "readahead" }, [226] = { 5, TF, SEN(setxattr), "setxattr" }, [227] = { 5, TF, SEN(setxattr), "lsetxattr" }, @@ -265,14 +246,14 @@ [237] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [238] = { 2, TS, SEN(kill), "tkill" }, [239] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, -[240] = { 6, 0, SEN(futex), "futex" }, +[240] = { 6, 0, SEN(futex_time32), "futex" }, [241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [243] = { 1, 0, SEN(set_thread_area), "set_thread_area" }, [244] = { 1, 0, SEN(get_thread_area), "get_thread_area" }, [245] = { 2, TM, SEN(io_setup), "io_setup" }, [246] = { 1, TM, SEN(io_destroy), "io_destroy" }, -[247] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[247] = { 5, 0, SEN(io_getevents_time32), "io_getevents" }, [248] = { 3, 0, SEN(io_submit), "io_submit" }, [249] = { 3, 0, SEN(io_cancel), "io_cancel" }, [250] = { 5, TD, SEN(fadvise64), "fadvise64" }, @@ -285,16 +266,16 @@ [257] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, [258] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [259] = { 3, 0, SEN(timer_create), "timer_create" }, -[260] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[261] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[260] = { 4, 0, SEN(timer_settime32), "timer_settime" }, +[261] = { 2, 0, SEN(timer_gettime32), "timer_gettime" }, [262] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, [263] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[264] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[265] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[266] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[267] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, -[268] = { 3, TF, SEN(statfs64), "statfs64" }, -[269] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[264] = { 2, 0, SEN(clock_settime32), "clock_settime" }, +[265] = { 2, 0, SEN(clock_gettime32), "clock_gettime" }, +[266] = { 2, 0, SEN(clock_getres_time32), "clock_getres" }, +[267] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" }, +[268] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, +[269] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, [270] = { 3, TS, SEN(tgkill), "tgkill" }, [271] = { 2, TF, SEN(utimes), "utimes" }, [272] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, @@ -302,12 +283,12 @@ [274] = { 6, TM, SEN(mbind), "mbind" }, [275] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, [276] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, -[277] = { 4, 0, SEN(mq_open), "mq_open" }, +[277] = { 4, TD, SEN(mq_open), "mq_open" }, [278] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[279] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[280] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[281] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[282] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[279] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" }, +[280] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" }, +[281] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[282] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, [283] = { 4, 0, SEN(kexec_load), "kexec_load" }, [284] = { 5, TP, SEN(waitid), "waitid" }, [285] = { }, /* sys_setaltroot */ @@ -317,7 +298,7 @@ [289] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, [290] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, [291] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[292] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[292] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, [293] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, [294] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, [295] = { 4, TD|TF, SEN(openat), "openat" }, @@ -325,7 +306,7 @@ [297] = { 4, TD|TF, SEN(mknodat), "mknodat" }, [298] = { 5, TD|TF, SEN(fchownat), "fchownat" }, [299] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[300] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[300] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" }, [301] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, [302] = { 4, TD|TF, SEN(renameat), "renameat" }, [303] = { 5, TD|TF, SEN(linkat), "linkat" }, @@ -333,8 +314,8 @@ [305] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, [306] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, [307] = { 3, TD|TF, SEN(faccessat), "faccessat" }, -[308] = { 6, TD, SEN(pselect6), "pselect6" }, -[309] = { 5, TD, SEN(ppoll), "ppoll" }, +[308] = { 6, TD, SEN(pselect6_time32), "pselect6" }, +[309] = { 5, TD, SEN(ppoll_time32), "ppoll" }, [310] = { 1, TP, SEN(unshare), "unshare" }, [311] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, [312] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, @@ -345,13 +326,13 @@ [317] = { 6, TM, SEN(move_pages), "move_pages" }, [318] = { 3, 0, SEN(getcpu), "getcpu" }, [319] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[320] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[320] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [321] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [322] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [323] = { 1, TD, SEN(eventfd), "eventfd" }, [324] = { 6, TD, SEN(fallocate), "fallocate" }, -[325] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, -[326] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[325] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" }, +[326] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" }, [327] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, [328] = { 2, TD, SEN(eventfd2), "eventfd2" }, [329] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, @@ -362,13 +343,13 @@ [334] = { 5, TD, SEN(pwritev), "pwritev" }, [335] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, [336] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, -[337] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[337] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" }, [338] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, [339] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, [340] = { 4, 0, SEN(prlimit64), "prlimit64" }, [341] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, [342] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[343] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[343] = { 2, 0, SEN(clock_adjtime32), "clock_adjtime" }, [344] = { 1, TD, SEN(syncfs), "syncfs" }, [345] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, [346] = { 2, TD, SEN(setns), "setns" }, @@ -408,6 +389,45 @@ [380] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, [381] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, [382] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[383] = { 5, TD|TF|TSTA, SEN(statx), "statx" }, +[384] = { 2, TP, SEN(arch_prctl), "arch_prctl" }, +[385] = { 6, 0, SEN(io_pgetevents_time32), "io_pgetevents" }, +[386] = { 4, 0, SEN(rseq), "rseq" }, +/* room for arch specific calls */ +[393] = { 3, TI, SEN(semget), "semget" }, +[394] = { 4, TI, SEN(semctl), "semctl" }, +[395] = { 3, TI, SEN(shmget), "shmget" }, +[396] = { 3, TI, SEN(shmctl), "shmctl" }, +[397] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[398] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[399] = { 2, TI, SEN(msgget), "msgget" }, +[400] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[401] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[402] = { 3, TI, SEN(msgctl), "msgctl" }, +[403] = { 2, 0, SEN(clock_gettime64), "clock_gettime64" }, +[404] = { 2, 0, SEN(clock_settime64), "clock_settime64" }, +[405] = { 2, 0, SEN(clock_adjtime64), "clock_adjtime64" }, +[406] = { 2, 0, SEN(clock_getres_time64), "clock_getres_time64" }, +[407] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep_time64"}, +[408] = { 2, 0, SEN(timer_gettime64), "timer_gettime64" }, +[409] = { 4, 0, SEN(timer_settime64), "timer_settime64" }, +[410] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime64" }, +[411] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime64" }, +[412] = { 4, TD|TF, SEN(utimensat_time64), "utimensat_time64" }, +[413] = { 6, TD, SEN(pselect6_time64), "pselect6_time64" }, +[414] = { 5, TD, SEN(ppoll_time64), "ppoll_time64" }, +[416] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents_time64" }, +[417] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg_time64" }, +[418] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend_time64" }, +[419] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive_time64"}, +[420] = { 4, TI, SEN(semtimedop_time64), "semtimedop_time64" }, +[421] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait_time64"}, +[422] = { 6, 0, SEN(futex_time64), "futex_time64" }, +[423] = { 2, 0, SEN(sched_rr_get_interval_time64), "sched_rr_get_interval_time64" }, +[424] = { 4, TD|TS, SEN(pidfd_send_signal), "pidfd_send_signal" }, +[425] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" }, +[426] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" }, +[427] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" }, -#define SYS_socket_subcall 400 -#include "subcall.h" +#define SYS_socket_subcall 500 +#include "subcall32.h" diff --git a/linux/i386/userent.h b/linux/i386/userent.h index a8abd11d..bdbefd8c 100644 --- a/linux/i386/userent.h +++ b/linux/i386/userent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + XLAT(4*EBX), XLAT(4*ECX), XLAT(4*EDX), diff --git a/linux/i386/userent0.h b/linux/i386/userent0.h index d2728ff7..da7d4440 100644 --- a/linux/i386/userent0.h +++ b/linux/i386/userent0.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + XLAT_UOFF(u_fpvalid), XLAT_UOFF(i387), XLAT_UOFF(u_tsize), diff --git a/linux/ia64/arch_defs_.h b/linux/ia64/arch_defs_.h new file mode 100644 index 00000000..87ca0cdb --- /dev/null +++ b/linux/ia64/arch_defs_.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define HAVE_ARCH_GETRVAL2 1 +#define HAVE_ARCH_UID16_SYSCALLS 1 +#define HAVE_ARCH_SA_RESTORER 0 +#define HAVE_ARCH_DEDICATED_ERR_REG 1 diff --git a/linux/ia64/arch_getrval2.c b/linux/ia64/arch_getrval2.c index 7a6875f0..c518b607 100644 --- a/linux/ia64/arch_getrval2.c +++ b/linux/ia64/arch_getrval2.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + long getrval2(struct tcb *tcp) { + if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0) + return -1; return ia64_regs.gr[9]; } diff --git a/linux/ia64/arch_regs.c b/linux/ia64/arch_regs.c index deec1769..9d539da5 100644 --- a/linux/ia64/arch_regs.c +++ b/linux/ia64/arch_regs.c @@ -1,8 +1,12 @@ -static struct pt_all_user_regs ia64_regs; -unsigned long *const ia64_frame_ptr = &ia64_regs.gr[12]; +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ -#define IA64_PSR_IS (1UL << 34) -#define ia64_ia32mode (ia64_regs.cr_ipsr & IA64_PSR_IS) +static struct pt_all_user_regs ia64_regs; #define ARCH_REGS_FOR_GETREGS ia64_regs #define ARCH_PC_REG ia64_regs.br[0] +#define ARCH_SP_REG ia64_regs.gr[12] diff --git a/linux/ia64/arch_regs.h b/linux/ia64/arch_regs.h index 7ad969c8..2dcdc414 100644 --- a/linux/ia64/arch_regs.h +++ b/linux/ia64/arch_regs.h @@ -1,2 +1 @@ #include -extern unsigned long *const ia64_frame_ptr; diff --git a/linux/ia64/arch_rt_sigframe.c b/linux/ia64/arch_rt_sigframe.c new file mode 100644 index 00000000..6c8b637c --- /dev/null +++ b/linux/ia64/arch_rt_sigframe.c @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +FUNC_GET_RT_SIGFRAME_ADDR +{ + kernel_ulong_t sp; + return get_stack_pointer(tcp, &sp) ? sp + 16 : 0; +} diff --git a/linux/ia64/arch_sigreturn.c b/linux/ia64/arch_sigreturn.c deleted file mode 100644 index 0c0034f9..00000000 --- a/linux/ia64/arch_sigreturn.c +++ /dev/null @@ -1,12 +0,0 @@ -static void -arch_sigreturn(struct tcb *tcp) -{ - /* offsetof(struct sigframe, sc) */ -#define OFFSETOF_STRUCT_SIGFRAME_SC 0xA0 - const unsigned long addr = *ia64_frame_ptr + 16 + - OFFSETOF_STRUCT_SIGFRAME_SC + - offsetof(struct sigcontext, sc_mask); - tprints("{mask="); - print_sigset_addr_len(tcp, addr, NSIG_BYTES); - tprints("}"); -} diff --git a/linux/ia64/get_error.c b/linux/ia64/get_error.c index 52daa7f4..ce196bce 100644 --- a/linux/ia64/get_error.c +++ b/linux/ia64/get_error.c @@ -1,20 +1,19 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "negated_errno.h" + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { - if (ia64_ia32mode) { - int err = ia64_regs.gr[8]; - if (check_errno && is_negated_errno(err)) { - tcp->u_rval = -1; - tcp->u_error = -err; - } else { - tcp->u_rval = err; - } + if (ia64_regs.gr[10]) { + tcp->u_rval = -1; + tcp->u_error = ia64_regs.gr[8]; } else { - if (ia64_regs.gr[10]) { - tcp->u_rval = -1; - tcp->u_error = ia64_regs.gr[8]; - } else { - tcp->u_rval = ia64_regs.gr[8]; - } + tcp->u_rval = ia64_regs.gr[8]; } } diff --git a/linux/ia64/get_scno.c b/linux/ia64/get_scno.c index 0ddc17a9..6aba4097 100644 --- a/linux/ia64/get_scno.c +++ b/linux/ia64/get_scno.c @@ -1,7 +1,14 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) { - tcp->scno = ia64_ia32mode ? ia64_regs.gr[0] : ia64_regs.gr[15]; + tcp->scno = ia64_regs.gr[15]; return 1; } diff --git a/linux/ia64/get_syscall_args.c b/linux/ia64/get_syscall_args.c index 1b942eba..83a933eb 100644 --- a/linux/ia64/get_syscall_args.c +++ b/linux/ia64/get_syscall_args.c @@ -1,29 +1,33 @@ +/* + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { - if (!ia64_ia32mode) { - unsigned long *rbs_end = - (unsigned long *) ia64_regs.ar[PT_AUR_BSP]; - unsigned long sof = (ia64_regs.cfm >> 0) & 0x7f; - unsigned long sol = (ia64_regs.cfm >> 7) & 0x7f; - unsigned long *out0 = ia64_rse_skip_regs(rbs_end, -sof + sol); - unsigned int i; + unsigned long *rbs_end = + (unsigned long *) ia64_regs.ar[PT_AUR_BSP]; + unsigned long sof = (ia64_regs.cfm >> 0) & 0x7f; + unsigned long sol = (ia64_regs.cfm >> 7) & 0x7f; + unsigned long *out0 = ia64_rse_skip_regs(rbs_end, -sof + sol); + unsigned int i; - for (i = 0; i < tcp->s_ent->nargs; ++i) { - if (umove(tcp, - (unsigned long) ia64_rse_skip_regs(out0, i), - &tcp->u_arg[i]) < 0) + for (i = 0; i < n_args(tcp); ++i) { + if (umove(tcp, + (unsigned long) ia64_rse_skip_regs(out0, i), + &tcp->u_arg[i]) < 0) { + if (errno == EPERM) + tcp->u_arg[i] = 0; + else return -1; } - } else { - /* truncate away IVE sign-extension */ - tcp->u_arg[0] = 0xffffffff & ia64_regs.gr[11]; /* EBX */ - tcp->u_arg[1] = 0xffffffff & ia64_regs.gr[ 9]; /* ECX */ - tcp->u_arg[2] = 0xffffffff & ia64_regs.gr[10]; /* EDX */ - tcp->u_arg[3] = 0xffffffff & ia64_regs.gr[14]; /* ESI */ - tcp->u_arg[4] = 0xffffffff & ia64_regs.gr[15]; /* EDI */ - tcp->u_arg[5] = 0xffffffff & ia64_regs.gr[13]; /* EBP */ } + return 1; } diff --git a/linux/ia64/raw_syscall.h b/linux/ia64/raw_syscall.h new file mode 100644 index 00000000..1e1f540f --- /dev/null +++ b/linux/ia64/raw_syscall.h @@ -0,0 +1,41 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + register kernel_ulong_t r15 __asm__("r15") = nr; + register kernel_ulong_t r8 __asm__("r8"); + register kernel_ulong_t r10 __asm__("r10"); + __asm__ __volatile__("break 0x100000" + : "=r"(r8), "=r"(r10), "+r"(r15) + : + : "memory", "out0", "out1", "out2", + "out3", "out4", "out5", "out6", "out7", + "r2", "r3", "r9", "r11", "r13", + "r14", "r16", "r17", "r18", "r19", "r20", + "r21", "r22", "r23", "r24", "r25", "r26", + "r27", "r28", "r29", "r30", "r31", + "p6", "p7", "p8", "p9", "p10", + "p11", "p12", "p13", "p14", "p15", + "f6", "f7", "f8", "f9", "f10", + "f11", "f12", "f13", "f14", "f15", + "f5", "f6", "f7", "f8", "f9", "f10", "f11", + "b6", "b7"); + *err = !!r10; + return r8; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/ia64/rt_sigframe.h b/linux/ia64/rt_sigframe.h new file mode 100644 index 00000000..3f58dadf --- /dev/null +++ b/linux/ia64/rt_sigframe.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RT_SIGFRAME_H +# define STRACE_RT_SIGFRAME_H + +# include + +typedef struct { + unsigned long arg0; + unsigned long arg1; + unsigned long arg2; + void *handler; + siginfo_t info; + struct sigcontext sc; +} struct_rt_sigframe; + +# define OFFSETOF_SIGMASK_IN_RT_SIGFRAME \ + offsetof(struct_rt_sigframe, sc.sc_mask) + +#endif /* !STRACE_RT_SIGFRAME_H */ diff --git a/linux/ia64/set_error.c b/linux/ia64/set_error.c index c566b638..b27154e1 100644 --- a/linux/ia64/set_error.c +++ b/linux/ia64/set_error.c @@ -1,12 +1,16 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_error(struct tcb *tcp) { - if (ia64_ia32mode) { - ia64_regs.gr[8] = -tcp->u_error; - } else { - ia64_regs.gr[8] = tcp->u_error; - ia64_regs.gr[10] = -1; - } + ia64_regs.gr[8] = tcp->u_error; + ia64_regs.gr[10] = -1; + return set_regs(tcp->pid); } @@ -14,8 +18,7 @@ static int arch_set_success(struct tcb *tcp) { ia64_regs.gr[8] = tcp->u_rval; - if (!ia64_ia32mode) { - ia64_regs.gr[10] = 0; - } + ia64_regs.gr[10] = 0; + return set_regs(tcp->pid); } diff --git a/linux/ia64/set_scno.c b/linux/ia64/set_scno.c index 1af7b025..c1c89df9 100644 --- a/linux/ia64/set_scno.c +++ b/linux/ia64/set_scno.c @@ -1,10 +1,14 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { - if (ia64_ia32mode) - ia64_regs.gr[0] = scno; - else - ia64_regs.gr[15] = scno; + ia64_regs.gr[15] = scno; return set_regs(tcp->pid); } diff --git a/linux/ia64/syscallent.h b/linux/ia64/syscallent.h index 97ecab9c..f6062c4d 100644 --- a/linux/ia64/syscallent.h +++ b/linux/ia64/syscallent.h @@ -1,369 +1,348 @@ /* * Copyright (c) 1999, 2001 Hewlett-Packard Co - * David Mosberger-Tang + * David Mosberger-Tang + * Copyright (c) 2000-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * IA-32 syscalls that have pointer arguments which are incompatible - * with 64-bit layout get redirected to printargs. + * SPDX-License-Identifier: LGPL-2.1-or-later */ -#if CST > 0 -# undef SYS_FUNC_NAME -# define SYS_FUNC_NAME(syscall_name) printargs -# include "../i386/syscallent.h" -# undef SYS_FUNC_NAME -# define SYS_FUNC_NAME(syscall_name) MPERS_FUNC_NAME(syscall_name) -#endif -/* You must be careful to check ../i386/syscallent.h so that this table - starts where that one leaves off. -*/ -[1024] = { 0, 0, SEN(printargs), "ni_syscall" }, -[1025] = { 1, TP|SE, SEN(exit), "exit" }, -[1026] = { 3, TD, SEN(read), "read" }, -[1027] = { 3, TD, SEN(write), "write" }, -[1028] = { 3, TD|TF, SEN(open), "open" }, -[1029] = { 1, TD, SEN(close), "close" }, -[1030] = { 2, TD|TF, SEN(creat), "creat" }, -[1031] = { 2, TF, SEN(link), "link" }, -[1032] = { 1, TF, SEN(unlink), "unlink" }, -[1033] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, -[1034] = { 1, TF, SEN(chdir), "chdir" }, -[1035] = { 1, TD, SEN(fchdir), "fchdir" }, -[1036] = { 2, TF, SEN(utimes), "utimes" }, -[1037] = { 3, TF, SEN(mknod), "mknod" }, -[1038] = { 2, TF, SEN(chmod), "chmod" }, -[1039] = { 3, TF, SEN(chown), "chown" }, -[1040] = { 3, TD, SEN(lseek), "lseek" }, -[1041] = { 0, NF, SEN(getpid), "getpid" }, -[1042] = { 0, NF, SEN(getppid), "getppid" }, -[1043] = { 5, TF, SEN(mount), "mount" }, -[1044] = { 2, TF, SEN(umount2), "umount" }, -[1045] = { 1, 0, SEN(setuid), "setuid" }, -[1046] = { 0, NF, SEN(getuid), "getuid" }, -[1047] = { 0, NF, SEN(geteuid), "geteuid" }, -[1048] = { 4, 0, SEN(ptrace), "ptrace" }, -[1049] = { 2, TF, SEN(access), "access" }, -[1050] = { 0, 0, SEN(sync), "sync" }, -[1051] = { 1, TD, SEN(fsync), "fsync" }, -[1052] = { 1, TD, SEN(fdatasync), "fdatasync" }, -[1053] = { 2, TS, SEN(kill), "kill" }, -[1054] = { 2, TF, SEN(rename), "rename" }, -[1055] = { 2, TF, SEN(mkdir), "mkdir" }, -[1056] = { 1, TF, SEN(rmdir), "rmdir" }, -[1057] = { 1, TD, SEN(dup), "dup" }, -[1058] = { 0, TD, SEN(pipe), "pipe" }, -[1059] = { 1, 0, SEN(times), "times" }, -[1060] = { 1, TM|SI, SEN(brk), "brk" }, -[1061] = { 1, 0, SEN(setgid), "setgid" }, -[1062] = { 0, NF, SEN(getgid), "getgid" }, -[1063] = { 0, NF, SEN(getegid), "getegid" }, -[1064] = { 1, TF, SEN(acct), "acct" }, -[1065] = { 3, TD, SEN(ioctl), "ioctl" }, -[1066] = { 3, TD, SEN(fcntl), "fcntl" }, -[1067] = { 1, NF, SEN(umask), "umask" }, -[1068] = { 1, TF, SEN(chroot), "chroot" }, -[1069] = { 2, 0, SEN(ustat), "ustat" }, -[1070] = { 2, TD, SEN(dup2), "dup2" }, -[1071] = { 2, 0, SEN(setreuid), "setreuid" }, -[1072] = { 2, 0, SEN(setregid), "setregid" }, -[1073] = { 3, 0, SEN(getresuid), "getresuid" }, -[1074] = { 3, 0, SEN(setresuid), "setresuid" }, -[1075] = { 3, 0, SEN(getresgid), "getresgid" }, -[1076] = { 3, 0, SEN(setresgid), "setresgid" }, -[1077] = { 2, 0, SEN(getgroups), "getgroups" }, -[1078] = { 2, 0, SEN(setgroups), "setgroups" }, -[1079] = { 1, 0, SEN(getpgid), "getpgid" }, -[1080] = { 2, 0, SEN(setpgid), "setpgid" }, -[1081] = { 0, 0, SEN(setsid), "setsid" }, -[1082] = { 1, 0, SEN(getsid), "getsid" }, -[1083] = { 2, 0, SEN(sethostname), "sethostname" }, -[1084] = { 2, 0, SEN(setrlimit), "setrlimit" }, -[1085] = { 2, 0, SEN(getrlimit), "getrlimit" }, -[1086] = { 2, 0, SEN(getrusage), "getrusage" }, -[1087] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, -[1088] = { 2, 0, SEN(settimeofday), "settimeofday" }, -[1089] = { 5, TD, SEN(select), "select" }, -[1090] = { 3, TD, SEN(poll), "poll" }, -[1091] = { 2, TF, SEN(symlink), "symlink" }, -[1092] = { 3, TF, SEN(readlink), "readlink" }, -[1093] = { 1, TF, SEN(uselib), "uselib" }, -[1094] = { 2, TF, SEN(swapon), "swapon" }, -[1095] = { 1, TF, SEN(swapoff), "swapoff" }, -[1096] = { 4, 0, SEN(reboot), "reboot" }, -[1097] = { 2, TF, SEN(truncate), "truncate" }, -[1098] = { 2, TD, SEN(ftruncate), "ftruncate" }, -[1099] = { 2, TD, SEN(fchmod), "fchmod" }, -[1100] = { 3, TD, SEN(fchown), "fchown" }, -[1101] = { 2, 0, SEN(getpriority), "getpriority" }, -[1102] = { 3, 0, SEN(setpriority), "setpriority" }, -[1103] = { 2, TF, SEN(statfs), "statfs" }, -[1104] = { 2, TD, SEN(fstatfs), "fstatfs" }, -[1105] = { 0, NF, SEN(gettid), "gettid" }, -[1106] = { 3, TI, SEN(semget), "semget" }, -[1107] = { 3, TI, SEN(semop), "semop" }, -[1108] = { 4, TI, SEN(semctl), "semctl" }, -[1109] = { 2, TI, SEN(msgget), "msgget" }, -[1110] = { 4, TI, SEN(msgsnd), "msgsnd" }, -[1111] = { 5, TI, SEN(msgrcv), "msgrcv" }, -[1112] = { 3, TI, SEN(msgctl), "msgctl" }, -[1113] = { 3, TI, SEN(shmget), "shmget" }, -[1114] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, -[1115] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, -[1116] = { 3, TI, SEN(shmctl), "shmctl" }, -[1117] = { 3, 0, SEN(syslog), "syslog" }, -[1118] = { 3, 0, SEN(setitimer), "setitimer" }, -[1119] = { 2, 0, SEN(getitimer), "getitimer" }, -[1120] = { 2, TF, SEN(stat), "stat" }, -[1121] = { 2, TF, SEN(lstat), "lstat" }, -[1122] = { 2, TD, SEN(fstat), "fstat" }, -[1123] = { 0, 0, SEN(vhangup), "vhangup" }, -[1124] = { 3, TF, SEN(chown), "lchown" }, -[1125] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, -[1126] = { 4, TP, SEN(wait4), "wait4" }, -[1127] = { 1, 0, SEN(sysinfo), "sysinfo" }, -[1128] = { 5, TP, SEN(clone), "clone" }, -[1129] = { 2, 0, SEN(setdomainname), "setdomainname" }, -[1130] = { 1, 0, SEN(uname), "uname" }, -[1131] = { 1, 0, SEN(adjtimex), "adjtimex" }, -[1132] = { 2, 0, SEN(create_module), "create_module" }, -[1133] = { 3, 0, SEN(init_module), "init_module" }, -[1134] = { 2, 0, SEN(delete_module), "delete_module" }, -[1135] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, -[1136] = { 5, 0, SEN(query_module), "query_module" }, -[1137] = { 4, TF, SEN(quotactl), "quotactl" }, -[1138] = { 2, 0, SEN(bdflush), "bdflush" }, -[1139] = { 3, 0, SEN(sysfs), "sysfs" }, -[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" }, -[1144] = { 3, TD, SEN(getdents), "getdents" }, -[1145] = { 2, TD, SEN(flock), "flock" }, -[1146] = { 3, TD, SEN(readv), "readv" }, -[1147] = { 3, TD, SEN(writev), "writev" }, -[1148] = { 4, TD, SEN(pread), "pread64" }, -[1149] = { 4, TD, SEN(pwrite), "pwrite64" }, -[1150] = { 1, 0, SEN(printargs), "_sysctl" }, -[1151] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, -[1152] = { 2, TM|SI, SEN(munmap), "munmap" }, -[1153] = { 2, TM, SEN(mlock), "mlock" }, -[1154] = { 1, TM, SEN(mlockall), "mlockall" }, -[1155] = { 3, TM|SI, SEN(mprotect), "mprotect" }, -[1156] = { 5, TM|SI, SEN(mremap), "mremap" }, -[1157] = { 3, TM, SEN(msync), "msync" }, -[1158] = { 2, TM, SEN(munlock), "munlock" }, -[1159] = { 0, TM, SEN(munlockall), "munlockall" }, -[1160] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, -[1161] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, -[1162] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, -[1163] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, -[1164] = { 0, 0, SEN(sched_yield), "sched_yield" }, -[1165] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, -[1166] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[1167] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, -[1168] = { 2, 0, SEN(nanosleep), "nanosleep" }, -[1169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, -[1170] = { 5, 0, SEN(prctl), "prctl" }, -[1171] = { 0, 0, SEN(getpagesize), "getpagesize" }, -[1172] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" }, -[1173] = { 5, 0, SEN(printargs), "pciconfig_read" }, -[1174] = { 5, 0, SEN(printargs), "pciconfig_write" }, -[1175] = { MA, 0, SEN(printargs), "perfmonctl" }, -[1176] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, -[1177] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, -[1178] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[1179] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, -[1180] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, -[1181] = { 0, TS, SEN(sigreturn), "rt_sigreturn" }, -[1182] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, -[1183] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, -[1184] = { 2, TF, SEN(getcwd), "getcwd" }, -[1185] = { 2, 0, SEN(capget), "capget" }, -[1186] = { 2, 0, SEN(capset), "capset" }, -[1187] = { 4, TD|TN, SEN(sendfile), "sendfile" }, -[1188] = { 5, TN, SEN(getpmsg), "getpmsg" }, -[1189] = { 5, TN, SEN(putpmsg), "putpmsg" }, -[1190] = { 3, TN, SEN(socket), "socket" }, -[1191] = { 3, TN, SEN(bind), "bind" }, -[1192] = { 3, TN, SEN(connect), "connect" }, -[1193] = { 2, TN, SEN(listen), "listen" }, -[1194] = { 3, TN, SEN(accept), "accept" }, -[1195] = { 3, TN, SEN(getsockname), "getsockname" }, -[1196] = { 3, TN, SEN(getpeername), "getpeername" }, -[1197] = { 4, TN, SEN(socketpair), "socketpair" }, -[1198] = { 4, TN, SEN(send), "send" }, -[1199] = { 6, TN, SEN(sendto), "sendto" }, -[1200] = { 4, TN, SEN(recv), "recv" }, -[1201] = { 6, TN, SEN(recvfrom), "recvfrom" }, -[1202] = { 2, TN, SEN(shutdown), "shutdown" }, -[1203] = { 5, TN, SEN(setsockopt), "setsockopt" }, -[1204] = { 5, TN, SEN(getsockopt), "getsockopt" }, -[1205] = { 3, TN, SEN(sendmsg), "sendmsg" }, -[1206] = { 3, TN, SEN(recvmsg), "recvmsg" }, -[1207] = { 2, TF, SEN(pivotroot), "pivot_root" }, -[1208] = { 3, TM, SEN(mincore), "mincore" }, -[1209] = { 3, TM, SEN(madvise), "madvise" }, -[1210] = { 2, TF, SEN(stat), "stat" }, -[1211] = { 2, TF, SEN(lstat), "lstat" }, -[1212] = { 2, TD, SEN(fstat), "fstat" }, -[1213] = { 6, TP, SEN(clone), "clone2" }, -[1214] = { 3, TD, SEN(getdents64), "getdents64" }, -[1215] = { 2, 0, SEN(printargs), "getunwind" }, -[1216] = { 3, TD, SEN(readahead), "readahead" }, -[1217] = { 5, TF, SEN(setxattr), "setxattr" }, -[1218] = { 5, TF, SEN(setxattr), "lsetxattr" }, -[1219] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, -[1220] = { 4, TF, SEN(getxattr), "getxattr" }, -[1221] = { 4, TF, SEN(getxattr), "lgetxattr" }, -[1222] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, -[1223] = { 3, TF, SEN(listxattr), "listxattr" }, -[1224] = { 3, TF, SEN(listxattr), "llistxattr" }, -[1225] = { 3, TD, SEN(flistxattr), "flistxattr" }, -[1226] = { 2, TF, SEN(removexattr), "removexattr" }, -[1227] = { 2, TF, SEN(removexattr), "lremovexattr" }, -[1228] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, -[1229] = { 2, TS, SEN(kill), "tkill" }, -[1230] = { 6, 0, SEN(futex), "futex" }, -[1231] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, -[1232] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, -[1233] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, -[1234] = { 4, TD, SEN(fadvise64), "fadvise64" }, -[1235] = { 3, TS, SEN(tgkill), "tgkill" }, -[1236] = { 1, TP|SE, SEN(exit), "exit_group" }, -[1237] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" }, -[1238] = { 2, TM, SEN(io_setup), "io_setup" }, -[1239] = { 1, TM, SEN(io_destroy), "io_destroy" }, -[1240] = { 5, 0, SEN(io_getevents), "io_getevents" }, -[1241] = { 3, 0, SEN(io_submit), "io_submit" }, -[1242] = { 3, 0, SEN(io_cancel), "io_cancel" }, -[1243] = { 1, TD, SEN(epoll_create), "epoll_create" }, -[1244] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, -[1245] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, -[1246] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, -[1247] = { 4, TI, SEN(semtimedop), "semtimedop" }, -[1248] = { 3, 0, SEN(timer_create), "timer_create" }, -[1249] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[1250] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, -[1251] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, -[1252] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[1253] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[1254] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[1255] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[1256] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, -[1257] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, -[1258] = { 3, TF, SEN(statfs64), "statfs64" }, -[1259] = { 6, TM, SEN(mbind), "mbind" }, -[1260] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, -[1261] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, -[1262] = { 4, 0, SEN(mq_open), "mq_open" }, -[1263] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[1264] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[1265] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[1266] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[1267] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, -[1268] = { 4, 0, SEN(kexec_load), "kexec_load" }, -[1269] = { 5, 0, SEN(vserver), "vserver" }, -[1270] = { 5, TP, SEN(waitid), "waitid" }, -[1271] = { 5, 0, SEN(add_key), "add_key" }, -[1272] = { 4, 0, SEN(request_key), "request_key" }, -[1273] = { 5, 0, SEN(keyctl), "keyctl" }, -[1274] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, -[1275] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, -[1276] = { 6, TM, SEN(move_pages), "move_pages" }, -[1277] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[1278] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, -[1279] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, -[1280] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, -[1281] = { 4, TD|TF, SEN(openat), "openat" }, -[1282] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, -[1283] = { 4, TD|TF, SEN(mknodat), "mknodat" }, -[1284] = { 5, TD|TF, SEN(fchownat), "fchownat" }, -[1285] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[1286] = { 4, TD|TF, SEN(newfstatat), "newfstatat" }, -[1287] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, -[1288] = { 4, TD|TF, SEN(renameat), "renameat" }, -[1289] = { 5, TD|TF, SEN(linkat), "linkat" }, -[1290] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, -[1291] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, -[1292] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, -[1293] = { 3, TD|TF, SEN(faccessat), "faccessat" }, -[1294] = { 6, TD, SEN(pselect6), "pselect6" }, -[1295] = { 5, TD, SEN(ppoll), "ppoll" }, -[1296] = { 1, TP, SEN(unshare), "unshare" }, -[1297] = { 6, TD, SEN(splice), "splice" }, -[1298] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, -[1299] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, -[1300] = { 4, TD, SEN(sync_file_range), "sync_file_range" }, -[1301] = { 4, TD, SEN(tee), "tee" }, -[1302] = { 4, TD, SEN(vmsplice), "vmsplice" }, -[1303] = { 4, TD, SEN(fallocate), "fallocate" }, -[1304] = { 3, 0, SEN(getcpu), "getcpu" }, -[1305] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[1306] = { 4, TD|TF, SEN(utimensat), "utimensat" }, -[1307] = { 3, TD|TS, SEN(signalfd), "signalfd" }, -[1308] = { 4, TD, SEN(timerfd), "timerfd" }, -[1309] = { 1, TD, SEN(eventfd), "eventfd" }, -[1310] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, -[1311] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, -[1312] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, -[1313] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, -[1314] = { 2, TD, SEN(eventfd2), "eventfd2" }, -[1315] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, -[1316] = { 3, TD, SEN(dup3), "dup3" }, -[1317] = { 2, TD, SEN(pipe2), "pipe2" }, -[1318] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, -[1319] = { 4, TD, SEN(preadv), "preadv" }, -[1320] = { 4, TD, SEN(pwritev), "pwritev" }, -[1321] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, -[1322] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, -[1323] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, -[1324] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, -[1325] = { 4, 0, SEN(prlimit64), "prlimit64" }, -[1326] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, -[1327] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[1328] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, -[1329] = { 1, TD, SEN(syncfs), "syncfs" }, -[1330] = { 2, TD, SEN(setns), "setns" }, -[1331] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, -[1332] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, -[1333] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, -[1334] = { 4, TN, SEN(accept4), "accept4" }, -[1335] = { 3, TD, SEN(finit_module), "finit_module" }, -[1336] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, -[1337] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, -[1338] = { 5, TD|TF, SEN(renameat2), "renameat2" }, -[1339] = { 3, 0, SEN(getrandom), "getrandom" }, -[1340] = { 2, TD, SEN(memfd_create), "memfd_create" }, -[1341] = { 3, TD, SEN(bpf), "bpf" }, -[1342] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, -[1343] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, -[1344] = { 2, 0, SEN(membarrier), "membarrier" }, -[1345] = { 5, 0, SEN(kcmp), "kcmp" }, -[1346] = { 3, TM, SEN(mlock2), "mlock2" }, -[1347] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, -[1348] = { 6, TD, SEN(preadv2), "preadv2" }, -[1349] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[1024 + 0] = { 0, 0, SEN(printargs), "ni_syscall" }, +[1024 + 1] = { 1, TP|SE, SEN(exit), "exit" }, +[1024 + 2] = { 3, TD, SEN(read), "read" }, +[1024 + 3] = { 3, TD, SEN(write), "write" }, +[1024 + 4] = { 3, TD|TF, SEN(open), "open" }, +[1024 + 5] = { 1, TD, SEN(close), "close" }, +[1024 + 6] = { 2, TD|TF, SEN(creat), "creat" }, +[1024 + 7] = { 2, TF, SEN(link), "link" }, +[1024 + 8] = { 1, TF, SEN(unlink), "unlink" }, +[1024 + 9] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, +[1024 + 10] = { 1, TF, SEN(chdir), "chdir" }, +[1024 + 11] = { 1, TD, SEN(fchdir), "fchdir" }, +[1024 + 12] = { 2, TF, SEN(utimes), "utimes" }, +[1024 + 13] = { 3, TF, SEN(mknod), "mknod" }, +[1024 + 14] = { 2, TF, SEN(chmod), "chmod" }, +[1024 + 15] = { 3, TF, SEN(chown), "chown" }, +[1024 + 16] = { 3, TD, SEN(lseek), "lseek" }, +[1024 + 17] = { 0, PU|NF, SEN(getpid), "getpid" }, +[1024 + 18] = { 0, PU|NF, SEN(getppid), "getppid" }, +[1024 + 19] = { 5, TF, SEN(mount), "mount" }, +[1024 + 20] = { 2, TF, SEN(umount2), "umount" }, +[1024 + 21] = { 1, 0, SEN(setuid), "setuid" }, +[1024 + 22] = { 0, PU|NF, SEN(getuid), "getuid" }, +[1024 + 23] = { 0, PU|NF, SEN(geteuid), "geteuid" }, +[1024 + 24] = { 4, 0, SEN(ptrace), "ptrace" }, +[1024 + 25] = { 2, TF, SEN(access), "access" }, +[1024 + 26] = { 0, 0, SEN(sync), "sync" }, +[1024 + 27] = { 1, TD, SEN(fsync), "fsync" }, +[1024 + 28] = { 1, TD, SEN(fdatasync), "fdatasync" }, +[1024 + 29] = { 2, TS, SEN(kill), "kill" }, +[1024 + 30] = { 2, TF, SEN(rename), "rename" }, +[1024 + 31] = { 2, TF, SEN(mkdir), "mkdir" }, +[1024 + 32] = { 1, TF, SEN(rmdir), "rmdir" }, +[1024 + 33] = { 1, TD, SEN(dup), "dup" }, +[1024 + 34] = { 0, TD, SEN(pipe), "pipe" }, +[1024 + 35] = { 1, 0, SEN(times), "times" }, +[1024 + 36] = { 1, TM|SI, SEN(brk), "brk" }, +[1024 + 37] = { 1, 0, SEN(setgid), "setgid" }, +[1024 + 38] = { 0, PU|NF, SEN(getgid), "getgid" }, +[1024 + 39] = { 0, PU|NF, SEN(getegid), "getegid" }, +[1024 + 40] = { 1, TF, SEN(acct), "acct" }, +[1024 + 41] = { 3, TD, SEN(ioctl), "ioctl" }, +[1024 + 42] = { 3, TD, SEN(fcntl), "fcntl" }, +[1024 + 43] = { 1, NF, SEN(umask), "umask" }, +[1024 + 44] = { 1, TF, SEN(chroot), "chroot" }, +[1024 + 45] = { 2, TSFA, SEN(ustat), "ustat" }, +[1024 + 46] = { 2, TD, SEN(dup2), "dup2" }, +[1024 + 47] = { 2, 0, SEN(setreuid), "setreuid" }, +[1024 + 48] = { 2, 0, SEN(setregid), "setregid" }, +[1024 + 49] = { 3, 0, SEN(getresuid), "getresuid" }, +[1024 + 50] = { 3, 0, SEN(setresuid), "setresuid" }, +[1024 + 51] = { 3, 0, SEN(getresgid), "getresgid" }, +[1024 + 52] = { 3, 0, SEN(setresgid), "setresgid" }, +[1024 + 53] = { 2, 0, SEN(getgroups), "getgroups" }, +[1024 + 54] = { 2, 0, SEN(setgroups), "setgroups" }, +[1024 + 55] = { 1, 0, SEN(getpgid), "getpgid" }, +[1024 + 56] = { 2, 0, SEN(setpgid), "setpgid" }, +[1024 + 57] = { 0, 0, SEN(setsid), "setsid" }, +[1024 + 58] = { 1, 0, SEN(getsid), "getsid" }, +[1024 + 59] = { 2, 0, SEN(sethostname), "sethostname" }, +[1024 + 60] = { 2, 0, SEN(setrlimit), "setrlimit" }, +[1024 + 61] = { 2, 0, SEN(getrlimit), "getrlimit" }, +[1024 + 62] = { 2, 0, SEN(getrusage), "getrusage" }, +[1024 + 63] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, +[1024 + 64] = { 2, 0, SEN(settimeofday), "settimeofday" }, +[1024 + 65] = { 5, TD, SEN(select), "select" }, +[1024 + 66] = { 3, TD, SEN(poll_time64), "poll" }, +[1024 + 67] = { 2, TF, SEN(symlink), "symlink" }, +[1024 + 68] = { 3, TF, SEN(readlink), "readlink" }, +[1024 + 69] = { 1, TF, SEN(uselib), "uselib" }, +[1024 + 70] = { 2, TF, SEN(swapon), "swapon" }, +[1024 + 71] = { 1, TF, SEN(swapoff), "swapoff" }, +[1024 + 72] = { 4, 0, SEN(reboot), "reboot" }, +[1024 + 73] = { 2, TF, SEN(truncate), "truncate" }, +[1024 + 74] = { 2, TD, SEN(ftruncate), "ftruncate" }, +[1024 + 75] = { 2, TD, SEN(fchmod), "fchmod" }, +[1024 + 76] = { 3, TD, SEN(fchown), "fchown" }, +[1024 + 77] = { 2, 0, SEN(getpriority), "getpriority" }, +[1024 + 78] = { 3, 0, SEN(setpriority), "setpriority" }, +[1024 + 79] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[1024 + 80] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, +[1024 + 81] = { 0, PU|NF, SEN(gettid), "gettid" }, +[1024 + 82] = { 3, TI, SEN(semget), "semget" }, +[1024 + 83] = { 3, TI, SEN(semop), "semop" }, +[1024 + 84] = { 4, TI, SEN(semctl), "semctl" }, +[1024 + 85] = { 2, TI, SEN(msgget), "msgget" }, +[1024 + 86] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[1024 + 87] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[1024 + 88] = { 3, TI, SEN(msgctl), "msgctl" }, +[1024 + 89] = { 3, TI, SEN(shmget), "shmget" }, +[1024 + 90] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[1024 + 91] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[1024 + 92] = { 3, TI, SEN(shmctl), "shmctl" }, +[1024 + 93] = { 3, 0, SEN(syslog), "syslog" }, +[1024 + 94] = { 3, 0, SEN(setitimer), "setitimer" }, +[1024 + 95] = { 2, 0, SEN(getitimer), "getitimer" }, +[1024 + 96] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, +[1024 + 97] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, +[1024 + 98] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, +[1024 + 99] = { 0, 0, SEN(vhangup), "vhangup" }, +[1024 + 100] = { 3, TF, SEN(chown), "lchown" }, +[1024 + 101] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, +[1024 + 102] = { 4, TP, SEN(wait4), "wait4" }, +[1024 + 103] = { 1, 0, SEN(sysinfo), "sysinfo" }, +[1024 + 104] = { 5, TP, SEN(clone), "clone" }, +[1024 + 105] = { 2, 0, SEN(setdomainname), "setdomainname" }, +[1024 + 106] = { 1, 0, SEN(uname), "uname" }, +[1024 + 107] = { 1, 0, SEN(adjtimex64), "adjtimex" }, +[1024 + 108] = { 2, 0, SEN(create_module), "create_module" }, +[1024 + 109] = { 3, 0, SEN(init_module), "init_module" }, +[1024 + 110] = { 2, 0, SEN(delete_module), "delete_module" }, +[1024 + 111] = { 1, 0, SEN(get_kernel_syms), "get_kernel_syms" }, +[1024 + 112] = { 5, 0, SEN(query_module), "query_module" }, +[1024 + 113] = { 4, TF, SEN(quotactl), "quotactl" }, +[1024 + 114] = { 2, 0, SEN(bdflush), "bdflush" }, +[1024 + 115] = { 3, 0, SEN(sysfs), "sysfs" }, +[1024 + 116] = { 1, NF, SEN(personality), "personality" }, +[1024 + 117] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, +[1024 + 118] = { 1, NF, SEN(setfsuid), "setfsuid" }, +[1024 + 119] = { 1, NF, SEN(setfsgid), "setfsgid" }, +[1024 + 120] = { 3, TD, SEN(getdents), "getdents" }, +[1024 + 121] = { 2, TD, SEN(flock), "flock" }, +[1024 + 122] = { 3, TD, SEN(readv), "readv" }, +[1024 + 123] = { 3, TD, SEN(writev), "writev" }, +[1024 + 124] = { 4, TD, SEN(pread), "pread64" }, +[1024 + 125] = { 4, TD, SEN(pwrite), "pwrite64" }, +[1024 + 126] = { 1, 0, SEN(printargs), "_sysctl" }, +[1024 + 127] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, +[1024 + 128] = { 2, TM|SI, SEN(munmap), "munmap" }, +[1024 + 129] = { 2, TM, SEN(mlock), "mlock" }, +[1024 + 130] = { 1, TM, SEN(mlockall), "mlockall" }, +[1024 + 131] = { 3, TM|SI, SEN(mprotect), "mprotect" }, +[1024 + 132] = { 5, TM|SI, SEN(mremap), "mremap" }, +[1024 + 133] = { 3, TM, SEN(msync), "msync" }, +[1024 + 134] = { 2, TM, SEN(munlock), "munlock" }, +[1024 + 135] = { 0, TM, SEN(munlockall), "munlockall" }, +[1024 + 136] = { 2, 0, SEN(sched_getparam), "sched_getparam" }, +[1024 + 137] = { 2, 0, SEN(sched_setparam), "sched_setparam" }, +[1024 + 138] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, +[1024 + 139] = { 3, 0, SEN(sched_setscheduler), "sched_setscheduler" }, +[1024 + 140] = { 0, 0, SEN(sched_yield), "sched_yield" }, +[1024 + 141] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, +[1024 + 142] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, +[1024 + 143] = { 2, 0, SEN(sched_rr_get_interval_time64),"sched_rr_get_interval"}, +[1024 + 144] = { 2, 0, SEN(nanosleep_time64), "nanosleep" }, +[1024 + 145] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, +[1024 + 146] = { 5, 0, SEN(prctl), "prctl" }, +[1024 + 147] = { 0, PU|NF, SEN(getpagesize), "getpagesize" }, +[1024 + 148] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" }, +[1024 + 149] = { 5, 0, SEN(printargs), "pciconfig_read" }, +[1024 + 150] = { 5, 0, SEN(printargs), "pciconfig_write" }, +[1024 + 151] = { MA, 0, SEN(printargs), "perfmonctl" }, +[1024 + 152] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, +[1024 + 153] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, +[1024 + 154] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, +[1024 + 155] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, +[1024 + 156] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, +[1024 + 157] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, +[1024 + 158] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, +[1024 + 159] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait" }, +[1024 + 160] = { 2, TF, SEN(getcwd), "getcwd" }, +[1024 + 161] = { 2, 0, SEN(capget), "capget" }, +[1024 + 162] = { 2, 0, SEN(capset), "capset" }, +[1024 + 163] = { 4, TD|TN, SEN(sendfile), "sendfile" }, +[1024 + 164] = { 5, TN, SEN(getpmsg), "getpmsg" }, +[1024 + 165] = { 5, TN, SEN(putpmsg), "putpmsg" }, +[1024 + 166] = { 3, TN, SEN(socket), "socket" }, +[1024 + 167] = { 3, TN, SEN(bind), "bind" }, +[1024 + 168] = { 3, TN, SEN(connect), "connect" }, +[1024 + 169] = { 2, TN, SEN(listen), "listen" }, +[1024 + 170] = { 3, TN, SEN(accept), "accept" }, +[1024 + 171] = { 3, TN, SEN(getsockname), "getsockname" }, +[1024 + 172] = { 3, TN, SEN(getpeername), "getpeername" }, +[1024 + 173] = { 4, TN, SEN(socketpair), "socketpair" }, +[1024 + 174] = { 4, TN, SEN(send), "send" }, +[1024 + 175] = { 6, TN, SEN(sendto), "sendto" }, +[1024 + 176] = { 4, TN, SEN(recv), "recv" }, +[1024 + 177] = { 6, TN, SEN(recvfrom), "recvfrom" }, +[1024 + 178] = { 2, TN, SEN(shutdown), "shutdown" }, +[1024 + 179] = { 5, TN, SEN(setsockopt), "setsockopt" }, +[1024 + 180] = { 5, TN, SEN(getsockopt), "getsockopt" }, +[1024 + 181] = { 3, TN, SEN(sendmsg), "sendmsg" }, +[1024 + 182] = { 3, TN, SEN(recvmsg), "recvmsg" }, +[1024 + 183] = { 2, TF, SEN(pivotroot), "pivot_root" }, +[1024 + 184] = { 3, TM, SEN(mincore), "mincore" }, +[1024 + 185] = { 3, TM, SEN(madvise), "madvise" }, +[1024 + 186] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, +[1024 + 187] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, +[1024 + 188] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, +[1024 + 189] = { 6, TP, SEN(clone), "clone2" }, +[1024 + 190] = { 3, TD, SEN(getdents64), "getdents64" }, +[1024 + 191] = { 2, 0, SEN(printargs), "getunwind" }, +[1024 + 192] = { 3, TD, SEN(readahead), "readahead" }, +[1024 + 193] = { 5, TF, SEN(setxattr), "setxattr" }, +[1024 + 194] = { 5, TF, SEN(setxattr), "lsetxattr" }, +[1024 + 195] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, +[1024 + 196] = { 4, TF, SEN(getxattr), "getxattr" }, +[1024 + 197] = { 4, TF, SEN(getxattr), "lgetxattr" }, +[1024 + 198] = { 4, TD, SEN(fgetxattr), "fgetxattr" }, +[1024 + 199] = { 3, TF, SEN(listxattr), "listxattr" }, +[1024 + 200] = { 3, TF, SEN(listxattr), "llistxattr" }, +[1024 + 201] = { 3, TD, SEN(flistxattr), "flistxattr" }, +[1024 + 202] = { 2, TF, SEN(removexattr), "removexattr" }, +[1024 + 203] = { 2, TF, SEN(removexattr), "lremovexattr" }, +[1024 + 204] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, +[1024 + 205] = { 2, TS, SEN(kill), "tkill" }, +[1024 + 206] = { 6, 0, SEN(futex_time64), "futex" }, +[1024 + 207] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, +[1024 + 208] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, +[1024 + 209] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, +[1024 + 210] = { 4, TD, SEN(fadvise64), "fadvise64" }, +[1024 + 211] = { 3, TS, SEN(tgkill), "tgkill" }, +[1024 + 212] = { 1, TP|SE, SEN(exit), "exit_group" }, +[1024 + 213] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" }, +[1024 + 214] = { 2, TM, SEN(io_setup), "io_setup" }, +[1024 + 215] = { 1, TM, SEN(io_destroy), "io_destroy" }, +[1024 + 216] = { 5, 0, SEN(io_getevents_time64), "io_getevents" }, +[1024 + 217] = { 3, 0, SEN(io_submit), "io_submit" }, +[1024 + 218] = { 3, 0, SEN(io_cancel), "io_cancel" }, +[1024 + 219] = { 1, TD, SEN(epoll_create), "epoll_create" }, +[1024 + 220] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, +[1024 + 221] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, +[1024 + 222] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, +[1024 + 223] = { 4, TI, SEN(semtimedop_time64), "semtimedop" }, +[1024 + 224] = { 3, 0, SEN(timer_create), "timer_create" }, +[1024 + 225] = { 4, 0, SEN(timer_settime64), "timer_settime" }, +[1024 + 226] = { 2, 0, SEN(timer_gettime64), "timer_gettime" }, +[1024 + 227] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, +[1024 + 228] = { 1, 0, SEN(timer_delete), "timer_delete" }, +[1024 + 229] = { 2, 0, SEN(clock_settime64), "clock_settime" }, +[1024 + 230] = { 2, 0, SEN(clock_gettime64), "clock_gettime" }, +[1024 + 231] = { 2, 0, SEN(clock_getres_time64), "clock_getres" }, +[1024 + 232] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep" }, +[1024 + 233] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, +[1024 + 234] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, +[1024 + 235] = { 6, TM, SEN(mbind), "mbind" }, +[1024 + 236] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, +[1024 + 237] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, +[1024 + 238] = { 4, TD, SEN(mq_open), "mq_open" }, +[1024 + 239] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, +[1024 + 240] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend" }, +[1024 + 241] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive" }, +[1024 + 242] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[1024 + 243] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, +[1024 + 244] = { 4, 0, SEN(kexec_load), "kexec_load" }, +[1024 + 245] = { 5, 0, SEN(vserver), "vserver" }, +[1024 + 246] = { 5, TP, SEN(waitid), "waitid" }, +[1024 + 247] = { 5, 0, SEN(add_key), "add_key" }, +[1024 + 248] = { 4, 0, SEN(request_key), "request_key" }, +[1024 + 249] = { 5, 0, SEN(keyctl), "keyctl" }, +[1024 + 250] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, +[1024 + 251] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, +[1024 + 252] = { 6, TM, SEN(move_pages), "move_pages" }, +[1024 + 253] = { 0, TD, SEN(inotify_init), "inotify_init" }, +[1024 + 254] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, +[1024 + 255] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, +[1024 + 256] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, +[1024 + 257] = { 4, TD|TF, SEN(openat), "openat" }, +[1024 + 258] = { 3, TD|TF, SEN(mkdirat), "mkdirat" }, +[1024 + 259] = { 4, TD|TF, SEN(mknodat), "mknodat" }, +[1024 + 260] = { 5, TD|TF, SEN(fchownat), "fchownat" }, +[1024 + 261] = { 3, TD|TF, SEN(futimesat), "futimesat" }, +[1024 + 262] = { 4, TD|TF|TFST|TSTA,SEN(newfstatat), "newfstatat" }, +[1024 + 263] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, +[1024 + 264] = { 4, TD|TF, SEN(renameat), "renameat" }, +[1024 + 265] = { 5, TD|TF, SEN(linkat), "linkat" }, +[1024 + 266] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, +[1024 + 267] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, +[1024 + 268] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, +[1024 + 269] = { 3, TD|TF, SEN(faccessat), "faccessat" }, +[1024 + 270] = { 6, TD, SEN(pselect6_time64), "pselect6" }, +[1024 + 271] = { 5, TD, SEN(ppoll_time64), "ppoll" }, +[1024 + 272] = { 1, TP, SEN(unshare), "unshare" }, +[1024 + 273] = { 6, TD, SEN(splice), "splice" }, +[1024 + 274] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, +[1024 + 275] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, +[1024 + 276] = { 4, TD, SEN(sync_file_range), "sync_file_range" }, +[1024 + 277] = { 4, TD, SEN(tee), "tee" }, +[1024 + 278] = { 4, TD, SEN(vmsplice), "vmsplice" }, +[1024 + 279] = { 4, TD, SEN(fallocate), "fallocate" }, +[1024 + 280] = { 3, 0, SEN(getcpu), "getcpu" }, +[1024 + 281] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, +[1024 + 282] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" }, +[1024 + 283] = { 3, TD|TS, SEN(signalfd), "signalfd" }, +[1024 + 284] = { 4, TD, SEN(timerfd), "timerfd" }, +[1024 + 285] = { 1, TD, SEN(eventfd), "eventfd" }, +[1024 + 286] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, +[1024 + 287] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime" }, +[1024 + 288] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime" }, +[1024 + 289] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, +[1024 + 290] = { 2, TD, SEN(eventfd2), "eventfd2" }, +[1024 + 291] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, +[1024 + 292] = { 3, TD, SEN(dup3), "dup3" }, +[1024 + 293] = { 2, TD, SEN(pipe2), "pipe2" }, +[1024 + 294] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, +[1024 + 295] = { 4, TD, SEN(preadv), "preadv" }, +[1024 + 296] = { 4, TD, SEN(pwritev), "pwritev" }, +[1024 + 297] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, +[1024 + 298] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg" }, +[1024 + 299] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, +[1024 + 300] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, +[1024 + 301] = { 4, 0, SEN(prlimit64), "prlimit64" }, +[1024 + 302] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, +[1024 + 303] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, +[1024 + 304] = { 2, 0, SEN(clock_adjtime64), "clock_adjtime" }, +[1024 + 305] = { 1, TD, SEN(syncfs), "syncfs" }, +[1024 + 306] = { 2, TD, SEN(setns), "setns" }, +[1024 + 307] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, +[1024 + 308] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, +[1024 + 309] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, +[1024 + 310] = { 4, TN, SEN(accept4), "accept4" }, +[1024 + 311] = { 3, TD, SEN(finit_module), "finit_module" }, +[1024 + 312] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, +[1024 + 313] = { 4, 0, SEN(sched_getattr), "sched_getattr" }, +[1024 + 314] = { 5, TD|TF, SEN(renameat2), "renameat2" }, +[1024 + 315] = { 3, 0, SEN(getrandom), "getrandom" }, +[1024 + 316] = { 2, TD, SEN(memfd_create), "memfd_create" }, +[1024 + 317] = { 3, TD, SEN(bpf), "bpf" }, +[1024 + 318] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, +[1024 + 319] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, +[1024 + 320] = { 2, 0, SEN(membarrier), "membarrier" }, +[1024 + 321] = { 5, 0, SEN(kcmp), "kcmp" }, +[1024 + 322] = { 3, TM, SEN(mlock2), "mlock2" }, +[1024 + 323] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, +[1024 + 324] = { 6, TD, SEN(preadv2), "preadv2" }, +[1024 + 325] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[1024 + 326] = { 5, TD|TF|TSTA, SEN(statx), "statx" }, +[1024 + 327] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents" }, +[1024 + 328] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, +[1024 + 329] = { 3, 0, SEN(seccomp), "seccomp" }, +[1024 + 330] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, +[1024 + 331] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, +[1024 + 332] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[1024 + 333] = { 4, 0, SEN(rseq), "rseq" }, +/* [1024 + 334 ... 1024 + 423] - reserved to sync up with other architectures */ +[1024 + 424] = { 4, TD|TS, SEN(pidfd_send_signal), "pidfd_send_signal" }, +[1024 + 425] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" }, +[1024 + 426] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" }, +[1024 + 427] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" }, diff --git a/linux/ia64/userent.h b/linux/ia64/userent.h index d2ffae6f..f6f63724 100644 --- a/linux/ia64/userent.h +++ b/linux/ia64/userent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + { PT_F32, "f32" }, { PT_F33, "f33" }, { PT_F34, "f34" }, { PT_F35, "f35" }, { PT_F36, "f36" }, { PT_F37, "f37" }, { PT_F38, "f38" }, { PT_F39, "f39" }, { PT_F40, "f40" }, diff --git a/linux/inet_diag.h b/linux/inet_diag.h index 69012af0..cb9b7b3a 100644 --- a/linux/inet_diag.h +++ b/linux/inet_diag.h @@ -1,8 +1,15 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #ifndef STRACE_LINUX_INET_DIAG_H -#define STRACE_LINUX_INET_DIAG_H +# define STRACE_LINUX_INET_DIAG_H -#define TCPDIAG_GETSOCK 18 -#define DCCPDIAG_GETSOCK 19 +# define TCPDIAG_GETSOCK 18 +# define DCCPDIAG_GETSOCK 19 /* Socket identity */ struct inet_diag_sockid { @@ -14,7 +21,17 @@ struct inet_diag_sockid { uint32_t idiag_cookie[2]; }; -/* Request structure */ +/* Request structures */ +struct inet_diag_req { + uint8_t idiag_family; + uint8_t idiag_src_len; + uint8_t idiag_dst_len; + uint8_t idiag_ext; + struct inet_diag_sockid id; + uint32_t idiag_states; + uint32_t idiag_dbs; +}; + struct inet_diag_req_v2 { uint8_t sdiag_family; uint8_t sdiag_protocol; @@ -24,6 +41,45 @@ struct inet_diag_req_v2 { struct inet_diag_sockid id; }; +enum { + INET_DIAG_REQ_NONE, + INET_DIAG_REQ_BYTECODE, +}; + +struct inet_diag_bc_op { + unsigned char code; + unsigned char yes; + unsigned short no; +}; + +enum { + INET_DIAG_BC_NOP, + INET_DIAG_BC_JMP, + INET_DIAG_BC_S_GE, + INET_DIAG_BC_S_LE, + INET_DIAG_BC_D_GE, + INET_DIAG_BC_D_LE, + INET_DIAG_BC_AUTO, + INET_DIAG_BC_S_COND, + INET_DIAG_BC_D_COND, + INET_DIAG_BC_DEV_COND, /* u32 ifindex */ + INET_DIAG_BC_MARK_COND, + INET_DIAG_BC_S_EQ, + INET_DIAG_BC_D_EQ, +}; + +struct inet_diag_hostcond { + uint8_t family; + uint8_t prefix_len; + int port; + uint32_t addr[0]; +}; + +struct inet_diag_markcond { + uint32_t mark; + uint32_t mask; +}; + /* Info structure */ struct inet_diag_msg { uint8_t idiag_family; @@ -40,4 +96,60 @@ struct inet_diag_msg { uint32_t idiag_inode; }; +/* Extensions */ +enum { + INET_DIAG_NONE, + INET_DIAG_MEMINFO, + INET_DIAG_INFO, + INET_DIAG_VEGASINFO, + INET_DIAG_CONG, + INET_DIAG_TOS, + INET_DIAG_TCLASS, + INET_DIAG_SKMEMINFO, + INET_DIAG_SHUTDOWN, + INET_DIAG_DCTCPINFO, + INET_DIAG_PROTOCOL, /* response attribute only */ + INET_DIAG_SKV6ONLY, + INET_DIAG_LOCALS, + INET_DIAG_PEERS, + INET_DIAG_PAD, + INET_DIAG_MARK, + INET_DIAG_BBRINFO, + INET_DIAG_CLASS_ID, +}; + +/* INET_DIAG_MEM */ +struct inet_diag_meminfo { + uint32_t idiag_rmem; + uint32_t idiag_wmem; + uint32_t idiag_fmem; + uint32_t idiag_tmem; +}; + +/* INET_DIAG_VEGASINFO */ +struct tcpvegas_info { + uint32_t tcpv_enabled; + uint32_t tcpv_rttcnt; + uint32_t tcpv_rtt; + uint32_t tcpv_minrtt; +}; + +/* INET_DIAG_DCTCPINFO */ +struct tcp_dctcp_info { + uint16_t dctcp_enabled; + uint16_t dctcp_ce_state; + uint32_t dctcp_alpha; + uint32_t dctcp_ab_ecn; + uint32_t dctcp_ab_tot; +}; + +/* INET_DIAG_BBRINFO */ +struct tcp_bbr_info { + uint32_t bbr_bw_lo; + uint32_t bbr_bw_hi; + uint32_t bbr_min_rtt; + uint32_t bbr_pacing_gain; + uint32_t bbr_cwnd_gain; +}; + #endif /* !STRACE_LINUX_INET_DIAG_H */ diff --git a/linux/m68k/arch_defs_.h b/linux/m68k/arch_defs_.h new file mode 100644 index 00000000..1a8da94f --- /dev/null +++ b/linux/m68k/arch_defs_.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define HAVE_ARCH_OLD_MMAP 1 +#define HAVE_ARCH_OLD_SELECT 1 +#define HAVE_ARCH_UID16_SYSCALLS 1 +#define HAVE_ARCH_SA_RESTORER 1 diff --git a/linux/m68k/arch_regs.c b/linux/m68k/arch_regs.c index 3d4c3d9e..13b82eb0 100644 --- a/linux/m68k/arch_regs.c +++ b/linux/m68k/arch_regs.c @@ -1,4 +1,11 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static struct user_regs_struct m68k_regs; -unsigned long *const m68k_usp_ptr = (unsigned long *) &m68k_regs.usp; -#define ARCH_PC_REG m68k_regs.pc #define ARCH_REGS_FOR_GETREGS m68k_regs +#define ARCH_PC_REG m68k_regs.pc +#define ARCH_SP_REG m68k_regs.usp diff --git a/linux/m68k/arch_regs.h b/linux/m68k/arch_regs.h deleted file mode 100644 index 424ec11c..00000000 --- a/linux/m68k/arch_regs.h +++ /dev/null @@ -1 +0,0 @@ -extern unsigned long *const m68k_usp_ptr; diff --git a/linux/m68k/arch_rt_sigframe.c b/linux/m68k/arch_rt_sigframe.c new file mode 100644 index 00000000..bb60b44d --- /dev/null +++ b/linux/m68k/arch_rt_sigframe.c @@ -0,0 +1 @@ +#include "i386/arch_rt_sigframe.c" diff --git a/linux/m68k/arch_sigreturn.c b/linux/m68k/arch_sigreturn.c index b1402683..4682c0f8 100644 --- a/linux/m68k/arch_sigreturn.c +++ b/linux/m68k/arch_sigreturn.c @@ -1,20 +1,28 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static void arch_sigreturn(struct tcb *tcp) { - unsigned long addr; + unsigned long addr, sp; /* Fetch pointer to struct sigcontext. */ - if (umove(tcp, *m68k_usp_ptr + 2 * sizeof(int), &addr) < 0) + if (!get_stack_pointer(tcp, &sp) || + umove_or_printaddr(tcp, sp + 2 * sizeof(int), &addr)) return; unsigned long mask[NSIG_BYTES / sizeof(long)]; /* Fetch first word of signal mask. */ - if (umove(tcp, addr, &mask[0]) < 0) + if (umove_or_printaddr(tcp, addr, &mask[0])) return; /* Fetch remaining words of signal mask, located immediately before. */ addr -= sizeof(mask) - sizeof(long); - if (umoven(tcp, addr, sizeof(mask) - sizeof(long), &mask[1]) < 0) + if (umoven_or_printaddr(tcp, addr, sizeof(mask) - sizeof(long), &mask[1])) return; tprintsigmask_addr("{mask=", mask); diff --git a/linux/m68k/get_error.c b/linux/m68k/get_error.c index 3ad51a08..9af04478 100644 --- a/linux/m68k/get_error.c +++ b/linux/m68k/get_error.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "negated_errno.h" + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { if (check_errno && is_negated_errno(m68k_regs.d0)) { tcp->u_rval = -1; diff --git a/linux/m68k/get_scno.c b/linux/m68k/get_scno.c index 829f3477..41db19c5 100644 --- a/linux/m68k/get_scno.c +++ b/linux/m68k/get_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) diff --git a/linux/m68k/get_syscall_args.c b/linux/m68k/get_syscall_args.c index 8ec3d281..f2657b37 100644 --- a/linux/m68k/get_syscall_args.c +++ b/linux/m68k/get_syscall_args.c @@ -1,6 +1,13 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { tcp->u_arg[0] = m68k_regs.d1; tcp->u_arg[1] = m68k_regs.d2; diff --git a/linux/m68k/raw_syscall.h b/linux/m68k/raw_syscall.h new file mode 100644 index 00000000..345bc767 --- /dev/null +++ b/linux/m68k/raw_syscall.h @@ -0,0 +1,28 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + *err = 0; + register kernel_ulong_t d0 __asm__("%d0") = nr; + __asm__ __volatile__("trap #0" + : "=d"(d0) + : "0"(d0) + : "memory"); + return d0; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/m68k/rt_sigframe.h b/linux/m68k/rt_sigframe.h new file mode 100644 index 00000000..e40bd745 --- /dev/null +++ b/linux/m68k/rt_sigframe.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RT_SIGFRAME_H +# define STRACE_RT_SIGFRAME_H + +# include + +typedef struct { + char *pretcode; + int sig; + siginfo_t *pinfo; + void *puc; + char retcode[8]; + siginfo_t info; + ucontext_t uc; +} struct_rt_sigframe; + +#endif /* !STRACE_RT_SIGFRAME_H */ diff --git a/linux/m68k/set_error.c b/linux/m68k/set_error.c index 1ce72abe..bf01eef7 100644 --- a/linux/m68k/set_error.c +++ b/linux/m68k/set_error.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_error(struct tcb *tcp) { diff --git a/linux/m68k/set_scno.c b/linux/m68k/set_scno.c index b45e6485..84e8835c 100644 --- a/linux/m68k/set_scno.c +++ b/linux/m68k/set_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { diff --git a/linux/m68k/syscallent.h b/linux/m68k/syscallent.h index 1c33b090..f2117697 100644 --- a/linux/m68k/syscallent.h +++ b/linux/m68k/syscallent.h @@ -1,29 +1,10 @@ /* * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995 Rick Sladkey + * Copyright (c) 1995-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ [ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, @@ -44,17 +25,17 @@ [ 15] = { 2, TF, SEN(chmod), "chmod" }, [ 16] = { 3, TF, SEN(chown16), "chown" }, [ 17] = { 0, TM, SEN(break), "break" }, -[ 18] = { 2, TF, SEN(oldstat), "oldstat" }, +[ 18] = { 2, TF|TST|TSTA, SEN(oldstat), "oldstat" }, [ 19] = { 3, TD, SEN(lseek), "lseek" }, -[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 20] = { 0, PU|NF, SEN(getpid), "getpid" }, [ 21] = { 5, TF, SEN(mount), "mount" }, [ 22] = { 1, TF, SEN(umount), "umount" }, [ 23] = { 1, 0, SEN(setuid16), "setuid" }, -[ 24] = { 0, NF, SEN(getuid16), "getuid" }, +[ 24] = { 0, PU|NF, SEN(getuid16), "getuid" }, [ 25] = { 1, 0, SEN(stime), "stime" }, [ 26] = { 4, 0, SEN(ptrace), "ptrace" }, [ 27] = { 1, 0, SEN(alarm), "alarm" }, -[ 28] = { 2, TD, SEN(oldfstat), "oldfstat" }, +[ 28] = { 2, TD|TFST|TSTA, SEN(oldfstat), "oldfstat" }, [ 29] = { 0, TS, SEN(pause), "pause" }, [ 30] = { 2, TF, SEN(utime), "utime" }, [ 31] = { 2, 0, SEN(stty), "stty" }, @@ -73,10 +54,10 @@ [ 44] = { 0, 0, SEN(prof), "prof" }, [ 45] = { 1, TM|SI, SEN(brk), "brk" }, [ 46] = { 1, 0, SEN(setgid16), "setgid" }, -[ 47] = { 0, NF, SEN(getgid16), "getgid" }, +[ 47] = { 0, PU|NF, SEN(getgid16), "getgid" }, [ 48] = { 2, TS, SEN(signal), "signal" }, -[ 49] = { 0, NF, SEN(geteuid16), "geteuid" }, -[ 50] = { 0, NF, SEN(getegid16), "getegid" }, +[ 49] = { 0, PU|NF, SEN(geteuid16), "geteuid" }, +[ 50] = { 0, PU|NF, SEN(getegid16), "getegid" }, [ 51] = { 1, TF, SEN(acct), "acct" }, [ 52] = { 2, TF, SEN(umount2), "umount2" }, [ 53] = { 0, 0, SEN(lock), "lock" }, @@ -88,14 +69,14 @@ [ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, [ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, -[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 62] = { 2, TSFA, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, -[ 64] = { 0, NF, SEN(getppid), "getppid" }, -[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 64] = { 0, PU|NF, SEN(getppid), "getppid" }, +[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, [ 66] = { 0, 0, SEN(setsid), "setsid" }, [ 67] = { 3, TS, SEN(sigaction), "sigaction" }, -[ 68] = { 0, TS, SEN(siggetmask), "sgetmask" }, -[ 69] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[ 68] = { 0, TS, SEN(sgetmask), "sgetmask" }, +[ 69] = { 1, TS, SEN(ssetmask), "ssetmask" }, [ 70] = { 2, 0, SEN(setreuid16), "setreuid" }, [ 71] = { 2, 0, SEN(setregid16), "setregid" }, [ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, @@ -110,7 +91,7 @@ [ 81] = { 2, 0, SEN(setgroups16), "setgroups" }, [ 82] = { 1, TD, SEN(oldselect), "select" }, [ 83] = { 2, TF, SEN(symlink), "symlink" }, -[ 84] = { 2, TF, SEN(oldlstat), "oldlstat" }, +[ 84] = { 2, TF|TLST|TSTA, SEN(oldlstat), "oldlstat" }, [ 85] = { 3, TF, SEN(readlink), "readlink" }, [ 86] = { 1, TF, SEN(uselib), "uselib" }, [ 87] = { 2, TF, SEN(swapon), "swapon" }, @@ -125,16 +106,16 @@ [ 96] = { 2, 0, SEN(getpriority), "getpriority" }, [ 97] = { 3, 0, SEN(setpriority), "setpriority" }, [ 98] = { 4, 0, SEN(profil), "profil" }, -[ 99] = { 2, TF, SEN(statfs), "statfs" }, -[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, [101] = { 3, 0, SEN(ioperm), "ioperm" }, [102] = { 2, TD, SEN(socketcall), "socketcall" }, [103] = { 3, 0, SEN(syslog), "syslog" }, [104] = { 3, 0, SEN(setitimer), "setitimer" }, [105] = { 2, 0, SEN(getitimer), "getitimer" }, -[106] = { 2, TF, SEN(stat), "stat" }, -[107] = { 2, TF, SEN(lstat), "lstat" }, -[108] = { 2, TD, SEN(fstat), "fstat" }, +[106] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, +[107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, +[108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, [109] = { 1, 0, SEN(olduname), "olduname" }, [110] = { 1, 0, SEN(iopl), "iopl" }, [111] = { 0, 0, SEN(vhangup), "vhangup" }, @@ -150,7 +131,7 @@ [121] = { 2, 0, SEN(setdomainname), "setdomainname" }, [122] = { 1, 0, SEN(uname), "uname" }, [123] = { 4, 0, SEN(cacheflush), "cacheflush" }, -[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[124] = { 1, 0, SEN(adjtimex32), "adjtimex" }, [125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, [126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, [127] = { 2, 0, SEN(create_module), "create_module" }, @@ -187,14 +168,14 @@ [158] = { 0, 0, SEN(sched_yield), "sched_yield" }, [159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, -[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[161] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"}, +[162] = { 2, 0, SEN(nanosleep_time32), "nanosleep" }, [163] = { 5, TM|SI, SEN(mremap), "mremap" }, [164] = { 3, 0, SEN(setresuid16), "setresuid" }, [165] = { 3, 0, SEN(getresuid16), "getresuid" }, -[166] = { 0, 0, SEN(getpagesize), "getpagesize" }, +[166] = { 0, PU|NF, SEN(getpagesize), "getpagesize" }, [167] = { 5, 0, SEN(query_module), "query_module" }, -[168] = { 3, TD, SEN(poll), "poll" }, +[168] = { 3, TD, SEN(poll_time32), "poll" }, [169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, [170] = { 3, 0, SEN(setresgid16), "setresgid" }, [171] = { 3, 0, SEN(getresgid16), "getresgid" }, @@ -203,7 +184,7 @@ [174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, [175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, [176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[177] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[177] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" }, [178] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, [179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, [180] = { 5, TD, SEN(pread), "pread64" }, @@ -221,14 +202,14 @@ [192] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" }, [193] = { 3, TF, SEN(truncate64), "truncate64" }, [194] = { 3, TD, SEN(ftruncate64), "ftruncate64" }, -[195] = { 2, TF, SEN(stat64), "stat64" }, -[196] = { 2, TF, SEN(lstat64), "lstat64" }, -[197] = { 2, TD, SEN(fstat64), "fstat64" }, +[195] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" }, +[196] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" }, +[197] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" }, [198] = { 3, TF, SEN(chown), "chown32" }, -[199] = { 0, NF, SEN(getuid), "getuid32" }, -[200] = { 0, NF, SEN(getgid), "getgid32" }, -[201] = { 0, NF, SEN(geteuid), "geteuid32" }, -[202] = { 0, NF, SEN(geteuid), "getegid32" }, +[199] = { 0, PU|NF, SEN(getuid), "getuid32" }, +[200] = { 0, PU|NF, SEN(getgid), "getgid32" }, +[201] = { 0, PU|NF, SEN(geteuid), "geteuid32" }, +[202] = { 0, PU|NF, SEN(geteuid), "getegid32" }, [203] = { 2, 0, SEN(setreuid), "setreuid32" }, [204] = { 2, 0, SEN(setregid), "setregid32" }, [205] = { 2, 0, SEN(getgroups), "getgroups32" }, @@ -246,7 +227,7 @@ [217] = { 2, TF, SEN(pivotroot), "pivot_root" }, [218 ... 219] = { }, [220] = { 3, TD, SEN(getdents64), "getdents64" }, -[221] = { 0, NF, SEN(gettid), "gettid" }, +[221] = { 0, PU|NF, SEN(gettid), "gettid" }, [222] = { 2, TS, SEN(kill), "tkill" }, [223] = { 5, TF, SEN(setxattr), "setxattr" }, [224] = { 5, TF, SEN(setxattr), "lsetxattr" }, @@ -260,7 +241,7 @@ [232] = { 2, TF, SEN(removexattr), "removexattr" }, [233] = { 2, TF, SEN(removexattr), "lremovexattr" }, [234] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, -[235] = { 6, 0, SEN(futex), "futex" }, +[235] = { 6, 0, SEN(futex_time32), "futex" }, [236] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, [237] = { 3, TM, SEN(mincore), "mincore" }, [238] = { 3, TM, SEN(madvise), "madvise" }, @@ -268,7 +249,7 @@ [240] = { 4, TD, SEN(readahead), "readahead" }, [241] = { 2, TM, SEN(io_setup), "io_setup" }, [242] = { 1, TM, SEN(io_destroy), "io_destroy" }, -[243] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[243] = { 5, 0, SEN(io_getevents_time32), "io_getevents" }, [244] = { 3, 0, SEN(io_submit), "io_submit" }, [245] = { 3, 0, SEN(io_cancel), "io_cancel" }, [246] = { 5, TD, SEN(fadvise64), "fadvise64" }, @@ -280,28 +261,28 @@ [252] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, [253] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [254] = { 3, 0, SEN(timer_create), "timer_create" }, -[255] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[256] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[255] = { 4, 0, SEN(timer_settime32), "timer_settime" }, +[256] = { 2, 0, SEN(timer_gettime32), "timer_gettime" }, [257] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, [258] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[259] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[260] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[261] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[262] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, -[263] = { 3, TF, SEN(statfs64), "statfs64" }, -[264] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[259] = { 2, 0, SEN(clock_settime32), "clock_settime" }, +[260] = { 2, 0, SEN(clock_gettime32), "clock_gettime" }, +[261] = { 2, 0, SEN(clock_getres_time32), "clock_getres" }, +[262] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" }, +[263] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, +[264] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, [265] = { 3, TS, SEN(tgkill), "tgkill" }, [266] = { 2, TF, SEN(utimes), "utimes" }, [267] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, [268] = { 6, TM, SEN(mbind), "mbind" }, [269] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, [270] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, -[271] = { 4, 0, SEN(mq_open), "mq_open" }, +[271] = { 4, TD, SEN(mq_open), "mq_open" }, [272] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[273] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[274] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[275] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[276] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[273] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" }, +[274] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" }, +[275] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[276] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, [277] = { 5, TP, SEN(waitid), "waitid" }, [278] = { 5, 0, SEN(vserver), "vserver" }, [279] = { 5, 0, SEN(add_key), "add_key" }, @@ -310,7 +291,7 @@ [282] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, [283] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, [284] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[285] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[285] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, [286] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, [287] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, [288] = { 4, TD|TF, SEN(openat), "openat" }, @@ -318,7 +299,7 @@ [290] = { 4, TD|TF, SEN(mknodat), "mknodat" }, [291] = { 5, TD|TF, SEN(fchownat), "fchownat" }, [292] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[293] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[293] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" }, [294] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, [295] = { 4, TD|TF, SEN(renameat), "renameat" }, [296] = { 5, TD|TF, SEN(linkat), "linkat" }, @@ -326,8 +307,8 @@ [298] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, [299] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, [300] = { 3, TD|TF, SEN(faccessat), "faccessat" }, -[301] = { 6, TD, SEN(pselect6), "pselect6" }, -[302] = { 5, TD, SEN(ppoll), "ppoll" }, +[301] = { 6, TD, SEN(pselect6_time32), "pselect6" }, +[302] = { 5, TD, SEN(ppoll_time32), "ppoll" }, [303] = { 1, TP, SEN(unshare), "unshare" }, [304] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, [305] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, @@ -341,13 +322,13 @@ [313] = { 4, 0, SEN(kexec_load), "kexec_load" }, [314] = { 3, 0, SEN(getcpu), "getcpu" }, [315] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[316] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[316] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [317] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [318] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [319] = { 1, TD, SEN(eventfd), "eventfd" }, [320] = { 6, TD, SEN(fallocate), "fallocate" }, -[321] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, -[322] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[321] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" }, +[322] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" }, [323] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, [324] = { 2, TD, SEN(eventfd2), "eventfd2" }, [325] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, @@ -358,7 +339,7 @@ [330] = { 5, TD, SEN(pwritev), "pwritev" }, [331] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, [332] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, -[333] = { 0, 0, SEN(get_thread_area), "get_thread_area" }, +[333] = { 0, PU|NF, SEN(get_thread_area), "get_thread_area" }, [334] = { 1, 0, SEN(set_thread_area), "set_thread_area" }, [335] = { 6, 0, SEN(printargs), "atomic_cmpxchg_32" }, [336] = { 0, 0, SEN(printargs), "atomic_barrier" }, @@ -367,7 +348,7 @@ [339] = { 4, 0, SEN(prlimit64), "prlimit64" }, [340] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, [341] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[342] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[342] = { 2, 0, SEN(clock_adjtime32), "clock_adjtime" }, [343] = { 1, TD, SEN(syncfs), "syncfs" }, [344] = { 2, TD, SEN(setns), "setns" }, [345] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, @@ -396,7 +377,7 @@ [368] = { 6, TN, SEN(recvfrom), "recvfrom" }, [369] = { 3, TN, SEN(recvmsg), "recvmsg" }, [370] = { 2, TN, SEN(shutdown), "shutdown" }, -[371] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[371] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" }, [372] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, [373] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, [374] = { 2, 0, SEN(membarrier), "membarrier" }, @@ -404,6 +385,47 @@ [376] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, [377] = { 6, TD, SEN(preadv2), "preadv2" }, [378] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[379] = { 5, TD|TF|TSTA, SEN(statx), "statx" }, +[380] = { 3, 0, SEN(seccomp), "seccomp" }, +[381] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, +[382] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, +[383] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[384] = { 4, 0, SEN(rseq), "rseq" }, +/* room for arch specific calls */ +[393] = { 3, TI, SEN(semget), "semget" }, +[394] = { 4, TI, SEN(semctl), "semctl" }, +[395] = { 3, TI, SEN(shmget), "shmget" }, +[396] = { 3, TI, SEN(shmctl), "shmctl" }, +[397] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[398] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[399] = { 2, TI, SEN(msgget), "msgget" }, +[400] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[401] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[402] = { 3, TI, SEN(msgctl), "msgctl" }, +[403] = { 2, 0, SEN(clock_gettime64), "clock_gettime64" }, +[404] = { 2, 0, SEN(clock_settime64), "clock_settime64" }, +[405] = { 2, 0, SEN(clock_adjtime64), "clock_adjtime64" }, +[406] = { 2, 0, SEN(clock_getres_time64), "clock_getres_time64" }, +[407] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep_time64"}, +[408] = { 2, 0, SEN(timer_gettime64), "timer_gettime64" }, +[409] = { 4, 0, SEN(timer_settime64), "timer_settime64" }, +[410] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime64" }, +[411] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime64" }, +[412] = { 4, TD|TF, SEN(utimensat_time64), "utimensat_time64" }, +[413] = { 6, TD, SEN(pselect6_time64), "pselect6_time64" }, +[414] = { 5, TD, SEN(ppoll_time64), "ppoll_time64" }, +[416] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents_time64" }, +[417] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg_time64" }, +[418] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend_time64" }, +[419] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive_time64"}, +[420] = { 4, TI, SEN(semtimedop_time64), "semtimedop_time64" }, +[421] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait_time64"}, +[422] = { 6, 0, SEN(futex_time64), "futex_time64" }, +[423] = { 2, 0, SEN(sched_rr_get_interval_time64), "sched_rr_get_interval_time64" }, +[424] = { 4, TD|TS, SEN(pidfd_send_signal), "pidfd_send_signal" }, +[425] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" }, +[426] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" }, +[427] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" }, -#define SYS_socket_subcall 400 -#include "subcall.h" +#define SYS_socket_subcall 500 +#include "subcall32.h" diff --git a/linux/m68k/userent.h b/linux/m68k/userent.h index a17807ec..ba14c11a 100644 --- a/linux/m68k/userent.h +++ b/linux/m68k/userent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + XLAT(4*PT_D1), XLAT(4*PT_D2), XLAT(4*PT_D3), diff --git a/linux/metag/arch_regs.c b/linux/metag/arch_regs.c index e9f0d78a..67ee70fe 100644 --- a/linux/metag/arch_regs.c +++ b/linux/metag/arch_regs.c @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static struct user_gp_regs metag_regs; #define ARCH_REGS_FOR_GETREGSET metag_regs #define ARCH_PC_REG metag_regs.pc +#define ARCH_SP_REG metag_regs.ax[0][0] diff --git a/linux/metag/arch_rt_sigframe.c b/linux/metag/arch_rt_sigframe.c new file mode 100644 index 00000000..ba2bd8ca --- /dev/null +++ b/linux/metag/arch_rt_sigframe.c @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "rt_sigframe.h" + +FUNC_GET_RT_SIGFRAME_ADDR +{ + kernel_ulong_t sp; + return get_stack_pointer(tcp, &sp) + ? sp - sizeof(struct_rt_sigframe) : 0; +} diff --git a/linux/metag/get_error.c b/linux/metag/get_error.c index b7d287f9..b1e1649c 100644 --- a/linux/metag/get_error.c +++ b/linux/metag/get_error.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "negated_errno.h" + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { /* result pointer in D0Re0 (D0.0) */ if (check_errno && is_negated_errno(metag_regs.dx[0][0])) { diff --git a/linux/metag/get_scno.c b/linux/metag/get_scno.c index 6dc2ab4a..e7b83e28 100644 --- a/linux/metag/get_scno.c +++ b/linux/metag/get_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) diff --git a/linux/metag/get_syscall_args.c b/linux/metag/get_syscall_args.c index 4cae04f1..7f3c5cf2 100644 --- a/linux/metag/get_syscall_args.c +++ b/linux/metag/get_syscall_args.c @@ -1,6 +1,13 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { unsigned int i; diff --git a/linux/metag/raw_syscall.h b/linux/metag/raw_syscall.h new file mode 100644 index 00000000..f8d12d5f --- /dev/null +++ b/linux/metag/raw_syscall.h @@ -0,0 +1,29 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + *err = 0; + register kernel_ulong_t num __asm__("D1Re0") = nr; + register kernel_ulong_t ret __asm__("D0Re0"); + __asm__ __volatile__("SWITCH #0x440001" + : "=r"(ret) + : "d"(num) + : "memory"); + return ret; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/metag/set_error.c b/linux/metag/set_error.c index 9e10d798..18e42dd4 100644 --- a/linux/metag/set_error.c +++ b/linux/metag/set_error.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_error(struct tcb *tcp) { diff --git a/linux/metag/set_scno.c b/linux/metag/set_scno.c index c9b63c81..08dc3cd9 100644 --- a/linux/metag/set_scno.c +++ b/linux/metag/set_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { diff --git a/linux/metag/syscallent.h b/linux/metag/syscallent.h index 82ad55bb..f305974e 100644 --- a/linux/metag/syscallent.h +++ b/linux/metag/syscallent.h @@ -1,6 +1,13 @@ +/* + * Copyright (c) 2013-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "32/syscallent.h" /* [244 ... 259] are arch specific */ [245] = { 2, 0, SEN(printargs), "metag_setglobalbit" }, [246] = { 1, 0, SEN(printargs), "metag_set_fpu_flags" }, [247] = { 1, 0, SEN(printargs), "metag_set_tls" }, -[248] = { 0, NF, SEN(printargs), "metag_get_tls" }, +[248] = { 0, PU|NF, SEN(printargs), "metag_get_tls" }, diff --git a/linux/microblaze/arch_defs_.h b/linux/microblaze/arch_defs_.h new file mode 100644 index 00000000..309d8e7e --- /dev/null +++ b/linux/microblaze/arch_defs_.h @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define HAVE_ARCH_OLD_SELECT 1 +#define HAVE_ARCH_UID16_SYSCALLS 1 diff --git a/linux/microblaze/arch_regs.c b/linux/microblaze/arch_regs.c index a5fec611..4faf9376 100644 --- a/linux/microblaze/arch_regs.c +++ b/linux/microblaze/arch_regs.c @@ -1,2 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static unsigned long microblaze_r3; #define ARCH_PC_PEEK_ADDR PT_PC +#define ARCH_SP_PEEK_ADDR PT_GPR(1) diff --git a/linux/microblaze/arch_sigreturn.c b/linux/microblaze/arch_sigreturn.c index 6eb7cd8e..412e2078 100644 --- a/linux/microblaze/arch_sigreturn.c +++ b/linux/microblaze/arch_sigreturn.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static void arch_sigreturn(struct tcb *tcp) { @@ -6,11 +13,11 @@ arch_sigreturn(struct tcb *tcp) unsigned long addr; /* Read r1, the stack pointer. */ - if (upeek(tcp->pid, 1 * 4, &addr) < 0) + if (upeek(tcp, 1 * 4, &addr) < 0) return; addr += offsetof(struct sigcontext, oldmask); tprints("{mask="); - print_sigset_addr_len(tcp, addr, NSIG_BYTES); + print_sigset_addr(tcp, addr); tprints("}"); } diff --git a/linux/microblaze/get_error.c b/linux/microblaze/get_error.c index 878e24f6..b7ad28dc 100644 --- a/linux/microblaze/get_error.c +++ b/linux/microblaze/get_error.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "negated_errno.h" + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { if (check_errno && is_negated_errno(microblaze_r3)) { tcp->u_rval = -1; diff --git a/linux/microblaze/get_scno.c b/linux/microblaze/get_scno.c index 6f98f834..aaf2dcb3 100644 --- a/linux/microblaze/get_scno.c +++ b/linux/microblaze/get_scno.c @@ -1,6 +1,13 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) { - return upeek(tcp->pid, 0, &tcp->scno) < 0 ? -1 : 1; + return upeek(tcp, 0, &tcp->scno) < 0 ? -1 : 1; } diff --git a/linux/microblaze/get_syscall_args.c b/linux/microblaze/get_syscall_args.c index 830c8c32..0be85015 100644 --- a/linux/microblaze/get_syscall_args.c +++ b/linux/microblaze/get_syscall_args.c @@ -1,11 +1,18 @@ +/* + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { unsigned int i; - for (i = 0; i < tcp->s_ent->nargs; ++i) - if (upeek(tcp->pid, (5 + i) * 4, &tcp->u_arg[i]) < 0) + for (i = 0; i < n_args(tcp); ++i) + if (upeek(tcp, (5 + i) * 4, &tcp->u_arg[i]) < 0) return -1; return 1; } diff --git a/linux/microblaze/get_syscall_result.c b/linux/microblaze/get_syscall_result.c index 9ece53e8..79f23ca4 100644 --- a/linux/microblaze/get_syscall_result.c +++ b/linux/microblaze/get_syscall_result.c @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int get_syscall_result_regs(struct tcb *tcp) { - return upeek(tcp->pid, 3 * 4, µblaze_r3) < 0 ? -1 : 0; + return upeek(tcp, 3 * 4, µblaze_r3) < 0 ? -1 : 0; } diff --git a/linux/microblaze/raw_syscall.h b/linux/microblaze/raw_syscall.h new file mode 100644 index 00000000..fe47aa34 --- /dev/null +++ b/linux/microblaze/raw_syscall.h @@ -0,0 +1,30 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + *err = 0; + register kernel_ulong_t r12 __asm__("r12") = nr; + register kernel_ulong_t r3 __asm__("r3"); + __asm__ __volatile__("brki r14, 8" + : "=r"(r3) + : "r"(r12) + : "memory", "r4", "r5", "r6", "r7", + "r8", "r9", "r10", "r11"); + return r3; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/microblaze/set_error.c b/linux/microblaze/set_error.c index 46866719..71b3fbc3 100644 --- a/linux/microblaze/set_error.c +++ b/linux/microblaze/set_error.c @@ -1,13 +1,20 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_error(struct tcb *tcp) { microblaze_r3 = -tcp->u_error; - return upoke(tcp->pid, 3 * 4, microblaze_r3); + return upoke(tcp, 3 * 4, microblaze_r3); } static int arch_set_success(struct tcb *tcp) { microblaze_r3 = tcp->u_rval; - return upoke(tcp->pid, 3 * 4, microblaze_r3); + return upoke(tcp, 3 * 4, microblaze_r3); } diff --git a/linux/microblaze/set_scno.c b/linux/microblaze/set_scno.c index b9cddefc..cf896cc2 100644 --- a/linux/microblaze/set_scno.c +++ b/linux/microblaze/set_scno.c @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { - return upoke(tcp->pid, 0, scno); + return upoke(tcp, 0, scno); } diff --git a/linux/microblaze/syscallent.h b/linux/microblaze/syscallent.h index d71e97ac..8e2a3dd9 100644 --- a/linux/microblaze/syscallent.h +++ b/linux/microblaze/syscallent.h @@ -1,29 +1,10 @@ /* * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995 Rick Sladkey + * Copyright (c) 1995-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ [ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, @@ -44,17 +25,17 @@ [ 15] = { 2, TF, SEN(chmod), "chmod" }, [ 16] = { 3, TF, SEN(chown16), "lchown" }, [ 17] = { 0, TM, SEN(break), "break" }, -[ 18] = { 2, TF, SEN(oldstat), "oldstat" }, +[ 18] = { 2, TF|TST|TSTA, SEN(oldstat), "oldstat" }, [ 19] = { 3, TD, SEN(lseek), "lseek" }, -[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 20] = { 0, PU|NF, SEN(getpid), "getpid" }, [ 21] = { 5, TF, SEN(mount), "mount" }, [ 22] = { 1, TF, SEN(umount), "umount" }, [ 23] = { 1, 0, SEN(setuid16), "setuid" }, -[ 24] = { 0, NF, SEN(getuid16), "getuid" }, +[ 24] = { 0, PU|NF, SEN(getuid16), "getuid" }, [ 25] = { 1, 0, SEN(stime), "stime" }, [ 26] = { 4, 0, SEN(ptrace), "ptrace" }, [ 27] = { 1, 0, SEN(alarm), "alarm" }, -[ 28] = { 2, TD, SEN(oldfstat), "oldfstat" }, +[ 28] = { 2, TD|TFST|TSTA, SEN(oldfstat), "oldfstat" }, [ 29] = { 0, TS, SEN(pause), "pause" }, [ 30] = { 2, TF, SEN(utime), "utime" }, [ 31] = { 2, 0, SEN(stty), "stty" }, @@ -73,10 +54,10 @@ [ 44] = { 0, 0, SEN(prof), "prof" }, [ 45] = { 1, TM|SI, SEN(brk), "brk" }, [ 46] = { 1, 0, SEN(setgid16), "setgid" }, -[ 47] = { 0, NF, SEN(getgid16), "getgid" }, +[ 47] = { 0, PU|NF, SEN(getgid16), "getgid" }, [ 48] = { 2, TS, SEN(signal), "signal" }, -[ 49] = { 0, NF, SEN(geteuid16), "geteuid" }, -[ 50] = { 0, NF, SEN(getegid16), "getegid" }, +[ 49] = { 0, PU|NF, SEN(geteuid16), "geteuid" }, +[ 50] = { 0, PU|NF, SEN(getegid16), "getegid" }, [ 51] = { 1, TF, SEN(acct), "acct" }, [ 52] = { 2, TF, SEN(umount2), "umount2" }, [ 53] = { 0, 0, SEN(lock), "lock" }, @@ -88,14 +69,14 @@ [ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, [ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, -[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 62] = { 2, TSFA, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, -[ 64] = { 0, NF, SEN(getppid), "getppid" }, -[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 64] = { 0, PU|NF, SEN(getppid), "getppid" }, +[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, [ 66] = { 0, 0, SEN(setsid), "setsid" }, [ 67] = { 3, TS, SEN(sigaction), "sigaction" }, -[ 68] = { 0, TS, SEN(siggetmask), "sgetmask" }, -[ 69] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[ 68] = { 0, TS, SEN(sgetmask), "sgetmask" }, +[ 69] = { 1, TS, SEN(ssetmask), "ssetmask" }, [ 70] = { 2, 0, SEN(setreuid16), "setreuid" }, [ 71] = { 2, 0, SEN(setregid16), "setregid" }, [ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, @@ -110,7 +91,7 @@ [ 81] = { 2, 0, SEN(setgroups16), "setgroups" }, [ 82] = { 1, TD, SEN(oldselect), "select" }, [ 83] = { 2, TF, SEN(symlink), "symlink" }, -[ 84] = { 2, TF, SEN(oldlstat), "oldlstat" }, +[ 84] = { 2, TF|TLST|TSTA, SEN(oldlstat), "oldlstat" }, [ 85] = { 3, TF, SEN(readlink), "readlink" }, [ 86] = { 1, TF, SEN(uselib), "uselib" }, [ 87] = { 2, TF, SEN(swapon), "swapon" }, @@ -125,16 +106,16 @@ [ 96] = { 2, 0, SEN(getpriority), "getpriority" }, [ 97] = { 3, 0, SEN(setpriority), "setpriority" }, [ 98] = { 4, 0, SEN(profil), "profil" }, -[ 99] = { 2, TF, SEN(statfs), "statfs" }, -[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, [101] = { 3, 0, SEN(ioperm), "ioperm" }, [102] = { 2, TD, SEN(socketcall), "socketcall" }, [103] = { 3, 0, SEN(syslog), "syslog" }, [104] = { 3, 0, SEN(setitimer), "setitimer" }, [105] = { 2, 0, SEN(getitimer), "getitimer" }, -[106] = { 2, TF, SEN(stat), "stat" }, -[107] = { 2, TF, SEN(lstat), "lstat" }, -[108] = { 2, TD, SEN(fstat), "fstat" }, +[106] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, +[107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, +[108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, [109] = { 1, 0, SEN(olduname), "olduname" }, [110] = { 1, 0, SEN(iopl), "iopl" }, [111] = { 0, 0, SEN(vhangup), "vhangup" }, @@ -150,7 +131,7 @@ [121] = { 2, 0, SEN(setdomainname), "setdomainname" }, [122] = { 1, 0, SEN(uname), "uname" }, [123] = { 3, 0, SEN(modify_ldt), "modify_ldt" }, -[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[124] = { 1, 0, SEN(adjtimex32), "adjtimex" }, [125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, [126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, [127] = { 2, 0, SEN(create_module), "create_module" }, @@ -187,14 +168,14 @@ [158] = { 0, 0, SEN(sched_yield), "sched_yield" }, [159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, -[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[161] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"}, +[162] = { 2, 0, SEN(nanosleep_time32), "nanosleep" }, [163] = { 5, TM|SI, SEN(mremap), "mremap" }, [164] = { 3, 0, SEN(setresuid16), "setresuid" }, [165] = { 3, 0, SEN(getresuid16), "getresuid" }, [166] = { 5, 0, SEN(vm86), "vm86" }, [167] = { 5, 0, SEN(query_module), "query_module" }, -[168] = { 3, TD, SEN(poll), "poll" }, +[168] = { 3, TD, SEN(poll_time32), "poll" }, [169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, [170] = { 3, 0, SEN(setresgid16), "setresgid" }, [171] = { 3, 0, SEN(getresgid16), "getresgid" }, @@ -203,7 +184,7 @@ [174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, [175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, [176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[177] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[177] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" }, [178] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, [179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, [180] = { 5, TD, SEN(pread), "pread64" }, @@ -221,14 +202,14 @@ [192] = { 6, TD|TM|SI, SEN(mmap_pgoff), "mmap2" }, [193] = { 3, TF, SEN(truncate64), "truncate64" }, [194] = { 3, TD, SEN(ftruncate64), "ftruncate64" }, -[195] = { 2, TF, SEN(stat64), "stat64" }, -[196] = { 2, TF, SEN(lstat64), "lstat64" }, -[197] = { 2, TD, SEN(fstat64), "fstat64" }, +[195] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" }, +[196] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" }, +[197] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" }, [198] = { 3, TF, SEN(chown), "lchown32" }, -[199] = { 0, NF, SEN(getuid), "getuid32" }, -[200] = { 0, NF, SEN(getgid), "getgid32" }, -[201] = { 0, NF, SEN(geteuid), "geteuid32" }, -[202] = { 0, NF, SEN(geteuid), "getegid32" }, +[199] = { 0, PU|NF, SEN(getuid), "getuid32" }, +[200] = { 0, PU|NF, SEN(getgid), "getgid32" }, +[201] = { 0, PU|NF, SEN(geteuid), "geteuid32" }, +[202] = { 0, PU|NF, SEN(geteuid), "getegid32" }, [203] = { 2, 0, SEN(setreuid), "setreuid32" }, [204] = { 2, 0, SEN(setregid), "setregid32" }, [205] = { 2, 0, SEN(getgroups), "getgroups32" }, @@ -249,7 +230,7 @@ [220] = { 3, TD, SEN(getdents64), "getdents64" }, [221] = { 3, TD, SEN(fcntl64), "fcntl64" }, [222 ... 223] = { }, -[224] = { 0, NF, SEN(gettid), "gettid" }, +[224] = { 0, PU|NF, SEN(gettid), "gettid" }, [225] = { 4, TD, SEN(readahead), "readahead" }, [226] = { 5, TF, SEN(setxattr), "setxattr" }, [227] = { 5, TF, SEN(setxattr), "lsetxattr" }, @@ -265,14 +246,14 @@ [237] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [238] = { 2, TS, SEN(kill), "tkill" }, [239] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, -[240] = { 6, 0, SEN(futex), "futex" }, +[240] = { 6, 0, SEN(futex_time32), "futex" }, [241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [243] = { 1, 0, SEN(set_thread_area), "set_thread_area" }, [244] = { 1, 0, SEN(get_thread_area), "get_thread_area" }, [245] = { 2, TM, SEN(io_setup), "io_setup" }, [246] = { 1, TM, SEN(io_destroy), "io_destroy" }, -[247] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[247] = { 5, 0, SEN(io_getevents_time32), "io_getevents" }, [248] = { 3, 0, SEN(io_submit), "io_submit" }, [249] = { 3, 0, SEN(io_cancel), "io_cancel" }, [250] = { 5, TD, SEN(fadvise64), "fadvise64" }, @@ -285,16 +266,16 @@ [257] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, [258] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [259] = { 3, 0, SEN(timer_create), "timer_create" }, -[260] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[261] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[260] = { 4, 0, SEN(timer_settime32), "timer_settime" }, +[261] = { 2, 0, SEN(timer_gettime32), "timer_gettime" }, [262] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, [263] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[264] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[265] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[266] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[267] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, -[268] = { 3, TF, SEN(statfs64), "statfs64" }, -[269] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[264] = { 2, 0, SEN(clock_settime32), "clock_settime" }, +[265] = { 2, 0, SEN(clock_gettime32), "clock_gettime" }, +[266] = { 2, 0, SEN(clock_getres_time32), "clock_getres" }, +[267] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" }, +[268] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, +[269] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, [270] = { 3, TS, SEN(tgkill), "tgkill" }, [271] = { 2, TF, SEN(utimes), "utimes" }, [272] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, @@ -302,12 +283,12 @@ [274] = { 6, TM, SEN(mbind), "mbind" }, [275] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, [276] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, -[277] = { 4, 0, SEN(mq_open), "mq_open" }, +[277] = { 4, TD, SEN(mq_open), "mq_open" }, [278] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[279] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[280] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[281] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[282] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[279] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" }, +[280] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" }, +[281] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[282] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, [283] = { 4, 0, SEN(kexec_load), "kexec_load" }, [284] = { 5, TP, SEN(waitid), "waitid" }, [285] = { }, @@ -317,7 +298,7 @@ [289] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, [290] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, [291] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[292] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[292] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, [293] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, [294] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, [295] = { 4, TD|TF, SEN(openat), "openat" }, @@ -325,7 +306,7 @@ [297] = { 4, TD|TF, SEN(mknodat), "mknodat" }, [298] = { 5, TD|TF, SEN(fchownat), "fchownat" }, [299] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[300] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[300] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" }, [301] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, [302] = { 4, TD|TF, SEN(renameat), "renameat" }, [303] = { 5, TD|TF, SEN(linkat), "linkat" }, @@ -333,8 +314,8 @@ [305] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, [306] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, [307] = { 3, TD|TF, SEN(faccessat), "faccessat" }, -[308] = { 6, TD, SEN(pselect6), "pselect6" }, -[309] = { 5, TD, SEN(ppoll), "ppoll" }, +[308] = { 6, TD, SEN(pselect6_time32), "pselect6" }, +[309] = { 5, TD, SEN(ppoll_time32), "ppoll" }, [310] = { 1, TP, SEN(unshare), "unshare" }, [311] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, [312] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, @@ -345,14 +326,14 @@ [317] = { 6, TM, SEN(move_pages), "move_pages" }, [318] = { 3, 0, SEN(getcpu), "getcpu" }, [319] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[320] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[320] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [321] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [322] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [323] = { 1, TD, SEN(eventfd), "eventfd" }, [324] = { 6, TD, SEN(fallocate), "fallocate" }, -[325] = { 4, TI, SEN(semtimedop), "semtimedop" }, -[326] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, -[327] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[325] = { 4, TI, SEN(semtimedop_time32), "semtimedop" }, +[326] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" }, +[327] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" }, [328] = { 4, TI, SEN(semctl), "semctl" }, [329] = { 3, TI, SEN(semget), "semget" }, [330] = { 3, TI, SEN(semop), "semop" }, @@ -392,13 +373,13 @@ [364] = { 5, TD, SEN(pwritev), "pwritev" }, [365] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, [366] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, -[367] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[367] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" }, [368] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, [369] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, [370] = { 4, 0, SEN(prlimit64), "prlimit64" }, [371] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, [372] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[373] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[373] = { 2, 0, SEN(clock_adjtime32), "clock_adjtime" }, [374] = { 1, TD, SEN(syncfs), "syncfs" }, [375] = { 2, TD, SEN(setns), "setns" }, [376] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, @@ -423,3 +404,31 @@ [395] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, [396] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, [397] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[398] = { 5, TD|TF|TSTA, SEN(statx), "statx" }, +[399] = { 6, 0, SEN(io_pgetevents_time32), "io_pgetevents" }, +[400] = { 4, 0, SEN(rseq), "rseq" }, +/* [401 ... 402] - unused */ +[403] = { 2, 0, SEN(clock_gettime64), "clock_gettime64" }, +[404] = { 2, 0, SEN(clock_settime64), "clock_settime64" }, +[405] = { 2, 0, SEN(clock_adjtime64), "clock_adjtime64" }, +[406] = { 2, 0, SEN(clock_getres_time64), "clock_getres_time64" }, +[407] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep_time64"}, +[408] = { 2, 0, SEN(timer_gettime64), "timer_gettime64" }, +[409] = { 4, 0, SEN(timer_settime64), "timer_settime64" }, +[410] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime64" }, +[411] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime64" }, +[412] = { 4, TD|TF, SEN(utimensat_time64), "utimensat_time64" }, +[413] = { 6, TD, SEN(pselect6_time64), "pselect6_time64" }, +[414] = { 5, TD, SEN(ppoll_time64), "ppoll_time64" }, +[416] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents_time64" }, +[417] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg_time64" }, +[418] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend_time64" }, +[419] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive_time64"}, +[420] = { 4, TI, SEN(semtimedop_time64), "semtimedop_time64" }, +[421] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait_time64"}, +[422] = { 6, 0, SEN(futex_time64), "futex_time64" }, +[423] = { 2, 0, SEN(sched_rr_get_interval_time64), "sched_rr_get_interval_time64" }, +[424] = { 4, TD|TS, SEN(pidfd_send_signal), "pidfd_send_signal" }, +[425] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" }, +[426] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" }, +[427] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" }, diff --git a/linux/microblaze/userent.h b/linux/microblaze/userent.h index 68710cf3..d3b64880 100644 --- a/linux/microblaze/userent.h +++ b/linux/microblaze/userent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + { PT_GPR(0), "r0" }, { PT_GPR(1), "r1" }, { PT_GPR(2), "r2" }, diff --git a/linux/mips/arch_defs_.h b/linux/mips/arch_defs_.h new file mode 100644 index 00000000..f789e18d --- /dev/null +++ b/linux/mips/arch_defs_.h @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define HAVE_ARCH_GETRVAL2 1 +#define HAVE_ARCH_DEDICATED_ERR_REG 1 +#define CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL 1 diff --git a/linux/mips/arch_getrval2.c b/linux/mips/arch_getrval2.c index 332f2706..33b53ba2 100644 --- a/linux/mips/arch_getrval2.c +++ b/linux/mips/arch_getrval2.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + long getrval2(struct tcb *tcp) { + if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0) + return -1; return mips_regs.uregs[3]; } diff --git a/linux/mips/arch_regs.c b/linux/mips/arch_regs.c index 44f6bd5e..0874e31e 100644 --- a/linux/mips/arch_regs.c +++ b/linux/mips/arch_regs.c @@ -1,4 +1,28 @@ -struct mips_regs mips_regs; /* not static */ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +static struct { + uint64_t uregs[38]; +} mips_regs; + +#define REG_V0 2 +#define REG_A0 4 + +#define mips_REG_V0 mips_regs.uregs[REG_V0] +#define mips_REG_A0 mips_regs.uregs[REG_A0 + 0] +#define mips_REG_A1 mips_regs.uregs[REG_A0 + 1] +#define mips_REG_A2 mips_regs.uregs[REG_A0 + 2] +#define mips_REG_A3 mips_regs.uregs[REG_A0 + 3] +#define mips_REG_A4 mips_regs.uregs[REG_A0 + 4] +#define mips_REG_A5 mips_regs.uregs[REG_A0 + 5] +#define mips_REG_SP mips_regs.uregs[29] +#define mips_REG_EPC mips_regs.uregs[34] + /* PTRACE_GETREGS on MIPS is available since linux v2.6.15. */ #define ARCH_REGS_FOR_GETREGS mips_regs #define ARCH_PC_REG mips_REG_EPC +#define ARCH_SP_REG mips_REG_SP diff --git a/linux/mips/arch_regs.h b/linux/mips/arch_regs.h deleted file mode 100644 index 6372badc..00000000 --- a/linux/mips/arch_regs.h +++ /dev/null @@ -1,18 +0,0 @@ -struct mips_regs { - uint64_t uregs[38]; -}; - -extern struct mips_regs mips_regs; - -#define REG_V0 2 -#define REG_A0 4 - -#define mips_REG_V0 mips_regs.uregs[REG_V0] -#define mips_REG_A0 mips_regs.uregs[REG_A0 + 0] -#define mips_REG_A1 mips_regs.uregs[REG_A0 + 1] -#define mips_REG_A2 mips_regs.uregs[REG_A0 + 2] -#define mips_REG_A3 mips_regs.uregs[REG_A0 + 3] -#define mips_REG_A4 mips_regs.uregs[REG_A0 + 4] -#define mips_REG_A5 mips_regs.uregs[REG_A0 + 5] -#define mips_REG_SP mips_regs.uregs[29] -#define mips_REG_EPC mips_regs.uregs[34] diff --git a/linux/mips/arch_sigreturn.c b/linux/mips/arch_sigreturn.c index 72f7619b..fe8180f3 100644 --- a/linux/mips/arch_sigreturn.c +++ b/linux/mips/arch_sigreturn.c @@ -1,26 +1,26 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static void arch_sigreturn(struct tcb *tcp) { -#if defined LINUX_MIPSO32 + /* 64-bit ABIs do not have old sigreturn. */ +#ifdef LINUX_MIPSO32 + kernel_ulong_t addr; + if (!get_stack_pointer(tcp, &addr)) + return; /* * offsetof(struct sigframe, sf_mask) == * sizeof(sf_ass) + sizeof(sf_pad) + sizeof(struct sigcontext) */ - const kernel_ulong_t addr = mips_REG_SP + 6 * 4 + - sizeof(struct sigcontext); -#else - /* - * This decodes rt_sigreturn. - * The 64-bit ABIs do not have sigreturn. - * - * offsetof(struct rt_sigframe, rs_uc) == - * sizeof(sf_ass) + sizeof(sf_pad) + sizeof(struct siginfo) - */ - const kernel_ulong_t addr = mips_REG_SP + 6 * 4 + 128 + - offsetof(struct ucontext, uc_sigmask); -#endif + addr += 6 * 4 + sizeof(struct sigcontext); tprints("{mask="); - print_sigset_addr_len(tcp, addr, NSIG_BYTES); + print_sigset_addr(tcp, addr); tprints("}"); +#endif } diff --git a/linux/mips/errnoent.h b/linux/mips/errnoent.h index a82f9c62..6f0c16fb 100644 --- a/linux/mips/errnoent.h +++ b/linux/mips/errnoent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 1999-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + [ 1] = "EPERM", [ 2] = "ENOENT", [ 3] = "ESRCH", @@ -147,4 +154,5 @@ [527] = "EBADTYPE", [528] = "EJUKEBOX", [529] = "EIOCBQUEUED", +[530] = "ERECALLCONFLICT", [1133] = "EDQUOT", diff --git a/linux/mips/genstub.sh b/linux/mips/genstub.sh index 11f141f5..0d21692e 100755 --- a/linux/mips/genstub.sh +++ b/linux/mips/genstub.sh @@ -1,4 +1,9 @@ #!/bin/sh -e +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: LGPL-2.1-or-later srcdir="${0%/*}" dstdir="$1"; shift diff --git a/linux/mips/get_error.c b/linux/mips/get_error.c index 4096de26..bcc219d5 100644 --- a/linux/mips/get_error.c +++ b/linux/mips/get_error.c @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { if (mips_REG_A3) { tcp->u_rval = -1; diff --git a/linux/mips/get_scno.c b/linux/mips/get_scno.c index 9364f817..f06fae46 100644 --- a/linux/mips/get_scno.c +++ b/linux/mips/get_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) diff --git a/linux/mips/get_syscall_args.c b/linux/mips/get_syscall_args.c index ca2819bf..fc843f49 100644 --- a/linux/mips/get_syscall_args.c +++ b/linux/mips/get_syscall_args.c @@ -1,6 +1,13 @@ +/* + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { #if defined LINUX_MIPSN64 || defined LINUX_MIPSN32 tcp->u_arg[0] = mips_REG_A0; @@ -14,14 +21,64 @@ get_syscall_args(struct tcb *tcp) tcp->u_arg[1] = mips_REG_A1; tcp->u_arg[2] = mips_REG_A2; tcp->u_arg[3] = mips_REG_A3; - if (tcp->s_ent->nargs > 4) { - if (umoven(tcp, mips_REG_SP + 4 * 4, - (tcp->s_ent->nargs - 4) * sizeof(tcp->u_arg[0]), - &tcp->u_arg[4]) < 0) - return -1; + if (n_args(tcp) > 4 + && umoven(tcp, mips_REG_SP + 4 * sizeof(tcp->u_arg[0]), + (n_args(tcp) - 4) * sizeof(tcp->u_arg[0]), + &tcp->u_arg[4]) < 0) { + /* + * Let's proceed with the first 4 arguments + * instead of reporting the failure. + */ + memset(&tcp->u_arg[4], 0, + (n_args(tcp) - 4) * sizeof(tcp->u_arg[0])); } #else # error unsupported mips abi #endif return 1; } + +#ifdef LINUX_MIPSO32 +static void +arch_get_syscall_args_extra(struct tcb *tcp, const unsigned int n) +{ + /* This assumes n >= 4. */ + if (n_args(tcp) > n + && umoven(tcp, mips_REG_SP + n * sizeof(tcp->u_arg[0]), + (n_args(tcp) - n) * sizeof(tcp->u_arg[0]), + &tcp->u_arg[n]) < 0) { + /* + * Let's proceed with the first n arguments + * instead of reporting the failure. + */ + memset(&tcp->u_arg[n], 0, + (n_args(tcp) - n) * sizeof(tcp->u_arg[0])); + } +} +#endif + +#ifdef SYS_syscall_subcall +static void +decode_syscall_subcall(struct tcb *tcp) +{ + if (!scno_is_valid(tcp->u_arg[0])) + return; + tcp->scno = tcp->u_arg[0]; + tcp->qual_flg = qual_flags(tcp->scno); + tcp->s_ent = &sysent[tcp->scno]; + memmove(&tcp->u_arg[0], &tcp->u_arg[1], + sizeof(tcp->u_arg) - sizeof(tcp->u_arg[0])); + /* + * Fetching the last arg of 7-arg syscalls (fadvise64_64 + * and sync_file_range) requires additional code, + * see arch_get_syscall_args() above. + */ + if (n_args(tcp) == MAX_ARGS) { + if (umoven(tcp, + mips_REG_SP + MAX_ARGS * sizeof(tcp->u_arg[0]), + sizeof(tcp->u_arg[0]), + &tcp->u_arg[MAX_ARGS - 1]) < 0) + tcp->u_arg[MAX_ARGS - 1] = 0; + } +} +#endif /* SYS_syscall_subcall */ diff --git a/linux/mips/ioctls_arch0.h b/linux/mips/ioctls_arch0.h index 966e9ae5..7994bd43 100644 --- a/linux/mips/ioctls_arch0.h +++ b/linux/mips/ioctls_arch0.h @@ -29,12 +29,14 @@ { "asm/ioctls.h", "TIOCGETP", 0, 0x7408, 0 }, { "asm/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 }, { "asm/ioctls.h", "TIOCGICOUNT", 0, 0x5492, 0 }, +{ "asm/ioctls.h", "TIOCGISO7816", _IOC_READ, 0x5442, 0x28 }, { "asm/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x548b, 0 }, { "asm/ioctls.h", "TIOCGLTC", 0, 0x7474, 0 }, { "asm/ioctls.h", "TIOCGPGRP", _IOC_READ, 0x7477, 0x04 }, { "asm/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 }, { "asm/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 }, { "asm/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 }, +{ "asm/ioctls.h", "TIOCGPTPEER", _IOC_NONE, 0x5441, 0x00 }, { "asm/ioctls.h", "TIOCGRS485", _IOC_READ, 0x542e, 0x20 }, { "asm/ioctls.h", "TIOCGSERIAL", 0, 0x5484, 0 }, { "asm/ioctls.h", "TIOCGSID", 0, 0x7416, 0 }, @@ -63,6 +65,7 @@ { "asm/ioctls.h", "TIOCSETN", 0, 0x740a, 0 }, { "asm/ioctls.h", "TIOCSETP", 0, 0x7409, 0 }, { "asm/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 }, +{ "asm/ioctls.h", "TIOCSISO7816", _IOC_READ|_IOC_WRITE, 0x5443, 0x28 }, { "asm/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x548c, 0 }, { "asm/ioctls.h", "TIOCSLTC", 0, 0x7475, 0 }, { "asm/ioctls.h", "TIOCSPGRP", _IOC_WRITE, 0x7476, 0x04 }, @@ -80,3 +83,72 @@ { "asm/sockios.h", "SIOCGSTAMP", 0, 0x8906, 0 }, { "asm/sockios.h", "SIOCGSTAMPNS", 0, 0x8907, 0 }, { "asm/sockios.h", "SIOCSPGRP", _IOC_WRITE, 0x7308, 0x04 }, +{ "linux/kvm.h", "KVM_ASSIGN_DEV_IRQ", _IOC_WRITE, 0xae70, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_PCI_DEVICE", _IOC_READ, 0xae69, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_INTX_MASK", _IOC_WRITE, 0xaea4, 0x40 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_ENTRY", _IOC_WRITE, 0xae74, 0x10 }, +{ "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_NR", _IOC_WRITE, 0xae73, 0x08 }, +{ "linux/kvm.h", "KVM_CHECK_EXTENSION", _IOC_NONE, 0xae03, 0x00 }, +{ "linux/kvm.h", "KVM_CLEAR_DIRTY_LOG", _IOC_READ|_IOC_WRITE, 0xaec0, 0x18 }, +{ "linux/kvm.h", "KVM_CREATE_DEVICE", _IOC_READ|_IOC_WRITE, 0xaee0, 0x0c }, +{ "linux/kvm.h", "KVM_CREATE_IRQCHIP", _IOC_NONE, 0xae60, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_PIT", _IOC_NONE, 0xae64, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_PIT2", _IOC_WRITE, 0xae77, 0x40 }, +{ "linux/kvm.h", "KVM_CREATE_VCPU", _IOC_NONE, 0xae41, 0x00 }, +{ "linux/kvm.h", "KVM_CREATE_VM", _IOC_NONE, 0xae01, 0x00 }, +{ "linux/kvm.h", "KVM_DEASSIGN_DEV_IRQ", _IOC_WRITE, 0xae75, 0x40 }, +{ "linux/kvm.h", "KVM_DEASSIGN_PCI_DEVICE", _IOC_WRITE, 0xae72, 0x40 }, +{ "linux/kvm.h", "KVM_DIRTY_TLB", _IOC_WRITE, 0xaeaa, 0x10 }, +{ "linux/kvm.h", "KVM_ENABLE_CAP", _IOC_WRITE, 0xaea3, 0x68 }, +{ "linux/kvm.h", "KVM_GET_API_VERSION", _IOC_NONE, 0xae00, 0x00 }, +{ "linux/kvm.h", "KVM_GET_CLOCK", _IOC_READ, 0xae7c, 0x30 }, +{ "linux/kvm.h", "KVM_GET_DEVICE_ATTR", _IOC_WRITE, 0xaee2, 0x18 }, +{ "linux/kvm.h", "KVM_GET_DIRTY_LOG", _IOC_WRITE, 0xae42, 0x10 }, +{ "linux/kvm.h", "KVM_GET_FPU", _IOC_READ, 0xae8c, 0x00 }, +{ "linux/kvm.h", "KVM_GET_IRQCHIP", _IOC_READ|_IOC_WRITE, 0xae62, 0x208 }, +{ "linux/kvm.h", "KVM_GET_MP_STATE", _IOC_READ, 0xae98, 0x04 }, +{ "linux/kvm.h", "KVM_GET_NR_MMU_PAGES", _IOC_NONE, 0xae45, 0x00 }, +{ "linux/kvm.h", "KVM_GET_ONE_REG", _IOC_WRITE, 0xaeab, 0x10 }, +{ "linux/kvm.h", "KVM_GET_REGS", _IOC_READ, 0xae81, 0x118 }, +{ "linux/kvm.h", "KVM_GET_REG_LIST", _IOC_READ|_IOC_WRITE, 0xaeb0, 0x08 }, +{ "linux/kvm.h", "KVM_GET_SREGS", _IOC_READ, 0xae83, 0x00 }, +{ "linux/kvm.h", "KVM_GET_TSC_KHZ", _IOC_NONE, 0xaea3, 0x00 }, +{ "linux/kvm.h", "KVM_GET_VCPU_MMAP_SIZE", _IOC_NONE, 0xae04, 0x00 }, +{ "linux/kvm.h", "KVM_HAS_DEVICE_ATTR", _IOC_WRITE, 0xaee3, 0x18 }, +{ "linux/kvm.h", "KVM_INTERRUPT", _IOC_WRITE, 0xae86, 0x04 }, +{ "linux/kvm.h", "KVM_IOEVENTFD", _IOC_WRITE, 0xae79, 0x40 }, +{ "linux/kvm.h", "KVM_IRQFD", _IOC_WRITE, 0xae76, 0x20 }, +{ "linux/kvm.h", "KVM_IRQ_LINE", _IOC_WRITE, 0xae61, 0x08 }, +{ "linux/kvm.h", "KVM_IRQ_LINE_STATUS", _IOC_READ|_IOC_WRITE, 0xae67, 0x08 }, +{ "linux/kvm.h", "KVM_KVMCLOCK_CTRL", _IOC_NONE, 0xaead, 0x00 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_OP", _IOC_READ|_IOC_WRITE, 0xaeba, 0x08 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_REG_REGION", _IOC_READ, 0xaebb, 0x10 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_UNREG_REGION", _IOC_READ, 0xaebc, 0x10 }, +{ "linux/kvm.h", "KVM_NMI", _IOC_NONE, 0xae9a, 0x00 }, +{ "linux/kvm.h", "KVM_REGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae67, 0x10 }, +{ "linux/kvm.h", "KVM_REINJECT_CONTROL", _IOC_NONE, 0xae71, 0x00 }, +{ "linux/kvm.h", "KVM_RUN", _IOC_NONE, 0xae80, 0x00 }, +{ "linux/kvm.h", "KVM_SET_BOOT_CPU_ID", _IOC_NONE, 0xae78, 0x00 }, +{ "linux/kvm.h", "KVM_SET_CLOCK", _IOC_WRITE, 0xae7b, 0x30 }, +{ "linux/kvm.h", "KVM_SET_DEVICE_ATTR", _IOC_WRITE, 0xaee1, 0x18 }, +{ "linux/kvm.h", "KVM_SET_FPU", _IOC_WRITE, 0xae8d, 0x00 }, +{ "linux/kvm.h", "KVM_SET_GSI_ROUTING", _IOC_WRITE, 0xae6a, 0x08 }, +{ "linux/kvm.h", "KVM_SET_GUEST_DEBUG", _IOC_WRITE, 0xae9b, 0x08 }, +{ "linux/kvm.h", "KVM_SET_IDENTITY_MAP_ADDR", _IOC_WRITE, 0xae48, 0x08 }, +{ "linux/kvm.h", "KVM_SET_IRQCHIP", _IOC_READ, 0xae63, 0x208 }, +{ "linux/kvm.h", "KVM_SET_MEMORY_REGION", _IOC_WRITE, 0xae40, 0x18 }, +{ "linux/kvm.h", "KVM_SET_MP_STATE", _IOC_WRITE, 0xae99, 0x04 }, +{ "linux/kvm.h", "KVM_SET_NR_MMU_PAGES", _IOC_NONE, 0xae44, 0x00 }, +{ "linux/kvm.h", "KVM_SET_ONE_REG", _IOC_WRITE, 0xaeac, 0x10 }, +{ "linux/kvm.h", "KVM_SET_REGS", _IOC_WRITE, 0xae82, 0x118 }, +{ "linux/kvm.h", "KVM_SET_SIGNAL_MASK", _IOC_WRITE, 0xae8b, 0x04 }, +{ "linux/kvm.h", "KVM_SET_SREGS", _IOC_WRITE, 0xae84, 0x00 }, +{ "linux/kvm.h", "KVM_SET_TSC_KHZ", _IOC_NONE, 0xaea2, 0x00 }, +{ "linux/kvm.h", "KVM_SET_TSS_ADDR", _IOC_NONE, 0xae47, 0x00 }, +{ "linux/kvm.h", "KVM_SET_USER_MEMORY_REGION", _IOC_WRITE, 0xae46, 0x20 }, +{ "linux/kvm.h", "KVM_SET_VAPIC_ADDR", _IOC_WRITE, 0xae93, 0x08 }, +{ "linux/kvm.h", "KVM_SIGNAL_MSI", _IOC_WRITE, 0xaea5, 0x20 }, +{ "linux/kvm.h", "KVM_SMI", _IOC_NONE, 0xaeb7, 0x00 }, +{ "linux/kvm.h", "KVM_TPR_ACCESS_REPORTING", _IOC_READ|_IOC_WRITE, 0xae92, 0x28 }, +{ "linux/kvm.h", "KVM_TRANSLATE", _IOC_READ|_IOC_WRITE, 0xae85, 0x18 }, +{ "linux/kvm.h", "KVM_UNREGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae68, 0x10 }, diff --git a/linux/mips/ioctls_inc0.h b/linux/mips/ioctls_inc0.h index c00687f6..da4259ef 100644 --- a/linux/mips/ioctls_inc0.h +++ b/linux/mips/ioctls_inc0.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #ifdef LINUX_MIPSN64 # include "64/ioctls_inc.h" #else diff --git a/linux/mips/raw_syscall.h b/linux/mips/raw_syscall.h new file mode 100644 index 00000000..d1d33bc6 --- /dev/null +++ b/linux/mips/raw_syscall.h @@ -0,0 +1,35 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + register kernel_ulong_t s0 __asm__("$16") = nr; + register kernel_ulong_t v0 __asm__("$2"); + register kernel_ulong_t a3 __asm__("$7"); + __asm__ __volatile__(".set noreorder\n\t" + "move %0, %2\n\t" + "syscall\n\t" + ".set reorder" + : "=r"(v0), "=r"(a3) + : "r"(s0) + : "memory", "hi", "lo", "$1", "$3", "$8", "$9", + "$10", "$11", "$12", "$13", "$14", "$15", + "$24", "$25"); + *err = a3; + return v0; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/mips/rt_sigframe.h b/linux/mips/rt_sigframe.h new file mode 100644 index 00000000..1c3019dd --- /dev/null +++ b/linux/mips/rt_sigframe.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RT_SIGFRAME_H +# define STRACE_RT_SIGFRAME_H + +# include + +typedef struct { + uint32_t pad[6]; + siginfo_t info; + ucontext_t uc; +} struct_rt_sigframe; + +#endif /* !STRACE_RT_SIGFRAME_H */ diff --git a/linux/mips/set_error.c b/linux/mips/set_error.c index 89cf38ce..af019ae0 100644 --- a/linux/mips/set_error.c +++ b/linux/mips/set_error.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_error(struct tcb *tcp) { diff --git a/linux/mips/set_scno.c b/linux/mips/set_scno.c index 1eb456cc..ad312583 100644 --- a/linux/mips/set_scno.c +++ b/linux/mips/set_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { diff --git a/linux/mips/signalent.h b/linux/mips/signalent.h index d18e5105..c3caf2bb 100644 --- a/linux/mips/signalent.h +++ b/linux/mips/signalent.h @@ -1,4 +1,11 @@ - "SIG_0", /* 0 */ +/* + * Copyright (c) 1999-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + + "0", /* 0 */ "SIGHUP", /* 1 */ "SIGINT", /* 2 */ "SIGQUIT", /* 3 */ diff --git a/linux/mips/syscallent-compat.h b/linux/mips/syscallent-compat.h index 82a373b6..fce44a27 100644 --- a/linux/mips/syscallent-compat.h +++ b/linux/mips/syscallent-compat.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2013-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + [ 0] = { 0, 0, SEN(printargs), "svr4_syscall" }, [ 1] = { 0, 0, SEN(printargs), "svr4_exit" }, [ 2] = { 0, 0, SEN(printargs), "svr4_fork" }, @@ -16,7 +23,7 @@ [ 15] = { 0, 0, SEN(printargs), "svr4_chmod" }, [ 16] = { 0, 0, SEN(printargs), "svr4_chown" }, [ 17] = { 0, TM, SEN(printargs), "svr4_sbreak" }, -[ 18] = { 0, 0, SEN(printargs), "svr4_stat" }, +[ 18] = { 0, TF|TST|TSTA,SEN(printargs), "svr4_stat" }, [ 19] = { 0, 0, SEN(printargs), "svr4_lseek" }, [ 20] = { 0, 0, SEN(printargs), "svr4_getpid" }, [ 21] = { 0, 0, SEN(printargs), "svr4_mount" }, @@ -26,17 +33,17 @@ [ 25] = { 0, 0, SEN(printargs), "svr4_stime" }, [ 26] = { 0, 0, SEN(printargs), "svr4_ptrace" }, [ 27] = { 0, 0, SEN(printargs), "svr4_alarm" }, -[ 28] = { 0, 0, SEN(printargs), "svr4_fstat" }, +[ 28] = { 0, TD|TFST|TSTA,SEN(printargs), "svr4_fstat" }, [ 29] = { 0, 0, SEN(printargs), "svr4_pause" }, [ 30] = { 0, 0, SEN(printargs), "svr4_utime" }, [ 31] = { 0, 0, SEN(printargs), "svr4_stty" }, [ 32] = { 0, 0, SEN(printargs), "svr4_gtty" }, [ 33] = { 0, 0, SEN(printargs), "svr4_access" }, [ 34] = { 0, 0, SEN(printargs), "svr4_nice" }, -[ 35] = { 0, 0, SEN(printargs), "svr4_statfs" }, +[ 35] = { 0, TF|TSF|TSFA,SEN(printargs), "svr4_statfs" }, [ 36] = { 0, 0, SEN(printargs), "svr4_sync" }, [ 37] = { 0, 0, SEN(printargs), "svr4_kill" }, -[ 38] = { 0, 0, SEN(printargs), "svr4_fstatfs" }, +[ 38] = { 0, TD|TFSF|TSFA,SEN(printargs), "svr4_fstatfs" }, [ 39] = { 0, 0, SEN(printargs), "svr4_setpgrp" }, [ 40] = { 0, 0, SEN(printargs), "svr4_cxenix" }, [ 41] = { 0, 0, SEN(printargs), "svr4_dup" }, @@ -81,7 +88,7 @@ [ 85] = { 0, 0, SEN(printargs), "svr4_getmsg" }, [ 86] = { 0, 0, SEN(printargs), "svr4_putmsg" }, [ 87] = { 0, 0, SEN(printargs), "svr4_poll" }, -[ 88] = { 0, 0, SEN(printargs), "svr4_lstat" }, +[ 88] = { 0, TF|TLST|TSTA,SEN(printargs), "svr4_lstat" }, [ 89] = { 0, 0, SEN(printargs), "svr4_symlink" }, [ 90] = { 0, 0, SEN(printargs), "svr4_readlink" }, [ 91] = { 0, 0, SEN(printargs), "svr4_setgroups" }, @@ -96,8 +103,8 @@ [ 100] = { 0, 0, SEN(printargs), "svr4_setcontext" }, [ 101] = { 0, 0, SEN(printargs), "svr4_evsys" }, [ 102] = { 0, 0, SEN(printargs), "svr4_evtrapret" }, -[ 103] = { 0, 0, SEN(printargs), "svr4_statvfs" }, -[ 104] = { 0, 0, SEN(printargs), "svr4_fstatvfs" }, +[ 103] = { 0, TF|TSF|TSFA,SEN(printargs), "svr4_statvfs" }, +[ 104] = { 0, TD|TFSF|TSFA,SEN(printargs), "svr4_fstatvfs" }, [ 105] = { }, [ 106] = { 0, 0, SEN(printargs), "svr4_nfssys" }, [ 107] = { 0, 0, SEN(printargs), "svr4_waitid" }, @@ -116,9 +123,9 @@ [ 120] = { 0, 0, SEN(printargs), "svr4_fchdir" }, [ 121] = { 0, 0, SEN(printargs), "svr4_readv" }, [ 122] = { 0, 0, SEN(printargs), "svr4_writev" }, -[ 123] = { 0, 0, SEN(printargs), "svr4_xstat" }, -[ 124] = { 0, 0, SEN(printargs), "svr4_lxstat" }, -[ 125] = { 0, 0, SEN(printargs), "svr4_fxstat" }, +[ 123] = { 0, TF|TST|TSTA,SEN(printargs), "svr4_xstat" }, +[ 124] = { 0, TF|TLST|TSTA,SEN(printargs), "svr4_lxstat" }, +[ 125] = { 0, TD|TFST|TSTA,SEN(printargs), "svr4_fxstat" }, [ 126] = { 0, 0, SEN(printargs), "svr4_xmknod" }, [ 127] = { 0, 0, SEN(printargs), "svr4_clocal" }, [ 128] = { 0, 0, SEN(printargs), "svr4_setrlimit" }, @@ -167,7 +174,7 @@ [1015] = { 0, 0, SEN(printargs), "sysv_chmod" }, [1016] = { 0, 0, SEN(printargs), "sysv_chown" }, [1017] = { 0, TM|SI, SEN(printargs), "sysv_brk" }, -[1018] = { 0, 0, SEN(printargs), "sysv_stat" }, +[1018] = { 0, TF|TST|TSTA,SEN(printargs), "sysv_stat" }, [1019] = { 0, 0, SEN(printargs), "sysv_lseek" }, [1020] = { 0, 0, SEN(printargs), "sysv_getpid" }, [1021] = { 0, 0, SEN(printargs), "sysv_mount" }, @@ -177,17 +184,17 @@ [1025] = { 0, 0, SEN(printargs), "sysv_stime" }, [1026] = { 0, 0, SEN(printargs), "sysv_ptrace" }, [1027] = { 0, 0, SEN(printargs), "sysv_alarm" }, -[1028] = { 0, 0, SEN(printargs), "sysv_fstat" }, +[1028] = { 0, TD|TFST|TSTA,SEN(printargs), "sysv_fstat" }, [1029] = { 0, 0, SEN(printargs), "sysv_pause" }, [1030] = { 0, 0, SEN(printargs), "sysv_utime" }, [1031] = { 0, 0, SEN(printargs), "sysv_stty" }, [1032] = { 0, 0, SEN(printargs), "sysv_gtty" }, [1033] = { 0, 0, SEN(printargs), "sysv_access" }, [1034] = { 0, 0, SEN(printargs), "sysv_nice" }, -[1035] = { 0, 0, SEN(printargs), "sysv_statfs" }, +[1035] = { 0, TF|TSF|TSFA,SEN(printargs), "sysv_statfs" }, [1036] = { 0, 0, SEN(printargs), "sysv_sync" }, [1037] = { 0, 0, SEN(printargs), "sysv_kill" }, -[1038] = { 0, 0, SEN(printargs), "sysv_fstatfs" }, +[1038] = { 0, TD|TFSF|TSFA,SEN(printargs), "sysv_fstatfs" }, [1039] = { 0, 0, SEN(printargs), "sysv_setpgrp" }, [1040] = { 0, 0, SEN(printargs), "sysv_syssgi" }, [1041] = { 0, 0, SEN(printargs), "sysv_dup" }, @@ -261,7 +268,7 @@ [1114] = { 0, 0, SEN(printargs), "sysv_rename" }, [1115] = { 0, 0, SEN(printargs), "sysv_symlink" }, [1116] = { 0, 0, SEN(printargs), "sysv_readlink" }, -[1117] = { 0, 0, SEN(printargs), "sysv_lstat" }, +[1117] = { 0, TF|TLST|TSTA,SEN(printargs), "sysv_lstat" }, [1118] = { 0, 0, SEN(printargs), "sysv_nfsmount" }, [1119] = { 0, 0, SEN(printargs), "sysv_nfssvc" }, [1120] = { 0, 0, SEN(printargs), "sysv_getfh" }, @@ -302,9 +309,9 @@ [1155] = { 0, 0, SEN(printargs), "sysv_socketpair" }, [1156] = { 0, 0, SEN(printargs), "sysv_sysinfo" }, [1157] = { 0, 0, SEN(printargs), "sysv_nuname" }, -[1158] = { 0, 0, SEN(printargs), "sysv_xstat" }, -[1159] = { 0, 0, SEN(printargs), "sysv_lxstat" }, -[1160] = { 0, 0, SEN(printargs), "sysv_fxstat" }, +[1158] = { 0, TF|TST|TSTA,SEN(printargs), "sysv_xstat" }, +[1159] = { 0, TF|TLST|TSTA,SEN(printargs), "sysv_lxstat" }, +[1160] = { 0, TD|TFST|TSTA,SEN(printargs), "sysv_fxstat" }, [1161] = { 0, 0, SEN(printargs), "sysv_xmknod" }, [1162] = { 0, 0, SEN(printargs), "sysv_ksigaction" }, [1163] = { 0, 0, SEN(printargs), "sysv_sigpending" }, @@ -318,8 +325,8 @@ [1171] = { 0, 0, SEN(printargs), "sysv_sigstack" }, [1172] = { 0, 0, SEN(printargs), "sysv_sigaltstack" }, [1173] = { 0, 0, SEN(printargs), "sysv_sigsendset" }, -[1174] = { 0, 0, SEN(printargs), "sysv_statvfs" }, -[1175] = { 0, 0, SEN(printargs), "sysv_fstatvfs" }, +[1174] = { 0, TF|TSF|TSFA,SEN(printargs), "sysv_statvfs" }, +[1175] = { 0, TD|TFSF|TSFA,SEN(printargs), "sysv_fstatvfs" }, [1176] = { 0, 0, SEN(printargs), "sysv_getpmsg" }, [1177] = { 0, 0, SEN(printargs), "sysv_putpmsg" }, [1178] = { 0, 0, SEN(printargs), "sysv_lchown" }, @@ -352,7 +359,7 @@ [2015] = { 0, 0, SEN(printargs), "bsd43_chmod" }, [2016] = { 0, 0, SEN(printargs), "bsd43_chown" }, [2017] = { 0, TM, SEN(printargs), "bsd43_sbreak" }, -[2018] = { 0, 0, SEN(printargs), "bsd43_oldstat" }, +[2018] = { 0, TF|TST|TSTA,SEN(printargs), "bsd43_oldstat" }, [2019] = { 0, 0, SEN(printargs), "bsd43_lseek" }, [2020] = { 0, 0, SEN(printargs), "bsd43_getpid" }, [2021] = { 0, 0, SEN(printargs), "bsd43_oldmount" }, @@ -362,7 +369,7 @@ [2025] = { 0, 0, SEN(printargs), "bsd43_stime" }, [2026] = { 0, 0, SEN(printargs), "bsd43_ptrace" }, [2027] = { 0, 0, SEN(printargs), "bsd43_alarm" }, -[2028] = { 0, 0, SEN(printargs), "bsd43_oldfstat" }, +[2028] = { 0, TD|TFST|TSTA,SEN(printargs), "bsd43_oldfstat" }, [2029] = { 0, 0, SEN(printargs), "bsd43_pause" }, [2030] = { 0, 0, SEN(printargs), "bsd43_utime" }, [2031] = { 0, 0, SEN(printargs), "bsd43_stty" }, @@ -372,9 +379,9 @@ [2035] = { 0, 0, SEN(printargs), "bsd43_ftime" }, [2036] = { 0, 0, SEN(printargs), "bsd43_sync" }, [2037] = { 0, 0, SEN(printargs), "bsd43_kill" }, -[2038] = { 0, 0, SEN(printargs), "bsd43_stat" }, +[2038] = { 0, TF|TST|TSTA,SEN(printargs), "bsd43_stat" }, [2039] = { 0, 0, SEN(printargs), "bsd43_oldsetpgrp" }, -[2040] = { 0, 0, SEN(printargs), "bsd43_lstat" }, +[2040] = { 0, TF|TLST|TSTA,SEN(printargs), "bsd43_lstat" }, [2041] = { 0, 0, SEN(printargs), "bsd43_dup" }, [2042] = { 0, 0, SEN(printargs), "bsd43_pipe" }, [2043] = { 0, 0, SEN(printargs), "bsd43_times" }, @@ -396,7 +403,7 @@ [2059] = { 0, 0, SEN(printargs), "bsd43_execve" }, [2060] = { 0, 0, SEN(printargs), "bsd43_umask" }, [2061] = { 0, 0, SEN(printargs), "bsd43_chroot" }, -[2062] = { 0, 0, SEN(printargs), "bsd43_fstat" }, +[2062] = { 0, TD|TFST|TSTA,SEN(printargs), "bsd43_fstat" }, [2063] = { }, [2064] = { 0, 0, SEN(printargs), "bsd43_getpagesize" }, [2065] = { 0, TM|SI, SEN(printargs), "bsd43_mremap" }, @@ -494,8 +501,8 @@ [2157] = { 0, 0, SEN(printargs), "bsd43_nfs_mount" }, [2158] = { 0, 0, SEN(printargs), "bsd43_nfs_svc" }, [2159] = { 0, 0, SEN(printargs), "bsd43_getdirentries" }, -[2160] = { 0, 0, SEN(printargs), "bsd43_statfs" }, -[2161] = { 0, 0, SEN(printargs), "bsd43_fstatfs" }, +[2160] = { 0, TF|TSF|TSFA,SEN(printargs), "bsd43_statfs" }, +[2161] = { 0, TD|TFSF|TSFA,SEN(printargs), "bsd43_fstatfs" }, [2162] = { 0, 0, SEN(printargs), "bsd43_unmount" }, [2163] = { 0, 0, SEN(printargs), "bsd43_async_daemon" }, [2164] = { 0, 0, SEN(printargs), "bsd43_nfs_getfh" }, @@ -545,7 +552,7 @@ [3015] = { 0, 0, SEN(printargs), "posix_chmod" }, [3016] = { 0, 0, SEN(printargs), "posix_chown" }, [3017] = { 0, TM, SEN(printargs), "posix_sbreak" }, -[3018] = { 0, 0, SEN(printargs), "posix_stat" }, +[3018] = { 0, TF|TST|TSTA,SEN(printargs), "posix_stat" }, [3019] = { 0, 0, SEN(printargs), "posix_lseek" }, [3020] = { 0, 0, SEN(printargs), "posix_getpid" }, [3021] = { 0, 0, SEN(printargs), "posix_mount" }, @@ -555,17 +562,17 @@ [3025] = { 0, 0, SEN(printargs), "posix_stime" }, [3026] = { 0, 0, SEN(printargs), "posix_ptrace" }, [3027] = { 0, 0, SEN(printargs), "posix_alarm" }, -[3028] = { 0, 0, SEN(printargs), "posix_fstat" }, +[3028] = { 0, TD|TFST|TSTA,SEN(printargs), "posix_fstat" }, [3029] = { 0, 0, SEN(printargs), "posix_pause" }, [3030] = { 0, 0, SEN(printargs), "posix_utime" }, [3031] = { 0, 0, SEN(printargs), "posix_stty" }, [3032] = { 0, 0, SEN(printargs), "posix_gtty" }, [3033] = { 0, 0, SEN(printargs), "posix_access" }, [3034] = { 0, 0, SEN(printargs), "posix_nice" }, -[3035] = { 0, 0, SEN(printargs), "posix_statfs" }, +[3035] = { 0, TF|TSF|TSFA,SEN(printargs), "posix_statfs" }, [3036] = { 0, 0, SEN(printargs), "posix_sync" }, [3037] = { 0, 0, SEN(printargs), "posix_kill" }, -[3038] = { 0, 0, SEN(printargs), "posix_fstatfs" }, +[3038] = { 0, TD|TFSF|TSFA,SEN(printargs), "posix_fstatfs" }, [3039] = { 0, 0, SEN(printargs), "posix_getpgrp" }, [3040] = { 0, 0, SEN(printargs), "posix_syssgi" }, [3041] = { 0, 0, SEN(printargs), "posix_dup" }, @@ -639,7 +646,7 @@ [3114] = { 0, 0, SEN(printargs), "posix_rename" }, [3115] = { 0, 0, SEN(printargs), "posix_symlink" }, [3116] = { 0, 0, SEN(printargs), "posix_readlink" }, -[3117] = { 0, 0, SEN(printargs), "posix_lstat" }, +[3117] = { 0, TF|TLST|TSTA,SEN(printargs), "posix_lstat" }, [3118] = { 0, 0, SEN(printargs), "posix_nfs_mount" }, [3119] = { 0, 0, SEN(printargs), "posix_nfs_svc" }, [3120] = { 0, 0, SEN(printargs), "posix_nfs_getfh" }, diff --git a/linux/mips/syscallent-n32.h b/linux/mips/syscallent-n32.h index c93c33bd..16ec2a1b 100644 --- a/linux/mips/syscallent-n32.h +++ b/linux/mips/syscallent-n32.h @@ -1,13 +1,20 @@ +/* + * Copyright (c) 2013-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #if defined LINUX_MIPSN32 /* For an N32 strace decode the N32 64-bit syscalls. */ [6000] = { 3, TD, SEN(read), "read" }, /* start of Linux N32 */ [6001] = { 3, TD, SEN(write), "write" }, [6002] = { 3, TD|TF, SEN(open), "open" }, [6003] = { 1, TD, SEN(close), "close" }, -[6004] = { 2, TF, SEN(stat64), "stat" }, -[6005] = { 2, TD, SEN(fstat64), "fstat" }, -[6006] = { 2, TF, SEN(lstat64), "lstat" }, -[6007] = { 3, TD, SEN(poll), "poll" }, +[6004] = { 2, TF|TST|TSTA, SEN(stat64), "stat" }, +[6005] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat" }, +[6006] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat" }, +[6007] = { 3, TD, SEN(poll_time32), "poll" }, [6008] = { 3, TD, SEN(lseek), "lseek" }, [6009] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, [6010] = { 3, TM|SI, SEN(mprotect), "mprotect" }, @@ -34,11 +41,11 @@ [6031] = { 1, TD, SEN(dup), "dup" }, [6032] = { 2, TD, SEN(dup2), "dup2" }, [6033] = { 0, TS, SEN(pause), "pause" }, -[6034] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[6034] = { 2, 0, SEN(nanosleep_time32), "nanosleep" }, [6035] = { 2, 0, SEN(getitimer), "getitimer" }, [6036] = { 3, 0, SEN(setitimer), "setitimer" }, [6037] = { 1, 0, SEN(alarm), "alarm" }, -[6038] = { 0, NF, SEN(getpid), "getpid" }, +[6038] = { 0, PU|NF, SEN(getpid), "getpid" }, [6039] = { 4, TD|TN, SEN(sendfile), "sendfile" }, [6040] = { 3, TN, SEN(socket), "socket" }, [6041] = { 3, TN, SEN(connect), "connect" }, @@ -100,16 +107,16 @@ [6097] = { 1, 0, SEN(sysinfo), "sysinfo" }, [6098] = { 1, 0, SEN(times), "times" }, [6099] = { 4, 0, SEN(ptrace), "ptrace" }, -[6100] = { 0, NF, SEN(getuid), "getuid" }, +[6100] = { 0, PU|NF, SEN(getuid), "getuid" }, [6101] = { 3, 0, SEN(syslog), "syslog" }, -[6102] = { 0, NF, SEN(getgid), "getgid" }, +[6102] = { 0, PU|NF, SEN(getgid), "getgid" }, [6103] = { 1, 0, SEN(setuid), "setuid" }, [6104] = { 1, 0, SEN(setgid), "setgid" }, -[6105] = { 0, NF, SEN(geteuid), "geteuid" }, -[6106] = { 0, NF, SEN(getegid), "getegid" }, +[6105] = { 0, PU|NF, SEN(geteuid), "geteuid" }, +[6106] = { 0, PU|NF, SEN(getegid), "getegid" }, [6107] = { 2, 0, SEN(setpgid), "setpgid" }, -[6108] = { 0, NF, SEN(getppid), "getppid" }, -[6109] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[6108] = { 0, PU|NF, SEN(getppid), "getppid" }, +[6109] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, [6110] = { 0, 0, SEN(setsid), "setsid" }, [6111] = { 2, 0, SEN(setreuid), "setreuid" }, [6112] = { 2, 0, SEN(setregid), "setregid" }, @@ -126,16 +133,16 @@ [6123] = { 2, 0, SEN(capget), "capget" }, [6124] = { 2, 0, SEN(capset), "capset" }, [6125] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[6126] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[6126] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" }, [6127] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, [6128] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, [6129] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, [6130] = { 2, TF, SEN(utime), "utime" }, [6131] = { 3, TF, SEN(mknod), "mknod" }, [6132] = { 1, NF, SEN(personality), "personality" }, -[6133] = { 2, 0, SEN(ustat), "ustat" }, -[6134] = { 2, TF, SEN(statfs), "statfs" }, -[6135] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[6133] = { 2, TSFA, SEN(ustat), "ustat" }, +[6134] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[6135] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, [6136] = { 3, 0, SEN(sysfs), "sysfs" }, [6137] = { 2, 0, SEN(getpriority), "getpriority" }, [6138] = { 3, 0, SEN(setpriority), "setpriority" }, @@ -145,7 +152,7 @@ [6142] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, [6143] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [6144] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[6145] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[6145] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"}, [6146] = { 2, TM, SEN(mlock), "mlock" }, [6147] = { 2, TM, SEN(munlock), "munlock" }, [6148] = { 1, TM, SEN(mlockall), "mlockall" }, @@ -154,7 +161,7 @@ [6151] = { 2, TF, SEN(pivotroot), "pivot_root" }, [6152] = { 1, 0, SEN(sysctl), "_sysctl" }, [6153] = { 5, 0, SEN(prctl), "prctl" }, -[6154] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[6154] = { 1, 0, SEN(adjtimex32), "adjtimex" }, [6155] = { 2, 0, SEN(setrlimit), "setrlimit" }, [6156] = { 1, TF, SEN(chroot), "chroot" }, [6157] = { 0, 0, SEN(sync), "sync" }, @@ -178,7 +185,7 @@ [6175] = { 5, TN, SEN(putpmsg), "putpmsg" }, [6176] = { 0, 0, SEN(afs_syscall), "afs_syscall" }, [6177] = { 0, 0, SEN(printargs), "reserved177" }, -[6178] = { 0, NF, SEN(gettid), "gettid" }, +[6178] = { 0, PU|NF, SEN(gettid), "gettid" }, [6179] = { 3, TD, SEN(readahead), "readahead" }, [6180] = { 5, TF, SEN(setxattr), "setxattr" }, [6181] = { 5, TF, SEN(setxattr), "lsetxattr" }, @@ -194,7 +201,7 @@ [6191] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [6192] = { 2, TS, SEN(kill), "tkill" }, [6193] = { 1, 0, SEN(time), "time" }, -[6194] = { 6, 0, SEN(futex), "futex" }, +[6194] = { 6, 0, SEN(futex_time32), "futex" }, [6195] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [6196] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [6197] = { 3, 0, SEN(printargs), "cacheflush" }, @@ -202,7 +209,7 @@ [6199] = { 4, 0, SEN(sysmips), "sysmips" }, [6200] = { 2, TM, SEN(io_setup), "io_setup" }, [6201] = { 1, TM, SEN(io_destroy), "io_destroy" }, -[6202] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[6202] = { 5, 0, SEN(io_getevents_time32), "io_getevents" }, [6203] = { 3, 0, SEN(io_submit), "io_submit" }, [6204] = { 3, 0, SEN(io_cancel), "io_cancel" }, [6205] = { 1, TP|SE, SEN(exit), "exit_group" }, @@ -215,31 +222,31 @@ [6212] = { 3, TD, SEN(fcntl64), "fcntl64" }, [6213] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [6214] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, -[6215] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[6215] = { 4, TI, SEN(semtimedop_time32), "semtimedop" }, [6216] = { 4, TD, SEN(fadvise64_64), "fadvise64" }, -[6217] = { 3, TF, SEN(statfs64), "statfs64" }, -[6218] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[6217] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, +[6218] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, [6219] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, [6220] = { 3, 0, SEN(timer_create), "timer_create" }, -[6221] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[6222] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[6221] = { 4, 0, SEN(timer_settime32), "timer_settime" }, +[6222] = { 2, 0, SEN(timer_gettime32), "timer_gettime" }, [6223] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, [6224] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[6225] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[6226] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[6227] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[6228] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[6225] = { 2, 0, SEN(clock_settime32), "clock_settime" }, +[6226] = { 2, 0, SEN(clock_gettime32), "clock_gettime" }, +[6227] = { 2, 0, SEN(clock_getres_time32), "clock_getres" }, +[6228] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" }, [6229] = { 3, TS, SEN(tgkill), "tgkill" }, [6230] = { 2, TF, SEN(utimes), "utimes" }, [6231] = { 6, TM, SEN(mbind), "mbind" }, [6232] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, [6233] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, -[6234] = { 4, 0, SEN(mq_open), "mq_open" }, +[6234] = { 4, TD, SEN(mq_open), "mq_open" }, [6235] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[6236] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[6237] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[6238] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[6239] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[6236] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" }, +[6237] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" }, +[6238] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[6239] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, [6240] = { 5, 0, SEN(vserver), "vserver" }, [6241] = { 5, TP, SEN(waitid), "waitid" }, [6242] = { }, @@ -248,7 +255,7 @@ [6245] = { 5, 0, SEN(keyctl), "keyctl" }, [6246] = { 1, 0, SEN(set_thread_area), "set_thread_area" }, [6247] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[6248] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[6248] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, [6249] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, [6250] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, [6251] = { 4, TD|TF, SEN(openat), "openat" }, @@ -256,7 +263,7 @@ [6253] = { 4, TD|TF, SEN(mknodat), "mknodat" }, [6254] = { 5, TD|TF, SEN(fchownat), "fchownat" }, [6255] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[6256] = { 4, TD|TF, SEN(newfstatat), "newfstatat" }, +[6256] = { 4, TD|TF|TFST|TSTA,SEN(newfstatat), "newfstatat" }, [6257] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, [6258] = { 4, TD|TF, SEN(renameat), "renameat" }, [6259] = { 5, TD|TF, SEN(linkat), "linkat" }, @@ -264,8 +271,8 @@ [6261] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, [6262] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, [6263] = { 3, TD|TF, SEN(faccessat), "faccessat" }, -[6264] = { 6, TD, SEN(pselect6), "pselect6" }, -[6265] = { 5, TD, SEN(ppoll), "ppoll" }, +[6264] = { 6, TD, SEN(pselect6_time32), "pselect6" }, +[6265] = { 5, TD, SEN(ppoll_time32), "ppoll" }, [6266] = { 1, TP, SEN(unshare), "unshare" }, [6267] = { 6, TD, SEN(splice), "splice" }, [6268] = { 4, TD, SEN(sync_file_range), "sync_file_range" }, @@ -279,14 +286,14 @@ [6276] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, [6277] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, [6278] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, -[6279] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[6279] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [6280] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [6281] = { 4, TD, SEN(timerfd), "timerfd" }, [6282] = { 1, TD, SEN(eventfd), "eventfd" }, [6283] = { 4, TD, SEN(fallocate), "fallocate" }, [6284] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, -[6285] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, -[6286] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[6285] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" }, +[6286] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" }, [6287] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, [6288] = { 2, TD, SEN(eventfd2), "eventfd2" }, [6289] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, @@ -298,14 +305,14 @@ [6295] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, [6296] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, [6297] = { 4, TN, SEN(accept4), "accept4" }, -[6298] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[6298] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" }, [6299] = { 3, TD, SEN(getdents64), "getdents64" }, [6300] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, [6301] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, [6302] = { 4, 0, SEN(prlimit64), "prlimit64" }, [6303] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, [6304] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[6305] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[6305] = { 2, 0, SEN(clock_adjtime32), "clock_adjtime" }, [6306] = { 1, TD, SEN(syncfs), "syncfs" }, [6307] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, [6308] = { 2, TD, SEN(setns), "setns" }, @@ -330,9 +337,37 @@ [6327] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, [6328] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, [6329] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[6330] = { 5, TD|TF|TSTA, SEN(statx), "statx" }, +[6331] = { 4, 0, SEN(rseq), "rseq" }, +[6332] = { 6, 0, SEN(io_pgetevents_time32), "io_pgetevents" }, +/* [6333 ... 6402] - reserved to sync up with other architectures */ +[6403] = { 2, 0, SEN(clock_gettime64), "clock_gettime64" }, +[6404] = { 2, 0, SEN(clock_settime64), "clock_settime64" }, +[6405] = { 2, 0, SEN(clock_adjtime64), "clock_adjtime64" }, +[6406] = { 2, 0, SEN(clock_getres_time64), "clock_getres_time64" }, +[6407] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep_time64"}, +[6408] = { 2, 0, SEN(timer_gettime64), "timer_gettime64" }, +[6409] = { 4, 0, SEN(timer_settime64), "timer_settime64" }, +[6410] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime64" }, +[6411] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime64" }, +[6412] = { 4, TD|TF, SEN(utimensat_time64), "utimensat_time64" }, +[6413] = { 6, TD, SEN(pselect6_time64), "pselect6_time64" }, +[6414] = { 5, TD, SEN(ppoll_time64), "ppoll_time64" }, +[6416] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents_time64" }, +[6417] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg_time64" }, +[6418] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend_time64" }, +[6419] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive_time64"}, +[6420] = { 4, TI, SEN(semtimedop_time64), "semtimedop_time64" }, +[6421] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait_time64"}, +[6422] = { 6, 0, SEN(futex_time64), "futex_time64" }, +[6423] = { 2, 0, SEN(sched_rr_get_interval_time64), "sched_rr_get_interval_time64" }, +[6424] = { 4, TD|TS, SEN(pidfd_send_signal), "pidfd_send_signal" }, +[6425] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" }, +[6426] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" }, +[6427] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" }, -# define SYS_socket_subcall 6400 -# include "subcall.h" +# define SYS_socket_subcall 6500 +# include "subcall32.h" #else diff --git a/linux/mips/syscallent-n64.h b/linux/mips/syscallent-n64.h index f14eebfa..15db301e 100644 --- a/linux/mips/syscallent-n64.h +++ b/linux/mips/syscallent-n64.h @@ -1,13 +1,20 @@ +/* + * Copyright (c) 2013-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #if defined LINUX_MIPSN64 /* For an N64 strace decode the N64 64-bit syscalls. */ [5000] = { 3, TD, SEN(read), "read" }, /* start of Linux N64 */ [5001] = { 3, TD, SEN(write), "write" }, [5002] = { 3, TD|TF, SEN(open), "open" }, [5003] = { 1, TD, SEN(close), "close" }, -[5004] = { 2, TF, SEN(stat), "stat" }, -[5005] = { 2, TD, SEN(fstat), "fstat" }, -[5006] = { 2, TF, SEN(lstat), "lstat" }, -[5007] = { 3, TD, SEN(poll), "poll" }, +[5004] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, +[5005] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, +[5006] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, +[5007] = { 3, TD, SEN(poll_time64), "poll" }, [5008] = { 3, TD, SEN(lseek), "lseek" }, [5009] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, [5010] = { 3, TM|SI, SEN(mprotect), "mprotect" }, @@ -34,11 +41,11 @@ [5031] = { 1, TD, SEN(dup), "dup" }, [5032] = { 2, TD, SEN(dup2), "dup2" }, [5033] = { 0, TS, SEN(pause), "pause" }, -[5034] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[5034] = { 2, 0, SEN(nanosleep_time64), "nanosleep" }, [5035] = { 2, 0, SEN(getitimer), "getitimer" }, [5036] = { 3, 0, SEN(setitimer), "setitimer" }, [5037] = { 1, 0, SEN(alarm), "alarm" }, -[5038] = { 0, NF, SEN(getpid), "getpid" }, +[5038] = { 0, PU|NF, SEN(getpid), "getpid" }, [5039] = { 4, TD|TN, SEN(sendfile), "sendfile" }, [5040] = { 3, TN, SEN(socket), "socket" }, [5041] = { 3, TN, SEN(connect), "connect" }, @@ -100,16 +107,16 @@ [5097] = { 1, 0, SEN(sysinfo), "sysinfo" }, [5098] = { 1, 0, SEN(times), "times" }, [5099] = { 4, 0, SEN(ptrace), "ptrace" }, -[5100] = { 0, NF, SEN(getuid), "getuid" }, +[5100] = { 0, PU|NF, SEN(getuid), "getuid" }, [5101] = { 3, 0, SEN(syslog), "syslog" }, -[5102] = { 0, NF, SEN(getgid), "getgid" }, +[5102] = { 0, PU|NF, SEN(getgid), "getgid" }, [5103] = { 1, 0, SEN(setuid), "setuid" }, [5104] = { 1, 0, SEN(setgid), "setgid" }, -[5105] = { 0, NF, SEN(geteuid), "geteuid" }, -[5106] = { 0, NF, SEN(getegid), "getegid" }, +[5105] = { 0, PU|NF, SEN(geteuid), "geteuid" }, +[5106] = { 0, PU|NF, SEN(getegid), "getegid" }, [5107] = { 2, 0, SEN(setpgid), "setpgid" }, -[5108] = { 0, NF, SEN(getppid), "getppid" }, -[5109] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[5108] = { 0, PU|NF, SEN(getppid), "getppid" }, +[5109] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, [5110] = { 0, 0, SEN(setsid), "setsid" }, [5111] = { 2, 0, SEN(setreuid), "setreuid" }, [5112] = { 2, 0, SEN(setregid), "setregid" }, @@ -126,16 +133,16 @@ [5123] = { 2, 0, SEN(capget), "capget" }, [5124] = { 2, 0, SEN(capset), "capset" }, [5125] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[5126] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[5126] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait" }, [5127] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, [5128] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, [5129] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, [5130] = { 2, TF, SEN(utime), "utime" }, [5131] = { 3, TF, SEN(mknod), "mknod" }, [5132] = { 1, NF, SEN(personality), "personality" }, -[5133] = { 2, 0, SEN(ustat), "ustat" }, -[5134] = { 2, TF, SEN(statfs), "statfs" }, -[5135] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[5133] = { 2, TSFA, SEN(ustat), "ustat" }, +[5134] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[5135] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, [5136] = { 3, 0, SEN(sysfs), "sysfs" }, [5137] = { 2, 0, SEN(getpriority), "getpriority" }, [5138] = { 3, 0, SEN(setpriority), "setpriority" }, @@ -145,7 +152,7 @@ [5142] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, [5143] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [5144] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[5145] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[5145] = { 2, 0, SEN(sched_rr_get_interval_time64),"sched_rr_get_interval"}, [5146] = { 2, TM, SEN(mlock), "mlock" }, [5147] = { 2, TM, SEN(munlock), "munlock" }, [5148] = { 1, TM, SEN(mlockall), "mlockall" }, @@ -154,7 +161,7 @@ [5151] = { 2, TF, SEN(pivotroot), "pivot_root" }, [5152] = { 1, 0, SEN(sysctl), "_sysctl" }, [5153] = { 5, 0, SEN(prctl), "prctl" }, -[5154] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[5154] = { 1, 0, SEN(adjtimex64), "adjtimex" }, [5155] = { 2, 0, SEN(setrlimit), "setrlimit" }, [5156] = { 1, TF, SEN(chroot), "chroot" }, [5157] = { 0, 0, SEN(sync), "sync" }, @@ -178,7 +185,7 @@ [5175] = { 5, TN, SEN(putpmsg), "putpmsg" }, [5176] = { 0, 0, SEN(afs_syscall), "afs_syscall" }, [5177] = { 0, 0, SEN(printargs), "reserved177" }, -[5178] = { 0, NF, SEN(gettid), "gettid" }, +[5178] = { 0, PU|NF, SEN(gettid), "gettid" }, [5179] = { 3, TD, SEN(readahead), "readahead" }, [5180] = { 5, TF, SEN(setxattr), "setxattr" }, [5181] = { 5, TF, SEN(setxattr), "lsetxattr" }, @@ -194,7 +201,7 @@ [5191] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [5192] = { 2, TS, SEN(kill), "tkill" }, [5193] = { 1, 0, SEN(time), "time" }, -[5194] = { 6, 0, SEN(futex), "futex" }, +[5194] = { 6, 0, SEN(futex_time64), "futex" }, [5195] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [5196] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [5197] = { 3, 0, SEN(printargs), "cacheflush" }, @@ -202,7 +209,7 @@ [5199] = { 4, 0, SEN(sysmips), "sysmips" }, [5200] = { 2, TM, SEN(io_setup), "io_setup" }, [5201] = { 1, TM, SEN(io_destroy), "io_destroy" }, -[5202] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[5202] = { 5, 0, SEN(io_getevents_time64), "io_getevents" }, [5203] = { 3, 0, SEN(io_submit), "io_submit" }, [5204] = { 3, 0, SEN(io_cancel), "io_cancel" }, [5205] = { 1, TP|SE, SEN(exit), "exit_group" }, @@ -214,28 +221,28 @@ [5211] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, [5212] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [5213] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, -[5214] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[5214] = { 4, TI, SEN(semtimedop_time64), "semtimedop" }, [5215] = { 4, TD, SEN(fadvise64), "fadvise64" }, [5216] = { 3, 0, SEN(timer_create), "timer_create" }, -[5217] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[5218] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[5217] = { 4, 0, SEN(timer_settime64), "timer_settime" }, +[5218] = { 2, 0, SEN(timer_gettime64), "timer_gettime" }, [5219] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, [5220] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[5221] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[5222] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[5223] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[5224] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[5221] = { 2, 0, SEN(clock_settime64), "clock_settime" }, +[5222] = { 2, 0, SEN(clock_gettime64), "clock_gettime" }, +[5223] = { 2, 0, SEN(clock_getres_time64), "clock_getres" }, +[5224] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep" }, [5225] = { 3, TS, SEN(tgkill), "tgkill" }, [5226] = { 2, TF, SEN(utimes), "utimes" }, [5227] = { 6, TM, SEN(mbind), "mbind" }, [5228] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, [5229] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, -[5230] = { 4, 0, SEN(mq_open), "mq_open" }, +[5230] = { 4, TD, SEN(mq_open), "mq_open" }, [5231] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[5232] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[5233] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[5234] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[5235] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[5232] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend" }, +[5233] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive" }, +[5234] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[5235] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, [5236] = { 5, 0, SEN(vserver), "vserver" }, [5237] = { 5, TP, SEN(waitid), "waitid" }, [5238] = { }, @@ -244,7 +251,7 @@ [5241] = { 5, 0, SEN(keyctl), "keyctl" }, [5242] = { 1, 0, SEN(set_thread_area), "set_thread_area" }, [5243] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[5244] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[5244] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, [5245] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, [5246] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, [5247] = { 4, TD|TF, SEN(openat), "openat" }, @@ -252,7 +259,7 @@ [5249] = { 4, TD|TF, SEN(mknodat), "mknodat" }, [5250] = { 5, TD|TF, SEN(fchownat), "fchownat" }, [5251] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[5252] = { 4, TD|TF, SEN(newfstatat), "newfstatat" }, +[5252] = { 4, TD|TF|TFST|TSTA,SEN(newfstatat), "newfstatat" }, [5253] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, [5254] = { 4, TD|TF, SEN(renameat), "renameat" }, [5255] = { 5, TD|TF, SEN(linkat), "linkat" }, @@ -260,8 +267,8 @@ [5257] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, [5258] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, [5259] = { 3, TD|TF, SEN(faccessat), "faccessat" }, -[5260] = { 6, TD, SEN(pselect6), "pselect6" }, -[5261] = { 5, TD, SEN(ppoll), "ppoll" }, +[5260] = { 6, TD, SEN(pselect6_time64), "pselect6" }, +[5261] = { 5, TD, SEN(ppoll_time64), "ppoll" }, [5262] = { 1, TP, SEN(unshare), "unshare" }, [5263] = { 6, TD, SEN(splice), "splice" }, [5264] = { 4, TD, SEN(sync_file_range), "sync_file_range" }, @@ -275,14 +282,14 @@ [5272] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, [5273] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, [5274] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, -[5275] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[5275] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" }, [5276] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [5277] = { 4, TD, SEN(timerfd), "timerfd" }, [5278] = { 1, TD, SEN(eventfd), "eventfd" }, [5279] = { 4, TD, SEN(fallocate), "fallocate" }, [5280] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, -[5281] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, -[5282] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[5281] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime" }, +[5282] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime" }, [5283] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, [5284] = { 2, TD, SEN(eventfd2), "eventfd2" }, [5285] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, @@ -294,13 +301,13 @@ [5291] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, [5292] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, [5293] = { 4, TN, SEN(accept4), "accept4" }, -[5294] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[5294] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg" }, [5295] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, [5296] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, [5297] = { 4, 0, SEN(prlimit64), "prlimit64" }, [5298] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, [5299] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[5300] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[5300] = { 2, 0, SEN(clock_adjtime64), "clock_adjtime" }, [5301] = { 1, TD, SEN(syncfs), "syncfs" }, [5302] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, [5303] = { 2, TD, SEN(setns), "setns" }, @@ -326,9 +333,17 @@ [5323] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, [5324] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, [5325] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[5326] = { 5, TD|TF|TSTA, SEN(statx), "statx" }, +[5327] = { 4, 0, SEN(rseq), "rseq" }, +[5328] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents" }, +/* [5329 ... 5423] - reserved to sync up with other architectures */ +[5424] = { 4, TD|TS, SEN(pidfd_send_signal), "pidfd_send_signal" }, +[5425] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" }, +[5426] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" }, +[5427] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" }, -# define SYS_socket_subcall 5400 -# include "subcall.h" +# define SYS_socket_subcall 5500 +# include "subcall64.h" #else diff --git a/linux/mips/syscallent-o32.h b/linux/mips/syscallent-o32.h index 780d3bc0..7fdc60f6 100644 --- a/linux/mips/syscallent-o32.h +++ b/linux/mips/syscallent-o32.h @@ -1,5 +1,13 @@ +/* + * Copyright (c) 2013-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #if defined LINUX_MIPSO32 /* For an O32 strace, decode the o32 syscalls. */ +# define SYS_syscall_subcall 4000 [4000] = { MA, 0, SEN(syscall), "syscall" }, /* start of Linux o32 */ [4001] = { 1, TP|SE, SEN(exit), "exit" }, [4002] = { 0, TP, SEN(fork), "fork" }, @@ -18,17 +26,17 @@ [4015] = { 2, TF, SEN(chmod), "chmod" }, [4016] = { 3, TF, SEN(chown), "lchown" }, [4017] = { 0, TM, SEN(break), "break" }, -[4018] = { 2, TF, SEN(oldstat), "oldstat" }, +[4018] = { 2, TF|TST|TSTA, SEN(oldstat), "oldstat" }, [4019] = { 3, TD, SEN(lseek), "lseek" }, -[4020] = { 0, NF, SEN(getpid), "getpid" }, +[4020] = { 0, PU|NF, SEN(getpid), "getpid" }, [4021] = { 5, TF, SEN(mount), "mount" }, [4022] = { 1, TF, SEN(umount), "umount" }, [4023] = { 1, 0, SEN(setuid), "setuid" }, -[4024] = { 0, NF, SEN(getuid), "getuid" }, +[4024] = { 0, PU|NF, SEN(getuid), "getuid" }, [4025] = { 1, 0, SEN(stime), "stime" }, [4026] = { 4, 0, SEN(ptrace), "ptrace" }, [4027] = { 1, 0, SEN(alarm), "alarm" }, -[4028] = { 2, TD, SEN(oldfstat), "oldfstat" }, +[4028] = { 2, TD|TFST|TSTA, SEN(oldfstat), "oldfstat" }, [4029] = { 0, TS, SEN(pause), "pause" }, [4030] = { 2, TF, SEN(utime), "utime" }, [4031] = { 0, 0, SEN(stty), "stty" }, @@ -47,10 +55,10 @@ [4044] = { 0, 0, SEN(prof), "prof" }, [4045] = { 1, TM|SI, SEN(brk), "brk" }, [4046] = { 1, 0, SEN(setgid), "setgid" }, -[4047] = { 0, NF, SEN(getgid), "getgid" }, +[4047] = { 0, PU|NF, SEN(getgid), "getgid" }, [4048] = { 2, TS, SEN(signal), "signal" }, -[4049] = { 0, NF, SEN(geteuid), "geteuid" }, -[4050] = { 0, NF, SEN(getegid), "getegid" }, +[4049] = { 0, PU|NF, SEN(geteuid), "geteuid" }, +[4050] = { 0, PU|NF, SEN(getegid), "getegid" }, [4051] = { 1, TF, SEN(acct), "acct" }, [4052] = { 2, TF, SEN(umount2), "umount2" }, [4053] = { 0, 0, SEN(lock), "lock" }, @@ -62,17 +70,17 @@ [4059] = { 1, 0, SEN(oldolduname), "oldolduname" }, [4060] = { 1, NF, SEN(umask), "umask" }, [4061] = { 1, TF, SEN(chroot), "chroot" }, -[4062] = { 2, 0, SEN(ustat), "ustat" }, +[4062] = { 2, TSFA, SEN(ustat), "ustat" }, [4063] = { 2, TD, SEN(dup2), "dup2" }, -[4064] = { 0, NF, SEN(getppid), "getppid" }, -[4065] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[4064] = { 0, PU|NF, SEN(getppid), "getppid" }, +[4065] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, [4066] = { 0, 0, SEN(setsid), "setsid" }, [4067] = { 3, TS, SEN(sigaction), "sigaction" }, -[4068] = { 0, TS, SEN(siggetmask), "sgetmask" }, -[4069] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[4068] = { 0, TS, SEN(sgetmask), "sgetmask" }, +[4069] = { 1, TS, SEN(ssetmask), "ssetmask" }, [4070] = { 2, 0, SEN(setreuid), "setreuid" }, [4071] = { 2, 0, SEN(setregid), "setregid" }, -[4072] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, +[4072] = { 1, TS, SEN(sigsuspend), "sigsuspend" }, [4073] = { 1, TS, SEN(sigpending), "sigpending" }, [4074] = { 2, 0, SEN(sethostname), "sethostname" }, [4075] = { 2, 0, SEN(setrlimit), "setrlimit" }, @@ -84,7 +92,7 @@ [4081] = { 2, 0, SEN(setgroups), "setgroups" }, [4082] = { 0, 0, SEN(printargs), "reserved82" }, [4083] = { 2, TF, SEN(symlink), "symlink" }, -[4084] = { 2, TF, SEN(oldlstat), "oldlstat" }, +[4084] = { 2, TF|TLST|TSTA, SEN(oldlstat), "oldlstat" }, [4085] = { 3, TF, SEN(readlink), "readlink" }, [4086] = { 1, TF, SEN(uselib), "uselib" }, [4087] = { 2, TF, SEN(swapon), "swapon" }, @@ -99,16 +107,16 @@ [4096] = { 2, 0, SEN(getpriority), "getpriority" }, [4097] = { 3, 0, SEN(setpriority), "setpriority" }, [4098] = { 0, 0, SEN(profil), "profil" }, -[4099] = { 2, TF, SEN(statfs), "statfs" }, -[4100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[4099] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[4100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, [4101] = { 3, 0, SEN(ioperm), "ioperm" }, [4102] = { 2, TD, SEN(socketcall), "socketcall" }, [4103] = { 3, 0, SEN(syslog), "syslog" }, [4104] = { 3, 0, SEN(setitimer), "setitimer" }, [4105] = { 2, 0, SEN(getitimer), "getitimer" }, -[4106] = { 2, TF, SEN(stat), "stat" }, -[4107] = { 2, TF, SEN(lstat), "lstat" }, -[4108] = { 2, TD, SEN(fstat), "fstat" }, +[4106] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, +[4107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, +[4108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, [4109] = { 1, 0, SEN(olduname), "olduname" }, [4110] = { 1, 0, SEN(iopl), "iopl" }, [4111] = { 0, 0, SEN(vhangup), "vhangup" }, @@ -124,7 +132,7 @@ [4121] = { 2, 0, SEN(setdomainname), "setdomainname" }, [4122] = { 1, 0, SEN(uname), "uname" }, [4123] = { 0, 0, SEN(modify_ldt), "modify_ldt" }, -[4124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[4124] = { 1, 0, SEN(adjtimex32), "adjtimex" }, [4125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, [4126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, [4127] = { 2, 0, SEN(create_module), "create_module" }, @@ -165,8 +173,8 @@ [4162] = { 0, 0, SEN(sched_yield), "sched_yield" }, [4163] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [4164] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[4165] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, -[4166] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[4165] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"}, +[4166] = { 2, 0, SEN(nanosleep_time32), "nanosleep" }, [4167] = { 5, TM|SI, SEN(mremap), "mremap" }, [4168] = { 3, TN, SEN(accept), "accept" }, [4169] = { 3, TN, SEN(bind), "bind" }, @@ -188,7 +196,7 @@ [4185] = { 3, 0, SEN(setresuid), "setresuid" }, [4186] = { 3, 0, SEN(getresuid), "getresuid" }, [4187] = { 5, 0, SEN(query_module), "query_module" }, -[4188] = { 3, TD, SEN(poll), "poll" }, +[4188] = { 3, TD, SEN(poll_time32), "poll" }, [4189] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, [4190] = { 3, 0, SEN(setresgid), "setresgid" }, [4191] = { 3, 0, SEN(getresgid), "getresgid" }, @@ -197,7 +205,7 @@ [4194] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, [4195] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, [4196] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[4197] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[4197] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" }, [4198] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, [4199] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, [4200] = { 6, TD, SEN(pread), "pread64" }, @@ -213,16 +221,16 @@ [4210] = { 6, TD|TM|SI, SEN(mmap_4koff), "mmap2" }, [4211] = { 4, TF, SEN(truncate64), "truncate64" }, [4212] = { 4, TD, SEN(ftruncate64), "ftruncate64" }, -[4213] = { 2, TF, SEN(stat64), "stat64" }, -[4214] = { 2, TF, SEN(lstat64), "lstat64" }, -[4215] = { 2, TD, SEN(fstat64), "fstat64" }, +[4213] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" }, +[4214] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" }, +[4215] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" }, [4216] = { 2, TF, SEN(pivotroot), "pivot_root" }, [4217] = { 3, TM, SEN(mincore), "mincore" }, [4218] = { 3, TM, SEN(madvise), "madvise" }, [4219] = { 3, TD, SEN(getdents64), "getdents64" }, [4220] = { 3, TD, SEN(fcntl64), "fcntl64" }, -[4221] = { }, -[4222] = { 0, NF, SEN(gettid), "gettid" }, +[4221] = { 0, 0, SEN(printargs), "reserved221" }, +[4222] = { 0, PU|NF, SEN(gettid), "gettid" }, [4223] = { 5, TD, SEN(readahead), "readahead" }, [4224] = { 5, TF, SEN(setxattr), "setxattr" }, [4225] = { 5, TF, SEN(setxattr), "lsetxattr" }, @@ -238,12 +246,12 @@ [4235] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [4236] = { 2, TS, SEN(kill), "tkill" }, [4237] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, -[4238] = { 6, 0, SEN(futex), "futex" }, +[4238] = { 6, 0, SEN(futex_time32), "futex" }, [4239] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [4240] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [4241] = { 2, TM, SEN(io_setup), "io_setup" }, [4242] = { 1, TM, SEN(io_destroy), "io_destroy" }, -[4243] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[4243] = { 5, 0, SEN(io_getevents_time32), "io_getevents" }, [4244] = { 3, 0, SEN(io_submit), "io_submit" }, [4245] = { 3, 0, SEN(io_cancel), "io_cancel" }, [4246] = { 1, TP|SE, SEN(exit), "exit_group" }, @@ -255,28 +263,28 @@ [4252] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [4253] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, [4254] = { 7, TD, SEN(fadvise64_64), "fadvise64" }, -[4255] = { 3, TF, SEN(statfs64), "statfs64" }, -[4256] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[4255] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, +[4256] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, [4257] = { 3, 0, SEN(timer_create), "timer_create" }, -[4258] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[4259] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[4258] = { 4, 0, SEN(timer_settime32), "timer_settime" }, +[4259] = { 2, 0, SEN(timer_gettime32), "timer_gettime" }, [4260] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, [4261] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[4262] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[4263] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[4264] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[4265] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[4262] = { 2, 0, SEN(clock_settime32), "clock_settime" }, +[4263] = { 2, 0, SEN(clock_gettime32), "clock_gettime" }, +[4264] = { 2, 0, SEN(clock_getres_time32), "clock_getres" }, +[4265] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" }, [4266] = { 3, TS, SEN(tgkill), "tgkill" }, [4267] = { 2, TF, SEN(utimes), "utimes" }, [4268] = { 6, TM, SEN(mbind), "mbind" }, [4269] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, [4270] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, -[4271] = { 4, 0, SEN(mq_open), "mq_open" }, +[4271] = { 4, TD, SEN(mq_open), "mq_open" }, [4272] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[4273] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[4274] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[4275] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[4276] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[4273] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" }, +[4274] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" }, +[4275] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[4276] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, [4277] = { 5, 0, SEN(vserver), "vserver" }, [4278] = { 5, TP, SEN(waitid), "waitid" }, [4279] = { }, @@ -285,7 +293,7 @@ [4282] = { 5, 0, SEN(keyctl), "keyctl" }, [4283] = { 1, 0, SEN(set_thread_area), "set_thread_area" }, [4284] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[4285] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[4285] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, [4286] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, [4287] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, [4288] = { 4, TD|TF, SEN(openat), "openat" }, @@ -293,7 +301,7 @@ [4290] = { 4, TD|TF, SEN(mknodat), "mknodat" }, [4291] = { 5, TD|TF, SEN(fchownat), "fchownat" }, [4292] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[4293] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[4293] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" }, [4294] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, [4295] = { 4, TD|TF, SEN(renameat), "renameat" }, [4296] = { 5, TD|TF, SEN(linkat), "linkat" }, @@ -301,8 +309,8 @@ [4298] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, [4299] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, [4300] = { 3, TD|TF, SEN(faccessat), "faccessat" }, -[4301] = { 6, TD, SEN(pselect6), "pselect6" }, -[4302] = { 5, TD, SEN(ppoll), "ppoll" }, +[4301] = { 6, TD, SEN(pselect6_time32), "pselect6" }, +[4302] = { 5, TD, SEN(ppoll_time32), "ppoll" }, [4303] = { 1, TP, SEN(unshare), "unshare" }, [4304] = { 6, TD, SEN(splice), "splice" }, [4305] = { 7, TD, SEN(sync_file_range), "sync_file_range" }, @@ -316,14 +324,14 @@ [4313] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, [4314] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, [4315] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, -[4316] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[4316] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [4317] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [4318] = { 4, TD, SEN(timerfd), "timerfd" }, [4319] = { 1, TD, SEN(eventfd), "eventfd" }, [4320] = { 6, TD, SEN(fallocate), "fallocate" }, [4321] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, -[4322] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, -[4323] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, +[4322] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" }, +[4323] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" }, [4324] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, [4325] = { 2, TD, SEN(eventfd2), "eventfd2" }, [4326] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, @@ -335,13 +343,13 @@ [4332] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, [4333] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, [4334] = { 4, TN, SEN(accept4), "accept4" }, -[4335] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[4335] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" }, [4336] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, [4337] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, [4338] = { 4, 0, SEN(prlimit64), "prlimit64" }, [4339] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, [4340] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[4341] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[4341] = { 2, 0, SEN(clock_adjtime32), "clock_adjtime" }, [4342] = { 1, TD, SEN(syncfs), "syncfs" }, [4343] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, [4344] = { 2, TD, SEN(setns), "setns" }, @@ -366,9 +374,47 @@ [4363] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, [4364] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, [4365] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[4366] = { 5, TD|TF|TSTA, SEN(statx), "statx" }, +[4367] = { 4, 0, SEN(rseq), "rseq" }, +[4368] = { 6, 0, SEN(io_pgetevents_time32), "io_pgetevents" }, +/* room for arch specific calls */ +[4393] = { 3, TI, SEN(semget), "semget" }, +[4394] = { 4, TI, SEN(semctl), "semctl" }, +[4395] = { 3, TI, SEN(shmget), "shmget" }, +[4396] = { 3, TI, SEN(shmctl), "shmctl" }, +[4397] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[4398] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[4399] = { 2, TI, SEN(msgget), "msgget" }, +[4400] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[4401] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[4402] = { 3, TI, SEN(msgctl), "msgctl" }, +[4403] = { 2, 0, SEN(clock_gettime64), "clock_gettime64" }, +[4404] = { 2, 0, SEN(clock_settime64), "clock_settime64" }, +[4405] = { 2, 0, SEN(clock_adjtime64), "clock_adjtime64" }, +[4406] = { 2, 0, SEN(clock_getres_time64), "clock_getres_time64" }, +[4407] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep_time64"}, +[4408] = { 2, 0, SEN(timer_gettime64), "timer_gettime64" }, +[4409] = { 4, 0, SEN(timer_settime64), "timer_settime64" }, +[4410] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime64" }, +[4411] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime64" }, +[4412] = { 4, TD|TF, SEN(utimensat_time64), "utimensat_time64" }, +[4413] = { 6, TD, SEN(pselect6_time64), "pselect6_time64" }, +[4414] = { 5, TD, SEN(ppoll_time64), "ppoll_time64" }, +[4416] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents_time64" }, +[4417] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg_time64" }, +[4418] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend_time64" }, +[4419] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive_time64"}, +[4420] = { 4, TI, SEN(semtimedop_time64), "semtimedop_time64" }, +[4421] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait_time64"}, +[4422] = { 6, 0, SEN(futex_time64), "futex_time64" }, +[4423] = { 2, 0, SEN(sched_rr_get_interval_time64), "sched_rr_get_interval_time64" }, +[4424] = { 4, TD|TS, SEN(pidfd_send_signal), "pidfd_send_signal" }, +[4425] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" }, +[4426] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" }, +[4427] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" }, -# define SYS_socket_subcall 4400 -# include "subcall.h" +# define SYS_socket_subcall 4500 +# include "subcall32.h" #else diff --git a/linux/mips/userent.h b/linux/mips/userent.h index 1399142b..77cf50da 100644 --- a/linux/mips/userent.h +++ b/linux/mips/userent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + { 0, "r0" }, { 1, "r1" }, { 2, "r2" }, diff --git a/linux/mtd-abi.h b/linux/mtd-abi.h deleted file mode 100644 index b197861f..00000000 --- a/linux/mtd-abi.h +++ /dev/null @@ -1,278 +0,0 @@ -/* - * Copyright © 1999-2010 David Woodhouse et al. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - * - */ - -#ifndef __MTD_ABI_H__ -#define __MTD_ABI_H__ - -#include - -struct erase_info_user { - __u32 start; - __u32 length; -}; - -struct erase_info_user64 { - __u64 start; - __u64 length; -}; - -struct mtd_oob_buf { - __u32 start; - __u32 length; - unsigned char *ptr; -}; - -struct mtd_oob_buf64 { - __u64 start; - __u32 pad; - __u32 length; - __u64 usr_ptr; -}; - -/** - * MTD operation modes - * - * @MTD_OPS_PLACE_OOB: OOB data are placed at the given offset (default) - * @MTD_OPS_AUTO_OOB: OOB data are automatically placed at the free areas - * which are defined by the internal ecclayout - * @MTD_OPS_RAW: data are transferred as-is, with no error correction; - * this mode implies %MTD_OPS_PLACE_OOB - * - * These modes can be passed to ioctl(MEMWRITE) and are also used internally. - * See notes on "MTD file modes" for discussion on %MTD_OPS_RAW vs. - * %MTD_FILE_MODE_RAW. - */ -enum { - MTD_OPS_PLACE_OOB = 0, - MTD_OPS_AUTO_OOB = 1, - MTD_OPS_RAW = 2, -}; - -/** - * struct mtd_write_req - data structure for requesting a write operation - * - * @start: start address - * @len: length of data buffer - * @ooblen: length of OOB buffer - * @usr_data: user-provided data buffer - * @usr_oob: user-provided OOB buffer - * @mode: MTD mode (see "MTD operation modes") - * @padding: reserved, must be set to 0 - * - * This structure supports ioctl(MEMWRITE) operations, allowing data and/or OOB - * writes in various modes. To write to OOB-only, set @usr_data == NULL, and to - * write data-only, set @usr_oob == NULL. However, setting both @usr_data and - * @usr_oob to NULL is not allowed. - */ -struct mtd_write_req { - __u64 start; - __u64 len; - __u64 ooblen; - __u64 usr_data; - __u64 usr_oob; - __u8 mode; - __u8 padding[7]; -}; - -#define MTD_ABSENT 0 -#define MTD_RAM 1 -#define MTD_ROM 2 -#define MTD_NORFLASH 3 -#define MTD_NANDFLASH 4 -#define MTD_DATAFLASH 6 -#define MTD_UBIVOLUME 7 -#define MTD_MLCNANDFLASH 8 - -#define MTD_WRITEABLE 0x400 /* Device is writeable */ -#define MTD_BIT_WRITEABLE 0x800 /* Single bits can be flipped */ -#define MTD_NO_ERASE 0x1000 /* No erase necessary */ -#define MTD_POWERUP_LOCK 0x2000 /* Always locked after reset */ - -/* Some common devices / combinations of capabilities */ -#define MTD_CAP_ROM 0 -#define MTD_CAP_RAM (MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE) -#define MTD_CAP_NORFLASH (MTD_WRITEABLE | MTD_BIT_WRITEABLE) -#define MTD_CAP_NANDFLASH (MTD_WRITEABLE) - -/* Obsolete ECC byte placement modes (used with obsolete MEMGETOOBSEL) */ -#define MTD_NANDECC_OFF 0 // Switch off ECC (Not recommended) -#define MTD_NANDECC_PLACE 1 // Use the given placement in the structure (YAFFS1 legacy mode) -#define MTD_NANDECC_AUTOPLACE 2 // Use the default placement scheme -#define MTD_NANDECC_PLACEONLY 3 // Use the given placement in the structure (Do not store ecc result on read) -#define MTD_NANDECC_AUTOPL_USR 4 // Use the given autoplacement scheme rather than using the default - -/* OTP mode selection */ -#define MTD_OTP_OFF 0 -#define MTD_OTP_FACTORY 1 -#define MTD_OTP_USER 2 - -struct mtd_info_user { - __u8 type; - __u32 flags; - __u32 size; /* Total size of the MTD */ - __u32 erasesize; - __u32 writesize; - __u32 oobsize; /* Amount of OOB data per block (e.g. 16) */ - __u64 padding; /* Old obsolete field; do not use */ -}; - -struct region_info_user { - __u32 offset; /* At which this region starts, - * from the beginning of the MTD */ - __u32 erasesize; /* For this region */ - __u32 numblocks; /* Number of blocks in this region */ - __u32 regionindex; -}; - -struct otp_info { - __u32 start; - __u32 length; - __u32 locked; -}; - -/* - * Note, the following ioctl existed in the past and was removed: - * #define MEMSETOOBSEL _IOW('M', 9, struct nand_oobinfo) - * Try to avoid adding a new ioctl with the same ioctl number. - */ - -/* Get basic MTD characteristics info (better to use sysfs) */ -#define MEMGETINFO _IOR('M', 1, struct mtd_info_user) -/* Erase segment of MTD */ -#define MEMERASE _IOW('M', 2, struct erase_info_user) -/* Write out-of-band data from MTD */ -#define MEMWRITEOOB _IOWR('M', 3, struct mtd_oob_buf) -/* Read out-of-band data from MTD */ -#define MEMREADOOB _IOWR('M', 4, struct mtd_oob_buf) -/* Lock a chip (for MTD that supports it) */ -#define MEMLOCK _IOW('M', 5, struct erase_info_user) -/* Unlock a chip (for MTD that supports it) */ -#define MEMUNLOCK _IOW('M', 6, struct erase_info_user) -/* Get the number of different erase regions */ -#define MEMGETREGIONCOUNT _IOR('M', 7, int) -/* Get information about the erase region for a specific index */ -#define MEMGETREGIONINFO _IOWR('M', 8, struct region_info_user) -/* Get info about OOB modes (e.g., RAW, PLACE, AUTO) - legacy interface */ -#define MEMGETOOBSEL _IOR('M', 10, struct nand_oobinfo) -/* Check if an eraseblock is bad */ -#define MEMGETBADBLOCK _IOW('M', 11, __kernel_loff_t) -/* Mark an eraseblock as bad */ -#define MEMSETBADBLOCK _IOW('M', 12, __kernel_loff_t) -/* Set OTP (One-Time Programmable) mode (factory vs. user) */ -#define OTPSELECT _IOR('M', 13, int) -/* Get number of OTP (One-Time Programmable) regions */ -#define OTPGETREGIONCOUNT _IOW('M', 14, int) -/* Get all OTP (One-Time Programmable) info about MTD */ -#define OTPGETREGIONINFO _IOW('M', 15, struct otp_info) -/* Lock a given range of user data (must be in mode %MTD_FILE_MODE_OTP_USER) */ -#define OTPLOCK _IOR('M', 16, struct otp_info) -/* Get ECC layout (deprecated) */ -#define ECCGETLAYOUT _IOR('M', 17, struct nand_ecclayout_user) -/* Get statistics about corrected/uncorrected errors */ -#define ECCGETSTATS _IOR('M', 18, struct mtd_ecc_stats) -/* Set MTD mode on a per-file-descriptor basis (see "MTD file modes") */ -#define MTDFILEMODE _IO('M', 19) -/* Erase segment of MTD (supports 64-bit address) */ -#define MEMERASE64 _IOW('M', 20, struct erase_info_user64) -/* Write data to OOB (64-bit version) */ -#define MEMWRITEOOB64 _IOWR('M', 21, struct mtd_oob_buf64) -/* Read data from OOB (64-bit version) */ -#define MEMREADOOB64 _IOWR('M', 22, struct mtd_oob_buf64) -/* Check if chip is locked (for MTD that supports it) */ -#define MEMISLOCKED _IOR('M', 23, struct erase_info_user) -/* - * Most generic write interface; can write in-band and/or out-of-band in various - * modes (see "struct mtd_write_req"). This ioctl is not supported for flashes - * without OOB, e.g., NOR flash. - */ -#define MEMWRITE _IOWR('M', 24, struct mtd_write_req) - -/* - * Obsolete legacy interface. Keep it in order not to break userspace - * interfaces - */ -struct nand_oobinfo { - __u32 useecc; - __u32 eccbytes; - __u32 oobfree[8][2]; - __u32 eccpos[32]; -}; - -struct nand_oobfree { - __u32 offset; - __u32 length; -}; - -#define MTD_MAX_OOBFREE_ENTRIES 8 -#define MTD_MAX_ECCPOS_ENTRIES 64 -/* - * OBSOLETE: ECC layout control structure. Exported to user-space via ioctl - * ECCGETLAYOUT for backwards compatbility and should not be mistaken as a - * complete set of ECC information. The ioctl truncates the larger internal - * structure to retain binary compatibility with the static declaration of the - * ioctl. Note that the "MTD_MAX_..._ENTRIES" macros represent the max size of - * the user struct, not the MAX size of the internal struct nand_ecclayout. - */ -struct nand_ecclayout_user { - __u32 eccbytes; - __u32 eccpos[MTD_MAX_ECCPOS_ENTRIES]; - __u32 oobavail; - struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES]; -}; - -/** - * struct mtd_ecc_stats - error correction stats - * - * @corrected: number of corrected bits - * @failed: number of uncorrectable errors - * @badblocks: number of bad blocks in this partition - * @bbtblocks: number of blocks reserved for bad block tables - */ -struct mtd_ecc_stats { - __u32 corrected; - __u32 failed; - __u32 badblocks; - __u32 bbtblocks; -}; - -/* - * MTD file modes - for read/write access to MTD - * - * @MTD_FILE_MODE_NORMAL: OTP disabled, ECC enabled - * @MTD_FILE_MODE_OTP_FACTORY: OTP enabled in factory mode - * @MTD_FILE_MODE_OTP_USER: OTP enabled in user mode - * @MTD_FILE_MODE_RAW: OTP disabled, ECC disabled - * - * These modes can be set via ioctl(MTDFILEMODE). The mode mode will be retained - * separately for each open file descriptor. - * - * Note: %MTD_FILE_MODE_RAW provides the same functionality as %MTD_OPS_RAW - - * raw access to the flash, without error correction or autoplacement schemes. - * Wherever possible, the MTD_OPS_* mode will override the MTD_FILE_MODE_* mode - * (e.g., when using ioctl(MEMWRITE)), but in some cases, the MTD_FILE_MODE is - * used out of necessity (e.g., `write()', ioctl(MEMWRITEOOB64)). - */ -enum mtd_file_modes { - MTD_FILE_MODE_NORMAL = MTD_OTP_OFF, - MTD_FILE_MODE_OTP_FACTORY = MTD_OTP_FACTORY, - MTD_FILE_MODE_OTP_USER = MTD_OTP_USER, - MTD_FILE_MODE_RAW, -}; - -#endif /* __MTD_ABI_H__ */ diff --git a/linux/netlink_diag.h b/linux/netlink_diag.h index a52507c7..02ea3424 100644 --- a/linux/netlink_diag.h +++ b/linux/netlink_diag.h @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #ifndef STRACE_LINUX_NETLINK_DIAG_H -#define STRACE_LINUX_NETLINK_DIAG_H +# define STRACE_LINUX_NETLINK_DIAG_H struct netlink_diag_req { uint8_t sdiag_family; @@ -23,7 +30,33 @@ struct netlink_diag_msg { uint32_t ndiag_cookie[2]; }; -#define NDIAG_SHOW_MEMINFO 0x00000001 -#define NDIAG_PROTO_ALL ((uint8_t) ~0) +struct netlink_diag_ring { + uint32_t ndr_block_size; + uint32_t ndr_block_nr; + uint32_t ndr_frame_size; + uint32_t ndr_frame_nr; +}; + +enum { + NETLINK_DIAG_MEMINFO, + NETLINK_DIAG_GROUPS, + NETLINK_DIAG_RX_RING, + NETLINK_DIAG_TX_RING, + NETLINK_DIAG_FLAGS, +}; + +# define NDIAG_SHOW_MEMINFO 0x00000001 +# define NDIAG_SHOW_GROUPS 0x00000002 +# define NDIAG_SHOW_RING_CFG 0x00000004 /* deprecated since 4.6 */ +# define NDIAG_SHOW_FLAGS 0x00000008 +# define NDIAG_PROTO_ALL ((uint8_t) ~0) + +/* flags */ +# define NDIAG_FLAG_CB_RUNNING 0x00000001 +# define NDIAG_FLAG_PKTINFO 0x00000002 +# define NDIAG_FLAG_BROADCAST_ERROR 0x00000004 +# define NDIAG_FLAG_NO_ENOBUFS 0x00000008 +# define NDIAG_FLAG_LISTEN_ALL_NSID 0x00000010 +# define NDIAG_FLAG_CAP_ACK 0x00000020 #endif /* !STRACE_LINUX_NETLINK_DIAG_H */ diff --git a/linux/nios2/arch_defs_.h b/linux/nios2/arch_defs_.h new file mode 100644 index 00000000..9c778e24 --- /dev/null +++ b/linux/nios2/arch_defs_.h @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define HAVE_ARCH_DEDICATED_ERR_REG 1 diff --git a/linux/nios2/arch_regs.c b/linux/nios2/arch_regs.c index 2c30321f..3c28e620 100644 --- a/linux/nios2/arch_regs.c +++ b/linux/nios2/arch_regs.c @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static struct user_pt_regs nios2_regs; -# define ARCH_REGS_FOR_GETREGSET nios2_regs +#define ARCH_REGS_FOR_GETREGSET nios2_regs #define ARCH_PC_REG nios2_regs.regs[PTR_EA] +#define ARCH_SP_REG nios2_regs.regs[PTR_SP] diff --git a/linux/nios2/get_error.c b/linux/nios2/get_error.c index 1c91c0ac..d202abd9 100644 --- a/linux/nios2/get_error.c +++ b/linux/nios2/get_error.c @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { /* * The system call convention specifies that r2 contains the return diff --git a/linux/nios2/get_scno.c b/linux/nios2/get_scno.c index f4db85ee..cc0bd06d 100644 --- a/linux/nios2/get_scno.c +++ b/linux/nios2/get_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) diff --git a/linux/nios2/get_syscall_args.c b/linux/nios2/get_syscall_args.c index 707f594a..1e42fcd7 100644 --- a/linux/nios2/get_syscall_args.c +++ b/linux/nios2/get_syscall_args.c @@ -1,6 +1,13 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { tcp->u_arg[0] = nios2_regs.regs[4]; tcp->u_arg[1] = nios2_regs.regs[5]; diff --git a/linux/nios2/raw_syscall.h b/linux/nios2/raw_syscall.h new file mode 100644 index 00000000..02f6e7ee --- /dev/null +++ b/linux/nios2/raw_syscall.h @@ -0,0 +1,29 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + register kernel_ulong_t r2 __asm__("r2") = nr; + register kernel_ulong_t r7 __asm__("r7"); + __asm__ __volatile__("trap" + : "+r"(r2), "=r"(r7) + : + : "memory"); + *err = r7; + return r2; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/nios2/set_error.c b/linux/nios2/set_error.c index ecef8aa2..61fc0300 100644 --- a/linux/nios2/set_error.c +++ b/linux/nios2/set_error.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_error(struct tcb *tcp) { diff --git a/linux/nios2/set_scno.c b/linux/nios2/set_scno.c index 1f5051c2..64f226b1 100644 --- a/linux/nios2/set_scno.c +++ b/linux/nios2/set_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { diff --git a/linux/nios2/syscallent.h b/linux/nios2/syscallent.h index 301fd0e2..31431cf0 100644 --- a/linux/nios2/syscallent.h +++ b/linux/nios2/syscallent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #define sys_ARCH_mmap sys_mmap_pgoff #include "32/syscallent.h" /* [244 ... 259] are arch specific */ diff --git a/linux/nr_prefix.c b/linux/nr_prefix.c new file mode 100644 index 00000000..3b3d2d4e --- /dev/null +++ b/linux/nr_prefix.c @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +/** + * Returns prefix for a syscall constant literal. It is has to be that way + * thanks to ARM that decided to prefix their special system calls like sys32 + * and sys26 with __ARM_NR_* prefix instead of __NR_*, so we can't simply print + * "__NR_". + */ +static inline const char * +nr_prefix(kernel_ulong_t scno) +{ + return "__NR_"; +} diff --git a/linux/or1k/arch_regs.c b/linux/or1k/arch_regs.c index 78693e5a..196419df 100644 --- a/linux/or1k/arch_regs.c +++ b/linux/or1k/arch_regs.c @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static struct user_regs_struct or1k_regs; #define ARCH_REGS_FOR_GETREGSET or1k_regs #define ARCH_PC_REG or1k_regs.pc +#define ARCH_SP_REG or1k_regs.gpr[1] diff --git a/linux/or1k/get_error.c b/linux/or1k/get_error.c index 40e00bf4..e551f13f 100644 --- a/linux/or1k/get_error.c +++ b/linux/or1k/get_error.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "negated_errno.h" + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { if (check_errno && is_negated_errno(or1k_regs.gpr[11])) { tcp->u_rval = -1; diff --git a/linux/or1k/get_scno.c b/linux/or1k/get_scno.c index f446c907..f997abd4 100644 --- a/linux/or1k/get_scno.c +++ b/linux/or1k/get_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) diff --git a/linux/or1k/get_syscall_args.c b/linux/or1k/get_syscall_args.c index b72e01f0..f06d0a88 100644 --- a/linux/or1k/get_syscall_args.c +++ b/linux/or1k/get_syscall_args.c @@ -1,6 +1,13 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { tcp->u_arg[0] = or1k_regs.gpr[3 + 0]; tcp->u_arg[1] = or1k_regs.gpr[3 + 1]; diff --git a/linux/or1k/raw_syscall.h b/linux/or1k/raw_syscall.h new file mode 100644 index 00000000..e31df27e --- /dev/null +++ b/linux/or1k/raw_syscall.h @@ -0,0 +1,30 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + *err = 0; + register kernel_ulong_t r11 __asm__("r11") = nr; + __asm__ __volatile__("l.sys 1" + : "+r"(r11) + : + : "memory", "r3", "r4", "r5", "r6", "r7", "r8", + "r12", "r13", "r15", "r17", "r19", "r21", + "r23", "r25", "r27", "r29", "r31"); + return r11; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/or1k/set_error.c b/linux/or1k/set_error.c index 17973387..b5cb7016 100644 --- a/linux/or1k/set_error.c +++ b/linux/or1k/set_error.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_error(struct tcb *tcp) { diff --git a/linux/or1k/set_scno.c b/linux/or1k/set_scno.c index 269eeb5a..df2c5ad8 100644 --- a/linux/or1k/set_scno.c +++ b/linux/or1k/set_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { diff --git a/linux/or1k/syscallent.h b/linux/or1k/syscallent.h index 10af205e..ac339463 100644 --- a/linux/or1k/syscallent.h +++ b/linux/or1k/syscallent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2013-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #define sys_ARCH_mmap sys_mmap_pgoff #include "32/syscallent.h" /* [244 ... 259] are arch specific */ diff --git a/linux/or1k/userent.h b/linux/or1k/userent.h index c6fd7d39..056d1009 100644 --- a/linux/or1k/userent.h +++ b/linux/or1k/userent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + { 4*0, "r0" }, { 4*1, "r1" }, { 4*2, "r2" }, diff --git a/linux/packet_diag.h b/linux/packet_diag.h new file mode 100644 index 00000000..0efb7675 --- /dev/null +++ b/linux/packet_diag.h @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_LINUX_PACKET_DIAG_H +# define STRACE_LINUX_PACKET_DIAG_H + +struct packet_diag_req { + uint8_t sdiag_family; + uint8_t sdiag_protocol; + uint16_t pad; + uint32_t pdiag_ino; + uint32_t pdiag_show; + uint32_t pdiag_cookie[2]; +}; + +# define PACKET_SHOW_INFO 0x00000001 +# define PACKET_SHOW_MCLIST 0x00000002 +# define PACKET_SHOW_RING_CFG 0x00000004 +# define PACKET_SHOW_FANOUT 0x00000008 +# define PACKET_SHOW_MEMINFO 0x00000010 +# define PACKET_SHOW_FILTER 0x00000020 + +struct packet_diag_msg { + uint8_t pdiag_family; + uint8_t pdiag_type; + uint16_t pdiag_num; + + uint32_t pdiag_ino; + uint32_t pdiag_cookie[2]; +}; + +enum { + PACKET_DIAG_INFO, + PACKET_DIAG_MCLIST, + PACKET_DIAG_RX_RING, + PACKET_DIAG_TX_RING, + PACKET_DIAG_FANOUT, + PACKET_DIAG_UID, + PACKET_DIAG_MEMINFO, + PACKET_DIAG_FILTER, +}; + +struct packet_diag_info { + uint32_t pdi_index; + uint32_t pdi_version; + uint32_t pdi_reserve; + uint32_t pdi_copy_thresh; + uint32_t pdi_tstamp; + uint32_t pdi_flags; + +# define PDI_RUNNING 0x1 +# define PDI_AUXDATA 0x2 +# define PDI_ORIGDEV 0x4 +# define PDI_VNETHDR 0x8 +# define PDI_LOSS 0x10 +}; + +struct packet_diag_mclist { + uint32_t pdmc_index; + uint32_t pdmc_count; + uint16_t pdmc_type; + uint16_t pdmc_alen; + uint8_t pdmc_addr[32]; /* MAX_ADDR_LEN */ +}; + +struct packet_diag_ring { + uint32_t pdr_block_size; + uint32_t pdr_block_nr; + uint32_t pdr_frame_size; + uint32_t pdr_frame_nr; + uint32_t pdr_retire_tmo; + uint32_t pdr_sizeof_priv; + uint32_t pdr_features; +}; + +#endif /* !STRACE_LINUX_PACKET_DIAG_H */ diff --git a/linux/personality.h b/linux/personality.h deleted file mode 100644 index 9971703f..00000000 --- a/linux/personality.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef _LINUX_PERSONALITY_H -#define _LINUX_PERSONALITY_H - - -/* - * Flags for bug emulation. - * - * These occupy the top three bytes. - */ -enum { - UNAME26 = 0x0020000, - ADDR_NO_RANDOMIZE = 0x0040000, /* disable randomization of VA space */ - FDPIC_FUNCPTRS = 0x0080000, /* userspace function ptrs point to descriptors - * (signal handling) - */ - MMAP_PAGE_ZERO = 0x0100000, - ADDR_COMPAT_LAYOUT = 0x0200000, - READ_IMPLIES_EXEC = 0x0400000, - ADDR_LIMIT_32BIT = 0x0800000, - SHORT_INODE = 0x1000000, - WHOLE_SECONDS = 0x2000000, - STICKY_TIMEOUTS = 0x4000000, - ADDR_LIMIT_3GB = 0x8000000, -}; - -/* - * Security-relevant compatibility flags that must be - * cleared upon setuid or setgid exec: - */ -#define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC | \ - ADDR_NO_RANDOMIZE | \ - ADDR_COMPAT_LAYOUT | \ - MMAP_PAGE_ZERO) - -/* - * Personality types. - * - * These go in the low byte. Avoid using the top bit, it will - * conflict with error returns. - */ -enum { - PER_LINUX = 0x0000, - PER_LINUX_32BIT = 0x0000 | ADDR_LIMIT_32BIT, - PER_LINUX_FDPIC = 0x0000 | FDPIC_FUNCPTRS, - PER_SVR4 = 0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO, - PER_SVR3 = 0x0002 | STICKY_TIMEOUTS | SHORT_INODE, - PER_SCOSVR3 = 0x0003 | STICKY_TIMEOUTS | - WHOLE_SECONDS | SHORT_INODE, - PER_OSR5 = 0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS, - PER_WYSEV386 = 0x0004 | STICKY_TIMEOUTS | SHORT_INODE, - PER_ISCR4 = 0x0005 | STICKY_TIMEOUTS, - PER_BSD = 0x0006, - PER_SUNOS = 0x0006 | STICKY_TIMEOUTS, - PER_XENIX = 0x0007 | STICKY_TIMEOUTS | SHORT_INODE, - PER_LINUX32 = 0x0008, - PER_LINUX32_3GB = 0x0008 | ADDR_LIMIT_3GB, - PER_IRIX32 = 0x0009 | STICKY_TIMEOUTS,/* IRIX5 32-bit */ - PER_IRIXN32 = 0x000a | STICKY_TIMEOUTS,/* IRIX6 new 32-bit */ - PER_IRIX64 = 0x000b | STICKY_TIMEOUTS,/* IRIX6 64-bit */ - PER_RISCOS = 0x000c, - PER_SOLARIS = 0x000d | STICKY_TIMEOUTS, - PER_UW7 = 0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO, - PER_OSF4 = 0x000f, /* OSF/1 v4 */ - PER_HPUX = 0x0010, - PER_MASK = 0x00ff, -}; - - -#endif /* _LINUX_PERSONALITY_H */ diff --git a/linux/powerpc/arch_defs_.h b/linux/powerpc/arch_defs_.h new file mode 100644 index 00000000..31033712 --- /dev/null +++ b/linux/powerpc/arch_defs_.h @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define HAVE_ARCH_OLD_SELECT 1 +#define HAVE_ARCH_DEDICATED_ERR_REG 1 +#define CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL 1 diff --git a/linux/powerpc/arch_regs.c b/linux/powerpc/arch_regs.c index dd573f71..f9d0de59 100644 --- a/linux/powerpc/arch_regs.c +++ b/linux/powerpc/arch_regs.c @@ -1,4 +1,15 @@ -struct pt_regs ppc_regs; /* not static */ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +static struct pt_regs ppc_regs; #define ARCH_REGS_FOR_GETREGS ppc_regs #define ARCH_PC_REG ppc_regs.nip +#define ARCH_SP_REG ppc_regs.gpr[1] + +#undef ARCH_MIGHT_USE_SET_REGS +#define ARCH_MIGHT_USE_SET_REGS 0 diff --git a/linux/powerpc/arch_regs.h b/linux/powerpc/arch_regs.h deleted file mode 100644 index 1296e83e..00000000 --- a/linux/powerpc/arch_regs.h +++ /dev/null @@ -1 +0,0 @@ -extern struct pt_regs ppc_regs; diff --git a/linux/powerpc/arch_rt_sigframe.c b/linux/powerpc/arch_rt_sigframe.c new file mode 100644 index 00000000..1a614135 --- /dev/null +++ b/linux/powerpc/arch_rt_sigframe.c @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define SIGNAL_FRAMESIZE32 64 + +FUNC_GET_RT_SIGFRAME_ADDR +{ + kernel_ulong_t sp; + return get_stack_pointer(tcp, &sp) ? sp + SIGNAL_FRAMESIZE32 + 16 : 0; +} diff --git a/linux/powerpc/arch_sigreturn.c b/linux/powerpc/arch_sigreturn.c index 4f68648d..321f19a4 100644 --- a/linux/powerpc/arch_sigreturn.c +++ b/linux/powerpc/arch_sigreturn.c @@ -1,27 +1,41 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static void arch_sigreturn(struct tcb *tcp) { - unsigned long addr = ppc_regs.gpr[1]; - struct sigcontext sc; + kernel_ulong_t addr; + if (!get_stack_pointer(tcp, &addr)) + return; /* Skip dummy stack frame. */ -#ifdef POWERPC64 - if (current_personality == 0) - addr += 128; - else -#endif - addr += 64; + addr += 64; - if (umove(tcp, addr, &sc) < 0) { - tprintf("{mask=%#lx}", addr); - } else { - unsigned long mask[NSIG_BYTES / sizeof(long)]; #ifdef POWERPC64 - mask[0] = sc.oldmask | (sc._unused[3] << 32); + /* The only sigreturn on ppc64 is compat_sys_sigreturn. */ + typedef struct { + unsigned int _unused[4]; + int signal; + unsigned int handler; + unsigned int oldmask; + /* all the rest is irrelevant */ + } sigreturn_context; #else - mask[0] = sc.oldmask; - mask[1] = sc._unused[3]; + typedef struct sigcontext sigreturn_context; #endif + + sigreturn_context sc; + + if (!umove_or_printaddr(tcp, addr, &sc)) { + const unsigned int mask[NSIG_BYTES / sizeof(int)] = { + sc.oldmask, + sc._unused[3] + }; + tprintsigmask_addr("{mask=", mask); tprints("}"); } diff --git a/linux/powerpc/errnoent.h b/linux/powerpc/errnoent.h index b118c8eb..23d2111b 100644 --- a/linux/powerpc/errnoent.h +++ b/linux/powerpc/errnoent.h @@ -1,2 +1,9 @@ +/* + * Copyright (c) 1999-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "../errnoent.h" [ 58] = "EDEADLOCK", diff --git a/linux/powerpc/get_error.c b/linux/powerpc/get_error.c index 8f10612d..716e8782 100644 --- a/linux/powerpc/get_error.c +++ b/linux/powerpc/get_error.c @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { if (ppc_regs.ccr & 0x10000000) { tcp->u_rval = -1; diff --git a/linux/powerpc/get_scno.c b/linux/powerpc/get_scno.c index ef06656f..6624614a 100644 --- a/linux/powerpc/get_scno.c +++ b/linux/powerpc/get_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) diff --git a/linux/powerpc/get_syscall_args.c b/linux/powerpc/get_syscall_args.c index 66bcae31..823d7839 100644 --- a/linux/powerpc/get_syscall_args.c +++ b/linux/powerpc/get_syscall_args.c @@ -1,12 +1,34 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { - tcp->u_arg[0] = ppc_regs.orig_gpr3; - tcp->u_arg[1] = ppc_regs.gpr[4]; - tcp->u_arg[2] = ppc_regs.gpr[5]; - tcp->u_arg[3] = ppc_regs.gpr[6]; - tcp->u_arg[4] = ppc_regs.gpr[7]; - tcp->u_arg[5] = ppc_regs.gpr[8]; + if (current_personality != 0) { + /* + * Zero-extend from 32 bits. + * Use truncate_klong_to_current_wordsize(tcp->u_arg[N]) + * in syscall handlers + * if you need to use *sign-extended* parameter. + */ + tcp->u_arg[0] = (uint32_t) ppc_regs.orig_gpr3; + tcp->u_arg[1] = (uint32_t) ppc_regs.gpr[4]; + tcp->u_arg[2] = (uint32_t) ppc_regs.gpr[5]; + tcp->u_arg[3] = (uint32_t) ppc_regs.gpr[6]; + tcp->u_arg[4] = (uint32_t) ppc_regs.gpr[7]; + tcp->u_arg[5] = (uint32_t) ppc_regs.gpr[8]; + } else { + tcp->u_arg[0] = ppc_regs.orig_gpr3; + tcp->u_arg[1] = ppc_regs.gpr[4]; + tcp->u_arg[2] = ppc_regs.gpr[5]; + tcp->u_arg[3] = ppc_regs.gpr[6]; + tcp->u_arg[4] = ppc_regs.gpr[7]; + tcp->u_arg[5] = ppc_regs.gpr[8]; + } return 1; } diff --git a/linux/powerpc/getregs_old.c b/linux/powerpc/getregs_old.c index 1730f033..7edb796f 100644 --- a/linux/powerpc/getregs_old.c +++ b/linux/powerpc/getregs_old.c @@ -1,31 +1,38 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* * PTRACE_GETREGS was added to the PowerPC kernel in v2.6.23, * we provide a slow fallback for old kernels. */ static int -getregs_old(pid_t pid) +getregs_old(struct tcb *tcp) { int i; long r; if (iflag) { - r = upeek(pid, sizeof(long) * PT_NIP, &ppc_regs.nip); + r = upeek(tcp, sizeof(long) * PT_NIP, &ppc_regs.nip); if (r) goto out; } #ifdef POWERPC64 /* else we never use it */ - r = upeek(pid, sizeof(long) * PT_MSR, &ppc_regs.msr); + r = upeek(tcp, sizeof(long) * PT_MSR, &ppc_regs.msr); if (r) goto out; #endif - r = upeek(pid, sizeof(long) * PT_CCR, &ppc_regs.ccr); + r = upeek(tcp, sizeof(long) * PT_CCR, &ppc_regs.ccr); if (r) goto out; - r = upeek(pid, sizeof(long) * PT_ORIG_R3, &ppc_regs.orig_gpr3); + r = upeek(tcp, sizeof(long) * PT_ORIG_R3, &ppc_regs.orig_gpr3); if (r) goto out; for (i = 0; i <= 8; i++) { - r = upeek(pid, sizeof(long) * (PT_R0 + i), + r = upeek(tcp, sizeof(long) * (PT_R0 + i), &ppc_regs.gpr[i]); if (r) goto out; diff --git a/linux/powerpc/ioctls_arch0.h b/linux/powerpc/ioctls_arch0.h index 6b429d30..190887d4 100644 --- a/linux/powerpc/ioctls_arch0.h +++ b/linux/powerpc/ioctls_arch0.h @@ -26,12 +26,14 @@ { "asm/ioctls.h", "TIOCGETP", _IOC_READ, 0x7408, 0x06 }, { "asm/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 }, { "asm/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 }, +{ "asm/ioctls.h", "TIOCGISO7816", _IOC_READ, 0x5442, 0x28 }, { "asm/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 }, { "asm/ioctls.h", "TIOCGLTC", _IOC_READ, 0x7474, 0x06 }, { "asm/ioctls.h", "TIOCGPGRP", _IOC_READ, 0x7477, 0x04 }, { "asm/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 }, { "asm/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 }, { "asm/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 }, +{ "asm/ioctls.h", "TIOCGPTPEER", _IOC_NONE, 0x5441, 0x00 }, { "asm/ioctls.h", "TIOCGRS485", 0, 0x542e, 0 }, { "asm/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 }, { "asm/ioctls.h", "TIOCGSID", 0, 0x5429, 0 }, @@ -61,6 +63,7 @@ { "asm/ioctls.h", "TIOCSETN", _IOC_WRITE, 0x740a, 0x06 }, { "asm/ioctls.h", "TIOCSETP", _IOC_WRITE, 0x7409, 0x06 }, { "asm/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 }, +{ "asm/ioctls.h", "TIOCSISO7816", _IOC_READ|_IOC_WRITE, 0x5443, 0x28 }, { "asm/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 }, { "asm/ioctls.h", "TIOCSLTC", _IOC_WRITE, 0x7475, 0x06 }, { "asm/ioctls.h", "TIOCSPGRP", _IOC_WRITE, 0x7476, 0x04 }, @@ -86,21 +89,14 @@ { "asm/ps3fb.h", "PS3FB_IOCTL_ON", _IOC_NONE, 0x7204, 0x00 }, { "asm/ps3fb.h", "PS3FB_IOCTL_SCREENINFO", _IOC_READ, 0x7203, 0x04 }, { "asm/ps3fb.h", "PS3FB_IOCTL_SETMODE", _IOC_WRITE, 0x7201, 0x04 }, -{ "asm/sockios.h", "FIOGETOWN", 0, 0x8903, 0 }, -{ "asm/sockios.h", "FIOSETOWN", 0, 0x8901, 0 }, -{ "asm/sockios.h", "SIOCATMARK", 0, 0x8905, 0 }, -{ "asm/sockios.h", "SIOCGPGRP", 0, 0x8904, 0 }, -{ "asm/sockios.h", "SIOCGSTAMP", 0, 0x8906, 0 }, -{ "asm/sockios.h", "SIOCGSTAMPNS", 0, 0x8907, 0 }, -{ "asm/sockios.h", "SIOCSPGRP", 0, 0x8902, 0 }, { "linux/kvm.h", "KVM_ALLOCATE_RMA", _IOC_READ, 0xaea9, 0x08 }, -{ "linux/kvm.h", "KVM_ARM_SET_DEVICE_ADDR", _IOC_WRITE, 0xaeab, 0x10 }, { "linux/kvm.h", "KVM_ASSIGN_DEV_IRQ", _IOC_WRITE, 0xae70, 0x40 }, { "linux/kvm.h", "KVM_ASSIGN_PCI_DEVICE", _IOC_READ, 0xae69, 0x40 }, { "linux/kvm.h", "KVM_ASSIGN_SET_INTX_MASK", _IOC_WRITE, 0xaea4, 0x40 }, { "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_ENTRY", _IOC_WRITE, 0xae74, 0x10 }, { "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_NR", _IOC_WRITE, 0xae73, 0x08 }, { "linux/kvm.h", "KVM_CHECK_EXTENSION", _IOC_NONE, 0xae03, 0x00 }, +{ "linux/kvm.h", "KVM_CLEAR_DIRTY_LOG", _IOC_READ|_IOC_WRITE, 0xaec0, 0x18 }, { "linux/kvm.h", "KVM_CREATE_DEVICE", _IOC_READ|_IOC_WRITE, 0xaee0, 0x0c }, { "linux/kvm.h", "KVM_CREATE_IRQCHIP", _IOC_NONE, 0xae60, 0x00 }, { "linux/kvm.h", "KVM_CREATE_PIT", _IOC_NONE, 0xae64, 0x00 }, @@ -134,29 +130,23 @@ { "linux/kvm.h", "KVM_IRQ_LINE", _IOC_WRITE, 0xae61, 0x08 }, { "linux/kvm.h", "KVM_IRQ_LINE_STATUS", _IOC_READ|_IOC_WRITE, 0xae67, 0x08 }, { "linux/kvm.h", "KVM_KVMCLOCK_CTRL", _IOC_NONE, 0xaead, 0x00 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_OP", _IOC_READ|_IOC_WRITE, 0xaeba, 0x08 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_REG_REGION", _IOC_READ, 0xaebb, 0x10 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_UNREG_REGION", _IOC_READ, 0xaebc, 0x10 }, { "linux/kvm.h", "KVM_NMI", _IOC_NONE, 0xae9a, 0x00 }, { "linux/kvm.h", "KVM_PPC_ALLOCATE_HTAB", _IOC_READ|_IOC_WRITE, 0xaea7, 0x04 }, +{ "linux/kvm.h", "KVM_PPC_CONFIGURE_V3_MMU", _IOC_WRITE, 0xaeaf, 0x10 }, +{ "linux/kvm.h", "KVM_PPC_GET_CPU_CHAR", _IOC_READ, 0xaeb1, 0x20 }, { "linux/kvm.h", "KVM_PPC_GET_HTAB_FD", _IOC_WRITE, 0xaeaa, 0x20 }, { "linux/kvm.h", "KVM_PPC_GET_PVINFO", _IOC_WRITE, 0xaea1, 0x80 }, +{ "linux/kvm.h", "KVM_PPC_GET_RMMU_INFO", _IOC_WRITE, 0xaeb0, 0x60 }, { "linux/kvm.h", "KVM_PPC_GET_SMMU_INFO", _IOC_READ, 0xaea6, 0x250 }, +{ "linux/kvm.h", "KVM_PPC_RESIZE_HPT_COMMIT", _IOC_READ, 0xaeae, 0x10 }, +{ "linux/kvm.h", "KVM_PPC_RESIZE_HPT_PREPARE", _IOC_READ, 0xaead, 0x10 }, { "linux/kvm.h", "KVM_PPC_RTAS_DEFINE_TOKEN", _IOC_WRITE, 0xaeac, 0x80 }, { "linux/kvm.h", "KVM_REGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae67, 0x10 }, { "linux/kvm.h", "KVM_REINJECT_CONTROL", _IOC_NONE, 0xae71, 0x00 }, { "linux/kvm.h", "KVM_RUN", _IOC_NONE, 0xae80, 0x00 }, -{ "linux/kvm.h", "KVM_S390_ENABLE_SIE", _IOC_NONE, 0xae06, 0x00 }, -{ "linux/kvm.h", "KVM_S390_GET_IRQ_STATE", _IOC_WRITE, 0xaeb6, 0x20 }, -{ "linux/kvm.h", "KVM_S390_GET_SKEYS", _IOC_WRITE, 0xaeb2, 0x40 }, -{ "linux/kvm.h", "KVM_S390_INITIAL_RESET", _IOC_NONE, 0xae97, 0x00 }, -{ "linux/kvm.h", "KVM_S390_INTERRUPT", _IOC_WRITE, 0xae94, 0x10 }, -{ "linux/kvm.h", "KVM_S390_IRQ", _IOC_WRITE, 0xaeb4, 0x48 }, -{ "linux/kvm.h", "KVM_S390_MEM_OP", _IOC_WRITE, 0xaeb1, 0x40 }, -{ "linux/kvm.h", "KVM_S390_SET_INITIAL_PSW", _IOC_WRITE, 0xae96, 0x10 }, -{ "linux/kvm.h", "KVM_S390_SET_IRQ_STATE", _IOC_WRITE, 0xaeb5, 0x20 }, -{ "linux/kvm.h", "KVM_S390_SET_SKEYS", _IOC_WRITE, 0xaeb3, 0x40 }, -{ "linux/kvm.h", "KVM_S390_STORE_STATUS", _IOC_WRITE, 0xae95, 0x04 }, -{ "linux/kvm.h", "KVM_S390_UCAS_MAP", _IOC_WRITE, 0xae50, 0x18 }, -{ "linux/kvm.h", "KVM_S390_UCAS_UNMAP", _IOC_WRITE, 0xae51, 0x18 }, -{ "linux/kvm.h", "KVM_S390_VCPU_FAULT", _IOC_WRITE, 0xae52, 0x04 }, { "linux/kvm.h", "KVM_SET_BOOT_CPU_ID", _IOC_NONE, 0xae78, 0x00 }, { "linux/kvm.h", "KVM_SET_CLOCK", _IOC_WRITE, 0xae7b, 0x30 }, { "linux/kvm.h", "KVM_SET_DEVICE_ATTR", _IOC_WRITE, 0xaee1, 0x18 }, @@ -181,5 +171,3 @@ { "linux/kvm.h", "KVM_TPR_ACCESS_REPORTING", _IOC_READ|_IOC_WRITE, 0xae92, 0x28 }, { "linux/kvm.h", "KVM_TRANSLATE", _IOC_READ|_IOC_WRITE, 0xae85, 0x18 }, { "linux/kvm.h", "KVM_UNREGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae68, 0x10 }, -{ "linux/kvm.h", "KVM_X86_GET_MCE_CAP_SUPPORTED", _IOC_READ, 0xae9d, 0x08 }, -{ "linux/kvm.h", "KVM_X86_SETUP_MCE", _IOC_WRITE, 0xae9c, 0x08 }, diff --git a/linux/powerpc/raw_syscall.h b/linux/powerpc/raw_syscall.h new file mode 100644 index 00000000..e023fcd1 --- /dev/null +++ b/linux/powerpc/raw_syscall.h @@ -0,0 +1,32 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + register kernel_ulong_t r0 __asm__("r0") = nr; + register kernel_ulong_t r3 __asm__("r3"); + __asm__ __volatile__("sc\n\t" + "mfcr %0" + : "+r"(r0), "=r"(r3) + : + : "memory", "cr0", "ctr", "lr", + "r4", "r5", "r6", "r7", "r8", + "r9", "r10", "r11", "r12"); + *err = !!(r0 & 0x10000000); + return r3; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/powerpc/set_error.c b/linux/powerpc/set_error.c index 7edabee5..9b8a6f2f 100644 --- a/linux/powerpc/set_error.c +++ b/linux/powerpc/set_error.c @@ -1,12 +1,17 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_error(struct tcb *tcp) { ppc_regs.gpr[3] = tcp->u_error; -#ifdef HAVE_GETREGS_OLD - return upoke(tcp->pid, sizeof(long) * (PT_R0 + 3), ppc_regs.gpr[3]); -#else - return set_regs(tcp->pid); -#endif + ppc_regs.ccr |= 0x10000000; + return upoke(tcp, sizeof(long) * PT_CCR, ppc_regs.ccr) || + upoke(tcp, sizeof(long) * (PT_R0 + 3), ppc_regs.gpr[3]); } static int @@ -14,10 +19,6 @@ arch_set_success(struct tcb *tcp) { ppc_regs.gpr[3] = tcp->u_rval; ppc_regs.ccr &= ~0x10000000; -#ifdef HAVE_GETREGS_OLD - return upoke(tcp->pid, sizeof(long) * PT_CCR, ppc_regs.ccr) || - upoke(tcp->pid, sizeof(long) * (PT_R0 + 3), ppc_regs.gpr[3]); -#else - return set_regs(tcp->pid); -#endif + return upoke(tcp, sizeof(long) * PT_CCR, ppc_regs.ccr) || + upoke(tcp, sizeof(long) * (PT_R0 + 3), ppc_regs.gpr[3]); } diff --git a/linux/powerpc/set_scno.c b/linux/powerpc/set_scno.c index c5a04687..f47ad85b 100644 --- a/linux/powerpc/set_scno.c +++ b/linux/powerpc/set_scno.c @@ -1,10 +1,12 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { -#ifdef HAVE_GETREGS_OLD - return upoke(tcp->pid, sizeof(long) * PT_R0, scno); -#else - ppc_regs.gpr[0] = scno; - return set_regs(tcp->pid); -#endif + return upoke(tcp, sizeof(long) * PT_R0, scno); } diff --git a/linux/powerpc/syscallent.h b/linux/powerpc/syscallent.h index 4e1eb8b7..4e184646 100644 --- a/linux/powerpc/syscallent.h +++ b/linux/powerpc/syscallent.h @@ -1,29 +1,10 @@ /* * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995 Rick Sladkey + * Copyright (c) 1995-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ [ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, @@ -44,17 +25,17 @@ [ 15] = { 2, TF, SEN(chmod), "chmod" }, [ 16] = { 3, TF, SEN(chown), "lchown" }, [ 17] = { 0, TM, SEN(break), "break" }, -[ 18] = { 2, TF, SEN(oldstat), "oldstat" }, +[ 18] = { 2, TF|TST|TSTA, SEN(oldstat), "oldstat" }, [ 19] = { 3, TD, SEN(lseek), "lseek" }, -[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 20] = { 0, PU|NF, SEN(getpid), "getpid" }, [ 21] = { 5, TF, SEN(mount), "mount" }, [ 22] = { 1, TF, SEN(umount), "umount" }, [ 23] = { 1, 0, SEN(setuid), "setuid" }, -[ 24] = { 0, NF, SEN(getuid), "getuid" }, +[ 24] = { 0, PU|NF, SEN(getuid), "getuid" }, [ 25] = { 1, 0, SEN(stime), "stime" }, [ 26] = { 4, 0, SEN(ptrace), "ptrace" }, [ 27] = { 1, 0, SEN(alarm), "alarm" }, -[ 28] = { 2, TD, SEN(oldfstat), "oldfstat" }, +[ 28] = { 2, TD|TFST|TSTA, SEN(oldfstat), "oldfstat" }, [ 29] = { 0, TS, SEN(pause), "pause" }, [ 30] = { 2, TF, SEN(utime), "utime" }, [ 31] = { 2, 0, SEN(stty), "stty" }, @@ -73,10 +54,10 @@ [ 44] = { 0, 0, SEN(prof), "prof" }, [ 45] = { 1, TM|SI, SEN(brk), "brk" }, [ 46] = { 1, 0, SEN(setgid), "setgid" }, -[ 47] = { 0, NF, SEN(getgid), "getgid" }, +[ 47] = { 0, PU|NF, SEN(getgid), "getgid" }, [ 48] = { 2, TS, SEN(signal), "signal" }, -[ 49] = { 0, NF, SEN(geteuid), "geteuid" }, -[ 50] = { 0, NF, SEN(getegid), "getegid" }, +[ 49] = { 0, PU|NF, SEN(geteuid), "geteuid" }, +[ 50] = { 0, PU|NF, SEN(getegid), "getegid" }, [ 51] = { 1, TF, SEN(acct), "acct" }, [ 52] = { 2, TF, SEN(umount2), "umount2" }, [ 53] = { 0, 0, SEN(lock), "lock" }, @@ -88,17 +69,17 @@ [ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, [ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, -[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 62] = { 2, TSFA, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, -[ 64] = { 0, NF, SEN(getppid), "getppid" }, -[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 64] = { 0, PU|NF, SEN(getppid), "getppid" }, +[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, [ 66] = { 0, 0, SEN(setsid), "setsid" }, [ 67] = { 3, TS, SEN(sigaction), "sigaction" }, -[ 68] = { 0, TS, SEN(siggetmask), "sgetmask" }, -[ 69] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[ 68] = { 0, TS, SEN(sgetmask), "sgetmask" }, +[ 69] = { 1, TS, SEN(ssetmask), "ssetmask" }, [ 70] = { 2, 0, SEN(setreuid), "setreuid" }, [ 71] = { 2, 0, SEN(setregid), "setregid" }, -[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, +[ 72] = { 1, TS, SEN(sigsuspend), "sigsuspend" }, [ 73] = { 1, TS, SEN(sigpending), "sigpending" }, [ 74] = { 2, 0, SEN(sethostname), "sethostname" }, [ 75] = { 2, 0, SEN(setrlimit), "setrlimit" }, @@ -110,7 +91,7 @@ [ 81] = { 2, 0, SEN(setgroups), "setgroups" }, [ 82] = { 1, TD, SEN(oldselect), "select" }, [ 83] = { 2, TF, SEN(symlink), "symlink" }, -[ 84] = { 2, TF, SEN(oldlstat), "oldlstat" }, +[ 84] = { 2, TF|TLST|TSTA, SEN(oldlstat), "oldlstat" }, [ 85] = { 3, TF, SEN(readlink), "readlink" }, [ 86] = { 1, TF, SEN(uselib), "uselib" }, [ 87] = { 2, TF, SEN(swapon), "swapon" }, @@ -125,16 +106,16 @@ [ 96] = { 2, 0, SEN(getpriority), "getpriority" }, [ 97] = { 3, 0, SEN(setpriority), "setpriority" }, [ 98] = { 4, 0, SEN(profil), "profil" }, -[ 99] = { 2, TF, SEN(statfs), "statfs" }, -[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, [101] = { 3, 0, SEN(ioperm), "ioperm" }, [102] = { 2, TD, SEN(socketcall), "socketcall" }, [103] = { 3, 0, SEN(syslog), "syslog" }, [104] = { 3, 0, SEN(setitimer), "setitimer" }, [105] = { 2, 0, SEN(getitimer), "getitimer" }, -[106] = { 2, TF, SEN(stat), "stat" }, -[107] = { 2, TF, SEN(lstat), "lstat" }, -[108] = { 2, TD, SEN(fstat), "fstat" }, +[106] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, +[107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, +[108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, [109] = { 1, 0, SEN(olduname), "olduname" }, [110] = { 1, 0, SEN(iopl), "iopl" }, [111] = { 0, 0, SEN(vhangup), "vhangup" }, @@ -150,7 +131,7 @@ [121] = { 2, 0, SEN(setdomainname), "setdomainname" }, [122] = { 1, 0, SEN(uname), "uname" }, [123] = { 5, 0, SEN(printargs), "modify_ldt" }, -[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[124] = { 1, 0, SEN(adjtimex32), "adjtimex" }, [125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, [126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, [127] = { 2, 0, SEN(create_module), "create_module" }, @@ -187,13 +168,13 @@ [158] = { 0, 0, SEN(sched_yield), "sched_yield" }, [159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, -[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[161] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"}, +[162] = { 2, 0, SEN(nanosleep_time32), "nanosleep" }, [163] = { 5, TM|SI, SEN(mremap), "mremap" }, [164] = { 3, 0, SEN(setresuid), "setresuid" }, [165] = { 3, 0, SEN(getresuid), "getresuid" }, [166] = { 5, 0, SEN(query_module), "query_module" }, -[167] = { 3, TD, SEN(poll), "poll" }, +[167] = { 3, TD, SEN(poll_time32), "poll" }, [168] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, [169] = { 3, 0, SEN(setresgid), "setresgid" }, [170] = { 3, 0, SEN(getresgid), "getresgid" }, @@ -202,7 +183,7 @@ [173] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, [174] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, [175] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[176] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[176] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" }, [177] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, [178] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, [179] = { 6, TD, SEN(pread), "pread64" }, @@ -221,9 +202,9 @@ [192] = { 6, TD|TM|SI, SEN(mmap_4koff), "mmap2" }, [193] = { 4, TF, SEN(truncate64), "truncate64" }, [194] = { 4, TD, SEN(ftruncate64), "ftruncate64" }, -[195] = { 2, TF, SEN(stat64), "stat64" }, -[196] = { 2, TF, SEN(lstat64), "lstat64" }, -[197] = { 2, TD, SEN(fstat64), "fstat64" }, +[195] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" }, +[196] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" }, +[197] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" }, [198] = { 5, 0, SEN(printargs), "pciconfig_read" }, [199] = { 5, 0, SEN(printargs), "pciconfig_write" }, [200] = { 3, 0, SEN(printargs), "pciconfig_iobase" }, @@ -233,7 +214,7 @@ [204] = { 3, TD, SEN(fcntl64), "fcntl64" }, [205] = { 3, TM, SEN(madvise), "madvise" }, [206] = { 3, TM, SEN(mincore), "mincore" }, -[207] = { 0, NF, SEN(gettid), "gettid" }, +[207] = { 0, PU|NF, SEN(gettid), "gettid" }, [208] = { 2, TS, SEN(kill), "tkill" }, [209] = { 5, TF, SEN(setxattr), "setxattr" }, [210] = { 5, TF, SEN(setxattr), "lsetxattr" }, @@ -247,7 +228,7 @@ [218] = { 2, TF, SEN(removexattr), "removexattr" }, [219] = { 2, TF, SEN(removexattr), "lremovexattr" }, [220] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, -[221] = { 6, 0, SEN(futex), "futex" }, +[221] = { 6, 0, SEN(futex_time32), "futex" }, [222] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [223] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [224] = { }, @@ -255,7 +236,7 @@ [226] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, [227] = { 2, TM, SEN(io_setup), "io_setup" }, [228] = { 1, TM, SEN(io_destroy), "io_destroy" }, -[229] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[229] = { 5, 0, SEN(io_getevents_time32), "io_getevents" }, [230] = { 3, 0, SEN(io_submit), "io_submit" }, [231] = { 3, 0, SEN(io_cancel), "io_cancel" }, [232] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, @@ -267,19 +248,19 @@ [238] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, [239] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, [240] = { 3, 0, SEN(timer_create), "timer_create" }, -[241] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[242] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[241] = { 4, 0, SEN(timer_settime32), "timer_settime" }, +[242] = { 2, 0, SEN(timer_gettime32), "timer_gettime" }, [243] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, [244] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[245] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[246] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[247] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[248] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[245] = { 2, 0, SEN(clock_settime32), "clock_settime" }, +[246] = { 2, 0, SEN(clock_gettime32), "clock_gettime" }, +[247] = { 2, 0, SEN(clock_getres_time32), "clock_getres" }, +[248] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" }, [249] = { 2, 0, SEN(printargs), "swapcontext" }, [250] = { 3, TS, SEN(tgkill), "tgkill" }, [251] = { 2, TF, SEN(utimes), "utimes" }, -[252] = { 3, TF, SEN(statfs64), "statfs64" }, -[253] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[252] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, +[253] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, [254] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, [255] = { 1, 0, SEN(printargs), "rtas" }, [256] = { 5, 0, SEN(printargs), "sys_debug_setcontext" }, @@ -288,12 +269,12 @@ [259] = { 6, TM, SEN(mbind), "mbind" }, [260] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, [261] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, -[262] = { 4, 0, SEN(mq_open), "mq_open" }, +[262] = { 4, TD, SEN(mq_open), "mq_open" }, [263] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[264] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[265] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[266] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[267] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[264] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" }, +[265] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" }, +[266] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[267] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, [268] = { 4, 0, SEN(kexec_load), "kexec_load" }, [269] = { 5, 0, SEN(add_key), "add_key" }, [270] = { 4, 0, SEN(request_key), "request_key" }, @@ -302,12 +283,12 @@ [273] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, [274] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, [275] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[276] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[276] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, [277] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, [278] = { 3, 0, SEN(printargs), "spu_run" }, [279] = { 4, 0, SEN(printargs), "spu_create" }, -[280] = { 6, TD, SEN(pselect6), "pselect6" }, -[281] = { 5, TD, SEN(ppoll), "ppoll" }, +[280] = { 6, TD, SEN(pselect6_time32), "pselect6" }, +[281] = { 5, TD, SEN(ppoll_time32), "ppoll" }, [282] = { 1, TP, SEN(unshare), "unshare" }, [283] = { 6, TD, SEN(splice), "splice" }, [284] = { 4, TD, SEN(tee), "tee" }, @@ -317,7 +298,7 @@ [288] = { 4, TD|TF, SEN(mknodat), "mknodat" }, [289] = { 5, TD|TF, SEN(fchownat), "fchownat" }, [290] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[291] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[291] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" }, [292] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, [293] = { 4, TD|TF, SEN(renameat), "renameat" }, [294] = { 5, TD|TF, SEN(linkat), "linkat" }, @@ -330,15 +311,15 @@ [301] = { 6, TM, SEN(move_pages), "move_pages" }, [302] = { 3, 0, SEN(getcpu), "getcpu" }, [303] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[304] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[304] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [305] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [306] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [307] = { 1, TD, SEN(eventfd), "eventfd" }, [308] = { 6, TD, SEN(sync_file_range2), "sync_file_range2" }, [309] = { 6, TD, SEN(fallocate), "fallocate" }, [310] = { 3, 0, SEN(subpage_prot), "subpage_prot" }, -[311] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, -[312] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[311] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" }, +[312] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" }, [313] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, [314] = { 2, TD, SEN(eventfd2), "eventfd2" }, [315] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, @@ -369,11 +350,11 @@ [340] = { 5, TN, SEN(getsockopt), "getsockopt" }, [341] = { 3, TN, SEN(sendmsg), "sendmsg" }, [342] = { 3, TN, SEN(recvmsg), "recvmsg" }, -[343] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[343] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" }, [344] = { 4, TN, SEN(accept4), "accept4" }, [345] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, [346] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[347] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[347] = { 2, 0, SEN(clock_adjtime32), "clock_adjtime" }, [348] = { 1, TD, SEN(syncfs), "syncfs" }, [349] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, [350] = { 2, TD, SEN(setns), "setns" }, @@ -392,23 +373,53 @@ [363] = { 0, 0, SEN(printargs), "switch_endian" }, [364] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, [365] = { 2, 0, SEN(membarrier), "membarrier" }, -[366] = { 3, TI, SEN(semop), "semop" }, -[367] = { 3, TI, SEN(semget), "semget" }, -[368] = { 4, TI, SEN(semctl), "semctl" }, -[369] = { 4, TI, SEN(semtimedop), "semtimedop" }, -[370] = { 4, TI, SEN(msgsnd), "msgsnd" }, -[371] = { 5, TI, SEN(msgrcv), "msgrcv" }, -[372] = { 2, TI, SEN(msgget), "msgget" }, -[373] = { 3, TI, SEN(msgctl), "msgctl" }, -[374] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, -[375] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, -[376] = { 3, TI, SEN(shmget), "shmget" }, -[377] = { 3, TI, SEN(shmctl), "shmctl" }, +/* originally left for IPC, now unused */ [378] = { 3, TM, SEN(mlock2), "mlock2" }, [379] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, [380] = { 6, TD, SEN(preadv2), "preadv2" }, [381] = { 6, TD, SEN(pwritev2), "pwritev2" }, [382] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" }, +[383] = { 5, TD|TF|TSTA, SEN(statx), "statx" }, +[384] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, +[385] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[386] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, +[387] = { 4, 0, SEN(rseq), "rseq" }, +[388] = { 6, 0, SEN(io_pgetevents_time32), "io_pgetevents" }, +/* room for arch specific syscalls */ +[393] = { 3, TI, SEN(semget), "semget" }, +[394] = { 4, TI, SEN(semctl), "semctl" }, +[395] = { 3, TI, SEN(shmget), "shmget" }, +[396] = { 3, TI, SEN(shmctl), "shmctl" }, +[397] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[398] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[399] = { 2, TI, SEN(msgget), "msgget" }, +[400] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[401] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[402] = { 3, TI, SEN(msgctl), "msgctl" }, +[403] = { 2, 0, SEN(clock_gettime64), "clock_gettime64" }, +[404] = { 2, 0, SEN(clock_settime64), "clock_settime64" }, +[405] = { 2, 0, SEN(clock_adjtime64), "clock_adjtime64" }, +[406] = { 2, 0, SEN(clock_getres_time64), "clock_getres_time64" }, +[407] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep_time64"}, +[408] = { 2, 0, SEN(timer_gettime64), "timer_gettime64" }, +[409] = { 4, 0, SEN(timer_settime64), "timer_settime64" }, +[410] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime64" }, +[411] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime64" }, +[412] = { 4, TD|TF, SEN(utimensat_time64), "utimensat_time64" }, +[413] = { 6, TD, SEN(pselect6_time64), "pselect6_time64" }, +[414] = { 5, TD, SEN(ppoll_time64), "ppoll_time64" }, +[416] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents_time64" }, +[417] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg_time64" }, +[418] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend_time64" }, +[419] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive_time64"}, +[420] = { 4, TI, SEN(semtimedop_time64), "semtimedop_time64" }, +[421] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait_time64"}, +[422] = { 6, 0, SEN(futex_time64), "futex_time64" }, +[423] = { 2, 0, SEN(sched_rr_get_interval_time64), "sched_rr_get_interval_time64" }, +[424] = { 4, TD|TS, SEN(pidfd_send_signal), "pidfd_send_signal" }, +[425] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" }, +[426] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" }, +[427] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" }, -#define SYS_socket_subcall 400 -#include "subcall.h" +#define SYS_socket_subcall 500 +#include "subcall32.h" diff --git a/linux/powerpc/userent.h b/linux/powerpc/userent.h index e2094c24..93cc656b 100644 --- a/linux/powerpc/userent.h +++ b/linux/powerpc/userent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #ifndef PT_ORIG_R3 # define PT_ORIG_R3 34 #endif diff --git a/linux/powerpc64/arch_defs_.h b/linux/powerpc64/arch_defs_.h new file mode 100644 index 00000000..871f4109 --- /dev/null +++ b/linux/powerpc64/arch_defs_.h @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define HAVE_ARCH_OLD_SELECT 1 +#define SUPPORTED_PERSONALITIES 2 +#define HAVE_ARCH_DEDICATED_ERR_REG 1 diff --git a/linux/powerpc64/arch_get_personality.c b/linux/powerpc64/arch_get_personality.c new file mode 100644 index 00000000..9817d44a --- /dev/null +++ b/linux/powerpc64/arch_get_personality.c @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef AUDIT_ARCH_PPC +# define AUDIT_ARCH_PPC 0x14 +#endif + +int +get_personality_from_syscall_info(const struct ptrace_syscall_info *sci) +{ + return sci->arch == AUDIT_ARCH_PPC; +} diff --git a/linux/powerpc64/arch_regs.c b/linux/powerpc64/arch_regs.c index c50855d9..b5c572dc 100644 --- a/linux/powerpc64/arch_regs.c +++ b/linux/powerpc64/arch_regs.c @@ -1,3 +1 @@ #include "powerpc/arch_regs.c" -#undef ARCH_PC_REG -#define ARCH_PC_REG ppc_regs.nip diff --git a/linux/powerpc64/arch_regs.h b/linux/powerpc64/arch_regs.h deleted file mode 100644 index 05e4fe19..00000000 --- a/linux/powerpc64/arch_regs.h +++ /dev/null @@ -1 +0,0 @@ -#include "powerpc/arch_regs.h" diff --git a/linux/powerpc64/arch_rt_sigframe.c b/linux/powerpc64/arch_rt_sigframe.c new file mode 100644 index 00000000..17ef72b5 --- /dev/null +++ b/linux/powerpc64/arch_rt_sigframe.c @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#undef FUNC_GET_RT_SIGFRAME_ADDR +#define FUNC_GET_RT_SIGFRAME_ADDR \ + static kernel_ulong_t ppc_get_rt_sigframe_addr(struct tcb *tcp) + +#include "powerpc/arch_rt_sigframe.c" + +#undef FUNC_GET_RT_SIGFRAME_ADDR +#define FUNC_GET_RT_SIGFRAME_ADDR DEF_FUNC_GET_RT_SIGFRAME_ADDR + +FUNC_GET_RT_SIGFRAME_ADDR +{ + if (tcp->currpers == 1) + return ppc_get_rt_sigframe_addr(tcp); + kernel_ulong_t sp; + return get_stack_pointer(tcp, &sp) ? sp : 0; +} diff --git a/linux/powerpc64/errnoent1.h b/linux/powerpc64/errnoent1.h deleted file mode 100644 index c0f7787d..00000000 --- a/linux/powerpc64/errnoent1.h +++ /dev/null @@ -1 +0,0 @@ -#include "errnoent.h" diff --git a/linux/powerpc64/get_scno.c b/linux/powerpc64/get_scno.c index 8a943e8d..03523d39 100644 --- a/linux/powerpc64/get_scno.c +++ b/linux/powerpc64/get_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) diff --git a/linux/powerpc64/raw_syscall.h b/linux/powerpc64/raw_syscall.h new file mode 100644 index 00000000..05577ee9 --- /dev/null +++ b/linux/powerpc64/raw_syscall.h @@ -0,0 +1 @@ +#include "powerpc/raw_syscall.h" diff --git a/linux/powerpc64/rt_sigframe.h b/linux/powerpc64/rt_sigframe.h new file mode 100644 index 00000000..a99a3c2f --- /dev/null +++ b/linux/powerpc64/rt_sigframe.h @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef __powerpc64__ +# include "../rt_sigframe.h" +#else +# ifndef STRACE_RT_SIGFRAME_H +# define STRACE_RT_SIGFRAME_H + +# include + +typedef struct { + ucontext_t uc; + /* more data follows */ +} struct_rt_sigframe; + +# endif /* !STRACE_RT_SIGFRAME_H */ +#endif /* !__powerpc64__ */ diff --git a/linux/powerpc64/signalent1.h b/linux/powerpc64/signalent1.h deleted file mode 100644 index 093cba7f..00000000 --- a/linux/powerpc64/signalent1.h +++ /dev/null @@ -1 +0,0 @@ -#include "signalent.h" diff --git a/linux/powerpc64/syscallent.h b/linux/powerpc64/syscallent.h index e5263d4d..47a59990 100644 --- a/linux/powerpc64/syscallent.h +++ b/linux/powerpc64/syscallent.h @@ -1,29 +1,10 @@ /* * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995 Rick Sladkey + * Copyright (c) 1995-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ [ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, @@ -44,17 +25,17 @@ [ 15] = { 2, TF, SEN(chmod), "chmod" }, [ 16] = { 3, TF, SEN(chown), "lchown" }, [ 17] = { 0, TM, SEN(break), "break" }, -[ 18] = { 2, TF, SEN(oldstat), "oldstat" }, +[ 18] = { 2, TF|TST|TSTA, SEN(oldstat), "oldstat" }, [ 19] = { 3, TD, SEN(lseek), "lseek" }, -[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 20] = { 0, PU|NF, SEN(getpid), "getpid" }, [ 21] = { 5, TF, SEN(mount), "mount" }, [ 22] = { 1, TF, SEN(umount), "umount" }, [ 23] = { 1, 0, SEN(setuid), "setuid" }, -[ 24] = { 0, NF, SEN(getuid), "getuid" }, +[ 24] = { 0, PU|NF, SEN(getuid), "getuid" }, [ 25] = { 1, 0, SEN(stime), "stime" }, [ 26] = { 4, 0, SEN(ptrace), "ptrace" }, [ 27] = { 1, 0, SEN(alarm), "alarm" }, -[ 28] = { 2, TD, SEN(oldfstat), "oldfstat" }, +[ 28] = { 2, TD|TFST|TSTA, SEN(oldfstat), "oldfstat" }, [ 29] = { 0, TS, SEN(pause), "pause" }, [ 30] = { 2, TF, SEN(utime), "utime" }, [ 31] = { 2, 0, SEN(stty), "stty" }, @@ -73,10 +54,10 @@ [ 44] = { 0, 0, SEN(prof), "prof" }, [ 45] = { 1, TM|SI, SEN(brk), "brk" }, [ 46] = { 1, 0, SEN(setgid), "setgid" }, -[ 47] = { 0, NF, SEN(getgid), "getgid" }, +[ 47] = { 0, PU|NF, SEN(getgid), "getgid" }, [ 48] = { 2, TS, SEN(signal), "signal" }, -[ 49] = { 0, NF, SEN(geteuid), "geteuid" }, -[ 50] = { 0, NF, SEN(getegid), "getegid" }, +[ 49] = { 0, PU|NF, SEN(geteuid), "geteuid" }, +[ 50] = { 0, PU|NF, SEN(getegid), "getegid" }, [ 51] = { 1, TF, SEN(acct), "acct" }, [ 52] = { 2, TF, SEN(umount2), "umount2" }, [ 53] = { 0, 0, SEN(lock), "lock" }, @@ -88,17 +69,17 @@ [ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, [ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, -[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 62] = { 2, TSFA, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, -[ 64] = { 0, NF, SEN(getppid), "getppid" }, -[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 64] = { 0, PU|NF, SEN(getppid), "getppid" }, +[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, [ 66] = { 0, 0, SEN(setsid), "setsid" }, [ 67] = { 3, TS, SEN(sigaction), "sigaction" }, -[ 68] = { 0, TS, SEN(siggetmask), "sgetmask" }, -[ 69] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[ 68] = { 0, TS, SEN(sgetmask), "sgetmask" }, +[ 69] = { 1, TS, SEN(ssetmask), "ssetmask" }, [ 70] = { 2, 0, SEN(setreuid), "setreuid" }, [ 71] = { 2, 0, SEN(setregid), "setregid" }, -[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, +[ 72] = { 1, TS, SEN(sigsuspend), "sigsuspend" }, [ 73] = { 1, TS, SEN(sigpending), "sigpending" }, [ 74] = { 2, 0, SEN(sethostname), "sethostname" }, [ 75] = { 2, 0, SEN(setrlimit), "setrlimit" }, @@ -110,7 +91,7 @@ [ 81] = { 2, 0, SEN(setgroups), "setgroups" }, [ 82] = { 1, TD, SEN(oldselect), "select" }, [ 83] = { 2, TF, SEN(symlink), "symlink" }, -[ 84] = { 2, TF, SEN(oldlstat), "oldlstat" }, +[ 84] = { 2, TF|TLST|TSTA, SEN(oldlstat), "oldlstat" }, [ 85] = { 3, TF, SEN(readlink), "readlink" }, [ 86] = { 1, TF, SEN(uselib), "uselib" }, [ 87] = { 2, TF, SEN(swapon), "swapon" }, @@ -125,16 +106,16 @@ [ 96] = { 2, 0, SEN(getpriority), "getpriority" }, [ 97] = { 3, 0, SEN(setpriority), "setpriority" }, [ 98] = { 4, 0, SEN(profil), "profil" }, -[ 99] = { 2, TF, SEN(statfs), "statfs" }, -[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, [101] = { 3, 0, SEN(ioperm), "ioperm" }, [102] = { 2, TD, SEN(socketcall), "socketcall" }, [103] = { 3, 0, SEN(syslog), "syslog" }, [104] = { 3, 0, SEN(setitimer), "setitimer" }, [105] = { 2, 0, SEN(getitimer), "getitimer" }, -[106] = { 2, TF, SEN(stat), "stat" }, -[107] = { 2, TF, SEN(lstat), "lstat" }, -[108] = { 2, TD, SEN(fstat), "fstat" }, +[106] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, +[107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, +[108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, [109] = { 1, 0, SEN(olduname), "olduname" }, [110] = { 1, 0, SEN(iopl), "iopl" }, [111] = { 0, 0, SEN(vhangup), "vhangup" }, @@ -150,7 +131,7 @@ [121] = { 2, 0, SEN(setdomainname), "setdomainname" }, [122] = { 1, 0, SEN(uname), "uname" }, [123] = { 5, 0, SEN(printargs), "modify_ldt" }, -[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[124] = { 1, 0, SEN(adjtimex64), "adjtimex" }, [125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, [126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, [127] = { 2, 0, SEN(create_module), "create_module" }, @@ -187,13 +168,13 @@ [158] = { 0, 0, SEN(sched_yield), "sched_yield" }, [159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, -[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[161] = { 2, 0, SEN(sched_rr_get_interval_time64),"sched_rr_get_interval"}, +[162] = { 2, 0, SEN(nanosleep_time64), "nanosleep" }, [163] = { 5, TM|SI, SEN(mremap), "mremap" }, [164] = { 3, 0, SEN(setresuid), "setresuid" }, [165] = { 3, 0, SEN(getresuid), "getresuid" }, [166] = { 5, 0, SEN(query_module), "query_module" }, -[167] = { 3, TD, SEN(poll), "poll" }, +[167] = { 3, TD, SEN(poll_time64), "poll" }, [168] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, [169] = { 3, 0, SEN(setresgid), "setresgid" }, [170] = { 3, 0, SEN(getresgid), "getresgid" }, @@ -202,7 +183,7 @@ [173] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, [174] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, [175] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[176] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[176] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait" }, [177] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, [178] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, [179] = { 4, TD, SEN(pread), "pread64" }, @@ -228,7 +209,7 @@ [204] = { }, [205] = { 3, TM, SEN(madvise), "madvise" }, [206] = { 3, TM, SEN(mincore), "mincore" }, -[207] = { 0, NF, SEN(gettid), "gettid" }, +[207] = { 0, PU|NF, SEN(gettid), "gettid" }, [208] = { 2, TS, SEN(kill), "tkill" }, [209] = { 5, TF, SEN(setxattr), "setxattr" }, [210] = { 5, TF, SEN(setxattr), "lsetxattr" }, @@ -242,7 +223,7 @@ [218] = { 2, TF, SEN(removexattr), "removexattr" }, [219] = { 2, TF, SEN(removexattr), "lremovexattr" }, [220] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, -[221] = { 6, 0, SEN(futex), "futex" }, +[221] = { 6, 0, SEN(futex_time64), "futex" }, [222] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [223] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [224] = { }, @@ -250,7 +231,7 @@ [226] = { }, [227] = { 2, TM, SEN(io_setup), "io_setup" }, [228] = { 1, TM, SEN(io_destroy), "io_destroy" }, -[229] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[229] = { 5, 0, SEN(io_getevents_time64), "io_getevents" }, [230] = { 3, 0, SEN(io_submit), "io_submit" }, [231] = { 3, 0, SEN(io_cancel), "io_cancel" }, [232] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, @@ -262,19 +243,19 @@ [238] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, [239] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, [240] = { 3, 0, SEN(timer_create), "timer_create" }, -[241] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[242] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[241] = { 4, 0, SEN(timer_settime64), "timer_settime" }, +[242] = { 2, 0, SEN(timer_gettime64), "timer_gettime" }, [243] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, [244] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[245] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[246] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[247] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[248] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[245] = { 2, 0, SEN(clock_settime64), "clock_settime" }, +[246] = { 2, 0, SEN(clock_gettime64), "clock_gettime" }, +[247] = { 2, 0, SEN(clock_getres_time64), "clock_getres" }, +[248] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep" }, [249] = { 2, 0, SEN(printargs), "swapcontext" }, [250] = { 3, TS, SEN(tgkill), "tgkill" }, [251] = { 2, TF, SEN(utimes), "utimes" }, -[252] = { 3, TF, SEN(statfs64), "statfs64" }, -[253] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[252] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, +[253] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, [254] = { }, [255] = { 1, 0, SEN(printargs), "rtas" }, [256] = { 5, 0, SEN(printargs), "sys_debug_setcontext" }, @@ -283,12 +264,12 @@ [259] = { 6, TM, SEN(mbind), "mbind" }, [260] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, [261] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, -[262] = { 4, 0, SEN(mq_open), "mq_open" }, +[262] = { 4, TD, SEN(mq_open), "mq_open" }, [263] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[264] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[265] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[266] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[267] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[264] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend" }, +[265] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive" }, +[266] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[267] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, [268] = { 4, 0, SEN(kexec_load), "kexec_load" }, [269] = { 5, 0, SEN(add_key), "add_key" }, [270] = { 4, 0, SEN(request_key), "request_key" }, @@ -297,12 +278,12 @@ [273] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, [274] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, [275] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[276] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[276] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, [277] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, [278] = { 3, 0, SEN(printargs), "spu_run" }, [279] = { 4, 0, SEN(printargs), "spu_create" }, -[280] = { 6, TD, SEN(pselect6), "pselect6" }, -[281] = { 5, TD, SEN(ppoll), "ppoll" }, +[280] = { 6, TD, SEN(pselect6_time64), "pselect6" }, +[281] = { 5, TD, SEN(ppoll_time64), "ppoll" }, [282] = { 1, TP, SEN(unshare), "unshare" }, [283] = { 6, TD, SEN(splice), "splice" }, [284] = { 4, TD, SEN(tee), "tee" }, @@ -312,7 +293,7 @@ [288] = { 4, TD|TF, SEN(mknodat), "mknodat" }, [289] = { 5, TD|TF, SEN(fchownat), "fchownat" }, [290] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[291] = { 4, TD|TF, SEN(newfstatat), "newfstatat" }, +[291] = { 4, TD|TF|TFST|TSTA,SEN(newfstatat), "newfstatat" }, [292] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, [293] = { 4, TD|TF, SEN(renameat), "renameat" }, [294] = { 5, TD|TF, SEN(linkat), "linkat" }, @@ -325,15 +306,15 @@ [301] = { 6, TM, SEN(move_pages), "move_pages" }, [302] = { 3, 0, SEN(getcpu), "getcpu" }, [303] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[304] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[304] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" }, [305] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [306] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [307] = { 1, TD, SEN(eventfd), "eventfd" }, [308] = { 4, TD, SEN(sync_file_range2), "sync_file_range2" }, [309] = { 4, TD, SEN(fallocate), "fallocate" }, [310] = { 3, 0, SEN(subpage_prot), "subpage_prot" }, -[311] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, -[312] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[311] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime" }, +[312] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime" }, [313] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, [314] = { 2, TD, SEN(eventfd2), "eventfd2" }, [315] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, @@ -364,11 +345,11 @@ [340] = { 5, TN, SEN(getsockopt), "getsockopt" }, [341] = { 3, TN, SEN(sendmsg), "sendmsg" }, [342] = { 3, TN, SEN(recvmsg), "recvmsg" }, -[343] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[343] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg" }, [344] = { 4, TN, SEN(accept4), "accept4" }, [345] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, [346] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[347] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[347] = { 2, 0, SEN(clock_adjtime64), "clock_adjtime" }, [348] = { 1, TD, SEN(syncfs), "syncfs" }, [349] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, [350] = { 2, TD, SEN(setns), "setns" }, @@ -387,23 +368,35 @@ [363] = { 0, 0, SEN(printargs), "switch_endian" }, [364] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, [365] = { 2, 0, SEN(membarrier), "membarrier" }, -[366] = { 3, TI, SEN(semop), "semop" }, -[367] = { 3, TI, SEN(semget), "semget" }, -[368] = { 4, TI, SEN(semctl), "semctl" }, -[369] = { 4, TI, SEN(semtimedop), "semtimedop" }, -[370] = { 4, TI, SEN(msgsnd), "msgsnd" }, -[371] = { 5, TI, SEN(msgrcv), "msgrcv" }, -[372] = { 2, TI, SEN(msgget), "msgget" }, -[373] = { 3, TI, SEN(msgctl), "msgctl" }, -[374] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, -[375] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, -[376] = { 3, TI, SEN(shmget), "shmget" }, -[377] = { 3, TI, SEN(shmctl), "shmctl" }, +/* originally left for IPC, now unused */ [378] = { 3, TM, SEN(mlock2), "mlock2" }, [379] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, [380] = { 6, TD, SEN(preadv2), "preadv2" }, [381] = { 6, TD, SEN(pwritev2), "pwritev2" }, [382] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" }, +[383] = { 5, TD|TF|TSTA, SEN(statx), "statx" }, +[384] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, +[385] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[386] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, +[387] = { 4, 0, SEN(rseq), "rseq" }, +[388] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents" }, +/* room for arch specific syscalls */ +[392] = { 4, TI, SEN(semtimedop_time64), "semtimedop" }, +[393] = { 3, TI, SEN(semget), "semget" }, +[394] = { 4, TI, SEN(semctl), "semctl" }, +[395] = { 3, TI, SEN(shmget), "shmget" }, +[396] = { 3, TI, SEN(shmctl), "shmctl" }, +[397] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[398] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[399] = { 2, TI, SEN(msgget), "msgget" }, +[400] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[401] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[402] = { 3, TI, SEN(msgctl), "msgctl" }, +/* [403 ... 423] - reserved to sync up with other architectures */ +[424] = { 4, TD|TS, SEN(pidfd_send_signal), "pidfd_send_signal" }, +[425] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" }, +[426] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" }, +[427] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" }, -#define SYS_socket_subcall 400 -#include "subcall.h" +#define SYS_socket_subcall 500 +#include "subcall64.h" diff --git a/linux/ptp_clock.h b/linux/ptp_clock.h deleted file mode 100644 index b65c834f..00000000 --- a/linux/ptp_clock.h +++ /dev/null @@ -1,98 +0,0 @@ -/* - * PTP 1588 clock support - user space interface - * - * Copyright (C) 2010 OMICRON electronics GmbH - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - -#ifndef _PTP_CLOCK_H_ -#define _PTP_CLOCK_H_ - -#include -#include - -/* PTP_xxx bits, for the flags field within the request structures. */ -#define PTP_ENABLE_FEATURE (1<<0) -#define PTP_RISING_EDGE (1<<1) -#define PTP_FALLING_EDGE (1<<2) - -/* - * struct ptp_clock_time - represents a time value - * - * The sign of the seconds field applies to the whole value. The - * nanoseconds field is always unsigned. The reserved field is - * included for sub-nanosecond resolution, should the demand for - * this ever appear. - * - */ -struct ptp_clock_time { - __s64 sec; /* seconds */ - __u32 nsec; /* nanoseconds */ - __u32 reserved; -}; - -struct ptp_clock_caps { - int max_adj; /* Maximum frequency adjustment in parts per billon. */ - int n_alarm; /* Number of programmable alarms. */ - int n_ext_ts; /* Number of external time stamp channels. */ - int n_per_out; /* Number of programmable periodic signals. */ - int pps; /* Whether the clock supports a PPS callback. */ - int rsv[15]; /* Reserved for future use. */ -}; - -struct ptp_extts_request { - unsigned int index; /* Which channel to configure. */ - unsigned int flags; /* Bit field for PTP_xxx flags. */ - unsigned int rsv[2]; /* Reserved for future use. */ -}; - -struct ptp_perout_request { - struct ptp_clock_time start; /* Absolute start time. */ - struct ptp_clock_time period; /* Desired period, zero means disable. */ - unsigned int index; /* Which channel to configure. */ - unsigned int flags; /* Reserved for future use. */ - unsigned int rsv[4]; /* Reserved for future use. */ -}; - -#define PTP_MAX_SAMPLES 25 /* Maximum allowed offset measurement samples. */ - -struct ptp_sys_offset { - unsigned int n_samples; /* Desired number of measurements. */ - unsigned int rsv[3]; /* Reserved for future use. */ - /* - * Array of interleaved system/phc time stamps. The kernel - * will provide 2*n_samples + 1 time stamps, with the last - * one as a system time stamp. - */ - struct ptp_clock_time ts[2 * PTP_MAX_SAMPLES + 1]; -}; - -#define PTP_CLK_MAGIC '=' - -#define PTP_CLOCK_GETCAPS _IOR(PTP_CLK_MAGIC, 1, struct ptp_clock_caps) -#define PTP_EXTTS_REQUEST _IOW(PTP_CLK_MAGIC, 2, struct ptp_extts_request) -#define PTP_PEROUT_REQUEST _IOW(PTP_CLK_MAGIC, 3, struct ptp_perout_request) -#define PTP_ENABLE_PPS _IOW(PTP_CLK_MAGIC, 4, int) -#define PTP_SYS_OFFSET _IOW(PTP_CLK_MAGIC, 5, struct ptp_sys_offset) - -struct ptp_extts_event { - struct ptp_clock_time t; /* Time event occured. */ - unsigned int index; /* Which channel produced the event. */ - unsigned int flags; /* Reserved for future use. */ - unsigned int rsv[2]; /* Reserved for future use. */ -}; - -#endif diff --git a/linux/ptrace_pokeuser.c b/linux/ptrace_pokeuser.c new file mode 100644 index 00000000..4a212a02 --- /dev/null +++ b/linux/ptrace_pokeuser.c @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +static long +ptrace_pokeuser(int pid, unsigned long off, kernel_ulong_t val) +{ + return ptrace(PTRACE_POKEUSER, pid, off, val); +} diff --git a/linux/raw_syscall.h b/linux/raw_syscall.h new file mode 100644 index 00000000..da84fa5f --- /dev/null +++ b/linux/raw_syscall.h @@ -0,0 +1 @@ +/* nothing */ diff --git a/linux/riscv/arch_defs_.h b/linux/riscv/arch_defs_.h new file mode 100644 index 00000000..a9c27bc7 --- /dev/null +++ b/linux/riscv/arch_defs_.h @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define HAVE_ARCH_UID16_SYSCALLS 1 +#define SUPPORTED_PERSONALITIES 2 +#define CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL 1 diff --git a/linux/riscv/arch_get_personality.c b/linux/riscv/arch_get_personality.c new file mode 100644 index 00000000..78cf4329 --- /dev/null +++ b/linux/riscv/arch_get_personality.c @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef AUDIT_ARCH_RISCV32 +# define AUDIT_ARCH_RISCV32 0x400000f3 +#endif + +int +get_personality_from_syscall_info(const struct ptrace_syscall_info *sci) +{ + return sci->arch == AUDIT_ARCH_RISCV32; +} diff --git a/linux/riscv/arch_regs.c b/linux/riscv/arch_regs.c index 40be17d9..cbf5a67e 100644 --- a/linux/riscv/arch_regs.c +++ b/linux/riscv/arch_regs.c @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static struct user_regs_struct riscv_regs; #define ARCH_REGS_FOR_GETREGSET riscv_regs #define ARCH_PC_REG riscv_regs.pc +#define ARCH_SP_REG riscv_regs.sp diff --git a/linux/riscv/errnoent1.h b/linux/riscv/errnoent1.h deleted file mode 100644 index 2a5c728c..00000000 --- a/linux/riscv/errnoent1.h +++ /dev/null @@ -1,2 +0,0 @@ -/* RISC-V rv32 and rv64 */ -#include "../errnoent.h" diff --git a/linux/riscv/get_error.c b/linux/riscv/get_error.c index be640d0a..d4066534 100644 --- a/linux/riscv/get_error.c +++ b/linux/riscv/get_error.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "negated_errno.h" + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { if (check_errno && is_negated_errno(riscv_regs.a0)) { tcp->u_rval = -1; diff --git a/linux/riscv/get_scno.c b/linux/riscv/get_scno.c index 0ca1ed34..6b4256e7 100644 --- a/linux/riscv/get_scno.c +++ b/linux/riscv/get_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) diff --git a/linux/riscv/get_syscall_args.c b/linux/riscv/get_syscall_args.c index 746e085c..9418b8e4 100644 --- a/linux/riscv/get_syscall_args.c +++ b/linux/riscv/get_syscall_args.c @@ -1,6 +1,13 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { tcp->u_arg[0] = riscv_regs.a0; tcp->u_arg[1] = riscv_regs.a1; diff --git a/linux/riscv/raw_syscall.h b/linux/riscv/raw_syscall.h new file mode 100644 index 00000000..e069b11c --- /dev/null +++ b/linux/riscv/raw_syscall.h @@ -0,0 +1,29 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + *err = 0; + register kernel_ulong_t a7 __asm__("a7") = nr; + register kernel_ulong_t a0 __asm__("a0"); + __asm__ __volatile__("scall" + : "=r"(a0) + : "r"(a7) + : "memory"); + return a0; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/riscv/set_error.c b/linux/riscv/set_error.c index 6d1eee4c..b9038c90 100644 --- a/linux/riscv/set_error.c +++ b/linux/riscv/set_error.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_error(struct tcb *tcp) { diff --git a/linux/riscv/set_scno.c b/linux/riscv/set_scno.c index 64c7db76..2c586ee9 100644 --- a/linux/riscv/set_scno.c +++ b/linux/riscv/set_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { diff --git a/linux/riscv/signalent1.h b/linux/riscv/signalent1.h deleted file mode 100644 index 39891b8f..00000000 --- a/linux/riscv/signalent1.h +++ /dev/null @@ -1,2 +0,0 @@ -/* RISC-V rv32 and rv64 */ -#include "../signalent.h" diff --git a/linux/riscv/syscallent.h b/linux/riscv/syscallent.h index 7c416ef1..b8274586 100644 --- a/linux/riscv/syscallent.h +++ b/linux/riscv/syscallent.h @@ -1 +1,11 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "64/syscallent.h" + +/* #define __NR_riscv_flush_icache (__NR_arch_specific_syscall + 15) */ +[259] = { 3, TM, SEN(riscv_flush_icache), "riscv_flush_icache" }, diff --git a/linux/rt_sigframe.h b/linux/rt_sigframe.h new file mode 100644 index 00000000..959db22b --- /dev/null +++ b/linux/rt_sigframe.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RT_SIGFRAME_H +# define STRACE_RT_SIGFRAME_H + +# include + +/* This is a generic definition for compatible architectures. */ + +typedef struct { + siginfo_t info; + ucontext_t uc; + /* more data might follow */ +} struct_rt_sigframe; + +#endif /* !STRACE_RT_SIGFRAME_H */ diff --git a/linux/s390/arch_defs_.h b/linux/s390/arch_defs_.h new file mode 100644 index 00000000..39b7658d --- /dev/null +++ b/linux/s390/arch_defs_.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define HAVE_ARCH_OLD_MMAP 1 +#define HAVE_ARCH_OLD_MMAP_PGOFF 1 +#define HAVE_ARCH_UID16_SYSCALLS 1 +#define CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL 1 diff --git a/linux/s390/arch_regs.c b/linux/s390/arch_regs.c index fefb7630..dd872ca3 100644 --- a/linux/s390/arch_regs.c +++ b/linux/s390/arch_regs.c @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* PTRACE_GETREGSET on S390 is available since linux v2.6.27. */ static struct user_regs_struct s390_regset; -unsigned long *const s390_frame_ptr = &s390_regset.gprs[15]; #define ARCH_REGS_FOR_GETREGSET s390_regset #define ARCH_PC_REG s390_regset.psw.addr +#define ARCH_SP_REG s390_regset.gprs[15] diff --git a/linux/s390/arch_regs.h b/linux/s390/arch_regs.h deleted file mode 100644 index 586326ff..00000000 --- a/linux/s390/arch_regs.h +++ /dev/null @@ -1 +0,0 @@ -extern unsigned long *const s390_frame_ptr; diff --git a/linux/s390/arch_sigreturn.c b/linux/s390/arch_sigreturn.c index d1b85986..1efa5489 100644 --- a/linux/s390/arch_sigreturn.c +++ b/linux/s390/arch_sigreturn.c @@ -1,12 +1,28 @@ +/* + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef SIGNAL_FRAMESIZE +# define SIGNAL_FRAMESIZE 96 +#endif +#ifndef PTR_TYPE +# define PTR_TYPE unsigned long +#endif + static void arch_sigreturn(struct tcb *tcp) { - unsigned long mask[NSIG_BYTES / sizeof(long)]; - const unsigned long addr = *s390_frame_ptr + __SIGNAL_FRAMESIZE; + kernel_ulong_t addr; + + if (!get_stack_pointer(tcp, &addr)) + return; + addr += SIGNAL_FRAMESIZE; - if (umove(tcp, addr, &mask) < 0) { - tprintf("{mask=%#lx}", addr); - } else { + PTR_TYPE mask[NSIG_BYTES / sizeof(PTR_TYPE)]; + if (!umove_or_printaddr(tcp, addr, &mask)) { tprintsigmask_addr("{mask=", mask); tprints("}"); } diff --git a/linux/s390/get_error.c b/linux/s390/get_error.c index f491962d..5b580130 100644 --- a/linux/s390/get_error.c +++ b/linux/s390/get_error.c @@ -1,10 +1,23 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "negated_errno.h" + +#ifndef ARCH_REGSET +# define ARCH_REGSET s390_regset +#endif + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { - if (check_errno && is_negated_errno(s390_regset.gprs[2])) { + if (check_errno && is_negated_errno(ARCH_REGSET.gprs[2])) { tcp->u_rval = -1; - tcp->u_error = -s390_regset.gprs[2]; + tcp->u_error = -ARCH_REGSET.gprs[2]; } else { - tcp->u_rval = s390_regset.gprs[2]; + tcp->u_rval = ARCH_REGSET.gprs[2]; } } diff --git a/linux/s390/get_scno.c b/linux/s390/get_scno.c index d323860d..2af6c8e6 100644 --- a/linux/s390/get_scno.c +++ b/linux/s390/get_scno.c @@ -1,8 +1,19 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef ARCH_REGSET +# define ARCH_REGSET s390_regset +#endif + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) { - tcp->scno = s390_regset.gprs[2] ? - s390_regset.gprs[2] : s390_regset.gprs[1]; + tcp->scno = ARCH_REGSET.gprs[2] ? + ARCH_REGSET.gprs[2] : ARCH_REGSET.gprs[1]; return 1; } diff --git a/linux/s390/get_syscall_args.c b/linux/s390/get_syscall_args.c index ebf6c6c4..66570ff5 100644 --- a/linux/s390/get_syscall_args.c +++ b/linux/s390/get_syscall_args.c @@ -1,12 +1,23 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef ARCH_REGSET +# define ARCH_REGSET s390_regset +#endif + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { - tcp->u_arg[0] = s390_regset.orig_gpr2; - tcp->u_arg[1] = s390_regset.gprs[3]; - tcp->u_arg[2] = s390_regset.gprs[4]; - tcp->u_arg[3] = s390_regset.gprs[5]; - tcp->u_arg[4] = s390_regset.gprs[6]; - tcp->u_arg[5] = s390_regset.gprs[7]; + tcp->u_arg[0] = ARCH_REGSET.orig_gpr2; + tcp->u_arg[1] = ARCH_REGSET.gprs[3]; + tcp->u_arg[2] = ARCH_REGSET.gprs[4]; + tcp->u_arg[3] = ARCH_REGSET.gprs[5]; + tcp->u_arg[4] = ARCH_REGSET.gprs[6]; + tcp->u_arg[5] = ARCH_REGSET.gprs[7]; return 1; } diff --git a/linux/s390/ioctls_arch0.h b/linux/s390/ioctls_arch0.h index a287f0f8..db6204e4 100644 --- a/linux/s390/ioctls_arch0.h +++ b/linux/s390/ioctls_arch0.h @@ -37,37 +37,48 @@ { "asm/dasd.h", "DASDAPIVER", _IOC_READ, 0x4400, 0x04 }, { "asm/hypfs.h", "HYPFS_DIAG304", _IOC_READ|_IOC_WRITE, 0x1020, 0x18 }, { "asm/ioctls.h", "FIOQSIZE", 0, 0x545E, 0 }, +{ "asm/pkey.h", "PKEY_CLR2PROTK", _IOC_READ|_IOC_WRITE, 0x7004, 0x6c }, +{ "asm/pkey.h", "PKEY_CLR2SECK", _IOC_READ|_IOC_WRITE, 0x7002, 0x68 }, +{ "asm/pkey.h", "PKEY_FINDCARD", _IOC_READ|_IOC_WRITE, 0x7005, 0x44 }, +{ "asm/pkey.h", "PKEY_GENPROTK", _IOC_READ|_IOC_WRITE, 0x7008, 0x4c }, +{ "asm/pkey.h", "PKEY_GENSECK", _IOC_READ|_IOC_WRITE, 0x7001, 0x48 }, +{ "asm/pkey.h", "PKEY_KBLOB2PROTK", _IOC_READ|_IOC_WRITE, 0x700a, 0x50 }, +{ "asm/pkey.h", "PKEY_SEC2PROTK", _IOC_READ|_IOC_WRITE, 0x7003, 0x8c }, +{ "asm/pkey.h", "PKEY_SKEY2PKEY", _IOC_READ|_IOC_WRITE, 0x7006, 0x88 }, +{ "asm/pkey.h", "PKEY_VERIFYKEY", _IOC_READ|_IOC_WRITE, 0x7007, 0x4c }, +{ "asm/pkey.h", "PKEY_VERIFYPROTK", _IOC_WRITE, 0x7009, 0x48 }, { "asm/sclp_ctl.h", "SCLP_CTL_SCCB", _IOC_READ|_IOC_WRITE, 0x1010, 0x0c }, { "asm/tape390.h", "TAPE390_CRYPT_QUERY", _IOC_READ, 0x6403, 0x03 }, { "asm/tape390.h", "TAPE390_CRYPT_SET", _IOC_WRITE, 0x6402, 0x03 }, { "asm/tape390.h", "TAPE390_DISPLAY", _IOC_WRITE, 0x6401, 0x11 }, { "asm/tape390.h", "TAPE390_KEKL_QUERY", _IOC_READ, 0x6405, 0x86 }, { "asm/tape390.h", "TAPE390_KEKL_SET", _IOC_WRITE, 0x6404, 0x86 }, +{ "asm/vmcp.h", "VMCP_GETCODE", _IOC_READ, 0x1001, 0x04 }, +{ "asm/vmcp.h", "VMCP_GETSIZE", _IOC_READ, 0x1003, 0x04 }, +{ "asm/vmcp.h", "VMCP_SETBUF", _IOC_WRITE, 0x1002, 0x04 }, { "asm/zcrypt.h", "ICARSACRT", _IOC_READ|_IOC_WRITE, 0x7a06, 0x00 }, { "asm/zcrypt.h", "ICARSAMODEXPO", _IOC_READ|_IOC_WRITE, 0x7a05, 0x00 }, -{ "asm/zcrypt.h", "Z90STAT_CEX2ACOUNT", _IOC_READ, 0x7a4e, 0x04 }, -{ "asm/zcrypt.h", "Z90STAT_CEX2CCOUNT", _IOC_READ, 0x7a4d, 0x04 }, { "asm/zcrypt.h", "Z90STAT_DOMAIN_INDEX", _IOC_READ, 0x7a47, 0x04 }, -{ "asm/zcrypt.h", "Z90STAT_PCICACOUNT", _IOC_READ, 0x7a41, 0x04 }, -{ "asm/zcrypt.h", "Z90STAT_PCICCCOUNT", _IOC_READ, 0x7a42, 0x04 }, -{ "asm/zcrypt.h", "Z90STAT_PCIXCCMCL2COUNT", _IOC_READ, 0x7a4b, 0x04 }, -{ "asm/zcrypt.h", "Z90STAT_PCIXCCMCL3COUNT", _IOC_READ, 0x7a4c, 0x04 }, { "asm/zcrypt.h", "Z90STAT_PENDINGQ_COUNT", _IOC_READ, 0x7a45, 0x04 }, { "asm/zcrypt.h", "Z90STAT_PERDEV_REQCNT", _IOC_READ, 0x7a4a, 0x100 }, { "asm/zcrypt.h", "Z90STAT_QDEPTH_MASK", _IOC_READ, 0x7a49, 0x40 }, { "asm/zcrypt.h", "Z90STAT_REQUESTQ_COUNT", _IOC_READ, 0x7a44, 0x04 }, { "asm/zcrypt.h", "Z90STAT_STATUS_MASK", _IOC_READ, 0x7a48, 0x40 }, -{ "asm/zcrypt.h", "Z90STAT_TOTALCOUNT", _IOC_READ, 0x7a40, 0x04 }, { "asm/zcrypt.h", "Z90STAT_TOTALOPEN_COUNT", _IOC_READ, 0x7a46, 0x04 }, +{ "asm/zcrypt.h", "ZCRYPT_DEVICE_STATUS", _IOC_READ|_IOC_WRITE, 0x7a5f, 0x00 }, +{ "asm/zcrypt.h", "ZCRYPT_PERDEV_REQCNT", _IOC_READ, 0x7a5a, 0x400 }, +{ "asm/zcrypt.h", "ZCRYPT_QDEPTH_MASK", _IOC_READ, 0x7a59, 0x100 }, +{ "asm/zcrypt.h", "ZCRYPT_STATUS_MASK", _IOC_READ, 0x7a58, 0x100 }, +{ "asm/zcrypt.h", "ZDEVICESTATUS", _IOC_READ|_IOC_WRITE, 0x7a4f, 0x00 }, { "asm/zcrypt.h", "ZSECSENDCPRB", _IOC_READ|_IOC_WRITE, 0x7a81, 0x00 }, { "asm/zcrypt.h", "ZSENDEP11CPRB", _IOC_READ|_IOC_WRITE, 0x7a04, 0x00 }, -{ "linux/kvm.h", "KVM_ARM_SET_DEVICE_ADDR", _IOC_WRITE, 0xaeab, 0x10 }, { "linux/kvm.h", "KVM_ASSIGN_DEV_IRQ", _IOC_WRITE, 0xae70, 0x40 }, { "linux/kvm.h", "KVM_ASSIGN_PCI_DEVICE", _IOC_READ, 0xae69, 0x40 }, { "linux/kvm.h", "KVM_ASSIGN_SET_INTX_MASK", _IOC_WRITE, 0xaea4, 0x40 }, { "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_ENTRY", _IOC_WRITE, 0xae74, 0x10 }, { "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_NR", _IOC_WRITE, 0xae73, 0x08 }, { "linux/kvm.h", "KVM_CHECK_EXTENSION", _IOC_NONE, 0xae03, 0x00 }, +{ "linux/kvm.h", "KVM_CLEAR_DIRTY_LOG", _IOC_READ|_IOC_WRITE, 0xaec0, 0x18 }, { "linux/kvm.h", "KVM_CREATE_DEVICE", _IOC_READ|_IOC_WRITE, 0xaee0, 0x0c }, { "linux/kvm.h", "KVM_CREATE_IRQCHIP", _IOC_NONE, 0xae60, 0x00 }, { "linux/kvm.h", "KVM_CREATE_PIT", _IOC_NONE, 0xae64, 0x00 }, @@ -99,20 +110,22 @@ { "linux/kvm.h", "KVM_IRQ_LINE", _IOC_WRITE, 0xae61, 0x08 }, { "linux/kvm.h", "KVM_IRQ_LINE_STATUS", _IOC_READ|_IOC_WRITE, 0xae67, 0x08 }, { "linux/kvm.h", "KVM_KVMCLOCK_CTRL", _IOC_NONE, 0xaead, 0x00 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_OP", _IOC_READ|_IOC_WRITE, 0xaeba, 0x04 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_REG_REGION", _IOC_READ, 0xaebb, 0x10 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_UNREG_REGION", _IOC_READ, 0xaebc, 0x10 }, { "linux/kvm.h", "KVM_NMI", _IOC_NONE, 0xae9a, 0x00 }, -{ "linux/kvm.h", "KVM_PPC_ALLOCATE_HTAB", _IOC_READ|_IOC_WRITE, 0xaea7, 0x04 }, -{ "linux/kvm.h", "KVM_PPC_GET_PVINFO", _IOC_WRITE, 0xaea1, 0x80 }, -{ "linux/kvm.h", "KVM_PPC_GET_SMMU_INFO", _IOC_READ, 0xaea6, 0x250 }, { "linux/kvm.h", "KVM_REGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae67, 0x10 }, { "linux/kvm.h", "KVM_REINJECT_CONTROL", _IOC_NONE, 0xae71, 0x00 }, { "linux/kvm.h", "KVM_RUN", _IOC_NONE, 0xae80, 0x00 }, { "linux/kvm.h", "KVM_S390_ENABLE_SIE", _IOC_NONE, 0xae06, 0x00 }, +{ "linux/kvm.h", "KVM_S390_GET_CMMA_BITS", _IOC_READ|_IOC_WRITE, 0xaeb8, 0x20 }, { "linux/kvm.h", "KVM_S390_GET_IRQ_STATE", _IOC_WRITE, 0xaeb6, 0x20 }, { "linux/kvm.h", "KVM_S390_GET_SKEYS", _IOC_WRITE, 0xaeb2, 0x40 }, { "linux/kvm.h", "KVM_S390_INITIAL_RESET", _IOC_NONE, 0xae97, 0x00 }, { "linux/kvm.h", "KVM_S390_INTERRUPT", _IOC_WRITE, 0xae94, 0x10 }, { "linux/kvm.h", "KVM_S390_IRQ", _IOC_WRITE, 0xaeb4, 0x48 }, { "linux/kvm.h", "KVM_S390_MEM_OP", _IOC_WRITE, 0xaeb1, 0x40 }, +{ "linux/kvm.h", "KVM_S390_SET_CMMA_BITS", _IOC_WRITE, 0xaeb9, 0x20 }, { "linux/kvm.h", "KVM_S390_SET_INITIAL_PSW", _IOC_WRITE, 0xae96, 0x10 }, { "linux/kvm.h", "KVM_S390_SET_IRQ_STATE", _IOC_WRITE, 0xaeb5, 0x20 }, { "linux/kvm.h", "KVM_S390_SET_SKEYS", _IOC_WRITE, 0xaeb3, 0x40 }, @@ -144,5 +157,3 @@ { "linux/kvm.h", "KVM_TPR_ACCESS_REPORTING", _IOC_READ|_IOC_WRITE, 0xae92, 0x28 }, { "linux/kvm.h", "KVM_TRANSLATE", _IOC_READ|_IOC_WRITE, 0xae85, 0x18 }, { "linux/kvm.h", "KVM_UNREGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae68, 0x10 }, -{ "linux/kvm.h", "KVM_X86_GET_MCE_CAP_SUPPORTED", _IOC_READ, 0xae9d, 0x08 }, -{ "linux/kvm.h", "KVM_X86_SETUP_MCE", _IOC_WRITE, 0xae9c, 0x08 }, diff --git a/linux/s390/raw_syscall.h b/linux/s390/raw_syscall.h new file mode 100644 index 00000000..96d6230e --- /dev/null +++ b/linux/s390/raw_syscall.h @@ -0,0 +1,29 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + *err = 0; + register kernel_ulong_t r1 __asm__("r1") = nr; + register kernel_ulong_t r2 __asm__("r2"); + __asm__ __volatile__("svc 0" + : "=r"(r2) + : "r"(r1) + : "memory"); + return r2; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/s390/rt_sigframe.h b/linux/s390/rt_sigframe.h new file mode 100644 index 00000000..5c392652 --- /dev/null +++ b/linux/s390/rt_sigframe.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * Copyright (c) 2017-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RT_SIGFRAME_H +# define STRACE_RT_SIGFRAME_H + +# include + +# ifdef __s390x__ +# define SIGNAL_FRAMESIZE 160 +# else /* __s390__ */ +# define SIGNAL_FRAMESIZE 96 +# endif + +typedef struct { + uint8_t callee_used_stack[SIGNAL_FRAMESIZE]; + uint16_t svc_insn; + siginfo_t info; + ucontext_t uc; +} struct_rt_sigframe; + +#endif /* !STRACE_RT_SIGFRAME_H */ diff --git a/linux/s390/set_error.c b/linux/s390/set_error.c index 7262e5ce..f71865ef 100644 --- a/linux/s390/set_error.c +++ b/linux/s390/set_error.c @@ -1,13 +1,24 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef ARCH_REGSET +# define ARCH_REGSET s390_regset +#endif + static int arch_set_error(struct tcb *tcp) { - s390_regset.gprs[2] = -tcp->u_error; + ARCH_REGSET.gprs[2] = -tcp->u_error; return set_regs(tcp->pid); } static int arch_set_success(struct tcb *tcp) { - s390_regset.gprs[2] = tcp->u_rval; + ARCH_REGSET.gprs[2] = tcp->u_rval; return set_regs(tcp->pid); } diff --git a/linux/s390/set_scno.c b/linux/s390/set_scno.c index c7a31100..650deecb 100644 --- a/linux/s390/set_scno.c +++ b/linux/s390/set_scno.c @@ -1,6 +1,17 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef ARCH_REGSET +# define ARCH_REGSET s390_regset +#endif + static int arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { - s390_regset.gprs[2] = scno; + ARCH_REGSET.gprs[2] = scno; return set_regs(tcp->pid); } diff --git a/linux/s390/syscallent.h b/linux/s390/syscallent.h index 6f841c77..24cd190b 100644 --- a/linux/s390/syscallent.h +++ b/linux/s390/syscallent.h @@ -1,30 +1,11 @@ /* * Copyright (c) 2000 IBM Deutschland Entwicklung GmbH, IBM Coporation + * Copyright (c) 2000-2019 The strace developers. * Authors: Ulrich Weigand * D.J. Barrow * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later * */ @@ -48,11 +29,11 @@ [ 17] = { }, [ 18] = { }, [ 19] = { 3, TD, SEN(lseek), "lseek" }, -[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 20] = { 0, PU|NF, SEN(getpid), "getpid" }, [ 21] = { 5, TF, SEN(mount), "mount" }, [ 22] = { 1, TF, SEN(umount), "umount" }, [ 23] = { 1, 0, SEN(setuid16), "setuid" }, -[ 24] = { 0, NF, SEN(getuid16), "getuid" }, +[ 24] = { 0, PU|NF, SEN(getuid16), "getuid" }, [ 25] = { 1, 0, SEN(stime), "stime" }, [ 26] = { 4, 0, SEN(ptrace), "ptrace" }, [ 27] = { 1, 0, SEN(alarm), "alarm" }, @@ -75,10 +56,10 @@ [ 44] = { }, [ 45] = { 1, TM|SI, SEN(brk), "brk" }, [ 46] = { 1, 0, SEN(setgid16), "setgid" }, -[ 47] = { 0, NF, SEN(getgid16), "getgid" }, +[ 47] = { 0, PU|NF, SEN(getgid16), "getgid" }, [ 48] = { 2, TS, SEN(signal), "signal" }, -[ 49] = { 0, NF, SEN(geteuid16), "geteuid" }, -[ 50] = { 0, NF, SEN(getegid16), "getegid" }, +[ 49] = { 0, PU|NF, SEN(geteuid16), "geteuid" }, +[ 50] = { 0, PU|NF, SEN(getegid16), "getegid" }, [ 51] = { 1, TF, SEN(acct), "acct" }, [ 52] = { 2, TF, SEN(umount2), "umount2" }, [ 53] = { }, @@ -90,10 +71,10 @@ [ 59] = { }, [ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, -[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 62] = { 2, TSFA, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, -[ 64] = { 0, NF, SEN(getppid), "getppid" }, -[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 64] = { 0, PU|NF, SEN(getppid), "getppid" }, +[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, [ 66] = { 0, 0, SEN(setsid), "setsid" }, [ 67] = { 3, TS, SEN(sigaction), "sigaction" }, [ 68] = { }, @@ -127,16 +108,16 @@ [ 96] = { 2, 0, SEN(getpriority), "getpriority" }, [ 97] = { 3, 0, SEN(setpriority), "setpriority" }, [ 98] = { }, -[ 99] = { 2, TF, SEN(statfs), "statfs" }, -[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, [101] = { 3, 0, SEN(ioperm), "ioperm" }, [102] = { 2, TD, SEN(socketcall), "socketcall" }, [103] = { 3, 0, SEN(syslog), "syslog" }, [104] = { 3, 0, SEN(setitimer), "setitimer" }, [105] = { 2, 0, SEN(getitimer), "getitimer" }, -[106] = { 2, TF, SEN(stat), "stat" }, -[107] = { 2, TF, SEN(lstat), "lstat" }, -[108] = { 2, TD, SEN(fstat), "fstat" }, +[106] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, +[107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, +[108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, [109] = { }, [110] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" }, [111] = { 0, 0, SEN(vhangup), "vhangup" }, @@ -152,7 +133,7 @@ [121] = { 2, 0, SEN(setdomainname), "setdomainname" }, [122] = { 1, 0, SEN(uname), "uname" }, [123] = { }, -[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[124] = { 1, 0, SEN(adjtimex32), "adjtimex" }, [125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, [126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, [127] = { 2, 0, SEN(create_module), "create_module" }, @@ -189,23 +170,23 @@ [158] = { 0, 0, SEN(sched_yield), "sched_yield" }, [159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, -[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[161] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"}, +[162] = { 2, 0, SEN(nanosleep_time32), "nanosleep" }, [163] = { 5, TM|SI, SEN(mremap), "mremap" }, [164] = { 3, 0, SEN(setresuid16), "setresuid" }, [165] = { 3, 0, SEN(getresuid16), "getresuid" }, [166] = { }, [167] = { 5, 0, SEN(query_module), "query_module" }, -[168] = { 3, TD, SEN(poll), "poll" }, +[168] = { 3, TD, SEN(poll_time32), "poll" }, [169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, [170] = { 3, 0, SEN(setresgid16), "setresgid" }, [171] = { 3, 0, SEN(getresgid16), "getresgid" }, [172] = { 5, 0, SEN(prctl), "prctl" }, -[173] = { 0, TS, SEN(sigreturn), "rt_sigreturn" }, +[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, [174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, [175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, [176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[177] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[177] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" }, [178] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, [179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, [180] = { 5, TD, SEN(pread), "pread64" }, @@ -223,14 +204,14 @@ [192] = { 1, TD|TM|SI, SEN(old_mmap_pgoff), "mmap2" }, [193] = { 3, TF, SEN(truncate64), "truncate64" }, [194] = { 3, TD, SEN(ftruncate64), "ftruncate64" }, -[195] = { 2, TF, SEN(stat64), "stat64" }, -[196] = { 2, TF, SEN(lstat64), "lstat64" }, -[197] = { 2, TD, SEN(fstat64), "fstat64" }, +[195] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" }, +[196] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" }, +[197] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" }, [198] = { 3, TF, SEN(chown), "lchown32" }, -[199] = { 0, NF, SEN(getuid), "getuid32" }, -[200] = { 0, NF, SEN(getgid), "getgid32" }, -[201] = { 0, NF, SEN(geteuid), "geteuid32" }, -[202] = { 0, NF, SEN(getegid), "getegid32" }, +[199] = { 0, PU|NF, SEN(getuid), "getuid32" }, +[200] = { 0, PU|NF, SEN(getgid), "getgid32" }, +[201] = { 0, PU|NF, SEN(geteuid), "geteuid32" }, +[202] = { 0, PU|NF, SEN(getegid), "getegid32" }, [203] = { 2, 0, SEN(setreuid), "setreuid32" }, [204] = { 2, 0, SEN(setregid), "setregid32" }, [205] = { 2, 0, SEN(getgroups), "getgroups32" }, @@ -264,16 +245,16 @@ [233] = { 2, TF, SEN(removexattr), "removexattr" }, [234] = { 2, TF, SEN(removexattr), "lremovexattr" }, [235] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, -[236] = { 0, NF, SEN(gettid), "gettid" }, +[236] = { 0, PU|NF, SEN(gettid), "gettid" }, [237] = { 2, TS, SEN(kill), "tkill" }, -[238] = { 6, 0, SEN(futex), "futex" }, +[238] = { 6, 0, SEN(futex_time32), "futex" }, [239] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [240] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [241] = { 3, TS, SEN(tgkill), "tgkill" }, [242] = { }, [243] = { 2, TM, SEN(io_setup), "io_setup" }, [244] = { 1, TM, SEN(io_destroy), "io_destroy" }, -[245] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[245] = { 5, 0, SEN(io_getevents_time32), "io_getevents" }, [246] = { 3, 0, SEN(io_submit), "io_submit" }, [247] = { 3, 0, SEN(io_cancel), "io_cancel" }, [248] = { 1, TP|SE, SEN(exit), "exit_group" }, @@ -283,28 +264,28 @@ [252] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [253] = { 5, TD, SEN(fadvise64), "fadvise64" }, [254] = { 3, 0, SEN(timer_create), "timer_create" }, -[255] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[256] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[255] = { 4, 0, SEN(timer_settime32), "timer_settime" }, +[256] = { 2, 0, SEN(timer_gettime32), "timer_gettime" }, [257] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, [258] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[259] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[260] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[261] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[262] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[259] = { 2, 0, SEN(clock_settime32), "clock_settime" }, +[260] = { 2, 0, SEN(clock_gettime32), "clock_gettime" }, +[261] = { 2, 0, SEN(clock_getres_time32), "clock_getres" }, +[262] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" }, [263] = { 5, 0, SEN(vserver), "vserver" }, [264] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, -[265] = { 3, TF, SEN(statfs64), "statfs64" }, -[266] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[265] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, +[266] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, [267] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, [268] = { 6, TM, SEN(mbind), "mbind" }, [269] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, [270] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, -[271] = { 4, 0, SEN(mq_open), "mq_open" }, +[271] = { 4, TD, SEN(mq_open), "mq_open" }, [272] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[273] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[274] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[275] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[276] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[273] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" }, +[274] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" }, +[275] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[276] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, [277] = { 4, 0, SEN(kexec_load), "kexec_load" }, [278] = { 5, 0, SEN(add_key), "add_key" }, [279] = { 4, 0, SEN(request_key), "request_key" }, @@ -313,7 +294,7 @@ [282] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, [283] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, [284] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[285] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[285] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, [286] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, [287] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, [288] = { 4, TD|TF, SEN(openat), "openat" }, @@ -321,7 +302,7 @@ [290] = { 4, TD|TF, SEN(mknodat), "mknodat" }, [291] = { 5, TD|TF, SEN(fchownat), "fchownat" }, [292] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[293] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[293] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" }, [294] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, [295] = { 4, TD|TF, SEN(renameat), "renameat" }, [296] = { 5, TD|TF, SEN(linkat), "linkat" }, @@ -329,8 +310,8 @@ [298] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, [299] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, [300] = { 3, TD|TF, SEN(faccessat), "faccessat" }, -[301] = { 6, TD, SEN(pselect6), "pselect6" }, -[302] = { 5, TD, SEN(ppoll), "ppoll" }, +[301] = { 6, TD, SEN(pselect6_time32), "pselect6" }, +[302] = { 5, TD, SEN(ppoll_time32), "ppoll" }, [303] = { 1, TP, SEN(unshare), "unshare" }, [304] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, [305] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, @@ -343,13 +324,13 @@ [312] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, [313] = { 2, TF, SEN(utimes), "utimes" }, [314] = { 6, TD, SEN(fallocate), "fallocate" }, -[315] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[315] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [316] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [317] = { 4, TD, SEN(timerfd), "timerfd" }, [318] = { 1, TD, SEN(eventfd), "eventfd" }, [319] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, -[320] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, -[321] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[320] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" }, +[321] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" }, [322] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, [323] = { 2, TD, SEN(eventfd2), "eventfd2" }, [324] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, @@ -365,12 +346,12 @@ [334] = { 4, 0, SEN(prlimit64), "prlimit64" }, [335] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, [336] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[337] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[337] = { 2, 0, SEN(clock_adjtime32), "clock_adjtime" }, [338] = { 1, TD, SEN(syncfs), "syncfs" }, [339] = { 2, TD, SEN(setns), "setns" }, [340] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, [341] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, -[342] = { 2, 0, SEN(printargs), "s390_runtime_instr" }, +[342] = { 2, 0, SEN(s390_runtime_instr), "s390_runtime_instr" }, [343] = { 5, 0, SEN(kcmp), "kcmp" }, [344] = { 3, TD, SEN(finit_module), "finit_module" }, [345] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, @@ -380,12 +361,12 @@ [349] = { 3, 0, SEN(getrandom), "getrandom" }, [350] = { 2, TD, SEN(memfd_create), "memfd_create" }, [351] = { 3, TD, SEN(bpf), "bpf" }, -[352] = { 3, 0, SEN(printargs), "s390_pci_mmio_write" }, -[353] = { 3, 0, SEN(printargs), "s390_pci_mmio_read" }, +[352] = { 3, 0, SEN(s390_pci_mmio_write), "s390_pci_mmio_write" }, +[353] = { 3, 0, SEN(s390_pci_mmio_read), "s390_pci_mmio_read" }, [354] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, [355] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, [356] = { 2, 0, SEN(membarrier), "membarrier" }, -[357] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[357] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" }, [358] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, [359] = { 3, TN, SEN(socket), "socket" }, [360] = { 4, TN, SEN(socketpair), "socketpair" }, @@ -406,6 +387,50 @@ [375] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, [376] = { 6, TD, SEN(preadv2), "preadv2" }, [377] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[378] = { 2, 0, SEN(s390_guarded_storage), "s390_guarded_storage" }, +[379] = { 5, TD|TF|TSTA, SEN(statx), "statx" }, +[380] = { 4, 0, SEN(s390_sthyi), "s390_sthyi" }, +[381] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" }, +[382] = { 6, 0, SEN(io_pgetevents_time32), "io_pgetevents" }, +[383] = { 4, 0, SEN(rseq), "rseq" }, +[384] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, +[385] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, +[386] = { 1, 0, SEN(pkey_free), "pkey_free" }, +/* room for arch specific calls */ +[393] = { 3, TI, SEN(semget), "semget" }, +[394] = { 4, TI, SEN(semctl), "semctl" }, +[395] = { 3, TI, SEN(shmget), "shmget" }, +[396] = { 3, TI, SEN(shmctl), "shmctl" }, +[397] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[398] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[399] = { 2, TI, SEN(msgget), "msgget" }, +[400] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[401] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[402] = { 3, TI, SEN(msgctl), "msgctl" }, +[403] = { 2, 0, SEN(clock_gettime64), "clock_gettime64" }, +[404] = { 2, 0, SEN(clock_settime64), "clock_settime64" }, +[405] = { 2, 0, SEN(clock_adjtime64), "clock_adjtime64" }, +[406] = { 2, 0, SEN(clock_getres_time64), "clock_getres_time64" }, +[407] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep_time64"}, +[408] = { 2, 0, SEN(timer_gettime64), "timer_gettime64" }, +[409] = { 4, 0, SEN(timer_settime64), "timer_settime64" }, +[410] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime64" }, +[411] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime64" }, +[412] = { 4, TD|TF, SEN(utimensat_time64), "utimensat_time64" }, +[413] = { 6, TD, SEN(pselect6_time64), "pselect6_time64" }, +[414] = { 5, TD, SEN(ppoll_time64), "ppoll_time64" }, +[416] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents_time64" }, +[417] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg_time64" }, +[418] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend_time64" }, +[419] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive_time64"}, +[420] = { 4, TI, SEN(semtimedop_time64), "semtimedop_time64" }, +[421] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait_time64"}, +[422] = { 6, 0, SEN(futex_time64), "futex_time64" }, +[423] = { 2, 0, SEN(sched_rr_get_interval_time64), "sched_rr_get_interval_time64" }, +[424] = { 4, TD|TS, SEN(pidfd_send_signal), "pidfd_send_signal" }, +[425] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" }, +[426] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" }, +[427] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" }, -#define SYS_socket_subcall 400 -#include "subcall.h" +#define SYS_socket_subcall 500 +#include "subcall32.h" diff --git a/linux/s390/userent.h b/linux/s390/userent.h index f9c71d8a..8ba070b9 100644 --- a/linux/s390/userent.h +++ b/linux/s390/userent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "userent0.h" { PT_FPR0_HI, "fpr0.hi" }, { PT_FPR0_LO, "fpr0.lo" }, diff --git a/linux/s390/userent0.h b/linux/s390/userent0.h index 71fae74a..21a90fb7 100644 --- a/linux/s390/userent0.h +++ b/linux/s390/userent0.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + { PT_PSWMASK, "psw_mask" }, { PT_PSWADDR, "psw_addr" }, { PT_GPR0, "gpr0" }, diff --git a/linux/s390/userent1.h b/linux/s390/userent1.h index 3ff99b90..6691167c 100644 --- a/linux/s390/userent1.h +++ b/linux/s390/userent1.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + XLAT_UOFF(u_tsize), XLAT_UOFF(u_dsize), XLAT_UOFF(u_ssize), diff --git a/linux/s390x/arch_defs_.h b/linux/s390x/arch_defs_.h new file mode 100644 index 00000000..1e520761 --- /dev/null +++ b/linux/s390x/arch_defs_.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define HAVE_ARCH_OLD_MMAP 1 +#define HAVE_ARCH_OLD_MMAP_PGOFF 1 +#define HAVE_ARCH_UID16_SYSCALLS 1 +#define SUPPORTED_PERSONALITIES 2 diff --git a/linux/s390x/arch_get_personality.c b/linux/s390x/arch_get_personality.c new file mode 100644 index 00000000..8b12132e --- /dev/null +++ b/linux/s390x/arch_get_personality.c @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef AUDIT_ARCH_S390 +# define AUDIT_ARCH_S390 0x16 +#endif + +int +get_personality_from_syscall_info(const struct ptrace_syscall_info *sci) +{ + return sci->arch == AUDIT_ARCH_S390; +} diff --git a/linux/s390x/arch_regs.c b/linux/s390x/arch_regs.c index 62aece72..7a2c0a6a 100644 --- a/linux/s390x/arch_regs.c +++ b/linux/s390x/arch_regs.c @@ -1 +1,45 @@ -#include "s390/arch_regs.c" +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef HAVE_S390_COMPAT_REGS +typedef struct { + uint32_t mask; + uint32_t addr; +} ATTRIBUTE_ALIGNED(8) psw_compat_t; + +typedef struct { + psw_compat_t psw; + uint32_t gprs[NUM_GPRS]; + uint32_t acrs[NUM_ACRS]; + uint32_t orig_gpr2; +} s390_compat_regs; +#endif + +static union { + s390_compat_regs s390_regs; + s390_regs s390x_regs; +} s390x_regs_union; + +#define s390_regset s390x_regs_union.s390_regs +#define s390x_regset s390x_regs_union.s390x_regs + +static struct iovec s390x_io = { + .iov_base = &s390x_regs_union, +}; + + +#define ARCH_REGS_FOR_GETREGSET s390x_regs_union +#define ARCH_IOVEC_FOR_GETREGSET s390x_io +#define ARCH_PC_REG \ + (s390x_io.iov_len == sizeof(s390_regset) ? \ + s390_regset.psw.addr : s390x_regset.psw.addr) +#define ARCH_SP_REG \ + (s390x_io.iov_len == sizeof(s390_regset) ? \ + s390_regset.gprs[15] : s390x_regset.gprs[15]) + +#define ARCH_PERSONALITY_0_IOV_SIZE sizeof(s390x_regset) +#define ARCH_PERSONALITY_1_IOV_SIZE sizeof(s390_regset) diff --git a/linux/s390x/arch_regs.h b/linux/s390x/arch_regs.h deleted file mode 100644 index 14fced4e..00000000 --- a/linux/s390x/arch_regs.h +++ /dev/null @@ -1 +0,0 @@ -#include "s390/arch_regs.h" diff --git a/linux/s390x/arch_sigreturn.c b/linux/s390x/arch_sigreturn.c index 679a3952..641c0080 100644 --- a/linux/s390x/arch_sigreturn.c +++ b/linux/s390x/arch_sigreturn.c @@ -1 +1,29 @@ +/* + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include + +#define PTR_TYPE uint32_t +#define arch_sigreturn s390_arch_sigreturn #include "s390/arch_sigreturn.c" +#undef arch_sigreturn +#undef PTR_TYPE +#undef SIGNAL_FRAMESIZE + +#define SIGNAL_FRAMESIZE 160 +#define arch_sigreturn s390x_arch_sigreturn +#include "s390/arch_sigreturn.c" +#undef arch_sigreturn + +static void +arch_sigreturn(struct tcb *tcp) +{ + if (tcp->currpers == 1) + s390_arch_sigreturn(tcp); + else + s390x_arch_sigreturn(tcp); +} diff --git a/linux/s390x/get_error.c b/linux/s390x/get_error.c index 8e3944c2..0d3b610c 100644 --- a/linux/s390x/get_error.c +++ b/linux/s390x/get_error.c @@ -1 +1,29 @@ -#include "s390/get_error.c" +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "negated_errno.h" + +#define arch_get_error s390_get_error +#define ARCH_REGSET s390_regset +#include "../s390/get_error.c" +#undef ARCH_REGSET +#undef arch_get_error + +#define arch_get_error s390x_get_error +#define ARCH_REGSET s390x_regset +#include "../s390/get_error.c" +#undef ARCH_REGSET +#undef arch_get_error + +static void +arch_get_error(struct tcb *tcp, const bool check_errno) +{ + if (tcp->currpers == 1) + s390_get_error(tcp, check_errno); + else + s390x_get_error(tcp, check_errno); +} diff --git a/linux/s390x/get_scno.c b/linux/s390x/get_scno.c index 71816fbd..5f9cf4e7 100644 --- a/linux/s390x/get_scno.c +++ b/linux/s390x/get_scno.c @@ -1 +1,27 @@ -#include "s390/get_scno.c" +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define arch_get_scno s390_get_scno +#define ARCH_REGSET s390_regset +#include "../s390/get_scno.c" +#undef ARCH_REGSET +#undef arch_get_scno + +#define arch_get_scno s390x_get_scno +#define ARCH_REGSET s390x_regset +#include "../s390/get_scno.c" +#undef ARCH_REGSET +#undef arch_get_scno + +static int +arch_get_scno(struct tcb *tcp) +{ + if (s390x_io.iov_len == sizeof(s390_regset)) + return s390_get_scno(tcp); + else + return s390x_get_scno(tcp); +} diff --git a/linux/s390x/get_syscall_args.c b/linux/s390x/get_syscall_args.c index 4ded41d4..1a7147c0 100644 --- a/linux/s390x/get_syscall_args.c +++ b/linux/s390x/get_syscall_args.c @@ -1 +1,28 @@ -#include "s390/get_syscall_args.c" +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define arch_get_syscall_args s390_get_syscall_args +#define ARCH_REGSET s390_regset +#include "../s390/get_syscall_args.c" +#undef ARCH_REGSET +#undef arch_get_syscall_args + +#define arch_get_syscall_args s390x_get_syscall_args +#define ARCH_REGSET s390x_regset +#include "../s390/get_syscall_args.c" +#undef ARCH_REGSET +#undef arch_get_syscall_args + +/* Return -1 on error or 1 on success (never 0!). */ +static int +arch_get_syscall_args(struct tcb *tcp) +{ + if (tcp->currpers == 1) + return s390_get_syscall_args(tcp); + else + return s390x_get_syscall_args(tcp); +} diff --git a/linux/s390x/ioctls_arch0.h b/linux/s390x/ioctls_arch0.h index f7c3355e..2f9e3b7d 100644 --- a/linux/s390x/ioctls_arch0.h +++ b/linux/s390x/ioctls_arch0.h @@ -37,37 +37,48 @@ { "asm/dasd.h", "DASDAPIVER", _IOC_READ, 0x4400, 0x04 }, { "asm/hypfs.h", "HYPFS_DIAG304", _IOC_READ|_IOC_WRITE, 0x1020, 0x18 }, { "asm/ioctls.h", "FIOQSIZE", 0, 0x545E, 0 }, +{ "asm/pkey.h", "PKEY_CLR2PROTK", _IOC_READ|_IOC_WRITE, 0x7004, 0x6c }, +{ "asm/pkey.h", "PKEY_CLR2SECK", _IOC_READ|_IOC_WRITE, 0x7002, 0x68 }, +{ "asm/pkey.h", "PKEY_FINDCARD", _IOC_READ|_IOC_WRITE, 0x7005, 0x44 }, +{ "asm/pkey.h", "PKEY_GENPROTK", _IOC_READ|_IOC_WRITE, 0x7008, 0x4c }, +{ "asm/pkey.h", "PKEY_GENSECK", _IOC_READ|_IOC_WRITE, 0x7001, 0x48 }, +{ "asm/pkey.h", "PKEY_KBLOB2PROTK", _IOC_READ|_IOC_WRITE, 0x700a, 0x58 }, +{ "asm/pkey.h", "PKEY_SEC2PROTK", _IOC_READ|_IOC_WRITE, 0x7003, 0x8c }, +{ "asm/pkey.h", "PKEY_SKEY2PKEY", _IOC_READ|_IOC_WRITE, 0x7006, 0x88 }, +{ "asm/pkey.h", "PKEY_VERIFYKEY", _IOC_READ|_IOC_WRITE, 0x7007, 0x4c }, +{ "asm/pkey.h", "PKEY_VERIFYPROTK", _IOC_WRITE, 0x7009, 0x48 }, { "asm/sclp_ctl.h", "SCLP_CTL_SCCB", _IOC_READ|_IOC_WRITE, 0x1010, 0x0c }, { "asm/tape390.h", "TAPE390_CRYPT_QUERY", _IOC_READ, 0x6403, 0x03 }, { "asm/tape390.h", "TAPE390_CRYPT_SET", _IOC_WRITE, 0x6402, 0x03 }, { "asm/tape390.h", "TAPE390_DISPLAY", _IOC_WRITE, 0x6401, 0x11 }, { "asm/tape390.h", "TAPE390_KEKL_QUERY", _IOC_READ, 0x6405, 0x86 }, { "asm/tape390.h", "TAPE390_KEKL_SET", _IOC_WRITE, 0x6404, 0x86 }, +{ "asm/vmcp.h", "VMCP_GETCODE", _IOC_READ, 0x1001, 0x04 }, +{ "asm/vmcp.h", "VMCP_GETSIZE", _IOC_READ, 0x1003, 0x04 }, +{ "asm/vmcp.h", "VMCP_SETBUF", _IOC_WRITE, 0x1002, 0x04 }, { "asm/zcrypt.h", "ICARSACRT", _IOC_READ|_IOC_WRITE, 0x7a06, 0x00 }, { "asm/zcrypt.h", "ICARSAMODEXPO", _IOC_READ|_IOC_WRITE, 0x7a05, 0x00 }, -{ "asm/zcrypt.h", "Z90STAT_CEX2ACOUNT", _IOC_READ, 0x7a4e, 0x04 }, -{ "asm/zcrypt.h", "Z90STAT_CEX2CCOUNT", _IOC_READ, 0x7a4d, 0x04 }, { "asm/zcrypt.h", "Z90STAT_DOMAIN_INDEX", _IOC_READ, 0x7a47, 0x04 }, -{ "asm/zcrypt.h", "Z90STAT_PCICACOUNT", _IOC_READ, 0x7a41, 0x04 }, -{ "asm/zcrypt.h", "Z90STAT_PCICCCOUNT", _IOC_READ, 0x7a42, 0x04 }, -{ "asm/zcrypt.h", "Z90STAT_PCIXCCMCL2COUNT", _IOC_READ, 0x7a4b, 0x04 }, -{ "asm/zcrypt.h", "Z90STAT_PCIXCCMCL3COUNT", _IOC_READ, 0x7a4c, 0x04 }, { "asm/zcrypt.h", "Z90STAT_PENDINGQ_COUNT", _IOC_READ, 0x7a45, 0x04 }, { "asm/zcrypt.h", "Z90STAT_PERDEV_REQCNT", _IOC_READ, 0x7a4a, 0x100 }, { "asm/zcrypt.h", "Z90STAT_QDEPTH_MASK", _IOC_READ, 0x7a49, 0x40 }, { "asm/zcrypt.h", "Z90STAT_REQUESTQ_COUNT", _IOC_READ, 0x7a44, 0x04 }, { "asm/zcrypt.h", "Z90STAT_STATUS_MASK", _IOC_READ, 0x7a48, 0x40 }, -{ "asm/zcrypt.h", "Z90STAT_TOTALCOUNT", _IOC_READ, 0x7a40, 0x04 }, { "asm/zcrypt.h", "Z90STAT_TOTALOPEN_COUNT", _IOC_READ, 0x7a46, 0x04 }, +{ "asm/zcrypt.h", "ZCRYPT_DEVICE_STATUS", _IOC_READ|_IOC_WRITE, 0x7a5f, 0x00 }, +{ "asm/zcrypt.h", "ZCRYPT_PERDEV_REQCNT", _IOC_READ, 0x7a5a, 0x400 }, +{ "asm/zcrypt.h", "ZCRYPT_QDEPTH_MASK", _IOC_READ, 0x7a59, 0x100 }, +{ "asm/zcrypt.h", "ZCRYPT_STATUS_MASK", _IOC_READ, 0x7a58, 0x100 }, +{ "asm/zcrypt.h", "ZDEVICESTATUS", _IOC_READ|_IOC_WRITE, 0x7a4f, 0x00 }, { "asm/zcrypt.h", "ZSECSENDCPRB", _IOC_READ|_IOC_WRITE, 0x7a81, 0x00 }, { "asm/zcrypt.h", "ZSENDEP11CPRB", _IOC_READ|_IOC_WRITE, 0x7a04, 0x00 }, -{ "linux/kvm.h", "KVM_ARM_SET_DEVICE_ADDR", _IOC_WRITE, 0xaeab, 0x10 }, { "linux/kvm.h", "KVM_ASSIGN_DEV_IRQ", _IOC_WRITE, 0xae70, 0x40 }, { "linux/kvm.h", "KVM_ASSIGN_PCI_DEVICE", _IOC_READ, 0xae69, 0x40 }, { "linux/kvm.h", "KVM_ASSIGN_SET_INTX_MASK", _IOC_WRITE, 0xaea4, 0x40 }, { "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_ENTRY", _IOC_WRITE, 0xae74, 0x10 }, { "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_NR", _IOC_WRITE, 0xae73, 0x08 }, { "linux/kvm.h", "KVM_CHECK_EXTENSION", _IOC_NONE, 0xae03, 0x00 }, +{ "linux/kvm.h", "KVM_CLEAR_DIRTY_LOG", _IOC_READ|_IOC_WRITE, 0xaec0, 0x18 }, { "linux/kvm.h", "KVM_CREATE_DEVICE", _IOC_READ|_IOC_WRITE, 0xaee0, 0x0c }, { "linux/kvm.h", "KVM_CREATE_IRQCHIP", _IOC_NONE, 0xae60, 0x00 }, { "linux/kvm.h", "KVM_CREATE_PIT", _IOC_NONE, 0xae64, 0x00 }, @@ -99,20 +110,22 @@ { "linux/kvm.h", "KVM_IRQ_LINE", _IOC_WRITE, 0xae61, 0x08 }, { "linux/kvm.h", "KVM_IRQ_LINE_STATUS", _IOC_READ|_IOC_WRITE, 0xae67, 0x08 }, { "linux/kvm.h", "KVM_KVMCLOCK_CTRL", _IOC_NONE, 0xaead, 0x00 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_OP", _IOC_READ|_IOC_WRITE, 0xaeba, 0x08 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_REG_REGION", _IOC_READ, 0xaebb, 0x10 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_UNREG_REGION", _IOC_READ, 0xaebc, 0x10 }, { "linux/kvm.h", "KVM_NMI", _IOC_NONE, 0xae9a, 0x00 }, -{ "linux/kvm.h", "KVM_PPC_ALLOCATE_HTAB", _IOC_READ|_IOC_WRITE, 0xaea7, 0x04 }, -{ "linux/kvm.h", "KVM_PPC_GET_PVINFO", _IOC_WRITE, 0xaea1, 0x80 }, -{ "linux/kvm.h", "KVM_PPC_GET_SMMU_INFO", _IOC_READ, 0xaea6, 0x250 }, { "linux/kvm.h", "KVM_REGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae67, 0x10 }, { "linux/kvm.h", "KVM_REINJECT_CONTROL", _IOC_NONE, 0xae71, 0x00 }, { "linux/kvm.h", "KVM_RUN", _IOC_NONE, 0xae80, 0x00 }, { "linux/kvm.h", "KVM_S390_ENABLE_SIE", _IOC_NONE, 0xae06, 0x00 }, +{ "linux/kvm.h", "KVM_S390_GET_CMMA_BITS", _IOC_READ|_IOC_WRITE, 0xaeb8, 0x20 }, { "linux/kvm.h", "KVM_S390_GET_IRQ_STATE", _IOC_WRITE, 0xaeb6, 0x20 }, { "linux/kvm.h", "KVM_S390_GET_SKEYS", _IOC_WRITE, 0xaeb2, 0x40 }, { "linux/kvm.h", "KVM_S390_INITIAL_RESET", _IOC_NONE, 0xae97, 0x00 }, { "linux/kvm.h", "KVM_S390_INTERRUPT", _IOC_WRITE, 0xae94, 0x10 }, { "linux/kvm.h", "KVM_S390_IRQ", _IOC_WRITE, 0xaeb4, 0x48 }, { "linux/kvm.h", "KVM_S390_MEM_OP", _IOC_WRITE, 0xaeb1, 0x40 }, +{ "linux/kvm.h", "KVM_S390_SET_CMMA_BITS", _IOC_WRITE, 0xaeb9, 0x20 }, { "linux/kvm.h", "KVM_S390_SET_INITIAL_PSW", _IOC_WRITE, 0xae96, 0x10 }, { "linux/kvm.h", "KVM_S390_SET_IRQ_STATE", _IOC_WRITE, 0xaeb5, 0x20 }, { "linux/kvm.h", "KVM_S390_SET_SKEYS", _IOC_WRITE, 0xaeb3, 0x40 }, @@ -144,5 +157,3 @@ { "linux/kvm.h", "KVM_TPR_ACCESS_REPORTING", _IOC_READ|_IOC_WRITE, 0xae92, 0x28 }, { "linux/kvm.h", "KVM_TRANSLATE", _IOC_READ|_IOC_WRITE, 0xae85, 0x18 }, { "linux/kvm.h", "KVM_UNREGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae68, 0x10 }, -{ "linux/kvm.h", "KVM_X86_GET_MCE_CAP_SUPPORTED", _IOC_READ, 0xae9d, 0x08 }, -{ "linux/kvm.h", "KVM_X86_SETUP_MCE", _IOC_WRITE, 0xae9c, 0x08 }, diff --git a/linux/s390x/ioctls_arch1.h b/linux/s390x/ioctls_arch1.h new file mode 100644 index 00000000..4a16cb5c --- /dev/null +++ b/linux/s390x/ioctls_arch1.h @@ -0,0 +1 @@ +#include "s390/ioctls_arch0.h" diff --git a/linux/s390x/ioctls_inc1.h b/linux/s390x/ioctls_inc1.h new file mode 100644 index 00000000..e09b6c6d --- /dev/null +++ b/linux/s390x/ioctls_inc1.h @@ -0,0 +1 @@ +#include "s390/ioctls_inc0.h" diff --git a/linux/s390x/raw_syscall.h b/linux/s390x/raw_syscall.h new file mode 100644 index 00000000..05789ce1 --- /dev/null +++ b/linux/s390x/raw_syscall.h @@ -0,0 +1 @@ +#include "s390/raw_syscall.h" diff --git a/linux/s390x/rt_sigframe.h b/linux/s390x/rt_sigframe.h new file mode 100644 index 00000000..fc9b2247 --- /dev/null +++ b/linux/s390x/rt_sigframe.h @@ -0,0 +1 @@ +#include "s390/rt_sigframe.h" diff --git a/linux/s390x/set_error.c b/linux/s390x/set_error.c index 737ddef7..2acd00a0 100644 --- a/linux/s390x/set_error.c +++ b/linux/s390x/set_error.c @@ -1 +1,40 @@ -#include "s390/set_error.c" +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define arch_set_error s390_set_error +#define arch_set_success s390_set_success +#define ARCH_REGSET s390_regset +#include "../s390/set_error.c" +#undef ARCH_REGSET +#undef arch_set_success +#undef arch_set_error + +#define arch_set_error s390x_set_error +#define arch_set_success s390x_set_success +#define ARCH_REGSET s390x_regset +#include "../s390/set_error.c" +#undef ARCH_REGSET +#undef arch_set_success +#undef arch_set_error + +static int +arch_set_error(struct tcb *tcp) +{ + if (tcp->currpers == 1) + return s390_set_error(tcp); + else + return s390x_set_error(tcp); +} + +static int +arch_set_success(struct tcb *tcp) +{ + if (tcp->currpers == 1) + return s390_set_success(tcp); + else + return s390x_set_success(tcp); +} diff --git a/linux/s390x/set_scno.c b/linux/s390x/set_scno.c index 9cea4d10..a8d6f3bf 100644 --- a/linux/s390x/set_scno.c +++ b/linux/s390x/set_scno.c @@ -1 +1,27 @@ -#include "s390/set_scno.c" +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define arch_set_scno s390_set_scno +#define ARCH_REGSET s390_regset +#include "../s390/set_scno.c" +#undef ARCH_REGSET +#undef arch_set_scno + +#define arch_set_scno s390x_set_scno +#define ARCH_REGSET s390x_regset +#include "../s390/set_scno.c" +#undef ARCH_REGSET +#undef arch_set_scno + +static int +arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) +{ + if (tcp->currpers == 1) + return s390_set_scno(tcp, scno); + else + return s390x_set_scno(tcp, scno); +} diff --git a/linux/s390x/syscallent.h b/linux/s390x/syscallent.h index ca67f467..5b61cdc2 100644 --- a/linux/s390x/syscallent.h +++ b/linux/s390x/syscallent.h @@ -1,29 +1,10 @@ /* * Copyright (c) 2000 IBM Deutschland Entwicklung GmbH, IBM Coporation + * Copyright (c) 2000-2019 The strace developers. * Author: Ulrich Weigand * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later * */ @@ -47,7 +28,7 @@ [ 17] = { }, [ 18] = { }, [ 19] = { 3, TD, SEN(lseek), "lseek" }, -[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 20] = { 0, PU|NF, SEN(getpid), "getpid" }, [ 21] = { 5, TF, SEN(mount), "mount" }, [ 22] = { 1, TF, SEN(umount), "umount" }, [ 23] = { }, @@ -89,10 +70,10 @@ [ 59] = { }, [ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, -[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 62] = { 2, TSFA, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, -[ 64] = { 0, NF, SEN(getppid), "getppid" }, -[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 64] = { 0, PU|NF, SEN(getppid), "getppid" }, +[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, [ 66] = { 0, 0, SEN(setsid), "setsid" }, [ 67] = { 3, TS, SEN(sigaction), "sigaction" }, [ 68 ... 71] = { }, @@ -121,16 +102,16 @@ [ 96] = { 2, 0, SEN(getpriority), "getpriority" }, [ 97] = { 3, 0, SEN(setpriority), "setpriority" }, [ 98] = { }, -[ 99] = { 2, TF, SEN(statfs), "statfs" }, -[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, [101] = { }, [102] = { 2, TD, SEN(socketcall), "socketcall" }, [103] = { 3, 0, SEN(syslog), "syslog" }, [104] = { 3, 0, SEN(setitimer), "setitimer" }, [105] = { 2, 0, SEN(getitimer), "getitimer" }, -[106] = { 2, TF, SEN(stat), "stat" }, -[107] = { 2, TF, SEN(lstat), "lstat" }, -[108] = { 2, TD, SEN(fstat), "fstat" }, +[106] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, +[107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, +[108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, [109] = { }, [110] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" }, [111] = { 0, 0, SEN(vhangup), "vhangup" }, @@ -146,7 +127,7 @@ [121] = { 2, 0, SEN(setdomainname), "setdomainname" }, [122] = { 1, 0, SEN(uname), "uname" }, [123] = { }, -[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[124] = { 1, 0, SEN(adjtimex64), "adjtimex" }, [125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, [126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, [127] = { 2, 0, SEN(create_module), "create_module" }, @@ -181,20 +162,20 @@ [158] = { 0, 0, SEN(sched_yield), "sched_yield" }, [159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, -[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[161] = { 2, 0, SEN(sched_rr_get_interval_time64),"sched_rr_get_interval"}, +[162] = { 2, 0, SEN(nanosleep_time64), "nanosleep" }, [163] = { 5, TM|SI, SEN(mremap), "mremap" }, [164 ... 166] = { }, [167] = { 5, 0, SEN(query_module), "query_module" }, -[168] = { 3, TD, SEN(poll), "poll" }, +[168] = { 3, TD, SEN(poll_time64), "poll" }, [169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, [170 ... 171] = { }, [172] = { 5, 0, SEN(prctl), "prctl" }, -[173] = { 0, TS, SEN(sigreturn), "rt_sigreturn" }, +[173] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, [174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, [175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, [176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[177] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[177] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait" }, [178] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, [179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, [180] = { 4, TD, SEN(pread), "pread64" }, @@ -211,10 +192,10 @@ [191] = { 2, 0, SEN(getrlimit), "getrlimit" }, [196 ... 197] = { }, [198] = { 3, TF, SEN(chown), "lchown" }, -[199] = { 0, NF, SEN(getuid), "getuid" }, -[200] = { 0, NF, SEN(getgid), "getgid" }, -[201] = { 0, NF, SEN(geteuid), "geteuid" }, -[202] = { 0, NF, SEN(getegid), "getegid" }, +[199] = { 0, PU|NF, SEN(getuid), "getuid" }, +[200] = { 0, PU|NF, SEN(getgid), "getgid" }, +[201] = { 0, PU|NF, SEN(geteuid), "geteuid" }, +[202] = { 0, PU|NF, SEN(getegid), "getegid" }, [203] = { 2, 0, SEN(setreuid), "setreuid" }, [204] = { 2, 0, SEN(setregid), "setregid" }, [205] = { 2, 0, SEN(getgroups), "getgroups" }, @@ -248,16 +229,16 @@ [233] = { 2, TF, SEN(removexattr), "removexattr" }, [234] = { 2, TF, SEN(removexattr), "lremovexattr" }, [235] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, -[236] = { 0, NF, SEN(gettid), "gettid" }, +[236] = { 0, PU|NF, SEN(gettid), "gettid" }, [237] = { 2, TS, SEN(kill), "tkill" }, -[238] = { 6, 0, SEN(futex), "futex" }, +[238] = { 6, 0, SEN(futex_time64), "futex" }, [239] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [240] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [241] = { 3, TS, SEN(tgkill), "tgkill" }, [242] = { }, [243] = { 2, TM, SEN(io_setup), "io_setup" }, [244] = { 1, TM, SEN(io_destroy), "io_destroy" }, -[245] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[245] = { 5, 0, SEN(io_getevents_time64), "io_getevents" }, [246] = { 3, 0, SEN(io_submit), "io_submit" }, [247] = { 3, 0, SEN(io_cancel), "io_cancel" }, [248] = { 1, TP|SE, SEN(exit), "exit_group" }, @@ -267,28 +248,28 @@ [252] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [253] = { 4, TD, SEN(fadvise64), "fadvise64" }, [254] = { 3, 0, SEN(timer_create), "timer_create" }, -[255] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[256] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[255] = { 4, 0, SEN(timer_settime64), "timer_settime" }, +[256] = { 2, 0, SEN(timer_gettime64), "timer_gettime" }, [257] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, [258] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[259] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[260] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[261] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[262] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[259] = { 2, 0, SEN(clock_settime64), "clock_settime" }, +[260] = { 2, 0, SEN(clock_gettime64), "clock_gettime" }, +[261] = { 2, 0, SEN(clock_getres_time64), "clock_getres" }, +[262] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep" }, [263] = { 5, 0, SEN(vserver), "vserver" }, [264] = { }, -[265] = { 3, TF, SEN(statfs64), "statfs64" }, -[266] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[265] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, +[266] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, [267] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, [268] = { 6, TM, SEN(mbind), "mbind" }, [269] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, [270] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, -[271] = { 4, 0, SEN(mq_open), "mq_open" }, +[271] = { 4, TD, SEN(mq_open), "mq_open" }, [272] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[273] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[274] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[275] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[276] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[273] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend" }, +[274] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive" }, +[275] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[276] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, [277] = { 4, 0, SEN(kexec_load), "kexec_load" }, [278] = { 5, 0, SEN(add_key), "add_key" }, [279] = { 4, 0, SEN(request_key), "request_key" }, @@ -297,7 +278,7 @@ [282] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, [283] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, [284] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[285] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[285] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, [286] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, [287] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, [288] = { 4, TD|TF, SEN(openat), "openat" }, @@ -305,7 +286,7 @@ [290] = { 4, TD|TF, SEN(mknodat), "mknodat" }, [291] = { 5, TD|TF, SEN(fchownat), "fchownat" }, [292] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[293] = { 4, TD|TF, SEN(newfstatat), "newfstatat" }, +[293] = { 4, TD|TF|TFST|TSTA,SEN(newfstatat), "newfstatat" }, [294] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, [295] = { 4, TD|TF, SEN(renameat), "renameat" }, [296] = { 5, TD|TF, SEN(linkat), "linkat" }, @@ -313,8 +294,8 @@ [298] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, [299] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, [300] = { 3, TD|TF, SEN(faccessat), "faccessat" }, -[301] = { 6, TD, SEN(pselect6), "pselect6" }, -[302] = { 5, TD, SEN(ppoll), "ppoll" }, +[301] = { 6, TD, SEN(pselect6_time64), "pselect6" }, +[302] = { 5, TD, SEN(ppoll_time64), "ppoll" }, [303] = { 1, TP, SEN(unshare), "unshare" }, [304] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, [305] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, @@ -327,13 +308,13 @@ [312] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, [313] = { 2, TF, SEN(utimes), "utimes" }, [314] = { 4, TD, SEN(fallocate), "fallocate" }, -[315] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[315] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" }, [316] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [317] = { 4, TD, SEN(timerfd), "timerfd" }, [318] = { 1, TD, SEN(eventfd), "eventfd" }, [319] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, -[320] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, -[321] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[320] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime" }, +[321] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime" }, [322] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, [323] = { 2, TD, SEN(eventfd2), "eventfd2" }, [324] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, @@ -349,12 +330,12 @@ [334] = { 4, 0, SEN(prlimit64), "prlimit64" }, [335] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, [336] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[337] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[337] = { 2, 0, SEN(clock_adjtime64), "clock_adjtime" }, [338] = { 1, TD, SEN(syncfs), "syncfs" }, [339] = { 2, TD, SEN(setns), "setns" }, [340] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, [341] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, -[342] = { 2, 0, SEN(printargs), "s390_runtime_instr" }, +[342] = { 2, 0, SEN(s390_runtime_instr), "s390_runtime_instr" }, [343] = { 5, 0, SEN(kcmp), "kcmp" }, [344] = { 3, TD, SEN(finit_module), "finit_module" }, [345] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, @@ -364,12 +345,12 @@ [349] = { 3, 0, SEN(getrandom), "getrandom" }, [350] = { 2, TD, SEN(memfd_create), "memfd_create" }, [351] = { 3, TD, SEN(bpf), "bpf" }, -[352] = { 3, 0, SEN(printargs), "s390_pci_mmio_write" }, -[353] = { 3, 0, SEN(printargs), "s390_pci_mmio_read" }, +[352] = { 3, 0, SEN(s390_pci_mmio_write), "s390_pci_mmio_write" }, +[353] = { 3, 0, SEN(s390_pci_mmio_read), "s390_pci_mmio_read" }, [354] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, [355] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, [356] = { 2, 0, SEN(membarrier), "membarrier" }, -[357] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[357] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg" }, [358] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, [359] = { 3, TN, SEN(socket), "socket" }, [360] = { 4, TN, SEN(socketpair), "socketpair" }, @@ -390,6 +371,32 @@ [375] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, [376] = { 6, TD, SEN(preadv2), "preadv2" }, [377] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[378] = { 2, 0, SEN(s390_guarded_storage), "s390_guarded_storage" }, +[379] = { 5, TD|TF|TSTA, SEN(statx), "statx" }, +[380] = { 4, 0, SEN(s390_sthyi), "s390_sthyi" }, +[381] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" }, +[382] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents" }, +[383] = { 4, 0, SEN(rseq), "rseq" }, +[384] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, +[385] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, +[386] = { 1, 0, SEN(pkey_free), "pkey_free" }, +/* room for arch specific calls */ +[392] = { 4, TI, SEN(semtimedop_time64), "semtimedop" }, +[393] = { 3, TI, SEN(semget), "semget" }, +[394] = { 4, TI, SEN(semctl), "semctl" }, +[395] = { 3, TI, SEN(shmget), "shmget" }, +[396] = { 3, TI, SEN(shmctl), "shmctl" }, +[397] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[398] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[399] = { 2, TI, SEN(msgget), "msgget" }, +[400] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[401] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[402] = { 3, TI, SEN(msgctl), "msgctl" }, +/* [403 ... 423] - reserved to sync up with other architectures */ +[424] = { 4, TD|TS, SEN(pidfd_send_signal), "pidfd_send_signal" }, +[425] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" }, +[426] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" }, +[427] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" }, -#define SYS_socket_subcall 400 -#include "subcall.h" +#define SYS_socket_subcall 500 +#include "subcall64.h" diff --git a/linux/s390x/syscallent1.h b/linux/s390x/syscallent1.h new file mode 100644 index 00000000..6b7a4b3c --- /dev/null +++ b/linux/s390x/syscallent1.h @@ -0,0 +1 @@ +#include "s390/syscallent.h" diff --git a/linux/s390x/userent.h b/linux/s390x/userent.h index d14488fe..8997dd88 100644 --- a/linux/s390x/userent.h +++ b/linux/s390x/userent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "../s390/userent0.h" { PT_FPR0, "fpr0" }, { PT_FPR1, "fpr1" }, diff --git a/linux/sh/arch_defs_.h b/linux/sh/arch_defs_.h new file mode 100644 index 00000000..1809580d --- /dev/null +++ b/linux/sh/arch_defs_.h @@ -0,0 +1,10 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define HAVE_ARCH_GETRVAL2 1 +#define HAVE_ARCH_OLD_SELECT 1 +#define HAVE_ARCH_UID16_SYSCALLS 1 diff --git a/linux/sh/arch_getrval2.c b/linux/sh/arch_getrval2.c index 27b7cdd0..bd32ac8f 100644 --- a/linux/sh/arch_getrval2.c +++ b/linux/sh/arch_getrval2.c @@ -1,8 +1,15 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + long getrval2(struct tcb *tcp) { unsigned long val; - if (upeek(tcp->pid, 4*(REG_REG0+1), &val) < 0) + if (upeek(tcp, 4*(REG_REG0+1), &val) < 0) return -1; return val; } diff --git a/linux/sh/arch_regs.c b/linux/sh/arch_regs.c index 5429b4f5..74164547 100644 --- a/linux/sh/arch_regs.c +++ b/linux/sh/arch_regs.c @@ -1,2 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static unsigned long sh_r0; #define ARCH_PC_PEEK_ADDR (4 * REG_PC) +#define ARCH_SP_PEEK_ADDR (4 * 15) diff --git a/linux/sh/get_error.c b/linux/sh/get_error.c index 158ff9e6..9319c612 100644 --- a/linux/sh/get_error.c +++ b/linux/sh/get_error.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "negated_errno.h" + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { if (check_errno && is_negated_errno(sh_r0)) { tcp->u_rval = -1; diff --git a/linux/sh/get_scno.c b/linux/sh/get_scno.c index 45fc0b7b..b23824d5 100644 --- a/linux/sh/get_scno.c +++ b/linux/sh/get_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) @@ -7,7 +14,7 @@ arch_get_scno(struct tcb *tcp) /* * In the new syscall ABI, the system call number is in R3. */ - if (upeek(tcp->pid, 4*(REG_REG0+3), &scno) < 0) + if (upeek(tcp, 4*(REG_REG0+3), &scno) < 0) return -1; if ((long) scno < 0) { diff --git a/linux/sh/get_syscall_args.c b/linux/sh/get_syscall_args.c index 0b6c8819..4156baa8 100644 --- a/linux/sh/get_syscall_args.c +++ b/linux/sh/get_syscall_args.c @@ -1,6 +1,13 @@ +/* + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { static const int syscall_regs[MAX_ARGS] = { 4 * (REG_REG0+4), @@ -12,8 +19,8 @@ get_syscall_args(struct tcb *tcp) }; unsigned int i; - for (i = 0; i < tcp->s_ent->nargs; ++i) - if (upeek(tcp->pid, syscall_regs[i], &tcp->u_arg[i]) < 0) + for (i = 0; i < n_args(tcp); ++i) + if (upeek(tcp, syscall_regs[i], &tcp->u_arg[i]) < 0) return -1; return 1; } diff --git a/linux/sh/get_syscall_result.c b/linux/sh/get_syscall_result.c index f7b93b74..a8d6bc49 100644 --- a/linux/sh/get_syscall_result.c +++ b/linux/sh/get_syscall_result.c @@ -1,6 +1,13 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int get_syscall_result_regs(struct tcb *tcp) { /* new syscall ABI returns result in R0 */ - return upeek(tcp->pid, 4 * REG_REG0, &sh_r0) < 0 ? -1 : 0; + return upeek(tcp, 4 * REG_REG0, &sh_r0) < 0 ? -1 : 0; } diff --git a/linux/sh/raw_syscall.h b/linux/sh/raw_syscall.h new file mode 100644 index 00000000..1c2f8136 --- /dev/null +++ b/linux/sh/raw_syscall.h @@ -0,0 +1,34 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + *err = 0; + register kernel_ulong_t r3 __asm__("%r3") = nr; + register kernel_ulong_t r0 __asm__("%r0"); + __asm__ __volatile__("trapa #0x10\n\t" + "or r0,r0\n\t" + "or r0,r0\n\t" + "or r0,r0\n\t" + "or r0,r0\n\t" + "or r0,r0\n\t" + : "=r"(r0) + : "r"(r3) + : "memory", "t"); + return r0; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/sh/set_error.c b/linux/sh/set_error.c index cb093b64..ef51a5c4 100644 --- a/linux/sh/set_error.c +++ b/linux/sh/set_error.c @@ -1,13 +1,20 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_error(struct tcb *tcp) { sh_r0 = -tcp->u_error; - return upoke(tcp->pid, 4 * REG_REG0, sh_r0); + return upoke(tcp, 4 * REG_REG0, sh_r0); } static int arch_set_success(struct tcb *tcp) { sh_r0 = tcp->u_rval; - return upoke(tcp->pid, 4 * REG_REG0, sh_r0); + return upoke(tcp, 4 * REG_REG0, sh_r0); } diff --git a/linux/sh/set_scno.c b/linux/sh/set_scno.c index 5f71664a..2f0b7703 100644 --- a/linux/sh/set_scno.c +++ b/linux/sh/set_scno.c @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { - return upoke(tcp->pid, 4 * (REG_REG0 + 3), scno); + return upoke(tcp, 4 * (REG_REG0 + 3), scno); } diff --git a/linux/sh/syscallent.h b/linux/sh/syscallent.h index 758c7f19..44cc9d90 100644 --- a/linux/sh/syscallent.h +++ b/linux/sh/syscallent.h @@ -3,29 +3,10 @@ * Copyright (c) 1993, 1994, 1995 Rick Sladkey * Copyright (c) 2000 PocketPenguins Inc. Linux for Hitachi SuperH * port by Greg Banks + * Copyright (c) 2000-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ [ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, @@ -46,17 +27,17 @@ [ 15] = { 2, TF, SEN(chmod), "chmod" }, [ 16] = { 3, TF, SEN(chown16), "lchown" }, [ 17] = { 0, TM, SEN(break), "break" }, -[ 18] = { 2, TF, SEN(oldstat), "oldstat" }, +[ 18] = { 2, TF|TST|TSTA, SEN(oldstat), "oldstat" }, [ 19] = { 3, TD, SEN(lseek), "lseek" }, -[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 20] = { 0, PU|NF, SEN(getpid), "getpid" }, [ 21] = { 5, TF, SEN(mount), "mount" }, [ 22] = { 1, TF, SEN(umount), "umount" }, [ 23] = { 1, 0, SEN(setuid16), "setuid" }, -[ 24] = { 0, NF, SEN(getuid16), "getuid" }, +[ 24] = { 0, PU|NF, SEN(getuid16), "getuid" }, [ 25] = { 1, 0, SEN(stime), "stime" }, [ 26] = { 4, 0, SEN(ptrace), "ptrace" }, [ 27] = { 1, 0, SEN(alarm), "alarm" }, -[ 28] = { 2, TD, SEN(oldfstat), "oldfstat" }, +[ 28] = { 2, TD|TFST|TSTA, SEN(oldfstat), "oldfstat" }, [ 29] = { 0, TS, SEN(pause), "pause" }, [ 30] = { 2, TF, SEN(utime), "utime" }, [ 31] = { 2, 0, SEN(stty), "stty" }, @@ -75,10 +56,10 @@ [ 44] = { 0, 0, SEN(prof), "prof" }, [ 45] = { 1, TM|SI, SEN(brk), "brk" }, [ 46] = { 1, 0, SEN(setgid16), "setgid" }, -[ 47] = { 0, NF, SEN(getgid16), "getgid" }, +[ 47] = { 0, PU|NF, SEN(getgid16), "getgid" }, [ 48] = { 2, TS, SEN(signal), "signal" }, -[ 49] = { 0, NF, SEN(geteuid16), "geteuid" }, -[ 50] = { 0, NF, SEN(getegid16), "getegid" }, +[ 49] = { 0, PU|NF, SEN(geteuid16), "geteuid" }, +[ 50] = { 0, PU|NF, SEN(getegid16), "getegid" }, [ 51] = { 1, TF, SEN(acct), "acct" }, [ 52] = { 2, TF, SEN(umount2), "umount2" }, [ 53] = { 0, 0, SEN(lock), "lock" }, @@ -90,17 +71,17 @@ [ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, [ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, -[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 62] = { 2, TSFA, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, -[ 64] = { 0, NF, SEN(getppid), "getppid" }, -[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 64] = { 0, PU|NF, SEN(getppid), "getppid" }, +[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, [ 66] = { 0, 0, SEN(setsid), "setsid" }, [ 67] = { 3, TS, SEN(sigaction), "sigaction" }, -[ 68] = { 0, TS, SEN(siggetmask), "sgetmask" }, -[ 69] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[ 68] = { 0, TS, SEN(sgetmask), "sgetmask" }, +[ 69] = { 1, TS, SEN(ssetmask), "ssetmask" }, [ 70] = { 2, 0, SEN(setreuid16), "setreuid" }, [ 71] = { 2, 0, SEN(setregid16), "setregid" }, -[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, +[ 72] = { 1, TS, SEN(sigsuspend), "sigsuspend" }, [ 73] = { 1, TS, SEN(sigpending), "sigpending" }, [ 74] = { 2, 0, SEN(sethostname), "sethostname" }, [ 75] = { 2, 0, SEN(setrlimit), "setrlimit" }, @@ -112,7 +93,7 @@ [ 81] = { 2, 0, SEN(setgroups16), "setgroups" }, [ 82] = { 1, TD, SEN(oldselect), "select" }, [ 83] = { 2, TF, SEN(symlink), "symlink" }, -[ 84] = { 2, TF, SEN(oldlstat), "oldlstat" }, +[ 84] = { 2, TF|TLST|TSTA, SEN(oldlstat), "oldlstat" }, [ 85] = { 3, TF, SEN(readlink), "readlink" }, [ 86] = { 1, TF, SEN(uselib), "uselib" }, [ 87] = { 2, TF, SEN(swapon), "swapon" }, @@ -127,16 +108,16 @@ [ 96] = { 2, 0, SEN(getpriority), "getpriority" }, [ 97] = { 3, 0, SEN(setpriority), "setpriority" }, [ 98] = { 4, 0, SEN(profil), "profil" }, -[ 99] = { 2, TF, SEN(statfs), "statfs" }, -[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, [101] = { 3, 0, SEN(ioperm), "ioperm" }, [102] = { 2, TD, SEN(socketcall), "socketcall" }, [103] = { 3, 0, SEN(syslog), "syslog" }, [104] = { 3, 0, SEN(setitimer), "setitimer" }, [105] = { 2, 0, SEN(getitimer), "getitimer" }, -[106] = { 2, TF, SEN(stat), "stat" }, -[107] = { 2, TF, SEN(lstat), "lstat" }, -[108] = { 2, TD, SEN(fstat), "fstat" }, +[106] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, +[107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, +[108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, [109] = { 1, 0, SEN(olduname), "olduname" }, [110] = { 1, 0, SEN(iopl), "iopl" }, [111] = { 0, 0, SEN(vhangup), "vhangup" }, @@ -152,7 +133,7 @@ [121] = { 2, 0, SEN(setdomainname), "setdomainname" }, [122] = { 1, 0, SEN(uname), "uname" }, [123] = { 3, 0, SEN(cacheflush), "cacheflush" }, -[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[124] = { 1, 0, SEN(adjtimex32), "adjtimex" }, [125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, [126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, [127] = { 2, 0, SEN(create_module), "create_module" }, @@ -189,14 +170,14 @@ [158] = { 0, 0, SEN(sched_yield), "sched_yield" }, [159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, -[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[161] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"}, +[162] = { 2, 0, SEN(nanosleep_time32), "nanosleep" }, [163] = { 5, TM|SI, SEN(mremap), "mremap" }, [164] = { 3, 0, SEN(setresuid16), "setresuid" }, [165] = { 3, 0, SEN(getresuid16), "getresuid" }, [166] = { 5, 0, SEN(vm86), "vm86" }, [167] = { 5, 0, SEN(query_module), "query_module" }, -[168] = { 3, TD, SEN(poll), "poll" }, +[168] = { 3, TD, SEN(poll_time32), "poll" }, [169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, [170] = { 3, 0, SEN(setresgid16), "setresgid" }, [171] = { 3, 0, SEN(getresgid16), "getresgid" }, @@ -205,7 +186,7 @@ [174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, [175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, [176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[177] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[177] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" }, [178] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, [179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, [180] = { 6, TD, SEN(pread), "pread64" }, @@ -222,14 +203,14 @@ [192] = { 6, TD|TM|SI, SEN(mmap_4koff), "mmap2" }, [193] = { 3, TF, SEN(truncate64), "truncate64" }, [194] = { 3, TD, SEN(ftruncate64), "ftruncate64" }, -[195] = { 2, TF, SEN(stat64), "stat64" }, -[196] = { 2, TF, SEN(lstat64), "lstat64" }, -[197] = { 2, TD, SEN(fstat64), "fstat64" }, +[195] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" }, +[196] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" }, +[197] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" }, [198] = { 3, TF, SEN(chown), "lchown32" }, -[199] = { 0, NF, SEN(getuid), "getuid32" }, -[200] = { 0, NF, SEN(getgid), "getgid32" }, -[201] = { 0, NF, SEN(geteuid), "geteuid32" }, -[202] = { 0, NF, SEN(getegid), "getegid32" }, +[199] = { 0, PU|NF, SEN(getuid), "getuid32" }, +[200] = { 0, PU|NF, SEN(getgid), "getgid32" }, +[201] = { 0, PU|NF, SEN(geteuid), "geteuid32" }, +[202] = { 0, PU|NF, SEN(getegid), "getegid32" }, [203] = { 2, 0, SEN(setreuid), "setreuid32" }, [204] = { 2, 0, SEN(setregid), "setregid32" }, [205] = { 2, 0, SEN(getgroups), "getgroups32" }, @@ -250,7 +231,7 @@ [220] = { 3, TD, SEN(getdents64), "getdents64" }, [221] = { 3, TD, SEN(fcntl64), "fcntl64" }, [222 ... 223] = { }, -[224] = { 0, NF, SEN(gettid), "gettid" }, +[224] = { 0, PU|NF, SEN(gettid), "gettid" }, [225] = { 4, TD, SEN(readahead), "readahead" }, [226] = { 5, TF, SEN(setxattr), "setxattr" }, [227] = { 5, TF, SEN(setxattr), "lsetxattr" }, @@ -266,13 +247,13 @@ [237] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [238] = { 2, TS, SEN(kill), "tkill" }, [239] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, -[240] = { 6, 0, SEN(futex), "futex" }, +[240] = { 6, 0, SEN(futex_time32), "futex" }, [241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [243 ... 244] = { }, [245] = { 2, TM, SEN(io_setup), "io_setup" }, [246] = { 1, TM, SEN(io_destroy), "io_destroy" }, -[247] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[247] = { 5, 0, SEN(io_getevents_time32), "io_getevents" }, [248] = { 3, 0, SEN(io_submit), "io_submit" }, [249] = { 3, 0, SEN(io_cancel), "io_cancel" }, [250] = { 5, TD, SEN(fadvise64), "fadvise64" }, @@ -285,16 +266,16 @@ [257] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, [258] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [259] = { 3, 0, SEN(timer_create), "timer_create" }, -[260] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[261] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[260] = { 4, 0, SEN(timer_settime32), "timer_settime" }, +[261] = { 2, 0, SEN(timer_gettime32), "timer_gettime" }, [262] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, [263] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[264] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[265] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[266] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[267] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, -[268] = { 3, TF, SEN(statfs64), "statfs64" }, -[269] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[264] = { 2, 0, SEN(clock_settime32), "clock_settime" }, +[265] = { 2, 0, SEN(clock_gettime32), "clock_gettime" }, +[266] = { 2, 0, SEN(clock_getres_time32), "clock_getres" }, +[267] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" }, +[268] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, +[269] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, [270] = { 3, TS, SEN(tgkill), "tgkill" }, [271] = { 2, TF, SEN(utimes), "utimes" }, [272] = { 6, TD, SEN(fadvise64_64), "fadvise64_64" }, @@ -302,12 +283,12 @@ [274] = { 6, TM, SEN(mbind), "mbind" }, [275] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, [276] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, -[277] = { 4, 0, SEN(mq_open), "mq_open" }, +[277] = { 4, TD, SEN(mq_open), "mq_open" }, [278] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[279] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[280] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[281] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[282] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[279] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" }, +[280] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" }, +[281] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[282] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, [283] = { 4, 0, SEN(kexec_load), "kexec_load" }, [284] = { 5, TP, SEN(waitid), "waitid" }, [285] = { 5, 0, SEN(add_key), "add_key" }, @@ -316,7 +297,7 @@ [288] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, [289] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, [290] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[291] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[291] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, [292] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, [293] = { }, [294] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, @@ -325,7 +306,7 @@ [297] = { 4, TD|TF, SEN(mknodat), "mknodat" }, [298] = { 5, TD|TF, SEN(fchownat), "fchownat" }, [299] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[300] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[300] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" }, [301] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, [302] = { 4, TD|TF, SEN(renameat), "renameat" }, [303] = { 5, TD|TF, SEN(linkat), "linkat" }, @@ -333,8 +314,8 @@ [305] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, [306] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, [307] = { 3, TD|TF, SEN(faccessat), "faccessat" }, -[308] = { 6, TD, SEN(pselect6), "pselect6" }, -[309] = { 5, TD, SEN(ppoll), "ppoll" }, +[308] = { 6, TD, SEN(pselect6_time32), "pselect6" }, +[309] = { 5, TD, SEN(ppoll_time32), "ppoll" }, [310] = { 1, TP, SEN(unshare), "unshare" }, [311] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, [312] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, @@ -345,13 +326,13 @@ [317] = { 6, TM, SEN(move_pages), "move_pages" }, [318] = { 3, 0, SEN(getcpu), "getcpu" }, [319] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[320] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[320] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [321] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [322] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [323] = { 1, TD, SEN(eventfd), "eventfd" }, [324] = { 6, TD, SEN(fallocate), "fallocate" }, -[325] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, -[326] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[325] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" }, +[326] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" }, [327] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, [328] = { 2, TD, SEN(eventfd2), "eventfd2" }, [329] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, @@ -382,11 +363,11 @@ [354] = { 5, TN, SEN(getsockopt), "getsockopt" }, [355] = { 3, TN, SEN(sendmsg), "sendmsg" }, [356] = { 3, TN, SEN(recvmsg), "recvmsg" }, -[357] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[357] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" }, [358] = { 4, TN, SEN(accept4), "accept4" }, [359] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, [360] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[361] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[361] = { 2, 0, SEN(clock_adjtime32), "clock_adjtime" }, [362] = { 1, TD, SEN(syncfs), "syncfs" }, [363] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, [364] = { 2, TD, SEN(setns), "setns" }, @@ -408,6 +389,46 @@ [380] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, [381] = { 6, TD, SEN(preadv2), "preadv2" }, [382] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[383] = { 5, TD|TF|TSTA, SEN(statx), "statx" }, +[384] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, +[385] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, +[386] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[387] = { 4, 0, SEN(rseq), "rseq" }, +/* room for arch specific calls */ +[393] = { 3, TI, SEN(semget), "semget" }, +[394] = { 4, TI, SEN(semctl), "semctl" }, +[395] = { 3, TI, SEN(shmget), "shmget" }, +[396] = { 3, TI, SEN(shmctl), "shmctl" }, +[397] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[398] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[399] = { 2, TI, SEN(msgget), "msgget" }, +[400] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[401] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[402] = { 3, TI, SEN(msgctl), "msgctl" }, +[403] = { 2, 0, SEN(clock_gettime64), "clock_gettime64" }, +[404] = { 2, 0, SEN(clock_settime64), "clock_settime64" }, +[405] = { 2, 0, SEN(clock_adjtime64), "clock_adjtime64" }, +[406] = { 2, 0, SEN(clock_getres_time64), "clock_getres_time64" }, +[407] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep_time64"}, +[408] = { 2, 0, SEN(timer_gettime64), "timer_gettime64" }, +[409] = { 4, 0, SEN(timer_settime64), "timer_settime64" }, +[410] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime64" }, +[411] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime64" }, +[412] = { 4, TD|TF, SEN(utimensat_time64), "utimensat_time64" }, +[413] = { 6, TD, SEN(pselect6_time64), "pselect6_time64" }, +[414] = { 5, TD, SEN(ppoll_time64), "ppoll_time64" }, +[416] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents_time64" }, +[417] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg_time64" }, +[418] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend_time64" }, +[419] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive_time64"}, +[420] = { 4, TI, SEN(semtimedop_time64), "semtimedop_time64" }, +[421] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait_time64"}, +[422] = { 6, 0, SEN(futex_time64), "futex_time64" }, +[423] = { 2, 0, SEN(sched_rr_get_interval_time64), "sched_rr_get_interval_time64" }, +[424] = { 4, TD|TS, SEN(pidfd_send_signal), "pidfd_send_signal" }, +[425] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" }, +[426] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" }, +[427] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" }, -#define SYS_socket_subcall 400 -#include "subcall.h" +#define SYS_socket_subcall 500 +#include "subcall32.h" diff --git a/linux/sh/userent.h b/linux/sh/userent.h index 116861a9..8d769e5f 100644 --- a/linux/sh/userent.h +++ b/linux/sh/userent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + XLAT(4*REG_REG0), { 4*(REG_REG0+1), "4*REG_REG1" }, { 4*(REG_REG0+2), "4*REG_REG2" }, diff --git a/linux/sh/userent0.h b/linux/sh/userent0.h index 918805a1..c1d41224 100644 --- a/linux/sh/userent0.h +++ b/linux/sh/userent0.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + XLAT_UOFF(u_fpvalid), XLAT_UOFF(u_tsize), XLAT_UOFF(u_dsize), diff --git a/linux/sh64/arch_defs_.h b/linux/sh64/arch_defs_.h new file mode 100644 index 00000000..18f4d738 --- /dev/null +++ b/linux/sh64/arch_defs_.h @@ -0,0 +1,8 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define HAVE_ARCH_UID16_SYSCALLS 1 diff --git a/linux/sh64/arch_regs.c b/linux/sh64/arch_regs.c index 8b3202a8..9b3d4eb3 100644 --- a/linux/sh64/arch_regs.c +++ b/linux/sh64/arch_regs.c @@ -1,2 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static unsigned long sh64_r9; #define ARCH_PC_PEEK_ADDR REG_PC +#define ARCH_SP_PEEK_ADDR REG_GENERAL(15) diff --git a/linux/sh64/arch_regs.h b/linux/sh64/arch_regs.h index 7f64b497..5bf759d6 100644 --- a/linux/sh64/arch_regs.h +++ b/linux/sh64/arch_regs.h @@ -1,15 +1,22 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* SH64 Linux - this code assumes the following kernel API for system calls: - PC Offset 0 - System Call Offset 16 (actually, (syscall no.) | (0x1n << 16), - where n = no. of parameters. - Other regs Offset 24+ + PC Offset 0 + System Call Offset 16 (actually, (syscall no.) | (0x1n << 16), + where n = no. of parameters. + Other regs Offset 24+ - On entry: R2-7 = parameters 1-6 (as many as necessary) - On return: R9 = result. + On entry: R2-7 = parameters 1-6 (as many as necessary) + On return: R9 = result. */ /* Offset for peeks of registers */ -#define REG_OFFSET (24) -#define REG_GENERAL(x) (8*(x)+REG_OFFSET) -#define REG_PC (0*8) -#define REG_SYSCALL (2*8) +#define REG_OFFSET (24) +#define REG_GENERAL(x) (8*(x)+REG_OFFSET) +#define REG_PC (0*8) +#define REG_SYSCALL (2*8) diff --git a/linux/sh64/get_error.c b/linux/sh64/get_error.c index 7858df7c..795031c9 100644 --- a/linux/sh64/get_error.c +++ b/linux/sh64/get_error.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "negated_errno.h" + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { if (check_errno && is_negated_errno(sh64_r9)) { tcp->u_rval = -1; diff --git a/linux/sh64/get_scno.c b/linux/sh64/get_scno.c index 50a52232..c85786bd 100644 --- a/linux/sh64/get_scno.c +++ b/linux/sh64/get_scno.c @@ -1,8 +1,15 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) { - if (upeek(tcp->pid, REG_SYSCALL, &tcp->scno) < 0) + if (upeek(tcp, REG_SYSCALL, &tcp->scno) < 0) return -1; tcp->scno &= 0xffff; return 1; diff --git a/linux/sh64/get_syscall_args.c b/linux/sh64/get_syscall_args.c index 3970df8f..4b53e20e 100644 --- a/linux/sh64/get_syscall_args.c +++ b/linux/sh64/get_syscall_args.c @@ -1,13 +1,20 @@ +/* + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { /* Registers used by SH5 Linux system calls for parameters */ static const int syscall_regs[MAX_ARGS] = { 2, 3, 4, 5, 6, 7 }; unsigned int i; - for (i = 0; i < tcp->s_ent->nargs; ++i) - if (upeek(tcp->pid, REG_GENERAL(syscall_regs[i]), + for (i = 0; i < n_args(tcp); ++i) + if (upeek(tcp, REG_GENERAL(syscall_regs[i]), &tcp->u_arg[i]) < 0) return -1; return 1; diff --git a/linux/sh64/get_syscall_result.c b/linux/sh64/get_syscall_result.c index 4264dccc..1183f687 100644 --- a/linux/sh64/get_syscall_result.c +++ b/linux/sh64/get_syscall_result.c @@ -1,6 +1,13 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int get_syscall_result_regs(struct tcb *tcp) { /* ABI defines result returned in r9 */ - return upeek(tcp->pid, REG_GENERAL(9), &sh64_r9) < 0 ? -1 : 0; + return upeek(tcp, REG_GENERAL(9), &sh64_r9) < 0 ? -1 : 0; } diff --git a/linux/sh64/raw_syscall.h b/linux/sh64/raw_syscall.h new file mode 100644 index 00000000..2477b323 --- /dev/null +++ b/linux/sh64/raw_syscall.h @@ -0,0 +1 @@ +#include "sh/raw_syscall.h" diff --git a/linux/sh64/rt_sigframe.h b/linux/sh64/rt_sigframe.h new file mode 100644 index 00000000..f8da6554 --- /dev/null +++ b/linux/sh64/rt_sigframe.h @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RT_SIGFRAME_H +# define STRACE_RT_SIGFRAME_H + +# include + +typedef struct { + siginfo_t *pinfo; + void *puc; + siginfo_t info; + ucontext_t uc; + /* more data follows */ +} struct_rt_sigframe; + +#endif /* !STRACE_RT_SIGFRAME_H */ diff --git a/linux/sh64/set_error.c b/linux/sh64/set_error.c index 35271fb5..4a983571 100644 --- a/linux/sh64/set_error.c +++ b/linux/sh64/set_error.c @@ -1,13 +1,20 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_error(struct tcb *tcp) { sh64_r9 = -tcp->u_error; - return upoke(tcp->pid, REG_GENERAL(9), sh64_r9); + return upoke(tcp, REG_GENERAL(9), sh64_r9); } static int arch_set_success(struct tcb *tcp) { sh64_r9 = tcp->u_rval; - return upoke(tcp->pid, REG_GENERAL(9), sh64_r9); + return upoke(tcp, REG_GENERAL(9), sh64_r9); } diff --git a/linux/sh64/set_scno.c b/linux/sh64/set_scno.c index be4f1ed1..f7e0fdfa 100644 --- a/linux/sh64/set_scno.c +++ b/linux/sh64/set_scno.c @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { - return upoke(tcp->pid, REG_SYSCALL, scno); + return upoke(tcp, REG_SYSCALL, scno); } diff --git a/linux/sh64/syscallent.h b/linux/sh64/syscallent.h index e35ef6f3..a21b0c47 100644 --- a/linux/sh64/syscallent.h +++ b/linux/sh64/syscallent.h @@ -1,29 +1,10 @@ /* * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995 Rick Sladkey + * Copyright (c) 1995-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ [ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, @@ -44,17 +25,17 @@ [ 15] = { 2, TF, SEN(chmod), "chmod" }, [ 16] = { 3, TF, SEN(chown16), "lchown" }, [ 17] = { 0, TM, SEN(break), "break" }, -[ 18] = { 2, TF, SEN(oldstat), "oldstat" }, +[ 18] = { 2, TF|TST|TSTA, SEN(oldstat), "oldstat" }, [ 19] = { 3, TD, SEN(lseek), "lseek" }, -[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 20] = { 0, PU|NF, SEN(getpid), "getpid" }, [ 21] = { 5, TF, SEN(mount), "mount" }, [ 22] = { 1, TF, SEN(umount), "umount" }, [ 23] = { 1, 0, SEN(setuid16), "setuid" }, -[ 24] = { 0, NF, SEN(getuid16), "getuid" }, +[ 24] = { 0, PU|NF, SEN(getuid16), "getuid" }, [ 25] = { 1, 0, SEN(stime), "stime" }, [ 26] = { 4, 0, SEN(ptrace), "ptrace" }, [ 27] = { 1, 0, SEN(alarm), "alarm" }, -[ 28] = { 2, TD, SEN(oldfstat), "oldfstat" }, +[ 28] = { 2, TD|TFST|TSTA, SEN(oldfstat), "oldfstat" }, [ 29] = { 0, TS, SEN(pause), "pause" }, [ 30] = { 2, TF, SEN(utime), "utime" }, [ 31] = { 2, 0, SEN(stty), "stty" }, @@ -73,10 +54,10 @@ [ 44] = { 0, 0, SEN(prof), "prof" }, [ 45] = { 1, TM|SI, SEN(brk), "brk" }, [ 46] = { 1, 0, SEN(setgid16), "setgid" }, -[ 47] = { 0, NF, SEN(getgid16), "getgid" }, +[ 47] = { 0, PU|NF, SEN(getgid16), "getgid" }, [ 48] = { 2, TS, SEN(signal), "signal" }, -[ 49] = { 0, NF, SEN(geteuid16), "geteuid" }, -[ 50] = { 0, NF, SEN(getegid16), "getegid" }, +[ 49] = { 0, PU|NF, SEN(geteuid16), "geteuid" }, +[ 50] = { 0, PU|NF, SEN(getegid16), "getegid" }, [ 51] = { 1, TF, SEN(acct), "acct" }, [ 52] = { 2, TF, SEN(umount2), "umount2" }, [ 53] = { 0, 0, SEN(lock), "lock" }, @@ -88,17 +69,17 @@ [ 59] = { 1, 0, SEN(oldolduname), "oldolduname" }, [ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, -[ 62] = { 2, 0, SEN(ustat), "ustat" }, +[ 62] = { 2, TSFA, SEN(ustat), "ustat" }, [ 63] = { 2, TD, SEN(dup2), "dup2" }, -[ 64] = { 0, NF, SEN(getppid), "getppid" }, -[ 65] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 64] = { 0, PU|NF, SEN(getppid), "getppid" }, +[ 65] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, [ 66] = { 0, 0, SEN(setsid), "setsid" }, [ 67] = { 3, TS, SEN(sigaction), "sigaction" }, -[ 68] = { 0, TS, SEN(siggetmask), "sgetmask" }, -[ 69] = { 1, TS, SEN(sigsetmask), "ssetmask" }, +[ 68] = { 0, TS, SEN(sgetmask), "sgetmask" }, +[ 69] = { 1, TS, SEN(ssetmask), "ssetmask" }, [ 70] = { 2, 0, SEN(setreuid16), "setreuid" }, [ 71] = { 2, 0, SEN(setregid16), "setregid" }, -[ 72] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, +[ 72] = { 1, TS, SEN(sigsuspend), "sigsuspend" }, [ 73] = { 1, TS, SEN(sigpending), "sigpending" }, [ 74] = { 2, 0, SEN(sethostname), "sethostname" }, [ 75] = { 2, 0, SEN(setrlimit), "setrlimit" }, @@ -110,7 +91,7 @@ [ 81] = { 2, 0, SEN(setgroups16), "setgroups" }, [ 82] = { }, [ 83] = { 2, TF, SEN(symlink), "symlink" }, -[ 84] = { 2, TF, SEN(oldlstat), "oldlstat" }, +[ 84] = { 2, TF|TLST|TSTA, SEN(oldlstat), "oldlstat" }, [ 85] = { 3, TF, SEN(readlink), "readlink" }, [ 86] = { 1, TF, SEN(uselib), "uselib" }, [ 87] = { 2, TF, SEN(swapon), "swapon" }, @@ -125,16 +106,16 @@ [ 96] = { 2, 0, SEN(getpriority), "getpriority" }, [ 97] = { 3, 0, SEN(setpriority), "setpriority" }, [ 98] = { 4, 0, SEN(profil), "profil" }, -[ 99] = { 2, TF, SEN(statfs), "statfs" }, -[100] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[ 99] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[100] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, [101] = { 3, 0, SEN(ioperm), "ioperm" }, [102] = { 2, TD, SEN(socketcall), "socketcall" }, [103] = { 3, 0, SEN(syslog), "syslog" }, [104] = { 3, 0, SEN(setitimer), "setitimer" }, [105] = { 2, 0, SEN(getitimer), "getitimer" }, -[106] = { 2, TF, SEN(stat), "stat" }, -[107] = { 2, TF, SEN(lstat), "lstat" }, -[108] = { 2, TD, SEN(fstat), "fstat" }, +[106] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, +[107] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, +[108] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, [109] = { 1, 0, SEN(olduname), "olduname" }, [110] = { 1, 0, SEN(iopl), "iopl" }, [111] = { 0, 0, SEN(vhangup), "vhangup" }, @@ -150,7 +131,7 @@ [121] = { 2, 0, SEN(setdomainname), "setdomainname" }, [122] = { 1, 0, SEN(uname), "uname" }, [123] = { 3, 0, SEN(printargs), "cacheflush" }, -[124] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[124] = { 1, 0, SEN(adjtimex64), "adjtimex" }, [125] = { 3, TM|SI, SEN(mprotect), "mprotect" }, [126] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, [127] = { 2, 0, SEN(create_module), "create_module" }, @@ -187,14 +168,14 @@ [158] = { 0, 0, SEN(sched_yield), "sched_yield" }, [159] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [160] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[161] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, -[162] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[161] = { 2, 0, SEN(sched_rr_get_interval_time64),"sched_rr_get_interval"}, +[162] = { 2, 0, SEN(nanosleep_time64), "nanosleep" }, [163] = { 5, TM|SI, SEN(mremap), "mremap" }, [164] = { 3, 0, SEN(setresuid16), "setresuid" }, [165] = { 3, 0, SEN(getresuid16), "getresuid" }, [166] = { }, [167] = { 5, 0, SEN(query_module), "query_module" }, -[168] = { 3, TD, SEN(poll), "poll" }, +[168] = { 3, TD, SEN(poll_time64), "poll" }, [169] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, [170] = { 3, 0, SEN(setresgid16), "setresgid" }, [171] = { 3, 0, SEN(getresgid16), "getresgid" }, @@ -203,7 +184,7 @@ [174] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, [175] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, [176] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[177] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[177] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait" }, [178] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, [179] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, [180] = { 4, TD, SEN(pread), "pread64" }, @@ -220,14 +201,14 @@ [192] = { 6, TD|TM|SI, SEN(mmap_4koff), "mmap2" }, [193] = { 2, TF, SEN(truncate), "truncate64" }, [194] = { 2, TD, SEN(ftruncate), "ftruncate64" }, -[195] = { 2, TF, SEN(stat64), "stat64" }, -[196] = { 2, TF, SEN(lstat64), "lstat64" }, -[197] = { 2, TD, SEN(fstat64), "fstat64" }, +[195] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" }, +[196] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" }, +[197] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" }, [198] = { 3, TF, SEN(chown), "lchown32" }, -[199] = { 0, NF, SEN(getuid), "getuid32" }, -[200] = { 0, NF, SEN(getgid), "getgid32" }, -[201] = { 0, NF, SEN(geteuid), "geteuid32" }, -[202] = { 0, NF, SEN(getegid), "getegid32" }, +[199] = { 0, PU|NF, SEN(getuid), "getuid32" }, +[200] = { 0, PU|NF, SEN(getgid), "getgid32" }, +[201] = { 0, PU|NF, SEN(geteuid), "geteuid32" }, +[202] = { 0, PU|NF, SEN(getegid), "getegid32" }, [203] = { 2, 0, SEN(setreuid), "setreuid32" }, [204] = { 2, 0, SEN(setregid), "setregid32" }, [205] = { 2, 0, SEN(getgroups), "getgroups32" }, @@ -276,7 +257,7 @@ [248] = { 3, TD, SEN(getdents64), "getdents64" }, [249] = { 3, TD, SEN(fcntl64), "fcntl64" }, [250 ... 251] = { }, -[252] = { 0, NF, SEN(gettid), "gettid" }, +[252] = { 0, PU|NF, SEN(gettid), "gettid" }, [253] = { 3, TD, SEN(readahead), "readahead" }, [254] = { 5, TF, SEN(setxattr), "setxattr" }, [255] = { 5, TF, SEN(setxattr), "lsetxattr" }, @@ -292,13 +273,13 @@ [265] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [266] = { 2, TS, SEN(kill), "tkill" }, [267] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, -[268] = { 6, 0, SEN(futex), "futex" }, +[268] = { 6, 0, SEN(futex_time64), "futex" }, [269] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [270] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [271 ... 272] = { }, [273] = { 2, TM, SEN(io_setup), "io_setup" }, [274] = { 1, TM, SEN(io_destroy), "io_destroy" }, -[275] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[275] = { 5, 0, SEN(io_getevents_time64), "io_getevents" }, [276] = { 3, 0, SEN(io_submit), "io_submit" }, [277] = { 3, 0, SEN(io_cancel), "io_cancel" }, [278] = { 4, TD, SEN(fadvise64), "fadvise64" }, @@ -311,16 +292,16 @@ [285] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, [286] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [287] = { 3, 0, SEN(timer_create), "timer_create" }, -[288] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[289] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[288] = { 4, 0, SEN(timer_settime64), "timer_settime" }, +[289] = { 2, 0, SEN(timer_gettime64), "timer_gettime" }, [290] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, [291] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[292] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[293] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[294] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[295] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, -[296] = { 3, TF, SEN(statfs64), "statfs64" }, -[297] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[292] = { 2, 0, SEN(clock_settime64), "clock_settime" }, +[293] = { 2, 0, SEN(clock_gettime64), "clock_gettime" }, +[294] = { 2, 0, SEN(clock_getres_time64), "clock_getres" }, +[295] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep" }, +[296] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, +[297] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, [298] = { 3, TS, SEN(tgkill), "tgkill" }, [299] = { 2, TF, SEN(utimes), "utimes" }, [300] = { 4, TD, SEN(fadvise64_64), "fadvise64_64" }, @@ -328,12 +309,12 @@ [302] = { 6, TM, SEN(mbind), "mbind" }, [303] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, [304] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, -[305] = { 4, 0, SEN(mq_open), "mq_open" }, +[305] = { 4, TD, SEN(mq_open), "mq_open" }, [306] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[307] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[308] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[309] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[310] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[307] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend" }, +[308] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive" }, +[309] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[310] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, [311] = { 4, 0, SEN(kexec_load), "kexec_load" }, [312] = { 5, TP, SEN(waitid), "waitid" }, [313] = { 5, 0, SEN(add_key), "add_key" }, @@ -342,7 +323,7 @@ [316] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, [317] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, [318] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[319] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[319] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, [320] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, [321] = { }, [322] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, @@ -351,7 +332,7 @@ [325] = { 4, TD|TF, SEN(mknodat), "mknodat" }, [326] = { 5, TD|TF, SEN(fchownat), "fchownat" }, [327] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[328] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[328] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" }, [329] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, [330] = { 4, TD|TF, SEN(renameat), "renameat" }, [331] = { 5, TD|TF, SEN(linkat), "linkat" }, @@ -359,8 +340,8 @@ [333] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, [334] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, [335] = { 3, TD|TF, SEN(faccessat), "faccessat" }, -[336] = { 6, TD, SEN(pselect6), "pselect6" }, -[337] = { 5, TD, SEN(ppoll), "ppoll" }, +[336] = { 6, TD, SEN(pselect6_time64), "pselect6" }, +[337] = { 5, TD, SEN(ppoll_time64), "ppoll" }, [338] = { 1, TP, SEN(unshare), "unshare" }, [339] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, [340] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, @@ -371,13 +352,13 @@ [345] = { 6, TM, SEN(move_pages), "move_pages" }, [346] = { 3, 0, SEN(getcpu), "getcpu" }, [347] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[348] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[348] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" }, [349] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [350] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [351] = { 1, TD, SEN(eventfd), "eventfd" }, [352] = { 4, TD, SEN(fallocate), "fallocate" }, -[353] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, -[354] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[353] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime" }, +[354] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime" }, [355] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, [356] = { 2, TD, SEN(eventfd2), "eventfd2" }, [357] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, @@ -388,14 +369,14 @@ [362] = { 4, TD, SEN(pwritev), "pwritev" }, [363] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, [364] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, -[365] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[365] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg" }, [366] = { 4, TN, SEN(accept4), "accept4" }, [367] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, [368] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, [369] = { 4, 0, SEN(prlimit64), "prlimit64" }, [370] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, [371] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[372] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[372] = { 2, 0, SEN(clock_adjtime64), "clock_adjtime" }, [373] = { 1, TD, SEN(syncfs), "syncfs" }, [374] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, [375] = { 2, TD, SEN(setns), "setns" }, @@ -417,6 +398,11 @@ [391] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, [392] = { 6, TD, SEN(preadv2), "preadv2" }, [393] = { 6, TD, SEN(pwritev2), "pwritev2" }, +/* [403 ... 423] - reserved to sync up with other architectures */ +[424] = { 4, TD|TS, SEN(pidfd_send_signal), "pidfd_send_signal" }, +[425] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" }, +[426] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" }, +[427] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" }, -#define SYS_socket_subcall 400 -#include "subcall.h" +#define SYS_socket_subcall 500 +#include "subcall64.h" diff --git a/linux/sh64/userent.h b/linux/sh64/userent.h index e8810d29..ecff5f63 100644 --- a/linux/sh64/userent.h +++ b/linux/sh64/userent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + { 0, "PC(L)" }, { 4, "PC(U)" }, { 8, "SR(L)" }, diff --git a/linux/shuffle_scno.c b/linux/shuffle_scno.c new file mode 100644 index 00000000..dc1633d2 --- /dev/null +++ b/linux/shuffle_scno.c @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +kernel_ulong_t +shuffle_scno(kernel_ulong_t scno) +{ + return scno; +} diff --git a/linux/signal.h.in b/linux/signal.h.in new file mode 100644 index 00000000..44e7ea39 --- /dev/null +++ b/linux/signal.h.in @@ -0,0 +1,5 @@ +/* + * Workaround the infamous incompatibility between + * and many libc headers by overriding with . + */ +#include diff --git a/linux/signalent.h b/linux/signalent.h index 112f746c..b17ea843 100644 --- a/linux/signalent.h +++ b/linux/signalent.h @@ -1,4 +1,11 @@ - "SIG_0", /* 0 */ +/* + * Copyright (c) 1999-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + + "0", /* 0 */ "SIGHUP", /* 1 */ "SIGINT", /* 2 */ "SIGQUIT", /* 3 */ diff --git a/linux/smc_diag.h b/linux/smc_diag.h new file mode 100644 index 00000000..c4f2088b --- /dev/null +++ b/linux/smc_diag.h @@ -0,0 +1,99 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_LINUX_SMC_DIAG_H +# define STRACE_LINUX_SMC_DIAG_H + +# include + +# include "gcc_compat.h" + +/* Request structure */ +struct smc_diag_req { + uint8_t diag_family; + uint8_t pad[2]; + uint8_t diag_ext; /* Query extended information */ + struct inet_diag_sockid id; +}; + +struct smc_diag_msg { + uint8_t diag_family; + uint8_t diag_state; + uint8_t diag_fallback; + uint8_t diag_shutdown; + struct inet_diag_sockid id; + + uint32_t diag_uid; + uint64_t diag_inode; +}; + +/* Extensions */ +enum { + SMC_DIAG_NONE, + SMC_DIAG_CONNINFO, + SMC_DIAG_LGRINFO, + SMC_DIAG_SHUTDOWN, + SMC_DIAG_DMBINFO, + SMC_DIAG_FALLBACK, +}; + +/* SMC_DIAG_CONNINFO */ +struct smc_diag_cursor { + uint16_t reserved; + uint16_t wrap; + uint32_t count; +}; + +struct smc_diag_conninfo { + uint32_t token; + uint32_t sndbuf_size; + uint32_t rmbe_size; + uint32_t peer_rmbe_size; + struct smc_diag_cursor rx_prod; + struct smc_diag_cursor rx_cons; + struct smc_diag_cursor tx_prod; + struct smc_diag_cursor tx_cons; + uint8_t rx_prod_flags; + uint8_t rx_conn_state_flags; + uint8_t tx_prod_flags; + uint8_t tx_conn_state_flags; + struct smc_diag_cursor tx_prep; + struct smc_diag_cursor tx_sent; + struct smc_diag_cursor tx_fin; +}; + +/* SMC_DIAG_LINKINFO */ +struct smc_diag_linkinfo { + uint8_t link_id; + uint8_t ibname[64]; /* IB_DEVICE_NAME_MAX */ + uint8_t ibport; + uint8_t gid[40]; + uint8_t peer_gid[40]; +}; + +/* SMC_DIAG_LGRINFO */ +struct smc_diag_lgrinfo { + struct smc_diag_linkinfo lnk[1]; + uint8_t role; +}; + +/* SMC_DIAG_DMBINFO */ +struct smcd_diag_dmbinfo { + uint32_t linkid; + uint64_t ATTRIBUTE_ALIGNED(8) peer_gid; + uint64_t ATTRIBUTE_ALIGNED(8) my_gid; + uint64_t ATTRIBUTE_ALIGNED(8) token; + uint64_t ATTRIBUTE_ALIGNED(8) peer_token; +}; + +/* SMC_DIAG_FALLBACK */ +struct smc_diag_fallback { + uint32_t reason; + uint32_t peer_diagnosis; +}; + +#endif /* !STRACE_LINUX_SMC_DIAG_H */ diff --git a/linux/sock_diag.h b/linux/sock_diag.h index ba0c114f..50ce15ea 100644 --- a/linux/sock_diag.h +++ b/linux/sock_diag.h @@ -1,7 +1,17 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #ifndef STRACE_LINUX_SOCK_DIAG_H -#define STRACE_LINUX_SOCK_DIAG_H +# define STRACE_LINUX_SOCK_DIAG_H + +# define SOCK_DIAG_BY_FAMILY 20 +# define SOCK_DESTROY 21 -#define SOCK_DIAG_BY_FAMILY 20 +# define SK_MEMINFO_VARS 9 struct sock_diag_req { uint8_t sdiag_family; diff --git a/linux/sparc/arch_defs_.h b/linux/sparc/arch_defs_.h new file mode 100644 index 00000000..3549c95d --- /dev/null +++ b/linux/sparc/arch_defs_.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define HAVE_ARCH_GETRVAL2 1 +#define HAVE_ARCH_UID16_SYSCALLS 1 +#define HAVE_ARCH_SA_RESTORER 1 +#define HAVE_ARCH_DEDICATED_ERR_REG 1 +#define CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL 1 diff --git a/linux/sparc/arch_getrval2.c b/linux/sparc/arch_getrval2.c index 9079482c..fd8908bb 100644 --- a/linux/sparc/arch_getrval2.c +++ b/linux/sparc/arch_getrval2.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + long getrval2(struct tcb *tcp) { + if (ptrace_syscall_info_is_valid() && get_regs(tcp) < 0) + return -1; return sparc_regs.u_regs[U_REG_O1]; } diff --git a/linux/sparc/arch_regs.c b/linux/sparc/arch_regs.c index c0f22e6c..62d240f7 100644 --- a/linux/sparc/arch_regs.c +++ b/linux/sparc/arch_regs.c @@ -1,3 +1,19 @@ -struct pt_regs sparc_regs; /* not static */ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +static struct pt_regs sparc_regs; + +/* Indexes into the pt_regs.u_reg[] array -- UREG_XX from kernel are all off + * by 1 and use Ix instead of Ox. These work for both 32 and 64 bit Linux. */ +#define U_REG_G1 0 +#define U_REG_O0 7 +#define U_REG_O1 8 +#define U_REG_FP 13 + #define ARCH_REGS_FOR_GETREGS sparc_regs #define ARCH_PC_REG sparc_regs.pc +#define ARCH_SP_REG sparc_regs.u_regs[U_REG_FP] diff --git a/linux/sparc/arch_regs.h b/linux/sparc/arch_regs.h deleted file mode 100644 index ac11a1df..00000000 --- a/linux/sparc/arch_regs.h +++ /dev/null @@ -1,7 +0,0 @@ -extern struct pt_regs sparc_regs; -/* Indexes into the pt_regs.u_reg[] array -- UREG_XX from kernel are all off - * by 1 and use Ix instead of Ox. These work for both 32 and 64 bit Linux. */ -#define U_REG_G1 0 -#define U_REG_O0 7 -#define U_REG_O1 8 -#define U_REG_FP 13 diff --git a/linux/sparc/arch_sigreturn.c b/linux/sparc/arch_sigreturn.c index 2170a7ba..13b5dcca 100644 --- a/linux/sparc/arch_sigreturn.c +++ b/linux/sparc/arch_sigreturn.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #ifndef SIZEOF_STRUCT_SPARC_STACKF # define SIZEOF_STRUCT_SPARC_STACKF sizeof(struct sparc_stackf) #endif @@ -11,8 +18,10 @@ static void arch_sigreturn(struct tcb *tcp) { - unsigned long addr = sparc_regs.u_regs[U_REG_FP] + - SIZEOF_STRUCT_SPARC_STACKF + SIZEOF_STRUCT_PT_REGS; + kernel_ulong_t addr; + if (!get_stack_pointer(tcp, &addr)) + return; + addr += SIZEOF_STRUCT_SPARC_STACKF + SIZEOF_STRUCT_PT_REGS; struct { unsigned int mask; char fpu_save[PERSONALITY_WORDSIZE]; @@ -20,9 +29,7 @@ arch_sigreturn(struct tcb *tcp) unsigned int extramask[NSIG_BYTES / sizeof(int) - 1]; } frame; - if (umove(tcp, addr, &frame) < 0) { - tprintf("{mask=%#lx}", addr); - } else { + if (!umove_or_printaddr(tcp, addr, &frame)) { unsigned int mask[NSIG_BYTES / sizeof(int)]; mask[0] = frame.mask; diff --git a/linux/sparc/errnoent.h b/linux/sparc/errnoent.h index fe5ff07d..4e6d471a 100644 --- a/linux/sparc/errnoent.h +++ b/linux/sparc/errnoent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 1999-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + [ 1] = "EPERM", [ 2] = "ENOENT", [ 3] = "ESRCH", @@ -149,3 +156,4 @@ [527] = "EBADTYPE", [528] = "EJUKEBOX", [529] = "EIOCBQUEUED", +[530] = "ERECALLCONFLICT", diff --git a/linux/sparc/gen.pl b/linux/sparc/gen.pl deleted file mode 100644 index 8c2f75b9..00000000 --- a/linux/sparc/gen.pl +++ /dev/null @@ -1,37 +0,0 @@ -open SPARC, "syscallent.h" || die "no puedo abrir el de la sparc"; -open ALPHA, "../alpha/syscallent.h" || die "no puedo abrir el de la alpha"; -open PC, "../i386/syscallent.h" || die "no puedo abrir PC\n"; - -while () { - chop; - ($i1, $i2, $i3, $syscall, $syscall_name) = split; - $strn[$index] = $syscall_name; - $name[$index++] = $syscall; -} - -while (){ - if (/\{/) { - ($i1, $n, $pr, $syscall) = split; - $par{$syscall} = $n; - $prr{$syscall} = $pr; - } -} - -while (){ - if (/\{/) { - ($i1, $n, $pr, $syscall) = split; - $par{$syscall} = $n; - $prr{$syscall} = $pr; - } -} - -print "missing \n"; - -for ($i = 0; $i < $index; $i++){ - $x = $name[$i]; - $y = $strn[$i]; - $n = $par{$x}; - $p = $prr{$x}; - $j++; - print "\t{ $n\t$p\t$x\t$y },\t /* $j */\n"; -} diff --git a/linux/sparc/get_error.c b/linux/sparc/get_error.c index 1b960ace..b3e80c31 100644 --- a/linux/sparc/get_error.c +++ b/linux/sparc/get_error.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { if (sparc_regs.psr & PSR_C) { tcp->u_rval = -1; diff --git a/linux/sparc/get_scno.c b/linux/sparc/get_scno.c index f041259d..b515952a 100644 --- a/linux/sparc/get_scno.c +++ b/linux/sparc/get_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) diff --git a/linux/sparc/get_syscall_args.c b/linux/sparc/get_syscall_args.c index 57b5488e..96c61c44 100644 --- a/linux/sparc/get_syscall_args.c +++ b/linux/sparc/get_syscall_args.c @@ -1,6 +1,13 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { tcp->u_arg[0] = sparc_regs.u_regs[U_REG_O0 + 0]; tcp->u_arg[1] = sparc_regs.u_regs[U_REG_O0 + 1]; diff --git a/linux/sparc/raw_syscall.h b/linux/sparc/raw_syscall.h new file mode 100644 index 00000000..d4799fde --- /dev/null +++ b/linux/sparc/raw_syscall.h @@ -0,0 +1,38 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + register kernel_ulong_t g1 __asm__("g1") = nr; + register kernel_ulong_t rval __asm__("o0"); + __asm__ __volatile__("ta 0x10\n\t" + "bcc 1f\n\t" + "mov 0, %0\n\t" + "mov 1, %0\n\t" + "1:" + : "+r"(g1), "=r"(rval) + : + : "memory", "cc", "f0", "f1", "f2", "f3", "f4", + "f5", "f6", "f7", "f8", "f9", "f10", "f11", + "f12", "f13", "f14", "f15", "f16", "f17", + "f18", "f19", "f20", "f21", "f22", "f23", + "f24", "f25", "f26", "f27", "f28", "f29", + "f30", "f31"); + *err = g1; + return rval; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/sparc/rt_sigframe.h b/linux/sparc/rt_sigframe.h new file mode 100644 index 00000000..eb2e0410 --- /dev/null +++ b/linux/sparc/rt_sigframe.h @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RT_SIGFRAME_H +# define STRACE_RT_SIGFRAME_H + +# include "ptrace.h" +# include + +typedef struct { + struct sparc_stackf ss; + siginfo_t info; + struct pt_regs regs; + sigset_t mask; + /* more data follows */ +} struct_rt_sigframe; + +# define OFFSETOF_SIGMASK_IN_RT_SIGFRAME \ + offsetof(struct_rt_sigframe, mask) + +#endif /* !STRACE_RT_SIGFRAME_H */ diff --git a/linux/sparc/set_error.c b/linux/sparc/set_error.c index d285b7ca..7cffdd3f 100644 --- a/linux/sparc/set_error.c +++ b/linux/sparc/set_error.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_error(struct tcb *tcp) { diff --git a/linux/sparc/set_scno.c b/linux/sparc/set_scno.c index c891a0b5..813fc3a0 100644 --- a/linux/sparc/set_scno.c +++ b/linux/sparc/set_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* * Reloading the syscall number from %g1 register is supported * by linux kernel starting with commit v4.5-rc7~35^2~3. diff --git a/linux/sparc/signalent.h b/linux/sparc/signalent.h index 83ca9ca8..7a3a6281 100644 --- a/linux/sparc/signalent.h +++ b/linux/sparc/signalent.h @@ -1,4 +1,11 @@ - "SIG_0", /* 0 */ +/* + * Copyright (c) 1999-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + + "0", /* 0 */ "SIGHUP", /* 1 */ "SIGINT", /* 2 */ "SIGQUIT", /* 3 */ diff --git a/linux/sparc/syscallent.h b/linux/sparc/syscallent.h index ab27a15a..706c15e6 100644 --- a/linux/sparc/syscallent.h +++ b/linux/sparc/syscallent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 1999-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + [ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, [ 1] = { 1, TP|SE, SEN(exit), "exit" }, [ 2] = { 0, TP, SEN(fork), "fork" }, @@ -18,11 +25,11 @@ [ 17] = { 1, TM|SI, SEN(brk), "brk" }, [ 18] = { 4, 0, SEN(printargs), "perfctr" }, [ 19] = { 3, TD, SEN(lseek), "lseek" }, -[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 20] = { 0, PU|NF, SEN(getpid), "getpid" }, [ 21] = { 2, 0, SEN(capget), "capget" }, [ 22] = { 2, 0, SEN(capset), "capset" }, [ 23] = { 1, 0, SEN(setuid16), "setuid" }, -[ 24] = { 0, NF, SEN(getuid16), "getuid" }, +[ 24] = { 0, PU|NF, SEN(getuid16), "getuid" }, [ 25] = { 4, TD, SEN(vmsplice), "vmsplice" }, [ 26] = { 4, 0, SEN(ptrace), "ptrace" }, [ 27] = { 1, 0, SEN(alarm), "alarm" }, @@ -36,22 +43,22 @@ [ 35] = { 3, TF, SEN(chown), "chown32" }, [ 36] = { 0, 0, SEN(sync), "sync" }, [ 37] = { 2, TS, SEN(kill), "kill" }, -[ 38] = { 2, TF, SEN(stat), "stat" }, +[ 38] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, [ 39] = { 4, TD|TN, SEN(sendfile), "sendfile" }, -[ 40] = { 2, TF, SEN(lstat), "lstat" }, +[ 40] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, [ 41] = { 1, TD, SEN(dup), "dup" }, [ 42] = { 0, TD, SEN(pipe), "pipe" }, [ 43] = { 1, 0, SEN(times), "times" }, -[ 44] = { 0, NF, SEN(getuid), "getuid32" }, +[ 44] = { 0, PU|NF, SEN(getuid), "getuid32" }, [ 45] = { 2, TF, SEN(umount2), "umount2" }, [ 46] = { 1, 0, SEN(setgid16), "setgid" }, -[ 47] = { 0, NF, SEN(getgid16), "getgid" }, +[ 47] = { 0, PU|NF, SEN(getgid16), "getgid" }, [ 48] = { 2, TS, SEN(signal), "signal" }, -[ 49] = { 0, NF, SEN(geteuid16), "geteuid" }, -[ 50] = { 0, NF, SEN(getegid16), "getegid" }, +[ 49] = { 0, PU|NF, SEN(geteuid16), "geteuid" }, +[ 50] = { 0, PU|NF, SEN(getegid16), "getegid" }, [ 51] = { 1, TF, SEN(acct), "acct" }, [ 52] = { }, -[ 53] = { 0, NF, SEN(getgid), "getgid32" }, +[ 53] = { 0, PU|NF, SEN(getgid), "getgid32" }, [ 54] = { 3, TD, SEN(ioctl), "ioctl" }, [ 55] = { 4, 0, SEN(reboot), "reboot" }, [ 56] = { 6, TD|TM|SI, SEN(mmap_4koff), "mmap2" }, @@ -60,15 +67,15 @@ [ 59] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, [ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, -[ 62] = { 2, TD, SEN(fstat), "fstat" }, -[ 63] = { 2, TD, SEN(fstat64), "fstat64" }, -[ 64] = { 0, 0, SEN(getpagesize), "getpagesize" }, +[ 62] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, +[ 63] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" }, +[ 64] = { 0, PU|NF, SEN(getpagesize), "getpagesize" }, [ 65] = { 3, TM, SEN(msync), "msync" }, [ 66] = { 0, TP, SEN(vfork), "vfork" }, [ 67] = { 5, TD, SEN(pread), "pread64" }, [ 68] = { 5, TD, SEN(pwrite), "pwrite64" }, -[ 69] = { 0, NF, SEN(geteuid), "geteuid32" }, -[ 70] = { 0, NF, SEN(getegid), "getegid32" }, +[ 69] = { 0, PU|NF, SEN(geteuid), "geteuid32" }, +[ 70] = { 0, PU|NF, SEN(getegid), "getegid32" }, [ 71] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, [ 72] = { 2, 0, SEN(setreuid), "setreuid32" }, [ 73] = { 2, TM|SI, SEN(munmap), "munmap" }, @@ -79,7 +86,7 @@ [ 78] = { 3, TM, SEN(mincore), "mincore" }, [ 79] = { 2, 0, SEN(getgroups16), "getgroups" }, [ 80] = { 2, 0, SEN(setgroups16), "setgroups" }, -[ 81] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 81] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, [ 82] = { 2, 0, SEN(setgroups), "setgroups32" }, [ 83] = { 3, 0, SEN(setitimer), "setitimer" }, [ 84] = { 3, TD, SEN(ftruncate64), "ftruncate64" }, @@ -103,7 +110,7 @@ [102] = { 5, TS, SEN(rt_sigaction), "rt_sigaction" }, [103] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, [104] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[105] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[105] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" }, [106] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, [107] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, [108] = { 3, 0, SEN(setresuid), "setresuid32" }, @@ -130,18 +137,18 @@ [129] = { 2, TF, SEN(truncate), "truncate" }, [130] = { 2, TD, SEN(ftruncate), "ftruncate" }, [131] = { 2, TD, SEN(flock), "flock" }, -[132] = { 2, TF, SEN(lstat64), "lstat64" }, +[132] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" }, [133] = { 6, TN, SEN(sendto), "sendto" }, [134] = { 2, TN, SEN(shutdown), "shutdown" }, [135] = { 4, TN, SEN(socketpair), "socketpair" }, [136] = { 2, TF, SEN(mkdir), "mkdir" }, [137] = { 1, TF, SEN(rmdir), "rmdir" }, [138] = { 2, TF, SEN(utimes), "utimes" }, -[139] = { 2, TF, SEN(stat64), "stat64" }, +[139] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" }, [140] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, [141] = { 3, TN, SEN(getpeername), "getpeername" }, -[142] = { 6, 0, SEN(futex), "futex" }, -[143] = { 0, NF, SEN(gettid), "gettid" }, +[142] = { 6, 0, SEN(futex_time32), "futex" }, +[143] = { 0, PU|NF, SEN(gettid), "gettid" }, [144] = { 2, 0, SEN(getrlimit), "getrlimit" }, [145] = { 2, 0, SEN(setrlimit), "setrlimit" }, [146] = { 2, TF, SEN(pivotroot), "pivot_root" }, @@ -150,13 +157,13 @@ [149] = { 5, 0, SEN(printargs), "pciconfig_write" }, [150] = { 3, TN, SEN(getsockname), "getsockname" }, [151] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[152] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, -[153] = { 3, TD, SEN(poll), "poll" }, +[152] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, +[153] = { 3, TD, SEN(poll_time32), "poll" }, [154] = { 3, TD, SEN(getdents64), "getdents64" }, [155] = { 3, TD, SEN(fcntl64), "fcntl64" }, [156] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, -[157] = { 2, TF, SEN(statfs), "statfs" }, -[158] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[157] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[158] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, [159] = { 1, TF, SEN(umount), "umount" }, [160] = { 3, 0, SEN(sched_setaffinity), "sched_set_affinity" }, [161] = { 3, 0, SEN(sched_getaffinity), "sched_get_affinity" }, @@ -166,7 +173,7 @@ [165] = { 4, TF, SEN(quotactl), "quotactl" }, [166] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [167] = { 5, TF, SEN(mount), "mount" }, -[168] = { 2, 0, SEN(ustat), "ustat" }, +[168] = { 2, TSFA, SEN(ustat), "ustat" }, [169] = { 5, TF, SEN(setxattr), "setxattr" }, [170] = { 5, TF, SEN(setxattr), "lsetxattr" }, [171] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, @@ -195,12 +202,12 @@ [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, NF, SEN(getppid), "getppid" }, +[197] = { 0, PU|NF, SEN(getppid), "getppid" }, [198] = { 3, TS, SEN(sigaction), "sigaction" }, -[199] = { 0, TS, SEN(siggetmask), "sgetmask" }, -[200] = { 1, TS, SEN(sigsetmask), "ssetmask" }, -[201] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, -[202] = { 2, TF, SEN(lstat), "oldlstat" }, +[199] = { 0, TS, SEN(sgetmask), "sgetmask" }, +[200] = { 1, TS, SEN(ssetmask), "ssetmask" }, +[201] = { 1, TS, SEN(sigsuspend), "sigsuspend" }, +[202] = { 2, TF|TLST|TSTA, SEN(lstat), "oldlstat" }, [203] = { 1, TF, SEN(uselib), "uselib" }, [204] = { 3, TD, SEN(readdir), "readdir" }, [205] = { 4, TD, SEN(readahead), "readahead" }, @@ -217,7 +224,7 @@ [216] = { 0, TS, SEN(sigreturn), "sigreturn" }, [217] = { 5, TP, SEN(clone), "clone" }, [218] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, -[219] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[219] = { 1, 0, SEN(adjtimex32), "adjtimex" }, [220] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, [221] = { 2, 0, SEN(create_module), "create_module" }, [222] = { 2, 0, SEN(delete_module), "delete_module" }, @@ -232,8 +239,8 @@ [231] = { 1, 0, SEN(time), "time" }, [232] = { 6, TD, SEN(splice), "splice" }, [233] = { 1, 0, SEN(stime), "stime" }, -[234] = { 3, TF, SEN(statfs64), "statfs64" }, -[235] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[234] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, +[235] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, [236] = { 5, TD, SEN(llseek), "_llseek" }, [237] = { 2, TM, SEN(mlock), "mlock" }, [238] = { 2, TM, SEN(munlock), "munlock" }, @@ -246,22 +253,22 @@ [245] = { 0, 0, SEN(sched_yield), "sched_yield" }, [246] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [247] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[248] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, -[249] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[248] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"}, +[249] = { 2, 0, SEN(nanosleep_time32), "nanosleep" }, [250] = { 5, TM|SI, SEN(mremap), "mremap" }, [251] = { 1, 0, SEN(sysctl), "_sysctl" }, [252] = { 1, 0, SEN(getsid), "getsid" }, [253] = { 1, TD, SEN(fdatasync), "fdatasync" }, [254] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, [255] = { 6, TD, SEN(sync_file_range), "sync_file_range" }, -[256] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[257] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[258] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[259] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[256] = { 2, 0, SEN(clock_settime32), "clock_settime" }, +[257] = { 2, 0, SEN(clock_gettime32), "clock_gettime" }, +[258] = { 2, 0, SEN(clock_getres_time32), "clock_getres" }, +[259] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" }, [260] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [261] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, -[262] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[263] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[262] = { 4, 0, SEN(timer_settime32), "timer_settime" }, +[263] = { 2, 0, SEN(timer_gettime32), "timer_gettime" }, [264] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, [265] = { 1, 0, SEN(timer_delete), "timer_delete" }, [266] = { 3, 0, SEN(timer_create), "timer_create" }, @@ -270,13 +277,13 @@ [269] = { 1, TM, SEN(io_destroy), "io_destroy" }, [270] = { 3, 0, SEN(io_submit), "io_submit" }, [271] = { 3, 0, SEN(io_cancel), "io_cancel" }, -[272] = { 5, 0, SEN(io_getevents), "io_getevents" }, -[273] = { 4, 0, SEN(mq_open), "mq_open" }, +[272] = { 5, 0, SEN(io_getevents_time32), "io_getevents" }, +[273] = { 4, TD, SEN(mq_open), "mq_open" }, [274] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[275] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[276] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[277] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[278] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[275] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" }, +[276] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" }, +[277] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[278] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, [279] = { 5, TP, SEN(waitid), "waitid" }, [280] = { 4, TD, SEN(tee), "tee" }, [281] = { 5, 0, SEN(add_key), "add_key" }, @@ -287,7 +294,7 @@ [286] = { 4, TD|TF, SEN(mknodat), "mknodat" }, [287] = { 5, TD|TF, SEN(fchownat), "fchownat" }, [288] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[289] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[289] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" }, [290] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, [291] = { 4, TD|TF, SEN(renameat), "renameat" }, [292] = { 5, TD|TF, SEN(linkat), "linkat" }, @@ -295,8 +302,8 @@ [294] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, [295] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, [296] = { 3, TD|TF, SEN(faccessat), "faccessat" }, -[297] = { 6, TD, SEN(pselect6), "pselect6" }, -[298] = { 5, TD, SEN(ppoll), "ppoll" }, +[297] = { 6, TD, SEN(pselect6_time32), "pselect6" }, +[298] = { 5, TD, SEN(ppoll_time32), "ppoll" }, [299] = { 1, TP, SEN(unshare), "unshare" }, [300] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, [301] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, @@ -308,13 +315,13 @@ [307] = { 6, TM, SEN(move_pages), "move_pages" }, [308] = { 3, 0, SEN(getcpu), "getcpu" }, [309] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[310] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[310] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [311] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [312] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [313] = { 1, TD, SEN(eventfd), "eventfd" }, [314] = { 6, TD, SEN(fallocate), "fallocate" }, -[315] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, -[316] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[315] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" }, +[316] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" }, [317] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, [318] = { 2, TD, SEN(eventfd2), "eventfd2" }, [319] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, @@ -326,19 +333,19 @@ [325] = { 5, TD, SEN(pwritev), "pwritev" }, [326] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, [327] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, -[328] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[328] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" }, [329] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, [330] = { 6, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, [331] = { 4, 0, SEN(prlimit64), "prlimit64" }, [332] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, [333] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[334] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[334] = { 2, 0, SEN(clock_adjtime32), "clock_adjtime" }, [335] = { 1, TD, SEN(syncfs), "syncfs" }, [336] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, [337] = { 2, TD, SEN(setns), "setns" }, [338] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, [339] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, -[340] = { 0, NF, SEN(printargs), "kern_features" }, +[340] = { 0, PU, SEN(kern_features), "kern_features" }, [341] = { 5, 0, SEN(kcmp), "kcmp" }, [342] = { 3, TD, SEN(finit_module), "finit_module" }, [343] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, @@ -358,6 +365,47 @@ [357] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, [358] = { 6, TD, SEN(preadv2), "preadv2" }, [359] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[360] = { 5, TD|TF|TSTA, SEN(statx), "statx" }, +[361] = { 6, 0, SEN(io_pgetevents_time32), "io_pgetevents" }, +[362] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, +[363] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, +[364] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[365] = { 4, 0, SEN(rseq), "rseq" }, +/* room for arch specific calls */ +[393] = { 3, TI, SEN(semget), "semget" }, +[394] = { 4, TI, SEN(semctl), "semctl" }, +[395] = { 3, TI, SEN(shmget), "shmget" }, +[396] = { 3, TI, SEN(shmctl), "shmctl" }, +[397] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[398] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[399] = { 2, TI, SEN(msgget), "msgget" }, +[400] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[401] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[402] = { 3, TI, SEN(msgctl), "msgctl" }, +[403] = { 2, 0, SEN(clock_gettime64), "clock_gettime64" }, +[404] = { 2, 0, SEN(clock_settime64), "clock_settime64" }, +[405] = { 2, 0, SEN(clock_adjtime64), "clock_adjtime64" }, +[406] = { 2, 0, SEN(clock_getres_time64), "clock_getres_time64" }, +[407] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep_time64"}, +[408] = { 2, 0, SEN(timer_gettime64), "timer_gettime64" }, +[409] = { 4, 0, SEN(timer_settime64), "timer_settime64" }, +[410] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime64" }, +[411] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime64" }, +[412] = { 4, TD|TF, SEN(utimensat_time64), "utimensat_time64" }, +[413] = { 6, TD, SEN(pselect6_time64), "pselect6_time64" }, +[414] = { 5, TD, SEN(ppoll_time64), "ppoll_time64" }, +[416] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents_time64" }, +[417] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg_time64" }, +[418] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend_time64" }, +[419] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive_time64"}, +[420] = { 4, TI, SEN(semtimedop_time64), "semtimedop_time64" }, +[421] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait_time64"}, +[422] = { 6, 0, SEN(futex_time64), "futex_time64" }, +[423] = { 2, 0, SEN(sched_rr_get_interval_time64), "sched_rr_get_interval_time64" }, +[424] = { 4, TD|TS, SEN(pidfd_send_signal), "pidfd_send_signal" }, +[425] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" }, +[426] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" }, +[427] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" }, -#define SYS_socket_subcall 400 -#include "subcall.h" +#define SYS_socket_subcall 500 +#include "subcall32.h" diff --git a/linux/sparc64/arch_defs_.h b/linux/sparc64/arch_defs_.h new file mode 100644 index 00000000..68eef4fc --- /dev/null +++ b/linux/sparc64/arch_defs_.h @@ -0,0 +1,12 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define HAVE_ARCH_GETRVAL2 1 +#define HAVE_ARCH_UID16_SYSCALLS 1 +#define HAVE_ARCH_SA_RESTORER 1 +#define SUPPORTED_PERSONALITIES 2 +#define HAVE_ARCH_DEDICATED_ERR_REG 1 diff --git a/linux/sparc64/arch_get_personality.c b/linux/sparc64/arch_get_personality.c new file mode 100644 index 00000000..36d11915 --- /dev/null +++ b/linux/sparc64/arch_get_personality.c @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef AUDIT_ARCH_SPARC +# define AUDIT_ARCH_SPARC 0x2 +#endif + +int +get_personality_from_syscall_info(const struct ptrace_syscall_info *sci) +{ + return sci->arch == AUDIT_ARCH_SPARC; +} diff --git a/linux/sparc64/arch_regs.c b/linux/sparc64/arch_regs.c index c1c2fae2..07f0e405 100644 --- a/linux/sparc64/arch_regs.c +++ b/linux/sparc64/arch_regs.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "sparc/arch_regs.c" #undef ARCH_PC_REG #define ARCH_PC_REG sparc_regs.tpc diff --git a/linux/sparc64/arch_regs.h b/linux/sparc64/arch_regs.h deleted file mode 100644 index a49ad539..00000000 --- a/linux/sparc64/arch_regs.h +++ /dev/null @@ -1 +0,0 @@ -#include "sparc/arch_regs.h" diff --git a/linux/sparc64/arch_rt_sigframe.c b/linux/sparc64/arch_rt_sigframe.c new file mode 100644 index 00000000..3af454d2 --- /dev/null +++ b/linux/sparc64/arch_rt_sigframe.c @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define STACK_BIAS 2047 + +FUNC_GET_RT_SIGFRAME_ADDR +{ + kernel_ulong_t sp; + if (!get_stack_pointer(tcp, &sp)) + return 0; + return tcp->currpers == 1 ? sp & 0xffffffffUL + : sp + STACK_BIAS; +} diff --git a/linux/sparc64/arch_sigreturn.c b/linux/sparc64/arch_sigreturn.c index feac9da6..6a9f4c35 100644 --- a/linux/sparc64/arch_sigreturn.c +++ b/linux/sparc64/arch_sigreturn.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #define arch_sigreturn sparc64_arch_sigreturn #include "sparc/arch_sigreturn.c" #undef arch_sigreturn diff --git a/linux/sparc64/errnoent1.h b/linux/sparc64/errnoent1.h deleted file mode 100644 index c0f7787d..00000000 --- a/linux/sparc64/errnoent1.h +++ /dev/null @@ -1 +0,0 @@ -#include "errnoent.h" diff --git a/linux/sparc64/get_error.c b/linux/sparc64/get_error.c index 8f8978b6..f254e2bf 100644 --- a/linux/sparc64/get_error.c +++ b/linux/sparc64/get_error.c @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { if (sparc_regs.tstate & 0x1100000000UL) { tcp->u_rval = -1; diff --git a/linux/sparc64/get_scno.c b/linux/sparc64/get_scno.c index 4abe2a1f..56ecbce2 100644 --- a/linux/sparc64/get_scno.c +++ b/linux/sparc64/get_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) @@ -6,18 +13,18 @@ arch_get_scno(struct tcb *tcp) unsigned long trap; errno = 0; trap = ptrace(PTRACE_PEEKTEXT, tcp->pid, (void *) sparc_regs.tpc, 0); - if (errno) - return -1; - trap >>= 32; - switch (trap) { - case 0x91d02010: - /* Linux/SPARC syscall trap. */ - update_personality(tcp, 1); - break; - case 0x91d0206d: - /* Linux/SPARC64 syscall trap. */ - update_personality(tcp, 0); - break; + if (errno == 0) { + trap >>= 32; + switch (trap) { + case 0x91d02010: + /* Linux/SPARC syscall trap. */ + update_personality(tcp, 1); + break; + case 0x91d0206d: + /* Linux/SPARC64 syscall trap. */ + update_personality(tcp, 0); + break; + } } tcp->scno = sparc_regs.u_regs[U_REG_G1]; diff --git a/linux/sparc64/get_syscall_args.c b/linux/sparc64/get_syscall_args.c index f5c1aa6f..40a306ce 100644 --- a/linux/sparc64/get_syscall_args.c +++ b/linux/sparc64/get_syscall_args.c @@ -1,6 +1,13 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { if (tcp->currpers == 1) { /* diff --git a/linux/sparc64/raw_syscall.h b/linux/sparc64/raw_syscall.h new file mode 100644 index 00000000..efb73277 --- /dev/null +++ b/linux/sparc64/raw_syscall.h @@ -0,0 +1,40 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + register kernel_ulong_t g1 __asm__("g1") = nr; + register kernel_ulong_t rval __asm__("o0"); + __asm__ __volatile__("ta 0x6d\n\t" + "bcc,pt %%xcc, 1f\n\t" + "mov 0, %0\n\t" + "mov 1, %0\n\t" + "1:" + : "+r"(g1), "=r"(rval) + : + : "memory", "cc", "f0", "f1", "f2", "f3", "f4", + "f5", "f6", "f7", "f8", "f9", "f10", "f11", + "f12", "f13", "f14", "f15", "f16", "f17", + "f18", "f19", "f20", "f21", "f22", "f23", + "f24", "f25", "f26", "f27", "f28", "f29", + "f30", "f31", "f32", "f34", "f36", "f38", + "f40", "f42", "f44", "f46", "f48", "f50", + "f52", "f54", "f56", "f58", "f60", "f62"); + *err = g1; + return rval; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/sparc64/rt_sigframe.h b/linux/sparc64/rt_sigframe.h new file mode 100644 index 00000000..b6b4cc40 --- /dev/null +++ b/linux/sparc64/rt_sigframe.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef __arch64__ +# include "sparc/rt_sigframe.h" +#else +# ifndef STRACE_RT_SIGFRAME_H +# define STRACE_RT_SIGFRAME_H + +# include "ptrace.h" +# include + +typedef struct { + struct sparc_stackf ss; + siginfo_t info; + struct pt_regs regs; + void *fpu_save; + stack_t stack; + sigset_t mask; + /* more data follows */ +} struct_rt_sigframe; + +# define OFFSETOF_SIGMASK_IN_RT_SIGFRAME \ + offsetof(struct_rt_sigframe, mask) + +# endif /* !STRACE_RT_SIGFRAME_H */ +#endif /* __arch64__ */ diff --git a/linux/sparc64/set_error.c b/linux/sparc64/set_error.c index 6c266af9..e89c578e 100644 --- a/linux/sparc64/set_error.c +++ b/linux/sparc64/set_error.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_error(struct tcb *tcp) { diff --git a/linux/sparc64/signalent1.h b/linux/sparc64/signalent1.h deleted file mode 100644 index 093cba7f..00000000 --- a/linux/sparc64/signalent1.h +++ /dev/null @@ -1 +0,0 @@ -#include "signalent.h" diff --git a/linux/sparc64/syscallent.h b/linux/sparc64/syscallent.h index ffc35a19..1023b07d 100644 --- a/linux/sparc64/syscallent.h +++ b/linux/sparc64/syscallent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2004-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + [ 0] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, [ 1] = { 1, TP|SE, SEN(exit), "exit" }, [ 2] = { 0, TP, SEN(fork), "fork" }, @@ -18,11 +25,11 @@ [ 17] = { 1, TM|SI, SEN(brk), "brk" }, [ 18] = { 4, 0, SEN(printargs), "perfctr" }, [ 19] = { 3, TD, SEN(lseek), "lseek" }, -[ 20] = { 0, NF, SEN(getpid), "getpid" }, +[ 20] = { 0, PU|NF, SEN(getpid), "getpid" }, [ 21] = { 2, 0, SEN(capget), "capget" }, [ 22] = { 2, 0, SEN(capset), "capset" }, [ 23] = { 1, 0, SEN(setuid), "setuid" }, -[ 24] = { 0, NF, SEN(getuid), "getuid" }, +[ 24] = { 0, PU|NF, SEN(getuid), "getuid" }, [ 25] = { 4, TD, SEN(vmsplice), "vmsplice" }, [ 26] = { 4, 0, SEN(ptrace), "ptrace" }, [ 27] = { 1, 0, SEN(alarm), "alarm" }, @@ -35,19 +42,19 @@ [ 35] = { }, [ 36] = { 0, 0, SEN(sync), "sync" }, [ 37] = { 2, TS, SEN(kill), "kill" }, -[ 38] = { 2, TF, SEN(stat), "stat" }, +[ 38] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, [ 39] = { 4, TD|TN, SEN(sendfile), "sendfile" }, -[ 40] = { 2, TF, SEN(lstat), "lstat" }, +[ 40] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, [ 41] = { 1, TD, SEN(dup), "dup" }, [ 42] = { 0, TD, SEN(pipe), "pipe" }, [ 43] = { 1, 0, SEN(times), "times" }, [ 44] = { }, [ 45] = { 2, TF, SEN(umount2), "umount2" }, [ 46] = { 1, 0, SEN(setgid), "setgid" }, -[ 47] = { 0, NF, SEN(getgid), "getgid" }, +[ 47] = { 0, PU|NF, SEN(getgid), "getgid" }, [ 48] = { 2, TS, SEN(signal), "signal" }, -[ 49] = { 0, NF, SEN(geteuid), "geteuid" }, -[ 50] = { 0, NF, SEN(getegid), "getegid" }, +[ 49] = { 0, PU|NF, SEN(geteuid), "geteuid" }, +[ 50] = { 0, PU|NF, SEN(getegid), "getegid" }, [ 51] = { 1, TF, SEN(acct), "acct" }, [ 52] = { 2, 0, SEN(printargs), "memory_ordering" }, [ 53] = { }, @@ -59,9 +66,9 @@ [ 59] = { 3, TF|TP|SE|SI, SEN(execve), "execve" }, [ 60] = { 1, NF, SEN(umask), "umask" }, [ 61] = { 1, TF, SEN(chroot), "chroot" }, -[ 62] = { 2, TD, SEN(fstat), "fstat" }, -[ 63] = { 2, TD, SEN(fstat64), "fstat64" }, -[ 64] = { 0, 0, SEN(getpagesize), "getpagesize" }, +[ 62] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, +[ 63] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" }, +[ 64] = { 0, PU|NF, SEN(getpagesize), "getpagesize" }, [ 65] = { 3, TM, SEN(msync), "msync" }, [ 66] = { 0, TP, SEN(vfork), "vfork" }, [ 67] = { 4, TD, SEN(pread), "pread64" }, @@ -77,7 +84,7 @@ [ 78] = { 3, TM, SEN(mincore), "mincore" }, [ 79] = { 2, 0, SEN(getgroups), "getgroups" }, [ 80] = { 2, 0, SEN(setgroups), "setgroups" }, -[ 81] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[ 81] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, [ 82] = { }, [ 83] = { 3, 0, SEN(setitimer), "setitimer" }, [ 84] = { }, @@ -101,7 +108,7 @@ [102] = { 5, TS, SEN(rt_sigaction), "rt_sigaction" }, [103] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, [104] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[105] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[105] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait" }, [106] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, [107] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, [108] = { 3, 0, SEN(setresuid), "setresuid" }, @@ -128,18 +135,18 @@ [129] = { 2, TF, SEN(truncate), "truncate" }, [130] = { 2, TD, SEN(ftruncate), "ftruncate" }, [131] = { 2, TD, SEN(flock), "flock" }, -[132] = { 2, TF, SEN(lstat64), "lstat64" }, +[132] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" }, [133] = { 6, TN, SEN(sendto), "sendto" }, [134] = { 2, TN, SEN(shutdown), "shutdown" }, [135] = { 4, TN, SEN(socketpair), "socketpair" }, [136] = { 2, TF, SEN(mkdir), "mkdir" }, [137] = { 1, TF, SEN(rmdir), "rmdir" }, [138] = { 2, TF, SEN(utimes), "utimes" }, -[139] = { 2, TF, SEN(stat64), "stat64" }, +[139] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" }, [140] = { 4, TD|TN, SEN(sendfile64), "sendfile64" }, [141] = { 3, TN, SEN(getpeername), "getpeername" }, -[142] = { 6, 0, SEN(futex), "futex" }, -[143] = { 0, NF, SEN(gettid), "gettid" }, +[142] = { 6, 0, SEN(futex_time64), "futex" }, +[143] = { 0, PU|NF, SEN(gettid), "gettid" }, [144] = { 2, 0, SEN(getrlimit), "getrlimit" }, [145] = { 2, 0, SEN(setrlimit), "setrlimit" }, [146] = { 2, TF, SEN(pivotroot), "pivot_root" }, @@ -148,13 +155,13 @@ [149] = { 5, 0, SEN(printargs), "pciconfig_write" }, [150] = { 3, TN, SEN(getsockname), "getsockname" }, [151] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[152] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, -[153] = { 3, TD, SEN(poll), "poll" }, +[152] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, +[153] = { 3, TD, SEN(poll_time64), "poll" }, [154] = { 3, TD, SEN(getdents64), "getdents64" }, [155] = { }, [156] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, -[157] = { 2, TF, SEN(statfs), "statfs" }, -[158] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[157] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[158] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, [159] = { 1, TF, SEN(umount), "umount" }, [160] = { 3, 0, SEN(sched_setaffinity), "sched_set_affinity" }, [161] = { 3, 0, SEN(sched_getaffinity), "sched_get_affinity" }, @@ -164,7 +171,7 @@ [165] = { 4, TF, SEN(quotactl), "quotactl" }, [166] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [167] = { 5, TF, SEN(mount), "mount" }, -[168] = { 2, 0, SEN(ustat), "ustat" }, +[168] = { 2, TSFA, SEN(ustat), "ustat" }, [169] = { 5, TF, SEN(setxattr), "setxattr" }, [170] = { 5, TF, SEN(setxattr), "lsetxattr" }, [171] = { 5, TD, SEN(fsetxattr), "fsetxattr" }, @@ -193,12 +200,12 @@ [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, NF, SEN(getppid), "getppid" }, +[197] = { 0, PU|NF, SEN(getppid), "getppid" }, [198] = { 3, TS, SEN(sigaction), "sigaction" }, -[199] = { 0, TS, SEN(siggetmask), "sgetmask" }, -[200] = { 1, TS, SEN(sigsetmask), "ssetmask" }, -[201] = { 3, TS, SEN(sigsuspend), "sigsuspend" }, -[202] = { 2, TF, SEN(lstat), "oldlstat" }, +[199] = { 0, TS, SEN(sgetmask), "sgetmask" }, +[200] = { 1, TS, SEN(ssetmask), "ssetmask" }, +[201] = { 1, TS, SEN(sigsuspend), "sigsuspend" }, +[202] = { 2, TF|TLST|TSTA, SEN(lstat), "oldlstat" }, [203] = { 1, TF, SEN(uselib), "uselib" }, [204] = { 3, TD, SEN(readdir), "readdir" }, [205] = { 3, TD, SEN(readahead), "readahead" }, @@ -215,7 +222,7 @@ [216] = { 0, TS, SEN(sigreturn), "sigreturn" }, [217] = { 5, TP, SEN(clone), "clone" }, [218] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, -[219] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[219] = { 1, 0, SEN(adjtimex64), "adjtimex" }, [220] = { 3, TS, SEN(sigprocmask), "sigprocmask" }, [221] = { 2, 0, SEN(create_module), "create_module" }, [222] = { 2, 0, SEN(delete_module), "delete_module" }, @@ -230,8 +237,8 @@ [231] = { }, [232] = { 6, TD, SEN(splice), "splice" }, [233] = { 1, 0, SEN(stime), "stime" }, -[234] = { 3, TF, SEN(statfs64), "statfs64" }, -[235] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[234] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, +[235] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, [236] = { 5, TD, SEN(llseek), "_llseek" }, [237] = { 2, TM, SEN(mlock), "mlock" }, [238] = { 2, TM, SEN(munlock), "munlock" }, @@ -244,22 +251,22 @@ [245] = { 0, 0, SEN(sched_yield), "sched_yield" }, [246] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [247] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[248] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, -[249] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[248] = { 2, 0, SEN(sched_rr_get_interval_time64),"sched_rr_get_interval"}, +[249] = { 2, 0, SEN(nanosleep_time64), "nanosleep" }, [250] = { 5, TM|SI, SEN(mremap), "mremap" }, [251] = { 1, 0, SEN(sysctl), "_sysctl" }, [252] = { 1, 0, SEN(getsid), "getsid" }, [253] = { 1, TD, SEN(fdatasync), "fdatasync" }, [254] = { 3, 0, SEN(nfsservctl), "nfsservctl" }, [255] = { 4, TD, SEN(sync_file_range), "sync_file_range" }, -[256] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[257] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[258] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[259] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[256] = { 2, 0, SEN(clock_settime64), "clock_settime" }, +[257] = { 2, 0, SEN(clock_gettime64), "clock_gettime" }, +[258] = { 2, 0, SEN(clock_getres_time64), "clock_getres" }, +[259] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep" }, [260] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [261] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, -[262] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[263] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[262] = { 4, 0, SEN(timer_settime64), "timer_settime" }, +[263] = { 2, 0, SEN(timer_gettime64), "timer_gettime" }, [264] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, [265] = { 1, 0, SEN(timer_delete), "timer_delete" }, [266] = { 3, 0, SEN(timer_create), "timer_create" }, @@ -268,13 +275,13 @@ [269] = { 1, TM, SEN(io_destroy), "io_destroy" }, [270] = { 3, 0, SEN(io_submit), "io_submit" }, [271] = { 3, 0, SEN(io_cancel), "io_cancel" }, -[272] = { 5, 0, SEN(io_getevents), "io_getevents" }, -[273] = { 4, 0, SEN(mq_open), "mq_open" }, +[272] = { 5, 0, SEN(io_getevents_time64), "io_getevents" }, +[273] = { 4, TD, SEN(mq_open), "mq_open" }, [274] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[275] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[276] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[277] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[278] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[275] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend" }, +[276] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive" }, +[277] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[278] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, [279] = { 5, TP, SEN(waitid), "waitid" }, [280] = { 4, TD, SEN(tee), "tee" }, [281] = { 5, 0, SEN(add_key), "add_key" }, @@ -285,7 +292,7 @@ [286] = { 4, TD|TF, SEN(mknodat), "mknodat" }, [287] = { 5, TD|TF, SEN(fchownat), "fchownat" }, [288] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[289] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[289] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" }, [290] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, [291] = { 4, TD|TF, SEN(renameat), "renameat" }, [292] = { 5, TD|TF, SEN(linkat), "linkat" }, @@ -293,8 +300,8 @@ [294] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, [295] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, [296] = { 3, TD|TF, SEN(faccessat), "faccessat" }, -[297] = { 6, TD, SEN(pselect6), "pselect6" }, -[298] = { 5, TD, SEN(ppoll), "ppoll" }, +[297] = { 6, TD, SEN(pselect6_time64), "pselect6" }, +[298] = { 5, TD, SEN(ppoll_time64), "ppoll" }, [299] = { 1, TP, SEN(unshare), "unshare" }, [300] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, [301] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, @@ -306,13 +313,13 @@ [307] = { 6, TM, SEN(move_pages), "move_pages" }, [308] = { 3, 0, SEN(getcpu), "getcpu" }, [309] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, -[310] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[310] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" }, [311] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [312] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [313] = { 1, TD, SEN(eventfd), "eventfd" }, [314] = { 4, TD, SEN(fallocate), "fallocate" }, -[315] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, -[316] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[315] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime" }, +[316] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime" }, [317] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, [318] = { 2, TD, SEN(eventfd2), "eventfd2" }, [319] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, @@ -324,19 +331,19 @@ [325] = { 4, TD, SEN(pwritev), "pwritev" }, [326] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, [327] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, -[328] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[328] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg" }, [329] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, [330] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, [331] = { 4, 0, SEN(prlimit64), "prlimit64" }, [332] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, [333] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[334] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[334] = { 2, 0, SEN(clock_sparc64_adjtime), "clock_adjtime" }, [335] = { 1, TD, SEN(syncfs), "syncfs" }, [336] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, [337] = { 2, TD, SEN(setns), "setns" }, [338] = { 6, 0, SEN(process_vm_readv), "process_vm_readv" }, [339] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" }, -[340] = { 0, NF, SEN(printargs), "kern_features" }, +[340] = { 0, PU, SEN(kern_features), "kern_features" }, [341] = { 5, 0, SEN(kcmp), "kcmp" }, [342] = { 3, TD, SEN(finit_module), "finit_module" }, [343] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, @@ -356,6 +363,29 @@ [357] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, [358] = { 6, TD, SEN(preadv2), "preadv2" }, [359] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[360] = { 5, TD|TF|TSTA, SEN(statx), "statx" }, +[361] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents" }, +[362] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, +[363] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, +[364] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[365] = { 4, 0, SEN(rseq), "rseq" }, +/* room for arch specific calls */ +[392] = { 4, TI, SEN(semtimedop_time64), "semtimedop" }, +[393] = { 3, TI, SEN(semget), "semget" }, +[394] = { 4, TI, SEN(semctl), "semctl" }, +[395] = { 3, TI, SEN(shmget), "shmget" }, +[396] = { 3, TI, SEN(shmctl), "shmctl" }, +[397] = { 3, TI|TM|SI, SEN(shmat), "shmat" }, +[398] = { 1, TI|TM|SI, SEN(shmdt), "shmdt" }, +[399] = { 2, TI, SEN(msgget), "msgget" }, +[400] = { 4, TI, SEN(msgsnd), "msgsnd" }, +[401] = { 5, TI, SEN(msgrcv), "msgrcv" }, +[402] = { 3, TI, SEN(msgctl), "msgctl" }, +/* [403 ... 423] - reserved to sync up with other architectures */ +[424] = { 4, TD|TS, SEN(pidfd_send_signal), "pidfd_send_signal" }, +[425] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" }, +[426] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" }, +[427] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" }, -#define SYS_socket_subcall 400 -#include "subcall.h" +#define SYS_socket_subcall 500 +#include "subcall64.h" diff --git a/linux/sparc64/userent.h b/linux/sparc64/userent.h index 9387e254..87076bf3 100644 --- a/linux/sparc64/userent.h +++ b/linux/sparc64/userent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + XLAT_UOFF(u_tsize), XLAT_UOFF(u_dsize), XLAT_UOFF(u_ssize), diff --git a/linux/subcall.h b/linux/subcall.h index 169e5eab..408e4f08 100644 --- a/linux/subcall.h +++ b/linux/subcall.h @@ -1,28 +1,9 @@ /* * Copyright (c) 2013-2015 Dmitry V. Levin + * Copyright (c) 2013-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #ifndef SYS_socket_subcall diff --git a/linux/subcall32.h b/linux/subcall32.h new file mode 100644 index 00000000..922d83d4 --- /dev/null +++ b/linux/subcall32.h @@ -0,0 +1,5 @@ +#define sys_semtimedop sys_semtimedop_time32 +#define sys_recvmmsg sys_recvmmsg_time32 +#include "subcall.h" +#undef sys_recvmmsg +#undef sys_semtimedop diff --git a/linux/subcall64.h b/linux/subcall64.h new file mode 100644 index 00000000..95e15bfb --- /dev/null +++ b/linux/subcall64.h @@ -0,0 +1,5 @@ +#define sys_semtimedop sys_semtimedop_time64 +#define sys_recvmmsg sys_recvmmsg_time64 +#include "subcall.h" +#undef sys_recvmmsg +#undef sys_semtimedop diff --git a/linux/syscall.h b/linux/syscall.h index 6bf8b420..d770eab4 100644 --- a/linux/syscall.h +++ b/linux/syscall.h @@ -1,39 +1,20 @@ /* * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995 Rick Sladkey + * Copyright (c) 1995-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #ifndef STRACE_LINUX_SYSCALL_H -#define STRACE_LINUX_SYSCALL_H +# define STRACE_LINUX_SYSCALL_H -#include "dummy.h" -#include "sys_func.h" -#include "sen.h" +# include "dummy.h" +# include "sys_func.h" +# include "sen.h" -#if NEED_UID16_PARSERS +# if HAVE_ARCH_UID16_SYSCALLS extern SYS_FUNC(chown16); extern SYS_FUNC(fchown16); extern SYS_FUNC(getgroups16); @@ -44,6 +25,6 @@ extern SYS_FUNC(setgroups16); extern SYS_FUNC(setresuid16); extern SYS_FUNC(setreuid16); extern SYS_FUNC(setuid16); -#endif +# endif /* HAVE_ARCH_UID16_SYSCALLS */ #endif /* !STRACE_LINUX_SYSCALL_H */ diff --git a/linux/tile/arch_defs_.h b/linux/tile/arch_defs_.h new file mode 100644 index 00000000..a781208c --- /dev/null +++ b/linux/tile/arch_defs_.h @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define SUPPORTED_PERSONALITIES 2 +#define CAN_ARCH_BE_COMPAT_ON_64BIT_KERNEL 1 + +#ifdef __tilepro__ +# define DEFAULT_PERSONALITY 1 +#endif diff --git a/linux/tile/arch_get_personality.c b/linux/tile/arch_get_personality.c new file mode 100644 index 00000000..0a88242d --- /dev/null +++ b/linux/tile/arch_get_personality.c @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef AUDIT_ARCH_TILEGX32 +# define AUDIT_ARCH_TILEGX32 0x400000bf +#endif +#ifndef AUDIT_ARCH_TILEPRO +# define AUDIT_ARCH_TILEPRO 0x400000bc +#endif + +int +get_personality_from_syscall_info(const struct ptrace_syscall_info *sci) +{ + return sci->arch == AUDIT_ARCH_TILEGX32 || + sci->arch == AUDIT_ARCH_TILEPRO; +} diff --git a/linux/tile/arch_regs.c b/linux/tile/arch_regs.c index 6a7309d2..f792e773 100644 --- a/linux/tile/arch_regs.c +++ b/linux/tile/arch_regs.c @@ -1,3 +1,11 @@ -struct pt_regs tile_regs; /* not static */ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +static struct pt_regs tile_regs; #define ARCH_REGS_FOR_GETREGS tile_regs #define ARCH_PC_REG tile_regs.pc +#define ARCH_SP_REG tile_regs.sp diff --git a/linux/tile/arch_regs.h b/linux/tile/arch_regs.h deleted file mode 100644 index cd3f72b3..00000000 --- a/linux/tile/arch_regs.h +++ /dev/null @@ -1 +0,0 @@ -extern struct pt_regs tile_regs; diff --git a/linux/tile/arch_sigreturn.c b/linux/tile/arch_sigreturn.c index 88e946f0..43b27b5d 100644 --- a/linux/tile/arch_sigreturn.c +++ b/linux/tile/arch_sigreturn.c @@ -1,12 +1,22 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static void arch_sigreturn(struct tcb *tcp) { + kernel_ulong_t addr; + if (!get_stack_pointer(tcp, &addr)) + return; + /* offset of ucontext in the kernel's sigframe structure */ #define SIGFRAME_UC_OFFSET C_ABI_SAVE_AREA_SIZE + sizeof(siginfo_t) - const unsigned long addr = tile_regs.sp + SIGFRAME_UC_OFFSET + - offsetof(struct ucontext, uc_sigmask); + addr += SIGFRAME_UC_OFFSET + offsetof(ucontext_t, uc_sigmask); tprints("{mask="); - print_sigset_addr_len(tcp, addr, NSIG_BYTES); + print_sigset_addr(tcp, addr); tprints("}"); } diff --git a/linux/tile/errnoent1.h b/linux/tile/errnoent1.h deleted file mode 100644 index 091df787..00000000 --- a/linux/tile/errnoent1.h +++ /dev/null @@ -1,2 +0,0 @@ -/* tilegx32/tilepro */ -#include "errnoent.h" diff --git a/linux/tile/get_error.c b/linux/tile/get_error.c index 9949af4f..c6b6c807 100644 --- a/linux/tile/get_error.c +++ b/linux/tile/get_error.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "negated_errno.h" + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { /* * The standard tile calling convention returns the value diff --git a/linux/tile/get_scno.c b/linux/tile/get_scno.c index e8403d9b..9be1ea76 100644 --- a/linux/tile/get_scno.c +++ b/linux/tile/get_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) diff --git a/linux/tile/get_syscall_args.c b/linux/tile/get_syscall_args.c index b2043d39..34d596ab 100644 --- a/linux/tile/get_syscall_args.c +++ b/linux/tile/get_syscall_args.c @@ -1,6 +1,13 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { tcp->u_arg[0] = tile_regs.regs[0]; tcp->u_arg[1] = tile_regs.regs[1]; diff --git a/linux/tile/raw_syscall.h b/linux/tile/raw_syscall.h new file mode 100644 index 00000000..c006ad1e --- /dev/null +++ b/linux/tile/raw_syscall.h @@ -0,0 +1,33 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + kernel_ulong_t r, e, c2, c3, c4, c5, c10; + __asm__ __volatile__("swint1" + : "=R00"(r), "=R01"(e), + "=R02"(c2), "=R03"(c3), "=R04"(c4), + "=R05"(c5), "=R10"(c10) + : "R10"(nr) + : "memory", "r6", "r7", "r8", "r9", "r11", + "r12", "r13", "r14", "r15", "r16", "r17", + "r18", "r19", "r20", "r21", "r22", "r23", + "r24", "r25", "r26", "r27", "r28", "r29"); + *err = e; + return r; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/tile/rt_sigframe.h b/linux/tile/rt_sigframe.h new file mode 100644 index 00000000..06050650 --- /dev/null +++ b/linux/tile/rt_sigframe.h @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RT_SIGFRAME_H +# define STRACE_RT_SIGFRAME_H + +# include + +typedef struct { + unsigned char save_area[C_ABI_SAVE_AREA_SIZE]; + siginfo_t info; + ucontext_t uc; +} struct_rt_sigframe; + +#endif /* !STRACE_RT_SIGFRAME_H */ diff --git a/linux/tile/set_error.c b/linux/tile/set_error.c index 16d9b956..78e476cf 100644 --- a/linux/tile/set_error.c +++ b/linux/tile/set_error.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_error(struct tcb *tcp) { diff --git a/linux/tile/set_scno.c b/linux/tile/set_scno.c index c28d88c3..c1ab0d55 100644 --- a/linux/tile/set_scno.c +++ b/linux/tile/set_scno.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { diff --git a/linux/tile/signalent1.h b/linux/tile/signalent1.h deleted file mode 100644 index 62f11939..00000000 --- a/linux/tile/signalent1.h +++ /dev/null @@ -1,2 +0,0 @@ -/* tilegx32/tilepro */ -#include "signalent.h" diff --git a/linux/tile/syscallent.h b/linux/tile/syscallent.h index eb518fb9..50b60a4f 100644 --- a/linux/tile/syscallent.h +++ b/linux/tile/syscallent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2009-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "64/syscallent.h" /* [244 ... 259] are arch specific */ [244] = { 1, 0, SEN(printargs), "cmpxchg_badaddr" }, diff --git a/linux/tile/syscallent1.h b/linux/tile/syscallent1.h index b305f067..19941c29 100644 --- a/linux/tile/syscallent1.h +++ b/linux/tile/syscallent1.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2013-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #define sys_ARCH_mmap sys_mmap_4koff #define ARCH_WANT_SYNC_FILE_RANGE2 1 #include "32/syscallent.h" diff --git a/linux/tile/userent.h b/linux/tile/userent.h index 915f4a50..167e9729 100644 --- a/linux/tile/userent.h +++ b/linux/tile/userent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + { PTREGS_OFFSET_REG(0), "r0" }, { PTREGS_OFFSET_REG(1), "r1" }, { PTREGS_OFFSET_REG(2), "r2" }, diff --git a/linux/ubi-user.h b/linux/ubi-user.h deleted file mode 100644 index e9e56b35..00000000 --- a/linux/ubi-user.h +++ /dev/null @@ -1,420 +0,0 @@ -/* - * Copyright © International Business Machines Corp., 2006 - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See - * the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * Author: Artem Bityutskiy (Битюцкий Артём) - */ - -#ifndef __UBI_USER_H__ -#define __UBI_USER_H__ - -#include - -/* - * UBI device creation (the same as MTD device attachment) - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * MTD devices may be attached using %UBI_IOCATT ioctl command of the UBI - * control device. The caller has to properly fill and pass - * &struct ubi_attach_req object - UBI will attach the MTD device specified in - * the request and return the newly created UBI device number as the ioctl - * return value. - * - * UBI device deletion (the same as MTD device detachment) - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * An UBI device maybe deleted with %UBI_IOCDET ioctl command of the UBI - * control device. - * - * UBI volume creation - * ~~~~~~~~~~~~~~~~~~~ - * - * UBI volumes are created via the %UBI_IOCMKVOL ioctl command of UBI character - * device. A &struct ubi_mkvol_req object has to be properly filled and a - * pointer to it has to be passed to the ioctl. - * - * UBI volume deletion - * ~~~~~~~~~~~~~~~~~~~ - * - * To delete a volume, the %UBI_IOCRMVOL ioctl command of the UBI character - * device should be used. A pointer to the 32-bit volume ID hast to be passed - * to the ioctl. - * - * UBI volume re-size - * ~~~~~~~~~~~~~~~~~~ - * - * To re-size a volume, the %UBI_IOCRSVOL ioctl command of the UBI character - * device should be used. A &struct ubi_rsvol_req object has to be properly - * filled and a pointer to it has to be passed to the ioctl. - * - * UBI volumes re-name - * ~~~~~~~~~~~~~~~~~~~ - * - * To re-name several volumes atomically at one go, the %UBI_IOCRNVOL command - * of the UBI character device should be used. A &struct ubi_rnvol_req object - * has to be properly filled and a pointer to it has to be passed to the ioctl. - * - * UBI volume update - * ~~~~~~~~~~~~~~~~~ - * - * Volume update should be done via the %UBI_IOCVOLUP ioctl command of the - * corresponding UBI volume character device. A pointer to a 64-bit update - * size should be passed to the ioctl. After this, UBI expects user to write - * this number of bytes to the volume character device. The update is finished - * when the claimed number of bytes is passed. So, the volume update sequence - * is something like: - * - * fd = open("/dev/my_volume"); - * ioctl(fd, UBI_IOCVOLUP, &image_size); - * write(fd, buf, image_size); - * close(fd); - * - * Logical eraseblock erase - * ~~~~~~~~~~~~~~~~~~~~~~~~ - * - * To erase a logical eraseblock, the %UBI_IOCEBER ioctl command of the - * corresponding UBI volume character device should be used. This command - * unmaps the requested logical eraseblock, makes sure the corresponding - * physical eraseblock is successfully erased, and returns. - * - * Atomic logical eraseblock change - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * Atomic logical eraseblock change operation is called using the %UBI_IOCEBCH - * ioctl command of the corresponding UBI volume character device. A pointer to - * a &struct ubi_leb_change_req object has to be passed to the ioctl. Then the - * user is expected to write the requested amount of bytes (similarly to what - * should be done in case of the "volume update" ioctl). - * - * Logical eraseblock map - * ~~~~~~~~~~~~~~~~~~~~~ - * - * To map a logical eraseblock to a physical eraseblock, the %UBI_IOCEBMAP - * ioctl command should be used. A pointer to a &struct ubi_map_req object is - * expected to be passed. The ioctl maps the requested logical eraseblock to - * a physical eraseblock and returns. Only non-mapped logical eraseblocks can - * be mapped. If the logical eraseblock specified in the request is already - * mapped to a physical eraseblock, the ioctl fails and returns error. - * - * Logical eraseblock unmap - * ~~~~~~~~~~~~~~~~~~~~~~~~ - * - * To unmap a logical eraseblock to a physical eraseblock, the %UBI_IOCEBUNMAP - * ioctl command should be used. The ioctl unmaps the logical eraseblocks, - * schedules corresponding physical eraseblock for erasure, and returns. Unlike - * the "LEB erase" command, it does not wait for the physical eraseblock being - * erased. Note, the side effect of this is that if an unclean reboot happens - * after the unmap ioctl returns, you may find the LEB mapped again to the same - * physical eraseblock after the UBI is run again. - * - * Check if logical eraseblock is mapped - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * To check if a logical eraseblock is mapped to a physical eraseblock, the - * %UBI_IOCEBISMAP ioctl command should be used. It returns %0 if the LEB is - * not mapped, and %1 if it is mapped. - * - * Set an UBI volume property - * ~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * To set an UBI volume property the %UBI_IOCSETPROP ioctl command should be - * used. A pointer to a &struct ubi_set_vol_prop_req object is expected to be - * passed. The object describes which property should be set, and to which value - * it should be set. - */ - -/* - * When a new UBI volume or UBI device is created, users may either specify the - * volume/device number they want to create or to let UBI automatically assign - * the number using these constants. - */ -#define UBI_VOL_NUM_AUTO (-1) -#define UBI_DEV_NUM_AUTO (-1) - -/* Maximum volume name length */ -#define UBI_MAX_VOLUME_NAME 127 - -/* ioctl commands of UBI character devices */ - -#define UBI_IOC_MAGIC 'o' - -/* Create an UBI volume */ -#define UBI_IOCMKVOL _IOW(UBI_IOC_MAGIC, 0, struct ubi_mkvol_req) -/* Remove an UBI volume */ -#define UBI_IOCRMVOL _IOW(UBI_IOC_MAGIC, 1, __s32) -/* Re-size an UBI volume */ -#define UBI_IOCRSVOL _IOW(UBI_IOC_MAGIC, 2, struct ubi_rsvol_req) -/* Re-name volumes */ -#define UBI_IOCRNVOL _IOW(UBI_IOC_MAGIC, 3, struct ubi_rnvol_req) - -/* ioctl commands of the UBI control character device */ - -#define UBI_CTRL_IOC_MAGIC 'o' - -/* Attach an MTD device */ -#define UBI_IOCATT _IOW(UBI_CTRL_IOC_MAGIC, 64, struct ubi_attach_req) -/* Detach an MTD device */ -#define UBI_IOCDET _IOW(UBI_CTRL_IOC_MAGIC, 65, __s32) - -/* ioctl commands of UBI volume character devices */ - -#define UBI_VOL_IOC_MAGIC 'O' - -/* Start UBI volume update */ -#define UBI_IOCVOLUP _IOW(UBI_VOL_IOC_MAGIC, 0, __s64) -/* LEB erasure command, used for debugging, disabled by default */ -#define UBI_IOCEBER _IOW(UBI_VOL_IOC_MAGIC, 1, __s32) -/* Atomic LEB change command */ -#define UBI_IOCEBCH _IOW(UBI_VOL_IOC_MAGIC, 2, __s32) -/* Map LEB command */ -#define UBI_IOCEBMAP _IOW(UBI_VOL_IOC_MAGIC, 3, struct ubi_map_req) -/* Unmap LEB command */ -#define UBI_IOCEBUNMAP _IOW(UBI_VOL_IOC_MAGIC, 4, __s32) -/* Check if LEB is mapped command */ -#define UBI_IOCEBISMAP _IOR(UBI_VOL_IOC_MAGIC, 5, __s32) -/* Set an UBI volume property */ -#define UBI_IOCSETVOLPROP _IOW(UBI_VOL_IOC_MAGIC, 6, \ - struct ubi_set_vol_prop_req) - -/* Maximum MTD device name length supported by UBI */ -#define MAX_UBI_MTD_NAME_LEN 127 - -/* Maximum amount of UBI volumes that can be re-named at one go */ -#define UBI_MAX_RNVOL 32 - -/* - * UBI volume type constants. - * - * @UBI_DYNAMIC_VOLUME: dynamic volume - * @UBI_STATIC_VOLUME: static volume - */ -enum { - UBI_DYNAMIC_VOLUME = 3, - UBI_STATIC_VOLUME = 4, -}; - -/* - * UBI set volume property ioctl constants. - * - * @UBI_VOL_PROP_DIRECT_WRITE: allow (any non-zero value) or disallow (value 0) - * user to directly write and erase individual - * eraseblocks on dynamic volumes - */ -enum { - UBI_VOL_PROP_DIRECT_WRITE = 1, -}; - -/** - * struct ubi_attach_req - attach MTD device request. - * @ubi_num: UBI device number to create - * @mtd_num: MTD device number to attach - * @vid_hdr_offset: VID header offset (use defaults if %0) - * @max_beb_per1024: maximum expected number of bad PEB per 1024 PEBs - * @padding: reserved for future, not used, has to be zeroed - * - * This data structure is used to specify MTD device UBI has to attach and the - * parameters it has to use. The number which should be assigned to the new UBI - * device is passed in @ubi_num. UBI may automatically assign the number if - * @UBI_DEV_NUM_AUTO is passed. In this case, the device number is returned in - * @ubi_num. - * - * Most applications should pass %0 in @vid_hdr_offset to make UBI use default - * offset of the VID header within physical eraseblocks. The default offset is - * the next min. I/O unit after the EC header. For example, it will be offset - * 512 in case of a 512 bytes page NAND flash with no sub-page support. Or - * it will be 512 in case of a 2KiB page NAND flash with 4 512-byte sub-pages. - * - * But in rare cases, if this optimizes things, the VID header may be placed to - * a different offset. For example, the boot-loader might do things faster if - * the VID header sits at the end of the first 2KiB NAND page with 4 sub-pages. - * As the boot-loader would not normally need to read EC headers (unless it - * needs UBI in RW mode), it might be faster to calculate ECC. This is weird - * example, but it real-life example. So, in this example, @vid_hdr_offer would - * be 2KiB-64 bytes = 1984. Note, that this position is not even 512-bytes - * aligned, which is OK, as UBI is clever enough to realize this is 4th - * sub-page of the first page and add needed padding. - * - * The @max_beb_per1024 is the maximum amount of bad PEBs UBI expects on the - * UBI device per 1024 eraseblocks. This value is often given in an other form - * in the NAND datasheet (min NVB i.e. minimal number of valid blocks). The - * maximum expected bad eraseblocks per 1024 is then: - * 1024 * (1 - MinNVB / MaxNVB) - * Which gives 20 for most NAND devices. This limit is used in order to derive - * amount of eraseblock UBI reserves for handling new bad blocks. If the device - * has more bad eraseblocks than this limit, UBI does not reserve any physical - * eraseblocks for new bad eraseblocks, but attempts to use available - * eraseblocks (if any). The accepted range is 0-768. If 0 is given, the - * default kernel value of %CONFIG_MTD_UBI_BEB_LIMIT will be used. - */ -struct ubi_attach_req { - __s32 ubi_num; - __s32 mtd_num; - __s32 vid_hdr_offset; - __s16 max_beb_per1024; - __s8 padding[10]; -}; - -/** - * struct ubi_mkvol_req - volume description data structure used in - * volume creation requests. - * @vol_id: volume number - * @alignment: volume alignment - * @bytes: volume size in bytes - * @vol_type: volume type (%UBI_DYNAMIC_VOLUME or %UBI_STATIC_VOLUME) - * @padding1: reserved for future, not used, has to be zeroed - * @name_len: volume name length - * @padding2: reserved for future, not used, has to be zeroed - * @name: volume name - * - * This structure is used by user-space programs when creating new volumes. The - * @used_bytes field is only necessary when creating static volumes. - * - * The @alignment field specifies the required alignment of the volume logical - * eraseblock. This means, that the size of logical eraseblocks will be aligned - * to this number, i.e., - * (UBI device logical eraseblock size) mod (@alignment) = 0. - * - * To put it differently, the logical eraseblock of this volume may be slightly - * shortened in order to make it properly aligned. The alignment has to be - * multiple of the flash minimal input/output unit, or %1 to utilize the entire - * available space of logical eraseblocks. - * - * The @alignment field may be useful, for example, when one wants to maintain - * a block device on top of an UBI volume. In this case, it is desirable to fit - * an integer number of blocks in logical eraseblocks of this UBI volume. With - * alignment it is possible to update this volume using plane UBI volume image - * BLOBs, without caring about how to properly align them. - */ -struct ubi_mkvol_req { - __s32 vol_id; - __s32 alignment; - __s64 bytes; - __s8 vol_type; - __s8 padding1; - __s16 name_len; - __s8 padding2[4]; - char name[UBI_MAX_VOLUME_NAME + 1]; -} ATTRIBUTE_PACKED; - -/** - * struct ubi_rsvol_req - a data structure used in volume re-size requests. - * @vol_id: ID of the volume to re-size - * @bytes: new size of the volume in bytes - * - * Re-sizing is possible for both dynamic and static volumes. But while dynamic - * volumes may be re-sized arbitrarily, static volumes cannot be made to be - * smaller than the number of bytes they bear. To arbitrarily shrink a static - * volume, it must be wiped out first (by means of volume update operation with - * zero number of bytes). - */ -struct ubi_rsvol_req { - __s64 bytes; - __s32 vol_id; -} ATTRIBUTE_PACKED; - -/** - * struct ubi_rnvol_req - volumes re-name request. - * @count: count of volumes to re-name - * @padding1: reserved for future, not used, has to be zeroed - * @vol_id: ID of the volume to re-name - * @name_len: name length - * @padding2: reserved for future, not used, has to be zeroed - * @name: new volume name - * - * UBI allows to re-name up to %32 volumes at one go. The count of volumes to - * re-name is specified in the @count field. The ID of the volumes to re-name - * and the new names are specified in the @vol_id and @name fields. - * - * The UBI volume re-name operation is atomic, which means that should power cut - * happen, the volumes will have either old name or new name. So the possible - * use-cases of this command is atomic upgrade. Indeed, to upgrade, say, volumes - * A and B one may create temporary volumes %A1 and %B1 with the new contents, - * then atomically re-name A1->A and B1->B, in which case old %A and %B will - * be removed. - * - * If it is not desirable to remove old A and B, the re-name request has to - * contain 4 entries: A1->A, A->A1, B1->B, B->B1, in which case old A1 and B1 - * become A and B, and old A and B will become A1 and B1. - * - * It is also OK to request: A1->A, A1->X, B1->B, B->Y, in which case old A1 - * and B1 become A and B, and old A and B become X and Y. - * - * In other words, in case of re-naming into an existing volume name, the - * existing volume is removed, unless it is re-named as well at the same - * re-name request. - */ -struct ubi_rnvol_req { - __s32 count; - __s8 padding1[12]; - struct { - __s32 vol_id; - __s16 name_len; - __s8 padding2[2]; - char name[UBI_MAX_VOLUME_NAME + 1]; - } ents[UBI_MAX_RNVOL]; -} ATTRIBUTE_PACKED; - -/** - * struct ubi_leb_change_req - a data structure used in atomic LEB change - * requests. - * @lnum: logical eraseblock number to change - * @bytes: how many bytes will be written to the logical eraseblock - * @dtype: pass "3" for better compatibility with old kernels - * @padding: reserved for future, not used, has to be zeroed - * - * The @dtype field used to inform UBI about what kind of data will be written - * to the LEB: long term (value 1), short term (value 2), unknown (value 3). - * UBI tried to pick a PEB with lower erase counter for short term data and a - * PEB with higher erase counter for long term data. But this was not really - * used because users usually do not know this and could easily mislead UBI. We - * removed this feature in May 2012. UBI currently just ignores the @dtype - * field. But for better compatibility with older kernels it is recommended to - * set @dtype to 3 (unknown). - */ -struct ubi_leb_change_req { - __s32 lnum; - __s32 bytes; - __s8 dtype; /* obsolete, do not use! */ - __s8 padding[7]; -} ATTRIBUTE_PACKED; - -/** - * struct ubi_map_req - a data structure used in map LEB requests. - * @dtype: pass "3" for better compatibility with old kernels - * @lnum: logical eraseblock number to unmap - * @padding: reserved for future, not used, has to be zeroed - */ -struct ubi_map_req { - __s32 lnum; - __s8 dtype; /* obsolete, do not use! */ - __s8 padding[3]; -} ATTRIBUTE_PACKED; - - -/** - * struct ubi_set_vol_prop_req - a data structure used to set an UBI volume - * property. - * @property: property to set (%UBI_VOL_PROP_DIRECT_WRITE) - * @padding: reserved for future, not used, has to be zeroed - * @value: value to set - */ -struct ubi_set_vol_prop_req { - __u8 property; - __u8 padding[7]; - __u64 value; -} ATTRIBUTE_PACKED; - -#endif /* __UBI_USER_H__ */ diff --git a/linux/unix_diag.h b/linux/unix_diag.h index 0c3da5bb..1d15a0ce 100644 --- a/linux/unix_diag.h +++ b/linux/unix_diag.h @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #ifndef STRACE_LINUX_UNIX_DIAG_H -#define STRACE_LINUX_UNIX_DIAG_H +# define STRACE_LINUX_UNIX_DIAG_H struct unix_diag_req { uint8_t sdiag_family; @@ -11,8 +18,12 @@ struct unix_diag_req { uint32_t udiag_cookie[2]; }; -#define UDIAG_SHOW_NAME 0x01 -#define UDIAG_SHOW_PEER 0x04 +# define UDIAG_SHOW_NAME 0x01 +# define UDIAG_SHOW_VFS 0x02 +# define UDIAG_SHOW_PEER 0x04 +# define UDIAG_SHOW_ICONS 0x08 +# define UDIAG_SHOW_RQLEN 0x10 +# define UDIAG_SHOW_MEMINFO 0x20 struct unix_diag_msg { uint8_t udiag_family; @@ -23,7 +34,24 @@ struct unix_diag_msg { uint32_t udiag_cookie[2]; }; -#define UNIX_DIAG_NAME 0 -#define UNIX_DIAG_PEER 2 +enum { + UNIX_DIAG_NAME, + UNIX_DIAG_VFS, + UNIX_DIAG_PEER, + UNIX_DIAG_ICONS, + UNIX_DIAG_RQLEN, + UNIX_DIAG_MEMINFO, + UNIX_DIAG_SHUTDOWN, +}; + +struct unix_diag_vfs { + uint32_t udiag_vfs_ino; + uint32_t udiag_vfs_dev; +}; + +struct unix_diag_rqlen { + uint32_t udiag_rqueue; + uint32_t udiag_wqueue; +}; #endif /* !STRACE_LINUX_UNIX_DIAG_H */ diff --git a/linux/userent0.h b/linux/userent0.h index b3c5ebce..c9e24cd1 100644 --- a/linux/userent0.h +++ b/linux/userent0.h @@ -1 +1,8 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + { sizeof(struct user), "sizeof(struct user)" }, diff --git a/linux/x32/arch_defs_.h b/linux/x32/arch_defs_.h new file mode 100644 index 00000000..1055de12 --- /dev/null +++ b/linux/x32/arch_defs_.h @@ -0,0 +1,13 @@ +/* + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define ARCH_TIMESIZE 8 +#define HAVE_ARCH_OLD_MMAP 1 +#define HAVE_ARCH_OLD_SELECT 1 +#define HAVE_ARCH_UID16_SYSCALLS 1 +#define HAVE_ARCH_OLD_TIME64_SYSCALLS 1 +#define SUPPORTED_PERSONALITIES 2 diff --git a/linux/x32/arch_get_personality.c b/linux/x32/arch_get_personality.c new file mode 100644 index 00000000..a8ede47e --- /dev/null +++ b/linux/x32/arch_get_personality.c @@ -0,0 +1 @@ +#include "x86_64/arch_get_personality.c" diff --git a/linux/x32/arch_kvm.c b/linux/x32/arch_kvm.c new file mode 100644 index 00000000..e8e982ee --- /dev/null +++ b/linux/x32/arch_kvm.c @@ -0,0 +1 @@ +#include "x86_64/arch_kvm.c" diff --git a/linux/x32/arch_rt_sigframe.c b/linux/x32/arch_rt_sigframe.c new file mode 100644 index 00000000..1cc45e5f --- /dev/null +++ b/linux/x32/arch_rt_sigframe.c @@ -0,0 +1 @@ +#include "x86_64/arch_rt_sigframe.c" diff --git a/linux/x32/check_scno.c b/linux/x32/check_scno.c new file mode 100644 index 00000000..42387012 --- /dev/null +++ b/linux/x32/check_scno.c @@ -0,0 +1,22 @@ +/* + * Copyright (c) 2010-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +/* Return codes: 1 - ok, 0 - ignore, other - error. */ +static int +arch_check_scno(struct tcb *tcp) +{ + + const kernel_ulong_t scno = ptrace_sci.entry.nr; + + if (tcp->currpers == 0 && !(scno & __X32_SYSCALL_BIT)) { + error_msg("syscall_%" PRI_klu "(...) in unsupported " + "64-bit mode of process PID=%d", scno, tcp->pid); + return 0; + } + + return 1; +} diff --git a/linux/x32/errnoent1.h b/linux/x32/errnoent1.h deleted file mode 100644 index d32435af..00000000 --- a/linux/x32/errnoent1.h +++ /dev/null @@ -1,2 +0,0 @@ -/* i386 personality */ -#include "errnoent.h" diff --git a/linux/x32/ioctls_inc0.h b/linux/x32/ioctls_inc0.h index 46303d12..0706d019 100644 --- a/linux/x32/ioctls_inc0.h +++ b/linux/x32/ioctls_inc0.h @@ -34,11 +34,13 @@ { "asm-generic/ioctls.h", "TIOCGETD", 0, 0x5424, 0 }, { "asm-generic/ioctls.h", "TIOCGEXCL", _IOC_READ, 0x5440, 0x04 }, { "asm-generic/ioctls.h", "TIOCGICOUNT", 0, 0x545D, 0 }, +{ "asm-generic/ioctls.h", "TIOCGISO7816", _IOC_READ, 0x5442, 0x28 }, { "asm-generic/ioctls.h", "TIOCGLCKTRMIOS", 0, 0x5456, 0 }, { "asm-generic/ioctls.h", "TIOCGPGRP", 0, 0x540F, 0 }, { "asm-generic/ioctls.h", "TIOCGPKT", _IOC_READ, 0x5438, 0x04 }, { "asm-generic/ioctls.h", "TIOCGPTLCK", _IOC_READ, 0x5439, 0x04 }, { "asm-generic/ioctls.h", "TIOCGPTN", _IOC_READ, 0x5430, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCGPTPEER", _IOC_NONE, 0x5441, 0x00 }, { "asm-generic/ioctls.h", "TIOCGRS485", 0, 0x542E, 0 }, { "asm-generic/ioctls.h", "TIOCGSERIAL", 0, 0x541E, 0 }, { "asm-generic/ioctls.h", "TIOCGSID", 0, 0x5429, 0 }, @@ -65,6 +67,7 @@ { "asm-generic/ioctls.h", "TIOCSERSWILD", 0, 0x5455, 0 }, { "asm-generic/ioctls.h", "TIOCSETD", 0, 0x5423, 0 }, { "asm-generic/ioctls.h", "TIOCSIG", _IOC_WRITE, 0x5436, 0x04 }, +{ "asm-generic/ioctls.h", "TIOCSISO7816", _IOC_READ|_IOC_WRITE, 0x5443, 0x28 }, { "asm-generic/ioctls.h", "TIOCSLCKTRMIOS", 0, 0x5457, 0 }, { "asm-generic/ioctls.h", "TIOCSPGRP", 0, 0x5410, 0 }, { "asm-generic/ioctls.h", "TIOCSPTLCK", _IOC_WRITE, 0x5431, 0x04 }, @@ -84,6 +87,7 @@ { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x6454, 0x20 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x120 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 }, @@ -92,6 +96,8 @@ { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_SCHED", _IOC_WRITE, 0x6455, 0x10 }, +{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_VM", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 }, { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 }, { "drm/drm.h", "DRM_IOCTL_ADD_BUFS", _IOC_READ|_IOC_WRITE, 0x6416, 0x18 }, @@ -109,6 +115,8 @@ { "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 }, { "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 }, { "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_CRTC_GET_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643b, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_CRTC_QUEUE_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643c, 0x18 }, { "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x28 }, { "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 }, { "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 }, @@ -136,6 +144,7 @@ { "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 }, { "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 }, { "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c6, 0x18 }, { "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c }, { "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 }, { "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 }, @@ -152,10 +161,13 @@ { "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 }, { "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 }, { "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_GET_LEASE", _IOC_READ|_IOC_WRITE, 0x64c8, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_LIST_LESSEES", _IOC_READ|_IOC_WRITE, 0x64c7, 0x10 }, { "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 }, { "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x20 }, { "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x18 }, { "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 }, +{ "drm/drm.h", "DRM_IOCTL_MODE_REVOKE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c9, 0x04 }, { "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 }, { "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 }, { "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 }, @@ -177,6 +189,13 @@ { "drm/drm.h", "DRM_IOCTL_SG_ALLOC", _IOC_READ|_IOC_WRITE, 0x6438, 0x08 }, { "drm/drm.h", "DRM_IOCTL_SG_FREE", _IOC_WRITE, 0x6439, 0x08 }, { "drm/drm.h", "DRM_IOCTL_SWITCH_CTX", _IOC_WRITE, 0x6424, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_CREATE", _IOC_READ|_IOC_WRITE, 0x64bf, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_DESTROY", _IOC_READ|_IOC_WRITE, 0x64c0, 0x08 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x64c2, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD", _IOC_READ|_IOC_WRITE, 0x64c1, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_RESET", _IOC_READ|_IOC_WRITE, 0x64c4, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_SIGNAL", _IOC_READ|_IOC_WRITE, 0x64c5, 0x10 }, +{ "drm/drm.h", "DRM_IOCTL_SYNCOBJ_WAIT", _IOC_READ|_IOC_WRITE, 0x64c3, 0x20 }, { "drm/drm.h", "DRM_IOCTL_UNBLOCK", _IOC_READ|_IOC_WRITE, 0x6413, 0x04 }, { "drm/drm.h", "DRM_IOCTL_UNLOCK", _IOC_WRITE, 0x642b, 0x08 }, { "drm/drm.h", "DRM_IOCTL_UPDATE_DRAW", _IOC_WRITE, 0x643f, 0x18 }, @@ -186,10 +205,12 @@ { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, -{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x30 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_DOM", _IOC_READ|_IOC_WRITE, 0x644a, 0x48 }, +{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_SIG", _IOC_READ|_IOC_WRITE, 0x644b, 0x4c }, { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 }, @@ -197,10 +218,10 @@ { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_GET", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_GEM_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, -{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_CMD_CTRL", _IOC_READ|_IOC_WRITE, 0x6473, 0x08 }, -{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_PROPERTY", _IOC_READ|_IOC_WRITE, 0x6470, 0x50 }, -{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_QUEUE_BUF", _IOC_READ|_IOC_WRITE, 0x6472, 0x28 }, -{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_SET_PROPERTY", _IOC_READ|_IOC_WRITE, 0x6471, 0x60 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_COMMIT", _IOC_READ|_IOC_WRITE, 0x6483, 0x20 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6481, 0x18 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_LIMITS", _IOC_READ|_IOC_WRITE, 0x6482, 0x20 }, +{ "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_IPP_GET_RESOURCES", _IOC_READ|_IOC_WRITE, 0x6480, 0x10 }, { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_VIDI_CONNECTION", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, { "drm/i810_drm.h", "DRM_IOCTL_I810_CLEAR", _IOC_WRITE, 0x6442, 0x0c }, { "drm/i810_drm.h", "DRM_IOCTL_I810_COPY", _IOC_WRITE, 0x6447, 0x0c }, @@ -233,6 +254,7 @@ { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_ENTERVT", _IOC_NONE, 0x6459, 0x00 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER", _IOC_WRITE, 0x6454, 0x28 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2", _IOC_WRITE, 0x6469, 0x40 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_EXECBUFFER2_WR", _IOC_READ|_IOC_WRITE, 0x6469, 0x40 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_APERTURE", _IOC_READ, 0x6463, 0x10 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_CACHING", _IOC_READ|_IOC_WRITE, 0x6470, 0x08 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6462, 0x10 }, @@ -264,11 +286,17 @@ { "drm/i915_drm.h", "DRM_IOCTL_I915_IRQ_WAIT", _IOC_WRITE, 0x6445, 0x04 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_ATTRS", _IOC_READ|_IOC_WRITE, 0x6468, 0x2c }, { "drm/i915_drm.h", "DRM_IOCTL_I915_OVERLAY_PUT_IMAGE", _IOC_WRITE, 0x6467, 0x2c }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_ADD_CONFIG", _IOC_WRITE, 0x6477, 0x48 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_OPEN", _IOC_WRITE, 0x6476, 0x10 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_PERF_REMOVE_CONFIG", _IOC_WRITE, 0x6478, 0x08 }, +{ "drm/i915_drm.h", "DRM_IOCTL_I915_QUERY", _IOC_READ|_IOC_WRITE, 0x6479, 0x10 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_REG_READ", _IOC_READ|_IOC_WRITE, 0x6471, 0x10 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_SETPARAM", _IOC_WRITE, 0x6447, 0x08 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_SET_SPRITE_COLORKEY", _IOC_READ|_IOC_WRITE, 0x646b, 0x14 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_SET_VBLANK_PIPE", _IOC_WRITE, 0x644d, 0x04 }, { "drm/i915_drm.h", "DRM_IOCTL_I915_VBLANK_SWAP", _IOC_READ|_IOC_WRITE, 0x644f, 0x0c }, +{ "drm/i915_drm.h", "I915_PERF_IOCTL_DISABLE", _IOC_NONE, 0x6901, 0x00 }, +{ "drm/i915_drm.h", "I915_PERF_IOCTL_ENABLE", _IOC_NONE, 0x6900, 0x00 }, { "drm/mga_drm.h", "DRM_IOCTL_MGA_BLIT", _IOC_WRITE, 0x6448, 0x34 }, { "drm/mga_drm.h", "DRM_IOCTL_MGA_CLEAR", _IOC_WRITE, 0x6444, 0x14 }, { "drm/mga_drm.h", "DRM_IOCTL_MGA_DMA_BOOTSTRAP", _IOC_READ|_IOC_WRITE, 0x644c, 0x1c }, @@ -284,17 +312,21 @@ { "drm/mga_drm.h", "DRM_IOCTL_MGA_WAIT_FENCE", _IOC_READ|_IOC_WRITE, 0x644b, 0x04 }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x04 }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 }, -{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x28 }, { "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, -{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x18 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE", _IOC_WRITE, 0x644b, 0x04 }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_NEW", _IOC_READ|_IOC_WRITE, 0x644a, 0x0c }, +{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6480, 0x30 }, { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_PUSHBUF", _IOC_READ|_IOC_WRITE, 0x6481, 0x40 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_SVM_BIND", _IOC_READ|_IOC_WRITE, 0x6449, 0x40 }, +{ "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_SVM_INIT", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 }, { "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_FINI", _IOC_WRITE, 0x6445, 0x10 }, { "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x08 }, { "drm/omap_drm.h", "DRM_IOCTL_OMAP_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6446, 0x18 }, @@ -377,7 +409,7 @@ { "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_ALLOC", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, { "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_FREE", _IOC_WRITE, 0x6445, 0x10 }, { "drm/sis_drm.h", "DRM_IOCTL_SIS_FB_INIT", _IOC_WRITE, 0x6456, 0x08 }, -{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_CLOSE_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6446, 0x10 }, +{ "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_CLOSE_CHANNEL", _IOC_READ|_IOC_WRITE, 0x6446, 0x08 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_FLAGS", _IOC_READ|_IOC_WRITE, 0x644d, 0x08 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_GEM_GET_TILING", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 }, @@ -391,12 +423,26 @@ { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_INCR", _IOC_READ|_IOC_WRITE, 0x6443, 0x08 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_READ", _IOC_READ|_IOC_WRITE, 0x6442, 0x08 }, { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_GET_BO_OFFSET", _IOC_READ|_IOC_WRITE, 0x6445, 0x08 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0x38 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_SUBMIT_TFU", _IOC_WRITE, 0x6446, 0x44 }, +{ "drm/v3d_drm.h", "DRM_IOCTL_V3D_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_LABEL_BO", _IOC_READ|_IOC_WRITE, 0x644a, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_MMAP_BO", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 }, -{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0xa0 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_CREATE", _IOC_READ|_IOC_WRITE, 0x644c, 0x18 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_DESTROY", _IOC_READ|_IOC_WRITE, 0x644d, 0x04 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_PERFMON_GET_VALUES", _IOC_READ|_IOC_WRITE, 0x644e, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SET_TILING", _IOC_READ|_IOC_WRITE, 0x6448, 0x10 }, +{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_SUBMIT_CL", _IOC_READ|_IOC_WRITE, 0x6440, 0xb0 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_BO", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 }, { "drm/vc4_drm.h", "DRM_IOCTL_VC4_WAIT_SEQNO", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, { "drm/vgem_drm.h", "DRM_IOCTL_VGEM_FENCE_ATTACH", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, @@ -415,7 +461,7 @@ { "drm/via_drm.h", "DRM_IOCTL_VIA_MAP_INIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x14 }, { "drm/via_drm.h", "DRM_IOCTL_VIA_PCICMD", _IOC_WRITE, 0x644a, 0x08 }, { "drm/via_drm.h", "DRM_IOCTL_VIA_WAIT_IRQ", _IOC_READ|_IOC_WRITE, 0x644d, 0x10 }, -{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_EXECBUFFER", _IOC_WRITE, 0x6442, 0x20 }, +{ "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_EXECBUFFER", _IOC_READ|_IOC_WRITE, 0x6442, 0x20 }, { "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GETPARAM", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 }, { "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_GET_CAPS", _IOC_READ|_IOC_WRITE, 0x6449, 0x18 }, { "drm/virtgpu_drm.h", "DRM_IOCTL_VIRTGPU_MAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x10 }, @@ -451,9 +497,14 @@ { "linux/android/binder.h", "BC_REGISTER_LOOPER", _IOC_NONE, 0x630b, 0x00 }, { "linux/android/binder.h", "BC_RELEASE", _IOC_WRITE, 0x6306, 0x04 }, { "linux/android/binder.h", "BC_REPLY", _IOC_WRITE, 0x6301, 0x40 }, +{ "linux/android/binder.h", "BC_REPLY_SG", _IOC_WRITE, 0x6312, 0x48 }, { "linux/android/binder.h", "BC_REQUEST_DEATH_NOTIFICATION", _IOC_WRITE, 0x630e, 0x0c }, { "linux/android/binder.h", "BC_TRANSACTION", _IOC_WRITE, 0x6300, 0x40 }, +{ "linux/android/binder.h", "BC_TRANSACTION_SG", _IOC_WRITE, 0x6311, 0x48 }, +{ "linux/android/binder.h", "BINDER_GET_NODE_DEBUG_INFO", _IOC_READ|_IOC_WRITE, 0x620b, 0x18 }, +{ "linux/android/binder.h", "BINDER_GET_NODE_INFO_FOR_REF", _IOC_READ|_IOC_WRITE, 0x620c, 0x18 }, { "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR", _IOC_WRITE, 0x6207, 0x04 }, +{ "linux/android/binder.h", "BINDER_SET_CONTEXT_MGR_EXT", _IOC_WRITE, 0x620d, 0x18 }, { "linux/android/binder.h", "BINDER_SET_IDLE_PRIORITY", _IOC_WRITE, 0x6206, 0x04 }, { "linux/android/binder.h", "BINDER_SET_IDLE_TIMEOUT", _IOC_WRITE, 0x6203, 0x08 }, { "linux/android/binder.h", "BINDER_SET_MAX_THREADS", _IOC_WRITE, 0x6205, 0x04 }, @@ -478,10 +529,14 @@ { "linux/android/binder.h", "BR_SPAWN_LOOPER", _IOC_NONE, 0x720d, 0x00 }, { "linux/android/binder.h", "BR_TRANSACTION", _IOC_READ, 0x7202, 0x40 }, { "linux/android/binder.h", "BR_TRANSACTION_COMPLETE", _IOC_NONE, 0x7206, 0x00 }, +{ "linux/android/binder.h", "BR_TRANSACTION_SEC_CTX", _IOC_READ, 0x7202, 0x48 }, +{ "linux/android/binderfs.h", "BINDER_CTL_ADD", _IOC_READ|_IOC_WRITE, 0x6201, 0x108 }, { "linux/apm_bios.h", "APM_IOC_STANDBY", _IOC_NONE, 0x4101, 0x00 }, { "linux/apm_bios.h", "APM_IOC_SUSPEND", _IOC_NONE, 0x4102, 0x00 }, { "linux/arcfb.h", "FBIO_GETCONTROL2", _IOC_READ, 0x4689, 0x04 }, { "linux/arcfb.h", "FBIO_WAITEVENT", _IOC_NONE, 0x4688, 0x00 }, +{ "linux/aspeed-lpc-ctrl.h", "ASPEED_LPC_CTRL_IOCTL_GET_SIZE", _IOC_READ|_IOC_WRITE, 0xb200, 0x10 }, +{ "linux/aspeed-lpc-ctrl.h", "ASPEED_LPC_CTRL_IOCTL_MAP", _IOC_WRITE, 0xb201, 0x10 }, { "linux/atm_eni.h", "ENI_MEMDUMP", _IOC_WRITE, 0x6160, 0x0c }, { "linux/atm_eni.h", "ENI_SETMULT", _IOC_WRITE, 0x6167, 0x0c }, { "linux/atm_he.h", "HE_GET_REG", _IOC_WRITE, 0x6160, 0x0c }, @@ -547,17 +602,19 @@ { "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_SETPIPEFD", _IOC_READ|_IOC_WRITE, 0x9378, 0x18 }, { "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_TIMEOUT", _IOC_READ|_IOC_WRITE, 0x937a, 0x18 }, { "linux/auto_dev-ioctl.h", "AUTOFS_DEV_IOCTL_VERSION", _IOC_READ|_IOC_WRITE, 0x9371, 0x18 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_ASKUMOUNT", _IOC_READ, 0x9370, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_CATATONIC", _IOC_NONE, 0x9362, 0x00 }, { "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE", _IOC_READ, 0x9365, 0x10c }, +{ "linux/auto_fs.h", "AUTOFS_IOC_EXPIRE_MULTI", _IOC_WRITE, 0x9366, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_FAIL", _IOC_NONE, 0x9361, 0x00 }, +{ "linux/auto_fs.h", "AUTOFS_IOC_PROTOSUBVER", _IOC_READ, 0x9367, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_PROTOVER", _IOC_READ, 0x9363, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_READY", _IOC_NONE, 0x9360, 0x00 }, { "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT", _IOC_READ|_IOC_WRITE, 0x9364, 0x04 }, { "linux/auto_fs.h", "AUTOFS_IOC_SETTIMEOUT32", _IOC_READ|_IOC_WRITE, 0x9364, 0x04 }, -{ "linux/auto_fs4.h", "AUTOFS_IOC_ASKUMOUNT", _IOC_READ, 0x9370, 0x04 }, -{ "linux/auto_fs4.h", "AUTOFS_IOC_EXPIRE_MULTI", _IOC_WRITE, 0x9366, 0x04 }, -{ "linux/auto_fs4.h", "AUTOFS_IOC_PROTOSUBVER", _IOC_READ, 0x9367, 0x04 }, { "linux/blkpg.h", "BLKPG", _IOC_NONE, 0x1269, 0x00 }, +{ "linux/blkzoned.h", "BLKGETNRZONES", _IOC_READ, 0x1285, 0x04 }, +{ "linux/blkzoned.h", "BLKGETZONESZ", _IOC_READ, 0x1284, 0x04 }, { "linux/blkzoned.h", "BLKREPORTZONE", _IOC_READ|_IOC_WRITE, 0x1282, 0x10 }, { "linux/blkzoned.h", "BLKRESETZONE", _IOC_WRITE, 0x1283, 0x10 }, { "linux/bt-bmc.h", "BT_BMC_IOCTL_SMS_ATN", _IOC_NONE, 0xb100, 0x00 }, @@ -575,14 +632,18 @@ { "linux/btrfs.h", "BTRFS_IOC_DEV_INFO", _IOC_READ|_IOC_WRITE, 0x941e, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_DEV_REPLACE", _IOC_READ|_IOC_WRITE, 0x9435, 0xa28 }, { "linux/btrfs.h", "BTRFS_IOC_FILE_EXTENT_SAME", _IOC_READ|_IOC_WRITE, 0x9436, 0x18 }, +{ "linux/btrfs.h", "BTRFS_IOC_FORGET_DEV", _IOC_WRITE, 0x9405, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_FS_INFO", _IOC_READ, 0x941f, 0x400 }, { "linux/btrfs.h", "BTRFS_IOC_GET_DEV_STATS", _IOC_READ|_IOC_WRITE, 0x9434, 0x408 }, { "linux/btrfs.h", "BTRFS_IOC_GET_FEATURES", _IOC_READ, 0x9439, 0x18 }, -{ "linux/btrfs.h", "BTRFS_IOC_GET_FSLABEL", _IOC_READ, 0x9431, 0x100 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_SUBVOL_INFO", _IOC_READ, 0x943c, 0x1f8 }, +{ "linux/btrfs.h", "BTRFS_IOC_GET_SUBVOL_ROOTREF", _IOC_READ|_IOC_WRITE, 0x943d, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_GET_SUPPORTED_FEATURES", _IOC_READ, 0x9439, 0x48 }, { "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 }, +{ "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP_USER", _IOC_READ|_IOC_WRITE, 0x943e, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 }, { "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 }, +{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO_V2", _IOC_READ|_IOC_WRITE, 0x943b, 0x38 }, { "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 }, { "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 }, { "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 }, @@ -599,7 +660,6 @@ { "linux/btrfs.h", "BTRFS_IOC_SCRUB_PROGRESS", _IOC_READ|_IOC_WRITE, 0x941d, 0x400 }, { "linux/btrfs.h", "BTRFS_IOC_SEND", _IOC_WRITE, 0x9426, 0x48 }, { "linux/btrfs.h", "BTRFS_IOC_SET_FEATURES", _IOC_WRITE, 0x9439, 0x30 }, -{ "linux/btrfs.h", "BTRFS_IOC_SET_FSLABEL", _IOC_WRITE, 0x9432, 0x100 }, { "linux/btrfs.h", "BTRFS_IOC_SET_RECEIVED_SUBVOL", _IOC_READ|_IOC_WRITE, 0x9425, 0xc8 }, { "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE", _IOC_WRITE, 0x9401, 0x1000 }, { "linux/btrfs.h", "BTRFS_IOC_SNAP_CREATE_V2", _IOC_WRITE, 0x9417, 0x1000 }, @@ -719,6 +779,7 @@ { "linux/cm4000_cs.h", "CM_IOCSRDR", _IOC_NONE, 0x6303, 0x00 }, { "linux/cm4000_cs.h", "CM_IOSDBGLVL", _IOC_WRITE, 0x63fa, 0x04 }, { "linux/coda.h", "CIOC_KERNEL_VERSION", _IOC_READ|_IOC_WRITE, 0x630a, 0x04 }, +{ "linux/dm-ioctl.h", "DM_DEV_ARM_POLL", _IOC_READ|_IOC_WRITE, 0xfd10, 0x138 }, { "linux/dm-ioctl.h", "DM_DEV_CREATE", _IOC_READ|_IOC_WRITE, 0xfd03, 0x138 }, { "linux/dm-ioctl.h", "DM_DEV_REMOVE", _IOC_READ|_IOC_WRITE, 0xfd04, 0x138 }, { "linux/dm-ioctl.h", "DM_DEV_RENAME", _IOC_READ|_IOC_WRITE, 0xfd05, 0x138 }, @@ -745,17 +806,13 @@ { "linux/dvb/audio.h", "AUDIO_CLEAR_BUFFER", _IOC_NONE, 0x6f0c, 0x00 }, { "linux/dvb/audio.h", "AUDIO_CONTINUE", _IOC_NONE, 0x6f04, 0x00 }, { "linux/dvb/audio.h", "AUDIO_GET_CAPABILITIES", _IOC_READ, 0x6f0b, 0x04 }, -{ "linux/dvb/audio.h", "AUDIO_GET_PTS", _IOC_READ, 0x6f13, 0x08 }, { "linux/dvb/audio.h", "AUDIO_GET_STATUS", _IOC_READ, 0x6f0a, 0x20 }, { "linux/dvb/audio.h", "AUDIO_PAUSE", _IOC_NONE, 0x6f03, 0x00 }, { "linux/dvb/audio.h", "AUDIO_PLAY", _IOC_NONE, 0x6f02, 0x00 }, { "linux/dvb/audio.h", "AUDIO_SELECT_SOURCE", _IOC_NONE, 0x6f05, 0x00 }, -{ "linux/dvb/audio.h", "AUDIO_SET_ATTRIBUTES", _IOC_WRITE, 0x6f11, 0x02 }, { "linux/dvb/audio.h", "AUDIO_SET_AV_SYNC", _IOC_NONE, 0x6f07, 0x00 }, { "linux/dvb/audio.h", "AUDIO_SET_BYPASS_MODE", _IOC_NONE, 0x6f08, 0x00 }, -{ "linux/dvb/audio.h", "AUDIO_SET_EXT_ID", _IOC_NONE, 0x6f10, 0x00 }, { "linux/dvb/audio.h", "AUDIO_SET_ID", _IOC_NONE, 0x6f0d, 0x00 }, -{ "linux/dvb/audio.h", "AUDIO_SET_KARAOKE", _IOC_WRITE, 0x6f12, 0x0c }, { "linux/dvb/audio.h", "AUDIO_SET_MIXER", _IOC_WRITE, 0x6f0e, 0x08 }, { "linux/dvb/audio.h", "AUDIO_SET_MUTE", _IOC_NONE, 0x6f06, 0x00 }, { "linux/dvb/audio.h", "AUDIO_SET_STREAMTYPE", _IOC_NONE, 0x6f0f, 0x00 }, @@ -767,16 +824,18 @@ { "linux/dvb/ca.h", "CA_RESET", _IOC_NONE, 0x6f80, 0x00 }, { "linux/dvb/ca.h", "CA_SEND_MSG", _IOC_WRITE, 0x6f85, 0x10c }, { "linux/dvb/ca.h", "CA_SET_DESCR", _IOC_WRITE, 0x6f86, 0x10 }, -{ "linux/dvb/ca.h", "CA_SET_PID", _IOC_WRITE, 0x6f87, 0x08 }, { "linux/dvb/dmx.h", "DMX_ADD_PID", _IOC_WRITE, 0x6f33, 0x02 }, -{ "linux/dvb/dmx.h", "DMX_GET_CAPS", _IOC_READ, 0x6f30, 0x08 }, +{ "linux/dvb/dmx.h", "DMX_DQBUF", _IOC_READ|_IOC_WRITE, 0x6f40, 0x18 }, +{ "linux/dvb/dmx.h", "DMX_EXPBUF", _IOC_READ|_IOC_WRITE, 0x6f3e, 0x0c }, { "linux/dvb/dmx.h", "DMX_GET_PES_PIDS", _IOC_READ, 0x6f2f, 0x0a }, { "linux/dvb/dmx.h", "DMX_GET_STC", _IOC_READ|_IOC_WRITE, 0x6f32, 0x10 }, +{ "linux/dvb/dmx.h", "DMX_QBUF", _IOC_READ|_IOC_WRITE, 0x6f3f, 0x18 }, +{ "linux/dvb/dmx.h", "DMX_QUERYBUF", _IOC_READ|_IOC_WRITE, 0x6f3d, 0x18 }, { "linux/dvb/dmx.h", "DMX_REMOVE_PID", _IOC_WRITE, 0x6f34, 0x02 }, +{ "linux/dvb/dmx.h", "DMX_REQBUFS", _IOC_READ|_IOC_WRITE, 0x6f3c, 0x08 }, { "linux/dvb/dmx.h", "DMX_SET_BUFFER_SIZE", _IOC_NONE, 0x6f2d, 0x00 }, { "linux/dvb/dmx.h", "DMX_SET_FILTER", _IOC_WRITE, 0x6f2b, 0x3c }, { "linux/dvb/dmx.h", "DMX_SET_PES_FILTER", _IOC_WRITE, 0x6f2c, 0x14 }, -{ "linux/dvb/dmx.h", "DMX_SET_SOURCE", _IOC_WRITE, 0x6f31, 0x04 }, { "linux/dvb/dmx.h", "DMX_START", _IOC_NONE, 0x6f29, 0x00 }, { "linux/dvb/dmx.h", "DMX_STOP", _IOC_NONE, 0x6f2a, 0x00 }, { "linux/dvb/frontend.h", "FE_DISEQC_RECV_SLAVE_REPLY", _IOC_READ, 0x6f40, 0x0c }, @@ -810,25 +869,17 @@ { "linux/dvb/video.h", "VIDEO_FAST_FORWARD", _IOC_NONE, 0x6f1f, 0x00 }, { "linux/dvb/video.h", "VIDEO_FREEZE", _IOC_NONE, 0x6f17, 0x00 }, { "linux/dvb/video.h", "VIDEO_GET_CAPABILITIES", _IOC_READ, 0x6f21, 0x04 }, -{ "linux/dvb/video.h", "VIDEO_GET_EVENT", _IOC_READ, 0x6f1c, 0x20 }, +{ "linux/dvb/video.h", "VIDEO_GET_EVENT", _IOC_READ, 0x6f1c, 0x14 }, { "linux/dvb/video.h", "VIDEO_GET_FRAME_COUNT", _IOC_READ, 0x6f3a, 0x08 }, -{ "linux/dvb/video.h", "VIDEO_GET_FRAME_RATE", _IOC_READ, 0x6f38, 0x04 }, -{ "linux/dvb/video.h", "VIDEO_GET_NAVI", _IOC_READ, 0x6f34, 0x404 }, { "linux/dvb/video.h", "VIDEO_GET_PTS", _IOC_READ, 0x6f39, 0x08 }, { "linux/dvb/video.h", "VIDEO_GET_SIZE", _IOC_READ, 0x6f37, 0x0c }, { "linux/dvb/video.h", "VIDEO_GET_STATUS", _IOC_READ, 0x6f1b, 0x14 }, { "linux/dvb/video.h", "VIDEO_PLAY", _IOC_NONE, 0x6f16, 0x00 }, { "linux/dvb/video.h", "VIDEO_SELECT_SOURCE", _IOC_NONE, 0x6f19, 0x00 }, -{ "linux/dvb/video.h", "VIDEO_SET_ATTRIBUTES", _IOC_NONE, 0x6f35, 0x00 }, { "linux/dvb/video.h", "VIDEO_SET_BLANK", _IOC_NONE, 0x6f1a, 0x00 }, { "linux/dvb/video.h", "VIDEO_SET_DISPLAY_FORMAT", _IOC_NONE, 0x6f1d, 0x00 }, { "linux/dvb/video.h", "VIDEO_SET_FORMAT", _IOC_NONE, 0x6f25, 0x00 }, -{ "linux/dvb/video.h", "VIDEO_SET_HIGHLIGHT", _IOC_WRITE, 0x6f27, 0x10 }, -{ "linux/dvb/video.h", "VIDEO_SET_ID", _IOC_NONE, 0x6f23, 0x00 }, -{ "linux/dvb/video.h", "VIDEO_SET_SPU", _IOC_WRITE, 0x6f32, 0x08 }, -{ "linux/dvb/video.h", "VIDEO_SET_SPU_PALETTE", _IOC_WRITE, 0x6f33, 0x08 }, { "linux/dvb/video.h", "VIDEO_SET_STREAMTYPE", _IOC_NONE, 0x6f24, 0x00 }, -{ "linux/dvb/video.h", "VIDEO_SET_SYSTEM", _IOC_NONE, 0x6f26, 0x00 }, { "linux/dvb/video.h", "VIDEO_SLOWMOTION", _IOC_NONE, 0x6f20, 0x00 }, { "linux/dvb/video.h", "VIDEO_STILLPICTURE", _IOC_WRITE, 0x6f1e, 0x08 }, { "linux/dvb/video.h", "VIDEO_STOP", _IOC_NONE, 0x6f15, 0x00 }, @@ -901,6 +952,14 @@ { "linux/firewire-cdev.h", "FW_CDEV_IOC_SET_ISO_CHANNELS", _IOC_WRITE, 0x2317, 0x10 }, { "linux/firewire-cdev.h", "FW_CDEV_IOC_START_ISO", _IOC_WRITE, 0x230a, 0x10 }, { "linux/firewire-cdev.h", "FW_CDEV_IOC_STOP_ISO", _IOC_WRITE, 0x230b, 0x04 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_CHECK_EXTENSION", _IOC_NONE, 0xb601, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_FME_PORT_PR", _IOC_NONE, 0xb680, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_GET_API_VERSION", _IOC_NONE, 0xb600, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_MAP", _IOC_NONE, 0xb643, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_DMA_UNMAP", _IOC_NONE, 0xb644, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_INFO", _IOC_NONE, 0xb641, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_GET_REGION_INFO", _IOC_NONE, 0xb642, 0x00 }, +{ "linux/fpga-dfl.h", "DFL_FPGA_PORT_RESET", _IOC_NONE, 0xb640, 0x00 }, { "linux/fs.h", "BLKALIGNOFF", _IOC_NONE, 0x127a, 0x00 }, { "linux/fs.h", "BLKBSZGET", _IOC_READ, 0x1270, 0x04 }, { "linux/fs.h", "BLKBSZSET", _IOC_WRITE, 0x1271, 0x04 }, @@ -945,12 +1004,18 @@ { "linux/fs.h", "FS_IOC_FSGETXATTR", _IOC_READ, 0x581f, 0x1c }, { "linux/fs.h", "FS_IOC_FSSETXATTR", _IOC_WRITE, 0x5820, 0x1c }, { "linux/fs.h", "FS_IOC_GETFLAGS", _IOC_READ, 0x6601, 0x04 }, +{ "linux/fs.h", "FS_IOC_GETFSLABEL", _IOC_READ, 0x9431, 0x100 }, { "linux/fs.h", "FS_IOC_GETVERSION", _IOC_READ, 0x7601, 0x04 }, { "linux/fs.h", "FS_IOC_GET_ENCRYPTION_POLICY", _IOC_WRITE, 0x6615, 0x0c }, { "linux/fs.h", "FS_IOC_GET_ENCRYPTION_PWSALT", _IOC_WRITE, 0x6614, 0x10 }, { "linux/fs.h", "FS_IOC_SETFLAGS", _IOC_WRITE, 0x6602, 0x04 }, +{ "linux/fs.h", "FS_IOC_SETFSLABEL", _IOC_WRITE, 0x9432, 0x100 }, { "linux/fs.h", "FS_IOC_SETVERSION", _IOC_WRITE, 0x7602, 0x04 }, { "linux/fs.h", "FS_IOC_SET_ENCRYPTION_POLICY", _IOC_READ, 0x6613, 0x0c }, +{ "linux/fsi.h", "FSI_SCOM_CHECK", _IOC_READ, 0x7300, 0x04 }, +{ "linux/fsi.h", "FSI_SCOM_READ", _IOC_READ|_IOC_WRITE, 0x7301, 0x20 }, +{ "linux/fsi.h", "FSI_SCOM_RESET", _IOC_WRITE, 0x7303, 0x04 }, +{ "linux/fsi.h", "FSI_SCOM_WRITE", _IOC_READ|_IOC_WRITE, 0x7302, 0x20 }, { "linux/fsl-diu-fb.h", "MFB_GET_ALPHA", _IOC_READ, 0x4d00, 0x01 }, { "linux/fsl-diu-fb.h", "MFB_GET_AOID", _IOC_READ, 0x4d04, 0x08 }, { "linux/fsl-diu-fb.h", "MFB_GET_GAMMA", _IOC_READ, 0x4d01, 0x01 }, @@ -969,6 +1034,7 @@ { "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_START", _IOC_READ|_IOC_WRITE, 0xaf03, 0x10 }, { "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_PARTITION_STOP", _IOC_READ|_IOC_WRITE, 0xaf04, 0x08 }, { "linux/fsl_hypervisor.h", "FSL_HV_IOCTL_SETPROP", _IOC_READ|_IOC_WRITE, 0xaf08, 0x28 }, +{ "linux/fsmap.h", "FS_IOC_GETFSMAP", _IOC_READ|_IOC_WRITE, 0x583b, 0xc0 }, { "linux/fuse.h", "FUSE_DEV_IOC_CLONE", _IOC_READ, 0xe500, 0x04 }, { "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_DDCB", _IOC_READ|_IOC_WRITE, 0xa532, 0xe8 }, { "linux/genwqe/genwqe_card.h", "GENWQE_EXECUTE_RAW_DDCB", _IOC_READ|_IOC_WRITE, 0xa533, 0xe8 }, @@ -1105,7 +1171,9 @@ { "linux/if_tun.h", "TUNGETVNETBE", _IOC_READ, 0x54df, 0x04 }, { "linux/if_tun.h", "TUNGETVNETHDRSZ", _IOC_READ, 0x54d7, 0x04 }, { "linux/if_tun.h", "TUNGETVNETLE", _IOC_READ, 0x54dd, 0x04 }, +{ "linux/if_tun.h", "TUNSETCARRIER", _IOC_WRITE, 0x54e2, 0x04 }, { "linux/if_tun.h", "TUNSETDEBUG", _IOC_WRITE, 0x54c9, 0x04 }, +{ "linux/if_tun.h", "TUNSETFILTEREBPF", _IOC_READ, 0x54e1, 0x04 }, { "linux/if_tun.h", "TUNSETGROUP", _IOC_WRITE, 0x54ce, 0x04 }, { "linux/if_tun.h", "TUNSETIFF", _IOC_WRITE, 0x54ca, 0x04 }, { "linux/if_tun.h", "TUNSETIFINDEX", _IOC_WRITE, 0x54da, 0x04 }, @@ -1116,11 +1184,13 @@ { "linux/if_tun.h", "TUNSETPERSIST", _IOC_WRITE, 0x54cb, 0x04 }, { "linux/if_tun.h", "TUNSETQUEUE", _IOC_WRITE, 0x54d9, 0x04 }, { "linux/if_tun.h", "TUNSETSNDBUF", _IOC_WRITE, 0x54d4, 0x04 }, +{ "linux/if_tun.h", "TUNSETSTEERINGEBPF", _IOC_READ, 0x54e0, 0x04 }, { "linux/if_tun.h", "TUNSETTXFILTER", _IOC_WRITE, 0x54d1, 0x04 }, { "linux/if_tun.h", "TUNSETVNETBE", _IOC_WRITE, 0x54de, 0x04 }, { "linux/if_tun.h", "TUNSETVNETHDRSZ", _IOC_WRITE, 0x54d8, 0x04 }, { "linux/if_tun.h", "TUNSETVNETLE", _IOC_WRITE, 0x54dc, 0x04 }, { "linux/iio/events.h", "IIO_GET_EVENT_FD_IOCTL", _IOC_READ, 0x6990, 0x04 }, +{ "linux/inotify.h", "INOTIFY_IOC_SETNEXTWD", _IOC_WRITE, 0x4900, 0x04 }, { "linux/input.h", "EVIOCGEFFECTS", _IOC_READ, 0x4584, 0x04 }, { "linux/input.h", "EVIOCGID", _IOC_READ, 0x4502, 0x08 }, { "linux/input.h", "EVIOCGKEYCODE", _IOC_READ, 0x4504, 0x08 }, @@ -1158,6 +1228,9 @@ { "linux/ipmi.h", "IPMICTL_SET_TIMING_PARMS_CMD", _IOC_READ, 0x6916, 0x08 }, { "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD", _IOC_READ, 0x690f, 0x02 }, { "linux/ipmi.h", "IPMICTL_UNREGISTER_FOR_CMD_CHANS", _IOC_READ, 0x691d, 0x0c }, +{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_CLEAR_SMS_ATN", _IOC_NONE, 0xb101, 0x00 }, +{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_FORCE_ABORT", _IOC_NONE, 0xb102, 0x00 }, +{ "linux/ipmi_bmc.h", "IPMI_BMC_IOCTL_SET_SMS_ATN", _IOC_NONE, 0xb100, 0x00 }, { "linux/isdn.h", "IIOCDBGVAR", _IOC_NONE, 0x497f, 0x00 }, { "linux/isdn.h", "IIOCDRVCTL", _IOC_NONE, 0x4980, 0x00 }, { "linux/isdn.h", "IIOCGETCPS", _IOC_NONE, 0x4915, 0x00 }, @@ -1199,48 +1272,6 @@ { "linux/ivtv.h", "IVTV_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x38 }, { "linux/ivtv.h", "IVTV_IOC_PASSTHROUGH_MODE", _IOC_WRITE, 0x56c1, 0x04 }, { "linux/ivtvfb.h", "IVTVFB_IOC_DMA_FRAME", _IOC_WRITE, 0x56c0, 0x0c }, -{ "linux/ixjuser.h", "IXJCTL_AEC_GET_LEVEL", _IOC_NONE, 0x71cd, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_AEC_START", _IOC_WRITE, 0x71cb, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_AEC_STOP", _IOC_NONE, 0x71cc, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_CARDTYPE", _IOC_READ, 0x71c1, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_CID", _IOC_READ, 0x71d4, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_CIDCW", _IOC_WRITE, 0x71d9, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DAA_AGAIN", _IOC_WRITE, 0x71d2, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DAA_COEFF_SET", _IOC_WRITE, 0x71d0, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DRYBUFFER_CLEAR", _IOC_NONE, 0x71e7, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_DRYBUFFER_READ", _IOC_READ, 0x71e6, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DSP_IDLE", _IOC_NONE, 0x71c5, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_DSP_RESET", _IOC_NONE, 0x71c0, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_DSP_TYPE", _IOC_READ, 0x71c3, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DSP_VERSION", _IOC_READ, 0x71c4, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_DTMF_PRESCALE", _IOC_WRITE, 0x71e8, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_FILTER_CADENCE", _IOC_WRITE, 0x71d6, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_FRAMES_READ", _IOC_READ, 0x71e2, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_FRAMES_WRITTEN", _IOC_READ, 0x71e3, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_GET_FILTER_HIST", _IOC_WRITE, 0x71c8, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_HZ", _IOC_WRITE, 0x71e0, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_INIT_TONE", _IOC_WRITE, 0x71c9, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_INTERCOM_START", _IOC_WRITE, 0x71fd, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_INTERCOM_STOP", _IOC_WRITE, 0x71fe, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_MIXER", _IOC_WRITE, 0x71cf, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_PLAY_CID", _IOC_NONE, 0x71d7, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_PORT", _IOC_WRITE, 0x71d1, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_POTS_PSTN", _IOC_WRITE, 0x71d5, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_PSTN_LINETEST", _IOC_NONE, 0x71d3, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_RATE", _IOC_WRITE, 0x71e1, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_READ_WAIT", _IOC_READ, 0x71e4, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SC_RXG", _IOC_WRITE, 0x71ea, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SC_TXG", _IOC_WRITE, 0x71eb, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SERIAL", _IOC_READ, 0x71c2, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SET_FILTER", _IOC_WRITE, 0x71c7, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SET_FILTER_RAW", _IOC_WRITE, 0x71dd, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SET_LED", _IOC_WRITE, 0x71ce, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_SIGCTL", _IOC_WRITE, 0x71e9, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_TESTRAM", _IOC_NONE, 0x71c6, 0x00 }, -{ "linux/ixjuser.h", "IXJCTL_TONE_CADENCE", _IOC_WRITE, 0x71ca, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_VERSION", _IOC_READ, 0x71da, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_VMWI", _IOC_READ, 0x71d8, 0x04 }, -{ "linux/ixjuser.h", "IXJCTL_WRITE_WAIT", _IOC_READ, 0x71e5, 0x04 }, { "linux/joystick.h", "JSIOCGAXES", _IOC_READ, 0x6a11, 0x01 }, { "linux/joystick.h", "JSIOCGAXMAP", _IOC_READ, 0x6a32, 0x40 }, { "linux/joystick.h", "JSIOCGBTNMAP", _IOC_READ, 0x6a34, 0x400 }, @@ -1299,6 +1330,8 @@ { "linux/kd.h", "PIO_UNIMAP", 0, 0x4B67, 0 }, { "linux/kd.h", "PIO_UNIMAPCLR", 0, 0x4B68, 0 }, { "linux/kd.h", "PIO_UNISCRNMAP", 0, 0x4B6A, 0 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ACQUIRE_VM", _IOC_WRITE, 0x4b15, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_ALLOC_MEMORY_OF_GPU", _IOC_READ|_IOC_WRITE, 0x4b16, 0x28 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_EVENT", _IOC_READ|_IOC_WRITE, 0x4b08, 0x20 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_CREATE_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b02, 0x58 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_ADDRESS_WATCH", _IOC_WRITE, 0x4b0f, 0x10 }, @@ -1307,14 +1340,28 @@ { "linux/kfd_ioctl.h", "AMDKFD_IOC_DBG_WAVE_CONTROL", _IOC_WRITE, 0x4b10, 0x10 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_EVENT", _IOC_WRITE, 0x4b09, 0x08 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_DESTROY_QUEUE", _IOC_READ|_IOC_WRITE, 0x4b03, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_FREE_MEMORY_OF_GPU", _IOC_WRITE, 0x4b17, 0x08 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_CLOCK_COUNTERS", _IOC_READ|_IOC_WRITE, 0x4b05, 0x28 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_DMABUF_INFO", _IOC_READ|_IOC_WRITE, 0x4b1c, 0x20 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES", _IOC_READ, 0x4b06, 0x190 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_PROCESS_APERTURES_NEW", _IOC_READ|_IOC_WRITE, 0x4b14, 0x10 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_QUEUE_WAVE_STATE", _IOC_READ|_IOC_WRITE, 0x4b1b, 0x18 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_TILE_CONFIG", _IOC_READ|_IOC_WRITE, 0x4b12, 0x28 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_GET_VERSION", _IOC_READ, 0x4b01, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_IMPORT_DMABUF", _IOC_READ|_IOC_WRITE, 0x4b1d, 0x18 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_MAP_MEMORY_TO_GPU", _IOC_READ|_IOC_WRITE, 0x4b18, 0x18 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_RESET_EVENT", _IOC_WRITE, 0x4b0b, 0x08 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_CU_MASK", _IOC_WRITE, 0x4b1a, 0x10 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_EVENT", _IOC_WRITE, 0x4b0a, 0x08 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_MEMORY_POLICY", _IOC_WRITE, 0x4b04, 0x20 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_SCRATCH_BACKING_VA", _IOC_READ|_IOC_WRITE, 0x4b11, 0x10 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_SET_TRAP_HANDLER", _IOC_WRITE, 0x4b13, 0x18 }, +{ "linux/kfd_ioctl.h", "AMDKFD_IOC_UNMAP_MEMORY_FROM_GPU", _IOC_READ|_IOC_WRITE, 0x4b19, 0x18 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_UPDATE_QUEUE", _IOC_WRITE, 0x4b07, 0x18 }, { "linux/kfd_ioctl.h", "AMDKFD_IOC_WAIT_EVENTS", _IOC_READ|_IOC_WRITE, 0x4b0c, 0x18 }, +{ "linux/lightnvm.h", "NVME_NVM_IOCTL_ADMIN_VIO", _IOC_READ|_IOC_WRITE, 0x4c41, 0x50 }, +{ "linux/lightnvm.h", "NVME_NVM_IOCTL_IO_VIO", _IOC_READ|_IOC_WRITE, 0x4c43, 0x50 }, +{ "linux/lightnvm.h", "NVME_NVM_IOCTL_SUBMIT_VIO", _IOC_READ|_IOC_WRITE, 0x4c42, 0x40 }, { "linux/lightnvm.h", "NVM_DEV_CREATE", _IOC_WRITE, 0x4c22, 0x80 }, { "linux/lightnvm.h", "NVM_DEV_FACTORY", _IOC_WRITE, 0x4c25, 0x24 }, { "linux/lightnvm.h", "NVM_DEV_INIT", _IOC_WRITE, 0x4c24, 0x2c }, @@ -1327,6 +1374,7 @@ { "linux/lirc.h", "LIRC_GET_MIN_TIMEOUT", _IOC_READ, 0x6908, 0x04 }, { "linux/lirc.h", "LIRC_GET_REC_MODE", _IOC_READ, 0x6902, 0x04 }, { "linux/lirc.h", "LIRC_GET_REC_RESOLUTION", _IOC_READ, 0x6907, 0x04 }, +{ "linux/lirc.h", "LIRC_GET_REC_TIMEOUT", _IOC_READ, 0x6924, 0x04 }, { "linux/lirc.h", "LIRC_GET_SEND_MODE", _IOC_READ, 0x6901, 0x04 }, { "linux/lirc.h", "LIRC_SET_MEASURE_CARRIER_MODE", _IOC_WRITE, 0x691d, 0x04 }, { "linux/lirc.h", "LIRC_SET_REC_CARRIER", _IOC_WRITE, 0x6914, 0x04 }, @@ -1346,11 +1394,13 @@ { "linux/loop.h", "LOOP_CTL_REMOVE", 0, 0x4C81, 0 }, { "linux/loop.h", "LOOP_GET_STATUS", 0, 0x4C03, 0 }, { "linux/loop.h", "LOOP_GET_STATUS64", 0, 0x4C05, 0 }, +{ "linux/loop.h", "LOOP_SET_BLOCK_SIZE", 0, 0x4C09, 0 }, { "linux/loop.h", "LOOP_SET_CAPACITY", 0, 0x4C07, 0 }, { "linux/loop.h", "LOOP_SET_DIRECT_IO", 0, 0x4C08, 0 }, { "linux/loop.h", "LOOP_SET_FD", 0, 0x4C00, 0 }, { "linux/loop.h", "LOOP_SET_STATUS", 0, 0x4C02, 0 }, { "linux/loop.h", "LOOP_SET_STATUS64", 0, 0x4C04, 0 }, +{ "linux/lp.h", "LPSETTIMEOUT_NEW", _IOC_WRITE, 0x060f, 0x10 }, { "linux/mISDNif.h", "IMADDTIMER", _IOC_READ, 0x4940, 0x04 }, { "linux/mISDNif.h", "IMCLEAR_L2", _IOC_READ, 0x4946, 0x04 }, { "linux/mISDNif.h", "IMCTRLREQ", _IOC_READ, 0x4945, 0x04 }, @@ -1370,7 +1420,10 @@ { "linux/media.h", "MEDIA_IOC_ENUM_ENTITIES", _IOC_READ|_IOC_WRITE, 0x7c01, 0x100 }, { "linux/media.h", "MEDIA_IOC_ENUM_LINKS", _IOC_READ|_IOC_WRITE, 0x7c02, 0x1c }, { "linux/media.h", "MEDIA_IOC_G_TOPOLOGY", _IOC_READ|_IOC_WRITE, 0x7c04, 0x48 }, +{ "linux/media.h", "MEDIA_IOC_REQUEST_ALLOC", _IOC_READ, 0x7c05, 0x04 }, { "linux/media.h", "MEDIA_IOC_SETUP_LINK", _IOC_READ|_IOC_WRITE, 0x7c03, 0x34 }, +{ "linux/media.h", "MEDIA_REQUEST_IOC_QUEUE", _IOC_NONE, 0x7c80, 0x00 }, +{ "linux/media.h", "MEDIA_REQUEST_IOC_REINIT", _IOC_NONE, 0x7c81, 0x00 }, { "linux/mei.h", "IOCTL_MEI_CONNECT_CLIENT", _IOC_READ|_IOC_WRITE, 0x4801, 0x10 }, { "linux/mei.h", "IOCTL_MEI_NOTIFY_GET", _IOC_READ, 0x4803, 0x04 }, { "linux/mei.h", "IOCTL_MEI_NOTIFY_SET", _IOC_WRITE, 0x4802, 0x04 }, @@ -1410,26 +1463,6 @@ { "linux/nbd.h", "NBD_SET_SIZE_BLOCKS", _IOC_NONE, 0xab07, 0x00 }, { "linux/nbd.h", "NBD_SET_SOCK", _IOC_NONE, 0xab00, 0x00 }, { "linux/nbd.h", "NBD_SET_TIMEOUT", _IOC_NONE, 0xab09, 0x00 }, -{ "linux/ncp_fs.h", "NCP_IOC_CONN_LOGGED_IN", _IOC_NONE, 0x6e03, 0x00 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETCHARSETS", _IOC_READ|_IOC_WRITE, 0x6e0b, 0x2a }, -{ "linux/ncp_fs.h", "NCP_IOC_GETDENTRYTTL", _IOC_WRITE, 0x6e0c, 0x04 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID", _IOC_WRITE, 0x6e02, 0x02 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETMOUNTUID2", _IOC_WRITE, 0x6e02, 0x04 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETOBJECTNAME", _IOC_READ|_IOC_WRITE, 0x6e09, 0x0c }, -{ "linux/ncp_fs.h", "NCP_IOC_GETPRIVATEDATA", _IOC_READ|_IOC_WRITE, 0x6e0a, 0x08 }, -{ "linux/ncp_fs.h", "NCP_IOC_GETROOT", _IOC_WRITE, 0x6e08, 0x0c }, -{ "linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO", _IOC_READ|_IOC_WRITE, 0x6e04, 0x28 }, -{ "linux/ncp_fs.h", "NCP_IOC_GET_FS_INFO_V2", _IOC_READ|_IOC_WRITE, 0x6e04, 0x24 }, -{ "linux/ncp_fs.h", "NCP_IOC_LOCKUNLOCK", _IOC_READ, 0x6e07, 0x14 }, -{ "linux/ncp_fs.h", "NCP_IOC_NCPREQUEST", _IOC_READ, 0x6e01, 0x0c }, -{ "linux/ncp_fs.h", "NCP_IOC_SETCHARSETS", _IOC_READ, 0x6e0b, 0x2a }, -{ "linux/ncp_fs.h", "NCP_IOC_SETDENTRYTTL", _IOC_READ, 0x6e0c, 0x04 }, -{ "linux/ncp_fs.h", "NCP_IOC_SETOBJECTNAME", _IOC_READ, 0x6e09, 0x0c }, -{ "linux/ncp_fs.h", "NCP_IOC_SETPRIVATEDATA", _IOC_READ, 0x6e0a, 0x08 }, -{ "linux/ncp_fs.h", "NCP_IOC_SETROOT", _IOC_READ, 0x6e08, 0x0c }, -{ "linux/ncp_fs.h", "NCP_IOC_SET_SIGN_WANTED", _IOC_WRITE, 0x6e06, 0x04 }, -{ "linux/ncp_fs.h", "NCP_IOC_SIGN_INIT", _IOC_READ, 0x6e05, 0x18 }, -{ "linux/ncp_fs.h", "NCP_IOC_SIGN_WANTED", _IOC_READ, 0x6e06, 0x04 }, { "linux/ndctl.h", "ND_IOCTL_ARS_CAP", _IOC_READ|_IOC_WRITE, 0x4e01, 0x20 }, { "linux/ndctl.h", "ND_IOCTL_ARS_START", _IOC_READ|_IOC_WRITE, 0x4e02, 0x20 }, { "linux/ndctl.h", "ND_IOCTL_ARS_STATUS", _IOC_READ|_IOC_WRITE, 0x4e03, 0x30 }, @@ -1439,8 +1472,6 @@ { "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e05, 0x0c }, { "linux/ndctl.h", "ND_IOCTL_GET_CONFIG_SIZE", _IOC_READ|_IOC_WRITE, 0x4e04, 0x0c }, { "linux/ndctl.h", "ND_IOCTL_SET_CONFIG_DATA", _IOC_READ|_IOC_WRITE, 0x4e06, 0x08 }, -{ "linux/ndctl.h", "ND_IOCTL_SMART", _IOC_READ|_IOC_WRITE, 0x4e01, 0x84 }, -{ "linux/ndctl.h", "ND_IOCTL_SMART_THRESHOLD", _IOC_READ|_IOC_WRITE, 0x4e02, 0x0c }, { "linux/ndctl.h", "ND_IOCTL_VENDOR", _IOC_READ|_IOC_WRITE, 0x4e09, 0x08 }, { "linux/nilfs2_api.h", "NILFS_IOCTL_CHANGE_CPMODE", _IOC_WRITE, 0x6e80, 0x10 }, { "linux/nilfs2_api.h", "NILFS_IOCTL_CLEAN_SEGMENTS", _IOC_WRITE, 0x6e88, 0x78 }, @@ -1455,6 +1486,8 @@ { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 }, { "linux/nilfs2_api.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 }, { "linux/nilfs2_api.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 0x08 }, +{ "linux/nsfs.h", "NS_GET_NSTYPE", _IOC_NONE, 0xb703, 0x00 }, +{ "linux/nsfs.h", "NS_GET_OWNER_UID", _IOC_NONE, 0xb704, 0x00 }, { "linux/nsfs.h", "NS_GET_PARENT", _IOC_NONE, 0xb702, 0x00 }, { "linux/nsfs.h", "NS_GET_USERNS", _IOC_NONE, 0xb701, 0x00 }, { "linux/nvme_ioctl.h", "NVME_IOCTL_ADMIN_CMD", _IOC_READ|_IOC_WRITE, 0x4e41, 0x48 }, @@ -1473,6 +1506,7 @@ { "linux/omap3isp.h", "VIDIOC_OMAP3ISP_PRV_CFG", _IOC_READ|_IOC_WRITE, 0x56c2, 0x3c }, { "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_EN", _IOC_READ|_IOC_WRITE, 0x56c7, 0x04 }, { "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_REQ", _IOC_READ|_IOC_WRITE, 0x56c6, 0x20 }, +{ "linux/omap3isp.h", "VIDIOC_OMAP3ISP_STAT_REQ_TIME32", _IOC_READ|_IOC_WRITE, 0x56c6, 0x18 }, { "linux/omapfb.h", "OMAPFB_CTRL_TEST", _IOC_WRITE, 0x4f2e, 0x04 }, { "linux/omapfb.h", "OMAPFB_GET_CAPS", _IOC_READ, 0x4f2a, 0x0c }, { "linux/omapfb.h", "OMAPFB_GET_COLOR_KEY", _IOC_WRITE, 0x4f33, 0x10 }, @@ -1496,11 +1530,22 @@ { "linux/omapfb.h", "OMAPFB_VSYNC", _IOC_NONE, 0x4f26, 0x00 }, { "linux/omapfb.h", "OMAPFB_WAITFORGO", _IOC_NONE, 0x4f3c, 0x00 }, { "linux/omapfb.h", "OMAPFB_WAITFORVSYNC", _IOC_NONE, 0x4f39, 0x00 }, +{ "linux/pcitest.h", "PCITEST_BAR", _IOC_NONE, 0x5001, 0x00 }, +{ "linux/pcitest.h", "PCITEST_COPY", _IOC_WRITE, 0x5006, 0x04 }, +{ "linux/pcitest.h", "PCITEST_GET_IRQTYPE", _IOC_NONE, 0x5009, 0x00 }, +{ "linux/pcitest.h", "PCITEST_LEGACY_IRQ", _IOC_NONE, 0x5002, 0x00 }, +{ "linux/pcitest.h", "PCITEST_MSI", _IOC_WRITE, 0x5003, 0x04 }, +{ "linux/pcitest.h", "PCITEST_MSIX", _IOC_WRITE, 0x5007, 0x04 }, +{ "linux/pcitest.h", "PCITEST_READ", _IOC_WRITE, 0x5005, 0x04 }, +{ "linux/pcitest.h", "PCITEST_SET_IRQTYPE", _IOC_WRITE, 0x5008, 0x04 }, +{ "linux/pcitest.h", "PCITEST_WRITE", _IOC_WRITE, 0x5004, 0x04 }, { "linux/perf_event.h", "PERF_EVENT_IOC_DISABLE", _IOC_NONE, 0x2401, 0x00 }, { "linux/perf_event.h", "PERF_EVENT_IOC_ENABLE", _IOC_NONE, 0x2400, 0x00 }, { "linux/perf_event.h", "PERF_EVENT_IOC_ID", _IOC_READ, 0x2407, 0x04 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_MODIFY_ATTRIBUTES", _IOC_WRITE, 0x240b, 0x04 }, { "linux/perf_event.h", "PERF_EVENT_IOC_PAUSE_OUTPUT", _IOC_WRITE, 0x2409, 0x04 }, { "linux/perf_event.h", "PERF_EVENT_IOC_PERIOD", _IOC_WRITE, 0x2404, 0x08 }, +{ "linux/perf_event.h", "PERF_EVENT_IOC_QUERY_BPF", _IOC_READ|_IOC_WRITE, 0x240a, 0x04 }, { "linux/perf_event.h", "PERF_EVENT_IOC_REFRESH", _IOC_NONE, 0x2402, 0x00 }, { "linux/perf_event.h", "PERF_EVENT_IOC_RESET", _IOC_NONE, 0x2403, 0x00 }, { "linux/perf_event.h", "PERF_EVENT_IOC_SET_BPF", _IOC_WRITE, 0x2408, 0x04 }, @@ -1588,6 +1633,7 @@ { "linux/pr.h", "IOC_PR_REGISTER", _IOC_WRITE, 0x70c8, 0x18 }, { "linux/pr.h", "IOC_PR_RELEASE", _IOC_WRITE, 0x70ca, 0x10 }, { "linux/pr.h", "IOC_PR_RESERVE", _IOC_WRITE, 0x70c9, 0x10 }, +{ "linux/psp-sev.h", "SEV_ISSUE_CMD", _IOC_READ|_IOC_WRITE, 0x5300, 0x10 }, { "linux/ptp_clock.h", "PTP_CLOCK_GETCAPS", _IOC_READ, 0x3d01, 0x50 }, { "linux/ptp_clock.h", "PTP_ENABLE_PPS", _IOC_WRITE, 0x3d04, 0x04 }, { "linux/ptp_clock.h", "PTP_EXTTS_REQUEST", _IOC_WRITE, 0x3d02, 0x10 }, @@ -1595,6 +1641,7 @@ { "linux/ptp_clock.h", "PTP_PIN_GETFUNC", _IOC_READ|_IOC_WRITE, 0x3d06, 0x60 }, { "linux/ptp_clock.h", "PTP_PIN_SETFUNC", _IOC_WRITE, 0x3d07, 0x60 }, { "linux/ptp_clock.h", "PTP_SYS_OFFSET", _IOC_WRITE, 0x3d05, 0x340 }, +{ "linux/ptp_clock.h", "PTP_SYS_OFFSET_EXTENDED", _IOC_READ|_IOC_WRITE, 0x3d09, 0x4c0 }, { "linux/ptp_clock.h", "PTP_SYS_OFFSET_PRECISE", _IOC_READ|_IOC_WRITE, 0x3d08, 0x40 }, { "linux/radeonfb.h", "FBIO_RADEON_GET_MIRROR", _IOC_READ, 0x4003, 0x04 }, { "linux/radeonfb.h", "FBIO_RADEON_SET_MIRROR", _IOC_WRITE, 0x4004, 0x04 }, @@ -1625,6 +1672,7 @@ { "linux/random.h", "RNDCLEARPOOL", _IOC_NONE, 0x5206, 0x00 }, { "linux/random.h", "RNDGETENTCNT", _IOC_READ, 0x5200, 0x04 }, { "linux/random.h", "RNDGETPOOL", _IOC_READ, 0x5202, 0x08 }, +{ "linux/random.h", "RNDRESEEDCRNG", _IOC_NONE, 0x5207, 0x00 }, { "linux/random.h", "RNDZAPENTCNT", _IOC_NONE, 0x5204, 0x00 }, { "linux/raw.h", "RAW_GETBIND", _IOC_NONE, 0xac01, 0x00 }, { "linux/raw.h", "RAW_SETBIND", _IOC_NONE, 0xac00, 0x00 }, @@ -1665,6 +1713,8 @@ { "linux/rio_mport_cdev.h", "RIO_UNMAP_INBOUND", _IOC_WRITE, 0x6d12, 0x08 }, { "linux/rio_mport_cdev.h", "RIO_UNMAP_OUTBOUND", _IOC_WRITE, 0x6d10, 0x28 }, { "linux/rio_mport_cdev.h", "RIO_WAIT_FOR_ASYNC", _IOC_WRITE, 0x6d16, 0x08 }, +{ "linux/rpmsg.h", "RPMSG_CREATE_EPT_IOCTL", _IOC_WRITE, 0xb501, 0x28 }, +{ "linux/rpmsg.h", "RPMSG_DESTROY_EPT_IOCTL", _IOC_NONE, 0xb502, 0x00 }, { "linux/rtc.h", "RTC_AIE_OFF", _IOC_NONE, 0x7002, 0x00 }, { "linux/rtc.h", "RTC_AIE_ON", _IOC_NONE, 0x7001, 0x00 }, { "linux/rtc.h", "RTC_ALM_READ", _IOC_READ, 0x7008, 0x24 }, @@ -1704,6 +1754,21 @@ { "linux/scif_ioctl.h", "SCIF_VREADFROM", _IOC_READ|_IOC_WRITE, 0x730c, 0x28 }, { "linux/scif_ioctl.h", "SCIF_VWRITETO", _IOC_READ|_IOC_WRITE, 0x730d, 0x28 }, { "linux/scif_ioctl.h", "SCIF_WRITETO", _IOC_READ|_IOC_WRITE, 0x730b, 0x28 }, +{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_ID_VALID", _IOC_READ, 0x2102, 0x08 }, +{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_RECV", _IOC_READ|_IOC_WRITE, 0x2100, 0x50 }, +{ "linux/seccomp.h", "SECCOMP_IOCTL_NOTIF_SEND", _IOC_READ|_IOC_WRITE, 0x2101, 0x18 }, +{ "linux/sed-opal.h", "IOC_OPAL_ACTIVATE_LSP", _IOC_WRITE, 0x70df, 0x118 }, +{ "linux/sed-opal.h", "IOC_OPAL_ACTIVATE_USR", _IOC_WRITE, 0x70e1, 0x110 }, +{ "linux/sed-opal.h", "IOC_OPAL_ADD_USR_TO_LR", _IOC_WRITE, 0x70e4, 0x118 }, +{ "linux/sed-opal.h", "IOC_OPAL_ENABLE_DISABLE_MBR", _IOC_WRITE, 0x70e5, 0x110 }, +{ "linux/sed-opal.h", "IOC_OPAL_ERASE_LR", _IOC_WRITE, 0x70e6, 0x110 }, +{ "linux/sed-opal.h", "IOC_OPAL_LOCK_UNLOCK", _IOC_WRITE, 0x70dd, 0x118 }, +{ "linux/sed-opal.h", "IOC_OPAL_LR_SETUP", _IOC_WRITE, 0x70e3, 0x128 }, +{ "linux/sed-opal.h", "IOC_OPAL_REVERT_TPR", _IOC_WRITE, 0x70e2, 0x108 }, +{ "linux/sed-opal.h", "IOC_OPAL_SAVE", _IOC_WRITE, 0x70dc, 0x118 }, +{ "linux/sed-opal.h", "IOC_OPAL_SECURE_ERASE_LR", _IOC_WRITE, 0x70e7, 0x110 }, +{ "linux/sed-opal.h", "IOC_OPAL_SET_PW", _IOC_WRITE, 0x70e0, 0x220 }, +{ "linux/sed-opal.h", "IOC_OPAL_TAKE_OWNERSHIP", _IOC_WRITE, 0x70de, 0x108 }, { "linux/serio.h", "SPIOCSTYPE", _IOC_WRITE, 0x7101, 0x04 }, { "linux/sockios.h", "SIOCADDDLCI", 0, 0x8980, 0 }, { "linux/sockios.h", "SIOCADDMULTI", 0, 0x8931, 0 }, @@ -1916,6 +1981,12 @@ { "linux/suspend_ioctls.h", "SNAPSHOT_S2RAM", _IOC_NONE, 0x330b, 0x00 }, { "linux/suspend_ioctls.h", "SNAPSHOT_SET_SWAP_AREA", _IOC_WRITE, 0x330d, 0x0c }, { "linux/suspend_ioctls.h", "SNAPSHOT_UNFREEZE", _IOC_NONE, 0x3302, 0x00 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_CTL", _IOC_READ|_IOC_WRITE, 0x5743, 0x28 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_EVENT_SUMMARY", _IOC_READ, 0x5742, 0x198 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_FLASH_INFO", _IOC_READ, 0x5740, 0x10 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_FLASH_PART_INFO", _IOC_READ|_IOC_WRITE, 0x5741, 0x10 }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_PFF_TO_PORT", _IOC_READ|_IOC_WRITE, 0x5744, 0x0c }, +{ "linux/switchtec_ioctl.h", "SWITCHTEC_IOCTL_PORT_TO_PFF", _IOC_READ|_IOC_WRITE, 0x5745, 0x0c }, { "linux/sync_file.h", "SYNC_IOC_FILE_INFO", _IOC_READ|_IOC_WRITE, 0x3e04, 0x38 }, { "linux/sync_file.h", "SYNC_IOC_MERGE", _IOC_READ|_IOC_WRITE, 0x3e03, 0x30 }, { "linux/synclink.h", "MGSL_IOCCLRMODCOUNT", _IOC_NONE, 0x6d0f, 0x00 }, @@ -1938,53 +2009,15 @@ { "linux/synclink.h", "MGSL_IOCTXENABLE", _IOC_NONE, 0x6d04, 0x00 }, { "linux/synclink.h", "MGSL_IOCWAITEVENT", _IOC_READ|_IOC_WRITE, 0x6d08, 0x04 }, { "linux/synclink.h", "MGSL_IOCWAITGPIO", _IOC_READ|_IOC_WRITE, 0x6d12, 0x10 }, -{ "linux/telephony.h", "OLD_PHONE_RING_START", _IOC_NONE, 0x7187, 0x00 }, -{ "linux/telephony.h", "PHONE_BUSY", _IOC_NONE, 0x71a1, 0x00 }, -{ "linux/telephony.h", "PHONE_CAPABILITIES", _IOC_NONE, 0x7180, 0x00 }, -{ "linux/telephony.h", "PHONE_CAPABILITIES_CHECK", _IOC_WRITE, 0x7182, 0x04 }, -{ "linux/telephony.h", "PHONE_CAPABILITIES_LIST", _IOC_READ, 0x7181, 0x04 }, -{ "linux/telephony.h", "PHONE_CPT_STOP", _IOC_NONE, 0x71a4, 0x00 }, -{ "linux/telephony.h", "PHONE_DIALTONE", _IOC_NONE, 0x71a3, 0x00 }, -{ "linux/telephony.h", "PHONE_DTMF_OOB", _IOC_WRITE, 0x7199, 0x04 }, -{ "linux/telephony.h", "PHONE_DTMF_READY", _IOC_READ, 0x7196, 0x04 }, -{ "linux/telephony.h", "PHONE_EXCEPTION", _IOC_READ, 0x719a, 0x04 }, -{ "linux/telephony.h", "PHONE_FRAME", _IOC_WRITE, 0x718d, 0x04 }, -{ "linux/telephony.h", "PHONE_GET_DTMF", _IOC_READ, 0x7197, 0x04 }, -{ "linux/telephony.h", "PHONE_GET_DTMF_ASCII", _IOC_READ, 0x7198, 0x04 }, -{ "linux/telephony.h", "PHONE_GET_TONE_OFF_TIME", _IOC_NONE, 0x719f, 0x00 }, -{ "linux/telephony.h", "PHONE_GET_TONE_ON_TIME", _IOC_NONE, 0x719e, 0x00 }, -{ "linux/telephony.h", "PHONE_GET_TONE_STATE", _IOC_NONE, 0x71a0, 0x00 }, -{ "linux/telephony.h", "PHONE_HOOKSTATE", _IOC_NONE, 0x7184, 0x00 }, -{ "linux/telephony.h", "PHONE_MAXRINGS", _IOC_WRITE, 0x7185, 0x01 }, -{ "linux/telephony.h", "PHONE_PLAY_CODEC", _IOC_WRITE, 0x7190, 0x04 }, -{ "linux/telephony.h", "PHONE_PLAY_DEPTH", _IOC_WRITE, 0x7193, 0x04 }, -{ "linux/telephony.h", "PHONE_PLAY_LEVEL", _IOC_NONE, 0x7195, 0x00 }, -{ "linux/telephony.h", "PHONE_PLAY_START", _IOC_NONE, 0x7191, 0x00 }, -{ "linux/telephony.h", "PHONE_PLAY_STOP", _IOC_NONE, 0x7192, 0x00 }, -{ "linux/telephony.h", "PHONE_PLAY_TONE", _IOC_WRITE, 0x719b, 0x01 }, -{ "linux/telephony.h", "PHONE_PLAY_VOLUME", _IOC_WRITE, 0x7194, 0x04 }, -{ "linux/telephony.h", "PHONE_PLAY_VOLUME_LINEAR", _IOC_WRITE, 0x71dc, 0x04 }, -{ "linux/telephony.h", "PHONE_PSTN_GET_STATE", _IOC_NONE, 0x71a5, 0x00 }, -{ "linux/telephony.h", "PHONE_PSTN_LINETEST", _IOC_NONE, 0x71a8, 0x00 }, -{ "linux/telephony.h", "PHONE_PSTN_SET_STATE", _IOC_WRITE, 0x71a4, 0x04 }, -{ "linux/telephony.h", "PHONE_QUERY_CODEC", _IOC_READ|_IOC_WRITE, 0x71a7, 0x04 }, -{ "linux/telephony.h", "PHONE_REC_CODEC", _IOC_WRITE, 0x7189, 0x04 }, -{ "linux/telephony.h", "PHONE_REC_DEPTH", _IOC_WRITE, 0x718c, 0x04 }, -{ "linux/telephony.h", "PHONE_REC_LEVEL", _IOC_NONE, 0x718f, 0x00 }, -{ "linux/telephony.h", "PHONE_REC_START", _IOC_NONE, 0x718a, 0x00 }, -{ "linux/telephony.h", "PHONE_REC_STOP", _IOC_NONE, 0x718b, 0x00 }, -{ "linux/telephony.h", "PHONE_REC_VOLUME", _IOC_WRITE, 0x718e, 0x04 }, -{ "linux/telephony.h", "PHONE_REC_VOLUME_LINEAR", _IOC_WRITE, 0x71db, 0x04 }, -{ "linux/telephony.h", "PHONE_RING", _IOC_NONE, 0x7183, 0x00 }, -{ "linux/telephony.h", "PHONE_RINGBACK", _IOC_NONE, 0x71a2, 0x00 }, -{ "linux/telephony.h", "PHONE_RING_CADENCE", _IOC_WRITE, 0x7186, 0x02 }, -{ "linux/telephony.h", "PHONE_RING_START", _IOC_WRITE, 0x7187, 0x04 }, -{ "linux/telephony.h", "PHONE_RING_STOP", _IOC_NONE, 0x7188, 0x00 }, -{ "linux/telephony.h", "PHONE_SET_TONE_OFF_TIME", _IOC_WRITE, 0x719d, 0x04 }, -{ "linux/telephony.h", "PHONE_SET_TONE_ON_TIME", _IOC_WRITE, 0x719c, 0x04 }, -{ "linux/telephony.h", "PHONE_VAD", _IOC_WRITE, 0x71a9, 0x04 }, -{ "linux/telephony.h", "PHONE_WINK", _IOC_WRITE, 0x71aa, 0x04 }, -{ "linux/telephony.h", "PHONE_WINK_DURATION", _IOC_WRITE, 0x71a6, 0x04 }, +{ "linux/tee.h", "TEE_IOC_CANCEL", _IOC_READ, 0xa404, 0x08 }, +{ "linux/tee.h", "TEE_IOC_CLOSE_SESSION", _IOC_READ, 0xa405, 0x04 }, +{ "linux/tee.h", "TEE_IOC_INVOKE", _IOC_READ, 0xa403, 0x10 }, +{ "linux/tee.h", "TEE_IOC_OPEN_SESSION", _IOC_READ, 0xa402, 0x10 }, +{ "linux/tee.h", "TEE_IOC_SHM_ALLOC", _IOC_READ|_IOC_WRITE, 0xa401, 0x10 }, +{ "linux/tee.h", "TEE_IOC_SHM_REGISTER", _IOC_READ|_IOC_WRITE, 0xa409, 0x18 }, +{ "linux/tee.h", "TEE_IOC_SUPPL_RECV", _IOC_READ, 0xa406, 0x10 }, +{ "linux/tee.h", "TEE_IOC_SUPPL_SEND", _IOC_READ, 0xa407, 0x10 }, +{ "linux/tee.h", "TEE_IOC_VERSION", _IOC_READ, 0xa400, 0x0c }, { "linux/timerfd.h", "TFD_IOC_SET_TICKS", _IOC_WRITE, 0x5400, 0x08 }, { "linux/toshiba.h", "TOSHIBA_ACPI_SCI", _IOC_READ|_IOC_WRITE, 0x7491, 0x18 }, { "linux/toshiba.h", "TOSH_SMM", _IOC_READ|_IOC_WRITE, 0x7490, 0x18 }, @@ -1992,6 +2025,8 @@ { "linux/udf_fs_i.h", "UDF_GETEASIZE", _IOC_READ, 0x6c40, 0x04 }, { "linux/udf_fs_i.h", "UDF_GETVOLIDENT", _IOC_READ, 0x6c42, 0x04 }, { "linux/udf_fs_i.h", "UDF_RELOCATE_BLOCKS", _IOC_READ|_IOC_WRITE, 0x6c43, 0x04 }, +{ "linux/udmabuf.h", "UDMABUF_CREATE", _IOC_WRITE, 0x7542, 0x18 }, +{ "linux/udmabuf.h", "UDMABUF_CREATE_LIST", _IOC_WRITE, 0x7543, 0x08 }, { "linux/uinput.h", "UI_ABS_SETUP", _IOC_WRITE, 0x5504, 0x1c }, { "linux/uinput.h", "UI_BEGIN_FF_ERASE", _IOC_READ|_IOC_WRITE, 0x55ca, 0x0c }, { "linux/uinput.h", "UI_BEGIN_FF_UPLOAD", _IOC_READ|_IOC_WRITE, 0x55c8, 0x60 }, @@ -2021,6 +2056,7 @@ { "linux/usb/functionfs.h", "FUNCTIONFS_INTERFACE_REVMAP", _IOC_NONE, 0x6780, 0x00 }, { "linux/usb/g_printer.h", "GADGET_GET_PRINTER_STATUS", _IOC_READ, 0x6721, 0x01 }, { "linux/usb/g_printer.h", "GADGET_SET_PRINTER_STATUS", _IOC_READ|_IOC_WRITE, 0x6722, 0x01 }, +{ "linux/usb/g_uvc.h", "UVCIOC_SEND_RESPONSE", _IOC_WRITE, 0x5501, 0x40 }, { "linux/usb/gadgetfs.h", "GADGETFS_CLEAR_HALT", _IOC_NONE, 0x6703, 0x00 }, { "linux/usb/gadgetfs.h", "GADGETFS_FIFO_FLUSH", _IOC_NONE, 0x6702, 0x00 }, { "linux/usb/gadgetfs.h", "GADGETFS_FIFO_STATUS", _IOC_NONE, 0x6701, 0x00 }, @@ -2032,12 +2068,27 @@ { "linux/usb/tmc.h", "USBTMC488_IOCTL_LOCAL_LOCKOUT", _IOC_NONE, 0x5b15, 0x00 }, { "linux/usb/tmc.h", "USBTMC488_IOCTL_READ_STB", _IOC_READ, 0x5b12, 0x01 }, { "linux/usb/tmc.h", "USBTMC488_IOCTL_REN_CONTROL", _IOC_WRITE, 0x5b13, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_TRIGGER", _IOC_NONE, 0x5b16, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC488_IOCTL_WAIT_SRQ", _IOC_WRITE, 0x5b17, 0x04 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_IN", _IOC_NONE, 0x5b04, 0x00 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_ABORT_BULK_OUT", _IOC_NONE, 0x5b03, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_API_VERSION", _IOC_READ, 0x5b10, 0x04 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_AUTO_ABORT", _IOC_WRITE, 0x5b19, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CANCEL_IO", _IOC_NONE, 0x5b23, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CLEANUP_IO", _IOC_NONE, 0x5b24, 0x00 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR", _IOC_NONE, 0x5b02, 0x00 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_IN_HALT", _IOC_NONE, 0x5b07, 0x00 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_CLEAR_OUT_HALT", _IOC_NONE, 0x5b06, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CONFIG_TERMCHAR", _IOC_WRITE, 0x5b0c, 0x02 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_CTRL_REQUEST", _IOC_READ|_IOC_WRITE, 0x5b08, 0x0c }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_EOM_ENABLE", _IOC_WRITE, 0x5b0b, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_GET_TIMEOUT", _IOC_READ, 0x5b09, 0x04 }, { "linux/usb/tmc.h", "USBTMC_IOCTL_INDICATOR_PULSE", _IOC_NONE, 0x5b01, 0x00 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_MSG_IN_ATTR", _IOC_READ, 0x5b18, 0x01 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_READ", _IOC_READ|_IOC_WRITE, 0x5b0e, 0x10 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_SET_TIMEOUT", _IOC_WRITE, 0x5b0a, 0x04 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_WRITE", _IOC_READ|_IOC_WRITE, 0x5b0d, 0x10 }, +{ "linux/usb/tmc.h", "USBTMC_IOCTL_WRITE_RESULT", _IOC_READ|_IOC_WRITE, 0x5b0f, 0x04 }, { "linux/usbdevice_fs.h", "USBDEVFS_ALLOC_STREAMS", _IOC_READ, 0x551c, 0x08 }, { "linux/usbdevice_fs.h", "USBDEVFS_BULK", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 }, { "linux/usbdevice_fs.h", "USBDEVFS_BULK32", _IOC_READ|_IOC_WRITE, 0x5502, 0x10 }, @@ -2057,6 +2108,7 @@ { "linux/usbdevice_fs.h", "USBDEVFS_FREE_STREAMS", _IOC_READ, 0x551d, 0x08 }, { "linux/usbdevice_fs.h", "USBDEVFS_GETDRIVER", _IOC_WRITE, 0x5508, 0x104 }, { "linux/usbdevice_fs.h", "USBDEVFS_GET_CAPABILITIES", _IOC_READ, 0x551a, 0x04 }, +{ "linux/usbdevice_fs.h", "USBDEVFS_GET_SPEED", _IOC_NONE, 0x551f, 0x00 }, { "linux/usbdevice_fs.h", "USBDEVFS_HUB_PORTINFO", _IOC_READ, 0x5513, 0x80 }, { "linux/usbdevice_fs.h", "USBDEVFS_IOCTL", _IOC_READ|_IOC_WRITE, 0x5512, 0x0c }, { "linux/usbdevice_fs.h", "USBDEVFS_IOCTL32", _IOC_READ|_IOC_WRITE, 0x5512, 0x0c }, @@ -2080,30 +2132,36 @@ { "linux/userfaultfd.h", "UFFDIO_ZEROPAGE", _IOC_READ|_IOC_WRITE, 0xaa04, 0x20 }, { "linux/uvcvideo.h", "UVCIOC_CTRL_MAP", _IOC_READ|_IOC_WRITE, 0x7520, 0x58 }, { "linux/uvcvideo.h", "UVCIOC_CTRL_QUERY", _IOC_READ|_IOC_WRITE, 0x7521, 0x0c }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_DV_TIMINGS_CAP", _IOC_READ|_IOC_WRITE, 0x5664, 0x90 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5662, 0x94 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x564b, 0x40 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_FRAME_SIZE", _IOC_READ|_IOC_WRITE, 0x564a, 0x40 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_ENUM_MBUS_CODE", _IOC_READ|_IOC_WRITE, 0x5602, 0x30 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_CROP", _IOC_READ|_IOC_WRITE, 0x563b, 0x38 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5658, 0x84 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_EDID", _IOC_READ|_IOC_WRITE, 0x5628, 0x24 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FMT", _IOC_READ|_IOC_WRITE, 0x5604, 0x58 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5615, 0x30 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_G_SELECTION", _IOC_READ|_IOC_WRITE, 0x563d, 0x40 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_CROP", _IOC_READ|_IOC_WRITE, 0x563c, 0x38 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_DV_TIMINGS", _IOC_READ|_IOC_WRITE, 0x5657, 0x84 }, -{ "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_EDID", _IOC_READ|_IOC_WRITE, 0x5629, 0x24 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FMT", _IOC_READ|_IOC_WRITE, 0x5605, 0x58 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_FRAME_INTERVAL", _IOC_READ|_IOC_WRITE, 0x5616, 0x30 }, { "linux/v4l2-subdev.h", "VIDIOC_SUBDEV_S_SELECTION", _IOC_READ|_IOC_WRITE, 0x563e, 0x40 }, +{ "linux/vboxguest.h", "VBG_IOCTL_CHANGE_FILTER_MASK", _IOC_READ|_IOC_WRITE, 0x560c, 0x20 }, +{ "linux/vboxguest.h", "VBG_IOCTL_CHANGE_GUEST_CAPABILITIES", _IOC_READ|_IOC_WRITE, 0x560e, 0x20 }, +{ "linux/vboxguest.h", "VBG_IOCTL_CHECK_BALLOON", _IOC_READ|_IOC_WRITE, 0x5611, 0x20 }, +{ "linux/vboxguest.h", "VBG_IOCTL_DRIVER_VERSION_INFO", _IOC_READ|_IOC_WRITE, 0x5600, 0x2c }, +{ "linux/vboxguest.h", "VBG_IOCTL_HGCM_CONNECT", _IOC_READ|_IOC_WRITE, 0x5604, 0x9c }, +{ "linux/vboxguest.h", "VBG_IOCTL_HGCM_DISCONNECT", _IOC_READ|_IOC_WRITE, 0x5605, 0x1c }, +{ "linux/vboxguest.h", "VBG_IOCTL_INTERRUPT_ALL_WAIT_FOR_EVENTS", _IOC_READ|_IOC_WRITE, 0x560b, 0x18 }, +{ "linux/vboxguest.h", "VBG_IOCTL_VMMDEV_REQUEST_BIG", _IOC_READ|_IOC_WRITE, 0x5603, 0x00 }, +{ "linux/vboxguest.h", "VBG_IOCTL_WAIT_FOR_EVENTS", _IOC_READ|_IOC_WRITE, 0x560a, 0x20 }, +{ "linux/vboxguest.h", "VBG_IOCTL_WRITE_CORE_DUMP", _IOC_READ|_IOC_WRITE, 0x5613, 0x1c }, { "linux/vfio.h", "VFIO_CHECK_EXTENSION", _IOC_NONE, 0x3b65, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_GET_GFX_DMABUF", _IOC_NONE, 0x3b73, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_GET_INFO", _IOC_NONE, 0x3b6b, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_GET_IRQ_INFO", _IOC_NONE, 0x3b6d, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_GET_PCI_HOT_RESET_INFO", _IOC_NONE, 0x3b70, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_GET_REGION_INFO", _IOC_NONE, 0x3b6c, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_IOEVENTFD", _IOC_NONE, 0x3b74, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_PCI_HOT_RESET", _IOC_NONE, 0x3b71, 0x00 }, +{ "linux/vfio.h", "VFIO_DEVICE_QUERY_GFX_PLANE", _IOC_NONE, 0x3b72, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_RESET", _IOC_NONE, 0x3b6f, 0x00 }, { "linux/vfio.h", "VFIO_DEVICE_SET_IRQS", _IOC_NONE, 0x3b6e, 0x00 }, { "linux/vfio.h", "VFIO_EEH_PE_OP", _IOC_NONE, 0x3b79, 0x00 }, @@ -2123,6 +2181,7 @@ { "linux/vfio.h", "VFIO_IOMMU_SPAPR_UNREGISTER_MEMORY", _IOC_NONE, 0x3b76, 0x00 }, { "linux/vfio.h", "VFIO_IOMMU_UNMAP_DMA", _IOC_NONE, 0x3b72, 0x00 }, { "linux/vfio.h", "VFIO_SET_IOMMU", _IOC_NONE, 0x3b66, 0x00 }, +{ "linux/vhost.h", "VHOST_GET_BACKEND_FEATURES", _IOC_READ, 0xaf26, 0x08 }, { "linux/vhost.h", "VHOST_GET_FEATURES", _IOC_READ, 0xaf00, 0x08 }, { "linux/vhost.h", "VHOST_GET_VRING_BASE", _IOC_READ|_IOC_WRITE, 0xaf12, 0x08 }, { "linux/vhost.h", "VHOST_GET_VRING_BUSYLOOP_TIMEOUT", _IOC_WRITE, 0xaf24, 0x08 }, @@ -2134,6 +2193,7 @@ { "linux/vhost.h", "VHOST_SCSI_GET_EVENTS_MISSED", _IOC_WRITE, 0xaf44, 0x04 }, { "linux/vhost.h", "VHOST_SCSI_SET_ENDPOINT", _IOC_WRITE, 0xaf40, 0xe8 }, { "linux/vhost.h", "VHOST_SCSI_SET_EVENTS_MISSED", _IOC_WRITE, 0xaf43, 0x04 }, +{ "linux/vhost.h", "VHOST_SET_BACKEND_FEATURES", _IOC_WRITE, 0xaf25, 0x08 }, { "linux/vhost.h", "VHOST_SET_FEATURES", _IOC_WRITE, 0xaf00, 0x08 }, { "linux/vhost.h", "VHOST_SET_LOG_BASE", _IOC_WRITE, 0xaf04, 0x08 }, { "linux/vhost.h", "VHOST_SET_LOG_FD", _IOC_WRITE, 0xaf07, 0x04 }, @@ -2203,7 +2263,6 @@ { "linux/videodev2.h", "VIDIOC_QUERY_DV_TIMINGS", _IOC_READ, 0x5663, 0x84 }, { "linux/videodev2.h", "VIDIOC_QUERY_EXT_CTRL", _IOC_READ|_IOC_WRITE, 0x5667, 0xe8 }, { "linux/videodev2.h", "VIDIOC_REQBUFS", _IOC_READ|_IOC_WRITE, 0x5608, 0x14 }, -{ "linux/videodev2.h", "VIDIOC_RESERVED", _IOC_NONE, 0x5601, 0x00 }, { "linux/videodev2.h", "VIDIOC_STREAMOFF", _IOC_WRITE, 0x5613, 0x04 }, { "linux/videodev2.h", "VIDIOC_STREAMON", _IOC_WRITE, 0x5612, 0x04 }, { "linux/videodev2.h", "VIDIOC_SUBSCRIBE_EVENT", _IOC_WRITE, 0x565a, 0x20 }, @@ -2335,7 +2394,7 @@ { "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 }, { "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 }, { "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 }, -{ "media/davinci/vpfe_capture.h", "VPFE_CMD_S_CCDC_RAW_PARAMS", _IOC_WRITE, 0x56c1, 0x04 }, +{ "linux/wmi.h", "DELL_WMI_SMBIOS_CMD", _IOC_READ|_IOC_WRITE, 0x5700, 0x34 }, { "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 }, { "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 }, { "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 }, @@ -2353,6 +2412,23 @@ { "misc/cxl.h", "CXL_IOCTL_GET_PROCESS_ELEMENT", _IOC_READ, 0xca01, 0x04 }, { "misc/cxl.h", "CXL_IOCTL_START_WORK", _IOC_WRITE, 0xca00, 0x40 }, { "misc/cxl.h", "CXL_IOCTL_VALIDATE_IMAGE", _IOC_WRITE, 0xca0b, 0x40 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_ALLOC_DMA_BUFF", _IOC_READ|_IOC_WRITE, 0x5201, 0x10 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_FREE_DMA_BUFF", _IOC_READ|_IOC_WRITE, 0x5202, 0x04 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_ATTACH", _IOC_NONE, 0x5204, 0x00 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_INIT_CREATE", _IOC_READ|_IOC_WRITE, 0x5205, 0x18 }, +{ "misc/fastrpc.h", "FASTRPC_IOCTL_INVOKE", _IOC_READ|_IOC_WRITE, 0x5203, 0x10 }, +{ "misc/habanalabs.h", "HL_IOCTL_CB", _IOC_READ|_IOC_WRITE, 0x4802, 0x18 }, +{ "misc/habanalabs.h", "HL_IOCTL_CS", _IOC_READ|_IOC_WRITE, 0x4803, 0x30 }, +{ "misc/habanalabs.h", "HL_IOCTL_INFO", _IOC_READ|_IOC_WRITE, 0x4801, 0x18 }, +{ "misc/habanalabs.h", "HL_IOCTL_MEMORY", _IOC_READ|_IOC_WRITE, 0x4805, 0x28 }, +{ "misc/habanalabs.h", "HL_IOCTL_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x4804, 0x18 }, +{ "misc/ocxl.h", "OCXL_IOCTL_ATTACH", _IOC_WRITE, 0xca10, 0x20 }, +{ "misc/ocxl.h", "OCXL_IOCTL_ENABLE_P9_WAIT", _IOC_READ, 0xca15, 0x20 }, +{ "misc/ocxl.h", "OCXL_IOCTL_GET_FEATURES", _IOC_READ, 0xca16, 0x20 }, +{ "misc/ocxl.h", "OCXL_IOCTL_GET_METADATA", _IOC_READ, 0xca14, 0x80 }, +{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_ALLOC", _IOC_READ, 0xca11, 0x08 }, +{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_FREE", _IOC_WRITE, 0xca12, 0x08 }, +{ "misc/ocxl.h", "OCXL_IOCTL_IRQ_SET_FD", _IOC_WRITE, 0xca13, 0x10 }, { "mtd/mtd-abi.h", "ECCGETLAYOUT", _IOC_READ, 0x4d11, 0x148 }, { "mtd/mtd-abi.h", "ECCGETSTATS", _IOC_READ, 0x4d12, 0x10 }, { "mtd/mtd-abi.h", "MEMERASE", _IOC_WRITE, 0x4d02, 0x08 }, @@ -2386,8 +2462,10 @@ { "mtd/ubi-user.h", "UBI_IOCMKVOL", _IOC_WRITE, 0x6f00, 0x98 }, { "mtd/ubi-user.h", "UBI_IOCRMVOL", _IOC_WRITE, 0x6f01, 0x04 }, { "mtd/ubi-user.h", "UBI_IOCRNVOL", _IOC_WRITE, 0x6f03, 0x1110 }, +{ "mtd/ubi-user.h", "UBI_IOCRPEB", _IOC_WRITE, 0x6f04, 0x04 }, { "mtd/ubi-user.h", "UBI_IOCRSVOL", _IOC_WRITE, 0x6f02, 0x0c }, { "mtd/ubi-user.h", "UBI_IOCSETVOLPROP", _IOC_WRITE, 0x4f06, 0x10 }, +{ "mtd/ubi-user.h", "UBI_IOCSPEB", _IOC_WRITE, 0x6f05, 0x04 }, { "mtd/ubi-user.h", "UBI_IOCVOLCRBLK", _IOC_WRITE, 0x4f07, 0x80 }, { "mtd/ubi-user.h", "UBI_IOCVOLRMBLK", _IOC_NONE, 0x4f08, 0x00 }, { "mtd/ubi-user.h", "UBI_IOCVOLUP", _IOC_WRITE, 0x4f00, 0x08 }, @@ -2418,23 +2496,24 @@ { "net/bluetooth/rfcomm.h", "RFCOMMRELEASEDEV", _IOC_WRITE, 0x52c9, 0x04 }, { "net/bluetooth/rfcomm.h", "RFCOMMSTEALDLC", _IOC_WRITE, 0x52dc, 0x04 }, { "net/nfc/nci_core.h", "NCIUARTSETDRIVER", _IOC_WRITE, 0x5500, 0x04 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_ACK_EVENT", _IOC_WRITE, 0x1bea, 0x04 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_ASSIGN_CTXT", _IOC_READ|_IOC_WRITE, 0x1be1, 0x1c }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CREDIT_UPD", _IOC_NONE, 0x1be6, 0x00 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CTXT_INFO", _IOC_WRITE, 0x1be2, 0x28 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_CTXT_RESET", _IOC_NONE, 0x1bec, 0x00 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_GET_VERS", _IOC_READ, 0x1bee, 0x04 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_POLL_TYPE", _IOC_WRITE, 0x1be9, 0x04 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_RECV_CTRL", _IOC_WRITE, 0x1be8, 0x04 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_SET_PKEY", _IOC_WRITE, 0x1beb, 0x02 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_FREE", _IOC_READ|_IOC_WRITE, 0x1be5, 0x18 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_INVAL_READ", _IOC_READ|_IOC_WRITE, 0x1bed, 0x18 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_TID_UPDATE", _IOC_READ|_IOC_WRITE, 0x1be4, 0x18 }, -{ "rdma/hfi/hfi1_user.h", "HFI1_IOCTL_USER_INFO", _IOC_WRITE, 0x1be3, 0x78 }, -{ "rdma/ib_user_mad.h", "IB_USER_MAD_ENABLE_PKEY", _IOC_NONE, 0x1b03, 0x00 }, -{ "rdma/ib_user_mad.h", "IB_USER_MAD_REGISTER_AGENT", _IOC_READ|_IOC_WRITE, 0x1b01, 0x1c }, -{ "rdma/ib_user_mad.h", "IB_USER_MAD_REGISTER_AGENT2", _IOC_READ|_IOC_WRITE, 0x1b04, 0x28 }, -{ "rdma/ib_user_mad.h", "IB_USER_MAD_UNREGISTER_AGENT", _IOC_WRITE, 0x1b02, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_ACK_EVENT", _IOC_WRITE, 0x1bea, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_ASSIGN_CTXT", _IOC_READ|_IOC_WRITE, 0x1be1, 0x1c }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CREDIT_UPD", _IOC_NONE, 0x1be6, 0x00 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CTXT_INFO", _IOC_WRITE, 0x1be2, 0x28 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_CTXT_RESET", _IOC_NONE, 0x1bec, 0x00 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_GET_VERS", _IOC_READ, 0x1bee, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_POLL_TYPE", _IOC_WRITE, 0x1be9, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_RECV_CTRL", _IOC_WRITE, 0x1be8, 0x04 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_SET_PKEY", _IOC_WRITE, 0x1beb, 0x02 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_FREE", _IOC_READ|_IOC_WRITE, 0x1be5, 0x18 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_INVAL_READ", _IOC_READ|_IOC_WRITE, 0x1bed, 0x18 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_TID_UPDATE", _IOC_READ|_IOC_WRITE, 0x1be4, 0x18 }, +{ "rdma/rdma_user_ioctl.h", "HFI1_IOCTL_USER_INFO", _IOC_WRITE, 0x1be3, 0x78 }, +{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_ENABLE_PKEY", _IOC_NONE, 0x1b03, 0x00 }, +{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_REGISTER_AGENT", _IOC_READ|_IOC_WRITE, 0x1b01, 0x1c }, +{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_REGISTER_AGENT2", _IOC_READ|_IOC_WRITE, 0x1b04, 0x28 }, +{ "rdma/rdma_user_ioctl.h", "IB_USER_MAD_UNREGISTER_AGENT", _IOC_WRITE, 0x1b02, 0x04 }, +{ "rdma/rdma_user_ioctl_cmds.h", "RDMA_VERBS_IOCTL", _IOC_READ|_IOC_WRITE, 0x1b01, 0x18 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_ATTACH", _IOC_READ|_IOC_WRITE, 0xca80, 0x90 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_DETACH", _IOC_READ|_IOC_WRITE, 0xca83, 0x60 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_MANAGE_LUN", _IOC_READ|_IOC_WRITE, 0xca86, 0x68 }, @@ -2445,6 +2524,8 @@ { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VERIFY", _IOC_READ|_IOC_WRITE, 0xca84, 0x90 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_CLONE", _IOC_READ|_IOC_WRITE, 0xca89, 0x70 }, { "scsi/cxlflash_ioctl.h", "DK_CXLFLASH_VLUN_RESIZE", _IOC_READ|_IOC_WRITE, 0xca88, 0x78 }, +{ "scsi/cxlflash_ioctl.h", "HT_CXLFLASH_AFU_DEBUG", _IOC_READ|_IOC_WRITE, 0xcabe, 0x78 }, +{ "scsi/cxlflash_ioctl.h", "HT_CXLFLASH_LUN_PROVISION", _IOC_READ|_IOC_WRITE, 0xcabf, 0xa0 }, { "scsi/scsi.h", "SCSI_IOCTL_GET_BUS_NUMBER", 0, 0x5386, 0 }, { "scsi/scsi.h", "SCSI_IOCTL_GET_IDLUN", 0, 0x5382, 0 }, { "scsi/scsi.h", "SCSI_IOCTL_GET_PCI", 0, 0x5387, 0 }, @@ -2563,6 +2644,7 @@ { "sound/asound.h", "SNDRV_PCM_IOCTL_TSTAMP", _IOC_WRITE, 0x4102, 0x04 }, { "sound/asound.h", "SNDRV_PCM_IOCTL_TTSTAMP", _IOC_WRITE, 0x4103, 0x04 }, { "sound/asound.h", "SNDRV_PCM_IOCTL_UNLINK", _IOC_NONE, 0x4161, 0x00 }, +{ "sound/asound.h", "SNDRV_PCM_IOCTL_USER_PVERSION", _IOC_WRITE, 0x4104, 0x04 }, { "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEI_FRAMES", _IOC_WRITE, 0x4150, 0x0c }, { "sound/asound.h", "SNDRV_PCM_IOCTL_WRITEN_FRAMES", _IOC_WRITE, 0x4152, 0x0c }, { "sound/asound.h", "SNDRV_PCM_IOCTL_XRUN", _IOC_NONE, 0x4148, 0x00 }, @@ -2626,6 +2708,7 @@ { "sound/emu10k1.h", "SNDRV_EMU10K1_IOCTL_ZERO_TRAM_COUNTER", _IOC_NONE, 0x4882, 0x00 }, { "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_GET_INFO", _IOC_READ, 0x48f8, 0x20 }, { "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_LOCK", _IOC_NONE, 0x48f9, 0x00 }, +{ "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_TASCAM_STATE", _IOC_READ, 0x48fb, 0x100 }, { "sound/firewire.h", "SNDRV_FIREWIRE_IOCTL_UNLOCK", _IOC_NONE, 0x48fa, 0x00 }, { "sound/hda_hwdep.h", "HDA_IOCTL_GET_WCAP", _IOC_READ|_IOC_WRITE, 0x4812, 0x08 }, { "sound/hda_hwdep.h", "HDA_IOCTL_PVERSION", _IOC_READ, 0x4810, 0x04 }, @@ -2666,17 +2749,17 @@ { "staging/android/ashmem.h", "ASHMEM_SET_PROT_MASK", _IOC_WRITE, 0x7705, 0x04 }, { "staging/android/ashmem.h", "ASHMEM_SET_SIZE", _IOC_WRITE, 0x7703, 0x04 }, { "staging/android/ashmem.h", "ASHMEM_UNPIN", _IOC_WRITE, 0x7708, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_ALLOC", _IOC_READ|_IOC_WRITE, 0x4900, 0x14 }, -{ "staging/android/ion.h", "ION_IOC_CUSTOM", _IOC_READ|_IOC_WRITE, 0x4906, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_FREE", _IOC_READ|_IOC_WRITE, 0x4901, 0x04 }, +{ "staging/android/ion.h", "ION_IOC_ALLOC", _IOC_READ|_IOC_WRITE, 0x4900, 0x18 }, { "staging/android/ion.h", "ION_IOC_HEAP_QUERY", _IOC_READ|_IOC_WRITE, 0x4908, 0x18 }, -{ "staging/android/ion.h", "ION_IOC_IMPORT", _IOC_READ|_IOC_WRITE, 0x4905, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_MAP", _IOC_READ|_IOC_WRITE, 0x4902, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_SHARE", _IOC_READ|_IOC_WRITE, 0x4904, 0x08 }, -{ "staging/android/ion.h", "ION_IOC_SYNC", _IOC_READ|_IOC_WRITE, 0x4907, 0x08 }, -{ "staging/android/ion_test.h", "ION_IOC_TEST_DMA_MAPPING", _IOC_WRITE, 0x49f1, 0x20 }, -{ "staging/android/ion_test.h", "ION_IOC_TEST_KERNEL_MAPPING", _IOC_WRITE, 0x49f2, 0x20 }, -{ "staging/android/ion_test.h", "ION_IOC_TEST_SET_FD", _IOC_NONE, 0x49f0, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_COND_WAIT", _IOC_READ|_IOC_WRITE, 0xf507, 0x20 }, +{ "staging/android/vsoc_shm.h", "VSOC_COND_WAKE", _IOC_NONE, 0xf508, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_CREATE_FD_SCOPED_PERMISSION", _IOC_WRITE, 0xf500, 0x10 }, +{ "staging/android/vsoc_shm.h", "VSOC_DESCRIBE_REGION", _IOC_READ, 0xf504, 0x3c }, +{ "staging/android/vsoc_shm.h", "VSOC_GET_FD_SCOPED_PERMISSION", _IOC_READ, 0xf501, 0x10 }, +{ "staging/android/vsoc_shm.h", "VSOC_MAYBE_SEND_INTERRUPT_TO_HOST", _IOC_NONE, 0xf502, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_SELF_INTERRUPT", _IOC_NONE, 0xf505, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_SEND_INTERRUPT_TO_HOST", _IOC_NONE, 0xf506, 0x00 }, +{ "staging/android/vsoc_shm.h", "VSOC_WAIT_FOR_INCOMING_INTERRUPT", _IOC_NONE, 0xf503, 0x00 }, { "video/da8xx-fb.h", "FBIGET_BRIGHTNESS", _IOC_READ, 0x4603, 0x04 }, { "video/da8xx-fb.h", "FBIGET_COLOR", _IOC_READ, 0x4605, 0x04 }, { "video/da8xx-fb.h", "FBIOGET_CONTRAST", _IOC_READ, 0x4601, 0x04 }, @@ -2719,6 +2802,10 @@ { "xen/evtchn.h", "IOCTL_EVTCHN_RESET", _IOC_NONE, 0x4505, 0x00 }, { "xen/evtchn.h", "IOCTL_EVTCHN_RESTRICT_DOMID", _IOC_NONE, 0x4506, 0x02 }, { "xen/evtchn.h", "IOCTL_EVTCHN_UNBIND", _IOC_NONE, 0x4503, 0x04 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_FROM_REFS", _IOC_NONE, 0x4709, 0x14 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_EXP_WAIT_RELEASED", _IOC_NONE, 0x470a, 0x08 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_RELEASE", _IOC_NONE, 0x470c, 0x08 }, +{ "xen/gntdev.h", "IOCTL_GNTDEV_DMABUF_IMP_TO_REFS", _IOC_NONE, 0x470b, 0x14 }, { "xen/gntdev.h", "IOCTL_GNTDEV_GET_OFFSET_FOR_VADDR", _IOC_NONE, 0x4702, 0x18 }, { "xen/gntdev.h", "IOCTL_GNTDEV_GRANT_COPY", _IOC_NONE, 0x4708, 0x08 }, { "xen/gntdev.h", "IOCTL_GNTDEV_MAP_GRANT_REF", _IOC_NONE, 0x4700, 0x18 }, diff --git a/linux/x32/ptrace_pokeuser.c b/linux/x32/ptrace_pokeuser.c new file mode 100644 index 00000000..a4e70ffb --- /dev/null +++ b/linux/x32/ptrace_pokeuser.c @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +static long +ptrace_pokeuser(int pid, unsigned long off, kernel_ulong_t val) +{ + /* + * As PTRACE_POKEUSER is crippled on x32 by design from the very first + * linux kernel commit v3.4-rc1~33^2~2 when it was introduced, + * workaround this by using the raw x86_64 syscall instead. + */ + return syscall(101, PTRACE_POKEUSER, pid, off, val); +} diff --git a/linux/x32/raw_syscall.h b/linux/x32/raw_syscall.h new file mode 100644 index 00000000..6582aa8f --- /dev/null +++ b/linux/x32/raw_syscall.h @@ -0,0 +1 @@ +#include "x86_64/raw_syscall.h" diff --git a/linux/x32/rt_sigframe.h b/linux/x32/rt_sigframe.h new file mode 100644 index 00000000..8452e890 --- /dev/null +++ b/linux/x32/rt_sigframe.h @@ -0,0 +1 @@ +#include "x86_64/rt_sigframe.h" diff --git a/linux/x32/shuffle_scno.c b/linux/x32/shuffle_scno.c new file mode 100644 index 00000000..0e1abb30 --- /dev/null +++ b/linux/x32/shuffle_scno.c @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +kernel_ulong_t +shuffle_scno(kernel_ulong_t scno) +{ + if (current_personality == 0 && scno != (kernel_ulong_t) -1) + scno ^= __X32_SYSCALL_BIT; + + return scno; +} diff --git a/linux/x32/signalent1.h b/linux/x32/signalent1.h deleted file mode 100644 index fdae15fc..00000000 --- a/linux/x32/signalent1.h +++ /dev/null @@ -1,2 +0,0 @@ -/* i386 personality */ -#include "signalent.h" diff --git a/linux/x32/syscallent.h b/linux/x32/syscallent.h index 0cda1a65..76d4676e 100644 --- a/linux/x32/syscallent.h +++ b/linux/x32/syscallent.h @@ -1,24 +1,31 @@ +/* + * Copyright (c) 2012-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + [ 0] = { 3, TD, SEN(read), "read" }, [ 1] = { 3, TD, SEN(write), "write" }, [ 2] = { 3, TD|TF, SEN(open), "open" }, [ 3] = { 1, TD, SEN(close), "close" }, -[ 4] = { 2, TF, SEN(stat), "stat" }, -[ 5] = { 2, TD, SEN(fstat), "fstat" }, -[ 6] = { 2, TF, SEN(lstat), "lstat" }, -[ 7] = { 3, TD, SEN(poll), "poll" }, +[ 4] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, +[ 5] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, +[ 6] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, +[ 7] = { 3, TD, SEN(poll_time64), "poll" }, [ 8] = { 3, TD, SEN(lseek), "lseek" }, [ 9] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, [ 10] = { 3, TM|SI, SEN(mprotect), "mprotect" }, [ 11] = { 2, TM|SI, SEN(munmap), "munmap" }, [ 12] = { 1, TM|SI, SEN(brk), "brk" }, -[ 13] = { 4, TS, SEN(printargs), "64:rt_sigaction" }, +[ 13] = { 4, TS, SEN(printargs), "rt_sigaction#64" }, [ 14] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, -[ 15] = { 0, TS, SEN(printargs), "64:rt_sigreturn" }, -[ 16] = { 3, TD, SEN(printargs), "64:ioctl" }, +[ 15] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn#64" }, +[ 16] = { 3, TD, SEN(printargs), "ioctl#64" }, [ 17] = { 4, TD, SEN(pread), "pread64" }, [ 18] = { 4, TD, SEN(pwrite), "pwrite64" }, -[ 19] = { 3, TD, SEN(printargs), "64:readv" }, -[ 20] = { 3, TD, SEN(printargs), "64:writev" }, +[ 19] = { 3, TD, SEN(printargs), "readv#64" }, +[ 20] = { 3, TD, SEN(printargs), "writev#64" }, [ 21] = { 2, TF, SEN(access), "access" }, [ 22] = { 1, TD, SEN(pipe), "pipe" }, [ 23] = { 5, TD, SEN(select), "select" }, @@ -33,31 +40,31 @@ [ 32] = { 1, TD, SEN(dup), "dup" }, [ 33] = { 2, TD, SEN(dup2), "dup2" }, [ 34] = { 0, TS, SEN(pause), "pause" }, -[ 35] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[ 35] = { 2, 0, SEN(nanosleep_time64), "nanosleep" }, [ 36] = { 2, 0, SEN(getitimer), "getitimer" }, [ 37] = { 1, 0, SEN(alarm), "alarm" }, [ 38] = { 3, 0, SEN(setitimer), "setitimer" }, -[ 39] = { 0, NF, SEN(getpid), "getpid" }, +[ 39] = { 0, PU|NF, SEN(getpid), "getpid" }, [ 40] = { 4, TD|TN, SEN(sendfile64), "sendfile" }, [ 41] = { 3, TN, SEN(socket), "socket" }, [ 42] = { 3, TN, SEN(connect), "connect" }, [ 43] = { 3, TN, SEN(accept), "accept" }, [ 44] = { 6, TN, SEN(sendto), "sendto" }, -[ 45] = { 6, TN, SEN(printargs), "64:recvfrom" }, -[ 46] = { 3, TN, SEN(printargs), "64:sendmsg" }, -[ 47] = { 3, TN, SEN(printargs), "64:recvmsg" }, +[ 45] = { 6, TN, SEN(printargs), "recvfrom#64" }, +[ 46] = { 3, TN, SEN(printargs), "sendmsg#64" }, +[ 47] = { 3, TN, SEN(printargs), "recvmsg#64" }, [ 48] = { 2, TN, SEN(shutdown), "shutdown" }, [ 49] = { 3, TN, SEN(bind), "bind" }, [ 50] = { 2, TN, SEN(listen), "listen" }, [ 51] = { 3, TN, SEN(getsockname), "getsockname" }, [ 52] = { 3, TN, SEN(getpeername), "getpeername" }, [ 53] = { 4, TN, SEN(socketpair), "socketpair" }, -[ 54] = { 5, TN, SEN(printargs), "64:setsockopt" }, -[ 55] = { 5, TN, SEN(printargs), "64:getsockopt" }, +[ 54] = { 5, TN, SEN(printargs), "setsockopt#64" }, +[ 55] = { 5, TN, SEN(printargs), "getsockopt#64" }, [ 56] = { 5, TP, SEN(clone), "clone" }, [ 57] = { 0, TP, SEN(fork), "fork" }, [ 58] = { 0, TP, SEN(vfork), "vfork" }, -[ 59] = { 3, TF|TP|SE|SI, SEN(printargs), "64:execve" }, +[ 59] = { 3, TF|TP|SE|SI, SEN(printargs), "execve#64" }, [ 60] = { 1, TP|SE, SEN(exit), "exit" }, [ 61] = { 4, TP, SEN(wait4), "wait4" }, [ 62] = { 2, TS, SEN(kill), "kill" }, @@ -99,17 +106,17 @@ [ 98] = { 2, 0, SEN(getrusage), "getrusage" }, [ 99] = { 1, 0, SEN(sysinfo), "sysinfo" }, [100] = { 1, 0, SEN(times), "times" }, -[101] = { 4, 0, SEN(printargs), "64:ptrace" }, -[102] = { 0, NF, SEN(getuid), "getuid" }, +[101] = { 4, 0, SEN(printargs), "ptrace#64" }, +[102] = { 0, PU|NF, SEN(getuid), "getuid" }, [103] = { 3, 0, SEN(syslog), "syslog" }, -[104] = { 0, NF, SEN(getgid), "getgid" }, +[104] = { 0, PU|NF, SEN(getgid), "getgid" }, [105] = { 1, 0, SEN(setuid), "setuid" }, [106] = { 1, 0, SEN(setgid), "setgid" }, -[107] = { 0, NF, SEN(geteuid), "geteuid" }, -[108] = { 0, NF, SEN(getegid), "getegid" }, +[107] = { 0, PU|NF, SEN(geteuid), "geteuid" }, +[108] = { 0, PU|NF, SEN(getegid), "getegid" }, [109] = { 2, 0, SEN(setpgid), "setpgid" }, -[110] = { 0, NF, SEN(getppid), "getppid" }, -[111] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[110] = { 0, PU|NF, SEN(getppid), "getppid" }, +[111] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, [112] = { 0, 0, SEN(setsid), "setsid" }, [113] = { 2, 0, SEN(setreuid), "setreuid" }, [114] = { 2, 0, SEN(setregid), "setregid" }, @@ -125,18 +132,18 @@ [124] = { 1, 0, SEN(getsid), "getsid" }, [125] = { 2, 0, SEN(capget), "capget" }, [126] = { 2, 0, SEN(capset), "capset" }, -[127] = { 2, TS, SEN(printargs), "64:rt_sigpending" }, -[128] = { 4, TS, SEN(printargs), "64:rt_sigtimedwait" }, -[129] = { 3, TS, SEN(printargs), "64:rt_sigqueueinfo" }, +[127] = { 2, TS, SEN(printargs), "rt_sigpending#64" }, +[128] = { 4, TS, SEN(printargs), "rt_sigtimedwait#64" }, +[129] = { 3, TS, SEN(printargs), "rt_sigqueueinfo#64" }, [130] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, -[131] = { 2, TS, SEN(printargs), "64:sigaltstack" }, +[131] = { 2, TS, SEN(printargs), "sigaltstack#64" }, [132] = { 2, TF, SEN(utime), "utime" }, [133] = { 3, TF, SEN(mknod), "mknod" }, -[134] = { 1, TF, SEN(printargs), "64:uselib" }, +[134] = { 1, TF, SEN(printargs), "uselib#64" }, [135] = { 1, NF, SEN(personality), "personality" }, -[136] = { 2, 0, SEN(ustat), "ustat" }, -[137] = { 2, TF, SEN(statfs), "statfs" }, -[138] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[136] = { 2, TSFA, SEN(ustat), "ustat" }, +[137] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[138] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, [139] = { 3, 0, SEN(sysfs), "sysfs" }, [140] = { 2, 0, SEN(getpriority), "getpriority" }, [141] = { 3, 0, SEN(setpriority), "setpriority" }, @@ -146,7 +153,7 @@ [145] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, [146] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [147] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[148] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[148] = { 2, 0, SEN(sched_rr_get_interval_time64),"sched_rr_get_interval"}, [149] = { 2, TM, SEN(mlock), "mlock" }, [150] = { 2, TM, SEN(munlock), "munlock" }, [151] = { 1, TM, SEN(mlockall), "mlockall" }, @@ -154,10 +161,10 @@ [153] = { 0, 0, SEN(vhangup), "vhangup" }, [154] = { 3, 0, SEN(modify_ldt), "modify_ldt" }, [155] = { 2, TF, SEN(pivotroot), "pivot_root" }, -[156] = { 1, 0, SEN(printargs), "64:_sysctl" }, +[156] = { 1, 0, SEN(printargs), "_sysctl#64" }, [157] = { 5, 0, SEN(prctl), "prctl" }, [158] = { 2, TP, SEN(arch_prctl), "arch_prctl" }, -[159] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[159] = { 1, 0, SEN(adjtimex64), "adjtimex" }, [160] = { 2, 0, SEN(setrlimit), "setrlimit" }, [161] = { 1, TF, SEN(chroot), "chroot" }, [162] = { 0, 0, SEN(sync), "sync" }, @@ -172,19 +179,19 @@ [171] = { 2, 0, SEN(setdomainname), "setdomainname" }, [172] = { 1, 0, SEN(iopl), "iopl" }, [173] = { 3, 0, SEN(ioperm), "ioperm" }, -[174] = { 2, 0, SEN(printargs), "64:create_module" }, +[174] = { 2, 0, SEN(printargs), "create_module#64" }, [175] = { 3, 0, SEN(init_module), "init_module" }, [176] = { 2, 0, SEN(delete_module), "delete_module" }, -[177] = { 1, 0, SEN(printargs), "64:get_kernel_syms" }, -[178] = { 5, 0, SEN(printargs), "64:query_module" }, +[177] = { 1, 0, SEN(printargs), "get_kernel_syms#64" }, +[178] = { 5, 0, SEN(printargs), "query_module#64" }, [179] = { 4, TF, SEN(quotactl), "quotactl" }, -[180] = { 3, 0, SEN(printargs), "64:nfsservctl" }, +[180] = { 3, 0, SEN(printargs), "nfsservctl#64" }, [181] = { 5, TN, SEN(getpmsg), "getpmsg" }, [182] = { 5, TN, SEN(putpmsg), "putpmsg" }, [183] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, [184] = { 3, 0, SEN(tuxcall), "tuxcall" }, [185] = { 3, 0, SEN(security), "security" }, -[186] = { 0, NF, SEN(gettid), "gettid" }, +[186] = { 0, PU|NF, SEN(gettid), "gettid" }, [187] = { 3, TD, SEN(readahead), "readahead" }, [188] = { 5, TF, SEN(setxattr), "setxattr" }, [189] = { 5, TF, SEN(setxattr), "lsetxattr" }, @@ -200,59 +207,59 @@ [199] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [200] = { 2, TS, SEN(kill), "tkill" }, [201] = { 1, 0, SEN(time), "time" }, -[202] = { 6, 0, SEN(futex), "futex" }, +[202] = { 6, 0, SEN(futex_time64), "futex" }, [203] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [204] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, -[205] = { 1, 0, SEN(printargs), "64:set_thread_area" }, -[206] = { 2, TM, SEN(printargs), "64:io_setup" }, +[205] = { 1, 0, SEN(printargs), "set_thread_area#64" }, +[206] = { 2, TM, SEN(printargs), "io_setup#64" }, [207] = { 1, TM, SEN(io_destroy), "io_destroy" }, -[208] = { 5, 0, SEN(io_getevents), "io_getevents" }, -[209] = { 3, 0, SEN(printargs), "64:io_submit" }, +[208] = { 5, 0, SEN(io_getevents_time64), "io_getevents" }, +[209] = { 3, 0, SEN(printargs), "io_submit#64" }, [210] = { 3, 0, SEN(io_cancel), "io_cancel" }, -[211] = { 1, 0, SEN(printargs), "64:get_thread_area" }, +[211] = { 1, 0, SEN(printargs), "get_thread_area#64" }, [212] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" }, [213] = { 1, TD, SEN(epoll_create), "epoll_create" }, -[214] = { 4, 0, SEN(printargs), "64:epoll_ctl_old" }, -[215] = { 4, 0, SEN(printargs), "64:epoll_wait_old" }, +[214] = { 4, 0, SEN(printargs), "epoll_ctl_old#64" }, +[215] = { 4, 0, SEN(printargs), "epoll_wait_old#64" }, [216] = { 5, TM|SI, SEN(remap_file_pages), "remap_file_pages" }, [217] = { 3, TD, SEN(getdents64), "getdents64" }, [218] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [219] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, -[220] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[220] = { 4, TI, SEN(semtimedop_time64), "semtimedop" }, [221] = { 4, TD, SEN(fadvise64), "fadvise64" }, -[222] = { 3, 0, SEN(printargs), "64:timer_create" }, -[223] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[224] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[222] = { 3, 0, SEN(printargs), "timer_create#64" }, +[223] = { 4, 0, SEN(timer_settime64), "timer_settime" }, +[224] = { 2, 0, SEN(timer_gettime64), "timer_gettime" }, [225] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, [226] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[227] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[228] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[229] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[230] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[227] = { 2, 0, SEN(clock_settime64), "clock_settime" }, +[228] = { 2, 0, SEN(clock_gettime64), "clock_gettime" }, +[229] = { 2, 0, SEN(clock_getres_time64), "clock_getres" }, +[230] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep" }, [231] = { 1, TP|SE, SEN(exit), "exit_group" }, [232] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, [233] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, [234] = { 3, TS, SEN(tgkill), "tgkill" }, [235] = { 2, TF, SEN(utimes), "utimes" }, -[236] = { 5, 0, SEN(printargs), "64:vserver" }, +[236] = { 5, 0, SEN(printargs), "vserver#64" }, [237] = { 6, TM, SEN(mbind), "mbind" }, [238] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, [239] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, -[240] = { 4, 0, SEN(mq_open), "mq_open" }, +[240] = { 4, TD, SEN(mq_open), "mq_open" }, [241] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[242] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[243] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[244] = { 2, 0, SEN(printargs), "64:mq_notify" }, -[245] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, -[246] = { 4, 0, SEN(printargs), "64:kexec_load" }, -[247] = { 5, TP, SEN(printargs), "64:waitid" }, +[242] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend" }, +[243] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive" }, +[244] = { 2, 0, SEN(printargs), "mq_notify#64" }, +[245] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, +[246] = { 4, 0, SEN(printargs), "kexec_load#64" }, +[247] = { 5, TP, SEN(printargs), "waitid#64" }, [248] = { 5, 0, SEN(add_key), "add_key" }, [249] = { 4, 0, SEN(request_key), "request_key" }, [250] = { 5, 0, SEN(keyctl), "keyctl" }, [251] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, [252] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, [253] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[254] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[254] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, [255] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, [256] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, [257] = { 4, TD|TF, SEN(openat), "openat" }, @@ -260,7 +267,7 @@ [259] = { 4, TD|TF, SEN(mknodat), "mknodat" }, [260] = { 5, TD|TF, SEN(fchownat), "fchownat" }, [261] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[262] = { 4, TD|TF, SEN(newfstatat), "newfstatat" }, +[262] = { 4, TD|TF|TFST|TSTA,SEN(newfstatat), "newfstatat" }, [263] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, [264] = { 4, TD|TF, SEN(renameat), "renameat" }, [265] = { 5, TD|TF, SEN(linkat), "linkat" }, @@ -268,24 +275,24 @@ [267] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, [268] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, [269] = { 3, TD|TF, SEN(faccessat), "faccessat" }, -[270] = { 6, TD, SEN(pselect6), "pselect6" }, -[271] = { 5, TD, SEN(ppoll), "ppoll" }, +[270] = { 6, TD, SEN(pselect6_time64), "pselect6" }, +[271] = { 5, TD, SEN(ppoll_time64), "ppoll" }, [272] = { 1, TP, SEN(unshare), "unshare" }, -[273] = { 2, 0, SEN(printargs), "64:set_robust_list" }, -[274] = { 3, 0, SEN(printargs), "64:get_robust_list" }, +[273] = { 2, 0, SEN(printargs), "set_robust_list#64" }, +[274] = { 3, 0, SEN(printargs), "get_robust_list#64" }, [275] = { 6, TD, SEN(splice), "splice" }, [276] = { 4, TD, SEN(tee), "tee" }, [277] = { 4, TD, SEN(sync_file_range), "sync_file_range" }, -[278] = { 4, TD, SEN(printargs), "64:vmsplice" }, -[279] = { 6, TM, SEN(printargs), "64:move_pages" }, -[280] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[278] = { 4, TD, SEN(printargs), "vmsplice#64" }, +[279] = { 6, TM, SEN(printargs), "move_pages#64" }, +[280] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" }, [281] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, [282] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [283] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [284] = { 1, TD, SEN(eventfd), "eventfd" }, [285] = { 4, TD, SEN(fallocate), "fallocate" }, -[286] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, -[287] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[286] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime" }, +[287] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime" }, [288] = { 4, TN, SEN(accept4), "accept4" }, [289] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, [290] = { 2, TD, SEN(eventfd2), "eventfd2" }, @@ -293,23 +300,23 @@ [292] = { 3, TD, SEN(dup3), "dup3" }, [293] = { 2, TD, SEN(pipe2), "pipe2" }, [294] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, -[295] = { 4, TD, SEN(printargs), "64:preadv" }, -[296] = { 4, TD, SEN(printargs), "64:pwritev" }, -[297] = { 4, TP|TS, SEN(printargs), "64:rt_tgsigqueueinfo" }, +[295] = { 4, TD, SEN(printargs), "preadv#64" }, +[296] = { 4, TD, SEN(printargs), "pwritev#64" }, +[297] = { 4, TP|TS, SEN(printargs), "rt_tgsigqueueinfo#64" }, [298] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, -[299] = { 5, TN, SEN(printargs), "64:recvmmsg" }, +[299] = { 5, TN, SEN(printargs), "recvmmsg#64" }, [300] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, [301] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, [302] = { 4, 0, SEN(prlimit64), "prlimit64" }, [303] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, [304] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[305] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[305] = { 2, 0, SEN(clock_adjtime64), "clock_adjtime" }, [306] = { 1, TD, SEN(syncfs), "syncfs" }, -[307] = { 4, TN, SEN(printargs), "64:sendmmsg" }, +[307] = { 4, TN, SEN(printargs), "sendmmsg#64" }, [308] = { 2, TD, SEN(setns), "setns" }, [309] = { 3, 0, SEN(getcpu), "getcpu" }, -[310] = { 6, 0, SEN(printargs), "64:process_vm_readv" }, -[311] = { 6, 0, SEN(printargs), "64:process_vm_writev" }, +[310] = { 6, 0, SEN(printargs), "process_vm_readv#64" }, +[311] = { 6, 0, SEN(printargs), "process_vm_writev#64" }, [312] = { 5, 0, SEN(kcmp), "kcmp" }, [313] = { 3, TD, SEN(finit_module), "finit_module" }, [314] = { 3, 0, SEN(sched_setattr), "sched_setattr" }, @@ -320,23 +327,27 @@ [319] = { 2, TD, SEN(memfd_create), "memfd_create" }, [320] = { 5, TD, SEN(kexec_file_load), "kexec_file_load" }, [321] = { 3, TD, SEN(bpf), "bpf" }, -[322] = { 5, TD|TF|TP|SE|SI, SEN(printargs), "64:execveat" }, +[322] = { 5, TD|TF|TP|SE|SI, SEN(printargs), "execveat#64" }, [323] = { 1, TD, SEN(userfaultfd), "userfaultfd" }, [324] = { 2, 0, SEN(membarrier), "membarrier" }, [325] = { 3, TM, SEN(mlock2), "mlock2" }, [326] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, -[327] = { 6, TD, SEN(printargs), "64:preadv2" }, -[328] = { 6, TD, SEN(printargs), "64:pwritev2" }, +[327] = { 6, TD, SEN(printargs), "preadv2#64" }, +[328] = { 6, TD, SEN(printargs), "pwritev2#64" }, [329] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, [330] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, [331] = { 1, 0, SEN(pkey_free), "pkey_free" }, -[332 ... 511] = { }, +[332] = { 5, TD|TF|TSTA, SEN(statx), "statx" }, +[333] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents" }, +[334] = { 4, 0, SEN(rseq), "rseq" }, +/* [335 ... 423] - reserved to sync up with other architectures */ +[424] = { 4, TD|TS, SEN(pidfd_send_signal), "pidfd_send_signal" }, /* * x32-specific system call numbers start at 512 to avoid cache impact * for native 64-bit operation. */ [512] = { 4, CST|TS, SEN(rt_sigaction), "rt_sigaction" }, -[513] = { 0, CST|TS, SEN(sigreturn), "rt_sigreturn" }, +[513] = { 0, CST|TS, SEN(rt_sigreturn), "rt_sigreturn" }, [514] = { 3, CST|TD, SEN(ioctl), "ioctl" }, [515] = { 3, CST|TD, SEN(readv), "readv" }, [516] = { 3, CST|TD, SEN(writev), "writev" }, @@ -346,11 +357,11 @@ [520] = { 3, CST|TF|TP|SE|SI,SEN(execve), "execve" }, [521] = { 4, CST, SEN(ptrace), "ptrace" }, [522] = { 2, CST|TS, SEN(rt_sigpending), "rt_sigpending" }, -[523] = { 4, CST|TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[523] = { 4, CST|TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait" }, [524] = { 3, CST|TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, [525] = { 2, CST|TS, SEN(sigaltstack), "sigaltstack" }, [526] = { 3, CST, SEN(timer_create), "timer_create" }, -[527] = { 2, CST, SEN(mq_notify), "mq_notify" }, +[527] = { 2, CST|TD, SEN(mq_notify), "mq_notify" }, [528] = { 4, CST, SEN(kexec_load), "kexec_load" }, [529] = { 5, CST|TP, SEN(waitid), "waitid" }, [530] = { 2, CST, SEN(set_robust_list), "set_robust_list" }, @@ -360,7 +371,7 @@ [534] = { 4, TD, SEN(preadv), "preadv" }, [535] = { 4, TD, SEN(pwritev), "pwritev" }, [536] = { 4, CST|TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, -[537] = { 5, CST|TN, SEN(recvmmsg), "recvmmsg" }, +[537] = { 5, CST|TN, SEN(recvmmsg_time64), "recvmmsg" }, [538] = { 4, CST|TN, SEN(sendmmsg), "sendmmsg" }, [539] = { 6, CST, SEN(process_vm_readv), "process_vm_readv" }, [540] = { 6, CST, SEN(process_vm_writev), "process_vm_writev" }, @@ -369,5 +380,8 @@ [543] = { 2, CST|TM, SEN(io_setup), "io_setup" }, [544] = { 3, CST, SEN(io_submit), "io_submit" }, [545] = { 5, CST|TD|TF|TP|SE|SI, SEN(execveat), "execveat" }, -[546] = { 6, TD, SEN(preadv2), "preadv2" }, -[547] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[546] = { 5, TD, SEN(preadv2), "preadv2" }, +[547] = { 5, TD, SEN(pwritev2), "pwritev2" }, +[425] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" }, +[426] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" }, +[427] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" }, diff --git a/linux/x86_64/arch_defs_.h b/linux/x86_64/arch_defs_.h new file mode 100644 index 00000000..a8c1d991 --- /dev/null +++ b/linux/x86_64/arch_defs_.h @@ -0,0 +1,11 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#define HAVE_ARCH_OLD_MMAP 1 +#define HAVE_ARCH_OLD_SELECT 1 +#define HAVE_ARCH_UID16_SYSCALLS 1 +#define SUPPORTED_PERSONALITIES 3 diff --git a/linux/x86_64/arch_get_personality.c b/linux/x86_64/arch_get_personality.c new file mode 100644 index 00000000..1dcc6932 --- /dev/null +++ b/linux/x86_64/arch_get_personality.c @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2010-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef AUDIT_ARCH_I386 +# define AUDIT_ARCH_I386 0x40000003 +#endif + +int +get_personality_from_syscall_info(const struct ptrace_syscall_info *sci) +{ + unsigned int pers = sci->arch == AUDIT_ARCH_I386; + +#ifndef X32 + switch(sci->op) { + case PTRACE_SYSCALL_INFO_ENTRY: + case PTRACE_SYSCALL_INFO_SECCOMP: + break; + default: + return -1; + } + + kernel_ulong_t scno = sci->entry.nr; + +# ifndef __X32_SYSCALL_BIT +# define __X32_SYSCALL_BIT 0x40000000 +# endif + + if (pers == 0 && (scno & __X32_SYSCALL_BIT)) { + /* + * Syscall number -1 requires special treatment: + * it might be a side effect of SECCOMP_RET_ERRNO + * filtering that sets orig_rax to -1 + * in some versions of linux kernel. + * If that is the case, then + * __X32_SYSCALL_BIT logic does not apply. + */ + if (scno != (kernel_ulong_t) -1) + pers = 2; + } +#endif /* !X32 */ + + return pers; +} diff --git a/linux/x86_64/arch_kvm.c b/linux/x86_64/arch_kvm.c new file mode 100644 index 00000000..cb168f34 --- /dev/null +++ b/linux/x86_64/arch_kvm.c @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifdef HAVE_STRUCT_KVM_REGS +static void +arch_print_kvm_regs(struct tcb *const tcp, + const kernel_ulong_t addr, + const struct kvm_regs *const regs) +{ + PRINT_FIELD_X("{", *regs, rax); + if (abbrev(tcp)) + tprints(", ..."); + else { + PRINT_FIELD_X(", ", *regs, rbx); + PRINT_FIELD_X(", ", *regs, rcx); + PRINT_FIELD_X(", ", *regs, rdx); + PRINT_FIELD_X(", ", *regs, rsi); + PRINT_FIELD_X(", ", *regs, rdi); + } + PRINT_FIELD_X(", ", *regs, rsp); + PRINT_FIELD_X(", ", *regs, rbp); + if (abbrev(tcp)) + tprints(", ..."); + else { + PRINT_FIELD_X(", ", *regs, r8); + PRINT_FIELD_X(", ", *regs, r9); + PRINT_FIELD_X(", ", *regs, r10); + PRINT_FIELD_X(", ", *regs, r11); + PRINT_FIELD_X(", ", *regs, r12); + PRINT_FIELD_X(", ", *regs, r13); + PRINT_FIELD_X(", ", *regs, r14); + PRINT_FIELD_X(", ", *regs, r15); + } + PRINT_FIELD_X(", ", *regs, rip); + + /* TODO: we can decode this more */ + PRINT_FIELD_X(", ", *regs, rflags); + + tprints("}"); +} +#endif /* HAVE_STRUCT_KVM_REGS */ + +#ifdef HAVE_STRUCT_KVM_SREGS +static void +kvm_ioctl_decode_regs_segment(const char *prefix, + const struct kvm_segment *const segment) +{ + tprints(prefix); + PRINT_FIELD_X("={", *segment, base); + PRINT_FIELD_U(", ", *segment, limit); + PRINT_FIELD_U(", ", *segment, selector); + PRINT_FIELD_U(", ", *segment, type); + PRINT_FIELD_U(", ", *segment, present); + PRINT_FIELD_U(", ", *segment, dpl); + PRINT_FIELD_U(", ", *segment, db); + PRINT_FIELD_U(", ", *segment, s); + PRINT_FIELD_U(", ", *segment, l); + PRINT_FIELD_U(", ", *segment, g); + PRINT_FIELD_U(", ", *segment, avl); + tprints("}"); +} + +static void +kvm_ioctl_decode_regs_dtable(const char *prefix, + const struct kvm_dtable *const dtable) +{ + tprints(prefix); + PRINT_FIELD_X("={", *dtable, base); + PRINT_FIELD_U(", ", *dtable, limit); + tprints("}"); +} + +# define PRINT_FIELD_KVM_SREGS_STRUCT(prefix_, where_, type_, field_) \ + kvm_ioctl_decode_regs_ ## type_(prefix_ #field_, &(where_)->field_) + +static void +arch_print_kvm_sregs(struct tcb *const tcp, + const kernel_ulong_t addr, + const struct kvm_sregs *const sregs) +{ + PRINT_FIELD_KVM_SREGS_STRUCT("{", sregs, segment, cs); + if (abbrev(tcp)) { + tprints(", ...}"); + return; + } + + PRINT_FIELD_KVM_SREGS_STRUCT(", ", sregs, segment, ds); + PRINT_FIELD_KVM_SREGS_STRUCT(", ", sregs, segment, es); + PRINT_FIELD_KVM_SREGS_STRUCT(", ", sregs, segment, fs); + PRINT_FIELD_KVM_SREGS_STRUCT(", ", sregs, segment, gs); + PRINT_FIELD_KVM_SREGS_STRUCT(", ", sregs, segment, ss); + PRINT_FIELD_KVM_SREGS_STRUCT(", ", sregs, segment, tr); + PRINT_FIELD_KVM_SREGS_STRUCT(", ", sregs, segment, ldt); + PRINT_FIELD_KVM_SREGS_STRUCT(", ", sregs, dtable, gdt); + PRINT_FIELD_KVM_SREGS_STRUCT(", ", sregs, dtable, idt); + PRINT_FIELD_U(", ", *sregs, cr0); + PRINT_FIELD_U(", ", *sregs, cr2); + PRINT_FIELD_U(", ", *sregs, cr3); + PRINT_FIELD_U(", ", *sregs, cr4); + PRINT_FIELD_U(", ", *sregs, cr8); + PRINT_FIELD_U(", ", *sregs, efer); + PRINT_FIELD_X(", ", *sregs, apic_base); + tprints(", interrupt_bitmap=["); + + unsigned int i; + for (i = 0; i < ARRAY_SIZE(sregs->interrupt_bitmap); i++) { + if (i != 0) + tprints(", "); + tprintf("%#" PRI__x64, sregs->interrupt_bitmap[i]); + } + tprints("]}"); +} +#endif /* HAVE_STRUCT_KVM_SREGS */ diff --git a/linux/x86_64/arch_regs.c b/linux/x86_64/arch_regs.c index daee69f9..8878569e 100644 --- a/linux/x86_64/arch_regs.c +++ b/linux/x86_64/arch_regs.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* * On i386, pt_regs and user_regs_struct are the same, * but on 64 bit x86, user_regs_struct has six more fields: @@ -30,12 +37,16 @@ static union { #define x86_64_regs x86_regs_union.x86_64_r #define i386_regs x86_regs_union.i386_r -uint32_t *const i386_esp_ptr = &i386_regs.esp; -uint64_t *const x86_64_rsp_ptr = (uint64_t *) &x86_64_regs.rsp; static struct iovec x86_io = { .iov_base = &x86_regs_union }; #define ARCH_REGS_FOR_GETREGSET x86_regs_union #define ARCH_IOVEC_FOR_GETREGSET x86_io -#define ARCH_PC_REG (x86_io.iov_len == sizeof(i386_regs) ? i386_regs.eip : x86_64_regs.rip) +#define ARCH_PC_REG \ + (x86_io.iov_len == sizeof(i386_regs) ? i386_regs.eip : x86_64_regs.rip) +#define ARCH_SP_REG \ + (x86_io.iov_len == sizeof(i386_regs) ? i386_regs.esp : x86_64_regs.rsp) + +#undef ARCH_MIGHT_USE_SET_REGS +#define ARCH_MIGHT_USE_SET_REGS 0 diff --git a/linux/x86_64/arch_regs.h b/linux/x86_64/arch_regs.h index c2ccee67..08824f22 100644 --- a/linux/x86_64/arch_regs.h +++ b/linux/x86_64/arch_regs.h @@ -1,2 +1,35 @@ -extern uint32_t *const i386_esp_ptr; -extern uint64_t *const x86_64_rsp_ptr; +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +/* does not provide these definitions. */ +#define R15 0 +#define R14 1 +#define R13 2 +#define R12 3 +#define RBP 4 +#define RBX 5 +#define R11 6 +#define R10 7 +#define R9 8 +#define R8 9 +#define RAX 10 +#define RCX 11 +#define RDX 12 +#define RSI 13 +#define RDI 14 +#define ORIG_RAX 15 +#define RIP 16 +#define CS 17 +#define EFLAGS 18 +#define RSP 19 +#define SS 20 +#define FS_BASE 21 +#define GS_BASE 22 +#define DS 23 +#define ES 24 +#define FS 25 +#define GS 26 diff --git a/linux/x86_64/arch_rt_sigframe.c b/linux/x86_64/arch_rt_sigframe.c new file mode 100644 index 00000000..bb60b44d --- /dev/null +++ b/linux/x86_64/arch_rt_sigframe.c @@ -0,0 +1 @@ +#include "i386/arch_rt_sigframe.c" diff --git a/linux/x86_64/arch_sigreturn.c b/linux/x86_64/arch_sigreturn.c index 060b93a7..9f4f0d87 100644 --- a/linux/x86_64/arch_sigreturn.c +++ b/linux/x86_64/arch_sigreturn.c @@ -1,32 +1,2 @@ -#define arch_sigreturn i386_arch_sigreturn +/* Only x86 personality has old sigreturn syscall. */ #include "i386/arch_sigreturn.c" -#undef arch_sigreturn - -static void -arch_sigreturn(struct tcb *tcp) -{ - if (current_personality == 1) { - i386_arch_sigreturn(tcp); - return; - } - - typedef struct { - uint32_t flags, link, stack[3], pad; - struct sigcontext mcontext; - } ucontext_x32_header; - -#define X86_64_SIGMASK_OFFSET offsetof(struct ucontext, uc_sigmask) -#define X32_SIGMASK_OFFSET sizeof(ucontext_x32_header) - - const kernel_ulong_t offset = -#ifdef X32 - X32_SIGMASK_OFFSET; -#else - current_personality == 2 ? X32_SIGMASK_OFFSET : - X86_64_SIGMASK_OFFSET; -#endif - const kernel_ulong_t addr = (kernel_ulong_t) *x86_64_rsp_ptr + offset; - tprints("{mask="); - print_sigset_addr_len(tcp, addr, NSIG_BYTES); - tprints("}"); -} diff --git a/linux/x86_64/asm_stat.h b/linux/x86_64/asm_stat.h index a563f087..91dd1aaf 100644 --- a/linux/x86_64/asm_stat.h +++ b/linux/x86_64/asm_stat.h @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #ifndef STRACE_X86_64_ASM_STAT_H -#define STRACE_X86_64_ASM_STAT_H +# define STRACE_X86_64_ASM_STAT_H # if defined __x86_64__ && defined __ILP32__ # define stat redirect_kernel_stat diff --git a/linux/x86_64/errnoent1.h b/linux/x86_64/errnoent1.h deleted file mode 100644 index d32435af..00000000 --- a/linux/x86_64/errnoent1.h +++ /dev/null @@ -1,2 +0,0 @@ -/* i386 personality */ -#include "errnoent.h" diff --git a/linux/x86_64/errnoent2.h b/linux/x86_64/errnoent2.h deleted file mode 100644 index 2192ec8d..00000000 --- a/linux/x86_64/errnoent2.h +++ /dev/null @@ -1,2 +0,0 @@ -/* x32 personality */ -#include "errnoent.h" diff --git a/linux/x86_64/gentab.pl b/linux/x86_64/gentab.pl deleted file mode 100644 index 52f7aa95..00000000 --- a/linux/x86_64/gentab.pl +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/perl -w -#generate syscall table from a template file (usually the master i386 syscall -#ent.h) and the x86_64 unistd.h -%conv = ( - "exit" => "_exit", -); - -%known = ( - "mmap" => "sys_mmap", - "sched_yield" => "printargs", -); - -# only used when the template file has no entry -%args = ( - "arch_prctl" => 2, - "tkill" => 2, - "gettid" => 0, - "readahead" => 3, - # should decode all these: - "setxattr" => 5, - "lsetxattr" => 5, - "fsetxattr" => 5, - "getxattr" => 4, - "lgetxattr" => 4, - "fgetxattr" => 4, - "listxattr" => 3, - "llistxattr" => 3, - "flistxattr" => 3, - "removexattr" => 2, - "lremovexattr" => 2, - "fremovexattr" => 2, - "mmap" => 6, - "sched_yield" => 0, -); - -open(F,$ARGV[0]) || die "cannot open template file $ARGV[0]\n"; - -while () { - next unless /{/; - s/\/\*.*\*\///; - ($name) = /"([^"]+)"/; - chomp; - $call{$name} = $_; -} - -open(SL, ">syscallnum.h") || die "cannot create syscallnum.h\n"; - -open(S,$ARGV[1]) || die "cannot open syscall file $ARGV[1]\n"; -while () { - $name = ""; - next unless (($name, $num) = /define\s+__NR_(\S+)\s+(\d+)/); - next if $name eq ""; - - $name = $conv{$name} if defined($conv{$name}); - - if (!defined($call{$name})) { - unless (defined($args{$name})) { - print STDERR "unknown call $name $num\n"; - $na = 3; - } else { - $na = $args{$name}; - } - if (defined($known{$name})) { - $func = $known{$name}; - } else { - $func = "printargs"; - } - print "\t{ $na,\t0,\t$func,\t\"$name\" }, /* $num */\n"; - } else { - print "$call{$name} /* $num */\n"; - } - print SL "#define SYS_$name $num\n" -} diff --git a/linux/x86_64/get_error.c b/linux/x86_64/get_error.c index 9411625b..92b1a844 100644 --- a/linux/x86_64/get_error.c +++ b/linux/x86_64/get_error.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "negated_errno.h" + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { /* * In X32, return value is 64-bit (llseek uses one). @@ -18,6 +27,9 @@ get_error(struct tcb *tcp, const bool check_errno) tcp->u_rval = -1; tcp->u_error = -rax; } else { - tcp->u_rval = rax; + if (x86_io.iov_len == sizeof(i386_regs)) + tcp->u_rval = (uint32_t) rax; + else + tcp->u_rval = rax; } } diff --git a/linux/x86_64/get_scno.c b/linux/x86_64/get_scno.c index b8c31948..0a274888 100644 --- a/linux/x86_64/get_scno.c +++ b/linux/x86_64/get_scno.c @@ -5,37 +5,12 @@ * Copyright (c) 2008-2013 Denys Vlasenko * Copyright (c) 2012 H.J. Lu * Copyright (c) 2010-2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ -#ifdef X86_64 -# define X32_PERSONALITY_NUMBER 2 -#else -# define X32_PERSONALITY_NUMBER 0 -#endif - /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) @@ -47,7 +22,6 @@ arch_get_scno(struct tcb *tcp) # define __X32_SYSCALL_BIT 0x40000000 #endif -#if 1 /* * GETREGSET of NT_PRSTATUS tells us regset size, * which unambiguously detects i386. @@ -56,7 +30,7 @@ arch_get_scno(struct tcb *tcp) * solely by looking at __X32_SYSCALL_BIT: * arch/x86/include/asm/compat.h::is_x32_task(): * if (task_pt_regs(current)->orig_ax & __X32_SYSCALL_BIT) - * return true; + * return true; */ if (x86_io.iov_len == sizeof(i386_regs)) { scno = i386_regs.orig_eax; @@ -74,66 +48,15 @@ arch_get_scno(struct tcb *tcp) * __X32_SYSCALL_BIT logic does not apply. */ if ((long long) x86_64_regs.orig_rax != -1) { - scno -= __X32_SYSCALL_BIT; currpers = 2; } else { -# ifdef X32 +#ifdef X32 currpers = 2; -# endif +#endif } } } -#elif 0 - /* - * cs = 0x33 for long mode (native 64 bit and x32) - * cs = 0x23 for compatibility mode (32 bit) - * ds = 0x2b for x32 mode (x86-64 in 32 bit) - */ - scno = x86_64_regs.orig_rax; - switch (x86_64_regs.cs) { - case 0x23: currpers = 1; break; - case 0x33: - if (x86_64_regs.ds == 0x2b) { - currpers = 2; - scno &= ~__X32_SYSCALL_BIT; - } else - currpers = 0; - break; - default: - error_msg("Unknown value CS=0x%08X while " - "detecting personality of process PID=%d", - (int)x86_64_regs.cs, tcp->pid); - currpers = current_personality; - break; - } -#elif 0 - /* - * This version analyzes the opcode of a syscall instruction. - * (int 0x80 on i386 vs. syscall on x86-64) - * It works, but is too complicated, and strictly speaking, unreliable. - */ - unsigned long call, rip = x86_64_regs.rip; - /* sizeof(syscall) == sizeof(int 0x80) == 2 */ - rip -= 2; - errno = 0; - call = ptrace(PTRACE_PEEKTEXT, tcp->pid, (char *)rip, (char *)0); - if (errno) - perror_msg("ptrace_peektext failed"); - switch (call & 0xffff) { - /* x86-64: syscall = 0x0f 0x05 */ - case 0x050f: currpers = 0; break; - /* i386: int 0x80 = 0xcd 0x80 */ - case 0x80cd: currpers = 1; break; - default: - currpers = current_personality; - error_msg("Unknown syscall opcode (0x%04X) while " - "detecting personality of process PID=%d", - (int)call, tcp->pid); - break; - } -#endif - #ifdef X32 /* * If we are built for a x32 system, then personality 0 is x32 diff --git a/linux/x86_64/get_syscall_args.c b/linux/x86_64/get_syscall_args.c index f285ac32..60c6344b 100644 --- a/linux/x86_64/get_syscall_args.c +++ b/linux/x86_64/get_syscall_args.c @@ -1,10 +1,17 @@ +/* + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { if (x86_io.iov_len != sizeof(i386_regs)) { /* x86-64 or x32 ABI */ - if (tcp->s_ent->sys_flags & COMPAT_SYSCALL_TYPES) { + if (tcp_sysent(tcp)->sys_flags & COMPAT_SYSCALL_TYPES) { /* * X32 compat syscall: zero-extend from 32 bits. * Use truncate_klong_to_current_wordsize(tcp->u_arg[N]) diff --git a/linux/x86_64/getregs_old.c b/linux/x86_64/getregs_old.c index 9f7c2489..26239056 100644 --- a/linux/x86_64/getregs_old.c +++ b/linux/x86_64/getregs_old.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2013 Denys Vlasenko * Copyright (c) 2013-2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ /* @@ -31,10 +12,10 @@ * a PTRACE_GETREGS based fallback is provided for old kernels. */ static int -getregs_old(pid_t pid) +getregs_old(struct tcb *tcp) { /* Use old method, with unreliable heuristical detection of 32-bitness. */ - long r = ptrace(PTRACE_GETREGS, pid, NULL, &x86_64_regs); + long r = ptrace(PTRACE_GETREGS, tcp->pid, NULL, &x86_64_regs); if (r) return r; diff --git a/linux/x86_64/getregs_old.h b/linux/x86_64/getregs_old.h index 80303016..de495823 100644 --- a/linux/x86_64/getregs_old.h +++ b/linux/x86_64/getregs_old.h @@ -1,2 +1,9 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #define HAVE_GETREGS_OLD -static int getregs_old(pid_t); +static int getregs_old(struct tcb *); diff --git a/linux/x86_64/ioctls_arch0.h b/linux/x86_64/ioctls_arch0.h index d13cb463..06e93fa9 100644 --- a/linux/x86_64/ioctls_arch0.h +++ b/linux/x86_64/ioctls_arch0.h @@ -14,13 +14,13 @@ { "asm/mtrr.h", "MTRRIOC_KILL_PAGE_ENTRY", _IOC_WRITE, 0x4d09, 0x10 }, { "asm/mtrr.h", "MTRRIOC_SET_ENTRY", _IOC_WRITE, 0x4d01, 0x10 }, { "asm/mtrr.h", "MTRRIOC_SET_PAGE_ENTRY", _IOC_WRITE, 0x4d06, 0x10 }, -{ "linux/kvm.h", "KVM_ARM_SET_DEVICE_ADDR", _IOC_WRITE, 0xaeab, 0x10 }, { "linux/kvm.h", "KVM_ASSIGN_DEV_IRQ", _IOC_WRITE, 0xae70, 0x40 }, { "linux/kvm.h", "KVM_ASSIGN_PCI_DEVICE", _IOC_READ, 0xae69, 0x40 }, { "linux/kvm.h", "KVM_ASSIGN_SET_INTX_MASK", _IOC_WRITE, 0xaea4, 0x40 }, { "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_ENTRY", _IOC_WRITE, 0xae74, 0x10 }, { "linux/kvm.h", "KVM_ASSIGN_SET_MSIX_NR", _IOC_WRITE, 0xae73, 0x08 }, { "linux/kvm.h", "KVM_CHECK_EXTENSION", _IOC_NONE, 0xae03, 0x00 }, +{ "linux/kvm.h", "KVM_CLEAR_DIRTY_LOG", _IOC_READ|_IOC_WRITE, 0xaec0, 0x18 }, { "linux/kvm.h", "KVM_CREATE_DEVICE", _IOC_READ|_IOC_WRITE, 0xaee0, 0x0c }, { "linux/kvm.h", "KVM_CREATE_IRQCHIP", _IOC_NONE, 0xae60, 0x00 }, { "linux/kvm.h", "KVM_CREATE_PIT", _IOC_NONE, 0xae64, 0x00 }, @@ -43,7 +43,9 @@ { "linux/kvm.h", "KVM_GET_LAPIC", _IOC_READ, 0xae8e, 0x400 }, { "linux/kvm.h", "KVM_GET_MP_STATE", _IOC_READ, 0xae98, 0x04 }, { "linux/kvm.h", "KVM_GET_MSRS", _IOC_READ|_IOC_WRITE, 0xae88, 0x08 }, +{ "linux/kvm.h", "KVM_GET_MSR_FEATURE_INDEX_LIST", _IOC_READ|_IOC_WRITE, 0xae0a, 0x04 }, { "linux/kvm.h", "KVM_GET_MSR_INDEX_LIST", _IOC_READ|_IOC_WRITE, 0xae02, 0x04 }, +{ "linux/kvm.h", "KVM_GET_NESTED_STATE", _IOC_READ|_IOC_WRITE, 0xaebe, 0x80 }, { "linux/kvm.h", "KVM_GET_NR_MMU_PAGES", _IOC_NONE, 0xae45, 0x00 }, { "linux/kvm.h", "KVM_GET_ONE_REG", _IOC_WRITE, 0xaeab, 0x10 }, { "linux/kvm.h", "KVM_GET_PIT", _IOC_READ|_IOC_WRITE, 0xae65, 0x48 }, @@ -52,39 +54,27 @@ { "linux/kvm.h", "KVM_GET_REG_LIST", _IOC_READ|_IOC_WRITE, 0xaeb0, 0x08 }, { "linux/kvm.h", "KVM_GET_SREGS", _IOC_READ, 0xae83, 0x138 }, { "linux/kvm.h", "KVM_GET_SUPPORTED_CPUID", _IOC_READ|_IOC_WRITE, 0xae05, 0x08 }, +{ "linux/kvm.h", "KVM_GET_SUPPORTED_HV_CPUID", _IOC_READ|_IOC_WRITE, 0xaec1, 0x08 }, { "linux/kvm.h", "KVM_GET_TSC_KHZ", _IOC_NONE, 0xaea3, 0x00 }, { "linux/kvm.h", "KVM_GET_VCPU_EVENTS", _IOC_READ, 0xae9f, 0x40 }, { "linux/kvm.h", "KVM_GET_VCPU_MMAP_SIZE", _IOC_NONE, 0xae04, 0x00 }, { "linux/kvm.h", "KVM_GET_XCRS", _IOC_READ, 0xaea6, 0x188 }, { "linux/kvm.h", "KVM_GET_XSAVE", _IOC_READ, 0xaea4, 0x1000 }, { "linux/kvm.h", "KVM_HAS_DEVICE_ATTR", _IOC_WRITE, 0xaee3, 0x18 }, +{ "linux/kvm.h", "KVM_HYPERV_EVENTFD", _IOC_WRITE, 0xaebd, 0x18 }, { "linux/kvm.h", "KVM_INTERRUPT", _IOC_WRITE, 0xae86, 0x04 }, { "linux/kvm.h", "KVM_IOEVENTFD", _IOC_WRITE, 0xae79, 0x40 }, { "linux/kvm.h", "KVM_IRQFD", _IOC_WRITE, 0xae76, 0x20 }, { "linux/kvm.h", "KVM_IRQ_LINE", _IOC_WRITE, 0xae61, 0x08 }, { "linux/kvm.h", "KVM_IRQ_LINE_STATUS", _IOC_READ|_IOC_WRITE, 0xae67, 0x08 }, { "linux/kvm.h", "KVM_KVMCLOCK_CTRL", _IOC_NONE, 0xaead, 0x00 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_OP", _IOC_READ|_IOC_WRITE, 0xaeba, 0x08 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_REG_REGION", _IOC_READ, 0xaebb, 0x10 }, +{ "linux/kvm.h", "KVM_MEMORY_ENCRYPT_UNREG_REGION", _IOC_READ, 0xaebc, 0x10 }, { "linux/kvm.h", "KVM_NMI", _IOC_NONE, 0xae9a, 0x00 }, -{ "linux/kvm.h", "KVM_PPC_ALLOCATE_HTAB", _IOC_READ|_IOC_WRITE, 0xaea7, 0x04 }, -{ "linux/kvm.h", "KVM_PPC_GET_PVINFO", _IOC_WRITE, 0xaea1, 0x80 }, -{ "linux/kvm.h", "KVM_PPC_GET_SMMU_INFO", _IOC_READ, 0xaea6, 0x250 }, { "linux/kvm.h", "KVM_REGISTER_COALESCED_MMIO", _IOC_WRITE, 0xae67, 0x10 }, { "linux/kvm.h", "KVM_REINJECT_CONTROL", _IOC_NONE, 0xae71, 0x00 }, { "linux/kvm.h", "KVM_RUN", _IOC_NONE, 0xae80, 0x00 }, -{ "linux/kvm.h", "KVM_S390_ENABLE_SIE", _IOC_NONE, 0xae06, 0x00 }, -{ "linux/kvm.h", "KVM_S390_GET_IRQ_STATE", _IOC_WRITE, 0xaeb6, 0x20 }, -{ "linux/kvm.h", "KVM_S390_GET_SKEYS", _IOC_WRITE, 0xaeb2, 0x40 }, -{ "linux/kvm.h", "KVM_S390_INITIAL_RESET", _IOC_NONE, 0xae97, 0x00 }, -{ "linux/kvm.h", "KVM_S390_INTERRUPT", _IOC_WRITE, 0xae94, 0x10 }, -{ "linux/kvm.h", "KVM_S390_IRQ", _IOC_WRITE, 0xaeb4, 0x48 }, -{ "linux/kvm.h", "KVM_S390_MEM_OP", _IOC_WRITE, 0xaeb1, 0x40 }, -{ "linux/kvm.h", "KVM_S390_SET_INITIAL_PSW", _IOC_WRITE, 0xae96, 0x10 }, -{ "linux/kvm.h", "KVM_S390_SET_IRQ_STATE", _IOC_WRITE, 0xaeb5, 0x20 }, -{ "linux/kvm.h", "KVM_S390_SET_SKEYS", _IOC_WRITE, 0xaeb3, 0x40 }, -{ "linux/kvm.h", "KVM_S390_STORE_STATUS", _IOC_WRITE, 0xae95, 0x08 }, -{ "linux/kvm.h", "KVM_S390_UCAS_MAP", _IOC_WRITE, 0xae50, 0x18 }, -{ "linux/kvm.h", "KVM_S390_UCAS_UNMAP", _IOC_WRITE, 0xae51, 0x18 }, -{ "linux/kvm.h", "KVM_S390_VCPU_FAULT", _IOC_WRITE, 0xae52, 0x08 }, { "linux/kvm.h", "KVM_SET_BOOT_CPU_ID", _IOC_NONE, 0xae78, 0x00 }, { "linux/kvm.h", "KVM_SET_CLOCK", _IOC_WRITE, 0xae7b, 0x30 }, { "linux/kvm.h", "KVM_SET_CPUID", _IOC_WRITE, 0xae8a, 0x08 }, @@ -101,6 +91,7 @@ { "linux/kvm.h", "KVM_SET_MEMORY_REGION", _IOC_WRITE, 0xae40, 0x18 }, { "linux/kvm.h", "KVM_SET_MP_STATE", _IOC_WRITE, 0xae99, 0x04 }, { "linux/kvm.h", "KVM_SET_MSRS", _IOC_WRITE, 0xae89, 0x08 }, +{ "linux/kvm.h", "KVM_SET_NESTED_STATE", _IOC_WRITE, 0xaebf, 0x80 }, { "linux/kvm.h", "KVM_SET_NR_MMU_PAGES", _IOC_NONE, 0xae44, 0x00 }, { "linux/kvm.h", "KVM_SET_ONE_REG", _IOC_WRITE, 0xaeac, 0x10 }, { "linux/kvm.h", "KVM_SET_PIT", _IOC_READ, 0xae66, 0x48 }, diff --git a/linux/x86_64/raw_syscall.h b/linux/x86_64/raw_syscall.h new file mode 100644 index 00000000..66c3eaf9 --- /dev/null +++ b/linux/x86_64/raw_syscall.h @@ -0,0 +1,28 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + *err = 0; + kernel_ulong_t ret; + __asm__ __volatile__("syscall" + : "=a"(ret) + : "a"(nr) + : "memory", "cc", "rcx", "r11"); + return ret; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/x86_64/rt_sigframe.h b/linux/x86_64/rt_sigframe.h new file mode 100644 index 00000000..79b9ea03 --- /dev/null +++ b/linux/x86_64/rt_sigframe.h @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifdef __i386__ +# include "i386/rt_sigframe.h" +#else +# ifndef STRACE_RT_SIGFRAME_H +# define STRACE_RT_SIGFRAME_H + +# include + +typedef struct { + kernel_ulong_t pretcode; + ucontext_t uc; + /* more data follows */ +} struct_rt_sigframe; + +# endif /* !STRACE_RT_SIGFRAME_H */ +#endif /* !__i386__ */ diff --git a/linux/x86_64/set_error.c b/linux/x86_64/set_error.c index 123c8951..2c781b1d 100644 --- a/linux/x86_64/set_error.c +++ b/linux/x86_64/set_error.c @@ -1,37 +1,32 @@ -#ifndef HAVE_GETREGS_OLD -# define arch_set_error i386_set_error -# define arch_set_success i386_set_success -# include "i386/set_error.c" -# undef arch_set_success -# undef arch_set_error -#endif /* !HAVE_GETREGS_OLD */ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ static int arch_set_error(struct tcb *tcp) { -#ifdef HAVE_GETREGS_OLD - x86_64_regs.rax = - (long long) tcp->u_error; - return upoke(tcp->pid, 8 * RAX, x86_64_regs.rax); -#else - if (x86_io.iov_len == sizeof(i386_regs)) - return i386_set_error(tcp); + kernel_ulong_t rval = -(long) tcp->u_error; - x86_64_regs.rax = - (long long) tcp->u_error; - return set_regs(tcp->pid); -#endif + if (tcp->currpers == 1) + i386_regs.eax = rval; + else + x86_64_regs.rax = rval; + + return upoke(tcp, 8 * RAX, rval); } static int arch_set_success(struct tcb *tcp) { -#ifdef HAVE_GETREGS_OLD - x86_64_regs.rax = (long long) tcp->u_rval; - return upoke(tcp->pid, 8 * RAX, x86_64_regs.rax); -#else - if (x86_io.iov_len == sizeof(i386_regs)) - return i386_set_success(tcp); + kernel_ulong_t rval = (kernel_ulong_t) tcp->u_rval; + + if (tcp->currpers == 1) + i386_regs.eax = rval; + else + x86_64_regs.rax = rval; - x86_64_regs.rax = (long long) tcp->u_rval; - return set_regs(tcp->pid); -#endif + return upoke(tcp, 8 * RAX, rval); } diff --git a/linux/x86_64/set_scno.c b/linux/x86_64/set_scno.c index 6438c526..51242c48 100644 --- a/linux/x86_64/set_scno.c +++ b/linux/x86_64/set_scno.c @@ -1,19 +1,12 @@ -#ifndef HAVE_GETREGS_OLD -# define arch_set_scno i386_set_scno -# include "i386/set_scno.c" -# undef arch_set_scno -#endif /* !HAVE_GETREGS_OLD */ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ static int arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { -#ifdef HAVE_GETREGS_OLD - return upoke(tcp->pid, 8 * ORIG_RAX, scno); -#else - if (x86_io.iov_len == sizeof(i386_regs)) - return i386_set_scno(tcp, scno); - - x86_64_regs.orig_rax = scno; - return set_regs(tcp->pid); -#endif + return upoke(tcp, 8 * ORIG_RAX, scno); } diff --git a/linux/x86_64/shuffle_scno.c b/linux/x86_64/shuffle_scno.c new file mode 100644 index 00000000..6b688345 --- /dev/null +++ b/linux/x86_64/shuffle_scno.c @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +kernel_ulong_t +shuffle_scno(kernel_ulong_t scno) +{ + if (current_personality == 2) + scno ^= __X32_SYSCALL_BIT; + + return scno; +} diff --git a/linux/x86_64/signalent1.h b/linux/x86_64/signalent1.h deleted file mode 100644 index fdae15fc..00000000 --- a/linux/x86_64/signalent1.h +++ /dev/null @@ -1,2 +0,0 @@ -/* i386 personality */ -#include "signalent.h" diff --git a/linux/x86_64/signalent2.h b/linux/x86_64/signalent2.h deleted file mode 100644 index 6b32d62f..00000000 --- a/linux/x86_64/signalent2.h +++ /dev/null @@ -1,2 +0,0 @@ -/* x32 personality */ -#include "signalent.h" diff --git a/linux/x86_64/syscallent.h b/linux/x86_64/syscallent.h index fcabde74..03bda0d6 100644 --- a/linux/x86_64/syscallent.h +++ b/linux/x86_64/syscallent.h @@ -1,11 +1,18 @@ +/* + * Copyright (c) 2002-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + [ 0] = { 3, TD, SEN(read), "read" }, [ 1] = { 3, TD, SEN(write), "write" }, [ 2] = { 3, TD|TF, SEN(open), "open" }, [ 3] = { 1, TD, SEN(close), "close" }, -[ 4] = { 2, TF, SEN(stat), "stat" }, -[ 5] = { 2, TD, SEN(fstat), "fstat" }, -[ 6] = { 2, TF, SEN(lstat), "lstat" }, -[ 7] = { 3, TD, SEN(poll), "poll" }, +[ 4] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, +[ 5] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, +[ 6] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, +[ 7] = { 3, TD, SEN(poll_time64), "poll" }, [ 8] = { 3, TD, SEN(lseek), "lseek" }, [ 9] = { 6, TD|TM|SI, SEN(mmap), "mmap" }, [ 10] = { 3, TM|SI, SEN(mprotect), "mprotect" }, @@ -13,7 +20,7 @@ [ 12] = { 1, TM|SI, SEN(brk), "brk" }, [ 13] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, [ 14] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, -[ 15] = { 0, TS, SEN(sigreturn), "rt_sigreturn" }, +[ 15] = { 0, TS, SEN(rt_sigreturn), "rt_sigreturn" }, [ 16] = { 3, TD, SEN(ioctl), "ioctl" }, [ 17] = { 4, TD, SEN(pread), "pread64" }, [ 18] = { 4, TD, SEN(pwrite), "pwrite64" }, @@ -33,11 +40,11 @@ [ 32] = { 1, TD, SEN(dup), "dup" }, [ 33] = { 2, TD, SEN(dup2), "dup2" }, [ 34] = { 0, TS, SEN(pause), "pause" }, -[ 35] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[ 35] = { 2, 0, SEN(nanosleep_time64), "nanosleep" }, [ 36] = { 2, 0, SEN(getitimer), "getitimer" }, [ 37] = { 1, 0, SEN(alarm), "alarm" }, [ 38] = { 3, 0, SEN(setitimer), "setitimer" }, -[ 39] = { 0, NF, SEN(getpid), "getpid" }, +[ 39] = { 0, PU|NF, SEN(getpid), "getpid" }, [ 40] = { 4, TD|TN, SEN(sendfile64), "sendfile" }, [ 41] = { 3, TN, SEN(socket), "socket" }, [ 42] = { 3, TN, SEN(connect), "connect" }, @@ -100,16 +107,16 @@ [ 99] = { 1, 0, SEN(sysinfo), "sysinfo" }, [100] = { 1, 0, SEN(times), "times" }, [101] = { 4, 0, SEN(ptrace), "ptrace" }, -[102] = { 0, NF, SEN(getuid), "getuid" }, +[102] = { 0, PU|NF, SEN(getuid), "getuid" }, [103] = { 3, 0, SEN(syslog), "syslog" }, -[104] = { 0, NF, SEN(getgid), "getgid" }, +[104] = { 0, PU|NF, SEN(getgid), "getgid" }, [105] = { 1, 0, SEN(setuid), "setuid" }, [106] = { 1, 0, SEN(setgid), "setgid" }, -[107] = { 0, NF, SEN(geteuid), "geteuid" }, -[108] = { 0, NF, SEN(getegid), "getegid" }, +[107] = { 0, PU|NF, SEN(geteuid), "geteuid" }, +[108] = { 0, PU|NF, SEN(getegid), "getegid" }, [109] = { 2, 0, SEN(setpgid), "setpgid" }, -[110] = { 0, NF, SEN(getppid), "getppid" }, -[111] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[110] = { 0, PU|NF, SEN(getppid), "getppid" }, +[111] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, [112] = { 0, 0, SEN(setsid), "setsid" }, [113] = { 2, 0, SEN(setreuid), "setreuid" }, [114] = { 2, 0, SEN(setregid), "setregid" }, @@ -126,7 +133,7 @@ [125] = { 2, 0, SEN(capget), "capget" }, [126] = { 2, 0, SEN(capset), "capset" }, [127] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[128] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[128] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait" }, [129] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, [130] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, [131] = { 2, TS, SEN(sigaltstack), "sigaltstack" }, @@ -134,9 +141,9 @@ [133] = { 3, TF, SEN(mknod), "mknod" }, [134] = { 1, TF, SEN(uselib), "uselib" }, [135] = { 1, NF, SEN(personality), "personality" }, -[136] = { 2, 0, SEN(ustat), "ustat" }, -[137] = { 2, TF, SEN(statfs), "statfs" }, -[138] = { 2, TD, SEN(fstatfs), "fstatfs" }, +[136] = { 2, TSFA, SEN(ustat), "ustat" }, +[137] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[138] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, [139] = { 3, 0, SEN(sysfs), "sysfs" }, [140] = { 2, 0, SEN(getpriority), "getpriority" }, [141] = { 3, 0, SEN(setpriority), "setpriority" }, @@ -146,7 +153,7 @@ [145] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, [146] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [147] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[148] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[148] = { 2, 0, SEN(sched_rr_get_interval_time64),"sched_rr_get_interval"}, [149] = { 2, TM, SEN(mlock), "mlock" }, [150] = { 2, TM, SEN(munlock), "munlock" }, [151] = { 1, TM, SEN(mlockall), "mlockall" }, @@ -157,7 +164,7 @@ [156] = { 1, 0, SEN(sysctl), "_sysctl" }, [157] = { 5, 0, SEN(prctl), "prctl" }, [158] = { 2, TP, SEN(arch_prctl), "arch_prctl" }, -[159] = { 1, 0, SEN(adjtimex), "adjtimex" }, +[159] = { 1, 0, SEN(adjtimex64), "adjtimex" }, [160] = { 2, 0, SEN(setrlimit), "setrlimit" }, [161] = { 1, TF, SEN(chroot), "chroot" }, [162] = { 0, 0, SEN(sync), "sync" }, @@ -184,7 +191,7 @@ [183] = { 5, 0, SEN(afs_syscall), "afs_syscall" }, [184] = { 3, 0, SEN(tuxcall), "tuxcall" }, [185] = { 3, 0, SEN(security), "security" }, -[186] = { 0, NF, SEN(gettid), "gettid" }, +[186] = { 0, PU|NF, SEN(gettid), "gettid" }, [187] = { 3, TD, SEN(readahead), "readahead" }, [188] = { 5, TF, SEN(setxattr), "setxattr" }, [189] = { 5, TF, SEN(setxattr), "lsetxattr" }, @@ -200,13 +207,13 @@ [199] = { 2, TD, SEN(fremovexattr), "fremovexattr" }, [200] = { 2, TS, SEN(kill), "tkill" }, [201] = { 1, 0, SEN(time), "time" }, -[202] = { 6, 0, SEN(futex), "futex" }, +[202] = { 6, 0, SEN(futex_time64), "futex" }, [203] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" }, [204] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" }, [205] = { 1, 0, SEN(set_thread_area), "set_thread_area" }, [206] = { 2, TM, SEN(io_setup), "io_setup" }, [207] = { 1, TM, SEN(io_destroy), "io_destroy" }, -[208] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[208] = { 5, 0, SEN(io_getevents_time64), "io_getevents" }, [209] = { 3, 0, SEN(io_submit), "io_submit" }, [210] = { 3, 0, SEN(io_cancel), "io_cancel" }, [211] = { 1, 0, SEN(get_thread_area), "get_thread_area" }, @@ -218,17 +225,17 @@ [217] = { 3, TD, SEN(getdents64), "getdents64" }, [218] = { 1, 0, SEN(set_tid_address), "set_tid_address" }, [219] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, -[220] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[220] = { 4, TI, SEN(semtimedop_time64), "semtimedop" }, [221] = { 4, TD, SEN(fadvise64), "fadvise64" }, [222] = { 3, 0, SEN(timer_create), "timer_create" }, -[223] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[224] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[223] = { 4, 0, SEN(timer_settime64), "timer_settime" }, +[224] = { 2, 0, SEN(timer_gettime64), "timer_gettime" }, [225] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, [226] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[227] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[228] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[229] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[230] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[227] = { 2, 0, SEN(clock_settime64), "clock_settime" }, +[228] = { 2, 0, SEN(clock_gettime64), "clock_gettime" }, +[229] = { 2, 0, SEN(clock_getres_time64), "clock_getres" }, +[230] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep" }, [231] = { 1, TP|SE, SEN(exit), "exit_group" }, [232] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, [233] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, @@ -238,12 +245,12 @@ [237] = { 6, TM, SEN(mbind), "mbind" }, [238] = { 3, TM, SEN(set_mempolicy), "set_mempolicy" }, [239] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" }, -[240] = { 4, 0, SEN(mq_open), "mq_open" }, +[240] = { 4, TD, SEN(mq_open), "mq_open" }, [241] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[242] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[243] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[244] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[245] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[242] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend" }, +[243] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive" }, +[244] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[245] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, [246] = { 4, 0, SEN(kexec_load), "kexec_load" }, [247] = { 5, TP, SEN(waitid), "waitid" }, [248] = { 5, 0, SEN(add_key), "add_key" }, @@ -252,7 +259,7 @@ [251] = { 3, 0, SEN(ioprio_set), "ioprio_set" }, [252] = { 2, 0, SEN(ioprio_get), "ioprio_get" }, [253] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[254] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[254] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, [255] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, [256] = { 4, TM, SEN(migrate_pages), "migrate_pages" }, [257] = { 4, TD|TF, SEN(openat), "openat" }, @@ -260,7 +267,7 @@ [259] = { 4, TD|TF, SEN(mknodat), "mknodat" }, [260] = { 5, TD|TF, SEN(fchownat), "fchownat" }, [261] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[262] = { 4, TD|TF, SEN(newfstatat), "newfstatat" }, +[262] = { 4, TD|TF|TFST|TSTA,SEN(newfstatat), "newfstatat" }, [263] = { 3, TD|TF, SEN(unlinkat), "unlinkat" }, [264] = { 4, TD|TF, SEN(renameat), "renameat" }, [265] = { 5, TD|TF, SEN(linkat), "linkat" }, @@ -268,8 +275,8 @@ [267] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, [268] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, [269] = { 3, TD|TF, SEN(faccessat), "faccessat" }, -[270] = { 6, TD, SEN(pselect6), "pselect6" }, -[271] = { 5, TD, SEN(ppoll), "ppoll" }, +[270] = { 6, TD, SEN(pselect6_time64), "pselect6" }, +[271] = { 5, TD, SEN(ppoll_time64), "ppoll" }, [272] = { 1, TP, SEN(unshare), "unshare" }, [273] = { 2, 0, SEN(set_robust_list), "set_robust_list" }, [274] = { 3, 0, SEN(get_robust_list), "get_robust_list" }, @@ -278,14 +285,14 @@ [277] = { 4, TD, SEN(sync_file_range), "sync_file_range" }, [278] = { 4, TD, SEN(vmsplice), "vmsplice" }, [279] = { 6, TM, SEN(move_pages), "move_pages" }, -[280] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[280] = { 4, TD|TF, SEN(utimensat_time64), "utimensat" }, [281] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, [282] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [283] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, [284] = { 1, TD, SEN(eventfd), "eventfd" }, [285] = { 4, TD, SEN(fallocate), "fallocate" }, -[286] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, -[287] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[286] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime" }, +[287] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime" }, [288] = { 4, TN, SEN(accept4), "accept4" }, [289] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, [290] = { 2, TD, SEN(eventfd2), "eventfd2" }, @@ -297,13 +304,13 @@ [296] = { 4, TD, SEN(pwritev), "pwritev" }, [297] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, [298] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, -[299] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[299] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg" }, [300] = { 2, TD, SEN(fanotify_init), "fanotify_init" }, [301] = { 5, TD|TF, SEN(fanotify_mark), "fanotify_mark" }, [302] = { 4, 0, SEN(prlimit64), "prlimit64" }, [303] = { 5, TD|TF, SEN(name_to_handle_at), "name_to_handle_at" }, [304] = { 3, TD, SEN(open_by_handle_at), "open_by_handle_at" }, -[305] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[305] = { 2, 0, SEN(clock_adjtime64), "clock_adjtime" }, [306] = { 1, TD, SEN(syncfs), "syncfs" }, [307] = { 4, TN, SEN(sendmmsg), "sendmmsg" }, [308] = { 2, TD, SEN(setns), "setns" }, @@ -330,3 +337,11 @@ [329] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, [330] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, [331] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[332] = { 5, TD|TF|TSTA, SEN(statx), "statx" }, +[333] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents" }, +[334] = { 4, 0, SEN(rseq), "rseq" }, +/* [335 ... 423] - reserved to sync up with other architectures */ +[424] = { 4, TD|TS, SEN(pidfd_send_signal), "pidfd_send_signal" }, +[425] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" }, +[426] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" }, +[427] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" }, diff --git a/linux/x86_64/userent.h b/linux/x86_64/userent.h index c5c084eb..a8eab7d5 100644 --- a/linux/x86_64/userent.h +++ b/linux/x86_64/userent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + XLAT(8*R15), XLAT(8*R14), XLAT(8*R13), diff --git a/linux/xtensa/arch_regs.c b/linux/xtensa/arch_regs.c index 67e5f010..557e5bac 100644 --- a/linux/xtensa/arch_regs.c +++ b/linux/xtensa/arch_regs.c @@ -1,2 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static unsigned long xtensa_a2; #define ARCH_PC_PEEK_ADDR REG_PC +#define ARCH_SP_PEEK_ADDR (REG_A_BASE + 1) diff --git a/linux/xtensa/get_error.c b/linux/xtensa/get_error.c index 51ccd3b8..7fc8ac2c 100644 --- a/linux/xtensa/get_error.c +++ b/linux/xtensa/get_error.c @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "negated_errno.h" + static void -get_error(struct tcb *tcp, const bool check_errno) +arch_get_error(struct tcb *tcp, const bool check_errno) { if (check_errno && is_negated_errno(xtensa_a2)) { tcp->u_rval = -1; diff --git a/linux/xtensa/get_scno.c b/linux/xtensa/get_scno.c index d230f73b..f8edf9f2 100644 --- a/linux/xtensa/get_scno.c +++ b/linux/xtensa/get_scno.c @@ -1,6 +1,13 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return codes: 1 - ok, 0 - ignore, other - error. */ static int arch_get_scno(struct tcb *tcp) { - return upeek(tcp->pid, SYSCALL_NR, &tcp->scno) < 0 ? -1 : 1; + return upeek(tcp, SYSCALL_NR, &tcp->scno) < 0 ? -1 : 1; } diff --git a/linux/xtensa/get_syscall_args.c b/linux/xtensa/get_syscall_args.c index a9c933a9..69b981c3 100644 --- a/linux/xtensa/get_syscall_args.c +++ b/linux/xtensa/get_syscall_args.c @@ -1,6 +1,13 @@ +/* + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + /* Return -1 on error or 1 on success (never 0!). */ static int -get_syscall_args(struct tcb *tcp) +arch_get_syscall_args(struct tcb *tcp) { /* arg0: a6, arg1: a3, arg2: a4, arg3: a5, arg4: a8, arg5: a9 */ static const int xtensaregs[MAX_ARGS] = { @@ -13,8 +20,8 @@ get_syscall_args(struct tcb *tcp) }; unsigned int i; - for (i = 0; i < tcp->s_ent->nargs; ++i) - if (upeek(tcp->pid, xtensaregs[i], &tcp->u_arg[i]) < 0) + for (i = 0; i < n_args(tcp); ++i) + if (upeek(tcp, xtensaregs[i], &tcp->u_arg[i]) < 0) return -1; return 1; } diff --git a/linux/xtensa/get_syscall_result.c b/linux/xtensa/get_syscall_result.c index 51ad6dea..bbb091c9 100644 --- a/linux/xtensa/get_syscall_result.c +++ b/linux/xtensa/get_syscall_result.c @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int get_syscall_result_regs(struct tcb *tcp) { - return upeek(tcp->pid, REG_A_BASE + 2, &xtensa_a2) < 0 ? -1 : 0; + return upeek(tcp, REG_A_BASE + 2, &xtensa_a2) < 0 ? -1 : 0; } diff --git a/linux/xtensa/raw_syscall.h b/linux/xtensa/raw_syscall.h new file mode 100644 index 00000000..883860ed --- /dev/null +++ b/linux/xtensa/raw_syscall.h @@ -0,0 +1,28 @@ +/* + * Raw syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_RAW_SYSCALL_H +# define STRACE_RAW_SYSCALL_H + +# include "kernel_types.h" + +static inline kernel_ulong_t +raw_syscall_0(const kernel_ulong_t nr, kernel_ulong_t *err) +{ + *err = 0; + register kernel_ulong_t a2 __asm__("a2") = nr; + __asm__ __volatile__("syscall" + : "=a"(a2) + : "r"(a2) + : "memory"); + return a2; +} +# define raw_syscall_0 raw_syscall_0 + +#endif /* !STRACE_RAW_SYSCALL_H */ diff --git a/linux/xtensa/set_error.c b/linux/xtensa/set_error.c index 4eb59171..cd6d627b 100644 --- a/linux/xtensa/set_error.c +++ b/linux/xtensa/set_error.c @@ -1,13 +1,20 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_error(struct tcb *tcp) { xtensa_a2 = -tcp->u_error; - return upoke(tcp->pid, REG_A_BASE + 2, xtensa_a2); + return upoke(tcp, REG_A_BASE + 2, xtensa_a2); } static int arch_set_success(struct tcb *tcp) { xtensa_a2 = tcp->u_rval; - return upoke(tcp->pid, REG_A_BASE + 2, xtensa_a2); + return upoke(tcp, REG_A_BASE + 2, xtensa_a2); } diff --git a/linux/xtensa/set_scno.c b/linux/xtensa/set_scno.c index 54c948d3..8d38c13b 100644 --- a/linux/xtensa/set_scno.c +++ b/linux/xtensa/set_scno.c @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + static int arch_set_scno(struct tcb *tcp, kernel_ulong_t scno) { - return upoke(tcp->pid, SYSCALL_NR, scno); + return upoke(tcp, SYSCALL_NR, scno); } diff --git a/linux/xtensa/syscallent.h b/linux/xtensa/syscallent.h index a130d6e0..8cb6a46c 100644 --- a/linux/xtensa/syscallent.h +++ b/linux/xtensa/syscallent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2013-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + [ 0] = { 0, 0, SEN(printargs), "spill" }, [ 1] = { 0, 0, SEN(printargs), "xtensa" }, [ 2 ... 7] = { }, @@ -9,7 +16,7 @@ [ 13] = { 3, TD, SEN(write), "write" }, [ 14] = { 5, TD, SEN(select), "select" }, [ 15] = { 3, TD, SEN(lseek), "lseek" }, -[ 16] = { 3, TD, SEN(poll), "poll" }, +[ 16] = { 3, TD, SEN(poll_time32), "poll" }, [ 17] = { 5, TD, SEN(llseek), "_llseek" }, [ 18] = { 4, TD, SEN(epoll_wait), "epoll_wait" }, [ 19] = { 4, TD, SEN(epoll_ctl), "epoll_ctl" }, @@ -39,16 +46,16 @@ [ 43] = { 2, TF, SEN(getcwd), "getcwd" }, [ 44] = { 2, TF, SEN(chmod), "chmod" }, [ 45] = { 3, TF, SEN(chown), "chown" }, -[ 46] = { 2, TF, SEN(stat), "stat" }, -[ 47] = { 2, TF, SEN(stat64), "stat64" }, +[ 46] = { 2, TF|TST|TSTA, SEN(stat), "stat" }, +[ 47] = { 2, TF|TST|TSTA, SEN(stat64), "stat64" }, [ 48] = { 3, TF, SEN(chown), "lchown" }, -[ 49] = { 2, TF, SEN(lstat), "lstat" }, -[ 50] = { 2, TF, SEN(lstat64), "lstat64" }, +[ 49] = { 2, TF|TLST|TSTA, SEN(lstat), "lstat" }, +[ 50] = { 2, TF|TLST|TSTA, SEN(lstat64), "lstat64" }, [ 51] = { }, [ 52] = { 2, TD, SEN(fchmod), "fchmod" }, [ 53] = { 3, TD, SEN(fchown), "fchown" }, -[ 54] = { 2, TD, SEN(fstat), "fstat" }, -[ 55] = { 2, TD, SEN(fstat64), "fstat64" }, +[ 54] = { 2, TD|TFST|TSTA, SEN(fstat), "fstat" }, +[ 55] = { 2, TD|TFST|TSTA, SEN(fstat64), "fstat64" }, [ 56] = { 2, TD, SEN(flock), "flock" }, [ 57] = { 2, TF, SEN(access), "access" }, [ 58] = { 1, NF, SEN(umask), "umask" }, @@ -113,14 +120,14 @@ [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, NF, SEN(getpid), "getpid" }, +[120] = { 0, PU|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, NF, SEN(gettid), "gettid" }, +[127] = { 0, PU|NF, SEN(gettid), "gettid" }, [128] = { 0, 0, SEN(setsid), "setsid" }, [129] = { 1, 0, SEN(getsid), "getsid" }, [130] = { 5, 0, SEN(prctl), "prctl" }, @@ -130,11 +137,11 @@ [134] = { 3, 0, SEN(setitimer), "setitimer" }, [135] = { 2, 0, SEN(getitimer), "getitimer" }, [136] = { 1, 0, SEN(setuid), "setuid" }, -[137] = { 0, NF, SEN(getuid), "getuid" }, +[137] = { 0, PU|NF, SEN(getuid), "getuid" }, [138] = { 1, 0, SEN(setgid), "setgid" }, -[139] = { 0, NF, SEN(getgid), "getgid" }, -[140] = { 0, NF, SEN(geteuid), "geteuid" }, -[141] = { 0, NF, SEN(getegid), "getegid" }, +[139] = { 0, PU|NF, SEN(getgid), "getgid" }, +[140] = { 0, PU|NF, SEN(geteuid), "geteuid" }, +[141] = { 0, PU|NF, SEN(getegid), "getegid" }, [142] = { 2, 0, SEN(setreuid), "setreuid" }, [143] = { 2, 0, SEN(setregid), "setregid" }, [144] = { 3, 0, SEN(setresuid), "setresuid" }, @@ -143,8 +150,8 @@ [147] = { 3, 0, SEN(getresgid), "getresgid" }, [148] = { 2, 0, SEN(setpgid), "setpgid" }, [149] = { 1, 0, SEN(getpgid), "getpgid" }, -[150] = { 0, NF, SEN(getppid), "getppid" }, -[151] = { 0, 0, SEN(getpgrp), "getpgrp" }, +[150] = { 0, PU|NF, SEN(getppid), "getppid" }, +[151] = { 0, PU|NF, SEN(getpgrp), "getpgrp" }, [152 ... 153] = { }, [154] = { 1, 0, SEN(times), "times" }, [155] = { 1, TF, SEN(acct), "acct" }, @@ -153,7 +160,7 @@ [158] = { 2, 0, SEN(capget), "capget" }, [159] = { 2, 0, SEN(capset), "capset" }, [160] = { 4, 0, SEN(ptrace), "ptrace" }, -[161] = { 4, TI, SEN(semtimedop), "semtimedop" }, +[161] = { 4, TI, SEN(semtimedop_time32), "semtimedop" }, [162] = { 3, TI, SEN(semget), "semget" }, [163] = { 3, TI, SEN(semop), "semop" }, [164] = { 4, TI, SEN(semctl), "semctl" }, @@ -175,19 +182,19 @@ [180] = { 1, NF, SEN(setfsuid), "setfsuid" }, [181] = { 1, NF, SEN(setfsgid), "setfsgid" }, [182] = { 3, 0, SEN(sysfs), "sysfs" }, -[183] = { 2, 0, SEN(ustat), "ustat" }, -[184] = { 2, TF, SEN(statfs), "statfs" }, -[185] = { 2, TD, SEN(fstatfs), "fstatfs" }, -[186] = { 3, TF, SEN(statfs64), "statfs64" }, -[187] = { 3, TD, SEN(fstatfs64), "fstatfs64" }, +[183] = { 2, TSFA, SEN(ustat), "ustat" }, +[184] = { 2, TF|TSF|TSFA, SEN(statfs), "statfs" }, +[185] = { 2, TD|TFSF|TSFA, SEN(fstatfs), "fstatfs" }, +[186] = { 3, TF|TSF|TSFA, SEN(statfs64), "statfs64" }, +[187] = { 3, TD|TFSF|TSFA, SEN(fstatfs64), "fstatfs64" }, [188] = { 2, 0, SEN(setrlimit), "setrlimit" }, [189] = { 2, 0, SEN(getrlimit), "getrlimit" }, [190] = { 2, 0, SEN(getrusage), "getrusage" }, -[191] = { 6, 0, SEN(futex), "futex" }, +[191] = { 6, 0, SEN(futex_time32), "futex" }, [192] = { 2, 0, SEN(gettimeofday), "gettimeofday" }, [193] = { 2, 0, SEN(settimeofday), "settimeofday" }, -[194] = { 1, 0, SEN(adjtimex), "adjtimex" }, -[195] = { 2, 0, SEN(nanosleep), "nanosleep" }, +[194] = { 1, 0, SEN(adjtimex32), "adjtimex" }, +[195] = { 2, 0, SEN(nanosleep_time32), "nanosleep" }, [196] = { 2, 0, SEN(getgroups), "getgroups" }, [197] = { 2, 0, SEN(setgroups), "setgroups" }, [198] = { 2, 0, SEN(sethostname), "sethostname" }, @@ -210,7 +217,7 @@ [215] = { 1, 0, SEN(sched_getscheduler), "sched_getscheduler" }, [216] = { 1, 0, SEN(sched_get_priority_max), "sched_get_priority_max"}, [217] = { 1, 0, SEN(sched_get_priority_min), "sched_get_priority_min"}, -[218] = { 2, 0, SEN(sched_rr_get_interval), "sched_rr_get_interval" }, +[218] = { 2, 0, SEN(sched_rr_get_interval_time32),"sched_rr_get_interval"}, [219] = { 0, 0, SEN(sched_yield), "sched_yield" }, [220 ... 222] = { }, [223] = { 0, 0, SEN(restart_syscall), "restart_syscall" }, @@ -219,29 +226,29 @@ [226] = { 4, TS, SEN(rt_sigaction), "rt_sigaction" }, [227] = { 4, TS, SEN(rt_sigprocmask), "rt_sigprocmask" }, [228] = { 2, TS, SEN(rt_sigpending), "rt_sigpending" }, -[229] = { 4, TS, SEN(rt_sigtimedwait), "rt_sigtimedwait" }, +[229] = { 4, TS, SEN(rt_sigtimedwait_time32), "rt_sigtimedwait" }, [230] = { 3, TS, SEN(rt_sigqueueinfo), "rt_sigqueueinfo" }, [231] = { 2, TS, SEN(rt_sigsuspend), "rt_sigsuspend" }, -[232] = { 4, 0, SEN(mq_open), "mq_open" }, +[232] = { 4, TD, SEN(mq_open), "mq_open" }, [233] = { 1, 0, SEN(mq_unlink), "mq_unlink" }, -[234] = { 5, 0, SEN(mq_timedsend), "mq_timedsend" }, -[235] = { 5, 0, SEN(mq_timedreceive), "mq_timedreceive" }, -[236] = { 2, 0, SEN(mq_notify), "mq_notify" }, -[237] = { 3, 0, SEN(mq_getsetattr), "mq_getsetattr" }, +[234] = { 5, TD, SEN(mq_timedsend_time32), "mq_timedsend" }, +[235] = { 5, TD, SEN(mq_timedreceive_time32), "mq_timedreceive" }, +[236] = { 2, TD, SEN(mq_notify), "mq_notify" }, +[237] = { 3, TD, SEN(mq_getsetattr), "mq_getsetattr" }, [238] = { }, [239] = { 2, TM, SEN(io_setup), "io_setup" }, [240] = { 1, TM, SEN(io_destroy), "io_destroy" }, [241] = { 3, 0, SEN(io_submit), "io_submit" }, -[242] = { 5, 0, SEN(io_getevents), "io_getevents" }, +[242] = { 5, 0, SEN(io_getevents_time32), "io_getevents" }, [243] = { 3, 0, SEN(io_cancel), "io_cancel" }, -[244] = { 2, 0, SEN(clock_settime), "clock_settime" }, -[245] = { 2, 0, SEN(clock_gettime), "clock_gettime" }, -[246] = { 2, 0, SEN(clock_getres), "clock_getres" }, -[247] = { 4, 0, SEN(clock_nanosleep), "clock_nanosleep" }, +[244] = { 2, 0, SEN(clock_settime32), "clock_settime" }, +[245] = { 2, 0, SEN(clock_gettime32), "clock_gettime" }, +[246] = { 2, 0, SEN(clock_getres_time32), "clock_getres" }, +[247] = { 4, 0, SEN(clock_nanosleep_time32), "clock_nanosleep" }, [248] = { 3, 0, SEN(timer_create), "timer_create" }, [249] = { 1, 0, SEN(timer_delete), "timer_delete" }, -[250] = { 4, 0, SEN(timer_settime), "timer_settime" }, -[251] = { 2, 0, SEN(timer_gettime), "timer_gettime" }, +[250] = { 4, 0, SEN(timer_settime32), "timer_settime" }, +[251] = { 2, 0, SEN(timer_gettime32), "timer_gettime" }, [252] = { 1, 0, SEN(timer_getoverrun), "timer_getoverrun" }, [253] = { }, [254] = { 4, 0, SEN(lookup_dcookie), "lookup_dcookie" }, @@ -262,12 +269,12 @@ [269] = { 4, TD, SEN(tee), "tee" }, [270] = { 4, TD, SEN(vmsplice), "vmsplice" }, [271] = { }, -[272] = { 6, TD, SEN(pselect6), "pselect6" }, -[273] = { 5, TD, SEN(ppoll), "ppoll" }, +[272] = { 6, TD, SEN(pselect6_time32), "pselect6" }, +[273] = { 5, TD, SEN(ppoll_time32), "ppoll" }, [274] = { 6, TD, SEN(epoll_pwait), "epoll_pwait" }, [275] = { 1, TD, SEN(epoll_create1), "epoll_create1" }, [276] = { 0, TD, SEN(inotify_init), "inotify_init" }, -[277] = { 3, TD, SEN(inotify_add_watch), "inotify_add_watch" }, +[277] = { 3, TD|TF, SEN(inotify_add_watch), "inotify_add_watch" }, [278] = { 2, TD, SEN(inotify_rm_watch), "inotify_rm_watch" }, [279] = { 1, TD, SEN(inotify_init1), "inotify_init1" }, [280] = { 3, 0, SEN(getcpu), "getcpu" }, @@ -285,24 +292,24 @@ [293] = { 5, TD|TF, SEN(linkat), "linkat" }, [294] = { 3, TD|TF, SEN(symlinkat), "symlinkat" }, [295] = { 4, TD|TF, SEN(readlinkat), "readlinkat" }, -[296] = { 4, TD|TF, SEN(utimensat), "utimensat" }, +[296] = { 4, TD|TF, SEN(utimensat_time32), "utimensat" }, [297] = { 5, TD|TF, SEN(fchownat), "fchownat" }, [298] = { 3, TD|TF, SEN(futimesat), "futimesat" }, -[299] = { 4, TD|TF, SEN(fstatat64), "fstatat64" }, +[299] = { 4, TD|TF|TFST|TSTA,SEN(fstatat64), "fstatat64" }, [300] = { 3, TD|TF, SEN(fchmodat), "fchmodat" }, [301] = { 3, TD|TF, SEN(faccessat), "faccessat" }, [302 ... 303] = { }, [304] = { 3, TD|TS, SEN(signalfd), "signalfd" }, [305] = { }, [306] = { 1, TD, SEN(eventfd), "eventfd" }, -[307] = { 5, TN, SEN(recvmmsg), "recvmmsg" }, +[307] = { 5, TN, SEN(recvmmsg_time32), "recvmmsg" }, [308] = { 2, TD, SEN(setns), "setns" }, [309] = { 4, TD|TS, SEN(signalfd4), "signalfd4" }, [310] = { 3, TD, SEN(dup3), "dup3" }, [311] = { 2, TD, SEN(pipe2), "pipe2" }, [312] = { 2, TD, SEN(timerfd_create), "timerfd_create" }, -[313] = { 4, TD, SEN(timerfd_settime), "timerfd_settime" }, -[314] = { 2, TD, SEN(timerfd_gettime), "timerfd_gettime" }, +[313] = { 4, TD, SEN(timerfd_settime32), "timerfd_settime" }, +[314] = { 2, TD, SEN(timerfd_gettime32), "timerfd_gettime" }, [315] = { }, [316] = { 2, TD, SEN(eventfd2), "eventfd2" }, [317] = { 5, TD, SEN(preadv), "preadv" }, @@ -317,7 +324,7 @@ [326] = { 6, TD, SEN(sync_file_range2), "sync_file_range2" }, [327] = { 5, TD, SEN(perf_event_open), "perf_event_open" }, [328] = { 4, TP|TS, SEN(rt_tgsigqueueinfo), "rt_tgsigqueueinfo" }, -[329] = { 2, 0, SEN(clock_adjtime), "clock_adjtime" }, +[329] = { 2, 0, SEN(clock_adjtime32), "clock_adjtime" }, [330] = { 4, 0, SEN(prlimit64), "prlimit64" }, [331] = { 5, 0, SEN(kcmp), "kcmp" }, [332] = { 3, TD, SEN(finit_module), "finit_module" }, @@ -336,3 +343,33 @@ [345] = { 6, TD, SEN(copy_file_range), "copy_file_range" }, [346] = { 6, TD, SEN(preadv2), "preadv2" }, [347] = { 6, TD, SEN(pwritev2), "pwritev2" }, +[348] = { 4, TM|SI, SEN(pkey_mprotect), "pkey_mprotect" }, +[349] = { 2, 0, SEN(pkey_alloc), "pkey_alloc" }, +[350] = { 1, 0, SEN(pkey_free), "pkey_free" }, +[351] = { 5, TD|TF|TSTA, SEN(statx), "statx" }, +[352] = { 4, 0, SEN(rseq), "rseq" }, +/* [353 ... 402] - reserved to sync up with other architectures */ +[403] = { 2, 0, SEN(clock_gettime64), "clock_gettime64" }, +[404] = { 2, 0, SEN(clock_settime64), "clock_settime64" }, +[405] = { 2, 0, SEN(clock_adjtime64), "clock_adjtime64" }, +[406] = { 2, 0, SEN(clock_getres_time64), "clock_getres_time64" }, +[407] = { 4, 0, SEN(clock_nanosleep_time64), "clock_nanosleep_time64"}, +[408] = { 2, 0, SEN(timer_gettime64), "timer_gettime64" }, +[409] = { 4, 0, SEN(timer_settime64), "timer_settime64" }, +[410] = { 2, TD, SEN(timerfd_gettime64), "timerfd_gettime64" }, +[411] = { 4, TD, SEN(timerfd_settime64), "timerfd_settime64" }, +[412] = { 4, TD|TF, SEN(utimensat_time64), "utimensat_time64" }, +[413] = { 6, TD, SEN(pselect6_time64), "pselect6_time64" }, +[414] = { 5, TD, SEN(ppoll_time64), "ppoll_time64" }, +[416] = { 6, 0, SEN(io_pgetevents_time64), "io_pgetevents_time64" }, +[417] = { 5, TN, SEN(recvmmsg_time64), "recvmmsg_time64" }, +[418] = { 5, TD, SEN(mq_timedsend_time64), "mq_timedsend_time64" }, +[419] = { 5, TD, SEN(mq_timedreceive_time64), "mq_timedreceive_time64"}, +[420] = { 4, TI, SEN(semtimedop_time64), "semtimedop_time64" }, +[421] = { 4, TS, SEN(rt_sigtimedwait_time64), "rt_sigtimedwait_time64"}, +[422] = { 6, 0, SEN(futex_time64), "futex_time64" }, +[423] = { 2, 0, SEN(sched_rr_get_interval_time64), "sched_rr_get_interval_time64" }, +[424] = { 4, TD|TS, SEN(pidfd_send_signal), "pidfd_send_signal" }, +[425] = { 2, TD, SEN(io_uring_setup), "io_uring_setup" }, +[426] = { 6, TD|TS, SEN(io_uring_enter), "io_uring_enter" }, +[427] = { 4, TD|TM, SEN(io_uring_register), "io_uring_register" }, diff --git a/linux/xtensa/userent.h b/linux/xtensa/userent.h index 0bee7179..71fa7d57 100644 --- a/linux/xtensa/userent.h +++ b/linux/xtensa/userent.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + { REG_A_BASE, "a0" }, { REG_A_BASE+1, "a1" }, { REG_A_BASE+2, "a2" }, diff --git a/list.h b/list.h new file mode 100644 index 00000000..98563e4d --- /dev/null +++ b/list.h @@ -0,0 +1,300 @@ +/* + * Some simple implementation of lists similar to the one used in the kernel. + * + * Copyright (c) 2016-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_LIST_H +# define STRACE_LIST_H + +/* + * struct list_item and related macros and functions provide an interface + * for manipulating and iterating linked lists. In order to have list + * associated with its payload, struct list_item has to be embedded into + * a structure type representing payload, and (optionally) an additional + * struct list_item should be added somewhere as a starting point for list + * iteration (creating a list with a designated head). A situation where + * no designated head exists, and each embedded struct list_head is considered + * a head (i.e. starting point for list iteration), is also possible. + * + * List head has to be initialised with list_init() call. Statically allocated + * list heads can also be defined with an EMPTY_LIST() macro. + * + * In order to get a pointer to list item from a struct list_item, list_elem + * macro is used. + * + * When a designated head is used, list_head() and list_tail() can be used + * for getting pointer to the first and the last list item, respectively. + * + * list_next() and list_prev() macros can be used for obtaining pointers + * to the next and the previous items in the list, respectively. Note that + * they do not perform additional checks for the validity of these pointers, + * so they have to be guarded with respective list_head/list_tail checks in case + * of lists with designated heads (where the list's head is not embedded withing + * a list item. + * + * list_{insert,append,remove,remove_tail,remove_head,replace} provide some + * basic means of list manipulation. + * + * list_foreach() and list_foreach_safe() are wrapper macros for simplifying + * iteration over a list, with the latter having an additional argument + * for storing temporary pointer, thus allowing list manipulations during + * its iteration. + * + * A simple example: + * + * struct my_struct { + * int a; + * struct list_item l1; + * struct list_item l2; + * }; + * + * EMPTY_LIST(list_1); <--- Defining a designated head for list + * + * struct my_struct *item = + * calloc(1, sizeof(*item)); + * list_init(&item->l2); <--- Initialising structure field that + * is used for lists without designated + * head. + * list_insert(&list_1, &item->l1); <--- Inserting an item into the list + * + * item = calloc(1, sizeof(*item)); + * list_init(&item->l2); + * + * list_append(&(list_head(list_1, struct my_struct, l1)->l2), &item->l2); + * + * struct my_struct *cur = item; <--- Iteration over a headless list + * do { + * printf("%d\n", cur->a); + * } while ((cur = list_next(&cur, l2)) != item); + * + * struct my_struct *i; + * list_foreach(i, list_1, l1) { <--- Iteration over list_1 without list + * printf("%d\n", i->a); modification + * } + * + * struct my_struct *tmp; <--- Iteration with modification + * list_foreach_safe(i, list_1, l1, tmp) { + * list_remove(&i->l1); + * free(i); + * } + * + * See also: + * "Linux kernel design patterns - part 2", section "Linked Lists" + * https://lwn.net/Articles/336255/ + */ + +# include "macros.h" + +struct list_item { + struct list_item *prev; + struct list_item *next; +}; + +/** + * Define an empty list head. + * + * @param l_ List head variable name. + */ +# define EMPTY_LIST(l_) struct list_item l_ = { &l_, &l_ } + +/** Initialise an empty list. */ +static inline void +list_init(struct list_item *l) +{ + l->prev = l; + l->next = l; +} + +/** Check whether list is empty. */ +static inline bool +list_is_empty(const struct list_item *l) +{ + return ((l->next == l) && (l->prev == l)) + /* + * XXX This could be the case when struct list_item hasn't been + * initialised at all; we should probably also call some + * errror_func_msg() in that case, as it looks like sloppy + * programming. + */ + || (!l->next && !l->prev); +} + +/** + * Convert a pointer to a struct list_item to a pointer to a list item. + * + * @param var Pointer to struct list_item. + * @param type Type of the list's item. + * @param field Name of the field that holds the respective struct list_item. + */ +# define list_elem(var, type, field) containerof((var), type, field) + +/** + * Get the first element in a list. + * + * @param head Pointer to the list's head. + * @param type Type of the list's item. + * @param field Name of the field that holds the respective struct list_item. + */ +# define list_head(head, type, field) \ + (list_is_empty(head) ? NULL : list_elem((head)->next, type, field)) +/** + * Get the last element in a list. + * + * @param head Pointer to the list's head. + * @param type Type of the list's item. + * @param field Name of the field that holds the respective struct list_item. + */ +# define list_tail(head, type, field) \ + (list_is_empty(head) ? NULL : list_elem((head)->prev, type, field)) + +/** + * Get the next element in a list. + * + * @param var Pointer to a list item. + * @param field Name of the field that holds the respective struct list_item. + */ +# define list_next(var, field) \ + list_elem((var)->field.next, typeof(*(var)), field) +/** + * Get the previous element in a list. + * + * @param var Pointer to a list item. + * @param field Name of the field that holds the respective struct list_item. + */ +# define list_prev(var, field) \ + list_elem((var)->field.prev, typeof(*(var)), field) + +/** + * Insert an item into a list. The item is placed as the next list item + * to the head. + */ +static inline void +list_insert(struct list_item *head, struct list_item *item) +{ + item->next = head->next; + item->prev = head; + head->next->prev = item; + head->next = item; +} + +/** + * Insert an item into a list. The item is placed as the previous list item + * to the head. + */ +static inline void +list_append(struct list_item *head, struct list_item *item) +{ + item->next = head; + item->prev = head->prev; + head->prev->next = item; + head->prev = item; +} + +/** + * Remove an item from a list. + * + * @param item Pointer to struct list_item of the item to be removed. + * @return Whether the action has been performed. + */ +static inline bool +list_remove(struct list_item *item) +{ + if (!item->next || !item->prev || list_is_empty(item)) + return false; + + item->prev->next = item->next; + item->next->prev = item->prev; + item->next = item->prev = item; + + return true; +} + +/** + * Remove the last element of a list. + * + * @param head Pointer to the list's head. + * @return Pointer to struct list_item removed from the list; + * or NULL, if the list is empty. + */ +static inline struct list_item * +list_remove_tail(struct list_item *head) +{ + struct list_item *t = list_is_empty(head) ? NULL : head->prev; + + if (t) + list_remove(t); + + return t; +} + +/** + * Remove the first element of a list. + * + * @param head Pointer to the list's head. + * @return Pointer to struct list_item removed from the list; + * or NULL, if the list is empty. + */ +static inline struct list_item * +list_remove_head(struct list_item *head) +{ + struct list_item *h = list_is_empty(head) ? NULL : head->next; + + if (h) + list_remove(h); + + return h; +} + +/** + * Replace an old struct list_item in a list with the new one. + * + * @param old Pointer to struct list_item of the item to be replaced. + * @param new Pointer to struct list_item of the item to be replaced with. + * @return Whether the replacement has been performed. + */ +static inline bool +list_replace(struct list_item *old, struct list_item *new) +{ + if (!old->next || !old->prev || list_is_empty(old)) + return false; + + new->next = old->next; + new->prev = old->prev; + old->prev->next = new; + old->next->prev = new; + old->next = old->prev = old; + + return true; +} + +/** + * List iteration wrapper for non-destructive operations. + * + * @param var_ Variable holding pointer to a current list item. + * @param head_ Pointer to the list's head. + * @param field_ Name of the field containing the respective struct list_item + * inside list items. + */ +# define list_foreach(var_, head_, field_) \ + for (var_ = list_elem((head_)->next, typeof(*var_), field_); \ + &(var_->field_) != (head_); var_ = list_next(var_, field_)) + +/** + * List iteration wrapper for destructive operations. + * + * @param var_ Variable holding pointer to a current list item. + * @param head_ Pointer to the list's head. + * @param field_ Name of the field containing the respective struct list_item + * inside list items. + * @param _tmp Temporary variable for storing pointer to the next item. + */ +# define list_foreach_safe(var_, head_, field_, _tmp) \ + for (var_ = list_elem((head_)->next, typeof(*var_), field_), \ + _tmp = list_elem((var_)->field_.next, typeof(*var_), field_); \ + &var_->field_ != head_; var_ = _tmp, _tmp = list_next(_tmp, field_)) + +#endif /* !STRACE_LIST_H */ diff --git a/listen.c b/listen.c new file mode 100644 index 00000000..b8ec00c3 --- /dev/null +++ b/listen.c @@ -0,0 +1,21 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-2000 Wichert Akkerman + * Copyright (c) 1999-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +SYS_FUNC(listen) +{ + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + tprintf("%" PRI_klu, tcp->u_arg[1]); + + return RVAL_DECODED; +} diff --git a/lookup_dcookie.c b/lookup_dcookie.c index 279694f1..4042bd9d 100644 --- a/lookup_dcookie.c +++ b/lookup_dcookie.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/loop.c b/loop.c index f19ad928..36a40c55 100644 --- a/loop.c +++ b/loop.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2012 The Chromium OS Authors. + * Copyright (c) 2012-2018 The strace developers. * Written by Mike Frysinger . * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -35,7 +16,12 @@ typedef struct loop_info struct_loop_info; #include MPERS_DEFS +#include "print_fields.h" + +#define XLAT_MACROS_ONLY #include "xlat/loop_cmds.h" +#undef XLAT_MACROS_ONLY + #include "xlat/loop_flags_options.h" #include "xlat/loop_crypt_type_options.h" @@ -51,11 +37,9 @@ decode_loop_info(struct tcb *const tcp, const kernel_ulong_t addr) tprintf("{lo_number=%d", info.lo_number); if (!abbrev(tcp)) { - tprints(", lo_device="); - print_dev_t(info.lo_device); + PRINT_FIELD_DEV(", ", info, lo_device); tprintf(", lo_inode=%" PRI_klu, (kernel_ulong_t) info.lo_inode); - tprints(", lo_rdevice="); - print_dev_t(info.lo_rdevice); + PRINT_FIELD_DEV(", ", info, lo_rdevice); } tprintf(", lo_offset=%#x", info.lo_offset); @@ -75,15 +59,13 @@ decode_loop_info(struct tcb *const tcp, const kernel_ulong_t addr) tprints(", lo_flags="); printflags(loop_flags_options, info.lo_flags, "LO_FLAGS_???"); - tprints(", lo_name="); - print_quoted_string(info.lo_name, LO_NAME_SIZE, - QUOTE_0_TERMINATED); + PRINT_FIELD_CSTRING(", ", info, lo_name); if (!abbrev(tcp) || info.lo_encrypt_type != LO_CRYPT_NONE) { - tprints(", lo_encrypt_key="); - print_quoted_string((void *) info.lo_encrypt_key, - MIN((uint32_t) info.lo_encrypt_key_size, - LO_KEY_SIZE), 0); + const unsigned int lo_encrypt_key_size = + MIN((unsigned) info.lo_encrypt_key_size, LO_KEY_SIZE); + PRINT_FIELD_STRING(", ", info, lo_encrypt_key, + lo_encrypt_key_size, 0); } if (!abbrev(tcp)) @@ -107,11 +89,9 @@ decode_loop_info64(struct tcb *const tcp, const kernel_ulong_t addr) return; if (!abbrev(tcp)) { - tprints("{lo_device="); - print_dev_t(info64.lo_device); + PRINT_FIELD_DEV("{", info64, lo_device); tprintf(", lo_inode=%" PRIu64, (uint64_t) info64.lo_inode); - tprints(", lo_rdevice="); - print_dev_t(info64.lo_rdevice); + PRINT_FIELD_DEV(", ", info64, lo_rdevice); tprintf(", lo_offset=%#" PRIx64 ", lo_sizelimit=%" PRIu64 ", lo_number=%" PRIu32, (uint64_t) info64.lo_offset, @@ -134,18 +114,14 @@ decode_loop_info64(struct tcb *const tcp, const kernel_ulong_t addr) tprints(", lo_flags="); printflags(loop_flags_options, info64.lo_flags, "LO_FLAGS_???"); - tprints(", lo_file_name="); - print_quoted_string((void *) info64.lo_file_name, - LO_NAME_SIZE, QUOTE_0_TERMINATED); + PRINT_FIELD_CSTRING(", ", info64, lo_file_name); if (!abbrev(tcp) || info64.lo_encrypt_type != LO_CRYPT_NONE) { - tprints(", lo_crypt_name="); - print_quoted_string((void *) info64.lo_crypt_name, - LO_NAME_SIZE, QUOTE_0_TERMINATED); - tprints(", lo_encrypt_key="); - print_quoted_string((void *) info64.lo_encrypt_key, - MIN(info64.lo_encrypt_key_size, - LO_KEY_SIZE), 0); + PRINT_FIELD_CSTRING(", ", info64, lo_crypt_name); + const unsigned int lo_encrypt_key_size = + MIN((unsigned) info64.lo_encrypt_key_size, LO_KEY_SIZE); + PRINT_FIELD_STRING(", ", info64, lo_encrypt_key, + lo_encrypt_key_size, 0); } if (!abbrev(tcp)) @@ -164,7 +140,7 @@ MPERS_PRINTER_DECL(int, loop_ioctl, case LOOP_GET_STATUS: if (entering(tcp)) return 0; - /* fall through */ + ATTRIBUTE_FALLTHROUGH; case LOOP_SET_STATUS: decode_loop_info(tcp, arg); break; @@ -172,7 +148,7 @@ MPERS_PRINTER_DECL(int, loop_ioctl, case LOOP_GET_STATUS64: if (entering(tcp)) return 0; - /* fall through */ + ATTRIBUTE_FALLTHROUGH; case LOOP_SET_STATUS64: decode_loop_info64(tcp, arg); break; @@ -197,6 +173,7 @@ MPERS_PRINTER_DECL(int, loop_ioctl, break; case LOOP_SET_DIRECT_IO: + case LOOP_SET_BLOCK_SIZE: tprintf(", %" PRI_klu, arg); break; @@ -204,5 +181,5 @@ MPERS_PRINTER_DECL(int, loop_ioctl, return RVAL_DECODED; } - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } diff --git a/lseek.c b/lseek.c index 18d847b6..c3c9be79 100644 --- a/lseek.c +++ b/lseek.c @@ -8,29 +8,10 @@ * Copyright (c) 2012 H.J. Lu * Copyright (c) 2013 Denys Vlasenko * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -49,11 +30,11 @@ SYS_FUNC(lseek) kernel_long_t offset; -# ifndef current_klongsize +#ifndef current_klongsize if (current_klongsize < sizeof(kernel_long_t)) { offset = (int) tcp->u_arg[1]; } else -# endif /* !current_klongsize */ +#endif /* !current_klongsize */ { offset = tcp->u_arg[1]; } @@ -62,7 +43,7 @@ SYS_FUNC(lseek) printxval(whence_codes, tcp->u_arg[2], "SEEK_???"); - return RVAL_DECODED | RVAL_UDECIMAL; + return RVAL_DECODED; } /* llseek syscall takes explicitly two ulong arguments hi, lo, diff --git a/m4/ax_code_coverage.m4 b/m4/ax_code_coverage.m4 index 93dfce3a..0ca72e59 100644 --- a/m4/ax_code_coverage.m4 +++ b/m4/ax_code_coverage.m4 @@ -1,5 +1,5 @@ # =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_code_coverage.html +# https://www.gnu.org/software/autoconf-archive/ax_code_coverage.html # =========================================================================== # # SYNOPSIS @@ -9,9 +9,9 @@ # DESCRIPTION # # Defines CODE_COVERAGE_CPPFLAGS, CODE_COVERAGE_CFLAGS, -# CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LDFLAGS which should be -# included in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LDFLAGS variables of -# every build target (program or library) which should be built with code +# CODE_COVERAGE_CXXFLAGS and CODE_COVERAGE_LIBS which should be included +# in the CPPFLAGS, CFLAGS CXXFLAGS and LIBS/LIBADD variables of every +# build target (program or library) which should be built with code # coverage support. Also defines CODE_COVERAGE_RULES which should be # substituted in your Makefile; and $enable_code_coverage which can be # used in subsequent configure output. CODE_COVERAGE_ENABLED is defined @@ -21,7 +21,7 @@ # Test also for gcov program and create GCOV variable that could be # substituted. # -# Note that all optimisation flags in CFLAGS must be disabled when code +# Note that all optimization flags in CFLAGS must be disabled when code # coverage is enabled. # # Usage example: @@ -33,7 +33,7 @@ # Makefile.am: # # @CODE_COVERAGE_RULES@ -# my_program_LIBS = ... $(CODE_COVERAGE_LDFLAGS) ... +# my_program_LIBS = ... $(CODE_COVERAGE_LIBS) ... # my_program_CPPFLAGS = ... $(CODE_COVERAGE_CPPFLAGS) ... # my_program_CFLAGS = ... $(CODE_COVERAGE_CFLAGS) ... # my_program_CXXFLAGS = ... $(CODE_COVERAGE_CXXFLAGS) ... @@ -45,6 +45,11 @@ # (`make check`) and build a code coverage report detailing the code which # was touched, then print the URI for the report. # +# In earlier versions of this macro, CODE_COVERAGE_LDFLAGS was defined +# instead of CODE_COVERAGE_LIBS. They are both still defined, but use of +# CODE_COVERAGE_LIBS is preferred for clarity; CODE_COVERAGE_LDFLAGS is +# deprecated. They have the same value. +# # This code was derived from Makefile.decl in GLib, originally licenced # under LGPLv2.1+. # @@ -56,6 +61,7 @@ # Copyright (c) 2012 Paolo Borelli # Copyright (c) 2012 Dan Winship # Copyright (c) 2015 Bastien ROUCARIES +# Copyright (c) 2016-2017 The strace developers. # # This library is free software; you can redistribute it and/or modify it # under the terms of the GNU Lesser General Public License as published by @@ -68,9 +74,10 @@ # General Public License for more details. # # You should have received a copy of the GNU Lesser General Public License -# along with this program. If not, see . +# along with this program. If not, see . -#serial 16 +#serial 24 +##modified for strace project AC_DEFUN([AX_CODE_COVERAGE],[ dnl Check for --enable-code-coverage @@ -106,49 +113,56 @@ AC_DEFUN([AX_CODE_COVERAGE],[ AC_MSG_ERROR([not compiling with gcc, which is required for gcov code coverage]) ]) - # List of supported lcov versions. - lcov_version_list="1.6 1.7 1.8 1.9 1.10 1.11 1.12" - AC_CHECK_PROG([LCOV], [lcov], [lcov]) AC_CHECK_PROG([GENHTML], [genhtml], [genhtml]) - AS_IF([ test "$LCOV" ], [ - AC_CACHE_CHECK([for lcov version], ax_cv_lcov_version, [ - ax_cv_lcov_version=invalid - lcov_version=`$LCOV -v 2>/dev/null | $SED -e 's/^.* //'` - for lcov_check_version in $lcov_version_list; do - if test "$lcov_version" = "$lcov_check_version"; then - ax_cv_lcov_version="$lcov_check_version (ok)" - fi - done - ]) - ], [ - lcov_msg="To enable code coverage reporting you must have one of the following lcov versions installed: $lcov_version_list" - AC_MSG_ERROR([$lcov_msg]) + AS_IF([ test -z "$LCOV" ], [ + AC_MSG_ERROR([To enable code coverage reporting you must have lcov installed]) ]) - case $ax_cv_lcov_version in - ""|invalid[)] - lcov_msg="You must have one of the following versions of lcov: $lcov_version_list (found: $lcov_version)." - AC_MSG_ERROR([$lcov_msg]) - LCOV="exit 0;" - ;; - esac - AS_IF([ test -z "$GENHTML" ], [ AC_MSG_ERROR([Could not find genhtml from the lcov package]) ]) dnl Build the code coverage flags - CODE_COVERAGE_CPPFLAGS="-DNDEBUG" + dnl Define CODE_COVERAGE_LDFLAGS for backwards compatibility + CODE_COVERAGE_CPPFLAGS="-DENABLE_COVERAGE_GCOV -DNDEBUG" CODE_COVERAGE_CFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" CODE_COVERAGE_CXXFLAGS="-O0 -g -fprofile-arcs -ftest-coverage" - CODE_COVERAGE_LDFLAGS="-lgcov" + CODE_COVERAGE_LIBS="-lgcov" + CODE_COVERAGE_LDFLAGS="$CODE_COVERAGE_LIBS" AC_SUBST([CODE_COVERAGE_CPPFLAGS]) AC_SUBST([CODE_COVERAGE_CFLAGS]) AC_SUBST([CODE_COVERAGE_CXXFLAGS]) + AC_SUBST([CODE_COVERAGE_LIBS]) AC_SUBST([CODE_COVERAGE_LDFLAGS]) + + [CODE_COVERAGE_RULES_CHECK=' + -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check + $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture +'] + [CODE_COVERAGE_RULES_CAPTURE=' + $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS) + $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS) + -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp + $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) + @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" +'] + [CODE_COVERAGE_RULES_CLEAN=' +clean: code-coverage-clean +distclean: code-coverage-clean +code-coverage-clean: + -$(LCOV) --directory $(top_builddir) -z + -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) + -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete +'] + ], [ + [CODE_COVERAGE_RULES_CHECK=' + @echo "Need to reconfigure with --enable-code-coverage" +'] + CODE_COVERAGE_RULES_CAPTURE="$CODE_COVERAGE_RULES_CHECK" + CODE_COVERAGE_RULES_CLEAN='' ]) [CODE_COVERAGE_RULES=' @@ -206,7 +220,7 @@ CODE_COVERAGE_LCOV_RMOPTS ?= $(CODE_COVERAGE_LCOV_RMOPTS_DEFAULT) CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT ?=\ $(if $(CODE_COVERAGE_BRANCH_COVERAGE),\ --rc genhtml_branch_coverage=$(CODE_COVERAGE_BRANCH_COVERAGE)) -CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULTS) +CODE_COVERAGE_GENHTML_OPTIONS ?= $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) CODE_COVERAGE_IGNORE_PATTERN ?= code_coverage_v_lcov_cap = $(code_coverage_v_lcov_cap_$(V)) @@ -228,37 +242,15 @@ code_coverage_quiet_0 = --quiet code_coverage_sanitize = $(subst -,_,$(subst .,_,$(1))) # Use recursive makes in order to ignore errors during check -check-code-coverage: -ifeq ($(CODE_COVERAGE_ENABLED),yes) - -$(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k check - $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) code-coverage-capture -else - @echo "Need to reconfigure with --enable-code-coverage" -endif +check-code-coverage:'"$CODE_COVERAGE_RULES_CHECK"' # Capture code coverage data -code-coverage-capture: code-coverage-capture-hook -ifeq ($(CODE_COVERAGE_ENABLED),yes) - $(code_coverage_v_lcov_cap)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --capture --output-file "$(CODE_COVERAGE_OUTPUT_FILE).tmp" --test-name "$(call code_coverage_sanitize,$(PACKAGE_NAME)-$(PACKAGE_VERSION))" --no-checksum --compat-libtool $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_OPTIONS) - $(code_coverage_v_lcov_ign)$(LCOV) $(code_coverage_quiet) $(addprefix --directory ,$(CODE_COVERAGE_DIRECTORY)) --remove "$(CODE_COVERAGE_OUTPUT_FILE).tmp" "/tmp/*" $(CODE_COVERAGE_IGNORE_PATTERN) --output-file "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_LCOV_SHOPTS) $(CODE_COVERAGE_LCOV_RMOPTS) - -@rm -f $(CODE_COVERAGE_OUTPUT_FILE).tmp - $(code_coverage_v_genhtml)LANG=C $(GENHTML) $(code_coverage_quiet) $(addprefix --prefix ,$(CODE_COVERAGE_DIRECTORY)) --output-directory "$(CODE_COVERAGE_OUTPUT_DIRECTORY)" --title "$(PACKAGE_NAME)-$(PACKAGE_VERSION) Code Coverage" --legend --show-details "$(CODE_COVERAGE_OUTPUT_FILE)" $(CODE_COVERAGE_GENHTML_OPTIONS) - @echo "file://$(abs_builddir)/$(CODE_COVERAGE_OUTPUT_DIRECTORY)/index.html" -else - @echo "Need to reconfigure with --enable-code-coverage" -endif +code-coverage-capture: code-coverage-capture-hook'"$CODE_COVERAGE_RULES_CAPTURE"' # Hook rule executed before code-coverage-capture, overridable by the user code-coverage-capture-hook: -ifeq ($(CODE_COVERAGE_ENABLED),yes) -clean: code-coverage-clean -distclean: code-coverage-clean -code-coverage-clean: - -$(LCOV) --directory $(top_builddir) -z - -rm -rf $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_FILE).tmp $(CODE_COVERAGE_OUTPUT_DIRECTORY) - -find . \( -name "*.gcda" -o -name "*.gcno" -o -name "*.gcov" \) -delete -endif +'"$CODE_COVERAGE_RULES_CLEAN"' GITIGNOREFILES ?= GITIGNOREFILES += $(CODE_COVERAGE_OUTPUT_FILE) $(CODE_COVERAGE_OUTPUT_DIRECTORY) diff --git a/m4/ax_prog_cc_for_build.m4 b/m4/ax_prog_cc_for_build.m4 index 9fddbf64..0572e251 100644 --- a/m4/ax_prog_cc_for_build.m4 +++ b/m4/ax_prog_cc_for_build.m4 @@ -26,6 +26,7 @@ # LICENSE # # Copyright (c) 2008 Paolo Bonzini +# Copyright (c) 2008-2017 The strace developers. # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice diff --git a/m4/ax_valgrind_check.m4 b/m4/ax_valgrind_check.m4 index fa84a35e..0d35ee24 100644 --- a/m4/ax_valgrind_check.m4 +++ b/m4/ax_valgrind_check.m4 @@ -1,5 +1,5 @@ # =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_valgrind_check.html +# https://www.gnu.org/software/autoconf-archive/ax_valgrind_check.html # =========================================================================== # # SYNOPSIS @@ -61,13 +61,14 @@ # LICENSE # # Copyright (c) 2014, 2015, 2016 Philip Withnall +# Copyright (c) 2016-2017 The strace developers. # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 13 +#serial 15 #modified for strace project dnl Configured tools @@ -102,6 +103,7 @@ AC_DEFUN([AX_VALGRIND_CHECK],[ AM_CONDITIONAL([VALGRIND_ENABLED],[test "$enable_valgrind" = "yes"]) AC_SUBST([VALGRIND_ENABLED],[$enable_valgrind]) + AM_EXTRA_RECURSIVE_TARGETS([check-valgrind]) # Check for Valgrind tools we care about. [valgrind_enabled_tools=] @@ -140,6 +142,7 @@ m4_if(m4_defn([en_dflt_valgrind_]vgtool), [off], [= "yes"], [!= "no"]),[ valgrind_enabled_tools="$valgrind_enabled_tools ]m4_bpatsubst(vgtool,[^exp-])[" ]) AC_SUBST([ENABLE_VALGRIND_]vgtool,[$enable_valgrind_]vgtool) + AM_EXTRA_RECURSIVE_TARGETS([check-valgrind-]vgtool) ]) AC_SUBST([valgrind_tools],["]m4_join([ ], valgrind_tool_list)["]) AC_SUBST([valgrind_enabled_tools],[$valgrind_enabled_tools]) @@ -188,9 +191,8 @@ endif # Use recursive makes in order to ignore errors during check check-valgrind: ifeq ($(VALGRIND_ENABLED),yes) - -$(A''M_V_at)$(foreach tool,$(valgrind_enabled_tools), \ - $(MAKE) $(AM_MAKEFLAGS) -k check-valgrind-$(tool); \ - ) + $(A''M_V_at)$(MAKE) $(AM_MAKEFLAGS) -k \ + $(foreach tool, $(valgrind_enabled_tools), check-valgrind-$(tool)) else @echo "Need to reconfigure with --enable-valgrind" endif @@ -206,7 +208,7 @@ VALGRIND_LOG_COMPILER = \ $(valgrind_lt) \ $(VALGRIND) $(VALGRIND_SUPPRESSIONS) --error-exitcode=1 $(VALGRIND_FLAGS) -define valgrind_tool_rule = +define valgrind_tool_rule check-valgrind-$(1): $$(BUILT_SOURCES) ifeq ($$(VALGRIND_ENABLED)-$$(ENABLE_VALGRIND_$(1)),yes-yes) $$(valgrind_v_use)$$(MAKE) $$(AM_MAKEFLAGS) check-am \ diff --git a/m4/bpf_attr.m4 b/m4/bpf_attr.m4 new file mode 100644 index 00000000..8db2a643 --- /dev/null +++ b/m4/bpf_attr.m4 @@ -0,0 +1,131 @@ +dnl Generated by ./m4/gen_bpf_attr_m4.sh from bpf_attr.h; do not edit. +AC_DEFUN([st_BPF_ATTR], [dnl + AC_CHECK_MEMBERS(m4_normalize([ + struct bpf_map_info.btf_id, + struct bpf_map_info.btf_key_type_id, + struct bpf_map_info.btf_value_type_id, + struct bpf_map_info.id, + struct bpf_map_info.ifindex, + struct bpf_map_info.key_size, + struct bpf_map_info.map_flags, + struct bpf_map_info.max_entries, + struct bpf_map_info.name, + struct bpf_map_info.type, + struct bpf_map_info.value_size, + struct bpf_prog_info.btf_id, + struct bpf_prog_info.created_by_uid, + struct bpf_prog_info.func_info, + struct bpf_prog_info.func_info_rec_size, + struct bpf_prog_info.id, + struct bpf_prog_info.ifindex, + struct bpf_prog_info.jited_func_lens, + struct bpf_prog_info.jited_ksyms, + struct bpf_prog_info.jited_line_info, + struct bpf_prog_info.jited_line_info_rec_size, + struct bpf_prog_info.jited_prog_insns, + struct bpf_prog_info.jited_prog_len, + struct bpf_prog_info.line_info, + struct bpf_prog_info.line_info_rec_size, + struct bpf_prog_info.load_time, + struct bpf_prog_info.map_ids, + struct bpf_prog_info.name, + struct bpf_prog_info.nr_func_info, + struct bpf_prog_info.nr_jited_func_lens, + struct bpf_prog_info.nr_jited_ksyms, + struct bpf_prog_info.nr_jited_line_info, + struct bpf_prog_info.nr_line_info, + struct bpf_prog_info.nr_map_ids, + struct bpf_prog_info.nr_prog_tags, + struct bpf_prog_info.prog_tags, + struct bpf_prog_info.run_cnt, + struct bpf_prog_info.run_time_ns, + struct bpf_prog_info.tag, + struct bpf_prog_info.type, + struct bpf_prog_info.xlated_prog_insns, + struct bpf_prog_info.xlated_prog_len, + union bpf_attr.attach_bpf_fd, + union bpf_attr.attach_flags, + union bpf_attr.attach_type, + union bpf_attr.bpf_fd, + union bpf_attr.btf, + union bpf_attr.btf_fd, + union bpf_attr.btf_id, + union bpf_attr.btf_key_type_id, + union bpf_attr.btf_log_buf, + union bpf_attr.btf_log_level, + union bpf_attr.btf_log_size, + union bpf_attr.btf_size, + union bpf_attr.btf_value_type_id, + union bpf_attr.dummy, + union bpf_attr.expected_attach_type, + union bpf_attr.file_flags, + union bpf_attr.flags, + union bpf_attr.func_info, + union bpf_attr.func_info_cnt, + union bpf_attr.func_info_rec_size, + union bpf_attr.info.bpf_fd, + union bpf_attr.info.info, + union bpf_attr.info.info_len, + union bpf_attr.inner_map_fd, + union bpf_attr.insn_cnt, + union bpf_attr.insns, + union bpf_attr.kern_version, + union bpf_attr.key, + union bpf_attr.key_size, + union bpf_attr.license, + union bpf_attr.line_info, + union bpf_attr.line_info_cnt, + union bpf_attr.line_info_rec_size, + union bpf_attr.log_buf, + union bpf_attr.log_level, + union bpf_attr.log_size, + union bpf_attr.map_fd, + union bpf_attr.map_flags, + union bpf_attr.map_id, + union bpf_attr.map_ifindex, + union bpf_attr.map_name, + union bpf_attr.map_type, + union bpf_attr.max_entries, + union bpf_attr.next_id, + union bpf_attr.next_key, + union bpf_attr.numa_node, + union bpf_attr.open_flags, + union bpf_attr.pathname, + union bpf_attr.prog_btf_fd, + union bpf_attr.prog_flags, + union bpf_attr.prog_id, + union bpf_attr.prog_ifindex, + union bpf_attr.prog_name, + union bpf_attr.prog_type, + union bpf_attr.query.attach_flags, + union bpf_attr.query.attach_type, + union bpf_attr.query.prog_cnt, + union bpf_attr.query.prog_ids, + union bpf_attr.query.query_flags, + union bpf_attr.query.target_fd, + union bpf_attr.raw_tracepoint.name, + union bpf_attr.raw_tracepoint.prog_fd, + union bpf_attr.start_id, + union bpf_attr.target_fd, + union bpf_attr.task_fd_query.buf, + union bpf_attr.task_fd_query.buf_len, + union bpf_attr.task_fd_query.fd, + union bpf_attr.task_fd_query.fd_type, + union bpf_attr.task_fd_query.flags, + union bpf_attr.task_fd_query.pid, + union bpf_attr.task_fd_query.probe_addr, + union bpf_attr.task_fd_query.probe_offset, + union bpf_attr.task_fd_query.prog_id, + union bpf_attr.test.data_in, + union bpf_attr.test.data_out, + union bpf_attr.test.data_size_in, + union bpf_attr.test.data_size_out, + union bpf_attr.test.duration, + union bpf_attr.test.prog_fd, + union bpf_attr.test.repeat, + union bpf_attr.test.retval, + union bpf_attr.value, + union bpf_attr.value_size, + union bpf_attr.dummy + ]),,, [#include ]) +]) diff --git a/m4/mpers.m4 b/m4/mpers.m4 index 277a3841..13725d71 100644 --- a/m4/mpers.m4 +++ b/m4/mpers.m4 @@ -1,30 +1,11 @@ #!/usr/bin/m4 # -# Copyright (c) 2015-2016 Dmitry V. Levin +# Copyright (c) 2015-2017 Dmitry V. Levin # Copyright (c) 2015 Elvira Khabirova +# Copyright (c) 2015-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: LGPL-2.1-or-later AC_DEFUN([st_MPERS_LOAD_AC_CV], [ @@ -61,7 +42,7 @@ AC_DEFUN([st_MPERS_STRUCT_STAT], [ st_MPERS_LOAD_AC_CV([type_struct_stat$1]) AC_CHECK_TYPE([struct stat$1], AC_DEFINE([HAVE_]MPERS_NAME[_STRUCT_STAT$1], [1], - [Define to 1 if MPERS_NAME has the type 'struct stat$1'.]),, + [Define to 1 if ]mpers_name[ has the type 'struct stat$1'.]),, [#include #include ]) st_MPERS_SAVE_AC_CV([type_struct_stat$1]) @@ -69,7 +50,7 @@ st_MPERS_SAVE_AC_CV([type_struct_stat$1]) st_MPERS_LOAD_AC_CV([member_struct_stat$1_st_mtime_nsec]) AC_CHECK_MEMBER([struct stat$1.st_mtime_nsec], AC_DEFINE([HAVE_]MPERS_NAME[_STRUCT_STAT$1_ST_MTIME_NSEC], [1], - [Define to 1 if 'st_mtime_nsec' is a member of MPERS_NAME 'struct stat$1'.]),, + [Define to 1 if 'st_mtime_nsec' is a member of ]mpers_name[ 'struct stat$1'.]),, [#include #include ]) st_MPERS_SAVE_AC_CV([member_struct_stat$1_st_mtime_nsec]) @@ -82,13 +63,16 @@ pushdef([mpers_name], [$1]) pushdef([MPERS_NAME], translit([$1], [a-z], [A-Z])) pushdef([HAVE_MPERS], [HAVE_]MPERS_NAME[_MPERS]) pushdef([HAVE_RUNTIME], [HAVE_]MPERS_NAME[_RUNTIME]) -pushdef([CFLAG], [-$1]) +pushdef([MPERS_CFLAGS], [$cc_flags_$1]) pushdef([st_cv_cc], [st_cv_$1_cc]) pushdef([st_cv_runtime], [st_cv_$1_runtime]) pushdef([st_cv_mpers], [st_cv_$1_mpers]) case "$arch" in [$2]) + case "$enable_mpers" in + yes|check|[$1]) + AH_TEMPLATE([HAVE_GNU_STUBS_32_H], [Define to 1 if you have the header file.]) AH_TEMPLATE([HAVE_GNU_STUBS_X32_H], @@ -101,37 +85,75 @@ case "$arch" in IFLAG=-I.]) popdef([gnu_stubs]) saved_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS CFLAG $IFLAG" - AC_CACHE_CHECK([for CFLAG compile support], [st_cv_cc], + CFLAGS="$CFLAGS MPERS_CFLAGS $IFLAG" + AC_CACHE_CHECK([for mpers_name personality compile support], [st_cv_cc], [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include int main(){return 0;}]])], [st_cv_cc=yes], [st_cv_cc=no])]) if test $st_cv_cc = yes; then - AC_CACHE_CHECK([for CFLAG runtime support], [st_cv_runtime], + AC_CACHE_CHECK([for mpers_name personality runtime support], + [st_cv_runtime], [AC_RUN_IFELSE([AC_LANG_SOURCE([[#include int main(){return 0;}]])], [st_cv_runtime=yes], [st_cv_runtime=no], [st_cv_runtime=no])]) - AC_CACHE_CHECK([whether mpers.sh CFLAG works], [st_cv_mpers], - [if CC="$CC" CPP="$CPP" CPPFLAGS="$CPPFLAGS" \ - $srcdir/mpers_test.sh [$1]; then + AC_CACHE_CHECK([whether mpers.sh mpers_name MPERS_CFLAGS works], + [st_cv_mpers], + [if READELF="$READELF" \ + CC="$CC" CPP="$CPP" CPPFLAGS="$CPPFLAGS $IFLAG" \ + $srcdir/mpers_test.sh [$1] MPERS_CFLAGS; then st_cv_mpers=yes else st_cv_mpers=no fi]) if test $st_cv_mpers = yes; then AC_DEFINE(HAVE_MPERS, [1], - [Define to 1 if you have CFLAG mpers support]) + [Define to 1 if you have mpers_name mpers support]) st_MPERS_STRUCT_STAT([]) st_MPERS_STRUCT_STAT([64]) + + if test $st_cv_runtime = yes; then + pushdef([SIZEOF_LONG], + MPERS_NAME[_SIZEOF_LONG]) + st_MPERS_LOAD_AC_CV([sizeof_long]) + AC_CHECK_SIZEOF([long]) + st_MPERS_SAVE_AC_CV([sizeof_long]) + popdef([SIZEOF_LONG]) + + pushdef([SIZEOF_KERNEL_LONG_T], + MPERS_NAME[_SIZEOF_KERNEL_LONG_T]) + st_MPERS_LOAD_AC_CV([sizeof_kernel_long_t]) + AC_CHECK_SIZEOF([kernel_long_t],, + [#include "$srcdir/kernel_types.h"]) + st_MPERS_SAVE_AC_CV([sizeof_kernel_long_t]) + popdef([SIZEOF_KERNEL_LONG_T]) + fi fi fi CFLAGS="$saved_CFLAGS" ;; - *) + *) # case "$enable_mpers" + st_cv_runtime=no + st_cv_mpers=no + ;; + esac + + test "$st_cv_mpers" = yes || + st_cv_mpers=no + AC_MSG_CHECKING([whether to enable $1 personality support]) + AC_MSG_RESULT([$st_cv_mpers]) + + case "$enable_mpers,$st_cv_mpers" in + yes,no|[$1],no) + AC_MSG_ERROR([Cannot enable $1 personality support]) + ;; + esac + ;; + + *) # case "$arch" st_cv_runtime=no st_cv_mpers=no ;; @@ -143,7 +165,7 @@ AM_CONDITIONAL(HAVE_MPERS, [test "$st_cv_mpers" = yes]) popdef([st_cv_mpers]) popdef([st_cv_runtime]) popdef([st_cv_cc]) -popdef([CFLAG]) +popdef([MPERS_CFLAGS]) popdef([HAVE_RUNTIME]) popdef([HAVE_MPERS]) popdef([MPERS_NAME]) diff --git a/m4/st_demangle.m4 b/m4/st_demangle.m4 new file mode 100644 index 00000000..89941306 --- /dev/null +++ b/m4/st_demangle.m4 @@ -0,0 +1,65 @@ +#!/usr/bin/m4 +# +# Copyright (c) 2017-2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: LGPL-2.1-or-later + +AC_DEFUN([st_DEMANGLE], [dnl + +AC_ARG_WITH([libiberty], + [AS_HELP_STRING([--with-libiberty], + [use libiberty to demangle symbols in stack trace])], + [case "${withval}" in + yes|no|check) ;; + *) with_libiberty=yes + libiberty_CPPFLAGS="-I${withval}/include" + libiberty_LDFLAGS="-L${withval}/lib" ;; + esac], + [with_libiberty=check] +) + +libiberty_CPPFLAGS= +libiberty_LDFLAGS= +libiberty_LIBS= +use_libiberty=no + +AS_IF([test "x$with_libiberty" != xno], + [saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $libiberty_CPPFLAGS" + found_demangle_h=no + AC_CHECK_HEADERS([demangle.h libiberty/demangle.h], + [found_demangle_h=yes]) + CPPFLAGS="$saved_CPPFLAGS" + AS_IF([test "x$found_demangle_h" = xyes], + [saved_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $libiberty_LDFLAGS" + AC_CHECK_LIB([iberty],[cplus_demangle], + [libiberty_LIBS="-liberty" + use_libiberty=yes + ], + [if test "x$with_libiberty" != xcheck; then + AC_MSG_FAILURE([failed to find cplus_demangle in libiberty]) + fi + ] + ) + LDFLAGS="$saved_LDFLAGS" + ], + [if test "x$with_libiberty" != xcheck; then + AC_MSG_FAILURE([failed to find demangle.h]) + fi + ] + ) + ] +) + +AC_MSG_CHECKING([whether to enable symbols demangling in stack trace]) +if test "x$use_libiberty" = xyes; then + AC_DEFINE([USE_DEMANGLE], 1, [Do symbols demangling in stack trace]) + AC_SUBST(libiberty_LIBS) + AC_SUBST(libiberty_LDFLAGS) + AC_SUBST(libiberty_CPPFLAGS) +fi +AC_MSG_RESULT([$use_libiberty]) + +]) diff --git a/m4/st_libdw.m4 b/m4/st_libdw.m4 new file mode 100644 index 00000000..06b7f85a --- /dev/null +++ b/m4/st_libdw.m4 @@ -0,0 +1,93 @@ +#!/usr/bin/m4 +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: LGPL-2.1-or-later + +AC_DEFUN([st_ARG_LIBDW], [dnl + +: ${libdw_CPPFLAGS=} +: ${libdw_CFLAGS=} +: ${libdw_LDFLAGS=} +: ${libdw_LIBS=} + +AC_ARG_WITH([libdw], + [AS_HELP_STRING([--with-libdw], + [use libdw to implement stack tracing support] + ) + ], + [case "${withval}" in + yes|no|check) ;; + *) libdw_CPPFLAGS="-I${withval}/include" + libdw_LDFLAGS="-L${withval}/lib" + with_libdw=yes ;; + esac + ], + [with_libdw=check] + ) + +]) + +AC_DEFUN([st_LIBDW], [dnl + +have_libdw= + +AS_IF([test "x$with_libdw" != xno && test "x$use_unwinder" = x], + [saved_CPPFLAGS="$CPPFLAGS" + saved_CFLAGS="$CFLAGS" + CPPFLAGS="$CPPFLAGS $libdw_CPPFLAGS" + CFLAGS="$CFLAGS $libdw_CFLAGS" + + AC_CHECK_HEADERS([elfutils/libdwfl.h], + [AC_CHECK_LIB([dw], [dwfl_linux_proc_attach], + [libdw_LIBS="-ldw $libdw_LIBS" + AC_CACHE_CHECK([for elfutils version], + [st_cv_ELFUTILS_VERSION], + [[st_cv_ELFUTILS_VERSION="$(echo _ELFUTILS_VERSION | + $CPP $CPPFLAGS -P -imacros elfutils/version.h - | + grep '^[0-9]')" + test -n "$st_cv_ELFUTILS_VERSION" || + st_cv_ELFUTILS_VERSION=0 + ]] + ) + AS_IF([test "$st_cv_ELFUTILS_VERSION" -ge 164], + [have_libdw=yes], + [AS_IF([test "x$with_libdw" = xyes], + [AC_MSG_ERROR([elfutils version >= 164 is required for stack tracing support])], + [AC_MSG_WARN([elfutils version >= 164 is required for stack tracing support])] + ) + ] + ) + ], + [AS_IF([test "x$with_libdw" = xyes], + [AC_MSG_FAILURE([failed to find dwfl_linux_proc_attach in libdw])], + ) + ], + [$libdw_LDFLAGS $libdw_LIBS] + ) + ], + [AS_IF([test "x$with_libdw" = xyes], + [AC_MSG_FAILURE([failed to find elfutils/libdwfl.h])] + ) + ] + ) + + CFLAGS="$saved_CFLAGS" + CPPFLAGS="$saved_CPPFLAGS" + ] +) + +AS_IF([test "x$have_libdw" = xyes], + [use_unwinder=libdw + AC_DEFINE([USE_LIBDW], 1, + [Whether to use libdw for stack tracing] + ) + AC_SUBST(libdw_CPPFLAGS) + AC_SUBST(libdw_CFLAGS) + AC_SUBST(libdw_LDFLAGS) + AC_SUBST(libdw_LIBS) + ] + ) + +]) diff --git a/m4/st_libunwind.m4 b/m4/st_libunwind.m4 new file mode 100644 index 00000000..e78b5f67 --- /dev/null +++ b/m4/st_libunwind.m4 @@ -0,0 +1,99 @@ +#!/usr/bin/m4 +# +# Copyright (c) 2013-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: LGPL-2.1-or-later + +AC_DEFUN([st_ARG_LIBUNWIND], [dnl + +AC_ARG_WITH([libunwind], + [AS_HELP_STRING([--with-libunwind], + [use libunwind to implement stack tracing support])], + [case "${withval}" in + yes|no|check) ;; + *) with_libunwind=yes + libunwind_CPPFLAGS="-I${withval}/include" + libunwind_LDFLAGS="-L${withval}/lib" ;; + esac], + [with_libunwind=check] +) + +]) + +AC_DEFUN([st_LIBUNWIND], [dnl + +libunwind_CPPFLAGS= +libunwind_LDFLAGS= +libunwind_LIBS= + +AS_IF([test "x$with_libunwind" != xno && test "x$use_unwinder" = x], + [saved_CPPFLAGS="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS $libunwind_CPPFLAGS" + + AC_CHECK_HEADERS([libunwind-ptrace.h], + [saved_LDFLAGS="$LDFLAGS" + LDFLAGS="$LDFLAGS $libunwind_LDFLAGS" + + AC_CHECK_LIB([unwind], [backtrace], + [libunwind_LIBS="-lunwind $libunwind_LIBS" + + AC_MSG_CHECKING([for unw_create_addr_space in libunwind-generic]) + saved_LIBS="$LIBS" + LIBS="-lunwind-generic $libunwind_LIBS $LIBS" + + AC_LINK_IFELSE( + [AC_LANG_PROGRAM([[#include ]], + [[return !unw_create_addr_space(0, 0)]]) + ], + [AC_MSG_RESULT([yes]) + libunwind_LIBS="-lunwind-generic $libunwind_LIBS" + + AC_CHECK_LIB([unwind-ptrace], [_UPT_create], + [libunwind_LIBS="-lunwind-ptrace $libunwind_LIBS" + use_unwinder=libunwind + ], + [if test "x$with_libunwind" != xcheck; then + AC_MSG_FAILURE([failed to find _UPT_create in libunwind-ptrace]) + fi + ], + [$libunwind_LIBS] + ) + ], + [AC_MSG_RESULT([no]) + if test "x$with_libunwind" != xcheck; then + AC_MSG_FAILURE([failed to find unw_create_addr_space in libunwind-generic]) + fi + ] + ) + + LIBS="$saved_LIBS" + ], + [if test "x$with_libunwind" != xcheck; then + AC_MSG_FAILURE([failed to find libunwind]) + fi + ], + [$libunwind_LIBS] + ) + + LDFLAGS="$saved_LDFLAGS" + ], + [if test "x$with_libunwind" != xcheck; then + AC_MSG_FAILURE([failed to find libunwind-ptrace.h]) + fi + ] + ) + + CPPFLAGS="$saved_CPPFLAGS" + ] +) + +if test "x$use_unwinder" = xlibunwind; then + AC_DEFINE([USE_LIBUNWIND], 1, + [Whether to use libunwind for stack tracing]) + AC_SUBST(libunwind_LIBS) + AC_SUBST(libunwind_LDFLAGS) + AC_SUBST(libunwind_CPPFLAGS) +fi + +]) diff --git a/m4/st_save_restore_var.m4 b/m4/st_save_restore_var.m4 index 2939380a..482dbcde 100644 --- a/m4/st_save_restore_var.m4 +++ b/m4/st_save_restore_var.m4 @@ -1,3 +1,10 @@ +#!/usr/bin/m4 +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: LGPL-2.1-or-later + AC_DEFUN([st_SAVE_VAR], [dnl AS_IF([test -n "${$1+set}"], [st_saved_$1="${$1}"; unset $1]) ]) diff --git a/m4/st_stacktrace.m4 b/m4/st_stacktrace.m4 new file mode 100644 index 00000000..f77b6526 --- /dev/null +++ b/m4/st_stacktrace.m4 @@ -0,0 +1,58 @@ +#!/usr/bin/m4 +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: LGPL-2.1-or-later + +AC_DEFUN([st_STACKTRACE], [dnl + +AC_ARG_ENABLE([stacktrace], + [AS_HELP_STRING([--enable-stacktrace=yes|no|check], + [whether to enable stack tracing support, default is check])], + [case "$enableval" in + yes|no|check) enable_stacktrace="$enableval" ;; + *) AC_MSG_ERROR([bad value $enableval for enable-stacktrace option. + Valid options are: yes, no, check.]) + ;; + esac], + [enable_stacktrace=check]) + +use_unwinder= +dnl Whether to enable stack tracing support? + +AS_IF([test x"$enable_stacktrace" != xno], + [st_ARG_LIBDW + st_ARG_LIBUNWIND + AS_IF([test "x$with_libdw" = xyes && test "x$with_libunwind" = xyes], + [AC_MSG_ERROR([--with-libdw=yes and --with-libunwind=yes are mutually exclusive])], + [test "x$with_libdw" = xyes], [with_libunwind=no], + [test "x$with_libunwind" = xyes], [with_libdw=no] + ) + AS_IF([test "x$use_unwinder" = x], [st_LIBDW]) + AS_IF([test "x$use_unwinder" = x], [st_LIBUNWIND]) + AS_IF([test x"$enable_stacktrace$use_unwinder" = xyes], + [AC_MSG_ERROR([stack tracing support requires an unwinder])] + ) + ] + ) + +AC_MSG_CHECKING([whether to enable stack tracing support]) +AM_CONDITIONAL([ENABLE_STACKTRACE], [test "x$use_unwinder" != x]) +AM_CONDITIONAL([USE_LIBDW], [test "x$use_unwinder" = xlibdw]) +AM_CONDITIONAL([USE_LIBUNWIND], [test "x$use_unwinder" = xlibunwind]) + +use_libiberty= +AS_IF([test "x$use_unwinder" != x], + [AC_DEFINE([ENABLE_STACKTRACE], [1], + [Define to enable stack tracing support]) + AC_DEFINE_UNQUOTED([USE_UNWINDER], ["$use_unwinder"], + [The unwinder to use for stack tracing support]) + AC_MSG_RESULT([yes, using $use_unwinder]) + dnl As stack tracing support is enabled, check for a demangler. + st_DEMANGLE], + [AC_MSG_RESULT([no])]) + +AM_CONDITIONAL([USE_DEMANGLE], [test "x$use_libiberty" = xyes]) + +]) diff --git a/m4/st_warn_cflags.m4 b/m4/st_warn_cflags.m4 index 04d45442..9e4d7e3e 100644 --- a/m4/st_warn_cflags.m4 +++ b/m4/st_warn_cflags.m4 @@ -1,14 +1,24 @@ +#!/usr/bin/m4 +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: LGPL-2.1-or-later + AC_DEFUN([st_WARN_CFLAGS], [dnl gl_WARN_ADD([-Wall]) gl_WARN_ADD([-Wempty-body]) gl_WARN_ADD([-Wformat-security]) gl_WARN_ADD([-Wignored-qualifiers]) +gl_WARN_ADD([-Wimplicit-fallthrough=5]) gl_WARN_ADD([-Winit-self]) +gl_WARN_ADD([-Winitializer-overrides]) gl_WARN_ADD([-Wlogical-op]) gl_WARN_ADD([-Wmissing-parameter-type]) gl_WARN_ADD([-Wnested-externs]) gl_WARN_ADD([-Wold-style-declaration]) gl_WARN_ADD([-Wold-style-definition]) +gl_WARN_ADD([-Woverride-init]) gl_WARN_ADD([-Wsign-compare]) gl_WARN_ADD([-Wtype-limits]) gl_WARN_ADD([-Wwrite-strings]) diff --git a/macros.h b/macros.h new file mode 100644 index 00000000..f3ebdaf4 --- /dev/null +++ b/macros.h @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2001-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_MACROS_H +# define STRACE_MACROS_H + +# include +# include + +# include "gcc_compat.h" + +# define ARRAY_SIZE(a_) (sizeof(a_) / sizeof((a_)[0]) + MUST_BE_ARRAY(a_)) + +# define ARRSZ_PAIR(a_) a_, ARRAY_SIZE(a_) + +# define STRINGIFY(...) #__VA_ARGS__ +# define STRINGIFY_VAL(...) STRINGIFY(__VA_ARGS__) + +# ifndef MAX +# define MAX(a, b) (((a) > (b)) ? (a) : (b)) +# endif +# ifndef MIN +# define MIN(a, b) (((a) < (b)) ? (a) : (b)) +# endif +# define CLAMP(val, min, max) MIN(MAX(min, val), max) + +# ifndef ROUNDUP_DIV +# define ROUNDUP_DIV(val_, div_) (((val_) + (div_) - 1) / (div_)) +# endif + +# ifndef ROUNDUP +# define ROUNDUP(val_, div_) (ROUNDUP_DIV((val_), (div_)) * (div_)) +# endif + +# ifndef offsetofend +# define offsetofend(type_, member_) \ + (offsetof(type_, member_) + sizeof(((type_ *)0)->member_)) +# endif + +# ifndef cast_ptr +# define cast_ptr(type_, var_) \ + ((type_) (uintptr_t) (const volatile void *) (var_)) +# endif + +# ifndef containerof +/** + * Return a pointer to a structure that contains the provided variable. + * + * @param ptr_ Pointer to data that is a field of the container structure. + * @param struct_ Type of the container structure. + * @param member_ Name of the member field. + * @return Pointer to the container structure. + */ +# define containerof(ptr_, struct_, member_) \ + cast_ptr(struct_ *, \ + (const volatile char *) (ptr_) - offsetof(struct_, member_)) +# endif + +static inline bool +is_filled(const char *ptr, char fill, size_t size) +{ + while (size--) + if (*ptr++ != fill) + return false; + + return true; +} + +# define IS_ARRAY_ZERO(arr_) \ + is_filled((const char *) (arr_), 0, sizeof(arr_) + MUST_BE_ARRAY(arr_)) + +#endif /* !STRACE_MACROS_H */ diff --git a/maint/ioctls_gen.sh b/maint/ioctls_gen.sh deleted file mode 100755 index b20a0bd1..00000000 --- a/maint/ioctls_gen.sh +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/sh -# Copyright (c) 2004-2015 Dmitry V. Levin -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -set -efu - -me="${0##*/}" -mydir="${0%/*}" -msg() -{ - printf >&2 '%s\n' "$me: $*" -} - -case $# in - 1) - inc_dir="$1" - arch_dir= - ;; - 2) - inc_dir="$1" - arch_dir="$2" - ;; - *) - echo >&2 "usage: $me include-directory [arch-include-directory]" - exit 1 - ;; -esac - -# Check and canonicalize include-directory and arch-include-directory. -abs_inc_dir="$(cd "$inc_dir" && pwd -P)" -INCLUDES_inc="-I$abs_inc_dir/uapi -I$abs_inc_dir" -abs_arch_dir= -INCLUDES_arch= -[ -z "$arch_dir" ] || { - abs_arch_dir="$(cd "$arch_dir" && pwd -P)" - INCLUDES_arch="-I$abs_arch_dir/uapi -I$abs_arch_dir" -} - -cleanup() -{ - trap - EXIT - rm -f ioctls_hex.h ioctls_sym.h - exit "$@" -} -trap 'cleanup $?' EXIT -trap 'cleanup 1' HUP PIPE INT QUIT TERM - -# Fetch ioctl commands defined in hex form. -{ - "$mydir"/ioctls_hex.sh "$inc_dir" 03 linux/hdreg.h - "$mydir"/ioctls_hex.sh "$inc_dir" 22 scsi/sg.h - "$mydir"/ioctls_hex.sh "$inc_dir" 46 linux/fb.h - "$mydir"/ioctls_hex.sh "$inc_dir" 4B linux/kd.h - "$mydir"/ioctls_hex.sh "$inc_dir" 4C linux/loop.h - "$mydir"/ioctls_hex.sh "$inc_dir" 53 linux/cdrom.h scsi/scsi.h scsi/scsi_ioctl.h - "$mydir"/ioctls_hex.sh "$inc_dir" '\(46\|54\|66\|74\)' asm/ioctls.h asm-generic/ioctls.h - "$mydir"/ioctls_hex.sh "$inc_dir" 56 linux/vt.h - "$mydir"/ioctls_hex.sh "$inc_dir" '7[12]' linux/videotext.h - "$mydir"/ioctls_hex.sh "$inc_dir" 89 asm/sockios.h asm-generic/sockios.h linux/sockios.h - "$mydir"/ioctls_hex.sh "$inc_dir" 8B linux/wireless.h -} > ioctls_hex.h -msg "generated $(grep -c '^{' ioctls_hex.h) hex ioctls from $inc_dir" - -# Fetch ioctl commands defined in symbolic form. -INCLUDES="$INCLUDES_arch ${INCLUDES-}" \ - "$mydir"/ioctls_sym.sh "$inc_dir" > ioctls_sym.h - -# Move KVM_* constants from ioctls_inc.h to ioctls_arch.h. -grep -F 'linux/kvm.h' < ioctls_sym.h > ioctls_kvm.h ||: -grep -Fv 'linux/kvm.h' < ioctls_sym.h > ioctls_unkvm.h -mv ioctls_unkvm.h ioctls_sym.h - -# Part of android ioctl commands are defined elsewhere. -android_dir="$inc_dir/../drivers/staging/android" -if [ -d "$android_dir/uapi" ]; then - INCLUDES="$INCLUDES_inc $INCLUDES_arch ${INCLUDES-}" \ - "$mydir"/ioctls_sym.sh "$android_dir" staging/android >> ioctls_sym.h -fi -msg "generated $(grep -c '^{' ioctls_sym.h) symbolic ioctls from $inc_dir" - -# Output all ioctl definitions fetched from include-directory. -echo "/* Generated by $me from definitions found in ${inc_dir%%/}/ tree. */" > ioctls_inc.h -LC_COLLATE=C sort -u ioctls_hex.h ioctls_sym.h >> ioctls_inc.h -msg "generated $(grep -c '^{' ioctls_inc.h) ioctls from $inc_dir" - -[ -n "$arch_dir" ] || exit 0 - -# Fetch ioctl commands defined in hex form. -{ - "$mydir"/ioctls_hex.sh "$arch_dir" 54 asm/ioctls.h - "$mydir"/ioctls_hex.sh "$arch_dir" '\(46\|54\|66\|74\)' asm/ioctls.h - "$mydir"/ioctls_hex.sh "$arch_dir" 89 asm/sockios.h -} > ioctls_hex.h -msg "generated $(grep -c '^{' ioctls_hex.h) hex ioctls from $arch_dir" - -# Fetch ioctl commands defined in symbolic form. -INCLUDES="$INCLUDES_inc ${INCLUDES-}" \ - "$mydir"/ioctls_sym.sh "$arch_dir" > ioctls_sym.h -msg "generated $(grep -c '^{' ioctls_sym.h) symbolic ioctls from $arch_dir" - -# Output all ioctl definitions fetched from arch-include-directory. -echo "/* Generated by $me from definitions found in ${arch_dir%%/}/ tree. */" > ioctls_arch.h -LC_COLLATE=C sort -u ioctls_hex.h ioctls_kvm.h ioctls_sym.h >> ioctls_arch.h -msg "generated $(grep -c '^{' ioctls_arch.h) ioctls from $arch_dir" diff --git a/maint/ioctls_hex.sh b/maint/ioctls_hex.sh deleted file mode 100755 index a7987333..00000000 --- a/maint/ioctls_hex.sh +++ /dev/null @@ -1,49 +0,0 @@ -#!/bin/sh -# Copyright (c) 2001 Wichert Akkerman -# Copyright (c) 2004-2015 Dmitry V. Levin -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -set -efu - -me="${0##*/}" - -[ $# -ge 2 ] || { - echo >&2 "usage: $me include-directory type [files...]" - exit 1 -} - -dir="$1"; shift # dir must exist -type="$1"; shift # type might be a regexp - -cd "$dir" - -regexp='[[:space:]]*#[[:space:]]*define[[:space:]]\+\([A-Z][A-Z0-9_]*\)[[:space:]]\+\(0x'"$type"'..\)\>' - -for f; do - grep "^$regexp" "$f" "uapi/$f" 2>/dev/null ||:; -done | - sed 's|^uapi/||' | - sed -n 's/^\([^:]*\):'"$regexp"'.*/{ "\1", "\2", 0, \3, 0 },/p' | - LC_COLLATE=C sort -u diff --git a/maint/ioctls_sym.sh b/maint/ioctls_sym.sh deleted file mode 100755 index 14d53c66..00000000 --- a/maint/ioctls_sym.sh +++ /dev/null @@ -1,435 +0,0 @@ -#!/bin/sh -# Copyright (c) 2015 Dmitry V. Levin -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -set -efu - -# This script processes header files containing ioctl command definitions in -# symbolic form, assuming that these definitions match the following regular -# expressions: - -r_define='^[[:space:]]*#[[:space:]]*define[[:space:]]\+' -r_cmd_name='[A-Z][A-Z0-9_]*' -r_io='\([A-Z]\+\)\?_S\?\(IO\|IOW\|IOR\|IOWR\|IOC\)' -r_value='[[:space:]]\+'"$r_io"'[[:space:]]*([^)]' -regexp="${r_define}${r_cmd_name}${r_value}" - -uname_m="$(uname -m)" -me="${0##*/}" -msg() -{ - printf >&2 '%s\n' "$me: $*" -} - -prefix= -case $# in - 1) inc_dir="$1"; shift - ;; - 2) inc_dir="$1"; shift - prefix="$1"; shift - ;; - *) echo >&2 "usage: $me include-directory [prefix]" - exit 1 - ;; -esac - -[ -z "$prefix" ] || - prefix="${prefix%%/}/" - -tmpdir= -cleanup() -{ - trap - EXIT - [ -z "$tmpdir" ] || - rm -rf -- "$tmpdir" - exit "$@" -} - -trap 'cleanup $?' EXIT -trap 'cleanup 1' HUP PIPE INT QUIT TERM -tmpdir="$(mktemp -dt "$me.XXXXXX")" - -# list interesting files in $inc_dir. -cd "$inc_dir" -inc_dir="$(pwd -P)" -find . -type f -name '*.h' -print0 | - xargs -r0 grep -l "$r_value" -- > "$tmpdir"/headers1.list || - exit 0 -cd - > /dev/null -sed 's|^\./\(uapi/\)\?||' < "$tmpdir"/headers1.list > "$tmpdir"/headers.list -LC_COLLATE=C sort -u -o "$tmpdir"/headers.list "$tmpdir"/headers.list - -msg "processing $(wc -l < "$tmpdir"/headers.list) header files from $inc_dir" -failed=0 - -CC="${CC:-gcc}" -CPP="${CPP:-cpp}" -CPPFLAGS="${CPPFLAGS-} -D__EXPORTED_HEADERS__" -CFLAGS="${CFLAGS:--Wall -O2} -D__EXPORTED_HEADERS__" -LDFLAGS="${LDFLAGS-}" -INCLUDES="-I$inc_dir/uapi -I$inc_dir ${INCLUDES-}" - -$CC $INCLUDES $CFLAGS -c -o "$tmpdir"/print_ioctlent.o "${0%/*}"/print_ioctlent.c - -# Hook onto and -for d in asm-generic asm; do - mkdir "$tmpdir/$d" - cat > "$tmpdir/$d"/ioctl.h <<__EOF__ -#include_next <$d/ioctl.h> -#undef _IOC -#define _IOC(dir,type,nr,size) dir, type, nr, size -__EOF__ -done - -INCLUDES="-I$tmpdir $INCLUDES" - -process_file() -{ - local f="$1"; shift - - # Common code for every processed file. - cat > "$tmpdir"/printents.c <<__EOF__ -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#ifndef NULL -# define NULL ((void*)0) -#endif -#ifndef __user -# define __user -#endif -#ifndef __iomem -# define __iomem -#endif -#ifndef __noreturn -# define __noreturn __attribute__((noreturn)) -#endif -#ifndef __packed -# define __packed __attribute__((packed)) -#endif - -typedef signed char s8; -typedef unsigned char u8; -typedef signed short s16; -typedef unsigned short u16; -typedef signed int s32; -typedef unsigned int u32; -typedef signed long long s64; -typedef unsigned long long u64; - -#include "fixes.h" - -#include -#ifndef BITS_PER_LONG -# define BITS_PER_LONG __BITS_PER_LONG -#endif - -#include "$f" - -void print_ioctlent(const char *, const char *, unsigned short, unsigned short, unsigned short, unsigned short); - -int main(void) -{ - -#include "defs.h" - -return 0; -} -__EOF__ - - # Soft pre-include workarounds for some processed files. Fragile. - case "$f" in - *asm/amigayle.h) - return 0 # false positive - ;; - *asm/cmb.h) - echo '#include ' - ;; - *asm/core_*.h) - return 0 # false positives - ;; - *asm/ioctls.h) - cat <<'__EOF__' -#include -#include -__EOF__ - ;; - drm/sis_drm.h) - echo '#include ' - ;; - *drm/*_drm.h) - echo '#include ' > "$tmpdir/drm.h" - ;; - fbio.h|*/fbio.h) - cat <<'__EOF__' -#include -#undef FBIOGETCMAP -#undef FBIOPUTCMAP -__EOF__ - ;; - *linux/atm_zatm.h) - cat <<'__EOF__' -#include -#ifndef _LINUX_TIME_H -# define _LINUX_TIME_H -#endif -#ifndef _UAPI_LINUX_TIME_H -# define _UAPI_LINUX_TIME_H -#endif -__EOF__ - ;; - *linux/atm?*.h) - echo '#include ' - ;; - *linux/auto_fs*.h) - echo 'typedef u32 compat_ulong_t;' - ;; - *linux/coda.h|*android_alarm.h) - cat <<'__EOF__' -#ifndef _LINUX_TIME_H -# define _LINUX_TIME_H -#endif -#ifndef _UAPI_LINUX_TIME_H -# define _UAPI_LINUX_TIME_H -#endif -__EOF__ - ;; - *linux/fs.h|*linux/ncp_fs.h) - cat <<'__EOF__' -#include -#include -__EOF__ - ;; - *linux/if_pppox.h) - echo '#include ' - ;; - *linux/if_tun.h|*linux/ppp-ioctl.h) - echo '#include ' - ;; - *linux/isdn_ppp.h|*linux/gsmmux.h) - echo '#include ' - ;; - *media*/saa6588.h) - echo 'typedef struct poll_table_struct poll_table;' - ;; - *linux/ivtvfb.h|*linux/meye.h|*media/*.h) - echo '#include ' - ;; - *linux/kvm.h) - case "$uname_m" in - i?86|x86_64|arm*|ppc*|s390*) ;; - *) return 0 ;; # not applicable - esac - ;; - *linux/sonet.h) - echo '#include ' - ;; - *linux/usbdevice_fs.h) - cat <<'__EOF__' -struct usbdevfs_ctrltransfer32 { __u32 unused[4]; }; -struct usbdevfs_bulktransfer32 { __u32 unused[4]; }; -struct usbdevfs_disconnectsignal32 { __u32 unused[2]; }; -struct usbdevfs_urb32 { __u8 unused[42]; }; -struct usbdevfs_ioctl32 { __u32 unused[3]; }; -__EOF__ - ;; - logger.h|*/logger.h) - echo 'typedef __u32 kuid_t;' - ;; - *sound/asequencer.h) - cat <<'__EOF__' -#include -struct snd_seq_queue_owner { __u32 unused[0]; }; -__EOF__ - ;; - *sound/emu10k1.h) - cat <<'__EOF__' -#include -#ifndef DECLARE_BITMAP -# define DIV_ROUND_UP(x,y) (((x) + ((y) - 1)) / (y)) -# define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, 8 * sizeof(long)) -# define DECLARE_BITMAP(name,bits) unsigned long name[BITS_TO_LONGS(bits)] -#endif -__EOF__ - ;; - *video/sstfb.h) - echo 'struct fb_info;' - ;; - *xen/evtchn.h|*xen/gntdev.h) - cat <<'__EOF__' -typedef uint32_t grant_ref_t; -typedef uint16_t domid_t; -__EOF__ - ;; - *xen/interface/*.h) - return 0 # false positives - ;; - *xen/privcmd.h) - return 0 # too much work to make it compileable - ;; - esac > "$tmpdir"/fixes.h - - cat > "$tmpdir"/header.in <<__EOF__ -#include -#ifndef BITS_PER_LONG -# define BITS_PER_LONG __BITS_PER_LONG -#endif -#include "$f" -__EOF__ - - if [ -f "$inc_dir/uapi/$f" ]; then - s="$inc_dir/uapi/$f" - elif [ -f "$inc_dir/$f" ]; then - s="$inc_dir/$f" - else - msg "$f: file not found" - return 1 - fi - - [ -n "${f##*/*}" ] || - mkdir -p "$tmpdir/${f%/*}" - # Hard workarounds for some processed files. Very fragile. - case "$f" in - *asm-generic/ioctls.h) - # Filter out macros defined using unavailable types. - case "$uname_m" in - alpha*|ppc*) - grep -Fv 'struct termios2' < "$s" > "$tmpdir/$f" - ;; - esac - ;; - *acpi/*|*linux/i2o.h|*media*/exynos-fimc.h|*media/v4l2-subdev.h|*net/bluetooth/*|net/nfc/nci_core.h) - # Fetch macros only. - grep "${r_define}${r_cmd_name}" < "$s" > "$tmpdir/$f" - ;; - binder.h|*/binder.h) - # Convert enums to macros. - sed '/^enum binder/,/^};/d' < "$s" > "$tmpdir/$f" - sed -n '/^enum binder/,/^};/ s/^[[:space:]].*/&/p' < "$s" | - sed -e ' -s/^[[:space:]]*\([A-Z][A-Z_0-9]*\)[[:space:]]*=[[:space:]]*_\(IO\|IOW\|IOR\|IOWR\|IOC\)[[:space:]]*(/#define \1 _\2(/ -s/^\(#define .*)\),$/\1/ -s/^\(#define .*,\)$/\1 \\/ -s/^\([[:space:]]\+[^),]\+)\),$/\1/' >> "$tmpdir/$f" - ;; - *drm/r128_drm.h) - # Filter out the code that references unknown types. - sed '/drm_r128_clear2_t/d' < "$s" > "$tmpdir/$f" - ;; - *drm/sis_drm.h) - # Filter out the code that references unknown types. - sed '/^struct sis_file_private/,/^}/d' < "$s" > "$tmpdir/$f" - ;; - *drm/via_drm.h) - # Create the file it attempts to include. - touch "$tmpdir/via_drmclient.h" - # Filter out the code that references unknown types. - sed '/^struct via_file_private/,/^}/d' < "$s" > "$tmpdir/$f" - ;; - *linux/nilfs2_fs.h) - # Create the file it attempts to include. - touch "$tmpdir/asm/bug.h" - ;; - *linux/vmw_vmci_defs.h) - # Fetch ioctl macros only. - grep "${r_define}I" < "$s" > "$tmpdir/$f" - ;; - *media/v4l2-common.h) - # Fetch one piece of code containing ioctls definitions. - sed -n '/ remaining ioctls/,/ ---/p' < "$s" > "$tmpdir/$f" - ;; - openpromio.h|*/openpromio.h|fbio.h|*/fbio.h) - # Create the file it attempts to include. - mkdir -p "$tmpdir/linux" - touch "$tmpdir/linux/compiler.h" - esac - if [ -f "$tmpdir/$f" ]; then - s="$tmpdir/$f" - fi - - # This may fail if the file includes unavailable headers. - # In case of success it outputs both the #define directives - # and the result of preprocessing. - $CPP $CPPFLAGS -dD $INCLUDES < "$tmpdir"/header.in > "$tmpdir"/header.out - - # Soft post-preprocess workarounds. Fragile. - case "$f" in - *linux/kvm.h) - arm_list='KVM_ARM_PREFERRED_TARGET|KVM_ARM_VCPU_INIT' - ppc_list='KVM_ALLOCATE_RMA|KVM_CREATE_SPAPR_TCE|KVM_CREATE_SPAPR_TCE_64|KVM_PPC_GET_HTAB_FD|KVM_PPC_RTAS_DEFINE_TOKEN' - x86_list='KVM_GET_CPUID2|KVM_GET_DEBUGREGS|KVM_GET_EMULATED_CPUID|KVM_GET_LAPIC|KVM_GET_MSRS|KVM_GET_MSR_INDEX_LIST|KVM_GET_PIT|KVM_GET_PIT2|KVM_GET_SUPPORTED_CPUID|KVM_GET_VCPU_EVENTS|KVM_GET_XCRS|KVM_GET_XSAVE|KVM_SET_CPUID|KVM_SET_CPUID2|KVM_SET_DEBUGREGS|KVM_SET_LAPIC|KVM_SET_MEMORY_ALIAS|KVM_SET_MSRS|KVM_SET_PIT|KVM_SET_PIT2|KVM_SET_VCPU_EVENTS|KVM_SET_XCRS|KVM_SET_XSAVE|KVM_X86_SET_MCE|KVM_XEN_HVM_CONFIG' - case "$uname_m" in - arm*) list="$ppc_list|$x86_list" ;; - ppc*) list="$arm_list|$x86_list" ;; - i?86|x86_64*) list="$arm_list|$ppc_list" ;; - *) list="$arm_list|$ppc_list|$x86_list" ;; - esac - sed -r -i "/[[:space:]]($list)[[:space:]]/d" "$tmpdir"/header.out - ;; - esac - - # Need to exclude ioctl commands defined elsewhere. - local_defines='^[[:space:]]*#[[:space:]]*define[[:space:]]\+\('"$r_cmd_name"'\)[[:space:]]' - sed -n 's/'"$local_defines"'.*/\1\\/p' "$s" > "$tmpdir"/local_names - r_local_names="$(tr '\n' '|' < "$tmpdir"/local_names)" - r_local_names="${r_local_names%%|}" - r_local_names="${r_local_names%%\\}" - - # Keep this in sync with $regexp by replacing $r_cmd_name with $r_local_names. - defs_regexp="${r_define}\($r_local_names\)${r_value}" - - qf="$(echo "$prefix$f" | sed 's/[&\/]/\\&/g')" - # This outputs lines in the following format: - # print_ioctlent("filename.h", "IOCTL_CMD_NAME", IOCTL_CMD_NAME); - sed -n 's/'"$defs_regexp"'.*/print_ioctlent("'"$qf"'", "\1", \1);/p' \ - < "$tmpdir"/header.out > "$tmpdir"/defs.h - - # If something is wrong with the file, this will fail. - $CC $INCLUDES $CFLAGS -c -o "$tmpdir"/printents.o "$tmpdir"/printents.c - $CC $LDFLAGS -o "$tmpdir"/print_ioctlents \ - "$tmpdir"/printents.o "$tmpdir"/print_ioctlent.o - "$tmpdir"/print_ioctlents > "$tmpdir"/ioctlents - cat "$tmpdir"/ioctlents - msg "$f: fetched $(grep -c '^{' "$tmpdir"/ioctlents) ioctl entries" -} - -while read f; do - (process_file "$f" < /dev/null) - [ $? -eq 0 ] || { - msg "$f: failed to process" - failed=$((1 + $failed)) - } -done < "$tmpdir"/headers.list - -[ $failed -eq 0 ] || - msg "failed to process $failed file(s)" diff --git a/maint/print_ioctlent.c b/maint/print_ioctlent.c deleted file mode 100644 index d15aa351..00000000 --- a/maint/print_ioctlent.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2015 Dmitry V. Levin - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (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 -#include - -typedef unsigned short u16; - -static const char * -dir2str(const char *name, u16 dir) -{ - switch (dir) { -#define CASE(x) case x: return #x - CASE(_IOC_NONE); - CASE(_IOC_READ); - CASE(_IOC_WRITE); - CASE(_IOC_READ|_IOC_WRITE); - } - - static char buf[3 + sizeof(dir) * 2]; - fprintf(stderr, - "print_ioctlents: WARNING: invalid dir 0x%02x in %s\n", - dir, name); - snprintf(buf, sizeof(buf), "0x%02x", dir); - return buf; -} - -void -print_ioctlent(const char *info, const char *name, - u16 dir, u16 type, u16 nr, u16 size) -{ - unsigned int type_nr = - ((unsigned) type << _IOC_TYPESHIFT) | - ((unsigned) nr << _IOC_NRSHIFT); - - if (dir & ~_IOC_DIRMASK) - fprintf(stderr, - "print_ioctlents: WARNING: dir 0x%02x is out of mask 0x%02x in %s\n", - dir, _IOC_DIRMASK, name); - if (type & ~_IOC_TYPEMASK) - fprintf(stderr, - "print_ioctlents: WARNING: type 0x%02x is out of mask 0x%02x in %s\n", - type, _IOC_TYPEMASK, name); - if (nr & ~_IOC_NRMASK) - fprintf(stderr, - "print_ioctlents: WARNING: nr 0x%02x is out of mask 0x%02x in %s\n", - nr, _IOC_NRMASK, name); - if (size & ~_IOC_SIZEMASK) - fprintf(stderr, - "print_ioctlents: WARNING: size 0x%02x is out of mask 0x%02x in %s\n", - size, _IOC_SIZEMASK, name); - - printf("{ \"%s\", \"%s\", %s, 0x%04x, 0x%02x },\n", - info, name, dir2str(name, dir), type_nr, size); -} diff --git a/mem.c b/mem.c index 40ed707a..53626c06 100644 --- a/mem.c +++ b/mem.c @@ -5,33 +5,14 @@ * Copyright (c) 1996-1999 Wichert Akkerman * Copyright (c) 2000 PocketPenguins Inc. Linux for Hitachi SuperH * port by Greg Banks + * Copyright (c) 1999-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" -#include +#include #include unsigned long @@ -39,8 +20,18 @@ get_pagesize(void) { static unsigned long pagesize; - if (!pagesize) - pagesize = sysconf(_SC_PAGESIZE); + if (!pagesize) { + long ret = sysconf(_SC_PAGESIZE); + + if (ret < 0) + perror_func_msg_and_die("sysconf(_SC_PAGESIZE)"); + if (ret == 0) + error_func_msg_and_die("sysconf(_SC_PAGESIZE) " + "returned 0"); + + pagesize = (unsigned long) ret; + } + return pagesize; } @@ -54,6 +45,48 @@ SYS_FUNC(brk) #include "xlat/mmap_prot.h" #include "xlat/mmap_flags.h" +#ifndef MAP_HUGE_SHIFT +# define MAP_HUGE_SHIFT 26 +#endif + +#ifndef MAP_HUGE_MASK +# define MAP_HUGE_MASK 0x3f +#endif + +static void +print_mmap_flags(kernel_ulong_t flags) +{ + if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) + tprintf("%#" PRI_klx, flags); + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) + return; + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) + tprints(" /* "); + + printxvals_ex(flags & MAP_TYPE, "MAP_???", XLAT_STYLE_ABBREV, + mmap_flags, NULL); + flags &= ~MAP_TYPE; + + const unsigned int mask = MAP_HUGE_MASK << MAP_HUGE_SHIFT; + const unsigned int hugetlb_value = flags & mask; + + flags &= ~mask; + if (flags) { + tprints("|"); + printflags_ex(flags, NULL, XLAT_STYLE_ABBREV, + mmap_flags, NULL); + } + + if (hugetlb_value) + tprintf("|%u<> MAP_HUGE_SHIFT); + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) + tprints(" */"); +} + static void print_mmap(struct tcb *tcp, kernel_ulong_t *u_arg, unsigned long long offset) { @@ -67,12 +100,7 @@ print_mmap(struct tcb *tcp, kernel_ulong_t *u_arg, unsigned long long offset) tprintf(", %" PRI_klu ", ", len); printflags64(mmap_prot, prot, "PROT_???"); tprints(", "); -#ifdef MAP_TYPE - printxval64(mmap_flags, flags & MAP_TYPE, "MAP_???"); - addflags(mmap_flags, flags & ~MAP_TYPE); -#else - printflags64(mmap_flags, flags, "MAP_???"); -#endif + print_mmap_flags(flags); tprints(", "); printfd(tcp, fd); tprintf(", %#llx", offset); @@ -86,51 +114,43 @@ print_mmap(struct tcb *tcp, kernel_ulong_t *u_arg, unsigned long long offset) * Confused? Me too! */ -#if defined AARCH64 || defined ARM \ - || defined I386 || defined X86_64 || defined X32 \ - || defined M68K \ - || defined S390 || defined S390X +#if HAVE_ARCH_OLD_MMAP /* Params are pointed to by u_arg[0], offset is in bytes */ SYS_FUNC(old_mmap) { - kernel_ulong_t u_arg[6]; -# if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG - /* We are here only in a 32-bit personality. */ - unsigned int narrow_arg[6]; - if (umove_or_printaddr(tcp, tcp->u_arg[0], &narrow_arg)) - return RVAL_DECODED | RVAL_HEX; - unsigned int i; - for (i = 0; i < 6; i++) - u_arg[i] = narrow_arg[i]; -# else - if (umove_or_printaddr(tcp, tcp->u_arg[0], &u_arg)) - return RVAL_DECODED | RVAL_HEX; -# endif - print_mmap(tcp, u_arg, u_arg[5]); + kernel_ulong_t *args = + fetch_indirect_syscall_args(tcp, tcp->u_arg[0], 6); + + if (args) + print_mmap(tcp, args, args[5]); + else + printaddr(tcp->u_arg[0]); return RVAL_DECODED | RVAL_HEX; } -#endif /* old_mmap architectures */ -#ifdef S390 +# if HAVE_ARCH_OLD_MMAP_PGOFF /* Params are pointed to by u_arg[0], offset is in pages */ SYS_FUNC(old_mmap_pgoff) { - kernel_ulong_t u_arg[5]; - int i; - unsigned int narrow_arg[6]; - unsigned long long offset; - if (umove_or_printaddr(tcp, tcp->u_arg[0], &narrow_arg)) - return RVAL_DECODED | RVAL_HEX; - for (i = 0; i < 5; i++) - u_arg[i] = narrow_arg[i]; - offset = narrow_arg[5]; - offset *= get_pagesize(); - print_mmap(tcp, u_arg, offset); + kernel_ulong_t *args = + fetch_indirect_syscall_args(tcp, tcp->u_arg[0], 6); + + if (args) { + unsigned long long offset; + + offset = args[5]; + offset *= get_pagesize(); + + print_mmap(tcp, args, offset); + } else { + printaddr(tcp->u_arg[0]); + } return RVAL_DECODED | RVAL_HEX; } -#endif /* S390 */ +# endif /* HAVE_ARCH_OLD_MMAP_PGOFF */ +#endif /* HAVE_ARCH_OLD_MMAP */ /* Params are passed directly, offset is in bytes */ SYS_FUNC(mmap) @@ -296,14 +316,6 @@ SYS_FUNC(mincore) return 0; } -#if defined ALPHA || defined IA64 || defined M68K \ - || defined SPARC || defined SPARC64 -SYS_FUNC(getpagesize) -{ - return RVAL_DECODED | RVAL_HEX; -} -#endif - SYS_FUNC(remap_file_pages) { const kernel_ulong_t addr = tcp->u_arg[0]; @@ -316,12 +328,7 @@ SYS_FUNC(remap_file_pages) tprintf(", %" PRI_klu ", ", size); printflags64(mmap_prot, prot, "PROT_???"); tprintf(", %" PRI_klu ", ", pgoff); -#ifdef MAP_TYPE - printxval64(mmap_flags, flags & MAP_TYPE, "MAP_???"); - addflags(mmap_flags, flags & ~MAP_TYPE); -#else - printflags64(mmap_flags, flags, "MAP_???"); -#endif + print_mmap_flags(flags); return RVAL_DECODED; } @@ -330,7 +337,7 @@ SYS_FUNC(remap_file_pages) static bool print_protmap_entry(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) { - tprintf("%#08x", * (unsigned int *) elem_buf); + tprintf("%#08x", *(unsigned int *) elem_buf); return true; } @@ -347,7 +354,7 @@ SYS_FUNC(subpage_prot) unsigned int entry; print_array(tcp, map, nmemb, &entry, sizeof(entry), - umoven_or_printaddr, print_protmap_entry, 0); + tfetch_mem, print_protmap_entry, 0); return RVAL_DECODED; } diff --git a/membarrier.c b/membarrier.c index 759b76f3..b17991f9 100644 --- a/membarrier.c +++ b/membarrier.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/memfd_create.c b/memfd_create.c index 0101f061..c94b1ac4 100644 --- a/memfd_create.c +++ b/memfd_create.c @@ -1,39 +1,58 @@ /* * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" +#ifdef HAVE_LINUX_MEMFD_H +# include +#endif + #include "xlat/memfd_create_flags.h" +#ifndef MFD_HUGE_SHIFT +# define MFD_HUGE_SHIFT 26 +#endif + +#ifndef MFD_HUGE_MASK +# define MFD_HUGE_MASK 0x3f +#endif + SYS_FUNC(memfd_create) { - printstr(tcp, tcp->u_arg[0]); + printpathn(tcp, tcp->u_arg[0], 255 - (sizeof("memfd:") - 1)); tprints(", "); - printflags(memfd_create_flags, tcp->u_arg[1], "MFD_???"); + + unsigned int flags = tcp->u_arg[1]; + + if (!flags || xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) + tprintf("%#x", flags); + + if (!flags || xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) + return RVAL_DECODED | RVAL_FD; + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) + tprints(" /* "); + + const unsigned int mask = MFD_HUGE_MASK << MFD_HUGE_SHIFT; + const unsigned int hugetlb_value = flags & mask; + flags &= ~mask; + + if (flags || !hugetlb_value) + printflags_ex(flags, "MFD_???", XLAT_STYLE_ABBREV, + memfd_create_flags, NULL); + + if (hugetlb_value) + tprintf("%s%u<> MFD_HUGE_SHIFT); + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) + tprints(" */"); return RVAL_DECODED | RVAL_FD; } diff --git a/missing b/missing index db98974f..625aeb11 100755 --- a/missing +++ b/missing @@ -1,9 +1,9 @@ #! /bin/sh # Common wrapper for a few potentially missing GNU programs. -scriptversion=2013-10-28.13; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 1996-2013 Free Software Foundation, Inc. +# Copyright (C) 1996-2018 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify @@ -17,7 +17,7 @@ scriptversion=2013-10-28.13; # UTC # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -101,9 +101,9 @@ else exit $st fi -perl_URL=http://www.perl.org/ -flex_URL=http://flex.sourceforge.net/ -gnu_software_URL=http://www.gnu.org/software +perl_URL=https://www.perl.org/ +flex_URL=https://github.com/westes/flex +gnu_software_URL=https://www.gnu.org/software program_details () { @@ -207,9 +207,9 @@ give_advice "$1" | sed -e '1s/^/WARNING: /' \ exit $st # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/mknod.c b/mknod.c index 3edcd848..b01e6000 100644 --- a/mknod.c +++ b/mknod.c @@ -6,29 +6,10 @@ * Copyright (c) 2006 Ulrich Drepper * Copyright (c) 2006 Bernhard Kaindl * Copyright (c) 2006-2015 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/mmap_cache.c b/mmap_cache.c new file mode 100644 index 00000000..89c62254 --- /dev/null +++ b/mmap_cache.c @@ -0,0 +1,227 @@ +/* + * Copyright (c) 2013 Luca Clementi + * Copyright (c) 2013-2018 The strace developers. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include + +#include "largefile_wrappers.h" +#include "mmap_cache.h" +#include "mmap_notify.h" +#include "xstring.h" + +static unsigned int mmap_cache_generation; + +static void +mmap_cache_invalidate(struct tcb *tcp, void *unused) +{ +#if SUPPORTED_PERSONALITIES > 1 + if (tcp->currpers != DEFAULT_PERSONALITY) { + /* disable stack trace */ + return; + } +#endif + mmap_cache_generation++; + debug_func_msg("tgen=%u, ggen=%u, tcp=%p, cache=%p", + tcp->mmap_cache ? tcp->mmap_cache->generation : 0, + mmap_cache_generation, tcp, + tcp->mmap_cache ? tcp->mmap_cache->entry : 0); +} + +void +mmap_cache_enable(void) +{ + static bool use_mmap_cache; + + if (!use_mmap_cache) { + mmap_notify_register_client(mmap_cache_invalidate, NULL); + use_mmap_cache = true; + } +} + +/* deleting the cache */ +static void +delete_mmap_cache(struct tcb *tcp, const char *caller) +{ + debug_func_msg("tgen=%u, ggen=%u, tcp=%p, cache=%p, caller=%s", + tcp->mmap_cache ? tcp->mmap_cache->generation : 0, + mmap_cache_generation, tcp, + tcp->mmap_cache ? tcp->mmap_cache->entry : 0, caller); + + if (!tcp->mmap_cache) + return; + + while (tcp->mmap_cache->size) { + unsigned int i = --tcp->mmap_cache->size; + free(tcp->mmap_cache->entry[i].binary_filename); + tcp->mmap_cache->entry[i].binary_filename = NULL; + } + + free(tcp->mmap_cache->entry); + tcp->mmap_cache->entry = NULL; + + free(tcp->mmap_cache); + tcp->mmap_cache = NULL; +} + +/* + * caching of /proc/ID/maps for each process to speed up stack tracing + * + * The cache must be refreshed after syscalls that affect memory mappings, + * e.g. mmap, mprotect, munmap, execve. + */ +extern enum mmap_cache_rebuild_result +mmap_cache_rebuild_if_invalid(struct tcb *tcp, const char *caller) +{ + if (tcp->mmap_cache + && tcp->mmap_cache->generation != mmap_cache_generation) + delete_mmap_cache(tcp, caller); + + if (tcp->mmap_cache) + return MMAP_CACHE_REBUILD_READY; + + char filename[sizeof("/proc/4294967296/maps")]; + xsprintf(filename, "/proc/%u/maps", tcp->pid); + + FILE *fp = fopen_stream(filename, "r"); + if (!fp) { + perror_msg("fopen: %s", filename); + return MMAP_CACHE_REBUILD_NOCACHE; + } + + struct mmap_cache_t cache = { + .free_fn = delete_mmap_cache, + .generation = mmap_cache_generation + }; + + /* start with a small dynamically-allocated array and then expand it */ + size_t allocated = 0; + char buffer[PATH_MAX + 80]; + + while (fgets(buffer, sizeof(buffer), fp) != NULL) { + unsigned long start_addr, end_addr, mmap_offset; + char read_bit; + char write_bit; + char exec_bit; + char shared_bit; + unsigned long major, minor; + char binary_path[sizeof(buffer)]; + + if (sscanf(buffer, "%lx-%lx %c%c%c%c %lx %lx:%lx %*d %[^\n]", + &start_addr, &end_addr, + &read_bit, &write_bit, &exec_bit, &shared_bit, + &mmap_offset, + &major, &minor, + binary_path) != 10) + continue; + + /* skip mappings that have unknown protection */ + if (!(read_bit == '-' || read_bit == 'r')) + continue; + if (!(write_bit == '-' || write_bit == 'w')) + continue; + if (!(exec_bit == '-' || exec_bit == 'x')) + continue; + if (!(shared_bit == 'p' || shared_bit == 's')) + continue; + + if (end_addr < start_addr) { + error_msg("%s: unrecognized file format", filename); + break; + } + + struct mmap_cache_entry_t *entry; + /* + * sanity check to make sure that we're storing + * non-overlapping regions in ascending order + */ + if (cache.size > 0) { + entry = &cache.entry[cache.size - 1]; + if (entry->start_addr == start_addr && + entry->end_addr == end_addr) { + /* duplicate entry, e.g. [vsyscall] */ + continue; + } + if (start_addr <= entry->start_addr || + start_addr < entry->end_addr) { + debug_msg("%s: overlapping memory region: " + "\"%s\" [%08lx-%08lx] overlaps with " + "\"%s\" [%08lx-%08lx]", + filename, binary_path, start_addr, + end_addr, entry->binary_filename, + entry->start_addr, entry->end_addr); + continue; + } + } + + if (cache.size >= allocated) + cache.entry = xgrowarray(cache.entry, &allocated, + sizeof(*cache.entry)); + + entry = &cache.entry[cache.size]; + entry->start_addr = start_addr; + entry->end_addr = end_addr; + entry->mmap_offset = mmap_offset; + entry->protections = ( + 0 + | ((read_bit == 'r')? MMAP_CACHE_PROT_READABLE : 0) + | ((write_bit == 'w')? MMAP_CACHE_PROT_WRITABLE : 0) + | ((exec_bit == 'x')? MMAP_CACHE_PROT_EXECUTABLE: 0) + | ((shared_bit == 's')? MMAP_CACHE_PROT_SHARED : 0) + ); + entry->major = major; + entry->minor = minor; + entry->binary_filename = xstrdup(binary_path); + cache.size++; + } + fclose(fp); + + if (!cache.size) + return MMAP_CACHE_REBUILD_NOCACHE; + + tcp->mmap_cache = xmalloc(sizeof(*tcp->mmap_cache)); + memcpy(tcp->mmap_cache, &cache, sizeof(cache)); + + debug_func_msg("tgen=%u, ggen=%u, tcp=%p, cache=%p, caller=%s", + tcp->mmap_cache->generation, mmap_cache_generation, + tcp, tcp->mmap_cache->entry, caller); + + return MMAP_CACHE_REBUILD_RENEWED; +} + +struct mmap_cache_entry_t * +mmap_cache_search(struct tcb *tcp, unsigned long ip) +{ + if (!tcp->mmap_cache) + return NULL; + + int lower = 0; + int upper = (int) tcp->mmap_cache->size - 1; + + while (lower <= upper) { + int mid = (upper + lower) / 2; + struct mmap_cache_entry_t *entry = &tcp->mmap_cache->entry[mid]; + + if (ip >= entry->start_addr && + ip < entry->end_addr) + return entry; + else if (ip < entry->start_addr) + upper = mid - 1; + else + lower = mid + 1; + } + return NULL; +} + +struct mmap_cache_entry_t * +mmap_cache_search_custom(struct tcb *tcp, mmap_cache_search_fn fn, void *data) +{ + for (unsigned int i = 0; i < tcp->mmap_cache->size; i++) { + if (fn(tcp->mmap_cache->entry + i, data)) + return tcp->mmap_cache->entry + i; + } + return NULL; +} diff --git a/mmap_cache.h b/mmap_cache.h new file mode 100644 index 00000000..aec62bf1 --- /dev/null +++ b/mmap_cache.h @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2013-2018 The strace developers. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_MMAP_CACHE_H +# define STRACE_MMAP_CACHE_H + +/* + * Keep a sorted array of cache entries, + * so that we can binary search through it. + */ + +struct mmap_cache_t { + struct mmap_cache_entry_t *entry; + void (*free_fn)(struct tcb *, const char *caller); + unsigned int size; + unsigned int generation; +}; + +struct mmap_cache_entry_t { + /** + * example entry: + * 7fabbb09b000-7fabbb09f000 r-xp 00179000 fc:00 1180246 /lib/libc-2.11.1.so + * + * start_addr is 0x7fabbb09b000 + * end_addr is 0x7fabbb09f000 + * mmap_offset is 0x179000 + * protections is MMAP_CACHE_PROT_READABLE|MMAP_CACHE_PROT_EXECUTABLE + * major is 0xfc + * minor is 0x00 + * binary_filename is "/lib/libc-2.11.1.so" + */ + unsigned long start_addr; + unsigned long end_addr; + unsigned long mmap_offset; + unsigned char protections; + unsigned long major, minor; + char *binary_filename; +}; + +enum mmap_cache_protection { + MMAP_CACHE_PROT_READABLE = 1 << 0, + MMAP_CACHE_PROT_WRITABLE = 1 << 1, + MMAP_CACHE_PROT_EXECUTABLE = 1 << 2, + MMAP_CACHE_PROT_SHARED = 1 << 3, +}; + +enum mmap_cache_rebuild_result { + MMAP_CACHE_REBUILD_NOCACHE, + MMAP_CACHE_REBUILD_READY, + MMAP_CACHE_REBUILD_RENEWED, +}; + +typedef bool (*mmap_cache_search_fn)(struct mmap_cache_entry_t *, void *); + +extern void +mmap_cache_enable(void); + +extern enum mmap_cache_rebuild_result +mmap_cache_rebuild_if_invalid(struct tcb *, const char *caller); + +extern struct mmap_cache_entry_t * +mmap_cache_search(struct tcb *, unsigned long ip); + +extern struct mmap_cache_entry_t * +mmap_cache_search_custom(struct tcb *, mmap_cache_search_fn, void *); + +#endif /* !STRACE_MMAP_CACHE_H */ diff --git a/mmap_notify.c b/mmap_notify.c new file mode 100644 index 00000000..5fb71ced --- /dev/null +++ b/mmap_notify.c @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018 The strace developers. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "mmap_notify.h" + +struct mmap_notify_client { + mmap_notify_fn fn; + void *data; + struct mmap_notify_client *next; +}; + +static struct mmap_notify_client *clients; + +void +mmap_notify_register_client(mmap_notify_fn fn, void *data) +{ + struct mmap_notify_client *client = xmalloc(sizeof(*client)); + client->fn = fn; + client->data = data; + client->next = clients; + clients = client; +} + +void +mmap_notify_report(struct tcb *tcp) +{ + struct mmap_notify_client *client; + + for (client = clients; client; client = client->next) + client->fn(tcp, client->data); +} diff --git a/mmap_notify.h b/mmap_notify.h new file mode 100644 index 00000000..e0272ce7 --- /dev/null +++ b/mmap_notify.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2018 The strace developers. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_MMAP_NOTIFY_H +# define STRACE_MMAP_NOTIFY_H + +# include "defs.h" + +typedef void (*mmap_notify_fn)(struct tcb *, void *); + +extern void +mmap_notify_register_client(mmap_notify_fn, void *); + +extern void +mmap_notify_report (struct tcb *); + +#endif /* !STRACE_MMAP_NOTIFY_H */ diff --git a/mmsghdr.c b/mmsghdr.c index c9e6cf0b..3fede19f 100644 --- a/mmsghdr.c +++ b/mmsghdr.c @@ -3,47 +3,24 @@ * Copyright (c) 2012-2013 Denys Vlasenko * Copyright (c) 2014 Masatake YAMATO * Copyright (c) 2010-2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" #include "msghdr.h" +#include "xstring.h" #include -static int -fetch_struct_mmsghdr_or_printaddr(struct tcb *const tcp, +static bool +fetch_struct_mmsghdr_for_print(struct tcb *const tcp, const kernel_ulong_t addr, const unsigned int len, void *const mh) { - if ((entering(tcp) || !syserror(tcp)) - && fetch_struct_mmsghdr(tcp, addr, mh)) { - return 0; - } else { - printaddr(addr); - return -1; - } + return (entering(tcp) || !syserror(tcp)) && + fetch_struct_mmsghdr(tcp, addr, mh); } struct print_struct_mmsghdr_config { @@ -144,7 +121,7 @@ decode_mmsgvec(struct tcb *const tcp, const kernel_ulong_t addr, } print_array(tcp, addr, vlen, &mmsg, sizeof_struct_mmsghdr(), - fetch_struct_mmsghdr_or_printaddr, + fetch_struct_mmsghdr_for_print, print_struct_mmsghdr, &c); } @@ -198,14 +175,16 @@ SYS_FUNC(sendmmsg) return 0; } -SYS_FUNC(recvmmsg) +static int +do_recvmmsg(struct tcb *const tcp, const print_obj_by_addr_fn print_ts, + const sprint_obj_by_addr_fn sprint_ts) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); tprints(", "); if (verbose(tcp)) { save_mmsgvec_namelen(tcp, tcp->u_arg[1], tcp->u_arg[2], - sprint_timespec(tcp, tcp->u_arg[4])); + sprint_ts(tcp, tcp->u_arg[4])); } else { /* msgvec */ printaddr(tcp->u_arg[1]); @@ -214,7 +193,7 @@ SYS_FUNC(recvmmsg) /* flags */ printflags(msg_flags, tcp->u_arg[3], "MSG_???"); tprints(", "); - print_timespec(tcp, tcp->u_arg[4]); + print_ts(tcp, tcp->u_arg[4]); } return 0; } else { @@ -240,9 +219,20 @@ SYS_FUNC(recvmmsg) return 0; /* timeout on exit */ static char str[sizeof("left") + TIMESPEC_TEXT_BUFSIZE]; - snprintf(str, sizeof(str), "left %s", - sprint_timespec(tcp, tcp->u_arg[4])); + xsprintf(str, "left %s", sprint_ts(tcp, tcp->u_arg[4])); tcp->auxstr = str; return RVAL_STR; } } + +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(recvmmsg_time32) +{ + return do_recvmmsg(tcp, print_timespec32, sprint_timespec32); +} +#endif + +SYS_FUNC(recvmmsg_time64) +{ + return do_recvmmsg(tcp, print_timespec64, sprint_timespec64); +} diff --git a/mount.c b/mount.c index 997452cc..3ab392f1 100644 --- a/mount.c +++ b/mount.c @@ -5,29 +5,10 @@ * Copyright (c) 1996-1999 Wichert Akkerman * Copyright (c) 2005 Roland McGrath * Copyright (c) 2007-2015 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -69,7 +50,7 @@ SYS_FUNC(mount) tprints(", "); if (old_magic) { - tprints("MS_MGC_VAL"); + print_xlat(MS_MGC_VAL); if (flags) tprints("|"); } diff --git a/mpers.am b/mpers.am index 1e3c7506..87387967 100644 --- a/mpers.am +++ b/mpers.am @@ -1,2 +1,2 @@ # Generated by ./generate_mpers_am.sh; do not edit. -mpers_source_files = block.c btrfs.c dirent.c evdev.c fetch_seccomp_fprog.c fetch_struct_flock.c fetch_struct_mmsghdr.c fetch_struct_msghdr.c fetch_struct_stat.c fetch_struct_stat64.c fetch_struct_statfs.c hdio.c ipc_msgctl.c ipc_shmctl.c loop.c mtd.c print_mq_attr.c print_msgbuf.c print_sg_req_info.c print_sigevent.c print_time.c print_timespec.c print_timeval.c print_timex.c printrusage.c printsiginfo.c rtc.c sg_io_v3.c sigaltstack.c sock.c sysinfo.c times.c ustat.c utime.c v4l2.c +mpers_source_files = block.c btrfs.c dirent.c evdev_mpers.c fetch_bpf_fprog.c fetch_struct_flock.c fetch_struct_keyctl_kdf_params.c fetch_struct_mmsghdr.c fetch_struct_msghdr.c fetch_struct_stat.c fetch_struct_stat64.c fetch_struct_statfs.c fetch_struct_xfs_quotastat.c hdio.c ipc_msgctl.c ipc_shmctl.c loop.c mtd.c perf_ioctl.c print_aio_sigset.c print_group_req.c print_mq_attr.c print_msgbuf.c print_sg_req_info.c print_sigevent.c print_time.c print_timespec.c print_timeval.c printrusage.c printsiginfo.c rt_sigreturn.c rtc.c sg_io_v3.c sigaltstack.c sock.c sysinfo.c times.c ustat.c utime.c v4l2.c diff --git a/mpers.awk b/mpers.awk index 2283b966..17f8f2bf 100644 --- a/mpers.awk +++ b/mpers.awk @@ -2,40 +2,15 @@ # # Copyright (c) 2015 Elvira Khabirova # Copyright (c) 2015-2016 Dmitry V. Levin +# Copyright (c) 2015-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: LGPL-2.1-or-later -function compare_indices(i1, v1, i2, v2) { - c1 = strtonum(sprintf("%s", i1)) - c2 = strtonum(sprintf("%s", i2)) - if (c1 < c2) - return -1 - return (c1 != c2) -} -function array_get(array_idx, array_member, array_return) +function array_get(array_idx, array_member, \ + array_return) { - array_return = array[array_idx][array_member] + array_return = array[array_idx, array_member] if ("" == array_return) { printf("%s: index [%s] without %s\n", FILENAME, array_idx, array_member) > "/dev/stderr" @@ -43,15 +18,20 @@ function array_get(array_idx, array_member, array_return) } return array_return } +function norm_idx(idx) +{ + return sprintf("%016s", idx) +} function array_seq(array_idx) { - if ("seq" in array[array_idx]) - return array[array_idx]["seq"] + if ((array_idx, "seq") in array) + return array[array_idx, "seq"] index_seq++ - array[array_idx]["seq"] = index_seq + array[array_idx, "seq"] = index_seq return index_seq } -function enter(array_idx) +function enter(array_idx, + item) { if (array_idx in called) { printf("%s: index loop detected:", FILENAME) > "/dev/stderr" @@ -67,69 +47,66 @@ 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) +function update_upper_bound(idx, val, \ + count) +{ + count = array[idx, "count"] + if (count == "") + count = 1 + array[idx, "count"] = count * val + array[idx, "upper_bound"] = array[idx, "upper_bound"] "[" val "]" +} +function what_is(what_idx, \ + item, loc_diff, location, prev_location, prev_returned_size, \ + special, to_return, type_idx, enc, i) { enter(what_idx) special = array_get(what_idx, "special") - switch (special) { - case "base_type": - switch (array_get(what_idx, "encoding")) { - case 5: # signed + if (special == "base_type") { + enc = array_get(what_idx, "encoding") + if (enc == 5) { # signed printf("int%s_t ", 8 * array_get(what_idx, "byte_size")) - break - case 7: # unsigned + } else if (enc == 7) { # unsigned printf("uint%s_t ", 8 * array_get(what_idx, "byte_size")) - break - default: # float, signed/unsigned char + } else { # float, signed/unsigned char printf("%s ", array_get(what_idx, "name")) - break } returned_size = array_get(what_idx, "byte_size") - break - case "enumeration_type": + } else if (special == "enumeration_type") { returned_size = array_get(what_idx, "byte_size") printf("uint%s_t ", 8 * returned_size) - break - case "pointer_type": + } else if (special == "pointer_type") { printf("mpers_ptr_t ") returned_size = array_get(what_idx, "byte_size") - break - case "array_type": + } else if (special == "array_type") { type_idx = array_get(what_idx, "type") what_is(type_idx) - to_return = array[what_idx]["upper_bound"] + to_return = array[what_idx, "upper_bound"] if ("" == to_return) - to_return = 0 - returned_size = to_return * returned_size + to_return = "[0]" + returned_size = array[what_idx, "count"] * returned_size return leave(what_idx, to_return) - break - case "structure_type": + } else if (special == "structure_type") { print "struct {" prev_location = 0 location = 0 returned_size = 0 prev_returned_size = 0 - for (item in array) { - if ("parent" in array[item] && \ - array_get(item, "parent") == what_idx) { - location = array_get(item, "location") + for (i = 1; i <= parents_cnt; i += 1) { + if (array_parents[aparents_keys[i]] == what_idx) { + location = array_get(aparents_keys[i], "location") loc_diff = location - prev_location - \ prev_returned_size if (loc_diff != 0) { printf("unsigned char mpers_%s_%s[%s];\n", - "filler", array_seq(item), loc_diff) + "filler", array_seq(aparents_keys[i]), loc_diff) } prev_location = location - returned = what_is(item) + returned = what_is(aparents_keys[i]) prev_returned_size = returned_size - printf("%s", array[item]["name"]) - if ("" != returned) { - printf("[%s]", returned) - } - print ";" + printf("%s%s;\n", array[aparents_keys[i], "name"], returned) } } returned_size = array_get(what_idx, "byte_size") @@ -139,101 +116,98 @@ function what_is(what_idx, type_idx, special, item, \ "end_filler", array_seq(item), loc_diff) } printf("} ATTRIBUTE_PACKED ") - break - case "union_type": + } else if (special == "union_type") { print "union {" - for (item in array) { - if ("parent" in array[item] && \ - array_get(item, "parent") == what_idx) { - returned = what_is(item) - printf("%s", array[item]["name"]) - if ("" != returned) { - printf("[%s]", returned) - } - print ";" + for (i = 1; i <= parents_cnt; i += 1) { + if (array_parents[aparents_keys[i]] == what_idx) { + returned = what_is(aparents_keys[i]) + printf("%s%s;\n", array[aparents_keys[i], "name"], returned) } } printf("} ") returned_size = array_get(what_idx, "byte_size") - break - case "typedef": + } else if (special == "typedef") { type_idx = array_get(what_idx, "type") return leave(what_idx, what_is(type_idx)) - break - case "member": + } else if (special == "member") { type_idx = array_get(what_idx, "type") return leave(what_idx, what_is(type_idx)) - break - default: + } else { type_idx = array_get(what_idx, "type") what_is(type_idx) - break } return leave(what_idx, "") } BEGIN { match(ARCH_FLAG, /[[:digit:]]+/, temparray) default_pointer_size = temparray[0] / 8 - print "#include " + print "#include " } /^<[[:xdigit:]]+>/ { match($0, /([[:alnum:]]+)><([[:alnum:]]+)/, matches) level = matches[1] - idx = "0x" matches[2] - array[idx]["idx"] = idx + idx = norm_idx(matches[2]) + array[idx, "idx"] = idx parent[level] = idx } /^DW_AT_data_member_location/ { if (!match($0, /\(DW_OP_plus_uconst:[[:space:]]+([[:digit:]]+)\)/, temparray)) match($0, /([[:digit:]]+)/, temparray) - array[idx]["location"] = temparray[1] + array[idx, "location"] = temparray[1] } /^DW_AT_name/ { match($0, /:[[:space:]]+([[:alpha:]_][[:alnum:]_[:space:]]*)/, \ temparray) - array[idx]["name"] = temparray[1] + array_names[idx] = 1 + array[idx, "name"] = temparray[1] } /^DW_AT_byte_size/ { match($0, /[[:digit:]]+/, temparray) - array[idx]["byte_size"] = temparray[0] + array[idx, "byte_size"] = temparray[0] } /^DW_AT_encoding/ { match($0, /[[:digit:]]+/, temparray) - array[idx]["encoding"] = temparray[0] + array[idx, "encoding"] = temparray[0] } /^DW_AT_type/ { - match($0, /:[[:space:]]+<(0x[[:xdigit:]]*)>$/, temparray) - array[idx]["type"] = temparray[1] + match($0, /:[[:space:]]+<0x([[:xdigit:]]*)>$/, temparray) + array[idx, "type"] = norm_idx(temparray[1]) } /^DW_AT_upper_bound/ { match($0, /[[:digit:]]+/, temparray) - array[parent[level-1]]["upper_bound"] = temparray[0] + 1 + update_upper_bound(parent[level - 1], temparray[0] + 1) } /^DW_AT_count/ { match($0, /[[:digit:]]+/, temparray) - array[parent[level-1]]["upper_bound"] = temparray[0] + update_upper_bound(parent[level - 1], temparray[0]) } /^Abbrev Number:[^(]+\(DW_TAG_/ { if (match($0, /typedef|union_type|structure_type|pointer_type\ |enumeration_type|array_type|base_type|member/, temparray)) { - array[idx]["special"] = temparray[0] + array_special[idx] = temparray[0] + array[idx, "special"] = temparray[0] if ("pointer_type" == temparray[0]) - array[idx]["byte_size"] = default_pointer_size + array[idx, "byte_size"] = default_pointer_size if (level > 1 && "member" == temparray[0]) - array[idx]["parent"] = parent[level-1] + array_parents[idx] = parent[level-1] } } END { - PROCINFO["sorted_in"] = "compare_indices" - for (item in array) { - if (array[item]["special"] == "pointer_type") { - print "typedef uint" \ - 8 * array_get(item, "byte_size") "_t mpers_ptr_t;" + parents_cnt = asorti(array_parents, aparents_keys) + + for (item in array_special) { + if (array[item, "special"] == "pointer_type") { + mpers_ptr_t = \ + "uint" 8 * array_get(item, "byte_size") "_t" + print "#ifndef mpers_ptr_t_is_" mpers_ptr_t + print "typedef " mpers_ptr_t " mpers_ptr_t;" + print "#define mpers_ptr_t_is_" mpers_ptr_t + print "#endif" break } } - for (item in array) { - if (array[item]["name"] == VAR_NAME) { + for (item in array_names) { + if (array[item, "name"] == VAR_NAME) { type = array_get(item, "type") print "typedef" what_is(type) diff --git a/mpers.sh b/mpers.sh index 36913e7d..763198f3 100755 --- a/mpers.sh +++ b/mpers.sh @@ -1,43 +1,28 @@ #!/bin/sh -e # # Copyright (c) 2015 Elvira Khabirova +# Copyright (c) 2015-2019 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: LGPL-2.1-or-later + +[ "x${D:-0}" != x1 ] || set -x export LC_ALL=C MPERS_AWK="${0%/*}/mpers.awk" ARCH_FLAG=$1 -PARSER_FILE=$2 +CC_ARCH_FLAG=$2 +PARSER_FILE=$3 +READELF="${READELF:-readelf}" CC="${CC-gcc}" CFLAGS="$CFLAGS -gdwarf-2 -c" CPP="${CPP-$CC -E}" CPPFLAGS="$CPPFLAGS -MM -MG" VAR_NAME='mpers_target_var' -BITS_DIR="mpers${ARCH_FLAG}" +BITS_DIR="mpers-${ARCH_FLAG}" mkdir -p ${BITS_DIR} set -- $(sed -r -n \ @@ -60,8 +45,8 @@ for m_type; do grep -F -q "${m_type}.h" "${f_i}" || continue sed -i -e '/DEF_MPERS_TYPE/d' "${f_c}" - $CC $CFLAGS $ARCH_FLAG "${f_c}" -o "${f_o}" - readelf --debug-dump=info "${f_o}" > "${f_d1}" + $CC $CFLAGS $CC_ARCH_FLAG "${f_c}" -o "${f_o}" + $READELF --debug-dump=info "${f_o}" > "${f_d1}" sed -r -n ' /^[[:space:]]*<1>/,/^[[:space:]]*<1><[^>]+>: Abbrev Number: 0/!d /^[[:space:]]*<[^>]*><[^>]*>: Abbrev Number: 0/d @@ -69,6 +54,6 @@ for m_type; do s/^[[:space:]]*((<[[:xdigit:]]+>){2}):[[:space:]]+/\1\n/ s/[[:space:]]+$// p' "${f_d1}" > "${f_d2}" - gawk -v VAR_NAME="$VAR_NAME" -v ARCH_FLAG="${ARCH_FLAG#-}" \ + gawk -v VAR_NAME="$VAR_NAME" -v ARCH_FLAG="${ARCH_FLAG}" \ -f "$MPERS_AWK" "${f_d2}" > "${f_h}" done diff --git a/mpers_test.sh b/mpers_test.sh index 907460b8..110ce092 100755 --- a/mpers_test.sh +++ b/mpers_test.sh @@ -2,31 +2,15 @@ # # Copyright (c) 2015 Elvira Khabirova # Copyright (c) 2015 Dmitry V. Levin +# Copyright (c) 2015-2019 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: LGPL-2.1-or-later + +[ "x${D:-0}" != x1 ] || set -x mpers_name="$1"; shift +mpers_cc_flags="$1"; shift size="$(printf %s "$mpers_name" |tr -cd '[0-9]')" [ "$size" -gt 0 ] @@ -56,7 +40,7 @@ typedef struct { long long sll __attribute__((__aligned__(8))); unsigned long long ull; unsigned long ul; - long asl[3]; + long asl[3][5][7]; char f; /* unsigned char mpers_end_filler_4[7]; */ } s; @@ -68,20 +52,24 @@ typedef struct { unsigned long ul; int si; unsigned ui; - short ss; - unsigned short us; + short ss[7][9]; + unsigned short us[4]; char sc; unsigned char uc; - } u[3]; + } u[3][2]; short f[0]; } sample_struct; #include MPERS_DEFS EOF expected="$mpers_dir/sample.expected" +mpers_ptr_t="uint${size}_t" cat > "$expected" < -typedef uint${size}_t mpers_ptr_t; +#include +#ifndef mpers_ptr_t_is_${mpers_ptr_t} +typedef ${mpers_ptr_t} mpers_ptr_t; +#define mpers_ptr_t_is_${mpers_ptr_t} +#endif typedef struct { struct { @@ -99,7 +87,7 @@ unsigned char mpers_filler_3[6]; int64_t sll; uint64_t ull; uint${size}_t ul; -int${size}_t asl[3]; +int${size}_t asl[3][5][7]; char f; unsigned char mpers_end_filler_4[7]; } ATTRIBUTE_PACKED s; @@ -111,11 +99,11 @@ int${size}_t sl; uint${size}_t ul; int32_t si; uint32_t ui; -int16_t ss; -uint16_t us; +int16_t ss[7][9]; +uint16_t us[4]; char sc; unsigned char uc; -} u[3]; +} u[3][2]; int16_t f[0]; } ATTRIBUTE_PACKED ${mpers_name}_sample_struct; #define MPERS_${mpers_name}_sample_struct ${mpers_name}_sample_struct @@ -123,5 +111,5 @@ EOF CFLAGS="$CPPFLAGS -I${srcdir} -DMPERS_IS_${mpers_name}" \ CPPFLAGS="$CPPFLAGS -I${srcdir} -DIN_MPERS -DMPERS_IS_${mpers_name}" \ -"$mpers_sh" "-$mpers_name" "$sample" +"$mpers_sh" "$mpers_name" "$mpers_cc_flags" "$sample" cmp "$expected" "$mpers_dir"/sample_struct.h > /dev/null diff --git a/mpers_type.h b/mpers_type.h index ac840adb..111947c3 100644 --- a/mpers_type.h +++ b/mpers_type.h @@ -1,52 +1,35 @@ /* * Copyright (c) 2015 Elvira Khabirova * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #ifndef STRACE_MPERS_TYPE_H -#define STRACE_MPERS_TYPE_H +# define STRACE_MPERS_TYPE_H -#ifdef IN_MPERS -# define STRINGIFY(a) #a -# define DEF_MPERS_TYPE(args) STRINGIFY(args.h) -# ifdef MPERS_IS_m32 -# define MPERS_PREFIX m32_ -# define MPERS_DEFS "m32_type_defs.h" -# elif defined MPERS_IS_mx32 -# define MPERS_PREFIX mx32_ -# define MPERS_DEFS "mx32_type_defs.h" -# endif -#else -# define MPERS_PREFIX -# define DEF_MPERS_TYPE(args) "empty.h" -# if IN_MPERS_BOOTSTRAP -# define MPERS_DEFS "empty.h" +# include "macros.h" + +# ifdef IN_MPERS +# define DEF_MPERS_TYPE(args) STRINGIFY(args.h) +# ifdef MPERS_IS_m32 +# define MPERS_PREFIX m32_ +# define MPERS_DEFS "m32_type_defs.h" +# elif defined MPERS_IS_mx32 +# define MPERS_PREFIX mx32_ +# define MPERS_DEFS "mx32_type_defs.h" +# endif # else -# define MPERS_DEFS "native_defs.h" +# define MPERS_PREFIX +# define DEF_MPERS_TYPE(args) "empty.h" +# if IN_MPERS_BOOTSTRAP +# define MPERS_DEFS "empty.h" +# else +# define MPERS_DEFS "native_defs.h" +# endif +typedef unsigned long mpers_ptr_t; # endif -#endif #endif /* !STRACE_MPERS_TYPE_H */ diff --git a/mpers_xlat.h b/mpers_xlat.h index 52f49641..7ba3cbcc 100644 --- a/mpers_xlat.h +++ b/mpers_xlat.h @@ -1,9 +1,11 @@ +extern const struct xlat block_ioctl_cmds[]; extern const struct xlat blkpg_ops[]; extern const struct xlat btrfs_balance_args[]; extern const struct xlat btrfs_balance_ctl_cmds[]; extern const struct xlat btrfs_balance_flags[]; extern const struct xlat btrfs_balance_state[]; extern const struct xlat btrfs_compress_types[]; +extern const struct xlat btrfs_cont_reading_from_srcdev_mode[]; extern const struct xlat btrfs_defrag_flags[]; extern const struct xlat btrfs_dev_replace_cmds[]; extern const struct xlat btrfs_dev_replace_results[]; @@ -14,6 +16,7 @@ extern const struct xlat btrfs_features_compat[]; extern const struct xlat btrfs_features_compat_ro[]; extern const struct xlat btrfs_features_incompat[]; extern const struct xlat btrfs_key_types[]; +extern const struct xlat btrfs_logical_ino_args_flags[]; extern const struct xlat btrfs_qgroup_ctl_cmds[]; extern const struct xlat btrfs_qgroup_inherit_flags[]; extern const struct xlat btrfs_qgroup_limit_flags[]; @@ -23,18 +26,6 @@ extern const struct xlat btrfs_send_flags[]; extern const struct xlat btrfs_snap_flags_v2[]; extern const struct xlat btrfs_space_info_flags[]; extern const struct xlat btrfs_tree_objectids[]; -extern const struct xlat evdev_autorepeat[]; -extern const struct xlat evdev_ff_status[]; -extern const struct xlat evdev_ff_types[]; -extern const struct xlat evdev_keycode[]; -extern const struct xlat evdev_leds[]; -extern const struct xlat evdev_misc[]; -extern const struct xlat evdev_mtslots[]; -extern const struct xlat evdev_prop[]; -extern const struct xlat evdev_relative_axes[]; -extern const struct xlat evdev_snd[]; -extern const struct xlat evdev_switch[]; -extern const struct xlat evdev_sync[]; extern const struct xlat msgctl_flags[]; extern const struct xlat shmctl_flags[]; extern const struct xlat loop_cmds[]; @@ -46,10 +37,10 @@ extern const struct xlat mtd_type_options[]; extern const struct xlat mtd_flags_options[]; extern const struct xlat mtd_otp_options[]; extern const struct xlat mtd_nandecc_options[]; +extern const struct xlat perf_ioctl_cmds[]; +extern const struct xlat perf_ioctl_flags[]; extern const struct xlat mq_attr_flags[]; extern const struct xlat sigev_value[]; -extern const struct xlat adjtimex_modes[]; -extern const struct xlat adjtimex_status[]; extern const struct xlat audit_arch[]; extern const struct xlat sigbus_codes[]; extern const struct xlat sigchld_codes[]; @@ -67,19 +58,29 @@ extern const struct xlat sg_io_dxfer_direction[]; extern const struct xlat sg_io_flags[]; extern const struct xlat sigaltstack_flags[]; extern const struct xlat iffflags[]; +extern const struct xlat arp_hardware_types[]; +extern const struct xlat v4l2_pix_fmts[]; +extern const struct xlat v4l2_sdr_fmts[]; extern const struct xlat v4l2_device_capabilities_flags[]; extern const struct xlat v4l2_buf_types[]; extern const struct xlat v4l2_format_description_flags[]; extern const struct xlat v4l2_fields[]; extern const struct xlat v4l2_colorspaces[]; +extern const struct xlat v4l2_vbi_flags[]; +extern const struct xlat v4l2_sliced_flags[]; extern const struct xlat v4l2_memories[]; extern const struct xlat v4l2_buf_flags[]; extern const struct xlat v4l2_streaming_capabilities[]; extern const struct xlat v4l2_capture_modes[]; extern const struct xlat v4l2_input_types[]; +extern const struct xlat v4l2_control_classes[]; +extern const struct xlat v4l2_control_id_bases[]; extern const struct xlat v4l2_control_ids[]; +extern const struct xlat v4l2_tuner_types[]; +extern const struct xlat v4l2_tuner_capabilities[]; +extern const struct xlat v4l2_tuner_rxsubchanses[]; +extern const struct xlat v4l2_tuner_audmodes[]; extern const struct xlat v4l2_control_types[]; extern const struct xlat v4l2_control_flags[]; -extern const struct xlat v4l2_control_classes[]; extern const struct xlat v4l2_framesize_types[]; extern const struct xlat v4l2_frameinterval_types[]; diff --git a/mq.c b/mq.c index 5b46d478..a8021a71 100644 --- a/mq.c +++ b/mq.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2004 Ulrich Drepper * Copyright (c) 2005-2015 Dmitry V. Levin + * Copyright (c) 2015-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -42,23 +23,39 @@ SYS_FUNC(mq_open) tprints(", "); printmqattr(tcp, tcp->u_arg[3], false); } - return RVAL_DECODED; + return RVAL_DECODED | RVAL_FD; } -SYS_FUNC(mq_timedsend) +static int +do_mq_timedsend(struct tcb *const tcp, const print_obj_by_addr_fn print_ts) { - tprintf("%d, ", (int) tcp->u_arg[0]); + printfd(tcp, tcp->u_arg[0]); + tprints(", "); printstrn(tcp, tcp->u_arg[1], tcp->u_arg[2]); tprintf(", %" PRI_klu ", %u, ", tcp->u_arg[2], (unsigned int) tcp->u_arg[3]); - print_timespec(tcp, tcp->u_arg[4]); + print_ts(tcp, tcp->u_arg[4]); return RVAL_DECODED; } -SYS_FUNC(mq_timedreceive) +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(mq_timedsend_time32) +{ + return do_mq_timedsend(tcp, print_timespec32); +} +#endif + +SYS_FUNC(mq_timedsend_time64) +{ + return do_mq_timedsend(tcp, print_timespec64); +} + +static int +do_mq_timedreceive(struct tcb *const tcp, const print_obj_by_addr_fn print_ts) { if (entering(tcp)) { - tprintf("%d, ", (int) tcp->u_arg[0]); + printfd(tcp, tcp->u_arg[0]); + tprints(", "); } else { if (syserror(tcp)) printaddr(tcp->u_arg[1]); @@ -66,22 +63,35 @@ SYS_FUNC(mq_timedreceive) printstrn(tcp, tcp->u_arg[1], tcp->u_rval); tprintf(", %" PRI_klu ", ", tcp->u_arg[2]); printnum_int(tcp, tcp->u_arg[3], "%u"); - tprintf(", "); + tprints(", "); /* * Since the timeout parameter is read by the kernel * on entering syscall, it has to be decoded the same way * whether the syscall has failed or not. */ temporarily_clear_syserror(tcp); - print_timespec(tcp, tcp->u_arg[4]); + print_ts(tcp, tcp->u_arg[4]); restore_cleared_syserror(tcp); } return 0; } +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(mq_timedreceive_time32) +{ + return do_mq_timedreceive(tcp, print_timespec32); +} +#endif + +SYS_FUNC(mq_timedreceive_time64) +{ + return do_mq_timedreceive(tcp, print_timespec64); +} + SYS_FUNC(mq_notify) { - tprintf("%d, ", (int) tcp->u_arg[0]); + printfd(tcp, tcp->u_arg[0]); + tprints(", "); print_sigevent(tcp, tcp->u_arg[1]); return RVAL_DECODED; } @@ -89,7 +99,8 @@ SYS_FUNC(mq_notify) SYS_FUNC(mq_getsetattr) { if (entering(tcp)) { - tprintf("%d, ", (int) tcp->u_arg[0]); + printfd(tcp, tcp->u_arg[0]); + tprints(", "); printmqattr(tcp, tcp->u_arg[1], true); tprints(", "); } else { diff --git a/msghdr.c b/msghdr.c index 56ba5498..830c5918 100644 --- a/msghdr.c +++ b/msghdr.c @@ -4,37 +4,22 @@ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-2000 Wichert Akkerman * Copyright (c) 2005-2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" +#include "print_fields.h" #include "msghdr.h" #include #include #include +#define XLAT_MACROS_ONLY +#include "xlat/sock_options.h" +#undef XLAT_MACROS_ONLY #include "xlat/msg_flags.h" #include "xlat/scmvals.h" #include "xlat/ip_cmsg_types.h" @@ -84,8 +69,10 @@ print_scm_creds(struct tcb *tcp, const void *cmsg_data, { const struct ucred *uc = cmsg_data; - tprintf("{pid=%u, uid=%u, gid=%u}", - (unsigned) uc->pid, (unsigned) uc->uid, (unsigned) uc->gid); + PRINT_FIELD_U("{", *uc, pid); + PRINT_FIELD_UID(", ", *uc, uid); + PRINT_FIELD_UID(", ", *uc, gid); + tprints("}"); } static void @@ -95,18 +82,58 @@ print_scm_security(struct tcb *tcp, const void *cmsg_data, print_quoted_string(cmsg_data, data_len, 0); } +static void +print_scm_timestamp_old(struct tcb *tcp, const void *cmsg_data, + const unsigned int data_len) +{ + print_struct_timeval_data_size(cmsg_data, data_len); +} + +static void +print_scm_timestampns_old(struct tcb *tcp, const void *cmsg_data, + const unsigned int data_len) +{ + print_struct_timespec_data_size(cmsg_data, data_len); +} + +static void +print_scm_timestamping_old(struct tcb *tcp, const void *cmsg_data, + const unsigned int data_len) +{ + print_struct_timespec_array_data_size(cmsg_data, 3, data_len); +} + +static void +print_scm_timestamp_new(struct tcb *tcp, const void *cmsg_data, + const unsigned int data_len) +{ + print_timeval64_data_size(cmsg_data, data_len); +} + +static void +print_scm_timestampns_new(struct tcb *tcp, const void *cmsg_data, + const unsigned int data_len) +{ + print_timespec64_data_size(cmsg_data, data_len); +} + +static void +print_scm_timestamping_new(struct tcb *tcp, const void *cmsg_data, + const unsigned int data_len) +{ + print_timespec64_array_data_size(cmsg_data, 3, data_len); +} + static void print_cmsg_ip_pktinfo(struct tcb *tcp, const void *cmsg_data, const unsigned int data_len) { const struct in_pktinfo *info = cmsg_data; - tprints("{ipi_ifindex="); - print_ifindex(info->ipi_ifindex); - tprintf(", ipi_spec_dst=inet_addr(\"%s\")", - inet_ntoa(info->ipi_spec_dst)); - tprintf(", ipi_addr=inet_addr(\"%s\")}", - inet_ntoa(info->ipi_addr)); + PRINT_FIELD_IFINDEX("{", *info, ipi_ifindex); + PRINT_FIELD_INET_ADDR(", ", *info, ipi_spec_dst, AF_INET); + PRINT_FIELD_INET_ADDR(", ", *info, ipi_addr, AF_INET); + tprints("}"); } static void @@ -164,11 +191,13 @@ print_cmsg_ip_recverr(struct tcb *tcp, const void *cmsg_data, { const struct sock_ee *const err = cmsg_data; - tprintf("{ee_errno=%u, ee_origin=%u, ee_type=%u, ee_code=%u" - ", ee_info=%u, ee_data=%u, offender=", - err->ee_errno, err->ee_origin, err->ee_type, - err->ee_code, err->ee_info, err->ee_data); - print_sockaddr(tcp, &err->offender, sizeof(err->offender)); + PRINT_FIELD_U("{", *err, ee_errno); + PRINT_FIELD_U(", ", *err, ee_origin); + PRINT_FIELD_U(", ", *err, ee_type); + PRINT_FIELD_U(", ", *err, ee_code); + PRINT_FIELD_U(", ", *err, ee_info); + PRINT_FIELD_U(", ", *err, ee_data); + PRINT_FIELD_SOCKADDR(", ", *err, offender); tprints("}"); } @@ -180,7 +209,7 @@ print_cmsg_ip_origdstaddr(struct tcb *tcp, const void *cmsg_data, data_len > sizeof(struct sockaddr_storage) ? sizeof(struct sockaddr_storage) : data_len; - print_sockaddr(tcp, cmsg_data, addr_len); + print_sockaddr(cmsg_data, addr_len); } typedef void (* const cmsg_printer)(struct tcb *, const void *, unsigned int); @@ -191,7 +220,13 @@ static const struct { } cmsg_socket_printers[] = { [SCM_RIGHTS] = { print_scm_rights, sizeof(int) }, [SCM_CREDENTIALS] = { print_scm_creds, sizeof(struct ucred) }, - [SCM_SECURITY] = { print_scm_security, 1 } + [SCM_SECURITY] = { print_scm_security, 1 }, + [SO_TIMESTAMP_OLD] = { print_scm_timestamp_old, 1 }, + [SO_TIMESTAMPNS_OLD] = { print_scm_timestampns_old, 1 }, + [SO_TIMESTAMPING_OLD] = { print_scm_timestamping_old, 1 }, + [SO_TIMESTAMP_NEW] = { print_scm_timestamp_new, 1 }, + [SO_TIMESTAMPNS_NEW] = { print_scm_timestampns_new, 1 }, + [SO_TIMESTAMPING_NEW] = { print_scm_timestamping_new, 1 } }, cmsg_ip_printers[] = { [IP_PKTINFO] = { print_cmsg_ip_pktinfo, sizeof(struct in_pktinfo) }, [IP_TTL] = { print_cmsg_uint, sizeof(unsigned int) }, @@ -234,12 +269,12 @@ print_cmsg_type_data(struct tcb *tcp, const int cmsg_level, const int cmsg_type, } static unsigned int -get_optmem_max(void) +get_optmem_max(struct tcb *tcp) { static int optmem_max; if (!optmem_max) { - if (read_int_from_file("/proc/sys/net/core/optmem_max", + if (read_int_from_file(tcp, "/proc/sys/net/core/optmem_max", &optmem_max) || optmem_max <= 0) { optmem_max = sizeof(long long) * (2 * IOV_MAX + 512); } else { @@ -265,8 +300,8 @@ decode_msg_control(struct tcb *const tcp, const kernel_ulong_t addr, #endif sizeof(struct cmsghdr); - unsigned int control_len = in_control_len > get_optmem_max() - ? get_optmem_max() : in_control_len; + unsigned int control_len = in_control_len > get_optmem_max(tcp) + ? get_optmem_max(tcp) : in_control_len; unsigned int buf_len = control_len; char *buf = buf_len < cmsg_size ? NULL : malloc(buf_len); if (!buf || umoven(tcp, addr, buf_len, buf) < 0) { @@ -305,7 +340,7 @@ decode_msg_control(struct tcb *const tcp, const kernel_ulong_t addr, print_cmsg_type_data(tcp, cmsg_level, cmsg_type, (const void *) (u.ptr + cmsg_size), - len > cmsg_size ? len - cmsg_size: 0); + len > cmsg_size ? len - cmsg_size : 0); tprints("}"); if (len < cmsg_size) { @@ -322,8 +357,8 @@ decode_msg_control(struct tcb *const tcp, const kernel_ulong_t addr, buf_len -= len; } if (buf_len) { - tprints(", "); - printaddr(addr + (control_len - buf_len)); + tprints(", ..."); + printaddr_comment(addr + (control_len - buf_len)); } else if (control_len < in_control_len) { tprints(", ..."); } @@ -352,17 +387,15 @@ print_struct_msghdr(struct tcb *tcp, const struct msghdr *msg, tprintf("%d", msg->msg_namelen); tprints(", msg_iov="); - tprint_iov_upto(tcp, msg->msg_iovlen, ptr_to_kulong(msg->msg_iov), decode, data_size); - tprintf(", msg_iovlen=%" PRI_klu, (kernel_ulong_t) msg->msg_iovlen); + PRINT_FIELD_U(", ", *msg, msg_iovlen); decode_msg_control(tcp, ptr_to_kulong(msg->msg_control), msg->msg_controllen); - tprintf(", msg_controllen=%" PRI_klu, (kernel_ulong_t) msg->msg_controllen); + PRINT_FIELD_U(", ", *msg, msg_controllen); - tprints(", msg_flags="); - printflags(msg_flags, msg->msg_flags, "MSG_???"); + PRINT_FIELD_FLAGS(", ", *msg, msg_flags, msg_flags, "MSG_???"); tprints("}"); } diff --git a/msghdr.h b/msghdr.h index 9e458fec..e3dbe6a4 100644 --- a/msghdr.h +++ b/msghdr.h @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2016-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #ifndef STRACE_MSGHDR_H -#define STRACE_MSGHDR_H +# define STRACE_MSGHDR_H /* For definitions of struct msghdr and struct mmsghdr. */ # include diff --git a/mtd.c b/mtd.c index 954a08b7..dc45bf85 100644 --- a/mtd.c +++ b/mtd.c @@ -1,53 +1,33 @@ /* * Copyright (c) 2012 Mike Frysinger + * Copyright (c) 2012-2018 The strace developers. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" -#include DEF_MPERS_TYPE(struct_mtd_oob_buf) +#ifdef HAVE_STRUCT_MTD_WRITE_REQ -#include +# include DEF_MPERS_TYPE(struct_mtd_oob_buf) -/* The mtd api changes quickly, so we have to keep a local copy */ -#include -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) -# include "mtd-abi.h" -#else +# include # include -#endif typedef struct mtd_oob_buf struct_mtd_oob_buf; +#endif /* HAVE_STRUCT_MTD_WRITE_REQ */ + #include MPERS_DEFS -#include "xlat/mtd_mode_options.h" -#include "xlat/mtd_file_mode_options.h" -#include "xlat/mtd_type_options.h" -#include "xlat/mtd_flags_options.h" -#include "xlat/mtd_otp_options.h" -#include "xlat/mtd_nandecc_options.h" +#ifdef HAVE_STRUCT_MTD_WRITE_REQ + +# include "xlat/mtd_mode_options.h" +# include "xlat/mtd_file_mode_options.h" +# include "xlat/mtd_type_options.h" +# include "xlat/mtd_flags_options.h" +# include "xlat/mtd_otp_options.h" +# include "xlat/mtd_nandecc_options.h" static void decode_erase_info_user(struct tcb *const tcp, const kernel_ulong_t addr) @@ -274,7 +254,7 @@ MPERS_PRINTER_DECL(int, mtd_ioctl, struct tcb *const tcp, case OTPGETREGIONINFO: if (entering(tcp)) return 0; - /* fall through */ + ATTRIBUTE_FALLTHROUGH; case OTPLOCK: decode_otp_info(tcp, arg); break; @@ -359,5 +339,7 @@ MPERS_PRINTER_DECL(int, mtd_ioctl, struct tcb *const tcp, return RVAL_DECODED; } - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } + +#endif /* HAVE_STRUCT_MTD_WRITE_REQ */ diff --git a/native_defs.h b/native_defs.h index cdc735e0..c4189a6b 100644 --- a/native_defs.h +++ b/native_defs.h @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #undef MPERS_PRINTER_NAME #define MPERS_PRINTER_NAME(printer_name) printer_name diff --git a/nbd_ioctl.c b/nbd_ioctl.c new file mode 100644 index 00000000..11cc05e6 --- /dev/null +++ b/nbd_ioctl.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "print_fields.h" +#include +#include +#include + +#define XLAT_MACROS_ONLY +#include "xlat/nbd_ioctl_cmds.h" +#undef XLAT_MACROS_ONLY + +#include "xlat/nbd_ioctl_flags.h" + +int +nbd_ioctl(struct tcb *const tcp, const unsigned int code, + const kernel_ulong_t arg) +{ + switch (code) { + case NBD_DISCONNECT: + case NBD_CLEAR_SOCK: + case NBD_DO_IT: + case NBD_CLEAR_QUE: + case NBD_PRINT_DEBUG: + return RVAL_IOCTL_DECODED; + + case NBD_SET_SOCK: + tprints(", "); + printfd(tcp, arg); + return RVAL_IOCTL_DECODED; + + case NBD_SET_BLKSIZE: + case NBD_SET_SIZE: + case NBD_SET_SIZE_BLOCKS: + case NBD_SET_TIMEOUT: + tprints(", "); + tprintf("%" PRI_klu, arg); + return RVAL_IOCTL_DECODED; + + case NBD_SET_FLAGS: + tprints(", "); + printflags(nbd_ioctl_flags, arg, "NBD_IOC_FLAG_???"); + return RVAL_IOCTL_DECODED; + + default: + return RVAL_DECODED; + } +} diff --git a/negated_errno.h b/negated_errno.h new file mode 100644 index 00000000..0e9e9a2e --- /dev/null +++ b/negated_errno.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_NEGATED_ERRNO_H +# define STRACE_NEGATED_ERRNO_H + +/* + * Check the syscall return value register value for whether it is + * a negated errno code indicating an error, or a success return value. + */ +static inline bool +is_negated_errno(kernel_ulong_t val) +{ + kernel_ulong_t max = -(kernel_long_t) MAX_ERRNO_VALUE; + +# ifndef current_klongsize + if (current_klongsize < sizeof(val)) { + val = (uint32_t) val; + max = (uint32_t) max; + } +# endif /* !current_klongsize */ + + return val >= max; +} + +#endif /* !STRACE_NEGATED_ERRNO_H */ diff --git a/net.c b/net.c index 314e02ab..f08691c7 100644 --- a/net.c +++ b/net.c @@ -3,32 +3,15 @@ * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-2000 Wichert Akkerman + * Copyright (c) 1999-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" +#include "print_fields.h" + #include #include #include @@ -55,7 +38,7 @@ #if defined(HAVE_LINUX_IP_VS_H) # include #endif -#include +#include "netlink.h" #if defined(HAVE_LINUX_NETFILTER_ARP_ARP_TABLES_H) # include #endif @@ -80,28 +63,23 @@ #include "xlat/socketlayers.h" #include "xlat/inet_protocols.h" -#include "xlat/netlink_protocols.h" - -#ifdef HAVE_BLUETOOTH_BLUETOOTH_H -# include -# include "xlat/bt_protocols.h" -#endif - -void -print_ifindex(unsigned int ifindex) -{ -#ifdef HAVE_IF_INDEXTONAME - char buf[IFNAMSIZ + 1]; - if (if_indextoname(ifindex, buf)) { - tprints("if_nametoindex("); - print_quoted_string(buf, sizeof(buf), QUOTE_0_TERMINATED); - tprints(")"); - return; - } -#endif - tprintf("%u", ifindex); -} +#define XLAT_MACROS_ONLY +#include "xlat/addrfams.h" +#include "xlat/ethernet_protocols.h" +#undef XLAT_MACROS_ONLY +#include "xlat/ax25_protocols.h" +#include "xlat/irda_protocols.h" +#include "xlat/can_protocols.h" +#include "xlat/bt_protocols.h" +#include "xlat/isdn_protocols.h" +#include "xlat/phonet_protocols.h" +#include "xlat/caif_protocols.h" +#include "xlat/nfc_protocols.h" +#include "xlat/kcm_protocols.h" +#include "xlat/smc_protocols.h" + +const size_t inet_protocols_size = ARRAY_SIZE(inet_protocols) - 1; static void decode_sockbuf(struct tcb *const tcp, const int fd, const kernel_ulong_t addr, @@ -110,7 +88,7 @@ decode_sockbuf(struct tcb *const tcp, const int fd, const kernel_ulong_t addr, switch (verbose(tcp) ? getfdproto(tcp, fd) : SOCK_PROTO_UNKNOWN) { case SOCK_PROTO_NETLINK: - decode_netlink(tcp, addr, addrlen); + decode_netlink(tcp, fd, addr, addrlen); break; default: printstrn(tcp, addr, addrlen); @@ -127,7 +105,7 @@ tprint_sock_type(unsigned int flags) const char *str = xlookup(socktypes, flags & SOCK_TYPE_MASK); if (str) { - tprints(str); + print_xlat_ex(flags & SOCK_TYPE_MASK, str, XLAT_STYLE_DEFAULT); flags &= ~SOCK_TYPE_MASK; if (!flags) return; @@ -145,45 +123,74 @@ SYS_FUNC(socket) switch (tcp->u_arg[0]) { case AF_INET: case AF_INET6: - printxval(inet_protocols, tcp->u_arg[2], "IPPROTO_???"); + printxval_search(inet_protocols, tcp->u_arg[2], "IPPROTO_???"); + break; + + case AF_AX25: + /* Those are not available in public headers. */ + printxval_searchn_ex(ARRSZ_PAIR(ax25_protocols) - 1, + tcp->u_arg[2], "AX25_P_???", + XLAT_STYLE_VERBOSE); break; case AF_NETLINK: printxval(netlink_protocols, tcp->u_arg[2], "NETLINK_???"); break; -#ifdef HAVE_BLUETOOTH_BLUETOOTH_H + case AF_PACKET: + tprints("htons("); + printxval_searchn(ethernet_protocols, ethernet_protocols_size, + ntohs(tcp->u_arg[2]), "ETH_P_???"); + tprints(")"); + break; + + case AF_IRDA: + printxval_index(can_protocols, tcp->u_arg[2], "IRDAPROTO_???"); + break; + + case AF_CAN: + printxval_index(can_protocols, tcp->u_arg[2], "CAN_???"); + break; + case AF_BLUETOOTH: - printxval(bt_protocols, tcp->u_arg[2], "BTPROTO_???"); + printxval_index(bt_protocols, tcp->u_arg[2], "BTPROTO_???"); break; -#endif - default: - tprintf("%" PRI_klu, tcp->u_arg[2]); + case AF_RXRPC: + printxval(addrfams, tcp->u_arg[2], "AF_???"); break; - } - return RVAL_DECODED | RVAL_FD; -} + case AF_ISDN: + printxval(isdn_protocols, tcp->u_arg[2], "ISDN_P_???"); + break; -SYS_FUNC(bind) -{ - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - const int addrlen = tcp->u_arg[2]; - decode_sockaddr(tcp, tcp->u_arg[1], addrlen); - tprintf(", %d", addrlen); + case AF_PHONET: + printxval_index(phonet_protocols, tcp->u_arg[2], "PN_PROTO_???"); + break; - return RVAL_DECODED; -} + case AF_CAIF: + printxval_index(caif_protocols, tcp->u_arg[2], "CAIFPROTO_???"); + break; -SYS_FUNC(listen) -{ - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - tprintf("%" PRI_klu, tcp->u_arg[1]); + case AF_NFC: + printxval_index(nfc_protocols, tcp->u_arg[2], + "NFC_SOCKPROTO_???"); + break; - return RVAL_DECODED; + case AF_KCM: + printxval_index(kcm_protocols, tcp->u_arg[2], "KCMPROTO_???"); + break; + + case AF_SMC: + printxval_index(smc_protocols, tcp->u_arg[2], "SMCPROTO_???"); + break; + + default: + tprintf("%" PRI_klu, tcp->u_arg[2]); + break; + } + + return RVAL_DECODED | RVAL_FD; } static bool @@ -347,17 +354,6 @@ SYS_FUNC(recvfrom) return 0; } -#include "xlat/shutdown_modes.h" - -SYS_FUNC(shutdown) -{ - printfd(tcp, tcp->u_arg[0]); - tprints(", "); - printxval(shutdown_modes, tcp->u_arg[1], "SHUT_???"); - - return RVAL_DECODED; -} - SYS_FUNC(getsockname) { return decode_sockname(tcp); @@ -399,7 +395,7 @@ do_pipe(struct tcb *tcp, int flags_arg) SYS_FUNC(pipe) { -#ifdef HAVE_GETRVAL2 +#if HAVE_ARCH_GETRVAL2 if (exiting(tcp) && !syserror(tcp)) printpair_fd(tcp, tcp->u_rval, getrval2(tcp)); return 0; @@ -427,18 +423,39 @@ SYS_FUNC(socketpair) return 0; } -#include "xlat/sockoptions.h" -#include "xlat/sockipoptions.h" -#include "xlat/getsockipoptions.h" -#include "xlat/setsockipoptions.h" -#include "xlat/sockipv6options.h" -#include "xlat/getsockipv6options.h" -#include "xlat/setsockipv6options.h" -#include "xlat/sockipxoptions.h" -#include "xlat/sockrawoptions.h" -#include "xlat/sockpacketoptions.h" -#include "xlat/socksctpoptions.h" -#include "xlat/socktcpoptions.h" +#include "xlat/sock_options.h" +#include "xlat/getsock_options.h" +#include "xlat/setsock_options.h" +#include "xlat/sock_ip_options.h" +#include "xlat/getsock_ip_options.h" +#include "xlat/setsock_ip_options.h" +#include "xlat/sock_ipv6_options.h" +#include "xlat/getsock_ipv6_options.h" +#include "xlat/setsock_ipv6_options.h" +#include "xlat/sock_ipx_options.h" +#include "xlat/sock_ax25_options.h" +#include "xlat/sock_netlink_options.h" +#include "xlat/sock_packet_options.h" +#include "xlat/sock_raw_options.h" +#include "xlat/sock_sctp_options.h" +#include "xlat/sock_tcp_options.h" +#include "xlat/sock_udp_options.h" +#include "xlat/sock_irda_options.h" +#include "xlat/sock_llc_options.h" +#include "xlat/sock_dccp_options.h" +#include "xlat/sock_tipc_options.h" +#include "xlat/sock_rxrpc_options.h" +#include "xlat/sock_pppol2tp_options.h" +#include "xlat/sock_bluetooth_options.h" +#include "xlat/sock_pnp_options.h" +#include "xlat/sock_rds_options.h" +#include "xlat/sock_iucv_options.h" +#include "xlat/sock_caif_options.h" +#include "xlat/sock_alg_options.h" +#include "xlat/sock_nfcllcp_options.h" +#include "xlat/sock_kcm_options.h" +#include "xlat/sock_tls_options.h" +#include "xlat/sock_xdp_options.h" static void print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level, @@ -446,35 +463,96 @@ print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level, { printfd(tcp, fd); tprints(", "); - printxval(socketlayers, level, "SOL_??"); + printxval_search(socketlayers, level, "SOL_??"); tprints(", "); switch (level) { case SOL_SOCKET: - printxval(sockoptions, name, "SO_???"); + printxvals(name, "SO_???", sock_options, + is_getsockopt ? getsock_options : + setsock_options, NULL); break; case SOL_IP: - printxvals(name, "IP_???", sockipoptions, - is_getsockopt ? getsockipoptions : setsockipoptions, NULL); + printxvals(name, "IP_???", sock_ip_options, + is_getsockopt ? getsock_ip_options : + setsock_ip_options, NULL); break; case SOL_IPV6: - printxvals(name, "IPV6_???", sockipv6options, - is_getsockopt ? getsockipv6options : setsockipv6options, NULL); + printxvals(name, "IPV6_???", sock_ipv6_options, + is_getsockopt ? getsock_ipv6_options : + setsock_ipv6_options, NULL); break; case SOL_IPX: - printxval(sockipxoptions, name, "IPX_???"); + printxval(sock_ipx_options, name, "IPX_???"); + break; + case SOL_AX25: + printxval_search(sock_ax25_options, name, "AX25_???"); break; case SOL_PACKET: - printxval(sockpacketoptions, name, "PACKET_???"); + printxval(sock_packet_options, name, "PACKET_???"); break; case SOL_TCP: - printxval(socktcpoptions, name, "TCP_???"); + printxval_index(sock_tcp_options, name, "TCP_???"); break; case SOL_SCTP: - printxval(socksctpoptions, name, "SCTP_???"); + printxval(sock_sctp_options, name, "SCTP_???"); break; case SOL_RAW: - printxval(sockrawoptions, name, "RAW_???"); + printxval(sock_raw_options, name, "RAW_???"); + break; + case SOL_NETLINK: + printxval(sock_netlink_options, name, "NETLINK_???"); + break; + case SOL_UDP: + printxval(sock_udp_options, name, "UDP_???"); + break; + case SOL_IRDA: + printxval_index(sock_irda_options, name, "IRLMP_???"); + break; + case SOL_LLC: + printxval_index(sock_llc_options, name, "LLC_OPT_???"); + break; + case SOL_DCCP: + printxval_search(sock_dccp_options, name, "DCCP_SOCKOPT_???"); + break; + case SOL_TIPC: + printxval_search(sock_tipc_options, name, "TIPC_???"); + break; + case SOL_RXRPC: + printxval_index(sock_rxrpc_options, name, "RXRPC_???"); + break; + case SOL_PPPOL2TP: + printxval_index(sock_pppol2tp_options, name, "PPPOL2TP_SO_???"); + break; + case SOL_BLUETOOTH: + printxval_search(sock_bluetooth_options, name, "BT_???"); + break; + case SOL_PNPIPE: + printxval(sock_pnp_options, name, "PNPIPE_???"); + break; + case SOL_RDS: + printxval_search(sock_rds_options, name, "RDS_???"); + break; + case SOL_IUCV: + printxval(sock_iucv_options, name, "SO_???"); + break; + case SOL_CAIF: + printxval(sock_caif_options, name, "CAIFSO_???"); + break; + case SOL_ALG: + printxval_index(sock_alg_options, name, "ALG_???"); + break; + case SOL_NFC: + printxval_index(sock_nfcllcp_options, name, "NFC_LLCP_???"); + break; + case SOL_KCM: + printxval(sock_kcm_options, name, "KCM_???"); + break; + case SOL_TLS: + printxval(sock_tls_options, name, "TLS_???"); + break; + case SOL_XDP: + printxval_index(sock_xdp_options, name, "XDP_???"); break; /* Other SOL_* protocol levels still need work. */ @@ -487,54 +565,162 @@ print_sockopt_fd_level_name(struct tcb *tcp, int fd, unsigned int level, } static void -print_linger(struct tcb *const tcp, const kernel_ulong_t addr, const int len) +print_get_linger(struct tcb *const tcp, const kernel_ulong_t addr, + unsigned int len) { struct linger linger; - if (len != sizeof(linger) || - umove(tcp, addr, &linger) < 0) { - printaddr(addr); + /* + * The kernel cannot return len > sizeof(linger) because struct linger + * cannot change, but extra safety won't harm either. + */ + if (len > sizeof(linger)) + len = sizeof(linger); + if (umoven_or_printaddr(tcp, addr, len, &linger)) return; - } - tprintf("{onoff=%d, linger=%d}", - linger.l_onoff, - linger.l_linger); + if (len < sizeof(linger.l_onoff)) { + tprints("{l_onoff="); + print_quoted_string((void *) &linger.l_onoff, + len, QUOTE_FORCE_HEX); + } else { + PRINT_FIELD_D("{", linger, l_onoff); + + if (len > offsetof(struct linger, l_linger)) { + len -= offsetof(struct linger, l_linger); + if (len < sizeof(linger.l_linger)) { + tprints(", l_linger="); + print_quoted_string((void *) &linger.l_linger, + len, QUOTE_FORCE_HEX); + } else { + PRINT_FIELD_D(", ", linger, l_linger); + } + } + } + tprints("}"); } -#ifdef SO_PEERCRED static void -print_ucred(struct tcb *const tcp, const kernel_ulong_t addr, const int len) +print_get_ucred(struct tcb *const tcp, const kernel_ulong_t addr, + unsigned int len) { struct ucred uc; - if (len != sizeof(uc) || - umove(tcp, addr, &uc) < 0) { - printaddr(addr); + /* + * The kernel is very unlikely to return len > sizeof(uc) + * because struct ucred is very unlikely to change, + * but extra safety won't harm either. + */ + if (len > sizeof(uc)) + len = sizeof(uc); + + if (umoven_or_printaddr(tcp, addr, len, &uc)) + return; + + if (len < sizeof(uc.pid)) { + tprints("{pid="); + print_quoted_string((void *) &uc.pid, + len, QUOTE_FORCE_HEX); } else { - tprintf("{pid=%u, uid=%u, gid=%u}", - (unsigned) uc.pid, - (unsigned) uc.uid, - (unsigned) uc.gid); + PRINT_FIELD_D("{", uc, pid); + + if (len > offsetof(struct ucred, uid)) { + len -= offsetof(struct ucred, uid); + if (len < sizeof(uc.uid)) { + tprints(", uid="); + print_quoted_string((void *) &uc.uid, + len, QUOTE_FORCE_HEX); + } else { + PRINT_FIELD_UID(", ", uc, uid); + + if (len > offsetof(struct ucred, gid) - + offsetof(struct ucred, uid)) { + len -= offsetof(struct ucred, gid) - + offsetof(struct ucred, uid); + if (len < sizeof(uc.gid)) { + tprints(", gid="); + print_quoted_string((void *) &uc.gid, + len, + QUOTE_FORCE_HEX); + } else { + PRINT_FIELD_UID(", ", uc, gid); + } + } + } + } } + tprints("}"); +} + +static void +print_get_error(struct tcb *const tcp, const kernel_ulong_t addr, + unsigned int len) +{ + unsigned int err; + + if (len > sizeof(err)) + err = sizeof(err); + + if (umoven_or_printaddr(tcp, addr, len, &err)) + return; + + tprints("["); + print_xlat_ex(err, err_name(err), XLAT_STYLE_FMT_U); + tprints("]"); } -#endif /* SO_PEERCRED */ #ifdef PACKET_STATISTICS static void print_tpacket_stats(struct tcb *const tcp, const kernel_ulong_t addr, - const int len) + unsigned int len) { - struct tpacket_stats stats; + struct tp_stats { + unsigned int tp_packets, tp_drops, tp_freeze_q_cnt; + } stats; + + /* + * The kernel may return len > sizeof(stats) if the kernel structure + * grew as it happened when tpacket_stats_v3 was introduced. + */ + if (len > sizeof(stats)) + len = sizeof(stats); + + if (umoven_or_printaddr(tcp, addr, len, &stats)) + return; - if (len != sizeof(stats) || - umove(tcp, addr, &stats) < 0) { - printaddr(addr); + if (len < sizeof(stats.tp_packets)) { + tprints("{tp_packets="); + print_quoted_string((void *) &stats.tp_packets, + len, QUOTE_FORCE_HEX); } else { - tprintf("{packets=%u, drops=%u}", - stats.tp_packets, - stats.tp_drops); + PRINT_FIELD_U("{", stats, tp_packets); + + if (len > offsetof(struct tp_stats, tp_drops)) { + len -= offsetof(struct tp_stats, tp_drops); + if (len < sizeof(stats.tp_drops)) { + tprints(", tp_drops="); + print_quoted_string((void *) &stats.tp_drops, + len, QUOTE_FORCE_HEX); + } else { + PRINT_FIELD_U(", ", stats, tp_drops); + + if (len > offsetof(struct tp_stats, tp_freeze_q_cnt) - + offsetof(struct tp_stats, tp_drops)) { + len -= offsetof(struct tp_stats, tp_freeze_q_cnt) - + offsetof(struct tp_stats, tp_drops); + if (len < sizeof(stats.tp_freeze_q_cnt)) { + tprints(", tp_freeze_q_cnt="); + print_quoted_string((void *) &stats.tp_freeze_q_cnt, + len, + QUOTE_FORCE_HEX); + } else { + PRINT_FIELD_U(", ", stats, tp_freeze_q_cnt); + } + } + } + } } + tprints("}"); } #endif /* PACKET_STATISTICS */ @@ -563,20 +749,44 @@ print_icmp_filter(struct tcb *const tcp, const kernel_ulong_t addr, int len) static void print_getsockopt(struct tcb *const tcp, const unsigned int level, const unsigned int name, const kernel_ulong_t addr, - const int len) + const int ulen, const int rlen) { + if (ulen <= 0 || rlen <= 0) { + /* + * As the kernel neither accepts nor returns a negative + * length in case of successful getsockopt syscall + * invocation, negative values must have been forged + * by userspace. + */ + printaddr(addr); + return; + } + if (addr && verbose(tcp)) switch (level) { case SOL_SOCKET: switch (name) { case SO_LINGER: - print_linger(tcp, addr, len); - goto done; -#ifdef SO_PEERCRED + print_get_linger(tcp, addr, rlen); + return; case SO_PEERCRED: - print_ucred(tcp, addr, len); - goto done; -#endif + print_get_ucred(tcp, addr, rlen); + return; + case SO_ATTACH_FILTER: + /* + * The length returned by the kernel in case of + * successful getsockopt syscall invocation is struct + * sock_fprog.len that has type unsigned short, + * anything else must have been forged by userspace. + */ + if ((unsigned short) rlen == (unsigned int) rlen) + print_sock_fprog(tcp, addr, rlen); + else + printaddr(addr); + return; + case SO_ERROR: + print_get_error(tcp, addr, rlen); + return; } break; @@ -584,8 +794,8 @@ print_getsockopt(struct tcb *const tcp, const unsigned int level, switch (name) { #ifdef PACKET_STATISTICS case PACKET_STATISTICS: - print_tpacket_stats(tcp, addr, len); - goto done; + print_tpacket_stats(tcp, addr, rlen); + return; #endif } break; @@ -593,120 +803,124 @@ print_getsockopt(struct tcb *const tcp, const unsigned int level, case SOL_RAW: switch (name) { case ICMP_FILTER: - print_icmp_filter(tcp, addr, len); - goto done; + print_icmp_filter(tcp, addr, rlen); + return; } break; + + case SOL_NETLINK: + switch (name) { + case NETLINK_LIST_MEMBERSHIPS: { + uint32_t buf; + print_array(tcp, addr, MIN(ulen, rlen) / sizeof(buf), + &buf, sizeof(buf), + tfetch_mem, print_uint32_array_member, 0); + break; + } + default: + printnum_int(tcp, addr, "%d"); + break; + } + return; } /* default arg printing */ if (verbose(tcp)) { - if (len == sizeof(int)) { + if (rlen == sizeof(int)) { printnum_int(tcp, addr, "%d"); } else { - printstrn(tcp, addr, len); + printstrn(tcp, addr, rlen); } } else { printaddr(addr); } -done: - tprintf(", [%d]", len); } SYS_FUNC(getsockopt) { + int ulen, rlen; + if (entering(tcp)) { print_sockopt_fd_level_name(tcp, tcp->u_arg[0], tcp->u_arg[1], tcp->u_arg[2], true); - } else { - int len; - if (syserror(tcp) || umove(tcp, tcp->u_arg[4], &len) < 0) { + if (verbose(tcp) && tcp->u_arg[4] + && umove(tcp, tcp->u_arg[4], &ulen) == 0) { + set_tcb_priv_ulong(tcp, ulen); + return 0; + } else { printaddr(tcp->u_arg[3]); tprints(", "); printaddr(tcp->u_arg[4]); + return RVAL_DECODED; + } + } else { + ulen = get_tcb_priv_ulong(tcp); + + if (syserror(tcp) || umove(tcp, tcp->u_arg[4], &rlen) < 0) { + printaddr(tcp->u_arg[3]); + tprintf(", [%d]", ulen); } else { print_getsockopt(tcp, tcp->u_arg[1], tcp->u_arg[2], - tcp->u_arg[3], len); + tcp->u_arg[3], ulen, rlen); + if (ulen != rlen) + tprintf(", [%d->%d]", ulen, rlen); + else + tprintf(", [%d]", rlen); } } return 0; } +static void +print_set_linger(struct tcb *const tcp, const kernel_ulong_t addr, + const int len) +{ + struct linger linger; + + if (len < (int) sizeof(linger)) { + printaddr(addr); + } else if (!umove_or_printaddr(tcp, addr, &linger)) { + PRINT_FIELD_D("{", linger, l_onoff); + PRINT_FIELD_D(", ", linger, l_linger); + tprints("}"); + } +} + #ifdef IP_ADD_MEMBERSHIP static void print_mreq(struct tcb *const tcp, const kernel_ulong_t addr, - const unsigned int len) + const int len) { struct ip_mreq mreq; - if (len < sizeof(mreq)) { - printstrn(tcp, addr, len); - return; + if (len < (int) sizeof(mreq)) { + printaddr(addr); + } else if (!umove_or_printaddr(tcp, addr, &mreq)) { + PRINT_FIELD_INET_ADDR("{", mreq, imr_multiaddr, AF_INET); + PRINT_FIELD_INET_ADDR(", ", mreq, imr_interface, AF_INET); + tprints("}"); } - if (umove_or_printaddr(tcp, addr, &mreq)) - return; - - tprints("{imr_multiaddr=inet_addr("); - print_quoted_string(inet_ntoa(mreq.imr_multiaddr), - 16, QUOTE_0_TERMINATED); - tprints("), imr_interface=inet_addr("); - print_quoted_string(inet_ntoa(mreq.imr_interface), - 16, QUOTE_0_TERMINATED); - tprints(")}"); } #endif /* IP_ADD_MEMBERSHIP */ #ifdef IPV6_ADD_MEMBERSHIP static void print_mreq6(struct tcb *const tcp, const kernel_ulong_t addr, - const unsigned int len) + const int len) { struct ipv6_mreq mreq; - if (len < sizeof(mreq)) - goto fail; - - if (umove_or_printaddr(tcp, addr, &mreq)) - return; - - const struct in6_addr *in6 = &mreq.ipv6mr_multiaddr; - char address[INET6_ADDRSTRLEN]; - - if (!inet_ntop(AF_INET6, in6, address, sizeof(address))) - goto fail; - - tprints("{ipv6mr_multiaddr=inet_pton("); - print_quoted_string(address, sizeof(address), QUOTE_0_TERMINATED); - tprints("), ipv6mr_interface="); - print_ifindex(mreq.ipv6mr_interface); - tprints("}"); - return; - -fail: - printstrn(tcp, addr, len); -} -#endif /* IPV6_ADD_MEMBERSHIP */ - -#ifdef MCAST_JOIN_GROUP -static void -print_group_req(struct tcb *const tcp, const kernel_ulong_t addr, const int len) -{ - struct group_req greq; - - if (len != sizeof(greq) || - umove(tcp, addr, &greq) < 0) { + if (len < (int) sizeof(mreq)) { printaddr(addr); - return; + } else if (!umove_or_printaddr(tcp, addr, &mreq)) { + PRINT_FIELD_INET_ADDR("{", mreq, ipv6mr_multiaddr, AF_INET6); + PRINT_FIELD_IFINDEX(", ", mreq, ipv6mr_interface); + tprints("}"); } - - tprintf("{gr_interface=%u, gr_group=", greq.gr_interface); - print_sockaddr(tcp, &greq.gr_group, sizeof(greq.gr_group)); - tprints("}"); - } -#endif /* MCAST_JOIN_GROUP */ +#endif /* IPV6_ADD_MEMBERSHIP */ #ifdef PACKET_RX_RING static void @@ -718,12 +932,11 @@ print_tpacket_req(struct tcb *const tcp, const kernel_ulong_t addr, const int le umove(tcp, addr, &req) < 0) { printaddr(addr); } else { - tprintf("{block_size=%u, block_nr=%u, " - "frame_size=%u, frame_nr=%u}", - req.tp_block_size, - req.tp_block_nr, - req.tp_frame_size, - req.tp_frame_nr); + PRINT_FIELD_U("{", req, tp_block_size); + PRINT_FIELD_U(", ", req, tp_block_nr); + PRINT_FIELD_U(", ", req, tp_frame_size); + PRINT_FIELD_U(", ", req, tp_frame_nr); + tprints("}"); } } #endif /* PACKET_RX_RING */ @@ -740,15 +953,13 @@ print_packet_mreq(struct tcb *const tcp, const kernel_ulong_t addr, const int le umove(tcp, addr, &mreq) < 0) { printaddr(addr); } else { - unsigned int i; - - tprintf("{mr_ifindex=%u, mr_type=", mreq.mr_ifindex); - printxval(packet_mreq_type, mreq.mr_type, "PACKET_MR_???"); - tprintf(", mr_alen=%u, mr_address=", mreq.mr_alen); - if (mreq.mr_alen > ARRAY_SIZE(mreq.mr_address)) - mreq.mr_alen = ARRAY_SIZE(mreq.mr_address); - for (i = 0; i < mreq.mr_alen; ++i) - tprintf("%02x", mreq.mr_address[i]); + PRINT_FIELD_IFINDEX("{", mreq, mr_ifindex); + PRINT_FIELD_XVAL(", ", mreq, mr_type, packet_mreq_type, + "PACKET_MR_???"); + PRINT_FIELD_U(", ", mreq, mr_alen); + PRINT_FIELD_MAC_SZ(", ", mreq, mr_address, + (mreq.mr_alen > sizeof(mreq.mr_address) + ? sizeof(mreq.mr_address) : mreq.mr_alen)); tprints("}"); } } @@ -764,8 +975,15 @@ print_setsockopt(struct tcb *const tcp, const unsigned int level, case SOL_SOCKET: switch (name) { case SO_LINGER: - print_linger(tcp, addr, len); - goto done; + print_set_linger(tcp, addr, len); + return; + case SO_ATTACH_FILTER: + case SO_ATTACH_REUSEPORT_CBPF: + if ((unsigned int) len == get_sock_fprog_size()) + decode_sock_fprog(tcp, addr); + else + printaddr(addr); + return; } break; @@ -775,13 +993,13 @@ print_setsockopt(struct tcb *const tcp, const unsigned int level, case IP_ADD_MEMBERSHIP: case IP_DROP_MEMBERSHIP: print_mreq(tcp, addr, len); - goto done; + return; #endif /* IP_ADD_MEMBERSHIP */ #ifdef MCAST_JOIN_GROUP case MCAST_JOIN_GROUP: case MCAST_LEAVE_GROUP: print_group_req(tcp, addr, len); - goto done; + return; #endif /* MCAST_JOIN_GROUP */ } break; @@ -798,8 +1016,14 @@ print_setsockopt(struct tcb *const tcp, const unsigned int level, case IPV6_LEAVE_ANYCAST: # endif print_mreq6(tcp, addr, len); - goto done; + return; #endif /* IPV6_ADD_MEMBERSHIP */ +#ifdef MCAST_JOIN_GROUP + case MCAST_JOIN_GROUP: + case MCAST_LEAVE_GROUP: + print_group_req(tcp, addr, len); + return; +#endif /* MCAST_JOIN_GROUP */ } break; @@ -811,13 +1035,13 @@ print_setsockopt(struct tcb *const tcp, const unsigned int level, case PACKET_TX_RING: # endif print_tpacket_req(tcp, addr, len); - goto done; + return; #endif /* PACKET_RX_RING */ #ifdef PACKET_ADD_MEMBERSHIP case PACKET_ADD_MEMBERSHIP: case PACKET_DROP_MEMBERSHIP: print_packet_mreq(tcp, addr, len); - goto done; + return; #endif /* PACKET_ADD_MEMBERSHIP */ } break; @@ -826,9 +1050,16 @@ print_setsockopt(struct tcb *const tcp, const unsigned int level, switch (name) { case ICMP_FILTER: print_icmp_filter(tcp, addr, len); - goto done; + return; } break; + + case SOL_NETLINK: + if (len < (int) sizeof(int)) + printaddr(addr); + else + printnum_int(tcp, addr, "%d"); + return; } /* default arg printing */ @@ -842,8 +1073,6 @@ print_setsockopt(struct tcb *const tcp, const unsigned int level, } else { printaddr(addr); } -done: - tprintf(", %d", len); } SYS_FUNC(setsockopt) @@ -852,6 +1081,7 @@ SYS_FUNC(setsockopt) tcp->u_arg[1], tcp->u_arg[2], false); print_setsockopt(tcp, tcp->u_arg[1], tcp->u_arg[2], tcp->u_arg[3], tcp->u_arg[4]); + tprintf(", %d", (int) tcp->u_arg[4]); return RVAL_DECODED; } diff --git a/netlink.c b/netlink.c index db6e43f8..a107a175 100644 --- a/netlink.c +++ b/netlink.c @@ -1,101 +1,634 @@ /* * Copyright (c) 2016 Fabien Siron * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" -#include -#include +#include "netlink.h" +#include "nlattr.h" +#include +#include +#include +#include "xlat/netlink_ack_flags.h" +#include "xlat/netlink_delete_flags.h" #include "xlat/netlink_flags.h" +#include "xlat/netlink_get_flags.h" +#include "xlat/netlink_new_flags.h" +#include "xlat/netlink_protocols.h" #include "xlat/netlink_types.h" +#include "xlat/nf_acct_msg_types.h" +#include "xlat/nf_cthelper_msg_types.h" +#include "xlat/nf_ctnetlink_exp_msg_types.h" +#include "xlat/nf_ctnetlink_msg_types.h" +#include "xlat/nf_cttimeout_msg_types.h" +#include "xlat/nf_ipset_msg_types.h" +#include "xlat/nf_nft_compat_msg_types.h" +#include "xlat/nf_nftables_msg_types.h" +#include "xlat/nf_osf_msg_types.h" +#include "xlat/nf_queue_msg_types.h" +#include "xlat/nf_ulog_msg_types.h" +#include "xlat/nl_audit_types.h" +#include "xlat/nl_crypto_types.h" +#include "xlat/nl_netfilter_subsys_ids.h" +#include "xlat/nl_selinux_types.h" +#include "xlat/nl_sock_diag_types.h" +#include "xlat/nl_xfrm_types.h" +#include "xlat/nlmsgerr_attrs.h" /* * Fetch a struct nlmsghdr from the given address. */ static bool fetch_nlmsghdr(struct tcb *const tcp, struct nlmsghdr *const nlmsghdr, - const kernel_ulong_t addr, const kernel_ulong_t len) + const kernel_ulong_t addr, const kernel_ulong_t len, + const bool in_array) { if (len < sizeof(struct nlmsghdr)) { - printstrn(tcp, addr, len); + printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX); return false; } - if (umove_or_printaddr(tcp, addr, nlmsghdr)) - return false; + if (tfetch_obj(tcp, addr, nlmsghdr)) + return true; - return true; + if (in_array) { + tprints("..."); + printaddr_comment(addr); + } else { + printaddr(addr); + } + + return false; +} + +static int +get_fd_nl_family(struct tcb *const tcp, const int fd) +{ + const unsigned long inode = getfdinode(tcp, fd); + if (!inode) + return -1; + + const char *const details = get_sockaddr_by_inode(tcp, fd, inode); + if (!details) + return -1; + + const char *const nl_details = STR_STRIP_PREFIX(details, "NETLINK:["); + if (nl_details == details) + return -1; + + const struct xlat *xlats = netlink_protocols; + for (; xlats->str; ++xlats) { + const char *name = STR_STRIP_PREFIX(xlats->str, "NETLINK_"); + if (!strncmp(nl_details, name, strlen(name))) + return xlats->val; + } + + if (*nl_details >= '0' && *nl_details <= '9') + return atoi(nl_details); + + return -1; +} + +static void +decode_nlmsg_type_default(struct tcb *tcp, const struct xlat *const xlat, + const uint16_t type, + const char *const dflt) +{ + printxval(xlat, type, dflt); +} + +static void +decode_nlmsg_type_generic(struct tcb *tcp, const struct xlat *const xlat, + const uint16_t type, + const char *const dflt) +{ + printxval(genl_families_xlat(tcp), type, dflt); +} + +static const struct { + const struct xlat *const xlat; + const char *const dflt; +} nf_nlmsg_types[] = { + [NFNL_SUBSYS_CTNETLINK] = { + nf_ctnetlink_msg_types, + "IPCTNL_MSG_CT_???" + }, + [NFNL_SUBSYS_CTNETLINK_EXP] = { + nf_ctnetlink_exp_msg_types, + "IPCTNL_MSG_EXP_???" + }, + [NFNL_SUBSYS_QUEUE] = { nf_queue_msg_types, "NFQNL_MSG_???" }, + [NFNL_SUBSYS_ULOG] = { nf_ulog_msg_types, "NFULNL_MSG_???" }, + [NFNL_SUBSYS_OSF] = { nf_osf_msg_types, "OSF_MSG_???" }, + [NFNL_SUBSYS_IPSET] = { nf_ipset_msg_types, "IPSET_CMD_???" }, + [NFNL_SUBSYS_ACCT] = { nf_acct_msg_types, "NFNL_MSG_ACCT_???" }, + [NFNL_SUBSYS_CTNETLINK_TIMEOUT] = { + nf_cttimeout_msg_types, + "IPCTNL_MSG_TIMEOUT_???" + }, + [NFNL_SUBSYS_CTHELPER] = { + nf_cthelper_msg_types, + "NFNL_MSG_CTHELPER_???" + }, + [NFNL_SUBSYS_NFTABLES] = { nf_nftables_msg_types, "NFT_MSG_???" }, + [NFNL_SUBSYS_NFT_COMPAT] = { + nf_nft_compat_msg_types, + "NFNL_MSG_COMPAT_???" + } +}; + +static void +decode_nlmsg_type_netfilter(struct tcb *tcp, const struct xlat *const xlat, + const uint16_t type, + const char *const dflt) +{ + /* Reserved control nfnetlink messages first. */ + const char *const text = xlookup(nl_netfilter_msg_types, type); + if (text) { + print_xlat_ex(type, text, XLAT_STYLE_DEFAULT); + return; + } + + /* + * Other netfilter message types are split + * in two pieces: 8 bits subsystem and 8 bits type. + */ + const uint8_t subsys_id = (uint8_t) (type >> 8); + const uint8_t msg_type = (uint8_t) type; + + printxval(xlat, subsys_id, dflt); + + tprints("<<8|"); + if (subsys_id < ARRAY_SIZE(nf_nlmsg_types)) + printxval(nf_nlmsg_types[subsys_id].xlat, + msg_type, nf_nlmsg_types[subsys_id].dflt); + else + tprintf("%#x", msg_type); +} + +typedef void (*nlmsg_types_decoder_t)(struct tcb *, const struct xlat *, + uint16_t type, + const char *dflt); + +static const struct { + const nlmsg_types_decoder_t decoder; + const struct xlat *const xlat; + const char *const dflt; +} nlmsg_types[] = { + [NETLINK_AUDIT] = { NULL, nl_audit_types, "AUDIT_???" }, + [NETLINK_CRYPTO] = { NULL, nl_crypto_types, "CRYPTO_MSG_???" }, + [NETLINK_GENERIC] = { + decode_nlmsg_type_generic, + NULL, + "GENERIC_FAMILY_???" + }, + [NETLINK_NETFILTER] = { + decode_nlmsg_type_netfilter, + nl_netfilter_subsys_ids, + "NFNL_SUBSYS_???" + }, + [NETLINK_ROUTE] = { NULL, nl_route_types, "RTM_???" }, + [NETLINK_SELINUX] = { NULL, nl_selinux_types, "SELNL_MSG_???" }, + [NETLINK_SOCK_DIAG] = { NULL, nl_sock_diag_types, "SOCK_DIAG_???" }, + [NETLINK_XFRM] = { NULL, nl_xfrm_types, "XFRM_MSG_???" } +}; + +/* + * As all valid netlink families are positive integers, use unsigned int + * for family here to filter out -1. + */ +static void +decode_nlmsg_type(struct tcb *tcp, const uint16_t type, + const unsigned int family) +{ + nlmsg_types_decoder_t decoder = decode_nlmsg_type_default; + const struct xlat *xlat = netlink_types; + const char *dflt = "NLMSG_???"; + + /* + * type < NLMSG_MIN_TYPE are reserved control messages + * that need no family-specific decoding. + */ + if (type >= NLMSG_MIN_TYPE && family < ARRAY_SIZE(nlmsg_types)) { + if (nlmsg_types[family].decoder) + decoder = nlmsg_types[family].decoder; + if (nlmsg_types[family].xlat) + xlat = nlmsg_types[family].xlat; + if (nlmsg_types[family].dflt) + dflt = nlmsg_types[family].dflt; + } + + decoder(tcp, xlat, type, dflt); +} + +static const struct xlat * +decode_nlmsg_flags_crypto(const uint16_t type) +{ + switch (type) { + case CRYPTO_MSG_NEWALG: + return netlink_new_flags; + case CRYPTO_MSG_DELALG: + case CRYPTO_MSG_DELRNG: + return netlink_delete_flags; + case CRYPTO_MSG_GETALG: + return netlink_get_flags; + } + + return NULL; +} + +static const struct xlat * +decode_nlmsg_flags_netfilter(const uint16_t type) +{ + const uint8_t subsys_id = (uint8_t) (type >> 8); + const uint8_t msg_type = (uint8_t) type; + + switch (subsys_id) { + case NFNL_SUBSYS_CTNETLINK: + switch (msg_type) { + case IPCTNL_MSG_CT_NEW: + return netlink_new_flags; + case IPCTNL_MSG_CT_GET: + case IPCTNL_MSG_CT_GET_CTRZERO: + case IPCTNL_MSG_CT_GET_STATS_CPU: + case IPCTNL_MSG_CT_GET_STATS: + case IPCTNL_MSG_CT_GET_DYING: + case IPCTNL_MSG_CT_GET_UNCONFIRMED: + return netlink_get_flags; + case IPCTNL_MSG_CT_DELETE: + return netlink_delete_flags; + } + break; + case NFNL_SUBSYS_CTNETLINK_EXP: + switch (msg_type) { + case IPCTNL_MSG_EXP_NEW: + return netlink_new_flags; + case IPCTNL_MSG_EXP_GET: + case IPCTNL_MSG_EXP_GET_STATS_CPU: + return netlink_get_flags; + case IPCTNL_MSG_EXP_DELETE: + return netlink_delete_flags; + } + break; + case NFNL_SUBSYS_ACCT: + switch (msg_type) { + case NFNL_MSG_ACCT_NEW: + return netlink_new_flags; + case NFNL_MSG_ACCT_GET: + case NFNL_MSG_ACCT_GET_CTRZERO: + return netlink_get_flags; + case NFNL_MSG_ACCT_DEL: + return netlink_delete_flags; + } + break; + case NFNL_SUBSYS_CTNETLINK_TIMEOUT: + switch (msg_type) { + case IPCTNL_MSG_TIMEOUT_NEW: + return netlink_new_flags; + case IPCTNL_MSG_TIMEOUT_GET: + return netlink_get_flags; + case IPCTNL_MSG_TIMEOUT_DELETE: + return netlink_delete_flags; + } + break; + case NFNL_SUBSYS_CTHELPER: + switch (msg_type) { + case NFNL_MSG_CTHELPER_NEW: + return netlink_new_flags; + case NFNL_MSG_CTHELPER_GET: + return netlink_get_flags; + case NFNL_MSG_CTHELPER_DEL: + return netlink_delete_flags; + } + break; + case NFNL_SUBSYS_NFTABLES: + switch (msg_type) { + case NFT_MSG_NEWTABLE: + case NFT_MSG_NEWCHAIN: + case NFT_MSG_NEWRULE: + case NFT_MSG_NEWSET: + case NFT_MSG_NEWSETELEM: + case NFT_MSG_NEWGEN: + case NFT_MSG_NEWOBJ: + return netlink_new_flags; + case NFT_MSG_GETTABLE: + case NFT_MSG_GETCHAIN: + case NFT_MSG_GETRULE: + case NFT_MSG_GETSET: + case NFT_MSG_GETSETELEM: + case NFT_MSG_GETGEN: + case NFT_MSG_GETOBJ: + case NFT_MSG_GETOBJ_RESET: + return netlink_get_flags; + case NFT_MSG_DELTABLE: + case NFT_MSG_DELCHAIN: + case NFT_MSG_DELRULE: + case NFT_MSG_DELSET: + case NFT_MSG_DELSETELEM: + case NFT_MSG_DELOBJ: + return netlink_delete_flags; + } + break; + case NFNL_SUBSYS_NFT_COMPAT: + switch (msg_type) { + case NFNL_MSG_COMPAT_GET: + return netlink_get_flags; + } + break; + } + + return NULL; +} + +static const struct xlat * +decode_nlmsg_flags_route(const uint16_t type) +{ + /* RTM_DELACTION uses NLM_F_ROOT flags */ + if (type == RTM_DELACTION) + return netlink_get_flags; + switch (type & 3) { + case 0: + return netlink_new_flags; + case 1: + return netlink_delete_flags; + case 2: + return netlink_get_flags; + } + + return NULL; +} + +static const struct xlat * +decode_nlmsg_flags_sock_diag(const uint16_t type) +{ + return netlink_get_flags; +} + +static const struct xlat * +decode_nlmsg_flags_xfrm(const uint16_t type) +{ + switch (type) { + case XFRM_MSG_NEWSA: + case XFRM_MSG_NEWPOLICY: + case XFRM_MSG_NEWAE: + case XFRM_MSG_NEWSADINFO: + case XFRM_MSG_NEWSPDINFO: + return netlink_new_flags; + case XFRM_MSG_DELSA: + case XFRM_MSG_DELPOLICY: + return netlink_delete_flags; + case XFRM_MSG_GETSA: + case XFRM_MSG_GETPOLICY: + case XFRM_MSG_GETAE: + case XFRM_MSG_GETSADINFO: + case XFRM_MSG_GETSPDINFO: + return netlink_get_flags; + } + + return NULL; +} + +typedef const struct xlat *(*nlmsg_flags_decoder_t)(const uint16_t type); + +static const nlmsg_flags_decoder_t nlmsg_flags[] = { + [NETLINK_CRYPTO] = decode_nlmsg_flags_crypto, + [NETLINK_NETFILTER] = decode_nlmsg_flags_netfilter, + [NETLINK_ROUTE] = decode_nlmsg_flags_route, + [NETLINK_SOCK_DIAG] = decode_nlmsg_flags_sock_diag, + [NETLINK_XFRM] = decode_nlmsg_flags_xfrm +}; + +/* + * As all valid netlink families are positive integers, use unsigned int + * for family here to filter out -1. + */ +static void +decode_nlmsg_flags(const uint16_t flags, const uint16_t type, + const unsigned int family) +{ + const struct xlat *table = NULL; + + if (type < NLMSG_MIN_TYPE) { + if (type == NLMSG_ERROR) + table = netlink_ack_flags; + } else if (family < ARRAY_SIZE(nlmsg_flags) && nlmsg_flags[family]) + table = nlmsg_flags[family](type); + + printflags_ex(flags, "NLM_F_???", XLAT_STYLE_DEFAULT, + netlink_flags, table, NULL); } static void -print_nlmsghdr(struct tcb *tcp, const struct nlmsghdr *const nlmsghdr) +print_nlmsghdr(struct tcb *tcp, + const int fd, + const int family, + const struct nlmsghdr *const nlmsghdr) { /* print the whole structure regardless of its nlmsg_len */ tprintf("{len=%u, type=", nlmsghdr->nlmsg_len); - printxval(netlink_types, nlmsghdr->nlmsg_type, "NLMSG_???"); + decode_nlmsg_type(tcp, nlmsghdr->nlmsg_type, family); tprints(", flags="); - printflags(netlink_flags, nlmsghdr->nlmsg_flags, "NLM_F_???"); + decode_nlmsg_flags(nlmsghdr->nlmsg_flags, + nlmsghdr->nlmsg_type, family); tprintf(", seq=%u, pid=%u}", nlmsghdr->nlmsg_seq, nlmsghdr->nlmsg_pid); } +static bool +print_cookie(struct tcb *const tcp, void *const elem_buf, + const size_t elem_size, void *const opaque_data) +{ + tprintf("%" PRIu8, *(uint8_t *) elem_buf); + + return true; +} + +static bool +decode_nlmsgerr_attr_cookie(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + uint8_t cookie; + const size_t nmemb = len / sizeof(cookie); + + print_array(tcp, addr, nmemb, &cookie, sizeof(cookie), + tfetch_mem, print_cookie, 0); + + return true; +} + +static const nla_decoder_t nlmsgerr_nla_decoders[] = { + [NLMSGERR_ATTR_MSG] = decode_nla_str, + [NLMSGERR_ATTR_OFFS] = decode_nla_u32, + [NLMSGERR_ATTR_COOKIE] = decode_nlmsgerr_attr_cookie +}; + static void decode_nlmsghdr_with_payload(struct tcb *const tcp, + const int fd, + const int family, const struct nlmsghdr *const nlmsghdr, const kernel_ulong_t addr, - const kernel_ulong_t len) + const kernel_ulong_t len); + +static void +decode_nlmsgerr(struct tcb *const tcp, + const int fd, + const int family, + kernel_ulong_t addr, + unsigned int len, + const bool capped) { - tprints("{"); + struct nlmsgerr err; + + if (len < sizeof(err.error)) { + printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX); + return; + } - print_nlmsghdr(tcp, nlmsghdr); + if (umove_or_printaddr(tcp, addr, &err.error)) + return; - unsigned int nlmsg_len = - nlmsghdr->nlmsg_len > len ? len : nlmsghdr->nlmsg_len; - if (nlmsg_len > sizeof(struct nlmsghdr)) { - tprints(", "); + tprints("{error="); + if (err.error < 0 && (unsigned) -err.error < nerrnos) { + tprintf("-%s", errnoent[-err.error]); + } else { + tprintf("%d", err.error); + } + + addr += offsetof(struct nlmsgerr, msg); + len -= offsetof(struct nlmsgerr, msg); + + if (len) { + tprints(", msg="); + if (fetch_nlmsghdr(tcp, &err.msg, addr, len, false)) { + unsigned int payload = + capped ? sizeof(err.msg) : err.msg.nlmsg_len; + if (payload > len) + payload = len; - printstrn(tcp, addr + sizeof(struct nlmsghdr), - nlmsg_len - sizeof(struct nlmsghdr)); + decode_nlmsghdr_with_payload(tcp, fd, family, + &err.msg, addr, payload); + if (len > payload) { + tprints(", "); + decode_nlattr(tcp, addr + payload, + len - payload, nlmsgerr_attrs, + "NLMSGERR_ATTR_???", + nlmsgerr_nla_decoders, + ARRAY_SIZE(nlmsgerr_nla_decoders), + NULL); + } + } } tprints("}"); } +static const netlink_decoder_t netlink_decoders[] = { +#ifdef HAVE_LINUX_CRYPTOUSER_H + [NETLINK_CRYPTO] = decode_netlink_crypto, +#endif +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_H + [NETLINK_NETFILTER] = decode_netlink_netfilter, +#endif + [NETLINK_ROUTE] = decode_netlink_route, + [NETLINK_SELINUX] = decode_netlink_selinux, + [NETLINK_SOCK_DIAG] = decode_netlink_sock_diag +}; + +static void +decode_payload(struct tcb *const tcp, + const int fd, + const int family, + const struct nlmsghdr *const nlmsghdr, + const kernel_ulong_t addr, + const unsigned int len) +{ + if (nlmsghdr->nlmsg_type == NLMSG_ERROR) { + decode_nlmsgerr(tcp, fd, family, addr, len, + nlmsghdr->nlmsg_flags & NLM_F_CAPPED); + return; + } + + /* + * While most of NLMSG_DONE messages indeed have payloads + * containing just a single integer, there are few exceptions, + * so pass payloads of NLMSG_DONE messages to family-specific + * netlink payload decoders. + * + * Other types of reserved control messages need no family-specific + * netlink payload decoding. + */ + if ((nlmsghdr->nlmsg_type >= NLMSG_MIN_TYPE + || nlmsghdr->nlmsg_type == NLMSG_DONE) + && (unsigned int) family < ARRAY_SIZE(netlink_decoders) + && netlink_decoders[family] + && netlink_decoders[family](tcp, nlmsghdr, addr, len)) { + return; + } + + if (nlmsghdr->nlmsg_type == NLMSG_DONE && len == sizeof(int)) { + int num; + + if (!umove_or_printaddr(tcp, addr, &num)) + tprintf("%d", num); + return; + } + + printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX); +} + +static void +decode_nlmsghdr_with_payload(struct tcb *const tcp, + const int fd, + const int family, + const struct nlmsghdr *const nlmsghdr, + const kernel_ulong_t addr, + const kernel_ulong_t len) +{ + const unsigned int nlmsg_len = MIN(nlmsghdr->nlmsg_len, len); + + if (nlmsg_len > NLMSG_HDRLEN) + tprints("{"); + + print_nlmsghdr(tcp, fd, family, nlmsghdr); + + if (nlmsg_len > NLMSG_HDRLEN) { + tprints(", "); + decode_payload(tcp, fd, family, nlmsghdr, addr + NLMSG_HDRLEN, + nlmsg_len - NLMSG_HDRLEN); + tprints("}"); + } +} + void -decode_netlink(struct tcb *const tcp, kernel_ulong_t addr, kernel_ulong_t len) +decode_netlink(struct tcb *const tcp, + const int fd, + kernel_ulong_t addr, + kernel_ulong_t len) { + const int family = get_fd_nl_family(tcp, fd); + + if (family == NETLINK_KOBJECT_UEVENT) { + decode_netlink_kobject_uevent(tcp, addr, len); + return; + } + struct nlmsghdr nlmsghdr; - bool print_array = false; + bool is_array = false; unsigned int elt; - for (elt = 0; fetch_nlmsghdr(tcp, &nlmsghdr, addr, len); elt++) { + for (elt = 0; fetch_nlmsghdr(tcp, &nlmsghdr, addr, len, is_array); + elt++) { if (abbrev(tcp) && elt == max_strlen) { tprints("..."); break; @@ -105,19 +638,20 @@ decode_netlink(struct tcb *const tcp, kernel_ulong_t addr, kernel_ulong_t len) kernel_ulong_t next_addr = 0; kernel_ulong_t next_len = 0; - if (nlmsghdr.nlmsg_len >= sizeof(struct nlmsghdr)) { + if (nlmsghdr.nlmsg_len >= NLMSG_HDRLEN) { next_len = (len >= nlmsg_len) ? len - nlmsg_len : 0; if (next_len && addr + nlmsg_len > addr) next_addr = addr + nlmsg_len; } - if (!print_array && next_addr) { + if (!is_array && next_addr) { tprints("["); - print_array = true; + is_array = true; } - decode_nlmsghdr_with_payload(tcp, &nlmsghdr, addr, len); + decode_nlmsghdr_with_payload(tcp, fd, family, + &nlmsghdr, addr, len); if (!next_addr) break; @@ -127,7 +661,7 @@ decode_netlink(struct tcb *const tcp, kernel_ulong_t addr, kernel_ulong_t len) len = next_len; } - if (print_array) { + if (is_array) { tprints("]"); } } diff --git a/netlink.h b/netlink.h new file mode 100644 index 00000000..a079362e --- /dev/null +++ b/netlink.h @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_NETLINK_H +# define STRACE_NETLINK_H + +# include +# include +# include + +# ifndef NETLINK_SOCK_DIAG +# define NETLINK_SOCK_DIAG 4 +# endif + +# ifndef NLM_F_NONREC +# define NLM_F_NONREC 0x100 +# endif +# ifndef NLM_F_CAPPED +# define NLM_F_CAPPED 0x100 +# endif + +# undef NLMSG_HDRLEN +# define NLMSG_HDRLEN ((unsigned int) NLMSG_ALIGN(sizeof(struct nlmsghdr))) + +# ifndef NLMSG_MIN_TYPE +# define NLMSG_MIN_TYPE 0x10 +# endif + +# ifndef NLA_ALIGN +# define NLA_ALIGN(len) (((len) + 3) & ~3) +# endif + +# undef NLA_HDRLEN +# define NLA_HDRLEN ((unsigned int) NLA_ALIGN(sizeof(struct nlattr))) + +# ifndef NLA_TYPE_MASK +# define NLA_F_NESTED (1 << 15) +# define NLA_F_NET_BYTEORDER (1 << 14) +# define NLA_TYPE_MASK ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER) +# endif + +static inline bool +is_nlmsg_ok(const struct nlmsghdr *const nlh, const ssize_t len) +{ + return len >= (ssize_t) sizeof(*nlh) + && nlh->nlmsg_len >= sizeof(*nlh) + && (size_t) len >= nlh->nlmsg_len; +} + +#endif /* !STRACE_NETLINK_H */ diff --git a/netlink_crypto.c b/netlink_crypto.c new file mode 100644 index 00000000..135416b4 --- /dev/null +++ b/netlink_crypto.c @@ -0,0 +1,224 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#ifdef HAVE_LINUX_CRYPTOUSER_H + +# include "netlink.h" +# include "nlattr.h" +# include "print_fields.h" + +# include + +# include "xlat/crypto_nl_attrs.h" + +static bool +decode_crypto_report_generic(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + tprints("{type="); + printstr_ex(tcp, addr, len, QUOTE_0_TERMINATED); + tprints("}"); + + return true; +} + +static bool +decode_crypto_report_hash(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ +# ifdef HAVE_STRUCT_CRYPTO_REPORT_HASH + struct crypto_report_hash rhash; + + if (len < sizeof(rhash)) + printstrn(tcp, addr, len); + else if (!umove_or_printaddr(tcp, addr, &rhash)) { + PRINT_FIELD_CSTRING("{", rhash, type); + PRINT_FIELD_U(", ", rhash, blocksize); + PRINT_FIELD_U(", ", rhash, digestsize); + tprints("}"); + } +# else + printstrn(tcp, addr, len); +# endif + + return true; +} + +static bool +decode_crypto_report_blkcipher(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ +# ifdef HAVE_STRUCT_CRYPTO_REPORT_BLKCIPHER + struct crypto_report_blkcipher rblkcipher; + + if (len < sizeof(rblkcipher)) + printstrn(tcp, addr, len); + else if (!umove_or_printaddr(tcp, addr, &rblkcipher)) { + PRINT_FIELD_CSTRING("{", rblkcipher, type); + PRINT_FIELD_CSTRING(", ", rblkcipher, geniv); + PRINT_FIELD_U(", ", rblkcipher, blocksize); + PRINT_FIELD_U(", ", rblkcipher, min_keysize); + PRINT_FIELD_U(", ", rblkcipher, max_keysize); + PRINT_FIELD_U(", ", rblkcipher, ivsize); + tprints("}"); + } +# else + printstrn(tcp, addr, len); +# endif + + return true; +} + +static bool +decode_crypto_report_aead(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ +# ifdef HAVE_STRUCT_CRYPTO_REPORT_AEAD + struct crypto_report_aead raead; + + if (len < sizeof(raead)) + printstrn(tcp, addr, len); + else if (!umove_or_printaddr(tcp, addr, &raead)) { + PRINT_FIELD_CSTRING("{", raead, type); + PRINT_FIELD_CSTRING(", ", raead, geniv); + PRINT_FIELD_U(", ", raead, blocksize); + PRINT_FIELD_U(", ", raead, maxauthsize); + PRINT_FIELD_U(", ", raead, ivsize); + tprints("}"); + } +# else + printstrn(tcp, addr, len); +# endif + + return true; +} + +static bool +decode_crypto_report_rng(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ +# ifdef HAVE_STRUCT_CRYPTO_REPORT_RNG + struct crypto_report_rng rrng; + + if (len < sizeof(rrng)) + printstrn(tcp, addr, len); + else if (!umove_or_printaddr(tcp, addr, &rrng)) { + PRINT_FIELD_CSTRING("{", rrng, type); + PRINT_FIELD_U(", ", rrng, seedsize); + tprints("}"); + } +# else + printstrn(tcp, addr, len); +# endif + + return true; +} + +static bool +decode_crypto_report_cipher(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ +# ifdef HAVE_STRUCT_CRYPTO_REPORT_CIPHER + struct crypto_report_cipher rcipher; + + if (len < sizeof(rcipher)) + printstrn(tcp, addr, len); + else if (!umove_or_printaddr(tcp, addr, &rcipher)) { + PRINT_FIELD_CSTRING("{", rcipher, type); + PRINT_FIELD_U(", ", rcipher, blocksize); + PRINT_FIELD_U(", ", rcipher, min_keysize); + PRINT_FIELD_U(", ", rcipher, max_keysize); + tprints("}"); + } +# else + printstrn(tcp, addr, len); +# endif + + return true; +} + +static const nla_decoder_t crypto_user_alg_nla_decoders[] = { + [CRYPTOCFGA_PRIORITY_VAL] = decode_nla_u32, + [CRYPTOCFGA_REPORT_LARVAL] = decode_crypto_report_generic, + [CRYPTOCFGA_REPORT_HASH] = decode_crypto_report_hash, + [CRYPTOCFGA_REPORT_BLKCIPHER] = decode_crypto_report_blkcipher, + [CRYPTOCFGA_REPORT_AEAD] = decode_crypto_report_aead, + [CRYPTOCFGA_REPORT_COMPRESS] = decode_crypto_report_generic, + [CRYPTOCFGA_REPORT_RNG] = decode_crypto_report_rng, + [CRYPTOCFGA_REPORT_CIPHER] = decode_crypto_report_cipher, + [CRYPTOCFGA_REPORT_AKCIPHER] = decode_crypto_report_generic, + [CRYPTOCFGA_REPORT_KPP] = decode_crypto_report_generic, + [CRYPTOCFGA_REPORT_ACOMP] = decode_crypto_report_generic +}; + +static void +decode_crypto_user_alg(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len) +{ + struct crypto_user_alg alg; + + if (len < sizeof(alg)) + printstrn(tcp, addr, len); + else if (!umove_or_printaddr(tcp, addr, &alg)) { + PRINT_FIELD_CSTRING("{", alg, cru_name); + PRINT_FIELD_CSTRING(", ", alg, cru_driver_name); + PRINT_FIELD_CSTRING(", ", alg, cru_module_name); + PRINT_FIELD_X(", ", alg, cru_type); + PRINT_FIELD_X(", ", alg, cru_mask); + PRINT_FIELD_U(", ", alg, cru_refcnt); + PRINT_FIELD_X(", ", alg, cru_flags); + tprints("}"); + + const size_t offset = NLMSG_ALIGN(sizeof(alg)); + if (len > offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + crypto_nl_attrs, "CRYPTOCFGA_???", + crypto_user_alg_nla_decoders, + ARRAY_SIZE(crypto_user_alg_nla_decoders), + NULL); + } + } +} + +bool +decode_netlink_crypto(struct tcb *const tcp, + const struct nlmsghdr *const nlmsghdr, + const kernel_ulong_t addr, + const unsigned int len) +{ + switch (nlmsghdr->nlmsg_type) { + case CRYPTO_MSG_NEWALG: + case CRYPTO_MSG_DELALG: + case CRYPTO_MSG_UPDATEALG: + case CRYPTO_MSG_GETALG: + decode_crypto_user_alg(tcp, addr, len); + break; + default: + return false; + } + + return true; +} + +#endif /* HAVE_LINUX_CRYPTOUSER_H */ diff --git a/netlink_inet_diag.c b/netlink_inet_diag.c new file mode 100644 index 00000000..5e84c2b7 --- /dev/null +++ b/netlink_inet_diag.c @@ -0,0 +1,410 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "netlink.h" +#include "netlink_sock_diag.h" +#include "nlattr.h" +#include "print_fields.h" + +#include + +#include +#include + +#include "xlat/inet_diag_attrs.h" +#include "xlat/inet_diag_bytecodes.h" +#include "xlat/inet_diag_extended_flags.h" +#include "xlat/inet_diag_req_attrs.h" + +#include "xlat/tcp_states.h" +#include "xlat/tcp_state_flags.h" + +void +print_inet_diag_sockid(const struct inet_diag_sockid *id, const uint8_t family) +{ + PRINT_FIELD_NET_PORT("{", *id, idiag_sport); + PRINT_FIELD_NET_PORT(", ", *id, idiag_dport); + PRINT_FIELD_INET_ADDR(", ", *id, idiag_src, family); + PRINT_FIELD_INET_ADDR(", ", *id, idiag_dst, family); + PRINT_FIELD_IFINDEX(", ", *id, idiag_if); + PRINT_FIELD_COOKIE(", ", *id, idiag_cookie); + tprints("}"); +} + +static void +decode_inet_diag_hostcond(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len) +{ + struct inet_diag_hostcond cond; + + if (len < sizeof(cond)) { + printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX); + return; + } + if (umove_or_printaddr(tcp, addr, &cond)) + return; + + PRINT_FIELD_XVAL("{", cond, family, addrfams, "AF_???"); + PRINT_FIELD_U(", ", cond, prefix_len); + PRINT_FIELD_U(", ", cond, port); + + if (len > sizeof(cond)) { + tprints(", "); + decode_inet_addr(tcp, addr + sizeof(cond), + len - sizeof(cond), cond.family, "addr"); + } + tprints("}"); +} + +static void +print_inet_diag_bc_op(const struct inet_diag_bc_op *const op) +{ + PRINT_FIELD_XVAL("{", *op, code, inet_diag_bytecodes, + "INET_DIAG_BC_???"); + PRINT_FIELD_U(", ", *op, yes); + PRINT_FIELD_U(", ", *op, no); + tprints("}"); +} + +static void +decode_inet_diag_markcond(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len) +{ + struct inet_diag_markcond markcond; + + if (len < sizeof(markcond)) + printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX); + else if (!umove_or_printaddr(tcp, addr, &markcond)) { + PRINT_FIELD_U("{", markcond, mark); + PRINT_FIELD_U(", ", markcond, mask); + tprints("}"); + } +} + +static void +decode_bytecode_data(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const unsigned char code) +{ + switch (code) { + case INET_DIAG_BC_S_COND: + case INET_DIAG_BC_D_COND: + decode_inet_diag_hostcond(tcp, addr, len); + break; + case INET_DIAG_BC_DEV_COND: { + uint32_t ifindex; + + if (len < sizeof(ifindex)) + printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX); + else if (!umove_or_printaddr(tcp, addr, &ifindex)) + print_ifindex(ifindex); + break; + } + case INET_DIAG_BC_S_GE: + case INET_DIAG_BC_S_LE: + case INET_DIAG_BC_D_GE: + case INET_DIAG_BC_D_LE: { + struct inet_diag_bc_op op; + + if (len < sizeof(op)) + printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX); + else if (!umove_or_printaddr(tcp, addr, &op)) + print_inet_diag_bc_op(&op); + break; + } + case INET_DIAG_BC_MARK_COND: + decode_inet_diag_markcond(tcp, addr, len); + break; + case INET_DIAG_BC_AUTO: + case INET_DIAG_BC_JMP: + case INET_DIAG_BC_NOP: + default: + printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX); + break; + } +} + +static bool +decode_inet_diag_bc_op(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct inet_diag_bc_op op; + + if (len < sizeof(op)) + return false; + if (umove_or_printaddr(tcp, addr, &op)) + return true; + + if (len > sizeof(op)) + tprints("{"); + + print_inet_diag_bc_op(&op); + + if (len > sizeof(op)) { + tprints(", "); + decode_bytecode_data(tcp, addr + sizeof(op), + len - sizeof(op), op.code); + tprints("}"); + } + + return true; +} + +static const nla_decoder_t inet_diag_req_nla_decoders[] = { + [INET_DIAG_REQ_BYTECODE] = decode_inet_diag_bc_op +}; + +static void +decode_inet_diag_req_compat(struct tcb *const tcp, + const struct nlmsghdr *const nlmsghdr, + const uint8_t family, + const kernel_ulong_t addr, + const unsigned int len) +{ + struct inet_diag_req req = { .idiag_family = family }; + size_t offset = sizeof(req.idiag_family); + bool decode_nla = false; + + PRINT_FIELD_XVAL("{", req, idiag_family, addrfams, "AF_???"); + tprints(", "); + if (len >= sizeof(req)) { + if (!umoven_or_printaddr(tcp, addr + offset, + sizeof(req) - offset, + (char *) &req + offset)) { + PRINT_FIELD_U("", req, idiag_src_len); + PRINT_FIELD_U(", ", req, idiag_dst_len); + PRINT_FIELD_FLAGS(", ", req, idiag_ext, + inet_diag_extended_flags, + "1< offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + inet_diag_req_attrs, "INET_DIAG_REQ_???", + inet_diag_req_nla_decoders, + ARRAY_SIZE(inet_diag_req_nla_decoders), NULL); + } +} + +static void +decode_inet_diag_req_v2(struct tcb *const tcp, + const struct nlmsghdr *const nlmsghdr, + const uint8_t family, + const kernel_ulong_t addr, + const unsigned int len) +{ + struct inet_diag_req_v2 req = { .sdiag_family = family }; + size_t offset = sizeof(req.sdiag_family); + bool decode_nla = false; + + PRINT_FIELD_XVAL("{", req, sdiag_family, addrfams, "AF_???"); + tprints(", "); + if (len >= sizeof(req)) { + if (!umoven_or_printaddr(tcp, addr + offset, + sizeof(req) - offset, + (char *) &req + offset)) { + PRINT_FIELD_XVAL("", req, sdiag_protocol, + inet_protocols, "IPPROTO_???"); + PRINT_FIELD_FLAGS(", ", req, idiag_ext, + inet_diag_extended_flags, + "1< offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + inet_diag_req_attrs, "INET_DIAG_REQ_???", + inet_diag_req_nla_decoders, + ARRAY_SIZE(inet_diag_req_nla_decoders), NULL); + } +} + +DECL_NETLINK_DIAG_DECODER(decode_inet_diag_req) +{ + if (nlmsghdr->nlmsg_type == TCPDIAG_GETSOCK + || nlmsghdr->nlmsg_type == DCCPDIAG_GETSOCK) + decode_inet_diag_req_compat(tcp, nlmsghdr, family, addr, len); + else + decode_inet_diag_req_v2(tcp, nlmsghdr, family, addr, len); +} + +static bool +decode_inet_diag_meminfo(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct inet_diag_meminfo minfo; + + if (len < sizeof(minfo)) + return false; + if (umove_or_printaddr(tcp, addr, &minfo)) + return true; + + PRINT_FIELD_U("{", minfo, idiag_rmem); + PRINT_FIELD_U(", ", minfo, idiag_wmem); + PRINT_FIELD_U(", ", minfo, idiag_fmem); + PRINT_FIELD_U(", ", minfo, idiag_tmem); + tprints("}"); + + return true; +} + +static bool +decode_tcpvegas_info(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct tcpvegas_info vegas; + + if (len < sizeof(vegas)) + return false; + if (umove_or_printaddr(tcp, addr, &vegas)) + return true; + + PRINT_FIELD_U("{", vegas, tcpv_enabled); + PRINT_FIELD_U(", ", vegas, tcpv_rttcnt); + PRINT_FIELD_U(", ", vegas, tcpv_rtt); + PRINT_FIELD_U(", ", vegas, tcpv_minrtt); + tprints("}"); + + return true; +} + +static bool +decode_tcp_dctcp_info(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct tcp_dctcp_info dctcp; + + if (len < sizeof(dctcp)) + return false; + if (umove_or_printaddr(tcp, addr, &dctcp)) + return true; + + PRINT_FIELD_U("{", dctcp, dctcp_enabled); + PRINT_FIELD_U(", ", dctcp, dctcp_ce_state); + PRINT_FIELD_U(", ", dctcp, dctcp_alpha); + PRINT_FIELD_U(", ", dctcp, dctcp_ab_ecn); + PRINT_FIELD_U(", ", dctcp, dctcp_ab_tot); + tprints("}"); + + return true; +} + +static bool +decode_tcp_bbr_info(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct tcp_bbr_info bbr; + + if (len < sizeof(bbr)) + return false; + if (umove_or_printaddr(tcp, addr, &bbr)) + return true; + + PRINT_FIELD_X("{", bbr, bbr_bw_lo); + PRINT_FIELD_X(", ", bbr, bbr_bw_hi); + PRINT_FIELD_U(", ", bbr, bbr_min_rtt); + PRINT_FIELD_U(", ", bbr, bbr_pacing_gain); + PRINT_FIELD_U(", ", bbr, bbr_cwnd_gain); + tprints("}"); + + return true; +} + +static const nla_decoder_t inet_diag_msg_nla_decoders[] = { + [INET_DIAG_MEMINFO] = decode_inet_diag_meminfo, + [INET_DIAG_INFO] = NULL, /* unimplemented */ + [INET_DIAG_VEGASINFO] = decode_tcpvegas_info, + [INET_DIAG_CONG] = decode_nla_str, + [INET_DIAG_TOS] = decode_nla_u8, + [INET_DIAG_TCLASS] = decode_nla_u8, + [INET_DIAG_SKMEMINFO] = decode_nla_meminfo, + [INET_DIAG_SHUTDOWN] = decode_nla_u8, + [INET_DIAG_DCTCPINFO] = decode_tcp_dctcp_info, + [INET_DIAG_PROTOCOL] = decode_nla_u8, + [INET_DIAG_SKV6ONLY] = decode_nla_u8, + [INET_DIAG_LOCALS] = NULL, /* unimplemented */ + [INET_DIAG_PEERS] = NULL, /* unimplemented */ + [INET_DIAG_PAD] = NULL, + [INET_DIAG_MARK] = decode_nla_u32, + [INET_DIAG_BBRINFO] = decode_tcp_bbr_info, + [INET_DIAG_CLASS_ID] = decode_nla_u32 +}; + +DECL_NETLINK_DIAG_DECODER(decode_inet_diag_msg) +{ + struct inet_diag_msg msg = { .idiag_family = family }; + size_t offset = sizeof(msg.idiag_family); + bool decode_nla = false; + + PRINT_FIELD_XVAL("{", msg, idiag_family, addrfams, "AF_???"); + tprints(", "); + if (len >= sizeof(msg)) { + if (!umoven_or_printaddr(tcp, addr + offset, + sizeof(msg) - offset, + (char *) &msg + offset)) { + PRINT_FIELD_XVAL("", msg, idiag_state, + tcp_states, "TCP_???"); + PRINT_FIELD_U(", ", msg, idiag_timer); + PRINT_FIELD_U(", ", msg, idiag_retrans); + PRINT_FIELD_INET_DIAG_SOCKID(", ", msg, id, + msg.idiag_family); + PRINT_FIELD_U(", ", msg, idiag_expires); + PRINT_FIELD_U(", ", msg, idiag_rqueue); + PRINT_FIELD_U(", ", msg, idiag_wqueue); + PRINT_FIELD_U(", ", msg, idiag_uid); + PRINT_FIELD_U(", ", msg, idiag_inode); + decode_nla = true; + } + } else + tprints("..."); + tprints("}"); + + offset = NLMSG_ALIGN(sizeof(msg)); + if (decode_nla && len > offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + inet_diag_attrs, "INET_DIAG_???", + inet_diag_msg_nla_decoders, + ARRAY_SIZE(inet_diag_msg_nla_decoders), NULL); + } +} diff --git a/netlink_kobject_uevent.c b/netlink_kobject_uevent.c new file mode 100644 index 00000000..764b1f54 --- /dev/null +++ b/netlink_kobject_uevent.c @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2018 Harsha Sharma + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "print_fields.h" +#include "netlink_kobject_uevent.h" + +#include + +void +decode_netlink_kobject_uevent(struct tcb *tcp, kernel_ulong_t addr, + kernel_ulong_t len) +{ + struct udev_monitor_netlink_header uh; + const char *prefix = "libudev"; + unsigned int offset = sizeof(uh); + + if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) || + !addr || len < offset || umove(tcp, addr, &uh) || + strcmp(uh.prefix, prefix) != 0) { + printstrn(tcp, addr, len); + return; + } + + PRINT_FIELD_CSTRING("{{", uh, prefix); + tprintf(", magic=htonl(%#x)", ntohl(uh.magic)); + PRINT_FIELD_U(", ", uh, header_size); + PRINT_FIELD_U(", ", uh, properties_off); + PRINT_FIELD_U(", ", uh, properties_len); + tprintf(", filter_subsystem_hash=htonl(%#x)", ntohl(uh.filter_subsystem_hash)); + tprintf(", filter_devtype_hash=htonl(%#x)", ntohl(uh.filter_devtype_hash)); + tprintf(", filter_tag_bloom_hi=htonl(%#x)", ntohl(uh.filter_tag_bloom_hi)); + tprintf(", filter_tag_bloom_lo=htonl(%#x)", ntohl(uh.filter_tag_bloom_lo)); + tprints("}"); + if (len > offset) { + tprints(", "); + printstrn(tcp, addr + offset, len - offset); + } + tprints("}"); +} diff --git a/netlink_kobject_uevent.h b/netlink_kobject_uevent.h new file mode 100644 index 00000000..3aea2532 --- /dev/null +++ b/netlink_kobject_uevent.h @@ -0,0 +1,24 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_NETLINK_KOBJECT_UEVENT_H +# define STRACE_NETLINK_KOBJECT_UEVENT_H + +struct udev_monitor_netlink_header { + /* "libudev" prefix to distinguish libudev and kernel messages */ + char prefix[8]; + unsigned int magic; + unsigned int header_size; + unsigned int properties_off; + unsigned int properties_len; + unsigned int filter_subsystem_hash; + unsigned int filter_devtype_hash; + unsigned int filter_tag_bloom_hi; + unsigned int filter_tag_bloom_lo; +}; + +#endif /* !STRACE_NETLINK_KOBJECT_UEVENT_H */ diff --git a/netlink_netfilter.c b/netlink_netfilter.c new file mode 100644 index 00000000..c6aeef20 --- /dev/null +++ b/netlink_netfilter.c @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2018 Chen Jingpiao + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_H + +# include "print_fields.h" +# include "nlattr.h" + +# include +# include +# include "netlink.h" +# include + +# include "xlat/netfilter_versions.h" +# include "xlat/nl_netfilter_msg_types.h" +# include "xlat/nl_netfilter_subsys_ids.h" + +bool +decode_netlink_netfilter(struct tcb *const tcp, + const struct nlmsghdr *const nlmsghdr, + const kernel_ulong_t addr, + const unsigned int len) +{ + if (nlmsghdr->nlmsg_type == NLMSG_DONE) + return false; + + struct nfgenmsg nfmsg; + + if (len < sizeof(nfmsg)) + printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX); + else if (!umove_or_printaddr(tcp, addr, &nfmsg)) { + const uint8_t subsys_id = (uint8_t) (nlmsghdr->nlmsg_type >> 8); + uint16_t res_id = ntohs(nfmsg.res_id); + + PRINT_FIELD_XVAL("{", nfmsg, nfgen_family, addrfams, "AF_???"); + PRINT_FIELD_XVAL(", ", nfmsg, version, netfilter_versions, + "NFNETLINK_???"); + + /* + * Work around wrong endianness in res_id field, + * see linux commit v4.3-rc1~28^2~47^2~1 + */ + tprints(", res_id="); + if (subsys_id == NFNL_SUBSYS_NFTABLES + && res_id == NFNL_SUBSYS_NFTABLES) { + print_xlat_ex(nfmsg.res_id, + "htons(NFNL_SUBSYS_NFTABLES)", + XLAT_STYLE_DEFAULT); + } else if (subsys_id == NFNL_SUBSYS_NFTABLES + && nfmsg.res_id == NFNL_SUBSYS_NFTABLES) { + print_xlat_ex(nfmsg.res_id, "NFNL_SUBSYS_NFTABLES", + XLAT_STYLE_DEFAULT); + } else { + tprintf("htons(%d)", res_id); + } + + const size_t offset = NLMSG_ALIGN(sizeof(nfmsg)); + if (len > offset) { + tprints(", "); + if ((nlmsghdr->nlmsg_type >= NFNL_MSG_BATCH_BEGIN + && nlmsghdr->nlmsg_type <= NFNL_MSG_BATCH_END) + || nlmsghdr->nlmsg_type < NLMSG_MIN_TYPE) + printstr_ex(tcp, addr + offset, + len - offset, QUOTE_FORCE_HEX); + else + decode_nlattr(tcp, addr + offset, len - offset, + NULL, NULL, NULL, 0, NULL); + } + } + + return true; +} + +#endif /* HAVE_LINUX_NETFILTER_NFNETLINK_H */ diff --git a/netlink_netlink_diag.c b/netlink_netlink_diag.c new file mode 100644 index 00000000..be2594bf --- /dev/null +++ b/netlink_netlink_diag.c @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "netlink.h" +#include "netlink_sock_diag.h" +#include "nlattr.h" +#include "print_fields.h" + +#include +#include + +#include "xlat/netlink_diag_attrs.h" +#include "xlat/netlink_diag_show.h" +#include "xlat/netlink_socket_flags.h" +#include "xlat/netlink_states.h" + +DECL_NETLINK_DIAG_DECODER(decode_netlink_diag_req) +{ + struct netlink_diag_req req = { .sdiag_family = family }; + const size_t offset = sizeof(req.sdiag_family); + + PRINT_FIELD_XVAL("{", req, sdiag_family, addrfams, "AF_???"); + tprints(", "); + if (len >= sizeof(req)) { + if (!umoven_or_printaddr(tcp, addr + offset, + sizeof(req) - offset, + (char *) &req + offset)) { + if (NDIAG_PROTO_ALL == req.sdiag_protocol) + tprintf("%s=%s", + "sdiag_protocol", "NDIAG_PROTO_ALL"); + else + PRINT_FIELD_XVAL("", req, sdiag_protocol, + netlink_protocols, + "NETLINK_???"); + PRINT_FIELD_U(", ", req, ndiag_ino); + PRINT_FIELD_FLAGS(", ", req, ndiag_show, + netlink_diag_show, "NDIAG_SHOW_???"); + PRINT_FIELD_COOKIE(", ", req, ndiag_cookie); + } + } else + tprints("..."); + tprints("}"); +} + +static bool +print_group(struct tcb *const tcp, + void *const elem_buf, + const size_t elem_size, + void *const opaque_data) +{ + if (elem_size < sizeof(kernel_ulong_t)) + tprintf("%#0*x", (int) elem_size * 2 + 2, + *(unsigned int *) elem_buf); + else + tprintf("%#0*" PRI_klx, (int) elem_size * 2 + 2, + *(kernel_ulong_t *) elem_buf); + + return true; +} + +static bool +decode_netlink_diag_groups(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + kernel_ulong_t buf; + const size_t nmemb = len / current_wordsize; + + if (!nmemb) + return false; + + print_array(tcp, addr, nmemb, &buf, current_wordsize, + tfetch_mem, print_group, 0); + + return true; +} + +static bool +decode_netlink_diag_ring(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct netlink_diag_ring ndr; + + if (len < sizeof(ndr)) + return false; + if (umove_or_printaddr(tcp, addr, &ndr)) + return true; + + PRINT_FIELD_U("{", ndr, ndr_block_size); + PRINT_FIELD_U(", ", ndr, ndr_block_nr); + PRINT_FIELD_U(", ", ndr, ndr_frame_size); + PRINT_FIELD_U(", ", ndr, ndr_frame_nr); + tprints("}"); + + return true; +} + +static bool +decode_netlink_diag_flags(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + uint32_t flags; + + if (len < sizeof(flags)) + return false; + if (umove_or_printaddr(tcp, addr, &flags)) + return true; + + printflags(netlink_socket_flags, flags, "NDIAG_FLAG_???"); + + return true; +} + +static const nla_decoder_t netlink_diag_msg_nla_decoders[] = { + [NETLINK_DIAG_MEMINFO] = decode_nla_meminfo, + [NETLINK_DIAG_GROUPS] = decode_netlink_diag_groups, + [NETLINK_DIAG_RX_RING] = decode_netlink_diag_ring, + [NETLINK_DIAG_TX_RING] = decode_netlink_diag_ring, + [NETLINK_DIAG_FLAGS] = decode_netlink_diag_flags +}; + +DECL_NETLINK_DIAG_DECODER(decode_netlink_diag_msg) +{ + struct netlink_diag_msg msg = { .ndiag_family = family }; + size_t offset = sizeof(msg.ndiag_family); + bool decode_nla = false; + + PRINT_FIELD_XVAL("{", msg, ndiag_family, addrfams, "AF_???"); + tprints(", "); + if (len >= sizeof(msg)) { + if (!umoven_or_printaddr(tcp, addr + offset, + sizeof(msg) - offset, + (char *) &msg + offset)) { + PRINT_FIELD_XVAL("", msg, ndiag_type, + socktypes, "SOCK_???"); + PRINT_FIELD_XVAL(", ", msg, ndiag_protocol, + netlink_protocols, "NETLINK_???"); + PRINT_FIELD_XVAL(", ", msg, ndiag_state, + netlink_states, "NETLINK_???"); + PRINT_FIELD_U(", ", msg, ndiag_portid); + PRINT_FIELD_U(", ", msg, ndiag_dst_portid); + PRINT_FIELD_U(", ", msg, ndiag_dst_group); + PRINT_FIELD_U(", ", msg, ndiag_ino); + PRINT_FIELD_COOKIE(", ", msg, ndiag_cookie); + decode_nla = true; + } + } else + tprints("..."); + tprints("}"); + + offset = NLMSG_ALIGN(sizeof(msg)); + if (decode_nla && len > offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + netlink_diag_attrs, "NETLINK_DIAG_???", + netlink_diag_msg_nla_decoders, + ARRAY_SIZE(netlink_diag_msg_nla_decoders), NULL); + } +} diff --git a/netlink_packet_diag.c b/netlink_packet_diag.c new file mode 100644 index 00000000..dd26f95a --- /dev/null +++ b/netlink_packet_diag.c @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "netlink.h" +#include "netlink_sock_diag.h" +#include "nlattr.h" +#include "print_fields.h" + +#include +#include +#include + +#include "xlat/af_packet_versions.h" +#include "xlat/packet_diag_attrs.h" +#include "xlat/packet_diag_info_flags.h" +#include "xlat/packet_diag_show.h" + +DECL_NETLINK_DIAG_DECODER(decode_packet_diag_req) +{ + struct packet_diag_req req = { .sdiag_family = family }; + const size_t offset = sizeof(req.sdiag_family); + + PRINT_FIELD_XVAL("{", req, sdiag_family, addrfams, "AF_???"); + tprints(", "); + if (len >= sizeof(req)) { + if (!umoven_or_printaddr(tcp, addr + offset, + sizeof(req) - offset, + (char *) &req + offset)) { + /* + * AF_PACKET currently doesn't support protocol values + * other than 0. + */ + PRINT_FIELD_X("", req, sdiag_protocol); + PRINT_FIELD_U(", ", req, pdiag_ino); + PRINT_FIELD_FLAGS(", ", req, pdiag_show, + packet_diag_show, "PACKET_SHOW_???"); + PRINT_FIELD_COOKIE(", ", req, pdiag_cookie); + } + } else + tprints("..."); + tprints("}"); +} + +static bool +decode_packet_diag_info(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct packet_diag_info pinfo; + + if (len < sizeof(pinfo)) + return false; + if (umove_or_printaddr(tcp, addr, &pinfo)) + return true; + + PRINT_FIELD_IFINDEX("{", pinfo, pdi_index); + PRINT_FIELD_XVAL(", ", pinfo, pdi_version, af_packet_versions, + "TPACKET_???"); + PRINT_FIELD_U(", ", pinfo, pdi_reserve); + PRINT_FIELD_U(", ", pinfo, pdi_copy_thresh); + PRINT_FIELD_U(", ", pinfo, pdi_tstamp); + PRINT_FIELD_FLAGS(", ", pinfo, pdi_flags, + packet_diag_info_flags, "PDI_???"); + tprints("}"); + + return true; +} + +static bool +print_packet_diag_mclist(struct tcb *const tcp, void *const elem_buf, + const size_t elem_size, void *const opaque_data) +{ + struct packet_diag_mclist *dml = elem_buf; + uint16_t alen = MIN(dml->pdmc_alen, sizeof(dml->pdmc_addr)); + + PRINT_FIELD_IFINDEX("{", *dml, pdmc_index); + PRINT_FIELD_U(", ", *dml, pdmc_count); + PRINT_FIELD_U(", ", *dml, pdmc_type); + PRINT_FIELD_U(", ", *dml, pdmc_alen); + PRINT_FIELD_STRING(", ", *dml, pdmc_addr, alen, QUOTE_FORCE_HEX); + tprints("}"); + + return true; +} + +static bool +decode_packet_diag_mclist(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct packet_diag_mclist dml; + const size_t nmemb = len / sizeof(dml); + + if (!nmemb) + return false; + + print_array(tcp, addr, nmemb, &dml, sizeof(dml), + tfetch_mem, print_packet_diag_mclist, 0); + + return true; +} + +static bool +decode_packet_diag_ring(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct packet_diag_ring pdr; + + if (len < sizeof(pdr)) + return false; + if (umove_or_printaddr(tcp, addr, &pdr)) + return true; + + PRINT_FIELD_U("{", pdr, pdr_block_size); + PRINT_FIELD_U(", ", pdr, pdr_block_nr); + PRINT_FIELD_U(", ", pdr, pdr_frame_size); + PRINT_FIELD_U(", ", pdr, pdr_frame_nr); + PRINT_FIELD_U(", ", pdr, pdr_retire_tmo); + PRINT_FIELD_U(", ", pdr, pdr_sizeof_priv); + PRINT_FIELD_U(", ", pdr, pdr_features); + tprints("}"); + + return true; +} + +static bool +decode_packet_diag_filter(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + const unsigned int nmemb = len / sizeof(struct sock_filter); + if (!nmemb || (unsigned short) nmemb != nmemb) + return false; + + print_sock_fprog(tcp, addr, nmemb); + + return true; +} + +static const nla_decoder_t packet_diag_msg_nla_decoders[] = { + [PACKET_DIAG_INFO] = decode_packet_diag_info, + [PACKET_DIAG_MCLIST] = decode_packet_diag_mclist, + [PACKET_DIAG_RX_RING] = decode_packet_diag_ring, + [PACKET_DIAG_TX_RING] = decode_packet_diag_ring, + [PACKET_DIAG_FANOUT] = decode_nla_u32, + [PACKET_DIAG_UID] = decode_nla_uid, + [PACKET_DIAG_MEMINFO] = decode_nla_meminfo, + [PACKET_DIAG_FILTER] = decode_packet_diag_filter +}; + +DECL_NETLINK_DIAG_DECODER(decode_packet_diag_msg) +{ + struct packet_diag_msg msg = { .pdiag_family = family }; + size_t offset = sizeof(msg.pdiag_family); + bool decode_nla = false; + + PRINT_FIELD_XVAL("{", msg, pdiag_family, addrfams, "AF_???"); + tprints(", "); + if (len >= sizeof(msg)) { + if (!umoven_or_printaddr(tcp, addr + offset, + sizeof(msg) - offset, + (char *) &msg + offset)) { + PRINT_FIELD_XVAL("", msg, pdiag_type, + socktypes, "SOCK_???"); + PRINT_FIELD_XVAL_SORTED_SIZED(", ", msg, pdiag_num, + ethernet_protocols, + ethernet_protocols_size, + "ETH_P_???"); + PRINT_FIELD_U(", ", msg, pdiag_ino); + PRINT_FIELD_COOKIE(", ", msg, pdiag_cookie); + decode_nla = true; + } + } else + tprints("..."); + tprints("}"); + + offset = NLMSG_ALIGN(sizeof(msg)); + if (decode_nla && len > offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + packet_diag_attrs, "PACKET_DIAG_???", + packet_diag_msg_nla_decoders, + ARRAY_SIZE(packet_diag_msg_nla_decoders), NULL); + } +} diff --git a/netlink_route.c b/netlink_route.c new file mode 100644 index 00000000..ff803fae --- /dev/null +++ b/netlink_route.c @@ -0,0 +1,127 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "netlink.h" +#include "netlink_route.h" + +#include + +#include "xlat/nl_route_types.h" + +static void +decode_family(struct tcb *const tcp, const uint8_t family, + const kernel_ulong_t addr, const unsigned int len) +{ + tprints("{family="); + printxval(addrfams, family, "AF_???"); + if (len > sizeof(family)) { + tprints(", "); + printstr_ex(tcp, addr + sizeof(family), + len - sizeof(family), QUOTE_FORCE_HEX); + } + tprints("}"); +} + +typedef DECL_NETLINK_ROUTE_DECODER((*netlink_route_decoder_t)); + +static const netlink_route_decoder_t route_decoders[] = { + [RTM_DELLINK - RTM_BASE] = decode_ifinfomsg, + [RTM_GETLINK - RTM_BASE] = decode_ifinfomsg, + [RTM_NEWLINK - RTM_BASE] = decode_ifinfomsg, + [RTM_SETLINK - RTM_BASE] = decode_ifinfomsg, + + [RTM_DELADDR - RTM_BASE] = decode_ifaddrmsg, + [RTM_GETADDR - RTM_BASE] = decode_ifaddrmsg, + [RTM_GETANYCAST - RTM_BASE] = decode_ifaddrmsg, + [RTM_GETMULTICAST - RTM_BASE] = decode_ifaddrmsg, + [RTM_NEWADDR - RTM_BASE] = decode_ifaddrmsg, + + [RTM_DELROUTE - RTM_BASE] = decode_rtmsg, + [RTM_GETROUTE - RTM_BASE] = decode_rtmsg, + [RTM_NEWROUTE - RTM_BASE] = decode_rtmsg, + + [RTM_DELRULE - RTM_BASE] = decode_fib_rule_hdr, + [RTM_GETRULE - RTM_BASE] = decode_fib_rule_hdr, + [RTM_NEWRULE - RTM_BASE] = decode_fib_rule_hdr, + + [RTM_DELNEIGH - RTM_BASE] = decode_ndmsg, + [RTM_GETNEIGH - RTM_BASE] = decode_rtm_getneigh, + [RTM_NEWNEIGH - RTM_BASE] = decode_ndmsg, + + [RTM_GETNEIGHTBL - RTM_BASE] = decode_ndtmsg, + [RTM_NEWNEIGHTBL - RTM_BASE] = decode_ndtmsg, + [RTM_SETNEIGHTBL - RTM_BASE] = decode_ndtmsg, + + [RTM_DELQDISC - RTM_BASE] = decode_tcmsg, + [RTM_GETQDISC - RTM_BASE] = decode_tcmsg, + [RTM_NEWQDISC - RTM_BASE] = decode_tcmsg, + [RTM_DELTCLASS - RTM_BASE] = decode_tcmsg, + [RTM_GETTCLASS - RTM_BASE] = decode_tcmsg, + [RTM_NEWTCLASS - RTM_BASE] = decode_tcmsg, + [RTM_DELTFILTER - RTM_BASE] = decode_tcmsg, + [RTM_GETTFILTER - RTM_BASE] = decode_tcmsg, + [RTM_NEWTFILTER - RTM_BASE] = decode_tcmsg, + + [RTM_DELACTION - RTM_BASE] = decode_tcamsg, + [RTM_GETACTION - RTM_BASE] = decode_tcamsg, + [RTM_NEWACTION - RTM_BASE] = decode_tcamsg, + +#ifdef HAVE_STRUCT_IFADDRLBLMSG + [RTM_DELADDRLABEL - RTM_BASE] = decode_ifaddrlblmsg, + [RTM_GETADDRLABEL - RTM_BASE] = decode_ifaddrlblmsg, + [RTM_NEWADDRLABEL - RTM_BASE] = decode_ifaddrlblmsg, +#endif + +#ifdef HAVE_STRUCT_DCBMSG + [RTM_GETDCB - RTM_BASE] = decode_dcbmsg, + [RTM_SETDCB - RTM_BASE] = decode_dcbmsg, +#endif + +#ifdef HAVE_STRUCT_NETCONFMSG + [RTM_DELNETCONF - RTM_BASE] = decode_netconfmsg, + [RTM_GETNETCONF - RTM_BASE] = decode_netconfmsg, + [RTM_NEWNETCONF - RTM_BASE] = decode_netconfmsg, +#endif + +#ifdef HAVE_STRUCT_BR_PORT_MSG + [RTM_DELMDB - RTM_BASE] = decode_br_port_msg, + [RTM_GETMDB - RTM_BASE] = decode_br_port_msg, + [RTM_NEWMDB - RTM_BASE] = decode_br_port_msg, +#endif + + [RTM_DELNSID - RTM_BASE] = decode_rtgenmsg, + [RTM_GETNSID - RTM_BASE] = decode_rtgenmsg, + [RTM_NEWNSID - RTM_BASE] = decode_rtgenmsg +}; + +bool +decode_netlink_route(struct tcb *const tcp, + const struct nlmsghdr *const nlmsghdr, + const kernel_ulong_t addr, + const unsigned int len) +{ + uint8_t family; + + if (nlmsghdr->nlmsg_type == NLMSG_DONE) + return false; + + if (!umove_or_printaddr(tcp, addr, &family)) { + const unsigned int index = nlmsghdr->nlmsg_type - RTM_BASE; + + if (index < ARRAY_SIZE(route_decoders) + && route_decoders[index]) { + route_decoders[index](tcp, nlmsghdr, family, addr, len); + } else { + decode_family(tcp, family, addr, len); + } + } + + return true; +} diff --git a/netlink_route.h b/netlink_route.h new file mode 100644 index 00000000..62aecf7f --- /dev/null +++ b/netlink_route.h @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_NETLINK_ROUTE_H +# define STRACE_NETLINK_ROUTE_H + +# define DECL_NETLINK_ROUTE_DECODER(route_decode_name) \ +void \ +route_decode_name(struct tcb *tcp, \ + const struct nlmsghdr *nlmsghdr, \ + uint8_t family, \ + kernel_ulong_t addr, \ + unsigned int len) \ +/* End of DECL_NETLINK_ROUTE_DECODER definition. */ + +extern DECL_NETLINK_ROUTE_DECODER(decode_br_port_msg); +extern DECL_NETLINK_ROUTE_DECODER(decode_dcbmsg); +extern DECL_NETLINK_ROUTE_DECODER(decode_fib_rule_hdr); +extern DECL_NETLINK_ROUTE_DECODER(decode_ifaddrlblmsg); +extern DECL_NETLINK_ROUTE_DECODER(decode_ifaddrmsg); +extern DECL_NETLINK_ROUTE_DECODER(decode_ifinfomsg); +extern DECL_NETLINK_ROUTE_DECODER(decode_ndmsg); +extern DECL_NETLINK_ROUTE_DECODER(decode_ndtmsg); +extern DECL_NETLINK_ROUTE_DECODER(decode_netconfmsg); +extern DECL_NETLINK_ROUTE_DECODER(decode_rtgenmsg); +extern DECL_NETLINK_ROUTE_DECODER(decode_rtm_getneigh); +extern DECL_NETLINK_ROUTE_DECODER(decode_rtmsg); +extern DECL_NETLINK_ROUTE_DECODER(decode_tcamsg); +extern DECL_NETLINK_ROUTE_DECODER(decode_tcmsg); + +#endif /* !STRACE_NETLINK_ROUTE_H */ diff --git a/netlink_selinux.c b/netlink_selinux.c new file mode 100644 index 00000000..5384328b --- /dev/null +++ b/netlink_selinux.c @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "netlink.h" +#include "print_fields.h" + +#include + +bool +decode_netlink_selinux(struct tcb *const tcp, + const struct nlmsghdr *const nlmsghdr, + const kernel_ulong_t addr, + const unsigned int len) +{ + switch (nlmsghdr->nlmsg_type) { + case SELNL_MSG_SETENFORCE: { + struct selnl_msg_setenforce msg; + + if (len < sizeof(msg)) + printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX); + else if (!umove_or_printaddr(tcp, addr, &msg)) { + PRINT_FIELD_D("{", msg, val); + tprints("}"); + } + break; + } + case SELNL_MSG_POLICYLOAD: { + struct selnl_msg_policyload msg; + + if (len < sizeof(msg)) + printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX); + else if (!umove_or_printaddr(tcp, addr, &msg)) { + PRINT_FIELD_U("{", msg, seqno); + tprints("}"); + } + break; + } + default: + return false; + } + + return true; +} diff --git a/netlink_smc_diag.c b/netlink_smc_diag.c new file mode 100644 index 00000000..9255c0de --- /dev/null +++ b/netlink_smc_diag.c @@ -0,0 +1,243 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include + +#ifndef AF_SMC +# define XLAT_MACROS_ONLY +# include "xlat/addrfams.h" +# undef XLAT_MACROS_ONLY +#endif + +#include "netlink.h" +#include "netlink_sock_diag.h" +#include "nlattr.h" +#include "print_fields.h" + +#include +#include + +#include "xlat/smc_decl_codes.h" +#include "xlat/smc_diag_attrs.h" +#include "xlat/smc_diag_extended_flags.h" +#include "xlat/smc_diag_mode.h" +#include "xlat/smc_link_group_roles.h" +#include "xlat/smc_states.h" +#include "xlat/sock_shutdown_flags.h" + +DECL_NETLINK_DIAG_DECODER(decode_smc_diag_req) +{ + struct smc_diag_req req = { .diag_family = family }; + const size_t offset = sizeof(req.diag_family); + + PRINT_FIELD_XVAL("{", req, diag_family, addrfams, "AF_???"); + tprints(", "); + if (len >= sizeof(req)) { + if (!umoven_or_printaddr(tcp, addr + offset, + sizeof(req) - offset, + (void *) &req + offset)) { + PRINT_FIELD_FLAGS("", req, diag_ext, + smc_diag_extended_flags, + "1<= sizeof(msg)) { + if (!umoven_or_printaddr(tcp, addr + offset, + sizeof(msg) - offset, + (void *) &msg + offset)) { + PRINT_FIELD_XVAL("", msg, diag_state, + smc_states, "SMC_???"); + PRINT_FIELD_XVAL_INDEX(", ", msg, diag_fallback, + smc_diag_mode, + "SMC_DIAG_MODE_???"); + PRINT_FIELD_U(", ", msg, diag_shutdown); + /* + * AF_SMC protocol family socket handler + * keeping the AF_INET sock address. + */ + PRINT_FIELD_INET_DIAG_SOCKID(", ", msg, id, AF_INET); + PRINT_FIELD_U(", ", msg, diag_uid); + PRINT_FIELD_U(", ", msg, diag_inode); + decode_nla = true; + } + } else + tprints("..."); + tprints("}"); + + offset = NLMSG_ALIGN(sizeof(msg)); + if (decode_nla && len > offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + smc_diag_attrs, "SMC_DIAG_???", + smc_diag_msg_nla_decoders, + ARRAY_SIZE(smc_diag_msg_nla_decoders), NULL); + } +} diff --git a/netlink_sock_diag.c b/netlink_sock_diag.c new file mode 100644 index 00000000..5185e5d2 --- /dev/null +++ b/netlink_sock_diag.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "netlink.h" +#include "netlink_sock_diag.h" + +#define XLAT_MACROS_ONLY +#include "xlat/addrfams.h" +#undef XLAT_MACROS_ONLY + +static void +decode_family(struct tcb *const tcp, const uint8_t family, + const kernel_ulong_t addr, const unsigned int len) +{ + tprints("{family="); + printxval(addrfams, family, "AF_???"); + if (len > sizeof(family)) { + tprints(", "); + printstr_ex(tcp, addr + sizeof(family), + len - sizeof(family), QUOTE_FORCE_HEX); + } + tprints("}"); +} + +typedef DECL_NETLINK_DIAG_DECODER((*netlink_diag_decoder_t)); + +static const struct { + const netlink_diag_decoder_t request, response; +} diag_decoders[] = { + [AF_UNIX] = { decode_unix_diag_req, decode_unix_diag_msg }, + [AF_INET] = { decode_inet_diag_req, decode_inet_diag_msg }, + [AF_INET6] = { decode_inet_diag_req, decode_inet_diag_msg }, + [AF_NETLINK] = { decode_netlink_diag_req, decode_netlink_diag_msg }, + [AF_PACKET] = { decode_packet_diag_req, decode_packet_diag_msg }, + [AF_SMC] = { decode_smc_diag_req, decode_smc_diag_msg }, +}; + +bool +decode_netlink_sock_diag(struct tcb *const tcp, + const struct nlmsghdr *const nlmsghdr, + const kernel_ulong_t addr, + const unsigned int len) +{ + uint8_t family; + + if (nlmsghdr->nlmsg_type == NLMSG_DONE) + return false; + + if (!umove_or_printaddr(tcp, addr, &family)) { + if (family < ARRAY_SIZE(diag_decoders) + && len > sizeof(family)) { + const netlink_diag_decoder_t decoder = + (nlmsghdr->nlmsg_flags & NLM_F_REQUEST) + ? diag_decoders[family].request + : diag_decoders[family].response; + + if (decoder) { + decoder(tcp, nlmsghdr, family, addr, len); + return true; + } + } + + decode_family(tcp, family, addr, len); + } + + return true; +} diff --git a/netlink_sock_diag.h b/netlink_sock_diag.h new file mode 100644 index 00000000..95fbc339 --- /dev/null +++ b/netlink_sock_diag.h @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_NETLINK_SOCK_DIAG_H +# define STRACE_NETLINK_SOCK_DIAG_H + +# define DECL_NETLINK_DIAG_DECODER(diag_decode_name) \ +void \ +diag_decode_name(struct tcb *tcp, \ + const struct nlmsghdr *nlmsghdr, \ + uint8_t family, \ + kernel_ulong_t addr, \ + unsigned int len) \ +/* End of DECL_NETLINK_DIAG_DECODER definition. */ + +extern DECL_NETLINK_DIAG_DECODER(decode_inet_diag_msg); +extern DECL_NETLINK_DIAG_DECODER(decode_inet_diag_req); +extern DECL_NETLINK_DIAG_DECODER(decode_netlink_diag_msg); +extern DECL_NETLINK_DIAG_DECODER(decode_netlink_diag_req); +extern DECL_NETLINK_DIAG_DECODER(decode_packet_diag_msg); +extern DECL_NETLINK_DIAG_DECODER(decode_packet_diag_req); +extern DECL_NETLINK_DIAG_DECODER(decode_smc_diag_msg); +extern DECL_NETLINK_DIAG_DECODER(decode_smc_diag_req); +extern DECL_NETLINK_DIAG_DECODER(decode_unix_diag_msg); +extern DECL_NETLINK_DIAG_DECODER(decode_unix_diag_req); + +struct inet_diag_sockid; + +extern void +print_inet_diag_sockid(const struct inet_diag_sockid *, const uint8_t family); + +# define PRINT_FIELD_INET_DIAG_SOCKID(prefix_, where_, field_, af_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + print_inet_diag_sockid(&(where_).field_, (af_)); \ + } while (0) + + +#endif /* !STRACE_NETLINK_SOCK_DIAG_H */ diff --git a/netlink_unix_diag.c b/netlink_unix_diag.c new file mode 100644 index 00000000..5a909963 --- /dev/null +++ b/netlink_unix_diag.c @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "netlink.h" +#include "netlink_sock_diag.h" +#include "nlattr.h" +#include "print_fields.h" + +#include +#include + +#include "xlat/unix_diag_attrs.h" +#include "xlat/unix_diag_show.h" + +DECL_NETLINK_DIAG_DECODER(decode_unix_diag_req) +{ + struct unix_diag_req req = { .sdiag_family = family }; + const size_t offset = sizeof(req.sdiag_family); + + PRINT_FIELD_XVAL("{", req, sdiag_family, addrfams, "AF_???"); + tprints(", "); + if (len >= sizeof(req)) { + if (!umoven_or_printaddr(tcp, addr + offset, + sizeof(req) - offset, + (char *) &req + offset)) { + PRINT_FIELD_U("", req, sdiag_protocol); + PRINT_FIELD_FLAGS(", ", req, udiag_states, + tcp_state_flags, "1<= sizeof(msg)) { + if (!umoven_or_printaddr(tcp, addr + offset, + sizeof(msg) - offset, + (char *) &msg + offset)) { + PRINT_FIELD_XVAL("", msg, udiag_type, + socktypes, "SOCK_???"); + PRINT_FIELD_XVAL(", ", msg, udiag_state, + tcp_states, "TCP_???"); + PRINT_FIELD_U(", ", msg, udiag_ino); + PRINT_FIELD_COOKIE(", ", msg, udiag_cookie); + decode_nla = true; + } + } else + tprints("..."); + tprints("}"); + + offset = NLMSG_ALIGN(sizeof(msg)); + if (decode_nla && len > offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + unix_diag_attrs, "UNIX_DIAG_???", + unix_diag_msg_nla_decoders, + ARRAY_SIZE(unix_diag_msg_nla_decoders), NULL); + } +} diff --git a/nlattr.c b/nlattr.c new file mode 100644 index 00000000..f3df7d99 --- /dev/null +++ b/nlattr.c @@ -0,0 +1,474 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include +#include "netlink.h" +#include "nlattr.h" +#include +#include +#include +#include "static_assert.h" + +#include "xlat/netlink_sk_meminfo_indices.h" + +static bool +fetch_nlattr(struct tcb *const tcp, struct nlattr *const nlattr, + const kernel_ulong_t addr, const unsigned int len, + const bool in_array) +{ + if (len < sizeof(struct nlattr)) { + printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX); + return false; + } + + if (tfetch_obj(tcp, addr, nlattr)) + return true; + + if (in_array) { + tprints("..."); + printaddr_comment(addr); + } else { + printaddr(addr); + } + + return false; +} + +static void +print_nlattr(const struct nlattr *const nla, + const struct xlat *const table, + const char *const dflt) +{ + static_assert(NLA_TYPE_MASK == ~(NLA_F_NESTED | NLA_F_NET_BYTEORDER), + "wrong NLA_TYPE_MASK"); + + tprintf("{nla_len=%u, nla_type=", nla->nla_len); + if (nla->nla_type & NLA_F_NESTED) { + print_xlat(NLA_F_NESTED); + tprints("|"); + } + if (nla->nla_type & NLA_F_NET_BYTEORDER) { + print_xlat(NLA_F_NET_BYTEORDER); + tprints("|"); + } + printxval(table, nla->nla_type & NLA_TYPE_MASK, dflt); + tprints("}"); +} + +static void +decode_nlattr_with_data(struct tcb *const tcp, + const struct nlattr *const nla, + const kernel_ulong_t addr, + const unsigned int len, + const struct xlat *const table, + const char *const dflt, + const nla_decoder_t *const decoders, + const unsigned int size, + const void *const opaque_data) +{ + const unsigned int nla_len = MIN(nla->nla_len, len); + + if (nla_len > NLA_HDRLEN) + tprints("{"); + + print_nlattr(nla, table, dflt); + + if (nla_len > NLA_HDRLEN) { + const unsigned int idx = + size ? nla->nla_type & NLA_TYPE_MASK : 0; + + tprints(", "); + if (!decoders + || (size && idx >= size) + || !decoders[idx] + || !decoders[idx]( + tcp, addr + NLA_HDRLEN, + nla_len - NLA_HDRLEN, + size ? opaque_data + : (const void *) (uintptr_t) nla->nla_type) + ) + printstr_ex(tcp, addr + NLA_HDRLEN, + nla_len - NLA_HDRLEN, QUOTE_FORCE_HEX); + tprints("}"); + } +} + +void +decode_nlattr(struct tcb *const tcp, + kernel_ulong_t addr, + unsigned int len, + const struct xlat *const table, + const char *const dflt, + const nla_decoder_t *const decoders, + const unsigned int size, + const void *const opaque_data) +{ + struct nlattr nla; + bool is_array = false; + unsigned int elt; + + if (decoders && !size && opaque_data) + error_func_msg("[xlat %p, dflt \"%s\", decoders %p] " + "size is zero (going to pass nla_type as " + "decoder argument), but opaque data (%p) is not " + "- will be ignored", + table, dflt, decoders, opaque_data); + + for (elt = 0; fetch_nlattr(tcp, &nla, addr, len, is_array); elt++) { + if (abbrev(tcp) && elt == max_strlen) { + tprints("..."); + break; + } + + const unsigned int nla_len = NLA_ALIGN(nla.nla_len); + kernel_ulong_t next_addr = 0; + unsigned int next_len = 0; + + if (nla.nla_len >= NLA_HDRLEN) { + next_len = (len >= nla_len) ? len - nla_len : 0; + + if (next_len && addr + nla_len > addr) + next_addr = addr + nla_len; + } + + if (!is_array && next_addr) { + tprints("["); + is_array = true; + } + + decode_nlattr_with_data(tcp, &nla, addr, len, table, dflt, + decoders, size, opaque_data); + + if (!next_addr) + break; + + tprints(", "); + addr = next_addr; + len = next_len; + } + + if (is_array) { + tprints("]"); + } +} + +bool +decode_nla_str(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + printstr_ex(tcp, addr, len, QUOTE_0_TERMINATED); + + return true; +} + +bool +decode_nla_strn(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + printstrn(tcp, addr, len); + + return true; +} + +bool +decode_nla_meminfo(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + uint32_t mem; + const size_t nmemb = len / sizeof(mem); + + if (!nmemb) + return false; + + unsigned int count = 0; + print_array_ex(tcp, addr, nmemb, &mem, sizeof(mem), + tfetch_mem, print_uint32_array_member, &count, + PAF_PRINT_INDICES | PAF_INDEX_XLAT_VALUE_INDEXED + | XLAT_STYLE_FMT_U, + ARRSZ_PAIR(netlink_sk_meminfo_indices) - 1, + "SK_MEMINFO_???"); + + return true; +} + +bool +decode_nla_fd(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + int fd; + + if (len < sizeof(fd)) + return false; + else if (!umove_or_printaddr(tcp, addr, &fd)) + printfd(tcp, fd); + + return true; +} + +bool +decode_nla_uid(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + uint32_t uid; + + if (len < sizeof(uid)) + return false; + else if (!umove_or_printaddr(tcp, addr, &uid)) + printuid("", uid); + + return true; +} + +bool +decode_nla_gid(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + return decode_nla_uid(tcp, addr, len, opaque_data); +} + +bool +decode_nla_ifindex(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + uint32_t ifindex; + + if (len < sizeof(ifindex)) + return false; + else if (!umove_or_printaddr(tcp, addr, &ifindex)) + print_ifindex(ifindex); + + return true; +} + +bool +decode_nla_xval(struct tcb *const tcp, + const kernel_ulong_t addr, + unsigned int len, + const void *const opaque_data) +{ + const struct decode_nla_xlat_opts * const opts = opaque_data; + union { + uint64_t val; + uint8_t bytes[sizeof(uint64_t)]; + } data = { .val = 0 }; + + if (len > sizeof(data) || len < opts->size) + return false; + + if (opts->size) + len = MIN(len, opts->size); + + const size_t bytes_offs = is_bigendian ? sizeof(data) - len : 0; + + if (!umoven_or_printaddr(tcp, addr, len, data.bytes + bytes_offs)) { + if (opts->process_fn) + data.val = opts->process_fn(data.val); + if (opts->prefix) + tprints(opts->prefix); + printxval_dispatch_ex(opts->xlat, opts->xlat_size, data.val, + opts->dflt, opts->xt, opts->style); + if (opts->suffix) + tprints(opts->suffix); + } + + return true; +} + +static uint64_t +process_host_order(uint64_t val) +{ + return ntohs(val); +} + +bool +decode_nla_ether_proto(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + const struct decode_nla_xlat_opts opts = { + .xlat = ethernet_protocols, + .xlat_size = ethernet_protocols_size, + .dflt = "ETHER_P_???", + .xt = XT_SORTED, + .prefix = "htons(", + .suffix = ")", + .size = 2, + .process_fn = process_host_order, + }; + + return decode_nla_xval(tcp, addr, len, &opts); +} + +bool +decode_nla_ip_proto(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + const struct decode_nla_xlat_opts opts = { + .xlat = inet_protocols, + .xlat_size = inet_protocols_size, + .xt = XT_SORTED, + .dflt = "IPPROTO_???", + .size = 1, + }; + + return decode_nla_xval(tcp, addr, len, &opts); +} + +bool +decode_nla_in_addr(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct in_addr in; + + if (len < sizeof(in)) + return false; + else if (!umove_or_printaddr(tcp, addr, &in)) + print_inet_addr(AF_INET, &in, sizeof(in), NULL); + + return true; +} + +bool +decode_nla_in6_addr(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct in6_addr in6; + + if (len < sizeof(in6)) + return false; + else if (!umove_or_printaddr(tcp, addr, &in6)) + print_inet_addr(AF_INET6, &in6, sizeof(in6), NULL); + + return true; +} + +bool +decode_nla_flags(struct tcb *const tcp, + const kernel_ulong_t addr, + unsigned int len, + const void *const opaque_data) +{ + const struct decode_nla_xlat_opts * const opts = opaque_data; + union { + uint64_t flags; + uint8_t bytes[sizeof(uint64_t)]; + } data = { .flags = 0 }; + + if (len > sizeof(data) || len < opts->size) + return false; + + if (opts->size) + len = MIN(len, opts->size); + + const size_t bytes_offs = is_bigendian ? sizeof(data) - len : 0; + + if (opts->xt == XT_INDEXED) + error_func_msg("indexed xlats are currently incompatible with " + "printflags"); + + if (!umoven_or_printaddr(tcp, addr, len, data.bytes + bytes_offs)) { + if (opts->process_fn) + data.flags = opts->process_fn(data.flags); + if (opts->prefix) + tprints(opts->prefix); + printflags_ex(data.flags, opts->dflt, opts->style, opts->xlat, + NULL); + if (opts->suffix) + tprints(opts->suffix); + } + + return true; +} + +bool +decode_nla_be16(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + uint16_t num; + + if (len < sizeof(num)) + return false; + else if (!umove_or_printaddr(tcp, addr, &num)) + tprintf("htons(%u)", ntohs(num)); + + return true; +} + +bool +decode_nla_be64(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ +#if defined HAVE_BE64TOH || defined be64toh + uint64_t num; + + if (len < sizeof(num)) + return false; + else if (!umove_or_printaddr(tcp, addr, &num)) + tprintf("htobe64(%" PRIu64 ")", be64toh(num)); + + return true; +#else + return false; +#endif +} + +#define DECODE_NLA_INTEGER(name, type, fmt) \ +bool \ +decode_nla_ ## name(struct tcb *const tcp, \ + const kernel_ulong_t addr, \ + const unsigned int len, \ + const void *const opaque_data) \ +{ \ + type num; \ + \ + if (len < sizeof(num)) \ + return false; \ + if (!umove_or_printaddr(tcp, addr, &num)) \ + tprintf(fmt, num); \ + return true; \ +} + +DECODE_NLA_INTEGER(x8, uint8_t, "%#" PRIx8) +DECODE_NLA_INTEGER(x16, uint16_t, "%#" PRIx16) +DECODE_NLA_INTEGER(x32, uint32_t, "%#" PRIx32) +DECODE_NLA_INTEGER(x64, uint64_t, "%#" PRIx64) +DECODE_NLA_INTEGER(u8, uint8_t, "%" PRIu8) +DECODE_NLA_INTEGER(u16, uint16_t, "%" PRIu16) +DECODE_NLA_INTEGER(u32, uint32_t, "%" PRIu32) +DECODE_NLA_INTEGER(u64, uint64_t, "%" PRIu64) +DECODE_NLA_INTEGER(s8, int8_t, "%" PRId8) +DECODE_NLA_INTEGER(s16, int16_t, "%" PRId16) +DECODE_NLA_INTEGER(s32, int32_t, "%" PRId32) +DECODE_NLA_INTEGER(s64, int64_t, "%" PRId64) diff --git a/nlattr.h b/nlattr.h new file mode 100644 index 00000000..a11f2f1d --- /dev/null +++ b/nlattr.h @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_NLATTR_H +# define STRACE_NLATTR_H + +# include "xlat.h" + +struct decode_nla_xlat_opts { + const struct xlat *xlat; + size_t xlat_size; /* is not needed for XT_NORMAL */ + const char *dflt; + enum xlat_type xt; + enum xlat_style style; + const char *prefix; + const char *suffix; + uint64_t (*process_fn)(uint64_t val); + size_t size; +}; + +/* + * Used for IFLA_LINKINFO decoding. Since there are no other indicators + * regarding the nature of data except for previously provided string + * in an IFLA_LINKINFO_KIND attribute, we have to store it in order to pass + * between calls as an opaque data. + */ +struct ifla_linkinfo_ctx { + char kind[16]; +}; + +typedef bool (*nla_decoder_t)(struct tcb *, kernel_ulong_t addr, + unsigned int len, const void *opaque_data); + +/** + * The case of non-NULL decoders and zero size is handled in a special way: + * the zeroth decoder is always called with nla_type being passed as opaque + * data. + */ +extern void +decode_nlattr(struct tcb *, + kernel_ulong_t addr, + unsigned int len, + const struct xlat *, + const char *dflt, + const nla_decoder_t *decoders, + unsigned int size, + const void *opaque_data); + +# define DECL_NLA(name) \ +extern bool \ +decode_nla_ ## name(struct tcb *, kernel_ulong_t addr, \ + unsigned int len, const void *) \ +/* End of DECL_NLA definition. */ + +DECL_NLA(x8); +DECL_NLA(x16); +DECL_NLA(x32); +DECL_NLA(x64); +DECL_NLA(u8); +DECL_NLA(u16); +DECL_NLA(u32); +DECL_NLA(u64); +DECL_NLA(s8); +DECL_NLA(s16); +DECL_NLA(s32); +DECL_NLA(s64); +DECL_NLA(be16); +DECL_NLA(be64); +DECL_NLA(xval); +DECL_NLA(flags); +DECL_NLA(str); +DECL_NLA(strn); +DECL_NLA(fd); +DECL_NLA(uid); +DECL_NLA(gid); +DECL_NLA(ifindex); +DECL_NLA(ether_proto); +DECL_NLA(ip_proto); +DECL_NLA(in_addr); +DECL_NLA(in6_addr); +DECL_NLA(meminfo); +DECL_NLA(rt_class); +DECL_NLA(rt_proto); +DECL_NLA(tc_stats); + +#endif /* !STRACE_NLATTR_H */ diff --git a/nsfs.c b/nsfs.c new file mode 100644 index 00000000..7b804fb3 --- /dev/null +++ b/nsfs.c @@ -0,0 +1,40 @@ +/* + * Support for decoding of NS_* ioctl commands. + * + * Copyright (c) 2017 Nikolay Marchuk + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "nsfs.h" + +int +nsfs_ioctl(struct tcb *tcp, unsigned int code, kernel_ulong_t arg) +{ + unsigned int uid; + switch (code) { + case NS_GET_USERNS: + case NS_GET_PARENT: + return RVAL_IOCTL_DECODED | RVAL_FD; + case NS_GET_NSTYPE: + if (entering(tcp)) + return 0; + if (!syserror(tcp)) + tcp->auxstr = xlookup(setns_types, tcp->u_rval); + return RVAL_IOCTL_DECODED | RVAL_STR; + case NS_GET_OWNER_UID: + if (entering(tcp)) + return 0; + tprints(", "); + if (!umove_or_printaddr(tcp, arg, &uid)) { + printuid("[", uid); + tprints("]"); + } + return RVAL_IOCTL_DECODED; + default: + return RVAL_DECODED; + } +} diff --git a/nsfs.h b/nsfs.h new file mode 100644 index 00000000..0f8106a9 --- /dev/null +++ b/nsfs.h @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_NSFS_H +# define STRACE_NSFS_H + +# include + +# ifdef HAVE_LINUX_NSFS_H +# include +# else +# define NSIO 0xb7 +# define NS_GET_USERNS _IO(NSIO, 0x1) +# define NS_GET_PARENT _IO(NSIO, 0x2) +# endif + +# ifndef NS_GET_NSTYPE +# define NS_GET_NSTYPE _IO(NSIO, 0x3) +# endif +# ifndef NS_GET_OWNER_UID +# define NS_GET_OWNER_UID _IO(NSIO, 0x4) +# endif + +#endif /* !STRACE_NSFS_H */ diff --git a/nsig.h b/nsig.h index 528f7033..7724a570 100644 --- a/nsig.h +++ b/nsig.h @@ -1,15 +1,22 @@ +/* + * Copyright (c) 2016-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #ifndef STRACE_NSIG_H -#define STRACE_NSIG_H +# define STRACE_NSIG_H -#include +# include -#ifndef NSIG -# warning NSIG is not defined, using 32 -# define NSIG 32 -#elif NSIG < 32 -# error NSIG < 32 -#endif +# ifndef NSIG +# warning NSIG is not defined, using 32 +# define NSIG 32 +# elif NSIG < 32 +# error NSIG < 32 +# endif -#define NSIG_BYTES (NSIG / 8) +# define NSIG_BYTES (NSIG / 8) #endif /* !STRACE_NSIG_H */ diff --git a/numa.c b/numa.c index c2cd143a..0029dfb3 100644 --- a/numa.c +++ b/numa.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2003-2007 Ulrich Drepper * Copyright (c) 2005-2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -33,10 +14,10 @@ print_node(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) { if (elem_size < sizeof(kernel_ulong_t)) { tprintf("%#0*x", (int) elem_size * 2 + 2, - * (unsigned int *) elem_buf); + *(unsigned int *) elem_buf); } else { tprintf("%#0*" PRI_klx, (int) elem_size * 2 + 2, - * (kernel_ulong_t *) elem_buf); + *(kernel_ulong_t *) elem_buf); } return true; @@ -58,7 +39,7 @@ print_nodemask(struct tcb *const tcp, const kernel_ulong_t addr, kernel_ulong_t buf; print_array(tcp, addr, nmemb, &buf, current_wordsize, - umoven_or_printaddr, print_node, 0); + tfetch_mem, print_node, 0); } SYS_FUNC(migrate_pages) @@ -126,9 +107,9 @@ print_addr(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) kernel_ulong_t addr; if (elem_size < sizeof(addr)) { - addr = * (unsigned int *) elem_buf; + addr = *(unsigned int *) elem_buf; } else { - addr = * (kernel_ulong_t *) elem_buf; + addr = *(kernel_ulong_t *) elem_buf; } printaddr(addr); @@ -139,20 +120,22 @@ print_addr(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) static bool print_status(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) { - const int status = * (int *) elem_buf; + const int status = *(int *) elem_buf; + bool is_errno = (status < 0) && ((unsigned) -status < nerrnos); - if (status < 0 && (unsigned) -status < nerrnos) - tprintf("%s", errnoent[-status]); - else + if (!is_errno || xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) tprintf("%d", status); - return true; -} + if (!is_errno || xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) + return true; -static bool -print_int(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) -{ - tprintf("%d", * (int *) elem_buf); + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) + tprints(" /* "); + + tprintf("-%s", errnoent[-status]); + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) + tprints(" */"); return true; } @@ -165,14 +148,14 @@ SYS_FUNC(move_pages) if (entering(tcp)) { tprintf("%d, %" PRI_klu ", ", (int) tcp->u_arg[0], npages); print_array(tcp, tcp->u_arg[2], npages, &buf, current_wordsize, - umoven_or_printaddr, print_addr, 0); + tfetch_mem, print_addr, 0); tprints(", "); print_array(tcp, tcp->u_arg[3], npages, &buf, sizeof(int), - umoven_or_printaddr, print_int, 0); + tfetch_mem, print_int32_array_member, 0); tprints(", "); } else { print_array(tcp, tcp->u_arg[4], npages, &buf, sizeof(int), - umoven_or_printaddr, print_status, 0); + tfetch_mem, print_status, 0); tprints(", "); printflags(move_pages_flags, tcp->u_arg[5], "MPOL_???"); } diff --git a/number_set.c b/number_set.c new file mode 100644 index 00000000..4092ffda --- /dev/null +++ b/number_set.c @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2016-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include +#include "number_set.h" +#include "xmalloc.h" + +typedef unsigned int number_slot_t; +#define BITS_PER_SLOT (sizeof(number_slot_t) * 8) + +struct number_set { + number_slot_t *vec; + unsigned int nslots; + bool not; +}; + +static void +number_setbit(const unsigned int i, number_slot_t *const vec) +{ + vec[i / BITS_PER_SLOT] |= (number_slot_t) 1 << (i % BITS_PER_SLOT); +} + +static bool +number_isset(const unsigned int i, const number_slot_t *const vec) +{ + return vec[i / BITS_PER_SLOT] & ((number_slot_t) 1 << (i % BITS_PER_SLOT)); +} + +static void +reallocate_number_set(struct number_set *const set, const unsigned int new_nslots) +{ + if (new_nslots <= set->nslots) + return; + set->vec = xreallocarray(set->vec, new_nslots, sizeof(*set->vec)); + memset(set->vec + set->nslots, 0, + sizeof(*set->vec) * (new_nslots - set->nslots)); + set->nslots = new_nslots; +} + +bool +number_set_array_is_empty(const struct number_set *const set, + const unsigned int idx) +{ + return !(set && (set[idx].nslots || set[idx].not)); +} + +bool +is_number_in_set(const unsigned int number, const struct number_set *const set) +{ + return set && ((number / BITS_PER_SLOT < set->nslots) + && number_isset(number, set->vec)) ^ set->not; +} + +bool +is_number_in_set_array(const unsigned int number, const struct number_set *const set, + const unsigned int idx) +{ + return set && ((number / BITS_PER_SLOT < set[idx].nslots) + && number_isset(number, set[idx].vec)) ^ set[idx].not; +} + +void +add_number_to_set(const unsigned int number, struct number_set *const set) +{ + reallocate_number_set(set, number / BITS_PER_SLOT + 1); + number_setbit(number, set->vec); +} + +void +add_number_to_set_array(const unsigned int number, struct number_set *const set, + const unsigned int idx) +{ + add_number_to_set(number, &set[idx]); +} + +void +clear_number_set_array(struct number_set *const set, const unsigned int nmemb) +{ + unsigned int i; + + for (i = 0; i < nmemb; ++i) { + if (set[i].nslots) + memset(set[i].vec, 0, + sizeof(*set[i].vec) * set[i].nslots); + set[i].not = false; + } +} + +void +invert_number_set_array(struct number_set *const set, const unsigned int nmemb) +{ + unsigned int i; + + for (i = 0; i < nmemb; ++i) + set[i].not = !set[i].not; +} + +struct number_set * +alloc_number_set_array(const unsigned int nmemb) +{ + return xcalloc(nmemb, sizeof(struct number_set)); +} + +void +free_number_set_array(struct number_set *const set, unsigned int nmemb) +{ + while (nmemb) { + --nmemb; + free(set[nmemb].vec); + set[nmemb].vec = NULL; + } + free(set); +} diff --git a/number_set.h b/number_set.h new file mode 100644 index 00000000..77dc3a9c --- /dev/null +++ b/number_set.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2016-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_NUMBER_SET_H +# define STRACE_NUMBER_SET_H + +# include "gcc_compat.h" + +struct number_set; + +extern bool +number_set_array_is_empty(const struct number_set *, unsigned int idx); + +extern bool +is_number_in_set(unsigned int number, const struct number_set *); + +extern bool +is_number_in_set_array(unsigned int number, const struct number_set *, unsigned int idx); + +extern void +add_number_to_set(unsigned int number, struct number_set *); + +extern void +add_number_to_set_array(unsigned int number, struct number_set *, unsigned int idx); + +extern void +clear_number_set_array(struct number_set *, unsigned int nmemb); + +extern void +invert_number_set_array(struct number_set *, unsigned int nmemb); + +extern struct number_set * +alloc_number_set_array(unsigned int nmemb) ATTRIBUTE_MALLOC; + +extern void +free_number_set_array(struct number_set *, unsigned int nmemb); + +extern struct number_set *read_set; +extern struct number_set *write_set; +extern struct number_set *signal_set; + +#endif /* !STRACE_NUMBER_SET_H */ diff --git a/oldstat.c b/oldstat.c index 5535310e..2d457656 100644 --- a/oldstat.c +++ b/oldstat.c @@ -4,29 +4,10 @@ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman * Copyright (c) 2005-2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/open.c b/open.c index 2944d55c..153c93a2 100644 --- a/open.c +++ b/open.c @@ -7,47 +7,24 @@ * Copyright (c) 2006-2007 Ulrich Drepper * Copyright (c) 2009-2013 Denys Vlasenko * Copyright (c) 2005-2015 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" +#include "xstring.h" -#include +#include /* some libcs are guilty of messing up with O_ACCMODE */ #undef O_ACCMODE #define O_ACCMODE 03 #ifdef O_LARGEFILE -# if O_LARGEFILE == 0 /* biarch platforms in 64-bit mode */ +# if O_LARGEFILE == 0 /* biarch platforms in 64-bit mode */ # undef O_LARGEFILE -# ifdef SPARC64 -# define O_LARGEFILE 0x40000 -# elif defined X86_64 || defined S390X -# define O_LARGEFILE 0100000 -# endif # endif #endif @@ -55,7 +32,7 @@ #include "xlat/open_mode_flags.h" #ifndef AT_FDCWD -# define AT_FDCWD -100 +# define AT_FDCWD -100 #endif /* The fd is an "int", so when decoding x86 on x86_64, we need to force sign @@ -65,11 +42,11 @@ void print_dirfd(struct tcb *tcp, int fd) { if (fd == AT_FDCWD) - tprints("AT_FDCWD, "); - else { + print_xlat_d(AT_FDCWD); + else printfd(tcp, fd); - tprints(", "); - } + + tprints(", "); } /* @@ -109,23 +86,17 @@ sprint_open_modes(unsigned int flags) } /* flags is still nonzero */ *p++ = sep; - sprintf(p, "%#x", flags); + p = xappendstr(outstr, p, "%#x", flags); return outstr; } void tprint_open_modes(unsigned int flags) { - tprints(sprint_open_modes(flags) + sizeof("flags")); + print_xlat_ex(flags, sprint_open_modes(flags) + sizeof("flags"), + XLAT_STYLE_DEFAULT); } -#ifdef O_TMPFILE -/* The kernel & C libraries often inline O_DIRECTORY. */ -# define STRACE_O_TMPFILE (O_TMPFILE & ~O_DIRECTORY) -#else /* !O_TMPFILE */ -# define STRACE_O_TMPFILE 0 -#endif - static int decode_open(struct tcb *tcp, int offset) { @@ -133,7 +104,7 @@ decode_open(struct tcb *tcp, int offset) tprints(", "); /* flags */ tprint_open_modes(tcp->u_arg[offset + 1]); - if (tcp->u_arg[offset + 1] & (O_CREAT | STRACE_O_TMPFILE)) { + if (tcp->u_arg[offset + 1] & (O_CREAT | __O_TMPFILE)) { /* mode */ tprints(", "); print_numeric_umode_t(tcp->u_arg[offset + 2]); diff --git a/or1k_atomic.c b/or1k_atomic.c index bb02e0e4..99a0f6f9 100644 --- a/or1k_atomic.c +++ b/or1k_atomic.c @@ -1,51 +1,32 @@ /* * Copyright (c) 2013 Christian Svensson * Copyright (c) 2014-2015 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" #ifdef OR1K -#define OR1K_ATOMIC_SWAP 1 -#define OR1K_ATOMIC_CMPXCHG 2 -#define OR1K_ATOMIC_XCHG 3 -#define OR1K_ATOMIC_ADD 4 -#define OR1K_ATOMIC_DECPOS 5 -#define OR1K_ATOMIC_AND 6 -#define OR1K_ATOMIC_OR 7 -#define OR1K_ATOMIC_UMAX 8 -#define OR1K_ATOMIC_UMIN 9 +# define OR1K_ATOMIC_SWAP 1 +# define OR1K_ATOMIC_CMPXCHG 2 +# define OR1K_ATOMIC_XCHG 3 +# define OR1K_ATOMIC_ADD 4 +# define OR1K_ATOMIC_DECPOS 5 +# define OR1K_ATOMIC_AND 6 +# define OR1K_ATOMIC_OR 7 +# define OR1K_ATOMIC_UMAX 8 +# define OR1K_ATOMIC_UMIN 9 -#include "xlat/atomic_ops.h" +# include "xlat/atomic_ops.h" SYS_FUNC(or1k_atomic) { printxval64(atomic_ops, tcp->u_arg[0], "???"); - switch(tcp->u_arg[0]) { + switch (tcp->u_arg[0]) { case OR1K_ATOMIC_SWAP: tprintf(", 0x%lx, 0x%lx", tcp->u_arg[1], tcp->u_arg[2]); break; diff --git a/pathtrace.c b/pathtrace.c index d991aeda..142e1b65 100644 --- a/pathtrace.c +++ b/pathtrace.c @@ -1,77 +1,59 @@ /* - * Copyright (c) 2011, Comtrol Corp. + * Copyright (c) 2011 Comtrol Corp. + * Copyright (c) 2011-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later * */ #include "defs.h" -#include +#include #include #include "syscall.h" +#include "xstring.h" -const char **paths_selected = NULL; -static unsigned num_selected = 0; +struct path_set global_path_set; /* * Return true if specified path matches one that we're tracing. */ -static int -pathmatch(const char *path) +static bool +pathmatch(const char *path, struct path_set *set) { unsigned i; - for (i = 0; i < num_selected; ++i) { - if (strcmp(path, paths_selected[i]) == 0) - return 1; + for (i = 0; i < set->num_selected; ++i) { + if (strcmp(path, set->paths_selected[i]) == 0) + return true; } - return 0; + return false; } /* * Return true if specified path (in user-space) matches. */ -static int -upathmatch(struct tcb *const tcp, const kernel_ulong_t upath) +static bool +upathmatch(struct tcb *const tcp, const kernel_ulong_t upath, + struct path_set *set) { char path[PATH_MAX + 1]; - return umovestr(tcp, upath, sizeof path, path) > 0 && - pathmatch(path); + return umovestr(tcp, upath, sizeof(path), path) > 0 && + pathmatch(path, set); } /* * Return true if specified fd maps to a path we're tracing. */ -static int -fdmatch(struct tcb *tcp, int fd) +static bool +fdmatch(struct tcb *tcp, int fd, struct path_set *set) { char path[PATH_MAX + 1]; int n = getfdpath(tcp, fd, path, sizeof(path)); - return n >= 0 && pathmatch(path); + return n >= 0 && pathmatch(path, set); } /* @@ -79,17 +61,17 @@ fdmatch(struct tcb *tcp, int fd) * Specifying NULL will delete all paths. */ static void -storepath(const char *path) +storepath(const char *path, struct path_set *set) { - unsigned i; - - if (pathmatch(path)) + if (pathmatch(path, set)) return; /* already in table */ - i = num_selected++; - paths_selected = xreallocarray(paths_selected, num_selected, - sizeof(paths_selected[0])); - paths_selected[i] = path; + if (set->num_selected >= set->size) + set->paths_selected = + xgrowarray(set->paths_selected, &set->size, + sizeof(set->paths_selected[0])); + + set->paths_selected[set->num_selected++] = path; } /* @@ -104,7 +86,7 @@ getfdpath(struct tcb *tcp, int fd, char *buf, unsigned bufsize) if (fd < 0) return -1; - sprintf(linkpath, "/proc/%u/fd/%u", tcp->pid, fd); + xsprintf(linkpath, "/proc/%u/fd/%u", tcp->pid, fd); n = readlink(linkpath, buf, bufsize - 1); /* * NB: if buf is too small, readlink doesn't fail, @@ -117,14 +99,14 @@ getfdpath(struct tcb *tcp, int fd, char *buf, unsigned bufsize) /* * Add a path to the set we're tracing. Also add the canonicalized - * version of the path. Secifying NULL will delete all paths. + * version of the path. Specifying NULL will delete all paths. */ void -pathtrace_select(const char *path) +pathtrace_select_set(const char *path, struct path_set *set) { char *rpath; - storepath(path); + storepath(path, set); rpath = realpath(path, NULL); @@ -138,22 +120,57 @@ pathtrace_select(const char *path) } error_msg("Requested path '%s' resolved into '%s'", path, rpath); - storepath(rpath); + storepath(rpath, set); +} + +static bool +match_xselect_args(struct tcb *tcp, const kernel_ulong_t *args, + struct path_set *set) +{ + /* Kernel truncates arg[0] to int, we do the same. */ + int nfds = (int) args[0]; + /* Kernel rejects negative nfds, so we don't parse it either. */ + if (nfds <= 0) + return false; + /* Beware of select(2^31-1, NULL, NULL, NULL) and similar... */ + if (nfds > 1024*1024) + nfds = 1024*1024; + unsigned int fdsize = (((nfds + 7) / 8) + current_wordsize-1) & -current_wordsize; + fd_set *fds = xmalloc(fdsize); + + for (unsigned int i = 1; i <= 3; ++i) { + if (args[i] == 0) + continue; + if (umoven(tcp, args[i], fdsize, fds) < 0) + continue; + for (int j = 0;; ++j) { + j = next_set_bit(fds, j, nfds); + if (j < 0) + break; + if (fdmatch(tcp, j, set)) { + free(fds); + return true; + } + } + } + + free(fds); + return false; } /* * Return true if syscall accesses a selected path * (or if no paths have been specified for tracing). */ -int -pathtrace_match(struct tcb *tcp) +bool +pathtrace_match_set(struct tcb *tcp, struct path_set *set) { const struct_sysent *s; - s = tcp->s_ent; + s = tcp_sysent(tcp); if (!(s->sys_flags & (TRACE_FILE | TRACE_DESC | TRACE_NETWORK))) - return 0; + return false; /* * Check for special cases where we need to do something @@ -168,9 +185,10 @@ pathtrace_match(struct tcb *tcp) case SEN_sendfile64: case SEN_tee: /* fd, fd */ - return fdmatch(tcp, tcp->u_arg[0]) || - fdmatch(tcp, tcp->u_arg[1]); + return fdmatch(tcp, tcp->u_arg[0], set) || + fdmatch(tcp, tcp->u_arg[1], set); + case SEN_execveat: case SEN_faccessat: case SEN_fchmodat: case SEN_fchownat: @@ -183,131 +201,96 @@ pathtrace_match(struct tcb *tcp) case SEN_newfstatat: case SEN_openat: case SEN_readlinkat: + case SEN_statx: case SEN_unlinkat: - case SEN_utimensat: + case SEN_utimensat_time32: + case SEN_utimensat_time64: /* fd, path */ - return fdmatch(tcp, tcp->u_arg[0]) || - upathmatch(tcp, tcp->u_arg[1]); + return fdmatch(tcp, tcp->u_arg[0], set) || + upathmatch(tcp, tcp->u_arg[1], set); case SEN_link: case SEN_mount: case SEN_pivotroot: /* path, path */ - return upathmatch(tcp, tcp->u_arg[0]) || - upathmatch(tcp, tcp->u_arg[1]); + return upathmatch(tcp, tcp->u_arg[0], set) || + upathmatch(tcp, tcp->u_arg[1], set); case SEN_quotactl: + case SEN_symlink: /* x, path */ - return upathmatch(tcp, tcp->u_arg[1]); + return upathmatch(tcp, tcp->u_arg[1], set); case SEN_linkat: case SEN_renameat2: case SEN_renameat: /* fd, path, fd, path */ - return fdmatch(tcp, tcp->u_arg[0]) || - fdmatch(tcp, tcp->u_arg[2]) || - upathmatch(tcp, tcp->u_arg[1]) || - upathmatch(tcp, tcp->u_arg[3]); + return fdmatch(tcp, tcp->u_arg[0], set) || + fdmatch(tcp, tcp->u_arg[2], set) || + upathmatch(tcp, tcp->u_arg[1], set) || + upathmatch(tcp, tcp->u_arg[3], set); +#if HAVE_ARCH_OLD_MMAP case SEN_old_mmap: -#if defined(S390) +# if HAVE_ARCH_OLD_MMAP_PGOFF case SEN_old_mmap_pgoff: -#endif +# endif + { + kernel_ulong_t *args = + fetch_indirect_syscall_args(tcp, tcp->u_arg[0], 6); + + return args && fdmatch(tcp, args[4], set); + } +#endif /* HAVE_ARCH_OLD_MMAP */ + 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]); + return fdmatch(tcp, tcp->u_arg[4], set); case SEN_symlinkat: - /* path, fd, path */ - return fdmatch(tcp, tcp->u_arg[1]) || - upathmatch(tcp, tcp->u_arg[0]) || - upathmatch(tcp, tcp->u_arg[2]); + /* x, fd, path */ + return fdmatch(tcp, tcp->u_arg[1], set) || + upathmatch(tcp, tcp->u_arg[2], set); case SEN_copy_file_range: case SEN_splice: /* fd, x, fd, x, x, x */ - return fdmatch(tcp, tcp->u_arg[0]) || - fdmatch(tcp, tcp->u_arg[2]); + return fdmatch(tcp, tcp->u_arg[0], set) || + fdmatch(tcp, tcp->u_arg[2], set); case SEN_epoll_ctl: /* x, x, fd, x */ - return fdmatch(tcp, tcp->u_arg[2]); + return fdmatch(tcp, tcp->u_arg[2], set); case SEN_fanotify_mark: - /* x, x, x, fd, path */ - return fdmatch(tcp, tcp->u_arg[3]) || - upathmatch(tcp, tcp->u_arg[4]); - + { + /* x, x, mask (64 bit), fd, path */ + unsigned long long mask = 0; + int argn = getllval(tcp, &mask, 2); + return fdmatch(tcp, tcp->u_arg[argn], set) || + upathmatch(tcp, tcp->u_arg[argn + 1], set); + } +#if HAVE_ARCH_OLD_SELECT case SEN_oldselect: - case SEN_pselect6: - case SEN_select: { - int i, j; - int nfds; - kernel_ulong_t *args; - kernel_ulong_t select_args[5]; - unsigned int oldselect_args[5]; - unsigned int fdsize; - fd_set *fds; - - if (SEN_oldselect == s->sen) { - if (sizeof(*select_args) == sizeof(*oldselect_args)) { - if (umove(tcp, tcp->u_arg[0], &select_args)) { - return 0; - } - } else { - unsigned int n; - - if (umove(tcp, tcp->u_arg[0], &oldselect_args)) { - return 0; - } - - for (n = 0; n < 5; ++n) { - select_args[n] = oldselect_args[n]; - } - } - args = select_args; - } else { - args = tcp->u_arg; - } + kernel_ulong_t *args = + fetch_indirect_syscall_args(tcp, tcp->u_arg[0], 5); - /* Kernel truncates arg[0] to int, we do the same. */ - nfds = (int) args[0]; - /* Kernel rejects negative nfds, so we don't parse it either. */ - if (nfds <= 0) - return 0; - /* Beware of select(2^31-1, NULL, NULL, NULL) and similar... */ - if (nfds > 1024*1024) - nfds = 1024*1024; - fdsize = (((nfds + 7) / 8) + current_wordsize-1) & -current_wordsize; - fds = xmalloc(fdsize); - - for (i = 1; i <= 3; ++i) { - if (args[i] == 0) - continue; - if (umoven(tcp, args[i], fdsize, fds) < 0) { - continue; - } - for (j = 0;; j++) { - j = next_set_bit(fds, j, nfds); - if (j < 0) - break; - if (fdmatch(tcp, j)) { - free(fds); - return 1; - } - } - } - free(fds); - return 0; + return args && match_xselect_args(tcp, args, set); } - - case SEN_poll: - case SEN_ppoll: +#endif + case SEN_pselect6_time32: + case SEN_pselect6_time64: + case SEN_select: + return match_xselect_args(tcp, tcp->u_arg, set); + case SEN_poll_time32: + case SEN_poll_time64: + case SEN_ppoll_time32: + case SEN_ppoll_time64: { struct pollfd fds; unsigned nfds; @@ -316,42 +299,63 @@ pathtrace_match(struct tcb *tcp) start = tcp->u_arg[0]; nfds = tcp->u_arg[1]; + if (nfds > 1024 * 1024) + nfds = 1024 * 1024; end = start + sizeof(fds) * nfds; if (nfds == 0 || end < start) - return 0; + return false; - for (cur = start; cur < end; cur += sizeof(fds)) - if ((umove(tcp, cur, &fds) == 0) - && fdmatch(tcp, fds.fd)) - return 1; + for (cur = start; cur < end; cur += sizeof(fds)) { + if (umove(tcp, cur, &fds)) + break; + if (fdmatch(tcp, fds.fd, set)) + return true; + } - return 0; + return false; } + case SEN_accept4: + case SEN_accept: case SEN_bpf: case SEN_epoll_create: case SEN_epoll_create1: case SEN_eventfd2: case SEN_eventfd: case SEN_fanotify_init: + case SEN_inotify_init: case SEN_inotify_init1: + case SEN_io_uring_enter: + case SEN_io_uring_register: + case SEN_io_uring_setup: case SEN_memfd_create: + case SEN_mq_getsetattr: + case SEN_mq_notify: + case SEN_mq_open: + case SEN_mq_timedreceive_time32: + case SEN_mq_timedreceive_time64: + case SEN_mq_timedsend_time32: + case SEN_mq_timedsend_time64: case SEN_perf_event_open: case SEN_pipe: case SEN_pipe2: case SEN_printargs: + case SEN_signalfd4: + case SEN_signalfd: case SEN_socket: case SEN_socketpair: case SEN_timerfd_create: - case SEN_timerfd_gettime: - case SEN_timerfd_settime: + case SEN_timerfd_gettime32: + case SEN_timerfd_gettime64: + case SEN_timerfd_settime32: + case SEN_timerfd_settime64: case SEN_userfaultfd: /* * These have TRACE_FILE or TRACE_DESCRIPTOR or TRACE_NETWORK set, * but they don't have any file descriptor or path args to test. */ - return 0; + return false; } /* @@ -360,10 +364,10 @@ pathtrace_match(struct tcb *tcp) */ if (s->sys_flags & TRACE_FILE) - return upathmatch(tcp, tcp->u_arg[0]); + return upathmatch(tcp, tcp->u_arg[0], set); if (s->sys_flags & (TRACE_DESC | TRACE_NETWORK)) - return fdmatch(tcp, tcp->u_arg[0]); + return fdmatch(tcp, tcp->u_arg[0], set); - return 0; + return false; } diff --git a/perf.c b/perf.c index f151c198..1c45f8d1 100644 --- a/perf.c +++ b/perf.c @@ -2,36 +2,17 @@ * Copyright (c) 2013 Ben Noordhuis * Copyright (c) 2013-2015 Dmitry V. Levin * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2015-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" #include "perf_event_struct.h" +#include "print_fields.h" -#include "xlat/clocknames.h" #include "xlat/hw_breakpoint_len.h" #include "xlat/hw_breakpoint_type.h" #include "xlat/perf_attr_size.h" @@ -60,7 +41,7 @@ free_pea_desc(void *pea_desc_ptr) free(desc); } -static int +int fetch_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) { struct pea_desc *desc; @@ -93,7 +74,7 @@ fetch_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) /* Size should be multiple of 8, but kernel doesn't check for it */ /* size &= ~7; */ - attr = xcalloc(1, sizeof(*attr)); + attr = xzalloc(sizeof(*attr)); if (umoven_or_printaddr(tcp, addr, size, attr)) { free(attr); @@ -111,13 +92,7 @@ fetch_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) return 0; } -#define PRINT_XLAT(prefix, xlat, x, dflt) \ - do { \ - tprints(prefix); \ - printxval_search(xlat, x, dflt); \ - } while (0) - -static void +void print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) { static const char *precise_ip_desc[] = { @@ -139,7 +114,7 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) * offsetofend against size) in order to print fields as kernel sees * them. This also should work great on big endian architectures. */ - #define _PERF_CHECK_FIELD(_field) \ +#define _PERF_CHECK_FIELD(_field) \ do { \ if (offsetof(struct perf_event_attr, _field) >= size) \ goto print_perf_event_attr_out; \ @@ -159,46 +134,49 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) use_new_size = 1; } - PRINT_XLAT("{type=", perf_type_id, attr->type, "PERF_TYPE_???"); - tprintf(", size="); - printxval(perf_attr_size, attr->size, "PERF_ATTR_SIZE_???"); + PRINT_FIELD_XVAL("{", *attr, type, perf_type_id, "PERF_TYPE_???"); + PRINT_FIELD_XVAL(", ", *attr, size, perf_attr_size, + "PERF_ATTR_SIZE_???"); if (use_new_size) { tprints(" => "); if (use_new_size > 0) printxval(perf_attr_size, new_size, - "PERF_ATTR_SIZE_???"); + "PERF_ATTR_SIZE_???"); else tprints("???"); } switch (attr->type) { case PERF_TYPE_HARDWARE: - PRINT_XLAT(", config=", perf_hw_id, attr->config, - "PERF_COUNT_HW_???"); + PRINT_FIELD_XVAL(", ", *attr, config, perf_hw_id, + "PERF_COUNT_HW_???"); break; case PERF_TYPE_SOFTWARE: - PRINT_XLAT(", config=", perf_sw_ids, attr->config, - "PERF_COUNT_SW_???"); + PRINT_FIELD_XVAL(", ", *attr, config, perf_sw_ids, + "PERF_COUNT_SW_???"); break; case PERF_TYPE_TRACEPOINT: /* * "The value to use in config can be obtained from under - * debugfs tracing/events/../../id if ftrace is enabled in the - * kernel." + * debugfs tracing/events/../../id if ftrace is enabled + * in the kernel." */ - tprintf(", config=%" PRIu64, attr->config); + PRINT_FIELD_U(", ", *attr, config); break; case PERF_TYPE_HW_CACHE: /* * (perf_hw_cache_id) | (perf_hw_cache_op_id << 8) | * (perf_hw_cache_op_result_id << 16) */ - PRINT_XLAT(", config=", perf_hw_cache_id, attr->config & 0xFF, - "PERF_COUNT_HW_CACHE_???"); - PRINT_XLAT("|", perf_hw_cache_op_id, (attr->config >> 8) & 0xFF, - "PERF_COUNT_HW_CACHE_OP_???"); + tprints(", config="); + printxval(perf_hw_cache_id, attr->config & 0xFF, + "PERF_COUNT_HW_CACHE_???"); + tprints("|"); + printxval(perf_hw_cache_op_id, (attr->config >> 8) & 0xFF, + "PERF_COUNT_HW_CACHE_OP_???"); + tprints("<<8|"); /* * Current code (see set_ext_hw_attr in arch/x86/events/core.c, * tile_map_cache_event in arch/tile/kernel/perf_event.c, @@ -214,14 +192,14 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) * armpmu_map_cache_event in drivers/perf/arm_pmu.c) assumes * that cache result is 8 bits in size. */ - PRINT_XLAT("<<8|", perf_hw_cache_op_result_id, - (attr->config >> 16) & 0xFF, - "PERF_COUNT_HW_CACHE_RESULT_???"); - tprintf("<<16"); - if (attr->config >> 24) - tprintf("|%#" PRIx64 "<<24 " - "/* PERF_COUNT_HW_CACHE_??? */", - attr->config >> 24); + printxval(perf_hw_cache_op_result_id, + (attr->config >> 16) & 0xFF, + "PERF_COUNT_HW_CACHE_RESULT_???"); + tprints("<<16"); + if (attr->config >> 24) { + tprintf("|%#" PRIx64 "<<24", attr->config >> 24); + tprints_comment("PERF_COUNT_HW_CACHE_???"); + } break; case PERF_TYPE_RAW: /* @@ -241,7 +219,7 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) * to zero. Its parameters are set in other places." */ default: - tprintf(", config=%#" PRIx64, attr->config); + PRINT_FIELD_X(", ", *attr, config); break; } @@ -249,98 +227,100 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) goto print_perf_event_attr_out; if (attr->freq) - tprintf(", sample_freq=%" PRIu64, attr->sample_freq); + PRINT_FIELD_U(", ", *attr, sample_freq); else - tprintf(", sample_period=%" PRIu64, attr->sample_period); + PRINT_FIELD_U(", ", *attr, sample_period); - tprintf(", sample_type="); - printflags64(perf_event_sample_format, attr->sample_type, - "PERF_SAMPLE_???"); - - tprintf(", read_format="); - printflags64(perf_event_read_format, attr->read_format, - "PERF_FORMAT_???"); + PRINT_FIELD_FLAGS(", ", *attr, sample_type, perf_event_sample_format, + "PERF_SAMPLE_???"); + PRINT_FIELD_FLAGS(", ", *attr, read_format, perf_event_read_format, + "PERF_FORMAT_???"); tprintf(", disabled=%u" - ", inherit=%u" - ", pinned=%u" - ", exclusive=%u" - ", exclusive_user=%u" - ", exclude_kernel=%u" - ", exclude_hv=%u" - ", exclude_idle=%u" - ", mmap=%u" - ", comm=%u" - ", freq=%u" - ", inherit_stat=%u" - ", enable_on_exec=%u" - ", task=%u" - ", watermark=%u" - ", precise_ip=%u /* %s */" - ", mmap_data=%u" - ", sample_id_all=%u" - ", exclude_host=%u" - ", exclude_guest=%u" - ", exclude_callchain_kernel=%u" - ", exclude_callchain_user=%u" - ", mmap2=%u" - ", comm_exec=%u" - ", use_clockid=%u" - ", context_switch=%u" - ", write_backward=%u", - attr->disabled, - attr->inherit, - attr->pinned, - attr->exclusive, - attr->exclude_user, - attr->exclude_kernel, - attr->exclude_hv, - attr->exclude_idle, - attr->mmap, - attr->comm, - attr->freq, - attr->inherit_stat, - attr->enable_on_exec, - attr->task, - attr->watermark, - attr->precise_ip, precise_ip_desc[attr->precise_ip], - attr->mmap_data, - attr->sample_id_all, - attr->exclude_host, - attr->exclude_guest, - attr->exclude_callchain_kernel, - attr->exclude_callchain_user, - attr->mmap2, - attr->comm_exec, - attr->use_clockid, - attr->context_switch, - attr->write_backward); + ", inherit=%u" + ", pinned=%u" + ", exclusive=%u" + ", exclusive_user=%u" + ", exclude_kernel=%u" + ", exclude_hv=%u" + ", exclude_idle=%u" + ", mmap=%u" + ", comm=%u" + ", freq=%u" + ", inherit_stat=%u" + ", enable_on_exec=%u" + ", task=%u" + ", watermark=%u" + ", precise_ip=%u", + attr->disabled, + attr->inherit, + attr->pinned, + attr->exclusive, + attr->exclude_user, + attr->exclude_kernel, + attr->exclude_hv, + attr->exclude_idle, + attr->mmap, + attr->comm, + attr->freq, + attr->inherit_stat, + attr->enable_on_exec, + attr->task, + attr->watermark, + attr->precise_ip); + tprints_comment(precise_ip_desc[attr->precise_ip]); + tprintf(", mmap_data=%u" + ", sample_id_all=%u" + ", exclude_host=%u" + ", exclude_guest=%u" + ", exclude_callchain_kernel=%u" + ", exclude_callchain_user=%u" + ", mmap2=%u" + ", comm_exec=%u" + ", use_clockid=%u" + ", context_switch=%u" + ", write_backward=%u" + ", namespaces=%u", + attr->mmap_data, + attr->sample_id_all, + attr->exclude_host, + attr->exclude_guest, + attr->exclude_callchain_kernel, + attr->exclude_callchain_user, + attr->mmap2, + attr->comm_exec, + attr->use_clockid, + attr->context_switch, + attr->write_backward, + attr->namespaces); /* * Print it only in case it is non-zero, since it may contain flags we * are not aware about. */ - if (attr->__reserved_1) - tprintf(", __reserved_1=%#" PRIx64 " /* Bits 63..28 */", - (uint64_t) attr->__reserved_1); + if (attr->__reserved_1) { + tprintf(", __reserved_1=%#" PRIx64, + (uint64_t) attr->__reserved_1); + tprints_comment("Bits 63..29"); + } if (attr->watermark) - tprintf(", wakeup_watermark=%u", attr->wakeup_watermark); + PRINT_FIELD_U(", ", *attr, wakeup_watermark); else - tprintf(", wakeup_events=%u", attr->wakeup_events); + PRINT_FIELD_U(", ", *attr, wakeup_events); if (attr->type == PERF_TYPE_BREAKPOINT) /* Any combination of R/W with X is deemed invalid */ - PRINT_XLAT(", bp_type=", hw_breakpoint_type, attr->bp_type, - (attr->bp_type <= - (HW_BREAKPOINT_X | HW_BREAKPOINT_RW)) ? - "HW_BREAKPOINT_INVALID" : - "HW_BREAKPOINT_???"); + PRINT_FIELD_XVAL(", ", *attr, bp_type, hw_breakpoint_type, + (attr->bp_type <= + (HW_BREAKPOINT_X | HW_BREAKPOINT_RW)) + ? "HW_BREAKPOINT_INVALID" + : "HW_BREAKPOINT_???"); if (attr->type == PERF_TYPE_BREAKPOINT) - tprintf(", bp_addr=%#" PRIx64, attr->bp_addr); + PRINT_FIELD_X(", ", *attr, bp_addr); else - tprintf(", config1=%#" PRIx64, attr->config1); + PRINT_FIELD_X(", ", *attr, config1); /* * Fields after bp_addr/config1 are optional and may not present; check @@ -349,15 +329,15 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) _PERF_CHECK_FIELD(bp_len); if (attr->type == PERF_TYPE_BREAKPOINT) - tprintf(", bp_len=%" PRIu64, attr->bp_len); + PRINT_FIELD_U(", ", *attr, bp_len); else - tprintf(", config2=%#" PRIx64, attr->config2); + PRINT_FIELD_X(", ", *attr, config2); _PERF_CHECK_FIELD(branch_sample_type); if (attr->sample_type & PERF_SAMPLE_BRANCH_STACK) { - tprintf(", branch_sample_type="); - printflags64(perf_branch_sample_type, attr->branch_sample_type, - "PERF_SAMPLE_BRANCH_???"); + PRINT_FIELD_FLAGS(", ", *attr, branch_sample_type, + perf_branch_sample_type, + "PERF_SAMPLE_BRANCH_???"); } _PERF_CHECK_FIELD(sample_regs_user); @@ -367,7 +347,7 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) * described in the kernel header * arch/ARCH/include/uapi/asm/perf_regs.h." */ - tprintf(", sample_regs_user=%#" PRIx64, attr->sample_regs_user); + PRINT_FIELD_X(", ", *attr, sample_regs_user); _PERF_CHECK_FIELD(sample_stack_user); /* @@ -375,33 +355,31 @@ print_perf_event_attr(struct tcb *const tcp, const kernel_ulong_t addr) * specified." */ if (attr->sample_type & PERF_SAMPLE_STACK_USER) - tprintf(", sample_stack_user=%#" PRIx32, - attr->sample_stack_user); + PRINT_FIELD_X(", ", *attr, sample_stack_user); if (attr->use_clockid) { _PERF_CHECK_FIELD(clockid); - tprintf(", clockid="); - printxval(clocknames, attr->clockid, "CLOCK_???"); + PRINT_FIELD_XVAL(", ", *attr, clockid, clocknames, "CLOCK_???"); } _PERF_CHECK_FIELD(sample_regs_intr); - tprintf(", sample_regs_intr=%#" PRIx64, attr->sample_regs_intr); + PRINT_FIELD_X(", ", *attr, sample_regs_intr); _PERF_CHECK_FIELD(aux_watermark); - tprintf(", aux_watermark=%" PRIu32, attr->aux_watermark); + PRINT_FIELD_U(", ", *attr, aux_watermark); _PERF_CHECK_FIELD(sample_max_stack); - tprintf(", sample_max_stack=%" PRIu16, attr->sample_max_stack); + PRINT_FIELD_U(", ", *attr, sample_max_stack); /* _PERF_CHECK_FIELD(__reserved_2); - tprintf(", __reserved2=%" PRIu16, attr->__reserved_2); */ + PRINT_FIELD_U(", ", *attr, __reserved2); */ print_perf_event_attr_out: if ((attr->size && (attr->size > size)) || (!attr->size && (size < PERF_ATTR_SIZE_VER0))) - tprintf(", ..."); + tprints(", ..."); - tprintf("}"); + tprints("}"); } SYS_FUNC(perf_event_open) @@ -419,10 +397,11 @@ SYS_FUNC(perf_event_open) print_perf_event_attr(tcp, tcp->u_arg[0]); } - tprintf(", %d, %d, %d, ", + tprintf(", %d, %d, ", (int) tcp->u_arg[1], - (int) tcp->u_arg[2], - (int) tcp->u_arg[3]); + (int) tcp->u_arg[2]); + printfd(tcp, tcp->u_arg[3]); + tprints(", "); printflags64(perf_event_open_flags, tcp->u_arg[4], "PERF_FLAG_???"); return RVAL_DECODED | RVAL_FD; diff --git a/perf_event_struct.h b/perf_event_struct.h index 161f6383..b9489a65 100644 --- a/perf_event_struct.h +++ b/perf_event_struct.h @@ -1,7 +1,14 @@ +/* + * Copyright (c) 2016-2018 Eugene Syromyatnikov + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #ifndef STRACE_LINUX_PERF_EVENT_STRUCT_H -#define STRACE_LINUX_PERF_EVENT_STRUCT_H +# define STRACE_LINUX_PERF_EVENT_STRUCT_H -#include +# include struct perf_event_attr { uint32_t type; @@ -13,34 +20,35 @@ struct perf_event_attr { }; uint64_t sample_type; uint64_t read_format; - uint64_t disabled :1, - inherit :1, - pinned :1, - exclusive :1, - exclude_user :1, - exclude_kernel :1, - exclude_hv :1, - exclude_idle :1, - mmap :1, - comm :1, - freq :1, - inherit_stat :1, - enable_on_exec :1, - task :1, - watermark :1, - precise_ip :2, - mmap_data :1, - sample_id_all :1, - exclude_host :1, - exclude_guest :1, - exclude_callchain_kernel :1, - exclude_callchain_user :1, - mmap2 :1, - comm_exec :1, - use_clockid :1, - context_switch :1, - write_backward :1, - __reserved_1 :36; + uint64_t disabled :1, + inherit :1, + pinned :1, + exclusive :1, + exclude_user :1, + exclude_kernel :1, + exclude_hv :1, + exclude_idle :1, + mmap :1, + comm :1, + freq :1, + inherit_stat :1, + enable_on_exec :1, + task :1, + watermark :1, + precise_ip :2, + mmap_data :1, + sample_id_all :1, + exclude_host :1, + exclude_guest :1, + exclude_callchain_kernel :1, + exclude_callchain_user :1, + mmap2 :1, + comm_exec :1, + use_clockid :1, + context_switch :1, + write_backward :1, + namespaces :1, + __reserved_1 :35; union { uint32_t wakeup_events; uint32_t wakeup_watermark; @@ -70,4 +78,10 @@ struct perf_event_attr { /* End of ver 5 - 112 bytes */ }; +struct perf_event_query_bpf { + uint32_t ids_len; + uint32_t prog_cnt; + uint32_t ids[0]; +}; + #endif /* !STRACE_LINUX_PERF_EVENT_STRUCT_H */ diff --git a/perf_ioctl.c b/perf_ioctl.c new file mode 100644 index 00000000..427aa9eb --- /dev/null +++ b/perf_ioctl.c @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#include + +#include "perf_event_struct.h" + +#define XLAT_MACROS_ONLY +#include "xlat/perf_ioctl_cmds.h" +#undef XLAT_MACROS_ONLY + +#include "xlat/perf_ioctl_flags.h" + +#include MPERS_DEFS + +static int +perf_ioctl_query_bpf(struct tcb *const tcp, const kernel_ulong_t arg) +{ + uint32_t info; + + if (entering(tcp)) { + tprints(", "); + + if (umove_or_printaddr(tcp, arg, &info)) + return RVAL_IOCTL_DECODED; + + tprintf("{ids_len=%u, ", info); + + return 0; + } + + if (syserror(tcp) || + umove(tcp, arg + offsetof(struct perf_event_query_bpf, prog_cnt), + &info)) { + tprints("...}"); + + return RVAL_IOCTL_DECODED; + } + + tprintf("prog_cnt=%u, ids=", info); + + print_array(tcp, arg + offsetof(struct perf_event_query_bpf, ids), info, + &info, sizeof(info), + tfetch_mem, print_uint32_array_member, NULL); + + tprints("}"); + + return RVAL_IOCTL_DECODED; +} + +static int +perf_ioctl_modify_attributes(struct tcb *const tcp, const kernel_ulong_t arg) +{ + tprints(", "); + if (!fetch_perf_event_attr(tcp, arg)) + print_perf_event_attr(tcp, arg); + + return RVAL_IOCTL_DECODED; +} + +MPERS_PRINTER_DECL(int, perf_ioctl, + struct tcb *const tcp, const unsigned int code, + const kernel_ulong_t arg) +{ + switch (code) { + case PERF_EVENT_IOC_ENABLE: + case PERF_EVENT_IOC_DISABLE: + case PERF_EVENT_IOC_RESET: + tprints(", "); + printflags(perf_ioctl_flags, arg, "PERF_IOC_FLAG_???"); + + return RVAL_IOCTL_DECODED; + + case PERF_EVENT_IOC_REFRESH: + tprintf(", %d", (int) arg); + + return RVAL_IOCTL_DECODED; + + case PERF_EVENT_IOC_PERIOD: + tprints(", "); + printnum_int64(tcp, arg, "%" PRIu64); + + return RVAL_IOCTL_DECODED; + + case PERF_EVENT_IOC_SET_OUTPUT: + case PERF_EVENT_IOC_SET_BPF: + tprintf(", "); + printfd(tcp, (int) arg); + + return RVAL_IOCTL_DECODED; + + case PERF_EVENT_IOC_PAUSE_OUTPUT: + tprintf(", %" PRI_klu, arg); + + return RVAL_IOCTL_DECODED; + + /* + * The following ioctl requests are personality-specific + * due to the pointer size. + */ + case PERF_EVENT_IOC_SET_FILTER: + tprints(", "); + printstr_ex(tcp, arg, get_pagesize(), QUOTE_0_TERMINATED); + + return RVAL_IOCTL_DECODED; + + case PERF_EVENT_IOC_ID: + if (entering(tcp)) { + tprints(", "); + + return 0; + } + + printnum_int64(tcp, arg, "%" PRIu64); + + return RVAL_IOCTL_DECODED; + + case PERF_EVENT_IOC_QUERY_BPF: + return perf_ioctl_query_bpf(tcp, arg); + + case PERF_EVENT_IOC_MODIFY_ATTRIBUTES: + return perf_ioctl_modify_attributes(tcp, arg); + + default: + return RVAL_DECODED; + } +} diff --git a/personality.c b/personality.c index 44ed5e3b..152865fb 100644 --- a/personality.c +++ b/personality.c @@ -1,34 +1,14 @@ /* * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" -#include -#include "xlat/personality_types.h" #include "xlat/personality_flags.h" +#include "xlat/personality_types.h" SYS_FUNC(personality) @@ -54,13 +34,9 @@ SYS_FUNC(personality) return 0; pers = tcp->u_rval; - const char *type = xlookup(personality_types, pers & PER_MASK); - char *p; static char outstr[1024]; - if (type) - p = stpcpy(outstr, type); - else - p = outstr + sprintf(outstr, "%#x /* %s */", pers & PER_MASK, "PER_???"); + char *p = outstr + sprintxval(outstr, sizeof(outstr), personality_types, + pers & PER_MASK, "PER_???"); pers &= ~PER_MASK; if (pers) strcpy(p, sprintflags("|", personality_flags, pers)); diff --git a/pkeys.c b/pkeys.c index f5338ab8..50dbd579 100644 --- a/pkeys.c +++ b/pkeys.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" #include "xlat/pkey_access.h" diff --git a/poll.c b/poll.c index f2a23814..3f06443a 100644 --- a/poll.c +++ b/poll.c @@ -1,33 +1,15 @@ /* * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 1999-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" #include +#include "xstring.h" #include "xlat/pollflags.h" @@ -55,12 +37,13 @@ decode_poll_entering(struct tcb *tcp) struct pollfd fds; print_array(tcp, addr, nfds, &fds, sizeof(fds), - umoven_or_printaddr, print_pollfd, 0); + tfetch_mem, print_pollfd, 0); tprintf(", %u, ", nfds); } static int -decode_poll_exiting(struct tcb *const tcp, const kernel_ulong_t pts) +decode_poll_exiting(struct tcb *const tcp, const sprint_obj_by_addr_fn sprint_ts, + const kernel_ulong_t pts) { struct pollfd fds; const unsigned int nfds = tcp->u_arg[1]; @@ -95,7 +78,7 @@ decode_poll_exiting(struct tcb *const tcp, const kernel_ulong_t pts) *outptr++ = '['; else outptr = stpcpy(outptr, ", "); - outptr += sprintf(outptr, "%#" PRI_klx, cur); + outptr = xappendstr(outstr, outptr, "%#" PRI_klx, cur); break; } if (!fds.revents) @@ -111,7 +94,7 @@ decode_poll_exiting(struct tcb *const tcp, const kernel_ulong_t pts) static const char fmt[] = "{fd=%d, revents="; char fdstr[sizeof(fmt) + sizeof(int) * 3]; - sprintf(fdstr, fmt, fds.fd); + xsprintf(fdstr, fmt, fds.fd); const char *flagstr = sprintflags("", pollflags, (unsigned short) fds.revents); @@ -132,7 +115,7 @@ decode_poll_exiting(struct tcb *const tcp, const kernel_ulong_t pts) *outptr = '\0'; if (pts) { - const char *str = sprint_timespec(tcp, pts); + const char *str = sprint_ts(tcp, pts); if (outptr + sizeof(", left ") + strlen(str) < end_outstr) { outptr = stpcpy(outptr, outptr == outstr ? "left " : ", left "); @@ -150,31 +133,43 @@ decode_poll_exiting(struct tcb *const tcp, const kernel_ulong_t pts) #undef end_outstr } -SYS_FUNC(poll) +#if HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS +static int +do_poll(struct tcb *const tcp, const sprint_obj_by_addr_fn sprint_ts) { if (entering(tcp)) { decode_poll_entering(tcp); - int timeout = tcp->u_arg[2]; - -#ifdef INFTIM - if (INFTIM == timeout) - tprints("INFTIM"); - else -#endif - tprintf("%d", timeout); + tprintf("%d", (int) tcp->u_arg[2]); return 0; } else { - return decode_poll_exiting(tcp, 0); + return decode_poll_exiting(tcp, sprint_ts, 0); } } +#endif /* HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS */ -SYS_FUNC(ppoll) +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(poll_time32) +{ + return do_poll(tcp, sprint_timespec32); +} +#endif + +#if HAVE_ARCH_OLD_TIME64_SYSCALLS +SYS_FUNC(poll_time64) +{ + return do_poll(tcp, sprint_timespec64); +} +#endif + +static int +do_ppoll(struct tcb *const tcp, const print_obj_by_addr_fn print_ts, + const sprint_obj_by_addr_fn sprint_ts) { if (entering(tcp)) { decode_poll_entering(tcp); - print_timespec(tcp, tcp->u_arg[2]); + print_ts(tcp, tcp->u_arg[2]); tprints(", "); /* NB: kernel requires arg[4] == NSIG_BYTES */ print_sigset_addr_len(tcp, tcp->u_arg[3], tcp->u_arg[4]); @@ -182,6 +177,18 @@ SYS_FUNC(ppoll) return 0; } else { - return decode_poll_exiting(tcp, tcp->u_arg[2]); + return decode_poll_exiting(tcp, sprint_ts, tcp->u_arg[2]); } } + +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(ppoll_time32) +{ + return do_ppoll(tcp, print_timespec32, sprint_timespec32); +} +#endif + +SYS_FUNC(ppoll_time64) +{ + return do_ppoll(tcp, print_timespec64, sprint_timespec64); +} diff --git a/prctl.c b/prctl.c index 6779ad51..814abc2a 100644 --- a/prctl.c +++ b/prctl.c @@ -3,35 +3,18 @@ * Copyright (c) 1996-2000 Wichert Akkerman * Copyright (c) 2005-2007 Roland McGrath * Copyright (c) 2008-2015 Dmitry V. Levin + * Copyright (c) 2014-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" #include +#include "xstring.h" + #include "xlat/prctl_options.h" #include "xlat/pr_cap_ambient.h" #include "xlat/pr_dumpable.h" @@ -39,6 +22,10 @@ #include "xlat/pr_mce_kill.h" #include "xlat/pr_mce_kill_policy.h" #include "xlat/pr_set_mm.h" +#include "xlat/pr_spec_cmds.h" +#include "xlat/pr_spec_get_store_bypass_flags.h" +#include "xlat/pr_spec_set_store_bypass_flags.h" +#include "xlat/pr_sve_vl_flags.h" #include "xlat/pr_tsc.h" #include "xlat/pr_unalign_flags.h" @@ -64,15 +51,36 @@ enum { #include "xlat/cap.h" +#ifndef PR_SVE_VL_LEN_MASK +# define PR_SVE_VL_LEN_MASK 0xffff +#endif + + static void print_prctl_args(struct tcb *tcp, const unsigned int first) { unsigned int i; - for (i = first; i < tcp->s_ent->nargs; ++i) + for (i = first; i < n_args(tcp); ++i) tprintf(", %#" PRI_klx, tcp->u_arg[i]); } +static char * +sprint_sve_val(kernel_ulong_t arg) +{ + static char out[sizeof("PR_SVE_SET_VL_ONEXEC|PR_SVE_VL_INHERIT|0x") + + sizeof(kernel_ulong_t) * 2]; + + kernel_ulong_t vl = arg & PR_SVE_VL_LEN_MASK; + kernel_ulong_t flags = arg & ~PR_SVE_VL_LEN_MASK; + const char *flags_str = sprintflags("", pr_sve_vl_flags, flags); + + xsprintf(out, "%s%s%#" PRI_klx, + flags_str ?: "", flags_str ? "|" : "", vl); + + return out; +} + SYS_FUNC(prctl) { const unsigned int option = tcp->u_arg[0]; @@ -133,7 +141,7 @@ SYS_FUNC(prctl) tprints(", "); } else if (!umove_or_printaddr(tcp, arg2, &i)) { tprints("["); - tprints(signame(i)); + printsignal(i); tprints("]"); } break; @@ -183,6 +191,45 @@ SYS_FUNC(prctl) (kernel_ulong_t) tcp->u_rval); return RVAL_STR; + case PR_SVE_SET_VL: + if (entering(tcp)) { + tprintf(", %s", sprint_sve_val(arg2)); + return 0; + } + ATTRIBUTE_FALLTHROUGH; + + case PR_SVE_GET_VL: + if (entering(tcp)) + break; + if (syserror(tcp) || tcp->u_rval == 0) + return 0; + + tcp->auxstr = sprint_sve_val(tcp->u_rval); + + return RVAL_STR; + + case PR_GET_SPECULATION_CTRL: + if (entering(tcp)) { + tprints(", "); + printxval64(pr_spec_cmds, arg2, "PR_SPEC_???"); + + break; + } + + if (syserror(tcp)) + return 0; + + switch (arg2) { + case PR_SPEC_STORE_BYPASS: + case PR_SPEC_INDIRECT_BRANCH: + tcp->auxstr = sprintflags("", + pr_spec_get_store_bypass_flags, + (kernel_ulong_t) tcp->u_rval); + break; + } + + return RVAL_STR; + /* PR_TASK_PERF_EVENTS_* take no arguments. */ case PR_TASK_PERF_EVENTS_DISABLE: case PR_TASK_PERF_EVENTS_ENABLE: @@ -272,15 +319,17 @@ SYS_FUNC(prctl) if (arg2 > 128) tprintf("%" PRI_klu, arg2); else - tprints(signame(arg2)); + printsignal(arg2); return RVAL_DECODED; case PR_SET_PTRACER: tprints(", "); - if ((int) arg2 == -1) - tprints("PR_SET_PTRACER_ANY"); - else + if ((int) arg2 == -1) { + print_xlat_ex(arg2, "PR_SET_PTRACER_ANY", + XLAT_STYLE_DEFAULT); + } else { tprintf("%" PRI_klu, arg2); + } return RVAL_DECODED; case PR_SET_SECCOMP: @@ -291,7 +340,7 @@ SYS_FUNC(prctl) return RVAL_DECODED; if (SECCOMP_MODE_FILTER == arg2) { tprints(", "); - print_seccomp_filter(tcp, arg3); + decode_seccomp_fprog(tcp, arg3); return RVAL_DECODED; } print_prctl_args(tcp, 2); @@ -331,13 +380,31 @@ SYS_FUNC(prctl) return 0; tcp->auxstr = xlookup(pr_mce_kill_policy, (kernel_ulong_t) tcp->u_rval); - return tcp->auxstr ? RVAL_STR : RVAL_UDECIMAL; + return RVAL_STR; case PR_SET_FP_MODE: tprints(", "); printflags(pr_fp_mode, arg2, "PR_FP_MODE_???"); return RVAL_DECODED; + case PR_SET_SPECULATION_CTRL: + tprints(", "); + printxval64(pr_spec_cmds, arg2, "PR_SPEC_???"); + tprints(", "); + + switch (arg2) { + case PR_SPEC_STORE_BYPASS: + case PR_SPEC_INDIRECT_BRANCH: + printxval64(pr_spec_set_store_bypass_flags, arg3, + "PR_SPEC_???"); + break; + + default: + tprintf("%#" PRI_klx, arg3); + } + + return RVAL_DECODED; + case PR_GET_NO_NEW_PRIVS: case PR_GET_THP_DISABLE: case PR_MPX_DISABLE_MANAGEMENT: @@ -349,8 +416,7 @@ SYS_FUNC(prctl) return 0; } -#if defined X86_64 || defined X32 -# include +#if defined X86_64 || defined X32 || defined I386 # include "xlat/archvals.h" SYS_FUNC(arch_prctl) @@ -374,4 +440,4 @@ SYS_FUNC(arch_prctl) tprintf(", %#" PRI_klx, addr); return RVAL_DECODED; } -#endif /* X86_64 || X32 */ +#endif /* X86_64 || X32 || I386 */ diff --git a/print_aio_sigset.c b/print_aio_sigset.c new file mode 100644 index 00000000..b6f1586a --- /dev/null +++ b/print_aio_sigset.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(strace_aio_sigset) + +typedef struct { + sigset_t *sigmask; + size_t sigsetsize; +} strace_aio_sigset; + +#include MPERS_DEFS + +#include "print_fields.h" + +MPERS_PRINTER_DECL(void, print_aio_sigset, struct tcb *tcp, + const kernel_ulong_t addr) +{ + strace_aio_sigset sigset; + + if (!umove_or_printaddr(tcp, addr, &sigset)) { + tprints("{sigmask="); + print_sigset_addr_len(tcp, (uintptr_t) sigset.sigmask, + sigset.sigsetsize); + PRINT_FIELD_U(", ", sigset, sigsetsize); + tprints("}"); + } +} diff --git a/print_dev_t.c b/print_dev_t.c index 9b62f842..043ca8aa 100644 --- a/print_dev_t.c +++ b/print_dev_t.c @@ -1,30 +1,10 @@ /* * Device number printing routine. * - * Copyright (c) 2016 The strace developers. + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -33,5 +13,17 @@ void print_dev_t(const unsigned long long dev) { - tprintf("makedev(%u, %u)", major(dev), minor(dev)); + if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) + tprintf("%#llx", dev); + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) + return; + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) + tprints(" /* "); + + tprintf("makedev(%#x, %#x)", major(dev), minor(dev)); + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) + tprints(" */"); } diff --git a/print_fields.h b/print_fields.h new file mode 100644 index 00000000..63968af3 --- /dev/null +++ b/print_fields.h @@ -0,0 +1,267 @@ +/* + * Copyright (c) 2016-2017 Dmitry V. Levin + * Copyright (c) 2017-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_PRINT_FIELDS_H +# define STRACE_PRINT_FIELDS_H + +/* + * The printf-like function to use in header files + * shared between strace and its tests. + */ +# ifndef STRACE_PRINTF +# define STRACE_PRINTF tprintf +# endif + +# define PRINT_FIELD_D(prefix_, where_, field_) \ + STRACE_PRINTF("%s%s=%lld", (prefix_), #field_, \ + sign_extend_unsigned_to_ll((where_).field_)) + +# define PRINT_FIELD_U(prefix_, where_, field_) \ + STRACE_PRINTF("%s%s=%llu", (prefix_), #field_, \ + zero_extend_signed_to_ull((where_).field_)) + +# define PRINT_FIELD_U_CAST(prefix_, where_, field_, type_) \ + STRACE_PRINTF("%s%s=%llu", (prefix_), #field_, \ + zero_extend_signed_to_ull((type_) (where_).field_)) + +# define PRINT_FIELD_X(prefix_, where_, field_) \ + STRACE_PRINTF("%s%s=%#llx", (prefix_), #field_, \ + zero_extend_signed_to_ull((where_).field_)) + +# define PRINT_FIELD_ADDR(prefix_, where_, field_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + printaddr((where_).field_); \ + } while (0) + +# define PRINT_FIELD_ADDR64(prefix_, where_, field_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + printaddr64((where_).field_); \ + } while (0) + +# define PRINT_FIELD_0X(prefix_, where_, field_) \ + STRACE_PRINTF("%s%s=%#0*llx", (prefix_), #field_, \ + (int) sizeof((where_).field_) * 2, \ + zero_extend_signed_to_ull((where_).field_)) + +# define PRINT_FIELD_COOKIE(prefix_, where_, field_) \ + STRACE_PRINTF("%s%s=[%llu, %llu]", (prefix_), #field_, \ + zero_extend_signed_to_ull((where_).field_[0]), \ + zero_extend_signed_to_ull((where_).field_[1])) + +# define PRINT_FIELD_FLAGS(prefix_, where_, field_, xlat_, dflt_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + printflags64((xlat_), \ + zero_extend_signed_to_ull((where_).field_),\ + (dflt_)); \ + } while (0) + +# define PRINT_FIELD_XVAL(prefix_, where_, field_, xlat_, dflt_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + printxval64((xlat_), \ + zero_extend_signed_to_ull((where_).field_), \ + (dflt_)); \ + } while (0) + +# define PRINT_FIELD_XVAL_U(prefix_, where_, field_, xlat_, dflt_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + printxvals_ex(zero_extend_signed_to_ull((where_).field_), \ + (dflt_), XLAT_STYLE_FMT_U, \ + (xlat_), NULL); \ + } while (0) + +# define PRINT_FIELD_XVAL_SORTED_SIZED(prefix_, where_, field_, xlat_, \ + xlat_size_, dflt_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + printxval_searchn((xlat_), (xlat_size_), \ + zero_extend_signed_to_ull((where_).field_), \ + (dflt_)); \ + } while (0) + +# define PRINT_FIELD_XVAL_INDEX(prefix_, where_, field_, xlat_, dflt_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + printxval_index((xlat_), \ + zero_extend_signed_to_ull((where_).field_), \ + (dflt_)); \ + } while (0) + +/* + * Generic "ID" printing. ID is considered unsigned except for the special value + * of -1. + */ +# define PRINT_FIELD_ID(prefix_, where_, field_) \ + do { \ + if (sign_extend_unsigned_to_ll((where_).field_) == -1LL) \ + STRACE_PRINTF("%s%s=-1", (prefix_), #field_); \ + else \ + STRACE_PRINTF("%s%s=%llu", (prefix_), #field_, \ + zero_extend_signed_to_ull((where_).field_)); \ + } while (0) + +# define PRINT_FIELD_UID PRINT_FIELD_ID + +# define PRINT_FIELD_UUID(prefix_, where_, field_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + print_uuid((const unsigned char *) ((where_).field_)); \ + } while (0) + +# define PRINT_FIELD_U64(prefix_, where_, field_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + if (zero_extend_signed_to_ull((where_).field_) == UINT64_MAX) \ + print_xlat_u(UINT64_MAX); \ + else \ + STRACE_PRINTF("%llu", \ + zero_extend_signed_to_ull((where_).field_)); \ + } while (0) + +# define PRINT_FIELD_STRING(prefix_, where_, field_, len_, style_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + print_quoted_string((const char *)(where_).field_, \ + (len_), (style_)); \ + } while (0) + +# define PRINT_FIELD_CSTRING(prefix_, where_, field_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + print_quoted_cstring((const char *) (where_).field_, \ + sizeof((where_).field_) + \ + MUST_BE_ARRAY((where_).field_)); \ + } while (0) + +# define PRINT_FIELD_CSTRING_SZ(prefix_, where_, field_, size_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + print_quoted_cstring((const char *) (where_).field_, \ + (size_)); \ + } while (0) + +# define PRINT_FIELD_HEX_ARRAY(prefix_, where_, field_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + print_quoted_string((const char *)(where_).field_, \ + sizeof((where_).field_) + \ + MUST_BE_ARRAY((where_).field_), \ + QUOTE_FORCE_HEX); \ + } while (0) + +# define PRINT_FIELD_INET_ADDR(prefix_, where_, field_, af_) \ + do { \ + STRACE_PRINTF(prefix_); \ + print_inet_addr((af_), &(where_).field_, \ + sizeof((where_).field_), #field_); \ + } while (0) + +# define PRINT_FIELD_AX25_ADDR(prefix_, where_, field_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + print_ax25_addr(&(where_).field_); \ + } while (0) + +# define PRINT_FIELD_X25_ADDR(prefix_, where_, field_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + print_x25_addr(&(where_).field_); \ + } while (0) + +# define PRINT_FIELD_NET_PORT(prefix_, where_, field_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + \ + if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) \ + print_quoted_string((const char *) \ + &(where_).field_, \ + sizeof((where_).field_), \ + QUOTE_FORCE_HEX); \ + \ + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) \ + break; \ + \ + if (xlat_verbose(xlat_verbosity) \ + == XLAT_STYLE_VERBOSE) \ + STRACE_PRINTF(" /* "); \ + \ + STRACE_PRINTF("htons(%u)", ntohs((where_).field_)); \ + \ + if (xlat_verbose(xlat_verbosity) \ + == XLAT_STYLE_VERBOSE) \ + STRACE_PRINTF(" */"); \ + } while (0) + +# define PRINT_FIELD_IFINDEX(prefix_, where_, field_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + print_ifindex((where_).field_); \ + } while (0) + +# define PRINT_FIELD_SOCKADDR(prefix_, where_, field_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + print_sockaddr(&(where_).field_, \ + sizeof((where_).field_)); \ + } while (0) + +# define PRINT_FIELD_DEV(prefix_, where_, field_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + print_dev_t((where_).field_); \ + } while (0) + +# define PRINT_FIELD_PTR(prefix_, where_, field_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + printaddr((mpers_ptr_t) (where_).field_); \ + } while (0) + +# define PRINT_FIELD_FD(prefix_, where_, field_, tcp_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + printfd((tcp_), (where_).field_); \ + } while (0) + +# define PRINT_FIELD_STRN(prefix_, where_, field_, len_, tcp_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + printstrn((tcp_), (where_).field_, (len_)); \ + } while (0) + + +# define PRINT_FIELD_STR(prefix_, where_, field_, tcp_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + printstr((tcp_), (where_).field_); \ + } while (0) + +# define PRINT_FIELD_PATH(prefix_, where_, field_, tcp_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + printpath((tcp_), (where_).field_); \ + } while (0) + +# define PRINT_FIELD_MAC(prefix_, where_, field_) \ + PRINT_FIELD_MAC_SZ((prefix_), (where_), field_, \ + ARRAY_SIZE((where_).field_)) + +# define PRINT_FIELD_MAC_SZ(prefix_, where_, field_, size_) \ + do { \ + static_assert(sizeof(((where_).field_)[0]) == 1, \ + "MAC address is not a byte array"); \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + print_mac_addr("", (const uint8_t *) ((where_).field_), \ + (size_)); \ + } while (0) + +#endif /* !STRACE_PRINT_FIELDS_H */ diff --git a/print_group_req.c b/print_group_req.c new file mode 100644 index 00000000..f0ce58b9 --- /dev/null +++ b/print_group_req.c @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include + +#ifdef MCAST_JOIN_GROUP + +# include DEF_MPERS_TYPE(struct_group_req) +typedef struct group_req struct_group_req; + +#endif /* MCAST_JOIN_GROUP */ + +#include MPERS_DEFS + +#ifdef MCAST_JOIN_GROUP + +# include "print_fields.h" + +MPERS_PRINTER_DECL(void, print_group_req, struct tcb *const tcp, + const kernel_ulong_t addr, const int len) +{ + struct_group_req greq; + + if (len < (int) sizeof(greq)) { + printaddr(addr); + } else if (!umove_or_printaddr(tcp, addr, &greq)) { + PRINT_FIELD_IFINDEX("{", greq, gr_interface); + PRINT_FIELD_SOCKADDR(", ", greq, gr_group); + tprints("}"); + } +} + +#endif /* MCAST_JOIN_GROUP */ diff --git a/print_ifindex.c b/print_ifindex.c new file mode 100644 index 00000000..b6e5470b --- /dev/null +++ b/print_ifindex.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2001-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include + +#ifdef HAVE_IF_INDEXTONAME +# include "xstring.h" + +# define INI_PFX "if_nametoindex(\"" +# define INI_SFX "\")" +# define IFNAME_QUOTED_SZ (sizeof(IFNAMSIZ) * 4 + 3) + +const char * +get_ifname(const unsigned int ifindex) +{ + static char name_quoted_buf[IFNAME_QUOTED_SZ]; + char name_buf[IFNAMSIZ]; + + if (!if_indextoname(ifindex, name_buf)) + return NULL; + + if (string_quote(name_buf, name_quoted_buf, sizeof(name_buf), + QUOTE_0_TERMINATED | QUOTE_OMIT_LEADING_TRAILING_QUOTES, + NULL)) + return NULL; + + return name_quoted_buf; +} + +static const char * +sprint_ifname(const unsigned int ifindex) +{ + static char res[IFNAME_QUOTED_SZ + sizeof(INI_PFX INI_SFX)]; + + const char *name_quoted = get_ifname(ifindex); + + if (!name_quoted) + return NULL; + + xsprintf(res, INI_PFX "%s" INI_SFX, name_quoted); + + return res; +} + +#else /* !HAVE_IF_INDEXTONAME */ + +const char *get_ifname(const unsigned int ifindex) { return NULL; } + +#endif /* HAVE_IF_INDEXTONAME */ + +void +print_ifindex(const unsigned int ifindex) +{ +#ifdef HAVE_IF_INDEXTONAME + print_xlat_ex(ifindex, sprint_ifname(ifindex), XLAT_STYLE_FMT_U); +#else + tprintf("%u", ifindex); +#endif +} diff --git a/print_instruction_pointer.c b/print_instruction_pointer.c new file mode 100644 index 00000000..a25dc8f3 --- /dev/null +++ b/print_instruction_pointer.c @@ -0,0 +1,24 @@ +/* + * Copyright (c) 1999-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +void +print_instruction_pointer(struct tcb *tcp) +{ + kernel_ulong_t ip; + + if (get_instruction_pointer(tcp, &ip)) { + tprintf(current_wordsize == 4 + ? "[%08" PRI_klx "] " + : "[%016" PRI_klx "] ", ip); + } else { + tprints(current_wordsize == 4 + ? "[????????] " + : "[????????????????] "); + } +} diff --git a/print_kernel_version.c b/print_kernel_version.c new file mode 100644 index 00000000..3c32d27b --- /dev/null +++ b/print_kernel_version.c @@ -0,0 +1,31 @@ +/* + * Kernel version printing routine. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +void +print_kernel_version(const unsigned long version) +{ + if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) + tprintf("%#lx", version); + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) + return; + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) + tprints(" /* "); + + tprintf("KERNEL_VERSION(%lu, %lu, %lu)", + version >> 16, + (version >> 8) & 0xFF, + version & 0xFF); + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) + tprints(" */"); +} diff --git a/print_mac.c b/print_mac.c new file mode 100644 index 00000000..8753954e --- /dev/null +++ b/print_mac.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#include "error_prints.h" +#include "xstring.h" + +#ifndef MAX_ADDR_LEN +# define MAX_ADDR_LEN 32 +#endif + +const char * +sprint_mac_addr(const uint8_t addr[], size_t size) +{ + static char res[MAX_ADDR_LEN * 3]; + + if (size > MAX_ADDR_LEN) { + error_func_msg("Address size (%zu) is more than maximum " + "supported (%u)", size, MAX_ADDR_LEN); + + return NULL; + } + + char *ptr = res; + + for (size_t i = 0; i < size; i++) + ptr = xappendstr(res, ptr, "%s%02x", i ? ":" : "", addr[i]); + + return res; +} + +void +print_mac_addr(const char *prefix, const uint8_t addr[], size_t size) +{ + tprints(prefix); + if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) + print_quoted_string((const char *) addr, size, + QUOTE_FORCE_HEX); + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) + return; + (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE + ? tprints_comment : tprints)(sprint_mac_addr(addr, size)); +} diff --git a/print_mq_attr.c b/print_mq_attr.c index b5f9c134..b230c0ed 100644 --- a/print_mq_attr.c +++ b/print_mq_attr.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2004 Ulrich Drepper * Copyright (c) 2005-2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -54,7 +35,7 @@ MPERS_PRINTER_DECL(void, printmqattr, struct tcb *const tcp, if (decode_flags) printflags64(mq_attr_flags, zero_extend_signed_to_ull(attr.mq_flags), - "/* O_??? */"); + "O_???"); else tprintf("%#llx", zero_extend_signed_to_ull(attr.mq_flags)); tprintf(", mq_maxmsg=%lld, mq_msgsize=%lld, mq_curmsgs=%lld}", diff --git a/print_msgbuf.c b/print_msgbuf.c index 348a8914..e61eef92 100644 --- a/print_msgbuf.c +++ b/print_msgbuf.c @@ -5,29 +5,10 @@ * Copyright (c) 1996-1999 Wichert Akkerman * Copyright (c) 2003-2006 Roland McGrath * Copyright (c) 2006-2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/print_sg_req_info.c b/print_sg_req_info.c index 9f0249ec..dd567f2f 100644 --- a/print_sg_req_info.c +++ b/print_sg_req_info.c @@ -1,37 +1,17 @@ /* * Decode struct sg_req_info. * - * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" #ifdef HAVE_SCSI_SG_H -#include DEF_MPERS_TYPE(struct_sg_req_info) +# include DEF_MPERS_TYPE(struct_sg_req_info) # include @@ -68,7 +48,7 @@ MPERS_PRINTER_DECL(int, decode_sg_req_info, tprintf(", duration=%u}", info.duration); } - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } #endif /* HAVE_SCSI_SG_H */ diff --git a/print_sigevent.c b/print_sigevent.c index cfdbc087..27298103 100644 --- a/print_sigevent.c +++ b/print_sigevent.c @@ -1,29 +1,9 @@ /* * Copyright (c) 2003, 2004 Ulrich Drepper - * Copyright (c) 2005-2016 Dmitry V. Levin + * Copyright (c) 2005-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -56,7 +36,7 @@ MPERS_PRINTER_DECL(void, print_sigevent, case SIGEV_SIGNAL: case SIGEV_THREAD: case SIGEV_THREAD_ID: - tprints(signame(sev.sigev_signo)); + printsignal(sev.sigev_signo); break; default: tprintf("%u", sev.sigev_signo); diff --git a/print_statfs.c b/print_statfs.c index c98ff8fe..b4e8f1e0 100644 --- a/print_statfs.c +++ b/print_statfs.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2014-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/print_struct_stat.c b/print_struct_stat.c index 7e9e2338..d7b4b734 100644 --- a/print_struct_stat.c +++ b/print_struct_stat.c @@ -7,29 +7,10 @@ * Copyright (c) 2009-2010 Andreas Schwab * Copyright (c) 2012 H.J. Lu * Copyright (c) 2005-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -65,18 +46,20 @@ print_struct_stat(struct tcb *tcp, const struct strace_stat *const st) } if (!abbrev(tcp)) { - tprints(", st_atime="); - tprints(sprinttime(st->atime)); - if (st->atime_nsec) - tprintf(".%09llu", st->atime_nsec); - tprints(", st_mtime="); - tprints(sprinttime(st->mtime)); - if (st->mtime_nsec) - tprintf(".%09llu", st->mtime_nsec); - tprints(", st_ctime="); - tprints(sprinttime(st->ctime)); - if (st->ctime_nsec) - tprintf(".%09llu", st->ctime_nsec); +#define PRINT_ST_TIME(field) \ + do { \ + tprintf(", st_" #field "=%lld", (long long) st->field); \ + tprints_comment(sprinttime_nsec(st->field, \ + zero_extend_signed_to_ull(st->field ## _nsec)));\ + if (st->has_nsec) \ + tprintf(", st_" #field "_nsec=%llu", \ + zero_extend_signed_to_ull( \ + st->field ## _nsec)); \ + } while (0) + + PRINT_ST_TIME(atime); + PRINT_ST_TIME(mtime); + PRINT_ST_TIME(ctime); } else { tprints(", ..."); } diff --git a/print_time.c b/print_time.c index 82d64fa2..50431834 100644 --- a/print_time.c +++ b/print_time.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -36,8 +17,17 @@ SYS_FUNC(time) if (exiting(tcp)) { time_t t; - if (!umove_or_printaddr(tcp, tcp->u_arg[0], &t)) - tprintf("[%jd]", (intmax_t) t); + if (!umove_or_printaddr(tcp, tcp->u_arg[0], &t)) { + tprintf("[%lld", (long long) t); + tprints_comment(sprinttime(t)); + tprints("]"); + } + + if (!syserror(tcp)) { + tcp->auxstr = sprinttime((time_t) tcp->u_rval); + + return RVAL_STR; + } } return 0; diff --git a/print_timespec.c b/print_timespec.c index 76c70edb..5b353cea 100644 --- a/print_timespec.c +++ b/print_timespec.c @@ -1,125 +1,48 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" #include DEF_MPERS_TYPE(timespec_t) -typedef struct timespec timespec_t; - -#include MPERS_DEFS +#include "kernel_timespec.h" -#ifndef UTIME_NOW -# define UTIME_NOW ((1l << 30) - 1l) -#endif -#ifndef UTIME_OMIT -# define UTIME_OMIT ((1l << 30) - 2l) +#if defined MPERS_IS_mx32 +# define TIMESPEC_IS_32BIT 0 +#elif defined MPERS_IS_m32 +# define TIMESPEC_IS_32BIT 1 +#elif ARCH_TIMESIZE == 4 +# define TIMESPEC_IS_32BIT 1 +#else +# define TIMESPEC_IS_32BIT 0 #endif -static const char timespec_fmt[] = "{tv_sec=%jd, tv_nsec=%jd}"; - -static void -print_timespec_t(const timespec_t *t) -{ - tprintf(timespec_fmt, (intmax_t) t->tv_sec, (intmax_t) t->tv_nsec); -} - -static void -print_timespec_t_utime(const timespec_t *t) -{ - switch (t->tv_nsec) { - case UTIME_NOW: - tprints("UTIME_NOW"); - break; - case UTIME_OMIT: - tprints("UTIME_OMIT"); - break; - default: - print_timespec_t(t); - break; - } -} - -MPERS_PRINTER_DECL(void, print_timespec, - struct tcb *const tcp, const kernel_ulong_t addr) -{ - timespec_t t; - - if (umove_or_printaddr(tcp, addr, &t)) - return; - - print_timespec_t(&t); -} - -MPERS_PRINTER_DECL(const char *, sprint_timespec, - struct tcb *const tcp, const kernel_ulong_t addr) -{ - timespec_t t; - static char buf[sizeof(timespec_fmt) + 3 * sizeof(t)]; - - if (!addr) { - strcpy(buf, "NULL"); - } else if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) || - umove(tcp, addr, &t)) { - snprintf(buf, sizeof(buf), "%#" PRI_klx, addr); - } else { - snprintf(buf, sizeof(buf), timespec_fmt, - (intmax_t) t.tv_sec, (intmax_t) t.tv_nsec); - } +#if TIMESPEC_IS_32BIT +typedef kernel_timespec32_t timespec_t; +# define PRINT_TIMESPEC_DATA_SIZE print_timespec32_data_size +# define PRINT_TIMESPEC_ARRAY_DATA_SIZE print_timespec32_array_data_size +#else +typedef kernel_timespec64_t timespec_t; +# define PRINT_TIMESPEC_DATA_SIZE print_timespec64_data_size +# define PRINT_TIMESPEC_ARRAY_DATA_SIZE print_timespec64_array_data_size +#endif - return buf; -} +#include MPERS_DEFS -MPERS_PRINTER_DECL(void, print_timespec_utime_pair, - struct tcb *const tcp, const kernel_ulong_t addr) +MPERS_PRINTER_DECL(bool, print_struct_timespec_data_size, + const void *arg, const size_t size) { - timespec_t t[2]; - - if (umove_or_printaddr(tcp, addr, &t)) - return; - - tprints("["); - print_timespec_t_utime(&t[0]); - tprints(", "); - print_timespec_t_utime(&t[1]); - tprints("]"); + return PRINT_TIMESPEC_DATA_SIZE(arg, size); } -MPERS_PRINTER_DECL(void, print_itimerspec, - struct tcb *const tcp, const kernel_ulong_t addr) +MPERS_PRINTER_DECL(bool, print_struct_timespec_array_data_size, + const void *arg, const unsigned int nmemb, + const size_t size) { - timespec_t t[2]; - - if (umove_or_printaddr(tcp, addr, &t)) - return; - - tprints("{it_interval="); - print_timespec_t(&t[0]); - tprints(", it_value="); - print_timespec_t(&t[1]); - tprints("}"); + return PRINT_TIMESPEC_ARRAY_DATA_SIZE(arg, nmemb, size); } diff --git a/print_timespec.h b/print_timespec.h new file mode 100644 index 00000000..9199d530 --- /dev/null +++ b/print_timespec.h @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "xstring.h" + +#ifndef TIMESPEC_NSEC +# define TIMESPEC_NSEC tv_nsec +#endif + +#ifndef UTIME_NOW +# define UTIME_NOW ((1l << 30) - 1l) +#endif +#ifndef UTIME_OMIT +# define UTIME_OMIT ((1l << 30) - 2l) +#endif + +#define TIMESPEC_TO_SEC_NSEC(t_) \ + ((long long) (t_)->tv_sec), \ + zero_extend_signed_to_ull((t_)->TIMESPEC_NSEC) + +static const char timespec_fmt[] = + "{tv_sec=%lld, " STRINGIFY_VAL(TIMESPEC_NSEC) "=%llu}"; + +static void +print_sec_nsec(long long sec, unsigned long long nsec) +{ + tprintf(timespec_fmt, sec, nsec); +} + +static void +print_timespec_t(const TIMESPEC_T *t) +{ + print_sec_nsec(TIMESPEC_TO_SEC_NSEC(t)); +} + +#ifdef PRINT_TIMESPEC_DATA_SIZE +bool +PRINT_TIMESPEC_DATA_SIZE(const void *arg, const size_t size) +{ + if (size < sizeof(TIMESPEC_T)) { + tprints("?"); + return false; + } + + print_timespec_t(arg); + return true; +} +#endif /* PRINT_TIMESPEC_DATA_SIZE */ + +#ifdef PRINT_TIMESPEC_ARRAY_DATA_SIZE +bool +PRINT_TIMESPEC_ARRAY_DATA_SIZE(const void *arg, const unsigned int nmemb, + const size_t size) +{ + const TIMESPEC_T *ts = arg; + unsigned int i; + + if (nmemb > size / sizeof(TIMESPEC_T)) { + tprints("?"); + return false; + } + + tprints("["); + + for (i = 0; i < nmemb; i++) { + if (i) + tprints(", "); + print_timespec_t(&ts[i]); + } + + tprints("]"); + return true; +} +#endif /* PRINT_TIMESPEC_ARRAY_DATA_SIZE */ + +#ifdef PRINT_TIMESPEC +int +PRINT_TIMESPEC(struct tcb *const tcp, const kernel_ulong_t addr) +{ + TIMESPEC_T t; + + if (umove_or_printaddr(tcp, addr, &t)) + return -1; + + print_timespec_t(&t); + return 0; +} +#endif /* PRINT_TIMESPEC */ + +#ifdef SPRINT_TIMESPEC +const char * +SPRINT_TIMESPEC(struct tcb *const tcp, const kernel_ulong_t addr) +{ + TIMESPEC_T t; + static char buf[sizeof(timespec_fmt) + 3 * sizeof(t)]; + + if (!addr) { + strcpy(buf, "NULL"); + } else if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) || + umove(tcp, addr, &t)) { + xsprintf(buf, "%#" PRI_klx, addr); + } else { + xsprintf(buf, timespec_fmt, TIMESPEC_TO_SEC_NSEC(&t)); + } + + return buf; +} +#endif /* SPRINT_TIMESPEC */ + +#ifdef PRINT_TIMESPEC_UTIME_PAIR +static void +print_timespec_t_utime(const TIMESPEC_T *t) +{ + switch (t->TIMESPEC_NSEC) { + case UTIME_NOW: + case UTIME_OMIT: + if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) + print_timespec_t(t); + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) + break; + + (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE + ? tprints_comment : tprints)(t->TIMESPEC_NSEC == UTIME_NOW + ? "UTIME_NOW" : "UTIME_OMIT"); + break; + default: + print_timespec_t(t); + tprints_comment(sprinttime_nsec(TIMESPEC_TO_SEC_NSEC(t))); + break; + } +} + +int +PRINT_TIMESPEC_UTIME_PAIR(struct tcb *const tcp, const kernel_ulong_t addr) +{ + TIMESPEC_T t[2]; + + if (umove_or_printaddr(tcp, addr, &t)) + return -1; + + tprints("["); + print_timespec_t_utime(&t[0]); + tprints(", "); + print_timespec_t_utime(&t[1]); + tprints("]"); + return 0; +} +#endif /* PRINT_TIMESPEC_UTIME_PAIR */ + +#ifdef PRINT_ITIMERSPEC +int +PRINT_ITIMERSPEC(struct tcb *const tcp, const kernel_ulong_t addr) +{ + TIMESPEC_T t[2]; + + if (umove_or_printaddr(tcp, addr, &t)) + return -1; + + tprints("{it_interval="); + print_timespec_t(&t[0]); + tprints(", it_value="); + print_timespec_t(&t[1]); + tprints("}"); + return 0; +} +#endif /* PRINT_ITIMERSPEC */ diff --git a/print_timespec32.c b/print_timespec32.c new file mode 100644 index 00000000..f6a16bc9 --- /dev/null +++ b/print_timespec32.c @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2019 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#if HAVE_ARCH_TIME32_SYSCALLS + +# define TIMESPEC_T kernel_timespec32_t +# define PRINT_TIMESPEC_DATA_SIZE print_timespec32_data_size +# define PRINT_TIMESPEC_ARRAY_DATA_SIZE print_timespec32_array_data_size +# define PRINT_TIMESPEC print_timespec32 +# define SPRINT_TIMESPEC sprint_timespec32 +# define PRINT_TIMESPEC_UTIME_PAIR print_timespec32_utime_pair +# define PRINT_ITIMERSPEC print_itimerspec32 + +# include "kernel_timespec.h" +# include "print_timespec.h" + +#endif /* HAVE_ARCH_TIME32_SYSCALLS */ diff --git a/print_timespec64.c b/print_timespec64.c new file mode 100644 index 00000000..3a9732c9 --- /dev/null +++ b/print_timespec64.c @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2019 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#define TIMESPEC_T kernel_timespec64_t +#define PRINT_TIMESPEC_DATA_SIZE print_timespec64_data_size +#define PRINT_TIMESPEC_ARRAY_DATA_SIZE print_timespec64_array_data_size +#define PRINT_TIMESPEC print_timespec64 +#define SPRINT_TIMESPEC sprint_timespec64 +#define PRINT_TIMESPEC_UTIME_PAIR print_timespec64_utime_pair +#define PRINT_ITIMERSPEC print_itimerspec64 + +#include "kernel_timespec.h" +#include "print_timespec.h" diff --git a/print_timeval.c b/print_timeval.c index 5c286754..ff87b27b 100644 --- a/print_timeval.c +++ b/print_timeval.c @@ -1,28 +1,9 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -33,12 +14,23 @@ typedef struct timeval timeval_t; #include MPERS_DEFS -static const char timeval_fmt[] = "{tv_sec=%jd, tv_usec=%jd}"; +#include "xstring.h" + +static const char timeval_fmt[] = "{tv_sec=%lld, tv_usec=%llu}"; static void print_timeval_t(const timeval_t *t) { - tprintf(timeval_fmt, (intmax_t) t->tv_sec, (intmax_t) t->tv_usec); + tprintf(timeval_fmt, (long long) t->tv_sec, + zero_extend_signed_to_ull(t->tv_usec)); +} + +static void +print_timeval_t_utime(const timeval_t *t) +{ + print_timeval_t(t); + tprints_comment(sprinttime_usec(t->tv_sec, + zero_extend_signed_to_ull(t->tv_usec))); } MPERS_PRINTER_DECL(void, print_struct_timeval, const void *arg) @@ -46,34 +38,44 @@ MPERS_PRINTER_DECL(void, print_struct_timeval, const void *arg) print_timeval_t(arg); } -MPERS_PRINTER_DECL(void, print_timeval, - struct tcb *const tcp, const kernel_ulong_t addr) +MPERS_PRINTER_DECL(bool, print_struct_timeval_data_size, + const void *arg, const size_t size) { - timeval_t t; - - if (umove_or_printaddr(tcp, addr, &t)) - return; + if (size < sizeof(timeval_t)) { + tprints("?"); + return false; + } - print_timeval_t(&t); + print_timeval_t(arg); + return true; } -static bool -print_timeval_item(struct tcb *tcp, void *elem_buf, size_t size, void *data) +MPERS_PRINTER_DECL(int, print_timeval, + struct tcb *const tcp, const kernel_ulong_t addr) { - timeval_t *t = elem_buf; + timeval_t t; - print_timeval_t(t); + if (umove_or_printaddr(tcp, addr, &t)) + return -1; - return true; + print_timeval_t(&t); + return 0; } -MPERS_PRINTER_DECL(void, print_timeval_pair, +MPERS_PRINTER_DECL(int, print_timeval_utimes, struct tcb *const tcp, const kernel_ulong_t addr) { - timeval_t t; + timeval_t t[2]; - print_array(tcp, addr, 2, &t, sizeof(t), umoven_or_printaddr, - print_timeval_item, NULL); + if (umove_or_printaddr(tcp, addr, &t)) + return -1; + + tprints("["); + print_timeval_t_utime(&t[0]); + tprints(", "); + print_timeval_t_utime(&t[1]); + tprints("]"); + return 0; } MPERS_PRINTER_DECL(const char *, sprint_timeval, @@ -86,28 +88,30 @@ MPERS_PRINTER_DECL(const char *, sprint_timeval, strcpy(buf, "NULL"); } else if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) || umove(tcp, addr, &t)) { - snprintf(buf, sizeof(buf), "%#" PRI_klx, addr); + xsprintf(buf, "%#" PRI_klx, addr); } else { - snprintf(buf, sizeof(buf), timeval_fmt, - (intmax_t) t.tv_sec, (intmax_t) t.tv_usec); + xsprintf(buf, timeval_fmt, + (long long) t.tv_sec, + zero_extend_signed_to_ull(t.tv_usec)); } return buf; } -MPERS_PRINTER_DECL(void, print_itimerval, +MPERS_PRINTER_DECL(int, print_itimerval, struct tcb *const tcp, const kernel_ulong_t addr) { timeval_t t[2]; if (umove_or_printaddr(tcp, addr, &t)) - return; + return -1; tprints("{it_interval="); print_timeval_t(&t[0]); tprints(", it_value="); print_timeval_t(&t[1]); tprints("}"); + return 0; } #ifdef ALPHA @@ -115,48 +119,60 @@ MPERS_PRINTER_DECL(void, print_itimerval, void print_timeval32_t(const timeval32_t *t) { - tprintf(timeval_fmt, (intmax_t) t->tv_sec, (intmax_t) t->tv_usec); + tprintf(timeval_fmt, (long long) t->tv_sec, + zero_extend_signed_to_ull(t->tv_usec)); } -void +static void +print_timeval32_t_utime(const timeval32_t *t) +{ + print_timeval32_t(t); + tprints_comment(sprinttime_usec(t->tv_sec, + zero_extend_signed_to_ull(t->tv_usec))); +} + +int print_timeval32(struct tcb *const tcp, const kernel_ulong_t addr) { timeval32_t t; if (umove_or_printaddr(tcp, addr, &t)) - return; + return -1; print_timeval32_t(&t); + return 0; } -void -print_timeval32_pair(struct tcb *const tcp, const kernel_ulong_t addr) +int +print_timeval32_utimes(struct tcb *const tcp, const kernel_ulong_t addr) { timeval32_t t[2]; if (umove_or_printaddr(tcp, addr, &t)) - return; + return -1; tprints("["); - print_timeval32_t(&t[0]); + print_timeval32_t_utime(&t[0]); tprints(", "); - print_timeval32_t(&t[1]); + print_timeval32_t_utime(&t[1]); tprints("]"); + return 0; } -void +int print_itimerval32(struct tcb *const tcp, const kernel_ulong_t addr) { timeval32_t t[2]; if (umove_or_printaddr(tcp, addr, &t)) - return; + return -1; tprints("{it_interval="); print_timeval32_t(&t[0]); tprints(", it_value="); print_timeval32_t(&t[1]); tprints("}"); + return 0; } const char * @@ -169,10 +185,11 @@ sprint_timeval32(struct tcb *const tcp, const kernel_ulong_t addr) strcpy(buf, "NULL"); } else if (!verbose(tcp) || (exiting(tcp) && syserror(tcp)) || umove(tcp, addr, &t)) { - snprintf(buf, sizeof(buf), "%#" PRI_klx, addr); + xsprintf(buf, "%#" PRI_klx, addr); } else { - snprintf(buf, sizeof(buf), timeval_fmt, - (intmax_t) t.tv_sec, (intmax_t) t.tv_usec); + xsprintf(buf, timeval_fmt, + (long long) t.tv_sec, + zero_extend_signed_to_ull(t.tv_usec)); } return buf; diff --git a/print_timeval64.c b/print_timeval64.c new file mode 100644 index 00000000..1721b96f --- /dev/null +++ b/print_timeval64.c @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2019 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#define TIMESPEC_T kernel_timeval64_t +#define TIMESPEC_NSEC tv_usec +#define PRINT_TIMESPEC_DATA_SIZE print_timeval64_data_size + +#include "kernel_timeval.h" +#include "print_timespec.h" diff --git a/print_timex.c b/print_timex.c index 5d0c478e..d4c45435 100644 --- a/print_timex.c +++ b/print_timex.c @@ -3,70 +3,42 @@ * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 2006-2015 Dmitry V. Levin + * Copyright (c) 2015-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" - -#include DEF_MPERS_TYPE(struct_timex) - +#include "kernel_timex.h" #include -typedef struct timex struct_timex; - -#include MPERS_DEFS #include "xlat/adjtimex_modes.h" #include "xlat/adjtimex_status.h" -MPERS_PRINTER_DECL(int, print_timex, - struct tcb *const tcp, const kernel_ulong_t addr) -{ - struct_timex tx; - if (umove_or_printaddr(tcp, addr, &tx)) - return -1; +#define PRINT_TIMEX print_timex64 +#define TIMEX_T kernel_timex64_t +#include "print_timex.h" +#undef TIMEX_T +#undef PRINT_TIMEX + +#if HAVE_ARCH_TIME32_SYSCALLS + +# define PRINT_TIMEX print_timex32 +# define TIMEX_T kernel_timex32_t +# include "print_timex.h" +# undef TIMEX_T +# undef PRINT_TIMEX + +#endif /* HAVE_ARCH_TIME32_SYSCALLS */ + +#ifdef SPARC64 + +# define PRINT_TIMEX print_sparc64_timex +# define TIMEX_T kernel_sparc64_timex_t +# include "print_timex.h" +# undef TIMEX_T +# undef PRINT_TIMEX - tprints("{modes="); - printflags(adjtimex_modes, tx.modes, "ADJ_???"); - tprintf(", offset=%jd, freq=%jd, maxerror=%ju, esterror=%ju, status=", - (intmax_t) tx.offset, (intmax_t) tx.freq, - (uintmax_t) tx.maxerror, (uintmax_t) tx.esterror); - printflags(adjtimex_status, tx.status, "STA_???"); - tprintf(", constant=%jd, precision=%ju, tolerance=%jd, time=", - (intmax_t) tx.constant, (uintmax_t) tx.precision, - (intmax_t) tx.tolerance); - MPERS_FUNC_NAME(print_struct_timeval)(&tx.time); - tprintf(", tick=%jd, ppsfreq=%jd, jitter=%jd", - (intmax_t) tx.tick, (intmax_t) tx.ppsfreq, (intmax_t) tx.jitter); - tprintf(", shift=%d, stabil=%jd, jitcnt=%jd", - tx.shift, (intmax_t) tx.stabil, (intmax_t) tx.jitcnt); - tprintf(", calcnt=%jd, errcnt=%jd, stbcnt=%jd", - (intmax_t) tx.calcnt, (intmax_t) tx.errcnt, (intmax_t) tx.stbcnt); -#ifdef HAVE_STRUCT_TIMEX_TAI - tprintf(", tai=%d", tx.tai); -#endif - tprints("}"); - return 0; -} +#endif /* SPARC64 */ diff --git a/print_timex.h b/print_timex.h new file mode 100644 index 00000000..3cc83062 --- /dev/null +++ b/print_timex.h @@ -0,0 +1,45 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 2006-2015 Dmitry V. Levin + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "print_fields.h" + +int +PRINT_TIMEX(struct tcb *const tcp, const kernel_ulong_t addr) +{ + TIMEX_T tx; + + if (umove_or_printaddr(tcp, addr, &tx)) + return -1; + + PRINT_FIELD_FLAGS("{", tx, modes, adjtimex_modes, "ADJ_???"); + PRINT_FIELD_D(", ", tx, offset); + PRINT_FIELD_D(", ", tx, freq); + PRINT_FIELD_D(", ", tx, maxerror); + PRINT_FIELD_D(", ", tx, esterror); + PRINT_FIELD_FLAGS(", ", tx, status, adjtimex_status, "STA_???"); + PRINT_FIELD_D(", ", tx, constant); + PRINT_FIELD_D(", ", tx, precision); + PRINT_FIELD_D(", ", tx, tolerance); + PRINT_FIELD_D(", time={", tx.time, tv_sec); + PRINT_FIELD_U(", ", tx.time, tv_usec); + PRINT_FIELD_D("}, ", tx, tick); + PRINT_FIELD_D(", ", tx, ppsfreq); + PRINT_FIELD_D(", ", tx, jitter); + PRINT_FIELD_D(", ", tx, shift); + PRINT_FIELD_D(", ", tx, stabil); + PRINT_FIELD_D(", ", tx, jitcnt); + PRINT_FIELD_D(", ", tx, calcnt); + PRINT_FIELD_D(", ", tx, errcnt); + PRINT_FIELD_D(", ", tx, stbcnt); + PRINT_FIELD_D(", ", tx, tai); + tprints("}"); + return 0; +} diff --git a/print_utils.h b/print_utils.h new file mode 100644 index 00000000..519cd401 --- /dev/null +++ b/print_utils.h @@ -0,0 +1,39 @@ +#ifndef STRACE_PRINT_UTILS_H +# define STRACE_PRINT_UTILS_H + +# include + +/* Hexadecimal output utils */ + +static const char hex_chars[16] = "0123456789abcdef"; + +/** + * Character array representing hexadecimal encoding of a character value. + * + * @param b_ Byte to provide representation for. + */ +# define BYTE_HEX_CHARS(b_) \ + hex_chars[((uint8_t) (b_)) >> 4], hex_chars[((uint8_t) (b_)) & 0xf] +# define BYTE_HEX_CHARS_PRINTF(b_) \ + '\\', 'x', BYTE_HEX_CHARS(b_) +# define BYTE_HEX_CHARS_PRINTF_QUOTED(b_) \ + '\'', BYTE_HEX_CHARS_PRINTF(b_), '\'' + +static inline char * +sprint_byte_hex(char *buf, uint8_t val) +{ + *buf++ = hex_chars[val >> 4]; + *buf++ = hex_chars[val & 0xf]; + + return buf; +} + +/* Character classification utils */ + +static inline bool +is_print(uint8_t c) +{ + return (c >= ' ') && (c < 0x7f); +} + +#endif /* STRACE_PRINT_UTILS_H */ diff --git a/printmode.c b/printmode.c index 1babed6d..30468fbf 100644 --- a/printmode.c +++ b/printmode.c @@ -4,29 +4,10 @@ * Copyright (c) 1993-1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman * Copyright (c) 2012 Denys Vlasenko + * Copyright (c) 2012-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -39,25 +20,24 @@ void print_symbolic_mode_t(const unsigned int mode) { - const char *ifmt; + const char *ifmt = ""; - if (mode & S_IFMT) { + if (mode & S_IFMT) ifmt = xlookup(modetypes, mode & S_IFMT); - if (!ifmt) { - tprintf("%#03o", mode); - return; - } - } else { - ifmt = NULL; - } - tprintf("%s%s%s%s%s%#03o", - ifmt ? ifmt : "", - ifmt ? "|" : "", - (mode & S_ISUID) ? "S_ISUID|" : "", - (mode & S_ISGID) ? "S_ISGID|" : "", - (mode & S_ISVTX) ? "S_ISVTX|" : "", - mode & ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX)); + if (!ifmt || xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) + tprintf("%#03o", mode); + + if (!ifmt || xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) + return; + + (xlat_verbose(xlat_verbosity) == XLAT_STYLE_ABBREV + ? tprintf : tprintf_comment)("%s%s%s%s%s%#03o", + ifmt, ifmt[0] ? "|" : "", + (mode & S_ISUID) ? "S_ISUID|" : "", + (mode & S_ISGID) ? "S_ISGID|" : "", + (mode & S_ISVTX) ? "S_ISVTX|" : "", + mode & ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX)); } void diff --git a/printrusage.c b/printrusage.c index 0a6a3c34..27a9c36d 100644 --- a/printrusage.c +++ b/printrusage.c @@ -3,29 +3,10 @@ * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 1999-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/printsiginfo.c b/printsiginfo.c index 7bbb4214..9cfc4c63 100644 --- a/printsiginfo.c +++ b/printsiginfo.c @@ -7,29 +7,10 @@ * Copyright (c) 2013 Denys Vlasenko * Copyright (c) 2011-2015 Dmitry V. Levin * Copyright (c) 2015 Elvira Khabirova + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -41,8 +22,10 @@ #include MPERS_DEFS +#include "nr_prefix.c" + #ifndef IN_MPERS -#include "printsiginfo.h" +# include "printsiginfo.h" #endif #include "xlat/audit_arch.h" @@ -123,10 +106,7 @@ print_si_code(int si_signo, unsigned int si_code) } } - if (code) - tprints(code); - else - tprintf("%#x", si_code); + print_xlat_ex(si_code, code, XLAT_STYLE_DEFAULT); } static void @@ -190,14 +170,31 @@ print_si_info(const siginfo_t *sip) break; #ifdef HAVE_SIGINFO_T_SI_SYSCALL case SIGSYS: { - const char *scname = - syscall_name((unsigned) sip->si_syscall); + /* + * Note that we can safely use the personlity set in + * current_personality here (and don't have to guess it + * based on X32_SYSCALL_BIT and si_arch, for example): + * - The signal is delivered as a result of seccomp + * filtering to the process executing forbidden + * syscall. + * - We have set the personality for the tracee during + * the syscall entering. + * - The current_personality is reliably switched in + * the next_event routine, it is set to the + * personality of the last call made (the one that + * triggered the signal delivery). + * - Looks like there are no other cases where SIGSYS + * is delivered from the kernel so far. + */ + const char *scname = syscall_name(shuffle_scno( + (unsigned) sip->si_syscall)); tprints(", si_call_addr="); printaddr(ptr_to_kulong(sip->si_call_addr)); tprints(", si_syscall="); if (scname) - tprintf("__NR_%s", scname); + tprintf("%s%s", + nr_prefix(sip->si_syscall), scname); else tprintf("%u", (unsigned) sip->si_syscall); tprints(", si_arch="); @@ -260,5 +257,5 @@ MPERS_PRINTER_DECL(void, print_siginfo_array, struct tcb *const tcp, siginfo_t si; print_array(tcp, addr, len, &si, sizeof(si), - umoven_or_printaddr, print_siginfo_t, 0); + tfetch_mem, print_siginfo_t, 0); } diff --git a/printsiginfo.h b/printsiginfo.h index 7ad72380..4088cb54 100644 --- a/printsiginfo.h +++ b/printsiginfo.h @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #ifndef STRACE_PRINTSIGINFO_H -#define STRACE_PRINTSIGINFO_H +# define STRACE_PRINTSIGINFO_H extern void printsiginfo(const siginfo_t *); diff --git a/process.c b/process.c index 6928fb92..d224c396 100644 --- a/process.c +++ b/process.c @@ -8,30 +8,11 @@ * * Copyright (c) 2000 PocketPenguins Inc. Linux for Hitachi SuperH * port by Greg Banks + * Copyright (c) 1999-2018 The strace developers. * * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -40,10 +21,11 @@ # include #endif -#include "xlat/nt_descriptor_types.h" - -#include "regs.h" #include "ptrace.h" +#include "ptrace_syscall_info.h" +#include "regs.h" + +#include "xlat/nt_descriptor_types.h" #include "xlat/ptrace_cmds.h" #include "xlat/ptrace_setoptions_flags.h" #include "xlat/ptrace_peeksiginfo_flags.h" @@ -59,6 +41,7 @@ static const struct xlat struct_user_offsets[] = { static void print_user_offset_addr(const kernel_ulong_t addr) { + bool no_str = false; const struct xlat *x; for (x = struct_user_offsets; x->str; ++x) { @@ -66,19 +49,26 @@ print_user_offset_addr(const kernel_ulong_t addr) break; } - if (!x->str) { + if (!x->str || (x == struct_user_offsets && x->val > addr)) + no_str = true; + if (no_str || xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) printaddr(addr); - } else if (x->val > addr) { - if (x == struct_user_offsets) { - printaddr(addr); - } else { - --x; - tprintf("%s + %" PRI_klu, - x->str, addr - (kernel_ulong_t) x->val); - } + if (no_str || xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) + return; + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) + tprints(" /* "); + + if (x->val > addr) { + --x; + tprintf("%s + %" PRI_klu, + x->str, addr - (kernel_ulong_t) x->val); } else { tprints(x->str); } + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) + tprints(" */"); } SYS_FUNC(ptrace) @@ -121,6 +111,8 @@ SYS_FUNC(ptrace) case PTRACE_GETSIGMASK: case PTRACE_SETSIGMASK: case PTRACE_SECCOMP_GET_FILTER: + case PTRACE_SECCOMP_GET_METADATA: + case PTRACE_GET_SYSCALL_INFO: tprintf(", %" PRI_klu, addr); break; case PTRACE_PEEKSIGINFO: { @@ -146,25 +138,25 @@ SYS_FUNC(ptrace) printaddr(addr); } -# if defined IA64 || defined SPARC || defined SPARC64 +#if defined IA64 || defined SPARC || defined SPARC64 switch (request) { -# ifdef IA64 +# ifdef IA64 case PTRACE_PEEKDATA: case PTRACE_PEEKTEXT: case PTRACE_PEEKUSER: /* data is ignored */ return RVAL_DECODED | RVAL_HEX; -# endif /* IA64 */ -# if defined SPARC || defined SPARC64 +# endif /* IA64 */ +# if defined SPARC || defined SPARC64 case PTRACE_GETREGS: case PTRACE_SETREGS: case PTRACE_GETFPREGS: case PTRACE_SETFPREGS: /* data is ignored */ return RVAL_DECODED; -# endif /* SPARC || SPARC64 */ +# endif /* SPARC || SPARC64 */ } -# endif /* IA64 || SPARC || SPARC64 */ +#endif /* IA64 || SPARC || SPARC64 */ tprints(", "); @@ -203,6 +195,21 @@ SYS_FUNC(ptrace) case PTRACE_SETREGSET: tprint_iov(tcp, /*len:*/ 1, data, IOV_DECODE_ADDR); break; + case PTRACE_SECCOMP_GET_METADATA: + if (verbose(tcp)) { + uint64_t filter_off; + if (addr < sizeof(filter_off) || + umove(tcp, data, &filter_off)) { + printaddr(data); + return RVAL_DECODED; + } + + tprintf("{filter_off=%" PRIu64, filter_off); + return 0; + } + + printaddr(data); + break; #ifndef IA64 case PTRACE_PEEKDATA: case PTRACE_PEEKTEXT: @@ -214,11 +221,12 @@ SYS_FUNC(ptrace) case PTRACE_GETSIGMASK: case PTRACE_PEEKSIGINFO: case PTRACE_SECCOMP_GET_FILTER: + case PTRACE_GET_SYSCALL_INFO: if (verbose(tcp)) { /* print data on exiting syscall */ return 0; } - /* fall through */ + ATTRIBUTE_FALLTHROUGH; default: printaddr(data); break; @@ -252,6 +260,36 @@ SYS_FUNC(ptrace) case PTRACE_SECCOMP_GET_FILTER: print_seccomp_fprog(tcp, data, tcp->u_rval); break; + case PTRACE_SECCOMP_GET_METADATA: { + const size_t offset = sizeof(uint64_t); + uint64_t flags = 0; + size_t ret_size = MIN((kernel_ulong_t) tcp->u_rval, + offset + sizeof(flags)); + + if (syserror(tcp) || ret_size <= offset) { + tprints("}"); + return 0; + } + + if (umoven(tcp, data + offset, ret_size - offset, + &flags)) { + tprints(", ...}"); + return 0; + } + + tprints(", flags="); + printflags64(seccomp_filter_flags, flags, + "SECCOMP_FILTER_FLAG_???"); + + if ((kernel_ulong_t) tcp->u_rval > ret_size) + tprints(", ..."); + + tprints("}"); + break; + } + case PTRACE_GET_SYSCALL_INFO: + print_ptrace_syscall_info(tcp, data, addr); + break; } } return 0; diff --git a/process_vm.c b/process_vm.c index f63b9173..abee1e68 100644 --- a/process_vm.c +++ b/process_vm.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2012 Denys Vlasenko * Copyright (c) 2012-2015 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/ptp.c b/ptp.c index e2a720ba..ffc16063 100644 --- a/ptp.c +++ b/ptp.c @@ -1,36 +1,21 @@ /* * Copyright (c) 2014 Stefan Sørensen * Copyright (c) 2014-2015 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" -#include -#include -#include "xlat/ptp_flags_options.h" +#ifdef HAVE_STRUCT_PTP_SYS_OFFSET + +# include +# include + +# include "print_fields.h" +# include "xlat/ptp_flags_options.h" int ptp_ioctl(struct tcb *const tcp, const unsigned int code, @@ -47,8 +32,8 @@ ptp_ioctl(struct tcb *const tcp, const unsigned int code, if (umove_or_printaddr(tcp, arg, &extts)) break; - tprintf("{index=%d, flags=", extts.index); - printflags(ptp_flags_options, extts.flags, "PTP_???"); + PRINT_FIELD_D("{", extts, index); + PRINT_FIELD_FLAGS(", ", extts, flags, ptp_flags_options, "PTP_???"); tprints("}"); break; } @@ -60,13 +45,12 @@ ptp_ioctl(struct tcb *const tcp, const unsigned int code, if (umove_or_printaddr(tcp, arg, &perout)) break; - tprintf("{start={%" PRId64 ", %" PRIu32 "}" - ", period={%" PRId64 ", %" PRIu32 "}" - ", index=%d, flags=", - (int64_t)perout.start.sec, perout.start.nsec, - (int64_t)perout.period.sec, perout.period.nsec, - perout.index); - printflags(ptp_flags_options, perout.flags, "PTP_???"); + PRINT_FIELD_D("{start={", perout.start, sec); + PRINT_FIELD_U(", ", perout.start, nsec); + PRINT_FIELD_D("}, period={", perout.period, sec); + PRINT_FIELD_U(", ", perout.period, nsec); + PRINT_FIELD_D("}, ", perout, index); + PRINT_FIELD_FLAGS(", ", perout, flags, ptp_flags_options, "PTP_???"); tprints("}"); break; } @@ -83,8 +67,8 @@ ptp_ioctl(struct tcb *const tcp, const unsigned int code, if (umove_or_printaddr(tcp, arg, &sysoff)) break; - tprintf("{n_samples=%u", sysoff.n_samples); - return 1; + PRINT_FIELD_U("{", sysoff, n_samples); + return 0; } else { unsigned int n_samples, i; @@ -105,9 +89,9 @@ ptp_ioctl(struct tcb *const tcp, const unsigned int code, for (i = 0; i < 2 * n_samples + 1; ++i) { if (i > 0) tprints(", "); - tprintf("{%" PRId64 ", %" PRIu32 "}", - (int64_t)sysoff.ts[i].sec, - sysoff.ts[i].nsec); + PRINT_FIELD_D("{", sysoff.ts[i], sec); + PRINT_FIELD_U(", ", sysoff.ts[i], nsec); + tprints("}"); } if (sysoff.n_samples > PTP_MAX_SAMPLES) tprints(", ..."); @@ -125,9 +109,12 @@ ptp_ioctl(struct tcb *const tcp, const unsigned int code, if (umove_or_printaddr(tcp, arg, &caps)) break; - tprintf("{max_adj=%d, n_alarm=%d, n_ext_ts=%d, n_per_out=%d, pps=%d}", - caps.max_adj, caps.n_alarm, caps.n_ext_ts, - caps.n_per_out, caps.pps); + PRINT_FIELD_D("{", caps, max_adj); + PRINT_FIELD_D(", ", caps, n_alarm); + PRINT_FIELD_D(", ", caps, n_ext_ts); + PRINT_FIELD_D(", ", caps, n_per_out); + PRINT_FIELD_D(", ", caps, pps); + tprints("}"); break; } @@ -135,5 +122,7 @@ ptp_ioctl(struct tcb *const tcp, const unsigned int code, return RVAL_DECODED; } - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } + +#endif /* HAVE_STRUCT_PTP_SYS_OFFSET */ diff --git a/ptrace.h b/ptrace.h index ce4fd9af..e4a5851d 100644 --- a/ptrace.h +++ b/ptrace.h @@ -8,175 +8,189 @@ * Copyright (c) 2011-2016 Dmitry V. Levin * Copyright (c) 2013 Ali Polatel * Copyright (c) 2015 Mike Frysinger + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #ifndef STRACE_PTRACE_H -#define STRACE_PTRACE_H +# define STRACE_PTRACE_H -#include +# include +# include -#ifdef HAVE_STRUCT_IA64_FPREG -# define ia64_fpreg XXX_ia64_fpreg -#endif -#ifdef HAVE_STRUCT_PT_ALL_USER_REGS -# define pt_all_user_regs XXX_pt_all_user_regs -#endif -#ifdef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS -# define ptrace_peeksiginfo_args XXX_ptrace_peeksiginfo_args -#endif +# ifdef HAVE_STRUCT_IA64_FPREG +# define ia64_fpreg XXX_ia64_fpreg +# endif +# ifdef HAVE_STRUCT_PT_ALL_USER_REGS +# define pt_all_user_regs XXX_pt_all_user_regs +# endif +# ifdef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS +# define ptrace_peeksiginfo_args XXX_ptrace_peeksiginfo_args +# endif -#include +# include -#ifdef HAVE_STRUCT_IA64_FPREG -# undef ia64_fpreg -#endif -#ifdef HAVE_STRUCT_PT_ALL_USER_REGS -# undef pt_all_user_regs -#endif -#ifdef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS -# undef ptrace_peeksiginfo_args -#endif +# ifdef HAVE_STRUCT_IA64_FPREG +# undef ia64_fpreg +# endif +# ifdef HAVE_STRUCT_PT_ALL_USER_REGS +# undef pt_all_user_regs +# endif +# ifdef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS +# undef ptrace_peeksiginfo_args +# endif -#if defined(SPARC) || defined(SPARC64) +# if defined(SPARC) || defined(SPARC64) /* * SPARC has a different PTRACE_DETACH value correctly defined in sys/ptrace.h, * but linux/ptrace.h clobbers it with the standard one. PTRACE_SUNDETACH is * also defined to the correct value by sys/ptrace.h, so use that instead. */ -# undef PTRACE_DETACH -# define PTRACE_DETACH PTRACE_SUNDETACH -#endif +# undef PTRACE_DETACH +# define PTRACE_DETACH PTRACE_SUNDETACH +# endif -#ifndef PTRACE_EVENT_FORK -# define PTRACE_EVENT_FORK 1 -#endif -#ifndef PTRACE_EVENT_VFORK -# define PTRACE_EVENT_VFORK 2 -#endif -#ifndef PTRACE_EVENT_CLONE -# define PTRACE_EVENT_CLONE 3 -#endif -#ifndef PTRACE_EVENT_EXEC -# define PTRACE_EVENT_EXEC 4 -#endif -#ifndef PTRACE_EVENT_VFORK_DONE -# define PTRACE_EVENT_VFORK_DONE 5 -#endif -#ifndef PTRACE_EVENT_EXIT -# define PTRACE_EVENT_EXIT 6 -#endif -#ifndef PTRACE_EVENT_SECCOMP -# define PTRACE_EVENT_SECCOMP 7 -#endif -#ifdef PTRACE_EVENT_STOP +# ifndef PTRACE_EVENT_FORK +# define PTRACE_EVENT_FORK 1 +# endif +# ifndef PTRACE_EVENT_VFORK +# define PTRACE_EVENT_VFORK 2 +# endif +# ifndef PTRACE_EVENT_CLONE +# define PTRACE_EVENT_CLONE 3 +# endif +# ifndef PTRACE_EVENT_EXEC +# define PTRACE_EVENT_EXEC 4 +# endif +# ifndef PTRACE_EVENT_VFORK_DONE +# define PTRACE_EVENT_VFORK_DONE 5 +# endif +# ifndef PTRACE_EVENT_EXIT +# define PTRACE_EVENT_EXIT 6 +# endif +# ifndef PTRACE_EVENT_SECCOMP +# define PTRACE_EVENT_SECCOMP 7 +# endif +# ifdef PTRACE_EVENT_STOP /* Linux 3.1 - 3.3 releases had a broken value. It was fixed in 3.4. */ -# if PTRACE_EVENT_STOP == 7 -# undef PTRACE_EVENT_STOP +# if PTRACE_EVENT_STOP == 7 +# undef PTRACE_EVENT_STOP +# endif +# endif +# ifndef PTRACE_EVENT_STOP +# define PTRACE_EVENT_STOP 128 # endif -#endif -#ifndef PTRACE_EVENT_STOP -# define PTRACE_EVENT_STOP 128 -#endif -#ifndef PTRACE_O_TRACESYSGOOD -# define PTRACE_O_TRACESYSGOOD 1 -#endif -#ifndef PTRACE_O_TRACEFORK -# define PTRACE_O_TRACEFORK (1 << PTRACE_EVENT_FORK) -#endif -#ifndef PTRACE_O_TRACEVFORK -# define PTRACE_O_TRACEVFORK (1 << PTRACE_EVENT_VFORK) -#endif -#ifndef PTRACE_O_TRACECLONE -# define PTRACE_O_TRACECLONE (1 << PTRACE_EVENT_CLONE) -#endif -#ifndef PTRACE_O_TRACEEXEC -# define PTRACE_O_TRACEEXEC (1 << PTRACE_EVENT_EXEC) -#endif -#ifndef PTRACE_O_TRACEVFORKDONE -# define PTRACE_O_TRACEVFORKDONE (1 << PTRACE_EVENT_VFORK_DONE) -#endif -#ifndef PTRACE_O_TRACEEXIT -# define PTRACE_O_TRACEEXIT (1 << PTRACE_EVENT_EXIT) -#endif -#ifndef PTRACE_O_TRACESECCOMP -# define PTRACE_O_TRACESECCOMP (1 << PTRACE_EVENT_SECCOMP) -#endif -#ifndef PTRACE_O_EXITKILL -# define PTRACE_O_EXITKILL (1 << 20) -#endif -#ifndef PTRACE_O_SUSPEND_SECCOMP -# define PTRACE_O_SUSPEND_SECCOMP (1 << 21) -#endif +# ifndef PTRACE_O_TRACESYSGOOD +# define PTRACE_O_TRACESYSGOOD 1 +# endif +# ifndef PTRACE_O_TRACEFORK +# define PTRACE_O_TRACEFORK (1 << PTRACE_EVENT_FORK) +# endif +# ifndef PTRACE_O_TRACEVFORK +# define PTRACE_O_TRACEVFORK (1 << PTRACE_EVENT_VFORK) +# endif +# ifndef PTRACE_O_TRACECLONE +# define PTRACE_O_TRACECLONE (1 << PTRACE_EVENT_CLONE) +# endif +# ifndef PTRACE_O_TRACEEXEC +# define PTRACE_O_TRACEEXEC (1 << PTRACE_EVENT_EXEC) +# endif +# ifndef PTRACE_O_TRACEVFORKDONE +# define PTRACE_O_TRACEVFORKDONE (1 << PTRACE_EVENT_VFORK_DONE) +# endif +# ifndef PTRACE_O_TRACEEXIT +# define PTRACE_O_TRACEEXIT (1 << PTRACE_EVENT_EXIT) +# endif +# ifndef PTRACE_O_TRACESECCOMP +# define PTRACE_O_TRACESECCOMP (1 << PTRACE_EVENT_SECCOMP) +# endif +# ifndef PTRACE_O_EXITKILL +# define PTRACE_O_EXITKILL (1 << 20) +# endif +# ifndef PTRACE_O_SUSPEND_SECCOMP +# define PTRACE_O_SUSPEND_SECCOMP (1 << 21) +# endif -#ifndef PTRACE_SETOPTIONS -# define PTRACE_SETOPTIONS 0x4200 -#endif -#ifndef PTRACE_GETEVENTMSG -# define PTRACE_GETEVENTMSG 0x4201 -#endif -#ifndef PTRACE_GETSIGINFO -# define PTRACE_GETSIGINFO 0x4202 -#endif -#ifndef PTRACE_SETSIGINFO -# define PTRACE_SETSIGINFO 0x4203 -#endif -#ifndef PTRACE_GETREGSET -# define PTRACE_GETREGSET 0x4204 -#endif -#ifndef PTRACE_SETREGSET -# define PTRACE_SETREGSET 0x4205 -#endif -#ifndef PTRACE_SEIZE -# define PTRACE_SEIZE 0x4206 -#endif -#ifndef PTRACE_INTERRUPT -# define PTRACE_INTERRUPT 0x4207 -#endif -#ifndef PTRACE_LISTEN -# define PTRACE_LISTEN 0x4208 -#endif -#ifndef PTRACE_PEEKSIGINFO -# define PTRACE_PEEKSIGINFO 0x4209 -#endif -#ifndef PTRACE_GETSIGMASK -# define PTRACE_GETSIGMASK 0x420a -#endif -#ifndef PTRACE_SETSIGMASK -# define PTRACE_SETSIGMASK 0x420b -#endif -#ifndef PTRACE_SECCOMP_GET_FILTER -# define PTRACE_SECCOMP_GET_FILTER 0x420c -#endif +# ifndef PTRACE_SETOPTIONS +# define PTRACE_SETOPTIONS 0x4200 +# endif +# ifndef PTRACE_GETEVENTMSG +# define PTRACE_GETEVENTMSG 0x4201 +# endif +# ifndef PTRACE_GETSIGINFO +# define PTRACE_GETSIGINFO 0x4202 +# endif +# ifndef PTRACE_SETSIGINFO +# define PTRACE_SETSIGINFO 0x4203 +# endif +# ifndef PTRACE_GETREGSET +# define PTRACE_GETREGSET 0x4204 +# endif +# ifndef PTRACE_SETREGSET +# define PTRACE_SETREGSET 0x4205 +# endif +# ifndef PTRACE_SEIZE +# define PTRACE_SEIZE 0x4206 +# endif +# ifndef PTRACE_INTERRUPT +# define PTRACE_INTERRUPT 0x4207 +# endif +# ifndef PTRACE_LISTEN +# define PTRACE_LISTEN 0x4208 +# endif +# ifndef PTRACE_PEEKSIGINFO +# define PTRACE_PEEKSIGINFO 0x4209 +# endif +# ifndef PTRACE_GETSIGMASK +# define PTRACE_GETSIGMASK 0x420a +# endif +# ifndef PTRACE_SETSIGMASK +# define PTRACE_SETSIGMASK 0x420b +# endif +# ifndef PTRACE_SECCOMP_GET_FILTER +# define PTRACE_SECCOMP_GET_FILTER 0x420c +# endif +# ifndef PTRACE_SECCOMP_GET_METADATA +# define PTRACE_SECCOMP_GET_METADATA 0x420d +# endif +# ifndef PTRACE_GET_SYSCALL_INFO +# define PTRACE_GET_SYSCALL_INFO 0x420e +# define PTRACE_SYSCALL_INFO_NONE 0 +# define PTRACE_SYSCALL_INFO_ENTRY 1 +# define PTRACE_SYSCALL_INFO_EXIT 2 +# define PTRACE_SYSCALL_INFO_SECCOMP 3 +struct ptrace_syscall_info { + uint8_t op; + uint8_t pad[3]; + uint32_t arch; + uint64_t instruction_pointer; + uint64_t stack_pointer; + union { + struct { + uint64_t nr; + uint64_t args[6]; + } entry; + struct { + int64_t rval; + uint8_t is_error; + } exit; + struct { + uint64_t nr; + uint64_t args[6]; + uint32_t ret_data; + } seccomp; + }; +}; +# endif -#if !HAVE_DECL_PTRACE_PEEKUSER -# define PTRACE_PEEKUSER PTRACE_PEEKUSR -#endif -#if !HAVE_DECL_PTRACE_POKEUSER -# define PTRACE_POKEUSER PTRACE_POKEUSR -#endif +# if !HAVE_DECL_PTRACE_PEEKUSER +# define PTRACE_PEEKUSER PTRACE_PEEKUSR +# endif +# if !HAVE_DECL_PTRACE_POKEUSER +# define PTRACE_POKEUSER PTRACE_POKEUSR +# endif #endif /* !STRACE_PTRACE_H */ diff --git a/ptrace_syscall_info.c b/ptrace_syscall_info.c new file mode 100644 index 00000000..8ded55ad --- /dev/null +++ b/ptrace_syscall_info.c @@ -0,0 +1,345 @@ +/* + * Copyright (c) 2018 Dmitry V. Levin + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "kill_save_errno.h" +#include "print_fields.h" +#include "ptrace.h" +#include "ptrace_syscall_info.h" +#include "scno.h" + +#include +#include + +#include "xlat/ptrace_syscall_info_op.h" + +bool ptrace_get_syscall_info_supported; + +static int +kill_tracee(pid_t pid) +{ + return kill_save_errno(pid, SIGKILL); +} + +#define FAIL do { ptrace_stop = -1U; goto done; } while (0) + +static const unsigned int expected_none_size = + offsetof(struct ptrace_syscall_info, entry); +static const unsigned int expected_entry_size = + offsetofend(struct ptrace_syscall_info, entry.args); +static const unsigned int expected_exit_size = + offsetofend(struct ptrace_syscall_info, exit.is_error); +static const unsigned int expected_seccomp_size = + offsetofend(struct ptrace_syscall_info, seccomp.ret_data); + +/* + * Test that PTRACE_GET_SYSCALL_INFO API is supported by the kernel, and + * that the semantics implemented in the kernel matches our expectations. + */ +bool +test_ptrace_get_syscall_info(void) +{ + /* + * NOMMU provides no forks necessary for PTRACE_GET_SYSCALL_INFO test, + * leave the default unchanged. + */ +#ifdef HAVE_FORK + static const unsigned long args[][7] = { + /* a sequence of architecture-agnostic syscalls */ + { + __NR_chdir, + (unsigned long) "", + 0xbad1fed1, + 0xbad2fed2, + 0xbad3fed3, + 0xbad4fed4, + 0xbad5fed5 + }, + { + __NR_gettid, + 0xcaf0bea0, + 0xcaf1bea1, + 0xcaf2bea2, + 0xcaf3bea3, + 0xcaf4bea4, + 0xcaf5bea5 + }, + { + __NR_exit_group, + 0, + 0xfac1c0d1, + 0xfac2c0d2, + 0xfac3c0d3, + 0xfac4c0d4, + 0xfac5c0d5 + } + }; + const unsigned long *exp_args; + + int pid = fork(); + if (pid < 0) + perror_func_msg_and_die("fork"); + + if (pid == 0) { + /* get the pid before PTRACE_TRACEME */ + pid = getpid(); + if (ptrace(PTRACE_TRACEME, 0L, 0L, 0L) < 0) { + /* exit with a nonzero exit status */ + perror_func_msg_and_die("PTRACE_TRACEME"); + } + kill(pid, SIGSTOP); + for (unsigned int i = 0; i < ARRAY_SIZE(args); ++i) { + syscall(args[i][0], + args[i][1], args[i][2], args[i][3], + args[i][4], args[i][5], args[i][6]); + } + /* unreachable */ + _exit(1); + } + + const struct { + unsigned int is_error; + int rval; + } *exp_param, exit_param[] = { + { 1, -ENOENT }, /* chdir */ + { 0, pid } /* gettid */ + }; + + unsigned int ptrace_stop; + + for (ptrace_stop = 0; ; ++ptrace_stop) { + struct ptrace_syscall_info info = { + .op = 0xff /* invalid PTRACE_SYSCALL_INFO_* op */ + }; + const size_t size = sizeof(info); + int status; + long rc = waitpid(pid, &status, 0); + if (rc != pid) { + /* cannot happen */ + kill_tracee(pid); + perror_func_msg_and_die("#%d: unexpected wait result" + " %ld", ptrace_stop, rc); + } + if (WIFEXITED(status)) { + /* tracee is no more */ + pid = 0; + if (WEXITSTATUS(status) == 0) + break; + debug_func_msg("#%d: unexpected exit status %u", + ptrace_stop, WEXITSTATUS(status)); + FAIL; + } + if (WIFSIGNALED(status)) { + /* tracee is no more */ + pid = 0; + debug_func_msg("#%d: unexpected signal %u", + ptrace_stop, WTERMSIG(status)); + FAIL; + } + if (!WIFSTOPPED(status)) { + /* cannot happen */ + kill_tracee(pid); + error_func_msg_and_die("#%d: unexpected wait status" + " %#x", ptrace_stop, status); + } + + switch (WSTOPSIG(status)) { + case SIGSTOP: + if (ptrace_stop) { + debug_func_msg("#%d: unexpected signal stop", + ptrace_stop); + FAIL; + } + if (ptrace(PTRACE_SETOPTIONS, pid, 0L, + PTRACE_O_TRACESYSGOOD) < 0) { + /* cannot happen */ + kill_tracee(pid); + perror_func_msg_and_die("PTRACE_SETOPTIONS"); + } + rc = ptrace(PTRACE_GET_SYSCALL_INFO, pid, + (void *) size, &info); + if (rc < 0) { + debug_perror_msg("PTRACE_GET_SYSCALL_INFO"); + FAIL; + } + if (rc < (long) expected_none_size + || info.op != PTRACE_SYSCALL_INFO_NONE + || !info.arch + || !info.instruction_pointer + || !info.stack_pointer) { + debug_func_msg("signal stop mismatch"); + FAIL; + } + break; + + case SIGTRAP | 0x80: + rc = ptrace(PTRACE_GET_SYSCALL_INFO, pid, + (void *) size, &info); + if (rc < 0) { + debug_perror_msg("#%d: PTRACE_GET_SYSCALL_INFO", + ptrace_stop); + FAIL; + } + switch (ptrace_stop) { + case 1: /* entering chdir */ + case 3: /* entering gettid */ + case 5: /* entering exit_group */ + exp_args = args[ptrace_stop / 2]; + if (rc < (long) expected_entry_size + || info.op != PTRACE_SYSCALL_INFO_ENTRY + || !info.arch + || !info.instruction_pointer + || !info.stack_pointer + || (info.entry.nr != exp_args[0]) + || (info.entry.args[0] != exp_args[1]) + || (info.entry.args[1] != exp_args[2]) + || (info.entry.args[2] != exp_args[3]) + || (info.entry.args[3] != exp_args[4]) + || (info.entry.args[4] != exp_args[5]) + || (info.entry.args[5] != exp_args[6])) { + debug_func_msg("#%d: entry stop" + " mismatch", + ptrace_stop); + FAIL; + } + break; + case 2: /* exiting chdir */ + case 4: /* exiting gettid */ + exp_param = &exit_param[ptrace_stop / 2 - 1]; + if (rc < (long) expected_exit_size + || info.op != PTRACE_SYSCALL_INFO_EXIT + || !info.arch + || !info.instruction_pointer + || !info.stack_pointer + || info.exit.is_error != exp_param->is_error + || info.exit.rval != exp_param->rval) { + debug_func_msg("#%d: exit stop" + " mismatch", + ptrace_stop); + FAIL; + } + break; + default: + debug_func_msg("#%d: unexpected syscall stop", + ptrace_stop); + FAIL; + } + break; + + default: + debug_func_msg("#%d: unexpected stop signal %#x", + ptrace_stop, WSTOPSIG(status)); + FAIL; + } + + if (ptrace(PTRACE_SYSCALL, pid, 0L, 0L) < 0) { + /* cannot happen */ + kill_tracee(pid); + perror_func_msg_and_die("PTRACE_SYSCALL"); + } + } + +done: + if (pid) { + kill_tracee(pid); + waitpid(pid, NULL, 0); + ptrace_stop = -1U; + } + + ptrace_get_syscall_info_supported = + ptrace_stop == ARRAY_SIZE(args) * 2; + + if (ptrace_get_syscall_info_supported) + debug_msg("PTRACE_GET_SYSCALL_INFO works"); + else + debug_msg("PTRACE_GET_SYSCALL_INFO does not work"); +#endif /* HAVE_FORK */ + + return ptrace_get_syscall_info_supported; +} + +void +print_ptrace_syscall_info(struct tcb *tcp, kernel_ulong_t addr, + kernel_ulong_t user_len) +{ + struct ptrace_syscall_info info; + kernel_ulong_t kernel_len = tcp->u_rval; + kernel_ulong_t ret_len = MIN(user_len, kernel_len); + kernel_ulong_t fetch_size = MIN(ret_len, expected_seccomp_size); + + if (!fetch_size || !tfetch_mem(tcp, addr, fetch_size, &info)) { + printaddr(addr); + return; + } + + PRINT_FIELD_XVAL_INDEX("{", info, op, ptrace_syscall_info_op, + "PTRACE_SYSCALL_INFO_???"); + if (fetch_size < offsetofend(struct ptrace_syscall_info, arch)) + goto printed; + PRINT_FIELD_XVAL(", ", info, arch, audit_arch, "AUDIT_ARCH_???"); + + if (fetch_size < offsetofend(struct ptrace_syscall_info, + instruction_pointer)) + goto printed; + PRINT_FIELD_ADDR64(", ", info, instruction_pointer); + + if (fetch_size < offsetofend(struct ptrace_syscall_info, stack_pointer)) + goto printed; + PRINT_FIELD_ADDR64(", ", info, stack_pointer); + + if (fetch_size < offsetofend(struct ptrace_syscall_info, entry.nr)) + goto printed; + + switch(info.op) { + case PTRACE_SYSCALL_INFO_ENTRY: + case PTRACE_SYSCALL_INFO_SECCOMP: + PRINT_FIELD_U((info.op == PTRACE_SYSCALL_INFO_ENTRY + ? ", entry={" : ", seccomp={"), + info.entry, nr); + for (unsigned int i = 0; + i < ARRAY_SIZE(info.entry.args); ++i) { + const unsigned int i_size = + offsetofend(struct ptrace_syscall_info, + entry.args[i]); + if (fetch_size < i_size) { + if (i) + break; + goto entry_printed; + } + tprintf(", %s%#" PRIx64, + (i ? "" : "arg=["), + (uint64_t) info.entry.args[i]); + } + tprints("]"); + if (info.op == PTRACE_SYSCALL_INFO_SECCOMP + && fetch_size >= expected_seccomp_size) + PRINT_FIELD_U(", ", info.seccomp, ret_data); +entry_printed: + tprints("}"); + break; + case PTRACE_SYSCALL_INFO_EXIT: + tprints(", exit={"); + if (fetch_size >= expected_exit_size + && info.exit.is_error) { + uint64_t err = -info.exit.rval; + + tprints("rval=-"); + print_xlat_ex(err, err_name(err), + XLAT_STYLE_FMT_U); + } else { + PRINT_FIELD_D("", info.exit, rval); + } + if (fetch_size >= expected_exit_size) + PRINT_FIELD_U(", ", info.exit, is_error); + tprints("}"); + break; + } + +printed: + tprints("}"); +} diff --git a/ptrace_syscall_info.h b/ptrace_syscall_info.h new file mode 100644 index 00000000..b70e5c6d --- /dev/null +++ b/ptrace_syscall_info.h @@ -0,0 +1,16 @@ +/* + * Copyright (c) 2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_PTRACE_SYSCALL_INFO_H +# define STRACE_PTRACE_SYSCALL_INFO_H + +extern bool ptrace_get_syscall_info_supported; +extern bool test_ptrace_get_syscall_info(void); +extern void print_ptrace_syscall_info(struct tcb *, kernel_ulong_t addr, + kernel_ulong_t len); + +#endif /* !STRACE_PTRACE_SYSCALL_INFO_H */ diff --git a/qualify.c b/qualify.c deleted file mode 100644 index bb4aefe3..00000000 --- a/qualify.c +++ /dev/null @@ -1,640 +0,0 @@ -/* - * Copyright (c) 2016 Dmitry V. Levin - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (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 "nsig.h" - -typedef unsigned int number_slot_t; -#define BITS_PER_SLOT (sizeof(number_slot_t) * 8) - -struct number_set { - number_slot_t *vec; - unsigned int nslots; - bool not; -}; - -struct number_set read_set; -struct number_set write_set; -struct number_set signal_set; - -static struct number_set abbrev_set[SUPPORTED_PERSONALITIES]; -static struct number_set inject_set[SUPPORTED_PERSONALITIES]; -static struct number_set raw_set[SUPPORTED_PERSONALITIES]; -static struct number_set trace_set[SUPPORTED_PERSONALITIES]; -static struct number_set verbose_set[SUPPORTED_PERSONALITIES]; - -static void -number_setbit(const unsigned int i, number_slot_t *const vec) -{ - vec[i / BITS_PER_SLOT] |= (number_slot_t) 1 << (i % BITS_PER_SLOT); -} - -static bool -number_isset(const unsigned int i, const number_slot_t *const vec) -{ - return vec[i / BITS_PER_SLOT] & ((number_slot_t) 1 << (i % BITS_PER_SLOT)); -} - -static void -reallocate_number_set(struct number_set *const set, const unsigned int new_nslots) -{ - if (new_nslots <= set->nslots) - return; - set->vec = xreallocarray(set->vec, new_nslots, sizeof(*set->vec)); - memset(set->vec + set->nslots, 0, - sizeof(*set->vec) * (new_nslots - set->nslots)); - set->nslots = new_nslots; -} - -static void -add_number_to_set(const unsigned int number, struct number_set *const set) -{ - reallocate_number_set(set, number / BITS_PER_SLOT + 1); - number_setbit(number, set->vec); -} - -bool -is_number_in_set(const unsigned int number, const struct number_set *const set) -{ - return ((number / BITS_PER_SLOT < set->nslots) - && number_isset(number, set->vec)) ^ set->not; -} - -typedef int (*string_to_uint_func)(const char *); - -/* - * Add numbers to SET according to STR specification. - */ -static void -qualify_tokens(const char *const str, struct number_set *const set, - string_to_uint_func func, const char *const name) -{ - /* Clear the set. */ - if (set->nslots) - memset(set->vec, 0, sizeof(*set->vec) * set->nslots); - set->not = false; - - /* - * Each leading ! character means inversion - * of the remaining specification. - */ - const char *s = str; -handle_inversion: - while (*s == '!') { - set->not = !set->not; - ++s; - } - - if (strcmp(s, "none") == 0) { - /* - * No numbers are added to the set. - * Subsequent is_number_in_set invocations will return set->not. - */ - return; - } else if (strcmp(s, "all") == 0) { - s = "!none"; - goto handle_inversion; - } - - /* - * Split the string into comma separated tokens. - * For each token, find out the corresponding number - * by calling FUNC, and add that number to the set. - * The absence of tokens or a negative answer - * from FUNC is a fatal error. - */ - char *copy = xstrdup(s); - char *saveptr = NULL; - const char *token; - int number = -1; - - for (token = strtok_r(copy, ",", &saveptr); token; - token = strtok_r(NULL, ",", &saveptr)) { - number = func(token); - if (number < 0) { - error_msg_and_die("invalid %s '%s'", name, token); - } - - add_number_to_set(number, set); - } - - free(copy); - - if (number < 0) { - error_msg_and_die("invalid %s '%s'", name, str); - } -} - -static int -sigstr_to_uint(const char *s) -{ - int i; - - if (*s >= '0' && *s <= '9') - return string_to_uint_upto(s, 255); - - if (strncasecmp(s, "SIG", 3) == 0) - s += 3; - - for (i = 0; i <= 255; ++i) { - const char *name = signame(i); - - if (strncasecmp(name, "SIG", 3) != 0) - continue; - - name += 3; - - if (strcasecmp(name, s) != 0) - continue; - - return i; - } - - return -1; -} - -static bool -qualify_syscall_number(const char *s, struct number_set *set) -{ - int n = string_to_uint(s); - if (n < 0) - return false; - - unsigned int p; - bool done = false; - - for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) { - if ((unsigned) n >= nsyscall_vec[p]) { - continue; - } - add_number_to_set(n, &set[p]); - done = true; - } - - return done; -} - -static unsigned int -lookup_class(const char *s) -{ - static const struct { - const char *name; - unsigned int value; - } syscall_class[] = { - { "desc", TRACE_DESC }, - { "file", TRACE_FILE }, - { "memory", TRACE_MEMORY }, - { "process", TRACE_PROCESS }, - { "signal", TRACE_SIGNAL }, - { "ipc", TRACE_IPC }, - { "network", TRACE_NETWORK }, - }; - - unsigned int i; - for (i = 0; i < ARRAY_SIZE(syscall_class); ++i) { - if (strcmp(s, syscall_class[i].name) == 0) { - return syscall_class[i].value; - } - } - - return 0; -} - -static bool -qualify_syscall_class(const char *s, struct number_set *set) -{ - const unsigned int n = lookup_class(s); - if (!n) - return false; - - unsigned int p; - for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) { - unsigned int i; - - for (i = 0; i < nsyscall_vec[p]; ++i) { - if (!sysent_vec[p][i].sys_name - || (sysent_vec[p][i].sys_flags & n) != n) { - continue; - } - add_number_to_set(i, &set[p]); - } - } - - return true; -} - -static bool -qualify_syscall_name(const char *s, struct number_set *set) -{ - unsigned int p; - bool found = false; - - for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) { - unsigned int i; - - for (i = 0; i < nsyscall_vec[p]; ++i) { - if (!sysent_vec[p][i].sys_name - || strcmp(s, sysent_vec[p][i].sys_name)) { - continue; - } - add_number_to_set(i, &set[p]); - found = true; - } - } - - return found; -} - -static bool -qualify_syscall(const char *token, struct number_set *set) -{ - if (*token >= '0' && *token <= '9') - return qualify_syscall_number(token, set); - return qualify_syscall_class(token, set) - || qualify_syscall_name(token, set); -} - -/* - * Add syscall numbers to SETs for each supported personality - * according to STR specification. - */ -static void -qualify_syscall_tokens(const char *const str, struct number_set *const set, - const char *const name) -{ - /* Clear all sets. */ - unsigned int p; - for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) { - if (set[p].nslots) - memset(set[p].vec, 0, - sizeof(*set[p].vec) * set[p].nslots); - set[p].not = false; - } - - /* - * Each leading ! character means inversion - * of the remaining specification. - */ - const char *s = str; -handle_inversion: - while (*s == '!') { - for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) { - set[p].not = !set[p].not; - } - ++s; - } - - if (strcmp(s, "none") == 0) { - /* - * No syscall numbers are added to sets. - * Subsequent is_number_in_set invocations - * will return set[p]->not. - */ - return; - } else if (strcmp(s, "all") == 0) { - s = "!none"; - goto handle_inversion; - } - - /* - * Split the string into comma separated tokens. - * For each token, call qualify_syscall that will take care - * if adding appropriate syscall numbers to sets. - * The absence of tokens or a negative return code - * from qualify_syscall is a fatal error. - */ - char *copy = xstrdup(s); - char *saveptr = NULL; - const char *token; - bool done = false; - - for (token = strtok_r(copy, ",", &saveptr); token; - token = strtok_r(NULL, ",", &saveptr)) { - done = qualify_syscall(token, set); - if (!done) { - error_msg_and_die("invalid %s '%s'", name, token); - } - } - - free(copy); - - if (!done) { - error_msg_and_die("invalid %s '%s'", name, str); - } -} - -/* - * Returns NULL if STR does not start with PREFIX, - * or a pointer to the first char in STR after PREFIX. - */ -static const char * -strip_prefix(const char *prefix, const char *str) -{ - size_t len = strlen(prefix); - - return strncmp(prefix, str, len) ? NULL : str + len; -} - -static int -find_errno_by_name(const char *name) -{ - unsigned int i; - - for (i = 1; i < nerrnos; ++i) { - if (errnoent[i] && (strcasecmp(name, errnoent[i]) == 0)) - return i; - } - - return -1; -} - -static bool -parse_inject_token(const char *const token, struct inject_opts *const fopts, - const bool fault_tokens_only) -{ - const char *val; - int intval; - - if ((val = strip_prefix("when=", token))) { - /* - * == 1+1 - * F == F+0 - * F+ == F+1 - * F+S - */ - char *end; - intval = string_to_uint_ex(val, &end, 0xffff, "+"); - if (intval < 1) - return false; - - fopts->first = intval; - - if (*end) { - val = end + 1; - if (*val) { - /* F+S */ - intval = string_to_uint_upto(val, 0xffff); - if (intval < 1) - return false; - fopts->step = intval; - } else { - /* F+ == F+1 */ - fopts->step = 1; - } - } else { - /* F == F+0 */ - fopts->step = 0; - } - } else if ((val = strip_prefix("error=", token))) { - if (fopts->rval != INJECT_OPTS_RVAL_DEFAULT) - return false; - intval = string_to_uint_upto(val, MAX_ERRNO_VALUE); - if (intval < 0) - intval = find_errno_by_name(val); - if (intval < 1) - return false; - fopts->rval = -intval; - } else if (!fault_tokens_only && (val = strip_prefix("retval=", token))) { - if (fopts->rval != INJECT_OPTS_RVAL_DEFAULT) - return false; - intval = string_to_uint(val); - if (intval < 0) - return false; - fopts->rval = intval; - } else if (!fault_tokens_only && (val = strip_prefix("signal=", token))) { - intval = sigstr_to_uint(val); - if (intval < 1 || intval > NSIG_BYTES * 8) - return false; - fopts->signo = intval; - } else { - return false; - } - - return true; -} - -static char * -parse_inject_expression(const char *const s, char **buf, - struct inject_opts *const fopts, - const bool fault_tokens_only) -{ - char *saveptr = NULL; - char *name = NULL; - char *token; - - *buf = xstrdup(s); - for (token = strtok_r(*buf, ":", &saveptr); token; - token = strtok_r(NULL, ":", &saveptr)) { - if (!name) - name = token; - else if (!parse_inject_token(token, fopts, fault_tokens_only)) - goto parse_error; - } - - if (name) - return name; - -parse_error: - free(*buf); - return *buf = NULL; -} - -static void -qualify_read(const char *const str) -{ - qualify_tokens(str, &read_set, string_to_uint, "descriptor"); -} - -static void -qualify_write(const char *const str) -{ - qualify_tokens(str, &write_set, string_to_uint, "descriptor"); -} - -static void -qualify_signals(const char *const str) -{ - qualify_tokens(str, &signal_set, sigstr_to_uint, "signal"); -} - -static void -qualify_trace(const char *const str) -{ - qualify_syscall_tokens(str, trace_set, "system call"); -} - -static void -qualify_abbrev(const char *const str) -{ - qualify_syscall_tokens(str, abbrev_set, "system call"); -} - -static void -qualify_verbose(const char *const str) -{ - qualify_syscall_tokens(str, verbose_set, "system call"); -} - -static void -qualify_raw(const char *const str) -{ - qualify_syscall_tokens(str, raw_set, "system call"); -} - -static void -qualify_inject_common(const char *const str, - const bool fault_tokens_only, - const char *const description) -{ - struct inject_opts opts = { - .first = 1, - .step = 1, - .rval = INJECT_OPTS_RVAL_DEFAULT, - .signo = 0 - }; - char *buf = NULL; - char *name = parse_inject_expression(str, &buf, &opts, fault_tokens_only); - if (!name) { - error_msg_and_die("invalid %s '%s'", description, str); - } - - /* If neither of retval, error, or signal is specified, then ... */ - if (opts.rval == INJECT_OPTS_RVAL_DEFAULT && !opts.signo) { - if (fault_tokens_only) { - /* in fault= syntax the default error code is ENOSYS. */ - opts.rval = -ENOSYS; - } else { - /* in inject= syntax this is not allowed. */ - error_msg_and_die("invalid %s '%s'", description, str); - } - } - - struct number_set tmp_set[SUPPORTED_PERSONALITIES]; - memset(tmp_set, 0, sizeof(tmp_set)); - qualify_syscall_tokens(name, tmp_set, description); - - free(buf); - - /* - * Initialize inject_vec accourding to tmp_set. - * Merge tmp_set into inject_set. - */ - unsigned int p; - for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) { - if (!tmp_set[p].nslots && !tmp_set[p].not) { - continue; - } - - if (!inject_vec[p]) { - inject_vec[p] = xcalloc(nsyscall_vec[p], - sizeof(*inject_vec[p])); - } - - unsigned int i; - for (i = 0; i < nsyscall_vec[p]; ++i) { - if (is_number_in_set(i, &tmp_set[p])) { - add_number_to_set(i, &inject_set[p]); - inject_vec[p][i] = opts; - } - } - - free(tmp_set[p].vec); - } -} - -static void -qualify_fault(const char *const str) -{ - qualify_inject_common(str, true, "fault argument"); -} - -static void -qualify_inject(const char *const str) -{ - qualify_inject_common(str, false, "inject argument"); -} - -static const struct qual_options { - const char *name; - void (*qualify)(const char *); -} qual_options[] = { - { "trace", qualify_trace }, - { "t", qualify_trace }, - { "abbrev", qualify_abbrev }, - { "a", qualify_abbrev }, - { "verbose", qualify_verbose }, - { "v", qualify_verbose }, - { "raw", qualify_raw }, - { "x", qualify_raw }, - { "signal", qualify_signals }, - { "signals", qualify_signals }, - { "s", qualify_signals }, - { "read", qualify_read }, - { "reads", qualify_read }, - { "r", qualify_read }, - { "write", qualify_write }, - { "writes", qualify_write }, - { "w", qualify_write }, - { "fault", qualify_fault }, - { "inject", qualify_inject }, -}; - -void -qualify(const char *str) -{ - const struct qual_options *opt = qual_options; - unsigned int i; - - for (i = 0; i < ARRAY_SIZE(qual_options); ++i) { - const char *p = qual_options[i].name; - unsigned int len = strlen(p); - - if (strncmp(str, p, len) || str[len] != '=') - continue; - - opt = &qual_options[i]; - str += len + 1; - break; - } - - opt->qualify(str); -} - -unsigned int -qual_flags(const unsigned int scno) -{ - return (is_number_in_set(scno, &trace_set[current_personality]) - ? QUAL_TRACE : 0) - | (is_number_in_set(scno, &abbrev_set[current_personality]) - ? QUAL_ABBREV : 0) - | (is_number_in_set(scno, &verbose_set[current_personality]) - ? QUAL_VERBOSE : 0) - | (is_number_in_set(scno, &raw_set[current_personality]) - ? QUAL_RAW : 0) - | (is_number_in_set(scno, &inject_set[current_personality]) - ? QUAL_INJECT : 0); -} diff --git a/quota.c b/quota.c index 19f391f7..e4073a21 100644 --- a/quota.c +++ b/quota.c @@ -4,32 +4,15 @@ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman * Copyright (c) 2005-2016 Dmitry V. Levin + * Copyright (c) 2006-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" +#include "print_fields.h" +#include "xfs_quota_stat.h" #define SUBCMDMASK 0x00ff #define SUBCMDSHIFT 8 @@ -55,8 +38,7 @@ * leads to problems when it is used on 32-bit tracee which does not have such * padding. */ -struct if_dqblk -{ +struct if_dqblk { uint64_t dqb_bhardlimit; uint64_t dqb_bsoftlimit; uint64_t dqb_curspace; @@ -81,10 +63,9 @@ struct if_nextdqblk { uint32_t dqb_id; }; -struct xfs_dqblk -{ +struct xfs_dqblk { int8_t d_version; /* version of this structure */ - int8_t d_flags; /* XFS_{USER,PROJ,GROUP}_QUOTA */ + uint8_t d_flags; /* XFS_{USER,PROJ,GROUP}_QUOTA */ uint16_t d_fieldmask; /* field specifier */ uint32_t d_id; /* user, project, or group ID */ uint64_t d_blk_hardlimit; /* absolute limit on disk blks */ @@ -107,36 +88,13 @@ struct xfs_dqblk char d_padding4[8]; /* yet more padding */ }; -struct if_dqinfo -{ +struct if_dqinfo { uint64_t dqi_bgrace; uint64_t dqi_igrace; uint32_t dqi_flags; uint32_t dqi_valid; }; -typedef struct fs_qfilestat -{ - uint64_t qfs_ino; /* inode number */ - uint64_t qfs_nblks; /* number of BBs 512-byte-blks */ - uint32_t qfs_nextents; /* number of extents */ -} fs_qfilestat_t; - -struct xfs_dqstats -{ - int8_t qs_version; /* version number for future changes */ - uint16_t qs_flags; /* XFS_QUOTA_{U,P,G}DQ_{ACCT,ENFD} */ - int8_t qs_pad; /* unused */ - fs_qfilestat_t qs_uquota; /* user quota storage information */ - fs_qfilestat_t qs_gquota; /* group quota storage information */ - uint32_t qs_incoredqs; /* number of dquots incore */ - int32_t qs_btimelimit; /* limit for blks timer */ - int32_t qs_itimelimit; /* limit for inodes timer */ - int32_t qs_rtbtimelimit; /* limit for rt blks timer */ - uint16_t qs_bwarnlimit; /* limit for num warnings */ - uint16_t qs_iwarnlimit; /* limit for num warnings */ -}; - struct fs_qfilestatv { uint64_t qfs_ino, qfs_nblks; uint32_t qfs_nextents, qfs_pad; @@ -158,18 +116,6 @@ struct fs_quota_statv { uint64_t qs_pad2[8]; }; -#define PRINT_FIELD_D(prefix, where, field) \ - tprintf("%s%s=%lld", (prefix), #field, \ - sign_extend_unsigned_to_ll((where).field)) - -#define PRINT_FIELD_U(prefix, where, field) \ - tprintf("%s%s=%llu", (prefix), #field, \ - zero_extend_signed_to_ull((where).field)) - -#define PRINT_FIELD_X(prefix, where, field) \ - tprintf("%s%s=%#llx", (prefix), #field, \ - zero_extend_signed_to_ull((where).field)) - static int decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, kernel_ulong_t data) { @@ -192,7 +138,7 @@ decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, kernel_ulong_t data) return 0; } - /* Fall-through */ + ATTRIBUTE_FALLTHROUGH; case Q_SETQUOTA: { struct if_dqblk dq; @@ -213,9 +159,8 @@ decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, kernel_ulong_t data) if (!abbrev(tcp)) { PRINT_FIELD_U(", ", dq, dqb_btime); PRINT_FIELD_U(", ", dq, dqb_itime); - tprints(", dqb_valid="); - printflags(if_dqblk_valid, - dq.dqb_valid, "QIF_???"); + PRINT_FIELD_FLAGS(", ", dq, dqb_valid, + if_dqblk_valid, "QIF_???"); } else { tprints(", ..."); } @@ -244,9 +189,8 @@ decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, kernel_ulong_t data) if (!abbrev(tcp)) { PRINT_FIELD_U(", ", dq, dqb_btime); PRINT_FIELD_U(", ", dq, dqb_itime); - tprints(", dqb_valid="); - printflags(if_dqblk_valid, - dq.dqb_valid, "QIF_???"); + PRINT_FIELD_FLAGS(", ", dq, dqb_valid, + if_dqblk_valid, "QIF_???"); PRINT_FIELD_U(", ", dq, dqb_id); } else { PRINT_FIELD_U(", ", dq, dqb_id); @@ -264,7 +208,7 @@ decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, kernel_ulong_t data) return 0; } - /* Fall-through */ + ATTRIBUTE_FALLTHROUGH; case Q_XSETQLIM: { struct xfs_dqblk dq; @@ -277,9 +221,8 @@ decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, kernel_ulong_t data) if (umove_or_printaddr(tcp, data, &dq)) break; PRINT_FIELD_D("{", dq, d_version); - tprints(", d_flags="); - printflags(xfs_dqblk_flags, - (uint8_t) dq.d_flags, "XFS_???_QUOTA"); + PRINT_FIELD_FLAGS(", ", dq, d_flags, + xfs_dqblk_flags, "XFS_???_QUOTA"); PRINT_FIELD_X(", ", dq, d_fieldmask); PRINT_FIELD_U(", ", dq, d_id); PRINT_FIELD_U(", ", dq, d_blk_hardlimit); @@ -328,7 +271,7 @@ decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, kernel_ulong_t data) return 0; } - /* Fall-through */ + ATTRIBUTE_FALLTHROUGH; case Q_SETINFO: { struct if_dqinfo dq; @@ -340,10 +283,8 @@ decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, kernel_ulong_t data) break; PRINT_FIELD_U("{", dq, dqi_bgrace); PRINT_FIELD_U(", ", dq, dqi_igrace); - tprints(", dqi_flags="); - printflags(if_dqinfo_flags, dq.dqi_flags, "DQF_???"); - tprints(", dqi_valid="); - printflags(if_dqinfo_valid, dq.dqi_valid, "IIF_???"); + PRINT_FIELD_FLAGS(", ", dq, dqi_flags, if_dqinfo_flags, "DQF_???"); + PRINT_FIELD_FLAGS(", ", dq, dqi_valid, if_dqinfo_valid, "IIF_???"); tprints("}"); break; } @@ -356,30 +297,28 @@ decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, kernel_ulong_t data) return 0; } - - if (umove_or_printaddr(tcp, data, &dq)) - break; - PRINT_FIELD_D("{", dq, qs_version); - if (!abbrev(tcp)) { - tprints(", qs_flags="); - printflags(xfs_quota_flags, - dq.qs_flags, "XFS_QUOTA_???"); - PRINT_FIELD_U(", ", dq, qs_incoredqs); - PRINT_FIELD_U(", qs_uquota={", dq.qs_uquota, qfs_ino); - PRINT_FIELD_U(", ", dq.qs_uquota, qfs_nblks); - PRINT_FIELD_U(", ", dq.qs_uquota, qfs_nextents); - PRINT_FIELD_U("}, qs_gquota={", dq.qs_gquota, qfs_ino); - PRINT_FIELD_U(", ", dq.qs_gquota, qfs_nblks); - PRINT_FIELD_U(", ", dq.qs_gquota, qfs_nextents); - PRINT_FIELD_D("}, ", dq, qs_btimelimit); - PRINT_FIELD_D(", ", dq, qs_itimelimit); - PRINT_FIELD_D(", ", dq, qs_rtbtimelimit); - PRINT_FIELD_U(", ", dq, qs_bwarnlimit); - PRINT_FIELD_U(", ", dq, qs_iwarnlimit); - } else { - tprints(", ..."); + if (fetch_struct_quotastat(tcp, data, &dq)) { + PRINT_FIELD_D("{", dq, qs_version); + if (!abbrev(tcp)) { + PRINT_FIELD_FLAGS(", ", dq, qs_flags, + xfs_quota_flags, "XFS_QUOTA_???"); + PRINT_FIELD_U(", qs_uquota={", dq.qs_uquota, qfs_ino); + PRINT_FIELD_U(", ", dq.qs_uquota, qfs_nblks); + PRINT_FIELD_U(", ", dq.qs_uquota, qfs_nextents); + PRINT_FIELD_U("}, qs_gquota={", dq.qs_gquota, qfs_ino); + PRINT_FIELD_U(", ", dq.qs_gquota, qfs_nblks); + PRINT_FIELD_U(", ", dq.qs_gquota, qfs_nextents); + PRINT_FIELD_U("}, ", dq, qs_incoredqs); + PRINT_FIELD_D(", ", dq, qs_btimelimit); + PRINT_FIELD_D(", ", dq, qs_itimelimit); + PRINT_FIELD_D(", ", dq, qs_rtbtimelimit); + PRINT_FIELD_U(", ", dq, qs_bwarnlimit); + PRINT_FIELD_U(", ", dq, qs_iwarnlimit); + } else { + tprints(", ..."); + } + tprints("}"); } - tprints("}"); break; } case Q_XGETQSTATV: @@ -396,9 +335,8 @@ decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, kernel_ulong_t data) break; PRINT_FIELD_D("{", dq, qs_version); if (!abbrev(tcp)) { - tprints(", qs_flags="); - printflags(xfs_quota_flags, - dq.qs_flags, "XFS_QUOTA_???"); + PRINT_FIELD_FLAGS(", ", dq, qs_flags, + xfs_quota_flags, "XFS_QUOTA_???"); PRINT_FIELD_U(", ", dq, qs_incoredqs); PRINT_FIELD_U(", qs_uquota={", dq.qs_uquota, qfs_ino); PRINT_FIELD_U(", ", dq.qs_uquota, qfs_nblks); @@ -456,6 +394,31 @@ decode_cmd_data(struct tcb *tcp, uint32_t id, uint32_t cmd, kernel_ulong_t data) return RVAL_DECODED; } +static void +print_qcmd(const uint32_t qcmd) +{ + const uint32_t cmd = QCMD_CMD(qcmd); + const uint32_t type = QCMD_TYPE(qcmd); + + if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) + tprintf("%u", qcmd); + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) + return; + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) + tprints(" /* "); + + tprints("QCMD("); + printxvals_ex(cmd, "Q_???", XLAT_STYLE_ABBREV, quotacmds, NULL); + tprints(", "); + printxvals_ex(type, "???QUOTA", XLAT_STYLE_ABBREV, quotatypes, NULL); + tprints(")"); + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) + tprints(" */"); +} + SYS_FUNC(quotactl) { /* @@ -466,15 +429,11 @@ SYS_FUNC(quotactl) */ uint32_t qcmd = tcp->u_arg[0]; uint32_t cmd = QCMD_CMD(qcmd); - uint32_t type = QCMD_TYPE(qcmd); uint32_t id = tcp->u_arg[2]; if (entering(tcp)) { - tprints("QCMD("); - printxval(quotacmds, cmd, "Q_???"); + print_qcmd(qcmd); tprints(", "); - printxval(quotatypes, type, "???QUOTA"); - tprints("), "); printpath(tcp, tcp->u_arg[1]); } return decode_cmd_data(tcp, id, cmd, tcp->u_arg[3]); diff --git a/random_ioctl.c b/random_ioctl.c new file mode 100644 index 00000000..36612b2f --- /dev/null +++ b/random_ioctl.c @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "print_fields.h" + +#include +#include + +#define XLAT_MACROS_ONLY +#include "xlat/random_ioctl_cmds.h" +#undef XLAT_MACROS_ONLY + +/* + * RNDGETPOOL was removed in 2.6.9, so non-ancient kernels always + * return -EINVAL for that. + */ + +int +random_ioctl(struct tcb *const tcp, const unsigned int code, + const kernel_ulong_t arg) +{ + struct rand_pool_info info; + kernel_ulong_t buf; + + switch (code) { + case RNDGETENTCNT: + if (entering(tcp)) + return 0; + ATTRIBUTE_FALLTHROUGH; + case RNDADDTOENTCNT: + tprints(", "); + printnum_int(tcp, arg, "%d"); + break; + + case RNDADDENTROPY: + tprints(", "); + if (!umove_or_printaddr(tcp, arg, &info)) { + PRINT_FIELD_D("{", info, entropy_count); + PRINT_FIELD_D(", ", info, buf_size); + tprints(", buf="); + buf = arg + offsetof(struct rand_pool_info, buf); + printstrn(tcp, buf, info.buf_size); + tprints("}"); + } + break; + + /* ioctls with no parameters */ + case RNDZAPENTCNT: + case RNDCLEARPOOL: + case RNDRESEEDCRNG: + break; + default: + return RVAL_DECODED; + } + return RVAL_IOCTL_DECODED; +} diff --git a/readahead.c b/readahead.c index d6caac33..92d170ae 100644 --- a/readahead.c +++ b/readahead.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" SYS_FUNC(readahead) diff --git a/readlink.c b/readlink.c index fd65b253..6a4920e4 100644 --- a/readlink.c +++ b/readlink.c @@ -6,29 +6,10 @@ * Copyright (c) 2006 Ulrich Drepper * Copyright (c) 2006 Bernhard Kaindl * Copyright (c) 2006-2015 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/reboot.c b/reboot.c index 381e4e89..e0fe65b1 100644 --- a/reboot.c +++ b/reboot.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" #include "xlat/bootflags1.h" @@ -10,14 +17,19 @@ SYS_FUNC(reboot) const unsigned int magic2 = tcp->u_arg[1]; const unsigned int cmd = tcp->u_arg[2]; - printflags(bootflags1, magic1, "LINUX_REBOOT_MAGIC_???"); + printxval(bootflags1, magic1, "LINUX_REBOOT_MAGIC_???"); tprints(", "); - printflags(bootflags2, magic2, "LINUX_REBOOT_MAGIC_???"); + printxval(bootflags2, magic2, "LINUX_REBOOT_MAGIC_???"); tprints(", "); - printflags(bootflags3, cmd, "LINUX_REBOOT_CMD_???"); + printxval(bootflags3, cmd, "LINUX_REBOOT_CMD_???"); if (cmd == LINUX_REBOOT_CMD_RESTART2) { tprints(", "); - printstr(tcp, tcp->u_arg[3]); + /* + * The size of kernel buffer is 256 bytes and + * the last byte is always zero, at most 255 bytes + * are copied from the user space. + */ + printstr_ex(tcp, tcp->u_arg[3], 255, QUOTE_0_TERMINATED); } return RVAL_DECODED; } diff --git a/regs.h b/regs.h index d89581d7..29d8a9ce 100644 --- a/regs.h +++ b/regs.h @@ -1,12 +1,14 @@ -#ifndef STRACE_REGS_H -#define STRACE_REGS_H - -#include +/* + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ -#ifdef HAVE_SYS_REG_H -# include -#endif +#ifndef STRACE_REGS_H +# define STRACE_REGS_H -#include "arch_regs.h" +# include +# include "arch_regs.h" #endif /* !STRACE_REGS_H */ diff --git a/renameat.c b/renameat.c index 746e9c4a..8f7118de 100644 --- a/renameat.c +++ b/renameat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" static void diff --git a/resource.c b/resource.c index 61c877e4..53192ee9 100644 --- a/resource.c +++ b/resource.c @@ -3,49 +3,40 @@ * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 1999-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" #include +#include "xstring.h" + #include "xlat/resources.h" -static const char * -sprint_rlim64(uint64_t lim) -{ - static char buf[sizeof(uint64_t)*3 + sizeof("*1024")]; +static void +print_rlim64_t(uint64_t lim) { + const char *str = NULL; if (lim == UINT64_MAX) - return "RLIM64_INFINITY"; + str = "RLIM64_INFINITY"; + else if (lim > 1024 && lim % 1024 == 0) { + static char buf[sizeof(lim) * 3 + sizeof("*1024")]; - if (lim > 1024 && lim % 1024 == 0) - sprintf(buf, "%" PRIu64 "*1024", lim / 1024); - else - sprintf(buf, "%" PRIu64, lim); - return buf; + xsprintf(buf, "%" PRIu64 "*1024", lim / 1024); + str = buf; + } + + if (!str || xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) + tprintf("%" PRIu64, lim); + + if (!str || xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) + return; + + (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE + ? tprints_comment : tprints)(str); } static void @@ -57,26 +48,37 @@ print_rlimit64(struct tcb *const tcp, const kernel_ulong_t addr) } rlim; if (!umove_or_printaddr(tcp, addr, &rlim)) { - tprintf("{rlim_cur=%s,", sprint_rlim64(rlim.rlim_cur)); - tprintf(" rlim_max=%s}", sprint_rlim64(rlim.rlim_max)); + tprints("{rlim_cur="); + print_rlim64_t(rlim.rlim_cur); + tprints(", rlim_max="); + print_rlim64_t(rlim.rlim_max); + tprints("}"); } } #if !defined(current_wordsize) || current_wordsize == 4 -static const char * -sprint_rlim32(uint32_t lim) -{ - static char buf[sizeof(uint32_t)*3 + sizeof("*1024")]; +static void +print_rlim32_t(uint32_t lim) { + const char *str = NULL; if (lim == UINT32_MAX) - return "RLIM_INFINITY"; + str = "RLIM_INFINITY"; + else if (lim > 1024 && lim % 1024 == 0) { + static char buf[sizeof(lim) * 3 + sizeof("*1024")]; - if (lim > 1024 && lim % 1024 == 0) - sprintf(buf, "%" PRIu32 "*1024", lim / 1024); - else - sprintf(buf, "%" PRIu32, lim); - return buf; + xsprintf(buf, "%" PRIu32 "*1024", lim / 1024); + str = buf; + } + + if (!str || xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) + tprintf("%" PRIu32, lim); + + if (!str || xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) + return; + + (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE + ? tprints_comment : tprints)(str); } static void @@ -88,8 +90,11 @@ print_rlimit32(struct tcb *const tcp, const kernel_ulong_t addr) } rlim; if (!umove_or_printaddr(tcp, addr, &rlim)) { - tprintf("{rlim_cur=%s,", sprint_rlim32(rlim.rlim_cur)); - tprintf(" rlim_max=%s}", sprint_rlim32(rlim.rlim_max)); + tprints("{rlim_cur="); + print_rlim32_t(rlim.rlim_cur); + tprints(", rlim_max="); + print_rlim32_t(rlim.rlim_max); + tprints("}"); } } @@ -119,8 +124,7 @@ SYS_FUNC(getrlimit) if (entering(tcp)) { printxval(resources, tcp->u_arg[0], "RLIMIT_???"); tprints(", "); - } - else { + } else { decode_rlimit(tcp, tcp->u_arg[1]); } return 0; @@ -156,8 +160,7 @@ SYS_FUNC(getrusage) if (entering(tcp)) { printxval(usagewho, tcp->u_arg[0], "RUSAGE_???"); tprints(", "); - } - else + } else printrusage(tcp, tcp->u_arg[1]); return 0; } @@ -168,8 +171,7 @@ SYS_FUNC(osf_getrusage) if (entering(tcp)) { printxval(usagewho, tcp->u_arg[0], "RUSAGE_???"); tprints(", "); - } - else + } else printrusage32(tcp, tcp->u_arg[1]); return 0; } diff --git a/retval.c b/retval.c new file mode 100644 index 00000000..4d5721c8 --- /dev/null +++ b/retval.c @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "retval.h" + +static kernel_long_t *retval_vec; +static size_t retval_vec_capacity; /* size of the arena */ +static size_t retval_vec_size; /* size of the used arena */ + +static void +expand_retval_vec(void) +{ + const size_t old_capacity = retval_vec_capacity; + retval_vec = xgrowarray(retval_vec, &retval_vec_capacity, + sizeof(*retval_vec)); + memset(retval_vec + old_capacity, 0, + (retval_vec_capacity - old_capacity) + * sizeof(*retval_vec)); +} + +uint16_t +retval_new(const kernel_long_t rval) +{ + const uint16_t idx = retval_vec_size; + + if (idx < retval_vec_size) + error_func_msg_and_die("retval index overflow"); + + if (retval_vec_size == retval_vec_capacity) + expand_retval_vec(); + + retval_vec[idx] = rval; + ++retval_vec_size; + + return idx; +} + +kernel_long_t +retval_get(const uint16_t rval_idx) +{ + if (rval_idx >= retval_vec_size) + error_func_msg_and_die("rval_idx >= retval_vec_size"); + + return retval_vec[rval_idx]; +} diff --git a/retval.h b/retval.h new file mode 100644 index 00000000..c7a187e3 --- /dev/null +++ b/retval.h @@ -0,0 +1,15 @@ +/* + * Copyright (c) 2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +/* retval to index and visa versa. */ +#ifndef STRACE_RETVAL_H +# define STRACE_RETVAL_H + +uint16_t retval_new(kernel_long_t rval); +kernel_long_t retval_get(uint16_t rval_idx); + +#endif /* !STRACE_RETVAL_H */ diff --git a/riscv.c b/riscv.c new file mode 100644 index 00000000..7f37281f --- /dev/null +++ b/riscv.c @@ -0,0 +1,33 @@ +/* + * RISC-V-specific syscall decoders. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#ifdef RISCV + +# include "xlat/riscv_flush_icache_flags.h" + +SYS_FUNC(riscv_flush_icache) +{ + /* uintptr_t start */ + printaddr(tcp->u_arg[0]); + + /* uintptr_t end */ + tprints(", "); + printaddr(tcp->u_arg[1]); + + /* uintptr_t flags */ + tprints(", "); + printflags64(riscv_flush_icache_flags, tcp->u_arg[2], + "SYS_RISCV_FLUSH_ICACHE_???"); + + return RVAL_DECODED; +} + +#endif /* RISCV */ diff --git a/rt_sigframe.c b/rt_sigframe.c new file mode 100644 index 00000000..32f47951 --- /dev/null +++ b/rt_sigframe.c @@ -0,0 +1,17 @@ +/* + * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "ptrace.h" +#include "regs.h" + +#define DEF_FUNC_GET_RT_SIGFRAME_ADDR \ + kernel_ulong_t get_rt_sigframe_addr(struct tcb *tcp) +#define FUNC_GET_RT_SIGFRAME_ADDR DEF_FUNC_GET_RT_SIGFRAME_ADDR + +#include "arch_rt_sigframe.c" diff --git a/rt_sigreturn.c b/rt_sigreturn.c new file mode 100644 index 00000000..d9009566 --- /dev/null +++ b/rt_sigreturn.c @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#include DEF_MPERS_TYPE(struct_rt_sigframe) + +#include "rt_sigframe.h" + +#include MPERS_DEFS + +#ifndef OFFSETOF_SIGMASK_IN_RT_SIGFRAME +# define OFFSETOF_SIGMASK_IN_RT_SIGFRAME \ + offsetof(struct_rt_sigframe, uc.uc_sigmask) +#endif + +SYS_FUNC(rt_sigreturn) +{ + const kernel_ulong_t sf_addr = get_rt_sigframe_addr(tcp); + + if (sf_addr) { + const kernel_ulong_t sm_addr = + sf_addr + OFFSETOF_SIGMASK_IN_RT_SIGFRAME; + tprints("{mask="); + print_sigset_addr(tcp, sm_addr); + tprints("}"); + } + + return RVAL_DECODED; +} diff --git a/rtc.c b/rtc.c index 43ea9466..dd292471 100644 --- a/rtc.c +++ b/rtc.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2004 Ulrich Drepper * Copyright (c) 2004-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -92,7 +73,7 @@ MPERS_PRINTER_DECL(int, rtc_ioctl, struct tcb *const tcp, case RTC_RD_TIME: if (entering(tcp)) return 0; - /* fall through */ + ATTRIBUTE_FALLTHROUGH; case RTC_ALM_SET: case RTC_SET_TIME: tprints(", "); @@ -112,7 +93,7 @@ MPERS_PRINTER_DECL(int, rtc_ioctl, struct tcb *const tcp, case RTC_WKALM_RD: if (entering(tcp)) return 0; - /* fall through */ + ATTRIBUTE_FALLTHROUGH; case RTC_WKALM_SET: tprints(", "); decode_rtc_wkalrm(tcp, arg); @@ -120,7 +101,7 @@ MPERS_PRINTER_DECL(int, rtc_ioctl, struct tcb *const tcp, case RTC_PLL_GET: if (entering(tcp)) return 0; - /* fall through */ + ATTRIBUTE_FALLTHROUGH; case RTC_PLL_SET: tprints(", "); decode_rtc_pll_info(tcp, arg); @@ -150,5 +131,5 @@ MPERS_PRINTER_DECL(int, rtc_ioctl, struct tcb *const tcp, return RVAL_DECODED; } - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } diff --git a/rtnl_addr.c b/rtnl_addr.c new file mode 100644 index 00000000..88ef39c1 --- /dev/null +++ b/rtnl_addr.c @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "netlink_route.h" +#include "nlattr.h" +#include "print_fields.h" + +#include "netlink.h" +#include +#ifdef HAVE_LINUX_IF_ADDR_H +# include +#endif + +#include "xlat/ifaddrflags.h" +#include "xlat/routing_scopes.h" +#include "xlat/rtnl_addr_attrs.h" + +static bool +decode_ifa_address(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + const struct ifaddrmsg *const ifaddr = opaque_data; + + decode_inet_addr(tcp, addr, len, ifaddr->ifa_family, NULL); + + return true; +} + +static bool +decode_ifa_cacheinfo(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct ifa_cacheinfo ci; + + if (len < sizeof(ci)) + return false; + else if (!umove_or_printaddr(tcp, addr, &ci)) { + PRINT_FIELD_U("{", ci, ifa_prefered); + PRINT_FIELD_U(", ", ci, ifa_valid); + PRINT_FIELD_U(", ", ci, cstamp); + PRINT_FIELD_U(", ", ci, tstamp); + tprintf("}"); + } + + return true; +} + +static bool +decode_ifa_flags(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + uint32_t ifa_flags; + + if (len < sizeof(ifa_flags)) + return false; + else if (!umove_or_printaddr(tcp, addr, &ifa_flags)) + printflags(ifaddrflags, ifa_flags, "IFA_F_???"); + + return true; +} + +static const nla_decoder_t ifaddrmsg_nla_decoders[] = { + [IFA_ADDRESS] = decode_ifa_address, + [IFA_LOCAL] = decode_ifa_address, + [IFA_LABEL] = decode_nla_str, + [IFA_BROADCAST] = decode_ifa_address, + [IFA_ANYCAST] = decode_ifa_address, + [IFA_CACHEINFO] = decode_ifa_cacheinfo, + [IFA_MULTICAST] = decode_ifa_address, + [IFA_FLAGS] = decode_ifa_flags +}; + +DECL_NETLINK_ROUTE_DECODER(decode_ifaddrmsg) +{ + struct ifaddrmsg ifaddr = { .ifa_family = family }; + size_t offset = sizeof(ifaddr.ifa_family); + bool decode_nla = false; + + PRINT_FIELD_XVAL("{", ifaddr, ifa_family, addrfams, "AF_???"); + + tprints(", "); + if (len >= sizeof(ifaddr)) { + if (!umoven_or_printaddr(tcp, addr + offset, + sizeof(ifaddr) - offset, + (char *) &ifaddr + offset)) { + PRINT_FIELD_U("", ifaddr, ifa_prefixlen); + PRINT_FIELD_FLAGS(", ", ifaddr, ifa_flags, + ifaddrflags, "IFA_F_???"); + PRINT_FIELD_XVAL(", ", ifaddr, ifa_scope, + routing_scopes, NULL); + PRINT_FIELD_IFINDEX(", ", ifaddr, ifa_index); + decode_nla = true; + } + } else + tprints("..."); + tprints("}"); + + offset = NLMSG_ALIGN(sizeof(ifaddr)); + if (decode_nla && len > offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + rtnl_addr_attrs, "IFA_???", + ifaddrmsg_nla_decoders, + ARRAY_SIZE(ifaddrmsg_nla_decoders), &ifaddr); + } +} diff --git a/rtnl_addrlabel.c b/rtnl_addrlabel.c new file mode 100644 index 00000000..1e6da24e --- /dev/null +++ b/rtnl_addrlabel.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#ifdef HAVE_STRUCT_IFADDRLBLMSG + +# include "netlink_route.h" +# include "nlattr.h" +# include "print_fields.h" + +# include +# include "netlink.h" + +# include "xlat/rtnl_addrlabel_attrs.h" + +static bool +decode_ifal_address(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + const struct ifaddrlblmsg *const ifal = opaque_data; + + decode_inet_addr(tcp, addr, len, ifal->ifal_family, NULL); + + return true; +} + +static const nla_decoder_t ifaddrlblmsg_nla_decoders[] = { + [IFAL_ADDRESS] = decode_ifal_address, + [IFAL_LABEL] = decode_nla_u32 +}; + +DECL_NETLINK_ROUTE_DECODER(decode_ifaddrlblmsg) +{ + struct ifaddrlblmsg ifal = { .ifal_family = family }; + size_t offset = sizeof(ifal.ifal_family); + bool decode_nla = false; + + PRINT_FIELD_XVAL("{", ifal, ifal_family, addrfams, "AF_???"); + + tprints(", "); + if (len >= sizeof(ifal)) { + if (!umoven_or_printaddr(tcp, addr + offset, + sizeof(ifal) - offset, + (char *) &ifal + offset)) { + PRINT_FIELD_U("", ifal, ifal_prefixlen); + PRINT_FIELD_U(", ", ifal, ifal_flags); + PRINT_FIELD_IFINDEX(", ", ifal, ifal_index); + PRINT_FIELD_U(", ", ifal, ifal_seq); + decode_nla = true; + } + } else + tprints("..."); + tprints("}"); + + offset = NLMSG_ALIGN(sizeof(ifal)); + if (decode_nla && len > offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + rtnl_addrlabel_attrs, "IFAL_???", + ifaddrlblmsg_nla_decoders, + ARRAY_SIZE(ifaddrlblmsg_nla_decoders), &ifal); + } +} + +#endif diff --git a/rtnl_dcb.c b/rtnl_dcb.c new file mode 100644 index 00000000..8d694bbe --- /dev/null +++ b/rtnl_dcb.c @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#ifdef HAVE_STRUCT_DCBMSG + +# include "netlink_route.h" +# include "nlattr.h" +# include "print_fields.h" + +# include +# include "netlink.h" + +# include "xlat/dcb_commands.h" +# include "xlat/rtnl_dcb_attrs.h" + +DECL_NETLINK_ROUTE_DECODER(decode_dcbmsg) +{ + struct dcbmsg dcb = { .dcb_family = family }; + size_t offset = sizeof(dcb.dcb_family); + bool decode_nla = false; + + PRINT_FIELD_XVAL("{", dcb, dcb_family, addrfams, "AF_???"); + + tprints(", "); + if (len >= sizeof(dcb)) { + if (!umoven_or_printaddr(tcp, addr + offset, + sizeof(dcb) - offset, + (char *) &dcb + offset)) { + PRINT_FIELD_XVAL("", dcb, cmd, + dcb_commands, "DCB_CMD_???"); + decode_nla = true; + } + } else + tprints("..."); + tprints("}"); + + offset = NLMSG_ALIGN(sizeof(dcb)); + if (decode_nla && len > offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + rtnl_dcb_attrs, "DCB_ATTR_???", NULL, 0, NULL); + } +} + +#endif diff --git a/rtnl_link.c b/rtnl_link.c new file mode 100644 index 00000000..92bc1e03 --- /dev/null +++ b/rtnl_link.c @@ -0,0 +1,911 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "netlink_route.h" +#include "nlattr.h" +#include "print_fields.h" + +#include "netlink.h" + +#include + +#ifdef HAVE_LINUX_IF_LINK_H +# include +#endif +#include + +#include "xlat/in6_addr_gen_mode.h" +#include "xlat/inet_devconf_indices.h" +#include "xlat/inet6_devconf_indices.h" +#include "xlat/inet6_if_flags.h" +#include "xlat/rtnl_ifla_af_spec_inet_attrs.h" +#include "xlat/rtnl_ifla_af_spec_inet6_attrs.h" +#include "xlat/rtnl_ifla_brport_attrs.h" +#include "xlat/rtnl_ifla_events.h" +#include "xlat/rtnl_ifla_info_attrs.h" +#include "xlat/rtnl_ifla_info_data_bridge_attrs.h" +#include "xlat/rtnl_ifla_info_data_tun_attrs.h" +#include "xlat/rtnl_ifla_port_attrs.h" +#include "xlat/rtnl_ifla_vf_port_attrs.h" +#include "xlat/rtnl_ifla_xdp_attached_mode.h" +#include "xlat/rtnl_ifla_xdp_attrs.h" +#include "xlat/rtnl_link_attrs.h" +#include "xlat/snmp_icmp6_stats.h" +#include "xlat/snmp_ip_stats.h" +#include "xlat/tun_device_types.h" +#include "xlat/xdp_flags.h" + +static bool +decode_rtnl_link_stats(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct rtnl_link_stats st; + const unsigned int min_size = + offsetofend(struct rtnl_link_stats, tx_compressed); + const unsigned int def_size = sizeof(st); + const unsigned int size = + (len >= def_size) ? def_size : + ((len == min_size) ? min_size : 0); + + if (!size) + return false; + + if (!umoven_or_printaddr(tcp, addr, size, &st)) { + PRINT_FIELD_U("{", st, rx_packets); + PRINT_FIELD_U(", ", st, tx_packets); + PRINT_FIELD_U(", ", st, rx_bytes); + PRINT_FIELD_U(", ", st, tx_bytes); + PRINT_FIELD_U(", ", st, rx_errors); + PRINT_FIELD_U(", ", st, tx_errors); + PRINT_FIELD_U(", ", st, rx_dropped); + PRINT_FIELD_U(", ", st, tx_dropped); + PRINT_FIELD_U(", ", st, multicast); + PRINT_FIELD_U(", ", st, collisions); + + PRINT_FIELD_U(", ", st, rx_length_errors); + PRINT_FIELD_U(", ", st, rx_over_errors); + PRINT_FIELD_U(", ", st, rx_crc_errors); + PRINT_FIELD_U(", ", st, rx_frame_errors); + PRINT_FIELD_U(", ", st, rx_fifo_errors); + PRINT_FIELD_U(", ", st, rx_missed_errors); + + PRINT_FIELD_U(", ", st, tx_aborted_errors); + PRINT_FIELD_U(", ", st, tx_carrier_errors); + PRINT_FIELD_U(", ", st, tx_fifo_errors); + PRINT_FIELD_U(", ", st, tx_heartbeat_errors); + PRINT_FIELD_U(", ", st, tx_window_errors); + + PRINT_FIELD_U(", ", st, rx_compressed); + PRINT_FIELD_U(", ", st, tx_compressed); +#ifdef HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER + if (len >= def_size) + PRINT_FIELD_U(", ", st, rx_nohandler); +#endif + tprints("}"); + } + + return true; +} + +static bool +decode_ifla_bridge_id(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct { + uint8_t prio[2]; + uint8_t addr[6]; + } id; + + if (len < sizeof(id)) + return false; + else if (!umove_or_printaddr(tcp, addr, &id)) { + tprintf("{prio=[%u, %u]", id.prio[0], id.prio[1]); + PRINT_FIELD_MAC(", ", id, addr); + tprints("}"); + } + + return true; +} + +static const nla_decoder_t ifla_brport_nla_decoders[] = { + [IFLA_BRPORT_STATE] = decode_nla_u8, + [IFLA_BRPORT_PRIORITY] = decode_nla_u16, + [IFLA_BRPORT_COST] = decode_nla_u32, + [IFLA_BRPORT_MODE] = decode_nla_u8, + [IFLA_BRPORT_GUARD] = decode_nla_u8, + [IFLA_BRPORT_PROTECT] = decode_nla_u8, + [IFLA_BRPORT_FAST_LEAVE] = decode_nla_u8, + [IFLA_BRPORT_LEARNING] = decode_nla_u8, + [IFLA_BRPORT_UNICAST_FLOOD] = decode_nla_u8, + [IFLA_BRPORT_PROXYARP] = decode_nla_u8, + [IFLA_BRPORT_LEARNING_SYNC] = decode_nla_u8, + [IFLA_BRPORT_PROXYARP_WIFI] = decode_nla_u8, + [IFLA_BRPORT_ROOT_ID] = decode_ifla_bridge_id, + [IFLA_BRPORT_BRIDGE_ID] = decode_ifla_bridge_id, + [IFLA_BRPORT_DESIGNATED_PORT] = decode_nla_u16, + [IFLA_BRPORT_DESIGNATED_COST] = decode_nla_u16, + [IFLA_BRPORT_ID] = decode_nla_u16, + [IFLA_BRPORT_NO] = decode_nla_u16, + [IFLA_BRPORT_TOPOLOGY_CHANGE_ACK] = decode_nla_u8, + [IFLA_BRPORT_CONFIG_PENDING] = decode_nla_u8, + [IFLA_BRPORT_MESSAGE_AGE_TIMER] = decode_nla_u64, + [IFLA_BRPORT_FORWARD_DELAY_TIMER] = decode_nla_u64, + [IFLA_BRPORT_HOLD_TIMER] = decode_nla_u64, + [IFLA_BRPORT_FLUSH] = NULL, + [IFLA_BRPORT_MULTICAST_ROUTER] = decode_nla_u8, + [IFLA_BRPORT_PAD] = NULL, + [IFLA_BRPORT_MCAST_FLOOD] = decode_nla_u8, + [IFLA_BRPORT_MCAST_TO_UCAST] = decode_nla_u8, + [IFLA_BRPORT_VLAN_TUNNEL] = decode_nla_u8, + [IFLA_BRPORT_BCAST_FLOOD] = decode_nla_u8, + [IFLA_BRPORT_GROUP_FWD_MASK] = decode_nla_u16, + [IFLA_BRPORT_NEIGH_SUPPRESS] = decode_nla_u8, + [IFLA_BRPORT_ISOLATED] = decode_nla_u8, + [IFLA_BRPORT_BACKUP_PORT] = decode_nla_ifindex, +}; + +static bool +decode_ifla_protinfo(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + decode_nlattr(tcp, addr, len, rtnl_ifla_brport_attrs, + "IFLA_BRPORT_???", + ARRSZ_PAIR(ifla_brport_nla_decoders), opaque_data); + + return true; +} + +static bool +decode_rtnl_link_ifmap(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct rtnl_link_ifmap map; + const unsigned int sizeof_ifmap = + offsetofend(struct rtnl_link_ifmap, port); + + if (len < sizeof_ifmap) + return false; + else if (!umoven_or_printaddr(tcp, addr, sizeof_ifmap, &map)) { + PRINT_FIELD_X("{", map, mem_start); + PRINT_FIELD_X(", ", map, mem_end); + PRINT_FIELD_X(", ", map, base_addr); + PRINT_FIELD_U(", ", map, irq); + PRINT_FIELD_U(", ", map, dma); + PRINT_FIELD_U(", ", map, port); + tprints("}"); + } + + return true; +} + +bool +decode_nla_linkinfo_kind(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct ifla_linkinfo_ctx *ctx = (void *) opaque_data; + + memset(ctx->kind, '\0', sizeof(ctx->kind)); + + if (umovestr(tcp, addr, sizeof(ctx->kind), ctx->kind) <= 0) { + /* + * If we haven't seen NUL or an error occurred, set kind to + * an empty string. + */ + ctx->kind[0] = '\0'; + } + + printstr_ex(tcp, addr, len, QUOTE_0_TERMINATED); + + return true; +} + +bool +decode_nla_linkinfo_xstats_can(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct strace_can_device_stats { + uint32_t bus_error; + uint32_t error_warning; + uint32_t error_passive; + uint32_t bus_off; + uint32_t arbitration_lost; + uint32_t restarts; + } st; + const unsigned int def_size = sizeof(st); + const unsigned int size = (len >= def_size) ? def_size : 0; + + if (!size) + return false; + + if (umoven_or_printaddr(tcp, addr, size, &st)) + return true; + + PRINT_FIELD_U("{", st, bus_error); + PRINT_FIELD_U(", ", st, error_warning); + PRINT_FIELD_U(", ", st, error_passive); + PRINT_FIELD_U(", ", st, bus_off); + PRINT_FIELD_U(", ", st, arbitration_lost); + PRINT_FIELD_U(", ", st, restarts); + tprints("}"); + + return true; +} + +bool +decode_nla_linkinfo_xstats(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct ifla_linkinfo_ctx *ctx = (void *) opaque_data; + nla_decoder_t func = NULL; + + if (!strcmp(ctx->kind, "can")) + func = decode_nla_linkinfo_xstats_can; + + if (func) + return func(tcp, addr, len, opaque_data); + + return false; +} + +static const nla_decoder_t ifla_info_data_bridge_nla_decoders[] = { + [IFLA_BR_UNSPEC] = NULL, + [IFLA_BR_FORWARD_DELAY] = decode_nla_u32, + [IFLA_BR_HELLO_TIME] = decode_nla_u32, + [IFLA_BR_MAX_AGE] = decode_nla_u32, + [IFLA_BR_AGEING_TIME] = decode_nla_u32, + [IFLA_BR_STP_STATE] = decode_nla_u32, + [IFLA_BR_PRIORITY] = decode_nla_u16, + [IFLA_BR_VLAN_FILTERING] = decode_nla_u8, + [IFLA_BR_VLAN_PROTOCOL] = decode_nla_ether_proto, + [IFLA_BR_GROUP_FWD_MASK] = decode_nla_x16, + [IFLA_BR_ROOT_ID] = decode_ifla_bridge_id, + [IFLA_BR_BRIDGE_ID] = decode_ifla_bridge_id, + [IFLA_BR_ROOT_PORT] = decode_nla_u16, + [IFLA_BR_ROOT_PATH_COST] = decode_nla_u32, + [IFLA_BR_TOPOLOGY_CHANGE] = decode_nla_u8, + [IFLA_BR_TOPOLOGY_CHANGE_DETECTED] = decode_nla_u8, + [IFLA_BR_HELLO_TIMER] = decode_nla_u64, + [IFLA_BR_TCN_TIMER] = decode_nla_u64, + [IFLA_BR_TOPOLOGY_CHANGE_TIMER] = decode_nla_u64, + [IFLA_BR_GC_TIMER] = decode_nla_u64, + [IFLA_BR_GROUP_ADDR] = NULL, /* MAC address */ + [IFLA_BR_FDB_FLUSH] = NULL, /* unspecified */ + [IFLA_BR_MCAST_ROUTER] = decode_nla_u8, + [IFLA_BR_MCAST_SNOOPING] = decode_nla_u8, + [IFLA_BR_MCAST_QUERY_USE_IFADDR] = decode_nla_u8, + [IFLA_BR_MCAST_QUERIER] = decode_nla_u8, + [IFLA_BR_MCAST_HASH_ELASTICITY] = decode_nla_u32, + [IFLA_BR_MCAST_HASH_MAX] = decode_nla_u32, + [IFLA_BR_MCAST_LAST_MEMBER_CNT] = decode_nla_u32, + [IFLA_BR_MCAST_STARTUP_QUERY_CNT] = decode_nla_u32, + [IFLA_BR_MCAST_LAST_MEMBER_INTVL] = decode_nla_u64, + [IFLA_BR_MCAST_MEMBERSHIP_INTVL] = decode_nla_u64, + [IFLA_BR_MCAST_QUERIER_INTVL] = decode_nla_u64, + [IFLA_BR_MCAST_QUERY_INTVL] = decode_nla_u64, + [IFLA_BR_MCAST_QUERY_RESPONSE_INTVL] = decode_nla_u64, + [IFLA_BR_MCAST_STARTUP_QUERY_INTVL] = decode_nla_u64, + [IFLA_BR_NF_CALL_IPTABLES] = decode_nla_u8, + [IFLA_BR_NF_CALL_IP6TABLES] = decode_nla_u8, + [IFLA_BR_NF_CALL_ARPTABLES] = decode_nla_u8, + [IFLA_BR_VLAN_DEFAULT_PVID] = decode_nla_u16, + [IFLA_BR_PAD] = NULL, + [IFLA_BR_VLAN_STATS_ENABLED] = decode_nla_u8, + [IFLA_BR_MCAST_STATS_ENABLED] = decode_nla_u8, + [IFLA_BR_MCAST_IGMP_VERSION] = decode_nla_u8, + [IFLA_BR_MCAST_MLD_VERSION] = decode_nla_u8, + [IFLA_BR_VLAN_STATS_PER_PORT] = decode_nla_u8, +}; + +bool +decode_nla_linkinfo_data_bridge(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + decode_nlattr(tcp, addr, len, rtnl_ifla_info_data_bridge_attrs, + "IFLA_BR_???", + ARRSZ_PAIR(ifla_info_data_bridge_nla_decoders), + opaque_data); + + return true; +} + +static bool +decode_nla_tun_type(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + const struct decode_nla_xlat_opts opts = { + .xlat = tun_device_types, + .xlat_size = ARRAY_SIZE(tun_device_types) - 1, + .xt = XT_INDEXED, + .dflt = "IFF_???", + .size = 1, + }; + + return decode_nla_xval(tcp, addr, len, &opts); +} + +static const nla_decoder_t ifla_info_data_tun_nla_decoders[] = { + [IFLA_TUN_UNSPEC] = NULL, + [IFLA_TUN_OWNER] = decode_nla_uid, + [IFLA_TUN_GROUP] = decode_nla_gid, + [IFLA_TUN_TYPE] = decode_nla_tun_type, + [IFLA_TUN_PI] = decode_nla_u8, + [IFLA_TUN_VNET_HDR] = decode_nla_u8, + [IFLA_TUN_PERSIST] = decode_nla_u8, + [IFLA_TUN_MULTI_QUEUE] = decode_nla_u8, + [IFLA_TUN_NUM_QUEUES] = decode_nla_u32, + [IFLA_TUN_NUM_DISABLED_QUEUES] = decode_nla_u32, +}; + +bool +decode_nla_linkinfo_data_tun(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + decode_nlattr(tcp, addr, len, rtnl_ifla_info_data_tun_attrs, + "IFLA_TUN_???", + ARRSZ_PAIR(ifla_info_data_tun_nla_decoders), + opaque_data); + + return true; +} + +bool +decode_nla_linkinfo_data(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct ifla_linkinfo_ctx *ctx = (void *) opaque_data; + nla_decoder_t func = NULL; + + if (!strcmp(ctx->kind, "bridge")) + func = decode_nla_linkinfo_data_bridge; + else if (!strcmp(ctx->kind, "tun")) + func = decode_nla_linkinfo_data_tun; + + if (func) + return func(tcp, addr, len, opaque_data); + + return false; +} + +static const nla_decoder_t ifla_linkinfo_nla_decoders[] = { + [IFLA_INFO_KIND] = decode_nla_linkinfo_kind, + [IFLA_INFO_DATA] = decode_nla_linkinfo_data, + [IFLA_INFO_XSTATS] = decode_nla_linkinfo_xstats, + [IFLA_INFO_SLAVE_KIND] = decode_nla_str, + [IFLA_INFO_SLAVE_DATA] = NULL, /* unimplemented */ +}; + +static bool +decode_ifla_linkinfo(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct ifla_linkinfo_ctx ctx = { .kind = "", }; + + decode_nlattr(tcp, addr, len, rtnl_ifla_info_attrs, + "IFLA_INFO_???", ARRSZ_PAIR(ifla_linkinfo_nla_decoders), + &ctx); + + return true; +} + +static bool +decode_rtnl_link_stats64(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ +#ifdef HAVE_STRUCT_RTNL_LINK_STATS64 + struct rtnl_link_stats64 st; + const unsigned int min_size = + offsetofend(struct rtnl_link_stats64, tx_compressed); + const unsigned int def_size = sizeof(st); + const unsigned int size = + (len >= def_size) ? def_size : + ((len == min_size) ? min_size : 0); + + if (!size) + return false; + + if (!umoven_or_printaddr(tcp, addr, size, &st)) { + PRINT_FIELD_U("{", st, rx_packets); + PRINT_FIELD_U(", ", st, tx_packets); + PRINT_FIELD_U(", ", st, rx_bytes); + PRINT_FIELD_U(", ", st, tx_bytes); + PRINT_FIELD_U(", ", st, rx_errors); + PRINT_FIELD_U(", ", st, tx_errors); + PRINT_FIELD_U(", ", st, rx_dropped); + PRINT_FIELD_U(", ", st, tx_dropped); + PRINT_FIELD_U(", ", st, multicast); + PRINT_FIELD_U(", ", st, collisions); + + PRINT_FIELD_U(", ", st, rx_length_errors); + PRINT_FIELD_U(", ", st, rx_over_errors); + PRINT_FIELD_U(", ", st, rx_crc_errors); + PRINT_FIELD_U(", ", st, rx_frame_errors); + PRINT_FIELD_U(", ", st, rx_fifo_errors); + PRINT_FIELD_U(", ", st, rx_missed_errors); + + PRINT_FIELD_U(", ", st, tx_aborted_errors); + PRINT_FIELD_U(", ", st, tx_carrier_errors); + PRINT_FIELD_U(", ", st, tx_fifo_errors); + PRINT_FIELD_U(", ", st, tx_heartbeat_errors); + PRINT_FIELD_U(", ", st, tx_window_errors); + + PRINT_FIELD_U(", ", st, rx_compressed); + PRINT_FIELD_U(", ", st, tx_compressed); +# ifdef HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER + if (len >= def_size) + PRINT_FIELD_U(", ", st, rx_nohandler); +# endif + tprints("}"); + } + + return true; +#else + return false; +#endif +} + +static bool +decode_ifla_port_vsi(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ +#ifdef HAVE_STRUCT_IFLA_PORT_VSI + struct ifla_port_vsi vsi; + + if (len < sizeof(vsi)) + return false; + else if (!umove_or_printaddr(tcp, addr, &vsi)) { + PRINT_FIELD_U("{", vsi, vsi_mgr_id); + PRINT_FIELD_STRING(", ", vsi, vsi_type_id, + sizeof(vsi.vsi_type_id), QUOTE_FORCE_HEX); + PRINT_FIELD_U(", ", vsi, vsi_type_version); + tprints("}"); + } + + return true; +#else + return false; +#endif +} + +static const nla_decoder_t ifla_port_nla_decoders[] = { + [IFLA_PORT_VF] = decode_nla_u32, + [IFLA_PORT_PROFILE] = decode_nla_str, + [IFLA_PORT_VSI_TYPE] = decode_ifla_port_vsi, + [IFLA_PORT_INSTANCE_UUID] = NULL, /* default parser */ + [IFLA_PORT_HOST_UUID] = NULL, /* default parser */ + [IFLA_PORT_REQUEST] = decode_nla_u8, + [IFLA_PORT_RESPONSE] = decode_nla_u16 +}; + +static bool +decode_ifla_port(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + decode_nlattr(tcp, addr, len, rtnl_ifla_port_attrs, + "IFLA_VF_PORT_???", ARRSZ_PAIR(ifla_port_nla_decoders), + opaque_data); + + return true; +} + +static const nla_decoder_t ifla_vf_port_nla_decoders[] = { + [IFLA_VF_PORT] = decode_ifla_port +}; + +static bool +decode_ifla_vf_ports(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + decode_nlattr(tcp, addr, len, rtnl_ifla_vf_port_attrs, + "IFLA_VF_PORT_???", ARRSZ_PAIR(ifla_vf_port_nla_decoders), + opaque_data); + + return true; +} + +static bool +decode_ifla_xdp_flags(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + uint32_t flags; + + if (len < sizeof(flags)) + return false; + else if (!umove_or_printaddr(tcp, addr, &flags)) + printflags(xdp_flags, flags, "XDP_FLAGS_???"); + + return true; +} + +bool +decode_ifla_xdp_attached(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + const struct decode_nla_xlat_opts opts = { + .xlat = rtnl_ifla_xdp_attached_mode, + .xlat_size = ARRAY_SIZE(rtnl_ifla_xdp_attached_mode) - 1, + .xt = XT_INDEXED, + .dflt = "XDP_ATTACHED_???", + .size = 1, + }; + + return decode_nla_xval(tcp, addr, len, &opts); +} + +static const nla_decoder_t ifla_xdp_nla_decoders[] = { + [IFLA_XDP_FD] = decode_nla_fd, + [IFLA_XDP_ATTACHED] = decode_ifla_xdp_attached, + [IFLA_XDP_FLAGS] = decode_ifla_xdp_flags, + [IFLA_XDP_PROG_ID] = decode_nla_u32, + [IFLA_XDP_DRV_PROG_ID] = decode_nla_u32, + [IFLA_XDP_SKB_PROG_ID] = decode_nla_u32, + [IFLA_XDP_HW_PROG_ID] = decode_nla_u32, +}; + +static bool +decode_ifla_xdp(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + decode_nlattr(tcp, addr, len, rtnl_ifla_xdp_attrs, + "IFLA_XDP_???", ARRSZ_PAIR(ifla_xdp_nla_decoders), + opaque_data); + + return true; +} + +static bool +decode_ifla_event(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + uint32_t ev; + + if (len < sizeof(ev)) + return false; + else if (!umove_or_printaddr(tcp, addr, &ev)) + printxval(rtnl_ifla_events, ev, "IFLA_EVENT_???"); + + return true; +} + + +static bool +decode_ifla_inet_conf(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + int elem; + size_t cnt = len / sizeof(elem); + + if (!cnt) + return false; + + print_array_ex(tcp, addr, cnt, &elem, sizeof(elem), + tfetch_mem, print_int32_array_member, NULL, + PAF_PRINT_INDICES | PAF_INDEX_XLAT_VALUE_INDEXED + | XLAT_STYLE_FMT_D, + ARRSZ_PAIR(inet_devconf_indices) - 1, + "IPV4_DEVCONF_???"); + + return true; +} + +static const nla_decoder_t ifla_inet_nla_decoders[] = { + [IFLA_INET_CONF] = decode_ifla_inet_conf, +}; + +static bool +decode_ifla_inet6_flags(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + const struct decode_nla_xlat_opts opts = { + ARRSZ_PAIR(inet6_if_flags) - 1, "IF_???", + .size = 4, + }; + + return decode_nla_flags(tcp, addr, len, &opts); +} + +static bool +decode_ifla_inet6_conf(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + int elem; + size_t cnt = len / sizeof(elem); + + if (!cnt) + return false; + + print_array_ex(tcp, addr, cnt, &elem, sizeof(elem), + tfetch_mem, print_int32_array_member, NULL, + PAF_PRINT_INDICES | PAF_INDEX_XLAT_VALUE_INDEXED + | XLAT_STYLE_FMT_D, + ARRSZ_PAIR(inet6_devconf_indices) - 1, + "DEVCONF_???"); + + return true; +} + +static bool +decode_ifla_inet6_stats(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + uint64_t elem; + size_t cnt = len / sizeof(elem); + + if (!cnt) + return false; + + print_array_ex(tcp, addr, cnt, &elem, sizeof(elem), + tfetch_mem, print_uint64_array_member, NULL, + PAF_PRINT_INDICES | PAF_INDEX_XLAT_VALUE_INDEXED + | XLAT_STYLE_FMT_U, ARRSZ_PAIR(snmp_ip_stats) - 1, + "IPSTATS_MIB_???"); + + return true; +} + +static bool +decode_ifla_inet6_cacheinfo(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct { + uint32_t max_reasm_len; + uint32_t tstamp; + uint32_t reachable_time; + uint32_t retrans_time; + } ci; + + if (len < sizeof(ci)) + return false; + else if (!umove_or_printaddr(tcp, addr, &ci)) { + PRINT_FIELD_U("{", ci, max_reasm_len); + PRINT_FIELD_U(", ", ci, tstamp); + PRINT_FIELD_U(", ", ci, reachable_time); + PRINT_FIELD_U(", ", ci, retrans_time); + tprints("}"); + } + + return true; +} + +static bool +decode_ifla_inet6_icmp6_stats(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + uint64_t elem; + size_t cnt = len / sizeof(elem); + + if (!cnt) + return false; + + print_array_ex(tcp, addr, cnt, &elem, sizeof(elem), + tfetch_mem, print_uint64_array_member, NULL, + PAF_PRINT_INDICES | PAF_INDEX_XLAT_VALUE_INDEXED + | XLAT_STYLE_FMT_U, ARRSZ_PAIR(snmp_icmp6_stats) - 1, + "ICMP6_MIB_???"); + + return true; +} + +static bool +decode_ifla_inet6_agm(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + const struct decode_nla_xlat_opts opts = { + ARRSZ_PAIR(in6_addr_gen_mode) - 1, "IN6_ADDR_GEN_MODE_???", + .xt = XT_INDEXED, + .size = 1, + }; + + return decode_nla_xval(tcp, addr, len, &opts); +} + +static const nla_decoder_t ifla_inet6_nla_decoders[] = { + [IFLA_INET6_FLAGS] = decode_ifla_inet6_flags, + [IFLA_INET6_CONF] = decode_ifla_inet6_conf, + [IFLA_INET6_STATS] = decode_ifla_inet6_stats, + [IFLA_INET6_MCAST] = NULL, /* unused */ + [IFLA_INET6_CACHEINFO] = decode_ifla_inet6_cacheinfo, + [IFLA_INET6_ICMP6STATS] = decode_ifla_inet6_icmp6_stats, + [IFLA_INET6_TOKEN] = decode_nla_in6_addr, + [IFLA_INET6_ADDR_GEN_MODE] = decode_ifla_inet6_agm, +}; + +static const struct nla_decoder_table_desc { + const struct xlat *xlat; + const char *dflt; + const nla_decoder_t *table; + size_t size; +} ifla_af_spec_protos[] = { + [AF_INET] = { + rtnl_ifla_af_spec_inet_attrs, "IFLA_INET_???", + ARRSZ_PAIR(ifla_inet_nla_decoders), + }, + [AF_INET6] = { + rtnl_ifla_af_spec_inet6_attrs, "IFLA_INET6_???", + ARRSZ_PAIR(ifla_inet6_nla_decoders), + }, +}; + +static bool +decode_ifla_af(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + uintptr_t proto = (uintptr_t) opaque_data; + const struct nla_decoder_table_desc *desc + = proto < ARRAY_SIZE(ifla_af_spec_protos) + ? ifla_af_spec_protos + proto : NULL; + + if (!desc || !desc->table) + return false; + + decode_nlattr(tcp, addr, len, + desc->xlat, desc->dflt, desc->table, desc->size, NULL); + + return true; +} + +static bool +decode_ifla_af_spec(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + nla_decoder_t af_spec_decoder = &decode_ifla_af; + + decode_nlattr(tcp, addr, len, addrfams, "AF_???", + &af_spec_decoder, 0, opaque_data); + + return true; +} + +static const nla_decoder_t ifinfomsg_nla_decoders[] = { + [IFLA_ADDRESS] = NULL, /* unimplemented */ + [IFLA_BROADCAST] = NULL, /* unimplemented */ + [IFLA_IFNAME] = decode_nla_str, + [IFLA_MTU] = decode_nla_u32, + [IFLA_LINK] = decode_nla_u32, + [IFLA_QDISC] = decode_nla_str, + [IFLA_STATS] = decode_rtnl_link_stats, + [IFLA_COST] = NULL, /* unused */ + [IFLA_PRIORITY] = NULL, /* unused */ + [IFLA_MASTER] = decode_nla_u32, + [IFLA_WIRELESS] = NULL, /* unimplemented */ + [IFLA_PROTINFO] = decode_ifla_protinfo, + [IFLA_TXQLEN] = decode_nla_u32, + [IFLA_MAP] = decode_rtnl_link_ifmap, + [IFLA_WEIGHT] = decode_nla_u32, + [IFLA_OPERSTATE] = decode_nla_u8, + [IFLA_LINKMODE] = decode_nla_u8, + [IFLA_LINKINFO] = decode_ifla_linkinfo, + [IFLA_NET_NS_PID] = decode_nla_u32, + [IFLA_IFALIAS] = decode_nla_str, + [IFLA_NUM_VF] = decode_nla_u32, + [IFLA_VFINFO_LIST] = NULL, /* unimplemented */ + [IFLA_STATS64] = decode_rtnl_link_stats64, + [IFLA_VF_PORTS] = decode_ifla_vf_ports, + [IFLA_PORT_SELF] = decode_ifla_port, + [IFLA_AF_SPEC] = decode_ifla_af_spec, + [IFLA_GROUP] = decode_nla_u32, + [IFLA_NET_NS_FD] = decode_nla_fd, + [IFLA_EXT_MASK] = decode_nla_u32, + [IFLA_PROMISCUITY] = decode_nla_u32, + [IFLA_NUM_TX_QUEUES] = decode_nla_u32, + [IFLA_NUM_RX_QUEUES] = decode_nla_u32, + [IFLA_CARRIER] = decode_nla_u8, + [IFLA_PHYS_PORT_ID] = NULL, /* default parser */ + [IFLA_CARRIER_CHANGES] = decode_nla_u32, + [IFLA_PHYS_SWITCH_ID] = NULL, /* default parser */ + [IFLA_LINK_NETNSID] = decode_nla_s32, + [IFLA_PHYS_PORT_NAME] = decode_nla_str, + [IFLA_PROTO_DOWN] = decode_nla_u8, + [IFLA_GSO_MAX_SEGS] = decode_nla_u32, + [IFLA_GSO_MAX_SIZE] = decode_nla_u32, + [IFLA_PAD] = NULL, + [IFLA_XDP] = decode_ifla_xdp, + [IFLA_EVENT] = decode_ifla_event, + [IFLA_NEW_NETNSID] = decode_nla_s32, + [IFLA_IF_NETNSID] = decode_nla_s32, + [IFLA_CARRIER_UP_COUNT] = decode_nla_u32, + [IFLA_CARRIER_DOWN_COUNT] = decode_nla_u32, + [IFLA_NEW_IFINDEX] = decode_nla_ifindex, + [IFLA_MIN_MTU] = decode_nla_u32, + [IFLA_MAX_MTU] = decode_nla_u32, +}; + +DECL_NETLINK_ROUTE_DECODER(decode_ifinfomsg) +{ + struct ifinfomsg ifinfo = { .ifi_family = family }; + size_t offset = sizeof(ifinfo.ifi_family); + bool decode_nla = false; + + PRINT_FIELD_XVAL("{", ifinfo, ifi_family, addrfams, "AF_???"); + + tprints(", "); + if (len >= sizeof(ifinfo)) { + if (!umoven_or_printaddr(tcp, addr + offset, + sizeof(ifinfo) - offset, + (char *) &ifinfo + offset)) { + PRINT_FIELD_XVAL_SORTED_SIZED("", ifinfo, ifi_type, + arp_hardware_types, + arp_hardware_types_size, + "ARPHRD_???"); + PRINT_FIELD_IFINDEX(", ", ifinfo, ifi_index); + PRINT_FIELD_FLAGS(", ", ifinfo, ifi_flags, + iffflags, "IFF_???"); + PRINT_FIELD_X(", ", ifinfo, ifi_change); + decode_nla = true; + } + } else + tprints("..."); + tprints("}"); + + offset = NLMSG_ALIGN(sizeof(ifinfo)); + if (decode_nla && len > offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + rtnl_link_attrs, "IFLA_???", + ARRSZ_PAIR(ifinfomsg_nla_decoders), NULL); + } +} diff --git a/rtnl_mdb.c b/rtnl_mdb.c new file mode 100644 index 00000000..dbbfb896 --- /dev/null +++ b/rtnl_mdb.c @@ -0,0 +1,216 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#ifdef HAVE_STRUCT_BR_PORT_MSG + +# include "netlink_route.h" +# include "nlattr.h" +# include "print_fields.h" + +# include +# include +# include "netlink.h" + +# ifdef HAVE_STRUCT_BR_MDB_ENTRY_FLAGS +# include "xlat/mdb_flags.h" +# endif +# include "xlat/mdb_states.h" +# include "xlat/multicast_router_types.h" +# include "xlat/rtnl_mdb_attrs.h" +# include "xlat/rtnl_mdba_mdb_attrs.h" +# include "xlat/rtnl_mdba_mdb_eattr_attrs.h" +# include "xlat/rtnl_mdba_mdb_entry_attrs.h" +# include "xlat/rtnl_mdba_router_attrs.h" +# include "xlat/rtnl_mdba_router_pattr_attrs.h" + +static const nla_decoder_t mdba_mdb_eattr_nla_decoders[] = { + [MDBA_MDB_EATTR_TIMER] = decode_nla_u32 +}; + +static bool +decode_mdba_mdb_entry_info(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ +# ifdef HAVE_STRUCT_BR_MDB_ENTRY + struct br_mdb_entry entry; + + if (len < sizeof(entry)) + return false; + else if (!umove_or_printaddr(tcp, addr, &entry)) { + PRINT_FIELD_IFINDEX("{", entry, ifindex); + PRINT_FIELD_XVAL(", ", entry, state, mdb_states, "MDB_???"); +# ifdef HAVE_STRUCT_BR_MDB_ENTRY_FLAGS + PRINT_FIELD_FLAGS(", ", entry, flags, + mdb_flags, "MDB_FLAGS_???"); +# endif +# ifdef HAVE_STRUCT_BR_MDB_ENTRY_VID + PRINT_FIELD_U(", ", entry, vid); +# endif + + const int proto = ntohs(entry.addr.proto); + + tprints(", addr={"); + print_inet_addr(proto, &entry.addr.u, + sizeof(entry.addr.u), "u"); + tprints(", proto=htons("); + printxval(addrfams, proto, "AF_???"); + tprints(")}}"); + } + + const size_t offset = NLMSG_ALIGN(sizeof(entry)); + if (len > offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + rtnl_mdba_mdb_eattr_attrs, "MDBA_MDB_EATTR_???", + mdba_mdb_eattr_nla_decoders, + ARRAY_SIZE(mdba_mdb_eattr_nla_decoders), NULL); + } + + return true; +# else + return false; +# endif /* HAVE_STRUCT_BR_MDB_ENTRY */ +} + +static const nla_decoder_t mdba_mdb_entry_nla_decoders[] = { + [MDBA_MDB_ENTRY_INFO] = decode_mdba_mdb_entry_info +}; + +static bool +decode_mdba_mdb_entry(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + decode_nlattr(tcp, addr, len, rtnl_mdba_mdb_entry_attrs, + "MDBA_MDB_ENTRY_???", mdba_mdb_entry_nla_decoders, + ARRAY_SIZE(mdba_mdb_entry_nla_decoders), NULL); + + return true; +} + +static const nla_decoder_t mdba_mdb_nla_decoders[] = { + [MDBA_MDB_ENTRY] = decode_mdba_mdb_entry +}; + +static bool +decode_mdba_mdb(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + decode_nlattr(tcp, addr, len, rtnl_mdba_mdb_attrs, "MDBA_MDB_???", + mdba_mdb_nla_decoders, + ARRAY_SIZE(mdba_mdb_nla_decoders), NULL); + + return true; +} + +static bool +decode_multicast_router_type(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + uint8_t type; + + if (!umove_or_printaddr(tcp, addr, &type)) + printxval(multicast_router_types, type, "MDB_RTR_TYPE_???"); + + return true; +} + +static const nla_decoder_t mdba_router_pattr_nla_decoders[] = { + [MDBA_ROUTER_PATTR_TIMER] = decode_nla_u32, + [MDBA_ROUTER_PATTR_TYPE] = decode_multicast_router_type +}; + +static bool +decode_mdba_router_port(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + uint32_t ifindex; + + if (len < sizeof(ifindex)) + return false; + else if (!umove_or_printaddr(tcp, addr, &ifindex)) + print_ifindex(ifindex); + + const size_t offset = NLMSG_ALIGN(sizeof(ifindex)); + if (len > offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + rtnl_mdba_router_pattr_attrs, + "MDBA_ROUTER_PATTR_???", + mdba_router_pattr_nla_decoders, + ARRAY_SIZE(mdba_router_pattr_nla_decoders), NULL); + } + + return true; +} + +static const nla_decoder_t mdba_router_nla_decoders[] = { + [MDBA_ROUTER_PORT] = decode_mdba_router_port +}; + +static bool +decode_mdba_router(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + decode_nlattr(tcp, addr, len, rtnl_mdba_router_attrs, "MDBA_ROUTER_???", + mdba_router_nla_decoders, + ARRAY_SIZE(mdba_router_nla_decoders), NULL); + + return true; +} + +static const nla_decoder_t br_port_msg_nla_decoders[] = { + [MDBA_MDB] = decode_mdba_mdb, + [MDBA_ROUTER] = decode_mdba_router +}; + +DECL_NETLINK_ROUTE_DECODER(decode_br_port_msg) +{ + struct br_port_msg bpm = { .family = family }; + size_t offset = sizeof(bpm.family); + bool decode_nla = false; + + PRINT_FIELD_XVAL("{", bpm, family, addrfams, "AF_???"); + + tprints(", "); + if (len >= sizeof(bpm)) { + if (!umoven_or_printaddr(tcp, addr + offset, + sizeof(bpm) - offset, + (char *) &bpm + offset)) { + PRINT_FIELD_IFINDEX("", bpm, ifindex); + decode_nla = true; + } + } else + tprints("..."); + tprints("}"); + + offset = NLMSG_ALIGN(sizeof(bpm)); + if (decode_nla && len > offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + rtnl_mdb_attrs, "MDBA_???", + br_port_msg_nla_decoders, + ARRAY_SIZE(br_port_msg_nla_decoders), NULL); + } +} + +#endif diff --git a/rtnl_neigh.c b/rtnl_neigh.c new file mode 100644 index 00000000..c542fee6 --- /dev/null +++ b/rtnl_neigh.c @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2016-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "netlink_route.h" +#include "nlattr.h" +#include "print_fields.h" + +#include "netlink.h" +#include +#ifdef HAVE_LINUX_NEIGHBOUR_H +# include +#endif + +#include "xlat/neighbor_cache_entry_flags.h" +#include "xlat/neighbor_cache_entry_states.h" +#include "xlat/rtnl_neigh_attrs.h" + +static bool +decode_neigh_addr(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + const struct ndmsg *const ndmsg = opaque_data; + + decode_inet_addr(tcp, addr, len, ndmsg->ndm_family, NULL); + + return true; +} + +static bool +decode_nda_cacheinfo(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct nda_cacheinfo ci; + + if (len < sizeof(ci)) + return false; + else if (!umove_or_printaddr(tcp, addr, &ci)) { + PRINT_FIELD_U("{", ci, ndm_confirmed); + PRINT_FIELD_U(", ", ci, ndm_used); + PRINT_FIELD_U(", ", ci, ndm_updated); + PRINT_FIELD_U(", ", ci, ndm_refcnt); + tprints("}"); + } + + return true; +} + +static const nla_decoder_t ndmsg_nla_decoders[] = { + [NDA_DST] = decode_neigh_addr, + [NDA_LLADDR] = decode_neigh_addr, + [NDA_CACHEINFO] = decode_nda_cacheinfo, + [NDA_PROBES] = decode_nla_u32, + [NDA_VLAN] = decode_nla_u16, + [NDA_PORT] = decode_nla_be16, + [NDA_VNI] = decode_nla_u32, + [NDA_IFINDEX] = decode_nla_ifindex, + [NDA_MASTER] = decode_nla_ifindex, + [NDA_LINK_NETNSID] = decode_nla_u32, + [NDA_SRC_VNI] = NULL, + [NDA_PROTOCOL] = decode_nla_u8, +}; + +DECL_NETLINK_ROUTE_DECODER(decode_ndmsg) +{ + struct ndmsg ndmsg = { .ndm_family = family }; + size_t offset = sizeof(ndmsg.ndm_family); + bool decode_nla = false; + + PRINT_FIELD_XVAL("{", ndmsg, ndm_family, addrfams, "AF_???"); + + tprints(", "); + if (len >= sizeof(ndmsg)) { + if (!umoven_or_printaddr(tcp, addr + offset, + sizeof(ndmsg) - offset, + (char *) &ndmsg + offset)) { + PRINT_FIELD_IFINDEX("", ndmsg, ndm_ifindex); + PRINT_FIELD_FLAGS(", ", ndmsg, ndm_state, + neighbor_cache_entry_states, + "NUD_???"); + PRINT_FIELD_FLAGS(", ", ndmsg, ndm_flags, + neighbor_cache_entry_flags, + "NTF_???"); + PRINT_FIELD_XVAL(", ", ndmsg, ndm_type, + routing_types, "RTN_???"); + decode_nla = true; + } + } else + tprints("..."); + tprints("}"); + + offset = NLMSG_ALIGN(sizeof(ndmsg)); + if (decode_nla && len > offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + rtnl_neigh_attrs, "NDA_???", + ndmsg_nla_decoders, + ARRAY_SIZE(ndmsg_nla_decoders), &ndmsg); + } +} + +DECL_NETLINK_ROUTE_DECODER(decode_rtm_getneigh) +{ + if (family == AF_BRIDGE) + decode_ifinfomsg(tcp, nlmsghdr, family, addr, len); + else + decode_ndmsg(tcp, nlmsghdr, family, addr, len); +} diff --git a/rtnl_neightbl.c b/rtnl_neightbl.c new file mode 100644 index 00000000..f9f5756b --- /dev/null +++ b/rtnl_neightbl.c @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "netlink_route.h" +#include "nlattr.h" +#include "print_fields.h" + +#include "netlink.h" +#include +#ifdef HAVE_LINUX_NEIGHBOUR_H +# include +#endif + +#include "xlat/rtnl_neightbl_attrs.h" +#include "xlat/rtnl_neightbl_parms_attrs.h" + +static bool +decode_ndt_config(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ +#ifdef HAVE_STRUCT_NDT_CONFIG + struct ndt_config ndtc; + + if (len < sizeof(ndtc)) + return false; + else if (!umove_or_printaddr(tcp, addr, &ndtc)) { + PRINT_FIELD_U("{", ndtc, ndtc_key_len); + PRINT_FIELD_U(", ", ndtc, ndtc_entry_size); + PRINT_FIELD_U(", ", ndtc, ndtc_entries); + PRINT_FIELD_U(", ", ndtc, ndtc_last_flush); + PRINT_FIELD_U(", ", ndtc, ndtc_last_rand); + PRINT_FIELD_U(", ", ndtc, ndtc_hash_rnd); + PRINT_FIELD_0X(", ", ndtc, ndtc_hash_mask); + PRINT_FIELD_U(", ", ndtc, ndtc_hash_chain_gc); + PRINT_FIELD_U(", ", ndtc, ndtc_proxy_qlen); + tprints("}"); + } + + return true; +#else + return false; +#endif +} + +static const nla_decoder_t ndt_parms_nla_decoders[] = { + [NDTPA_IFINDEX] = decode_nla_ifindex, + [NDTPA_REFCNT] = decode_nla_u32, + [NDTPA_REACHABLE_TIME] = decode_nla_u64, + [NDTPA_BASE_REACHABLE_TIME] = decode_nla_u64, + [NDTPA_RETRANS_TIME] = decode_nla_u64, + [NDTPA_GC_STALETIME] = decode_nla_u64, + [NDTPA_DELAY_PROBE_TIME] = decode_nla_u64, + [NDTPA_QUEUE_LEN] = decode_nla_u32, + [NDTPA_APP_PROBES] = decode_nla_u32, + [NDTPA_UCAST_PROBES] = decode_nla_u32, + [NDTPA_MCAST_PROBES] = decode_nla_u32, + [NDTPA_ANYCAST_DELAY] = decode_nla_u64, + [NDTPA_PROXY_DELAY] = decode_nla_u64, + [NDTPA_PROXY_QLEN] = decode_nla_u32, + [NDTPA_LOCKTIME] = decode_nla_u64, + [NDTPA_QUEUE_LENBYTES] = decode_nla_u32, + [NDTPA_MCAST_REPROBES] = decode_nla_u32, + [NDTPA_PAD] = NULL +}; + +static bool +decode_ndta_parms(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + decode_nlattr(tcp, addr, len, rtnl_neightbl_parms_attrs, "NDTPA_???", + ndt_parms_nla_decoders, + ARRAY_SIZE(ndt_parms_nla_decoders), opaque_data); + + return true; +} + +static bool +decode_ndt_stats(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ +#ifdef HAVE_STRUCT_NDT_STATS + struct ndt_stats ndtst; + const unsigned int min_size = + offsetofend(struct ndt_stats, ndts_forced_gc_runs); + const unsigned int def_size = sizeof(ndtst); + const unsigned int size = + (len >= def_size) ? def_size : + ((len == min_size) ? min_size : 0); + + if (!size) + return false; + + if (!umoven_or_printaddr(tcp, addr, size, &ndtst)) { + PRINT_FIELD_U("{", ndtst, ndts_allocs); + PRINT_FIELD_U(", ", ndtst, ndts_destroys); + PRINT_FIELD_U(", ", ndtst, ndts_hash_grows); + PRINT_FIELD_U(", ", ndtst, ndts_res_failed); + PRINT_FIELD_U(", ", ndtst, ndts_lookups); + PRINT_FIELD_U(", ", ndtst, ndts_hits); + PRINT_FIELD_U(", ", ndtst, ndts_rcv_probes_mcast); + PRINT_FIELD_U(", ", ndtst, ndts_rcv_probes_ucast); + PRINT_FIELD_U(", ", ndtst, ndts_periodic_gc_runs); + PRINT_FIELD_U(", ", ndtst, ndts_forced_gc_runs); +# ifdef HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS + if (len >= def_size) + PRINT_FIELD_U(", ", ndtst, ndts_table_fulls); +# endif + tprints("}"); + } + + return true; +#else + return false; +#endif +} + +static const nla_decoder_t ndtmsg_nla_decoders[] = { + [NDTA_NAME] = decode_nla_str, + [NDTA_THRESH1] = decode_nla_u32, + [NDTA_THRESH2] = decode_nla_u32, + [NDTA_THRESH3] = decode_nla_u32, + [NDTA_CONFIG] = decode_ndt_config, + [NDTA_PARMS] = decode_ndta_parms, + [NDTA_STATS] = decode_ndt_stats, + [NDTA_GC_INTERVAL] = decode_nla_u64, + [NDTA_PAD] = NULL, +}; + +DECL_NETLINK_ROUTE_DECODER(decode_ndtmsg) +{ + struct ndtmsg ndtmsg = { .ndtm_family = family }; + + PRINT_FIELD_XVAL("{", ndtmsg, ndtm_family, addrfams, "AF_???"); + tprints("}"); + + const size_t offset = NLMSG_ALIGN(sizeof(ndtmsg)); + if (len > offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + rtnl_neightbl_attrs, "NDTA_???", + ndtmsg_nla_decoders, + ARRAY_SIZE(ndtmsg_nla_decoders), NULL); + } +} diff --git a/rtnl_netconf.c b/rtnl_netconf.c new file mode 100644 index 00000000..799ee156 --- /dev/null +++ b/rtnl_netconf.c @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#ifdef HAVE_STRUCT_NETCONFMSG + +# include "netlink_route.h" +# include "nlattr.h" +# include "print_fields.h" + +# include +# include "netlink.h" + +# include "xlat/rtnl_netconf_attrs.h" + +static const nla_decoder_t netconfmsg_nla_decoders[] = { + [NETCONFA_IFINDEX] = decode_nla_ifindex, + [NETCONFA_FORWARDING] = decode_nla_s32, + [NETCONFA_RP_FILTER] = decode_nla_s32, + [NETCONFA_MC_FORWARDING] = decode_nla_s32, + [NETCONFA_PROXY_NEIGH] = decode_nla_s32, + [NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN] = decode_nla_s32, + [NETCONFA_INPUT] = decode_nla_s32, + [NETCONFA_BC_FORWARDING] = decode_nla_s32, +}; + +DECL_NETLINK_ROUTE_DECODER(decode_netconfmsg) +{ + struct netconfmsg ncm = { .ncm_family = family }; + + PRINT_FIELD_XVAL("{", ncm, ncm_family, addrfams, "AF_???"); + tprints("}"); + + const size_t offset = NLMSG_ALIGN(sizeof(ncm)); + if (len > offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + rtnl_netconf_attrs, "NETCONFA_???", + netconfmsg_nla_decoders, + ARRAY_SIZE(netconfmsg_nla_decoders), NULL); + } +} + +#endif diff --git a/rtnl_nsid.c b/rtnl_nsid.c new file mode 100644 index 00000000..759d9bf1 --- /dev/null +++ b/rtnl_nsid.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2016-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "netlink_route.h" +#include "nlattr.h" +#include "print_fields.h" + +#include "netlink.h" +#include + +#include "xlat/rtnl_nsid_attrs.h" + +static const nla_decoder_t rtgenmsg_nla_decoders[] = { + [NETNSA_NSID] = decode_nla_s32, + [NETNSA_PID] = decode_nla_u32, + [NETNSA_FD] = decode_nla_fd, + [NETNSA_TARGET_NSID] = decode_nla_s32, + [NETNSA_CURRENT_NSID] = decode_nla_s32 +}; + +DECL_NETLINK_ROUTE_DECODER(decode_rtgenmsg) +{ + struct rtgenmsg rtgenmsg = { .rtgen_family = family }; + + PRINT_FIELD_XVAL("{", rtgenmsg, rtgen_family, addrfams, "AF_???"); + tprints("}"); + + const size_t offset = NLMSG_ALIGN(sizeof(rtgenmsg)); + if (len > offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + rtnl_nsid_attrs, "NETNSA_???", + rtgenmsg_nla_decoders, + ARRAY_SIZE(rtgenmsg_nla_decoders), NULL); + } +} diff --git a/rtnl_route.c b/rtnl_route.c new file mode 100644 index 00000000..f1bca94d --- /dev/null +++ b/rtnl_route.c @@ -0,0 +1,312 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "netlink_route.h" +#include "nlattr.h" +#include "print_fields.h" + +#include +#include "netlink.h" +#include + +#include "xlat/ip_type_of_services.h" +#include "xlat/lwtunnel_encap_types.h" +#include "xlat/route_nexthop_flags.h" +#include "xlat/routing_flags.h" +#include "xlat/routing_protocols.h" +#include "xlat/routing_table_ids.h" +#include "xlat/routing_types.h" +#include "xlat/rtnl_route_attrs.h" +#include "xlat/rtnl_rta_metrics_attrs.h" + +bool +decode_nla_rt_class(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + uint32_t num; + + if (len < sizeof(num)) + return false; + if (!umove_or_printaddr(tcp, addr, &num)) + printxval(routing_table_ids, num, NULL); + return true; +} + +bool +decode_nla_rt_proto(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + uint8_t num; + + if (len < sizeof(num)) + return false; + if (!umove_or_printaddr(tcp, addr, &num)) + printxval_search(routing_protocols, num, "RTPROT_???"); + return true; +} + +static bool +decode_route_addr(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + const struct rtmsg *const rtmsg = opaque_data; + + decode_inet_addr(tcp, addr, len, rtmsg->rtm_family, NULL); + + return true; +} + +static const nla_decoder_t rta_metrics_nla_decoders[] = { + [RTAX_LOCK] = decode_nla_u32, + [RTAX_MTU] = decode_nla_u32, + [RTAX_WINDOW] = decode_nla_u32, + [RTAX_RTT] = decode_nla_u32, + [RTAX_RTTVAR] = decode_nla_u32, + [RTAX_SSTHRESH] = decode_nla_u32, + [RTAX_CWND] = decode_nla_u32, + [RTAX_ADVMSS] = decode_nla_u32, + [RTAX_REORDERING] = decode_nla_u32, + [RTAX_HOPLIMIT] = decode_nla_u32, + [RTAX_INITCWND] = decode_nla_u32, + [RTAX_FEATURES] = decode_nla_u32, + [RTAX_RTO_MIN] = decode_nla_u32, + [RTAX_INITRWND] = decode_nla_u32, + [RTAX_QUICKACK] = decode_nla_u32, + [RTAX_CC_ALGO] = decode_nla_str +}; + +static bool +decode_rta_metrics(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + decode_nlattr(tcp, addr, len, rtnl_rta_metrics_attrs, + "RTAX_???", rta_metrics_nla_decoders, + ARRAY_SIZE(rta_metrics_nla_decoders), opaque_data); + + return true; +} + +static bool +decode_rta_multipath(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data); + +static bool +decode_rta_cacheinfo(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct rta_cacheinfo ci; + + if (len < sizeof(ci)) + return false; + else if (!umove_or_printaddr(tcp, addr, &ci)) { + PRINT_FIELD_U("{", ci, rta_clntref); + PRINT_FIELD_U(", ", ci, rta_lastuse); + PRINT_FIELD_U(", ", ci, rta_expires); + PRINT_FIELD_U(", ", ci, rta_error); + PRINT_FIELD_U(", ", ci, rta_used); + PRINT_FIELD_X(", ", ci, rta_id); + PRINT_FIELD_U(", ", ci, rta_ts); + PRINT_FIELD_U(", ", ci, rta_tsage); + tprints("}"); + } + + return true; +} + +static bool +decode_rta_mfc_stats(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ +#ifdef HAVE_STRUCT_RTA_MFC_STATS + struct rta_mfc_stats mfcs; + + if (len < sizeof(mfcs)) + return false; + else if (!umove_or_printaddr(tcp, addr, &mfcs)) { + PRINT_FIELD_U("{", mfcs, mfcs_packets); + PRINT_FIELD_U(", ", mfcs, mfcs_bytes); + PRINT_FIELD_U(", ", mfcs, mfcs_wrong_if); + tprints("}"); + } + + return true; +#else + return false; +#endif +} + +static bool +decode_rtvia(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ +#ifdef HAVE_STRUCT_RTVIA + struct rtvia via; + + if (len < sizeof(via)) + return false; + else if (!umove_or_printaddr(tcp, addr, &via)) { + PRINT_FIELD_XVAL("{", via, rtvia_family, addrfams, "AF_???"); + + const unsigned int offset = offsetof(struct rtvia, rtvia_addr); + + if (len > offset) { + tprints(", "); + decode_inet_addr(tcp, addr + offset, len - offset, + via.rtvia_family, "rtvia_addr"); + } + tprints("}"); + } + + return true; +#else + return false; +#endif +} + +static bool +decode_rta_encap_type(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + uint16_t type; + + if (len < sizeof(type)) + return false; + else if (!umove_or_printaddr(tcp, addr, &type)) + printxval(lwtunnel_encap_types, type, "LWTUNNEL_ENCAP_???"); + + return true; +} + +static const nla_decoder_t rtmsg_nla_decoders[] = { + [RTA_DST] = decode_route_addr, + [RTA_SRC] = decode_route_addr, + [RTA_IIF] = decode_nla_ifindex, + [RTA_OIF] = decode_nla_ifindex, + [RTA_GATEWAY] = decode_route_addr, + [RTA_PRIORITY] = decode_nla_u32, + [RTA_PREFSRC] = decode_route_addr, + [RTA_METRICS] = decode_rta_metrics, + [RTA_MULTIPATH] = decode_rta_multipath, + [RTA_PROTOINFO] = decode_nla_u32, + [RTA_FLOW] = decode_nla_u32, + [RTA_CACHEINFO] = decode_rta_cacheinfo, + [RTA_SESSION] = NULL, /* unused */ + [RTA_MP_ALGO] = decode_nla_u32, + [RTA_TABLE] = decode_nla_rt_class, + [RTA_MARK] = decode_nla_u32, + [RTA_MFC_STATS] = decode_rta_mfc_stats, + [RTA_VIA] = decode_rtvia, + [RTA_NEWDST] = decode_route_addr, + [RTA_PREF] = decode_nla_u8, + [RTA_ENCAP_TYPE] = decode_rta_encap_type, + [RTA_ENCAP] = NULL, /* unimplemented */ + [RTA_EXPIRES] = decode_nla_u64, + [RTA_PAD] = NULL, + [RTA_UID] = decode_nla_u32, + [RTA_TTL_PROPAGATE] = decode_nla_u8, + [RTA_IP_PROTO] = decode_nla_u8, + [RTA_SPORT] = decode_nla_u16, + [RTA_DPORT] = decode_nla_u16 +}; + +static bool +decode_rta_multipath(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct rtnexthop nh; + + if (len < sizeof(nh)) + return false; + else if (!umove_or_printaddr(tcp, addr, &nh)) { + /* print the whole structure regardless of its rtnh_len */ + PRINT_FIELD_U("{", nh, rtnh_len); + PRINT_FIELD_FLAGS(", ", nh, rtnh_flags, + route_nexthop_flags, "RTNH_F_???"); + PRINT_FIELD_U(", ", nh, rtnh_hops); + PRINT_FIELD_IFINDEX(", ", nh, rtnh_ifindex); + tprints("}"); + + const unsigned short rtnh_len = MIN(len, nh.rtnh_len); + const size_t offset = RTNH_ALIGN(sizeof(nh)); + if (rtnh_len > offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, rtnh_len - offset, + rtnl_route_attrs, "RTA_???", + rtmsg_nla_decoders, + ARRAY_SIZE(rtmsg_nla_decoders), + opaque_data); + } + } + + return true; +} + +DECL_NETLINK_ROUTE_DECODER(decode_rtmsg) +{ + struct rtmsg rtmsg = { .rtm_family = family }; + size_t offset = sizeof(rtmsg.rtm_family); + bool decode_nla = false; + + PRINT_FIELD_XVAL("{", rtmsg, rtm_family, addrfams, "AF_???"); + + tprints(", "); + if (len >= sizeof(rtmsg)) { + if (!umoven_or_printaddr(tcp, addr + offset, + sizeof(rtmsg) - offset, + (char *) &rtmsg + offset)) { + PRINT_FIELD_U("", rtmsg, rtm_dst_len); + PRINT_FIELD_U(", ", rtmsg, rtm_src_len); + PRINT_FIELD_FLAGS(", ", rtmsg, rtm_tos, + ip_type_of_services, "IPTOS_TOS_???"); + PRINT_FIELD_XVAL(", ", rtmsg, rtm_table, + routing_table_ids, NULL); + PRINT_FIELD_XVAL(", ", rtmsg, rtm_protocol, + routing_protocols, "RTPROT_???"); + PRINT_FIELD_XVAL(", ", rtmsg, rtm_scope, + routing_scopes, NULL); + PRINT_FIELD_XVAL(", ", rtmsg, rtm_type, + routing_types, "RTN_???"); + PRINT_FIELD_FLAGS(", ", rtmsg, rtm_flags, + routing_flags, "RTM_F_???"); + decode_nla = true; + } + } else + tprints("..."); + tprints("}"); + + offset = NLMSG_ALIGN(sizeof(rtmsg)); + if (decode_nla && len > offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + rtnl_route_attrs, "RTA_???", + rtmsg_nla_decoders, + ARRAY_SIZE(rtmsg_nla_decoders), &rtmsg); + } +} diff --git a/rtnl_rule.c b/rtnl_rule.c new file mode 100644 index 00000000..7c628dbd --- /dev/null +++ b/rtnl_rule.c @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#include "netlink_route.h" +#include "nlattr.h" +#include "print_fields.h" + +#include "netlink.h" +#include +#ifdef HAVE_LINUX_FIB_RULES_H +# include +#endif + +#include "xlat/fib_rule_actions.h" +#include "xlat/fib_rule_flags.h" +#include "xlat/rtnl_rule_attrs.h" + +static bool +decode_rule_addr(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + const struct rtmsg *const rtmsg = opaque_data; + + decode_inet_addr(tcp, addr, len, rtmsg->rtm_family, NULL); + + return true; +} + +static bool +decode_fib_rule_uid_range(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ +#ifdef HAVE_STRUCT_FIB_RULE_UID_RANGE + struct fib_rule_uid_range range; + + if (len < sizeof(range)) + return false; + else if (!umove_or_printaddr(tcp, addr, &range)) { + PRINT_FIELD_U("{", range, start); + PRINT_FIELD_U(", ", range, end); + tprints("}"); + } + + return true; +#else + return false; +#endif +} + +static bool +decode_rule_port_range(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct /* fib_rule_port_range */ { + uint16_t start; + uint16_t end; + } range; + + if (len < sizeof(range)) + return false; + else if (!umove_or_printaddr(tcp, addr, &range)) { + PRINT_FIELD_U("{", range, start); + PRINT_FIELD_U(", ", range, end); + tprints("}"); + } + + return true; +} + +static const nla_decoder_t fib_rule_hdr_nla_decoders[] = { + [FRA_DST] = decode_rule_addr, + [FRA_SRC] = decode_rule_addr, + [FRA_IIFNAME] = decode_nla_str, + [FRA_GOTO] = decode_nla_u32, + [FRA_PRIORITY] = decode_nla_u32, + [FRA_FWMARK] = decode_nla_u32, + [FRA_FLOW] = decode_nla_u32, + [FRA_TUN_ID] = decode_nla_be64, + [FRA_SUPPRESS_IFGROUP] = decode_nla_u32, + [FRA_SUPPRESS_PREFIXLEN] = decode_nla_u32, + [FRA_TABLE] = decode_nla_rt_class, + [FRA_FWMASK] = decode_nla_u32, + [FRA_OIFNAME] = decode_nla_str, + [FRA_PAD] = NULL, + [FRA_L3MDEV] = decode_nla_u8, + [FRA_UID_RANGE] = decode_fib_rule_uid_range, + [FRA_PROTOCOL] = decode_nla_rt_proto, + [FRA_IP_PROTO] = decode_nla_ip_proto, + [FRA_SPORT_RANGE] = decode_rule_port_range, + [FRA_DPORT_RANGE] = decode_rule_port_range, +}; + +DECL_NETLINK_ROUTE_DECODER(decode_fib_rule_hdr) +{ + /* + * struct rtmsg and struct fib_rule_hdr are essentially + * the same structure, use struct rtmsg but treat it as + * struct fib_rule_hdr. + */ + struct rtmsg msg = { .rtm_family = family }; + size_t offset = sizeof(msg.rtm_family); + bool decode_nla = false; + + tprints("{family="); + printxval(addrfams, msg.rtm_family, "AF_???"); + + tprints(", "); + if (len >= sizeof(msg)) { + if (!umoven_or_printaddr(tcp, addr + offset, + sizeof(msg) - offset, + (char *) &msg + offset)) { + tprintf("dst_len=%u, src_len=%u", + msg.rtm_dst_len, msg.rtm_src_len); + tprints(", tos="); + printflags(ip_type_of_services, msg.rtm_tos, + "IPTOS_TOS_???"); + tprints(", table="); + printxval(routing_table_ids, msg.rtm_table, NULL); + tprints(", action="); + printxval(fib_rule_actions, msg.rtm_type, "FR_ACT_???"); + tprints(", flags="); + printflags(fib_rule_flags, msg.rtm_flags, + "FIB_RULE_???"); + decode_nla = true; + } + } else + tprints("..."); + tprints("}"); + + offset = NLMSG_ALIGN(sizeof(msg)); + if (decode_nla && len > offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + rtnl_rule_attrs, "FRA_???", + fib_rule_hdr_nla_decoders, + ARRAY_SIZE(fib_rule_hdr_nla_decoders), &msg); + } +} diff --git a/rtnl_tc.c b/rtnl_tc.c new file mode 100644 index 00000000..dd056e19 --- /dev/null +++ b/rtnl_tc.c @@ -0,0 +1,313 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "netlink_route.h" +#include "nlattr.h" +#include "print_fields.h" + +#include "netlink.h" +#ifdef HAVE_STRUCT_GNET_STATS_BASIC +# include +#endif +#include +#include + +#include "xlat/rtnl_tc_attrs.h" +#include "xlat/rtnl_tca_stab_attrs.h" +#include "xlat/rtnl_tca_stats_attrs.h" + +static bool +decode_tc_stats(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct tc_stats st; + const unsigned int sizeof_tc_stats = + offsetofend(struct tc_stats, backlog); + + if (len < sizeof_tc_stats) + return false; + else if (!umoven_or_printaddr(tcp, addr, sizeof_tc_stats, &st)) { + PRINT_FIELD_U("{", st, bytes); + PRINT_FIELD_U(", ", st, packets); + PRINT_FIELD_U(", ", st, drops); + PRINT_FIELD_U(", ", st, overlimits); + PRINT_FIELD_U(", ", st, bps); + PRINT_FIELD_U(", ", st, pps); + PRINT_FIELD_U(", ", st, qlen); + PRINT_FIELD_U(", ", st, backlog); + tprints("}"); + } + + return true; +} + +static bool +decode_tc_estimator(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + struct tc_estimator est; + + if (len < sizeof(est)) + return false; + else if (!umove_or_printaddr(tcp, addr, &est)) { + PRINT_FIELD_D("{", est, interval); + PRINT_FIELD_U(", ", est, ewma_log); + tprints("}"); + } + + return true; +} + +static bool +decode_gnet_stats_basic(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ +#ifdef HAVE_STRUCT_GNET_STATS_BASIC + struct gnet_stats_basic sb; + const unsigned int sizeof_st_basic = + offsetofend(struct gnet_stats_basic, packets); + + if (len < sizeof_st_basic) + return false; + else if (!umoven_or_printaddr(tcp, addr, sizeof_st_basic, &sb)) { + PRINT_FIELD_U("{", sb, bytes); + PRINT_FIELD_U(", ", sb, packets); + tprints("}"); + } + + return true; +#else + return false; +#endif +} + +static bool +decode_gnet_stats_rate_est(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ +#ifdef HAVE_STRUCT_GNET_STATS_RATE_EST + struct gnet_stats_rate_est est; + + if (len < sizeof(est)) + return false; + else if (!umove_or_printaddr(tcp, addr, &est)) { + PRINT_FIELD_U("{", est, bps); + PRINT_FIELD_U(", ", est, pps); + tprints("}"); + } + + return true; +#else + return false; +#endif +} + +static bool +decode_gnet_stats_queue(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ +#ifdef HAVE_STRUCT_GNET_STATS_QUEUE + struct gnet_stats_queue qstats; + + if (len < sizeof(qstats)) + return false; + else if (!umove_or_printaddr(tcp, addr, &qstats)) { + PRINT_FIELD_U("{", qstats, qlen); + PRINT_FIELD_U(", ", qstats, backlog); + PRINT_FIELD_U(", ", qstats, drops); + PRINT_FIELD_U(", ", qstats, requeues); + PRINT_FIELD_U(", ", qstats, overlimits); + tprints("}"); + } + + return true; +#else + return false; +#endif +} + +static bool +decode_gnet_stats_rate_est64(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ +#ifdef HAVE_STRUCT_GNET_STATS_RATE_EST64 + struct gnet_stats_rate_est64 est; + + if (len < sizeof(est)) + return false; + else if (!umove_or_printaddr(tcp, addr, &est)) { + PRINT_FIELD_U("{", est, bps); + PRINT_FIELD_U(", ", est, pps); + tprints("}"); + } + + return true; +#else + return false; +#endif +} + +static const nla_decoder_t tca_stats_nla_decoders[] = { + [TCA_STATS_BASIC] = decode_gnet_stats_basic, + [TCA_STATS_RATE_EST] = decode_gnet_stats_rate_est, + [TCA_STATS_QUEUE] = decode_gnet_stats_queue, + [TCA_STATS_APP] = NULL, /* unimplemented */ + [TCA_STATS_RATE_EST64] = decode_gnet_stats_rate_est64, + [TCA_STATS_PAD] = NULL, + [TCA_STATS_BASIC_HW] = decode_gnet_stats_basic, +}; + +bool +decode_nla_tc_stats(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + decode_nlattr(tcp, addr, len, rtnl_tca_stats_attrs, "TCA_STATS_???", + tca_stats_nla_decoders, + ARRAY_SIZE(tca_stats_nla_decoders), opaque_data); + + return true; +} + +static bool +decode_tc_sizespec(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ +#ifdef HAVE_STRUCT_TC_SIZESPEC + struct tc_sizespec s; + + if (len < sizeof(s)) + return false; + else if (!umove_or_printaddr(tcp, addr, &s)) { + PRINT_FIELD_U("{", s, cell_log); + PRINT_FIELD_U(", ", s, size_log); + PRINT_FIELD_D(", ", s, cell_align); + PRINT_FIELD_D(", ", s, overhead); + PRINT_FIELD_U(", ", s, linklayer); + PRINT_FIELD_U(", ", s, mpu); + PRINT_FIELD_U(", ", s, mtu); + PRINT_FIELD_U(", ", s, tsize); + tprints("}"); + } + + return true; +#else + return false; +#endif +} + +static bool +print_stab_data(struct tcb *const tcp, void *const elem_buf, + const size_t elem_size, void *const opaque_data) +{ + tprintf("%" PRIu16, *(uint16_t *) elem_buf); + + return true; +} + +static bool +decode_tca_stab_data(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + uint16_t data; + const size_t nmemb = len / sizeof(data); + + if (!nmemb) + return false; + + print_array(tcp, addr, nmemb, &data, sizeof(data), + tfetch_mem, print_stab_data, NULL); + + return true; +} + +static const nla_decoder_t tca_stab_nla_decoders[] = { + [TCA_STAB_BASE] = decode_tc_sizespec, + [TCA_STAB_DATA] = decode_tca_stab_data +}; + +static bool +decode_tca_stab(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const void *const opaque_data) +{ + decode_nlattr(tcp, addr, len, rtnl_tca_stab_attrs, "TCA_STAB_???", + tca_stab_nla_decoders, + ARRAY_SIZE(tca_stab_nla_decoders), opaque_data); + + return true; +} + +static const nla_decoder_t tcmsg_nla_decoders[] = { + [TCA_KIND] = decode_nla_str, + [TCA_OPTIONS] = NULL, /* unimplemented */ + [TCA_STATS] = decode_tc_stats, + [TCA_XSTATS] = NULL, /* unimplemented */ + [TCA_RATE] = decode_tc_estimator, + [TCA_FCNT] = decode_nla_u32, + [TCA_STATS2] = decode_nla_tc_stats, + [TCA_STAB] = decode_tca_stab, + [TCA_PAD] = NULL, + [TCA_DUMP_INVISIBLE] = NULL, + [TCA_CHAIN] = decode_nla_u32, + [TCA_HW_OFFLOAD] = decode_nla_u8, + [TCA_INGRESS_BLOCK] = decode_nla_u32, + [TCA_EGRESS_BLOCK] = decode_nla_u32, +}; + +DECL_NETLINK_ROUTE_DECODER(decode_tcmsg) +{ + struct tcmsg tcmsg = { .tcm_family = family }; + size_t offset = sizeof(tcmsg.tcm_family); + bool decode_nla = false; + + PRINT_FIELD_XVAL("{", tcmsg, tcm_family, addrfams, "AF_???"); + + tprints(", "); + if (len >= sizeof(tcmsg)) { + if (!umoven_or_printaddr(tcp, addr + offset, + sizeof(tcmsg) - offset, + (char *) &tcmsg + offset)) { + PRINT_FIELD_IFINDEX("", tcmsg, tcm_ifindex); + PRINT_FIELD_U(", ", tcmsg, tcm_handle); + PRINT_FIELD_U(", ", tcmsg, tcm_parent); + PRINT_FIELD_U(", ", tcmsg, tcm_info); + decode_nla = true; + } + } else + tprints("..."); + tprints("}"); + + offset = NLMSG_ALIGN(sizeof(tcmsg)); + if (decode_nla && len > offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + rtnl_tc_attrs, "TCA_???", tcmsg_nla_decoders, + ARRAY_SIZE(tcmsg_nla_decoders), NULL); + } +} diff --git a/rtnl_tc_action.c b/rtnl_tc_action.c new file mode 100644 index 00000000..b23d84d6 --- /dev/null +++ b/rtnl_tc_action.c @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "netlink_route.h" +#include "nlattr.h" +#include "print_fields.h" + +#include "netlink.h" +#include + +#include "xlat/rtnl_tc_action_attrs.h" + +static const nla_decoder_t tcamsg_nla_decoders[] = { + [TCA_ACT_KIND] = decode_nla_str, + [TCA_ACT_OPTIONS] = NULL, /* unimplemented */ + [TCA_ACT_INDEX] = decode_nla_u32, + [TCA_ACT_STATS] = decode_nla_tc_stats, + [TCA_ACT_PAD] = NULL, + [TCA_ACT_COOKIE] = NULL /* default parser */ +}; + +DECL_NETLINK_ROUTE_DECODER(decode_tcamsg) +{ + struct tcamsg tca = { .tca_family = family }; + + PRINT_FIELD_XVAL("{", tca, tca_family, addrfams, "AF_???"); + tprints("}"); + + const size_t offset = NLMSG_ALIGN(sizeof(tca)); + if (len > offset) { + tprints(", "); + decode_nlattr(tcp, addr + offset, len - offset, + rtnl_tc_action_attrs, "TCA_ACT_???", + tcamsg_nla_decoders, + ARRAY_SIZE(tcamsg_nla_decoders), NULL); + } +} diff --git a/s390.c b/s390.c new file mode 100644 index 00000000..a650b23f --- /dev/null +++ b/s390.c @@ -0,0 +1,1244 @@ +/* + * s390-specific syscalls decoders. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#if defined S390 || defined S390X + +# include + +# include "print_fields.h" + +# include "xlat/s390_guarded_storage_commands.h" +# include "xlat/s390_runtime_instr_commands.h" +# include "xlat/s390_sthyi_function_codes.h" + +/* + * Since, for some reason, kernel doesn't expose all these nice constants and + * structures in UAPI, we have to re-declare them ourselves. + */ + +/** + * "The header section is placed at the beginning of the response buffer and + * identifies the location and length of all other sections. Valid sections have + * nonzero offset values in the header. Each section provides information about + * validity of fields within that section." + */ +struct sthyi_hdr { + /** + * Header Flag Byte 1 - These flag settings indicate the environment + * that the instruction was executed in and may influence the value of + * the validity bits. The validity bits, and not these flags, should be + * used to determine if a field is valid. + * - 0x80 - Global Performance Data unavailable + * - 0x40 - One or more hypervisor levels below this level does not + * support the STHYI instruction. When this flag is set the + * value of INFGPDU is not meaningful because the state of the + * Global Performance Data setting cannot be determined. + * - 0x20 - Virtualization stack is incomplete. This bit indicates one + * of two cases: + * - One or more hypervisor levels does not support the STHYI + * instruction. For this case, INFSTHYI will also be set. + * - There were more than three levels of guest/hypervisor information + * to report. + * - 0x10 - Execution environment is not within a logical partition. + */ + uint8_t infhflg1; + uint8_t infhflg2; /**< Header Flag Byte 2 reserved for IBM(R) use */ + uint8_t infhval1; /**< Header Validity Byte 1 reserved for IBM use */ + uint8_t infhval2; /**< Header Validity Byte 2 reserved for IBM use */ + char reserved_1__[3]; /**< Reserved for future IBM use */ + uint8_t infhygct; /**< Count of Hypervisor and Guest Sections */ + uint16_t infhtotl; /**< Total length of response buffer */ + uint16_t infhdln; /**< Length of Header Section mapped by INF0HDR */ + uint16_t infmoff; /**< Offset to Machine Section mapped by INF0MAC */ + uint16_t infmlen; /**< Length of Machine Section */ + uint16_t infpoff; /**< Offset to Partition Section mapped by INF0PAR */ + uint16_t infplen; /**< Length of Partition Section */ + uint16_t infhoff1; /**< Offset to Hypervisor Section1 mapped by INF0HYP */ + uint16_t infhlen1; /**< Length of Hypervisor Section1 */ + uint16_t infgoff1; /**< Offset to Guest Section1 mapped by INF0GST */ + uint16_t infglen1; /**< Length of Guest Section1 */ + uint16_t infhoff2; /**< Offset to Hypervisor Section2 mapped by INF0HYP */ + uint16_t infhlen2; /**< Length of Hypervisor Section2 */ + uint16_t infgoff2; /**< Offset to Guest Section2 mapped by INF0GST */ + uint16_t infglen2; /**< Length of Guest Section2 */ + uint16_t infhoff3; /**< Offset to Hypervisor Section3 mapped by INF0HYP */ + uint16_t infhlen3; /**< Length of Hypervisor Section3 */ + uint16_t infgoff3; /**< Offset to Guest Section3 mapped by INF0GST */ + uint16_t infglen3; /**< Length of Guest Section3 */ + /* 44 bytes in total */ +} ATTRIBUTE_PACKED; + +struct sthyi_machine { + uint8_t infmflg1; /**< Machine Flag Byte 1 reserved for IBM use */ + uint8_t infmflg2; /**< Machine Flag Byte 2 reserved for IBM use */ + /** + * Machine Validity Byte 1 + * - 0x80 - Processor Count Validity. When this bit is on, it indicates + * that INFMSCPS, INFMDCPS, INFMSIFL, and INFMDIFL contain + * valid counts. The validity bit may be off when: + * - STHYI support is not available on a lower level hypervisor, or + * - Global Performance Data is not enabled. + * - 0x40 - Machine ID Validity. This bit being on indicates that a + * SYSIB 1.1.1 was obtained from STSI and information reported + * in the following fields is valid: INFMTYPE, INFMMANU, + * INFMSEQ, and INFMPMAN. + * - 0x20 - Machine Name Validity. This bit being on indicates that the + * INFMNAME field is valid. + */ + uint8_t infmval1; + uint8_t infmval2; /**< Machine Validity Byte 2 reserved for IBM use */ + /** + * Number of shared CPs configured in the machine or in the physical + * partition if the system is physically partitioned. + */ + uint16_t infmscps; + /** + * Number of dedicated CPs configured in this machine or in the physical + * partition if the system is physically partitioned. + */ + uint16_t infmdcps; + /** + * Number of shared IFLs configured in this machine or in the physical + * partition if the system is physically partitioned. + */ + uint16_t infmsifl; + /** + * Number of dedicated IFLs configured in this machine or in the + * physical partition if the system is physically partitioned. + */ + uint16_t infmdifl; + char infmname[8]; /**< EBCDIC Machine Name */ + char infmtype[4]; /**< EBCDIC Type */ + char infmmanu[16]; /**< EBCDIC Manufacturer */ + char infmseq[16]; /**< EBCDIC Sequence Code */ + char infmpman[4]; /**< EBCDIC Plant of Manufacture */ + /* 60 bytes in total*/ +} ATTRIBUTE_PACKED; + +struct sthyi_partition { + /** + * Partition Flag Byte 1 + * - 0x80 - Multithreading (MT) is enabled. + */ + uint8_t infpflg1; + /** Partition Flag Byte 2 reserved for IBM use */ + uint8_t infpflg2; + /** + * Partition Validity Byte 1 + * - 0x80 - Processor count validity. This bit being on indicates that + * INFPSCPS, INFPDCPS, INFPSIFL, and INFPDIFL contain valid + * counts. + * - 0x40 - Partition weight-based capped capacity validity. This bit + * being on indicates that INFPWBCP and INFPWBIF are valid + * - 0x20 - Partition absolute capped capacity validity. This bit being + * on indicates that INFPABCP and INFPABIF are valid. + * - 0x10 - Partition ID validity. This bit being on indicates that a + * SYSIB 2.2.2 was obtained from STSI and information reported + * in the following fields is valid: INFPPNUM and INFPPNAM. + * - 0x08 - LPAR group absolute capacity capping information validity. + * This bit being on indicates that INFPLGNM, INFPLGCP, and + * INFPLGIF are valid. + */ + uint8_t infpval1; + /** Partition Validity Byte 2 reserved for IBM use */ + uint8_t infpval2; + /** Logical partition number */ + uint16_t infppnum; + /** + * Number of shared logical CPs configured for this partition. Count + * of cores when MT is enabled. + */ + uint16_t infpscps; + /** + * Number of dedicated logical CPs configured for this partition. Count + * of cores when MT is enabled. + */ + uint16_t infpdcps; + /** + * Number of shared logical IFLs configured for this partition. Count + * of cores when MT is enabled. + */ + uint16_t infpsifl; + /** + * Number of dedicated logical IFLs configured for this partition. + * Count of cores when MT is enabled. + */ + uint16_t infpdifl; + /** Reserved for future IBM use */ + char reserved_1__[2]; + /** EBCIDIC Logical partition name */ + char infppnam[8]; + /** + * Partition weight-based capped capacity for CPs, a scaled number where + * 0x00010000 represents one core. Zero if not capped. + */ + uint32_t infpwbcp; + /** + * Partition absolute capped capacity for CPs, a scaled number where + * 0x00010000 represents one core. Zero if not capped. + */ + uint32_t infpabcp; + /** + * Partition weight-based capped capacity for IFLs, a scaled number + * where 0x00010000 represents one core. Zero if not capped. + */ + uint32_t infpwbif; + /** + * Partition absolute capped capacity for IFLs, a scaled number where + * 0x00010000 represents one core. Zero if not capped. + */ + uint32_t infpabif; + /** + * EBCIDIC LPAR group name. Binary zeros when the partition is not in + * an LPAR group. EBCDIC and padded with blanks on the right when in a + * group. The group name is reported only when there is a group cap on + * CP or IFL CPU types and the partition has the capped CPU type. + */ + char infplgnm[8]; + /** + * LPAR group absolute capacity value for CP CPU type when nonzero. This + * field will be nonzero only when INFPLGNM is nonzero and a cap is + * defined for the LPAR group for the CP CPU type. When nonzero, + * contains a scaled number where 0x00010000 represents one core. + */ + uint32_t infplgcp; + /** + * LPAR group absolute capacity value for IFL CPU type when nonzero. + * This field will be nonzero only when INFPLGNM is nonzero and a cap + * is defined for the LPAR group for the IFL CPU type. When nonzero, + * contains a scaled number where 0x00010000 represents one core. + */ + uint32_t infplgif; + /* 56 bytes */ +} ATTRIBUTE_PACKED; + +struct sthyi_hypervisor { + /** + * Hypervisor Flag Byte 1 + * - 0x80 - Guest CPU usage hard limiting is using the consumption + * method. + * - 0x40 - If on, LIMITHARD caps use prorated core time for capping. + * If off, raw CPU time is used. + */ + uint8_t infyflg1; + uint8_t infyflg2; /**< Hypervisor Flag Byte 2 reserved for IBM use */ + uint8_t infyval1; /**< Hypervisor Validity Byte 1 reserved for IBM use */ + uint8_t infyval2; /**< Hypervisor Validity Byte 2 reserved for IBM use */ + /** + * Hypervisor Type + * - 1 - z/VM is the hypervisor. + */ + uint8_t infytype; + char reserved_1__[1]; /**< Reserved for future IBM use */ + /** + * Threads in use per CP core. Only valid when MT enabled + * (INFPFLG1 0x80 is ON). + */ + uint8_t infycpt; + /** + * Threads in use per IFL core. Only valid when MT enabled + * (INFPFLG1 0x80 is ON). + */ + uint8_t infyiflt; + /** + * EBCID System Identifier. Left justified and padded with blanks. + * This field will be blanks if non-existent. + */ + char infysyid[8]; + /** + * EBCID Cluster Name. Left justified and padded with blanks. This is + * the name on the SSI statement in the system configuration file. This + * field will be blanks if nonexistent. + */ + char infyclnm[8]; + /** + * Total number of CPs shared among guests of this hypervisor. + * Number of cores when MT enabled. + */ + uint16_t infyscps; + /** + * Total number of CPs dedicated to guests of this hypervisor. + * Number of cores when MT enabled. + */ + uint16_t infydcps; + /** + * Total number of IFLs shared among guests of this hypervisor. + * Number of cores when MT enabled. + */ + uint16_t infysifl; + /** + * Total number of IFLs dedicated to guests of this hypervisor. + * Number of cores when MT enabled. + */ + uint16_t infydifl; + /* 32 bytes */ +} ATTRIBUTE_PACKED; + +struct sthyi_guest { + /** + * Guest Flag Byte 1 + * - 0x80 - Guest is mobility enabled + * - 0x40 - Guest has multiple virtual CPU types + * - 0x20 - Guest CP dispatch type has LIMITHARD cap + * - 0x10 - Guest IFL dispatch type has LIMITHARD cap + * - 0x08 - Virtual CPs are thread dispatched + * - 0x04 - Virtual IFLs are thread dispatched + */ + uint8_t infgflg1; + uint8_t infgflg2; /**< Guest Flag Byte 2 reserved for IBM use */ + uint8_t infgval1; /**< Guest Validity Byte 1 reserved for IBM use */ + uint8_t infgval2; /**< Guest Validity Byte 2 reserved for IBM use */ + char infgusid[8]; /**< EBCDIC Userid */ + uint16_t infgscps; /**< Number of guest shared CPs */ + uint16_t infgdcps; /**< Number of guest dedicated CPs */ + /** + * Dispatch type for guest CPs. This field is valid if INFGSCPS or + * INFGDCPS is greater than zero. + * - 0 - General Purpose (CP) + */ + uint8_t infgcpdt; + char reserved_1__[3]; /**< Reserved for future IBM use */ + /** + * Guest current capped capacity for shared virtual CPs, a scaled number + * where 0x00010000 represents one core. This field is zero to + * indicate not capped when: + * - There is no CP individual limit (that is, the "Guest CP dispatch + * type has LIMITHARD cap" bit in field INFGFLG1 is OFF). + * - There are no shared CPs on the system (that is, INFYSCPS = 0). + * If there is a CP limit but there are no shared CPs or virtual CPs, + * the limit is meaningless and does not apply to anything. + */ + uint32_t infgcpcc; + uint16_t infgsifl; /**< Number of guest shared IFLs */ + uint16_t infgdifl; /**< Number of guest dedicated IFLs */ + /** + * Dispatch type for guest IFLs. This field is valid if INFGSIFL or + * INFGDIFL is greater than zero. + * - 0 - General Purpose (CP) + * - 3 - Integrated Facility for Linux (IFL) + */ + uint8_t infgifdt; + char reserved_2__[3]; /**< Reserved for future IBM use */ + /** + * Guest current capped capacity for shared virtual IFLs, a scaled + * number where 0x00010000 represents one core. This field is zero + * to indicate not capped with an IFL limit when: + * - There is no IFL individual limit (that is, the "Guest IFL dispatch + * type has LIMITHARD cap" bit in field INFGFLG1 is OFF). + * - The guest's IFLs are dispatched on CPs (that is, INFGIFDT = 00). + * When the guest's IFLs are dispatched on CPs, the CP individual + * limit (in INFGCPCC) is applied to the guest's virtual IFLs and + * virtual CPs. + */ + uint32_t infgifcc; + /** + * CPU Pool Capping Flags + * - 0x80 - CPU Pool's CP virtual type has LIMITHARD cap + * - 0x40 - CPU Pool's CP virtual type has CAPACITY cap + * - 0x20 - CPU Pool's IFL virtual type has LIMITHARD cap + * - 0x10 - CPU Pool's IFL virtual type has CAPACITY cap + * - 0x08 - CPU Pool uses prorated core time. + */ + uint8_t infgpflg; + char reserved_3__[3]; /**< Reserved for future IBM use */ + /** + * EBCDIC CPU Pool Name. This field will be blanks if the guest is not + * in a CPU Pool. + */ + char infgpnam[8]; + /** + * CPU Pool capped capacity for shared virtual CPs, a scaled number + * where 0x00010000 represents one core. This field will be zero if + * not capped. + */ + uint32_t infgpccc; + /** + * CPU Pool capped capacity for shared virtual IFLs, a scaled number + * where 0x00010000 represents one core. This field will be zero if + * not capped. + */ + uint32_t infgpicc; + /* 56 bytes */ +} ATTRIBUTE_PACKED; + + +static void +decode_ebcdic(const char *ebcdic, char *ascii, size_t size) +{ + /* + * This is mostly Linux's EBCDIC-ASCII conversion table, except for + * various non-representable characters that are converted to spaces for + * readability purposes, as it is intended to be a hint for the string + * contents and not precise conversion. + */ + static char conv_table[] = + "\0\1\2\3 \11 \177 \13\14\15\16\17" + "\20\21\22\23 \n\10 \30\31 \34\35\36\37" + " \34 \n\27\33 \5\6\7" + " \26 \4 \24\25 \32" + " " " .<(+|" + "& " "!$*);~" + "-/ " "|,%_>?" + " `" ":#@'=\"" + " abcdefghi" " " + " jklmnopqr" " " + " ~stuvwxyz" " " + "^ " "[] " + "{ABCDEFGHI" " " + "}JKLMNOPQR" " " + "\\ STUVWXYZ" " " + "0123456789" " "; + + while (size--) + *ascii++ = conv_table[(unsigned char) *ebcdic++]; +} + +# define DECODE_EBCDIC(ebcdic_, ascii_) \ + decode_ebcdic((ebcdic_), (ascii_), \ + sizeof(ebcdic_) + MUST_BE_ARRAY(ebcdic_)) +# define PRINT_EBCDIC(ebcdic_) \ + do { \ + char ascii_str[sizeof(ebcdic_) + MUST_BE_ARRAY(ebcdic_)]; \ + \ + DECODE_EBCDIC(ebcdic_, ascii_str); \ + print_quoted_string(ascii_str, sizeof(ascii_str), \ + QUOTE_EMIT_COMMENT); \ + } while (0) + +# define PRINT_FIELD_EBCDIC(prefix_, where_, field_) \ + do { \ + PRINT_FIELD_HEX_ARRAY(prefix_, where_, field_); \ + PRINT_EBCDIC((where_).field_); \ + } while (0) + +# define PRINT_FIELD_WEIGHT(prefix_, where_, field_) \ + do { \ + PRINT_FIELD_X(prefix_, where_, field_); \ + if ((where_).field_) \ + tprintf_comment("%u %u/65536 cores", \ + (where_).field_ >> 16, \ + (where_).field_ & 0xFFFF); \ + else \ + tprints_comment("unlimited"); \ + } while (0) + + +# define IS_BLANK(arr_) /* 0x40 is space in EBCDIC */ \ + is_filled(arr_, '\x40', sizeof(arr_) + MUST_BE_ARRAY(arr_)) + +# define CHECK_SIZE(hdr_, size_, name_, ...) \ + do { \ + if ((size_) < sizeof(*(hdr_))) { \ + tprintf_comment("Invalid " name_ " with size " \ + "%hu < %zu expected", \ + ##__VA_ARGS__, \ + (size_), sizeof(*(hdr_))); \ + print_quoted_string((char *) (hdr_), (size_), \ + QUOTE_FORCE_HEX); \ + \ + return; \ + } \ + } while (0) + +# define PRINT_UNKNOWN_TAIL(hdr_, size_) \ + do { \ + if ((size_) > sizeof(*(hdr_)) && \ + !is_filled((char *) ((hdr_) + 1), '\0', \ + (size_) - sizeof(*(hdr_)))) { \ + tprints(", "); \ + print_quoted_string((char *) ((hdr_) + 1), \ + (size_) - sizeof(*(hdr_)), \ + QUOTE_FORCE_HEX); \ + } \ + } while (0) + +static void +print_sthyi_machine(struct tcb *tcp, struct sthyi_machine *hdr, uint16_t size, + bool *dummy) +{ + int cnt_val, name_val, id_val; + + CHECK_SIZE(hdr, size, "machine structure"); + + tprints("/* machine */ {"); + if (!abbrev(tcp)) { + if (hdr->infmflg1) { /* Reserved */ + PRINT_FIELD_0X("", *hdr, infmflg1); + tprints(", "); + } + if (hdr->infmflg2) { /* Reserved */ + PRINT_FIELD_0X(", ", *hdr, infmflg2); + tprints(", "); + } + } + + PRINT_FIELD_0X("", *hdr, infmval1); + cnt_val = !!(hdr->infmval1 & 0x80); + id_val = !!(hdr->infmval1 & 0x40); + name_val = !!(hdr->infmval1 & 0x20); + + if (!abbrev(tcp)) { + if (hdr->infmval1) + tprintf_comment("processor count validity: %d, " + "machine ID validity: %d, " + "machine name validity: %d%s%#.0x%s", + cnt_val, id_val, name_val, + hdr->infmval1 & 0x1F ? ", " : "", + hdr->infmval1 & 0x1F, + hdr->infmval1 & 0x1F ? " - ???" : ""); + if (hdr->infmval2) + PRINT_FIELD_0X(", ", *hdr, infmval2); + } + + if (cnt_val || hdr->infmscps) + PRINT_FIELD_U(", ", *hdr, infmscps); + if (cnt_val || hdr->infmdcps) + PRINT_FIELD_U(", ", *hdr, infmdcps); + if (cnt_val || hdr->infmsifl) + PRINT_FIELD_U(", ", *hdr, infmsifl); + if (cnt_val || hdr->infmdifl) + PRINT_FIELD_U(", ", *hdr, infmdifl); + + if (!abbrev(tcp)) { + if (name_val || hdr->infmname) + PRINT_FIELD_EBCDIC(", ", *hdr, infmname); + + if (id_val || !IS_ARRAY_ZERO(hdr->infmtype)) + PRINT_FIELD_EBCDIC(", ", *hdr, infmtype); + if (id_val || !IS_ARRAY_ZERO(hdr->infmmanu)) + PRINT_FIELD_EBCDIC(", ", *hdr, infmmanu); + if (id_val || !IS_ARRAY_ZERO(hdr->infmseq)) + PRINT_FIELD_EBCDIC(", ", *hdr, infmseq); + if (id_val || !IS_ARRAY_ZERO(hdr->infmpman)) + PRINT_FIELD_EBCDIC(", ", *hdr, infmpman); + + PRINT_UNKNOWN_TAIL(hdr, size); + } else { + tprints(", ..."); + } + + tprints("}"); +} + +static void +print_sthyi_partition(struct tcb *tcp, struct sthyi_partition *hdr, + uint16_t size, bool *mt) +{ + int cnt_val, wcap_val, acap_val, id_val, lpar_val; + + *mt = false; + + CHECK_SIZE(hdr, size, "partition structure"); + + *mt = !!(hdr->infpflg1 & 0x80); + + PRINT_FIELD_0X("/* partition */ {", *hdr, infpflg1); + if (!abbrev(tcp) && hdr->infpflg1) + tprintf_comment("%s%s%#.0x%s", + hdr->infpflg1 & 0x80 ? + "0x80 - multithreading is enabled" : "", + (hdr->infpflg1 & 0x80) && (hdr->infpflg1 & 0x7F) ? + ", " : "", + hdr->infpflg1 & 0x7F, + hdr->infpflg1 & 0x7F ? " - ???" : ""); + if (!abbrev(tcp) && hdr->infpflg2) /* Reserved */ + PRINT_FIELD_0X(", ", *hdr, infpflg2); + + PRINT_FIELD_0X(", ", *hdr, infpval1); + cnt_val = !!(hdr->infpval1 & 0x80); + wcap_val = !!(hdr->infpval1 & 0x40); + acap_val = !!(hdr->infpval1 & 0x20); + id_val = !!(hdr->infpval1 & 0x10); + lpar_val = !!(hdr->infpval1 & 0x08); + + if (!abbrev(tcp) && hdr->infpval1) + tprintf_comment("processor count validity: %d, " + "partition weight-based capacity validity: %d, " + "partition absolute capacity validity: %d, " + "partition ID validity: %d, " + "LPAR group absolute capacity capping " + "information validity: %d%s%#.0x%s", + cnt_val, wcap_val, acap_val, id_val, lpar_val, + hdr->infpval1 & 0x07 ? ", " : "", + hdr->infpval1 & 0x07, + hdr->infpval1 & 0x07 ? " - ???" : ""); + if (!abbrev(tcp) && hdr->infpval2) /* Reserved */ + PRINT_FIELD_0X(", ", *hdr, infpval2); + + if (id_val || hdr->infppnum) + PRINT_FIELD_U(", ", *hdr, infppnum); + + if (cnt_val || hdr->infpscps) + PRINT_FIELD_U(", ", *hdr, infpscps); + if (cnt_val || hdr->infpdcps) + PRINT_FIELD_U(", ", *hdr, infpdcps); + if (cnt_val || hdr->infpsifl) + PRINT_FIELD_U(", ", *hdr, infpsifl); + if (cnt_val || hdr->infpdifl) + PRINT_FIELD_U(", ", *hdr, infpdifl); + + if (!abbrev(tcp) && !IS_ARRAY_ZERO(hdr->reserved_1__)) + PRINT_FIELD_HEX_ARRAY(", ", *hdr, reserved_1__); + + if (id_val || !IS_ARRAY_ZERO(hdr->infppnam)) + PRINT_FIELD_EBCDIC(", ", *hdr, infppnam); + + if (!abbrev(tcp)) { + if (wcap_val || hdr->infpwbcp) + PRINT_FIELD_WEIGHT(", ", *hdr, infpwbcp); + if (acap_val || hdr->infpabcp) + PRINT_FIELD_WEIGHT(", ", *hdr, infpabcp); + if (wcap_val || hdr->infpwbif) + PRINT_FIELD_WEIGHT(", ", *hdr, infpwbif); + if (acap_val || hdr->infpabif) + PRINT_FIELD_WEIGHT(", ", *hdr, infpabif); + + if (!IS_ARRAY_ZERO(hdr->infplgnm)) { + PRINT_FIELD_EBCDIC(", ", *hdr, infplgnm); + + PRINT_FIELD_WEIGHT(", ", *hdr, infplgcp); + PRINT_FIELD_WEIGHT(", ", *hdr, infplgif); + } else { + if (lpar_val) + PRINT_FIELD_HEX_ARRAY(", ", *hdr, infplgnm); + if (hdr->infplgcp) + PRINT_FIELD_X(", ", *hdr, infplgcp); + if (hdr->infplgif) + PRINT_FIELD_X(", ", *hdr, infplgif); + } + + PRINT_UNKNOWN_TAIL(hdr, size); + } else { + tprints(", ..."); + } + + tprints("}"); +} + +static void +print_sthyi_hypervisor(struct tcb *tcp, struct sthyi_hypervisor *hdr, + uint16_t size, int num, bool mt) +{ + CHECK_SIZE(hdr, size, "hypervisor %d structure", num); + + tprintf("/* hypervisor %d */ ", num); + PRINT_FIELD_0X("{", *hdr, infyflg1); + if (!abbrev(tcp) && hdr->infyflg1) + tprintf_comment("%s%s%s%s%#.0x%s", + hdr->infyflg1 & 0x80 ? + "0x80 - guest CPU usage had limiting is using " + "the consumption method" : "", + (hdr->infyflg1 & 0x80) && (hdr->infyflg1 & 0x40) ? + ", " : "", + hdr->infyflg1 & 0x40 ? + "0x40 - LIMITHARD caps use prorated core time " + "for capping" : "", + (hdr->infyflg1 & 0xC0) && (hdr->infyflg1 & 0x3F) ? + ", " : "", + hdr->infyflg1 & 0x3F, + hdr->infyflg1 & 0x3F ? " - ???" : ""); + + if (!abbrev(tcp)) { + if (hdr->infyflg2) /* Reserved */ + PRINT_FIELD_0X(", ", *hdr, infyflg2); + if (hdr->infyval1) /* Reserved */ + PRINT_FIELD_0X(", ", *hdr, infyval1); + if (hdr->infyval2) /* Reserved */ + PRINT_FIELD_0X(", ", *hdr, infyval2); + + PRINT_FIELD_U(", ", *hdr, infytype); + switch (hdr->infytype) { + case 1: + tprints_comment("z/VM is the hypervisor"); + break; + default: + tprints_comment("unknown hypervisor type"); + } + + if (!IS_ARRAY_ZERO(hdr->reserved_1__)) + PRINT_FIELD_HEX_ARRAY(", ", *hdr, reserved_1__); + + if (mt || hdr->infycpt) + PRINT_FIELD_U(", ", *hdr, infycpt); + if (mt || hdr->infyiflt) + PRINT_FIELD_U(", ", *hdr, infyiflt); + } + + if (!abbrev(tcp) || !IS_BLANK(hdr->infysyid)) + PRINT_FIELD_EBCDIC(", ", *hdr, infysyid); + if (!abbrev(tcp) || !IS_BLANK(hdr->infyclnm)) + PRINT_FIELD_EBCDIC(", ", *hdr, infyclnm); + + if (!abbrev(tcp) || hdr->infyscps) + PRINT_FIELD_U(", ", *hdr, infyscps); + if (!abbrev(tcp) || hdr->infydcps) + PRINT_FIELD_U(", ", *hdr, infydcps); + if (!abbrev(tcp) || hdr->infysifl) + PRINT_FIELD_U(", ", *hdr, infysifl); + if (!abbrev(tcp) || hdr->infydifl) + PRINT_FIELD_U(", ", *hdr, infydifl); + + if (!abbrev(tcp)) { + PRINT_UNKNOWN_TAIL(hdr, size); + } else { + tprints(", ..."); + } + + tprints("}"); +} + +static void +print_sthyi_guest(struct tcb *tcp, struct sthyi_guest *hdr, uint16_t size, + int num, bool mt) +{ + CHECK_SIZE(hdr, size, "guest %d structure", num); + + tprintf("/* guest %d */ ", num); + PRINT_FIELD_0X("{", *hdr, infgflg1); + if (!abbrev(tcp) && hdr->infgflg1) + tprintf_comment("%s%s%s%s%s%s%s%s%s%s%s%s%#.0x%s", + hdr->infgflg1 & 0x80 ? + "0x80 - guest is mobility enabled" : "", + (hdr->infgflg1 & 0x80) && (hdr->infgflg1 & 0x40) ? + ", " : "", + hdr->infgflg1 & 0x40 ? + "0x40 - guest has multiple virtual CPU types" : + "", + (hdr->infgflg1 & 0xC0) && (hdr->infgflg1 & 0x20) ? + ", " : "", + hdr->infgflg1 & 0x20 ? + "0x20 - guest CP dispatch type has LIMITHARD " + "cap" : "", + (hdr->infgflg1 & 0xE0) && (hdr->infgflg1 & 0x10) ? + ", " : "", + hdr->infgflg1 & 0x10 ? + "0x10 - guest IFL dispatch type has LIMITHARD " + "cap" : "", + (hdr->infgflg1 & 0xF0) && (hdr->infgflg1 & 0x08) ? + ", " : "", + hdr->infgflg1 & 0x08 ? + "0x08 - virtual CPs are thread dispatched" : + "", + (hdr->infgflg1 & 0xF8) && (hdr->infgflg1 & 0x04) ? + ", " : "", + hdr->infgflg1 & 0x04 ? + "0x04 - virtual IFLs are thread dispatched" : + "", + (hdr->infgflg1 & 0xFC) && (hdr->infgflg1 & 0x03) ? + ", " : "", + hdr->infgflg1 & 0x03, + hdr->infgflg1 & 0x03 ? " - ???" : ""); + if (!abbrev(tcp)) { + if (hdr->infgflg2) /* Reserved */ + PRINT_FIELD_0X(", ", *hdr, infgflg2); + if (hdr->infgval1) /* Reserved */ + PRINT_FIELD_0X(", ", *hdr, infgval1); + if (hdr->infgval2) /* Reserved */ + PRINT_FIELD_0X(", ", *hdr, infgval2); + } + + PRINT_FIELD_EBCDIC(", ", *hdr, infgusid); + + if (!abbrev(tcp) || hdr->infgscps) + PRINT_FIELD_U(", ", *hdr, infgscps); + if (!abbrev(tcp) || hdr->infgdcps) + PRINT_FIELD_U(", ", *hdr, infgdcps); + + if (!abbrev(tcp)) { + PRINT_FIELD_U(", ", *hdr, infgcpdt); + switch (hdr->infgcpdt) { + case 0: + tprints_comment("General Purpose (CP)"); + break; + default: + tprints_comment("unknown"); + } + + if (!IS_ARRAY_ZERO(hdr->reserved_1__)) + PRINT_FIELD_HEX_ARRAY(", ", *hdr, reserved_1__); + } + + if (!abbrev(tcp) || hdr->infgcpcc) + PRINT_FIELD_WEIGHT(", ", *hdr, infgcpcc); + + if (!abbrev(tcp) || hdr->infgsifl) + PRINT_FIELD_U(", ", *hdr, infgsifl); + if (!abbrev(tcp) || hdr->infgdifl) + PRINT_FIELD_U(", ", *hdr, infgdifl); + + if (!abbrev(tcp)) { + PRINT_FIELD_U(", ", *hdr, infgifdt); + switch (hdr->infgifdt) { + case 0: + tprints_comment("General Purpose (CP)"); + break; + case 3: + tprints_comment("Integrated Facility for Linux (IFL)"); + break; + default: + tprints_comment("unknown"); + } + + if (!IS_ARRAY_ZERO(hdr->reserved_2__)) + PRINT_FIELD_HEX_ARRAY(", ", *hdr, reserved_2__); + } + + if (!abbrev(tcp) || hdr->infgifcc) + PRINT_FIELD_WEIGHT(", ", *hdr, infgifcc); + + PRINT_FIELD_0X(", ", *hdr, infgpflg); + if (!abbrev(tcp) && hdr->infgpflg) + tprintf_comment("%s%s%s%s%s%s%s%s%s%s%#.0x%s", + hdr->infgpflg & 0x80 ? + "0x80 - CPU pool's CP virtual type has " + "LIMITHARD cap" : "", + (hdr->infgpflg & 0x80) && (hdr->infgpflg & 0x40) ? + ", " : "", + hdr->infgpflg & 0x40 ? + "0x40 - CPU pool's CP virtual type has " + "CAPACITY cap" : "", + (hdr->infgpflg & 0xC0) && (hdr->infgpflg & 0x20) ? + ", " : "", + hdr->infgpflg & 0x20 ? + "0x20 - CPU pool's IFL virtual type has " + "LIMITHARD cap" : "", + (hdr->infgpflg & 0xE0) && (hdr->infgpflg & 0x10) ? + ", " : "", + hdr->infgpflg & 0x10 ? + "0x10 - CPU pool's IFL virtual type has " + "CAPACITY cap" : "", + (hdr->infgpflg & 0xF0) && (hdr->infgpflg & 0x08) ? + ", " : "", + hdr->infgpflg & 0x08 ? + "0x08 - CPU pool uses prorated core time" : "", + (hdr->infgpflg & 0xF8) && (hdr->infgpflg & 0x07) ? + ", " : "", + hdr->infgpflg & 0x07, + hdr->infgpflg & 0x07 ? " - ???" : ""); + + if (!abbrev(tcp)) { + if (!IS_ARRAY_ZERO(hdr->reserved_3__)) + PRINT_FIELD_HEX_ARRAY(", ", *hdr, reserved_3__); + + if (!IS_BLANK(hdr->infgpnam)) + PRINT_FIELD_EBCDIC(", ", *hdr, infgpnam); + + PRINT_FIELD_WEIGHT(", ", *hdr, infgpccc); + PRINT_FIELD_WEIGHT(", ", *hdr, infgpicc); + + PRINT_UNKNOWN_TAIL(hdr, size); + } else { + tprints(", ..."); + } + + tprints("}"); +} + +# define STHYI_PRINT_STRUCT(l_, name_) \ + do { \ + if (hdr->inf ##l_## off && hdr->inf ##l_## off + \ + hdr->inf ##l_## len <= sizeof(data)) { \ + tprints(", "); \ + print_sthyi_ ##name_(tcp, (struct sthyi_ ##name_ *) \ + (data + hdr->inf ##l_## off), \ + hdr->inf ##l_## len, &mt); \ + } \ + } while (0) + +# define STHYI_PRINT_HV_STRUCT(l_, n_, name_) \ + do { \ + if (hdr->inf ##l_## off ##n_ && hdr->inf ##l_## off ##n_ + \ + hdr->inf ##l_## len ##n_ <= sizeof(data)) { \ + tprints(", "); \ + print_sthyi_ ##name_(tcp, (struct sthyi_ ##name_ *) \ + (data + hdr->inf ##l_## off ##n_), \ + hdr->inf ##l_## len ##n_, n_, mt); \ + } \ + } while (0) + +static void +print_sthyi_buf(struct tcb *tcp, kernel_ulong_t ptr) +{ + char data[PAGE_SIZE]; + struct sthyi_hdr *hdr = (struct sthyi_hdr *) data; + bool mt = false; + + if (umove_or_printaddr(tcp, ptr, &data)) + return; + + tprints("{"); + + /* Header */ + PRINT_FIELD_0X("/* header */ {", *hdr, infhflg1); + + if (abbrev(tcp)) { + tprints(", ..."); + goto sthyi_sections; + } + + if (hdr->infhflg1) + tprintf_comment("%s%s%s%s%s%s%s%s%#.0x%s", + hdr->infhflg1 & 0x80 ? + "0x80 - Global Performance Data unavailable" : + "", + (hdr->infhflg1 & 0x80) && (hdr->infhflg1 & 0x40) ? + ", " : "", + hdr->infhflg1 & 0x40 ? + "0x40 - One or more hypervisor levels below " + "this level does not support the STHYI " + "instruction" : "", + (hdr->infhflg1 & 0xC0) && (hdr->infhflg1 & 0x20) ? + ", " : "", + hdr->infhflg1 & 0x20 ? + "0x20 - Virtualization stack is incomplete" : + "", + (hdr->infhflg1 & 0xE0) && (hdr->infhflg1 & 0x10) ? + ", " : "", + hdr->infhflg1 & 0x10 ? + "0x10 - Execution environment is not within " + "a logical partition" : "", + (hdr->infhflg1 & 0xF0) && (hdr->infhflg1 & 0x0F) ? + ", " : "", + hdr->infhflg1 & 0x0F, + hdr->infhflg1 & 0x0F ? " - ???" : ""); + if (hdr->infhflg2) /* Reserved */ + PRINT_FIELD_0X(", ", *hdr, infhflg2); + if (hdr->infhval1) /* Reserved */ + PRINT_FIELD_0X(", ", *hdr, infhval1); + if (hdr->infhval2) /* Reserved */ + PRINT_FIELD_0X(", ", *hdr, infhval2); + + if (!IS_ARRAY_ZERO(hdr->reserved_1__)) + PRINT_FIELD_HEX_ARRAY(", ", *hdr, reserved_1__); + + PRINT_FIELD_U(", ", *hdr, infhygct); + PRINT_FIELD_U(", ", *hdr, infhtotl); + + PRINT_FIELD_U(", ", *hdr, infhdln); + PRINT_FIELD_U(", ", *hdr, infmoff); + PRINT_FIELD_U(", ", *hdr, infmlen); + PRINT_FIELD_U(", ", *hdr, infpoff); + PRINT_FIELD_U(", ", *hdr, infplen); + + PRINT_FIELD_U(", ", *hdr, infhoff1); + PRINT_FIELD_U(", ", *hdr, infhlen1); + PRINT_FIELD_U(", ", *hdr, infgoff1); + PRINT_FIELD_U(", ", *hdr, infglen1); + PRINT_FIELD_U(", ", *hdr, infhoff2); + PRINT_FIELD_U(", ", *hdr, infhlen2); + PRINT_FIELD_U(", ", *hdr, infgoff2); + PRINT_FIELD_U(", ", *hdr, infglen2); + PRINT_FIELD_U(", ", *hdr, infhoff3); + PRINT_FIELD_U(", ", *hdr, infhlen3); + PRINT_FIELD_U(", ", *hdr, infgoff3); + PRINT_FIELD_U(", ", *hdr, infglen3); + + PRINT_UNKNOWN_TAIL(hdr, hdr->infhdln); + +sthyi_sections: + tprints("}"); + + STHYI_PRINT_STRUCT(m, machine); + STHYI_PRINT_STRUCT(p, partition); + + STHYI_PRINT_HV_STRUCT(h, 1, hypervisor); + STHYI_PRINT_HV_STRUCT(g, 1, guest); + STHYI_PRINT_HV_STRUCT(h, 2, hypervisor); + STHYI_PRINT_HV_STRUCT(g, 2, guest); + STHYI_PRINT_HV_STRUCT(h, 3, hypervisor); + STHYI_PRINT_HV_STRUCT(g, 3, guest); + + tprints("}"); +} + +/** + * Wrapper for the s390 STHYI instruction that provides hypervisor information. + * + * See https://www.ibm.com/support/knowledgecenter/SSB27U_6.3.0/com.ibm.zvm.v630.hcpb4/hcpb4sth.htm + * for the instruction documentation. + * + * The difference in the kernel wrapper is that it doesn't require the 4K + * alignment for the resp_buffer page (as it just copies from the internal + * cache). + */ +SYS_FUNC(s390_sthyi) +{ + /* in, function ID from s390_sthyi_function_codes */ + kernel_ulong_t function_code = tcp->u_arg[0]; + /* out, pointer to page-sized buffer */ + kernel_ulong_t resp_buffer_ptr = tcp->u_arg[1]; + /* out, pointer to u64 containing function result */ + kernel_ulong_t return_code_ptr = tcp->u_arg[2]; + /* in, should be 0, at the moment */ + kernel_ulong_t flags = tcp->u_arg[3]; + + if (entering(tcp)) { + printxval64(s390_sthyi_function_codes, function_code, + "STHYI_FC_???"); + tprints(", "); + } else { + switch (function_code) { + case STHYI_FC_CP_IFL_CAP: + print_sthyi_buf(tcp, resp_buffer_ptr); + break; + + default: + printaddr(resp_buffer_ptr); + } + + tprints(", "); + printnum_int64(tcp, return_code_ptr, "%" PRIu64); + tprintf(", %#" PRI_klx, flags); + } + + return 0; +} + + +/* + * Structures are written based on + * https://www-304.ibm.com/support/docview.wss?uid=isg29c69415c1e82603c852576700058075a&aid=1#page=85 + */ + +struct guard_storage_control_block { + uint64_t reserved; + /** + * Guard Storage Designation + * - Bits 0..J, J == 64-GSC - Guard Storage Origin (GSO) + * - Bits 53..55 - Guard Load Shift (GLS) + * - Bits 58..63 - Guard Storage Characteristic (GSC), this is J from + * the first item, valud values are 25..56. + */ + uint64_t gsd; + uint64_t gssm; /**< Guard Storage Section Mask */ + uint64_t gs_epl_a; /**< Guard Storage Event Parameter List Address */ +}; + +struct guard_storage_event_parameter_list { + uint8_t pad1; + /** + * Guard Storage Event Addressing Mode + * - 0x40 - Extended addressing mode (E) + * - 0x80 - Basic addressing mode (B) + */ + uint8_t gs_eam; + /** + * Guard Storage Event Cause indication + * - 0x01 - CPU was in transaction execution mode (TX) + * - 0x02 - CPU was in constrained transaction execution mode (CX) + * - 0x80 - Instruction causing the event: 0 - LGG, 1 - LLGFGS + */ + uint8_t gs_eci; + /** + * Guard Storage Event Access Information + * - 0x01 - DAT mode + * - Bits 1..2 - Address space indication + * - Bits 4..7 - AR number + */ + uint8_t gs_eai; + uint32_t pad2; + uint64_t gs_eha; /**< Guard Storage Event Handler Address */ + uint64_t gs_eia; /**< Guard Storage Event Instruction Address */ + uint64_t gs_eoa; /**< Guard Storage Event Operation Address */ + uint64_t gs_eir; /**< Guard Storage Event Intermediate Result */ + uint64_t gs_era; /**< Guard Storage Event Return Address */ +}; + +static void +guard_storage_print_gsepl(struct tcb *tcp, uint64_t addr) +{ + struct guard_storage_event_parameter_list gsepl; + + /* Since it is 64-bit even on 31-bit s390... */ + if (sizeof(addr) > current_klongsize && + addr >= (1ULL << (current_klongsize * 8))) { + tprintf("%#" PRIx64, addr); + + return; + } + + if (umove_or_printaddr(tcp, addr, &gsepl)) + return; + + tprints("[{"); + + if (!abbrev(tcp)) { + if (gsepl.pad1) { + PRINT_FIELD_0X("", gsepl, pad1); + tprints(", "); + } + + PRINT_FIELD_0X("", gsepl, gs_eam); + tprintf_comment("extended addressing mode: %u, " + "basic addressing mode: %u", + !!(gsepl.gs_eam & 0x2), !!(gsepl.gs_eam & 0x1)); + + PRINT_FIELD_0X(", ", gsepl, gs_eci); + tprintf_comment("CPU in TX: %u, CPU in CX: %u, instruction: %s", + !!(gsepl.gs_eci & 0x80), + !!(gsepl.gs_eci & 0x40), + gsepl.gs_eci & 0x01 ? "LLGFGS" : "LGG"); + + PRINT_FIELD_0X(", ", gsepl, gs_eai); + tprintf_comment("DAT: %u, address space indication: %u, " + "AR number: %u", + !!(gsepl.gs_eai & 0x40), + (gsepl.gs_eai >> 4) & 0x3, + gsepl.gs_eai & 0xF); + + if (gsepl.pad2) + PRINT_FIELD_0X(", ", gsepl, pad2); + + tprints(", "); + } + + PRINT_FIELD_X("", gsepl, gs_eha); + + if (!abbrev(tcp)) { + PRINT_FIELD_X(", ", gsepl, gs_eia); + PRINT_FIELD_X(", ", gsepl, gs_eoa); + PRINT_FIELD_X(", ", gsepl, gs_eir); + PRINT_FIELD_X(", ", gsepl, gs_era); + } else { + tprints(", ..."); + } + + tprints("}]"); +} + +# define DIV_ROUND_UP(x,y) (((x) + ((y) - 1)) / (y)) + +static void +guard_storage_print_gscb(struct tcb *tcp, kernel_ulong_t addr) +{ + struct guard_storage_control_block gscb; + + if (umove_or_printaddr(tcp, addr, &gscb)) + return; + + tprints("{"); + + if (gscb.reserved) { + PRINT_FIELD_0X("", gscb, reserved); + tprints(", "); + } + + PRINT_FIELD_0X("", gscb, gsd); + + if (!abbrev(tcp)) { + unsigned int gsc = gscb.gsd & 0x3F; + bool gsc_valid = gsc >= 25 && gsc <= 56; + tprintf_comment("GS origin: %#*.*" PRIx64 "%s, " + "guard load shift: %" PRIu64 ", " + "GS characteristic: %u", + gsc_valid ? 2 + DIV_ROUND_UP(64 - gsc, 4) : 0, + gsc_valid ? DIV_ROUND_UP(64 - gsc, 4) : 0, + gsc_valid ? gscb.gsd >> gsc : 0, + gsc_valid ? "" : "[invalid]", + (gscb.gsd >> 8) & 0x7, gsc); + } + + PRINT_FIELD_0X(", ", gscb, gssm); + + tprints(", gs_epl_a="); + guard_storage_print_gsepl(tcp, gscb.gs_epl_a); + + tprints("}"); +} + +SYS_FUNC(s390_guarded_storage) +{ + int command = (int) tcp->u_arg[0]; + kernel_ulong_t gs_cb = tcp->u_arg[1]; + + printxval(s390_guarded_storage_commands, command, "GS_???"); + + switch (command) { + case GS_ENABLE: + case GS_DISABLE: + case GS_CLEAR_BC_CB: + case GS_BROADCAST: + break; + + case GS_SET_BC_CB: + tprints(", "); + guard_storage_print_gscb(tcp, gs_cb); + break; + + default: + tprints(", "); + printaddr(gs_cb); + } + + return RVAL_DECODED; +} + +SYS_FUNC(s390_runtime_instr) +{ + int command = (int) tcp->u_arg[0]; + int signum = (int) tcp->u_arg[1]; + + + printxval_d(s390_runtime_instr_commands, command, + "S390_RUNTIME_INSTR_???"); + + /* + * signum is ignored since Linux 4.4, but let's print it for start + * command anyway. + */ + switch (command) { + case S390_RUNTIME_INSTR_START: + tprints(", "); + printsignal(signum); + break; + + case S390_RUNTIME_INSTR_STOP: + default: + break; + } + + return RVAL_DECODED; +} + +SYS_FUNC(s390_pci_mmio_write) +{ + kernel_ulong_t mmio_addr = tcp->u_arg[0]; + kernel_ulong_t user_buf = tcp->u_arg[1]; + kernel_ulong_t length = tcp->u_arg[2]; + + tprintf("%#" PRI_klx ", ", mmio_addr); + printstr_ex(tcp, user_buf, length, QUOTE_FORCE_HEX); + tprintf(", %" PRI_klu, length); + + return RVAL_DECODED; +} + +SYS_FUNC(s390_pci_mmio_read) +{ + kernel_ulong_t mmio_addr = tcp->u_arg[0]; + kernel_ulong_t user_buf = tcp->u_arg[1]; + kernel_ulong_t length = tcp->u_arg[2]; + + if (entering(tcp)) { + tprintf("%#" PRI_klx ", ", mmio_addr); + } else { + if (!syserror(tcp)) + printstr_ex(tcp, user_buf, length, QUOTE_FORCE_HEX); + else + printaddr(user_buf); + + tprintf(", %" PRI_klu, length); + } + + return 0; +} + +#endif /* defined S390 || defined S390X */ diff --git a/sched.c b/sched.c index 90242615..417ff742 100644 --- a/sched.c +++ b/sched.c @@ -2,34 +2,16 @@ * Copyright (c) 2004 Ulrich Drepper * Copyright (c) 2005 Roland McGrath * Copyright (c) 2012-2015 Dmitry V. Levin + * Copyright (c) 2014-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" #include +#include "sched_attr.h" #include "xlat/schedulers.h" #include "xlat/sched_flags.h" @@ -40,8 +22,7 @@ SYS_FUNC(sched_getscheduler) tprintf("%d", (int) tcp->u_arg[0]); } else if (!syserror(tcp)) { tcp->auxstr = xlookup(schedulers, (kernel_ulong_t) tcp->u_rval); - if (tcp->auxstr != NULL) - return RVAL_STR; + return RVAL_STR; } return 0; } @@ -80,7 +61,9 @@ SYS_FUNC(sched_get_priority_min) return RVAL_DECODED; } -SYS_FUNC(sched_rr_get_interval) +static int +do_sched_rr_get_interval(struct tcb *const tcp, + const print_obj_by_addr_fn print_ts) { if (entering(tcp)) { tprintf("%d, ", (int) tcp->u_arg[0]); @@ -88,49 +71,92 @@ SYS_FUNC(sched_rr_get_interval) if (syserror(tcp)) printaddr(tcp->u_arg[1]); else - print_timespec(tcp, tcp->u_arg[1]); + print_ts(tcp, tcp->u_arg[1]); } return 0; } +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(sched_rr_get_interval_time32) +{ + return do_sched_rr_get_interval(tcp, print_timespec32); +} +#endif + +SYS_FUNC(sched_rr_get_interval_time64) +{ + return do_sched_rr_get_interval(tcp, print_timespec64); +} + static void print_sched_attr(struct tcb *const tcp, const kernel_ulong_t addr, - unsigned int size) + unsigned int usize) { - struct { - uint32_t size; - uint32_t sched_policy; - uint64_t sched_flags; - uint32_t sched_nice; - uint32_t sched_priority; - uint64_t sched_runtime; - uint64_t sched_deadline; - uint64_t sched_period; - } attr = {}; - - if (size > sizeof(attr)) - size = sizeof(attr); - if (umoven_or_printaddr(tcp, addr, size, &attr)) - return; - - tprintf("{size=%u, sched_policy=", attr.size); - printxval(schedulers, attr.sched_policy, "SCHED_???"); - tprints(", sched_flags="); - printflags64(sched_flags, attr.sched_flags, "SCHED_FLAG_???"); - tprintf(", sched_nice=%d", attr.sched_nice); - tprintf(", sched_priority=%u", attr.sched_priority); - tprintf(", sched_runtime=%" PRIu64, attr.sched_runtime); - tprintf(", sched_deadline=%" PRIu64, attr.sched_deadline); - tprintf(", sched_period=%" PRIu64 "}", attr.sched_period); + struct sched_attr attr = {}; + unsigned int size; + + if (usize) { + /* called from sched_getattr */ + size = usize <= sizeof(attr) ? usize : (unsigned) sizeof(attr); + if (umoven_or_printaddr(tcp, addr, size, &attr)) + return; + /* the number of bytes written by the kernel */ + size = attr.size; + } else { + /* called from sched_setattr */ + if (umove_or_printaddr(tcp, addr, &attr.size)) + return; + usize = attr.size; + if (!usize) + usize = SCHED_ATTR_MIN_SIZE; + size = usize <= sizeof(attr) ? usize : (unsigned) sizeof(attr); + if (size >= SCHED_ATTR_MIN_SIZE) { + if (umoven_or_printaddr(tcp, addr, size, &attr)) + return; + } + } + + tprintf("{size=%u", attr.size); + + if (size >= SCHED_ATTR_MIN_SIZE) { + tprints(", sched_policy="); + printxval(schedulers, attr.sched_policy, "SCHED_???"); + tprints(", sched_flags="); + printflags64(sched_flags, attr.sched_flags, "SCHED_FLAG_???"); + +#define PRINT_SCHED_FIELD(field, fmt) \ + tprintf(", " #field "=%" fmt, attr.field) + + PRINT_SCHED_FIELD(sched_nice, "d"); + PRINT_SCHED_FIELD(sched_priority, "u"); + PRINT_SCHED_FIELD(sched_runtime, PRIu64); + PRINT_SCHED_FIELD(sched_deadline, PRIu64); + PRINT_SCHED_FIELD(sched_period, PRIu64); + + if (usize > size) + tprints(", ..."); + } + + tprints("}"); } SYS_FUNC(sched_setattr) { - tprintf("%d, ", (int) tcp->u_arg[0]); - print_sched_attr(tcp, tcp->u_arg[1], 0x100); - tprintf(", %u", (unsigned int) tcp->u_arg[2]); + if (entering(tcp)) { + tprintf("%d, ", (int) tcp->u_arg[0]); + print_sched_attr(tcp, tcp->u_arg[1], 0); + } else { + struct sched_attr attr; - return RVAL_DECODED; + if (verbose(tcp) && tcp->u_error == E2BIG + && umove(tcp, tcp->u_arg[1], &attr.size) == 0) { + tprintf(" => {size=%u}", attr.size); + } + + tprintf(", %u", (unsigned int) tcp->u_arg[2]); + } + + return 0; } SYS_FUNC(sched_getattr) @@ -138,10 +164,25 @@ SYS_FUNC(sched_getattr) if (entering(tcp)) { tprintf("%d, ", (int) tcp->u_arg[0]); } else { - print_sched_attr(tcp, tcp->u_arg[1], tcp->u_arg[2]); - tprintf(", %u, %u", - (unsigned int) tcp->u_arg[2], - (unsigned int) tcp->u_arg[3]); + const unsigned int size = tcp->u_arg[2]; + + if (size) + print_sched_attr(tcp, tcp->u_arg[1], size); + else + printaddr(tcp->u_arg[1]); + tprints(", "); +#ifdef AARCH64 + /* + * Due to a subtle gcc bug that leads to miscompiled aarch64 + * kernels, the 3rd argument of sched_getattr is not quite 32-bit + * as on other architectures. For more details see + * https://lists.strace.io/pipermail/strace-devel/2017-March/006085.html + */ + if (syserror(tcp)) + print_abnormal_hi(tcp->u_arg[2]); +#endif + tprintf("%u", size); + tprintf(", %u", (unsigned int) tcp->u_arg[3]); } return 0; diff --git a/sched_attr.h b/sched_attr.h new file mode 100644 index 00000000..c305ccfb --- /dev/null +++ b/sched_attr.h @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_SCHED_ATTR_H +# define STRACE_SCHED_ATTR_H + +# include + +struct sched_attr { + uint32_t size; + uint32_t sched_policy; + uint64_t sched_flags; + uint32_t sched_nice; + uint32_t sched_priority; + uint64_t sched_runtime; + uint64_t sched_deadline; + uint64_t sched_period; +}; + +# define SCHED_ATTR_MIN_SIZE 48 + +#endif /* !STRACE_SCHED_ATTR_H */ diff --git a/scno.am b/scno.am index 12745f12..89788ddf 100644 --- a/scno.am +++ b/scno.am @@ -1,39 +1,19 @@ # scno.h make rules for strace. # -# Copyright (c) 2017 Dmitry V. Levin +# Copyright (c) 2017-2019 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: LGPL-2.1-or-later SCNO_CPPFLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(ARCH_MFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) -syscallent.i: $(top_srcdir)/$(OS)/$(ARCH)/syscallent.h - $(CPP) -P $(SCNO_CPPFLAGS) $^ -o $@ +syscallent.i: $(top_builddir)/config.h $(top_srcdir)/$(OS)/$(ARCH)/syscallent.h + $(CPP) -P $(SCNO_CPPFLAGS) -include $^ -o $@ digits = [[:digit:]][[:digit:]]* al_nums = [[:alnum:]_][[:alnum:]_]* -SCNO_SED = /TRACE_INDIRECT_SUBCALL/d; s/^\[[[:space:]]*\($(digits)\)\][[:space:]]*=[[:space:]]*{[^,]*,[^,]*,[^,]*,[[:space:]]*"\($(al_nums)\)"[[:space:]]*},.*/\#ifndef __NR_\2\n\# define __NR_\2 (SYSCALL_BIT | \1)\n\#endif/p +SCNO_SED = /TRACE_INDIRECT_SUBCALL/d; s/^\[[[:space:]]*\($(digits)\([[:space:]]*+[[:space:]]*$(digits)\)\?\)\][[:space:]]*=[[:space:]]*{[^,]*,[^,]*,[^,]*,[[:space:]]*"\($(al_nums)\)"[[:space:]]*},.*/\#ifndef __NR_\3\n\# define __NR_\3 (SYSCALL_BIT | (\1))\n\#endif/p scno.h: $(top_srcdir)/scno.head syscallent.i echo '/* Generated by Makefile from $^; do not edit. */' > $@-t @@ -41,4 +21,5 @@ scno.h: $(top_srcdir)/scno.head syscallent.i LC_ALL=C sed -n '$(SCNO_SED)' $(filter-out $<,$^) >> $@-t mv $@-t $@ +BUILT_SOURCES += scno.h CLEANFILES += syscallent.i scno.h diff --git a/scno.head b/scno.head index a640102f..11814b15 100644 --- a/scno.head +++ b/scno.head @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #if defined __X32_SYSCALL_BIT && defined __NR_read \ && (__X32_SYSCALL_BIT & __NR_read) == __X32_SYSCALL_BIT # define SYSCALL_BIT __X32_SYSCALL_BIT diff --git a/scsi.c b/scsi.c index 35796201..02749a38 100644 --- a/scsi.c +++ b/scsi.c @@ -1,29 +1,9 @@ /* * Copyright (c) 2007 Vladimir Nadvornik - * Copyright (c) 2007-2017 Dmitry V. Levin + * Copyright (c) 2007-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -46,7 +26,7 @@ decode_sg_io(struct tcb *const tcp, const uint32_t iid, return decode_sg_io_v4(tcp, arg); default: tprintf("[%u]", iid); - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } } @@ -78,7 +58,7 @@ decode_sg_scsi_id(struct tcb *const tcp, const kernel_ulong_t arg) id.h_cmd_per_lun, id.d_queue_depth); } - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } #endif /* HAVE_SCSI_SG_H */ @@ -179,5 +159,5 @@ scsi_ioctl(struct tcb *const tcp, const unsigned int code, return RVAL_DECODED; } - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } diff --git a/seccomp.c b/seccomp.c index f778a6c4..3c1d3fb8 100644 --- a/seccomp.c +++ b/seccomp.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -33,196 +13,37 @@ #include "xlat/seccomp_ops.h" #include "xlat/seccomp_filter_flags.h" -#ifdef HAVE_LINUX_FILTER_H -# include -# include "xlat/bpf_class.h" -# include "xlat/bpf_miscop.h" -# include "xlat/bpf_mode.h" -# include "xlat/bpf_op_alu.h" -# include "xlat/bpf_op_jmp.h" -# include "xlat/bpf_rval.h" -# include "xlat/bpf_size.h" -# include "xlat/bpf_src.h" - -# ifndef SECCOMP_RET_ACTION -# define SECCOMP_RET_ACTION 0x7fff0000U -# endif -# include "xlat/seccomp_ret_action.h" -#endif - -struct bpf_filter { - uint16_t code; - uint8_t jt; - uint8_t jf; - uint32_t k; -}; - -#ifdef HAVE_LINUX_FILTER_H - -static void -decode_bpf_code(uint16_t code) -{ - uint16_t i = code & ~BPF_CLASS(code); - - printxval(bpf_class, BPF_CLASS(code), "BPF_???"); - switch (BPF_CLASS(code)) { - case BPF_LD: - case BPF_LDX: - tprints("|"); - printxval(bpf_size, BPF_SIZE(code), "BPF_???"); - tprints("|"); - printxval(bpf_mode, BPF_MODE(code), "BPF_???"); - break; - case BPF_ST: - case BPF_STX: - if (i) - tprintf("|%#x /* %s */", i, "BPF_???"); - break; - case BPF_ALU: - tprints("|"); - printxval(bpf_src, BPF_SRC(code), "BPF_???"); - tprints("|"); - printxval(bpf_op_alu, BPF_OP(code), "BPF_???"); - break; - case BPF_JMP: - tprints("|"); - printxval(bpf_src, BPF_SRC(code), "BPF_???"); - tprints("|"); - printxval(bpf_op_jmp, BPF_OP(code), "BPF_???"); - break; - case BPF_RET: - tprints("|"); - printxval(bpf_rval, BPF_RVAL(code), "BPF_???"); - i &= ~BPF_RVAL(code); - if (i) - tprintf("|%#x /* %s */", i, "BPF_???"); - break; - case BPF_MISC: - tprints("|"); - printxval(bpf_miscop, BPF_MISCOP(code), "BPF_???"); - i &= ~BPF_MISCOP(code); - if (i) - tprintf("|%#x /* %s */", i, "BPF_???"); - break; - } - -} - -#endif /* HAVE_LINUX_FILTER_H */ - -static void -decode_bpf_stmt(const struct bpf_filter *filter) -{ -#ifdef HAVE_LINUX_FILTER_H - tprints("BPF_STMT("); - decode_bpf_code(filter->code); - tprints(", "); - if (BPF_CLASS(filter->code) == BPF_RET) { - unsigned int action = SECCOMP_RET_ACTION & filter->k; - unsigned int data = filter->k & ~action; - - printxval(seccomp_ret_action, action, "SECCOMP_RET_???"); - if (data) - tprintf("|%#x)", data); - else - tprints(")"); - } else { - tprintf("%#x)", filter->k); - } -#else - tprintf("BPF_STMT(%#x, %#x)", filter->code, filter->k); -#endif /* HAVE_LINUX_FILTER_H */ -} - -static void -decode_bpf_jump(const struct bpf_filter *filter) -{ -#ifdef HAVE_LINUX_FILTER_H - tprints("BPF_JUMP("); - decode_bpf_code(filter->code); - tprintf(", %#x, %#x, %#x)", - filter->k, filter->jt, filter->jf); -#else - tprintf("BPF_JUMP(%#x, %#x, %#x, %#x)", - filter->code, filter->k, filter->jt, filter->jf); -#endif /* HAVE_LINUX_FILTER_H */ -} - -#ifndef BPF_MAXINSNS -# define BPF_MAXINSNS 4096 -#endif - -static bool -print_bpf_filter(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) -{ - const struct bpf_filter *filter = elem_buf; - unsigned int *pn = data; - - if ((*pn)++ >= BPF_MAXINSNS) { - tprints("..."); - return false; - } - - if (filter->jt || filter->jf) - decode_bpf_jump(filter); - else - decode_bpf_stmt(filter); - - return true; -} - -void -print_seccomp_fprog(struct tcb *const tcp, const kernel_ulong_t addr, - const unsigned short len) -{ - if (abbrev(tcp)) { - printaddr(addr); - } else { - unsigned int insns = 0; - struct bpf_filter filter; - - print_array(tcp, addr, len, &filter, sizeof(filter), - umoven_or_printaddr, print_bpf_filter, &insns); - } -} - -#include "seccomp_fprog.h" - -void -print_seccomp_filter(struct tcb *const tcp, const kernel_ulong_t addr) -{ - struct seccomp_fprog fprog; - - if (fetch_seccomp_fprog(tcp, addr, &fprog)) { - tprintf("{len=%hu, filter=", fprog.len); - print_seccomp_fprog(tcp, fprog.filter, fprog.len); - tprints("}"); - } -} - -static void -decode_seccomp_set_mode_strict(const unsigned int flags, - const kernel_ulong_t addr) -{ - tprintf("%u, ", flags); - printaddr(addr); -} - SYS_FUNC(seccomp) { unsigned int op = tcp->u_arg[0]; + unsigned int flags = tcp->u_arg[1]; + unsigned int act; printxval(seccomp_ops, op, "SECCOMP_SET_MODE_???"); tprints(", "); - if (op == SECCOMP_SET_MODE_FILTER) { - printflags(seccomp_filter_flags, tcp->u_arg[1], + switch (op) { + case SECCOMP_GET_ACTION_AVAIL: + tprintf("%u, ", flags); + if (!umove_or_printaddr(tcp, tcp->u_arg[2], &act)) { + tprints("["); + printxval(seccomp_ret_action, act, "SECCOMP_RET_???"); + tprints("]"); + } + break; + + case SECCOMP_SET_MODE_FILTER: + printflags(seccomp_filter_flags, flags, "SECCOMP_FILTER_FLAG_???"); tprints(", "); - print_seccomp_filter(tcp, tcp->u_arg[2]); - } else { - decode_seccomp_set_mode_strict(tcp->u_arg[1], - tcp->u_arg[2]); + decode_seccomp_fprog(tcp, tcp->u_arg[2]); + break; + + case SECCOMP_SET_MODE_STRICT: + default: + tprintf("%u, ", flags); + printaddr(tcp->u_arg[2]); + break; } return RVAL_DECODED; diff --git a/seccomp_fprog.h b/seccomp_fprog.h deleted file mode 100644 index f4837272..00000000 --- a/seccomp_fprog.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef STRACE_SECCOMP_FPROG_H -#define STRACE_SECCOMP_FPROG_H - -struct seccomp_fprog { - unsigned short len; - unsigned long filter; -}; - -#endif /* !STRACE_SECCOMP_FPROG_H */ diff --git a/sendfile.c b/sendfile.c index 7faf1ca2..bbffe992 100644 --- a/sendfile.c +++ b/sendfile.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/sg_io_v3.c b/sg_io_v3.c index 33aff506..7656c6ff 100644 --- a/sg_io_v3.c +++ b/sg_io_v3.c @@ -1,37 +1,17 @@ /* * Copyright (c) 2007 Vladimir Nadvornik - * Copyright (c) 2007-2017 Dmitry V. Levin + * Copyright (c) 2007-2018 Dmitry V. Levin * Copyright (c) 2015 Bart Van Assche * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" #ifdef HAVE_SCSI_SG_H -#include DEF_MPERS_TYPE(struct_sg_io_hdr) +# include DEF_MPERS_TYPE(struct_sg_io_hdr) # include @@ -44,6 +24,7 @@ typedef struct sg_io_hdr struct_sg_io_hdr; #include "xlat/sg_io_info.h" #ifdef HAVE_SCSI_SG_H +# include "print_fields.h" # include "xlat/sg_io_dxfer_direction.h" # include "xlat/sg_io_flags.h" @@ -59,6 +40,13 @@ print_sg_io_buffer(struct tcb *const tcp, const kernel_ulong_t addr, } } +# define PRINT_FIELD_SG_IO_BUFFER(prefix_, where_, field_, size_, count_, tcp_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + print_sg_io_buffer((tcp_), (mpers_ptr_t)((where_).field_), \ + (size_), (count_)); \ + } while (0) + static int decode_request(struct tcb *const tcp, const kernel_ulong_t arg) { @@ -70,26 +58,22 @@ decode_request(struct tcb *const tcp, const kernel_ulong_t arg) if (umoven_or_printaddr(tcp, arg + skip_iid, sizeof(sg_io) - skip_iid, &sg_io.dxfer_direction)) { tprints("}"); - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } - tprints("dxfer_direction="); - printxval(sg_io_dxfer_direction, sg_io.dxfer_direction, - "SG_DXFER_???"); - tprintf(", cmd_len=%u, cmdp=", sg_io.cmd_len); - print_sg_io_buffer(tcp, ptr_to_kulong(sg_io.cmdp), sg_io.cmd_len, 0); - tprintf(", mx_sb_len=%d", sg_io.mx_sb_len); - tprintf(", iovec_count=%d", sg_io.iovec_count); - tprintf(", dxfer_len=%u", sg_io.dxfer_len); - tprintf(", timeout=%u", sg_io.timeout); - tprints(", flags="); - printflags(sg_io_flags, sg_io.flags, "SG_FLAG_???"); + PRINT_FIELD_XVAL("", sg_io, dxfer_direction, sg_io_dxfer_direction, + "SG_DXFER_???"); + PRINT_FIELD_U(", ", sg_io, cmd_len); + PRINT_FIELD_SG_IO_BUFFER(", ", sg_io, cmdp, sg_io.cmd_len, 0, tcp); + PRINT_FIELD_U(", ", sg_io, mx_sb_len); + PRINT_FIELD_U(", ", sg_io, iovec_count); + PRINT_FIELD_U(", ", sg_io, dxfer_len); + PRINT_FIELD_U(", ", sg_io, timeout); + PRINT_FIELD_FLAGS(", ", sg_io, flags, sg_io_flags, "SG_FLAG_???"); if (sg_io.dxfer_direction == SG_DXFER_TO_DEV || sg_io.dxfer_direction == SG_DXFER_TO_FROM_DEV) { - tprints(", dxferp="); - print_sg_io_buffer(tcp, ptr_to_kulong(sg_io.dxferp), - sg_io.dxfer_len, sg_io.iovec_count); + PRINT_FIELD_SG_IO_BUFFER(", ", sg_io, dxferp, sg_io.dxfer_len, sg_io.iovec_count, tcp); } struct_sg_io_hdr *entering_sg_io = malloc(sizeof(*entering_sg_io)); @@ -99,7 +83,7 @@ decode_request(struct tcb *const tcp, const kernel_ulong_t arg) set_tcb_priv_data(tcp, entering_sg_io, free); } - return 1; + return 0; } static int @@ -110,49 +94,48 @@ decode_response(struct tcb *const tcp, const kernel_ulong_t arg) if (umove(tcp, arg, &sg_io) < 0) { /* print i/o fields fetched on entering syscall */ - if (entering_sg_io->dxfer_direction == SG_DXFER_FROM_DEV) { - tprints(", dxferp="); - printaddr(ptr_to_kulong(entering_sg_io->dxferp)); - } - tprints(", sbp="); - printaddr(ptr_to_kulong(entering_sg_io->sbp)); - return RVAL_DECODED | 1; + if (entering_sg_io->dxfer_direction == SG_DXFER_FROM_DEV) + PRINT_FIELD_PTR(", ", *entering_sg_io, dxferp); + PRINT_FIELD_PTR(", ", *entering_sg_io, sbp); + return RVAL_IOCTL_DECODED; } if (sg_io.interface_id != entering_sg_io->interface_id) { - tprintf(" => interface_id=%u", sg_io.interface_id); - return RVAL_DECODED | 1; + PRINT_FIELD_U(" => ", sg_io, interface_id); + return RVAL_IOCTL_DECODED; } if (sg_io.dxfer_direction == SG_DXFER_FROM_DEV || sg_io.dxfer_direction == SG_DXFER_TO_FROM_DEV) { uint32_t din_len = sg_io.dxfer_len; + const char *prefix = NULL; if (sg_io.resid > 0 && (unsigned int) sg_io.resid <= din_len) din_len -= sg_io.resid; - if (sg_io.dxfer_direction == SG_DXFER_FROM_DEV) { - tprints(", dxferp="); - } else if (din_len) { - tprints(" => dxferp="); - } - if (sg_io.dxfer_direction == SG_DXFER_FROM_DEV || din_len) { - print_sg_io_buffer(tcp, ptr_to_kulong(sg_io.dxferp), - din_len, sg_io.iovec_count); + + if (sg_io.dxfer_direction == SG_DXFER_FROM_DEV) + prefix = ", "; + else if (din_len) + prefix = " => "; + + if (prefix) { + tprints(prefix); + PRINT_FIELD_SG_IO_BUFFER("", sg_io, dxferp, din_len, + sg_io.iovec_count, tcp); } } - tprintf(", status=%#x", sg_io.status); - tprintf(", masked_status=%#x", sg_io.masked_status); - tprintf(", msg_status=%#x", sg_io.msg_status); - tprintf(", sb_len_wr=%u, sbp=", sg_io.sb_len_wr); - print_sg_io_buffer(tcp, ptr_to_kulong(sg_io.sbp), sg_io.sb_len_wr, 0); - tprintf(", host_status=%#x", sg_io.host_status); - tprintf(", driver_status=%#x", sg_io.driver_status); - tprintf(", resid=%d", sg_io.resid); - tprintf(", duration=%u", sg_io.duration); - tprints(", info="); - printflags(sg_io_info, sg_io.info, "SG_INFO_???"); - - return RVAL_DECODED | 1; + PRINT_FIELD_X(", ", sg_io, status); + PRINT_FIELD_X(", ", sg_io, masked_status); + PRINT_FIELD_X(", ", sg_io, msg_status); + PRINT_FIELD_U(", ", sg_io, sb_len_wr); + PRINT_FIELD_SG_IO_BUFFER(", ", sg_io, sbp, sg_io.sb_len_wr, 0, tcp); + PRINT_FIELD_X(", ", sg_io, host_status); + PRINT_FIELD_X(", ", sg_io, driver_status); + PRINT_FIELD_D(", ", sg_io, resid); + PRINT_FIELD_U(", ", sg_io, duration); + PRINT_FIELD_FLAGS(", ", sg_io, info, sg_io_info, "SG_INFO_???"); + + return RVAL_IOCTL_DECODED; } #else /* !HAVE_SCSI_SG_H */ @@ -161,7 +144,7 @@ static int decode_request(struct tcb *const tcp, const kernel_ulong_t arg) { tprints("{interface_id='S', ...}"); - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } static int diff --git a/sg_io_v4.c b/sg_io_v4.c index 1ae8814d..df73ed60 100644 --- a/sg_io_v4.c +++ b/sg_io_v4.c @@ -1,35 +1,16 @@ /* * Copyright (c) 2015 Bart Van Assche - * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" #ifdef HAVE_LINUX_BSG_H +# include "print_fields.h" # include # include "xlat/bsg_protocol.h" # include "xlat/bsg_subprotocol.h" @@ -47,6 +28,12 @@ print_sg_io_buffer(struct tcb *const tcp, const kernel_ulong_t addr, } } +# define PRINT_FIELD_SG_IO_BUFFER(prefix_, where_, field_, size_, count_, tcp_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + print_sg_io_buffer((tcp_), (where_).field_, (size_), (count_)); \ + } while (0) + static int decode_request(struct tcb *const tcp, const kernel_ulong_t arg) { @@ -57,33 +44,31 @@ decode_request(struct tcb *const tcp, const kernel_ulong_t arg) if (umoven_or_printaddr(tcp, arg + skip_iid, sizeof(sg_io) - skip_iid, &sg_io.protocol)) { tprints("}"); - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } - tprints("protocol="); - printxval(bsg_protocol, sg_io.protocol, "BSG_PROTOCOL_???"); - tprints(", subprotocol="); - printxval(bsg_subprotocol, sg_io.subprotocol, "BSG_SUB_PROTOCOL_???"); - tprintf(", request_len=%u, request=", sg_io.request_len); - print_sg_io_buffer(tcp, sg_io.request, sg_io.request_len, 0); - tprintf(", request_tag=%#" PRI__x64, sg_io.request_tag); - tprintf(", request_attr=%u", sg_io.request_attr); - tprintf(", request_priority=%u", sg_io.request_priority); - tprintf(", request_extra=%u", sg_io.request_extra); - tprintf(", max_response_len=%u", sg_io.max_response_len); - - tprintf(", dout_iovec_count=%u", sg_io.dout_iovec_count); - tprintf(", dout_xfer_len=%u", sg_io.dout_xfer_len); - tprintf(", din_iovec_count=%u", sg_io.din_iovec_count); - tprintf(", din_xfer_len=%u", sg_io.din_xfer_len); - tprints(", dout_xferp="); - print_sg_io_buffer(tcp, sg_io.dout_xferp, sg_io.dout_xfer_len, - sg_io.dout_iovec_count); - - tprintf(", timeout=%u", sg_io.timeout); - tprints(", flags="); - printflags(bsg_flags, sg_io.flags, "BSG_FLAG_???"); - tprintf(", usr_ptr=%#" PRI__x64, sg_io.usr_ptr); + PRINT_FIELD_XVAL("", sg_io, protocol, bsg_protocol, "BSG_PROTOCOL_???"); + PRINT_FIELD_XVAL(", ", sg_io, subprotocol, bsg_subprotocol, + "BSG_SUB_PROTOCOL_???"); + PRINT_FIELD_U(", ", sg_io, request_len); + PRINT_FIELD_SG_IO_BUFFER(", ", sg_io, request, sg_io.request_len, + 0, tcp); + PRINT_FIELD_X(", ", sg_io, request_tag); + PRINT_FIELD_U(", ", sg_io, request_attr); + PRINT_FIELD_U(", ", sg_io, request_priority); + PRINT_FIELD_U(", ", sg_io, request_extra); + PRINT_FIELD_U(", ", sg_io, max_response_len); + + PRINT_FIELD_U(", ", sg_io, dout_iovec_count); + PRINT_FIELD_U(", ", sg_io, dout_xfer_len); + PRINT_FIELD_U(", ", sg_io, din_iovec_count); + PRINT_FIELD_U(", ", sg_io, din_xfer_len); + PRINT_FIELD_SG_IO_BUFFER(", ", sg_io, dout_xferp, sg_io.dout_xfer_len, + sg_io.dout_iovec_count, tcp); + + PRINT_FIELD_U(", ", sg_io, timeout); + PRINT_FIELD_FLAGS(", ", sg_io, flags, bsg_flags, "BSG_FLAG_???"); + PRINT_FIELD_X(", ", sg_io, usr_ptr); struct sg_io_v4 *entering_sg_io = malloc(sizeof(*entering_sg_io)); if (entering_sg_io) { @@ -92,7 +77,7 @@ decode_request(struct tcb *const tcp, const kernel_ulong_t arg) set_tcb_priv_data(tcp, entering_sg_io, free); } - return 1; + return 0; } static int @@ -104,39 +89,36 @@ decode_response(struct tcb *const tcp, const kernel_ulong_t arg) if (umove(tcp, arg, &sg_io) < 0) { /* print i/o fields fetched on entering syscall */ - tprints(", response="); - printaddr(entering_sg_io->response); - tprints(", din_xferp="); - printaddr(entering_sg_io->din_xferp); - return RVAL_DECODED | 1; + PRINT_FIELD_X(", ", *entering_sg_io, response); + PRINT_FIELD_X(", ", *entering_sg_io, din_xferp); + return RVAL_IOCTL_DECODED; } if (sg_io.guard != entering_sg_io->guard) { - tprintf(" => guard=%u", sg_io.guard); - return RVAL_DECODED | 1; + PRINT_FIELD_U(" => ", sg_io, guard); + return RVAL_IOCTL_DECODED; } - tprintf(", response_len=%u, response=", sg_io.response_len); - print_sg_io_buffer(tcp, sg_io.response, sg_io.response_len, 0); + PRINT_FIELD_U(", ", sg_io, response_len); + PRINT_FIELD_SG_IO_BUFFER(", ", sg_io, response, sg_io.response_len, + 0, tcp); din_len = sg_io.din_xfer_len; if (sg_io.din_resid > 0 && (unsigned int) sg_io.din_resid <= din_len) din_len -= sg_io.din_resid; - tprints(", din_xferp="); - print_sg_io_buffer(tcp, sg_io.din_xferp, din_len, - sg_io.din_iovec_count); - tprintf(", driver_status=%#x", sg_io.driver_status); - tprintf(", transport_status=%#x", sg_io.transport_status); - tprintf(", device_status=%#x", sg_io.device_status); - tprintf(", retry_delay=%u", sg_io.retry_delay); - tprints(", info="); - printflags(sg_io_info, sg_io.info, "SG_INFO_???"); - tprintf(", duration=%u", sg_io.duration); - tprintf(", response_len=%u", sg_io.response_len); - tprintf(", din_resid=%d", sg_io.din_resid); - tprintf(", dout_resid=%d", sg_io.dout_resid); - tprintf(", generated_tag=%#" PRI__x64, sg_io.generated_tag); - - return RVAL_DECODED | 1; + PRINT_FIELD_SG_IO_BUFFER(", ", sg_io, din_xferp, din_len, + sg_io.din_iovec_count, tcp); + PRINT_FIELD_X(", ", sg_io, driver_status); + PRINT_FIELD_X(", ", sg_io, transport_status); + PRINT_FIELD_X(", ", sg_io, device_status); + PRINT_FIELD_U(", ", sg_io, retry_delay); + PRINT_FIELD_FLAGS(", ", sg_io, info, sg_io_info, "SG_INFO_???"); + PRINT_FIELD_U(", ", sg_io, duration); + PRINT_FIELD_U(", ", sg_io, response_len); + PRINT_FIELD_D(", ", sg_io, din_resid); + PRINT_FIELD_D(", ", sg_io, dout_resid); + PRINT_FIELD_X(", ", sg_io, generated_tag); + + return RVAL_IOCTL_DECODED; } #else /* !HAVE_LINUX_BSG_H */ @@ -145,7 +127,7 @@ static int decode_request(struct tcb *const tcp, const kernel_ulong_t arg) { tprints("{guard='Q', ...}"); - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } static int diff --git a/shutdown.c b/shutdown.c new file mode 100644 index 00000000..fba6e994 --- /dev/null +++ b/shutdown.c @@ -0,0 +1,24 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-2000 Wichert Akkerman + * Copyright (c) 1999-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#include +#include "xlat/shutdown_modes.h" + +SYS_FUNC(shutdown) +{ + printfd(tcp, tcp->u_arg[0]); + tprints(", "); + printxval(shutdown_modes, tcp->u_arg[1], "SHUT_???"); + + return RVAL_DECODED; +} diff --git a/sigaltstack.c b/sigaltstack.c index 7b624c97..f86d09ff 100644 --- a/sigaltstack.c +++ b/sigaltstack.c @@ -5,29 +5,10 @@ * Copyright (c) 1996-1999 Wichert Akkerman * Copyright (c) 2005-2015 Dmitry V. Levin * Copyright (c) 2015 Elvira Khabirova + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/sigevent.h b/sigevent.h index 04c90792..c2228a96 100644 --- a/sigevent.h +++ b/sigevent.h @@ -1,32 +1,12 @@ /* - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #ifndef STRACE_SIGEVENT_H -#define STRACE_SIGEVENT_H +# define STRACE_SIGEVENT_H typedef struct { union { diff --git a/signal.c b/signal.c index 25329d3e..fcaf9d4f 100644 --- a/signal.c +++ b/signal.c @@ -6,33 +6,15 @@ * Copyright (c) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation * Linux for s390 port by D.J. Barrow * + * Copyright (c) 2001-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" #include "nsig.h" +#include "xstring.h" /* The libc headers do not define this constant since it should only be used by the implementation. So we define it here. */ @@ -49,19 +31,15 @@ * Some architectures, otherwise, do not define SA_RESTORER in their headers, * but actually have sa_restorer. */ -#ifdef SA_RESTORER -# if defined HPPA || defined IA64 -# define HAVE_SA_RESTORER 0 -# else -# define HAVE_SA_RESTORER 1 -# endif -#else /* !SA_RESTORER */ -# if defined SPARC || defined SPARC64 || defined M68K +#ifdef HAVE_ARCH_SA_RESTORER +# define HAVE_SA_RESTORER HAVE_ARCH_SA_RESTORER +#else /* !HAVE_ARCH_SA_RESTORER */ +# ifdef SA_RESTORER # define HAVE_SA_RESTORER 1 # else # define HAVE_SA_RESTORER 0 # endif -#endif +#endif /* HAVE_ARCH_SA_RESTORER */ #include "xlat/sa_handler_values.h" #include "xlat/sigact_flags.h" @@ -119,7 +97,7 @@ print_sa_handler(kernel_ulong_t handler) const char *sa_handler_str = get_sa_handler_str(handler); if (sa_handler_str) - tprints(sa_handler_str); + print_xlat_ex(handler, sa_handler_str, XLAT_STYLE_DEFAULT); else printaddr(handler); } @@ -127,21 +105,36 @@ print_sa_handler(kernel_ulong_t handler) const char * signame(const int sig) { - static char buf[sizeof("SIGRT_%u") + sizeof(int)*3]; - - if (sig >= 0) { + if (sig > 0) { const unsigned int s = sig; if (s < nsignals) return signalent[s]; #ifdef ASM_SIGRTMAX if (s >= ASM_SIGRTMIN && s <= (unsigned int) ASM_SIGRTMAX) { - sprintf(buf, "SIGRT_%u", s - ASM_SIGRTMIN); + static char buf[sizeof("SIGRT_%u") + sizeof(s) * 3]; + + xsprintf(buf, "SIGRT_%u", s - ASM_SIGRTMIN); return buf; } #endif } - sprintf(buf, "%d", sig); + + return NULL; +} + +const char * +sprintsigname(const int sig) +{ + const char *str = signame(sig); + + if (str) + return str; + + static char buf[sizeof(sig) * 3 + 2]; + + xsprintf(buf, "%d", sig); + return buf; } @@ -208,11 +201,11 @@ sprintsigmask_n(const char *prefix, const void *sig_mask, unsigned int bytes) } #ifdef ASM_SIGRTMAX else if (i >= ASM_SIGRTMIN && i <= ASM_SIGRTMAX) { - s += sprintf(s, "RT_%u", i - ASM_SIGRTMIN); + s = xappendstr(outstr, s, "RT_%u", i - ASM_SIGRTMIN); } #endif else { - s += sprintf(s, "%u", i); + s = xappendstr(outstr, s, "%u", i); } sep = ' '; } @@ -229,10 +222,35 @@ sprintsigmask_n(const char *prefix, const void *sig_mask, unsigned int bytes) #define tprintsigmask_val(prefix, mask) \ tprints(sprintsigmask_n((prefix), &(mask), sizeof(mask))) +static const char * +sprint_old_sigmask_val(const char *const prefix, const unsigned long mask) +{ +#if defined(current_wordsize) || !defined(WORDS_BIGENDIAN) + return sprintsigmask_n(prefix, &mask, current_wordsize); +#else /* !current_wordsize && WORDS_BIGENDIAN */ + if (current_wordsize == sizeof(mask)) { + return sprintsigmask_val(prefix, mask); + } else { + uint32_t mask32 = mask; + return sprintsigmask_val(prefix, mask32); + } +#endif +} + +#define tprint_old_sigmask_val(prefix, mask) \ + tprints(sprint_old_sigmask_val((prefix), (mask))) + void printsignal(int nr) { - tprints(signame(nr)); + const char *str = signame(nr); + + if (!str || xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) + tprintf("%d", nr); + if (!str || xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) + return; + (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE + ? tprints_comment : tprints)(str); } static void @@ -260,13 +278,19 @@ print_sigset_addr_len(struct tcb *const tcp, const kernel_ulong_t addr, print_sigset_addr_len_limit(tcp, addr, len, current_wordsize); } -SYS_FUNC(sigsetmask) +void +print_sigset_addr(struct tcb *const tcp, const kernel_ulong_t addr) +{ + print_sigset_addr_len_limit(tcp, addr, NSIG_BYTES, NSIG_BYTES); +} + +SYS_FUNC(ssetmask) { if (entering(tcp)) { - tprintsigmask_val("", tcp->u_arg[0]); - } - else if (!syserror(tcp)) { - tcp->auxstr = sprintsigmask_val("old mask ", tcp->u_rval); + tprint_old_sigmask_val("", (unsigned) tcp->u_arg[0]); + } else if (!syserror(tcp)) { + tcp->auxstr = sprint_old_sigmask_val("old mask ", + (unsigned) tcp->u_rval); return RVAL_HEX | RVAL_STR; } return 0; @@ -274,30 +298,25 @@ SYS_FUNC(sigsetmask) struct old_sigaction { /* sa_handler may be a libc #define, need to use other name: */ -#ifdef MIPS +#if defined MIPS unsigned int sa_flags; unsigned long sa_handler__; - /* Kernel treats sa_mask as an array of longs. */ - unsigned long sa_mask[NSIG / sizeof(long)]; + unsigned long sa_mask; +#elif defined ALPHA + unsigned long sa_handler__; + unsigned long sa_mask; + unsigned int sa_flags; #else unsigned long sa_handler__; unsigned long sa_mask; unsigned long sa_flags; -#endif /* !MIPS */ -#if HAVE_SA_RESTORER unsigned long sa_restorer; #endif -}; - -struct old_sigaction32 { - /* sa_handler may be a libc #define, need to use other name: */ - uint32_t sa_handler__; - uint32_t sa_mask; - uint32_t sa_flags; -#if HAVE_SA_RESTORER - uint32_t sa_restorer; +} +#ifdef ALPHA + ATTRIBUTE_PACKED #endif -}; +; static void decode_old_sigaction(struct tcb *const tcp, const kernel_ulong_t addr) @@ -306,7 +325,12 @@ decode_old_sigaction(struct tcb *const tcp, const kernel_ulong_t addr) #ifndef current_wordsize if (current_wordsize < sizeof(sa.sa_handler__)) { - struct old_sigaction32 sa32; + struct old_sigaction32 { + uint32_t sa_handler__; + uint32_t sa_mask; + uint32_t sa_flags; + uint32_t sa_restorer; + } sa32; if (umove_or_printaddr(tcp, addr, &sa32)) return; @@ -314,9 +338,7 @@ decode_old_sigaction(struct tcb *const tcp, const kernel_ulong_t addr) memset(&sa, 0, sizeof(sa)); sa.sa_handler__ = sa32.sa_handler__; sa.sa_flags = sa32.sa_flags; -#if HAVE_SA_RESTORER && defined SA_RESTORER sa.sa_restorer = sa32.sa_restorer; -#endif sa.sa_mask = sa32.sa_mask; } else #endif @@ -326,15 +348,11 @@ decode_old_sigaction(struct tcb *const tcp, const kernel_ulong_t addr) tprints("{sa_handler="); print_sa_handler(sa.sa_handler__); tprints(", sa_mask="); -#ifdef MIPS - tprintsigmask_addr("", sa.sa_mask); -#else - tprintsigmask_val("", sa.sa_mask); -#endif + tprint_old_sigmask_val("", sa.sa_mask); tprints(", sa_flags="); printflags(sigact_flags, sa.sa_flags, "SA_???"); -#if HAVE_SA_RESTORER && defined SA_RESTORER - if (sa.sa_flags & SA_RESTORER) { +#if !(defined ALPHA || defined MIPS) + if (sa.sa_flags & 0x04000000U) { tprints(", sa_restorer="); printaddr(sa.sa_restorer); } @@ -345,7 +363,14 @@ decode_old_sigaction(struct tcb *const tcp, const kernel_ulong_t addr) SYS_FUNC(sigaction) { if (entering(tcp)) { - printsignal(tcp->u_arg[0]); + int signo = tcp->u_arg[0]; +#if defined SPARC || defined SPARC64 + if (signo < 0) { + tprints("-"); + signo = -signo; + } +#endif + printsignal(signo); tprints(", "); decode_old_sigaction(tcp, tcp->u_arg[1]); tprints(", "); @@ -368,73 +393,84 @@ SYS_FUNC(signal) return 0; } -SYS_FUNC(siggetmask) +SYS_FUNC(sgetmask) { - if (exiting(tcp)) { - tcp->auxstr = sprintsigmask_val("mask ", tcp->u_rval); + if (exiting(tcp) && !syserror(tcp)) { + tcp->auxstr = sprint_old_sigmask_val("mask ", tcp->u_rval); + return RVAL_HEX | RVAL_STR; } - return RVAL_HEX | RVAL_STR; + return 0; } SYS_FUNC(sigsuspend) { - tprintsigmask_val("", tcp->u_arg[2]); +#ifdef MIPS + print_sigset_addr_len(tcp, tcp->u_arg[n_args(tcp) - 1], + current_wordsize); +#else + tprint_old_sigmask_val("", tcp->u_arg[n_args(tcp) - 1]); +#endif return RVAL_DECODED; } -/* "Old" sigprocmask, which operates with word-sized signal masks */ -SYS_FUNC(sigprocmask) +#ifdef ALPHA +/* + * The OSF/1 sigprocmask is different: it doesn't pass in two pointers, + * but rather passes in the new bitmask as an argument and then returns + * the old bitmask. This "works" because we only have 64 signals to worry + * about. If you want more, use of the rt_sigprocmask syscall is required. + * + * Alpha: + * old = osf_sigprocmask(how, new); + * Everyone else: + * ret = sigprocmask(how, &new, &old, ...); + */ +SYS_FUNC(osf_sigprocmask) { -# ifdef ALPHA if (entering(tcp)) { - /* - * Alpha/OSF is different: it doesn't pass in two pointers, - * but rather passes in the new bitmask as an argument and - * then returns the old bitmask. This "works" because we - * only have 64 signals to worry about. If you want more, - * use of the rt_sigprocmask syscall is required. - * Alpha: - * old = osf_sigprocmask(how, new); - * Everyone else: - * ret = sigprocmask(how, &new, &old, ...); - */ printxval(sigprocmaskcmds, tcp->u_arg[0], "SIG_???"); tprintsigmask_val(", ", tcp->u_arg[1]); - } - else if (!syserror(tcp)) { + } else if (!syserror(tcp)) { tcp->auxstr = sprintsigmask_val("old mask ", tcp->u_rval); return RVAL_HEX | RVAL_STR; } -# else /* !ALPHA */ + return 0; +} + +#else /* !ALPHA */ + +/* "Old" sigprocmask, which operates with word-sized signal masks */ +SYS_FUNC(sigprocmask) +{ if (entering(tcp)) { printxval(sigprocmaskcmds, tcp->u_arg[0], "SIG_???"); tprints(", "); print_sigset_addr_len(tcp, tcp->u_arg[1], current_wordsize); tprints(", "); - } - else { + } else { print_sigset_addr_len(tcp, tcp->u_arg[2], current_wordsize); } -# endif /* !ALPHA */ return 0; } +#endif /* !ALPHA */ SYS_FUNC(kill) { - tprintf("%d, %s", - (int) tcp->u_arg[0], - signame(tcp->u_arg[1])); + /* pid */ + tprintf("%d, ", (int) tcp->u_arg[0]); + /* signal */ + printsignal(tcp->u_arg[1]); return RVAL_DECODED; } SYS_FUNC(tgkill) { - tprintf("%d, %d, %s", - (int) tcp->u_arg[0], - (int) tcp->u_arg[1], - signame(tcp->u_arg[2])); + /* tgid, tid */ + tprintf("%d, %d, ", (int) tcp->u_arg[0], (int) tcp->u_arg[1]); + /* signal */ + printsignal(tcp->u_arg[2]); return RVAL_DECODED; } @@ -454,8 +490,7 @@ SYS_FUNC(rt_sigprocmask) tprints(", "); print_sigset_addr_len(tcp, tcp->u_arg[1], tcp->u_arg[3]); tprints(", "); - } - else { + } else { print_sigset_addr_len(tcp, tcp->u_arg[2], tcp->u_arg[3]); tprintf(", %" PRI_klu, tcp->u_arg[3]); } @@ -463,8 +498,7 @@ SYS_FUNC(rt_sigprocmask) } /* Structure describing the action to be taken when a signal arrives. */ -struct new_sigaction -{ +struct new_sigaction { /* sa_handler may be a libc #define, need to use other name: */ #ifdef MIPS unsigned int sa_flags; @@ -480,8 +514,7 @@ struct new_sigaction unsigned long sa_mask[NSIG / sizeof(long)]; }; /* Same for i386-on-x86_64 and similar cases */ -struct new_sigaction32 -{ +struct new_sigaction32 { uint32_t sa_handler__; uint32_t sa_flags; #if HAVE_SA_RESTORER @@ -505,9 +538,9 @@ decode_new_sigaction(struct tcb *const tcp, const kernel_ulong_t addr) memset(&sa, 0, sizeof(sa)); sa.sa_handler__ = sa32.sa_handler__; sa.sa_flags = sa32.sa_flags; -#if HAVE_SA_RESTORER && defined SA_RESTORER +# if HAVE_SA_RESTORER && defined SA_RESTORER sa.sa_restorer = sa32.sa_restorer; -#endif +# endif /* Kernel treats sa_mask as an array of longs. * For 32-bit process, "long" is uint32_t, thus, for example, * 32th bit in sa_mask will end up as bit 0 in sa_mask[1]. @@ -615,7 +648,22 @@ SYS_FUNC(rt_tgsigqueueinfo) return RVAL_DECODED; } -SYS_FUNC(rt_sigtimedwait) +SYS_FUNC(pidfd_send_signal) +{ + /* int pidfd */ + printfd(tcp, tcp->u_arg[0]); + /* int sig, siginfo_t *info */ + tprints(", "); + print_sigqueueinfo(tcp, tcp->u_arg[1], tcp->u_arg[2]); + /* unsigned int flags */ + tprintf(", %#x", (unsigned int) tcp->u_arg[3]); + + return RVAL_DECODED; +} + +static int +do_rt_sigtimedwait(struct tcb *const tcp, const print_obj_by_addr_fn print_ts, + const sprint_obj_by_addr_fn sprint_ts) { /* NB: kernel requires arg[3] == NSIG_BYTES */ if (entering(tcp)) { @@ -629,10 +677,10 @@ SYS_FUNC(rt_sigtimedwait) */ printaddr(tcp->u_arg[1]); tprints(", "); - print_timespec(tcp, tcp->u_arg[2]); + print_ts(tcp, tcp->u_arg[2]); tprintf(", %" PRI_klu, tcp->u_arg[3]); } else { - char *sts = xstrdup(sprint_timespec(tcp, tcp->u_arg[2])); + char *sts = xstrdup(sprint_ts(tcp, tcp->u_arg[2])); set_tcb_priv_data(tcp, sts, free); } } else { @@ -649,7 +697,19 @@ SYS_FUNC(rt_sigtimedwait) } } return 0; -}; +} + +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(rt_sigtimedwait_time32) +{ + return do_rt_sigtimedwait(tcp, print_timespec32, sprint_timespec32); +} +#endif + +SYS_FUNC(rt_sigtimedwait_time64) +{ + return do_rt_sigtimedwait(tcp, print_timespec64, sprint_timespec64); +} SYS_FUNC(restart_syscall) { diff --git a/signalent.sh b/signalent.sh deleted file mode 100755 index 62ae7862..00000000 --- a/signalent.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/sh -# Copyright (c) 1996 Rick Sladkey -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -cat $* | - sed -n -e 's/\/\*.*\*\// /' -e 's/^#[ ]*define[ ][ ]*SIG\([^_ ]*\)[ ][ ]*\([0-9][0-9]*\)[ ]*$/\1 \2/p' | - sort -k2n | uniq | - awk ' - BEGIN { - tabs = "\t\t\t\t\t\t\t\t" - signal = -1; - } - $2 <= 256 { - if (signal == $2) - next - while (++signal < $2) { - n = "\"SIG_" signal "\"" - s = "\t" n "," - s = s substr(tabs, 1, 16/8 - int((length(n) + 1)/8)) - s = s "/* " signal " */" - print s - } - if (signal == $2) - n = "\"SIG" $1 "\"" - n = "\"SIG" $1 "\"" - s = "\t" n "," - s = s substr(tabs, 1, 16/8 - int((length(n) + 1)/8)) - s = s "/* " signal " */" - print s - } - ' diff --git a/signalfd.c b/signalfd.c index 3895c766..96854905 100644 --- a/signalfd.c +++ b/signalfd.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2008-2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/sigreturn.c b/sigreturn.c index b2eeb7a4..755d2aa5 100644 --- a/sigreturn.c +++ b/sigreturn.c @@ -1,7 +1,14 @@ +/* + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" +#include "ptrace.h" #include "nsig.h" #include "regs.h" -#include "ptrace.h" #if defined HAVE_ASM_SIGCONTEXT_H && !defined HAVE_STRUCT_SIGCONTEXT # include diff --git a/sock.c b/sock.c index 9dd247cc..a0152bdd 100644 --- a/sock.c +++ b/sock.c @@ -1,31 +1,13 @@ /* * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" +#include "print_fields.h" #include #if defined ALPHA || defined SH || defined SH64 @@ -45,12 +27,9 @@ typedef struct ifreq struct_ifreq; #include "xlat/iffflags.h" -#define PRINT_IFREQ_ADDR(tcp, ifr, sockaddr) \ - do { \ - tprints(#sockaddr "="); \ - print_sockaddr(tcp, &((ifr)->sockaddr), \ - sizeof((ifr)->sockaddr)); \ - } while (0) +#define XLAT_MACROS_ONLY +#include "xlat/arp_hardware_types.h" +#undef XLAT_MACROS_ONLY static void print_ifname(const char *ifname) @@ -58,6 +37,8 @@ print_ifname(const char *ifname) print_quoted_string(ifname, IFNAMSIZ + 1, QUOTE_0_TERMINATED); } +DIAG_PUSH_IGNORE_OVERRIDE_INIT + static void print_ifreq(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t arg, const struct_ifreq *const ifr) @@ -65,29 +46,105 @@ print_ifreq(struct tcb *const tcp, const unsigned int code, switch (code) { case SIOCSIFADDR: case SIOCGIFADDR: - PRINT_IFREQ_ADDR(tcp, ifr, ifr_addr); + PRINT_FIELD_SOCKADDR("", *ifr, ifr_addr); break; case SIOCSIFDSTADDR: case SIOCGIFDSTADDR: - PRINT_IFREQ_ADDR(tcp, ifr, ifr_dstaddr); + PRINT_FIELD_SOCKADDR("", *ifr, ifr_dstaddr); break; case SIOCSIFBRDADDR: case SIOCGIFBRDADDR: - PRINT_IFREQ_ADDR(tcp, ifr, ifr_broadaddr); + PRINT_FIELD_SOCKADDR("", *ifr, ifr_broadaddr); break; case SIOCSIFNETMASK: case SIOCGIFNETMASK: - PRINT_IFREQ_ADDR(tcp, ifr, ifr_netmask); + PRINT_FIELD_SOCKADDR("", *ifr, ifr_netmask); break; case SIOCSIFHWADDR: case SIOCGIFHWADDR: { - /* XXX Are there other hardware addresses - than 6-byte MACs? */ - const unsigned char *bytes = - (unsigned char *) &ifr->ifr_hwaddr.sa_data; - tprintf("ifr_hwaddr=%02x:%02x:%02x:%02x:%02x:%02x", - bytes[0], bytes[1], bytes[2], - bytes[3], bytes[4], bytes[5]); + static uint8_t hwaddr_sizes[] = { + [0 ... ARPHRD_IEEE802_TR] = 255, + + [ARPHRD_NETROM] = 7 /* AX25_ADDR_LEN */, + [ARPHRD_ETHER] = 6 /* ETH_ALEN */, + /* ARPHRD_EETHER - no actual devices in Linux */ + [ARPHRD_AX25] = 7 /* AX25_ADDR_LEN */, + /* ARPHRD_PRONET - no actual devices in Linux */ + /* ARPHRD_CHAOS - no actual devices in Linux */ + [ARPHRD_IEEE802] = 6 /* FC_ALEN */, + [ARPHRD_ARCNET] = 1 /* ARCNET_ALEN */, + /* ARPHRD_APPLETLK - no actual devices in Linux */ + [ARPHRD_DLCI] = sizeof(short), + /* ARPHRD_ATM - no explicit setting */ + /* ARPHRD_METRICOM - no actual devices in Linux */ + [ARPHRD_IEEE1394] = 16 /* FWNET_ALEN */, + [ARPHRD_EUI64] = 8 /* EUI64_ADDR_LEN */, + [ARPHRD_INFINIBAND] = 20 /* INFINIBAND_ALEN */, + [ARPHRD_SLIP] = 0, + /* ARPHRD_CSLIP - no actual devices in Linux */ + /* ARPHRD_SLIP6 - no actual devices in Linux */ + /* ARPHRD_CSLIP6 - no actual devices in Linux */ + /* ARPHRD_RSRVD - no actual devices in Linux */ + /* ARPHRD_ADAPT - no actual devices in Linux */ + [ARPHRD_ROSE] = 5 /* ROSE_ADDR_LEN */, + [ARPHRD_X25] = 0, + /* ARPHRD_HWX25 - no actual devices in Linux */ + [ARPHRD_CAN] = 0, + [ARPHRD_PPP] = 0, + /* ARPHRD_CISCO - no actual devices in Linux */ + /* ARPHRD_LAPB - no actual devices in Linux */ + /* ARPHRD_DDCMP - no actual devices in Linux */ + [ARPHRD_RAWHDLC] = 0, + [ARPHRD_RAWIP] = 0, + [ARPHRD_TUNNEL] = 4 /* IPIP */, + [ARPHRD_TUNNEL6] = 16 /* sizeof(struct in6_addr) */, + /* ARPHRD_FRAD - no actual devices in Linux */ + /* ARPHRD_SKIP - no actual devices in Linux */ + [ARPHRD_LOOPBACK] = 6 /* ETH_ALEN */, + [ARPHRD_LOCALTLK] = 1 /* LTALK_ALEN */, + [ARPHRD_FDDI] = 6 /* FDDI_K_ALEN */, + /* ARPHRD_BIF - no actual devices in Linux */ + [ARPHRD_SIT] = 4, + [ARPHRD_IPDDP] = 0, + [ARPHRD_IPGRE] = 4, + [ARPHRD_PIMREG] = 0, + [ARPHRD_HIPPI] = 6 /* HIPPI_ALEN */, + /* ARPHRD_ASH - no actual devices in Linux */ + /* ARPHRD_ECONET - no actual devices in Linux */ + [ARPHRD_IRDA] = 4 /* LAP_ALEN */, + /* ARPHRD_FCPP - no actual devices in Linux */ + /* ARPHRD_FCAL - no actual devices in Linux */ + /* ARPHRD_FCPL - no actual devices in Linux */ + /* ARPHRD_FCFABRIC - no actual devices in Linux */ + /* ARPHRD_IEEE802_TR - no actual devices in Linux */ + [ARPHRD_IEEE80211] = 6 /* ETH_ALEN */, + [ARPHRD_IEEE80211_PRISM] = 6 /* ETH_ALEN */, + [ARPHRD_IEEE80211_RADIOTAP] = 6 /* ETH_ALEN */, + [ARPHRD_IEEE802154] + = 8 /* IEEE802154_EXTENDED_ADDR_LEN */, + [ARPHRD_IEEE802154_MONITOR] + = 8 /* IEEE802154_EXTENDED_ADDR_LEN */, + [ARPHRD_PHONET] = 1, + [ARPHRD_PHONET_PIPE] = 1, + [ARPHRD_CAIF] = 0, + [ARPHRD_IP6GRE] = 16 /* sizeof(struct in6_addr) */, + [ARPHRD_NETLINK] = 0, + [ARPHRD_6LOWPAN] = 8 /* EUI64_ADDR_LEN */ + /* ^ or ETH_ALEN, depending on lltype */, + [ARPHRD_VSOCKMON] = 0, + }; + + uint16_t proto = ifr->ifr_hwaddr.sa_family; + uint8_t sz = (proto < ARRAY_SIZE(hwaddr_sizes)) + ? hwaddr_sizes[proto] : 255; + + PRINT_FIELD_XVAL_SORTED_SIZED("ifr_hwaddr={", ifr->ifr_hwaddr, + sa_family, arp_hardware_types, + arp_hardware_types_size, + "ARPHRD_???"); + PRINT_FIELD_MAC_SZ(", ", ifr->ifr_hwaddr, sa_data, + MIN(sizeof(ifr->ifr_hwaddr.sa_data), sz)); + tprints("}"); break; } case SIOCSIFFLAGS: @@ -127,6 +184,8 @@ print_ifreq(struct tcb *const tcp, const unsigned int code, } } +DIAG_POP_IGNORE_OVERRIDE_INIT + static unsigned int print_ifc_len(int len) { @@ -148,8 +207,7 @@ print_ifconf_ifreq(struct tcb *tcp, void *elem_buf, size_t elem_size, tprints("{ifr_name="); print_ifname(ifr->ifr_name); - tprints(", "); - PRINT_IFREQ_ADDR(tcp, ifr, ifr_addr); + PRINT_FIELD_SOCKADDR(", ", *ifr, ifr_addr); tprints("}"); return true; @@ -179,7 +237,7 @@ decode_ifconf(struct tcb *const tcp, const kernel_ulong_t addr) entering_ifc = get_tcb_priv_data(tcp); if (!entering_ifc) { - error_msg("decode_ifconf: where is my ifconf?"); + error_func_msg("where is my ifconf?"); return 0; } } @@ -204,7 +262,7 @@ decode_ifconf(struct tcb *const tcp, const kernel_ulong_t addr) tprints("}"); } - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } if (entering(tcp)) { @@ -214,7 +272,7 @@ decode_ifconf(struct tcb *const tcp, const kernel_ulong_t addr) set_tcb_priv_data(tcp, ifc, free); - return 1; + return 0; } /* exiting */ @@ -238,12 +296,12 @@ decode_ifconf(struct tcb *const tcp, const kernel_ulong_t addr) print_array(tcp, ptr_to_kulong(ifc->ifc_buf), ifc->ifc_len / sizeof(struct_ifreq), &ifr, sizeof(ifr), - umoven_or_printaddr, print_ifconf_ifreq, NULL); + tfetch_mem, print_ifconf_ifreq, NULL); } tprints("}"); - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } MPERS_PRINTER_DECL(int, sock_ioctl, @@ -350,7 +408,7 @@ MPERS_PRINTER_DECL(int, sock_ioctl, tprints("{ifr_name="); print_ifname(ifr.ifr_name); } - return 1; + return 0; } else { if (syserror(tcp)) { tprints("}"); @@ -377,5 +435,5 @@ MPERS_PRINTER_DECL(int, sock_ioctl, return RVAL_DECODED; } - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } diff --git a/sockaddr.c b/sockaddr.c index 174108ca..acba7f02 100644 --- a/sockaddr.c +++ b/sockaddr.c @@ -4,41 +4,26 @@ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-2000 Wichert Akkerman * Copyright (c) 2005-2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" +#include "print_fields.h" + #include #include #include #include -#include +#include "netlink.h" +#include #include #include #include +#include #ifdef HAVE_NETIPX_IPX_H # include @@ -51,18 +36,16 @@ #include "xlat/ethernet_protocols.h" #include "xlat/af_packet_types.h" -#ifdef HAVE_BLUETOOTH_BLUETOOTH_H -# include -# include -# include -# include -# include - -# include "xlat/hci_channels.h" -#endif +#include "xlat/bdaddr_types.h" +#include "xlat/bluetooth_l2_cid.h" +#include "xlat/bluetooth_l2_psm.h" +#include "xlat/hci_channels.h" #define SIZEOF_SA_FAMILY sizeof(((struct sockaddr *) 0)->sa_family) +const size_t arp_hardware_types_size = ARRAY_SIZE(arp_hardware_types) - 1; +const size_t ethernet_protocols_size = ARRAY_SIZE(ethernet_protocols) - 1; + static void print_sockaddr_data_un(const void *const buf, const int addrlen) { @@ -81,13 +64,120 @@ print_sockaddr_data_un(const void *const buf, const int addrlen) } } +bool +print_inet_addr(const int af, + const void *const addr, + const unsigned int len, + const char *const var_name) +{ + char buf[INET6_ADDRSTRLEN]; + + switch (af) { + case AF_INET: + if (inet_ntop(af, addr, buf, sizeof(buf))) { + if (var_name) + tprintf("%s=", var_name); + + if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) + print_quoted_string((const char*) addr, + len, QUOTE_FORCE_HEX); + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) + return true; + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) + tprints(" /* "); + + tprintf("inet_addr(\"%s\")", buf); + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) + tprints(" */"); + + return true; + } + break; + case AF_INET6: + if (inet_ntop(af, addr, buf, sizeof(buf))) { + if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) { + if (var_name) + tprintf("%s=", var_name); + print_quoted_string(addr, len, QUOTE_FORCE_HEX); + } + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) + return true; + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) + tprints(" /* "); + + if (var_name && + (xlat_verbose(xlat_verbosity) == XLAT_STYLE_ABBREV)) + tprintf("inet_pton(%s, \"%s\", &%s)", + "AF_INET6", buf, var_name); + else + tprintf("inet_pton(%s, \"%s\")", + "AF_INET6", buf); + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) + tprints(" */"); + + return true; + } + break; + } + + if (var_name) + tprintf("%s=", var_name); + print_quoted_string(addr, len, QUOTE_FORCE_HEX); + return false; +} + +bool +decode_inet_addr(struct tcb *const tcp, + const kernel_ulong_t addr, + const unsigned int len, + const int family, + const char *const var_name) +{ + union { + struct in_addr a4; + struct in6_addr a6; + } addrbuf; + size_t size = 0; + + switch (family) { + case AF_INET: + size = sizeof(addrbuf.a4); + break; + case AF_INET6: + size = sizeof(addrbuf.a6); + break; + } + + if (!size || len < size) { + if (var_name) + tprintf("%s=", var_name); + printstr_ex(tcp, addr, len, QUOTE_FORCE_HEX); + return false; + } + + if (umoven(tcp, addr, size, &addrbuf) < 0) { + if (var_name) + tprintf("%s=", var_name); + printaddr(addr); + return false; + } + + return print_inet_addr(family, &addrbuf, size, var_name); +} + static void print_sockaddr_data_in(const void *const buf, const int addrlen) { const struct sockaddr_in *const sa_in = buf; - tprintf("sin_port=htons(%u), sin_addr=inet_addr(\"%s\")", - ntohs(sa_in->sin_port), inet_ntoa(sa_in->sin_addr)); + PRINT_FIELD_NET_PORT("", *sa_in, sin_port); + PRINT_FIELD_INET_ADDR(", ", *sa_in, sin_addr, AF_INET); } #define SIN6_MIN_LEN offsetof(struct sockaddr_in6, sin6_scope_id) @@ -97,25 +187,188 @@ print_sockaddr_data_in6(const void *const buf, const int addrlen) { const struct sockaddr_in6 *const sa_in6 = buf; - char string_addr[100]; - inet_ntop(AF_INET6, &sa_in6->sin6_addr, - string_addr, sizeof(string_addr)); - tprintf("sin6_port=htons(%u), inet_pton(AF_INET6" - ", \"%s\", &sin6_addr), sin6_flowinfo=htonl(%u)", - ntohs(sa_in6->sin6_port), string_addr, - ntohl(sa_in6->sin6_flowinfo)); + PRINT_FIELD_NET_PORT("", *sa_in6, sin6_port); + tprints(", sin6_flowinfo="); + if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) + print_quoted_string((const char*) &sa_in6->sin6_flowinfo, + sizeof(sa_in6->sin6_flowinfo), + QUOTE_FORCE_HEX); + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) + tprintf(" /* htonl(%u) */", ntohl(sa_in6->sin6_flowinfo)); + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_ABBREV) + tprintf("htonl(%u)", ntohl(sa_in6->sin6_flowinfo)); + PRINT_FIELD_INET_ADDR(", ", *sa_in6, sin6_addr, AF_INET6); if (addrlen <= (int) SIN6_MIN_LEN) return; - tprints(", sin6_scope_id="); #if defined IN6_IS_ADDR_LINKLOCAL && defined IN6_IS_ADDR_MC_LINKLOCAL if (IN6_IS_ADDR_LINKLOCAL(&sa_in6->sin6_addr) || IN6_IS_ADDR_MC_LINKLOCAL(&sa_in6->sin6_addr)) - print_ifindex(sa_in6->sin6_scope_id); + PRINT_FIELD_IFINDEX(", ", *sa_in6, sin6_scope_id); else #endif - tprintf("%u", sa_in6->sin6_scope_id); + PRINT_FIELD_U(", ", *sa_in6, sin6_scope_id); +} + +/** + * Check that we can print an AX.25 address in its native form, otherwise it + * makes sense to print it in raw also (or in raw only). + */ +enum xlat_style +check_ax25_address(const ax25_address *addr) +{ + enum xlat_style ret = XLAT_STYLE_DEFAULT; + bool space_seen = false; + bool char_seen = false; + + for (size_t i = 0; i < ARRAY_SIZE(addr->ax25_call) - 1; i++) { + unsigned char c = addr->ax25_call[i]; + + /* The lowest bit should be zero */ + if (c & 1) + ret = XLAT_STYLE_VERBOSE; + + c >>= 1; + + if (c == ' ') + space_seen = true; + else + char_seen = true; + + /* Sane address contains only numbers and uppercase letters */ + if ((c < '0' || c > '9') && (c < 'A' || c > 'Z') && c != ' ') + ret = XLAT_STYLE_VERBOSE; + if (c != ' ' && space_seen) + ret = XLAT_STYLE_VERBOSE; + + /* non-printable chars */ + if (c < ' ' || c > 0x7e + /* characters used for printing comments */ + || c == '*' || c == '/') + return XLAT_STYLE_RAW; + } + + if (addr->ax25_call[ARRAY_SIZE(addr->ax25_call) - 1] & ~0x1e) + ret = XLAT_STYLE_VERBOSE; + + if (!char_seen && addr->ax25_call[ARRAY_SIZE(addr->ax25_call) - 1]) + ret = XLAT_STYLE_VERBOSE; + + return ret; +} + +/** Convert a (presumably) valid AX.25 to a string */ +static const char * +ax25_addr2str(const ax25_address *addr) +{ + static char buf[ARRAY_SIZE(addr->ax25_call) + sizeof("-15")]; + char *p = buf; + size_t end; + + for (end = ARRAY_SIZE(addr->ax25_call) - 1; end; end--) + if ((addr->ax25_call[end - 1] >> 1) != ' ') + break; + + for (size_t i = 0; i < end; i++) + *p++ = ((unsigned char) addr->ax25_call[i]) >> 1; + + *p++ = '-'; + + unsigned char ssid = (addr->ax25_call[ARRAY_SIZE(addr->ax25_call) - 1] + >> 1) & 0xf; + + if (ssid > 9) { + *p++ = '1'; + ssid -= 10; + } + + *p++ = ssid + '0'; + *p = '\0'; + + if (buf[0] == '-' && buf[1] == '0') + return "*"; + + return buf; +} + +static void +print_ax25_addr_raw(const ax25_address *addr) +{ + PRINT_FIELD_HEX_ARRAY("{", *addr, ax25_call); + tprints("}"); +} + +void +print_ax25_addr(const void /* ax25_address */ *addr_void) +{ + const ax25_address *addr = addr_void; + enum xlat_style xs = check_ax25_address(addr); + + if (xs == XLAT_STYLE_DEFAULT) + xs = xlat_verbose(xlat_verbosity); + + if (xs != XLAT_STYLE_ABBREV) + print_ax25_addr_raw(addr); + + if (xs == XLAT_STYLE_RAW) + return; + + const char *addr_str = ax25_addr2str(addr); + + (xs == XLAT_STYLE_VERBOSE ? tprints_comment : tprints)(addr_str); +} + +static void +print_sockaddr_data_ax25(const void *const buf, const int addrlen) +{ + const struct full_sockaddr_ax25 *const sax25 = buf; + size_t addrlen_us = MAX(addrlen, 0); + bool full = sax25->fsa_ax25.sax25_ndigis || + (addrlen_us > sizeof(struct sockaddr_ax25)); + + if (full) + tprints("fsa_ax25={"); + + tprints("sax25_call="); + print_ax25_addr(&sax25->fsa_ax25.sax25_call); + PRINT_FIELD_D(", ", sax25->fsa_ax25, sax25_ndigis); + + if (!full) + return; + + tprints("}"); + + size_t has_digis = MIN((addrlen_us - sizeof(sax25->fsa_ax25)) + / sizeof(sax25->fsa_digipeater[0]), + ARRAY_SIZE(sax25->fsa_digipeater)); + size_t want_digis = MIN( + (unsigned int) MAX(sax25->fsa_ax25.sax25_ndigis, 0), + ARRAY_SIZE(sax25->fsa_digipeater)); + size_t digis = MIN(has_digis, want_digis); + + if (want_digis == 0) + goto digis_end; + + tprints(", fsa_digipeater=["); + for (size_t i = 0; i < digis; i++) { + if (i) + tprints(", "); + + print_ax25_addr(sax25->fsa_digipeater + i); + } + + if (want_digis > has_digis) + tprintf("%s/* ??? */", digis ? ", " : ""); + + tprints("]"); + +digis_end: + if (addrlen_us > (has_digis * sizeof(sax25->fsa_digipeater[0]) + + sizeof(sax25->fsa_ax25))) + tprints(", ..."); } static void @@ -124,16 +377,33 @@ print_sockaddr_data_ipx(const void *const buf, const int addrlen) const struct sockaddr_ipx *const sa_ipx = buf; unsigned int i; - tprintf("sipx_port=htons(%u)" - ", sipx_network=htonl(%#08x)" + PRINT_FIELD_NET_PORT("", *sa_ipx, sipx_port); + tprintf(", sipx_network=htonl(%#08x)" ", sipx_node=[", - ntohs(sa_ipx->sipx_port), ntohl(sa_ipx->sipx_network)); for (i = 0; i < IPX_NODE_LEN; ++i) { tprintf("%s%#02x", i ? ", " : "", sa_ipx->sipx_node[i]); } - tprintf("], sipx_type=%#02x", sa_ipx->sipx_type); + PRINT_FIELD_0X("], ", *sa_ipx, sipx_type); +} + +void +print_x25_addr(const void /* struct x25_address */ *addr_void) +{ + const struct x25_address *addr = addr_void; + + tprints("{x25_addr="); + print_quoted_cstring(addr->x25_addr, sizeof(addr->x25_addr)); + tprints("}"); +} + +static void +print_sockaddr_data_x25(const void *const buf, const int addrlen) +{ + const struct sockaddr_x25 *const sa_x25 = buf; + + PRINT_FIELD_X25_ADDR("", *sa_x25, sx25_addr); } static void @@ -141,8 +411,34 @@ print_sockaddr_data_nl(const void *const buf, const int addrlen) { const struct sockaddr_nl *const sa_nl = buf; - tprintf("nl_pid=%d, nl_groups=%#08x", - sa_nl->nl_pid, sa_nl->nl_groups); + PRINT_FIELD_D("", *sa_nl, nl_pid); + PRINT_FIELD_0X(", ", *sa_nl, nl_groups); +} + +static void +print_sll_protocol(const struct sockaddr_ll *const sa_ll) +{ + int x_style = xlat_verbose(xlat_verbosity); + + tprints("sll_protocol="); + if (x_style != XLAT_STYLE_ABBREV) + print_quoted_string((const char *) &sa_ll->sll_protocol, + sizeof(sa_ll->sll_protocol), + QUOTE_FORCE_HEX); + + if (x_style == XLAT_STYLE_RAW) + return; + + if (x_style == XLAT_STYLE_VERBOSE) + tprints(" /* "); + + tprints("htons("); + printxval_search_ex(ethernet_protocols, ntohs(sa_ll->sll_protocol), + "ETH_P_???", XLAT_STYLE_ABBREV); + tprints(")"); + + if (x_style == XLAT_STYLE_VERBOSE) + tprints(" */"); } static void @@ -150,14 +446,12 @@ print_sockaddr_data_ll(const void *const buf, const int addrlen) { const struct sockaddr_ll *const sa_ll = buf; - tprints("sll_protocol=htons("); - printxval(ethernet_protocols, ntohs(sa_ll->sll_protocol), "ETH_P_???"); - tprints("), sll_ifindex="); - print_ifindex(sa_ll->sll_ifindex); + print_sll_protocol(sa_ll); + PRINT_FIELD_IFINDEX(", ", *sa_ll, sll_ifindex); tprints(", sll_hatype="); - printxval(arp_hardware_types, sa_ll->sll_hatype, "ARPHRD_???"); + printxval_search(arp_hardware_types, sa_ll->sll_hatype, "ARPHRD_???"); tprints(", sll_pkttype="); - printxval(af_packet_types, sa_ll->sll_pkttype, "PACKET_???"); + printxval_index(af_packet_types, sa_ll->sll_pkttype, "PACKET_???"); tprintf(", sll_halen=%u", sa_ll->sll_halen); if (sa_ll->sll_halen) { const unsigned int oob_halen = @@ -188,55 +482,165 @@ print_sockaddr_data_raw(const void *const buf, const int addrlen) print_quoted_string(data, datalen, 0); } -#ifdef HAVE_BLUETOOTH_BLUETOOTH_H +static uint16_t +btohs(uint16_t val) +{ +#ifdef WORDS_BIGENDIAN + return (val << 8) | (val >> 8); +#else + return val; +#endif +} + +static void +print_bluetooth_l2_psm(const char *prefix, uint16_t psm) +{ + const uint16_t psm_he = btohs(psm); + const char *psm_name = xlookup(bluetooth_l2_psm, psm_he); + const bool psm_str = psm_name || (psm_he >= L2CAP_PSM_LE_DYN_START + && psm_he <= L2CAP_PSM_LE_DYN_END) + || (psm_he >= L2CAP_PSM_DYN_START); + + tprintf("%shtobs(", prefix); + + if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV || !psm_str) + tprintf("%#x", psm_he); + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) + goto print_bluetooth_l2_psm_end; + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE || !psm_str) + tprints(" /* "); + + if (psm_name) { + tprints(psm_name); + } else if (psm_he >= L2CAP_PSM_LE_DYN_START + && psm_he <= L2CAP_PSM_LE_DYN_END) { + print_xlat(L2CAP_PSM_LE_DYN_START); + tprintf(" + %u", psm_he - L2CAP_PSM_LE_DYN_START); + } else if (psm_he >= L2CAP_PSM_DYN_START) { + print_xlat(L2CAP_PSM_DYN_START); + tprintf(" + %u", psm_he - L2CAP_PSM_DYN_START); + } else { + tprints("L2CAP_PSM_???"); + } + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE || !psm_str) + tprints(" */"); + +print_bluetooth_l2_psm_end: + tprints(")"); +} + +static void +print_bluetooth_l2_cid(const char *prefix, uint16_t cid) +{ + const uint16_t cid_he = btohs(cid); + const char *cid_name = xlookup(bluetooth_l2_cid, cid_he); + const bool cid_str = cid_name || (cid_he >= L2CAP_CID_DYN_START); + + tprintf("%shtobs(", prefix); + + if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV || !cid_str) + tprintf("%#x", cid_he); + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) + goto print_bluetooth_l2_cid_end; + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE || !cid_str) + tprints(" /* "); + + if (cid_name) { + tprints(cid_name); + } else if (cid_he >= L2CAP_CID_DYN_START) { + print_xlat(L2CAP_CID_DYN_START); + tprintf(" + %u", cid_he - L2CAP_CID_DYN_START); + } else { + tprints("L2CAP_CID_???"); + } + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE || !cid_str) + tprints(" */"); + +print_bluetooth_l2_cid_end: + tprints(")"); +} + static void print_sockaddr_data_bt(const void *const buf, const int addrlen) { + struct sockaddr_hci { + /* sa_family_t */ uint16_t hci_family; + uint16_t hci_dev; + uint16_t hci_channel; + }; + + struct bdaddr { + uint8_t b[6]; + } ATTRIBUTE_PACKED; + + struct sockaddr_sco { + /* sa_family_t */ uint16_t sco_family; + struct bdaddr sco_bdaddr; + }; + + struct sockaddr_rc { + /* sa_family_t */ uint16_t rc_family; + struct bdaddr rc_bdaddr; + uint8_t rc_channel; + }; + + struct sockaddr_l2 { + /* sa_family_t */ uint16_t l2_family; + /* little endian */ uint16_t l2_psm; + struct bdaddr l2_bdaddr; + /* little endian */ uint16_t l2_cid; + uint8_t l2_bdaddr_type; + }; + switch (addrlen) { - case sizeof(struct sockaddr_hci): { - const struct sockaddr_hci *const hci = buf; - tprintf("hci_dev=htobs(%hu), hci_channel=", - btohs(hci->hci_dev)); - printxval(hci_channels, hci->hci_channel, - "HCI_CHANNEL_???"); - break; - } - case sizeof(struct sockaddr_sco): { - const struct sockaddr_sco *const sco = buf; - tprintf("sco_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x", - sco->sco_bdaddr.b[0], sco->sco_bdaddr.b[1], - sco->sco_bdaddr.b[2], sco->sco_bdaddr.b[3], - sco->sco_bdaddr.b[4], sco->sco_bdaddr.b[5]); - break; - } - case sizeof(struct sockaddr_rc): { - const struct sockaddr_rc *const rc = buf; - tprintf("rc_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" - ", rc_channel=%u", - rc->rc_bdaddr.b[0], rc->rc_bdaddr.b[1], - rc->rc_bdaddr.b[2], rc->rc_bdaddr.b[3], - rc->rc_bdaddr.b[4], rc->rc_bdaddr.b[5], - rc->rc_channel); - break; - } - case sizeof(struct sockaddr_l2): { - const struct sockaddr_l2 *const l2 = buf; - tprintf("l2_psm=htobs(%hu)" - ", l2_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" - ", l2_cid=htobs(%hu), l2_bdaddr_type=%u", - btohs(l2->l2_psm), - l2->l2_bdaddr.b[0], l2->l2_bdaddr.b[1], - l2->l2_bdaddr.b[2], l2->l2_bdaddr.b[3], - l2->l2_bdaddr.b[4], l2->l2_bdaddr.b[5], - btohs(l2->l2_cid), l2->l2_bdaddr_type); - break; + case sizeof(struct sockaddr_hci): { + const struct sockaddr_hci *const hci = buf; + tprintf("hci_dev=htobs(%hu), hci_channel=", + btohs(hci->hci_dev)); + printxval_index(hci_channels, hci->hci_channel, + "HCI_CHANNEL_???"); + break; + } + case sizeof(struct sockaddr_sco): { + const struct sockaddr_sco *const sco = buf; + print_mac_addr("sco_bdaddr=", sco->sco_bdaddr.b, + sizeof(sco->sco_bdaddr.b)); + break; + } + case sizeof(struct sockaddr_rc): { + const struct sockaddr_rc *const rc = buf; + print_mac_addr("rc_bdaddr=", rc->rc_bdaddr.b, + sizeof(rc->rc_bdaddr.b)); + tprintf(", rc_channel=%u", rc->rc_channel); + break; + } + case offsetof(struct sockaddr_l2, l2_bdaddr_type): + case sizeof(struct sockaddr_l2): { + const struct sockaddr_l2 *const l2 = buf; + print_bluetooth_l2_psm("l2_psm=", l2->l2_psm); + print_mac_addr(", l2_bdaddr=", l2->l2_bdaddr.b, + sizeof(l2->l2_bdaddr.b)); + print_bluetooth_l2_cid(", l2_cid=", l2->l2_cid); + + if (addrlen == sizeof(struct sockaddr_l2)) { + tprints(", l2_bdaddr_type="); + printxval_index(bdaddr_types, l2->l2_bdaddr_type, + "BDADDR_???"); } - default: - print_sockaddr_data_raw(buf, addrlen); - break; + + break; + } + default: + print_sockaddr_data_raw(buf, addrlen); + break; } } -#endif /* HAVE_BLUETOOTH_BLUETOOTH_H */ typedef void (* const sockaddr_printer)(const void *const, const int); @@ -246,22 +650,22 @@ static const struct { } sa_printers[] = { [AF_UNIX] = { print_sockaddr_data_un, SIZEOF_SA_FAMILY + 1 }, [AF_INET] = { print_sockaddr_data_in, sizeof(struct sockaddr_in) }, + [AF_AX25] = { print_sockaddr_data_ax25, sizeof(struct sockaddr_ax25) }, [AF_IPX] = { print_sockaddr_data_ipx, sizeof(struct sockaddr_ipx) }, + [AF_X25] = { print_sockaddr_data_x25, sizeof(struct sockaddr_x25) }, [AF_INET6] = { print_sockaddr_data_in6, SIN6_MIN_LEN }, [AF_NETLINK] = { print_sockaddr_data_nl, SIZEOF_SA_FAMILY + 1 }, [AF_PACKET] = { print_sockaddr_data_ll, sizeof(struct sockaddr_ll) }, -#ifdef HAVE_BLUETOOTH_BLUETOOTH_H [AF_BLUETOOTH] = { print_sockaddr_data_bt, SIZEOF_SA_FAMILY + 1 }, -#endif }; void -print_sockaddr(struct tcb *tcp, const void *const buf, const int addrlen) +print_sockaddr(const void *const buf, const int addrlen) { const struct sockaddr *const sa = buf; tprints("{sa_family="); - printxval(addrfams, sa->sa_family, "AF_???"); + printxval_index(addrfams, sa->sa_family, "AF_???"); if (addrlen > (int) SIZEOF_SA_FAMILY) { tprints(", "); @@ -300,7 +704,7 @@ decode_sockaddr(struct tcb *const tcp, const kernel_ulong_t addr, int addrlen) memset(&addrbuf.pad[addrlen], 0, sizeof(addrbuf.pad) - addrlen); - print_sockaddr(tcp, &addrbuf, addrlen); + print_sockaddr(&addrbuf, addrlen); return addrbuf.sa.sa_family; } diff --git a/socketcall.c b/socketcall.c index 9f48a104..fa944617 100644 --- a/socketcall.c +++ b/socketcall.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -30,14 +11,7 @@ SYS_FUNC(socketcall) { - const unsigned int call = tcp->u_arg[0]; - const char *str = xlookup(socketcalls, call); - - if (str) - tprints(str); - else - tprintf("%d", call); - + printxval_d(socketcalls, tcp->u_arg[0], NULL); tprints(", "); printaddr(tcp->u_arg[1]); diff --git a/socketutils.c b/socketutils.c index d50ef831..d6191187 100644 --- a/socketutils.c +++ b/socketutils.c @@ -1,48 +1,35 @@ /* * Copyright (c) 2014 Zubin Mithra * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" #include #include #include -#include +#include "netlink.h" #include #include #include #include #include -#include "xlat/netlink_protocols.h" +#include #include #ifndef UNIX_PATH_MAX # define UNIX_PATH_MAX sizeof(((struct sockaddr_un *) 0)->sun_path) #endif +#include "xstring.h" + +#define XLAT_MACROS_ONLY +#include "xlat/inet_protocols.h" +#undef XLAT_MACROS_ONLY + typedef struct { unsigned long inode; char *details; @@ -53,30 +40,36 @@ static cache_entry cache[CACHE_SIZE]; #define CACHE_MASK (CACHE_SIZE - 1) static int -cache_and_print_inode_details(const unsigned long inode, char *const details) +cache_inode_details(const unsigned long inode, char *const details) { cache_entry *e = &cache[inode & CACHE_MASK]; free(e->details); e->inode = inode; e->details = details; - tprints(details); return 1; } -bool -print_sockaddr_by_inode_cached(const unsigned long inode) +static const char * +get_sockaddr_by_inode_cached(const unsigned long inode) { const cache_entry *const e = &cache[inode & CACHE_MASK]; - if (e && inode == e->inode) { - tprints(e->details); + return (e && inode == e->inode) ? e->details : NULL; +} + +static bool +print_sockaddr_by_inode_cached(const unsigned long inode) +{ + const char *const details = get_sockaddr_by_inode_cached(inode); + if (details) { + tprints(details); return true; } return false; } static bool -send_query(const int fd, void *req, size_t req_size) +send_query(struct tcb *tcp, const int fd, void *req, size_t req_size) { struct sockaddr_nl nladdr = { .nl_family = AF_NETLINK @@ -103,7 +96,8 @@ send_query(const int fd, void *req, size_t req_size) } static bool -inet_send_query(const int fd, const int family, const int proto) +inet_send_query(struct tcb *tcp, const int fd, const int family, + const int proto) { struct { const struct nlmsghdr nlh; @@ -120,13 +114,14 @@ inet_send_query(const int fd, const int family, const int proto) .idiag_states = -1 } }; - return send_query(fd, &req, sizeof(req)); + return send_query(tcp, fd, &req, sizeof(req)); } static int -inet_parse_response(const char *const proto_name, const void *const data, - const int data_len, const unsigned long inode) +inet_parse_response(const void *const data, const int data_len, + const unsigned long inode, void *opaque_data) { + const char *const proto_name = opaque_data; const struct inet_diag_msg *const diag_msg = data; static const char zero_addr[sizeof(struct in6_addr)]; socklen_t addr_size, text_size; @@ -136,7 +131,7 @@ inet_parse_response(const char *const proto_name, const void *const data, if (diag_msg->idiag_inode != inode) return 0; - switch(diag_msg->idiag_family) { + switch (diag_msg->idiag_family) { case AF_INET: addr_size = sizeof(struct in_addr); text_size = INET_ADDRSTRLEN; @@ -152,6 +147,10 @@ inet_parse_response(const char *const proto_name, const void *const data, char src_buf[text_size]; char *details; + /* open/closing brackets for IPv6 addresses */ + const char *ob = diag_msg->idiag_family == AF_INET6 ? "[" : ""; + const char *cb = diag_msg->idiag_family == AF_INET6 ? "]" : ""; + if (!inet_ntop(diag_msg->idiag_family, diag_msg->id.idiag_src, src_buf, text_size)) return -1; @@ -164,24 +163,27 @@ inet_parse_response(const char *const proto_name, const void *const data, dst_buf, text_size)) return -1; - if (asprintf(&details, "%s:[%s:%u->%s:%u]", proto_name, - src_buf, ntohs(diag_msg->id.idiag_sport), - dst_buf, ntohs(diag_msg->id.idiag_dport)) < 0) + if (asprintf(&details, "%s:[%s%s%s:%u->%s%s%s:%u]", proto_name, + ob, src_buf, cb, ntohs(diag_msg->id.idiag_sport), + ob, dst_buf, cb, ntohs(diag_msg->id.idiag_dport)) + < 0) return false; } else { - if (asprintf(&details, "%s:[%s:%u]", proto_name, src_buf, + if (asprintf(&details, "%s:[%s%s%s:%u]", + proto_name, ob, src_buf, cb, ntohs(diag_msg->id.idiag_sport)) < 0) return false; } - return cache_and_print_inode_details(inode, details); + return cache_inode_details(inode, details); } static bool -receive_responses(const int fd, const unsigned long inode, - const char *proto_name, - int (* parser) (const char *, const void *, - int, unsigned long)) +receive_responses(struct tcb *tcp, const int fd, const unsigned long inode, + const unsigned long expected_msg_type, + int (*parser)(const void *, int, + unsigned long, void *), + void *opaque_data) { static union { struct nlmsghdr hdr; @@ -213,13 +215,13 @@ receive_responses(const int fd, const unsigned long inode, } const struct nlmsghdr *h = &hdr_buf.hdr; - if (!NLMSG_OK(h, ret)) + if (!is_nlmsg_ok(h, ret)) return false; - for (; NLMSG_OK(h, ret); h = NLMSG_NEXT(h, ret)) { - if (h->nlmsg_type != SOCK_DIAG_BY_FAMILY) + for (; is_nlmsg_ok(h, ret); h = NLMSG_NEXT(h, ret)) { + if (h->nlmsg_type != expected_msg_type) return false; - const int rc = parser(proto_name, NLMSG_DATA(h), - h->nlmsg_len, inode); + const int rc = parser(NLMSG_DATA(h), + h->nlmsg_len, inode, opaque_data); if (rc > 0) return true; if (rc < 0) @@ -230,16 +232,15 @@ receive_responses(const int fd, const unsigned long inode, } static bool -inet_print(const int fd, const int family, const int protocol, - const unsigned long inode, const char *proto_name) +unix_send_query(struct tcb *tcp, const int fd, const unsigned long inode) { - return inet_send_query(fd, family, protocol) - && receive_responses(fd, inode, proto_name, inet_parse_response); -} + /* + * The kernel bug was fixed in mainline by commit v4.5-rc6~35^2~11 + * and backported to stable/linux-4.4.y by commit v4.4.4~297. + */ + const uint16_t dump_flag = + os_release < KERNEL_VERSION(4, 4, 4) ? NLM_F_DUMP : 0; -static bool -unix_send_query(const int fd, const unsigned long inode) -{ struct { const struct nlmsghdr nlh; const struct unix_diag_req udr; @@ -247,22 +248,24 @@ unix_send_query(const int fd, const unsigned long inode) .nlh = { .nlmsg_len = sizeof(req), .nlmsg_type = SOCK_DIAG_BY_FAMILY, - .nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST + .nlmsg_flags = NLM_F_REQUEST | dump_flag }, .udr = { .sdiag_family = AF_UNIX, .udiag_ino = inode, .udiag_states = -1, - .udiag_show = UDIAG_SHOW_NAME | UDIAG_SHOW_PEER + .udiag_show = UDIAG_SHOW_NAME | UDIAG_SHOW_PEER, + .udiag_cookie = { ~0U, ~0U } } }; - return send_query(fd, &req, sizeof(req)); + return send_query(tcp, fd, &req, sizeof(req)); } static int -unix_parse_response(const char *proto_name, const void *data, - const int data_len, const unsigned long inode) +unix_parse_response(const void *data, const int data_len, + const unsigned long inode, void *opaque_data) { + const char *proto_name = opaque_data; const struct unix_diag_msg *diag_msg = data; struct rtattr *attr; int rta_len = data_len - NLMSG_LENGTH(sizeof(*diag_msg)); @@ -306,7 +309,7 @@ unix_parse_response(const char *proto_name, const void *data, char peer_str[3 + sizeof(peer) * 3]; if (peer) - snprintf(peer_str, sizeof(peer_str), "->%u", peer); + xsprintf(peer_str, "->%u", peer); else peer_str[0] = '\0'; @@ -318,10 +321,10 @@ unix_parse_response(const char *proto_name, const void *data, if (path[0] == '\0') { outstr[1] = '@'; string_quote(path + 1, outstr + 2, - path_len - 1, QUOTE_0_TERMINATED); + path_len - 1, QUOTE_0_TERMINATED, NULL); } else { string_quote(path, outstr + 1, - path_len, QUOTE_0_TERMINATED); + path_len, QUOTE_0_TERMINATED, NULL); } path_str = outstr; } else { @@ -333,11 +336,11 @@ unix_parse_response(const char *proto_name, const void *data, peer_str, path_str) < 0) return -1; - return cache_and_print_inode_details(inode, details); + return cache_inode_details(inode, details); } static bool -netlink_send_query(const int fd, const unsigned long inode) +netlink_send_query(struct tcb *tcp, const int fd, const unsigned long inode) { struct { const struct nlmsghdr nlh; @@ -350,17 +353,17 @@ netlink_send_query(const int fd, const unsigned long inode) }, .ndr = { .sdiag_family = AF_NETLINK, - .sdiag_protocol = NDIAG_PROTO_ALL, - .ndiag_show = NDIAG_SHOW_MEMINFO + .sdiag_protocol = NDIAG_PROTO_ALL } }; - return send_query(fd, &req, sizeof(req)); + return send_query(tcp, fd, &req, sizeof(req)); } static int -netlink_parse_response(const char *proto_name, const void *data, - const int data_len, const unsigned long inode) +netlink_parse_response(const void *data, const int data_len, + const unsigned long inode, void *opaque_data) { + const char *proto_name = opaque_data; const struct netlink_diag_msg *const diag_msg = data; const char *netlink_proto; char *details; @@ -377,12 +380,7 @@ netlink_parse_response(const char *proto_name, const void *data, diag_msg->ndiag_protocol); if (netlink_proto) { - static const char netlink_prefix[] = "NETLINK_"; - const size_t netlink_prefix_len = - sizeof(netlink_prefix) -1; - if (strncmp(netlink_proto, netlink_prefix, - netlink_prefix_len) == 0) - netlink_proto += netlink_prefix_len; + netlink_proto = STR_STRIP_PREFIX(netlink_proto, "NETLINK_"); if (asprintf(&details, "%s:[%s:%u]", proto_name, netlink_proto, diag_msg->ndiag_portid) < 0) return -1; @@ -392,58 +390,87 @@ netlink_parse_response(const char *proto_name, const void *data, return -1; } - return cache_and_print_inode_details(inode, details); -} - -static bool -unix_print(const int fd, const unsigned long inode) -{ - return unix_send_query(fd, inode) - && receive_responses(fd, inode, "UNIX", unix_parse_response); -} - -static bool -tcp_v4_print(const int fd, const unsigned long inode) -{ - return inet_print(fd, AF_INET, IPPROTO_TCP, inode, "TCP"); -} - -static bool -udp_v4_print(const int fd, const unsigned long inode) -{ - return inet_print(fd, AF_INET, IPPROTO_UDP, inode, "UDP"); + return cache_inode_details(inode, details); } -static bool -tcp_v6_print(const int fd, const unsigned long inode) +static const char * +unix_get(struct tcb *tcp, const int fd, const int family, const int proto, + const unsigned long inode, const char *name) { - return inet_print(fd, AF_INET6, IPPROTO_TCP, inode, "TCPv6"); + return unix_send_query(tcp, fd, inode) + && receive_responses(tcp, fd, inode, SOCK_DIAG_BY_FAMILY, + unix_parse_response, (void *) name) + ? get_sockaddr_by_inode_cached(inode) : NULL; } -static bool -udp_v6_print(const int fd, const unsigned long inode) +static const char * +inet_get(struct tcb *tcp, const int fd, const int family, const int protocol, + const unsigned long inode, const char *proto_name) { - return inet_print(fd, AF_INET6, IPPROTO_UDP, inode, "UDPv6"); + return inet_send_query(tcp, fd, family, protocol) + && receive_responses(tcp, fd, inode, SOCK_DIAG_BY_FAMILY, + inet_parse_response, (void *) proto_name) + ? get_sockaddr_by_inode_cached(inode) : NULL; } -static bool -netlink_print(const int fd, const unsigned long inode) +static const char * +netlink_get(struct tcb *tcp, const int fd, const int family, const int protocol, + const unsigned long inode, const char *proto_name) { - return netlink_send_query(fd, inode) - && receive_responses(fd, inode, "NETLINK", - netlink_parse_response); + return netlink_send_query(tcp, fd, inode) + && receive_responses(tcp, fd, inode, SOCK_DIAG_BY_FAMILY, + netlink_parse_response, + (void *) proto_name) + ? get_sockaddr_by_inode_cached(inode) : NULL; } static const struct { const char *const name; - bool (*const print)(int, unsigned long); + const char * (*const get)(struct tcb *, int fd, int family, + int protocol, unsigned long inode, + const char *proto_name); + int family; + int proto; } protocols[] = { - [SOCK_PROTO_UNIX] = { "UNIX", unix_print }, - [SOCK_PROTO_TCP] = { "TCP", tcp_v4_print }, - [SOCK_PROTO_UDP] = { "UDP", udp_v4_print }, - [SOCK_PROTO_TCPv6] = { "TCPv6", tcp_v6_print }, - [SOCK_PROTO_UDPv6] = { "UDPv6", udp_v6_print }, - [SOCK_PROTO_NETLINK] = { "NETLINK", netlink_print } + [SOCK_PROTO_UNIX] = { "UNIX", unix_get, AF_UNIX}, + /* + * inet_diag handlers are currently implemented only for TCP, + * UDP(lite), SCTP, RAW, and DCCP, but we try to resolve it for all + * protocols anyway, just in case. + */ + [SOCK_PROTO_TCP] = + { "TCP", inet_get, AF_INET, IPPROTO_TCP }, + [SOCK_PROTO_UDP] = + { "UDP", inet_get, AF_INET, IPPROTO_UDP }, + [SOCK_PROTO_UDPLITE] = + { "UDPLITE", inet_get, AF_INET, IPPROTO_UDPLITE }, + [SOCK_PROTO_DCCP] = + { "DCCP", inet_get, AF_INET, IPPROTO_DCCP }, + [SOCK_PROTO_SCTP] = + { "SCTP", inet_get, AF_INET, IPPROTO_SCTP }, + [SOCK_PROTO_L2TP_IP] = + { "L2TP/IP", inet_get, AF_INET, IPPROTO_L2TP }, + [SOCK_PROTO_PING] = + { "PING", inet_get, AF_INET, IPPROTO_ICMP }, + [SOCK_PROTO_RAW] = + { "RAW", inet_get, AF_INET, IPPROTO_RAW }, + [SOCK_PROTO_TCPv6] = + { "TCPv6", inet_get, AF_INET6, IPPROTO_TCP }, + [SOCK_PROTO_UDPv6] = + { "UDPv6", inet_get, AF_INET6, IPPROTO_UDP }, + [SOCK_PROTO_UDPLITEv6] = + { "UDPLITEv6", inet_get, AF_INET6, IPPROTO_UDPLITE }, + [SOCK_PROTO_DCCPv6] = + { "DCCPv6", inet_get, AF_INET6, IPPROTO_DCCP }, + [SOCK_PROTO_SCTPv6] = + { "SCTPv6", inet_get, AF_INET6, IPPROTO_SCTP }, + [SOCK_PROTO_L2TP_IPv6] = + { "L2TP/IPv6", inet_get, AF_INET6, IPPROTO_L2TP }, + [SOCK_PROTO_PINGv6] = + { "PINGv6", inet_get, AF_INET6, IPPROTO_ICMP }, + [SOCK_PROTO_RAWv6] = + { "RAWv6", inet_get, AF_INET6, IPPROTO_RAW }, + [SOCK_PROTO_NETLINK] = { "NETLINK", netlink_get, AF_NETLINK }, }; enum sock_proto @@ -458,39 +485,185 @@ get_proto_by_name(const char *const name) return SOCK_PROTO_UNKNOWN; } -/* Given an inode number of a socket, print out the details - * of the ip address and port. */ +int +get_family_by_proto(enum sock_proto proto) +{ + if ((size_t) proto < ARRAY_SIZE(protocols)) + return protocols[proto].family; -bool -print_sockaddr_by_inode(const unsigned long inode, const enum sock_proto proto) + return AF_UNSPEC; +} + +static const char * +get_sockaddr_by_inode_uncached(struct tcb *tcp, const unsigned long inode, + const enum sock_proto proto) { if ((unsigned int) proto >= ARRAY_SIZE(protocols) || - (proto != SOCK_PROTO_UNKNOWN && !protocols[proto].print)) - return false; + (proto != SOCK_PROTO_UNKNOWN && !protocols[proto].get)) + return NULL; const int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG); if (fd < 0) - return false; - bool r = false; + return NULL; + const char *details = NULL; if (proto != SOCK_PROTO_UNKNOWN) { - r = protocols[proto].print(fd, inode); - if (!r) { - tprintf("%s:[%lu]", protocols[proto].name, inode); - r = true; - } + details = protocols[proto].get(tcp, fd, protocols[proto].family, + protocols[proto].proto, inode, + protocols[proto].name); } else { unsigned int i; for (i = (unsigned int) SOCK_PROTO_UNKNOWN + 1; i < ARRAY_SIZE(protocols); ++i) { - if (!protocols[i].print) + if (!protocols[i].get) continue; - r = protocols[i].print(fd, inode); - if (r) + details = protocols[i].get(tcp, fd, + protocols[proto].family, + protocols[proto].proto, + inode, + protocols[proto].name); + if (details) break; } } close(fd); - return r; + return details; +} + +static bool +print_sockaddr_by_inode_uncached(struct tcb *tcp, const unsigned long inode, + const enum sock_proto proto) +{ + const char *details = get_sockaddr_by_inode_uncached(tcp, inode, proto); + + if (details) { + tprints(details); + return true; + } + + if ((unsigned int) proto < ARRAY_SIZE(protocols) && + protocols[proto].name) { + tprintf("%s:[%lu]", protocols[proto].name, inode); + return true; + } + + return false; +} + +/* Given an inode number of a socket, return its protocol details. */ +const char * +get_sockaddr_by_inode(struct tcb *const tcp, const int fd, + const unsigned long inode) +{ + const char *details = get_sockaddr_by_inode_cached(inode); + return details ? details : + get_sockaddr_by_inode_uncached(tcp, inode, getfdproto(tcp, fd)); +} + +/* Given an inode number of a socket, print out its protocol details. */ +bool +print_sockaddr_by_inode(struct tcb *const tcp, const int fd, + const unsigned long inode) +{ + return print_sockaddr_by_inode_cached(inode) ? true : + print_sockaddr_by_inode_uncached(tcp, inode, + getfdproto(tcp, fd)); +} + +/* + * Managing the cache for decoding communications of Netlink GENERIC protocol + * + * As name shown Netlink GENERIC protocol is generic protocol. The + * numbers of msg types used in the protocol are not defined + * statically. Kernel defines them on demand. So the xlat converted + * from header files doesn't help for decoding the protocol. Following + * codes are building xlat(dyxlat) at runtime. + */ +static bool +genl_send_dump_families(struct tcb *tcp, const int fd) +{ + struct { + const struct nlmsghdr nlh; + struct genlmsghdr gnlh; + } req = { + .nlh = { + .nlmsg_len = sizeof(req), + .nlmsg_type = GENL_ID_CTRL, + .nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST, + }, + .gnlh = { + .cmd = CTRL_CMD_GETFAMILY, + } + }; + return send_query(tcp, fd, &req, sizeof(req)); +} + +static int +genl_parse_families_response(const void *const data, + const int data_len, const unsigned long inode, + void *opaque_data) +{ + struct dyxlat *const dyxlat = opaque_data; + const struct genlmsghdr *const gnlh = data; + struct rtattr *attr; + int rta_len = data_len - NLMSG_LENGTH(sizeof(*gnlh)); + + char *name = NULL; + unsigned int name_len = 0; + uint16_t *id = NULL; + + if (rta_len < 0) + return -1; + if (gnlh->cmd != CTRL_CMD_NEWFAMILY) + return -1; + if (gnlh->version != 2) + return -1; + + for (attr = (struct rtattr *) (gnlh + 1); + RTA_OK(attr, rta_len); + attr = RTA_NEXT(attr, rta_len)) { + switch (attr->rta_type) { + case CTRL_ATTR_FAMILY_NAME: + if (!name) { + name = RTA_DATA(attr); + name_len = RTA_PAYLOAD(attr); + } + break; + case CTRL_ATTR_FAMILY_ID: + if (!id && RTA_PAYLOAD(attr) == sizeof(*id)) + id = RTA_DATA(attr); + break; + } + + if (name && id) { + dyxlat_add_pair(dyxlat, *id, name, name_len); + name = NULL; + id = NULL; + } + } + + return 0; +} + +const struct xlat * +genl_families_xlat(struct tcb *tcp) +{ + static struct dyxlat *dyxlat; + + if (!dyxlat) { + dyxlat = dyxlat_alloc(32); + + int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_GENERIC); + if (fd < 0) + goto out; + + if (genl_send_dump_families(tcp, fd)) + receive_responses(tcp, fd, 0, GENL_ID_CTRL, + genl_parse_families_response, dyxlat); + close(fd); + } + +out: + return dyxlat_get(dyxlat); } diff --git a/sparc.c b/sparc.c new file mode 100644 index 00000000..608127a8 --- /dev/null +++ b/sparc.c @@ -0,0 +1,26 @@ +/* + * SPARC-specific syscall decoders. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" + +#if defined SPARC || defined SPARC64 + +# include "xlat/sparc_kern_features.h" + +SYS_FUNC(kern_features) +{ + if (entering(tcp) || syserror(tcp)) + return 0; + + tcp->auxstr = sprintflags("", sparc_kern_features, + (kernel_ulong_t) tcp->u_rval); + return RVAL_HEX | RVAL_STR; +} + +#endif /* SPARC || SPARC64 */ diff --git a/sram_alloc.c b/sram_alloc.c index 922746bb..c18e7660 100644 --- a/sram_alloc.c +++ b/sram_alloc.c @@ -1,10 +1,17 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" #ifdef BFIN -#include +# include -#include "xlat/sram_alloc_flags.h" +# include "xlat/sram_alloc_flags.h" SYS_FUNC(sram_alloc) { diff --git a/stat.c b/stat.c index 28bd15ef..c7ad4811 100644 --- a/stat.c +++ b/stat.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2005-2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/stat.h b/stat.h index 092d2687..bc1ba90e 100644 --- a/stat.h +++ b/stat.h @@ -1,32 +1,13 @@ /* * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #ifndef STRACE_STAT_H -#define STRACE_STAT_H +# define STRACE_STAT_H struct strace_stat { unsigned long long dev; @@ -45,6 +26,7 @@ struct strace_stat { unsigned long long atime_nsec; unsigned long long ctime_nsec; unsigned long long mtime_nsec; + bool has_nsec; }; #endif /* !STRACE_STAT_H */ diff --git a/stat64.c b/stat64.c index 09d203dc..62584728 100644 --- a/stat64.c +++ b/stat64.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2005-2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/statfs.c b/statfs.c index 00dd04c4..36c99a11 100644 --- a/statfs.c +++ b/statfs.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" SYS_FUNC(statfs) diff --git a/statfs.h b/statfs.h index c9864248..d2ac192c 100644 --- a/statfs.h +++ b/statfs.h @@ -1,32 +1,12 @@ /* - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #ifndef STRACE_STATFS_H -#define STRACE_STATFS_H +# define STRACE_STATFS_H struct strace_statfs { unsigned long long f_type; diff --git a/statfs64.c b/statfs64.c index cd433d51..f42307c4 100644 --- a/statfs64.c +++ b/statfs64.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" SYS_FUNC(statfs64) diff --git a/static_assert.h b/static_assert.h new file mode 100644 index 00000000..0bcfa80d --- /dev/null +++ b/static_assert.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_STATIC_ASSERT_H +# define STRACE_STATIC_ASSERT_H + +# include "assert.h" + +# if defined HAVE_STATIC_ASSERT + +/* static_assert is already available */ + +# elif defined HAVE__STATIC_ASSERT + +# undef static_assert +# define static_assert _Static_assert + +# else /* !HAVE_STATIC_ASSERT && !HAVE__STATIC_ASSERT */ + +# define static_assert(expr, message) \ + extern int (*strace_static_assert(int))[sizeof(int[2 * !!(expr) - 1])] + +# endif + +#endif /* !STRACE_STATIC_ASSERT_H */ diff --git a/statx.c b/statx.c new file mode 100644 index 00000000..9cc30c4f --- /dev/null +++ b/statx.c @@ -0,0 +1,95 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "print_fields.h" +#include "statx.h" + +#include + +#include "xlat/statx_masks.h" +#include "xlat/statx_attrs.h" +#include "xlat/at_statx_sync_types.h" + +SYS_FUNC(statx) +{ + if (entering(tcp)) { + print_dirfd(tcp, tcp->u_arg[0]); + printpath(tcp, tcp->u_arg[1]); + tprints(", "); + + unsigned int flags = tcp->u_arg[2]; + printflags(at_statx_sync_types, flags & AT_STATX_SYNC_TYPE, + NULL); + flags &= ~AT_STATX_SYNC_TYPE; + if (flags) { + tprints("|"); + printflags(at_flags, flags, NULL); + } + + tprints(", "); + printflags(statx_masks, tcp->u_arg[3], "STATX_???"); + tprints(", "); + } else { +#define PRINT_FIELD_TIME(field) \ + do { \ + tprintf(", " #field "={tv_sec=%" PRId64 \ + ", tv_nsec=%" PRIu32 "}", \ + stx.field.sec, stx.field.nsec); \ + tprints_comment(sprinttime_nsec(stx.field.sec, \ + zero_extend_signed_to_ull(stx.field.nsec))); \ + } while (0) + + struct_statx stx; + if (umove_or_printaddr(tcp, tcp->u_arg[4], &stx)) + return 0; + + tprints("{stx_mask="); + printflags(statx_masks, stx.stx_mask, "STATX_???"); + + if (!abbrev(tcp)) + PRINT_FIELD_U(", ", stx, stx_blksize); + + tprints(", stx_attributes="); + printflags(statx_attrs, stx.stx_attributes, "STATX_ATTR_???"); + + if (!abbrev(tcp)) { + PRINT_FIELD_U(", ", stx, stx_nlink); + printuid(", stx_uid=", stx.stx_uid); + printuid(", stx_gid=", stx.stx_gid); + } + + tprints(", stx_mode="); + print_symbolic_mode_t(stx.stx_mode); + + if (!abbrev(tcp)) + PRINT_FIELD_U(", ", stx, stx_ino); + + PRINT_FIELD_U(", ", stx, stx_size); + + if (!abbrev(tcp)) { + PRINT_FIELD_U(", ", stx, stx_blocks); + + tprints(", stx_attributes_mask="); + printflags(statx_attrs, stx.stx_attributes_mask, + "STATX_ATTR_???"); + + PRINT_FIELD_TIME(stx_atime); + PRINT_FIELD_TIME(stx_btime); + PRINT_FIELD_TIME(stx_ctime); + PRINT_FIELD_TIME(stx_mtime); + PRINT_FIELD_U(", ", stx, stx_rdev_major); + PRINT_FIELD_U(", ", stx, stx_rdev_minor); + PRINT_FIELD_U(", ", stx, stx_dev_major); + PRINT_FIELD_U(", ", stx, stx_dev_minor); + } else { + tprints(", ..."); + } + tprints("}"); + } + return 0; +} diff --git a/statx.h b/statx.h new file mode 100644 index 00000000..e4d8a26d --- /dev/null +++ b/statx.h @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_STATX_H +# define STRACE_STATX_H + +# include + +typedef struct { + int64_t sec; + int32_t nsec; + int32_t reserved; +} struct_statx_timestamp; + +typedef struct { + uint32_t stx_mask; /* What results were written [uncond] */ + uint32_t stx_blksize; /* Preferred general I/O size [uncond] */ + uint64_t stx_attributes; /* Flags conveying information about the file + [uncond] */ + + uint32_t stx_nlink; /* Number of hard links */ + uint32_t stx_uid; /* User ID of owner */ + uint32_t stx_gid; /* Group ID of owner */ + uint16_t stx_mode; /* File mode */ + uint16_t reserved0[1]; + + uint64_t stx_ino; /* Inode number */ + uint64_t stx_size; /* File size */ + uint64_t stx_blocks; /* Number of 512-byte blocks allocated */ + uint64_t stx_attributes_mask; /* Mask to show what's supported in + stx_attributes */ + + struct_statx_timestamp stx_atime; /* Last access time */ + struct_statx_timestamp stx_btime; /* File creation time */ + struct_statx_timestamp stx_ctime; /* Last attribute change time */ + struct_statx_timestamp stx_mtime; /* Last data modification time */ + + uint32_t stx_rdev_major; /* Device ID of special file [if bdev/cdev] */ + uint32_t stx_rdev_minor; + uint32_t stx_dev_major; /* ID of device containing file [uncond] */ + uint32_t stx_dev_minor; + + uint64_t reserved2[14]; /* Spare space for future expansion */ +} struct_statx; + +#endif /* !STRACE_STATX_H */ diff --git a/strace-graph b/strace-graph index 5435e864..41739a3c 100755 --- a/strace-graph +++ b/strace-graph @@ -9,29 +9,10 @@ # The script can also handle the output with strace -t, -tt, or -ttt. # It will add elapsed time for each process in that case. -# This script is Copyright (C) 1998 by Richard Braakman . - -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# Copyright (c) 1998 by Richard Braakman . +# Copyright (c) 1998-2018 The strace developers. + +# SPDX-License-Identifier: LGPL-2.1-or-later use strict; use warnings; @@ -41,6 +22,7 @@ my $floatform; # Scales for strace slowdown. Make configurable! my $scale_factor = 3.5; +my %running_fqname; while (<>) { my ($pid, $call, $args, $result, $time, $time_spent); @@ -222,12 +204,15 @@ my %pr; sub handle_trace { my ($pid, $call, $args, $result, $time) = @_; - my $p; + my $pid_fqname = $pid . "-" . $time; - if (defined $time and not defined $pr{$pid}{start}) { - $pr{$pid}{start} = $time; + if (defined $time and not defined $running_fqname{$pid}) { + $pr{$pid_fqname}{start} = $time; + $running_fqname{$pid} = $pid_fqname; } + $pid_fqname = $running_fqname{$pid}; + if ($call eq 'execve') { return if $result ne '0'; @@ -235,30 +220,34 @@ sub handle_trace { my ($basename) = $filename =~ m/([^\/]*)$/; if ($basename ne $$argv[0]) { $$argv[0] = "$basename($$argv[0])"; - } - my $seq = $pr{$pid}{seq}; + } + my $seq = $pr{$pid_fqname}{seq}; $seq = [] if not defined $seq; push @$seq, ['EXEC', $filename, $argv]; - $pr{$pid}{seq} = $seq; + $pr{$pid_fqname}{seq} = $seq; } elsif ($call eq 'fork' || $call eq 'clone' || $call eq 'vfork') { return if $result == 0; - my $seq = $pr{$pid}{seq}; + my $seq = $pr{$pid_fqname}{seq}; + my $result_fqname= $result . "-" . $time; $seq = [] if not defined $seq; - push @$seq, ['FORK', $result]; - $pr{$pid}{seq} = $seq; - $pr{$result}{parent} = $pid; - $pr{$result}{seq} = []; + push @$seq, ['FORK', $result_fqname]; + $pr{$pid_fqname}{seq} = $seq; + $pr{$result_fqname}{start} = $time; + $pr{$result_fqname}{parent} = $pid_fqname; + $pr{$result_fqname}{seq} = []; + $running_fqname{$result} = $result_fqname; } elsif ($call eq '_exit' || $call eq 'exit_group') { - $pr{$pid}{end} = $time if defined $time; + $pr{$running_fqname{$pid}}{end} = $time if defined $time and not defined $pr{$running_fqname{$pid}}{end}; + delete $running_fqname{$pid}; } } sub handle_killed { my ($pid, $time) = @_; - $pr{$pid}{end} = $time if defined $time; + $pr{$pid}{end} = $time if defined $time and not defined $pr{$pid}{end}; } sub straight_seq { @@ -321,11 +310,11 @@ sub display_pid_trace { } } elsif ($$elem[0] eq 'FORK') { if ($i == 1) { - if ($lead =~ /-$/) { + if ($lead =~ /-$/) { display_pid_trace($$elem[1], "$lead--+--"); - } else { + } else { display_pid_trace($$elem[1], "$lead +--"); - } + } } elsif ($i == @seq) { display_pid_trace($$elem[1], "$lead `--"); } else { diff --git a/strace-log-merge b/strace-log-merge index 8ab24091..93d87ba2 100755 --- a/strace-log-merge +++ b/strace-log-merge @@ -1,4 +1,11 @@ #!/bin/sh +# +# This script processes strace -ff -tt output. It merges the contents of all +# STRACE_LOG.PID files and sorts them, printing result on the standard output. +# +# Copyright (c) 2012-2019 The strace developers. +# +# SPDX-License-Identifier: LGPL-2.1-or-later show_usage() { @@ -13,6 +20,9 @@ option which prints timestamps (otherwise sorting won't do any good). __EOF__ } +dd='\([0-9][0-9]\)' +ds='\([0-9][0-9]*\)' + if [ $# -ne 1 ]; then show_usage >&2 exit 1 @@ -23,19 +33,56 @@ fi logfile=$1 -for file in "$logfile".*; do - [ -f "$file" ] || continue - suffix=${file#"$logfile".} - [ "$suffix" -gt 0 ] 2> /dev/null || - continue - pid=$(printf "%-5s" $suffix) +iterate_logfiles() +{ + local file suffix + + for file in "$logfile".*; do + [ -f "$file" ] || continue + suffix=${file#"$logfile".} + [ "$suffix" -gt 0 ] 2> /dev/null || + continue + "$@" "$suffix" "$file" + done +} + +max_suffix_length=0 +process_suffix() +{ + local suffix len + suffix="$1"; shift + + len=${#suffix} + if [ $len -gt $max_suffix_length ]; then + max_suffix_length=$len + fi +} + +process_logfile() +{ + local suffix file pid + suffix="$1"; shift + file="$1"; shift + + pid=$(printf "%-*s" $max_suffix_length $suffix) # Some strace logs have last line which is not '\n' terminated, # so add extra newline to every file. - # grep -v '^$' removes empty lines which may result. - sed "s/^/$pid /" < "$file" + # Empty lines are removed later. + sed -n "s/^\($dd:\)\?\($dd:\)\?\($ds\.\)\?$ds /\2\4\6\7 $pid \0/p" < "$file" echo -done \ -| sort -s -k2,2 | grep -v '^$' +} + +iterate_logfiles process_suffix + +[ $max_suffix_length -gt 0 ] || { + echo >&2 "${0##*/}: $logfile: strace output not found" + exit 1 +} + +iterate_logfiles process_logfile | + sort -s -n -k1,1 | + sed -n 's/^[0-9][0-9]* //p' | + grep -v '^$' rc=$? [ $rc -eq 1 ] && diff --git a/strace-log-merge.1 b/strace-log-merge.1 new file mode 100644 index 00000000..2236392e --- /dev/null +++ b/strace-log-merge.1 @@ -0,0 +1,126 @@ +.\" Copyright (c) 2017 The strace developers. +.\" All rights reserved. +.\" +.\" SPDX-License-Identifier: LGPL-2.1-or-later +.\" +.\" Required option. +.de OR +. ie \\n(.$-1 \ +. RI "\fB\\$1\fP" "\ \\$2" +. el \ +. BR "\\$1" +.. +.\" +.TH STRACE-LOG-MERGE 1 "2019-03-17" "strace 5.1" +.\" +.SH NAME +strace-log-merge \- merge strace \-ff \-tt output +.\" +.SH SYNOPSIS +.SY strace\-log\-merge +.IR STRACE_LOG +.YS +.SY strace\-log\-merge +.OR \-\-help +.YS +.\" +.SH DESCRIPTION +.B strace\-log\-merge +merges the output of +.B strace \-ff \-tt[t] +command, prepending PID to each line and sorting the result using time stamp as +a key. +.\" +.SH OPTIONS +.\" +.TP +.B \-\-help +Show program usage and exit. +.TP +.I STRACE_LOG +Output file name prefix of files produced by a +.B strace -ff -tt[t] +command. +.SH EXIT STATUS +.TP +.B 0 +Success +.TP +.B Non-zero +Error occurred: either no argument specified (in that case a usage is printed), +or something went wrong during the processing of +.IR STRACE_LOG ".*" +files. +.\" +.SH USAGE EXAMPLE +.sp +.nf +.ft CW +$ strace -o sleepy -ff -tt -e trace=execve,nanosleep \\ + sh -c 'sleep 0.1 & sleep 0.2 & sleep 0.3' +$ strace-log-merge sleepy | fold -w 72 -s +13475 21:13:52.040837 execve("/bin/sh", ["sh", "-c", "sleep 0.1 & sleep +0.2 & sleep 0."...], 0x7ffde54b2450 /* 33 vars */) = 0 +13478 21:13:52.044050 execve("/bin/sleep", ["sleep", "0.3"], +0x5631be4f87a8 /* 33 vars */) = 0 +13476 21:13:52.044269 execve("/bin/sleep", ["sleep", "0.1"], +0x5631be4f87a8 /* 33 vars */) = 0 +13477 21:13:52.044389 execve("/bin/sleep", ["sleep", "0.2"], +0x5631be4f87a8 /* 33 vars */) = 0 +13478 21:13:52.046207 nanosleep({tv_sec=0, tv_nsec=300000000}, NULL) = 0 +13476 21:13:52.046303 nanosleep({tv_sec=0, tv_nsec=100000000}, NULL) = 0 +13477 21:13:52.046318 nanosleep({tv_sec=0, tv_nsec=200000000}, NULL) = 0 +13476 21:13:52.146852 +++ exited with 0 +++ +13475 21:13:52.146942 --- SIGCHLD {si_signo=SIGCHLD, +si_code=CLD_EXITED, si_pid=13476, si_uid=1000, si_status=0, si_utime=0, +si_stime=0} --- +13477 21:13:52.247782 +++ exited with 0 +++ +13475 21:13:52.247885 --- SIGCHLD {si_signo=SIGCHLD, +si_code=CLD_EXITED, si_pid=13477, si_uid=1000, si_status=0, si_utime=0, +si_stime=0} --- +13478 21:13:52.347680 +++ exited with 0 +++ +13475 21:13:52.347786 --- SIGCHLD {si_signo=SIGCHLD, +si_code=CLD_EXITED, si_pid=13478, si_uid=1000, si_status=0, si_utime=0, +si_stime=0} --- +13475 21:13:52.348069 +++ exited with 0 +++ +.ft R +.fi +.sp +.\" +.SH NOTES +.I strace-log-merge +does not work well with +.B strace +logs generated by +.B strace -tt +invocation that pass midnight, as those lack the information required +for the proper sorting. +Employing the +.B -ttt +option in the respective +.B strace +invocation should solve the problem. +.\" +.SH BUGS +.I strace-log-merge +does not perform any checks whether the files specified are in the correct +format and implies that only files from a single +.I strace +session match +.IR STRACE_LOG ".*" +glob pattern. +.\" +.SH HISTORY +The initial version of +.I strace-log-merge +was written by Denys Vlasenko in 2012. +.\" +.SH REPORTING BUGS +Problems with +.B strace-log-merge +should be reported to the +.B strace +mailing list at . +.\" +.SH "SEE ALSO" +.BR strace (1) diff --git a/strace-log-merge.1.in b/strace-log-merge.1.in new file mode 100644 index 00000000..bdd89479 --- /dev/null +++ b/strace-log-merge.1.in @@ -0,0 +1,126 @@ +.\" Copyright (c) 2017 The strace developers. +.\" All rights reserved. +.\" +.\" SPDX-License-Identifier: LGPL-2.1-or-later +.\" +.\" Required option. +.de OR +. ie \\n(.$-1 \ +. RI "\fB\\$1\fP" "\ \\$2" +. el \ +. BR "\\$1" +.. +.\" +.TH STRACE-LOG-MERGE 1 "@MANPAGE_DATE@" "strace @VERSION@" +.\" +.SH NAME +strace-log-merge \- merge strace \-ff \-tt output +.\" +.SH SYNOPSIS +.SY strace\-log\-merge +.IR STRACE_LOG +.YS +.SY strace\-log\-merge +.OR \-\-help +.YS +.\" +.SH DESCRIPTION +.B strace\-log\-merge +merges the output of +.B strace \-ff \-tt[t] +command, prepending PID to each line and sorting the result using time stamp as +a key. +.\" +.SH OPTIONS +.\" +.TP +.B \-\-help +Show program usage and exit. +.TP +.I STRACE_LOG +Output file name prefix of files produced by a +.B strace -ff -tt[t] +command. +.SH EXIT STATUS +.TP +.B 0 +Success +.TP +.B Non-zero +Error occurred: either no argument specified (in that case a usage is printed), +or something went wrong during the processing of +.IR STRACE_LOG ".*" +files. +.\" +.SH USAGE EXAMPLE +.sp +.nf +.ft CW +$ strace -o sleepy -ff -tt -e trace=execve,nanosleep \\ + sh -c 'sleep 0.1 & sleep 0.2 & sleep 0.3' +$ strace-log-merge sleepy | fold -w 72 -s +13475 21:13:52.040837 execve("/bin/sh", ["sh", "-c", "sleep 0.1 & sleep +0.2 & sleep 0."...], 0x7ffde54b2450 /* 33 vars */) = 0 +13478 21:13:52.044050 execve("/bin/sleep", ["sleep", "0.3"], +0x5631be4f87a8 /* 33 vars */) = 0 +13476 21:13:52.044269 execve("/bin/sleep", ["sleep", "0.1"], +0x5631be4f87a8 /* 33 vars */) = 0 +13477 21:13:52.044389 execve("/bin/sleep", ["sleep", "0.2"], +0x5631be4f87a8 /* 33 vars */) = 0 +13478 21:13:52.046207 nanosleep({tv_sec=0, tv_nsec=300000000}, NULL) = 0 +13476 21:13:52.046303 nanosleep({tv_sec=0, tv_nsec=100000000}, NULL) = 0 +13477 21:13:52.046318 nanosleep({tv_sec=0, tv_nsec=200000000}, NULL) = 0 +13476 21:13:52.146852 +++ exited with 0 +++ +13475 21:13:52.146942 --- SIGCHLD {si_signo=SIGCHLD, +si_code=CLD_EXITED, si_pid=13476, si_uid=1000, si_status=0, si_utime=0, +si_stime=0} --- +13477 21:13:52.247782 +++ exited with 0 +++ +13475 21:13:52.247885 --- SIGCHLD {si_signo=SIGCHLD, +si_code=CLD_EXITED, si_pid=13477, si_uid=1000, si_status=0, si_utime=0, +si_stime=0} --- +13478 21:13:52.347680 +++ exited with 0 +++ +13475 21:13:52.347786 --- SIGCHLD {si_signo=SIGCHLD, +si_code=CLD_EXITED, si_pid=13478, si_uid=1000, si_status=0, si_utime=0, +si_stime=0} --- +13475 21:13:52.348069 +++ exited with 0 +++ +.ft R +.fi +.sp +.\" +.SH NOTES +.I strace-log-merge +does not work well with +.B strace +logs generated by +.B strace -tt +invocation that pass midnight, as those lack the information required +for the proper sorting. +Employing the +.B -ttt +option in the respective +.B strace +invocation should solve the problem. +.\" +.SH BUGS +.I strace-log-merge +does not perform any checks whether the files specified are in the correct +format and implies that only files from a single +.I strace +session match +.IR STRACE_LOG ".*" +glob pattern. +.\" +.SH HISTORY +The initial version of +.I strace-log-merge +was written by Denys Vlasenko in 2012. +.\" +.SH REPORTING BUGS +Problems with +.B strace-log-merge +should be reported to the +.B strace +mailing list at . +.\" +.SH "SEE ALSO" +.BR strace (1) diff --git a/strace.1 b/strace.1 index 9230766e..bd463f29 100644 --- a/strace.1 +++ b/strace.1 @@ -1,71 +1,87 @@ .\" Copyright (c) 1991, 1992 Paul Kranenburg .\" Copyright (c) 1993 Branko Lankester .\" Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey +.\" Copyright (c) 1996-2017 The strace developers. .\" All rights reserved. .\" -.\" Redistribution and use in source and binary forms, with or without -.\" modification, are permitted provided that the following conditions -.\" are met: -.\" 1. Redistributions of source code must retain the above copyright -.\" notice, this list of conditions and the following disclaimer. -.\" 2. Redistributions in binary form must reproduce the above copyright -.\" notice, this list of conditions and the following disclaimer in the -.\" documentation and/or other materials provided with the distribution. -.\" 3. The name of the author may not be used to endorse or promote products -.\" derived from this software without specific prior written permission. -.\" -.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" SPDX-License-Identifier: LGPL-2.1-or-later .de CW .sp +.in +4n .nf .ft CW .. .de CE .ft R .fi +.in .sp .. -.\" Macro IX is not defined in the groff macros -.if \n(.g \{\ -. de IX +.\" Like .OP, but with ellipsis at the end in order to signify that option +.\" can be provided multiple times. Based on .OP definition in groff's +.\" an-ext.tmac. +.de OM +. ie \\n(.$-1 \ +. RI "[\fB\\$1\fP" "\ \\$2" "]...\&" +. el \ +. RB "[" "\\$1" "]...\&" +.. +.\" Required option. +.de OR +. ie \\n(.$-1 \ +. RI "\fB\\$1\fP" "\ \\$2" +. el \ +. BR "\\$1" .. -.\} -.TH STRACE 1 "2010-03-30" +.TH STRACE 1 "2019-03-17" "strace 5.1" .SH NAME strace \- trace system calls and signals .SH SYNOPSIS -.B strace -[\fB-CdffhikqrtttTvVxxy\fR] -[\fB-I\fIn\fR] -[\fB-b\fIexecve\fR] -[\fB-e\fIexpr\fR]... -[\fB-a\fIcolumn\fR] -[\fB-o\fIfile\fR] -[\fB-s\fIstrsize\fR] -[\fB-P\fIpath\fR]... \fB-p\fIpid\fR... / -[\fB-D\fR] -[\fB-E\fIvar\fR[=\fIval\fR]]... [\fB-u\fIusername\fR] -\fIcommand\fR [\fIargs\fR] -.sp -.B strace -\fB-c\fR[\fBdf\fR] -[\fB-I\fIn\fR] -[\fB-b\fIexecve\fR] -[\fB-e\fIexpr\fR]... -[\fB-O\fIoverhead\fR] -[\fB-S\fIsortby\fR] \fB-p\fIpid\fR... / -[\fB-D\fR] -[\fB-E\fIvar\fR[=\fIval\fR]]... [\fB-u\fIusername\fR] -\fIcommand\fR [\fIargs\fR] +.SY strace +.if ''#' .ig end_unwind_opt +.OP \-ACdffhikqrtttTvVxxy +.end_unwind_opt +.if '#'#' .ig end_no_unwind_opt +.OP \-ACdffhiqrtttTvVxxy +.end_no_unwind_opt +.OP \-I n +.OP \-b execve +.OM \-e expr +.OP \-a column +.OP \-o file +.OP \-s strsize +.OP \-X format +.OM \-P path +.OM \-p pid +.BR "" { +.OR \-p pid +.BR "" | +.OP \-D +.OM \-E var\fR[=\fIval\fR] +.OP \-u username +.IR command " [" args ] +.BR "" } +.YS +.SY strace +.B \-c +.OP \-df +.OP \-I n +.OP \-b execve +.OM \-e expr +.OP \-O overhead +.OP \-S sortby +.OM \-P path +.OM \-p pid +.BR "" { +.OR \-p pid +.BR "" | +.OP \-D +.OM \-E var\fR[=\fIval\fR] +.OP -u username +.IR command " [" args ] +.BR "" } +.YS + .SH DESCRIPTION .IX "strace command" "" "\fLstrace\fR command" .LP @@ -135,39 +151,51 @@ read(0, 0x7ffff72cf5cf, 1) = ? ERESTARTSYS (To be restarted) rt_sigreturn(0xe) = 0 read(0, "", 1) = 0 .CE -Arguments are printed in symbolic form with a passion. +Arguments are printed in symbolic form with passion. This example shows the shell performing ">>xyzzy" output redirection: .CW open("xyzzy", O_WRONLY|O_APPEND|O_CREAT, 0666) = 3 .CE -Here the third argument of open is decoded by breaking down the +Here, the third argument of +.BR open (2) +is decoded by breaking down the flag argument into its three bitwise-OR constituents and printing the -mode value in octal by tradition. Where traditional or native +mode value in octal by tradition. Where the traditional or native usage differs from ANSI or POSIX, the latter forms are preferred. In some cases, .B strace -output has proven to be more readable than the source. +output is proven to be more readable than the source. .LP Structure pointers are dereferenced and the members are displayed -as appropriate. In all cases arguments are formatted in the most C-like +as appropriate. In most cases, arguments are formatted in the most C-like fashion possible. For example, the essence of the command "ls \-l /dev/null" is captured as: .CW -lstat("/dev/null", {st_mode=S_IFCHR|0666, st_rdev=makedev(1, 3), ...}) = 0 +lstat("/dev/null", {st_mode=S_IFCHR|0666, st_rdev=makedev(0x1, 0x3), ...}) = 0 .CE Notice how the 'struct stat' argument is dereferenced and how each member is -displayed symbolically. In particular, observe how the st_mode member -is carefully decoded into a bitwise-OR of symbolic and numeric values. -Also notice in this example that the first argument to lstat is an input -to the system call and the second argument is an output. Since output -arguments are not modified if the system call fails, arguments may not -always be dereferenced. For example, retrying the "ls \-l" example +displayed symbolically. In particular, observe how the +.B st_mode +member is carefully decoded into a bitwise-OR of symbolic and numeric values. +Also notice in this example that the first argument to +.BR lstat (2) +is an input to the system call and the second argument is an output. +Since output arguments are not modified if the system call fails, arguments may +not always be dereferenced. For example, retrying the "ls \-l" example with a non-existent file produces the following line: .CW lstat("/foo/bar", 0xb004) = \-1 ENOENT (No such file or directory) .CE In this case the porch light is on but nobody is home. .LP +Syscalls unknown to +.B strace +are printed raw, with the unknown system call number printed in hexadecimal form +and prefixed with "syscall_": +.CW +syscall_0xbad(0x1, 0x2, 0x3, 0x4, 0x5, 0x6) = -1 ENOSYS (Function not implemented) +.CE +.LP Character pointers are dereferenced and printed as C strings. Non-printing characters in strings are normally represented by ordinary C escape codes. @@ -176,32 +204,34 @@ Only the first (32 by default) bytes of strings are printed; longer strings have an ellipsis appended following the closing quote. Here is a line from "ls \-l" where the -.B getpwuid +.BR getpwuid (3) library routine is reading the password file: .CW read(3, "root::0:0:System Administrator:/"..., 1024) = 422 .CE While structures are annotated using curly braces, simple pointers and arrays are printed using square brackets with commas separating -elements. Here is an example from the command "id" on a system with -supplementary group ids: +elements. Here is an example from the command +.BR id (1) +on a system with supplementary group ids: .CW getgroups(32, [100, 0]) = 2 .CE On the other hand, bit-sets are also shown using square brackets -but set elements are separated only by a space. Here is the shell +but set elements are separated only by a space. Here is the shell, preparing to execute an external command: .CW sigprocmask(SIG_BLOCK, [CHLD TTOU], []) = 0 .CE -Here the second argument is a bit-set of two signals, SIGCHLD and SIGTTOU. -In some cases the bit-set is so full that printing out the unset +Here, the second argument is a bit-set of two signals, +.BR SIGCHLD " and " SIGTTOU . +In some cases, the bit-set is so full that printing out the unset elements is more valuable. In that case, the bit-set is prefixed by a tilde like this: .CW sigprocmask(SIG_UNBLOCK, ~[], NULL) = 0 .CE -Here the second argument represents the full set of all signals. +Here, the second argument represents the full set of all signals. .SH OPTIONS .SS Output format .TP 12 @@ -210,26 +240,32 @@ Align return values in a specific column (default column 40). .TP .B \-i Print the instruction pointer at the time of the system call. +.if ''#' .ig end_unwind .TP .B \-k -Print the execution stack trace of the traced processes after each system call (experimental). -This option is available only if -.B strace -is built with libunwind. +Print the execution stack trace of the traced processes after each system call. +.end_unwind .TP .BI "\-o " filename Write the trace output to the file .I filename rather than to stderr. -Use -.I filename.pid -if +.IR filename . pid +form is used if .B \-ff -is used. -If the argument begins with '|' or with '!' then the rest of the +option is supplied. +If the argument begins with '|' or '!', the rest of the argument is treated as a command and all output is piped to it. This is convenient for piping the debugging output to a program without affecting the redirections of executed programs. +The latter is not compatible with +.B \-ff +option currently. +.TP +.B \-A +Open the file provided in the +.B \-o +option in append mode. .TP .B \-q Suppress messages about attaching, detaching etc. This happens @@ -243,6 +279,13 @@ If given twice, suppress messages about process exit status. Print a relative timestamp upon entry to each system call. This records the time difference between the beginning of successive system calls. +Note that since +.B \-r +option uses the monotonic clock time for measuring time difference and not the +wall clock time, its measurements can differ from the difference in time +reported by the +.B \-t +option. .TP .BI "\-s " strsize Specify the maximum string size to print (the default is 32). Note @@ -250,7 +293,7 @@ that filenames are not considered strings and are always printed in full. .TP .B \-t -Prefix each line of the trace with the time of day. +Prefix each line of the trace with the wall clock time. .TP .B \-tt If given twice, the time printed will include the microseconds. @@ -270,23 +313,44 @@ Print all non-ASCII strings in hexadecimal string format. .B \-xx Print all strings in hexadecimal string format. .TP +.BI "\-X " format +Set the format for printing of named constants and flags. +Supported +.I format +values are: +.RS +.TP 10 +.B raw +Raw number output, without decoding. +.TP +.B abbrev +Output a named constant or a set of flags instead of the raw number if they are +found. +This is the default +.B strace +behaviour. +.TP +.B verbose +Output both the raw value and the decoded string (as a comment). +.RE +.TP .B \-y Print paths associated with file descriptor arguments. .TP .B \-yy -Print protocol specific information associated with socket file descriptors. +Print protocol specific information associated with socket file descriptors, +and block/character device number associated with device file descriptors. .SS Statistics .TP 12 .B \-c Count time, calls, and errors for each system call and report a summary on -program exit. On Linux, this attempts to show system time (CPU time spent -running in the kernel) independent of wall clock time. If +program exit, suppressing the regular output. +This attempts to show system time (CPU time spent running +in the kernel) independent of wall clock time. If .B \-c is used with -.B \-f -or -.B \-F -, only aggregate totals for all traced processes are kept. +.BR \-f , +only aggregate totals for all traced processes are kept. .TP .B \-C Like @@ -330,7 +394,7 @@ A qualifying expression which modifies which events to trace or how to trace them. The format of the expression is: .RS 15 .IP -[\,\fIqualifier\/\fB=\fR][\fB!\fR]\,\fIvalue1\/\fR[\fB,\,\fIvalue2\/\fR]... +[\,\fIqualifier\/\fB=\fR][\fB!\fR][\fB?\fR]\,\fIvalue1\/\fR[\fB,\fR[\fB?\fR]\,\fIvalue2\/\fR]... .RE .IP where @@ -344,8 +408,9 @@ is one of .BR read , .BR write , .BR fault , +.BR inject , or -.B inject +.B kvm and .I value is a qualifier-dependent symbol or number. The default @@ -361,6 +426,11 @@ system call. By contrast, .BR \-e "\ " trace "=!" open means to trace every system call except .BR open . +Question mark before the syscall qualification allows suppression of error +in case no syscalls matched the qualification provided. +Appending one of "@64", "@32", or "@x32" suffixes to the syscall qualification +allows specifying syscalls only for the 64-bit, 32-bit, or 32-on-64-bit +personality, respectively. In addition, the special values .B all and @@ -383,35 +453,103 @@ about the user/kernel boundary if only a subset of system calls are being monitored. The default is .BR trace = all . .TP -.BR "\-e\ trace" = file +\fB\-e\ trace\fR=/\,\fIregex\fR +Trace only those system calls that match the +.IR regex . +You can use +.B POSIX +Extended Regular Expression syntax (see +.BR regex (7)). +.TP +.BR "\-e\ trace" = %file +.TQ +.BR "\-e\ trace" = file " (deprecated)" Trace all system calls which take a file name as an argument. You can think of this as an abbreviation for .BR "\-e\ trace" = open , stat , chmod , unlink ,... which is useful to seeing what files the process is referencing. Furthermore, using the abbreviation will ensure that you don't accidentally forget to include a call like -.B lstat +.BR lstat (2) in the list. Betchya woulda forgot that one. .TP -.BR "\-e\ trace" = process +.BR "\-e\ trace" = %process +.TQ +.BR "\-e\ trace" = process " (deprecated)" Trace all system calls which involve process management. This is useful for watching the fork, wait, and exec steps of a process. .TP -.BR "\-e\ trace" = network +.BR "\-e\ trace" = %net +.TQ +.BR "\-e\ trace" = %network +.TQ +.BR "\-e\ trace" = network " (deprecated)" Trace all the network related system calls. .TP -.BR "\-e\ trace" = signal +.BR "\-e\ trace" = %signal +.TQ +.BR "\-e\ trace" = signal " (deprecated)" Trace all signal related system calls. .TP -.BR "\-e\ trace" = ipc +.BR "\-e\ trace" = %ipc +.TQ +.BR "\-e\ trace" = ipc " (deprecated)" Trace all IPC related system calls. .TP -.BR "\-e\ trace" = desc +.BR "\-e\ trace" = %desc +.TQ +.BR "\-e\ trace" = desc " (deprecated)" Trace all file descriptor related system calls. .TP -.BR "\-e\ trace" = memory +.BR "\-e\ trace" = %memory +.TQ +.BR "\-e\ trace" = memory " (deprecated)" Trace all memory mapping related system calls. .TP +.BR "\-e\ trace" = %stat +Trace stat syscall variants. +.TP +.BR "\-e\ trace" = %lstat +Trace lstat syscall variants. +.TP +.BR "\-e\ trace" = %fstat +Trace fstat and fstatat syscall variants. +.TP +.BR "\-e\ trace" = %%stat +Trace syscalls used for requesting file status (stat, lstat, fstat, fstatat, +statx, and their variants). +.TP +.BR "\-e\ trace" = %statfs +Trace statfs, statfs64, statvfs, osf_statfs, and osf_statfs64 system calls. +The same effect can be achieved with +.BR "\-e\ trace" = /^(.*_)?statv?fs +regular expression. +.TP +.BR "\-e\ trace" = %fstatfs +Trace fstatfs, fstatfs64, fstatvfs, osf_fstatfs, and osf_fstatfs64 system calls. +The same effect can be achieved with +.BR "\-e\ trace" = /fstatv?fs +regular expression. +.TP +.BR "\-e\ trace" = %%statfs +Trace syscalls related to file system statistics (statfs-like, fstatfs-like, +and ustat). The same effect can be achieved with +.BR "\-e\ trace" = /statv?fs|fsstat|ustat +regular expression. +.TP +.BR "\-e\ trace" = %pure +Trace syscalls that always succeed and have no arguments. +Currently, this list includes +.BR arc_gettls "(2), " getdtablesize "(2), " getegid "(2), " getegid32 "(2)," +.BR geteuid "(2), " geteuid32 "(2), " getgid "(2), " getgid32 "(2)," +.BR getpagesize "(2), " getpgrp "(2), " getpid "(2), " getppid "(2)," +.BR get_thread_area (2) +(on architectures other than x86), +.BR gettid "(2), " get_tls "(2), " getuid "(2), " getuid32 "(2)," +.BR getxgid "(2), " getxpid "(2), " getxuid "(2), " kern_features "(2), and" +.BR metag_get_tls "(2)" +syscalls. +.TP \fB\-e\ abbrev\fR=\,\fIset\fR Abbreviate the output from printing each member of large structures. The default is @@ -432,15 +570,20 @@ This option has the effect of causing all arguments to be printed in hexadecimal. This is mostly useful if you don't trust the decoding or you need to know the actual numeric value of an argument. +See also +.B \-X raw +option. .TP \fB\-e\ signal\fR=\,\fIset\fR Trace only the specified subset of signals. The default is .BR signal = all . For example, -.B signal "=!" SIGIO +.BR signal "=!" SIGIO (or .BR signal "=!" io ) -causes SIGIO signals not to be traced. +causes +.B SIGIO +signals not to be traced. .TP \fB\-e\ read\fR=\,\fIset\fR Perform a full hexadecimal and ASCII dump of all the data read from @@ -470,14 +613,16 @@ Note that this is independent from the normal tracing of the system call which is controlled by the option .BR -e "\ " trace = write . .TP -\fB\-e\ inject\fR=\,\fIset\/\fR[:\fBerror\fR=\,\fIerrno\/\fR|:\fBretval\fR=\,\fIvalue\/\fR][:\fBsignal\fR=\,\fIsig\/\fR][:\fBwhen\fR=\,\fIexpr\/\fR] +\fB\-e\ inject\fR=\,\fIset\/\fR[:\fBerror\fR=\,\fIerrno\/\fR|:\fBretval\fR=\,\fIvalue\/\fR][:\fBsignal\fR=\,\fIsig\/\fR][:\fBsyscall\fR=\fIsyscall\fR][:\fBdelay_enter\fR=\,\fIusecs\/\fR][:\fBdelay_exit\fR=\,\fIusecs\/\fR][:\fBwhen\fR=\,\fIexpr\/\fR] Perform syscall tampering for the specified set of syscalls. At least one of .BR error , .BR retval , +.BR signal , +.BR delay_enter , or -.B signal +.B delay_exit options has to be specified. .B error and @@ -486,7 +631,8 @@ are mutually exclusive. If :\fBerror\fR=\,\fIerrno\/\fR option is specified, a fault is injected into a syscall invocation: -the syscall number is replaced by -1 which corresponds to an invalid syscall, +the syscall number is replaced by -1 which corresponds to an invalid syscall +(unless a syscall is specified with :\fBsyscall=\fR option), and the error code is specified using a symbolic .I errno value like @@ -504,19 +650,35 @@ or a numeric value within 1..\fBSIGRTMAX\fR range, that signal is delivered on entering every syscall specified by the .IR set . +If :\fBdelay_enter\fR=\,\fIusecs\/\fR or :\fBdelay_exit\fR=\,\fIusecs\/\fR +options are specified, delay injection is performed: the tracee is delayed +by at least +.IR usecs +microseconds on entering or exiting the syscall. + If :\fBsignal\fR=\,\fIsig\/\fR option is specified without -:\fBerror\fR=\,\fIerrno\/\fR or :\fBretval\fR=\,\fIvalue\/\fR options, +:\fBerror\fR=\,\fIerrno\/\fR, :\fBretval\fR=\,\fIvalue\/\fR or +:\fBdelay_{enter,exit}\fR=\,\fIusecs\/\fR options, then only a signal .I sig -is delivered without a syscall fault injection. +is delivered without a syscall fault or delay injection. Conversely, :\fBerror\fR=\,\fIerrno\/\fR or :\fBretval\fR=\,\fIvalue\/\fR option without -:\fBsignal\fR=\,\fIsig\/\fR option injects a fault without delivering a signal. +:\fBdelay_enter\fR=\,\fIusecs\/\fR, +:\fBdelay_exit\fR=\,\fIusecs\/\fR or +:\fBsignal\fR=\,\fIsig\/\fR options injects a fault without delivering a signal +or injecting a delay, etc. If both :\fBerror\fR=\,\fIerrno\/\fR or :\fBretval\fR=\,\fIvalue\/\fR and :\fBsignal\fR=\,\fIsig\/\fR options are specified, then both a fault or success is injected and a signal is delivered. +if :\fBsyscall\fR=\fIsyscall\fR option is specified, the corresponding syscall +with no side effects is injected instead of -1. +Currently, only "pure" (see +.BR "-e trace" = "%pure" +description) syscalls can be specified there. + Unless a :\fBwhen\fR=\,\fIexpr\fR subexpression is specified, an injection is being made into every invocation of each syscall from the .IR set . @@ -569,8 +731,9 @@ An injection expression can contain only one .BR error = or .BR retval = -specification. -If an injection expression contains multiple +specification, and only one +.BR signal = +specification. If an injection expression contains multiple .BR when = specifications, the last one takes precedence. @@ -589,7 +752,11 @@ This is equivalent to more generic \fB\-e\ inject\fR= expression with default value of .I errno option set to -.IR ENOSYS . +.BR ENOSYS . +.TP +.BR "\-e\ kvm" = vcpu +Print the exit reason of kvm vcpu. Requires Linux kernel version 4.16.0 +or higher. .TP .BI "\-P " path @@ -609,10 +776,11 @@ this option to get all of the gory details. .BI "\-b " syscall If specified syscall is reached, detach from traced process. Currently, only -.I execve +.BR execve (2) syscall is supported. This option is useful if you want to trace -multi-threaded process and therefore require -f, but don't want -to trace its (potentially very complex) children. +multi-threaded process and therefore require +.BR \-f , +but don't want to trace its (potentially very complex) children. .TP .B \-D Run tracer process as a detached grandchild, not as parent of the @@ -631,26 +799,55 @@ system calls. Note that .B \-p .I PID .B \-f -will attach all threads of process PID if it is multi-threaded, -not only thread with thread_id = PID. +will attach all threads of process +.I PID +if it is multi-threaded, not only thread with +.IR thread_id " = " PID . .TP .B \-ff If the .B \-o .I filename option is in effect, each processes trace is written to -.I filename.pid -where pid is the numeric process id of each process. +.IR filename . pid +where +.I pid +is the numeric process id of each process. This is incompatible with .BR \-c , since no per-process counts are kept. + +One might want to consider using +.BR strace-log-merge (1) +to obtain a combined strace log view. .TP .BI "\-I " interruptible -When strace can be interrupted by signals (such as pressing ^C). -1: no signals are blocked; 2: fatal signals are blocked while decoding syscall -(default); 3: fatal signals are always blocked (default if '-o FILE PROG'); -4: fatal signals and SIGTSTP (^Z) are always blocked (useful to make -strace -o FILE PROG not stop on ^Z). +When +.B strace +can be interrupted by signals (such as pressing +.BR CTRL\-C ). +.RS +.TP 4 +.B 1 +no signals are blocked; +.TQ +.B 2 +fatal signals are blocked while decoding syscall (default); +.TQ +.B 3 +fatal signals are always blocked (default if +.BR -o " " \fIFILE\fR " " \fIPROG\fR ); +.TQ +.B 4 +fatal signals and +.BR SIGTSTP " (" CTRL\-Z ) +are always blocked (useful to make +.BI "strace -o " "FILE PROG" +not stop on +.BR CTRL\-Z , +default if +.BR \-D ). +.RE .SS Startup .TP 12 \fB\-E\ \fIvar\fR=\,\fIval\fR @@ -670,8 +867,8 @@ Attach to the process with the process .I pid and begin tracing. The trace may be terminated -at any time by a keyboard interrupt signal (\c -.SM CTRL\s0-C). +at any time by a keyboard interrupt signal +.RB ( CTRL\-C ). .B strace will respond by detaching itself from the traced process(es) leaving it (them) to continue running. @@ -701,8 +898,15 @@ Show some debugging output of itself on the standard error. .TP .B \-F -This option is now obsolete and it has the same functionality as -.BR \-f . +This option is deprecated. It is retained for backward compatibility only +and may be removed in future releases. +Usage of multiple instances of +.B \-F +option is still equivalent to a single +.BR \-f , +and it is ignored at all if used along with one or more instances of +.B \-f +option. .TP .B \-h Print the help summary. @@ -724,7 +928,8 @@ terminates itself with the same signal, so that .B strace can be used as a wrapper process transparent to the invoking parent process. Note that parent-child relationship (signal stop notifications, -getppid() value, etc) between traced process and its parent are not preserved +.BR getppid (2) +value, etc) between traced process and its parent are not preserved unless .B \-D is used. @@ -760,9 +965,72 @@ where members of the .B trace group are trusted users. If you do use this feature, please remember to install -a non-setuid version of +a regular non-setuid version of +.B strace +for ordinary users to use. +.SH "MULTIPLE PERSONALITY SUPPORT" +On some architectures, +.B strace +supports decoding of syscalls for processes that use different ABI rather than +the one +.B strace +uses. +Specifically, in addition to decoding native ABI, +.B strace +can decode the following ABIs on the following architectures: +.TS H +allbox; +lb lb +l l. +Architecture ABIs supported +x86_64 i386, x32 (when built as an x86_64 application); i386 (when built as an x32 application) +AArch64 ARM 32-bit EABI +PowerPC 64-bit PowerPC 32-bit +RISC-V 64-bit RISC-V 32-bit +s390x s390 +SPARC 64-bit SPARC 32-bit +TILE 64-bit TILE 32-bit +.TE +.PP +This support is optional and relies on ability to generate and parse structure +definitions during the build time. +Please refer to the output of the +.B strace \-V +command in order to figure out what support is available in your +.B strace +build ("non-native" refers to an ABI that differs from the ABI +.B strace +has): +.TP 15 +.B m32-mpers +.B strace +can trace and properly decode non-native 32-bit binaries. +.TP +.B no-m32-mpers +.B strace +can trace, but cannot properly decode non-native 32-bit binaries. +.TP +.B mx32-mpers .B strace -for ordinary lusers to use. +can trace and properly decode non-native 32-on-64-bit binaries. +.TP +.B no-mx32-mpers +.B strace +can trace, but cannot properly decode non-native 32-on-64-bit binaries. +.PP +If the output contains neither +.B m32-mpers +nor +.BR no-m32-mpers , +then decoding of non-native 32-bit binaries is not implemented at all +or not applicable. +.PP +Likewise, if the output contains neither +.B mx32-mpers +nor +.BR no-mx32-mpers , +then decoding of non-native 32-on-64-bit binaries is not implemented at all +or not applicable. .SH NOTES It is a pity that so much tracing clutter is produced by systems employing shared libraries. @@ -774,14 +1042,15 @@ sometimes possible to make deductive inferences about process behavior using inputs and outputs as propositions. .LP In some cases, a system call will differ from the documented behavior -or have a different name. For example, on System V-derived systems -the true -.BR time (2) -system call does not take an argument and the -.B stat -function is called -.B xstat -and takes an extra leading argument. These +or have a different name. For example, the +.BR faccessat (2) +system call does not have +.I flags +argument, and the +.BR setrlimit (2) +library function uses +.BR prlimit64 (2) +system call on modern (2.6.38+) kernels. These discrepancies are normal but idiosyncratic characteristics of the system call interface and are accounted for by C library wrapper functions. @@ -798,15 +1067,40 @@ ARM syscall and Xtensa syscall are filtered and printed as .BR fadvise64_64 (2). .LP +On x32, syscalls that are intended to be used by 64-bit processes and not x32 +ones (for example, +.BR readv (2), +that has syscall number 19 on x86_64, with its x32 counterpart has syscall +number 515), but called with +.B __X32_SYSCALL_BIT +flag being set, are designated with +.B "#64" +suffix. +.LP On some platforms a process that is attached to with the .B \-p -option may observe a spurious EINTR return from the current -system call that is not restartable. (Ideally, all system calls -should be restarted on strace attach, making the attach invisible +option may observe a spurious +.B EINTR +return from the current system call that is not restartable. +(Ideally, all system calls should be restarted on +.B strace +attach, making the attach invisible to the traced process, but a few system calls aren't. Arguably, every instance of such behavior is a kernel bug.) This may have an unpredictable effect on the process if the process takes no action to restart the system call. +.LP +As +.B strace +executes the specified +.I command +directly and does not employ a shell for that, scripts without shebang +that usually run just fine when invoked by shell fail to execute with +.B ENOEXEC +error. +It is advisable to manually supply a shell as a +.I command +with the script as its argument. .SH BUGS Programs that use the .I setuid @@ -819,17 +1113,15 @@ A traced process runs slowly. .LP Traced processes which are descended from .I command -may be left running after an interrupt signal (\c -.SM CTRL\s0-C). -.LP -The -.B \-i -option is weakly supported. +may be left running after an interrupt signal +.RB ( CTRL\-C ). .SH HISTORY The original .B strace was written by Paul Kranenburg -for SunOS and was inspired by its trace utility. +for SunOS and was inspired by its +.B trace +utility. The SunOS version of .B strace was ported to Linux and enhanced @@ -855,14 +1147,56 @@ automatic configuration support. In 1995 he ported .B strace to Irix and tired of writing about himself in the third person. +.PP +Beginning with 1996, +.B strace +was maintained by Wichert Akkerman. +During his tenure, +.B strace +development migrated to CVS; ports to FreeBSD and many architectures on Linux +(including ARM, IA-64, MIPS, PA-RISC, PowerPC, s390, SPARC) were introduced. +In 2002, the burden of +.B strace +maintainership was transferred to Roland McGrath. +Since then, +.B strace +gained support for several new Linux architectures (AMD64, s390x, SuperH), +bi-architecture support for some of them, and received numerous additions and +improvements in syscalls decoders on Linux; +.B strace +development migrated to +.B git +during that period. +Since 2009, +.B strace +is actively maintained by Dmitry Levin. +.B strace +gained support for AArch64, ARC, AVR32, Blackfin, Meta, Nios II, OpenSISC 1000, +RISC-V, Tile/TileGx, Xtensa architectures since that time. +In 2012, unmaintained and apparently broken support for non-Linux operating +systems was removed. +Also, in 2012 +.B strace +gained support for path tracing and file descriptor path decoding. +In 2014, support for stack traces printing was added. +In 2016, syscall fault injection was implemented. +.PP +For the additional information, please refer to the +.B NEWS +file and +.B strace +repository commit log. .SH REPORTING BUGS Problems with .B strace should be reported to the .B strace -mailing list at . +mailing list at . .SH "SEE ALSO" +.BR strace-log-merge (1), .BR ltrace (1), +.BR perf-trace (1), +.BR trace-cmd (1), .BR time (1), .BR ptrace (2), .BR proc (5) diff --git a/strace.1.in b/strace.1.in new file mode 100644 index 00000000..76a74119 --- /dev/null +++ b/strace.1.in @@ -0,0 +1,1202 @@ +.\" Copyright (c) 1991, 1992 Paul Kranenburg +.\" Copyright (c) 1993 Branko Lankester +.\" Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey +.\" Copyright (c) 1996-2017 The strace developers. +.\" All rights reserved. +.\" +.\" SPDX-License-Identifier: LGPL-2.1-or-later +.de CW +.sp +.in +4n +.nf +.ft CW +.. +.de CE +.ft R +.fi +.in +.sp +.. +.\" Like .OP, but with ellipsis at the end in order to signify that option +.\" can be provided multiple times. Based on .OP definition in groff's +.\" an-ext.tmac. +.de OM +. ie \\n(.$-1 \ +. RI "[\fB\\$1\fP" "\ \\$2" "]...\&" +. el \ +. RB "[" "\\$1" "]...\&" +.. +.\" Required option. +.de OR +. ie \\n(.$-1 \ +. RI "\fB\\$1\fP" "\ \\$2" +. el \ +. BR "\\$1" +.. +.TH STRACE 1 "@MANPAGE_DATE@" "strace @VERSION@" +.SH NAME +strace \- trace system calls and signals +.SH SYNOPSIS +.SY strace +.if '@ENABLE_STACKTRACE_TRUE@'#' .ig end_unwind_opt +.OP \-ACdffhikqrtttTvVxxy +.end_unwind_opt +.if '@ENABLE_STACKTRACE_FALSE@'#' .ig end_no_unwind_opt +.OP \-ACdffhiqrtttTvVxxy +.end_no_unwind_opt +.OP \-I n +.OP \-b execve +.OM \-e expr +.OP \-a column +.OP \-o file +.OP \-s strsize +.OP \-X format +.OM \-P path +.OM \-p pid +.BR "" { +.OR \-p pid +.BR "" | +.OP \-D +.OM \-E var\fR[=\fIval\fR] +.OP \-u username +.IR command " [" args ] +.BR "" } +.YS +.SY strace +.B \-c +.OP \-df +.OP \-I n +.OP \-b execve +.OM \-e expr +.OP \-O overhead +.OP \-S sortby +.OM \-P path +.OM \-p pid +.BR "" { +.OR \-p pid +.BR "" | +.OP \-D +.OM \-E var\fR[=\fIval\fR] +.OP -u username +.IR command " [" args ] +.BR "" } +.YS + +.SH DESCRIPTION +.IX "strace command" "" "\fLstrace\fR command" +.LP +In the simplest case +.B strace +runs the specified +.I command +until it exits. +It intercepts and records the system calls which are called +by a process and the signals which are received by a process. +The name of each system call, its arguments and its return value +are printed on standard error or to the file specified with the +.B \-o +option. +.LP +.B strace +is a useful diagnostic, instructional, and debugging tool. +System administrators, diagnosticians and trouble-shooters will find +it invaluable for solving problems with +programs for which the source is not readily available since +they do not need to be recompiled in order to trace them. +Students, hackers and the overly-curious will find that +a great deal can be learned about a system and its system calls by +tracing even ordinary programs. And programmers will find that +since system calls and signals are events that happen at the user/kernel +interface, a close examination of this boundary is very +useful for bug isolation, sanity checking and +attempting to capture race conditions. +.LP +Each line in the trace contains the system call name, followed +by its arguments in parentheses and its return value. +An example from stracing the command "cat /dev/null" is: +.CW +open("/dev/null", O_RDONLY) = 3 +.CE +Errors (typically a return value of \-1) have the errno symbol +and error string appended. +.CW +open("/foo/bar", O_RDONLY) = \-1 ENOENT (No such file or directory) +.CE +Signals are printed as signal symbol and decoded siginfo structure. +An excerpt from stracing and interrupting the command "sleep 666" is: +.CW +sigsuspend([] +--- SIGINT {si_signo=SIGINT, si_code=SI_USER, si_pid=...} --- ++++ killed by SIGINT +++ +.CE +If a system call is being executed and meanwhile another one is being called +from a different thread/process then +.B strace +will try to preserve the order of those events and mark the ongoing call as +being +.IR unfinished . +When the call returns it will be marked as +.IR resumed . +.CW +[pid 28772] select(4, [3], NULL, NULL, NULL +[pid 28779] clock_gettime(CLOCK_REALTIME, {1130322148, 939977000}) = 0 +[pid 28772] <... select resumed> ) = 1 (in [3]) +.CE +Interruption of a (restartable) system call by a signal delivery is processed +differently as kernel terminates the system call and also arranges its +immediate reexecution after the signal handler completes. +.CW +read(0, 0x7ffff72cf5cf, 1) = ? ERESTARTSYS (To be restarted) +--- SIGALRM ... --- +rt_sigreturn(0xe) = 0 +read(0, "", 1) = 0 +.CE +Arguments are printed in symbolic form with passion. +This example shows the shell performing ">>xyzzy" output redirection: +.CW +open("xyzzy", O_WRONLY|O_APPEND|O_CREAT, 0666) = 3 +.CE +Here, the third argument of +.BR open (2) +is decoded by breaking down the +flag argument into its three bitwise-OR constituents and printing the +mode value in octal by tradition. Where the traditional or native +usage differs from ANSI or POSIX, the latter forms are preferred. +In some cases, +.B strace +output is proven to be more readable than the source. +.LP +Structure pointers are dereferenced and the members are displayed +as appropriate. In most cases, arguments are formatted in the most C-like +fashion possible. +For example, the essence of the command "ls \-l /dev/null" is captured as: +.CW +lstat("/dev/null", {st_mode=S_IFCHR|0666, st_rdev=makedev(0x1, 0x3), ...}) = 0 +.CE +Notice how the 'struct stat' argument is dereferenced and how each member is +displayed symbolically. In particular, observe how the +.B st_mode +member is carefully decoded into a bitwise-OR of symbolic and numeric values. +Also notice in this example that the first argument to +.BR lstat (2) +is an input to the system call and the second argument is an output. +Since output arguments are not modified if the system call fails, arguments may +not always be dereferenced. For example, retrying the "ls \-l" example +with a non-existent file produces the following line: +.CW +lstat("/foo/bar", 0xb004) = \-1 ENOENT (No such file or directory) +.CE +In this case the porch light is on but nobody is home. +.LP +Syscalls unknown to +.B strace +are printed raw, with the unknown system call number printed in hexadecimal form +and prefixed with "syscall_": +.CW +syscall_0xbad(0x1, 0x2, 0x3, 0x4, 0x5, 0x6) = -1 ENOSYS (Function not implemented) +.CE +.LP +Character pointers are dereferenced and printed as C strings. +Non-printing characters in strings are normally represented by +ordinary C escape codes. +Only the first +.I strsize +(32 by default) bytes of strings are printed; +longer strings have an ellipsis appended following the closing quote. +Here is a line from "ls \-l" where the +.BR getpwuid (3) +library routine is reading the password file: +.CW +read(3, "root::0:0:System Administrator:/"..., 1024) = 422 +.CE +While structures are annotated using curly braces, simple pointers +and arrays are printed using square brackets with commas separating +elements. Here is an example from the command +.BR id (1) +on a system with supplementary group ids: +.CW +getgroups(32, [100, 0]) = 2 +.CE +On the other hand, bit-sets are also shown using square brackets +but set elements are separated only by a space. Here is the shell, +preparing to execute an external command: +.CW +sigprocmask(SIG_BLOCK, [CHLD TTOU], []) = 0 +.CE +Here, the second argument is a bit-set of two signals, +.BR SIGCHLD " and " SIGTTOU . +In some cases, the bit-set is so full that printing out the unset +elements is more valuable. In that case, the bit-set is prefixed by +a tilde like this: +.CW +sigprocmask(SIG_UNBLOCK, ~[], NULL) = 0 +.CE +Here, the second argument represents the full set of all signals. +.SH OPTIONS +.SS Output format +.TP 12 +.BI "\-a " column +Align return values in a specific column (default column 40). +.TP +.B \-i +Print the instruction pointer at the time of the system call. +.if '@ENABLE_STACKTRACE_TRUE@'#' .ig end_unwind +.TP +.B \-k +Print the execution stack trace of the traced processes after each system call. +.end_unwind +.TP +.BI "\-o " filename +Write the trace output to the file +.I filename +rather than to stderr. +.IR filename . pid +form is used if +.B \-ff +option is supplied. +If the argument begins with '|' or '!', the rest of the +argument is treated as a command and all output is piped to it. +This is convenient for piping the debugging output to a program +without affecting the redirections of executed programs. +The latter is not compatible with +.B \-ff +option currently. +.TP +.B \-A +Open the file provided in the +.B \-o +option in append mode. +.TP +.B \-q +Suppress messages about attaching, detaching etc. This happens +automatically when output is redirected to a file and the command +is run directly instead of attaching. +.TP +.B \-qq +If given twice, suppress messages about process exit status. +.TP +.B \-r +Print a relative timestamp upon entry to each system call. This +records the time difference between the beginning of successive +system calls. +Note that since +.B \-r +option uses the monotonic clock time for measuring time difference and not the +wall clock time, its measurements can differ from the difference in time +reported by the +.B \-t +option. +.TP +.BI "\-s " strsize +Specify the maximum string size to print (the default is 32). Note +that filenames are not considered strings and are always printed in +full. +.TP +.B \-t +Prefix each line of the trace with the wall clock time. +.TP +.B \-tt +If given twice, the time printed will include the microseconds. +.TP +.B \-ttt +If given thrice, the time printed will include the microseconds +and the leading portion will be printed as the number +of seconds since the epoch. +.TP +.B \-T +Show the time spent in system calls. This records the time +difference between the beginning and the end of each system call. +.TP +.B \-x +Print all non-ASCII strings in hexadecimal string format. +.TP +.B \-xx +Print all strings in hexadecimal string format. +.TP +.BI "\-X " format +Set the format for printing of named constants and flags. +Supported +.I format +values are: +.RS +.TP 10 +.B raw +Raw number output, without decoding. +.TP +.B abbrev +Output a named constant or a set of flags instead of the raw number if they are +found. +This is the default +.B strace +behaviour. +.TP +.B verbose +Output both the raw value and the decoded string (as a comment). +.RE +.TP +.B \-y +Print paths associated with file descriptor arguments. +.TP +.B \-yy +Print protocol specific information associated with socket file descriptors, +and block/character device number associated with device file descriptors. +.SS Statistics +.TP 12 +.B \-c +Count time, calls, and errors for each system call and report a summary on +program exit, suppressing the regular output. +This attempts to show system time (CPU time spent running +in the kernel) independent of wall clock time. If +.B \-c +is used with +.BR \-f , +only aggregate totals for all traced processes are kept. +.TP +.B \-C +Like +.B \-c +but also print regular output while processes are running. +.TP +.BI "\-O " overhead +Set the overhead for tracing system calls to +.I overhead +microseconds. +This is useful for overriding the default heuristic for guessing +how much time is spent in mere measuring when timing system calls using +the +.B \-c +option. The accuracy of the heuristic can be gauged by timing a given +program run without tracing (using +.BR time (1)) +and comparing the accumulated +system call time to the total produced using +.BR \-c . +.TP +.BI "\-S " sortby +Sort the output of the histogram printed by the +.B \-c +option by the specified criterion. Legal values are +.BR time , +.BR calls , +.BR name , +and +.B nothing +(default is +.BR time ). +.TP +.B \-w +Summarise the time difference between the beginning and end of +each system call. The default is to summarise the system time. +.SS Filtering +.TP 12 +.BI "\-e " expr +A qualifying expression which modifies which events to trace +or how to trace them. The format of the expression is: +.RS 15 +.IP +[\,\fIqualifier\/\fB=\fR][\fB!\fR][\fB?\fR]\,\fIvalue1\/\fR[\fB,\fR[\fB?\fR]\,\fIvalue2\/\fR]... +.RE +.IP +where +.I qualifier +is one of +.BR trace , +.BR abbrev , +.BR verbose , +.BR raw , +.BR signal , +.BR read , +.BR write , +.BR fault , +.BR inject , +or +.B kvm +and +.I value +is a qualifier-dependent symbol or number. The default +qualifier is +.BR trace . +Using an exclamation mark negates the set of values. For example, +.BR \-e "\ " open +means literally +.BR \-e "\ " trace = open +which in turn means trace only the +.B open +system call. By contrast, +.BR \-e "\ " trace "=!" open +means to trace every system call except +.BR open . +Question mark before the syscall qualification allows suppression of error +in case no syscalls matched the qualification provided. +Appending one of "@64", "@32", or "@x32" suffixes to the syscall qualification +allows specifying syscalls only for the 64-bit, 32-bit, or 32-on-64-bit +personality, respectively. +In addition, the special values +.B all +and +.B none +have the obvious meanings. +.IP +Note that some shells use the exclamation point for history +expansion even inside quoted arguments. If so, you must escape +the exclamation point with a backslash. +.TP +\fB\-e\ trace\fR=\,\fIset\fR +Trace only the specified set of system calls. The +.B \-c +option is useful for determining which system calls might be useful +to trace. For example, +.BR trace = open,close,read,write +means to only +trace those four system calls. Be careful when making inferences +about the user/kernel boundary if only a subset of system calls +are being monitored. The default is +.BR trace = all . +.TP +\fB\-e\ trace\fR=/\,\fIregex\fR +Trace only those system calls that match the +.IR regex . +You can use +.B POSIX +Extended Regular Expression syntax (see +.BR regex (7)). +.TP +.BR "\-e\ trace" = %file +.TQ +.BR "\-e\ trace" = file " (deprecated)" +Trace all system calls which take a file name as an argument. You +can think of this as an abbreviation for +.BR "\-e\ trace" = open , stat , chmod , unlink ,... +which is useful to seeing what files the process is referencing. +Furthermore, using the abbreviation will ensure that you don't +accidentally forget to include a call like +.BR lstat (2) +in the list. Betchya woulda forgot that one. +.TP +.BR "\-e\ trace" = %process +.TQ +.BR "\-e\ trace" = process " (deprecated)" +Trace all system calls which involve process management. This +is useful for watching the fork, wait, and exec steps of a process. +.TP +.BR "\-e\ trace" = %net +.TQ +.BR "\-e\ trace" = %network +.TQ +.BR "\-e\ trace" = network " (deprecated)" +Trace all the network related system calls. +.TP +.BR "\-e\ trace" = %signal +.TQ +.BR "\-e\ trace" = signal " (deprecated)" +Trace all signal related system calls. +.TP +.BR "\-e\ trace" = %ipc +.TQ +.BR "\-e\ trace" = ipc " (deprecated)" +Trace all IPC related system calls. +.TP +.BR "\-e\ trace" = %desc +.TQ +.BR "\-e\ trace" = desc " (deprecated)" +Trace all file descriptor related system calls. +.TP +.BR "\-e\ trace" = %memory +.TQ +.BR "\-e\ trace" = memory " (deprecated)" +Trace all memory mapping related system calls. +.TP +.BR "\-e\ trace" = %stat +Trace stat syscall variants. +.TP +.BR "\-e\ trace" = %lstat +Trace lstat syscall variants. +.TP +.BR "\-e\ trace" = %fstat +Trace fstat and fstatat syscall variants. +.TP +.BR "\-e\ trace" = %%stat +Trace syscalls used for requesting file status (stat, lstat, fstat, fstatat, +statx, and their variants). +.TP +.BR "\-e\ trace" = %statfs +Trace statfs, statfs64, statvfs, osf_statfs, and osf_statfs64 system calls. +The same effect can be achieved with +.BR "\-e\ trace" = /^(.*_)?statv?fs +regular expression. +.TP +.BR "\-e\ trace" = %fstatfs +Trace fstatfs, fstatfs64, fstatvfs, osf_fstatfs, and osf_fstatfs64 system calls. +The same effect can be achieved with +.BR "\-e\ trace" = /fstatv?fs +regular expression. +.TP +.BR "\-e\ trace" = %%statfs +Trace syscalls related to file system statistics (statfs-like, fstatfs-like, +and ustat). The same effect can be achieved with +.BR "\-e\ trace" = /statv?fs|fsstat|ustat +regular expression. +.TP +.BR "\-e\ trace" = %pure +Trace syscalls that always succeed and have no arguments. +Currently, this list includes +.BR arc_gettls "(2), " getdtablesize "(2), " getegid "(2), " getegid32 "(2)," +.BR geteuid "(2), " geteuid32 "(2), " getgid "(2), " getgid32 "(2)," +.BR getpagesize "(2), " getpgrp "(2), " getpid "(2), " getppid "(2)," +.BR get_thread_area (2) +(on architectures other than x86), +.BR gettid "(2), " get_tls "(2), " getuid "(2), " getuid32 "(2)," +.BR getxgid "(2), " getxpid "(2), " getxuid "(2), " kern_features "(2), and" +.BR metag_get_tls "(2)" +syscalls. +.TP +\fB\-e\ abbrev\fR=\,\fIset\fR +Abbreviate the output from printing each member of large structures. +The default is +.BR abbrev = all . +The +.B \-v +option has the effect of +.BR abbrev = none . +.TP +\fB\-e\ verbose\fR=\,\fIset\fR +Dereference structures for the specified set of system calls. The +default is +.BR verbose = all . +.TP +\fB\-e\ raw\fR=\,\fIset\fR +Print raw, undecoded arguments for the specified set of system calls. +This option has the effect of causing all arguments to be printed +in hexadecimal. This is mostly useful if you don't trust the +decoding or you need to know the actual numeric value of an +argument. +See also +.B \-X raw +option. +.TP +\fB\-e\ signal\fR=\,\fIset\fR +Trace only the specified subset of signals. The default is +.BR signal = all . +For example, +.BR signal "=!" SIGIO +(or +.BR signal "=!" io ) +causes +.B SIGIO +signals not to be traced. +.TP +\fB\-e\ read\fR=\,\fIset\fR +Perform a full hexadecimal and ASCII dump of all the data read from +file descriptors listed in the specified set. For example, to see +all input activity on file descriptors +.I 3 +and +.I 5 +use +\fB\-e\ read\fR=\,\fI3\fR,\fI5\fR. +Note that this is independent from the normal tracing of the +.BR read (2) +system call which is controlled by the option +.BR -e "\ " trace = read . +.TP +\fB\-e\ write\fR=\,\fIset\fR +Perform a full hexadecimal and ASCII dump of all the data written to +file descriptors listed in the specified set. For example, to see +all output activity on file descriptors +.I 3 +and +.I 5 +use +\fB\-e\ write\fR=\,\fI3\fR,\,\fI5\fR. +Note that this is independent from the normal tracing of the +.BR write (2) +system call which is controlled by the option +.BR -e "\ " trace = write . +.TP +\fB\-e\ inject\fR=\,\fIset\/\fR[:\fBerror\fR=\,\fIerrno\/\fR|:\fBretval\fR=\,\fIvalue\/\fR][:\fBsignal\fR=\,\fIsig\/\fR][:\fBsyscall\fR=\fIsyscall\fR][:\fBdelay_enter\fR=\,\fIusecs\/\fR][:\fBdelay_exit\fR=\,\fIusecs\/\fR][:\fBwhen\fR=\,\fIexpr\/\fR] +Perform syscall tampering for the specified set of syscalls. + +At least one of +.BR error , +.BR retval , +.BR signal , +.BR delay_enter , +or +.B delay_exit +options has to be specified. +.B error +and +.B retval +are mutually exclusive. + +If :\fBerror\fR=\,\fIerrno\/\fR option is specified, +a fault is injected into a syscall invocation: +the syscall number is replaced by -1 which corresponds to an invalid syscall +(unless a syscall is specified with :\fBsyscall=\fR option), +and the error code is specified using a symbolic +.I errno +value like +.B ENOSYS +or a numeric value within 1..4095 range. + +If :\fBretval\fR=\,\fIvalue\/\fR option is specified, +success injection is performed: the syscall number is replaced by -1, +but a bogus success value is returned to the callee. + +If :\fBsignal\fR=\,\fIsig\/\fR option is specified with either a symbolic value +like +.B SIGSEGV +or a numeric value within 1..\fBSIGRTMAX\fR range, +that signal is delivered on entering every syscall specified by the +.IR set . + +If :\fBdelay_enter\fR=\,\fIusecs\/\fR or :\fBdelay_exit\fR=\,\fIusecs\/\fR +options are specified, delay injection is performed: the tracee is delayed +by at least +.IR usecs +microseconds on entering or exiting the syscall. + +If :\fBsignal\fR=\,\fIsig\/\fR option is specified without +:\fBerror\fR=\,\fIerrno\/\fR, :\fBretval\fR=\,\fIvalue\/\fR or +:\fBdelay_{enter,exit}\fR=\,\fIusecs\/\fR options, +then only a signal +.I sig +is delivered without a syscall fault or delay injection. +Conversely, :\fBerror\fR=\,\fIerrno\/\fR or +:\fBretval\fR=\,\fIvalue\/\fR option without +:\fBdelay_enter\fR=\,\fIusecs\/\fR, +:\fBdelay_exit\fR=\,\fIusecs\/\fR or +:\fBsignal\fR=\,\fIsig\/\fR options injects a fault without delivering a signal +or injecting a delay, etc. + +If both :\fBerror\fR=\,\fIerrno\/\fR or :\fBretval\fR=\,\fIvalue\/\fR +and :\fBsignal\fR=\,\fIsig\/\fR options are specified, then both +a fault or success is injected and a signal is delivered. + +if :\fBsyscall\fR=\fIsyscall\fR option is specified, the corresponding syscall +with no side effects is injected instead of -1. +Currently, only "pure" (see +.BR "-e trace" = "%pure" +description) syscalls can be specified there. + +Unless a :\fBwhen\fR=\,\fIexpr\fR subexpression is specified, +an injection is being made into every invocation of each syscall from the +.IR set . + +The format of the subexpression is one of the following: +.RS +.IP "" 2 +.I first +.RS 4 +For every syscall from the +.IR set , +perform an injection for the syscall invocation number +.I first +only. +.RE +.IP "" 2 +\fIfirst\/\fB+\fR +.RS 4 +For every syscall from the +.IR set , +perform injections for the syscall invocation number +.I first +and all subsequent invocations. +.RE +.IP "" 2 +\fIfirst\/\fB+\fIstep\fR +.RS 4 +For every syscall from the +.IR set , +perform injections for syscall invocations number +.IR first , +.IR first + step , +.IR first + step + step , +and so on. +.RE +.RE +.IP +For example, to fail each third and subsequent chdir syscalls with +.BR ENOENT , +use +\fB\-e\ inject\fR=\,\fIchdir\/\fR:\fBerror\fR=\,\fIENOENT\/\fR:\fBwhen\fR=\,\fI3\/\fB+\fR. + +The valid range for numbers +.I first +and +.I step +is 1..65535. + +An injection expression can contain only one +.BR error = +or +.BR retval = +specification, and only one +.BR signal = +specification. If an injection expression contains multiple +.BR when = +specifications, the last one takes precedence. + +Accounting of syscalls that are subject to injection +is done per syscall and per tracee. + +Specification of syscall injection can be combined +with other syscall filtering options, for example, +\fB\-P \fI/dev/urandom \fB\-e inject\fR=\,\fIfile\/\fR:\fBerror\fR=\,\fIENOENT\fR. + +.TP +\fB\-e\ fault\fR=\,\fIset\/\fR[:\fBerror\fR=\,\fIerrno\/\fR][:\fBwhen\fR=\,\fIexpr\/\fR] +Perform syscall fault injection for the specified set of syscalls. + +This is equivalent to more generic +\fB\-e\ inject\fR= expression with default value of +.I errno +option set to +.BR ENOSYS . +.TP +.BR "\-e\ kvm" = vcpu +Print the exit reason of kvm vcpu. Requires Linux kernel version 4.16.0 +or higher. + +.TP +.BI "\-P " path +Trace only system calls accessing +.IR path . +Multiple +.B \-P +options can be used to specify several paths. +.TP +.B \-v +Print unabbreviated versions of environment, stat, termios, etc. +calls. These structures are very common in calls and so the default +behavior displays a reasonable subset of structure members. Use +this option to get all of the gory details. +.SS Tracing +.TP 12 +.BI "\-b " syscall +If specified syscall is reached, detach from traced process. +Currently, only +.BR execve (2) +syscall is supported. This option is useful if you want to trace +multi-threaded process and therefore require +.BR \-f , +but don't want to trace its (potentially very complex) children. +.TP +.B \-D +Run tracer process as a detached grandchild, not as parent of the +tracee. This reduces the visible effect of +.B strace +by keeping the tracee a direct child of the calling process. +.TP +.B \-f +Trace child processes as they are created by currently traced +processes as a result of the +.BR fork (2), +.BR vfork (2) +and +.BR clone (2) +system calls. Note that +.B \-p +.I PID +.B \-f +will attach all threads of process +.I PID +if it is multi-threaded, not only thread with +.IR thread_id " = " PID . +.TP +.B \-ff +If the +.B \-o +.I filename +option is in effect, each processes trace is written to +.IR filename . pid +where +.I pid +is the numeric process id of each process. +This is incompatible with +.BR \-c , +since no per-process counts are kept. + +One might want to consider using +.BR strace-log-merge (1) +to obtain a combined strace log view. +.TP +.BI "\-I " interruptible +When +.B strace +can be interrupted by signals (such as pressing +.BR CTRL\-C ). +.RS +.TP 4 +.B 1 +no signals are blocked; +.TQ +.B 2 +fatal signals are blocked while decoding syscall (default); +.TQ +.B 3 +fatal signals are always blocked (default if +.BR -o " " \fIFILE\fR " " \fIPROG\fR ); +.TQ +.B 4 +fatal signals and +.BR SIGTSTP " (" CTRL\-Z ) +are always blocked (useful to make +.BI "strace -o " "FILE PROG" +not stop on +.BR CTRL\-Z , +default if +.BR \-D ). +.RE +.SS Startup +.TP 12 +\fB\-E\ \fIvar\fR=\,\fIval\fR +Run command with +.IR var = val +in its list of environment variables. +.TP +.BI "\-E " var +Remove +.IR var +from the inherited list of environment variables before passing it on to +the command. +.TP +.BI "\-p " pid +Attach to the process with the process +.SM ID +.I pid +and begin tracing. +The trace may be terminated +at any time by a keyboard interrupt signal +.RB ( CTRL\-C ). +.B strace +will respond by detaching itself from the traced process(es) +leaving it (them) to continue running. +Multiple +.B \-p +options can be used to attach to many processes in addition to +.I command +(which is optional if at least one +.B \-p +option is given). +.B \-p +"`pidof PROG`" syntax is supported. +.TP +.BI "\-u " username +Run command with the user \s-1ID\s0, group \s-2ID\s0, and +supplementary groups of +.IR username . +This option is only useful when running as root and enables the +correct execution of setuid and/or setgid binaries. +Unless this option is used setuid and setgid programs are executed +without effective privileges. +.SS Miscellaneous +.TP 12 +.B \-d +Show some debugging output of +.B strace +itself on the standard error. +.TP +.B \-F +This option is deprecated. It is retained for backward compatibility only +and may be removed in future releases. +Usage of multiple instances of +.B \-F +option is still equivalent to a single +.BR \-f , +and it is ignored at all if used along with one or more instances of +.B \-f +option. +.TP +.B \-h +Print the help summary. +.TP +.B \-V +Print the version number of +.BR strace . +.SH DIAGNOSTICS +When +.I command +exits, +.B strace +exits with the same exit status. +If +.I command +is terminated by a signal, +.B strace +terminates itself with the same signal, so that +.B strace +can be used as a wrapper process transparent to the invoking parent process. +Note that parent-child relationship (signal stop notifications, +.BR getppid (2) +value, etc) between traced process and its parent are not preserved +unless +.B \-D +is used. +.LP +When using +.B \-p +without a +.IR command , +the exit status of +.B strace +is zero unless no processes has been attached or there was an unexpected error +in doing the tracing. +.SH "SETUID INSTALLATION" +If +.B strace +is installed setuid to root then the invoking user will be able to +attach to and trace processes owned by any user. +In addition setuid and setgid programs will be executed and traced +with the correct effective privileges. +Since only users trusted with full root privileges should be allowed +to do these things, +it only makes sense to install +.B strace +as setuid to root when the users who can execute it are restricted +to those users who have this trust. +For example, it makes sense to install a special version of +.B strace +with mode 'rwsr-xr--', user +.B root +and group +.BR trace , +where members of the +.B trace +group are trusted users. +If you do use this feature, please remember to install +a regular non-setuid version of +.B strace +for ordinary users to use. +.SH "MULTIPLE PERSONALITY SUPPORT" +On some architectures, +.B strace +supports decoding of syscalls for processes that use different ABI rather than +the one +.B strace +uses. +Specifically, in addition to decoding native ABI, +.B strace +can decode the following ABIs on the following architectures: +.TS H +allbox; +lb lb +l l. +Architecture ABIs supported +x86_64 i386, x32 (when built as an x86_64 application); i386 (when built as an x32 application) +AArch64 ARM 32-bit EABI +PowerPC 64-bit PowerPC 32-bit +RISC-V 64-bit RISC-V 32-bit +s390x s390 +SPARC 64-bit SPARC 32-bit +TILE 64-bit TILE 32-bit +.TE +.PP +This support is optional and relies on ability to generate and parse structure +definitions during the build time. +Please refer to the output of the +.B strace \-V +command in order to figure out what support is available in your +.B strace +build ("non-native" refers to an ABI that differs from the ABI +.B strace +has): +.TP 15 +.B m32-mpers +.B strace +can trace and properly decode non-native 32-bit binaries. +.TP +.B no-m32-mpers +.B strace +can trace, but cannot properly decode non-native 32-bit binaries. +.TP +.B mx32-mpers +.B strace +can trace and properly decode non-native 32-on-64-bit binaries. +.TP +.B no-mx32-mpers +.B strace +can trace, but cannot properly decode non-native 32-on-64-bit binaries. +.PP +If the output contains neither +.B m32-mpers +nor +.BR no-m32-mpers , +then decoding of non-native 32-bit binaries is not implemented at all +or not applicable. +.PP +Likewise, if the output contains neither +.B mx32-mpers +nor +.BR no-mx32-mpers , +then decoding of non-native 32-on-64-bit binaries is not implemented at all +or not applicable. +.SH NOTES +It is a pity that so much tracing clutter is produced by systems +employing shared libraries. +.LP +It is instructive to think about system call inputs and outputs +as data-flow across the user/kernel boundary. Because user-space +and kernel-space are separate and address-protected, it is +sometimes possible to make deductive inferences about process +behavior using inputs and outputs as propositions. +.LP +In some cases, a system call will differ from the documented behavior +or have a different name. For example, the +.BR faccessat (2) +system call does not have +.I flags +argument, and the +.BR setrlimit (2) +library function uses +.BR prlimit64 (2) +system call on modern (2.6.38+) kernels. These +discrepancies are normal but idiosyncratic characteristics of the +system call interface and are accounted for by C library wrapper +functions. +.LP +Some system calls have different names in different architectures and +personalities. In these cases, system call filtering and printing +uses the names that match corresponding +.BR __NR_ * +kernel macros of the tracee's architecture and personality. +There are two exceptions from this general rule: +.BR arm_fadvise64_64 (2) +ARM syscall and +.BR xtensa_fadvise64_64 (2) +Xtensa syscall are filtered and printed as +.BR fadvise64_64 (2). +.LP +On x32, syscalls that are intended to be used by 64-bit processes and not x32 +ones (for example, +.BR readv (2), +that has syscall number 19 on x86_64, with its x32 counterpart has syscall +number 515), but called with +.B __X32_SYSCALL_BIT +flag being set, are designated with +.B "#64" +suffix. +.LP +On some platforms a process that is attached to with the +.B \-p +option may observe a spurious +.B EINTR +return from the current system call that is not restartable. +(Ideally, all system calls should be restarted on +.B strace +attach, making the attach invisible +to the traced process, but a few system calls aren't. +Arguably, every instance of such behavior is a kernel bug.) +This may have an unpredictable effect on the process +if the process takes no action to restart the system call. +.LP +As +.B strace +executes the specified +.I command +directly and does not employ a shell for that, scripts without shebang +that usually run just fine when invoked by shell fail to execute with +.B ENOEXEC +error. +It is advisable to manually supply a shell as a +.I command +with the script as its argument. +.SH BUGS +Programs that use the +.I setuid +bit do not have +effective user +.SM ID +privileges while being traced. +.LP +A traced process runs slowly. +.LP +Traced processes which are descended from +.I command +may be left running after an interrupt signal +.RB ( CTRL\-C ). +.SH HISTORY +The original +.B strace +was written by Paul Kranenburg +for SunOS and was inspired by its +.B trace +utility. +The SunOS version of +.B strace +was ported to Linux and enhanced +by Branko Lankester, who also wrote the Linux kernel support. +Even though Paul released +.B strace +2.5 in 1992, +Branko's work was based on Paul's +.B strace +1.5 release from 1991. +In 1993, Rick Sladkey merged +.B strace +2.5 for SunOS and the second release of +.B strace +for Linux, added many of the features of +.BR truss (1) +from SVR4, and produced an +.B strace +that worked on both platforms. In 1994 Rick ported +.B strace +to SVR4 and Solaris and wrote the +automatic configuration support. In 1995 he ported +.B strace +to Irix +and tired of writing about himself in the third person. +.PP +Beginning with 1996, +.B strace +was maintained by Wichert Akkerman. +During his tenure, +.B strace +development migrated to CVS; ports to FreeBSD and many architectures on Linux +(including ARM, IA-64, MIPS, PA-RISC, PowerPC, s390, SPARC) were introduced. +In 2002, the burden of +.B strace +maintainership was transferred to Roland McGrath. +Since then, +.B strace +gained support for several new Linux architectures (AMD64, s390x, SuperH), +bi-architecture support for some of them, and received numerous additions and +improvements in syscalls decoders on Linux; +.B strace +development migrated to +.B git +during that period. +Since 2009, +.B strace +is actively maintained by Dmitry Levin. +.B strace +gained support for AArch64, ARC, AVR32, Blackfin, Meta, Nios II, OpenSISC 1000, +RISC-V, Tile/TileGx, Xtensa architectures since that time. +In 2012, unmaintained and apparently broken support for non-Linux operating +systems was removed. +Also, in 2012 +.B strace +gained support for path tracing and file descriptor path decoding. +In 2014, support for stack traces printing was added. +In 2016, syscall fault injection was implemented. +.PP +For the additional information, please refer to the +.B NEWS +file and +.B strace +repository commit log. +.SH REPORTING BUGS +Problems with +.B strace +should be reported to the +.B strace +mailing list at . +.SH "SEE ALSO" +.BR strace-log-merge (1), +.BR ltrace (1), +.BR perf-trace (1), +.BR trace-cmd (1), +.BR time (1), +.BR ptrace (2), +.BR proc (5) diff --git a/strace.c b/strace.c index 7214e6ef..318b1409 100644 --- a/strace.c +++ b/strace.c @@ -3,60 +3,53 @@ * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 1999-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" #include -#include +#include #include +#include "ptrace.h" #include #include -#include #include +#ifdef HAVE_PATHS_H +# include +#endif #include #include #include +#include #include #ifdef HAVE_PRCTL # include #endif #include +#include "kill_save_errno.h" +#include "largefile_wrappers.h" +#include "mmap_cache.h" +#include "number_set.h" +#include "ptrace_syscall_info.h" #include "scno.h" -#include "ptrace.h" #include "printsiginfo.h" +#include "trace_event.h" +#include "xstring.h" +#include "delay.h" +#include "wait.h" /* In some libc, these aren't declared. Do it ourself: */ extern char **environ; extern int optind; extern char *optarg; -#ifdef USE_LIBUNWIND +#ifdef ENABLE_STACKTRACE /* if this is true do the stack trace for every system call */ -bool stack_trace_enabled = false; +bool stack_trace_enabled; #endif #define my_tkill(tid, sig) syscall(__NR_tkill, (tid), (sig)) @@ -73,27 +66,27 @@ bool stack_trace_enabled = false; const unsigned int syscall_trap_sig = SIGTRAP | 0x80; cflag_t cflag = CFLAG_NONE; -unsigned int followfork = 0; +unsigned int followfork; unsigned int ptrace_setoptions = PTRACE_O_TRACESYSGOOD | PTRACE_O_TRACEEXEC | PTRACE_O_TRACEEXIT; -unsigned int xflag = 0; -bool debug_flag = 0; -bool Tflag = 0; -bool iflag = 0; -bool count_wallclock = 0; -unsigned int qflag = 0; -static unsigned int tflag = 0; -static bool rflag = 0; -static bool print_pid_pfx = 0; +unsigned int xflag; +bool debug_flag; +bool Tflag; +bool iflag; +bool count_wallclock; +unsigned int qflag; +static unsigned int tflag; +static bool rflag; +static bool print_pid_pfx; /* -I n */ enum { - INTR_NOT_SET = 0, - INTR_ANYWHERE = 1, /* don't block/ignore any signals */ - INTR_WHILE_WAIT = 2, /* block fatal signals while decoding syscall. default */ - INTR_NEVER = 3, /* block fatal signals. default if '-o FILE PROG' */ - INTR_BLOCK_TSTP_TOO = 4, /* block fatal signals and SIGTSTP (^Z) */ - NUM_INTR_OPTS + INTR_NOT_SET = 0, + INTR_ANYWHERE = 1, /* don't block/ignore any signals */ + INTR_WHILE_WAIT = 2, /* block fatal signals while decoding syscall. default */ + INTR_NEVER = 3, /* block fatal signals. default if '-o FILE PROG' */ + INTR_BLOCK_TSTP_TOO = 4, /* block fatal signals and SIGTSTP (^Z); default if -D */ + NUM_INTR_OPTS }; static int opt_intr; /* We play with signal mask only if this mode is active: */ @@ -111,29 +104,24 @@ static int opt_intr; * wait() etc. Without -D, strace process gets lodged in between, * disrupting parent<->child link. */ -static bool daemonized_tracer = 0; +static bool daemonized_tracer; -#if USE_SEIZE static int post_attach_sigstop = TCB_IGNORE_ONE_SIGSTOP; -# define use_seize (post_attach_sigstop == 0) -#else -# define post_attach_sigstop TCB_IGNORE_ONE_SIGSTOP -# define use_seize 0 -#endif +#define use_seize (post_attach_sigstop == 0) /* Sometimes we want to print only succeeding syscalls. */ -bool not_failing_only = 0; +bool not_failing_only; /* Show path associated with fd arguments */ -unsigned int show_fd_path = 0; +unsigned int show_fd_path; -static bool detach_on_execve = 0; +static bool detach_on_execve; static int exit_code; -static int strace_child = 0; -static int strace_tracer_pid = 0; +static int strace_child; +static int strace_tracer_pid; -static char *username = NULL; +static const char *username; static uid_t run_uid; static gid_t run_gid; @@ -141,36 +129,57 @@ unsigned int max_strlen = DEFAULT_STRLEN; static int acolumn = DEFAULT_ACOLUMN; static char *acolumn_spaces; -static char *outfname = NULL; +/* Default output style for xlat entities */ +enum xlat_style xlat_verbosity = XLAT_STYLE_ABBREV; + +static const char *outfname; /* If -ff, points to stderr. Else, it's our common output log */ static FILE *shared_log; +static bool open_append; -struct tcb *printing_tcp = NULL; +struct tcb *printing_tcp; static struct tcb *current_tcp; +struct tcb_wait_data { + enum trace_event te; /**< Event passed to dispatch_event() */ + int status; /**< status, returned by wait4() */ + unsigned long msg; /**< Value returned by PTRACE_GETEVENTMSG */ + siginfo_t si; /**< siginfo, returned by PTRACE_GETSIGINFO */ +}; + static struct tcb **tcbtab; -static unsigned int nprocs, tcbtabsize; -static const char *progname; +static unsigned int nprocs; +static size_t tcbtabsize; + +static struct tcb_wait_data *tcb_wait_tab; +static size_t tcb_wait_tab_size; + + +#ifndef HAVE_PROGRAM_INVOCATION_NAME +char *program_invocation_name; +#endif unsigned os_release; /* generated from uname()'s u.release */ static void detach(struct tcb *tcp); -static void cleanup(void); +static void cleanup(int sig); static void interrupt(int sig); -static sigset_t empty_set, blocked_set; #ifdef HAVE_SIG_ATOMIC_T -static volatile sig_atomic_t interrupted; +static volatile sig_atomic_t interrupted, restart_failed; #else -static volatile int interrupted; +static volatile int interrupted, restart_failed; #endif +static sigset_t timer_set; +static void timer_sighandler(int); + #ifndef HAVE_STRERROR -#if !HAVE_DECL_SYS_ERRLIST +# if !HAVE_DECL_SYS_ERRLIST extern int sys_nerr; extern char *sys_errlist[]; -#endif +# endif const char * strerror(int err_no) @@ -178,7 +187,7 @@ strerror(int err_no) static char buf[sizeof("Unknown error %d") + sizeof(int)*3]; if (err_no < 1 || err_no >= sys_nerr) { - sprintf(buf, "Unknown error %d", err_no); + xsprintf(buf, "Unknown error %d", err_no); return buf; } return sys_errlist[err_no]; @@ -189,11 +198,36 @@ strerror(int err_no) static void print_version(void) { + static const char features[] = +#ifdef ENABLE_STACKTRACE + " stack-trace=" USE_UNWINDER +#endif +#ifdef USE_DEMANGLE + " stack-demangle" +#endif +#if SUPPORTED_PERSONALITIES > 1 +# if defined HAVE_M32_MPERS + " m32-mpers" +# else + " no-m32-mpers" +# endif +#endif /* SUPPORTED_PERSONALITIES > 1 */ +#if SUPPORTED_PERSONALITIES > 2 +# if defined HAVE_MX32_MPERS + " mx32-mpers" +# else + " no-mx32-mpers" +# endif +#endif /* SUPPORTED_PERSONALITIES > 2 */ + ""; + printf("%s -- version %s\n" - "Copyright (C) %s The strace developers <%s>.\n" + "Copyright (c) 1991-%s The strace developers <%s>.\n" "This is free software; see the source for copying conditions. There is NO\n" "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n", - PACKAGE_NAME, PACKAGE_VERSION, "1991-2017", PACKAGE_URL); + PACKAGE_NAME, PACKAGE_VERSION, COPYRIGHT_YEAR, PACKAGE_URL); + printf("\nOptional features enabled:%s\n", + features[0] ? features : " (none)"); } static void @@ -210,9 +244,9 @@ Output format:\n\ -a column alignment COLUMN for printing syscall results (default %d)\n\ -i print instruction pointer at time of syscall\n\ " -#ifdef USE_LIBUNWIND +#ifdef ENABLE_STACKTRACE "\ - -k obtain stack trace between each syscall (experimental)\n\ + -k obtain stack trace between each syscall\n\ " #endif "\ @@ -225,6 +259,7 @@ Output format:\n\ -T print time spent in each syscall\n\ -x print non-ascii strings in hex\n\ -xx print all strings in hex\n\ + -X format set the format for printing of named constants and flags\n\ -y print paths associated with file descriptor arguments\n\ -yy print protocol specific information associated with socket file descriptors\n\ \n\ @@ -237,7 +272,7 @@ Statistics:\n\ \n\ Filtering:\n\ -e expr a qualifying expression: option=[!]all or option=[!]val1[,val2]...\n\ - options: trace, abbrev, verbose, raw, signal, read, write, fault\n\ + options: trace, abbrev, verbose, raw, signal, read, write, fault, inject, kvm\n\ -P path trace accesses to path\n\ \n\ Tracing:\n\ @@ -274,88 +309,15 @@ Miscellaneous:\n\ exit(0); } -static void ATTRIBUTE_NORETURN +void ATTRIBUTE_NORETURN die(void) { if (strace_tracer_pid == getpid()) { - cflag = 0; - cleanup(); - } - exit(1); -} - -static void verror_msg(int err_no, const char *fmt, va_list p) -{ - char *msg; - - fflush(NULL); - - /* We want to print entire message with single fprintf to ensure - * message integrity if stderr is shared with other programs. - * Thus we use vasprintf + single fprintf. - */ - msg = NULL; - if (vasprintf(&msg, fmt, p) >= 0) { - if (err_no) - fprintf(stderr, "%s: %s: %s\n", progname, msg, strerror(err_no)); - else - fprintf(stderr, "%s: %s\n", progname, msg); - free(msg); - } else { - /* malloc in vasprintf failed, try it without malloc */ - fprintf(stderr, "%s: ", progname); - vfprintf(stderr, fmt, p); - if (err_no) - fprintf(stderr, ": %s\n", strerror(err_no)); - else - putc('\n', stderr); - } - /* We don't switch stderr to buffered, thus fprintf(stderr) - * always flushes its output and this is not necessary: */ - /* fflush(stderr); */ -} - -void error_msg(const char *fmt, ...) -{ - va_list p; - va_start(p, fmt); - verror_msg(0, fmt, p); - va_end(p); -} - -void error_msg_and_die(const char *fmt, ...) -{ - va_list p; - va_start(p, fmt); - verror_msg(0, fmt, p); - die(); -} - -void error_msg_and_help(const char *fmt, ...) -{ - if (fmt != NULL) { - va_list p; - va_start(p, fmt); - verror_msg(0, fmt, p); + cleanup(0); + exit(1); } - fprintf(stderr, "Try '%s -h' for more information.\n", progname); - die(); -} - -void perror_msg(const char *fmt, ...) -{ - va_list p; - va_start(p, fmt); - verror_msg(errno, fmt, p); - va_end(p); -} -void perror_msg_and_die(const char *fmt, ...) -{ - va_list p; - va_start(p, fmt); - verror_msg(errno, fmt, p); - die(); + _exit(1); } static void @@ -369,7 +331,6 @@ static const char *ptrace_attach_cmd; static int ptrace_attach_or_seize(int pid) { -#if USE_SEIZE int r; if (!use_seize) return ptrace_attach_cmd = "PTRACE_ATTACH", @@ -379,10 +340,18 @@ ptrace_attach_or_seize(int pid) return ptrace_attach_cmd = "PTRACE_SEIZE", r; r = ptrace(PTRACE_INTERRUPT, pid, 0L, 0L); return ptrace_attach_cmd = "PTRACE_INTERRUPT", r; -#else - return ptrace_attach_cmd = "PTRACE_ATTACH", - ptrace(PTRACE_ATTACH, pid, 0L, 0L); -#endif +} + +static const char * +ptrace_op_str(unsigned int op) +{ + const char *str = xlookup(ptrace_cmds, op); + if (str) + return str; + + static char buf[sizeof(op) * 3]; + xsprintf(buf, "%u", op); + return buf; } /* @@ -396,28 +365,13 @@ static int ptrace_restart(const unsigned int op, struct tcb *const tcp, unsigned int sig) { int err; - const char *msg; errno = 0; ptrace(op, tcp->pid, 0L, (unsigned long) sig); err = errno; - if (!err) + if (!err || err == ESRCH) return 0; - switch (op) { - case PTRACE_CONT: - msg = "CONT"; - break; - case PTRACE_DETACH: - msg = "DETACH"; - break; - case PTRACE_LISTEN: - msg = "LISTEN"; - break; - default: - msg = "SYSCALL"; - } - /* * Why curcol != 0? Otherwise sometimes we get this: * @@ -428,13 +382,13 @@ ptrace_restart(const unsigned int op, struct tcb *const tcp, unsigned int sig) * but before we tried to restart it. Log looks ugly. */ if (current_tcp && current_tcp->curcol != 0) { - tprintf(" \n", msg, strerror(err)); + tprintf(" \n", + tcp->pid, ptrace_op_str(op), strerror(err)); line_ended(); } - if (err == ESRCH) - return 0; errno = err; - perror_msg("ptrace(PTRACE_%s,pid:%d,sig:%u)", msg, tcp->pid, sig); + perror_msg("ptrace(%s,pid:%d,sig:%u)", + ptrace_op_str(op), tcp->pid, sig); return -1; } @@ -457,16 +411,8 @@ set_cloexec_flag(int fd) if (flags == newflags) return; - fcntl(fd, F_SETFD, newflags); /* never fails */ -} - -static void -kill_save_errno(pid_t pid, int sig) -{ - int saved_errno = errno; - - (void) kill(pid, sig); - errno = saved_errno; + if (fcntl(fd, F_SETFD, newflags)) /* never fails */ + perror_msg_and_die("fcntl(%d, F_SETFD, %#x)", fd, newflags); } /* @@ -483,35 +429,13 @@ swap_uid(void) } } -#ifdef _LARGEFILE64_SOURCE -# ifdef HAVE_FOPEN64 -# define fopen_for_output fopen64 -# else -# define fopen_for_output fopen -# endif -# define struct_stat struct stat64 -# define stat_file stat64 -# define struct_dirent struct dirent64 -# define read_dir readdir64 -# define struct_rlimit struct rlimit64 -# define set_rlimit setrlimit64 -#else -# define fopen_for_output fopen -# define struct_stat struct stat -# define stat_file stat -# define struct_dirent struct dirent -# define read_dir readdir -# define struct_rlimit struct rlimit -# define set_rlimit setrlimit -#endif - static FILE * strace_fopen(const char *path) { FILE *fp; swap_uid(); - fp = fopen_for_output(path, "w"); + fp = fopen_stream(path, open_append ? "a" : "w"); if (!fp) perror_msg_and_die("Can't fopen '%s'", path); swap_uid(); @@ -519,7 +443,7 @@ strace_fopen(const char *path) return fp; } -static int popen_pid = 0; +static int popen_pid; #ifndef _PATH_BSHELL # define _PATH_BSHELL "/bin/sh" @@ -565,24 +489,43 @@ strace_popen(const char *command) swap_uid(); fp = fdopen(fds[1], "w"); if (!fp) - die_out_of_memory(); + perror_msg_and_die("fdopen"); return fp; } -void -tprintf(const char *fmt, ...) +static void +outf_perror(const struct tcb * const tcp) { - va_list args; + if (tcp->outf == stderr) + return; - va_start(args, fmt); + /* This is ugly, but we don't store separate file names */ + if (followfork >= 2) + perror_msg("%s.%u", outfname, tcp->pid); + else + perror_msg("%s", outfname); +} + +ATTRIBUTE_FORMAT((printf, 1, 0)) +static void +tvprintf(const char *const fmt, va_list args) +{ if (current_tcp) { int n = vfprintf(current_tcp->outf, fmt, args); if (n < 0) { - if (current_tcp->outf != stderr) - perror_msg("%s", outfname); + /* very unlikely due to vfprintf buffering */ + outf_perror(current_tcp); } else current_tcp->curcol += n; } +} + +void +tprintf(const char *fmt, ...) +{ + va_list args; + va_start(args, fmt); + tvprintf(fmt, args); va_end(args); } @@ -599,17 +542,45 @@ tprints(const char *str) current_tcp->curcol += strlen(str); return; } - if (current_tcp->outf != stderr) - perror_msg("%s", outfname); + /* very unlikely due to fputs_unlocked buffering */ + outf_perror(current_tcp); } } +void +tprints_comment(const char *const str) +{ + if (str && *str) + tprintf(" /* %s */", str); +} + +void +tprintf_comment(const char *fmt, ...) +{ + if (!fmt || !*fmt) + return; + + va_list args; + va_start(args, fmt); + tprints(" /* "); + tvprintf(fmt, args); + tprints(" */"); + va_end(args); +} + +static void +flush_tcp_output(const struct tcb *const tcp) +{ + if (fflush(tcp->outf)) + outf_perror(tcp); +} + void line_ended(void) { if (current_tcp) { current_tcp->curcol = 0; - fflush(current_tcp->outf); + flush_tcp_output(current_tcp); } if (printing_tcp) { printing_tcp->curcol = 0; @@ -617,6 +588,16 @@ line_ended(void) } } +void +set_current_tcp(const struct tcb *tcp) +{ + current_tcp = (struct tcb *) tcp; + + /* Sync current_personality and stuff */ + if (current_tcp) + set_personality(current_tcp->currpers); +} + void printleader(struct tcb *tcp) { @@ -627,7 +608,7 @@ printleader(struct tcb *tcp) printing_tcp = tcp; if (printing_tcp) { - current_tcp = printing_tcp; + set_current_tcp(printing_tcp); if (printing_tcp->curcol != 0 && (followfork < 2 || printing_tcp == tcp)) { /* * case 1: we have a shared log (i.e. not -ff), and last line @@ -641,7 +622,7 @@ printleader(struct tcb *tcp) } printing_tcp = tcp; - current_tcp = tcp; + set_current_tcp(tcp); current_tcp->curcol = 0; if (print_pid_pfx) @@ -650,34 +631,49 @@ printleader(struct tcb *tcp) tprintf("[pid %5u] ", tcp->pid); if (tflag) { - char str[sizeof("HH:MM:SS")]; - struct timeval tv, dtv; - static struct timeval otv; - - gettimeofday(&tv, NULL); - if (rflag) { - if (otv.tv_sec == 0) - otv = tv; - tv_sub(&dtv, &tv, &otv); - tprintf("%6ld.%06ld ", - (long) dtv.tv_sec, (long) dtv.tv_usec); - otv = tv; - } - else if (tflag > 2) { - tprintf("%ld.%06ld ", - (long) tv.tv_sec, (long) tv.tv_usec); - } - else { - time_t local = tv.tv_sec; - strftime(str, sizeof(str), "%T", localtime(&local)); + struct timespec ts; + clock_gettime(CLOCK_REALTIME, &ts); + + if (tflag > 2) { + tprintf("%lld.%06ld ", + (long long) ts.tv_sec, (long) ts.tv_nsec / 1000); + } else { + time_t local = ts.tv_sec; + char str[MAX(sizeof("HH:MM:SS"), sizeof(ts.tv_sec) * 3)]; + struct tm *tm = localtime(&local); + + if (tm) + strftime(str, sizeof(str), "%T", tm); + else + xsprintf(str, "%lld", (long long) local); if (tflag > 1) - tprintf("%s.%06ld ", str, (long) tv.tv_usec); + tprintf("%s.%06ld ", + str, (long) ts.tv_nsec / 1000); else tprintf("%s ", str); } } + + if (rflag) { + struct timespec ts; + clock_gettime(CLOCK_MONOTONIC, &ts); + + static struct timespec ots; + if (ots.tv_sec == 0) + ots = ts; + + struct timespec dts; + ts_sub(&dts, &ts, &ots); + ots = ts; + + tprintf("%s%6ld.%06ld%s ", + tflag ? "(+" : "", + (long) dts.tv_sec, (long) dts.tv_nsec / 1000, + tflag ? ")" : ""); + } + if (iflag) - print_pc(tcp); + print_instruction_pointer(tcp); } void @@ -692,14 +688,20 @@ tabto(void) * may create bogus empty FILE., and then die. */ static void -newoutf(struct tcb *tcp) +after_successful_attach(struct tcb *tcp, const unsigned int flags) { + tcp->flags |= TCB_ATTACHED | TCB_STARTUP | flags; tcp->outf = shared_log; /* if not -ff mode, the same file is for all */ if (followfork >= 2) { - char name[520 + sizeof(int) * 3]; - sprintf(name, "%.512s.%u", outfname, tcp->pid); + char name[PATH_MAX]; + xsprintf(name, "%s.%u", outfname, tcp->pid); tcp->outf = strace_fopen(name); } + +#ifdef ENABLE_STACKTRACE + if (stack_trace_enabled) + unwind_tcb_init(tcp); +#endif } static void @@ -710,20 +712,18 @@ expand_tcbtab(void) callers have pointers and it would be a pain. So tcbtab is a table of pointers. Since we never free the TCBs, we allocate a single chunk of many. */ - unsigned int new_tcbtabsize, alloc_tcbtabsize; + size_t old_tcbtabsize; struct tcb *newtcbs; + struct tcb **tcb_ptr; - if (tcbtabsize) { - alloc_tcbtabsize = tcbtabsize; - new_tcbtabsize = tcbtabsize * 2; - } else { - new_tcbtabsize = alloc_tcbtabsize = 1; - } + old_tcbtabsize = tcbtabsize; + + tcbtab = xgrowarray(tcbtab, &tcbtabsize, sizeof(tcbtab[0])); + newtcbs = xcalloc(tcbtabsize - old_tcbtabsize, sizeof(newtcbs[0])); - newtcbs = xcalloc(alloc_tcbtabsize, sizeof(newtcbs[0])); - tcbtab = xreallocarray(tcbtab, new_tcbtabsize, sizeof(tcbtab[0])); - while (tcbtabsize < new_tcbtabsize) - tcbtab[tcbtabsize++] = newtcbs++; + for (tcb_ptr = tcbtab + old_tcbtabsize; + tcb_ptr < tcbtab + tcbtabsize; tcb_ptr++, newtcbs++) + *tcb_ptr = newtcbs; } static struct tcb * @@ -739,20 +739,14 @@ alloctcb(int pid) tcp = tcbtab[i]; if (!tcp->pid) { memset(tcp, 0, sizeof(*tcp)); + list_init(&tcp->wait_list); tcp->pid = pid; #if SUPPORTED_PERSONALITIES > 1 tcp->currpers = current_personality; #endif - -#ifdef USE_LIBUNWIND - if (stack_trace_enabled) - unwind_tcb_init(tcp); -#endif - nprocs++; - if (debug_flag) - error_msg("new tcb for pid %d, active tcbs:%d", - tcp->pid, nprocs); + debug_msg("new tcb for pid %d, active tcbs:%d", + tcp->pid, nprocs); return tcp; } } @@ -802,16 +796,20 @@ droptcb(struct tcb *tcp) free_tcb_priv_data(tcp); -#ifdef USE_LIBUNWIND - if (stack_trace_enabled) { +#ifdef ENABLE_STACKTRACE + if (stack_trace_enabled) unwind_tcb_fin(tcp); - } #endif +#ifdef HAVE_LINUX_KVM_H + kvm_vcpu_info_free(tcp); +#endif + + if (tcp->mmap_cache) + tcp->mmap_cache->free_fn(tcp, __func__); + nprocs--; - if (debug_flag) - error_msg("dropped tcb for pid %d, %d remain", - tcp->pid, nprocs); + debug_msg("dropped tcb for pid %d, %d remain", tcp->pid, nprocs); if (tcp->outf) { if (followfork >= 2) { @@ -821,15 +819,17 @@ droptcb(struct tcb *tcp) } else { if (printing_tcp == tcp && tcp->curcol != 0) fprintf(tcp->outf, " \n"); - fflush(tcp->outf); + flush_tcp_output(tcp); } } if (current_tcp == tcp) - current_tcp = NULL; + set_current_tcp(NULL); if (printing_tcp == tcp) printing_tcp = NULL; + list_remove(&tcp->wait_list); + memset(tcp, 0, sizeof(*tcp)); } @@ -867,14 +867,14 @@ detach(struct tcb *tcp) } if (errno != ESRCH) { /* Shouldn't happen. */ - perror_msg("detach: ptrace(PTRACE_DETACH,%u)", tcp->pid); + perror_func_msg("ptrace(PTRACE_DETACH,%u)", tcp->pid); goto drop; } /* ESRCH: process is either not stopped or doesn't exist. */ if (my_tkill(tcp->pid, 0) < 0) { if (errno != ESRCH) /* Shouldn't happen. */ - perror_msg("detach: tkill(%u,0)", tcp->pid); + perror_func_msg("tkill(%u,0)", tcp->pid); /* else: process doesn't exist. */ goto drop; } @@ -890,14 +890,13 @@ detach(struct tcb *tcp) if (!error) goto wait_loop; if (errno != ESRCH) - perror_msg("detach: ptrace(PTRACE_INTERRUPT,%u)", tcp->pid); - } - else { + perror_func_msg("ptrace(PTRACE_INTERRUPT,%u)", tcp->pid); + } else { error = my_tkill(tcp->pid, SIGSTOP); if (!error) goto wait_loop; if (errno != ESRCH) - perror_msg("detach: tkill(%u,SIGSTOP)", tcp->pid); + perror_func_msg("tkill(%u,SIGSTOP)", tcp->pid); } /* Either process doesn't exist, or some weird error. */ goto drop; @@ -918,7 +917,7 @@ detach(struct tcb *tcp) * ^^^ WRONG! We expect this PID to exist, * and want to emit a message otherwise: */ - perror_msg("detach: waitpid(%u)", tcp->pid); + perror_func_msg("waitpid(%u)", tcp->pid); break; } if (!WIFSTOPPED(status)) { @@ -935,9 +934,8 @@ detach(struct tcb *tcp) break; } sig = WSTOPSIG(status); - if (debug_flag) - error_msg("detach wait: event:%d sig:%d", - (unsigned)status >> 16, sig); + debug_msg("detach wait: event:%d sig:%d", + (unsigned) status >> 16, sig); if (use_seize) { unsigned event = (unsigned)status >> 16; if (event == PTRACE_EVENT_STOP /*&& sig == SIGTRAP*/) { @@ -1004,7 +1002,7 @@ process_opt_p_list(char *opt) * pidof uses space as delim, pgrep uses newline. :( */ int pid; - char *delim = opt + strcspn(opt, ", \n\t"); + char *delim = opt + strcspn(opt, "\n\t ,"); char c = *delim; *delim = '\0'; @@ -1033,17 +1031,16 @@ attach_tcb(struct tcb *const tcp) return; } - tcp->flags |= TCB_ATTACHED | TCB_STARTUP | post_attach_sigstop; - newoutf(tcp); - if (debug_flag) - error_msg("attach to pid %d (main) succeeded", tcp->pid); + after_successful_attach(tcp, TCB_GRABBED | post_attach_sigstop); + debug_msg("attach to pid %d (main) succeeded", tcp->pid); - char procdir[sizeof("/proc/%d/task") + sizeof(int) * 3]; + static const char task_path[] = "/proc/%d/task"; + char procdir[sizeof(task_path) + sizeof(int) * 3]; DIR *dir; unsigned int ntid = 0, nerr = 0; if (followfork && tcp->pid != strace_child && - sprintf(procdir, "/proc/%d/task", tcp->pid) > 0 && + xsprintf(procdir, task_path, tcp->pid) > 0 && (dir = opendir(procdir)) != NULL) { struct_dirent *de; @@ -1058,18 +1055,14 @@ attach_tcb(struct tcb *const tcp) ++ntid; if (ptrace_attach_or_seize(tid) < 0) { ++nerr; - if (debug_flag) - perror_msg("attach: ptrace(%s, %d)", - ptrace_attach_cmd, tid); + debug_perror_msg("attach: ptrace(%s, %d)", + ptrace_attach_cmd, tid); continue; } - if (debug_flag) - error_msg("attach to pid %d succeeded", tid); - struct tcb *tid_tcp = alloctcb(tid); - tid_tcp->flags |= TCB_ATTACHED | TCB_STARTUP | - post_attach_sigstop; - newoutf(tid_tcp); + after_successful_attach(alloctcb(tid), + TCB_GRABBED | post_attach_sigstop); + debug_msg("attach to pid %d succeeded", tid); } closedir(dir); @@ -1093,20 +1086,11 @@ startup_attach(void) unsigned int tcbi; struct tcb *tcp; - /* - * Block user interruptions as we would leave the traced - * process stopped (process state T) if we would terminate in - * between PTRACE_ATTACH and wait4() on SIGSTOP. - * We rely on cleanup() from this point on. - */ - if (interactive) - sigprocmask(SIG_BLOCK, &blocked_set, NULL); - if (daemonized_tracer) { pid_t pid = fork(); - if (pid < 0) { - perror_msg_and_die("fork"); - } + if (pid < 0) + perror_func_msg_and_die("fork"); + if (pid) { /* parent */ /* * Wait for grandchild to attach to straced process @@ -1141,12 +1125,8 @@ startup_attach(void) attach_tcb(tcp); - if (interactive) { - sigprocmask(SIG_SETMASK, &empty_set, NULL); - if (interrupted) - goto ret; - sigprocmask(SIG_BLOCK, &blocked_set, NULL); - } + if (interrupted) + return; } /* for each tcbtab[] */ if (daemonized_tracer) { @@ -1157,10 +1137,6 @@ startup_attach(void) kill(parent_pid, SIGKILL); strace_child = 0; } - - ret: - if (interactive) - sigprocmask(SIG_SETMASK, &empty_set, NULL); } /* Stack-o-phobic exec helper, in the hope to work around @@ -1172,6 +1148,7 @@ struct exec_params { gid_t run_egid; char **argv; char *pathname; + struct sigaction child_sa; }; static struct exec_params params_for_tracee; @@ -1202,8 +1179,7 @@ exec_or_die(void) if (setreuid(run_uid, params->run_euid) < 0) { perror_msg_and_die("setreuid"); } - } - else if (geteuid() != 0) + } else if (geteuid() != 0) if (setreuid(run_uid, run_uid) < 0) { perror_msg_and_die("setreuid"); } @@ -1226,6 +1202,9 @@ exec_or_die(void) alarm(0); } + if (params_for_tracee.child_sa.sa_handler != SIG_DFL) + sigaction(SIGCHLD, ¶ms_for_tracee.child_sa, NULL); + execv(params->pathname, params->argv); perror_msg_and_die("exec"); } @@ -1242,7 +1221,7 @@ open_dummy_desc(void) int fds[2]; if (pipe(fds)) - perror_msg_and_die("pipe"); + perror_func_msg_and_die("pipe"); close(fds[1]); set_cloexec_flag(fds[0]); return fds[0]; @@ -1297,7 +1276,7 @@ redirect_standard_fds(void) static void startup_child(char **argv) { - struct_stat statbuf; + strace_stat_t statbuf; const char *filename; size_t filename_len; char pathname[PATH_MAX]; @@ -1332,15 +1311,13 @@ startup_child(char **argv) if (colon) { n = colon - path; m = n + 1; - } - else + } else m = n = strlen(path); if (n == 0) { if (!getcwd(pathname, PATH_MAX)) continue; len = strlen(pathname); - } - else if (n > sizeof pathname - 1) + } else if (n > sizeof(pathname) - 1) continue; else { strncpy(pathname, path, n); @@ -1382,9 +1359,9 @@ startup_child(char **argv) #endif pid = fork(); - if (pid < 0) { - perror_msg_and_die("fork"); - } + if (pid < 0) + perror_func_msg_and_die("fork"); + if ((pid != 0 && daemonized_tracer) || (pid == 0 && !daemonized_tracer) ) { @@ -1430,19 +1407,20 @@ startup_child(char **argv) kill(pid, SIGCONT); } tcp = alloctcb(pid); - tcp->flags |= TCB_ATTACHED | TCB_STARTUP - | TCB_SKIP_DETACH_ON_FIRST_EXEC - | (NOMMU_SYSTEM ? 0 : (TCB_HIDE_LOG | post_attach_sigstop)); - newoutf(tcp); - } - else { + after_successful_attach(tcp, TCB_SKIP_DETACH_ON_FIRST_EXEC + | (NOMMU_SYSTEM ? 0 + : (TCB_HIDE_LOG + | post_attach_sigstop))); + } else { /* With -D, we are *child* here, the tracee is our parent. */ strace_child = strace_tracer_pid; strace_tracer_pid = getpid(); tcp = alloctcb(strace_child); tcp->flags |= TCB_SKIP_DETACH_ON_FIRST_EXEC | TCB_HIDE_LOG; - /* attaching will be done later, by startup_attach */ - /* note: we don't do newoutf(tcp) here either! */ + /* + * Attaching will be done later, by startup_attach. + * Note: we don't do after_successful_attach() here either! + */ /* NOMMU BUG! -D mode is active, we (child) return, * and we will scribble over parent's stack! @@ -1479,7 +1457,6 @@ startup_child(char **argv) redirect_standard_fds(); } -#if USE_SEIZE static void test_ptrace_seize(void) { @@ -1493,7 +1470,7 @@ test_ptrace_seize(void) pid = fork(); if (pid < 0) - perror_msg_and_die("fork"); + perror_func_msg_and_die("fork"); if (pid == 0) { pause(); @@ -1506,8 +1483,8 @@ test_ptrace_seize(void) */ if (ptrace(PTRACE_SEIZE, pid, 0, 0) == 0) { post_attach_sigstop = 0; /* this sets use_seize to 1 */ - } else if (debug_flag) { - error_msg("PTRACE_SEIZE doesn't work"); + } else { + debug_msg("PTRACE_SEIZE doesn't work"); } kill(pid, SIGKILL); @@ -1520,19 +1497,15 @@ test_ptrace_seize(void) if (tracee_pid <= 0) { if (errno == EINTR) continue; - perror_msg_and_die("%s: unexpected wait result %d", - __func__, tracee_pid); + perror_func_msg_and_die("unexpected wait result %d", + tracee_pid); } - if (WIFSIGNALED(status)) { + if (WIFSIGNALED(status)) return; - } - error_msg_and_die("%s: unexpected wait status %#x", - __func__, status); + + error_func_msg_and_die("unexpected wait status %#x", status); } } -#else /* !USE_SEIZE */ -# define test_ptrace_seize() ((void)0) -#endif static unsigned get_os_release(void) @@ -1550,12 +1523,12 @@ get_os_release(void) error_msg_and_die("Bad OS release string: '%s'", u.release); /* Note: this open-codes KERNEL_VERSION(): */ rel = (rel << 8) | atoi(p); - if (rel >= KERNEL_VERSION(1,0,0)) + if (rel >= KERNEL_VERSION(1, 0, 0)) break; while (*p >= '0' && *p <= '9') p++; if (*p != '.') { - if (rel >= KERNEL_VERSION(0,1,0)) { + if (rel >= KERNEL_VERSION(0, 1, 0)) { /* "X.Y-something" means "X.Y.0" */ rel <<= 8; break; @@ -1567,6 +1540,13 @@ get_os_release(void) return rel; } +static void +set_sighandler(int signo, void (*sighandler)(int), struct sigaction *oldact) +{ + const struct sigaction sa = { .sa_handler = sighandler }; + sigaction(signo, &sa, oldact); +} + /* * Initialization part of main() was eating much stack (~0.5k), * which was unused after init. @@ -1580,16 +1560,12 @@ init(int argc, char *argv[]) { int c, i; int optF = 0; - struct sigaction sa; - progname = argv[0] ? argv[0] : "strace"; - - /* Make sure SIGCHLD has the default action so that waitpid - definitely works without losing track of children. The user - should not have given us a bogus state to inherit, but he might - have. Arguably we should detect SIG_IGN here and pass it on - to children, but probably noone really needs that. */ - signal(SIGCHLD, SIG_DFL); + if (!program_invocation_name || !*program_invocation_name) { + static char name[] = "strace"; + program_invocation_name = + (argc > 0 && argv[0] && *argv[0]) ? argv[0] : name; + } strace_tracer_pid = getpid(); @@ -1605,14 +1581,20 @@ init(int argc, char *argv[]) # error Bug in DEFAULT_QUAL_FLAGS #endif qualify("signal=all"); - while ((c = getopt(argc, argv, - "+b:cCdfFhiqrtTvVwxyz" -#ifdef USE_LIBUNWIND - "k" + while ((c = getopt(argc, argv, "+" +#ifdef ENABLE_STACKTRACE + "k" #endif - "D" - "a:e:o:O:p:s:S:u:E:P:I:")) != EOF) { + "a:Ab:cCdDe:E:fFhiI:o:O:p:P:qrs:S:tTu:vVwxX:yz")) != EOF) { switch (c) { + case 'a': + acolumn = string_to_uint(optarg); + if (acolumn < 0) + error_opt_arg(c, optarg); + break; + case 'A': + open_append = true; + break; case 'b': if (strcmp(optarg, "execve") != 0) error_msg_and_die("Syscall '%s' for -b isn't supported", @@ -1637,59 +1619,37 @@ init(int argc, char *argv[]) case 'D': daemonized_tracer = 1; break; - case 'F': - optF = 1; + case 'e': + qualify(optarg); + break; + case 'E': + if (putenv(optarg) < 0) + perror_msg_and_die("putenv"); break; case 'f': followfork++; break; + case 'F': + optF = 1; + break; case 'h': usage(); break; case 'i': iflag = 1; break; - case 'q': - qflag++; - break; - case 'r': - rflag = 1; - break; - case 't': - tflag++; - break; - case 'T': - Tflag = 1; - break; - case 'w': - count_wallclock = 1; - break; - case 'x': - xflag++; - break; - case 'y': - show_fd_path++; - break; - case 'v': - qualify("abbrev=none"); - break; - case 'V': - print_version(); - exit(0); - break; - case 'z': - not_failing_only = 1; - break; - case 'a': - acolumn = string_to_uint(optarg); - if (acolumn < 0) + case 'I': + opt_intr = string_to_uint_upto(optarg, NUM_INTR_OPTS - 1); + if (opt_intr <= 0) error_opt_arg(c, optarg); break; - case 'e': - qualify(optarg); +#ifdef ENABLE_STACKTRACE + case 'k': + stack_trace_enabled = true; break; +#endif case 'o': - outfname = xstrdup(optarg); + outfname = optarg; break; case 'O': i = string_to_uint(optarg); @@ -1703,54 +1663,85 @@ init(int argc, char *argv[]) case 'P': pathtrace_select(optarg); break; + case 'q': + qflag++; + break; + case 'r': + rflag = 1; + break; case 's': i = string_to_uint(optarg); - if (i < 0) + if (i < 0 || (unsigned int) i > -1U / 4) error_opt_arg(c, optarg); max_strlen = i; break; case 'S': set_sortby(optarg); break; - case 'u': - username = xstrdup(optarg); + case 't': + tflag++; break; -#ifdef USE_LIBUNWIND - case 'k': - stack_trace_enabled = true; + case 'T': + Tflag = 1; break; -#endif - case 'E': - if (putenv(optarg) < 0) - die_out_of_memory(); + case 'u': + username = optarg; break; - case 'I': - opt_intr = string_to_uint_upto(optarg, NUM_INTR_OPTS - 1); - if (opt_intr <= 0) + case 'v': + qualify("abbrev=none"); + break; + case 'V': + print_version(); + exit(0); + break; + case 'w': + count_wallclock = 1; + break; + case 'x': + xflag++; + break; + case 'X': + if (!strcmp(optarg, "raw")) + xlat_verbosity = XLAT_STYLE_RAW; + else if (!strcmp(optarg, "abbrev")) + xlat_verbosity = XLAT_STYLE_ABBREV; + else if (!strcmp(optarg, "verbose")) + xlat_verbosity = XLAT_STYLE_VERBOSE; + else error_opt_arg(c, optarg); break; + case 'y': + show_fd_path++; + break; + case 'z': + not_failing_only = 1; + break; default: error_msg_and_help(NULL); break; } } - argv += optind; - /* argc -= optind; - no need, argc is not used below */ - acolumn_spaces = xmalloc(acolumn + 1); - memset(acolumn_spaces, ' ', acolumn); - acolumn_spaces[acolumn] = '\0'; + argv += optind; + argc -= optind; - if (!argv[0] && !nprocs) { + if (argc < 0 || (!nprocs && !argc)) { error_msg_and_help("must have PROG [ARGS] or -p PID"); } - if (!argv[0] && daemonized_tracer) { + if (!argc && daemonized_tracer) { error_msg_and_help("PROG [ARGS] must be specified with -D"); } - if (!followfork) - followfork = optF; + if (optF) { + if (followfork) { + error_msg("deprecated option -F ignored"); + } else { + error_msg("option -F is deprecated, " + "please use -f instead"); + followfork = optF; + } + } if (followfork >= 2 && cflag) { error_msg_and_help("(-c or -C) and -ff are mutually exclusive"); @@ -1763,10 +1754,8 @@ init(int argc, char *argv[]) if (cflag == CFLAG_ONLY_STATS) { if (iflag) error_msg("-%c has no effect with -c", 'i'); -#ifdef USE_LIBUNWIND if (stack_trace_enabled) error_msg("-%c has no effect with -c", 'k'); -#endif if (rflag) error_msg("-%c has no effect with -c", 'r'); if (tflag) @@ -1777,21 +1766,15 @@ init(int argc, char *argv[]) error_msg("-%c has no effect with -c", 'y'); } - if (rflag) { - if (tflag > 1) - error_msg("-tt has no effect with -r"); - tflag = 1; - } + acolumn_spaces = xmalloc(acolumn + 1); + memset(acolumn_spaces, ' ', acolumn); + acolumn_spaces[acolumn] = '\0'; -#ifdef USE_LIBUNWIND - if (stack_trace_enabled) { - unsigned int tcbi; + set_sighandler(SIGCHLD, SIG_DFL, ¶ms_for_tracee.child_sa); +#ifdef ENABLE_STACKTRACE + if (stack_trace_enabled) unwind_init(); - for (tcbi = 0; tcbi < tcbtabsize; ++tcbi) { - unwind_tcb_init(tcbtab[tcbi]); - } - } #endif /* See if they want to run as another user. */ @@ -1807,8 +1790,7 @@ init(int argc, char *argv[]) } run_uid = pent->pw_uid; run_gid = pent->pw_gid; - } - else { + } else { run_uid = getuid(); run_gid = getgid(); } @@ -1817,9 +1799,9 @@ init(int argc, char *argv[]) ptrace_setoptions |= PTRACE_O_TRACECLONE | PTRACE_O_TRACEFORK | PTRACE_O_TRACEVFORK; - if (debug_flag) - error_msg("ptrace_setoptions = %#x", ptrace_setoptions); + debug_msg("ptrace_setoptions = %#x", ptrace_setoptions); test_ptrace_seize(); + test_ptrace_get_syscall_info(); /* * Is something weird with our stdin and/or stdout - @@ -1843,11 +1825,15 @@ init(int argc, char *argv[]) * when using popen, so prohibit it. */ if (followfork >= 2) - error_msg_and_help("piping the output and -ff are mutually exclusive"); + error_msg_and_help("piping the output and -ff " + "are mutually exclusive"); shared_log = strace_popen(outfname + 1); - } - else if (followfork < 2) + } else if (followfork < 2) { shared_log = strace_fopen(outfname); + } else if (strlen(outfname) >= PATH_MAX - sizeof(int) * 3) { + errno = ENAMETOOLONG; + perror_msg_and_die("%s", outfname); + } } else { /* -ff without -o FILE is the same as single -f */ if (followfork >= 2) @@ -1857,63 +1843,59 @@ init(int argc, char *argv[]) if (!outfname || outfname[0] == '|' || outfname[0] == '!') { setvbuf(shared_log, NULL, _IOLBF, 0); } - if (outfname && argv[0]) { - if (!opt_intr) - opt_intr = INTR_NEVER; - if (!qflag) - qflag = 1; - } - if (!opt_intr) - opt_intr = INTR_WHILE_WAIT; - /* argv[0] -pPID -oFILE Default interactive setting + /* + * argv[0] -pPID -oFILE Default interactive setting * yes * 0 INTR_WHILE_WAIT * no 1 0 INTR_WHILE_WAIT * yes * 1 INTR_NEVER * no 1 1 INTR_WHILE_WAIT */ - sigemptyset(&empty_set); - sigemptyset(&blocked_set); + if (daemonized_tracer && !opt_intr) + opt_intr = INTR_BLOCK_TSTP_TOO; + if (outfname && argc) { + if (!opt_intr) + opt_intr = INTR_NEVER; + if (!qflag) + qflag = 1; + } + if (!opt_intr) + opt_intr = INTR_WHILE_WAIT; - /* startup_child() must be called before the signal handlers get + /* + * startup_child() must be called before the signal handlers get * installed below as they are inherited into the spawned process. * Also we do not need to be protected by them as during interruption * in the startup_child() mode we kill the spawned process anyway. */ - if (argv[0]) { + if (argc) { startup_child(argv); } - sa.sa_handler = SIG_IGN; - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - sigaction(SIGTTOU, &sa, NULL); /* SIG_IGN */ - sigaction(SIGTTIN, &sa, NULL); /* SIG_IGN */ + set_sighandler(SIGTTOU, SIG_IGN, NULL); + set_sighandler(SIGTTIN, SIG_IGN, NULL); if (opt_intr != INTR_ANYWHERE) { if (opt_intr == INTR_BLOCK_TSTP_TOO) - sigaction(SIGTSTP, &sa, NULL); /* SIG_IGN */ + set_sighandler(SIGTSTP, SIG_IGN, NULL); /* * In interactive mode (if no -o OUTFILE, or -p PID is used), - * fatal signals are blocked while syscall stop is processed, - * and acted on in between, when waiting for new syscall stops. - * In non-interactive mode, signals are ignored. + * fatal signals are handled asynchronously and acted + * when waiting for process state changes. + * In non-interactive mode these signals are ignored. */ - if (opt_intr == INTR_WHILE_WAIT) { - sigaddset(&blocked_set, SIGHUP); - sigaddset(&blocked_set, SIGINT); - sigaddset(&blocked_set, SIGQUIT); - sigaddset(&blocked_set, SIGPIPE); - sigaddset(&blocked_set, SIGTERM); - sa.sa_handler = interrupt; - } - /* SIG_IGN, or set handler for these */ - sigaction(SIGHUP, &sa, NULL); - sigaction(SIGINT, &sa, NULL); - sigaction(SIGQUIT, &sa, NULL); - sigaction(SIGPIPE, &sa, NULL); - sigaction(SIGTERM, &sa, NULL); + set_sighandler(SIGHUP, interactive ? interrupt : SIG_IGN, NULL); + set_sighandler(SIGINT, interactive ? interrupt : SIG_IGN, NULL); + set_sighandler(SIGQUIT, interactive ? interrupt : SIG_IGN, NULL); + set_sighandler(SIGPIPE, interactive ? interrupt : SIG_IGN, NULL); + set_sighandler(SIGTERM, interactive ? interrupt : SIG_IGN, NULL); } + + sigemptyset(&timer_set); + sigaddset(&timer_set, SIGALRM); + sigprocmask(SIG_BLOCK, &timer_set, NULL); + set_sighandler(SIGALRM, timer_sighandler, NULL); + if (nprocs != 0 || daemonized_tracer) startup_attach(); @@ -1926,31 +1908,36 @@ init(int argc, char *argv[]) } static struct tcb * -pid2tcb(int pid) +pid2tcb(const int pid) { - unsigned int i; - if (pid <= 0) return NULL; - for (i = 0; i < tcbtabsize; i++) { - struct tcb *tcp = tcbtab[i]; +#define PID2TCB_CACHE_SIZE 1024U +#define PID2TCB_CACHE_MASK (PID2TCB_CACHE_SIZE - 1) + + static struct tcb *pid2tcb_cache[PID2TCB_CACHE_SIZE]; + struct tcb **const ptcp = &pid2tcb_cache[pid & PID2TCB_CACHE_MASK]; + struct tcb *tcp = *ptcp; + + if (tcp && tcp->pid == pid) + return tcp; + + for (unsigned int i = 0; i < tcbtabsize; ++i) { + tcp = tcbtab[i]; if (tcp->pid == pid) - return tcp; + return *ptcp = tcp; } return NULL; } static void -cleanup(void) +cleanup(int fatal_sig) { unsigned int i; struct tcb *tcp; - int fatal_sig; - /* 'interrupted' is a volatile object, fetch it only once */ - fatal_sig = interrupted; if (!fatal_sig) fatal_sig = SIGTERM; @@ -1958,16 +1945,13 @@ cleanup(void) tcp = tcbtab[i]; if (!tcp->pid) continue; - if (debug_flag) - error_msg("cleanup: looking at pid %u", tcp->pid); + debug_func_msg("looking at pid %u", tcp->pid); if (tcp->pid == strace_child) { kill(tcp->pid, SIGCONT); kill(tcp->pid, fatal_sig); } detach(tcp); } - if (cflag) - call_summary(shared_log); } static void @@ -1985,23 +1969,14 @@ print_debug_info(const int pid, int status) strcpy(buf, "???"); if (WIFSIGNALED(status)) -#ifdef WCOREDUMP - sprintf(buf, "WIFSIGNALED,%ssig=%s", + xsprintf(buf, "WIFSIGNALED,%ssig=%s", WCOREDUMP(status) ? "core," : "", - signame(WTERMSIG(status))); -#else - sprintf(buf, "WIFSIGNALED,sig=%s", - signame(WTERMSIG(status))); -#endif + sprintsigname(WTERMSIG(status))); if (WIFEXITED(status)) - sprintf(buf, "WIFEXITED,exitcode=%u", WEXITSTATUS(status)); + xsprintf(buf, "WIFEXITED,exitcode=%u", WEXITSTATUS(status)); if (WIFSTOPPED(status)) - sprintf(buf, "WIFSTOPPED,sig=%s", signame(WSTOPSIG(status))); -#ifdef WIFCONTINUED - /* Should never be seen */ - if (WIFCONTINUED(status)) - strcpy(buf, "WIFCONTINUED"); -#endif + xsprintf(buf, "WIFSTOPPED,sig=%s", + sprintsigname(WSTOPSIG(status))); evbuf[0] = '\0'; if (event != 0) { static const char *const event_names[] = { @@ -2018,7 +1993,7 @@ print_debug_info(const int pid, int status) e = event_names[event]; else if (event == PTRACE_EVENT_STOP) e = "STOP"; - sprintf(evbuf, ",EVENT_%s (%u)", e, event); + xsprintf(evbuf, ",EVENT_%s (%u)", e, event); } error_msg("[wait(0x%06x) = %u] %s%s", status, pid, buf, evbuf); } @@ -2042,17 +2017,20 @@ maybe_allocate_tcb(const int pid, int status) if (followfork) { /* We assume it's a fork/vfork/clone child */ struct tcb *tcp = alloctcb(pid); - tcp->flags |= TCB_ATTACHED | TCB_STARTUP | post_attach_sigstop; - newoutf(tcp); + after_successful_attach(tcp, post_attach_sigstop); if (!qflag) error_msg("Process %d attached", pid); return tcp; } else { - /* This can happen if a clone call used - * CLONE_PTRACE itself. + /* + * This can happen if a clone call misused CLONE_PTRACE itself. + * + * There used to be a dance around possible re-injection of + * WSTOPSIG(status), but it was later removed as the only + * observable stop here is the initial ptrace-stop. */ - ptrace(PTRACE_CONT, pid, NULL, 0); - error_msg("Stop of unknown pid %u seen, PTRACE_CONTed it", pid); + ptrace(PTRACE_DETACH, pid, NULL, 0L); + error_msg("Detached unknown pid %d", pid); return NULL; } } @@ -2062,10 +2040,8 @@ maybe_switch_tcbs(struct tcb *tcp, const int pid) { FILE *fp; struct tcb *execve_thread; - long old_pid = 0; + long old_pid = tcb_wait_tab[tcp->wait_data_idx].msg; - if (ptrace(PTRACE_GETEVENTMSG, pid, NULL, &old_pid) < 0) - return tcp; /* Avoid truncation in pid2tcb() param passing */ if (old_pid <= 0 || old_pid == pid) return tcp; @@ -2115,16 +2091,11 @@ print_signalled(struct tcb *tcp, const int pid, int status) } if (cflag != CFLAG_ONLY_STATS - && is_number_in_set(WTERMSIG(status), &signal_set)) { + && is_number_in_set(WTERMSIG(status), signal_set)) { printleader(tcp); -#ifdef WCOREDUMP tprintf("+++ killed by %s %s+++\n", - signame(WTERMSIG(status)), + sprintsigname(WTERMSIG(status)), WCOREDUMP(status) ? "(core dumped) " : ""); -#else - tprintf("+++ killed by %s +++\n", - signame(WTERMSIG(status))); -#endif line_ended(); } } @@ -2150,30 +2121,33 @@ print_stopped(struct tcb *tcp, const siginfo_t *si, const unsigned int sig) { if (cflag != CFLAG_ONLY_STATS && !hide_log(tcp) - && is_number_in_set(sig, &signal_set)) { + && is_number_in_set(sig, signal_set)) { printleader(tcp); if (si) { - tprintf("--- %s ", signame(sig)); + tprintf("--- %s ", sprintsigname(sig)); printsiginfo(si); tprints(" ---\n"); } else - tprintf("--- stopped by %s ---\n", signame(sig)); + tprintf("--- stopped by %s ---\n", sprintsigname(sig)); line_ended(); + +#ifdef ENABLE_STACKTRACE + if (stack_trace_enabled) + unwind_tcb_print(tcp); +#endif } } static void startup_tcb(struct tcb *tcp) { - if (debug_flag) - error_msg("pid %d has TCB_STARTUP, initializing it", tcp->pid); + debug_msg("pid %d has TCB_STARTUP, initializing it", tcp->pid); tcp->flags &= ~TCB_STARTUP; if (!use_seize) { - if (debug_flag) - error_msg("setting opts 0x%x on pid %d", - ptrace_setoptions, tcp->pid); + debug_msg("setting opts 0x%x on pid %d", + ptrace_setoptions, tcp->pid); if (ptrace(PTRACE_SETOPTIONS, tcp->pid, NULL, ptrace_setoptions) < 0) { if (errno != ESRCH) { /* Should never happen, really */ @@ -2181,6 +2155,9 @@ startup_tcb(struct tcb *tcp) } } } + + if ((tcp->flags & TCB_GRABBED) && (get_scno(tcp) == 1)) + tcp->s_prev_ent = tcp->s_ent; } static void @@ -2193,19 +2170,14 @@ print_event_exit(struct tcb *tcp) if (followfork < 2 && printing_tcp && printing_tcp != tcp && printing_tcp->curcol != 0) { - current_tcp = printing_tcp; + set_current_tcp(printing_tcp); tprints(" \n"); - fflush(printing_tcp->outf); + flush_tcp_output(printing_tcp); printing_tcp->curcol = 0; - current_tcp = tcp; + set_current_tcp(tcp); } - if ((followfork < 2 && printing_tcp != tcp) - || (tcp->flags & TCB_REPRINT)) { - tcp->flags &= ~TCB_REPRINT; - printleader(tcp); - tprintf("<... %s resumed>", tcp->s_ent->sys_name); - } + print_syscall_resume(tcp); if (!(tcp->sys_func_rval & RVAL_DECODED)) { /* @@ -2214,31 +2186,85 @@ print_event_exit(struct tcb *tcp) */ tprints(" "); } + + printing_tcp = tcp; tprints(") "); tabto(); tprints("= ?\n"); line_ended(); } -/* Returns true iff the main trace loop has to continue. */ -static bool -trace(void) +static size_t +trace_wait_data_size(struct tcb *tcp) { - int pid; - int wait_errno; - int status; - bool stopped; - unsigned int sig; - unsigned int event; - struct tcb *tcp; - struct rusage ru; + return sizeof(struct tcb_wait_data); +} + +static struct tcb_wait_data * +init_trace_wait_data(void *p) +{ + struct tcb_wait_data *wd = p; + + memset(wd, 0, sizeof(*wd)); + + return wd; +} + +static struct tcb_wait_data * +copy_trace_wait_data(const struct tcb_wait_data *wd) +{ + struct tcb_wait_data *new_wd = xmalloc(sizeof(*new_wd)); + + memcpy(new_wd, wd, sizeof(*wd)); + + return new_wd; +} + +static void +free_trace_wait_data(struct tcb_wait_data *wd) +{ + free(wd); +} +static void +tcb_wait_tab_check_size(const size_t size) +{ + while (size >= tcb_wait_tab_size) { + tcb_wait_tab = xgrowarray(tcb_wait_tab, + &tcb_wait_tab_size, + sizeof(tcb_wait_tab[0])); + } +} + +static const struct tcb_wait_data * +next_event(void) +{ if (interrupted) - return false; + return NULL; + + struct tcb *tcp = NULL; + struct list_item *elem; + + static EMPTY_LIST(pending_tcps); + /* Handle the queued tcbs before waiting for new events. */ + if (!list_is_empty(&pending_tcps)) + goto next_event_get_tcp; + + static struct tcb *extra_tcp; + static size_t wait_extra_data_idx; + /* Handle the extra tcb event. */ + if (extra_tcp) { + tcp = extra_tcp; + extra_tcp = NULL; + tcp->wait_data_idx = wait_extra_data_idx; + + debug_msg("dequeued extra event for pid %u", tcp->pid); + goto next_event_exit; + } /* * Used to exit simply when nprocs hits zero, but in this testcase: - * int main() { _exit(!!fork()); } + * int main(void) { _exit(!!fork()); } * under strace -f, parent sometimes (rarely) manages * to exit before we see the first stop of the child, * and we are losing track of it: @@ -2254,55 +2280,368 @@ trace(void) * on exit. Oh well... */ if (nprocs == 0) - return false; + return NULL; } - if (interactive) - sigprocmask(SIG_SETMASK, &empty_set, NULL); - pid = wait4(-1, &status, __WALL, (cflag ? &ru : NULL)); - wait_errno = errno; - if (interactive) - sigprocmask(SIG_BLOCK, &blocked_set, NULL); + const bool unblock_delay_timer = is_delay_timer_armed(); - if (pid < 0) { - if (wait_errno == EINTR) - return true; - if (nprocs == 0 && wait_errno == ECHILD) - return false; - /* - * If nprocs > 0, ECHILD is not expected, - * treat it as any other error here: - */ - errno = wait_errno; - perror_msg_and_die("wait4(__WALL)"); + /* + * The window of opportunity to handle expirations + * of the delay timer opens here. + * + * Unblock the signal handler for the delay timer + * iff the delay timer is already created. + */ + if (unblock_delay_timer) + sigprocmask(SIG_UNBLOCK, &timer_set, NULL); + + /* + * If the delay timer has expired, then its expiration + * has been handled already by the signal handler. + * + * If the delay timer expires during wait4(), + * then the system call will be interrupted and + * the expiration will be handled by the signal handler. + */ + int status; + struct rusage ru; + int pid = wait4(-1, &status, __WALL, (cflag ? &ru : NULL)); + int wait_errno = errno; + + /* + * The window of opportunity to handle expirations + * of the delay timer closes here. + * + * Block the signal handler for the delay timer + * iff it was unblocked earlier. + */ + if (unblock_delay_timer) { + sigprocmask(SIG_BLOCK, &timer_set, NULL); + + if (restart_failed) + return NULL; } - if (pid == popen_pid) { - if (!WIFSTOPPED(status)) - popen_pid = 0; - return true; + size_t wait_tab_pos = 0; + bool wait_nohang = false; + + /* + * Wait for new events until wait4() returns 0 (meaning that there's + * nothing more to wait for for now), or a second event for some tcb + * appears (which may happen if a tracee was SIGKILL'ed, for example). + */ + for (;;) { + struct tcb_wait_data *wd; + + if (pid < 0) { + if (wait_errno == EINTR) + break; + if (wait_nohang) + break; + if (nprocs == 0 && wait_errno == ECHILD) + return NULL; + /* + * If nprocs > 0, ECHILD is not expected, + * treat it as any other error here: + */ + errno = wait_errno; + perror_msg_and_die("wait4(__WALL)"); + } + + if (!pid) + break; + + if (pid == popen_pid) { + if (!WIFSTOPPED(status)) + popen_pid = 0; + break; + } + + if (debug_flag) + print_debug_info(pid, status); + + /* Look up 'pid' in our table. */ + tcp = pid2tcb(pid); + + if (!tcp) { + tcp = maybe_allocate_tcb(pid, status); + if (!tcp) + goto next_event_wait_next; + } + + if (cflag) { + struct timespec stime = { + .tv_sec = ru.ru_stime.tv_sec, + .tv_nsec = ru.ru_stime.tv_usec * 1000 + }; + ts_sub(&tcp->dtime, &stime, &tcp->stime); + tcp->stime = stime; + } + + tcb_wait_tab_check_size(wait_tab_pos); + + /* Initialise a new wait data structure. */ + wd = tcb_wait_tab + wait_tab_pos; + init_trace_wait_data(wd); + wd->status = status; + + if (WIFSIGNALED(status)) { + wd->te = TE_SIGNALLED; + } else if (WIFEXITED(status)) { + wd->te = TE_EXITED; + } else { + /* + * As WCONTINUED flag has not been specified to wait4, + * it cannot be WIFCONTINUED(status), so the only case + * that remains is WIFSTOPPED(status). + */ + + const unsigned int sig = WSTOPSIG(status); + const unsigned int event = (unsigned int) status >> 16; + + switch (event) { + case 0: + /* + * Is this post-attach SIGSTOP? + * Interestingly, the process may stop + * with STOPSIG equal to some other signal + * than SIGSTOP if we happened to attach + * just before the process takes a signal. + */ + if (sig == SIGSTOP && + (tcp->flags & TCB_IGNORE_ONE_SIGSTOP)) { + debug_func_msg("ignored SIGSTOP on " + "pid %d", tcp->pid); + tcp->flags &= ~TCB_IGNORE_ONE_SIGSTOP; + wd->te = TE_RESTART; + } else if (sig == syscall_trap_sig) { + wd->te = TE_SYSCALL_STOP; + } else { + /* + * True if tracee is stopped by signal + * (as opposed to "tracee received + * signal"). + * TODO: shouldn't we check for + * errno == EINVAL too? + * We can get ESRCH instead, you know... + */ + bool stopped = ptrace(PTRACE_GETSIGINFO, + pid, 0, &wd->si) < 0; + + wd->te = stopped ? TE_GROUP_STOP + : TE_SIGNAL_DELIVERY_STOP; + } + break; + case PTRACE_EVENT_STOP: + /* + * PTRACE_INTERRUPT-stop or group-stop. + * PTRACE_INTERRUPT-stop has sig == SIGTRAP here. + */ + switch (sig) { + case SIGSTOP: + case SIGTSTP: + case SIGTTIN: + case SIGTTOU: + wd->te = TE_GROUP_STOP; + break; + default: + wd->te = TE_RESTART; + } + break; + case PTRACE_EVENT_EXEC: + /* + * TODO: shouldn't we check for + * errno == EINVAL here, too? + * We can get ESRCH instead, you know... + */ + if (ptrace(PTRACE_GETEVENTMSG, pid, NULL, + &wd->msg) < 0) + wd->msg = 0; + + wd->te = TE_STOP_BEFORE_EXECVE; + break; + case PTRACE_EVENT_EXIT: + wd->te = TE_STOP_BEFORE_EXIT; + break; + default: + wd->te = TE_RESTART; + } + } + + if (!wd->te) + error_func_msg("Tracing event hasn't been determined " + "for pid %d, status %0#x", pid, status); + + if (!list_is_empty(&tcp->wait_list)) { + wait_extra_data_idx = wait_tab_pos; + extra_tcp = tcp; + debug_func_msg("queued extra pid %d", tcp->pid); + } else { + tcp->wait_data_idx = wait_tab_pos; + list_append(&pending_tcps, &tcp->wait_list); + debug_func_msg("queued pid %d", tcp->pid); + } + + wait_tab_pos++; + + if (extra_tcp) + break; + +next_event_wait_next: + pid = wait4(-1, &status, __WALL | WNOHANG, (cflag ? &ru : NULL)); + wait_errno = errno; + wait_nohang = true; } - if (debug_flag) - print_debug_info(pid, status); +next_event_get_tcp: + elem = list_remove_head(&pending_tcps); - /* Look up 'pid' in our table. */ - tcp = pid2tcb(pid); + if (!elem) { + tcb_wait_tab_check_size(0); + memset(tcb_wait_tab, 0, sizeof(*tcb_wait_tab)); + tcb_wait_tab->te = TE_NEXT; - if (!tcp) { - tcp = maybe_allocate_tcb(pid, status); - if (!tcp) - return true; + return tcb_wait_tab; + } else { + tcp = list_elem(elem, struct tcb, wait_list); + debug_func_msg("dequeued pid %d", tcp->pid); } - if (WIFSTOPPED(status)) - get_regs(pid); - else - clear_regs(); +next_event_exit: + /* Is this the very first time we see this tracee stopped? */ + if (tcp->flags & TCB_STARTUP) + startup_tcb(tcp); + + clear_regs(tcp); + + /* Set current output file */ + set_current_tcp(tcp); + + return tcb_wait_tab + tcp->wait_data_idx; +} - event = (unsigned int) status >> 16; +static int +trace_syscall(struct tcb *tcp, unsigned int *sig) +{ + if (entering(tcp)) { + int res = syscall_entering_decode(tcp); + switch (res) { + case 0: + return 0; + case 1: + res = syscall_entering_trace(tcp, sig); + } + syscall_entering_finish(tcp, res); + return res; + } else { + struct timespec ts = {}; + int res = syscall_exiting_decode(tcp, &ts); + if (res != 0) { + res = syscall_exiting_trace(tcp, &ts, res); + } + syscall_exiting_finish(tcp); + return res; + } +} + +/* Returns true iff the main trace loop has to continue. */ +static bool +dispatch_event(const struct tcb_wait_data *wd) +{ + unsigned int restart_op = PTRACE_SYSCALL; + unsigned int restart_sig = 0; + enum trace_event te = wd ? wd->te : TE_BREAK; + /* + * Copy wd->status to a non-const variable to workaround glibc bugs + * around union wait fixed by glibc commit glibc-2.24~391 + */ + int status = wd ? wd->status : 0; + + switch (te) { + case TE_BREAK: + return false; + + case TE_NEXT: + return true; + + case TE_RESTART: + break; + + case TE_SYSCALL_STOP: + if (trace_syscall(current_tcp, &restart_sig) < 0) { + /* + * ptrace() failed in trace_syscall(). + * Likely a result of process disappearing mid-flight. + * Observed case: exit_group() or SIGKILL terminating + * all processes in thread group. + * We assume that ptrace error was caused by process death. + * We used to detach(current_tcp) here, but since we no + * longer implement "detach before death" policy/hack, + * we can let this process to report its death to us + * normally, via WIFEXITED or WIFSIGNALED wait status. + */ + return true; + } + break; + + case TE_SIGNAL_DELIVERY_STOP: + restart_sig = WSTOPSIG(status); + print_stopped(current_tcp, &wd->si, restart_sig); + break; + + case TE_SIGNALLED: + print_signalled(current_tcp, current_tcp->pid, status); + droptcb(current_tcp); + return true; + + case TE_GROUP_STOP: + restart_sig = WSTOPSIG(status); + print_stopped(current_tcp, NULL, restart_sig); + if (use_seize) { + /* + * This ends ptrace-stop, but does *not* end group-stop. + * This makes stopping signals work properly on straced + * process (that is, process really stops. It used to + * continue to run). + */ + restart_op = PTRACE_LISTEN; + restart_sig = 0; + } + break; + + case TE_EXITED: + print_exited(current_tcp, current_tcp->pid, status); + droptcb(current_tcp); + return true; + + case TE_STOP_BEFORE_EXECVE: + /* The syscall succeeded, clear the flag. */ + current_tcp->flags &= ~TCB_CHECK_EXEC_SYSCALL; + /* + * Check that we are inside syscall now (next event after + * PTRACE_EVENT_EXEC should be for syscall exiting). If it is + * not the case, we might have a situation when we attach to a + * process and the first thing we see is a PTRACE_EVENT_EXEC + * and all the following syscall state tracking is screwed up + * otherwise. + */ + if (entering(current_tcp)) { + int ret; + + error_msg("Stray PTRACE_EVENT_EXEC from pid %d" + ", trying to recover...", + current_tcp->pid); + + current_tcp->flags |= TCB_RECOVERING; + ret = trace_syscall(current_tcp, &restart_sig); + current_tcp->flags &= ~TCB_RECOVERING; + + if (ret < 0) { + /* The reason is described in TE_SYSCALL_STOP */ + return true; + } + } - if (event == PTRACE_EVENT_EXEC) { /* * Under Linux, execve changes pid to thread leader's pid, * and we see this changed pid on EVENT_EXEC and later, @@ -2318,184 +2657,141 @@ trace(void) * PTRACE_GETEVENTMSG returns old pid starting from Linux 3.0. * On 2.6 and earlier, it can return garbage. */ - if (os_release >= KERNEL_VERSION(3,0,0)) - tcp = maybe_switch_tcbs(tcp, pid); + if (os_release >= KERNEL_VERSION(3, 0, 0)) + set_current_tcp(maybe_switch_tcbs(current_tcp, + current_tcp->pid)); if (detach_on_execve) { - if (tcp->flags & TCB_SKIP_DETACH_ON_FIRST_EXEC) { - tcp->flags &= ~TCB_SKIP_DETACH_ON_FIRST_EXEC; + if (current_tcp->flags & TCB_SKIP_DETACH_ON_FIRST_EXEC) { + current_tcp->flags &= ~TCB_SKIP_DETACH_ON_FIRST_EXEC; } else { - detach(tcp); /* do "-b execve" thingy */ + detach(current_tcp); /* do "-b execve" thingy */ return true; } } - } + break; - /* Set current output file */ - current_tcp = tcp; - - if (cflag) { - tv_sub(&tcp->dtime, &ru.ru_stime, &tcp->stime); - tcp->stime = ru.ru_stime; + case TE_STOP_BEFORE_EXIT: + print_event_exit(current_tcp); + break; } - if (WIFSIGNALED(status)) { - print_signalled(tcp, pid, status); - droptcb(tcp); - return true; - } + /* We handled quick cases, we are permitted to interrupt now. */ + if (interrupted) + return false; - if (WIFEXITED(status)) { - print_exited(tcp, pid, status); - droptcb(tcp); - return true; - } + /* If the process is being delayed, do not ptrace_restart just yet */ + if (syscall_delayed(current_tcp)) { + if (current_tcp->delayed_wait_data) + error_func_msg("pid %d has delayed wait data set" + " already", current_tcp->pid); + + current_tcp->delayed_wait_data = copy_trace_wait_data(wd); - if (!WIFSTOPPED(status)) { - /* - * Neither signalled, exited or stopped. - * How could that be? - */ - error_msg("pid %u not stopped!", pid); - droptcb(tcp); return true; } - /* Is this the very first time we see this tracee stopped? */ - if (tcp->flags & TCB_STARTUP) { - startup_tcb(tcp); - if (get_scno(tcp) == 1) - tcp->s_prev_ent = tcp->s_ent; + if (ptrace_restart(restart_op, current_tcp, restart_sig) < 0) { + /* Note: ptrace_restart emitted error message */ + exit_code = 1; + return false; } + return true; +} - sig = WSTOPSIG(status); +static bool +restart_delayed_tcb(struct tcb *const tcp) +{ + struct tcb_wait_data *wd = tcp->delayed_wait_data; - switch (event) { - case 0: - break; - case PTRACE_EVENT_EXIT: - print_event_exit(tcp); - goto restart_tracee_with_sig_0; -#if USE_SEIZE - case PTRACE_EVENT_STOP: - /* - * PTRACE_INTERRUPT-stop or group-stop. - * PTRACE_INTERRUPT-stop has sig == SIGTRAP here. - */ - switch (sig) { - case SIGSTOP: - case SIGTSTP: - case SIGTTIN: - case SIGTTOU: - stopped = true; - goto show_stopsig; - } - /* fall through */ -#endif - default: - goto restart_tracee_with_sig_0; + if (!wd) { + error_func_msg("No delayed wait data found for pid %d", + tcp->pid); + wd = init_trace_wait_data(alloca(trace_wait_data_size(tcp))); } - /* - * Is this post-attach SIGSTOP? - * Interestingly, the process may stop - * with STOPSIG equal to some other signal - * than SIGSTOP if we happend to attach - * just before the process takes a signal. - */ - if (sig == SIGSTOP && (tcp->flags & TCB_IGNORE_ONE_SIGSTOP)) { - if (debug_flag) - error_msg("ignored SIGSTOP on pid %d", tcp->pid); - tcp->flags &= ~TCB_IGNORE_ONE_SIGSTOP; - goto restart_tracee_with_sig_0; - } + wd->te = TE_RESTART; - if (sig != syscall_trap_sig) { - siginfo_t si = {}; + debug_func_msg("pid %d", tcp->pid); - /* - * True if tracee is stopped by signal - * (as opposed to "tracee received signal"). - * TODO: shouldn't we check for errno == EINVAL too? - * We can get ESRCH instead, you know... - */ - stopped = ptrace(PTRACE_GETSIGINFO, pid, 0, &si) < 0; -#if USE_SEIZE -show_stopsig: -#endif - print_stopped(tcp, stopped ? NULL : &si, sig); + tcp->flags &= ~TCB_DELAYED; - if (!stopped) - /* It's signal-delivery-stop. Inject the signal */ - goto restart_tracee; + struct tcb *const prev_tcp = current_tcp; + current_tcp = tcp; + bool ret = dispatch_event(wd); + current_tcp = prev_tcp; - /* It's group-stop */ - if (use_seize) { - /* - * This ends ptrace-stop, but does *not* end group-stop. - * This makes stopping signals work properly on straced process - * (that is, process really stops. It used to continue to run). - */ - if (ptrace_restart(PTRACE_LISTEN, tcp, 0) < 0) { - /* Note: ptrace_restart emitted error message */ - exit_code = 1; - return false; - } - return true; - } - /* We don't have PTRACE_LISTEN support... */ - goto restart_tracee; - } + free_trace_wait_data(tcp->delayed_wait_data); + tcp->delayed_wait_data = NULL; - /* We handled quick cases, we are permitted to interrupt now. */ - if (interrupted) - return false; + return ret; +} - /* - * This should be syscall entry or exit. - * Handle it. - */ - sig = 0; - if (trace_syscall(tcp, &sig) < 0) { - /* - * ptrace() failed in trace_syscall(). - * Likely a result of process disappearing mid-flight. - * Observed case: exit_group() or SIGKILL terminating - * all processes in thread group. - * We assume that ptrace error was caused by process death. - * We used to detach(tcp) here, but since we no longer - * implement "detach before death" policy/hack, - * we can let this process to report its death to us - * normally, via WIFEXITED or WIFSIGNALED wait status. - */ - return true; - } - goto restart_tracee; +static bool +restart_delayed_tcbs(void) +{ + struct tcb *tcp_next = NULL; + struct timespec ts_now; -restart_tracee_with_sig_0: - sig = 0; + clock_gettime(CLOCK_MONOTONIC, &ts_now); -restart_tracee: - if (ptrace_restart(PTRACE_SYSCALL, tcp, sig) < 0) { - /* Note: ptrace_restart emitted error message */ - exit_code = 1; - return false; + for (size_t i = 0; i < tcbtabsize; i++) { + struct tcb *tcp = tcbtab[i]; + + if (tcp->pid && syscall_delayed(tcp)) { + if (ts_cmp(&ts_now, &tcp->delay_expiration_time) > 0) { + if (!restart_delayed_tcb(tcp)) + return false; + } else { + /* Check whether this tcb is the next. */ + if (!tcp_next || + ts_cmp(&tcp_next->delay_expiration_time, + &tcp->delay_expiration_time) > 0) { + tcp_next = tcp; + } + } + } } + if (tcp_next) + arm_delay_timer(tcp_next); + return true; } -int -main(int argc, char *argv[]) +/* + * As this signal handler does a lot of work that is not suitable + * for signal handlers, extra care must be taken to ensure that + * it is enabled only in those places where it's safe. + */ +static void +timer_sighandler(int sig) { - init(argc, argv); + delay_timer_expired(); - exit_code = !nprocs; + if (restart_failed) + return; - while (trace()) - ; + int saved_errno = errno; + + if (!restart_delayed_tcbs()) + restart_failed = 1; + + errno = saved_errno; +} + +#ifdef ENABLE_COVERAGE_GCOV +extern void __gcov_flush(void); +#endif + +static void ATTRIBUTE_NORETURN +terminate(void) +{ + int sig = interrupted; - cleanup(); + cleanup(sig); + if (cflag) + call_summary(shared_log); fflush(NULL); if (shared_log != stderr) fclose(shared_log); @@ -2503,6 +2799,9 @@ main(int argc, char *argv[]) while (waitpid(popen_pid, NULL, 0) < 0 && errno == EINTR) ; } + if (sig) { + exit_code = 0x100 | sig; + } if (exit_code > 0xff) { /* Avoid potential core file clobbering. */ struct_rlimit rlim = {0, 0}; @@ -2511,11 +2810,36 @@ main(int argc, char *argv[]) /* Child was killed by a signal, mimic that. */ exit_code &= 0xff; signal(exit_code, SIG_DFL); +#ifdef ENABLE_COVERAGE_GCOV + __gcov_flush(); +#endif raise(exit_code); + + /* Unblock the signal. */ + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, exit_code); +#ifdef ENABLE_COVERAGE_GCOV + __gcov_flush(); +#endif + sigprocmask(SIG_UNBLOCK, &mask, NULL); + /* Paranoia - what if this signal is not fatal? Exit with 128 + signo then. */ exit_code += 128; } + exit(exit_code); +} - return exit_code; +int +main(int argc, char *argv[]) +{ + setlocale(LC_ALL, ""); + init(argc, argv); + + exit_code = !nprocs; + + while (dispatch_event(next_event())) + ; + terminate(); } diff --git a/strace.spec b/strace.spec index f134bd8d..8f8ce6b2 100644 --- a/strace.spec +++ b/strace.spec @@ -1,37 +1,40 @@ Summary: Tracks and displays system calls associated with a running process Name: strace -Version: 4.16 +Version: 5.1 Release: 1%{?dist} -License: BSD -Group: Development/Debuggers -URL: http://sourceforge.net/projects/strace/ -Source: http://downloads.sourceforge.net/strace/%{name}-%{version}.tar.xz -%if 0%{?fedora} >= 20 || 0%{?centos} >= 8 || 0%{?rhel} >= 8 || 0%{?suse_version} >= 1300 -%define buildrequires_libunwind_devel BuildRequires: libunwind-devel +# The test suite is GPLv2+, all the rest is LGPLv2.1+. +License: LGPL-2.1-or-later and GPL-2.0-or-later +# Some distros require Group tag to be present, +# some require Group tag to be absent, +# some do not care about Group tag at all, +# and we have to cater for all of them. +%if 0%{?fedora} < 28 && 0%{?centos} < 8 && 0%{?rhel} < 8 && 0%{?suse_version} < 1500 +Group: Development%{?suse_version:/Tools}/Debuggers %endif -%ifarch x86_64 -# for experimental -k option -%{?buildrequires_libunwind_devel} -%endif -%define strace64_arches ppc64 sparc64 -%{?!buildroot:BuildRoot: %_tmppath/buildroot-%name-%version-%release} +URL: https://strace.io +Source: https://strace.io/files/%{version}/strace-%{version}.tar.xz +BuildRequires: gcc gzip -%description -The strace program intercepts and records the system calls called and -received by a running process. Strace can print a record of each -system call, its arguments and its return value. Strace is useful for -diagnosing problems and debugging, as well as for instructional -purposes. +# Install Bluetooth headers for AF_BLUETOOTH sockets decoding. +%if 0%{?fedora} >= 18 || 0%{?centos} >= 8 || 0%{?rhel} >= 8 || 0%{?suse_version} >= 1200 +BuildRequires: pkgconfig(bluez) +%endif -Install strace if you need a tool to track the system calls made and -received by a process. +# Install elfutils-devel or libdw-devel to enable strace -k option. +# Install binutils-devel to enable symbol demangling. +%if 0%{?fedora} >= 20 || 0%{?centos} >= 6 || 0%{?rhel} >= 6 +%define buildrequires_stacktrace BuildRequires: elfutils-devel binutils-devel +%endif +%if 0%{?suse_version} >= 1100 +%define buildrequires_stacktrace BuildRequires: libdw-devel binutils-devel +%endif +%{?buildrequires_stacktrace} -%ifarch %{strace64_arches} -%package -n strace64 -Summary: Tracks and displays system calls associated with a running process. -Group: Development/Debuggers +# OBS compatibility +%{?!buildroot:BuildRoot: %_tmppath/buildroot-%name-%version-%release} +%define maybe_use_defattr %{?suse_version:%%defattr(-,root,root)} -%description -n strace64 +%description The strace program intercepts and records the system calls called and received by a running process. Strace can print a record of each system call, its arguments and its return value. Strace is useful for @@ -41,13 +44,11 @@ purposes. Install strace if you need a tool to track the system calls made and received by a process. -This package provides the `strace64' program to trace 64-bit processes. -The `strace' program in the `strace' package is for 32-bit processes. -%endif - %prep %setup -q echo -n %version-%release > .tarball-version +echo -n 2019 > .year +echo -n 2019-03-17 > .strace.1.in.date %build echo 'BEGIN OF BUILD ENVIRONMENT INFORMATION' @@ -56,11 +57,13 @@ libc="$(ldd /bin/sh |sed -n 's|^[^/]*\(/[^ ]*/libc\.so[^ ]*\).*|\1|p' |head -1)" $libc |head -1 file -L /bin/sh gcc --version |head -1 -kver="$(echo -e '#include \nLINUX_VERSION_CODE' | gcc -E -P -)" +ld --version |head -1 +kver="$(printf '%%s\n%%s\n' '#include ' 'LINUX_VERSION_CODE' | gcc -E -P -)" printf 'kernel-headers %%s.%%s.%%s\n' $(($kver/65536)) $(($kver/256%%256)) $(($kver%%256)) echo 'END OF BUILD ENVIRONMENT INFORMATION' -%configure +CFLAGS_FOR_BUILD="$RPM_OPT_FLAGS"; export CFLAGS_FOR_BUILD +%configure --enable-mpers=check make %{?_smp_mflags} %install @@ -69,39 +72,69 @@ make DESTDIR=%{buildroot} install # remove unpackaged files from the buildroot rm -f %{buildroot}%{_bindir}/strace-graph -%define copy64 ln -%if 0%{?rhel} -%if 0%{?rhel} < 6 -%endif -%define copy64 cp -p -%endif - -%ifarch %{strace64_arches} -%{copy64} %{buildroot}%{_bindir}/strace %{buildroot}%{_bindir}/strace64 -%endif +# some say uncompressed changelog files are too big +for f in ChangeLog ChangeLog-CVS; do + gzip -9n < "$f" > "$f".gz & +done +wait %check +%{buildroot}%{_bindir}/strace -V make %{?_smp_mflags} -k check VERBOSE=1 echo 'BEGIN OF TEST SUITE INFORMATION' tail -n 99999 -- tests*/test-suite.log tests*/ksysent.log +find tests* -type f -name '*.log' -print0 | + xargs -r0 grep -H '^KERNEL BUG:' -- ||: echo 'END OF TEST SUITE INFORMATION' %files -%{?suse_version:%defattr(-,root,root)} -%doc CREDITS ChangeLog ChangeLog-CVS COPYING NEWS README +%maybe_use_defattr +%doc CREDITS ChangeLog.gz ChangeLog-CVS.gz COPYING NEWS README %{_bindir}/strace %{_bindir}/strace-log-merge %{_mandir}/man1/* -%ifarch %{strace64_arches} -%files -n strace64 -%{?suse_version:%defattr(-,root,root)} -%{_bindir}/strace64 -%endif - %changelog -* Tue Feb 14 2017 strace-devel@lists.sourceforge.net - 4.16-1 -- strace 4.16 snapshot. +* Wed May 22 2019 strace-devel@lists.strace.io - 5.1-1 +- strace 5.1 snapshot. + +* Tue Mar 19 2019 Dmitry V. Levin - 5.0-1 +- v4.26 -> v5.0 (resolves: #478419, #526740, #851457, #1609318, + #1610774, #1662936, #1676045). + +* Wed Dec 26 2018 Dmitry V. Levin - 4.26-1 +- v4.25 -> v4.26. + +* Tue Oct 30 2018 Dmitry V. Levin - 4.25-1 +- v4.24 -> v4.25. + +* Tue Aug 14 2018 Dmitry V. Levin - 4.24-1 +- v4.23 -> v4.24. + +* Thu Jun 14 2018 Dmitry V. Levin - 4.23-1 +- v4.22 -> v4.23. +- Enabled libdw backend for -k option (#1568647). + +* Thu Apr 05 2018 Dmitry V. Levin - 4.22-1 +- v4.21 -> v4.22. + +* Tue Feb 13 2018 Dmitry V. Levin - 4.21-1 +- v4.20 -> v4.21. + +* Mon Nov 13 2017 Dmitry V. Levin - 4.20-1 +- v4.19 -> v4.20. + +* Tue Sep 05 2017 Dmitry V. Levin - 4.19-1 +- v4.18 -> v4.19. + +* Wed Jul 05 2017 Dmitry V. Levin - 4.18-1 +- v4.17 -> v4.18. + +* Wed May 24 2017 Dmitry V. Levin - 4.17-1 +- v4.16 -> v4.17. + +* Tue Feb 14 2017 Dmitry V. Levin - 4.16-1 +- v4.15 -> v4.16. * Wed Dec 14 2016 Dmitry V. Levin - 4.15-1 - v4.14-100-g622af42 -> v4.15. diff --git a/strace.spec.in b/strace.spec.in index b9451787..9a12658f 100644 --- a/strace.spec.in +++ b/strace.spec.in @@ -2,36 +2,39 @@ Summary: Tracks and displays system calls associated with a running process Name: strace Version: @PACKAGE_VERSION@ Release: 1%{?dist} -License: BSD -Group: Development/Debuggers -URL: http://sourceforge.net/projects/strace/ -Source: http://downloads.sourceforge.net/strace/%{name}-%{version}.tar.xz -%if 0%{?fedora} >= 20 || 0%{?centos} >= 8 || 0%{?rhel} >= 8 || 0%{?suse_version} >= 1300 -%define buildrequires_libunwind_devel BuildRequires: libunwind-devel +# The test suite is GPLv2+, all the rest is LGPLv2.1+. +License: LGPL-2.1-or-later and GPL-2.0-or-later +# Some distros require Group tag to be present, +# some require Group tag to be absent, +# some do not care about Group tag at all, +# and we have to cater for all of them. +%if 0%{?fedora} < 28 && 0%{?centos} < 8 && 0%{?rhel} < 8 && 0%{?suse_version} < 1500 +Group: Development%{?suse_version:/Tools}/Debuggers %endif -%ifarch x86_64 -# for experimental -k option -%{?buildrequires_libunwind_devel} -%endif -%define strace64_arches ppc64 sparc64 -%{?!buildroot:BuildRoot: %_tmppath/buildroot-%name-%version-%release} +URL: https://strace.io +Source: https://strace.io/files/%{version}/strace-%{version}.tar.xz +BuildRequires: gcc gzip -%description -The strace program intercepts and records the system calls called and -received by a running process. Strace can print a record of each -system call, its arguments and its return value. Strace is useful for -diagnosing problems and debugging, as well as for instructional -purposes. +# Install Bluetooth headers for AF_BLUETOOTH sockets decoding. +%if 0%{?fedora} >= 18 || 0%{?centos} >= 8 || 0%{?rhel} >= 8 || 0%{?suse_version} >= 1200 +BuildRequires: pkgconfig(bluez) +%endif -Install strace if you need a tool to track the system calls made and -received by a process. +# Install elfutils-devel or libdw-devel to enable strace -k option. +# Install binutils-devel to enable symbol demangling. +%if 0%{?fedora} >= 20 || 0%{?centos} >= 6 || 0%{?rhel} >= 6 +%define buildrequires_stacktrace BuildRequires: elfutils-devel binutils-devel +%endif +%if 0%{?suse_version} >= 1100 +%define buildrequires_stacktrace BuildRequires: libdw-devel binutils-devel +%endif +%{?buildrequires_stacktrace} -%ifarch %{strace64_arches} -%package -n strace64 -Summary: Tracks and displays system calls associated with a running process. -Group: Development/Debuggers +# OBS compatibility +%{?!buildroot:BuildRoot: %_tmppath/buildroot-%name-%version-%release} +%define maybe_use_defattr %{?suse_version:%%defattr(-,root,root)} -%description -n strace64 +%description The strace program intercepts and records the system calls called and received by a running process. Strace can print a record of each system call, its arguments and its return value. Strace is useful for @@ -41,13 +44,11 @@ purposes. Install strace if you need a tool to track the system calls made and received by a process. -This package provides the `strace64' program to trace 64-bit processes. -The `strace' program in the `strace' package is for 32-bit processes. -%endif - %prep %setup -q echo -n %version-%release > .tarball-version +echo -n @COPYRIGHT_YEAR@ > .year +echo -n @MANPAGE_DATE@ > .strace.1.in.date %build echo 'BEGIN OF BUILD ENVIRONMENT INFORMATION' @@ -56,11 +57,13 @@ libc="$(ldd /bin/sh |sed -n 's|^[^/]*\(/[^ ]*/libc\.so[^ ]*\).*|\1|p' |head -1)" $libc |head -1 file -L /bin/sh gcc --version |head -1 -kver="$(echo -e '#include \nLINUX_VERSION_CODE' | gcc -E -P -)" +ld --version |head -1 +kver="$(printf '%%s\n%%s\n' '#include ' 'LINUX_VERSION_CODE' | gcc -E -P -)" printf 'kernel-headers %%s.%%s.%%s\n' $(($kver/65536)) $(($kver/256%%256)) $(($kver%%256)) echo 'END OF BUILD ENVIRONMENT INFORMATION' -%configure +CFLAGS_FOR_BUILD="$RPM_OPT_FLAGS"; export CFLAGS_FOR_BUILD +%configure --enable-mpers=check make %{?_smp_mflags} %install @@ -69,40 +72,70 @@ make DESTDIR=%{buildroot} install # remove unpackaged files from the buildroot rm -f %{buildroot}%{_bindir}/strace-graph -%define copy64 ln -%if 0%{?rhel} -%if 0%{?rhel} < 6 -%endif -%define copy64 cp -p -%endif - -%ifarch %{strace64_arches} -%{copy64} %{buildroot}%{_bindir}/strace %{buildroot}%{_bindir}/strace64 -%endif +# some say uncompressed changelog files are too big +for f in ChangeLog ChangeLog-CVS; do + gzip -9n < "$f" > "$f".gz & +done +wait %check +%{buildroot}%{_bindir}/strace -V make %{?_smp_mflags} -k check VERBOSE=1 echo 'BEGIN OF TEST SUITE INFORMATION' tail -n 99999 -- tests*/test-suite.log tests*/ksysent.log +find tests* -type f -name '*.log' -print0 | + xargs -r0 grep -H '^KERNEL BUG:' -- ||: echo 'END OF TEST SUITE INFORMATION' %files -%{?suse_version:%defattr(-,root,root)} -%doc CREDITS ChangeLog ChangeLog-CVS COPYING NEWS README +%maybe_use_defattr +%doc CREDITS ChangeLog.gz ChangeLog-CVS.gz COPYING NEWS README %{_bindir}/strace %{_bindir}/strace-log-merge %{_mandir}/man1/* -%ifarch %{strace64_arches} -%files -n strace64 -%{?suse_version:%defattr(-,root,root)} -%{_bindir}/strace64 -%endif - %changelog * @RPM_CHANGELOGTIME@ @PACKAGE_BUGREPORT@ - @PACKAGE_VERSION@-1 - @PACKAGE_STRING@ snapshot. +* Tue Mar 19 2019 Dmitry V. Levin - 5.0-1 +- v4.26 -> v5.0 (resolves: #478419, #526740, #851457, #1609318, + #1610774, #1662936, #1676045). + +* Wed Dec 26 2018 Dmitry V. Levin - 4.26-1 +- v4.25 -> v4.26. + +* Tue Oct 30 2018 Dmitry V. Levin - 4.25-1 +- v4.24 -> v4.25. + +* Tue Aug 14 2018 Dmitry V. Levin - 4.24-1 +- v4.23 -> v4.24. + +* Thu Jun 14 2018 Dmitry V. Levin - 4.23-1 +- v4.22 -> v4.23. +- Enabled libdw backend for -k option (#1568647). + +* Thu Apr 05 2018 Dmitry V. Levin - 4.22-1 +- v4.21 -> v4.22. + +* Tue Feb 13 2018 Dmitry V. Levin - 4.21-1 +- v4.20 -> v4.21. + +* Mon Nov 13 2017 Dmitry V. Levin - 4.20-1 +- v4.19 -> v4.20. + +* Tue Sep 05 2017 Dmitry V. Levin - 4.19-1 +- v4.18 -> v4.19. + +* Wed Jul 05 2017 Dmitry V. Levin - 4.18-1 +- v4.17 -> v4.18. + +* Wed May 24 2017 Dmitry V. Levin - 4.17-1 +- v4.16 -> v4.17. + +* Tue Feb 14 2017 Dmitry V. Levin - 4.16-1 +- v4.15 -> v4.16. + * Wed Dec 14 2016 Dmitry V. Levin - 4.15-1 - v4.14-100-g622af42 -> v4.15. diff --git a/string_to_uint.c b/string_to_uint.c new file mode 100644 index 00000000..6300f9bc --- /dev/null +++ b/string_to_uint.c @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2001-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include +#include + +#include "string_to_uint.h" + +long long +string_to_uint_ex(const char *const str, char **const endptr, + const unsigned long long max_val, + const char *const accepted_ending) +{ + char *end; + long long val; + + if (!*str) + return -1; + + errno = 0; + val = strtoll(str, &end, 10); + + if (str == end || val < 0 || (unsigned long long) val > max_val + || (val == LLONG_MAX && errno == ERANGE)) + return -1; + + if (*end && (!accepted_ending || !strchr(accepted_ending, *end))) + return -1; + + if (endptr) + *endptr = end; + + return val; +} diff --git a/string_to_uint.h b/string_to_uint.h new file mode 100644 index 00000000..3eb9c8e7 --- /dev/null +++ b/string_to_uint.h @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2001-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_STRING_TO_UINT_H +# define STRACE_STRING_TO_UINT_H + +# include + +# include "kernel_types.h" + +extern long long +string_to_uint_ex(const char *str, char **endptr, + unsigned long long max_val, const char *accepted_ending); + +static inline long long +string_to_uint_upto(const char *const str, const unsigned long long max_val) +{ + return string_to_uint_ex(str, NULL, max_val, NULL); +} + +static inline int +string_to_uint(const char *str) +{ + return string_to_uint_upto(str, INT_MAX); +} + +static inline long +string_to_ulong(const char *str) +{ + return string_to_uint_upto(str, LONG_MAX); +} + +static inline kernel_long_t +string_to_kulong(const char *str) +{ + return string_to_uint_upto(str, ((kernel_ulong_t) -1ULL) >> 1); +} + +static inline long long +string_to_ulonglong(const char *str) +{ + return string_to_uint_upto(str, LLONG_MAX); +} + +#endif /* !STRACE_STRING_TO_UINT_H */ diff --git a/swapon.c b/swapon.c index e5ebd0fa..87fd3c1f 100644 --- a/swapon.c +++ b/swapon.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" #include diff --git a/sync_file_range.c b/sync_file_range.c index 855e8af3..f4d15d5e 100644 --- a/sync_file_range.c +++ b/sync_file_range.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2013 William Manley * Copyright (c) 2014-2015 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/sync_file_range2.c b/sync_file_range2.c index a1ef091b..e249cb10 100644 --- a/sync_file_range2.c +++ b/sync_file_range2.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2013 William Manley * Copyright (c) 2014-2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/syscall.c b/syscall.c index c0407ed5..bae7343c 100644 --- a/syscall.c +++ b/syscall.c @@ -6,35 +6,23 @@ * Copyright (c) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation * Linux for s390 port by D.J. Barrow * + * Copyright (c) 1999-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" +#include "get_personality.h" +#include "mmap_notify.h" #include "native_defs.h" +#include "ptrace.h" +#include "ptrace_syscall_info.h" #include "nsig.h" -#include +#include "number_set.h" +#include "delay.h" +#include "retval.h" +#include /* for struct iovec */ #include @@ -43,7 +31,6 @@ #include #include "regs.h" -#include "ptrace.h" #if defined(SPARC64) # undef PTRACE_GETREGS @@ -52,35 +39,11 @@ # define PTRACE_SETREGS PTRACE_SETREGS64 #endif -#if defined SPARC64 -# include -#elif defined SPARC -# include -#endif - -#ifdef IA64 -# include -#endif - -#ifndef NT_PRSTATUS -# define NT_PRSTATUS 1 -#endif - #include "syscall.h" +#include "xstring.h" /* Define these shorthand notations to simplify the syscallent files. */ -#define TD TRACE_DESC -#define TF TRACE_FILE -#define TI TRACE_IPC -#define TN TRACE_NETWORK -#define TP TRACE_PROCESS -#define TS TRACE_SIGNAL -#define TM TRACE_MEMORY -#define NF SYSCALL_NEVER_FAILS -#define MA MAX_ARGS -#define SI STACKTRACE_INVALIDATE_CACHE -#define SE STACKTRACE_CAPTURE_ON_ENTER -#define CST COMPAT_SYSCALL_TYPES +#include "sysent_shorthand_defs.h" #define SEN(syscall_name) SEN_ ## syscall_name, SYS_FUNC_NAME(sys_ ## syscall_name) @@ -103,20 +66,15 @@ static const struct_sysent sysent2[] = { #endif /* Now undef them since short defines cause wicked namespace pollution. */ -#undef SEN -#undef TD -#undef TF -#undef TI -#undef TN -#undef TP -#undef TS -#undef TM -#undef NF -#undef MA -#undef SI -#undef SE -#undef CST +#include "sysent_shorthand_undefs.h" + +const char *const errnoent[] = { +#include "errnoent.h" +}; +const char *const signalent[] = { +#include "signalent.h" +}; /* * `ioctlent[012].h' files are automatically generated by the auxiliary * program `ioctlsort', such that the list is sorted by the `code' field. @@ -125,23 +83,11 @@ static const struct_sysent sysent2[] = { * in "/usr/include". */ -const char *const errnoent0[] = { -#include "errnoent.h" -}; -const char *const signalent0[] = { -#include "signalent.h" -}; const struct_ioctlent ioctlent0[] = { #include "ioctlent0.h" }; #if SUPPORTED_PERSONALITIES > 1 -static const char *const errnoent1[] = { -# include "errnoent1.h" -}; -static const char *const signalent1[] = { -# include "signalent1.h" -}; static const struct_ioctlent ioctlent1[] = { # include "ioctlent1.h" }; @@ -156,12 +102,6 @@ static const struct_printers printers1 = { #endif #if SUPPORTED_PERSONALITIES > 2 -static const char *const errnoent2[] = { -# include "errnoent2.h" -}; -static const char *const signalent2[] = { -# include "signalent2.h" -}; static const struct_ioctlent ioctlent2[] = { # include "ioctlent2.h" }; @@ -181,26 +121,6 @@ enum { #endif }; -enum { - nerrnos0 = ARRAY_SIZE(errnoent0) -#if SUPPORTED_PERSONALITIES > 1 - , nerrnos1 = ARRAY_SIZE(errnoent1) -# if SUPPORTED_PERSONALITIES > 2 - , nerrnos2 = ARRAY_SIZE(errnoent2) -# endif -#endif -}; - -enum { - nsignals0 = ARRAY_SIZE(signalent0) -#if SUPPORTED_PERSONALITIES > 1 - , nsignals1 = ARRAY_SIZE(signalent1) -# if SUPPORTED_PERSONALITIES > 2 - , nsignals2 = ARRAY_SIZE(signalent2) -# endif -#endif -}; - enum { nioctlents0 = ARRAY_SIZE(ioctlent0) #if SUPPORTED_PERSONALITIES > 1 @@ -213,15 +133,13 @@ enum { #if SUPPORTED_PERSONALITIES > 1 const struct_sysent *sysent = sysent0; -const char *const *errnoent = errnoent0; -const char *const *signalent = signalent0; const struct_ioctlent *ioctlent = ioctlent0; const struct_printers *printers = &printers0; #endif +const unsigned int nerrnos = ARRAY_SIZE(errnoent); +const unsigned int nsignals = ARRAY_SIZE(signalent); unsigned nsyscalls = nsyscalls0; -unsigned nerrnos = nerrnos0; -unsigned nsignals = nsignals0; unsigned nioctlents = nioctlents0; const unsigned int nsyscall_vec[SUPPORTED_PERSONALITIES] = { @@ -243,22 +161,47 @@ const struct_sysent *const sysent_vec[SUPPORTED_PERSONALITIES] = { #endif }; +const char *const personality_names[] = +#if defined X86_64 + {"64 bit", "32 bit", "x32"} +#elif defined X32 + {"x32", "32 bit"} +#elif SUPPORTED_PERSONALITIES == 2 + {"64 bit", "32 bit"} +#else + {STRINGIFY_VAL(__WORDSIZE) " bit"} +#endif + ; + +const char *const personality_designators[] = +#if defined X86_64 + { "64", "32", "x32" } +#elif defined X32 + { "x32", "32" } +#elif SUPPORTED_PERSONALITIES == 2 + { "64", "32" } +#else + { STRINGIFY_VAL(__WORDSIZE) } +#endif + ; + #if SUPPORTED_PERSONALITIES > 1 + unsigned current_personality; # ifndef current_wordsize -unsigned current_wordsize; +unsigned current_wordsize = PERSONALITY0_WORDSIZE; static const int personality_wordsize[SUPPORTED_PERSONALITIES] = { PERSONALITY0_WORDSIZE, PERSONALITY1_WORDSIZE, -# if SUPPORTED_PERSONALITIES > 2 +# if SUPPORTED_PERSONALITIES > 2 PERSONALITY2_WORDSIZE, -# endif +# endif }; # endif # ifndef current_klongsize -unsigned current_klongsize; +unsigned current_klongsize = PERSONALITY0_KLONGSIZE; static const int personality_klongsize[SUPPORTED_PERSONALITIES] = { PERSONALITY0_KLONGSIZE, PERSONALITY1_KLONGSIZE, @@ -269,40 +212,35 @@ static const int personality_klongsize[SUPPORTED_PERSONALITIES] = { # endif void -set_personality(int personality) +set_personality(unsigned int personality) { + if (personality == current_personality) + return; + + if (personality >= SUPPORTED_PERSONALITIES) + error_msg_and_die("Requested switch to unsupported personality " + "%u", personality); + nsyscalls = nsyscall_vec[personality]; sysent = sysent_vec[personality]; switch (personality) { case 0: - errnoent = errnoent0; - nerrnos = nerrnos0; ioctlent = ioctlent0; nioctlents = nioctlents0; - signalent = signalent0; - nsignals = nsignals0; printers = &printers0; break; case 1: - errnoent = errnoent1; - nerrnos = nerrnos1; ioctlent = ioctlent1; nioctlents = nioctlents1; - signalent = signalent1; - nsignals = nsignals1; printers = &printers1; break; # if SUPPORTED_PERSONALITIES > 2 case 2: - errnoent = errnoent2; - nerrnos = nerrnos2; ioctlent = ioctlent2; nioctlents = nioctlents2; - signalent = signalent2; - nsignals = nsignals2; printers = &printers2; break; # endif @@ -320,33 +258,26 @@ set_personality(int personality) static void update_personality(struct tcb *tcp, unsigned int personality) { - if (personality == current_personality) - return; + static bool need_mpers_warning[] = + { false, !HAVE_PERSONALITY_1_MPERS, !HAVE_PERSONALITY_2_MPERS }; + set_personality(personality); if (personality == tcp->currpers) return; tcp->currpers = personality; -# undef PERSONALITY_NAMES -# if defined POWERPC64 -# define PERSONALITY_NAMES {"64 bit", "32 bit"} -# elif defined X86_64 -# define PERSONALITY_NAMES {"64 bit", "32 bit", "x32"} -# elif defined X32 -# define PERSONALITY_NAMES {"x32", "32 bit"} -# elif defined AARCH64 -# define PERSONALITY_NAMES {"64 bit", "32 bit"} -# elif defined TILE -# define PERSONALITY_NAMES {"64-bit", "32-bit"} -# endif -# ifdef PERSONALITY_NAMES if (!qflag) { - static const char *const names[] = PERSONALITY_NAMES; error_msg("[ Process PID=%d runs in %s mode. ]", - tcp->pid, names[personality]); + tcp->pid, personality_names[personality]); + } + + if (need_mpers_warning[personality]) { + error_msg("WARNING: Proper structure decoding for this " + "personality is not supported, please consider " + "building strace with mpers support enabled."); + need_mpers_warning[personality] = false; } -# endif } #endif @@ -375,7 +306,7 @@ decode_socket_subcall(struct tcb *tcp) tcp->u_arg[i] = (sizeof(uint32_t) == current_wordsize) ? ((uint32_t *) (void *) buf)[i] : buf[i]; } -#endif +#endif /* SYS_socket_subcall */ #ifdef SYS_ipc_subcall static void @@ -410,79 +341,33 @@ decode_ipc_subcall(struct tcb *tcp) tcp->qual_flg = qual_flags(tcp->scno); tcp->s_ent = &sysent[tcp->scno]; - const unsigned int n = tcp->s_ent->nargs; + const unsigned int n = n_args(tcp); unsigned int i; for (i = 0; i < n; i++) tcp->u_arg[i] = tcp->u_arg[i + 1]; } -#endif +#endif /* SYS_ipc_subcall */ -#ifdef LINUX_MIPSO32 -static void -decode_mips_subcall(struct tcb *tcp) -{ - if (!scno_is_valid(tcp->u_arg[0])) - return; - tcp->scno = tcp->u_arg[0]; - tcp->qual_flg = qual_flags(tcp->scno); - tcp->s_ent = &sysent[tcp->scno]; - memmove(&tcp->u_arg[0], &tcp->u_arg[1], - sizeof(tcp->u_arg) - sizeof(tcp->u_arg[0])); - /* - * Fetching the last arg of 7-arg syscalls (fadvise64_64 - * and sync_file_range) requires additional code, - * see linux/mips/get_syscall_args.c - */ - if (tcp->s_ent->nargs == MAX_ARGS) { - if (umoven(tcp, - mips_REG_SP + MAX_ARGS * sizeof(tcp->u_arg[0]), - sizeof(tcp->u_arg[0]), - &tcp->u_arg[MAX_ARGS - 1]) < 0) - tcp->u_arg[MAX_ARGS - 1] = 0; - } -} -#endif /* LINUX_MIPSO32 */ +#ifdef SYS_syscall_subcall +/* The implementation is architecture specific. */ +static void decode_syscall_subcall(struct tcb *); +#endif /* SYS_syscall_subcall */ static void dumpio(struct tcb *tcp) { - if (syserror(tcp)) - return; - int fd = tcp->u_arg[0]; if (fd < 0) return; - if (is_number_in_set(fd, &read_set)) { - switch (tcp->s_ent->sen) { - case SEN_read: - case SEN_pread: - case SEN_recv: - case SEN_recvfrom: - case SEN_mq_timedreceive: - dumpstr(tcp, tcp->u_arg[1], tcp->u_rval); - return; - case SEN_readv: - case SEN_preadv: - case SEN_preadv2: - dumpiov_upto(tcp, tcp->u_arg[2], tcp->u_arg[1], - tcp->u_rval); - return; - case SEN_recvmsg: - dumpiov_in_msghdr(tcp, tcp->u_arg[1], tcp->u_rval); - return; - case SEN_recvmmsg: - dumpiov_in_mmsghdr(tcp, tcp->u_arg[1]); - return; - } - } - if (is_number_in_set(fd, &write_set)) { - switch (tcp->s_ent->sen) { + if (is_number_in_set(fd, write_set)) { + switch (tcp_sysent(tcp)->sen) { case SEN_write: case SEN_pwrite: case SEN_send: case SEN_sendto: - case SEN_mq_timedsend: + case SEN_mq_timedsend_time32: + case SEN_mq_timedsend_time64: dumpstr(tcp, tcp->u_arg[1], tcp->u_arg[2]); break; case SEN_writev: @@ -499,41 +384,36 @@ dumpio(struct tcb *tcp) break; } } -} - -/* - * Shuffle syscall numbers so that we don't have huge gaps in syscall table. - * The shuffling should be an involution: shuffle_scno(shuffle_scno(n)) == n. - */ -static kernel_ulong_t -shuffle_scno(kernel_ulong_t scno) -{ -#if defined(ARM) || defined(AARCH64) /* So far only 32-bit ARM needs this */ - if (scno < ARM_FIRST_SHUFFLED_SYSCALL) - return scno; - /* __ARM_NR_cmpxchg? Swap with LAST_ORDINARY+1 */ - if (scno == ARM_FIRST_SHUFFLED_SYSCALL) - return 0x000ffff0; - if (scno == 0x000ffff0) - return ARM_FIRST_SHUFFLED_SYSCALL; + if (syserror(tcp)) + return; -# define ARM_SECOND_SHUFFLED_SYSCALL (ARM_FIRST_SHUFFLED_SYSCALL + 1) - /* - * Is it ARM specific syscall? - * Swap [0x000f0000, 0x000f0000 + LAST_SPECIAL] range - * with [SECOND_SHUFFLED, SECOND_SHUFFLED + LAST_SPECIAL] range. - */ - if (scno >= 0x000f0000 && - scno <= 0x000f0000 + ARM_LAST_SPECIAL_SYSCALL) { - return scno - 0x000f0000 + ARM_SECOND_SHUFFLED_SYSCALL; - } - if (scno <= ARM_SECOND_SHUFFLED_SYSCALL + ARM_LAST_SPECIAL_SYSCALL) { - return scno + 0x000f0000 - ARM_SECOND_SHUFFLED_SYSCALL; + if (is_number_in_set(fd, read_set)) { + switch (tcp_sysent(tcp)->sen) { + case SEN_read: + case SEN_pread: + case SEN_recv: + case SEN_recvfrom: + case SEN_mq_timedreceive_time32: + case SEN_mq_timedreceive_time64: + dumpstr(tcp, tcp->u_arg[1], tcp->u_rval); + return; + case SEN_readv: + case SEN_preadv: + case SEN_preadv2: + dumpiov_upto(tcp, tcp->u_arg[2], tcp->u_arg[1], + tcp->u_rval); + return; + case SEN_recvmsg: + dumpiov_in_msghdr(tcp, tcp->u_arg[1], tcp->u_rval); + return; + case SEN_recvmmsg: + case SEN_recvmmsg_time32: + case SEN_recvmmsg_time64: + dumpiov_in_mmsghdr(tcp, tcp->u_arg[1]); + return; + } } -#endif /* ARM || AARCH64 */ - - return scno; } const char * @@ -545,21 +425,34 @@ err_name(unsigned long err) return NULL; } -static long get_regs_error; - -void -clear_regs(void) +static void +print_err_ret(kernel_ulong_t ret, unsigned long u_error) { - get_regs_error = -1; + const char *u_error_str = err_name(u_error); + + if (u_error_str) + tprintf("= %" PRI_kld " %s (%s)", + ret, u_error_str, strerror(u_error)); + else + tprintf("= %" PRI_kld " (errno %lu)", ret, u_error); } +static long get_regs(struct tcb *); static int get_syscall_args(struct tcb *); static int get_syscall_result(struct tcb *); -static int arch_get_scno(struct tcb *tcp); +static void get_error(struct tcb *, bool); +static void set_error(struct tcb *, unsigned long); +static void set_success(struct tcb *, kernel_long_t); +static int arch_get_scno(struct tcb *); +static int arch_check_scno(struct tcb *); static int arch_set_scno(struct tcb *, kernel_ulong_t); -static void get_error(struct tcb *, const bool); +static int arch_get_syscall_args(struct tcb *); +static void arch_get_error(struct tcb *, bool); static int arch_set_error(struct tcb *); static int arch_set_success(struct tcb *); +#if MAX_ARGS > 6 +static void arch_get_syscall_args_extra(struct tcb *, unsigned int); +#endif struct inject_opts *inject_vec[SUPPORTED_PERSONALITIES]; @@ -594,10 +487,40 @@ tamper_with_syscall_entering(struct tcb *tcp, unsigned int *signo) opts->first = opts->step; - if (opts->signo > 0) - *signo = opts->signo; - if (opts->rval != INJECT_OPTS_RVAL_DEFAULT && !arch_set_scno(tcp, -1)) - tcp->flags |= TCB_TAMPERED; + if (!recovering(tcp)) { + if (opts->data.flags & INJECT_F_SIGNAL) + *signo = opts->data.signo; + if (opts->data.flags & (INJECT_F_ERROR | INJECT_F_RETVAL)) { + kernel_long_t scno = + (opts->data.flags & INJECT_F_SYSCALL) + ? (kernel_long_t) shuffle_scno(opts->data.scno) + : -1; + + if (!arch_set_scno(tcp, scno)) { + tcp->flags |= TCB_TAMPERED; + if (scno != -1) + tcp->flags |= TCB_TAMPERED_NO_FAIL; +#if ARCH_NEEDS_SET_ERROR_FOR_SCNO_TAMPERING + /* + * So far it's just a workaround for hppa, + * but let's pretend it could be used elsewhere. + */ + else { + kernel_long_t rval = + (opts->data.flags & INJECT_F_RETVAL) ? + ENOSYS : retval_get(opts->data.rval_idx); + + tcp->u_error = 0; /* force reset */ + set_error(tcp, rval); + } +#endif + } + } + if (opts->data.flags & INJECT_F_DELAY_ENTER) + delay_tcb(tcp, opts->data.delay_idx, true); + if (opts->data.flags & INJECT_F_DELAY_EXIT) + tcp->flags |= TCB_INJECT_DELAY_EXIT; + } return 0; } @@ -606,181 +529,186 @@ static long tamper_with_syscall_exiting(struct tcb *tcp) { struct inject_opts *opts = tcb_inject_opts(tcp); - if (!opts) return 0; - if (opts->rval >= 0) { - kernel_long_t u_rval = tcp->u_rval; + if (inject_delay_exit(tcp)) + delay_tcb(tcp, opts->data.delay_idx, false); - tcp->u_rval = opts->rval; - if (arch_set_success(tcp)) { - tcp->u_rval = u_rval; - } else { - tcp->u_error = 0; - } - } else { - unsigned long new_error = -opts->rval; + if (!syscall_tampered(tcp)) + return 0; - if (new_error != tcp->u_error && new_error <= MAX_ERRNO_VALUE) { - unsigned long u_error = tcp->u_error; + if (!syserror(tcp) ^ !!syscall_tampered_nofail(tcp)) { + error_msg("Failed to tamper with process %d: unexpectedly got" + " %serror (return value %#" PRI_klx ", error %lu)", + tcp->pid, syscall_tampered_nofail(tcp) ? "" : "no ", + tcp->u_rval, tcp->u_error); - tcp->u_error = new_error; - if (arch_set_error(tcp)) { - tcp->u_error = u_error; - } - } + return 1; } + if (opts->data.flags & INJECT_F_RETVAL) + set_success(tcp, retval_get(opts->data.rval_idx)); + else + set_error(tcp, retval_get(opts->data.rval_idx)); + return 0; } -static int -trace_syscall_entering(struct tcb *tcp, unsigned int *sig) +/* + * Returns: + * 0: "ignore this ptrace stop", bail out silently. + * 1: ok, decoded; call + * syscall_entering_finish(tcp, syscall_entering_trace(tcp, ...)). + * other: error; call syscall_entering_finish(tcp, res), where res is the value + * returned. + */ +int +syscall_entering_decode(struct tcb *tcp) { - int res, scno_good; - - scno_good = res = get_scno(tcp); + int res = get_scno(tcp); if (res == 0) return res; - if (res == 1) - res = get_syscall_args(tcp); - - if (res != 1) { + if (res != 1 || (res = get_syscall_args(tcp)) != 1) { printleader(tcp); - tprintf("%s(", scno_good == 1 ? tcp->s_ent->sys_name : "????"); + tprintf("%s(", tcp_sysent(tcp)->sys_name); /* * " " will be added later by the code which * detects ptrace errors. */ - goto ret; + return res; } -#ifdef LINUX_MIPSO32 - if (SEN_syscall == tcp->s_ent->sen) - decode_mips_subcall(tcp); -#endif - -#if defined(SYS_socket_subcall) || defined(SYS_ipc_subcall) - switch (tcp->s_ent->sen) { +#if defined SYS_ipc_subcall \ + || defined SYS_socket_subcall \ + || defined SYS_syscall_subcall + for (;;) { + switch (tcp_sysent(tcp)->sen) { +# ifdef SYS_ipc_subcall + case SEN_ipc: + decode_ipc_subcall(tcp); + break; +# endif # ifdef SYS_socket_subcall case SEN_socketcall: decode_socket_subcall(tcp); break; # endif -# ifdef SYS_ipc_subcall - case SEN_ipc: - decode_ipc_subcall(tcp); +# ifdef SYS_syscall_subcall + case SEN_syscall: + decode_syscall_subcall(tcp); + if (tcp_sysent(tcp)->sen != SEN_syscall) + continue; break; # endif + } + break; } #endif - /* Restrain from fault injection while the trace executes strace code. */ + return 1; +} + +int +syscall_entering_trace(struct tcb *tcp, unsigned int *sig) +{ if (hide_log(tcp)) { + /* + * Restrain from fault injection + * while the trace executes strace code. + */ tcp->qual_flg &= ~QUAL_INJECT; - } - switch (tcp->s_ent->sen) { - case SEN_execve: - case SEN_execveat: -#if defined SPARC || defined SPARC64 - case SEN_execv: -#endif - tcp->flags &= ~TCB_HIDE_LOG; - break; + switch (tcp_sysent(tcp)->sen) { + case SEN_execve: + case SEN_execveat: + case SEN_execv: + /* + * First exec* syscall makes the log visible. + */ + tcp->flags &= ~TCB_HIDE_LOG; + /* + * Check whether this exec* syscall succeeds. + */ + tcp->flags |= TCB_CHECK_EXEC_SYSCALL; + break; + } } - if (!(tcp->qual_flg & QUAL_TRACE) - || (tracing_paths && !pathtrace_match(tcp)) - ) { - tcp->flags |= TCB_INSYSCALL | TCB_FILTERED; - tcp->sys_func_rval = 0; + if (hide_log(tcp) || !traced(tcp) || (tracing_paths && !pathtrace_match(tcp))) { + tcp->flags |= TCB_FILTERED; return 0; } tcp->flags &= ~TCB_FILTERED; - if (hide_log(tcp)) { - res = 0; - goto ret; - } - - if (tcp->qual_flg & QUAL_INJECT) + if (inject(tcp)) tamper_with_syscall_entering(tcp, sig); if (cflag == CFLAG_ONLY_STATS) { - res = 0; - goto ret; + return 0; } -#ifdef USE_LIBUNWIND +#ifdef ENABLE_STACKTRACE if (stack_trace_enabled) { - if (tcp->s_ent->sys_flags & STACKTRACE_CAPTURE_ON_ENTER) - unwind_capture_stacktrace(tcp); + if (tcp_sysent(tcp)->sys_flags & STACKTRACE_CAPTURE_ON_ENTER) + unwind_tcb_capture(tcp); } #endif printleader(tcp); - tprintf("%s(", tcp->s_ent->sys_name); - if (tcp->qual_flg & QUAL_RAW) - res = printargs(tcp); - else - res = tcp->s_ent->sys_func(tcp); - + tprintf("%s(", tcp_sysent(tcp)->sys_name); + int res = raw(tcp) ? printargs(tcp) : tcp_sysent(tcp)->sys_func(tcp); fflush(tcp->outf); - ret: - tcp->flags |= TCB_INSYSCALL; - tcp->sys_func_rval = res; - /* Measure the entrance time as late as possible to avoid errors. */ - if (Tflag || cflag) - gettimeofday(&tcp->etime, NULL); return res; } -static bool -syscall_tampered(struct tcb *tcp) +void +syscall_entering_finish(struct tcb *tcp, int res) { - return tcp->flags & TCB_TAMPERED; + tcp->flags |= TCB_INSYSCALL; + tcp->sys_func_rval = res; + /* Measure the entrance time as late as possible to avoid errors. */ + if ((Tflag || cflag) && !filtered(tcp)) + clock_gettime(CLOCK_MONOTONIC, &tcp->etime); } -static int -trace_syscall_exiting(struct tcb *tcp) +/* Returns: + * 0: "bail out". + * 1: ok. + * -1: error in one of ptrace ops. + * + * If not 0, call syscall_exiting_trace(tcp, res), where res is the return + * value. Anyway, call syscall_exiting_finish(tcp) then. + */ +int +syscall_exiting_decode(struct tcb *tcp, struct timespec *pts) { - int sys_res; - struct timeval tv; - int res; - unsigned long u_error; - const char *u_error_str; - /* Measure the exit time as early as possible to avoid errors. */ - if (Tflag || cflag) - gettimeofday(&tv, NULL); + if ((Tflag || cflag) && !filtered(tcp)) + clock_gettime(CLOCK_MONOTONIC, pts); -#ifdef USE_LIBUNWIND - if (stack_trace_enabled) { - if (tcp->s_ent->sys_flags & STACKTRACE_INVALIDATE_CACHE) - unwind_cache_invalidate(tcp); + if (tcp_sysent(tcp)->sys_flags & MEMORY_MAPPING_CHANGE) + mmap_notify_report(tcp); + + if (filtered(tcp)) + return 0; + + if (check_exec_syscall(tcp)) { + /* The check failed, hide the log. */ + tcp->flags |= TCB_HIDE_LOG; } -#endif #if SUPPORTED_PERSONALITIES > 1 update_personality(tcp, tcp->currpers); #endif - res = (get_regs_error ? -1 : get_syscall_result(tcp)); - if (filtered(tcp) || hide_log(tcp)) - goto ret; - if (syserror(tcp) && syscall_tampered(tcp)) - tamper_with_syscall_exiting(tcp); - - if (cflag) { - count_syscall(tcp, &tv); - if (cflag == CFLAG_ONLY_STATS) { - goto ret; - } - } + return get_syscall_result(tcp); +} +void +print_syscall_resume(struct tcb *tcp) +{ /* If not in -ff mode, and printing_tcp != tcp, * then the log currently does not end with output * of _our syscall entry_, but with something else. @@ -790,11 +718,28 @@ trace_syscall_exiting(struct tcb *tcp) * "strace -ff -oLOG test/threaded_execve" corner case. * It's the only case when -ff mode needs reprinting. */ - if ((followfork < 2 && printing_tcp != tcp) || (tcp->flags & TCB_REPRINT)) { + if ((followfork < 2 && printing_tcp != tcp) + || (tcp->flags & TCB_REPRINT)) { tcp->flags &= ~TCB_REPRINT; printleader(tcp); - tprintf("<... %s resumed> ", tcp->s_ent->sys_name); + tprintf("<... %s resumed>", tcp_sysent(tcp)->sys_name); } +} + +int +syscall_exiting_trace(struct tcb *tcp, struct timespec *ts, int res) +{ + if (syscall_tampered(tcp) || inject_delay_exit(tcp)) + tamper_with_syscall_exiting(tcp); + + if (cflag) { + count_syscall(tcp, ts); + if (cflag == CFLAG_ONLY_STATS) { + return 0; + } + } + + print_syscall_resume(tcp); printing_tcp = tcp; tcp->s_prev_ent = NULL; @@ -804,48 +749,43 @@ trace_syscall_exiting(struct tcb *tcp) tabto(); tprints("= ? \n"); line_ended(); - tcp->flags &= ~(TCB_INSYSCALL | TCB_TAMPERED); - tcp->sys_func_rval = 0; - free_tcb_priv_data(tcp); return res; } tcp->s_prev_ent = tcp->s_ent; - sys_res = 0; - if (tcp->qual_flg & QUAL_RAW) { + int sys_res = 0; + if (raw(tcp)) { /* sys_res = printargs(tcp); - but it's nop on sysexit */ } else { /* FIXME: not_failing_only (IOW, option -z) is broken: * failure of syscall is known only after syscall return. * Thus we end up with something like this on, say, ENOENT: - * open("doesnt_exist", O_RDONLY + * open("does_not_exist", O_RDONLY * {next syscall decode} * whereas the intended result is that open(...) line * is not shown at all. */ if (not_failing_only && tcp->u_error) - goto ret; /* ignore failed syscalls */ + return 0; /* ignore failed syscalls */ if (tcp->sys_func_rval & RVAL_DECODED) sys_res = tcp->sys_func_rval; else - sys_res = tcp->s_ent->sys_func(tcp); + sys_res = tcp_sysent(tcp)->sys_func(tcp); } tprints(") "); tabto(); - u_error = tcp->u_error; - if (tcp->qual_flg & QUAL_RAW) { - if (u_error) { - tprintf("= -1 (errno %lu)", u_error); - } else { + if (raw(tcp)) { + if (tcp->u_error) + print_err_ret(tcp->u_rval, tcp->u_error); + else tprintf("= %#" PRI_klx, tcp->u_rval); - } + if (syscall_tampered(tcp)) tprints(" (INJECTED)"); - } - else if (!(sys_res & RVAL_NONE) && u_error) { - switch (u_error) { + } else if (!(sys_res & RVAL_NONE) && tcp->u_error) { + switch (tcp->u_error) { /* Blocked signals do not interrupt any syscalls. * In this case syscalls don't return ERESTARTfoo codes. * @@ -900,28 +840,21 @@ trace_syscall_exiting(struct tcb *tcp) tprints("= ? ERESTART_RESTARTBLOCK (Interrupted by signal)"); break; default: - u_error_str = err_name(u_error); - if (u_error_str) - tprintf("= -1 %s (%s)", - u_error_str, strerror(u_error)); - else - tprintf("= -1 %lu (%s)", - u_error, strerror(u_error)); + print_err_ret(tcp->u_rval, tcp->u_error); break; } if (syscall_tampered(tcp)) - tprintf(" (INJECTED)"); + tprints(" (INJECTED)"); if ((sys_res & RVAL_STR) && tcp->auxstr) tprintf(" (%s)", tcp->auxstr); - } - else { + } else { if (sys_res & RVAL_NONE) tprints("= ?"); else { switch (sys_res & RVAL_MASK) { case RVAL_HEX: #if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG - if (current_wordsize < sizeof(tcp->u_rval)) { + if (current_klongsize < sizeof(tcp->u_rval)) { tprintf("= %#x", (unsigned int) tcp->u_rval); } else @@ -936,7 +869,7 @@ trace_syscall_exiting(struct tcb *tcp) break; case RVAL_UDECIMAL: #if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG - if (current_wordsize < sizeof(tcp->u_rval)) { + if (current_klongsize < sizeof(tcp->u_rval)) { tprintf("= %u", (unsigned int) tcp->u_rval); } else @@ -945,15 +878,11 @@ trace_syscall_exiting(struct tcb *tcp) tprintf("= %" PRI_klu, tcp->u_rval); } break; - case RVAL_DECIMAL: - tprintf("= %" PRI_kld, tcp->u_rval); - break; case RVAL_FD: if (show_fd_path) { tprints("= "); printfd(tcp, tcp->u_rval); - } - else + } else tprintf("= %" PRI_kld, tcp->u_rval); break; default: @@ -967,31 +896,27 @@ trace_syscall_exiting(struct tcb *tcp) tprints(" (INJECTED)"); } if (Tflag) { - tv_sub(&tv, &tv, &tcp->etime); + ts_sub(ts, ts, &tcp->etime); tprintf(" <%ld.%06ld>", - (long) tv.tv_sec, (long) tv.tv_usec); + (long) ts->tv_sec, (long) ts->tv_nsec / 1000); } tprints("\n"); dumpio(tcp); line_ended(); -#ifdef USE_LIBUNWIND +#ifdef ENABLE_STACKTRACE if (stack_trace_enabled) - unwind_print_stacktrace(tcp); + unwind_tcb_print(tcp); #endif - - ret: - tcp->flags &= ~(TCB_INSYSCALL | TCB_TAMPERED); - tcp->sys_func_rval = 0; - free_tcb_priv_data(tcp); return 0; } -int -trace_syscall(struct tcb *tcp, unsigned int *signo) +void +syscall_exiting_finish(struct tcb *tcp) { - return exiting(tcp) ? - trace_syscall_exiting(tcp) : trace_syscall_entering(tcp, signo); + tcp->flags &= ~(TCB_INSYSCALL | TCB_TAMPERED | TCB_INJECT_DELAY_EXIT); + tcp->sys_func_rval = 0; + free_tcb_priv_data(tcp); } bool @@ -1023,54 +948,33 @@ restore_cleared_syserror(struct tcb *tcp) tcp->u_error = saved_u_error; } -/* - * Check the syscall return value register value for whether it is - * a negated errno code indicating an error, or a success return value. - */ -static inline bool -is_negated_errno(kernel_ulong_t val) +static struct ptrace_syscall_info ptrace_sci; + +static bool +ptrace_syscall_info_is_valid(void) { - /* Linux kernel defines MAX_ERRNO to 4095. */ - kernel_ulong_t max = -(kernel_long_t) 4095; + return ptrace_get_syscall_info_supported && + ptrace_sci.op <= PTRACE_SYSCALL_INFO_SECCOMP; +} -#ifndef current_klongsize - if (current_klongsize < sizeof(val)) { - val = (uint32_t) val; - max = (uint32_t) max; - } -#endif /* !current_klongsize */ +#define XLAT_MACROS_ONLY +#include "xlat/nt_descriptor_types.h" +#undef XLAT_MACROS_ONLY - return val >= max; -} +#define ARCH_MIGHT_USE_SET_REGS 1 #include "arch_regs.c" -#ifdef HAVE_GETRVAL2 +#if HAVE_ARCH_GETRVAL2 # include "arch_getrval2.c" #endif -void -print_pc(struct tcb *tcp) -{ -#if defined ARCH_PC_REG -# define ARCH_GET_PC 0 -#elif defined ARCH_PC_PEEK_ADDR - kernel_ulong_t pc; -# define ARCH_PC_REG pc -# define ARCH_GET_PC upeek(tcp->pid, ARCH_PC_PEEK_ADDR, &pc) -#else -# error Neither ARCH_PC_REG nor ARCH_PC_PEEK_ADDR is defined -#endif - if (get_regs_error || ARCH_GET_PC) - tprints(current_wordsize == 4 ? "[????????] " - : "[????????????????] "); - else - tprintf(current_wordsize == 4 - ? "[%08" PRI_klx "] " : "[%016" PRI_klx "] ", - (kernel_ulong_t) ARCH_PC_REG); -} - #include "getregs_old.h" +#ifdef HAVE_GETREGS_OLD +/* Either getregs_old() or set_regs() */ +# undef ARCH_MIGHT_USE_SET_REGS +# define ARCH_MIGHT_USE_SET_REGS 0 +#endif #undef ptrace_getregset_or_getregs #undef ptrace_setregset_or_setregs @@ -1096,7 +1000,7 @@ ptrace_getregset(pid_t pid) # endif } -# ifndef HAVE_GETREGS_OLD +# if ARCH_MIGHT_USE_SET_REGS # define ptrace_setregset_or_setregs ptrace_setregset static int ptrace_setregset(pid_t pid) @@ -1114,7 +1018,7 @@ ptrace_setregset(pid_t pid) return ptrace(PTRACE_SETREGSET, pid, NT_PRSTATUS, &io); # endif } -# endif /* !HAVE_GETREGS_OLD */ +# endif /* ARCH_MIGHT_USE_SET_REGS */ #elif defined ARCH_REGS_FOR_GETREGS @@ -1130,7 +1034,7 @@ ptrace_getregs(pid_t pid) # endif } -# ifndef HAVE_GETREGS_OLD +# if ARCH_MIGHT_USE_SET_REGS # define ptrace_setregset_or_setregs ptrace_setregs static int ptrace_setregs(pid_t pid) @@ -1142,16 +1046,27 @@ ptrace_setregs(pid_t pid) return ptrace(PTRACE_SETREGS, pid, NULL, &ARCH_REGS_FOR_GETREGS); # endif } -# endif /* !HAVE_GETREGS_OLD */ +# endif /* ARCH_MIGHT_USE_SET_REGS */ #endif /* ARCH_REGS_FOR_GETREGSET || ARCH_REGS_FOR_GETREGS */ +static long get_regs_error = -1; + void -get_regs(pid_t pid) +clear_regs(struct tcb *tcp) +{ + ptrace_sci.op = 0xff; + get_regs_error = -1; +} + +static long +get_regs(struct tcb *const tcp) { -#undef USE_GET_SYSCALL_RESULT_REGS #ifdef ptrace_getregset_or_getregs + if (get_regs_error != -1) + return get_regs_error; + # ifdef HAVE_GETREGS_OLD /* * Try PTRACE_GETREGSET/PTRACE_GETREGS first, @@ -1159,29 +1074,57 @@ get_regs(pid_t pid) */ static int use_getregs_old; if (use_getregs_old < 0) { - get_regs_error = ptrace_getregset_or_getregs(pid); - return; + return get_regs_error = ptrace_getregset_or_getregs(tcp->pid); } else if (use_getregs_old == 0) { - get_regs_error = ptrace_getregset_or_getregs(pid); + get_regs_error = ptrace_getregset_or_getregs(tcp->pid); if (get_regs_error >= 0) { use_getregs_old = -1; - return; + return get_regs_error; } if (errno == EPERM || errno == ESRCH) - return; + return get_regs_error; use_getregs_old = 1; } - get_regs_error = getregs_old(pid); + return get_regs_error = getregs_old(tcp); # else /* !HAVE_GETREGS_OLD */ /* Assume that PTRACE_GETREGSET/PTRACE_GETREGS works. */ - get_regs_error = ptrace_getregset_or_getregs(pid); + get_regs_error = ptrace_getregset_or_getregs(tcp->pid); + +# if defined ARCH_PERSONALITY_0_IOV_SIZE + if (get_regs_error) + return get_regs_error; + + switch (ARCH_IOVEC_FOR_GETREGSET.iov_len) { + case ARCH_PERSONALITY_0_IOV_SIZE: + update_personality(tcp, 0); + break; + case ARCH_PERSONALITY_1_IOV_SIZE: + update_personality(tcp, 1); + break; + default: { + static bool printed = false; + + if (!printed) { + error_msg("Unsupported regset size returned by " + "PTRACE_GETREGSET: %zu", + ARCH_IOVEC_FOR_GETREGSET.iov_len); + + printed = true; + } + + update_personality(tcp, 0); + } + } +# endif /* ARCH_PERSONALITY_0_IOV_SIZE */ + + return get_regs_error; + # endif /* !HAVE_GETREGS_OLD */ #else /* !ptrace_getregset_or_getregs */ -# define USE_GET_SYSCALL_RESULT_REGS 1 # warning get_regs is not implemented for this architecture yet - get_regs_error = 0; + return 0; #endif /* !ptrace_getregset_or_getregs */ } @@ -1197,7 +1140,7 @@ set_regs(pid_t pid) struct sysent_buf { struct tcb *tcp; struct_sysent ent; - char buf[sizeof("syscall_%lu") + sizeof(kernel_ulong_t) * 3]; + char buf[sizeof("syscall_0x") + sizeof(kernel_ulong_t) * 2]; }; static void @@ -1208,74 +1151,309 @@ free_sysent_buf(void *ptr) free(ptr); } +static bool +ptrace_get_syscall_info(struct tcb *tcp) +{ + /* + * ptrace_get_syscall_info_supported should have been checked + * by the caller. + */ + if (ptrace_sci.op == 0xff) { + const size_t size = sizeof(ptrace_sci); + if (ptrace(PTRACE_GET_SYSCALL_INFO, tcp->pid, + (void *) size, &ptrace_sci) < 0) { + get_regs_error = -2; + return false; + } +#if SUPPORTED_PERSONALITIES > 1 + int newpers = get_personality_from_syscall_info(&ptrace_sci); + if (newpers >= 0) + update_personality(tcp, newpers); +#endif + } + + if (entering(tcp)) { + if (ptrace_sci.op == PTRACE_SYSCALL_INFO_EXIT) { + error_msg("pid %d: entering" + ", ptrace_syscall_info.op == %u", + tcp->pid, ptrace_sci.op); + /* TODO: handle this. */ + } + } else { + if (ptrace_sci.op == PTRACE_SYSCALL_INFO_ENTRY) { + error_msg("pid %d: exiting" + ", ptrace_syscall_info.op == %u", + tcp->pid, ptrace_sci.op); + /* TODO: handle this. */ + } + } + + return true; +} + +bool +get_instruction_pointer(struct tcb *tcp, kernel_ulong_t *ip) +{ + if (get_regs_error < -1) + return false; + + if (ptrace_get_syscall_info_supported) { + if (!ptrace_get_syscall_info(tcp)) + return false; + *ip = (kernel_ulong_t) ptrace_sci.instruction_pointer; + return true; + } + +#if defined ARCH_PC_REG + if (get_regs(tcp) < 0) + return false; + *ip = (kernel_ulong_t) ARCH_PC_REG; + return true; +#elif defined ARCH_PC_PEEK_ADDR + if (upeek(tcp, ARCH_PC_PEEK_ADDR, ip) < 0) + return false; + return true; +#else +# error Neither ARCH_PC_REG nor ARCH_PC_PEEK_ADDR is defined +#endif +} + +bool +get_stack_pointer(struct tcb *tcp, kernel_ulong_t *sp) +{ + if (get_regs_error < -1) + return false; + + if (ptrace_get_syscall_info_supported) { + if (!ptrace_get_syscall_info(tcp)) + return false; + *sp = (kernel_ulong_t) ptrace_sci.stack_pointer; + return true; + } + +#if defined ARCH_SP_REG + if (get_regs(tcp) < 0) + return false; + *sp = (kernel_ulong_t) ARCH_SP_REG; + return true; +#elif defined ARCH_SP_PEEK_ADDR + if (upeek(tcp, ARCH_SP_PEEK_ADDR, sp) < 0) + return false; + return true; +#else + return false; +#endif +} + +static int +get_syscall_regs(struct tcb *tcp) +{ + if (get_regs_error != -1) + return get_regs_error; + + if (ptrace_get_syscall_info_supported) + return ptrace_get_syscall_info(tcp) ? 0 : get_regs_error; + + return get_regs(tcp); +} + +const struct_sysent stub_sysent = { + .nargs = MAX_ARGS, + .sys_flags = MEMORY_MAPPING_CHANGE, + .sen = SEN_printargs, + .sys_func = printargs, + .sys_name = "????", +}; + /* * Returns: - * 0: "ignore this ptrace stop", bail out of trace_syscall_entering() silently. - * 1: ok, continue in trace_syscall_entering(). - * other: error, trace_syscall_entering() should print error indicator - * ("????" etc) and bail out. + * 0: "ignore this ptrace stop", syscall_entering_decode() should return a "bail + * out silently" code. + * 1: ok, continue in syscall_entering_decode(). + * other: error, syscall_entering_decode() should print error indicator + * ("????" etc) and return an appropriate code. */ int get_scno(struct tcb *tcp) { - if (get_regs_error) + tcp->scno = -1; + tcp->s_ent = NULL; + tcp->qual_flg = QUAL_RAW | DEFAULT_QUAL_FLAGS; + + if (get_syscall_regs(tcp) < 0) return -1; - int rc = arch_get_scno(tcp); - if (rc != 1) - return rc; + if (ptrace_syscall_info_is_valid()) { + /* + * So far it's just a workaround for x32, + * but let's pretend it could be used elsewhere. + */ + int rc = arch_check_scno(tcp); + if (rc != 1) + return rc; + tcp->scno = ptrace_sci.entry.nr; + } else { + int rc = arch_get_scno(tcp); + if (rc != 1) + return rc; + } + + tcp->scno = shuffle_scno(tcp->scno); if (scno_is_valid(tcp->scno)) { tcp->s_ent = &sysent[tcp->scno]; tcp->qual_flg = qual_flags(tcp->scno); } else { - struct sysent_buf *s = xcalloc(1, sizeof(*s)); + struct sysent_buf *s = xzalloc(sizeof(*s)); s->tcp = tcp; - s->ent.nargs = MAX_ARGS; - s->ent.sen = SEN_printargs; - s->ent.sys_func = printargs; + s->ent = stub_sysent; s->ent.sys_name = s->buf; - sprintf(s->buf, "syscall_%" PRI_klu, shuffle_scno(tcp->scno)); + xsprintf(s->buf, "syscall_%#" PRI_klx, shuffle_scno(tcp->scno)); tcp->s_ent = &s->ent; - tcp->qual_flg = QUAL_RAW | DEFAULT_QUAL_FLAGS; set_tcb_priv_data(tcp, s, free_sysent_buf); - if (debug_flag) - error_msg("pid %d invalid syscall %" PRI_kld, - tcp->pid, tcp->scno); + debug_msg("pid %d invalid syscall %#" PRI_klx, + tcp->pid, shuffle_scno(tcp->scno)); } + + /* + * We refrain from argument decoding during recovering + * as tracee memory mappings has changed and the registers + * are very likely pointing to garbage already. + */ + if (recovering(tcp)) + tcp->qual_flg |= QUAL_RAW; + return 1; } -#ifdef USE_GET_SYSCALL_RESULT_REGS +static int +get_syscall_args(struct tcb *tcp) +{ + if (ptrace_syscall_info_is_valid()) { + const unsigned int n = + MIN(ARRAY_SIZE(tcp->u_arg), + ARRAY_SIZE(ptrace_sci.entry.args)); + for (unsigned int i = 0; i < n; ++i) + tcp->u_arg[i] = ptrace_sci.entry.args[i]; +#if SUPPORTED_PERSONALITIES > 1 + if (tcp_sysent(tcp)->sys_flags & COMPAT_SYSCALL_TYPES) { + for (unsigned int i = 0; i < n; ++i) + tcp->u_arg[i] = (uint32_t) tcp->u_arg[i]; + } +#endif + /* + * So far it's just a workaround for mips o32, + * but let's pretend it could be used elsewhere. + */ +#if MAX_ARGS > 6 + arch_get_syscall_args_extra(tcp, n); +#endif + return 1; + } + return arch_get_syscall_args(tcp); +} + +#ifdef ptrace_getregset_or_getregs +# define get_syscall_result_regs get_syscall_regs +#else static int get_syscall_result_regs(struct tcb *); #endif /* Returns: - * 1: ok, continue in trace_syscall_exiting(). - * -1: error, trace_syscall_exiting() should print error indicator + * 1: ok, continue in syscall_exiting_trace(). + * -1: error, syscall_exiting_trace() should print error indicator * ("????" etc) and bail out. */ static int get_syscall_result(struct tcb *tcp) { -#ifdef USE_GET_SYSCALL_RESULT_REGS - if (get_syscall_result_regs(tcp)) + if (get_syscall_result_regs(tcp) < 0) return -1; -#endif - tcp->u_error = 0; - get_error(tcp, !(tcp->s_ent->sys_flags & SYSCALL_NEVER_FAILS)); + get_error(tcp, + (!(tcp_sysent(tcp)->sys_flags & SYSCALL_NEVER_FAILS) + || syscall_tampered(tcp)) + && !syscall_tampered_nofail(tcp)); return 1; } +static void +get_error(struct tcb *tcp, const bool check_errno) +{ + if (ptrace_syscall_info_is_valid()) { + if (ptrace_sci.exit.is_error) { + tcp->u_rval = -1; + tcp->u_error = -ptrace_sci.exit.rval; + } else { + tcp->u_error = 0; + tcp->u_rval = ptrace_sci.exit.rval; + } + } else { + tcp->u_error = 0; + arch_get_error(tcp, check_errno); + } +} + +static void +set_error(struct tcb *tcp, unsigned long new_error) +{ + const unsigned long old_error = tcp->u_error; + + if (new_error == old_error || new_error > MAX_ERRNO_VALUE) + return; + +#ifdef ptrace_setregset_or_setregs + /* if we are going to invoke set_regs, call get_regs first */ + if (get_regs(tcp) < 0) + return; +#endif + + tcp->u_error = new_error; + if (arch_set_error(tcp)) { + tcp->u_error = old_error; + /* arch_set_error does not update u_rval */ + } else { + if (ptrace_syscall_info_is_valid()) + tcp->u_rval = -1; + else + get_error(tcp, !(tcp_sysent(tcp)->sys_flags & + SYSCALL_NEVER_FAILS)); + } +} + +static void +set_success(struct tcb *tcp, kernel_long_t new_rval) +{ + const kernel_long_t old_rval = tcp->u_rval; + +#ifdef ptrace_setregset_or_setregs + /* if we are going to invoke set_regs, call get_regs first */ + if (get_regs(tcp) < 0) + return; +#endif + + tcp->u_rval = new_rval; + if (arch_set_success(tcp)) { + tcp->u_rval = old_rval; + /* arch_set_success does not update u_error */ + } else { + if (ptrace_syscall_info_is_valid()) + tcp->u_error = 0; + else + get_error(tcp, !(tcp_sysent(tcp)->sys_flags & + SYSCALL_NEVER_FAILS)); + } +} + #include "get_scno.c" +#include "check_scno.c" #include "set_scno.c" #include "get_syscall_args.c" -#ifdef USE_GET_SYSCALL_RESULT_REGS +#ifndef ptrace_getregset_or_getregs # include "get_syscall_result.c" #endif #include "get_error.c" @@ -1283,13 +1461,10 @@ get_syscall_result(struct tcb *tcp) #ifdef HAVE_GETREGS_OLD # include "getregs_old.c" #endif +#include "shuffle_scno.c" const char * syscall_name(kernel_ulong_t scno) { -#if defined X32_PERSONALITY_NUMBER && defined __X32_SYSCALL_BIT - if (current_personality == X32_PERSONALITY_NUMBER) - scno &= ~__X32_SYSCALL_BIT; -#endif - return scno_is_valid(scno) ? sysent[scno].sys_name: NULL; + return scno_is_valid(scno) ? sysent[scno].sys_name : NULL; } diff --git a/syscallent.sh b/syscallent.sh deleted file mode 100755 index 16dd77f6..00000000 --- a/syscallent.sh +++ /dev/null @@ -1,73 +0,0 @@ -#!/bin/sh -# Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -cat ${1+"$@"} | - sed -n 's/^#[ ]*define[ ][ ]*SYS_\([^ ]*\)[ ]*[^0-9]*\([0-9]*\).*$/\1 \2/p -s/^#[ ]*define[ ][ ]*__NR_\([^ ]*\)[ ]*[^0-9]*\([0-9]*\).*$/\1 \2/p -s/^#[ ]*define[ ][ ]*__NR_\([^ ]*\)[ ]*[^0-9()]*(__NR_Linux + \([0-9]*\))$/\1 \2/p' | - sort -k2n | uniq | - awk ' - BEGIN { - tabs = "\t\t\t\t\t\t\t\t" - call = -1; - } - { - while (++call < $2) { - f = "printargs" - n = "SYS_" call - s = "\t{ MA,\t0,\t" - s = s f "," - s = s substr(tabs, 1, 24/8 - int((length(f) + 1)/8)) - s = s "\"" n "\"" - s = s substr(tabs, 1, 16/8 - int((length(n) + 2)/8)) - s = s "}, /* " call " */" - print s - } - f = "sys_" $1 - n = $1 - s = "\t{ MA,\t0,\t" - s = s f "," - s = s substr(tabs, 1, 24/8 - int((length(f) + 1)/8)) - s = s "\"" n "\"" - s = s substr(tabs, 1, 16/8 - int((length(n) + 2)/8)) - s = s "}, /* " call " */" - print s - } - END { - limit = call + 100 - while (++call < limit) { - f = "printargs" - n = "SYS_" call - s = "\t{ MA,\t0,\t" - s = s f "," - s = s substr(tabs, 1, 24/8 - int((length(f) + 1)/8)) - s = s "\"" n "\"" - s = s substr(tabs, 1, 16/8 - int((length(n) + 2)/8)) - s = s "}, /* " call " */" - print s - } - } - ' diff --git a/sysctl.c b/sysctl.c index 38436931..5b6fac13 100644 --- a/sysctl.c +++ b/sysctl.c @@ -2,29 +2,10 @@ * Copyright (c) 1999 Ulrich Drepper * Copyright (c) 2005 Roland McGrath * Copyright (c) 2005-2015 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -154,7 +135,7 @@ SYS_FUNC(sysctl) default: goto out; } - out: +out: max_cnt = info.nlen; if (abbrev(tcp) && max_cnt > max_strlen) max_cnt = max_strlen; diff --git a/sysent.h b/sysent.h index aa93bcb8..336a30bf 100644 --- a/sysent.h +++ b/sysent.h @@ -1,5 +1,12 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #ifndef STRACE_SYSENT_H -#define STRACE_SYSENT_H +# define STRACE_SYSENT_H typedef struct sysent { unsigned nargs; @@ -9,17 +16,25 @@ typedef struct sysent { const char *sys_name; } struct_sysent; -#define TRACE_FILE 001 /* Trace file-related syscalls. */ -#define TRACE_IPC 002 /* Trace IPC-related syscalls. */ -#define TRACE_NETWORK 004 /* Trace network-related syscalls. */ -#define TRACE_PROCESS 010 /* Trace process-related syscalls. */ -#define TRACE_SIGNAL 020 /* Trace signal-related syscalls. */ -#define TRACE_DESC 040 /* Trace file descriptor-related syscalls. */ -#define TRACE_MEMORY 0100 /* Trace memory mapping-related syscalls. */ -#define SYSCALL_NEVER_FAILS 0200 /* Syscall is always successful. */ -#define STACKTRACE_INVALIDATE_CACHE 0400 /* Trigger proc/maps cache updating */ -#define STACKTRACE_CAPTURE_ON_ENTER 01000 /* Capture stacktrace on "entering" stage */ -#define TRACE_INDIRECT_SUBCALL 02000 /* Syscall is an indirect socket/ipc subcall. */ -#define COMPAT_SYSCALL_TYPES 04000 /* A compat syscall that uses compat types. */ +# define TRACE_FILE 00000001 /* Trace file-related syscalls. */ +# define TRACE_IPC 00000002 /* Trace IPC-related syscalls. */ +# define TRACE_NETWORK 00000004 /* Trace network-related syscalls. */ +# define TRACE_PROCESS 00000010 /* Trace process-related syscalls. */ +# define TRACE_SIGNAL 00000020 /* Trace signal-related syscalls. */ +# define TRACE_DESC 00000040 /* Trace file descriptor-related syscalls. */ +# define TRACE_MEMORY 00000100 /* Trace memory mapping-related syscalls. */ +# define SYSCALL_NEVER_FAILS 00000200 /* Syscall is always successful. */ +# define MEMORY_MAPPING_CHANGE 00000400 /* Trigger proc/maps cache updating */ +# define STACKTRACE_CAPTURE_ON_ENTER 00001000 /* Capture stacktrace on "entering" stage */ +# define TRACE_INDIRECT_SUBCALL 00002000 /* Syscall is an indirect socket/ipc subcall. */ +# define COMPAT_SYSCALL_TYPES 00004000 /* A compat syscall that uses compat types. */ +# define TRACE_STAT 00010000 /* Trace {,*_}{,old}{,x}stat{,64} syscalls. */ +# define TRACE_LSTAT 00020000 /* Trace *lstat* syscalls. */ +# define TRACE_STATFS 00040000 /* Trace statfs, statfs64, and statvfs syscalls. */ +# define TRACE_FSTATFS 00100000 /* Trace fstatfs, fstatfs64 and fstatvfs syscalls. */ +# define TRACE_STATFS_LIKE 00200000 /* Trace statfs-like, fstatfs-like and ustat syscalls. */ +# define TRACE_FSTAT 00400000 /* Trace *fstat{,at}{,64} syscalls. */ +# define TRACE_STAT_LIKE 01000000 /* Trace *{,l,f}stat{,x,at}{,64} syscalls. */ +# define TRACE_PURE 02000000 /* Trace getter syscalls with no arguments. */ #endif /* !STRACE_SYSENT_H */ diff --git a/sysent_shorthand_defs.h b/sysent_shorthand_defs.h new file mode 100644 index 00000000..009f9a4b --- /dev/null +++ b/sysent_shorthand_defs.h @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifdef STRACE_TESTS_H + +# define TD 0 +# define TF 0 +# define TI 0 +# define TN 0 +# define TP 0 +# define TS 0 +# define TM 0 +# define TST 0 +# define TLST 0 +# define TFST 0 +# define TSTA 0 +# define TSF 0 +# define TFSF 0 +# define TSFA 0 +# define PU 0 +# define NF 0 +# define MA 0 +# define SI 0 +# define SE 0 +# define CST 0 +# define SEN(a) 0, 0 + +#else /* !STRACE_TESTS_H */ + +# define TD TRACE_DESC +# define TF TRACE_FILE +# define TI TRACE_IPC +# define TN TRACE_NETWORK +# define TP TRACE_PROCESS +# define TS TRACE_SIGNAL +# define TM TRACE_MEMORY +# define TST TRACE_STAT +# define TLST TRACE_LSTAT +# define TFST TRACE_FSTAT +# define TSTA TRACE_STAT_LIKE +# define TSF TRACE_STATFS +# define TFSF TRACE_FSTATFS +# define TSFA TRACE_STATFS_LIKE +# define PU TRACE_PURE +# define NF SYSCALL_NEVER_FAILS +# define MA MAX_ARGS +# define SI MEMORY_MAPPING_CHANGE +# define SE STACKTRACE_CAPTURE_ON_ENTER +# define CST COMPAT_SYSCALL_TYPES +/* SEN(a) is defined elsewhere */ + +#endif diff --git a/sysent_shorthand_undefs.h b/sysent_shorthand_undefs.h new file mode 100644 index 00000000..bc9ad131 --- /dev/null +++ b/sysent_shorthand_undefs.h @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#undef TD +#undef TF +#undef TI +#undef TN +#undef TP +#undef TS +#undef TM +#undef TST +#undef TLST +#undef TFST +#undef TSTA +#undef TSF +#undef TFSF +#undef TSFA +#undef NF +#undef MA +#undef SI +#undef SE +#undef CST +#undef SEN diff --git a/sysinfo.c b/sysinfo.c index a0f29cbf..8500475b 100644 --- a/sysinfo.c +++ b/sysinfo.c @@ -7,29 +7,10 @@ * Copyright (c) 2012 Denys Vlasenko * Copyright (c) 2014-2015 Dmitry V. Levin * Copyright (c) 2015 Elvira Khabirova + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/syslog.c b/syslog.c index 99063060..34d56199 100644 --- a/syslog.c +++ b/syslog.c @@ -1,46 +1,13 @@ /* * Copyright (c) 2012-2015 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" -enum { - SYSLOG_ACTION_CLOSE = 0, - SYSLOG_ACTION_OPEN, - SYSLOG_ACTION_READ, - SYSLOG_ACTION_READ_ALL, - SYSLOG_ACTION_READ_CLEAR, - SYSLOG_ACTION_CLEAR, - SYSLOG_ACTION_CONSOLE_OFF, - SYSLOG_ACTION_CONSOLE_ON, - SYSLOG_ACTION_CONSOLE_LEVEL, - SYSLOG_ACTION_SIZE_UNREAD, - SYSLOG_ACTION_SIZE_BUFFER -}; - #include "xlat/syslog_action_type.h" SYS_FUNC(syslog) diff --git a/sysmips.c b/sysmips.c index af5ffba0..b0b7eea2 100644 --- a/sysmips.c +++ b/sysmips.c @@ -1,47 +1,28 @@ /* * Copyright (c) 2001 Wichert Akkerman * Copyright (c) 2014-2015 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" #ifdef MIPS -#ifdef HAVE_LINUX_UTSNAME_H -# include -#endif -#ifdef HAVE_ASM_SYSMIPS_H -# include -#endif +# ifdef HAVE_LINUX_UTSNAME_H +# include +# endif +# ifdef HAVE_ASM_SYSMIPS_H +# include +# endif -#ifndef __NEW_UTS_LEN -# define __NEW_UTS_LEN 64 -#endif +# ifndef __NEW_UTS_LEN +# define __NEW_UTS_LEN 64 +# endif -#include "xlat/sysmips_operations.h" +# include "xlat/sysmips_operations.h" SYS_FUNC(sysmips) { @@ -58,8 +39,7 @@ SYS_FUNC(sysmips) nodename) < 0) { printaddr(tcp->u_arg[1]); } else { - print_quoted_string(nodename, __NEW_UTS_LEN + 1, - QUOTE_0_TERMINATED); + print_quoted_cstring(nodename, __NEW_UTS_LEN + 1); } return RVAL_DECODED; } diff --git a/term.c b/term.c index d083cdd5..b413a62a 100644 --- a/term.c +++ b/term.c @@ -1,28 +1,9 @@ /* * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -41,7 +22,6 @@ static void decode_termios(struct tcb *const tcp, const kernel_ulong_t addr) { struct termios tios; - int i; tprints(", "); if (umove_or_printaddr(tcp, addr, &tios)) @@ -64,10 +44,9 @@ decode_termios(struct tcb *const tcp, const kernel_ulong_t addr) if (!(tios.c_lflag & ICANON)) tprintf("c_cc[VMIN]=%d, c_cc[VTIME]=%d, ", tios.c_cc[VMIN], tios.c_cc[VTIME]); - tprints("c_cc=\""); - for (i = 0; i < NCCS; i++) - tprintf("\\x%02x", tios.c_cc[i]); - tprints("\"}"); + tprints("c_cc="); + print_quoted_string((char *) tios.c_cc, NCCS, QUOTE_FORCE_HEX); + tprints("}"); } static void @@ -161,6 +140,7 @@ term_ioctl(struct tcb *const tcp, const unsigned int code, case TIOCGLCKTRMIOS: if (entering(tcp)) return 0; + ATTRIBUTE_FALLTHROUGH; case TCSETS: #ifdef TCSETS2 case TCSETS2: @@ -181,6 +161,7 @@ term_ioctl(struct tcb *const tcp, const unsigned int code, case TCGETA: if (entering(tcp)) return 0; + ATTRIBUTE_FALLTHROUGH; case TCSETA: case TCSETAW: case TCSETAF: @@ -191,6 +172,7 @@ term_ioctl(struct tcb *const tcp, const unsigned int code, case TIOCGWINSZ: if (entering(tcp)) return 0; + ATTRIBUTE_FALLTHROUGH; case TIOCSWINSZ: decode_winsize(tcp, arg); break; @@ -200,6 +182,7 @@ term_ioctl(struct tcb *const tcp, const unsigned int code, case TIOCGSIZE: if (entering(tcp)) return 0; + ATTRIBUTE_FALLTHROUGH; case TIOCSSIZE: decode_ttysize(tcp, arg); break; @@ -224,6 +207,7 @@ term_ioctl(struct tcb *const tcp, const unsigned int code, case TIOCMGET: if (entering(tcp)) return 0; + ATTRIBUTE_FALLTHROUGH; case TIOCMBIS: case TIOCMBIC: case TIOCMSET: @@ -246,6 +230,7 @@ term_ioctl(struct tcb *const tcp, const unsigned int code, #endif if (entering(tcp)) return 0; + ATTRIBUTE_FALLTHROUGH; case TIOCSPGRP: case TIOCSETD: case FIONBIO: @@ -287,5 +272,5 @@ term_ioctl(struct tcb *const tcp, const unsigned int code, return RVAL_DECODED; } - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } diff --git a/test-driver b/test-driver index d3060566..b8521a48 100755 --- a/test-driver +++ b/test-driver @@ -1,9 +1,9 @@ #! /bin/sh # test-driver - basic testsuite driver script. -scriptversion=2013-07-13.22; # UTC +scriptversion=2018-03-07.03; # UTC -# Copyright (C) 2011-2013 Free Software Foundation, Inc. +# Copyright (C) 2011-2018 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +16,7 @@ scriptversion=2013-07-13.22; # UTC # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a @@ -106,11 +106,14 @@ trap "st=143; $do_exit" 15 # Test script is run here. "$@" >$log_file 2>&1 estatus=$? + if test $enable_hard_errors = no && test $estatus -eq 99; then - estatus=1 + tweaked_estatus=1 +else + tweaked_estatus=$estatus fi -case $estatus:$expect_failure in +case $tweaked_estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; @@ -119,6 +122,12 @@ case $estatus:$expect_failure in *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac +# Report the test outcome and exit status in the logs, so that one can +# know whether the test passed or failed simply by looking at the '.log' +# file, without the need of also peaking into the corresponding '.trs' +# file (automake bug#11814). +echo "$res $test_name (exit status: $estatus)" >>$log_file + # Report outcome to console. echo "${col}${res}${std}: $test_name" @@ -131,9 +140,9 @@ echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" -# time-stamp-time-zone: "UTC" +# time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: diff --git a/tests-m32/COPYING b/tests-m32/COPYING new file mode 100644 index 00000000..6aba5919 --- /dev/null +++ b/tests-m32/COPYING @@ -0,0 +1,11 @@ +Copyright (c) 2011-2019 The strace developers. +All rights reserved. + +strace test suite is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +strace test suite is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See GPL-2.0-or-later for more details. diff --git a/tests-m32/GPL-2.0-or-later b/tests-m32/GPL-2.0-or-later new file mode 100644 index 00000000..2a166946 --- /dev/null +++ b/tests-m32/GPL-2.0-or-later @@ -0,0 +1,339 @@ +GNU GENERAL PUBLIC LICENSE + +Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. + +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 , USA + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away your freedom +to share and change it. By contrast, the GNU General Public License is +intended to guarantee your freedom to share and change free software--to +make sure the software is free for all its users. This General Public +License applies to most of the Free Software Foundation's software and +to any other program whose authors commit to using it. (Some other Free +Software Foundation software is covered by the GNU Lesser General Public +License instead.) You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it in +new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid anyone +to deny you these rights or to ask you to surrender the rights. These +restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or +for a fee, you must give the recipients all the rights that you have. You +must make sure that they, too, receive or can get the source code. And +you must show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, +we want its recipients to know that what they have is not the original, +so that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains + a notice placed by the copyright holder saying it may be distributed + under the terms of this General Public License. The "Program", below, + refers to any such program or work, and a "work based on the Program" + means either the Program or any derivative work under copyright law: + that is to say, a work containing the Program or a portion of it, + either verbatim or with modifications and/or translated into another + language. (Hereinafter, translation is included without limitation + in the term "modification".) Each licensee is addressed as "you". + + Activities other than copying, distribution and modification are not + covered by this License; they are outside its scope. The act of running + the Program is not restricted, and the output from the Program is + covered only if its contents constitute a work based on the Program + (independent of having been made by running the Program). Whether + that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's source + code as you receive it, in any medium, provided that you conspicuously + and appropriately publish on each copy an appropriate copyright notice + and disclaimer of warranty; keep intact all the notices that refer + to this License and to the absence of any warranty; and give any + other recipients of the Program a copy of this License along with + the Program. + + You may charge a fee for the physical act of transferring a copy, and + you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion of + it, thus forming a work based on the Program, and copy and distribute + such modifications or work under the terms of Section 1 above, + provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that + in whole or in part contains or is derived from the Program or + any part thereof, to be licensed as a whole at no charge to all + third parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display + an announcement including an appropriate copyright notice and + a notice that there is no warranty (or else, saying that you + provide a warranty) and that users may redistribute the program + under these conditions, and telling the user how to view a copy + of this License. (Exception: if the Program itself is interactive + but does not normally print such an announcement, your work based + on the Program is not required to print an announcement.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the Program, + and can be reasonably considered independent and separate works in + themselves, then this License, and its terms, do not apply to those + sections when you distribute them as separate works. But when you + distribute the same sections as part of a whole which is a work + based on the Program, the distribution of the whole must be on the + terms of this License, whose permissions for other licensees extend + to the entire whole, and thus to each and every part regardless of + who wrote it. + + Thus, it is not the intent of this section to claim rights or contest + your rights to work written entirely by you; rather, the intent is + to exercise the right to control the distribution of derivative or + collective works based on the Program. + + In addition, mere aggregation of another work not based on the Program + with the Program (or with a work based on the Program) on a volume + of a storage or distribution medium does not bring the other work + under the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, + under Section 2) in object code or executable form under the terms of + Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; + or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer to + distribute corresponding source code. (This alternative is allowed + only for noncommercial distribution and only if you received the + program in object code or executable form with such an offer, + in accord with Subsection b above.) + + The source code for a work means the preferred form of the work + for making modifications to it. For an executable work, complete + source code means all the source code for all modules it contains, + plus any associated interface definition files, plus the scripts used + to control compilation and installation of the executable. However, + as a special exception, the source code distributed need not include + anything that is normally distributed (in either source or binary + form) with the major components (compiler, kernel, and so on) of the + operating system on which the executable runs, unless that component + itself accompanies the executable. + + If distribution of executable or object code is made by offering access + to copy from a designated place, then offering equivalent access to + copy the source code from the same place counts as distribution of + the source code, even though third parties are not compelled to copy + the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program + except as expressly provided under this License. Any attempt otherwise + to copy, modify, sublicense or distribute the Program is void, and + will automatically terminate your rights under this License. However, + parties who have received copies, or rights, from you under this + License will not have their licenses terminated so long as such + parties remain in full compliance. + + 5. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify + or distribute the Program or its derivative works. These actions + are prohibited by law if you do not accept this License. Therefore, + by modifying or distributing the Program (or any work based on the + Program), you indicate your acceptance of this License to do so, and + all its terms and conditions for copying, distributing or modifying + the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the + Program), the recipient automatically receives a license from the + original licensor to copy, distribute or modify the Program subject to + these terms and conditions. You may not impose any further restrictions + on the recipients' exercise of the rights granted herein. You are not + responsible for enforcing compliance by third parties to this License. + + 7. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent issues), + conditions are imposed on you (whether by court order, agreement + or otherwise) that contradict the conditions of this License, they + do not excuse you from the conditions of this License. If you cannot + distribute so as to satisfy simultaneously your obligations under this + License and any other pertinent obligations, then as a consequence + you may not distribute the Program at all. For example, if a patent + license would not permit royalty-free redistribution of the Program + by all those who receive copies directly or indirectly through you, + then the only way you could satisfy both it and this License would + be to refrain entirely from distribution of the Program. + + If any portion of this section is held invalid or unenforceable under + any particular circumstance, the balance of the section is intended + to apply and the section as a whole is intended to apply in other + circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of + any such claims; this section has the sole purpose of protecting + the integrity of the free software distribution system, which + is implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is willing + to distribute software through any other system and a licensee cannot + impose that choice. + + This section is intended to make thoroughly clear what is believed + to be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in + certain countries either by patents or by copyrighted interfaces, the + original copyright holder who places the Program under this License + may add an explicit geographical distribution limitation excluding + those countries, so that distribution is permitted only in or among + countries not thus excluded. In such case, this License incorporates + the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions + of the General Public License from time to time. Such new versions + will be similar in spirit to the present version, but may differ in + detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the Program + specifies a version number of this License which applies to it and + "any later version", you have the option of following the terms and + conditions either of that version or of any later version published + by the Free Software Foundation. If the Program does not specify + a version number of this License, you may choose any version ever + published by the Free Software Foundation. + + 10. If you wish to incorporate parts of the Program into other free + programs whose distribution conditions are different, write to the + author to ask for permission. For software which is copyrighted by the + Free Software Foundation, write to the Free Software Foundation; we + sometimes make exceptions for this. Our decision will be guided by the + two goals of preserving the free status of all derivatives of our free + software and of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO + WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE + LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS + AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF + ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE + PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME + THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO + IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY + MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE + TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR + CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE + THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING + RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR + A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN + IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF + SUCH DAMAGES. END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + +Copyright (C) + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 , USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author Gnomovision +comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is +free software, and you are welcome to redistribute it under certain +conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the +appropriate parts of the General Public License. Of course, the commands +you use may be called something other than `show w' and `show c'; they +could even be mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or +your school, if any, to sign a "copyright disclaimer" for the program, +if necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +< signature of Ty Coon > , 1 April 1989 Ty Coon, President of Vice This +General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/tests-m32/Makefile.am b/tests-m32/Makefile.am index 8d10878b..30365523 100644 --- a/tests-m32/Makefile.am +++ b/tests-m32/Makefile.am @@ -1,34 +1,19 @@ # Automake input for strace tests. # # Copyright (c) 2011-2016 Dmitry V. Levin +# Copyright (c) 2011-2019 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later OS = linux ARCH = @arch_m32@ +NATIVE_ARCH = @arch_native@ +SIZEOF_KERNEL_LONG_T = 4 +SIZEOF_LONG = 4 MPERS_NAME = m32 -ARCH_MFLAGS = -DMPERS_IS_$(MPERS_NAME) -m32 +MPERS_CC_FLAGS = @cc_flags_m32@ +ARCH_MFLAGS = -DMPERS_IS_$(MPERS_NAME) $(MPERS_CC_FLAGS) AM_CFLAGS = $(WARN_CFLAGS) AM_CPPFLAGS = $(ARCH_MFLAGS) \ -I$(builddir) \ @@ -37,27 +22,40 @@ AM_CPPFLAGS = $(ARCH_MFLAGS) \ -I$(top_builddir)/$(OS) \ -I$(top_srcdir)/$(OS) \ -I$(top_builddir) \ - -I$(top_srcdir) + -I$(top_srcdir) \ + -DTESTS_SIZEOF_KERNEL_LONG_T=$(SIZEOF_KERNEL_LONG_T) \ + -DTESTS_SIZEOF_LONG=$(SIZEOF_LONG) AM_LDFLAGS = $(ARCH_MFLAGS) libtests_a_SOURCES = \ + create_nl_socket.c \ errno2name.c \ error_msg.c \ fill_memory.c \ get_page_size.c \ + get_sigset_size.c \ hexdump_strdup.c \ hexquote_strndup.c \ + ifindex.c \ inode_of_sockfd.c \ libmmsg.c \ libsocketcall.c \ overflowuid.c \ pipe_maxfd.c \ print_quoted_string.c \ + print_time.c \ printflags.c \ printxval.c \ signal2name.c \ + skip_unavailable.c \ sprintrc.c \ tail_alloc.c \ + test_netlink.h \ + test_nlattr.h \ + test_printpath.c \ + test_printstrn.c \ + test_ucopy.c \ + test_ucopy.h \ tests.h \ tprintf.c \ # end of libtests_a_SOURCES @@ -65,396 +63,125 @@ libtests_a_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 check_LIBRARIES = libtests.a LDADD = libtests.a -check_PROGRAMS = \ - _newselect \ - accept \ - accept4 \ - access \ - acct \ - add_key \ - adjtimex \ - aio \ - alarm \ +include pure_executables.am + +check_PROGRAMS = $(PURE_EXECUTABLES) \ + _newselect-P \ answer \ attach-f-p \ attach-f-p-cmd \ attach-p-cmd-cmd \ attach-p-cmd-p \ - bpf \ - brk \ - btrfs \ - caps \ + block_reset_raise_run \ + bpf-obj_get_info_by_fd \ + bpf-obj_get_info_by_fd-prog \ + bpf-obj_get_info_by_fd-prog-v \ + bpf-obj_get_info_by_fd-v \ + bpf-success \ + bpf-success-v \ caps-abbrev \ - chmod \ - chown \ - chown32 \ - chroot \ - clock_adjtime \ - clock_nanosleep \ - clock_xettime \ - copy_file_range \ + check_sigblock \ + check_sigign \ + clone_parent \ + clone_ptrace \ count-f \ - creat \ - delete_module \ - dup \ - dup2 \ - dup3 \ - epoll_create \ - epoll_create1 \ - epoll_ctl \ - epoll_pwait \ - epoll_wait \ - erestartsys \ - eventfd \ - execve \ + delay \ execve-v \ - execveat \ execveat-v \ - faccessat \ - fadvise64 \ - fadvise64_64 \ - fallocate \ - fanotify_init \ - fanotify_mark \ - fchdir \ - fchmod \ - fchmodat \ - fchown \ - fchown32 \ - fchownat \ - fcntl \ - fcntl64 \ - fdatasync \ - file_handle \ - file_ioctl \ filter-unavailable \ - finit_module \ - flock \ fork-f \ - fstat \ - fstat64 \ - fstatat64 \ - fstatfs \ - fstatfs64 \ - fsync \ - ftruncate \ - ftruncate64 \ - futex \ - futimesat \ - get_mempolicy \ - getcpu \ - getcwd \ - getdents \ - getdents64 \ - getegid \ - getegid32 \ - geteuid \ - geteuid32 \ - getgid \ - getgid32 \ - getgroups \ - getgroups32 \ - getpeername \ - getpgrp \ - getrandom \ - getresgid \ - getresgid32 \ - getresuid \ - getresuid32 \ - getrlimit \ - getrusage \ - getsid \ - getsockname \ - getuid \ - getuid32 \ - getxxid \ - inet-cmsg \ - init_module \ - inotify \ - inotify_init1 \ - ioctl \ - ioctl_block \ - ioctl_dm \ + fsync-y \ + getpid \ + getppid \ + gettid \ + inject-nf \ + int_0x80 \ ioctl_dm-v \ - ioctl_evdev \ + ioctl_evdev-success \ + ioctl_evdev-success-v \ ioctl_evdev-v \ - ioctl_loop \ ioctl_loop-nv \ ioctl_loop-v \ - ioctl_mtd \ - ioctl_rtc \ + ioctl_nsfs \ + ioctl_perf-success \ ioctl_rtc-v \ - ioctl_scsi \ - ioctl_sg_io_v3 \ - ioctl_sg_io_v4 \ - ioctl_sock_gifconf \ - ioctl_uffdio \ - ioctl_v4l2 \ - ioperm \ - iopl \ - ioprio \ - ip_mreq \ - ipc \ - ipc_msg \ - ipc_msgbuf \ - ipc_sem \ - ipc_shm \ - kcmp \ - kexec_file_load \ - kexec_load \ - keyctl \ - kill \ + is_linux_mips_n64 \ + kill_child \ ksysent \ - lchown \ - lchown32 \ - link \ - linkat \ - llseek \ - lookup_dcookie \ - lseek \ - lstat \ - lstat64 \ - mbind \ - membarrier \ - memfd_create \ - migrate_pages \ - mincore \ - mkdir \ - mkdirat \ - mknod \ - mknodat \ - mlock \ - mlock2 \ - mlockall \ - mmap \ - mmap64 \ - mmsg \ + list_sigaction_signum \ + localtime \ + looping_threads \ mmsg-silent \ - mmsg_name \ mmsg_name-v \ - mount \ - move_pages \ - mq \ - mq_sendrecv \ - mq_sendrecv-read \ - mq_sendrecv-write \ - msg_control \ msg_control-v \ - msg_name \ - munlockall \ - nanosleep \ net-accept-connect \ - net-icmp_filter \ - net-sockaddr \ - net-y-unix \ - net-yy-inet \ - net-yy-netlink \ - net-yy-unix \ + net-tpacket_stats-success \ netlink_inet_diag \ netlink_netlink_diag \ - netlink_protocol \ netlink_unix_diag \ - newfstatat \ nsyscalls \ - old_mmap \ - oldfstat \ - oldlstat \ - oldselect \ - oldstat \ - open \ - openat \ - pause \ + nsyscalls-d \ + oldselect-P \ + oldselect-efault-P \ + orphaned_process_group \ pc \ - perf_event_open \ perf_event_open_nonverbose \ perf_event_open_unabbrev \ - personality \ - pipe \ - pipe2 \ - pkey_alloc \ - pkey_free \ - pkey_mprotect \ - poll \ - ppoll \ - prctl-arg2-intptr \ - prctl-dumpable \ - prctl-name \ - prctl-no-args \ - prctl-pdeathsig \ + ppoll-v \ prctl-seccomp-filter-v \ prctl-seccomp-strict \ - prctl-securebits \ - prctl-tid_address \ - prctl-tsc \ - pread64-pwrite64 \ - preadv \ - preadv-pwritev \ - preadv2-pwritev2 \ + prctl-spec-inject \ print_maxfd \ - printstr \ - prlimit64 \ - process_vm_readv \ - process_vm_writev \ - pselect6 \ - ptrace \ - pwritev \ qual_fault \ qual_inject-error-signal \ qual_inject-retval \ qual_inject-signal \ qual_signal \ - quotactl \ + quotactl-success \ + quotactl-success-v \ quotactl-v \ - quotactl-xfs \ + quotactl-xfs-success \ + quotactl-xfs-success-v \ quotactl-xfs-v \ - read-write \ - readahead \ - readdir \ - readlink \ - readlinkat \ - readv \ - reboot \ - recvfrom \ - recvmmsg-timeout \ - recvmsg \ redirect-fds \ - remap_file_pages \ - rename \ - renameat \ - renameat2 \ - request_key \ restart_syscall \ - rmdir \ - rt_sigpending \ - rt_sigprocmask \ - rt_sigqueueinfo \ - rt_sigsuspend \ - rt_sigtimedwait \ - rt_tgsigqueueinfo \ - sched_get_priority_mxx \ - sched_rr_get_interval \ - sched_xetaffinity \ - sched_xetattr \ - sched_xetparam \ - sched_xetscheduler \ - sched_yield \ + run_expect_termsig \ scm_rights \ - seccomp-filter \ seccomp-filter-v \ seccomp-strict \ - select \ - semop \ - sendfile \ - sendfile64 \ - set_mempolicy \ + select-P \ set_ptracer_any \ - setdomainname \ - setfsgid \ - setfsgid32 \ - setfsuid \ - setfsuid32 \ - setgid \ - setgid32 \ - setgroups \ - setgroups32 \ - sethostname \ - setns \ - setregid \ - setregid32 \ - setresgid \ - setresgid32 \ - setresuid \ - setresuid32 \ - setreuid \ - setreuid32 \ - setrlimit \ - setuid \ - setuid32 \ - shmxt \ - shutdown \ - sigaction \ - sigaltstack \ - siginfo \ + set_sigblock \ + set_sigign \ signal_receive \ - signalfd4 \ - sigreturn \ sleep \ - socketcall \ - splice \ stack-fcall \ - stat \ - stat64 \ - statfs \ - statfs64 \ - swap \ - symlink \ - symlinkat \ - sync \ - sync_file_range \ - sync_file_range2 \ - sysinfo \ - syslog \ - tee \ + stack-fcall-mangled \ threads-execve \ - time \ - timer_create \ - timer_xettime \ - timerfd_xettime \ - times \ - times-fail \ - truncate \ - truncate64 \ - ugetrlimit \ - uio \ - umask \ - umount \ - umount2 \ - umoven-illptr \ - umovestr \ - umovestr-illptr \ - umovestr2 \ - umovestr3 \ - uname \ + unblock_reset_raise \ unix-pair-send-recv \ unix-pair-sendto-recvfrom \ - unlink \ - unlinkat \ - unshare \ - userfaultfd \ - ustat \ - utime \ - utimensat \ - utimes \ vfork-f \ - vhangup \ - vmsplice \ - wait4 \ wait4-v \ - waitid \ waitid-v \ - waitpid \ - xattr \ - xattr-strings \ - xet_robust_list \ - xetitimer \ - xetpgid \ - xetpriority \ - xettimeofday \ + zeroargc \ # end of check_PROGRAMS -attach_f_p_LDADD = -lrt -lpthread $(LDADD) -clock_xettime_LDADD = -lrt $(LDADD) +attach_f_p_LDADD = -lpthread $(LDADD) count_f_LDADD = -lpthread $(LDADD) +delay_LDADD = $(clock_LIBS) $(LDADD) filter_unavailable_LDADD = -lpthread $(LDADD) fstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 fstatat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 ftruncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +localtime_LDADD = $(clock_LIBS) $(LDADD) +looping_threads_LDADD = -lpthread $(LDADD) lstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 mmap64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 -mq_LDADD = -lrt $(LDADD) -mq_sendrecv_LDADD = -lrt $(LDADD) -mq_sendrecv_read_LDADD = -lrt $(LDADD) -mq_sendrecv_write_LDADD = -lrt $(LDADD) +mmap64_Xabbrev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mmap64_Xraw_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mmap64_Xverbose_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mq_LDADD = $(mq_LIBS) $(LDADD) newfstatat_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 pc_LDADD = $(dl_LIBS) $(LDADD) pread64_pwrite64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 @@ -463,221 +190,72 @@ preadv_pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 stat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 statfs_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 -threads_execve_LDADD = -lrt -lpthread $(LDADD) -times_LDADD = -lrt $(LDADD) +threads_execve_LDADD = -lpthread $(clock_LIBS) $(LDADD) +times_LDADD = $(clock_LIBS) $(LDADD) truncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 uio_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 stack_fcall_SOURCES = stack-fcall.c \ stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c -if USE_LIBUNWIND -LIBUNWIND_TESTS = strace-k.test +stack_fcall_mangled_SOURCES = stack-fcall-mangled.c \ + stack-fcall-mangled-0.c stack-fcall-mangled-1.c \ + stack-fcall-mangled-2.c stack-fcall-mangled-3.c + +include gen_tests.am + +if ENABLE_STACKTRACE +STACKTRACE_TESTS = strace-k.test +if USE_DEMANGLE +STACKTRACE_TESTS += strace-k-demangle.test +endif else -LIBUNWIND_TESTS = +STACKTRACE_TESTS = endif DECODER_TESTS = \ - _newselect.test \ - accept.test \ - accept4.test \ - access.test \ - acct.test \ - add_key.test \ - adjtimex.test \ - aio.test \ - alarm.test \ - bpf.test \ + bpf-success-v.test \ + bpf-success.test \ brk.test \ + btrfs-X.test \ btrfs-v.test \ + btrfs-vX.test \ btrfs-vw.test \ + btrfs-vwX.test \ btrfs-w.test \ - btrfs.test \ + btrfs-wX.test \ caps-abbrev.test \ caps.test \ - chmod.test \ - chown.test \ - chown32.test \ - chroot.test \ - clock_adjtime.test \ - clock_nanosleep.test \ - clock_xettime.test \ - copy_file_range.test \ - creat.test \ - delete_module.test \ - dup.test \ - dup2.test \ - dup3.test \ - epoll_create.test \ - epoll_create1.test \ - epoll_ctl.test \ - epoll_pwait.test \ - epoll_wait.test \ - erestartsys.test \ eventfd.test \ execve-v.test \ execve.test \ - execveat-v.test \ - execveat.test \ - faccessat.test \ fadvise64.test \ - fadvise64_64.test \ - fallocate.test \ - fanotify_init.test \ - fanotify_mark.test \ - fchdir.test \ - fchmod.test \ - fchmodat.test \ - fchown.test \ - fchown32.test \ - fchownat.test \ - fcntl.test \ - fcntl64.test \ - fdatasync.test \ - file_handle.test \ - file_ioctl.test \ - finit_module.test \ - flock.test \ - fstat.test \ - fstat64.test \ - fstatat64.test \ - fstatfs.test \ - fstatfs64.test \ - fsync.test \ - ftruncate.test \ - ftruncate64.test \ futex.test \ - futimesat.test \ - get_mempolicy.test \ - getcpu.test \ - getcwd.test \ - getdents.test \ - getdents64.test \ - getegid.test \ - getegid32.test \ - geteuid.test \ - geteuid32.test \ - getgid.test \ - getgid32.test \ - getgroups.test \ - getgroups32.test \ - getpeername.test \ - getpgrp.test \ - getrandom.test \ - getresgid.test \ - getresgid32.test \ - getresuid.test \ - getresuid32.test \ - getrlimit.test \ - getrusage.test \ - getsid.test \ - getsockname.test \ getuid.test \ - getuid32.test \ - getxxid.test \ - inet-cmsg.test \ - init_module.test \ - inotify.test \ - inotify_init1.test \ + int_0x80.test \ ioctl.test \ - ioctl_block.test \ - ioctl_dm-v.test \ - ioctl_dm.test \ - ioctl_evdev-v.test \ - ioctl_evdev.test \ - ioctl_loop-nv.test \ - ioctl_loop-v.test \ - ioctl_loop.test \ - ioctl_mtd.test \ - ioctl_rtc-v.test \ - ioctl_rtc.test \ - ioctl_scsi.test \ - ioctl_sg_io_v3.test \ - ioctl_sg_io_v4.test \ - ioctl_sock_gifconf.test \ - ioctl_uffdio.test \ - ioctl_v4l2.test \ - ioperm.test \ - iopl.test \ - ioprio.test \ - ip_mreq.test \ - ipc.test \ - ipc_msg.test \ + ioctl_evdev-success-v.test \ + ioctl_evdev-success.test \ + ioctl_perf-success.test \ ipc_msgbuf.test \ - ipc_sem.test \ - ipc_shm.test \ - kcmp.test \ - kexec_file_load.test \ - kexec_load.test \ - keyctl.test \ - kill.test \ - lchown.test \ - lchown32.test \ - link.test \ - linkat.test \ + kern_features-fault.test \ llseek.test \ - lookup_dcookie.test \ lseek.test \ - lstat.test \ - lstat64.test \ - mbind.test \ - membarrier.test \ - memfd_create.test \ - migrate_pages.test \ - mincore.test \ - mkdir.test \ - mkdirat.test \ - mknod.test \ - mknodat.test \ - mlock.test \ - mlock2.test \ - mlockall.test \ mmap.test \ - mmap64.test \ - mmsg-silent.test \ - mmsg.test \ - mmsg_name-v.test \ - mmsg_name.test \ - mount.test \ - move_pages.test \ - mq.test \ - mq_sendrecv-read.test \ - mq_sendrecv-write.test \ - mq_sendrecv.test \ - msg_control-v.test \ - msg_control.test \ - msg_name.test \ - munlockall.test \ - nanosleep.test \ - net-icmp_filter.test \ - net-sockaddr.test \ + net-tpacket_stats-success.test \ net-y-unix.test \ net-yy-inet.test \ net-yy-netlink.test \ net-yy-unix.test \ net.test \ - netlink_protocol.test \ - newfstatat.test \ + netlink_sock_diag.test \ + nsyscalls-d.test \ + nsyscalls-nd.test \ nsyscalls.test \ - old_mmap.test \ - oldfstat.test \ - oldlstat.test \ - oldselect.test \ - oldstat.test \ - open.test \ - openat.test \ - pause.test \ - perf_event_open.test \ - perf_event_open_nonverbose.test \ - perf_event_open_unabbrev.test \ personality.test \ pipe.test \ - pipe2.test \ - pkey_alloc.test \ - pkey_free.test \ - pkey_mprotect.test \ + poll-P.test \ poll.test \ - ppoll.test \ prctl-arg2-intptr.test \ prctl-dumpable.test \ prctl-name.test \ @@ -686,171 +264,68 @@ DECODER_TESTS = \ prctl-seccomp-filter-v.test \ prctl-seccomp-strict.test \ prctl-securebits.test \ + prctl-spec-inject.test \ prctl-tid_address.test \ prctl-tsc.test \ - pread64-pwrite64.test \ - preadv-pwritev.test \ - preadv.test \ - preadv2-pwritev2.test \ - printstr.test \ - prlimit64.test \ - process_vm_readv.test \ - process_vm_writev.test \ - pselect6.test \ - ptrace.test \ - pwritev.test \ qual_fault-exit_group.test \ - quotactl-v.test \ - quotactl-xfs-v.test \ - quotactl-xfs.test \ - quotactl.test \ - read-write.test \ - readahead.test \ - readdir.test \ - readlink.test \ - readlinkat.test \ + quotactl-success-v.test \ + quotactl-success.test \ + quotactl-xfs-success-v.test \ + quotactl-xfs-success.test \ readv.test \ - reboot.test \ - recvfrom.test \ - recvmmsg-timeout.test \ - recvmsg.test \ - remap_file_pages.test \ - rename.test \ - renameat.test \ - renameat2.test \ - request_key.test \ - rmdir.test \ - rt_sigpending.test \ - rt_sigprocmask.test \ - rt_sigqueueinfo.test \ - rt_sigsuspend.test \ - rt_sigtimedwait.test \ - rt_tgsigqueueinfo.test \ - sched_get_priority_mxx.test \ - sched_rr_get_interval.test \ - sched_xetaffinity.test \ - sched_xetattr.test \ - sched_xetparam.test \ - sched_xetscheduler.test \ - sched_yield.test \ + rt_sigaction.test \ scm_rights-fd.test \ - seccomp-filter-v.test \ - seccomp-filter.test \ seccomp-strict.test \ - select.test \ - semop.test \ - sendfile.test \ - sendfile64.test \ - set_mempolicy.test \ - setdomainname.test \ - setfsgid.test \ - setfsgid32.test \ - setfsuid.test \ - setfsuid32.test \ - setgid.test \ - setgid32.test \ - setgroups.test \ - setgroups32.test \ - sethostname.test \ - setns.test \ - setregid.test \ - setregid32.test \ - setresgid.test \ - setresgid32.test \ - setresuid.test \ - setresuid32.test \ - setreuid.test \ - setreuid32.test \ - setrlimit.test \ - setuid.test \ - setuid32.test \ - shmxt.test \ - shutdown.test \ - sigaction.test \ sigaltstack.test \ - siginfo.test \ - signalfd4.test \ - sigreturn.test \ - socketcall.test \ - splice.test \ - stat.test \ - stat64.test \ - statfs.test \ - statfs64.test \ sun_path.test \ - swap.test \ - symlink.test \ - symlinkat.test \ - sync.test \ - sync_file_range.test \ - sync_file_range2.test \ - sysinfo.test \ - syslog.test \ - tee.test \ - time.test \ - timer_create.test \ - timer_xettime.test \ - timerfd_xettime.test \ - times-fail.test \ - times.test \ - truncate.test \ - truncate64.test \ - ugetrlimit.test \ uio.test \ - umask.test \ umount.test \ umount2.test \ - umoven-illptr.test \ - umovestr-illptr.test \ umovestr.test \ umovestr2.test \ - umovestr3.test \ uname.test \ unix-pair-send-recv.test \ unix-pair-sendto-recvfrom.test \ - unlink.test \ - unlinkat.test \ - unshare.test \ - userfaultfd.test \ - ustat.test \ - utime.test \ - utimensat.test \ - utimes.test \ - vhangup.test \ - vmsplice.test \ - wait4-v.test \ - wait4.test \ - waitid-v.test \ - waitid.test \ - waitpid.test \ - xattr-strings.test \ - xattr.test \ - xet_robust_list.test \ - xetitimer.test \ - xetpgid.test \ - xetpriority.test \ - xettimeofday.test \ + xet_thread_area_x86.test \ # end of DECODER_TESTS MISC_TESTS = \ attach-f-p.test \ attach-p-cmd.test \ bexecve.test \ + clone_parent.test \ + clone_ptrace.test \ count-f.test \ count.test \ + delay.test \ detach-running.test \ detach-sleeping.test \ detach-stopped.test \ + fflush.test \ filter-unavailable.test \ - fork-f.test \ + filtering_fd-syntax.test \ + filtering_syscall-syntax.test \ + first_exec_failure.test \ + get_regs.test \ + inject-nf.test \ + interactive_block.test \ + kill_child.test \ ksysent.test \ + localtime.test \ + looping_threads.test \ opipe.test \ options-syntax.test \ pc.test \ + printpath-umovestr-legacy.test \ + printstrn-umoven-legacy.test \ qual_fault-syntax.test \ + qual_fault-syscall.test \ qual_fault.test \ + qual_inject-error-signal-syscall.test \ qual_inject-error-signal.test \ + qual_inject-retval-syscall.test \ qual_inject-retval.test \ + qual_inject-signal-syscall.test \ qual_inject-signal.test \ qual_inject-syntax.test \ qual_signal.test \ @@ -858,92 +333,135 @@ MISC_TESTS = \ redirect-fds.test \ redirect.test \ restart_syscall.test \ - signal_receive.test \ + sigblock.test \ + sigign.test \ strace-C.test \ strace-E.test \ strace-S.test \ strace-T.test \ strace-V.test \ strace-ff.test \ + strace-log-merge-error.test \ + strace-log-merge-suffix.test \ strace-r.test \ strace-t.test \ strace-tt.test \ strace-ttt.test \ + termsig.test \ threads-execve.test \ - vfork-f.test \ # end of MISC_TESTS -TESTS = $(DECODER_TESTS) $(MISC_TESTS) $(LIBUNWIND_TESTS) +TESTS = $(GEN_TESTS) $(DECODER_TESTS) $(MISC_TESTS) $(STACKTRACE_TESTS) XFAIL_TESTS_ = -XFAIL_TESTS_m32 = $(LIBUNWIND_TESTS) -XFAIL_TESTS_mx32 = $(LIBUNWIND_TESTS) -XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) +XFAIL_TESTS_m32 = $(STACKTRACE_TESTS) +XFAIL_TESTS_mx32 = $(STACKTRACE_TESTS) +XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) $(XFAIL_TESTS_$(ARCH)) TEST_LOG_COMPILER = env -AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) MIPS_ABI=$(MIPS_ABI) $(srcdir)/run.sh +AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) STRACE_NATIVE_ARCH=$(NATIVE_ARCH) \ + SIZEOF_KERNEL_LONG_T=$(SIZEOF_KERNEL_LONG_T) \ + SIZEOF_LONG=$(SIZEOF_LONG) \ + MIPS_ABI=$(MIPS_ABI) $(srcdir)/run.sh @VALGRIND_CHECK_RULES@ VALGRIND_FLAGS = --quiet -VALGRIND_SUPPRESSIONS_FILES = $(srcdir)/strace.supp +VALGRIND_SUPPRESSIONS_FILES = $(abs_srcdir)/strace.supp -EXTRA_DIST = init.sh run.sh match.awk \ - caps-abbrev.awk \ - caps.awk \ - count-f.expected \ - eventfd.expected \ - fadvise.h \ - filter-unavailable.expected \ - fstatat.c \ - fstatx.c \ - getresugid.c \ - init_delete_module.h \ - ipc.sh \ - ipc_msgbuf.expected \ - ksysent.sed \ - lstatx.c \ - net.expected \ - oldselect.expected \ - pipe.expected \ - ppoll-v.expected \ - ppoll.expected \ - process_vm_readv_writev.c \ - qual_fault-exit_group.expected \ - qual_inject-error-signal.expected \ - qual_inject-signal.expected \ - quotactl.h \ - scno_tampering.sh \ - setfsugid.c \ - setresugid.c \ - setreugid.c \ - setugid.c \ - sigaction.awk \ - sigaltstack.expected \ - sockname.c \ - statfs.expected \ - statx.sh \ - strace-C.expected \ - strace-E.expected \ - strace-T.expected \ - strace-ff.expected \ - strace-k.test \ - strace-r.expected \ - strace.supp \ - struct_flock.c \ - sun_path.expected \ - uio.expected \ - umode_t.c \ - umovestr.expected \ - unix-pair-send-recv.expected \ - unix-pair-sendto-recvfrom.expected \ - xchownx.c \ - xgetrlimit.c \ - xselect.c \ - xstatfs.c \ - xstatfs64.c \ - xstatfsx.c \ - xstatx.c \ - $(TESTS) +EXTRA_DIST = \ + COPYING \ + GPL-2.0-or-later \ + PTRACE_SEIZE.sh \ + accept_compat.h \ + attach-p-cmd.h \ + caps-abbrev.awk \ + caps.awk \ + clock.in \ + count-f.expected \ + eventfd.expected \ + fadvise.h \ + fcntl-common.c \ + filter-unavailable.expected \ + fstatat.c \ + fstatx.c \ + gen_pure_executables.sh \ + gen_tests.in \ + gen_tests.sh \ + getresugid.c \ + init.sh \ + init_delete_module.h \ + ioctl_kvm_run_common.c \ + ipc.sh \ + ksysent.sed \ + lstatx.c \ + match.awk \ + net.expected \ + netlink_sock_diag-v.sh \ + nlattr_ifla.h \ + pipe.expected \ + print_user_desc.c \ + printsignal.c \ + process_vm_readv_writev.c \ + pure_executables.list \ + qual_fault-exit_group.expected \ + qual_inject-error-signal.expected \ + qual_inject-signal.expected \ + qualify_personality.sh \ + qualify_personality_empty.in \ + quotactl.h \ + regex.in \ + rt_sigaction.awk \ + run.sh \ + sched.in \ + scno_tampering.sh \ + setfsugid.c \ + setresugid.c \ + setreugid.c \ + setugid.c \ + sigaltstack.expected \ + sockaddr_xlat.c \ + sockname.c \ + stack-fcall.h \ + strace-C.expected \ + strace-E.expected \ + strace-T.expected \ + strace-ff.expected \ + strace-k-demangle.expected \ + strace-k-demangle.test \ + strace-k.expected \ + strace-k.test \ + strace-r.expected \ + strace.supp \ + sun_path.expected \ + syntax.sh \ + trace_fstat.in \ + trace_fstatfs.in \ + trace_lstat.in \ + trace_personality_32.in \ + trace_personality_64.in \ + trace_personality_regex_32.in \ + trace_personality_regex_64.in \ + trace_personality_regex_x32.in \ + trace_personality_x32.in \ + trace_question.in \ + trace_stat.in \ + trace_stat_like.in \ + trace_statfs.in \ + trace_statfs_like.in \ + uio.expected \ + umode_t.c \ + umovestr.expected \ + unix-pair-send-recv.expected \ + unix-pair-sendto-recvfrom.expected \ + xchownx.c \ + xgetrlimit.c \ + xselect.c \ + xstatfs.c \ + xstatfs64.c \ + xstatfsx.c \ + xstatx.c \ + xutimes.c \ + $(TESTS) ksysent.h: $(srcdir)/ksysent.sed echo '#include ' | \ @@ -957,6 +475,15 @@ ksysent.$(OBJEXT): ksysent.h objects = $(filter %.$(OBJEXT),$(SOURCES:.c=.$(OBJEXT))) $(objects): scno.h -CLEANFILES = ksysent.h $(TESTS:=.tmp) +clean-local: clean-local-check +.PHONY: clean-local-check +clean-local-check: + -rm -rf -- $(TESTS:.test=.dir) $(GEN_TESTS:.gen.test=.dir) + +.PHONY: check-valgrind-local +check-valgrind-local: $(check_LIBRARIES) $(check_PROGRAMS) + +BUILT_SOURCES = ksysent.h +CLEANFILES = ksysent.h include ../scno.am diff --git a/tests-m32/Makefile.in b/tests-m32/Makefile.in index 77d11da5..9c424933 100644 --- a/tests-m32/Makefile.in +++ b/tests-m32/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -17,58 +17,29 @@ # Automake input for strace tests. # # Copyright (c) 2011-2016 Dmitry V. Levin +# Copyright (c) 2011-2019 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later # scno.h make rules for strace. # -# Copyright (c) 2017 Dmitry V. Levin +# Copyright (c) 2017-2019 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: LGPL-2.1-or-later VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -131,163 +102,288 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -check_PROGRAMS = _newselect$(EXEEXT) accept$(EXEEXT) accept4$(EXEEXT) \ - access$(EXEEXT) acct$(EXEEXT) add_key$(EXEEXT) \ - adjtimex$(EXEEXT) aio$(EXEEXT) alarm$(EXEEXT) answer$(EXEEXT) \ +check_PROGRAMS = $(am__EXEEXT_1) _newselect-P$(EXEEXT) answer$(EXEEXT) \ attach-f-p$(EXEEXT) attach-f-p-cmd$(EXEEXT) \ - attach-p-cmd-cmd$(EXEEXT) attach-p-cmd-p$(EXEEXT) bpf$(EXEEXT) \ - brk$(EXEEXT) btrfs$(EXEEXT) caps$(EXEEXT) caps-abbrev$(EXEEXT) \ - chmod$(EXEEXT) chown$(EXEEXT) chown32$(EXEEXT) chroot$(EXEEXT) \ - clock_adjtime$(EXEEXT) clock_nanosleep$(EXEEXT) \ - clock_xettime$(EXEEXT) copy_file_range$(EXEEXT) \ - count-f$(EXEEXT) creat$(EXEEXT) delete_module$(EXEEXT) \ - dup$(EXEEXT) dup2$(EXEEXT) dup3$(EXEEXT) epoll_create$(EXEEXT) \ - epoll_create1$(EXEEXT) epoll_ctl$(EXEEXT) epoll_pwait$(EXEEXT) \ - epoll_wait$(EXEEXT) erestartsys$(EXEEXT) eventfd$(EXEEXT) \ - execve$(EXEEXT) execve-v$(EXEEXT) execveat$(EXEEXT) \ - execveat-v$(EXEEXT) faccessat$(EXEEXT) fadvise64$(EXEEXT) \ + attach-p-cmd-cmd$(EXEEXT) attach-p-cmd-p$(EXEEXT) \ + block_reset_raise_run$(EXEEXT) bpf-obj_get_info_by_fd$(EXEEXT) \ + bpf-obj_get_info_by_fd-prog$(EXEEXT) \ + bpf-obj_get_info_by_fd-prog-v$(EXEEXT) \ + bpf-obj_get_info_by_fd-v$(EXEEXT) bpf-success$(EXEEXT) \ + bpf-success-v$(EXEEXT) caps-abbrev$(EXEEXT) \ + check_sigblock$(EXEEXT) check_sigign$(EXEEXT) \ + clone_parent$(EXEEXT) clone_ptrace$(EXEEXT) count-f$(EXEEXT) \ + delay$(EXEEXT) execve-v$(EXEEXT) execveat-v$(EXEEXT) \ + filter-unavailable$(EXEEXT) fork-f$(EXEEXT) fsync-y$(EXEEXT) \ + getpid$(EXEEXT) getppid$(EXEEXT) gettid$(EXEEXT) \ + inject-nf$(EXEEXT) int_0x80$(EXEEXT) ioctl_dm-v$(EXEEXT) \ + ioctl_evdev-success$(EXEEXT) ioctl_evdev-success-v$(EXEEXT) \ + ioctl_evdev-v$(EXEEXT) ioctl_loop-nv$(EXEEXT) \ + ioctl_loop-v$(EXEEXT) ioctl_nsfs$(EXEEXT) \ + ioctl_perf-success$(EXEEXT) ioctl_rtc-v$(EXEEXT) \ + is_linux_mips_n64$(EXEEXT) kill_child$(EXEEXT) \ + ksysent$(EXEEXT) list_sigaction_signum$(EXEEXT) \ + localtime$(EXEEXT) looping_threads$(EXEEXT) \ + mmsg-silent$(EXEEXT) mmsg_name-v$(EXEEXT) \ + msg_control-v$(EXEEXT) net-accept-connect$(EXEEXT) \ + net-tpacket_stats-success$(EXEEXT) netlink_inet_diag$(EXEEXT) \ + netlink_netlink_diag$(EXEEXT) netlink_unix_diag$(EXEEXT) \ + nsyscalls$(EXEEXT) nsyscalls-d$(EXEEXT) oldselect-P$(EXEEXT) \ + oldselect-efault-P$(EXEEXT) orphaned_process_group$(EXEEXT) \ + pc$(EXEEXT) perf_event_open_nonverbose$(EXEEXT) \ + perf_event_open_unabbrev$(EXEEXT) ppoll-v$(EXEEXT) \ + prctl-seccomp-filter-v$(EXEEXT) prctl-seccomp-strict$(EXEEXT) \ + prctl-spec-inject$(EXEEXT) print_maxfd$(EXEEXT) \ + qual_fault$(EXEEXT) qual_inject-error-signal$(EXEEXT) \ + qual_inject-retval$(EXEEXT) qual_inject-signal$(EXEEXT) \ + qual_signal$(EXEEXT) quotactl-success$(EXEEXT) \ + quotactl-success-v$(EXEEXT) quotactl-v$(EXEEXT) \ + quotactl-xfs-success$(EXEEXT) quotactl-xfs-success-v$(EXEEXT) \ + quotactl-xfs-v$(EXEEXT) redirect-fds$(EXEEXT) \ + restart_syscall$(EXEEXT) run_expect_termsig$(EXEEXT) \ + scm_rights$(EXEEXT) seccomp-filter-v$(EXEEXT) \ + seccomp-strict$(EXEEXT) select-P$(EXEEXT) \ + set_ptracer_any$(EXEEXT) set_sigblock$(EXEEXT) \ + set_sigign$(EXEEXT) signal_receive$(EXEEXT) sleep$(EXEEXT) \ + stack-fcall$(EXEEXT) stack-fcall-mangled$(EXEEXT) \ + threads-execve$(EXEEXT) unblock_reset_raise$(EXEEXT) \ + unix-pair-send-recv$(EXEEXT) \ + unix-pair-sendto-recvfrom$(EXEEXT) vfork-f$(EXEEXT) \ + wait4-v$(EXEEXT) waitid-v$(EXEEXT) zeroargc$(EXEEXT) +@ENABLE_STACKTRACE_TRUE@@USE_DEMANGLE_TRUE@am__append_1 = strace-k-demangle.test +TESTS = $(GEN_TESTS) $(DECODER_TESTS) $(MISC_TESTS) $(am__EXEEXT_2) +subdir = tests-m32 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ + $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ + $(top_srcdir)/m4/ax_valgrind_check.m4 \ + $(top_srcdir)/m4/bpf_attr.m4 $(top_srcdir)/m4/mpers.m4 \ + $(top_srcdir)/m4/st_demangle.m4 $(top_srcdir)/m4/st_libdw.m4 \ + $(top_srcdir)/m4/st_libunwind.m4 \ + $(top_srcdir)/m4/st_save_restore_var.m4 \ + $(top_srcdir)/m4/st_stacktrace.m4 \ + $(top_srcdir)/m4/st_warn_cflags.m4 \ + $(top_srcdir)/m4/warnings.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__EXEEXT_1 = _newselect$(EXEEXT) accept$(EXEEXT) accept4$(EXEEXT) \ + access$(EXEEXT) acct$(EXEEXT) add_key$(EXEEXT) \ + adjtimex$(EXEEXT) aio$(EXEEXT) aio_pgetevents$(EXEEXT) \ + alarm$(EXEEXT) bpf$(EXEEXT) bpf-obj_get_info_by_fd$(EXEEXT) \ + bpf-obj_get_info_by_fd-prog$(EXEEXT) \ + bpf-obj_get_info_by_fd-prog-v$(EXEEXT) \ + bpf-obj_get_info_by_fd-v$(EXEEXT) bpf-v$(EXEEXT) brk$(EXEEXT) \ + btrfs$(EXEEXT) caps$(EXEEXT) chmod$(EXEEXT) chown$(EXEEXT) \ + chown32$(EXEEXT) chroot$(EXEEXT) clock_adjtime$(EXEEXT) \ + clock_nanosleep$(EXEEXT) clock_xettime$(EXEEXT) \ + copy_file_range$(EXEEXT) creat$(EXEEXT) delete_module$(EXEEXT) \ + dev-yy$(EXEEXT) dup$(EXEEXT) dup2$(EXEEXT) dup3$(EXEEXT) \ + epoll_create$(EXEEXT) epoll_create1$(EXEEXT) \ + epoll_ctl$(EXEEXT) epoll_pwait$(EXEEXT) epoll_wait$(EXEEXT) \ + erestartsys$(EXEEXT) eventfd$(EXEEXT) execve$(EXEEXT) \ + execveat$(EXEEXT) faccessat$(EXEEXT) fadvise64$(EXEEXT) \ fadvise64_64$(EXEEXT) fallocate$(EXEEXT) \ - fanotify_init$(EXEEXT) fanotify_mark$(EXEEXT) fchdir$(EXEEXT) \ + fanotify_init$(EXEEXT) fanotify_mark$(EXEEXT) \ + fanotify_mark-Xabbrev$(EXEEXT) fanotify_mark-Xraw$(EXEEXT) \ + fanotify_mark-Xverbose$(EXEEXT) fchdir$(EXEEXT) \ fchmod$(EXEEXT) fchmodat$(EXEEXT) fchown$(EXEEXT) \ fchown32$(EXEEXT) fchownat$(EXEEXT) fcntl$(EXEEXT) \ - fcntl64$(EXEEXT) fdatasync$(EXEEXT) file_handle$(EXEEXT) \ - file_ioctl$(EXEEXT) filter-unavailable$(EXEEXT) \ - finit_module$(EXEEXT) flock$(EXEEXT) fork-f$(EXEEXT) \ - fstat$(EXEEXT) fstat64$(EXEEXT) fstatat64$(EXEEXT) \ - fstatfs$(EXEEXT) fstatfs64$(EXEEXT) fsync$(EXEEXT) \ - ftruncate$(EXEEXT) ftruncate64$(EXEEXT) futex$(EXEEXT) \ - futimesat$(EXEEXT) get_mempolicy$(EXEEXT) getcpu$(EXEEXT) \ - getcwd$(EXEEXT) getdents$(EXEEXT) getdents64$(EXEEXT) \ - getegid$(EXEEXT) getegid32$(EXEEXT) geteuid$(EXEEXT) \ - geteuid32$(EXEEXT) getgid$(EXEEXT) getgid32$(EXEEXT) \ - getgroups$(EXEEXT) getgroups32$(EXEEXT) getpeername$(EXEEXT) \ - getpgrp$(EXEEXT) getrandom$(EXEEXT) getresgid$(EXEEXT) \ - getresgid32$(EXEEXT) getresuid$(EXEEXT) getresuid32$(EXEEXT) \ - getrlimit$(EXEEXT) getrusage$(EXEEXT) getsid$(EXEEXT) \ - getsockname$(EXEEXT) getuid$(EXEEXT) getuid32$(EXEEXT) \ - getxxid$(EXEEXT) inet-cmsg$(EXEEXT) init_module$(EXEEXT) \ - inotify$(EXEEXT) inotify_init1$(EXEEXT) ioctl$(EXEEXT) \ - ioctl_block$(EXEEXT) ioctl_dm$(EXEEXT) ioctl_dm-v$(EXEEXT) \ - ioctl_evdev$(EXEEXT) ioctl_evdev-v$(EXEEXT) \ - ioctl_loop$(EXEEXT) ioctl_loop-nv$(EXEEXT) \ - ioctl_loop-v$(EXEEXT) ioctl_mtd$(EXEEXT) ioctl_rtc$(EXEEXT) \ - ioctl_rtc-v$(EXEEXT) ioctl_scsi$(EXEEXT) \ - ioctl_sg_io_v3$(EXEEXT) ioctl_sg_io_v4$(EXEEXT) \ - ioctl_sock_gifconf$(EXEEXT) ioctl_uffdio$(EXEEXT) \ - ioctl_v4l2$(EXEEXT) ioperm$(EXEEXT) iopl$(EXEEXT) \ - ioprio$(EXEEXT) ip_mreq$(EXEEXT) ipc$(EXEEXT) ipc_msg$(EXEEXT) \ - ipc_msgbuf$(EXEEXT) ipc_sem$(EXEEXT) ipc_shm$(EXEEXT) \ - kcmp$(EXEEXT) kexec_file_load$(EXEEXT) kexec_load$(EXEEXT) \ - keyctl$(EXEEXT) kill$(EXEEXT) ksysent$(EXEEXT) lchown$(EXEEXT) \ - lchown32$(EXEEXT) link$(EXEEXT) linkat$(EXEEXT) \ - llseek$(EXEEXT) lookup_dcookie$(EXEEXT) lseek$(EXEEXT) \ - lstat$(EXEEXT) lstat64$(EXEEXT) mbind$(EXEEXT) \ - membarrier$(EXEEXT) memfd_create$(EXEEXT) \ + fcntl64$(EXEEXT) fdatasync$(EXEEXT) fflush$(EXEEXT) \ + file_handle$(EXEEXT) file_ioctl$(EXEEXT) finit_module$(EXEEXT) \ + flock$(EXEEXT) fstat$(EXEEXT) fstat-Xabbrev$(EXEEXT) \ + fstat-Xraw$(EXEEXT) fstat-Xverbose$(EXEEXT) fstat64$(EXEEXT) \ + fstat64-Xabbrev$(EXEEXT) fstat64-Xraw$(EXEEXT) \ + fstat64-Xverbose$(EXEEXT) fstatat64$(EXEEXT) fstatfs$(EXEEXT) \ + fstatfs64$(EXEEXT) fsync$(EXEEXT) ftruncate$(EXEEXT) \ + ftruncate64$(EXEEXT) futex$(EXEEXT) futimesat$(EXEEXT) \ + get_mempolicy$(EXEEXT) getcpu$(EXEEXT) getcwd$(EXEEXT) \ + getdents$(EXEEXT) getdents64$(EXEEXT) getegid$(EXEEXT) \ + getegid32$(EXEEXT) geteuid$(EXEEXT) geteuid32$(EXEEXT) \ + getgid$(EXEEXT) getgid32$(EXEEXT) getgroups$(EXEEXT) \ + getgroups32$(EXEEXT) getpeername$(EXEEXT) getpgrp$(EXEEXT) \ + getpid$(EXEEXT) getppid$(EXEEXT) getrandom$(EXEEXT) \ + getresgid$(EXEEXT) getresgid32$(EXEEXT) getresuid$(EXEEXT) \ + getresuid32$(EXEEXT) getrlimit$(EXEEXT) getrusage$(EXEEXT) \ + getsid$(EXEEXT) getsockname$(EXEEXT) getuid$(EXEEXT) \ + getuid32$(EXEEXT) getxxid$(EXEEXT) group_req$(EXEEXT) \ + inet-cmsg$(EXEEXT) init_module$(EXEEXT) inotify$(EXEEXT) \ + inotify_init1$(EXEEXT) io_uring_enter$(EXEEXT) \ + io_uring_register$(EXEEXT) io_uring_setup$(EXEEXT) \ + ioctl$(EXEEXT) ioctl_block$(EXEEXT) ioctl_dm$(EXEEXT) \ + ioctl_evdev$(EXEEXT) ioctl_inotify$(EXEEXT) \ + ioctl_kvm_run$(EXEEXT) ioctl_kvm_run-v$(EXEEXT) \ + ioctl_kvm_run_auxstr_vcpu$(EXEEXT) ioctl_loop$(EXEEXT) \ + ioctl_mtd$(EXEEXT) ioctl_nbd$(EXEEXT) ioctl_perf$(EXEEXT) \ + ioctl_ptp$(EXEEXT) ioctl_random$(EXEEXT) ioctl_rtc$(EXEEXT) \ + ioctl_scsi$(EXEEXT) ioctl_sg_io_v3$(EXEEXT) \ + ioctl_sg_io_v4$(EXEEXT) ioctl_sock_gifconf$(EXEEXT) \ + ioctl_uffdio$(EXEEXT) ioctl_v4l2$(EXEEXT) ioperm$(EXEEXT) \ + iopl$(EXEEXT) ioprio$(EXEEXT) ioprio-Xabbrev$(EXEEXT) \ + ioprio-Xraw$(EXEEXT) ioprio-Xverbose$(EXEEXT) ip_mreq$(EXEEXT) \ + ipc$(EXEEXT) ipc_msg$(EXEEXT) ipc_msg-Xabbrev$(EXEEXT) \ + ipc_msg-Xraw$(EXEEXT) ipc_msg-Xverbose$(EXEEXT) \ + ipc_msgbuf$(EXEEXT) ipc_msgbuf-Xabbrev$(EXEEXT) \ + ipc_msgbuf-Xraw$(EXEEXT) ipc_msgbuf-Xverbose$(EXEEXT) \ + ipc_sem$(EXEEXT) ipc_sem-Xabbrev$(EXEEXT) \ + ipc_sem-Xraw$(EXEEXT) ipc_sem-Xverbose$(EXEEXT) \ + ipc_shm$(EXEEXT) ipc_shm-Xabbrev$(EXEEXT) \ + ipc_shm-Xraw$(EXEEXT) ipc_shm-Xverbose$(EXEEXT) kcmp$(EXEEXT) \ + kcmp-y$(EXEEXT) kern_features$(EXEEXT) kernel_version$(EXEEXT) \ + kernel_version-Xabbrev$(EXEEXT) kernel_version-Xraw$(EXEEXT) \ + kernel_version-Xverbose$(EXEEXT) kexec_file_load$(EXEEXT) \ + kexec_load$(EXEEXT) keyctl$(EXEEXT) keyctl-Xabbrev$(EXEEXT) \ + keyctl-Xraw$(EXEEXT) keyctl-Xverbose$(EXEEXT) kill$(EXEEXT) \ + lchown$(EXEEXT) lchown32$(EXEEXT) link$(EXEEXT) \ + linkat$(EXEEXT) llseek$(EXEEXT) lookup_dcookie$(EXEEXT) \ + lseek$(EXEEXT) lstat$(EXEEXT) lstat64$(EXEEXT) \ + madvise$(EXEEXT) mbind$(EXEEXT) membarrier$(EXEEXT) \ + memfd_create$(EXEEXT) memfd_create-Xabbrev$(EXEEXT) \ + memfd_create-Xraw$(EXEEXT) memfd_create-Xverbose$(EXEEXT) \ migrate_pages$(EXEEXT) mincore$(EXEEXT) mkdir$(EXEEXT) \ mkdirat$(EXEEXT) mknod$(EXEEXT) mknodat$(EXEEXT) \ mlock$(EXEEXT) mlock2$(EXEEXT) mlockall$(EXEEXT) mmap$(EXEEXT) \ - mmap64$(EXEEXT) mmsg$(EXEEXT) mmsg-silent$(EXEEXT) \ - mmsg_name$(EXEEXT) mmsg_name-v$(EXEEXT) mount$(EXEEXT) \ - move_pages$(EXEEXT) mq$(EXEEXT) mq_sendrecv$(EXEEXT) \ + mmap-Xabbrev$(EXEEXT) mmap-Xraw$(EXEEXT) \ + mmap-Xverbose$(EXEEXT) mmap64$(EXEEXT) mmap64-Xabbrev$(EXEEXT) \ + mmap64-Xraw$(EXEEXT) mmap64-Xverbose$(EXEEXT) mmsg$(EXEEXT) \ + mmsg_name$(EXEEXT) modify_ldt$(EXEEXT) mount$(EXEEXT) \ + mount-Xabbrev$(EXEEXT) mount-Xraw$(EXEEXT) \ + mount-Xverbose$(EXEEXT) move_pages$(EXEEXT) \ + move_pages-Xabbrev$(EXEEXT) move_pages-Xraw$(EXEEXT) \ + move_pages-Xverbose$(EXEEXT) mq$(EXEEXT) mq_sendrecv$(EXEEXT) \ mq_sendrecv-read$(EXEEXT) mq_sendrecv-write$(EXEEXT) \ - msg_control$(EXEEXT) msg_control-v$(EXEEXT) msg_name$(EXEEXT) \ - munlockall$(EXEEXT) nanosleep$(EXEEXT) \ - net-accept-connect$(EXEEXT) net-icmp_filter$(EXEEXT) \ - net-sockaddr$(EXEEXT) net-y-unix$(EXEEXT) net-yy-inet$(EXEEXT) \ + msg_control$(EXEEXT) msg_name$(EXEEXT) munlockall$(EXEEXT) \ + nanosleep$(EXEEXT) net-icmp_filter$(EXEEXT) \ + net-packet_mreq$(EXEEXT) net-packet_mreq-Xabbrev$(EXEEXT) \ + net-packet_mreq-Xraw$(EXEEXT) \ + net-packet_mreq-Xverbose$(EXEEXT) net-sockaddr$(EXEEXT) \ + net-tpacket_req$(EXEEXT) net-tpacket_stats$(EXEEXT) \ + net-y-unix$(EXEEXT) net-yy-inet$(EXEEXT) net-yy-inet6$(EXEEXT) \ net-yy-netlink$(EXEEXT) net-yy-unix$(EXEEXT) \ - netlink_inet_diag$(EXEEXT) netlink_netlink_diag$(EXEEXT) \ - netlink_protocol$(EXEEXT) netlink_unix_diag$(EXEEXT) \ - newfstatat$(EXEEXT) nsyscalls$(EXEEXT) old_mmap$(EXEEXT) \ - oldfstat$(EXEEXT) oldlstat$(EXEEXT) oldselect$(EXEEXT) \ - oldstat$(EXEEXT) open$(EXEEXT) openat$(EXEEXT) pause$(EXEEXT) \ - pc$(EXEEXT) perf_event_open$(EXEEXT) \ - perf_event_open_nonverbose$(EXEEXT) \ - perf_event_open_unabbrev$(EXEEXT) personality$(EXEEXT) \ + netlink_audit$(EXEEXT) netlink_crypto$(EXEEXT) \ + netlink_generic$(EXEEXT) netlink_kobject_uevent$(EXEEXT) \ + netlink_netfilter$(EXEEXT) netlink_protocol$(EXEEXT) \ + netlink_route$(EXEEXT) netlink_selinux$(EXEEXT) \ + netlink_sock_diag$(EXEEXT) netlink_xfrm$(EXEEXT) \ + newfstatat$(EXEEXT) nfnetlink_acct$(EXEEXT) \ + nfnetlink_cthelper$(EXEEXT) nfnetlink_ctnetlink$(EXEEXT) \ + nfnetlink_ctnetlink_exp$(EXEEXT) nfnetlink_cttimeout$(EXEEXT) \ + nfnetlink_ipset$(EXEEXT) nfnetlink_nft_compat$(EXEEXT) \ + nfnetlink_nftables$(EXEEXT) nfnetlink_osf$(EXEEXT) \ + nfnetlink_queue$(EXEEXT) nfnetlink_ulog$(EXEEXT) \ + nlattr$(EXEEXT) nlattr_br_port_msg$(EXEEXT) \ + nlattr_crypto_user_alg$(EXEEXT) nlattr_dcbmsg$(EXEEXT) \ + nlattr_fib_rule_hdr$(EXEEXT) nlattr_ifaddrlblmsg$(EXEEXT) \ + nlattr_ifaddrmsg$(EXEEXT) nlattr_ifinfomsg$(EXEEXT) \ + nlattr_ifla_af_spec$(EXEEXT) nlattr_ifla_brport$(EXEEXT) \ + nlattr_ifla_linkinfo$(EXEEXT) nlattr_ifla_port$(EXEEXT) \ + nlattr_ifla_xdp$(EXEEXT) nlattr_inet_diag_msg$(EXEEXT) \ + nlattr_inet_diag_req_compat$(EXEEXT) \ + nlattr_inet_diag_req_v2$(EXEEXT) \ + nlattr_mdba_mdb_entry$(EXEEXT) \ + nlattr_mdba_router_port$(EXEEXT) nlattr_ndmsg$(EXEEXT) \ + nlattr_ndtmsg$(EXEEXT) nlattr_netconfmsg$(EXEEXT) \ + nlattr_netlink_diag_msg$(EXEEXT) nlattr_nlmsgerr$(EXEEXT) \ + nlattr_packet_diag_msg$(EXEEXT) nlattr_rtgenmsg$(EXEEXT) \ + nlattr_rtmsg$(EXEEXT) nlattr_smc_diag_msg$(EXEEXT) \ + nlattr_tc_stats$(EXEEXT) nlattr_tca_stab$(EXEEXT) \ + nlattr_tcamsg$(EXEEXT) nlattr_tcmsg$(EXEEXT) \ + nlattr_unix_diag_msg$(EXEEXT) old_mmap$(EXEEXT) \ + old_mmap-P$(EXEEXT) old_mmap-Xabbrev$(EXEEXT) \ + old_mmap-Xraw$(EXEEXT) old_mmap-Xverbose$(EXEEXT) \ + old_mmap-v-none$(EXEEXT) oldfstat$(EXEEXT) oldlstat$(EXEEXT) \ + oldselect$(EXEEXT) oldselect-efault$(EXEEXT) oldstat$(EXEEXT) \ + open$(EXEEXT) openat$(EXEEXT) osf_utimes$(EXEEXT) \ + pause$(EXEEXT) perf_event_open$(EXEEXT) personality$(EXEEXT) \ + personality-Xabbrev$(EXEEXT) personality-Xraw$(EXEEXT) \ + personality-Xverbose$(EXEEXT) pidfd_send_signal$(EXEEXT) \ pipe$(EXEEXT) pipe2$(EXEEXT) pkey_alloc$(EXEEXT) \ pkey_free$(EXEEXT) pkey_mprotect$(EXEEXT) poll$(EXEEXT) \ - ppoll$(EXEEXT) prctl-arg2-intptr$(EXEEXT) \ - prctl-dumpable$(EXEEXT) prctl-name$(EXEEXT) \ - prctl-no-args$(EXEEXT) prctl-pdeathsig$(EXEEXT) \ - prctl-seccomp-filter-v$(EXEEXT) prctl-seccomp-strict$(EXEEXT) \ - prctl-securebits$(EXEEXT) prctl-tid_address$(EXEEXT) \ - prctl-tsc$(EXEEXT) pread64-pwrite64$(EXEEXT) preadv$(EXEEXT) \ + poll-P$(EXEEXT) ppoll$(EXEEXT) ppoll-P$(EXEEXT) \ + prctl-arg2-intptr$(EXEEXT) prctl-dumpable$(EXEEXT) \ + prctl-name$(EXEEXT) prctl-no-args$(EXEEXT) \ + prctl-pdeathsig$(EXEEXT) prctl-securebits$(EXEEXT) \ + prctl-tid_address$(EXEEXT) prctl-tsc$(EXEEXT) \ + pread64-pwrite64$(EXEEXT) preadv$(EXEEXT) \ preadv-pwritev$(EXEEXT) preadv2-pwritev2$(EXEEXT) \ - print_maxfd$(EXEEXT) printstr$(EXEEXT) prlimit64$(EXEEXT) \ + printpath-umovestr$(EXEEXT) \ + printpath-umovestr-peekdata$(EXEEXT) \ + printpath-umovestr-undumpable$(EXEEXT) \ + printsignal-Xabbrev$(EXEEXT) printsignal-Xraw$(EXEEXT) \ + printsignal-Xverbose$(EXEEXT) printstr$(EXEEXT) \ + printstrn-umoven$(EXEEXT) printstrn-umoven-peekdata$(EXEEXT) \ + printstrn-umoven-undumpable$(EXEEXT) prlimit64$(EXEEXT) \ process_vm_readv$(EXEEXT) process_vm_writev$(EXEEXT) \ - pselect6$(EXEEXT) ptrace$(EXEEXT) pwritev$(EXEEXT) \ - qual_fault$(EXEEXT) qual_inject-error-signal$(EXEEXT) \ - qual_inject-retval$(EXEEXT) qual_inject-signal$(EXEEXT) \ - qual_signal$(EXEEXT) quotactl$(EXEEXT) quotactl-v$(EXEEXT) \ - quotactl-xfs$(EXEEXT) quotactl-xfs-v$(EXEEXT) \ - read-write$(EXEEXT) readahead$(EXEEXT) readdir$(EXEEXT) \ - readlink$(EXEEXT) readlinkat$(EXEEXT) readv$(EXEEXT) \ - reboot$(EXEEXT) recvfrom$(EXEEXT) recvmmsg-timeout$(EXEEXT) \ - recvmsg$(EXEEXT) redirect-fds$(EXEEXT) \ - remap_file_pages$(EXEEXT) rename$(EXEEXT) renameat$(EXEEXT) \ - renameat2$(EXEEXT) request_key$(EXEEXT) \ - restart_syscall$(EXEEXT) rmdir$(EXEEXT) rt_sigpending$(EXEEXT) \ + pselect6$(EXEEXT) ptrace$(EXEEXT) ptrace_syscall_info$(EXEEXT) \ + pwritev$(EXEEXT) quotactl$(EXEEXT) quotactl-Xabbrev$(EXEEXT) \ + quotactl-Xraw$(EXEEXT) quotactl-Xverbose$(EXEEXT) \ + quotactl-xfs$(EXEEXT) read-write$(EXEEXT) readahead$(EXEEXT) \ + readdir$(EXEEXT) readlink$(EXEEXT) readlinkat$(EXEEXT) \ + readv$(EXEEXT) reboot$(EXEEXT) recvfrom$(EXEEXT) \ + recvmmsg-timeout$(EXEEXT) recvmsg$(EXEEXT) \ + remap_file_pages$(EXEEXT) remap_file_pages-Xabbrev$(EXEEXT) \ + remap_file_pages-Xraw$(EXEEXT) \ + remap_file_pages-Xverbose$(EXEEXT) rename$(EXEEXT) \ + renameat$(EXEEXT) renameat2$(EXEEXT) request_key$(EXEEXT) \ + riscv_flush_icache$(EXEEXT) rmdir$(EXEEXT) \ + rt_sigaction$(EXEEXT) rt_sigpending$(EXEEXT) \ rt_sigprocmask$(EXEEXT) rt_sigqueueinfo$(EXEEXT) \ - rt_sigsuspend$(EXEEXT) rt_sigtimedwait$(EXEEXT) \ - rt_tgsigqueueinfo$(EXEEXT) sched_get_priority_mxx$(EXEEXT) \ - sched_rr_get_interval$(EXEEXT) sched_xetaffinity$(EXEEXT) \ - sched_xetattr$(EXEEXT) sched_xetparam$(EXEEXT) \ - sched_xetscheduler$(EXEEXT) sched_yield$(EXEEXT) \ - scm_rights$(EXEEXT) seccomp-filter$(EXEEXT) \ - seccomp-filter-v$(EXEEXT) seccomp-strict$(EXEEXT) \ - select$(EXEEXT) semop$(EXEEXT) sendfile$(EXEEXT) \ - sendfile64$(EXEEXT) set_mempolicy$(EXEEXT) \ - set_ptracer_any$(EXEEXT) setdomainname$(EXEEXT) \ + rt_sigreturn$(EXEEXT) rt_sigsuspend$(EXEEXT) \ + rt_sigtimedwait$(EXEEXT) rt_tgsigqueueinfo$(EXEEXT) \ + s390_guarded_storage$(EXEEXT) s390_guarded_storage-v$(EXEEXT) \ + s390_pci_mmio_read_write$(EXEEXT) s390_runtime_instr$(EXEEXT) \ + s390_sthyi$(EXEEXT) s390_sthyi-v$(EXEEXT) \ + sched_get_priority_mxx$(EXEEXT) sched_rr_get_interval$(EXEEXT) \ + sched_xetaffinity$(EXEEXT) sched_xetattr$(EXEEXT) \ + sched_xetparam$(EXEEXT) sched_xetscheduler$(EXEEXT) \ + sched_yield$(EXEEXT) seccomp-filter$(EXEEXT) \ + seccomp_get_action_avail$(EXEEXT) select$(EXEEXT) \ + semop$(EXEEXT) sendfile$(EXEEXT) sendfile64$(EXEEXT) \ + set_mempolicy$(EXEEXT) setdomainname$(EXEEXT) \ setfsgid$(EXEEXT) setfsgid32$(EXEEXT) setfsuid$(EXEEXT) \ setfsuid32$(EXEEXT) setgid$(EXEEXT) setgid32$(EXEEXT) \ setgroups$(EXEEXT) setgroups32$(EXEEXT) sethostname$(EXEEXT) \ setns$(EXEEXT) setregid$(EXEEXT) setregid32$(EXEEXT) \ setresgid$(EXEEXT) setresgid32$(EXEEXT) setresuid$(EXEEXT) \ setresuid32$(EXEEXT) setreuid$(EXEEXT) setreuid32$(EXEEXT) \ - setrlimit$(EXEEXT) setuid$(EXEEXT) setuid32$(EXEEXT) \ - shmxt$(EXEEXT) shutdown$(EXEEXT) sigaction$(EXEEXT) \ - sigaltstack$(EXEEXT) siginfo$(EXEEXT) signal_receive$(EXEEXT) \ - signalfd4$(EXEEXT) sigreturn$(EXEEXT) sleep$(EXEEXT) \ - socketcall$(EXEEXT) splice$(EXEEXT) stack-fcall$(EXEEXT) \ - stat$(EXEEXT) stat64$(EXEEXT) statfs$(EXEEXT) \ - statfs64$(EXEEXT) swap$(EXEEXT) symlink$(EXEEXT) \ - symlinkat$(EXEEXT) sync$(EXEEXT) sync_file_range$(EXEEXT) \ + setrlimit$(EXEEXT) setrlimit-Xabbrev$(EXEEXT) \ + setrlimit-Xraw$(EXEEXT) setrlimit-Xverbose$(EXEEXT) \ + setuid$(EXEEXT) setuid32$(EXEEXT) shmxt$(EXEEXT) \ + shutdown$(EXEEXT) sigaction$(EXEEXT) sigaltstack$(EXEEXT) \ + siginfo$(EXEEXT) signal$(EXEEXT) signalfd4$(EXEEXT) \ + sigpending$(EXEEXT) sigprocmask$(EXEEXT) sigreturn$(EXEEXT) \ + sigsuspend$(EXEEXT) so_error$(EXEEXT) so_linger$(EXEEXT) \ + so_peercred$(EXEEXT) so_peercred-Xabbrev$(EXEEXT) \ + so_peercred-Xraw$(EXEEXT) so_peercred-Xverbose$(EXEEXT) \ + sock_filter-v$(EXEEXT) sock_filter-v-Xabbrev$(EXEEXT) \ + sock_filter-v-Xraw$(EXEEXT) sock_filter-v-Xverbose$(EXEEXT) \ + sockaddr_xlat-Xabbrev$(EXEEXT) sockaddr_xlat-Xraw$(EXEEXT) \ + sockaddr_xlat-Xverbose$(EXEEXT) socketcall$(EXEEXT) \ + sockopt-sol_netlink$(EXEEXT) sockopt-timestamp$(EXEEXT) \ + splice$(EXEEXT) stat$(EXEEXT) stat64$(EXEEXT) statfs$(EXEEXT) \ + statfs64$(EXEEXT) statx$(EXEEXT) swap$(EXEEXT) \ + sxetmask$(EXEEXT) symlink$(EXEEXT) symlinkat$(EXEEXT) \ + sync$(EXEEXT) sync_file_range$(EXEEXT) \ sync_file_range2$(EXEEXT) sysinfo$(EXEEXT) syslog$(EXEEXT) \ - tee$(EXEEXT) threads-execve$(EXEEXT) time$(EXEEXT) \ - timer_create$(EXEEXT) timer_xettime$(EXEEXT) \ - timerfd_xettime$(EXEEXT) times$(EXEEXT) times-fail$(EXEEXT) \ - truncate$(EXEEXT) truncate64$(EXEEXT) ugetrlimit$(EXEEXT) \ - uio$(EXEEXT) umask$(EXEEXT) umount$(EXEEXT) umount2$(EXEEXT) \ - umoven-illptr$(EXEEXT) umovestr$(EXEEXT) \ - umovestr-illptr$(EXEEXT) umovestr2$(EXEEXT) umovestr3$(EXEEXT) \ - uname$(EXEEXT) unix-pair-send-recv$(EXEEXT) \ - unix-pair-sendto-recvfrom$(EXEEXT) unlink$(EXEEXT) \ + tee$(EXEEXT) time$(EXEEXT) timer_create$(EXEEXT) \ + timer_xettime$(EXEEXT) timerfd_xettime$(EXEEXT) times$(EXEEXT) \ + times-fail$(EXEEXT) truncate$(EXEEXT) truncate64$(EXEEXT) \ + ugetrlimit$(EXEEXT) uio$(EXEEXT) umask$(EXEEXT) \ + umount$(EXEEXT) umount2$(EXEEXT) umoven-illptr$(EXEEXT) \ + umovestr$(EXEEXT) umovestr-illptr$(EXEEXT) umovestr2$(EXEEXT) \ + umovestr3$(EXEEXT) uname$(EXEEXT) unlink$(EXEEXT) \ unlinkat$(EXEEXT) unshare$(EXEEXT) userfaultfd$(EXEEXT) \ ustat$(EXEEXT) utime$(EXEEXT) utimensat$(EXEEXT) \ - utimes$(EXEEXT) vfork-f$(EXEEXT) vhangup$(EXEEXT) \ - vmsplice$(EXEEXT) wait4$(EXEEXT) wait4-v$(EXEEXT) \ - waitid$(EXEEXT) waitid-v$(EXEEXT) waitpid$(EXEEXT) \ - xattr$(EXEEXT) xattr-strings$(EXEEXT) xet_robust_list$(EXEEXT) \ + utimensat-Xabbrev$(EXEEXT) utimensat-Xraw$(EXEEXT) \ + utimensat-Xverbose$(EXEEXT) utimes$(EXEEXT) vhangup$(EXEEXT) \ + vmsplice$(EXEEXT) wait4$(EXEEXT) waitid$(EXEEXT) \ + waitpid$(EXEEXT) xattr$(EXEEXT) xattr-strings$(EXEEXT) \ + xet_robust_list$(EXEEXT) xet_thread_area_x86$(EXEEXT) \ xetitimer$(EXEEXT) xetpgid$(EXEEXT) xetpriority$(EXEEXT) \ xettimeofday$(EXEEXT) -TESTS = $(DECODER_TESTS) $(MISC_TESTS) $(am__EXEEXT_1) -DIST_COMMON = $(srcdir)/../scno.am $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am $(top_srcdir)/depcomp \ - $(top_srcdir)/test-driver -subdir = tests-m32 -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ - $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ - $(top_srcdir)/m4/ax_valgrind_check.m4 \ - $(top_srcdir)/m4/mpers.m4 \ - $(top_srcdir)/m4/st_save_restore_var.m4 \ - $(top_srcdir)/m4/st_warn_cflags.m4 \ - $(top_srcdir)/m4/warnings.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = AR = ar ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) @@ -296,26 +392,37 @@ am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libtests_a_AR = $(AR) $(ARFLAGS) libtests_a_LIBADD = -am_libtests_a_OBJECTS = libtests_a-errno2name.$(OBJEXT) \ - libtests_a-error_msg.$(OBJEXT) \ +am_libtests_a_OBJECTS = libtests_a-create_nl_socket.$(OBJEXT) \ + libtests_a-errno2name.$(OBJEXT) libtests_a-error_msg.$(OBJEXT) \ libtests_a-fill_memory.$(OBJEXT) \ libtests_a-get_page_size.$(OBJEXT) \ + libtests_a-get_sigset_size.$(OBJEXT) \ libtests_a-hexdump_strdup.$(OBJEXT) \ libtests_a-hexquote_strndup.$(OBJEXT) \ + libtests_a-ifindex.$(OBJEXT) \ libtests_a-inode_of_sockfd.$(OBJEXT) \ libtests_a-libmmsg.$(OBJEXT) \ libtests_a-libsocketcall.$(OBJEXT) \ libtests_a-overflowuid.$(OBJEXT) \ libtests_a-pipe_maxfd.$(OBJEXT) \ libtests_a-print_quoted_string.$(OBJEXT) \ + libtests_a-print_time.$(OBJEXT) \ libtests_a-printflags.$(OBJEXT) libtests_a-printxval.$(OBJEXT) \ - libtests_a-signal2name.$(OBJEXT) libtests_a-sprintrc.$(OBJEXT) \ - libtests_a-tail_alloc.$(OBJEXT) libtests_a-tprintf.$(OBJEXT) + libtests_a-signal2name.$(OBJEXT) \ + libtests_a-skip_unavailable.$(OBJEXT) \ + libtests_a-sprintrc.$(OBJEXT) libtests_a-tail_alloc.$(OBJEXT) \ + libtests_a-test_printpath.$(OBJEXT) \ + libtests_a-test_printstrn.$(OBJEXT) \ + libtests_a-test_ucopy.$(OBJEXT) libtests_a-tprintf.$(OBJEXT) libtests_a_OBJECTS = $(am_libtests_a_OBJECTS) _newselect_SOURCES = _newselect.c _newselect_OBJECTS = _newselect.$(OBJEXT) _newselect_LDADD = $(LDADD) _newselect_DEPENDENCIES = libtests.a +_newselect_P_SOURCES = _newselect-P.c +_newselect_P_OBJECTS = _newselect-P.$(OBJEXT) +_newselect_P_LDADD = $(LDADD) +_newselect_P_DEPENDENCIES = libtests.a accept_SOURCES = accept.c accept_OBJECTS = accept.$(OBJEXT) accept_LDADD = $(LDADD) @@ -344,6 +451,10 @@ aio_SOURCES = aio.c aio_OBJECTS = aio.$(OBJEXT) aio_LDADD = $(LDADD) aio_DEPENDENCIES = libtests.a +aio_pgetevents_SOURCES = aio_pgetevents.c +aio_pgetevents_OBJECTS = aio_pgetevents.$(OBJEXT) +aio_pgetevents_LDADD = $(LDADD) +aio_pgetevents_DEPENDENCIES = libtests.a alarm_SOURCES = alarm.c alarm_OBJECTS = alarm.$(OBJEXT) alarm_LDADD = $(LDADD) @@ -367,10 +478,45 @@ attach_p_cmd_p_SOURCES = attach-p-cmd-p.c attach_p_cmd_p_OBJECTS = attach-p-cmd-p.$(OBJEXT) attach_p_cmd_p_LDADD = $(LDADD) attach_p_cmd_p_DEPENDENCIES = libtests.a +block_reset_raise_run_SOURCES = block_reset_raise_run.c +block_reset_raise_run_OBJECTS = block_reset_raise_run.$(OBJEXT) +block_reset_raise_run_LDADD = $(LDADD) +block_reset_raise_run_DEPENDENCIES = libtests.a bpf_SOURCES = bpf.c bpf_OBJECTS = bpf.$(OBJEXT) bpf_LDADD = $(LDADD) bpf_DEPENDENCIES = libtests.a +bpf_obj_get_info_by_fd_SOURCES = bpf-obj_get_info_by_fd.c +bpf_obj_get_info_by_fd_OBJECTS = bpf-obj_get_info_by_fd.$(OBJEXT) +bpf_obj_get_info_by_fd_LDADD = $(LDADD) +bpf_obj_get_info_by_fd_DEPENDENCIES = libtests.a +bpf_obj_get_info_by_fd_prog_SOURCES = bpf-obj_get_info_by_fd-prog.c +bpf_obj_get_info_by_fd_prog_OBJECTS = \ + bpf-obj_get_info_by_fd-prog.$(OBJEXT) +bpf_obj_get_info_by_fd_prog_LDADD = $(LDADD) +bpf_obj_get_info_by_fd_prog_DEPENDENCIES = libtests.a +bpf_obj_get_info_by_fd_prog_v_SOURCES = \ + bpf-obj_get_info_by_fd-prog-v.c +bpf_obj_get_info_by_fd_prog_v_OBJECTS = \ + bpf-obj_get_info_by_fd-prog-v.$(OBJEXT) +bpf_obj_get_info_by_fd_prog_v_LDADD = $(LDADD) +bpf_obj_get_info_by_fd_prog_v_DEPENDENCIES = libtests.a +bpf_obj_get_info_by_fd_v_SOURCES = bpf-obj_get_info_by_fd-v.c +bpf_obj_get_info_by_fd_v_OBJECTS = bpf-obj_get_info_by_fd-v.$(OBJEXT) +bpf_obj_get_info_by_fd_v_LDADD = $(LDADD) +bpf_obj_get_info_by_fd_v_DEPENDENCIES = libtests.a +bpf_success_SOURCES = bpf-success.c +bpf_success_OBJECTS = bpf-success.$(OBJEXT) +bpf_success_LDADD = $(LDADD) +bpf_success_DEPENDENCIES = libtests.a +bpf_success_v_SOURCES = bpf-success-v.c +bpf_success_v_OBJECTS = bpf-success-v.$(OBJEXT) +bpf_success_v_LDADD = $(LDADD) +bpf_success_v_DEPENDENCIES = libtests.a +bpf_v_SOURCES = bpf-v.c +bpf_v_OBJECTS = bpf-v.$(OBJEXT) +bpf_v_LDADD = $(LDADD) +bpf_v_DEPENDENCIES = libtests.a brk_SOURCES = brk.c brk_OBJECTS = brk.$(OBJEXT) brk_LDADD = $(LDADD) @@ -387,6 +533,14 @@ caps_abbrev_SOURCES = caps-abbrev.c caps_abbrev_OBJECTS = caps-abbrev.$(OBJEXT) caps_abbrev_LDADD = $(LDADD) caps_abbrev_DEPENDENCIES = libtests.a +check_sigblock_SOURCES = check_sigblock.c +check_sigblock_OBJECTS = check_sigblock.$(OBJEXT) +check_sigblock_LDADD = $(LDADD) +check_sigblock_DEPENDENCIES = libtests.a +check_sigign_SOURCES = check_sigign.c +check_sigign_OBJECTS = check_sigign.$(OBJEXT) +check_sigign_LDADD = $(LDADD) +check_sigign_DEPENDENCIES = libtests.a chmod_SOURCES = chmod.c chmod_OBJECTS = chmod.$(OBJEXT) chmod_LDADD = $(LDADD) @@ -413,7 +567,16 @@ clock_nanosleep_LDADD = $(LDADD) clock_nanosleep_DEPENDENCIES = libtests.a clock_xettime_SOURCES = clock_xettime.c clock_xettime_OBJECTS = clock_xettime.$(OBJEXT) -clock_xettime_DEPENDENCIES = $(LDADD) +clock_xettime_LDADD = $(LDADD) +clock_xettime_DEPENDENCIES = libtests.a +clone_parent_SOURCES = clone_parent.c +clone_parent_OBJECTS = clone_parent.$(OBJEXT) +clone_parent_LDADD = $(LDADD) +clone_parent_DEPENDENCIES = libtests.a +clone_ptrace_SOURCES = clone_ptrace.c +clone_ptrace_OBJECTS = clone_ptrace.$(OBJEXT) +clone_ptrace_LDADD = $(LDADD) +clone_ptrace_DEPENDENCIES = libtests.a copy_file_range_SOURCES = copy_file_range.c copy_file_range_OBJECTS = copy_file_range.$(OBJEXT) copy_file_range_LDADD = $(LDADD) @@ -425,10 +588,18 @@ creat_SOURCES = creat.c creat_OBJECTS = creat.$(OBJEXT) creat_LDADD = $(LDADD) creat_DEPENDENCIES = libtests.a +delay_SOURCES = delay.c +delay_OBJECTS = delay.$(OBJEXT) +am__DEPENDENCIES_1 = +delay_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LDADD) delete_module_SOURCES = delete_module.c delete_module_OBJECTS = delete_module.$(OBJEXT) delete_module_LDADD = $(LDADD) delete_module_DEPENDENCIES = libtests.a +dev_yy_SOURCES = dev-yy.c +dev_yy_OBJECTS = dev-yy.$(OBJEXT) +dev_yy_LDADD = $(LDADD) +dev_yy_DEPENDENCIES = libtests.a dup_SOURCES = dup.c dup_OBJECTS = dup.$(OBJEXT) dup_LDADD = $(LDADD) @@ -509,6 +680,18 @@ fanotify_mark_SOURCES = fanotify_mark.c fanotify_mark_OBJECTS = fanotify_mark.$(OBJEXT) fanotify_mark_LDADD = $(LDADD) fanotify_mark_DEPENDENCIES = libtests.a +fanotify_mark_Xabbrev_SOURCES = fanotify_mark-Xabbrev.c +fanotify_mark_Xabbrev_OBJECTS = fanotify_mark-Xabbrev.$(OBJEXT) +fanotify_mark_Xabbrev_LDADD = $(LDADD) +fanotify_mark_Xabbrev_DEPENDENCIES = libtests.a +fanotify_mark_Xraw_SOURCES = fanotify_mark-Xraw.c +fanotify_mark_Xraw_OBJECTS = fanotify_mark-Xraw.$(OBJEXT) +fanotify_mark_Xraw_LDADD = $(LDADD) +fanotify_mark_Xraw_DEPENDENCIES = libtests.a +fanotify_mark_Xverbose_SOURCES = fanotify_mark-Xverbose.c +fanotify_mark_Xverbose_OBJECTS = fanotify_mark-Xverbose.$(OBJEXT) +fanotify_mark_Xverbose_LDADD = $(LDADD) +fanotify_mark_Xverbose_DEPENDENCIES = libtests.a fchdir_SOURCES = fchdir.c fchdir_OBJECTS = fchdir.$(OBJEXT) fchdir_LDADD = $(LDADD) @@ -545,6 +728,10 @@ fdatasync_SOURCES = fdatasync.c fdatasync_OBJECTS = fdatasync.$(OBJEXT) fdatasync_LDADD = $(LDADD) fdatasync_DEPENDENCIES = libtests.a +fflush_SOURCES = fflush.c +fflush_OBJECTS = fflush.$(OBJEXT) +fflush_LDADD = $(LDADD) +fflush_DEPENDENCIES = libtests.a file_handle_SOURCES = file_handle.c file_handle_OBJECTS = file_handle.$(OBJEXT) file_handle_LDADD = $(LDADD) @@ -572,10 +759,34 @@ fstat_SOURCES = fstat.c fstat_OBJECTS = fstat.$(OBJEXT) fstat_LDADD = $(LDADD) fstat_DEPENDENCIES = libtests.a +fstat_Xabbrev_SOURCES = fstat-Xabbrev.c +fstat_Xabbrev_OBJECTS = fstat-Xabbrev.$(OBJEXT) +fstat_Xabbrev_LDADD = $(LDADD) +fstat_Xabbrev_DEPENDENCIES = libtests.a +fstat_Xraw_SOURCES = fstat-Xraw.c +fstat_Xraw_OBJECTS = fstat-Xraw.$(OBJEXT) +fstat_Xraw_LDADD = $(LDADD) +fstat_Xraw_DEPENDENCIES = libtests.a +fstat_Xverbose_SOURCES = fstat-Xverbose.c +fstat_Xverbose_OBJECTS = fstat-Xverbose.$(OBJEXT) +fstat_Xverbose_LDADD = $(LDADD) +fstat_Xverbose_DEPENDENCIES = libtests.a fstat64_SOURCES = fstat64.c fstat64_OBJECTS = fstat64-fstat64.$(OBJEXT) fstat64_LDADD = $(LDADD) fstat64_DEPENDENCIES = libtests.a +fstat64_Xabbrev_SOURCES = fstat64-Xabbrev.c +fstat64_Xabbrev_OBJECTS = fstat64-Xabbrev.$(OBJEXT) +fstat64_Xabbrev_LDADD = $(LDADD) +fstat64_Xabbrev_DEPENDENCIES = libtests.a +fstat64_Xraw_SOURCES = fstat64-Xraw.c +fstat64_Xraw_OBJECTS = fstat64-Xraw.$(OBJEXT) +fstat64_Xraw_LDADD = $(LDADD) +fstat64_Xraw_DEPENDENCIES = libtests.a +fstat64_Xverbose_SOURCES = fstat64-Xverbose.c +fstat64_Xverbose_OBJECTS = fstat64-Xverbose.$(OBJEXT) +fstat64_Xverbose_LDADD = $(LDADD) +fstat64_Xverbose_DEPENDENCIES = libtests.a fstatat64_SOURCES = fstatat64.c fstatat64_OBJECTS = fstatat64-fstatat64.$(OBJEXT) fstatat64_LDADD = $(LDADD) @@ -592,6 +803,10 @@ fsync_SOURCES = fsync.c fsync_OBJECTS = fsync.$(OBJEXT) fsync_LDADD = $(LDADD) fsync_DEPENDENCIES = libtests.a +fsync_y_SOURCES = fsync-y.c +fsync_y_OBJECTS = fsync-y.$(OBJEXT) +fsync_y_LDADD = $(LDADD) +fsync_y_DEPENDENCIES = libtests.a ftruncate_SOURCES = ftruncate.c ftruncate_OBJECTS = ftruncate.$(OBJEXT) ftruncate_LDADD = $(LDADD) @@ -668,6 +883,14 @@ getpgrp_SOURCES = getpgrp.c getpgrp_OBJECTS = getpgrp.$(OBJEXT) getpgrp_LDADD = $(LDADD) getpgrp_DEPENDENCIES = libtests.a +getpid_SOURCES = getpid.c +getpid_OBJECTS = getpid.$(OBJEXT) +getpid_LDADD = $(LDADD) +getpid_DEPENDENCIES = libtests.a +getppid_SOURCES = getppid.c +getppid_OBJECTS = getppid.$(OBJEXT) +getppid_LDADD = $(LDADD) +getppid_DEPENDENCIES = libtests.a getrandom_SOURCES = getrandom.c getrandom_OBJECTS = getrandom.$(OBJEXT) getrandom_LDADD = $(LDADD) @@ -704,6 +927,10 @@ getsockname_SOURCES = getsockname.c getsockname_OBJECTS = getsockname.$(OBJEXT) getsockname_LDADD = $(LDADD) getsockname_DEPENDENCIES = libtests.a +gettid_SOURCES = gettid.c +gettid_OBJECTS = gettid.$(OBJEXT) +gettid_LDADD = $(LDADD) +gettid_DEPENDENCIES = libtests.a getuid_SOURCES = getuid.c getuid_OBJECTS = getuid.$(OBJEXT) getuid_LDADD = $(LDADD) @@ -716,6 +943,10 @@ getxxid_SOURCES = getxxid.c getxxid_OBJECTS = getxxid.$(OBJEXT) getxxid_LDADD = $(LDADD) getxxid_DEPENDENCIES = libtests.a +group_req_SOURCES = group_req.c +group_req_OBJECTS = group_req.$(OBJEXT) +group_req_LDADD = $(LDADD) +group_req_DEPENDENCIES = libtests.a inet_cmsg_SOURCES = inet-cmsg.c inet_cmsg_OBJECTS = inet-cmsg.$(OBJEXT) inet_cmsg_LDADD = $(LDADD) @@ -724,6 +955,10 @@ init_module_SOURCES = init_module.c init_module_OBJECTS = init_module.$(OBJEXT) init_module_LDADD = $(LDADD) init_module_DEPENDENCIES = libtests.a +inject_nf_SOURCES = inject-nf.c +inject_nf_OBJECTS = inject-nf.$(OBJEXT) +inject_nf_LDADD = $(LDADD) +inject_nf_DEPENDENCIES = libtests.a inotify_SOURCES = inotify.c inotify_OBJECTS = inotify.$(OBJEXT) inotify_LDADD = $(LDADD) @@ -732,6 +967,22 @@ inotify_init1_SOURCES = inotify_init1.c inotify_init1_OBJECTS = inotify_init1.$(OBJEXT) inotify_init1_LDADD = $(LDADD) inotify_init1_DEPENDENCIES = libtests.a +int_0x80_SOURCES = int_0x80.c +int_0x80_OBJECTS = int_0x80.$(OBJEXT) +int_0x80_LDADD = $(LDADD) +int_0x80_DEPENDENCIES = libtests.a +io_uring_enter_SOURCES = io_uring_enter.c +io_uring_enter_OBJECTS = io_uring_enter.$(OBJEXT) +io_uring_enter_LDADD = $(LDADD) +io_uring_enter_DEPENDENCIES = libtests.a +io_uring_register_SOURCES = io_uring_register.c +io_uring_register_OBJECTS = io_uring_register.$(OBJEXT) +io_uring_register_LDADD = $(LDADD) +io_uring_register_DEPENDENCIES = libtests.a +io_uring_setup_SOURCES = io_uring_setup.c +io_uring_setup_OBJECTS = io_uring_setup.$(OBJEXT) +io_uring_setup_LDADD = $(LDADD) +io_uring_setup_DEPENDENCIES = libtests.a ioctl_SOURCES = ioctl.c ioctl_OBJECTS = ioctl.$(OBJEXT) ioctl_LDADD = $(LDADD) @@ -752,10 +1003,35 @@ ioctl_evdev_SOURCES = ioctl_evdev.c ioctl_evdev_OBJECTS = ioctl_evdev.$(OBJEXT) ioctl_evdev_LDADD = $(LDADD) ioctl_evdev_DEPENDENCIES = libtests.a +ioctl_evdev_success_SOURCES = ioctl_evdev-success.c +ioctl_evdev_success_OBJECTS = ioctl_evdev-success.$(OBJEXT) +ioctl_evdev_success_LDADD = $(LDADD) +ioctl_evdev_success_DEPENDENCIES = libtests.a +ioctl_evdev_success_v_SOURCES = ioctl_evdev-success-v.c +ioctl_evdev_success_v_OBJECTS = ioctl_evdev-success-v.$(OBJEXT) +ioctl_evdev_success_v_LDADD = $(LDADD) +ioctl_evdev_success_v_DEPENDENCIES = libtests.a ioctl_evdev_v_SOURCES = ioctl_evdev-v.c ioctl_evdev_v_OBJECTS = ioctl_evdev-v.$(OBJEXT) ioctl_evdev_v_LDADD = $(LDADD) ioctl_evdev_v_DEPENDENCIES = libtests.a +ioctl_inotify_SOURCES = ioctl_inotify.c +ioctl_inotify_OBJECTS = ioctl_inotify.$(OBJEXT) +ioctl_inotify_LDADD = $(LDADD) +ioctl_inotify_DEPENDENCIES = libtests.a +ioctl_kvm_run_SOURCES = ioctl_kvm_run.c +ioctl_kvm_run_OBJECTS = ioctl_kvm_run.$(OBJEXT) +ioctl_kvm_run_LDADD = $(LDADD) +ioctl_kvm_run_DEPENDENCIES = libtests.a +ioctl_kvm_run_v_SOURCES = ioctl_kvm_run-v.c +ioctl_kvm_run_v_OBJECTS = ioctl_kvm_run-v.$(OBJEXT) +ioctl_kvm_run_v_LDADD = $(LDADD) +ioctl_kvm_run_v_DEPENDENCIES = libtests.a +ioctl_kvm_run_auxstr_vcpu_SOURCES = ioctl_kvm_run_auxstr_vcpu.c +ioctl_kvm_run_auxstr_vcpu_OBJECTS = \ + ioctl_kvm_run_auxstr_vcpu.$(OBJEXT) +ioctl_kvm_run_auxstr_vcpu_LDADD = $(LDADD) +ioctl_kvm_run_auxstr_vcpu_DEPENDENCIES = libtests.a ioctl_loop_SOURCES = ioctl_loop.c ioctl_loop_OBJECTS = ioctl_loop.$(OBJEXT) ioctl_loop_LDADD = $(LDADD) @@ -772,6 +1048,30 @@ ioctl_mtd_SOURCES = ioctl_mtd.c ioctl_mtd_OBJECTS = ioctl_mtd.$(OBJEXT) ioctl_mtd_LDADD = $(LDADD) ioctl_mtd_DEPENDENCIES = libtests.a +ioctl_nbd_SOURCES = ioctl_nbd.c +ioctl_nbd_OBJECTS = ioctl_nbd.$(OBJEXT) +ioctl_nbd_LDADD = $(LDADD) +ioctl_nbd_DEPENDENCIES = libtests.a +ioctl_nsfs_SOURCES = ioctl_nsfs.c +ioctl_nsfs_OBJECTS = ioctl_nsfs.$(OBJEXT) +ioctl_nsfs_LDADD = $(LDADD) +ioctl_nsfs_DEPENDENCIES = libtests.a +ioctl_perf_SOURCES = ioctl_perf.c +ioctl_perf_OBJECTS = ioctl_perf.$(OBJEXT) +ioctl_perf_LDADD = $(LDADD) +ioctl_perf_DEPENDENCIES = libtests.a +ioctl_perf_success_SOURCES = ioctl_perf-success.c +ioctl_perf_success_OBJECTS = ioctl_perf-success.$(OBJEXT) +ioctl_perf_success_LDADD = $(LDADD) +ioctl_perf_success_DEPENDENCIES = libtests.a +ioctl_ptp_SOURCES = ioctl_ptp.c +ioctl_ptp_OBJECTS = ioctl_ptp.$(OBJEXT) +ioctl_ptp_LDADD = $(LDADD) +ioctl_ptp_DEPENDENCIES = libtests.a +ioctl_random_SOURCES = ioctl_random.c +ioctl_random_OBJECTS = ioctl_random.$(OBJEXT) +ioctl_random_LDADD = $(LDADD) +ioctl_random_DEPENDENCIES = libtests.a ioctl_rtc_SOURCES = ioctl_rtc.c ioctl_rtc_OBJECTS = ioctl_rtc.$(OBJEXT) ioctl_rtc_LDADD = $(LDADD) @@ -816,6 +1116,18 @@ ioprio_SOURCES = ioprio.c ioprio_OBJECTS = ioprio.$(OBJEXT) ioprio_LDADD = $(LDADD) ioprio_DEPENDENCIES = libtests.a +ioprio_Xabbrev_SOURCES = ioprio-Xabbrev.c +ioprio_Xabbrev_OBJECTS = ioprio-Xabbrev.$(OBJEXT) +ioprio_Xabbrev_LDADD = $(LDADD) +ioprio_Xabbrev_DEPENDENCIES = libtests.a +ioprio_Xraw_SOURCES = ioprio-Xraw.c +ioprio_Xraw_OBJECTS = ioprio-Xraw.$(OBJEXT) +ioprio_Xraw_LDADD = $(LDADD) +ioprio_Xraw_DEPENDENCIES = libtests.a +ioprio_Xverbose_SOURCES = ioprio-Xverbose.c +ioprio_Xverbose_OBJECTS = ioprio-Xverbose.$(OBJEXT) +ioprio_Xverbose_LDADD = $(LDADD) +ioprio_Xverbose_DEPENDENCIES = libtests.a ip_mreq_SOURCES = ip_mreq.c ip_mreq_OBJECTS = ip_mreq.$(OBJEXT) ip_mreq_LDADD = $(LDADD) @@ -828,22 +1140,98 @@ ipc_msg_SOURCES = ipc_msg.c ipc_msg_OBJECTS = ipc_msg.$(OBJEXT) ipc_msg_LDADD = $(LDADD) ipc_msg_DEPENDENCIES = libtests.a +ipc_msg_Xabbrev_SOURCES = ipc_msg-Xabbrev.c +ipc_msg_Xabbrev_OBJECTS = ipc_msg-Xabbrev.$(OBJEXT) +ipc_msg_Xabbrev_LDADD = $(LDADD) +ipc_msg_Xabbrev_DEPENDENCIES = libtests.a +ipc_msg_Xraw_SOURCES = ipc_msg-Xraw.c +ipc_msg_Xraw_OBJECTS = ipc_msg-Xraw.$(OBJEXT) +ipc_msg_Xraw_LDADD = $(LDADD) +ipc_msg_Xraw_DEPENDENCIES = libtests.a +ipc_msg_Xverbose_SOURCES = ipc_msg-Xverbose.c +ipc_msg_Xverbose_OBJECTS = ipc_msg-Xverbose.$(OBJEXT) +ipc_msg_Xverbose_LDADD = $(LDADD) +ipc_msg_Xverbose_DEPENDENCIES = libtests.a ipc_msgbuf_SOURCES = ipc_msgbuf.c ipc_msgbuf_OBJECTS = ipc_msgbuf.$(OBJEXT) ipc_msgbuf_LDADD = $(LDADD) ipc_msgbuf_DEPENDENCIES = libtests.a +ipc_msgbuf_Xabbrev_SOURCES = ipc_msgbuf-Xabbrev.c +ipc_msgbuf_Xabbrev_OBJECTS = ipc_msgbuf-Xabbrev.$(OBJEXT) +ipc_msgbuf_Xabbrev_LDADD = $(LDADD) +ipc_msgbuf_Xabbrev_DEPENDENCIES = libtests.a +ipc_msgbuf_Xraw_SOURCES = ipc_msgbuf-Xraw.c +ipc_msgbuf_Xraw_OBJECTS = ipc_msgbuf-Xraw.$(OBJEXT) +ipc_msgbuf_Xraw_LDADD = $(LDADD) +ipc_msgbuf_Xraw_DEPENDENCIES = libtests.a +ipc_msgbuf_Xverbose_SOURCES = ipc_msgbuf-Xverbose.c +ipc_msgbuf_Xverbose_OBJECTS = ipc_msgbuf-Xverbose.$(OBJEXT) +ipc_msgbuf_Xverbose_LDADD = $(LDADD) +ipc_msgbuf_Xverbose_DEPENDENCIES = libtests.a ipc_sem_SOURCES = ipc_sem.c ipc_sem_OBJECTS = ipc_sem.$(OBJEXT) ipc_sem_LDADD = $(LDADD) ipc_sem_DEPENDENCIES = libtests.a +ipc_sem_Xabbrev_SOURCES = ipc_sem-Xabbrev.c +ipc_sem_Xabbrev_OBJECTS = ipc_sem-Xabbrev.$(OBJEXT) +ipc_sem_Xabbrev_LDADD = $(LDADD) +ipc_sem_Xabbrev_DEPENDENCIES = libtests.a +ipc_sem_Xraw_SOURCES = ipc_sem-Xraw.c +ipc_sem_Xraw_OBJECTS = ipc_sem-Xraw.$(OBJEXT) +ipc_sem_Xraw_LDADD = $(LDADD) +ipc_sem_Xraw_DEPENDENCIES = libtests.a +ipc_sem_Xverbose_SOURCES = ipc_sem-Xverbose.c +ipc_sem_Xverbose_OBJECTS = ipc_sem-Xverbose.$(OBJEXT) +ipc_sem_Xverbose_LDADD = $(LDADD) +ipc_sem_Xverbose_DEPENDENCIES = libtests.a ipc_shm_SOURCES = ipc_shm.c ipc_shm_OBJECTS = ipc_shm.$(OBJEXT) ipc_shm_LDADD = $(LDADD) ipc_shm_DEPENDENCIES = libtests.a +ipc_shm_Xabbrev_SOURCES = ipc_shm-Xabbrev.c +ipc_shm_Xabbrev_OBJECTS = ipc_shm-Xabbrev.$(OBJEXT) +ipc_shm_Xabbrev_LDADD = $(LDADD) +ipc_shm_Xabbrev_DEPENDENCIES = libtests.a +ipc_shm_Xraw_SOURCES = ipc_shm-Xraw.c +ipc_shm_Xraw_OBJECTS = ipc_shm-Xraw.$(OBJEXT) +ipc_shm_Xraw_LDADD = $(LDADD) +ipc_shm_Xraw_DEPENDENCIES = libtests.a +ipc_shm_Xverbose_SOURCES = ipc_shm-Xverbose.c +ipc_shm_Xverbose_OBJECTS = ipc_shm-Xverbose.$(OBJEXT) +ipc_shm_Xverbose_LDADD = $(LDADD) +ipc_shm_Xverbose_DEPENDENCIES = libtests.a +is_linux_mips_n64_SOURCES = is_linux_mips_n64.c +is_linux_mips_n64_OBJECTS = is_linux_mips_n64.$(OBJEXT) +is_linux_mips_n64_LDADD = $(LDADD) +is_linux_mips_n64_DEPENDENCIES = libtests.a kcmp_SOURCES = kcmp.c kcmp_OBJECTS = kcmp.$(OBJEXT) kcmp_LDADD = $(LDADD) kcmp_DEPENDENCIES = libtests.a +kcmp_y_SOURCES = kcmp-y.c +kcmp_y_OBJECTS = kcmp-y.$(OBJEXT) +kcmp_y_LDADD = $(LDADD) +kcmp_y_DEPENDENCIES = libtests.a +kern_features_SOURCES = kern_features.c +kern_features_OBJECTS = kern_features.$(OBJEXT) +kern_features_LDADD = $(LDADD) +kern_features_DEPENDENCIES = libtests.a +kernel_version_SOURCES = kernel_version.c +kernel_version_OBJECTS = kernel_version.$(OBJEXT) +kernel_version_LDADD = $(LDADD) +kernel_version_DEPENDENCIES = libtests.a +kernel_version_Xabbrev_SOURCES = kernel_version-Xabbrev.c +kernel_version_Xabbrev_OBJECTS = kernel_version-Xabbrev.$(OBJEXT) +kernel_version_Xabbrev_LDADD = $(LDADD) +kernel_version_Xabbrev_DEPENDENCIES = libtests.a +kernel_version_Xraw_SOURCES = kernel_version-Xraw.c +kernel_version_Xraw_OBJECTS = kernel_version-Xraw.$(OBJEXT) +kernel_version_Xraw_LDADD = $(LDADD) +kernel_version_Xraw_DEPENDENCIES = libtests.a +kernel_version_Xverbose_SOURCES = kernel_version-Xverbose.c +kernel_version_Xverbose_OBJECTS = kernel_version-Xverbose.$(OBJEXT) +kernel_version_Xverbose_LDADD = $(LDADD) +kernel_version_Xverbose_DEPENDENCIES = libtests.a kexec_file_load_SOURCES = kexec_file_load.c kexec_file_load_OBJECTS = kexec_file_load.$(OBJEXT) kexec_file_load_LDADD = $(LDADD) @@ -856,10 +1244,26 @@ keyctl_SOURCES = keyctl.c keyctl_OBJECTS = keyctl.$(OBJEXT) keyctl_LDADD = $(LDADD) keyctl_DEPENDENCIES = libtests.a +keyctl_Xabbrev_SOURCES = keyctl-Xabbrev.c +keyctl_Xabbrev_OBJECTS = keyctl-Xabbrev.$(OBJEXT) +keyctl_Xabbrev_LDADD = $(LDADD) +keyctl_Xabbrev_DEPENDENCIES = libtests.a +keyctl_Xraw_SOURCES = keyctl-Xraw.c +keyctl_Xraw_OBJECTS = keyctl-Xraw.$(OBJEXT) +keyctl_Xraw_LDADD = $(LDADD) +keyctl_Xraw_DEPENDENCIES = libtests.a +keyctl_Xverbose_SOURCES = keyctl-Xverbose.c +keyctl_Xverbose_OBJECTS = keyctl-Xverbose.$(OBJEXT) +keyctl_Xverbose_LDADD = $(LDADD) +keyctl_Xverbose_DEPENDENCIES = libtests.a kill_SOURCES = kill.c kill_OBJECTS = kill.$(OBJEXT) kill_LDADD = $(LDADD) kill_DEPENDENCIES = libtests.a +kill_child_SOURCES = kill_child.c +kill_child_OBJECTS = kill_child.$(OBJEXT) +kill_child_LDADD = $(LDADD) +kill_child_DEPENDENCIES = libtests.a ksysent_SOURCES = ksysent.c ksysent_OBJECTS = ksysent.$(OBJEXT) ksysent_LDADD = $(LDADD) @@ -880,14 +1284,24 @@ linkat_SOURCES = linkat.c linkat_OBJECTS = linkat.$(OBJEXT) linkat_LDADD = $(LDADD) linkat_DEPENDENCIES = libtests.a +list_sigaction_signum_SOURCES = list_sigaction_signum.c +list_sigaction_signum_OBJECTS = list_sigaction_signum.$(OBJEXT) +list_sigaction_signum_LDADD = $(LDADD) +list_sigaction_signum_DEPENDENCIES = libtests.a llseek_SOURCES = llseek.c llseek_OBJECTS = llseek.$(OBJEXT) llseek_LDADD = $(LDADD) llseek_DEPENDENCIES = libtests.a +localtime_SOURCES = localtime.c +localtime_OBJECTS = localtime.$(OBJEXT) +localtime_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LDADD) lookup_dcookie_SOURCES = lookup_dcookie.c lookup_dcookie_OBJECTS = lookup_dcookie.$(OBJEXT) lookup_dcookie_LDADD = $(LDADD) lookup_dcookie_DEPENDENCIES = libtests.a +looping_threads_SOURCES = looping_threads.c +looping_threads_OBJECTS = looping_threads.$(OBJEXT) +looping_threads_DEPENDENCIES = $(LDADD) lseek_SOURCES = lseek.c lseek_OBJECTS = lseek.$(OBJEXT) lseek_LDADD = $(LDADD) @@ -900,6 +1314,10 @@ lstat64_SOURCES = lstat64.c lstat64_OBJECTS = lstat64-lstat64.$(OBJEXT) lstat64_LDADD = $(LDADD) lstat64_DEPENDENCIES = libtests.a +madvise_SOURCES = madvise.c +madvise_OBJECTS = madvise.$(OBJEXT) +madvise_LDADD = $(LDADD) +madvise_DEPENDENCIES = libtests.a mbind_SOURCES = mbind.c mbind_OBJECTS = mbind.$(OBJEXT) mbind_LDADD = $(LDADD) @@ -912,6 +1330,18 @@ memfd_create_SOURCES = memfd_create.c memfd_create_OBJECTS = memfd_create.$(OBJEXT) memfd_create_LDADD = $(LDADD) memfd_create_DEPENDENCIES = libtests.a +memfd_create_Xabbrev_SOURCES = memfd_create-Xabbrev.c +memfd_create_Xabbrev_OBJECTS = memfd_create-Xabbrev.$(OBJEXT) +memfd_create_Xabbrev_LDADD = $(LDADD) +memfd_create_Xabbrev_DEPENDENCIES = libtests.a +memfd_create_Xraw_SOURCES = memfd_create-Xraw.c +memfd_create_Xraw_OBJECTS = memfd_create-Xraw.$(OBJEXT) +memfd_create_Xraw_LDADD = $(LDADD) +memfd_create_Xraw_DEPENDENCIES = libtests.a +memfd_create_Xverbose_SOURCES = memfd_create-Xverbose.c +memfd_create_Xverbose_OBJECTS = memfd_create-Xverbose.$(OBJEXT) +memfd_create_Xverbose_LDADD = $(LDADD) +memfd_create_Xverbose_DEPENDENCIES = libtests.a migrate_pages_SOURCES = migrate_pages.c migrate_pages_OBJECTS = migrate_pages.$(OBJEXT) migrate_pages_LDADD = $(LDADD) @@ -952,10 +1382,34 @@ mmap_SOURCES = mmap.c mmap_OBJECTS = mmap.$(OBJEXT) mmap_LDADD = $(LDADD) mmap_DEPENDENCIES = libtests.a +mmap_Xabbrev_SOURCES = mmap-Xabbrev.c +mmap_Xabbrev_OBJECTS = mmap-Xabbrev.$(OBJEXT) +mmap_Xabbrev_LDADD = $(LDADD) +mmap_Xabbrev_DEPENDENCIES = libtests.a +mmap_Xraw_SOURCES = mmap-Xraw.c +mmap_Xraw_OBJECTS = mmap-Xraw.$(OBJEXT) +mmap_Xraw_LDADD = $(LDADD) +mmap_Xraw_DEPENDENCIES = libtests.a +mmap_Xverbose_SOURCES = mmap-Xverbose.c +mmap_Xverbose_OBJECTS = mmap-Xverbose.$(OBJEXT) +mmap_Xverbose_LDADD = $(LDADD) +mmap_Xverbose_DEPENDENCIES = libtests.a mmap64_SOURCES = mmap64.c mmap64_OBJECTS = mmap64-mmap64.$(OBJEXT) mmap64_LDADD = $(LDADD) mmap64_DEPENDENCIES = libtests.a +mmap64_Xabbrev_SOURCES = mmap64-Xabbrev.c +mmap64_Xabbrev_OBJECTS = mmap64_Xabbrev-mmap64-Xabbrev.$(OBJEXT) +mmap64_Xabbrev_LDADD = $(LDADD) +mmap64_Xabbrev_DEPENDENCIES = libtests.a +mmap64_Xraw_SOURCES = mmap64-Xraw.c +mmap64_Xraw_OBJECTS = mmap64_Xraw-mmap64-Xraw.$(OBJEXT) +mmap64_Xraw_LDADD = $(LDADD) +mmap64_Xraw_DEPENDENCIES = libtests.a +mmap64_Xverbose_SOURCES = mmap64-Xverbose.c +mmap64_Xverbose_OBJECTS = mmap64_Xverbose-mmap64-Xverbose.$(OBJEXT) +mmap64_Xverbose_LDADD = $(LDADD) +mmap64_Xverbose_DEPENDENCIES = libtests.a mmsg_SOURCES = mmsg.c mmsg_OBJECTS = mmsg.$(OBJEXT) mmsg_LDADD = $(LDADD) @@ -972,26 +1426,57 @@ mmsg_name_v_SOURCES = mmsg_name-v.c mmsg_name_v_OBJECTS = mmsg_name-v.$(OBJEXT) mmsg_name_v_LDADD = $(LDADD) mmsg_name_v_DEPENDENCIES = libtests.a +modify_ldt_SOURCES = modify_ldt.c +modify_ldt_OBJECTS = modify_ldt.$(OBJEXT) +modify_ldt_LDADD = $(LDADD) +modify_ldt_DEPENDENCIES = libtests.a mount_SOURCES = mount.c mount_OBJECTS = mount.$(OBJEXT) mount_LDADD = $(LDADD) mount_DEPENDENCIES = libtests.a +mount_Xabbrev_SOURCES = mount-Xabbrev.c +mount_Xabbrev_OBJECTS = mount-Xabbrev.$(OBJEXT) +mount_Xabbrev_LDADD = $(LDADD) +mount_Xabbrev_DEPENDENCIES = libtests.a +mount_Xraw_SOURCES = mount-Xraw.c +mount_Xraw_OBJECTS = mount-Xraw.$(OBJEXT) +mount_Xraw_LDADD = $(LDADD) +mount_Xraw_DEPENDENCIES = libtests.a +mount_Xverbose_SOURCES = mount-Xverbose.c +mount_Xverbose_OBJECTS = mount-Xverbose.$(OBJEXT) +mount_Xverbose_LDADD = $(LDADD) +mount_Xverbose_DEPENDENCIES = libtests.a move_pages_SOURCES = move_pages.c move_pages_OBJECTS = move_pages.$(OBJEXT) move_pages_LDADD = $(LDADD) move_pages_DEPENDENCIES = libtests.a +move_pages_Xabbrev_SOURCES = move_pages-Xabbrev.c +move_pages_Xabbrev_OBJECTS = move_pages-Xabbrev.$(OBJEXT) +move_pages_Xabbrev_LDADD = $(LDADD) +move_pages_Xabbrev_DEPENDENCIES = libtests.a +move_pages_Xraw_SOURCES = move_pages-Xraw.c +move_pages_Xraw_OBJECTS = move_pages-Xraw.$(OBJEXT) +move_pages_Xraw_LDADD = $(LDADD) +move_pages_Xraw_DEPENDENCIES = libtests.a +move_pages_Xverbose_SOURCES = move_pages-Xverbose.c +move_pages_Xverbose_OBJECTS = move_pages-Xverbose.$(OBJEXT) +move_pages_Xverbose_LDADD = $(LDADD) +move_pages_Xverbose_DEPENDENCIES = libtests.a mq_SOURCES = mq.c mq_OBJECTS = mq.$(OBJEXT) -mq_DEPENDENCIES = $(LDADD) +mq_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LDADD) mq_sendrecv_SOURCES = mq_sendrecv.c mq_sendrecv_OBJECTS = mq_sendrecv.$(OBJEXT) -mq_sendrecv_DEPENDENCIES = $(LDADD) +mq_sendrecv_LDADD = $(LDADD) +mq_sendrecv_DEPENDENCIES = libtests.a mq_sendrecv_read_SOURCES = mq_sendrecv-read.c mq_sendrecv_read_OBJECTS = mq_sendrecv-read.$(OBJEXT) -mq_sendrecv_read_DEPENDENCIES = $(LDADD) +mq_sendrecv_read_LDADD = $(LDADD) +mq_sendrecv_read_DEPENDENCIES = libtests.a mq_sendrecv_write_SOURCES = mq_sendrecv-write.c mq_sendrecv_write_OBJECTS = mq_sendrecv-write.$(OBJEXT) -mq_sendrecv_write_DEPENDENCIES = $(LDADD) +mq_sendrecv_write_LDADD = $(LDADD) +mq_sendrecv_write_DEPENDENCIES = libtests.a msg_control_SOURCES = msg_control.c msg_control_OBJECTS = msg_control.$(OBJEXT) msg_control_LDADD = $(LDADD) @@ -1020,10 +1505,39 @@ net_icmp_filter_SOURCES = net-icmp_filter.c net_icmp_filter_OBJECTS = net-icmp_filter.$(OBJEXT) net_icmp_filter_LDADD = $(LDADD) net_icmp_filter_DEPENDENCIES = libtests.a +net_packet_mreq_SOURCES = net-packet_mreq.c +net_packet_mreq_OBJECTS = net-packet_mreq.$(OBJEXT) +net_packet_mreq_LDADD = $(LDADD) +net_packet_mreq_DEPENDENCIES = libtests.a +net_packet_mreq_Xabbrev_SOURCES = net-packet_mreq-Xabbrev.c +net_packet_mreq_Xabbrev_OBJECTS = net-packet_mreq-Xabbrev.$(OBJEXT) +net_packet_mreq_Xabbrev_LDADD = $(LDADD) +net_packet_mreq_Xabbrev_DEPENDENCIES = libtests.a +net_packet_mreq_Xraw_SOURCES = net-packet_mreq-Xraw.c +net_packet_mreq_Xraw_OBJECTS = net-packet_mreq-Xraw.$(OBJEXT) +net_packet_mreq_Xraw_LDADD = $(LDADD) +net_packet_mreq_Xraw_DEPENDENCIES = libtests.a +net_packet_mreq_Xverbose_SOURCES = net-packet_mreq-Xverbose.c +net_packet_mreq_Xverbose_OBJECTS = net-packet_mreq-Xverbose.$(OBJEXT) +net_packet_mreq_Xverbose_LDADD = $(LDADD) +net_packet_mreq_Xverbose_DEPENDENCIES = libtests.a net_sockaddr_SOURCES = net-sockaddr.c net_sockaddr_OBJECTS = net-sockaddr.$(OBJEXT) net_sockaddr_LDADD = $(LDADD) net_sockaddr_DEPENDENCIES = libtests.a +net_tpacket_req_SOURCES = net-tpacket_req.c +net_tpacket_req_OBJECTS = net-tpacket_req.$(OBJEXT) +net_tpacket_req_LDADD = $(LDADD) +net_tpacket_req_DEPENDENCIES = libtests.a +net_tpacket_stats_SOURCES = net-tpacket_stats.c +net_tpacket_stats_OBJECTS = net-tpacket_stats.$(OBJEXT) +net_tpacket_stats_LDADD = $(LDADD) +net_tpacket_stats_DEPENDENCIES = libtests.a +net_tpacket_stats_success_SOURCES = net-tpacket_stats-success.c +net_tpacket_stats_success_OBJECTS = \ + net-tpacket_stats-success.$(OBJEXT) +net_tpacket_stats_success_LDADD = $(LDADD) +net_tpacket_stats_success_DEPENDENCIES = libtests.a net_y_unix_SOURCES = net-y-unix.c net_y_unix_OBJECTS = net-y-unix.$(OBJEXT) net_y_unix_LDADD = $(LDADD) @@ -1032,6 +1546,10 @@ net_yy_inet_SOURCES = net-yy-inet.c net_yy_inet_OBJECTS = net-yy-inet.$(OBJEXT) net_yy_inet_LDADD = $(LDADD) net_yy_inet_DEPENDENCIES = libtests.a +net_yy_inet6_SOURCES = net-yy-inet6.c +net_yy_inet6_OBJECTS = net-yy-inet6.$(OBJEXT) +net_yy_inet6_LDADD = $(LDADD) +net_yy_inet6_DEPENDENCIES = libtests.a net_yy_netlink_SOURCES = net-yy-netlink.c net_yy_netlink_OBJECTS = net-yy-netlink.$(OBJEXT) net_yy_netlink_LDADD = $(LDADD) @@ -1040,10 +1558,30 @@ net_yy_unix_SOURCES = net-yy-unix.c net_yy_unix_OBJECTS = net-yy-unix.$(OBJEXT) net_yy_unix_LDADD = $(LDADD) net_yy_unix_DEPENDENCIES = libtests.a +netlink_audit_SOURCES = netlink_audit.c +netlink_audit_OBJECTS = netlink_audit.$(OBJEXT) +netlink_audit_LDADD = $(LDADD) +netlink_audit_DEPENDENCIES = libtests.a +netlink_crypto_SOURCES = netlink_crypto.c +netlink_crypto_OBJECTS = netlink_crypto.$(OBJEXT) +netlink_crypto_LDADD = $(LDADD) +netlink_crypto_DEPENDENCIES = libtests.a +netlink_generic_SOURCES = netlink_generic.c +netlink_generic_OBJECTS = netlink_generic.$(OBJEXT) +netlink_generic_LDADD = $(LDADD) +netlink_generic_DEPENDENCIES = libtests.a netlink_inet_diag_SOURCES = netlink_inet_diag.c netlink_inet_diag_OBJECTS = netlink_inet_diag.$(OBJEXT) netlink_inet_diag_LDADD = $(LDADD) netlink_inet_diag_DEPENDENCIES = libtests.a +netlink_kobject_uevent_SOURCES = netlink_kobject_uevent.c +netlink_kobject_uevent_OBJECTS = netlink_kobject_uevent.$(OBJEXT) +netlink_kobject_uevent_LDADD = $(LDADD) +netlink_kobject_uevent_DEPENDENCIES = libtests.a +netlink_netfilter_SOURCES = netlink_netfilter.c +netlink_netfilter_OBJECTS = netlink_netfilter.$(OBJEXT) +netlink_netfilter_LDADD = $(LDADD) +netlink_netfilter_DEPENDENCIES = libtests.a netlink_netlink_diag_SOURCES = netlink_netlink_diag.c netlink_netlink_diag_OBJECTS = netlink_netlink_diag.$(OBJEXT) netlink_netlink_diag_LDADD = $(LDADD) @@ -1052,22 +1590,235 @@ netlink_protocol_SOURCES = netlink_protocol.c netlink_protocol_OBJECTS = netlink_protocol.$(OBJEXT) netlink_protocol_LDADD = $(LDADD) netlink_protocol_DEPENDENCIES = libtests.a +netlink_route_SOURCES = netlink_route.c +netlink_route_OBJECTS = netlink_route.$(OBJEXT) +netlink_route_LDADD = $(LDADD) +netlink_route_DEPENDENCIES = libtests.a +netlink_selinux_SOURCES = netlink_selinux.c +netlink_selinux_OBJECTS = netlink_selinux.$(OBJEXT) +netlink_selinux_LDADD = $(LDADD) +netlink_selinux_DEPENDENCIES = libtests.a +netlink_sock_diag_SOURCES = netlink_sock_diag.c +netlink_sock_diag_OBJECTS = netlink_sock_diag.$(OBJEXT) +netlink_sock_diag_LDADD = $(LDADD) +netlink_sock_diag_DEPENDENCIES = libtests.a netlink_unix_diag_SOURCES = netlink_unix_diag.c netlink_unix_diag_OBJECTS = netlink_unix_diag.$(OBJEXT) netlink_unix_diag_LDADD = $(LDADD) netlink_unix_diag_DEPENDENCIES = libtests.a +netlink_xfrm_SOURCES = netlink_xfrm.c +netlink_xfrm_OBJECTS = netlink_xfrm.$(OBJEXT) +netlink_xfrm_LDADD = $(LDADD) +netlink_xfrm_DEPENDENCIES = libtests.a newfstatat_SOURCES = newfstatat.c newfstatat_OBJECTS = newfstatat-newfstatat.$(OBJEXT) newfstatat_LDADD = $(LDADD) newfstatat_DEPENDENCIES = libtests.a +nfnetlink_acct_SOURCES = nfnetlink_acct.c +nfnetlink_acct_OBJECTS = nfnetlink_acct.$(OBJEXT) +nfnetlink_acct_LDADD = $(LDADD) +nfnetlink_acct_DEPENDENCIES = libtests.a +nfnetlink_cthelper_SOURCES = nfnetlink_cthelper.c +nfnetlink_cthelper_OBJECTS = nfnetlink_cthelper.$(OBJEXT) +nfnetlink_cthelper_LDADD = $(LDADD) +nfnetlink_cthelper_DEPENDENCIES = libtests.a +nfnetlink_ctnetlink_SOURCES = nfnetlink_ctnetlink.c +nfnetlink_ctnetlink_OBJECTS = nfnetlink_ctnetlink.$(OBJEXT) +nfnetlink_ctnetlink_LDADD = $(LDADD) +nfnetlink_ctnetlink_DEPENDENCIES = libtests.a +nfnetlink_ctnetlink_exp_SOURCES = nfnetlink_ctnetlink_exp.c +nfnetlink_ctnetlink_exp_OBJECTS = nfnetlink_ctnetlink_exp.$(OBJEXT) +nfnetlink_ctnetlink_exp_LDADD = $(LDADD) +nfnetlink_ctnetlink_exp_DEPENDENCIES = libtests.a +nfnetlink_cttimeout_SOURCES = nfnetlink_cttimeout.c +nfnetlink_cttimeout_OBJECTS = nfnetlink_cttimeout.$(OBJEXT) +nfnetlink_cttimeout_LDADD = $(LDADD) +nfnetlink_cttimeout_DEPENDENCIES = libtests.a +nfnetlink_ipset_SOURCES = nfnetlink_ipset.c +nfnetlink_ipset_OBJECTS = nfnetlink_ipset.$(OBJEXT) +nfnetlink_ipset_LDADD = $(LDADD) +nfnetlink_ipset_DEPENDENCIES = libtests.a +nfnetlink_nft_compat_SOURCES = nfnetlink_nft_compat.c +nfnetlink_nft_compat_OBJECTS = nfnetlink_nft_compat.$(OBJEXT) +nfnetlink_nft_compat_LDADD = $(LDADD) +nfnetlink_nft_compat_DEPENDENCIES = libtests.a +nfnetlink_nftables_SOURCES = nfnetlink_nftables.c +nfnetlink_nftables_OBJECTS = nfnetlink_nftables.$(OBJEXT) +nfnetlink_nftables_LDADD = $(LDADD) +nfnetlink_nftables_DEPENDENCIES = libtests.a +nfnetlink_osf_SOURCES = nfnetlink_osf.c +nfnetlink_osf_OBJECTS = nfnetlink_osf.$(OBJEXT) +nfnetlink_osf_LDADD = $(LDADD) +nfnetlink_osf_DEPENDENCIES = libtests.a +nfnetlink_queue_SOURCES = nfnetlink_queue.c +nfnetlink_queue_OBJECTS = nfnetlink_queue.$(OBJEXT) +nfnetlink_queue_LDADD = $(LDADD) +nfnetlink_queue_DEPENDENCIES = libtests.a +nfnetlink_ulog_SOURCES = nfnetlink_ulog.c +nfnetlink_ulog_OBJECTS = nfnetlink_ulog.$(OBJEXT) +nfnetlink_ulog_LDADD = $(LDADD) +nfnetlink_ulog_DEPENDENCIES = libtests.a +nlattr_SOURCES = nlattr.c +nlattr_OBJECTS = nlattr.$(OBJEXT) +nlattr_LDADD = $(LDADD) +nlattr_DEPENDENCIES = libtests.a +nlattr_br_port_msg_SOURCES = nlattr_br_port_msg.c +nlattr_br_port_msg_OBJECTS = nlattr_br_port_msg.$(OBJEXT) +nlattr_br_port_msg_LDADD = $(LDADD) +nlattr_br_port_msg_DEPENDENCIES = libtests.a +nlattr_crypto_user_alg_SOURCES = nlattr_crypto_user_alg.c +nlattr_crypto_user_alg_OBJECTS = nlattr_crypto_user_alg.$(OBJEXT) +nlattr_crypto_user_alg_LDADD = $(LDADD) +nlattr_crypto_user_alg_DEPENDENCIES = libtests.a +nlattr_dcbmsg_SOURCES = nlattr_dcbmsg.c +nlattr_dcbmsg_OBJECTS = nlattr_dcbmsg.$(OBJEXT) +nlattr_dcbmsg_LDADD = $(LDADD) +nlattr_dcbmsg_DEPENDENCIES = libtests.a +nlattr_fib_rule_hdr_SOURCES = nlattr_fib_rule_hdr.c +nlattr_fib_rule_hdr_OBJECTS = nlattr_fib_rule_hdr.$(OBJEXT) +nlattr_fib_rule_hdr_LDADD = $(LDADD) +nlattr_fib_rule_hdr_DEPENDENCIES = libtests.a +nlattr_ifaddrlblmsg_SOURCES = nlattr_ifaddrlblmsg.c +nlattr_ifaddrlblmsg_OBJECTS = nlattr_ifaddrlblmsg.$(OBJEXT) +nlattr_ifaddrlblmsg_LDADD = $(LDADD) +nlattr_ifaddrlblmsg_DEPENDENCIES = libtests.a +nlattr_ifaddrmsg_SOURCES = nlattr_ifaddrmsg.c +nlattr_ifaddrmsg_OBJECTS = nlattr_ifaddrmsg.$(OBJEXT) +nlattr_ifaddrmsg_LDADD = $(LDADD) +nlattr_ifaddrmsg_DEPENDENCIES = libtests.a +nlattr_ifinfomsg_SOURCES = nlattr_ifinfomsg.c +nlattr_ifinfomsg_OBJECTS = nlattr_ifinfomsg.$(OBJEXT) +nlattr_ifinfomsg_LDADD = $(LDADD) +nlattr_ifinfomsg_DEPENDENCIES = libtests.a +nlattr_ifla_af_spec_SOURCES = nlattr_ifla_af_spec.c +nlattr_ifla_af_spec_OBJECTS = nlattr_ifla_af_spec.$(OBJEXT) +nlattr_ifla_af_spec_LDADD = $(LDADD) +nlattr_ifla_af_spec_DEPENDENCIES = libtests.a +nlattr_ifla_brport_SOURCES = nlattr_ifla_brport.c +nlattr_ifla_brport_OBJECTS = nlattr_ifla_brport.$(OBJEXT) +nlattr_ifla_brport_LDADD = $(LDADD) +nlattr_ifla_brport_DEPENDENCIES = libtests.a +nlattr_ifla_linkinfo_SOURCES = nlattr_ifla_linkinfo.c +nlattr_ifla_linkinfo_OBJECTS = nlattr_ifla_linkinfo.$(OBJEXT) +nlattr_ifla_linkinfo_LDADD = $(LDADD) +nlattr_ifla_linkinfo_DEPENDENCIES = libtests.a +nlattr_ifla_port_SOURCES = nlattr_ifla_port.c +nlattr_ifla_port_OBJECTS = nlattr_ifla_port.$(OBJEXT) +nlattr_ifla_port_LDADD = $(LDADD) +nlattr_ifla_port_DEPENDENCIES = libtests.a +nlattr_ifla_xdp_SOURCES = nlattr_ifla_xdp.c +nlattr_ifla_xdp_OBJECTS = nlattr_ifla_xdp.$(OBJEXT) +nlattr_ifla_xdp_LDADD = $(LDADD) +nlattr_ifla_xdp_DEPENDENCIES = libtests.a +nlattr_inet_diag_msg_SOURCES = nlattr_inet_diag_msg.c +nlattr_inet_diag_msg_OBJECTS = nlattr_inet_diag_msg.$(OBJEXT) +nlattr_inet_diag_msg_LDADD = $(LDADD) +nlattr_inet_diag_msg_DEPENDENCIES = libtests.a +nlattr_inet_diag_req_compat_SOURCES = nlattr_inet_diag_req_compat.c +nlattr_inet_diag_req_compat_OBJECTS = \ + nlattr_inet_diag_req_compat.$(OBJEXT) +nlattr_inet_diag_req_compat_LDADD = $(LDADD) +nlattr_inet_diag_req_compat_DEPENDENCIES = libtests.a +nlattr_inet_diag_req_v2_SOURCES = nlattr_inet_diag_req_v2.c +nlattr_inet_diag_req_v2_OBJECTS = nlattr_inet_diag_req_v2.$(OBJEXT) +nlattr_inet_diag_req_v2_LDADD = $(LDADD) +nlattr_inet_diag_req_v2_DEPENDENCIES = libtests.a +nlattr_mdba_mdb_entry_SOURCES = nlattr_mdba_mdb_entry.c +nlattr_mdba_mdb_entry_OBJECTS = nlattr_mdba_mdb_entry.$(OBJEXT) +nlattr_mdba_mdb_entry_LDADD = $(LDADD) +nlattr_mdba_mdb_entry_DEPENDENCIES = libtests.a +nlattr_mdba_router_port_SOURCES = nlattr_mdba_router_port.c +nlattr_mdba_router_port_OBJECTS = nlattr_mdba_router_port.$(OBJEXT) +nlattr_mdba_router_port_LDADD = $(LDADD) +nlattr_mdba_router_port_DEPENDENCIES = libtests.a +nlattr_ndmsg_SOURCES = nlattr_ndmsg.c +nlattr_ndmsg_OBJECTS = nlattr_ndmsg.$(OBJEXT) +nlattr_ndmsg_LDADD = $(LDADD) +nlattr_ndmsg_DEPENDENCIES = libtests.a +nlattr_ndtmsg_SOURCES = nlattr_ndtmsg.c +nlattr_ndtmsg_OBJECTS = nlattr_ndtmsg.$(OBJEXT) +nlattr_ndtmsg_LDADD = $(LDADD) +nlattr_ndtmsg_DEPENDENCIES = libtests.a +nlattr_netconfmsg_SOURCES = nlattr_netconfmsg.c +nlattr_netconfmsg_OBJECTS = nlattr_netconfmsg.$(OBJEXT) +nlattr_netconfmsg_LDADD = $(LDADD) +nlattr_netconfmsg_DEPENDENCIES = libtests.a +nlattr_netlink_diag_msg_SOURCES = nlattr_netlink_diag_msg.c +nlattr_netlink_diag_msg_OBJECTS = nlattr_netlink_diag_msg.$(OBJEXT) +nlattr_netlink_diag_msg_LDADD = $(LDADD) +nlattr_netlink_diag_msg_DEPENDENCIES = libtests.a +nlattr_nlmsgerr_SOURCES = nlattr_nlmsgerr.c +nlattr_nlmsgerr_OBJECTS = nlattr_nlmsgerr.$(OBJEXT) +nlattr_nlmsgerr_LDADD = $(LDADD) +nlattr_nlmsgerr_DEPENDENCIES = libtests.a +nlattr_packet_diag_msg_SOURCES = nlattr_packet_diag_msg.c +nlattr_packet_diag_msg_OBJECTS = nlattr_packet_diag_msg.$(OBJEXT) +nlattr_packet_diag_msg_LDADD = $(LDADD) +nlattr_packet_diag_msg_DEPENDENCIES = libtests.a +nlattr_rtgenmsg_SOURCES = nlattr_rtgenmsg.c +nlattr_rtgenmsg_OBJECTS = nlattr_rtgenmsg.$(OBJEXT) +nlattr_rtgenmsg_LDADD = $(LDADD) +nlattr_rtgenmsg_DEPENDENCIES = libtests.a +nlattr_rtmsg_SOURCES = nlattr_rtmsg.c +nlattr_rtmsg_OBJECTS = nlattr_rtmsg.$(OBJEXT) +nlattr_rtmsg_LDADD = $(LDADD) +nlattr_rtmsg_DEPENDENCIES = libtests.a +nlattr_smc_diag_msg_SOURCES = nlattr_smc_diag_msg.c +nlattr_smc_diag_msg_OBJECTS = nlattr_smc_diag_msg.$(OBJEXT) +nlattr_smc_diag_msg_LDADD = $(LDADD) +nlattr_smc_diag_msg_DEPENDENCIES = libtests.a +nlattr_tc_stats_SOURCES = nlattr_tc_stats.c +nlattr_tc_stats_OBJECTS = nlattr_tc_stats.$(OBJEXT) +nlattr_tc_stats_LDADD = $(LDADD) +nlattr_tc_stats_DEPENDENCIES = libtests.a +nlattr_tca_stab_SOURCES = nlattr_tca_stab.c +nlattr_tca_stab_OBJECTS = nlattr_tca_stab.$(OBJEXT) +nlattr_tca_stab_LDADD = $(LDADD) +nlattr_tca_stab_DEPENDENCIES = libtests.a +nlattr_tcamsg_SOURCES = nlattr_tcamsg.c +nlattr_tcamsg_OBJECTS = nlattr_tcamsg.$(OBJEXT) +nlattr_tcamsg_LDADD = $(LDADD) +nlattr_tcamsg_DEPENDENCIES = libtests.a +nlattr_tcmsg_SOURCES = nlattr_tcmsg.c +nlattr_tcmsg_OBJECTS = nlattr_tcmsg.$(OBJEXT) +nlattr_tcmsg_LDADD = $(LDADD) +nlattr_tcmsg_DEPENDENCIES = libtests.a +nlattr_unix_diag_msg_SOURCES = nlattr_unix_diag_msg.c +nlattr_unix_diag_msg_OBJECTS = nlattr_unix_diag_msg.$(OBJEXT) +nlattr_unix_diag_msg_LDADD = $(LDADD) +nlattr_unix_diag_msg_DEPENDENCIES = libtests.a nsyscalls_SOURCES = nsyscalls.c nsyscalls_OBJECTS = nsyscalls.$(OBJEXT) nsyscalls_LDADD = $(LDADD) nsyscalls_DEPENDENCIES = libtests.a +nsyscalls_d_SOURCES = nsyscalls-d.c +nsyscalls_d_OBJECTS = nsyscalls-d.$(OBJEXT) +nsyscalls_d_LDADD = $(LDADD) +nsyscalls_d_DEPENDENCIES = libtests.a old_mmap_SOURCES = old_mmap.c old_mmap_OBJECTS = old_mmap.$(OBJEXT) old_mmap_LDADD = $(LDADD) old_mmap_DEPENDENCIES = libtests.a +old_mmap_P_SOURCES = old_mmap-P.c +old_mmap_P_OBJECTS = old_mmap-P.$(OBJEXT) +old_mmap_P_LDADD = $(LDADD) +old_mmap_P_DEPENDENCIES = libtests.a +old_mmap_Xabbrev_SOURCES = old_mmap-Xabbrev.c +old_mmap_Xabbrev_OBJECTS = old_mmap-Xabbrev.$(OBJEXT) +old_mmap_Xabbrev_LDADD = $(LDADD) +old_mmap_Xabbrev_DEPENDENCIES = libtests.a +old_mmap_Xraw_SOURCES = old_mmap-Xraw.c +old_mmap_Xraw_OBJECTS = old_mmap-Xraw.$(OBJEXT) +old_mmap_Xraw_LDADD = $(LDADD) +old_mmap_Xraw_DEPENDENCIES = libtests.a +old_mmap_Xverbose_SOURCES = old_mmap-Xverbose.c +old_mmap_Xverbose_OBJECTS = old_mmap-Xverbose.$(OBJEXT) +old_mmap_Xverbose_LDADD = $(LDADD) +old_mmap_Xverbose_DEPENDENCIES = libtests.a +old_mmap_v_none_SOURCES = old_mmap-v-none.c +old_mmap_v_none_OBJECTS = old_mmap-v-none.$(OBJEXT) +old_mmap_v_none_LDADD = $(LDADD) +old_mmap_v_none_DEPENDENCIES = libtests.a oldfstat_SOURCES = oldfstat.c oldfstat_OBJECTS = oldfstat.$(OBJEXT) oldfstat_LDADD = $(LDADD) @@ -1080,6 +1831,18 @@ oldselect_SOURCES = oldselect.c oldselect_OBJECTS = oldselect.$(OBJEXT) oldselect_LDADD = $(LDADD) oldselect_DEPENDENCIES = libtests.a +oldselect_P_SOURCES = oldselect-P.c +oldselect_P_OBJECTS = oldselect-P.$(OBJEXT) +oldselect_P_LDADD = $(LDADD) +oldselect_P_DEPENDENCIES = libtests.a +oldselect_efault_SOURCES = oldselect-efault.c +oldselect_efault_OBJECTS = oldselect-efault.$(OBJEXT) +oldselect_efault_LDADD = $(LDADD) +oldselect_efault_DEPENDENCIES = libtests.a +oldselect_efault_P_SOURCES = oldselect-efault-P.c +oldselect_efault_P_OBJECTS = oldselect-efault-P.$(OBJEXT) +oldselect_efault_P_LDADD = $(LDADD) +oldselect_efault_P_DEPENDENCIES = libtests.a oldstat_SOURCES = oldstat.c oldstat_OBJECTS = oldstat.$(OBJEXT) oldstat_LDADD = $(LDADD) @@ -1092,13 +1855,20 @@ openat_SOURCES = openat.c openat_OBJECTS = openat.$(OBJEXT) openat_LDADD = $(LDADD) openat_DEPENDENCIES = libtests.a +orphaned_process_group_SOURCES = orphaned_process_group.c +orphaned_process_group_OBJECTS = orphaned_process_group.$(OBJEXT) +orphaned_process_group_LDADD = $(LDADD) +orphaned_process_group_DEPENDENCIES = libtests.a +osf_utimes_SOURCES = osf_utimes.c +osf_utimes_OBJECTS = osf_utimes.$(OBJEXT) +osf_utimes_LDADD = $(LDADD) +osf_utimes_DEPENDENCIES = libtests.a pause_SOURCES = pause.c pause_OBJECTS = pause.$(OBJEXT) pause_LDADD = $(LDADD) pause_DEPENDENCIES = libtests.a pc_SOURCES = pc.c pc_OBJECTS = pc.$(OBJEXT) -am__DEPENDENCIES_1 = pc_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LDADD) perf_event_open_SOURCES = perf_event_open.c perf_event_open_OBJECTS = perf_event_open.$(OBJEXT) @@ -1117,6 +1887,22 @@ personality_SOURCES = personality.c personality_OBJECTS = personality.$(OBJEXT) personality_LDADD = $(LDADD) personality_DEPENDENCIES = libtests.a +personality_Xabbrev_SOURCES = personality-Xabbrev.c +personality_Xabbrev_OBJECTS = personality-Xabbrev.$(OBJEXT) +personality_Xabbrev_LDADD = $(LDADD) +personality_Xabbrev_DEPENDENCIES = libtests.a +personality_Xraw_SOURCES = personality-Xraw.c +personality_Xraw_OBJECTS = personality-Xraw.$(OBJEXT) +personality_Xraw_LDADD = $(LDADD) +personality_Xraw_DEPENDENCIES = libtests.a +personality_Xverbose_SOURCES = personality-Xverbose.c +personality_Xverbose_OBJECTS = personality-Xverbose.$(OBJEXT) +personality_Xverbose_LDADD = $(LDADD) +personality_Xverbose_DEPENDENCIES = libtests.a +pidfd_send_signal_SOURCES = pidfd_send_signal.c +pidfd_send_signal_OBJECTS = pidfd_send_signal.$(OBJEXT) +pidfd_send_signal_LDADD = $(LDADD) +pidfd_send_signal_DEPENDENCIES = libtests.a pipe_SOURCES = pipe.c pipe_OBJECTS = pipe.$(OBJEXT) pipe_LDADD = $(LDADD) @@ -1141,10 +1927,22 @@ poll_SOURCES = poll.c poll_OBJECTS = poll.$(OBJEXT) poll_LDADD = $(LDADD) poll_DEPENDENCIES = libtests.a +poll_P_SOURCES = poll-P.c +poll_P_OBJECTS = poll-P.$(OBJEXT) +poll_P_LDADD = $(LDADD) +poll_P_DEPENDENCIES = libtests.a ppoll_SOURCES = ppoll.c ppoll_OBJECTS = ppoll.$(OBJEXT) ppoll_LDADD = $(LDADD) ppoll_DEPENDENCIES = libtests.a +ppoll_P_SOURCES = ppoll-P.c +ppoll_P_OBJECTS = ppoll-P.$(OBJEXT) +ppoll_P_LDADD = $(LDADD) +ppoll_P_DEPENDENCIES = libtests.a +ppoll_v_SOURCES = ppoll-v.c +ppoll_v_OBJECTS = ppoll-v.$(OBJEXT) +ppoll_v_LDADD = $(LDADD) +ppoll_v_DEPENDENCIES = libtests.a prctl_arg2_intptr_SOURCES = prctl-arg2-intptr.c prctl_arg2_intptr_OBJECTS = prctl-arg2-intptr.$(OBJEXT) prctl_arg2_intptr_LDADD = $(LDADD) @@ -1177,6 +1975,10 @@ prctl_securebits_SOURCES = prctl-securebits.c prctl_securebits_OBJECTS = prctl-securebits.$(OBJEXT) prctl_securebits_LDADD = $(LDADD) prctl_securebits_DEPENDENCIES = libtests.a +prctl_spec_inject_SOURCES = prctl-spec-inject.c +prctl_spec_inject_OBJECTS = prctl-spec-inject.$(OBJEXT) +prctl_spec_inject_LDADD = $(LDADD) +prctl_spec_inject_DEPENDENCIES = libtests.a prctl_tid_address_SOURCES = prctl-tid_address.c prctl_tid_address_OBJECTS = prctl-tid_address.$(OBJEXT) prctl_tid_address_LDADD = $(LDADD) @@ -1206,10 +2008,51 @@ print_maxfd_SOURCES = print_maxfd.c print_maxfd_OBJECTS = print_maxfd.$(OBJEXT) print_maxfd_LDADD = $(LDADD) print_maxfd_DEPENDENCIES = libtests.a +printpath_umovestr_SOURCES = printpath-umovestr.c +printpath_umovestr_OBJECTS = printpath-umovestr.$(OBJEXT) +printpath_umovestr_LDADD = $(LDADD) +printpath_umovestr_DEPENDENCIES = libtests.a +printpath_umovestr_peekdata_SOURCES = printpath-umovestr-peekdata.c +printpath_umovestr_peekdata_OBJECTS = \ + printpath-umovestr-peekdata.$(OBJEXT) +printpath_umovestr_peekdata_LDADD = $(LDADD) +printpath_umovestr_peekdata_DEPENDENCIES = libtests.a +printpath_umovestr_undumpable_SOURCES = \ + printpath-umovestr-undumpable.c +printpath_umovestr_undumpable_OBJECTS = \ + printpath-umovestr-undumpable.$(OBJEXT) +printpath_umovestr_undumpable_LDADD = $(LDADD) +printpath_umovestr_undumpable_DEPENDENCIES = libtests.a +printsignal_Xabbrev_SOURCES = printsignal-Xabbrev.c +printsignal_Xabbrev_OBJECTS = printsignal-Xabbrev.$(OBJEXT) +printsignal_Xabbrev_LDADD = $(LDADD) +printsignal_Xabbrev_DEPENDENCIES = libtests.a +printsignal_Xraw_SOURCES = printsignal-Xraw.c +printsignal_Xraw_OBJECTS = printsignal-Xraw.$(OBJEXT) +printsignal_Xraw_LDADD = $(LDADD) +printsignal_Xraw_DEPENDENCIES = libtests.a +printsignal_Xverbose_SOURCES = printsignal-Xverbose.c +printsignal_Xverbose_OBJECTS = printsignal-Xverbose.$(OBJEXT) +printsignal_Xverbose_LDADD = $(LDADD) +printsignal_Xverbose_DEPENDENCIES = libtests.a printstr_SOURCES = printstr.c printstr_OBJECTS = printstr.$(OBJEXT) printstr_LDADD = $(LDADD) printstr_DEPENDENCIES = libtests.a +printstrn_umoven_SOURCES = printstrn-umoven.c +printstrn_umoven_OBJECTS = printstrn-umoven.$(OBJEXT) +printstrn_umoven_LDADD = $(LDADD) +printstrn_umoven_DEPENDENCIES = libtests.a +printstrn_umoven_peekdata_SOURCES = printstrn-umoven-peekdata.c +printstrn_umoven_peekdata_OBJECTS = \ + printstrn-umoven-peekdata.$(OBJEXT) +printstrn_umoven_peekdata_LDADD = $(LDADD) +printstrn_umoven_peekdata_DEPENDENCIES = libtests.a +printstrn_umoven_undumpable_SOURCES = printstrn-umoven-undumpable.c +printstrn_umoven_undumpable_OBJECTS = \ + printstrn-umoven-undumpable.$(OBJEXT) +printstrn_umoven_undumpable_LDADD = $(LDADD) +printstrn_umoven_undumpable_DEPENDENCIES = libtests.a prlimit64_SOURCES = prlimit64.c prlimit64_OBJECTS = prlimit64.$(OBJEXT) prlimit64_LDADD = $(LDADD) @@ -1230,6 +2073,10 @@ ptrace_SOURCES = ptrace.c ptrace_OBJECTS = ptrace.$(OBJEXT) ptrace_LDADD = $(LDADD) ptrace_DEPENDENCIES = libtests.a +ptrace_syscall_info_SOURCES = ptrace_syscall_info.c +ptrace_syscall_info_OBJECTS = ptrace_syscall_info.$(OBJEXT) +ptrace_syscall_info_LDADD = $(LDADD) +ptrace_syscall_info_DEPENDENCIES = libtests.a pwritev_SOURCES = pwritev.c pwritev_OBJECTS = pwritev-pwritev.$(OBJEXT) pwritev_LDADD = $(LDADD) @@ -1258,6 +2105,26 @@ quotactl_SOURCES = quotactl.c quotactl_OBJECTS = quotactl.$(OBJEXT) quotactl_LDADD = $(LDADD) quotactl_DEPENDENCIES = libtests.a +quotactl_Xabbrev_SOURCES = quotactl-Xabbrev.c +quotactl_Xabbrev_OBJECTS = quotactl-Xabbrev.$(OBJEXT) +quotactl_Xabbrev_LDADD = $(LDADD) +quotactl_Xabbrev_DEPENDENCIES = libtests.a +quotactl_Xraw_SOURCES = quotactl-Xraw.c +quotactl_Xraw_OBJECTS = quotactl-Xraw.$(OBJEXT) +quotactl_Xraw_LDADD = $(LDADD) +quotactl_Xraw_DEPENDENCIES = libtests.a +quotactl_Xverbose_SOURCES = quotactl-Xverbose.c +quotactl_Xverbose_OBJECTS = quotactl-Xverbose.$(OBJEXT) +quotactl_Xverbose_LDADD = $(LDADD) +quotactl_Xverbose_DEPENDENCIES = libtests.a +quotactl_success_SOURCES = quotactl-success.c +quotactl_success_OBJECTS = quotactl-success.$(OBJEXT) +quotactl_success_LDADD = $(LDADD) +quotactl_success_DEPENDENCIES = libtests.a +quotactl_success_v_SOURCES = quotactl-success-v.c +quotactl_success_v_OBJECTS = quotactl-success-v.$(OBJEXT) +quotactl_success_v_LDADD = $(LDADD) +quotactl_success_v_DEPENDENCIES = libtests.a quotactl_v_SOURCES = quotactl-v.c quotactl_v_OBJECTS = quotactl-v.$(OBJEXT) quotactl_v_LDADD = $(LDADD) @@ -1266,6 +2133,14 @@ quotactl_xfs_SOURCES = quotactl-xfs.c quotactl_xfs_OBJECTS = quotactl-xfs.$(OBJEXT) quotactl_xfs_LDADD = $(LDADD) quotactl_xfs_DEPENDENCIES = libtests.a +quotactl_xfs_success_SOURCES = quotactl-xfs-success.c +quotactl_xfs_success_OBJECTS = quotactl-xfs-success.$(OBJEXT) +quotactl_xfs_success_LDADD = $(LDADD) +quotactl_xfs_success_DEPENDENCIES = libtests.a +quotactl_xfs_success_v_SOURCES = quotactl-xfs-success-v.c +quotactl_xfs_success_v_OBJECTS = quotactl-xfs-success-v.$(OBJEXT) +quotactl_xfs_success_v_LDADD = $(LDADD) +quotactl_xfs_success_v_DEPENDENCIES = libtests.a quotactl_xfs_v_SOURCES = quotactl-xfs-v.c quotactl_xfs_v_OBJECTS = quotactl-xfs-v.$(OBJEXT) quotactl_xfs_v_LDADD = $(LDADD) @@ -1318,6 +2193,19 @@ remap_file_pages_SOURCES = remap_file_pages.c remap_file_pages_OBJECTS = remap_file_pages.$(OBJEXT) remap_file_pages_LDADD = $(LDADD) remap_file_pages_DEPENDENCIES = libtests.a +remap_file_pages_Xabbrev_SOURCES = remap_file_pages-Xabbrev.c +remap_file_pages_Xabbrev_OBJECTS = remap_file_pages-Xabbrev.$(OBJEXT) +remap_file_pages_Xabbrev_LDADD = $(LDADD) +remap_file_pages_Xabbrev_DEPENDENCIES = libtests.a +remap_file_pages_Xraw_SOURCES = remap_file_pages-Xraw.c +remap_file_pages_Xraw_OBJECTS = remap_file_pages-Xraw.$(OBJEXT) +remap_file_pages_Xraw_LDADD = $(LDADD) +remap_file_pages_Xraw_DEPENDENCIES = libtests.a +remap_file_pages_Xverbose_SOURCES = remap_file_pages-Xverbose.c +remap_file_pages_Xverbose_OBJECTS = \ + remap_file_pages-Xverbose.$(OBJEXT) +remap_file_pages_Xverbose_LDADD = $(LDADD) +remap_file_pages_Xverbose_DEPENDENCIES = libtests.a rename_SOURCES = rename.c rename_OBJECTS = rename.$(OBJEXT) rename_LDADD = $(LDADD) @@ -1338,10 +2226,18 @@ restart_syscall_SOURCES = restart_syscall.c restart_syscall_OBJECTS = restart_syscall.$(OBJEXT) restart_syscall_LDADD = $(LDADD) restart_syscall_DEPENDENCIES = libtests.a +riscv_flush_icache_SOURCES = riscv_flush_icache.c +riscv_flush_icache_OBJECTS = riscv_flush_icache.$(OBJEXT) +riscv_flush_icache_LDADD = $(LDADD) +riscv_flush_icache_DEPENDENCIES = libtests.a rmdir_SOURCES = rmdir.c rmdir_OBJECTS = rmdir.$(OBJEXT) rmdir_LDADD = $(LDADD) rmdir_DEPENDENCIES = libtests.a +rt_sigaction_SOURCES = rt_sigaction.c +rt_sigaction_OBJECTS = rt_sigaction.$(OBJEXT) +rt_sigaction_LDADD = $(LDADD) +rt_sigaction_DEPENDENCIES = libtests.a rt_sigpending_SOURCES = rt_sigpending.c rt_sigpending_OBJECTS = rt_sigpending.$(OBJEXT) rt_sigpending_LDADD = $(LDADD) @@ -1354,6 +2250,10 @@ rt_sigqueueinfo_SOURCES = rt_sigqueueinfo.c rt_sigqueueinfo_OBJECTS = rt_sigqueueinfo.$(OBJEXT) rt_sigqueueinfo_LDADD = $(LDADD) rt_sigqueueinfo_DEPENDENCIES = libtests.a +rt_sigreturn_SOURCES = rt_sigreturn.c +rt_sigreturn_OBJECTS = rt_sigreturn.$(OBJEXT) +rt_sigreturn_LDADD = $(LDADD) +rt_sigreturn_DEPENDENCIES = libtests.a rt_sigsuspend_SOURCES = rt_sigsuspend.c rt_sigsuspend_OBJECTS = rt_sigsuspend.$(OBJEXT) rt_sigsuspend_LDADD = $(LDADD) @@ -1366,6 +2266,34 @@ rt_tgsigqueueinfo_SOURCES = rt_tgsigqueueinfo.c rt_tgsigqueueinfo_OBJECTS = rt_tgsigqueueinfo.$(OBJEXT) rt_tgsigqueueinfo_LDADD = $(LDADD) rt_tgsigqueueinfo_DEPENDENCIES = libtests.a +run_expect_termsig_SOURCES = run_expect_termsig.c +run_expect_termsig_OBJECTS = run_expect_termsig.$(OBJEXT) +run_expect_termsig_LDADD = $(LDADD) +run_expect_termsig_DEPENDENCIES = libtests.a +s390_guarded_storage_SOURCES = s390_guarded_storage.c +s390_guarded_storage_OBJECTS = s390_guarded_storage.$(OBJEXT) +s390_guarded_storage_LDADD = $(LDADD) +s390_guarded_storage_DEPENDENCIES = libtests.a +s390_guarded_storage_v_SOURCES = s390_guarded_storage-v.c +s390_guarded_storage_v_OBJECTS = s390_guarded_storage-v.$(OBJEXT) +s390_guarded_storage_v_LDADD = $(LDADD) +s390_guarded_storage_v_DEPENDENCIES = libtests.a +s390_pci_mmio_read_write_SOURCES = s390_pci_mmio_read_write.c +s390_pci_mmio_read_write_OBJECTS = s390_pci_mmio_read_write.$(OBJEXT) +s390_pci_mmio_read_write_LDADD = $(LDADD) +s390_pci_mmio_read_write_DEPENDENCIES = libtests.a +s390_runtime_instr_SOURCES = s390_runtime_instr.c +s390_runtime_instr_OBJECTS = s390_runtime_instr.$(OBJEXT) +s390_runtime_instr_LDADD = $(LDADD) +s390_runtime_instr_DEPENDENCIES = libtests.a +s390_sthyi_SOURCES = s390_sthyi.c +s390_sthyi_OBJECTS = s390_sthyi.$(OBJEXT) +s390_sthyi_LDADD = $(LDADD) +s390_sthyi_DEPENDENCIES = libtests.a +s390_sthyi_v_SOURCES = s390_sthyi-v.c +s390_sthyi_v_OBJECTS = s390_sthyi-v.$(OBJEXT) +s390_sthyi_v_LDADD = $(LDADD) +s390_sthyi_v_DEPENDENCIES = libtests.a sched_get_priority_mxx_SOURCES = sched_get_priority_mxx.c sched_get_priority_mxx_OBJECTS = sched_get_priority_mxx.$(OBJEXT) sched_get_priority_mxx_LDADD = $(LDADD) @@ -1410,10 +2338,18 @@ seccomp_strict_SOURCES = seccomp-strict.c seccomp_strict_OBJECTS = seccomp-strict.$(OBJEXT) seccomp_strict_LDADD = $(LDADD) seccomp_strict_DEPENDENCIES = libtests.a +seccomp_get_action_avail_SOURCES = seccomp_get_action_avail.c +seccomp_get_action_avail_OBJECTS = seccomp_get_action_avail.$(OBJEXT) +seccomp_get_action_avail_LDADD = $(LDADD) +seccomp_get_action_avail_DEPENDENCIES = libtests.a select_SOURCES = select.c select_OBJECTS = select.$(OBJEXT) select_LDADD = $(LDADD) select_DEPENDENCIES = libtests.a +select_P_SOURCES = select-P.c +select_P_OBJECTS = select-P.$(OBJEXT) +select_P_LDADD = $(LDADD) +select_P_DEPENDENCIES = libtests.a semop_SOURCES = semop.c semop_OBJECTS = semop.$(OBJEXT) semop_LDADD = $(LDADD) @@ -1434,6 +2370,14 @@ set_ptracer_any_SOURCES = set_ptracer_any.c set_ptracer_any_OBJECTS = set_ptracer_any.$(OBJEXT) set_ptracer_any_LDADD = $(LDADD) set_ptracer_any_DEPENDENCIES = libtests.a +set_sigblock_SOURCES = set_sigblock.c +set_sigblock_OBJECTS = set_sigblock.$(OBJEXT) +set_sigblock_LDADD = $(LDADD) +set_sigblock_DEPENDENCIES = libtests.a +set_sigign_SOURCES = set_sigign.c +set_sigign_OBJECTS = set_sigign.$(OBJEXT) +set_sigign_LDADD = $(LDADD) +set_sigign_DEPENDENCIES = libtests.a setdomainname_SOURCES = setdomainname.c setdomainname_OBJECTS = setdomainname.$(OBJEXT) setdomainname_LDADD = $(LDADD) @@ -1514,6 +2458,18 @@ setrlimit_SOURCES = setrlimit.c setrlimit_OBJECTS = setrlimit.$(OBJEXT) setrlimit_LDADD = $(LDADD) setrlimit_DEPENDENCIES = libtests.a +setrlimit_Xabbrev_SOURCES = setrlimit-Xabbrev.c +setrlimit_Xabbrev_OBJECTS = setrlimit-Xabbrev.$(OBJEXT) +setrlimit_Xabbrev_LDADD = $(LDADD) +setrlimit_Xabbrev_DEPENDENCIES = libtests.a +setrlimit_Xraw_SOURCES = setrlimit-Xraw.c +setrlimit_Xraw_OBJECTS = setrlimit-Xraw.$(OBJEXT) +setrlimit_Xraw_LDADD = $(LDADD) +setrlimit_Xraw_DEPENDENCIES = libtests.a +setrlimit_Xverbose_SOURCES = setrlimit-Xverbose.c +setrlimit_Xverbose_OBJECTS = setrlimit-Xverbose.$(OBJEXT) +setrlimit_Xverbose_LDADD = $(LDADD) +setrlimit_Xverbose_DEPENDENCIES = libtests.a setuid_SOURCES = setuid.c setuid_OBJECTS = setuid.$(OBJEXT) setuid_LDADD = $(LDADD) @@ -1542,6 +2498,10 @@ siginfo_SOURCES = siginfo.c siginfo_OBJECTS = siginfo.$(OBJEXT) siginfo_LDADD = $(LDADD) siginfo_DEPENDENCIES = libtests.a +signal_SOURCES = signal.c +signal_OBJECTS = signal.$(OBJEXT) +signal_LDADD = $(LDADD) +signal_DEPENDENCIES = libtests.a signal_receive_SOURCES = signal_receive.c signal_receive_OBJECTS = signal_receive.$(OBJEXT) signal_receive_LDADD = $(LDADD) @@ -1550,18 +2510,90 @@ signalfd4_SOURCES = signalfd4.c signalfd4_OBJECTS = signalfd4.$(OBJEXT) signalfd4_LDADD = $(LDADD) signalfd4_DEPENDENCIES = libtests.a +sigpending_SOURCES = sigpending.c +sigpending_OBJECTS = sigpending.$(OBJEXT) +sigpending_LDADD = $(LDADD) +sigpending_DEPENDENCIES = libtests.a +sigprocmask_SOURCES = sigprocmask.c +sigprocmask_OBJECTS = sigprocmask.$(OBJEXT) +sigprocmask_LDADD = $(LDADD) +sigprocmask_DEPENDENCIES = libtests.a sigreturn_SOURCES = sigreturn.c sigreturn_OBJECTS = sigreturn.$(OBJEXT) sigreturn_LDADD = $(LDADD) sigreturn_DEPENDENCIES = libtests.a +sigsuspend_SOURCES = sigsuspend.c +sigsuspend_OBJECTS = sigsuspend.$(OBJEXT) +sigsuspend_LDADD = $(LDADD) +sigsuspend_DEPENDENCIES = libtests.a sleep_SOURCES = sleep.c sleep_OBJECTS = sleep.$(OBJEXT) sleep_LDADD = $(LDADD) sleep_DEPENDENCIES = libtests.a +so_error_SOURCES = so_error.c +so_error_OBJECTS = so_error.$(OBJEXT) +so_error_LDADD = $(LDADD) +so_error_DEPENDENCIES = libtests.a +so_linger_SOURCES = so_linger.c +so_linger_OBJECTS = so_linger.$(OBJEXT) +so_linger_LDADD = $(LDADD) +so_linger_DEPENDENCIES = libtests.a +so_peercred_SOURCES = so_peercred.c +so_peercred_OBJECTS = so_peercred.$(OBJEXT) +so_peercred_LDADD = $(LDADD) +so_peercred_DEPENDENCIES = libtests.a +so_peercred_Xabbrev_SOURCES = so_peercred-Xabbrev.c +so_peercred_Xabbrev_OBJECTS = so_peercred-Xabbrev.$(OBJEXT) +so_peercred_Xabbrev_LDADD = $(LDADD) +so_peercred_Xabbrev_DEPENDENCIES = libtests.a +so_peercred_Xraw_SOURCES = so_peercred-Xraw.c +so_peercred_Xraw_OBJECTS = so_peercred-Xraw.$(OBJEXT) +so_peercred_Xraw_LDADD = $(LDADD) +so_peercred_Xraw_DEPENDENCIES = libtests.a +so_peercred_Xverbose_SOURCES = so_peercred-Xverbose.c +so_peercred_Xverbose_OBJECTS = so_peercred-Xverbose.$(OBJEXT) +so_peercred_Xverbose_LDADD = $(LDADD) +so_peercred_Xverbose_DEPENDENCIES = libtests.a +sock_filter_v_SOURCES = sock_filter-v.c +sock_filter_v_OBJECTS = sock_filter-v.$(OBJEXT) +sock_filter_v_LDADD = $(LDADD) +sock_filter_v_DEPENDENCIES = libtests.a +sock_filter_v_Xabbrev_SOURCES = sock_filter-v-Xabbrev.c +sock_filter_v_Xabbrev_OBJECTS = sock_filter-v-Xabbrev.$(OBJEXT) +sock_filter_v_Xabbrev_LDADD = $(LDADD) +sock_filter_v_Xabbrev_DEPENDENCIES = libtests.a +sock_filter_v_Xraw_SOURCES = sock_filter-v-Xraw.c +sock_filter_v_Xraw_OBJECTS = sock_filter-v-Xraw.$(OBJEXT) +sock_filter_v_Xraw_LDADD = $(LDADD) +sock_filter_v_Xraw_DEPENDENCIES = libtests.a +sock_filter_v_Xverbose_SOURCES = sock_filter-v-Xverbose.c +sock_filter_v_Xverbose_OBJECTS = sock_filter-v-Xverbose.$(OBJEXT) +sock_filter_v_Xverbose_LDADD = $(LDADD) +sock_filter_v_Xverbose_DEPENDENCIES = libtests.a +sockaddr_xlat_Xabbrev_SOURCES = sockaddr_xlat-Xabbrev.c +sockaddr_xlat_Xabbrev_OBJECTS = sockaddr_xlat-Xabbrev.$(OBJEXT) +sockaddr_xlat_Xabbrev_LDADD = $(LDADD) +sockaddr_xlat_Xabbrev_DEPENDENCIES = libtests.a +sockaddr_xlat_Xraw_SOURCES = sockaddr_xlat-Xraw.c +sockaddr_xlat_Xraw_OBJECTS = sockaddr_xlat-Xraw.$(OBJEXT) +sockaddr_xlat_Xraw_LDADD = $(LDADD) +sockaddr_xlat_Xraw_DEPENDENCIES = libtests.a +sockaddr_xlat_Xverbose_SOURCES = sockaddr_xlat-Xverbose.c +sockaddr_xlat_Xverbose_OBJECTS = sockaddr_xlat-Xverbose.$(OBJEXT) +sockaddr_xlat_Xverbose_LDADD = $(LDADD) +sockaddr_xlat_Xverbose_DEPENDENCIES = libtests.a socketcall_SOURCES = socketcall.c socketcall_OBJECTS = socketcall.$(OBJEXT) socketcall_LDADD = $(LDADD) socketcall_DEPENDENCIES = libtests.a +sockopt_sol_netlink_SOURCES = sockopt-sol_netlink.c +sockopt_sol_netlink_OBJECTS = sockopt-sol_netlink.$(OBJEXT) +sockopt_sol_netlink_LDADD = $(LDADD) +sockopt_sol_netlink_DEPENDENCIES = libtests.a +sockopt_timestamp_SOURCES = sockopt-timestamp.c +sockopt_timestamp_OBJECTS = sockopt-timestamp.$(OBJEXT) +sockopt_timestamp_LDADD = $(LDADD) +sockopt_timestamp_DEPENDENCIES = libtests.a splice_SOURCES = splice.c splice_OBJECTS = splice.$(OBJEXT) splice_LDADD = $(LDADD) @@ -1572,6 +2604,14 @@ am_stack_fcall_OBJECTS = stack-fcall.$(OBJEXT) stack-fcall-0.$(OBJEXT) \ stack_fcall_OBJECTS = $(am_stack_fcall_OBJECTS) stack_fcall_LDADD = $(LDADD) stack_fcall_DEPENDENCIES = libtests.a +am_stack_fcall_mangled_OBJECTS = stack-fcall-mangled.$(OBJEXT) \ + stack-fcall-mangled-0.$(OBJEXT) \ + stack-fcall-mangled-1.$(OBJEXT) \ + stack-fcall-mangled-2.$(OBJEXT) \ + stack-fcall-mangled-3.$(OBJEXT) +stack_fcall_mangled_OBJECTS = $(am_stack_fcall_mangled_OBJECTS) +stack_fcall_mangled_LDADD = $(LDADD) +stack_fcall_mangled_DEPENDENCIES = libtests.a stat_SOURCES = stat.c stat_OBJECTS = stat.$(OBJEXT) stat_LDADD = $(LDADD) @@ -1588,10 +2628,18 @@ statfs64_SOURCES = statfs64.c statfs64_OBJECTS = statfs64.$(OBJEXT) statfs64_LDADD = $(LDADD) statfs64_DEPENDENCIES = libtests.a +statx_SOURCES = statx.c +statx_OBJECTS = statx.$(OBJEXT) +statx_LDADD = $(LDADD) +statx_DEPENDENCIES = libtests.a swap_SOURCES = swap.c swap_OBJECTS = swap.$(OBJEXT) swap_LDADD = $(LDADD) swap_DEPENDENCIES = libtests.a +sxetmask_SOURCES = sxetmask.c +sxetmask_OBJECTS = sxetmask.$(OBJEXT) +sxetmask_LDADD = $(LDADD) +sxetmask_DEPENDENCIES = libtests.a symlink_SOURCES = symlink.c symlink_OBJECTS = symlink.$(OBJEXT) symlink_LDADD = $(LDADD) @@ -1626,7 +2674,7 @@ tee_LDADD = $(LDADD) tee_DEPENDENCIES = libtests.a threads_execve_SOURCES = threads-execve.c threads_execve_OBJECTS = threads-execve.$(OBJEXT) -threads_execve_DEPENDENCIES = $(LDADD) +threads_execve_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LDADD) time_SOURCES = time.c time_OBJECTS = time.$(OBJEXT) time_LDADD = $(LDADD) @@ -1645,7 +2693,7 @@ timerfd_xettime_LDADD = $(LDADD) timerfd_xettime_DEPENDENCIES = libtests.a times_SOURCES = times.c times_OBJECTS = times.$(OBJEXT) -times_DEPENDENCIES = $(LDADD) +times_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LDADD) times_fail_SOURCES = times-fail.c times_fail_OBJECTS = times-fail.$(OBJEXT) times_fail_LDADD = $(LDADD) @@ -1702,6 +2750,10 @@ uname_SOURCES = uname.c uname_OBJECTS = uname.$(OBJEXT) uname_LDADD = $(LDADD) uname_DEPENDENCIES = libtests.a +unblock_reset_raise_SOURCES = unblock_reset_raise.c +unblock_reset_raise_OBJECTS = unblock_reset_raise.$(OBJEXT) +unblock_reset_raise_LDADD = $(LDADD) +unblock_reset_raise_DEPENDENCIES = libtests.a unix_pair_send_recv_SOURCES = unix-pair-send-recv.c unix_pair_send_recv_OBJECTS = unix-pair-send-recv.$(OBJEXT) unix_pair_send_recv_LDADD = $(LDADD) @@ -1739,6 +2791,18 @@ utimensat_SOURCES = utimensat.c utimensat_OBJECTS = utimensat.$(OBJEXT) utimensat_LDADD = $(LDADD) utimensat_DEPENDENCIES = libtests.a +utimensat_Xabbrev_SOURCES = utimensat-Xabbrev.c +utimensat_Xabbrev_OBJECTS = utimensat-Xabbrev.$(OBJEXT) +utimensat_Xabbrev_LDADD = $(LDADD) +utimensat_Xabbrev_DEPENDENCIES = libtests.a +utimensat_Xraw_SOURCES = utimensat-Xraw.c +utimensat_Xraw_OBJECTS = utimensat-Xraw.$(OBJEXT) +utimensat_Xraw_LDADD = $(LDADD) +utimensat_Xraw_DEPENDENCIES = libtests.a +utimensat_Xverbose_SOURCES = utimensat-Xverbose.c +utimensat_Xverbose_OBJECTS = utimensat-Xverbose.$(OBJEXT) +utimensat_Xverbose_LDADD = $(LDADD) +utimensat_Xverbose_DEPENDENCIES = libtests.a utimes_SOURCES = utimes.c utimes_OBJECTS = utimes.$(OBJEXT) utimes_LDADD = $(LDADD) @@ -1787,6 +2851,10 @@ xet_robust_list_SOURCES = xet_robust_list.c xet_robust_list_OBJECTS = xet_robust_list.$(OBJEXT) xet_robust_list_LDADD = $(LDADD) xet_robust_list_DEPENDENCIES = libtests.a +xet_thread_area_x86_SOURCES = xet_thread_area_x86.c +xet_thread_area_x86_OBJECTS = xet_thread_area_x86.$(OBJEXT) +xet_thread_area_x86_LDADD = $(LDADD) +xet_thread_area_x86_DEPENDENCIES = libtests.a xetitimer_SOURCES = xetitimer.c xetitimer_OBJECTS = xetitimer.$(OBJEXT) xetitimer_LDADD = $(LDADD) @@ -1803,6 +2871,10 @@ xettimeofday_SOURCES = xettimeofday.c xettimeofday_OBJECTS = xettimeofday.$(OBJEXT) xettimeofday_LDADD = $(LDADD) xettimeofday_DEPENDENCIES = libtests.a +zeroargc_SOURCES = zeroargc.c +zeroargc_OBJECTS = zeroargc.$(OBJEXT) +zeroargc_LDADD = $(LDADD) +zeroargc_DEPENDENCIES = libtests.a AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -1817,7 +2889,402 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/_newselect-P.Po \ + ./$(DEPDIR)/_newselect.Po ./$(DEPDIR)/accept.Po \ + ./$(DEPDIR)/accept4.Po ./$(DEPDIR)/access.Po \ + ./$(DEPDIR)/acct.Po ./$(DEPDIR)/add_key.Po \ + ./$(DEPDIR)/adjtimex.Po ./$(DEPDIR)/aio.Po \ + ./$(DEPDIR)/aio_pgetevents.Po ./$(DEPDIR)/alarm.Po \ + ./$(DEPDIR)/answer.Po ./$(DEPDIR)/attach-f-p-cmd.Po \ + ./$(DEPDIR)/attach-f-p.Po ./$(DEPDIR)/attach-p-cmd-cmd.Po \ + ./$(DEPDIR)/attach-p-cmd-p.Po \ + ./$(DEPDIR)/block_reset_raise_run.Po \ + ./$(DEPDIR)/bpf-obj_get_info_by_fd-prog-v.Po \ + ./$(DEPDIR)/bpf-obj_get_info_by_fd-prog.Po \ + ./$(DEPDIR)/bpf-obj_get_info_by_fd-v.Po \ + ./$(DEPDIR)/bpf-obj_get_info_by_fd.Po \ + ./$(DEPDIR)/bpf-success-v.Po ./$(DEPDIR)/bpf-success.Po \ + ./$(DEPDIR)/bpf-v.Po ./$(DEPDIR)/bpf.Po ./$(DEPDIR)/brk.Po \ + ./$(DEPDIR)/btrfs.Po ./$(DEPDIR)/caps-abbrev.Po \ + ./$(DEPDIR)/caps.Po ./$(DEPDIR)/check_sigblock.Po \ + ./$(DEPDIR)/check_sigign.Po ./$(DEPDIR)/chmod.Po \ + ./$(DEPDIR)/chown.Po ./$(DEPDIR)/chown32.Po \ + ./$(DEPDIR)/chroot.Po ./$(DEPDIR)/clock_adjtime.Po \ + ./$(DEPDIR)/clock_nanosleep.Po ./$(DEPDIR)/clock_xettime.Po \ + ./$(DEPDIR)/clone_parent.Po ./$(DEPDIR)/clone_ptrace.Po \ + ./$(DEPDIR)/copy_file_range.Po ./$(DEPDIR)/count-f.Po \ + ./$(DEPDIR)/creat.Po ./$(DEPDIR)/delay.Po \ + ./$(DEPDIR)/delete_module.Po ./$(DEPDIR)/dev-yy.Po \ + ./$(DEPDIR)/dup.Po ./$(DEPDIR)/dup2.Po ./$(DEPDIR)/dup3.Po \ + ./$(DEPDIR)/epoll_create.Po ./$(DEPDIR)/epoll_create1.Po \ + ./$(DEPDIR)/epoll_ctl.Po ./$(DEPDIR)/epoll_pwait.Po \ + ./$(DEPDIR)/epoll_wait.Po ./$(DEPDIR)/erestartsys.Po \ + ./$(DEPDIR)/eventfd.Po ./$(DEPDIR)/execve-v.Po \ + ./$(DEPDIR)/execve.Po ./$(DEPDIR)/execveat-v.Po \ + ./$(DEPDIR)/execveat.Po ./$(DEPDIR)/faccessat.Po \ + ./$(DEPDIR)/fadvise64.Po ./$(DEPDIR)/fadvise64_64.Po \ + ./$(DEPDIR)/fallocate.Po ./$(DEPDIR)/fanotify_init.Po \ + ./$(DEPDIR)/fanotify_mark-Xabbrev.Po \ + ./$(DEPDIR)/fanotify_mark-Xraw.Po \ + ./$(DEPDIR)/fanotify_mark-Xverbose.Po \ + ./$(DEPDIR)/fanotify_mark.Po ./$(DEPDIR)/fchdir.Po \ + ./$(DEPDIR)/fchmod.Po ./$(DEPDIR)/fchmodat.Po \ + ./$(DEPDIR)/fchown.Po ./$(DEPDIR)/fchown32.Po \ + ./$(DEPDIR)/fchownat.Po ./$(DEPDIR)/fcntl.Po \ + ./$(DEPDIR)/fcntl64.Po ./$(DEPDIR)/fdatasync.Po \ + ./$(DEPDIR)/fflush.Po ./$(DEPDIR)/file_handle.Po \ + ./$(DEPDIR)/file_ioctl.Po ./$(DEPDIR)/filter-unavailable.Po \ + ./$(DEPDIR)/finit_module.Po ./$(DEPDIR)/flock.Po \ + ./$(DEPDIR)/fork-f.Po ./$(DEPDIR)/fstat-Xabbrev.Po \ + ./$(DEPDIR)/fstat-Xraw.Po ./$(DEPDIR)/fstat-Xverbose.Po \ + ./$(DEPDIR)/fstat.Po ./$(DEPDIR)/fstat64-Xabbrev.Po \ + ./$(DEPDIR)/fstat64-Xraw.Po ./$(DEPDIR)/fstat64-Xverbose.Po \ + ./$(DEPDIR)/fstat64-fstat64.Po \ + ./$(DEPDIR)/fstatat64-fstatat64.Po ./$(DEPDIR)/fstatfs.Po \ + ./$(DEPDIR)/fstatfs64.Po ./$(DEPDIR)/fsync-y.Po \ + ./$(DEPDIR)/fsync.Po ./$(DEPDIR)/ftruncate.Po \ + ./$(DEPDIR)/ftruncate64-ftruncate64.Po ./$(DEPDIR)/futex.Po \ + ./$(DEPDIR)/futimesat.Po ./$(DEPDIR)/get_mempolicy.Po \ + ./$(DEPDIR)/getcpu.Po ./$(DEPDIR)/getcwd.Po \ + ./$(DEPDIR)/getdents.Po ./$(DEPDIR)/getdents64.Po \ + ./$(DEPDIR)/getegid.Po ./$(DEPDIR)/getegid32.Po \ + ./$(DEPDIR)/geteuid.Po ./$(DEPDIR)/geteuid32.Po \ + ./$(DEPDIR)/getgid.Po ./$(DEPDIR)/getgid32.Po \ + ./$(DEPDIR)/getgroups.Po ./$(DEPDIR)/getgroups32.Po \ + ./$(DEPDIR)/getpeername.Po ./$(DEPDIR)/getpgrp.Po \ + ./$(DEPDIR)/getpid.Po ./$(DEPDIR)/getppid.Po \ + ./$(DEPDIR)/getrandom.Po ./$(DEPDIR)/getresgid.Po \ + ./$(DEPDIR)/getresgid32.Po ./$(DEPDIR)/getresuid.Po \ + ./$(DEPDIR)/getresuid32.Po ./$(DEPDIR)/getrlimit.Po \ + ./$(DEPDIR)/getrusage.Po ./$(DEPDIR)/getsid.Po \ + ./$(DEPDIR)/getsockname.Po ./$(DEPDIR)/gettid.Po \ + ./$(DEPDIR)/getuid.Po ./$(DEPDIR)/getuid32.Po \ + ./$(DEPDIR)/getxxid.Po ./$(DEPDIR)/group_req.Po \ + ./$(DEPDIR)/inet-cmsg.Po ./$(DEPDIR)/init_module.Po \ + ./$(DEPDIR)/inject-nf.Po ./$(DEPDIR)/inotify.Po \ + ./$(DEPDIR)/inotify_init1.Po ./$(DEPDIR)/int_0x80.Po \ + ./$(DEPDIR)/io_uring_enter.Po ./$(DEPDIR)/io_uring_register.Po \ + ./$(DEPDIR)/io_uring_setup.Po ./$(DEPDIR)/ioctl.Po \ + ./$(DEPDIR)/ioctl_block.Po ./$(DEPDIR)/ioctl_dm-v.Po \ + ./$(DEPDIR)/ioctl_dm.Po ./$(DEPDIR)/ioctl_evdev-success-v.Po \ + ./$(DEPDIR)/ioctl_evdev-success.Po \ + ./$(DEPDIR)/ioctl_evdev-v.Po ./$(DEPDIR)/ioctl_evdev.Po \ + ./$(DEPDIR)/ioctl_inotify.Po ./$(DEPDIR)/ioctl_kvm_run-v.Po \ + ./$(DEPDIR)/ioctl_kvm_run.Po \ + ./$(DEPDIR)/ioctl_kvm_run_auxstr_vcpu.Po \ + ./$(DEPDIR)/ioctl_loop-nv.Po ./$(DEPDIR)/ioctl_loop-v.Po \ + ./$(DEPDIR)/ioctl_loop.Po ./$(DEPDIR)/ioctl_mtd.Po \ + ./$(DEPDIR)/ioctl_nbd.Po ./$(DEPDIR)/ioctl_nsfs.Po \ + ./$(DEPDIR)/ioctl_perf-success.Po ./$(DEPDIR)/ioctl_perf.Po \ + ./$(DEPDIR)/ioctl_ptp.Po ./$(DEPDIR)/ioctl_random.Po \ + ./$(DEPDIR)/ioctl_rtc-v.Po ./$(DEPDIR)/ioctl_rtc.Po \ + ./$(DEPDIR)/ioctl_scsi.Po ./$(DEPDIR)/ioctl_sg_io_v3.Po \ + ./$(DEPDIR)/ioctl_sg_io_v4.Po \ + ./$(DEPDIR)/ioctl_sock_gifconf.Po ./$(DEPDIR)/ioctl_uffdio.Po \ + ./$(DEPDIR)/ioctl_v4l2.Po ./$(DEPDIR)/ioperm.Po \ + ./$(DEPDIR)/iopl.Po ./$(DEPDIR)/ioprio-Xabbrev.Po \ + ./$(DEPDIR)/ioprio-Xraw.Po ./$(DEPDIR)/ioprio-Xverbose.Po \ + ./$(DEPDIR)/ioprio.Po ./$(DEPDIR)/ip_mreq.Po \ + ./$(DEPDIR)/ipc.Po ./$(DEPDIR)/ipc_msg-Xabbrev.Po \ + ./$(DEPDIR)/ipc_msg-Xraw.Po ./$(DEPDIR)/ipc_msg-Xverbose.Po \ + ./$(DEPDIR)/ipc_msg.Po ./$(DEPDIR)/ipc_msgbuf-Xabbrev.Po \ + ./$(DEPDIR)/ipc_msgbuf-Xraw.Po \ + ./$(DEPDIR)/ipc_msgbuf-Xverbose.Po ./$(DEPDIR)/ipc_msgbuf.Po \ + ./$(DEPDIR)/ipc_sem-Xabbrev.Po ./$(DEPDIR)/ipc_sem-Xraw.Po \ + ./$(DEPDIR)/ipc_sem-Xverbose.Po ./$(DEPDIR)/ipc_sem.Po \ + ./$(DEPDIR)/ipc_shm-Xabbrev.Po ./$(DEPDIR)/ipc_shm-Xraw.Po \ + ./$(DEPDIR)/ipc_shm-Xverbose.Po ./$(DEPDIR)/ipc_shm.Po \ + ./$(DEPDIR)/is_linux_mips_n64.Po ./$(DEPDIR)/kcmp-y.Po \ + ./$(DEPDIR)/kcmp.Po ./$(DEPDIR)/kern_features.Po \ + ./$(DEPDIR)/kernel_version-Xabbrev.Po \ + ./$(DEPDIR)/kernel_version-Xraw.Po \ + ./$(DEPDIR)/kernel_version-Xverbose.Po \ + ./$(DEPDIR)/kernel_version.Po ./$(DEPDIR)/kexec_file_load.Po \ + ./$(DEPDIR)/kexec_load.Po ./$(DEPDIR)/keyctl-Xabbrev.Po \ + ./$(DEPDIR)/keyctl-Xraw.Po ./$(DEPDIR)/keyctl-Xverbose.Po \ + ./$(DEPDIR)/keyctl.Po ./$(DEPDIR)/kill.Po \ + ./$(DEPDIR)/kill_child.Po ./$(DEPDIR)/ksysent.Po \ + ./$(DEPDIR)/lchown.Po ./$(DEPDIR)/lchown32.Po \ + ./$(DEPDIR)/libtests_a-create_nl_socket.Po \ + ./$(DEPDIR)/libtests_a-errno2name.Po \ + ./$(DEPDIR)/libtests_a-error_msg.Po \ + ./$(DEPDIR)/libtests_a-fill_memory.Po \ + ./$(DEPDIR)/libtests_a-get_page_size.Po \ + ./$(DEPDIR)/libtests_a-get_sigset_size.Po \ + ./$(DEPDIR)/libtests_a-hexdump_strdup.Po \ + ./$(DEPDIR)/libtests_a-hexquote_strndup.Po \ + ./$(DEPDIR)/libtests_a-ifindex.Po \ + ./$(DEPDIR)/libtests_a-inode_of_sockfd.Po \ + ./$(DEPDIR)/libtests_a-libmmsg.Po \ + ./$(DEPDIR)/libtests_a-libsocketcall.Po \ + ./$(DEPDIR)/libtests_a-overflowuid.Po \ + ./$(DEPDIR)/libtests_a-pipe_maxfd.Po \ + ./$(DEPDIR)/libtests_a-print_quoted_string.Po \ + ./$(DEPDIR)/libtests_a-print_time.Po \ + ./$(DEPDIR)/libtests_a-printflags.Po \ + ./$(DEPDIR)/libtests_a-printxval.Po \ + ./$(DEPDIR)/libtests_a-signal2name.Po \ + ./$(DEPDIR)/libtests_a-skip_unavailable.Po \ + ./$(DEPDIR)/libtests_a-sprintrc.Po \ + ./$(DEPDIR)/libtests_a-tail_alloc.Po \ + ./$(DEPDIR)/libtests_a-test_printpath.Po \ + ./$(DEPDIR)/libtests_a-test_printstrn.Po \ + ./$(DEPDIR)/libtests_a-test_ucopy.Po \ + ./$(DEPDIR)/libtests_a-tprintf.Po ./$(DEPDIR)/link.Po \ + ./$(DEPDIR)/linkat.Po ./$(DEPDIR)/list_sigaction_signum.Po \ + ./$(DEPDIR)/llseek.Po ./$(DEPDIR)/localtime.Po \ + ./$(DEPDIR)/lookup_dcookie.Po ./$(DEPDIR)/looping_threads.Po \ + ./$(DEPDIR)/lseek.Po ./$(DEPDIR)/lstat.Po \ + ./$(DEPDIR)/lstat64-lstat64.Po ./$(DEPDIR)/madvise.Po \ + ./$(DEPDIR)/mbind.Po ./$(DEPDIR)/membarrier.Po \ + ./$(DEPDIR)/memfd_create-Xabbrev.Po \ + ./$(DEPDIR)/memfd_create-Xraw.Po \ + ./$(DEPDIR)/memfd_create-Xverbose.Po \ + ./$(DEPDIR)/memfd_create.Po ./$(DEPDIR)/migrate_pages.Po \ + ./$(DEPDIR)/mincore.Po ./$(DEPDIR)/mkdir.Po \ + ./$(DEPDIR)/mkdirat.Po ./$(DEPDIR)/mknod.Po \ + ./$(DEPDIR)/mknodat.Po ./$(DEPDIR)/mlock.Po \ + ./$(DEPDIR)/mlock2.Po ./$(DEPDIR)/mlockall.Po \ + ./$(DEPDIR)/mmap-Xabbrev.Po ./$(DEPDIR)/mmap-Xraw.Po \ + ./$(DEPDIR)/mmap-Xverbose.Po ./$(DEPDIR)/mmap.Po \ + ./$(DEPDIR)/mmap64-mmap64.Po \ + ./$(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Po \ + ./$(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Po \ + ./$(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Po \ + ./$(DEPDIR)/mmsg-silent.Po ./$(DEPDIR)/mmsg.Po \ + ./$(DEPDIR)/mmsg_name-v.Po ./$(DEPDIR)/mmsg_name.Po \ + ./$(DEPDIR)/modify_ldt.Po ./$(DEPDIR)/mount-Xabbrev.Po \ + ./$(DEPDIR)/mount-Xraw.Po ./$(DEPDIR)/mount-Xverbose.Po \ + ./$(DEPDIR)/mount.Po ./$(DEPDIR)/move_pages-Xabbrev.Po \ + ./$(DEPDIR)/move_pages-Xraw.Po \ + ./$(DEPDIR)/move_pages-Xverbose.Po ./$(DEPDIR)/move_pages.Po \ + ./$(DEPDIR)/mq.Po ./$(DEPDIR)/mq_sendrecv-read.Po \ + ./$(DEPDIR)/mq_sendrecv-write.Po ./$(DEPDIR)/mq_sendrecv.Po \ + ./$(DEPDIR)/msg_control-v.Po ./$(DEPDIR)/msg_control.Po \ + ./$(DEPDIR)/msg_name.Po ./$(DEPDIR)/munlockall.Po \ + ./$(DEPDIR)/nanosleep.Po ./$(DEPDIR)/net-accept-connect.Po \ + ./$(DEPDIR)/net-icmp_filter.Po \ + ./$(DEPDIR)/net-packet_mreq-Xabbrev.Po \ + ./$(DEPDIR)/net-packet_mreq-Xraw.Po \ + ./$(DEPDIR)/net-packet_mreq-Xverbose.Po \ + ./$(DEPDIR)/net-packet_mreq.Po ./$(DEPDIR)/net-sockaddr.Po \ + ./$(DEPDIR)/net-tpacket_req.Po \ + ./$(DEPDIR)/net-tpacket_stats-success.Po \ + ./$(DEPDIR)/net-tpacket_stats.Po ./$(DEPDIR)/net-y-unix.Po \ + ./$(DEPDIR)/net-yy-inet.Po ./$(DEPDIR)/net-yy-inet6.Po \ + ./$(DEPDIR)/net-yy-netlink.Po ./$(DEPDIR)/net-yy-unix.Po \ + ./$(DEPDIR)/netlink_audit.Po ./$(DEPDIR)/netlink_crypto.Po \ + ./$(DEPDIR)/netlink_generic.Po \ + ./$(DEPDIR)/netlink_inet_diag.Po \ + ./$(DEPDIR)/netlink_kobject_uevent.Po \ + ./$(DEPDIR)/netlink_netfilter.Po \ + ./$(DEPDIR)/netlink_netlink_diag.Po \ + ./$(DEPDIR)/netlink_protocol.Po ./$(DEPDIR)/netlink_route.Po \ + ./$(DEPDIR)/netlink_selinux.Po \ + ./$(DEPDIR)/netlink_sock_diag.Po \ + ./$(DEPDIR)/netlink_unix_diag.Po ./$(DEPDIR)/netlink_xfrm.Po \ + ./$(DEPDIR)/newfstatat-newfstatat.Po \ + ./$(DEPDIR)/nfnetlink_acct.Po \ + ./$(DEPDIR)/nfnetlink_cthelper.Po \ + ./$(DEPDIR)/nfnetlink_ctnetlink.Po \ + ./$(DEPDIR)/nfnetlink_ctnetlink_exp.Po \ + ./$(DEPDIR)/nfnetlink_cttimeout.Po \ + ./$(DEPDIR)/nfnetlink_ipset.Po \ + ./$(DEPDIR)/nfnetlink_nft_compat.Po \ + ./$(DEPDIR)/nfnetlink_nftables.Po ./$(DEPDIR)/nfnetlink_osf.Po \ + ./$(DEPDIR)/nfnetlink_queue.Po ./$(DEPDIR)/nfnetlink_ulog.Po \ + ./$(DEPDIR)/nlattr.Po ./$(DEPDIR)/nlattr_br_port_msg.Po \ + ./$(DEPDIR)/nlattr_crypto_user_alg.Po \ + ./$(DEPDIR)/nlattr_dcbmsg.Po \ + ./$(DEPDIR)/nlattr_fib_rule_hdr.Po \ + ./$(DEPDIR)/nlattr_ifaddrlblmsg.Po \ + ./$(DEPDIR)/nlattr_ifaddrmsg.Po \ + ./$(DEPDIR)/nlattr_ifinfomsg.Po \ + ./$(DEPDIR)/nlattr_ifla_af_spec.Po \ + ./$(DEPDIR)/nlattr_ifla_brport.Po \ + ./$(DEPDIR)/nlattr_ifla_linkinfo.Po \ + ./$(DEPDIR)/nlattr_ifla_port.Po ./$(DEPDIR)/nlattr_ifla_xdp.Po \ + ./$(DEPDIR)/nlattr_inet_diag_msg.Po \ + ./$(DEPDIR)/nlattr_inet_diag_req_compat.Po \ + ./$(DEPDIR)/nlattr_inet_diag_req_v2.Po \ + ./$(DEPDIR)/nlattr_mdba_mdb_entry.Po \ + ./$(DEPDIR)/nlattr_mdba_router_port.Po \ + ./$(DEPDIR)/nlattr_ndmsg.Po ./$(DEPDIR)/nlattr_ndtmsg.Po \ + ./$(DEPDIR)/nlattr_netconfmsg.Po \ + ./$(DEPDIR)/nlattr_netlink_diag_msg.Po \ + ./$(DEPDIR)/nlattr_nlmsgerr.Po \ + ./$(DEPDIR)/nlattr_packet_diag_msg.Po \ + ./$(DEPDIR)/nlattr_rtgenmsg.Po ./$(DEPDIR)/nlattr_rtmsg.Po \ + ./$(DEPDIR)/nlattr_smc_diag_msg.Po \ + ./$(DEPDIR)/nlattr_tc_stats.Po ./$(DEPDIR)/nlattr_tca_stab.Po \ + ./$(DEPDIR)/nlattr_tcamsg.Po ./$(DEPDIR)/nlattr_tcmsg.Po \ + ./$(DEPDIR)/nlattr_unix_diag_msg.Po ./$(DEPDIR)/nsyscalls-d.Po \ + ./$(DEPDIR)/nsyscalls.Po ./$(DEPDIR)/old_mmap-P.Po \ + ./$(DEPDIR)/old_mmap-Xabbrev.Po ./$(DEPDIR)/old_mmap-Xraw.Po \ + ./$(DEPDIR)/old_mmap-Xverbose.Po \ + ./$(DEPDIR)/old_mmap-v-none.Po ./$(DEPDIR)/old_mmap.Po \ + ./$(DEPDIR)/oldfstat.Po ./$(DEPDIR)/oldlstat.Po \ + ./$(DEPDIR)/oldselect-P.Po ./$(DEPDIR)/oldselect-efault-P.Po \ + ./$(DEPDIR)/oldselect-efault.Po ./$(DEPDIR)/oldselect.Po \ + ./$(DEPDIR)/oldstat.Po ./$(DEPDIR)/open.Po \ + ./$(DEPDIR)/openat.Po ./$(DEPDIR)/orphaned_process_group.Po \ + ./$(DEPDIR)/osf_utimes.Po ./$(DEPDIR)/pause.Po \ + ./$(DEPDIR)/pc.Po ./$(DEPDIR)/perf_event_open.Po \ + ./$(DEPDIR)/perf_event_open_nonverbose.Po \ + ./$(DEPDIR)/perf_event_open_unabbrev.Po \ + ./$(DEPDIR)/personality-Xabbrev.Po \ + ./$(DEPDIR)/personality-Xraw.Po \ + ./$(DEPDIR)/personality-Xverbose.Po ./$(DEPDIR)/personality.Po \ + ./$(DEPDIR)/pidfd_send_signal.Po ./$(DEPDIR)/pipe.Po \ + ./$(DEPDIR)/pipe2.Po ./$(DEPDIR)/pkey_alloc.Po \ + ./$(DEPDIR)/pkey_free.Po ./$(DEPDIR)/pkey_mprotect.Po \ + ./$(DEPDIR)/poll-P.Po ./$(DEPDIR)/poll.Po \ + ./$(DEPDIR)/ppoll-P.Po ./$(DEPDIR)/ppoll-v.Po \ + ./$(DEPDIR)/ppoll.Po ./$(DEPDIR)/prctl-arg2-intptr.Po \ + ./$(DEPDIR)/prctl-dumpable.Po ./$(DEPDIR)/prctl-name.Po \ + ./$(DEPDIR)/prctl-no-args.Po ./$(DEPDIR)/prctl-pdeathsig.Po \ + ./$(DEPDIR)/prctl-seccomp-filter-v.Po \ + ./$(DEPDIR)/prctl-seccomp-strict.Po \ + ./$(DEPDIR)/prctl-securebits.Po \ + ./$(DEPDIR)/prctl-spec-inject.Po \ + ./$(DEPDIR)/prctl-tid_address.Po ./$(DEPDIR)/prctl-tsc.Po \ + ./$(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po \ + ./$(DEPDIR)/preadv-preadv.Po ./$(DEPDIR)/preadv2-pwritev2.Po \ + ./$(DEPDIR)/preadv_pwritev-preadv-pwritev.Po \ + ./$(DEPDIR)/print_maxfd.Po \ + ./$(DEPDIR)/printpath-umovestr-peekdata.Po \ + ./$(DEPDIR)/printpath-umovestr-undumpable.Po \ + ./$(DEPDIR)/printpath-umovestr.Po \ + ./$(DEPDIR)/printsignal-Xabbrev.Po \ + ./$(DEPDIR)/printsignal-Xraw.Po \ + ./$(DEPDIR)/printsignal-Xverbose.Po ./$(DEPDIR)/printstr.Po \ + ./$(DEPDIR)/printstrn-umoven-peekdata.Po \ + ./$(DEPDIR)/printstrn-umoven-undumpable.Po \ + ./$(DEPDIR)/printstrn-umoven.Po ./$(DEPDIR)/prlimit64.Po \ + ./$(DEPDIR)/process_vm_readv.Po \ + ./$(DEPDIR)/process_vm_writev.Po ./$(DEPDIR)/pselect6.Po \ + ./$(DEPDIR)/ptrace.Po ./$(DEPDIR)/ptrace_syscall_info.Po \ + ./$(DEPDIR)/pwritev-pwritev.Po ./$(DEPDIR)/qual_fault.Po \ + ./$(DEPDIR)/qual_inject-error-signal.Po \ + ./$(DEPDIR)/qual_inject-retval.Po \ + ./$(DEPDIR)/qual_inject-signal.Po ./$(DEPDIR)/qual_signal.Po \ + ./$(DEPDIR)/quotactl-Xabbrev.Po ./$(DEPDIR)/quotactl-Xraw.Po \ + ./$(DEPDIR)/quotactl-Xverbose.Po \ + ./$(DEPDIR)/quotactl-success-v.Po \ + ./$(DEPDIR)/quotactl-success.Po ./$(DEPDIR)/quotactl-v.Po \ + ./$(DEPDIR)/quotactl-xfs-success-v.Po \ + ./$(DEPDIR)/quotactl-xfs-success.Po \ + ./$(DEPDIR)/quotactl-xfs-v.Po ./$(DEPDIR)/quotactl-xfs.Po \ + ./$(DEPDIR)/quotactl.Po ./$(DEPDIR)/read-write.Po \ + ./$(DEPDIR)/readahead.Po ./$(DEPDIR)/readdir.Po \ + ./$(DEPDIR)/readlink.Po ./$(DEPDIR)/readlinkat.Po \ + ./$(DEPDIR)/readv.Po ./$(DEPDIR)/reboot.Po \ + ./$(DEPDIR)/recvfrom.Po ./$(DEPDIR)/recvmmsg-timeout.Po \ + ./$(DEPDIR)/recvmsg.Po ./$(DEPDIR)/redirect-fds.Po \ + ./$(DEPDIR)/remap_file_pages-Xabbrev.Po \ + ./$(DEPDIR)/remap_file_pages-Xraw.Po \ + ./$(DEPDIR)/remap_file_pages-Xverbose.Po \ + ./$(DEPDIR)/remap_file_pages.Po ./$(DEPDIR)/rename.Po \ + ./$(DEPDIR)/renameat.Po ./$(DEPDIR)/renameat2.Po \ + ./$(DEPDIR)/request_key.Po ./$(DEPDIR)/restart_syscall.Po \ + ./$(DEPDIR)/riscv_flush_icache.Po ./$(DEPDIR)/rmdir.Po \ + ./$(DEPDIR)/rt_sigaction.Po ./$(DEPDIR)/rt_sigpending.Po \ + ./$(DEPDIR)/rt_sigprocmask.Po ./$(DEPDIR)/rt_sigqueueinfo.Po \ + ./$(DEPDIR)/rt_sigreturn.Po ./$(DEPDIR)/rt_sigsuspend.Po \ + ./$(DEPDIR)/rt_sigtimedwait.Po \ + ./$(DEPDIR)/rt_tgsigqueueinfo.Po \ + ./$(DEPDIR)/run_expect_termsig.Po \ + ./$(DEPDIR)/s390_guarded_storage-v.Po \ + ./$(DEPDIR)/s390_guarded_storage.Po \ + ./$(DEPDIR)/s390_pci_mmio_read_write.Po \ + ./$(DEPDIR)/s390_runtime_instr.Po ./$(DEPDIR)/s390_sthyi-v.Po \ + ./$(DEPDIR)/s390_sthyi.Po \ + ./$(DEPDIR)/sched_get_priority_mxx.Po \ + ./$(DEPDIR)/sched_rr_get_interval.Po \ + ./$(DEPDIR)/sched_xetaffinity.Po ./$(DEPDIR)/sched_xetattr.Po \ + ./$(DEPDIR)/sched_xetparam.Po \ + ./$(DEPDIR)/sched_xetscheduler.Po ./$(DEPDIR)/sched_yield.Po \ + ./$(DEPDIR)/scm_rights.Po ./$(DEPDIR)/seccomp-filter-v.Po \ + ./$(DEPDIR)/seccomp-filter.Po ./$(DEPDIR)/seccomp-strict.Po \ + ./$(DEPDIR)/seccomp_get_action_avail.Po \ + ./$(DEPDIR)/select-P.Po ./$(DEPDIR)/select.Po \ + ./$(DEPDIR)/semop.Po ./$(DEPDIR)/sendfile.Po \ + ./$(DEPDIR)/sendfile64.Po ./$(DEPDIR)/set_mempolicy.Po \ + ./$(DEPDIR)/set_ptracer_any.Po ./$(DEPDIR)/set_sigblock.Po \ + ./$(DEPDIR)/set_sigign.Po ./$(DEPDIR)/setdomainname.Po \ + ./$(DEPDIR)/setfsgid.Po ./$(DEPDIR)/setfsgid32.Po \ + ./$(DEPDIR)/setfsuid.Po ./$(DEPDIR)/setfsuid32.Po \ + ./$(DEPDIR)/setgid.Po ./$(DEPDIR)/setgid32.Po \ + ./$(DEPDIR)/setgroups.Po ./$(DEPDIR)/setgroups32.Po \ + ./$(DEPDIR)/sethostname.Po ./$(DEPDIR)/setns.Po \ + ./$(DEPDIR)/setregid.Po ./$(DEPDIR)/setregid32.Po \ + ./$(DEPDIR)/setresgid.Po ./$(DEPDIR)/setresgid32.Po \ + ./$(DEPDIR)/setresuid.Po ./$(DEPDIR)/setresuid32.Po \ + ./$(DEPDIR)/setreuid.Po ./$(DEPDIR)/setreuid32.Po \ + ./$(DEPDIR)/setrlimit-Xabbrev.Po ./$(DEPDIR)/setrlimit-Xraw.Po \ + ./$(DEPDIR)/setrlimit-Xverbose.Po ./$(DEPDIR)/setrlimit.Po \ + ./$(DEPDIR)/setuid.Po ./$(DEPDIR)/setuid32.Po \ + ./$(DEPDIR)/shmxt.Po ./$(DEPDIR)/shutdown.Po \ + ./$(DEPDIR)/sigaction.Po ./$(DEPDIR)/sigaltstack.Po \ + ./$(DEPDIR)/siginfo.Po ./$(DEPDIR)/signal.Po \ + ./$(DEPDIR)/signal_receive.Po ./$(DEPDIR)/signalfd4.Po \ + ./$(DEPDIR)/sigpending.Po ./$(DEPDIR)/sigprocmask.Po \ + ./$(DEPDIR)/sigreturn.Po ./$(DEPDIR)/sigsuspend.Po \ + ./$(DEPDIR)/sleep.Po ./$(DEPDIR)/so_error.Po \ + ./$(DEPDIR)/so_linger.Po ./$(DEPDIR)/so_peercred-Xabbrev.Po \ + ./$(DEPDIR)/so_peercred-Xraw.Po \ + ./$(DEPDIR)/so_peercred-Xverbose.Po ./$(DEPDIR)/so_peercred.Po \ + ./$(DEPDIR)/sock_filter-v-Xabbrev.Po \ + ./$(DEPDIR)/sock_filter-v-Xraw.Po \ + ./$(DEPDIR)/sock_filter-v-Xverbose.Po \ + ./$(DEPDIR)/sock_filter-v.Po \ + ./$(DEPDIR)/sockaddr_xlat-Xabbrev.Po \ + ./$(DEPDIR)/sockaddr_xlat-Xraw.Po \ + ./$(DEPDIR)/sockaddr_xlat-Xverbose.Po \ + ./$(DEPDIR)/socketcall.Po ./$(DEPDIR)/sockopt-sol_netlink.Po \ + ./$(DEPDIR)/sockopt-timestamp.Po ./$(DEPDIR)/splice.Po \ + ./$(DEPDIR)/stack-fcall-0.Po ./$(DEPDIR)/stack-fcall-1.Po \ + ./$(DEPDIR)/stack-fcall-2.Po ./$(DEPDIR)/stack-fcall-3.Po \ + ./$(DEPDIR)/stack-fcall-mangled-0.Po \ + ./$(DEPDIR)/stack-fcall-mangled-1.Po \ + ./$(DEPDIR)/stack-fcall-mangled-2.Po \ + ./$(DEPDIR)/stack-fcall-mangled-3.Po \ + ./$(DEPDIR)/stack-fcall-mangled.Po ./$(DEPDIR)/stack-fcall.Po \ + ./$(DEPDIR)/stat.Po ./$(DEPDIR)/stat64-stat64.Po \ + ./$(DEPDIR)/statfs-statfs.Po ./$(DEPDIR)/statfs64.Po \ + ./$(DEPDIR)/statx.Po ./$(DEPDIR)/swap.Po \ + ./$(DEPDIR)/sxetmask.Po ./$(DEPDIR)/symlink.Po \ + ./$(DEPDIR)/symlinkat.Po ./$(DEPDIR)/sync.Po \ + ./$(DEPDIR)/sync_file_range.Po ./$(DEPDIR)/sync_file_range2.Po \ + ./$(DEPDIR)/sysinfo.Po ./$(DEPDIR)/syslog.Po \ + ./$(DEPDIR)/tee.Po ./$(DEPDIR)/threads-execve.Po \ + ./$(DEPDIR)/time.Po ./$(DEPDIR)/timer_create.Po \ + ./$(DEPDIR)/timer_xettime.Po ./$(DEPDIR)/timerfd_xettime.Po \ + ./$(DEPDIR)/times-fail.Po ./$(DEPDIR)/times.Po \ + ./$(DEPDIR)/truncate.Po ./$(DEPDIR)/truncate64-truncate64.Po \ + ./$(DEPDIR)/ugetrlimit.Po ./$(DEPDIR)/uio-uio.Po \ + ./$(DEPDIR)/umask.Po ./$(DEPDIR)/umount.Po \ + ./$(DEPDIR)/umount2.Po ./$(DEPDIR)/umoven-illptr.Po \ + ./$(DEPDIR)/umovestr-illptr.Po ./$(DEPDIR)/umovestr.Po \ + ./$(DEPDIR)/umovestr2.Po ./$(DEPDIR)/umovestr3.Po \ + ./$(DEPDIR)/uname.Po ./$(DEPDIR)/unblock_reset_raise.Po \ + ./$(DEPDIR)/unix-pair-send-recv.Po \ + ./$(DEPDIR)/unix-pair-sendto-recvfrom.Po ./$(DEPDIR)/unlink.Po \ + ./$(DEPDIR)/unlinkat.Po ./$(DEPDIR)/unshare.Po \ + ./$(DEPDIR)/userfaultfd.Po ./$(DEPDIR)/ustat.Po \ + ./$(DEPDIR)/utime.Po ./$(DEPDIR)/utimensat-Xabbrev.Po \ + ./$(DEPDIR)/utimensat-Xraw.Po \ + ./$(DEPDIR)/utimensat-Xverbose.Po ./$(DEPDIR)/utimensat.Po \ + ./$(DEPDIR)/utimes.Po ./$(DEPDIR)/vfork-f.Po \ + ./$(DEPDIR)/vhangup.Po ./$(DEPDIR)/vmsplice.Po \ + ./$(DEPDIR)/wait4-v.Po ./$(DEPDIR)/wait4.Po \ + ./$(DEPDIR)/waitid-v.Po ./$(DEPDIR)/waitid.Po \ + ./$(DEPDIR)/waitpid.Po ./$(DEPDIR)/xattr-strings.Po \ + ./$(DEPDIR)/xattr.Po ./$(DEPDIR)/xet_robust_list.Po \ + ./$(DEPDIR)/xet_thread_area_x86.Po ./$(DEPDIR)/xetitimer.Po \ + ./$(DEPDIR)/xetpgid.Po ./$(DEPDIR)/xetpriority.Po \ + ./$(DEPDIR)/xettimeofday.Po ./$(DEPDIR)/zeroargc.Po am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -1835,182 +3302,349 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(libtests_a_SOURCES) _newselect.c accept.c accept4.c \ - access.c acct.c add_key.c adjtimex.c aio.c alarm.c answer.c \ - attach-f-p.c attach-f-p-cmd.c attach-p-cmd-cmd.c \ - attach-p-cmd-p.c bpf.c brk.c btrfs.c caps.c caps-abbrev.c \ - chmod.c chown.c chown32.c chroot.c clock_adjtime.c \ - clock_nanosleep.c clock_xettime.c copy_file_range.c count-f.c \ - creat.c delete_module.c dup.c dup2.c dup3.c epoll_create.c \ - epoll_create1.c epoll_ctl.c epoll_pwait.c epoll_wait.c \ - erestartsys.c eventfd.c execve.c execve-v.c execveat.c \ - execveat-v.c faccessat.c fadvise64.c fadvise64_64.c \ - fallocate.c fanotify_init.c fanotify_mark.c fchdir.c fchmod.c \ - fchmodat.c fchown.c fchown32.c fchownat.c fcntl.c fcntl64.c \ - fdatasync.c file_handle.c file_ioctl.c filter-unavailable.c \ - finit_module.c flock.c fork-f.c fstat.c fstat64.c fstatat64.c \ - fstatfs.c fstatfs64.c fsync.c ftruncate.c ftruncate64.c \ - futex.c futimesat.c get_mempolicy.c getcpu.c getcwd.c \ - getdents.c getdents64.c getegid.c getegid32.c geteuid.c \ - geteuid32.c getgid.c getgid32.c getgroups.c getgroups32.c \ - getpeername.c getpgrp.c getrandom.c getresgid.c getresgid32.c \ +SOURCES = $(libtests_a_SOURCES) _newselect.c _newselect-P.c accept.c \ + accept4.c access.c acct.c add_key.c adjtimex.c aio.c \ + aio_pgetevents.c alarm.c answer.c attach-f-p.c \ + attach-f-p-cmd.c attach-p-cmd-cmd.c attach-p-cmd-p.c \ + block_reset_raise_run.c bpf.c bpf-obj_get_info_by_fd.c \ + bpf-obj_get_info_by_fd-prog.c bpf-obj_get_info_by_fd-prog-v.c \ + bpf-obj_get_info_by_fd-v.c bpf-success.c bpf-success-v.c \ + bpf-v.c brk.c btrfs.c caps.c caps-abbrev.c check_sigblock.c \ + check_sigign.c chmod.c chown.c chown32.c chroot.c \ + clock_adjtime.c clock_nanosleep.c clock_xettime.c \ + clone_parent.c clone_ptrace.c copy_file_range.c count-f.c \ + creat.c delay.c delete_module.c dev-yy.c dup.c dup2.c dup3.c \ + epoll_create.c epoll_create1.c epoll_ctl.c epoll_pwait.c \ + epoll_wait.c erestartsys.c eventfd.c execve.c execve-v.c \ + execveat.c execveat-v.c faccessat.c fadvise64.c fadvise64_64.c \ + fallocate.c fanotify_init.c fanotify_mark.c \ + fanotify_mark-Xabbrev.c fanotify_mark-Xraw.c \ + fanotify_mark-Xverbose.c fchdir.c fchmod.c fchmodat.c fchown.c \ + fchown32.c fchownat.c fcntl.c fcntl64.c fdatasync.c fflush.c \ + file_handle.c file_ioctl.c filter-unavailable.c finit_module.c \ + flock.c fork-f.c fstat.c fstat-Xabbrev.c fstat-Xraw.c \ + fstat-Xverbose.c fstat64.c fstat64-Xabbrev.c fstat64-Xraw.c \ + fstat64-Xverbose.c fstatat64.c fstatfs.c fstatfs64.c fsync.c \ + fsync-y.c ftruncate.c ftruncate64.c futex.c futimesat.c \ + get_mempolicy.c getcpu.c getcwd.c getdents.c getdents64.c \ + getegid.c getegid32.c geteuid.c geteuid32.c getgid.c \ + getgid32.c getgroups.c getgroups32.c getpeername.c getpgrp.c \ + getpid.c getppid.c getrandom.c getresgid.c getresgid32.c \ getresuid.c getresuid32.c getrlimit.c getrusage.c getsid.c \ - getsockname.c getuid.c getuid32.c getxxid.c inet-cmsg.c \ - init_module.c inotify.c inotify_init1.c ioctl.c ioctl_block.c \ - ioctl_dm.c ioctl_dm-v.c ioctl_evdev.c ioctl_evdev-v.c \ + getsockname.c gettid.c getuid.c getuid32.c getxxid.c \ + group_req.c inet-cmsg.c init_module.c inject-nf.c inotify.c \ + inotify_init1.c int_0x80.c io_uring_enter.c \ + io_uring_register.c io_uring_setup.c ioctl.c ioctl_block.c \ + ioctl_dm.c ioctl_dm-v.c ioctl_evdev.c ioctl_evdev-success.c \ + ioctl_evdev-success-v.c ioctl_evdev-v.c ioctl_inotify.c \ + ioctl_kvm_run.c ioctl_kvm_run-v.c ioctl_kvm_run_auxstr_vcpu.c \ ioctl_loop.c ioctl_loop-nv.c ioctl_loop-v.c ioctl_mtd.c \ - ioctl_rtc.c ioctl_rtc-v.c ioctl_scsi.c ioctl_sg_io_v3.c \ - ioctl_sg_io_v4.c ioctl_sock_gifconf.c ioctl_uffdio.c \ - ioctl_v4l2.c ioperm.c iopl.c ioprio.c ip_mreq.c ipc.c \ - ipc_msg.c ipc_msgbuf.c ipc_sem.c ipc_shm.c kcmp.c \ - kexec_file_load.c kexec_load.c keyctl.c kill.c ksysent.c \ - lchown.c lchown32.c link.c linkat.c llseek.c lookup_dcookie.c \ - lseek.c lstat.c lstat64.c mbind.c membarrier.c memfd_create.c \ - migrate_pages.c mincore.c mkdir.c mkdirat.c mknod.c mknodat.c \ - mlock.c mlock2.c mlockall.c mmap.c mmap64.c mmsg.c \ - mmsg-silent.c mmsg_name.c mmsg_name-v.c mount.c move_pages.c \ + ioctl_nbd.c ioctl_nsfs.c ioctl_perf.c ioctl_perf-success.c \ + ioctl_ptp.c ioctl_random.c ioctl_rtc.c ioctl_rtc-v.c \ + ioctl_scsi.c ioctl_sg_io_v3.c ioctl_sg_io_v4.c \ + ioctl_sock_gifconf.c ioctl_uffdio.c ioctl_v4l2.c ioperm.c \ + iopl.c ioprio.c ioprio-Xabbrev.c ioprio-Xraw.c \ + ioprio-Xverbose.c ip_mreq.c ipc.c ipc_msg.c ipc_msg-Xabbrev.c \ + ipc_msg-Xraw.c ipc_msg-Xverbose.c ipc_msgbuf.c \ + ipc_msgbuf-Xabbrev.c ipc_msgbuf-Xraw.c ipc_msgbuf-Xverbose.c \ + ipc_sem.c ipc_sem-Xabbrev.c ipc_sem-Xraw.c ipc_sem-Xverbose.c \ + ipc_shm.c ipc_shm-Xabbrev.c ipc_shm-Xraw.c ipc_shm-Xverbose.c \ + is_linux_mips_n64.c kcmp.c kcmp-y.c kern_features.c \ + kernel_version.c kernel_version-Xabbrev.c \ + kernel_version-Xraw.c kernel_version-Xverbose.c \ + kexec_file_load.c kexec_load.c keyctl.c keyctl-Xabbrev.c \ + keyctl-Xraw.c keyctl-Xverbose.c kill.c kill_child.c ksysent.c \ + lchown.c lchown32.c link.c linkat.c list_sigaction_signum.c \ + llseek.c localtime.c lookup_dcookie.c looping_threads.c \ + lseek.c lstat.c lstat64.c madvise.c mbind.c membarrier.c \ + memfd_create.c memfd_create-Xabbrev.c memfd_create-Xraw.c \ + memfd_create-Xverbose.c migrate_pages.c mincore.c mkdir.c \ + mkdirat.c mknod.c mknodat.c mlock.c mlock2.c mlockall.c mmap.c \ + mmap-Xabbrev.c mmap-Xraw.c mmap-Xverbose.c mmap64.c \ + mmap64-Xabbrev.c mmap64-Xraw.c mmap64-Xverbose.c mmsg.c \ + mmsg-silent.c mmsg_name.c mmsg_name-v.c modify_ldt.c mount.c \ + mount-Xabbrev.c mount-Xraw.c mount-Xverbose.c move_pages.c \ + move_pages-Xabbrev.c move_pages-Xraw.c move_pages-Xverbose.c \ mq.c mq_sendrecv.c mq_sendrecv-read.c mq_sendrecv-write.c \ msg_control.c msg_control-v.c msg_name.c munlockall.c \ nanosleep.c net-accept-connect.c net-icmp_filter.c \ - net-sockaddr.c net-y-unix.c net-yy-inet.c net-yy-netlink.c \ - net-yy-unix.c netlink_inet_diag.c netlink_netlink_diag.c \ - netlink_protocol.c netlink_unix_diag.c newfstatat.c \ - nsyscalls.c old_mmap.c oldfstat.c oldlstat.c oldselect.c \ - oldstat.c open.c openat.c pause.c pc.c perf_event_open.c \ - perf_event_open_nonverbose.c perf_event_open_unabbrev.c \ - personality.c pipe.c pipe2.c pkey_alloc.c pkey_free.c \ - pkey_mprotect.c poll.c ppoll.c prctl-arg2-intptr.c \ + net-packet_mreq.c net-packet_mreq-Xabbrev.c \ + net-packet_mreq-Xraw.c net-packet_mreq-Xverbose.c \ + net-sockaddr.c net-tpacket_req.c net-tpacket_stats.c \ + net-tpacket_stats-success.c net-y-unix.c net-yy-inet.c \ + net-yy-inet6.c net-yy-netlink.c net-yy-unix.c netlink_audit.c \ + netlink_crypto.c netlink_generic.c netlink_inet_diag.c \ + netlink_kobject_uevent.c netlink_netfilter.c \ + netlink_netlink_diag.c netlink_protocol.c netlink_route.c \ + netlink_selinux.c netlink_sock_diag.c netlink_unix_diag.c \ + netlink_xfrm.c newfstatat.c nfnetlink_acct.c \ + nfnetlink_cthelper.c nfnetlink_ctnetlink.c \ + nfnetlink_ctnetlink_exp.c nfnetlink_cttimeout.c \ + nfnetlink_ipset.c nfnetlink_nft_compat.c nfnetlink_nftables.c \ + nfnetlink_osf.c nfnetlink_queue.c nfnetlink_ulog.c nlattr.c \ + nlattr_br_port_msg.c nlattr_crypto_user_alg.c nlattr_dcbmsg.c \ + nlattr_fib_rule_hdr.c nlattr_ifaddrlblmsg.c nlattr_ifaddrmsg.c \ + nlattr_ifinfomsg.c nlattr_ifla_af_spec.c nlattr_ifla_brport.c \ + nlattr_ifla_linkinfo.c nlattr_ifla_port.c nlattr_ifla_xdp.c \ + nlattr_inet_diag_msg.c nlattr_inet_diag_req_compat.c \ + nlattr_inet_diag_req_v2.c nlattr_mdba_mdb_entry.c \ + nlattr_mdba_router_port.c nlattr_ndmsg.c nlattr_ndtmsg.c \ + nlattr_netconfmsg.c nlattr_netlink_diag_msg.c \ + nlattr_nlmsgerr.c nlattr_packet_diag_msg.c nlattr_rtgenmsg.c \ + nlattr_rtmsg.c nlattr_smc_diag_msg.c nlattr_tc_stats.c \ + nlattr_tca_stab.c nlattr_tcamsg.c nlattr_tcmsg.c \ + nlattr_unix_diag_msg.c nsyscalls.c nsyscalls-d.c old_mmap.c \ + old_mmap-P.c old_mmap-Xabbrev.c old_mmap-Xraw.c \ + old_mmap-Xverbose.c old_mmap-v-none.c oldfstat.c oldlstat.c \ + oldselect.c oldselect-P.c oldselect-efault.c \ + oldselect-efault-P.c oldstat.c open.c openat.c \ + orphaned_process_group.c osf_utimes.c pause.c pc.c \ + perf_event_open.c perf_event_open_nonverbose.c \ + perf_event_open_unabbrev.c personality.c personality-Xabbrev.c \ + personality-Xraw.c personality-Xverbose.c pidfd_send_signal.c \ + pipe.c pipe2.c pkey_alloc.c pkey_free.c pkey_mprotect.c poll.c \ + poll-P.c ppoll.c ppoll-P.c ppoll-v.c prctl-arg2-intptr.c \ prctl-dumpable.c prctl-name.c prctl-no-args.c \ prctl-pdeathsig.c prctl-seccomp-filter-v.c \ - prctl-seccomp-strict.c prctl-securebits.c prctl-tid_address.c \ - prctl-tsc.c pread64-pwrite64.c preadv.c preadv-pwritev.c \ - preadv2-pwritev2.c print_maxfd.c printstr.c prlimit64.c \ - process_vm_readv.c process_vm_writev.c pselect6.c ptrace.c \ + prctl-seccomp-strict.c prctl-securebits.c prctl-spec-inject.c \ + prctl-tid_address.c prctl-tsc.c pread64-pwrite64.c preadv.c \ + preadv-pwritev.c preadv2-pwritev2.c print_maxfd.c \ + printpath-umovestr.c printpath-umovestr-peekdata.c \ + printpath-umovestr-undumpable.c printsignal-Xabbrev.c \ + printsignal-Xraw.c printsignal-Xverbose.c printstr.c \ + printstrn-umoven.c printstrn-umoven-peekdata.c \ + printstrn-umoven-undumpable.c prlimit64.c process_vm_readv.c \ + process_vm_writev.c pselect6.c ptrace.c ptrace_syscall_info.c \ pwritev.c qual_fault.c qual_inject-error-signal.c \ qual_inject-retval.c qual_inject-signal.c qual_signal.c \ - quotactl.c quotactl-v.c quotactl-xfs.c quotactl-xfs-v.c \ - read-write.c readahead.c readdir.c readlink.c readlinkat.c \ - readv.c reboot.c recvfrom.c recvmmsg-timeout.c recvmsg.c \ - redirect-fds.c remap_file_pages.c rename.c renameat.c \ - renameat2.c request_key.c restart_syscall.c rmdir.c \ - rt_sigpending.c rt_sigprocmask.c rt_sigqueueinfo.c \ + quotactl.c quotactl-Xabbrev.c quotactl-Xraw.c \ + quotactl-Xverbose.c quotactl-success.c quotactl-success-v.c \ + quotactl-v.c quotactl-xfs.c quotactl-xfs-success.c \ + quotactl-xfs-success-v.c quotactl-xfs-v.c read-write.c \ + readahead.c readdir.c readlink.c readlinkat.c readv.c reboot.c \ + recvfrom.c recvmmsg-timeout.c recvmsg.c redirect-fds.c \ + remap_file_pages.c remap_file_pages-Xabbrev.c \ + remap_file_pages-Xraw.c remap_file_pages-Xverbose.c rename.c \ + renameat.c renameat2.c request_key.c restart_syscall.c \ + riscv_flush_icache.c rmdir.c rt_sigaction.c rt_sigpending.c \ + rt_sigprocmask.c rt_sigqueueinfo.c rt_sigreturn.c \ rt_sigsuspend.c rt_sigtimedwait.c rt_tgsigqueueinfo.c \ + run_expect_termsig.c s390_guarded_storage.c \ + s390_guarded_storage-v.c s390_pci_mmio_read_write.c \ + s390_runtime_instr.c s390_sthyi.c s390_sthyi-v.c \ sched_get_priority_mxx.c sched_rr_get_interval.c \ sched_xetaffinity.c sched_xetattr.c sched_xetparam.c \ sched_xetscheduler.c sched_yield.c scm_rights.c \ - seccomp-filter.c seccomp-filter-v.c seccomp-strict.c select.c \ - semop.c sendfile.c sendfile64.c set_mempolicy.c \ - set_ptracer_any.c setdomainname.c setfsgid.c setfsgid32.c \ - setfsuid.c setfsuid32.c setgid.c setgid32.c setgroups.c \ - setgroups32.c sethostname.c setns.c setregid.c setregid32.c \ - setresgid.c setresgid32.c setresuid.c setresuid32.c setreuid.c \ - setreuid32.c setrlimit.c setuid.c setuid32.c shmxt.c \ - shutdown.c sigaction.c sigaltstack.c siginfo.c \ - signal_receive.c signalfd4.c sigreturn.c sleep.c socketcall.c \ - splice.c $(stack_fcall_SOURCES) stat.c stat64.c statfs.c \ - statfs64.c swap.c symlink.c symlinkat.c sync.c \ - sync_file_range.c sync_file_range2.c sysinfo.c syslog.c tee.c \ - threads-execve.c time.c timer_create.c timer_xettime.c \ - timerfd_xettime.c times.c times-fail.c truncate.c truncate64.c \ - ugetrlimit.c uio.c umask.c umount.c umount2.c umoven-illptr.c \ - umovestr.c umovestr-illptr.c umovestr2.c umovestr3.c uname.c \ - unix-pair-send-recv.c unix-pair-sendto-recvfrom.c unlink.c \ - unlinkat.c unshare.c userfaultfd.c ustat.c utime.c utimensat.c \ - utimes.c vfork-f.c vhangup.c vmsplice.c wait4.c wait4-v.c \ - waitid.c waitid-v.c waitpid.c xattr.c xattr-strings.c \ - xet_robust_list.c xetitimer.c xetpgid.c xetpriority.c \ - xettimeofday.c -DIST_SOURCES = $(libtests_a_SOURCES) _newselect.c accept.c accept4.c \ - access.c acct.c add_key.c adjtimex.c aio.c alarm.c answer.c \ - attach-f-p.c attach-f-p-cmd.c attach-p-cmd-cmd.c \ - attach-p-cmd-p.c bpf.c brk.c btrfs.c caps.c caps-abbrev.c \ - chmod.c chown.c chown32.c chroot.c clock_adjtime.c \ - clock_nanosleep.c clock_xettime.c copy_file_range.c count-f.c \ - creat.c delete_module.c dup.c dup2.c dup3.c epoll_create.c \ - epoll_create1.c epoll_ctl.c epoll_pwait.c epoll_wait.c \ - erestartsys.c eventfd.c execve.c execve-v.c execveat.c \ - execveat-v.c faccessat.c fadvise64.c fadvise64_64.c \ - fallocate.c fanotify_init.c fanotify_mark.c fchdir.c fchmod.c \ - fchmodat.c fchown.c fchown32.c fchownat.c fcntl.c fcntl64.c \ - fdatasync.c file_handle.c file_ioctl.c filter-unavailable.c \ - finit_module.c flock.c fork-f.c fstat.c fstat64.c fstatat64.c \ - fstatfs.c fstatfs64.c fsync.c ftruncate.c ftruncate64.c \ - futex.c futimesat.c get_mempolicy.c getcpu.c getcwd.c \ - getdents.c getdents64.c getegid.c getegid32.c geteuid.c \ - geteuid32.c getgid.c getgid32.c getgroups.c getgroups32.c \ - getpeername.c getpgrp.c getrandom.c getresgid.c getresgid32.c \ + seccomp-filter.c seccomp-filter-v.c seccomp-strict.c \ + seccomp_get_action_avail.c select.c select-P.c semop.c \ + sendfile.c sendfile64.c set_mempolicy.c set_ptracer_any.c \ + set_sigblock.c set_sigign.c setdomainname.c setfsgid.c \ + setfsgid32.c setfsuid.c setfsuid32.c setgid.c setgid32.c \ + setgroups.c setgroups32.c sethostname.c setns.c setregid.c \ + setregid32.c setresgid.c setresgid32.c setresuid.c \ + setresuid32.c setreuid.c setreuid32.c setrlimit.c \ + setrlimit-Xabbrev.c setrlimit-Xraw.c setrlimit-Xverbose.c \ + setuid.c setuid32.c shmxt.c shutdown.c sigaction.c \ + sigaltstack.c siginfo.c signal.c signal_receive.c signalfd4.c \ + sigpending.c sigprocmask.c sigreturn.c sigsuspend.c sleep.c \ + so_error.c so_linger.c so_peercred.c so_peercred-Xabbrev.c \ + so_peercred-Xraw.c so_peercred-Xverbose.c sock_filter-v.c \ + sock_filter-v-Xabbrev.c sock_filter-v-Xraw.c \ + sock_filter-v-Xverbose.c sockaddr_xlat-Xabbrev.c \ + sockaddr_xlat-Xraw.c sockaddr_xlat-Xverbose.c socketcall.c \ + sockopt-sol_netlink.c sockopt-timestamp.c splice.c \ + $(stack_fcall_SOURCES) $(stack_fcall_mangled_SOURCES) stat.c \ + stat64.c statfs.c statfs64.c statx.c swap.c sxetmask.c \ + symlink.c symlinkat.c sync.c sync_file_range.c \ + sync_file_range2.c sysinfo.c syslog.c tee.c threads-execve.c \ + time.c timer_create.c timer_xettime.c timerfd_xettime.c \ + times.c times-fail.c truncate.c truncate64.c ugetrlimit.c \ + uio.c umask.c umount.c umount2.c umoven-illptr.c umovestr.c \ + umovestr-illptr.c umovestr2.c umovestr3.c uname.c \ + unblock_reset_raise.c unix-pair-send-recv.c \ + unix-pair-sendto-recvfrom.c unlink.c unlinkat.c unshare.c \ + userfaultfd.c ustat.c utime.c utimensat.c utimensat-Xabbrev.c \ + utimensat-Xraw.c utimensat-Xverbose.c utimes.c vfork-f.c \ + vhangup.c vmsplice.c wait4.c wait4-v.c waitid.c waitid-v.c \ + waitpid.c xattr.c xattr-strings.c xet_robust_list.c \ + xet_thread_area_x86.c xetitimer.c xetpgid.c xetpriority.c \ + xettimeofday.c zeroargc.c +DIST_SOURCES = $(libtests_a_SOURCES) _newselect.c _newselect-P.c \ + accept.c accept4.c access.c acct.c add_key.c adjtimex.c aio.c \ + aio_pgetevents.c alarm.c answer.c attach-f-p.c \ + attach-f-p-cmd.c attach-p-cmd-cmd.c attach-p-cmd-p.c \ + block_reset_raise_run.c bpf.c bpf-obj_get_info_by_fd.c \ + bpf-obj_get_info_by_fd-prog.c bpf-obj_get_info_by_fd-prog-v.c \ + bpf-obj_get_info_by_fd-v.c bpf-success.c bpf-success-v.c \ + bpf-v.c brk.c btrfs.c caps.c caps-abbrev.c check_sigblock.c \ + check_sigign.c chmod.c chown.c chown32.c chroot.c \ + clock_adjtime.c clock_nanosleep.c clock_xettime.c \ + clone_parent.c clone_ptrace.c copy_file_range.c count-f.c \ + creat.c delay.c delete_module.c dev-yy.c dup.c dup2.c dup3.c \ + epoll_create.c epoll_create1.c epoll_ctl.c epoll_pwait.c \ + epoll_wait.c erestartsys.c eventfd.c execve.c execve-v.c \ + execveat.c execveat-v.c faccessat.c fadvise64.c fadvise64_64.c \ + fallocate.c fanotify_init.c fanotify_mark.c \ + fanotify_mark-Xabbrev.c fanotify_mark-Xraw.c \ + fanotify_mark-Xverbose.c fchdir.c fchmod.c fchmodat.c fchown.c \ + fchown32.c fchownat.c fcntl.c fcntl64.c fdatasync.c fflush.c \ + file_handle.c file_ioctl.c filter-unavailable.c finit_module.c \ + flock.c fork-f.c fstat.c fstat-Xabbrev.c fstat-Xraw.c \ + fstat-Xverbose.c fstat64.c fstat64-Xabbrev.c fstat64-Xraw.c \ + fstat64-Xverbose.c fstatat64.c fstatfs.c fstatfs64.c fsync.c \ + fsync-y.c ftruncate.c ftruncate64.c futex.c futimesat.c \ + get_mempolicy.c getcpu.c getcwd.c getdents.c getdents64.c \ + getegid.c getegid32.c geteuid.c geteuid32.c getgid.c \ + getgid32.c getgroups.c getgroups32.c getpeername.c getpgrp.c \ + getpid.c getppid.c getrandom.c getresgid.c getresgid32.c \ getresuid.c getresuid32.c getrlimit.c getrusage.c getsid.c \ - getsockname.c getuid.c getuid32.c getxxid.c inet-cmsg.c \ - init_module.c inotify.c inotify_init1.c ioctl.c ioctl_block.c \ - ioctl_dm.c ioctl_dm-v.c ioctl_evdev.c ioctl_evdev-v.c \ + getsockname.c gettid.c getuid.c getuid32.c getxxid.c \ + group_req.c inet-cmsg.c init_module.c inject-nf.c inotify.c \ + inotify_init1.c int_0x80.c io_uring_enter.c \ + io_uring_register.c io_uring_setup.c ioctl.c ioctl_block.c \ + ioctl_dm.c ioctl_dm-v.c ioctl_evdev.c ioctl_evdev-success.c \ + ioctl_evdev-success-v.c ioctl_evdev-v.c ioctl_inotify.c \ + ioctl_kvm_run.c ioctl_kvm_run-v.c ioctl_kvm_run_auxstr_vcpu.c \ ioctl_loop.c ioctl_loop-nv.c ioctl_loop-v.c ioctl_mtd.c \ - ioctl_rtc.c ioctl_rtc-v.c ioctl_scsi.c ioctl_sg_io_v3.c \ - ioctl_sg_io_v4.c ioctl_sock_gifconf.c ioctl_uffdio.c \ - ioctl_v4l2.c ioperm.c iopl.c ioprio.c ip_mreq.c ipc.c \ - ipc_msg.c ipc_msgbuf.c ipc_sem.c ipc_shm.c kcmp.c \ - kexec_file_load.c kexec_load.c keyctl.c kill.c ksysent.c \ - lchown.c lchown32.c link.c linkat.c llseek.c lookup_dcookie.c \ - lseek.c lstat.c lstat64.c mbind.c membarrier.c memfd_create.c \ - migrate_pages.c mincore.c mkdir.c mkdirat.c mknod.c mknodat.c \ - mlock.c mlock2.c mlockall.c mmap.c mmap64.c mmsg.c \ - mmsg-silent.c mmsg_name.c mmsg_name-v.c mount.c move_pages.c \ + ioctl_nbd.c ioctl_nsfs.c ioctl_perf.c ioctl_perf-success.c \ + ioctl_ptp.c ioctl_random.c ioctl_rtc.c ioctl_rtc-v.c \ + ioctl_scsi.c ioctl_sg_io_v3.c ioctl_sg_io_v4.c \ + ioctl_sock_gifconf.c ioctl_uffdio.c ioctl_v4l2.c ioperm.c \ + iopl.c ioprio.c ioprio-Xabbrev.c ioprio-Xraw.c \ + ioprio-Xverbose.c ip_mreq.c ipc.c ipc_msg.c ipc_msg-Xabbrev.c \ + ipc_msg-Xraw.c ipc_msg-Xverbose.c ipc_msgbuf.c \ + ipc_msgbuf-Xabbrev.c ipc_msgbuf-Xraw.c ipc_msgbuf-Xverbose.c \ + ipc_sem.c ipc_sem-Xabbrev.c ipc_sem-Xraw.c ipc_sem-Xverbose.c \ + ipc_shm.c ipc_shm-Xabbrev.c ipc_shm-Xraw.c ipc_shm-Xverbose.c \ + is_linux_mips_n64.c kcmp.c kcmp-y.c kern_features.c \ + kernel_version.c kernel_version-Xabbrev.c \ + kernel_version-Xraw.c kernel_version-Xverbose.c \ + kexec_file_load.c kexec_load.c keyctl.c keyctl-Xabbrev.c \ + keyctl-Xraw.c keyctl-Xverbose.c kill.c kill_child.c ksysent.c \ + lchown.c lchown32.c link.c linkat.c list_sigaction_signum.c \ + llseek.c localtime.c lookup_dcookie.c looping_threads.c \ + lseek.c lstat.c lstat64.c madvise.c mbind.c membarrier.c \ + memfd_create.c memfd_create-Xabbrev.c memfd_create-Xraw.c \ + memfd_create-Xverbose.c migrate_pages.c mincore.c mkdir.c \ + mkdirat.c mknod.c mknodat.c mlock.c mlock2.c mlockall.c mmap.c \ + mmap-Xabbrev.c mmap-Xraw.c mmap-Xverbose.c mmap64.c \ + mmap64-Xabbrev.c mmap64-Xraw.c mmap64-Xverbose.c mmsg.c \ + mmsg-silent.c mmsg_name.c mmsg_name-v.c modify_ldt.c mount.c \ + mount-Xabbrev.c mount-Xraw.c mount-Xverbose.c move_pages.c \ + move_pages-Xabbrev.c move_pages-Xraw.c move_pages-Xverbose.c \ mq.c mq_sendrecv.c mq_sendrecv-read.c mq_sendrecv-write.c \ msg_control.c msg_control-v.c msg_name.c munlockall.c \ nanosleep.c net-accept-connect.c net-icmp_filter.c \ - net-sockaddr.c net-y-unix.c net-yy-inet.c net-yy-netlink.c \ - net-yy-unix.c netlink_inet_diag.c netlink_netlink_diag.c \ - netlink_protocol.c netlink_unix_diag.c newfstatat.c \ - nsyscalls.c old_mmap.c oldfstat.c oldlstat.c oldselect.c \ - oldstat.c open.c openat.c pause.c pc.c perf_event_open.c \ - perf_event_open_nonverbose.c perf_event_open_unabbrev.c \ - personality.c pipe.c pipe2.c pkey_alloc.c pkey_free.c \ - pkey_mprotect.c poll.c ppoll.c prctl-arg2-intptr.c \ + net-packet_mreq.c net-packet_mreq-Xabbrev.c \ + net-packet_mreq-Xraw.c net-packet_mreq-Xverbose.c \ + net-sockaddr.c net-tpacket_req.c net-tpacket_stats.c \ + net-tpacket_stats-success.c net-y-unix.c net-yy-inet.c \ + net-yy-inet6.c net-yy-netlink.c net-yy-unix.c netlink_audit.c \ + netlink_crypto.c netlink_generic.c netlink_inet_diag.c \ + netlink_kobject_uevent.c netlink_netfilter.c \ + netlink_netlink_diag.c netlink_protocol.c netlink_route.c \ + netlink_selinux.c netlink_sock_diag.c netlink_unix_diag.c \ + netlink_xfrm.c newfstatat.c nfnetlink_acct.c \ + nfnetlink_cthelper.c nfnetlink_ctnetlink.c \ + nfnetlink_ctnetlink_exp.c nfnetlink_cttimeout.c \ + nfnetlink_ipset.c nfnetlink_nft_compat.c nfnetlink_nftables.c \ + nfnetlink_osf.c nfnetlink_queue.c nfnetlink_ulog.c nlattr.c \ + nlattr_br_port_msg.c nlattr_crypto_user_alg.c nlattr_dcbmsg.c \ + nlattr_fib_rule_hdr.c nlattr_ifaddrlblmsg.c nlattr_ifaddrmsg.c \ + nlattr_ifinfomsg.c nlattr_ifla_af_spec.c nlattr_ifla_brport.c \ + nlattr_ifla_linkinfo.c nlattr_ifla_port.c nlattr_ifla_xdp.c \ + nlattr_inet_diag_msg.c nlattr_inet_diag_req_compat.c \ + nlattr_inet_diag_req_v2.c nlattr_mdba_mdb_entry.c \ + nlattr_mdba_router_port.c nlattr_ndmsg.c nlattr_ndtmsg.c \ + nlattr_netconfmsg.c nlattr_netlink_diag_msg.c \ + nlattr_nlmsgerr.c nlattr_packet_diag_msg.c nlattr_rtgenmsg.c \ + nlattr_rtmsg.c nlattr_smc_diag_msg.c nlattr_tc_stats.c \ + nlattr_tca_stab.c nlattr_tcamsg.c nlattr_tcmsg.c \ + nlattr_unix_diag_msg.c nsyscalls.c nsyscalls-d.c old_mmap.c \ + old_mmap-P.c old_mmap-Xabbrev.c old_mmap-Xraw.c \ + old_mmap-Xverbose.c old_mmap-v-none.c oldfstat.c oldlstat.c \ + oldselect.c oldselect-P.c oldselect-efault.c \ + oldselect-efault-P.c oldstat.c open.c openat.c \ + orphaned_process_group.c osf_utimes.c pause.c pc.c \ + perf_event_open.c perf_event_open_nonverbose.c \ + perf_event_open_unabbrev.c personality.c personality-Xabbrev.c \ + personality-Xraw.c personality-Xverbose.c pidfd_send_signal.c \ + pipe.c pipe2.c pkey_alloc.c pkey_free.c pkey_mprotect.c poll.c \ + poll-P.c ppoll.c ppoll-P.c ppoll-v.c prctl-arg2-intptr.c \ prctl-dumpable.c prctl-name.c prctl-no-args.c \ prctl-pdeathsig.c prctl-seccomp-filter-v.c \ - prctl-seccomp-strict.c prctl-securebits.c prctl-tid_address.c \ - prctl-tsc.c pread64-pwrite64.c preadv.c preadv-pwritev.c \ - preadv2-pwritev2.c print_maxfd.c printstr.c prlimit64.c \ - process_vm_readv.c process_vm_writev.c pselect6.c ptrace.c \ + prctl-seccomp-strict.c prctl-securebits.c prctl-spec-inject.c \ + prctl-tid_address.c prctl-tsc.c pread64-pwrite64.c preadv.c \ + preadv-pwritev.c preadv2-pwritev2.c print_maxfd.c \ + printpath-umovestr.c printpath-umovestr-peekdata.c \ + printpath-umovestr-undumpable.c printsignal-Xabbrev.c \ + printsignal-Xraw.c printsignal-Xverbose.c printstr.c \ + printstrn-umoven.c printstrn-umoven-peekdata.c \ + printstrn-umoven-undumpable.c prlimit64.c process_vm_readv.c \ + process_vm_writev.c pselect6.c ptrace.c ptrace_syscall_info.c \ pwritev.c qual_fault.c qual_inject-error-signal.c \ qual_inject-retval.c qual_inject-signal.c qual_signal.c \ - quotactl.c quotactl-v.c quotactl-xfs.c quotactl-xfs-v.c \ - read-write.c readahead.c readdir.c readlink.c readlinkat.c \ - readv.c reboot.c recvfrom.c recvmmsg-timeout.c recvmsg.c \ - redirect-fds.c remap_file_pages.c rename.c renameat.c \ - renameat2.c request_key.c restart_syscall.c rmdir.c \ - rt_sigpending.c rt_sigprocmask.c rt_sigqueueinfo.c \ + quotactl.c quotactl-Xabbrev.c quotactl-Xraw.c \ + quotactl-Xverbose.c quotactl-success.c quotactl-success-v.c \ + quotactl-v.c quotactl-xfs.c quotactl-xfs-success.c \ + quotactl-xfs-success-v.c quotactl-xfs-v.c read-write.c \ + readahead.c readdir.c readlink.c readlinkat.c readv.c reboot.c \ + recvfrom.c recvmmsg-timeout.c recvmsg.c redirect-fds.c \ + remap_file_pages.c remap_file_pages-Xabbrev.c \ + remap_file_pages-Xraw.c remap_file_pages-Xverbose.c rename.c \ + renameat.c renameat2.c request_key.c restart_syscall.c \ + riscv_flush_icache.c rmdir.c rt_sigaction.c rt_sigpending.c \ + rt_sigprocmask.c rt_sigqueueinfo.c rt_sigreturn.c \ rt_sigsuspend.c rt_sigtimedwait.c rt_tgsigqueueinfo.c \ + run_expect_termsig.c s390_guarded_storage.c \ + s390_guarded_storage-v.c s390_pci_mmio_read_write.c \ + s390_runtime_instr.c s390_sthyi.c s390_sthyi-v.c \ sched_get_priority_mxx.c sched_rr_get_interval.c \ sched_xetaffinity.c sched_xetattr.c sched_xetparam.c \ sched_xetscheduler.c sched_yield.c scm_rights.c \ - seccomp-filter.c seccomp-filter-v.c seccomp-strict.c select.c \ - semop.c sendfile.c sendfile64.c set_mempolicy.c \ - set_ptracer_any.c setdomainname.c setfsgid.c setfsgid32.c \ - setfsuid.c setfsuid32.c setgid.c setgid32.c setgroups.c \ - setgroups32.c sethostname.c setns.c setregid.c setregid32.c \ - setresgid.c setresgid32.c setresuid.c setresuid32.c setreuid.c \ - setreuid32.c setrlimit.c setuid.c setuid32.c shmxt.c \ - shutdown.c sigaction.c sigaltstack.c siginfo.c \ - signal_receive.c signalfd4.c sigreturn.c sleep.c socketcall.c \ - splice.c $(stack_fcall_SOURCES) stat.c stat64.c statfs.c \ - statfs64.c swap.c symlink.c symlinkat.c sync.c \ - sync_file_range.c sync_file_range2.c sysinfo.c syslog.c tee.c \ - threads-execve.c time.c timer_create.c timer_xettime.c \ - timerfd_xettime.c times.c times-fail.c truncate.c truncate64.c \ - ugetrlimit.c uio.c umask.c umount.c umount2.c umoven-illptr.c \ - umovestr.c umovestr-illptr.c umovestr2.c umovestr3.c uname.c \ - unix-pair-send-recv.c unix-pair-sendto-recvfrom.c unlink.c \ - unlinkat.c unshare.c userfaultfd.c ustat.c utime.c utimensat.c \ - utimes.c vfork-f.c vhangup.c vmsplice.c wait4.c wait4-v.c \ - waitid.c waitid-v.c waitpid.c xattr.c xattr-strings.c \ - xet_robust_list.c xetitimer.c xetpgid.c xetpriority.c \ - xettimeofday.c + seccomp-filter.c seccomp-filter-v.c seccomp-strict.c \ + seccomp_get_action_avail.c select.c select-P.c semop.c \ + sendfile.c sendfile64.c set_mempolicy.c set_ptracer_any.c \ + set_sigblock.c set_sigign.c setdomainname.c setfsgid.c \ + setfsgid32.c setfsuid.c setfsuid32.c setgid.c setgid32.c \ + setgroups.c setgroups32.c sethostname.c setns.c setregid.c \ + setregid32.c setresgid.c setresgid32.c setresuid.c \ + setresuid32.c setreuid.c setreuid32.c setrlimit.c \ + setrlimit-Xabbrev.c setrlimit-Xraw.c setrlimit-Xverbose.c \ + setuid.c setuid32.c shmxt.c shutdown.c sigaction.c \ + sigaltstack.c siginfo.c signal.c signal_receive.c signalfd4.c \ + sigpending.c sigprocmask.c sigreturn.c sigsuspend.c sleep.c \ + so_error.c so_linger.c so_peercred.c so_peercred-Xabbrev.c \ + so_peercred-Xraw.c so_peercred-Xverbose.c sock_filter-v.c \ + sock_filter-v-Xabbrev.c sock_filter-v-Xraw.c \ + sock_filter-v-Xverbose.c sockaddr_xlat-Xabbrev.c \ + sockaddr_xlat-Xraw.c sockaddr_xlat-Xverbose.c socketcall.c \ + sockopt-sol_netlink.c sockopt-timestamp.c splice.c \ + $(stack_fcall_SOURCES) $(stack_fcall_mangled_SOURCES) stat.c \ + stat64.c statfs.c statfs64.c statx.c swap.c sxetmask.c \ + symlink.c symlinkat.c sync.c sync_file_range.c \ + sync_file_range2.c sysinfo.c syslog.c tee.c threads-execve.c \ + time.c timer_create.c timer_xettime.c timerfd_xettime.c \ + times.c times-fail.c truncate.c truncate64.c ugetrlimit.c \ + uio.c umask.c umount.c umount2.c umoven-illptr.c umovestr.c \ + umovestr-illptr.c umovestr2.c umovestr3.c uname.c \ + unblock_reset_raise.c unix-pair-send-recv.c \ + unix-pair-sendto-recvfrom.c unlink.c unlinkat.c unshare.c \ + userfaultfd.c ustat.c utime.c utimensat.c utimensat-Xabbrev.c \ + utimensat-Xraw.c utimensat-Xverbose.c utimes.c vfork-f.c \ + vhangup.c vmsplice.c wait4.c wait4-v.c waitid.c waitid-v.c \ + waitpid.c xattr.c xattr-strings.c xet_robust_list.c \ + xet_thread_area_x86.c xetitimer.c xetpgid.c xetpriority.c \ + xettimeofday.c zeroargc.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac -am__extra_recursive_targets = check-valgrind-recursive +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -2214,7 +3848,7 @@ am__set_TESTS_bases = \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck -@USE_LIBUNWIND_TRUE@am__EXEEXT_1 = strace-k.test +@ENABLE_STACKTRACE_TRUE@am__EXEEXT_2 = strace-k.test $(am__append_1) TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test am__test_logs1 = $(TESTS:=.log) @@ -2233,6 +3867,9 @@ am__set_b = \ *) \ b='$*';; \ esac +am__DIST_COMMON = $(srcdir)/../scno.am $(srcdir)/Makefile.in \ + $(srcdir)/gen_tests.am $(srcdir)/pure_executables.am \ + $(top_srcdir)/depcomp $(top_srcdir)/test-driver COPYING DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -2253,6 +3890,8 @@ CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ +COPYRIGHT_YEAR = @COPYRIGHT_YEAR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ @@ -2286,6 +3925,7 @@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANPAGE_DATE = @MANPAGE_DATE@ MIPS_ABI = @MIPS_ABI@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ @@ -2299,10 +3939,13 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ +READELF = @READELF@ RPM_CHANGELOGTIME = @RPM_CHANGELOGTIME@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIZEOF_KERNEL_LONG_T = 4 +SIZEOF_LONG = 4 STRIP = @STRIP@ VALGRIND = @VALGRIND@ VALGRIND_ENABLED = @VALGRIND_ENABLED@ @@ -2323,6 +3966,7 @@ am__untar = @am__untar@ arch = @arch@ arch_m32 = @arch_m32@ arch_mx32 = @arch_mx32@ +arch_native = @arch_native@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -2330,6 +3974,9 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +cc_flags_m32 = @cc_flags_m32@ +cc_flags_mx32 = @cc_flags_mx32@ +clock_LIBS = @clock_LIBS@ datadir = @datadir@ datarootdir = @datarootdir@ dl_LIBS = @dl_LIBS@ @@ -2346,7 +3993,14 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ +libdw_CFLAGS = @libdw_CFLAGS@ +libdw_CPPFLAGS = @libdw_CPPFLAGS@ +libdw_LDFLAGS = @libdw_LDFLAGS@ +libdw_LIBS = @libdw_LIBS@ libexecdir = @libexecdir@ +libiberty_CPPFLAGS = @libiberty_CPPFLAGS@ +libiberty_LDFLAGS = @libiberty_LDFLAGS@ +libiberty_LIBS = @libiberty_LIBS@ libunwind_CPPFLAGS = @libunwind_CPPFLAGS@ libunwind_LDFLAGS = @libunwind_LDFLAGS@ libunwind_LIBS = @libunwind_LIBS@ @@ -2354,6 +4008,7 @@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ +mq_LIBS = @mq_LIBS@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ @@ -2364,6 +4019,7 @@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +timer_LIBS = @timer_LIBS@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @@ -2371,8 +4027,10 @@ valgrind_enabled_tools = @valgrind_enabled_tools@ valgrind_tools = @valgrind_tools@ OS = linux ARCH = @arch_m32@ +NATIVE_ARCH = @arch_native@ MPERS_NAME = m32 -ARCH_MFLAGS = -DMPERS_IS_$(MPERS_NAME) -m32 +MPERS_CC_FLAGS = @cc_flags_m32@ +ARCH_MFLAGS = -DMPERS_IS_$(MPERS_NAME) $(MPERS_CC_FLAGS) AM_CFLAGS = $(WARN_CFLAGS) AM_CPPFLAGS = $(ARCH_MFLAGS) \ -I$(builddir) \ @@ -2381,27 +4039,40 @@ AM_CPPFLAGS = $(ARCH_MFLAGS) \ -I$(top_builddir)/$(OS) \ -I$(top_srcdir)/$(OS) \ -I$(top_builddir) \ - -I$(top_srcdir) + -I$(top_srcdir) \ + -DTESTS_SIZEOF_KERNEL_LONG_T=$(SIZEOF_KERNEL_LONG_T) \ + -DTESTS_SIZEOF_LONG=$(SIZEOF_LONG) AM_LDFLAGS = $(ARCH_MFLAGS) libtests_a_SOURCES = \ + create_nl_socket.c \ errno2name.c \ error_msg.c \ fill_memory.c \ get_page_size.c \ + get_sigset_size.c \ hexdump_strdup.c \ hexquote_strndup.c \ + ifindex.c \ inode_of_sockfd.c \ libmmsg.c \ libsocketcall.c \ overflowuid.c \ pipe_maxfd.c \ print_quoted_string.c \ + print_time.c \ printflags.c \ printxval.c \ signal2name.c \ + skip_unavailable.c \ sprintrc.c \ tail_alloc.c \ + test_netlink.h \ + test_nlattr.h \ + test_printpath.c \ + test_printstrn.c \ + test_ucopy.c \ + test_ucopy.h \ tests.h \ tprintf.c \ # end of libtests_a_SOURCES @@ -2409,19 +4080,545 @@ libtests_a_SOURCES = \ libtests_a_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 check_LIBRARIES = libtests.a LDADD = libtests.a -attach_f_p_LDADD = -lrt -lpthread $(LDADD) -clock_xettime_LDADD = -lrt $(LDADD) + +# Generated by ./tests/gen_pure_executables.sh from ./tests/pure_executables.list; do not edit. +PURE_EXECUTABLES = \ + _newselect \ + accept \ + accept4 \ + access \ + acct \ + add_key \ + adjtimex \ + aio \ + aio_pgetevents \ + alarm \ + bpf \ + bpf-obj_get_info_by_fd \ + bpf-obj_get_info_by_fd-prog \ + bpf-obj_get_info_by_fd-prog-v \ + bpf-obj_get_info_by_fd-v \ + bpf-v \ + brk \ + btrfs \ + caps \ + chmod \ + chown \ + chown32 \ + chroot \ + clock_adjtime \ + clock_nanosleep \ + clock_xettime \ + copy_file_range \ + creat \ + delete_module \ + dev-yy \ + dup \ + dup2 \ + dup3 \ + epoll_create \ + epoll_create1 \ + epoll_ctl \ + epoll_pwait \ + epoll_wait \ + erestartsys \ + eventfd \ + execve \ + execveat \ + faccessat \ + fadvise64 \ + fadvise64_64 \ + fallocate \ + fanotify_init \ + fanotify_mark \ + fanotify_mark-Xabbrev \ + fanotify_mark-Xraw \ + fanotify_mark-Xverbose \ + fchdir \ + fchmod \ + fchmodat \ + fchown \ + fchown32 \ + fchownat \ + fcntl \ + fcntl64 \ + fdatasync \ + fflush \ + file_handle \ + file_ioctl \ + finit_module \ + flock \ + fstat \ + fstat-Xabbrev \ + fstat-Xraw \ + fstat-Xverbose \ + fstat64 \ + fstat64-Xabbrev \ + fstat64-Xraw \ + fstat64-Xverbose \ + fstatat64 \ + fstatfs \ + fstatfs64 \ + fsync \ + ftruncate \ + ftruncate64 \ + futex \ + futimesat \ + get_mempolicy \ + getcpu \ + getcwd \ + getdents \ + getdents64 \ + getegid \ + getegid32 \ + geteuid \ + geteuid32 \ + getgid \ + getgid32 \ + getgroups \ + getgroups32 \ + getpeername \ + getpgrp \ + getpid \ + getppid \ + getrandom \ + getresgid \ + getresgid32 \ + getresuid \ + getresuid32 \ + getrlimit \ + getrusage \ + getsid \ + getsockname \ + getuid \ + getuid32 \ + getxxid \ + group_req \ + inet-cmsg \ + init_module \ + inotify \ + inotify_init1 \ + io_uring_enter \ + io_uring_register \ + io_uring_setup \ + ioctl \ + ioctl_block \ + ioctl_dm \ + ioctl_evdev \ + ioctl_inotify \ + ioctl_kvm_run \ + ioctl_kvm_run-v \ + ioctl_kvm_run_auxstr_vcpu \ + ioctl_loop \ + ioctl_mtd \ + ioctl_nbd \ + ioctl_perf \ + ioctl_ptp \ + ioctl_random \ + ioctl_rtc \ + ioctl_scsi \ + ioctl_sg_io_v3 \ + ioctl_sg_io_v4 \ + ioctl_sock_gifconf \ + ioctl_uffdio \ + ioctl_v4l2 \ + ioperm \ + iopl \ + ioprio \ + ioprio-Xabbrev \ + ioprio-Xraw \ + ioprio-Xverbose \ + ip_mreq \ + ipc \ + ipc_msg \ + ipc_msg-Xabbrev \ + ipc_msg-Xraw \ + ipc_msg-Xverbose \ + ipc_msgbuf \ + ipc_msgbuf-Xabbrev \ + ipc_msgbuf-Xraw \ + ipc_msgbuf-Xverbose \ + ipc_sem \ + ipc_sem-Xabbrev \ + ipc_sem-Xraw \ + ipc_sem-Xverbose \ + ipc_shm \ + ipc_shm-Xabbrev \ + ipc_shm-Xraw \ + ipc_shm-Xverbose \ + kcmp \ + kcmp-y \ + kern_features \ + kernel_version \ + kernel_version-Xabbrev \ + kernel_version-Xraw \ + kernel_version-Xverbose \ + kexec_file_load \ + kexec_load \ + keyctl \ + keyctl-Xabbrev \ + keyctl-Xraw \ + keyctl-Xverbose \ + kill \ + lchown \ + lchown32 \ + link \ + linkat \ + llseek \ + lookup_dcookie \ + lseek \ + lstat \ + lstat64 \ + madvise \ + mbind \ + membarrier \ + memfd_create \ + memfd_create-Xabbrev \ + memfd_create-Xraw \ + memfd_create-Xverbose \ + migrate_pages \ + mincore \ + mkdir \ + mkdirat \ + mknod \ + mknodat \ + mlock \ + mlock2 \ + mlockall \ + mmap \ + mmap-Xabbrev \ + mmap-Xraw \ + mmap-Xverbose \ + mmap64 \ + mmap64-Xabbrev \ + mmap64-Xraw \ + mmap64-Xverbose \ + mmsg \ + mmsg_name \ + modify_ldt \ + mount \ + mount-Xabbrev \ + mount-Xraw \ + mount-Xverbose \ + move_pages \ + move_pages-Xabbrev \ + move_pages-Xraw \ + move_pages-Xverbose \ + mq \ + mq_sendrecv \ + mq_sendrecv-read \ + mq_sendrecv-write \ + msg_control \ + msg_name \ + munlockall \ + nanosleep \ + net-icmp_filter \ + net-packet_mreq \ + net-packet_mreq-Xabbrev \ + net-packet_mreq-Xraw \ + net-packet_mreq-Xverbose \ + net-sockaddr \ + net-tpacket_req \ + net-tpacket_stats \ + net-y-unix \ + net-yy-inet \ + net-yy-inet6 \ + net-yy-netlink \ + net-yy-unix \ + netlink_audit \ + netlink_crypto \ + netlink_generic \ + netlink_kobject_uevent \ + netlink_netfilter \ + netlink_protocol \ + netlink_route \ + netlink_selinux \ + netlink_sock_diag \ + netlink_xfrm \ + newfstatat \ + nfnetlink_acct \ + nfnetlink_cthelper \ + nfnetlink_ctnetlink \ + nfnetlink_ctnetlink_exp \ + nfnetlink_cttimeout \ + nfnetlink_ipset \ + nfnetlink_nft_compat \ + nfnetlink_nftables \ + nfnetlink_osf \ + nfnetlink_queue \ + nfnetlink_ulog \ + nlattr \ + nlattr_br_port_msg \ + nlattr_crypto_user_alg \ + nlattr_dcbmsg \ + nlattr_fib_rule_hdr \ + nlattr_ifaddrlblmsg \ + nlattr_ifaddrmsg \ + nlattr_ifinfomsg \ + nlattr_ifla_af_spec \ + nlattr_ifla_brport \ + nlattr_ifla_linkinfo \ + nlattr_ifla_port \ + nlattr_ifla_xdp \ + nlattr_inet_diag_msg \ + nlattr_inet_diag_req_compat \ + nlattr_inet_diag_req_v2 \ + nlattr_mdba_mdb_entry \ + nlattr_mdba_router_port \ + nlattr_ndmsg \ + nlattr_ndtmsg \ + nlattr_netconfmsg \ + nlattr_netlink_diag_msg \ + nlattr_nlmsgerr \ + nlattr_packet_diag_msg \ + nlattr_rtgenmsg \ + nlattr_rtmsg \ + nlattr_smc_diag_msg \ + nlattr_tc_stats \ + nlattr_tca_stab \ + nlattr_tcamsg \ + nlattr_tcmsg \ + nlattr_unix_diag_msg \ + old_mmap \ + old_mmap-P \ + old_mmap-Xabbrev \ + old_mmap-Xraw \ + old_mmap-Xverbose \ + old_mmap-v-none \ + oldfstat \ + oldlstat \ + oldselect \ + oldselect-efault \ + oldstat \ + open \ + openat \ + osf_utimes \ + pause \ + perf_event_open \ + personality \ + personality-Xabbrev \ + personality-Xraw \ + personality-Xverbose \ + pidfd_send_signal \ + pipe \ + pipe2 \ + pkey_alloc \ + pkey_free \ + pkey_mprotect \ + poll \ + poll-P \ + ppoll \ + ppoll-P \ + prctl-arg2-intptr \ + prctl-dumpable \ + prctl-name \ + prctl-no-args \ + prctl-pdeathsig \ + prctl-securebits \ + prctl-tid_address \ + prctl-tsc \ + pread64-pwrite64 \ + preadv \ + preadv-pwritev \ + preadv2-pwritev2 \ + printpath-umovestr \ + printpath-umovestr-peekdata \ + printpath-umovestr-undumpable \ + printsignal-Xabbrev \ + printsignal-Xraw \ + printsignal-Xverbose \ + printstr \ + printstrn-umoven \ + printstrn-umoven-peekdata \ + printstrn-umoven-undumpable \ + prlimit64 \ + process_vm_readv \ + process_vm_writev \ + pselect6 \ + ptrace \ + ptrace_syscall_info \ + pwritev \ + quotactl \ + quotactl-Xabbrev \ + quotactl-Xraw \ + quotactl-Xverbose \ + quotactl-xfs \ + read-write \ + readahead \ + readdir \ + readlink \ + readlinkat \ + readv \ + reboot \ + recvfrom \ + recvmmsg-timeout \ + recvmsg \ + remap_file_pages \ + remap_file_pages-Xabbrev \ + remap_file_pages-Xraw \ + remap_file_pages-Xverbose \ + rename \ + renameat \ + renameat2 \ + request_key \ + riscv_flush_icache \ + rmdir \ + rt_sigaction \ + rt_sigpending \ + rt_sigprocmask \ + rt_sigqueueinfo \ + rt_sigreturn \ + rt_sigsuspend \ + rt_sigtimedwait \ + rt_tgsigqueueinfo \ + s390_guarded_storage \ + s390_guarded_storage-v \ + s390_pci_mmio_read_write \ + s390_runtime_instr \ + s390_sthyi \ + s390_sthyi-v \ + sched_get_priority_mxx \ + sched_rr_get_interval \ + sched_xetaffinity \ + sched_xetattr \ + sched_xetparam \ + sched_xetscheduler \ + sched_yield \ + seccomp-filter \ + seccomp_get_action_avail \ + select \ + semop \ + sendfile \ + sendfile64 \ + set_mempolicy \ + setdomainname \ + setfsgid \ + setfsgid32 \ + setfsuid \ + setfsuid32 \ + setgid \ + setgid32 \ + setgroups \ + setgroups32 \ + sethostname \ + setns \ + setregid \ + setregid32 \ + setresgid \ + setresgid32 \ + setresuid \ + setresuid32 \ + setreuid \ + setreuid32 \ + setrlimit \ + setrlimit-Xabbrev \ + setrlimit-Xraw \ + setrlimit-Xverbose \ + setuid \ + setuid32 \ + shmxt \ + shutdown \ + sigaction \ + sigaltstack \ + siginfo \ + signal \ + signalfd4 \ + sigpending \ + sigprocmask \ + sigreturn \ + sigsuspend \ + so_error \ + so_linger \ + so_peercred \ + so_peercred-Xabbrev \ + so_peercred-Xraw \ + so_peercred-Xverbose \ + sock_filter-v \ + sock_filter-v-Xabbrev \ + sock_filter-v-Xraw \ + sock_filter-v-Xverbose \ + sockaddr_xlat-Xabbrev \ + sockaddr_xlat-Xraw \ + sockaddr_xlat-Xverbose \ + socketcall \ + sockopt-sol_netlink \ + sockopt-timestamp \ + splice \ + stat \ + stat64 \ + statfs \ + statfs64 \ + statx \ + swap \ + sxetmask \ + symlink \ + symlinkat \ + sync \ + sync_file_range \ + sync_file_range2 \ + sysinfo \ + syslog \ + tee \ + time \ + timer_create \ + timer_xettime \ + timerfd_xettime \ + times \ + times-fail \ + truncate \ + truncate64 \ + ugetrlimit \ + uio \ + umask \ + umount \ + umount2 \ + umoven-illptr \ + umovestr \ + umovestr-illptr \ + umovestr2 \ + umovestr3 \ + uname \ + unlink \ + unlinkat \ + unshare \ + userfaultfd \ + ustat \ + utime \ + utimensat \ + utimensat-Xabbrev \ + utimensat-Xraw \ + utimensat-Xverbose \ + utimes \ + vhangup \ + vmsplice \ + wait4 \ + waitid \ + waitpid \ + xattr \ + xattr-strings \ + xet_robust_list \ + xet_thread_area_x86 \ + xetitimer \ + xetpgid \ + xetpriority \ + xettimeofday \ + # + +attach_f_p_LDADD = -lpthread $(LDADD) count_f_LDADD = -lpthread $(LDADD) +delay_LDADD = $(clock_LIBS) $(LDADD) filter_unavailable_LDADD = -lpthread $(LDADD) fstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 fstatat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 ftruncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +localtime_LDADD = $(clock_LIBS) $(LDADD) +looping_threads_LDADD = -lpthread $(LDADD) lstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 mmap64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 -mq_LDADD = -lrt $(LDADD) -mq_sendrecv_LDADD = -lrt $(LDADD) -mq_sendrecv_read_LDADD = -lrt $(LDADD) -mq_sendrecv_write_LDADD = -lrt $(LDADD) +mmap64_Xabbrev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mmap64_Xraw_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mmap64_Xverbose_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mq_LDADD = $(mq_LIBS) $(LDADD) newfstatat_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 pc_LDADD = $(dl_LIBS) $(LDADD) pread64_pwrite64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 @@ -2430,216 +4627,286 @@ preadv_pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 stat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 statfs_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 -threads_execve_LDADD = -lrt -lpthread $(LDADD) -times_LDADD = -lrt $(LDADD) +threads_execve_LDADD = -lpthread $(clock_LIBS) $(LDADD) +times_LDADD = $(clock_LIBS) $(LDADD) truncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 uio_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 stack_fcall_SOURCES = stack-fcall.c \ stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c -@USE_LIBUNWIND_FALSE@LIBUNWIND_TESTS = -@USE_LIBUNWIND_TRUE@LIBUNWIND_TESTS = strace-k.test +stack_fcall_mangled_SOURCES = stack-fcall-mangled.c \ + stack-fcall-mangled-0.c stack-fcall-mangled-1.c \ + stack-fcall-mangled-2.c stack-fcall-mangled-3.c + + +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in; do not edit. +GEN_TESTS = _newselect.gen.test _newselect-P.gen.test accept.gen.test \ + accept4.gen.test access.gen.test acct.gen.test \ + add_key.gen.test adjtimex.gen.test aio.gen.test \ + aio_pgetevents.gen.test alarm.gen.test bpf.gen.test \ + bpf-obj_get_info_by_fd.gen.test \ + bpf-obj_get_info_by_fd-prog.gen.test \ + bpf-obj_get_info_by_fd-prog-v.gen.test \ + bpf-obj_get_info_by_fd-v.gen.test bpf-v.gen.test \ + btrfs.gen.test chmod.gen.test chown.gen.test chown32.gen.test \ + chroot.gen.test clock.gen.test clock_adjtime.gen.test \ + clock_nanosleep.gen.test clock_xettime.gen.test \ + copy_file_range.gen.test creat.gen.test delete_module.gen.test \ + dev-yy.gen.test dup.gen.test dup2.gen.test dup3.gen.test \ + epoll_create.gen.test epoll_create1.gen.test \ + epoll_ctl.gen.test epoll_pwait.gen.test epoll_wait.gen.test \ + erestartsys.gen.test execveat.gen.test execveat-v.gen.test \ + faccessat.gen.test fadvise64_64.gen.test fallocate.gen.test \ + fanotify_init.gen.test fanotify_mark.gen.test \ + fanotify_mark-Xabbrev.gen.test fanotify_mark-Xraw.gen.test \ + fanotify_mark-Xverbose.gen.test fchdir.gen.test \ + fchmod.gen.test fchmodat.gen.test fchown.gen.test \ + fchown32.gen.test fchownat.gen.test fcntl.gen.test \ + fcntl64.gen.test fdatasync.gen.test file_handle.gen.test \ + file_ioctl.gen.test finit_module.gen.test flock.gen.test \ + fork-f.gen.test fstat.gen.test fstat-Xabbrev.gen.test \ + fstat-Xraw.gen.test fstat-Xverbose.gen.test fstat64.gen.test \ + fstat64-Xabbrev.gen.test fstat64-Xraw.gen.test \ + fstat64-Xverbose.gen.test fstatat64.gen.test fstatfs.gen.test \ + fstatfs64.gen.test fsync.gen.test fsync-y.gen.test \ + ftruncate.gen.test ftruncate64.gen.test futimesat.gen.test \ + get_mempolicy.gen.test getcpu.gen.test getcwd.gen.test \ + getdents.gen.test getdents64.gen.test getegid.gen.test \ + getegid32.gen.test geteuid.gen.test geteuid32.gen.test \ + getgid.gen.test getgid32.gen.test getgroups.gen.test \ + getgroups32.gen.test getpeername.gen.test getpgrp.gen.test \ + getpid.gen.test getppid.gen.test getrandom.gen.test \ + getresgid.gen.test getresgid32.gen.test getresuid.gen.test \ + getresuid32.gen.test getrlimit.gen.test getrusage.gen.test \ + getsid.gen.test getsockname.gen.test gettid.gen.test \ + getuid32.gen.test getxxid.gen.test group_req.gen.test \ + inet-cmsg.gen.test init_module.gen.test inotify.gen.test \ + inotify_init1.gen.test io_uring_enter.gen.test \ + io_uring_register.gen.test io_uring_setup.gen.test \ + ioctl_block.gen.test ioctl_dm.gen.test ioctl_dm-v.gen.test \ + ioctl_evdev.gen.test ioctl_evdev-v.gen.test \ + ioctl_inotify.gen.test ioctl_kvm_run.gen.test \ + ioctl_kvm_run-v.gen.test ioctl_kvm_run_auxstr_vcpu.gen.test \ + ioctl_loop.gen.test ioctl_loop-nv.gen.test \ + ioctl_loop-v.gen.test ioctl_mtd.gen.test ioctl_nbd.gen.test \ + ioctl_nsfs.gen.test ioctl_perf.gen.test ioctl_ptp.gen.test \ + ioctl_random.gen.test ioctl_rtc.gen.test ioctl_rtc-v.gen.test \ + ioctl_scsi.gen.test ioctl_sg_io_v3.gen.test \ + ioctl_sg_io_v4.gen.test ioctl_sock_gifconf.gen.test \ + ioctl_uffdio.gen.test ioctl_v4l2.gen.test ioperm.gen.test \ + iopl.gen.test ioprio.gen.test ioprio-Xabbrev.gen.test \ + ioprio-Xraw.gen.test ioprio-Xverbose.gen.test ip_mreq.gen.test \ + ipc.gen.test ipc_msg.gen.test ipc_msg-Xabbrev.gen.test \ + ipc_msg-Xraw.gen.test ipc_msg-Xverbose.gen.test \ + ipc_msgbuf-Xabbrev.gen.test ipc_msgbuf-Xraw.gen.test \ + ipc_msgbuf-Xverbose.gen.test ipc_sem.gen.test \ + ipc_sem-Xabbrev.gen.test ipc_sem-Xraw.gen.test \ + ipc_sem-Xverbose.gen.test ipc_shm.gen.test \ + ipc_shm-Xabbrev.gen.test ipc_shm-Xraw.gen.test \ + ipc_shm-Xverbose.gen.test kcmp.gen.test kcmp-y.gen.test \ + kern_features.gen.test kernel_version.gen.test \ + kernel_version-Xabbrev.gen.test kernel_version-Xraw.gen.test \ + kernel_version-Xverbose.gen.test kexec_file_load.gen.test \ + kexec_load.gen.test keyctl.gen.test keyctl-Xabbrev.gen.test \ + keyctl-Xraw.gen.test keyctl-Xverbose.gen.test kill.gen.test \ + lchown.gen.test lchown32.gen.test link.gen.test \ + linkat.gen.test lookup_dcookie.gen.test lstat.gen.test \ + lstat64.gen.test madvise.gen.test mbind.gen.test \ + membarrier.gen.test memfd_create.gen.test \ + memfd_create-Xabbrev.gen.test memfd_create-Xraw.gen.test \ + memfd_create-Xverbose.gen.test migrate_pages.gen.test \ + mincore.gen.test mkdir.gen.test mkdirat.gen.test \ + mknod.gen.test mknodat.gen.test mlock.gen.test mlock2.gen.test \ + mlockall.gen.test mmap-Xabbrev.gen.test mmap-Xraw.gen.test \ + mmap-Xverbose.gen.test mmap64.gen.test mmap64-Xabbrev.gen.test \ + mmap64-Xraw.gen.test mmap64-Xverbose.gen.test mmsg.gen.test \ + mmsg-silent.gen.test mmsg_name.gen.test mmsg_name-v.gen.test \ + modify_ldt.gen.test mount.gen.test mount-Xabbrev.gen.test \ + mount-Xraw.gen.test mount-Xverbose.gen.test \ + move_pages.gen.test move_pages-Xabbrev.gen.test \ + move_pages-Xraw.gen.test move_pages-Xverbose.gen.test \ + mq.gen.test mq_sendrecv.gen.test mq_sendrecv-read.gen.test \ + mq_sendrecv-write.gen.test msg_control.gen.test \ + msg_control-v.gen.test msg_name.gen.test munlockall.gen.test \ + nanosleep.gen.test net-icmp_filter.gen.test \ + net-packet_mreq.gen.test net-packet_mreq-Xabbrev.gen.test \ + net-packet_mreq-Xraw.gen.test \ + net-packet_mreq-Xverbose.gen.test net-sockaddr.gen.test \ + net-tpacket_req.gen.test net-tpacket_stats.gen.test \ + net-yy-inet6.gen.test netlink_audit.gen.test \ + netlink_crypto.gen.test netlink_generic.gen.test \ + netlink_kobject_uevent.gen.test netlink_netfilter.gen.test \ + netlink_protocol.gen.test netlink_route.gen.test \ + netlink_selinux.gen.test netlink_xfrm.gen.test \ + newfstatat.gen.test nfnetlink_acct.gen.test \ + nfnetlink_cthelper.gen.test nfnetlink_ctnetlink.gen.test \ + nfnetlink_ctnetlink_exp.gen.test nfnetlink_cttimeout.gen.test \ + nfnetlink_ipset.gen.test nfnetlink_nft_compat.gen.test \ + nfnetlink_nftables.gen.test nfnetlink_osf.gen.test \ + nfnetlink_queue.gen.test nfnetlink_ulog.gen.test \ + nlattr.gen.test nlattr_br_port_msg.gen.test \ + nlattr_crypto_user_alg.gen.test nlattr_dcbmsg.gen.test \ + nlattr_fib_rule_hdr.gen.test nlattr_ifaddrlblmsg.gen.test \ + nlattr_ifaddrmsg.gen.test nlattr_ifinfomsg.gen.test \ + nlattr_ifla_af_spec.gen.test nlattr_ifla_brport.gen.test \ + nlattr_ifla_linkinfo.gen.test nlattr_ifla_port.gen.test \ + nlattr_ifla_xdp.gen.test nlattr_inet_diag_msg.gen.test \ + nlattr_inet_diag_req_compat.gen.test \ + nlattr_inet_diag_req_v2.gen.test \ + nlattr_mdba_mdb_entry.gen.test \ + nlattr_mdba_router_port.gen.test nlattr_ndmsg.gen.test \ + nlattr_ndtmsg.gen.test nlattr_netconfmsg.gen.test \ + nlattr_netlink_diag_msg.gen.test nlattr_nlmsgerr.gen.test \ + nlattr_packet_diag_msg.gen.test nlattr_rtgenmsg.gen.test \ + nlattr_rtmsg.gen.test nlattr_smc_diag_msg.gen.test \ + nlattr_tc_stats.gen.test nlattr_tca_stab.gen.test \ + nlattr_tcamsg.gen.test nlattr_tcmsg.gen.test \ + nlattr_unix_diag_msg.gen.test old_mmap.gen.test \ + old_mmap-P.gen.test old_mmap-Xabbrev.gen.test \ + old_mmap-Xraw.gen.test old_mmap-Xverbose.gen.test \ + old_mmap-v-none.gen.test oldfstat.gen.test oldlstat.gen.test \ + oldselect.gen.test oldselect-P.gen.test \ + oldselect-efault.gen.test oldselect-efault-P.gen.test \ + oldstat.gen.test open.gen.test openat.gen.test \ + orphaned_process_group.gen.test osf_utimes.gen.test \ + pause.gen.test perf_event_open.gen.test \ + perf_event_open_nonverbose.gen.test \ + perf_event_open_unabbrev.gen.test personality-Xabbrev.gen.test \ + personality-Xraw.gen.test personality-Xverbose.gen.test \ + pidfd_send_signal.gen.test pipe2.gen.test pkey_alloc.gen.test \ + pkey_free.gen.test pkey_mprotect.gen.test ppoll.gen.test \ + ppoll-P.gen.test ppoll-v.gen.test pread64-pwrite64.gen.test \ + preadv.gen.test preadv-pwritev.gen.test \ + preadv2-pwritev2.gen.test printpath-umovestr.gen.test \ + printpath-umovestr-peekdata.gen.test \ + printpath-umovestr-undumpable.gen.test \ + printsignal-Xabbrev.gen.test printsignal-Xraw.gen.test \ + printsignal-Xverbose.gen.test printstr.gen.test \ + printstrn-umoven.gen.test printstrn-umoven-peekdata.gen.test \ + printstrn-umoven-undumpable.gen.test prlimit64.gen.test \ + process_vm_readv.gen.test process_vm_writev.gen.test \ + pselect6.gen.test ptrace.gen.test ptrace_syscall_info.gen.test \ + pwritev.gen.test quotactl.gen.test quotactl-Xabbrev.gen.test \ + quotactl-Xraw.gen.test quotactl-Xverbose.gen.test \ + quotactl-v.gen.test quotactl-xfs.gen.test \ + quotactl-xfs-v.gen.test read-write.gen.test readahead.gen.test \ + readdir.gen.test readlink.gen.test readlinkat.gen.test \ + reboot.gen.test recvfrom.gen.test recvmmsg-timeout.gen.test \ + recvmsg.gen.test regex.gen.test remap_file_pages.gen.test \ + remap_file_pages-Xabbrev.gen.test \ + remap_file_pages-Xraw.gen.test \ + remap_file_pages-Xverbose.gen.test rename.gen.test \ + renameat.gen.test renameat2.gen.test request_key.gen.test \ + riscv_flush_icache.gen.test rmdir.gen.test \ + rt_sigpending.gen.test rt_sigprocmask.gen.test \ + rt_sigqueueinfo.gen.test rt_sigreturn.gen.test \ + rt_sigsuspend.gen.test rt_sigtimedwait.gen.test \ + rt_tgsigqueueinfo.gen.test s390_guarded_storage.gen.test \ + s390_guarded_storage-v.gen.test \ + s390_pci_mmio_read_write.gen.test s390_runtime_instr.gen.test \ + s390_sthyi.gen.test s390_sthyi-v.gen.test sched.gen.test \ + sched_get_priority_mxx.gen.test sched_rr_get_interval.gen.test \ + sched_xetaffinity.gen.test sched_xetattr.gen.test \ + sched_xetparam.gen.test sched_xetscheduler.gen.test \ + sched_yield.gen.test seccomp-filter.gen.test \ + seccomp-filter-v.gen.test seccomp_get_action_avail.gen.test \ + select.gen.test select-P.gen.test semop.gen.test \ + sendfile.gen.test sendfile64.gen.test set_mempolicy.gen.test \ + setdomainname.gen.test setfsgid.gen.test setfsgid32.gen.test \ + setfsuid.gen.test setfsuid32.gen.test setgid.gen.test \ + setgid32.gen.test setgroups.gen.test setgroups32.gen.test \ + sethostname.gen.test setns.gen.test setregid.gen.test \ + setregid32.gen.test setresgid.gen.test setresgid32.gen.test \ + setresuid.gen.test setresuid32.gen.test setreuid.gen.test \ + setreuid32.gen.test setrlimit.gen.test \ + setrlimit-Xabbrev.gen.test setrlimit-Xraw.gen.test \ + setrlimit-Xverbose.gen.test setuid.gen.test setuid32.gen.test \ + shmxt.gen.test shutdown.gen.test sigaction.gen.test \ + siginfo.gen.test signal.gen.test signal_receive.gen.test \ + signalfd4.gen.test sigpending.gen.test sigprocmask.gen.test \ + sigreturn.gen.test sigsuspend.gen.test so_error.gen.test \ + so_linger.gen.test so_peercred.gen.test \ + so_peercred-Xabbrev.gen.test so_peercred-Xraw.gen.test \ + so_peercred-Xverbose.gen.test sock_filter-v.gen.test \ + sock_filter-v-Xabbrev.gen.test sock_filter-v-Xraw.gen.test \ + sock_filter-v-Xverbose.gen.test sockaddr_xlat-Xabbrev.gen.test \ + sockaddr_xlat-Xraw.gen.test sockaddr_xlat-Xverbose.gen.test \ + socketcall.gen.test sockopt-sol_netlink.gen.test \ + sockopt-timestamp.gen.test splice.gen.test stat.gen.test \ + stat64.gen.test statfs.gen.test statfs64.gen.test \ + statx.gen.test swap.gen.test sxetmask.gen.test \ + symlink.gen.test symlinkat.gen.test sync.gen.test \ + sync_file_range.gen.test sync_file_range2.gen.test \ + sysinfo.gen.test syslog.gen.test tee.gen.test time.gen.test \ + timer_create.gen.test timer_xettime.gen.test \ + timerfd_xettime.gen.test times.gen.test times-fail.gen.test \ + trace_fstat.gen.test trace_fstatfs.gen.test \ + trace_lstat.gen.test trace_personality_32.gen.test \ + trace_personality_64.gen.test \ + trace_personality_regex_32.gen.test \ + trace_personality_regex_64.gen.test \ + trace_personality_regex_x32.gen.test \ + trace_personality_x32.gen.test trace_question.gen.test \ + trace_stat.gen.test trace_stat_like.gen.test \ + trace_statfs.gen.test trace_statfs_like.gen.test \ + truncate.gen.test truncate64.gen.test ugetrlimit.gen.test \ + umask.gen.test umoven-illptr.gen.test umovestr-illptr.gen.test \ + umovestr3.gen.test unlink.gen.test unlinkat.gen.test \ + unshare.gen.test userfaultfd.gen.test ustat.gen.test \ + utime.gen.test utimensat.gen.test utimensat-Xabbrev.gen.test \ + utimensat-Xraw.gen.test utimensat-Xverbose.gen.test \ + utimes.gen.test vfork-f.gen.test vhangup.gen.test \ + vmsplice.gen.test wait4.gen.test wait4-v.gen.test \ + waitid.gen.test waitid-v.gen.test waitpid.gen.test \ + xattr.gen.test xattr-strings.gen.test xet_robust_list.gen.test \ + xetitimer.gen.test xetpgid.gen.test xetpriority.gen.test \ + xettimeofday.gen.test +@ENABLE_STACKTRACE_FALSE@STACKTRACE_TESTS = +@ENABLE_STACKTRACE_TRUE@STACKTRACE_TESTS = strace-k.test \ +@ENABLE_STACKTRACE_TRUE@ $(am__append_1) DECODER_TESTS = \ - _newselect.test \ - accept.test \ - accept4.test \ - access.test \ - acct.test \ - add_key.test \ - adjtimex.test \ - aio.test \ - alarm.test \ - bpf.test \ + bpf-success-v.test \ + bpf-success.test \ brk.test \ + btrfs-X.test \ btrfs-v.test \ + btrfs-vX.test \ btrfs-vw.test \ + btrfs-vwX.test \ btrfs-w.test \ - btrfs.test \ + btrfs-wX.test \ caps-abbrev.test \ caps.test \ - chmod.test \ - chown.test \ - chown32.test \ - chroot.test \ - clock_adjtime.test \ - clock_nanosleep.test \ - clock_xettime.test \ - copy_file_range.test \ - creat.test \ - delete_module.test \ - dup.test \ - dup2.test \ - dup3.test \ - epoll_create.test \ - epoll_create1.test \ - epoll_ctl.test \ - epoll_pwait.test \ - epoll_wait.test \ - erestartsys.test \ eventfd.test \ execve-v.test \ execve.test \ - execveat-v.test \ - execveat.test \ - faccessat.test \ fadvise64.test \ - fadvise64_64.test \ - fallocate.test \ - fanotify_init.test \ - fanotify_mark.test \ - fchdir.test \ - fchmod.test \ - fchmodat.test \ - fchown.test \ - fchown32.test \ - fchownat.test \ - fcntl.test \ - fcntl64.test \ - fdatasync.test \ - file_handle.test \ - file_ioctl.test \ - finit_module.test \ - flock.test \ - fstat.test \ - fstat64.test \ - fstatat64.test \ - fstatfs.test \ - fstatfs64.test \ - fsync.test \ - ftruncate.test \ - ftruncate64.test \ futex.test \ - futimesat.test \ - get_mempolicy.test \ - getcpu.test \ - getcwd.test \ - getdents.test \ - getdents64.test \ - getegid.test \ - getegid32.test \ - geteuid.test \ - geteuid32.test \ - getgid.test \ - getgid32.test \ - getgroups.test \ - getgroups32.test \ - getpeername.test \ - getpgrp.test \ - getrandom.test \ - getresgid.test \ - getresgid32.test \ - getresuid.test \ - getresuid32.test \ - getrlimit.test \ - getrusage.test \ - getsid.test \ - getsockname.test \ getuid.test \ - getuid32.test \ - getxxid.test \ - inet-cmsg.test \ - init_module.test \ - inotify.test \ - inotify_init1.test \ + int_0x80.test \ ioctl.test \ - ioctl_block.test \ - ioctl_dm-v.test \ - ioctl_dm.test \ - ioctl_evdev-v.test \ - ioctl_evdev.test \ - ioctl_loop-nv.test \ - ioctl_loop-v.test \ - ioctl_loop.test \ - ioctl_mtd.test \ - ioctl_rtc-v.test \ - ioctl_rtc.test \ - ioctl_scsi.test \ - ioctl_sg_io_v3.test \ - ioctl_sg_io_v4.test \ - ioctl_sock_gifconf.test \ - ioctl_uffdio.test \ - ioctl_v4l2.test \ - ioperm.test \ - iopl.test \ - ioprio.test \ - ip_mreq.test \ - ipc.test \ - ipc_msg.test \ + ioctl_evdev-success-v.test \ + ioctl_evdev-success.test \ + ioctl_perf-success.test \ ipc_msgbuf.test \ - ipc_sem.test \ - ipc_shm.test \ - kcmp.test \ - kexec_file_load.test \ - kexec_load.test \ - keyctl.test \ - kill.test \ - lchown.test \ - lchown32.test \ - link.test \ - linkat.test \ + kern_features-fault.test \ llseek.test \ - lookup_dcookie.test \ lseek.test \ - lstat.test \ - lstat64.test \ - mbind.test \ - membarrier.test \ - memfd_create.test \ - migrate_pages.test \ - mincore.test \ - mkdir.test \ - mkdirat.test \ - mknod.test \ - mknodat.test \ - mlock.test \ - mlock2.test \ - mlockall.test \ mmap.test \ - mmap64.test \ - mmsg-silent.test \ - mmsg.test \ - mmsg_name-v.test \ - mmsg_name.test \ - mount.test \ - move_pages.test \ - mq.test \ - mq_sendrecv-read.test \ - mq_sendrecv-write.test \ - mq_sendrecv.test \ - msg_control-v.test \ - msg_control.test \ - msg_name.test \ - munlockall.test \ - nanosleep.test \ - net-icmp_filter.test \ - net-sockaddr.test \ + net-tpacket_stats-success.test \ net-y-unix.test \ net-yy-inet.test \ net-yy-netlink.test \ net-yy-unix.test \ net.test \ - netlink_protocol.test \ - newfstatat.test \ + netlink_sock_diag.test \ + nsyscalls-d.test \ + nsyscalls-nd.test \ nsyscalls.test \ - old_mmap.test \ - oldfstat.test \ - oldlstat.test \ - oldselect.test \ - oldstat.test \ - open.test \ - openat.test \ - pause.test \ - perf_event_open.test \ - perf_event_open_nonverbose.test \ - perf_event_open_unabbrev.test \ personality.test \ pipe.test \ - pipe2.test \ - pkey_alloc.test \ - pkey_free.test \ - pkey_mprotect.test \ + poll-P.test \ poll.test \ - ppoll.test \ prctl-arg2-intptr.test \ prctl-dumpable.test \ prctl-name.test \ @@ -2648,171 +4915,68 @@ DECODER_TESTS = \ prctl-seccomp-filter-v.test \ prctl-seccomp-strict.test \ prctl-securebits.test \ + prctl-spec-inject.test \ prctl-tid_address.test \ prctl-tsc.test \ - pread64-pwrite64.test \ - preadv-pwritev.test \ - preadv.test \ - preadv2-pwritev2.test \ - printstr.test \ - prlimit64.test \ - process_vm_readv.test \ - process_vm_writev.test \ - pselect6.test \ - ptrace.test \ - pwritev.test \ qual_fault-exit_group.test \ - quotactl-v.test \ - quotactl-xfs-v.test \ - quotactl-xfs.test \ - quotactl.test \ - read-write.test \ - readahead.test \ - readdir.test \ - readlink.test \ - readlinkat.test \ + quotactl-success-v.test \ + quotactl-success.test \ + quotactl-xfs-success-v.test \ + quotactl-xfs-success.test \ readv.test \ - reboot.test \ - recvfrom.test \ - recvmmsg-timeout.test \ - recvmsg.test \ - remap_file_pages.test \ - rename.test \ - renameat.test \ - renameat2.test \ - request_key.test \ - rmdir.test \ - rt_sigpending.test \ - rt_sigprocmask.test \ - rt_sigqueueinfo.test \ - rt_sigsuspend.test \ - rt_sigtimedwait.test \ - rt_tgsigqueueinfo.test \ - sched_get_priority_mxx.test \ - sched_rr_get_interval.test \ - sched_xetaffinity.test \ - sched_xetattr.test \ - sched_xetparam.test \ - sched_xetscheduler.test \ - sched_yield.test \ + rt_sigaction.test \ scm_rights-fd.test \ - seccomp-filter-v.test \ - seccomp-filter.test \ seccomp-strict.test \ - select.test \ - semop.test \ - sendfile.test \ - sendfile64.test \ - set_mempolicy.test \ - setdomainname.test \ - setfsgid.test \ - setfsgid32.test \ - setfsuid.test \ - setfsuid32.test \ - setgid.test \ - setgid32.test \ - setgroups.test \ - setgroups32.test \ - sethostname.test \ - setns.test \ - setregid.test \ - setregid32.test \ - setresgid.test \ - setresgid32.test \ - setresuid.test \ - setresuid32.test \ - setreuid.test \ - setreuid32.test \ - setrlimit.test \ - setuid.test \ - setuid32.test \ - shmxt.test \ - shutdown.test \ - sigaction.test \ sigaltstack.test \ - siginfo.test \ - signalfd4.test \ - sigreturn.test \ - socketcall.test \ - splice.test \ - stat.test \ - stat64.test \ - statfs.test \ - statfs64.test \ sun_path.test \ - swap.test \ - symlink.test \ - symlinkat.test \ - sync.test \ - sync_file_range.test \ - sync_file_range2.test \ - sysinfo.test \ - syslog.test \ - tee.test \ - time.test \ - timer_create.test \ - timer_xettime.test \ - timerfd_xettime.test \ - times-fail.test \ - times.test \ - truncate.test \ - truncate64.test \ - ugetrlimit.test \ uio.test \ - umask.test \ umount.test \ umount2.test \ - umoven-illptr.test \ - umovestr-illptr.test \ umovestr.test \ umovestr2.test \ - umovestr3.test \ uname.test \ unix-pair-send-recv.test \ unix-pair-sendto-recvfrom.test \ - unlink.test \ - unlinkat.test \ - unshare.test \ - userfaultfd.test \ - ustat.test \ - utime.test \ - utimensat.test \ - utimes.test \ - vhangup.test \ - vmsplice.test \ - wait4-v.test \ - wait4.test \ - waitid-v.test \ - waitid.test \ - waitpid.test \ - xattr-strings.test \ - xattr.test \ - xet_robust_list.test \ - xetitimer.test \ - xetpgid.test \ - xetpriority.test \ - xettimeofday.test \ + xet_thread_area_x86.test \ # end of DECODER_TESTS MISC_TESTS = \ attach-f-p.test \ attach-p-cmd.test \ bexecve.test \ + clone_parent.test \ + clone_ptrace.test \ count-f.test \ count.test \ + delay.test \ detach-running.test \ detach-sleeping.test \ detach-stopped.test \ + fflush.test \ filter-unavailable.test \ - fork-f.test \ + filtering_fd-syntax.test \ + filtering_syscall-syntax.test \ + first_exec_failure.test \ + get_regs.test \ + inject-nf.test \ + interactive_block.test \ + kill_child.test \ ksysent.test \ + localtime.test \ + looping_threads.test \ opipe.test \ options-syntax.test \ pc.test \ + printpath-umovestr-legacy.test \ + printstrn-umoven-legacy.test \ qual_fault-syntax.test \ + qual_fault-syscall.test \ qual_fault.test \ + qual_inject-error-signal-syscall.test \ qual_inject-error-signal.test \ + qual_inject-retval-syscall.test \ qual_inject-retval.test \ + qual_inject-signal-syscall.test \ qual_inject-signal.test \ qual_inject-syntax.test \ qual_signal.test \ @@ -2820,100 +4984,146 @@ MISC_TESTS = \ redirect-fds.test \ redirect.test \ restart_syscall.test \ - signal_receive.test \ + sigblock.test \ + sigign.test \ strace-C.test \ strace-E.test \ strace-S.test \ strace-T.test \ strace-V.test \ strace-ff.test \ + strace-log-merge-error.test \ + strace-log-merge-suffix.test \ strace-r.test \ strace-t.test \ strace-tt.test \ strace-ttt.test \ + termsig.test \ threads-execve.test \ - vfork-f.test \ # end of MISC_TESTS XFAIL_TESTS_ = -XFAIL_TESTS_m32 = $(LIBUNWIND_TESTS) -XFAIL_TESTS_mx32 = $(LIBUNWIND_TESTS) -XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) +XFAIL_TESTS_m32 = $(STACKTRACE_TESTS) +XFAIL_TESTS_mx32 = $(STACKTRACE_TESTS) +XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) $(XFAIL_TESTS_$(ARCH)) TEST_LOG_COMPILER = env -AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) MIPS_ABI=$(MIPS_ABI) $(srcdir)/run.sh +AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) STRACE_NATIVE_ARCH=$(NATIVE_ARCH) \ + SIZEOF_KERNEL_LONG_T=$(SIZEOF_KERNEL_LONG_T) \ + SIZEOF_LONG=$(SIZEOF_LONG) \ + MIPS_ABI=$(MIPS_ABI) $(srcdir)/run.sh + VALGRIND_FLAGS = --quiet -VALGRIND_SUPPRESSIONS_FILES = $(srcdir)/strace.supp -EXTRA_DIST = init.sh run.sh match.awk \ - caps-abbrev.awk \ - caps.awk \ - count-f.expected \ - eventfd.expected \ - fadvise.h \ - filter-unavailable.expected \ - fstatat.c \ - fstatx.c \ - getresugid.c \ - init_delete_module.h \ - ipc.sh \ - ipc_msgbuf.expected \ - ksysent.sed \ - lstatx.c \ - net.expected \ - oldselect.expected \ - pipe.expected \ - ppoll-v.expected \ - ppoll.expected \ - process_vm_readv_writev.c \ - qual_fault-exit_group.expected \ - qual_inject-error-signal.expected \ - qual_inject-signal.expected \ - quotactl.h \ - scno_tampering.sh \ - setfsugid.c \ - setresugid.c \ - setreugid.c \ - setugid.c \ - sigaction.awk \ - sigaltstack.expected \ - sockname.c \ - statfs.expected \ - statx.sh \ - strace-C.expected \ - strace-E.expected \ - strace-T.expected \ - strace-ff.expected \ - strace-k.test \ - strace-r.expected \ - strace.supp \ - struct_flock.c \ - sun_path.expected \ - uio.expected \ - umode_t.c \ - umovestr.expected \ - unix-pair-send-recv.expected \ - unix-pair-sendto-recvfrom.expected \ - xchownx.c \ - xgetrlimit.c \ - xselect.c \ - xstatfs.c \ - xstatfs64.c \ - xstatfsx.c \ - xstatx.c \ - $(TESTS) +VALGRIND_SUPPRESSIONS_FILES = $(abs_srcdir)/strace.supp +EXTRA_DIST = \ + COPYING \ + GPL-2.0-or-later \ + PTRACE_SEIZE.sh \ + accept_compat.h \ + attach-p-cmd.h \ + caps-abbrev.awk \ + caps.awk \ + clock.in \ + count-f.expected \ + eventfd.expected \ + fadvise.h \ + fcntl-common.c \ + filter-unavailable.expected \ + fstatat.c \ + fstatx.c \ + gen_pure_executables.sh \ + gen_tests.in \ + gen_tests.sh \ + getresugid.c \ + init.sh \ + init_delete_module.h \ + ioctl_kvm_run_common.c \ + ipc.sh \ + ksysent.sed \ + lstatx.c \ + match.awk \ + net.expected \ + netlink_sock_diag-v.sh \ + nlattr_ifla.h \ + pipe.expected \ + print_user_desc.c \ + printsignal.c \ + process_vm_readv_writev.c \ + pure_executables.list \ + qual_fault-exit_group.expected \ + qual_inject-error-signal.expected \ + qual_inject-signal.expected \ + qualify_personality.sh \ + qualify_personality_empty.in \ + quotactl.h \ + regex.in \ + rt_sigaction.awk \ + run.sh \ + sched.in \ + scno_tampering.sh \ + setfsugid.c \ + setresugid.c \ + setreugid.c \ + setugid.c \ + sigaltstack.expected \ + sockaddr_xlat.c \ + sockname.c \ + stack-fcall.h \ + strace-C.expected \ + strace-E.expected \ + strace-T.expected \ + strace-ff.expected \ + strace-k-demangle.expected \ + strace-k-demangle.test \ + strace-k.expected \ + strace-k.test \ + strace-r.expected \ + strace.supp \ + sun_path.expected \ + syntax.sh \ + trace_fstat.in \ + trace_fstatfs.in \ + trace_lstat.in \ + trace_personality_32.in \ + trace_personality_64.in \ + trace_personality_regex_32.in \ + trace_personality_regex_64.in \ + trace_personality_regex_x32.in \ + trace_personality_x32.in \ + trace_question.in \ + trace_stat.in \ + trace_stat_like.in \ + trace_statfs.in \ + trace_statfs_like.in \ + uio.expected \ + umode_t.c \ + umovestr.expected \ + unix-pair-send-recv.expected \ + unix-pair-sendto-recvfrom.expected \ + xchownx.c \ + xgetrlimit.c \ + xselect.c \ + xstatfs.c \ + xstatfs64.c \ + xstatfsx.c \ + xstatx.c \ + xutimes.c \ + $(TESTS) objects = $(filter %.$(OBJEXT),$(SOURCES:.c=.$(OBJEXT))) -CLEANFILES = ksysent.h $(TESTS:=.tmp) syscallent.i scno.h +BUILT_SOURCES = ksysent.h scno.h +CLEANFILES = ksysent.h syscallent.i scno.h SCNO_CPPFLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(ARCH_MFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) digits = [[:digit:]][[:digit:]]* al_nums = [[:alnum:]_][[:alnum:]_]* -SCNO_SED = /TRACE_INDIRECT_SUBCALL/d; s/^\[[[:space:]]*\($(digits)\)\][[:space:]]*=[[:space:]]*{[^,]*,[^,]*,[^,]*,[[:space:]]*"\($(al_nums)\)"[[:space:]]*},.*/\#ifndef __NR_\2\n\# define __NR_\2 (SYSCALL_BIT | \1)\n\#endif/p -all: all-am +SCNO_SED = /TRACE_INDIRECT_SUBCALL/d; s/^\[[[:space:]]*\($(digits)\([[:space:]]*+[[:space:]]*$(digits)\)\?\)\][[:space:]]*=[[:space:]]*{[^,]*,[^,]*,[^,]*,[[:space:]]*"\($(al_nums)\)"[[:space:]]*},.*/\#ifndef __NR_\3\n\# define __NR_\3 (SYSCALL_BIT | (\1))\n\#endif/p +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .log .o .obj .test .test$(EXEEXT) .trs -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../scno.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/pure_executables.am $(srcdir)/gen_tests.am $(srcdir)/../scno.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -2925,16 +5135,15 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/.. echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests-m32/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests-m32/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; -$(srcdir)/../scno.am: +$(srcdir)/pure_executables.am $(srcdir)/gen_tests.am $(srcdir)/../scno.am $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -2945,6 +5154,9 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) + clean-checkLIBRARIES: -test -z "$(check_LIBRARIES)" || rm -f $(check_LIBRARIES) @@ -2953,13 +5165,14 @@ libtests.a: $(libtests_a_OBJECTS) $(libtests_a_DEPENDENCIES) $(EXTRA_libtests_a_ $(AM_V_AR)$(libtests_a_AR) libtests.a $(libtests_a_OBJECTS) $(libtests_a_LIBADD) $(AM_V_at)$(RANLIB) libtests.a -clean-checkPROGRAMS: - -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) - _newselect$(EXEEXT): $(_newselect_OBJECTS) $(_newselect_DEPENDENCIES) $(EXTRA__newselect_DEPENDENCIES) @rm -f _newselect$(EXEEXT) $(AM_V_CCLD)$(LINK) $(_newselect_OBJECTS) $(_newselect_LDADD) $(LIBS) +_newselect-P$(EXEEXT): $(_newselect_P_OBJECTS) $(_newselect_P_DEPENDENCIES) $(EXTRA__newselect_P_DEPENDENCIES) + @rm -f _newselect-P$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(_newselect_P_OBJECTS) $(_newselect_P_LDADD) $(LIBS) + accept$(EXEEXT): $(accept_OBJECTS) $(accept_DEPENDENCIES) $(EXTRA_accept_DEPENDENCIES) @rm -f accept$(EXEEXT) $(AM_V_CCLD)$(LINK) $(accept_OBJECTS) $(accept_LDADD) $(LIBS) @@ -2988,6 +5201,10 @@ aio$(EXEEXT): $(aio_OBJECTS) $(aio_DEPENDENCIES) $(EXTRA_aio_DEPENDENCIES) @rm -f aio$(EXEEXT) $(AM_V_CCLD)$(LINK) $(aio_OBJECTS) $(aio_LDADD) $(LIBS) +aio_pgetevents$(EXEEXT): $(aio_pgetevents_OBJECTS) $(aio_pgetevents_DEPENDENCIES) $(EXTRA_aio_pgetevents_DEPENDENCIES) + @rm -f aio_pgetevents$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(aio_pgetevents_OBJECTS) $(aio_pgetevents_LDADD) $(LIBS) + alarm$(EXEEXT): $(alarm_OBJECTS) $(alarm_DEPENDENCIES) $(EXTRA_alarm_DEPENDENCIES) @rm -f alarm$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alarm_OBJECTS) $(alarm_LDADD) $(LIBS) @@ -3012,10 +5229,42 @@ attach-p-cmd-p$(EXEEXT): $(attach_p_cmd_p_OBJECTS) $(attach_p_cmd_p_DEPENDENCIES @rm -f attach-p-cmd-p$(EXEEXT) $(AM_V_CCLD)$(LINK) $(attach_p_cmd_p_OBJECTS) $(attach_p_cmd_p_LDADD) $(LIBS) +block_reset_raise_run$(EXEEXT): $(block_reset_raise_run_OBJECTS) $(block_reset_raise_run_DEPENDENCIES) $(EXTRA_block_reset_raise_run_DEPENDENCIES) + @rm -f block_reset_raise_run$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(block_reset_raise_run_OBJECTS) $(block_reset_raise_run_LDADD) $(LIBS) + bpf$(EXEEXT): $(bpf_OBJECTS) $(bpf_DEPENDENCIES) $(EXTRA_bpf_DEPENDENCIES) @rm -f bpf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bpf_OBJECTS) $(bpf_LDADD) $(LIBS) +bpf-obj_get_info_by_fd$(EXEEXT): $(bpf_obj_get_info_by_fd_OBJECTS) $(bpf_obj_get_info_by_fd_DEPENDENCIES) $(EXTRA_bpf_obj_get_info_by_fd_DEPENDENCIES) + @rm -f bpf-obj_get_info_by_fd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_obj_get_info_by_fd_OBJECTS) $(bpf_obj_get_info_by_fd_LDADD) $(LIBS) + +bpf-obj_get_info_by_fd-prog$(EXEEXT): $(bpf_obj_get_info_by_fd_prog_OBJECTS) $(bpf_obj_get_info_by_fd_prog_DEPENDENCIES) $(EXTRA_bpf_obj_get_info_by_fd_prog_DEPENDENCIES) + @rm -f bpf-obj_get_info_by_fd-prog$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_obj_get_info_by_fd_prog_OBJECTS) $(bpf_obj_get_info_by_fd_prog_LDADD) $(LIBS) + +bpf-obj_get_info_by_fd-prog-v$(EXEEXT): $(bpf_obj_get_info_by_fd_prog_v_OBJECTS) $(bpf_obj_get_info_by_fd_prog_v_DEPENDENCIES) $(EXTRA_bpf_obj_get_info_by_fd_prog_v_DEPENDENCIES) + @rm -f bpf-obj_get_info_by_fd-prog-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_obj_get_info_by_fd_prog_v_OBJECTS) $(bpf_obj_get_info_by_fd_prog_v_LDADD) $(LIBS) + +bpf-obj_get_info_by_fd-v$(EXEEXT): $(bpf_obj_get_info_by_fd_v_OBJECTS) $(bpf_obj_get_info_by_fd_v_DEPENDENCIES) $(EXTRA_bpf_obj_get_info_by_fd_v_DEPENDENCIES) + @rm -f bpf-obj_get_info_by_fd-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_obj_get_info_by_fd_v_OBJECTS) $(bpf_obj_get_info_by_fd_v_LDADD) $(LIBS) + +bpf-success$(EXEEXT): $(bpf_success_OBJECTS) $(bpf_success_DEPENDENCIES) $(EXTRA_bpf_success_DEPENDENCIES) + @rm -f bpf-success$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_success_OBJECTS) $(bpf_success_LDADD) $(LIBS) + +bpf-success-v$(EXEEXT): $(bpf_success_v_OBJECTS) $(bpf_success_v_DEPENDENCIES) $(EXTRA_bpf_success_v_DEPENDENCIES) + @rm -f bpf-success-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_success_v_OBJECTS) $(bpf_success_v_LDADD) $(LIBS) + +bpf-v$(EXEEXT): $(bpf_v_OBJECTS) $(bpf_v_DEPENDENCIES) $(EXTRA_bpf_v_DEPENDENCIES) + @rm -f bpf-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_v_OBJECTS) $(bpf_v_LDADD) $(LIBS) + brk$(EXEEXT): $(brk_OBJECTS) $(brk_DEPENDENCIES) $(EXTRA_brk_DEPENDENCIES) @rm -f brk$(EXEEXT) $(AM_V_CCLD)$(LINK) $(brk_OBJECTS) $(brk_LDADD) $(LIBS) @@ -3032,6 +5281,14 @@ caps-abbrev$(EXEEXT): $(caps_abbrev_OBJECTS) $(caps_abbrev_DEPENDENCIES) $(EXTRA @rm -f caps-abbrev$(EXEEXT) $(AM_V_CCLD)$(LINK) $(caps_abbrev_OBJECTS) $(caps_abbrev_LDADD) $(LIBS) +check_sigblock$(EXEEXT): $(check_sigblock_OBJECTS) $(check_sigblock_DEPENDENCIES) $(EXTRA_check_sigblock_DEPENDENCIES) + @rm -f check_sigblock$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(check_sigblock_OBJECTS) $(check_sigblock_LDADD) $(LIBS) + +check_sigign$(EXEEXT): $(check_sigign_OBJECTS) $(check_sigign_DEPENDENCIES) $(EXTRA_check_sigign_DEPENDENCIES) + @rm -f check_sigign$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(check_sigign_OBJECTS) $(check_sigign_LDADD) $(LIBS) + chmod$(EXEEXT): $(chmod_OBJECTS) $(chmod_DEPENDENCIES) $(EXTRA_chmod_DEPENDENCIES) @rm -f chmod$(EXEEXT) $(AM_V_CCLD)$(LINK) $(chmod_OBJECTS) $(chmod_LDADD) $(LIBS) @@ -3060,6 +5317,14 @@ clock_xettime$(EXEEXT): $(clock_xettime_OBJECTS) $(clock_xettime_DEPENDENCIES) $ @rm -f clock_xettime$(EXEEXT) $(AM_V_CCLD)$(LINK) $(clock_xettime_OBJECTS) $(clock_xettime_LDADD) $(LIBS) +clone_parent$(EXEEXT): $(clone_parent_OBJECTS) $(clone_parent_DEPENDENCIES) $(EXTRA_clone_parent_DEPENDENCIES) + @rm -f clone_parent$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(clone_parent_OBJECTS) $(clone_parent_LDADD) $(LIBS) + +clone_ptrace$(EXEEXT): $(clone_ptrace_OBJECTS) $(clone_ptrace_DEPENDENCIES) $(EXTRA_clone_ptrace_DEPENDENCIES) + @rm -f clone_ptrace$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(clone_ptrace_OBJECTS) $(clone_ptrace_LDADD) $(LIBS) + copy_file_range$(EXEEXT): $(copy_file_range_OBJECTS) $(copy_file_range_DEPENDENCIES) $(EXTRA_copy_file_range_DEPENDENCIES) @rm -f copy_file_range$(EXEEXT) $(AM_V_CCLD)$(LINK) $(copy_file_range_OBJECTS) $(copy_file_range_LDADD) $(LIBS) @@ -3072,10 +5337,18 @@ creat$(EXEEXT): $(creat_OBJECTS) $(creat_DEPENDENCIES) $(EXTRA_creat_DEPENDENCIE @rm -f creat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(creat_OBJECTS) $(creat_LDADD) $(LIBS) +delay$(EXEEXT): $(delay_OBJECTS) $(delay_DEPENDENCIES) $(EXTRA_delay_DEPENDENCIES) + @rm -f delay$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(delay_OBJECTS) $(delay_LDADD) $(LIBS) + delete_module$(EXEEXT): $(delete_module_OBJECTS) $(delete_module_DEPENDENCIES) $(EXTRA_delete_module_DEPENDENCIES) @rm -f delete_module$(EXEEXT) $(AM_V_CCLD)$(LINK) $(delete_module_OBJECTS) $(delete_module_LDADD) $(LIBS) +dev-yy$(EXEEXT): $(dev_yy_OBJECTS) $(dev_yy_DEPENDENCIES) $(EXTRA_dev_yy_DEPENDENCIES) + @rm -f dev-yy$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(dev_yy_OBJECTS) $(dev_yy_LDADD) $(LIBS) + dup$(EXEEXT): $(dup_OBJECTS) $(dup_DEPENDENCIES) $(EXTRA_dup_DEPENDENCIES) @rm -f dup$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dup_OBJECTS) $(dup_LDADD) $(LIBS) @@ -3156,6 +5429,18 @@ fanotify_mark$(EXEEXT): $(fanotify_mark_OBJECTS) $(fanotify_mark_DEPENDENCIES) $ @rm -f fanotify_mark$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fanotify_mark_OBJECTS) $(fanotify_mark_LDADD) $(LIBS) +fanotify_mark-Xabbrev$(EXEEXT): $(fanotify_mark_Xabbrev_OBJECTS) $(fanotify_mark_Xabbrev_DEPENDENCIES) $(EXTRA_fanotify_mark_Xabbrev_DEPENDENCIES) + @rm -f fanotify_mark-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fanotify_mark_Xabbrev_OBJECTS) $(fanotify_mark_Xabbrev_LDADD) $(LIBS) + +fanotify_mark-Xraw$(EXEEXT): $(fanotify_mark_Xraw_OBJECTS) $(fanotify_mark_Xraw_DEPENDENCIES) $(EXTRA_fanotify_mark_Xraw_DEPENDENCIES) + @rm -f fanotify_mark-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fanotify_mark_Xraw_OBJECTS) $(fanotify_mark_Xraw_LDADD) $(LIBS) + +fanotify_mark-Xverbose$(EXEEXT): $(fanotify_mark_Xverbose_OBJECTS) $(fanotify_mark_Xverbose_DEPENDENCIES) $(EXTRA_fanotify_mark_Xverbose_DEPENDENCIES) + @rm -f fanotify_mark-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fanotify_mark_Xverbose_OBJECTS) $(fanotify_mark_Xverbose_LDADD) $(LIBS) + fchdir$(EXEEXT): $(fchdir_OBJECTS) $(fchdir_DEPENDENCIES) $(EXTRA_fchdir_DEPENDENCIES) @rm -f fchdir$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fchdir_OBJECTS) $(fchdir_LDADD) $(LIBS) @@ -3192,6 +5477,10 @@ fdatasync$(EXEEXT): $(fdatasync_OBJECTS) $(fdatasync_DEPENDENCIES) $(EXTRA_fdata @rm -f fdatasync$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fdatasync_OBJECTS) $(fdatasync_LDADD) $(LIBS) +fflush$(EXEEXT): $(fflush_OBJECTS) $(fflush_DEPENDENCIES) $(EXTRA_fflush_DEPENDENCIES) + @rm -f fflush$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fflush_OBJECTS) $(fflush_LDADD) $(LIBS) + file_handle$(EXEEXT): $(file_handle_OBJECTS) $(file_handle_DEPENDENCIES) $(EXTRA_file_handle_DEPENDENCIES) @rm -f file_handle$(EXEEXT) $(AM_V_CCLD)$(LINK) $(file_handle_OBJECTS) $(file_handle_LDADD) $(LIBS) @@ -3220,10 +5509,34 @@ fstat$(EXEEXT): $(fstat_OBJECTS) $(fstat_DEPENDENCIES) $(EXTRA_fstat_DEPENDENCIE @rm -f fstat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fstat_OBJECTS) $(fstat_LDADD) $(LIBS) +fstat-Xabbrev$(EXEEXT): $(fstat_Xabbrev_OBJECTS) $(fstat_Xabbrev_DEPENDENCIES) $(EXTRA_fstat_Xabbrev_DEPENDENCIES) + @rm -f fstat-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat_Xabbrev_OBJECTS) $(fstat_Xabbrev_LDADD) $(LIBS) + +fstat-Xraw$(EXEEXT): $(fstat_Xraw_OBJECTS) $(fstat_Xraw_DEPENDENCIES) $(EXTRA_fstat_Xraw_DEPENDENCIES) + @rm -f fstat-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat_Xraw_OBJECTS) $(fstat_Xraw_LDADD) $(LIBS) + +fstat-Xverbose$(EXEEXT): $(fstat_Xverbose_OBJECTS) $(fstat_Xverbose_DEPENDENCIES) $(EXTRA_fstat_Xverbose_DEPENDENCIES) + @rm -f fstat-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat_Xverbose_OBJECTS) $(fstat_Xverbose_LDADD) $(LIBS) + fstat64$(EXEEXT): $(fstat64_OBJECTS) $(fstat64_DEPENDENCIES) $(EXTRA_fstat64_DEPENDENCIES) @rm -f fstat64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fstat64_OBJECTS) $(fstat64_LDADD) $(LIBS) +fstat64-Xabbrev$(EXEEXT): $(fstat64_Xabbrev_OBJECTS) $(fstat64_Xabbrev_DEPENDENCIES) $(EXTRA_fstat64_Xabbrev_DEPENDENCIES) + @rm -f fstat64-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat64_Xabbrev_OBJECTS) $(fstat64_Xabbrev_LDADD) $(LIBS) + +fstat64-Xraw$(EXEEXT): $(fstat64_Xraw_OBJECTS) $(fstat64_Xraw_DEPENDENCIES) $(EXTRA_fstat64_Xraw_DEPENDENCIES) + @rm -f fstat64-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat64_Xraw_OBJECTS) $(fstat64_Xraw_LDADD) $(LIBS) + +fstat64-Xverbose$(EXEEXT): $(fstat64_Xverbose_OBJECTS) $(fstat64_Xverbose_DEPENDENCIES) $(EXTRA_fstat64_Xverbose_DEPENDENCIES) + @rm -f fstat64-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat64_Xverbose_OBJECTS) $(fstat64_Xverbose_LDADD) $(LIBS) + fstatat64$(EXEEXT): $(fstatat64_OBJECTS) $(fstatat64_DEPENDENCIES) $(EXTRA_fstatat64_DEPENDENCIES) @rm -f fstatat64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fstatat64_OBJECTS) $(fstatat64_LDADD) $(LIBS) @@ -3240,6 +5553,10 @@ fsync$(EXEEXT): $(fsync_OBJECTS) $(fsync_DEPENDENCIES) $(EXTRA_fsync_DEPENDENCIE @rm -f fsync$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fsync_OBJECTS) $(fsync_LDADD) $(LIBS) +fsync-y$(EXEEXT): $(fsync_y_OBJECTS) $(fsync_y_DEPENDENCIES) $(EXTRA_fsync_y_DEPENDENCIES) + @rm -f fsync-y$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fsync_y_OBJECTS) $(fsync_y_LDADD) $(LIBS) + ftruncate$(EXEEXT): $(ftruncate_OBJECTS) $(ftruncate_DEPENDENCIES) $(EXTRA_ftruncate_DEPENDENCIES) @rm -f ftruncate$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ftruncate_OBJECTS) $(ftruncate_LDADD) $(LIBS) @@ -3316,6 +5633,14 @@ getpgrp$(EXEEXT): $(getpgrp_OBJECTS) $(getpgrp_DEPENDENCIES) $(EXTRA_getpgrp_DEP @rm -f getpgrp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getpgrp_OBJECTS) $(getpgrp_LDADD) $(LIBS) +getpid$(EXEEXT): $(getpid_OBJECTS) $(getpid_DEPENDENCIES) $(EXTRA_getpid_DEPENDENCIES) + @rm -f getpid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getpid_OBJECTS) $(getpid_LDADD) $(LIBS) + +getppid$(EXEEXT): $(getppid_OBJECTS) $(getppid_DEPENDENCIES) $(EXTRA_getppid_DEPENDENCIES) + @rm -f getppid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getppid_OBJECTS) $(getppid_LDADD) $(LIBS) + getrandom$(EXEEXT): $(getrandom_OBJECTS) $(getrandom_DEPENDENCIES) $(EXTRA_getrandom_DEPENDENCIES) @rm -f getrandom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getrandom_OBJECTS) $(getrandom_LDADD) $(LIBS) @@ -3352,6 +5677,10 @@ getsockname$(EXEEXT): $(getsockname_OBJECTS) $(getsockname_DEPENDENCIES) $(EXTRA @rm -f getsockname$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getsockname_OBJECTS) $(getsockname_LDADD) $(LIBS) +gettid$(EXEEXT): $(gettid_OBJECTS) $(gettid_DEPENDENCIES) $(EXTRA_gettid_DEPENDENCIES) + @rm -f gettid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gettid_OBJECTS) $(gettid_LDADD) $(LIBS) + getuid$(EXEEXT): $(getuid_OBJECTS) $(getuid_DEPENDENCIES) $(EXTRA_getuid_DEPENDENCIES) @rm -f getuid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getuid_OBJECTS) $(getuid_LDADD) $(LIBS) @@ -3364,6 +5693,10 @@ getxxid$(EXEEXT): $(getxxid_OBJECTS) $(getxxid_DEPENDENCIES) $(EXTRA_getxxid_DEP @rm -f getxxid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getxxid_OBJECTS) $(getxxid_LDADD) $(LIBS) +group_req$(EXEEXT): $(group_req_OBJECTS) $(group_req_DEPENDENCIES) $(EXTRA_group_req_DEPENDENCIES) + @rm -f group_req$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(group_req_OBJECTS) $(group_req_LDADD) $(LIBS) + inet-cmsg$(EXEEXT): $(inet_cmsg_OBJECTS) $(inet_cmsg_DEPENDENCIES) $(EXTRA_inet_cmsg_DEPENDENCIES) @rm -f inet-cmsg$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inet_cmsg_OBJECTS) $(inet_cmsg_LDADD) $(LIBS) @@ -3372,6 +5705,10 @@ init_module$(EXEEXT): $(init_module_OBJECTS) $(init_module_DEPENDENCIES) $(EXTRA @rm -f init_module$(EXEEXT) $(AM_V_CCLD)$(LINK) $(init_module_OBJECTS) $(init_module_LDADD) $(LIBS) +inject-nf$(EXEEXT): $(inject_nf_OBJECTS) $(inject_nf_DEPENDENCIES) $(EXTRA_inject_nf_DEPENDENCIES) + @rm -f inject-nf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(inject_nf_OBJECTS) $(inject_nf_LDADD) $(LIBS) + inotify$(EXEEXT): $(inotify_OBJECTS) $(inotify_DEPENDENCIES) $(EXTRA_inotify_DEPENDENCIES) @rm -f inotify$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inotify_OBJECTS) $(inotify_LDADD) $(LIBS) @@ -3380,6 +5717,22 @@ inotify_init1$(EXEEXT): $(inotify_init1_OBJECTS) $(inotify_init1_DEPENDENCIES) $ @rm -f inotify_init1$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inotify_init1_OBJECTS) $(inotify_init1_LDADD) $(LIBS) +int_0x80$(EXEEXT): $(int_0x80_OBJECTS) $(int_0x80_DEPENDENCIES) $(EXTRA_int_0x80_DEPENDENCIES) + @rm -f int_0x80$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(int_0x80_OBJECTS) $(int_0x80_LDADD) $(LIBS) + +io_uring_enter$(EXEEXT): $(io_uring_enter_OBJECTS) $(io_uring_enter_DEPENDENCIES) $(EXTRA_io_uring_enter_DEPENDENCIES) + @rm -f io_uring_enter$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(io_uring_enter_OBJECTS) $(io_uring_enter_LDADD) $(LIBS) + +io_uring_register$(EXEEXT): $(io_uring_register_OBJECTS) $(io_uring_register_DEPENDENCIES) $(EXTRA_io_uring_register_DEPENDENCIES) + @rm -f io_uring_register$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(io_uring_register_OBJECTS) $(io_uring_register_LDADD) $(LIBS) + +io_uring_setup$(EXEEXT): $(io_uring_setup_OBJECTS) $(io_uring_setup_DEPENDENCIES) $(EXTRA_io_uring_setup_DEPENDENCIES) + @rm -f io_uring_setup$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(io_uring_setup_OBJECTS) $(io_uring_setup_LDADD) $(LIBS) + ioctl$(EXEEXT): $(ioctl_OBJECTS) $(ioctl_DEPENDENCIES) $(EXTRA_ioctl_DEPENDENCIES) @rm -f ioctl$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ioctl_OBJECTS) $(ioctl_LDADD) $(LIBS) @@ -3400,10 +5753,34 @@ ioctl_evdev$(EXEEXT): $(ioctl_evdev_OBJECTS) $(ioctl_evdev_DEPENDENCIES) $(EXTRA @rm -f ioctl_evdev$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ioctl_evdev_OBJECTS) $(ioctl_evdev_LDADD) $(LIBS) +ioctl_evdev-success$(EXEEXT): $(ioctl_evdev_success_OBJECTS) $(ioctl_evdev_success_DEPENDENCIES) $(EXTRA_ioctl_evdev_success_DEPENDENCIES) + @rm -f ioctl_evdev-success$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_evdev_success_OBJECTS) $(ioctl_evdev_success_LDADD) $(LIBS) + +ioctl_evdev-success-v$(EXEEXT): $(ioctl_evdev_success_v_OBJECTS) $(ioctl_evdev_success_v_DEPENDENCIES) $(EXTRA_ioctl_evdev_success_v_DEPENDENCIES) + @rm -f ioctl_evdev-success-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_evdev_success_v_OBJECTS) $(ioctl_evdev_success_v_LDADD) $(LIBS) + ioctl_evdev-v$(EXEEXT): $(ioctl_evdev_v_OBJECTS) $(ioctl_evdev_v_DEPENDENCIES) $(EXTRA_ioctl_evdev_v_DEPENDENCIES) @rm -f ioctl_evdev-v$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ioctl_evdev_v_OBJECTS) $(ioctl_evdev_v_LDADD) $(LIBS) +ioctl_inotify$(EXEEXT): $(ioctl_inotify_OBJECTS) $(ioctl_inotify_DEPENDENCIES) $(EXTRA_ioctl_inotify_DEPENDENCIES) + @rm -f ioctl_inotify$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_inotify_OBJECTS) $(ioctl_inotify_LDADD) $(LIBS) + +ioctl_kvm_run$(EXEEXT): $(ioctl_kvm_run_OBJECTS) $(ioctl_kvm_run_DEPENDENCIES) $(EXTRA_ioctl_kvm_run_DEPENDENCIES) + @rm -f ioctl_kvm_run$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_kvm_run_OBJECTS) $(ioctl_kvm_run_LDADD) $(LIBS) + +ioctl_kvm_run-v$(EXEEXT): $(ioctl_kvm_run_v_OBJECTS) $(ioctl_kvm_run_v_DEPENDENCIES) $(EXTRA_ioctl_kvm_run_v_DEPENDENCIES) + @rm -f ioctl_kvm_run-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_kvm_run_v_OBJECTS) $(ioctl_kvm_run_v_LDADD) $(LIBS) + +ioctl_kvm_run_auxstr_vcpu$(EXEEXT): $(ioctl_kvm_run_auxstr_vcpu_OBJECTS) $(ioctl_kvm_run_auxstr_vcpu_DEPENDENCIES) $(EXTRA_ioctl_kvm_run_auxstr_vcpu_DEPENDENCIES) + @rm -f ioctl_kvm_run_auxstr_vcpu$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_kvm_run_auxstr_vcpu_OBJECTS) $(ioctl_kvm_run_auxstr_vcpu_LDADD) $(LIBS) + ioctl_loop$(EXEEXT): $(ioctl_loop_OBJECTS) $(ioctl_loop_DEPENDENCIES) $(EXTRA_ioctl_loop_DEPENDENCIES) @rm -f ioctl_loop$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ioctl_loop_OBJECTS) $(ioctl_loop_LDADD) $(LIBS) @@ -3420,6 +5797,30 @@ ioctl_mtd$(EXEEXT): $(ioctl_mtd_OBJECTS) $(ioctl_mtd_DEPENDENCIES) $(EXTRA_ioctl @rm -f ioctl_mtd$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ioctl_mtd_OBJECTS) $(ioctl_mtd_LDADD) $(LIBS) +ioctl_nbd$(EXEEXT): $(ioctl_nbd_OBJECTS) $(ioctl_nbd_DEPENDENCIES) $(EXTRA_ioctl_nbd_DEPENDENCIES) + @rm -f ioctl_nbd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_nbd_OBJECTS) $(ioctl_nbd_LDADD) $(LIBS) + +ioctl_nsfs$(EXEEXT): $(ioctl_nsfs_OBJECTS) $(ioctl_nsfs_DEPENDENCIES) $(EXTRA_ioctl_nsfs_DEPENDENCIES) + @rm -f ioctl_nsfs$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_nsfs_OBJECTS) $(ioctl_nsfs_LDADD) $(LIBS) + +ioctl_perf$(EXEEXT): $(ioctl_perf_OBJECTS) $(ioctl_perf_DEPENDENCIES) $(EXTRA_ioctl_perf_DEPENDENCIES) + @rm -f ioctl_perf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_perf_OBJECTS) $(ioctl_perf_LDADD) $(LIBS) + +ioctl_perf-success$(EXEEXT): $(ioctl_perf_success_OBJECTS) $(ioctl_perf_success_DEPENDENCIES) $(EXTRA_ioctl_perf_success_DEPENDENCIES) + @rm -f ioctl_perf-success$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_perf_success_OBJECTS) $(ioctl_perf_success_LDADD) $(LIBS) + +ioctl_ptp$(EXEEXT): $(ioctl_ptp_OBJECTS) $(ioctl_ptp_DEPENDENCIES) $(EXTRA_ioctl_ptp_DEPENDENCIES) + @rm -f ioctl_ptp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_ptp_OBJECTS) $(ioctl_ptp_LDADD) $(LIBS) + +ioctl_random$(EXEEXT): $(ioctl_random_OBJECTS) $(ioctl_random_DEPENDENCIES) $(EXTRA_ioctl_random_DEPENDENCIES) + @rm -f ioctl_random$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_random_OBJECTS) $(ioctl_random_LDADD) $(LIBS) + ioctl_rtc$(EXEEXT): $(ioctl_rtc_OBJECTS) $(ioctl_rtc_DEPENDENCIES) $(EXTRA_ioctl_rtc_DEPENDENCIES) @rm -f ioctl_rtc$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ioctl_rtc_OBJECTS) $(ioctl_rtc_LDADD) $(LIBS) @@ -3464,6 +5865,18 @@ ioprio$(EXEEXT): $(ioprio_OBJECTS) $(ioprio_DEPENDENCIES) $(EXTRA_ioprio_DEPENDE @rm -f ioprio$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ioprio_OBJECTS) $(ioprio_LDADD) $(LIBS) +ioprio-Xabbrev$(EXEEXT): $(ioprio_Xabbrev_OBJECTS) $(ioprio_Xabbrev_DEPENDENCIES) $(EXTRA_ioprio_Xabbrev_DEPENDENCIES) + @rm -f ioprio-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioprio_Xabbrev_OBJECTS) $(ioprio_Xabbrev_LDADD) $(LIBS) + +ioprio-Xraw$(EXEEXT): $(ioprio_Xraw_OBJECTS) $(ioprio_Xraw_DEPENDENCIES) $(EXTRA_ioprio_Xraw_DEPENDENCIES) + @rm -f ioprio-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioprio_Xraw_OBJECTS) $(ioprio_Xraw_LDADD) $(LIBS) + +ioprio-Xverbose$(EXEEXT): $(ioprio_Xverbose_OBJECTS) $(ioprio_Xverbose_DEPENDENCIES) $(EXTRA_ioprio_Xverbose_DEPENDENCIES) + @rm -f ioprio-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioprio_Xverbose_OBJECTS) $(ioprio_Xverbose_LDADD) $(LIBS) + ip_mreq$(EXEEXT): $(ip_mreq_OBJECTS) $(ip_mreq_DEPENDENCIES) $(EXTRA_ip_mreq_DEPENDENCIES) @rm -f ip_mreq$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ip_mreq_OBJECTS) $(ip_mreq_LDADD) $(LIBS) @@ -3476,22 +5889,98 @@ ipc_msg$(EXEEXT): $(ipc_msg_OBJECTS) $(ipc_msg_DEPENDENCIES) $(EXTRA_ipc_msg_DEP @rm -f ipc_msg$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ipc_msg_OBJECTS) $(ipc_msg_LDADD) $(LIBS) +ipc_msg-Xabbrev$(EXEEXT): $(ipc_msg_Xabbrev_OBJECTS) $(ipc_msg_Xabbrev_DEPENDENCIES) $(EXTRA_ipc_msg_Xabbrev_DEPENDENCIES) + @rm -f ipc_msg-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msg_Xabbrev_OBJECTS) $(ipc_msg_Xabbrev_LDADD) $(LIBS) + +ipc_msg-Xraw$(EXEEXT): $(ipc_msg_Xraw_OBJECTS) $(ipc_msg_Xraw_DEPENDENCIES) $(EXTRA_ipc_msg_Xraw_DEPENDENCIES) + @rm -f ipc_msg-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msg_Xraw_OBJECTS) $(ipc_msg_Xraw_LDADD) $(LIBS) + +ipc_msg-Xverbose$(EXEEXT): $(ipc_msg_Xverbose_OBJECTS) $(ipc_msg_Xverbose_DEPENDENCIES) $(EXTRA_ipc_msg_Xverbose_DEPENDENCIES) + @rm -f ipc_msg-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msg_Xverbose_OBJECTS) $(ipc_msg_Xverbose_LDADD) $(LIBS) + ipc_msgbuf$(EXEEXT): $(ipc_msgbuf_OBJECTS) $(ipc_msgbuf_DEPENDENCIES) $(EXTRA_ipc_msgbuf_DEPENDENCIES) @rm -f ipc_msgbuf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ipc_msgbuf_OBJECTS) $(ipc_msgbuf_LDADD) $(LIBS) +ipc_msgbuf-Xabbrev$(EXEEXT): $(ipc_msgbuf_Xabbrev_OBJECTS) $(ipc_msgbuf_Xabbrev_DEPENDENCIES) $(EXTRA_ipc_msgbuf_Xabbrev_DEPENDENCIES) + @rm -f ipc_msgbuf-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msgbuf_Xabbrev_OBJECTS) $(ipc_msgbuf_Xabbrev_LDADD) $(LIBS) + +ipc_msgbuf-Xraw$(EXEEXT): $(ipc_msgbuf_Xraw_OBJECTS) $(ipc_msgbuf_Xraw_DEPENDENCIES) $(EXTRA_ipc_msgbuf_Xraw_DEPENDENCIES) + @rm -f ipc_msgbuf-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msgbuf_Xraw_OBJECTS) $(ipc_msgbuf_Xraw_LDADD) $(LIBS) + +ipc_msgbuf-Xverbose$(EXEEXT): $(ipc_msgbuf_Xverbose_OBJECTS) $(ipc_msgbuf_Xverbose_DEPENDENCIES) $(EXTRA_ipc_msgbuf_Xverbose_DEPENDENCIES) + @rm -f ipc_msgbuf-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msgbuf_Xverbose_OBJECTS) $(ipc_msgbuf_Xverbose_LDADD) $(LIBS) + ipc_sem$(EXEEXT): $(ipc_sem_OBJECTS) $(ipc_sem_DEPENDENCIES) $(EXTRA_ipc_sem_DEPENDENCIES) @rm -f ipc_sem$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ipc_sem_OBJECTS) $(ipc_sem_LDADD) $(LIBS) +ipc_sem-Xabbrev$(EXEEXT): $(ipc_sem_Xabbrev_OBJECTS) $(ipc_sem_Xabbrev_DEPENDENCIES) $(EXTRA_ipc_sem_Xabbrev_DEPENDENCIES) + @rm -f ipc_sem-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_sem_Xabbrev_OBJECTS) $(ipc_sem_Xabbrev_LDADD) $(LIBS) + +ipc_sem-Xraw$(EXEEXT): $(ipc_sem_Xraw_OBJECTS) $(ipc_sem_Xraw_DEPENDENCIES) $(EXTRA_ipc_sem_Xraw_DEPENDENCIES) + @rm -f ipc_sem-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_sem_Xraw_OBJECTS) $(ipc_sem_Xraw_LDADD) $(LIBS) + +ipc_sem-Xverbose$(EXEEXT): $(ipc_sem_Xverbose_OBJECTS) $(ipc_sem_Xverbose_DEPENDENCIES) $(EXTRA_ipc_sem_Xverbose_DEPENDENCIES) + @rm -f ipc_sem-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_sem_Xverbose_OBJECTS) $(ipc_sem_Xverbose_LDADD) $(LIBS) + ipc_shm$(EXEEXT): $(ipc_shm_OBJECTS) $(ipc_shm_DEPENDENCIES) $(EXTRA_ipc_shm_DEPENDENCIES) @rm -f ipc_shm$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ipc_shm_OBJECTS) $(ipc_shm_LDADD) $(LIBS) +ipc_shm-Xabbrev$(EXEEXT): $(ipc_shm_Xabbrev_OBJECTS) $(ipc_shm_Xabbrev_DEPENDENCIES) $(EXTRA_ipc_shm_Xabbrev_DEPENDENCIES) + @rm -f ipc_shm-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_shm_Xabbrev_OBJECTS) $(ipc_shm_Xabbrev_LDADD) $(LIBS) + +ipc_shm-Xraw$(EXEEXT): $(ipc_shm_Xraw_OBJECTS) $(ipc_shm_Xraw_DEPENDENCIES) $(EXTRA_ipc_shm_Xraw_DEPENDENCIES) + @rm -f ipc_shm-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_shm_Xraw_OBJECTS) $(ipc_shm_Xraw_LDADD) $(LIBS) + +ipc_shm-Xverbose$(EXEEXT): $(ipc_shm_Xverbose_OBJECTS) $(ipc_shm_Xverbose_DEPENDENCIES) $(EXTRA_ipc_shm_Xverbose_DEPENDENCIES) + @rm -f ipc_shm-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_shm_Xverbose_OBJECTS) $(ipc_shm_Xverbose_LDADD) $(LIBS) + +is_linux_mips_n64$(EXEEXT): $(is_linux_mips_n64_OBJECTS) $(is_linux_mips_n64_DEPENDENCIES) $(EXTRA_is_linux_mips_n64_DEPENDENCIES) + @rm -f is_linux_mips_n64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(is_linux_mips_n64_OBJECTS) $(is_linux_mips_n64_LDADD) $(LIBS) + kcmp$(EXEEXT): $(kcmp_OBJECTS) $(kcmp_DEPENDENCIES) $(EXTRA_kcmp_DEPENDENCIES) @rm -f kcmp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(kcmp_OBJECTS) $(kcmp_LDADD) $(LIBS) +kcmp-y$(EXEEXT): $(kcmp_y_OBJECTS) $(kcmp_y_DEPENDENCIES) $(EXTRA_kcmp_y_DEPENDENCIES) + @rm -f kcmp-y$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kcmp_y_OBJECTS) $(kcmp_y_LDADD) $(LIBS) + +kern_features$(EXEEXT): $(kern_features_OBJECTS) $(kern_features_DEPENDENCIES) $(EXTRA_kern_features_DEPENDENCIES) + @rm -f kern_features$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kern_features_OBJECTS) $(kern_features_LDADD) $(LIBS) + +kernel_version$(EXEEXT): $(kernel_version_OBJECTS) $(kernel_version_DEPENDENCIES) $(EXTRA_kernel_version_DEPENDENCIES) + @rm -f kernel_version$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kernel_version_OBJECTS) $(kernel_version_LDADD) $(LIBS) + +kernel_version-Xabbrev$(EXEEXT): $(kernel_version_Xabbrev_OBJECTS) $(kernel_version_Xabbrev_DEPENDENCIES) $(EXTRA_kernel_version_Xabbrev_DEPENDENCIES) + @rm -f kernel_version-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kernel_version_Xabbrev_OBJECTS) $(kernel_version_Xabbrev_LDADD) $(LIBS) + +kernel_version-Xraw$(EXEEXT): $(kernel_version_Xraw_OBJECTS) $(kernel_version_Xraw_DEPENDENCIES) $(EXTRA_kernel_version_Xraw_DEPENDENCIES) + @rm -f kernel_version-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kernel_version_Xraw_OBJECTS) $(kernel_version_Xraw_LDADD) $(LIBS) + +kernel_version-Xverbose$(EXEEXT): $(kernel_version_Xverbose_OBJECTS) $(kernel_version_Xverbose_DEPENDENCIES) $(EXTRA_kernel_version_Xverbose_DEPENDENCIES) + @rm -f kernel_version-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kernel_version_Xverbose_OBJECTS) $(kernel_version_Xverbose_LDADD) $(LIBS) + kexec_file_load$(EXEEXT): $(kexec_file_load_OBJECTS) $(kexec_file_load_DEPENDENCIES) $(EXTRA_kexec_file_load_DEPENDENCIES) @rm -f kexec_file_load$(EXEEXT) $(AM_V_CCLD)$(LINK) $(kexec_file_load_OBJECTS) $(kexec_file_load_LDADD) $(LIBS) @@ -3504,10 +5993,26 @@ keyctl$(EXEEXT): $(keyctl_OBJECTS) $(keyctl_DEPENDENCIES) $(EXTRA_keyctl_DEPENDE @rm -f keyctl$(EXEEXT) $(AM_V_CCLD)$(LINK) $(keyctl_OBJECTS) $(keyctl_LDADD) $(LIBS) +keyctl-Xabbrev$(EXEEXT): $(keyctl_Xabbrev_OBJECTS) $(keyctl_Xabbrev_DEPENDENCIES) $(EXTRA_keyctl_Xabbrev_DEPENDENCIES) + @rm -f keyctl-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(keyctl_Xabbrev_OBJECTS) $(keyctl_Xabbrev_LDADD) $(LIBS) + +keyctl-Xraw$(EXEEXT): $(keyctl_Xraw_OBJECTS) $(keyctl_Xraw_DEPENDENCIES) $(EXTRA_keyctl_Xraw_DEPENDENCIES) + @rm -f keyctl-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(keyctl_Xraw_OBJECTS) $(keyctl_Xraw_LDADD) $(LIBS) + +keyctl-Xverbose$(EXEEXT): $(keyctl_Xverbose_OBJECTS) $(keyctl_Xverbose_DEPENDENCIES) $(EXTRA_keyctl_Xverbose_DEPENDENCIES) + @rm -f keyctl-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(keyctl_Xverbose_OBJECTS) $(keyctl_Xverbose_LDADD) $(LIBS) + kill$(EXEEXT): $(kill_OBJECTS) $(kill_DEPENDENCIES) $(EXTRA_kill_DEPENDENCIES) @rm -f kill$(EXEEXT) $(AM_V_CCLD)$(LINK) $(kill_OBJECTS) $(kill_LDADD) $(LIBS) +kill_child$(EXEEXT): $(kill_child_OBJECTS) $(kill_child_DEPENDENCIES) $(EXTRA_kill_child_DEPENDENCIES) + @rm -f kill_child$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kill_child_OBJECTS) $(kill_child_LDADD) $(LIBS) + ksysent$(EXEEXT): $(ksysent_OBJECTS) $(ksysent_DEPENDENCIES) $(EXTRA_ksysent_DEPENDENCIES) @rm -f ksysent$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ksysent_OBJECTS) $(ksysent_LDADD) $(LIBS) @@ -3528,14 +6033,26 @@ linkat$(EXEEXT): $(linkat_OBJECTS) $(linkat_DEPENDENCIES) $(EXTRA_linkat_DEPENDE @rm -f linkat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(linkat_OBJECTS) $(linkat_LDADD) $(LIBS) +list_sigaction_signum$(EXEEXT): $(list_sigaction_signum_OBJECTS) $(list_sigaction_signum_DEPENDENCIES) $(EXTRA_list_sigaction_signum_DEPENDENCIES) + @rm -f list_sigaction_signum$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(list_sigaction_signum_OBJECTS) $(list_sigaction_signum_LDADD) $(LIBS) + llseek$(EXEEXT): $(llseek_OBJECTS) $(llseek_DEPENDENCIES) $(EXTRA_llseek_DEPENDENCIES) @rm -f llseek$(EXEEXT) $(AM_V_CCLD)$(LINK) $(llseek_OBJECTS) $(llseek_LDADD) $(LIBS) +localtime$(EXEEXT): $(localtime_OBJECTS) $(localtime_DEPENDENCIES) $(EXTRA_localtime_DEPENDENCIES) + @rm -f localtime$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(localtime_OBJECTS) $(localtime_LDADD) $(LIBS) + lookup_dcookie$(EXEEXT): $(lookup_dcookie_OBJECTS) $(lookup_dcookie_DEPENDENCIES) $(EXTRA_lookup_dcookie_DEPENDENCIES) @rm -f lookup_dcookie$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lookup_dcookie_OBJECTS) $(lookup_dcookie_LDADD) $(LIBS) +looping_threads$(EXEEXT): $(looping_threads_OBJECTS) $(looping_threads_DEPENDENCIES) $(EXTRA_looping_threads_DEPENDENCIES) + @rm -f looping_threads$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(looping_threads_OBJECTS) $(looping_threads_LDADD) $(LIBS) + lseek$(EXEEXT): $(lseek_OBJECTS) $(lseek_DEPENDENCIES) $(EXTRA_lseek_DEPENDENCIES) @rm -f lseek$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lseek_OBJECTS) $(lseek_LDADD) $(LIBS) @@ -3548,6 +6065,10 @@ lstat64$(EXEEXT): $(lstat64_OBJECTS) $(lstat64_DEPENDENCIES) $(EXTRA_lstat64_DEP @rm -f lstat64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lstat64_OBJECTS) $(lstat64_LDADD) $(LIBS) +madvise$(EXEEXT): $(madvise_OBJECTS) $(madvise_DEPENDENCIES) $(EXTRA_madvise_DEPENDENCIES) + @rm -f madvise$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(madvise_OBJECTS) $(madvise_LDADD) $(LIBS) + mbind$(EXEEXT): $(mbind_OBJECTS) $(mbind_DEPENDENCIES) $(EXTRA_mbind_DEPENDENCIES) @rm -f mbind$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mbind_OBJECTS) $(mbind_LDADD) $(LIBS) @@ -3560,6 +6081,18 @@ memfd_create$(EXEEXT): $(memfd_create_OBJECTS) $(memfd_create_DEPENDENCIES) $(EX @rm -f memfd_create$(EXEEXT) $(AM_V_CCLD)$(LINK) $(memfd_create_OBJECTS) $(memfd_create_LDADD) $(LIBS) +memfd_create-Xabbrev$(EXEEXT): $(memfd_create_Xabbrev_OBJECTS) $(memfd_create_Xabbrev_DEPENDENCIES) $(EXTRA_memfd_create_Xabbrev_DEPENDENCIES) + @rm -f memfd_create-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(memfd_create_Xabbrev_OBJECTS) $(memfd_create_Xabbrev_LDADD) $(LIBS) + +memfd_create-Xraw$(EXEEXT): $(memfd_create_Xraw_OBJECTS) $(memfd_create_Xraw_DEPENDENCIES) $(EXTRA_memfd_create_Xraw_DEPENDENCIES) + @rm -f memfd_create-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(memfd_create_Xraw_OBJECTS) $(memfd_create_Xraw_LDADD) $(LIBS) + +memfd_create-Xverbose$(EXEEXT): $(memfd_create_Xverbose_OBJECTS) $(memfd_create_Xverbose_DEPENDENCIES) $(EXTRA_memfd_create_Xverbose_DEPENDENCIES) + @rm -f memfd_create-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(memfd_create_Xverbose_OBJECTS) $(memfd_create_Xverbose_LDADD) $(LIBS) + migrate_pages$(EXEEXT): $(migrate_pages_OBJECTS) $(migrate_pages_DEPENDENCIES) $(EXTRA_migrate_pages_DEPENDENCIES) @rm -f migrate_pages$(EXEEXT) $(AM_V_CCLD)$(LINK) $(migrate_pages_OBJECTS) $(migrate_pages_LDADD) $(LIBS) @@ -3600,10 +6133,34 @@ mmap$(EXEEXT): $(mmap_OBJECTS) $(mmap_DEPENDENCIES) $(EXTRA_mmap_DEPENDENCIES) @rm -f mmap$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mmap_OBJECTS) $(mmap_LDADD) $(LIBS) +mmap-Xabbrev$(EXEEXT): $(mmap_Xabbrev_OBJECTS) $(mmap_Xabbrev_DEPENDENCIES) $(EXTRA_mmap_Xabbrev_DEPENDENCIES) + @rm -f mmap-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap_Xabbrev_OBJECTS) $(mmap_Xabbrev_LDADD) $(LIBS) + +mmap-Xraw$(EXEEXT): $(mmap_Xraw_OBJECTS) $(mmap_Xraw_DEPENDENCIES) $(EXTRA_mmap_Xraw_DEPENDENCIES) + @rm -f mmap-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap_Xraw_OBJECTS) $(mmap_Xraw_LDADD) $(LIBS) + +mmap-Xverbose$(EXEEXT): $(mmap_Xverbose_OBJECTS) $(mmap_Xverbose_DEPENDENCIES) $(EXTRA_mmap_Xverbose_DEPENDENCIES) + @rm -f mmap-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap_Xverbose_OBJECTS) $(mmap_Xverbose_LDADD) $(LIBS) + mmap64$(EXEEXT): $(mmap64_OBJECTS) $(mmap64_DEPENDENCIES) $(EXTRA_mmap64_DEPENDENCIES) @rm -f mmap64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mmap64_OBJECTS) $(mmap64_LDADD) $(LIBS) +mmap64-Xabbrev$(EXEEXT): $(mmap64_Xabbrev_OBJECTS) $(mmap64_Xabbrev_DEPENDENCIES) $(EXTRA_mmap64_Xabbrev_DEPENDENCIES) + @rm -f mmap64-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap64_Xabbrev_OBJECTS) $(mmap64_Xabbrev_LDADD) $(LIBS) + +mmap64-Xraw$(EXEEXT): $(mmap64_Xraw_OBJECTS) $(mmap64_Xraw_DEPENDENCIES) $(EXTRA_mmap64_Xraw_DEPENDENCIES) + @rm -f mmap64-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap64_Xraw_OBJECTS) $(mmap64_Xraw_LDADD) $(LIBS) + +mmap64-Xverbose$(EXEEXT): $(mmap64_Xverbose_OBJECTS) $(mmap64_Xverbose_DEPENDENCIES) $(EXTRA_mmap64_Xverbose_DEPENDENCIES) + @rm -f mmap64-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap64_Xverbose_OBJECTS) $(mmap64_Xverbose_LDADD) $(LIBS) + mmsg$(EXEEXT): $(mmsg_OBJECTS) $(mmsg_DEPENDENCIES) $(EXTRA_mmsg_DEPENDENCIES) @rm -f mmsg$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mmsg_OBJECTS) $(mmsg_LDADD) $(LIBS) @@ -3620,14 +6177,42 @@ mmsg_name-v$(EXEEXT): $(mmsg_name_v_OBJECTS) $(mmsg_name_v_DEPENDENCIES) $(EXTRA @rm -f mmsg_name-v$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mmsg_name_v_OBJECTS) $(mmsg_name_v_LDADD) $(LIBS) +modify_ldt$(EXEEXT): $(modify_ldt_OBJECTS) $(modify_ldt_DEPENDENCIES) $(EXTRA_modify_ldt_DEPENDENCIES) + @rm -f modify_ldt$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(modify_ldt_OBJECTS) $(modify_ldt_LDADD) $(LIBS) + mount$(EXEEXT): $(mount_OBJECTS) $(mount_DEPENDENCIES) $(EXTRA_mount_DEPENDENCIES) @rm -f mount$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mount_OBJECTS) $(mount_LDADD) $(LIBS) +mount-Xabbrev$(EXEEXT): $(mount_Xabbrev_OBJECTS) $(mount_Xabbrev_DEPENDENCIES) $(EXTRA_mount_Xabbrev_DEPENDENCIES) + @rm -f mount-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mount_Xabbrev_OBJECTS) $(mount_Xabbrev_LDADD) $(LIBS) + +mount-Xraw$(EXEEXT): $(mount_Xraw_OBJECTS) $(mount_Xraw_DEPENDENCIES) $(EXTRA_mount_Xraw_DEPENDENCIES) + @rm -f mount-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mount_Xraw_OBJECTS) $(mount_Xraw_LDADD) $(LIBS) + +mount-Xverbose$(EXEEXT): $(mount_Xverbose_OBJECTS) $(mount_Xverbose_DEPENDENCIES) $(EXTRA_mount_Xverbose_DEPENDENCIES) + @rm -f mount-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mount_Xverbose_OBJECTS) $(mount_Xverbose_LDADD) $(LIBS) + move_pages$(EXEEXT): $(move_pages_OBJECTS) $(move_pages_DEPENDENCIES) $(EXTRA_move_pages_DEPENDENCIES) @rm -f move_pages$(EXEEXT) $(AM_V_CCLD)$(LINK) $(move_pages_OBJECTS) $(move_pages_LDADD) $(LIBS) +move_pages-Xabbrev$(EXEEXT): $(move_pages_Xabbrev_OBJECTS) $(move_pages_Xabbrev_DEPENDENCIES) $(EXTRA_move_pages_Xabbrev_DEPENDENCIES) + @rm -f move_pages-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(move_pages_Xabbrev_OBJECTS) $(move_pages_Xabbrev_LDADD) $(LIBS) + +move_pages-Xraw$(EXEEXT): $(move_pages_Xraw_OBJECTS) $(move_pages_Xraw_DEPENDENCIES) $(EXTRA_move_pages_Xraw_DEPENDENCIES) + @rm -f move_pages-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(move_pages_Xraw_OBJECTS) $(move_pages_Xraw_LDADD) $(LIBS) + +move_pages-Xverbose$(EXEEXT): $(move_pages_Xverbose_OBJECTS) $(move_pages_Xverbose_DEPENDENCIES) $(EXTRA_move_pages_Xverbose_DEPENDENCIES) + @rm -f move_pages-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(move_pages_Xverbose_OBJECTS) $(move_pages_Xverbose_LDADD) $(LIBS) + mq$(EXEEXT): $(mq_OBJECTS) $(mq_DEPENDENCIES) $(EXTRA_mq_DEPENDENCIES) @rm -f mq$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mq_OBJECTS) $(mq_LDADD) $(LIBS) @@ -3672,10 +6257,38 @@ net-icmp_filter$(EXEEXT): $(net_icmp_filter_OBJECTS) $(net_icmp_filter_DEPENDENC @rm -f net-icmp_filter$(EXEEXT) $(AM_V_CCLD)$(LINK) $(net_icmp_filter_OBJECTS) $(net_icmp_filter_LDADD) $(LIBS) +net-packet_mreq$(EXEEXT): $(net_packet_mreq_OBJECTS) $(net_packet_mreq_DEPENDENCIES) $(EXTRA_net_packet_mreq_DEPENDENCIES) + @rm -f net-packet_mreq$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_packet_mreq_OBJECTS) $(net_packet_mreq_LDADD) $(LIBS) + +net-packet_mreq-Xabbrev$(EXEEXT): $(net_packet_mreq_Xabbrev_OBJECTS) $(net_packet_mreq_Xabbrev_DEPENDENCIES) $(EXTRA_net_packet_mreq_Xabbrev_DEPENDENCIES) + @rm -f net-packet_mreq-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_packet_mreq_Xabbrev_OBJECTS) $(net_packet_mreq_Xabbrev_LDADD) $(LIBS) + +net-packet_mreq-Xraw$(EXEEXT): $(net_packet_mreq_Xraw_OBJECTS) $(net_packet_mreq_Xraw_DEPENDENCIES) $(EXTRA_net_packet_mreq_Xraw_DEPENDENCIES) + @rm -f net-packet_mreq-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_packet_mreq_Xraw_OBJECTS) $(net_packet_mreq_Xraw_LDADD) $(LIBS) + +net-packet_mreq-Xverbose$(EXEEXT): $(net_packet_mreq_Xverbose_OBJECTS) $(net_packet_mreq_Xverbose_DEPENDENCIES) $(EXTRA_net_packet_mreq_Xverbose_DEPENDENCIES) + @rm -f net-packet_mreq-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_packet_mreq_Xverbose_OBJECTS) $(net_packet_mreq_Xverbose_LDADD) $(LIBS) + net-sockaddr$(EXEEXT): $(net_sockaddr_OBJECTS) $(net_sockaddr_DEPENDENCIES) $(EXTRA_net_sockaddr_DEPENDENCIES) @rm -f net-sockaddr$(EXEEXT) $(AM_V_CCLD)$(LINK) $(net_sockaddr_OBJECTS) $(net_sockaddr_LDADD) $(LIBS) +net-tpacket_req$(EXEEXT): $(net_tpacket_req_OBJECTS) $(net_tpacket_req_DEPENDENCIES) $(EXTRA_net_tpacket_req_DEPENDENCIES) + @rm -f net-tpacket_req$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_tpacket_req_OBJECTS) $(net_tpacket_req_LDADD) $(LIBS) + +net-tpacket_stats$(EXEEXT): $(net_tpacket_stats_OBJECTS) $(net_tpacket_stats_DEPENDENCIES) $(EXTRA_net_tpacket_stats_DEPENDENCIES) + @rm -f net-tpacket_stats$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_tpacket_stats_OBJECTS) $(net_tpacket_stats_LDADD) $(LIBS) + +net-tpacket_stats-success$(EXEEXT): $(net_tpacket_stats_success_OBJECTS) $(net_tpacket_stats_success_DEPENDENCIES) $(EXTRA_net_tpacket_stats_success_DEPENDENCIES) + @rm -f net-tpacket_stats-success$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_tpacket_stats_success_OBJECTS) $(net_tpacket_stats_success_LDADD) $(LIBS) + net-y-unix$(EXEEXT): $(net_y_unix_OBJECTS) $(net_y_unix_DEPENDENCIES) $(EXTRA_net_y_unix_DEPENDENCIES) @rm -f net-y-unix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(net_y_unix_OBJECTS) $(net_y_unix_LDADD) $(LIBS) @@ -3684,6 +6297,10 @@ net-yy-inet$(EXEEXT): $(net_yy_inet_OBJECTS) $(net_yy_inet_DEPENDENCIES) $(EXTRA @rm -f net-yy-inet$(EXEEXT) $(AM_V_CCLD)$(LINK) $(net_yy_inet_OBJECTS) $(net_yy_inet_LDADD) $(LIBS) +net-yy-inet6$(EXEEXT): $(net_yy_inet6_OBJECTS) $(net_yy_inet6_DEPENDENCIES) $(EXTRA_net_yy_inet6_DEPENDENCIES) + @rm -f net-yy-inet6$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_yy_inet6_OBJECTS) $(net_yy_inet6_LDADD) $(LIBS) + net-yy-netlink$(EXEEXT): $(net_yy_netlink_OBJECTS) $(net_yy_netlink_DEPENDENCIES) $(EXTRA_net_yy_netlink_DEPENDENCIES) @rm -f net-yy-netlink$(EXEEXT) $(AM_V_CCLD)$(LINK) $(net_yy_netlink_OBJECTS) $(net_yy_netlink_LDADD) $(LIBS) @@ -3692,10 +6309,30 @@ net-yy-unix$(EXEEXT): $(net_yy_unix_OBJECTS) $(net_yy_unix_DEPENDENCIES) $(EXTRA @rm -f net-yy-unix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(net_yy_unix_OBJECTS) $(net_yy_unix_LDADD) $(LIBS) +netlink_audit$(EXEEXT): $(netlink_audit_OBJECTS) $(netlink_audit_DEPENDENCIES) $(EXTRA_netlink_audit_DEPENDENCIES) + @rm -f netlink_audit$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_audit_OBJECTS) $(netlink_audit_LDADD) $(LIBS) + +netlink_crypto$(EXEEXT): $(netlink_crypto_OBJECTS) $(netlink_crypto_DEPENDENCIES) $(EXTRA_netlink_crypto_DEPENDENCIES) + @rm -f netlink_crypto$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_crypto_OBJECTS) $(netlink_crypto_LDADD) $(LIBS) + +netlink_generic$(EXEEXT): $(netlink_generic_OBJECTS) $(netlink_generic_DEPENDENCIES) $(EXTRA_netlink_generic_DEPENDENCIES) + @rm -f netlink_generic$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_generic_OBJECTS) $(netlink_generic_LDADD) $(LIBS) + netlink_inet_diag$(EXEEXT): $(netlink_inet_diag_OBJECTS) $(netlink_inet_diag_DEPENDENCIES) $(EXTRA_netlink_inet_diag_DEPENDENCIES) @rm -f netlink_inet_diag$(EXEEXT) $(AM_V_CCLD)$(LINK) $(netlink_inet_diag_OBJECTS) $(netlink_inet_diag_LDADD) $(LIBS) +netlink_kobject_uevent$(EXEEXT): $(netlink_kobject_uevent_OBJECTS) $(netlink_kobject_uevent_DEPENDENCIES) $(EXTRA_netlink_kobject_uevent_DEPENDENCIES) + @rm -f netlink_kobject_uevent$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_kobject_uevent_OBJECTS) $(netlink_kobject_uevent_LDADD) $(LIBS) + +netlink_netfilter$(EXEEXT): $(netlink_netfilter_OBJECTS) $(netlink_netfilter_DEPENDENCIES) $(EXTRA_netlink_netfilter_DEPENDENCIES) + @rm -f netlink_netfilter$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_netfilter_OBJECTS) $(netlink_netfilter_LDADD) $(LIBS) + netlink_netlink_diag$(EXEEXT): $(netlink_netlink_diag_OBJECTS) $(netlink_netlink_diag_DEPENDENCIES) $(EXTRA_netlink_netlink_diag_DEPENDENCIES) @rm -f netlink_netlink_diag$(EXEEXT) $(AM_V_CCLD)$(LINK) $(netlink_netlink_diag_OBJECTS) $(netlink_netlink_diag_LDADD) $(LIBS) @@ -3704,22 +6341,234 @@ netlink_protocol$(EXEEXT): $(netlink_protocol_OBJECTS) $(netlink_protocol_DEPEND @rm -f netlink_protocol$(EXEEXT) $(AM_V_CCLD)$(LINK) $(netlink_protocol_OBJECTS) $(netlink_protocol_LDADD) $(LIBS) +netlink_route$(EXEEXT): $(netlink_route_OBJECTS) $(netlink_route_DEPENDENCIES) $(EXTRA_netlink_route_DEPENDENCIES) + @rm -f netlink_route$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_route_OBJECTS) $(netlink_route_LDADD) $(LIBS) + +netlink_selinux$(EXEEXT): $(netlink_selinux_OBJECTS) $(netlink_selinux_DEPENDENCIES) $(EXTRA_netlink_selinux_DEPENDENCIES) + @rm -f netlink_selinux$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_selinux_OBJECTS) $(netlink_selinux_LDADD) $(LIBS) + +netlink_sock_diag$(EXEEXT): $(netlink_sock_diag_OBJECTS) $(netlink_sock_diag_DEPENDENCIES) $(EXTRA_netlink_sock_diag_DEPENDENCIES) + @rm -f netlink_sock_diag$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_sock_diag_OBJECTS) $(netlink_sock_diag_LDADD) $(LIBS) + netlink_unix_diag$(EXEEXT): $(netlink_unix_diag_OBJECTS) $(netlink_unix_diag_DEPENDENCIES) $(EXTRA_netlink_unix_diag_DEPENDENCIES) @rm -f netlink_unix_diag$(EXEEXT) $(AM_V_CCLD)$(LINK) $(netlink_unix_diag_OBJECTS) $(netlink_unix_diag_LDADD) $(LIBS) +netlink_xfrm$(EXEEXT): $(netlink_xfrm_OBJECTS) $(netlink_xfrm_DEPENDENCIES) $(EXTRA_netlink_xfrm_DEPENDENCIES) + @rm -f netlink_xfrm$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_xfrm_OBJECTS) $(netlink_xfrm_LDADD) $(LIBS) + newfstatat$(EXEEXT): $(newfstatat_OBJECTS) $(newfstatat_DEPENDENCIES) $(EXTRA_newfstatat_DEPENDENCIES) @rm -f newfstatat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(newfstatat_OBJECTS) $(newfstatat_LDADD) $(LIBS) +nfnetlink_acct$(EXEEXT): $(nfnetlink_acct_OBJECTS) $(nfnetlink_acct_DEPENDENCIES) $(EXTRA_nfnetlink_acct_DEPENDENCIES) + @rm -f nfnetlink_acct$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_acct_OBJECTS) $(nfnetlink_acct_LDADD) $(LIBS) + +nfnetlink_cthelper$(EXEEXT): $(nfnetlink_cthelper_OBJECTS) $(nfnetlink_cthelper_DEPENDENCIES) $(EXTRA_nfnetlink_cthelper_DEPENDENCIES) + @rm -f nfnetlink_cthelper$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_cthelper_OBJECTS) $(nfnetlink_cthelper_LDADD) $(LIBS) + +nfnetlink_ctnetlink$(EXEEXT): $(nfnetlink_ctnetlink_OBJECTS) $(nfnetlink_ctnetlink_DEPENDENCIES) $(EXTRA_nfnetlink_ctnetlink_DEPENDENCIES) + @rm -f nfnetlink_ctnetlink$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_ctnetlink_OBJECTS) $(nfnetlink_ctnetlink_LDADD) $(LIBS) + +nfnetlink_ctnetlink_exp$(EXEEXT): $(nfnetlink_ctnetlink_exp_OBJECTS) $(nfnetlink_ctnetlink_exp_DEPENDENCIES) $(EXTRA_nfnetlink_ctnetlink_exp_DEPENDENCIES) + @rm -f nfnetlink_ctnetlink_exp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_ctnetlink_exp_OBJECTS) $(nfnetlink_ctnetlink_exp_LDADD) $(LIBS) + +nfnetlink_cttimeout$(EXEEXT): $(nfnetlink_cttimeout_OBJECTS) $(nfnetlink_cttimeout_DEPENDENCIES) $(EXTRA_nfnetlink_cttimeout_DEPENDENCIES) + @rm -f nfnetlink_cttimeout$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_cttimeout_OBJECTS) $(nfnetlink_cttimeout_LDADD) $(LIBS) + +nfnetlink_ipset$(EXEEXT): $(nfnetlink_ipset_OBJECTS) $(nfnetlink_ipset_DEPENDENCIES) $(EXTRA_nfnetlink_ipset_DEPENDENCIES) + @rm -f nfnetlink_ipset$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_ipset_OBJECTS) $(nfnetlink_ipset_LDADD) $(LIBS) + +nfnetlink_nft_compat$(EXEEXT): $(nfnetlink_nft_compat_OBJECTS) $(nfnetlink_nft_compat_DEPENDENCIES) $(EXTRA_nfnetlink_nft_compat_DEPENDENCIES) + @rm -f nfnetlink_nft_compat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_nft_compat_OBJECTS) $(nfnetlink_nft_compat_LDADD) $(LIBS) + +nfnetlink_nftables$(EXEEXT): $(nfnetlink_nftables_OBJECTS) $(nfnetlink_nftables_DEPENDENCIES) $(EXTRA_nfnetlink_nftables_DEPENDENCIES) + @rm -f nfnetlink_nftables$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_nftables_OBJECTS) $(nfnetlink_nftables_LDADD) $(LIBS) + +nfnetlink_osf$(EXEEXT): $(nfnetlink_osf_OBJECTS) $(nfnetlink_osf_DEPENDENCIES) $(EXTRA_nfnetlink_osf_DEPENDENCIES) + @rm -f nfnetlink_osf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_osf_OBJECTS) $(nfnetlink_osf_LDADD) $(LIBS) + +nfnetlink_queue$(EXEEXT): $(nfnetlink_queue_OBJECTS) $(nfnetlink_queue_DEPENDENCIES) $(EXTRA_nfnetlink_queue_DEPENDENCIES) + @rm -f nfnetlink_queue$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_queue_OBJECTS) $(nfnetlink_queue_LDADD) $(LIBS) + +nfnetlink_ulog$(EXEEXT): $(nfnetlink_ulog_OBJECTS) $(nfnetlink_ulog_DEPENDENCIES) $(EXTRA_nfnetlink_ulog_DEPENDENCIES) + @rm -f nfnetlink_ulog$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_ulog_OBJECTS) $(nfnetlink_ulog_LDADD) $(LIBS) + +nlattr$(EXEEXT): $(nlattr_OBJECTS) $(nlattr_DEPENDENCIES) $(EXTRA_nlattr_DEPENDENCIES) + @rm -f nlattr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_OBJECTS) $(nlattr_LDADD) $(LIBS) + +nlattr_br_port_msg$(EXEEXT): $(nlattr_br_port_msg_OBJECTS) $(nlattr_br_port_msg_DEPENDENCIES) $(EXTRA_nlattr_br_port_msg_DEPENDENCIES) + @rm -f nlattr_br_port_msg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_br_port_msg_OBJECTS) $(nlattr_br_port_msg_LDADD) $(LIBS) + +nlattr_crypto_user_alg$(EXEEXT): $(nlattr_crypto_user_alg_OBJECTS) $(nlattr_crypto_user_alg_DEPENDENCIES) $(EXTRA_nlattr_crypto_user_alg_DEPENDENCIES) + @rm -f nlattr_crypto_user_alg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_crypto_user_alg_OBJECTS) $(nlattr_crypto_user_alg_LDADD) $(LIBS) + +nlattr_dcbmsg$(EXEEXT): $(nlattr_dcbmsg_OBJECTS) $(nlattr_dcbmsg_DEPENDENCIES) $(EXTRA_nlattr_dcbmsg_DEPENDENCIES) + @rm -f nlattr_dcbmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_dcbmsg_OBJECTS) $(nlattr_dcbmsg_LDADD) $(LIBS) + +nlattr_fib_rule_hdr$(EXEEXT): $(nlattr_fib_rule_hdr_OBJECTS) $(nlattr_fib_rule_hdr_DEPENDENCIES) $(EXTRA_nlattr_fib_rule_hdr_DEPENDENCIES) + @rm -f nlattr_fib_rule_hdr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_fib_rule_hdr_OBJECTS) $(nlattr_fib_rule_hdr_LDADD) $(LIBS) + +nlattr_ifaddrlblmsg$(EXEEXT): $(nlattr_ifaddrlblmsg_OBJECTS) $(nlattr_ifaddrlblmsg_DEPENDENCIES) $(EXTRA_nlattr_ifaddrlblmsg_DEPENDENCIES) + @rm -f nlattr_ifaddrlblmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifaddrlblmsg_OBJECTS) $(nlattr_ifaddrlblmsg_LDADD) $(LIBS) + +nlattr_ifaddrmsg$(EXEEXT): $(nlattr_ifaddrmsg_OBJECTS) $(nlattr_ifaddrmsg_DEPENDENCIES) $(EXTRA_nlattr_ifaddrmsg_DEPENDENCIES) + @rm -f nlattr_ifaddrmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifaddrmsg_OBJECTS) $(nlattr_ifaddrmsg_LDADD) $(LIBS) + +nlattr_ifinfomsg$(EXEEXT): $(nlattr_ifinfomsg_OBJECTS) $(nlattr_ifinfomsg_DEPENDENCIES) $(EXTRA_nlattr_ifinfomsg_DEPENDENCIES) + @rm -f nlattr_ifinfomsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifinfomsg_OBJECTS) $(nlattr_ifinfomsg_LDADD) $(LIBS) + +nlattr_ifla_af_spec$(EXEEXT): $(nlattr_ifla_af_spec_OBJECTS) $(nlattr_ifla_af_spec_DEPENDENCIES) $(EXTRA_nlattr_ifla_af_spec_DEPENDENCIES) + @rm -f nlattr_ifla_af_spec$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifla_af_spec_OBJECTS) $(nlattr_ifla_af_spec_LDADD) $(LIBS) + +nlattr_ifla_brport$(EXEEXT): $(nlattr_ifla_brport_OBJECTS) $(nlattr_ifla_brport_DEPENDENCIES) $(EXTRA_nlattr_ifla_brport_DEPENDENCIES) + @rm -f nlattr_ifla_brport$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifla_brport_OBJECTS) $(nlattr_ifla_brport_LDADD) $(LIBS) + +nlattr_ifla_linkinfo$(EXEEXT): $(nlattr_ifla_linkinfo_OBJECTS) $(nlattr_ifla_linkinfo_DEPENDENCIES) $(EXTRA_nlattr_ifla_linkinfo_DEPENDENCIES) + @rm -f nlattr_ifla_linkinfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifla_linkinfo_OBJECTS) $(nlattr_ifla_linkinfo_LDADD) $(LIBS) + +nlattr_ifla_port$(EXEEXT): $(nlattr_ifla_port_OBJECTS) $(nlattr_ifla_port_DEPENDENCIES) $(EXTRA_nlattr_ifla_port_DEPENDENCIES) + @rm -f nlattr_ifla_port$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifla_port_OBJECTS) $(nlattr_ifla_port_LDADD) $(LIBS) + +nlattr_ifla_xdp$(EXEEXT): $(nlattr_ifla_xdp_OBJECTS) $(nlattr_ifla_xdp_DEPENDENCIES) $(EXTRA_nlattr_ifla_xdp_DEPENDENCIES) + @rm -f nlattr_ifla_xdp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifla_xdp_OBJECTS) $(nlattr_ifla_xdp_LDADD) $(LIBS) + +nlattr_inet_diag_msg$(EXEEXT): $(nlattr_inet_diag_msg_OBJECTS) $(nlattr_inet_diag_msg_DEPENDENCIES) $(EXTRA_nlattr_inet_diag_msg_DEPENDENCIES) + @rm -f nlattr_inet_diag_msg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_inet_diag_msg_OBJECTS) $(nlattr_inet_diag_msg_LDADD) $(LIBS) + +nlattr_inet_diag_req_compat$(EXEEXT): $(nlattr_inet_diag_req_compat_OBJECTS) $(nlattr_inet_diag_req_compat_DEPENDENCIES) $(EXTRA_nlattr_inet_diag_req_compat_DEPENDENCIES) + @rm -f nlattr_inet_diag_req_compat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_inet_diag_req_compat_OBJECTS) $(nlattr_inet_diag_req_compat_LDADD) $(LIBS) + +nlattr_inet_diag_req_v2$(EXEEXT): $(nlattr_inet_diag_req_v2_OBJECTS) $(nlattr_inet_diag_req_v2_DEPENDENCIES) $(EXTRA_nlattr_inet_diag_req_v2_DEPENDENCIES) + @rm -f nlattr_inet_diag_req_v2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_inet_diag_req_v2_OBJECTS) $(nlattr_inet_diag_req_v2_LDADD) $(LIBS) + +nlattr_mdba_mdb_entry$(EXEEXT): $(nlattr_mdba_mdb_entry_OBJECTS) $(nlattr_mdba_mdb_entry_DEPENDENCIES) $(EXTRA_nlattr_mdba_mdb_entry_DEPENDENCIES) + @rm -f nlattr_mdba_mdb_entry$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_mdba_mdb_entry_OBJECTS) $(nlattr_mdba_mdb_entry_LDADD) $(LIBS) + +nlattr_mdba_router_port$(EXEEXT): $(nlattr_mdba_router_port_OBJECTS) $(nlattr_mdba_router_port_DEPENDENCIES) $(EXTRA_nlattr_mdba_router_port_DEPENDENCIES) + @rm -f nlattr_mdba_router_port$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_mdba_router_port_OBJECTS) $(nlattr_mdba_router_port_LDADD) $(LIBS) + +nlattr_ndmsg$(EXEEXT): $(nlattr_ndmsg_OBJECTS) $(nlattr_ndmsg_DEPENDENCIES) $(EXTRA_nlattr_ndmsg_DEPENDENCIES) + @rm -f nlattr_ndmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ndmsg_OBJECTS) $(nlattr_ndmsg_LDADD) $(LIBS) + +nlattr_ndtmsg$(EXEEXT): $(nlattr_ndtmsg_OBJECTS) $(nlattr_ndtmsg_DEPENDENCIES) $(EXTRA_nlattr_ndtmsg_DEPENDENCIES) + @rm -f nlattr_ndtmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ndtmsg_OBJECTS) $(nlattr_ndtmsg_LDADD) $(LIBS) + +nlattr_netconfmsg$(EXEEXT): $(nlattr_netconfmsg_OBJECTS) $(nlattr_netconfmsg_DEPENDENCIES) $(EXTRA_nlattr_netconfmsg_DEPENDENCIES) + @rm -f nlattr_netconfmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_netconfmsg_OBJECTS) $(nlattr_netconfmsg_LDADD) $(LIBS) + +nlattr_netlink_diag_msg$(EXEEXT): $(nlattr_netlink_diag_msg_OBJECTS) $(nlattr_netlink_diag_msg_DEPENDENCIES) $(EXTRA_nlattr_netlink_diag_msg_DEPENDENCIES) + @rm -f nlattr_netlink_diag_msg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_netlink_diag_msg_OBJECTS) $(nlattr_netlink_diag_msg_LDADD) $(LIBS) + +nlattr_nlmsgerr$(EXEEXT): $(nlattr_nlmsgerr_OBJECTS) $(nlattr_nlmsgerr_DEPENDENCIES) $(EXTRA_nlattr_nlmsgerr_DEPENDENCIES) + @rm -f nlattr_nlmsgerr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_nlmsgerr_OBJECTS) $(nlattr_nlmsgerr_LDADD) $(LIBS) + +nlattr_packet_diag_msg$(EXEEXT): $(nlattr_packet_diag_msg_OBJECTS) $(nlattr_packet_diag_msg_DEPENDENCIES) $(EXTRA_nlattr_packet_diag_msg_DEPENDENCIES) + @rm -f nlattr_packet_diag_msg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_packet_diag_msg_OBJECTS) $(nlattr_packet_diag_msg_LDADD) $(LIBS) + +nlattr_rtgenmsg$(EXEEXT): $(nlattr_rtgenmsg_OBJECTS) $(nlattr_rtgenmsg_DEPENDENCIES) $(EXTRA_nlattr_rtgenmsg_DEPENDENCIES) + @rm -f nlattr_rtgenmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_rtgenmsg_OBJECTS) $(nlattr_rtgenmsg_LDADD) $(LIBS) + +nlattr_rtmsg$(EXEEXT): $(nlattr_rtmsg_OBJECTS) $(nlattr_rtmsg_DEPENDENCIES) $(EXTRA_nlattr_rtmsg_DEPENDENCIES) + @rm -f nlattr_rtmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_rtmsg_OBJECTS) $(nlattr_rtmsg_LDADD) $(LIBS) + +nlattr_smc_diag_msg$(EXEEXT): $(nlattr_smc_diag_msg_OBJECTS) $(nlattr_smc_diag_msg_DEPENDENCIES) $(EXTRA_nlattr_smc_diag_msg_DEPENDENCIES) + @rm -f nlattr_smc_diag_msg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_smc_diag_msg_OBJECTS) $(nlattr_smc_diag_msg_LDADD) $(LIBS) + +nlattr_tc_stats$(EXEEXT): $(nlattr_tc_stats_OBJECTS) $(nlattr_tc_stats_DEPENDENCIES) $(EXTRA_nlattr_tc_stats_DEPENDENCIES) + @rm -f nlattr_tc_stats$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_tc_stats_OBJECTS) $(nlattr_tc_stats_LDADD) $(LIBS) + +nlattr_tca_stab$(EXEEXT): $(nlattr_tca_stab_OBJECTS) $(nlattr_tca_stab_DEPENDENCIES) $(EXTRA_nlattr_tca_stab_DEPENDENCIES) + @rm -f nlattr_tca_stab$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_tca_stab_OBJECTS) $(nlattr_tca_stab_LDADD) $(LIBS) + +nlattr_tcamsg$(EXEEXT): $(nlattr_tcamsg_OBJECTS) $(nlattr_tcamsg_DEPENDENCIES) $(EXTRA_nlattr_tcamsg_DEPENDENCIES) + @rm -f nlattr_tcamsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_tcamsg_OBJECTS) $(nlattr_tcamsg_LDADD) $(LIBS) + +nlattr_tcmsg$(EXEEXT): $(nlattr_tcmsg_OBJECTS) $(nlattr_tcmsg_DEPENDENCIES) $(EXTRA_nlattr_tcmsg_DEPENDENCIES) + @rm -f nlattr_tcmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_tcmsg_OBJECTS) $(nlattr_tcmsg_LDADD) $(LIBS) + +nlattr_unix_diag_msg$(EXEEXT): $(nlattr_unix_diag_msg_OBJECTS) $(nlattr_unix_diag_msg_DEPENDENCIES) $(EXTRA_nlattr_unix_diag_msg_DEPENDENCIES) + @rm -f nlattr_unix_diag_msg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_unix_diag_msg_OBJECTS) $(nlattr_unix_diag_msg_LDADD) $(LIBS) + nsyscalls$(EXEEXT): $(nsyscalls_OBJECTS) $(nsyscalls_DEPENDENCIES) $(EXTRA_nsyscalls_DEPENDENCIES) @rm -f nsyscalls$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nsyscalls_OBJECTS) $(nsyscalls_LDADD) $(LIBS) +nsyscalls-d$(EXEEXT): $(nsyscalls_d_OBJECTS) $(nsyscalls_d_DEPENDENCIES) $(EXTRA_nsyscalls_d_DEPENDENCIES) + @rm -f nsyscalls-d$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nsyscalls_d_OBJECTS) $(nsyscalls_d_LDADD) $(LIBS) + old_mmap$(EXEEXT): $(old_mmap_OBJECTS) $(old_mmap_DEPENDENCIES) $(EXTRA_old_mmap_DEPENDENCIES) @rm -f old_mmap$(EXEEXT) $(AM_V_CCLD)$(LINK) $(old_mmap_OBJECTS) $(old_mmap_LDADD) $(LIBS) +old_mmap-P$(EXEEXT): $(old_mmap_P_OBJECTS) $(old_mmap_P_DEPENDENCIES) $(EXTRA_old_mmap_P_DEPENDENCIES) + @rm -f old_mmap-P$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(old_mmap_P_OBJECTS) $(old_mmap_P_LDADD) $(LIBS) + +old_mmap-Xabbrev$(EXEEXT): $(old_mmap_Xabbrev_OBJECTS) $(old_mmap_Xabbrev_DEPENDENCIES) $(EXTRA_old_mmap_Xabbrev_DEPENDENCIES) + @rm -f old_mmap-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(old_mmap_Xabbrev_OBJECTS) $(old_mmap_Xabbrev_LDADD) $(LIBS) + +old_mmap-Xraw$(EXEEXT): $(old_mmap_Xraw_OBJECTS) $(old_mmap_Xraw_DEPENDENCIES) $(EXTRA_old_mmap_Xraw_DEPENDENCIES) + @rm -f old_mmap-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(old_mmap_Xraw_OBJECTS) $(old_mmap_Xraw_LDADD) $(LIBS) + +old_mmap-Xverbose$(EXEEXT): $(old_mmap_Xverbose_OBJECTS) $(old_mmap_Xverbose_DEPENDENCIES) $(EXTRA_old_mmap_Xverbose_DEPENDENCIES) + @rm -f old_mmap-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(old_mmap_Xverbose_OBJECTS) $(old_mmap_Xverbose_LDADD) $(LIBS) + +old_mmap-v-none$(EXEEXT): $(old_mmap_v_none_OBJECTS) $(old_mmap_v_none_DEPENDENCIES) $(EXTRA_old_mmap_v_none_DEPENDENCIES) + @rm -f old_mmap-v-none$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(old_mmap_v_none_OBJECTS) $(old_mmap_v_none_LDADD) $(LIBS) + oldfstat$(EXEEXT): $(oldfstat_OBJECTS) $(oldfstat_DEPENDENCIES) $(EXTRA_oldfstat_DEPENDENCIES) @rm -f oldfstat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(oldfstat_OBJECTS) $(oldfstat_LDADD) $(LIBS) @@ -3732,6 +6581,18 @@ oldselect$(EXEEXT): $(oldselect_OBJECTS) $(oldselect_DEPENDENCIES) $(EXTRA_oldse @rm -f oldselect$(EXEEXT) $(AM_V_CCLD)$(LINK) $(oldselect_OBJECTS) $(oldselect_LDADD) $(LIBS) +oldselect-P$(EXEEXT): $(oldselect_P_OBJECTS) $(oldselect_P_DEPENDENCIES) $(EXTRA_oldselect_P_DEPENDENCIES) + @rm -f oldselect-P$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(oldselect_P_OBJECTS) $(oldselect_P_LDADD) $(LIBS) + +oldselect-efault$(EXEEXT): $(oldselect_efault_OBJECTS) $(oldselect_efault_DEPENDENCIES) $(EXTRA_oldselect_efault_DEPENDENCIES) + @rm -f oldselect-efault$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(oldselect_efault_OBJECTS) $(oldselect_efault_LDADD) $(LIBS) + +oldselect-efault-P$(EXEEXT): $(oldselect_efault_P_OBJECTS) $(oldselect_efault_P_DEPENDENCIES) $(EXTRA_oldselect_efault_P_DEPENDENCIES) + @rm -f oldselect-efault-P$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(oldselect_efault_P_OBJECTS) $(oldselect_efault_P_LDADD) $(LIBS) + oldstat$(EXEEXT): $(oldstat_OBJECTS) $(oldstat_DEPENDENCIES) $(EXTRA_oldstat_DEPENDENCIES) @rm -f oldstat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(oldstat_OBJECTS) $(oldstat_LDADD) $(LIBS) @@ -3744,6 +6605,14 @@ openat$(EXEEXT): $(openat_OBJECTS) $(openat_DEPENDENCIES) $(EXTRA_openat_DEPENDE @rm -f openat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(openat_OBJECTS) $(openat_LDADD) $(LIBS) +orphaned_process_group$(EXEEXT): $(orphaned_process_group_OBJECTS) $(orphaned_process_group_DEPENDENCIES) $(EXTRA_orphaned_process_group_DEPENDENCIES) + @rm -f orphaned_process_group$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(orphaned_process_group_OBJECTS) $(orphaned_process_group_LDADD) $(LIBS) + +osf_utimes$(EXEEXT): $(osf_utimes_OBJECTS) $(osf_utimes_DEPENDENCIES) $(EXTRA_osf_utimes_DEPENDENCIES) + @rm -f osf_utimes$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(osf_utimes_OBJECTS) $(osf_utimes_LDADD) $(LIBS) + pause$(EXEEXT): $(pause_OBJECTS) $(pause_DEPENDENCIES) $(EXTRA_pause_DEPENDENCIES) @rm -f pause$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pause_OBJECTS) $(pause_LDADD) $(LIBS) @@ -3768,6 +6637,22 @@ personality$(EXEEXT): $(personality_OBJECTS) $(personality_DEPENDENCIES) $(EXTRA @rm -f personality$(EXEEXT) $(AM_V_CCLD)$(LINK) $(personality_OBJECTS) $(personality_LDADD) $(LIBS) +personality-Xabbrev$(EXEEXT): $(personality_Xabbrev_OBJECTS) $(personality_Xabbrev_DEPENDENCIES) $(EXTRA_personality_Xabbrev_DEPENDENCIES) + @rm -f personality-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(personality_Xabbrev_OBJECTS) $(personality_Xabbrev_LDADD) $(LIBS) + +personality-Xraw$(EXEEXT): $(personality_Xraw_OBJECTS) $(personality_Xraw_DEPENDENCIES) $(EXTRA_personality_Xraw_DEPENDENCIES) + @rm -f personality-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(personality_Xraw_OBJECTS) $(personality_Xraw_LDADD) $(LIBS) + +personality-Xverbose$(EXEEXT): $(personality_Xverbose_OBJECTS) $(personality_Xverbose_DEPENDENCIES) $(EXTRA_personality_Xverbose_DEPENDENCIES) + @rm -f personality-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(personality_Xverbose_OBJECTS) $(personality_Xverbose_LDADD) $(LIBS) + +pidfd_send_signal$(EXEEXT): $(pidfd_send_signal_OBJECTS) $(pidfd_send_signal_DEPENDENCIES) $(EXTRA_pidfd_send_signal_DEPENDENCIES) + @rm -f pidfd_send_signal$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pidfd_send_signal_OBJECTS) $(pidfd_send_signal_LDADD) $(LIBS) + pipe$(EXEEXT): $(pipe_OBJECTS) $(pipe_DEPENDENCIES) $(EXTRA_pipe_DEPENDENCIES) @rm -f pipe$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pipe_OBJECTS) $(pipe_LDADD) $(LIBS) @@ -3792,10 +6677,22 @@ poll$(EXEEXT): $(poll_OBJECTS) $(poll_DEPENDENCIES) $(EXTRA_poll_DEPENDENCIES) @rm -f poll$(EXEEXT) $(AM_V_CCLD)$(LINK) $(poll_OBJECTS) $(poll_LDADD) $(LIBS) +poll-P$(EXEEXT): $(poll_P_OBJECTS) $(poll_P_DEPENDENCIES) $(EXTRA_poll_P_DEPENDENCIES) + @rm -f poll-P$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(poll_P_OBJECTS) $(poll_P_LDADD) $(LIBS) + ppoll$(EXEEXT): $(ppoll_OBJECTS) $(ppoll_DEPENDENCIES) $(EXTRA_ppoll_DEPENDENCIES) @rm -f ppoll$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ppoll_OBJECTS) $(ppoll_LDADD) $(LIBS) +ppoll-P$(EXEEXT): $(ppoll_P_OBJECTS) $(ppoll_P_DEPENDENCIES) $(EXTRA_ppoll_P_DEPENDENCIES) + @rm -f ppoll-P$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ppoll_P_OBJECTS) $(ppoll_P_LDADD) $(LIBS) + +ppoll-v$(EXEEXT): $(ppoll_v_OBJECTS) $(ppoll_v_DEPENDENCIES) $(EXTRA_ppoll_v_DEPENDENCIES) + @rm -f ppoll-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ppoll_v_OBJECTS) $(ppoll_v_LDADD) $(LIBS) + prctl-arg2-intptr$(EXEEXT): $(prctl_arg2_intptr_OBJECTS) $(prctl_arg2_intptr_DEPENDENCIES) $(EXTRA_prctl_arg2_intptr_DEPENDENCIES) @rm -f prctl-arg2-intptr$(EXEEXT) $(AM_V_CCLD)$(LINK) $(prctl_arg2_intptr_OBJECTS) $(prctl_arg2_intptr_LDADD) $(LIBS) @@ -3828,6 +6725,10 @@ prctl-securebits$(EXEEXT): $(prctl_securebits_OBJECTS) $(prctl_securebits_DEPEND @rm -f prctl-securebits$(EXEEXT) $(AM_V_CCLD)$(LINK) $(prctl_securebits_OBJECTS) $(prctl_securebits_LDADD) $(LIBS) +prctl-spec-inject$(EXEEXT): $(prctl_spec_inject_OBJECTS) $(prctl_spec_inject_DEPENDENCIES) $(EXTRA_prctl_spec_inject_DEPENDENCIES) + @rm -f prctl-spec-inject$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_spec_inject_OBJECTS) $(prctl_spec_inject_LDADD) $(LIBS) + prctl-tid_address$(EXEEXT): $(prctl_tid_address_OBJECTS) $(prctl_tid_address_DEPENDENCIES) $(EXTRA_prctl_tid_address_DEPENDENCIES) @rm -f prctl-tid_address$(EXEEXT) $(AM_V_CCLD)$(LINK) $(prctl_tid_address_OBJECTS) $(prctl_tid_address_LDADD) $(LIBS) @@ -3856,10 +6757,46 @@ print_maxfd$(EXEEXT): $(print_maxfd_OBJECTS) $(print_maxfd_DEPENDENCIES) $(EXTRA @rm -f print_maxfd$(EXEEXT) $(AM_V_CCLD)$(LINK) $(print_maxfd_OBJECTS) $(print_maxfd_LDADD) $(LIBS) +printpath-umovestr$(EXEEXT): $(printpath_umovestr_OBJECTS) $(printpath_umovestr_DEPENDENCIES) $(EXTRA_printpath_umovestr_DEPENDENCIES) + @rm -f printpath-umovestr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printpath_umovestr_OBJECTS) $(printpath_umovestr_LDADD) $(LIBS) + +printpath-umovestr-peekdata$(EXEEXT): $(printpath_umovestr_peekdata_OBJECTS) $(printpath_umovestr_peekdata_DEPENDENCIES) $(EXTRA_printpath_umovestr_peekdata_DEPENDENCIES) + @rm -f printpath-umovestr-peekdata$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printpath_umovestr_peekdata_OBJECTS) $(printpath_umovestr_peekdata_LDADD) $(LIBS) + +printpath-umovestr-undumpable$(EXEEXT): $(printpath_umovestr_undumpable_OBJECTS) $(printpath_umovestr_undumpable_DEPENDENCIES) $(EXTRA_printpath_umovestr_undumpable_DEPENDENCIES) + @rm -f printpath-umovestr-undumpable$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printpath_umovestr_undumpable_OBJECTS) $(printpath_umovestr_undumpable_LDADD) $(LIBS) + +printsignal-Xabbrev$(EXEEXT): $(printsignal_Xabbrev_OBJECTS) $(printsignal_Xabbrev_DEPENDENCIES) $(EXTRA_printsignal_Xabbrev_DEPENDENCIES) + @rm -f printsignal-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printsignal_Xabbrev_OBJECTS) $(printsignal_Xabbrev_LDADD) $(LIBS) + +printsignal-Xraw$(EXEEXT): $(printsignal_Xraw_OBJECTS) $(printsignal_Xraw_DEPENDENCIES) $(EXTRA_printsignal_Xraw_DEPENDENCIES) + @rm -f printsignal-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printsignal_Xraw_OBJECTS) $(printsignal_Xraw_LDADD) $(LIBS) + +printsignal-Xverbose$(EXEEXT): $(printsignal_Xverbose_OBJECTS) $(printsignal_Xverbose_DEPENDENCIES) $(EXTRA_printsignal_Xverbose_DEPENDENCIES) + @rm -f printsignal-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printsignal_Xverbose_OBJECTS) $(printsignal_Xverbose_LDADD) $(LIBS) + printstr$(EXEEXT): $(printstr_OBJECTS) $(printstr_DEPENDENCIES) $(EXTRA_printstr_DEPENDENCIES) @rm -f printstr$(EXEEXT) $(AM_V_CCLD)$(LINK) $(printstr_OBJECTS) $(printstr_LDADD) $(LIBS) +printstrn-umoven$(EXEEXT): $(printstrn_umoven_OBJECTS) $(printstrn_umoven_DEPENDENCIES) $(EXTRA_printstrn_umoven_DEPENDENCIES) + @rm -f printstrn-umoven$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printstrn_umoven_OBJECTS) $(printstrn_umoven_LDADD) $(LIBS) + +printstrn-umoven-peekdata$(EXEEXT): $(printstrn_umoven_peekdata_OBJECTS) $(printstrn_umoven_peekdata_DEPENDENCIES) $(EXTRA_printstrn_umoven_peekdata_DEPENDENCIES) + @rm -f printstrn-umoven-peekdata$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printstrn_umoven_peekdata_OBJECTS) $(printstrn_umoven_peekdata_LDADD) $(LIBS) + +printstrn-umoven-undumpable$(EXEEXT): $(printstrn_umoven_undumpable_OBJECTS) $(printstrn_umoven_undumpable_DEPENDENCIES) $(EXTRA_printstrn_umoven_undumpable_DEPENDENCIES) + @rm -f printstrn-umoven-undumpable$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printstrn_umoven_undumpable_OBJECTS) $(printstrn_umoven_undumpable_LDADD) $(LIBS) + prlimit64$(EXEEXT): $(prlimit64_OBJECTS) $(prlimit64_DEPENDENCIES) $(EXTRA_prlimit64_DEPENDENCIES) @rm -f prlimit64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(prlimit64_OBJECTS) $(prlimit64_LDADD) $(LIBS) @@ -3880,6 +6817,10 @@ ptrace$(EXEEXT): $(ptrace_OBJECTS) $(ptrace_DEPENDENCIES) $(EXTRA_ptrace_DEPENDE @rm -f ptrace$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ptrace_OBJECTS) $(ptrace_LDADD) $(LIBS) +ptrace_syscall_info$(EXEEXT): $(ptrace_syscall_info_OBJECTS) $(ptrace_syscall_info_DEPENDENCIES) $(EXTRA_ptrace_syscall_info_DEPENDENCIES) + @rm -f ptrace_syscall_info$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ptrace_syscall_info_OBJECTS) $(ptrace_syscall_info_LDADD) $(LIBS) + pwritev$(EXEEXT): $(pwritev_OBJECTS) $(pwritev_DEPENDENCIES) $(EXTRA_pwritev_DEPENDENCIES) @rm -f pwritev$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pwritev_OBJECTS) $(pwritev_LDADD) $(LIBS) @@ -3908,6 +6849,26 @@ quotactl$(EXEEXT): $(quotactl_OBJECTS) $(quotactl_DEPENDENCIES) $(EXTRA_quotactl @rm -f quotactl$(EXEEXT) $(AM_V_CCLD)$(LINK) $(quotactl_OBJECTS) $(quotactl_LDADD) $(LIBS) +quotactl-Xabbrev$(EXEEXT): $(quotactl_Xabbrev_OBJECTS) $(quotactl_Xabbrev_DEPENDENCIES) $(EXTRA_quotactl_Xabbrev_DEPENDENCIES) + @rm -f quotactl-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_Xabbrev_OBJECTS) $(quotactl_Xabbrev_LDADD) $(LIBS) + +quotactl-Xraw$(EXEEXT): $(quotactl_Xraw_OBJECTS) $(quotactl_Xraw_DEPENDENCIES) $(EXTRA_quotactl_Xraw_DEPENDENCIES) + @rm -f quotactl-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_Xraw_OBJECTS) $(quotactl_Xraw_LDADD) $(LIBS) + +quotactl-Xverbose$(EXEEXT): $(quotactl_Xverbose_OBJECTS) $(quotactl_Xverbose_DEPENDENCIES) $(EXTRA_quotactl_Xverbose_DEPENDENCIES) + @rm -f quotactl-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_Xverbose_OBJECTS) $(quotactl_Xverbose_LDADD) $(LIBS) + +quotactl-success$(EXEEXT): $(quotactl_success_OBJECTS) $(quotactl_success_DEPENDENCIES) $(EXTRA_quotactl_success_DEPENDENCIES) + @rm -f quotactl-success$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_success_OBJECTS) $(quotactl_success_LDADD) $(LIBS) + +quotactl-success-v$(EXEEXT): $(quotactl_success_v_OBJECTS) $(quotactl_success_v_DEPENDENCIES) $(EXTRA_quotactl_success_v_DEPENDENCIES) + @rm -f quotactl-success-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_success_v_OBJECTS) $(quotactl_success_v_LDADD) $(LIBS) + quotactl-v$(EXEEXT): $(quotactl_v_OBJECTS) $(quotactl_v_DEPENDENCIES) $(EXTRA_quotactl_v_DEPENDENCIES) @rm -f quotactl-v$(EXEEXT) $(AM_V_CCLD)$(LINK) $(quotactl_v_OBJECTS) $(quotactl_v_LDADD) $(LIBS) @@ -3916,6 +6877,14 @@ quotactl-xfs$(EXEEXT): $(quotactl_xfs_OBJECTS) $(quotactl_xfs_DEPENDENCIES) $(EX @rm -f quotactl-xfs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(quotactl_xfs_OBJECTS) $(quotactl_xfs_LDADD) $(LIBS) +quotactl-xfs-success$(EXEEXT): $(quotactl_xfs_success_OBJECTS) $(quotactl_xfs_success_DEPENDENCIES) $(EXTRA_quotactl_xfs_success_DEPENDENCIES) + @rm -f quotactl-xfs-success$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_xfs_success_OBJECTS) $(quotactl_xfs_success_LDADD) $(LIBS) + +quotactl-xfs-success-v$(EXEEXT): $(quotactl_xfs_success_v_OBJECTS) $(quotactl_xfs_success_v_DEPENDENCIES) $(EXTRA_quotactl_xfs_success_v_DEPENDENCIES) + @rm -f quotactl-xfs-success-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_xfs_success_v_OBJECTS) $(quotactl_xfs_success_v_LDADD) $(LIBS) + quotactl-xfs-v$(EXEEXT): $(quotactl_xfs_v_OBJECTS) $(quotactl_xfs_v_DEPENDENCIES) $(EXTRA_quotactl_xfs_v_DEPENDENCIES) @rm -f quotactl-xfs-v$(EXEEXT) $(AM_V_CCLD)$(LINK) $(quotactl_xfs_v_OBJECTS) $(quotactl_xfs_v_LDADD) $(LIBS) @@ -3968,6 +6937,18 @@ remap_file_pages$(EXEEXT): $(remap_file_pages_OBJECTS) $(remap_file_pages_DEPEND @rm -f remap_file_pages$(EXEEXT) $(AM_V_CCLD)$(LINK) $(remap_file_pages_OBJECTS) $(remap_file_pages_LDADD) $(LIBS) +remap_file_pages-Xabbrev$(EXEEXT): $(remap_file_pages_Xabbrev_OBJECTS) $(remap_file_pages_Xabbrev_DEPENDENCIES) $(EXTRA_remap_file_pages_Xabbrev_DEPENDENCIES) + @rm -f remap_file_pages-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(remap_file_pages_Xabbrev_OBJECTS) $(remap_file_pages_Xabbrev_LDADD) $(LIBS) + +remap_file_pages-Xraw$(EXEEXT): $(remap_file_pages_Xraw_OBJECTS) $(remap_file_pages_Xraw_DEPENDENCIES) $(EXTRA_remap_file_pages_Xraw_DEPENDENCIES) + @rm -f remap_file_pages-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(remap_file_pages_Xraw_OBJECTS) $(remap_file_pages_Xraw_LDADD) $(LIBS) + +remap_file_pages-Xverbose$(EXEEXT): $(remap_file_pages_Xverbose_OBJECTS) $(remap_file_pages_Xverbose_DEPENDENCIES) $(EXTRA_remap_file_pages_Xverbose_DEPENDENCIES) + @rm -f remap_file_pages-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(remap_file_pages_Xverbose_OBJECTS) $(remap_file_pages_Xverbose_LDADD) $(LIBS) + rename$(EXEEXT): $(rename_OBJECTS) $(rename_DEPENDENCIES) $(EXTRA_rename_DEPENDENCIES) @rm -f rename$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rename_OBJECTS) $(rename_LDADD) $(LIBS) @@ -3988,10 +6969,18 @@ restart_syscall$(EXEEXT): $(restart_syscall_OBJECTS) $(restart_syscall_DEPENDENC @rm -f restart_syscall$(EXEEXT) $(AM_V_CCLD)$(LINK) $(restart_syscall_OBJECTS) $(restart_syscall_LDADD) $(LIBS) +riscv_flush_icache$(EXEEXT): $(riscv_flush_icache_OBJECTS) $(riscv_flush_icache_DEPENDENCIES) $(EXTRA_riscv_flush_icache_DEPENDENCIES) + @rm -f riscv_flush_icache$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(riscv_flush_icache_OBJECTS) $(riscv_flush_icache_LDADD) $(LIBS) + rmdir$(EXEEXT): $(rmdir_OBJECTS) $(rmdir_DEPENDENCIES) $(EXTRA_rmdir_DEPENDENCIES) @rm -f rmdir$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rmdir_OBJECTS) $(rmdir_LDADD) $(LIBS) +rt_sigaction$(EXEEXT): $(rt_sigaction_OBJECTS) $(rt_sigaction_DEPENDENCIES) $(EXTRA_rt_sigaction_DEPENDENCIES) + @rm -f rt_sigaction$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_sigaction_OBJECTS) $(rt_sigaction_LDADD) $(LIBS) + rt_sigpending$(EXEEXT): $(rt_sigpending_OBJECTS) $(rt_sigpending_DEPENDENCIES) $(EXTRA_rt_sigpending_DEPENDENCIES) @rm -f rt_sigpending$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rt_sigpending_OBJECTS) $(rt_sigpending_LDADD) $(LIBS) @@ -4004,6 +6993,10 @@ rt_sigqueueinfo$(EXEEXT): $(rt_sigqueueinfo_OBJECTS) $(rt_sigqueueinfo_DEPENDENC @rm -f rt_sigqueueinfo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rt_sigqueueinfo_OBJECTS) $(rt_sigqueueinfo_LDADD) $(LIBS) +rt_sigreturn$(EXEEXT): $(rt_sigreturn_OBJECTS) $(rt_sigreturn_DEPENDENCIES) $(EXTRA_rt_sigreturn_DEPENDENCIES) + @rm -f rt_sigreturn$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_sigreturn_OBJECTS) $(rt_sigreturn_LDADD) $(LIBS) + rt_sigsuspend$(EXEEXT): $(rt_sigsuspend_OBJECTS) $(rt_sigsuspend_DEPENDENCIES) $(EXTRA_rt_sigsuspend_DEPENDENCIES) @rm -f rt_sigsuspend$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rt_sigsuspend_OBJECTS) $(rt_sigsuspend_LDADD) $(LIBS) @@ -4016,6 +7009,34 @@ rt_tgsigqueueinfo$(EXEEXT): $(rt_tgsigqueueinfo_OBJECTS) $(rt_tgsigqueueinfo_DEP @rm -f rt_tgsigqueueinfo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rt_tgsigqueueinfo_OBJECTS) $(rt_tgsigqueueinfo_LDADD) $(LIBS) +run_expect_termsig$(EXEEXT): $(run_expect_termsig_OBJECTS) $(run_expect_termsig_DEPENDENCIES) $(EXTRA_run_expect_termsig_DEPENDENCIES) + @rm -f run_expect_termsig$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(run_expect_termsig_OBJECTS) $(run_expect_termsig_LDADD) $(LIBS) + +s390_guarded_storage$(EXEEXT): $(s390_guarded_storage_OBJECTS) $(s390_guarded_storage_DEPENDENCIES) $(EXTRA_s390_guarded_storage_DEPENDENCIES) + @rm -f s390_guarded_storage$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(s390_guarded_storage_OBJECTS) $(s390_guarded_storage_LDADD) $(LIBS) + +s390_guarded_storage-v$(EXEEXT): $(s390_guarded_storage_v_OBJECTS) $(s390_guarded_storage_v_DEPENDENCIES) $(EXTRA_s390_guarded_storage_v_DEPENDENCIES) + @rm -f s390_guarded_storage-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(s390_guarded_storage_v_OBJECTS) $(s390_guarded_storage_v_LDADD) $(LIBS) + +s390_pci_mmio_read_write$(EXEEXT): $(s390_pci_mmio_read_write_OBJECTS) $(s390_pci_mmio_read_write_DEPENDENCIES) $(EXTRA_s390_pci_mmio_read_write_DEPENDENCIES) + @rm -f s390_pci_mmio_read_write$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(s390_pci_mmio_read_write_OBJECTS) $(s390_pci_mmio_read_write_LDADD) $(LIBS) + +s390_runtime_instr$(EXEEXT): $(s390_runtime_instr_OBJECTS) $(s390_runtime_instr_DEPENDENCIES) $(EXTRA_s390_runtime_instr_DEPENDENCIES) + @rm -f s390_runtime_instr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(s390_runtime_instr_OBJECTS) $(s390_runtime_instr_LDADD) $(LIBS) + +s390_sthyi$(EXEEXT): $(s390_sthyi_OBJECTS) $(s390_sthyi_DEPENDENCIES) $(EXTRA_s390_sthyi_DEPENDENCIES) + @rm -f s390_sthyi$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(s390_sthyi_OBJECTS) $(s390_sthyi_LDADD) $(LIBS) + +s390_sthyi-v$(EXEEXT): $(s390_sthyi_v_OBJECTS) $(s390_sthyi_v_DEPENDENCIES) $(EXTRA_s390_sthyi_v_DEPENDENCIES) + @rm -f s390_sthyi-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(s390_sthyi_v_OBJECTS) $(s390_sthyi_v_LDADD) $(LIBS) + sched_get_priority_mxx$(EXEEXT): $(sched_get_priority_mxx_OBJECTS) $(sched_get_priority_mxx_DEPENDENCIES) $(EXTRA_sched_get_priority_mxx_DEPENDENCIES) @rm -f sched_get_priority_mxx$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sched_get_priority_mxx_OBJECTS) $(sched_get_priority_mxx_LDADD) $(LIBS) @@ -4060,10 +7081,18 @@ seccomp-strict$(EXEEXT): $(seccomp_strict_OBJECTS) $(seccomp_strict_DEPENDENCIES @rm -f seccomp-strict$(EXEEXT) $(AM_V_CCLD)$(LINK) $(seccomp_strict_OBJECTS) $(seccomp_strict_LDADD) $(LIBS) +seccomp_get_action_avail$(EXEEXT): $(seccomp_get_action_avail_OBJECTS) $(seccomp_get_action_avail_DEPENDENCIES) $(EXTRA_seccomp_get_action_avail_DEPENDENCIES) + @rm -f seccomp_get_action_avail$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(seccomp_get_action_avail_OBJECTS) $(seccomp_get_action_avail_LDADD) $(LIBS) + select$(EXEEXT): $(select_OBJECTS) $(select_DEPENDENCIES) $(EXTRA_select_DEPENDENCIES) @rm -f select$(EXEEXT) $(AM_V_CCLD)$(LINK) $(select_OBJECTS) $(select_LDADD) $(LIBS) +select-P$(EXEEXT): $(select_P_OBJECTS) $(select_P_DEPENDENCIES) $(EXTRA_select_P_DEPENDENCIES) + @rm -f select-P$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(select_P_OBJECTS) $(select_P_LDADD) $(LIBS) + semop$(EXEEXT): $(semop_OBJECTS) $(semop_DEPENDENCIES) $(EXTRA_semop_DEPENDENCIES) @rm -f semop$(EXEEXT) $(AM_V_CCLD)$(LINK) $(semop_OBJECTS) $(semop_LDADD) $(LIBS) @@ -4084,6 +7113,14 @@ set_ptracer_any$(EXEEXT): $(set_ptracer_any_OBJECTS) $(set_ptracer_any_DEPENDENC @rm -f set_ptracer_any$(EXEEXT) $(AM_V_CCLD)$(LINK) $(set_ptracer_any_OBJECTS) $(set_ptracer_any_LDADD) $(LIBS) +set_sigblock$(EXEEXT): $(set_sigblock_OBJECTS) $(set_sigblock_DEPENDENCIES) $(EXTRA_set_sigblock_DEPENDENCIES) + @rm -f set_sigblock$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(set_sigblock_OBJECTS) $(set_sigblock_LDADD) $(LIBS) + +set_sigign$(EXEEXT): $(set_sigign_OBJECTS) $(set_sigign_DEPENDENCIES) $(EXTRA_set_sigign_DEPENDENCIES) + @rm -f set_sigign$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(set_sigign_OBJECTS) $(set_sigign_LDADD) $(LIBS) + setdomainname$(EXEEXT): $(setdomainname_OBJECTS) $(setdomainname_DEPENDENCIES) $(EXTRA_setdomainname_DEPENDENCIES) @rm -f setdomainname$(EXEEXT) $(AM_V_CCLD)$(LINK) $(setdomainname_OBJECTS) $(setdomainname_LDADD) $(LIBS) @@ -4164,6 +7201,18 @@ setrlimit$(EXEEXT): $(setrlimit_OBJECTS) $(setrlimit_DEPENDENCIES) $(EXTRA_setrl @rm -f setrlimit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(setrlimit_OBJECTS) $(setrlimit_LDADD) $(LIBS) +setrlimit-Xabbrev$(EXEEXT): $(setrlimit_Xabbrev_OBJECTS) $(setrlimit_Xabbrev_DEPENDENCIES) $(EXTRA_setrlimit_Xabbrev_DEPENDENCIES) + @rm -f setrlimit-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setrlimit_Xabbrev_OBJECTS) $(setrlimit_Xabbrev_LDADD) $(LIBS) + +setrlimit-Xraw$(EXEEXT): $(setrlimit_Xraw_OBJECTS) $(setrlimit_Xraw_DEPENDENCIES) $(EXTRA_setrlimit_Xraw_DEPENDENCIES) + @rm -f setrlimit-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setrlimit_Xraw_OBJECTS) $(setrlimit_Xraw_LDADD) $(LIBS) + +setrlimit-Xverbose$(EXEEXT): $(setrlimit_Xverbose_OBJECTS) $(setrlimit_Xverbose_DEPENDENCIES) $(EXTRA_setrlimit_Xverbose_DEPENDENCIES) + @rm -f setrlimit-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setrlimit_Xverbose_OBJECTS) $(setrlimit_Xverbose_LDADD) $(LIBS) + setuid$(EXEEXT): $(setuid_OBJECTS) $(setuid_DEPENDENCIES) $(EXTRA_setuid_DEPENDENCIES) @rm -f setuid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(setuid_OBJECTS) $(setuid_LDADD) $(LIBS) @@ -4192,6 +7241,10 @@ siginfo$(EXEEXT): $(siginfo_OBJECTS) $(siginfo_DEPENDENCIES) $(EXTRA_siginfo_DEP @rm -f siginfo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(siginfo_OBJECTS) $(siginfo_LDADD) $(LIBS) +signal$(EXEEXT): $(signal_OBJECTS) $(signal_DEPENDENCIES) $(EXTRA_signal_DEPENDENCIES) + @rm -f signal$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(signal_OBJECTS) $(signal_LDADD) $(LIBS) + signal_receive$(EXEEXT): $(signal_receive_OBJECTS) $(signal_receive_DEPENDENCIES) $(EXTRA_signal_receive_DEPENDENCIES) @rm -f signal_receive$(EXEEXT) $(AM_V_CCLD)$(LINK) $(signal_receive_OBJECTS) $(signal_receive_LDADD) $(LIBS) @@ -4200,18 +7253,90 @@ signalfd4$(EXEEXT): $(signalfd4_OBJECTS) $(signalfd4_DEPENDENCIES) $(EXTRA_signa @rm -f signalfd4$(EXEEXT) $(AM_V_CCLD)$(LINK) $(signalfd4_OBJECTS) $(signalfd4_LDADD) $(LIBS) +sigpending$(EXEEXT): $(sigpending_OBJECTS) $(sigpending_DEPENDENCIES) $(EXTRA_sigpending_DEPENDENCIES) + @rm -f sigpending$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sigpending_OBJECTS) $(sigpending_LDADD) $(LIBS) + +sigprocmask$(EXEEXT): $(sigprocmask_OBJECTS) $(sigprocmask_DEPENDENCIES) $(EXTRA_sigprocmask_DEPENDENCIES) + @rm -f sigprocmask$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sigprocmask_OBJECTS) $(sigprocmask_LDADD) $(LIBS) + sigreturn$(EXEEXT): $(sigreturn_OBJECTS) $(sigreturn_DEPENDENCIES) $(EXTRA_sigreturn_DEPENDENCIES) @rm -f sigreturn$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sigreturn_OBJECTS) $(sigreturn_LDADD) $(LIBS) +sigsuspend$(EXEEXT): $(sigsuspend_OBJECTS) $(sigsuspend_DEPENDENCIES) $(EXTRA_sigsuspend_DEPENDENCIES) + @rm -f sigsuspend$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sigsuspend_OBJECTS) $(sigsuspend_LDADD) $(LIBS) + sleep$(EXEEXT): $(sleep_OBJECTS) $(sleep_DEPENDENCIES) $(EXTRA_sleep_DEPENDENCIES) @rm -f sleep$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sleep_OBJECTS) $(sleep_LDADD) $(LIBS) +so_error$(EXEEXT): $(so_error_OBJECTS) $(so_error_DEPENDENCIES) $(EXTRA_so_error_DEPENDENCIES) + @rm -f so_error$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(so_error_OBJECTS) $(so_error_LDADD) $(LIBS) + +so_linger$(EXEEXT): $(so_linger_OBJECTS) $(so_linger_DEPENDENCIES) $(EXTRA_so_linger_DEPENDENCIES) + @rm -f so_linger$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(so_linger_OBJECTS) $(so_linger_LDADD) $(LIBS) + +so_peercred$(EXEEXT): $(so_peercred_OBJECTS) $(so_peercred_DEPENDENCIES) $(EXTRA_so_peercred_DEPENDENCIES) + @rm -f so_peercred$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(so_peercred_OBJECTS) $(so_peercred_LDADD) $(LIBS) + +so_peercred-Xabbrev$(EXEEXT): $(so_peercred_Xabbrev_OBJECTS) $(so_peercred_Xabbrev_DEPENDENCIES) $(EXTRA_so_peercred_Xabbrev_DEPENDENCIES) + @rm -f so_peercred-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(so_peercred_Xabbrev_OBJECTS) $(so_peercred_Xabbrev_LDADD) $(LIBS) + +so_peercred-Xraw$(EXEEXT): $(so_peercred_Xraw_OBJECTS) $(so_peercred_Xraw_DEPENDENCIES) $(EXTRA_so_peercred_Xraw_DEPENDENCIES) + @rm -f so_peercred-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(so_peercred_Xraw_OBJECTS) $(so_peercred_Xraw_LDADD) $(LIBS) + +so_peercred-Xverbose$(EXEEXT): $(so_peercred_Xverbose_OBJECTS) $(so_peercred_Xverbose_DEPENDENCIES) $(EXTRA_so_peercred_Xverbose_DEPENDENCIES) + @rm -f so_peercred-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(so_peercred_Xverbose_OBJECTS) $(so_peercred_Xverbose_LDADD) $(LIBS) + +sock_filter-v$(EXEEXT): $(sock_filter_v_OBJECTS) $(sock_filter_v_DEPENDENCIES) $(EXTRA_sock_filter_v_DEPENDENCIES) + @rm -f sock_filter-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sock_filter_v_OBJECTS) $(sock_filter_v_LDADD) $(LIBS) + +sock_filter-v-Xabbrev$(EXEEXT): $(sock_filter_v_Xabbrev_OBJECTS) $(sock_filter_v_Xabbrev_DEPENDENCIES) $(EXTRA_sock_filter_v_Xabbrev_DEPENDENCIES) + @rm -f sock_filter-v-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sock_filter_v_Xabbrev_OBJECTS) $(sock_filter_v_Xabbrev_LDADD) $(LIBS) + +sock_filter-v-Xraw$(EXEEXT): $(sock_filter_v_Xraw_OBJECTS) $(sock_filter_v_Xraw_DEPENDENCIES) $(EXTRA_sock_filter_v_Xraw_DEPENDENCIES) + @rm -f sock_filter-v-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sock_filter_v_Xraw_OBJECTS) $(sock_filter_v_Xraw_LDADD) $(LIBS) + +sock_filter-v-Xverbose$(EXEEXT): $(sock_filter_v_Xverbose_OBJECTS) $(sock_filter_v_Xverbose_DEPENDENCIES) $(EXTRA_sock_filter_v_Xverbose_DEPENDENCIES) + @rm -f sock_filter-v-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sock_filter_v_Xverbose_OBJECTS) $(sock_filter_v_Xverbose_LDADD) $(LIBS) + +sockaddr_xlat-Xabbrev$(EXEEXT): $(sockaddr_xlat_Xabbrev_OBJECTS) $(sockaddr_xlat_Xabbrev_DEPENDENCIES) $(EXTRA_sockaddr_xlat_Xabbrev_DEPENDENCIES) + @rm -f sockaddr_xlat-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sockaddr_xlat_Xabbrev_OBJECTS) $(sockaddr_xlat_Xabbrev_LDADD) $(LIBS) + +sockaddr_xlat-Xraw$(EXEEXT): $(sockaddr_xlat_Xraw_OBJECTS) $(sockaddr_xlat_Xraw_DEPENDENCIES) $(EXTRA_sockaddr_xlat_Xraw_DEPENDENCIES) + @rm -f sockaddr_xlat-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sockaddr_xlat_Xraw_OBJECTS) $(sockaddr_xlat_Xraw_LDADD) $(LIBS) + +sockaddr_xlat-Xverbose$(EXEEXT): $(sockaddr_xlat_Xverbose_OBJECTS) $(sockaddr_xlat_Xverbose_DEPENDENCIES) $(EXTRA_sockaddr_xlat_Xverbose_DEPENDENCIES) + @rm -f sockaddr_xlat-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sockaddr_xlat_Xverbose_OBJECTS) $(sockaddr_xlat_Xverbose_LDADD) $(LIBS) + socketcall$(EXEEXT): $(socketcall_OBJECTS) $(socketcall_DEPENDENCIES) $(EXTRA_socketcall_DEPENDENCIES) @rm -f socketcall$(EXEEXT) $(AM_V_CCLD)$(LINK) $(socketcall_OBJECTS) $(socketcall_LDADD) $(LIBS) +sockopt-sol_netlink$(EXEEXT): $(sockopt_sol_netlink_OBJECTS) $(sockopt_sol_netlink_DEPENDENCIES) $(EXTRA_sockopt_sol_netlink_DEPENDENCIES) + @rm -f sockopt-sol_netlink$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sockopt_sol_netlink_OBJECTS) $(sockopt_sol_netlink_LDADD) $(LIBS) + +sockopt-timestamp$(EXEEXT): $(sockopt_timestamp_OBJECTS) $(sockopt_timestamp_DEPENDENCIES) $(EXTRA_sockopt_timestamp_DEPENDENCIES) + @rm -f sockopt-timestamp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sockopt_timestamp_OBJECTS) $(sockopt_timestamp_LDADD) $(LIBS) + splice$(EXEEXT): $(splice_OBJECTS) $(splice_DEPENDENCIES) $(EXTRA_splice_DEPENDENCIES) @rm -f splice$(EXEEXT) $(AM_V_CCLD)$(LINK) $(splice_OBJECTS) $(splice_LDADD) $(LIBS) @@ -4220,6 +7345,10 @@ stack-fcall$(EXEEXT): $(stack_fcall_OBJECTS) $(stack_fcall_DEPENDENCIES) $(EXTRA @rm -f stack-fcall$(EXEEXT) $(AM_V_CCLD)$(LINK) $(stack_fcall_OBJECTS) $(stack_fcall_LDADD) $(LIBS) +stack-fcall-mangled$(EXEEXT): $(stack_fcall_mangled_OBJECTS) $(stack_fcall_mangled_DEPENDENCIES) $(EXTRA_stack_fcall_mangled_DEPENDENCIES) + @rm -f stack-fcall-mangled$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(stack_fcall_mangled_OBJECTS) $(stack_fcall_mangled_LDADD) $(LIBS) + stat$(EXEEXT): $(stat_OBJECTS) $(stat_DEPENDENCIES) $(EXTRA_stat_DEPENDENCIES) @rm -f stat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(stat_OBJECTS) $(stat_LDADD) $(LIBS) @@ -4236,10 +7365,18 @@ statfs64$(EXEEXT): $(statfs64_OBJECTS) $(statfs64_DEPENDENCIES) $(EXTRA_statfs64 @rm -f statfs64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(statfs64_OBJECTS) $(statfs64_LDADD) $(LIBS) +statx$(EXEEXT): $(statx_OBJECTS) $(statx_DEPENDENCIES) $(EXTRA_statx_DEPENDENCIES) + @rm -f statx$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(statx_OBJECTS) $(statx_LDADD) $(LIBS) + swap$(EXEEXT): $(swap_OBJECTS) $(swap_DEPENDENCIES) $(EXTRA_swap_DEPENDENCIES) @rm -f swap$(EXEEXT) $(AM_V_CCLD)$(LINK) $(swap_OBJECTS) $(swap_LDADD) $(LIBS) +sxetmask$(EXEEXT): $(sxetmask_OBJECTS) $(sxetmask_DEPENDENCIES) $(EXTRA_sxetmask_DEPENDENCIES) + @rm -f sxetmask$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sxetmask_OBJECTS) $(sxetmask_LDADD) $(LIBS) + symlink$(EXEEXT): $(symlink_OBJECTS) $(symlink_DEPENDENCIES) $(EXTRA_symlink_DEPENDENCIES) @rm -f symlink$(EXEEXT) $(AM_V_CCLD)$(LINK) $(symlink_OBJECTS) $(symlink_LDADD) $(LIBS) @@ -4352,6 +7489,10 @@ uname$(EXEEXT): $(uname_OBJECTS) $(uname_DEPENDENCIES) $(EXTRA_uname_DEPENDENCIE @rm -f uname$(EXEEXT) $(AM_V_CCLD)$(LINK) $(uname_OBJECTS) $(uname_LDADD) $(LIBS) +unblock_reset_raise$(EXEEXT): $(unblock_reset_raise_OBJECTS) $(unblock_reset_raise_DEPENDENCIES) $(EXTRA_unblock_reset_raise_DEPENDENCIES) + @rm -f unblock_reset_raise$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unblock_reset_raise_OBJECTS) $(unblock_reset_raise_LDADD) $(LIBS) + unix-pair-send-recv$(EXEEXT): $(unix_pair_send_recv_OBJECTS) $(unix_pair_send_recv_DEPENDENCIES) $(EXTRA_unix_pair_send_recv_DEPENDENCIES) @rm -f unix-pair-send-recv$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unix_pair_send_recv_OBJECTS) $(unix_pair_send_recv_LDADD) $(LIBS) @@ -4388,6 +7529,18 @@ utimensat$(EXEEXT): $(utimensat_OBJECTS) $(utimensat_DEPENDENCIES) $(EXTRA_utime @rm -f utimensat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(utimensat_OBJECTS) $(utimensat_LDADD) $(LIBS) +utimensat-Xabbrev$(EXEEXT): $(utimensat_Xabbrev_OBJECTS) $(utimensat_Xabbrev_DEPENDENCIES) $(EXTRA_utimensat_Xabbrev_DEPENDENCIES) + @rm -f utimensat-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(utimensat_Xabbrev_OBJECTS) $(utimensat_Xabbrev_LDADD) $(LIBS) + +utimensat-Xraw$(EXEEXT): $(utimensat_Xraw_OBJECTS) $(utimensat_Xraw_DEPENDENCIES) $(EXTRA_utimensat_Xraw_DEPENDENCIES) + @rm -f utimensat-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(utimensat_Xraw_OBJECTS) $(utimensat_Xraw_LDADD) $(LIBS) + +utimensat-Xverbose$(EXEEXT): $(utimensat_Xverbose_OBJECTS) $(utimensat_Xverbose_DEPENDENCIES) $(EXTRA_utimensat_Xverbose_DEPENDENCIES) + @rm -f utimensat-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(utimensat_Xverbose_OBJECTS) $(utimensat_Xverbose_LDADD) $(LIBS) + utimes$(EXEEXT): $(utimes_OBJECTS) $(utimes_DEPENDENCIES) $(EXTRA_utimes_DEPENDENCIES) @rm -f utimes$(EXEEXT) $(AM_V_CCLD)$(LINK) $(utimes_OBJECTS) $(utimes_LDADD) $(LIBS) @@ -4436,6 +7589,10 @@ xet_robust_list$(EXEEXT): $(xet_robust_list_OBJECTS) $(xet_robust_list_DEPENDENC @rm -f xet_robust_list$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xet_robust_list_OBJECTS) $(xet_robust_list_LDADD) $(LIBS) +xet_thread_area_x86$(EXEEXT): $(xet_thread_area_x86_OBJECTS) $(xet_thread_area_x86_DEPENDENCIES) $(EXTRA_xet_thread_area_x86_DEPENDENCIES) + @rm -f xet_thread_area_x86$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xet_thread_area_x86_OBJECTS) $(xet_thread_area_x86_LDADD) $(LIBS) + xetitimer$(EXEEXT): $(xetitimer_OBJECTS) $(xetitimer_DEPENDENCIES) $(EXTRA_xetitimer_DEPENDENCIES) @rm -f xetitimer$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xetitimer_OBJECTS) $(xetitimer_LDADD) $(LIBS) @@ -4452,408 +7609,668 @@ xettimeofday$(EXEEXT): $(xettimeofday_OBJECTS) $(xettimeofday_DEPENDENCIES) $(EX @rm -f xettimeofday$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xettimeofday_OBJECTS) $(xettimeofday_LDADD) $(LIBS) +zeroargc$(EXEEXT): $(zeroargc_OBJECTS) $(zeroargc_DEPENDENCIES) $(EXTRA_zeroargc_DEPENDENCIES) + @rm -f zeroargc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(zeroargc_OBJECTS) $(zeroargc_LDADD) $(LIBS) + mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_newselect.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept4.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/access.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acct.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_key.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adjtimex.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aio.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alarm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/answer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-f-p-cmd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-f-p.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-p-cmd-cmd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-p-cmd-p.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/brk.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/btrfs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caps-abbrev.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caps.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chmod.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chown.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chown32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chroot.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_adjtime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_nanosleep.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_xettime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/copy_file_range.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/count-f.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/delete_module.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup3.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_create.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_create1.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_ctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_pwait.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_wait.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/erestartsys.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eventfd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execve-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execve.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execveat-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execveat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/faccessat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fadvise64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fadvise64_64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fallocate.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_init.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchdir.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmod.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmodat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchown.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchown32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchownat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdatasync.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_handle.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_ioctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter-unavailable.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit_module.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fork-f.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat64-fstat64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatat64-fstatat64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatfs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatfs64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsync.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftruncate.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftruncate64-ftruncate64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/futex.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/futimesat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_mempolicy.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcpu.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcwd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdents.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdents64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getegid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getegid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geteuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geteuid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgroups.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgroups32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpeername.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpgrp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrandom.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresgid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresgid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresuid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrlimit.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrusage.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getsid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getsockname.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getuid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getxxid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet-cmsg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init_module.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inotify.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inotify_init1.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_block.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_dm-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_dm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop-nv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_mtd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_rtc-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_rtc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_scsi.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sg_io_v3.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sg_io_v4.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sock_gifconf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_uffdio.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_v4l2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioperm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iopl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioprio.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ip_mreq.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msgbuf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_sem.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_shm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kcmp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kexec_file_load.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kexec_load.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kill.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ksysent.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-errno2name.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-error_msg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-fill_memory.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-get_page_size.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-hexdump_strdup.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-hexquote_strndup.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-inode_of_sockfd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-libmmsg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-libsocketcall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-overflowuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-pipe_maxfd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-print_quoted_string.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-printflags.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-printxval.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-signal2name.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-sprintrc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-tail_alloc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-tprintf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/link.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linkat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/llseek.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lookup_dcookie.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lseek.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat64-lstat64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbind.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/membarrier.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memfd_create.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/migrate_pages.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mincore.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdir.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdirat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mknod.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mknodat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlock2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlockall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap64-mmap64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg-silent.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg_name-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg_name.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_pages.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv-read.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv-write.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_control-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_control.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_name.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/munlockall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nanosleep.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-accept-connect.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-icmp_filter.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-sockaddr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-y-unix.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-inet.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-netlink.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-unix.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_inet_diag.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_netlink_diag.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_protocol.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_unix_diag.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/newfstatat-newfstatat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nsyscalls.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldfstat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldlstat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldselect.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldstat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pause.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open_nonverbose.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open_unabbrev.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/personality.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_alloc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_free.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_mprotect.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poll.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppoll.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-arg2-intptr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-dumpable.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-name.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-no-args.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-pdeathsig.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-seccomp-filter-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-seccomp-strict.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-securebits.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-tid_address.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-tsc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv-preadv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv2-pwritev2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv_pwritev-preadv-pwritev.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print_maxfd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printstr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prlimit64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process_vm_readv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process_vm_writev.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pselect6.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptrace.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pwritev-pwritev.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_fault.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-error-signal.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-retval.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-signal.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_signal.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read-write.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readahead.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readdir.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlinkat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reboot.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvfrom.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvmmsg-timeout.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvmsg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/redirect-fds.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remap_file_pages.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rename.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renameat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renameat2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/request_key.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/restart_syscall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rmdir.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigpending.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigprocmask.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigqueueinfo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigsuspend.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigtimedwait.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_tgsigqueueinfo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_get_priority_mxx.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_rr_get_interval.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetaffinity.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetattr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetparam.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetscheduler.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_yield.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scm_rights.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-filter-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-filter.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-strict.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/semop.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendfile.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendfile64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_mempolicy.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_ptracer_any.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setdomainname.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsgid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsgid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsuid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgroups.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgroups32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sethostname.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setns.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setregid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setregid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresgid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresgid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresuid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setreuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setreuid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setrlimit.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setuid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shmxt.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shutdown.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaction.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaltstack.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siginfo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal_receive.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signalfd4.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigreturn.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sleep.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socketcall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/splice.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-0.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-1.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-3.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat64-stat64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statfs-statfs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statfs64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlink.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlinkat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync_file_range.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync_file_range2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysinfo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syslog.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tee.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threads-execve.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer_create.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer_xettime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timerfd_xettime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/times-fail.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/times.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/truncate.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/truncate64-truncate64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ugetrlimit.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uio-uio.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umask.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umount.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umount2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umoven-illptr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr-illptr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr3.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uname.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix-pair-send-recv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix-pair-sendto-recvfrom.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlink.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlinkat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unshare.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/userfaultfd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ustat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimensat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimes.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfork-f.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vhangup.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmsplice.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait4-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait4.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitid-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitpid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xattr-strings.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xattr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xet_robust_list.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetitimer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetpgid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetpriority.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xettimeofday.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_newselect-P.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_newselect.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept4.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/access.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acct.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_key.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adjtimex.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aio_pgetevents.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alarm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/answer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-f-p-cmd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-f-p.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-p-cmd-cmd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-p-cmd-p.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/block_reset_raise_run.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf-obj_get_info_by_fd-prog-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf-obj_get_info_by_fd-prog.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf-obj_get_info_by_fd-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf-obj_get_info_by_fd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf-success-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf-success.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/brk.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/btrfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caps-abbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caps.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_sigblock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_sigign.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chmod.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chown.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chown32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chroot.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_adjtime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_nanosleep.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_xettime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clone_parent.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clone_ptrace.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/copy_file_range.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/count-f.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/delay.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/delete_module.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dev-yy.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup3.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_create.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_create1.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_ctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_pwait.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_wait.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/erestartsys.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eventfd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execve-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execve.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execveat-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execveat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/faccessat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fadvise64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fadvise64_64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fallocate.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_init.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchdir.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmod.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmodat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchown.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchown32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchownat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdatasync.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fflush.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_handle.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_ioctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter-unavailable.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit_module.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fork-f.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat64-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat64-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat64-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat64-fstat64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatat64-fstatat64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatfs64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsync-y.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsync.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftruncate.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftruncate64-ftruncate64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/futex.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/futimesat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_mempolicy.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcpu.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcwd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdents.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdents64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getegid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getegid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geteuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geteuid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgroups.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgroups32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpeername.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpgrp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getppid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrandom.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresgid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresgid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresuid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrlimit.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrusage.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getsid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getsockname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getuid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getxxid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/group_req.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet-cmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init_module.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inject-nf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inotify.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inotify_init1.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/int_0x80.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io_uring_enter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io_uring_register.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io_uring_setup.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_block.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_dm-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_dm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev-success-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev-success.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_inotify.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_kvm_run-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_kvm_run.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_kvm_run_auxstr_vcpu.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop-nv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_mtd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_nbd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_nsfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_perf-success.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_perf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_ptp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_random.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_rtc-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_rtc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_scsi.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sg_io_v3.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sg_io_v4.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sock_gifconf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_uffdio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_v4l2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioperm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iopl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioprio-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioprio-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioprio-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioprio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ip_mreq.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msg-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msg-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msg-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msgbuf-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msgbuf-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msgbuf-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msgbuf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_sem-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_sem-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_sem-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_sem.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_shm-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_shm-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_shm-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_shm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/is_linux_mips_n64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kcmp-y.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kcmp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kern_features.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kernel_version-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kernel_version-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kernel_version-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kernel_version.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kexec_file_load.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kexec_load.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyctl-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyctl-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyctl-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kill.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kill_child.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ksysent.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-create_nl_socket.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-errno2name.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-error_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-fill_memory.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-get_page_size.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-get_sigset_size.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-hexdump_strdup.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-hexquote_strndup.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-ifindex.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-inode_of_sockfd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-libmmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-libsocketcall.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-overflowuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-pipe_maxfd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-print_quoted_string.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-print_time.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-printflags.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-printxval.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-signal2name.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-skip_unavailable.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-sprintrc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-tail_alloc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-test_printpath.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-test_printstrn.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-test_ucopy.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-tprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/link.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linkat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list_sigaction_signum.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/llseek.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localtime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lookup_dcookie.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/looping_threads.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lseek.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat64-lstat64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madvise.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbind.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/membarrier.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memfd_create-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memfd_create-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memfd_create-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memfd_create.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/migrate_pages.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mincore.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdir.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdirat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mknod.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mknodat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlock2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlockall.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap64-mmap64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg-silent.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg_name-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg_name.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modify_ldt.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_pages-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_pages-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_pages-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_pages.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv-read.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv-write.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_control-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_control.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_name.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/munlockall.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nanosleep.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-accept-connect.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-icmp_filter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-packet_mreq-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-packet_mreq-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-packet_mreq-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-packet_mreq.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-sockaddr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-tpacket_req.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-tpacket_stats-success.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-tpacket_stats.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-y-unix.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-inet.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-inet6.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-netlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-unix.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_audit.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_crypto.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_generic.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_inet_diag.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_kobject_uevent.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_netfilter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_netlink_diag.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_protocol.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_route.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_selinux.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_sock_diag.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_unix_diag.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_xfrm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/newfstatat-newfstatat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_acct.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_cthelper.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_ctnetlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_ctnetlink_exp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_cttimeout.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_ipset.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_nft_compat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_nftables.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_osf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_queue.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_ulog.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_br_port_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_crypto_user_alg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_dcbmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_fib_rule_hdr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifaddrlblmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifaddrmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifinfomsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifla_af_spec.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifla_brport.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifla_linkinfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifla_port.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifla_xdp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_inet_diag_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_inet_diag_req_compat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_inet_diag_req_v2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_mdba_mdb_entry.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_mdba_router_port.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ndmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ndtmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_netconfmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_netlink_diag_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_nlmsgerr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_packet_diag_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_rtgenmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_rtmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_smc_diag_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_tc_stats.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_tca_stab.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_tcamsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_tcmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_unix_diag_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nsyscalls-d.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nsyscalls.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap-P.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap-v-none.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldfstat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldlstat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldselect-P.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldselect-efault-P.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldselect-efault.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldselect.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldstat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orphaned_process_group.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osf_utimes.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pause.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open_nonverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open_unabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/personality-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/personality-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/personality-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/personality.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pidfd_send_signal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_alloc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_free.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_mprotect.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poll-P.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poll.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppoll-P.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppoll-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppoll.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-arg2-intptr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-dumpable.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-name.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-no-args.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-pdeathsig.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-seccomp-filter-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-seccomp-strict.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-securebits.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-spec-inject.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-tid_address.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-tsc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv-preadv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv2-pwritev2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv_pwritev-preadv-pwritev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print_maxfd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printpath-umovestr-peekdata.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printpath-umovestr-undumpable.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printpath-umovestr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printsignal-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printsignal-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printsignal-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printstr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printstrn-umoven-peekdata.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printstrn-umoven-undumpable.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printstrn-umoven.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prlimit64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process_vm_readv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process_vm_writev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pselect6.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptrace.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptrace_syscall_info.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pwritev-pwritev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_fault.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-error-signal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-retval.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-signal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_signal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-success-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-success.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs-success-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs-success.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read-write.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readahead.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readdir.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlinkat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reboot.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvfrom.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvmmsg-timeout.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/redirect-fds.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remap_file_pages-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remap_file_pages-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remap_file_pages-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remap_file_pages.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rename.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renameat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renameat2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/request_key.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/restart_syscall.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/riscv_flush_icache.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rmdir.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigaction.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigpending.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigprocmask.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigqueueinfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigreturn.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigsuspend.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigtimedwait.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_tgsigqueueinfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run_expect_termsig.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s390_guarded_storage-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s390_guarded_storage.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s390_pci_mmio_read_write.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s390_runtime_instr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s390_sthyi-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s390_sthyi.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_get_priority_mxx.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_rr_get_interval.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetaffinity.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetattr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetparam.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetscheduler.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_yield.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scm_rights.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-filter-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-filter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-strict.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp_get_action_avail.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select-P.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/semop.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendfile.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendfile64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_mempolicy.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_ptracer_any.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_sigblock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_sigign.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setdomainname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsgid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsgid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsuid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgroups.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgroups32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sethostname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setns.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setregid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setregid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresgid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresgid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresuid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setreuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setreuid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setrlimit-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setrlimit-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setrlimit-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setrlimit.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setuid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shmxt.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shutdown.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaction.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaltstack.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siginfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal_receive.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signalfd4.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigpending.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigprocmask.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigreturn.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigsuspend.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sleep.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/so_error.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/so_linger.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/so_peercred-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/so_peercred-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/so_peercred-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/so_peercred.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sock_filter-v-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sock_filter-v-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sock_filter-v-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sock_filter-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockaddr_xlat-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockaddr_xlat-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockaddr_xlat-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socketcall.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockopt-sol_netlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockopt-timestamp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/splice.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-0.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-1.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-3.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled-0.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled-1.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled-2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled-3.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat64-stat64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statfs-statfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statfs64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statx.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sxetmask.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlinkat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync_file_range.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync_file_range2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysinfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syslog.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tee.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threads-execve.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer_create.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer_xettime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timerfd_xettime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/times-fail.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/times.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/truncate.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/truncate64-truncate64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ugetrlimit.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uio-uio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umask.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umount.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umount2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umoven-illptr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr-illptr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr3.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unblock_reset_raise.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix-pair-send-recv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix-pair-sendto-recvfrom.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlinkat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unshare.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/userfaultfd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ustat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimensat-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimensat-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimensat-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimensat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimes.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfork-f.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vhangup.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmsplice.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait4-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait4.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitid-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitpid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xattr-strings.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xattr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xet_robust_list.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xet_thread_area_x86.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetitimer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetpgid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetpriority.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xettimeofday.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zeroargc.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -4869,6 +8286,20 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +libtests_a-create_nl_socket.o: create_nl_socket.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-create_nl_socket.o -MD -MP -MF $(DEPDIR)/libtests_a-create_nl_socket.Tpo -c -o libtests_a-create_nl_socket.o `test -f 'create_nl_socket.c' || echo '$(srcdir)/'`create_nl_socket.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-create_nl_socket.Tpo $(DEPDIR)/libtests_a-create_nl_socket.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='create_nl_socket.c' object='libtests_a-create_nl_socket.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-create_nl_socket.o `test -f 'create_nl_socket.c' || echo '$(srcdir)/'`create_nl_socket.c + +libtests_a-create_nl_socket.obj: create_nl_socket.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-create_nl_socket.obj -MD -MP -MF $(DEPDIR)/libtests_a-create_nl_socket.Tpo -c -o libtests_a-create_nl_socket.obj `if test -f 'create_nl_socket.c'; then $(CYGPATH_W) 'create_nl_socket.c'; else $(CYGPATH_W) '$(srcdir)/create_nl_socket.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-create_nl_socket.Tpo $(DEPDIR)/libtests_a-create_nl_socket.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='create_nl_socket.c' object='libtests_a-create_nl_socket.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-create_nl_socket.obj `if test -f 'create_nl_socket.c'; then $(CYGPATH_W) 'create_nl_socket.c'; else $(CYGPATH_W) '$(srcdir)/create_nl_socket.c'; fi` + libtests_a-errno2name.o: errno2name.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-errno2name.o -MD -MP -MF $(DEPDIR)/libtests_a-errno2name.Tpo -c -o libtests_a-errno2name.o `test -f 'errno2name.c' || echo '$(srcdir)/'`errno2name.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-errno2name.Tpo $(DEPDIR)/libtests_a-errno2name.Po @@ -4925,6 +8356,20 @@ libtests_a-get_page_size.obj: get_page_size.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-get_page_size.obj `if test -f 'get_page_size.c'; then $(CYGPATH_W) 'get_page_size.c'; else $(CYGPATH_W) '$(srcdir)/get_page_size.c'; fi` +libtests_a-get_sigset_size.o: get_sigset_size.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-get_sigset_size.o -MD -MP -MF $(DEPDIR)/libtests_a-get_sigset_size.Tpo -c -o libtests_a-get_sigset_size.o `test -f 'get_sigset_size.c' || echo '$(srcdir)/'`get_sigset_size.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-get_sigset_size.Tpo $(DEPDIR)/libtests_a-get_sigset_size.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='get_sigset_size.c' object='libtests_a-get_sigset_size.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-get_sigset_size.o `test -f 'get_sigset_size.c' || echo '$(srcdir)/'`get_sigset_size.c + +libtests_a-get_sigset_size.obj: get_sigset_size.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-get_sigset_size.obj -MD -MP -MF $(DEPDIR)/libtests_a-get_sigset_size.Tpo -c -o libtests_a-get_sigset_size.obj `if test -f 'get_sigset_size.c'; then $(CYGPATH_W) 'get_sigset_size.c'; else $(CYGPATH_W) '$(srcdir)/get_sigset_size.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-get_sigset_size.Tpo $(DEPDIR)/libtests_a-get_sigset_size.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='get_sigset_size.c' object='libtests_a-get_sigset_size.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-get_sigset_size.obj `if test -f 'get_sigset_size.c'; then $(CYGPATH_W) 'get_sigset_size.c'; else $(CYGPATH_W) '$(srcdir)/get_sigset_size.c'; fi` + libtests_a-hexdump_strdup.o: hexdump_strdup.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-hexdump_strdup.o -MD -MP -MF $(DEPDIR)/libtests_a-hexdump_strdup.Tpo -c -o libtests_a-hexdump_strdup.o `test -f 'hexdump_strdup.c' || echo '$(srcdir)/'`hexdump_strdup.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-hexdump_strdup.Tpo $(DEPDIR)/libtests_a-hexdump_strdup.Po @@ -4953,6 +8398,20 @@ libtests_a-hexquote_strndup.obj: hexquote_strndup.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-hexquote_strndup.obj `if test -f 'hexquote_strndup.c'; then $(CYGPATH_W) 'hexquote_strndup.c'; else $(CYGPATH_W) '$(srcdir)/hexquote_strndup.c'; fi` +libtests_a-ifindex.o: ifindex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-ifindex.o -MD -MP -MF $(DEPDIR)/libtests_a-ifindex.Tpo -c -o libtests_a-ifindex.o `test -f 'ifindex.c' || echo '$(srcdir)/'`ifindex.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-ifindex.Tpo $(DEPDIR)/libtests_a-ifindex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ifindex.c' object='libtests_a-ifindex.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-ifindex.o `test -f 'ifindex.c' || echo '$(srcdir)/'`ifindex.c + +libtests_a-ifindex.obj: ifindex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-ifindex.obj -MD -MP -MF $(DEPDIR)/libtests_a-ifindex.Tpo -c -o libtests_a-ifindex.obj `if test -f 'ifindex.c'; then $(CYGPATH_W) 'ifindex.c'; else $(CYGPATH_W) '$(srcdir)/ifindex.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-ifindex.Tpo $(DEPDIR)/libtests_a-ifindex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ifindex.c' object='libtests_a-ifindex.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-ifindex.obj `if test -f 'ifindex.c'; then $(CYGPATH_W) 'ifindex.c'; else $(CYGPATH_W) '$(srcdir)/ifindex.c'; fi` + libtests_a-inode_of_sockfd.o: inode_of_sockfd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-inode_of_sockfd.o -MD -MP -MF $(DEPDIR)/libtests_a-inode_of_sockfd.Tpo -c -o libtests_a-inode_of_sockfd.o `test -f 'inode_of_sockfd.c' || echo '$(srcdir)/'`inode_of_sockfd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-inode_of_sockfd.Tpo $(DEPDIR)/libtests_a-inode_of_sockfd.Po @@ -5037,6 +8496,20 @@ libtests_a-print_quoted_string.obj: print_quoted_string.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-print_quoted_string.obj `if test -f 'print_quoted_string.c'; then $(CYGPATH_W) 'print_quoted_string.c'; else $(CYGPATH_W) '$(srcdir)/print_quoted_string.c'; fi` +libtests_a-print_time.o: print_time.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-print_time.o -MD -MP -MF $(DEPDIR)/libtests_a-print_time.Tpo -c -o libtests_a-print_time.o `test -f 'print_time.c' || echo '$(srcdir)/'`print_time.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-print_time.Tpo $(DEPDIR)/libtests_a-print_time.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_time.c' object='libtests_a-print_time.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-print_time.o `test -f 'print_time.c' || echo '$(srcdir)/'`print_time.c + +libtests_a-print_time.obj: print_time.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-print_time.obj -MD -MP -MF $(DEPDIR)/libtests_a-print_time.Tpo -c -o libtests_a-print_time.obj `if test -f 'print_time.c'; then $(CYGPATH_W) 'print_time.c'; else $(CYGPATH_W) '$(srcdir)/print_time.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-print_time.Tpo $(DEPDIR)/libtests_a-print_time.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_time.c' object='libtests_a-print_time.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-print_time.obj `if test -f 'print_time.c'; then $(CYGPATH_W) 'print_time.c'; else $(CYGPATH_W) '$(srcdir)/print_time.c'; fi` + libtests_a-printflags.o: printflags.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-printflags.o -MD -MP -MF $(DEPDIR)/libtests_a-printflags.Tpo -c -o libtests_a-printflags.o `test -f 'printflags.c' || echo '$(srcdir)/'`printflags.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-printflags.Tpo $(DEPDIR)/libtests_a-printflags.Po @@ -5079,6 +8552,20 @@ libtests_a-signal2name.obj: signal2name.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-signal2name.obj `if test -f 'signal2name.c'; then $(CYGPATH_W) 'signal2name.c'; else $(CYGPATH_W) '$(srcdir)/signal2name.c'; fi` +libtests_a-skip_unavailable.o: skip_unavailable.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-skip_unavailable.o -MD -MP -MF $(DEPDIR)/libtests_a-skip_unavailable.Tpo -c -o libtests_a-skip_unavailable.o `test -f 'skip_unavailable.c' || echo '$(srcdir)/'`skip_unavailable.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-skip_unavailable.Tpo $(DEPDIR)/libtests_a-skip_unavailable.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='skip_unavailable.c' object='libtests_a-skip_unavailable.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-skip_unavailable.o `test -f 'skip_unavailable.c' || echo '$(srcdir)/'`skip_unavailable.c + +libtests_a-skip_unavailable.obj: skip_unavailable.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-skip_unavailable.obj -MD -MP -MF $(DEPDIR)/libtests_a-skip_unavailable.Tpo -c -o libtests_a-skip_unavailable.obj `if test -f 'skip_unavailable.c'; then $(CYGPATH_W) 'skip_unavailable.c'; else $(CYGPATH_W) '$(srcdir)/skip_unavailable.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-skip_unavailable.Tpo $(DEPDIR)/libtests_a-skip_unavailable.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='skip_unavailable.c' object='libtests_a-skip_unavailable.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-skip_unavailable.obj `if test -f 'skip_unavailable.c'; then $(CYGPATH_W) 'skip_unavailable.c'; else $(CYGPATH_W) '$(srcdir)/skip_unavailable.c'; fi` + libtests_a-sprintrc.o: sprintrc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-sprintrc.o -MD -MP -MF $(DEPDIR)/libtests_a-sprintrc.Tpo -c -o libtests_a-sprintrc.o `test -f 'sprintrc.c' || echo '$(srcdir)/'`sprintrc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-sprintrc.Tpo $(DEPDIR)/libtests_a-sprintrc.Po @@ -5107,6 +8594,48 @@ libtests_a-tail_alloc.obj: tail_alloc.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-tail_alloc.obj `if test -f 'tail_alloc.c'; then $(CYGPATH_W) 'tail_alloc.c'; else $(CYGPATH_W) '$(srcdir)/tail_alloc.c'; fi` +libtests_a-test_printpath.o: test_printpath.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-test_printpath.o -MD -MP -MF $(DEPDIR)/libtests_a-test_printpath.Tpo -c -o libtests_a-test_printpath.o `test -f 'test_printpath.c' || echo '$(srcdir)/'`test_printpath.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-test_printpath.Tpo $(DEPDIR)/libtests_a-test_printpath.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_printpath.c' object='libtests_a-test_printpath.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-test_printpath.o `test -f 'test_printpath.c' || echo '$(srcdir)/'`test_printpath.c + +libtests_a-test_printpath.obj: test_printpath.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-test_printpath.obj -MD -MP -MF $(DEPDIR)/libtests_a-test_printpath.Tpo -c -o libtests_a-test_printpath.obj `if test -f 'test_printpath.c'; then $(CYGPATH_W) 'test_printpath.c'; else $(CYGPATH_W) '$(srcdir)/test_printpath.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-test_printpath.Tpo $(DEPDIR)/libtests_a-test_printpath.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_printpath.c' object='libtests_a-test_printpath.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-test_printpath.obj `if test -f 'test_printpath.c'; then $(CYGPATH_W) 'test_printpath.c'; else $(CYGPATH_W) '$(srcdir)/test_printpath.c'; fi` + +libtests_a-test_printstrn.o: test_printstrn.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-test_printstrn.o -MD -MP -MF $(DEPDIR)/libtests_a-test_printstrn.Tpo -c -o libtests_a-test_printstrn.o `test -f 'test_printstrn.c' || echo '$(srcdir)/'`test_printstrn.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-test_printstrn.Tpo $(DEPDIR)/libtests_a-test_printstrn.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_printstrn.c' object='libtests_a-test_printstrn.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-test_printstrn.o `test -f 'test_printstrn.c' || echo '$(srcdir)/'`test_printstrn.c + +libtests_a-test_printstrn.obj: test_printstrn.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-test_printstrn.obj -MD -MP -MF $(DEPDIR)/libtests_a-test_printstrn.Tpo -c -o libtests_a-test_printstrn.obj `if test -f 'test_printstrn.c'; then $(CYGPATH_W) 'test_printstrn.c'; else $(CYGPATH_W) '$(srcdir)/test_printstrn.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-test_printstrn.Tpo $(DEPDIR)/libtests_a-test_printstrn.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_printstrn.c' object='libtests_a-test_printstrn.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-test_printstrn.obj `if test -f 'test_printstrn.c'; then $(CYGPATH_W) 'test_printstrn.c'; else $(CYGPATH_W) '$(srcdir)/test_printstrn.c'; fi` + +libtests_a-test_ucopy.o: test_ucopy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-test_ucopy.o -MD -MP -MF $(DEPDIR)/libtests_a-test_ucopy.Tpo -c -o libtests_a-test_ucopy.o `test -f 'test_ucopy.c' || echo '$(srcdir)/'`test_ucopy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-test_ucopy.Tpo $(DEPDIR)/libtests_a-test_ucopy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_ucopy.c' object='libtests_a-test_ucopy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-test_ucopy.o `test -f 'test_ucopy.c' || echo '$(srcdir)/'`test_ucopy.c + +libtests_a-test_ucopy.obj: test_ucopy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-test_ucopy.obj -MD -MP -MF $(DEPDIR)/libtests_a-test_ucopy.Tpo -c -o libtests_a-test_ucopy.obj `if test -f 'test_ucopy.c'; then $(CYGPATH_W) 'test_ucopy.c'; else $(CYGPATH_W) '$(srcdir)/test_ucopy.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-test_ucopy.Tpo $(DEPDIR)/libtests_a-test_ucopy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_ucopy.c' object='libtests_a-test_ucopy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-test_ucopy.obj `if test -f 'test_ucopy.c'; then $(CYGPATH_W) 'test_ucopy.c'; else $(CYGPATH_W) '$(srcdir)/test_ucopy.c'; fi` + libtests_a-tprintf.o: tprintf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-tprintf.o -MD -MP -MF $(DEPDIR)/libtests_a-tprintf.Tpo -c -o libtests_a-tprintf.o `test -f 'tprintf.c' || echo '$(srcdir)/'`tprintf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-tprintf.Tpo $(DEPDIR)/libtests_a-tprintf.Po @@ -5191,6 +8720,48 @@ mmap64-mmap64.obj: mmap64.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64-mmap64.obj `if test -f 'mmap64.c'; then $(CYGPATH_W) 'mmap64.c'; else $(CYGPATH_W) '$(srcdir)/mmap64.c'; fi` +mmap64_Xabbrev-mmap64-Xabbrev.o: mmap64-Xabbrev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xabbrev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64_Xabbrev-mmap64-Xabbrev.o -MD -MP -MF $(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Tpo -c -o mmap64_Xabbrev-mmap64-Xabbrev.o `test -f 'mmap64-Xabbrev.c' || echo '$(srcdir)/'`mmap64-Xabbrev.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Tpo $(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64-Xabbrev.c' object='mmap64_Xabbrev-mmap64-Xabbrev.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xabbrev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64_Xabbrev-mmap64-Xabbrev.o `test -f 'mmap64-Xabbrev.c' || echo '$(srcdir)/'`mmap64-Xabbrev.c + +mmap64_Xabbrev-mmap64-Xabbrev.obj: mmap64-Xabbrev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xabbrev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64_Xabbrev-mmap64-Xabbrev.obj -MD -MP -MF $(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Tpo -c -o mmap64_Xabbrev-mmap64-Xabbrev.obj `if test -f 'mmap64-Xabbrev.c'; then $(CYGPATH_W) 'mmap64-Xabbrev.c'; else $(CYGPATH_W) '$(srcdir)/mmap64-Xabbrev.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Tpo $(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64-Xabbrev.c' object='mmap64_Xabbrev-mmap64-Xabbrev.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xabbrev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64_Xabbrev-mmap64-Xabbrev.obj `if test -f 'mmap64-Xabbrev.c'; then $(CYGPATH_W) 'mmap64-Xabbrev.c'; else $(CYGPATH_W) '$(srcdir)/mmap64-Xabbrev.c'; fi` + +mmap64_Xraw-mmap64-Xraw.o: mmap64-Xraw.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xraw_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64_Xraw-mmap64-Xraw.o -MD -MP -MF $(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Tpo -c -o mmap64_Xraw-mmap64-Xraw.o `test -f 'mmap64-Xraw.c' || echo '$(srcdir)/'`mmap64-Xraw.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Tpo $(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64-Xraw.c' object='mmap64_Xraw-mmap64-Xraw.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xraw_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64_Xraw-mmap64-Xraw.o `test -f 'mmap64-Xraw.c' || echo '$(srcdir)/'`mmap64-Xraw.c + +mmap64_Xraw-mmap64-Xraw.obj: mmap64-Xraw.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xraw_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64_Xraw-mmap64-Xraw.obj -MD -MP -MF $(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Tpo -c -o mmap64_Xraw-mmap64-Xraw.obj `if test -f 'mmap64-Xraw.c'; then $(CYGPATH_W) 'mmap64-Xraw.c'; else $(CYGPATH_W) '$(srcdir)/mmap64-Xraw.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Tpo $(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64-Xraw.c' object='mmap64_Xraw-mmap64-Xraw.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xraw_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64_Xraw-mmap64-Xraw.obj `if test -f 'mmap64-Xraw.c'; then $(CYGPATH_W) 'mmap64-Xraw.c'; else $(CYGPATH_W) '$(srcdir)/mmap64-Xraw.c'; fi` + +mmap64_Xverbose-mmap64-Xverbose.o: mmap64-Xverbose.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xverbose_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64_Xverbose-mmap64-Xverbose.o -MD -MP -MF $(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Tpo -c -o mmap64_Xverbose-mmap64-Xverbose.o `test -f 'mmap64-Xverbose.c' || echo '$(srcdir)/'`mmap64-Xverbose.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Tpo $(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64-Xverbose.c' object='mmap64_Xverbose-mmap64-Xverbose.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xverbose_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64_Xverbose-mmap64-Xverbose.o `test -f 'mmap64-Xverbose.c' || echo '$(srcdir)/'`mmap64-Xverbose.c + +mmap64_Xverbose-mmap64-Xverbose.obj: mmap64-Xverbose.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xverbose_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64_Xverbose-mmap64-Xverbose.obj -MD -MP -MF $(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Tpo -c -o mmap64_Xverbose-mmap64-Xverbose.obj `if test -f 'mmap64-Xverbose.c'; then $(CYGPATH_W) 'mmap64-Xverbose.c'; else $(CYGPATH_W) '$(srcdir)/mmap64-Xverbose.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Tpo $(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64-Xverbose.c' object='mmap64_Xverbose-mmap64-Xverbose.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xverbose_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64_Xverbose-mmap64-Xverbose.obj `if test -f 'mmap64-Xverbose.c'; then $(CYGPATH_W) 'mmap64-Xverbose.c'; else $(CYGPATH_W) '$(srcdir)/mmap64-Xverbose.c'; fi` + newfstatat-newfstatat.o: newfstatat.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(newfstatat_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT newfstatat-newfstatat.o -MD -MP -MF $(DEPDIR)/newfstatat-newfstatat.Tpo -c -o newfstatat-newfstatat.o `test -f 'newfstatat.c' || echo '$(srcdir)/'`newfstatat.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/newfstatat-newfstatat.Tpo $(DEPDIR)/newfstatat-newfstatat.Po @@ -5317,6 +8888,10 @@ uio-uio.obj: uio.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o uio-uio.obj `if test -f 'uio.c'; then $(CYGPATH_W) 'uio.c'; else $(CYGPATH_W) '$(srcdir)/uio.c'; fi` check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -5400,7 +8975,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ - else \ + elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ @@ -5490,7 +9065,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) fi; \ $$success || exit 1 -check-TESTS: +check-TESTS: $(check_PROGRAMS) $(check_LIBRARIES) @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @@ -5500,7 +9075,7 @@ check-TESTS: log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; -recheck: all $(check_LIBRARIES) $(check_PROGRAMS) +recheck: all $(check_PROGRAMS) $(check_LIBRARIES) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ @@ -5526,7 +9101,10 @@ recheck: all $(check_LIBRARIES) $(check_PROGRAMS) @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -5557,12 +9135,14 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) $(check_LIBRARIES) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_LIBRARIES) $(MAKE) $(AM_MAKEFLAGS) check-TESTS -check: check-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile installdirs: -install: install-am +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -5596,17 +9176,679 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) check-valgrind: check-valgrind-am check-valgrind-am: check-valgrind-local +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + clean: clean-am clean-am: clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \ - mostlyclean-am + clean-local mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/_newselect-P.Po + -rm -f ./$(DEPDIR)/_newselect.Po + -rm -f ./$(DEPDIR)/accept.Po + -rm -f ./$(DEPDIR)/accept4.Po + -rm -f ./$(DEPDIR)/access.Po + -rm -f ./$(DEPDIR)/acct.Po + -rm -f ./$(DEPDIR)/add_key.Po + -rm -f ./$(DEPDIR)/adjtimex.Po + -rm -f ./$(DEPDIR)/aio.Po + -rm -f ./$(DEPDIR)/aio_pgetevents.Po + -rm -f ./$(DEPDIR)/alarm.Po + -rm -f ./$(DEPDIR)/answer.Po + -rm -f ./$(DEPDIR)/attach-f-p-cmd.Po + -rm -f ./$(DEPDIR)/attach-f-p.Po + -rm -f ./$(DEPDIR)/attach-p-cmd-cmd.Po + -rm -f ./$(DEPDIR)/attach-p-cmd-p.Po + -rm -f ./$(DEPDIR)/block_reset_raise_run.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd-prog-v.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd-prog.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd-v.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd.Po + -rm -f ./$(DEPDIR)/bpf-success-v.Po + -rm -f ./$(DEPDIR)/bpf-success.Po + -rm -f ./$(DEPDIR)/bpf-v.Po + -rm -f ./$(DEPDIR)/bpf.Po + -rm -f ./$(DEPDIR)/brk.Po + -rm -f ./$(DEPDIR)/btrfs.Po + -rm -f ./$(DEPDIR)/caps-abbrev.Po + -rm -f ./$(DEPDIR)/caps.Po + -rm -f ./$(DEPDIR)/check_sigblock.Po + -rm -f ./$(DEPDIR)/check_sigign.Po + -rm -f ./$(DEPDIR)/chmod.Po + -rm -f ./$(DEPDIR)/chown.Po + -rm -f ./$(DEPDIR)/chown32.Po + -rm -f ./$(DEPDIR)/chroot.Po + -rm -f ./$(DEPDIR)/clock_adjtime.Po + -rm -f ./$(DEPDIR)/clock_nanosleep.Po + -rm -f ./$(DEPDIR)/clock_xettime.Po + -rm -f ./$(DEPDIR)/clone_parent.Po + -rm -f ./$(DEPDIR)/clone_ptrace.Po + -rm -f ./$(DEPDIR)/copy_file_range.Po + -rm -f ./$(DEPDIR)/count-f.Po + -rm -f ./$(DEPDIR)/creat.Po + -rm -f ./$(DEPDIR)/delay.Po + -rm -f ./$(DEPDIR)/delete_module.Po + -rm -f ./$(DEPDIR)/dev-yy.Po + -rm -f ./$(DEPDIR)/dup.Po + -rm -f ./$(DEPDIR)/dup2.Po + -rm -f ./$(DEPDIR)/dup3.Po + -rm -f ./$(DEPDIR)/epoll_create.Po + -rm -f ./$(DEPDIR)/epoll_create1.Po + -rm -f ./$(DEPDIR)/epoll_ctl.Po + -rm -f ./$(DEPDIR)/epoll_pwait.Po + -rm -f ./$(DEPDIR)/epoll_wait.Po + -rm -f ./$(DEPDIR)/erestartsys.Po + -rm -f ./$(DEPDIR)/eventfd.Po + -rm -f ./$(DEPDIR)/execve-v.Po + -rm -f ./$(DEPDIR)/execve.Po + -rm -f ./$(DEPDIR)/execveat-v.Po + -rm -f ./$(DEPDIR)/execveat.Po + -rm -f ./$(DEPDIR)/faccessat.Po + -rm -f ./$(DEPDIR)/fadvise64.Po + -rm -f ./$(DEPDIR)/fadvise64_64.Po + -rm -f ./$(DEPDIR)/fallocate.Po + -rm -f ./$(DEPDIR)/fanotify_init.Po + -rm -f ./$(DEPDIR)/fanotify_mark-Xabbrev.Po + -rm -f ./$(DEPDIR)/fanotify_mark-Xraw.Po + -rm -f ./$(DEPDIR)/fanotify_mark-Xverbose.Po + -rm -f ./$(DEPDIR)/fanotify_mark.Po + -rm -f ./$(DEPDIR)/fchdir.Po + -rm -f ./$(DEPDIR)/fchmod.Po + -rm -f ./$(DEPDIR)/fchmodat.Po + -rm -f ./$(DEPDIR)/fchown.Po + -rm -f ./$(DEPDIR)/fchown32.Po + -rm -f ./$(DEPDIR)/fchownat.Po + -rm -f ./$(DEPDIR)/fcntl.Po + -rm -f ./$(DEPDIR)/fcntl64.Po + -rm -f ./$(DEPDIR)/fdatasync.Po + -rm -f ./$(DEPDIR)/fflush.Po + -rm -f ./$(DEPDIR)/file_handle.Po + -rm -f ./$(DEPDIR)/file_ioctl.Po + -rm -f ./$(DEPDIR)/filter-unavailable.Po + -rm -f ./$(DEPDIR)/finit_module.Po + -rm -f ./$(DEPDIR)/flock.Po + -rm -f ./$(DEPDIR)/fork-f.Po + -rm -f ./$(DEPDIR)/fstat-Xabbrev.Po + -rm -f ./$(DEPDIR)/fstat-Xraw.Po + -rm -f ./$(DEPDIR)/fstat-Xverbose.Po + -rm -f ./$(DEPDIR)/fstat.Po + -rm -f ./$(DEPDIR)/fstat64-Xabbrev.Po + -rm -f ./$(DEPDIR)/fstat64-Xraw.Po + -rm -f ./$(DEPDIR)/fstat64-Xverbose.Po + -rm -f ./$(DEPDIR)/fstat64-fstat64.Po + -rm -f ./$(DEPDIR)/fstatat64-fstatat64.Po + -rm -f ./$(DEPDIR)/fstatfs.Po + -rm -f ./$(DEPDIR)/fstatfs64.Po + -rm -f ./$(DEPDIR)/fsync-y.Po + -rm -f ./$(DEPDIR)/fsync.Po + -rm -f ./$(DEPDIR)/ftruncate.Po + -rm -f ./$(DEPDIR)/ftruncate64-ftruncate64.Po + -rm -f ./$(DEPDIR)/futex.Po + -rm -f ./$(DEPDIR)/futimesat.Po + -rm -f ./$(DEPDIR)/get_mempolicy.Po + -rm -f ./$(DEPDIR)/getcpu.Po + -rm -f ./$(DEPDIR)/getcwd.Po + -rm -f ./$(DEPDIR)/getdents.Po + -rm -f ./$(DEPDIR)/getdents64.Po + -rm -f ./$(DEPDIR)/getegid.Po + -rm -f ./$(DEPDIR)/getegid32.Po + -rm -f ./$(DEPDIR)/geteuid.Po + -rm -f ./$(DEPDIR)/geteuid32.Po + -rm -f ./$(DEPDIR)/getgid.Po + -rm -f ./$(DEPDIR)/getgid32.Po + -rm -f ./$(DEPDIR)/getgroups.Po + -rm -f ./$(DEPDIR)/getgroups32.Po + -rm -f ./$(DEPDIR)/getpeername.Po + -rm -f ./$(DEPDIR)/getpgrp.Po + -rm -f ./$(DEPDIR)/getpid.Po + -rm -f ./$(DEPDIR)/getppid.Po + -rm -f ./$(DEPDIR)/getrandom.Po + -rm -f ./$(DEPDIR)/getresgid.Po + -rm -f ./$(DEPDIR)/getresgid32.Po + -rm -f ./$(DEPDIR)/getresuid.Po + -rm -f ./$(DEPDIR)/getresuid32.Po + -rm -f ./$(DEPDIR)/getrlimit.Po + -rm -f ./$(DEPDIR)/getrusage.Po + -rm -f ./$(DEPDIR)/getsid.Po + -rm -f ./$(DEPDIR)/getsockname.Po + -rm -f ./$(DEPDIR)/gettid.Po + -rm -f ./$(DEPDIR)/getuid.Po + -rm -f ./$(DEPDIR)/getuid32.Po + -rm -f ./$(DEPDIR)/getxxid.Po + -rm -f ./$(DEPDIR)/group_req.Po + -rm -f ./$(DEPDIR)/inet-cmsg.Po + -rm -f ./$(DEPDIR)/init_module.Po + -rm -f ./$(DEPDIR)/inject-nf.Po + -rm -f ./$(DEPDIR)/inotify.Po + -rm -f ./$(DEPDIR)/inotify_init1.Po + -rm -f ./$(DEPDIR)/int_0x80.Po + -rm -f ./$(DEPDIR)/io_uring_enter.Po + -rm -f ./$(DEPDIR)/io_uring_register.Po + -rm -f ./$(DEPDIR)/io_uring_setup.Po + -rm -f ./$(DEPDIR)/ioctl.Po + -rm -f ./$(DEPDIR)/ioctl_block.Po + -rm -f ./$(DEPDIR)/ioctl_dm-v.Po + -rm -f ./$(DEPDIR)/ioctl_dm.Po + -rm -f ./$(DEPDIR)/ioctl_evdev-success-v.Po + -rm -f ./$(DEPDIR)/ioctl_evdev-success.Po + -rm -f ./$(DEPDIR)/ioctl_evdev-v.Po + -rm -f ./$(DEPDIR)/ioctl_evdev.Po + -rm -f ./$(DEPDIR)/ioctl_inotify.Po + -rm -f ./$(DEPDIR)/ioctl_kvm_run-v.Po + -rm -f ./$(DEPDIR)/ioctl_kvm_run.Po + -rm -f ./$(DEPDIR)/ioctl_kvm_run_auxstr_vcpu.Po + -rm -f ./$(DEPDIR)/ioctl_loop-nv.Po + -rm -f ./$(DEPDIR)/ioctl_loop-v.Po + -rm -f ./$(DEPDIR)/ioctl_loop.Po + -rm -f ./$(DEPDIR)/ioctl_mtd.Po + -rm -f ./$(DEPDIR)/ioctl_nbd.Po + -rm -f ./$(DEPDIR)/ioctl_nsfs.Po + -rm -f ./$(DEPDIR)/ioctl_perf-success.Po + -rm -f ./$(DEPDIR)/ioctl_perf.Po + -rm -f ./$(DEPDIR)/ioctl_ptp.Po + -rm -f ./$(DEPDIR)/ioctl_random.Po + -rm -f ./$(DEPDIR)/ioctl_rtc-v.Po + -rm -f ./$(DEPDIR)/ioctl_rtc.Po + -rm -f ./$(DEPDIR)/ioctl_scsi.Po + -rm -f ./$(DEPDIR)/ioctl_sg_io_v3.Po + -rm -f ./$(DEPDIR)/ioctl_sg_io_v4.Po + -rm -f ./$(DEPDIR)/ioctl_sock_gifconf.Po + -rm -f ./$(DEPDIR)/ioctl_uffdio.Po + -rm -f ./$(DEPDIR)/ioctl_v4l2.Po + -rm -f ./$(DEPDIR)/ioperm.Po + -rm -f ./$(DEPDIR)/iopl.Po + -rm -f ./$(DEPDIR)/ioprio-Xabbrev.Po + -rm -f ./$(DEPDIR)/ioprio-Xraw.Po + -rm -f ./$(DEPDIR)/ioprio-Xverbose.Po + -rm -f ./$(DEPDIR)/ioprio.Po + -rm -f ./$(DEPDIR)/ip_mreq.Po + -rm -f ./$(DEPDIR)/ipc.Po + -rm -f ./$(DEPDIR)/ipc_msg-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_msg-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_msg-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_msg.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf.Po + -rm -f ./$(DEPDIR)/ipc_sem-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_sem-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_sem-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_sem.Po + -rm -f ./$(DEPDIR)/ipc_shm-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_shm-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_shm-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_shm.Po + -rm -f ./$(DEPDIR)/is_linux_mips_n64.Po + -rm -f ./$(DEPDIR)/kcmp-y.Po + -rm -f ./$(DEPDIR)/kcmp.Po + -rm -f ./$(DEPDIR)/kern_features.Po + -rm -f ./$(DEPDIR)/kernel_version-Xabbrev.Po + -rm -f ./$(DEPDIR)/kernel_version-Xraw.Po + -rm -f ./$(DEPDIR)/kernel_version-Xverbose.Po + -rm -f ./$(DEPDIR)/kernel_version.Po + -rm -f ./$(DEPDIR)/kexec_file_load.Po + -rm -f ./$(DEPDIR)/kexec_load.Po + -rm -f ./$(DEPDIR)/keyctl-Xabbrev.Po + -rm -f ./$(DEPDIR)/keyctl-Xraw.Po + -rm -f ./$(DEPDIR)/keyctl-Xverbose.Po + -rm -f ./$(DEPDIR)/keyctl.Po + -rm -f ./$(DEPDIR)/kill.Po + -rm -f ./$(DEPDIR)/kill_child.Po + -rm -f ./$(DEPDIR)/ksysent.Po + -rm -f ./$(DEPDIR)/lchown.Po + -rm -f ./$(DEPDIR)/lchown32.Po + -rm -f ./$(DEPDIR)/libtests_a-create_nl_socket.Po + -rm -f ./$(DEPDIR)/libtests_a-errno2name.Po + -rm -f ./$(DEPDIR)/libtests_a-error_msg.Po + -rm -f ./$(DEPDIR)/libtests_a-fill_memory.Po + -rm -f ./$(DEPDIR)/libtests_a-get_page_size.Po + -rm -f ./$(DEPDIR)/libtests_a-get_sigset_size.Po + -rm -f ./$(DEPDIR)/libtests_a-hexdump_strdup.Po + -rm -f ./$(DEPDIR)/libtests_a-hexquote_strndup.Po + -rm -f ./$(DEPDIR)/libtests_a-ifindex.Po + -rm -f ./$(DEPDIR)/libtests_a-inode_of_sockfd.Po + -rm -f ./$(DEPDIR)/libtests_a-libmmsg.Po + -rm -f ./$(DEPDIR)/libtests_a-libsocketcall.Po + -rm -f ./$(DEPDIR)/libtests_a-overflowuid.Po + -rm -f ./$(DEPDIR)/libtests_a-pipe_maxfd.Po + -rm -f ./$(DEPDIR)/libtests_a-print_quoted_string.Po + -rm -f ./$(DEPDIR)/libtests_a-print_time.Po + -rm -f ./$(DEPDIR)/libtests_a-printflags.Po + -rm -f ./$(DEPDIR)/libtests_a-printxval.Po + -rm -f ./$(DEPDIR)/libtests_a-signal2name.Po + -rm -f ./$(DEPDIR)/libtests_a-skip_unavailable.Po + -rm -f ./$(DEPDIR)/libtests_a-sprintrc.Po + -rm -f ./$(DEPDIR)/libtests_a-tail_alloc.Po + -rm -f ./$(DEPDIR)/libtests_a-test_printpath.Po + -rm -f ./$(DEPDIR)/libtests_a-test_printstrn.Po + -rm -f ./$(DEPDIR)/libtests_a-test_ucopy.Po + -rm -f ./$(DEPDIR)/libtests_a-tprintf.Po + -rm -f ./$(DEPDIR)/link.Po + -rm -f ./$(DEPDIR)/linkat.Po + -rm -f ./$(DEPDIR)/list_sigaction_signum.Po + -rm -f ./$(DEPDIR)/llseek.Po + -rm -f ./$(DEPDIR)/localtime.Po + -rm -f ./$(DEPDIR)/lookup_dcookie.Po + -rm -f ./$(DEPDIR)/looping_threads.Po + -rm -f ./$(DEPDIR)/lseek.Po + -rm -f ./$(DEPDIR)/lstat.Po + -rm -f ./$(DEPDIR)/lstat64-lstat64.Po + -rm -f ./$(DEPDIR)/madvise.Po + -rm -f ./$(DEPDIR)/mbind.Po + -rm -f ./$(DEPDIR)/membarrier.Po + -rm -f ./$(DEPDIR)/memfd_create-Xabbrev.Po + -rm -f ./$(DEPDIR)/memfd_create-Xraw.Po + -rm -f ./$(DEPDIR)/memfd_create-Xverbose.Po + -rm -f ./$(DEPDIR)/memfd_create.Po + -rm -f ./$(DEPDIR)/migrate_pages.Po + -rm -f ./$(DEPDIR)/mincore.Po + -rm -f ./$(DEPDIR)/mkdir.Po + -rm -f ./$(DEPDIR)/mkdirat.Po + -rm -f ./$(DEPDIR)/mknod.Po + -rm -f ./$(DEPDIR)/mknodat.Po + -rm -f ./$(DEPDIR)/mlock.Po + -rm -f ./$(DEPDIR)/mlock2.Po + -rm -f ./$(DEPDIR)/mlockall.Po + -rm -f ./$(DEPDIR)/mmap-Xabbrev.Po + -rm -f ./$(DEPDIR)/mmap-Xraw.Po + -rm -f ./$(DEPDIR)/mmap-Xverbose.Po + -rm -f ./$(DEPDIR)/mmap.Po + -rm -f ./$(DEPDIR)/mmap64-mmap64.Po + -rm -f ./$(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Po + -rm -f ./$(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Po + -rm -f ./$(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Po + -rm -f ./$(DEPDIR)/mmsg-silent.Po + -rm -f ./$(DEPDIR)/mmsg.Po + -rm -f ./$(DEPDIR)/mmsg_name-v.Po + -rm -f ./$(DEPDIR)/mmsg_name.Po + -rm -f ./$(DEPDIR)/modify_ldt.Po + -rm -f ./$(DEPDIR)/mount-Xabbrev.Po + -rm -f ./$(DEPDIR)/mount-Xraw.Po + -rm -f ./$(DEPDIR)/mount-Xverbose.Po + -rm -f ./$(DEPDIR)/mount.Po + -rm -f ./$(DEPDIR)/move_pages-Xabbrev.Po + -rm -f ./$(DEPDIR)/move_pages-Xraw.Po + -rm -f ./$(DEPDIR)/move_pages-Xverbose.Po + -rm -f ./$(DEPDIR)/move_pages.Po + -rm -f ./$(DEPDIR)/mq.Po + -rm -f ./$(DEPDIR)/mq_sendrecv-read.Po + -rm -f ./$(DEPDIR)/mq_sendrecv-write.Po + -rm -f ./$(DEPDIR)/mq_sendrecv.Po + -rm -f ./$(DEPDIR)/msg_control-v.Po + -rm -f ./$(DEPDIR)/msg_control.Po + -rm -f ./$(DEPDIR)/msg_name.Po + -rm -f ./$(DEPDIR)/munlockall.Po + -rm -f ./$(DEPDIR)/nanosleep.Po + -rm -f ./$(DEPDIR)/net-accept-connect.Po + -rm -f ./$(DEPDIR)/net-icmp_filter.Po + -rm -f ./$(DEPDIR)/net-packet_mreq-Xabbrev.Po + -rm -f ./$(DEPDIR)/net-packet_mreq-Xraw.Po + -rm -f ./$(DEPDIR)/net-packet_mreq-Xverbose.Po + -rm -f ./$(DEPDIR)/net-packet_mreq.Po + -rm -f ./$(DEPDIR)/net-sockaddr.Po + -rm -f ./$(DEPDIR)/net-tpacket_req.Po + -rm -f ./$(DEPDIR)/net-tpacket_stats-success.Po + -rm -f ./$(DEPDIR)/net-tpacket_stats.Po + -rm -f ./$(DEPDIR)/net-y-unix.Po + -rm -f ./$(DEPDIR)/net-yy-inet.Po + -rm -f ./$(DEPDIR)/net-yy-inet6.Po + -rm -f ./$(DEPDIR)/net-yy-netlink.Po + -rm -f ./$(DEPDIR)/net-yy-unix.Po + -rm -f ./$(DEPDIR)/netlink_audit.Po + -rm -f ./$(DEPDIR)/netlink_crypto.Po + -rm -f ./$(DEPDIR)/netlink_generic.Po + -rm -f ./$(DEPDIR)/netlink_inet_diag.Po + -rm -f ./$(DEPDIR)/netlink_kobject_uevent.Po + -rm -f ./$(DEPDIR)/netlink_netfilter.Po + -rm -f ./$(DEPDIR)/netlink_netlink_diag.Po + -rm -f ./$(DEPDIR)/netlink_protocol.Po + -rm -f ./$(DEPDIR)/netlink_route.Po + -rm -f ./$(DEPDIR)/netlink_selinux.Po + -rm -f ./$(DEPDIR)/netlink_sock_diag.Po + -rm -f ./$(DEPDIR)/netlink_unix_diag.Po + -rm -f ./$(DEPDIR)/netlink_xfrm.Po + -rm -f ./$(DEPDIR)/newfstatat-newfstatat.Po + -rm -f ./$(DEPDIR)/nfnetlink_acct.Po + -rm -f ./$(DEPDIR)/nfnetlink_cthelper.Po + -rm -f ./$(DEPDIR)/nfnetlink_ctnetlink.Po + -rm -f ./$(DEPDIR)/nfnetlink_ctnetlink_exp.Po + -rm -f ./$(DEPDIR)/nfnetlink_cttimeout.Po + -rm -f ./$(DEPDIR)/nfnetlink_ipset.Po + -rm -f ./$(DEPDIR)/nfnetlink_nft_compat.Po + -rm -f ./$(DEPDIR)/nfnetlink_nftables.Po + -rm -f ./$(DEPDIR)/nfnetlink_osf.Po + -rm -f ./$(DEPDIR)/nfnetlink_queue.Po + -rm -f ./$(DEPDIR)/nfnetlink_ulog.Po + -rm -f ./$(DEPDIR)/nlattr.Po + -rm -f ./$(DEPDIR)/nlattr_br_port_msg.Po + -rm -f ./$(DEPDIR)/nlattr_crypto_user_alg.Po + -rm -f ./$(DEPDIR)/nlattr_dcbmsg.Po + -rm -f ./$(DEPDIR)/nlattr_fib_rule_hdr.Po + -rm -f ./$(DEPDIR)/nlattr_ifaddrlblmsg.Po + -rm -f ./$(DEPDIR)/nlattr_ifaddrmsg.Po + -rm -f ./$(DEPDIR)/nlattr_ifinfomsg.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_af_spec.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_brport.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_linkinfo.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_port.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_xdp.Po + -rm -f ./$(DEPDIR)/nlattr_inet_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_inet_diag_req_compat.Po + -rm -f ./$(DEPDIR)/nlattr_inet_diag_req_v2.Po + -rm -f ./$(DEPDIR)/nlattr_mdba_mdb_entry.Po + -rm -f ./$(DEPDIR)/nlattr_mdba_router_port.Po + -rm -f ./$(DEPDIR)/nlattr_ndmsg.Po + -rm -f ./$(DEPDIR)/nlattr_ndtmsg.Po + -rm -f ./$(DEPDIR)/nlattr_netconfmsg.Po + -rm -f ./$(DEPDIR)/nlattr_netlink_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_nlmsgerr.Po + -rm -f ./$(DEPDIR)/nlattr_packet_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_rtgenmsg.Po + -rm -f ./$(DEPDIR)/nlattr_rtmsg.Po + -rm -f ./$(DEPDIR)/nlattr_smc_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_tc_stats.Po + -rm -f ./$(DEPDIR)/nlattr_tca_stab.Po + -rm -f ./$(DEPDIR)/nlattr_tcamsg.Po + -rm -f ./$(DEPDIR)/nlattr_tcmsg.Po + -rm -f ./$(DEPDIR)/nlattr_unix_diag_msg.Po + -rm -f ./$(DEPDIR)/nsyscalls-d.Po + -rm -f ./$(DEPDIR)/nsyscalls.Po + -rm -f ./$(DEPDIR)/old_mmap-P.Po + -rm -f ./$(DEPDIR)/old_mmap-Xabbrev.Po + -rm -f ./$(DEPDIR)/old_mmap-Xraw.Po + -rm -f ./$(DEPDIR)/old_mmap-Xverbose.Po + -rm -f ./$(DEPDIR)/old_mmap-v-none.Po + -rm -f ./$(DEPDIR)/old_mmap.Po + -rm -f ./$(DEPDIR)/oldfstat.Po + -rm -f ./$(DEPDIR)/oldlstat.Po + -rm -f ./$(DEPDIR)/oldselect-P.Po + -rm -f ./$(DEPDIR)/oldselect-efault-P.Po + -rm -f ./$(DEPDIR)/oldselect-efault.Po + -rm -f ./$(DEPDIR)/oldselect.Po + -rm -f ./$(DEPDIR)/oldstat.Po + -rm -f ./$(DEPDIR)/open.Po + -rm -f ./$(DEPDIR)/openat.Po + -rm -f ./$(DEPDIR)/orphaned_process_group.Po + -rm -f ./$(DEPDIR)/osf_utimes.Po + -rm -f ./$(DEPDIR)/pause.Po + -rm -f ./$(DEPDIR)/pc.Po + -rm -f ./$(DEPDIR)/perf_event_open.Po + -rm -f ./$(DEPDIR)/perf_event_open_nonverbose.Po + -rm -f ./$(DEPDIR)/perf_event_open_unabbrev.Po + -rm -f ./$(DEPDIR)/personality-Xabbrev.Po + -rm -f ./$(DEPDIR)/personality-Xraw.Po + -rm -f ./$(DEPDIR)/personality-Xverbose.Po + -rm -f ./$(DEPDIR)/personality.Po + -rm -f ./$(DEPDIR)/pidfd_send_signal.Po + -rm -f ./$(DEPDIR)/pipe.Po + -rm -f ./$(DEPDIR)/pipe2.Po + -rm -f ./$(DEPDIR)/pkey_alloc.Po + -rm -f ./$(DEPDIR)/pkey_free.Po + -rm -f ./$(DEPDIR)/pkey_mprotect.Po + -rm -f ./$(DEPDIR)/poll-P.Po + -rm -f ./$(DEPDIR)/poll.Po + -rm -f ./$(DEPDIR)/ppoll-P.Po + -rm -f ./$(DEPDIR)/ppoll-v.Po + -rm -f ./$(DEPDIR)/ppoll.Po + -rm -f ./$(DEPDIR)/prctl-arg2-intptr.Po + -rm -f ./$(DEPDIR)/prctl-dumpable.Po + -rm -f ./$(DEPDIR)/prctl-name.Po + -rm -f ./$(DEPDIR)/prctl-no-args.Po + -rm -f ./$(DEPDIR)/prctl-pdeathsig.Po + -rm -f ./$(DEPDIR)/prctl-seccomp-filter-v.Po + -rm -f ./$(DEPDIR)/prctl-seccomp-strict.Po + -rm -f ./$(DEPDIR)/prctl-securebits.Po + -rm -f ./$(DEPDIR)/prctl-spec-inject.Po + -rm -f ./$(DEPDIR)/prctl-tid_address.Po + -rm -f ./$(DEPDIR)/prctl-tsc.Po + -rm -f ./$(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po + -rm -f ./$(DEPDIR)/preadv-preadv.Po + -rm -f ./$(DEPDIR)/preadv2-pwritev2.Po + -rm -f ./$(DEPDIR)/preadv_pwritev-preadv-pwritev.Po + -rm -f ./$(DEPDIR)/print_maxfd.Po + -rm -f ./$(DEPDIR)/printpath-umovestr-peekdata.Po + -rm -f ./$(DEPDIR)/printpath-umovestr-undumpable.Po + -rm -f ./$(DEPDIR)/printpath-umovestr.Po + -rm -f ./$(DEPDIR)/printsignal-Xabbrev.Po + -rm -f ./$(DEPDIR)/printsignal-Xraw.Po + -rm -f ./$(DEPDIR)/printsignal-Xverbose.Po + -rm -f ./$(DEPDIR)/printstr.Po + -rm -f ./$(DEPDIR)/printstrn-umoven-peekdata.Po + -rm -f ./$(DEPDIR)/printstrn-umoven-undumpable.Po + -rm -f ./$(DEPDIR)/printstrn-umoven.Po + -rm -f ./$(DEPDIR)/prlimit64.Po + -rm -f ./$(DEPDIR)/process_vm_readv.Po + -rm -f ./$(DEPDIR)/process_vm_writev.Po + -rm -f ./$(DEPDIR)/pselect6.Po + -rm -f ./$(DEPDIR)/ptrace.Po + -rm -f ./$(DEPDIR)/ptrace_syscall_info.Po + -rm -f ./$(DEPDIR)/pwritev-pwritev.Po + -rm -f ./$(DEPDIR)/qual_fault.Po + -rm -f ./$(DEPDIR)/qual_inject-error-signal.Po + -rm -f ./$(DEPDIR)/qual_inject-retval.Po + -rm -f ./$(DEPDIR)/qual_inject-signal.Po + -rm -f ./$(DEPDIR)/qual_signal.Po + -rm -f ./$(DEPDIR)/quotactl-Xabbrev.Po + -rm -f ./$(DEPDIR)/quotactl-Xraw.Po + -rm -f ./$(DEPDIR)/quotactl-Xverbose.Po + -rm -f ./$(DEPDIR)/quotactl-success-v.Po + -rm -f ./$(DEPDIR)/quotactl-success.Po + -rm -f ./$(DEPDIR)/quotactl-v.Po + -rm -f ./$(DEPDIR)/quotactl-xfs-success-v.Po + -rm -f ./$(DEPDIR)/quotactl-xfs-success.Po + -rm -f ./$(DEPDIR)/quotactl-xfs-v.Po + -rm -f ./$(DEPDIR)/quotactl-xfs.Po + -rm -f ./$(DEPDIR)/quotactl.Po + -rm -f ./$(DEPDIR)/read-write.Po + -rm -f ./$(DEPDIR)/readahead.Po + -rm -f ./$(DEPDIR)/readdir.Po + -rm -f ./$(DEPDIR)/readlink.Po + -rm -f ./$(DEPDIR)/readlinkat.Po + -rm -f ./$(DEPDIR)/readv.Po + -rm -f ./$(DEPDIR)/reboot.Po + -rm -f ./$(DEPDIR)/recvfrom.Po + -rm -f ./$(DEPDIR)/recvmmsg-timeout.Po + -rm -f ./$(DEPDIR)/recvmsg.Po + -rm -f ./$(DEPDIR)/redirect-fds.Po + -rm -f ./$(DEPDIR)/remap_file_pages-Xabbrev.Po + -rm -f ./$(DEPDIR)/remap_file_pages-Xraw.Po + -rm -f ./$(DEPDIR)/remap_file_pages-Xverbose.Po + -rm -f ./$(DEPDIR)/remap_file_pages.Po + -rm -f ./$(DEPDIR)/rename.Po + -rm -f ./$(DEPDIR)/renameat.Po + -rm -f ./$(DEPDIR)/renameat2.Po + -rm -f ./$(DEPDIR)/request_key.Po + -rm -f ./$(DEPDIR)/restart_syscall.Po + -rm -f ./$(DEPDIR)/riscv_flush_icache.Po + -rm -f ./$(DEPDIR)/rmdir.Po + -rm -f ./$(DEPDIR)/rt_sigaction.Po + -rm -f ./$(DEPDIR)/rt_sigpending.Po + -rm -f ./$(DEPDIR)/rt_sigprocmask.Po + -rm -f ./$(DEPDIR)/rt_sigqueueinfo.Po + -rm -f ./$(DEPDIR)/rt_sigreturn.Po + -rm -f ./$(DEPDIR)/rt_sigsuspend.Po + -rm -f ./$(DEPDIR)/rt_sigtimedwait.Po + -rm -f ./$(DEPDIR)/rt_tgsigqueueinfo.Po + -rm -f ./$(DEPDIR)/run_expect_termsig.Po + -rm -f ./$(DEPDIR)/s390_guarded_storage-v.Po + -rm -f ./$(DEPDIR)/s390_guarded_storage.Po + -rm -f ./$(DEPDIR)/s390_pci_mmio_read_write.Po + -rm -f ./$(DEPDIR)/s390_runtime_instr.Po + -rm -f ./$(DEPDIR)/s390_sthyi-v.Po + -rm -f ./$(DEPDIR)/s390_sthyi.Po + -rm -f ./$(DEPDIR)/sched_get_priority_mxx.Po + -rm -f ./$(DEPDIR)/sched_rr_get_interval.Po + -rm -f ./$(DEPDIR)/sched_xetaffinity.Po + -rm -f ./$(DEPDIR)/sched_xetattr.Po + -rm -f ./$(DEPDIR)/sched_xetparam.Po + -rm -f ./$(DEPDIR)/sched_xetscheduler.Po + -rm -f ./$(DEPDIR)/sched_yield.Po + -rm -f ./$(DEPDIR)/scm_rights.Po + -rm -f ./$(DEPDIR)/seccomp-filter-v.Po + -rm -f ./$(DEPDIR)/seccomp-filter.Po + -rm -f ./$(DEPDIR)/seccomp-strict.Po + -rm -f ./$(DEPDIR)/seccomp_get_action_avail.Po + -rm -f ./$(DEPDIR)/select-P.Po + -rm -f ./$(DEPDIR)/select.Po + -rm -f ./$(DEPDIR)/semop.Po + -rm -f ./$(DEPDIR)/sendfile.Po + -rm -f ./$(DEPDIR)/sendfile64.Po + -rm -f ./$(DEPDIR)/set_mempolicy.Po + -rm -f ./$(DEPDIR)/set_ptracer_any.Po + -rm -f ./$(DEPDIR)/set_sigblock.Po + -rm -f ./$(DEPDIR)/set_sigign.Po + -rm -f ./$(DEPDIR)/setdomainname.Po + -rm -f ./$(DEPDIR)/setfsgid.Po + -rm -f ./$(DEPDIR)/setfsgid32.Po + -rm -f ./$(DEPDIR)/setfsuid.Po + -rm -f ./$(DEPDIR)/setfsuid32.Po + -rm -f ./$(DEPDIR)/setgid.Po + -rm -f ./$(DEPDIR)/setgid32.Po + -rm -f ./$(DEPDIR)/setgroups.Po + -rm -f ./$(DEPDIR)/setgroups32.Po + -rm -f ./$(DEPDIR)/sethostname.Po + -rm -f ./$(DEPDIR)/setns.Po + -rm -f ./$(DEPDIR)/setregid.Po + -rm -f ./$(DEPDIR)/setregid32.Po + -rm -f ./$(DEPDIR)/setresgid.Po + -rm -f ./$(DEPDIR)/setresgid32.Po + -rm -f ./$(DEPDIR)/setresuid.Po + -rm -f ./$(DEPDIR)/setresuid32.Po + -rm -f ./$(DEPDIR)/setreuid.Po + -rm -f ./$(DEPDIR)/setreuid32.Po + -rm -f ./$(DEPDIR)/setrlimit-Xabbrev.Po + -rm -f ./$(DEPDIR)/setrlimit-Xraw.Po + -rm -f ./$(DEPDIR)/setrlimit-Xverbose.Po + -rm -f ./$(DEPDIR)/setrlimit.Po + -rm -f ./$(DEPDIR)/setuid.Po + -rm -f ./$(DEPDIR)/setuid32.Po + -rm -f ./$(DEPDIR)/shmxt.Po + -rm -f ./$(DEPDIR)/shutdown.Po + -rm -f ./$(DEPDIR)/sigaction.Po + -rm -f ./$(DEPDIR)/sigaltstack.Po + -rm -f ./$(DEPDIR)/siginfo.Po + -rm -f ./$(DEPDIR)/signal.Po + -rm -f ./$(DEPDIR)/signal_receive.Po + -rm -f ./$(DEPDIR)/signalfd4.Po + -rm -f ./$(DEPDIR)/sigpending.Po + -rm -f ./$(DEPDIR)/sigprocmask.Po + -rm -f ./$(DEPDIR)/sigreturn.Po + -rm -f ./$(DEPDIR)/sigsuspend.Po + -rm -f ./$(DEPDIR)/sleep.Po + -rm -f ./$(DEPDIR)/so_error.Po + -rm -f ./$(DEPDIR)/so_linger.Po + -rm -f ./$(DEPDIR)/so_peercred-Xabbrev.Po + -rm -f ./$(DEPDIR)/so_peercred-Xraw.Po + -rm -f ./$(DEPDIR)/so_peercred-Xverbose.Po + -rm -f ./$(DEPDIR)/so_peercred.Po + -rm -f ./$(DEPDIR)/sock_filter-v-Xabbrev.Po + -rm -f ./$(DEPDIR)/sock_filter-v-Xraw.Po + -rm -f ./$(DEPDIR)/sock_filter-v-Xverbose.Po + -rm -f ./$(DEPDIR)/sock_filter-v.Po + -rm -f ./$(DEPDIR)/sockaddr_xlat-Xabbrev.Po + -rm -f ./$(DEPDIR)/sockaddr_xlat-Xraw.Po + -rm -f ./$(DEPDIR)/sockaddr_xlat-Xverbose.Po + -rm -f ./$(DEPDIR)/socketcall.Po + -rm -f ./$(DEPDIR)/sockopt-sol_netlink.Po + -rm -f ./$(DEPDIR)/sockopt-timestamp.Po + -rm -f ./$(DEPDIR)/splice.Po + -rm -f ./$(DEPDIR)/stack-fcall-0.Po + -rm -f ./$(DEPDIR)/stack-fcall-1.Po + -rm -f ./$(DEPDIR)/stack-fcall-2.Po + -rm -f ./$(DEPDIR)/stack-fcall-3.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-0.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-1.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-2.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-3.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled.Po + -rm -f ./$(DEPDIR)/stack-fcall.Po + -rm -f ./$(DEPDIR)/stat.Po + -rm -f ./$(DEPDIR)/stat64-stat64.Po + -rm -f ./$(DEPDIR)/statfs-statfs.Po + -rm -f ./$(DEPDIR)/statfs64.Po + -rm -f ./$(DEPDIR)/statx.Po + -rm -f ./$(DEPDIR)/swap.Po + -rm -f ./$(DEPDIR)/sxetmask.Po + -rm -f ./$(DEPDIR)/symlink.Po + -rm -f ./$(DEPDIR)/symlinkat.Po + -rm -f ./$(DEPDIR)/sync.Po + -rm -f ./$(DEPDIR)/sync_file_range.Po + -rm -f ./$(DEPDIR)/sync_file_range2.Po + -rm -f ./$(DEPDIR)/sysinfo.Po + -rm -f ./$(DEPDIR)/syslog.Po + -rm -f ./$(DEPDIR)/tee.Po + -rm -f ./$(DEPDIR)/threads-execve.Po + -rm -f ./$(DEPDIR)/time.Po + -rm -f ./$(DEPDIR)/timer_create.Po + -rm -f ./$(DEPDIR)/timer_xettime.Po + -rm -f ./$(DEPDIR)/timerfd_xettime.Po + -rm -f ./$(DEPDIR)/times-fail.Po + -rm -f ./$(DEPDIR)/times.Po + -rm -f ./$(DEPDIR)/truncate.Po + -rm -f ./$(DEPDIR)/truncate64-truncate64.Po + -rm -f ./$(DEPDIR)/ugetrlimit.Po + -rm -f ./$(DEPDIR)/uio-uio.Po + -rm -f ./$(DEPDIR)/umask.Po + -rm -f ./$(DEPDIR)/umount.Po + -rm -f ./$(DEPDIR)/umount2.Po + -rm -f ./$(DEPDIR)/umoven-illptr.Po + -rm -f ./$(DEPDIR)/umovestr-illptr.Po + -rm -f ./$(DEPDIR)/umovestr.Po + -rm -f ./$(DEPDIR)/umovestr2.Po + -rm -f ./$(DEPDIR)/umovestr3.Po + -rm -f ./$(DEPDIR)/uname.Po + -rm -f ./$(DEPDIR)/unblock_reset_raise.Po + -rm -f ./$(DEPDIR)/unix-pair-send-recv.Po + -rm -f ./$(DEPDIR)/unix-pair-sendto-recvfrom.Po + -rm -f ./$(DEPDIR)/unlink.Po + -rm -f ./$(DEPDIR)/unlinkat.Po + -rm -f ./$(DEPDIR)/unshare.Po + -rm -f ./$(DEPDIR)/userfaultfd.Po + -rm -f ./$(DEPDIR)/ustat.Po + -rm -f ./$(DEPDIR)/utime.Po + -rm -f ./$(DEPDIR)/utimensat-Xabbrev.Po + -rm -f ./$(DEPDIR)/utimensat-Xraw.Po + -rm -f ./$(DEPDIR)/utimensat-Xverbose.Po + -rm -f ./$(DEPDIR)/utimensat.Po + -rm -f ./$(DEPDIR)/utimes.Po + -rm -f ./$(DEPDIR)/vfork-f.Po + -rm -f ./$(DEPDIR)/vhangup.Po + -rm -f ./$(DEPDIR)/vmsplice.Po + -rm -f ./$(DEPDIR)/wait4-v.Po + -rm -f ./$(DEPDIR)/wait4.Po + -rm -f ./$(DEPDIR)/waitid-v.Po + -rm -f ./$(DEPDIR)/waitid.Po + -rm -f ./$(DEPDIR)/waitpid.Po + -rm -f ./$(DEPDIR)/xattr-strings.Po + -rm -f ./$(DEPDIR)/xattr.Po + -rm -f ./$(DEPDIR)/xet_robust_list.Po + -rm -f ./$(DEPDIR)/xet_thread_area_x86.Po + -rm -f ./$(DEPDIR)/xetitimer.Po + -rm -f ./$(DEPDIR)/xetpgid.Po + -rm -f ./$(DEPDIR)/xetpriority.Po + -rm -f ./$(DEPDIR)/xettimeofday.Po + -rm -f ./$(DEPDIR)/zeroargc.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -5652,7 +9894,652 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/_newselect-P.Po + -rm -f ./$(DEPDIR)/_newselect.Po + -rm -f ./$(DEPDIR)/accept.Po + -rm -f ./$(DEPDIR)/accept4.Po + -rm -f ./$(DEPDIR)/access.Po + -rm -f ./$(DEPDIR)/acct.Po + -rm -f ./$(DEPDIR)/add_key.Po + -rm -f ./$(DEPDIR)/adjtimex.Po + -rm -f ./$(DEPDIR)/aio.Po + -rm -f ./$(DEPDIR)/aio_pgetevents.Po + -rm -f ./$(DEPDIR)/alarm.Po + -rm -f ./$(DEPDIR)/answer.Po + -rm -f ./$(DEPDIR)/attach-f-p-cmd.Po + -rm -f ./$(DEPDIR)/attach-f-p.Po + -rm -f ./$(DEPDIR)/attach-p-cmd-cmd.Po + -rm -f ./$(DEPDIR)/attach-p-cmd-p.Po + -rm -f ./$(DEPDIR)/block_reset_raise_run.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd-prog-v.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd-prog.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd-v.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd.Po + -rm -f ./$(DEPDIR)/bpf-success-v.Po + -rm -f ./$(DEPDIR)/bpf-success.Po + -rm -f ./$(DEPDIR)/bpf-v.Po + -rm -f ./$(DEPDIR)/bpf.Po + -rm -f ./$(DEPDIR)/brk.Po + -rm -f ./$(DEPDIR)/btrfs.Po + -rm -f ./$(DEPDIR)/caps-abbrev.Po + -rm -f ./$(DEPDIR)/caps.Po + -rm -f ./$(DEPDIR)/check_sigblock.Po + -rm -f ./$(DEPDIR)/check_sigign.Po + -rm -f ./$(DEPDIR)/chmod.Po + -rm -f ./$(DEPDIR)/chown.Po + -rm -f ./$(DEPDIR)/chown32.Po + -rm -f ./$(DEPDIR)/chroot.Po + -rm -f ./$(DEPDIR)/clock_adjtime.Po + -rm -f ./$(DEPDIR)/clock_nanosleep.Po + -rm -f ./$(DEPDIR)/clock_xettime.Po + -rm -f ./$(DEPDIR)/clone_parent.Po + -rm -f ./$(DEPDIR)/clone_ptrace.Po + -rm -f ./$(DEPDIR)/copy_file_range.Po + -rm -f ./$(DEPDIR)/count-f.Po + -rm -f ./$(DEPDIR)/creat.Po + -rm -f ./$(DEPDIR)/delay.Po + -rm -f ./$(DEPDIR)/delete_module.Po + -rm -f ./$(DEPDIR)/dev-yy.Po + -rm -f ./$(DEPDIR)/dup.Po + -rm -f ./$(DEPDIR)/dup2.Po + -rm -f ./$(DEPDIR)/dup3.Po + -rm -f ./$(DEPDIR)/epoll_create.Po + -rm -f ./$(DEPDIR)/epoll_create1.Po + -rm -f ./$(DEPDIR)/epoll_ctl.Po + -rm -f ./$(DEPDIR)/epoll_pwait.Po + -rm -f ./$(DEPDIR)/epoll_wait.Po + -rm -f ./$(DEPDIR)/erestartsys.Po + -rm -f ./$(DEPDIR)/eventfd.Po + -rm -f ./$(DEPDIR)/execve-v.Po + -rm -f ./$(DEPDIR)/execve.Po + -rm -f ./$(DEPDIR)/execveat-v.Po + -rm -f ./$(DEPDIR)/execveat.Po + -rm -f ./$(DEPDIR)/faccessat.Po + -rm -f ./$(DEPDIR)/fadvise64.Po + -rm -f ./$(DEPDIR)/fadvise64_64.Po + -rm -f ./$(DEPDIR)/fallocate.Po + -rm -f ./$(DEPDIR)/fanotify_init.Po + -rm -f ./$(DEPDIR)/fanotify_mark-Xabbrev.Po + -rm -f ./$(DEPDIR)/fanotify_mark-Xraw.Po + -rm -f ./$(DEPDIR)/fanotify_mark-Xverbose.Po + -rm -f ./$(DEPDIR)/fanotify_mark.Po + -rm -f ./$(DEPDIR)/fchdir.Po + -rm -f ./$(DEPDIR)/fchmod.Po + -rm -f ./$(DEPDIR)/fchmodat.Po + -rm -f ./$(DEPDIR)/fchown.Po + -rm -f ./$(DEPDIR)/fchown32.Po + -rm -f ./$(DEPDIR)/fchownat.Po + -rm -f ./$(DEPDIR)/fcntl.Po + -rm -f ./$(DEPDIR)/fcntl64.Po + -rm -f ./$(DEPDIR)/fdatasync.Po + -rm -f ./$(DEPDIR)/fflush.Po + -rm -f ./$(DEPDIR)/file_handle.Po + -rm -f ./$(DEPDIR)/file_ioctl.Po + -rm -f ./$(DEPDIR)/filter-unavailable.Po + -rm -f ./$(DEPDIR)/finit_module.Po + -rm -f ./$(DEPDIR)/flock.Po + -rm -f ./$(DEPDIR)/fork-f.Po + -rm -f ./$(DEPDIR)/fstat-Xabbrev.Po + -rm -f ./$(DEPDIR)/fstat-Xraw.Po + -rm -f ./$(DEPDIR)/fstat-Xverbose.Po + -rm -f ./$(DEPDIR)/fstat.Po + -rm -f ./$(DEPDIR)/fstat64-Xabbrev.Po + -rm -f ./$(DEPDIR)/fstat64-Xraw.Po + -rm -f ./$(DEPDIR)/fstat64-Xverbose.Po + -rm -f ./$(DEPDIR)/fstat64-fstat64.Po + -rm -f ./$(DEPDIR)/fstatat64-fstatat64.Po + -rm -f ./$(DEPDIR)/fstatfs.Po + -rm -f ./$(DEPDIR)/fstatfs64.Po + -rm -f ./$(DEPDIR)/fsync-y.Po + -rm -f ./$(DEPDIR)/fsync.Po + -rm -f ./$(DEPDIR)/ftruncate.Po + -rm -f ./$(DEPDIR)/ftruncate64-ftruncate64.Po + -rm -f ./$(DEPDIR)/futex.Po + -rm -f ./$(DEPDIR)/futimesat.Po + -rm -f ./$(DEPDIR)/get_mempolicy.Po + -rm -f ./$(DEPDIR)/getcpu.Po + -rm -f ./$(DEPDIR)/getcwd.Po + -rm -f ./$(DEPDIR)/getdents.Po + -rm -f ./$(DEPDIR)/getdents64.Po + -rm -f ./$(DEPDIR)/getegid.Po + -rm -f ./$(DEPDIR)/getegid32.Po + -rm -f ./$(DEPDIR)/geteuid.Po + -rm -f ./$(DEPDIR)/geteuid32.Po + -rm -f ./$(DEPDIR)/getgid.Po + -rm -f ./$(DEPDIR)/getgid32.Po + -rm -f ./$(DEPDIR)/getgroups.Po + -rm -f ./$(DEPDIR)/getgroups32.Po + -rm -f ./$(DEPDIR)/getpeername.Po + -rm -f ./$(DEPDIR)/getpgrp.Po + -rm -f ./$(DEPDIR)/getpid.Po + -rm -f ./$(DEPDIR)/getppid.Po + -rm -f ./$(DEPDIR)/getrandom.Po + -rm -f ./$(DEPDIR)/getresgid.Po + -rm -f ./$(DEPDIR)/getresgid32.Po + -rm -f ./$(DEPDIR)/getresuid.Po + -rm -f ./$(DEPDIR)/getresuid32.Po + -rm -f ./$(DEPDIR)/getrlimit.Po + -rm -f ./$(DEPDIR)/getrusage.Po + -rm -f ./$(DEPDIR)/getsid.Po + -rm -f ./$(DEPDIR)/getsockname.Po + -rm -f ./$(DEPDIR)/gettid.Po + -rm -f ./$(DEPDIR)/getuid.Po + -rm -f ./$(DEPDIR)/getuid32.Po + -rm -f ./$(DEPDIR)/getxxid.Po + -rm -f ./$(DEPDIR)/group_req.Po + -rm -f ./$(DEPDIR)/inet-cmsg.Po + -rm -f ./$(DEPDIR)/init_module.Po + -rm -f ./$(DEPDIR)/inject-nf.Po + -rm -f ./$(DEPDIR)/inotify.Po + -rm -f ./$(DEPDIR)/inotify_init1.Po + -rm -f ./$(DEPDIR)/int_0x80.Po + -rm -f ./$(DEPDIR)/io_uring_enter.Po + -rm -f ./$(DEPDIR)/io_uring_register.Po + -rm -f ./$(DEPDIR)/io_uring_setup.Po + -rm -f ./$(DEPDIR)/ioctl.Po + -rm -f ./$(DEPDIR)/ioctl_block.Po + -rm -f ./$(DEPDIR)/ioctl_dm-v.Po + -rm -f ./$(DEPDIR)/ioctl_dm.Po + -rm -f ./$(DEPDIR)/ioctl_evdev-success-v.Po + -rm -f ./$(DEPDIR)/ioctl_evdev-success.Po + -rm -f ./$(DEPDIR)/ioctl_evdev-v.Po + -rm -f ./$(DEPDIR)/ioctl_evdev.Po + -rm -f ./$(DEPDIR)/ioctl_inotify.Po + -rm -f ./$(DEPDIR)/ioctl_kvm_run-v.Po + -rm -f ./$(DEPDIR)/ioctl_kvm_run.Po + -rm -f ./$(DEPDIR)/ioctl_kvm_run_auxstr_vcpu.Po + -rm -f ./$(DEPDIR)/ioctl_loop-nv.Po + -rm -f ./$(DEPDIR)/ioctl_loop-v.Po + -rm -f ./$(DEPDIR)/ioctl_loop.Po + -rm -f ./$(DEPDIR)/ioctl_mtd.Po + -rm -f ./$(DEPDIR)/ioctl_nbd.Po + -rm -f ./$(DEPDIR)/ioctl_nsfs.Po + -rm -f ./$(DEPDIR)/ioctl_perf-success.Po + -rm -f ./$(DEPDIR)/ioctl_perf.Po + -rm -f ./$(DEPDIR)/ioctl_ptp.Po + -rm -f ./$(DEPDIR)/ioctl_random.Po + -rm -f ./$(DEPDIR)/ioctl_rtc-v.Po + -rm -f ./$(DEPDIR)/ioctl_rtc.Po + -rm -f ./$(DEPDIR)/ioctl_scsi.Po + -rm -f ./$(DEPDIR)/ioctl_sg_io_v3.Po + -rm -f ./$(DEPDIR)/ioctl_sg_io_v4.Po + -rm -f ./$(DEPDIR)/ioctl_sock_gifconf.Po + -rm -f ./$(DEPDIR)/ioctl_uffdio.Po + -rm -f ./$(DEPDIR)/ioctl_v4l2.Po + -rm -f ./$(DEPDIR)/ioperm.Po + -rm -f ./$(DEPDIR)/iopl.Po + -rm -f ./$(DEPDIR)/ioprio-Xabbrev.Po + -rm -f ./$(DEPDIR)/ioprio-Xraw.Po + -rm -f ./$(DEPDIR)/ioprio-Xverbose.Po + -rm -f ./$(DEPDIR)/ioprio.Po + -rm -f ./$(DEPDIR)/ip_mreq.Po + -rm -f ./$(DEPDIR)/ipc.Po + -rm -f ./$(DEPDIR)/ipc_msg-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_msg-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_msg-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_msg.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf.Po + -rm -f ./$(DEPDIR)/ipc_sem-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_sem-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_sem-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_sem.Po + -rm -f ./$(DEPDIR)/ipc_shm-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_shm-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_shm-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_shm.Po + -rm -f ./$(DEPDIR)/is_linux_mips_n64.Po + -rm -f ./$(DEPDIR)/kcmp-y.Po + -rm -f ./$(DEPDIR)/kcmp.Po + -rm -f ./$(DEPDIR)/kern_features.Po + -rm -f ./$(DEPDIR)/kernel_version-Xabbrev.Po + -rm -f ./$(DEPDIR)/kernel_version-Xraw.Po + -rm -f ./$(DEPDIR)/kernel_version-Xverbose.Po + -rm -f ./$(DEPDIR)/kernel_version.Po + -rm -f ./$(DEPDIR)/kexec_file_load.Po + -rm -f ./$(DEPDIR)/kexec_load.Po + -rm -f ./$(DEPDIR)/keyctl-Xabbrev.Po + -rm -f ./$(DEPDIR)/keyctl-Xraw.Po + -rm -f ./$(DEPDIR)/keyctl-Xverbose.Po + -rm -f ./$(DEPDIR)/keyctl.Po + -rm -f ./$(DEPDIR)/kill.Po + -rm -f ./$(DEPDIR)/kill_child.Po + -rm -f ./$(DEPDIR)/ksysent.Po + -rm -f ./$(DEPDIR)/lchown.Po + -rm -f ./$(DEPDIR)/lchown32.Po + -rm -f ./$(DEPDIR)/libtests_a-create_nl_socket.Po + -rm -f ./$(DEPDIR)/libtests_a-errno2name.Po + -rm -f ./$(DEPDIR)/libtests_a-error_msg.Po + -rm -f ./$(DEPDIR)/libtests_a-fill_memory.Po + -rm -f ./$(DEPDIR)/libtests_a-get_page_size.Po + -rm -f ./$(DEPDIR)/libtests_a-get_sigset_size.Po + -rm -f ./$(DEPDIR)/libtests_a-hexdump_strdup.Po + -rm -f ./$(DEPDIR)/libtests_a-hexquote_strndup.Po + -rm -f ./$(DEPDIR)/libtests_a-ifindex.Po + -rm -f ./$(DEPDIR)/libtests_a-inode_of_sockfd.Po + -rm -f ./$(DEPDIR)/libtests_a-libmmsg.Po + -rm -f ./$(DEPDIR)/libtests_a-libsocketcall.Po + -rm -f ./$(DEPDIR)/libtests_a-overflowuid.Po + -rm -f ./$(DEPDIR)/libtests_a-pipe_maxfd.Po + -rm -f ./$(DEPDIR)/libtests_a-print_quoted_string.Po + -rm -f ./$(DEPDIR)/libtests_a-print_time.Po + -rm -f ./$(DEPDIR)/libtests_a-printflags.Po + -rm -f ./$(DEPDIR)/libtests_a-printxval.Po + -rm -f ./$(DEPDIR)/libtests_a-signal2name.Po + -rm -f ./$(DEPDIR)/libtests_a-skip_unavailable.Po + -rm -f ./$(DEPDIR)/libtests_a-sprintrc.Po + -rm -f ./$(DEPDIR)/libtests_a-tail_alloc.Po + -rm -f ./$(DEPDIR)/libtests_a-test_printpath.Po + -rm -f ./$(DEPDIR)/libtests_a-test_printstrn.Po + -rm -f ./$(DEPDIR)/libtests_a-test_ucopy.Po + -rm -f ./$(DEPDIR)/libtests_a-tprintf.Po + -rm -f ./$(DEPDIR)/link.Po + -rm -f ./$(DEPDIR)/linkat.Po + -rm -f ./$(DEPDIR)/list_sigaction_signum.Po + -rm -f ./$(DEPDIR)/llseek.Po + -rm -f ./$(DEPDIR)/localtime.Po + -rm -f ./$(DEPDIR)/lookup_dcookie.Po + -rm -f ./$(DEPDIR)/looping_threads.Po + -rm -f ./$(DEPDIR)/lseek.Po + -rm -f ./$(DEPDIR)/lstat.Po + -rm -f ./$(DEPDIR)/lstat64-lstat64.Po + -rm -f ./$(DEPDIR)/madvise.Po + -rm -f ./$(DEPDIR)/mbind.Po + -rm -f ./$(DEPDIR)/membarrier.Po + -rm -f ./$(DEPDIR)/memfd_create-Xabbrev.Po + -rm -f ./$(DEPDIR)/memfd_create-Xraw.Po + -rm -f ./$(DEPDIR)/memfd_create-Xverbose.Po + -rm -f ./$(DEPDIR)/memfd_create.Po + -rm -f ./$(DEPDIR)/migrate_pages.Po + -rm -f ./$(DEPDIR)/mincore.Po + -rm -f ./$(DEPDIR)/mkdir.Po + -rm -f ./$(DEPDIR)/mkdirat.Po + -rm -f ./$(DEPDIR)/mknod.Po + -rm -f ./$(DEPDIR)/mknodat.Po + -rm -f ./$(DEPDIR)/mlock.Po + -rm -f ./$(DEPDIR)/mlock2.Po + -rm -f ./$(DEPDIR)/mlockall.Po + -rm -f ./$(DEPDIR)/mmap-Xabbrev.Po + -rm -f ./$(DEPDIR)/mmap-Xraw.Po + -rm -f ./$(DEPDIR)/mmap-Xverbose.Po + -rm -f ./$(DEPDIR)/mmap.Po + -rm -f ./$(DEPDIR)/mmap64-mmap64.Po + -rm -f ./$(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Po + -rm -f ./$(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Po + -rm -f ./$(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Po + -rm -f ./$(DEPDIR)/mmsg-silent.Po + -rm -f ./$(DEPDIR)/mmsg.Po + -rm -f ./$(DEPDIR)/mmsg_name-v.Po + -rm -f ./$(DEPDIR)/mmsg_name.Po + -rm -f ./$(DEPDIR)/modify_ldt.Po + -rm -f ./$(DEPDIR)/mount-Xabbrev.Po + -rm -f ./$(DEPDIR)/mount-Xraw.Po + -rm -f ./$(DEPDIR)/mount-Xverbose.Po + -rm -f ./$(DEPDIR)/mount.Po + -rm -f ./$(DEPDIR)/move_pages-Xabbrev.Po + -rm -f ./$(DEPDIR)/move_pages-Xraw.Po + -rm -f ./$(DEPDIR)/move_pages-Xverbose.Po + -rm -f ./$(DEPDIR)/move_pages.Po + -rm -f ./$(DEPDIR)/mq.Po + -rm -f ./$(DEPDIR)/mq_sendrecv-read.Po + -rm -f ./$(DEPDIR)/mq_sendrecv-write.Po + -rm -f ./$(DEPDIR)/mq_sendrecv.Po + -rm -f ./$(DEPDIR)/msg_control-v.Po + -rm -f ./$(DEPDIR)/msg_control.Po + -rm -f ./$(DEPDIR)/msg_name.Po + -rm -f ./$(DEPDIR)/munlockall.Po + -rm -f ./$(DEPDIR)/nanosleep.Po + -rm -f ./$(DEPDIR)/net-accept-connect.Po + -rm -f ./$(DEPDIR)/net-icmp_filter.Po + -rm -f ./$(DEPDIR)/net-packet_mreq-Xabbrev.Po + -rm -f ./$(DEPDIR)/net-packet_mreq-Xraw.Po + -rm -f ./$(DEPDIR)/net-packet_mreq-Xverbose.Po + -rm -f ./$(DEPDIR)/net-packet_mreq.Po + -rm -f ./$(DEPDIR)/net-sockaddr.Po + -rm -f ./$(DEPDIR)/net-tpacket_req.Po + -rm -f ./$(DEPDIR)/net-tpacket_stats-success.Po + -rm -f ./$(DEPDIR)/net-tpacket_stats.Po + -rm -f ./$(DEPDIR)/net-y-unix.Po + -rm -f ./$(DEPDIR)/net-yy-inet.Po + -rm -f ./$(DEPDIR)/net-yy-inet6.Po + -rm -f ./$(DEPDIR)/net-yy-netlink.Po + -rm -f ./$(DEPDIR)/net-yy-unix.Po + -rm -f ./$(DEPDIR)/netlink_audit.Po + -rm -f ./$(DEPDIR)/netlink_crypto.Po + -rm -f ./$(DEPDIR)/netlink_generic.Po + -rm -f ./$(DEPDIR)/netlink_inet_diag.Po + -rm -f ./$(DEPDIR)/netlink_kobject_uevent.Po + -rm -f ./$(DEPDIR)/netlink_netfilter.Po + -rm -f ./$(DEPDIR)/netlink_netlink_diag.Po + -rm -f ./$(DEPDIR)/netlink_protocol.Po + -rm -f ./$(DEPDIR)/netlink_route.Po + -rm -f ./$(DEPDIR)/netlink_selinux.Po + -rm -f ./$(DEPDIR)/netlink_sock_diag.Po + -rm -f ./$(DEPDIR)/netlink_unix_diag.Po + -rm -f ./$(DEPDIR)/netlink_xfrm.Po + -rm -f ./$(DEPDIR)/newfstatat-newfstatat.Po + -rm -f ./$(DEPDIR)/nfnetlink_acct.Po + -rm -f ./$(DEPDIR)/nfnetlink_cthelper.Po + -rm -f ./$(DEPDIR)/nfnetlink_ctnetlink.Po + -rm -f ./$(DEPDIR)/nfnetlink_ctnetlink_exp.Po + -rm -f ./$(DEPDIR)/nfnetlink_cttimeout.Po + -rm -f ./$(DEPDIR)/nfnetlink_ipset.Po + -rm -f ./$(DEPDIR)/nfnetlink_nft_compat.Po + -rm -f ./$(DEPDIR)/nfnetlink_nftables.Po + -rm -f ./$(DEPDIR)/nfnetlink_osf.Po + -rm -f ./$(DEPDIR)/nfnetlink_queue.Po + -rm -f ./$(DEPDIR)/nfnetlink_ulog.Po + -rm -f ./$(DEPDIR)/nlattr.Po + -rm -f ./$(DEPDIR)/nlattr_br_port_msg.Po + -rm -f ./$(DEPDIR)/nlattr_crypto_user_alg.Po + -rm -f ./$(DEPDIR)/nlattr_dcbmsg.Po + -rm -f ./$(DEPDIR)/nlattr_fib_rule_hdr.Po + -rm -f ./$(DEPDIR)/nlattr_ifaddrlblmsg.Po + -rm -f ./$(DEPDIR)/nlattr_ifaddrmsg.Po + -rm -f ./$(DEPDIR)/nlattr_ifinfomsg.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_af_spec.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_brport.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_linkinfo.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_port.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_xdp.Po + -rm -f ./$(DEPDIR)/nlattr_inet_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_inet_diag_req_compat.Po + -rm -f ./$(DEPDIR)/nlattr_inet_diag_req_v2.Po + -rm -f ./$(DEPDIR)/nlattr_mdba_mdb_entry.Po + -rm -f ./$(DEPDIR)/nlattr_mdba_router_port.Po + -rm -f ./$(DEPDIR)/nlattr_ndmsg.Po + -rm -f ./$(DEPDIR)/nlattr_ndtmsg.Po + -rm -f ./$(DEPDIR)/nlattr_netconfmsg.Po + -rm -f ./$(DEPDIR)/nlattr_netlink_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_nlmsgerr.Po + -rm -f ./$(DEPDIR)/nlattr_packet_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_rtgenmsg.Po + -rm -f ./$(DEPDIR)/nlattr_rtmsg.Po + -rm -f ./$(DEPDIR)/nlattr_smc_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_tc_stats.Po + -rm -f ./$(DEPDIR)/nlattr_tca_stab.Po + -rm -f ./$(DEPDIR)/nlattr_tcamsg.Po + -rm -f ./$(DEPDIR)/nlattr_tcmsg.Po + -rm -f ./$(DEPDIR)/nlattr_unix_diag_msg.Po + -rm -f ./$(DEPDIR)/nsyscalls-d.Po + -rm -f ./$(DEPDIR)/nsyscalls.Po + -rm -f ./$(DEPDIR)/old_mmap-P.Po + -rm -f ./$(DEPDIR)/old_mmap-Xabbrev.Po + -rm -f ./$(DEPDIR)/old_mmap-Xraw.Po + -rm -f ./$(DEPDIR)/old_mmap-Xverbose.Po + -rm -f ./$(DEPDIR)/old_mmap-v-none.Po + -rm -f ./$(DEPDIR)/old_mmap.Po + -rm -f ./$(DEPDIR)/oldfstat.Po + -rm -f ./$(DEPDIR)/oldlstat.Po + -rm -f ./$(DEPDIR)/oldselect-P.Po + -rm -f ./$(DEPDIR)/oldselect-efault-P.Po + -rm -f ./$(DEPDIR)/oldselect-efault.Po + -rm -f ./$(DEPDIR)/oldselect.Po + -rm -f ./$(DEPDIR)/oldstat.Po + -rm -f ./$(DEPDIR)/open.Po + -rm -f ./$(DEPDIR)/openat.Po + -rm -f ./$(DEPDIR)/orphaned_process_group.Po + -rm -f ./$(DEPDIR)/osf_utimes.Po + -rm -f ./$(DEPDIR)/pause.Po + -rm -f ./$(DEPDIR)/pc.Po + -rm -f ./$(DEPDIR)/perf_event_open.Po + -rm -f ./$(DEPDIR)/perf_event_open_nonverbose.Po + -rm -f ./$(DEPDIR)/perf_event_open_unabbrev.Po + -rm -f ./$(DEPDIR)/personality-Xabbrev.Po + -rm -f ./$(DEPDIR)/personality-Xraw.Po + -rm -f ./$(DEPDIR)/personality-Xverbose.Po + -rm -f ./$(DEPDIR)/personality.Po + -rm -f ./$(DEPDIR)/pidfd_send_signal.Po + -rm -f ./$(DEPDIR)/pipe.Po + -rm -f ./$(DEPDIR)/pipe2.Po + -rm -f ./$(DEPDIR)/pkey_alloc.Po + -rm -f ./$(DEPDIR)/pkey_free.Po + -rm -f ./$(DEPDIR)/pkey_mprotect.Po + -rm -f ./$(DEPDIR)/poll-P.Po + -rm -f ./$(DEPDIR)/poll.Po + -rm -f ./$(DEPDIR)/ppoll-P.Po + -rm -f ./$(DEPDIR)/ppoll-v.Po + -rm -f ./$(DEPDIR)/ppoll.Po + -rm -f ./$(DEPDIR)/prctl-arg2-intptr.Po + -rm -f ./$(DEPDIR)/prctl-dumpable.Po + -rm -f ./$(DEPDIR)/prctl-name.Po + -rm -f ./$(DEPDIR)/prctl-no-args.Po + -rm -f ./$(DEPDIR)/prctl-pdeathsig.Po + -rm -f ./$(DEPDIR)/prctl-seccomp-filter-v.Po + -rm -f ./$(DEPDIR)/prctl-seccomp-strict.Po + -rm -f ./$(DEPDIR)/prctl-securebits.Po + -rm -f ./$(DEPDIR)/prctl-spec-inject.Po + -rm -f ./$(DEPDIR)/prctl-tid_address.Po + -rm -f ./$(DEPDIR)/prctl-tsc.Po + -rm -f ./$(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po + -rm -f ./$(DEPDIR)/preadv-preadv.Po + -rm -f ./$(DEPDIR)/preadv2-pwritev2.Po + -rm -f ./$(DEPDIR)/preadv_pwritev-preadv-pwritev.Po + -rm -f ./$(DEPDIR)/print_maxfd.Po + -rm -f ./$(DEPDIR)/printpath-umovestr-peekdata.Po + -rm -f ./$(DEPDIR)/printpath-umovestr-undumpable.Po + -rm -f ./$(DEPDIR)/printpath-umovestr.Po + -rm -f ./$(DEPDIR)/printsignal-Xabbrev.Po + -rm -f ./$(DEPDIR)/printsignal-Xraw.Po + -rm -f ./$(DEPDIR)/printsignal-Xverbose.Po + -rm -f ./$(DEPDIR)/printstr.Po + -rm -f ./$(DEPDIR)/printstrn-umoven-peekdata.Po + -rm -f ./$(DEPDIR)/printstrn-umoven-undumpable.Po + -rm -f ./$(DEPDIR)/printstrn-umoven.Po + -rm -f ./$(DEPDIR)/prlimit64.Po + -rm -f ./$(DEPDIR)/process_vm_readv.Po + -rm -f ./$(DEPDIR)/process_vm_writev.Po + -rm -f ./$(DEPDIR)/pselect6.Po + -rm -f ./$(DEPDIR)/ptrace.Po + -rm -f ./$(DEPDIR)/ptrace_syscall_info.Po + -rm -f ./$(DEPDIR)/pwritev-pwritev.Po + -rm -f ./$(DEPDIR)/qual_fault.Po + -rm -f ./$(DEPDIR)/qual_inject-error-signal.Po + -rm -f ./$(DEPDIR)/qual_inject-retval.Po + -rm -f ./$(DEPDIR)/qual_inject-signal.Po + -rm -f ./$(DEPDIR)/qual_signal.Po + -rm -f ./$(DEPDIR)/quotactl-Xabbrev.Po + -rm -f ./$(DEPDIR)/quotactl-Xraw.Po + -rm -f ./$(DEPDIR)/quotactl-Xverbose.Po + -rm -f ./$(DEPDIR)/quotactl-success-v.Po + -rm -f ./$(DEPDIR)/quotactl-success.Po + -rm -f ./$(DEPDIR)/quotactl-v.Po + -rm -f ./$(DEPDIR)/quotactl-xfs-success-v.Po + -rm -f ./$(DEPDIR)/quotactl-xfs-success.Po + -rm -f ./$(DEPDIR)/quotactl-xfs-v.Po + -rm -f ./$(DEPDIR)/quotactl-xfs.Po + -rm -f ./$(DEPDIR)/quotactl.Po + -rm -f ./$(DEPDIR)/read-write.Po + -rm -f ./$(DEPDIR)/readahead.Po + -rm -f ./$(DEPDIR)/readdir.Po + -rm -f ./$(DEPDIR)/readlink.Po + -rm -f ./$(DEPDIR)/readlinkat.Po + -rm -f ./$(DEPDIR)/readv.Po + -rm -f ./$(DEPDIR)/reboot.Po + -rm -f ./$(DEPDIR)/recvfrom.Po + -rm -f ./$(DEPDIR)/recvmmsg-timeout.Po + -rm -f ./$(DEPDIR)/recvmsg.Po + -rm -f ./$(DEPDIR)/redirect-fds.Po + -rm -f ./$(DEPDIR)/remap_file_pages-Xabbrev.Po + -rm -f ./$(DEPDIR)/remap_file_pages-Xraw.Po + -rm -f ./$(DEPDIR)/remap_file_pages-Xverbose.Po + -rm -f ./$(DEPDIR)/remap_file_pages.Po + -rm -f ./$(DEPDIR)/rename.Po + -rm -f ./$(DEPDIR)/renameat.Po + -rm -f ./$(DEPDIR)/renameat2.Po + -rm -f ./$(DEPDIR)/request_key.Po + -rm -f ./$(DEPDIR)/restart_syscall.Po + -rm -f ./$(DEPDIR)/riscv_flush_icache.Po + -rm -f ./$(DEPDIR)/rmdir.Po + -rm -f ./$(DEPDIR)/rt_sigaction.Po + -rm -f ./$(DEPDIR)/rt_sigpending.Po + -rm -f ./$(DEPDIR)/rt_sigprocmask.Po + -rm -f ./$(DEPDIR)/rt_sigqueueinfo.Po + -rm -f ./$(DEPDIR)/rt_sigreturn.Po + -rm -f ./$(DEPDIR)/rt_sigsuspend.Po + -rm -f ./$(DEPDIR)/rt_sigtimedwait.Po + -rm -f ./$(DEPDIR)/rt_tgsigqueueinfo.Po + -rm -f ./$(DEPDIR)/run_expect_termsig.Po + -rm -f ./$(DEPDIR)/s390_guarded_storage-v.Po + -rm -f ./$(DEPDIR)/s390_guarded_storage.Po + -rm -f ./$(DEPDIR)/s390_pci_mmio_read_write.Po + -rm -f ./$(DEPDIR)/s390_runtime_instr.Po + -rm -f ./$(DEPDIR)/s390_sthyi-v.Po + -rm -f ./$(DEPDIR)/s390_sthyi.Po + -rm -f ./$(DEPDIR)/sched_get_priority_mxx.Po + -rm -f ./$(DEPDIR)/sched_rr_get_interval.Po + -rm -f ./$(DEPDIR)/sched_xetaffinity.Po + -rm -f ./$(DEPDIR)/sched_xetattr.Po + -rm -f ./$(DEPDIR)/sched_xetparam.Po + -rm -f ./$(DEPDIR)/sched_xetscheduler.Po + -rm -f ./$(DEPDIR)/sched_yield.Po + -rm -f ./$(DEPDIR)/scm_rights.Po + -rm -f ./$(DEPDIR)/seccomp-filter-v.Po + -rm -f ./$(DEPDIR)/seccomp-filter.Po + -rm -f ./$(DEPDIR)/seccomp-strict.Po + -rm -f ./$(DEPDIR)/seccomp_get_action_avail.Po + -rm -f ./$(DEPDIR)/select-P.Po + -rm -f ./$(DEPDIR)/select.Po + -rm -f ./$(DEPDIR)/semop.Po + -rm -f ./$(DEPDIR)/sendfile.Po + -rm -f ./$(DEPDIR)/sendfile64.Po + -rm -f ./$(DEPDIR)/set_mempolicy.Po + -rm -f ./$(DEPDIR)/set_ptracer_any.Po + -rm -f ./$(DEPDIR)/set_sigblock.Po + -rm -f ./$(DEPDIR)/set_sigign.Po + -rm -f ./$(DEPDIR)/setdomainname.Po + -rm -f ./$(DEPDIR)/setfsgid.Po + -rm -f ./$(DEPDIR)/setfsgid32.Po + -rm -f ./$(DEPDIR)/setfsuid.Po + -rm -f ./$(DEPDIR)/setfsuid32.Po + -rm -f ./$(DEPDIR)/setgid.Po + -rm -f ./$(DEPDIR)/setgid32.Po + -rm -f ./$(DEPDIR)/setgroups.Po + -rm -f ./$(DEPDIR)/setgroups32.Po + -rm -f ./$(DEPDIR)/sethostname.Po + -rm -f ./$(DEPDIR)/setns.Po + -rm -f ./$(DEPDIR)/setregid.Po + -rm -f ./$(DEPDIR)/setregid32.Po + -rm -f ./$(DEPDIR)/setresgid.Po + -rm -f ./$(DEPDIR)/setresgid32.Po + -rm -f ./$(DEPDIR)/setresuid.Po + -rm -f ./$(DEPDIR)/setresuid32.Po + -rm -f ./$(DEPDIR)/setreuid.Po + -rm -f ./$(DEPDIR)/setreuid32.Po + -rm -f ./$(DEPDIR)/setrlimit-Xabbrev.Po + -rm -f ./$(DEPDIR)/setrlimit-Xraw.Po + -rm -f ./$(DEPDIR)/setrlimit-Xverbose.Po + -rm -f ./$(DEPDIR)/setrlimit.Po + -rm -f ./$(DEPDIR)/setuid.Po + -rm -f ./$(DEPDIR)/setuid32.Po + -rm -f ./$(DEPDIR)/shmxt.Po + -rm -f ./$(DEPDIR)/shutdown.Po + -rm -f ./$(DEPDIR)/sigaction.Po + -rm -f ./$(DEPDIR)/sigaltstack.Po + -rm -f ./$(DEPDIR)/siginfo.Po + -rm -f ./$(DEPDIR)/signal.Po + -rm -f ./$(DEPDIR)/signal_receive.Po + -rm -f ./$(DEPDIR)/signalfd4.Po + -rm -f ./$(DEPDIR)/sigpending.Po + -rm -f ./$(DEPDIR)/sigprocmask.Po + -rm -f ./$(DEPDIR)/sigreturn.Po + -rm -f ./$(DEPDIR)/sigsuspend.Po + -rm -f ./$(DEPDIR)/sleep.Po + -rm -f ./$(DEPDIR)/so_error.Po + -rm -f ./$(DEPDIR)/so_linger.Po + -rm -f ./$(DEPDIR)/so_peercred-Xabbrev.Po + -rm -f ./$(DEPDIR)/so_peercred-Xraw.Po + -rm -f ./$(DEPDIR)/so_peercred-Xverbose.Po + -rm -f ./$(DEPDIR)/so_peercred.Po + -rm -f ./$(DEPDIR)/sock_filter-v-Xabbrev.Po + -rm -f ./$(DEPDIR)/sock_filter-v-Xraw.Po + -rm -f ./$(DEPDIR)/sock_filter-v-Xverbose.Po + -rm -f ./$(DEPDIR)/sock_filter-v.Po + -rm -f ./$(DEPDIR)/sockaddr_xlat-Xabbrev.Po + -rm -f ./$(DEPDIR)/sockaddr_xlat-Xraw.Po + -rm -f ./$(DEPDIR)/sockaddr_xlat-Xverbose.Po + -rm -f ./$(DEPDIR)/socketcall.Po + -rm -f ./$(DEPDIR)/sockopt-sol_netlink.Po + -rm -f ./$(DEPDIR)/sockopt-timestamp.Po + -rm -f ./$(DEPDIR)/splice.Po + -rm -f ./$(DEPDIR)/stack-fcall-0.Po + -rm -f ./$(DEPDIR)/stack-fcall-1.Po + -rm -f ./$(DEPDIR)/stack-fcall-2.Po + -rm -f ./$(DEPDIR)/stack-fcall-3.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-0.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-1.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-2.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-3.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled.Po + -rm -f ./$(DEPDIR)/stack-fcall.Po + -rm -f ./$(DEPDIR)/stat.Po + -rm -f ./$(DEPDIR)/stat64-stat64.Po + -rm -f ./$(DEPDIR)/statfs-statfs.Po + -rm -f ./$(DEPDIR)/statfs64.Po + -rm -f ./$(DEPDIR)/statx.Po + -rm -f ./$(DEPDIR)/swap.Po + -rm -f ./$(DEPDIR)/sxetmask.Po + -rm -f ./$(DEPDIR)/symlink.Po + -rm -f ./$(DEPDIR)/symlinkat.Po + -rm -f ./$(DEPDIR)/sync.Po + -rm -f ./$(DEPDIR)/sync_file_range.Po + -rm -f ./$(DEPDIR)/sync_file_range2.Po + -rm -f ./$(DEPDIR)/sysinfo.Po + -rm -f ./$(DEPDIR)/syslog.Po + -rm -f ./$(DEPDIR)/tee.Po + -rm -f ./$(DEPDIR)/threads-execve.Po + -rm -f ./$(DEPDIR)/time.Po + -rm -f ./$(DEPDIR)/timer_create.Po + -rm -f ./$(DEPDIR)/timer_xettime.Po + -rm -f ./$(DEPDIR)/timerfd_xettime.Po + -rm -f ./$(DEPDIR)/times-fail.Po + -rm -f ./$(DEPDIR)/times.Po + -rm -f ./$(DEPDIR)/truncate.Po + -rm -f ./$(DEPDIR)/truncate64-truncate64.Po + -rm -f ./$(DEPDIR)/ugetrlimit.Po + -rm -f ./$(DEPDIR)/uio-uio.Po + -rm -f ./$(DEPDIR)/umask.Po + -rm -f ./$(DEPDIR)/umount.Po + -rm -f ./$(DEPDIR)/umount2.Po + -rm -f ./$(DEPDIR)/umoven-illptr.Po + -rm -f ./$(DEPDIR)/umovestr-illptr.Po + -rm -f ./$(DEPDIR)/umovestr.Po + -rm -f ./$(DEPDIR)/umovestr2.Po + -rm -f ./$(DEPDIR)/umovestr3.Po + -rm -f ./$(DEPDIR)/uname.Po + -rm -f ./$(DEPDIR)/unblock_reset_raise.Po + -rm -f ./$(DEPDIR)/unix-pair-send-recv.Po + -rm -f ./$(DEPDIR)/unix-pair-sendto-recvfrom.Po + -rm -f ./$(DEPDIR)/unlink.Po + -rm -f ./$(DEPDIR)/unlinkat.Po + -rm -f ./$(DEPDIR)/unshare.Po + -rm -f ./$(DEPDIR)/userfaultfd.Po + -rm -f ./$(DEPDIR)/ustat.Po + -rm -f ./$(DEPDIR)/utime.Po + -rm -f ./$(DEPDIR)/utimensat-Xabbrev.Po + -rm -f ./$(DEPDIR)/utimensat-Xraw.Po + -rm -f ./$(DEPDIR)/utimensat-Xverbose.Po + -rm -f ./$(DEPDIR)/utimensat.Po + -rm -f ./$(DEPDIR)/utimes.Po + -rm -f ./$(DEPDIR)/vfork-f.Po + -rm -f ./$(DEPDIR)/vhangup.Po + -rm -f ./$(DEPDIR)/vmsplice.Po + -rm -f ./$(DEPDIR)/wait4-v.Po + -rm -f ./$(DEPDIR)/wait4.Po + -rm -f ./$(DEPDIR)/waitid-v.Po + -rm -f ./$(DEPDIR)/waitid.Po + -rm -f ./$(DEPDIR)/waitpid.Po + -rm -f ./$(DEPDIR)/xattr-strings.Po + -rm -f ./$(DEPDIR)/xattr.Po + -rm -f ./$(DEPDIR)/xet_robust_list.Po + -rm -f ./$(DEPDIR)/xet_thread_area_x86.Po + -rm -f ./$(DEPDIR)/xetitimer.Po + -rm -f ./$(DEPDIR)/xetpgid.Po + -rm -f ./$(DEPDIR)/xetpriority.Po + -rm -f ./$(DEPDIR)/xettimeofday.Po + -rm -f ./$(DEPDIR)/zeroargc.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -5670,38 +10557,1624 @@ ps-am: uninstall-am: -.MAKE: check-am install-am install-strip +.MAKE: all check check-am install install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am \ - check-valgrind-am check-valgrind-local clean \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \ - cscopelist-am ctags ctags-am distclean distclean-compile \ - distclean-generic distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ + clean-local cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am recheck tags tags-am \ uninstall uninstall-am +.PRECIOUS: Makefile -@VALGRIND_CHECK_RULES@ -ksysent.h: $(srcdir)/ksysent.sed - echo '#include ' | \ - $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -dM - > $@.t1 - LC_COLLATE=C sed -r -n -f $(srcdir)/ksysent.sed < $@.t1 > $@.t2 - mv -f $@.t2 $@ - rm -f $@.t1 +$(srcdir)/_newselect.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ -ksysent.$(OBJEXT): ksysent.h -$(objects): scno.h +$(srcdir)/_newselect-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/accept.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/accept4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/access.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/acct.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/add_key.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/adjtimex.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/aio.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/aio_pgetevents.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/alarm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd-prog.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd-prog-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/btrfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chmod.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chown32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chroot.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock_adjtime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock_nanosleep.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock_xettime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/copy_file_range.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/creat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/delete_module.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dev-yy.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dup.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dup2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dup3.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_create.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_create1.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_ctl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_pwait.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_wait.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/erestartsys.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/execveat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/execveat-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/faccessat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fadvise64_64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fallocate.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_init.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchmod.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchmodat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchown32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchownat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fcntl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fcntl64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fdatasync.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/file_handle.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/file_ioctl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/finit_module.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/flock.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fork-f.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstatat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstatfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstatfs64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fsync.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fsync-y.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ftruncate.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ftruncate64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/futimesat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/get_mempolicy.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getcpu.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getcwd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getdents.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getdents64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getegid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getegid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/geteuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/geteuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgroups.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgroups32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getpeername.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getpgrp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getpid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getppid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getrandom.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getrlimit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getrusage.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getsid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getsockname.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/gettid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getxxid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/group_req.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/inet-cmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/init_module.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/inotify.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/inotify_init1.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/io_uring_enter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/io_uring_register.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/io_uring_setup.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_block.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_dm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_dm-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_evdev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_evdev-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_inotify.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_kvm_run.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_kvm_run-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_kvm_run_auxstr_vcpu.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_loop.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_loop-nv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_loop-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_mtd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_nbd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_nsfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_perf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_ptp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_random.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_rtc.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_rtc-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_scsi.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_sg_io_v3.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_sg_io_v4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_sock_gifconf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_uffdio.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_v4l2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioperm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/iopl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ip_mreq.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msgbuf-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msgbuf-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msgbuf-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kcmp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kcmp-y.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kern_features.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kexec_file_load.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kexec_load.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kill.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lchown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lchown32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/link.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/linkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lookup_dcookie.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lstat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/madvise.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mbind.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/membarrier.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/migrate_pages.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mincore.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mkdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mkdirat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mknod.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mknodat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mlock.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mlock2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mlockall.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg-silent.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg_name.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg_name-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/modify_ldt.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq_sendrecv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq_sendrecv-read.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq_sendrecv-write.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/msg_control.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/msg_control-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/msg_name.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/munlockall.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nanosleep.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-icmp_filter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-sockaddr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-tpacket_req.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-tpacket_stats.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-yy-inet6.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_audit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_crypto.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_generic.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_kobject_uevent.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_netfilter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_protocol.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_route.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_selinux.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_xfrm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/newfstatat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_acct.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_cthelper.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ctnetlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ctnetlink_exp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_cttimeout.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ipset.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_nft_compat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_nftables.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_osf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_queue.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ulog.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_br_port_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_crypto_user_alg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_dcbmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_fib_rule_hdr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifaddrlblmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifaddrmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifinfomsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_af_spec.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_brport.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_linkinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_port.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_xdp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_inet_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_inet_diag_req_compat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_inet_diag_req_v2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_mdba_mdb_entry.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_mdba_router_port.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ndmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ndtmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_netconfmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_netlink_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_nlmsgerr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_packet_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_rtgenmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_rtmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_smc_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tc_stats.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tca_stab.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tcamsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tcmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_unix_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-v-none.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldfstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldlstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect-efault.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect-efault-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/open.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/openat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/orphaned_process_group.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/osf_utimes.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pause.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/perf_event_open.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/perf_event_open_nonverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/perf_event_open_unabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/personality-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/personality-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/personality-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pidfd_send_signal.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pipe2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pkey_alloc.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pkey_free.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pkey_mprotect.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ppoll.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ppoll-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ppoll-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pread64-pwrite64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/preadv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/preadv-pwritev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/preadv2-pwritev2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printpath-umovestr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printpath-umovestr-peekdata.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printpath-umovestr-undumpable.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printsignal-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printsignal-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printsignal-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstrn-umoven.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstrn-umoven-peekdata.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstrn-umoven-undumpable.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/prlimit64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/process_vm_readv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/process_vm_writev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pselect6.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ptrace.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ptrace_syscall_info.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pwritev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-xfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-xfs-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/read-write.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readahead.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readlinkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/reboot.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/recvfrom.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/recvmmsg-timeout.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/recvmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/regex.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rename.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/renameat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/renameat2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/request_key.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/riscv_flush_icache.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rmdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigpending.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigprocmask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigqueueinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigreturn.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigsuspend.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigtimedwait.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_tgsigqueueinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_guarded_storage.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_guarded_storage-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_pci_mmio_read_write.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_runtime_instr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_sthyi.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_sthyi-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_get_priority_mxx.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_rr_get_interval.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetaffinity.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetattr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetparam.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetscheduler.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_yield.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/seccomp-filter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/seccomp-filter-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/seccomp_get_action_avail.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/select.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/select-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/semop.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sendfile.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sendfile64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/set_mempolicy.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setdomainname.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgroups.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgroups32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sethostname.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setns.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setregid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setregid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setreuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setreuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/shmxt.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/shutdown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigaction.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/siginfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/signal.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/signal_receive.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/signalfd4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigpending.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigprocmask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigreturn.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigsuspend.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_error.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_linger.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockaddr_xlat-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockaddr_xlat-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockaddr_xlat-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/socketcall.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockopt-sol_netlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockopt-timestamp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/splice.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/stat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/stat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/statfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/statfs64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/statx.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/swap.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sxetmask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/symlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/symlinkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sync.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sync_file_range.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sync_file_range2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sysinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/syslog.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/tee.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/time.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/timer_create.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/timer_xettime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/timerfd_xettime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/times.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/times-fail.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_fstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_fstatfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_lstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_regex_32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_regex_64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_regex_x32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_x32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_question.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_stat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_stat_like.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_statfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_statfs_like.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/truncate.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/truncate64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ugetrlimit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umoven-illptr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umovestr-illptr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umovestr3.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/unlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/unlinkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/unshare.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/userfaultfd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ustat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimes.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/vfork-f.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/vhangup.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/vmsplice.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/wait4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/wait4-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/waitid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/waitid-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/waitpid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xattr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xattr-strings.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xet_robust_list.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xetitimer.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xetpgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xetpriority.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xettimeofday.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +@VALGRIND_CHECK_RULES@ + +ksysent.h: $(srcdir)/ksysent.sed + echo '#include ' | \ + $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -dM - > $@.t1 + LC_COLLATE=C sed -r -n -f $(srcdir)/ksysent.sed < $@.t1 > $@.t2 + mv -f $@.t2 $@ + rm -f $@.t1 + +ksysent.$(OBJEXT): ksysent.h +$(objects): scno.h + +clean-local: clean-local-check +.PHONY: clean-local-check +clean-local-check: + -rm -rf -- $(TESTS:.test=.dir) $(GEN_TESTS:.gen.test=.dir) + +.PHONY: check-valgrind-local +check-valgrind-local: $(check_LIBRARIES) $(check_PROGRAMS) -syscallent.i: $(top_srcdir)/$(OS)/$(ARCH)/syscallent.h - $(CPP) -P $(SCNO_CPPFLAGS) $^ -o $@ +syscallent.i: $(top_builddir)/config.h $(top_srcdir)/$(OS)/$(ARCH)/syscallent.h + $(CPP) -P $(SCNO_CPPFLAGS) -include $^ -o $@ scno.h: $(top_srcdir)/scno.head syscallent.i echo '/* Generated by Makefile from $^; do not edit. */' > $@-t diff --git a/tests-m32/PTRACE_SEIZE.sh b/tests-m32/PTRACE_SEIZE.sh new file mode 100755 index 00000000..9ffe4c78 --- /dev/null +++ b/tests-m32/PTRACE_SEIZE.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# +# Skip the test if PTRACE_SEIZE is not supported. +# +# Copyright (c) 2014-2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +$STRACE -d -enone / > /dev/null 2> "$LOG" ||: +if grep -x "[^:]*strace: PTRACE_SEIZE doesn't work" "$LOG" > /dev/null; then + skip_ "PTRACE_SEIZE doesn't work" +fi diff --git a/tests-m32/_newselect-P.c b/tests-m32/_newselect-P.c new file mode 100644 index 00000000..561fbfe2 --- /dev/null +++ b/tests-m32/_newselect-P.c @@ -0,0 +1,2 @@ +#define PATH_TRACING_FD 9 +#include "_newselect.c" diff --git a/tests-m32/_newselect-P.gen.test b/tests-m32/_newselect-P.gen.test new file mode 100755 index 00000000..9c4247a1 --- /dev/null +++ b/tests-m32/_newselect-P.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (_newselect-P -e trace=_newselect -P /dev/full 9>>/dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=_newselect -P /dev/full 9>>/dev/full diff --git a/tests-m32/_newselect.c b/tests-m32/_newselect.c index ae2bc51a..bfba2edb 100644 --- a/tests-m32/_newselect.c +++ b/tests-m32/_newselect.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/_newselect.gen.test b/tests-m32/_newselect.gen.test new file mode 100755 index 00000000..8e4d5f24 --- /dev/null +++ b/tests-m32/_newselect.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (_newselect ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/_newselect.test b/tests-m32/_newselect.test deleted file mode 100755 index 3371d4db..00000000 --- a/tests-m32/_newselect.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check _newselect syscall decoding. - -. "${srcdir=.}/select.test" diff --git a/tests-m32/accept.c b/tests-m32/accept.c index 8d42ba15..df5dee80 100644 --- a/tests-m32/accept.c +++ b/tests-m32/accept.c @@ -2,34 +2,40 @@ * Check decoding of accept syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ -#ifndef TEST_SYSCALL_NAME -# define TEST_SYSCALL_NAME accept -#endif +#include "tests.h" + +#include + +#include + +#if defined __NR_accept + +# ifndef TEST_SYSCALL_NAME +# define TEST_SYSCALL_NAME do_accept + +# ifndef TEST_SYSCALL_STR +# define TEST_SYSCALL_STR "accept" +# endif + +int do_accept(int sockfd, void *addr, void *addrlen) +{ + return syscall(__NR_accept, sockfd, addr, addrlen); +} +# endif /* !TEST_SYSCALL_NAME */ + +#else /* !__NR_accept */ + +# ifndef TEST_SYSCALL_NAME +# define TEST_SYSCALL_NAME accept +# endif + +#endif /* __NR_accept */ #define TEST_SYSCALL_PREPARE connect_un() static void connect_un(void); diff --git a/tests-m32/accept.gen.test b/tests-m32/accept.gen.test new file mode 100755 index 00000000..45d9239e --- /dev/null +++ b/tests-m32/accept.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (accept -a22 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests-m32/accept.test b/tests-m32/accept.test deleted file mode 100755 index b5e07904..00000000 --- a/tests-m32/accept.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of accept syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a22 diff --git a/tests-m32/accept4.c b/tests-m32/accept4.c index d26e15c5..692b7661 100644 --- a/tests-m32/accept4.c +++ b/tests-m32/accept4.c @@ -1,30 +1,10 @@ /* * Check decoding of accept4 syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/accept4.gen.test b/tests-m32/accept4.gen.test new file mode 100755 index 00000000..71199703 --- /dev/null +++ b/tests-m32/accept4.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (accept4 -a37 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a37 diff --git a/tests-m32/accept4.test b/tests-m32/accept4.test deleted file mode 100755 index 722f25a5..00000000 --- a/tests-m32/accept4.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of accept4 syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a37 diff --git a/tests-m32/accept_compat.h b/tests-m32/accept_compat.h new file mode 100644 index 00000000..0fbdc690 --- /dev/null +++ b/tests-m32/accept_compat.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef _STRACE_TESTS_ACCEPT_COMPAT_H_ +# define _STRACE_TESTS_ACCEPT_COMPAT_H_ + +# include +# include +# include + +# if defined __NR_socketcall && defined __sparc__ +/* + * Work around the fact that + * - glibc >= 2.26 uses accept4 syscall to implement accept() call on sparc; + * - accept syscall had not been wired up on sparc until v4.4-rc8~4^2~1. + */ +static inline int +do_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen) +{ + const long args[] = { sockfd, (long) addr, (long) addrlen }; + + return syscall(__NR_socketcall, 5, args); +} +# else +# define do_accept accept +# endif + +#endif /* !_STRACE_TESTS_ACCEPT_COMPAT_H_ */ diff --git a/tests-m32/access.c b/tests-m32/access.c index e6f169b2..cbdde6a2 100644 --- a/tests-m32/access.c +++ b/tests-m32/access.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -19,6 +26,7 @@ main(void) printf("access(\"%s\", R_OK|W_OK|X_OK) = %ld %s (%m)\n", sample, rc, errno2name()); + puts("+++ exited with 0 +++"); return 0; } diff --git a/tests-m32/access.gen.test b/tests-m32/access.gen.test new file mode 100755 index 00000000..7d80e6f8 --- /dev/null +++ b/tests-m32/access.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (access -a30 -P access_sample); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 -P access_sample diff --git a/tests-m32/access.test b/tests-m32/access.test deleted file mode 100755 index 3ab2eb4b..00000000 --- a/tests-m32/access.test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -# Check access syscall decoding. - -. "${srcdir=.}/init.sh" - -check_prog grep -run_prog > /dev/null -run_strace -eaccess -a30 $args > "$EXP" - -# Filter out access() calls made by libc. -grep -F access_sample < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-m32/acct.c b/tests-m32/acct.c index 1cc3fa56..2127df60 100644 --- a/tests-m32/acct.c +++ b/tests-m32/acct.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/acct.gen.test b/tests-m32/acct.gen.test new file mode 100755 index 00000000..4a98dd46 --- /dev/null +++ b/tests-m32/acct.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (acct -a20 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-m32/acct.test b/tests-m32/acct.test deleted file mode 100755 index b9bca754..00000000 --- a/tests-m32/acct.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check acct syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 diff --git a/tests-m32/add_key.c b/tests-m32/add_key.c index d2696f9b..c1014927 100644 --- a/tests-m32/add_key.c +++ b/tests-m32/add_key.c @@ -2,29 +2,10 @@ * Check decoding of add_key syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -70,8 +51,7 @@ main(void) { static const char unterminated1[] = { '\1', '\2', '\3', '\4', '\5' }; static const char unterminated2[] = { '\6', '\7', '\10', '\11', '\12' }; - static const char unterminated3[] = - { '\16', '\17', '\20', '\21', '\22' }; + static const char unterminated3[] = { '\16', '\17', '\20', '\21', '\22' }; char *bogus_type = tail_memdup(unterminated1, sizeof(unterminated1)); char *bogus_desc = tail_memdup(unterminated2, sizeof(unterminated2)); @@ -102,7 +82,7 @@ main(void) { bogus_desc, NULL }, { ARG_STR("\25\26\27\30\31") }, { ARG_STR("desc") }, - { "overly long description", _STR("overly long ") "..." }, + { "overly long description", STRINGIFY("overly long ") "..." }, }; struct { @@ -113,10 +93,10 @@ main(void) { ARG_STR(NULL), 0 }, { bogus_payload + sizeof(unterminated3), NULL, (size_t) 0xdeadbeefbadc0dedULL }, - { bogus_payload, _STR(""), 0 }, - { bogus_payload, _STR("\16\17\20\21\22"), 5 }, + { bogus_payload, STRINGIFY(""), 0 }, + { bogus_payload, STRINGIFY("\16\17\20\21\22"), 5 }, { bogus_payload, NULL, 10 }, - { "overly long payload", _STR("overly long ") "...", 15 }, + { "overly long payload", STRINGIFY("overly long ") "...", 15 }, }; struct { diff --git a/tests-m32/add_key.gen.test b/tests-m32/add_key.gen.test new file mode 100755 index 00000000..d6ffbc86 --- /dev/null +++ b/tests-m32/add_key.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (add_key -a30 -s12); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 -s12 diff --git a/tests-m32/add_key.test b/tests-m32/add_key.test deleted file mode 100755 index eadd8c2b..00000000 --- a/tests-m32/add_key.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of add_key syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a30 -s12 diff --git a/tests-m32/adjtimex.c b/tests-m32/adjtimex.c index 1638b535..87d3acdc 100644 --- a/tests-m32/adjtimex.c +++ b/tests-m32/adjtimex.c @@ -1,70 +1,56 @@ /* * This file is part of adjtimex strace test. * - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2019 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" +#include #include #include #include #include +#include "xlat.h" +#include "xlat/adjtimex_state.h" +#include "xlat/adjtimex_status.h" + int main(void) { - adjtimex(NULL); - printf("adjtimex\\(NULL\\) = -1 EFAULT \\(%m\\)\n"); + int state = adjtimex(NULL); + printf("adjtimex(NULL) = %s\n", sprintrc(state)); - struct timex * const tx = tail_alloc(sizeof(*tx)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timex, tx); memset(tx, 0, sizeof(*tx)); - int state = adjtimex(tx); + state = adjtimex(tx); if (state < 0) perror_msg_and_skip("adjtimex"); - printf("adjtimex\\(\\{modes=0, offset=%jd, freq=%jd, maxerror=%jd" - ", esterror=%jd, status=%s, constant=%jd, precision=%jd" - ", tolerance=%jd, time=\\{tv_sec=%jd, tv_usec=%jd\\}, tick=%jd, " - "ppsfreq=%jd, jitter=%jd, shift=%d, stabil=%jd, jitcnt=%jd, " - "calcnt=%jd, errcnt=%jd, stbcnt=%jd" -#ifdef HAVE_STRUCT_TIMEX_TAI - ", tai=%d" -#endif - "\\}\\) = %d \\(TIME_[A-Z]+\\)\n", + printf("adjtimex({modes=0, offset=%jd, freq=%jd, maxerror=%jd" + ", esterror=%jd, status=", (intmax_t) tx->offset, (intmax_t) tx->freq, (intmax_t) tx->maxerror, - (intmax_t) tx->esterror, - tx->status ? "STA_[A-Z]+(\\|STA_[A-Z]+)*" : "0", + (intmax_t) tx->esterror); + if (tx->status) + printflags(adjtimex_status, (unsigned int) tx->status, NULL); + else + putchar('0'); + printf(", constant=%jd, precision=%jd" + ", tolerance=%jd, time={tv_sec=%lld, tv_usec=%llu}, tick=%jd" + ", ppsfreq=%jd, jitter=%jd, shift=%d, stabil=%jd, jitcnt=%jd" + ", calcnt=%jd, errcnt=%jd, stbcnt=%jd, tai=%d" + "}) = %d (", (intmax_t) tx->constant, (intmax_t) tx->precision, (intmax_t) tx->tolerance, - (intmax_t) tx->time.tv_sec, - (intmax_t) tx->time.tv_usec, + (long long) tx->time.tv_sec, + zero_extend_signed_to_ull(tx->time.tv_usec), (intmax_t) tx->tick, (intmax_t) tx->ppsfreq, (intmax_t) tx->jitter, @@ -76,8 +62,13 @@ main(void) (intmax_t) tx->stbcnt, #ifdef HAVE_STRUCT_TIMEX_TAI tx->tai, +#else + *(const int *)((const void *) tx + offsetofend(struct timex, stbcnt)), #endif state); + printxval(adjtimex_state, (unsigned int) state, NULL); + puts(")"); + puts("+++ exited with 0 +++"); return 0; } diff --git a/tests-m32/adjtimex.gen.test b/tests-m32/adjtimex.gen.test new file mode 100755 index 00000000..e6024431 --- /dev/null +++ b/tests-m32/adjtimex.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (adjtimex -a15 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests-m32/adjtimex.test b/tests-m32/adjtimex.test deleted file mode 100755 index 01405501..00000000 --- a/tests-m32/adjtimex.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check adjtimex syscall decoding. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a 15 -e adjtimex $args > "$OUT" -match_grep "$LOG" "$OUT" -rm -f "$OUT" - -exit 0 diff --git a/tests-m32/aio.c b/tests-m32/aio.c index 0766d23a..13821998 100644 --- a/tests-m32/aio.c +++ b/tests-m32/aio.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -198,15 +179,14 @@ main(void) }; const long *cbvs2 = tail_memdup(proto_cbvs2, sizeof(proto_cbvs2)); - unsigned long *ctx = tail_alloc(sizeof(unsigned long)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned long, ctx); *ctx = 0; const unsigned int nr = ARRAY_SIZE(proto_cb); const unsigned long lnr = (unsigned long) (0xdeadbeef00000000ULL | nr); const struct io_event *ev = tail_alloc(nr * sizeof(struct io_event)); - const struct timespec proto_ts = { .tv_nsec = 123456789 }; - const struct timespec *ts = tail_memdup(&proto_ts, sizeof(proto_ts)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, ts); (void) close(0); if (open("/dev/zero", O_RDONLY)) @@ -239,11 +219,12 @@ main(void) if (rc != (long) nr) perror_msg_and_skip("io_submit"); printf("io_submit(%#lx, %u, [" - "{data=%#" PRI__x64 ", pread, reqprio=11, fildes=0, " - "buf=%p, nbytes=%u, offset=%" PRI__d64 "}, " - "{data=%#" PRI__x64 ", pread, reqprio=22, fildes=0, " - "buf=%p, nbytes=%u, offset=%" PRI__d64 "}" - "]) = %s\n", + "{aio_data=%#" PRI__x64 ", aio_lio_opcode=IOCB_CMD_PREAD" + ", aio_reqprio=11, aio_fildes=0, aio_buf=%p, aio_nbytes=%u" + ", aio_offset=%" PRI__d64 + "}, {aio_data=%#" PRI__x64 ", aio_lio_opcode=IOCB_CMD_PREAD" + ", aio_reqprio=22, aio_fildes=0, aio_buf=%p, aio_nbytes=%u" + ", aio_offset=%" PRI__d64 "}]) = %s\n", *ctx, nr, cb[0].aio_data, data0, sizeof_data0, cb[0].aio_offset, cb[1].aio_data, data1, sizeof_data1, cb[1].aio_offset, @@ -263,6 +244,24 @@ main(void) bogus_ctx, (long) 0xca7faceddeadf00dLL, (long) 0xba5e1e505ca571e0LL, ts + 1, sprintrc(rc)); + ts->tv_sec = 0xdeadbeefU; + ts->tv_nsec = 0xfacefeedU; + rc = syscall(__NR_io_getevents, bogus_ctx, 0, 0, 0, ts); + printf("io_getevents(%#lx, 0, 0, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + bogus_ctx, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), sprintrc(rc)); + + ts->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + ts->tv_nsec = (long) 0xbadc0dedfacefeedLL; + rc = syscall(__NR_io_getevents, bogus_ctx, 0, 0, 0, ts); + printf("io_getevents(%#lx, 0, 0, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + bogus_ctx, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), sprintrc(rc)); + + ts->tv_sec = 0; + ts->tv_nsec = 123456789; rc = syscall(__NR_io_getevents, *ctx, nr, nr + 1, ev, ts); printf("io_getevents(%#lx, %ld, %ld, [" "{data=%#" PRI__x64 ", obj=%p, res=%u, res2=0}, " @@ -281,8 +280,9 @@ main(void) sprintrc(rc)); rc = syscall(__NR_io_cancel, *ctx, cbc, ev); - printf("io_cancel(%#lx, {data=%#" PRI__x64 - ", pread, reqprio=99, fildes=-42}, %p) = %s\n", + printf("io_cancel(%#lx, {aio_data=%#" PRI__x64 + ", aio_lio_opcode=IOCB_CMD_PREAD, aio_reqprio=99" + ", aio_fildes=-42}, %p) = %s\n", *ctx, cbc->aio_data, ev, sprintrc(rc)); rc = syscall(__NR_io_submit, (unsigned long) 0xfacef157beeff00dULL, @@ -295,23 +295,26 @@ main(void) printf("io_submit(%#lx, %ld, %p) = %s\n", *ctx, -1L, cbvs + nr, sprintrc(rc)); - rc = syscall(__NR_io_submit, *ctx, 1057L, cbvs2); printf("io_submit(%#lx, %ld, [" - "{data=%#" PRI__x64 ", key=%u, %hu /* SUB_??? */, fildes=%d}, " - "{key=%u, pwrite, reqprio=%hd, fildes=%d, str=NULL" - ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 + "{aio_data=%#" PRI__x64 ", aio_key=%u" + ", aio_lio_opcode=%hu /* IOCB_CMD_??? */, aio_fildes=%d}" + ", {aio_key=%u, aio_lio_opcode=IOCB_CMD_PWRITE, aio_reqprio=%hd" + ", aio_fildes=%d, aio_buf=NULL" + ", aio_nbytes=%" PRI__u64 ", aio_offset=%" PRI__d64 # ifdef IOCB_FLAG_RESFD - ", resfd=%d, flags=%#x" + ", aio_resfd=%d, aio_flags=%#x" # endif - "}, " - "{key=%u, pwrite, reqprio=%hd, fildes=%d, buf=%#" PRI__x64 - ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}, " - "{key=%u, pwrite, reqprio=%hd, fildes=%d" - ", str=\"\\0\\1\\2\\3%.28s\"..." - ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}, " - "{key=%u, pwritev, reqprio=%hd, fildes=%d, buf=%#" PRI__x64 - ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}" - ", {NULL}, {%#lx}, %p]) = %s\n", + "}, {aio_key=%u, aio_lio_opcode=IOCB_CMD_PWRITE" + ", aio_reqprio=%hd, aio_fildes=%d, aio_buf=%#" PRI__x64 + ", aio_nbytes=%" PRI__u64 ", aio_offset=%" PRI__d64 + "}, {aio_key=%u, aio_lio_opcode=IOCB_CMD_PWRITE" + ", aio_reqprio=%hd, aio_fildes=%d" + ", aio_buf=\"\\0\\1\\2\\3%.28s\"..." + ", aio_nbytes=%" PRI__u64 ", aio_offset=%" PRI__d64 + "}, {aio_key=%u, aio_lio_opcode=IOCB_CMD_PWRITEV" + ", aio_reqprio=%hd, aio_fildes=%d, aio_buf=%#" PRI__x64 + ", aio_nbytes=%" PRI__u64 ", aio_offset=%" PRI__d64 + "}, NULL, %#lx, ... /* %p */]) = ", *ctx, 1057L, cbv2[0].aio_data, cbv2[0].aio_key, cbv2[0].aio_lio_opcode, cbv2[0].aio_fildes, @@ -326,18 +329,22 @@ main(void) data2 + 4, cbv2[3].aio_nbytes, cbv2[3].aio_offset, cbv2[4].aio_key, cbv2[4].aio_reqprio, cbv2[4].aio_fildes, cbv2[4].aio_buf, cbv2[4].aio_nbytes, cbv2[4].aio_offset, - cbvs2[6], cbvs2 + 7, sprintrc(rc)); + cbvs2[6], cbvs2 + 7); + rc = syscall(__NR_io_submit, *ctx, 1057L, cbvs2); + puts(sprintrc(rc)); rc = syscall(__NR_io_submit, *ctx, nr, cbvs); if (rc != (long) nr) perror_msg_and_skip("io_submit"); printf("io_submit(%#lx, %u, [" - "{data=%#" PRI__x64 ", preadv, reqprio=%hd, fildes=0, " - "iovec=[{iov_base=%p, iov_len=%u}" - ", {iov_base=%p, iov_len=%u}], offset=%" PRI__d64 "}, " - "{data=%#" PRI__x64 ", preadv, reqprio=%hd, fildes=0, " - "iovec=[{iov_base=%p, iov_len=%u}" - ", {iov_base=%p, iov_len=%u}], offset=%" PRI__d64 "}" + "{aio_data=%#" PRI__x64 ", aio_lio_opcode=IOCB_CMD_PREADV" + ", aio_reqprio=%hd, aio_fildes=0, " + "aio_buf=[{iov_base=%p, iov_len=%u}" + ", {iov_base=%p, iov_len=%u}], aio_offset=%" PRI__d64 "}, " + "{aio_data=%#" PRI__x64 ", aio_lio_opcode=IOCB_CMD_PREADV" + ", aio_reqprio=%hd, aio_fildes=0" + ", aio_buf=[{iov_base=%p, iov_len=%u}" + ", {iov_base=%p, iov_len=%u}], aio_offset=%" PRI__d64 "}" "]) = %s\n", *ctx, nr, cbv[0].aio_data, cbv[0].aio_reqprio, diff --git a/tests-m32/aio.gen.test b/tests-m32/aio.gen.test new file mode 100755 index 00000000..8c8cbd5c --- /dev/null +++ b/tests-m32/aio.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (aio -a14 -e trace=io_setup,io_submit,io_getevents,io_cancel,io_destroy); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 -e trace=io_setup,io_submit,io_getevents,io_cancel,io_destroy diff --git a/tests-m32/aio.test b/tests-m32/aio.test deleted file mode 100755 index 2ba90da8..00000000 --- a/tests-m32/aio.test +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -# Check io_* syscalls decoding. - -. "${srcdir=.}/init.sh" - -syscalls=io_setup,io_submit,io_getevents,io_cancel,io_destroy -run_strace_match_diff -a14 -e trace=$syscalls diff --git a/tests-m32/aio_pgetevents.c b/tests-m32/aio_pgetevents.c new file mode 100644 index 00000000..8bea0b7b --- /dev/null +++ b/tests-m32/aio_pgetevents.c @@ -0,0 +1,170 @@ +/* + * Check decoding of io_pgetevents syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include "scno.h" + +#if defined __NR_io_setup && defined __NR_io_pgetevents + +# include +# include +# include +# include + +# include "nsig.h" + +# include + +# if !HAVE_STRUCT___AIO_SIGSET +struct __aio_sigset { + sigset_t *sigmask; + size_t sigsetsize; +}; +# endif + +static const char *errstr; + +static long +sys_io_pgetevents(const kernel_ulong_t ctx_id, + const kernel_long_t min_nr, + const kernel_long_t nr, + const kernel_ulong_t events, + const kernel_ulong_t timeout, + const kernel_ulong_t usig) +{ + long rc = syscall(__NR_io_pgetevents, ctx_id, min_nr, nr, + events, timeout, usig); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const kernel_ulong_t bogus_ctx = + (kernel_ulong_t) 0xface1e55deadbeefLL; + static const kernel_long_t bogus_min_nr = + (kernel_long_t) 0xca7faceddeadf00dLL; + static const kernel_long_t bogus_nr = + (kernel_long_t) 0xba5e1e505ca571e0LL; + static const size_t bogus_sigsetsize = + (size_t) 0xdeadbeefbadcaffeULL; + + const unsigned int sizeof_data0 = 4096; + const unsigned int sizeof_data1 = 8192; + void *data0 = tail_alloc(sizeof_data0); + void *data1 = tail_alloc(sizeof_data1); + + const struct iocb proto_cb[] = { + { + .aio_data = (unsigned long) 0xfeedface11111111ULL, + .aio_reqprio = 11, + .aio_buf = (unsigned long) data0, + .aio_offset = (unsigned long) 0xdeface1facefeedULL, + .aio_nbytes = sizeof_data0 + }, + { + .aio_data = (unsigned long) 0xfeedface22222222ULL, + .aio_reqprio = 22, + .aio_buf = (unsigned long) data1, + .aio_offset = (unsigned long) 0xdeface2cafef00dULL, + .aio_nbytes = sizeof_data1 + } + }; + const struct iocb *cb = tail_memdup(proto_cb, sizeof(proto_cb)); + + const long proto_cbs[] = { + (long) &cb[0], (long) &cb[1] + }; + const long *cbs = tail_memdup(proto_cbs, sizeof(proto_cbs)); + + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned long, ctx); + *ctx = 0; + + const unsigned int nr = ARRAY_SIZE(proto_cb); + + const struct io_event *ev = tail_alloc(nr * sizeof(struct io_event)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, ts); + TAIL_ALLOC_OBJECT_CONST_PTR(struct __aio_sigset, ss); + TAIL_ALLOC_OBJECT_CONST_PTR(sigset_t, sigs); + + (void) close(0); + if (open("/dev/zero", O_RDONLY)) + perror_msg_and_skip("open: %s", "/dev/zero"); + + if (syscall(__NR_io_setup, nr, ctx)) + perror_msg_and_skip("io_setup"); + + if (syscall(__NR_io_submit, *ctx, nr, cbs) != (long) nr) + perror_msg_and_skip("io_submit"); + + sys_io_pgetevents(bogus_ctx, bogus_min_nr, bogus_nr, + (uintptr_t) (ev + 1), 0, 0); + printf("io_pgetevents(%#jx, %ld, %ld, %p, NULL, NULL) = %s\n", + (uintmax_t) bogus_ctx, (long) bogus_min_nr, + (long) bogus_nr, ev + 1, errstr); + + sys_io_pgetevents(bogus_ctx, bogus_min_nr, bogus_nr, + 0, (uintptr_t) (ts + 1), 0); + printf("io_pgetevents(%#jx, %ld, %ld, NULL, %p, NULL) = %s\n", + (uintmax_t) bogus_ctx, (long) bogus_min_nr, + (long) bogus_nr, ts + 1, errstr); + + sys_io_pgetevents(bogus_ctx, bogus_min_nr, bogus_nr, + 0, 0, (uintptr_t) (ss + 1)); + printf("io_pgetevents(%#jx, %ld, %ld, NULL, NULL, %p) = %s\n", + (uintmax_t) bogus_ctx, (long) bogus_min_nr, + (long) bogus_nr, ss + 1, errstr); + + ss->sigmask = sigs + 1; + ss->sigsetsize = bogus_sigsetsize; + sys_io_pgetevents(bogus_ctx, bogus_min_nr, bogus_nr, + 0, 0, (uintptr_t) ss); + printf("io_pgetevents(%#jx, %ld, %ld, NULL, NULL" + ", {sigmask=%p, sigsetsize=%zu}) = %s\n", + (uintmax_t) bogus_ctx, (long) bogus_min_nr, + (long) bogus_nr, sigs + 1, bogus_sigsetsize, errstr); + + ts->tv_sec = 0xdeadbeefU; + ts->tv_nsec = 0xfacefeedU; + ss->sigmask = sigs; + ss->sigsetsize = NSIG_BYTES; + sys_io_pgetevents(bogus_ctx, 0, 0, 0, (uintptr_t) ts, (uintptr_t) ss); + printf("io_pgetevents(%#jx, 0, 0, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}" + ", {sigmask=~[], sigsetsize=%u}) = %s\n", + (uintmax_t) bogus_ctx, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), NSIG_BYTES, + errstr); + + sigemptyset(sigs); + sigaddset(sigs, SIGSYS); + + ts->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + ts->tv_nsec = (long) 0xbadc0dedfacefeedLL; + sys_io_pgetevents(bogus_ctx, 0, 0, 0, (uintptr_t) ts, (uintptr_t) ss); + printf("io_pgetevents(%#jx, 0, 0, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}" + ", {sigmask=[SYS], sigsetsize=%u}) = %s\n", + (uintmax_t) bogus_ctx, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), NSIG_BYTES, + errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_io_setup && __NR_io_pgetevents") + +#endif diff --git a/tests-m32/aio_pgetevents.gen.test b/tests-m32/aio_pgetevents.gen.test new file mode 100755 index 00000000..7ea3874d --- /dev/null +++ b/tests-m32/aio_pgetevents.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (aio_pgetevents -e trace=io_pgetevents); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=io_pgetevents diff --git a/tests-m32/alarm.c b/tests-m32/alarm.c index 291b26ad..35404535 100644 --- a/tests-m32/alarm.c +++ b/tests-m32/alarm.c @@ -1,30 +1,10 @@ /* * This file is part of alarm strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/alarm.gen.test b/tests-m32/alarm.gen.test new file mode 100755 index 00000000..25982e14 --- /dev/null +++ b/tests-m32/alarm.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (alarm -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-m32/alarm.test b/tests-m32/alarm.test deleted file mode 100755 index 267b2239..00000000 --- a/tests-m32/alarm.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check alarm syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 diff --git a/tests-m32/answer.c b/tests-m32/answer.c index ae3059a4..a69adc39 100644 --- a/tests-m32/answer.c +++ b/tests-m32/answer.c @@ -1,30 +1,10 @@ /* * Check decoding of fault injected exit_group syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/attach-f-p-cmd.c b/tests-m32/attach-f-p-cmd.c index 77594beb..ab293839 100644 --- a/tests-m32/attach-f-p-cmd.c +++ b/tests-m32/attach-f-p-cmd.c @@ -2,29 +2,10 @@ * This file is part of attach-f-p strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -34,6 +15,8 @@ int main(void) { + skip_if_unavailable("/proc/self/task/"); + static const char dir[] = "attach-f-p.test cmd"; pid_t pid = getpid(); int rc = chdir(dir); diff --git a/tests-m32/attach-f-p.c b/tests-m32/attach-f-p.c index 3f9a7e3e..3b7aed85 100644 --- a/tests-m32/attach-f-p.c +++ b/tests-m32/attach-f-p.c @@ -1,30 +1,10 @@ /* * This file is part of attach-f-p strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/attach-f-p.test b/tests-m32/attach-f-p.test index f4170740..b7a4a0d1 100755 --- a/tests-m32/attach-f-p.test +++ b/tests-m32/attach-f-p.test @@ -3,48 +3,24 @@ # Check that -f -p attaches to threads properly. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -# strace -f -p is implemented using /proc/$pid/task/ -[ -d /proc/self/task/ ] || - framework_skip_ '/proc/self/task/ is not available' run_prog_skip_if_failed \ kill -0 $$ -run_prog ./attach-f-p-cmd > /dev/null +run_prog ../attach-f-p-cmd > /dev/null -rm -f "$OUT" -./set_ptracer_any sh -c "exec ./attach-f-p >> $OUT" > /dev/null & +../set_ptracer_any sh -c "exec ../attach-f-p >> $EXP" > /dev/null & tracee_pid=$! -while ! [ -s "$OUT" ]; do +while ! [ -s "$EXP" ]; do kill -0 $tracee_pid 2> /dev/null || fail_ 'set_ptracer_any sh failed' done -run_strace -a32 -f -echdir -p $tracee_pid ./attach-f-p-cmd > "$OUT" -match_diff "$LOG" "$OUT" -rm -f "$OUT" +run_strace -a32 -f -echdir -p $tracee_pid ../attach-f-p-cmd > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests-m32/attach-p-cmd-cmd.c b/tests-m32/attach-p-cmd-cmd.c index d0f824e9..aa0f3f58 100644 --- a/tests-m32/attach-p-cmd-cmd.c +++ b/tests-m32/attach-p-cmd-cmd.c @@ -1,30 +1,10 @@ /* * This file is part of attach-p-cmd strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,19 +12,41 @@ #include #include #include +#include "attach-p-cmd.h" -int -main(void) +static void +write_pidfile(const pid_t pid) +{ + FILE *fp = fopen(pidfile, "w"); + if (!fp) + perror_msg_and_fail("fopen: %s", pidfile); + + if (fprintf(fp, "%d", pid) < 0) + perror_msg_and_fail("fprintf: %s", pidfile); + + if (fclose(fp)) + perror_msg_and_fail("fclose: %s", pidfile); +} + +static void +wait_for_peer_invocation(void) { - static const char lockdir[] = "attach-p-cmd.test-lock"; /* wait for the lock directory to be created by peer */ while (rmdir(lockdir)) { if (ENOENT != errno) perror_msg_and_fail("rmdir: %s", lockdir); } +} + +int +main(void) +{ + const pid_t pid = getpid(); + write_pidfile(pid); + + wait_for_peer_invocation(); static const char dir[] = "attach-p-cmd.test cmd"; - pid_t pid = getpid(); int rc = chdir(dir); printf("%-5d chdir(\"%s\") = %s\n" diff --git a/tests-m32/attach-p-cmd-p.c b/tests-m32/attach-p-cmd-p.c index 254d19ae..5fde01e2 100644 --- a/tests-m32/attach-p-cmd-p.c +++ b/tests-m32/attach-p-cmd-p.c @@ -1,30 +1,10 @@ /* * This file is part of attach-p-cmd strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -33,27 +13,14 @@ #include #include #include +#include #include +#include "attach-p-cmd.h" static void -handler(int signo) -{ -} - -int -main(void) +wait_for_peer_invocation(void) { - const struct sigaction act = { .sa_handler = handler }; - if (sigaction(SIGALRM, &act, NULL)) - perror_msg_and_fail("sigaction"); - - sigset_t mask = {}; - sigaddset(&mask, SIGALRM); - if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) - perror_msg_and_fail("sigprocmask"); - - static const char lockdir[] = "attach-p-cmd.test-lock"; - /* create a lock directory */ + /* create the lock directory */ if (mkdir(lockdir, 0700)) perror_msg_and_fail("mkdir: %s", lockdir); @@ -63,21 +30,51 @@ main(void) perror_msg_and_fail("mkdir: %s", lockdir); } - /* remove the lock directory */ + /* cleanup the lock directory */ if (rmdir(lockdir)) perror_msg_and_fail("rmdir: %s", lockdir); +} + +static void +wait_for_peer_termination(void) +{ + FILE *fp = fopen(pidfile, "r"); + if (!fp) + perror_msg_and_fail("fopen: %s", pidfile); + + pid_t pid; + if (fscanf(fp, "%d", &pid) < 0) + perror_msg_and_fail("fscanf: %s", pidfile); + if (pid < 0) + error_msg_and_fail("pid = %d", pid); + + if (fclose(fp)) + perror_msg_and_fail("fclose: %s", pidfile); + + if (unlink(pidfile)) + perror_msg_and_fail("unlink: %s", pidfile); + + while (kill(pid, 0) == 0) + ; +} + +int +main(void) +{ + wait_for_peer_invocation(); + wait_for_peer_termination(); - alarm(1); - pause(); + static const struct timespec ts = { .tv_nsec = 123456789 }; + if (nanosleep(&ts, NULL)) + perror_msg_and_fail("nanosleep"); static const char dir[] = "attach-p-cmd.test -p"; pid_t pid = getpid(); int rc = chdir(dir); - printf("%-5d --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---\n" - "%-5d chdir(\"%s\") = %d %s (%m)\n" + printf("%-5d chdir(\"%s\") = %s\n" "%-5d +++ exited with 0 +++\n", - pid, pid, dir, rc, errno2name(), pid); + pid, dir, sprintrc(rc), pid); return 0; } diff --git a/tests-m32/attach-p-cmd.h b/tests-m32/attach-p-cmd.h new file mode 100644 index 00000000..5f27cd10 --- /dev/null +++ b/tests-m32/attach-p-cmd.h @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +static const char lockdir[] = "attach-p-cmd.test-lock"; +static const char pidfile[] = "attach-p-cmd.test-pid"; diff --git a/tests-m32/attach-p-cmd.test b/tests-m32/attach-p-cmd.test index 2068cf1d..6240ca94 100755 --- a/tests-m32/attach-p-cmd.test +++ b/tests-m32/attach-p-cmd.test @@ -3,45 +3,23 @@ # Check that simultaneous use of -p option and tracing of a command works. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog_skip_if_failed \ kill -0 $$ -rm -rf attach-p-cmd.test-lock -rm -f "$OUT" -./set_ptracer_any ./attach-p-cmd-p >> "$OUT" & +../set_ptracer_any ../attach-p-cmd-p >> "$EXP" & tracee_pid=$! -while ! [ -s "$OUT" ]; do +while ! [ -s "$EXP" ]; do kill -0 $tracee_pid 2> /dev/null || - fail_ 'set_ptracer_any ./attach-p-cmd-p failed' + fail_ 'set_ptracer_any ../attach-p-cmd-p failed' done -run_strace -a30 -echdir -p $tracee_pid ./attach-p-cmd-cmd > "$OUT" -match_diff "$LOG" "$OUT" -rm -f "$OUT" +run_strace -a30 -echdir -p $tracee_pid ../attach-p-cmd-cmd > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests-m32/bexecve.test b/tests-m32/bexecve.test index f1ab04f1..7a135871 100755 --- a/tests-m32/bexecve.test +++ b/tests-m32/bexecve.test @@ -3,29 +3,10 @@ # Check -bexecve behavior. # # Copyright (c) 2015 Dmitry V. Levin +# Copyright (c) 2015-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -35,14 +16,14 @@ run_strace_redir() $STRACE "$@" 2> "$LOG" } -run_strace_redir -enone ./set_ptracer_any true || +run_strace_redir -enone ../set_ptracer_any true || dump_log_and_fail_with "$STRACE $args: unexpected exit status" -run_strace_redir -enone ./set_ptracer_any false +run_strace_redir -enone ../set_ptracer_any false [ $? -eq 1 ] || dump_log_and_fail_with "$STRACE $args: unexpected exit status" -run_strace_redir -bexecve -enone ./set_ptracer_any false || +run_strace_redir -bexecve -enone ../set_ptracer_any false || dump_log_and_fail_with "$STRACE $args: unexpected exit status" pattern_detached='[^:]*strace: Process [1-9][0-9]* detached' diff --git a/tests-m32/block_reset_raise_run.c b/tests-m32/block_reset_raise_run.c new file mode 100644 index 00000000..45387b9e --- /dev/null +++ b/tests-m32/block_reset_raise_run.c @@ -0,0 +1,35 @@ +/* + * Execute a command with blocked, reset, and raised signal. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +int +main(int ac, char **av) +{ + if (ac < 3) + error_msg_and_fail("usage: block_reset_raise_run signo path..."); + + sigset_t mask; + sigemptyset(&mask); + const int signo = atoi(av[1]); + if (sigaddset(&mask, signo)) + perror_msg_and_fail("sigaddset: %s", av[1]); + if (sigprocmask(SIG_BLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + if (signal(signo, SIG_DFL) == SIG_ERR) + perror_msg_and_fail("signal: %s", av[1]); + if (raise(signo)) + perror_msg_and_fail("raise: %s", av[1]); + + execvp(av[2], av + 2); + perror_msg_and_fail("execvp: %s", av[2]); +} diff --git a/tests-m32/bpf-obj_get_info_by_fd-prog-v.c b/tests-m32/bpf-obj_get_info_by_fd-prog-v.c new file mode 100644 index 00000000..d7e10b43 --- /dev/null +++ b/tests-m32/bpf-obj_get_info_by_fd-prog-v.c @@ -0,0 +1,3 @@ +#define CHECK_OBJ_PROG 1 +#define VERBOSE 1 +#include "bpf-obj_get_info_by_fd.c" diff --git a/tests-m32/bpf-obj_get_info_by_fd-prog-v.gen.test b/tests-m32/bpf-obj_get_info_by_fd-prog-v.gen.test new file mode 100755 index 00000000..fcaa1d8b --- /dev/null +++ b/tests-m32/bpf-obj_get_info_by_fd-prog-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (bpf-obj_get_info_by_fd-prog-v -a20 -y -v -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -y -v -e trace=bpf diff --git a/tests-m32/bpf-obj_get_info_by_fd-prog.c b/tests-m32/bpf-obj_get_info_by_fd-prog.c new file mode 100644 index 00000000..19a5f75a --- /dev/null +++ b/tests-m32/bpf-obj_get_info_by_fd-prog.c @@ -0,0 +1,2 @@ +#define CHECK_OBJ_PROG 1 +#include "bpf-obj_get_info_by_fd.c" diff --git a/tests-m32/bpf-obj_get_info_by_fd-prog.gen.test b/tests-m32/bpf-obj_get_info_by_fd-prog.gen.test new file mode 100755 index 00000000..8cbd7c04 --- /dev/null +++ b/tests-m32/bpf-obj_get_info_by_fd-prog.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (bpf-obj_get_info_by_fd-prog -a20 -y -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -y -e trace=bpf diff --git a/tests-m32/bpf-obj_get_info_by_fd-v.c b/tests-m32/bpf-obj_get_info_by_fd-v.c new file mode 100644 index 00000000..2debc5f1 --- /dev/null +++ b/tests-m32/bpf-obj_get_info_by_fd-v.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "bpf-obj_get_info_by_fd.c" diff --git a/tests-m32/bpf-obj_get_info_by_fd-v.gen.test b/tests-m32/bpf-obj_get_info_by_fd-v.gen.test new file mode 100755 index 00000000..255d91e9 --- /dev/null +++ b/tests-m32/bpf-obj_get_info_by_fd-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (bpf-obj_get_info_by_fd-v -a20 -y -v -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -y -v -e trace=bpf diff --git a/tests-m32/bpf-obj_get_info_by_fd.c b/tests-m32/bpf-obj_get_info_by_fd.c new file mode 100644 index 00000000..3e18591d --- /dev/null +++ b/tests-m32/bpf-obj_get_info_by_fd.c @@ -0,0 +1,608 @@ +/* + * Check bpf(BPF_OBJ_GET_INFO_BY_FD) decoding. + * + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifndef CHECK_OBJ_PROG +# define CHECK_OBJ_PROG 0 +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "print_fields.h" +#include "scno.h" + +#ifdef HAVE_LINUX_BPF_H +# include +#endif + +#include "bpf_attr.h" + +#include "xlat.h" +#include "xlat/bpf_map_flags.h" +#include "xlat/bpf_map_types.h" +#include "xlat/bpf_prog_types.h" + +#define XLAT_MACROS_ONLY +#include "xlat/bpf_commands.h" +#include "xlat/bpf_op_alu.h" +#include "xlat/bpf_op_jmp.h" +#include "xlat/bpf_size.h" +#include "xlat/bpf_src.h" +#include "xlat/ebpf_class.h" +#include "xlat/ebpf_mode.h" +#include "xlat/ebpf_op_alu.h" +#include "xlat/ebpf_regs.h" +#include "xlat/ebpf_size.h" + +#ifndef HAVE_STRUCT_BPF_INSN +struct bpf_insn { + uint8_t code; + uint8_t dst_reg:4; + uint8_t src_reg:4; + int16_t off; + int32_t imm; +}; +#endif + +static const char *errstr; + +static long +sys_bpf(kernel_ulong_t cmd, void *attr, kernel_ulong_t size) +{ + long rc = syscall(__NR_bpf, cmd, attr, size); + errstr = sprintrc(rc); + return rc; +} + +static void +print_map_create(void *attr_void, size_t size, long rc) +{ + /* struct BPF_MAP_CREATE_struct *attr = attr_void; */ + + printf("bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_ARRAY, key_size=4" + ", value_size=8, max_entries=1"); + if (size > offsetof(struct BPF_MAP_CREATE_struct, map_flags)) + printf(", map_flags=0"); + if (size > offsetof(struct BPF_MAP_CREATE_struct, inner_map_fd)) + printf(", inner_map_fd=0"); + if (size > offsetof(struct BPF_MAP_CREATE_struct, map_name)) + printf(", map_name=\"test_map\""); + if (size > offsetof(struct BPF_MAP_CREATE_struct, map_ifindex)) + printf(", map_ifindex=0"); + if (size > offsetof(struct BPF_MAP_CREATE_struct, btf_fd)) { + printf(", btf_fd=0" + ", btf_key_type_id=0, btf_value_type_id=0"); + } + printf("}, %zu) = ", size); + if (rc >= 0) + printf("%ld\n", rc); + else + puts(errstr); +} + +#if CHECK_OBJ_PROG +static struct bpf_insn socket_prog[] = { + { /* 0 */ + .code = BPF_ALU64 | BPF_K | BPF_MOV, + .dst_reg = BPF_REG_1, + .imm = 0, + }, + { /* 1 */ + .code = BPF_STX | BPF_W | BPF_MEM, + .dst_reg = BPF_REG_10, + .src_reg = BPF_REG_1, + .off = -4, + }, + { /* 2 */ + .code = BPF_ALU64 | BPF_X | BPF_MOV, + .dst_reg = BPF_REG_2, + .src_reg = BPF_REG_10, + }, + { /* 3 */ + .code = BPF_ALU64 | BPF_K | BPF_ADD, + .dst_reg = BPF_REG_2, + .imm = -4, + }, + { /* 4 */ + .code = BPF_LD | BPF_DW | BPF_IMM, + .dst_reg = BPF_REG_1, + .src_reg = 1 /* BPF_PSEUDO_MAP_FD */, + .imm = 0, /* to be set to map fd */ + }, + { /* 5 */ + .imm = 0, + }, + { /* 6 */ + .code = BPF_JMP | BPF_K | BPF_CALL, + .imm = 0x1, /* BPF_FUNC_map_lookup_elem */ + }, + { /* 7 */ + .code = BPF_ALU64 | BPF_K | BPF_MOV, + .dst_reg = BPF_REG_0, + .imm = 0, + }, + { /* 8 */ + .code = BPF_JMP | BPF_K | BPF_EXIT, + }, +}; + +# if VERBOSE +static const char *socket_prog_fmt = + "[{code=BPF_ALU64|BPF_K|BPF_MOV" + ", dst_reg=BPF_REG_1, src_reg=BPF_REG_0, off=0, imm=0}" + ", {code=BPF_STX|BPF_W|BPF_MEM" + ", dst_reg=BPF_REG_10, src_reg=BPF_REG_1, off=-4, imm=0}" + ", {code=BPF_ALU64|BPF_X|BPF_MOV" + ", dst_reg=BPF_REG_2, src_reg=BPF_REG_10, off=0, imm=0}" + ", {code=BPF_ALU64|BPF_K|BPF_ADD" + ", dst_reg=BPF_REG_2, src_reg=BPF_REG_0, off=0, imm=0xfffffffc}" + ", {code=BPF_LD|BPF_DW|BPF_IMM" + ", dst_reg=BPF_REG_1, src_reg=BPF_REG_1, off=0, imm=%#x}" + ", {code=BPF_LD|BPF_W|BPF_IMM" + ", dst_reg=BPF_REG_0, src_reg=BPF_REG_0, off=0, imm=0}" + ", {code=BPF_JMP|BPF_K|BPF_CALL" + ", dst_reg=BPF_REG_0, src_reg=BPF_REG_0, off=0, imm=0x1}" + ", {code=BPF_ALU64|BPF_K|BPF_MOV" + ", dst_reg=BPF_REG_0, src_reg=BPF_REG_0, off=0, imm=0}" + ", {code=BPF_JMP|BPF_K|BPF_EXIT" + ", dst_reg=BPF_REG_0, src_reg=BPF_REG_0, off=0, imm=0}" + "]"; +# endif /* VERBOSE */ + +static const char *license = "BSD"; +static char log_buf[4096]; + +static void +print_prog_load(void *attr_void, size_t size, long rc) +{ + printf("bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_SOCKET_FILTER" + ", insn_cnt=%zu, insns=", ARRAY_SIZE(socket_prog)); +# if VERBOSE + printf(socket_prog_fmt, socket_prog[4].imm); +# else + printf("%p", socket_prog); +# endif + if (size > offsetof(struct BPF_PROG_LOAD_struct, license)) + printf(", license=\"BSD\""); + if (size > offsetof(struct BPF_PROG_LOAD_struct, log_buf)) + printf(", log_level=7, log_size=%zu, log_buf=\"\"", + sizeof(log_buf)); + if (size > offsetof(struct BPF_PROG_LOAD_struct, kern_version)) + printf(", kern_version=KERNEL_VERSION(57005, 192, 222)"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, prog_flags)) + printf(", prog_flags=0"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, prog_name)) + printf(", prog_name=\"test_prog\""); + if (size > offsetof(struct BPF_PROG_LOAD_struct, prog_ifindex)) + printf(", prog_ifindex=0"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, expected_attach_type)) + printf(", expected_attach_type=BPF_CGROUP_INET_INGRESS"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, prog_btf_fd)) + printf(", prog_btf_fd=0"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, func_info_rec_size)) + printf(", func_info_rec_size=0"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, func_info)) + printf(", func_info=NULL"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, func_info_cnt)) + printf(", func_info_cnt=0"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, line_info_rec_size)) + printf(", line_info_rec_size=0"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, line_info)) + printf(", line_info=NULL"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, line_info_cnt)) + printf(", line_info_cnt=0"); + printf("}, %zu) = ", size); + if (rc >= 0) + printf("%ld\n", rc); + else + puts(errstr); +} +#endif /* CHECK_OBJ_PROG */ + +static long +try_bpf(kernel_ulong_t cmd, void (*printer)(void *attr, size_t size, long rc), + void *attr, size_t **sizes) +{ + long rc; + + for (rc = -1; **sizes; (*sizes)++) { + rc = sys_bpf(cmd, attr, **sizes); + printer(attr, **sizes, rc); + + if (rc >= 0) + break; + } + + return rc; +} + +int +main(void) +{ + struct BPF_MAP_CREATE_struct bpf_map_create_attr = { + .map_type = BPF_MAP_TYPE_ARRAY, + .key_size = 4, + .value_size = 8, + .max_entries = 1, + .map_name = "test_map", + }; + size_t bpf_map_create_attr_sizes[] = { + sizeof(bpf_map_create_attr), + offsetofend(struct BPF_MAP_CREATE_struct, max_entries), + 0, + }; + +#if CHECK_OBJ_PROG + struct BPF_PROG_LOAD_struct bpf_prog_load_attr = { + .prog_type = BPF_PROG_TYPE_SOCKET_FILTER, + .insn_cnt = ARRAY_SIZE(socket_prog), + .insns = (uintptr_t) socket_prog, + .license = (uintptr_t) license, + .log_level = 7, + .log_size = sizeof(log_buf), + .log_buf = (uintptr_t) log_buf, + .kern_version = 0xdeadc0de, + .prog_name = "test_prog", + }; + size_t bpf_prog_load_attr_sizes[] = { + sizeof(bpf_prog_load_attr), + offsetofend(struct BPF_PROG_LOAD_struct, prog_name), + offsetofend(struct BPF_PROG_LOAD_struct, prog_flags), + offsetofend(struct BPF_PROG_LOAD_struct, kern_version), + offsetofend(struct BPF_PROG_LOAD_struct, log_buf), + offsetofend(struct BPF_PROG_LOAD_struct, license), + offsetofend(struct BPF_PROG_LOAD_struct, insns), + 0, + }; +#endif /* CHECK_OBJ_PROG */ + + size_t *bpf_map_create_attr_size = bpf_map_create_attr_sizes; + int map_fd = try_bpf(BPF_MAP_CREATE, print_map_create, + &bpf_map_create_attr, &bpf_map_create_attr_size); + if (map_fd < 0) + perror_msg_and_skip("BPF_MAP_CREATE failed"); + +#if CHECK_OBJ_PROG + socket_prog[4].imm = map_fd; + + size_t *bpf_prog_load_attr_size = bpf_prog_load_attr_sizes; + int prog_fd = try_bpf(BPF_PROG_LOAD, print_prog_load, + &bpf_prog_load_attr, &bpf_prog_load_attr_size); + if (prog_fd < 0) + perror_msg_and_skip("BPF_PROG_LOAD failed (log: \"%s\")", + log_buf); +#endif /* CHECK_OBJ_PROG */ + + /* + * This has to be a macro, otherwise the compiler complains that + * initializer element is not constant. + */ +#define MAP_INFO_SZ (sizeof(*map_info) + 64) + struct bpf_map_info_struct *map_info = tail_alloc(MAP_INFO_SZ); + struct BPF_OBJ_GET_INFO_BY_FD_struct bpf_map_get_info_attr = { + .bpf_fd = map_fd, + .info_len = MAP_INFO_SZ, + .info = (uintptr_t) map_info, + }; + + memset(map_info, 0, MAP_INFO_SZ); + int ret = sys_bpf(BPF_OBJ_GET_INFO_BY_FD, &bpf_map_get_info_attr, + sizeof(bpf_map_get_info_attr)); + if (ret < 0) + perror_msg_and_skip("BPF_OBJ_GET_INFO_BY_FD map failed"); + + printf("bpf(BPF_OBJ_GET_INFO_BY_FD" + ", {info={bpf_fd=%d, info_len=%zu", + map_fd, MAP_INFO_SZ); + if (bpf_map_get_info_attr.info_len != MAP_INFO_SZ) + printf(" => %u", bpf_map_get_info_attr.info_len); + + printf(", info="); +#if VERBOSE + printf("{type="); + printxval(bpf_map_types, map_info->type, "BPF_MAP_TYPE_???"); + PRINT_FIELD_U(", ", *map_info, id); + PRINT_FIELD_U(", ", *map_info, key_size); + PRINT_FIELD_U(", ", *map_info, value_size); + PRINT_FIELD_U(", ", *map_info, max_entries); + printf(", map_flags="); + printflags(bpf_map_flags, map_info->map_flags, "BPF_F_???"); + + if (bpf_map_get_info_attr.info_len > + offsetof(struct bpf_map_info_struct, name)) { + printf(", name="); + print_quoted_cstring(map_info->name, sizeof(map_info->name)); + } + if (bpf_map_get_info_attr.info_len > + offsetof(struct bpf_map_info_struct, ifindex)) + printf(", ifindex=%u", map_info->ifindex); + if (bpf_map_get_info_attr.info_len > + offsetof(struct bpf_map_info_struct, netns_dev)) + printf(", netns_dev=makedev(%#x, %#x)", + major(map_info->netns_dev), minor(map_info->netns_dev)); + if (bpf_map_get_info_attr.info_len > + offsetof(struct bpf_map_info_struct, netns_ino)) + printf(", netns_ino=%" PRIu64, map_info->netns_ino); + if (bpf_map_get_info_attr.info_len > + offsetof(struct bpf_map_info_struct, btf_id)) + PRINT_FIELD_U(", ", *map_info, btf_id); + if (bpf_map_get_info_attr.info_len > + offsetof(struct bpf_map_info_struct, btf_key_type_id)) + PRINT_FIELD_U(", ", *map_info, btf_key_type_id); + if (bpf_map_get_info_attr.info_len > + offsetof(struct bpf_map_info_struct, btf_value_type_id)) + PRINT_FIELD_U(", ", *map_info, btf_value_type_id); + printf("}"); +#else /* !VERBOSE */ + printf("%p", map_info); +#endif /* VERBOSE */ + printf("}}, %zu) = %s\n", sizeof(bpf_map_get_info_attr), errstr); + +#if CHECK_OBJ_PROG + /* + * This has to be a macro, otherwise the compiler complains that + * initializer element is not constant. + */ +# define PROG_INFO_SZ (sizeof(*prog_info) + 64) + struct bpf_prog_info_struct *prog_info = tail_alloc(PROG_INFO_SZ); + struct bpf_insn *xlated_prog = tail_alloc(sizeof(*xlated_prog) * 42); + uint32_t *map_ids = tail_alloc(sizeof(*map_ids) * 2); + struct BPF_OBJ_GET_INFO_BY_FD_struct bpf_prog_get_info_attr = { + .bpf_fd = prog_fd, + .info_len = PROG_INFO_SZ, + .info = (uintptr_t) prog_info, + }; + size_t old_prog_info_len = PROG_INFO_SZ; + + memset(prog_info, 0, PROG_INFO_SZ); + for (unsigned int i = 0; i < 4; i++) { + prog_info->jited_prog_len = 0; + prog_info->nr_jited_ksyms = 0; + prog_info->nr_jited_func_lens = 0; + prog_info->func_info_rec_size = 0; + prog_info->nr_func_info = 0; + prog_info->nr_line_info = 0; + prog_info->nr_jited_line_info = 0; + prog_info->jited_line_info = 0; + prog_info->line_info_rec_size = 0; + prog_info->jited_line_info_rec_size = 0; + prog_info->nr_prog_tags = 0; + memset(prog_info + 1, 0, PROG_INFO_SZ - sizeof(*prog_info)); + switch (i) { + case 1: + prog_info->xlated_prog_insns = + (uintptr_t) (xlated_prog + 42); + prog_info->xlated_prog_len = 336; + prog_info->map_ids = (uintptr_t) (map_ids + 2); + prog_info->nr_map_ids = 2; + break; + case 2: + prog_info->xlated_prog_insns = (uintptr_t) xlated_prog; + /* TODO: check xlated_prog output */ + prog_info->xlated_prog_len = 0; + prog_info->map_ids = (uintptr_t) map_ids; + prog_info->nr_map_ids = 0; + break; + case 3: + prog_info->xlated_prog_insns = (uintptr_t) xlated_prog; + prog_info->xlated_prog_len = 0; + prog_info->map_ids = (uintptr_t) map_ids; + prog_info->nr_map_ids = 2; + break; + } + + ret = sys_bpf(BPF_OBJ_GET_INFO_BY_FD, &bpf_prog_get_info_attr, + sizeof(bpf_prog_get_info_attr)); + if (i != 1 && ret < 0) + perror_msg_and_skip("BPF_OBJ_GET_INFO_BY_FD" + " prog %u failed", i); + + printf("bpf(BPF_OBJ_GET_INFO_BY_FD" + ", {info={bpf_fd=%d, info_len=%zu", + prog_fd, old_prog_info_len); + if (!i && bpf_prog_get_info_attr.info_len != PROG_INFO_SZ) + printf(" => %u", bpf_prog_get_info_attr.info_len); + old_prog_info_len = bpf_prog_get_info_attr.info_len; + + printf(", info="); +# if VERBOSE + printf("{type="); + printxval(bpf_prog_types, prog_info->type, "BPF_PROG_TYPE_???"); + PRINT_FIELD_U(", ", *prog_info, id); + printf(", tag="); + print_quoted_hex(prog_info->tag, sizeof(prog_info->tag)); + printf(", jited_prog_len=0"); + if (prog_info->jited_prog_len) + printf(" => %u", prog_info->jited_prog_len); + printf(", jited_prog_insns=NULL"); + switch (i) { + case 0: + printf(", xlated_prog_len=0"); + if (prog_info->xlated_prog_len) + printf(" => %u", prog_info->xlated_prog_len); + printf(", xlated_prog_insns=NULL"); + break; + case 1: + printf(", xlated_prog_len=336"); + if (prog_info->xlated_prog_len != 336) + printf(" => %u", prog_info->xlated_prog_len); + if (prog_info->xlated_prog_len) + printf(", xlated_prog_insns=%p", xlated_prog + 42); + else + printf(", xlated_prog_insns=[]"); + break; + case 2: + case 3: + printf(", xlated_prog_len=0"); + if (prog_info->xlated_prog_len) + printf(" => %u", prog_info->xlated_prog_len); + printf(", xlated_prog_insns=[]"); + break; + } + + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, load_time)) + printf(", load_time=%" PRIu64, prog_info->load_time); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, created_by_uid)) + printf(", created_by_uid=%u", + prog_info->created_by_uid); + + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, map_ids)) { + switch (i) { + case 0: + printf(", nr_map_ids=0"); + if (prog_info->nr_map_ids) + printf(" => 1"); + printf(", map_ids=NULL"); + break; + case 1: + printf(", nr_map_ids=2, map_ids=%p", + map_ids + 2); + break; + case 2: + printf(", nr_map_ids=0"); + if (prog_info->nr_map_ids) + printf(" => 1"); + printf(", map_ids=[]"); + break; + case 3: + printf(", nr_map_ids=2"); + if (prog_info->nr_map_ids != 2) + printf(" => 1"); + printf(", map_ids=[%u]", map_info->id); + break; + } + } + + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, name)) + printf(", name=\"test_prog\""); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, ifindex)) + printf(", ifindex=%u", prog_info->ifindex); + if (bpf_prog_get_info_attr.info_len > + offsetofend(struct bpf_prog_info_struct, ifindex)) + printf(", gpl_compatible=%u", prog_info->gpl_compatible); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, netns_dev)) + printf(", netns_dev=makedev(%#x, %#x)", + major(prog_info->netns_dev), + minor(prog_info->netns_dev)); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, netns_ino)) + printf(", netns_ino=%" PRIu64, prog_info->netns_ino); + + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, nr_jited_ksyms)) { + printf(", nr_jited_ksyms=0"); + if (prog_info->nr_jited_ksyms) + printf(" => %u", prog_info->nr_jited_ksyms); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, nr_jited_func_lens)) { + printf(", nr_jited_func_lens=0"); + if (prog_info->nr_jited_func_lens) + printf(" => %u", prog_info->nr_jited_func_lens); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, jited_ksyms)) + printf(", jited_ksyms=NULL"); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, jited_func_lens)) + printf(", jited_func_lens=NULL"); + + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, btf_id)) + PRINT_FIELD_U(", ", *prog_info, btf_id); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, func_info_rec_size)) { + printf(", func_info_rec_size=0"); + if (prog_info->func_info_rec_size) + printf(" => %u", prog_info->func_info_rec_size); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, func_info)) + printf(", func_info=NULL"); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, nr_func_info)) { + printf(", nr_func_info=0"); + if (prog_info->nr_func_info) + printf(" => %u", prog_info->nr_func_info); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, nr_line_info)) { + printf(", nr_line_info=0"); + if (prog_info->nr_line_info) + printf(" => %u", prog_info->nr_line_info); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, line_info)) + printf(", line_info=NULL"); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, jited_line_info)) + printf(", jited_line_info=NULL"); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, nr_jited_line_info)) { + printf(", nr_jited_line_info=0"); + if (prog_info->nr_jited_line_info) + printf(" => %u", prog_info->nr_jited_line_info); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, line_info_rec_size)) { + printf(", line_info_rec_size=0"); + if (prog_info->line_info_rec_size) + printf(" => %u", prog_info->line_info_rec_size); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, jited_line_info_rec_size)) { + printf(", jited_line_info_rec_size=0"); + if (prog_info->jited_line_info_rec_size) + printf(" => %u", prog_info->jited_line_info_rec_size); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, nr_prog_tags)) { + printf(", nr_prog_tags=0"); + if (prog_info->nr_prog_tags) + printf(" => %u", prog_info->nr_prog_tags); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, prog_tags)) + printf(", prog_tags=NULL"); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, run_time_ns)) + printf(", run_time_ns=%llu", + (unsigned long long) prog_info->run_time_ns); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, run_cnt)) + printf(", run_cnt=%llu", + (unsigned long long) prog_info->run_cnt); + + printf("}"); +# else /* !VERBOSE */ + printf("%p", prog_info); +# endif /* VERBOSE */ + printf("}}, %zu) = %s\n", + sizeof(bpf_prog_get_info_attr), errstr); + } +#endif /* CHECK_OBJ_PROG */ + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/bpf-obj_get_info_by_fd.gen.test b/tests-m32/bpf-obj_get_info_by_fd.gen.test new file mode 100755 index 00000000..0efa59a4 --- /dev/null +++ b/tests-m32/bpf-obj_get_info_by_fd.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (bpf-obj_get_info_by_fd -a20 -y -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -y -e trace=bpf diff --git a/tests-m32/bpf-success-v.c b/tests-m32/bpf-success-v.c new file mode 100644 index 00000000..48c2a16d --- /dev/null +++ b/tests-m32/bpf-success-v.c @@ -0,0 +1,2 @@ +#define INJECT_RETVAL 42 +#include "bpf-v.c" diff --git a/tests-m32/bpf-success-v.test b/tests-m32/bpf-success-v.test new file mode 100755 index 00000000..9afcb148 --- /dev/null +++ b/tests-m32/bpf-success-v.test @@ -0,0 +1,11 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +run_strace -a20 -v -e trace=bpf -e inject=bpf:retval=42 ../bpf-success-v > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests-m32/bpf-success.c b/tests-m32/bpf-success.c new file mode 100644 index 00000000..06f46956 --- /dev/null +++ b/tests-m32/bpf-success.c @@ -0,0 +1,2 @@ +#define INJECT_RETVAL 42 +#include "bpf.c" diff --git a/tests-m32/bpf-success.test b/tests-m32/bpf-success.test new file mode 100755 index 00000000..4321e532 --- /dev/null +++ b/tests-m32/bpf-success.test @@ -0,0 +1,11 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +run_strace -a20 -e trace=bpf -e inject=bpf:retval=42 ../bpf-success > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests-m32/bpf-v.c b/tests-m32/bpf-v.c new file mode 100644 index 00000000..3f44f249 --- /dev/null +++ b/tests-m32/bpf-v.c @@ -0,0 +1,3 @@ +/* This file is part of bpf-v strace test. */ +#define VERBOSE 1 +#include "bpf.c" diff --git a/tests-m32/bpf-v.gen.test b/tests-m32/bpf-v.gen.test new file mode 100755 index 00000000..e57154e3 --- /dev/null +++ b/tests-m32/bpf-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (bpf-v -a20 -v -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -v -e trace=bpf diff --git a/tests-m32/bpf.c b/tests-m32/bpf.c index 7ef16c9f..fd29ab44 100644 --- a/tests-m32/bpf.c +++ b/tests-m32/bpf.c @@ -1,234 +1,1252 @@ /* + * Check bpf syscall decoding. + * * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2015-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" + +#include +#include +#include +#include +#include + #include +#include "scno.h" -#if defined HAVE_UNION_BPF_ATTR_LOG_BUF && defined __NR_bpf -# include -# include -# include +#ifdef HAVE_LINUX_BPF_H # include +#endif -static const struct bpf_insn insns[] = { - { .code = BPF_JMP | BPF_EXIT } +#include "bpf_attr.h" +#include "print_fields.h" + +#include "xlat.h" +#include "xlat/bpf_commands.h" + +#if defined MPERS_IS_m32 || SIZEOF_KERNEL_LONG_T > 4 +# define BIG_ADDR(addr64_, addr32_) addr64_ +# define BIG_ADDR_MAYBE(addr_) +#elif defined __arm__ || defined __i386__ || defined __mips__ \ + || defined __powerpc__ || defined __riscv__ || defined __s390__ \ + || defined __sparc__ || defined __tile__ +# define BIG_ADDR(addr64_, addr32_) addr64_ " or " addr32_ +# define BIG_ADDR_MAYBE(addr_) addr_ " or " +#else +# define BIG_ADDR(addr64_, addr32_) addr32_ +# define BIG_ADDR_MAYBE(addr_) +#endif + +#ifndef HAVE_STRUCT_BPF_INSN +struct bpf_insn { + uint8_t code; + uint8_t dst_reg:4; + uint8_t src_reg:4; + int16_t off; + int32_t imm; +}; +#endif + +#define BPF_ATTR_DATA_FIELD(cmd_) struct cmd_ ## _struct cmd_ ## _data + +union bpf_attr_data { + BPF_ATTR_DATA_FIELD(BPF_MAP_CREATE); + BPF_ATTR_DATA_FIELD(BPF_MAP_LOOKUP_ELEM); + BPF_ATTR_DATA_FIELD(BPF_MAP_UPDATE_ELEM); + BPF_ATTR_DATA_FIELD(BPF_MAP_DELETE_ELEM); + BPF_ATTR_DATA_FIELD(BPF_MAP_GET_NEXT_KEY); + BPF_ATTR_DATA_FIELD(BPF_PROG_LOAD); + BPF_ATTR_DATA_FIELD(BPF_OBJ_PIN); + BPF_ATTR_DATA_FIELD(BPF_PROG_ATTACH); + BPF_ATTR_DATA_FIELD(BPF_PROG_DETACH); + BPF_ATTR_DATA_FIELD(BPF_PROG_TEST_RUN); + BPF_ATTR_DATA_FIELD(BPF_PROG_GET_NEXT_ID); + BPF_ATTR_DATA_FIELD(BPF_PROG_GET_FD_BY_ID); + BPF_ATTR_DATA_FIELD(BPF_MAP_GET_FD_BY_ID); + BPF_ATTR_DATA_FIELD(BPF_OBJ_GET_INFO_BY_FD); + BPF_ATTR_DATA_FIELD(BPF_PROG_QUERY); + BPF_ATTR_DATA_FIELD(BPF_RAW_TRACEPOINT_OPEN); + BPF_ATTR_DATA_FIELD(BPF_BTF_LOAD); + BPF_ATTR_DATA_FIELD(BPF_BTF_GET_FD_BY_ID); + BPF_ATTR_DATA_FIELD(BPF_TASK_FD_QUERY); + char char_data[256]; +}; + +struct bpf_attr_check { + union bpf_attr_data data; + size_t size; + const char *str; + void (*init_fn)(struct bpf_attr_check *check); + void (*print_fn)(const struct bpf_attr_check *check, + unsigned long addr); +}; + +struct bpf_check { + kernel_ulong_t cmd; + const char *cmd_str; + const struct bpf_attr_check *checks; + size_t count; }; +static const kernel_ulong_t long_bits = (kernel_ulong_t) 0xfacefeed00000000ULL; static const char *errstr; -static char log_buf[4096]; +static unsigned int sizeof_attr = sizeof(union bpf_attr_data); +static unsigned int page_size; +static unsigned long end_of_page; static long sys_bpf(kernel_ulong_t cmd, kernel_ulong_t attr, kernel_ulong_t size) { long rc = syscall(__NR_bpf, cmd, attr, size); + errstr = sprintrc(rc); + +#ifdef INJECT_RETVAL + if (rc != INJECT_RETVAL) + error_msg_and_fail("Got a return value of %ld != %d", + rc, INJECT_RETVAL); + + static char inj_errstr[4096]; + + snprintf(inj_errstr, sizeof(inj_errstr), "%s (INJECTED)", errstr); + errstr = inj_errstr; +#endif + return rc; } -static int -map_create(void) +#if VERBOSE +# define print_extra_data(addr_, offs_, size_) \ + do { \ + printf("/* bytes %u..%u */ ", (offs_), (size_) + (offs_) - 1); \ + print_quoted_hex((addr_) + (offs_), (size_)); \ + } while (0) +#else +# define print_extra_data(addr_, offs_, size_) printf("...") +#endif + +static void +print_bpf_attr(const struct bpf_attr_check *check, unsigned long addr) { - union bpf_attr attr = { - .key_size = 4, - .value_size = 8, - .max_entries = 256 - }; - void *const t_attr = tail_memdup(&attr, sizeof(attr)); - return sys_bpf(BPF_MAP_CREATE, (unsigned long) t_attr, sizeof(attr)); + if (check->print_fn) + check->print_fn(check, addr); + else + printf("%s", check->str); } -static int -map_any(int cmd) +static void +test_bpf(const struct bpf_check *cmd_check) { - union bpf_attr attr = { - .map_fd = -1, - .key = 0xdeadbeef, - .value = 0xbadc0ded - }; - void *const t_attr = tail_memdup(&attr, sizeof(attr)); - return sys_bpf(cmd, (unsigned long) t_attr, sizeof(attr)); + const struct bpf_attr_check *check = 0; + const union bpf_attr_data *data = 0; + unsigned int offset = 0; + + /* zero addr */ + sys_bpf(cmd_check->cmd, 0, long_bits | sizeof(union bpf_attr_data)); + printf("bpf(%s, NULL, %u) = %s\n", + cmd_check->cmd_str, sizeof_attr, errstr); + + /* zero size */ + unsigned long addr = end_of_page - sizeof_attr; + sys_bpf(cmd_check->cmd, addr, long_bits); + printf("bpf(%s, %#lx, 0) = %s\n", + cmd_check->cmd_str, addr, errstr); + + for (size_t i = 0; i < cmd_check->count; i++) { + check = &cmd_check->checks[i]; + if (check->init_fn) + check->init_fn((struct bpf_attr_check *) check); + data = &check->data; + offset = check->size; + + addr = end_of_page - offset; + memcpy((void *) addr, data, offset); + + /* starting piece of bpf_attr_data */ + sys_bpf(cmd_check->cmd, addr, offset); + printf("bpf(%s, {", cmd_check->cmd_str); + print_bpf_attr(check, addr); + printf("}, %u) = %s\n", offset, errstr); + + /* short read of the starting piece */ + sys_bpf(cmd_check->cmd, addr + 1, offset); + printf("bpf(%s, %#lx, %u) = %s\n", + cmd_check->cmd_str, addr + 1, offset, errstr); + } + + if (offset < sizeof_attr) { + /* short read of the whole bpf_attr_data */ + memcpy((void *) end_of_page - sizeof_attr + 1, data, offset); + addr = end_of_page - sizeof_attr + 1; + memset((void *) addr + offset, 0, sizeof_attr - offset - 1); + sys_bpf(cmd_check->cmd, addr, sizeof_attr); + printf("bpf(%s, %#lx, %u) = %s\n", + cmd_check->cmd_str, addr, sizeof_attr, errstr); + + /* the whole bpf_attr_data */ + memcpy((void *) end_of_page - sizeof_attr, data, offset); + addr = end_of_page - sizeof_attr; + memset((void *) addr + offset, 0, sizeof_attr - offset); + sys_bpf(cmd_check->cmd, addr, sizeof_attr); + printf("bpf(%s, {", cmd_check->cmd_str); + print_bpf_attr(check, addr); + printf("}, %u) = %s\n", sizeof_attr, errstr); + + /* non-zero bytes after the relevant part */ + fill_memory_ex((void *) addr + offset, + sizeof_attr - offset, '0', 10); + sys_bpf(cmd_check->cmd, addr, sizeof_attr); + printf("bpf(%s, {", cmd_check->cmd_str); + print_bpf_attr(check, addr); + printf(", "); + print_extra_data((char *) addr, offset, + sizeof_attr - offset); + printf("}, %u) = %s\n", sizeof_attr, errstr); + } + + /* short read of the whole page */ + memcpy((void *) end_of_page - page_size + 1, data, offset); + addr = end_of_page - page_size + 1; + memset((void *) addr + offset, 0, page_size - offset - 1); + sys_bpf(cmd_check->cmd, addr, page_size); + printf("bpf(%s, %#lx, %u) = %s\n", + cmd_check->cmd_str, addr, page_size, errstr); + + /* the whole page */ + memcpy((void *) end_of_page - page_size, data, offset); + addr = end_of_page - page_size; + memset((void *) addr + offset, 0, page_size - offset); + sys_bpf(cmd_check->cmd, addr, page_size); + printf("bpf(%s, {", cmd_check->cmd_str); + print_bpf_attr(check, addr); + printf("}, %u) = %s\n", page_size, errstr); + + /* non-zero bytes after the whole bpf_attr_data */ + fill_memory_ex((void *) addr + offset, + page_size - offset, '0', 10); + sys_bpf(cmd_check->cmd, addr, page_size); + printf("bpf(%s, {", cmd_check->cmd_str); + print_bpf_attr(check, addr); + printf(", "); + print_extra_data((char *) addr, offset, + page_size - offset); + printf("}, %u) = %s\n", page_size, errstr); + + /* more than a page */ + sys_bpf(cmd_check->cmd, addr, page_size + 1); + printf("bpf(%s, %#lx, %u) = %s\n", + cmd_check->cmd_str, addr, page_size + 1, errstr); } -static int -prog_load(void) +static void +init_BPF_MAP_CREATE_attr7(struct bpf_attr_check *check) { - union bpf_attr attr = { - .insn_cnt = sizeof(insns) / sizeof(insns[0]), - .insns = (unsigned long) insns, - .license = (unsigned long) "GPL", - .log_level = 42, - .log_size = sizeof(log_buf), - .log_buf = (unsigned long) log_buf - }; - void *const t_attr = tail_memdup(&attr, sizeof(attr)); - return sys_bpf(BPF_PROG_LOAD, (unsigned long) t_attr, sizeof(attr)); + struct BPF_MAP_CREATE_struct *attr = &check->data.BPF_MAP_CREATE_data; + attr->map_ifindex = ifindex_lo(); } +static struct bpf_attr_check BPF_MAP_CREATE_checks[] = { + { + .data = { .BPF_MAP_CREATE_data = { .map_type = 2 } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, map_type), + .str = "map_type=BPF_MAP_TYPE_ARRAY, key_size=0, value_size=0" + ", max_entries=0" + }, + { /* 1 */ + .data = { .BPF_MAP_CREATE_data = { + .map_type = 20, + .key_size = 4, + .value_size = 8, + .max_entries = 256, + .map_flags = 63, + .inner_map_fd = -1, + .numa_node = 3141592653, + .map_name = "0123456789abcde", + } }, + .size = offsetof(struct BPF_MAP_CREATE_struct, map_name) + 8, + .str = "map_type=BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, key_size=4" + ", value_size=8, max_entries=256" + ", map_flags=BPF_F_NO_PREALLOC|BPF_F_NO_COMMON_LRU" + "|BPF_F_NUMA_NODE|BPF_F_RDONLY|BPF_F_WRONLY" + "|BPF_F_STACK_BUILD_ID" + ", inner_map_fd=-1" + ", numa_node=3141592653" + ", map_name=\"0123456\"...", + + }, + { /* 2 */ + .data = { .BPF_MAP_CREATE_data = { + .map_type = 24, + .key_size = 0xface1e55, + .value_size = 0xbadc0ded, + .max_entries = 0xbeefcafe, + .map_flags = 0xffffff80, + .inner_map_fd = 2718281828, + .numa_node = -1, + .map_name = "", + .map_ifindex = 3141592653, + } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, map_ifindex), + .str = "map_type=0x18 /* BPF_MAP_TYPE_??? */" + ", key_size=4207812181, value_size=3134983661" + ", max_entries=3203386110" + ", map_flags=0xffffff80 /* BPF_F_??? */" + ", inner_map_fd=-1576685468" + ", map_name=\"\", map_ifindex=3141592653", + + }, + { /* 3 */ + .data = { .BPF_MAP_CREATE_data = { + .map_type = 0xdeadf00d, + .key_size = 0xface1e55, + .value_size = 0xbadc0ded, + .max_entries = 0xbeefcafe, + .map_flags = 0xc0dedead, + .inner_map_fd = 2718281828, + .numa_node = -1, + } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, map_flags), + .str = "map_type=0xdeadf00d /* BPF_MAP_TYPE_??? */" + ", key_size=4207812181, value_size=3134983661" + ", max_entries=3203386110" + ", map_flags=BPF_F_NO_PREALLOC|BPF_F_NUMA_NODE" + "|BPF_F_RDONLY|BPF_F_STACK_BUILD_ID" + "|0xc0dede80", + }, + { /* 4 */ + .data = { .BPF_MAP_CREATE_data = { + .map_type = 0xdeadf00d, + .key_size = 0xface1e55, + .value_size = 0xbadc0ded, + .max_entries = 0xbeefcafe, + .map_flags = 0xc0dedead, + .inner_map_fd = 2718281828, + .numa_node = -1, + } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, inner_map_fd), + .str = "map_type=0xdeadf00d /* BPF_MAP_TYPE_??? */" + ", key_size=4207812181, value_size=3134983661" + ", max_entries=3203386110" + ", map_flags=BPF_F_NO_PREALLOC|BPF_F_NUMA_NODE" + "|BPF_F_RDONLY|BPF_F_STACK_BUILD_ID" + "|0xc0dede80" + ", inner_map_fd=-1576685468", + }, + { /* 5 */ + .data = { .BPF_MAP_CREATE_data = { + .map_type = 0xdeadf00d, + .key_size = 0xface1e55, + .value_size = 0xbadc0ded, + .max_entries = 0xbeefcafe, + .map_flags = 0xc0dedead, + .inner_map_fd = 2718281828, + .numa_node = -1, + } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, numa_node), + .str = "map_type=0xdeadf00d /* BPF_MAP_TYPE_??? */" + ", key_size=4207812181, value_size=3134983661" + ", max_entries=3203386110" + ", map_flags=BPF_F_NO_PREALLOC|BPF_F_NUMA_NODE" + "|BPF_F_RDONLY|BPF_F_STACK_BUILD_ID" + "|0xc0dede80" + ", inner_map_fd=-1576685468" + ", numa_node=4294967295 /* NUMA_NO_NODE */", + }, + { /* 6 */ + .data = { .BPF_MAP_CREATE_data = { + .map_type = 0xdeadf00d, + .key_size = 0xface1e55, + .value_size = 0xbadc0ded, + .max_entries = 0xbeefcafe, + .map_flags = 0xc0dedead, + .inner_map_fd = 2718281828, + .numa_node = -1, + .map_name = "fedcba9876543210", + } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, map_name), + .str = "map_type=0xdeadf00d /* BPF_MAP_TYPE_??? */" + ", key_size=4207812181, value_size=3134983661" + ", max_entries=3203386110" + ", map_flags=BPF_F_NO_PREALLOC|BPF_F_NUMA_NODE" + "|BPF_F_RDONLY|BPF_F_STACK_BUILD_ID" + "|0xc0dede80" + ", inner_map_fd=-1576685468" + ", numa_node=4294967295 /* NUMA_NO_NODE */" + ", map_name=\"fedcba987654321\"...", + }, + { /* 7 */ + .data = { .BPF_MAP_CREATE_data = { + .map_type = 0xdeadf00d, + .key_size = 0xface1e55, + .value_size = 0xbadc0ded, + .max_entries = 0xbeefcafe, + .map_flags = 0xc0dedead, + .inner_map_fd = 2718281828, + .numa_node = -1, + .map_name = "0123456789abcde", + } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, map_ifindex), + .str = "map_type=0xdeadf00d /* BPF_MAP_TYPE_??? */" + ", key_size=4207812181, value_size=3134983661" + ", max_entries=3203386110" + ", map_flags=BPF_F_NO_PREALLOC|BPF_F_NUMA_NODE" + "|BPF_F_RDONLY|BPF_F_STACK_BUILD_ID" + "|0xc0dede80" + ", inner_map_fd=-1576685468" + ", numa_node=4294967295 /* NUMA_NO_NODE */" + ", map_name=\"0123456789abcde\"" + ", map_ifindex=" IFINDEX_LO_STR, + .init_fn = init_BPF_MAP_CREATE_attr7, + }, + { /* 8 */ + .data = { .BPF_MAP_CREATE_data = { + .btf_fd = 0xbadc0ded, + .btf_key_type_id = 0xfacefeed, + .btf_value_type_id = 0xcafef00d + } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, + btf_value_type_id), + .str = "map_type=BPF_MAP_TYPE_UNSPEC" + ", key_size=0" + ", value_size=0" + ", max_entries=0" + ", map_flags=0" + ", inner_map_fd=0" + ", map_name=\"\"" + ", map_ifindex=0" + ", btf_fd=-1159983635" + ", btf_key_type_id=4207869677" + ", btf_value_type_id=3405705229" + }, +}; + +static const struct bpf_attr_check BPF_MAP_LOOKUP_ELEM_checks[] = { + { + .data = { .BPF_MAP_LOOKUP_ELEM_data = { .map_fd = -1 } }, + .size = offsetofend(struct BPF_MAP_LOOKUP_ELEM_struct, map_fd), + .str = "map_fd=-1, key=NULL, value=NULL" + }, + { + .data = { .BPF_MAP_LOOKUP_ELEM_data = { + .map_fd = -1, + .key = 0xdeadbeef, + .value = 0xbadc0ded + } }, + .size = offsetofend(struct BPF_MAP_LOOKUP_ELEM_struct, value), + .str = "map_fd=-1, key=0xdeadbeef, value=0xbadc0ded" + } +}; + +#define BPF_MAP_LOOKUP_AND_DELETE_ELEM_checks BPF_MAP_LOOKUP_ELEM_checks + +static const struct bpf_attr_check BPF_MAP_UPDATE_ELEM_checks[] = { + { + .data = { .BPF_MAP_UPDATE_ELEM_data = { .map_fd = -1 } }, + .size = offsetofend(struct BPF_MAP_UPDATE_ELEM_struct, map_fd), + .str = "map_fd=-1, key=NULL, value=NULL, flags=BPF_ANY" + }, + { + .data = { .BPF_MAP_UPDATE_ELEM_data = { + .map_fd = -1, + .key = 0xdeadbeef, + .value = 0xbadc0ded, + .flags = 2 + } }, + .size = offsetofend(struct BPF_MAP_UPDATE_ELEM_struct, flags), + .str = "map_fd=-1, key=0xdeadbeef, value=0xbadc0ded" + ", flags=BPF_EXIST" + } +}; + +static const struct bpf_attr_check BPF_MAP_DELETE_ELEM_checks[] = { + { + .data = { .BPF_MAP_DELETE_ELEM_data = { .map_fd = -1 } }, + .size = offsetofend(struct BPF_MAP_DELETE_ELEM_struct, map_fd), + .str = "map_fd=-1, key=NULL" + }, + { + .data = { .BPF_MAP_DELETE_ELEM_data = { + .map_fd = -1, + .key = 0xdeadbeef + } }, + .size = offsetofend(struct BPF_MAP_DELETE_ELEM_struct, key), + .str = "map_fd=-1, key=0xdeadbeef" + } +}; + +static const struct bpf_attr_check BPF_MAP_GET_NEXT_KEY_checks[] = { + { + .data = { .BPF_MAP_GET_NEXT_KEY_data = { .map_fd = -1 } }, + .size = offsetofend(struct BPF_MAP_GET_NEXT_KEY_struct, map_fd), + .str = "map_fd=-1, key=NULL, next_key=NULL" + }, + { + .data = { .BPF_MAP_GET_NEXT_KEY_data = { + .map_fd = -1, + .key = 0xdeadbeef, + .next_key = 0xbadc0ded + } }, + .size = offsetofend(struct BPF_MAP_GET_NEXT_KEY_struct, next_key), + .str = "map_fd=-1, key=0xdeadbeef, next_key=0xbadc0ded" + } +}; + +static const struct bpf_insn insns[] = { + { + .code = 0x95, + .dst_reg = 10, + .src_reg = 11, + .off = 0xdead, + .imm = 0xbadc0ded, + }, +}; +static const char license[] = "GPL"; +static const char pathname[] = "/sys/fs/bpf/foo/bar"; + +static char *log_buf; /* - * bpf() syscall and its first six commands were introduced in Linux kernel - * 3.18. Some additional commands were added afterwards, so we need to take - * precautions to make sure the tests compile. - * - * BPF_OBJ_PIN and BPF_OBJ_GET commands appear in kernel 4.4. + * This has to be a macro, otherwise the compiler complains that + * initializer element is not constant. */ -# ifdef HAVE_UNION_BPF_ATTR_BPF_FD -static int -obj_manage(int cmd) +#define log_buf_size 4096U + +static inline char * +get_log_buf(void) { - union bpf_attr attr = { - .pathname = (unsigned long) "/sys/fs/bpf/foo/bar", - .bpf_fd = -1 - }; - void *const t_attr = tail_memdup(&attr, sizeof(attr)); - return sys_bpf(cmd, (unsigned long) t_attr, sizeof(attr)); + if (!log_buf) + log_buf = tail_alloc(log_buf_size); + return log_buf; } -# endif -/* BPF_PROG_ATTACH and BPF_PROG_DETACH commands appear in kernel 4.10. */ -# ifdef HAVE_UNION_BPF_ATTR_ATTACH_TYPE -static int -prog_cgroup(int cmd) +static inline char * +get_log_buf_tail(void) { - union bpf_attr attr = { - .target_fd = -1, - .attach_bpf_fd = -1, - .attach_type = 0 - }; - void *const t_attr = tail_memdup(&attr, sizeof(attr)); - return sys_bpf(cmd, (unsigned long) t_attr, sizeof(attr)); + return get_log_buf() + log_buf_size; } -# endif -static unsigned long efault; +#if VERBOSE +# define INSNS_FMT \ + "[{code=BPF_JMP|BPF_K|BPF_EXIT, dst_reg=BPF_REG_10" \ + ", src_reg=0xb /* BPF_REG_??? */, off=%d, imm=%#x}]" +# define INSNS_ARG insns[0].off, insns[0].imm +#else +# define INSNS_FMT "%p" +# define INSNS_ARG insns +#endif + +static void +init_BPF_PROG_LOAD_attr3(struct bpf_attr_check *check) +{ + struct BPF_PROG_LOAD_struct *attr = &check->data.BPF_PROG_LOAD_data; + + attr->insns = (uintptr_t) insns; + attr->license = (uintptr_t) license; + attr->log_buf = (uintptr_t) get_log_buf_tail(); +} static void -bogus_bpf(int cmd, const char *name) +print_BPF_PROG_LOAD_attr3(const struct bpf_attr_check *check, unsigned long addr) { - const unsigned long bogus_size = 1024; - const unsigned long bogus_addr = efault - bogus_size; + printf("prog_type=BPF_PROG_TYPE_SOCKET_FILTER, insn_cnt=%u" + ", insns=" INSNS_FMT ", license=\"%s\", log_level=2718281828" + ", log_size=%u, log_buf=%p" + ", kern_version=KERNEL_VERSION(51966, 240, 13)" + ", prog_flags=0x4 /* BPF_F_??? */" + ", prog_name=\"0123456789abcde\"..., prog_ifindex=3203399405", + (unsigned int) ARRAY_SIZE(insns), INSNS_ARG, license, + log_buf_size, get_log_buf_tail()); +} - sys_bpf(cmd, efault, 4); - printf("bpf(%s, %#lx, %lu) = %s\n", - name, efault, 4UL, errstr); +static void +init_BPF_PROG_LOAD_attr4(struct bpf_attr_check *check) +{ + struct BPF_PROG_LOAD_struct *attr = &check->data.BPF_PROG_LOAD_data; - sys_bpf(cmd, efault, bogus_size); - printf("bpf(%s, %#lx, %lu) = %s\n", - name, efault, bogus_size, errstr); + attr->insns = (uintptr_t) insns; + attr->license = (uintptr_t) license; + attr->log_buf = (uintptr_t) get_log_buf(); + attr->prog_ifindex = ifindex_lo(); - sys_bpf(cmd, bogus_addr, 0); - printf("bpf(%s, %#lx, %lu) = %s\n", - name, bogus_addr, 0UL, errstr); + strncpy(log_buf, "log test", 9); } -#define BOGUS_BPF(cmd) bogus_bpf(cmd, #cmd) +static void +print_BPF_PROG_LOAD_attr4(const struct bpf_attr_check *check, unsigned long addr) +{ + printf("prog_type=BPF_PROG_TYPE_UNSPEC, insn_cnt=%u, insns=" INSNS_FMT + ", license=\"%s\", log_level=2718281828, log_size=4" + ", log_buf=\"log \"..." + ", kern_version=KERNEL_VERSION(51966, 240, 13)" + ", prog_flags=BPF_F_STRICT_ALIGNMENT|BPF_F_ANY_ALIGNMENT|0x4" + ", prog_name=\"0123456789abcde\"..., prog_ifindex=%s" + ", expected_attach_type=BPF_CGROUP_INET6_BIND", + (unsigned int) ARRAY_SIZE(insns), INSNS_ARG, + license, IFINDEX_LO_STR); +} -int -main(void) +static struct bpf_attr_check BPF_PROG_LOAD_checks[] = { + { + .data = { .BPF_PROG_LOAD_data = { .prog_type = 1 } }, + .size = offsetofend(struct BPF_PROG_LOAD_struct, prog_type), + .str = "prog_type=BPF_PROG_TYPE_SOCKET_FILTER" + ", insn_cnt=0, insns=NULL, license=NULL" + }, + { /* 1 */ + .data = { .BPF_PROG_LOAD_data = { + .prog_type = 22, + .insn_cnt = 0xbadc0ded, + .insns = 0, + .license = 0, + .log_level = 42, + .log_size = 3141592653U, + .log_buf = 0, + .kern_version = 0xcafef00d, + .prog_flags = 0, + } }, + .size = offsetofend(struct BPF_PROG_LOAD_struct, prog_flags), + .str = "prog_type=0x16 /* BPF_PROG_TYPE_??? */" + ", insn_cnt=3134983661, insns=NULL, license=NULL" + ", log_level=42, log_size=3141592653, log_buf=NULL" + ", kern_version=KERNEL_VERSION(51966, 240, 13)" + ", prog_flags=0", + }, + { /* 2 */ + .data = { .BPF_PROG_LOAD_data = { + .prog_type = 20, + .insn_cnt = 0xbadc0ded, + .insns = 0xffffffff00000000, + .license = 0xffffffff00000000, + .log_level = 2718281828U, + .log_size = log_buf_size, + .log_buf = 0xffffffff00000000, + .kern_version = 0xcafef00d, + .prog_flags = 1, + .prog_name = "fedcba987654321", + } }, + .size = offsetofend(struct BPF_PROG_LOAD_struct, prog_name), + .str = "prog_type=BPF_PROG_TYPE_SK_REUSEPORT" + ", insn_cnt=3134983661" + ", insns=" BIG_ADDR("0xffffffff00000000", "NULL") + ", license=" BIG_ADDR("0xffffffff00000000", "NULL") + ", log_level=2718281828, log_size=4096" + ", log_buf=" BIG_ADDR("0xffffffff00000000", "NULL") + ", kern_version=KERNEL_VERSION(51966, 240, 13)" + ", prog_flags=BPF_F_STRICT_ALIGNMENT" + ", prog_name=\"fedcba987654321\"", + }, + { /* 3 */ + .data = { .BPF_PROG_LOAD_data = { + .prog_type = 1, + .insn_cnt = ARRAY_SIZE(insns), + .log_level = 2718281828U, + .log_size = log_buf_size, + .kern_version = 0xcafef00d, + .prog_flags = 4, + .prog_name = "0123456789abcdef", + .prog_ifindex = 0xbeeffeed, + } }, + .size = offsetofend(struct BPF_PROG_LOAD_struct, prog_ifindex), + .init_fn = init_BPF_PROG_LOAD_attr3, + .print_fn = print_BPF_PROG_LOAD_attr3 + }, + { /* 4 */ + .data = { .BPF_PROG_LOAD_data = { + .prog_type = 0, + .insn_cnt = ARRAY_SIZE(insns), + .log_level = 2718281828U, + .log_size = 4, + .kern_version = 0xcafef00d, + .prog_flags = 7, + .prog_name = "0123456789abcdef", + .expected_attach_type = 9, + } }, + .size = offsetofend(struct BPF_PROG_LOAD_struct, + expected_attach_type), + .init_fn = init_BPF_PROG_LOAD_attr4, + .print_fn = print_BPF_PROG_LOAD_attr4 + }, + { /* 5 */ + .data = { .BPF_PROG_LOAD_data = { + .prog_flags = 2, + .expected_attach_type = 17, + .prog_btf_fd = 0xbadc0ded, + .func_info_rec_size = 0xdad1bef2, + .func_info = 0xfac1fed2fac3fed4, + .func_info_cnt = 0xdad3bef4, + .line_info_rec_size = 0xdad5bef6, + .line_info = 0xfac5fed5fac7fed8, + .line_info_cnt = 0xdad7bef8 + } }, + .size = offsetofend(struct BPF_PROG_LOAD_struct, + line_info_cnt), + .str = "prog_type=BPF_PROG_TYPE_UNSPEC" + ", insn_cnt=0" + ", insns=NULL" + ", license=NULL" + ", log_level=0" + ", log_size=0" + ", log_buf=NULL" + ", kern_version=KERNEL_VERSION(0, 0, 0)" + ", prog_flags=BPF_F_ANY_ALIGNMENT" + ", prog_name=\"\"" + ", prog_ifindex=0" + ", expected_attach_type=BPF_FLOW_DISSECTOR" + ", prog_btf_fd=-1159983635" + ", func_info_rec_size=3671178994" + ", func_info=0xfac1fed2fac3fed4" + ", func_info_cnt=3671310068" + ", line_info_rec_size=3671441142" + ", line_info=0xfac5fed5fac7fed8" + ", line_info_cnt=3671572216" + }, +}; + +static void +init_BPF_OBJ_PIN_attr(struct bpf_attr_check *check) { - efault = (unsigned long) tail_alloc(1) + 1; - - map_create(); - printf("bpf(BPF_MAP_CREATE" - ", {map_type=BPF_MAP_TYPE_UNSPEC, key_size=4" - ", value_size=8, max_entries=256}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_MAP_CREATE); - - map_any(BPF_MAP_LOOKUP_ELEM); - printf("bpf(BPF_MAP_LOOKUP_ELEM" - ", {map_fd=-1, key=0xdeadbeef}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_MAP_LOOKUP_ELEM); - - map_any(BPF_MAP_UPDATE_ELEM); - printf("bpf(BPF_MAP_UPDATE_ELEM" - ", {map_fd=-1, key=0xdeadbeef" - ", value=0xbadc0ded, flags=BPF_ANY}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_MAP_UPDATE_ELEM); - - map_any(BPF_MAP_DELETE_ELEM); - printf("bpf(BPF_MAP_DELETE_ELEM" - ", {map_fd=-1, key=0xdeadbeef}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_MAP_DELETE_ELEM); - - map_any(BPF_MAP_GET_NEXT_KEY); - printf("bpf(BPF_MAP_GET_NEXT_KEY" - ", {map_fd=-1, key=0xdeadbeef}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_MAP_GET_NEXT_KEY); - - prog_load(); - printf("bpf(BPF_PROG_LOAD" - ", {prog_type=BPF_PROG_TYPE_UNSPEC, insn_cnt=1, insns=%p" - ", license=\"GPL\", log_level=42, log_size=4096, log_buf=%p" - ", kern_version=0}, %u) = %s\n", - insns, log_buf, (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_PROG_LOAD); - -# ifdef HAVE_UNION_BPF_ATTR_BPF_FD - obj_manage(BPF_OBJ_PIN); - printf("bpf(BPF_OBJ_PIN" - ", {pathname=\"/sys/fs/bpf/foo/bar\", bpf_fd=-1}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_OBJ_PIN); - - obj_manage(BPF_OBJ_GET); - printf("bpf(BPF_OBJ_GET" - ", {pathname=\"/sys/fs/bpf/foo/bar\", bpf_fd=-1}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_OBJ_GET); -# endif - -# ifdef HAVE_UNION_BPF_ATTR_ATTACH_TYPE - prog_cgroup(BPF_PROG_ATTACH); - printf("bpf(BPF_PROG_ATTACH" - ", {target_fd=-1, attach_bpf_fd=-1" - ", attach_type=BPF_CGROUP_INET_INGRESS}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_PROG_ATTACH); - - prog_cgroup(BPF_PROG_DETACH); - printf("bpf(BPF_PROG_DETACH" - ", {target_fd=-1, attach_type=BPF_CGROUP_INET_INGRESS}, %u)" - " = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_PROG_DETACH); -# endif - - bogus_bpf(0xfacefeed, "0xfacefeed /* BPF_??? */"); + struct BPF_OBJ_PIN_struct *attr = &check->data.BPF_OBJ_PIN_data; + attr->pathname = (uintptr_t) pathname; +} - puts("+++ exited with 0 +++"); - return 0; +static struct bpf_attr_check BPF_OBJ_PIN_checks[] = { + { + .data = { .BPF_OBJ_PIN_data = { .pathname = 0 } }, + .size = offsetofend(struct BPF_OBJ_PIN_struct, pathname), + .str = "pathname=NULL, bpf_fd=0" + }, + { + .data = { .BPF_OBJ_PIN_data = { + .pathname = 0xFFFFFFFFFFFFFFFFULL + } }, + .size = offsetofend(struct BPF_OBJ_PIN_struct, pathname), + .str = "pathname=" BIG_ADDR("0xffffffffffffffff", "0xffffffff") + ", bpf_fd=0", + }, + { + .data = { .BPF_OBJ_PIN_data = { .bpf_fd = -1 } }, + .size = offsetofend(struct BPF_OBJ_PIN_struct, bpf_fd), + .init_fn = init_BPF_OBJ_PIN_attr, + .str = "pathname=\"/sys/fs/bpf/foo/bar\", bpf_fd=-1" + }, + { + .data = { .BPF_OBJ_PIN_data = { + .bpf_fd = -1, + .file_flags = 0x18 + } }, + .size = offsetofend(struct BPF_OBJ_PIN_struct, file_flags), + .init_fn = init_BPF_OBJ_PIN_attr, + .str = "pathname=\"/sys/fs/bpf/foo/bar\", bpf_fd=-1" + ", file_flags=BPF_F_RDONLY|BPF_F_WRONLY" + } +}; + +#define BPF_OBJ_GET_checks BPF_OBJ_PIN_checks + +static const struct bpf_attr_check BPF_PROG_ATTACH_checks[] = { + { + .data = { .BPF_PROG_ATTACH_data = { .target_fd = -1 } }, + .size = offsetofend(struct BPF_PROG_ATTACH_struct, target_fd), + .str = "target_fd=-1, attach_bpf_fd=0" + ", attach_type=BPF_CGROUP_INET_INGRESS, attach_flags=0" + }, + { + .data = { .BPF_PROG_ATTACH_data = { + .target_fd = -1, + .attach_bpf_fd = -2, + .attach_type = 2, + .attach_flags = 1 + } }, + .size = offsetofend(struct BPF_PROG_ATTACH_struct, attach_flags), + .str = "target_fd=-1, attach_bpf_fd=-2" + ", attach_type=BPF_CGROUP_INET_SOCK_CREATE" + ", attach_flags=BPF_F_ALLOW_OVERRIDE" + } +}; + + +static const struct bpf_attr_check BPF_PROG_DETACH_checks[] = { + { + .data = { .BPF_PROG_DETACH_data = { .target_fd = -1 } }, + .size = offsetofend(struct BPF_PROG_DETACH_struct, target_fd), + .str = "target_fd=-1, attach_type=BPF_CGROUP_INET_INGRESS" + }, + { + .data = { .BPF_PROG_DETACH_data = { + .target_fd = -1, + .attach_type = 2 + } }, + .size = offsetofend(struct BPF_PROG_DETACH_struct, attach_type), + .str = "target_fd=-1, attach_type=BPF_CGROUP_INET_SOCK_CREATE" + } +}; + +static const struct bpf_attr_check BPF_PROG_TEST_RUN_checks[] = { + { + .data = { .BPF_PROG_TEST_RUN_data = { .prog_fd = -1 } }, + .size = offsetofend(struct BPF_PROG_TEST_RUN_struct, prog_fd), + .str = "test={prog_fd=-1, retval=0, data_size_in=0" + ", data_size_out=0, data_in=NULL, data_out=NULL" + ", repeat=0, duration=0}" + }, + { + .data = { .BPF_PROG_TEST_RUN_data = { + .prog_fd = -1, + .retval = 0xfac1fed2, + .data_size_in = 0xfac3fed4, + .data_size_out = 0xfac5fed6, + .data_in = (uint64_t) 0xfacef11dbadc2dedULL, + .data_out = (uint64_t) 0xfacef33dbadc4dedULL, + .repeat = 0xfac7fed8, + .duration = 0xfac9feda + } }, + .size = offsetofend(struct BPF_PROG_TEST_RUN_struct, duration), + .str = "test={prog_fd=-1, retval=4207017682" + ", data_size_in=4207148756, data_size_out=4207279830" + ", data_in=0xfacef11dbadc2ded" + ", data_out=0xfacef33dbadc4ded" + ", repeat=4207410904, duration=4207541978}" + } +}; + +static const struct bpf_attr_check BPF_PROG_GET_NEXT_ID_checks[] = { + { + .data = { .BPF_PROG_GET_NEXT_ID_data = { + .start_id = 0xdeadbeef + } }, + .size = offsetofend(struct BPF_PROG_GET_NEXT_ID_struct, start_id), + .str = "start_id=3735928559, next_id=0" + }, + { + .data = { .BPF_PROG_GET_NEXT_ID_data = { + .start_id = 0xdeadbeef + } }, + .size = 1, + .str = "start_id=" +#if WORDS_BIGENDIAN + "3724541952" /* 0xde000000 */ +#else + "239" /* 0x000000ef */ +#endif + ", next_id=0" + }, + { + .data = { .BPF_PROG_GET_NEXT_ID_data = { + .start_id = 0xbadc0ded, + .next_id = 0xcafef00d + } }, + .size = offsetofend(struct BPF_PROG_GET_NEXT_ID_struct, next_id), + .str = "start_id=3134983661, next_id=3405705229" + }, + { + .data = { .BPF_PROG_GET_NEXT_ID_data = { + .start_id = 0xbadc0ded, + .next_id = 0xcafef00d, + .open_flags = 0xffffff27 + } }, + .size = offsetofend(struct BPF_PROG_GET_NEXT_ID_struct, open_flags), + .str = "start_id=3134983661, next_id=3405705229" + ", open_flags=0xffffff27 /* BPF_F_??? */" + } +}; + +#define BPF_MAP_GET_NEXT_ID_checks BPF_PROG_GET_NEXT_ID_checks + +static const struct bpf_attr_check BPF_PROG_GET_FD_BY_ID_checks[] = { + { + .data = { .BPF_PROG_GET_FD_BY_ID_data = { + .prog_id = 0xdeadbeef + } }, + .size = offsetofend(struct BPF_PROG_GET_FD_BY_ID_struct, prog_id), + .str = "prog_id=3735928559, next_id=0" + }, + { + .data = { .BPF_PROG_GET_FD_BY_ID_data = { + .prog_id = 0xbadc0ded, + .next_id = 0xcafef00d + } }, + .size = offsetofend(struct BPF_PROG_GET_FD_BY_ID_struct, next_id), + .str = "prog_id=3134983661, next_id=3405705229" + }, + { + .data = { .BPF_PROG_GET_FD_BY_ID_data = { + .prog_id = 0xbadc0ded, + .next_id = 0xcafef00d, + .open_flags = 0xffffff27 + } }, + .size = offsetofend(struct BPF_PROG_GET_FD_BY_ID_struct, open_flags), + .str = "prog_id=3134983661, next_id=3405705229" + ", open_flags=0xffffff27 /* BPF_F_??? */" + } +}; + +static const struct bpf_attr_check BPF_MAP_GET_FD_BY_ID_checks[] = { + { + .data = { .BPF_MAP_GET_FD_BY_ID_data = { + .map_id = 0xdeadbeef + } }, + .size = offsetofend(struct BPF_MAP_GET_FD_BY_ID_struct, map_id), + .str = "map_id=3735928559, next_id=0" + }, + { + .data = { .BPF_MAP_GET_FD_BY_ID_data = { + .map_id = 0xbadc0ded, + .next_id = 0xcafef00d + } }, + .size = offsetofend(struct BPF_MAP_GET_FD_BY_ID_struct, next_id), + .str = "map_id=3134983661, next_id=3405705229" + }, + { + .data = { .BPF_MAP_GET_FD_BY_ID_data = { + .map_id = 0xbadc0ded, + .next_id = 0xcafef00d, + .open_flags = 0xffffff27 + } }, + .size = offsetofend(struct BPF_MAP_GET_FD_BY_ID_struct, open_flags), + .str = "map_id=3134983661, next_id=3405705229" + ", open_flags=0xffffff27 /* BPF_F_??? */" + } +}; + +static const struct bpf_attr_check BPF_OBJ_GET_INFO_BY_FD_checks[] = { + { + .data = { .BPF_OBJ_GET_INFO_BY_FD_data = { .bpf_fd = -1 } }, + .size = offsetofend(struct BPF_OBJ_GET_INFO_BY_FD_struct, bpf_fd), + .str = "info={bpf_fd=-1, info_len=0, info=NULL}" + }, + { + .data = { .BPF_OBJ_GET_INFO_BY_FD_data = { + .bpf_fd = -1, + .info_len = 0xdeadbeef, + .info = (uint64_t) 0xfacefeedbadc0dedULL + } }, + .size = offsetofend(struct BPF_OBJ_GET_INFO_BY_FD_struct, info), + .str = "info={bpf_fd=-1, info_len=3735928559" + ", info=0xfacefeedbadc0ded}" + } +}; + + +static uint32_t prog_load_ids[] = { 0, 1, 0xffffffff, 2718281828, }; +uint32_t *prog_load_ids_ptr; + +static void +init_BPF_PROG_QUERY_attr4(struct bpf_attr_check *check) +{ + struct BPF_PROG_QUERY_struct *attr = &check->data.BPF_PROG_QUERY_data; + + if (!prog_load_ids_ptr) + prog_load_ids_ptr = tail_memdup(prog_load_ids, + sizeof(prog_load_ids)); + + attr->prog_ids = (uintptr_t) prog_load_ids_ptr; + attr->prog_cnt = ARRAY_SIZE(prog_load_ids); } +static void +print_BPF_PROG_QUERY_attr4(const struct bpf_attr_check *check, unsigned long addr) +{ + printf("query={target_fd=-1153374643" + ", attach_type=0xfeedface /* BPF_??? */" + ", query_flags=BPF_F_QUERY_EFFECTIVE|0xdeadf00c" + ", attach_flags=BPF_F_ALLOW_MULTI|0xbeefcafc" +#if defined(INJECT_RETVAL) && INJECT_RETVAL > 0 + ", prog_ids=[0, 1, 4294967295, 2718281828], prog_cnt=4}" #else + ", prog_ids=%p, prog_cnt=4}", prog_load_ids_ptr +#endif + ); +} + +static void +init_BPF_PROG_QUERY_attr5(struct bpf_attr_check *check) +{ + struct BPF_PROG_QUERY_struct *attr = &check->data.BPF_PROG_QUERY_data; -SKIP_MAIN_UNDEFINED("__NR_bpf") + if (!prog_load_ids_ptr) + prog_load_ids_ptr = tail_memdup(prog_load_ids, + sizeof(prog_load_ids)); + attr->prog_ids = (uintptr_t) prog_load_ids_ptr; + attr->prog_cnt = ARRAY_SIZE(prog_load_ids) + 1; +} + +static void +print_BPF_PROG_QUERY_attr5(const struct bpf_attr_check *check, unsigned long addr) +{ + printf("query={target_fd=-1153374643" + ", attach_type=0xfeedface /* BPF_??? */" + ", query_flags=BPF_F_QUERY_EFFECTIVE|0xdeadf00c" + ", attach_flags=BPF_F_ALLOW_MULTI|0xbeefcafc" +#if defined(INJECT_RETVAL) && INJECT_RETVAL > 0 + ", prog_ids=[0, 1, 4294967295, 2718281828, ... /* %p */]" + ", prog_cnt=5}", + prog_load_ids_ptr + ARRAY_SIZE(prog_load_ids) +#else + ", prog_ids=%p, prog_cnt=5}", prog_load_ids_ptr #endif + ); +} + +static struct bpf_attr_check BPF_PROG_QUERY_checks[] = { + { + .data = { .BPF_PROG_QUERY_data = { .target_fd = -1 } }, + .size = offsetofend(struct BPF_PROG_QUERY_struct, target_fd), + .str = "query={target_fd=-1" + ", attach_type=BPF_CGROUP_INET_INGRESS, query_flags=0" + ", attach_flags=0, prog_ids=NULL, prog_cnt=0}", + }, + { /* 1 */ + .data = { .BPF_PROG_QUERY_data = { + .target_fd = 3141592653U, + .attach_type = 16, + .query_flags = 1, + .attach_flags = 3, + } }, + .size = offsetofend(struct BPF_PROG_QUERY_struct, attach_flags), + .str = "query={target_fd=-1153374643" + ", attach_type=BPF_LIRC_MODE2" + ", query_flags=BPF_F_QUERY_EFFECTIVE" + ", attach_flags=BPF_F_ALLOW_OVERRIDE|BPF_F_ALLOW_MULTI" + ", prog_ids=NULL, prog_cnt=0}", + }, + { /* 2 */ + .data = { .BPF_PROG_QUERY_data = { + .target_fd = 3141592653U, + .attach_type = 18, + .query_flags = 0xfffffffe, + .attach_flags = 0xfffffffc, + .prog_ids = 0xffffffffffffffffULL, + .prog_cnt = 2718281828, + } }, + .size = offsetofend(struct BPF_PROG_QUERY_struct, prog_cnt), + .str = "query={target_fd=-1153374643" + ", attach_type=0x12 /* BPF_??? */" + ", query_flags=0xfffffffe /* BPF_F_QUERY_??? */" + ", attach_flags=0xfffffffc /* BPF_F_??? */" + ", prog_ids=" + BIG_ADDR("0xffffffffffffffff", "0xffffffff") + ", prog_cnt=2718281828}", + }, + { /* 3 */ + .data = { .BPF_PROG_QUERY_data = { + .target_fd = 3141592653U, + .attach_type = 0xfeedface, + .query_flags = 0xdeadf00d, + .attach_flags = 0xbeefcafe, + .prog_ids = 0xffffffffffffffffULL, + .prog_cnt = 0, + } }, + .size = offsetofend(struct BPF_PROG_QUERY_struct, prog_cnt), + .str = "query={target_fd=-1153374643" + ", attach_type=0xfeedface /* BPF_??? */" + ", query_flags=BPF_F_QUERY_EFFECTIVE|0xdeadf00c" + ", attach_flags=BPF_F_ALLOW_MULTI|0xbeefcafc" + ", prog_ids=" BIG_ADDR_MAYBE("0xffffffffffffffff") "[]" + ", prog_cnt=0}", + }, + { /* 4 */ + .data = { .BPF_PROG_QUERY_data = { + .target_fd = 3141592653U, + .attach_type = 0xfeedface, + .query_flags = 0xdeadf00d, + .attach_flags = 0xbeefcafe, + } }, + .size = offsetofend(struct BPF_PROG_QUERY_struct, prog_cnt), + .init_fn = init_BPF_PROG_QUERY_attr4, + .print_fn = print_BPF_PROG_QUERY_attr4, + }, + { /* 5 */ + .data = { .BPF_PROG_QUERY_data = { + .target_fd = 3141592653U, + .attach_type = 0xfeedface, + .query_flags = 0xdeadf00d, + .attach_flags = 0xbeefcafe, + } }, + .size = offsetofend(struct BPF_PROG_QUERY_struct, prog_cnt), + .init_fn = init_BPF_PROG_QUERY_attr5, + .print_fn = print_BPF_PROG_QUERY_attr5, + }, +}; + + +static void +init_BPF_RAW_TRACEPOINT_attr2(struct bpf_attr_check *check) +{ + /* TODO: test the 128 byte limit */ + static const char tp_name[] = "0123456789qwertyuiop0123456789qwe"; + + struct BPF_RAW_TRACEPOINT_OPEN_struct *attr = + &check->data.BPF_RAW_TRACEPOINT_OPEN_data; + + attr->name = (uintptr_t) tp_name; +} + +static struct bpf_attr_check BPF_RAW_TRACEPOINT_OPEN_checks[] = { + { + .data = { .BPF_RAW_TRACEPOINT_OPEN_data = { .name = 0 } }, + .size = offsetofend(struct BPF_RAW_TRACEPOINT_OPEN_struct, + name), + .str = "raw_tracepoint={name=NULL, prog_fd=0}", + }, + { /* 1 */ + .data = { .BPF_RAW_TRACEPOINT_OPEN_data = { + .name = 0xffffffff00000000ULL, + .prog_fd = 0xdeadbeef, + } }, + .size = offsetofend(struct BPF_RAW_TRACEPOINT_OPEN_struct, + prog_fd), + .str = "raw_tracepoint=" + "{name=" BIG_ADDR("0xffffffff00000000", "NULL") + ", prog_fd=-559038737}", + }, + { + .data = { .BPF_RAW_TRACEPOINT_OPEN_data = { + .prog_fd = 0xdeadbeef, + } }, + .size = offsetofend(struct BPF_RAW_TRACEPOINT_OPEN_struct, + prog_fd), + .init_fn = init_BPF_RAW_TRACEPOINT_attr2, + .str = "raw_tracepoint=" + "{name=\"0123456789qwertyuiop0123456789qw\"..." + ", prog_fd=-559038737}", + } +}; + +static void +init_BPF_BTF_LOAD_attr(struct bpf_attr_check *check) +{ + static const char sample_btf_data[] = "bPf\0daTum"; + + static char *btf_data; + if (!btf_data) + btf_data = tail_memdup(sample_btf_data, + sizeof(sample_btf_data) - 1); + + struct BPF_BTF_LOAD_struct *attr = &check->data.BPF_BTF_LOAD_data; + attr->btf = (uintptr_t) btf_data; +} + +static struct bpf_attr_check BPF_BTF_LOAD_checks[] = { + { + .data = { .BPF_BTF_LOAD_data = { .btf = 0 } }, + .size = offsetofend(struct BPF_BTF_LOAD_struct, btf), + .str = "btf=NULL, btf_log_buf=NULL, btf_size=0" + ", btf_log_size=0, btf_log_level=0" + }, + { /* 1 */ + .data = { .BPF_BTF_LOAD_data = { + .btf_log_buf = 0xfacefeeddeadbeefULL, + .btf_size = 9, + .btf_log_size = -1U, + .btf_log_level = 42 + } }, + .size = offsetofend(struct BPF_BTF_LOAD_struct, btf_log_level), + .init_fn = init_BPF_BTF_LOAD_attr, + .str = "btf=\"bPf\\0daTum\"" + ", btf_log_buf=0xfacefeeddeadbeef" + ", btf_size=9" + ", btf_log_size=4294967295" + ", btf_log_level=42" + } +}; + +static const struct bpf_attr_check BPF_BTF_GET_FD_BY_ID_checks[] = { + { + .data = { .BPF_BTF_GET_FD_BY_ID_data = { .btf_id = 0xdeadbeef } }, + .size = offsetofend(struct BPF_BTF_GET_FD_BY_ID_struct, btf_id), + .str = "btf_id=3735928559" + } +}; + +static const struct bpf_attr_check BPF_TASK_FD_QUERY_checks[] = { + { + .data = { .BPF_TASK_FD_QUERY_data = { .pid = 0xdeadbeef } }, + .size = offsetofend(struct BPF_TASK_FD_QUERY_struct, pid), + .str = "task_fd_query={pid=3735928559, fd=0, flags=0" + ", buf_len=0, buf=NULL, prog_id=0" + ", fd_type=BPF_FD_TYPE_RAW_TRACEPOINT" + ", probe_offset=0, probe_addr=0}" + }, + { /* 1 */ + .data = { .BPF_TASK_FD_QUERY_data = { + .pid = 0xcafef00d, + .fd = 0xdeadbeef, + .flags = 0xfacefeed, + .buf_len = 0xdefaced, + .buf = 0xfffffffffffffffe, + .prog_id = 0xbadc0ded, + .fd_type = 5, + .probe_offset = 0xfac1fed2fac3fed4, + .probe_addr = 0xfac5fed5fac7fed8 + } }, + .size = offsetofend(struct BPF_TASK_FD_QUERY_struct, probe_addr), + .str = "task_fd_query={pid=3405705229" + ", fd=-559038737" + ", flags=4207869677" + ", buf_len=233811181" + ", buf=" BIG_ADDR("0xfffffffffffffffe", "0xfffffffe") + ", prog_id=3134983661" + ", fd_type=BPF_FD_TYPE_URETPROBE" + ", probe_offset=0xfac1fed2fac3fed4" + ", probe_addr=0xfac5fed5fac7fed8}" + } +}; + + +#define CHK(cmd_) \ + { \ + cmd_, #cmd_, \ + cmd_##_checks, ARRAY_SIZE(cmd_##_checks), \ + } \ + /* End of CHK definition */ + +int +main(void) +{ + static const struct bpf_check checks[] = { + CHK(BPF_MAP_CREATE), + CHK(BPF_MAP_LOOKUP_ELEM), + CHK(BPF_MAP_UPDATE_ELEM), + CHK(BPF_MAP_DELETE_ELEM), + CHK(BPF_MAP_GET_NEXT_KEY), + CHK(BPF_PROG_LOAD), + CHK(BPF_OBJ_PIN), + CHK(BPF_OBJ_GET), + CHK(BPF_PROG_ATTACH), + CHK(BPF_PROG_DETACH), + CHK(BPF_PROG_TEST_RUN), + CHK(BPF_PROG_GET_NEXT_ID), + CHK(BPF_MAP_GET_NEXT_ID), + CHK(BPF_PROG_GET_FD_BY_ID), + CHK(BPF_MAP_GET_FD_BY_ID), + CHK(BPF_OBJ_GET_INFO_BY_FD), + CHK(BPF_PROG_QUERY), + CHK(BPF_RAW_TRACEPOINT_OPEN), + CHK(BPF_BTF_LOAD), + CHK(BPF_BTF_GET_FD_BY_ID), + CHK(BPF_TASK_FD_QUERY), + CHK(BPF_MAP_LOOKUP_AND_DELETE_ELEM), + }; + + page_size = get_page_size(); + end_of_page = (unsigned long) tail_alloc(1) + 1; + + for (size_t i = 0; i < ARRAY_SIZE(checks); i++) + test_bpf(checks + i); + + sys_bpf(0xfacefeed, 0, (kernel_ulong_t) 0xfacefeedbadc0dedULL); + printf("bpf(0xfacefeed /* BPF_??? */, NULL, %u) = %s\n", + 0xbadc0dedu, errstr); + + sys_bpf(0xfacefeed, end_of_page, 40); + printf("bpf(0xfacefeed /* BPF_??? */, %#lx, 40) = %s\n", + end_of_page, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/bpf.gen.test b/tests-m32/bpf.gen.test new file mode 100755 index 00000000..1391d6b8 --- /dev/null +++ b/tests-m32/bpf.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (bpf -a20 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-m32/bpf.test b/tests-m32/bpf.test deleted file mode 100755 index adf0d576..00000000 --- a/tests-m32/bpf.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check bpf syscall decoding. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a20 diff --git a/tests-m32/brk.c b/tests-m32/brk.c index 572ebd61..caf40e13 100644 --- a/tests-m32/brk.c +++ b/tests-m32/brk.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/brk.test b/tests-m32/brk.test index 8c0e2e49..e90cf8ab 100755 --- a/tests-m32/brk.test +++ b/tests-m32/brk.test @@ -1,10 +1,14 @@ #!/bin/sh - +# # Check brk syscall decoding. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog > /dev/null run_strace -a10 -ebrk $args > "$EXP" match_grep "$LOG" "$EXP" -rm -f "$EXP" diff --git a/tests-m32/btrfs-X.test b/tests-m32/btrfs-X.test new file mode 100755 index 00000000..58770ae0 --- /dev/null +++ b/tests-m32/btrfs-X.test @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Check verbose xlat decoding of btrfs ioctl. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog ../btrfs -X > /dev/null +run_strace -a16 -Xverbose -eioctl $args > "$EXP" +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests-m32/btrfs-v.test b/tests-m32/btrfs-v.test index 1ee17b4b..f67d4126 100755 --- a/tests-m32/btrfs-v.test +++ b/tests-m32/btrfs-v.test @@ -1,15 +1,16 @@ #!/bin/sh - -# Check verbose decoding of btrfs ioctl +# +# Check verbose decoding of btrfs ioctl. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./btrfs -v > /dev/null -run_strace -a16 -veioctl $args > "$EXP" check_prog grep +run_prog ../btrfs -v > /dev/null +run_strace -a16 -veioctl $args > "$EXP" grep -v '^ioctl([012],' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" - -exit 0 diff --git a/tests-m32/btrfs-vX.test b/tests-m32/btrfs-vX.test new file mode 100755 index 00000000..db15a50c --- /dev/null +++ b/tests-m32/btrfs-vX.test @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Check verbose, verbose xlat decoding of btrfs ioctl. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog ../btrfs -v -X > /dev/null +run_strace -a16 -Xverbose -veioctl $args > "$EXP" +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests-m32/btrfs-vw.test b/tests-m32/btrfs-vw.test index c7e40ad7..eba59d7a 100755 --- a/tests-m32/btrfs-vw.test +++ b/tests-m32/btrfs-vw.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check verbose decoding of btrfs ioctl w/ live ioctls. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later # WARNING: USE OF THIS TEST WILL MODIFY AN EXISTING BTRFS FILE SYSTEM @@ -18,12 +23,8 @@ elif [ ! -d "${BTRFS_MOUNTPOINT}" ]; then skip_ "\$BTRFS_MOUNTPOINT does not point to a directory" fi -run_prog ./btrfs -v -w "${BTRFS_MOUNTPOINT}" > /dev/null -run_strace -a16 -veioctl $args > "$EXP" check_prog grep +run_prog ../btrfs -v -w "${BTRFS_MOUNTPOINT}" > /dev/null +run_strace -a16 -veioctl $args > "$EXP" grep -v '^ioctl([012],' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" - -exit 0 diff --git a/tests-m32/btrfs-vwX.test b/tests-m32/btrfs-vwX.test new file mode 100755 index 00000000..20f60abe --- /dev/null +++ b/tests-m32/btrfs-vwX.test @@ -0,0 +1,30 @@ +#!/bin/sh +# +# Check verbose, verbose xlat decoding of btrfs ioctl w/ live ioctls. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +# WARNING: USE OF THIS TEST WILL MODIFY AN EXISTING BTRFS FILE SYSTEM + +# Typical usage: +# mkfs.btrfs +# mount /mnt +# BTRFS_MOUNTPOINT=/mnt make check TESTS="btrfs-vwX" +# umount /mnt + +. "${srcdir=.}/init.sh" + +if [ -z "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT not set" +elif [ ! -d "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT does not point to a directory" +fi + +check_prog grep +run_prog ../btrfs -v -w -X "${BTRFS_MOUNTPOINT}" > /dev/null +run_strace -a16 -Xverbose -veioctl $args > "$EXP" +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests-m32/btrfs-w.test b/tests-m32/btrfs-w.test index 6238dca8..ba9b220d 100755 --- a/tests-m32/btrfs-w.test +++ b/tests-m32/btrfs-w.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check decoding of btrfs ioctl w/ live ioctls. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later # WARNING: USE OF THIS TEST WILL MODIFY AN EXISTING BTRFS FILE SYSTEM @@ -18,12 +23,8 @@ elif [ ! -d "${BTRFS_MOUNTPOINT}" ]; then skip_ "\$BTRFS_MOUNTPOINT does not point to a directory" fi -run_prog ./btrfs -w "${BTRFS_MOUNTPOINT}" > /dev/null -run_strace -a16 -eioctl $args > "$EXP" check_prog grep +run_prog ../btrfs -w "${BTRFS_MOUNTPOINT}" > /dev/null +run_strace -a16 -eioctl $args > "$EXP" grep -v '^ioctl([012],' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" - -exit 0 diff --git a/tests-m32/btrfs-wX.test b/tests-m32/btrfs-wX.test new file mode 100755 index 00000000..1a7dea2e --- /dev/null +++ b/tests-m32/btrfs-wX.test @@ -0,0 +1,30 @@ +#!/bin/sh +# +# Check verbose xlat decoding of btrfs ioctl w/ live ioctls. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +# WARNING: USE OF THIS TEST WILL MODIFY AN EXISTING BTRFS FILE SYSTEM + +# Typical usage: +# mkfs.btrfs +# mount /mnt +# BTRFS_MOUNTPOINT=/mnt make check TESTS="btrfs-wX" +# umount /mnt + +. "${srcdir=.}/init.sh" + +if [ -z "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT not set" +elif [ ! -d "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT does not point to a directory" +fi + +check_prog grep +run_prog ../btrfs -w -X "${BTRFS_MOUNTPOINT}" > /dev/null +run_strace -a16 -Xverbose -eioctl $args > "$EXP" +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests-m32/btrfs.c b/tests-m32/btrfs.c index b3e23f80..f1a26bf3 100644 --- a/tests-m32/btrfs.c +++ b/tests-m32/btrfs.c @@ -1,57 +1,73 @@ +/* + * Copyright (c) 2016-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #ifdef HAVE_LINUX_BTRFS_H -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "xlat.h" - -#include "xlat/btrfs_balance_args.h" -#include "xlat/btrfs_balance_flags.h" -#include "xlat/btrfs_balance_state.h" -#include "xlat/btrfs_compress_types.h" -#include "xlat/btrfs_defrag_flags.h" -#include "xlat/btrfs_dev_stats_values.h" -#include "xlat/btrfs_dev_stats_flags.h" -#include "xlat/btrfs_qgroup_inherit_flags.h" -#include "xlat/btrfs_qgroup_limit_flags.h" -#include "xlat/btrfs_scrub_flags.h" -#include "xlat/btrfs_send_flags.h" -#include "xlat/btrfs_space_info_flags.h" -#include "xlat/btrfs_snap_flags_v2.h" -#include "xlat/btrfs_tree_objectids.h" -#include "xlat/btrfs_features_compat.h" -#include "xlat/btrfs_features_compat_ro.h" -#include "xlat/btrfs_features_incompat.h" -#include "xlat/btrfs_key_types.h" - -#ifdef HAVE_LINUX_FIEMAP_H -# include -# include "xlat/fiemap_flags.h" -# include "xlat/fiemap_extent_flags.h" -#endif - -#ifndef BTRFS_LABEL_SIZE -# define BTRFS_LABEL_SIZE 256 -#endif - -#ifndef BTRFS_NAME_LEN -# define BTRFS_NAME_LEN 255 -#endif +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include "xlat.h" + +# include "xlat/btrfs_balance_args.h" +# include "xlat/btrfs_balance_flags.h" +# include "xlat/btrfs_balance_state.h" +# include "xlat/btrfs_compress_types.h" +# include "xlat/btrfs_cont_reading_from_srcdev_mode.h" +# include "xlat/btrfs_defrag_flags.h" +# include "xlat/btrfs_dev_stats_values.h" +# include "xlat/btrfs_dev_stats_flags.h" +# include "xlat/btrfs_qgroup_inherit_flags.h" +# include "xlat/btrfs_qgroup_limit_flags.h" +# include "xlat/btrfs_scrub_flags.h" +# include "xlat/btrfs_send_flags.h" +# include "xlat/btrfs_space_info_flags.h" +# include "xlat/btrfs_snap_flags_v2.h" +# include "xlat/btrfs_tree_objectids.h" +# include "xlat/btrfs_features_compat.h" +# include "xlat/btrfs_features_compat_ro.h" +# include "xlat/btrfs_features_incompat.h" +# include "xlat/btrfs_key_types.h" + +# ifdef HAVE_LINUX_FIEMAP_H +# include +# include "xlat/fiemap_flags.h" +# include "xlat/fiemap_extent_flags.h" +# endif + +# ifndef BTRFS_LABEL_SIZE +# define BTRFS_LABEL_SIZE 256 +# endif + +# ifndef BTRFS_NAME_LEN +# define BTRFS_NAME_LEN 255 +# endif + +# ifndef FS_IOC_GETFSLABEL +# define FS_IOC_GETFSLABEL BTRFS_IOC_GET_FSLABEL +# endif + +# ifndef FS_IOC_SETFSLABEL +# define FS_IOC_SETFSLABEL BTRFS_IOC_SET_FSLABEL +# endif /* * Prior to Linux 3.12, the BTRFS_IOC_DEFAULT_SUBVOL used u64 in @@ -61,8 +77,13 @@ typedef __u64 u64; static const char *btrfs_test_root; static int btrfs_test_dir_fd; -static bool verbose = false; -static bool write_ok = false; +static bool verbose; +static bool write_ok; +static bool verbose_xlat; + +static const char *path; +static const char dir_name_fmt[] = "strace-test-%d"; +static char dir_name[sizeof(dir_name_fmt) + sizeof(int) * 3]; const unsigned char uuid_reference[BTRFS_UUID_SIZE] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, @@ -71,50 +92,50 @@ const unsigned char uuid_reference[BTRFS_UUID_SIZE] = { const char uuid_reference_string[] = "01234567-89ab-cdef-fedc-ba9876543210"; -#ifndef BTRFS_IOC_QUOTA_RESCAN +# ifndef BTRFS_IOC_QUOTA_RESCAN struct btrfs_ioctl_quota_rescan_args { uint64_t flags, progress, reserved[6]; }; -# define BTRFS_IOC_QUOTA_RESCAN _IOW(BTRFS_IOCTL_MAGIC, 44, \ - struct btrfs_ioctl_quota_rescan_args) -# define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \ - struct btrfs_ioctl_quota_rescan_args) -#endif - -#ifndef BTRFS_IOC_QUOTA_RESCAN_WAIT -# define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46) -#endif - -#ifndef BTRFS_IOC_GET_FEATURES -# define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \ - struct btrfs_ioctl_feature_flags) -# define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, \ - struct btrfs_ioctl_feature_flags[2]) -# define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \ - struct btrfs_ioctl_feature_flags[3]) -#endif - -#ifndef HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS +# define BTRFS_IOC_QUOTA_RESCAN \ + _IOW(BTRFS_IOCTL_MAGIC, 44, struct btrfs_ioctl_quota_rescan_args) +# define BTRFS_IOC_QUOTA_RESCAN_STATUS \ + _IOR(BTRFS_IOCTL_MAGIC, 45, struct btrfs_ioctl_quota_rescan_args) +# endif + +# ifndef BTRFS_IOC_QUOTA_RESCAN_WAIT +# define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46) +# endif + +# ifndef BTRFS_IOC_GET_FEATURES +# define BTRFS_IOC_GET_FEATURES \ + _IOR(BTRFS_IOCTL_MAGIC, 57, struct btrfs_ioctl_feature_flags) +# define BTRFS_IOC_SET_FEATURES \ + _IOW(BTRFS_IOCTL_MAGIC, 57, struct btrfs_ioctl_feature_flags[2]) +# define BTRFS_IOC_GET_SUPPORTED_FEATURES \ + _IOR(BTRFS_IOCTL_MAGIC, 57, struct btrfs_ioctl_feature_flags[3]) +# endif + +# ifndef HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS struct btrfs_ioctl_feature_flags { - uint64_t compat_flags; - uint64_t compat_ro_flags; - uint64_t incompat_flags; + uint64_t compat_flags; + uint64_t compat_ro_flags; + uint64_t incompat_flags; }; -#endif +# endif -#ifndef HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START +# ifndef HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START struct btrfs_ioctl_defrag_range_args { - uint64_t start; - uint64_t len; - uint64_t flags; - uint32_t extent_thresh; - uint32_t compress_type; - uint32_t unused[4]; + uint64_t start; + uint64_t len; + uint64_t flags; + uint32_t extent_thresh; + uint32_t compress_type; + uint32_t unused[4]; }; -#endif +# endif -#ifndef FIDEDUPERANGE -# define FIDEDUPERANGE _IOWR(0x94, 54, struct file_dedupe_range) +# ifndef FIDEDUPERANGE +# define FIDEDUPERANGE _IOWR(0x94, 54, struct file_dedupe_range) struct file_dedupe_range_info { int64_t dest_fd; /* in - destination file */ uint64_t dest_offset; /* in - start of extent in destination */ @@ -137,27 +158,99 @@ struct file_dedupe_range { uint32_t reserved2; /* must be zero */ struct file_dedupe_range_info info[0]; }; -#endif +# endif -#ifndef BTRFS_IOC_TREE_SEARCH_V2 -# define BTRFS_IOC_TREE_SEARCH_V2 _IOWR(BTRFS_IOCTL_MAGIC, 17, \ - struct btrfs_ioctl_search_args_v2) +# ifndef BTRFS_IOC_TREE_SEARCH_V2 +# define BTRFS_IOC_TREE_SEARCH_V2 \ + _IOWR(BTRFS_IOCTL_MAGIC, 17, struct btrfs_ioctl_search_args_v2) struct btrfs_ioctl_search_args_v2 { struct btrfs_ioctl_search_key key; /* in/out - search parameters */ uint64_t buf_size; /* in - size of buffer * out - on EOVERFLOW: needed size * to store item */ - uint64_t buf[0]; /* out - found items */ + uint64_t buf[0]; /* out - found items */ }; -#endif +# endif + + +static const char * +sprint_xlat_(uint32_t val, const char *xlat) +{ + static char str[256]; + int ret; + + if (verbose_xlat) { + ret = snprintf(str, sizeof(str), "%#x /* %s */", val, xlat); + if (ret < 0) + perror_msg_and_fail("sprint_ioc(%#x, %s)", val, xlat); + if ((unsigned) ret >= sizeof(str)) + error_msg_and_fail("sprint_ioc(%#x, %s): buffer " + "overflow", val, xlat); + + return str; + } + + return xlat; +} static const char * -maybe_print_uint64max(uint64_t val) +sprint_makedev(unsigned long long val) +{ + static char devid[256]; + int ret; + + if (verbose_xlat) + ret = snprintf(devid, sizeof(devid), + "%#llx /* makedev(%#x, %#x) */", + val, major(val), minor(val)); + else + ret = snprintf(devid, sizeof(devid), + "makedev(%#x, %#x)", major(val), minor(val)); + + if (ret < 0) + perror_msg_and_fail("sprint_makedev(%llx)", val); + if ((unsigned) ret >= sizeof(devid)) + error_msg_and_fail("sprint_makedev(%llx): buffer " + "overflow", val); + return devid; +} + +# define ioc(x_) sprint_xlat_(x_, #x_) + +void +prfl_btrfs(const struct xlat *xlat, const unsigned long long val, + const char *str) +{ + if (verbose_xlat && val) + printf("%#llx /* ", val); + printflags(xlat, val, str); + if (verbose_xlat && val) + printf(" */"); +} + +void +prxval_btrfs(const struct xlat *xlat, const unsigned long long val, + const char *str, bool known) { - if (val == UINT64_MAX) - return " /* UINT64_MAX */"; - return ""; + if (verbose_xlat && known) + printf("%#llx /* ", val); + printxval(xlat, val, str); + if (verbose_xlat && known) + printf(" */"); +} + +static void +print_uint64(const char *prefix, uint64_t val) +{ + if (val == UINT64_MAX) { + if (verbose_xlat) + printf("%s%" PRIu64 " /* UINT64_MAX */", prefix, val); + else + printf("%sUINT64_MAX", prefix); + } else { + printf("%s%" PRIu64, prefix, val); + } } /* takes highest valid flag bit */ @@ -183,10 +276,10 @@ static void btrfs_test_trans_ioctls(void) { ioctl(-1, BTRFS_IOC_TRANS_START, NULL); - printf("ioctl(-1, BTRFS_IOC_TRANS_START) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_TRANS_START)); ioctl(-1, BTRFS_IOC_TRANS_END, NULL); - printf("ioctl(-1, BTRFS_IOC_TRANS_END) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_TRANS_END)); } /* @@ -202,14 +295,15 @@ btrfs_test_sync_ioctls(void) uint64_t u64val = 0xdeadbeefbadc0dedULL; ioctl(-1, BTRFS_IOC_SYNC, NULL); - printf("ioctl(-1, BTRFS_IOC_SYNC) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_SYNC)); ioctl(-1, BTRFS_IOC_WAIT_SYNC, NULL); - printf("ioctl(-1, BTRFS_IOC_WAIT_SYNC, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_WAIT_SYNC)); ioctl(-1, BTRFS_IOC_WAIT_SYNC, &u64val); - printf("ioctl(-1, BTRFS_IOC_WAIT_SYNC, [%" PRIu64 - "]) = -1 EBADF (%m)\n", u64val); + printf("ioctl(-1, %s, [%" PRIu64 "]) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_WAIT_SYNC), u64val); /* * The live test of BTRFS_IOC_SYNC happens as a part of the test @@ -221,24 +315,24 @@ static void btrfs_print_qgroup_inherit(struct btrfs_qgroup_inherit *inherit) { printf("{flags="); - printflags(btrfs_qgroup_inherit_flags, inherit->flags, + prfl_btrfs(btrfs_qgroup_inherit_flags, inherit->flags, "BTRFS_QGROUP_INHERIT_???"); printf(", num_qgroups=%" PRI__u64 ", num_ref_copies=%" PRI__u64 - ", num_excl_copies=%" PRI__u64", lim={flags=", + ", num_excl_copies=%" PRI__u64 ", lim={flags=", inherit->num_qgroups, inherit->num_ref_copies, inherit->num_excl_copies); - printflags(btrfs_qgroup_limit_flags, + prfl_btrfs(btrfs_qgroup_limit_flags, inherit->lim.flags, "BTRFS_QGROUP_LIMIT_???"); printf(", max_rfer=%" PRI__u64 ", max_excl=%" PRI__u64 ", rsv_rfer=%" PRI__u64 ", rsv_excl=%" PRI__u64 - "}, qgroups=", + "}, ", inherit->lim.max_rfer, inherit->lim.max_excl, inherit->lim.rsv_rfer, inherit->lim.rsv_excl); if (verbose) { unsigned int i; - printf("["); + printf("qgroups=["); for (i = 0; i < inherit->num_qgroups; i++) { if (i > 0) printf(", "); @@ -255,7 +349,7 @@ static void btrfs_print_vol_args_v2(struct btrfs_ioctl_vol_args_v2 *args, int print_qgroups) { printf("{fd=%d, flags=", (int) args->fd); - printflags(btrfs_snap_flags_v2, args->flags, "BTRFS_SUBVOL_???"); + prfl_btrfs(btrfs_snap_flags_v2, args->flags, "BTRFS_SUBVOL_???"); if (args->flags & BTRFS_SUBVOL_QGROUP_INHERIT) { printf(", size=%" PRI__u64 ", qgroup_inherit=", args->size); @@ -303,61 +397,64 @@ btrfs_test_subvol_ioctls(void) strcpy(vol_args.name, subvol_name); ioctl(-1, BTRFS_IOC_SNAP_CREATE, NULL); - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SNAP_CREATE)); ioctl(-1, BTRFS_IOC_SNAP_CREATE, &vol_args); - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE, " - "{fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + printf("ioctl(-1, %s, {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SNAP_CREATE), vol_args.name); ioctl(-1, BTRFS_IOC_SUBVOL_CREATE, &vol_args); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE, " - "{fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + printf("ioctl(-1, %s, {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SUBVOL_CREATE), vol_args.name); ioctl(-1, BTRFS_IOC_SNAP_DESTROY, &vol_args); - printf("ioctl(-1, BTRFS_IOC_SNAP_DESTROY," - " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + printf("ioctl(-1, %s, {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SNAP_DESTROY), vol_args.name); strncpy(vol_args.name, long_subvol_name, BTRFS_PATH_NAME_MAX); ioctl(-1, BTRFS_IOC_SNAP_CREATE, &vol_args); - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE," - " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + printf("ioctl(-1, %s, {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SNAP_CREATE), vol_args.name); ioctl(-1, BTRFS_IOC_SUBVOL_CREATE, &vol_args); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE," - " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + printf("ioctl(-1, %s, {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SUBVOL_CREATE), vol_args.name); ioctl(-1, BTRFS_IOC_SNAP_DESTROY, &vol_args); - printf("ioctl(-1, BTRFS_IOC_SNAP_DESTROY," - " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + printf("ioctl(-1, %s, {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SNAP_DESTROY), vol_args.name); long_subvol_name = realloc(long_subvol_name, BTRFS_SUBVOL_NAME_MAX); if (!long_subvol_name) perror_msg_and_fail("realloc failed"); ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, NULL); - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SNAP_CREATE_V2)); ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, NULL); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SUBVOL_CREATE_V2)); strcpy(vol_args_v2.name, subvol_name); - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SNAP_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 1); ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SUBVOL_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 1); ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); strncpy(vol_args_v2.name, long_subvol_name, BTRFS_SUBVOL_NAME_MAX); - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SNAP_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 1); ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SUBVOL_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 1); ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); @@ -365,12 +462,12 @@ btrfs_test_subvol_ioctls(void) strcpy(vol_args_v2.name, subvol_name); vol_args_v2.qgroup_inherit = bad_pointer; - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SNAP_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 0); ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SUBVOL_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 0); ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); @@ -395,31 +492,33 @@ btrfs_test_subvol_ioctls(void) inherit->lim.rsv_excl = u64val; vol_args_v2.qgroup_inherit = inherit; - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SNAP_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 1); ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SUBVOL_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 1); ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, NULL); - printf("ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_DEFAULT_SUBVOL)); ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, &u64val); - printf("ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, [%" - PRIu64 "]) = -1 EBADF (%m)\n", u64val); + printf("ioctl(-1, %s, [%" PRIu64 "]) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_DEFAULT_SUBVOL), u64val); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_SETFLAGS, "); - printflags(btrfs_snap_flags_v2, vol_args_v2.flags, + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SUBVOL_SETFLAGS)); + prfl_btrfs(btrfs_snap_flags_v2, vol_args_v2.flags, "BTRFS_SUBVOL_???"); ioctl(-1, BTRFS_IOC_SUBVOL_SETFLAGS, &vol_args_v2.flags); printf(") = -1 EBADF (%m)\n"); if (write_ok) { struct btrfs_ioctl_vol_args_v2 args_passed; + long ret; /* * Returns transid if flags & BTRFS_SUBVOL_CREATE_ASYNC * - BTRFS_IOC_SNAP_CREATE_V2 @@ -433,12 +532,15 @@ btrfs_test_subvol_ioctls(void) vol_args_v2.size = 0; vol_args_v2.qgroup_inherit = NULL; args_passed = vol_args_v2; - printf("ioctl(%d, BTRFS_IOC_SUBVOL_CREATE_V2, ", - btrfs_test_dir_fd); + printf("ioctl(%d, %s, ", + btrfs_test_dir_fd, ioc(BTRFS_IOC_SUBVOL_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 1); - ioctl(btrfs_test_dir_fd, BTRFS_IOC_SUBVOL_CREATE_V2, + ret = ioctl(btrfs_test_dir_fd, BTRFS_IOC_SUBVOL_CREATE_V2, &args_passed); - printf(" => {transid=%" PRI__u64"}) = 0\n", + if (ret < 0) + perror_msg_and_fail("ioctl(BTRFS_IOC_SUBVOL_CREATE_V2) " + "failed"); + printf(" => {transid=%" PRI__u64 "}) = 0\n", args_passed.transid); subvolfd = openat(btrfs_test_dir_fd, subvol_name, @@ -449,27 +551,27 @@ btrfs_test_subvol_ioctls(void) strncpy(vol_args_v2.name, long_subvol_name, BTRFS_NAME_LEN); vol_args_v2.fd = subvolfd; args_passed = vol_args_v2; - printf("ioctl(%d, BTRFS_IOC_SNAP_CREATE_V2, ", - btrfs_test_dir_fd); + printf("ioctl(%d, %s, ", + btrfs_test_dir_fd, ioc(BTRFS_IOC_SNAP_CREATE_V2)); btrfs_print_vol_args_v2(&args_passed, 1); ioctl(btrfs_test_dir_fd, BTRFS_IOC_SNAP_CREATE_V2, &args_passed); - printf(" => {transid=%" PRI__u64"}) = 0\n", + printf(" => {transid=%" PRI__u64 "}) = 0\n", args_passed.transid); /* This only works when mounted w/ -ouser_subvol_rm_allowed */ strncpy(vol_args.name, long_subvol_name, 255); vol_args.name[255] = 0; ioctl(btrfs_test_dir_fd, BTRFS_IOC_SNAP_DESTROY, &vol_args); - printf("ioctl(%d, BTRFS_IOC_SNAP_DESTROY, " - "{fd=%d, name=\"%.*s\"}) = 0\n", - btrfs_test_dir_fd, (int) vol_args.fd, 255, long_subvol_name); + printf("ioctl(%d, %s, {fd=%d, name=\"%.*s\"}) = 0\n", + btrfs_test_dir_fd, ioc(BTRFS_IOC_SNAP_DESTROY), + (int) vol_args.fd, 255, long_subvol_name); strcpy(vol_args.name, subvol_name); ioctl(btrfs_test_dir_fd, BTRFS_IOC_SNAP_DESTROY, &vol_args); - printf("ioctl(%d, BTRFS_IOC_SNAP_DESTROY, " - "{fd=%d, name=\"%s\"}) = 0\n", - btrfs_test_dir_fd, (int) vol_args.fd, subvol_name); + printf("ioctl(%d, %s, {fd=%d, name=\"%s\"}) = 0\n", + btrfs_test_dir_fd, ioc(BTRFS_IOC_SNAP_DESTROY), + (int) vol_args.fd, subvol_name); close(subvolfd); } @@ -480,19 +582,17 @@ static void btrfs_print_balance_args(struct btrfs_balance_args *args) { printf("{profiles="); - printflags(btrfs_space_info_flags, args->profiles, + prfl_btrfs(btrfs_space_info_flags, args->profiles, "BTRFS_BLOCK_GROUP_???"); - printf(", usage=%"PRI__u64 "%s, devid=%"PRI__u64 "%s, pstart=%"PRI__u64 - "%s, pend=%"PRI__u64 "%s, vstart=%"PRI__u64 "%s, vend=%"PRI__u64 - "%s, target=%"PRI__u64 "%s, flags=", - args->usage, maybe_print_uint64max(args->usage), - args->devid, maybe_print_uint64max(args->devid), - args->pstart, maybe_print_uint64max(args->pstart), - args->pend, maybe_print_uint64max(args->pend), - args->vstart, maybe_print_uint64max(args->vstart), - args->vend, maybe_print_uint64max(args->vend), - args->target, maybe_print_uint64max(args->target)); - printflags(btrfs_balance_args, args->flags, "BTRFS_BALANCE_ARGS_???"); + print_uint64(", usage=", args->usage); + printf(", devid=%s", sprint_makedev(args->devid)); + print_uint64(", pstart=", args->pstart); + print_uint64(", pend=", args->pend); + print_uint64(", vstart=", args->vstart); + print_uint64(", vend=", args->vend); + print_uint64(", target=", args->target); + printf(", flags="); + prfl_btrfs(btrfs_balance_args, args->flags, "BTRFS_BALANCE_ARGS_???"); printf("}"); } @@ -532,25 +632,31 @@ btrfs_test_balance_ioctls(void) struct btrfs_ioctl_vol_args vol_args = {}; ioctl(-1, BTRFS_IOC_BALANCE_CTL, 1); - printf("ioctl(-1, BTRFS_IOC_BALANCE_CTL, " - "BTRFS_BALANCE_CTL_PAUSE) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, %sBTRFS_BALANCE_CTL_PAUSE%s) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_BALANCE_CTL), + verbose_xlat ? "0x1 /* " : "", + verbose_xlat ? " */" : ""); ioctl(-1, BTRFS_IOC_BALANCE_CTL, 2); - printf("ioctl(-1, BTRFS_IOC_BALANCE_CTL, " - "BTRFS_BALANCE_CTL_CANCEL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, " + "%sBTRFS_BALANCE_CTL_CANCEL%s) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_BALANCE_CTL), + verbose_xlat ? "0x2 /* " : "", + verbose_xlat ? " */" : ""); ioctl(-1, BTRFS_IOC_BALANCE, NULL); - printf("ioctl(-1, BTRFS_IOC_BALANCE) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_BALANCE)); ioctl(-1, BTRFS_IOC_BALANCE, &vol_args); - printf("ioctl(-1, BTRFS_IOC_BALANCE) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_BALANCE)); /* struct btrfs_ioctl_balance_args */ ioctl(-1, BTRFS_IOC_BALANCE_V2, NULL); - printf("ioctl(-1, BTRFS_IOC_BALANCE_V2, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_BALANCE_V2)); - printf("ioctl(-1, BTRFS_IOC_BALANCE_V2, {flags="); - printflags(btrfs_balance_flags, args.flags, "BTRFS_BALANCE_???"); + printf("ioctl(-1, %s, {flags=", ioc(BTRFS_IOC_BALANCE_V2)); + prfl_btrfs(btrfs_balance_flags, args.flags, "BTRFS_BALANCE_???"); printf(", data="); btrfs_print_balance_args(&args.data); printf(", meta="); @@ -561,6 +667,8 @@ btrfs_test_balance_ioctls(void) printf("}) = -1 EBADF (%m)\n"); if (write_ok) { + long ret; + args.flags = BTRFS_BALANCE_DATA | BTRFS_BALANCE_METADATA | BTRFS_BALANCE_SYSTEM; args.data.flags = 0; @@ -569,31 +677,43 @@ btrfs_test_balance_ioctls(void) args.meta.profiles = 0; args.sys.flags = 0; args.sys.profiles = 0; - printf("ioctl(%d, BTRFS_IOC_BALANCE_V2, {flags=", - btrfs_test_dir_fd); - printflags(btrfs_balance_flags, args.flags, - "BTRFS_BALANCE_???"); - printf(", data="); - btrfs_print_balance_args(&args.data); - printf(", meta="); - btrfs_print_balance_args(&args.meta); - printf(", sys="); - btrfs_print_balance_args(&args.sys); - ioctl(btrfs_test_dir_fd, BTRFS_IOC_BALANCE_V2, &args); - printf("} => {flags="); - printflags(btrfs_balance_flags, args.flags, + /* + * We should keep args the same for data in meta in case + * volume-under-tests uses mixed groups data and metadata. + */ + args.meta.pend = -1ULL; + args.meta.vend = -1ULL; + + printf("ioctl(%d, %s, {flags=", + btrfs_test_dir_fd, ioc(BTRFS_IOC_BALANCE_V2)); + + prfl_btrfs(btrfs_balance_flags, args.flags, "BTRFS_BALANCE_???"); - printf(", state="); - printflags(btrfs_balance_state, args.state, - "BTRFS_BALANCE_STATE_???"); printf(", data="); btrfs_print_balance_args(&args.data); printf(", meta="); btrfs_print_balance_args(&args.meta); printf(", sys="); btrfs_print_balance_args(&args.sys); - printf("}) = 0\n"); + ret = ioctl(btrfs_test_dir_fd, BTRFS_IOC_BALANCE_V2, &args); + if (ret < 0) { + printf("}) = %s\n", sprintrc(ret)); + } else { + printf("} => {flags="); + prfl_btrfs(btrfs_balance_flags, args.flags, + "BTRFS_BALANCE_???"); + printf(", state="); + prfl_btrfs(btrfs_balance_state, args.state, + "BTRFS_BALANCE_STATE_???"); + printf(", data="); + btrfs_print_balance_args(&args.data); + printf(", meta="); + btrfs_print_balance_args(&args.meta); + printf(", sys="); + btrfs_print_balance_args(&args.sys); + printf("}) = %ld\n", ret); + } } } @@ -616,38 +736,46 @@ btrfs_test_device_ioctls(void) }; ioctl(-1, BTRFS_IOC_RESIZE, NULL); - printf("ioctl(-1, BTRFS_IOC_RESIZE, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_RESIZE)); strcpy(args.name, devid); ioctl(-1, BTRFS_IOC_RESIZE, &args); - printf("ioctl(-1, BTRFS_IOC_RESIZE, " - "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", - (int) args.fd, args.name); + printf("ioctl(-1, %s, {fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_RESIZE), (int) args.fd, args.name); ioctl(-1, BTRFS_IOC_SCAN_DEV, NULL); - printf("ioctl(-1, BTRFS_IOC_SCAN_DEV, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SCAN_DEV)); strcpy(args.name, devname); ioctl(-1, BTRFS_IOC_SCAN_DEV, &args); - printf("ioctl(-1, BTRFS_IOC_SCAN_DEV, " - "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", - (int) args.fd, args.name); + printf("ioctl(-1, %s, {fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SCAN_DEV), (int) args.fd, args.name); + +# ifdef BTRFS_IOC_FORGET_DEV + ioctl(-1, BTRFS_IOC_FORGET_DEV, NULL); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_FORGET_DEV)); + + strcpy(args.name, devname); + ioctl(-1, BTRFS_IOC_FORGET_DEV, &args); + printf("ioctl(-1, %s, {fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_FORGET_DEV), (int) args.fd, args.name); +# endif ioctl(-1, BTRFS_IOC_ADD_DEV, NULL); - printf("ioctl(-1, BTRFS_IOC_ADD_DEV, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_ADD_DEV)); ioctl(-1, BTRFS_IOC_ADD_DEV, &args); - printf("ioctl(-1, BTRFS_IOC_ADD_DEV, " - "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", - (int) args.fd, args.name); + printf("ioctl(-1, %s, {fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_ADD_DEV), (int) args.fd, args.name); ioctl(-1, BTRFS_IOC_RM_DEV, NULL); - printf("ioctl(-1, BTRFS_IOC_RM_DEV, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_RM_DEV)); ioctl(-1, BTRFS_IOC_RM_DEV, &args); - printf("ioctl(-1, BTRFS_IOC_RM_DEV, " - "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", - (int) args.fd, args.name); + printf("ioctl(-1, %s, {fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_RM_DEV), (int) args.fd, args.name); } @@ -668,35 +796,40 @@ btrfs_test_clone_ioctls(void) }; ioctl(-1, BTRFS_IOC_CLONE, clone_fd); - printf("ioctl(-1, BTRFS_IOC_CLONE or FICLONE, %x) = -1 EBADF (%m)\n", - clone_fd); + printf("ioctl(-1, %s, %x) = -1 EBADF (%m)\n", + sprint_xlat_(BTRFS_IOC_CLONE, "BTRFS_IOC_CLONE or FICLONE"), + clone_fd); ioctl(-1, BTRFS_IOC_CLONE_RANGE, NULL); - printf("ioctl(-1, BTRFS_IOC_CLONE_RANGE or FICLONERANGE, " - "NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + sprint_xlat_(BTRFS_IOC_CLONE_RANGE, + "BTRFS_IOC_CLONE_RANGE or FICLONERANGE")); ioctl(-1, BTRFS_IOC_CLONE_RANGE, &args); - printf("ioctl(-1, BTRFS_IOC_CLONE_RANGE or FICLONERANGE, " + printf("ioctl(-1, %s, " "{src_fd=%d, src_offset=%" PRI__u64 ", src_length=%" PRI__u64 ", dest_offset=%" PRI__u64 "}) = -1 EBADF (%m)\n", + sprint_xlat_(BTRFS_IOC_CLONE_RANGE, + "BTRFS_IOC_CLONE_RANGE or FICLONERANGE"), (int) args.src_fd, args.src_offset, args.src_length, args.dest_offset); } -#define BTRFS_COMPRESS_TYPES 2 -#define BTRFS_INVALID_COMPRESS (BTRFS_COMPRESS_TYPES + 1) +# define BTRFS_COMPRESS_TYPES 2 +# define BTRFS_INVALID_COMPRESS (BTRFS_COMPRESS_TYPES + 1) static void -btrfs_print_defrag_range_args(struct btrfs_ioctl_defrag_range_args *args) +btrfs_print_defrag_range_args(struct btrfs_ioctl_defrag_range_args *args, + bool compress_type_known) { - printf("{start=%" PRIu64", len=%" PRIu64 "%s, flags=", - (uint64_t) args->start, (uint64_t) args->len, - maybe_print_uint64max(args->len)); + printf("{start=%" PRIu64, (uint64_t) args->start); + print_uint64(", len=", args->len); - printflags(btrfs_defrag_flags, args->flags, "BTRFS_DEFRAG_RANGE_???"); + printf(", flags="); + prfl_btrfs(btrfs_defrag_flags, args->flags, "BTRFS_DEFRAG_RANGE_???"); printf(", extent_thresh=%u, compress_type=", args->extent_thresh); - printxval(btrfs_compress_types, args->compress_type, - "BTRFS_COMPRESS_???"); + prxval_btrfs(btrfs_compress_types, args->compress_type, + "BTRFS_COMPRESS_???", compress_type_known); printf("}"); } @@ -722,29 +855,30 @@ btrfs_test_defrag_ioctls(void) * actually consume it. */ ioctl(-1, BTRFS_IOC_DEFRAG, NULL); - printf("ioctl(-1, BTRFS_IOC_DEFRAG) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_DEFRAG)); ioctl(-1, BTRFS_IOC_DEFRAG, &vol_args); - printf("ioctl(-1, BTRFS_IOC_DEFRAG) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_DEFRAG)); /* struct btrfs_ioctl_defrag_range_args */ ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, NULL); - printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_DEFRAG_RANGE)); - printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, "); - btrfs_print_defrag_range_args(&args); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_DEFRAG_RANGE)); + btrfs_print_defrag_range_args(&args, true); ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, &args); printf(") = -1 EBADF (%m)\n"); args.compress_type = BTRFS_INVALID_COMPRESS; - printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, "); - btrfs_print_defrag_range_args(&args); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_DEFRAG_RANGE)); + btrfs_print_defrag_range_args(&args, false); ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, &args); printf(") = -1 EBADF (%m)\n"); args.len--; - printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, "); - btrfs_print_defrag_range_args(&args); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_DEFRAG_RANGE)); + btrfs_print_defrag_range_args(&args, false); ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, &args); printf(") = -1 EBADF (%m)\n"); } @@ -762,18 +896,28 @@ static void btrfs_print_objectid(uint64_t objectid) { const char *str = xlookup(btrfs_tree_objectids, objectid); - printf("%" PRIu64, objectid); - if (str) - printf(" /* %s */", str); + if (str) { + if (verbose_xlat) + printf("%" PRIu64 " /* %s */", objectid, str); + else + printf("%s", str); + } else { + printf("%" PRIu64, objectid); + } } static void btrfs_print_key_type(uint32_t type) { const char *str = xlookup(btrfs_key_types, type); - printf("%u", type); - if (str) - printf(" /* %s */", str); + if (str) { + if (verbose_xlat) + printf("%u /* %s */", type, str); + else + printf("%s", str); + } else { + printf("%u", type); + } } static void @@ -789,18 +933,10 @@ btrfs_print_search_key(struct btrfs_ioctl_search_key *key) printf(", max_objectid="); btrfs_print_objectid(key->max_objectid); } - if (key->min_offset) - printf(", min_offset=%" PRI__u64 "%s", - key->min_offset, maybe_print_uint64max(key->min_offset)); - if (key->max_offset) - printf(", max_offset=%" PRI__u64 "%s", - key->max_offset, maybe_print_uint64max(key->max_offset)); - if (key->min_transid) - printf(", min_transid=%" PRI__u64"%s", key->min_transid, - maybe_print_uint64max(key->min_transid)); - if (key->max_transid) - printf(", max_transid=%" PRI__u64"%s", key->max_transid, - maybe_print_uint64max(key->max_transid)); + print_uint64(", min_offset=", key->min_offset); + print_uint64(", max_offset=", key->max_offset); + print_uint64(", min_transid=", key->min_transid); + print_uint64(", max_transid=", key->max_transid); printf(", min_type="); btrfs_print_key_type(key->min_type); printf(", max_type="); @@ -815,7 +951,7 @@ btrfs_print_tree_search_buf(struct btrfs_ioctl_search_key *key, if (verbose) { uint64_t i; uint64_t off = 0; - printf("["); + printf("buf=["); for (i = 0; i < key->nr_items; i++) { struct btrfs_ioctl_search_header *sh; sh = (typeof(sh))(buf + off); @@ -860,19 +996,21 @@ btrfs_test_search_ioctls(void) }; ioctl(-1, BTRFS_IOC_TREE_SEARCH, NULL); - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_TREE_SEARCH)); ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, NULL); - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_TREE_SEARCH_V2)); search_args.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH)); btrfs_print_search_key(&search_args.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); printf("}) = -1 EBADF (%m)\n"); search_args_v2.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH_V2)); btrfs_print_search_key(&search_args_v2.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", @@ -881,13 +1019,13 @@ btrfs_test_search_ioctls(void) key_reference.min_objectid = 6; key_reference.max_objectid = 7; search_args.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH)); btrfs_print_search_key(&search_args.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); printf("}) = -1 EBADF (%m)\n"); search_args_v2.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH_V2)); btrfs_print_search_key(&search_args_v2.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", @@ -896,13 +1034,13 @@ btrfs_test_search_ioctls(void) key_reference.min_offset++; key_reference.max_offset--; search_args.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH)); btrfs_print_search_key(&search_args.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); printf("}) = -1 EBADF (%m)\n"); search_args_v2.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH_V2)); btrfs_print_search_key(&search_args_v2.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", @@ -911,13 +1049,13 @@ btrfs_test_search_ioctls(void) key_reference.min_transid++; key_reference.max_transid--; search_args.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH)); btrfs_print_search_key(&search_args.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); printf("}) = -1 EBADF (%m)\n"); search_args_v2.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH_V2)); btrfs_print_search_key(&search_args_v2.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", @@ -926,13 +1064,13 @@ btrfs_test_search_ioctls(void) key_reference.min_type = 1; key_reference.max_type = 12; search_args.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH)); btrfs_print_search_key(&search_args.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); printf("}) = -1 EBADF (%m)\n"); search_args_v2.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH_V2)); btrfs_print_search_key(&search_args_v2.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", @@ -951,11 +1089,11 @@ btrfs_test_search_ioctls(void) key_reference.max_offset = -1ULL; search_args.key = key_reference; - printf("ioctl(%d, BTRFS_IOC_TREE_SEARCH, {", - btrfs_test_dir_fd); + printf("ioctl(%d, %s, {", + btrfs_test_dir_fd, ioc(BTRFS_IOC_TREE_SEARCH)); btrfs_print_search_key(&search_args.key); ioctl(btrfs_test_dir_fd, BTRFS_IOC_TREE_SEARCH, &search_args); - printf("} => {key={nr_items=%u}, buf=", + printf("} => {key={nr_items=%u}, ", search_args.key.nr_items); btrfs_print_tree_search_buf(&search_args.key, search_args.buf, sizeof(search_args.buf)); @@ -967,12 +1105,12 @@ btrfs_test_search_ioctls(void) args->key = key_reference; args->buf_size = bufsize; - printf("ioctl(%d, BTRFS_IOC_TREE_SEARCH_V2, {", - btrfs_test_dir_fd); + printf("ioctl(%d, %s, {", + btrfs_test_dir_fd, ioc(BTRFS_IOC_TREE_SEARCH_V2)); btrfs_print_search_key(&key_reference); printf(", buf_size=%" PRIu64 "}", (uint64_t) args->buf_size); ioctl(btrfs_test_dir_fd, BTRFS_IOC_TREE_SEARCH_V2, args); - printf(" => {key={nr_items=%u}, buf_size=%" PRIu64 ", buf=", + printf(" => {key={nr_items=%u}, buf_size=%" PRIu64 ", ", args->key.nr_items, (uint64_t)args->buf_size); btrfs_print_tree_search_buf(&args->key, args->buf, args->buf_size); @@ -980,8 +1118,8 @@ btrfs_test_search_ioctls(void) args->key = key_reference; args->buf_size = sizeof(struct btrfs_ioctl_search_header); - printf("ioctl(%d, BTRFS_IOC_TREE_SEARCH_V2, {", - btrfs_test_dir_fd); + printf("ioctl(%d, %s, {", + btrfs_test_dir_fd, ioc(BTRFS_IOC_TREE_SEARCH_V2)); btrfs_print_search_key(&args->key); printf(", buf_size=%" PRIu64 "}", (uint64_t)args->buf_size); ioctl(btrfs_test_dir_fd, BTRFS_IOC_TREE_SEARCH_V2, args); @@ -1004,9 +1142,10 @@ btrfs_test_ino_lookup_ioctl(void) }; ioctl(-1, BTRFS_IOC_INO_LOOKUP, NULL); - printf("ioctl(-1, BTRFS_IOC_INO_LOOKUP, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_INO_LOOKUP)); - printf("ioctl(-1, BTRFS_IOC_INO_LOOKUP, {treeid="); + printf("ioctl(-1, %s, {treeid=", ioc(BTRFS_IOC_INO_LOOKUP)); btrfs_print_objectid(args.treeid); printf(", objectid="); btrfs_print_objectid(args.objectid); @@ -1014,8 +1153,8 @@ btrfs_test_ino_lookup_ioctl(void) printf("}) = -1 EBADF (%m)\n"); if (btrfs_test_root) { - printf("ioctl(%d, BTRFS_IOC_INO_LOOKUP, {treeid=", - btrfs_test_dir_fd); + printf("ioctl(%d, %s, {treeid=", + btrfs_test_dir_fd, ioc(BTRFS_IOC_INO_LOOKUP)); btrfs_print_objectid(args.treeid); printf(", objectid="); btrfs_print_objectid(args.objectid); @@ -1034,20 +1173,20 @@ btrfs_test_space_info_ioctl(void) struct btrfs_ioctl_space_args args = {}; ioctl(-1, BTRFS_IOC_SPACE_INFO, NULL); - printf("ioctl(-1, BTRFS_IOC_SPACE_INFO, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SPACE_INFO)); ioctl(-1, BTRFS_IOC_SPACE_INFO, &args); - printf("ioctl(-1, BTRFS_IOC_SPACE_INFO, " - "{space_slots=%" PRI__u64 "}) = -1 EBADF (%m)\n", - args.space_slots); + printf("ioctl(-1, %s, {space_slots=%" PRI__u64 "}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SPACE_INFO), args.space_slots); if (btrfs_test_root) { struct btrfs_ioctl_space_args args_passed; struct btrfs_ioctl_space_args *argsp; args_passed = args; - printf("ioctl(%d, BTRFS_IOC_SPACE_INFO, " - "{space_slots=%" PRI__u64 "}", - btrfs_test_dir_fd, args_passed.space_slots); + printf("ioctl(%d, %s, {space_slots=%" PRI__u64 "}", + btrfs_test_dir_fd, ioc(BTRFS_IOC_SPACE_INFO), + args_passed.space_slots); ioctl(btrfs_test_dir_fd, BTRFS_IOC_SPACE_INFO, &args_passed); printf(" => {total_spaces=%" PRI__u64 "}) = 0\n", args_passed.total_spaces); @@ -1059,22 +1198,22 @@ btrfs_test_space_info_ioctl(void) *argsp = args; argsp->space_slots = args_passed.total_spaces; - printf("ioctl(%d, BTRFS_IOC_SPACE_INFO, " - "{space_slots=%" PRI__u64 "}", - btrfs_test_dir_fd, argsp->space_slots); + printf("ioctl(%d, %s, {space_slots=%" PRI__u64 "}", + btrfs_test_dir_fd, ioc(BTRFS_IOC_SPACE_INFO), + argsp->space_slots); ioctl(btrfs_test_dir_fd, BTRFS_IOC_SPACE_INFO, argsp); - printf(" => {total_spaces=%" PRI__u64 ", spaces=", + printf(" => {total_spaces=%" PRI__u64 ", ", argsp->total_spaces); if (verbose) { unsigned int i; - printf("["); + printf("spaces=["); for (i = 0; i < argsp->total_spaces; i++) { struct btrfs_ioctl_space_info *info; info = &argsp->spaces[i]; if (i) printf(", "); printf("{flags="); - printflags(btrfs_space_info_flags, info->flags, + prfl_btrfs(btrfs_space_info_flags, info->flags, "BTRFS_SPACE_INFO_???"); printf(", total_bytes=%" PRI__u64 ", used_bytes=%" PRI__u64 "}", @@ -1107,25 +1246,28 @@ btrfs_test_scrub_ioctls(void) }; ioctl(-1, BTRFS_IOC_SCRUB, NULL); - printf("ioctl(-1, BTRFS_IOC_SCRUB, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_SCRUB)); ioctl(-1, BTRFS_IOC_SCRUB_CANCEL, NULL); - printf("ioctl(-1, BTRFS_IOC_SCRUB_CANCEL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_SCRUB_CANCEL)); - printf("ioctl(-1, BTRFS_IOC_SCRUB, {devid=%" PRI__u64 ", start=%" - PRI__u64 "%s, end=%" PRI__u64"%s, flags=", - args.devid, args.start, maybe_print_uint64max(args.start), - args.end, maybe_print_uint64max(args.end)); - printflags(btrfs_scrub_flags, args.flags, "BTRFS_SCRUB_???"); + printf("ioctl(-1, %s, {devid=%s", + ioc(BTRFS_IOC_SCRUB), sprint_makedev(args.devid)); + print_uint64(", start=", args.start); + print_uint64(", end=", args.end); + printf(", flags="); + prfl_btrfs(btrfs_scrub_flags, args.flags, "BTRFS_SCRUB_???"); ioctl(-1, BTRFS_IOC_SCRUB, &args); printf("}) = -1 EBADF (%m)\n"); ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, NULL); - printf("ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SCRUB_PROGRESS)); ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, &args); - printf("ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, " - "{devid=%" PRI__u64 "}) = -1 EBADF (%m)\n", args.devid); + printf("ioctl(-1, %s, {devid=%s}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SCRUB_PROGRESS), + sprint_makedev(args.devid)); } /* @@ -1141,12 +1283,14 @@ btrfs_test_dev_info_ioctl(void) memcpy(&args.uuid, uuid_reference, BTRFS_UUID_SIZE); ioctl(-1, BTRFS_IOC_DEV_INFO, NULL); - printf("ioctl(-1, BTRFS_IOC_DEV_INFO, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_DEV_INFO)); ioctl(-1, BTRFS_IOC_DEV_INFO, &args); - printf("ioctl(-1, BTRFS_IOC_DEV_INFO, " - "{devid=%" PRI__u64", uuid=%s}) = -1 EBADF (%m)\n", - args.devid, uuid_reference_string); + printf("ioctl(-1, %s, " + "{devid=%s, uuid=%s}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_DEV_INFO), sprint_makedev(args.devid), + uuid_reference_string); } /* @@ -1161,27 +1305,84 @@ btrfs_test_ino_path_ioctls(void) struct btrfs_ioctl_ino_path_args args = { .inum = 256, .size = sizeof(buf), - .fspath = (unsigned long)buf, + .reserved = { + 0xdeadc0defacefeebULL, + 0xdeadc0defacefeecULL, + 0xdeadc0defacefeedULL, + }, + .fspath = 0, }; +# ifdef HAVE_BTRFS_IOCTL_LOGICAL_INO_ARGS + args.flags = +# else + args.reserved[3] = +# endif + 0xdeadc0defacefeeeULL; + + ioctl(-1, BTRFS_IOC_INO_PATHS, NULL); - printf("ioctl(-1, BTRFS_IOC_INO_PATHS, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_INO_PATHS)); ioctl(-1, BTRFS_IOC_LOGICAL_INO, NULL); - printf("ioctl(-1, BTRFS_IOC_LOGICAL_INO, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_LOGICAL_INO)); ioctl(-1, BTRFS_IOC_INO_PATHS, &args); - printf("ioctl(-1, BTRFS_IOC_INO_PATHS, " - "{inum=%" PRI__u64", size=%" PRI__u64 + printf("ioctl(-1, %s, {inum=%" PRI__u64 ", size=%" PRI__u64 + ", fspath=NULL}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_INO_PATHS), args.inum, args.size); + + args.fspath = (uintptr_t) buf; + ioctl(-1, BTRFS_IOC_INO_PATHS, &args); + printf("ioctl(-1, %s, {inum=%" PRI__u64 ", size=%" PRI__u64 ", fspath=0x%" PRI__x64 "}) = -1 EBADF (%m)\n", - args.inum, args.size, args.fspath); + ioc(BTRFS_IOC_INO_PATHS), args.inum, args.size, args.fspath); + args.fspath = 0; ioctl(-1, BTRFS_IOC_LOGICAL_INO, &args); - printf("ioctl(-1, BTRFS_IOC_LOGICAL_INO, {logical=%" PRI__u64 - ", size=%" PRI__u64", inodes=0x%" PRI__x64 - "}) = -1 EBADF (%m)\n", args.inum, args.size, args.fspath); + printf("ioctl(-1, %s, {logical=%" PRI__u64 + ", size=%" PRI__u64 ", reserved=[0xdeadc0defacefeeb" + ", 0xdeadc0defacefeec, 0xdeadc0defacefeed]" + ", flags=0xdeadc0defacefeee /* BTRFS_LOGICAL_INO_ARGS_??? */" + ", inodes=NULL}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_LOGICAL_INO), args.inum, args.size); + + args.fspath = (uintptr_t) buf; + args.reserved[0] = 0; + args.reserved[2] = 0; +# ifdef HAVE_BTRFS_IOCTL_LOGICAL_INO_ARGS + args.flags = +# else + args.reserved[3] = +# endif + 1; -#ifdef HAVE_LINUX_FIEMAP_H + ioctl(-1, BTRFS_IOC_LOGICAL_INO, &args); + printf("ioctl(-1, %s, {logical=%" PRI__u64 + ", size=%" PRI__u64 ", reserved=[0, 0xdeadc0defacefeec, 0]" + ", flags=%sBTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET%s" + ", inodes=0x%" PRI__x64 "}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_LOGICAL_INO), args.inum, args.size, + verbose_xlat ? "0x1 /* " : "", verbose_xlat ? " */" : "", + args.fspath); + + args.reserved[1] = 0; +# ifdef HAVE_BTRFS_IOCTL_LOGICAL_INO_ARGS + args.flags = +# else + args.reserved[3] = +# endif + 0; + + ioctl(-1, BTRFS_IOC_LOGICAL_INO, &args); + printf("ioctl(-1, %s, {logical=%" PRI__u64 + ", size=%" PRI__u64 ", flags=0, inodes=0x%" PRI__x64 + "}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_LOGICAL_INO), args.inum, args.size, args.fspath); + +# ifdef HAVE_LINUX_FIEMAP_H if (btrfs_test_root) { int size; struct stat si; @@ -1195,17 +1396,16 @@ btrfs_test_ino_path_ioctls(void) perror_msg_and_fail("fstat failed"); args.inum = si.st_ino; - printf("ioctl(%d, BTRFS_IOC_INO_PATHS, " - "{inum=%" PRI__u64", size=%" PRI__u64 - ", fspath=0x%" PRI__x64"}", - btrfs_test_dir_fd, args.inum, args.size, - args.fspath); + printf("ioctl(%d, %s, {inum=%" PRI__u64 ", size=%" PRI__u64 + ", fspath=0x%" PRI__x64 "}", + btrfs_test_dir_fd, ioc(BTRFS_IOC_INO_PATHS), + args.inum, args.size, args.fspath); ioctl(btrfs_test_dir_fd, BTRFS_IOC_INO_PATHS, &args); - printf(" => {fspath={bytes_left=%u, bytes_missing=%u, elem_cnt=%u, elem_missed=%u, val=", + printf(" => {fspath={bytes_left=%u, bytes_missing=%u, elem_cnt=%u, elem_missed=%u, ", data->bytes_left, data->bytes_missing, data->elem_cnt, data->elem_missed); if (verbose) { - printf("[\"strace-test\"]"); + printf("val=[\"%s\"]", dir_name); } else printf("..."); printf("}}) = 0\n"); @@ -1227,7 +1427,7 @@ btrfs_test_ino_path_ioctls(void) */ fsync(fd); ioctl(fd, BTRFS_IOC_SYNC, NULL); - printf("ioctl(%d, BTRFS_IOC_SYNC) = 0\n", fd); + printf("ioctl(%d, %s) = 0\n", fd, ioc(BTRFS_IOC_SYNC)); size = sizeof(*fiemap) + 2 * sizeof(fiemap->fm_extents[0]); fiemap = malloc(size); @@ -1239,18 +1439,19 @@ btrfs_test_ino_path_ioctls(void) fiemap->fm_extent_count = 2; /* This is also a live test for FIEMAP */ - printf("ioctl(%d, FS_IOC_FIEMAP, {fm_start=%" PRI__u64 - ", fm_length=%" PRI__u64", fm_flags=", - fd, fiemap->fm_start, fiemap->fm_length); - printflags(fiemap_flags, fiemap->fm_flags, "FIEMAP_FLAG_???"); + printf("ioctl(%d, %s, {fm_start=%" PRI__u64 + ", fm_length=%" PRI__u64 ", fm_flags=", + fd, ioc(FS_IOC_FIEMAP), + fiemap->fm_start, fiemap->fm_length); + prfl_btrfs(fiemap_flags, fiemap->fm_flags, "FIEMAP_FLAG_???"); printf(", fm_extent_count=%u}", fiemap->fm_extent_count); ioctl(fd, FS_IOC_FIEMAP, fiemap); printf(" => {fm_flags="); - printflags(fiemap_flags, fiemap->fm_flags, "FIEMAP_FLAG_???"); - printf(", fm_mapped_extents=%u, fm_extents=", + prfl_btrfs(fiemap_flags, fiemap->fm_flags, "FIEMAP_FLAG_???"); + printf(", fm_mapped_extents=%u, ", fiemap->fm_mapped_extents); if (verbose) { - printf("["); + printf("fm_extents=["); unsigned int i; for (i = 0; i < fiemap->fm_mapped_extents; i++) { struct fiemap_extent *fe; @@ -1263,7 +1464,7 @@ btrfs_test_ino_path_ioctls(void) ", ", fe->fe_logical, fe->fe_physical, fe->fe_length); - printflags(fiemap_extent_flags, fe->fe_flags, + prfl_btrfs(fiemap_extent_flags, fe->fe_flags, "FIEMAP_EXTENT_???"); printf("}"); } @@ -1273,15 +1474,16 @@ btrfs_test_ino_path_ioctls(void) printf("}) = 0\n"); args.inum = fiemap->fm_extents[0].fe_physical; - printf("ioctl(%d, BTRFS_IOC_LOGICAL_INO, {logical=%" PRI__u64 - ", size=%" PRI__u64", inodes=0x%" PRI__x64"}", - fd, args.inum, args.size, args.fspath); + printf("ioctl(%d, %s, {logical=%" PRI__u64 + ", size=%" PRI__u64 ", flags=0, inodes=0x%" PRI__x64 "}", + fd, ioc(BTRFS_IOC_LOGICAL_INO), + args.inum, args.size, args.fspath); ioctl(fd, BTRFS_IOC_LOGICAL_INO, &args); - printf(" => {inodes={bytes_left=%u, bytes_missing=%u, elem_cnt=%u, elem_missed=%u, val=", + printf(" => {inodes={bytes_left=%u, bytes_missing=%u, elem_cnt=%u, elem_missed=%u, ", data->bytes_left, data->bytes_missing, data->elem_cnt, data->elem_missed); if (verbose) { - printf("[{inum=%llu, offset=0, root=5}]", + printf("val=[{inum=%llu, offset=0, root=5}]", (unsigned long long) si.st_ino); } else printf("..."); @@ -1289,7 +1491,7 @@ btrfs_test_ino_path_ioctls(void) close(fd); free(fiemap); } -#endif /* HAVE_LINUX_FIEMAP_H */ +# endif /* HAVE_LINUX_FIEMAP_H */ } /* @@ -1306,18 +1508,23 @@ btrfs_test_set_received_subvol_ioctl(void) .nsec = 12345, }, }; + int saved_errno; + memcpy(&args.uuid, uuid_reference, BTRFS_UUID_SIZE); ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, NULL); - printf("ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, " - "NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SET_RECEIVED_SUBVOL)); ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, &args); - printf("ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, " - "{uuid=%s, stransid=%" PRI__u64", stime=%" PRI__u64 - ".%u, flags=0}) = -1 EBADF (%m)\n", - uuid_reference_string, args.stransid, args.stime.sec, - args.stime.nsec); + saved_errno = errno; + printf("ioctl(-1, %s, {uuid=%s, stransid=%" PRI__u64 + ", stime={sec=%" PRI__u64 ", nsec=%u}", + ioc(BTRFS_IOC_SET_RECEIVED_SUBVOL), uuid_reference_string, + args.stransid, args.stime.sec, args.stime.nsec); + print_time_t_nsec(args.stime.sec, args.stime.nsec, true); + errno = saved_errno; + printf(", flags=0}) = -1 EBADF (%m)\n"); } /* @@ -1335,29 +1542,25 @@ btrfs_test_send_ioctl(void) }; ioctl(-1, BTRFS_IOC_SEND, NULL); - printf("ioctl(-1, BTRFS_IOC_SEND, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_SEND)); - printf("ioctl(-1, BTRFS_IOC_SEND, " - "{send_fd=%d, clone_sources_count=%" PRI__u64 - ", clone_sources=", + printf("ioctl(-1, %s, {send_fd=%d, clone_sources_count=%" PRI__u64 + ", clone_sources=NULL", + ioc(BTRFS_IOC_SEND), (int) args.send_fd, args.clone_sources_count); - if (verbose) - printf("NULL"); - else - printf("..."); printf(", parent_root="); btrfs_print_objectid(args.parent_root); printf(", flags="); - printflags(btrfs_send_flags, args.flags, "BTRFS_SEND_FLAGS_???"); + prfl_btrfs(btrfs_send_flags, args.flags, "BTRFS_SEND_FLAGS_???"); ioctl(-1, BTRFS_IOC_SEND, &args); printf("}) = -1 EBADF (%m)\n"); args.clone_sources_count = 2; args.clone_sources = (__u64 *) (void *) u64_array; - printf("ioctl(-1, BTRFS_IOC_SEND, " - "{send_fd=%d, clone_sources_count=%" PRI__u64 + printf("ioctl(-1, %s, {send_fd=%d, clone_sources_count=%" PRI__u64 ", clone_sources=", + ioc(BTRFS_IOC_SEND), (int) args.send_fd, args.clone_sources_count); if (verbose) { printf("["); @@ -1366,11 +1569,11 @@ btrfs_test_send_ioctl(void) btrfs_print_objectid(u64_array[1]); printf("]"); } else - printf("..."); + printf("%p", args.clone_sources); printf(", parent_root="); btrfs_print_objectid(args.parent_root); printf(", flags="); - printflags(btrfs_send_flags, args.flags, "BTRFS_SEND_FLAGS_???"); + prfl_btrfs(btrfs_send_flags, args.flags, "BTRFS_SEND_FLAGS_???"); ioctl(-1, BTRFS_IOC_SEND, &args); printf("}) = -1 EBADF (%m)\n"); } @@ -1387,26 +1590,37 @@ btrfs_test_quota_ctl_ioctl(void) }; ioctl(-1, BTRFS_IOC_QUOTA_CTL, NULL); - printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_CTL)); ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); - printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " - "BTRFS_QUOTA_CTL_ENABLE}) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, {cmd=%sBTRFS_QUOTA_CTL_ENABLE%s}) " + "= -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_CTL), + verbose_xlat ? "0x1 /* " : "", + verbose_xlat ? " */" : ""); args.cmd = 2; ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); - printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " - "BTRFS_QUOTA_CTL_DISABLE}) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, {cmd=%sBTRFS_QUOTA_CTL_DISABLE%s}) " + "= -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_CTL), + verbose_xlat ? "0x2 /* " : "", + verbose_xlat ? " */" : ""); args.cmd = 3; ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); - printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " - "BTRFS_QUOTA_CTL_RESCAN__NOTUSED}) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, " + "{cmd=%sBTRFS_QUOTA_CTL_RESCAN__NOTUSED%s}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_CTL), + verbose_xlat ? "0x3 /* " : "", + verbose_xlat ? " */" : ""); args.cmd = 4; ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); - printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " - "0x4 /* BTRFS_QUOTA_CTL_??? */}) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, " + "{cmd=0x4 /* BTRFS_QUOTA_CTL_??? */}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_CTL)); } /* @@ -1423,12 +1637,14 @@ btrfs_test_qgroup_assign_ioctl(void) }; ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, NULL); - printf("ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QGROUP_ASSIGN)); ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, &args); - printf("ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, " - "{assign=%" PRI__u64", src=%" PRI__u64", dst=%" PRI__u64 - "}) = -1 EBADF (%m)\n", args.assign, args.src, args.dst); + printf("ioctl(-1, %s, " + "{assign=%" PRI__u64 ", src=%" PRI__u64 ", dst=%" PRI__u64 + "}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QGROUP_ASSIGN), args.assign, args.src, args.dst); } /* @@ -1444,12 +1660,13 @@ btrfs_test_qgroup_create_ioctl(void) }; ioctl(-1, BTRFS_IOC_QGROUP_CREATE, NULL); - printf("ioctl(-1, BTRFS_IOC_QGROUP_CREATE, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_QGROUP_CREATE)); ioctl(-1, BTRFS_IOC_QGROUP_CREATE, &args); - printf("ioctl(-1, BTRFS_IOC_QGROUP_CREATE, " - "{create=%" PRI__u64", qgroupid=%" PRI__u64 - "}) = -1 EBADF (%m)\n", args.create, args.qgroupid); + printf("ioctl(-1, %s, " + "{create=%" PRI__u64 ", qgroupid=%" PRI__u64 + "}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QGROUP_CREATE), args.create, args.qgroupid); } /* @@ -1466,43 +1683,46 @@ btrfs_test_quota_rescan_ioctl(void) }; ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, NULL); - printf("ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_RESCAN)); ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, &args); - printf("ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, " - "{flags=0}) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, {flags=0}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_RESCAN)); ioctl(-1, BTRFS_IOC_QUOTA_RESCAN_WAIT, NULL); - printf("ioctl(-1, BTRFS_IOC_QUOTA_RESCAN_WAIT) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_RESCAN_WAIT)); } /* * Consumes argument, returns nothing: - * - BTRFS_IOC_SET_FSLABEL + * - FS_IOC_SETFSLABEL * * Consumes no argument, returns argument: - * - BTRFS_IOC_GET_FS_LABEL + * - FS_IOC_GETFSLABEL */ static void btrfs_test_label_ioctls(void) { char label[BTRFS_LABEL_SIZE] = "btrfs-label"; - ioctl(-1, BTRFS_IOC_SET_FSLABEL, NULL); - printf("ioctl(-1, BTRFS_IOC_SET_FSLABEL, NULL) = -1 EBADF (%m)\n"); + ioctl(-1, FS_IOC_SETFSLABEL, NULL); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(FS_IOC_SETFSLABEL)); - ioctl(-1, BTRFS_IOC_SET_FSLABEL, label); - printf("ioctl(-1, BTRFS_IOC_SET_FSLABEL, \"%s\") = -1 EBADF (%m)\n", - label); + ioctl(-1, FS_IOC_SETFSLABEL, label); + printf("ioctl(-1, %s, \"%s\") = -1 EBADF (%m)\n", + ioc(FS_IOC_SETFSLABEL), label); if (write_ok) { - ioctl(btrfs_test_dir_fd, BTRFS_IOC_SET_FSLABEL, label); - printf("ioctl(%d, BTRFS_IOC_SET_FSLABEL, \"%s\") = 0\n", - btrfs_test_dir_fd, label); + ioctl(btrfs_test_dir_fd, FS_IOC_SETFSLABEL, label); + printf("ioctl(%d, %s, \"%s\") = 0\n", + btrfs_test_dir_fd, ioc(FS_IOC_SETFSLABEL), label); - ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_FSLABEL, label); - printf("ioctl(%d, BTRFS_IOC_GET_FSLABEL, \"%s\") = 0\n", - btrfs_test_dir_fd, label); + ioctl(btrfs_test_dir_fd, FS_IOC_GETFSLABEL, label); + printf("ioctl(%d, %s, \"%s\") = 0\n", + btrfs_test_dir_fd, ioc(FS_IOC_GETFSLABEL), label); } } @@ -1518,14 +1738,14 @@ btrfs_test_get_dev_stats_ioctl(void) .nr_items = 5, .flags = max_flags_plus_one(0), }; - ioctl(-1, BTRFS_IOC_GET_DEV_STATS, NULL); - printf("ioctl(-1, BTRFS_IOC_GET_DEV_STATS, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_GET_DEV_STATS)); - printf("ioctl(-1, BTRFS_IOC_GET_DEV_STATS, {devid=%" PRI__u64 - ", nr_items=%" PRI__u64", flags=", - args.devid, args.nr_items); - printflags(btrfs_dev_stats_flags, args.flags, + printf("ioctl(-1, %s, {devid=%s" + ", nr_items=%" PRI__u64 ", flags=", + ioc(BTRFS_IOC_GET_DEV_STATS), + sprint_makedev(args.devid), args.nr_items); + prfl_btrfs(btrfs_dev_stats_flags, args.flags, "BTRFS_DEV_STATS_???"); ioctl(-1, BTRFS_IOC_GET_DEV_STATS, &args); printf("}) = -1 EBADF (%m)\n"); @@ -1533,23 +1753,32 @@ btrfs_test_get_dev_stats_ioctl(void) if (write_ok) { unsigned int i; args.flags = BTRFS_DEV_STATS_RESET; - printf("ioctl(%d, BTRFS_IOC_GET_DEV_STATS, {devid=%" PRI__u64 - ", nr_items=%" PRI__u64", flags=", - btrfs_test_dir_fd, args.devid, args.nr_items); - printflags(btrfs_dev_stats_flags, args.flags, + printf("ioctl(%d, %s, {devid=%s" + ", nr_items=%" PRI__u64 ", flags=", + btrfs_test_dir_fd, ioc(BTRFS_IOC_GET_DEV_STATS), + sprint_makedev(args.devid), args.nr_items); + prfl_btrfs(btrfs_dev_stats_flags, args.flags, "BTRFS_DEV_STATS_???"); ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_DEV_STATS, &args); printf("} => {nr_items=%" PRI__u64 ", flags=", args.nr_items); - printflags(btrfs_dev_stats_flags, args.flags, + prfl_btrfs(btrfs_dev_stats_flags, args.flags, "BTRFS_DEV_STATS_???"); printf(", ["); for (i = 0; i < args.nr_items; i++) { const char *name = xlookup(btrfs_dev_stats_values, i); if (i) printf(", "); - if (name) - printf("/* %s */ ", name); + + if (name) { + if (verbose_xlat) + printf("[%u /* %s */] = ", i, name); + else + printf("[%s] = ", name); + } else { + printf("[%u] = ", i); + } + printf("%" PRI__u64, args.values[i]); } printf("]}) = 0\n"); @@ -1574,28 +1803,45 @@ btrfs_test_dev_replace_ioctl(void) /* struct btrfs_ioctl_dev_replace_args */ ioctl(-1, BTRFS_IOC_DEV_REPLACE, NULL); - printf("ioctl(-1, BTRFS_IOC_DEV_REPLACE, NULL) = -1 EBADF (%m)\n"); - - ioctl(-1, BTRFS_IOC_DEV_REPLACE, &args); - printf("ioctl(-1, BTRFS_IOC_DEV_REPLACE, " - "{cmd=BTRFS_IOCTL_DEV_REPLACE_CMD_START, start={srcdevid=%" - PRI__u64", cont_reading_from_srcdev_mode=%" PRI__u64 - ", srcdev_name=\"%s\", tgtdev_name=\"%s\"}}) = -1 EBADF (%m)\n", - args.start.srcdevid, - args.start.cont_reading_from_srcdev_mode, - (char *)args.start.srcdev_name, - (char *)args.start.tgtdev_name); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_DEV_REPLACE)); + + for (unsigned long i = 0; i < 3; i++) { + int saved_errno; + + args.start.cont_reading_from_srcdev_mode = i; + ioctl(-1, BTRFS_IOC_DEV_REPLACE, &args); + saved_errno = errno; + printf("ioctl(-1, %s, " + "{cmd=%sBTRFS_IOCTL_DEV_REPLACE_CMD_START%s" + ", start={srcdevid=%s" + ", cont_reading_from_srcdev_mode=", + ioc(BTRFS_IOC_DEV_REPLACE), + verbose_xlat ? "0 /* " : "", verbose_xlat ? " */" : "", + sprint_makedev(args.start.srcdevid) + ); + prxval_btrfs(btrfs_cont_reading_from_srcdev_mode, + args.start.cont_reading_from_srcdev_mode, + "BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV" + "_MODE_???", i < 2); + errno = saved_errno; + printf(", srcdev_name=\"%s\", tgtdev_name=\"%s\"}}) " + "= -1 EBADF (%m)\n", + (char *)args.start.srcdev_name, + (char *)args.start.tgtdev_name); + } args.cmd = 1; ioctl(-1, BTRFS_IOC_DEV_REPLACE, &args); - printf("ioctl(-1, BTRFS_IOC_DEV_REPLACE, " - "{cmd=BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS}) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, {cmd=%sBTRFS_IOCTL_DEV_REPLACE_CMD_STATUS%s}) " + "= -1 EBADF (%m)\n", + ioc(BTRFS_IOC_DEV_REPLACE), + verbose_xlat ? "0x1 /* " : "", verbose_xlat ? " */" : ""); } static void btrfs_test_extent_same_ioctl(void) { -#ifdef BTRFS_IOC_FILE_EXTENT_SAME +# ifdef BTRFS_IOC_FILE_EXTENT_SAME struct file_dedupe_range args = { .src_offset = 1024, .src_length = 10240, @@ -1603,13 +1849,16 @@ btrfs_test_extent_same_ioctl(void) struct file_dedupe_range *argsp; ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME, NULL); - printf("ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " - "NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + sprint_xlat_(BTRFS_IOC_FILE_EXTENT_SAME, + "BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE")); - printf("ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " + printf("ioctl(-1, %s, " "{src_offset=%" PRIu64 ", src_length=%" PRIu64 ", dest_count=%hu, info=[]", + sprint_xlat_(BTRFS_IOC_FILE_EXTENT_SAME, + "BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE"), (uint64_t)args.src_offset, (uint64_t)args.src_length, args.dest_count); ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME, &args); @@ -1629,10 +1878,12 @@ btrfs_test_extent_same_ioctl(void) argsp->info[2].dest_fd = 2; argsp->info[2].dest_offset = 20480; - printf("ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " + printf("ioctl(-1, %s, " "{src_offset=%" PRIu64 ", src_length=%" PRIu64 ", dest_count=%hu, info=", + sprint_xlat_(BTRFS_IOC_FILE_EXTENT_SAME, + "BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE"), (int64_t)argsp->src_offset, (uint64_t)argsp->src_length, argsp->dest_count); printf("[{dest_fd=%" PRId64 ", dest_offset=%" PRIu64 @@ -1691,9 +1942,12 @@ btrfs_test_extent_same_ioctl(void) argsp->info[2].dest_fd = fd2; argsp->info[2].dest_offset = 20480; - printf("ioctl(%d, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " + printf("ioctl(%d, %s, " "{src_offset=%" PRIu64 ", src_length=%" PRIu64 ", dest_count=%hu, info=", fd1, + sprint_xlat_(BTRFS_IOC_FILE_EXTENT_SAME, + "BTRFS_IOC_FILE_EXTENT_SAME" + " or FIDEDUPERANGE"), (uint64_t)argsp->src_offset, (uint64_t)argsp->src_length, argsp->dest_count); printf("[{dest_fd=%" PRId64 ", dest_offset=%" PRIu64 @@ -1733,7 +1987,7 @@ btrfs_test_extent_same_ioctl(void) close(fd2); } free(argsp); -#endif /* BTRFS_IOC_FILE_EXTENT_SAME */ +# endif /* BTRFS_IOC_FILE_EXTENT_SAME */ } static void @@ -1744,11 +1998,11 @@ btrfs_print_features(struct btrfs_ioctl_feature_flags *flags) "BTRFS_FEATURE_COMPAT_???"); printf(", compat_ro_flags="); - printflags(btrfs_features_compat_ro, flags->compat_ro_flags, + prfl_btrfs(btrfs_features_compat_ro, flags->compat_ro_flags, "BTRFS_FEATURE_COMPAT_RO_???"); printf(", incompat_flags="); - printflags(btrfs_features_incompat, flags->incompat_flags, + prfl_btrfs(btrfs_features_incompat, flags->incompat_flags, "BTRFS_FEATURE_INCOMPAT_???"); printf("}"); } @@ -1778,9 +2032,10 @@ btrfs_test_features_ioctls(void) struct btrfs_ioctl_feature_flags supported_features[3]; ioctl(-1, BTRFS_IOC_SET_FEATURES, NULL); - printf("ioctl(-1, BTRFS_IOC_SET_FEATURES, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SET_FEATURES)); - printf("ioctl(-1, BTRFS_IOC_SET_FEATURES, ["); + printf("ioctl(-1, %s, [", ioc(BTRFS_IOC_SET_FEATURES)); btrfs_print_features(&args[0]); printf(", "); btrfs_print_features(&args[1]); @@ -1788,8 +2043,8 @@ btrfs_test_features_ioctls(void) printf("]) = -1 EBADF (%m)\n"); if (btrfs_test_root) { - printf("ioctl(%d, BTRFS_IOC_GET_FEATURES, ", - btrfs_test_dir_fd); + printf("ioctl(%d, %s, ", + btrfs_test_dir_fd, ioc(BTRFS_IOC_GET_FEATURES)); ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_FEATURES, &supported_features); btrfs_print_features(&supported_features[0]); @@ -1797,15 +2052,16 @@ btrfs_test_features_ioctls(void) ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_SUPPORTED_FEATURES, &supported_features); - printf("ioctl(%d, BTRFS_IOC_GET_SUPPORTED_FEATURES, ", - btrfs_test_dir_fd); - printf("[ /* supported */ "); + printf("ioctl(%d, %s, ", + btrfs_test_dir_fd, + ioc(BTRFS_IOC_GET_SUPPORTED_FEATURES)); + printf("["); btrfs_print_features(&supported_features[0]); - printf(", /* safe to set */ "); + printf(" /* supported */, "); btrfs_print_features(&supported_features[1]); - printf(", /* safe to clear */ "); + printf(" /* safe to set */, "); btrfs_print_features(&supported_features[2]); - printf("]) = 0\n"); + printf(" /* safe to clear */]) = 0\n"); } } @@ -1816,7 +2072,7 @@ btrfs_test_read_ioctls(void) XLAT(BTRFS_IOC_BALANCE_PROGRESS), XLAT(BTRFS_IOC_FS_INFO), XLAT(BTRFS_IOC_GET_FEATURES), - XLAT(BTRFS_IOC_GET_FSLABEL), + XLAT(FS_IOC_GETFSLABEL), XLAT(BTRFS_IOC_GET_SUPPORTED_FEATURES), XLAT(BTRFS_IOC_QGROUP_LIMIT), XLAT(BTRFS_IOC_QUOTA_RESCAN_STATUS), @@ -1827,19 +2083,28 @@ btrfs_test_read_ioctls(void) unsigned int i; for (i = 0; i < ARRAY_SIZE(btrfs_read_cmd); ++i) { ioctl(-1, (unsigned long) btrfs_read_cmd[i].val, 0); - printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", btrfs_read_cmd[i].str); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + sprint_xlat_(btrfs_read_cmd[i].val, + btrfs_read_cmd[i].str)); } } +static void +rm_test_dir(void) +{ + int rootfd = open(path, O_RDONLY|O_DIRECTORY); + + unlinkat(rootfd, dir_name, AT_REMOVEDIR); +} + int main(int argc, char *argv[]) { int opt; int ret; - const char *path; - while ((opt = getopt(argc, argv, "wv")) != -1) { + while ((opt = getopt(argc, argv, "wvX")) != -1) { switch (opt) { case 'v': /* @@ -1851,11 +2116,18 @@ main(int argc, char *argv[]) case 'w': write_ok = true; break; + case 'X': + verbose_xlat = true; + break; default: - error_msg_and_fail("usage: btrfs [-v] [-w] [path]"); + error_msg_and_fail("usage: btrfs [-vwX] [path]"); } } + ret = snprintf(dir_name, sizeof(dir_name), dir_name_fmt, getpid()); + if (ret < 0) + perror_msg_and_fail("snprintf(dir_name)"); + /* * This will enable optional tests that require a valid file descriptor */ @@ -1877,14 +2149,18 @@ main(int argc, char *argv[]) if (rootfd < 0) perror_msg_and_fail("open(%s) failed", path); - ret = mkdirat(rootfd, "strace-test", 0755); + ret = mkdirat(rootfd, dir_name, 0755); if (ret < 0 && errno != EEXIST) - perror_msg_and_fail("mkdirat(strace-test) failed"); + perror_msg_and_fail("mkdirat(%s) failed", dir_name); + + /* Register removal of the created directory. */ + if (ret == 0) + atexit(rm_test_dir); - btrfs_test_dir_fd = openat(rootfd, "strace-test", + btrfs_test_dir_fd = openat(rootfd, dir_name, O_RDONLY|O_DIRECTORY); if (btrfs_test_dir_fd < 0) - perror_msg_and_fail("openat(strace-test) failed"); + perror_msg_and_fail("openat(%s) failed", dir_name); close(rootfd); } else write_ok = false; diff --git a/tests-m32/btrfs.gen.test b/tests-m32/btrfs.gen.test new file mode 100755 index 00000000..3976cf5d --- /dev/null +++ b/tests-m32/btrfs.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (btrfs +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/btrfs.test b/tests-m32/btrfs.test deleted file mode 100755 index 2121b5b8..00000000 --- a/tests-m32/btrfs.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check basic btrfs ioctl decoding. - -. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/caps-abbrev.awk b/tests-m32/caps-abbrev.awk index 86de7f23..c00023b4 100644 --- a/tests-m32/caps-abbrev.awk +++ b/tests-m32/caps-abbrev.awk @@ -2,30 +2,10 @@ # # This file is part of caps strace test. # -# Copyright (c) 2014-2016 Dmitry V. Levin +# Copyright (c) 2014-2018 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later BEGIN { cap = "(0|1< +# Copyright (c) 2014-2018 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later BEGIN { cap = "(0|1< + * Copyright (c) 2014-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/caps.test b/tests-m32/caps.test index 607a75bb..ac68364e 100755 --- a/tests-m32/caps.test +++ b/tests-m32/caps.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check capget/capset syscalls decoding. +# +# Copyright (c) 2014-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests-m32/check_sigblock.c b/tests-m32/check_sigblock.c new file mode 100644 index 00000000..cd781f19 --- /dev/null +++ b/tests-m32/check_sigblock.c @@ -0,0 +1,29 @@ +/* + * Check that the specified signal number is blocked/unblocked. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include + +int +main(int ac, char **av) +{ + if (ac != 3) + error_msg_and_fail("usage: check_sigblock 0|1 signum"); + + const int block = !!atoi(av[1]); + const int signum = atoi(av[2]); + sigset_t mask; + + sigemptyset(&mask); + if (sigprocmask(SIG_SETMASK, NULL, &mask)) + perror_msg_and_fail("sigprocmask"); + + return block ^ sigismember(&mask, signum); +} diff --git a/tests-m32/check_sigign.c b/tests-m32/check_sigign.c new file mode 100644 index 00000000..a04f5d6b --- /dev/null +++ b/tests-m32/check_sigign.c @@ -0,0 +1,29 @@ +/* + * Check that the signal handler for the specified signal number is set + * to SIG_IGN/SIG_DFL. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include + +int +main(int ac, char **av) +{ + if (ac != 3) + error_msg_and_fail("usage: check_sigign 0|1 signum"); + + const int ign = !!atoi(av[1]); + const int signum = atoi(av[2]); + struct sigaction act; + + if (sigaction(signum, NULL, &act)) + perror_msg_and_fail("sigaction: %s", av[2]); + + return ign ^ (act.sa_handler == SIG_IGN); +} diff --git a/tests-m32/chmod.c b/tests-m32/chmod.c index f6f98ece..d7c9fbab 100644 --- a/tests-m32/chmod.c +++ b/tests-m32/chmod.c @@ -1,29 +1,9 @@ /* * Copyright (c) 2016 Anchit Jain - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -31,10 +11,10 @@ #if defined __NR_chmod -#include -#include -#include -#include +# include +# include +# include +# include int main(void) diff --git a/tests-m32/chmod.gen.test b/tests-m32/chmod.gen.test new file mode 100755 index 00000000..40330885 --- /dev/null +++ b/tests-m32/chmod.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (chmod -a28 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-m32/chmod.test b/tests-m32/chmod.test deleted file mode 100755 index 70e561a1..00000000 --- a/tests-m32/chmod.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check chmod syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 diff --git a/tests-m32/chown.c b/tests-m32/chown.c index 12aa8b71..05fe9af1 100644 --- a/tests-m32/chown.c +++ b/tests-m32/chown.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/chown.gen.test b/tests-m32/chown.gen.test new file mode 100755 index 00000000..87cc0f02 --- /dev/null +++ b/tests-m32/chown.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (chown -a28 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-m32/chown.test b/tests-m32/chown.test deleted file mode 100755 index eb356ce4..00000000 --- a/tests-m32/chown.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check chown syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 diff --git a/tests-m32/chown32.c b/tests-m32/chown32.c index 4fffd769..f2726203 100644 --- a/tests-m32/chown32.c +++ b/tests-m32/chown32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/chown32.gen.test b/tests-m32/chown32.gen.test new file mode 100755 index 00000000..8d9d8916 --- /dev/null +++ b/tests-m32/chown32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (chown32 -a31 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 diff --git a/tests-m32/chown32.test b/tests-m32/chown32.test deleted file mode 100755 index 0fa04c20..00000000 --- a/tests-m32/chown32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check chown32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a31 diff --git a/tests-m32/chroot.c b/tests-m32/chroot.c index a084cf33..3fc441e3 100644 --- a/tests-m32/chroot.c +++ b/tests-m32/chroot.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/chroot.gen.test b/tests-m32/chroot.gen.test new file mode 100755 index 00000000..40eb55ba --- /dev/null +++ b/tests-m32/chroot.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (chroot -a24 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-m32/chroot.test b/tests-m32/chroot.test deleted file mode 100755 index 3b384f5e..00000000 --- a/tests-m32/chroot.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check chroot syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 diff --git a/tests-m32/clock.gen.test b/tests-m32/clock.gen.test new file mode 100755 index 00000000..b76eaf53 --- /dev/null +++ b/tests-m32/clock.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (clock test_trace_expr 'times|fcntl.*' -e/clock); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr 'times|fcntl.*' -e/clock diff --git a/tests-m32/clock.in b/tests-m32/clock.in new file mode 100755 index 00000000..864de290 --- /dev/null +++ b/tests-m32/clock.in @@ -0,0 +1,3 @@ +clock_adjtime -a37 +clock_nanosleep +clock_xettime -a36 diff --git a/tests-m32/clock_adjtime.c b/tests-m32/clock_adjtime.c index 01089b54..8e5a12fb 100644 --- a/tests-m32/clock_adjtime.c +++ b/tests-m32/clock_adjtime.c @@ -1,30 +1,10 @@ /* * This file is part of clock_adjtime strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/clock_adjtime.gen.test b/tests-m32/clock_adjtime.gen.test new file mode 100755 index 00000000..22d5dbcd --- /dev/null +++ b/tests-m32/clock_adjtime.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (clock_adjtime -a37 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a37 diff --git a/tests-m32/clock_adjtime.test b/tests-m32/clock_adjtime.test deleted file mode 100755 index df2c0601..00000000 --- a/tests-m32/clock_adjtime.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check clock_adjtime syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a37 diff --git a/tests-m32/clock_nanosleep.c b/tests-m32/clock_nanosleep.c index 98407d7e..258c3ac1 100644 --- a/tests-m32/clock_nanosleep.c +++ b/tests-m32/clock_nanosleep.c @@ -1,28 +1,11 @@ /* + * Check decoding of clock_nanosleep and clock_gettime syscalls. + * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -62,9 +45,10 @@ main(void) if (syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, &req.ts, NULL)) perror_msg_and_skip("clock_nanosleep CLOCK_REALTIME"); - printf("clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=%jd, tv_nsec=%jd}, " - "NULL) = 0\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec); + printf("clock_nanosleep(CLOCK_REALTIME, 0" + ", {tv_sec=%lld, tv_nsec=%llu}, NULL) = 0\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec)); assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, NULL, &rem.ts) == -1); @@ -73,52 +57,71 @@ main(void) assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, &req.ts, &rem.ts) == 0); - printf("clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=%jd, tv_nsec=%jd}, " - "%p) = 0\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + printf("clock_nanosleep(CLOCK_REALTIME, 0" + ", {tv_sec=%lld, tv_nsec=%llu}, %p) = 0\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); req.ts.tv_nsec = 999999999 + 1; assert(syscall(__NR_clock_nanosleep, CLOCK_MONOTONIC, 0, &req.ts, &rem.ts) == -1); printf("clock_nanosleep(CLOCK_MONOTONIC, 0" - ", {tv_sec=%jd, tv_nsec=%jd}, %p) = -1 EINVAL (%m)\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + ", {tv_sec=%lld, tv_nsec=%llu}, %p) = -1 EINVAL (%m)\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); + + req.ts.tv_sec = 0xdeadbeefU; + req.ts.tv_nsec = 0xfacefeedU; + assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, + &req.ts, &rem.ts) == -1); + printf("clock_nanosleep(CLOCK_REALTIME, 0" + ", {tv_sec=%lld, tv_nsec=%llu}, %p) = -1 EINVAL (%m)\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); + + req.ts.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + req.ts.tv_nsec = (long) 0xbadc0dedfacefeedLL; + assert(syscall(__NR_clock_nanosleep, CLOCK_MONOTONIC, 0, + &req.ts, &rem.ts) == -1); + printf("clock_nanosleep(CLOCK_MONOTONIC, 0" + ", {tv_sec=%lld, tv_nsec=%llu}, %p) = -1 EINVAL (%m)\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); assert(sigaction(SIGALRM, &act, NULL) == 0); assert(sigprocmask(SIG_SETMASK, &set, NULL) == 0); if (setitimer(ITIMER_REAL, &itv, NULL)) perror_msg_and_skip("setitimer"); - printf("setitimer(ITIMER_REAL, {it_interval={tv_sec=%jd, tv_usec=%jd}" - ", it_value={tv_sec=%jd, tv_usec=%jd}}, NULL) = 0\n", - (intmax_t) itv.it_interval.tv_sec, - (intmax_t) itv.it_interval.tv_usec, - (intmax_t) itv.it_value.tv_sec, - (intmax_t) itv.it_value.tv_usec); - --req.ts.tv_nsec; + req.ts.tv_sec = 0; + req.ts.tv_nsec = 999999999; assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, &req.ts, &rem.ts) == -1); - printf("clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=%jd, tv_nsec=%jd}, " - "{tv_sec=%jd, tv_nsec=%jd})" + printf("clock_nanosleep(CLOCK_REALTIME, 0" + ", {tv_sec=%lld, tv_nsec=%llu}, {tv_sec=%lld, tv_nsec=%llu})" " = ? ERESTART_RESTARTBLOCK (Interrupted by signal)\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, - (intmax_t) rem.ts.tv_sec, (intmax_t) rem.ts.tv_nsec); + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), + (long long) rem.ts.tv_sec, + zero_extend_signed_to_ull(rem.ts.tv_nsec)); puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); assert(syscall(__NR_clock_gettime, CLOCK_REALTIME, &req.ts) == 0); - printf("clock_gettime(CLOCK_REALTIME, {tv_sec=%jd, tv_nsec=%jd}) = 0\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec); + printf("clock_gettime(CLOCK_REALTIME, {tv_sec=%lld, tv_nsec=%llu}) = 0\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec)); ++req.ts.tv_sec; rem.ts.tv_sec = 0xc0de4; rem.ts.tv_nsec = 0xc0de5; assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, TIMER_ABSTIME, &req.ts, &rem.ts) == -1); - printf("clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, {tv_sec=%jd, " - "tv_nsec=%jd}, %p)" + printf("clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME" + ", {tv_sec=%lld, tv_nsec=%llu}, %p)" " = ? ERESTARTNOHAND (To be restarted if no handler)\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); puts("+++ exited with 0 +++"); diff --git a/tests-m32/clock_nanosleep.gen.test b/tests-m32/clock_nanosleep.gen.test new file mode 100755 index 00000000..7a6025bb --- /dev/null +++ b/tests-m32/clock_nanosleep.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (clock_nanosleep -e trace=clock_nanosleep,clock_gettime); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=clock_nanosleep,clock_gettime diff --git a/tests-m32/clock_nanosleep.test b/tests-m32/clock_nanosleep.test deleted file mode 100755 index ec434a60..00000000 --- a/tests-m32/clock_nanosleep.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check clock_nanosleep, clock_gettime, and setitimer syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=clock_nanosleep,clock_gettime,setitimer diff --git a/tests-m32/clock_xettime.c b/tests-m32/clock_xettime.c index 3ef5695f..c25240da 100644 --- a/tests-m32/clock_xettime.c +++ b/tests-m32/clock_xettime.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -45,29 +26,45 @@ main(void) } t = { .pad = { 0xdeadbeef, 0xbadc0ded } }; + long rc; if (syscall(__NR_clock_getres, CLOCK_REALTIME, &t.ts)) perror_msg_and_skip("clock_getres CLOCK_REALTIME"); - printf("clock_getres(CLOCK_REALTIME, {tv_sec=%jd, tv_nsec=%jd}) = 0\n", - (intmax_t) t.ts.tv_sec, - (intmax_t) t.ts.tv_nsec); + printf("clock_getres(CLOCK_REALTIME, {tv_sec=%lld, tv_nsec=%llu})" + " = 0\n", + (long long) t.ts.tv_sec, + zero_extend_signed_to_ull(t.ts.tv_nsec)); if (syscall(__NR_clock_gettime, CLOCK_PROCESS_CPUTIME_ID, &t.ts)) perror_msg_and_skip("clock_gettime CLOCK_PROCESS_CPUTIME_ID"); - printf("clock_gettime(CLOCK_PROCESS_CPUTIME_ID, " - "{tv_sec=%jd, tv_nsec=%jd}) = 0\n", - (intmax_t) t.ts.tv_sec, - (intmax_t) t.ts.tv_nsec); + printf("clock_gettime(CLOCK_PROCESS_CPUTIME_ID" + ", {tv_sec=%lld, tv_nsec=%llu}) = 0\n", + (long long) t.ts.tv_sec, + zero_extend_signed_to_ull(t.ts.tv_nsec)); t.ts.tv_sec = 0xdeface1; t.ts.tv_nsec = 0xdeface2; - if (!syscall(__NR_clock_settime, CLOCK_THREAD_CPUTIME_ID, &t.ts)) - error_msg_and_skip("clock_settime CLOCK_THREAD_CPUTIME_ID:" - " EINVAL expected"); - printf("clock_settime(CLOCK_THREAD_CPUTIME_ID, {tv_sec=%jd, " - "tv_nsec=%jd}) = -1 EINVAL (%m)\n", - (intmax_t) t.ts.tv_sec, - (intmax_t) t.ts.tv_nsec); + rc = syscall(__NR_clock_settime, CLOCK_THREAD_CPUTIME_ID, &t.ts); + printf("clock_settime(CLOCK_THREAD_CPUTIME_ID" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + (long long) t.ts.tv_sec, + zero_extend_signed_to_ull(t.ts.tv_nsec), sprintrc(rc)); + + t.ts.tv_sec = 0xdeadbeefU; + t.ts.tv_nsec = 0xfacefeedU; + rc = syscall(__NR_clock_settime, CLOCK_THREAD_CPUTIME_ID, &t.ts); + printf("clock_settime(CLOCK_THREAD_CPUTIME_ID" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + (long long) t.ts.tv_sec, + zero_extend_signed_to_ull(t.ts.tv_nsec), sprintrc(rc)); + + t.ts.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + t.ts.tv_nsec = (long) 0xbadc0dedfacefeedLL; + rc = syscall(__NR_clock_settime, CLOCK_THREAD_CPUTIME_ID, &t.ts); + printf("clock_settime(CLOCK_THREAD_CPUTIME_ID" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + (long long) t.ts.tv_sec, + zero_extend_signed_to_ull(t.ts.tv_nsec), sprintrc(rc)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/clock_xettime.gen.test b/tests-m32/clock_xettime.gen.test new file mode 100755 index 00000000..590f058e --- /dev/null +++ b/tests-m32/clock_xettime.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (clock_xettime -a36 -e trace=clock_getres,clock_gettime,clock_settime); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 -e trace=clock_getres,clock_gettime,clock_settime diff --git a/tests-m32/clock_xettime.test b/tests-m32/clock_xettime.test deleted file mode 100755 index f045a66e..00000000 --- a/tests-m32/clock_xettime.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check clock_getres, clock_gettime, and clock_settime syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a36 -e trace=clock_getres,clock_gettime,clock_settime diff --git a/tests-m32/clone_parent.c b/tests-m32/clone_parent.c new file mode 100644 index 00000000..111f98d1 --- /dev/null +++ b/tests-m32/clone_parent.c @@ -0,0 +1,60 @@ +/* + * Check handling of CLONE_PARENT'ed processes. + * + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include + +static int +child(void *const arg) +{ + return 42; +} + +#define child_stack_size (get_page_size() / 2) + +#ifdef IA64 +extern int __clone2(int (*)(void *), void *, size_t, int, void *, ...); +# define clone(fn, child_stack, flags, arg) \ + __clone2(fn, child_stack, child_stack_size, flags, arg) +#endif + +int +main(void) +{ + const pid_t pid = clone(child, tail_alloc(child_stack_size), + CLONE_PARENT | SIGCHLD, 0); + if (pid < 0) + perror_msg_and_fail("clone"); + + int status; + if (wait(&status) >= 0) + error_msg_and_fail("unexpected return code from wait"); + + while (!kill(pid, 0)) + ; + if (errno != ESRCH) + perror_msg_and_fail("kill"); + + FILE *const fp = fdopen(3, "a"); + if (!fp) + perror_msg_and_fail("fdopen"); + if (fprintf(fp, "%s: Exit of unknown pid %d ignored\n", + getenv("STRACE_EXE") ?: "strace", pid) < 0) + perror_msg_and_fail("fprintf"); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/clone_parent.test b/tests-m32/clone_parent.test new file mode 100755 index 00000000..a5b077f3 --- /dev/null +++ b/tests-m32/clone_parent.test @@ -0,0 +1,10 @@ +#!/bin/sh -efu +# +# Check handling of CLONE_PARENT'ed processes. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/clone_ptrace.test" diff --git a/tests-m32/clone_ptrace.c b/tests-m32/clone_ptrace.c new file mode 100644 index 00000000..ee366ab9 --- /dev/null +++ b/tests-m32/clone_ptrace.c @@ -0,0 +1,90 @@ +/* + * Check handling of CLONE_PTRACE'ed processes. + * + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +static siginfo_t sinfo; + +static void +handler(const int no, siginfo_t *const si, void *const uc) +{ + memcpy(&sinfo, si, sizeof(sinfo)); +} + +static int +child(void *const arg) +{ + for(;;) + pause(); + return 0; +} + +#define child_stack_size (get_page_size() / 2) + +#ifdef IA64 +extern int __clone2(int (*)(void *), void *, size_t, int, void *, ...); +# define clone(fn, child_stack, flags, arg) \ + __clone2(fn, child_stack, child_stack_size, flags, arg) +#endif + +int +main(void) +{ + const int sig = SIGUSR1; + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, sig); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + const pid_t pid = clone(child, tail_alloc(child_stack_size), + CLONE_PTRACE | SIGCHLD, 0); + if (pid < 0) + perror_msg_and_fail("clone"); + + static const struct sigaction sa = { + .sa_sigaction = handler, + .sa_flags = SA_SIGINFO + }; + if (sigaction(SIGCHLD, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + kill(pid, sig); + + FILE *const fp = fdopen(3, "a"); + if (!fp) + perror_msg_and_fail("fdopen"); + if (fprintf(fp, "%s: Detached unknown pid %d\n", + getenv("STRACE_EXE") ?: "strace", pid) < 0) + perror_msg_and_fail("fprintf"); + + int status; + while (wait(&status) != pid) { + if (errno != EINTR) + perror_msg_and_fail("wait"); + } + if (!WIFSIGNALED(status) || WTERMSIG(status) != sig) + error_msg_and_fail("unexpected child exit status %d", status); + + printf("--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=%d" + ", si_uid=%u, si_status=%s, si_utime=%u, si_stime=%u} ---\n" + "+++ exited with 0 +++\n", pid, geteuid(), "SIGUSR1", + (unsigned int) sinfo.si_utime, (unsigned int) sinfo.si_stime); + + return 0; +} diff --git a/tests-m32/clone_ptrace.test b/tests-m32/clone_ptrace.test new file mode 100755 index 00000000..24c4298a --- /dev/null +++ b/tests-m32/clone_ptrace.test @@ -0,0 +1,24 @@ +#!/bin/sh -efu +# +# Check handling of CLONE_PTRACE'ed processes. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null 3>&1 +args="-e trace=none $args" +> "$LOG" || fail_ "failed to write $LOG" + +$STRACE -o "$LOG" $args > "$EXP" 2> "$OUT"-err 3> "$EXP"-err || { + msg="$STRACE $args failed with code $?" + cat "$OUT"-err "$LOG" >&2 + fail_ "$msg" +} + +cat "$OUT"-err >&2 +match_diff "$LOG" "$EXP" +match_diff "$OUT"-err "$EXP"-err diff --git a/tests-m32/copy_file_range.c b/tests-m32/copy_file_range.c index 085010af..c1f142c6 100644 --- a/tests-m32/copy_file_range.c +++ b/tests-m32/copy_file_range.c @@ -2,29 +2,10 @@ * This file is part of copy_file_range strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -41,8 +22,8 @@ main(void) { const long int fd_in = (long int) 0xdeadbeefffffffff; const long int fd_out = (long int) 0xdeadbeeffffffffe; - long long int *const off_in = tail_alloc(sizeof(*off_in)); - long long int *const off_out = tail_alloc(sizeof(*off_out)); + TAIL_ALLOC_OBJECT_CONST_PTR(long long int, off_in); + TAIL_ALLOC_OBJECT_CONST_PTR(long long int, off_out); *off_in = 0xdeadbef1facefed1; *off_out = 0xdeadbef2facefed2; const size_t len = (size_t) 0xdeadbef3facefed3ULL; diff --git a/tests-m32/copy_file_range.gen.test b/tests-m32/copy_file_range.gen.test new file mode 100755 index 00000000..e90c6c18 --- /dev/null +++ b/tests-m32/copy_file_range.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (copy_file_range ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/copy_file_range.test b/tests-m32/copy_file_range.test deleted file mode 100755 index c39f6acd..00000000 --- a/tests-m32/copy_file_range.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check copy_file_range syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/count-f.c b/tests-m32/count-f.c index 6992b16b..505b6900 100644 --- a/tests-m32/count-f.c +++ b/tests-m32/count-f.c @@ -1,30 +1,10 @@ /* * This file is part of count-f strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/count-f.test b/tests-m32/count-f.test index 67515efa..4f3d45f8 100755 --- a/tests-m32/count-f.test +++ b/tests-m32/count-f.test @@ -1,6 +1,11 @@ #!/bin/sh - -# Check whether -c counts through forks and clones properly +# +# Check whether -c counts through forks and clones properly. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests-m32/count.test b/tests-m32/count.test index e75dc6b0..6abb1772 100755 --- a/tests-m32/count.test +++ b/tests-m32/count.test @@ -3,40 +3,21 @@ # Check whether -c and -w options work. # # Copyright (c) 2014-2016 Dmitry V. Levin +# Copyright (c) 2014-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./sleep 0 +run_prog ../sleep 0 check_prog grep grep_log() { local pattern="$1"; shift - run_strace "$@" ./sleep 1 + run_strace "$@" ../sleep 1 grep nanosleep "$LOG" > /dev/null || framework_skip_ 'sleep does not use nanosleep' @@ -49,8 +30,12 @@ grep_log() } grep_log ' *[^ ]+ +0\.0[^n]*nanosleep' -c +grep_log ' *[^ ]+ +0\.0[^n]*nanosleep' -c -O1 grep_log ' *[^ ]+ +0\.0[^n]*nanosleep' -c -enanosleep +grep_log ' *[^ ]+ +0\.0[^n]*nanosleep' -c -O1 -enanosleep grep_log ' *[^ ]+ +(1\.[01]|0\.99)[^n]*nanosleep' -cw +grep_log ' *[^ ]+ +(1\.[01]|0\.99)[^n]*nanosleep' -cw -O1 grep_log '100\.00 +(1\.[01]|0\.99)[^n]*nanosleep' -cw -enanosleep +grep_log '100\.00 +(1\.[01]|0\.99)[^n]*nanosleep' -cw -O1 -enanosleep exit 0 diff --git a/tests-m32/creat.c b/tests-m32/creat.c index f22fdaaa..71819d5b 100644 --- a/tests-m32/creat.c +++ b/tests-m32/creat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/creat.gen.test b/tests-m32/creat.gen.test new file mode 100755 index 00000000..baff9169 --- /dev/null +++ b/tests-m32/creat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (creat -a20 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-m32/creat.test b/tests-m32/creat.test deleted file mode 100755 index 069648f7..00000000 --- a/tests-m32/creat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check creat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 diff --git a/tests-m32/create_nl_socket.c b/tests-m32/create_nl_socket.c new file mode 100644 index 00000000..ee187201 --- /dev/null +++ b/tests-m32/create_nl_socket.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include "netlink.h" + +int +create_nl_socket_ext(const int proto, const char *const name) +{ + const int fd = socket(AF_NETLINK, SOCK_RAW, proto); + if (fd < 0) + perror_msg_and_skip("socket AF_NETLINK %s", name); + + const struct sockaddr_nl addr = { .nl_family = AF_NETLINK }; + socklen_t len = sizeof(addr); + + if (bind(fd, (const struct sockaddr *) &addr, len)) + perror_msg_and_skip("bind AF_NETLINK %s", name); + + /* one more operation on this socket to win the race */ + int listening; + len = sizeof(listening); + if (getsockopt(fd, SOL_SOCKET, SO_ACCEPTCONN, &listening, &len)) + perror_msg_and_fail("getsockopt"); + + return fd; +} diff --git a/tests-m32/delay.c b/tests-m32/delay.c new file mode 100644 index 00000000..fb19b157 --- /dev/null +++ b/tests-m32/delay.c @@ -0,0 +1,115 @@ +/* + * Check delay injection. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int64_t +usecs_from_tv(const struct timeval *const tv) +{ + return (int64_t) tv->tv_sec * 1000000 + tv->tv_usec; +} + +static int64_t +usecs_from_ts(const struct timespec *const ts) +{ + return (int64_t) ts->tv_sec * 1000000 + ts->tv_nsec / 1000; +} + +static void +check_delay(const struct timeval *const tv0, + const struct timespec *const ts, + const struct timeval *const tv1, + const int nproc, + const int64_t delay_enter, + const int64_t delay_exit) +{ + const int64_t us0 = usecs_from_tv(tv0); + const int64_t us = usecs_from_ts(ts); + const int64_t us1 = usecs_from_tv(tv1); + + if (us - us0 < delay_exit * (nproc - 1) / nproc) + _exit(1); + + if (us - us0 > delay_exit * (nproc + 1) / nproc) + _exit(2); + + if (us1 - us < delay_enter * (nproc - 1) / nproc) + _exit(3); + + if (us1 - us > delay_enter * (nproc + 1) / nproc) + _exit(4); +} + +static void +run(const int nproc, const int delay_enter, const int delay_exit) +{ + struct timeval prev = { 0, 0 }, now; + + for (int i = 0; i < nproc; ++i, prev = now) { + struct timespec ts; + + if (i && clock_gettime(CLOCK_REALTIME, &ts)) + perror_msg_and_fail("clock_gettime"); + + if (syscall(__NR_gettimeofday, &now, NULL)) + perror_msg_and_fail("gettimeofday"); + + if (!i) + continue; + + check_delay(&prev, &ts, &now, nproc, delay_enter, delay_exit); + } + + _exit(0); +} + +int +main(int ac, char *av[]) +{ + if (ac != 4) + error_msg_and_fail("usage: delay "); + + const int nproc = atoi(av[1]); + if (nproc <= 1) + perror_msg_and_fail("invalid nproc: %s", av[1]); + + const int delay_enter = atoi(av[2]); + if (delay_enter <= 0) + perror_msg_and_fail("invalid delay_enter: %s", av[2]); + + const int delay_exit = atoi(av[3]); + if (delay_exit <= 0) + perror_msg_and_fail("invalid delay_exit: %s", av[3]); + + for (int i = 0; i < nproc; ++i) { + pid_t pid = fork(); + + if (pid) + usleep(MAX(delay_enter, delay_exit) / nproc); + else + run(nproc, delay_enter, delay_exit); + } + + int status; + while (wait(&status) > 0) { + if (status) + perror_msg_and_fail("wait status %d", status); + } + + return 0; +} diff --git a/tests-m32/delay.test b/tests-m32/delay.test new file mode 100755 index 00000000..df8552c7 --- /dev/null +++ b/tests-m32/delay.test @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Check delay injection. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +delay_enter=800000 +delay_exit=1600000 +run_strace -f -r -egettimeofday \ + -einject=gettimeofday:delay_enter=$delay_enter:delay_exit=$delay_exit \ + ../delay 4 $delay_enter $delay_exit diff --git a/tests-m32/delete_module.c b/tests-m32/delete_module.c index 5a317603..3b2614c1 100644 --- a/tests-m32/delete_module.c +++ b/tests-m32/delete_module.c @@ -2,29 +2,10 @@ * Check decoding of delete_module syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -48,8 +29,7 @@ main(void) unsigned int val_prefix, val_suffix; } flags[] = { { ARG_STR(0), 0, 0 }, - { (kernel_ulong_t) 0xffffffff00000000ULL | O_NONBLOCK, - "O_NONBLOCK", 0, 0 }, + { F8ILL_KULONG_MASK | O_NONBLOCK, "O_NONBLOCK", 0, 0 }, { (kernel_ulong_t) 0xbadc0dedfacef157ULL & ~(O_NONBLOCK | O_TRUNC), " /* O_??? */", 0xfacef157U & ~(O_NONBLOCK | O_TRUNC), 0}, { (kernel_ulong_t) (0xfacef157deade71cULL & ~O_NONBLOCK) | O_TRUNC, @@ -65,7 +45,7 @@ main(void) fill_memory_ex(bogus_param1, PARAM1_LEN, PARAM1_BASE, PARAM1_LEN); fill_memory_ex(bogus_param2, PARAM2_LEN, PARAM2_BASE, PARAM2_LEN); - rc = syscall(__NR_delete_module, NULL, bogus_zero); + rc = syscall(__NR_delete_module, NULL, F8ILL_KULONG_MASK); printf("delete_module(NULL, 0) = %s\n", sprintrc(rc)); rc = syscall(__NR_delete_module, bogus_param1, flags[0].val); diff --git a/tests-m32/delete_module.gen.test b/tests-m32/delete_module.gen.test new file mode 100755 index 00000000..028515ff --- /dev/null +++ b/tests-m32/delete_module.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (delete_module -a23 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 diff --git a/tests-m32/delete_module.test b/tests-m32/delete_module.test deleted file mode 100755 index fb86ec9a..00000000 --- a/tests-m32/delete_module.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of delete_module syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a23 diff --git a/tests-m32/detach-running.test b/tests-m32/detach-running.test index 006efb85..5eaf3754 100755 --- a/tests-m32/detach-running.test +++ b/tests-m32/detach-running.test @@ -3,29 +3,10 @@ # Ensure that strace can detach from running processes. # # Copyright (c) 2013-2015 Dmitry V. Levin +# Copyright (c) 2014-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -34,9 +15,15 @@ run_prog_skip_if_failed \ check_prog sleep +trap - TERM +sleep $TIMEOUT_DURATION & +kill -TERM $! +wait $! +expected_rc=$? + set -e -./set_ptracer_any sh -c "echo > $LOG; while :; do :; done" > /dev/null & +../set_ptracer_any sh -c "echo > $LOG; while :; do :; done" > /dev/null & while ! [ -s "$LOG" ]; do kill -0 $! 2> /dev/null || @@ -54,7 +41,6 @@ cleanup() return 0 } -rm -f "$LOG" $STRACE -p $tracee_pid 2> "$LOG" & while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do @@ -65,13 +51,18 @@ while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do $SLEEP_A_BIT done -kill -INT $! -wait $! +kill -TERM $! +wait $! && rc=0 || rc=$? grep -F "Process $tracee_pid detached" "$LOG" > /dev/null || { - cleanup - dump_log_and_fail_with "$STRACE -p failed to detach" - } + cleanup + dump_log_and_fail_with "$STRACE -p failed to detach" +} + +[ "$rc" = "$expected_rc" ] || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to terminate itself" +} if [ -f /proc/self/status ]; then $SLEEP_A_BIT diff --git a/tests-m32/detach-sleeping.test b/tests-m32/detach-sleeping.test index 54304f31..857cc2f7 100755 --- a/tests-m32/detach-sleeping.test +++ b/tests-m32/detach-sleeping.test @@ -3,29 +3,10 @@ # Ensure that strace can detach from sleeping processes. # # Copyright (c) 2013-2015 Dmitry V. Levin +# Copyright (c) 2014-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -34,10 +15,15 @@ run_prog_skip_if_failed \ check_prog sleep +trap - TERM +sleep $TIMEOUT_DURATION & +kill -TERM $! +wait $! +expected_rc=$? + set -e -rm -f "$LOG" -./set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > "$LOG" & +../set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > "$LOG" & while ! [ -s "$LOG" ]; do kill -0 $! 2> /dev/null || @@ -55,7 +41,6 @@ cleanup() return 0 } -rm -f "$LOG" $STRACE -p $tracee_pid 2> "$LOG" & while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do @@ -66,14 +51,19 @@ while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do $SLEEP_A_BIT done -kill -INT $! -wait $! +kill -TERM $! +wait $! && rc=0 || rc=$? grep -F "Process $tracee_pid detached" "$LOG" > /dev/null || { cleanup dump_log_and_fail_with "$STRACE -p failed to detach" } +[ "$rc" = "$expected_rc" ] || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to terminate itself" +} + if [ -f /proc/self/status ]; then $SLEEP_A_BIT test -d /proc/$tracee_pid || { diff --git a/tests-m32/detach-stopped.test b/tests-m32/detach-stopped.test index 8f480e7f..5dcde9b9 100755 --- a/tests-m32/detach-stopped.test +++ b/tests-m32/detach-stopped.test @@ -3,46 +3,29 @@ # Ensure that strace can detach from stopped processes. # # Copyright (c) 2013-2015 Dmitry V. Levin +# Copyright (c) 2014-2019 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" +. "${srcdir=.}/PTRACE_SEIZE.sh" run_prog_skip_if_failed \ kill -0 $$ check_prog sleep -$STRACE -d -enone / > /dev/null 2> "$LOG" -if grep -x "[^:]*strace: PTRACE_SEIZE doesn't work" "$LOG" > /dev/null; then - skip_ "PTRACE_SEIZE doesn't work" -fi +trap - TERM +sleep $TIMEOUT_DURATION & +kill -TERM $! +wait $! +expected_rc=$? set -e -rm -f "$LOG" -./set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > "$LOG" & +> "$LOG" +../set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > "$LOG" & while ! [ -s "$LOG" ]; do kill -0 $! 2> /dev/null || @@ -62,7 +45,7 @@ cleanup() return 0 } -rm -f "$LOG" +> "$LOG" $STRACE -p $tracee_pid 2> "$LOG" & while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do @@ -81,14 +64,19 @@ while ! grep -F -e '--- stopped by ' "$LOG" > /dev/null; do $SLEEP_A_BIT done -kill -INT $! -wait $! +kill -TERM $! +wait $! && rc=0 || rc=$? grep -F "Process $tracee_pid detached" "$LOG" > /dev/null || { cleanup dump_log_and_fail_with "$STRACE -p failed to detach" } +[ "$rc" = "$expected_rc" ] || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to terminate itself" +} + if [ -f /proc/self/status ]; then $SLEEP_A_BIT test -d /proc/$tracee_pid || { diff --git a/tests-m32/dev-yy.c b/tests-m32/dev-yy.c new file mode 100644 index 00000000..b9f55fa4 --- /dev/null +++ b/tests-m32/dev-yy.c @@ -0,0 +1,81 @@ +/* + * Check printing of character/block device numbers in -yy mode. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include + +#include + +#include + +#include + +#if defined __NR_openat && defined O_PATH + +int +main(void) +{ + static const struct { + const char *path; + unsigned int major; + unsigned int minor; + bool blk; + bool optional; + } checks[] = { + { "/dev/zero", 1, 5, false, false }, + { "/dev/full", 1, 7, false, false }, + { "/dev/sda", 8, 0, true, true }, + }; + + for (unsigned int i = 0; i < ARRAY_SIZE(checks); i++) { + /* + * We can't have nice things here and call openat() directly as + * some libcs (yes, musl, I'm looking at you now) are too + * frivolous in passing flags to the kernel. + */ + long fd = syscall(__NR_openat, AT_FDCWD, checks[i].path, + O_RDONLY|O_PATH); + + printf("openat(AT_FDCWD, \"%s\", O_RDONLY|O_PATH) = %s", + checks[i].path, sprintrc(fd)); + if (fd >= 0) + printf("<%s<%s %u:%u>>", + checks[i].path, + checks[i].blk ? "block" : "char", + checks[i].major, checks[i].minor); + puts(""); + + if (fd < 0) { + if (checks[i].optional) + continue; + else + perror_msg_and_fail("openat(\"%s\")", + checks[i].path); + } + + int rc = fsync(fd); + + printf("fsync(%ld<%s<%s %u:%u>>) = %s\n", + fd, checks[i].path, checks[i].blk ? "block" : "char", + checks[i].major, checks[i].minor, sprintrc(rc)); + + close(fd); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_openat && O_PATH") + +#endif diff --git a/tests-m32/dev-yy.gen.test b/tests-m32/dev-yy.gen.test new file mode 100755 index 00000000..d83d2e10 --- /dev/null +++ b/tests-m32/dev-yy.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (dev-yy -a30 -e trace=openat,fsync -P "/dev/full" -P "/dev/zero" -P "/dev/sda" -yy); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 -e trace=openat,fsync -P "/dev/full" -P "/dev/zero" -P "/dev/sda" -yy diff --git a/tests-m32/dup.c b/tests-m32/dup.c index 62157e2f..5cf5df7c 100644 --- a/tests-m32/dup.c +++ b/tests-m32/dup.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include diff --git a/tests-m32/dup.gen.test b/tests-m32/dup.gen.test new file mode 100755 index 00000000..e559cdbc --- /dev/null +++ b/tests-m32/dup.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (dup -a8 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 diff --git a/tests-m32/dup.test b/tests-m32/dup.test deleted file mode 100755 index 1dc19198..00000000 --- a/tests-m32/dup.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check dup syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a8 diff --git a/tests-m32/dup2.c b/tests-m32/dup2.c index 9f3addfa..fba8fca5 100644 --- a/tests-m32/dup2.c +++ b/tests-m32/dup2.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/dup2.gen.test b/tests-m32/dup2.gen.test new file mode 100755 index 00000000..6a6d2f58 --- /dev/null +++ b/tests-m32/dup2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (dup2 -a13 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 diff --git a/tests-m32/dup2.test b/tests-m32/dup2.test deleted file mode 100755 index 509c5db1..00000000 --- a/tests-m32/dup2.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check dup2 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a13 diff --git a/tests-m32/dup3.c b/tests-m32/dup3.c index 252e8469..741e06f8 100644 --- a/tests-m32/dup3.c +++ b/tests-m32/dup3.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include @@ -23,6 +30,6 @@ main(void) #else -SKIP_MAIN_UNDEFINED("__NR_dup3 && && O_CLOEXEC") +SKIP_MAIN_UNDEFINED("__NR_dup3 && O_CLOEXEC") #endif diff --git a/tests-m32/dup3.gen.test b/tests-m32/dup3.gen.test new file mode 100755 index 00000000..776b9a79 --- /dev/null +++ b/tests-m32/dup3.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (dup3 -a24 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-m32/dup3.test b/tests-m32/dup3.test deleted file mode 100755 index 293f78f9..00000000 --- a/tests-m32/dup3.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check dup3 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 diff --git a/tests-m32/epoll_create.c b/tests-m32/epoll_create.c index 44262c7d..42cc8d04 100644 --- a/tests-m32/epoll_create.c +++ b/tests-m32/epoll_create.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/epoll_create.gen.test b/tests-m32/epoll_create.gen.test new file mode 100755 index 00000000..277a5aab --- /dev/null +++ b/tests-m32/epoll_create.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (epoll_create -a17 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-m32/epoll_create.test b/tests-m32/epoll_create.test deleted file mode 100755 index 472a9bdb..00000000 --- a/tests-m32/epoll_create.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check epoll_create syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a17 diff --git a/tests-m32/epoll_create1.c b/tests-m32/epoll_create1.c index cd905ecb..81b33825 100644 --- a/tests-m32/epoll_create1.c +++ b/tests-m32/epoll_create1.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/epoll_create1.gen.test b/tests-m32/epoll_create1.gen.test new file mode 100755 index 00000000..c510c322 --- /dev/null +++ b/tests-m32/epoll_create1.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (epoll_create1 -a28 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-m32/epoll_create1.test b/tests-m32/epoll_create1.test deleted file mode 100755 index 7a926a97..00000000 --- a/tests-m32/epoll_create1.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check epoll_create1 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 diff --git a/tests-m32/epoll_ctl.c b/tests-m32/epoll_ctl.c index e6660555..85a288cd 100644 --- a/tests-m32/epoll_ctl.c +++ b/tests-m32/epoll_ctl.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -11,14 +18,14 @@ static long invoke_syscall(unsigned long epfd, unsigned long op, unsigned long fd, void *ev) { - op |= (unsigned long) 0xffffffff00000000ULL; - return syscall(__NR_epoll_ctl, epfd, op, fd, (unsigned long) ev); + return syscall(__NR_epoll_ctl, epfd, F8ILL_KULONG_MASK | op, + fd, (unsigned long) ev); } int main(void) { - struct epoll_event *const ev = tail_alloc(sizeof(*ev)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct epoll_event, ev); ev->events = EPOLLIN; long rc = invoke_syscall(-1U, EPOLL_CTL_ADD, -2U, ev); diff --git a/tests-m32/epoll_ctl.gen.test b/tests-m32/epoll_ctl.gen.test new file mode 100755 index 00000000..dba65f7d --- /dev/null +++ b/tests-m32/epoll_ctl.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (epoll_ctl ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/epoll_ctl.test b/tests-m32/epoll_ctl.test deleted file mode 100755 index 1aded543..00000000 --- a/tests-m32/epoll_ctl.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check epoll_ctl syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/epoll_pwait.c b/tests-m32/epoll_pwait.c index eaaa34d6..ce95e6dc 100644 --- a/tests-m32/epoll_pwait.c +++ b/tests-m32/epoll_pwait.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -12,7 +19,7 @@ int main(void) { sigset_t set[2]; - struct epoll_event *const ev = tail_alloc(sizeof(*ev)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct epoll_event, ev); long rc = syscall(__NR_epoll_pwait, -1, ev, 1, -2, set, (kernel_ulong_t) sizeof(set)); diff --git a/tests-m32/epoll_pwait.gen.test b/tests-m32/epoll_pwait.gen.test new file mode 100755 index 00000000..f98e2b55 --- /dev/null +++ b/tests-m32/epoll_pwait.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (epoll_pwait ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/epoll_pwait.test b/tests-m32/epoll_pwait.test deleted file mode 100755 index c7aeeace..00000000 --- a/tests-m32/epoll_pwait.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of epoll_pwait syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/epoll_wait.c b/tests-m32/epoll_wait.c index 038bf1f7..3981905d 100644 --- a/tests-m32/epoll_wait.c +++ b/tests-m32/epoll_wait.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -10,7 +17,7 @@ int main(void) { - struct epoll_event *const ev = tail_alloc(sizeof(*ev)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct epoll_event, ev); long rc = syscall(__NR_epoll_wait, -1, ev, 1, -2); printf("epoll_wait(-1, %p, 1, -2) = %ld %s (%m)\n", diff --git a/tests-m32/epoll_wait.gen.test b/tests-m32/epoll_wait.gen.test new file mode 100755 index 00000000..d90fbeb9 --- /dev/null +++ b/tests-m32/epoll_wait.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (epoll_wait -a26 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a26 diff --git a/tests-m32/epoll_wait.test b/tests-m32/epoll_wait.test deleted file mode 100755 index 83ae161f..00000000 --- a/tests-m32/epoll_wait.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check epoll_wait syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a26 diff --git a/tests-m32/erestartsys.c b/tests-m32/erestartsys.c index 97c9699c..c6767b52 100644 --- a/tests-m32/erestartsys.c +++ b/tests-m32/erestartsys.c @@ -1,30 +1,10 @@ /* * Check decoding of ERESTARTSYS error code. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/erestartsys.gen.test b/tests-m32/erestartsys.gen.test new file mode 100755 index 00000000..0fc3215f --- /dev/null +++ b/tests-m32/erestartsys.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (erestartsys -a34 -e signal=none -e trace=recvfrom); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a34 -e signal=none -e trace=recvfrom diff --git a/tests-m32/erestartsys.test b/tests-m32/erestartsys.test deleted file mode 100755 index 91f711f3..00000000 --- a/tests-m32/erestartsys.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of ERESTARTSYS error code. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a34 -e signal=none -e trace=recvfrom diff --git a/tests-m32/errno2name.c b/tests-m32/errno2name.c index 4a176993..56340d75 100644 --- a/tests-m32/errno2name.c +++ b/tests-m32/errno2name.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -476,6 +457,7 @@ errno2name(void) #ifdef EXFULL CASE(EXFULL); #endif - default: perror_msg_and_fail("unknown errno %d", errno); + default: + perror_msg_and_fail("unknown errno %d", errno); } } diff --git a/tests-m32/error_msg.c b/tests-m32/error_msg.c index 498a8821..caefa947 100644 --- a/tests-m32/error_msg.c +++ b/tests-m32/error_msg.c @@ -1,30 +1,14 @@ /* * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ +#define perror_msg_and_fail perror_msg_and_fail +#define error_msg_and_fail error_msg_and_fail + #include "tests.h" #include #include diff --git a/tests-m32/eventfd.c b/tests-m32/eventfd.c index d6ad6492..75d33dd7 100644 --- a/tests-m32/eventfd.c +++ b/tests-m32/eventfd.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/eventfd.test b/tests-m32/eventfd.test index e181ed6e..b6d24454 100755 --- a/tests-m32/eventfd.test +++ b/tests-m32/eventfd.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check eventfd2 syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests-m32/execve-v.test b/tests-m32/execve-v.test index cce58601..f8bafb91 100755 --- a/tests-m32/execve-v.test +++ b/tests-m32/execve-v.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check verbose decoding of execve syscall. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -11,5 +16,3 @@ run_strace -veexecve $args > "$EXP" # Filter out execve() call made by strace. grep -F test.execve < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-m32/execve.c b/tests-m32/execve.c index 74749e73..db7206d8 100644 --- a/tests-m32/execve.c +++ b/tests-m32/execve.c @@ -2,29 +2,10 @@ * This file is part of execve strace test. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -58,34 +39,40 @@ main(void) execve(FILENAME, tail_argv, tail_envp); printf("execve(\"%s\"" - ", [\"%s\", \"%s\", \"%s\", %p, %p, %p, ???]" + ", [\"%s\", \"%s\", \"%s\", %p, %p, %p, ... /* %p */]" #if VERBOSE - ", [\"%s\", \"%s\", %p, %p, %p, ???]" + ", [\"%s\", \"%s\", %p, %p, %p, ... /* %p */]" #else - ", [/* 5 vars, unterminated */]" + ", %p /* 5 vars, unterminated */" #endif ") = -1 ENOENT (%m)\n", Q_FILENAME, q_argv[0], q_argv[1], q_argv[2], - argv[3], argv[4], argv[5] + argv[3], argv[4], argv[5], (char *) tail_argv + sizeof(argv) #if VERBOSE - , q_envp[0], q_envp[1], envp[2], envp[3], envp[4] + , q_envp[0], q_envp[1], envp[2], envp[3], envp[4], + (char *) tail_envp + sizeof(envp) +#else + , tail_envp #endif ); tail_argv[ARRAY_SIZE(q_argv)] = NULL; tail_envp[ARRAY_SIZE(q_envp)] = NULL; + (void) q_envp; /* workaround for clang bug #33068 */ execve(FILENAME, tail_argv, tail_envp); printf("execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" #if VERBOSE ", [\"%s\", \"%s\"]" #else - ", [/* 2 vars */]" + ", %p /* 2 vars */" #endif ") = -1 ENOENT (%m)\n", Q_FILENAME, q_argv[0], q_argv[1], q_argv[2] #if VERBOSE , q_envp[0], q_envp[1] +#else + , tail_envp #endif ); @@ -94,16 +81,18 @@ main(void) #if VERBOSE ", [\"%s\"]" #else - ", [/* 1 var */]" + ", %p /* 1 var */" #endif ") = -1 ENOENT (%m)\n", Q_FILENAME, q_argv[2] #if VERBOSE , q_envp[1] +#else + , tail_envp + 1 #endif ); - char **const empty = tail_alloc(sizeof(*empty)); + TAIL_ALLOC_OBJECT_CONST_PTR(char *, empty); char **const efault = empty + 1; *empty = NULL; @@ -112,13 +101,22 @@ main(void) #if VERBOSE ", []" #else - ", [/* 0 vars */]" + ", %p /* 0 vars */" #endif - ") = -1 ENOENT (%m)\n", Q_FILENAME); + ") = -1 ENOENT (%m)\n", Q_FILENAME +#if !VERBOSE + , empty +#endif + ); + + char *const str_a = tail_alloc(DEFAULT_STRLEN + 2); + fill_memory_ex(str_a, DEFAULT_STRLEN + 1, '0', 10); + str_a[DEFAULT_STRLEN + 1] = '\0'; + + char *const str_b = tail_alloc(DEFAULT_STRLEN + 2); + fill_memory_ex(str_b, DEFAULT_STRLEN + 1, '_', 32); + str_b[DEFAULT_STRLEN + 1] = '\0'; - char str_a[] = "012345678901234567890123456789012"; - char str_b[] = "_abcdefghijklmnopqrstuvwxyz()[]{}"; -#define DEFAULT_STRLEN ((unsigned int) sizeof(str_a) - 2) char **const a = tail_alloc(sizeof(*a) * (DEFAULT_STRLEN + 2)); char **const b = tail_alloc(sizeof(*b) * (DEFAULT_STRLEN + 2)); unsigned int i; @@ -141,10 +139,11 @@ main(void) printf("], [\"%.*s\"...", DEFAULT_STRLEN, b[0]); for (i = 1; i <= DEFAULT_STRLEN; ++i) printf(", \"%s\"", b[i]); + printf("]"); #else - printf("], [/* %u vars */", DEFAULT_STRLEN + 1); + printf("], %p /* %u vars */", b, DEFAULT_STRLEN + 1); #endif - printf("]) = -1 ENOENT (%m)\n"); + printf(") = -1 ENOENT (%m)\n"); execve(FILENAME, a + 1, b + 1); printf("execve(\"%s\", [\"%s\"", Q_FILENAME, a[1]); @@ -154,10 +153,11 @@ main(void) printf("], [\"%s\"", b[1]); for (i = 2; i <= DEFAULT_STRLEN; ++i) printf(", \"%s\"", b[i]); + printf("]"); #else - printf("], [/* %d vars */", DEFAULT_STRLEN); + printf("], %p /* %d vars */", b + 1, DEFAULT_STRLEN); #endif - printf("]) = -1 ENOENT (%m)\n"); + printf(") = -1 ENOENT (%m)\n"); execve(FILENAME, (char **) tail_argv[ARRAY_SIZE(q_argv)], efault); printf("execve(\"%s\", NULL, %p) = -1 ENOENT (%m)\n", diff --git a/tests-m32/execve.test b/tests-m32/execve.test index 263b6fc5..0824bab4 100755 --- a/tests-m32/execve.test +++ b/tests-m32/execve.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check execve syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -11,5 +16,3 @@ run_strace -eexecve $args > "$EXP" # Filter out execve() call made by strace. grep -F test.execve < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-m32/execveat-v.gen.test b/tests-m32/execveat-v.gen.test new file mode 100755 index 00000000..f7d572f3 --- /dev/null +++ b/tests-m32/execveat-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (execveat-v -v -e trace=execveat); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=execveat diff --git a/tests-m32/execveat-v.test b/tests-m32/execveat-v.test deleted file mode 100755 index a9052248..00000000 --- a/tests-m32/execveat-v.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check verbose decoding of execveat syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -e trace=execveat diff --git a/tests-m32/execveat.c b/tests-m32/execveat.c index 9083830e..629a69ab 100644 --- a/tests-m32/execveat.c +++ b/tests-m32/execveat.c @@ -2,29 +2,10 @@ * This file is part of execveat strace test. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -63,68 +44,85 @@ main(void) syscall(__NR_execveat, -100, FILENAME, tail_argv, tail_envp, 0x1100); printf("execveat(AT_FDCWD, \"%s\"" - ", [\"%s\", \"%s\", \"%s\", %p, %p, %p, ???]" -#if VERBOSE - ", [\"%s\", \"%s\", %p, %p, %p, ???]" -#else - ", [/* 5 vars, unterminated */]" -#endif + ", [\"%s\", \"%s\", \"%s\", %p, %p, %p, ... /* %p */]" +# if VERBOSE + ", [\"%s\", \"%s\", %p, %p, %p, ... /* %p */]" +# else + ", %p /* 5 vars, unterminated */" +# endif ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", Q_FILENAME, q_argv[0], q_argv[1], q_argv[2], - argv[3], argv[4], argv[5], -#if VERBOSE + argv[3], argv[4], argv[5], (char *) tail_argv + sizeof(argv), +# if VERBOSE q_envp[0], q_envp[1], envp[2], envp[3], envp[4], -#endif + (char *) tail_envp + sizeof(envp), +# else + tail_envp, +# endif errno2name()); tail_argv[ARRAY_SIZE(q_argv)] = NULL; tail_envp[ARRAY_SIZE(q_envp)] = NULL; + (void) q_envp; /* workaround for clang bug #33068 */ syscall(__NR_execveat, -100, FILENAME, tail_argv, tail_envp, 0x1100); printf("execveat(AT_FDCWD, \"%s\", [\"%s\", \"%s\", \"%s\"]" -#if VERBOSE +# if VERBOSE ", [\"%s\", \"%s\"]" -#else - ", [/* 2 vars */]" -#endif +# else + ", %p /* 2 vars */" +# endif ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", Q_FILENAME, q_argv[0], q_argv[1], q_argv[2], -#if VERBOSE +# if VERBOSE q_envp[0], q_envp[1], -#endif +# else + tail_envp, +# endif errno2name()); syscall(__NR_execveat, -100, FILENAME, tail_argv + 2, tail_envp + 1, 0x1100); printf("execveat(AT_FDCWD, \"%s\", [\"%s\"]" -#if VERBOSE +# if VERBOSE ", [\"%s\"]" -#else - ", [/* 1 var */]" -#endif +# else + ", %p /* 1 var */" +# endif ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", Q_FILENAME, q_argv[2], -#if VERBOSE +# if VERBOSE q_envp[1], -#endif +# else + tail_envp + 1, +# endif errno2name()); - char **const empty = tail_alloc(sizeof(*empty)); + TAIL_ALLOC_OBJECT_CONST_PTR(char *, empty); char **const efault = empty + 1; *empty = NULL; syscall(__NR_execveat, -100, FILENAME, empty, empty, 0x1100); printf("execveat(AT_FDCWD, \"%s\", []" -#if VERBOSE +# if VERBOSE ", []" -#else - ", [/* 0 vars */]" -#endif +# else + ", %p /* 0 vars */" +# endif ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", - Q_FILENAME, errno2name()); + Q_FILENAME, +# if !VERBOSE + empty, +# endif + errno2name()); + + char *const str_a = tail_alloc(DEFAULT_STRLEN + 2); + fill_memory_ex(str_a, DEFAULT_STRLEN + 1, '0', 10); + str_a[DEFAULT_STRLEN + 1] = '\0'; + + char *const str_b = tail_alloc(DEFAULT_STRLEN + 2); + fill_memory_ex(str_b, DEFAULT_STRLEN + 1, '_', 32); + str_b[DEFAULT_STRLEN + 1] = '\0'; - char str_a[] = "012345678901234567890123456789012"; - char str_b[] = "_abcdefghijklmnopqrstuvwxyz()[]{}"; -#define DEFAULT_STRLEN ((unsigned int) sizeof(str_a) - 2) char **const a = tail_alloc(sizeof(*a) * (DEFAULT_STRLEN + 2)); char **const b = tail_alloc(sizeof(*b) * (DEFAULT_STRLEN + 2)); unsigned int i; @@ -138,33 +136,35 @@ main(void) printf("execveat(AT_FDCWD, \"%s\", [\"%.*s\"...", Q_FILENAME, DEFAULT_STRLEN, a[0]); for (i = 1; i < DEFAULT_STRLEN; ++i) printf(", \"%s\"", a[i]); -#if VERBOSE +# if VERBOSE printf(", \"%s\"", a[i]); -#else +# else printf(", ..."); -#endif -#if VERBOSE +# endif +# if VERBOSE printf("], [\"%.*s\"...", DEFAULT_STRLEN, b[0]); for (i = 1; i <= DEFAULT_STRLEN; ++i) printf(", \"%s\"", b[i]); -#else - printf("], [/* %u vars */", DEFAULT_STRLEN + 1); -#endif - printf("], AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + printf("]"); +# else + printf("], %p /* %u vars */", b, DEFAULT_STRLEN + 1); +# endif + printf(", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", errno2name()); syscall(__NR_execveat, -100, FILENAME, a + 1, b + 1, 0x1100); printf("execveat(AT_FDCWD, \"%s\", [\"%s\"", Q_FILENAME, a[1]); for (i = 2; i <= DEFAULT_STRLEN; ++i) printf(", \"%s\"", a[i]); -#if VERBOSE +# if VERBOSE printf("], [\"%s\"", b[1]); for (i = 2; i <= DEFAULT_STRLEN; ++i) printf(", \"%s\"", b[i]); -#else - printf("], [/* %d vars */", DEFAULT_STRLEN); -#endif - printf("], AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + printf("]"); +# else + printf("], %p /* %d vars */", b + 1, DEFAULT_STRLEN); +# endif + printf(", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", errno2name()); syscall(__NR_execveat, -100, FILENAME, NULL, efault, 0x1100); diff --git a/tests-m32/execveat.gen.test b/tests-m32/execveat.gen.test new file mode 100755 index 00000000..180b8299 --- /dev/null +++ b/tests-m32/execveat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (execveat ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/execveat.test b/tests-m32/execveat.test deleted file mode 100755 index 879e03e2..00000000 --- a/tests-m32/execveat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check execveat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/faccessat.c b/tests-m32/faccessat.c index ce81349d..6d95555a 100644 --- a/tests-m32/faccessat.c +++ b/tests-m32/faccessat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/faccessat.gen.test b/tests-m32/faccessat.gen.test new file mode 100755 index 00000000..4ccec2aa --- /dev/null +++ b/tests-m32/faccessat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (faccessat -P $NAME.sample); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -P $NAME.sample diff --git a/tests-m32/faccessat.test b/tests-m32/faccessat.test deleted file mode 100755 index 61e7e2fd..00000000 --- a/tests-m32/faccessat.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check faccessat syscall decoding. - -. "${srcdir=.}/openat.test" diff --git a/tests-m32/fadvise.h b/tests-m32/fadvise.h index 7a75f73b..f8ef089b 100644 --- a/tests-m32/fadvise.h +++ b/tests-m32/fadvise.h @@ -3,33 +3,14 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef STRACE_TESTS_FADVISE_H -#define STRACE_TESTS_FADVISE_H +# define STRACE_TESTS_FADVISE_H # include # include diff --git a/tests-m32/fadvise64.c b/tests-m32/fadvise64.c index 930680be..1d7b6681 100644 --- a/tests-m32/fadvise64.c +++ b/tests-m32/fadvise64.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/fadvise64.test b/tests-m32/fadvise64.test index 9f746720..c4e1415e 100755 --- a/tests-m32/fadvise64.test +++ b/tests-m32/fadvise64.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check decoding of fadvise64 syscall. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -9,4 +14,3 @@ run_strace -e $NAME $args > "$EXP" check_prog grep grep -v "^$NAME([0123]," < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-m32/fadvise64_64.c b/tests-m32/fadvise64_64.c index c23df97f..1520b7e4 100644 --- a/tests-m32/fadvise64_64.c +++ b/tests-m32/fadvise64_64.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/fadvise64_64.gen.test b/tests-m32/fadvise64_64.gen.test new file mode 100755 index 00000000..e46bf810 --- /dev/null +++ b/tests-m32/fadvise64_64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fadvise64_64 +fadvise64.test ); do not edit. +set -- +. "${srcdir=.}/fadvise64.test" diff --git a/tests-m32/fadvise64_64.test b/tests-m32/fadvise64_64.test deleted file mode 100755 index a50fe2b9..00000000 --- a/tests-m32/fadvise64_64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of fadvise64_64 syscall. - -. "${srcdir=.}/fadvise64.test" diff --git a/tests-m32/fallocate.c b/tests-m32/fallocate.c index a31711b3..0e2284de 100644 --- a/tests-m32/fallocate.c +++ b/tests-m32/fallocate.c @@ -2,29 +2,10 @@ * Check decoding of fallocate syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/fallocate.gen.test b/tests-m32/fallocate.gen.test new file mode 100755 index 00000000..3bb5bbf0 --- /dev/null +++ b/tests-m32/fallocate.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fallocate -a18 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests-m32/fallocate.test b/tests-m32/fallocate.test deleted file mode 100755 index 405187e5..00000000 --- a/tests-m32/fallocate.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getcwd syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a18 diff --git a/tests-m32/fanotify_init.c b/tests-m32/fanotify_init.c index c14b4131..a3eeff53 100644 --- a/tests-m32/fanotify_init.c +++ b/tests-m32/fanotify_init.c @@ -2,29 +2,10 @@ * Check decoding of fanotify_init syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -60,17 +41,19 @@ int main(void) { static const struct strval flags[] = { - { (kernel_ulong_t) 0xffffffff00000000ULL, "FAN_CLASS_NOTIF" }, + { F8ILL_KULONG_MASK, "FAN_CLASS_NOTIF" }, { (kernel_ulong_t) 0xffffffff0000000cULL, "0xc /* FAN_CLASS_??? */" }, - { (kernel_ulong_t) 0xdec0deddefaced04ULL, - "FAN_CLASS_CONTENT|0xefaced00 /* FAN_??? */" }, + { (kernel_ulong_t) 0xdec0deddefacec04ULL, + "FAN_CLASS_CONTENT|0xefacec00 /* FAN_??? */" }, { (kernel_ulong_t) 0xffffffffffffffffULL, "0xc /* FAN_CLASS_??? */|FAN_CLOEXEC|FAN_NONBLOCK|" - "FAN_UNLIMITED_QUEUE|FAN_UNLIMITED_MARKS|0xffffffc0" }, + "FAN_UNLIMITED_QUEUE|FAN_UNLIMITED_MARKS|" + "FAN_ENABLE_AUDIT|FAN_REPORT_TID|FAN_REPORT_FID|" + "0xfffffc80" }, }; static const struct strval event_f_flags[] = { - { (kernel_ulong_t) 0xffffffff00000000ULL, "O_RDONLY" }, + { F8ILL_KULONG_MASK, "O_RDONLY" }, { (kernel_ulong_t) 0xdeadbeef80000001ULL, "O_WRONLY|0x80000000" } }; diff --git a/tests-m32/fanotify_init.gen.test b/tests-m32/fanotify_init.gen.test new file mode 100755 index 00000000..69807a7a --- /dev/null +++ b/tests-m32/fanotify_init.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fanotify_init ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/fanotify_init.test b/tests-m32/fanotify_init.test deleted file mode 100755 index 8d26af42..00000000 --- a/tests-m32/fanotify_init.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of fanotify_init syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/fanotify_mark-Xabbrev.c b/tests-m32/fanotify_mark-Xabbrev.c new file mode 100644 index 00000000..2dc9fa12 --- /dev/null +++ b/tests-m32/fanotify_mark-Xabbrev.c @@ -0,0 +1 @@ +#include "fanotify_mark.c" diff --git a/tests-m32/fanotify_mark-Xabbrev.gen.test b/tests-m32/fanotify_mark-Xabbrev.gen.test new file mode 100755 index 00000000..86c40340 --- /dev/null +++ b/tests-m32/fanotify_mark-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fanotify_mark-Xabbrev -a32 -Xabbrev -e trace=fanotify_mark); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -Xabbrev -e trace=fanotify_mark diff --git a/tests-m32/fanotify_mark-Xraw.c b/tests-m32/fanotify_mark-Xraw.c new file mode 100644 index 00000000..f02c886a --- /dev/null +++ b/tests-m32/fanotify_mark-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "fanotify_mark.c" diff --git a/tests-m32/fanotify_mark-Xraw.gen.test b/tests-m32/fanotify_mark-Xraw.gen.test new file mode 100755 index 00000000..5be964d0 --- /dev/null +++ b/tests-m32/fanotify_mark-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fanotify_mark-Xraw -a32 -Xraw -e trace=fanotify_mark); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -Xraw -e trace=fanotify_mark diff --git a/tests-m32/fanotify_mark-Xverbose.c b/tests-m32/fanotify_mark-Xverbose.c new file mode 100644 index 00000000..b76f46f3 --- /dev/null +++ b/tests-m32/fanotify_mark-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "fanotify_mark.c" diff --git a/tests-m32/fanotify_mark-Xverbose.gen.test b/tests-m32/fanotify_mark-Xverbose.gen.test new file mode 100755 index 00000000..ef1a99d6 --- /dev/null +++ b/tests-m32/fanotify_mark-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fanotify_mark-Xverbose -a32 -Xverbose -e trace=fanotify_mark); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -Xverbose -e trace=fanotify_mark diff --git a/tests-m32/fanotify_mark.c b/tests-m32/fanotify_mark.c index 43f285d3..33d18253 100644 --- a/tests-m32/fanotify_mark.c +++ b/tests-m32/fanotify_mark.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2015-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,6 +21,20 @@ # include # include +# if XLAT_RAW +# define str_fan_mark_add "0x1" +# define str_fan_modify_ondir "0x40000002" +# define str_at_fdcwd "-100" +# elif XLAT_VERBOSE +# define str_fan_mark_add "0x1 /* FAN_MARK_ADD */" +# define str_fan_modify_ondir "0x40000002 /* FAN_MODIFY|FAN_ONDIR */" +# define str_at_fdcwd "-100 /* AT_FDCWD */" +# else +# define str_fan_mark_add "FAN_MARK_ADD" +# define str_fan_modify_ondir "FAN_MODIFY|FAN_ONDIR" +# define str_at_fdcwd "AT_FDCWD" +# endif + /* Performs fanotify_mark call via the syscall interface. */ static void do_call(kernel_ulong_t fd, kernel_ulong_t flags, const char *flags_str, @@ -78,8 +73,8 @@ struct strval64 { const char *str; }; -#define STR16 "0123456789abcdef" -#define STR64 STR16 STR16 STR16 STR16 +# define STR16 "0123456789abcdef" +# define STR64 STR16 STR16 STR16 STR16 int main(void) @@ -90,32 +85,97 @@ main(void) static const kernel_ulong_t fds[] = { (kernel_ulong_t) 0xdeadfeed12345678ULL, - (kernel_ulong_t) 0xffffffff00000000ULL, + F8ILL_KULONG_MASK, (kernel_ulong_t) 0xdeb0d1edffffffffULL, }; static const struct strval flags[] = { - { (kernel_ulong_t) 0xffffffff00000000ULL, "0" }, - { (kernel_ulong_t) 0xdec0deddefaced00ULL, - "0xefaced00 /* FAN_MARK_??? */" }, + { F8ILL_KULONG_MASK, "0" }, + { (kernel_ulong_t) 0xdec0deddefacec00ULL, + "0xefacec00" +# if !XLAT_RAW + " /* FAN_MARK_??? */" +# endif + }, { (kernel_ulong_t) 0xda7a105700000040ULL, - "FAN_MARK_IGNORED_SURV_MODIFY" }, - { (kernel_ulong_t) 0xbadc0deddeadfeedULL, - "FAN_MARK_ADD|FAN_MARK_DONT_FOLLOW|FAN_MARK_ONLYDIR|" - "FAN_MARK_IGNORED_MASK|FAN_MARK_IGNORED_SURV_MODIFY|" - "FAN_MARK_FLUSH|0xdeadfe00" }, +# if XLAT_RAW + "0x40" +# elif XLAT_VERBOSE + "0x40 /* FAN_MARK_IGNORED_SURV_MODIFY */" +# else + "FAN_MARK_IGNORED_SURV_MODIFY" +# endif + }, + { (kernel_ulong_t) 0xbadc0deddeadffffULL, +# if XLAT_RAW || XLAT_VERBOSE + "0xdeadffff" +# endif +# if XLAT_VERBOSE + " /* " +# endif +# if !XLAT_RAW + "FAN_MARK_ADD|FAN_MARK_REMOVE|FAN_MARK_DONT_FOLLOW|" + "FAN_MARK_ONLYDIR|FAN_MARK_MOUNT|FAN_MARK_IGNORED_MASK|" + "FAN_MARK_IGNORED_SURV_MODIFY|FAN_MARK_FLUSH|" + "FAN_MARK_FILESYSTEM|0xdeadfe00" +# endif +# if XLAT_VERBOSE + " */" +# endif + }, }; static const struct strval64 masks[] = { { ARG_ULL_STR(0) }, - { 0xdeadfeedfacebeefULL, - "FAN_ACCESS|FAN_MODIFY|FAN_CLOSE_WRITE|FAN_OPEN|" - "FAN_ACCESS_PERM|FAN_ONDIR|FAN_EVENT_ON_CHILD|" - "0xdeadfeedb2ccbec4" }, - { ARG_ULL_STR(0xffffffffb7fcbfc4) " /* FAN_??? */" }, + { 0xdeadfeedffffffffULL, +# if XLAT_RAW || XLAT_VERBOSE + "0xdeadfeedffffffff" +# endif +# if XLAT_VERBOSE + " /* " +# endif +# if !XLAT_RAW + "FAN_ACCESS|" + "FAN_MODIFY|" + "FAN_ATTRIB|" + "FAN_CLOSE_WRITE|" + "FAN_CLOSE_NOWRITE|" + "FAN_OPEN|" + "FAN_MOVED_FROM|" + "FAN_MOVED_TO|" + "FAN_CREATE|" + "FAN_DELETE|" + "FAN_DELETE_SELF|" + "FAN_MOVE_SELF|" + "FAN_OPEN_EXEC|" + "FAN_Q_OVERFLOW|" + "FAN_OPEN_PERM|" + "FAN_ACCESS_PERM|" + "FAN_OPEN_EXEC_PERM|" + "FAN_ONDIR|" + "FAN_EVENT_ON_CHILD|" + "0xdeadfeedb7f8a000" +# endif +# if XLAT_VERBOSE + " */" +# endif + }, + { ARG_ULL_STR(0xffffffffb7f8a000) +# if !XLAT_RAW + " /* FAN_??? */" +# endif + }, }; static const struct strval dirfds[] = { { (kernel_ulong_t) 0xfacefeed00000001ULL, "1" }, - { (kernel_ulong_t) 0xdec0ded0ffffffffULL, "FAN_NOFD" }, - { (kernel_ulong_t) 0xbadfacedffffff9cULL, "AT_FDCWD" }, + { (kernel_ulong_t) 0xdec0ded0ffffffffULL, +# if XLAT_RAW + "-1" +# elif XLAT_VERBOSE + "-1 /* FAN_NOFD */" +# else + "FAN_NOFD" +# endif + }, + { (kernel_ulong_t) 0xbadfacedffffff9cULL, str_at_fdcwd }, { (kernel_ulong_t) 0xdefaced1beeff00dULL, "-1091571699" }, }; static const char str64[] = STR64; @@ -148,8 +208,9 @@ main(void) rc = fanotify_mark(-1, FAN_MARK_ADD, FAN_MODIFY | FAN_ONDIR, -100, "."); - printf("fanotify_mark(-1, FAN_MARK_ADD, FAN_MODIFY|FAN_ONDIR" - ", AT_FDCWD, \".\") = %s\n", sprintrc(rc)); + printf("fanotify_mark(-1, %s, %s, %s, \".\") = %s\n", + str_fan_mark_add, str_fan_modify_ondir, str_at_fdcwd, + sprintrc(rc)); for (i = 0; i < ARRAY_SIZE(fds); i++) { for (j = 0; j < ARRAY_SIZE(flags); j++) { diff --git a/tests-m32/fanotify_mark.gen.test b/tests-m32/fanotify_mark.gen.test new file mode 100755 index 00000000..46512608 --- /dev/null +++ b/tests-m32/fanotify_mark.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fanotify_mark -a32 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 diff --git a/tests-m32/fanotify_mark.test b/tests-m32/fanotify_mark.test deleted file mode 100755 index fd671387..00000000 --- a/tests-m32/fanotify_mark.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of fanotify_mark syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a32 diff --git a/tests-m32/fchdir.c b/tests-m32/fchdir.c index 3cde5e63..118e5fea 100644 --- a/tests-m32/fchdir.c +++ b/tests-m32/fchdir.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/fchdir.gen.test b/tests-m32/fchdir.gen.test new file mode 100755 index 00000000..a352a21b --- /dev/null +++ b/tests-m32/fchdir.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fchdir -a11 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 diff --git a/tests-m32/fchdir.test b/tests-m32/fchdir.test deleted file mode 100755 index 3a4296ed..00000000 --- a/tests-m32/fchdir.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check fchdir syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a11 diff --git a/tests-m32/fchmod.c b/tests-m32/fchmod.c index 932d0830..4fa06727 100644 --- a/tests-m32/fchmod.c +++ b/tests-m32/fchmod.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Fabien Siron * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/fchmod.gen.test b/tests-m32/fchmod.gen.test new file mode 100755 index 00000000..828c9b50 --- /dev/null +++ b/tests-m32/fchmod.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fchmod -a15 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests-m32/fchmod.test b/tests-m32/fchmod.test deleted file mode 100755 index 4cb12632..00000000 --- a/tests-m32/fchmod.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check fchmod syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a15 diff --git a/tests-m32/fchmodat.c b/tests-m32/fchmodat.c index c52a1cab..f2fa5dd0 100644 --- a/tests-m32/fchmodat.c +++ b/tests-m32/fchmodat.c @@ -1,30 +1,10 @@ /* * Check decoding of fchmodat syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/fchmodat.gen.test b/tests-m32/fchmodat.gen.test new file mode 100755 index 00000000..36461858 --- /dev/null +++ b/tests-m32/fchmodat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fchmodat ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/fchmodat.test b/tests-m32/fchmodat.test deleted file mode 100755 index 13cbe806..00000000 --- a/tests-m32/fchmodat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of fchmodat syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/fchown.c b/tests-m32/fchown.c index d7119032..98bfd9de 100644 --- a/tests-m32/fchown.c +++ b/tests-m32/fchown.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/fchown.gen.test b/tests-m32/fchown.gen.test new file mode 100755 index 00000000..ec7f7c54 --- /dev/null +++ b/tests-m32/fchown.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fchown -a16 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 diff --git a/tests-m32/fchown.test b/tests-m32/fchown.test deleted file mode 100755 index 63a0f2e3..00000000 --- a/tests-m32/fchown.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check fchown syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a16 diff --git a/tests-m32/fchown32.c b/tests-m32/fchown32.c index 2d9d60f8..9d52f9a8 100644 --- a/tests-m32/fchown32.c +++ b/tests-m32/fchown32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/fchown32.gen.test b/tests-m32/fchown32.gen.test new file mode 100755 index 00000000..16705832 --- /dev/null +++ b/tests-m32/fchown32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fchown32 -a18 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests-m32/fchown32.test b/tests-m32/fchown32.test deleted file mode 100755 index e837f54e..00000000 --- a/tests-m32/fchown32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check fchown32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a18 diff --git a/tests-m32/fchownat.c b/tests-m32/fchownat.c index f2f37ae3..32167bc7 100644 --- a/tests-m32/fchownat.c +++ b/tests-m32/fchownat.c @@ -1,30 +1,10 @@ /* * Check decoding of fchownat syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/fchownat.gen.test b/tests-m32/fchownat.gen.test new file mode 100755 index 00000000..54bd0430 --- /dev/null +++ b/tests-m32/fchownat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fchownat ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/fchownat.test b/tests-m32/fchownat.test deleted file mode 100755 index e5d0f285..00000000 --- a/tests-m32/fchownat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of fchownat syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/fcntl-common.c b/tests-m32/fcntl-common.c new file mode 100644 index 00000000..b2125171 --- /dev/null +++ b/tests-m32/fcntl-common.c @@ -0,0 +1,379 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include +#include +#include +#include +#include +#include +#include "flock.h" + +#define FILE_LEN 4096 + +#define TEST_FLOCK_EINVAL(cmd) test_flock_einval(cmd, #cmd) +#define TEST_FLOCK64_EINVAL(cmd) test_flock64_einval(cmd, #cmd) + +#ifdef HAVE_TYPEOF +# define TYPEOF_FLOCK_OFF_T typeof(((struct_kernel_flock *) NULL)->l_len) +#else +# define TYPEOF_FLOCK_OFF_T off_t +#endif + +static const char *errstr; + +static long +invoke_test_syscall(const unsigned int fd, const unsigned int cmd, void *const p) +{ + const kernel_ulong_t kfd = F8ILL_KULONG_MASK | fd; + const kernel_ulong_t op = F8ILL_KULONG_MASK | cmd; + + long rc = syscall(TEST_SYSCALL_NR, kfd, op, (uintptr_t) p); + errstr = sprintrc(rc); + return rc; +} + +static void +test_flock_einval(const int cmd, const char *name) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct_kernel_flock, fl); + memset(fl, 0, sizeof(*fl)); + fl->l_type = F_RDLCK; + fl->l_start = (TYPEOF_FLOCK_OFF_T) 0xdefaced1facefeedULL; + fl->l_len = (TYPEOF_FLOCK_OFF_T) 0xdefaced2cafef00dULL; + + invoke_test_syscall(0, cmd, fl); + printf("%s(0, %s, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=%jd, l_len=%jd}) = %s\n", TEST_SYSCALL_STR, name, + (intmax_t) fl->l_start, (intmax_t) fl->l_len, errstr); + + void *const bad_addr = (void *) fl + 1; + invoke_test_syscall(0, cmd, bad_addr); + printf("%s(0, %s, %p) = %s\n", + TEST_SYSCALL_STR, name, bad_addr, errstr); +} + +/* + * This function is not declared static to avoid potential + * "defined but not used" warning when included by fcntl.c + */ +void +test_flock64_einval(const int cmd, const char *name) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct_kernel_flock64, fl); + memset(fl, 0, sizeof(*fl)); + fl->l_type = F_RDLCK; + fl->l_start = (TYPEOF_FLOCK_OFF_T) 0xdefaced1facefeedULL; + fl->l_len = (TYPEOF_FLOCK_OFF_T) 0xdefaced2cafef00dULL; + + invoke_test_syscall(0, cmd, fl); + printf("%s(0, %s, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=%jd, l_len=%jd}) = %s\n", TEST_SYSCALL_STR, name, + (intmax_t) fl->l_start, (intmax_t) fl->l_len, errstr); + + void *const bad_addr = (void *) fl + 1; + invoke_test_syscall(0, cmd, bad_addr); + printf("%s(0, %s, %p) = %s\n", + TEST_SYSCALL_STR, name, bad_addr, errstr); +} + +static void +test_flock(void) +{ + TEST_FLOCK_EINVAL(F_SETLK); + TEST_FLOCK_EINVAL(F_SETLKW); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct_kernel_flock, fl); + memset(fl, 0, sizeof(*fl)); + fl->l_type = F_RDLCK; + fl->l_len = FILE_LEN; + + long rc = invoke_test_syscall(0, F_SETLK, fl); + printf("%s(0, F_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = %s\n", + TEST_SYSCALL_STR, FILE_LEN, errstr); + if (rc) + return; + + invoke_test_syscall(0, F_GETLK, fl); + printf("%s(0, F_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d, l_pid=0}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); + + invoke_test_syscall(0, F_SETLKW, fl); + printf("%s(0, F_SETLKW, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); +} + +static void +test_flock64_ofd(void) +{ +#if defined F_OFD_GETLK && defined F_OFD_SETLK && defined F_OFD_SETLKW + TEST_FLOCK64_EINVAL(F_OFD_SETLK); + TEST_FLOCK64_EINVAL(F_OFD_SETLKW); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct_kernel_flock64, fl); + memset(fl, 0, sizeof(*fl)); + fl->l_type = F_RDLCK; + fl->l_len = FILE_LEN; + + long rc = invoke_test_syscall(0, F_OFD_SETLK, fl); + printf("%s(0, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = %s\n", + TEST_SYSCALL_STR, FILE_LEN, errstr); + if (rc) + return; + + invoke_test_syscall(0, F_OFD_GETLK, fl); + printf("%s(0, F_OFD_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d, l_pid=0}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); + + invoke_test_syscall(0, F_OFD_SETLKW, fl); + printf("%s(0, F_OFD_SETLKW, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); +#endif /* F_OFD_GETLK && F_OFD_SETLK && F_OFD_SETLKW */ +} + +static void test_flock64_lk64(void); + +static void +test_flock64(void) +{ + test_flock64_ofd(); + test_flock64_lk64(); +} + +/* + * F_[GS]ETOWN_EX had conflicting values with F_[SG]ETLK64 + * in kernel revisions v2.6.32-rc1~96..v2.6.32-rc7~23. + */ +#undef TEST_F_OWNER_EX +#if defined F_GETOWN_EX && defined F_SETOWN_EX \ + && (F_GETOWN_EX != F_SETLK64) && (F_SETOWN_EX != F_GETLK64) +# define TEST_F_OWNER_EX +#endif + +#ifdef TEST_F_OWNER_EX +# include "f_owner_ex.h" + +static long +test_f_owner_ex_type_pid(const int cmd, const char *const cmd_name, + const int type, const char *const type_name, + pid_t pid) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct_kernel_f_owner_ex, fo); + + fo->type = type; + fo->pid = pid; + long rc = invoke_test_syscall(0, cmd, fo); + printf("%s(0, %s, {type=%s, pid=%d}) = %s\n", + TEST_SYSCALL_STR, cmd_name, type_name, fo->pid, errstr); + + void *bad_addr = (void *) fo + 1; + invoke_test_syscall(0, cmd, bad_addr); + printf("%s(0, %s, %p) = %s\n", + TEST_SYSCALL_STR, cmd_name, bad_addr, errstr); + + return rc; +} + +static void +test_f_owner_ex_umove_or_printaddr(const int type, const char *const type_name, + pid_t pid) +{ + long rc = test_f_owner_ex_type_pid(ARG_STR(F_SETOWN_EX), + type, type_name, pid); + if (!rc) + test_f_owner_ex_type_pid(ARG_STR(F_GETOWN_EX), + type, type_name, pid); +} + +static void +test_f_owner_ex(void) +{ + static const struct { + int type; + const char *type_name; + pid_t pid[2]; + } a[] = { + { ARG_STR(F_OWNER_TID), { 1234567890, 20 } }, + { ARG_STR(F_OWNER_PID), { 1298126790, 30 } }, + { ARG_STR(F_OWNER_PGRP), { 1294567890, 40 } } + }; + + for (unsigned int i = 0; i < ARRAY_SIZE(a); i++) { + for (unsigned int j = 0; j < ARRAY_SIZE(a[0].pid); j++) { + test_f_owner_ex_umove_or_printaddr(a[i].type, + a[i].type_name, + a[i].pid[j]); + } + } +} +#endif /* TEST_F_OWNER_EX */ + +struct fcntl_cmd_check { + int fd; + int cmd; + const char *cmd_str; + long arg; + const char *arg_str; + void (*print_flags)(long rc); +}; + +static void +print_retval_flags(const struct fcntl_cmd_check *check, long rc) +{ + if (check->print_flags) { + check->print_flags(rc); + } else { + printf("%s", errstr); + } + printf("\n"); +} + +static void +test_other_set_cmd(const struct fcntl_cmd_check *check) +{ + invoke_test_syscall(check->fd, check->cmd, (void *) check->arg); + printf("%s(%d, %s, %s) = %s\n", + TEST_SYSCALL_STR, check->fd, + check->cmd_str, check->arg_str, errstr); + + /* bad file fd */ + invoke_test_syscall(-1, check->cmd, (void *) check->arg); + printf("%s(-1, %s, %s) = %s\n", + TEST_SYSCALL_STR, check->cmd_str, + check->arg_str, errstr); +} + +static void +test_other_get_cmd(const struct fcntl_cmd_check *check) +{ + long rc = invoke_test_syscall(check->fd, check->cmd, NULL); + printf("%s(%d, %s) = ", + TEST_SYSCALL_STR, check->fd, check->cmd_str); + print_retval_flags(check, rc); + + /* bad file fd */ + invoke_test_syscall(-1, check->cmd, NULL); + printf("%s(-1, %s) = %s\n", + TEST_SYSCALL_STR, check->cmd_str, errstr); +} + +static void +print_flags_getfd(long rc) +{ + assert(rc >= 0); + printf("%#lx%s", rc, rc & 1 ? " (flags FD_CLOEXEC)" : ""); +} + +static void +print_flags_getsig(long rc) +{ + assert(rc >= 0); + + if (!rc) { + printf("%ld", rc); + } else { + printf("%ld (%s)", rc, signal2name((int) rc)); + } +} + +static void +print_flags_getlease(long rc) +{ + assert(rc >= 0); + const char *text; + + switch (rc) { + case F_RDLCK: + text = "F_RDLCK"; + break; + case F_WRLCK: + text = "F_WRLCK"; + break; + case F_UNLCK: + text = "F_UNLCK"; + break; + default: + error_msg_and_fail("fcntl returned %#lx, does the" + " test have to be updated?", rc); + } + printf("%#lx (%s)", rc, text); +} + +static void +test_fcntl_others(void) +{ + static const struct fcntl_cmd_check set_checks[] = { + { 0, ARG_STR(F_SETFD), ARG_STR(FD_CLOEXEC) }, + { 0, ARG_STR(F_SETOWN), ARG_STR(20) }, +#ifdef F_SETPIPE_SZ + { 0, ARG_STR(F_SETPIPE_SZ), ARG_STR(4097) }, +#endif + { 0, ARG_STR(F_DUPFD), ARG_STR(0) }, +#ifdef F_DUPFD_CLOEXEC + { 0, ARG_STR(F_DUPFD_CLOEXEC), ARG_STR(0) }, +#endif + { 0, ARG_STR(F_SETFL), ARG_STR(O_RDWR|O_LARGEFILE) }, + { 0, ARG_STR(F_NOTIFY), ARG_STR(DN_ACCESS) }, + { 1, ARG_STR(F_SETLEASE), ARG_STR(F_RDLCK) }, + { 0, ARG_STR(F_SETSIG), 0, "0" }, + { 1, ARG_STR(F_SETSIG), 1, "SIGHUP" } + }; + for (unsigned int i = 0; i < ARRAY_SIZE(set_checks); i++) { + test_other_set_cmd(set_checks + i); + } + + static const struct fcntl_cmd_check get_checks[] = { + { 0, ARG_STR(F_GETFD), .print_flags = print_flags_getfd }, + { 1, ARG_STR(F_GETFD), .print_flags = print_flags_getfd }, + { 0, ARG_STR(F_GETOWN) }, +#ifdef F_GETPIPE_SZ + { 0, ARG_STR(F_GETPIPE_SZ) }, +#endif + { 1, ARG_STR(F_GETLEASE), .print_flags = print_flags_getlease }, + { 0, ARG_STR(F_GETSIG), .print_flags = print_flags_getsig }, + { 1, ARG_STR(F_GETSIG), .print_flags = print_flags_getsig } + }; + for (unsigned int j = 0; j < ARRAY_SIZE(get_checks); j++) { + test_other_get_cmd(get_checks + j); + } +} + +static void +create_sample(void) +{ + char fname[] = TEST_SYSCALL_STR "_XXXXXX"; + + (void) close(0); + if (mkstemp(fname)) + perror_msg_and_fail("mkstemp: %s", fname); + if (unlink(fname)) + perror_msg_and_fail("unlink: %s", fname); + if (ftruncate(0, FILE_LEN)) + perror_msg_and_fail("ftruncate"); +} + +int +main(void) +{ + create_sample(); + test_flock(); + test_flock64(); +#ifdef TEST_F_OWNER_EX + test_f_owner_ex(); +#endif + test_fcntl_others(); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/fcntl.c b/tests-m32/fcntl.c index f060cdf8..bd9ffbdd 100644 --- a/tests-m32/fcntl.c +++ b/tests-m32/fcntl.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,51 +13,40 @@ # define TEST_SYSCALL_NR __NR_fcntl # define TEST_SYSCALL_STR "fcntl" -# include "struct_flock.c" - -# define TEST_FLOCK64_EINVAL(cmd) test_flock64_einval(cmd, #cmd) +# include "fcntl-common.c" static void -test_flock64_einval(const int cmd, const char *name) +test_flock64_undecoded(const int cmd, const char *name) { struct_kernel_flock64 fl = { .l_type = F_RDLCK, .l_start = 0xdefaced1facefeedULL, .l_len = 0xdefaced2cafef00dULL }; - invoke_test_syscall(cmd, &fl); + invoke_test_syscall(0, cmd, &fl); printf("%s(0, %s, %p) = %s\n", - TEST_SYSCALL_STR, name, &fl, EINVAL_STR); + TEST_SYSCALL_STR, name, &fl, errstr); } +# define TEST_FLOCK64_UNDECODED(cmd) test_flock64_undecoded(cmd, #cmd) + static void -test_flock64(void) +test_flock64_lk64(void) { /* * F_[GS]ETOWN_EX had conflicting values with F_[GS]ETLK64 * in kernel revisions v2.6.32-rc1~96..v2.6.32-rc7~23. */ -#if !defined(F_GETOWN_EX) || F_GETOWN_EX != F_SETLK64 - TEST_FLOCK64_EINVAL(F_SETLK64); -#endif +# if !defined(F_GETOWN_EX) || F_GETOWN_EX != F_SETLK64 + TEST_FLOCK64_UNDECODED(F_SETLK64); +# endif /* F_GETLK and F_SETLKW64 have conflicting values on mips64 */ -#if !defined(__mips64) || F_GETLK != F_SETLKW64 - TEST_FLOCK64_EINVAL(F_SETLKW64); -#endif -#if !defined(F_SETOWN_EX) || F_SETOWN_EX != F_GETLK64 - TEST_FLOCK64_EINVAL(F_GETLK64); -#endif -} - -int -main(void) -{ - create_sample(); - test_flock(); - test_flock64(); - - puts("+++ exited with 0 +++"); - return 0; +# if !defined(__mips64) || F_GETLK != F_SETLKW64 + TEST_FLOCK64_UNDECODED(F_SETLKW64); +# endif +# if !defined(F_SETOWN_EX) || F_SETOWN_EX != F_GETLK64 + TEST_FLOCK64_UNDECODED(F_GETLK64); +# endif } #else diff --git a/tests-m32/fcntl.gen.test b/tests-m32/fcntl.gen.test new file mode 100755 index 00000000..9de26c00 --- /dev/null +++ b/tests-m32/fcntl.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fcntl -a8 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 diff --git a/tests-m32/fcntl.test b/tests-m32/fcntl.test deleted file mode 100755 index 9aea122d..00000000 --- a/tests-m32/fcntl.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check fcntl decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a8 diff --git a/tests-m32/fcntl64.c b/tests-m32/fcntl64.c index 5ecd6eb9..97277b2f 100644 --- a/tests-m32/fcntl64.c +++ b/tests-m32/fcntl64.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,68 +13,38 @@ # define TEST_SYSCALL_NR __NR_fcntl64 # define TEST_SYSCALL_STR "fcntl64" -# include "struct_flock.c" - -# define TEST_FLOCK64_EINVAL(cmd) test_flock64_einval(cmd, #cmd) - -static void -test_flock64_einval(const int cmd, const char *name) -{ - struct_kernel_flock64 fl = { - .l_type = F_RDLCK, - .l_start = 0xdefaced1facefeedULL, - .l_len = 0xdefaced2cafef00dULL - }; - invoke_test_syscall(cmd, &fl); - printf("%s(0, %s, {l_type=F_RDLCK, l_whence=SEEK_SET" - ", l_start=%jd, l_len=%jd}) = %s\n", TEST_SYSCALL_STR, name, - (intmax_t) fl.l_start, (intmax_t) fl.l_len, EINVAL_STR); -} +# include "fcntl-common.c" static void -test_flock64(void) +test_flock64_lk64(void) { TEST_FLOCK64_EINVAL(F_SETLK64); TEST_FLOCK64_EINVAL(F_SETLKW64); -# ifdef F_OFD_SETLK - TEST_FLOCK64_EINVAL(F_OFD_SETLK); - TEST_FLOCK64_EINVAL(F_OFD_SETLKW); -# endif - struct_kernel_flock64 fl = { - .l_type = F_RDLCK, - .l_len = FILE_LEN - }; - long rc = invoke_test_syscall(F_SETLK64, &fl); + TAIL_ALLOC_OBJECT_CONST_PTR(struct_kernel_flock64, fl); + memset(fl, 0, sizeof(*fl)); + fl->l_type = F_RDLCK; + fl->l_len = FILE_LEN; + + long rc = invoke_test_syscall(0, F_SETLK64, fl); printf("%s(0, F_SETLK64, {l_type=F_RDLCK, l_whence=SEEK_SET" ", l_start=0, l_len=%d}) = %s\n", - TEST_SYSCALL_STR, FILE_LEN, rc ? EINVAL_STR : "0"); + TEST_SYSCALL_STR, FILE_LEN, errstr); if (rc) return; - invoke_test_syscall(F_GETLK64, &fl); + invoke_test_syscall(0, F_GETLK64, fl); printf("%s(0, F_GETLK64, {l_type=F_UNLCK, l_whence=SEEK_SET" ", l_start=0, l_len=%d, l_pid=0}) = 0\n", TEST_SYSCALL_STR, FILE_LEN); - invoke_test_syscall(F_SETLK64, &fl); - printf("%s(0, F_SETLK64, {l_type=F_UNLCK, l_whence=SEEK_SET" + invoke_test_syscall(0, F_SETLKW64, fl); + printf("%s(0, F_SETLKW64, {l_type=F_UNLCK, l_whence=SEEK_SET" ", l_start=0, l_len=%d}) = 0\n", TEST_SYSCALL_STR, FILE_LEN); } -int -main(void) -{ - create_sample(); - test_flock(); - test_flock64(); - - puts("+++ exited with 0 +++"); - return 0; -} - #else SKIP_MAIN_UNDEFINED("__NR_fcntl64") diff --git a/tests-m32/fcntl64.gen.test b/tests-m32/fcntl64.gen.test new file mode 100755 index 00000000..fee01b66 --- /dev/null +++ b/tests-m32/fcntl64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fcntl64 -a8 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 diff --git a/tests-m32/fcntl64.test b/tests-m32/fcntl64.test deleted file mode 100755 index 00ba671a..00000000 --- a/tests-m32/fcntl64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check fcntl64 syscall decoding. - -. "${srcdir=.}/fcntl.test" diff --git a/tests-m32/fdatasync.c b/tests-m32/fdatasync.c index fc82ade3..f4c8d55f 100644 --- a/tests-m32/fdatasync.c +++ b/tests-m32/fdatasync.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/fdatasync.gen.test b/tests-m32/fdatasync.gen.test new file mode 100755 index 00000000..9aa5f2a6 --- /dev/null +++ b/tests-m32/fdatasync.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fdatasync -a14 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests-m32/fdatasync.test b/tests-m32/fdatasync.test deleted file mode 100755 index ff59749f..00000000 --- a/tests-m32/fdatasync.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check fdatasync syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a14 diff --git a/tests-m32/fflush.c b/tests-m32/fflush.c new file mode 100644 index 00000000..e14ee195 --- /dev/null +++ b/tests-m32/fflush.c @@ -0,0 +1,22 @@ +/* + * Check fflush error diagnostics. + * + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include + +int +main(void) +{ + errno = ENOSPC; + printf("%s: /dev/full: %m\n", getenv("STRACE_EXE") ?: "strace"); + return 0; +} diff --git a/tests-m32/fflush.test b/tests-m32/fflush.test new file mode 100755 index 00000000..b0186497 --- /dev/null +++ b/tests-m32/fflush.test @@ -0,0 +1,21 @@ +#!/bin/sh -efu +# +# Check fflush error diagnostics. +# +# Copyright (c) 2011-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +args="-o /dev/full -e trace=none $args" + +$STRACE $args > "$EXP" 2> "$LOG" || { + msg="$STRACE $args failed with code $?" + cat "$LOG" >&2 + fail_ "$msg" +} + +match_diff "$LOG" "$EXP" diff --git a/tests-m32/file_handle.c b/tests-m32/file_handle.c index a5ad6c73..38cd5af8 100644 --- a/tests-m32/file_handle.c +++ b/tests-m32/file_handle.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -38,7 +19,6 @@ # include # include # include -# include # include enum assert_rc { @@ -157,8 +137,8 @@ struct strval { const char *str; }; -#define STR16 "0123456789abcdef" -#define STR64 STR16 STR16 STR16 STR16 +# define STR16 "0123456789abcdef" +# define STR64 STR16 STR16 STR16 STR16 int main(void) @@ -187,7 +167,7 @@ main(void) (kernel_ulong_t) 0x12345678ffffff9cULL, }; static const struct strval open_flags[] = { - { (kernel_ulong_t) 0xffffffff00000000ULL, "O_RDONLY" }, + { F8ILL_KULONG_MASK, "O_RDONLY" }, { (kernel_ulong_t) 0xdeadbeef80000001ULL, "O_WRONLY|0x80000000" } }; @@ -208,7 +188,7 @@ main(void) tail_alloc(sizeof(struct file_handle) + 128); struct file_handle *handle_256 = tail_alloc(sizeof(struct file_handle) + 256); - int *bogus_mount_id = tail_alloc(sizeof(*bogus_mount_id)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, bogus_mount_id); char handle_0_addr[sizeof("0x") + sizeof(void *) * 2]; diff --git a/tests-m32/file_handle.gen.test b/tests-m32/file_handle.gen.test new file mode 100755 index 00000000..8280f9f4 --- /dev/null +++ b/tests-m32/file_handle.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (file_handle -e trace=name_to_handle_at,open_by_handle_at); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=name_to_handle_at,open_by_handle_at diff --git a/tests-m32/file_handle.test b/tests-m32/file_handle.test deleted file mode 100755 index 1ccc9d45..00000000 --- a/tests-m32/file_handle.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check name_to_handle_at and open_by_handle_at syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=name_to_handle_at,open_by_handle_at diff --git a/tests-m32/file_ioctl.c b/tests-m32/file_ioctl.c index 0fe17b15..7a2a905c 100644 --- a/tests-m32/file_ioctl.c +++ b/tests-m32/file_ioctl.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #ifdef HAVE_LINUX_FIEMAP_H @@ -13,7 +20,7 @@ static void test_fiemap(void) { (void) tail_alloc(1); - struct fiemap *const args = tail_alloc(sizeof(*args)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct fiemap, args); printf("ioctl(-1, FS_IOC_FIEMAP, {fm_start=%" PRI__u64 ", fm_length=%" PRI__u64", fm_flags=", diff --git a/tests-m32/file_ioctl.gen.test b/tests-m32/file_ioctl.gen.test new file mode 100755 index 00000000..0abab81a --- /dev/null +++ b/tests-m32/file_ioctl.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (file_ioctl +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/file_ioctl.test b/tests-m32/file_ioctl.test deleted file mode 100755 index 7b8b8ce8..00000000 --- a/tests-m32/file_ioctl.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check FS_IOC_FIEMAP ioctl decoding. - -. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/fill_memory.c b/tests-m32/fill_memory.c index a0aeccba..3e09d597 100644 --- a/tests-m32/fill_memory.c +++ b/tests-m32/fill_memory.c @@ -1,8 +1,15 @@ +/* + * Copyright (c) 2016-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" void fill_memory_ex(void *ptr, size_t size, unsigned char start, - unsigned char period) + unsigned int period) { unsigned char *p = ptr; size_t i; diff --git a/tests-m32/filter-unavailable.c b/tests-m32/filter-unavailable.c index 6368b2cb..de920753 100644 --- a/tests-m32/filter-unavailable.c +++ b/tests-m32/filter-unavailable.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/filter-unavailable.test b/tests-m32/filter-unavailable.test index 15a9ad1d..8e7e67ee 100755 --- a/tests-m32/filter-unavailable.test +++ b/tests-m32/filter-unavailable.test @@ -1,6 +1,11 @@ #!/bin/sh - -# check that syscalls are filtered properly +# +# Check that syscalls are filtered properly. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests-m32/filtering_fd-syntax.test b/tests-m32/filtering_fd-syntax.test new file mode 100755 index 00000000..53bf1b1c --- /dev/null +++ b/tests-m32/filtering_fd-syntax.test @@ -0,0 +1,40 @@ +#!/bin/sh +# +# Check descriptor set parsing syntax. +# +# Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/syntax.sh" + +check_fd_qualify() +{ + check_e "invalid descriptor '$1'" -e"read=$2" + check_e "invalid descriptor '$1'" -e "read=$2" + check_e "invalid descriptor '$1'" -e"write=$2" + check_e "invalid descriptor '$1'" -e "write=$2" +} + +for arg in '' , ,, ,,, ; do + check_fd_qualify "$arg" "$arg" + check_fd_qualify "!$arg" "!$arg" +done + +for arg in -1 -42 \ + not_fd \ + 2147483648 \ + 4294967296 \ + ; do + check_fd_qualify "$arg" "$arg" + check_fd_qualify "$arg" "1,$arg" + check_fd_qualify "$arg" "$arg,1" + check_fd_qualify "$arg" "!$arg" +done + +for arg in ! all none; do + check_fd_qualify "$arg" "1,$arg" + check_fd_qualify "!$arg" "1,!$arg" +done diff --git a/tests-m32/filtering_syscall-syntax.test b/tests-m32/filtering_syscall-syntax.test new file mode 100755 index 00000000..fe42edbe --- /dev/null +++ b/tests-m32/filtering_syscall-syntax.test @@ -0,0 +1,101 @@ +#!/bin/sh +# +# Check syscall set parsing syntax. +# +# Copyright (c) 2016-2018 Dmitry V. Levin +# Copyright (c) 2017 Nikolay Marchuk +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/syntax.sh" + +check_syscall() +{ + [ -z "$2" ] || check_e "invalid system call '$1'" -e"$2" + + check_e "invalid system call '$1'" -e "$2" + check_e "invalid system call '$1'" -etrace="$2" + check_e "invalid system call '$1'" -e trace="$2" + + check_e "invalid system call '$1'" -eabbrev="$2" + check_e "invalid system call '$1'" -e abbrev="$2" + + check_e "invalid system call '$1'" -everbose="$2" + check_e "invalid system call '$1'" -e verbose="$2" + + check_e "invalid system call '$1'" -eraw="$2" + check_e "invalid system call '$1'" -e raw="$2" + + check_e "invalid system call '$1'" -einject="$2" + check_e "invalid system call '$1'" -e inject="$2" + check_e "invalid system call '$1'" -einject="$2:" + check_e "invalid system call '$1'" -einject="$2::" + check_e "invalid system call '$1'" -einject="$2:::" + check_e "invalid system call '$1'" -e inject="$2:" + check_e "invalid system call '$1'" -e inject="$2::" + check_e "invalid system call '$1'" -e inject="$2:::" + check_e "invalid system call '$1'" -einject="$2:when=3" + check_e "invalid system call '$1'" -e inject="$2:when=3" + + check_e "invalid system call '$1'" -efault="$2" + check_e "invalid system call '$1'" -e fault="$2" + check_e "invalid system call '$1'" -efault="$2:" + check_e "invalid system call '$1'" -efault="$2::" + check_e "invalid system call '$1'" -efault="$2:::" + check_e "invalid system call '$1'" -e fault="$2:" + check_e "invalid system call '$1'" -e fault="$2::" + check_e "invalid system call '$1'" -e fault="$2:::" + check_e "invalid system call '$1'" -efault="$2:when=4" + check_e "invalid system call '$1'" -e fault="$2:when=4" +} + +for arg in '' , ,, ,,, ; do + check_syscall "$arg" "$arg" + check_syscall "!$arg" "!$arg" +done + +for arg in -1 -2 -3 -4 -5 \ + invalid_syscall_name \ + 0x 0y \ + 32767 \ + 2147483647 \ + 2147483648 \ + 4294967295 \ + 4294967296 \ + /non_syscall \ + % %not_a_class \ + ; do + check_syscall "$arg" "$arg" + check_syscall "$arg" "!$arg" + check_syscall "$arg" "1,$arg" +done + +for arg in '!chdir' none all; do + check_syscall "$arg" "1,$arg" +done + +# invalid syscall, multiple syscalls +for arg in %desc \ + %file \ + %memory \ + %process \ + %network \ + chdir \ + 1 \ + ?32767 \ + ?invalid \ + ?%not_a_class \ + ?/non_syscall \ + ; do + check_syscall nonsense "$arg,nonsense" + check_syscall nonsense "!$arg,nonsense" + check_syscall nonsense "nonsense,$arg" + check_syscall nonsense "!nonsense,$arg" +done + +check_e_using_grep 'regcomp: \+id: [[:alpha:]].+' -e trace='/+id' +check_e_using_grep 'regcomp: \*id: [[:alpha:]].+' -e trace='/*id' +check_e_using_grep 'regcomp: \{id: [[:alpha:]].+' -e trace='/{id' +check_e_using_grep 'regcomp: \(id: [[:alpha:]].+' -e trace='/(id' +check_e_using_grep 'regcomp: \[id: [[:alpha:]].+' -e trace='/[id' diff --git a/tests-m32/finit_module.c b/tests-m32/finit_module.c index 3f0178f7..64e6df02 100644 --- a/tests-m32/finit_module.c +++ b/tests-m32/finit_module.c @@ -2,29 +2,10 @@ * Check decoding of finit_module syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -68,7 +49,8 @@ main(void) fill_memory_ex(bogus_param1, PARAM1_LEN, PARAM1_BASE, PARAM1_LEN); fill_memory_ex(bogus_param2, PARAM2_LEN, PARAM2_BASE, PARAM2_LEN); - rc = syscall(__NR_finit_module, bogus_zero, NULL, bogus_zero); + rc = syscall(__NR_finit_module, F8ILL_KULONG_MASK, NULL, + F8ILL_KULONG_MASK); printf("finit_module(0, NULL, 0) = %s\n", sprintrc(rc)); rc = syscall(__NR_finit_module, bogus_fd, bogus_param1, flags[0].val); diff --git a/tests-m32/finit_module.gen.test b/tests-m32/finit_module.gen.test new file mode 100755 index 00000000..5ffafd32 --- /dev/null +++ b/tests-m32/finit_module.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (finit_module -a25 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests-m32/finit_module.test b/tests-m32/finit_module.test deleted file mode 100755 index bd644f38..00000000 --- a/tests-m32/finit_module.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of finit_module syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a25 diff --git a/tests-m32/first_exec_failure.test b/tests-m32/first_exec_failure.test new file mode 100755 index 00000000..175b084b --- /dev/null +++ b/tests-m32/first_exec_failure.test @@ -0,0 +1,30 @@ +#!/bin/sh +# +# Check error diagnostics when the first exec fails. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +$STRACE / 2> "$LOG" && + dump_log_and_fail_with \ + "$STRACE / failed to handle the error properly" + +check_prog head +check_prog tail + +head -n1 < "$LOG" > "$OUT" +cat > "$EXP" <<__EOF__ +execve\("/", \["/"\], 0x[[:xdigit:]]+ /\* [[:digit:]]+ vars \*/\) += -1 EACCES \(Permission denied\) +__EOF__ +match_grep "$OUT" "$EXP" + +tail -n +2 < "$LOG" > "$OUT" +cat > "$EXP" <<__EOF__ +$STRACE_EXE: exec: Permission denied ++++ exited with 1 +++ +__EOF__ +match_diff "$OUT" "$EXP" diff --git a/tests-m32/flock.c b/tests-m32/flock.c index c154e437..4f044409 100644 --- a/tests-m32/flock.c +++ b/tests-m32/flock.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/flock.gen.test b/tests-m32/flock.gen.test new file mode 100755 index 00000000..67a9d8c6 --- /dev/null +++ b/tests-m32/flock.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (flock -a19 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests-m32/flock.test b/tests-m32/flock.test deleted file mode 100755 index 24fcd74c..00000000 --- a/tests-m32/flock.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check flock syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a19 diff --git a/tests-m32/fork-f.c b/tests-m32/fork-f.c index 11ac3d97..0e71c500 100644 --- a/tests-m32/fork-f.c +++ b/tests-m32/fork-f.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/fork-f.gen.test b/tests-m32/fork-f.gen.test new file mode 100755 index 00000000..b534e13a --- /dev/null +++ b/tests-m32/fork-f.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fork-f -a26 -qq -f -e signal=none -e trace=chdir); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a26 -qq -f -e signal=none -e trace=chdir diff --git a/tests-m32/fork-f.test b/tests-m32/fork-f.test deleted file mode 100755 index d8ca1e3b..00000000 --- a/tests-m32/fork-f.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check how strace -f follows fork syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a26 -qq -f -e trace=chdir -e signal=none diff --git a/tests-m32/fstat-Xabbrev.c b/tests-m32/fstat-Xabbrev.c new file mode 100644 index 00000000..3fb61e09 --- /dev/null +++ b/tests-m32/fstat-Xabbrev.c @@ -0,0 +1 @@ +#include "fstat.c" diff --git a/tests-m32/fstat-Xabbrev.gen.test b/tests-m32/fstat-Xabbrev.gen.test new file mode 100755 index 00000000..827d5940 --- /dev/null +++ b/tests-m32/fstat-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat-Xabbrev -a15 -v -Xabbrev -P stat.sample -e trace=fstat); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 -v -Xabbrev -P stat.sample -e trace=fstat diff --git a/tests-m32/fstat-Xraw.c b/tests-m32/fstat-Xraw.c new file mode 100644 index 00000000..04284612 --- /dev/null +++ b/tests-m32/fstat-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "fstat.c" diff --git a/tests-m32/fstat-Xraw.gen.test b/tests-m32/fstat-Xraw.gen.test new file mode 100755 index 00000000..99fdc908 --- /dev/null +++ b/tests-m32/fstat-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat-Xraw -a15 -v -Xraw -P stat.sample -e trace=fstat); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 -v -Xraw -P stat.sample -e trace=fstat diff --git a/tests-m32/fstat-Xverbose.c b/tests-m32/fstat-Xverbose.c new file mode 100644 index 00000000..e2b20427 --- /dev/null +++ b/tests-m32/fstat-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "fstat.c" diff --git a/tests-m32/fstat-Xverbose.gen.test b/tests-m32/fstat-Xverbose.gen.test new file mode 100755 index 00000000..9a7ef89f --- /dev/null +++ b/tests-m32/fstat-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat-Xverbose -a15 -v -Xverbose -P stat.sample -e trace=fstat); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 -v -Xverbose -P stat.sample -e trace=fstat diff --git a/tests-m32/fstat.c b/tests-m32/fstat.c index 12df3e19..7a52e0cc 100644 --- a/tests-m32/fstat.c +++ b/tests-m32/fstat.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/fstat.gen.test b/tests-m32/fstat.gen.test new file mode 100755 index 00000000..8686ec80 --- /dev/null +++ b/tests-m32/fstat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat -a15 -v -P stat.sample); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 -v -P stat.sample diff --git a/tests-m32/fstat.test b/tests-m32/fstat.test deleted file mode 100755 index 2ba0fbaa..00000000 --- a/tests-m32/fstat.test +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -# Check fstat syscall decoding. - -. "${srcdir=.}/init.sh" - -# strace -P is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - -syscall=$NAME -run_prog > /dev/null -sample=$syscall.sample -> "$sample" -run_strace -ve$syscall -P$sample -a21 $args > "$OUT" -match_diff "$LOG" "$OUT" -rm -f "$OUT" - -exit 0 diff --git a/tests-m32/fstat64-Xabbrev.c b/tests-m32/fstat64-Xabbrev.c new file mode 100644 index 00000000..dc44b3d9 --- /dev/null +++ b/tests-m32/fstat64-Xabbrev.c @@ -0,0 +1 @@ +#include "fstat64.c" diff --git a/tests-m32/fstat64-Xabbrev.gen.test b/tests-m32/fstat64-Xabbrev.gen.test new file mode 100755 index 00000000..21b601f8 --- /dev/null +++ b/tests-m32/fstat64-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat64-Xabbrev -a17 -Xabbrev -v -P stat.sample -e trace=fstat64); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 -Xabbrev -v -P stat.sample -e trace=fstat64 diff --git a/tests-m32/fstat64-Xraw.c b/tests-m32/fstat64-Xraw.c new file mode 100644 index 00000000..f8930d72 --- /dev/null +++ b/tests-m32/fstat64-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "fstat64.c" diff --git a/tests-m32/fstat64-Xraw.gen.test b/tests-m32/fstat64-Xraw.gen.test new file mode 100755 index 00000000..a31dd848 --- /dev/null +++ b/tests-m32/fstat64-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat64-Xraw -a17 -Xraw -v -P stat.sample -e trace=fstat64); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 -Xraw -v -P stat.sample -e trace=fstat64 diff --git a/tests-m32/fstat64-Xverbose.c b/tests-m32/fstat64-Xverbose.c new file mode 100644 index 00000000..61e33aef --- /dev/null +++ b/tests-m32/fstat64-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "fstat64.c" diff --git a/tests-m32/fstat64-Xverbose.gen.test b/tests-m32/fstat64-Xverbose.gen.test new file mode 100755 index 00000000..8b789e49 --- /dev/null +++ b/tests-m32/fstat64-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat64-Xverbose -a17 -Xverbose -v -P stat.sample -e trace=fstat64); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 -Xverbose -v -P stat.sample -e trace=fstat64 diff --git a/tests-m32/fstat64.c b/tests-m32/fstat64.c index a9c2e072..5d30ca41 100644 --- a/tests-m32/fstat64.c +++ b/tests-m32/fstat64.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/fstat64.gen.test b/tests-m32/fstat64.gen.test new file mode 100755 index 00000000..a452b845 --- /dev/null +++ b/tests-m32/fstat64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat64 -a17 -v -P stat.sample); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 -v -P stat.sample diff --git a/tests-m32/fstat64.test b/tests-m32/fstat64.test deleted file mode 100755 index 8b4f5ef1..00000000 --- a/tests-m32/fstat64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check fstat64 syscall decoding. - -. "${srcdir=.}/fstat.test" diff --git a/tests-m32/fstatat.c b/tests-m32/fstatat.c index 66138c25..fde507c3 100644 --- a/tests-m32/fstatat.c +++ b/tests-m32/fstatat.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifdef HAVE_FSTATAT diff --git a/tests-m32/fstatat64.c b/tests-m32/fstatat64.c index 03082a8f..949463c9 100644 --- a/tests-m32/fstatat64.c +++ b/tests-m32/fstatat64.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/fstatat64.gen.test b/tests-m32/fstatat64.gen.test new file mode 100755 index 00000000..8da5c7f2 --- /dev/null +++ b/tests-m32/fstatat64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstatat64 -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests-m32/fstatat64.test b/tests-m32/fstatat64.test deleted file mode 100755 index 484008ac..00000000 --- a/tests-m32/fstatat64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check fstatat64 syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests-m32/fstatfs.c b/tests-m32/fstatfs.c index 9e68c8d3..f1609405 100644 --- a/tests-m32/fstatfs.c +++ b/tests-m32/fstatfs.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/fstatfs.gen.test b/tests-m32/fstatfs.gen.test new file mode 100755 index 00000000..27deaf34 --- /dev/null +++ b/tests-m32/fstatfs.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstatfs -a18 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests-m32/fstatfs.test b/tests-m32/fstatfs.test deleted file mode 100755 index 646e66f2..00000000 --- a/tests-m32/fstatfs.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check fstatfs syscall decoding. - -. "${srcdir=.}/statfs.test" diff --git a/tests-m32/fstatfs64.c b/tests-m32/fstatfs64.c index afc54aa9..14da042a 100644 --- a/tests-m32/fstatfs64.c +++ b/tests-m32/fstatfs64.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/fstatfs64.gen.test b/tests-m32/fstatfs64.gen.test new file mode 100755 index 00000000..d6937269 --- /dev/null +++ b/tests-m32/fstatfs64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstatfs64 -a24 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-m32/fstatfs64.test b/tests-m32/fstatfs64.test deleted file mode 100755 index 179ff1bf..00000000 --- a/tests-m32/fstatfs64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check fstatfs64 syscall decoding. - -. "${srcdir=.}/statfs.test" diff --git a/tests-m32/fstatx.c b/tests-m32/fstatx.c index f88d9a9c..275fe65a 100644 --- a/tests-m32/fstatx.c +++ b/tests-m32/fstatx.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #define IS_FSTAT 1 diff --git a/tests-m32/fsync-y.c b/tests-m32/fsync-y.c new file mode 100644 index 00000000..f42f8345 --- /dev/null +++ b/tests-m32/fsync-y.c @@ -0,0 +1,51 @@ +/* + * Check printing of file name in strace -y mode. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include + +int +main(void) +{ + char dir[PATH_MAX + 1]; + + const struct { + const char *path; + const char *cstr; + const char *fdstr; + } checks[] = { + { ARG_STR("\1\0020\v\0047\f\58\t\79\n\10\0171\r\0167\218\37 \\\'\"<<0::0>>1~\177\200\377"), + "\\1\\0020\\v\\0047\\f\\58\\t\\79\\n\\10\\0171\\r\\0167" + "\\218\\37 \\\\\'\\\"\\74\\0740::0\\76\\0761~\\177\\200\\377" }, + }; + + if (!getcwd(dir, sizeof(dir))) + perror_msg_and_fail("getcwd"); + + for (unsigned int i = 0; i < ARRAY_SIZE(checks); i++) { + long fd = open(checks[i].path, O_RDONLY|O_CREAT, 0600); + if (fd < 0) + perror_msg_and_fail("open(%s)", checks[i].cstr); + + int rc = fsync(fd); + + printf("fsync(%ld<", fd); + print_quoted_string_ex(dir, false, ">:"); + printf("/%s>) = %s\n", checks[i].fdstr, sprintrc(rc)); + + close(fd); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/fsync-y.gen.test b/tests-m32/fsync-y.gen.test new file mode 100755 index 00000000..055a580f --- /dev/null +++ b/tests-m32/fsync-y.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fsync-y -y -e trace=fsync); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -y -e trace=fsync diff --git a/tests-m32/fsync.c b/tests-m32/fsync.c index 2f504106..5624096b 100644 --- a/tests-m32/fsync.c +++ b/tests-m32/fsync.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/fsync.gen.test b/tests-m32/fsync.gen.test new file mode 100755 index 00000000..5e72cc25 --- /dev/null +++ b/tests-m32/fsync.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fsync -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-m32/fsync.test b/tests-m32/fsync.test deleted file mode 100755 index a58b67be..00000000 --- a/tests-m32/fsync.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check fsync syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 diff --git a/tests-m32/ftruncate.c b/tests-m32/ftruncate.c index ee17455f..6c77d4b1 100644 --- a/tests-m32/ftruncate.c +++ b/tests-m32/ftruncate.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/ftruncate.gen.test b/tests-m32/ftruncate.gen.test new file mode 100755 index 00000000..6e5926b2 --- /dev/null +++ b/tests-m32/ftruncate.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ftruncate -a24 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-m32/ftruncate.test b/tests-m32/ftruncate.test deleted file mode 100755 index ec8a1e05..00000000 --- a/tests-m32/ftruncate.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check ftruncate syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 diff --git a/tests-m32/ftruncate64.c b/tests-m32/ftruncate64.c index 90d9938f..b7e350b4 100644 --- a/tests-m32/ftruncate64.c +++ b/tests-m32/ftruncate64.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/ftruncate64.gen.test b/tests-m32/ftruncate64.gen.test new file mode 100755 index 00000000..d910f617 --- /dev/null +++ b/tests-m32/ftruncate64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ftruncate64 -a36 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests-m32/ftruncate64.test b/tests-m32/ftruncate64.test deleted file mode 100755 index 90682102..00000000 --- a/tests-m32/ftruncate64.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check ftruncate64 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a36 diff --git a/tests-m32/futex.c b/tests-m32/futex.c index 586b95d5..47191f27 100644 --- a/tests-m32/futex.c +++ b/tests-m32/futex.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -33,7 +14,6 @@ # include # include -# include # include # include # include @@ -55,18 +35,18 @@ # include "xlat/futexwakeops.h" # include "xlat/futexwakecmps.h" -static struct timespec *tmout; - void futex_error(int *uaddr, int op, unsigned long val, unsigned long timeout, - int *uaddr2, unsigned long val3, int rc) + int *uaddr2, unsigned long val3, int rc, const char *func, int line) { - perror_msg_and_fail("futex(%p, %#x, %#x, %#lx, %p, %#x) = %d", - uaddr, op, (unsigned) val, timeout, uaddr, (unsigned) val3, rc); + perror_msg_and_fail("%s:%d: futex(%p, %#x, %#x, %#lx, %p, %#x) = %d", + func, line, uaddr, op, (unsigned) val, timeout, uaddr, + (unsigned) val3, rc); } # define CHECK_FUTEX_GENERIC(uaddr, op, val, timeout, uaddr2, val3, check, \ enosys) \ do { \ + errno = 0; \ rc = syscall(__NR_futex, (uaddr), (op), (val), (timeout), \ (uaddr2), (val3)); \ /* It is here due to EPERM on WAKE_OP on AArch64 */ \ @@ -77,7 +57,7 @@ void futex_error(int *uaddr, int op, unsigned long val, unsigned long timeout, if (!(check)) \ futex_error((uaddr), (op), (val), \ (unsigned long) (timeout), (int *) (uaddr2), \ - (val3), rc); \ + (val3), rc, __func__, __LINE__); \ } while (0) # define CHECK_FUTEX_ENOSYS(uaddr, op, val, timeout, uaddr2, val3, check) \ @@ -151,20 +131,29 @@ void invalid_op(int *val, int op, uint32_t argmask, ...) } while (0) /* Value which differs from one stored in int *val */ -# define VAL ((unsigned long) 0xbadda7a0facefeedLLU) -# define VAL_PR ((unsigned) VAL) +# define VAL ((unsigned long) 0xbadda7a0facefeedLLU) +# define VAL_PR ((unsigned) VAL) + +# define VALP ((unsigned long) 0xbadda7a01acefeedLLU) +# define VALP_PR ((unsigned) VALP) -# define VAL2 ((unsigned long) 0xbadda7a0ca7b100dLLU) -# define VAL2_PR ((unsigned) VAL2) +# define VAL2 ((unsigned long) 0xbadda7a0ca7b100dLLU) +# define VAL2_PR ((unsigned) VAL2) -# define VAL3 ((unsigned long) 0xbadda7a09caffee1LLU) -# define VAL3_PR ((unsigned) VAL3) +# define VAL2P ((unsigned long) 0xbadda7a07a7b100dLLU) +# define VAL2P_PR ((unsigned) VAL2P) + +# define VAL3 ((unsigned long) 0xbadda7a09caffee1LLU) +# define VAL3_PR ((unsigned) VAL3) + +# define VAL3A ((unsigned long) 0xbadda7a0ffffffffLLU) +# define VAL3A_PR "FUTEX_BITSET_MATCH_ANY" int main(int argc, char *argv[]) { - int *uaddr = tail_alloc(sizeof(*uaddr)); - int *uaddr2 = tail_alloc(sizeof(*uaddr2)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, uaddr); + TAIL_ALLOC_OBJECT_CONST_PTR(int, uaddr2); int rc; unsigned i; unsigned j; @@ -172,7 +161,7 @@ main(int argc, char *argv[]) uaddr[0] = 0x1deadead; uaddr2[0] = 0xbadf00d; - tmout = tail_alloc(sizeof(*tmout)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, tmout); tmout->tv_sec = 123; tmout->tv_nsec = 0xbadc0de; @@ -189,37 +178,59 @@ main(int argc, char *argv[]) /* uaddr is NULL */ CHECK_FUTEX(NULL, FUTEX_WAIT, VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EFAULT)); - printf("futex(NULL, FUTEX_WAIT, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", - VAL_PR, (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, - sprintrc(rc)); + printf("futex(NULL, FUTEX_WAIT, %u, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); /* uaddr is faulty */ CHECK_FUTEX(uaddr + 1, FUTEX_WAIT, VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EFAULT)); - printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", - uaddr + 1, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + uaddr + 1, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); /* timeout is faulty */ CHECK_FUTEX(uaddr, FUTEX_WAIT, VAL, tmout + 1, uaddr2, VAL3, (rc == -1) && (errno == EFAULT)); printf("futex(%p, FUTEX_WAIT, %u, %p) = %s\n", - uaddr, 0xfacefeed, tmout + 1, sprintrc(rc)); + uaddr, 0xfacefeed, tmout + 1, sprintrc(rc)); + + /* timeout is invalid */ + tmout->tv_sec = 0xdeadbeefU; + tmout->tv_nsec = 0xfacefeedU; + + CHECK_FUTEX(uaddr, FUTEX_WAIT, VAL, tmout, uaddr2, VAL3, + (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); + + tmout->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + tmout->tv_nsec = (long) 0xbadc0dedfacefeedLL; + + CHECK_FUTEX(uaddr, FUTEX_WAIT, VAL, tmout, uaddr2, VAL3, + (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); + + tmout->tv_sec = 123; + tmout->tv_nsec = 0xbadc0de; /* uaddr is not as provided; uaddr2 is faulty but ignored */ CHECK_FUTEX(uaddr, FUTEX_WAIT, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", - uaddr, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); /* uaddr is not as provided; uaddr2 is faulty but ignored */ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAIT, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_PRIVATE, %u, {tv_sec=%jd, tv_nsec=%jd}) = " - "%s\n", - uaddr, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_PRIVATE, %u, {tv_sec=%lld, tv_nsec=%llu})" + " = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); /* Next 2 tests are with CLOCKRT bit set */ @@ -227,18 +238,18 @@ main(int argc, char *argv[]) CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_WAIT, VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT|FUTEX_CLOCK_REALTIME, %u, " - "{tv_sec=%jd, tv_nsec=%jd}) = %s\n", uaddr, VAL_PR, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, - sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT|FUTEX_CLOCK_REALTIME, %u" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); CHECK_FUTEX_ENOSYS(uaddr, - FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | FUTEX_WAIT , + FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | FUTEX_WAIT, VAL, tmout, uaddr2, 0, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_PRIVATE|FUTEX_CLOCK_REALTIME, %u, " - "{tv_sec=%jd, tv_nsec=%jd}) = %s\n", uaddr, VAL_PR, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, - sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_PRIVATE|FUTEX_CLOCK_REALTIME, %u" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); /* FUTEX_WAIT_BITSET - FUTEX_WAIT which provides additional bitmask * which should be matched at least in one bit with @@ -254,50 +265,62 @@ main(int argc, char *argv[]) CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_BITSET, %u, {tv_sec=%jd, tv_nsec=%jd}, " - "%#x) = %s\n", - uaddr, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, VAL3_PR, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_BITSET, %u, {tv_sec=%lld, tv_nsec=%llu}" + ", %#x) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), VAL3_PR, + sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, + VAL3A, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_BITSET, %u, {tv_sec=%lld, tv_nsec=%llu}" + ", %s) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), VAL3A_PR, + sprintrc(rc)); /* val3 of 0 is invalid */ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, 0, (rc == -1) && (errno == EINVAL)); - printf("futex(%p, FUTEX_WAIT_BITSET, %u, {tv_sec=%jd, tv_nsec=%jd}, " - "%#x) = %s\n", - uaddr, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, 0, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_BITSET, %u, {tv_sec=%lld, tv_nsec=%llu}" + ", %#x) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), 0, sprintrc(rc)); CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_BITSET_PRIVATE, %u, " - "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", - uaddr, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, VAL3_PR, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_BITSET_PRIVATE, %u" + ", {tv_sec=%lld, tv_nsec=%llu}, %#x) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), VAL3_PR, + sprintrc(rc)); /* Next 3 tests are with CLOCKRT bit set */ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, %u, " - "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", uaddr, VAL_PR, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, VAL3_PR, - sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, %u" + ", {tv_sec=%lld, tv_nsec=%llu}, %#x) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), VAL3_PR, + sprintrc(rc)); /* val3 of 0 is invalid */ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, 0, (rc == -1) && (errno == EINVAL)); - printf("futex(%p, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, %u, " - "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", uaddr, VAL_PR, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, 0, - sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, %u" + ", {tv_sec=%lld, tv_nsec=%llu}, %#x) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), 0, sprintrc(rc)); CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, %u, " - "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", uaddr, VAL_PR, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, VAL3_PR, - sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, %u" + ", {tv_sec=%lld, tv_nsec=%llu}, %#x) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), VAL3_PR, + sprintrc(rc)); /* FUTEX_WAKE - wake val processes waiting for uaddr * Possible flags: PRIVATE @@ -343,6 +366,11 @@ main(int argc, char *argv[]) printf("futex(%p, FUTEX_WAKE_BITSET, %u, %#x) = %s\n", uaddr, 10, VAL3_PR, sprintrc(rc)); + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAKE_BITSET, 10, NULL, NULL, + VAL3A, (rc == 0)); + printf("futex(%p, FUTEX_WAKE_BITSET, %u, %s) = %s\n", uaddr, 10, + VAL3A_PR, sprintrc(rc)); + /* bitset 0 is invalid */ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAKE_BITSET, 10, NULL, NULL, 0, (rc == -1) && (errno == EINVAL)); @@ -392,16 +420,26 @@ main(int argc, char *argv[]) /* Trying to re-queue some processes but there's nothing to re-queue */ CHECK_FUTEX(uaddr, FUTEX_REQUEUE, VAL, VAL2, uaddr2, VAL3, - (rc == 0)); + (rc == 0) || ((rc == -1) && (errno == EINVAL))); printf("futex(%p, FUTEX_REQUEUE, %u, %u, %p) = %s\n", uaddr, VAL_PR, VAL2_PR, uaddr2, sprintrc(rc)); + CHECK_FUTEX(uaddr, FUTEX_REQUEUE, VALP, VAL2P, uaddr2, VAL3, + (rc == 0)); + printf("futex(%p, FUTEX_REQUEUE, %u, %u, %p) = %s\n", + uaddr, VALP_PR, VAL2P_PR, uaddr2, sprintrc(rc)); + /* Trying to re-queue some processes but there's nothing to re-queue */ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_REQUEUE, VAL, VAL2, - uaddr2, VAL3, (rc == 0)); + uaddr2, VAL3, (rc == 0) || ((rc == -1) && (errno == EINVAL))); printf("futex(%p, FUTEX_REQUEUE_PRIVATE, %u, %u, %p) = %s\n", uaddr, VAL_PR, VAL2_PR, uaddr2, sprintrc(rc)); + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_REQUEUE, VALP, + VAL2P, uaddr2, VAL3, (rc == 0)); + printf("futex(%p, FUTEX_REQUEUE_PRIVATE, %u, %u, %p) = %s\n", + uaddr, VALP_PR, VAL2P_PR, uaddr2, sprintrc(rc)); + CHECK_INVALID_CLOCKRT(FUTEX_REQUEUE, ARG3 | ARG4 | ARG5, "%u", "%u", "%#lx"); @@ -418,22 +456,38 @@ main(int argc, char *argv[]) /* Comparison re-queue with wrong val value */ CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VAL, VAL2, uaddr2, VAL3, - (rc == -1) && (errno == EAGAIN)); + (rc == -1) && (errno == EAGAIN || errno == EINVAL)); printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n", uaddr, VAL_PR, VAL2_PR, uaddr2, VAL3_PR, sprintrc(rc)); + CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VALP, VAL2P, uaddr2, VAL3, + (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n", + uaddr, VALP_PR, VAL2P_PR, uaddr2, VAL3_PR, sprintrc(rc)); + /* Successful comparison re-queue */ CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VAL, VAL2, uaddr2, *uaddr, - (rc == 0)); + (rc == 0) || ((rc == -1) && (errno == EINVAL))); printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n", uaddr, VAL_PR, VAL2_PR, uaddr2, *uaddr, sprintrc(rc)); + CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VALP, VAL2P, uaddr2, *uaddr, + (rc == 0)); + printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n", + uaddr, VALP_PR, VAL2P_PR, uaddr2, *uaddr, sprintrc(rc)); + /* Successful comparison re-queue */ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_CMP_REQUEUE, VAL, - VAL2, uaddr2, *uaddr, (rc == 0)); + VAL2, uaddr2, *uaddr, + (rc == 0) || ((rc == -1) && (errno == EINVAL))); printf("futex(%p, FUTEX_CMP_REQUEUE_PRIVATE, %u, %u, %p, %u) = %s\n", uaddr, VAL_PR, VAL2_PR, uaddr2, *uaddr, sprintrc(rc)); + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_CMP_REQUEUE, VALP, + VAL2P, uaddr2, *uaddr, (rc == 0)); + printf("futex(%p, FUTEX_CMP_REQUEUE_PRIVATE, %u, %u, %p, %u) = %s\n", + uaddr, VALP_PR, VAL2P_PR, uaddr2, *uaddr, sprintrc(rc)); + CHECK_INVALID_CLOCKRT(FUTEX_CMP_REQUEUE, ARG3 | ARG4 | ARG5 | ARG6, "%u", "%u", "%#lx", "%u"); @@ -471,8 +525,16 @@ main(int argc, char *argv[]) static const struct { uint32_t val; const char *str; + + /* + * Peculiar semantics: + * * err == 0 and err2 != 0 => expect both either the absence + * of error or presence of err2 + * * err != 0 and err2 == 0 => expect err only, no success + * expected. + */ int err; - const char *errstr; + int err2; } wake_ops[] = { { 0x00000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, { 0x00fff000, "FUTEX_OP_SET<<28|0xfff<<12|FUTEX_OP_CMP_EQ<<24|" @@ -486,13 +548,13 @@ main(int argc, char *argv[]) { 0x30000000, "FUTEX_OP_ANDN<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, { 0x40000000, "FUTEX_OP_XOR<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, { 0x50000000, "0x5<<28 /* FUTEX_OP_??? */|0<<12|" - "FUTEX_OP_CMP_EQ<<24|0", ENOSYS, "ENOSYS" }, + "FUTEX_OP_CMP_EQ<<24|0", ENOSYS }, { 0x70000000, "0x7<<28 /* FUTEX_OP_??? */|0<<12|" - "FUTEX_OP_CMP_EQ<<24|0", ENOSYS, "ENOSYS" }, + "FUTEX_OP_CMP_EQ<<24|0", ENOSYS }, { 0x80000000, "FUTEX_OP_OPARG_SHIFT<<28|FUTEX_OP_SET<<28|0<<12|" "FUTEX_OP_CMP_EQ<<24|0" }, { 0xa0caffee, "FUTEX_OP_OPARG_SHIFT<<28|FUTEX_OP_OR<<28|" - "0xcaf<<12|FUTEX_OP_CMP_EQ<<24|0xfee" }, + "0xcaf<<12|FUTEX_OP_CMP_EQ<<24|0xfee", 0, EINVAL }, { 0x01000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_NE<<24|0" }, { 0x01234567, "FUTEX_OP_SET<<28|0x234<<12|FUTEX_OP_CMP_NE<<24|" "0x567" }, @@ -501,30 +563,41 @@ main(int argc, char *argv[]) { 0x04000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_GT<<24|0" }, { 0x05000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_GE<<24|0" }, { 0x06000000, "FUTEX_OP_SET<<28|0<<12|" - "0x6<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + "0x6<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS }, { 0x07000000, "FUTEX_OP_SET<<28|0<<12|" - "0x7<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + "0x7<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS }, { 0x08000000, "FUTEX_OP_SET<<28|0<<12|" - "0x8<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + "0x8<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS }, { 0x0f000000, "FUTEX_OP_SET<<28|0<<12|" - "0xf<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + "0xf<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS }, { 0xbadfaced, "FUTEX_OP_OPARG_SHIFT<<28|FUTEX_OP_ANDN<<28|" "0xdfa<<12|0xa<<24 /* FUTEX_OP_CMP_??? */|0xced", - ENOSYS, "ENOSYS" }, + ENOSYS, EINVAL }, { 0xffffffff, "FUTEX_OP_OPARG_SHIFT<<28|" "0x7<<28 /* FUTEX_OP_??? */|0xfff<<12|" "0xf<<24 /* FUTEX_OP_CMP_??? */|0xfff", - ENOSYS, "ENOSYS" }, + ENOSYS, EINVAL }, }; for (i = 0; i < ARRAY_SIZE(wake_ops); i++) { for (j = 0; j < 2; j++) { CHECK_FUTEX_ENOSYS(uaddr, j ? FUTEX_WAKE_OP_PRIVATE : FUTEX_WAKE_OP, - VAL, i, uaddr2, wake_ops[i].val, (rc == 0)); - printf("futex(%p, FUTEX_WAKE_OP%s, %u, %u, %p, %s) = " - "%s\n", uaddr, j ? "_PRIVATE" : "", VAL_PR, i, - uaddr2, wake_ops[i].str, sprintrc(rc)); + VAL, i, uaddr2, wake_ops[i].val, + /* + * Either one of errs is 0 or rc == 0 is not + * allowed. + */ + ((!wake_ops[i].err || !wake_ops[i].err2 || + (rc != 0)) && + ((!wake_ops[i].err && (rc == 0)) || + (wake_ops[i].err && (rc == -1) && + (errno == wake_ops[i].err)) || + (wake_ops[i].err2 && (rc == -1) && + (errno == wake_ops[i].err2))))); + printf("futex(%p, FUTEX_WAKE_OP%s, %u, %u, %p, %s)" + " = %s\n", uaddr, j ? "_PRIVATE" : "", VAL_PR, + i, uaddr2, wake_ops[i].str, sprintrc(rc)); } } @@ -552,16 +625,16 @@ main(int argc, char *argv[]) CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_LOCK_PI, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EFAULT)); - printf("futex(%p, FUTEX_LOCK_PI, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", - uaddr + 1, (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, - sprintrc(rc)); + printf("futex(%p, FUTEX_LOCK_PI, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + uaddr + 1, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_PRIVATE_FLAG | FUTEX_LOCK_PI, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EFAULT)); - printf("futex(%p, FUTEX_LOCK_PI_PRIVATE, {tv_sec=%jd, tv_nsec=%jd}) = " - "%s\n", - uaddr + 1, (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, - sprintrc(rc)); + printf("futex(%p, FUTEX_LOCK_PI_PRIVATE, {tv_sec=%lld, tv_nsec=%llu})" + " = %s\n", + uaddr + 1, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); /* NULL is passed by invalid_op() in cases valid timeout address is * needed */ @@ -587,7 +660,7 @@ main(int argc, char *argv[]) CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_PRIVATE_FLAG | FUTEX_UNLOCK_PI, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EFAULT)); - printf("futex(%p, FUTEX_UNLOCK_PI_PRIVATE) = %s\n", uaddr +1, + printf("futex(%p, FUTEX_UNLOCK_PI_PRIVATE) = %s\n", uaddr + 1, sprintrc(rc)); CHECK_INVALID_CLOCKRT(FUTEX_UNLOCK_PI, 0); @@ -633,32 +706,32 @@ main(int argc, char *argv[]) CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAIT_REQUEUE_PI, VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_REQUEUE_PI, %u, " - "{tv_sec=%jd, tv_nsec=%jd}, %p) = %s\n", - uaddr, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, uaddr2, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI, %u" + ", {tv_sec=%lld, tv_nsec=%llu}, %p) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), uaddr2, sprintrc(rc)); CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAIT_REQUEUE_PI, VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_REQUEUE_PI_PRIVATE, %u, " - "{tv_sec=%jd, tv_nsec=%jd}, %p) " - "= %s\n", uaddr, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, uaddr2, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI_PRIVATE, %u" + ", {tv_sec=%lld, tv_nsec=%llu}, %p) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), uaddr2, sprintrc(rc)); CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_WAIT_REQUEUE_PI, VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_REQUEUE_PI|FUTEX_CLOCK_REALTIME, %u, " - "{tv_sec=%jd, tv_nsec=%jd}, %p) = %s\n", uaddr, VAL_PR, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, uaddr2, - sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI|FUTEX_CLOCK_REALTIME, %u" + ", {tv_sec=%lld, tv_nsec=%llu}, %p) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), uaddr2, sprintrc(rc)); CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | FUTEX_WAIT_REQUEUE_PI, VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_REQUEUE_PI_PRIVATE|FUTEX_CLOCK_REALTIME, " - "%u, {tv_sec=%jd, tv_nsec=%jd}, %p) = %s\n", uaddr, VAL_PR, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, uaddr2, - sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI_PRIVATE|FUTEX_CLOCK_REALTIME" + ", %u, {tv_sec=%lld, tv_nsec=%llu}, %p) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), uaddr2, sprintrc(rc)); /* FUTEX_CMP_REQUEUE_PI - version of FUTEX_CMP_REQUEUE which re-queues * on PI-aware futex. diff --git a/tests-m32/futex.test b/tests-m32/futex.test index fc98267a..889eec61 100755 --- a/tests-m32/futex.test +++ b/tests-m32/futex.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check futex syscall decoding. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests-m32/futimesat.c b/tests-m32/futimesat.c index c3566291..8024f87b 100644 --- a/tests-m32/futimesat.c +++ b/tests-m32/futimesat.c @@ -1,30 +1,10 @@ /* * Check decoding of futimesat syscall. * - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -37,46 +17,123 @@ # include # include - -int -main(void) +static void +print_tv(const struct timeval *tv) { - struct timeval tv; - if (gettimeofday(&tv, NULL)) - perror_msg_and_fail("gettimeofday"); - - static const char sample[] = "futimesat_sample"; - unsigned long dirfd = (unsigned long) 0xdeadbeef00000000ULL | -100U; - - long rc = syscall(__NR_futimesat, dirfd, sample, 0); - printf("futimesat(AT_FDCWD, \"%s\", NULL) = %ld %s (%m)\n", - sample, rc, errno2name()); + printf("{tv_sec=%lld, tv_usec=%llu}", + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); + print_time_t_usec(tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec), 1); +} - struct timeval *const ts = tail_alloc(sizeof(*ts) * 2); - dirfd = (unsigned long) 0xdeadbeefffffffffULL; +static const char *errstr; - ts[0].tv_sec = tv.tv_sec; - ts[0].tv_usec = tv.tv_usec; - ts[1].tv_sec = tv.tv_sec - 1; - ts[1].tv_usec = tv.tv_usec + 1; +static long +k_futimesat(const kernel_ulong_t dirfd, + const kernel_ulong_t pathname, + const kernel_ulong_t times) +{ + long rc = syscall(__NR_futimesat, dirfd, pathname, times); + errstr = sprintrc(rc); + return rc; +} - rc = syscall(__NR_futimesat, dirfd, 0, ts + 2); - printf("futimesat(%d, NULL, %p) = %ld %s (%m)\n", - (int) dirfd, ts + 2, rc, errno2name()); +int +main(void) +{ + static const kernel_ulong_t bogus_fd = + (kernel_ulong_t) 0xbadfaceddeadbeaf; + static const kernel_ulong_t kfdcwd = + (kernel_ulong_t) 0xdefaced00000000 | -100U; + static const char proto_fname[] = "futimesat_sample"; + static const char qname[] = "\"futimesat_sample\""; - rc = syscall(__NR_futimesat, dirfd, 0, ts + 1); - printf("futimesat(%d, NULL, [{tv_sec=%jd, tv_usec=%jd}, %p]) = " - "%ld %s (%m)\n", (int) dirfd, - (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, - ts + 2, rc, errno2name()); + char *const fname = tail_memdup(proto_fname, sizeof(proto_fname)); + const kernel_ulong_t kfname = (uintptr_t) fname; + struct timeval *const tv = tail_alloc(sizeof(*tv) * 2); (void) close(0); - rc = syscall(__NR_futimesat, 0, "", ts); - printf("futimesat(0, \"\", [{tv_sec=%jd, tv_usec=%jd}, " - "{tv_sec=%jd, tv_usec=%jd}]) = %ld %s (%m)\n", - (intmax_t) ts[0].tv_sec, (intmax_t) ts[0].tv_usec, - (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, - rc, errno2name()); + + /* dirfd */ + k_futimesat(0, kfname, 0); + printf("futimesat(0, %s, NULL) = %s\n", qname, errstr); + + k_futimesat(bogus_fd, kfname, 0); + printf("futimesat(%d, %s, NULL) = %s\n", (int) bogus_fd, qname, errstr); + + k_futimesat(-100U, kfname, 0); + printf("futimesat(AT_FDCWD, %s, NULL) = %s\n", qname, errstr); + + k_futimesat(kfdcwd, kfname, 0); + printf("futimesat(AT_FDCWD, %s, NULL) = %s\n", qname, errstr); + + /* pathname */ + k_futimesat(kfdcwd, 0, 0); + printf("futimesat(AT_FDCWD, NULL, NULL) = %s\n", errstr); + + k_futimesat(kfdcwd, kfname + sizeof(proto_fname) - 1, 0); + printf("futimesat(AT_FDCWD, \"\", NULL) = %s\n", errstr); + + fname[sizeof(proto_fname) - 1] = '+'; + k_futimesat(kfdcwd, kfname, 0); + fname[sizeof(proto_fname) - 1] = '\0'; + printf("futimesat(AT_FDCWD, %p, NULL) = %s\n", fname, errstr); + + if (F8ILL_KULONG_SUPPORTED) { + k_futimesat(kfdcwd, f8ill_ptr_to_kulong(fname), 0); + printf("futimesat(AT_FDCWD, %#jx, NULL) = %s\n", + (uintmax_t) f8ill_ptr_to_kulong(fname), errstr); + } + + /* times */ + k_futimesat(kfdcwd, kfname, (uintptr_t) (tv + 1)); + printf("futimesat(AT_FDCWD, %s, %p) = %s\n", + qname, tv + 1, errstr); + + k_futimesat(kfdcwd, kfname, (uintptr_t) (tv + 2)); + printf("futimesat(AT_FDCWD, %s, %p) = %s\n", + qname, tv + 2, errstr); + + tv[0].tv_sec = 0xdeadbeefU; + tv[0].tv_usec = 0xfacefeedU; + tv[1].tv_sec = (time_t) 0xcafef00ddeadbeefLL; + tv[1].tv_usec = (suseconds_t) 0xbadc0dedfacefeedLL; + + k_futimesat(kfdcwd, kfname, (uintptr_t) tv); + printf("futimesat(AT_FDCWD, %s, [", qname); + print_tv(&tv[0]); + printf(", "); + print_tv(&tv[1]); + printf("]) = %s\n", errstr); + + tv[0].tv_sec = 1492356708; + tv[0].tv_usec = 567891234; + tv[1].tv_sec = 1492357086; + tv[1].tv_usec = 678902345; + + k_futimesat(kfdcwd, kfname, (uintptr_t) tv); + printf("futimesat(AT_FDCWD, %s, [", qname); + print_tv(&tv[0]); + printf(", "); + print_tv(&tv[1]); + printf("]) = %s\n", errstr); + + tv[0].tv_usec = 567891; + tv[1].tv_usec = 678902; + + k_futimesat(kfdcwd, kfname, (uintptr_t) tv); + printf("futimesat(AT_FDCWD, %s, [", qname); + print_tv(&tv[0]); + printf(", "); + print_tv(&tv[1]); + printf("]) = %s\n", errstr); + + if (F8ILL_KULONG_SUPPORTED) { + k_futimesat(kfdcwd, kfname, f8ill_ptr_to_kulong(tv)); + printf("futimesat(AT_FDCWD, %s, %#jx) = %s\n", + qname, (uintmax_t) f8ill_ptr_to_kulong(tv), errstr); + } puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/futimesat.gen.test b/tests-m32/futimesat.gen.test new file mode 100755 index 00000000..80d7a8bc --- /dev/null +++ b/tests-m32/futimesat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (futimesat -a28 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-m32/futimesat.test b/tests-m32/futimesat.test deleted file mode 100755 index 3a67c042..00000000 --- a/tests-m32/futimesat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check futimesat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 diff --git a/tests-m32/gen_pure_executables.sh b/tests-m32/gen_pure_executables.sh new file mode 100755 index 00000000..735f53a6 --- /dev/null +++ b/tests-m32/gen_pure_executables.sh @@ -0,0 +1,30 @@ +#!/bin/sh -efu +# +# Copyright (c) 2017-2018 Dmitry V. Levin +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +usage() +{ + cat >&2 < []] + +Generate pure_executables.am from list. +Deduce output file from unless an is specified. +EOF + exit 1 +} + +input="${0%/*}/pure_executables.list" +[ $# -eq 0 ] || { input="$1"; shift; } +output="$(dirname "$input")/pure_executables.am" +[ $# -eq 0 ] || { output="$1"; shift; } +[ $# -eq 0 ] || usage + +exec > "$output" + +echo "# Generated by $0 from $input; do not edit." +echo 'PURE_EXECUTABLES = \' +sed -n 's/^[^#].*/ & \\/p' < "$input" +echo ' #' diff --git a/tests-m32/gen_tests.am b/tests-m32/gen_tests.am new file mode 100644 index 00000000..e6d1fc7b --- /dev/null +++ b/tests-m32/gen_tests.am @@ -0,0 +1,1574 @@ +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in; do not edit. +GEN_TESTS = _newselect.gen.test _newselect-P.gen.test accept.gen.test accept4.gen.test access.gen.test acct.gen.test add_key.gen.test adjtimex.gen.test aio.gen.test aio_pgetevents.gen.test alarm.gen.test bpf.gen.test bpf-obj_get_info_by_fd.gen.test bpf-obj_get_info_by_fd-prog.gen.test bpf-obj_get_info_by_fd-prog-v.gen.test bpf-obj_get_info_by_fd-v.gen.test bpf-v.gen.test btrfs.gen.test chmod.gen.test chown.gen.test chown32.gen.test chroot.gen.test clock.gen.test clock_adjtime.gen.test clock_nanosleep.gen.test clock_xettime.gen.test copy_file_range.gen.test creat.gen.test delete_module.gen.test dev-yy.gen.test dup.gen.test dup2.gen.test dup3.gen.test epoll_create.gen.test epoll_create1.gen.test epoll_ctl.gen.test epoll_pwait.gen.test epoll_wait.gen.test erestartsys.gen.test execveat.gen.test execveat-v.gen.test faccessat.gen.test fadvise64_64.gen.test fallocate.gen.test fanotify_init.gen.test fanotify_mark.gen.test fanotify_mark-Xabbrev.gen.test fanotify_mark-Xraw.gen.test fanotify_mark-Xverbose.gen.test fchdir.gen.test fchmod.gen.test fchmodat.gen.test fchown.gen.test fchown32.gen.test fchownat.gen.test fcntl.gen.test fcntl64.gen.test fdatasync.gen.test file_handle.gen.test file_ioctl.gen.test finit_module.gen.test flock.gen.test fork-f.gen.test fstat.gen.test fstat-Xabbrev.gen.test fstat-Xraw.gen.test fstat-Xverbose.gen.test fstat64.gen.test fstat64-Xabbrev.gen.test fstat64-Xraw.gen.test fstat64-Xverbose.gen.test fstatat64.gen.test fstatfs.gen.test fstatfs64.gen.test fsync.gen.test fsync-y.gen.test ftruncate.gen.test ftruncate64.gen.test futimesat.gen.test get_mempolicy.gen.test getcpu.gen.test getcwd.gen.test getdents.gen.test getdents64.gen.test getegid.gen.test getegid32.gen.test geteuid.gen.test geteuid32.gen.test getgid.gen.test getgid32.gen.test getgroups.gen.test getgroups32.gen.test getpeername.gen.test getpgrp.gen.test getpid.gen.test getppid.gen.test getrandom.gen.test getresgid.gen.test getresgid32.gen.test getresuid.gen.test getresuid32.gen.test getrlimit.gen.test getrusage.gen.test getsid.gen.test getsockname.gen.test gettid.gen.test getuid32.gen.test getxxid.gen.test group_req.gen.test inet-cmsg.gen.test init_module.gen.test inotify.gen.test inotify_init1.gen.test io_uring_enter.gen.test io_uring_register.gen.test io_uring_setup.gen.test ioctl_block.gen.test ioctl_dm.gen.test ioctl_dm-v.gen.test ioctl_evdev.gen.test ioctl_evdev-v.gen.test ioctl_inotify.gen.test ioctl_kvm_run.gen.test ioctl_kvm_run-v.gen.test ioctl_kvm_run_auxstr_vcpu.gen.test ioctl_loop.gen.test ioctl_loop-nv.gen.test ioctl_loop-v.gen.test ioctl_mtd.gen.test ioctl_nbd.gen.test ioctl_nsfs.gen.test ioctl_perf.gen.test ioctl_ptp.gen.test ioctl_random.gen.test ioctl_rtc.gen.test ioctl_rtc-v.gen.test ioctl_scsi.gen.test ioctl_sg_io_v3.gen.test ioctl_sg_io_v4.gen.test ioctl_sock_gifconf.gen.test ioctl_uffdio.gen.test ioctl_v4l2.gen.test ioperm.gen.test iopl.gen.test ioprio.gen.test ioprio-Xabbrev.gen.test ioprio-Xraw.gen.test ioprio-Xverbose.gen.test ip_mreq.gen.test ipc.gen.test ipc_msg.gen.test ipc_msg-Xabbrev.gen.test ipc_msg-Xraw.gen.test ipc_msg-Xverbose.gen.test ipc_msgbuf-Xabbrev.gen.test ipc_msgbuf-Xraw.gen.test ipc_msgbuf-Xverbose.gen.test ipc_sem.gen.test ipc_sem-Xabbrev.gen.test ipc_sem-Xraw.gen.test ipc_sem-Xverbose.gen.test ipc_shm.gen.test ipc_shm-Xabbrev.gen.test ipc_shm-Xraw.gen.test ipc_shm-Xverbose.gen.test kcmp.gen.test kcmp-y.gen.test kern_features.gen.test kernel_version.gen.test kernel_version-Xabbrev.gen.test kernel_version-Xraw.gen.test kernel_version-Xverbose.gen.test kexec_file_load.gen.test kexec_load.gen.test keyctl.gen.test keyctl-Xabbrev.gen.test keyctl-Xraw.gen.test keyctl-Xverbose.gen.test kill.gen.test lchown.gen.test lchown32.gen.test link.gen.test linkat.gen.test lookup_dcookie.gen.test lstat.gen.test lstat64.gen.test madvise.gen.test mbind.gen.test membarrier.gen.test memfd_create.gen.test memfd_create-Xabbrev.gen.test memfd_create-Xraw.gen.test memfd_create-Xverbose.gen.test migrate_pages.gen.test mincore.gen.test mkdir.gen.test mkdirat.gen.test mknod.gen.test mknodat.gen.test mlock.gen.test mlock2.gen.test mlockall.gen.test mmap-Xabbrev.gen.test mmap-Xraw.gen.test mmap-Xverbose.gen.test mmap64.gen.test mmap64-Xabbrev.gen.test mmap64-Xraw.gen.test mmap64-Xverbose.gen.test mmsg.gen.test mmsg-silent.gen.test mmsg_name.gen.test mmsg_name-v.gen.test modify_ldt.gen.test mount.gen.test mount-Xabbrev.gen.test mount-Xraw.gen.test mount-Xverbose.gen.test move_pages.gen.test move_pages-Xabbrev.gen.test move_pages-Xraw.gen.test move_pages-Xverbose.gen.test mq.gen.test mq_sendrecv.gen.test mq_sendrecv-read.gen.test mq_sendrecv-write.gen.test msg_control.gen.test msg_control-v.gen.test msg_name.gen.test munlockall.gen.test nanosleep.gen.test net-icmp_filter.gen.test net-packet_mreq.gen.test net-packet_mreq-Xabbrev.gen.test net-packet_mreq-Xraw.gen.test net-packet_mreq-Xverbose.gen.test net-sockaddr.gen.test net-tpacket_req.gen.test net-tpacket_stats.gen.test net-yy-inet6.gen.test netlink_audit.gen.test netlink_crypto.gen.test netlink_generic.gen.test netlink_kobject_uevent.gen.test netlink_netfilter.gen.test netlink_protocol.gen.test netlink_route.gen.test netlink_selinux.gen.test netlink_xfrm.gen.test newfstatat.gen.test nfnetlink_acct.gen.test nfnetlink_cthelper.gen.test nfnetlink_ctnetlink.gen.test nfnetlink_ctnetlink_exp.gen.test nfnetlink_cttimeout.gen.test nfnetlink_ipset.gen.test nfnetlink_nft_compat.gen.test nfnetlink_nftables.gen.test nfnetlink_osf.gen.test nfnetlink_queue.gen.test nfnetlink_ulog.gen.test nlattr.gen.test nlattr_br_port_msg.gen.test nlattr_crypto_user_alg.gen.test nlattr_dcbmsg.gen.test nlattr_fib_rule_hdr.gen.test nlattr_ifaddrlblmsg.gen.test nlattr_ifaddrmsg.gen.test nlattr_ifinfomsg.gen.test nlattr_ifla_af_spec.gen.test nlattr_ifla_brport.gen.test nlattr_ifla_linkinfo.gen.test nlattr_ifla_port.gen.test nlattr_ifla_xdp.gen.test nlattr_inet_diag_msg.gen.test nlattr_inet_diag_req_compat.gen.test nlattr_inet_diag_req_v2.gen.test nlattr_mdba_mdb_entry.gen.test nlattr_mdba_router_port.gen.test nlattr_ndmsg.gen.test nlattr_ndtmsg.gen.test nlattr_netconfmsg.gen.test nlattr_netlink_diag_msg.gen.test nlattr_nlmsgerr.gen.test nlattr_packet_diag_msg.gen.test nlattr_rtgenmsg.gen.test nlattr_rtmsg.gen.test nlattr_smc_diag_msg.gen.test nlattr_tc_stats.gen.test nlattr_tca_stab.gen.test nlattr_tcamsg.gen.test nlattr_tcmsg.gen.test nlattr_unix_diag_msg.gen.test old_mmap.gen.test old_mmap-P.gen.test old_mmap-Xabbrev.gen.test old_mmap-Xraw.gen.test old_mmap-Xverbose.gen.test old_mmap-v-none.gen.test oldfstat.gen.test oldlstat.gen.test oldselect.gen.test oldselect-P.gen.test oldselect-efault.gen.test oldselect-efault-P.gen.test oldstat.gen.test open.gen.test openat.gen.test orphaned_process_group.gen.test osf_utimes.gen.test pause.gen.test perf_event_open.gen.test perf_event_open_nonverbose.gen.test perf_event_open_unabbrev.gen.test personality-Xabbrev.gen.test personality-Xraw.gen.test personality-Xverbose.gen.test pidfd_send_signal.gen.test pipe2.gen.test pkey_alloc.gen.test pkey_free.gen.test pkey_mprotect.gen.test ppoll.gen.test ppoll-P.gen.test ppoll-v.gen.test pread64-pwrite64.gen.test preadv.gen.test preadv-pwritev.gen.test preadv2-pwritev2.gen.test printpath-umovestr.gen.test printpath-umovestr-peekdata.gen.test printpath-umovestr-undumpable.gen.test printsignal-Xabbrev.gen.test printsignal-Xraw.gen.test printsignal-Xverbose.gen.test printstr.gen.test printstrn-umoven.gen.test printstrn-umoven-peekdata.gen.test printstrn-umoven-undumpable.gen.test prlimit64.gen.test process_vm_readv.gen.test process_vm_writev.gen.test pselect6.gen.test ptrace.gen.test ptrace_syscall_info.gen.test pwritev.gen.test quotactl.gen.test quotactl-Xabbrev.gen.test quotactl-Xraw.gen.test quotactl-Xverbose.gen.test quotactl-v.gen.test quotactl-xfs.gen.test quotactl-xfs-v.gen.test read-write.gen.test readahead.gen.test readdir.gen.test readlink.gen.test readlinkat.gen.test reboot.gen.test recvfrom.gen.test recvmmsg-timeout.gen.test recvmsg.gen.test regex.gen.test remap_file_pages.gen.test remap_file_pages-Xabbrev.gen.test remap_file_pages-Xraw.gen.test remap_file_pages-Xverbose.gen.test rename.gen.test renameat.gen.test renameat2.gen.test request_key.gen.test riscv_flush_icache.gen.test rmdir.gen.test rt_sigpending.gen.test rt_sigprocmask.gen.test rt_sigqueueinfo.gen.test rt_sigreturn.gen.test rt_sigsuspend.gen.test rt_sigtimedwait.gen.test rt_tgsigqueueinfo.gen.test s390_guarded_storage.gen.test s390_guarded_storage-v.gen.test s390_pci_mmio_read_write.gen.test s390_runtime_instr.gen.test s390_sthyi.gen.test s390_sthyi-v.gen.test sched.gen.test sched_get_priority_mxx.gen.test sched_rr_get_interval.gen.test sched_xetaffinity.gen.test sched_xetattr.gen.test sched_xetparam.gen.test sched_xetscheduler.gen.test sched_yield.gen.test seccomp-filter.gen.test seccomp-filter-v.gen.test seccomp_get_action_avail.gen.test select.gen.test select-P.gen.test semop.gen.test sendfile.gen.test sendfile64.gen.test set_mempolicy.gen.test setdomainname.gen.test setfsgid.gen.test setfsgid32.gen.test setfsuid.gen.test setfsuid32.gen.test setgid.gen.test setgid32.gen.test setgroups.gen.test setgroups32.gen.test sethostname.gen.test setns.gen.test setregid.gen.test setregid32.gen.test setresgid.gen.test setresgid32.gen.test setresuid.gen.test setresuid32.gen.test setreuid.gen.test setreuid32.gen.test setrlimit.gen.test setrlimit-Xabbrev.gen.test setrlimit-Xraw.gen.test setrlimit-Xverbose.gen.test setuid.gen.test setuid32.gen.test shmxt.gen.test shutdown.gen.test sigaction.gen.test siginfo.gen.test signal.gen.test signal_receive.gen.test signalfd4.gen.test sigpending.gen.test sigprocmask.gen.test sigreturn.gen.test sigsuspend.gen.test so_error.gen.test so_linger.gen.test so_peercred.gen.test so_peercred-Xabbrev.gen.test so_peercred-Xraw.gen.test so_peercred-Xverbose.gen.test sock_filter-v.gen.test sock_filter-v-Xabbrev.gen.test sock_filter-v-Xraw.gen.test sock_filter-v-Xverbose.gen.test sockaddr_xlat-Xabbrev.gen.test sockaddr_xlat-Xraw.gen.test sockaddr_xlat-Xverbose.gen.test socketcall.gen.test sockopt-sol_netlink.gen.test sockopt-timestamp.gen.test splice.gen.test stat.gen.test stat64.gen.test statfs.gen.test statfs64.gen.test statx.gen.test swap.gen.test sxetmask.gen.test symlink.gen.test symlinkat.gen.test sync.gen.test sync_file_range.gen.test sync_file_range2.gen.test sysinfo.gen.test syslog.gen.test tee.gen.test time.gen.test timer_create.gen.test timer_xettime.gen.test timerfd_xettime.gen.test times.gen.test times-fail.gen.test trace_fstat.gen.test trace_fstatfs.gen.test trace_lstat.gen.test trace_personality_32.gen.test trace_personality_64.gen.test trace_personality_regex_32.gen.test trace_personality_regex_64.gen.test trace_personality_regex_x32.gen.test trace_personality_x32.gen.test trace_question.gen.test trace_stat.gen.test trace_stat_like.gen.test trace_statfs.gen.test trace_statfs_like.gen.test truncate.gen.test truncate64.gen.test ugetrlimit.gen.test umask.gen.test umoven-illptr.gen.test umovestr-illptr.gen.test umovestr3.gen.test unlink.gen.test unlinkat.gen.test unshare.gen.test userfaultfd.gen.test ustat.gen.test utime.gen.test utimensat.gen.test utimensat-Xabbrev.gen.test utimensat-Xraw.gen.test utimensat-Xverbose.gen.test utimes.gen.test vfork-f.gen.test vhangup.gen.test vmsplice.gen.test wait4.gen.test wait4-v.gen.test waitid.gen.test waitid-v.gen.test waitpid.gen.test xattr.gen.test xattr-strings.gen.test xet_robust_list.gen.test xetitimer.gen.test xetpgid.gen.test xetpriority.gen.test xettimeofday.gen.test + +$(srcdir)/_newselect.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/_newselect-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/accept.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/accept4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/access.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/acct.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/add_key.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/adjtimex.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/aio.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/aio_pgetevents.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/alarm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd-prog.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd-prog-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/btrfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chmod.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chown32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chroot.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock_adjtime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock_nanosleep.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock_xettime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/copy_file_range.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/creat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/delete_module.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dev-yy.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dup.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dup2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dup3.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_create.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_create1.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_ctl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_pwait.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_wait.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/erestartsys.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/execveat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/execveat-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/faccessat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fadvise64_64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fallocate.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_init.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchmod.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchmodat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchown32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchownat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fcntl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fcntl64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fdatasync.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/file_handle.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/file_ioctl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/finit_module.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/flock.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fork-f.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstatat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstatfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstatfs64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fsync.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fsync-y.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ftruncate.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ftruncate64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/futimesat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/get_mempolicy.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getcpu.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getcwd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getdents.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getdents64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getegid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getegid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/geteuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/geteuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgroups.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgroups32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getpeername.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getpgrp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getpid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getppid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getrandom.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getrlimit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getrusage.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getsid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getsockname.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/gettid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getxxid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/group_req.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/inet-cmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/init_module.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/inotify.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/inotify_init1.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/io_uring_enter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/io_uring_register.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/io_uring_setup.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_block.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_dm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_dm-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_evdev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_evdev-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_inotify.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_kvm_run.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_kvm_run-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_kvm_run_auxstr_vcpu.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_loop.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_loop-nv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_loop-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_mtd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_nbd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_nsfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_perf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_ptp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_random.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_rtc.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_rtc-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_scsi.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_sg_io_v3.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_sg_io_v4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_sock_gifconf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_uffdio.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_v4l2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioperm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/iopl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ip_mreq.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msgbuf-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msgbuf-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msgbuf-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kcmp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kcmp-y.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kern_features.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kexec_file_load.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kexec_load.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kill.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lchown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lchown32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/link.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/linkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lookup_dcookie.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lstat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/madvise.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mbind.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/membarrier.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/migrate_pages.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mincore.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mkdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mkdirat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mknod.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mknodat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mlock.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mlock2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mlockall.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg-silent.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg_name.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg_name-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/modify_ldt.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq_sendrecv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq_sendrecv-read.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq_sendrecv-write.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/msg_control.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/msg_control-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/msg_name.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/munlockall.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nanosleep.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-icmp_filter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-sockaddr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-tpacket_req.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-tpacket_stats.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-yy-inet6.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_audit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_crypto.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_generic.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_kobject_uevent.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_netfilter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_protocol.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_route.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_selinux.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_xfrm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/newfstatat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_acct.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_cthelper.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ctnetlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ctnetlink_exp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_cttimeout.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ipset.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_nft_compat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_nftables.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_osf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_queue.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ulog.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_br_port_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_crypto_user_alg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_dcbmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_fib_rule_hdr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifaddrlblmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifaddrmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifinfomsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_af_spec.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_brport.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_linkinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_port.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_xdp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_inet_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_inet_diag_req_compat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_inet_diag_req_v2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_mdba_mdb_entry.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_mdba_router_port.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ndmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ndtmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_netconfmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_netlink_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_nlmsgerr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_packet_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_rtgenmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_rtmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_smc_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tc_stats.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tca_stab.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tcamsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tcmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_unix_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-v-none.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldfstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldlstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect-efault.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect-efault-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/open.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/openat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/orphaned_process_group.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/osf_utimes.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pause.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/perf_event_open.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/perf_event_open_nonverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/perf_event_open_unabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/personality-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/personality-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/personality-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pidfd_send_signal.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pipe2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pkey_alloc.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pkey_free.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pkey_mprotect.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ppoll.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ppoll-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ppoll-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pread64-pwrite64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/preadv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/preadv-pwritev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/preadv2-pwritev2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printpath-umovestr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printpath-umovestr-peekdata.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printpath-umovestr-undumpable.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printsignal-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printsignal-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printsignal-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstrn-umoven.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstrn-umoven-peekdata.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstrn-umoven-undumpable.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/prlimit64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/process_vm_readv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/process_vm_writev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pselect6.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ptrace.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ptrace_syscall_info.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pwritev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-xfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-xfs-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/read-write.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readahead.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readlinkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/reboot.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/recvfrom.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/recvmmsg-timeout.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/recvmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/regex.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rename.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/renameat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/renameat2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/request_key.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/riscv_flush_icache.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rmdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigpending.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigprocmask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigqueueinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigreturn.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigsuspend.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigtimedwait.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_tgsigqueueinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_guarded_storage.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_guarded_storage-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_pci_mmio_read_write.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_runtime_instr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_sthyi.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_sthyi-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_get_priority_mxx.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_rr_get_interval.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetaffinity.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetattr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetparam.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetscheduler.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_yield.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/seccomp-filter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/seccomp-filter-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/seccomp_get_action_avail.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/select.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/select-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/semop.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sendfile.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sendfile64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/set_mempolicy.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setdomainname.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgroups.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgroups32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sethostname.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setns.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setregid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setregid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setreuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setreuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/shmxt.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/shutdown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigaction.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/siginfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/signal.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/signal_receive.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/signalfd4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigpending.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigprocmask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigreturn.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigsuspend.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_error.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_linger.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockaddr_xlat-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockaddr_xlat-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockaddr_xlat-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/socketcall.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockopt-sol_netlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockopt-timestamp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/splice.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/stat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/stat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/statfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/statfs64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/statx.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/swap.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sxetmask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/symlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/symlinkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sync.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sync_file_range.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sync_file_range2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sysinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/syslog.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/tee.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/time.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/timer_create.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/timer_xettime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/timerfd_xettime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/times.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/times-fail.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_fstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_fstatfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_lstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_regex_32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_regex_64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_regex_x32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_x32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_question.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_stat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_stat_like.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_statfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_statfs_like.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/truncate.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/truncate64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ugetrlimit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umoven-illptr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umovestr-illptr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umovestr3.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/unlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/unlinkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/unshare.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/userfaultfd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ustat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimes.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/vfork-f.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/vhangup.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/vmsplice.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/wait4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/wait4-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/waitid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/waitid-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/waitpid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xattr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xattr-strings.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xet_robust_list.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xetitimer.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xetpgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xetpriority.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xettimeofday.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ diff --git a/tests-m32/gen_tests.in b/tests-m32/gen_tests.in new file mode 100644 index 00000000..487b9608 --- /dev/null +++ b/tests-m32/gen_tests.in @@ -0,0 +1,531 @@ +# Input for gen_tests.sh +# +# Copyright (c) 2017-2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +_newselect +_newselect-P -e trace=_newselect -P /dev/full 9>>/dev/full +accept -a22 +accept4 -a37 +access -a30 -P access_sample +acct -a20 +add_key -a30 -s12 +adjtimex -a15 +aio -a14 -e trace=io_setup,io_submit,io_getevents,io_cancel,io_destroy +aio_pgetevents -e trace=io_pgetevents +alarm -a10 +bpf -a20 +bpf-obj_get_info_by_fd -a20 -y -e trace=bpf +bpf-obj_get_info_by_fd-prog -a20 -y -e trace=bpf +bpf-obj_get_info_by_fd-prog-v -a20 -y -v -e trace=bpf +bpf-obj_get_info_by_fd-v -a20 -y -v -e trace=bpf +bpf-v -a20 -v -e trace=bpf +btrfs +ioctl.test +chmod -a28 +chown -a28 +chown32 -a31 +chroot -a24 +clock test_trace_expr 'times|fcntl.*' -e/clock +clock_adjtime -a37 +clock_nanosleep -e trace=clock_nanosleep,clock_gettime +clock_xettime -a36 -e trace=clock_getres,clock_gettime,clock_settime +copy_file_range +creat -a20 +delete_module -a23 +dev-yy -a30 -e trace=openat,fsync -P "/dev/full" -P "/dev/zero" -P "/dev/sda" -yy +dup -a8 +dup2 -a13 +dup3 -a24 +epoll_create -a17 +epoll_create1 -a28 +epoll_ctl +epoll_pwait +epoll_wait -a26 +erestartsys -a34 -e signal=none -e trace=recvfrom +execveat +execveat-v -v -e trace=execveat +faccessat -P $NAME.sample +fadvise64_64 +fadvise64.test +fallocate -a18 +fanotify_init +fanotify_mark -a32 +fanotify_mark-Xabbrev -a32 -Xabbrev -e trace=fanotify_mark +fanotify_mark-Xraw -a32 -Xraw -e trace=fanotify_mark +fanotify_mark-Xverbose -a32 -Xverbose -e trace=fanotify_mark +fchdir -a11 +fchmod -a15 +fchmodat +fchown -a16 +fchown32 -a18 +fchownat +fcntl -a8 +fcntl64 -a8 +fdatasync -a14 +file_handle -e trace=name_to_handle_at,open_by_handle_at +file_ioctl +ioctl.test +finit_module -a25 +flock -a19 +fork-f -a26 -qq -f -e signal=none -e trace=chdir +fstat -a15 -v -P stat.sample +fstat-Xabbrev -a15 -v -Xabbrev -P stat.sample -e trace=fstat +fstat-Xraw -a15 -v -Xraw -P stat.sample -e trace=fstat +fstat-Xverbose -a15 -v -Xverbose -P stat.sample -e trace=fstat +fstat64 -a17 -v -P stat.sample +fstat64-Xabbrev -a17 -Xabbrev -v -P stat.sample -e trace=fstat64 +fstat64-Xraw -a17 -Xraw -v -P stat.sample -e trace=fstat64 +fstat64-Xverbose -a17 -Xverbose -v -P stat.sample -e trace=fstat64 +fstatat64 -a32 -v -P stat.sample -P /dev/full +fstatfs -a18 +fstatfs64 -a24 +fsync -a10 +fsync-y -y -e trace=fsync +ftruncate -a24 +ftruncate64 -a36 +futimesat -a28 +get_mempolicy -s3 -a38 +getcpu -a25 +getcwd -a18 +getdents -a22 -v +getdents64 -a24 -v +getegid +getuid.test +getegid32 +getuid.test +geteuid +getuid.test +geteuid32 +getuid.test +getgid +getuid.test +getgid32 +getuid.test +getgroups -a17 +getgroups32 -a19 +getpeername -a27 +getpgrp -a10 +getpid -a9 +getppid -a10 +getrandom -a32 -s3 +getresgid -a25 +getresgid32 -a27 +getresuid -a25 +getresuid32 -a27 +getrlimit -a27 +getrusage -v +getsid -a10 +getsockname -a27 +gettid -a9 +getuid32 +getuid.test +getxxid -a10 -e trace=getxpid,getxuid,getxgid +group_req -e trace=setsockopt +inet-cmsg -e trace=recvmsg +init_module -a27 +inotify -a23 -e trace=inotify_add_watch,inotify_rm_watch +inotify_init1 -a27 +io_uring_enter -y +io_uring_register -y +io_uring_setup -a26 -y +ioctl_block +ioctl.test +ioctl_dm +ioctl.test -s9 +ioctl_dm-v +ioctl.test -v -s9 +ioctl_evdev +ioctl.test +ioctl_evdev-v +ioctl.test -v +ioctl_inotify +ioctl.test +ioctl_kvm_run +ioctl.test -a36 -y +ioctl_kvm_run-v +ioctl.test -v -a36 -y +ioctl_kvm_run_auxstr_vcpu +ioctl.test -a36 -y -e kvm=vcpu +ioctl_loop +ioctl.test +ioctl_loop-nv +ioctl.test -a22 -e verbose=none +ioctl_loop-v +ioctl.test -v +ioctl_mtd +ioctl.test +ioctl_nbd +ioctl.test -y +ioctl_nsfs +ioctl.test -esignal=none +ioctl_perf +ioctl.test +ioctl_ptp +ioctl.test +ioctl_random +ioctl.test +ioctl_rtc +ioctl.test +ioctl_rtc-v +ioctl.test -v +ioctl_scsi +ioctl.test +ioctl_sg_io_v3 +ioctl.test +ioctl_sg_io_v4 +ioctl.test +ioctl_sock_gifconf +ioctl.test -a28 -s1 +ioctl_uffdio +ioctl.test +ioctl_v4l2 +ioctl.test +ioperm -a27 +iopl -a8 +ioprio -a18 -e trace=ioprio_get,ioprio_set +ioprio-Xabbrev -a18 -e trace=ioprio_get,ioprio_set -Xabbrev +ioprio-Xraw -a18 -e trace=ioprio_get,ioprio_set -Xraw +ioprio-Xverbose -a18 -e trace=ioprio_get,ioprio_set -Xverbose +ip_mreq -e trace=setsockopt +ipc -a19 +ipc_msg +ipc.sh -a26 +ipc_msg-Xabbrev +ipc.sh -Xabbrev -a26 +ipc_msg-Xraw +ipc.sh -Xraw -a16 +ipc_msg-Xverbose +ipc.sh -Xverbose -a34 +ipc_msgbuf-Xabbrev +ipc_msgbuf.test -Xabbrev +ipc_msgbuf-Xraw +ipc_msgbuf.test -Xraw -a22 +ipc_msgbuf-Xverbose +ipc_msgbuf.test -Xverbose +ipc_sem +ipc.sh -a29 +ipc_sem-Xabbrev +ipc.sh -Xabbrev -a29 +ipc_sem-Xraw +ipc.sh -Xraw -a19 +ipc_sem-Xverbose +ipc.sh -Xverbose -a36 +ipc_shm +ipc.sh -a29 +ipc_shm-Xabbrev +ipc.sh -Xabbrev -a29 +ipc_shm-Xraw +ipc.sh -Xraw -a19 +ipc_shm-Xverbose +ipc.sh -Xverbose -a36 +kcmp -a22 +kcmp-y -a22 -y -e trace=kcmp +kern_features -a16 +kernel_version -a16 -v -e trace=bpf +kernel_version-Xabbrev -a16 -Xabbrev -v -e trace=bpf +kernel_version-Xraw -a16 -Xraw -v -e trace=bpf +kernel_version-Xverbose -a16 -Xverbose -v -e trace=bpf +kexec_file_load -s9 +kexec_load -s9 +keyctl -a31 -s10 +keyctl-Xabbrev -a31 -s10 -e trace=keyctl -Xabbrev +keyctl-Xraw -a13 -s10 -e trace=keyctl -Xraw +keyctl-Xverbose -a41 -s10 -e trace=keyctl -Xverbose +kill -a12 -esignal=none +lchown -a30 +lchown32 -a32 +link +linkat +lookup_dcookie -a27 +lstat -a32 -v -P stat.sample -P /dev/full +lstat64 -a32 -v -P stat.sample -P /dev/full +madvise -a33 +mbind +membarrier -a36 +memfd_create +memfd_create-Xabbrev -Xabbrev -e trace=memfd_create +memfd_create-Xraw -a30 -Xraw -e trace=memfd_create +memfd_create-Xverbose -Xverbose -e trace=memfd_create +migrate_pages -a33 +mincore -a22 +mkdir -a20 +mkdirat -a28 +mknod -a18 +mknodat -a35 +mlock -a20 -e trace=mlock,munlock +mlock2 +mlockall -a12 +mmap-Xabbrev +mmap.test abbrev +mmap-Xraw +mmap.test raw 14 +mmap-Xverbose +mmap.test verbose +mmap64 +mmap.test +mmap64-Xabbrev +mmap.test abbrev +mmap64-Xraw +mmap.test raw 14 +mmap64-Xverbose +mmap.test verbose +mmsg -e read=0 -e write=1 -e trace=recvmmsg,sendmmsg +mmsg-silent -a25 -e verbose=none -e trace=sendmmsg,recvmmsg +mmsg_name -a25 -e trace=sendmmsg,recvmmsg +mmsg_name-v -v -a25 -e trace=sendmmsg,recvmmsg +modify_ldt -a23 +mount -a33 +mount-Xabbrev -a33 -e trace=mount -Xabbrev +mount-Xraw -a33 -e trace=mount -Xraw +mount-Xverbose -a33 -e trace=mount -Xverbose +move_pages -s3 +move_pages-Xabbrev -s3 -e trace=move_pages -Xabbrev +move_pages-Xraw -s3 -a36 -e trace=move_pages -Xraw +move_pages-Xverbose -s3 -e trace=move_pages -Xverbose +mq -a32 -e trace=mq_getsetattr,mq_open,mq_unlink +mq_sendrecv -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink +mq_sendrecv-read -eread=0 -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink +mq_sendrecv-write -ewrite=0 -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink +msg_control -a21 -e trace=sendmsg +msg_control-v -v -a21 -e trace=sendmsg +msg_name -a20 -e trace=recvmsg +munlockall -a13 +nanosleep -a20 +net-icmp_filter -e trace=getsockopt,setsockopt +net-packet_mreq -e trace=setsockopt +net-packet_mreq-Xabbrev -e trace=setsockopt -Xabbrev +net-packet_mreq-Xraw -e trace=setsockopt -Xraw +net-packet_mreq-Xverbose -e trace=setsockopt -Xverbose +net-sockaddr -a24 -e trace=connect +net-tpacket_req -e trace=setsockopt +net-tpacket_stats -e trace=getsockopt +net-yy-inet6 +net-yy-inet.test +netlink_audit +netlink_sock_diag.test +netlink_crypto +netlink_sock_diag.test +netlink_generic +netlink_sock_diag.test +netlink_kobject_uevent +netlink_sock_diag.test +netlink_netfilter +netlink_sock_diag.test +netlink_protocol -e trace=sendto +netlink_route +netlink_sock_diag.test +netlink_selinux +netlink_sock_diag.test +netlink_xfrm +netlink_sock_diag.test +newfstatat -a32 -v -P stat.sample -P /dev/full +nfnetlink_acct +netlink_sock_diag.test +nfnetlink_cthelper +netlink_sock_diag.test +nfnetlink_ctnetlink +netlink_sock_diag.test +nfnetlink_ctnetlink_exp +netlink_sock_diag.test +nfnetlink_cttimeout +netlink_sock_diag.test +nfnetlink_ipset +netlink_sock_diag.test +nfnetlink_nft_compat +netlink_sock_diag.test +nfnetlink_nftables +netlink_sock_diag.test +nfnetlink_osf +netlink_sock_diag.test +nfnetlink_queue +netlink_sock_diag.test +nfnetlink_ulog +netlink_sock_diag.test +nlattr +netlink_sock_diag.test +nlattr_br_port_msg +netlink_sock_diag.test +nlattr_crypto_user_alg +netlink_sock_diag.test +nlattr_dcbmsg +netlink_sock_diag.test +nlattr_fib_rule_hdr +netlink_sock_diag.test +nlattr_ifaddrlblmsg +netlink_sock_diag.test +nlattr_ifaddrmsg +netlink_sock_diag.test +nlattr_ifinfomsg +netlink_sock_diag.test +nlattr_ifla_af_spec +netlink_sock_diag.test +nlattr_ifla_brport +netlink_sock_diag.test +nlattr_ifla_linkinfo +netlink_sock_diag.test +nlattr_ifla_port +netlink_sock_diag.test +nlattr_ifla_xdp +netlink_sock_diag.test +nlattr_inet_diag_msg +netlink_sock_diag.test +nlattr_inet_diag_req_compat +netlink_sock_diag.test +nlattr_inet_diag_req_v2 +netlink_sock_diag.test +nlattr_mdba_mdb_entry +netlink_sock_diag.test +nlattr_mdba_router_port +netlink_sock_diag.test +nlattr_ndmsg +netlink_sock_diag.test +nlattr_ndtmsg +netlink_sock_diag.test +nlattr_netconfmsg +netlink_sock_diag.test +nlattr_netlink_diag_msg +netlink_sock_diag.test +nlattr_nlmsgerr +netlink_sock_diag.test +nlattr_packet_diag_msg +netlink_sock_diag-v.sh +nlattr_rtgenmsg +netlink_sock_diag.test +nlattr_rtmsg +netlink_sock_diag.test +nlattr_smc_diag_msg +netlink_sock_diag.test +nlattr_tc_stats +netlink_sock_diag.test +nlattr_tca_stab +netlink_sock_diag.test +nlattr_tcamsg +netlink_sock_diag.test +nlattr_tcmsg +netlink_sock_diag.test +nlattr_unix_diag_msg +netlink_sock_diag.test +old_mmap -a11 -e trace=mmap +old_mmap-P -e trace=mmap -P "/dev/full" 9>>/dev/full +old_mmap-Xabbrev -a11 -e trace=mmap -Xabbrev +old_mmap-Xraw -a11 -e trace=mmap -Xraw +old_mmap-Xverbose -a11 -e trace=mmap -Xverbose +old_mmap-v-none -a11 -e trace=mmap -e verbose=none +oldfstat -a18 -v -P stat.sample +oldlstat -a32 -v -P stat.sample -P /dev/full +oldselect -a13 -e trace=select +oldselect-P -a13 -e trace=select -P /dev/full 9>>/dev/full +oldselect-efault -a13 -e trace=select +oldselect-efault-P -a13 -e trace=select -P /dev/full 9>>/dev/full +oldstat -a32 -v -P stat.sample -P /dev/full +open -a30 -P $NAME.sample +openat -a36 -P $NAME.sample +orphaned_process_group . "${srcdir=.}/PTRACE_SEIZE.sh"; run_strace_match_diff -f -e trace=none -e signal='!chld' +osf_utimes -a21 +pause -a8 -esignal=none +perf_event_open -a1 +perf_event_open_nonverbose -a34 -e verbose=none -e trace=perf_event_open +perf_event_open_unabbrev -a1 -v -e trace=perf_event_open +personality-Xabbrev +personality.test -Xabbrev +personality-Xraw +personality.test -a15 -Xraw +personality-Xverbose +personality.test -Xverbose +pidfd_send_signal +pipe2 -a15 +pkey_alloc -a17 +pkey_free -a13 +pkey_mprotect -a37 +ppoll -s2 +ppoll-P -s2 -e trace=ppoll -P /dev/full 9>>/dev/full +ppoll-v -v -s2 -e trace=ppoll +pread64-pwrite64 -a21 -eread=0 -ewrite=1 -e trace=pread64,pwrite64 -P pread64-pwrite64-tmpfile -P /dev/zero -P /dev/null +preadv -a21 +preadv-pwritev -a19 -eread=0 -ewrite=1 -e trace=preadv,pwritev +preadv2-pwritev2 -a22 -eread=0 -ewrite=1 -e trace=preadv2,pwritev2 +printpath-umovestr -a11 -e signal=none -e trace=chdir +printpath-umovestr-peekdata -a11 -e signal=none -e trace=chdir +printpath-umovestr-undumpable -a11 -e signal=none -e trace=chdir +printsignal-Xabbrev -a11 -Xabbrev -e signal=none -e trace=kill +printsignal-Xraw -a11 -Xraw -e signal=none -e trace=kill +printsignal-Xverbose -a11 -Xverbose -e signal=none -e trace=kill +printstr -e trace=writev +printstrn-umoven -s4096 -e signal=none -e trace=add_key +printstrn-umoven-peekdata -e signal=none -e trace=add_key +printstrn-umoven-undumpable -e signal=none -e trace=add_key +prlimit64 +process_vm_readv -s5 -a37 +process_vm_writev -s5 -a38 +pselect6 +ptrace -a23 -e signal=none +ptrace_syscall_info -a35 -e signal=none -e trace=ptrace +pwritev -a22 -s7 +quotactl +quotactl-Xabbrev -Xabbrev -e trace=quotactl +quotactl-Xraw -a27 -Xraw -e trace=quotactl +quotactl-Xverbose -Xverbose -e trace=quotactl +quotactl-v -v -e trace=quotactl +quotactl-xfs -e trace=quotactl +quotactl-xfs-v -v -e trace=quotactl +read-write -a15 -eread=0,5 -ewrite=1,4 -e trace=read,write -P read-write-tmpfile -P /dev/zero -P /dev/null +readahead -a1 +readdir -a16 +readlink -xx +readlinkat -xx +reboot -s 256 +recvfrom -a35 +recvmmsg-timeout -a25 -e trace=recvmmsg +recvmsg -eread=0 -ewrite=1 -e trace=recvmsg,sendmsg +regex test_trace_expr '' -etrace='/^(.*_)?statv?fs' +remap_file_pages +remap_file_pages-Xabbrev -Xabbrev -e trace=remap_file_pages +remap_file_pages-Xraw -Xraw -e trace=remap_file_pages +remap_file_pages-Xverbose -Xverbose -e trace=remap_file_pages +rename -a35 +renameat +renameat2 +request_key -a33 -s12 +riscv_flush_icache -a34 +rmdir -a22 +rt_sigpending -a20 +rt_sigprocmask +rt_sigqueueinfo -esignal=none +rt_sigreturn -esignal='!USR1' +rt_sigsuspend -a20 -esignal=none +rt_sigtimedwait -a38 +rt_tgsigqueueinfo -esignal=none +s390_guarded_storage -a32 +s390_guarded_storage-v -e trace=s390_guarded_storage -a32 -v +s390_pci_mmio_read_write -e trace=s390_pci_mmio_read,s390_pci_mmio_write -a30 +s390_runtime_instr -a44 +s390_sthyi -a47 +s390_sthyi-v -e trace=s390_sthyi -a47 -v +sched test_trace_expr times -e/sched +sched_get_priority_mxx -a33 -e trace=sched_get_priority_min,sched_get_priority_max +sched_rr_get_interval -a31 +sched_xetaffinity -a28 -e trace=sched_getaffinity,sched_setaffinity +sched_xetattr -a29 -e trace=sched_getattr,sched_setattr +sched_xetparam -a23 -e trace=sched_getparam,sched_setparam +sched_xetscheduler -a22 -e trace=sched_getscheduler,sched_setscheduler +sched_yield -a14 +seccomp-filter -e trace=seccomp +seccomp-filter-v -v -e trace=seccomp +seccomp_get_action_avail -e trace=seccomp +select -a36 +select-P -a36 -e trace=select -P /dev/full 9>>/dev/full +semop -a32 -e trace=semop,semtimedop +sendfile -a27 +sendfile64 -a29 +set_mempolicy -s3 -a35 +setdomainname -a24 +setfsgid -a12 +setfsgid32 -a14 +setfsuid -a12 +setfsuid32 -a14 +setgid -a10 +setgid32 -a12 +setgroups -s2 -a17 +setgroups32 -s2 -a19 +sethostname -a22 +setns -a21 +setregid -a15 +setregid32 -a17 +setresgid -a19 +setresgid32 -a21 +setresuid -a19 +setresuid32 -a21 +setreuid -a15 +setreuid32 -a17 +setrlimit -a27 +setrlimit-Xabbrev -a27 -e trace=setrlimit -Xabbrev +setrlimit-Xraw -a19 -e trace=setrlimit -Xraw +setrlimit-Xverbose -a36 -e trace=setrlimit -Xverbose +setuid -a10 +setuid32 -a12 +shmxt -a11 -e trace='/(osf_)?shmat,shmdt' +shutdown -a24 +sigaction -a31 +siginfo -e trace=none +signal -a25 -e signal=none -e trace='/^signal$' +signal_receive -a16 -e trace=kill +signalfd4 +sigpending -a15 +sigprocmask -a34 +sigreturn -esignal='!USR1' +sigsuspend -a19 -esignal=none +so_error -e trace=getsockopt +so_linger -e trace=getsockopt,setsockopt +so_peercred -e trace=getsockopt +so_peercred-Xabbrev -e trace=getsockopt -Xabbrev +so_peercred-Xraw -e trace=getsockopt -Xraw -a39 +so_peercred-Xverbose -e trace=getsockopt -Xverbose +sock_filter-v -v -e trace=getsockopt,setsockopt +sock_filter-v-Xabbrev -v -e trace=getsockopt,setsockopt -X abbrev +sock_filter-v-Xraw -a 37 -v -e trace=getsockopt,setsockopt -X raw +sock_filter-v-Xverbose -v -e trace=getsockopt,setsockopt -X verbose +sockaddr_xlat-Xabbrev -Xabbrev -e trace=connect +sockaddr_xlat-Xraw -Xraw -e trace=connect +sockaddr_xlat-Xverbose -Xverbose -e trace=connect +socketcall -a20 +sockopt-sol_netlink -e trace=getsockopt,setsockopt +sockopt-timestamp -e trace=recvmsg +splice +stat -a32 -v -P stat.sample -P /dev/full +stat64 -a32 -v -P stat.sample -P /dev/full +statfs -a17 +statfs64 -a23 +statx -a32 -v -P stat.sample -P /dev/full +swap -a23 -e trace=swapon,swapoff +sxetmask -a11 -e trace=sgetmask,ssetmask +symlink -a34 +symlinkat +sync -a7 +sync_file_range +sync_file_range2 +sysinfo -a14 +syslog -a36 +tee +time -a10 +timer_create +timer_xettime -e trace=timer_create,timer_settime,timer_gettime +timerfd_xettime -e trace=timerfd_create,timerfd_settime,timerfd_gettime +times -esignal=none +times-fail -a12 -e trace=times +trace_fstat test_trace_expr '' -e%fstat -v -P stat.sample -P /dev/full +trace_fstatfs test_trace_expr '' -e%fstatfs +trace_lstat test_trace_expr '' -e%lstat -v -P stat.sample -P /dev/full +trace_personality_32 +qualify_personality.sh 32 'getcwd' 'fsync-y' +trace_personality_64 +qualify_personality.sh 64 'getcwd' 'fsync-y' +trace_personality_regex_32 +qualify_personality.sh 32 '/clock.*' 'times|fcntl.*' +trace_personality_regex_64 +qualify_personality.sh 64 '/clock.*' 'times|fcntl.*' +trace_personality_regex_x32 +qualify_personality.sh x32 '/clock.*' 'times|fcntl.*' +trace_personality_x32 +qualify_personality.sh x32 'getcwd' 'fsync-y' +trace_question test_trace_expr '' -e?osf_utimes,?/^pkey_.* +trace_stat test_trace_expr '' -e%stat -v -P stat.sample -P /dev/full +trace_stat_like test_trace_expr '' -e%%stat -v -P stat.sample -P /dev/full +trace_statfs test_trace_expr '' -e%statfs +trace_statfs_like test_trace_expr '' -e%%statfs +truncate +truncate64 +ugetrlimit -a28 +umask -a11 +umoven-illptr -a36 -e trace=nanosleep +umovestr-illptr -a11 -e trace=chdir +umovestr3 -a14 -e trace=chdir +unlink -a24 +unlinkat -a35 +unshare -a11 +userfaultfd -a38 +ustat -a33 +utime -a16 +utimensat -a33 +utimensat-Xabbrev -a33 -Xabbrev -e trace=utimensat +utimensat-Xraw -a29 -Xraw -e trace=utimensat +utimensat-Xverbose -a44 -Xverbose -e trace=utimensat +utimes -a17 +vfork-f -a26 -qq -f -e signal=none -e trace=chdir +vhangup -a10 +vmsplice -ewrite=1 +wait4 -esignal=none +wait4-v -v -e signal=none -e trace=wait4 +waitid -esignal=none +waitid-v -v -e signal=none -e trace=waitid +waitpid -a28 +xattr -a22 -e trace=getxattr,fgetxattr,lgetxattr,setxattr,fsetxattr,lsetxattr,listxattr,flistxattr,llistxattr,removexattr,fremovexattr,lremovexattr +xattr-strings -a22 -s 4 -e trace=fsetxattr +xet_robust_list -a24 -e trace=get_robust_list,set_robust_list +xetitimer -a29 -e trace=setitimer,getitimer +xetpgid -a11 -e trace=getpgid,setpgid +xetpriority -a29 -e trace=getpriority,setpriority +xettimeofday -a20 -e trace=gettimeofday,settimeofday diff --git a/tests-m32/gen_tests.sh b/tests-m32/gen_tests.sh new file mode 100755 index 00000000..35402042 --- /dev/null +++ b/tests-m32/gen_tests.sh @@ -0,0 +1,92 @@ +#!/bin/sh -efu +# +# Copyright (c) 2017 Dmitry V. Levin +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +usage() +{ + cat >&2 < []] + +Generate test script(s) from table. +If a is specified, generate the script for this test only, +otherwise generate scripts for all tests specified in table. +EOF + exit 1 +} + +input="${0%/*}/gen_tests.in" +[ $# -eq 0 ] || { input="$1"; shift; } +output= +[ $# -eq 0 ] || { output="$1"; shift; } +[ $# -eq 0 ] || usage + +if [ -n "$output" ]; then + match="${output##*/}" + match="${match%.gen.test}" + [ -n "$match" ] || usage +else + match= + dir="$(dirname "$input")" +fi + +names= + +while read -r name arg0 args; do { + [ -n "${name###*}" ] || continue + if [ -z "$match" ]; then + names="$names $name" + output="$dir/$name.gen.test" + else + [ "$match" = "$name" ] || continue + fi + + hdr="\ +#!/bin/sh -efu +# Generated by $0 from $input ($name $arg0 $args); do not edit." + + case "$arg0" in + +*) + cat <<-EOF + $hdr + set -- $args + . "\${srcdir=.}/${arg0#+}" + EOF + ;; + + ''|-*) + cat <<-EOF + $hdr + . "\${srcdir=.}/init.sh" + run_strace_match_diff $arg0 $args + EOF + ;; + + *) + cat <<-EOF + $hdr + . "\${srcdir=.}/init.sh" + $arg0 $args + EOF + ;; + esac > "$output" + + chmod a+x "$output" +} < /dev/null; done < "$input" + +if [ -n "$names" ]; then + { + printf '# Generated by %s from %s; do not edit.\n' "$0" "$input" + printf 'GEN_TESTS =' + printf ' %s.gen.test' $names + echo + target='$(srcdir)/%s.gen.test' + dep1='$(abs_srcdir)/gen_tests.sh' + dep2='$(srcdir)/gen_tests.in' + recipe='$(AM_V_GEN) $^ $@' + printf "\\n$target: $dep1 $dep2\\n\\t$recipe\\n" $names + } > "$dir/gen_tests.am" +fi diff --git a/tests-m32/get_mempolicy.c b/tests-m32/get_mempolicy.c index 03d1bffc..7667bdb0 100644 --- a/tests-m32/get_mempolicy.c +++ b/tests-m32/get_mempolicy.c @@ -1,30 +1,10 @@ /* * Check decoding of get_mempolicy syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/get_mempolicy.gen.test b/tests-m32/get_mempolicy.gen.test new file mode 100755 index 00000000..ec6efb30 --- /dev/null +++ b/tests-m32/get_mempolicy.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (get_mempolicy -s3 -a38); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 -a38 diff --git a/tests-m32/get_mempolicy.test b/tests-m32/get_mempolicy.test deleted file mode 100755 index 92270970..00000000 --- a/tests-m32/get_mempolicy.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check get_mempolicy syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s3 -a38 diff --git a/tests-m32/get_page_size.c b/tests-m32/get_page_size.c index aeea861c..12ee929d 100644 --- a/tests-m32/get_page_size.c +++ b/tests-m32/get_page_size.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/get_regs.test b/tests-m32/get_regs.test new file mode 100755 index 00000000..e7628d24 --- /dev/null +++ b/tests-m32/get_regs.test @@ -0,0 +1,33 @@ +#!/bin/sh +# +# Check that get_regs is skipped for filtered syscalls. +# +# Copyright (c) 2017-2018 Dmitry V. Levin +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +check_prog env +check_prog grep +run_prog ../gettid > /dev/null + +run_strace -qq -esignal=none -eraw=all -etrace=none ../gettid > /dev/null + +run_strace -qq -esignal=none -eraw=all -eptrace -o '|grep -c ^ptrace > less' \ + -- "$STRACE_EXE" -o "$LOG" $args > /dev/null + +[ "$(cat less)" -gt 0 ] || + fail_ "$STRACE $args failed to catch any ptrace syscalls" + +run_strace -qq -esignal=none -eraw=all -etrace=all ../gettid > /dev/null + +run_strace -qq -esignal=none -eraw=all -eptrace -o '|grep -c ^ptrace > more' \ + -- "$STRACE_EXE" -o "$LOG" $args > /dev/null + +[ "$(cat more)" -gt 0 ] || + fail_ "$STRACE $args failed to catch any ptrace syscalls" + +[ "$(cat more)" -gt "$(cat less)" ] || + fail_ "$STRACE failed to skip get_regs for filtered syscalls" diff --git a/tests-m32/get_sigset_size.c b/tests-m32/get_sigset_size.c new file mode 100644 index 00000000..f58d1f51 --- /dev/null +++ b/tests-m32/get_sigset_size.c @@ -0,0 +1,46 @@ +/* + * Find out the size of kernel's sigset_t. + * + * Copyright (c) 2016-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +/* + * If the sigset size specified to rt_sigprocmask is not equal to the size + * of kernel's sigset_t, the kernel does not look at anything else and fails + * with EINVAL. + * + * Otherwise, if both pointers specified to rt_sigprocmask are NULL, + * the kernel just returns 0. + * + * This vaguely documented kernel feature can be used to probe + * the kernel and find out the size of kernel's sigset_t. + */ + +unsigned int +get_sigset_size(void) +{ + static unsigned int set_size; + + if (!set_size) { + static const unsigned int big_size = 1024 / 8; + + for (set_size = big_size; set_size; set_size >>= 1) { + if (!syscall(__NR_rt_sigprocmask, SIG_SETMASK, + NULL, NULL, set_size)) + break; + } + + if (!set_size) + perror_msg_and_fail("rt_sigprocmask"); + } + + return set_size; +} diff --git a/tests-m32/getcpu.c b/tests-m32/getcpu.c index ec671f1e..ecbaf0dc 100644 --- a/tests-m32/getcpu.c +++ b/tests-m32/getcpu.c @@ -2,29 +2,10 @@ * Check decoding of getcpu syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,16 +21,16 @@ int main(void) { unsigned *bogus_cpu = - (unsigned *) tail_alloc(sizeof(* bogus_cpu)) + 1; + (unsigned *) tail_alloc(sizeof(*bogus_cpu)) + 1; unsigned *bogus_node = - (unsigned *) tail_alloc(sizeof(* bogus_node)) + 1; + (unsigned *) tail_alloc(sizeof(*bogus_node)) + 1; unsigned *bogus_tcache = - (unsigned *) tail_alloc(sizeof(* bogus_tcache)) + 1; + (unsigned *) tail_alloc(sizeof(*bogus_tcache)) + 1; long res; - unsigned *cpu = tail_alloc(sizeof(*cpu)); - unsigned *node = tail_alloc(sizeof(*node)); - long * tcache = tail_alloc(128); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned, cpu); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned, node); + long *tcache = tail_alloc(128); res = syscall(__NR_getcpu, NULL, NULL, NULL); printf("getcpu(NULL, NULL, NULL) = %s\n", sprintrc(res)); diff --git a/tests-m32/getcpu.gen.test b/tests-m32/getcpu.gen.test new file mode 100755 index 00000000..ae38aaa0 --- /dev/null +++ b/tests-m32/getcpu.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getcpu -a25 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests-m32/getcpu.test b/tests-m32/getcpu.test deleted file mode 100755 index fe212658..00000000 --- a/tests-m32/getcpu.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of getcpu syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a25 diff --git a/tests-m32/getcwd.c b/tests-m32/getcwd.c index 707c25c9..5f9a7293 100644 --- a/tests-m32/getcwd.c +++ b/tests-m32/getcwd.c @@ -1,12 +1,19 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #ifdef __NR_getcwd +# include # include # include -# include int main(void) @@ -20,9 +27,9 @@ main(void) if (res <= 0) perror_msg_and_fail("getcwd"); - printf("getcwd(\""); + printf("getcwd("); print_quoted_string(cur_dir); - printf("\", %zu) = %ld\n", sizeof(cur_dir), res); + printf(", %zu) = %ld\n", sizeof(cur_dir), res); res = syscall(__NR_getcwd, cur_dir, 0); printf("getcwd(%p, 0) = %s\n", cur_dir, sprintrc(res)); diff --git a/tests-m32/getcwd.gen.test b/tests-m32/getcwd.gen.test new file mode 100755 index 00000000..f783a5b1 --- /dev/null +++ b/tests-m32/getcwd.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getcwd -a18 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests-m32/getcwd.test b/tests-m32/getcwd.test deleted file mode 100755 index 405187e5..00000000 --- a/tests-m32/getcwd.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getcwd syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a18 diff --git a/tests-m32/getdents.c b/tests-m32/getdents.c index b787c837..998e667f 100644 --- a/tests-m32/getdents.c +++ b/tests-m32/getdents.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -92,12 +73,10 @@ print_dirent(const kernel_dirent *d) } int -main(int ac, const char **av) +main(void) { - char *dname; + static const char dname[] = "getdents.test.tmp.dir"; - assert(ac == 1); - assert(asprintf(&dname, "%s.test.tmp.dir", av[0]) > 0); assert(!mkdir(dname, 0700)); assert(!chdir(dname)); (void) close(0); diff --git a/tests-m32/getdents.gen.test b/tests-m32/getdents.gen.test new file mode 100755 index 00000000..0db5f20a --- /dev/null +++ b/tests-m32/getdents.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getdents -a22 -v); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -v diff --git a/tests-m32/getdents.test b/tests-m32/getdents.test deleted file mode 100755 index 23c4ac3a..00000000 --- a/tests-m32/getdents.test +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -# Check getdents syscall decoding. - -. "${srcdir=.}/init.sh" - -rm -rf -- "$LOG".dir -run_strace_match_diff -a22 -v diff --git a/tests-m32/getdents64.c b/tests-m32/getdents64.c index 9da2a23c..e0575cf4 100644 --- a/tests-m32/getdents64.c +++ b/tests-m32/getdents64.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -98,12 +79,10 @@ print_dirent(const kernel_dirent64 *d) } int -main(int ac, const char **av) +main(void) { - char *dname; + static const char dname[] = "getdents64.test.tmp.dir"; - assert(ac == 1); - assert(asprintf(&dname, "%s.test.tmp.dir", av[0]) > 0); assert(!mkdir(dname, 0700)); assert(!chdir(dname)); (void) close(0); diff --git a/tests-m32/getdents64.gen.test b/tests-m32/getdents64.gen.test new file mode 100755 index 00000000..6e24d400 --- /dev/null +++ b/tests-m32/getdents64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getdents64 -a24 -v); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 -v diff --git a/tests-m32/getdents64.test b/tests-m32/getdents64.test deleted file mode 100755 index 401cfc7c..00000000 --- a/tests-m32/getdents64.test +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -# Check getdents64 syscall decoding. - -. "${srcdir=.}/init.sh" - -rm -rf -- "$LOG".dir -run_strace_match_diff -a24 -v diff --git a/tests-m32/getegid.c b/tests-m32/getegid.c index 98f8b9cb..2e0754b7 100644 --- a/tests-m32/getegid.c +++ b/tests-m32/getegid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/getegid.gen.test b/tests-m32/getegid.gen.test new file mode 100755 index 00000000..ddf8fa9a --- /dev/null +++ b/tests-m32/getegid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getegid +getuid.test ); do not edit. +set -- +. "${srcdir=.}/getuid.test" diff --git a/tests-m32/getegid.test b/tests-m32/getegid.test deleted file mode 100755 index 4354158b..00000000 --- a/tests-m32/getegid.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check getegid syscall decoding. - -. "${srcdir=.}/getuid.test" diff --git a/tests-m32/getegid32.c b/tests-m32/getegid32.c index d9951864..b7f5cb08 100644 --- a/tests-m32/getegid32.c +++ b/tests-m32/getegid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/getegid32.gen.test b/tests-m32/getegid32.gen.test new file mode 100755 index 00000000..a773f56a --- /dev/null +++ b/tests-m32/getegid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getegid32 +getuid.test ); do not edit. +set -- +. "${srcdir=.}/getuid.test" diff --git a/tests-m32/getegid32.test b/tests-m32/getegid32.test deleted file mode 100755 index a266620e..00000000 --- a/tests-m32/getegid32.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check getegid32 syscall decoding. - -. "${srcdir=.}/getuid.test" diff --git a/tests-m32/geteuid.c b/tests-m32/geteuid.c index ef8269f9..430df1c6 100644 --- a/tests-m32/geteuid.c +++ b/tests-m32/geteuid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/geteuid.gen.test b/tests-m32/geteuid.gen.test new file mode 100755 index 00000000..c7da2aa9 --- /dev/null +++ b/tests-m32/geteuid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (geteuid +getuid.test ); do not edit. +set -- +. "${srcdir=.}/getuid.test" diff --git a/tests-m32/geteuid.test b/tests-m32/geteuid.test deleted file mode 100755 index 14ff6a69..00000000 --- a/tests-m32/geteuid.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check geteuid syscall decoding. - -. "${srcdir=.}/getuid.test" diff --git a/tests-m32/geteuid32.c b/tests-m32/geteuid32.c index 4341e46f..94174f32 100644 --- a/tests-m32/geteuid32.c +++ b/tests-m32/geteuid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/geteuid32.gen.test b/tests-m32/geteuid32.gen.test new file mode 100755 index 00000000..75c3f12e --- /dev/null +++ b/tests-m32/geteuid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (geteuid32 +getuid.test ); do not edit. +set -- +. "${srcdir=.}/getuid.test" diff --git a/tests-m32/geteuid32.test b/tests-m32/geteuid32.test deleted file mode 100755 index 9dd173d9..00000000 --- a/tests-m32/geteuid32.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check geteuid32 syscall decoding. - -. "${srcdir=.}/getuid.test" diff --git a/tests-m32/getgid.c b/tests-m32/getgid.c index 2e060390..1bd70502 100644 --- a/tests-m32/getgid.c +++ b/tests-m32/getgid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/getgid.gen.test b/tests-m32/getgid.gen.test new file mode 100755 index 00000000..fc6ac3bc --- /dev/null +++ b/tests-m32/getgid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getgid +getuid.test ); do not edit. +set -- +. "${srcdir=.}/getuid.test" diff --git a/tests-m32/getgid.test b/tests-m32/getgid.test deleted file mode 100755 index f4f0c2e6..00000000 --- a/tests-m32/getgid.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check getgid syscall decoding. - -. "${srcdir=.}/getuid.test" diff --git a/tests-m32/getgid32.c b/tests-m32/getgid32.c index 52e4d76a..c6859cf4 100644 --- a/tests-m32/getgid32.c +++ b/tests-m32/getgid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/getgid32.gen.test b/tests-m32/getgid32.gen.test new file mode 100755 index 00000000..b3a87561 --- /dev/null +++ b/tests-m32/getgid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getgid32 +getuid.test ); do not edit. +set -- +. "${srcdir=.}/getuid.test" diff --git a/tests-m32/getgid32.test b/tests-m32/getgid32.test deleted file mode 100755 index 3bc98d1a..00000000 --- a/tests-m32/getgid32.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check getgid32 syscall decoding. - -. "${srcdir=.}/getuid.test" diff --git a/tests-m32/getgroups.c b/tests-m32/getgroups.c index 2617303f..36c095df 100644 --- a/tests-m32/getgroups.c +++ b/tests-m32/getgroups.c @@ -2,29 +2,10 @@ * Check decoding of getgroups/getgroups32 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifdef __NR_getgroups32 @@ -57,7 +38,7 @@ # include # include -#define MAX_STRLEN 32 +# define MAX_STRLEN 32 static long ngroups; static void @@ -91,7 +72,7 @@ main(void) if (ngroups < 0) perror_msg_and_fail(SYSCALL_NAME); - rc = syscall(SYSCALL_NR, (long) 0xffffffff00000000ULL, 0); + rc = syscall(SYSCALL_NR, F8ILL_KULONG_MASK, 0); printf("%s(0, NULL) = %ld\n", SYSCALL_NAME, rc); rc = syscall(SYSCALL_NR, -1U, 0); @@ -105,7 +86,7 @@ main(void) rc = syscall(SYSCALL_NR, ngroups_max, 0); printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, ngroups_max, sprintrc(rc)); - rc = syscall(SYSCALL_NR, (long) 0xffffffff00000000ULL | ngroups_max, 0); + rc = syscall(SYSCALL_NR, F8ILL_KULONG_MASK | ngroups_max, 0); printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, ngroups_max, sprintrc(rc)); /* check how the second argument is decoded */ diff --git a/tests-m32/getgroups.gen.test b/tests-m32/getgroups.gen.test new file mode 100755 index 00000000..ae196d05 --- /dev/null +++ b/tests-m32/getgroups.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getgroups -a17 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-m32/getgroups.test b/tests-m32/getgroups.test deleted file mode 100755 index 2eb3056d..00000000 --- a/tests-m32/getgroups.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getgroups syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a17 diff --git a/tests-m32/getgroups32.c b/tests-m32/getgroups32.c index d0a356de..d005792d 100644 --- a/tests-m32/getgroups32.c +++ b/tests-m32/getgroups32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/getgroups32.gen.test b/tests-m32/getgroups32.gen.test new file mode 100755 index 00000000..54b71d5f --- /dev/null +++ b/tests-m32/getgroups32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getgroups32 -a19 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests-m32/getgroups32.test b/tests-m32/getgroups32.test deleted file mode 100755 index 12a8bcc0..00000000 --- a/tests-m32/getgroups32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getgroups32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a19 diff --git a/tests-m32/getpeername.c b/tests-m32/getpeername.c index c842acec..cdc9ef08 100644 --- a/tests-m32/getpeername.c +++ b/tests-m32/getpeername.c @@ -1,30 +1,10 @@ /* * Check decoding of getpeername syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #define TEST_SYSCALL_NAME getpeername diff --git a/tests-m32/getpeername.gen.test b/tests-m32/getpeername.gen.test new file mode 100755 index 00000000..020583ab --- /dev/null +++ b/tests-m32/getpeername.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getpeername -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-m32/getpeername.test b/tests-m32/getpeername.test deleted file mode 100755 index 81f01bb1..00000000 --- a/tests-m32/getpeername.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of getpeername syscall. - -. "${srcdir=.}/getsockname.test" diff --git a/tests-m32/getpgrp.c b/tests-m32/getpgrp.c index 8b9d0882..3d45f718 100644 --- a/tests-m32/getpgrp.c +++ b/tests-m32/getpgrp.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/getpgrp.gen.test b/tests-m32/getpgrp.gen.test new file mode 100755 index 00000000..26989cdb --- /dev/null +++ b/tests-m32/getpgrp.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getpgrp -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-m32/getpgrp.test b/tests-m32/getpgrp.test deleted file mode 100755 index e116bb51..00000000 --- a/tests-m32/getpgrp.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getpgrp syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 diff --git a/tests-m32/getpid.c b/tests-m32/getpid.c new file mode 100644 index 00000000..5e88e052 --- /dev/null +++ b/tests-m32/getpid.c @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_getpid + +# include +# include + +int +main(void) +{ + printf("getpid() = %ld\n", syscall(__NR_getpid)); + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getpid") + +#endif diff --git a/tests-m32/getpid.gen.test b/tests-m32/getpid.gen.test new file mode 100755 index 00000000..2a3eb1cf --- /dev/null +++ b/tests-m32/getpid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getpid -a9 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a9 diff --git a/tests-m32/getppid.c b/tests-m32/getppid.c new file mode 100644 index 00000000..718d0691 --- /dev/null +++ b/tests-m32/getppid.c @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_getppid + +# include +# include + +int +main(void) +{ + printf("getppid() = %ld\n", syscall(__NR_getppid)); + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getppid") + +#endif diff --git a/tests-m32/getppid.gen.test b/tests-m32/getppid.gen.test new file mode 100755 index 00000000..655b0b7d --- /dev/null +++ b/tests-m32/getppid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getppid -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-m32/getrandom.c b/tests-m32/getrandom.c index de1a0874..eb6cdb1b 100644 --- a/tests-m32/getrandom.c +++ b/tests-m32/getrandom.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/getrandom.gen.test b/tests-m32/getrandom.gen.test new file mode 100755 index 00000000..2f5b9891 --- /dev/null +++ b/tests-m32/getrandom.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getrandom -a32 -s3); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -s3 diff --git a/tests-m32/getrandom.test b/tests-m32/getrandom.test deleted file mode 100755 index ad34048f..00000000 --- a/tests-m32/getrandom.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getrandom syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a32 -s3 diff --git a/tests-m32/getresgid.c b/tests-m32/getresgid.c index b8c687b1..3ad2c190 100644 --- a/tests-m32/getresgid.c +++ b/tests-m32/getresgid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/getresgid.gen.test b/tests-m32/getresgid.gen.test new file mode 100755 index 00000000..dc32c62c --- /dev/null +++ b/tests-m32/getresgid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getresgid -a25 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests-m32/getresgid.test b/tests-m32/getresgid.test deleted file mode 100755 index 9f5186e8..00000000 --- a/tests-m32/getresgid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getresgid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a25 diff --git a/tests-m32/getresgid32.c b/tests-m32/getresgid32.c index 71f11344..b78afaed 100644 --- a/tests-m32/getresgid32.c +++ b/tests-m32/getresgid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/getresgid32.gen.test b/tests-m32/getresgid32.gen.test new file mode 100755 index 00000000..0ee28299 --- /dev/null +++ b/tests-m32/getresgid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getresgid32 -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-m32/getresgid32.test b/tests-m32/getresgid32.test deleted file mode 100755 index a9798911..00000000 --- a/tests-m32/getresgid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getresgid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests-m32/getresugid.c b/tests-m32/getresugid.c index 0ee721cf..b369f8f7 100644 --- a/tests-m32/getresugid.c +++ b/tests-m32/getresugid.c @@ -2,29 +2,10 @@ * Check decoding of getresuid/getresgid/getresuid32/getresgid32 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -34,9 +15,9 @@ int main(void) { - unsigned UGID_TYPE *const r = tail_alloc(sizeof(*r)); - unsigned UGID_TYPE *const e = tail_alloc(sizeof(*e)); - unsigned UGID_TYPE *const s = tail_alloc(sizeof(*s)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned UGID_TYPE, r); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned UGID_TYPE, e); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned UGID_TYPE, s); if (syscall(SYSCALL_NR, r, e, s)) perror_msg_and_fail(SYSCALL_NAME); diff --git a/tests-m32/getresuid.c b/tests-m32/getresuid.c index b00f20ba..5bb2e301 100644 --- a/tests-m32/getresuid.c +++ b/tests-m32/getresuid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/getresuid.gen.test b/tests-m32/getresuid.gen.test new file mode 100755 index 00000000..b0f478ce --- /dev/null +++ b/tests-m32/getresuid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getresuid -a25 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests-m32/getresuid.test b/tests-m32/getresuid.test deleted file mode 100755 index eee1ac05..00000000 --- a/tests-m32/getresuid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getresuid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a25 diff --git a/tests-m32/getresuid32.c b/tests-m32/getresuid32.c index 4c9a83df..13acc695 100644 --- a/tests-m32/getresuid32.c +++ b/tests-m32/getresuid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/getresuid32.gen.test b/tests-m32/getresuid32.gen.test new file mode 100755 index 00000000..1b2f232c --- /dev/null +++ b/tests-m32/getresuid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getresuid32 -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-m32/getresuid32.test b/tests-m32/getresuid32.test deleted file mode 100755 index fdc76a31..00000000 --- a/tests-m32/getresuid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getresuid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests-m32/getrlimit.c b/tests-m32/getrlimit.c index bd9d0b0f..6d3b4cd5 100644 --- a/tests-m32/getrlimit.c +++ b/tests-m32/getrlimit.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/getrlimit.gen.test b/tests-m32/getrlimit.gen.test new file mode 100755 index 00000000..08daf2d0 --- /dev/null +++ b/tests-m32/getrlimit.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getrlimit -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-m32/getrlimit.test b/tests-m32/getrlimit.test deleted file mode 100755 index 6fd88aed..00000000 --- a/tests-m32/getrlimit.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of getrlimit syscall. - -. "${srcdir=.}/setrlimit.test" diff --git a/tests-m32/getrusage.c b/tests-m32/getrusage.c index 8b76eff6..412d8a00 100644 --- a/tests-m32/getrusage.c +++ b/tests-m32/getrusage.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2016 Fei Jie * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -35,27 +16,46 @@ # include # include # include +# include + +# include "xlat.h" +# include "xlat/usagewho.h" int -main(void) +invoke_print(int who, const char *who_str, struct rusage *usage) { - struct rusage *const usage = tail_alloc(sizeof(struct rusage)); - int rc = syscall(__NR_getrusage, RUSAGE_SELF, usage); - printf("getrusage(RUSAGE_SELF, {ru_utime={tv_sec=%jd, tv_usec=%jd}" - ", ru_stime={tv_sec=%jd, tv_usec=%jd}, ru_maxrss=%lu" + int rc = syscall(__NR_getrusage, who, usage); + int saved_errno = errno; + printf("getrusage(%s, {ru_utime={tv_sec=%lld, tv_usec=%llu}" + ", ru_stime={tv_sec=%lld, tv_usec=%llu}, ru_maxrss=%lu" ", ru_ixrss=%lu, ru_idrss=%lu, ru_isrss=%lu, ru_minflt=%lu" ", ru_majflt=%lu, ru_nswap=%lu, ru_inblock=%lu" ", ru_oublock=%lu, ru_msgsnd=%lu, ru_msgrcv=%lu" - ", ru_nsignals=%lu, ru_nvcsw=%lu, ru_nivcsw=%lu}) = %d\n", - (intmax_t) usage->ru_utime.tv_sec, - (intmax_t) usage->ru_utime.tv_usec, - (intmax_t) usage->ru_stime.tv_sec, - (intmax_t) usage->ru_stime.tv_usec, + ", ru_nsignals=%lu, ru_nvcsw=%lu, ru_nivcsw=%lu}) = %s\n", + who_str, + (long long) usage->ru_utime.tv_sec, + zero_extend_signed_to_ull(usage->ru_utime.tv_usec), + (long long) usage->ru_stime.tv_sec, + zero_extend_signed_to_ull(usage->ru_stime.tv_usec), usage->ru_maxrss, usage->ru_ixrss, usage->ru_idrss, usage->ru_isrss, usage->ru_minflt, usage->ru_majflt, usage->ru_nswap, usage->ru_inblock, usage->ru_oublock, usage->ru_msgsnd, usage->ru_msgrcv, usage->ru_nsignals, - usage->ru_nvcsw, usage->ru_nivcsw, rc); + usage->ru_nvcsw, usage->ru_nivcsw, sprintrc(rc)); + errno = saved_errno; + return rc; +} + +int +main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct rusage, usage); + if (invoke_print(ARG_STR(RUSAGE_SELF), usage)) { + perror_msg_and_fail("RUSAGE_SELF"); + } + if (invoke_print(ARG_STR(RUSAGE_THREAD), usage) && errno != EINVAL) { + perror_msg_and_fail("RUSAGE_THREAD"); + } puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/getrusage.gen.test b/tests-m32/getrusage.gen.test new file mode 100755 index 00000000..161818aa --- /dev/null +++ b/tests-m32/getrusage.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getrusage -v ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v diff --git a/tests-m32/getrusage.test b/tests-m32/getrusage.test deleted file mode 100755 index 4a3e8ed0..00000000 --- a/tests-m32/getrusage.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getrusage syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v diff --git a/tests-m32/getsid.c b/tests-m32/getsid.c index b563de9d..588ea4ab 100644 --- a/tests-m32/getsid.c +++ b/tests-m32/getsid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include diff --git a/tests-m32/getsid.gen.test b/tests-m32/getsid.gen.test new file mode 100755 index 00000000..2b9084a4 --- /dev/null +++ b/tests-m32/getsid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getsid -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-m32/getsid.test b/tests-m32/getsid.test deleted file mode 100755 index 3fcf9799..00000000 --- a/tests-m32/getsid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getsid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 diff --git a/tests-m32/getsockname.c b/tests-m32/getsockname.c index 66ac4e63..8883015c 100644 --- a/tests-m32/getsockname.c +++ b/tests-m32/getsockname.c @@ -1,30 +1,10 @@ /* * Check decoding of getsockname syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #define TEST_SYSCALL_NAME getsockname diff --git a/tests-m32/getsockname.gen.test b/tests-m32/getsockname.gen.test new file mode 100755 index 00000000..64cdeea8 --- /dev/null +++ b/tests-m32/getsockname.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getsockname -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-m32/getsockname.test b/tests-m32/getsockname.test deleted file mode 100755 index 99b28506..00000000 --- a/tests-m32/getsockname.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of getsockname syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests-m32/gettid.c b/tests-m32/gettid.c new file mode 100644 index 00000000..24947e89 --- /dev/null +++ b/tests-m32/gettid.c @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +int +main(void) +{ + printf("gettid() = %ld\n", syscall(__NR_gettid)); + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/gettid.gen.test b/tests-m32/gettid.gen.test new file mode 100755 index 00000000..f5ad317e --- /dev/null +++ b/tests-m32/gettid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (gettid -a9 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a9 diff --git a/tests-m32/getuid.c b/tests-m32/getuid.c index 57311f72..56f6c902 100644 --- a/tests-m32/getuid.c +++ b/tests-m32/getuid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/getuid.test b/tests-m32/getuid.test index 9aaf74ba..a0bbb3ed 100755 --- a/tests-m32/getuid.test +++ b/tests-m32/getuid.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check getuid syscall decoding. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -9,4 +14,3 @@ run_prog > /dev/null run_strace -qq -a9 -e$NAME $args > "$EXP" uniq < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" -rm -f "$OUT" "$EXP" diff --git a/tests-m32/getuid32.c b/tests-m32/getuid32.c index 397dd08f..1222dbcb 100644 --- a/tests-m32/getuid32.c +++ b/tests-m32/getuid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/getuid32.gen.test b/tests-m32/getuid32.gen.test new file mode 100755 index 00000000..e81eb064 --- /dev/null +++ b/tests-m32/getuid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getuid32 +getuid.test ); do not edit. +set -- +. "${srcdir=.}/getuid.test" diff --git a/tests-m32/getuid32.test b/tests-m32/getuid32.test deleted file mode 100755 index ae0c557b..00000000 --- a/tests-m32/getuid32.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check getuid32 syscall decoding. - -. "${srcdir=.}/getuid.test" diff --git a/tests-m32/getxxid.c b/tests-m32/getxxid.c index 6eee52c5..864cea5b 100644 --- a/tests-m32/getxxid.c +++ b/tests-m32/getxxid.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/getxxid.gen.test b/tests-m32/getxxid.gen.test new file mode 100755 index 00000000..5aa89f65 --- /dev/null +++ b/tests-m32/getxxid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getxxid -a10 -e trace=getxpid,getxuid,getxgid); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 -e trace=getxpid,getxuid,getxgid diff --git a/tests-m32/getxxid.test b/tests-m32/getxxid.test deleted file mode 100755 index 9b89d7cf..00000000 --- a/tests-m32/getxxid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getxpid, getxuid, and getxgid syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 -e trace=getxpid,getxuid,getxgid diff --git a/tests-m32/group_req.c b/tests-m32/group_req.c new file mode 100644 index 00000000..6a804bd2 --- /dev/null +++ b/tests-m32/group_req.c @@ -0,0 +1,141 @@ +/* + * Check decoding of MCAST_JOIN_GROUP/MCAST_LEAVE_GROUP. + * + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2017-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include + +#if defined MCAST_JOIN_GROUP && defined MCAST_LEAVE_GROUP + +# include +# include +# include +# include +# include + +# define multi4addr "224.0.0.3" +# define multi6addr "ff01::c" + +static const char *errstr; + +static int +set_opt(const int fd, const int level, const int opt, + const void *const val, const socklen_t len) +{ + int rc = setsockopt(fd, level, opt, val, len); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct group_req, greq4); + TAIL_ALLOC_OBJECT_CONST_PTR(struct group_req, greq6); + unsigned int i; + + greq6->gr_interface = greq4->gr_interface = ifindex_lo(); + if (!greq4->gr_interface) + perror_msg_and_skip("lo"); + + greq4->gr_group.ss_family = AF_INET; + inet_pton(AF_INET, multi4addr, &greq4->gr_group.ss_family + 2); + + greq6->gr_group.ss_family = AF_INET6; + inet_pton(AF_INET6, multi6addr, &greq6->gr_group.ss_family + 4); + + (void) close(0); + if (socket(AF_INET, SOCK_DGRAM, 0)) + perror_msg_and_skip("socket"); + + struct { + const int level; + const char *const str_level; + const int name; + const char *const str_name; + const struct group_req *const val; + const char *const addr; + } opts[] = { + { + ARG_STR(SOL_IP), ARG_STR(MCAST_JOIN_GROUP), greq4, + "gr_group={sa_family=AF_INET, sin_port=htons(65535)" + ", sin_addr=inet_addr(\"" multi4addr "\")}" + }, + { + ARG_STR(SOL_IP), ARG_STR(MCAST_LEAVE_GROUP), greq4, + "gr_group={sa_family=AF_INET, sin_port=htons(65535)" + ", sin_addr=inet_addr(\"" multi4addr "\")}" + }, + { + ARG_STR(SOL_IPV6), ARG_STR(MCAST_JOIN_GROUP), greq6, + "gr_group={sa_family=AF_INET6, sin6_port=htons(65535)" + ", sin6_flowinfo=htonl(4294967295)" + ", inet_pton(AF_INET6, \"" multi6addr "\", &sin6_addr)" + ", sin6_scope_id=4294967295}" + }, + { + ARG_STR(SOL_IPV6), ARG_STR(MCAST_LEAVE_GROUP), greq6, + "gr_group={sa_family=AF_INET6, sin6_port=htons(65535)" + ", sin6_flowinfo=htonl(4294967295)" + ", inet_pton(AF_INET6, \"" multi6addr "\", &sin6_addr)" + ", sin6_scope_id=4294967295}" + } + }; + + for (i = 0; i < ARRAY_SIZE(opts); ++i) { + /* optlen < 0, EINVAL */ + set_opt(0, opts[i].level, opts[i].name, opts[i].val, -1U); + printf("setsockopt(0, %s, %s, %p, -1) = %s\n", + opts[i].str_level, opts[i].str_name, + opts[i].val, errstr); + + /* optlen < sizeof(struct group_req), EINVAL */ + set_opt(0, opts[i].level, opts[i].name, opts[i].val, + sizeof(*opts[i].val) - 1); + printf("setsockopt(0, %s, %s, %p, %u) = %s\n", + opts[i].str_level, opts[i].str_name, + opts[i].val, (unsigned int) sizeof(*opts[i].val) - 1, + errstr); + + /* optval EFAULT */ + set_opt(0, opts[i].level, opts[i].name, + (const char *) opts[i].val + 1, sizeof(*opts[i].val)); + printf("setsockopt(0, %s, %s, %p, %u) = %s\n", + opts[i].str_level, opts[i].str_name, + (const char *) opts[i].val + 1, + (unsigned int) sizeof(*opts[i].val), errstr); + + /* classic */ + set_opt(0, opts[i].level, opts[i].name, + opts[i].val, sizeof(*opts[i].val)); + printf("setsockopt(0, %s, %s" + ", {gr_interface=%s, %s}, %u) = %s\n", + opts[i].str_level, opts[i].str_name, + IFINDEX_LO_STR, opts[i].addr, + (unsigned int) sizeof(*opts[i].val), errstr); + + /* optlen > sizeof(struct group_req), shortened */ + set_opt(0, opts[i].level, opts[i].name, opts[i].val, INT_MAX); + printf("setsockopt(0, %s, %s" + ", {gr_interface=%s, %s}, %u) = %s\n", + opts[i].str_level, opts[i].str_name, + IFINDEX_LO_STR, opts[i].addr, + INT_MAX, errstr); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("MCAST_JOIN_GROUP && MCAST_LEAVE_GROUP") + +#endif diff --git a/tests-m32/group_req.gen.test b/tests-m32/group_req.gen.test new file mode 100755 index 00000000..0e753b6e --- /dev/null +++ b/tests-m32/group_req.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (group_req -e trace=setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt diff --git a/tests-m32/hexdump_strdup.c b/tests-m32/hexdump_strdup.c index 4d6b53f4..d2b83448 100644 --- a/tests-m32/hexdump_strdup.c +++ b/tests-m32/hexdump_strdup.c @@ -1,30 +1,10 @@ /* * Make a hexdump copy of C string * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/hexquote_strndup.c b/tests-m32/hexquote_strndup.c index 3ad3970c..bb1e101e 100644 --- a/tests-m32/hexquote_strndup.c +++ b/tests-m32/hexquote_strndup.c @@ -1,30 +1,10 @@ /* * Make a hexquoted copy of a string * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/ifindex.c b/tests-m32/ifindex.c new file mode 100644 index 00000000..ae0eaa1f --- /dev/null +++ b/tests-m32/ifindex.c @@ -0,0 +1,35 @@ +/* + * Proxy wrappers for if_nametoindex. + * + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_IF_INDEXTONAME + +# include + +unsigned int +ifindex_lo(void) +{ + static unsigned int index; + + if (!index) + index = if_nametoindex("lo"); + + return index; +} + +#else /* !HAVE_IF_INDEXTONAME */ + +unsigned int +ifindex_lo(void) +{ + return 1; +} + +#endif diff --git a/tests-m32/inet-cmsg.c b/tests-m32/inet-cmsg.c index b530016d..44ae4c64 100644 --- a/tests-m32/inet-cmsg.c +++ b/tests-m32/inet-cmsg.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -38,9 +19,10 @@ static void print_pktinfo(const struct cmsghdr *c) { - printf("IP_PKTINFO, cmsg_data={ipi_ifindex=if_nametoindex(\"lo\")" - ", ipi_spec_dst=inet_addr(\"127.0.0.1\")" - ", ipi_addr=inet_addr(\"127.0.0.1\")}"); + printf("IP_PKTINFO, cmsg_data={ipi_ifindex=%s" + ", ipi_spec_dst=inet_addr(\"%s\")" + ", ipi_addr=inet_addr(\"%s\")}", + IFINDEX_LO_STR, "127.0.0.1", "127.0.0.1"); } static void diff --git a/tests-m32/inet-cmsg.gen.test b/tests-m32/inet-cmsg.gen.test new file mode 100755 index 00000000..8eeb7c90 --- /dev/null +++ b/tests-m32/inet-cmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (inet-cmsg -e trace=recvmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=recvmsg diff --git a/tests-m32/inet-cmsg.test b/tests-m32/inet-cmsg.test deleted file mode 100755 index 52ff5f59..00000000 --- a/tests-m32/inet-cmsg.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check IPPROTO_IP control messages decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=recvmsg diff --git a/tests-m32/init.sh b/tests-m32/init.sh index f368b98a..40e62188 100644 --- a/tests-m32/init.sh +++ b/tests-m32/init.sh @@ -1,35 +1,16 @@ #!/bin/sh # # Copyright (c) 2011-2016 Dmitry V. Levin +# Copyright (c) 2011-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later +export LC_ALL=C ME_="${0##*/}" -LOG="$ME_.tmp" -OUT="$LOG.out" -EXP="$LOG.exp" -NAME="${ME_%.test}" +LOG="log" +OUT="out" +EXP="exp" warn_() { printf >&2 '%s\n' "$*"; } fail_() { warn_ "$ME_: failed test: $*"; exit 1; } @@ -45,14 +26,14 @@ check_prog() dump_log_and_fail_with() { - cat < "$LOG" + cat < "$LOG" >&2 fail_ "$*" } run_prog() { if [ $# -eq 0 ]; then - set -- "./$NAME" + set -- "../$NAME" fi args="$*" "$@" || { @@ -72,6 +53,20 @@ run_prog_skip_if_failed() "$@" || framework_skip_ "$args failed with code $?" } +try_run_prog() +{ + local rc + + "$@" > /dev/null || { + rc=$? + if [ $rc -eq 77 ]; then + return 1 + else + fail_ "$* failed with code $rc" + fi + } +} + run_strace() { > "$LOG" || fail_ "failed to write $LOG" @@ -155,7 +150,7 @@ match_diff() check_prog diff - diff -- "$expected" "$output" || + diff -u -- "$expected" "$output" || fail_ "$error" } @@ -213,7 +208,17 @@ run_strace_match_diff() run_prog > /dev/null run_strace "$@" $args > "$EXP" match_diff "$LOG" "$EXP" - rm -f "$EXP" +} + +# Usage: run_strace_match_grep [args to run_strace] +run_strace_match_grep() +{ + args="$*" + [ -n "$args" -a -z "${args##*-e trace=*}" ] || + set -- -e trace="$NAME" "$@" + run_prog > /dev/null + run_strace "$@" $args > "$EXP" + match_grep "$LOG" "$EXP" } # Print kernel version code. @@ -223,7 +228,7 @@ kernel_version_code() ( set -f IFS=. - set -- $1 + set -- $1 0 0 v1="${1%%[!0-9]*}" && [ -n "$v1" ] || v1=0 v2="${2%%[!0-9]*}" && [ -n "$v2" ] || v2=0 v3="${3%%[!0-9]*}" && [ -n "$v3" ] || v3=0 @@ -250,22 +255,117 @@ grep_pid_status() cat < "/proc/$pid/status" | grep "$@" } +# Subtracts one program set from another. +# If an optional regular expression is specified, the lines in the minuend file +# that match this regular expression are elso excluded from the output. +# +# Usage: prog_set_subtract minuend_file subtrahend_file [subtrahend_regexp] +prog_set_subtract() +{ + local min sub re pat + min="$1"; shift + sub="$1"; shift + re="${1-}" + pat="$re|$(sed 's/[[:space:]].*//' < "$sub" | tr -s '\n' '|')" + grep -E -v -x -e "$pat" < "$min" +} + +# Usage: test_pure_prog_set [--expfile FILE] COMMON_ARGS < tests_file +# stdin should consist of lines in "test_name strace_args..." format. +test_pure_prog_set() +{ + local expfile + + expfile="$EXP" + + while [ -n "$1" ]; do + case "$1" in + --expfile) + shift + expfile="$1" + shift + ;; + *) + break + ;; + esac + done + + while read -r t prog_args; do { + # skip lines beginning with "#" symbol + [ "${t###}" = "$t" ] || continue + + try_run_prog "../$t" || continue + run_strace $prog_args "$@" "../$t" > "$expfile" + match_diff "$LOG" "$expfile" + } < /dev/null; done +} + +# Run strace against list of programs put in "$NAME.in" and then against the +# rest of pure_executables.list with the expectation of empty output in the +# latter case. +# +# Usage: source this file after init.sh and call: +# test_trace_expr subtrahend_regexp strace_args +# Environment: +# $NAME: test name, used for "$NAME.in" file containing list of tests +# for positive trace expression match; +# $srcdir: used to find pure_executables.list and "$NAME.in" files. +# Files created: +# negative.list: File containing list of tests for negative match. +test_trace_expr() +{ + local subtrahend_regexp + subtrahend_regexp="$1"; shift + test_pure_prog_set "$@" < "$srcdir/$NAME.in" + prog_set_subtract "$srcdir/pure_executables.list" "$srcdir/$NAME.in" \ + "$subtrahend_regexp" > negative.list + test_pure_prog_set --expfile /dev/null -qq -esignal=none "$@" \ + < negative.list +} + check_prog cat check_prog rm -rm -f "$LOG" +case "$ME_" in + *.gen.test) NAME="${ME_%.gen.test}" ;; + *.test) NAME="${ME_%.test}" ;; + *) NAME= +esac + +STRACE_EXE= +if [ -n "$NAME" ]; then + TESTDIR="$NAME.dir" + rm -rf -- "$TESTDIR" + mkdir -- "$TESTDIR" + cd "$TESTDIR" + + case "$srcdir" in + /*) ;; + *) srcdir="../$srcdir" ;; + esac -[ -n "${STRACE-}" ] || { - STRACE=../strace - case "${LOG_COMPILER-} ${LOG_FLAGS-}" in - *--suppressions=*--error-exitcode=*--tool=*) + [ -n "${STRACE-}" ] || { + STRACE=../../strace + case "${LOG_COMPILER-} ${LOG_FLAGS-}" in + *--suppressions=*--error-exitcode=*--tool=*) + STRACE_EXE="$STRACE" # add valgrind command prefix STRACE="${LOG_COMPILER-} ${LOG_FLAGS-} $STRACE" ;; - esac -} + esac + } + + trap 'dump_log_and_fail_with "time limit ($TIMEOUT_DURATION) exceeded"' XCPU +else + : "${STRACE:=../strace}" +fi + +# Export $STRACE_EXE to check_PROGRAMS. +: "${STRACE_EXE:=$STRACE}" +export STRACE_EXE -: "${TIMEOUT_DURATION:=60}" +: "${TIMEOUT_DURATION:=600}" : "${SLEEP_A_BIT:=sleep 1}" [ -z "${VERBOSE-}" ] || diff --git a/tests-m32/init_delete_module.h b/tests-m32/init_delete_module.h index db550c33..85a4a396 100644 --- a/tests-m32/init_delete_module.h +++ b/tests-m32/init_delete_module.h @@ -3,33 +3,14 @@ * and delete_module tests. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef STRACE_TESTS_INIT_DELETE_MODULE_H -#define STRACE_TESTS_INIT_DELETE_MODULE_H +# define STRACE_TESTS_INIT_DELETE_MODULE_H # include # include @@ -42,9 +23,6 @@ enum { MAX_STRLEN = 32, }; -static const kernel_ulong_t bogus_zero = - (kernel_ulong_t) 0xffffffff00000000ULL; - static void print_str(unsigned int base, unsigned int len, bool escape) { diff --git a/tests-m32/init_module.c b/tests-m32/init_module.c index 88ef9ec8..601f7f92 100644 --- a/tests-m32/init_module.c +++ b/tests-m32/init_module.c @@ -2,29 +2,10 @@ * Check decoding of init_module syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -55,9 +36,9 @@ main(void) fill_memory_ex(bogus_param1, PARAM1_LEN, PARAM1_BASE, PARAM1_LEN); fill_memory_ex(bogus_param2, PARAM2_LEN, PARAM2_BASE, PARAM2_LEN); - rc = syscall(__NR_init_module, NULL, bogus_zero, NULL); + rc = syscall(__NR_init_module, NULL, F8ILL_KULONG_MASK, NULL); printf("init_module(NULL, %llu, NULL) = %s\n", - (unsigned long long) bogus_zero, sprintrc(rc)); + (unsigned long long) F8ILL_KULONG_MASK, sprintrc(rc)); rc = syscall(__NR_init_module, bogus_addr, 0, bogus_param1); errstr = sprintrc(rc); diff --git a/tests-m32/init_module.gen.test b/tests-m32/init_module.gen.test new file mode 100755 index 00000000..b6961be6 --- /dev/null +++ b/tests-m32/init_module.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (init_module -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-m32/init_module.test b/tests-m32/init_module.test deleted file mode 100755 index ef7c7325..00000000 --- a/tests-m32/init_module.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of init_module syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests-m32/inject-nf.c b/tests-m32/inject-nf.c new file mode 100644 index 00000000..b419984f --- /dev/null +++ b/tests-m32/inject-nf.c @@ -0,0 +1,66 @@ +/* + * Check decoding of return values injected into a syscall that "never fails". + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include + +#include "raw_syscall.h" + +#ifdef __alpha__ +/* alpha has no getpid */ +# define SC_NR __NR_getpgrp +# define SC_NAME "getpgrp" +# define getpid getpgrp +#else +# define SC_NR __NR_getpid +# define SC_NAME "getpid" +#endif + +#ifdef raw_syscall_0 +# define INVOKE_SC(err) raw_syscall_0(SC_NR, &err) +#else +/* No raw_syscall_0, let's use getpid() and hope for the best. */ +# define INVOKE_SC(err) getpid() +#endif + +/* + * This prototype is intentionally different + * from the prototype provided by . + */ +extern kernel_ulong_t getpid(void); + +int +main(int ac, char **av) +{ + assert(ac == 1 || ac == 2); + + kernel_ulong_t expected = + (ac == 1) ? getpid() : strtoull(av[1], NULL, 0); + kernel_ulong_t err = 0; + kernel_ulong_t rc = INVOKE_SC(err); + + if (err || rc != expected) + error_msg_and_fail("expected %#llx, got rval=%#llx err=%#llx", + (unsigned long long) expected, + (unsigned long long) rc, + (unsigned long long) err); + + if (ac == 2) { + printf("%s() = %llu (INJECTED)\n", + SC_NAME, (unsigned long long) rc); + + puts("+++ exited with 0 +++"); + } + + return 0; +} diff --git a/tests-m32/inject-nf.test b/tests-m32/inject-nf.test new file mode 100755 index 00000000..cadb5adb --- /dev/null +++ b/tests-m32/inject-nf.test @@ -0,0 +1,55 @@ +#!/bin/sh -efu +# +# Check decoding of return values injected into a syscall that "never fails". +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +case "$STRACE_ARCH" in +alpha) + SYSCALL=getpgrp + ;; +*) + SYSCALL=getpid + ;; +esac + +run_prog +prog="$args" +fault_args="-a9 -e trace=${SYSCALL} -e inject=${SYSCALL}:retval=" + +test_rval() +{ + local rval + rval="$1"; shift + + run_strace $fault_args$rval $prog $rval > "$EXP" + match_diff "$LOG" "$EXP" +} + +test_rval 0 +test_rval 1 +test_rval 0x7fffffff +test_rval 0x80000000 +test_rval 0xfffff000 +test_rval 0xfffffffe +test_rval 0xffffffff + +case "$SIZEOF_KERNEL_LONG_T" in +8) + test_rval 0x80000000 + test_rval 0xfffff000 + test_rval 0xfffffffe + test_rval 0xffffffff + test_rval 0x100000000 + test_rval 0x7fffffffffffffff + test_rval 0x8000000000000000 + test_rval 0xfffffffffffff000 + test_rval 0xfffffffffffffffe + test_rval 0xffffffffffffffff + ;; +esac diff --git a/tests-m32/inode_of_sockfd.c b/tests-m32/inode_of_sockfd.c index b227f306..b9ad78ee 100644 --- a/tests-m32/inode_of_sockfd.c +++ b/tests-m32/inode_of_sockfd.c @@ -2,38 +2,19 @@ * This file is part of strace test suite. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include +#include #include #include #include #include -#include unsigned long inode_of_sockfd(const int fd) diff --git a/tests-m32/inotify.c b/tests-m32/inotify.c index 925d69ff..db751d4e 100644 --- a/tests-m32/inotify.c +++ b/tests-m32/inotify.c @@ -2,29 +2,10 @@ * Check decoding of inotify_add_watch and inotify_rm_watch syscalls. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -52,8 +33,8 @@ main(void) static const char *bogus_mask_str = "IN_ACCESS|IN_ATTRIB|" "IN_CLOSE_WRITE|IN_OPEN|IN_MOVED_TO|IN_DELETE|IN_DELETE_SELF|" "IN_MOVE_SELF|IN_Q_OVERFLOW|IN_IGNORED|IN_ONLYDIR|" - "IN_DONT_FOLLOW|IN_EXCL_UNLINK|IN_MASK_ADD|IN_ISDIR|IN_ONESHOT|" - "0x18ff1000"; + "IN_DONT_FOLLOW|IN_EXCL_UNLINK|IN_MASK_CREATE|IN_MASK_ADD|" + "IN_ISDIR|IN_ONESHOT|0x8ff1000"; long rc; char *bogus_path = tail_memdup(bogus_path_str.path, diff --git a/tests-m32/inotify.gen.test b/tests-m32/inotify.gen.test new file mode 100755 index 00000000..70102065 --- /dev/null +++ b/tests-m32/inotify.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (inotify -a23 -e trace=inotify_add_watch,inotify_rm_watch); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 -e trace=inotify_add_watch,inotify_rm_watch diff --git a/tests-m32/inotify.test b/tests-m32/inotify.test deleted file mode 100755 index 436f3bc8..00000000 --- a/tests-m32/inotify.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of inotify_add_watch and inotify_rm_watch syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=inotify_add_watch,inotify_rm_watch -a23 diff --git a/tests-m32/inotify_init1.c b/tests-m32/inotify_init1.c index 0325150d..4f352b70 100644 --- a/tests-m32/inotify_init1.c +++ b/tests-m32/inotify_init1.c @@ -2,29 +2,10 @@ * Check decoding of inotify_init1 syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/inotify_init1.gen.test b/tests-m32/inotify_init1.gen.test new file mode 100755 index 00000000..a1060c5d --- /dev/null +++ b/tests-m32/inotify_init1.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (inotify_init1 -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-m32/inotify_init1.test b/tests-m32/inotify_init1.test deleted file mode 100755 index 1a7c9261..00000000 --- a/tests-m32/inotify_init1.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of inotify_init1 syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests-m32/int_0x80.c b/tests-m32/int_0x80.c new file mode 100644 index 00000000..abdc94a7 --- /dev/null +++ b/tests-m32/int_0x80.c @@ -0,0 +1,32 @@ +/* + * Check decoding of int 0x80 on x86_64, x32, and x86. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#if defined __x86_64__ || defined __i386__ + +# include +# include + +int +main(void) +{ + /* 200 is __NR_getgid32 on x86 and __NR_tkill on x86_64. */ + __asm__("movl $200, %eax; int $0x80"); + printf("getgid32() = %d\n", getegid()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__x86_64__ || __i386__") + +#endif diff --git a/tests-m32/int_0x80.test b/tests-m32/int_0x80.test new file mode 100755 index 00000000..6b3ca25f --- /dev/null +++ b/tests-m32/int_0x80.test @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Check decoding of int 0x80 on x86_64, x32, and x86. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +$STRACE -d -enone / > /dev/null 2> "$LOG" +grep -x "[^:]*strace: PTRACE_GET_SYSCALL_INFO works" "$LOG" > /dev/null || + skip_ 'PTRACE_GET_SYSCALL_INFO does not work' + +run_strace_match_diff -a11 -e trace=getgid32 diff --git a/tests-m32/interactive_block.test b/tests-m32/interactive_block.test new file mode 100755 index 00000000..57df767a --- /dev/null +++ b/tests-m32/interactive_block.test @@ -0,0 +1,20 @@ +#!/bin/sh +# +# Check that in interactive mode those signals that were blocked +# at strace startup will remain blocked. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +strace0="$STRACE" +for signo in 1 2 3 13 14 15; do + blocksig="../block_reset_raise_run $signo" + run_prog $blocksig ../umovestr + STRACE="$blocksig $strace0" + run_strace -I2 -echdir ../umovestr + match_diff "$LOG" "$srcdir/umovestr.expected" +done diff --git a/tests-m32/io_uring_enter.c b/tests-m32/io_uring_enter.c new file mode 100644 index 00000000..3284ebac --- /dev/null +++ b/tests-m32/io_uring_enter.c @@ -0,0 +1,83 @@ +/* + * Check decoding of io_uring_enter syscall. + * + * Copyright (c) 2019 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include "scno.h" + +#ifdef __NR_io_uring_enter + +# include +# include +# include +# include + +static const char *errstr; + +static long +sys_io_uring_enter(unsigned int fd, unsigned int to_submit, + unsigned int min_complete, unsigned int flags, + const void *sigset_addr, kernel_ulong_t sigset_size) + +{ + kernel_ulong_t fill = (kernel_ulong_t) 0xdefaced00000000ULL; + kernel_ulong_t arg1 = fill | fd; + kernel_ulong_t arg2 = fill | to_submit; + kernel_ulong_t arg3 = fill | min_complete; + kernel_ulong_t arg4 = fill | flags; + kernel_ulong_t arg5 = (unsigned long) sigset_addr; + kernel_ulong_t arg6 = sigset_size; + + long rc = syscall(__NR_io_uring_enter, + arg1, arg2, arg3, arg4, arg5, arg6); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const char path[] = "/dev/null"; + + skip_if_unavailable("/proc/self/fd/"); + + int fd = open(path, O_RDONLY); + if (fd < 0) + perror_msg_and_fail("open: %s", path); + + const unsigned int size = get_sigset_size(); + void *const sigmask = tail_alloc(size); + sigset_t mask; + + memset(&mask, -1, sizeof(mask)); + sigdelset(&mask, SIGHUP); + sigdelset(&mask, SIGKILL); + sigdelset(&mask, SIGSTOP); + memcpy(sigmask, &mask, size); + + const unsigned int to_submit = 0xdeadbeef; + const unsigned int min_complete = 0xcafef00d; + + sys_io_uring_enter(fd, to_submit, min_complete, -1U, sigmask, size); + printf("io_uring_enter(%u<%s>, %u, %u" + ", IORING_ENTER_GETEVENTS|IORING_ENTER_SQ_WAKEUP|%#x" + ", %s, %u) = %s\n", + fd, path, to_submit, min_complete, -1U - 3, + "~[HUP KILL STOP]", size, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_io_uring_enter") + +#endif diff --git a/tests-m32/io_uring_enter.gen.test b/tests-m32/io_uring_enter.gen.test new file mode 100755 index 00000000..7e68909e --- /dev/null +++ b/tests-m32/io_uring_enter.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (io_uring_enter -y ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -y diff --git a/tests-m32/io_uring_register.c b/tests-m32/io_uring_register.c new file mode 100644 index 00000000..a0327ed8 --- /dev/null +++ b/tests-m32/io_uring_register.c @@ -0,0 +1,100 @@ +/* + * Check decoding of io_uring_register syscall. + * + * Copyright (c) 2019 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include "scno.h" + +#ifdef __NR_io_uring_register + +# include +# include +# include +# include + +static const char *errstr; + +static long +sys_io_uring_register(unsigned int fd, unsigned int opcode, + const void *arg, unsigned int nargs) + +{ + kernel_ulong_t fill = (kernel_ulong_t) 0xdefaced00000000ULL; + kernel_ulong_t bad = (kernel_ulong_t) 0xbadc0dedbadc0dedULL; + kernel_ulong_t arg1 = fill | fd; + kernel_ulong_t arg2 = fill | opcode; + kernel_ulong_t arg3 = (unsigned long) arg; + kernel_ulong_t arg4 = fill | nargs; + + long rc = syscall(__NR_io_uring_register, + arg1, arg2, arg3, arg4, bad, bad); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const char path_null[] = "/dev/null"; + static const char path_full[] = "/dev/full"; + const struct iovec iov[] = { + { + .iov_base = (void *) (unsigned long) 0xfacefeedcafef00d, + .iov_len = (unsigned long) 0xdeadfacebeefcafe + }, + { + .iov_base = (void *) path_null, + .iov_len = sizeof(path_null) + } + }; + const struct iovec *arg_iov = tail_memdup(iov, sizeof(iov)); + + skip_if_unavailable("/proc/self/fd/"); + + int fd_null = open(path_null, O_RDONLY); + if (fd_null < 0) + perror_msg_and_fail("open: %s", path_null); + + int fd_full = open(path_full, O_RDONLY); + if (fd_full < 0) + perror_msg_and_fail("open: %s", path_null); + + int fds[] = { fd_full, fd_null }; + const int *arg_fds = tail_memdup(fds, sizeof(fds)); + + sys_io_uring_register(fd_null, 0xbadc0ded, path_null, 0xdeadbeef); + printf("io_uring_register(%u<%s>, %#x /* IORING_REGISTER_??? */" + ", %p, %u) = %s\n", + fd_null, path_null, 0xbadc0ded, path_null, 0xdeadbeef, errstr); + + sys_io_uring_register(fd_null, 0, arg_iov, ARRAY_SIZE(iov)); + printf("io_uring_register(%u<%s>, IORING_REGISTER_BUFFERS" + ", [{iov_base=%p, iov_len=%lu}, {iov_base=%p, iov_len=%lu}]" + ", %u) = %s\n", + fd_null, path_null, iov[0].iov_base, + (unsigned long) iov[0].iov_len, + iov[1].iov_base, (unsigned long) iov[1].iov_len, + (unsigned int) ARRAY_SIZE(iov), errstr); + + sys_io_uring_register(fd_null, 2, arg_fds, ARRAY_SIZE(fds)); + printf("io_uring_register(%u<%s>, IORING_REGISTER_FILES" + ", [%u<%s>, %u<%s>], %u) = %s\n", + fd_null, path_null, fd_full, path_full, fd_null, path_null, + (unsigned int) ARRAY_SIZE(fds), errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_io_uring_register") + +#endif diff --git a/tests-m32/io_uring_register.gen.test b/tests-m32/io_uring_register.gen.test new file mode 100755 index 00000000..b3fda203 --- /dev/null +++ b/tests-m32/io_uring_register.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (io_uring_register -y ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -y diff --git a/tests-m32/io_uring_setup.c b/tests-m32/io_uring_setup.c new file mode 100644 index 00000000..f48095bb --- /dev/null +++ b/tests-m32/io_uring_setup.c @@ -0,0 +1,103 @@ +/* + * Check decoding of io_uring_setup syscall. + * + * Copyright (c) 2019 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include "scno.h" + +#if defined HAVE_LINUX_IO_URING_H && defined __NR_io_uring_setup + +# include +# include +# include +# include + +# include "print_fields.h" + +static const char *errstr; + +static long +sys_io_uring_setup(uint32_t nentries, const void *params) +{ + kernel_ulong_t fill = (kernel_ulong_t) 0xdefaced00000000ULL; + kernel_ulong_t bad = (kernel_ulong_t) 0xbadc0dedbadc0dedULL; + kernel_ulong_t arg1 = fill | nentries; + kernel_ulong_t arg2 = (unsigned long) params; + + long rc = syscall(__NR_io_uring_setup, arg1, arg2, bad, bad, bad, bad); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + long rc; + TAIL_ALLOC_OBJECT_CONST_PTR(struct io_uring_params, params); + const void *efault = (const void *) params + 1; + + skip_if_unavailable("/proc/self/fd/"); + + sys_io_uring_setup(-1U, NULL); + printf("io_uring_setup(%u, NULL) = %s\n", -1U, errstr); + + sys_io_uring_setup(0, efault); + printf("io_uring_setup(%u, %p) = %s\n", 0, efault, errstr); + + fill_memory(params, sizeof(*params)); + params->flags = -1; + sys_io_uring_setup(1, params); + printf("io_uring_setup(%u, {flags=IORING_SETUP_IOPOLL" + "|IORING_SETUP_SQPOLL|IORING_SETUP_SQ_AFF|%#x" + ", sq_thread_cpu=%#x, sq_thread_idle=%u, resv={", + 1, -1U - 7, params->sq_thread_cpu, params->sq_thread_idle); + for (unsigned int i = 0; i < ARRAY_SIZE(params->resv); ++i) + printf("%s%#x", i ? ", " : "", params->resv[i]); + printf("}}) = %s\n", errstr); + + memset(params, 0, sizeof(*params)); + rc = sys_io_uring_setup(2, params); + printf("io_uring_setup(%u, {flags=0, sq_thread_cpu=0" + ", sq_thread_idle=0", 2); + if (rc < 0) + printf("}) = %s\n", errstr); + else + printf(", sq_entries=%u, cq_entries=%u" + ", sq_off={head=%u, tail=%u, ring_mask=%u" + ", ring_entries=%u, flags=%u, dropped=%u, array=%u}" + ", cq_off={head=%u, tail=%u, ring_mask=%u" + ", ring_entries=%u, overflow=%u, cqes=%u}" + "}) = %ld\n", + params->sq_entries, + params->cq_entries, + params->sq_off.head, + params->sq_off.tail, + params->sq_off.ring_mask, + params->sq_off.ring_entries, + params->sq_off.flags, + params->sq_off.dropped, + params->sq_off.array, + params->cq_off.head, + params->cq_off.tail, + params->cq_off.ring_mask, + params->cq_off.ring_entries, + params->cq_off.overflow, + params->cq_off.cqes, + rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_IO_URING_H && __NR_io_uring_setup") + +#endif diff --git a/tests-m32/io_uring_setup.gen.test b/tests-m32/io_uring_setup.gen.test new file mode 100755 index 00000000..bec63a8a --- /dev/null +++ b/tests-m32/io_uring_setup.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (io_uring_setup -a26 -y); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a26 -y diff --git a/tests-m32/ioctl.c b/tests-m32/ioctl.c index 92a3191d..ec4e3670 100644 --- a/tests-m32/ioctl.c +++ b/tests-m32/ioctl.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -53,16 +34,16 @@ && defined EV_KEY int -main(void ) +main(void) { uint64_t data = 0; -#ifndef POWERPC +# ifndef POWERPC struct termios tty; (void) ioctl(-1, TCGETS, &tty); printf("ioctl(-1, TCGETS, %p)" " = -1 EBADF (%m)\n", &tty); -#endif +# endif (void) ioctl(-1, MMTIMER_GETRES, &data); printf("ioctl(-1, MMTIMER_GETRES, %p)" @@ -85,8 +66,13 @@ main(void ) " = -1 EBADF (%m)\n", &data); (void) ioctl(-1, _IOR('M', 13, int), &data); +# ifdef HAVE_STRUCT_MTD_WRITE_REQ printf("ioctl(-1, MIXER_READ(13) or OTPSELECT, [MTD_OTP_OFF])" " = -1 EBADF (%m)\n"); +# else + printf("ioctl(-1, MIXER_READ(13) or OTPSELECT, %p)" + " = -1 EBADF (%m)\n", &data); +# endif (void) ioctl(-1, _IOC(_IOC_WRITE, 0xde, 0, 0), (kernel_ulong_t) -1ULL); printf("ioctl(-1, _IOC(_IOC_WRITE, 0xde, 0, 0), %#lx)" diff --git a/tests-m32/ioctl.test b/tests-m32/ioctl.test index 94bc5d42..5e11f589 100755 --- a/tests-m32/ioctl.test +++ b/tests-m32/ioctl.test @@ -1,15 +1,16 @@ #!/bin/sh - +# # Check ioctl syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog > /dev/null -run_strace -a16 -eioctl $args > "$EXP" check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" +run_prog > /dev/null +run_strace -a16 -eioctl "$@" $args > "$EXP" +grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" - -exit 0 diff --git a/tests-m32/ioctl_block.c b/tests-m32/ioctl_block.c index f62b0b36..65f434c8 100644 --- a/tests-m32/ioctl_block.c +++ b/tests-m32/ioctl_block.c @@ -2,29 +2,10 @@ * This file is part of ioctl_block strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -57,9 +38,11 @@ static struct xlat block_argless[] = { #endif }; -#define TEST_NULL_ARG(cmd) \ - ioctl(-1, cmd, 0); \ - printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd) +#define TEST_NULL_ARG(cmd) \ + do { \ + ioctl(-1, cmd, 0); \ + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd); \ + } while (0) int main(void) @@ -113,7 +96,7 @@ main(void) ioctl(-1, BLKFRASET, lmagic); printf("ioctl(-1, BLKFRASET, %lu) = -1 EBADF (%m)\n", lmagic); - int *const val_int = tail_alloc(sizeof(*val_int)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, val_int); *val_int = magic; ioctl(-1, BLKROSET, val_int); @@ -144,19 +127,19 @@ main(void) " = -1 EBADF (%m)\n", pair_int64[0], pair_int64[1]); #endif - struct blkpg_ioctl_arg *const blkpg = tail_alloc(sizeof(*blkpg)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct blkpg_ioctl_arg, blkpg); blkpg->op = 3; blkpg->flags = 0xdeadbeef; blkpg->datalen = 0xbadc0ded; blkpg->data = (void *) (unsigned long) 0xcafef00dfffffeedULL; ioctl(-1, BLKPG, blkpg); - printf("ioctl(-1, BLKPG, {%s, flags=%d, datalen=%d" + printf("ioctl(-1, BLKPG, {op=%s, flags=%d, datalen=%d" ", data=%#lx}) = -1 EBADF (%m)\n", "BLKPG_RESIZE_PARTITION", blkpg->flags, blkpg->datalen, (unsigned long) blkpg->data); - struct blkpg_partition *const bp = tail_alloc(sizeof(*bp)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct blkpg_partition, bp); bp->start = 0xfac1fed2dad3bef4ULL; bp->length = 0xfac5fed6dad7bef8ULL; bp->pno = magic; @@ -166,9 +149,9 @@ main(void) blkpg->data = bp; ioctl(-1, BLKPG, blkpg); - printf("ioctl(-1, BLKPG, {%s, flags=%d, datalen=%d" + printf("ioctl(-1, BLKPG, {op=%s, flags=%d, datalen=%d" ", data={start=%lld, length=%lld, pno=%d" - ", devname=\"%.*s\", volname=\"%.*s\"}})" + ", devname=\"%.*s\"..., volname=\"%.*s\"...}})" " = -1 EBADF (%m)\n", "BLKPG_ADD_PARTITION", blkpg->flags, blkpg->datalen, @@ -177,7 +160,7 @@ main(void) (int) sizeof(bp->volname) - 1, bp->volname); #if defined BLKTRACESETUP && defined HAVE_STRUCT_BLK_USER_TRACE_SETUP - struct blk_user_trace_setup *const buts = tail_alloc(sizeof(*buts)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct blk_user_trace_setup, buts); fill_memory(buts, sizeof(*buts)); ioctl(-1, BLKTRACESETUP, buts); diff --git a/tests-m32/ioctl_block.gen.test b/tests-m32/ioctl_block.gen.test new file mode 100755 index 00000000..8b2c3df6 --- /dev/null +++ b/tests-m32/ioctl_block.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_block +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_block.test b/tests-m32/ioctl_block.test deleted file mode 100755 index 0bf2500f..00000000 --- a/tests-m32/ioctl_block.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of BLK* ioctls. - -. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_dm-v.gen.test b/tests-m32/ioctl_dm-v.gen.test new file mode 100755 index 00000000..66fa5856 --- /dev/null +++ b/tests-m32/ioctl_dm-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_dm-v +ioctl.test -v -s9); do not edit. +set -- -v -s9 +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_dm-v.test b/tests-m32/ioctl_dm-v.test deleted file mode 100755 index ade3b9e8..00000000 --- a/tests-m32/ioctl_dm-v.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check unabbreviated decoding of DM* ioctls. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a16 -s9 -veioctl $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-m32/ioctl_dm.c b/tests-m32/ioctl_dm.c index 08f036c6..f05528f9 100644 --- a/tests-m32/ioctl_dm.c +++ b/tests-m32/ioctl_dm.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Mikulas Patocka * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -34,7 +15,6 @@ # include # include -# include # include # include # include @@ -53,6 +33,10 @@ # define ALIGNED_OFFSET(t_, m_) \ ALIGNED_SIZE(offsetof(t_, m_), t_) +# ifndef DM_DEV_ARM_POLL +# define DM_DEV_ARM_POLL _IOWR(DM_IOCTL, 0x10, struct dm_ioctl) +# endif + static const char str129[] = STR32 STR32 STR32 STR32 "6"; static const __u64 dts_sector_base = (__u64) 0xdeadca75facef157ULL; @@ -138,7 +122,7 @@ init_dm_target_spec(struct dm_target_spec *ptr, uint32_t id) ptr->length = dts_length_base + dts_length_step * id; ptr->status = dts_status_base + dts_status_step * id; - strncpy(ptr->target_type, str129 + + memcpy(ptr->target_type, str129 + id % (sizeof(str129) - sizeof(ptr->target_type)), id % (sizeof(ptr->target_type) + 1)); if (id % (sizeof(ptr->target_type) + 1) < sizeof(ptr->target_type)) @@ -181,6 +165,7 @@ main(void) { ARG_STR(DM_TABLE_CLEAR), false }, { ARG_STR(DM_TABLE_DEPS), true }, { ARG_STR(DM_TABLE_STATUS), true }, + { ARG_STR(DM_DEV_ARM_POLL), false }, }; struct dm_ioctl *unaligned_dm_arg = @@ -234,23 +219,23 @@ main(void) dm_arg->version[1] = 0xbadc0dee; dm_arg->version[2] = 0xbadc0def; ioctl(-1, DM_VERSION, dm_arg); - printf("ioctl(-1, DM_VERSION, {version=%u.%u.%u, " - "/* Unsupported device mapper ABI version */ ...}) = " + printf("ioctl(-1, DM_VERSION, {version=%u.%u.%u" + " /* unsupported device mapper ABI version */}) = " "-1 EBADF (%m)\n", 0xbadc0ded, 0xbadc0dee, 0xbadc0def); /* Incorrect data_size */ init_s(dm_arg, 14, 64); ioctl(-1, DM_VERSION, dm_arg); - printf("ioctl(-1, DM_VERSION, {version=4.1.2, data_size=14, " - "/* Incorrect data_size */ ...}) = -1 EBADF (%m)\n"); + printf("ioctl(-1, DM_VERSION, {version=4.1.2, data_size=14" + " /* data_size too small */}) = -1 EBADF (%m)\n"); /* Unterminated name/uuid */ init_s(dm_arg, min_sizeof_dm_ioctl, 0); - strncpy(dm_arg->name, str129, sizeof(dm_arg->name)); - strncpy(dm_arg->uuid, str129, sizeof(dm_arg->uuid)); + memcpy(dm_arg->name, str129, sizeof(dm_arg->name)); + memcpy(dm_arg->uuid, str129, sizeof(dm_arg->uuid)); ioctl(-1, DM_VERSION, dm_arg); printf("ioctl(-1, DM_VERSION, {version=4.1.2, data_size=%zu, " - "dev=makedev(18, 52), name=\"%.127s\", uuid=\"%.128s\", " + "dev=makedev(0x12, 0x34), name=\"%.127s\"..., uuid=\"%.128s\"..., " "flags=0}) = -1 EBADF (%m)\n", min_sizeof_dm_ioctl, str129, str129); @@ -259,7 +244,7 @@ main(void) ioctl(-1, DM_VERSION, dm_arg); printf("ioctl(-1, DM_VERSION, " "{version=4.1.2, data_size=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0}) = " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0}) = " "-1 EBADF (%m)\n", min_sizeof_dm_ioctl); /* Zero dev, name, uuid */ @@ -279,7 +264,7 @@ main(void) ioctl(-1, DM_VERSION, dm_arg); printf("ioctl(-1, DM_VERSION, " "{version=4.1.2, data_size=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=" + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=" "DM_READONLY_FLAG|DM_SUSPEND_FLAG|DM_EXISTS_FLAG|" "DM_PERSISTENT_DEV_FLAG|DM_STATUS_TABLE_FLAG|" "DM_ACTIVE_PRESENT_FLAG|DM_INACTIVE_PRESENT_FLAG|" @@ -295,7 +280,7 @@ main(void) ioctl(-1, DM_VERSION, &s); printf("ioctl(-1, DM_VERSION, " "{version=4.1.2, data_size=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0}) = " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0}) = " "-1 EBADF (%m)\n", sizeof(s.ioc)); @@ -325,7 +310,7 @@ main(void) init_s(dm_arg, min_sizeof_dm_ioctl, 0); ioctl(-1, dummy_check_cmds[i].arg, dm_arg); printf("ioctl(-1, %s, {version=4.1.2, data_size=%zu%s, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\"%s, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\"%s, " "flags=0}) = -1 EBADF (%m)\n", dummy_check_cmds[i].str, min_sizeof_dm_ioctl, dummy_check_cmds[i].has_params ? ", data_start=0" : "", @@ -340,14 +325,14 @@ main(void) ioctl(-1, DM_DEV_SUSPEND, &s); printf("ioctl(-1, DM_DEV_SUSPEND, " "{version=4.1.2, data_size=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "flags=DM_SUSPEND_FLAG}) = -1 EBADF (%m)\n", sizeof(s.ioc)); init_s(&s.ioc, sizeof(s.ioc), 0); s.ioc.event_nr = 0xbadc0ded; ioctl(-1, DM_DEV_SUSPEND, &s); printf("ioctl(-1, DM_DEV_SUSPEND, " - "{version=4.1.2, data_size=%zu, dev=makedev(18, 52), " + "{version=4.1.2, data_size=%zu, dev=makedev(0x12, 0x34), " "name=\"nnn\", uuid=\"uuu\", event_nr=3134983661, " "flags=0}) = -1 EBADF (%m)\n", sizeof(s.ioc)); @@ -364,7 +349,7 @@ main(void) ioctl(-1, DM_TABLE_LOAD, &s); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%u, data_start=%u, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=1, flags=0, " # if VERBOSE "{sector_start=16, length=32, target_type=\"tgt\", " @@ -381,7 +366,7 @@ main(void) ioctl(-1, DM_TABLE_LOAD, dm_arg); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=0, flags=0}) = -1 EBADF (%m)\n", sizeof(*dm_arg), min_sizeof_dm_ioctl); @@ -392,11 +377,11 @@ main(void) ioctl(-1, DM_TABLE_LOAD, dm_arg); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%zu, data_start=%u, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=1234, flags=0, " # if VERBOSE - "/* misplaced struct dm_target_spec */ ..." -# else /* !VERBOSE */ + "??? /* misplaced struct dm_target_spec */" +# else "..." # endif /* VERBOSE */ "}) = -1 EBADF (%m)\n", sizeof(*dm_arg), 0xfffffff8); @@ -409,7 +394,7 @@ main(void) ioctl(-1, DM_TABLE_LOAD, dm_arg_open1); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=3735936673, flags=0, " # if VERBOSE "%p" @@ -437,7 +422,7 @@ main(void) errstr = sprintrc(rc); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=2, flags=0, ", sizeof(*dm_arg_open2), offsetof(struct dm_table_open_test, target1)); @@ -481,7 +466,7 @@ main(void) errstr = sprintrc(rc); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=4, flags=0, ", offsetof(struct dm_table_open_test, target5), offsetof(struct dm_table_open_test, target0)); @@ -491,13 +476,13 @@ main(void) print_dm_target_spec(&dm_arg_open3->target1, 15); printf("\"\\377\"}, "); print_dm_target_spec(&dm_arg_open3->target1, 42); - printf("\"\\1\\2\"}, /* misplaced struct dm_target_spec */ ..."); + printf("\"\\1\\2\"}, ??? /* misplaced struct dm_target_spec */"); # else /* !VERBOSE */ printf("..."); # endif /* VERBOSE */ printf("}) = %s\n", errstr); - #define FILL_DM_TARGET(id, id_next) \ +# define FILL_DM_TARGET(id, id_next) \ do { \ init_dm_target_spec(&dm_arg_open3->target##id, id); \ dm_arg_open3->target##id.next = \ @@ -505,10 +490,10 @@ main(void) target##id_next) - \ offsetof(struct dm_table_open_test, \ target##id); \ - strncpy(dm_arg_open3->param##id, str129 + id * 2, id); \ + memcpy(dm_arg_open3->param##id, str129 + id * 2, id); \ dm_arg_open3->param##id[id] = '\0'; \ } while (0) - #define PRINT_DM_TARGET(id) \ +# define PRINT_DM_TARGET(id) \ do { \ print_dm_target_spec(&dm_arg_open3->target##id, id); \ printf("\"%.*s\"}, ", id, str129 + id * 2); \ @@ -532,7 +517,7 @@ main(void) errstr = sprintrc(rc); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=3134983661, flags=0, ", sizeof(*dm_arg_open3), offsetof(struct dm_table_open_test, target0)); @@ -558,7 +543,7 @@ main(void) ioctl(-1, DM_TARGET_MSG, &s); printf("ioctl(-1, DM_TARGET_MSG, " "{version=4.1.2, data_size=%u, data_start=%u, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0, " # if VERBOSE "{sector=4660, message=\"long targ\"...}" # else /* !VERBOSE */ @@ -573,9 +558,9 @@ main(void) ioctl(-1, DM_TARGET_MSG, dm_arg); printf("ioctl(-1, DM_TARGET_MSG, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0, " # if VERBOSE - "/* misplaced struct dm_target_msg */" + "??? /* misplaced struct dm_target_msg */" # else /* !VERBOSE */ "..." # endif /* VERBOSE */ @@ -588,9 +573,9 @@ main(void) ioctl(-1, DM_TARGET_MSG, dm_arg); printf("ioctl(-1, DM_TARGET_MSG, " "{version=4.1.2, data_size=%zu, data_start=%u, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0, " # if VERBOSE - "/* misplaced struct dm_target_msg */" + "??? /* misplaced struct dm_target_msg */" # else /* !VERBOSE */ "..." # endif /* VERBOSE */ @@ -604,7 +589,7 @@ main(void) ioctl(-1, DM_TARGET_MSG, dm_arg); printf("ioctl(-1, DM_TARGET_MSG, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0, " # if VERBOSE "%p" # else /* !VERBOSE */ @@ -627,7 +612,7 @@ main(void) errstr = sprintrc(rc); printf("ioctl(-1, DM_TARGET_MSG, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, ", + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0, ", sizeof(*dm_arg_msg) + 1, offsetof(struct dm_target_msg_test, msg)); # if VERBOSE @@ -648,7 +633,7 @@ main(void) errstr = sprintrc(rc); printf("ioctl(-1, DM_TARGET_MSG, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, ", + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0, ", sizeof(*dm_arg_msg), offsetof(struct dm_target_msg_test, msg)); # if VERBOSE printf("{sector=%" PRI__u64 ", message=\"\"}", @@ -665,7 +650,7 @@ main(void) ioctl(-1, DM_DEV_SET_GEOMETRY, &s); printf("ioctl(-1, DM_DEV_SET_GEOMETRY, " "{version=4.1.2, data_size=%u, data_start=%u, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0, " # if VERBOSE "string=\"10 20 30 \"..." # else /* !VERBOSE */ @@ -683,7 +668,7 @@ main(void) ioctl(-1, DM_DEV_RENAME, unaligned_dm_arg); printf("ioctl(-1, DM_DEV_RENAME, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", event_nr=0, " "flags=0, " # if VERBOSE "string=%p" @@ -703,10 +688,10 @@ main(void) ioctl(-1, DM_DEV_RENAME, &s); printf("ioctl(-1, DM_DEV_RENAME, " "{version=4.1.2, data_size=%u, data_start=3735928559, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", event_nr=0, " "flags=0, " # if VERBOSE - "/* misplaced string */" + "??? /* misplaced string */" # else /* !VERBOSE */ "..." # endif /* VERBOSE */ @@ -720,7 +705,7 @@ main(void) ioctl(-1, DM_DEV_RENAME, &s); printf("ioctl(-1, DM_DEV_RENAME, " "{version=4.1.2, data_size=%u, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", event_nr=0, " "flags=0, " # if VERBOSE "string=\"nn\"" @@ -737,7 +722,7 @@ main(void) ioctl(-1, DM_DEV_RENAME, &s); printf("ioctl(-1, DM_DEV_RENAME, " "{version=4.1.2, data_size=%u, data_start=%u, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", event_nr=0, " "flags=0, " # if VERBOSE "string=\"new long \"..." @@ -754,13 +739,15 @@ main(void) ioctl(-1, DM_TABLE_LOAD, &s); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%u, data_start=%u, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=4294967295, flags=0, " # if VERBOSE - "{sector_start=0, length=0, target_type=\"\", string=\"\"}, " - "/* misplaced struct dm_target_spec */ " + "{sector_start=0, length=0, target_type=\"\", string=\"\"}" + ", ??? /* misplaced struct dm_target_spec */" +# else + "..." # endif /* VERBOSE */ - "...}) = -1 EBADF (%m)\n", + "}) = -1 EBADF (%m)\n", s.ioc.data_size, s.ioc.data_start); puts("+++ exited with 0 +++"); diff --git a/tests-m32/ioctl_dm.gen.test b/tests-m32/ioctl_dm.gen.test new file mode 100755 index 00000000..b60c7175 --- /dev/null +++ b/tests-m32/ioctl_dm.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_dm +ioctl.test -s9); do not edit. +set -- -s9 +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_dm.test b/tests-m32/ioctl_dm.test deleted file mode 100755 index 64852051..00000000 --- a/tests-m32/ioctl_dm.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check decoding of DM* ioctls. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a16 -s9 -eioctl $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-m32/ioctl_evdev-success-v.c b/tests-m32/ioctl_evdev-success-v.c new file mode 100644 index 00000000..6fc35477 --- /dev/null +++ b/tests-m32/ioctl_evdev-success-v.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "ioctl_evdev-success.c" diff --git a/tests-m32/ioctl_evdev-success-v.test b/tests-m32/ioctl_evdev-success-v.test new file mode 100755 index 00000000..faedee30 --- /dev/null +++ b/tests-m32/ioctl_evdev-success-v.test @@ -0,0 +1,18 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +: ${IOCTL_INJECT_START=256} +: ${IOCTL_INJECT_RETVAL=8} + +run_prog +run_strace -a16 -v -e trace=ioctl \ + -e inject=ioctl:retval="${IOCTL_INJECT_RETVAL}":when="${IOCTL_INJECT_START}+" \ + ../ioctl_evdev-success-v "${IOCTL_INJECT_START}" "${IOCTL_INJECT_RETVAL}"> "$EXP" +grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests-m32/ioctl_evdev-success.c b/tests-m32/ioctl_evdev-success.c new file mode 100644 index 00000000..7887d417 --- /dev/null +++ b/tests-m32/ioctl_evdev-success.c @@ -0,0 +1,239 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_INPUT_H + +# include +# include +# include +# include +# include +# include "print_fields.h" + +static const char *errstr; + +struct evdev_check { + unsigned long cmd; + const char *cmd_str; + void *arg_ptr; + void (*print_arg)(long rc, void *ptr, void *arg); +}; + +static long +invoke_test_syscall(unsigned long cmd, void *p) +{ + long rc = ioctl(-1, cmd, p); + errstr = sprintrc(rc); + static char inj_errstr[4096]; + + snprintf(inj_errstr, sizeof(inj_errstr), "%s (INJECTED)", errstr); + errstr = inj_errstr; + return rc; +} + +static void +test_evdev(struct evdev_check *check, void *arg) +{ + long rc = invoke_test_syscall(check->cmd, check->arg_ptr); + printf("ioctl(-1, %s, ", check->cmd_str); + if (check->print_arg) + check->print_arg(rc, check->arg_ptr, arg); + else + printf("%p", check->arg_ptr); + printf(") = %s\n", errstr); +} + +static void +print_input_absinfo(long rc, void *ptr, void *arg) +{ + struct input_absinfo *absinfo = ptr; + + if (rc < 0) { + printf("%p", absinfo); + return; + } + PRINT_FIELD_U("{", *absinfo, value); + PRINT_FIELD_U(", ", *absinfo, minimum); +# if VERBOSE + PRINT_FIELD_U(", ", *absinfo, maximum); + PRINT_FIELD_U(", ", *absinfo, fuzz); + PRINT_FIELD_U(", ", *absinfo, flat); +# ifdef HAVE_STRUCT_INPUT_ABSINFO_RESOLUTION + PRINT_FIELD_U(", ", *absinfo, resolution); +# endif +# else + printf(", ..."); +# endif + printf("}"); +} + +static void +print_input_id(long rc, void *ptr, void *arg) +{ + struct input_id *id = ptr; + + if (rc < 0) { + printf("%p", id); + return; + } + printf("{ID_BUS=%" PRIu16 + ", ID_VENDOR=%" PRIu16 + ", ID_PRODUCT=%" PRIu16 + ", ID_VERSION=%" PRIu16 "}", + id->bustype, id->vendor, id->product, id->version); +} + +# ifdef EVIOCGMTSLOTS +static void +print_mtslots(long rc, void *ptr, void *arg) +{ + int *buffer = ptr; + const char **str = arg; + int num = atoi(*(str + 1)); + + if (rc < 0) { + printf("%p", buffer); + return; + } + + printf("{code=%s", *str); + printf(", values=["); + for (unsigned int i = 1; i <= (unsigned) num; i++) + printf("%s%s", i > 1 ? ", " : "", *(str + i + 1)); + printf("]}"); +} +# endif + +static void +print_getbit(long rc, void *ptr, void *arg) +{ + const char **str = arg; + int num = atoi(*str); + + if (rc < 0) { + printf("%p", ptr); + return; + } + + printf("["); + printf("%s", *(str + 1)); + for (unsigned int i = 2; i <= (unsigned) num; i++) { +# if ! VERBOSE + if (i > 4) { + printf(", ..."); + break; + } +# endif + printf(", "); + printf("%s", *(str + i)); + } + printf("]"); +} + +int +main(int argc, char **argv) +{ + unsigned long num_skip; + long inject_retval; + bool locked = false; + + if (argc == 1) + return 0; + + if (argc < 3) + error_msg_and_fail("Usage: %s NUM_SKIP INJECT_RETVAL", argv[0]); + + num_skip = strtoul(argv[1], NULL, 0); + inject_retval = strtol(argv[2], NULL, 0); + + if (inject_retval < 0) + error_msg_and_fail("Expected non-negative INJECT_RETVAL, " + "but got %ld", inject_retval); + + for (unsigned int i = 0; i < num_skip; i++) { + long rc = ioctl(-1, EVIOCGID, NULL); + printf("ioctl(-1, EVIOCGID, NULL) = %s%s\n", + sprintrc(rc), + rc == inject_retval ? " (INJECTED)" : ""); + + if (rc != inject_retval) + continue; + + locked = true; + break; + } + + if (!locked) + error_msg_and_fail("Hasn't locked on ioctl(-1" + ", EVIOCGID, NULL) returning %lu", + inject_retval); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct input_id, id); + TAIL_ALLOC_OBJECT_CONST_PTR(struct input_absinfo, absinfo); + TAIL_ALLOC_OBJECT_CONST_PTR(int, bad_addr_slot); +# ifdef EVIOCGMTSLOTS + int mtslots[] = { ABS_MT_SLOT, 1, 3 }; + /* we use the second element to indicate the number of values */ + /* mtslots_str[1] is "2" so the number of values is 2 */ + const char *mtslots_str[] = { "ABS_MT_SLOT", "2", "1", "3" }; + + /* invalid flag */ + int invalid_mtslot[] = { -1, 1 }; + char invalid_str[4096]; + snprintf(invalid_str, sizeof(invalid_str), "%#x /* ABS_MT_??? */", invalid_mtslot[0]); + const char *invalid_mtslot_str[] = { invalid_str, "1", "1" }; +# endif + + /* set more than 4 bits */ + unsigned long ev_more[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED | 1 << EV_SND | 1 << EV_PWR }; + /* we use the first element to indicate the number of set bits */ + /* ev_more_str[0] is "5" so the number of set bits is 5 */ + const char *ev_more_str[] = { "5", "EV_ABS", "EV_MSC", "EV_LED", "EV_SND", "EV_PWR" }; + + /* set less than 4 bits */ + unsigned long ev_less[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED }; + const char *ev_less_str[] = { "3", "EV_ABS", "EV_MSC", "EV_LED" }; + + /* set zero bit */ + unsigned long ev_zero[] = { 0x0 }; + const char *ev_zero_str[] = { "0", " 0 " }; + + /* KEY_MAX is 0x2ff which is greater than retval * 8 */ + unsigned long key[] = { 1 << KEY_1 | 1 << KEY_2, 0 }; + const char *key_str[] = { "2", "KEY_1", "KEY_2" }; + + struct { + struct evdev_check check; + void *ptr; + } a[] = { + { { ARG_STR(EVIOCGID), id, print_input_id }, NULL }, + { { ARG_STR(EVIOCGABS(ABS_X)), absinfo, print_input_absinfo }, NULL }, + { { ARG_STR(EVIOCGABS(ABS_Y)), absinfo, print_input_absinfo }, NULL }, + { { ARG_STR(EVIOCGABS(ABS_Y)), absinfo, print_input_absinfo }, NULL }, + { { ARG_STR(EVIOCGBIT(0, 0)), ev_more, print_getbit }, &ev_more_str }, + { { ARG_STR(EVIOCGBIT(0, 0)), ev_less, print_getbit }, &ev_less_str }, + { { ARG_STR(EVIOCGBIT(0, 0)), ev_zero, print_getbit }, &ev_zero_str }, + { { ARG_STR(EVIOCGBIT(EV_KEY, 0)), key, print_getbit }, &key_str}, +# ifdef EVIOCGMTSLOTS + { { ARG_STR(EVIOCGMTSLOTS(12)), mtslots, print_mtslots }, &mtslots_str }, + { { ARG_STR(EVIOCGMTSLOTS(8)), invalid_mtslot, print_mtslots }, &invalid_mtslot_str } +# endif + }; + for (unsigned int i = 0; i < ARRAY_SIZE(a); i++) { + test_evdev(&a[i].check, a[i].ptr); + } + + puts("+++ exited with 0 +++"); + return 0; +} +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_INPUT_H") + +#endif diff --git a/tests-m32/ioctl_evdev-success.test b/tests-m32/ioctl_evdev-success.test new file mode 100755 index 00000000..54b0a20a --- /dev/null +++ b/tests-m32/ioctl_evdev-success.test @@ -0,0 +1,18 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +: ${IOCTL_INJECT_START=256} +: ${IOCTL_INJECT_RETVAL=8} + +run_prog +run_strace -a16 -e trace=ioctl \ + -e inject=ioctl:retval="${IOCTL_INJECT_RETVAL}":when="${IOCTL_INJECT_START}+" \ + ../ioctl_evdev-success "${IOCTL_INJECT_START}" "${IOCTL_INJECT_RETVAL}"> "$EXP" +grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests-m32/ioctl_evdev-v.gen.test b/tests-m32/ioctl_evdev-v.gen.test new file mode 100755 index 00000000..bf74ef4c --- /dev/null +++ b/tests-m32/ioctl_evdev-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_evdev-v +ioctl.test -v); do not edit. +set -- -v +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_evdev-v.test b/tests-m32/ioctl_evdev-v.test deleted file mode 100755 index 87941010..00000000 --- a/tests-m32/ioctl_evdev-v.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check verbose decoding EVIOC* ioctls. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a16 -veioctl $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-m32/ioctl_evdev.c b/tests-m32/ioctl_evdev.c index d12323ee..02be472c 100644 --- a/tests-m32/ioctl_evdev.c +++ b/tests-m32/ioctl_evdev.c @@ -2,29 +2,10 @@ * This file is part of ioctl_evdev strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -38,6 +19,13 @@ # include # include +# ifndef EV_SW +# define EV_SW 5 +# endif +# ifndef ABS_MT_TOOL_Y +# define ABS_MT_TOOL_Y 0x3d +# endif + static const unsigned int magic = 0xdeadbeef; static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; @@ -66,9 +54,13 @@ print_ffe_common(const struct ff_effect *const ffe, const char *const type_str) # endif /* VERBOSE */ } -# define TEST_NULL_ARG(cmd) \ - ioctl(-1, cmd, 0); \ - printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd) +# define TEST_NULL_ARG_EX(cmd, str) \ + do { \ + ioctl(-1, cmd, 0); \ + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", str); \ + } while (0) + +# define TEST_NULL_ARG(cmd) TEST_NULL_ARG_EX(cmd, #cmd) int main(void) @@ -102,6 +94,7 @@ main(void) TEST_NULL_ARG(EVIOCGLED(0)); # ifdef EVIOCGMTSLOTS TEST_NULL_ARG(EVIOCGMTSLOTS(0)); + TEST_NULL_ARG(EVIOCGMTSLOTS(8)); # endif # ifdef EVIOCGPROP TEST_NULL_ARG(EVIOCGPROP(0)); @@ -114,14 +107,24 @@ main(void) TEST_NULL_ARG(EVIOCGABS(ABS_X)); TEST_NULL_ARG(EVIOCSABS(ABS_X)); - TEST_NULL_ARG(EVIOCGBIT(EV_SYN, 0)); + TEST_NULL_ARG_EX(EVIOCGABS(0xe), "EVIOCGABS(0xe /* ABS_??? */)"); + TEST_NULL_ARG_EX(EVIOCSABS(0xe), "EVIOCSABS(0xe /* ABS_??? */)"); + + TEST_NULL_ARG(EVIOCGABS(ABS_MT_TOOL_Y)); + TEST_NULL_ARG(EVIOCSABS(ABS_MT_TOOL_Y)); + + TEST_NULL_ARG_EX(EVIOCGABS(0x3e), "EVIOCGABS(0x3e /* ABS_??? */)"); + TEST_NULL_ARG_EX(EVIOCSABS(0x3e), "EVIOCSABS(0x3e /* ABS_??? */)"); + + TEST_NULL_ARG_EX(EVIOCGABS(0x3f), "EVIOCGABS(0x3f /* ABS_??? */)"); + TEST_NULL_ARG_EX(EVIOCSABS(0x3f), "EVIOCSABS(0x3f /* ABS_??? */)"); + + TEST_NULL_ARG(EVIOCGBIT(0, 0)); TEST_NULL_ARG(EVIOCGBIT(EV_KEY, 1)); TEST_NULL_ARG(EVIOCGBIT(EV_REL, 2)); TEST_NULL_ARG(EVIOCGBIT(EV_ABS, 3)); TEST_NULL_ARG(EVIOCGBIT(EV_MSC, 4)); -# ifdef EV_SW TEST_NULL_ARG(EVIOCGBIT(EV_SW, 5)); -# endif TEST_NULL_ARG(EVIOCGBIT(EV_LED, 6)); TEST_NULL_ARG(EVIOCGBIT(EV_SND, 7)); TEST_NULL_ARG(EVIOCGBIT(EV_REP, 8)); @@ -129,6 +132,12 @@ main(void) TEST_NULL_ARG(EVIOCGBIT(EV_PWR, 10)); TEST_NULL_ARG(EVIOCGBIT(EV_FF_STATUS, 11)); + TEST_NULL_ARG_EX(EVIOCGBIT(0x6, 12), "EVIOCGBIT(0x6 /* EV_??? */, 12)"); + TEST_NULL_ARG_EX(EVIOCGBIT(0x18, 13), + "EVIOCGBIT(0x18 /* EV_??? */, 13)"); + TEST_NULL_ARG_EX(EVIOCGBIT(0x1f, 14), + "EVIOCGBIT(0x1f /* EV_??? */, 14)"); + ioctl(-1, EVIOCGBIT(EV_MAX, 42), 0); printf("ioctl(-1, EVIOCGBIT(%#x /* EV_??? */, 42), NULL)" " = -1 EBADF (%m)\n", EV_MAX); @@ -148,7 +157,7 @@ main(void) void *const page = tail_alloc(size); fill_memory(page, size); - int *const val_int = tail_alloc(sizeof(*val_int)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, val_int); *val_int = magic; # ifdef EVIOCSCLOCKID @@ -172,7 +181,7 @@ main(void) pair_int[0], "KEY_ESC"); # ifdef EVIOCSKEYCODE_V2 - struct input_keymap_entry *const ike = tail_alloc(sizeof(*ike)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct input_keymap_entry, ike); fill_memory(ike, sizeof(*ike)); ike->keycode = 2; @@ -196,24 +205,24 @@ main(void) printf("}) = -1 EBADF (%m)\n"); # endif - struct ff_effect *const ffe = tail_alloc(sizeof(*ffe)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct ff_effect, ffe); fill_memory(ffe, sizeof(*ffe)); ffe->type = FF_CONSTANT; ioctl(-1, EVIOCSFF, ffe); print_ffe_common(ffe, "FF_CONSTANT"); -# if VERBOSE +# if VERBOSE printf(", constant={level=%hd", ffe->u.constant.level); print_envelope(&ffe->u.constant.envelope); printf("}"); -# else +# else printf("..."); -# endif +# endif errno = EBADF; printf("}) = -1 EBADF (%m)\n"); -# if VERBOSE +# if VERBOSE ffe->type = FF_RAMP; ioctl(-1, EVIOCSFF, ffe); print_ffe_common(ffe, "FF_RAMP"); @@ -250,7 +259,7 @@ main(void) print_ffe_common(ffe, "0xff /* FF_??? */"); errno = EBADF; printf("}) = -1 EBADF (%m)\n"); -# endif +# endif ioctl(-1, _IOC(_IOC_READ, 0x45, 0x1, 0xff), lmagic); printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", diff --git a/tests-m32/ioctl_evdev.gen.test b/tests-m32/ioctl_evdev.gen.test new file mode 100755 index 00000000..68a43f7c --- /dev/null +++ b/tests-m32/ioctl_evdev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_evdev +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_evdev.test b/tests-m32/ioctl_evdev.test deleted file mode 100755 index 7ed2e98a..00000000 --- a/tests-m32/ioctl_evdev.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of EVIOC* ioctls. - -. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_inotify.c b/tests-m32/ioctl_inotify.c new file mode 100644 index 00000000..6be0c0ee --- /dev/null +++ b/tests-m32/ioctl_inotify.c @@ -0,0 +1,61 @@ +/* + * This file is part of ioctl_inotify strace test. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include + +#ifndef INOTIFY_IOC_SETNEXTWD +# define INOTIFY_IOC_SETNEXTWD _IOW('I', 0, int32_t) +#endif + +static long +sys_ioctl(kernel_long_t fd, kernel_ulong_t cmd, kernel_ulong_t arg) +{ + return syscall(__NR_ioctl, fd, cmd, arg); +} + +int +main(void) +{ + static const kernel_ulong_t unknown_inotify_cmd = + (kernel_ulong_t) 0xbadc0dedfeed49edULL; + static const kernel_ulong_t magic = + (kernel_ulong_t) 0xdeadbeefbadc0dedULL; + + /* Unknown inotify commands */ + sys_ioctl(-1, unknown_inotify_cmd, magic); + printf("ioctl(-1, _IOC(%s_IOC_READ|_IOC_WRITE, 0x49, %#x, %#x), " + "%#lx) = -1 EBADF (%m)\n", + _IOC_DIR((unsigned int) unknown_inotify_cmd) & _IOC_NONE ? + "_IOC_NONE|" : "", + _IOC_NR((unsigned int) unknown_inotify_cmd), + _IOC_SIZE((unsigned int) unknown_inotify_cmd), + (unsigned long) magic); + + sys_ioctl(-1, INOTIFY_IOC_SETNEXTWD + 1, magic); + printf("ioctl(-1, _IOC(_IOC_WRITE, 0x49, %#x, %#x), %#lx)" + " = -1 EBADF (%m)\n", + (unsigned int) _IOC_NR(INOTIFY_IOC_SETNEXTWD + 1), + (unsigned int) _IOC_SIZE(INOTIFY_IOC_SETNEXTWD + 1), + (unsigned long) magic); + + /* INOTIFY_IOC_SETNEXTWD */ + sys_ioctl(-1, INOTIFY_IOC_SETNEXTWD, magic); + printf("ioctl(-1, INOTIFY_IOC_SETNEXTWD, %d) = -1 EBADF (%m)\n", + (int) magic); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/ioctl_inotify.gen.test b/tests-m32/ioctl_inotify.gen.test new file mode 100755 index 00000000..237a98b8 --- /dev/null +++ b/tests-m32/ioctl_inotify.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_inotify +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_kvm_run-v.c b/tests-m32/ioctl_kvm_run-v.c new file mode 100644 index 00000000..388339b0 --- /dev/null +++ b/tests-m32/ioctl_kvm_run-v.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "ioctl_kvm_run.c" diff --git a/tests-m32/ioctl_kvm_run-v.gen.test b/tests-m32/ioctl_kvm_run-v.gen.test new file mode 100755 index 00000000..6f20ee48 --- /dev/null +++ b/tests-m32/ioctl_kvm_run-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_kvm_run-v +ioctl.test -v -a36 -y); do not edit. +set -- -v -a36 -y +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_kvm_run.c b/tests-m32/ioctl_kvm_run.c new file mode 100644 index 00000000..4a569708 --- /dev/null +++ b/tests-m32/ioctl_kvm_run.c @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "ioctl_kvm_run_common.c" + +#if need_print_KVM_RUN + +static void +print_KVM_RUN(const int fd, const char *const dev, const unsigned int reason) +{ + printf("ioctl(%d<%s>, KVM_RUN, 0) = 0\n", fd, dev); +} + +#endif diff --git a/tests-m32/ioctl_kvm_run.gen.test b/tests-m32/ioctl_kvm_run.gen.test new file mode 100755 index 00000000..7ab473ba --- /dev/null +++ b/tests-m32/ioctl_kvm_run.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_kvm_run +ioctl.test -a36 -y); do not edit. +set -- -a36 -y +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_kvm_run_auxstr_vcpu.c b/tests-m32/ioctl_kvm_run_auxstr_vcpu.c new file mode 100644 index 00000000..9140d3b2 --- /dev/null +++ b/tests-m32/ioctl_kvm_run_auxstr_vcpu.c @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#define KVM_NO_CPUID_CALLBACK \ + error_msg_and_skip("newer kernel (>= 4.16) is needed") + +#include "ioctl_kvm_run_common.c" + +#if need_print_KVM_RUN + +static void +print_KVM_RUN(const int fd, const char *const dev, const unsigned int reason) +{ + const char *str; + +# define CASE_ENTRY(R) case R: str = #R; break + switch (reason) { + CASE_ENTRY(KVM_EXIT_HLT); + CASE_ENTRY(KVM_EXIT_IO); + CASE_ENTRY(KVM_EXIT_MMIO); + default: str = "???"; + } + + printf("ioctl(%d<%s>, KVM_RUN, 0) = 0 (%s)\n", fd, dev, str); +} + +#endif diff --git a/tests-m32/ioctl_kvm_run_auxstr_vcpu.gen.test b/tests-m32/ioctl_kvm_run_auxstr_vcpu.gen.test new file mode 100755 index 00000000..d2995db8 --- /dev/null +++ b/tests-m32/ioctl_kvm_run_auxstr_vcpu.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_kvm_run_auxstr_vcpu +ioctl.test -a36 -y -e kvm=vcpu); do not edit. +set -- -a36 -y -e kvm=vcpu +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_kvm_run_common.c b/tests-m32/ioctl_kvm_run_common.c new file mode 100644 index 00000000..26e72cec --- /dev/null +++ b/tests-m32/ioctl_kvm_run_common.c @@ -0,0 +1,412 @@ +/* + * Check decoding of KVM_* commands of ioctl syscall using /dev/kvm API. + * Based on kvmtest.c from https://lwn.net/Articles/658512/ + * + * kvmtest.c author: Josh Triplett + * Copyright (c) 2015 Intel Corporation + * Copyright (c) 2017-2018 The strace developers. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include "tests.h" + +#if defined HAVE_LINUX_KVM_H \ + && defined HAVE_STRUCT_KVM_CPUID2 \ + && defined HAVE_STRUCT_KVM_REGS \ + && defined HAVE_STRUCT_KVM_SREGS \ + && defined HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION \ + &&(defined __x86_64__ || defined __i386__) + +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# ifndef KVM_MAX_CPUID_ENTRIES +# define KVM_MAX_CPUID_ENTRIES 80 +# endif + +# include "xlat.h" +# include "xlat/kvm_cpuid_flags.h" + +static int +kvm_ioctl(int fd, unsigned long cmd, const char *cmd_str, void *arg) +{ + int rc = ioctl(fd, cmd, arg); + if (rc < 0) + perror_msg_and_skip("%s", cmd_str); + return rc; +} + +# define KVM_IOCTL(fd_, cmd_, arg_) \ + kvm_ioctl((fd_), (cmd_), #cmd_, (arg_)) + +static const char dev[] = "/dev/kvm"; +static const char vm_dev[] = "anon_inode:kvm-vm"; +static char vcpu_dev[] = "anon_inode:kvm-vcpu:0"; +static size_t page_size; + +extern const char code[]; +extern const unsigned short code_size; + +__asm__( + ".type code, @object \n" + "code: \n" + " mov $0xd80003f8, %edx \n" + " mov $'\n', %al \n" + " out %al, (%dx) \n" + " hlt \n" + ".size code, . - code \n" + ".type code_size, @object \n" + "code_size: \n" + " .short . - code \n" + ".size code_size, . - code_size \n" + ); + +static void +print_kvm_segment(const struct kvm_segment *seg) +{ + printf("{base=%#jx, limit=%u, selector=%u, type=%u, present=%u, " + "dpl=%u, db=%u, s=%u, l=%u, g=%u, avl=%u}", + (uintmax_t) seg->base, seg->limit, seg->selector, seg->type, + seg->present, seg->dpl, seg->db, seg->s, seg->l, seg->g, + seg->avl); +} + +static void +print_kvm_sregs(const struct kvm_sregs *sregs) +{ + printf("{cs="); + print_kvm_segment(&sregs->cs); +# if VERBOSE + printf(", ds="); + print_kvm_segment(&sregs->ds); + printf(", es="); + print_kvm_segment(&sregs->es); + printf(", fs="); + print_kvm_segment(&sregs->fs); + printf(", gs="); + print_kvm_segment(&sregs->gs); + printf(", ss="); + print_kvm_segment(&sregs->ss); + printf(", tr="); + print_kvm_segment(&sregs->tr); + printf(", ldt="); + print_kvm_segment(&sregs->ldt); + printf(", gdt={base=%#jx, limit=%u}, idt={base=%#jx, limit=%u}, " + "cr0=%llu, cr2=%llu, cr3=%llu, cr4=%llu, cr8=%llu, efer=%llu, " + "apic_base=%#jx", (uintmax_t) sregs->gdt.base, sregs->gdt.limit, + (uintmax_t) sregs->idt.base, sregs->idt.limit, sregs->cr0, + sregs->cr2, sregs->cr3, sregs->cr4, sregs->cr8, sregs->efer, + (uintmax_t)sregs->apic_base); + printf(", interrupt_bitmap=["); + for (size_t i = 0; i < ARRAY_SIZE(sregs->interrupt_bitmap); i++) { + if (i) + printf(", "); + printf("%#jx", (uintmax_t) sregs->interrupt_bitmap[i]); + } + printf("]"); +# else + printf(", ..."); +# endif + printf("}"); +} + +static void +print_kvm_regs(const struct kvm_regs *regs) +{ + printf("{rax=%#jx", (uintmax_t) regs->rax); +# if VERBOSE + printf(", rbx=%#jx, rcx=%#jx, rdx=%#jx, rsi=%#jx, rdi=%#jx", + (uintmax_t) regs->rbx, (uintmax_t) regs->rcx, + (uintmax_t) regs->rdx, (uintmax_t) regs->rsi, + (uintmax_t) regs->rdi); +# else + printf(", ..."); +# endif + printf(", rsp=%#jx, rbp=%#jx", (uintmax_t) regs->rsp, + (uintmax_t) regs->rbp); +# if VERBOSE + printf(", r8=%#jx, r9=%#jx, r10=%#jx, r11=%#jx, r12=%#jx, r13=%#jx" + ", r14=%#jx, r15=%#jx", + (uintmax_t) regs->r8, (uintmax_t) regs->r9, + (uintmax_t) regs->r10, (uintmax_t) regs->r11, + (uintmax_t) regs->r12, (uintmax_t) regs->r13, + (uintmax_t) regs->r14, (uintmax_t) regs->r15); +# else + printf(", ..."); +# endif + printf(", rip=%#jx, rflags=%#jx}", (uintmax_t) regs->rip, + (uintmax_t) regs->rflags); +} + +# define need_print_KVM_RUN 1 + +static void +print_KVM_RUN(const int fd, const char *const dev, const unsigned int reason); + +static void +run_kvm(const int vcpu_fd, struct kvm_run *const run, const size_t mmap_size, + void *const mem) +{ + /* Initialize CS to point at 0, via a read-modify-write of sregs. */ + struct kvm_sregs sregs; + KVM_IOCTL(vcpu_fd, KVM_GET_SREGS, &sregs); + printf("ioctl(%d<%s>, KVM_GET_SREGS, ", vcpu_fd, vcpu_dev); + print_kvm_sregs(&sregs); + printf(") = 0\n"); + + sregs.cs.base = 0; + sregs.cs.selector = 0; + KVM_IOCTL(vcpu_fd, KVM_SET_SREGS, &sregs); + printf("ioctl(%d<%s>, KVM_SET_SREGS, ", vcpu_fd, vcpu_dev); + print_kvm_sregs(&sregs); + printf(") = 0\n"); + + /* + * Initialize registers: instruction pointer for our code, addends, + * and initial flags required by x86 architecture. + */ + struct kvm_regs regs = { + .rip = page_size, + .rax = 2, + .rbx = 2, + .rflags = 0x2, + }; + KVM_IOCTL(vcpu_fd, KVM_SET_REGS, ®s); + printf("ioctl(%d<%s>, KVM_SET_REGS, ", vcpu_fd, vcpu_dev); + print_kvm_regs(®s); + printf(") = 0\n"); + + /* Copy the code */ + memcpy(mem, code, code_size); + + const char *p = "\n"; + + /* Repeatedly run code and handle VM exits. */ + for (;;) { + KVM_IOCTL(vcpu_fd, KVM_RUN, NULL); + print_KVM_RUN(vcpu_fd, vcpu_dev, run->exit_reason); + + switch (run->exit_reason) { + case KVM_EXIT_HLT: + if (p) + error_msg_and_fail("premature KVM_EXIT_HLT"); + return; + case KVM_EXIT_IO: + if (run->io.direction == KVM_EXIT_IO_OUT + && run->io.size == 1 + && run->io.port == 0x03f8 + && run->io.count == 1 + && run->io.data_offset < mmap_size + && p && *p == ((char *) run)[run->io.data_offset]) + p = NULL; + else + error_msg_and_fail("unhandled KVM_EXIT_IO"); + break; + case KVM_EXIT_MMIO: + error_msg_and_fail("Got an unexpected MMIO exit:" + " phys_addr %#llx," + " data %02x %02x %02x %02x" + " %02x %02x %02x %02x," + " len %u, is_write %hhu", + (unsigned long long) run->mmio.phys_addr, + run->mmio.data[0], run->mmio.data[1], + run->mmio.data[2], run->mmio.data[3], + run->mmio.data[4], run->mmio.data[5], + run->mmio.data[6], run->mmio.data[7], + run->mmio.len, run->mmio.is_write); + + default: + error_msg_and_fail("exit_reason = %#x", + run->exit_reason); + } + } +} + +static int +vcpu_dev_should_have_cpuid(int fd) +{ + int r = 0; + char *filename = NULL; + char buf[sizeof(vcpu_dev)]; + + if (asprintf(&filename, "/proc/%d/fd/%d", getpid(), fd) < 0) + error_msg_and_fail("asprintf"); + + if (readlink(filename, buf, sizeof(buf)) == sizeof(buf) - 1 + && (memcmp(buf, vcpu_dev, sizeof(buf) - 1) == 0)) + r = 1; + free(filename); + return r; +} + +static void +print_cpuid_ioctl(int fd, const char *fd_dev, + const char *ioctl_name, const struct kvm_cpuid2 *cpuid) +{ + printf("ioctl(%d<%s>, %s, {nent=%u, entries=[", + fd, fd_dev, ioctl_name, cpuid->nent); +# if VERBOSE + for (size_t i = 0; i < cpuid->nent; i++) { + if (i) + printf(", "); + printf("{function=%#x, index=%#x, flags=", + cpuid->entries[i].function, cpuid->entries[i].index); + printflags(kvm_cpuid_flags, cpuid->entries[i].flags, + "KVM_CPUID_FLAG_???"); + printf(", eax=%#x, ebx=%#x, ecx=%#x, edx=%#x}", + cpuid->entries[i].eax, cpuid->entries[i].ebx, + cpuid->entries[i].ecx, cpuid->entries[i].edx); + } +# else + if (cpuid->nent) + printf("..."); +# endif + printf("]}) = 0\n"); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int kvm = open(dev, O_RDWR); + if (kvm < 0) + perror_msg_and_skip("open: %s", dev); + + /* Make sure we have the stable version of the API */ + int ret = KVM_IOCTL(kvm, KVM_GET_API_VERSION, 0); + if (ret != KVM_API_VERSION) + error_msg_and_skip("KVM_GET_API_VERSION returned %d" + ", KVM_API_VERSION is %d", + kvm, KVM_API_VERSION); + printf("ioctl(%d<%s>, KVM_GET_API_VERSION, 0) = %d\n", + kvm, dev, ret); + + ret = KVM_IOCTL(kvm, KVM_CHECK_EXTENSION, + (void *) (uintptr_t) KVM_CAP_USER_MEMORY); + printf("ioctl(%d<%s>, KVM_CHECK_EXTENSION, KVM_CAP_USER_MEMORY) = %d\n", + kvm, dev, ret); + + int vm_fd = KVM_IOCTL(kvm, KVM_CREATE_VM, 0); + printf("ioctl(%d<%s>, KVM_CREATE_VM, 0) = %d<%s>\n", + kvm, dev, vm_fd, vm_dev); + + /* Allocate one aligned page of guest memory to hold the code. */ + page_size = get_page_size(); + void *const mem = mmap(NULL, page_size, PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_ANONYMOUS, -1, 0); + if (mem == MAP_FAILED) + perror_msg_and_fail("mmap page"); + + /* Map it to the second page frame (to avoid the real-mode IDT at 0). */ + struct kvm_userspace_memory_region region = { + .slot = 0, + .guest_phys_addr = page_size, + .memory_size = page_size, + .userspace_addr = (uintptr_t) mem, + }; + KVM_IOCTL(vm_fd, KVM_SET_USER_MEMORY_REGION, ®ion); + printf("ioctl(%d<%s>, KVM_SET_USER_MEMORY_REGION" + ", {slot=0, flags=0, guest_phys_addr=%#lx, memory_size=%lu" + ", userspace_addr=%p}) = 0\n", vm_fd, vm_dev, + (unsigned long) page_size, (unsigned long) page_size, mem); + + int vcpu_fd = KVM_IOCTL(vm_fd, KVM_CREATE_VCPU, NULL); + if (!vcpu_dev_should_have_cpuid(vcpu_fd)) { + /* + * This is an older kernel that doesn't place a cpuid + * at the end of the dentry associated with vcpu_fd. + * Trim the cpuid part of vcpu_dev like: + * "anon_inode:kvm-vcpu:0" -> "anon_inode:kvm-vcpu" + */ + vcpu_dev[strlen (vcpu_dev) - 2] = '\0'; +# ifdef KVM_NO_CPUID_CALLBACK + KVM_NO_CPUID_CALLBACK; +# endif + } + + printf("ioctl(%d<%s>, KVM_CREATE_VCPU, 0) = %d<%s>\n", + vm_fd, vm_dev, vcpu_fd, vcpu_dev); + + /* Map the shared kvm_run structure and following data. */ + ret = KVM_IOCTL(kvm, KVM_GET_VCPU_MMAP_SIZE, NULL); + struct kvm_run *run; + if (ret < (int) sizeof(*run)) + error_msg_and_fail("KVM_GET_VCPU_MMAP_SIZE returned %d < %d", + ret, (int) sizeof(*run)); + printf("ioctl(%d<%s>, KVM_GET_VCPU_MMAP_SIZE, 0) = %d\n", + kvm, dev, ret); + + const size_t mmap_size = (ret + page_size - 1) & -page_size; + run = mmap(NULL, mmap_size, PROT_READ | PROT_WRITE, + MAP_SHARED, vcpu_fd, 0); + if (run == MAP_FAILED) + perror_msg_and_fail("mmap vcpu"); + + size_t cpuid_nent = KVM_MAX_CPUID_ENTRIES; + struct kvm_cpuid2 *cpuid = tail_alloc(sizeof(*cpuid) + + cpuid_nent * + sizeof(*cpuid->entries)); + + cpuid->nent = 0; + ioctl(kvm, KVM_GET_SUPPORTED_CPUID, cpuid); + printf("ioctl(%d<%s>, KVM_GET_SUPPORTED_CPUID, %p) = -1 E2BIG (%m)\n", + kvm, dev, cpuid); + + cpuid->nent = cpuid_nent; + + KVM_IOCTL(kvm, KVM_GET_SUPPORTED_CPUID, cpuid); + print_cpuid_ioctl(kvm, dev, "KVM_GET_SUPPORTED_CPUID", cpuid); + + struct kvm_cpuid2 cpuid_tmp = { .nent = 0 }; + KVM_IOCTL(vcpu_fd, KVM_SET_CPUID2, &cpuid_tmp); + printf("ioctl(%d<%s>, KVM_SET_CPUID2, {nent=%u, entries=[]}) = 0\n", + vcpu_fd, vcpu_dev, cpuid_tmp.nent); + + KVM_IOCTL(vcpu_fd, KVM_SET_CPUID2, cpuid); + print_cpuid_ioctl(vcpu_fd, vcpu_dev, "KVM_SET_CPUID2", cpuid); + + ioctl(vcpu_fd, KVM_SET_CPUID2, NULL); + printf("ioctl(%d<%s>, KVM_SET_CPUID2, NULL) = -1 EFAULT (%m)\n", + vcpu_fd, vcpu_dev); + + run_kvm(vcpu_fd, run, mmap_size, mem); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else /* !HAVE_LINUX_KVM_H */ + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_KVM_H && HAVE_STRUCT_KVM_CPUID2 && " + "HAVE_STRUCT_KVM_REGS && HAVE_STRUCT_KVM_SREGS && " + "HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION && " + "(__x86_64__ || __i386__)") + +# define need_print_KVM_RUN 0 + +#endif diff --git a/tests-m32/ioctl_loop-nv.gen.test b/tests-m32/ioctl_loop-nv.gen.test new file mode 100755 index 00000000..d9da86a2 --- /dev/null +++ b/tests-m32/ioctl_loop-nv.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_loop-nv +ioctl.test -a22 -e verbose=none); do not edit. +set -- -a22 -e verbose=none +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_loop-nv.test b/tests-m32/ioctl_loop-nv.test deleted file mode 100755 index dcc27e1d..00000000 --- a/tests-m32/ioctl_loop-nv.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check non-verbose decoding of LOOP_* ioctls. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a22 -eioctl -e verbose=none $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-m32/ioctl_loop-v.gen.test b/tests-m32/ioctl_loop-v.gen.test new file mode 100755 index 00000000..b03bf784 --- /dev/null +++ b/tests-m32/ioctl_loop-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_loop-v +ioctl.test -v); do not edit. +set -- -v +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_loop-v.test b/tests-m32/ioctl_loop-v.test deleted file mode 100755 index ff3995d8..00000000 --- a/tests-m32/ioctl_loop-v.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check non-abbreviated decoding of LOOP_* ioctls. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a22 -v -eioctl $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-m32/ioctl_loop.c b/tests-m32/ioctl_loop.c index a95e775d..53665603 100644 --- a/tests-m32/ioctl_loop.c +++ b/tests-m32/ioctl_loop.c @@ -3,47 +3,39 @@ * * Copyright (c) 2016 JingPiao Chen * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include -#include #include #include +#include #include #include +#include #include #include +#include "print_fields.h" + +#define XLAT_MACROS_ONLY #include "xlat/loop_cmds.h" +#undef XLAT_MACROS_ONLY #ifndef ABBREV # define ABBREV 0 #endif +static long +sys_ioctl(kernel_long_t fd, kernel_ulong_t cmd, kernel_ulong_t arg) +{ + return syscall(__NR_ioctl, fd, cmd, arg); +} + static void print_loop_info(struct loop_info * const info, bool print_encrypt, const char *encrypt_type, const char *encrypt_key, @@ -54,8 +46,8 @@ print_loop_info(struct loop_info * const info, bool print_encrypt, #else printf("{lo_number=%d", info->lo_number); # if VERBOSE - printf(", lo_device=makedev(%u, %u), lo_inode=%lu, " - "lo_rdevice=makedev(%u, %u)", + printf(", lo_device=makedev(%#x, %#x), lo_inode=%lu, " + "lo_rdevice=makedev(%#x, %#x)", major(info->lo_device), minor(info->lo_device), info->lo_inode, major(info->lo_rdevice), minor(info->lo_rdevice)); @@ -80,8 +72,7 @@ print_loop_info(struct loop_info * const info, bool print_encrypt, else printf("%#x /* LO_FLAGS_??? */", info->lo_flags); - printf(", lo_name=\"%.*s\"", - (int) sizeof(info->lo_name) - 1, info->lo_name); + PRINT_FIELD_CSTRING(", ", *info, lo_name); if (VERBOSE || print_encrypt) printf(", lo_encrypt_key=\"%.*s\"", @@ -111,8 +102,8 @@ print_loop_info64(struct loop_info64 * const info64, bool print_encrypt, printf("%p", info64); #else # if VERBOSE - printf("{lo_device=makedev(%u, %u), lo_inode=%" PRIu64 - ", lo_rdevice=makedev(%u, %u), lo_offset=%#" PRIx64 + printf("{lo_device=makedev(%#x, %#x), lo_inode=%" PRIu64 + ", lo_rdevice=makedev(%#x, %#x), lo_offset=%#" PRIx64 ", lo_sizelimit=%" PRIu64 ", lo_number=%" PRIu32, major(info64->lo_device), minor(info64->lo_device), (uint64_t) info64->lo_inode, @@ -143,17 +134,16 @@ print_loop_info64(struct loop_info64 * const info64, bool print_encrypt, printf("%s", flags); else printf("%#x /* LO_FLAGS_??? */", info64->lo_flags); - printf(", lo_file_name=\"%.*s\"", - (int) sizeof(info64->lo_file_name) - 1, info64->lo_file_name); + PRINT_FIELD_CSTRING(", ", *info64, lo_file_name); - if (VERBOSE || print_encrypt) - printf(", lo_crypt_name=\"%.*s\", lo_encrypt_key=\"%.*s\"", - (int) sizeof(info64->lo_crypt_name) - 1, - info64->lo_crypt_name, + if (VERBOSE || print_encrypt) { + PRINT_FIELD_CSTRING(", ", *info64, lo_crypt_name); + printf(", lo_encrypt_key=\"%.*s\"", encrypt_key ? (int) strlen(encrypt_key) : (int) sizeof(info64->lo_encrypt_key), encrypt_key ? encrypt_key : (char *) info64->lo_encrypt_key); + } # if VERBOSE printf(", lo_init=[%#" PRIx64 ", %#" PRIx64 "]}", @@ -175,35 +165,37 @@ main(void) static const kernel_ulong_t kernel_mask = ((kernel_ulong_t) -1) - ((unsigned long) -1L); - struct loop_info * const info = tail_alloc(sizeof(*info)); - struct loop_info64 * const info64 = tail_alloc(sizeof(*info64)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct loop_info, info); + TAIL_ALLOC_OBJECT_CONST_PTR(struct loop_info64, info64); /* Unknown loop commands */ - ioctl(-1, unknown_loop_cmd, magic); - printf("ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE%s, 0x4c, %#x, %#x), " + sys_ioctl(-1, unknown_loop_cmd, magic); + printf("ioctl(-1, _IOC(%s_IOC_READ|_IOC_WRITE, 0x4c, %#x, %#x), " "%#lx) = -1 EBADF (%m)\n", _IOC_DIR((unsigned int) unknown_loop_cmd) & _IOC_NONE ? - "|_IOC_NONE" : "", + "_IOC_NONE|" : "", _IOC_NR((unsigned int) unknown_loop_cmd), _IOC_SIZE((unsigned int) unknown_loop_cmd), (unsigned long) magic); - ioctl(-1, LOOP_SET_DIRECT_IO + 1, magic); - printf("ioctl(-1, _IOC(0, 0x4c, %#x, %#x), %#lx) = " + sys_ioctl(-1, LOOP_SET_BLOCK_SIZE + 1, magic); + printf("ioctl(-1, _IOC(%s, 0x4c, %#x, %#x), %#lx) = " "-1 EBADF (%m)\n", - _IOC_NR(LOOP_SET_DIRECT_IO + 1), - _IOC_SIZE(LOOP_SET_DIRECT_IO + 1), + _IOC_NONE ? "0" : "_IOC_NONE", + _IOC_NR(LOOP_SET_BLOCK_SIZE + 1), + _IOC_SIZE(LOOP_SET_BLOCK_SIZE + 1), (unsigned long) magic); - ioctl(-1, LOOP_CTL_GET_FREE + 1, magic); - printf("ioctl(-1, _IOC(0, 0x4c, %#x, %#x), %#lx) = " + sys_ioctl(-1, LOOP_CTL_GET_FREE + 1, magic); + printf("ioctl(-1, _IOC(%s, 0x4c, %#x, %#x), %#lx) = " "-1 EBADF (%m)\n", + _IOC_NONE ? "0" : "_IOC_NONE", _IOC_NR(LOOP_CTL_GET_FREE + 1), _IOC_SIZE(LOOP_CTL_GET_FREE + 1), (unsigned long) magic); /* LOOP_SET_FD */ - ioctl(-1, LOOP_SET_FD, magic); + sys_ioctl(-1, LOOP_SET_FD, magic); printf("ioctl(-1, LOOP_SET_FD, %d) = -1 EBADF (%m)\n", (unsigned int) magic); @@ -290,7 +282,7 @@ main(void) printf("ioctl(-1, LOOP_GET_STATUS64, %p) = -1 EBADF (%m)\n", info64); /* LOOP_CHANGE_FD */ - ioctl(-1, LOOP_CHANGE_FD, magic); + sys_ioctl(-1, LOOP_CHANGE_FD, magic); printf("ioctl(-1, LOOP_CHANGE_FD, %d) = -1 EBADF (%m)\n", (unsigned int) magic); @@ -299,17 +291,22 @@ main(void) printf("ioctl(-1, LOOP_SET_CAPACITY) = -1 EBADF (%m)\n"); /* LOOP_SET_DIRECT_IO */ - ioctl(-1, LOOP_SET_DIRECT_IO, magic); + sys_ioctl(-1, LOOP_SET_DIRECT_IO, magic); printf("ioctl(-1, LOOP_SET_DIRECT_IO, %lu) = -1 EBADF (%m)\n", (unsigned long) magic); + /* LOOP_SET_BLOCK_SIZE */ + sys_ioctl(-1, LOOP_SET_BLOCK_SIZE, magic); + printf("ioctl(-1, LOOP_SET_BLOCK_SIZE, %lu) = -1 EBADF (%m)\n", + (unsigned long) magic); + /* LOOP_CTL_ADD */ - ioctl(-1, LOOP_CTL_ADD, magic); + sys_ioctl(-1, LOOP_CTL_ADD, magic); printf("ioctl(-1, LOOP_CTL_ADD, %d) = -1 EBADF (%m)\n", (unsigned int) magic); /* LOOP_CTL_REMOVE */ - ioctl(-1, LOOP_CTL_REMOVE, magic); + sys_ioctl(-1, LOOP_CTL_REMOVE, magic); printf("ioctl(-1, LOOP_CTL_REMOVE, %d) = -1 EBADF (%m)\n", (unsigned int) magic); diff --git a/tests-m32/ioctl_loop.gen.test b/tests-m32/ioctl_loop.gen.test new file mode 100755 index 00000000..d4ec35ac --- /dev/null +++ b/tests-m32/ioctl_loop.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_loop +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_loop.test b/tests-m32/ioctl_loop.test deleted file mode 100755 index 112cd636..00000000 --- a/tests-m32/ioctl_loop.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check decoding of LOOP_* ioctls. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a22 -eioctl $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-m32/ioctl_mtd.c b/tests-m32/ioctl_mtd.c index a37d5d0f..cfc1d442 100644 --- a/tests-m32/ioctl_mtd.c +++ b/tests-m32/ioctl_mtd.c @@ -2,49 +2,28 @@ * This file is part of ioctl_mtd strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" -#include -#include -#include -#include -#include -#include -#include -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) -# include "mtd-abi.h" -#else +#ifdef HAVE_STRUCT_MTD_WRITE_REQ + +# include +# include +# include +# include +# include +# include +# include # include -#endif static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; -#define TEST_NULL_ARG(cmd) \ +# define TEST_NULL_ARG(cmd) \ do { \ ioctl(-1, cmd, 0); \ if (_IOC_DIR(cmd) == _IOC_WRITE) \ @@ -57,15 +36,17 @@ static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; (unsigned int) _IOC_NR(cmd), #cmd); \ else \ printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd); \ - } while (0) - -#define TEST_erase_info_user(cmd, eiu) \ - ioctl(-1, cmd, eiu); \ - printf("ioctl(-1, MIXER_%s(%u) or %s, {start=%#x, length=%#x})" \ - " = -1 EBADF (%m)\n", \ - (_IOC_DIR(cmd) == _IOC_READ) ? "READ" : "WRITE", \ - (unsigned int) _IOC_NR(cmd), #cmd, \ - eiu->start, eiu->length) + } while (0) + +# define TEST_erase_info_user(cmd, eiu) \ + do { \ + ioctl(-1, cmd, eiu); \ + printf("ioctl(-1, MIXER_%s(%u) or %s, {start=%#x, length=%#x})" \ + " = -1 EBADF (%m)\n", \ + (_IOC_DIR(cmd) == _IOC_READ) ? "READ" : "WRITE", \ + (unsigned int) _IOC_NR(cmd), #cmd, \ + eiu->start, eiu->length); \ + } while (0) int main(void) @@ -95,13 +76,13 @@ main(void) ioctl(-1, MTDFILEMODE, MTD_FILE_MODE_NORMAL); printf("ioctl(-1, MTDFILEMODE, MTD_FILE_MODE_NORMAL) = -1 EBADF (%m)\n"); - int *const opt = tail_alloc(sizeof(*opt)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, opt); *opt = MTD_OTP_OFF; ioctl(-1, OTPSELECT, opt); printf("ioctl(-1, MIXER_READ(%u) or OTPSELECT, [MTD_OTP_OFF])" " = -1 EBADF (%m)\n", (unsigned int) _IOC_NR(OTPSELECT)); - uint64_t *const v64 = tail_alloc(sizeof(*v64)); + TAIL_ALLOC_OBJECT_CONST_PTR(uint64_t, v64); fill_memory(v64, sizeof(*v64)); ioctl(-1, MEMGETBADBLOCK, v64); @@ -114,17 +95,17 @@ main(void) " = -1 EBADF (%m)\n", (unsigned int) _IOC_NR(MEMSETBADBLOCK), *v64); - struct region_info_user *const riu = tail_alloc(sizeof(*riu)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct region_info_user, riu); fill_memory(riu, sizeof(*riu)); ioctl(-1, MEMGETREGIONINFO, riu); printf("ioctl(-1, %s, {regionindex=%#x}) = -1 EBADF (%m)\n", "MEMGETREGIONINFO" -#ifdef __i386__ +# ifdef __i386__ " or MTRRIOC_GET_PAGE_ENTRY" -#endif +# endif , riu->regionindex); - struct erase_info_user *const eiu = tail_alloc(sizeof(*eiu)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct erase_info_user, eiu); fill_memory(eiu, sizeof(*eiu)); TEST_erase_info_user(MEMERASE, eiu); @@ -132,7 +113,7 @@ main(void) TEST_erase_info_user(MEMUNLOCK, eiu); TEST_erase_info_user(MEMISLOCKED, eiu); - struct erase_info_user64 *const eiu64 = tail_alloc(sizeof(*eiu64)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct erase_info_user64, eiu64); fill_memory(eiu64, sizeof(*eiu64)); ioctl(-1, MEMERASE64, eiu64); printf("ioctl(-1, MIXER_WRITE(%u) or %s, {start=%#llx, length=%#llx})" @@ -141,7 +122,7 @@ main(void) (unsigned long long) eiu64->start, (unsigned long long) eiu64->length); - struct mtd_oob_buf *const oob = tail_alloc(sizeof(*oob)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct mtd_oob_buf, oob); fill_memory(oob, sizeof(*oob)); ioctl(-1, MEMWRITEOOB, oob); @@ -152,7 +133,7 @@ main(void) printf("ioctl(-1, MEMREADOOB, {start=%#x, length=%#x, ptr=%p})" " = -1 EBADF (%m)\n", oob->start, oob->length, oob->ptr); - struct mtd_oob_buf64 *const oob64 = tail_alloc(sizeof(*oob64)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct mtd_oob_buf64, oob64); fill_memory(oob64, sizeof(*oob64)); ioctl(-1, MEMWRITEOOB64, oob64); @@ -168,14 +149,14 @@ main(void) (unsigned long long) oob64->usr_ptr); - struct otp_info *const oi = tail_alloc(sizeof(*oi)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct otp_info, oi); fill_memory(oi, sizeof(*oi)); ioctl(-1, OTPLOCK, oi); printf("ioctl(-1, MIXER_READ(%u) or OTPLOCK" ", {start=%#x, length=%#x, locked=%u}) = -1 EBADF (%m)\n", (unsigned int) _IOC_NR(OTPLOCK), oi->start, oi->length, oi->locked); - struct mtd_write_req *const wr = tail_alloc(sizeof(*wr)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct mtd_write_req, wr); fill_memory(wr, sizeof(*wr)); wr->mode = MTD_OPS_PLACE_OOB; ioctl(-1, MEMWRITE, wr); @@ -195,3 +176,9 @@ main(void) puts("+++ exited with 0 +++"); return 0; } + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_MTD_WRITE_REQ") + +#endif diff --git a/tests-m32/ioctl_mtd.gen.test b/tests-m32/ioctl_mtd.gen.test new file mode 100755 index 00000000..65b00037 --- /dev/null +++ b/tests-m32/ioctl_mtd.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_mtd +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_mtd.test b/tests-m32/ioctl_mtd.test deleted file mode 100755 index 08428073..00000000 --- a/tests-m32/ioctl_mtd.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of 'M' type ioctls. - -. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_nbd.c b/tests-m32/ioctl_nbd.c new file mode 100644 index 00000000..0992ca28 --- /dev/null +++ b/tests-m32/ioctl_nbd.c @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +#define XLAT_MACROS_ONLY +#include "xlat/nbd_ioctl_cmds.h" +#include "xlat/nbd_ioctl_flags.h" +#undef XLAT_MACROS_ONLY + +#define RVAL_EBADF " = -1 EBADF (%m)\n" + +int +main(void) +{ + static const unsigned long ubeef = (unsigned long) 0xcafef00ddeadbeefULL; + static const char null_path[] = "/dev/null"; + + int fd = open(null_path, O_RDONLY); + if (fd < 0) + perror_msg_and_fail("open(\"%s\")", null_path); + + skip_if_unavailable("/proc/self/fd/"); + + ioctl(-1, NBD_DISCONNECT, NULL); + printf("ioctl(-1, NBD_DISCONNECT)" RVAL_EBADF); + ioctl(-1, NBD_CLEAR_SOCK, NULL); + printf("ioctl(-1, NBD_CLEAR_SOCK)" RVAL_EBADF); + ioctl(-1, NBD_DO_IT, NULL); + printf("ioctl(-1, NBD_DO_IT)" RVAL_EBADF); + ioctl(-1, NBD_CLEAR_QUE, NULL); + printf("ioctl(-1, NBD_CLEAR_QUE)" RVAL_EBADF); + ioctl(-1, NBD_PRINT_DEBUG, NULL); + printf("ioctl(-1, NBD_PRINT_DEBUG)" RVAL_EBADF); + ioctl(-1, NBD_SET_SOCK, fd); + printf("ioctl(-1, NBD_SET_SOCK, %d)" RVAL_EBADF, fd); + + ioctl(-1, NBD_SET_BLKSIZE, ubeef); + printf("ioctl(-1, NBD_SET_BLKSIZE, %lu)" RVAL_EBADF, ubeef); + ioctl(-1, NBD_SET_SIZE, ubeef); + printf("ioctl(-1, NBD_SET_SIZE, %lu)" RVAL_EBADF, ubeef); + ioctl(-1, NBD_SET_SIZE_BLOCKS, ubeef); + printf("ioctl(-1, NBD_SET_SIZE_BLOCKS, %lu)" RVAL_EBADF, ubeef); + + ioctl(-1, NBD_SET_TIMEOUT, ubeef); + printf("ioctl(-1, NBD_SET_TIMEOUT, %lu)" RVAL_EBADF, ubeef); + + ioctl(-1, NBD_SET_FLAGS, 0); + printf("ioctl(-1, NBD_SET_FLAGS, 0)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_HAS_FLAGS); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_HAS_FLAGS)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_READ_ONLY); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_READ_ONLY)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_FLUSH); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_FLUSH)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_FUA); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_FUA)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_TRIM); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_TRIM)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_WRITE_ZEROES); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_WRITE_ZEROES)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_DF); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_DF)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_CAN_MULTI_CONN); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_CAN_MULTI_CONN)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_RESIZE); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_RESIZE)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_CACHE); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_CACHE)" RVAL_EBADF); + + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_HAS_FLAGS|NBD_FLAG_READ_ONLY| + NBD_FLAG_SEND_FUA|NBD_FLAG_SEND_CACHE| + (1 << 15)|(1<<31)); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_HAS_FLAGS|NBD_FLAG_READ_ONLY|" + "NBD_FLAG_SEND_FUA|NBD_FLAG_SEND_CACHE|0x80008000)" RVAL_EBADF); + + ioctl(-1, _IOC(_IOC_NONE, 0xab, 0xb, 0), NULL); + printf("ioctl(-1, _IOC(_IOC_NONE, 0xab, 0xb, 0), 0)" RVAL_EBADF); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/ioctl_nbd.gen.test b/tests-m32/ioctl_nbd.gen.test new file mode 100755 index 00000000..55e287a2 --- /dev/null +++ b/tests-m32/ioctl_nbd.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_nbd +ioctl.test -y); do not edit. +set -- -y +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_nsfs.c b/tests-m32/ioctl_nsfs.c new file mode 100644 index 00000000..74dbe6e9 --- /dev/null +++ b/tests-m32/ioctl_nsfs.c @@ -0,0 +1,126 @@ +/* + * Check decoding of NS_* commands of ioctl syscall. + * + * Copyright (c) 2017 Nikolay Marchuk + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include +#include "nsfs.h" + +#ifndef CLONE_NEWUSER +# define CLONE_NEWUSER 0x10000000 +#endif + +static void +test_no_namespace(void) +{ + ioctl(-1, NS_GET_USERNS); + printf("ioctl(-1, NS_GET_USERNS) = -1 EBADF (%m)\n"); + ioctl(-1, NS_GET_PARENT); + printf("ioctl(-1, NS_GET_PARENT) = -1 EBADF (%m)\n"); + ioctl(-1, NS_GET_NSTYPE); + printf("ioctl(-1, NS_GET_NSTYPE) = -1 EBADF (%m)\n"); + ioctl(-1, NS_GET_OWNER_UID, NULL); + printf("ioctl(-1, NS_GET_OWNER_UID, NULL) = -1 EBADF (%m)\n"); +} + +static void +test_clone(pid_t pid) +{ + char path[sizeof("/proc/%d/ns/user") + sizeof(int)*3]; + snprintf(path, sizeof(path), "/proc/%d/ns/user", pid); + + int ns_fd = open(path, O_RDONLY); + if (ns_fd == -1) + perror_msg_and_skip("open: %s", path); + + int userns_fd = ioctl(ns_fd, NS_GET_USERNS); + printf("ioctl(%d, NS_GET_USERNS) = %s\n", ns_fd, sprintrc(userns_fd)); + + int parent_ns_fd = ioctl(userns_fd, NS_GET_PARENT); + printf("ioctl(%d, NS_GET_PARENT) = %s\n", + userns_fd, sprintrc(parent_ns_fd)); + + int nstype = ioctl(userns_fd, NS_GET_NSTYPE); + if (nstype == -1) { + printf("ioctl(%d, NS_GET_NSTYPE) = %s\n", + userns_fd, sprintrc(nstype)); + } else { + printf("ioctl(%d, NS_GET_NSTYPE) = %d (CLONE_NEWUSER)\n", + userns_fd, nstype); + } + + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, uid); + int rc = ioctl(userns_fd, NS_GET_OWNER_UID, uid); + if (rc == -1) { + printf("ioctl(%d, NS_GET_OWNER_UID, %p) = %s\n", + userns_fd, uid, sprintrc(rc)); + } else { + printf("ioctl(%d, NS_GET_OWNER_UID, [%u]) = %d\n", + userns_fd, *uid, rc); + } +} + +static int +child(void *arg) +{ + int *pipefd = (int *) arg; + close(pipefd[1]); + /* Wait for EOF from pipe. */ + if (read(pipefd[0], &pipefd[1], 1)) + perror_msg_and_fail("read"); + return 0; +} + +#ifdef IA64 +extern int __clone2(int (*)(void *), void *, size_t, int, void *, ...); +# define clone(fn, child_stack, flags, arg) \ + __clone2(fn, child_stack, get_page_size() / 2, flags, arg) +#endif + +static void +test_user_namespace(void) +{ + pid_t pid; + int pipefd[2]; + int status; + + if (pipe(pipefd)) + perror_msg_and_fail("pipe"); + + pid = clone(child, tail_alloc(get_page_size() / 2), + CLONE_NEWUSER | CLONE_UNTRACED | SIGCHLD, pipefd); + if (pid == -1) { + perror("clone"); + return; + } + close(pipefd[0]); + test_clone(pid); + close(pipefd[1]); + if (wait(&status) != pid) { + perror_msg_and_fail("wait"); + } else if (status != 0) { + error_msg_and_fail("unexpected child exit status %d", status); + } +} + +int +main(void) +{ + test_no_namespace(); + test_user_namespace(); + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/ioctl_nsfs.gen.test b/tests-m32/ioctl_nsfs.gen.test new file mode 100755 index 00000000..f9adc5f0 --- /dev/null +++ b/tests-m32/ioctl_nsfs.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_nsfs +ioctl.test -esignal=none); do not edit. +set -- -esignal=none +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_perf-success.c b/tests-m32/ioctl_perf-success.c new file mode 100644 index 00000000..eaf572ac --- /dev/null +++ b/tests-m32/ioctl_perf-success.c @@ -0,0 +1,145 @@ +/* + * Check decoding of successful PERF_EVENT_IOC_{ID,QUERY_BPF} ioctls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_PERF_EVENT_H + +# include +# include +# include +# include +# include +# include +# include + +# ifndef PERF_EVENT_IOC_ID +# define PERF_EVENT_IOC_ID _IOR('$', 7, void *) +# endif + +# ifndef PERF_EVENT_IOC_QUERY_BPF +# define PERF_EVENT_IOC_QUERY_BPF _IOWR('$', 10, void *) + +struct perf_event_query_bpf { + uint32_t ids_len; + uint32_t prog_cnt; + uint32_t ids[0]; +}; +# endif + +int +main(int argc, char **argv) +{ + static const uint64_t magic64 = 0xfacefeeddeadc0deULL; + + TAIL_ALLOC_OBJECT_CONST_PTR(uint64_t, u64_ptr); + uint64_t *const u64_efault = u64_ptr + 1; + uint32_t *const u32_arr = tail_alloc(sizeof(uint32_t) * 4); + uint32_t *const u32_efault = u32_arr + 4; + + unsigned long num_skip; + long inject_retval; + bool locked = false; + + *u64_ptr = magic64; + + if (argc == 1) + return 0; + + if (argc < 3) + error_msg_and_fail("Usage: %s NUM_SKIP INJECT_RETVAL", argv[0]); + + num_skip = strtoul(argv[1], NULL, 0); + inject_retval = strtol(argv[2], NULL, 0); + + if (inject_retval < 0) + error_msg_and_fail("Expected non-negative INJECT_RETVAL, " + "but got %ld", inject_retval); + + for (unsigned long i = 0; i < num_skip; i++) { + long ret = ioctl(-1, PERF_EVENT_IOC_ID, NULL); + + printf("ioctl(-1, PERF_EVENT_IOC_ID, NULL) = %s%s\n", + sprintrc(ret), + ret == inject_retval ? " (INJECTED)" : ""); + + if (ret != inject_retval) + continue; + + locked = true; + break; + } + + if (!locked) + error_msg_and_fail("Hasn't locked on ioctl(-1" + ", PERF_EVENT_IOC_ID, NULL) returning %lu", + inject_retval); + + /* PERF_EVENT_IOC_ID */ + assert(ioctl(-1, PERF_EVENT_IOC_ID, NULL) == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_ID, NULL) = %ld (INJECTED)\n", + inject_retval); + + assert(ioctl(-1, PERF_EVENT_IOC_ID, u64_efault) == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_ID, %p) = %ld (INJECTED)\n", + u64_efault, inject_retval); + + assert(ioctl(-1, PERF_EVENT_IOC_ID, u64_ptr) == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_ID, [%" PRIu64 "]) = %ld (INJECTED)\n", + magic64, inject_retval); + + /* PERF_EVENT_IOC_QUERY_BPF */ + assert(ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, NULL) == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, NULL) = %ld (INJECTED)\n", + inject_retval); + + assert(ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, u32_efault) + == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, %p) = %ld (INJECTED)\n", + u32_efault, inject_retval); + + u32_arr[3] = 0xdeadbeef; + assert(ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, u32_arr + 3) + == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, {ids_len=3735928559, ...}) " + "= %ld (INJECTED)\n", + inject_retval); + + u32_arr[2] = 0xdecaffed; + assert(ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, u32_arr + 2) + == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, {ids_len=3737845741" + ", prog_cnt=3735928559, ids=%p})" + " = %ld (INJECTED)\n", + u32_efault, inject_retval); + + u32_arr[0] = 0xbadc0ded; + u32_arr[1] = 5; + assert(ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, u32_arr) == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, {ids_len=3134983661" + ", prog_cnt=5, ids=[3737845741, 3735928559, ... /* %p */]})" + " = %ld (INJECTED)\n", + u32_efault, inject_retval); + + u32_arr[1] = 2; + assert(ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, u32_arr) == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, {ids_len=3134983661" + ", prog_cnt=2, ids=[3737845741, 3735928559]})" + " = %ld (INJECTED)\n", + inject_retval); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_PERF_EVENT_H"); + +#endif diff --git a/tests-m32/ioctl_perf-success.test b/tests-m32/ioctl_perf-success.test new file mode 100755 index 00000000..2edd1d34 --- /dev/null +++ b/tests-m32/ioctl_perf-success.test @@ -0,0 +1,20 @@ +#!/bin/sh -efu +# +# Check decoding of successful PERF_EVENT_IOC_{ID,QUERY_BPF} ioctls. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +: ${IOCTL_INJECT_START=256} +: ${IOCTL_INJECT_RETVAL=42} + +run_prog +run_strace -a35 -e trace=ioctl \ + -e inject=ioctl:retval="${IOCTL_INJECT_RETVAL}":when="${IOCTL_INJECT_START}+" \ + ../ioctl_perf-success "${IOCTL_INJECT_START}" "${IOCTL_INJECT_RETVAL}" > "$EXP" +grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests-m32/ioctl_perf.c b/tests-m32/ioctl_perf.c new file mode 100644 index 00000000..30cb35f6 --- /dev/null +++ b/tests-m32/ioctl_perf.c @@ -0,0 +1,218 @@ +/* + * Check decoding of PERF_EVENT_IOC_* commands of ioctl syscall. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_PERF_EVENT_H + +# include +# include +# include +# include +# include +# include +# include + +/* + * Workaround the bug in kernel UAPI that was fixed + * in Linux commit v2.6.33-rc1~48^2~288^2~19. + */ +# ifndef u64 +# define u64 uint64_t +# endif + +# define XLAT_MACROS_ONLY +# include "xlat/perf_ioctl_cmds.h" +# undef XLAT_MACROS_ONLY + +# define STR16 "0123456789abcdef" + +static long +sys_ioctl(kernel_long_t fd, kernel_ulong_t cmd, kernel_ulong_t arg) +{ + return syscall(__NR_ioctl, fd, cmd, arg); +} + +int +main(void) +{ + static const kernel_ulong_t unknown_perf_cmd = + (kernel_ulong_t) 0xbadc0dedfeed24edULL; + static const kernel_ulong_t magic = + (kernel_ulong_t) 0xdeadbeefbadc0dedULL; + static const uint64_t magic64 = 0xfacefeeddeadc0deULL; + static const char str[] = STR16 STR16 STR16 STR16; + + static struct { + unsigned int cmd; + const char *str; + } flag_iocs[] = { + { ARG_STR(PERF_EVENT_IOC_ENABLE) }, + { ARG_STR(PERF_EVENT_IOC_DISABLE) }, + { ARG_STR(PERF_EVENT_IOC_RESET) }, + }; + + TAIL_ALLOC_OBJECT_CONST_PTR(uint64_t, u64_ptr); + uint64_t *const u64_efault = u64_ptr + 1; + uint32_t *const u32_arr = tail_alloc(sizeof(uint32_t) * 4); + uint32_t *const u32_efault = u32_arr + 4; + char *const str_ptr = tail_memdup(str, sizeof(str)); + char *const str_efault = str_ptr + sizeof(str); + TAIL_ALLOC_OBJECT_CONST_PTR(struct perf_event_attr, pea_ptr); + + *u64_ptr = magic64; + fill_memory_ex(pea_ptr, sizeof(*pea_ptr), 0xaa, 0x55); + + /* Unknown perf commands */ + sys_ioctl(-1, unknown_perf_cmd, magic); + printf("ioctl(-1, _IOC(%s_IOC_READ|_IOC_WRITE, 0x24, %#x, %#x), " + "%#lx) = -1 EBADF (%m)\n", + _IOC_DIR((unsigned int) unknown_perf_cmd) & _IOC_NONE ? + "_IOC_NONE|" : "", + _IOC_NR((unsigned int) unknown_perf_cmd), + _IOC_SIZE((unsigned int) unknown_perf_cmd), + (unsigned long) magic); + + sys_ioctl(-1, PERF_EVENT_IOC_MODIFY_ATTRIBUTES + 1, magic); + printf("ioctl(-1, _IOC(_IOC_WRITE, 0x24, %#x, %#x), %#lx)" + " = -1 EBADF (%m)\n", + (unsigned int) _IOC_NR(PERF_EVENT_IOC_MODIFY_ATTRIBUTES + 1), + (unsigned int) _IOC_SIZE(PERF_EVENT_IOC_MODIFY_ATTRIBUTES + 1), + (unsigned long) magic); + + /* PERF_EVENT_IOC_{ENABLE,DISABLE,RESET} */ + for (unsigned i = 0; i < ARRAY_SIZE(flag_iocs); i++) { + ioctl(-1, flag_iocs[i].cmd, 0); + printf("ioctl(-1, %s, 0) = -1 EBADF (%m)\n", flag_iocs[i].str); + + ioctl(-1, flag_iocs[i].cmd, 1); + printf("ioctl(-1, %s, PERF_IOC_FLAG_GROUP) = -1 EBADF (%m)\n", + flag_iocs[i].str); + + ioctl(-1, flag_iocs[i].cmd, 2); + printf("ioctl(-1, %s, 0x2 /* PERF_IOC_FLAG_??? */) " + "= -1 EBADF (%m)\n", + flag_iocs[i].str); + + sys_ioctl(-1, flag_iocs[i].cmd, magic); + printf("ioctl(-1, %s, PERF_IOC_FLAG_GROUP|%#x) " + "= -1 EBADF (%m)\n", + flag_iocs[i].str, (unsigned int) magic & ~1U); + } + + /* PERF_EVENT_IOC_REFRESH */ + sys_ioctl(-1, PERF_EVENT_IOC_REFRESH, magic); + printf("ioctl(-1, PERF_EVENT_IOC_REFRESH, %d) = -1 EBADF (%m)\n", + (int) magic); + + /* PERF_EVENT_IOC_PERIOD */ + ioctl(-1, PERF_EVENT_IOC_PERIOD, NULL); + printf("ioctl(-1, PERF_EVENT_IOC_PERIOD, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, PERF_EVENT_IOC_PERIOD, u64_efault); + printf("ioctl(-1, PERF_EVENT_IOC_PERIOD, %p) = -1 EBADF (%m)\n", + u64_efault); + + ioctl(-1, PERF_EVENT_IOC_PERIOD, u64_ptr); + printf("ioctl(-1, PERF_EVENT_IOC_PERIOD, [%" PRIu64 "])" + " = -1 EBADF (%m)\n", + magic64); + + /* PERF_EVENT_IOC_SET_OUTPUT */ + sys_ioctl(-1, PERF_EVENT_IOC_SET_OUTPUT, magic); + printf("ioctl(-1, PERF_EVENT_IOC_SET_OUTPUT, %d) = -1 EBADF (%m)\n", + (int) magic); + + /* PERF_EVENT_IOC_SET_FILTER */ + ioctl(-1, PERF_EVENT_IOC_SET_FILTER, NULL); + printf("ioctl(-1, PERF_EVENT_IOC_SET_FILTER, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, PERF_EVENT_IOC_SET_FILTER, str_efault); + printf("ioctl(-1, PERF_EVENT_IOC_SET_FILTER, %p) = -1 EBADF (%m)\n", + str_efault); + + ioctl(-1, PERF_EVENT_IOC_SET_FILTER, str_ptr); + printf("ioctl(-1, PERF_EVENT_IOC_SET_FILTER, \"%.32s\"...)" + " = -1 EBADF (%m)\n", + str_ptr); + + ioctl(-1, PERF_EVENT_IOC_SET_FILTER, str_ptr + 40); + printf("ioctl(-1, PERF_EVENT_IOC_SET_FILTER, \"%.32s\")" + " = -1 EBADF (%m)\n", + str_ptr + 40); + + str_ptr[sizeof(str) - 1] = '0'; + ioctl(-1, PERF_EVENT_IOC_SET_FILTER, str_ptr + 40); + printf("ioctl(-1, PERF_EVENT_IOC_SET_FILTER, %p)" + " = -1 EBADF (%m)\n", + str_ptr + 40); + + /* PERF_EVENT_IOC_ID */ + ioctl(-1, PERF_EVENT_IOC_ID, NULL); + printf("ioctl(-1, PERF_EVENT_IOC_ID, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, PERF_EVENT_IOC_ID, u64_efault); + printf("ioctl(-1, PERF_EVENT_IOC_ID, %p) = -1 EBADF (%m)\n", + u64_efault); + + ioctl(-1, PERF_EVENT_IOC_ID, u64_ptr); + printf("ioctl(-1, PERF_EVENT_IOC_ID, %p) = -1 EBADF (%m)\n", + u64_ptr); + + /* PERF_EVENT_IOC_SET_BPF */ + sys_ioctl(-1, PERF_EVENT_IOC_SET_BPF, magic); + printf("ioctl(-1, PERF_EVENT_IOC_SET_BPF, %d) = -1 EBADF (%m)\n", + (int) magic); + + /* PERF_EVENT_IOC_PAUSE_OUTPUT */ + sys_ioctl(-1, PERF_EVENT_IOC_PAUSE_OUTPUT, magic); + printf("ioctl(-1, PERF_EVENT_IOC_PAUSE_OUTPUT, %lu) = -1 EBADF (%m)\n", + (unsigned long) magic); + + /* PERF_EVENT_IOC_QUERY_BPF */ + ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, NULL); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, u32_efault); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, %p) = -1 EBADF (%m)\n", + u32_efault); + + u32_arr[0] = 0xbadc0ded; + ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, u32_arr); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, {ids_len=3134983661, ...})" + " = -1 EBADF (%m)\n"); + + /* PERF_EVENT_IOC_MODIFY_ATTRIBUTES */ + ioctl(-1, PERF_EVENT_IOC_MODIFY_ATTRIBUTES, NULL); + printf("ioctl(-1, PERF_EVENT_IOC_MODIFY_ATTRIBUTES, NULL)" + " = -1 EBADF (%m)\n"); + + ioctl(-1, PERF_EVENT_IOC_MODIFY_ATTRIBUTES, pea_ptr + 1); + printf("ioctl(-1, PERF_EVENT_IOC_MODIFY_ATTRIBUTES, %p)" + " = -1 EBADF (%m)\n", + pea_ptr + 1); + + printf("ioctl(-1, PERF_EVENT_IOC_MODIFY_ATTRIBUTES" + ", {type=%#x /* PERF_TYPE_??? */" + ", size=%#x /* PERF_ATTR_SIZE_??? */" + ", config=%#llx, ...}) = -1 EBADF (%m)\n", + (unsigned int) pea_ptr->type, + (unsigned int) pea_ptr->size, + (unsigned long long) pea_ptr->config); + ioctl(-1, PERF_EVENT_IOC_MODIFY_ATTRIBUTES, pea_ptr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_PERF_EVENT_H"); + +#endif diff --git a/tests-m32/ioctl_perf.gen.test b/tests-m32/ioctl_perf.gen.test new file mode 100755 index 00000000..0264f349 --- /dev/null +++ b/tests-m32/ioctl_perf.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_perf +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_ptp.c b/tests-m32/ioctl_ptp.c new file mode 100644 index 00000000..52d9698a --- /dev/null +++ b/tests-m32/ioctl_ptp.c @@ -0,0 +1,111 @@ +/* + * Check decoding of PTP_* commands of ioctl syscall. + * + * Copyright (c) 2018 Harsha Sharma + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_PTP_SYS_OFFSET + +# include +# include +# include +# include +# include +# include +# include +# include + +# include "xlat.h" +# include "xlat/ptp_flags_options.h" + +static void +test_no_device(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct ptp_clock_caps, caps); + fill_memory(caps, sizeof(*caps)); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct ptp_sys_offset, sysoff); + fill_memory(sysoff, sizeof(*sysoff)); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct ptp_extts_request, extts); + fill_memory(extts, sizeof(*extts)); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct ptp_perout_request, perout); + fill_memory(perout, sizeof(*perout)); + + int saved_errno; + + /* PTP_CLOCK_GETCAPS */ + ioctl(-1, PTP_CLOCK_GETCAPS, NULL); + printf("ioctl(-1, PTP_CLOCK_GETCAPS, NULL) = -1 EBADF (%m)\n"); + ioctl(-1, PTP_CLOCK_GETCAPS, caps); + printf("ioctl(-1, PTP_CLOCK_GETCAPS, %p) = -1 EBADF (%m)\n", caps); + + /* PTP_SYS_OFFSET */ + ioctl(-1, PTP_SYS_OFFSET, NULL); + printf("ioctl(-1, PTP_SYS_OFFSET, NULL) = -1 EBADF (%m)\n"); + ioctl(-1, PTP_SYS_OFFSET, sysoff); + printf("ioctl(-1, PTP_SYS_OFFSET, {n_samples=%u}) = -1 EBADF (%m)\n", + sysoff->n_samples); + + /* PTP_ENABLE_PPS */ + ioctl(-1, PTP_ENABLE_PPS, 0); + printf("ioctl(-1, PTP_ENABLE_PPS, 0) = -1 EBADF (%m)\n"); + ioctl(-1, PTP_ENABLE_PPS, 1); + printf("ioctl(-1, PTP_ENABLE_PPS, 1) = -1 EBADF (%m)\n"); + + /* PTP_EXTTS_REQUEST */ + ioctl(-1, PTP_EXTTS_REQUEST, NULL); + printf("ioctl(-1, PTP_EXTTS_REQUEST, NULL) = -1 EBADF (%m)\n"); + ioctl(-1, PTP_EXTTS_REQUEST, extts); + saved_errno = errno; + printf("ioctl(-1, PTP_EXTTS_REQUEST, {index=%d, flags=", extts->index); + printflags(ptp_flags_options, extts->flags, "PTP_???"); + errno = saved_errno; + printf("}) = -1 EBADF (%m)\n"); + + /* PTP_PEROUT_REQUEST */ + ioctl(-1, PTP_PEROUT_REQUEST, NULL); + printf("ioctl(-1, PTP_PEROUT_REQUEST, NULL) = -1 EBADF (%m)\n"); + ioctl(-1, PTP_PEROUT_REQUEST, perout); + saved_errno = errno; + printf("ioctl(-1, PTP_PEROUT_REQUEST, {start={sec=%" PRId64 + ", nsec=%" PRIu32 "}, period={sec=%" PRId64 ", nsec=%" PRIu32 "}" + ", index=%d, flags=", + (int64_t) perout->start.sec, perout->start.nsec, + (int64_t)perout->period.sec, perout->period.nsec, perout->index); + printflags(ptp_flags_options, perout->flags, "PTP_???"); + errno = saved_errno; + printf("}) = -1 EBADF (%m)\n"); + + /* unrecognized */ + ioctl(-1, _IOC(_IOC_READ, PTP_CLK_MAGIC, 0xff, 0xfe), 0); + printf("ioctl(-1, _IOC(_IOC_READ, %#x, 0xff, 0xfe), 0)" + " = -1 EBADF (%m)\n", PTP_CLK_MAGIC); + + const unsigned long arg = (unsigned long) 0xfacefeeddeadbeefULL; + ioctl(-1, _IOC(_IOC_WRITE, PTP_CLK_MAGIC, 0xfd, 0xfc), arg); + printf("ioctl(-1, _IOC(_IOC_WRITE, %#x, 0xfd, 0xfc), %#lx)" + " = -1 EBADF (%m)\n", PTP_CLK_MAGIC, arg); +} + +int +main(void) +{ + test_no_device(); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_PTP_SYS_OFFSET") + +#endif /* HAVE_STRUCT_PTP_SYS_OFFSET */ diff --git a/tests-m32/ioctl_ptp.gen.test b/tests-m32/ioctl_ptp.gen.test new file mode 100755 index 00000000..6c0b0a92 --- /dev/null +++ b/tests-m32/ioctl_ptp.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_ptp +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_random.c b/tests-m32/ioctl_random.c new file mode 100644 index 00000000..0d8e9f28 --- /dev/null +++ b/tests-m32/ioctl_random.c @@ -0,0 +1,61 @@ +/* + * Check decoding of RND* commands of ioctl syscall. + * + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +#define XLAT_MACROS_ONLY +#include "xlat/random_ioctl_cmds.h" +#undef XLAT_MACROS_ONLY + +#define RVAL_EBADF " = -1 EBADF (%m)\n" + +int +main(void) +{ + union { + char c[sizeof(struct rand_pool_info) + 8]; + struct rand_pool_info info; + } u; + struct rand_pool_info *info = &u.info; + int cnt = 6; + + memcpy(info->buf, "12345678", 8); + info->buf_size = 8; + info->entropy_count = 3; + + ioctl(-1, RNDGETENTCNT, &cnt); + printf("ioctl(-1, RNDGETENTCNT, %p)" RVAL_EBADF, &cnt); + ioctl(-1, RNDADDTOENTCNT, &cnt); + printf("ioctl(-1, RNDADDTOENTCNT, [6])" RVAL_EBADF); + + ioctl(-1, RNDADDENTROPY, NULL); + printf("ioctl(-1, RNDADDENTROPY, NULL)" RVAL_EBADF); + ioctl(-1, RNDADDENTROPY, info); + printf("ioctl(-1, RNDADDENTROPY, {entropy_count=3, buf_size=8, buf=\"12345678\"})" RVAL_EBADF); + + ioctl(-1, RNDZAPENTCNT); + printf("ioctl(-1, FASTRPC_IOCTL_INIT_ATTACH or RNDZAPENTCNT)" + RVAL_EBADF); + ioctl(-1, RNDCLEARPOOL); + printf("ioctl(-1, RNDCLEARPOOL)" RVAL_EBADF); + ioctl(-1, RNDRESEEDCRNG); + printf("ioctl(-1, RNDRESEEDCRNG)" RVAL_EBADF); + + ioctl(-1, _IO('R', 0xff), NULL); + printf("ioctl(-1, _IOC(_IOC_NONE, %#x, 0xff, 0), 0)" RVAL_EBADF, 'R'); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/ioctl_random.gen.test b/tests-m32/ioctl_random.gen.test new file mode 100755 index 00000000..3afcab0a --- /dev/null +++ b/tests-m32/ioctl_random.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_random +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_rtc-v.gen.test b/tests-m32/ioctl_rtc-v.gen.test new file mode 100755 index 00000000..820181b0 --- /dev/null +++ b/tests-m32/ioctl_rtc-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_rtc-v +ioctl.test -v); do not edit. +set -- -v +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_rtc-v.test b/tests-m32/ioctl_rtc-v.test deleted file mode 100755 index a255322d..00000000 --- a/tests-m32/ioctl_rtc-v.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check verbose decoding of RTC_* ioctls. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a16 -veioctl $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-m32/ioctl_rtc.c b/tests-m32/ioctl_rtc.c index 49d7ec7b..d192e378 100644 --- a/tests-m32/ioctl_rtc.c +++ b/tests-m32/ioctl_rtc.c @@ -2,29 +2,10 @@ * This file is part of ioctl_rtc strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -73,13 +54,13 @@ main(void) void *const page = tail_alloc(size); fill_memory(page, size); - struct rtc_time *rt = tail_alloc(sizeof(*rt)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct rtc_time, rt); fill_memory(rt, sizeof(*rt)); - struct rtc_wkalrm *wk = tail_alloc(sizeof(*wk)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct rtc_wkalrm, wk); fill_memory(wk, sizeof(*wk)); - struct rtc_pll_info *pll = tail_alloc(sizeof(*pll)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct rtc_pll_info, pll); fill_memory(pll, sizeof(*pll)); /* RTC_ALM_READ */ diff --git a/tests-m32/ioctl_rtc.gen.test b/tests-m32/ioctl_rtc.gen.test new file mode 100755 index 00000000..310b5588 --- /dev/null +++ b/tests-m32/ioctl_rtc.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_rtc +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_rtc.test b/tests-m32/ioctl_rtc.test deleted file mode 100755 index 4545f2ae..00000000 --- a/tests-m32/ioctl_rtc.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check basic decoding of RTC_* ioctls. - -. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_scsi.c b/tests-m32/ioctl_scsi.c index 0db94d84..b6347b62 100644 --- a/tests-m32/ioctl_scsi.c +++ b/tests-m32/ioctl_scsi.c @@ -2,29 +2,10 @@ * Check decoding of SCSI ioctl commands. * * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -69,7 +50,7 @@ int main(void) { - int *const pint = tail_alloc(sizeof(*pint)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, pint); *pint = (int) 0xfacefeed; TEST_NO_ARG(SG_GET_TIMEOUT); @@ -137,13 +118,14 @@ main(void) "SG_SCSI_RESET"); ioctl(-1, 0x22ff, 0); - printf("ioctl(-1, _IOC(0, 0x22, 0xff, 0), 0) = -1 EBADF (%m)\n"); + printf("ioctl(-1, _IOC(%s, 0x22, 0xff, 0), 0) = -1 EBADF (%m)\n", + _IOC_NONE ? "0" : "_IOC_NONE"); static const unsigned long magic = (unsigned long) 0xdeadbeeffacefeedULL; ioctl(-1, 0x22ff, magic); - printf("ioctl(-1, _IOC(0, 0x22, 0xff, 0), %#lx) = -1 EBADF (%m)\n", - magic); + printf("ioctl(-1, _IOC(%s, 0x22, 0xff, 0), %#lx) = -1 EBADF (%m)\n", + _IOC_NONE ? "0" : "_IOC_NONE", magic); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/ioctl_scsi.gen.test b/tests-m32/ioctl_scsi.gen.test new file mode 100755 index 00000000..499bfc49 --- /dev/null +++ b/tests-m32/ioctl_scsi.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_scsi +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_scsi.test b/tests-m32/ioctl_scsi.test deleted file mode 100755 index 2710f12b..00000000 --- a/tests-m32/ioctl_scsi.test +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -# Check decoding of SCSI ioctl commands. -. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_sg_io_v3.c b/tests-m32/ioctl_sg_io_v3.c index ef25795b..b857892f 100644 --- a/tests-m32/ioctl_sg_io_v3.c +++ b/tests-m32/ioctl_sg_io_v3.c @@ -1,30 +1,10 @@ /* * Check decoding of ioctl SG_IO v3 commands. * - * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -43,7 +23,7 @@ main(void) ioctl(-1, SG_IO, 0); printf("ioctl(-1, SG_IO, NULL) = -1 EBADF (%m)\n"); - struct sg_io_hdr *const sg_io = tail_alloc(sizeof(*sg_io)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sg_io_hdr, sg_io); fill_memory(sg_io, sizeof(*sg_io)); const void *const efault = sg_io + 1; @@ -53,7 +33,7 @@ main(void) ioctl(-1, SG_IO, sg_io); printf("ioctl(-1, SG_IO, [%u]) = -1 EBADF (%m)\n", sg_io->interface_id); - unsigned int *const piid = tail_alloc(sizeof(*piid)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, piid); *piid = (unsigned char) 'S'; ioctl(-1, SG_IO, piid); printf("ioctl(-1, SG_IO, {interface_id='S', %p}) = -1 EBADF (%m)\n", piid + 1); @@ -198,12 +178,12 @@ main(void) sg_io->iovec_count, sg_io->dxfer_len, sg_io->timeout, - * (unsigned char *) (iov[0].iov_base + 0), - * (unsigned char *) (iov[0].iov_base + 1), + *(unsigned char *) (iov[0].iov_base + 0), + *(unsigned char *) (iov[0].iov_base + 1), (unsigned int) iov[0].iov_len, - * (unsigned char *) (iov[1].iov_base + 0), - * (unsigned char *) (iov[1].iov_base + 1), - * (unsigned char *) (iov[1].iov_base + 2), + *(unsigned char *) (iov[1].iov_base + 0), + *(unsigned char *) (iov[1].iov_base + 1), + *(unsigned char *) (iov[1].iov_base + 2), (unsigned int) iov[1].iov_len, sg_io->status, sg_io->masked_status, @@ -248,12 +228,12 @@ main(void) sg_io->iovec_count, sg_io->dxfer_len, sg_io->timeout, - * (unsigned char *) (iov[0].iov_base + 0), - * (unsigned char *) (iov[0].iov_base + 1), + *(unsigned char *) (iov[0].iov_base + 0), + *(unsigned char *) (iov[0].iov_base + 1), (unsigned int) iov[0].iov_len, - * (unsigned char *) (iov[1].iov_base + 0), - * (unsigned char *) (iov[1].iov_base + 1), - * (unsigned char *) (iov[1].iov_base + 2), + *(unsigned char *) (iov[1].iov_base + 0), + *(unsigned char *) (iov[1].iov_base + 1), + *(unsigned char *) (iov[1].iov_base + 2), (unsigned int) iov[1].iov_len, sg_io->status, sg_io->masked_status, @@ -300,10 +280,10 @@ main(void) sg_io->iovec_count, sg_io->dxfer_len, sg_io->timeout, - * (unsigned char *) (sg_io->dxferp + 0), - * (unsigned char *) (sg_io->dxferp + 1), - * (unsigned char *) (sg_io->dxferp + 2), - * (unsigned char *) (sg_io->dxferp + 3), + *(unsigned char *) (sg_io->dxferp + 0), + *(unsigned char *) (sg_io->dxferp + 1), + *(unsigned char *) (sg_io->dxferp + 2), + *(unsigned char *) (sg_io->dxferp + 3), sg_io->status, sg_io->masked_status, sg_io->msg_status, @@ -348,11 +328,11 @@ main(void) sg_io->iovec_count, sg_io->dxfer_len, sg_io->timeout, - * (unsigned char *) (sg_io->dxferp + 0), - * (unsigned char *) (sg_io->dxferp + 1), - * (unsigned char *) (sg_io->dxferp + 2), - * (unsigned char *) (sg_io->dxferp + 0), - * (unsigned char *) (sg_io->dxferp + 1), + *(unsigned char *) (sg_io->dxferp + 0), + *(unsigned char *) (sg_io->dxferp + 1), + *(unsigned char *) (sg_io->dxferp + 2), + *(unsigned char *) (sg_io->dxferp + 0), + *(unsigned char *) (sg_io->dxferp + 1), sg_io->status, sg_io->masked_status, sg_io->msg_status, @@ -394,9 +374,9 @@ main(void) sg_io->iovec_count, sg_io->dxfer_len, sg_io->timeout, - * (unsigned char *) (sg_io->dxferp + 0), - * (unsigned char *) (sg_io->dxferp + 1), - * (unsigned char *) (sg_io->dxferp + 2), + *(unsigned char *) (sg_io->dxferp + 0), + *(unsigned char *) (sg_io->dxferp + 1), + *(unsigned char *) (sg_io->dxferp + 2), sg_io->status, sg_io->masked_status, sg_io->msg_status, diff --git a/tests-m32/ioctl_sg_io_v3.gen.test b/tests-m32/ioctl_sg_io_v3.gen.test new file mode 100755 index 00000000..ef8fd14d --- /dev/null +++ b/tests-m32/ioctl_sg_io_v3.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_sg_io_v3 +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_sg_io_v3.test b/tests-m32/ioctl_sg_io_v3.test deleted file mode 100755 index dacacdf4..00000000 --- a/tests-m32/ioctl_sg_io_v3.test +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -# Check decoding of ioctl SG_IO v3 commands. -. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_sg_io_v4.c b/tests-m32/ioctl_sg_io_v4.c index 5f899eee..59438285 100644 --- a/tests-m32/ioctl_sg_io_v4.c +++ b/tests-m32/ioctl_sg_io_v4.c @@ -1,30 +1,10 @@ /* * Check decoding of ioctl SG_IO v4 commands. * - * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -45,7 +25,7 @@ main(void) ioctl(-1, SG_IO, 0); printf("ioctl(-1, SG_IO, NULL) = -1 EBADF (%m)\n"); - struct sg_io_v4 *const sg_io = tail_alloc(sizeof(*sg_io)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sg_io_v4, sg_io); fill_memory(sg_io, sizeof(*sg_io)); const void *const efault = sg_io + 1; @@ -55,7 +35,7 @@ main(void) ioctl(-1, SG_IO, sg_io); printf("ioctl(-1, SG_IO, [%u]) = -1 EBADF (%m)\n", sg_io->guard); - unsigned int *const pguard = tail_alloc(sizeof(*pguard)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, pguard); *pguard = (unsigned char) 'Q'; ioctl(-1, SG_IO, pguard); printf("ioctl(-1, SG_IO, {guard='Q', %p}) = -1 EBADF (%m)\n", pguard + 1); @@ -189,9 +169,9 @@ main(void) ", dout_resid=%d" ", generated_tag=%#" PRI__x64 "}) = -1 EBADF (%m)\n", sg_io->request_len, - * (unsigned char *) ((unsigned long) sg_io->request + 0), - * (unsigned char *) ((unsigned long) sg_io->request + 1), - * (unsigned char *) ((unsigned long) sg_io->request + 2), + *(unsigned char *) ((unsigned long) sg_io->request + 0), + *(unsigned char *) ((unsigned long) sg_io->request + 1), + *(unsigned char *) ((unsigned long) sg_io->request + 2), sg_io->request_tag, sg_io->request_attr, sg_io->request_priority, @@ -201,22 +181,22 @@ main(void) sg_io->dout_xfer_len, sg_io->din_iovec_count, sg_io->din_xfer_len, - * (unsigned char *) (iov[0].iov_base + 0), - * (unsigned char *) (iov[0].iov_base + 1), + *(unsigned char *) (iov[0].iov_base + 0), + *(unsigned char *) (iov[0].iov_base + 1), (unsigned int) iov[0].iov_len, - * (unsigned char *) (iov[1].iov_base + 0), - * (unsigned char *) (iov[1].iov_base + 1), - * (unsigned char *) (iov[1].iov_base + 2), + *(unsigned char *) (iov[1].iov_base + 0), + *(unsigned char *) (iov[1].iov_base + 1), + *(unsigned char *) (iov[1].iov_base + 2), (unsigned int) iov[1].iov_len, sg_io->timeout, sg_io->usr_ptr, sg_io->response_len, - * (unsigned char *) ((unsigned long) sg_io->response + 0), - * (unsigned char *) ((unsigned long) sg_io->response + 1), - * (unsigned char *) ((unsigned long) sg_io->din_xferp + 0), - * (unsigned char *) ((unsigned long) sg_io->din_xferp + 1), - * (unsigned char *) ((unsigned long) sg_io->din_xferp + 2), - * (unsigned char *) ((unsigned long) sg_io->din_xferp + 3), + *(unsigned char *) ((unsigned long) sg_io->response + 0), + *(unsigned char *) ((unsigned long) sg_io->response + 1), + *(unsigned char *) ((unsigned long) sg_io->din_xferp + 0), + *(unsigned char *) ((unsigned long) sg_io->din_xferp + 1), + *(unsigned char *) ((unsigned long) sg_io->din_xferp + 2), + *(unsigned char *) ((unsigned long) sg_io->din_xferp + 3), sg_io->driver_status, sg_io->transport_status, sg_io->device_status, diff --git a/tests-m32/ioctl_sg_io_v4.gen.test b/tests-m32/ioctl_sg_io_v4.gen.test new file mode 100755 index 00000000..4aa4e4e9 --- /dev/null +++ b/tests-m32/ioctl_sg_io_v4.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_sg_io_v4 +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_sg_io_v4.test b/tests-m32/ioctl_sg_io_v4.test deleted file mode 100755 index 25567224..00000000 --- a/tests-m32/ioctl_sg_io_v4.test +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -# Check decoding of ioctl SG_IO v4 commands. -. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_sock_gifconf.c b/tests-m32/ioctl_sock_gifconf.c index ae0bea4f..0db9d7da 100644 --- a/tests-m32/ioctl_sock_gifconf.c +++ b/tests-m32/ioctl_sock_gifconf.c @@ -2,34 +2,14 @@ * Check decoding of SIOCGIFCONF command of ioctl syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" -#include #include #include @@ -104,7 +84,7 @@ print_ifconf(struct ifconf *ifc, int in_len, char *in_buf, long rc) static void gifconf_ioctl(int fd, struct ifconf *ifc, bool ifc_valid) { - const char * errstr; + const char *errstr; int in_len; char *in_buf; long rc; @@ -134,7 +114,7 @@ int main(int argc, char *argv[]) { struct ifreq *ifr = tail_alloc(2 * sizeof(*ifr)); - struct ifconf *ifc = tail_alloc(sizeof(*ifc)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct ifconf, ifc); struct sockaddr_in addr; int fd; diff --git a/tests-m32/ioctl_sock_gifconf.gen.test b/tests-m32/ioctl_sock_gifconf.gen.test new file mode 100755 index 00000000..5d6fe2f4 --- /dev/null +++ b/tests-m32/ioctl_sock_gifconf.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_sock_gifconf +ioctl.test -a28 -s1); do not edit. +set -- -a28 -s1 +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_sock_gifconf.test b/tests-m32/ioctl_sock_gifconf.test deleted file mode 100755 index 2e2fc019..00000000 --- a/tests-m32/ioctl_sock_gifconf.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check decoding of SIOCGIFCONF ioctl. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a28 -s1 -eioctl $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-m32/ioctl_uffdio.c b/tests-m32/ioctl_uffdio.c index 10b8b843..19104442 100644 --- a/tests-m32/ioctl_uffdio.c +++ b/tests-m32/ioctl_uffdio.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Red Hat, Inc. + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -43,6 +24,9 @@ # include # include +# include "xlat.h" +# include "xlat/uffd_api_features.h" + int main(void) { @@ -54,7 +38,7 @@ main(void) perror_msg_and_skip("userfaultfd"); /* ---- API ---- */ - struct uffdio_api *api_struct = tail_alloc(sizeof(*api_struct)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct uffdio_api, api_struct); /* With a bad fd */ memset(api_struct, 0, sizeof(*api_struct)); @@ -69,10 +53,14 @@ main(void) api_struct->api = UFFD_API; api_struct->features = 0; rc = ioctl(fd, UFFDIO_API, api_struct); - printf("ioctl(%d, UFFDIO_API, {api=0xaa, features=0, " - "features.out=%#" PRIx64 ", " "ioctls=1<<_UFFDIO_REGISTER|" - "1<<_UFFDIO_UNREGISTER|1<<_UFFDIO_API", - fd, (uint64_t)api_struct->features); + printf("ioctl(%d, UFFDIO_API, {api=0xaa, features=0", fd); + if (api_struct->features) { + printf(" => features="); + printflags(uffd_api_features, api_struct->features, + "UFFD_FEATURE_???"); + } + printf(", ioctls=1<<_UFFDIO_REGISTER|" + "1<<_UFFDIO_UNREGISTER|1<<_UFFDIO_API"); api_struct->ioctls &= ~(1ull<<_UFFDIO_REGISTER| 1ull<<_UFFDIO_UNREGISTER| 1ull<<_UFFDIO_API); @@ -127,7 +115,7 @@ main(void) * userfaultfd will cause us to stall. */ /* ---- COPY ---- */ - struct uffdio_copy *copy_struct = tail_alloc(sizeof(*copy_struct)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct uffdio_copy, copy_struct); memset(copy_struct, 0, sizeof(*copy_struct)); rc = ioctl(-1, UFFDIO_COPY, copy_struct); @@ -148,7 +136,7 @@ main(void) fd, area2, area1, pagesize, pagesize, rc); /* ---- ZEROPAGE ---- */ - struct uffdio_zeropage *zero_struct = tail_alloc(sizeof(*zero_struct)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct uffdio_zeropage, zero_struct); madvise(area2, pagesize, MADV_DONTNEED); memset(zero_struct, 0, sizeof(*zero_struct)); @@ -169,7 +157,7 @@ main(void) fd, area2, pagesize, pagesize, rc); /* ---- WAKE ---- */ - struct uffdio_range *range_struct = tail_alloc(sizeof(*range_struct)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct uffdio_range, range_struct); memset(range_struct, 0, sizeof(*range_struct)); rc = ioctl(-1, UFFDIO_WAKE, range_struct); diff --git a/tests-m32/ioctl_uffdio.gen.test b/tests-m32/ioctl_uffdio.gen.test new file mode 100755 index 00000000..ed73c5f0 --- /dev/null +++ b/tests-m32/ioctl_uffdio.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_uffdio +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_uffdio.test b/tests-m32/ioctl_uffdio.test deleted file mode 100755 index fae9b556..00000000 --- a/tests-m32/ioctl_uffdio.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check userfaultfd ioctl decoding. - -. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_v4l2.c b/tests-m32/ioctl_v4l2.c index af8c3419..54e9ee7c 100644 --- a/tests-m32/ioctl_v4l2.c +++ b/tests-m32/ioctl_v4l2.c @@ -1,66 +1,365 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" +#include #include #include #include #include #include -#if WORDS_BIGENDIAN -# define cc0(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 24)) -# define cc1(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 16)) -# define cc2(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 8)) -# define cc3(arg) ((unsigned int) (unsigned char) (arg)) -# define fourcc(a0, a1, a2, a3) \ - ((unsigned int)(a3) | \ - ((unsigned int)(a2) << 8) | \ - ((unsigned int)(a1) << 16) | \ - ((unsigned int)(a0) << 24)) -#else -# define cc0(arg) ((unsigned int) (unsigned char) (arg)) -# define cc1(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 8)) -# define cc2(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 16)) -# define cc3(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 24)) -# define fourcc(a0, a1, a2, a3) \ +#define cc0(arg) ((unsigned int) (unsigned char) (arg)) +#define cc1(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 8)) +#define cc2(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 16)) +#define cc3(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 24)) +#define fourcc(a0, a1, a2, a3) \ ((unsigned int)(a0) | \ ((unsigned int)(a1) << 8) | \ ((unsigned int)(a2) << 16) | \ ((unsigned int)(a3) << 24)) -#endif static const unsigned int magic = 0xdeadbeef; +static const unsigned int pf_magic = fourcc('S', '5', '0', '8'); +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT +static const unsigned int sf_magic = fourcc('R', 'U', '1', '2'); +#endif + +static void +init_v4l2_format(struct v4l2_format *const f, + const unsigned int buf_type) +{ + memset(f, -1, sizeof(*f)); + f->type = buf_type; + switch (buf_type) { + case V4L2_BUF_TYPE_VIDEO_CAPTURE: + case V4L2_BUF_TYPE_VIDEO_OUTPUT: + f->fmt.pix.width = 0x657b8160; + f->fmt.pix.height = 0x951c0047; + if (buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE) + f->fmt.pix.pixelformat = magic; + else + f->fmt.pix.pixelformat = pf_magic; + f->fmt.pix.field = V4L2_FIELD_NONE; + f->fmt.pix.bytesperline = 0xdf20d185; + f->fmt.pix.sizeimage = 0x0cf7be41; + f->fmt.pix.colorspace = V4L2_COLORSPACE_JPEG; + break; +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE + case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: + case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: { + unsigned int i; + + f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; + f->fmt.pix_mp.width = 0x1f3b774b; + f->fmt.pix_mp.height = 0xab96a8d6; + if (buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) + f->fmt.pix_mp.pixelformat = magic; + else + f->fmt.pix_mp.pixelformat = pf_magic; + f->fmt.pix_mp.field = V4L2_FIELD_NONE; + f->fmt.pix_mp.colorspace = V4L2_COLORSPACE_JPEG; + struct v4l2_plane_pix_format *cur_pix = + f->fmt.pix_mp.plane_fmt; + for (i = 0; + i < ARRAY_SIZE(f->fmt.pix_mp.plane_fmt); + i++) { + cur_pix[i].sizeimage = 0x1e3c531c | i; + cur_pix[i].bytesperline = 0xa983d721 | i; + } + break; + } +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY + case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: +#endif + case V4L2_BUF_TYPE_VIDEO_OVERLAY: + f->fmt.win.w.left = 0xe8373662; + f->fmt.win.w.top = 0x0336d283; + f->fmt.win.w.width = 0x9235fe72; + f->fmt.win.w.height = 0xbbd886c8; + f->fmt.win.field = V4L2_FIELD_ANY; + f->fmt.win.chromakey = 0xdb1f991f; + f->fmt.win.clipcount = 2; + f->fmt.win.clips = + tail_alloc(sizeof(*f->fmt.win.clips) * + f->fmt.win.clipcount); + f->fmt.win.clips[0].c.left = 0x3313d36e; + f->fmt.win.clips[0].c.top = 0xcdffe510; + f->fmt.win.clips[0].c.width = 0x2064f3a8; + f->fmt.win.clips[0].c.height = 0xd06d314a; + f->fmt.win.clips[1].c.left = 0xd8c8a83f; + f->fmt.win.clips[1].c.top = 0x336e87ba; + f->fmt.win.clips[1].c.width = 0x9e3a6fb3; + f->fmt.win.clips[1].c.height = 0x05617b76; + + f->fmt.win.bitmap = (void *) -2UL; +#ifdef HAVE_STRUCT_V4L2_WINDOW_GLOBAL_ALPHA + f->fmt.win.global_alpha = 0xce; +#endif + break; + case V4L2_BUF_TYPE_VBI_CAPTURE: + case V4L2_BUF_TYPE_VBI_OUTPUT: + f->fmt.vbi.sampling_rate = 0x3d9b5b79; + f->fmt.vbi.offset = 0x055b3a09; + f->fmt.vbi.samples_per_line = 0xf176d436; + if (buf_type == V4L2_BUF_TYPE_VBI_CAPTURE) + f->fmt.vbi.sample_format = magic; + else + f->fmt.vbi.sample_format = pf_magic; + f->fmt.vbi.start[0] = 0x9858e2eb; + f->fmt.vbi.start[1] = 0x8a4dc8c1; + f->fmt.vbi.count[0] = 0x4bcf36a3; + f->fmt.vbi.count[1] = 0x97dff65f; + f->fmt.vbi.flags = V4L2_VBI_INTERLACED; + break; +#if HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE + case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: + case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: { + unsigned int i; + + f->fmt.sliced.service_set = V4L2_SLICED_VPS; + f->fmt.sliced.io_size = 0xd897925a; + for (i = 0; + i < ARRAY_SIZE(f->fmt.sliced.service_lines[0]); + i++) { + f->fmt.sliced.service_lines[0][i] = 0xc38e | i; + f->fmt.sliced.service_lines[1][i] = 0x3abb | i; + } + break; + } +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT + case V4L2_BUF_TYPE_SDR_OUTPUT: + f->fmt.sdr.pixelformat = sf_magic; +# ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE + f->fmt.sdr.buffersize = 0x25afabfb; +# endif + break; +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE + case V4L2_BUF_TYPE_SDR_CAPTURE: + f->fmt.sdr.pixelformat = magic; +# ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE + f->fmt.sdr.buffersize = 0x25afabfb; +# endif + break; +#endif + } +} + +static void +dprint_ioctl_v4l2(struct v4l2_format *const f, + const char *request, const unsigned int buf_type, + const char *buf_type_string) +{ + int saved_errno; + + switch (buf_type) { + case V4L2_BUF_TYPE_VIDEO_CAPTURE: + case V4L2_BUF_TYPE_VIDEO_OUTPUT: + saved_errno = errno; + printf("ioctl(-1, %s, {type=%s" + ", fmt.pix={width=%u, height=%u, pixelformat=", + request, + buf_type_string, + f->fmt.pix.width, f->fmt.pix.height); + + if (buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE) + printf("v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')", + cc0(magic), cc1(magic), cc2(magic), cc3(magic)); + else + printf("v4l2_fourcc('%c', '%c', '%c', '%c') " + "/* V4L2_PIX_FMT_SPCA508 */", + cc0(pf_magic), cc1(pf_magic), cc2(pf_magic), + cc3(pf_magic)); + + errno = saved_errno; + printf(", field=V4L2_FIELD_NONE, bytesperline=%u, sizeimage=%u" + ", colorspace=V4L2_COLORSPACE_JPEG}}) = -1 EBADF (%m)\n", + f->fmt.pix.bytesperline, + f->fmt.pix.sizeimage); + break; +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE + case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: + case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: { + unsigned int i; + + saved_errno = errno; + printf("ioctl(-1, %s" + ", {type=%s" + ", fmt.pix_mp={width=%u, height=%u, pixelformat=", + request, + buf_type_string, + f->fmt.pix_mp.width, f->fmt.pix_mp.height); + + if (buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) + printf("v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')", + cc0(magic), cc1(magic), cc2(magic), cc3(magic)); + else + printf("v4l2_fourcc('%c', '%c', '%c', '%c') " + "/* V4L2_PIX_FMT_SPCA508 */", + cc0(pf_magic), cc1(pf_magic), cc2(pf_magic), + cc3(pf_magic)); + + printf(", field=V4L2_FIELD_NONE, colorspace=" + "V4L2_COLORSPACE_JPEG, plane_fmt=["); + for (i = 0; + i < ARRAY_SIZE(f->fmt.pix_mp.plane_fmt); + ++i) { + if (i) + printf(", "); + printf("{sizeimage=%u, bytesperline=%u}", + f->fmt.pix_mp.plane_fmt[i].sizeimage, + f->fmt.pix_mp.plane_fmt[i].bytesperline); + } + errno = saved_errno; + printf("], num_planes=%u}}) = -1 EBADF (%m)\n", + f->fmt.pix_mp.num_planes); + break; + } +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY + case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: +#endif + case V4L2_BUF_TYPE_VIDEO_OVERLAY: + printf("ioctl(-1, %s, {type=%s" + ", fmt.win={left=%d, top=%d, width=%u, height=%u" + ", field=V4L2_FIELD_ANY, chromakey=%#x, clips=" + "[{left=%d, top=%d, width=%u, height=%u}, " + "{left=%d, top=%d, width=%u, height=%u}]" + ", clipcount=%u, bitmap=%p" +#ifdef HAVE_STRUCT_V4L2_WINDOW_GLOBAL_ALPHA + ", global_alpha=%#x" +#endif + "}}) = -1 EBADF (%m)\n", + request, + buf_type_string, + f->fmt.win.w.left, f->fmt.win.w.top, + f->fmt.win.w.width, f->fmt.win.w.height, + f->fmt.win.chromakey, + f->fmt.win.clips[0].c.left, + f->fmt.win.clips[0].c.top, + f->fmt.win.clips[0].c.width, + f->fmt.win.clips[0].c.height, + f->fmt.win.clips[1].c.left, + f->fmt.win.clips[1].c.top, + f->fmt.win.clips[1].c.width, + f->fmt.win.clips[1].c.height, + f->fmt.win.clipcount, f->fmt.win.bitmap +#ifdef HAVE_STRUCT_V4L2_WINDOW_GLOBAL_ALPHA + , f->fmt.win.global_alpha +#endif + ); + break; + case V4L2_BUF_TYPE_VBI_CAPTURE: + case V4L2_BUF_TYPE_VBI_OUTPUT: + saved_errno = errno; + printf("ioctl(-1, %s, {type=%s" + ", fmt.vbi={sampling_rate=%u, offset=%u" + ", samples_per_line=%u, sample_format=", + request, + buf_type_string, + f->fmt.vbi.sampling_rate, f->fmt.vbi.offset, + f->fmt.vbi.samples_per_line); + + if (buf_type == V4L2_BUF_TYPE_VBI_CAPTURE) + printf("v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')", + cc0(magic), cc1(magic), cc2(magic), cc3(magic)); + else + printf("v4l2_fourcc('%c', '%c', '%c', '%c') " + "/* V4L2_PIX_FMT_SPCA508 */", + cc0(pf_magic), cc1(pf_magic), cc2(pf_magic), + cc3(pf_magic)); + + errno = saved_errno; + printf(", start=[%u, %u], count=[%u, %u]" + ", flags=V4L2_VBI_INTERLACED}})" + " = -1 EBADF (%m)\n", + f->fmt.vbi.start[0], f->fmt.vbi.start[1], + f->fmt.vbi.count[0], f->fmt.vbi.count[1]); + break; +#if HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE + case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: + case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: { + unsigned int i, j; + + printf("ioctl(-1, %s, {type=%s" + ", fmt.sliced={service_set=V4L2_SLICED_VPS" + ", io_size=%u, service_lines=[", + request, + buf_type_string, + f->fmt.sliced.io_size); + for (i = 0; + i < ARRAY_SIZE(f->fmt.sliced.service_lines); + i++) { + if (i > 0) + printf(", "); + printf("["); + for (j = 0; + j < ARRAY_SIZE(f->fmt.sliced.service_lines[0]); + j++) { + if (j > 0) + printf(", "); + printf("%#x", + f->fmt.sliced.service_lines[i][j]); + } + printf("]"); + } + printf("]}}) = -1 EBADF (%m)\n"); + break; + } +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT + case V4L2_BUF_TYPE_SDR_OUTPUT: +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE + case V4L2_BUF_TYPE_SDR_CAPTURE: + saved_errno = errno; + printf("ioctl(-1, %s, {type=%s" + ", fmt.sdr={pixelformat=", + request, + buf_type_string); + + if (buf_type == V4L2_BUF_TYPE_SDR_CAPTURE) + printf("v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')", + cc0(magic), cc1(magic), cc2(magic), cc3(magic)); +# if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT + else + printf("v4l2_fourcc('%c', '%c', '%c', '%c') " + "/* V4L2_SDR_FMT_RU12LE */", + cc0(sf_magic), cc1(sf_magic), cc2(sf_magic), + cc3(sf_magic)); +# endif + + errno = saved_errno; + printf( +# ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE + ", buffersize=%u" +# endif + "}}) = -1 EBADF (%m)\n" +# ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE + , f->fmt.sdr.buffersize +# endif + ); + break; +#endif + } +} +#define print_ioctl_v4l2(v4l2_format, request, buf_type) \ + dprint_ioctl_v4l2((v4l2_format), (request), (buf_type), #buf_type) int -main(void ) +main(void) { const unsigned int size = get_page_size(); void *const page = tail_alloc(size); + void *const page_end = page + size; fill_memory(page, size); unsigned char cc[sizeof(int)] = { 'A', '\'', '\\', '\xfa' }; @@ -76,7 +375,7 @@ main(void ) ioctl(-1, VIDIOC_ENUM_FMT, 0); printf("ioctl(-1, VIDIOC_ENUM_FMT, NULL) = -1 EBADF (%m)\n"); - struct v4l2_fmtdesc *const p_fmtdesc = tail_alloc(sizeof(*p_fmtdesc)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_fmtdesc, p_fmtdesc); p_fmtdesc->index = magic; p_fmtdesc->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ioctl(-1, VIDIOC_ENUM_FMT, p_fmtdesc); @@ -88,99 +387,167 @@ main(void ) ioctl(-1, VIDIOC_G_FMT, 0); printf("ioctl(-1, VIDIOC_G_FMT, NULL) = -1 EBADF (%m)\n"); - struct v4l2_format *const p_format = tail_alloc(sizeof(*p_format)); - p_format->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_format, p_format); + p_format->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ioctl(-1, VIDIOC_G_FMT, p_format); printf("ioctl(-1, VIDIOC_G_FMT" ", {type=V4L2_BUF_TYPE_VIDEO_CAPTURE}) = -1 EBADF (%m)\n"); +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE + p_format->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE}) =" + " -1 EBADF (%m)\n"); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY + p_format->type = V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY; + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY}) =" + " -1 EBADF (%m)\n"); +#endif + p_format->type = V4L2_BUF_TYPE_VIDEO_OVERLAY; + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_VIDEO_OVERLAY}) =" + " -1 EBADF (%m)\n"); + p_format->type = V4L2_BUF_TYPE_VBI_CAPTURE; + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_VBI_CAPTURE}) = -1 EBADF (%m)\n"); +#if HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE + p_format->type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE; + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_SLICED_VBI_CAPTURE}) = -1 EBADF (%m)\n"); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE + p_format->type = V4L2_BUF_TYPE_SDR_CAPTURE; + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_SDR_CAPTURE}) = -1 EBADF (%m)\n"); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT + p_format->type = V4L2_BUF_TYPE_SDR_OUTPUT; + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_SDR_OUTPUT}) = -1 EBADF (%m)\n"); +#endif /* VIDIOC_S_FMT */ ioctl(-1, VIDIOC_S_FMT, 0); printf("ioctl(-1, VIDIOC_S_FMT, NULL) = -1 EBADF (%m)\n"); - p_format->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; - p_format->fmt.pix.width = 0xdad1beaf; - p_format->fmt.pix.height = 0xdad2beaf; - p_format->fmt.pix.pixelformat = magic; - p_format->fmt.pix.field = V4L2_FIELD_NONE; - p_format->fmt.pix.bytesperline = 0xdad3beaf; - p_format->fmt.pix.sizeimage = 0xdad4beaf; - p_format->fmt.pix.colorspace = V4L2_COLORSPACE_JPEG; - + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_OUTPUT); ioctl(-1, VIDIOC_S_FMT, p_format); - printf("ioctl(-1, VIDIOC_S_FMT, {type=V4L2_BUF_TYPE_VIDEO_OUTPUT" - ", fmt.pix={width=%u, height=%u, pixelformat=" - "v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')" - ", field=V4L2_FIELD_NONE, bytesperline=%u, sizeimage=%u" - ", colorspace=V4L2_COLORSPACE_JPEG}}) = -1 EBADF (%m)\n", - p_format->fmt.pix.width, p_format->fmt.pix.height, - cc0(magic), cc1(magic), cc2(magic), cc3(magic), - p_format->fmt.pix.bytesperline, p_format->fmt.pix.sizeimage); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", V4L2_BUF_TYPE_VIDEO_OUTPUT); +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); + ioctl(-1, VIDIOC_S_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", + V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY); + ioctl(-1, VIDIOC_S_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", + V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY); +#endif + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_OVERLAY); + ioctl(-1, VIDIOC_S_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", + V4L2_BUF_TYPE_VIDEO_OVERLAY); + init_v4l2_format(p_format, V4L2_BUF_TYPE_VBI_CAPTURE); + ioctl(-1, VIDIOC_S_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", V4L2_BUF_TYPE_VBI_CAPTURE); +#if HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE + init_v4l2_format(p_format, V4L2_BUF_TYPE_SLICED_VBI_CAPTURE); + ioctl(-1, VIDIOC_S_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", + V4L2_BUF_TYPE_SLICED_VBI_CAPTURE); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE + init_v4l2_format(p_format, V4L2_BUF_TYPE_SDR_CAPTURE); + ioctl(-1, VIDIOC_S_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", V4L2_BUF_TYPE_SDR_CAPTURE); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT + init_v4l2_format(p_format, V4L2_BUF_TYPE_SDR_OUTPUT); + ioctl(-1, VIDIOC_S_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", V4L2_BUF_TYPE_SDR_OUTPUT); +#endif /* VIDIOC_TRY_FMT */ ioctl(-1, VIDIOC_TRY_FMT, 0); printf("ioctl(-1, VIDIOC_TRY_FMT, NULL) = -1 EBADF (%m)\n"); + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_OUTPUT); + ioctl(-1, VIDIOC_TRY_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", + V4L2_BUF_TYPE_VIDEO_OUTPUT); #if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE - memset(p_format, -1, sizeof(*p_format)); - p_format->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; - p_format->fmt.pix_mp.width = 0xdad1beaf; - p_format->fmt.pix_mp.height = 0xdad2beaf; - p_format->fmt.pix_mp.pixelformat = magic; - p_format->fmt.pix_mp.field = V4L2_FIELD_NONE; - p_format->fmt.pix_mp.colorspace = V4L2_COLORSPACE_JPEG; - unsigned int i; - for (i = 0; i < ARRAY_SIZE(p_format->fmt.pix_mp.plane_fmt); ++i) { - p_format->fmt.pix_mp.plane_fmt[i].sizeimage = 0xbadc0de0 | i; - p_format->fmt.pix_mp.plane_fmt[i].bytesperline = 0xdadbeaf0 | i; - } + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); ioctl(-1, VIDIOC_TRY_FMT, p_format); - printf("ioctl(-1, VIDIOC_TRY_FMT" - ", {type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE" - ", fmt.pix_mp={width=%u, height=%u, pixelformat=" - "v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')" - ", field=V4L2_FIELD_NONE, colorspace=V4L2_COLORSPACE_JPEG" - ", plane_fmt=[", - p_format->fmt.pix_mp.width, p_format->fmt.pix_mp.height, - cc0(magic), cc1(magic), cc2(magic), cc3(magic)); - for (i = 0; i < ARRAY_SIZE(p_format->fmt.pix_mp.plane_fmt); ++i) { - if (i) - printf(", "); - printf("{sizeimage=%u, bytesperline=%u}", - p_format->fmt.pix_mp.plane_fmt[i].sizeimage, - p_format->fmt.pix_mp.plane_fmt[i].bytesperline); - } - printf("], num_planes=%u}}) = -1 EBADF (%m)\n", - p_format->fmt.pix_mp.num_planes); -#else + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", + V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY); + ioctl(-1, VIDIOC_TRY_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", + V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY); +#endif + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_OVERLAY); + ioctl(-1, VIDIOC_TRY_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", + V4L2_BUF_TYPE_VIDEO_OVERLAY); + + init_v4l2_format(p_format, V4L2_BUF_TYPE_VBI_CAPTURE); + ioctl(-1, VIDIOC_TRY_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", V4L2_BUF_TYPE_VBI_CAPTURE); +#if HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE + init_v4l2_format(p_format, V4L2_BUF_TYPE_SLICED_VBI_CAPTURE); + ioctl(-1, VIDIOC_TRY_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", + V4L2_BUF_TYPE_SLICED_VBI_CAPTURE); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE + init_v4l2_format(p_format, V4L2_BUF_TYPE_SDR_CAPTURE); + ioctl(-1, VIDIOC_TRY_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", V4L2_BUF_TYPE_SDR_CAPTURE); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT + init_v4l2_format(p_format, V4L2_BUF_TYPE_SDR_OUTPUT); + ioctl(-1, VIDIOC_TRY_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", V4L2_BUF_TYPE_SDR_OUTPUT); +#endif struct v4l2_format *const p_v4l2_format = - page + size - sizeof(*p_v4l2_format); + page_end - sizeof(*p_v4l2_format); ioctl(-1, VIDIOC_TRY_FMT, p_v4l2_format); printf("ioctl(-1, VIDIOC_TRY_FMT, {type=%#x /* V4L2_BUF_TYPE_??? */})" " = -1 EBADF (%m)\n", p_v4l2_format->type); -#endif /* VIDIOC_REQBUFS */ ioctl(-1, VIDIOC_REQBUFS, 0); printf("ioctl(-1, VIDIOC_REQBUFS, NULL) = -1 EBADF (%m)\n"); struct v4l2_requestbuffers *const p_v4l2_requestbuffers = - page + size - sizeof(*p_v4l2_requestbuffers); + page_end - sizeof(*p_v4l2_requestbuffers); ioctl(-1, VIDIOC_REQBUFS, p_v4l2_requestbuffers); - printf("ioctl(-1, VIDIOC_REQBUFS, {count=%u, type=%#x" - " /* V4L2_BUF_TYPE_??? */, memory=%#x /* V4L2_MEMORY_??? */})" + printf("ioctl(-1, VIDIOC_REQBUFS, {type=%#x /* V4L2_BUF_TYPE_??? */, " + "memory=%#x /* V4L2_MEMORY_??? */, count=%u})" " = -1 EBADF (%m)\n", - p_v4l2_requestbuffers->count, p_v4l2_requestbuffers->type, - p_v4l2_requestbuffers->memory); + p_v4l2_requestbuffers->memory, + p_v4l2_requestbuffers->count); /* VIDIOC_QUERYBUF */ ioctl(-1, VIDIOC_QUERYBUF, 0); printf("ioctl(-1, VIDIOC_QUERYBUF, NULL) = -1 EBADF (%m)\n"); struct v4l2_buffer *const p_v4l2_buffer = - page + size - sizeof(*p_v4l2_buffer); + page_end - sizeof(*p_v4l2_buffer); ioctl(-1, VIDIOC_QUERYBUF, p_v4l2_buffer); printf("ioctl(-1, VIDIOC_QUERYBUF, {type=%#x /* V4L2_BUF_TYPE_??? */" ", index=%u}) = -1 EBADF (%m)\n", @@ -216,7 +583,7 @@ main(void ) printf("ioctl(-1, VIDIOC_S_FBUF, NULL) = -1 EBADF (%m)\n"); struct v4l2_framebuffer *const p_v4l2_framebuffer = - page + size - sizeof(*p_v4l2_framebuffer); + page_end - sizeof(*p_v4l2_framebuffer); ioctl(-1, VIDIOC_S_FBUF, p_v4l2_framebuffer); printf("ioctl(-1, VIDIOC_S_FBUF, {capability=%#x" ", flags=%#x, base=%p}) = -1 EBADF (%m)\n", @@ -228,7 +595,7 @@ main(void ) ioctl(-1, VIDIOC_STREAMON, 0); printf("ioctl(-1, VIDIOC_STREAMON, NULL) = -1 EBADF (%m)\n"); - int *const p_int = page + size - sizeof(int); + int *const p_int = page_end - sizeof(int); ioctl(-1, VIDIOC_STREAMON, p_int); printf("ioctl(-1, VIDIOC_STREAMON, [%#x /* V4L2_BUF_TYPE_??? */])" " = -1 EBADF (%m)\n", *p_int); @@ -246,7 +613,7 @@ main(void ) printf("ioctl(-1, VIDIOC_G_PARM, NULL) = -1 EBADF (%m)\n"); struct v4l2_streamparm *const p_v4l2_streamparm = - page + size - sizeof(*p_v4l2_streamparm); + page_end - sizeof(*p_v4l2_streamparm); ioctl(-1, VIDIOC_G_PARM, p_v4l2_streamparm); printf("ioctl(-1, VIDIOC_G_PARM, {type=%#x /* V4L2_BUF_TYPE_??? */})" " = -1 EBADF (%m)\n", p_v4l2_streamparm->type); @@ -259,8 +626,7 @@ main(void ) printf("ioctl(-1, VIDIOC_S_PARM, {type=%#x /* V4L2_BUF_TYPE_??? */})" " = -1 EBADF (%m)\n", p_v4l2_streamparm->type); - struct v4l2_streamparm *const p_streamparm = - tail_alloc(sizeof(*p_streamparm)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_streamparm, p_streamparm); p_streamparm->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; p_streamparm->parm.capture.capability = V4L2_CAP_TIMEPERFRAME; p_streamparm->parm.capture.capturemode = V4L2_MODE_HIGHQUALITY; @@ -295,7 +661,7 @@ main(void ) ioctl(-1, VIDIOC_S_STD, 0); printf("ioctl(-1, VIDIOC_S_STD, NULL) = -1 EBADF (%m)\n"); - long long *const p_longlong = page + size - sizeof(*p_longlong); + long long *const p_longlong = page_end - sizeof(*p_longlong); ioctl(-1, VIDIOC_S_STD, p_longlong); printf("ioctl(-1, VIDIOC_S_STD, [%#llx]) = -1 EBADF (%m)\n", *p_longlong); @@ -305,7 +671,7 @@ main(void ) printf("ioctl(-1, VIDIOC_ENUMSTD, NULL) = -1 EBADF (%m)\n"); struct v4l2_standard *const p_v4l2_standard = - page + size - sizeof(*p_v4l2_standard); + page_end - sizeof(*p_v4l2_standard); ioctl(-1, VIDIOC_ENUMSTD, p_v4l2_standard); printf("ioctl(-1, VIDIOC_ENUMSTD, {index=%u}) = -1 EBADF (%m)\n", p_v4l2_standard->index); @@ -315,7 +681,7 @@ main(void ) printf("ioctl(-1, VIDIOC_ENUMINPUT, NULL) = -1 EBADF (%m)\n"); struct v4l2_input *const p_v4l2_input = - page + size - sizeof(*p_v4l2_input); + page_end - sizeof(*p_v4l2_input); ioctl(-1, VIDIOC_ENUMINPUT, p_v4l2_input); printf("ioctl(-1, VIDIOC_ENUMINPUT, {index=%u}) = -1 EBADF (%m)\n", p_v4l2_input->index); @@ -325,7 +691,7 @@ main(void ) printf("ioctl(-1, VIDIOC_G_CTRL, NULL) = -1 EBADF (%m)\n"); struct v4l2_control *const p_v4l2_control = - page + size - sizeof(*p_v4l2_control); + page_end - sizeof(*p_v4l2_control); ioctl(-1, VIDIOC_G_CTRL, p_v4l2_control); printf("ioctl(-1, VIDIOC_G_CTRL, {id=%#x /* V4L2_CID_??? */})" " = -1 EBADF (%m)\n", p_v4l2_control->id); @@ -339,24 +705,59 @@ main(void ) ", value=%d}) = -1 EBADF (%m)\n", p_v4l2_control->id, p_v4l2_control->value); + /* VIDIOC_G_TUNER */ + ioctl(-1, VIDIOC_G_TUNER, 0); + printf("ioctl(-1, VIDIOC_G_TUNER, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_tuner *const p_v4l2_tuner = + page_end - sizeof(*p_v4l2_tuner); + ioctl(-1, VIDIOC_G_TUNER, p_v4l2_tuner); + printf("ioctl(-1, VIDIOC_G_TUNER, {index=%u})" + " = -1 EBADF (%m)\n", p_v4l2_tuner->index); + + /* VIDIOC_S_TUNER */ + ioctl(-1, VIDIOC_S_TUNER, 0); + printf("ioctl(-1, VIDIOC_S_TUNER, NULL) = -1 EBADF (%m)\n"); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_tuner, p_tuner); + p_tuner->index = 0x4fb6df39; + strcpy((char *) p_tuner->name, "cum tacent clamant"); + p_tuner->type = V4L2_TUNER_RADIO; + p_tuner->capability = V4L2_TUNER_CAP_LOW; + p_tuner->rangelow = 0xa673bc29; + p_tuner->rangehigh = 0xbaf16d12; + p_tuner->rxsubchans = V4L2_TUNER_SUB_MONO; + p_tuner->audmode = V4L2_TUNER_MODE_MONO; + p_tuner->signal = 0x10bf92c8; + p_tuner->afc = 0x3bf7e18b; + ioctl(-1, VIDIOC_S_TUNER, p_tuner); + printf("ioctl(-1, VIDIOC_S_TUNER, {index=%u" + ", name=\"cum tacent clamant\"" + ", type=V4L2_TUNER_RADIO, capability=V4L2_TUNER_CAP_LOW" + ", rangelow=%u, rangehigh=%u" + ", rxsubchans=V4L2_TUNER_SUB_MONO" + ", audmode=V4L2_TUNER_MODE_MONO, signal=%d, afc=%d" + "}) = -1 EBADF (%m)\n", + p_tuner->index, p_tuner->rangelow, + p_tuner->rangehigh, p_tuner->signal, p_tuner->afc); + /* VIDIOC_QUERYCTRL */ ioctl(-1, VIDIOC_QUERYCTRL, 0); printf("ioctl(-1, VIDIOC_QUERYCTRL, NULL) = -1 EBADF (%m)\n"); struct v4l2_queryctrl *const p_v4l2_queryctrl = - page + size - sizeof(*p_v4l2_queryctrl); + page_end - sizeof(*p_v4l2_queryctrl); ioctl(-1, VIDIOC_QUERYCTRL, p_v4l2_queryctrl); -# ifdef V4L2_CTRL_FLAG_NEXT_CTRL +#ifdef V4L2_CTRL_FLAG_NEXT_CTRL printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=V4L2_CTRL_FLAG_NEXT_CTRL" "|%#x /* V4L2_CID_??? */}) = -1 EBADF (%m)\n", p_v4l2_queryctrl->id & ~V4L2_CTRL_FLAG_NEXT_CTRL); -# else +#else printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=%#x /* V4L2_CID_??? */})" " = -1 EBADF (%m)\n", p_v4l2_queryctrl->id); -# endif +#endif - struct v4l2_queryctrl *const p_queryctrl = - tail_alloc(sizeof(*p_queryctrl)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_queryctrl, p_queryctrl); p_queryctrl->id = V4L2_CID_SATURATION; ioctl(-1, VIDIOC_QUERYCTRL, p_queryctrl); printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=V4L2_CID_SATURATION})" @@ -381,7 +782,7 @@ main(void ) printf("ioctl(-1, VIDIOC_CROPCAP, NULL) = -1 EBADF (%m)\n"); struct v4l2_cropcap *const p_v4l2_cropcap = - page + size - sizeof(*p_v4l2_cropcap); + page_end - sizeof(*p_v4l2_cropcap); ioctl(-1, VIDIOC_CROPCAP, p_v4l2_cropcap); printf("ioctl(-1, VIDIOC_CROPCAP, {type=%#x /* V4L2_BUF_TYPE_??? */})" " = -1 EBADF (%m)\n", p_v4l2_cropcap->type); @@ -391,7 +792,7 @@ main(void ) printf("ioctl(-1, VIDIOC_G_CROP, NULL) = -1 EBADF (%m)\n"); struct v4l2_crop *const p_v4l2_crop = - page + size - sizeof(*p_v4l2_crop); + page_end - sizeof(*p_v4l2_crop); ioctl(-1, VIDIOC_G_CROP, p_v4l2_crop); printf("ioctl(-1, VIDIOC_G_CROP, {type=%#x /* V4L2_BUF_TYPE_??? */})" " = -1 EBADF (%m)\n", p_v4l2_crop->type); @@ -414,8 +815,7 @@ main(void ) ioctl(-1, VIDIOC_S_EXT_CTRLS, 0); printf("ioctl(-1, VIDIOC_S_EXT_CTRLS, NULL) = -1 EBADF (%m)\n"); - struct v4l2_ext_controls *const p_ext_controls = - tail_alloc(sizeof(*p_ext_controls)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_ext_controls, p_ext_controls); p_ext_controls->ctrl_class = V4L2_CTRL_CLASS_USER; p_ext_controls->count = 0; p_ext_controls->controls = (void *) -2UL; @@ -423,6 +823,21 @@ main(void ) printf("ioctl(-1, VIDIOC_S_EXT_CTRLS, {ctrl_class=V4L2_CTRL_CLASS_USER" ", count=%u}) = -1 EBADF (%m)\n", p_ext_controls->count); + p_ext_controls->ctrl_class = 0x00a30000; + p_ext_controls->count = magic; + ioctl(-1, VIDIOC_S_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_S_EXT_CTRLS, {ctrl_class=V4L2_CTRL_CLASS_DETECT" + ", count=%u, controls=%p}) = -1 EBADF (%m)\n", + p_ext_controls->count, p_ext_controls->controls); + + p_ext_controls->ctrl_class = 0x00a40000; + p_ext_controls->count = magic; + ioctl(-1, VIDIOC_S_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_S_EXT_CTRLS" + ", {ctrl_class=0xa40000 /* V4L2_CTRL_CLASS_??? */" + ", count=%u, controls=%p}) = -1 EBADF (%m)\n", + p_ext_controls->count, p_ext_controls->controls); + p_ext_controls->ctrl_class = V4L2_CTRL_CLASS_MPEG; p_ext_controls->count = magic; ioctl(-1, VIDIOC_S_EXT_CTRLS, p_ext_controls); @@ -464,7 +879,7 @@ main(void ) ", {ctrl_class=V4L2_CTRL_CLASS_MPEG, count=%u, controls=" "[{id=V4L2_CID_BRIGHTNESS, size=0, value=%d, value64=%lld}" ", {id=V4L2_CID_CONTRAST, size=2, string=\"\\377\\377\"}" - ", %p]}) = -1 EBADF (%m)\n", + ", ... /* %p */]}) = -1 EBADF (%m)\n", p_ext_controls->count, p_ext_controls->controls[0].value, (long long) p_ext_controls->controls[0].value64, @@ -500,8 +915,7 @@ main(void ) ioctl(-1, VIDIOC_ENUM_FRAMESIZES, 0); printf("ioctl(-1, VIDIOC_ENUM_FRAMESIZES, NULL) = -1 EBADF (%m)\n"); - struct v4l2_frmsizeenum *const p_frmsizeenum = - tail_alloc(sizeof(*p_frmsizeenum)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_frmsizeenum, p_frmsizeenum); p_frmsizeenum->index = magic; p_frmsizeenum->pixel_format = fourcc(cc[0], cc[1], cc[2], cc[3]); @@ -517,7 +931,7 @@ main(void ) printf("ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, NULL) = -1 EBADF (%m)\n"); struct v4l2_frmivalenum *const p_v4l2_frmivalenum = - page + size - sizeof(*p_v4l2_frmivalenum); + page_end - sizeof(*p_v4l2_frmivalenum); ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, p_v4l2_frmivalenum); printf("ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, {index=%u" ", pixel_format=v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')" @@ -536,7 +950,7 @@ main(void ) printf("ioctl(-1, VIDIOC_CREATE_BUFS, NULL) = -1 EBADF (%m)\n"); struct v4l2_create_buffers *const p_v4l2_create_buffers = - page + size - sizeof(*p_v4l2_create_buffers); + page_end - sizeof(*p_v4l2_create_buffers); ioctl(-1, VIDIOC_CREATE_BUFS, p_v4l2_create_buffers); printf("ioctl(-1, VIDIOC_CREATE_BUFS, {count=%u, memory=%#x" " /* V4L2_MEMORY_??? */, format={type=%#x" diff --git a/tests-m32/ioctl_v4l2.gen.test b/tests-m32/ioctl_v4l2.gen.test new file mode 100755 index 00000000..4c571447 --- /dev/null +++ b/tests-m32/ioctl_v4l2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_v4l2 +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioctl_v4l2.test b/tests-m32/ioctl_v4l2.test deleted file mode 100755 index a092a3cd..00000000 --- a/tests-m32/ioctl_v4l2.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check basic VIDIOC_* ioctl decoding. - -. "${srcdir=.}/ioctl.test" diff --git a/tests-m32/ioperm.c b/tests-m32/ioperm.c index 2f02b523..3f99b2db 100644 --- a/tests-m32/ioperm.c +++ b/tests-m32/ioperm.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/ioperm.gen.test b/tests-m32/ioperm.gen.test new file mode 100755 index 00000000..bc69f69e --- /dev/null +++ b/tests-m32/ioperm.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioperm -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-m32/ioperm.test b/tests-m32/ioperm.test deleted file mode 100755 index 8c1c1cc7..00000000 --- a/tests-m32/ioperm.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check ioperm syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests-m32/iopl.c b/tests-m32/iopl.c index 14ec29e3..f8904030 100644 --- a/tests-m32/iopl.c +++ b/tests-m32/iopl.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/iopl.gen.test b/tests-m32/iopl.gen.test new file mode 100755 index 00000000..f7769d23 --- /dev/null +++ b/tests-m32/iopl.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (iopl -a8 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 diff --git a/tests-m32/iopl.test b/tests-m32/iopl.test deleted file mode 100755 index d0b5b113..00000000 --- a/tests-m32/iopl.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check iopl syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a8 diff --git a/tests-m32/ioprio-Xabbrev.c b/tests-m32/ioprio-Xabbrev.c new file mode 100644 index 00000000..01a07f48 --- /dev/null +++ b/tests-m32/ioprio-Xabbrev.c @@ -0,0 +1 @@ +#include "ioprio.c" diff --git a/tests-m32/ioprio-Xabbrev.gen.test b/tests-m32/ioprio-Xabbrev.gen.test new file mode 100755 index 00000000..156c048b --- /dev/null +++ b/tests-m32/ioprio-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioprio-Xabbrev -a18 -e trace=ioprio_get,ioprio_set -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 -e trace=ioprio_get,ioprio_set -Xabbrev diff --git a/tests-m32/ioprio-Xraw.c b/tests-m32/ioprio-Xraw.c new file mode 100644 index 00000000..6a815069 --- /dev/null +++ b/tests-m32/ioprio-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "ioprio.c" diff --git a/tests-m32/ioprio-Xraw.gen.test b/tests-m32/ioprio-Xraw.gen.test new file mode 100755 index 00000000..92c614e5 --- /dev/null +++ b/tests-m32/ioprio-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioprio-Xraw -a18 -e trace=ioprio_get,ioprio_set -Xraw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 -e trace=ioprio_get,ioprio_set -Xraw diff --git a/tests-m32/ioprio-Xverbose.c b/tests-m32/ioprio-Xverbose.c new file mode 100644 index 00000000..3c12bb6c --- /dev/null +++ b/tests-m32/ioprio-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "ioprio.c" diff --git a/tests-m32/ioprio-Xverbose.gen.test b/tests-m32/ioprio-Xverbose.gen.test new file mode 100755 index 00000000..97e6154b --- /dev/null +++ b/tests-m32/ioprio-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioprio-Xverbose -a18 -e trace=ioprio_get,ioprio_set -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 -e trace=ioprio_get,ioprio_set -Xverbose diff --git a/tests-m32/ioprio.c b/tests-m32/ioprio.c index 44ace6c3..65775963 100644 --- a/tests-m32/ioprio.c +++ b/tests-m32/ioprio.c @@ -2,29 +2,10 @@ * Check decoding of ioprio_get and ioprio_set syscalls. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -46,14 +27,6 @@ enum { # include "xlat.h" # include "xlat/ioprio_class.h" -void -print_ioprio(unsigned long val) -{ - printf(" (IOPRIO_PRIO_VALUE("); - printxval(ioprio_class, val >> 13, "IOPRIO_CLASS_???"); - printf(", %d))", (int) (val & 0x1fff)); -} - int main(void) { @@ -63,32 +36,78 @@ main(void) (kernel_ulong_t) 0xbadc0dedda7a1057ULL; static const kernel_ulong_t bogus_ioprio = (kernel_ulong_t) 0xdec0ded1facefeedULL; +# if !XLAT_RAW static const char * const bogus_ioprio_str = "IOPRIO_PRIO_VALUE(0x7d677 /* IOPRIO_CLASS_??? */, 7917)"; +# endif long rc; + const char *errstr; rc = syscall(__NR_ioprio_get, bogus_which, bogus_who); + errstr = sprintrc(rc); +# if XLAT_RAW + printf("ioprio_get(%#x, %d) = %s\n", + (int) bogus_which, (int) bogus_who, errstr); +# else /* XLAT_ABBREV || XLAT_VERBOSE */ printf("ioprio_get(%#x /* IOPRIO_WHO_??? */, %d) = %s\n", - (int) bogus_which, (int) bogus_who, sprintrc(rc)); + (int) bogus_which, (int) bogus_who, errstr); +# endif rc = syscall(__NR_ioprio_get, 1, 0); - printf("ioprio_get(IOPRIO_WHO_PROCESS, 0) = %s", sprintrc(rc)); - - if (rc >= -1) - print_ioprio(rc); - + errstr = sprintrc(rc); +# if XLAT_RAW + printf("ioprio_get(0x1, 0) = %s\n", errstr); +# elif XLAT_VERBOSE + printf("ioprio_get(0x1 /* IOPRIO_WHO_PROCESS */, 0) = %s", errstr); + if (rc >= 0) { + printf(" (IOPRIO_PRIO_VALUE(%u /* ", (unsigned int) rc >> 13); + printxval(ioprio_class, (unsigned int) rc >> 13, + "IOPRIO_CLASS_???"); + printf(" */, %u))", (unsigned int) rc & 0x1fff); + } + puts(""); +# else /* XLAT_ABBREV */ + printf("ioprio_get(IOPRIO_WHO_PROCESS, 0) = %s", errstr); + if (rc >= 0) { + printf(" (IOPRIO_PRIO_VALUE("); + printxval(ioprio_class, (unsigned int) rc >> 13, + "IOPRIO_CLASS_???"); + printf(", %u))", (unsigned int) rc & 0x1fff); + } puts(""); +# endif rc = syscall(__NR_ioprio_set, 2, 0, 8191); - printf("ioprio_set(IOPRIO_WHO_PGRP, 0, " - "IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 8191)) = %s\n", - sprintrc(rc)); + errstr = sprintrc(rc); +# if XLAT_RAW + printf("ioprio_set(%#x, 0, 8191) = %s\n", 2, errstr); +# elif XLAT_VERBOSE + printf("ioprio_set(%#x /* IOPRIO_WHO_PGRP */, 0, 8191" + " /* IOPRIO_PRIO_VALUE(0 /* IOPRIO_CLASS_NONE */, 8191) */)" + " = %s\n", + 2, errstr); +# else /* XLAT_ABBREV */ + printf("ioprio_set(IOPRIO_WHO_PGRP, 0" + ", IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 8191)) = %s\n", + errstr); +# endif rc = syscall(__NR_ioprio_set, bogus_which, bogus_who, bogus_ioprio); + errstr = sprintrc(rc); +# if XLAT_RAW + printf("ioprio_set(%#x, %d, %d) = %s\n", + (int) bogus_which, (int) bogus_who, (int) bogus_ioprio, + errstr); +# elif XLAT_VERBOSE + printf("ioprio_set(%#x /* IOPRIO_WHO_??? */, %d, %d /* %s */) = %s\n", + (int) bogus_which, (int) bogus_who, (int) bogus_ioprio, + bogus_ioprio_str, errstr); +# else /* XLAT_ABBREV */ printf("ioprio_set(%#x /* IOPRIO_WHO_??? */, %d, %s) = %s\n", (int) bogus_which, (int) bogus_who, bogus_ioprio_str, - sprintrc(rc)); + errstr); +# endif puts("+++ exited with 0 +++"); diff --git a/tests-m32/ioprio.gen.test b/tests-m32/ioprio.gen.test new file mode 100755 index 00000000..f43f78ed --- /dev/null +++ b/tests-m32/ioprio.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioprio -a18 -e trace=ioprio_get,ioprio_set); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 -e trace=ioprio_get,ioprio_set diff --git a/tests-m32/ioprio.test b/tests-m32/ioprio.test deleted file mode 100755 index e79310b3..00000000 --- a/tests-m32/ioprio.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check iprio_get and iprio_set syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a18 -e trace=ioprio_get,ioprio_set diff --git a/tests-m32/ip_mreq.c b/tests-m32/ip_mreq.c index fa0c504b..4744bd38 100644 --- a/tests-m32/ip_mreq.c +++ b/tests-m32/ip_mreq.c @@ -1,51 +1,33 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include #if defined IP_ADD_MEMBERSHIP && defined IPV6_ADD_MEMBERSHIP \ - && defined IPV6_JOIN_ANYCAST && defined HAVE_IF_INDEXTONAME + && defined IPV6_JOIN_ANYCAST +# include # include # include # include # include # include +# define multi4addr "224.0.0.3" +# define multi6addr "ff01::c" +# define interface "127.0.0.1" + int main(void) { - static const char multi4addr[] = "224.0.0.3"; - static const char multi6addr[] = "ff01::c"; - static const char interface[] = "127.0.0.1"; - - struct ip_mreq *const m4 = tail_alloc(sizeof(*m4)); - struct ipv6_mreq *const m6 = tail_alloc(sizeof(*m6)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct ip_mreq, m4); + TAIL_ALLOC_OBJECT_CONST_PTR(struct ipv6_mreq, m6); unsigned int i; int rc; @@ -53,7 +35,7 @@ main(void) inet_pton(AF_INET, interface, &m4->imr_interface); inet_pton(AF_INET6, multi6addr, &m6->ipv6mr_multiaddr); - m6->ipv6mr_interface = if_nametoindex("lo"); + m6->ipv6mr_interface = ifindex_lo(); if (!m6->ipv6mr_interface) perror_msg_and_skip("lo"); @@ -62,87 +44,91 @@ main(void) perror_msg_and_skip("socket"); struct { - int level; - const char *str_level; - int optname; - const char *str_optname; - void *optval; - unsigned int optsize; - } short_any[] = { + const int level; + const char *const str_level; + const int name; + const char *str_name; + const void *const val; + unsigned int size; + const char *const addr; + } opts[] = { { ARG_STR(SOL_IP), ARG_STR(IP_ADD_MEMBERSHIP), - m4, sizeof(*m4) + m4, sizeof(*m4), + "{imr_multiaddr=inet_addr(\"" multi4addr + "\"), imr_interface=inet_addr(\"" interface "\")}" }, { ARG_STR(SOL_IP), ARG_STR(IP_DROP_MEMBERSHIP), - m4, sizeof(*m4) + m4, sizeof(*m4), + "{imr_multiaddr=inet_addr(\"" multi4addr + "\"), imr_interface=inet_addr(\"" interface "\")}" }, { ARG_STR(SOL_IPV6), ARG_STR(IPV6_ADD_MEMBERSHIP), - m6, sizeof(*m6) + m6, sizeof(*m6), + "{inet_pton(AF_INET6, \"" multi6addr + "\", &ipv6mr_multiaddr)" + ", ipv6mr_interface=" IFINDEX_LO_STR "}" }, { ARG_STR(SOL_IPV6), ARG_STR(IPV6_DROP_MEMBERSHIP), - m6, sizeof(*m6) + m6, sizeof(*m6), + "{inet_pton(AF_INET6, \"" multi6addr + "\", &ipv6mr_multiaddr)" + ", ipv6mr_interface=" IFINDEX_LO_STR "}" }, { ARG_STR(SOL_IPV6), ARG_STR(IPV6_JOIN_ANYCAST), - m6, sizeof(*m6) + m6, sizeof(*m6), + "{inet_pton(AF_INET6, \"" multi6addr + "\", &ipv6mr_multiaddr)" + ", ipv6mr_interface=" IFINDEX_LO_STR "}" }, { ARG_STR(SOL_IPV6), ARG_STR(IPV6_LEAVE_ANYCAST), - m6, sizeof(*m6) + m6, sizeof(*m6), + "{inet_pton(AF_INET6, \"" multi6addr + "\", &ipv6mr_multiaddr)" + ", ipv6mr_interface=" IFINDEX_LO_STR "}" } }; - for (i = 0; i < ARRAY_SIZE(short_any); ++i) { - rc = setsockopt(0, short_any[i].level, short_any[i].optname, - short_any[i].optval, 1); - printf("setsockopt(0, %s, %s, \"\\%hho\", 1) = %s\n", - short_any[i].str_level, short_any[i].str_optname, - * (unsigned char *) short_any[i].optval, - sprintrc(rc)); - - rc = setsockopt(0, short_any[i].level, short_any[i].optname, - short_any[i].optval + 1, short_any[i].optsize); + for (i = 0; i < ARRAY_SIZE(opts); ++i) { + /* optlen < 0, EINVAL */ + rc = setsockopt(0, opts[i].level, opts[i].name, + opts[i].val, -1); + printf("setsockopt(0, %s, %s, %p, -1) = %s\n", + opts[i].str_level, opts[i].str_name, + opts[i].val, sprintrc(rc)); + + /* optlen < sizeof(struct), EINVAL */ + rc = setsockopt(0, opts[i].level, opts[i].name, + opts[i].val, opts[i].size - 1); printf("setsockopt(0, %s, %s, %p, %u) = %s\n", - short_any[i].str_level, short_any[i].str_optname, - short_any[i].optval + 1, short_any[i].optsize, - sprintrc(rc)); - } + opts[i].str_level, opts[i].str_name, + opts[i].val, opts[i].size - 1, sprintrc(rc)); - struct { - int optname; - const char *str_optname; - } long_ip[] = { - { ARG_STR(IP_ADD_MEMBERSHIP) }, - { ARG_STR(IP_DROP_MEMBERSHIP) } - }, long_ipv6[] = { - { ARG_STR(IPV6_ADD_MEMBERSHIP) }, - { ARG_STR(IPV6_DROP_MEMBERSHIP) }, - { ARG_STR(IPV6_JOIN_ANYCAST) }, - { ARG_STR(IPV6_LEAVE_ANYCAST) } - }; - - for (i = 0; i < ARRAY_SIZE(long_ip); ++i) { - rc = setsockopt(0, SOL_IP, long_ip[i].optname, - m4, sizeof(*m4)); - printf("setsockopt(0, SOL_IP, %s" - ", {imr_multiaddr=inet_addr(\"%s\")" - ", imr_interface=inet_addr(\"%s\")}, %u) = %s\n", - long_ip[i].str_optname, multi4addr, - interface, (unsigned) sizeof(*m4), sprintrc(rc)); - } - - for (i = 0; i < ARRAY_SIZE(long_ipv6); ++i) { - rc = setsockopt(0, SOL_IPV6, long_ipv6[i].optname, - m6, sizeof(*m6)); - printf("setsockopt(0, SOL_IPV6, %s" - ", {ipv6mr_multiaddr=inet_pton(\"%s\")" - ", ipv6mr_interface=if_nametoindex(\"lo\")}" - ", %u) = %s\n", - long_ipv6[i].str_optname, multi6addr, - (unsigned) sizeof(*m6), sprintrc(rc)); + /* optval EFAULT */ + rc = setsockopt(0, opts[i].level, opts[i].name, + opts[i].val + 1, opts[i].size); + printf("setsockopt(0, %s, %s, %p, %u) = %s\n", + opts[i].str_level, opts[i].str_name, + opts[i].val + 1, opts[i].size, sprintrc(rc)); + + /* classic */ + rc = setsockopt(0, opts[i].level, opts[i].name, + opts[i].val, opts[i].size); + printf("setsockopt(0, %s, %s, %s, %u) = %s\n", + opts[i].str_level, opts[i].str_name, + opts[i].addr, opts[i].size, sprintrc(rc)); + + /* optlen > sizeof(struct), shortened */ + rc = setsockopt(0, opts[i].level, opts[i].name, + opts[i].val, INT_MAX); + printf("setsockopt(0, %s, %s, %s, %u) = %s\n", + opts[i].str_level, opts[i].str_name, + opts[i].addr, INT_MAX, sprintrc(rc)); } puts("+++ exited with 0 +++"); @@ -152,6 +138,6 @@ main(void) #else SKIP_MAIN_UNDEFINED("IP_ADD_MEMBERSHIP && IPV6_ADD_MEMBERSHIP" - " && IPV6_JOIN_ANYCAST && HAVE_IF_INDEXTONAME") + " && IPV6_JOIN_ANYCAST") #endif diff --git a/tests-m32/ip_mreq.gen.test b/tests-m32/ip_mreq.gen.test new file mode 100755 index 00000000..990387a6 --- /dev/null +++ b/tests-m32/ip_mreq.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ip_mreq -e trace=setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt diff --git a/tests-m32/ip_mreq.test b/tests-m32/ip_mreq.test deleted file mode 100755 index d0a9e0f1..00000000 --- a/tests-m32/ip_mreq.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check {IP,IPV6}_{ADD,DROP}_MEMBERSHIP setsockopt decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=setsockopt diff --git a/tests-m32/ipc.c b/tests-m32/ipc.c index c64d3716..5c86f207 100644 --- a/tests-m32/ipc.c +++ b/tests-m32/ipc.c @@ -1,30 +1,10 @@ /* * Check decoding of ipc syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/ipc.gen.test b/tests-m32/ipc.gen.test new file mode 100755 index 00000000..0aa75789 --- /dev/null +++ b/tests-m32/ipc.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc -a19 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests-m32/ipc.sh b/tests-m32/ipc.sh index 752d4bb2..58e4309b 100644 --- a/tests-m32/ipc.sh +++ b/tests-m32/ipc.sh @@ -1,13 +1,16 @@ #!/bin/sh - +# # Check decoding of ipc syscalls +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog > /dev/null -run_strace -eipc $args > "$OUT" -match_grep "$LOG" "$OUT" - -rm -f "$OUT" +run_strace -eipc "$@" $args > "$EXP" +match_grep "$LOG" "$EXP" exit 0 diff --git a/tests-m32/ipc.test b/tests-m32/ipc.test deleted file mode 100755 index aa33fa61..00000000 --- a/tests-m32/ipc.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of ipc syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a19 diff --git a/tests-m32/ipc_msg-Xabbrev.c b/tests-m32/ipc_msg-Xabbrev.c new file mode 100644 index 00000000..f4535e8b --- /dev/null +++ b/tests-m32/ipc_msg-Xabbrev.c @@ -0,0 +1 @@ +#include "ipc_msg.c" diff --git a/tests-m32/ipc_msg-Xabbrev.gen.test b/tests-m32/ipc_msg-Xabbrev.gen.test new file mode 100755 index 00000000..0969ee1e --- /dev/null +++ b/tests-m32/ipc_msg-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_msg-Xabbrev +ipc.sh -Xabbrev -a26); do not edit. +set -- -Xabbrev -a26 +. "${srcdir=.}/ipc.sh" diff --git a/tests-m32/ipc_msg-Xraw.c b/tests-m32/ipc_msg-Xraw.c new file mode 100644 index 00000000..9c016d30 --- /dev/null +++ b/tests-m32/ipc_msg-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "ipc_msg.c" diff --git a/tests-m32/ipc_msg-Xraw.gen.test b/tests-m32/ipc_msg-Xraw.gen.test new file mode 100755 index 00000000..5d5d7322 --- /dev/null +++ b/tests-m32/ipc_msg-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_msg-Xraw +ipc.sh -Xraw -a16); do not edit. +set -- -Xraw -a16 +. "${srcdir=.}/ipc.sh" diff --git a/tests-m32/ipc_msg-Xverbose.c b/tests-m32/ipc_msg-Xverbose.c new file mode 100644 index 00000000..3f59f984 --- /dev/null +++ b/tests-m32/ipc_msg-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "ipc_msg.c" diff --git a/tests-m32/ipc_msg-Xverbose.gen.test b/tests-m32/ipc_msg-Xverbose.gen.test new file mode 100755 index 00000000..88c79a00 --- /dev/null +++ b/tests-m32/ipc_msg-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_msg-Xverbose +ipc.sh -Xverbose -a34); do not edit. +set -- -Xverbose -a34 +. "${srcdir=.}/ipc.sh" diff --git a/tests-m32/ipc_msg.c b/tests-m32/ipc_msg.c index b4938439..b12f4af3 100644 --- a/tests-m32/ipc_msg.c +++ b/tests-m32/ipc_msg.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2015 Elvira Khabirova * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -35,6 +16,10 @@ #include "xlat.h" #include "xlat/resource_flags.h" +#ifndef MSG_STAT_ANY +# define MSG_STAT_ANY 13 +#endif + /* * Before glibc-2.22-122-gbe48165, ppc64 code tried to retrieve data * provided in third argument of msgctl call (in case of IPC_SET cmd) @@ -52,13 +37,50 @@ # define TEST_MSGCTL_BOGUS_ADDR 1 #endif +#if XLAT_RAW +# define str_ipc_excl_nowait "0xface1c00" +# define str_ipc_private "0" +# define str_ipc_rmid "0" +# define str_ipc_set "0x1" +# define str_ipc_stat "0x2" +# define str_msg_stat "0xb" +# define str_msg_info "0xc" +# define str_msg_stat_any "0xd" +# define str_ipc_64 "0x100" +# define str_bogus_cmd "0xdeadbeef" +#elif XLAT_VERBOSE +# define str_ipc_excl_nowait \ + "0xface1c00 /\\* IPC_EXCL\\|IPC_NOWAIT\\|0xface1000 \\*/" +# define str_ipc_private "0 /\\* IPC_PRIVATE \\*/" +# define str_ipc_rmid "0 /\\* IPC_RMID \\*/" +# define str_ipc_set "0x1 /\\* IPC_SET \\*/" +# define str_ipc_stat "0x2 /\\* IPC_STAT \\*/" +# define str_msg_stat "0xb /\\* MSG_STAT \\*/" +# define str_msg_info "0xc /\\* MSG_INFO \\*/" +# define str_msg_stat_any "0xd /\\* MSG_STAT_ANY \\*/" +# define str_ipc_64 "0x100 /\\* IPC_64 \\*/" +# define str_bogus_cmd "0xdeadbeef /\\* MSG_\\?\\?\\? \\*/" +#else +# define str_ipc_excl_nowait "IPC_EXCL\\|IPC_NOWAIT\\|0xface1000" +# define str_ipc_private "IPC_PRIVATE" +# define str_ipc_rmid "IPC_RMID" +# define str_ipc_set "IPC_SET" +# define str_ipc_stat "IPC_STAT" +# define str_msg_stat "MSG_STAT" +# define str_msg_info "MSG_INFO" +# define str_msg_stat_any "MSG_STAT_ANY" +# define str_ipc_64 "IPC_64" +# define str_bogus_cmd "0xdeadbeef /\\* MSG_\\?\\?\\? \\*/" +#endif + static int id = -1; static void cleanup(void) { msgctl(id, IPC_RMID, NULL); - printf("msgctl\\(%d, (IPC_64\\|)?IPC_RMID, NULL\\) += 0\n", id); + printf("msgctl\\(%d, (%s\\|)?%s, NULL\\) += 0\n", + id, str_ipc_64, str_ipc_rmid); id = -1; } @@ -67,7 +89,7 @@ main(void) { static const key_t private_key = (key_t) (0xffffffff00000000ULL | IPC_PRIVATE); - static const key_t bogus_key = (key_t) 0xeca86420fdb97531ULL; + static const key_t bogus_key = (key_t) 0xeca86420fdb9f531ULL; static const int bogus_msgid = 0xfdb97531; static const int bogus_cmd = 0xdeadbeef; #if TEST_MSGCTL_BOGUS_ADDR @@ -79,37 +101,36 @@ main(void) struct msqid_ds ds; rc = msgget(bogus_key, bogus_flags); - printf("msgget\\(%#llx, %s%s%s%#x\\|%#04o\\) += %s\n", + printf("msgget\\(%#llx, %s\\|%#04o\\) = %s\n", zero_extend_signed_to_ull(bogus_key), - IPC_CREAT & bogus_flags ? "IPC_CREAT\\|" : "", - IPC_EXCL & bogus_flags ? "IPC_EXCL\\|" : "", - IPC_NOWAIT & bogus_flags ? "IPC_NOWAIT\\|" : "", - bogus_flags & ~(0777 | IPC_CREAT | IPC_EXCL | IPC_NOWAIT), + str_ipc_excl_nowait, bogus_flags & 0777, sprintrc_grep(rc)); id = msgget(private_key, 0600); if (id < 0) perror_msg_and_skip("msgget"); - printf("msgget\\(IPC_PRIVATE, 0600\\) += %d\n", id); + printf("msgget\\(%s, 0600\\) = %d\n", str_ipc_private, id); atexit(cleanup); rc = msgctl(bogus_msgid, bogus_cmd, NULL); - printf("msgctl\\(%d, (IPC_64\\|)?%#x /\\* MSG_\\?\\?\\? \\*/, NULL\\)" - " += %s\n", bogus_msgid, bogus_cmd, sprintrc_grep(rc)); + printf("msgctl\\(%d, (%s\\|)?%s, NULL\\) = %s\n", + bogus_msgid, str_ipc_64, str_bogus_cmd, sprintrc_grep(rc)); #if TEST_MSGCTL_BOGUS_ADDR rc = msgctl(bogus_msgid, IPC_SET, bogus_addr); - printf("msgctl\\(%d, (IPC_64\\|)?IPC_SET, %p\\) += %s\n", - bogus_msgid, bogus_addr, sprintrc_grep(rc)); + printf("msgctl\\(%d, (%s\\|)?%s, %p\\) = %s\n", + bogus_msgid, str_ipc_64, str_ipc_set, bogus_addr, + sprintrc_grep(rc)); #endif if (msgctl(id, IPC_STAT, &ds)) perror_msg_and_skip("msgctl IPC_STAT"); - printf("msgctl\\(%d, (IPC_64\\|)?IPC_STAT, \\{msg_perm=\\{uid=%u" + printf("msgctl\\(%d, (%s\\|)?%s, \\{msg_perm=\\{uid=%u" ", gid=%u, mode=%#o, key=%u, cuid=%u, cgid=%u\\}, msg_stime=%u" ", msg_rtime=%u, msg_ctime=%u, msg_qnum=%u, msg_qbytes=%u" - ", msg_lspid=%u, msg_lrpid=%u\\}\\) += 0\n", - id, (unsigned) ds.msg_perm.uid, (unsigned) ds.msg_perm.gid, + ", msg_lspid=%u, msg_lrpid=%u\\}\\) = 0\n", + id, str_ipc_64, str_ipc_stat, + (unsigned) ds.msg_perm.uid, (unsigned) ds.msg_perm.gid, (unsigned) ds.msg_perm.mode, (unsigned) ds.msg_perm.__key, (unsigned) ds.msg_perm.cuid, (unsigned) ds.msg_perm.cgid, (unsigned) ds.msg_stime, (unsigned) ds.msg_rtime, @@ -119,18 +140,22 @@ main(void) if (msgctl(id, IPC_SET, &ds)) perror_msg_and_skip("msgctl IPC_SET"); - printf("msgctl\\(%d, (IPC_64\\|)?IPC_SET, \\{msg_perm=\\{uid=%u" - ", gid=%u, mode=%#o\\}, ...\\}\\) += 0\n", - id, (unsigned) ds.msg_perm.uid, (unsigned) ds.msg_perm.gid, - (unsigned) ds.msg_perm.mode); + printf("msgctl\\(%d, (%s\\|)?%s, \\{msg_perm=\\{uid=%u" + ", gid=%u, mode=%#o\\}, ...\\}\\) = 0\n", + id, str_ipc_64, str_ipc_set, (unsigned) ds.msg_perm.uid, + (unsigned) ds.msg_perm.gid, (unsigned) ds.msg_perm.mode); rc = msgctl(0, MSG_INFO, &ds); - printf("msgctl\\(0, (IPC_64\\|)?MSG_INFO, %p\\) += %s\n", - &ds, sprintrc_grep(rc)); + printf("msgctl\\(0, (%s\\|)?%s, %p\\) = %s\n", + str_ipc_64, str_msg_info, &ds, sprintrc_grep(rc)); rc = msgctl(id, MSG_STAT, &ds); - printf("msgctl\\(%d, (IPC_64\\|)?MSG_STAT, %p\\) += %s\n", - id, &ds, sprintrc_grep(rc)); + printf("msgctl\\(%d, (%s\\|)?%s, %p\\) = %s\n", + id, str_ipc_64, str_msg_stat, &ds, sprintrc_grep(rc)); + + rc = msgctl(id, MSG_STAT_ANY, &ds); + printf("msgctl\\(%d, (%s\\|)?%s, %p\\) = %s\n", + id, str_ipc_64, str_msg_stat_any, &ds, sprintrc_grep(rc)); return 0; } diff --git a/tests-m32/ipc_msg.gen.test b/tests-m32/ipc_msg.gen.test new file mode 100755 index 00000000..82026198 --- /dev/null +++ b/tests-m32/ipc_msg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_msg +ipc.sh -a26); do not edit. +set -- -a26 +. "${srcdir=.}/ipc.sh" diff --git a/tests-m32/ipc_msg.test b/tests-m32/ipc_msg.test deleted file mode 100755 index 177495b0..00000000 --- a/tests-m32/ipc_msg.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of ipc msgget/msgctl syscalls - -. "${srcdir=.}/ipc.sh" diff --git a/tests-m32/ipc_msgbuf-Xabbrev.c b/tests-m32/ipc_msgbuf-Xabbrev.c new file mode 100644 index 00000000..e2f09eb1 --- /dev/null +++ b/tests-m32/ipc_msgbuf-Xabbrev.c @@ -0,0 +1 @@ +#include "ipc_msgbuf.c" diff --git a/tests-m32/ipc_msgbuf-Xabbrev.gen.test b/tests-m32/ipc_msgbuf-Xabbrev.gen.test new file mode 100755 index 00000000..402d804e --- /dev/null +++ b/tests-m32/ipc_msgbuf-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_msgbuf-Xabbrev +ipc_msgbuf.test -Xabbrev); do not edit. +set -- -Xabbrev +. "${srcdir=.}/ipc_msgbuf.test" diff --git a/tests-m32/ipc_msgbuf-Xraw.c b/tests-m32/ipc_msgbuf-Xraw.c new file mode 100644 index 00000000..c6f8a31b --- /dev/null +++ b/tests-m32/ipc_msgbuf-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "ipc_msgbuf.c" diff --git a/tests-m32/ipc_msgbuf-Xraw.gen.test b/tests-m32/ipc_msgbuf-Xraw.gen.test new file mode 100755 index 00000000..c1112cb6 --- /dev/null +++ b/tests-m32/ipc_msgbuf-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_msgbuf-Xraw +ipc_msgbuf.test -Xraw -a22); do not edit. +set -- -Xraw -a22 +. "${srcdir=.}/ipc_msgbuf.test" diff --git a/tests-m32/ipc_msgbuf-Xverbose.c b/tests-m32/ipc_msgbuf-Xverbose.c new file mode 100644 index 00000000..ae09a4ad --- /dev/null +++ b/tests-m32/ipc_msgbuf-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "ipc_msgbuf.c" diff --git a/tests-m32/ipc_msgbuf-Xverbose.gen.test b/tests-m32/ipc_msgbuf-Xverbose.gen.test new file mode 100755 index 00000000..2c72eb71 --- /dev/null +++ b/tests-m32/ipc_msgbuf-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_msgbuf-Xverbose +ipc_msgbuf.test -Xverbose); do not edit. +set -- -Xverbose +. "${srcdir=.}/ipc_msgbuf.test" diff --git a/tests-m32/ipc_msgbuf.c b/tests-m32/ipc_msgbuf.c index 1c34494d..92525f94 100644 --- a/tests-m32/ipc_msgbuf.c +++ b/tests-m32/ipc_msgbuf.c @@ -1,33 +1,17 @@ /* * Copyright (c) 2015 Elvira Khabirova * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" +#include #include +#include +#include #include #include #include @@ -37,17 +21,54 @@ static int msqid = -1; -static void +#if XLAT_RAW +# define str_ipc_creat "0x200" +# define str_ipc_private "0" +# define str_ipc_rmid "0" +# define str_ipc_64 "0x100" +#elif XLAT_VERBOSE +# define str_ipc_creat "0x200 /\\* IPC_CREAT \\*/" +# define str_ipc_private "0 /\\* IPC_PRIVATE \\*/" +# define str_ipc_rmid "0 /\\* IPC_RMID \\*/" +# define str_ipc_64 "0x100 /\\* IPC_64 \\*/" +#else +# define str_ipc_creat "IPC_CREAT" +# define str_ipc_private "IPC_PRIVATE" +# define str_ipc_rmid "IPC_RMID" +# define str_ipc_64 "IPC_64" +#endif + +static int cleanup(void) { - msgctl(msqid, IPC_RMID, 0); - msqid = -1; + if (msqid != -1) { + int rc = msgctl(msqid, IPC_RMID, 0); + printf("msgctl\\(%d, (%s\\|)?%s, NULL\\) = 0\n", + msqid, str_ipc_64, str_ipc_rmid); + msqid = -1; + if (rc == -1) + return 77; + puts("\\+\\+\\+ exited with 0 \\+\\+\\+"); + } + return 0; +} + +int +sys_msgrcv(int msqid, void *msgp, size_t sz, kernel_long_t msgtyp, + int msgflg) +{ +#if defined __x86_64__ && defined __ILP32__ + return syscall(__NR_msgrcv, msqid, msgp, sz, msgtyp, msgflg); +#else + return msgrcv(msqid, msgp, sz, msgtyp, msgflg); +#endif } int -main (void) +main(void) { - const long mtype = 0xdefaced; + /* mtype has to be positive */ + const kernel_long_t mtype = (kernel_long_t) 0x7facefed5adc0dedULL; struct { kernel_long_t mtype; char mtext[msgsz]; @@ -58,10 +79,23 @@ main (void) msqid = msgget(IPC_PRIVATE, IPC_CREAT | S_IRWXU); if (msqid == -1) perror_msg_and_skip("msgget"); - atexit(cleanup); + printf("msgget\\(%s, %s\\|0700\\) = %d\n", + str_ipc_private, str_ipc_creat, msqid); + + typedef void (*atexit_func)(void); + atexit((atexit_func) cleanup); + + printf("msgsnd\\(%d, \\{%lld, \"" text_string "\\\\0\"\\}, 14, 0\\)" + " = 0\n", + msqid, (long long) mtype); if (msgsnd(msqid, &msg, msgsz, 0) == -1) perror_msg_and_skip("msgsnd"); - if (msgrcv(msqid, &msg, msgsz, mtype, 0) != msgsz) + + if (sys_msgrcv(msqid, &msg, msgsz, -mtype, 0) != msgsz) perror_msg_and_skip("msgrcv"); - return 0; + printf("msgrcv\\(%d, \\{%lld, \"" text_string "\\\\0\"\\}, 14, %lld" + ", 0\\) = 14\n", + msqid, (long long) mtype, -(long long) mtype); + + return cleanup(); } diff --git a/tests-m32/ipc_msgbuf.expected b/tests-m32/ipc_msgbuf.expected deleted file mode 100644 index 880424bf..00000000 --- a/tests-m32/ipc_msgbuf.expected +++ /dev/null @@ -1,4 +0,0 @@ -msgget\(IPC_PRIVATE, IPC_CREAT\|0700\) += [0-9]* -msgsnd\([0-9]*, \{233811181, "STRACE_STRING\\0"\}, 14, 0\) += 0 -msgrcv\([0-9]*, \{233811181, "STRACE_STRING\\0"\}, 14, 233811181, 0\) += 14 -msgctl\([0-9]*, (IPC_64\|)?IPC_RMID, NULL\) += 0 diff --git a/tests-m32/ipc_msgbuf.test b/tests-m32/ipc_msgbuf.test index d0b65d1a..4e26578a 100755 --- a/tests-m32/ipc_msgbuf.test +++ b/tests-m32/ipc_msgbuf.test @@ -1,11 +1,16 @@ #!/bin/sh - +# # Check msgget, msgsnd, msgrcv, msgctl syscalls decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog -run_strace -v -e msgget,msgsnd,msgrcv,msgctl $args -match_grep +run_strace -a26 -v -e msgget,msgsnd,msgrcv,msgctl "$@" $args > "$EXP" +match_grep "$LOG" "$EXP" exit 0 diff --git a/tests-m32/ipc_sem-Xabbrev.c b/tests-m32/ipc_sem-Xabbrev.c new file mode 100644 index 00000000..727005ad --- /dev/null +++ b/tests-m32/ipc_sem-Xabbrev.c @@ -0,0 +1 @@ +#include "ipc_sem.c" diff --git a/tests-m32/ipc_sem-Xabbrev.gen.test b/tests-m32/ipc_sem-Xabbrev.gen.test new file mode 100755 index 00000000..0757a48b --- /dev/null +++ b/tests-m32/ipc_sem-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_sem-Xabbrev +ipc.sh -Xabbrev -a29); do not edit. +set -- -Xabbrev -a29 +. "${srcdir=.}/ipc.sh" diff --git a/tests-m32/ipc_sem-Xraw.c b/tests-m32/ipc_sem-Xraw.c new file mode 100644 index 00000000..0a57c0ac --- /dev/null +++ b/tests-m32/ipc_sem-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "ipc_sem.c" diff --git a/tests-m32/ipc_sem-Xraw.gen.test b/tests-m32/ipc_sem-Xraw.gen.test new file mode 100755 index 00000000..07d59e51 --- /dev/null +++ b/tests-m32/ipc_sem-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_sem-Xraw +ipc.sh -Xraw -a19); do not edit. +set -- -Xraw -a19 +. "${srcdir=.}/ipc.sh" diff --git a/tests-m32/ipc_sem-Xverbose.c b/tests-m32/ipc_sem-Xverbose.c new file mode 100644 index 00000000..56e83806 --- /dev/null +++ b/tests-m32/ipc_sem-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "ipc_sem.c" diff --git a/tests-m32/ipc_sem-Xverbose.gen.test b/tests-m32/ipc_sem-Xverbose.gen.test new file mode 100755 index 00000000..43a61d08 --- /dev/null +++ b/tests-m32/ipc_sem-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_sem-Xverbose +ipc.sh -Xverbose -a36); do not edit. +set -- -Xverbose -a36 +. "${srcdir=.}/ipc.sh" diff --git a/tests-m32/ipc_sem.c b/tests-m32/ipc_sem.c index 8f6382cc..7341f728 100644 --- a/tests-m32/ipc_sem.c +++ b/tests-m32/ipc_sem.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2015 Andreas Schwab * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -35,11 +16,48 @@ #include "xlat.h" #include "xlat/resource_flags.h" +#ifndef SEM_STAT_ANY +# define SEM_STAT_ANY 20 +#endif + +#if XLAT_RAW +# define str_ipc_flags "0xface1e00" +# define str_ipc_private "0" +# define str_ipc_rmid "0" +# define str_ipc_stat "0x2" +# define str_sem_stat "0x12" +# define str_sem_info "0x13" +# define str_sem_stat_any "0x14" +# define str_ipc_64 "0x100" +# define str_bogus_cmd "0xdeadbeef" +#elif XLAT_VERBOSE +# define str_ipc_flags \ + "0xface1e00 /\\* IPC_CREAT\\|IPC_EXCL\\|IPC_NOWAIT\\|0xface1000 \\*/" +# define str_ipc_private "0 /\\* IPC_PRIVATE \\*/" +# define str_ipc_rmid "0 /\\* IPC_RMID \\*/" +# define str_ipc_stat "0x2 /\\* IPC_STAT \\*/" +# define str_sem_stat "0x12 /\\* SEM_STAT \\*/" +# define str_sem_info "0x13 /\\* SEM_INFO \\*/" +# define str_sem_stat_any "0x14 /\\* SEM_STAT_ANY \\*/" +# define str_ipc_64 "0x100 /\\* IPC_64 \\*/" +# define str_bogus_cmd "0xdeadbeef /\\* SEM_\\?\\?\\? \\*/" +#else +# define str_ipc_flags "IPC_CREAT\\|IPC_EXCL\\|IPC_NOWAIT\\|0xface1000" +# define str_ipc_private "IPC_PRIVATE" +# define str_ipc_rmid "IPC_RMID" +# define str_ipc_stat "IPC_STAT" +# define str_sem_stat "SEM_STAT" +# define str_sem_info "SEM_INFO" +# define str_sem_stat_any "SEM_STAT_ANY" +# define str_ipc_64 "IPC_64" +# define str_bogus_cmd "0xdeadbeef /\\* SEM_\\?\\?\\? \\*/" +#endif + union semun { - int val; /* Value for SETVAL */ - struct semid_ds *buf; /* Buffer for IPC_STAT, IPC_SET */ - unsigned short *array; /* Array for GETALL, SETALL */ - struct seminfo *__buf; /* Buffer for IPC_INFO + int val; /* Value for SETVAL */ + struct semid_ds *buf; /* Buffer for IPC_STAT, IPC_SET */ + unsigned short *array; /* Array for GETALL, SETALL */ + struct seminfo *__buf; /* Buffer for IPC_INFO (Linux-specific) */ }; @@ -49,8 +67,8 @@ static void cleanup(void) { semctl(id, 0, IPC_RMID, 0); - printf("semctl\\(%d, 0, (IPC_64\\|)?IPC_RMID, \\[?NULL\\]?\\) += 0\n", - id); + printf("semctl\\(%d, 0, (%s\\|)?%s, \\[?NULL\\]?\\) = 0\n", + id, str_ipc_64, str_ipc_rmid); id = -1; } @@ -74,42 +92,41 @@ main(void) struct seminfo info; rc = semget(bogus_key, bogus_size, bogus_flags); - printf("semget\\(%#llx, %d, %s%s%s%#x\\|%#04o\\) += %s\n", + printf("semget\\(%#llx, %d, %s\\|%#04o\\) = %s\n", zero_extend_signed_to_ull(bogus_key), bogus_size, - IPC_CREAT & bogus_flags ? "IPC_CREAT\\|" : "", - IPC_EXCL & bogus_flags ? "IPC_EXCL\\|" : "", - IPC_NOWAIT & bogus_flags ? "IPC_NOWAIT\\|" : "", - bogus_flags & ~(0777 | IPC_CREAT | IPC_EXCL | IPC_NOWAIT), - bogus_flags & 0777, sprintrc_grep(rc)); + str_ipc_flags, bogus_flags & 0777, sprintrc_grep(rc)); id = semget(private_key, 1, 0600); if (id < 0) perror_msg_and_skip("semget"); - printf("semget\\(IPC_PRIVATE, 1, 0600\\) += %d\n", id); + printf("semget\\(%s, 1, 0600\\) = %d\n", str_ipc_private, id); atexit(cleanup); rc = semctl(bogus_semid, bogus_semnum, bogus_cmd, bogus_arg); #define SEMCTL_BOGUS_ARG_FMT "(%#lx|\\[(%#lx|NULL)\\]|NULL)" - printf("semctl\\(%d, %d, (IPC_64\\|)?%#x /\\* SEM_\\?\\?\\? \\*/" - ", " SEMCTL_BOGUS_ARG_FMT "\\) += %s\n", - bogus_semid, bogus_semnum, bogus_cmd, + printf("semctl\\(%d, %d, (%s\\|)?%s, " SEMCTL_BOGUS_ARG_FMT "\\) = %s\n", + bogus_semid, bogus_semnum, str_ipc_64, str_bogus_cmd, bogus_arg, bogus_arg, sprintrc_grep(rc)); un.buf = &ds; if (semctl(id, 0, IPC_STAT, un)) perror_msg_and_skip("semctl IPC_STAT"); - printf("semctl\\(%d, 0, (IPC_64\\|)?IPC_STAT, \\[?%p\\]?\\) += 0\n", - id, &ds); + printf("semctl\\(%d, 0, (%s\\|)?%s, \\[?%p\\]?\\) = 0\n", + id, str_ipc_64, str_ipc_stat, &ds); un.__buf = &info; rc = semctl(0, 0, SEM_INFO, un); - printf("semctl\\(0, 0, (IPC_64\\|)?SEM_INFO, \\[?%p\\]?\\) += %s\n", - &info, sprintrc_grep(rc)); + printf("semctl\\(0, 0, (%s\\|)?%s, \\[?%p\\]?\\) = %s\n", + str_ipc_64, str_sem_info, &info, sprintrc_grep(rc)); un.buf = &ds; rc = semctl(id, 0, SEM_STAT, un); - printf("semctl\\(%d, 0, (IPC_64\\|)?SEM_STAT, \\[?%p\\]?\\) += %s\n", - id, &ds, sprintrc_grep(rc)); + printf("semctl\\(%d, 0, (%s\\|)?%s, \\[?%p\\]?\\) = %s\n", + id, str_ipc_64, str_sem_stat, &ds, sprintrc_grep(rc)); + + rc = semctl(id, 0, SEM_STAT_ANY, un); + printf("semctl\\(%d, 0, (%s\\|)?%s, (%p|\\[(%p|NULL)\\]|NULL)\\) = %s\n", + id, str_ipc_64, str_sem_stat_any, &ds, &ds, sprintrc_grep(rc)); return 0; } diff --git a/tests-m32/ipc_sem.gen.test b/tests-m32/ipc_sem.gen.test new file mode 100755 index 00000000..173b3af3 --- /dev/null +++ b/tests-m32/ipc_sem.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_sem +ipc.sh -a29); do not edit. +set -- -a29 +. "${srcdir=.}/ipc.sh" diff --git a/tests-m32/ipc_sem.test b/tests-m32/ipc_sem.test deleted file mode 100755 index cc93d07b..00000000 --- a/tests-m32/ipc_sem.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of ipc semget/semctl syscalls - -. "${srcdir=.}/ipc.sh" diff --git a/tests-m32/ipc_shm-Xabbrev.c b/tests-m32/ipc_shm-Xabbrev.c new file mode 100644 index 00000000..c191aeaa --- /dev/null +++ b/tests-m32/ipc_shm-Xabbrev.c @@ -0,0 +1 @@ +#include "ipc_shm.c" diff --git a/tests-m32/ipc_shm-Xabbrev.gen.test b/tests-m32/ipc_shm-Xabbrev.gen.test new file mode 100755 index 00000000..d68c2462 --- /dev/null +++ b/tests-m32/ipc_shm-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_shm-Xabbrev +ipc.sh -Xabbrev -a29); do not edit. +set -- -Xabbrev -a29 +. "${srcdir=.}/ipc.sh" diff --git a/tests-m32/ipc_shm-Xraw.c b/tests-m32/ipc_shm-Xraw.c new file mode 100644 index 00000000..08e09ac1 --- /dev/null +++ b/tests-m32/ipc_shm-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "ipc_shm.c" diff --git a/tests-m32/ipc_shm-Xraw.gen.test b/tests-m32/ipc_shm-Xraw.gen.test new file mode 100755 index 00000000..071eef67 --- /dev/null +++ b/tests-m32/ipc_shm-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_shm-Xraw +ipc.sh -Xraw -a19); do not edit. +set -- -Xraw -a19 +. "${srcdir=.}/ipc.sh" diff --git a/tests-m32/ipc_shm-Xverbose.c b/tests-m32/ipc_shm-Xverbose.c new file mode 100644 index 00000000..b936785f --- /dev/null +++ b/tests-m32/ipc_shm-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "ipc_shm.c" diff --git a/tests-m32/ipc_shm-Xverbose.gen.test b/tests-m32/ipc_shm-Xverbose.gen.test new file mode 100755 index 00000000..170adeee --- /dev/null +++ b/tests-m32/ipc_shm-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_shm-Xverbose +ipc.sh -Xverbose -a36); do not edit. +set -- -Xverbose -a36 +. "${srcdir=.}/ipc.sh" diff --git a/tests-m32/ipc_shm.c b/tests-m32/ipc_shm.c index 66960ff9..76c19d8d 100644 --- a/tests-m32/ipc_shm.c +++ b/tests-m32/ipc_shm.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2015 Elvira Khabirova * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,16 +13,70 @@ #include #include +#ifndef SHM_HUGE_SHIFT +# define SHM_HUGE_SHIFT 26 +#endif + +#ifndef SHM_HUGE_MASK +# define SHM_HUGE_MASK 0x3f +#endif + +#ifndef SHM_STAT_ANY +# define SHM_STAT_ANY 15 +#endif + #include "xlat.h" #include "xlat/shm_resource_flags.h" +#if XLAT_RAW +# define str_ipc_flags "0x2ce1e00" +# define str_shm_huge "21<<26" +# define str_ipc_private "0" +# define str_ipc_rmid "0" +# define str_ipc_set "0x1" +# define str_ipc_stat "0x2" +# define str_shm_stat "0xd" +# define str_shm_info "0xe" +# define str_shm_stat_any "0xf" +# define str_ipc_64 "0x100" +# define str_bogus_cmd "0xdefaced2" +#elif XLAT_VERBOSE +# define str_ipc_flags \ + "0x2ce1e00 /\\* IPC_CREAT\\|IPC_EXCL\\|SHM_HUGETLB\\|SHM_NORESERVE" \ + "\\|0x2ce0000 \\*/" +# define str_shm_huge "21<<26 /\\* SHM_HUGE_SHIFT \\*/" +# define str_ipc_private "0 /\\* IPC_PRIVATE \\*/" +# define str_ipc_rmid "0 /\\* IPC_RMID \\*/" +# define str_ipc_set "0x1 /\\* IPC_SET \\*/" +# define str_ipc_stat "0x2 /\\* IPC_STAT \\*/" +# define str_shm_stat "0xd /\\* SHM_STAT \\*/" +# define str_shm_info "0xe /\\* SHM_INFO \\*/" +# define str_shm_stat_any "0xf /\\* SHM_STAT_ANY \\*/" +# define str_ipc_64 "0x100 /\\* IPC_64 \\*/" +# define str_bogus_cmd "0xdefaced2 /\\* SHM_\\?\\?\\? \\*/" +#else +# define str_ipc_flags \ + "IPC_CREAT\\|IPC_EXCL\\|SHM_HUGETLB\\|SHM_NORESERVE\\|0x2ce0000" +# define str_shm_huge "21< + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef MIPS + +int +main(void) +{ + __asm__(".set noreorder; li $a0, 0; li $v0, 5058; syscall"); + return 77; +} + +#else + +SKIP_MAIN_UNDEFINED("MIPS") + +#endif diff --git a/tests-m32/kcmp-y.c b/tests-m32/kcmp-y.c new file mode 100644 index 00000000..02ad90e5 --- /dev/null +++ b/tests-m32/kcmp-y.c @@ -0,0 +1,3 @@ +#define VERBOSE_FD 1 + +#include "kcmp.c" diff --git a/tests-m32/kcmp-y.gen.test b/tests-m32/kcmp-y.gen.test new file mode 100755 index 00000000..065db9d0 --- /dev/null +++ b/tests-m32/kcmp-y.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kcmp-y -a22 -y -e trace=kcmp); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -y -e trace=kcmp diff --git a/tests-m32/kcmp.c b/tests-m32/kcmp.c index cb497c9f..4e3433ee 100644 --- a/tests-m32/kcmp.c +++ b/tests-m32/kcmp.c @@ -1,30 +1,11 @@ /* * Check decoding of kcmp syscall. * - * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2017 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -34,15 +15,67 @@ #ifdef __NR_kcmp +# include +# include +# include # include +# include # include -# define KCMP_FILE 0 -# define KCMP_SYSVSEM 6 +# ifndef VERBOSE_FD +# define VERBOSE_FD 0 +# endif + +/* + * We prefer to use system headers in order to catch some possible deviations in + * system's headers from our perception of reality, but happy to include our own + * definitions as well. + */ +# ifdef HAVE_LINUX_KCMP_H +# include +# else +# define KCMP_FILE 0 +# define KCMP_VM 1 +# define KCMP_FILES 2 +# define KCMP_FS 3 +# define KCMP_SIGHAND 4 +# define KCMP_IO 5 +# define KCMP_SYSVSEM 6 +# endif + +/* All other kcmp types have been added atomically */ +# define KCMP_EPOLL_TFD 7 + +# ifndef HAVE_STRUCT_KCMP_EPOLL_SLOT +struct kcmp_epoll_slot { + uint32_t efd; + uint32_t tfd; + uint32_t toff; +}; +# endif + +static const kernel_ulong_t kcmp_max_type = KCMP_EPOLL_TFD; + +static const char null_path[] = "/dev/null"; +static const char zero_path[] = "/dev/zero"; + +# define NULL_FD 23 +# define ZERO_FD 42 +static void +printpidfd(const char *prefix, pid_t pid, unsigned fd) +{ + printf("%s%d", prefix, fd); +} + +/* + * Last argument is optional and is used as follows: + * * When type is KCMP_EPOLL_TFD, it signalises whether idx2 is a valid + * pointer. + */ static void do_kcmp(kernel_ulong_t pid1, kernel_ulong_t pid2, kernel_ulong_t type, - const char *type_str, kernel_ulong_t idx1, kernel_ulong_t idx2) + const char *type_str, kernel_ulong_t idx1, kernel_ulong_t idx2, ...) { long rc; const char *errstr; @@ -57,11 +90,37 @@ do_kcmp(kernel_ulong_t pid1, kernel_ulong_t pid2, kernel_ulong_t type, else printf("%#x /* KCMP_??? */", (int) type); - if (type == KCMP_FILE) - printf(", %u, %u", (unsigned) idx1, (unsigned) idx2); - else if (type > KCMP_SYSVSEM) + if (type == KCMP_FILE) { + printpidfd(", ", pid1, idx1); + printpidfd(", ", pid2, idx2); + } else if (type == KCMP_EPOLL_TFD) { + va_list ap; + int valid_ptr; + + va_start(ap, idx2); + valid_ptr = va_arg(ap, int); + va_end(ap); + + printpidfd(", ", pid1, idx1); + printf(", "); + + if (valid_ptr) { + struct kcmp_epoll_slot *slot = + (struct kcmp_epoll_slot *) (uintptr_t) idx2; + + printpidfd("{efd=", pid2, slot->efd); + printpidfd(", tfd=", pid2, slot->tfd); + printf(", toff=%llu}", (unsigned long long) slot->toff); + } else { + if (idx2) + printf("%#llx", (unsigned long long) idx2); + else + printf("NULL"); + } + } else if (type > kcmp_max_type) { printf(", %#llx, %#llx", (unsigned long long) idx1, (unsigned long long) idx2); + } printf(") = %s\n", errstr); } @@ -79,18 +138,71 @@ main(void) (kernel_ulong_t) 0xdec0ded3dec0ded4ULL; static const kernel_ulong_t bogus_idx2 = (kernel_ulong_t) 0xba5e1e55deadc0deULL; + static const struct kcmp_epoll_slot slot_data[] = { + { 0xdeadc0de, 0xfacef157, 0xbadc0ded }, + { NULL_FD, ZERO_FD, 0 }, + { 0, 0, 0 }, + }; + static kernel_ulong_t ptr_check = + F8ILL_KULONG_SUPPORTED ? F8ILL_KULONG_MASK : 0; + + int fd; + unsigned i; + TAIL_ALLOC_OBJECT_CONST_PTR(struct kcmp_epoll_slot, slot); + + /* Open some files to test printpidfd */ + fd = open(null_path, O_RDONLY); + if (fd < 0) + perror_msg_and_fail("open(\"%s\")", null_path); + if (fd != NULL_FD) { + if (dup2(fd, NULL_FD) < 0) + perror_msg_and_fail("dup2(fd, NULL_FD)"); + close(fd); + } + + fd = open(zero_path, O_RDONLY); + if (fd < 0) + perror_msg_and_fail("open(\"%s\")", zero_path); + if (fd != ZERO_FD) { + if (dup2(fd, ZERO_FD) < 0) + perror_msg_and_fail("dup2(fd, ZERO_FD)"); + close(fd); + } + + close(0); /* Invalid values */ do_kcmp(bogus_pid1, bogus_pid2, bogus_type, NULL, bogus_idx1, bogus_idx2); - do_kcmp(0, 0, KCMP_SYSVSEM + 1, NULL, 0, 0); + do_kcmp(F8ILL_KULONG_MASK, F8ILL_KULONG_MASK, kcmp_max_type + 1, NULL, + 0, 0); /* KCMP_FILE is the only type which has additional args */ do_kcmp(3141592653U, 2718281828U, ARG_STR(KCMP_FILE), bogus_idx1, bogus_idx2); - /* Some type without additional args */ + do_kcmp(-1, -1, ARG_STR(KCMP_FILE), NULL_FD, ZERO_FD); + + /* Types without additional args */ + do_kcmp(-1, -1, ARG_STR(KCMP_VM), bogus_idx1, bogus_idx2); + do_kcmp(-1, -1, ARG_STR(KCMP_FILES), bogus_idx1, bogus_idx2); + do_kcmp(-1, -1, ARG_STR(KCMP_FS), bogus_idx1, bogus_idx2); + do_kcmp(-1, -1, ARG_STR(KCMP_SIGHAND), bogus_idx1, bogus_idx2); + do_kcmp(-1, -1, ARG_STR(KCMP_IO), bogus_idx1, bogus_idx2); do_kcmp(-1, -1, ARG_STR(KCMP_SYSVSEM), bogus_idx1, bogus_idx2); + /* KCMP_EPOLL_TFD checks */ + do_kcmp(-1, -1, ARG_STR(KCMP_EPOLL_TFD), + F8ILL_KULONG_MASK | 2718281828U, ptr_check, 0); + do_kcmp(-1, -1, ARG_STR(KCMP_EPOLL_TFD), + 3141592653U, (uintptr_t) slot + 1, 0); + + for (i = 0; i < ARRAY_SIZE(slot_data); i++) { + memcpy(slot, slot_data + i, sizeof(*slot)); + + do_kcmp(getpid(), getppid(), ARG_STR(KCMP_EPOLL_TFD), NULL_FD, + (uintptr_t) slot, 1); + } + puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/kcmp.gen.test b/tests-m32/kcmp.gen.test new file mode 100755 index 00000000..139e909b --- /dev/null +++ b/tests-m32/kcmp.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kcmp -a22 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests-m32/kcmp.test b/tests-m32/kcmp.test deleted file mode 100755 index d022aeba..00000000 --- a/tests-m32/kcmp.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of kcmp syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests-m32/kern_features-fault.test b/tests-m32/kern_features-fault.test new file mode 100755 index 00000000..a46c839f --- /dev/null +++ b/tests-m32/kern_features-fault.test @@ -0,0 +1,43 @@ +#!/bin/sh +# +# Check decoding of SPARC-specific kern_features syscall. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +run_prog ../kern_features > /dev/null +prog="$args" +fault_args='-a16 -e trace=kern_features -e inject=kern_features:retval=' + +test_run_rval() +{ + local run rval + run="$1"; shift + rval="$1"; shift + + run_strace $fault_args$rval $prog $run > "$EXP" + match_diff "$LOG" "$EXP" +} + +test_run_rval 0 0 +test_run_rval 1 1 +test_run_rval 2 2 +test_run_rval 3 2147483646 # 0x7ffffffe +test_run_rval 4 2147483647 # 0x7fffffff + +exit 0 # injecting retval < 0 not supported yet + +case "$SIZEOF_KERNEL_LONG_T" in +4) + test_run_rval 5 3735943886 # 0xdeadface + test_run_rval 6 4294967295 # 0xffffffff + ;; +8) + test_run_rval 5 13464652301225294542 # 0xbadc0deddeadface + test_run_rval 6 18446744073709551615 # 0xffffffffffffffff + ;; +esac diff --git a/tests-m32/kern_features.c b/tests-m32/kern_features.c new file mode 100644 index 00000000..4814414d --- /dev/null +++ b/tests-m32/kern_features.c @@ -0,0 +1,100 @@ +/* + * Check decoding of SPARC-specific kern_features syscall. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include + +#include "raw_syscall.h" +#include "scno.h" + +#if defined __NR_kern_features && defined raw_syscall_0 + +# include +# include +# include +# include + +static void +test_kern_features(unsigned int num) +{ + /* The expected return codes, as enforced by fault injection */ + static struct { + kernel_ulong_t ret; + const char *str; + } checks[] = { + { 0, NULL }, + { 1, "KERN_FEATURE_MIXED_MODE_STACK" }, + { 2, "0x2" }, + { 0x7ffffffe, "0x7ffffffe" }, + { 0x7fffffff, "KERN_FEATURE_MIXED_MODE_STACK|0x7ffffffe" }, + { (kernel_ulong_t) 0xbadc0deddeadfaceULL, + sizeof(kernel_ulong_t) == 8 ? + "0xbadc0deddeadface" : "0xdeadface" }, + { (kernel_ulong_t) -1ULL, + sizeof(kernel_ulong_t) == 8 ? + "KERN_FEATURE_MIXED_MODE_STACK|0xfffffffffffffffe" : + "KERN_FEATURE_MIXED_MODE_STACK|0xfffffffe" }, + }; + + kernel_ulong_t err = 0; + kernel_ulong_t rc = raw_syscall_0(__NR_kern_features, &err); + + if (err) { + errno = rc; + printf("kern_features() = %s\n", sprintrc(-1)); + return; + } + + printf("kern_features() = %#llx", (unsigned long long) rc); + + if (num < ARRAY_SIZE(checks)) { + if (rc != checks[num].ret) + error_msg_and_fail("Expected return value (%llx) " + "doesn't match expected one (%#llx)", + (unsigned long long) rc, + (unsigned long long) checks[num].ret); + + if (checks[num].str) + printf(" (%s)", checks[num].str); + + printf(" (INJECTED)"); + } else if (rc) { + printf(" ("); + + if (rc & 1) + printf("KERN_FEATURE_MIXED_MODE_STACK"); + + if (rc & ~1ULL) { + if (rc & 1) + printf("|"); + + printf("%#llx", rc & ~1ULL); + } + + printf(")"); + } + + puts(""); +} + +int +main(int ac, char **av) +{ + test_kern_features(ac > 1 ? atoi(av[1]) : -1); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_kern_features && raw_syscall_0"); + +#endif diff --git a/tests-m32/kern_features.gen.test b/tests-m32/kern_features.gen.test new file mode 100755 index 00000000..317614a4 --- /dev/null +++ b/tests-m32/kern_features.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kern_features -a16 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 diff --git a/tests-m32/kernel_version-Xabbrev.c b/tests-m32/kernel_version-Xabbrev.c new file mode 100644 index 00000000..2d6da358 --- /dev/null +++ b/tests-m32/kernel_version-Xabbrev.c @@ -0,0 +1 @@ +#include "kernel_version.c" diff --git a/tests-m32/kernel_version-Xabbrev.gen.test b/tests-m32/kernel_version-Xabbrev.gen.test new file mode 100755 index 00000000..abfd5676 --- /dev/null +++ b/tests-m32/kernel_version-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kernel_version-Xabbrev -a16 -Xabbrev -v -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 -Xabbrev -v -e trace=bpf diff --git a/tests-m32/kernel_version-Xraw.c b/tests-m32/kernel_version-Xraw.c new file mode 100644 index 00000000..cf27608b --- /dev/null +++ b/tests-m32/kernel_version-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "kernel_version.c" diff --git a/tests-m32/kernel_version-Xraw.gen.test b/tests-m32/kernel_version-Xraw.gen.test new file mode 100755 index 00000000..e274faad --- /dev/null +++ b/tests-m32/kernel_version-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kernel_version-Xraw -a16 -Xraw -v -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 -Xraw -v -e trace=bpf diff --git a/tests-m32/kernel_version-Xverbose.c b/tests-m32/kernel_version-Xverbose.c new file mode 100644 index 00000000..cc6eb1b7 --- /dev/null +++ b/tests-m32/kernel_version-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "kernel_version.c" diff --git a/tests-m32/kernel_version-Xverbose.gen.test b/tests-m32/kernel_version-Xverbose.gen.test new file mode 100755 index 00000000..b9536ca3 --- /dev/null +++ b/tests-m32/kernel_version-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kernel_version-Xverbose -a16 -Xverbose -v -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 -Xverbose -v -e trace=bpf diff --git a/tests-m32/kernel_version.c b/tests-m32/kernel_version.c new file mode 100644 index 00000000..6e1c0eac --- /dev/null +++ b/tests-m32/kernel_version.c @@ -0,0 +1,104 @@ +/* + * Check kernel version decoding. + * + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +#include +#include "scno.h" + +#ifdef HAVE_LINUX_BPF_H +# include +#endif + +#include "bpf_attr.h" +#include "print_fields.h" + +#include "xlat.h" +#include "xlat/bpf_commands.h" + +#define CMD_STR(x) #x +static const char *errstr; + +static void +print_bpf_attr(void) +{ +#if XLAT_RAW + printf("{prog_type=0x16" +#else + printf("{prog_type=0x16 /* BPF_PROG_TYPE_??? */" +#endif + ", insn_cnt=3134983661" + ", insns=NULL" + ", license=NULL" + ", log_level=24" + ", log_size=3141592653" + ", log_buf=NULL" +#if XLAT_RAW + ", kern_version=0xcafef00d" +#elif XLAT_VERBOSE + ", kern_version=0xcafef00d" + " /* KERNEL_VERSION(51966, 240, 13) */" +#else + ", kern_version=KERNEL_VERSION(51966, 240, 13)" +#endif + ", prog_flags=0" + ", prog_name=\"\"" + ", prog_ifindex=0" + ", expected_attach_type=" +#if XLAT_RAW + "0" +#elif XLAT_VERBOSE + "0 /* BPF_CGROUP_INET_INGRESS */" +#else /* XLAT_ABBREV */ + "BPF_CGROUP_INET_INGRESS" +#endif + ", prog_btf_fd=0" + ", func_info_rec_size=0" + ", func_info=NULL" + ", func_info_cnt=0" + ", line_info_rec_size=0" + ", line_info=NULL" + ", line_info_cnt=0}"); +} + +int +main(void) +{ + long ret; + struct BPF_PROG_LOAD_struct prog = { + .prog_type = 22, + .insn_cnt = 0xbadc0ded, + .insns = 0, + .license = 0, + .log_level = 24, + .log_size = 3141592653U, + .log_buf = 0, + .kern_version = 0xcafef00d, + .prog_flags = 0, + }; + ret = syscall(__NR_bpf, BPF_PROG_LOAD, &prog, sizeof(prog)); + errstr = sprintrc(ret); +#if XLAT_RAW + printf("bpf(%#x, ", BPF_PROG_LOAD); +#elif XLAT_VERBOSE + printf("bpf(%#x /* %s */, ", BPF_PROG_LOAD, CMD_STR(BPF_PROG_LOAD)); +#else + printf("bpf(%s, ", CMD_STR(BPF_PROG_LOAD)); +#endif + print_bpf_attr(); + printf(", %u) = %s\n", (unsigned int) sizeof(prog), errstr); + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/kernel_version.gen.test b/tests-m32/kernel_version.gen.test new file mode 100755 index 00000000..8430c763 --- /dev/null +++ b/tests-m32/kernel_version.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kernel_version -a16 -v -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 -v -e trace=bpf diff --git a/tests-m32/kexec_file_load.c b/tests-m32/kexec_file_load.c index be90a37d..5e5d91ed 100644 --- a/tests-m32/kexec_file_load.c +++ b/tests-m32/kexec_file_load.c @@ -2,29 +2,10 @@ * Check decoding of kexec_file_load syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -44,7 +25,7 @@ struct strval { const char *str; }; -#define CMDLINE_STR "deadcodebaddatadefaced"; +# define CMDLINE_STR "deadcodebaddatadefaced" int main(void) diff --git a/tests-m32/kexec_file_load.gen.test b/tests-m32/kexec_file_load.gen.test new file mode 100755 index 00000000..11013497 --- /dev/null +++ b/tests-m32/kexec_file_load.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kexec_file_load -s9 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s9 diff --git a/tests-m32/kexec_file_load.test b/tests-m32/kexec_file_load.test deleted file mode 100755 index c95e1238..00000000 --- a/tests-m32/kexec_file_load.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of kexec_file_load syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s9 diff --git a/tests-m32/kexec_load.c b/tests-m32/kexec_load.c index 330238de..ae7a72c0 100644 --- a/tests-m32/kexec_load.c +++ b/tests-m32/kexec_load.c @@ -2,29 +2,10 @@ * Check decoding of kexec_load syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -62,8 +43,7 @@ main(void) }; static const kernel_ulong_t bogus_zero = - sizeof(long) < sizeof(kernel_long_t) ? - (kernel_ulong_t) 0xffffffff00000000ULL : 0; + sizeof(long) < sizeof(kernel_long_t) ? F8ILL_KULONG_MASK : 0; static const kernel_ulong_t bogus_entry = (kernel_ulong_t) 0xdeadca57badda7a1ULL; static const kernel_ulong_t bogus_nsegs = @@ -129,7 +109,7 @@ main(void) printf("{buf=%p, bufsz=%zu, mem=%p, memsz=%zu}, ", segms[i].buf, segms[i].bufsz, segms[i].mem, segms[i].memsz); - printf("%p], %s%s) = %s\n", + printf("... /* %p */], %s%s) = %s\n", segms + NUM_SEGMS, sizeof(long) == 8 ? flags[0].str64 : flags[0].str32, flags[0].str, errstr); diff --git a/tests-m32/kexec_load.gen.test b/tests-m32/kexec_load.gen.test new file mode 100755 index 00000000..6ce18317 --- /dev/null +++ b/tests-m32/kexec_load.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kexec_load -s9 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s9 diff --git a/tests-m32/kexec_load.test b/tests-m32/kexec_load.test deleted file mode 100755 index 4b1511e9..00000000 --- a/tests-m32/kexec_load.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of kexec_load syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s9 diff --git a/tests-m32/keyctl-Xabbrev.c b/tests-m32/keyctl-Xabbrev.c new file mode 100644 index 00000000..7b6b0dcc --- /dev/null +++ b/tests-m32/keyctl-Xabbrev.c @@ -0,0 +1 @@ +#include "keyctl.c" diff --git a/tests-m32/keyctl-Xabbrev.gen.test b/tests-m32/keyctl-Xabbrev.gen.test new file mode 100755 index 00000000..0068a032 --- /dev/null +++ b/tests-m32/keyctl-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (keyctl-Xabbrev -a31 -s10 -e trace=keyctl -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 -s10 -e trace=keyctl -Xabbrev diff --git a/tests-m32/keyctl-Xraw.c b/tests-m32/keyctl-Xraw.c new file mode 100644 index 00000000..202c22a9 --- /dev/null +++ b/tests-m32/keyctl-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "keyctl.c" diff --git a/tests-m32/keyctl-Xraw.gen.test b/tests-m32/keyctl-Xraw.gen.test new file mode 100755 index 00000000..2d89ea79 --- /dev/null +++ b/tests-m32/keyctl-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (keyctl-Xraw -a13 -s10 -e trace=keyctl -Xraw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 -s10 -e trace=keyctl -Xraw diff --git a/tests-m32/keyctl-Xverbose.c b/tests-m32/keyctl-Xverbose.c new file mode 100644 index 00000000..9f9d744a --- /dev/null +++ b/tests-m32/keyctl-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "keyctl.c" diff --git a/tests-m32/keyctl-Xverbose.gen.test b/tests-m32/keyctl-Xverbose.gen.test new file mode 100755 index 00000000..a0cdd7de --- /dev/null +++ b/tests-m32/keyctl-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (keyctl-Xverbose -a41 -s10 -e trace=keyctl -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a41 -s10 -e trace=keyctl -Xverbose diff --git a/tests-m32/keyctl.c b/tests-m32/keyctl.c index 2e26076b..ccfd3b44 100644 --- a/tests-m32/keyctl.c +++ b/tests-m32/keyctl.c @@ -2,29 +2,10 @@ * Check decoding of keyctl syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,10 +17,10 @@ # include # include +# include # include # include # include -# include # include # include # include @@ -55,6 +36,15 @@ struct keyctl_dh_params { }; # endif +# ifndef HAVE_STRUCT_KEYCTL_KDF_PARAMS +struct keyctl_kdf_params { + char *hashname; + char *otherinfo; + uint32_t otherinfolen; + uint32_t __spare[8]; +}; +# endif + # include "xlat.h" # include "xlat/keyctl_commands.h" @@ -74,7 +64,18 @@ static const size_t limit = 10; * significantly breaking interface. */ bool nul_terminated_buf = true; -bool buf_in_arg = false; +bool buf_in_arg; + +/* From ioctl_dm.c */ +# define STR32 "AbCdEfGhIjKlMnOpQrStUvWxYz012345" + +# if XLAT_RAW +# define XARG_STR(v_) (v_), STRINGIFY(v_) +# elif XLAT_VERBOSE +# define XARG_STR(v_) (v_), STRINGIFY(v_) " /* " #v_ " */" +# else +# define XARG_STR ARG_STR +# endif /* * When this is called with positive size, the buffer provided is an "out" @@ -97,17 +98,11 @@ print_quoted_string_limit(const char *str, size_t size, long rc) if (!nul_terminated_buf || (strnlen(str, limited_size) == limited_size)) { - printf("\""); print_quoted_memory(str, limited_size); if (print_size > limit) - printf("\"..."); - else - printf("\""); - } else { - printf("\""); + printf("..."); + } else print_quoted_string(str); - printf("\""); - } } static void @@ -121,9 +116,9 @@ print_arg(kernel_ulong_t arg, const char *str, const char *fmt, size_t size, printf("%s", str); } else { if (size == sizeof(uint64_t)) - printf(fmt, (uint64_t)arg); + printf(fmt, (uint64_t) arg); else if (size == sizeof(uint32_t)) - printf(fmt, (uint32_t)arg); + printf(fmt, (uint32_t) arg); else print_quoted_string_limit((void *) (uintptr_t) arg, size, rc); @@ -180,7 +175,13 @@ do_keyctl(kernel_ulong_t cmd, const char *cmd_str, ...) long rc = syscall(__NR_keyctl, cmd, args[0], args[1], args[2], args[3]); const char *errstr = sprintrc(rc); +# if XLAT_RAW + printf("keyctl(%#x", (unsigned) cmd); +# elif XLAT_VERBOSE + printf("keyctl(%#x /* %s */", (unsigned) cmd, cmd_str); +# else printf("keyctl(%s", cmd_str); +# endif for (i = 0; i < cnt; i++) { printf(", "); print_arg(args[i], arg_str[i], arg_fmt[i], arg_sz[i], rc); @@ -188,6 +189,85 @@ do_keyctl(kernel_ulong_t cmd, const char *cmd_str, ...) printf(") = %s\n", errstr); } +int +append_str(char **buf, size_t *left, const char *fmt, ...) +{ + int ret; + va_list ap; + + va_start(ap, fmt); + ret = vsnprintf(*buf, *left, fmt, ap); + va_end(ap); + + assert((ret >= 0) && ((unsigned) ret < *left)); + + *left -= ret; + *buf += ret; + + return ret; +} + +const char * +kckdfp_to_str(struct keyctl_kdf_params *kdf, bool deref_hash, bool deref_oi, + bool print_spare, const char *hash_str, const char *oi_str) +{ + static char buf[4096]; + + size_t left = sizeof(buf); + char *pos = buf; + + append_str(&pos, &left, "{hashname="); + + if (deref_hash && hash_str) { + append_str(&pos, &left, "%s", hash_str); + } else if (!kdf->hashname) { + append_str(&pos, &left, "NULL"); + } else if (deref_hash) { + append_str(&pos, &left, "\"%.*s\"", limit, kdf->hashname); + + if (strnlen(kdf->hashname, limit + 1) > limit) + append_str(&pos, &left, "..."); + } else { + append_str(&pos, &left, "%p", kdf->hashname); + } + + append_str(&pos, &left, ", otherinfo="); + + if (deref_oi && oi_str) { + append_str(&pos, &left, "%s", oi_str); + } else if (!kdf->otherinfo) { + append_str(&pos, &left, "NULL"); + } else if (deref_oi) { + append_str(&pos, &left, "\"%.*s\"", limit, kdf->otherinfo); + + if (strnlen(kdf->otherinfo, limit + 1) > limit) + append_str(&pos, &left, "..."); + } else { + append_str(&pos, &left, "%p", kdf->otherinfo); + } + + append_str(&pos, &left, ", otherinfolen=%u", kdf->otherinfolen); + + if (print_spare) { + size_t i; + + append_str(&pos, &left, ", __spare=["); + + for (i = 0; i < ARRAY_SIZE(kdf->__spare); i++) { + if (i) + append_str(&pos, &left, ", "); + + append_str(&pos, &left, "%#x", kdf->__spare[i]); + } + + append_str(&pos, &left, "]"); + } + + append_str(&pos, &left, "}"); + + return buf; +} + int main(void) { @@ -212,9 +292,50 @@ main(void) static const char *bogus_key3_str = "-557785390"; static const struct keyctl_dh_params kcdhp_data = { - KEY_SPEC_GROUP_KEYRING, 1234567890, 3141592653U }; - static const char *kcdhp_str = "{private=KEY_SPEC_GROUP_KEYRING, " - "prime=1234567890, base=-1153374643}"; + .private = KEY_SPEC_GROUP_KEYRING, + .prime = 1234567890, + .base = 3141592653U + }; + static const char *kcdhp_str = "{private=" +# if XLAT_RAW || XLAT_VERBOSE + "-6" +# endif +# if XLAT_VERBOSE + " /* " +# endif +# if !XLAT_RAW + "KEY_SPEC_GROUP_KEYRING" +# endif +# if XLAT_VERBOSE + " */" +# endif + ", prime=1234567890, base=-1153374643}"; + + /* + * It's bigger than current hash name size limit, but since it's + * implementation-dependent and totally internal, we do not rely + * on it much. + */ + static const char long_hash_data[] = STR32 STR32 STR32 STR32 "xxx"; + static const char short_hash_data[] = "hmac(aes)"; + static const char otherinfo1_data[] = "\1\2 OH HAI THAR\255\0\1"; + static const char otherinfo2_data[] = "\1\2\n\255\0\1"; + static const struct keyctl_kdf_params kckdfp_data[] = { + [0] = { NULL, NULL, 0, { 0 } }, + [1] = { NULL /* Changed to unaccessible address in copy */, + NULL, 0xbadc0dedU, { [7] = 0xdeadfeedU } }, + [2] = { NULL /* long_hash_data */, + NULL /* Changed to unaccessible address in copy */, + 0, { 0 } }, + [3] = { NULL /* unterminated1 */, + NULL /* otherinfo_data */, 0, { 1 } }, + [4] = { NULL /* short_hash_data */, + NULL /* otherinfo1_data */, sizeof(otherinfo1_data), + { 0, 0xfacebeef, 0, 0xba5e1ead } }, + [5] = { NULL /* short_hash_data */, + NULL /* otherinfo2_data */, sizeof(otherinfo2_data), + { 0 } }, + }; char *bogus_str = tail_memdup(unterminated1, sizeof(unterminated1)); char *bogus_desc = tail_memdup(unterminated2, sizeof(unterminated2)); @@ -223,6 +344,15 @@ main(void) char *long_type = tail_memdup(long_type_str, sizeof(long_type_str)); char *long_desc = tail_memdup(long_desc_str, sizeof(long_desc_str)); char *kcdhp = tail_memdup(&kcdhp_data, sizeof(kcdhp_data)); + char *kckdfp_long_hash = tail_memdup(long_hash_data, + sizeof(long_hash_data)); + char *kckdfp_short_hash = tail_memdup(short_hash_data, + sizeof(short_hash_data)); + char *kckdfp_otherinfo1 = tail_memdup(otherinfo1_data, + sizeof(otherinfo1_data)); + char *kckdfp_otherinfo2 = tail_memdup(otherinfo2_data, + sizeof(otherinfo2_data)); + char *kckdfp_char = tail_alloc(sizeof(kckdfp_data[0])); struct iovec *key_iov = tail_alloc(sizeof(*key_iov) * IOV_SIZE); char *bogus_buf1 = tail_alloc(9); char *bogus_buf2 = tail_alloc(256); @@ -230,7 +360,7 @@ main(void) char *key_iov_str2 = tail_alloc(4096); ssize_t ret; ssize_t kis_size = 0; - int i; + size_t i; key_iov[0].iov_base = short_type; key_iov[0].iov_len = sizeof(short_type_str); @@ -297,42 +427,58 @@ main(void) /* Invalid command */ do_keyctl((kernel_ulong_t) 0xbadc0dedfacefeedULL, - "0xfacefeed /* KEYCTL_??? */", +# if XLAT_VERBOSE + "KEYCTL_???" +# else + "0xfacefeed" +# if !XLAT_RAW + " /* KEYCTL_??? */" +# endif +# endif + , sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfee1badc0de5ULL, NULL, kulong_fmt, + (kernel_ulong_t) 0xdeadfee1badc0de5ULL, NULL, + kulong_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfee2badc0de6ULL, NULL, kulong_fmt, + (kernel_ulong_t) 0xdeadfee2badc0de6ULL, NULL, + kulong_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfee3badc0de7ULL, NULL, kulong_fmt, + (kernel_ulong_t) 0xdeadfee3badc0de7ULL, NULL, + kulong_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, kulong_fmt); + (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, + kulong_fmt); /* GET_KEYRING_ID */ do_keyctl(ARG_STR(KEYCTL_GET_KEYRING_ID), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xbadc0dedffffffffLLU, "-1", - NULL, 0UL); + (kernel_ulong_t) 0xbadc0dedffffffffLLU, "-1", NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_GET_KEYRING_ID), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), "%d", - sizeof(int), 3141592653U, NULL, "%d", - NULL, 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), "%d", + sizeof(int), 3141592653U, NULL, "%d", NULL, + 0UL); /* KEYCTL_JOIN_SESSION_KEYRING */ do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), - sizeof(char *), ARG_STR(NULL), NULL, 0UL); + sizeof(char *), ARG_STR(NULL), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, 0UL); do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), - sizeof(char *), bogus_str, NULL, ptr_fmt, 0UL); + sizeof(char *), bogus_str, NULL, ptr_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), - sizeof(char *), ARG_STR("bogus name"), NULL, 0UL); + sizeof(char *), ARG_STR("bogus name"), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), sizeof(char *), "very long keyring name", "\"very long \"...", - NULL, 0UL); + NULL, + 0UL); /* KEYCTL_UPDATE */ @@ -340,21 +486,21 @@ main(void) buf_in_arg = true; do_keyctl(ARG_STR(KEYCTL_UPDATE), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, sizeof(char *), ARG_STR(NULL), NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 0, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 0, NULL, ksize_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_UPDATE), sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, ksize_fmt, + (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, ksize_fmt, 0UL); do_keyctl(ARG_STR(KEYCTL_UPDATE), sizeof(int32_t), bogus_key2, NULL, "%d", sizeof(char *), bogus_str, NULL, ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, ksize_fmt, + (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, ksize_fmt, 0UL); do_keyctl(ARG_STR(KEYCTL_UPDATE), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, @@ -369,11 +515,14 @@ main(void) /* KEYCTL_REVOKE */ do_keyctl(ARG_STR(KEYCTL_REVOKE), - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_REVOKE), - sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key1, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_REVOKE), - sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key2, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_REVOKE), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, 0UL); @@ -381,34 +530,55 @@ main(void) /* KEYCTL_CHOWN */ do_keyctl(ARG_STR(KEYCTL_CHOWN), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, sizeof(uid_t), ARG_STR(-1), NULL, - sizeof(gid_t), ARG_STR(-1), NULL, 0UL); + sizeof(gid_t), ARG_STR(-1), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_CHOWN), sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(uid_t), 2718281828U, NULL, "%u", - sizeof(gid_t), 3141592653U, NULL, "%u", 0UL); + sizeof(gid_t), 3141592653U, NULL, "%u", + 0UL); /* KEYCTL_SETPERM */ do_keyctl(ARG_STR(KEYCTL_SETPERM), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQKEY_AUTH_KEY), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_REQKEY_AUTH_KEY), NULL, sizeof(uint32_t), 0xffffffffU, - "KEY_POS_VIEW|KEY_POS_READ|KEY_POS_WRITE|" - "KEY_POS_SEARCH|KEY_POS_LINK|KEY_POS_SETATTR|" - "KEY_USR_VIEW|KEY_USR_READ|KEY_USR_WRITE|" - "KEY_USR_SEARCH|KEY_USR_LINK|KEY_USR_SETATTR|" - "KEY_GRP_VIEW|KEY_GRP_READ|KEY_GRP_WRITE|" - "KEY_GRP_SEARCH|KEY_GRP_LINK|KEY_GRP_SETATTR|" - "KEY_OTH_VIEW|KEY_OTH_READ|KEY_OTH_WRITE|" - "KEY_OTH_SEARCH|KEY_OTH_LINK|KEY_OTH_SETATTR|" - "0xc0c0c0c0", NULL, 0UL); +# if XLAT_RAW || XLAT_VERBOSE + "0xffffffff" +# endif +# if XLAT_VERBOSE + " /* " +# endif +# if !XLAT_RAW + "KEY_POS_VIEW|KEY_POS_READ|KEY_POS_WRITE|" + "KEY_POS_SEARCH|KEY_POS_LINK|KEY_POS_SETATTR|" + "KEY_USR_VIEW|KEY_USR_READ|KEY_USR_WRITE|" + "KEY_USR_SEARCH|KEY_USR_LINK|KEY_USR_SETATTR|" + "KEY_GRP_VIEW|KEY_GRP_READ|KEY_GRP_WRITE|" + "KEY_GRP_SEARCH|KEY_GRP_LINK|KEY_GRP_SETATTR|" + "KEY_OTH_VIEW|KEY_OTH_READ|KEY_OTH_WRITE|" + "KEY_OTH_SEARCH|KEY_OTH_LINK|KEY_OTH_SETATTR|" + "0xc0c0c0c0" +# endif +# if XLAT_VERBOSE + " */" +# endif + , NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_SETPERM), sizeof(int32_t), bogus_key1, NULL, "%d", - sizeof(uint32_t), 0, NULL, "%#x", 0UL); + sizeof(uint32_t), 0, NULL, "%#x", + 0UL); do_keyctl(ARG_STR(KEYCTL_SETPERM), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, - sizeof(uint32_t), 0xc0c0c0c0, "0xc0c0c0c0 /* KEY_??? */", + sizeof(uint32_t), 0xc0c0c0c0, + "0xc0c0c0c0" +# if !XLAT_RAW + " /* KEY_??? */" +# endif + , NULL, 0UL); @@ -418,38 +588,41 @@ main(void) sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, 0UL); do_keyctl(ARG_STR(KEYCTL_DESCRIBE), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, 0UL); do_keyctl(ARG_STR(KEYCTL_DESCRIBE), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 9, NULL, ksize_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_DESCRIBE), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 256, NULL, ksize_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_DESCRIBE), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) -4, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) -4, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) -4, NULL, ksize_fmt, + 0UL); /* KEYCTL_CLEAR */ do_keyctl(ARG_STR(KEYCTL_CLEAR), - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_CLEAR), - sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key1, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_CLEAR), - sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key2, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_CLEAR), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, 0UL); @@ -458,12 +631,14 @@ main(void) /* KEYCTL_LINK */ do_keyctl(ARG_STR(KEYCTL_LINK), sizeof(int32_t), bogus_key1, NULL, "%d", - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_LINK), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, - sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), bogus_key2, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_LINK), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, 0UL); @@ -471,13 +646,14 @@ main(void) /* KEYCTL_UNLINK */ do_keyctl(ARG_STR(KEYCTL_UNLINK), sizeof(int32_t), bogus_key1, NULL, "%d", - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); do_keyctl(ARG_STR(KEYCTL_UNLINK), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, - sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), bogus_key2, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_UNLINK), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, 0UL); @@ -486,7 +662,7 @@ main(void) buf_in_arg = true; do_keyctl(ARG_STR(KEYCTL_SEARCH), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, sizeof(char *), ARG_STR(NULL), NULL, sizeof(char *), ARG_STR(NULL), NULL, sizeof(int32_t), 0, NULL, "%d"); @@ -494,7 +670,7 @@ main(void) sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, sizeof(char *), (char *) 0xfffff00dfffff157ULL, NULL, ptr_fmt, - sizeof(int32_t), ARG_STR(KEY_SPEC_USER_SESSION_KEYRING), + sizeof(int32_t), XARG_STR(KEY_SPEC_USER_SESSION_KEYRING), NULL); do_keyctl(ARG_STR(KEYCTL_SEARCH), sizeof(int32_t), bogus_key2, NULL, "%d", @@ -512,6 +688,34 @@ main(void) sizeof(long_type_str), long_desc, NULL, NULL, sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); + /* KEYCTL_RESTRICT_KEYRING */ + + do_keyctl(ARG_STR(KEYCTL_RESTRICT_KEYRING), + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(char *), ARG_STR(NULL), NULL, + sizeof(char *), ARG_STR(NULL), NULL, + NULL); + do_keyctl(ARG_STR(KEYCTL_RESTRICT_KEYRING), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, + sizeof(char *), (char *) 0xfffff00dfffff157ULL, NULL, ptr_fmt, + NULL); + do_keyctl(ARG_STR(KEYCTL_RESTRICT_KEYRING), + sizeof(int32_t), bogus_key2, NULL, "%d", + sizeof(char *), bogus_str, NULL, ptr_fmt, + sizeof(char *), bogus_desc, NULL, ptr_fmt, + NULL); + do_keyctl(ARG_STR(KEYCTL_RESTRICT_KEYRING), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(short_type_str), short_type, NULL, NULL, + sizeof(short_desc_str), short_desc, NULL, NULL, + NULL); + do_keyctl(ARG_STR(KEYCTL_RESTRICT_KEYRING), + sizeof(int32_t), 0, NULL, "%d", + sizeof(long_type_str), long_type, NULL, NULL, + sizeof(long_type_str), long_desc, NULL, NULL, + NULL); + buf_in_arg = false; @@ -532,23 +736,23 @@ main(void) sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, 0UL); do_keyctl(ARG_STR(KEYCTL_READ), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 9, NULL, ksize_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_READ), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 256, NULL, ksize_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_READ), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) -4, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) -4, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) -4, NULL, ksize_fmt, + 0UL); nul_terminated_buf = true; @@ -559,33 +763,33 @@ main(void) sizeof(int32_t), 0, NULL, "%d", sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, sizeof(int32_t), 0, NULL, "%d"); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfeedLLU, NULL, ksize_fmt, + (kernel_ulong_t) 0xdeadfeedLLU, NULL, ksize_fmt, sizeof(int32_t), bogus_key1, NULL, "%d"); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), sizeof(int32_t), bogus_key2, NULL, "%d", sizeof(char *), bogus_str, NULL, ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 32LLU, NULL, ksize_fmt, + (kernel_ulong_t) 32LLU, NULL, ksize_fmt, sizeof(int32_t), bogus_key2, NULL, "%d"); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(short_type_str), short_desc, NULL, NULL, sizeof(kernel_ulong_t), - (kernel_ulong_t) sizeof(short_type_str) - 1, NULL, - ksize_fmt, + (kernel_ulong_t) sizeof(short_type_str) - 1, NULL, + ksize_fmt, sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, sizeof(long_type_str), long_desc, NULL, NULL, sizeof(kernel_ulong_t), - (kernel_ulong_t) sizeof(long_type_str), NULL, ksize_fmt, - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL); + (kernel_ulong_t) sizeof(long_type_str), NULL, ksize_fmt, + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL); buf_in_arg = false; @@ -594,16 +798,20 @@ main(void) do_keyctl(ARG_STR(KEYCTL_NEGATE), sizeof(int32_t), 0, NULL, "%d", sizeof(uint32_t), 0, NULL, "%u", - sizeof(int32_t), 0, NULL, "%d", 0UL); + sizeof(int32_t), 0, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_NEGATE), sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(uint32_t), 3141592653U, NULL, "%u", - sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key1, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_NEGATE), sizeof(int32_t), bogus_key2, NULL, "%d", sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, - sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", + NULL, + sizeof(int32_t), bogus_key2, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_NEGATE), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(kernel_ulong_t), @@ -614,7 +822,7 @@ main(void) /* KEYCTL_SET_REQKEY_KEYRING */ do_keyctl(ARG_STR(KEYCTL_SET_REQKEY_KEYRING), - sizeof(int32_t), ARG_STR(KEY_REQKEY_DEFL_NO_CHANGE), NULL, + sizeof(int32_t), XARG_STR(KEY_REQKEY_DEFL_NO_CHANGE), NULL, 0UL); /* * Keep it commented out until proper way of faking syscalls is not @@ -622,34 +830,44 @@ main(void) */ /* do_keyctl(ARG_STR(KEYCTL_SET_REQKEY_KEYRING), sizeof(int32_t), - ARG_STR(KEY_REQKEY_DEFL_REQUESTOR_KEYRING), NULL, 0UL); */ + XARG_STR(KEY_REQKEY_DEFL_REQUESTOR_KEYRING), NULL, 0UL); */ do_keyctl(ARG_STR(KEYCTL_SET_REQKEY_KEYRING), sizeof(kernel_ulong_t), (kernel_ulong_t) 0xfeedf157badc0dedLLU, - "0xbadc0ded /* KEY_REQKEY_DEFL_??? */", NULL, 0UL); + "-1159983635" +# if !XLAT_RAW + " /* KEY_REQKEY_DEFL_??? */" +# endif + , NULL, 0UL); /* KEYCTL_SET_TIMEOUT */ do_keyctl(ARG_STR(KEYCTL_SET_TIMEOUT), sizeof(int32_t), 0, NULL, "%d", - sizeof(uint32_t), 0, NULL, "%u", 0UL); + sizeof(uint32_t), 0, NULL, "%u", + 0UL); do_keyctl(ARG_STR(KEYCTL_SET_TIMEOUT), sizeof(int32_t), bogus_key1, NULL, "%d", - sizeof(uint32_t), 3141592653U, NULL, "%u", 0UL); + sizeof(uint32_t), 3141592653U, NULL, "%u", + 0UL); do_keyctl(ARG_STR(KEYCTL_SET_TIMEOUT), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", + NULL, 0UL); /* KEYCTL_ASSUME_AUTHORITY */ do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), - sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key1, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), - sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key2, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, 0UL); @@ -659,28 +877,29 @@ main(void) do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(char *), ARG_STR(NULL), ptr_fmt, - sizeof(uint32_t), 0xbadc0dedU, NULL, "%u", 0UL); + sizeof(uint32_t), 0xbadc0dedU, NULL, "%u", + 0UL); do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, 0UL); do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 9, NULL, ksize_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 256, NULL, ksize_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) -4, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) -4, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) -4, NULL, ksize_fmt, + 0UL); /* KEYCTL_SESSION_TO_PARENT */ @@ -701,15 +920,18 @@ main(void) do_keyctl(ARG_STR(KEYCTL_REJECT), sizeof(int32_t), bogus_key2, NULL, "%d", sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadca75facef157LLU, "4207866199", NULL, + (kernel_ulong_t) 0xdeadca75facef157LLU, "4207866199", + NULL, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", + NULL, sizeof(int32_t), bogus_key2, NULL, "%d"); do_keyctl(ARG_STR(KEYCTL_REJECT), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, - sizeof(uint32_t), ARG_STR(ENODEV), NULL, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", + NULL, + sizeof(uint32_t), XARG_STR(ENODEV), NULL, sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); @@ -718,19 +940,19 @@ main(void) sizeof(int32_t), 0, NULL, "%d", sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, sizeof(int32_t), 0, NULL, "%d"); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfeedLLU, NULL, ksize_fmt, + sizeof(kernel_ulong_t), (kernel_ulong_t) 0xdeadfeedLLU, NULL, + ksize_fmt, sizeof(int32_t), bogus_key1, NULL, "%d"); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), sizeof(int32_t), bogus_key2, NULL, "%d", sizeof(char *), key_iov + IOV_SIZE, NULL, ptr_fmt, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 32LLU, NULL, ksize_fmt, + sizeof(kernel_ulong_t), (kernel_ulong_t) 32LLU, NULL, + ksize_fmt, sizeof(int32_t), bogus_key2, NULL, "%d"); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, @@ -739,20 +961,23 @@ main(void) ksize_fmt, sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, sizeof(key_iov), key_iov, key_iov_str2, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) IOV_SIZE, NULL, ksize_fmt, - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL); + sizeof(kernel_ulong_t), (kernel_ulong_t) IOV_SIZE, NULL, + ksize_fmt, + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL); /* KEYCTL_INVALIDATE */ do_keyctl(ARG_STR(KEYCTL_INVALIDATE), - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_INVALIDATE), - sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key1, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_INVALIDATE), - sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key2, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_INVALIDATE), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, 0UL); @@ -761,10 +986,12 @@ main(void) /* KEYCTL_GET_PERSISTENT */ do_keyctl(ARG_STR(KEYCTL_GET_PERSISTENT), sizeof(uid_t), ARG_STR(-1), NULL, - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_GET_PERSISTENT), sizeof(uid_t), 2718281828U, NULL, "%u", - sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key1, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_GET_PERSISTENT), sizeof(uid_t), 2718281828U, NULL, "%u", sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, @@ -782,29 +1009,86 @@ main(void) sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, - 0UL); + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + sizeof(char *), ARG_STR(NULL), ptr_fmt); do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), sizeof(char *), kcdhp + 1, NULL, ptr_fmt, sizeof(char *), (char *) 0xfffff157ffffdeadULL, NULL, ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, - 0UL); + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + sizeof(char *), ARG_STR(NULL), ptr_fmt); do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), sizeof(kcdhp), kcdhp, kcdhp_str, NULL, (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 9, NULL, ksize_fmt, + sizeof(char *), ARG_STR(NULL), ptr_fmt); do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), sizeof(kcdhp), kcdhp, kcdhp_str, NULL, (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 256, NULL, ksize_fmt, + sizeof(char *), ARG_STR(NULL), ptr_fmt); do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), sizeof(kcdhp), kcdhp, kcdhp_str, NULL, (size_t) -1, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) -1, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) -1, NULL, ksize_fmt, + sizeof(char *), kckdfp_char + 1, NULL, ptr_fmt); + + /* KEYCTL_DH_COMPUTE + KDF */ + + for (i = 0; i < ARRAY_SIZE(kckdfp_data); i++) { + struct keyctl_kdf_params *kckdfp = + (struct keyctl_kdf_params *) kckdfp_char; + bool deref_hash = true; + bool deref_opts = true; + bool print_spare = false; + const char *hash_str = NULL; + const char *oi_str = NULL; + + memcpy(kckdfp, kckdfp_data + i, sizeof(kckdfp_data[i])); + + switch (i) { + case 1: + deref_hash = false; + print_spare = true; + kckdfp->hashname = + kckdfp_short_hash + sizeof(short_hash_data); + break; + case 2: + deref_opts = false; + kckdfp->hashname = kckdfp_long_hash; + kckdfp->otherinfo = + kckdfp_otherinfo1 + sizeof(otherinfo1_data); + break; + case 3: + deref_opts = false; + deref_hash = false; + print_spare = true; + kckdfp->hashname = bogus_str; + kckdfp->otherinfo = kckdfp_otherinfo1; + break; + case 4: + oi_str = "\"\\1\\2 OH HAI \"..."; + print_spare = true; + kckdfp->hashname = kckdfp_short_hash; + kckdfp->otherinfo = kckdfp_otherinfo1; + break; + case 5: + oi_str = "\"\\1\\2\\n\\255\\0\\1\\0\""; + kckdfp->hashname = kckdfp_short_hash; + kckdfp->otherinfo = kckdfp_otherinfo2; + break; + } + + do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), + sizeof(kcdhp), kcdhp, kcdhp_str, NULL, + (size_t) -1, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), (kernel_ulong_t) -1, NULL, + ksize_fmt, + sizeof(kckdfp), kckdfp_char, + kckdfp_to_str(kckdfp, deref_hash, deref_opts, + print_spare, hash_str, oi_str), + NULL); + } nul_terminated_buf = true; diff --git a/tests-m32/keyctl.gen.test b/tests-m32/keyctl.gen.test new file mode 100755 index 00000000..82afad99 --- /dev/null +++ b/tests-m32/keyctl.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (keyctl -a31 -s10); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 -s10 diff --git a/tests-m32/keyctl.test b/tests-m32/keyctl.test deleted file mode 100755 index 875a82d3..00000000 --- a/tests-m32/keyctl.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of keyctl syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a31 -s10 diff --git a/tests-m32/kill.c b/tests-m32/kill.c index cb884aa1..4ef9b628 100644 --- a/tests-m32/kill.c +++ b/tests-m32/kill.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Fei Jie + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -66,7 +47,7 @@ main(void) (int) big_pid, (int) big_sig, rc, errno2name()); rc = syscall(__NR_kill, (long) 0xdefaced00000000ULL | pid, 0); - printf("kill(%d, SIG_0) = %ld\n", pid, rc); + printf("kill(%d, 0) = %ld\n", pid, rc); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/kill.gen.test b/tests-m32/kill.gen.test new file mode 100755 index 00000000..08a004e9 --- /dev/null +++ b/tests-m32/kill.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kill -a12 -esignal=none); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 -esignal=none diff --git a/tests-m32/kill.test b/tests-m32/kill.test deleted file mode 100755 index 7a3a51aa..00000000 --- a/tests-m32/kill.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of kill syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a12 -esignal=none diff --git a/tests-m32/kill_child.c b/tests-m32/kill_child.c new file mode 100644 index 00000000..55b83aba --- /dev/null +++ b/tests-m32/kill_child.c @@ -0,0 +1,69 @@ +/* + * Check for the corner case that previously lead to segfault + * due to an attempt to access unitialised tcp->s_ent. + * + * 13994 ????( + * ... + * 13994 <... ???? resumed>) = ? + * + * Copyright (c) 2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +#define ITERS 10000 +#define SC_ITERS 10000 + +int +main(void) +{ + volatile sig_atomic_t *const mem = + mmap(NULL, get_page_size(), PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_ANONYMOUS, -1, 0); + if (mem == MAP_FAILED) + perror_msg_and_fail("mmap"); + + for (unsigned int i = 0; i < ITERS; ++i) { + mem[0] = mem[1] = 0; + + const pid_t pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + /* wait for the parent */ + while (!mem[0]) + ; + /* let the parent know we are running */ + mem[1] = 1; + + for (unsigned int j = 0; j < SC_ITERS; j++) + sched_yield(); + + pause(); + return 0; + } + + /* let the child know we are running */ + mem[0] = 1; + /* wait for the child */ + while (!mem[1]) + ; + + if (kill(pid, SIGKILL)) + perror_msg_and_fail("kill"); + if (wait(NULL) != pid) + perror_msg_and_fail("wait"); + } + + return 0; +} diff --git a/tests-m32/kill_child.test b/tests-m32/kill_child.test new file mode 100755 index 00000000..312592bd --- /dev/null +++ b/tests-m32/kill_child.test @@ -0,0 +1,31 @@ +#!/bin/sh +# +# Check whether repeated killing of just forked processes crashes strace. +# +# Copyright (c) 2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed date +%s > /dev/null +s0="$(date +%s)" + +run_prog +args="-f -qq -e signal=none -e trace=sched_yield,/kill $args" + +# Run strace until the known corner case is observed. +while :; do + run_strace $args + + # Printing of "<... SYSCALL resumed>" in strace.c:print_event_exit + # used to segfault when the syscall number had not been obtained + # on syscall entering. + grep -q '^[1-9][0-9]* <\.\.\. ???? resumed>) \+= ?$' "$LOG" && exit 0 + + s1="$(date +%s)" + if [ "$(($s1-$s0))" -gt "$(($TIMEOUT_DURATION/2))" ]; then + skip_ 'Unable to reproduce <... ???? resumed>' + fi +done diff --git a/tests-m32/ksysent.c b/tests-m32/ksysent.c index 8cac93ca..4319bdb2 100644 --- a/tests-m32/ksysent.c +++ b/tests-m32/ksysent.c @@ -2,29 +2,10 @@ * Validate syscallent.h file. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -33,24 +14,14 @@ #include #include -#define TD 0 -#define TF 0 -#define TI 0 -#define TN 0 -#define TP 0 -#define TS 0 -#define TM 0 -#define NF 0 -#define MA 0 -#define SI 0 -#define SE 0 -#define CST 0 -#define SEN(arg) 0,0 +#include "sysent_shorthand_defs.h" static const struct_sysent syscallent[] = { #include "syscallent.h" }; +#include "sysent_shorthand_undefs.h" + typedef const char *pstr_t; static const pstr_t ksyslist[] = { #include "ksysent.h" diff --git a/tests-m32/ksysent.sed b/tests-m32/ksysent.sed index 63ded4a9..c35ba22f 100644 --- a/tests-m32/ksysent.sed +++ b/tests-m32/ksysent.sed @@ -1,9 +1,14 @@ #!/bin/sed -rnf +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later # should not have been exported at all -/#define[[:space:]]+__NR_(sys_epoll_|arch_specific_syscall|syscalls|syscall_count|syscall_max|available|reserved|unused)/d +/#define[[:space:]]+__NR_(sys_epoll_|arch_specific_syscall|arm_sync_file_range|syscalls|syscall_count|syscall_max|available|reserved|unused)/d -# should not have been named this way +# should not have been named this way s/__NR_(arm|xtensa)_fadvise64_64/__NR_fadvise64_64/ # legacy names diff --git a/tests-m32/ksysent.test b/tests-m32/ksysent.test index 80266488..347ed675 100755 --- a/tests-m32/ksysent.test +++ b/tests-m32/ksysent.test @@ -1,4 +1,9 @@ #!/bin/sh +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later # Validate syscallent.h diff --git a/tests-m32/lchown.c b/tests-m32/lchown.c index a07c878c..c9008219 100644 --- a/tests-m32/lchown.c +++ b/tests-m32/lchown.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/lchown.gen.test b/tests-m32/lchown.gen.test new file mode 100755 index 00000000..d346c76d --- /dev/null +++ b/tests-m32/lchown.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (lchown -a30 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 diff --git a/tests-m32/lchown.test b/tests-m32/lchown.test deleted file mode 100755 index ceeaa859..00000000 --- a/tests-m32/lchown.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check lchown syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a30 diff --git a/tests-m32/lchown32.c b/tests-m32/lchown32.c index 29cb01db..1a505e1f 100644 --- a/tests-m32/lchown32.c +++ b/tests-m32/lchown32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/lchown32.gen.test b/tests-m32/lchown32.gen.test new file mode 100755 index 00000000..5da2349c --- /dev/null +++ b/tests-m32/lchown32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (lchown32 -a32 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 diff --git a/tests-m32/lchown32.test b/tests-m32/lchown32.test deleted file mode 100755 index 6ee1ac95..00000000 --- a/tests-m32/lchown32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check lchown32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a32 diff --git a/tests-m32/libmmsg.c b/tests-m32/libmmsg.c index b0db26d2..0f23597d 100644 --- a/tests-m32/libmmsg.c +++ b/tests-m32/libmmsg.c @@ -1,30 +1,10 @@ /* * Wrappers for recvmmsg and sendmmsg syscalls. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/libsocketcall.c b/tests-m32/libsocketcall.c index 04d6710f..34f65478 100644 --- a/tests-m32/libsocketcall.c +++ b/tests-m32/libsocketcall.c @@ -1,30 +1,10 @@ /* * Invoke a socket syscall, either directly or via __NR_socketcall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -43,7 +23,7 @@ socketcall(const int nr, const int call, int rc = -1; errno = ENOSYS; -# ifdef __NR_socketcall +#ifdef __NR_socketcall static int have_socketcall = -1; if (have_socketcall < 0) { @@ -59,7 +39,7 @@ socketcall(const int nr, const int call, const long args[] = { a1, a2, a3, a4, a5 }; rc = syscall(__NR_socketcall, call, args); } else -# endif +#endif { if (nr != -1) rc = syscall(nr, a1, a2, a3, a4, a5); diff --git a/tests-m32/link.c b/tests-m32/link.c index d6550fd3..357eb0be 100644 --- a/tests-m32/link.c +++ b/tests-m32/link.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/link.gen.test b/tests-m32/link.gen.test new file mode 100755 index 00000000..2ec3f5b8 --- /dev/null +++ b/tests-m32/link.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (link ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/link.test b/tests-m32/link.test deleted file mode 100755 index cfa2b0cc..00000000 --- a/tests-m32/link.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check link syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/linkat.c b/tests-m32/linkat.c index 64b900ea..748ddf18 100644 --- a/tests-m32/linkat.c +++ b/tests-m32/linkat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/linkat.gen.test b/tests-m32/linkat.gen.test new file mode 100755 index 00000000..8bdf78b4 --- /dev/null +++ b/tests-m32/linkat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (linkat ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/linkat.test b/tests-m32/linkat.test deleted file mode 100755 index 5627de7f..00000000 --- a/tests-m32/linkat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check linkat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/list_sigaction_signum.c b/tests-m32/list_sigaction_signum.c new file mode 100644 index 00000000..bf495406 --- /dev/null +++ b/tests-m32/list_sigaction_signum.c @@ -0,0 +1,37 @@ +/* + * List signal numbers that are valid arguments for sigaction syscall. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include + +int +main(void) +{ + unsigned int i; + + for (i = 1; i < 32; ++i) { + static const struct sigaction ign = { .sa_handler = SIG_IGN }; + static const struct sigaction dfl = { .sa_handler = SIG_DFL }; + struct sigaction act; + + if (sigaction(i, &ign, NULL) || + sigaction(i, NULL, &act) || + ign.sa_handler != act.sa_handler || + sigaction(i, &dfl, NULL) || + sigaction(i, NULL, &act) || + dfl.sa_handler != act.sa_handler) + continue; + + printf("%u\n", i); + } + + return 0; +} diff --git a/tests-m32/llseek.c b/tests-m32/llseek.c index e687e947..169fa913 100644 --- a/tests-m32/llseek.c +++ b/tests-m32/llseek.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/llseek.test b/tests-m32/llseek.test index cf1607ed..a2858398 100755 --- a/tests-m32/llseek.test +++ b/tests-m32/llseek.test @@ -1,15 +1,16 @@ #!/bin/sh - +# # Check _llseek syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" check_prog grep run_prog > /dev/null run_strace -e_llseek $args > "$EXP" -grep -v '^lseek([0-9]' < "$LOG" > "$OUT" +grep -v '^_llseek([0-9]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" - -exit 0 diff --git a/tests-m32/localtime.c b/tests-m32/localtime.c new file mode 100644 index 00000000..652d3e6a --- /dev/null +++ b/tests-m32/localtime.c @@ -0,0 +1,37 @@ +/* + * Check handling of localtime() returning NULL in printleader(). + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include + +#include + +int +main(void) +{ + struct timespec ts; + int pid; + + assert(!clock_gettime(CLOCK_REALTIME, &ts)); + + pid = syscall(__NR_gettid); + + /* We expect localtime to fail here */ + printf("%lld.%06ld gettid() = %d\n", + (long long) ts.tv_sec, (long) (ts.tv_nsec / 1000), pid); + + printf("%lld.%06ld +++ exited with 0 +++\n", + (long long) ts.tv_sec, (long) (ts.tv_nsec / 1000)); + + return 0; +} diff --git a/tests-m32/localtime.test b/tests-m32/localtime.test new file mode 100755 index 00000000..e2ce1325 --- /dev/null +++ b/tests-m32/localtime.test @@ -0,0 +1,18 @@ +#!/bin/sh +# +# Check handling of localtime() failure in printleader(). +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +check_prog faketime +faketime -f +1000000000000000000x0 ../$NAME | grep -q '^100000000' \ + || framework_skip_ 'faketime failed to fake time' + +STRACE="faketime -f +1000000000000000000x0 $STRACE" + +run_strace_match_diff -tt -a10 -e trace=gettid diff --git a/tests-m32/lookup_dcookie.c b/tests-m32/lookup_dcookie.c index 986180ce..430ae135 100644 --- a/tests-m32/lookup_dcookie.c +++ b/tests-m32/lookup_dcookie.c @@ -2,29 +2,10 @@ * Check decoding of lookup_dcookie syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/lookup_dcookie.gen.test b/tests-m32/lookup_dcookie.gen.test new file mode 100755 index 00000000..616c7057 --- /dev/null +++ b/tests-m32/lookup_dcookie.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (lookup_dcookie -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-m32/lookup_dcookie.test b/tests-m32/lookup_dcookie.test deleted file mode 100755 index 47e1c2d6..00000000 --- a/tests-m32/lookup_dcookie.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of lookup_cookie syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests-m32/looping_threads.c b/tests-m32/looping_threads.c new file mode 100644 index 00000000..2f5e9550 --- /dev/null +++ b/tests-m32/looping_threads.c @@ -0,0 +1,121 @@ +/* + * Check tracing of looping threads. + * + * Copyright (c) 2009-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +static void * +thread(void *arg) +{ + for (;;) + getuid(); + return arg; +} + +int +main(int ac, const char *av[]) +{ + assert(ac == 3); + + int timeout = atoi(av[1]); + assert(timeout > 0); + + int num_threads = atoi(av[2]); + assert(num_threads > 0); + + /* + * Unblock all signals. + */ + static sigset_t mask; + if (sigprocmask(SIG_SETMASK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + /* + * Reset SIGALRM and SIGHUP signal handlers. + */ + static const struct sigaction sa_def = { .sa_handler = SIG_DFL }; + if (sigaction(SIGHUP, &sa_def, NULL)) + perror_msg_and_fail("sigaction SIGHUP"); + if (sigaction(SIGALRM, &sa_def, NULL)) + perror_msg_and_fail("sigaction SIGALRM"); + + /* + * Create a new process group. + */ + if (setpgid(0, 0)) + perror_msg_and_fail("setpgid"); + + /* + * Set an alarm clock. + */ + alarm(timeout); + + /* + * When the main process terminates, the process group becomes orphaned. + * If any member of the orphaned process group is stopped, then + * a SIGHUP signal followed by a SIGCONT signal is sent to each process + * in the orphaned process group. + * Create a process in a stopped state to activate this behaviour. + */ + const pid_t stopped = fork(); + if (stopped < 0) + perror_msg_and_fail("fork"); + if (!stopped) { + raise(SIGSTOP); + _exit(0); + } + + /* + * Wait for the process to stop. + */ + int status; + if (waitpid(stopped, &status, WUNTRACED) != stopped) + perror_msg_and_fail("waitpid WUNTRACED"); + if (!WIFSTOPPED(status) || WSTOPSIG(status) != SIGSTOP) + error_msg_and_fail("waitpid WUNTRACED: " + "unexpected wait status %d", status); + /* + * Create all threads in a subprocess, this guarantees that + * their tracer will not be their parent. + */ + pid_t pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + if (!pid) { + for (int i = 0; i < num_threads; i++) { + pthread_t t; + if ((errno = pthread_create(&t, NULL, thread, NULL))) { + if (EAGAIN == errno) + break; + perror_msg_and_fail("pthread_create #%d", i); + } + } + + /* This terminates all threads created above. */ + _exit(0); + } + + if (waitpid(pid, &status, 0) != pid) + perror_msg_and_fail("waitpid"); + if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) + error_msg_and_fail("waitpid: unexpected wait status %d", + status); + + /* + * Make the process group orphaned. + */ + return 0; +} diff --git a/tests-m32/looping_threads.test b/tests-m32/looping_threads.test new file mode 100755 index 00000000..e8b0bbb5 --- /dev/null +++ b/tests-m32/looping_threads.test @@ -0,0 +1,38 @@ +#!/bin/sh +# +# Check tracing of looping threads. +# +# Copyright (c) 2009-2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" +. "${srcdir=.}/PTRACE_SEIZE.sh" + +run_prog ../orphaned_process_group > /dev/null + +run_prog_skip_if_failed date +%s > /dev/null +s0="$(date +%s)" + +check_prog nproc +inc="$(nproc)" +[ "$inc" -ge 1 ] || inc=1 + +timeout_2="$(($TIMEOUT_DURATION/2))" +timeout_8="$(($TIMEOUT_DURATION/8))" +nproc=1 + +run_prog "../$NAME" "$timeout_8" "$nproc" + +while :; do + run_strace -f -qq -enone -esignal=none "../$NAME" "$timeout_2" "$nproc" + + s1="$(date +%s)" + [ "$(($s1-$s0))" -lt "$timeout_8" ] || + break + + nproc="$(($nproc+$inc))" +done + +warn_ "$ME_: nproc=$nproc elapsed=$(($s1-$s0))" diff --git a/tests-m32/lseek.c b/tests-m32/lseek.c index 4428c4e9..0e12bf9c 100644 --- a/tests-m32/lseek.c +++ b/tests-m32/lseek.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/lseek.test b/tests-m32/lseek.test index f96a91d1..646f7313 100755 --- a/tests-m32/lseek.test +++ b/tests-m32/lseek.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check lseek syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -9,7 +14,3 @@ run_prog > /dev/null run_strace -a30 -elseek $args > "$EXP" grep -v '^lseek([0-9]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" - -exit 0 diff --git a/tests-m32/lstat.c b/tests-m32/lstat.c index 3754f766..1a200fe7 100644 --- a/tests-m32/lstat.c +++ b/tests-m32/lstat.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/lstat.gen.test b/tests-m32/lstat.gen.test new file mode 100755 index 00000000..7231c491 --- /dev/null +++ b/tests-m32/lstat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (lstat -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests-m32/lstat.test b/tests-m32/lstat.test deleted file mode 100755 index f513bb48..00000000 --- a/tests-m32/lstat.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check lstat syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests-m32/lstat64.c b/tests-m32/lstat64.c index da06609d..0c0cf879 100644 --- a/tests-m32/lstat64.c +++ b/tests-m32/lstat64.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/lstat64.gen.test b/tests-m32/lstat64.gen.test new file mode 100755 index 00000000..124cce4b --- /dev/null +++ b/tests-m32/lstat64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (lstat64 -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests-m32/lstat64.test b/tests-m32/lstat64.test deleted file mode 100755 index fcafe79d..00000000 --- a/tests-m32/lstat64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check lstat64 syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests-m32/lstatx.c b/tests-m32/lstatx.c index cdd1124b..b49c4055 100644 --- a/tests-m32/lstatx.c +++ b/tests-m32/lstatx.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #define TEST_SYSCALL_INVOKE(sample, pst) \ diff --git a/tests-m32/madvise.c b/tests-m32/madvise.c new file mode 100644 index 00000000..33a7abbe --- /dev/null +++ b/tests-m32/madvise.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +static const char *errstr; + +static long +k_madvise(const kernel_ulong_t addr, + const kernel_ulong_t length, + const kernel_ulong_t advice) +{ + long rc = syscall(__NR_madvise, addr, length, advice); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + const unsigned long length = get_page_size(); + void *const addr = tail_alloc(length); + long rc; + + rc = madvise(addr, length, MADV_NORMAL); + printf("madvise(%p, %lu, MADV_NORMAL) = %s\n", + addr, length, sprintrc(rc)); + + static const kernel_ulong_t advice = + (kernel_ulong_t) 0xfacefeed00000000ULL | MADV_RANDOM; + rc = k_madvise((uintptr_t) addr, length, advice); + printf("madvise(%p, %lu, MADV_RANDOM) = %s\n", + addr, length, sprintrc(rc)); + + static const kernel_ulong_t bogus_length = + (kernel_ulong_t) 0xfffffffffffffaceULL; + rc = k_madvise(0, bogus_length, MADV_SEQUENTIAL); + printf("madvise(NULL, %llu, MADV_SEQUENTIAL) = %s\n", + (unsigned long long) bogus_length, sprintrc(rc)); + + if (F8ILL_KULONG_SUPPORTED) { + rc = k_madvise(f8ill_ptr_to_kulong(addr), length, MADV_NORMAL); + printf("madvise(%#llx, %lu, MADV_NORMAL) = %s\n", + (unsigned long long) f8ill_ptr_to_kulong(addr), + length, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/madvise.gen.test b/tests-m32/madvise.gen.test new file mode 100755 index 00000000..a549cf94 --- /dev/null +++ b/tests-m32/madvise.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (madvise -a33 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 diff --git a/tests-m32/match.awk b/tests-m32/match.awk index abfbae92..d91c5182 100644 --- a/tests-m32/match.awk +++ b/tests-m32/match.awk @@ -1,29 +1,9 @@ #!/bin/gawk # -# Copyright (c) 2014-2015 Dmitry V. Levin +# Copyright (c) 2014-2018 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later # s[] is array of match strings # r[] is array of match patterns diff --git a/tests-m32/mbind.c b/tests-m32/mbind.c index b0544263..8e478a6f 100644 --- a/tests-m32/mbind.c +++ b/tests-m32/mbind.c @@ -1,30 +1,10 @@ /* * Check decoding of mbind syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/mbind.gen.test b/tests-m32/mbind.gen.test new file mode 100755 index 00000000..c47e0fc1 --- /dev/null +++ b/tests-m32/mbind.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mbind ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/mbind.test b/tests-m32/mbind.test deleted file mode 100755 index 2a07cac6..00000000 --- a/tests-m32/mbind.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of mbind syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/membarrier.c b/tests-m32/membarrier.c index 330893b6..0e55497b 100644 --- a/tests-m32/membarrier.c +++ b/tests-m32/membarrier.c @@ -1,28 +1,9 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -44,10 +25,49 @@ main(void) printf("membarrier(0x3 /* MEMBARRIER_CMD_??? */, 255) = %s\n", sprintrc(-1)); if (saved_errno != ENOSYS) { - /* the test needs to be updated? */ - assert(syscall(__NR_membarrier, 0, 0) == 1); - puts("membarrier(MEMBARRIER_CMD_QUERY, 0)" - " = 0x1 (MEMBARRIER_CMD_SHARED)"); + const char *text_global; + const char *text; + int rc = syscall(__NR_membarrier, 0, 0); + + assert(rc >= 0); + + text_global = rc & 1 ? "MEMBARRIER_CMD_GLOBAL" : ""; + + switch (rc & ~1) { + case 0: + text = ""; + break; + case 8: + text = "MEMBARRIER_CMD_PRIVATE_EXPEDITED"; + break; + case 8|16: + text = "MEMBARRIER_CMD_PRIVATE_EXPEDITED|" + "MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED"; + break; + + case 2|4|8|16: + text = "MEMBARRIER_CMD_GLOBAL_EXPEDITED|" + "MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED|" + "MEMBARRIER_CMD_PRIVATE_EXPEDITED|" + "MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED"; + break; + + case 2|4|8|16|32|64: + text = "MEMBARRIER_CMD_GLOBAL_EXPEDITED|" + "MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED|" + "MEMBARRIER_CMD_PRIVATE_EXPEDITED|" + "MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED|" + "MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE|" + "MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE"; + break; + + default: + error_msg_and_fail("membarrier returned %#x, does" + " the test have to be updated?", rc); + } + printf("membarrier(MEMBARRIER_CMD_QUERY, 0) = %#x (%s%s%s)\n", + rc, text_global, text[0] && text_global[0] ? "|" : "", + text); } puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/membarrier.gen.test b/tests-m32/membarrier.gen.test new file mode 100755 index 00000000..6ae6e915 --- /dev/null +++ b/tests-m32/membarrier.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (membarrier -a36 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests-m32/membarrier.test b/tests-m32/membarrier.test deleted file mode 100755 index ad1f713b..00000000 --- a/tests-m32/membarrier.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check membarrier syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a36 diff --git a/tests-m32/memfd_create-Xabbrev.c b/tests-m32/memfd_create-Xabbrev.c new file mode 100644 index 00000000..f738c743 --- /dev/null +++ b/tests-m32/memfd_create-Xabbrev.c @@ -0,0 +1 @@ +#include "memfd_create.c" diff --git a/tests-m32/memfd_create-Xabbrev.gen.test b/tests-m32/memfd_create-Xabbrev.gen.test new file mode 100755 index 00000000..32f3e23e --- /dev/null +++ b/tests-m32/memfd_create-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (memfd_create-Xabbrev -Xabbrev -e trace=memfd_create); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xabbrev -e trace=memfd_create diff --git a/tests-m32/memfd_create-Xraw.c b/tests-m32/memfd_create-Xraw.c new file mode 100644 index 00000000..0673d2d0 --- /dev/null +++ b/tests-m32/memfd_create-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "memfd_create.c" diff --git a/tests-m32/memfd_create-Xraw.gen.test b/tests-m32/memfd_create-Xraw.gen.test new file mode 100755 index 00000000..97bd6029 --- /dev/null +++ b/tests-m32/memfd_create-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (memfd_create-Xraw -a30 -Xraw -e trace=memfd_create); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 -Xraw -e trace=memfd_create diff --git a/tests-m32/memfd_create-Xverbose.c b/tests-m32/memfd_create-Xverbose.c new file mode 100644 index 00000000..4c428c48 --- /dev/null +++ b/tests-m32/memfd_create-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "memfd_create.c" diff --git a/tests-m32/memfd_create-Xverbose.gen.test b/tests-m32/memfd_create-Xverbose.gen.test new file mode 100755 index 00000000..c3c6846e --- /dev/null +++ b/tests-m32/memfd_create-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (memfd_create-Xverbose -Xverbose -e trace=memfd_create); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xverbose -e trace=memfd_create diff --git a/tests-m32/memfd_create.c b/tests-m32/memfd_create.c index 480fd177..2658a1ba 100644 --- a/tests-m32/memfd_create.c +++ b/tests-m32/memfd_create.c @@ -1,3 +1,12 @@ +/* + * Check decoding of memfd_create syscall. + * + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include "scno.h" @@ -5,16 +14,95 @@ #ifdef __NR_memfd_create # include +# include # include +# ifdef HAVE_LINUX_MEMFD_H +# include +# endif + +# ifndef MFD_HUGE_SHIFT +# define MFD_HUGE_SHIFT 26 +# endif + +# ifndef MFD_HUGE_MASK +# define MFD_HUGE_MASK 0x3f +# endif + +static const char *errstr; + +static long +k_memfd_create(const kernel_ulong_t name, const kernel_ulong_t flags) +{ + const long rc = syscall(__NR_memfd_create, name, flags); + errstr = sprintrc(rc); + return rc; +} + int main(void) { - static const char text[] = "strace"; - int rc = syscall(__NR_memfd_create, text, 7); + const size_t size = 255 - (sizeof("memfd:") - 1) + 1; + char *pattern = tail_alloc(size); + fill_memory_ex(pattern, size, '0', 10); + + k_memfd_create((uintptr_t) pattern, 0); + printf("memfd_create(\"%.*s\"..., 0) = %s\n", + (int) size - 1, pattern, errstr); + + kernel_ulong_t flags = (kernel_ulong_t) 0xfacefeed00000007ULL; +# define flags1_str "MFD_CLOEXEC|MFD_ALLOW_SEALING|MFD_HUGETLB" + + k_memfd_create((uintptr_t) pattern, flags); +# if XLAT_VERBOSE + printf("memfd_create(\"%.*s\"..., %s /* %s */) = %s\n", + (int) size - 1, pattern, + "0x7", flags1_str, errstr); +# else + printf("memfd_create(\"%.*s\"..., %s) = %s\n", + (int) size - 1, pattern, +# if XLAT_RAW + "0x7", +# else + flags1_str, +# endif + errstr); +# endif + + pattern[size - 1] = '\0'; + flags = 30 << MFD_HUGE_SHIFT; + k_memfd_create((uintptr_t) pattern, flags); +# if XLAT_RAW + printf("memfd_create(\"%s\", %#x) = %s\n", + pattern, (unsigned int) flags, errstr); +# elif XLAT_VERBOSE + printf("memfd_create(\"%s\", %#x /* %s */) = %s\n", + pattern, (unsigned int) flags, "30< + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/migrate_pages.gen.test b/tests-m32/migrate_pages.gen.test new file mode 100755 index 00000000..0ea017d0 --- /dev/null +++ b/tests-m32/migrate_pages.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (migrate_pages -a33 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 diff --git a/tests-m32/migrate_pages.test b/tests-m32/migrate_pages.test deleted file mode 100755 index fad53b79..00000000 --- a/tests-m32/migrate_pages.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check migrate_pages syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a33 diff --git a/tests-m32/mincore.c b/tests-m32/mincore.c index ea2b49e3..01619b05 100644 --- a/tests-m32/mincore.c +++ b/tests-m32/mincore.c @@ -1,36 +1,15 @@ /* * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include #include -#define DEFAULT_STRLEN 32 - static void print_mincore(const unsigned int pages, void *const addr, const size_t size, unsigned char *const vec) diff --git a/tests-m32/mincore.gen.test b/tests-m32/mincore.gen.test new file mode 100755 index 00000000..45e43e25 --- /dev/null +++ b/tests-m32/mincore.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mincore -a22 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests-m32/mincore.test b/tests-m32/mincore.test deleted file mode 100755 index 6af9f492..00000000 --- a/tests-m32/mincore.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mincore syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a22 diff --git a/tests-m32/mkdir.c b/tests-m32/mkdir.c index d971b188..e6e62ef6 100644 --- a/tests-m32/mkdir.c +++ b/tests-m32/mkdir.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/mkdir.gen.test b/tests-m32/mkdir.gen.test new file mode 100755 index 00000000..8d34c8b2 --- /dev/null +++ b/tests-m32/mkdir.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mkdir -a20 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-m32/mkdir.test b/tests-m32/mkdir.test deleted file mode 100755 index 38ed6928..00000000 --- a/tests-m32/mkdir.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mkdir syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 diff --git a/tests-m32/mkdirat.c b/tests-m32/mkdirat.c index 6bfe4a5f..91bf06be 100644 --- a/tests-m32/mkdirat.c +++ b/tests-m32/mkdirat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/mkdirat.gen.test b/tests-m32/mkdirat.gen.test new file mode 100755 index 00000000..eef8e526 --- /dev/null +++ b/tests-m32/mkdirat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mkdirat -a28 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-m32/mkdirat.test b/tests-m32/mkdirat.test deleted file mode 100755 index 0fcb841a..00000000 --- a/tests-m32/mkdirat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mkdirat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 diff --git a/tests-m32/mknod.c b/tests-m32/mknod.c index 4cc1c5cb..94d80284 100644 --- a/tests-m32/mknod.c +++ b/tests-m32/mknod.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -8,7 +15,7 @@ # include # include -static const char sample[] = "mknod"; +static const char *sample; static long call_mknod(unsigned short mode, unsigned long dev) @@ -18,9 +25,10 @@ call_mknod(unsigned short mode, unsigned long dev) } int -main(void) +main(int ac, char **av) { unsigned long dev = (unsigned long) 0xdeadbeefbadc0dedULL; + sample = av[0]; long rc = call_mknod(0, dev); printf("mknod(\"%s\", 000) = %ld %s (%m)\n", @@ -49,7 +57,7 @@ main(void) dev = (unsigned long) 0xdeadbeef00000000ULL | makedev(1, 7); rc = call_mknod(S_IFCHR | 024, dev); - printf("mknod(\"%s\", S_IFCHR|024, makedev(1, 7)) = %ld %s (%m)\n", + printf("mknod(\"%s\", S_IFCHR|024, makedev(0x1, 0x7)) = %ld %s (%m)\n", sample, rc, errno2name()); const unsigned short mode = (0xffff & ~S_IFMT) | S_IFBLK; @@ -57,8 +65,8 @@ main(void) rc = call_mknod(mode, dev); printf("mknod(\"%s\", S_IFBLK|S_ISUID|S_ISGID|S_ISVTX|%#03ho" - ", makedev(%u, %u)) = %ld %s (%m)\n", - sample, mode & ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX), + ", makedev(%#x, %#x)) = %ld %s (%m)\n", + sample, (short) (mode & ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX)), major((unsigned) dev), minor((unsigned) dev), rc, errno2name()); diff --git a/tests-m32/mknod.gen.test b/tests-m32/mknod.gen.test new file mode 100755 index 00000000..ce08e99f --- /dev/null +++ b/tests-m32/mknod.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mknod -a18 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests-m32/mknod.test b/tests-m32/mknod.test deleted file mode 100755 index 195f1e33..00000000 --- a/tests-m32/mknod.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mknod syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a18 diff --git a/tests-m32/mknodat.c b/tests-m32/mknodat.c index 756e2771..34b34d80 100644 --- a/tests-m32/mknodat.c +++ b/tests-m32/mknodat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -50,7 +57,7 @@ main(void) dev = (unsigned long) 0xdeadbeef00000000ULL | makedev(1, 7); rc = call_mknodat(S_IFCHR | 024, dev); - printf("mknodat(-1, \"%s\", S_IFCHR|024, makedev(1, 7)) = %ld %s (%m)\n", + printf("mknodat(-1, \"%s\", S_IFCHR|024, makedev(0x1, 0x7)) = %ld %s (%m)\n", sample, rc, errno2name()); const unsigned short mode = (0xffff & ~S_IFMT) | S_IFBLK; @@ -58,8 +65,8 @@ main(void) rc = call_mknodat(mode, dev); printf("mknodat(-1, \"%s\", S_IFBLK|S_ISUID|S_ISGID|S_ISVTX|%#03ho" - ", makedev(%u, %u)) = %ld %s (%m)\n", - sample, mode & ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX), + ", makedev(%#x, %#x)) = %ld %s (%m)\n", + sample, (short) (mode & ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX)), major((unsigned) dev), minor((unsigned) dev), rc, errno2name()); diff --git a/tests-m32/mknodat.gen.test b/tests-m32/mknodat.gen.test new file mode 100755 index 00000000..dce7d449 --- /dev/null +++ b/tests-m32/mknodat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mknodat -a35 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests-m32/mknodat.test b/tests-m32/mknodat.test deleted file mode 100755 index 1701a368..00000000 --- a/tests-m32/mknodat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mknodat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a35 diff --git a/tests-m32/mlock.c b/tests-m32/mlock.c index 8e9806bd..0f31d20c 100644 --- a/tests-m32/mlock.c +++ b/tests-m32/mlock.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/mlock.gen.test b/tests-m32/mlock.gen.test new file mode 100755 index 00000000..2c8ea5e1 --- /dev/null +++ b/tests-m32/mlock.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mlock -a20 -e trace=mlock,munlock); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -e trace=mlock,munlock diff --git a/tests-m32/mlock.test b/tests-m32/mlock.test deleted file mode 100755 index 9a73a306..00000000 --- a/tests-m32/mlock.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mlock and munlock syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=mlock,munlock -a20 diff --git a/tests-m32/mlock2.c b/tests-m32/mlock2.c index 71a2003e..23f1cd9a 100644 --- a/tests-m32/mlock2.c +++ b/tests-m32/mlock2.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/mlock2.gen.test b/tests-m32/mlock2.gen.test new file mode 100755 index 00000000..ff94eb89 --- /dev/null +++ b/tests-m32/mlock2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mlock2 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/mlock2.test b/tests-m32/mlock2.test deleted file mode 100755 index bc412e97..00000000 --- a/tests-m32/mlock2.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mlock2 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/mlockall.c b/tests-m32/mlockall.c index 682d070d..20428ce7 100644 --- a/tests-m32/mlockall.c +++ b/tests-m32/mlockall.c @@ -1,30 +1,10 @@ /* * Check decoding of mlockall syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/mlockall.gen.test b/tests-m32/mlockall.gen.test new file mode 100755 index 00000000..59ef67f8 --- /dev/null +++ b/tests-m32/mlockall.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mlockall -a12 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests-m32/mlockall.test b/tests-m32/mlockall.test deleted file mode 100755 index d7a6182d..00000000 --- a/tests-m32/mlockall.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of mlockall syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a12 diff --git a/tests-m32/mmap-Xabbrev.c b/tests-m32/mmap-Xabbrev.c new file mode 100644 index 00000000..b31ce427 --- /dev/null +++ b/tests-m32/mmap-Xabbrev.c @@ -0,0 +1 @@ +#include "mmap.c" diff --git a/tests-m32/mmap-Xabbrev.gen.test b/tests-m32/mmap-Xabbrev.gen.test new file mode 100755 index 00000000..b11a84ff --- /dev/null +++ b/tests-m32/mmap-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmap-Xabbrev +mmap.test abbrev); do not edit. +set -- abbrev +. "${srcdir=.}/mmap.test" diff --git a/tests-m32/mmap-Xraw.c b/tests-m32/mmap-Xraw.c new file mode 100644 index 00000000..ef25c030 --- /dev/null +++ b/tests-m32/mmap-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "mmap.c" diff --git a/tests-m32/mmap-Xraw.gen.test b/tests-m32/mmap-Xraw.gen.test new file mode 100755 index 00000000..3caca91d --- /dev/null +++ b/tests-m32/mmap-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmap-Xraw +mmap.test raw 14); do not edit. +set -- raw 14 +. "${srcdir=.}/mmap.test" diff --git a/tests-m32/mmap-Xverbose.c b/tests-m32/mmap-Xverbose.c new file mode 100644 index 00000000..08e9e305 --- /dev/null +++ b/tests-m32/mmap-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "mmap.c" diff --git a/tests-m32/mmap-Xverbose.gen.test b/tests-m32/mmap-Xverbose.gen.test new file mode 100755 index 00000000..99b41c02 --- /dev/null +++ b/tests-m32/mmap-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmap-Xverbose +mmap.test verbose); do not edit. +set -- verbose +. "${srcdir=.}/mmap.test" diff --git a/tests-m32/mmap.c b/tests-m32/mmap.c index f726f63e..1f6322fe 100644 --- a/tests-m32/mmap.c +++ b/tests-m32/mmap.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -57,25 +38,59 @@ main(int ac, char **av) (void) close(0); (void) close(0); +#if XLAT_RAW + printf("%s(NULL, 0, %#x, %#x, 0, 0) = -1 EBADF (%m)\n", + name, PROT_NONE, MAP_FILE); +#elif XLAT_VERBOSE + printf("%s(NULL, 0, %#x /* PROT_NONE */, %#x /* MAP_FILE */, 0, 0) " + "= -1 EBADF (%m)\n", + name, PROT_NONE, MAP_FILE); +#else printf("%s(NULL, 0, PROT_NONE, MAP_FILE, 0, 0) = -1 EBADF (%m)\n", name); +#endif mmap(NULL, 0, PROT_NONE, MAP_FILE, 0, 0); p = mmap(addr, length1, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, fd, offset); if (MAP_FAILED == p) perror_msg_and_fail("mmap"); +#if XLAT_RAW + printf("%s(%p, %lu, %#x, " + "%#x, %d, %#jx) = %p\n", + name, addr, length1, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, fd, uoffset, p); +#elif XLAT_VERBOSE + printf("%s(%p, %lu, %#x /* PROT_READ|PROT_WRITE */, " + "%#x /* MAP_PRIVATE|MAP_ANONYMOUS */, %d, %#jx) = %p\n", + name, addr, length1, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, fd, uoffset, p); +#else printf("%s(%p, %lu, PROT_READ|PROT_WRITE, " "MAP_PRIVATE|MAP_ANONYMOUS, %d, %#jx) = %p\n", name, addr, length1, fd, uoffset, p); +#endif if (msync(p, length1, MS_SYNC)) perror_msg_and_fail("msync"); +#if XLAT_RAW + printf("msync(%p, %lu, %#x) = 0\n", p, length1, MS_SYNC); +#elif XLAT_VERBOSE + printf("msync(%p, %lu, %#x /* MS_SYNC */) = 0\n", p, length1, MS_SYNC); +#else printf("msync(%p, %lu, MS_SYNC) = 0\n", p, length1); +#endif if (mprotect(p, length1, PROT_NONE)) perror_msg_and_fail("mprotect"); +#if XLAT_RAW + printf("mprotect(%p, %lu, %#x) = 0\n", p, length1, PROT_NONE); +#elif XLAT_VERBOSE + printf("mprotect(%p, %lu, %#x /* PROT_NONE */) = 0\n", + p, length1, PROT_NONE); +#else printf("mprotect(%p, %lu, PROT_NONE) = 0\n", p, length1); +#endif addr = mremap(p, length1, length2, 0); if (MAP_FAILED == addr) @@ -86,20 +101,33 @@ main(int ac, char **av) addr + length2); if (MAP_FAILED == p) perror_msg_and_fail("mremap"); +#if XLAT_RAW + printf("mremap(%p, %lu, %lu, %#x, %p) = %p\n", + addr, length2, length3, MREMAP_MAYMOVE | MREMAP_FIXED, + addr + length2, p); +#elif XLAT_VERBOSE + printf("mremap(%p, %lu, %lu, %#x /* MREMAP_MAYMOVE|MREMAP_FIXED */" + ", %p) = %p\n", + addr, length2, length3, MREMAP_MAYMOVE | MREMAP_FIXED, + addr + length2, p); +#else printf("mremap(%p, %lu, %lu, MREMAP_MAYMOVE|MREMAP_FIXED" ", %p) = %p\n", addr, length2, length3, addr + length2, p); - - if (madvise(p, length3, MADV_NORMAL)) - perror_msg_and_fail("madvise"); - printf("madvise(%p, %lu, MADV_NORMAL) = 0\n", p, length3); +#endif if (munmap(p, length3)) perror_msg_and_fail("munmap"); printf("munmap(%p, %lu) = 0\n", p, length3); - if (mlockall(MCL_FUTURE)) - perror_msg_and_fail("mlockall"); - puts("mlockall(MCL_FUTURE) = 0"); + printf("mlockall("); +#if XLAT_RAW + printf("%#x", MCL_FUTURE); +#elif XLAT_VERBOSE + printf("%#x /* MCL_FUTURE */", MCL_FUTURE); +#else + printf("MCL_FUTURE"); +#endif + printf(") = %s\n", sprintrc(mlockall(MCL_FUTURE))); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/mmap.test b/tests-m32/mmap.test index 0b87114a..a47f0db0 100755 --- a/tests-m32/mmap.test +++ b/tests-m32/mmap.test @@ -4,29 +4,10 @@ # syscalls decoding. # # Copyright (c) 2015-2016 Dmitry V. Levin +# Copyright (c) 2015-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -34,15 +15,20 @@ check_prog grep check_prog sed run_prog > /dev/null +xlat_opt="" +[ "$#" -gt 0 ] && xlat_opt="-X$1" +align=20 +[ "$#" -gt 1 ] && align="$2" + syscall= for n in mmap mmap2; do $STRACE -e$n -h > /dev/null && syscall=$syscall,$n done run_strace -e$syscall $args > /dev/null -if grep '^mmap(NULL, 0, PROT_NONE,' < "$LOG" > /dev/null; then +if grep '^mmap(NULL, 0, \(0 /* PROT_NONE */\|0\|PROT_NONE\),' < "$LOG" > /dev/null; then mmap=mmap -elif grep '^mmap2(NULL, 0, PROT_NONE,' < "$LOG" > /dev/null; then +elif grep '^mmap2(NULL, 0, \(0 \/\* PROT_NONE \*\/\|0\|PROT_NONE\),' < "$LOG" > /dev/null; then mmap=mmap2 else dump_log_and_fail_with "mmap/mmap2 not found in $STRACE $args output" @@ -50,9 +36,7 @@ fi syscall=$mmap,madvise,mlockall,mprotect,mremap,msync,munmap -run_prog "./$NAME" $mmap > /dev/null -run_strace -a20 -e$syscall $args > "$EXP" -sed -n "/^$mmap(NULL, 0, PROT_NONE,/,\$p" < "$LOG" > "$OUT" +run_prog "../$NAME" $mmap > /dev/null +run_strace -a$align -e$syscall $xlat_opt $args > "$EXP" +sed -n "/^$mmap(NULL, 0, \(0 \/\* PROT_NONE \*\/\|0\|PROT_NONE\),/,\$p" < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-m32/mmap64-Xabbrev.c b/tests-m32/mmap64-Xabbrev.c new file mode 100644 index 00000000..cbd77896 --- /dev/null +++ b/tests-m32/mmap64-Xabbrev.c @@ -0,0 +1 @@ +#include "mmap64.c" diff --git a/tests-m32/mmap64-Xabbrev.gen.test b/tests-m32/mmap64-Xabbrev.gen.test new file mode 100755 index 00000000..3e2c94ba --- /dev/null +++ b/tests-m32/mmap64-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmap64-Xabbrev +mmap.test abbrev); do not edit. +set -- abbrev +. "${srcdir=.}/mmap.test" diff --git a/tests-m32/mmap64-Xraw.c b/tests-m32/mmap64-Xraw.c new file mode 100644 index 00000000..f75f235f --- /dev/null +++ b/tests-m32/mmap64-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "mmap64.c" diff --git a/tests-m32/mmap64-Xraw.gen.test b/tests-m32/mmap64-Xraw.gen.test new file mode 100755 index 00000000..7aeed02f --- /dev/null +++ b/tests-m32/mmap64-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmap64-Xraw +mmap.test raw 14); do not edit. +set -- raw 14 +. "${srcdir=.}/mmap.test" diff --git a/tests-m32/mmap64-Xverbose.c b/tests-m32/mmap64-Xverbose.c new file mode 100644 index 00000000..f72513e1 --- /dev/null +++ b/tests-m32/mmap64-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "mmap64.c" diff --git a/tests-m32/mmap64-Xverbose.gen.test b/tests-m32/mmap64-Xverbose.gen.test new file mode 100755 index 00000000..0d675d98 --- /dev/null +++ b/tests-m32/mmap64-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmap64-Xverbose +mmap.test verbose); do not edit. +set -- verbose +. "${srcdir=.}/mmap.test" diff --git a/tests-m32/mmap64.gen.test b/tests-m32/mmap64.gen.test new file mode 100755 index 00000000..0ecd5294 --- /dev/null +++ b/tests-m32/mmap64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmap64 +mmap.test ); do not edit. +set -- +. "${srcdir=.}/mmap.test" diff --git a/tests-m32/mmap64.test b/tests-m32/mmap64.test deleted file mode 100755 index 51f1896e..00000000 --- a/tests-m32/mmap64.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mmap/mprotect/munmap syscalls decoding. -# Target executable was compiled with -D_FILE_OFFSET_BITS=64. - -. "${srcdir=.}/mmap.test" diff --git a/tests-m32/mmsg-silent.c b/tests-m32/mmsg-silent.c index 47d0a504..82e373d2 100644 --- a/tests-m32/mmsg-silent.c +++ b/tests-m32/mmsg-silent.c @@ -1,30 +1,10 @@ /* * Check silent decoding of sendmmsg and recvmmsg syscalls. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/mmsg-silent.gen.test b/tests-m32/mmsg-silent.gen.test new file mode 100755 index 00000000..47863f26 --- /dev/null +++ b/tests-m32/mmsg-silent.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmsg-silent -a25 -e verbose=none -e trace=sendmmsg,recvmmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 -e verbose=none -e trace=sendmmsg,recvmmsg diff --git a/tests-m32/mmsg-silent.test b/tests-m32/mmsg-silent.test deleted file mode 100755 index 775e0ad3..00000000 --- a/tests-m32/mmsg-silent.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check silent decoding of sendmmsg and recvmmsg syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a25 -e verbose=none -e trace=sendmmsg,recvmmsg diff --git a/tests-m32/mmsg.c b/tests-m32/mmsg.c index 88805d16..ab8fdf6e 100644 --- a/tests-m32/mmsg.c +++ b/tests-m32/mmsg.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2014 Masatake YAMATO * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -113,14 +94,16 @@ main(void) " | 00000 %-49s %-16s |\n", w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), - ARRAY_SIZE(w0_iov_), + (unsigned int) ARRAY_SIZE(w0_iov_), LENGTH_OF(w0_c) + LENGTH_OF(w1_c), - w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w1_iov_), + w2_c, LENGTH_OF(w2_c), (unsigned int) ARRAY_SIZE(w1_iov_), LENGTH_OF(w2_c), n_w_mmh, r, - ARRAY_SIZE(w0_iov_), LENGTH_OF(w0_c), w0_d, w0_c, + (unsigned int) ARRAY_SIZE(w0_iov_), + LENGTH_OF(w0_c), w0_d, w0_c, LENGTH_OF(w1_c), w1_d, w1_c, - ARRAY_SIZE(w1_iov_), LENGTH_OF(w2_c), w2_d, w2_c); + (unsigned int) ARRAY_SIZE(w1_iov_), + LENGTH_OF(w2_c), w2_d, w2_c); const unsigned int w_len = LENGTH_OF(w0_c) + LENGTH_OF(w1_c) + LENGTH_OF(w2_c); @@ -184,11 +167,14 @@ main(void) " = %u buffers in vector 1\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - r0_c, r_len, ARRAY_SIZE(r0_iov_), LENGTH_OF(r0_c), - r1_c, r_len, r_len, ARRAY_SIZE(r1_iov_), LENGTH_OF(r1_c), + r0_c, r_len, (unsigned int) ARRAY_SIZE(r0_iov_), + LENGTH_OF(r0_c), r1_c, r_len, r_len, + (unsigned int) ARRAY_SIZE(r1_iov_), LENGTH_OF(r1_c), n_r_mmh, r, - ARRAY_SIZE(r0_iov_), LENGTH_OF(r0_c), r0_d, r0_c, - ARRAY_SIZE(r1_iov_), LENGTH_OF(r1_c), r1_d, r1_c); + (unsigned int) ARRAY_SIZE(r0_iov_), LENGTH_OF(r0_c), + r0_d, r0_c, + (unsigned int) ARRAY_SIZE(r1_iov_), LENGTH_OF(r1_c), + r1_d, r1_c); tprintf("+++ exited with 0 +++\n"); return 0; diff --git a/tests-m32/mmsg.gen.test b/tests-m32/mmsg.gen.test new file mode 100755 index 00000000..4d90e3d2 --- /dev/null +++ b/tests-m32/mmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmsg -e read=0 -e write=1 -e trace=recvmmsg,sendmmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e read=0 -e write=1 -e trace=recvmmsg,sendmmsg diff --git a/tests-m32/mmsg.test b/tests-m32/mmsg.test deleted file mode 100755 index a8148ba8..00000000 --- a/tests-m32/mmsg.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check how iovecs in struct mmsghdr are decoded. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=recvmmsg,sendmmsg -e read=0 -e write=1 diff --git a/tests-m32/mmsg_name-v.gen.test b/tests-m32/mmsg_name-v.gen.test new file mode 100755 index 00000000..e34946fc --- /dev/null +++ b/tests-m32/mmsg_name-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmsg_name-v -v -a25 -e trace=sendmmsg,recvmmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -a25 -e trace=sendmmsg,recvmmsg diff --git a/tests-m32/mmsg_name-v.test b/tests-m32/mmsg_name-v.test deleted file mode 100755 index ab8dfba6..00000000 --- a/tests-m32/mmsg_name-v.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# Check verbose decoding of msg_name* fields of struct msghdr array argument -# of sendmmsg and recvmmsg syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -a25 -e trace=sendmmsg,recvmmsg diff --git a/tests-m32/mmsg_name.c b/tests-m32/mmsg_name.c index a7a55c55..fce004bb 100644 --- a/tests-m32/mmsg_name.c +++ b/tests-m32/mmsg_name.c @@ -3,29 +3,10 @@ * of sendmmsg and recvmmsg syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,8 +21,6 @@ #include "msghdr.h" -#define DEFAULT_STRLEN 32 - #define IOV_MAX1 (IOV_MAX + 1) #ifndef TEST_NAME @@ -77,7 +56,7 @@ print_msghdr(const struct msghdr *const msg, const int user_msg_namelen) } printf("%d, msg_iov=[{iov_base=\"%c\", iov_len=1}]" ", msg_iovlen=1, msg_controllen=0, msg_flags=0}", - (int) msg->msg_namelen, * (char *) msg->msg_iov[0].iov_base); + (int) msg->msg_namelen, *(char *) msg->msg_iov[0].iov_base); } static void @@ -121,9 +100,9 @@ test_mmsg_name(const int send_fd, const int recv_fd) if (i) printf(", "); if (i >= IOV_MAX -# if !VERBOSE +#if !VERBOSE || i >= DEFAULT_STRLEN -# endif +#endif ) { printf("..."); break; @@ -153,7 +132,7 @@ test_mmsg_name(const int send_fd, const int recv_fd) printf("sendmmsg(-1, [{msg_hdr="); print_msghdr(&send_mh[IOV_MAX].msg_hdr, 0); errno = saved_errno; - printf("}, %p], %u, MSG_DONTWAIT) = %d %s (%m)\n", + printf("}, ... /* %p */], %u, MSG_DONTWAIT) = %d %s (%m)\n", &send_mh[IOV_MAX1], 2, rc, errno2name()); rc = send_mmsg(send_fd, send_mh, IOV_MAX1, MSG_DONTWAIT); diff --git a/tests-m32/mmsg_name.gen.test b/tests-m32/mmsg_name.gen.test new file mode 100755 index 00000000..ac542946 --- /dev/null +++ b/tests-m32/mmsg_name.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmsg_name -a25 -e trace=sendmmsg,recvmmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 -e trace=sendmmsg,recvmmsg diff --git a/tests-m32/mmsg_name.test b/tests-m32/mmsg_name.test deleted file mode 100755 index e18c9722..00000000 --- a/tests-m32/mmsg_name.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# Check decoding of msg_name* fields of struct msghdr array argument -# of sendmmsg and recvmmsg syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a25 -e trace=sendmmsg,recvmmsg diff --git a/tests-m32/modify_ldt.c b/tests-m32/modify_ldt.c new file mode 100644 index 00000000..78e370e4 --- /dev/null +++ b/tests-m32/modify_ldt.c @@ -0,0 +1,117 @@ +/* + * Check decoding of modify_ldt syscall. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include + +#if defined __NR_modify_ldt && defined HAVE_STRUCT_USER_DESC + +# include +# include +# include + +# include "print_user_desc.c" + +void +printrc(long rc) +{ +# ifdef __x86_64__ + int err = -rc; + + /* Thanks, long return type of syscall(2) */ + printf("%lld", zero_extend_signed_to_ull(rc)); + + if (err > 0 && err < 0x1000) { + errno = err; + printf(" %s (%m)", errno2name()); + } +# else + printf("%s", sprintrc(rc)); +# endif + + puts(""); +} + +int +main(void) +{ + static const kernel_ulong_t bogus_func = + (kernel_ulong_t) 0xbadc0dedda7a1057ULL; + static const kernel_ulong_t bogus_bytecount = + (kernel_ulong_t) 0xdeadfacefa57beefULL; + + TAIL_ALLOC_OBJECT_CONST_PTR(struct user_desc, us); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, bogus_int); + long rc; + + fill_memory(us, sizeof(*us)); + + rc = syscall(__NR_modify_ldt, 0, 0, 0); + printf("modify_ldt(0, NULL, 0) = "); + printrc(rc); + + rc = syscall(__NR_modify_ldt, bogus_func, (kernel_long_t) -1, + bogus_bytecount); + printf("modify_ldt(%d, %#llx, %llu) = ", + (int) bogus_func, + zero_extend_signed_to_ull((kernel_long_t) -1), + (unsigned long long) bogus_bytecount); + printrc(rc); + + rc = syscall(__NR_modify_ldt, bogus_func, us + 1, 0); + printf("modify_ldt(%d, %p, 0) = ", (int) bogus_func, us + 1); + printrc(rc); + + rc = syscall(__NR_modify_ldt, bogus_func, us, 42); + printf("modify_ldt(%d, %p, 42) = ", (int) bogus_func, us); + printrc(rc); + + rc = syscall(__NR_modify_ldt, bogus_func, us + 1, sizeof(*us)); + printf("modify_ldt(%d, %p, %zu) = ", + (int) bogus_func, us + 1, sizeof(*us)); + printrc(rc); + + /* + * print_user_desc handles entry_number field in a special way for + * get_thread_area syscall, so let's also check here that we don't + * retrieve it accidentally. + */ + rc = syscall(__NR_modify_ldt, bogus_func, bogus_int, sizeof(*us)); + printf("modify_ldt(%d, %p, %zu) = ", + (int) bogus_func, bogus_int, sizeof(*us)); + printrc(rc); + + rc = syscall(__NR_modify_ldt, bogus_func, us, sizeof(*us)); + printf("modify_ldt(%d, ", (int) bogus_func); + print_user_desc(us, NULL); + printf(", %zu) = ", sizeof(*us)); + printrc(rc); + + fill_memory_ex(us, sizeof(*us), 0x55, 80); + us->entry_number = -1; + us->base_addr = 0; + us->limit = 0; + + rc = syscall(__NR_modify_ldt, bogus_func, us, sizeof(*us)); + printf("modify_ldt(%d, ", (int) bogus_func); + print_user_desc(us, "-1"); + printf(", %zu) = ", sizeof(*us)); + printrc(rc); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_modify_ldt && HAVE_STRUCT_USER_DESC"); + +#endif diff --git a/tests-m32/modify_ldt.gen.test b/tests-m32/modify_ldt.gen.test new file mode 100755 index 00000000..1a85b067 --- /dev/null +++ b/tests-m32/modify_ldt.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (modify_ldt -a23 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 diff --git a/tests-m32/mount-Xabbrev.c b/tests-m32/mount-Xabbrev.c new file mode 100644 index 00000000..0f6fecde --- /dev/null +++ b/tests-m32/mount-Xabbrev.c @@ -0,0 +1 @@ +#include "mount.c" diff --git a/tests-m32/mount-Xabbrev.gen.test b/tests-m32/mount-Xabbrev.gen.test new file mode 100755 index 00000000..10e261ff --- /dev/null +++ b/tests-m32/mount-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mount-Xabbrev -a33 -e trace=mount -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -e trace=mount -Xabbrev diff --git a/tests-m32/mount-Xraw.c b/tests-m32/mount-Xraw.c new file mode 100644 index 00000000..3aa1f084 --- /dev/null +++ b/tests-m32/mount-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "mount.c" diff --git a/tests-m32/mount-Xraw.gen.test b/tests-m32/mount-Xraw.gen.test new file mode 100755 index 00000000..ce852f88 --- /dev/null +++ b/tests-m32/mount-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mount-Xraw -a33 -e trace=mount -Xraw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -e trace=mount -Xraw diff --git a/tests-m32/mount-Xverbose.c b/tests-m32/mount-Xverbose.c new file mode 100644 index 00000000..0b211c7a --- /dev/null +++ b/tests-m32/mount-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "mount.c" diff --git a/tests-m32/mount-Xverbose.gen.test b/tests-m32/mount-Xverbose.gen.test new file mode 100755 index 00000000..c780070e --- /dev/null +++ b/tests-m32/mount-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mount-Xverbose -a33 -e trace=mount -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -e trace=mount -Xverbose diff --git a/tests-m32/mount.c b/tests-m32/mount.c index cbfe42f8..05bc310d 100644 --- a/tests-m32/mount.c +++ b/tests-m32/mount.c @@ -2,29 +2,10 @@ * Check decoding of mount syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,7 +21,34 @@ # define MS_RELATIME (1ul << 21) #endif -#define str_ro_nosuid_nodev_noexec "MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC" +#if XLAT_RAW +# define str_unknown "0x300" +# define str_submount_200 "0x4000200" +# define str_mgc_val "0xc0ed0000" +# define str_remount "0x20" +# define str_bind "0x1000" +# define str_ro_nosuid_nodev_noexec "0xf" +# define str_ro_nosuid_nodev_noexec_relatime "0x20000f" +#elif XLAT_VERBOSE +# define str_unknown "0x300 /* MS_??? */" +# define str_submount_200 "0x4000200 /* MS_SUBMOUNT|0x200 */" +# define str_mgc_val "0xc0ed0000 /* MS_MGC_VAL */" +# define str_remount "0x20 /* MS_REMOUNT */" +# define str_bind "0x1000 /* MS_BIND */" +# define str_ro_nosuid_nodev_noexec \ + "0xf /* MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC */" +# define str_ro_nosuid_nodev_noexec_relatime \ + "0x20000f /* MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_RELATIME */" +#else /* !XLAT_RAW && !XLAT_VERBOSE */ +# define str_unknown "0x300 /* MS_??? */" +# define str_submount_200 "MS_SUBMOUNT|0x200" +# define str_mgc_val "MS_MGC_VAL" +# define str_remount "MS_REMOUNT" +# define str_bind "MS_BIND" +# define str_ro_nosuid_nodev_noexec "MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC" +# define str_ro_nosuid_nodev_noexec_relatime \ + "MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_RELATIME" +#endif /* XLAT_RAW, XLAT_VERBOSE */ int main(void) @@ -49,35 +57,59 @@ main(void) static const char target[] = "mount_target"; static const char fstype[] = "mount_fstype"; static const char data[] = "mount_data"; + TAIL_ALLOC_OBJECT_CONST_PTR(char, bogus); + + bogus[0] = 'a'; + + int rc = mount(NULL, NULL, NULL, 0, NULL); + printf("mount(NULL, NULL, NULL, 0, NULL) = %s\n", + sprintrc(rc)); + + rc = mount(bogus, bogus, bogus, 768, bogus); + printf("mount(%p, %p, %p, %s, %p) = %s\n", + bogus, bogus, bogus, str_unknown, bogus, sprintrc(rc)); - int rc = mount(source, target, fstype, 15, data); - printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", + rc = mount(bogus + 1, bogus + 1, bogus + 1, 0x4000200, bogus + 1); + printf("mount(%p, %p, %p, %s, %p) = %s\n", + bogus + 1, bogus + 1, bogus + 1, str_submount_200, + bogus + 1, sprintrc(rc)); + + rc = mount(source, target, fstype, 15, data); + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %s\n", source, target, fstype, str_ro_nosuid_nodev_noexec, - data, rc, errno2name()); + data, sprintrc(rc)); rc = mount(source, target, fstype, MS_RELATIME | 15, data); - printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %s\n", source, target, fstype, - str_ro_nosuid_nodev_noexec "|MS_RELATIME", - data, rc, errno2name()); + str_ro_nosuid_nodev_noexec_relatime, + data, sprintrc(rc)); rc = mount(source, target, fstype, MS_MGC_VAL, data); - printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", - source, target, fstype, "MS_MGC_VAL", data, rc, errno2name()); + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %s\n", + source, target, fstype, str_mgc_val, data, sprintrc(rc)); rc = mount(source, target, fstype, MS_MGC_VAL | 15, data); - printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %s\n", source, target, fstype, - "MS_MGC_VAL|" str_ro_nosuid_nodev_noexec, - data, rc, errno2name()); + str_mgc_val "|" str_ro_nosuid_nodev_noexec, + data, sprintrc(rc)); + + rc = mount(source, target, NULL, MS_REMOUNT, data); + printf("mount(\"%s\", \"%s\", NULL, %s, \"%s\") = %s\n", + source, target, str_remount, data, sprintrc(rc)); rc = mount(source, target, fstype, MS_REMOUNT, data); - printf("mount(\"%s\", \"%s\", %p, %s, \"%s\") = %d %s (%m)\n", - source, target, fstype, "MS_REMOUNT", data, rc, errno2name()); + printf("mount(\"%s\", \"%s\", %p, %s, \"%s\") = %s\n", + source, target, fstype, str_remount, data, sprintrc(rc)); + + rc = mount(source, target, NULL, MS_BIND, data); + printf("mount(\"%s\", \"%s\", NULL, %s, %p) = %s\n", + source, target, str_bind, data, sprintrc(rc)); - rc = mount(source, target, fstype, MS_BIND, data); - printf("mount(\"%s\", \"%s\", %p, %s, %p) = %d %s (%m)\n", - source, target, fstype, "MS_BIND", data, rc, errno2name()); + rc = mount(source, target, fstype, MS_BIND, NULL); + printf("mount(\"%s\", \"%s\", %p, %s, NULL) = %s\n", + source, target, fstype, str_bind, sprintrc(rc)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/mount.gen.test b/tests-m32/mount.gen.test new file mode 100755 index 00000000..2a3639c8 --- /dev/null +++ b/tests-m32/mount.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mount -a33 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 diff --git a/tests-m32/mount.test b/tests-m32/mount.test deleted file mode 100755 index 40fdca95..00000000 --- a/tests-m32/mount.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of mount syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/move_pages-Xabbrev.c b/tests-m32/move_pages-Xabbrev.c new file mode 100644 index 00000000..d0949884 --- /dev/null +++ b/tests-m32/move_pages-Xabbrev.c @@ -0,0 +1 @@ +#include "move_pages.c" diff --git a/tests-m32/move_pages-Xabbrev.gen.test b/tests-m32/move_pages-Xabbrev.gen.test new file mode 100755 index 00000000..4a17a0db --- /dev/null +++ b/tests-m32/move_pages-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (move_pages-Xabbrev -s3 -e trace=move_pages -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 -e trace=move_pages -Xabbrev diff --git a/tests-m32/move_pages-Xraw.c b/tests-m32/move_pages-Xraw.c new file mode 100644 index 00000000..e9a6cc08 --- /dev/null +++ b/tests-m32/move_pages-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "move_pages.c" diff --git a/tests-m32/move_pages-Xraw.gen.test b/tests-m32/move_pages-Xraw.gen.test new file mode 100755 index 00000000..6465b0f9 --- /dev/null +++ b/tests-m32/move_pages-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (move_pages-Xraw -s3 -a36 -e trace=move_pages -Xraw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 -a36 -e trace=move_pages -Xraw diff --git a/tests-m32/move_pages-Xverbose.c b/tests-m32/move_pages-Xverbose.c new file mode 100644 index 00000000..71fcdee6 --- /dev/null +++ b/tests-m32/move_pages-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "move_pages.c" diff --git a/tests-m32/move_pages-Xverbose.gen.test b/tests-m32/move_pages-Xverbose.gen.test new file mode 100755 index 00000000..15e95c94 --- /dev/null +++ b/tests-m32/move_pages-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (move_pages-Xverbose -s3 -e trace=move_pages -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 -e trace=move_pages -Xverbose diff --git a/tests-m32/move_pages.c b/tests-m32/move_pages.c index f4ccafa2..895c7c6f 100644 --- a/tests-m32/move_pages.c +++ b/tests-m32/move_pages.c @@ -2,29 +2,10 @@ * Check decoding of move_pages syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -62,7 +43,7 @@ print_page_array(const void **const pages, break; } } else { - printf("%p", pages + i); + printf("... /* %p */", pages + i); break; } const void *const addr = pages[i]; @@ -98,7 +79,7 @@ print_node_array(const int *const nodes, break; } } else { - printf("%p", nodes + i); + printf("... /* %p */", nodes + i); break; } printf("%d", nodes[i]); @@ -125,8 +106,16 @@ print_status_array(const int *const status, const unsigned long count) if (status[i] >= 0) { printf("%d", status[i]); } else { +# if !XLAT_RAW errno = -status[i]; - printf("%s", errno2name()); +# endif +# if XLAT_RAW + printf("%d", status[i]); +# elif XLAT_VERBOSE + printf("%d /* -%s */", status[i], errno2name()); +# else + printf("-%s", errno2name()); +# endif } } printf("]"); @@ -152,7 +141,13 @@ print_stat_pages(const unsigned long pid, const unsigned long count, } else { print_status_array(status, count); } +# if XLAT_RAW + printf(", 0x2) = %s\n", errstr); +# elif XLAT_VERBOSE + printf(", 0x2 /* MPOL_MF_MOVE */) = %s\n", errstr); +# else /* XLAT_ABBREV */ printf(", MPOL_MF_MOVE) = %s\n", errstr); +# endif } static void @@ -178,7 +173,13 @@ print_move_pages(const unsigned long pid, printf("%p", status); else printf("[]"); +# if XLAT_RAW + printf(", 0x4) = %s\n", errstr); +# elif XLAT_VERBOSE + printf(", 0x4 /* MPOL_MF_MOVE_ALL */) = %s\n", errstr); +# else /* XLAT_ABBREV */ printf(", MPOL_MF_MOVE_ALL) = %s\n", errstr); +# endif } int @@ -190,9 +191,9 @@ main(void) const unsigned page_size = get_page_size(); const void *const page = tail_alloc(page_size); const void *const efault = page + page_size; - const void **pages = tail_alloc(sizeof(*pages)); - int *nodes = tail_alloc(sizeof(*nodes)); - int *status = tail_alloc(sizeof(*status)); + TAIL_ALLOC_OBJECT_VAR_PTR(const void *, pages); + TAIL_ALLOC_OBJECT_VAR_PTR(int, nodes); + TAIL_ALLOC_OBJECT_VAR_PTR(int, status); print_stat_pages(pid, 0, pages, status); print_move_pages(pid, 0, 0, pages, nodes, status); diff --git a/tests-m32/move_pages.gen.test b/tests-m32/move_pages.gen.test new file mode 100755 index 00000000..9d472ef9 --- /dev/null +++ b/tests-m32/move_pages.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (move_pages -s3 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 diff --git a/tests-m32/move_pages.test b/tests-m32/move_pages.test deleted file mode 100755 index f9577172..00000000 --- a/tests-m32/move_pages.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of move_pages syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s3 diff --git a/tests-m32/mq.c b/tests-m32/mq.c index 9c2ffc8e..a083e5a1 100644 --- a/tests-m32/mq.c +++ b/tests-m32/mq.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2015 Elvira Khabirova * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -37,17 +18,19 @@ # include # include -# define NAME "strace-mq.test" - int -main (void) +main(void) { struct mq_attr attr; (void) close(0); - if (mq_open("/" NAME, O_CREAT, 0700, NULL)) + char *name; + if (asprintf(&name, "/strace-mq-%u.sample", getpid()) < 0) + perror_msg_and_fail("asprintf"); + + if (mq_open(name, O_CREAT, 0700, NULL)) perror_msg_and_skip("mq_open"); - printf("mq_open(\"%s\", O_RDONLY|O_CREAT, 0700, NULL) = 0\n", NAME); + printf("mq_open(\"%s\", O_RDONLY|O_CREAT, 0700, NULL) = 0\n", name + 1); if (mq_getattr(0, &attr)) perror_msg_and_skip("mq_getattr"); @@ -63,9 +46,9 @@ main (void) (long long) attr.mq_maxmsg, (long long) attr.mq_msgsize); - if (mq_unlink("/" NAME)) + if (mq_unlink(name)) perror_msg_and_skip("mq_unlink"); - printf("mq_unlink(\"%s\") = 0\n", NAME); + printf("mq_unlink(\"%s\") = 0\n", name + 1); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/mq.gen.test b/tests-m32/mq.gen.test new file mode 100755 index 00000000..8be520d6 --- /dev/null +++ b/tests-m32/mq.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mq -a32 -e trace=mq_getsetattr,mq_open,mq_unlink); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -e trace=mq_getsetattr,mq_open,mq_unlink diff --git a/tests-m32/mq.test b/tests-m32/mq.test deleted file mode 100755 index 746b07b7..00000000 --- a/tests-m32/mq.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of mq_open, mq_getsetattr, and mq_unlink syscalls. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a28 -e trace=mq_getsetattr,mq_open,mq_unlink diff --git a/tests-m32/mq_sendrecv-read.gen.test b/tests-m32/mq_sendrecv-read.gen.test new file mode 100755 index 00000000..278e9b7b --- /dev/null +++ b/tests-m32/mq_sendrecv-read.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mq_sendrecv-read -eread=0 -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -eread=0 -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink diff --git a/tests-m32/mq_sendrecv-read.test b/tests-m32/mq_sendrecv-read.test deleted file mode 100755 index eb4ad75e..00000000 --- a/tests-m32/mq_sendrecv-read.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of mq_open, mq_notify, mq_timedsend, mq_timedreceive syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink -eread=0 -a14 diff --git a/tests-m32/mq_sendrecv-write.gen.test b/tests-m32/mq_sendrecv-write.gen.test new file mode 100755 index 00000000..5963eb41 --- /dev/null +++ b/tests-m32/mq_sendrecv-write.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mq_sendrecv-write -ewrite=0 -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -ewrite=0 -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink diff --git a/tests-m32/mq_sendrecv-write.test b/tests-m32/mq_sendrecv-write.test deleted file mode 100755 index 38277ec6..00000000 --- a/tests-m32/mq_sendrecv-write.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of mq_open, mq_notify, mq_timedsend, mq_timedreceive syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink -ewrite=0 -a14 diff --git a/tests-m32/mq_sendrecv.c b/tests-m32/mq_sendrecv.c index c151542c..7af0f36e 100644 --- a/tests-m32/mq_sendrecv.c +++ b/tests-m32/mq_sendrecv.c @@ -3,29 +3,10 @@ * mq_unlink syscalls. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,7 +21,6 @@ # include # include # include -# include # include # include # include @@ -49,10 +29,6 @@ # include "sigevent.h" -# ifndef MQ_NAME -# define MQ_NAME "mq_sendrecv.sample" -# endif - # ifndef DUMPIO_READ # define DUMPIO_READ 0 # endif @@ -61,6 +37,7 @@ # define DUMPIO_WRITE 0 # endif +static char *mq_name; enum { NUM_ATTRS = 8, @@ -83,7 +60,7 @@ printstr(unsigned char start, unsigned int count) printf("\""); } -#if DUMPIO_READ || DUMPIO_WRITE +# if DUMPIO_READ || DUMPIO_WRITE static void dumpstr(unsigned char start, unsigned int count) { @@ -117,15 +94,15 @@ dumpstr(unsigned char start, unsigned int count) } } } -#endif /* DUMPIO_READ || DUMPIO_WRITE */ +# endif /* DUMPIO_READ || DUMPIO_WRITE */ static void cleanup(void) { long rc; - rc = syscall(__NR_mq_unlink, MQ_NAME); - printf("mq_unlink(\"" MQ_NAME "\") = %s\n", sprintrc(rc)); + rc = syscall(__NR_mq_unlink, mq_name); + printf("mq_unlink(\"%s\") = %s\n", mq_name, sprintrc(rc)); puts("+++ exited with 0 +++"); } @@ -147,9 +124,9 @@ do_send(int fd, char *msg, unsigned int msg_size, struct timespec *tmout, if (cropped) printf("..."); errno = saved_errno; - printf(", %u, 42, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", msg_size, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, - sprintrc(rc)); + printf(", %u, 42, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", msg_size, + (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); errno = saved_errno; if (rc == -1) { @@ -185,9 +162,9 @@ do_recv(int fd, char *msg, unsigned int msg_size, struct timespec *tmout, printf("%p", msg); } errno = saved_errno; - printf(", %u, [42], {tv_sec=%jd, tv_nsec=%jd}) = %s\n", MSG_SIZE, - (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, sprintrc(rc)); + printf(", %u, [42], {tv_sec=%lld, tv_nsec=%llu}) = %s\n", MSG_SIZE, + (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); errno = saved_errno; if (rc == -1) { @@ -230,7 +207,7 @@ main(void) static const struct timespec future_tmout_data = { .tv_sec = (time_t) 0x7ea1fade7e57faceLL, .tv_nsec = 999999999, - };; + }; struct_sigevent bogus_sev_data = { .sigev_notify = 0xdefaced, .sigev_signo = 0xfacefeed, @@ -242,7 +219,7 @@ main(void) kernel_long_t *bogus_attrs = tail_alloc(sizeof(*bogus_attrs) * NUM_ATTRS); char *msg = tail_alloc(MSG_SIZE); - unsigned *bogus_prio_ptr = tail_alloc(sizeof(*bogus_prio_ptr)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned, bogus_prio_ptr); struct timespec *bogus_tmout = tail_memdup(&bogus_tmout_data, sizeof(*bogus_tmout)); struct timespec *future_tmout = tail_memdup(&future_tmout_data, @@ -278,8 +255,8 @@ main(void) /* Valid attributes structure */ rc = syscall(__NR_mq_open, msg, O_CREAT | bogus_oflags, bogus_mode, bogus_attrs); - printf("mq_open(%p, O_ACCMODE|O_CREAT, %#o, {mq_flags=%#llx, " - "mq_maxmsg=%lld, mq_msgsize=%lld, mq_curmsgs=%lld}) = %s\n", + printf("mq_open(%p, O_ACCMODE|O_CREAT, %#o, {mq_flags=%#llx" + ", mq_maxmsg=%lld, mq_msgsize=%lld, mq_curmsgs=%lld}) = %s\n", msg, (unsigned short) bogus_mode, (unsigned long long) (kernel_ulong_t) bogus_attrs[0], (long long) bogus_attrs[1], @@ -304,12 +281,12 @@ main(void) /* Partially invalid message (memory only partially available) */ rc = syscall(__NR_mq_timedsend, bogus_fd, msg + MSG_SIZE - MSG_CUT, MSG_SIZE, bogus_prio, bogus_tmout); - printf("mq_timedsend(%d, %p, %llu, %u, {tv_sec=%jd, tv_nsec=%jd}) = " - "%s\n", + printf("mq_timedsend(%d, %p, %llu, %u, {tv_sec=%lld, tv_nsec=%llu})" + " = %s\n", (int) bogus_fd, msg + MSG_SIZE - MSG_CUT, (unsigned long long) MSG_SIZE, (unsigned) bogus_prio, - (intmax_t) bogus_tmout->tv_sec, (intmax_t) bogus_tmout->tv_nsec, - sprintrc(rc)); + (long long) bogus_tmout->tv_sec, + zero_extend_signed_to_ull(bogus_tmout->tv_nsec), sprintrc(rc)); /* Fully valid message, uncut */ rc = syscall(__NR_mq_timedsend, bogus_fd, msg + MSG_SIZE - MSG_CUT, @@ -317,10 +294,10 @@ main(void) errstr = sprintrc(rc); printf("mq_timedsend(%d, ", (int) bogus_fd); printstr(MSG_START + MSG_SIZE - MSG_CUT, MSG_CUT); - printf(", %llu, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + printf(", %llu, %u, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", (unsigned long long) MSG_CUT, (unsigned) bogus_prio, - (intmax_t) bogus_tmout->tv_sec, (intmax_t) bogus_tmout->tv_nsec, - errstr); + (long long) bogus_tmout->tv_sec, + zero_extend_signed_to_ull(bogus_tmout->tv_nsec), errstr); /* Partially invalid message, cut at maxstrlen */ rc = syscall(__NR_mq_timedsend, bogus_fd, msg + MSG_CUT, MSG_SIZE, @@ -328,10 +305,10 @@ main(void) errstr = sprintrc(rc); printf("mq_timedsend(%d, ", (int) bogus_fd); printstr(MSG_START + MSG_CUT, MSG_MAX_UNCUT); - printf("..., %llu, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + printf("..., %llu, %u, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", (unsigned long long) MSG_SIZE, (unsigned) bogus_prio, - (intmax_t) bogus_tmout->tv_sec, (intmax_t) bogus_tmout->tv_nsec, - errstr); + (long long) bogus_tmout->tv_sec, + zero_extend_signed_to_ull(bogus_tmout->tv_nsec), errstr); /* mq_timedreceive */ @@ -351,11 +328,11 @@ main(void) /* Invalid fd, valid msg pointer */ rc = syscall(__NR_mq_timedreceive, bogus_fd, msg, bogus_size, bogus_prio_ptr, bogus_tmout); - printf("mq_timedreceive(%d, %p, %llu, %p, {tv_sec=%jd, tv_nsec=%jd}) = " - "%s\n", + printf("mq_timedreceive(%d, %p, %llu, %p, {tv_sec=%lld, tv_nsec=%llu}) " + "= %s\n", (int) bogus_fd, msg, (unsigned long long) bogus_size, - bogus_prio_ptr, (intmax_t) bogus_tmout->tv_sec, - (intmax_t) bogus_tmout->tv_nsec, sprintrc(rc)); + bogus_prio_ptr, (long long) bogus_tmout->tv_sec, + zero_extend_signed_to_ull(bogus_tmout->tv_nsec), sprintrc(rc)); /* mq_notify */ @@ -381,8 +358,8 @@ main(void) /* SIGEV_NONE */ bogus_sev->sigev_notify = SIGEV_NONE; rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); - printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}, " - "sigev_signo=%u, sigev_notify=SIGEV_NONE}) = %s\n", + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}" + ", sigev_signo=%u, sigev_notify=SIGEV_NONE}) = %s\n", (int) bogus_fd, bogus_sev->sigev_value.sival_int, bogus_sev->sigev_value.sival_ptr, bogus_sev->sigev_signo, sprintrc(rc)); @@ -391,8 +368,8 @@ main(void) bogus_sev->sigev_notify = SIGEV_SIGNAL; bogus_sev->sigev_signo = SIGALRM; rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); - printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}, " - "sigev_signo=SIGALRM, sigev_notify=SIGEV_SIGNAL}) = %s\n", + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}" + ", sigev_signo=SIGALRM, sigev_notify=SIGEV_SIGNAL}) = %s\n", (int) bogus_fd, bogus_sev->sigev_value.sival_int, bogus_sev->sigev_value.sival_ptr, sprintrc(rc)); @@ -403,10 +380,10 @@ main(void) bogus_sev->sigev_un.sigev_thread.attribute = (unsigned long) 0xcafef00dfacefeedULL; rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); - printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}, " - "sigev_signo=SIGALRM, sigev_notify=SIGEV_THREAD, " - "sigev_notify_function=%#lx, sigev_notify_attributes=%#lx}) = " - "%s\n", + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}" + ", sigev_signo=SIGALRM, sigev_notify=SIGEV_THREAD" + ", sigev_notify_function=%#lx, sigev_notify_attributes=%#lx})" + " = %s\n", (int) bogus_fd, bogus_sev->sigev_value.sival_int, bogus_sev->sigev_value.sival_ptr, bogus_sev->sigev_un.sigev_thread.function, @@ -430,13 +407,16 @@ main(void) /* Sending and receiving test */ + if (asprintf(&mq_name, "strace-mq_sendrecv-%u.sample", getpid()) < 0) + perror_msg_and_fail("asprintf"); + # if DUMPIO_READ || DUMPIO_WRITE close(0); # endif bogus_attrs[1] = 2; bogus_attrs[2] = MSG_SIZE; - fd = rc = syscall(__NR_mq_open, MQ_NAME, - O_CREAT|O_RDWR|O_NONBLOCK, S_IRWXU, bogus_attrs); + fd = rc = syscall(__NR_mq_open, mq_name, + O_CREAT|O_RDWR|O_NONBLOCK, S_IRWXU, bogus_attrs); errstr = sprintrc(rc); if (rc < 0) perror_msg_and_skip("mq_open"); @@ -448,11 +428,11 @@ main(void) # endif fill_memory_ex(bogus_attrs, sizeof(*bogus_attrs) * NUM_ATTRS, 0xbb, 0x70); - printf("mq_open(\"" MQ_NAME "\", O_RDWR|O_CREAT|O_NONBLOCK, " - "0700, {mq_flags=%#llx, mq_maxmsg=2, mq_msgsize=%u, " - "mq_curmsgs=%lld}) = %s\n", - (unsigned long long) (kernel_ulong_t) bogus_attrs[0], MSG_SIZE, - (long long) bogus_attrs[3], errstr); + printf("mq_open(\"%s\", O_RDWR|O_CREAT|O_NONBLOCK, 0700" + ", {mq_flags=%#llx, mq_maxmsg=2, mq_msgsize=%u" + ", mq_curmsgs=%lld}) = %s\n", + mq_name, (unsigned long long) (kernel_ulong_t) bogus_attrs[0], + MSG_SIZE, (long long) bogus_attrs[3], errstr); rc = syscall(__NR_mq_getsetattr, fd, NULL, bogus_attrs); if (rc < 0) diff --git a/tests-m32/mq_sendrecv.gen.test b/tests-m32/mq_sendrecv.gen.test new file mode 100755 index 00000000..d82576f9 --- /dev/null +++ b/tests-m32/mq_sendrecv.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mq_sendrecv -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink diff --git a/tests-m32/mq_sendrecv.test b/tests-m32/mq_sendrecv.test deleted file mode 100755 index 67f4d63c..00000000 --- a/tests-m32/mq_sendrecv.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of mq_open, mq_notify, mq_timedsend, mq_timedreceive syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink -a14 diff --git a/tests-m32/msg_control-v.gen.test b/tests-m32/msg_control-v.gen.test new file mode 100755 index 00000000..0a0de15e --- /dev/null +++ b/tests-m32/msg_control-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (msg_control-v -v -a21 -e trace=sendmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -a21 -e trace=sendmsg diff --git a/tests-m32/msg_control-v.test b/tests-m32/msg_control-v.test deleted file mode 100755 index 41f98428..00000000 --- a/tests-m32/msg_control-v.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check verbose decoding of struct msghdr ancillary data. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -a21 -e trace=sendmsg diff --git a/tests-m32/msg_control.c b/tests-m32/msg_control.c index 709a3075..a4a32a88 100644 --- a/tests-m32/msg_control.c +++ b/tests-m32/msg_control.c @@ -2,29 +2,10 @@ * Check decoding of struct msghdr ancillary data. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -39,6 +20,17 @@ #include #include +#if defined HAVE_STRUCT___KERNEL_SOCK_TIMEVAL \ + || defined HAVE_STRUCT___KERNEL_TIMESPEC +# include +#endif + +#include "xlat.h" +#define XLAT_MACROS_ONLY +#include "xlat/sock_options.h" +#include "xlat/scmvals.h" +#undef XLAT_MACROS_ONLY + #ifndef SOL_IP # define SOL_IP 0 #endif @@ -46,10 +38,6 @@ # define SOL_TCP 6 #endif -#ifndef SCM_SECURITY -# define SCM_SECURITY 3 -#endif - #define MIN_SIZE_OF(type, member) \ (offsetof(type, member) + sizeof(((type *) 0)->member)) @@ -59,8 +47,6 @@ get_cmsghdr(void *const page, const size_t len) return page - CMSG_ALIGN(len); } -#define DEFAULT_STRLEN 32 - static void print_fds(const struct cmsghdr *const cmsg, const size_t cmsg_len) { @@ -130,7 +116,7 @@ test_scm_rights1(struct msghdr *const mh, print_fds(cmsg, src_len); printf("}"); if (aligned_cms_len < msg_controllen) - printf(", %p", (void *) cmsg + aligned_cms_len); + printf(", ... /* %p */", (void *) cmsg + aligned_cms_len); printf("]"); } @@ -193,7 +179,7 @@ test_scm_rights2(struct msghdr *const mh, print_fds(cmsg[1], src1_len); printf("}"); if (aligned_cms_len[1] < msg_controllen1) - printf(", %p", (void *) cmsg[1] + aligned_cms_len[1]); + printf(", ... /* %p */", (void *) cmsg[1] + aligned_cms_len[1]); printf("]"); errno = saved_errno; @@ -228,6 +214,308 @@ test_scm_rights3(struct msghdr *const mh, void *const page, const size_t nfds) (unsigned long) len, rc, errno2name()); } +static void +test_scm_timestamp_old(struct msghdr *const mh, void *const page) +{ + size_t len = CMSG_SPACE(sizeof(struct timeval)); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct timeval)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMP_OLD; + struct timeval *tv = (struct timeval *) CMSG_DATA(cmsg); + tv->tv_sec = 123456789; + tv->tv_usec = 987654; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMP_OLD" + ", cmsg_data={tv_sec=%lld, tv_usec=%llu}}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, + (long long) tv->tv_sec, zero_extend_signed_to_ull(tv->tv_usec), + (unsigned long) len, rc, errno2name()); + + len = CMSG_SPACE(sizeof(struct timeval) - sizeof(long)); + cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct timeval) - sizeof(long)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMP_OLD; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMP_OLD, cmsg_data=?}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, + (unsigned long) len, rc, errno2name()); +} + +static void +test_scm_timestampns_old(struct msghdr *const mh, void *const page) +{ + size_t len = CMSG_SPACE(sizeof(struct timespec)); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct timespec)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPNS_OLD; + struct timespec *ts = (struct timespec *) CMSG_DATA(cmsg); + ts->tv_sec = 123456789; + ts->tv_nsec = 987654321; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPNS_OLD" + ", cmsg_data={tv_sec=%lld, tv_nsec=%llu}}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, + (long long) ts->tv_sec, zero_extend_signed_to_ull(ts->tv_nsec), + (unsigned long) len, rc, errno2name()); + + len = CMSG_SPACE(sizeof(struct timespec) - sizeof(long)); + cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct timespec) - sizeof(long)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPNS_OLD; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPNS_OLD" + ", cmsg_data=?}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, + (unsigned long) len, rc, errno2name()); +} + +static void +test_scm_timestamping_old(struct msghdr *const mh, void *const page) +{ + size_t len = CMSG_SPACE(3 * sizeof(struct timespec)); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(3 * sizeof(struct timespec)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPING_OLD; + struct timespec *ts = (struct timespec *) CMSG_DATA(cmsg); + ts[0].tv_sec = 123456789; + ts[0].tv_nsec = 987654321; + ts[1].tv_sec = 123456790; + ts[1].tv_nsec = 987654320; + ts[2].tv_sec = 123456791; + ts[2].tv_nsec = 987654319; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPING_OLD" + ", cmsg_data=[{tv_sec=%lld, tv_nsec=%llu}" + ", {tv_sec=%lld, tv_nsec=%llu}, {tv_sec=%lld, tv_nsec=%llu}]}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, (long long) ts[0].tv_sec, + zero_extend_signed_to_ull(ts[0].tv_nsec), + (long long) ts[1].tv_sec, + zero_extend_signed_to_ull(ts[1].tv_nsec), + (long long) ts[2].tv_sec, + zero_extend_signed_to_ull(ts[2].tv_nsec), + (unsigned long) len, rc, errno2name()); + + len = CMSG_SPACE(3 * sizeof(struct timespec) - sizeof(long)); + cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(3 * sizeof(struct timespec) - sizeof(long)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPING_OLD; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPING_OLD" + ", cmsg_data=?}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, + (unsigned long) len, rc, errno2name()); +} + +#ifdef HAVE_STRUCT___KERNEL_SOCK_TIMEVAL +static void +test_scm_timestamp_new(struct msghdr *const mh, void *const page) +{ + size_t len = CMSG_SPACE(sizeof(struct __kernel_sock_timeval)); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct __kernel_sock_timeval)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMP_NEW; + struct __kernel_sock_timeval *tv = + (struct __kernel_sock_timeval *) CMSG_DATA(cmsg); + tv->tv_sec = 0xdefaceddeadbeef; + tv->tv_usec = 0xdec0dedcafef00d; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMP_NEW" + ", cmsg_data={tv_sec=%lld, tv_usec=%llu}}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %s\n", + (unsigned) cmsg->cmsg_len, + (long long) tv->tv_sec, zero_extend_signed_to_ull(tv->tv_usec), + (unsigned long) len, sprintrc(rc)); + + len = CMSG_SPACE(sizeof(struct __kernel_sock_timeval) - sizeof(long)); + cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = + CMSG_LEN(sizeof(struct __kernel_sock_timeval) - sizeof(long)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMP_NEW; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMP_NEW, cmsg_data=?}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %s\n", + (unsigned) cmsg->cmsg_len, + (unsigned long) len, sprintrc(rc)); +} +#endif /* HAVE_STRUCT___KERNEL_SOCK_TIMEVAL */ + +#ifdef HAVE_STRUCT___KERNEL_TIMESPEC +static void +test_scm_timestampns_new(struct msghdr *const mh, void *const page) +{ + size_t len = CMSG_SPACE(sizeof(struct __kernel_timespec)); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct __kernel_timespec)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPNS_NEW; + struct __kernel_timespec *ts = + (struct __kernel_timespec *) CMSG_DATA(cmsg); + ts->tv_sec = 0xdefaceddeadbeef; + ts->tv_nsec = 0xdec0dedcafef00d; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPNS_NEW" + ", cmsg_data={tv_sec=%lld, tv_nsec=%llu}}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %s\n", + (unsigned) cmsg->cmsg_len, + (long long) ts->tv_sec, zero_extend_signed_to_ull(ts->tv_nsec), + (unsigned long) len, sprintrc(rc)); + + len = CMSG_SPACE(sizeof(struct __kernel_timespec) - sizeof(long)); + cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = + CMSG_LEN(sizeof(struct __kernel_timespec) - sizeof(long)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPNS_NEW; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPNS_NEW" + ", cmsg_data=?}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %s\n", + (unsigned) cmsg->cmsg_len, + (unsigned long) len, sprintrc(rc)); +} + +static void +test_scm_timestamping_new(struct msghdr *const mh, void *const page) +{ + size_t len = CMSG_SPACE(3 * sizeof(struct __kernel_timespec)); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(3 * sizeof(struct __kernel_timespec)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPING_NEW; + struct __kernel_timespec *ts = + (struct __kernel_timespec *) CMSG_DATA(cmsg); + ts[0].tv_sec = 0xdeface0deadbef1; + ts[0].tv_nsec = 0xdec0de2cafef0d3; + ts[1].tv_sec = 0xdeface4deadbef5; + ts[1].tv_nsec = 0xdec0de6cafef0d7; + ts[2].tv_sec = 0xdeface8deadbef9; + ts[2].tv_nsec = 0xdec0dedcafef00d; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPING_NEW" + ", cmsg_data=[{tv_sec=%lld, tv_nsec=%llu}" + ", {tv_sec=%lld, tv_nsec=%llu}, {tv_sec=%lld, tv_nsec=%llu}]}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %s\n", + (unsigned) cmsg->cmsg_len, (long long) ts[0].tv_sec, + zero_extend_signed_to_ull(ts[0].tv_nsec), + (long long) ts[1].tv_sec, + zero_extend_signed_to_ull(ts[1].tv_nsec), + (long long) ts[2].tv_sec, + zero_extend_signed_to_ull(ts[2].tv_nsec), + (unsigned long) len, sprintrc(rc)); + + len = CMSG_SPACE(3 * sizeof(struct __kernel_timespec) - sizeof(long)); + cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = + CMSG_LEN(3 * sizeof(struct __kernel_timespec) - sizeof(long)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPING_NEW; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPING_NEW" + ", cmsg_data=?}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %s\n", + (unsigned) cmsg->cmsg_len, + (unsigned long) len, sprintrc(rc)); +} +#endif /* HAVE_STRUCT___KERNEL_TIMESPEC */ + static void print_security(const struct cmsghdr *const cmsg, const size_t cmsg_len) { @@ -277,7 +565,7 @@ test_scm_security(struct msghdr *const mh, print_security(cmsg, src_len); printf("}"); if (aligned_cms_len < msg_controllen) - printf(", %p", (void *) cmsg + aligned_cms_len); + printf(", ... /* %p */", (void *) cmsg + aligned_cms_len); printf("]"); errno = saved_errno; @@ -377,12 +665,23 @@ test_sol_socket(struct msghdr *const mh, void *const page) test_scm_rights3(mh, page, DEFAULT_STRLEN); test_scm_rights3(mh, page, DEFAULT_STRLEN + 1); + test_scm_timestamp_old(mh, page); + test_scm_timestampns_old(mh, page); + test_scm_timestamping_old(mh, page); +#ifdef HAVE_STRUCT___KERNEL_SOCK_TIMEVAL + test_scm_timestamp_new(mh, page); +#endif +#ifdef HAVE_STRUCT___KERNEL_TIMESPEC + test_scm_timestampns_new(mh, page); + test_scm_timestamping_new(mh, page); +#endif + test_unknown_type(mh, page, ARG_STR(SOL_SOCKET), "SCM_???"); } static void test_ip_pktinfo(struct msghdr *const mh, void *const page, - const int cmsg_type, const char *const cmsg_type_str) + const int cmsg_type, const char *const cmsg_type_str) { const unsigned int len = CMSG_SPACE(sizeof(struct in_pktinfo)); struct cmsghdr *const cmsg = get_cmsghdr(page, len); @@ -392,11 +691,7 @@ test_ip_pktinfo(struct msghdr *const mh, void *const page, cmsg->cmsg_type = cmsg_type; struct in_pktinfo *const info = (struct in_pktinfo *) CMSG_DATA(cmsg); -#ifdef HAVE_IF_INDEXTONAME - info->ipi_ifindex = if_nametoindex("lo"); -#else - info->ipi_ifindex = 1; -#endif + info->ipi_ifindex = ifindex_lo(); info->ipi_spec_dst.s_addr = inet_addr("1.2.3.4"); info->ipi_addr.s_addr = inet_addr("5.6.7.8"); @@ -411,12 +706,7 @@ test_ip_pktinfo(struct msghdr *const mh, void *const page, ", ipi_addr=inet_addr(\"%s\")}}]" ", msg_controllen=%u, msg_flags=0}, 0) = %d %s (%m)\n", (unsigned) cmsg->cmsg_len, cmsg_type_str, -#ifdef HAVE_IF_INDEXTONAME - "if_nametoindex(\"lo\")", -#else - "1", -#endif - "1.2.3.4", "5.6.7.8", len, rc, errno2name()); + IFINDEX_LO_STR, "1.2.3.4", "5.6.7.8", len, rc, errno2name()); } static void @@ -447,7 +737,7 @@ test_ip_uint(struct msghdr *const mh, void *const page, static void test_ip_uint8_t(struct msghdr *const mh, void *const page, - const int cmsg_type, const char *const cmsg_type_str) + const int cmsg_type, const char *const cmsg_type_str) { const unsigned int len = CMSG_SPACE(1); struct cmsghdr *const cmsg = get_cmsghdr(page, len); @@ -529,7 +819,7 @@ struct sock_ee { static void test_ip_recverr(struct msghdr *const mh, void *const page, - const int cmsg_type, const char *const cmsg_type_str) + const int cmsg_type, const char *const cmsg_type_str) { const unsigned int len = CMSG_SPACE(sizeof(struct sock_ee)); struct cmsghdr *const cmsg = get_cmsghdr(page, len); @@ -689,7 +979,7 @@ int main(int ac, const char **av) int rc = sendmsg(-1, 0, 0); printf("sendmsg(-1, NULL, 0) = %d %s (%m)\n", rc, errno2name()); - struct msghdr *mh = tail_alloc(sizeof(*mh)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct msghdr, mh); memset(mh, 0, sizeof(*mh)); test_big_len(mh); diff --git a/tests-m32/msg_control.gen.test b/tests-m32/msg_control.gen.test new file mode 100755 index 00000000..446ebcb3 --- /dev/null +++ b/tests-m32/msg_control.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (msg_control -a21 -e trace=sendmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 -e trace=sendmsg diff --git a/tests-m32/msg_control.test b/tests-m32/msg_control.test deleted file mode 100755 index 809ec7bb..00000000 --- a/tests-m32/msg_control.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of struct msghdr ancillary data. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a21 -e trace=sendmsg diff --git a/tests-m32/msg_name.c b/tests-m32/msg_name.c index c2ddda2a..d4973e08 100644 --- a/tests-m32/msg_name.c +++ b/tests-m32/msg_name.c @@ -2,29 +2,10 @@ * Check decoding of struct msghdr.msg_name* arguments of recvmsg syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -47,13 +28,13 @@ send_recv(const int send_fd, const int recv_fd, static void test_msg_name(const int send_fd, const int recv_fd) { - char *const recv_buf = tail_alloc(sizeof(*recv_buf)); - struct iovec *const iov = tail_alloc(sizeof(*iov)); + TAIL_ALLOC_OBJECT_CONST_PTR(char, recv_buf); + TAIL_ALLOC_OBJECT_CONST_PTR(struct iovec, iov); iov->iov_base = recv_buf; iov->iov_len = sizeof(*recv_buf); - struct sockaddr_un *const addr = tail_alloc(sizeof(*addr)); - struct msghdr *const msg = tail_alloc(sizeof(*msg)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sockaddr_un, addr); + TAIL_ALLOC_OBJECT_CONST_PTR(struct msghdr, msg); msg->msg_name = addr; msg->msg_namelen = sizeof(*addr); msg->msg_iov = iov; diff --git a/tests-m32/msg_name.gen.test b/tests-m32/msg_name.gen.test new file mode 100755 index 00000000..2d0ae902 --- /dev/null +++ b/tests-m32/msg_name.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (msg_name -a20 -e trace=recvmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -e trace=recvmsg diff --git a/tests-m32/msg_name.test b/tests-m32/msg_name.test deleted file mode 100755 index ac06dd55..00000000 --- a/tests-m32/msg_name.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of struct msghdr.msg_name* arguments of recvmsg syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 -e trace=recvmsg diff --git a/tests-m32/munlockall.c b/tests-m32/munlockall.c index 9ac69423..0f103c8f 100644 --- a/tests-m32/munlockall.c +++ b/tests-m32/munlockall.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -6,7 +13,7 @@ int main(void) { - printf("munlockall() = %d\n", munlockall()); + printf("munlockall() = %s\n", sprintrc(munlockall())); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/munlockall.gen.test b/tests-m32/munlockall.gen.test new file mode 100755 index 00000000..2e4e0c4f --- /dev/null +++ b/tests-m32/munlockall.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (munlockall -a13 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 diff --git a/tests-m32/munlockall.test b/tests-m32/munlockall.test deleted file mode 100755 index e25d60a8..00000000 --- a/tests-m32/munlockall.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check munlockall syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a13 diff --git a/tests-m32/nanosleep.c b/tests-m32/nanosleep.c index 9f0e626f..c7ebf496 100644 --- a/tests-m32/nanosleep.c +++ b/tests-m32/nanosleep.c @@ -1,28 +1,11 @@ /* + * Check decoding of nanosleep syscall. + * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -57,40 +40,62 @@ main(void) if (nanosleep(&req.ts, NULL)) perror_msg_and_fail("nanosleep"); - printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, NULL) = 0\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec); + printf("nanosleep({tv_sec=%lld, tv_nsec=%llu}, NULL) = 0\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec)); assert(nanosleep(NULL, &rem.ts) == -1); printf("nanosleep(NULL, %p) = -1 EFAULT (%m)\n", &rem.ts); if (nanosleep(&req.ts, &rem.ts)) perror_msg_and_fail("nanosleep"); - printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, %p) = 0\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + printf("nanosleep({tv_sec=%lld, tv_nsec=%llu}, %p) = 0\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); req.ts.tv_nsec = 1000000000; assert(nanosleep(&req.ts, &rem.ts) == -1); - printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, %p) = -1 EINVAL (%m)\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + printf("nanosleep({tv_sec=%lld, tv_nsec=%llu}, %p) = -1 EINVAL (%m)\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); + + req.ts.tv_sec = 0xdeadbeefU; + req.ts.tv_nsec = 0xfacefeedU; + assert(nanosleep(&req.ts, &rem.ts) == -1); + printf("nanosleep({tv_sec=%lld, tv_nsec=%llu}, %p) = -1 EINVAL (%m)\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); + + req.ts.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + req.ts.tv_nsec = (long) 0xbadc0dedfacefeedLL; + assert(nanosleep(&req.ts, &rem.ts) == -1); + printf("nanosleep({tv_sec=%lld, tv_nsec=%llu}, %p) = -1 EINVAL (%m)\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); + + req.ts.tv_sec = -1; + req.ts.tv_nsec = -1; + assert(nanosleep(&req.ts, &rem.ts) == -1); + printf("nanosleep({tv_sec=%lld, tv_nsec=%llu}, %p) = -1 EINVAL (%m)\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); assert(sigaction(SIGALRM, &act, NULL) == 0); assert(sigprocmask(SIG_SETMASK, &set, NULL) == 0); if (setitimer(ITIMER_REAL, &itv, NULL)) perror_msg_and_skip("setitimer"); - printf("setitimer(ITIMER_REAL, {it_interval={tv_sec=%jd, tv_usec=%jd}" - ", it_value={tv_sec=%jd, tv_usec=%jd}}, NULL) = 0\n", - (intmax_t) itv.it_interval.tv_sec, - (intmax_t) itv.it_interval.tv_usec, - (intmax_t) itv.it_value.tv_sec, - (intmax_t) itv.it_value.tv_usec); + req.ts.tv_sec = 0; req.ts.tv_nsec = 999999999; assert(nanosleep(&req.ts, &rem.ts) == -1); - printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, {tv_sec=%jd, tv_nsec=%jd})" + printf("nanosleep({tv_sec=%lld, tv_nsec=%llu}" + ", {tv_sec=%lld, tv_nsec=%llu})" " = ? ERESTART_RESTARTBLOCK (Interrupted by signal)\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, - (intmax_t) rem.ts.tv_sec, (intmax_t) rem.ts.tv_nsec); + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), + (long long) rem.ts.tv_sec, + zero_extend_signed_to_ull(rem.ts.tv_nsec)); puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); puts("+++ exited with 0 +++"); diff --git a/tests-m32/nanosleep.gen.test b/tests-m32/nanosleep.gen.test new file mode 100755 index 00000000..41928ded --- /dev/null +++ b/tests-m32/nanosleep.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nanosleep -a20 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-m32/nanosleep.test b/tests-m32/nanosleep.test deleted file mode 100755 index 055a8dcd..00000000 --- a/tests-m32/nanosleep.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check nanosleep and setitimer syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 -e trace=nanosleep,setitimer diff --git a/tests-m32/net-accept-connect.c b/tests-m32/net-accept-connect.c index 04c05a60..326cd8c1 100644 --- a/tests-m32/net-accept-connect.c +++ b/tests-m32/net-accept-connect.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2013-2016 Dmitry V. Levin + * Copyright (c) 2013-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -48,15 +29,16 @@ main(int ac, const char **av) struct sockaddr_un addr = { .sun_family = AF_UNIX, }; - socklen_t len; assert(ac == 2); - assert(strlen(av[1]) > 0); + socklen_t len = strlen(av[1]); + assert(len > 0 && len <= sizeof(addr.sun_path)); - strncpy(addr.sun_path, av[1], sizeof(addr.sun_path)); - len = offsetof(struct sockaddr_un, sun_path) + strlen(av[1]) + 1; - if (len > sizeof(addr)) - len = sizeof(addr); + if (++len > sizeof(addr.sun_path)) + len = sizeof(addr.sun_path); + + memcpy(addr.sun_path, av[1], len); + len += offsetof(struct sockaddr_un, sun_path); unlink(av[1]); close(0); @@ -69,7 +51,7 @@ main(int ac, const char **av) if (listen(0, 5)) perror_msg_and_skip("listen"); - memset(&addr, 0, sizeof addr); + memset(&addr, 0, sizeof(addr)); assert(getsockname(0, (struct sockaddr *) &addr, &len) == 0); if (len > sizeof(addr)) len = sizeof(addr); diff --git a/tests-m32/net-icmp_filter.c b/tests-m32/net-icmp_filter.c index f3f99f14..81b24293 100644 --- a/tests-m32/net-icmp_filter.c +++ b/tests-m32/net-icmp_filter.c @@ -2,29 +2,10 @@ * Check decoding of ICMP_FILTER. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -43,13 +24,13 @@ main(void) printf("setsockopt(-1, SOL_RAW, ICMP_FILTER, NULL, 0) = -1 %s (%m)\n", errno2name()); - socklen_t *const plen = tail_alloc(sizeof(*plen)); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, plen); void *const efault = plen + 1; - struct icmp_filter *const f = tail_alloc(sizeof(*f)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct icmp_filter, f); getsockopt(-1, SOL_RAW, ICMP_FILTER, f, plen); - printf("getsockopt(-1, SOL_RAW, ICMP_FILTER, %p, %p) = -1 %s (%m)\n", - f, plen, errno2name()); + printf("getsockopt(-1, SOL_RAW, ICMP_FILTER, %p, [%d]) = -1 %s (%m)\n", + f, *plen, errno2name()); setsockopt(-1, SOL_RAW, ICMP_FILTER, efault, sizeof(*f)); printf("setsockopt(-1, SOL_RAW, ICMP_FILTER, %p, %u) = -1 %s (%m)\n", diff --git a/tests-m32/net-icmp_filter.gen.test b/tests-m32/net-icmp_filter.gen.test new file mode 100755 index 00000000..bf6c765f --- /dev/null +++ b/tests-m32/net-icmp_filter.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-icmp_filter -e trace=getsockopt,setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt,setsockopt diff --git a/tests-m32/net-icmp_filter.test b/tests-m32/net-icmp_filter.test deleted file mode 100755 index c05a5e65..00000000 --- a/tests-m32/net-icmp_filter.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of ICMP_FILTER. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=getsockopt,setsockopt diff --git a/tests-m32/net-packet_mreq-Xabbrev.c b/tests-m32/net-packet_mreq-Xabbrev.c new file mode 100644 index 00000000..027bf5a4 --- /dev/null +++ b/tests-m32/net-packet_mreq-Xabbrev.c @@ -0,0 +1 @@ +#include "net-packet_mreq.c" diff --git a/tests-m32/net-packet_mreq-Xabbrev.gen.test b/tests-m32/net-packet_mreq-Xabbrev.gen.test new file mode 100755 index 00000000..66c5243b --- /dev/null +++ b/tests-m32/net-packet_mreq-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-packet_mreq-Xabbrev -e trace=setsockopt -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt -Xabbrev diff --git a/tests-m32/net-packet_mreq-Xraw.c b/tests-m32/net-packet_mreq-Xraw.c new file mode 100644 index 00000000..0b041c3e --- /dev/null +++ b/tests-m32/net-packet_mreq-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "net-packet_mreq.c" diff --git a/tests-m32/net-packet_mreq-Xraw.gen.test b/tests-m32/net-packet_mreq-Xraw.gen.test new file mode 100755 index 00000000..67ba710f --- /dev/null +++ b/tests-m32/net-packet_mreq-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-packet_mreq-Xraw -e trace=setsockopt -Xraw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt -Xraw diff --git a/tests-m32/net-packet_mreq-Xverbose.c b/tests-m32/net-packet_mreq-Xverbose.c new file mode 100644 index 00000000..02185bab --- /dev/null +++ b/tests-m32/net-packet_mreq-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "net-packet_mreq.c" diff --git a/tests-m32/net-packet_mreq-Xverbose.gen.test b/tests-m32/net-packet_mreq-Xverbose.gen.test new file mode 100755 index 00000000..d1c96342 --- /dev/null +++ b/tests-m32/net-packet_mreq-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-packet_mreq-Xverbose -e trace=setsockopt -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt -Xverbose diff --git a/tests-m32/net-packet_mreq.c b/tests-m32/net-packet_mreq.c new file mode 100644 index 00000000..6b64e9eb --- /dev/null +++ b/tests-m32/net-packet_mreq.c @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +static const char *errstr; + +static long +packet_mreq_membership(int optname, void *optval, socklen_t len) +{ + long rc = setsockopt(-1, SOL_PACKET, optname, optval, len); + errstr = sprintrc(rc); + return rc; +} + +static void +test_packet_mreq(const int optname, const char *const optname_str) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct packet_mreq, pmreq); + socklen_t len = sizeof(struct packet_mreq); + + /* setsockopt with optname unknown */ + packet_mreq_membership(-1, NULL, 0); +#if XLAT_RAW + printf("setsockopt(-1, %#x, %#x, NULL, 0) = %s\n", + SOL_PACKET, -1, errstr); +#elif XLAT_VERBOSE + printf("setsockopt(-1, %#x /* SOL_PACKET */, %#x /* PACKET_??? */" + ", NULL, 0) = %s\n", SOL_PACKET, -1, errstr); +#else + printf("setsockopt(-1, SOL_PACKET, %#x /* PACKET_??? */, NULL, 0) = %s\n", + -1, errstr); +#endif + + /* setsockopt with mr_type unknown */ + pmreq->mr_ifindex = 0; + pmreq->mr_alen = ARRAY_SIZE(pmreq->mr_address); + packet_mreq_membership(optname, pmreq, len); +#if XLAT_RAW + printf("setsockopt(-1, %#x, %#x, {mr_ifindex=%d," + " mr_type=%#x, mr_alen=%d, mr_address=", + SOL_PACKET, optname, pmreq->mr_ifindex, + pmreq->mr_type, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, + ARRAY_SIZE(pmreq->mr_address)); + printf("}, %d) = %s\n", len, errstr); +#elif XLAT_VERBOSE + printf("setsockopt(-1, %#x /* SOL_PACKET */, %#x /* %s */" + ", {mr_ifindex=%d, mr_type=%#x /* PACKET_MR_??? */" + ", mr_alen=%d, mr_address=", + SOL_PACKET, optname, optname_str, pmreq->mr_ifindex, + pmreq->mr_type, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, + ARRAY_SIZE(pmreq->mr_address)); + printf(" /* "); + for (unsigned int i = 0; i < ARRAY_SIZE(pmreq->mr_address); i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf(" */}, %d) = %s\n", len, errstr); +#else + printf("setsockopt(-1, SOL_PACKET, %s, {mr_ifindex=%d," + " mr_type=%#x /* PACKET_MR_??? */, mr_alen=%d, mr_address=", + optname_str, pmreq->mr_ifindex, pmreq->mr_type, pmreq->mr_alen); + for (unsigned int i = 0; i < ARRAY_SIZE(pmreq->mr_address); i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf("}, %d) = %s\n", len, errstr); +#endif + + /* setsockopt with mr_type unknown and mr_alen > sizeof(mr_address) */ + pmreq->mr_alen = ARRAY_SIZE(pmreq->mr_address) + 1; + packet_mreq_membership(optname, pmreq, len); +#if XLAT_RAW + printf("setsockopt(-1, %#x, %#x, {mr_ifindex=%d," + " mr_type=%#x, mr_alen=%d, mr_address=", + SOL_PACKET, optname, pmreq->mr_ifindex, + pmreq->mr_type, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, + ARRAY_SIZE(pmreq->mr_address)); + printf("}, %d) = %s\n", len, errstr); +#elif XLAT_VERBOSE + printf("setsockopt(-1, %#x /* SOL_PACKET */, %#x /* %s */" + ", {mr_ifindex=%d, mr_type=%#x /* PACKET_MR_??? */" + ", mr_alen=%d, mr_address=", + SOL_PACKET, optname, optname_str, pmreq->mr_ifindex, + pmreq->mr_type, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, + ARRAY_SIZE(pmreq->mr_address)); + printf(" /* "); + for (unsigned int i = 0; i < ARRAY_SIZE(pmreq->mr_address); i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf(" */}, %d) = %s\n", len, errstr); +#else + printf("setsockopt(-1, SOL_PACKET, %s, {mr_ifindex=%d," + " mr_type=%#x /* PACKET_MR_??? */, mr_alen=%d, mr_address=", + optname_str, pmreq->mr_ifindex, pmreq->mr_type, pmreq->mr_alen); + for (unsigned int i = 0; i < ARRAY_SIZE(pmreq->mr_address); i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf("}, %d) = %s\n", len, errstr); +#endif + + /* setsockopt with mr_type unknown and mr_alen < sizeof(mr_address) */ + pmreq->mr_alen = ARRAY_SIZE(pmreq->mr_address) - 1; + packet_mreq_membership(optname, pmreq, len); +#if XLAT_RAW + printf("setsockopt(-1, %#x, %#x, {mr_ifindex=%d," + " mr_type=%#x, mr_alen=%d, mr_address=", + SOL_PACKET, optname, pmreq->mr_ifindex, + pmreq->mr_type, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, pmreq->mr_alen); + printf("}, %d) = %s\n", len, errstr); +#elif XLAT_VERBOSE + printf("setsockopt(-1, %#x /* SOL_PACKET */, %#x /* %s */" + ", {mr_ifindex=%d, mr_type=%#x /* PACKET_MR_??? */" + ", mr_alen=%d, mr_address=", + SOL_PACKET, optname, optname_str, pmreq->mr_ifindex, + pmreq->mr_type, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, pmreq->mr_alen); + printf(" /* "); + for (unsigned int i = 0; i < pmreq->mr_alen; i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf(" */}, %d) = %s\n", len, errstr); +#else + printf("setsockopt(-1, SOL_PACKET, %s, {mr_ifindex=%d," + " mr_type=%#x /* PACKET_MR_??? */, mr_alen=%d, mr_address=", + optname_str, pmreq->mr_ifindex, pmreq->mr_type, pmreq->mr_alen); + for (unsigned int i = 0; i < pmreq->mr_alen; i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf("}, %d) = %s\n", len, errstr); +#endif + + /* setsockopt with valid mr_type */ + pmreq->mr_alen = ARRAY_SIZE(pmreq->mr_address); + static const struct { + unsigned short type; + const char *const type_str; + } a[] = { + { ARG_STR(PACKET_MR_MULTICAST) }, + { ARG_STR(PACKET_MR_PROMISC) }, + { ARG_STR(PACKET_MR_ALLMULTI) }, +#ifdef PACKET_MR_UNICAST + { ARG_STR(PACKET_MR_UNICAST) }, +#endif + }; + + for (unsigned int i = 0; i < ARRAY_SIZE(a); i++) { + pmreq->mr_type = a[i].type; + packet_mreq_membership(optname, pmreq, len); +#if XLAT_RAW + printf("setsockopt(-1, %#x, %#x, {mr_ifindex=%d," + " mr_type=%#x, mr_alen=%d, mr_address=", + SOL_PACKET, optname, pmreq->mr_ifindex, + pmreq->mr_type, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, pmreq->mr_alen); + printf("}, %d) = %s\n", len, errstr); +#elif XLAT_VERBOSE + printf("setsockopt(-1, %#x /* SOL_PACKET */, %#x /* %s */" + ", {mr_ifindex=%d, mr_type=%#x /* %s */" + ", mr_alen=%d, mr_address=", + SOL_PACKET, optname, optname_str, pmreq->mr_ifindex, + pmreq->mr_type, a[i].type_str, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, pmreq->mr_alen); + printf(" /* "); + for (unsigned int i = 0; i < pmreq->mr_alen; i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf(" */}, %d) = %s\n", len, errstr); +#else + printf("setsockopt(-1, SOL_PACKET, %s, {mr_ifindex=%d," + " mr_type=%s, mr_alen=%d, mr_address=", + optname_str, pmreq->mr_ifindex, a[i].type_str, pmreq->mr_alen); + for (unsigned int i = 0; i < pmreq->mr_alen; i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf("}, %d) = %s\n", len, errstr); +#endif + } + + /* setsockopt with optlen larger than usual */ + len = len + 1; + packet_mreq_membership(optname, pmreq, len); +#if XLAT_RAW + printf("setsockopt(-1, %#x, %#x, %p, %d) = %s\n", + SOL_PACKET, optname, pmreq, len, errstr); +#elif XLAT_VERBOSE + printf("setsockopt(-1, %#x /* SOL_PACKET */, %#x /* %s */" + ", %p, %d) = %s\n", SOL_PACKET, optname, optname_str, + pmreq, len, errstr); +#else + printf("setsockopt(-1, SOL_PACKET, %s, %p," + " %d) = %s\n", optname_str, pmreq, len, errstr); +#endif +} + +int +main(void) +{ + test_packet_mreq(ARG_STR(PACKET_ADD_MEMBERSHIP)); + test_packet_mreq(ARG_STR(PACKET_DROP_MEMBERSHIP)); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/net-packet_mreq.gen.test b/tests-m32/net-packet_mreq.gen.test new file mode 100755 index 00000000..9dd034a9 --- /dev/null +++ b/tests-m32/net-packet_mreq.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-packet_mreq -e trace=setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt diff --git a/tests-m32/net-sockaddr.c b/tests-m32/net-sockaddr.c index bf37779f..cd973922 100644 --- a/tests-m32/net-sockaddr.c +++ b/tests-m32/net-sockaddr.c @@ -2,29 +2,10 @@ * Check decoding of sockaddr structures * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,11 +17,13 @@ #include #include #include +#include "netlink.h" +#include #include #include #include +#include #include -#include #ifdef HAVE_BLUETOOTH_BLUETOOTH_H # include # include @@ -49,15 +32,10 @@ # include #endif -#ifdef HAVE_IF_INDEXTONAME -/* used to conflict with */ -extern unsigned int if_nametoindex(const char *); -#endif - static void check_un(void) { - struct sockaddr_un *un = tail_alloc(sizeof(*un)); + TAIL_ALLOC_OBJECT_VAR_PTR(struct sockaddr_un, un); un->sun_family = AF_UNIX; memset(un->sun_path, '0', sizeof(un->sun_path)); unsigned int len = sizeof(*un); @@ -133,7 +111,7 @@ check_in(void) const unsigned short h_port = 12345; static const char h_addr[] = "12.34.56.78"; - struct sockaddr_in *in = tail_alloc(sizeof(*in)); + TAIL_ALLOC_OBJECT_VAR_PTR(struct sockaddr_in, in); in->sin_family = AF_INET; in->sin_port = htons(h_port); in->sin_addr.s_addr = inet_addr(h_addr); @@ -178,26 +156,24 @@ check_in6_linklocal(struct sockaddr_in6 *const in6, const char *const h_addr) unsigned int len = sizeof(*in6); int ret = connect(-1, (void *) in6, len); printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" - ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" ", sin6_flowinfo=htonl(%u)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" ", sin6_scope_id=%u}, %u)" " = %d EBADF (%m)\n", - ntohs(in6->sin6_port), h_addr, - ntohl(in6->sin6_flowinfo), in6->sin6_scope_id, len, ret); + ntohs(in6->sin6_port), ntohl(in6->sin6_flowinfo), + h_addr, in6->sin6_scope_id, len, ret); -#ifdef HAVE_IF_INDEXTONAME - in6->sin6_scope_id = if_nametoindex("lo"); + in6->sin6_scope_id = ifindex_lo(); if (in6->sin6_scope_id) { ret = connect(-1, (void *) in6, len); printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" - ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" ", sin6_flowinfo=htonl(%u)" - ", sin6_scope_id=if_nametoindex(\"lo\")}, %u)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" + ", sin6_scope_id=%s}, %u)" " = %d EBADF (%m)\n", - ntohs(in6->sin6_port), h_addr, - ntohl(in6->sin6_flowinfo), len, ret); + ntohs(in6->sin6_port), ntohl(in6->sin6_flowinfo), h_addr, + IFINDEX_LO_STR, len, ret); } -#endif } static void @@ -207,7 +183,7 @@ check_in6(void) const unsigned int h_flowinfo = 1234567890; static const char h_addr[] = "12:34:56:78:90:ab:cd:ef"; - struct sockaddr_in6 *in6 = tail_alloc(sizeof(*in6)); + TAIL_ALLOC_OBJECT_VAR_PTR(struct sockaddr_in6, in6); in6->sin6_family = AF_INET6; in6->sin6_port = htons(h_port); in6->sin6_flowinfo = htonl(h_flowinfo); @@ -216,10 +192,11 @@ check_in6(void) unsigned int len = sizeof(*in6); int ret = connect(-1, (void *) in6, len); printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", sin6_flowinfo=htonl(%u)" ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" - ", sin6_flowinfo=htonl(%u), sin6_scope_id=%u}, %u)" + ", sin6_scope_id=%u}, %u)" " = %d EBADF (%m)\n", - h_port, h_addr, h_flowinfo, in6->sin6_scope_id, len, ret); + h_port, h_flowinfo, h_addr, in6->sin6_scope_id, len, ret); check_in6_linklocal(in6, "fe80::"); check_in6_linklocal(in6, "ff42::"); @@ -233,10 +210,11 @@ check_in6(void) len = sizeof(*in6) + 4; ret = connect(-1, (void *) in6, len); printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", sin6_flowinfo=htonl(%u)" ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" - ", sin6_flowinfo=htonl(%u), sin6_scope_id=%u}, %u)" + ", sin6_scope_id=%u}, %u)" " = %d EBADF (%m)\n", - h_port, h_addr, h_flowinfo, in6->sin6_scope_id, len, ret); + h_port, h_flowinfo, h_addr, in6->sin6_scope_id, len, ret); in6 = ((void *) in6) + 4 + sizeof(in6->sin6_scope_id); in6->sin6_family = AF_INET6; @@ -246,10 +224,10 @@ check_in6(void) len = sizeof(*in6) - sizeof(in6->sin6_scope_id); ret = connect(-1, (void *) in6, len); printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" - ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" - ", sin6_flowinfo=htonl(%u)}, %u)" + ", sin6_flowinfo=htonl(%u)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)}, %u)" " = %d EBADF (%m)\n", - h_port, h_addr, h_flowinfo, len, ret); + h_port, h_flowinfo, h_addr, len, ret); in6 = ((void *) in6) + 4; in6->sin6_family = AF_INET6; @@ -295,10 +273,185 @@ check_ipx(void) c_ipx.sipx_type, len, ret); } +/* for a bit more compact AX.25 address definitions */ +#define AX25_ADDR(c_, s_) \ + { { (c_)[0] << 1, (c_)[1] << 1, (c_)[2] << 1, \ + (c_)[3] << 1, (c_)[4] << 1, (c_)[5] << 1, (s_) << 1 } } \ + /* End of AX25_ADDR definition */ + +static void +check_ax25(void) +{ + const struct full_sockaddr_ax25 ax25 = { + .fsa_ax25 = { + .sax25_family = AF_AX25, + .sax25_call = AX25_ADDR("VALID ", 13), + .sax25_ndigis = 8, + }, + .fsa_digipeater = { + AX25_ADDR("SPA CE", 0), + AX25_ADDR("SSID ", 16), + AX25_ADDR(" ", 0), + AX25_ADDR("NULL\0", 3), + AX25_ADDR("A-B-C", 4), + AX25_ADDR(",}]\"\\'", 5), + AX25_ADDR("DASH-0", 6), + AX25_ADDR("\n\tABCD", 7), + }, + }; + const ax25_address aux_addrs[] = { + AX25_ADDR("VALID2", 7), + AX25_ADDR("OK ", 15), + AX25_ADDR("FINE ", 2), + AX25_ADDR("smalls", 9), + }; + + enum { AX25_ALIGN = ALIGNOF(struct full_sockaddr_ax25), }; + size_t size = sizeof(ax25); + size_t surplus = ROUNDUP(sizeof(ax25_address), AX25_ALIGN); + void *sax_void = midtail_alloc(size, surplus); + struct full_sockaddr_ax25 *sax = sax_void; + long rc; + + fill_memory(sax, size); + sax->fsa_ax25.sax25_family = AF_AX25; + rc = connect(-1, sax_void, sizeof(struct sockaddr_ax25) - 1); + printf("connect(-1, {sa_family=AF_AX25, sa_data=\"\\202\\203\\204\\205" + "\\206\\207\\210\\211\\212\\213\\214\\215\\216\"}, %zu) = %s\n", + sizeof(struct sockaddr_ax25) - 1, sprintrc(rc)); + + memcpy(sax, &ax25, sizeof(ax25)); + rc = connect(-1, sax_void, sizeof(struct sockaddr_ax25)); + printf("connect(-1, {sa_family=AF_AX25, fsa_ax25={sax25_call=VALID-13" + ", sax25_ndigis=8}, fsa_digipeater=[/* ??? */]}, %zu) = %s\n", + sizeof(struct sockaddr_ax25), sprintrc(rc)); + + sax->fsa_ax25.sax25_ndigis = 0; + rc = connect(-1, sax_void, sizeof(struct sockaddr_ax25)); + printf("connect(-1, {sa_family=AF_AX25, sax25_call=VALID-13" + ", sax25_ndigis=0}, %zu) = %s\n", + sizeof(struct sockaddr_ax25), sprintrc(rc)); + + sax->fsa_ax25.sax25_ndigis = 8; + size = sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 3 + 1; + rc = connect(-1, sax_void, size); + printf("connect(-1, {sa_family=AF_AX25, fsa_ax25={sax25_call=VALID-13" + ", sax25_ndigis=8}, fsa_digipeater" + "=[{ax25_call=\"\\xa6\\xa0\\x82\\x40\\x86\\x8a\\x00\"" + "} /* SPA CE-0 */" + ", {ax25_call=\"\\xa6\\xa6\\x92\\x88\\x40\\x40\\x20\"" + "} /* SSID-0 */" + ", *" + ", /* ??? */], ...}, %zu) = %s\n", + size, sprintrc(rc)); + + sax->fsa_digipeater[2].ax25_call[6] = 0x4; + size = sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 4; + rc = connect(-1, sax_void, size); + printf("connect(-1, {sa_family=AF_AX25, fsa_ax25={sax25_call=VALID-13" + ", sax25_ndigis=8}, fsa_digipeater" + "=[{ax25_call=\"\\xa6\\xa0\\x82\\x40\\x86\\x8a\\x00\"" + "} /* SPA CE-0 */" + ", {ax25_call=\"\\xa6\\xa6\\x92\\x88\\x40\\x40\\x20\"" + "} /* SSID-0 */" + ", {ax25_call=\"\\x40\\x40\\x40\\x40\\x40\\x40\\x04\"} /* -2 */" + ", {ax25_call=\"\\x9c\\xaa\\x98\\x98\\x00\\x00\\x06\"}" + ", /* ??? */]}, %zu) = %s\n", + size, sprintrc(rc)); + + memcpy(sax->fsa_digipeater, aux_addrs, sizeof(aux_addrs)); + sax->fsa_digipeater[2].ax25_call[6] = 0xa5; + sax->fsa_digipeater[4].ax25_call[5] = 0x40; + for (size_t i = 0; i < 3; i++) { + size = sizeof(ax25) + sizeof(ax25_address) * (i / 2); + rc = connect(-1, sax_void, size); + printf("connect(-1, {sa_family=AF_AX25" + ", fsa_ax25={sax25_call=VALID-13, sax25_ndigis=%d}" + ", fsa_digipeater=[VALID2-7, OK-15, %s /* FINE-2 */" + ", {ax25_call=\"\\xe6\\xda\\xc2\\xd8\\xd8\\xe6\\x12\"" + "} /* smalls-9 */" + ", {ax25_call=\"\\x%s\\x%s\\x84\\x5a\\x86\\x40\\x08\"" + "} /* %sB-C-4 */" + ", {ax25_call=\"\\x58\\xfa\\xba\\x44\\x%s\\x%s\\x0a\"" + "}%s" + ", {ax25_call=\"\\x88\\x82\\xa6\\x90\\x5a\\x%s\\x0c\"" + "}%s" + "%s]%s}, %zu) = %s\n" + , sax->fsa_ax25.sax25_ndigis + , i + ? "{ax25_call=\"\\x8c\\x92\\x9c\\x8a\\x40\\x41\\x04\"}" + : "{ax25_call=\"\\x8c\\x92\\x9c\\x8a\\x40\\x40\\xa5\"}" + , i ? "40" : "82" + , i ? "40" : "5a" + , i ? " " : "A-" + , i ? "54" : "b8" + , i ? "5e" : "4e" + , i ? "" : " /* ,}]\"\\'-5 */" + , i ? "fe" : "60" + , i ? "" : " /* DASH-0-6 */" + , i == 1 + ? "" + : ", {ax25_call=\"\\x14\\x12\\x82\\x84\\x86\\x88\\x0e\"}" + , i > 1 ? ", ..." : "" + , size, sprintrc(rc)); + + if (i == 1) { + sax_void = (char *) sax_void - surplus; + memmove(sax_void, sax, sizeof(ax25)); + sax = sax_void; + } + + sax->fsa_ax25.sax25_ndigis = 7 + 2 * i; + + sax->fsa_digipeater[2].ax25_call[5] = 0x41; + sax->fsa_digipeater[2].ax25_call[6] = 0x4; + + sax->fsa_digipeater[4].ax25_call[0] = 0x40; + sax->fsa_digipeater[4].ax25_call[1] = 0x40; + + sax->fsa_digipeater[5].ax25_call[4] = '*' << 1; + sax->fsa_digipeater[5].ax25_call[5] = '/' << 1; + + sax->fsa_digipeater[6].ax25_call[5] = 0xfe; + } +} + +static void +check_x25(void) +{ + static const struct sockaddr_x25 c_x25 = { + .sx25_family = AF_X25, + .sx25_addr = { "0123456789abcdef" }, + }; + void *x25_void = tail_memdup(&c_x25, sizeof(c_x25) + 1); + struct sockaddr_x25 *x25 = x25_void; + long rc; + + rc = connect(-1, x25, sizeof(c_x25) - 1); + printf("connect(-1, {sa_family=AF_X25" + ", sa_data=\"0123456789abcde\"}, %zu) = %s\n", + sizeof(c_x25) - 1, sprintrc(rc)); + + for (size_t i = 0; i < 2; i++) { + rc = connect(-1, x25, sizeof(c_x25) + i); + printf("connect(-1, {sa_family=AF_X25" + ", sx25_addr={x25_addr=\"0123456789abcde\"...}" + "}, %zu) = %s\n", + sizeof(c_x25) + i, sprintrc(rc)); + } + + x25->sx25_addr.x25_addr[10] = '\0'; + rc = connect(-1, x25, sizeof(c_x25)); + printf("connect(-1, {sa_family=AF_X25" + ", sx25_addr={x25_addr=\"0123456789\"}" + "}, %zu) = %s\n", + sizeof(c_x25), sprintrc(rc)); +} + static void check_nl(void) { - struct sockaddr_nl *nl = tail_alloc(sizeof(*nl)); + TAIL_ALLOC_OBJECT_VAR_PTR(struct sockaddr_nl, nl); nl->nl_family = AF_NETLINK; nl->nl_pid = 1234567890; nl->nl_groups = 0xfacefeed; @@ -370,19 +523,16 @@ check_ll(void) ", sll_pkttype=PACKET_HOST, sll_halen=0}, %u)" " = %d EBADF (%m)\n", c_ll.sll_ifindex, len, ret); -#ifdef HAVE_IF_INDEXTONAME - const int id = if_nametoindex("lo"); - if (id) { - ((struct sockaddr_ll *) ll)->sll_ifindex = id; + ((struct sockaddr_ll *) ll)->sll_ifindex = ifindex_lo(); + if (((struct sockaddr_ll *) ll)->sll_ifindex) { ret = connect(-1, ll, len); printf("connect(-1, {sa_family=AF_PACKET" ", sll_protocol=htons(ETH_P_ALL)" - ", sll_ifindex=if_nametoindex(\"lo\")" + ", sll_ifindex=%s" ", sll_hatype=ARPHRD_ETHER" ", sll_pkttype=PACKET_HOST, sll_halen=0}, %u)" - " = %d EBADF (%m)\n", len, ret); + " = %d EBADF (%m)\n", IFINDEX_LO_STR, len, ret); } -#endif } #ifdef HAVE_BLUETOOTH_BLUETOOTH_H @@ -390,7 +540,7 @@ static void check_hci(void) { const unsigned short h_port = 12345; - struct sockaddr_hci *hci = tail_alloc(sizeof(*hci)); + TAIL_ALLOC_OBJECT_VAR_PTR(struct sockaddr_hci, hci); hci->hci_family = AF_BLUETOOTH; hci->hci_dev = htobs(h_port); hci->hci_channel = HCI_CHANNEL_RAW; @@ -445,25 +595,86 @@ check_l2(void) { const unsigned short h_psm = 12345; const unsigned short h_cid = 13579; - const struct sockaddr_l2 c_l2 = { + struct sockaddr_l2 c_l2 = { .l2_family = AF_BLUETOOTH, .l2_psm = htobs(h_psm), .l2_bdaddr.b = "abcdef", .l2_cid = htobs(h_cid), - .l2_bdaddr_type = 42 +# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE + .l2_bdaddr_type = 0xce, +# endif }; void *l2 = tail_memdup(&c_l2, sizeof(c_l2)); unsigned int len = sizeof(c_l2); + int ret = connect(-1, l2, len); printf("connect(-1, {sa_family=AF_BLUETOOTH" - ", l2_psm=htobs(%hu)" + ", l2_psm=htobs(L2CAP_PSM_DYN_START + %hu)" + ", l2_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + ", l2_cid=htobs(L2CAP_CID_DYN_START + %hu)" +# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE + ", l2_bdaddr_type=0xce /* BDADDR_??? */" +# endif + "}, %u) = %d EBADF (%m)\n", + (short) (h_psm - 0x1001), + c_l2.l2_bdaddr.b[0], c_l2.l2_bdaddr.b[1], + c_l2.l2_bdaddr.b[2], c_l2.l2_bdaddr.b[3], + c_l2.l2_bdaddr.b[4], c_l2.l2_bdaddr.b[5], + (short) (h_cid - 0x40), len, ret); + + c_l2.l2_psm = htobs(1); + c_l2.l2_cid = htobs(1); +# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE + c_l2.l2_bdaddr_type = BDADDR_LE_RANDOM; +# endif + memcpy(l2, &c_l2, sizeof(c_l2)); + ret = connect(-1, l2, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", l2_psm=htobs(L2CAP_PSM_SDP)" + ", l2_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + ", l2_cid=htobs(L2CAP_CID_SIGNALING)" +# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE + ", l2_bdaddr_type=BDADDR_LE_RANDOM" +# endif + "}, %u) = %d EBADF (%m)\n", + c_l2.l2_bdaddr.b[0], c_l2.l2_bdaddr.b[1], + c_l2.l2_bdaddr.b[2], c_l2.l2_bdaddr.b[3], + c_l2.l2_bdaddr.b[4], c_l2.l2_bdaddr.b[5], + len, ret); + + c_l2.l2_psm = htobs(0xbad); + c_l2.l2_cid = htobs(8); +# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE + c_l2.l2_bdaddr_type = 3; +# endif + memcpy(l2, &c_l2, sizeof(c_l2)); + ret = connect(-1, l2, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", l2_psm=htobs(0xbad /* L2CAP_PSM_??? */)" + ", l2_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + ", l2_cid=htobs(0x8 /* L2CAP_CID_??? */)" +# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE + ", l2_bdaddr_type=0x3 /* BDADDR_??? */" +# endif + "}, %u) = %d EBADF (%m)\n", + c_l2.l2_bdaddr.b[0], c_l2.l2_bdaddr.b[1], + c_l2.l2_bdaddr.b[2], c_l2.l2_bdaddr.b[3], + c_l2.l2_bdaddr.b[4], c_l2.l2_bdaddr.b[5], + len, ret); + + c_l2.l2_psm = htobs(0x10ff); + c_l2.l2_cid = htobs(0xffff); + memcpy(l2, &c_l2, 12); + ret = connect(-1, l2, 12); + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", l2_psm=htobs(L2CAP_PSM_AUTO_END)" ", l2_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" - ", l2_cid=htobs(%hu), l2_bdaddr_type=%u}" - ", %u) = %d EBADF (%m)\n", h_psm, + ", l2_cid=htobs(L2CAP_CID_DYN_END)" + "}, 12) = %d EBADF (%m)\n", c_l2.l2_bdaddr.b[0], c_l2.l2_bdaddr.b[1], c_l2.l2_bdaddr.b[2], c_l2.l2_bdaddr.b[3], c_l2.l2_bdaddr.b[4], c_l2.l2_bdaddr.b[5], - h_cid, c_l2.l2_bdaddr_type, len, ret); + ret); } #endif @@ -502,6 +713,8 @@ main(void) check_in(); check_in6(); check_ipx(); + check_ax25(); + check_x25(); check_nl(); check_ll(); #ifdef HAVE_BLUETOOTH_BLUETOOTH_H diff --git a/tests-m32/net-sockaddr.gen.test b/tests-m32/net-sockaddr.gen.test new file mode 100755 index 00000000..53c8335a --- /dev/null +++ b/tests-m32/net-sockaddr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-sockaddr -a24 -e trace=connect); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 -e trace=connect diff --git a/tests-m32/net-sockaddr.test b/tests-m32/net-sockaddr.test deleted file mode 100755 index cdfe536f..00000000 --- a/tests-m32/net-sockaddr.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of sockaddr structures. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 -e trace=connect diff --git a/tests-m32/net-tpacket_req.c b/tests-m32/net-tpacket_req.c new file mode 100644 index 00000000..b11ddf8e --- /dev/null +++ b/tests-m32/net-tpacket_req.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +static const char *errstr; + +static long +set_tpacket_req(int optname, void *optval, socklen_t len) +{ + long rc = setsockopt(-1, SOL_PACKET, optname, optval, len); + errstr = sprintrc(rc); + return rc; +} + +static void +test_tpacket_req(const int optname, const char *const optname_str) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct tpacket_req, tpreq); + socklen_t len; + + /* setsockopt with optname unknown */ + set_tpacket_req(-1, NULL, 0); + printf("setsockopt(-1, SOL_PACKET, %#x /* PACKET_??? */, NULL, 0) = %s\n", + -1, errstr); + + /* classic setsockopt */ + len = sizeof(struct tpacket_req); + set_tpacket_req(optname, tpreq, len); + printf("setsockopt(-1, SOL_PACKET, %s, {tp_block_size=%u," + " tp_block_nr=%u, tp_frame_size=%u, tp_frame_nr=%u}, %d) = %s\n", + optname_str, tpreq->tp_block_size, tpreq->tp_block_nr, + tpreq->tp_frame_size, tpreq->tp_frame_nr, len, errstr); + + /* setsockopt with optlen larger than usual */ + len = len + 1; + set_tpacket_req(optname, tpreq, len); + printf("setsockopt(-1, SOL_PACKET, %s, %p," + " %d) = %s\n", optname_str, tpreq, len, errstr); +} + +int +main(void) +{ + test_tpacket_req(ARG_STR(PACKET_RX_RING)); +#ifdef PACKET_TX_RING + test_tpacket_req(ARG_STR(PACKET_TX_RING)); +#endif + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/net-tpacket_req.gen.test b/tests-m32/net-tpacket_req.gen.test new file mode 100755 index 00000000..6fc4e601 --- /dev/null +++ b/tests-m32/net-tpacket_req.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-tpacket_req -e trace=setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt diff --git a/tests-m32/net-tpacket_stats-success.c b/tests-m32/net-tpacket_stats-success.c new file mode 100644 index 00000000..883ec048 --- /dev/null +++ b/tests-m32/net-tpacket_stats-success.c @@ -0,0 +1,2 @@ +#define INJECT_RETVAL 42 +#include "net-tpacket_stats.c" diff --git a/tests-m32/net-tpacket_stats-success.test b/tests-m32/net-tpacket_stats-success.test new file mode 100755 index 00000000..47ab84ef --- /dev/null +++ b/tests-m32/net-tpacket_stats-success.test @@ -0,0 +1,11 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + + . "${srcdir=.}/scno_tampering.sh" + +run_strace -e trace=getsockopt -e inject=getsockopt:retval=42 ../net-tpacket_stats-success > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests-m32/net-tpacket_stats.c b/tests-m32/net-tpacket_stats.c new file mode 100644 index 00000000..22f5fa25 --- /dev/null +++ b/tests-m32/net-tpacket_stats.c @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include "print_fields.h" + +static const char *errstr; + +struct tp_stats { + unsigned int tp_packets, tp_drops, tp_freeze_q_cnt; +}; + +static long +get_tpacket_stats(void *optval, socklen_t *len) +{ + struct tp_stats *tpstats = optval; + socklen_t optlen = *len; + long rc = getsockopt(-1, SOL_PACKET, PACKET_STATISTICS, tpstats, len); + errstr = sprintrc(rc); +#ifdef INJECT_RETVAL + if (rc != INJECT_RETVAL) + error_msg_and_fail("Got a return value of %ld != %d", + rc, INJECT_RETVAL); + + static char inj_errstr[4096]; + + snprintf(inj_errstr, sizeof(inj_errstr), "%s (INJECTED)", errstr); + errstr = inj_errstr; +#endif + printf("getsockopt(-1, SOL_PACKET, PACKET_STATISTICS"); + if (rc < 0 || optlen <= 0) { + printf(", %p", tpstats); + } else if (optlen < sizeof(tpstats->tp_packets)) { + printf(", {tp_packets="); + print_quoted_hex(tpstats, optlen); + printf("}"); + } else { + PRINT_FIELD_U(", {", *tpstats, tp_packets); + + if (optlen > offsetof(struct tp_stats, tp_drops)) { + optlen -= offsetof(struct tp_stats, tp_drops); + if (optlen < sizeof(tpstats->tp_drops)) { + printf(", tp_drops="); + print_quoted_hex(tpstats, optlen); + } else { + PRINT_FIELD_U(", ", *tpstats, tp_drops); + + if (optlen > offsetof(struct tp_stats, tp_freeze_q_cnt) - + offsetof(struct tp_stats, tp_drops)) { + optlen -= offsetof(struct tp_stats, tp_freeze_q_cnt) - + offsetof(struct tp_stats, tp_drops); + if (optlen < sizeof(tpstats->tp_freeze_q_cnt)) { + printf(", tp_freeze_q_cnt="); + print_quoted_hex(tpstats, optlen); + } else { + PRINT_FIELD_U(", ", *tpstats, tp_freeze_q_cnt); + } + } + } + } + printf("}"); + } + printf(", [%d]) = %s\n", *len, errstr); + + return rc; +} + +int +main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct tp_stats, tp_stats); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); + + /* offset of (truncated) struct tp_stats.tp_packets */ + const unsigned int offset_tp_packets = offsetofend(struct tp_stats, tp_packets); + const unsigned int tp_packets_truncated = offset_tp_packets - 1; + /* offset of (truncated) struct tp_stats.tp_drops */ + const unsigned int offset_tp_drops = offsetofend(struct tp_stats, tp_drops); + const unsigned int tp_drops_truncated = offset_tp_drops - 1; + /* offset of (truncated) struct tp_stats.tp_freeze_q_cnt */ + const unsigned int offset_tp_freeze_q_cnt = offsetofend(struct tp_stats, tp_freeze_q_cnt); + const unsigned int tp_freeze_q_cnt_truncated = offset_tp_freeze_q_cnt - 1; + + *len = sizeof(*tp_stats); + + /* classic getsockopt */ + unsigned int optlen = *len; + get_tpacket_stats(tp_stats, &optlen); + + /* getsockopt with zero optlen */ + optlen = 0; + get_tpacket_stats(tp_stats, &optlen); + + /* + * getsockopt with optlen less than offsetofend(struct tp_stats.tp_packets): + * the part of struct tp_stats.tp_packets is printed in hex. + */ + optlen = tp_packets_truncated; + get_tpacket_stats(tp_stats, &optlen); + + /* + * getsockopt with optlen equals to offsetofend(struct tp_stats.tp_packets): + * struct tp_stats.tp_drops and struct tp_stats.offset_tp_freeze_q_cnt + * are not printed. + */ + optlen = offset_tp_packets; + get_tpacket_stats(tp_stats, &optlen); + + /* + * getsockopt with optlen greater than offsetofend(struct tp_stats.tp_packets) + * but less than offsetofend(struct tp_stats, tp_drops): + * the part of struct tp_stats.tp_drops is printed in hex. + */ + optlen = tp_drops_truncated; + get_tpacket_stats(tp_stats, &optlen); + + /* + * getsockopt with optlen equals to offsetofend(struct tp_stats.tp_drops): + * struct tp_stats.tp_freeze_q_cnt is not printed. + */ + optlen = offset_tp_drops; + get_tpacket_stats(tp_stats, &optlen); + + /* + * getsockopt with optlen greater than offsetofend(struct tp_stats.tp_drops) + * but less than offsetofend(struct tp_stats, tp_freeze_q_cnt): + * the part of struct tp_stats.tp_freeze_q_cnt is printed in hex. + */ + optlen = tp_freeze_q_cnt_truncated; + get_tpacket_stats(tp_stats, &optlen); + + /* + * getsockopt with optlen equals to offsetofend(struct tp_stats.tp_freeze_q_cnt): + */ + optlen = offset_tp_freeze_q_cnt; + get_tpacket_stats(tp_stats, &optlen); + + /* + * getsockopt with optlen greater than sizeof(struct tp_stats) + */ + optlen = offset_tp_freeze_q_cnt + 1; + get_tpacket_stats(tp_stats, &optlen); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/net-tpacket_stats.gen.test b/tests-m32/net-tpacket_stats.gen.test new file mode 100755 index 00000000..2df46550 --- /dev/null +++ b/tests-m32/net-tpacket_stats.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-tpacket_stats -e trace=getsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt diff --git a/tests-m32/net-y-unix.c b/tests-m32/net-y-unix.c index 3efc2f64..e9d218b5 100644 --- a/tests-m32/net-y-unix.c +++ b/tests-m32/net-y-unix.c @@ -1,30 +1,11 @@ /* * This file is part of net-y-unix strace test. * - * Copyright (c) 2013-2016 Dmitry V. Levin + * Copyright (c) 2013-2017 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -34,23 +15,26 @@ #include #include #include -#include #include #include +#include "accept_compat.h" + +#define TEST_SOCKET "net-y-unix.socket" + int -main(int ac, const char **av) +main(void) { - assert(ac == 2); + skip_if_unavailable("/proc/self/fd/"); - struct sockaddr_un addr = { .sun_family = AF_UNIX }; - unsigned int sun_path_len = strlen(av[1]); - assert(sun_path_len > 0 && sun_path_len <= sizeof(addr.sun_path)); - strncpy(addr.sun_path, av[1], sizeof(addr.sun_path)); + static const struct sockaddr_un addr = { + .sun_family = AF_UNIX, + .sun_path = TEST_SOCKET + }; struct sockaddr * const listen_sa = tail_memdup(&addr, sizeof(addr)); - socklen_t * const len = tail_alloc(sizeof(socklen_t)); - *len = offsetof(struct sockaddr_un, sun_path) + strlen(av[1]) + 1; + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); + *len = offsetof(struct sockaddr_un, sun_path) + strlen(TEST_SOCKET) + 1; if (*len > sizeof(addr)) *len = sizeof(addr); @@ -61,17 +45,18 @@ main(int ac, const char **av) printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", listen_fd, listen_inode); - (void) unlink(av[1]); + (void) unlink(TEST_SOCKET); if (bind(listen_fd, listen_sa, *len)) perror_msg_and_skip("bind"); printf("bind(%d, {sa_family=AF_UNIX, sun_path=\"%s\"}" - ", %u) = 0\n", listen_fd, listen_inode, av[1], (unsigned) *len); + ", %u) = 0\n", + listen_fd, listen_inode, TEST_SOCKET, (unsigned) *len); if (listen(listen_fd, 1)) perror_msg_and_skip("listen"); printf("listen(%d, 1) = 0\n", listen_fd, listen_inode); - unsigned int * const optval = tail_alloc(sizeof(unsigned int)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, optval); *len = sizeof(*optval); if (getsockopt(listen_fd, SOL_SOCKET, SO_PASSCRED, optval, len)) perror_msg_and_fail("getsockopt"); @@ -85,7 +70,7 @@ main(int ac, const char **av) perror_msg_and_fail("getsockname"); printf("getsockname(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", listen_fd, listen_inode, - av[1], (int) sizeof(addr), (int) *len); + TEST_SOCKET, (int) sizeof(addr), (int) *len); int connect_fd = socket(AF_UNIX, SOCK_STREAM, 0); if (connect_fd < 0) @@ -98,12 +83,12 @@ main(int ac, const char **av) perror_msg_and_fail("connect"); printf("connect(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, %u) = 0\n", - connect_fd, connect_inode, av[1], (unsigned) *len); + connect_fd, connect_inode, TEST_SOCKET, (unsigned) *len); struct sockaddr * const accept_sa = tail_alloc(sizeof(addr)); memset(accept_sa, 0, sizeof(addr)); *len = sizeof(addr); - int accept_fd = accept(listen_fd, accept_sa, len); + int accept_fd = do_accept(listen_fd, accept_sa, len); if (accept_fd < 0) perror_msg_and_fail("accept"); unsigned long accept_inode = inode_of_sockfd(accept_fd); @@ -119,7 +104,7 @@ main(int ac, const char **av) perror_msg_and_fail("getpeername"); printf("getpeername(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", connect_fd, connect_inode, - av[1], (int) sizeof(addr), (int) *len); + TEST_SOCKET, (int) sizeof(addr), (int) *len); char text[] = "text"; assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, 0) @@ -163,23 +148,23 @@ main(int ac, const char **av) perror_msg_and_fail("getsockname"); printf("getsockname(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", - listen_fd, listen_inode, av[1], + listen_fd, listen_inode, TEST_SOCKET, (int) sizeof(addr), (int) *len); if (connect(connect_fd, listen_sa, *len)) perror_msg_and_fail("connect"); printf("connect(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, %u) = 0\n", - connect_fd, connect_inode, av[1], (unsigned) *len); + connect_fd, connect_inode, TEST_SOCKET, (unsigned) *len); memset(accept_sa, 0, sizeof(addr)); *len = sizeof(addr); - accept_fd = accept(listen_fd, accept_sa, len); + accept_fd = do_accept(listen_fd, accept_sa, len); if (accept_fd < 0) perror_msg_and_fail("accept"); accept_inode = inode_of_sockfd(accept_fd); const char * const sun_path1 = - ((struct sockaddr_un *) accept_sa) -> sun_path + 1; + ((struct sockaddr_un *) accept_sa)->sun_path + 1; printf("accept(%d, {sa_family=AF_UNIX" ", sun_path=@\"%s\"}, [%d->%d]) = %d\n", listen_fd, listen_inode, sun_path1, @@ -192,7 +177,7 @@ main(int ac, const char **av) perror_msg_and_fail("getpeername"); printf("getpeername(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", - connect_fd, connect_inode, av[1], + connect_fd, connect_inode, TEST_SOCKET, (int) sizeof(addr), (int) *len); memset(accept_sa, 0, sizeof(addr)); @@ -224,7 +209,7 @@ main(int ac, const char **av) assert(close(accept_fd) == 0); printf("close(%d) = 0\n", accept_fd, accept_inode); - assert(unlink(av[1]) == 0); + assert(unlink(TEST_SOCKET) == 0); assert(close(listen_fd) == 0); printf("close(%d) = 0\n", diff --git a/tests-m32/net-y-unix.test b/tests-m32/net-y-unix.test index aec8159f..aaaf9705 100755 --- a/tests-m32/net-y-unix.test +++ b/tests-m32/net-y-unix.test @@ -2,45 +2,18 @@ # # Check decoding of network syscalls in -y mode. # -# Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -# strace -y is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - check_prog sed -addr="$NAME-local-stream" -run_prog "./$NAME" $addr > /dev/null - +run_prog > /dev/null run_strace -a20 -y -eclose,network $args > "$EXP" + # Filter out close() calls made by ld.so and libc. sed -n '/socket/,$p' < "$LOG" > "$OUT" - match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-m32/net-yy-inet.c b/tests-m32/net-yy-inet.c index f76f941d..03264faa 100644 --- a/tests-m32/net-yy-inet.c +++ b/tests-m32/net-yy-inet.c @@ -2,29 +2,10 @@ * This file is part of net-yy-inet strace test. * * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -38,78 +19,99 @@ #include #include +#include "accept_compat.h" + +#ifndef ADDR_FAMILY +# define ADDR_FAMILY_FIELD sin_family +# define ADDR_FAMILY AF_INET +# define AF_STR "AF_INET" +# define LOOPBACK_FIELD .sin_addr.s_addr = htonl(INADDR_LOOPBACK) +# define LOOPBACK "127.0.0.1" +# define SOCKADDR_TYPE sockaddr_in +# define TCP_STR "TCP" +# define INPORT sin_port +# define INPORT_STR "sin_port" +# define INADDR_STR "sin_addr=inet_addr(\"" LOOPBACK "\")" +# define SA_FIELDS "" +#endif + int main(void) { - const struct sockaddr_in addr = { - .sin_family = AF_INET, - .sin_addr.s_addr = htonl(INADDR_LOOPBACK) + skip_if_unavailable("/proc/self/fd/"); + + const struct SOCKADDR_TYPE addr = { + .ADDR_FAMILY_FIELD = ADDR_FAMILY, + LOOPBACK_FIELD }; struct sockaddr * const listen_sa = tail_memdup(&addr, sizeof(addr)); - socklen_t * const len = tail_alloc(sizeof(socklen_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); *len = sizeof(addr); - const int listen_fd = socket(AF_INET, SOCK_STREAM, 0); + const int listen_fd = socket(ADDR_FAMILY, SOCK_STREAM, 0); if (listen_fd < 0) perror_msg_and_skip("socket"); const unsigned long listen_inode = inode_of_sockfd(listen_fd); - printf("socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = %d\n", + printf("socket(" AF_STR ", SOCK_STREAM, IPPROTO_IP) = %d<" TCP_STR + ":[%lu]>\n", listen_fd, listen_inode); if (bind(listen_fd, listen_sa, *len)) perror_msg_and_skip("bind"); - printf("bind(%d, {sa_family=AF_INET, sin_port=htons(0)" - ", sin_addr=inet_addr(\"127.0.0.1\")}, %u) = 0\n", + printf("bind(%d<" TCP_STR ":[%lu]>, {sa_family=" AF_STR ", " INPORT_STR + "=htons(0), " INADDR_STR SA_FIELDS "}, %u) = 0\n", listen_fd, listen_inode, (unsigned) *len); if (listen(listen_fd, 1)) perror_msg_and_skip("listen"); - printf("listen(%d, 1) = 0\n", listen_fd, listen_inode); + printf("listen(%d<" TCP_STR ":[%lu]>, 1) = 0\n", + listen_fd, listen_inode); memset(listen_sa, 0, sizeof(addr)); *len = sizeof(addr); if (getsockname(listen_fd, listen_sa, len)) perror_msg_and_fail("getsockname"); const unsigned int listen_port = - ntohs(((struct sockaddr_in *) listen_sa) -> sin_port); - printf("getsockname(%d, {sa_family=AF_INET" - ", sin_port=htons(%u), sin_addr=inet_addr(\"127.0.0.1\")}" + ntohs(((struct SOCKADDR_TYPE *) listen_sa)->INPORT); + printf("getsockname(%d<" TCP_STR ":[" LOOPBACK ":%u]>, {sa_family=" + AF_STR ", " INPORT_STR "=htons(%u), " INADDR_STR SA_FIELDS "}" ", [%u]) = 0\n", listen_fd, listen_port, listen_port, (unsigned) *len); - unsigned int * const optval = tail_alloc(sizeof(unsigned int)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, optval); *len = sizeof(*optval); if (getsockopt(listen_fd, SOL_TCP, TCP_MAXSEG, optval, len)) perror_msg_and_fail("getsockopt"); - printf("getsockopt(%d, SOL_TCP, TCP_MAXSEG" - ", [%u], [%u]) = 0\n", + printf("getsockopt(%d<" TCP_STR ":[" LOOPBACK ":%u]>, SOL_TCP, " + "TCP_MAXSEG, [%u], [%u]) = 0\n", listen_fd, listen_port, *optval, (unsigned) *len); - const int connect_fd = socket(AF_INET, SOCK_STREAM, 0); + const int connect_fd = socket(ADDR_FAMILY, SOCK_STREAM, 0); if (connect_fd < 0) perror_msg_and_fail("socket"); const unsigned long connect_inode = inode_of_sockfd(connect_fd); - printf("socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = %d\n", + printf("socket(" AF_STR ", SOCK_STREAM, IPPROTO_IP) = %d<" TCP_STR + ":[%lu]>\n", connect_fd, connect_inode); *len = sizeof(addr); if (connect(connect_fd, listen_sa, *len)) perror_msg_and_fail("connect"); - printf("connect(%d, {sa_family=AF_INET, sin_port=htons(%u)" - ", sin_addr=inet_addr(\"127.0.0.1\")}, %u) = 0\n", + printf("connect(%d<" TCP_STR ":[%lu]>, {sa_family=" AF_STR ", " + INPORT_STR "=htons(%u), " INADDR_STR SA_FIELDS "}, %u) = 0\n", connect_fd, connect_inode, listen_port, (unsigned) *len); struct sockaddr * const accept_sa = tail_alloc(sizeof(addr)); memset(accept_sa, 0, sizeof(addr)); *len = sizeof(addr); - const int accept_fd = accept(listen_fd, accept_sa, len); + const int accept_fd = do_accept(listen_fd, accept_sa, len); if (accept_fd < 0) perror_msg_and_fail("accept"); const unsigned int connect_port = - ntohs(((struct sockaddr_in *) accept_sa) -> sin_port); - printf("accept(%d, {sa_family=AF_INET" - ", sin_port=htons(%u), sin_addr=inet_addr(\"127.0.0.1\")}" - ", [%u]) = %d127.0.0.1:%u]>\n", + ntohs(((struct SOCKADDR_TYPE *) accept_sa)->INPORT); + printf("accept(%d<" TCP_STR ":[" LOOPBACK ":%u]>, {sa_family=" AF_STR + ", " INPORT_STR "=htons(%u), " INADDR_STR SA_FIELDS "}" + ", [%u]) = %d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>\n", listen_fd, listen_port, connect_port, (unsigned) *len, accept_fd, listen_port, connect_port); @@ -117,9 +119,9 @@ main(void) *len = sizeof(addr); if (getpeername(accept_fd, accept_sa, len)) perror_msg_and_fail("getpeername"); - printf("getpeername(%d127.0.0.1:%u]>" - ", {sa_family=AF_INET, sin_port=htons(%u)" - ", sin_addr=inet_addr(\"127.0.0.1\")}, [%u]) = 0\n", + printf("getpeername(%d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>" + ", {sa_family=" AF_STR ", " INPORT_STR "=htons(%u)" + ", " INADDR_STR SA_FIELDS "}, [%u]) = 0\n", accept_fd, listen_port, connect_port, connect_port, (unsigned) *len); @@ -127,16 +129,16 @@ main(void) *len = sizeof(addr); if (getpeername(connect_fd, listen_sa, len)) perror_msg_and_fail("getpeername"); - printf("getpeername(%d127.0.0.1:%u]>" - ", {sa_family=AF_INET, sin_port=htons(%u)" - ", sin_addr=inet_addr(\"127.0.0.1\")}, [%u]) = 0\n", + printf("getpeername(%d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>" + ", {sa_family=" AF_STR ", " INPORT_STR "=htons(%u)" + ", " INADDR_STR SA_FIELDS "}, [%u]) = 0\n", connect_fd, connect_port, listen_port, listen_port, (unsigned) *len); *len = sizeof(*optval); if (setsockopt(connect_fd, SOL_TCP, TCP_MAXSEG, optval, *len)) perror_msg_and_fail("setsockopt"); - printf("setsockopt(%d127.0.0.1:%u]>" + printf("setsockopt(%d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>" ", SOL_TCP, TCP_MAXSEG, [%u], %u) = 0\n", connect_fd, connect_port, listen_port, *optval, (unsigned) *len); @@ -144,28 +146,30 @@ main(void) char text[] = "text"; assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTROUTE | MSG_DONTWAIT, NULL, 0) == sizeof(text) - 1); - printf("sendto(%d127.0.0.1:%u]>, \"%s\", %u" - ", MSG_DONTROUTE|MSG_DONTWAIT, NULL, 0) = %u\n", + printf("sendto(%d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>, " + "\"%s\", %u, MSG_DONTROUTE|MSG_DONTWAIT, NULL, 0) = %u\n", connect_fd, connect_port, listen_port, text, (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); assert(close(connect_fd) == 0); - printf("close(%d127.0.0.1:%u]>) = 0\n", + printf("close(%d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>) = " + "0\n", connect_fd, connect_port, listen_port); assert(recvfrom(accept_fd, text, sizeof(text) - 1, MSG_WAITALL, NULL, NULL) == sizeof(text) - 1); - printf("recvfrom(%d127.0.0.1:%u]>, \"%s\", %u" - ", MSG_WAITALL, NULL, NULL) = %u\n", + printf("recvfrom(%d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>, " + "\"%s\", %u, MSG_WAITALL, NULL, NULL) = %u\n", accept_fd, listen_port, connect_port, text, (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); assert(close(accept_fd) == 0); - printf("close(%d127.0.0.1:%u]>) = 0\n", + printf("close(%d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>) = " + "0\n", accept_fd, listen_port, connect_port); assert(close(listen_fd) == 0); - printf("close(%d) = 0\n", + printf("close(%d<" TCP_STR ":[" LOOPBACK ":%u]>) = 0\n", listen_fd, listen_port); puts("+++ exited with 0 +++"); diff --git a/tests-m32/net-yy-inet.test b/tests-m32/net-yy-inet.test index 2ebf91fa..71a2a0c7 100755 --- a/tests-m32/net-yy-inet.test +++ b/tests-m32/net-yy-inet.test @@ -3,44 +3,19 @@ # Check decoding of ip:port pairs associated with socket descriptors # # Copyright (c) 2014-2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -# strace -yy is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - check_prog sed -run_prog ./netlink_inet_diag - -run_prog "./$NAME" > /dev/null +run_prog ../netlink_inet_diag +run_prog > /dev/null run_strace -a22 -yy -eclose,network $args > "$EXP" + # Filter out close() calls made by ld.so and libc. sed -n '/socket/,$p' < "$LOG" > "$OUT" - match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-m32/net-yy-inet6.c b/tests-m32/net-yy-inet6.c new file mode 100644 index 00000000..b8a7e240 --- /dev/null +++ b/tests-m32/net-yy-inet6.c @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#define ADDR_FAMILY_FIELD sin6_family +#define ADDR_FAMILY AF_INET6 +#define AF_STR "AF_INET6" +#define LOOPBACK_FIELD .sin6_addr = IN6ADDR_LOOPBACK_INIT +#define LOOPBACK "[::1]" +#define SOCKADDR_TYPE sockaddr_in6 +#define TCP_STR "TCPv6" +#define INPORT sin6_port +#define INPORT_STR "sin6_port" +#define INADDR_STR "sin6_flowinfo=htonl(0)" \ + ", inet_pton(AF_INET6, \"::1\", &sin6_addr)" +#define SA_FIELDS ", sin6_scope_id=0" + +#include "net-yy-inet.c" diff --git a/tests-m32/net-yy-inet6.gen.test b/tests-m32/net-yy-inet6.gen.test new file mode 100755 index 00000000..afa38c6e --- /dev/null +++ b/tests-m32/net-yy-inet6.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-yy-inet6 +net-yy-inet.test ); do not edit. +set -- +. "${srcdir=.}/net-yy-inet.test" diff --git a/tests-m32/net-yy-netlink.c b/tests-m32/net-yy-netlink.c index 64d0efca..38b1a0d4 100644 --- a/tests-m32/net-yy-netlink.c +++ b/tests-m32/net-yy-netlink.c @@ -1,31 +1,12 @@ /* * This file is part of net-yy-netlink strace test. * - * Copyright (c) 2013-2016 Dmitry V. Levin + * Copyright (c) 2013-2017 Dmitry V. Levin * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,24 +17,21 @@ #include #include #include -#include +#include "netlink.h" #include #include -#if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG -# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG -#endif - int main(void) { - unsigned magic = 1234; + skip_if_unavailable("/proc/self/fd/"); + struct sockaddr_nl addr = { .nl_family = AF_NETLINK, - .nl_pid = 1234 + .nl_pid = getpid() }; struct sockaddr *const sa = tail_memdup(&addr, sizeof(addr)); - socklen_t * const len = tail_alloc(sizeof(socklen_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); *len = sizeof(addr); const int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG); @@ -67,17 +45,17 @@ main(void) perror_msg_and_skip("bind"); printf("bind(%d, {sa_family=AF_NETLINK" ", nl_pid=%u, nl_groups=00000000}, %u) = 0\n", - fd, inode, magic, (unsigned) *len); + fd, inode, addr.nl_pid, (unsigned) *len); if (getsockname(fd, sa, len)) perror_msg_and_fail("getsockname"); printf("getsockname(%d, {sa_family=AF_NETLINK" ", nl_pid=%u, nl_groups=00000000}, [%u]) = 0\n", - fd, magic, magic, (unsigned) *len); + fd, addr.nl_pid, addr.nl_pid, (unsigned) *len); if (close(fd)) perror_msg_and_fail("close"); - printf("close(%d) = 0\n", fd, magic); + printf("close(%d) = 0\n", fd, addr.nl_pid); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/net-yy-netlink.test b/tests-m32/net-yy-netlink.test index bff1d861..892c9799 100755 --- a/tests-m32/net-yy-netlink.test +++ b/tests-m32/net-yy-netlink.test @@ -6,44 +6,19 @@ # Copyright (c) 2014 Masatake YAMATO # Copyright (c) 2014-2016 Dmitry V. Levin # Copyright (c) 2016 Fabien Siron +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -# strace -yy is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - check_prog sed -run_prog ./netlink_netlink_diag - -run_prog "./$NAME" > /dev/null +run_prog ../netlink_netlink_diag +run_prog > /dev/null run_strace -a22 -yy -eclose,network $args > "$EXP" + # Filter out close() calls made by ld.so and libc. sed -n '/socket/,$p' < "$LOG" > "$OUT" - match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-m32/net-yy-unix.c b/tests-m32/net-yy-unix.c index 63637bdd..0380da3f 100644 --- a/tests-m32/net-yy-unix.c +++ b/tests-m32/net-yy-unix.c @@ -1,30 +1,11 @@ /* * This file is part of net-yy-unix strace test. * - * Copyright (c) 2013-2016 Dmitry V. Levin + * Copyright (c) 2013-2017 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -34,23 +15,26 @@ #include #include #include -#include #include #include +#include "accept_compat.h" + +#define TEST_SOCKET "net-yy-unix.socket" + int -main(int ac, const char **av) +main(void) { - assert(ac == 2); + skip_if_unavailable("/proc/self/fd/"); - struct sockaddr_un addr = { .sun_family = AF_UNIX }; - unsigned int sun_path_len = strlen(av[1]); - assert(sun_path_len > 0 && sun_path_len <= sizeof(addr.sun_path)); - strncpy(addr.sun_path, av[1], sizeof(addr.sun_path)); + struct sockaddr_un addr = { + .sun_family = AF_UNIX, + .sun_path = TEST_SOCKET + }; struct sockaddr * const listen_sa = tail_memdup(&addr, sizeof(addr)); - socklen_t * const len = tail_alloc(sizeof(socklen_t)); - *len = offsetof(struct sockaddr_un, sun_path) + strlen(av[1]) + 1; + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); + *len = offsetof(struct sockaddr_un, sun_path) + strlen(TEST_SOCKET) + 1; if (*len > sizeof(addr)) *len = sizeof(addr); @@ -61,24 +45,25 @@ main(int ac, const char **av) printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", listen_fd, listen_inode); - (void) unlink(av[1]); + (void) unlink(TEST_SOCKET); if (bind(listen_fd, listen_sa, *len)) perror_msg_and_skip("bind"); printf("bind(%d, {sa_family=AF_UNIX, sun_path=\"%s\"}" - ", %u) = 0\n", listen_fd, listen_inode, av[1], (unsigned) *len); + ", %u) = 0\n", + listen_fd, listen_inode, TEST_SOCKET, (unsigned) *len); if (listen(listen_fd, 1)) perror_msg_and_skip("listen"); printf("listen(%d, 1) = 0\n", - listen_fd, listen_inode, av[1]); + listen_fd, listen_inode, TEST_SOCKET); - unsigned int * const optval = tail_alloc(sizeof(unsigned int)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, optval); *len = sizeof(*optval); if (getsockopt(listen_fd, SOL_SOCKET, SO_PASSCRED, optval, len)) perror_msg_and_fail("getsockopt"); printf("getsockopt(%d, SOL_SOCKET, SO_PASSCRED" ", [%u], [%u]) = 0\n", - listen_fd, listen_inode, av[1], *optval, (unsigned) *len); + listen_fd, listen_inode, TEST_SOCKET, *optval, (unsigned) *len); memset(listen_sa, 0, sizeof(addr)); *len = sizeof(addr); @@ -86,7 +71,7 @@ main(int ac, const char **av) perror_msg_and_fail("getsockname"); printf("getsockname(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", listen_fd, listen_inode, - av[1], av[1], (int) sizeof(addr), (int) *len); + TEST_SOCKET, TEST_SOCKET, (int) sizeof(addr), (int) *len); int connect_fd = socket(AF_UNIX, SOCK_STREAM, 0); if (connect_fd < 0) @@ -99,19 +84,20 @@ main(int ac, const char **av) perror_msg_and_fail("connect"); printf("connect(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, %u) = 0\n", - connect_fd, connect_inode, av[1], (unsigned) *len); + connect_fd, connect_inode, TEST_SOCKET, (unsigned) *len); struct sockaddr * const accept_sa = tail_alloc(sizeof(addr)); memset(accept_sa, 0, sizeof(addr)); *len = sizeof(addr); - int accept_fd = accept(listen_fd, accept_sa, len); + int accept_fd = do_accept(listen_fd, accept_sa, len); if (accept_fd < 0) perror_msg_and_fail("accept"); unsigned long accept_inode = inode_of_sockfd(accept_fd); printf("accept(%d, {sa_family=AF_UNIX}" ", [%d->%d]) = %d%lu,\"%s\"]>\n", - listen_fd, listen_inode, av[1], (int) sizeof(addr), (int) *len, - accept_fd, accept_inode, connect_inode, av[1]); + listen_fd, listen_inode, TEST_SOCKET, + (int) sizeof(addr), (int) *len, + accept_fd, accept_inode, connect_inode, TEST_SOCKET); memset(listen_sa, 0, sizeof(addr)); *len = sizeof(addr); @@ -120,7 +106,7 @@ main(int ac, const char **av) printf("getpeername(%d%lu]>, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", connect_fd, connect_inode, - accept_inode, av[1], (int) sizeof(addr), (int) *len); + accept_inode, TEST_SOCKET, (int) sizeof(addr), (int) *len); char text[] = "text"; assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, 0) @@ -134,7 +120,7 @@ main(int ac, const char **av) == sizeof(text) - 1); printf("recvfrom(%d%lu,\"%s\"]>, \"%s\", %u, MSG_DONTWAIT" ", NULL, NULL) = %u\n", - accept_fd, accept_inode, connect_inode, av[1], text, + accept_fd, accept_inode, connect_inode, TEST_SOCKET, text, (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); assert(close(connect_fd) == 0); @@ -143,7 +129,7 @@ main(int ac, const char **av) assert(close(accept_fd) == 0); printf("close(%d%lu,\"%s\"]>) = 0\n", - accept_fd, accept_inode, connect_inode, av[1]); + accept_fd, accept_inode, connect_inode, TEST_SOCKET); connect_fd = socket(AF_UNIX, SOCK_STREAM, 0); if (connect_fd < 0) @@ -166,27 +152,27 @@ main(int ac, const char **av) perror_msg_and_fail("getsockname"); printf("getsockname(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", listen_fd, listen_inode, - av[1], av[1], (int) sizeof(addr), (int) *len); + TEST_SOCKET, TEST_SOCKET, (int) sizeof(addr), (int) *len); if (connect(connect_fd, listen_sa, *len)) perror_msg_and_fail("connect"); printf("connect(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, %u) = 0\n", - connect_fd, connect_inode, av[1], (unsigned) *len); + connect_fd, connect_inode, TEST_SOCKET, (unsigned) *len); memset(accept_sa, 0, sizeof(addr)); *len = sizeof(addr); - accept_fd = accept(listen_fd, accept_sa, len); + accept_fd = do_accept(listen_fd, accept_sa, len); if (accept_fd < 0) perror_msg_and_fail("accept"); accept_inode = inode_of_sockfd(accept_fd); const char * const sun_path1 = - ((struct sockaddr_un *) accept_sa) -> sun_path + 1; + ((struct sockaddr_un *) accept_sa)->sun_path + 1; printf("accept(%d, {sa_family=AF_UNIX" ", sun_path=@\"%s\"}, [%d->%d]) = %d%lu,\"%s\"]>\n", - listen_fd, listen_inode, av[1], sun_path1, + listen_fd, listen_inode, TEST_SOCKET, sun_path1, (int) sizeof(addr), (int) *len, - accept_fd, accept_inode, connect_inode, av[1]); + accept_fd, accept_inode, connect_inode, TEST_SOCKET); memset(listen_sa, 0, sizeof(addr)); *len = sizeof(addr); @@ -194,7 +180,7 @@ main(int ac, const char **av) perror_msg_and_fail("getpeername"); printf("getpeername(%d%lu,@\"%s\"]>, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", connect_fd, connect_inode, - accept_inode, sun_path1, av[1], (int) sizeof(addr), (int) *len); + accept_inode, sun_path1, TEST_SOCKET, (int) sizeof(addr), (int) *len); assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, 0) == sizeof(text) - 1); @@ -207,7 +193,7 @@ main(int ac, const char **av) == sizeof(text) - 1); printf("recvfrom(%d%lu,\"%s\"]>, \"%s\", %u, MSG_DONTWAIT" ", NULL, NULL) = %u\n", - accept_fd, accept_inode, connect_inode, av[1], text, + accept_fd, accept_inode, connect_inode, TEST_SOCKET, text, (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); assert(close(connect_fd) == 0); @@ -216,13 +202,13 @@ main(int ac, const char **av) assert(close(accept_fd) == 0); printf("close(%d%lu,\"%s\"]>) = 0\n", - accept_fd, accept_inode, connect_inode, av[1]); + accept_fd, accept_inode, connect_inode, TEST_SOCKET); - assert(unlink(av[1]) == 0); + assert(unlink(TEST_SOCKET) == 0); assert(close(listen_fd) == 0); printf("close(%d) = 0\n", - listen_fd, listen_inode, av[1]); + listen_fd, listen_inode, TEST_SOCKET); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/net-yy-unix.test b/tests-m32/net-yy-unix.test index b82761c3..d00dd2c1 100755 --- a/tests-m32/net-yy-unix.test +++ b/tests-m32/net-yy-unix.test @@ -4,46 +4,19 @@ # associated with unix domain socket descriptors. # # Copyright (c) 2014 Masatake YAMATO -# Copyright (c) 2014-2016 Dmitry V. Levin +# Copyright (c) 2014-2018 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -# strace -yy is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - check_prog sed -run_prog ./netlink_unix_diag - -addr="$NAME-local-stream" -run_prog "./$NAME" $addr > /dev/null +run_prog ../netlink_unix_diag +run_prog > /dev/null run_strace -a22 -yy -eclose,network $args > "$EXP" + # Filter out close() calls made by ld.so and libc. sed -n '/socket/,$p' < "$LOG" > "$OUT" - match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-m32/net.expected b/tests-m32/net.expected index 80dd0701..e33e2966 100644 --- a/tests-m32/net.expected +++ b/tests-m32/net.expected @@ -3,5 +3,5 @@ [1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +bind\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="net-local-stream"\}, 19\) += 0 [1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +listen\(0, 5\) += 0 [1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +getsockname\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="net-local-stream"\}, \[19\]\) += 0 -[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +accept\(0, \{sa_family=AF_(LOCAL|UNIX|FILE)\}, \[19->2\]\) += 1 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +accept4?\(0, \{sa_family=AF_(LOCAL|UNIX|FILE)\}, \[19->2\](, 0)?\) += 1 [1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +connect\(1, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="net-local-stream"\}, 19\) += 0 diff --git a/tests-m32/net.test b/tests-m32/net.test index cf943ffa..cca850a9 100755 --- a/tests-m32/net.test +++ b/tests-m32/net.test @@ -1,11 +1,16 @@ #!/bin/sh - +# # Check how network syscalls are traced. +# +# Copyright (c) 2014-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./net-accept-connect net-local-stream -run_strace_merge -enetwork $args +run_prog ../net-accept-connect net-local-stream +run_strace_merge -e%network $args match_grep exit 0 diff --git a/tests-m32/netlink_audit.c b/tests-m32/netlink_audit.c new file mode 100644 index 00000000..eba609a1 --- /dev/null +++ b/tests-m32/netlink_audit.c @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include "netlink.h" + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = AUDIT_GET, + .nlmsg_flags = NLM_F_REQUEST, + }; + + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=AUDIT_GET" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_AUDIT); + + test_nlmsg_type(fd); + + printf("+++ exited with 0 +++\n"); + + return 0; +} diff --git a/tests-m32/netlink_audit.gen.test b/tests-m32/netlink_audit.gen.test new file mode 100755 index 00000000..5c17038e --- /dev/null +++ b/tests-m32/netlink_audit.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_audit +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/netlink_crypto.c b/tests-m32/netlink_crypto.c new file mode 100644 index 00000000..e2a5be0c --- /dev/null +++ b/tests-m32/netlink_crypto.c @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_CRYPTOUSER_H + +# include +# include +# include +# include +# include "test_netlink.h" + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = CRYPTO_MSG_NEWALG, + .nlmsg_flags = NLM_F_REQUEST, + }; + + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=CRYPTO_MSG_NEWALG" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = CRYPTO_MSG_GETALG; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=CRYPTO_MSG_GETALG" + ", flags=NLM_F_REQUEST|NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = CRYPTO_MSG_NEWALG; + nlh.nlmsg_flags = NLM_F_ECHO | NLM_F_REPLACE; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=CRYPTO_MSG_NEWALG" + ", flags=NLM_F_ECHO|NLM_F_REPLACE, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = CRYPTO_MSG_DELALG; + nlh.nlmsg_flags = NLM_F_ECHO | NLM_F_NONREC; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=CRYPTO_MSG_DELALG" + ", flags=NLM_F_ECHO|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = CRYPTO_MSG_UPDATEALG; + nlh.nlmsg_flags = NLM_F_REPLACE; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=CRYPTO_MSG_UPDATEALG" + ", flags=%#x /* NLM_F_??? */, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, NLM_F_REPLACE, + (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_crypto_msg_newalg(const int fd) +{ + struct crypto_user_alg alg = { + .cru_name = "abcd", + .cru_driver_name = "efgh", + .cru_module_name = "dcba", + .cru_type = 0xabcdfabc, + .cru_mask = 0xfedabacd, + .cru_refcnt = 0xbcacfacd, + .cru_flags = 0xefacdbad + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(alg)); + + TEST_NETLINK_OBJECT_EX(fd, nlh0, + CRYPTO_MSG_NEWALG, NLM_F_REQUEST, + alg, print_quoted_memory, + printf("{cru_name=\"abcd\"" + ", cru_driver_name=\"efgh\"" + ", cru_module_name=\"dcba\""); + PRINT_FIELD_X(", ", alg, cru_type); + PRINT_FIELD_X(", ", alg, cru_mask); + PRINT_FIELD_U(", ", alg, cru_refcnt); + PRINT_FIELD_X(", ", alg, cru_flags); + printf("}")); + + fill_memory_ex(alg.cru_name, sizeof(alg.cru_name), '0', 10); + fill_memory_ex(alg.cru_driver_name, sizeof(alg.cru_driver_name), + 'a', 'z' - 'a' + 1); + fill_memory_ex(alg.cru_module_name, sizeof(alg.cru_module_name), + 'A', 'Z' - 'A' + 1); + + TEST_NETLINK_OBJECT_EX(fd, nlh0, + CRYPTO_MSG_NEWALG, NLM_F_REQUEST, + alg, print_quoted_memory, + printf("{cru_name="); + print_quoted_memory(alg.cru_name, + sizeof(alg.cru_name) - 1); + printf("..., cru_driver_name="); + print_quoted_memory(alg.cru_driver_name, + sizeof(alg.cru_driver_name) - 1); + printf("..., cru_module_name="); + print_quoted_memory(alg.cru_module_name, + sizeof(alg.cru_module_name) - 1); + PRINT_FIELD_X("..., ", alg, cru_type); + PRINT_FIELD_X(", ", alg, cru_mask); + PRINT_FIELD_U(", ", alg, cru_refcnt); + PRINT_FIELD_X(", ", alg, cru_flags); + printf("}")); +} + +static void +test_crypto_msg_unspec(const int fd) +{ + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, 4); + + TEST_NETLINK_(fd, nlh0, + 0xffff, "0xffff /* CRYPTO_MSG_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + 4, "abcd", 4, printf("\"\\x61\\x62\\x63\\x64\"")); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_CRYPTO); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + test_crypto_msg_newalg(fd); + test_crypto_msg_unspec(fd); + + printf("+++ exited with 0 +++\n"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_CRYPTOUSER_H") + +#endif diff --git a/tests-m32/netlink_crypto.gen.test b/tests-m32/netlink_crypto.gen.test new file mode 100755 index 00000000..fcb4c3d9 --- /dev/null +++ b/tests-m32/netlink_crypto.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_crypto +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/netlink_generic.c b/tests-m32/netlink_generic.c new file mode 100644 index 00000000..485ece11 --- /dev/null +++ b/tests-m32/netlink_generic.c @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +/* This test case is based on netlink_selinux.c */ + +#include "tests.h" + +#include +#include +#include +#include +#include "netlink.h" +#include + +static void +test_nlmsg_type(const int fd) +{ + /* + * Though GENL_ID_CTRL number is statically fixed in this test case, + * strace does not have a builtin knowledge that the corresponding + * string is "nlctrl". + */ + long rc; + struct { + const struct nlmsghdr nlh; + struct genlmsghdr gnlh; + } req = { + .nlh = { + .nlmsg_len = sizeof(req), + .nlmsg_type = GENL_ID_CTRL, + .nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST + }, + .gnlh = { + .cmd = CTRL_CMD_GETFAMILY + } + }; + + rc = sendto(fd, &req, sizeof(req), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=nlctrl" + ", flags=NLM_F_REQUEST|0x300, seq=0, pid=0}" + ", \"\\x03\\x00\\x00\\x00\"}, %u" + ", MSG_DONTWAIT, NULL, 0) = %s\n", + fd, req.nlh.nlmsg_len, + (unsigned int) sizeof(req), sprintrc(rc)); +} + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_GENERIC); + + test_nlmsg_type(fd); + + printf("+++ exited with 0 +++\n"); + + return 0; +} diff --git a/tests-m32/netlink_generic.gen.test b/tests-m32/netlink_generic.gen.test new file mode 100755 index 00000000..6f304d3a --- /dev/null +++ b/tests-m32/netlink_generic.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_generic +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/netlink_inet_diag.c b/tests-m32/netlink_inet_diag.c index 2332e203..e3ccc05c 100644 --- a/tests-m32/netlink_inet_diag.c +++ b/tests-m32/netlink_inet_diag.c @@ -2,29 +2,10 @@ * This file is part of inet-yy strace test. * * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,7 +13,7 @@ #include #include #include -#include +#include "netlink.h" #include #include @@ -99,8 +80,8 @@ check_responses(const int fd) perror_msg_and_skip("recvmsg"); struct nlmsghdr *h = &hdr_buf.hdr; - if (!NLMSG_OK(h, ret)) - error_msg_and_skip("!NLMSG_OK"); + if (!is_nlmsg_ok(h, ret)) + error_msg_and_skip("!is_nlmsg_ok"); if (h->nlmsg_type == NLMSG_ERROR) { const struct nlmsgerr *err = NLMSG_DATA(h); if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err))) diff --git a/tests-m32/netlink_kobject_uevent.c b/tests-m32/netlink_kobject_uevent.c new file mode 100644 index 00000000..17f3e1ea --- /dev/null +++ b/tests-m32/netlink_kobject_uevent.c @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include "netlink.h" +#include "netlink_kobject_uevent.h" + +static const char *errstr; + +static ssize_t +sys_send(const int fd, const void *const buf, const size_t len) +{ + const ssize_t rc = sendto(fd, buf, len, MSG_DONTWAIT, NULL, 0); + errstr = sprintrc(rc); + return rc; +} + +static void +test_nlmsg_type_udev(const int fd) +{ + static const char extra[] = "12345678"; + struct udev_monitor_netlink_header uh = { + .prefix = "libudev", + .magic = htonl(0xfeedcafe), + .header_size = sizeof(uh), + .properties_off = 40, + .properties_len = 299, + .filter_subsystem_hash = htonl(0xc370b302), + .filter_devtype_hash = htonl(0x10800000), + .filter_tag_bloom_hi = htonl(0x2000400), + .filter_tag_bloom_lo = htonl(0x10800000), + }; + const unsigned int extra_len = LENGTH_OF(extra); + const unsigned int uh_len = sizeof(uh); + + char *const buf = tail_alloc(uh_len + extra_len); + memcpy(buf + extra_len, &uh, uh_len); + + sys_send(fd, buf + extra_len, uh_len); + printf("sendto(%d, {{prefix=\"%s\", magic=htonl(%#x)" + ", header_size=%u, properties_off=%u, properties_len=%u" + ", filter_subsystem_hash=htonl(%#x)" + ", filter_devtype_hash=htonl(%#x)" + ", filter_tag_bloom_hi=htonl(%#x)" + ", filter_tag_bloom_lo=htonl(%#x)}}, %u, MSG_DONTWAIT, NULL, " + "0) = %s\n" + , fd, uh.prefix, + ntohl(uh.magic), uh.header_size, uh.properties_off, + uh.properties_len, ntohl(uh.filter_subsystem_hash), + ntohl(uh.filter_devtype_hash), ntohl(uh.filter_tag_bloom_hi), + ntohl(uh.filter_tag_bloom_lo), uh_len, errstr); + + memcpy(buf, &uh, uh_len); + memcpy(buf + uh_len, extra, extra_len); + sys_send(fd, buf, uh_len + extra_len); + printf("sendto(%d, {{prefix=\"%s\", magic=htonl(%#x)" + ", header_size=%u, properties_off=%u, properties_len=%u" + ", filter_subsystem_hash=htonl(%#x)" + ", filter_devtype_hash=htonl(%#x)" + ", filter_tag_bloom_hi=htonl(%#x)" + ", filter_tag_bloom_lo=htonl(%#x)}, " + , fd, uh.prefix, + ntohl(uh.magic), uh.header_size, uh.properties_off, + uh.properties_len, ntohl(uh.filter_subsystem_hash), + ntohl(uh.filter_devtype_hash), ntohl(uh.filter_tag_bloom_hi), + ntohl(uh.filter_tag_bloom_lo)); + print_quoted_memory(buf + uh_len, extra_len); + printf("}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + uh_len + extra_len, errstr); + + memcpy(buf + extra_len + 1, &uh, uh_len - 1); + sys_send(fd, buf + extra_len + 1, uh_len); + printf("sendto(%d, ", fd); + print_quoted_memory(&uh, MIN(uh_len - 1, DEFAULT_STRLEN)); + printf("%s, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + (uh_len - 1 > DEFAULT_STRLEN ? "..." : ""), + uh_len, errstr); +} + +static void +test_nlmsg_type_kernel(const int fd) +{ + struct udev_monitor_netlink_header uh = { + .prefix = "change@", + .magic = htonl(0xfeedcafe), + .header_size = sizeof(uh), + .properties_off = 10, + .properties_len = 299, + .filter_subsystem_hash = htonl(0xfffffff), + .filter_devtype_hash = htonl(0x10000000), + .filter_tag_bloom_hi = htonl(0x2000400), + }; + const unsigned int uh_len = sizeof(uh); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct udev_monitor_netlink_header, p); + memcpy(p, &uh, uh_len); + + sys_send(fd, p, uh_len); + printf("sendto(%d, ", fd); + print_quoted_memory(&uh, MIN(uh_len, DEFAULT_STRLEN)); + printf("%s, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + (uh_len > DEFAULT_STRLEN ? "..." : ""), + uh_len, errstr); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_KOBJECT_UEVENT); + + test_nlmsg_type_udev(fd); + test_nlmsg_type_kernel(fd); + /* test using data that looks like a zero-length C string */ + char *const buf = tail_alloc(DEFAULT_STRLEN + 1); + buf[0] = '='; + fill_memory_ex(buf + 1, DEFAULT_STRLEN, 0, DEFAULT_STRLEN); + + sys_send(fd, buf + 1, DEFAULT_STRLEN); + printf("sendto(%d, ", fd); + print_quoted_memory(buf + 1, DEFAULT_STRLEN); + printf(", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + DEFAULT_STRLEN, errstr); + + sys_send(fd, buf, DEFAULT_STRLEN + 1); + printf("sendto(%d, ", fd); + print_quoted_memory(buf, DEFAULT_STRLEN); + printf("..., %u, MSG_DONTWAIT, NULL, 0) = %s\n", + DEFAULT_STRLEN + 1, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/netlink_kobject_uevent.gen.test b/tests-m32/netlink_kobject_uevent.gen.test new file mode 100755 index 00000000..46bdebd1 --- /dev/null +++ b/tests-m32/netlink_kobject_uevent.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_kobject_uevent +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/netlink_netfilter.c b/tests-m32/netlink_netfilter.c new file mode 100644 index 00000000..6f535d4b --- /dev/null +++ b/tests-m32/netlink_netfilter.c @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2017, 2018 Chen Jingpiao + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_H + +# include +# include +# include +# include +# include +# include +# include "test_netlink.h" +# include +# ifdef HAVE_LINUX_NETFILTER_NF_TABLES_H +# include +# endif + +# ifndef NFNETLINK_V0 +# define NFNETLINK_V0 0 +# endif +# ifndef NFNL_SUBSYS_NFTABLES +# define NFNL_SUBSYS_NFTABLES 10 +# endif +# ifndef NFT_MSG_NEWTABLE +# define NFT_MSG_NEWTABLE 0 +# endif + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + +# ifdef NFNL_MSG_BATCH_BEGIN + nlh.nlmsg_type = NFNL_MSG_BATCH_BEGIN; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=NFNL_MSG_BATCH_BEGIN" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +# endif + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK << 8 | 0xff; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK<<8|0xff /* IPCTNL_MSG_CT_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = 0xffff; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=0xff /* NFNL_SUBSYS_??? */<<8|0xff" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_nlmsg_done(const int fd) +{ + const int num = 0xabcdefad; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(num)); + + TEST_NETLINK(fd, nlh0, NLMSG_DONE, NLM_F_REQUEST, + sizeof(num), &num, sizeof(num), + printf("%d", num)); +} + +static void +test_nfgenmsg(const int fd) +{ + static const struct nlattr nla = { + .nla_len = sizeof(nla), + .nla_type = 0x0bcd + }; + + struct nfgenmsg msg = { + .nfgen_family = AF_UNIX, + .version = NFNETLINK_V0, + .res_id = NFNL_SUBSYS_NFTABLES + }; + char str_buf[NLMSG_ALIGN(sizeof(msg)) + 4]; + char nla_buf[NLMSG_ALIGN(sizeof(msg)) + sizeof(nla)]; + + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, + MAX(sizeof(str_buf), sizeof(nla_buf))); + + TEST_NETLINK_OBJECT_EX_(fd, nlh0, + NFNL_SUBSYS_NFTABLES << 8 | NFT_MSG_NEWTABLE, + "NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_NEWTABLE", + NLM_F_REQUEST, "NLM_F_REQUEST", + msg, print_quoted_hex, + printf("{nfgen_family=AF_UNIX"); + printf(", version=NFNETLINK_V0"); + printf(", res_id="); + if (htons(NFNL_SUBSYS_NFTABLES) == NFNL_SUBSYS_NFTABLES) + printf("htons(NFNL_SUBSYS_NFTABLES)"); + else + printf("NFNL_SUBSYS_NFTABLES"); + ); + + msg.res_id = htons(NFNL_SUBSYS_NFTABLES); + TEST_NETLINK_(fd, nlh0, + NFNL_SUBSYS_NFTABLES << 8 | NFT_MSG_NEWTABLE, + "NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_NEWTABLE", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(msg), &msg, sizeof(msg), + printf("{nfgen_family=AF_UNIX"); + printf(", version=NFNETLINK_V0"); + printf(", res_id=htons(NFNL_SUBSYS_NFTABLES)")); + + msg.res_id = htons(0xabcd); + TEST_NETLINK_(fd, nlh0, + NFNL_SUBSYS_NFTABLES << 8 | NFT_MSG_NEWTABLE, + "NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_NEWTABLE", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(msg), &msg, sizeof(msg), + printf("{nfgen_family=AF_UNIX"); + printf(", version=NFNETLINK_V0"); + printf(", res_id=htons(%d)", 0xabcd)); + +# ifdef NFNL_MSG_BATCH_BEGIN + msg.res_id = htons(NFNL_SUBSYS_NFTABLES); + TEST_NETLINK(fd, nlh0, + NFNL_MSG_BATCH_BEGIN, NLM_F_REQUEST, + sizeof(msg), &msg, sizeof(msg), + printf("{nfgen_family=AF_UNIX"); + printf(", version=NFNETLINK_V0"); + printf(", res_id=htons(%d)", NFNL_SUBSYS_NFTABLES)); + + msg.res_id = htons(0xabcd); + memcpy(str_buf, &msg, sizeof(msg)); + memcpy(str_buf + NLMSG_ALIGN(sizeof(msg)), "1234", 4); + + TEST_NETLINK(fd, nlh0, + NFNL_MSG_BATCH_BEGIN, NLM_F_REQUEST, + sizeof(str_buf), str_buf, sizeof(str_buf), + printf("{nfgen_family=AF_UNIX"); + printf(", version=NFNETLINK_V0"); + printf(", res_id=htons(%d)" + ", \"\\x31\\x32\\x33\\x34\"", 0xabcd)); +# endif /* NFNL_MSG_BATCH_BEGIN */ + + msg.res_id = htons(NFNL_SUBSYS_NFTABLES); + memcpy(nla_buf, &msg, sizeof(msg)); + memcpy(nla_buf + NLMSG_ALIGN(sizeof(msg)), &nla, sizeof(nla)); + + TEST_NETLINK_(fd, nlh0, + NFNL_SUBSYS_NFTABLES << 8 | 0xff, + "NFNL_SUBSYS_NFTABLES<<8|0xff /* NFT_MSG_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(nla_buf), nla_buf, sizeof(nla_buf), + printf("{nfgen_family=AF_UNIX"); + printf(", version=NFNETLINK_V0"); + printf(", res_id=htons(NFNL_SUBSYS_NFTABLES)" + ", {nla_len=%d, nla_type=%#x}", + nla.nla_len, nla.nla_type)); +} + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_done(fd); + test_nfgenmsg(fd); + + printf("+++ exited with 0 +++\n"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_H") + +#endif diff --git a/tests-m32/netlink_netfilter.gen.test b/tests-m32/netlink_netfilter.gen.test new file mode 100755 index 00000000..94b3f369 --- /dev/null +++ b/tests-m32/netlink_netfilter.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_netfilter +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/netlink_netlink_diag.c b/tests-m32/netlink_netlink_diag.c index fc32822b..f397605f 100644 --- a/tests-m32/netlink_netlink_diag.c +++ b/tests-m32/netlink_netlink_diag.c @@ -3,29 +3,10 @@ * * Copyright (c) 2014-2016 Dmitry V. Levin * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -33,14 +14,10 @@ #include #include #include -#include +#include "netlink.h" #include #include -#if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG -# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG -#endif - static void send_query(const int fd) { @@ -58,8 +35,7 @@ send_query(const int fd) }, .ndr = { .sdiag_family = AF_NETLINK, - .sdiag_protocol = NDIAG_PROTO_ALL, - .ndiag_show = NDIAG_SHOW_MEMINFO + .sdiag_protocol = NDIAG_PROTO_ALL } }; struct iovec iov = { @@ -104,8 +80,8 @@ check_responses(const int fd) perror_msg_and_skip("recvmsg"); struct nlmsghdr *h = &hdr_buf.hdr; - if (!NLMSG_OK(h, ret)) - error_msg_and_skip("!NLMSG_OK"); + if (!is_nlmsg_ok(h, ret)) + error_msg_and_skip("!is_nlmsg_ok"); if (h->nlmsg_type == NLMSG_ERROR) { const struct nlmsgerr *err = NLMSG_DATA(h); if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err))) diff --git a/tests-m32/netlink_protocol.c b/tests-m32/netlink_protocol.c index 34e114be..fd901d88 100644 --- a/tests-m32/netlink_protocol.c +++ b/tests-m32/netlink_protocol.c @@ -1,31 +1,12 @@ /* * Check decoding of netlink protocol. * - * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2014-2017 Dmitry V. Levin * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -38,14 +19,10 @@ # include # include # include -# include +# include "netlink.h" # include # include -# if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG -# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG -# endif - static void send_query(const int fd) { @@ -87,21 +64,23 @@ send_query(const int fd) /* whole message length < sizeof(struct nlmsghdr) */ rc = sendto(fd, req->magic, sizeof(req->magic), MSG_DONTWAIT, NULL, 0); - printf("sendto(%d, \"abcd\", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + printf("sendto(%d, \"\\x61\\x62\\x63\\x64\"" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, (unsigned) sizeof(req->magic), sprintrc(rc)); /* a single message with some data */ rc = sendto(fd, req, sizeof(*req), MSG_DONTWAIT, NULL, 0); printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}, \"abcd\"}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + ", seq=0, pid=0}, \"\\x61\\x62\\x63\\x64\"}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, req->nlh.nlmsg_len, NLM_F_DUMP, (unsigned) sizeof(*req), sprintrc(rc)); /* a single message without data */ req->nlh.nlmsg_len = sizeof(req->nlh); rc = sendto(fd, &req->nlh, sizeof(req->nlh), MSG_DONTWAIT, NULL, 0); - printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + printf("sendto(%d, {len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, req->nlh.nlmsg_len, NLM_F_DUMP, (unsigned) sizeof(req->nlh), sprintrc(rc)); @@ -109,15 +88,16 @@ send_query(const int fd) req->nlh.nlmsg_len = sizeof(*req) + 8; rc = sendto(fd, req, sizeof(*req), MSG_DONTWAIT, NULL, 0); printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}, \"abcd\"}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + ", seq=0, pid=0}, \"\\x61\\x62\\x63\\x64\"}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, req->nlh.nlmsg_len, NLM_F_DUMP, (unsigned) sizeof(*req), sprintrc(rc)); /* nlmsg_len < sizeof(struct nlmsghdr) */ req->nlh.nlmsg_len = 8; rc = sendto(fd, req, sizeof(*req), MSG_DONTWAIT, NULL, 0); - printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + printf("sendto(%d, {len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, req->nlh.nlmsg_len, NLM_F_DUMP, (unsigned) sizeof(*req), sprintrc(rc)); @@ -126,14 +106,16 @@ send_query(const int fd) struct req req1; char padding[NLMSG_ALIGN(sizeof(struct req)) - sizeof(struct req)]; struct req req2; - } *const reqs = tail_alloc(sizeof(*reqs)); + }; + TAIL_ALLOC_OBJECT_CONST_PTR(struct reqs, reqs); memcpy(&reqs->req1, &c_req, sizeof(c_req)); memcpy(&reqs->req2, &c_req, sizeof(c_req)); rc = sendto(fd, reqs, sizeof(*reqs), MSG_DONTWAIT, NULL, 0); printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}, \"abcd\"}, {{len=%u, type=NLMSG_NOOP" - ", flags=NLM_F_REQUEST|0x%x, seq=0, pid=0}, \"abcd\"}]" + ", seq=0, pid=0}, \"\\x61\\x62\\x63\\x64\"}" + ", {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, \"\\x61\\x62\\x63\\x64\"}]" ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP, reqs->req2.nlh.nlmsg_len, NLM_F_DUMP, @@ -143,8 +125,8 @@ send_query(const int fd) void *const efault2 = tail_memdup(&reqs->req1, sizeof(reqs->req1)); rc = sendto(fd, efault2, sizeof(*reqs), MSG_DONTWAIT, NULL, 0); printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}, \"abcd\"}, %p], %u, MSG_DONTWAIT, NULL, 0)" - " = %s\n", + ", seq=0, pid=0}, \"\\x61\\x62\\x63\\x64\"}" + ", ... /* %p */], %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP, &((struct reqs *) efault2)->req2, (unsigned) sizeof(*reqs), sprintrc(rc)); @@ -154,26 +136,25 @@ send_query(const int fd) NULL, 0); errstr = sprintrc(rc); printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}, \"abcd\"}, \"", + ", seq=0, pid=0}, \"\\x61\\x62\\x63\\x64\"}, ", fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP); - print_quoted_memory((void *) &reqs->req2.nlh, - sizeof(reqs->req2) - sizeof(req->nlh)); - printf("\"], %u, MSG_DONTWAIT, NULL, 0) = %s\n", + print_quoted_hex(&reqs->req2.nlh, + sizeof(reqs->req2) - sizeof(req->nlh)); + printf("], %u, MSG_DONTWAIT, NULL, 0) = %s\n", (unsigned) (sizeof(*reqs) - sizeof(req->nlh)), errstr); /* second nlmsg_len < sizeof(struct nlmsghdr) */ reqs->req2.nlh.nlmsg_len = 4; rc = sendto(fd, reqs, sizeof(*reqs), MSG_DONTWAIT, NULL, 0); printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}, \"abcd\"}, {{len=%u, type=NLMSG_NOOP" - ", flags=NLM_F_REQUEST|0x%x, seq=0, pid=0}}], %u" - ", MSG_DONTWAIT, NULL, 0) = %s\n", + ", seq=0, pid=0}, \"\\x61\\x62\\x63\\x64\"}" + ", {len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}], %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP, reqs->req2.nlh.nlmsg_len, NLM_F_DUMP, (unsigned) sizeof(*reqs), sprintrc(rc)); /* abbreviated output */ -# define DEFAULT_STRLEN 32 # define ABBREV_LEN (DEFAULT_STRLEN + 1) const unsigned int msg_len = sizeof(struct nlmsghdr) * ABBREV_LEN; struct nlmsghdr *const msgs = tail_alloc(msg_len); @@ -192,31 +173,220 @@ send_query(const int fd) for (i = 0; i < DEFAULT_STRLEN; ++i) { if (i) printf(", "); - printf("{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=%u, pid=0}}", + printf("{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=%u, pid=0}", msgs[i].nlmsg_len, NLM_F_DUMP, msgs[i].nlmsg_seq); } printf(", ...], %u, MSG_DONTWAIT, NULL, 0) = %s\n", msg_len, errstr); } -int main(void) +static void +test_nlmsgerr(const int fd) +{ + struct nlmsgerr *err; + struct nlmsghdr *nlh; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(*err) + 4); + long rc; + + /* error message without enough room for the error code */ + nlh = nlh0; + nlh->nlmsg_len = NLMSG_HDRLEN + 4; + nlh->nlmsg_type = NLMSG_ERROR; + nlh->nlmsg_flags = NLM_F_REQUEST; + nlh->nlmsg_seq = 0; + nlh->nlmsg_pid = 0; + + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_ERROR, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, %p}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh->nlmsg_len, nlh0 + NLMSG_HDRLEN, + nlh->nlmsg_len, sprintrc(rc)); + + nlh->nlmsg_len = NLMSG_HDRLEN + 2; + nlh = nlh0 - 2; + memmove(nlh, nlh0, sizeof(*nlh)); + memcpy(NLMSG_DATA(nlh), "42", 2); + + rc = sendto(fd, nlh, NLMSG_HDRLEN + 2, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_ERROR, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, \"\\x34\\x32\"}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, NLMSG_HDRLEN + 2, NLMSG_HDRLEN + 2, sprintrc(rc)); + + /* error message with room for the error code only */ + nlh = nlh0 - sizeof(err->error); + nlh->nlmsg_len = NLMSG_HDRLEN + sizeof(err->error); + nlh->nlmsg_type = NLMSG_ERROR; + nlh->nlmsg_flags = NLM_F_REQUEST; + nlh->nlmsg_seq = 0; + nlh->nlmsg_pid = 0; + err = NLMSG_DATA(nlh); + err->error = 42; + + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_ERROR, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, {error=42}}, %u, MSG_DONTWAIT, NULL, 0)" + " = %s\n", fd, nlh->nlmsg_len, nlh->nlmsg_len, sprintrc(rc)); + + err->error = -1; + + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_ERROR, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, {error=-EPERM}}, %u, MSG_DONTWAIT, NULL, 0)" + " = %s\n", fd, nlh->nlmsg_len, nlh->nlmsg_len, sprintrc(rc)); + + err->error = -32767; + nlh->nlmsg_len += sizeof(err->msg.nlmsg_len); + + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_ERROR, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, {error=-32767, msg=%p}}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh->nlmsg_len, nlh0 + NLMSG_HDRLEN, + nlh->nlmsg_len, sprintrc(rc)); + + /* error message with room for the error code and a header */ + nlh = nlh0 - sizeof(*err); + nlh->nlmsg_len = NLMSG_HDRLEN + sizeof(*err); + nlh->nlmsg_type = NLMSG_ERROR; + nlh->nlmsg_flags = NLM_F_REQUEST; + nlh->nlmsg_seq = 0; + nlh->nlmsg_pid = 0; + err = NLMSG_DATA(nlh); + err->error = -13; + err->msg.nlmsg_len = NLMSG_HDRLEN; + err->msg.nlmsg_type = NLMSG_NOOP; + err->msg.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST; + err->msg.nlmsg_seq = 42; + err->msg.nlmsg_pid = 1234; + + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_ERROR, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, {error=-EACCES" + ", msg={len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=%u, pid=%u}}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh->nlmsg_len, err->msg.nlmsg_len, NLM_F_DUMP, + err->msg.nlmsg_seq, err->msg.nlmsg_pid, + nlh->nlmsg_len, sprintrc(rc)); + + /* error message with room for the error code, a header, and some data */ + nlh = nlh0 - sizeof(*err) - 4; + nlh->nlmsg_len = NLMSG_HDRLEN + sizeof(*err) + 4; + nlh->nlmsg_type = NLMSG_ERROR; + nlh->nlmsg_flags = NLM_F_REQUEST; + nlh->nlmsg_seq = 0; + nlh->nlmsg_pid = 0; + err = NLMSG_DATA(nlh); + err->error = -13; + err->msg.nlmsg_len = NLMSG_HDRLEN + 4; + err->msg.nlmsg_type = NLMSG_NOOP; + err->msg.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST; + err->msg.nlmsg_seq = 421; + err->msg.nlmsg_pid = 12345; + memcpy(NLMSG_DATA(&err->msg), "abcd", 4); + + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_ERROR, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, {error=-EACCES" + ", msg={{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=%u, pid=%u}, \"\\x61\\x62\\x63\\x64\"}}}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh->nlmsg_len, err->msg.nlmsg_len, NLM_F_DUMP, + err->msg.nlmsg_seq, err->msg.nlmsg_pid, + nlh->nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_done(const int fd) { - struct sockaddr_nl addr; - socklen_t len = sizeof(addr); - int fd; + struct nlmsghdr *nlh; + const int num = 0xfacefeed; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(num)); + long rc; + + /* NLMSG_DONE message without enough room for an integer payload */ + nlh = nlh0; + *nlh = (struct nlmsghdr) { + .nlmsg_len = NLMSG_HDRLEN + sizeof(num), + .nlmsg_type = NLMSG_DONE, + .nlmsg_flags = NLM_F_MULTI + }; + + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_DONE, flags=NLM_F_MULTI" + ", seq=0, pid=0}, %p}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh->nlmsg_len, nlh0 + NLMSG_HDRLEN, + nlh->nlmsg_len, sprintrc(rc)); + + /* NLMSG_DONE message with enough room for an oddly short payload */ + nlh->nlmsg_len = NLMSG_HDRLEN + 2; + nlh = nlh0 - 2; + /* Beware of unaligned access to nlh members. */ + memmove(nlh, nlh0, sizeof(*nlh)); + memcpy(NLMSG_DATA(nlh), "42", 2); + + rc = sendto(fd, nlh, NLMSG_HDRLEN + 2, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_DONE, flags=NLM_F_MULTI, seq=0" + ", pid=0}, \"\\x34\\x32\"}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, NLMSG_HDRLEN + 2, NLMSG_HDRLEN + 2, sprintrc(rc)); + + /* NLMSG_DONE message with enough room for an integer payload */ + nlh = nlh0 - sizeof(num); + *nlh = (struct nlmsghdr) { + .nlmsg_len = NLMSG_HDRLEN + sizeof(num), + .nlmsg_type = NLMSG_DONE, + .nlmsg_flags = NLM_F_MULTI + }; + memcpy(NLMSG_DATA(nlh), &num, sizeof(num)); - memset(&addr, 0, sizeof(addr)); - addr.nl_family = AF_NETLINK; + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_DONE, flags=NLM_F_MULTI" + ", seq=0, pid=0}, %d}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh->nlmsg_len, num, nlh->nlmsg_len, sprintrc(rc)); +} + +# if defined NLM_F_CAPPED || defined NLM_F_ACK_TLVS +static void +test_ack_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = NLMSG_ERROR, + }; - if ((fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG)) == -1) - perror_msg_and_skip("socket AF_NETLINK"); +# ifdef NLM_F_CAPPED + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_CAPPED, + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=NLMSG_ERROR" + ", flags=NLM_F_REQUEST|NLM_F_CAPPED, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +# endif + +# ifdef NLM_F_ACK_TLVS + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK_TLVS; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=NLMSG_ERROR" + ", flags=NLM_F_REQUEST|NLM_F_ACK_TLVS, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +# endif + +# if defined NLM_F_CAPPED && defined NLM_F_ACK_TLVS + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_CAPPED | NLM_F_ACK_TLVS; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=NLMSG_ERROR" + ", flags=NLM_F_REQUEST|NLM_F_CAPPED|NLM_F_ACK_TLVS, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +# endif +} +# endif - printf("socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG) = %d\n", - fd); - if (bind(fd, (struct sockaddr *) &addr, len)) - perror_msg_and_skip("bind"); - printf("bind(%d, {sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}" - ", %u) = 0\n", fd, len); +int main(void) +{ + const int fd = create_nl_socket(NETLINK_SOCK_DIAG); char *path; if (asprintf(&path, "/proc/self/fd/%u", fd) < 0) @@ -227,9 +397,13 @@ int main(void) free(path); send_query(fd); + test_nlmsgerr(fd); + test_nlmsg_done(fd); +# if defined NLM_F_CAPPED || defined NLM_F_ACK_TLVS + test_ack_flags(fd); +# endif - printf("+++ exited with 0 +++\n"); - + puts("+++ exited with 0 +++"); return 0; } diff --git a/tests-m32/netlink_protocol.gen.test b/tests-m32/netlink_protocol.gen.test new file mode 100755 index 00000000..18d06677 --- /dev/null +++ b/tests-m32/netlink_protocol.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_protocol -e trace=sendto); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=sendto diff --git a/tests-m32/netlink_protocol.test b/tests-m32/netlink_protocol.test deleted file mode 100755 index ab2bb1e8..00000000 --- a/tests-m32/netlink_protocol.test +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# Check decoding of netlink protocol. - -. "${srcdir=.}/init.sh" - -# getfdproto is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - -run_strace_match_diff -e trace=network diff --git a/tests-m32/netlink_route.c b/tests-m32/netlink_route.c new file mode 100644 index 00000000..9281e9a4 --- /dev/null +++ b/tests-m32/netlink_route.c @@ -0,0 +1,477 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include "test_netlink.h" +#ifdef HAVE_STRUCT_DCBMSG +# include +#endif +#ifdef HAVE_LINUX_FIB_RULES_H +# include +#endif +#ifdef HAVE_LINUX_IF_ADDR_H +# include +#endif +#ifdef HAVE_STRUCT_IFADDRLBLMSG +# include +#endif +#include +#include +#include +#ifdef HAVE_LINUX_NEIGHBOUR_H +# include +#endif +#ifdef HAVE_STRUCT_NETCONFMSG +# include +#endif +#include + +#define TEST_NL_ROUTE(fd_, nlh0_, type_, obj_, print_family_, ...) \ + do { \ + /* family and string */ \ + TEST_NETLINK((fd_), (nlh0_), \ + type_, NLM_F_REQUEST, \ + sizeof(obj_) - 1, \ + &(obj_), sizeof(obj_) - 1, \ + (print_family_); \ + printf(", ...}")); \ + \ + /* sizeof(obj_) */ \ + TEST_NETLINK((fd_), (nlh0_), \ + type_, NLM_F_REQUEST, \ + sizeof(obj_), &(obj_), sizeof(obj_), \ + (print_family_); \ + __VA_ARGS__); \ + \ + /* short read of sizeof(obj_) */ \ + TEST_NETLINK((fd_), (nlh0_), \ + type_, NLM_F_REQUEST, \ + sizeof(obj_), &(obj_), sizeof(obj_) - 1, \ + (print_family_); \ + printf(", %p}", \ + NLMSG_DATA(TEST_NETLINK_nlh) + 1)); \ + } while (0) + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = RTM_GETLINK, + .nlmsg_flags = NLM_F_REQUEST, + }; + + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=RTM_GETLINK" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = RTM_GETLINK; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=RTM_GETLINK" + ", flags=NLM_F_REQUEST|NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = RTM_DELACTION; + nlh.nlmsg_flags = NLM_F_ROOT; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=RTM_DELACTION" + ", flags=NLM_F_ROOT, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = RTM_NEWLINK; + nlh.nlmsg_flags = NLM_F_ECHO | NLM_F_REPLACE; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=RTM_NEWLINK" + ", flags=NLM_F_ECHO|NLM_F_REPLACE, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = RTM_DELLINK; + nlh.nlmsg_flags = NLM_F_NONREC; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=RTM_DELLINK" + ", flags=NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_nlmsg_done(const int fd) +{ + const int num = 0xabcdefad; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(num)); + + TEST_NETLINK(fd, nlh0, NLMSG_DONE, NLM_F_REQUEST, + sizeof(num), &num, sizeof(num), + printf("%d", num)); +} + +static void +test_rtnl_unspec(const int fd) +{ + uint8_t family = 0; + char buf[sizeof(family) + 4]; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(buf)); + + /* unspecified family only */ + TEST_NETLINK_(fd, nlh0, + 0xffff, "0xffff /* RTM_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(family), &family, sizeof(family), + printf("{family=AF_UNSPEC}")); + + /* unknown family only */ + family = 0xff; + TEST_NETLINK_(fd, nlh0, + 0xffff, "0xffff /* RTM_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(family), &family, sizeof(family), + printf("{family=0xff /* AF_??? */}")); + + /* short read of family */ + TEST_NETLINK_(fd, nlh0, + 0xffff, "0xffff /* RTM_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(family), &family, sizeof(family) - 1, + printf("%p", NLMSG_DATA(TEST_NETLINK_nlh))); + + /* unspecified family and string */ + family = 0; + memcpy(buf, &family, sizeof(family)); + memcpy(buf + sizeof(family), "1234", 4); + TEST_NETLINK_(fd, nlh0, + 0xffff, "0xffff /* RTM_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(buf), buf, sizeof(buf), + printf("{family=AF_UNSPEC, \"\\x31\\x32\\x33\\x34\"}")); + + /* unknown family and string */ + family = 0xfd; + memcpy(buf, &family, sizeof(family)); + TEST_NETLINK_(fd, nlh0, + 0xffff, "0xffff /* RTM_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(buf), buf, sizeof(buf), + printf("{family=%#x /* AF_??? */" + ", \"\\x31\\x32\\x33\\x34\"}", family)); +} + +static void +test_rtnl_link(const int fd) +{ + const struct ifinfomsg ifinfo = { + .ifi_family = AF_UNIX, + .ifi_type = ARPHRD_LOOPBACK, + .ifi_index = ifindex_lo(), + .ifi_flags = IFF_UP, + .ifi_change = 0xfabcdeba + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(ifinfo)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETLINK, ifinfo, + printf("{ifi_family=AF_UNIX"), + printf(", ifi_type=ARPHRD_LOOPBACK" + ", ifi_index=" IFINDEX_LO_STR + ", ifi_flags=IFF_UP"); + PRINT_FIELD_X(", ", ifinfo, ifi_change); + printf("}")); +} + +static void +test_rtnl_addr(const int fd) +{ + const struct ifaddrmsg msg = { + .ifa_family = AF_UNIX, + .ifa_prefixlen = 0xde, + .ifa_flags = IFA_F_SECONDARY, + .ifa_scope = RT_SCOPE_UNIVERSE, + .ifa_index = ifindex_lo() + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETADDR, msg, + printf("{ifa_family=AF_UNIX"), + PRINT_FIELD_U(", ", msg, ifa_prefixlen); + printf(", ifa_flags=IFA_F_SECONDARY" + ", ifa_scope=RT_SCOPE_UNIVERSE" + ", ifa_index=" IFINDEX_LO_STR); + printf("}")); +} + +static void +test_rtnl_route(const int fd) +{ + static const struct rtmsg msg = { + .rtm_family = AF_UNIX, + .rtm_dst_len = 0xaf, + .rtm_src_len = 0xda, + .rtm_tos = IPTOS_LOWDELAY, + .rtm_table = RT_TABLE_DEFAULT, + .rtm_protocol = RTPROT_KERNEL, + .rtm_scope = RT_SCOPE_UNIVERSE, + .rtm_type = RTN_LOCAL, + .rtm_flags = RTM_F_NOTIFY + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETROUTE, msg, + printf("{rtm_family=AF_UNIX"), + PRINT_FIELD_U(", ", msg, rtm_dst_len); + PRINT_FIELD_U(", ", msg, rtm_src_len); + printf(", rtm_tos=IPTOS_LOWDELAY" + ", rtm_table=RT_TABLE_DEFAULT" + ", rtm_protocol=RTPROT_KERNEL" + ", rtm_scope=RT_SCOPE_UNIVERSE" + ", rtm_type=RTN_LOCAL" + ", rtm_flags=RTM_F_NOTIFY}")); +} + +#ifdef HAVE_LINUX_FIB_RULES_H +static void +test_rtnl_rule(const int fd) +{ + struct rtmsg msg = { + .rtm_family = AF_UNIX, + .rtm_dst_len = 0xaf, + .rtm_src_len = 0xda, + .rtm_tos = IPTOS_LOWDELAY, + .rtm_table = RT_TABLE_UNSPEC, + .rtm_type = FR_ACT_TO_TBL, + .rtm_flags = FIB_RULE_INVERT + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETRULE, msg, + printf("{family=AF_UNIX"), + printf(", dst_len=%u, src_len=%u" + ", tos=IPTOS_LOWDELAY" + ", table=RT_TABLE_UNSPEC" + ", action=FR_ACT_TO_TBL" + ", flags=FIB_RULE_INVERT}", + msg.rtm_dst_len, + msg.rtm_src_len)); +} +#endif + +static void +test_rtnl_neigh(const int fd) +{ + const struct ndmsg msg = { + .ndm_family = AF_UNIX, + .ndm_ifindex = ifindex_lo(), + .ndm_state = NUD_PERMANENT, + .ndm_flags = NTF_PROXY, + .ndm_type = RTN_UNSPEC + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETNEIGH, msg, + printf("{ndm_family=AF_UNIX"), + printf(", ndm_ifindex=" IFINDEX_LO_STR + ", ndm_state=NUD_PERMANENT" + ", ndm_flags=NTF_PROXY" + ", ndm_type=RTN_UNSPEC}")); +} + +static void +test_rtnl_neightbl(const int fd) +{ + static const struct ndtmsg msg = { + .ndtm_family = AF_NETLINK + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NETLINK(fd, nlh0, + RTM_GETNEIGHTBL, NLM_F_REQUEST, + sizeof(msg), &msg, sizeof(msg), + printf("{ndtm_family=AF_NETLINK}")); +} + +static void +test_rtnl_tc(const int fd) +{ + const struct tcmsg msg = { + .tcm_family = AF_UNIX, + .tcm_ifindex = ifindex_lo(), + .tcm_handle = 0xfadcdafb, + .tcm_parent = 0xafbcadab, + .tcm_info = 0xbcaedafa + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETQDISC, msg, + printf("{tcm_family=AF_UNIX"), + printf(", tcm_ifindex=" IFINDEX_LO_STR); + PRINT_FIELD_U(", ", msg, tcm_handle); + PRINT_FIELD_U(", ", msg, tcm_parent); + PRINT_FIELD_U(", ", msg, tcm_info); + printf("}")); +} + +static void +test_rtnl_tca(const int fd) +{ + struct tcamsg msg = { + .tca_family = AF_INET + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NETLINK(fd, nlh0, + RTM_GETACTION, NLM_F_REQUEST, + sizeof(msg), &msg, sizeof(msg), + printf("{tca_family=AF_INET}")); +} + +#ifdef HAVE_STRUCT_IFADDRLBLMSG +static void +test_rtnl_addrlabel(const int fd) +{ + const struct ifaddrlblmsg msg = { + .ifal_family = AF_UNIX, + .ifal_prefixlen = 0xaf, + .ifal_flags = 0xbd, + .ifal_index = ifindex_lo(), + .ifal_seq = 0xfadcdafb + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETADDRLABEL, msg, + printf("{ifal_family=AF_UNIX"), + PRINT_FIELD_U(", ", msg, ifal_prefixlen); + PRINT_FIELD_U(", ", msg, ifal_flags); + printf(", ifal_index=" IFINDEX_LO_STR); + PRINT_FIELD_U(", ", msg, ifal_seq); + printf("}")); +} +#endif + +#ifdef HAVE_STRUCT_DCBMSG +static void +test_rtnl_dcb(const int fd) +{ + static const struct dcbmsg msg = { + .dcb_family = AF_UNIX, + .cmd = DCB_CMD_UNDEFINED + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETDCB, msg, + printf("{dcb_family=AF_UNIX"), + printf(", cmd=DCB_CMD_UNDEFINED}")); +} +#endif + +#ifdef HAVE_STRUCT_NETCONFMSG +static void +test_rtnl_netconf(const int fd) +{ + static const struct netconfmsg msg = { + .ncm_family = AF_INET + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NETLINK(fd, nlh0, + RTM_GETNETCONF, NLM_F_REQUEST, + sizeof(msg), &msg, sizeof(msg), + printf("{ncm_family=AF_INET}")); +} +#endif + +#ifdef HAVE_STRUCT_BR_PORT_MSG +static void +test_rtnl_mdb(const int fd) +{ + const struct br_port_msg msg = { + .family = AF_UNIX, + .ifindex = ifindex_lo() + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETMDB, msg, + printf("{family=AF_UNIX"), + printf(", ifindex=" IFINDEX_LO_STR "}")); +} +#endif + +#ifdef RTM_NEWNSID +static void +test_rtnl_nsid(const int fd) +{ + static const struct rtgenmsg msg = { + .rtgen_family = AF_UNIX + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NETLINK(fd, nlh0, + RTM_GETNSID, NLM_F_REQUEST, + sizeof(msg), &msg, sizeof(msg), + printf("{rtgen_family=AF_UNIX}")); +} +#endif + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_ROUTE); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + test_nlmsg_done(fd); + test_rtnl_unspec(fd); + test_rtnl_link(fd); + test_rtnl_addr(fd); + test_rtnl_route(fd); +#ifdef HAVE_LINUX_FIB_RULES_H + test_rtnl_rule(fd); +#endif + test_rtnl_neigh(fd); + test_rtnl_neightbl(fd); + test_rtnl_tc(fd); + test_rtnl_tca(fd); +#ifdef HAVE_STRUCT_IFADDRLBLMSG + test_rtnl_addrlabel(fd); +#endif +#ifdef HAVE_STRUCT_DCBMSG + test_rtnl_dcb(fd); +#endif +#ifdef HAVE_STRUCT_NETCONFMSG + test_rtnl_netconf(fd); +#endif +#ifdef HAVE_STRUCT_BR_PORT_MSG + test_rtnl_mdb(fd); +#endif +#ifdef RTM_NEWNSID + test_rtnl_nsid(fd); +#endif + + printf("+++ exited with 0 +++\n"); + + return 0; +} diff --git a/tests-m32/netlink_route.gen.test b/tests-m32/netlink_route.gen.test new file mode 100755 index 00000000..bd9c0d95 --- /dev/null +++ b/tests-m32/netlink_route.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_route +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/netlink_selinux.c b/tests-m32/netlink_selinux.c new file mode 100644 index 00000000..85b50478 --- /dev/null +++ b/tests-m32/netlink_selinux.c @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include "test_netlink.h" +#include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = SELNL_MSG_SETENFORCE, + .nlmsg_flags = NLM_F_REQUEST, + }; + + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=SELNL_MSG_SETENFORCE" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_selnl_msg_unspec(const int fd) +{ + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, 4); + + TEST_NETLINK_(fd, nlh0, + 0xffff, "0xffff /* SELNL_MSG_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + 4, "1234", 4, + printf("\"\\x31\\x32\\x33\\x34\"")); +} + +static void +test_selnl_msg_setenforce(const int fd) +{ + static const struct selnl_msg_setenforce msg = { + .val = 0xfbdcdfab + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NETLINK_OBJECT(fd, nlh0, + SELNL_MSG_SETENFORCE, NLM_F_REQUEST, msg, + PRINT_FIELD_D("{", msg, val); + printf("}")); +} + +static void +test_selnl_msg_policyload(const int fd) +{ + static const struct selnl_msg_policyload msg = { + .seqno = 0xabdcfabc + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NETLINK_OBJECT(fd, nlh0, + SELNL_MSG_POLICYLOAD, NLM_F_REQUEST, msg, + PRINT_FIELD_U("{", msg, seqno); + printf("}")); +} + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_SELINUX); + + test_nlmsg_type(fd); + test_selnl_msg_unspec(fd); + test_selnl_msg_setenforce(fd); + test_selnl_msg_policyload(fd); + + printf("+++ exited with 0 +++\n"); + + return 0; +} diff --git a/tests-m32/netlink_selinux.gen.test b/tests-m32/netlink_selinux.gen.test new file mode 100755 index 00000000..484ffae7 --- /dev/null +++ b/tests-m32/netlink_selinux.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_selinux +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/netlink_sock_diag-v.sh b/tests-m32/netlink_sock_diag-v.sh new file mode 100755 index 00000000..0fb467db --- /dev/null +++ b/tests-m32/netlink_sock_diag-v.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# +# Check verbose decoding of NETLINK_SOCK_DIAG protocol +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog ../netlink_netlink_diag +run_strace_match_diff -v -e trace=sendto diff --git a/tests-m32/netlink_sock_diag.c b/tests-m32/netlink_sock_diag.c new file mode 100644 index 00000000..591c3944 --- /dev/null +++ b/tests-m32/netlink_sock_diag.c @@ -0,0 +1,659 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include "test_netlink.h" +#include +#include +#include +#include +#ifdef AF_SMC +# include +#endif +#include +#include + +#define SMC_ACTIVE 1 + +#define TEST_SOCK_DIAG(fd_, nlh0_, \ + family_, type_, flags_, \ + obj_, print_family_, ...) \ + \ + do { \ + /* family only */ \ + uint8_t family = (family_); \ + TEST_NETLINK_((fd_), (nlh0_), \ + type_, #type_, \ + flags_, #flags_, \ + sizeof(family), &family, sizeof(family), \ + printf("{family=%s}", #family_)); \ + \ + /* family and string */ \ + char buf[sizeof(family) + 4]; \ + memcpy(buf, &family, sizeof(family)); \ + memcpy(buf + sizeof(family), "1234", 4); \ + TEST_NETLINK_((fd_), (nlh0_), \ + type_, #type_, \ + flags_, #flags_, \ + sizeof(buf), buf, sizeof(buf), \ + (print_family_); \ + printf(", ...}")); \ + \ + /* sizeof(obj_) */ \ + TEST_NETLINK_((fd_), (nlh0_), \ + type_, #type_, \ + flags_, #flags_, \ + sizeof(obj_), &(obj_), sizeof(obj_), \ + (print_family_); \ + __VA_ARGS__); \ + \ + /* short read of sizeof(obj_) */ \ + TEST_NETLINK_((fd_), (nlh0_), \ + type_, #type_, \ + flags_, #flags_, \ + sizeof(obj_), &(obj_), sizeof(obj_) - 1, \ + (print_family_); \ + printf(", %p}", \ + NLMSG_DATA(TEST_NETLINK_nlh) + 1));\ + } while (0) + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_REQUEST, + }; + + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP, + }; + + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_REQUEST|NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_odd_family_req(const int fd) +{ + uint8_t family = 0; + char buf[sizeof(family) + 4]; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(buf)); + + /* unspecified family only */ + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, + NLM_F_REQUEST, + sizeof(family), &family, sizeof(family), + printf("{family=AF_UNSPEC}")); + + /* unknown family only */ + family = 0xff; + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, + NLM_F_REQUEST, + sizeof(family), &family, sizeof(family), + printf("{family=%#x /* AF_??? */}", family)); + + /* short read of family */ + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, + NLM_F_REQUEST, + sizeof(family), &family, sizeof(family) - 1, + printf("%p", NLMSG_DATA(TEST_NETLINK_nlh))); + + /* unspecified family and string */ + family = 0; + memcpy(buf, &family, sizeof(family)); + memcpy(buf + sizeof(family), "1234", 4); + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, + NLM_F_REQUEST, + sizeof(buf), buf, sizeof(buf), + printf("{family=AF_UNSPEC, \"\\x31\\x32\\x33\\x34\"}")); + + /* unknown family and string */ + family = 0xfd; + memcpy(buf, &family, sizeof(family)); + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, + NLM_F_REQUEST, + sizeof(buf), buf, sizeof(buf), + printf("{family=%#x /* AF_??? */" + ", \"\\x31\\x32\\x33\\x34\"}", family)); +} + +static void +test_odd_family_msg(const int fd) +{ + uint8_t family = 0; + char buf[sizeof(family) + 4]; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(buf)); + + /* unspecified family only */ + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, NLM_F_DUMP, + sizeof(family), &family, sizeof(family), + printf("{family=AF_UNSPEC}")); + + /* unknown family only */ + family = 0xff; + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, NLM_F_DUMP, + sizeof(family), &family, sizeof(family), + printf("{family=%#x /* AF_??? */}", family)); + + /* short read of family */ + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, NLM_F_DUMP, + sizeof(family), &family, sizeof(family) - 1, + printf("%p", NLMSG_DATA(TEST_NETLINK_nlh))); + + /* unspecified family and string */ + family = 0; + memcpy(buf, &family, sizeof(family)); + memcpy(buf + sizeof(family), "1234", 4); + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, NLM_F_DUMP, + sizeof(buf), buf, sizeof(buf), + printf("{family=AF_UNSPEC, \"\\x31\\x32\\x33\\x34\"}")); + + /* unknown family and string */ + family = 0xfd; + memcpy(buf, &family, sizeof(family)); + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, NLM_F_DUMP, + sizeof(buf), buf, sizeof(buf), + printf("{family=%#x /* AF_??? */" + ", \"\\x31\\x32\\x33\\x34\"}", family)); +} + +static void +test_unix_diag_req(const int fd) +{ + static const struct unix_diag_req req = { + .sdiag_family = AF_UNIX, + .sdiag_protocol = 253, + .udiag_states = 1 << TCP_ESTABLISHED | 1 << TCP_LISTEN, + .udiag_ino = 0xfacefeed, + .udiag_show = UDIAG_SHOW_NAME, + .udiag_cookie = { 0xdeadbeef, 0xbadc0ded } + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(req)); + TEST_SOCK_DIAG(fd, nlh0, AF_UNIX, + SOCK_DIAG_BY_FAMILY, NLM_F_REQUEST, req, + printf("{sdiag_family=AF_UNIX"), + PRINT_FIELD_U(", ", req, sdiag_protocol); + printf(", udiag_states=1< + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,14 +17,10 @@ #include #include #include -#include +#include "netlink.h" #include #include -#if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG -# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG -#endif - static void send_query(const int fd) { @@ -107,8 +84,8 @@ check_responses(const int fd) perror_msg_and_skip("recvmsg"); struct nlmsghdr *h = &hdr_buf.hdr; - if (!NLMSG_OK(h, ret)) - error_msg_and_skip("!NLMSG_OK"); + if (!is_nlmsg_ok(h, ret)) + error_msg_and_skip("!is_nlmsg_ok"); if (h->nlmsg_type == NLMSG_ERROR) { const struct nlmsgerr *err = NLMSG_DATA(h); if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err))) diff --git a/tests-m32/netlink_xfrm.c b/tests-m32/netlink_xfrm.c new file mode 100644 index 00000000..26095fba --- /dev/null +++ b/tests-m32/netlink_xfrm.c @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include "netlink.h" +#include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = XFRM_MSG_NEWSA, + .nlmsg_flags = NLM_F_REQUEST, + }; + + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=XFRM_MSG_NEWSA" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = XFRM_MSG_GETSA; + nlh.nlmsg_flags = NLM_F_DUMP; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=XFRM_MSG_GETSA" + ", flags=NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = XFRM_MSG_NEWSA; + nlh.nlmsg_flags = NLM_F_REPLACE; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=XFRM_MSG_NEWSA" + ", flags=NLM_F_REPLACE, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = XFRM_MSG_DELSA; + nlh.nlmsg_flags = NLM_F_ECHO | NLM_F_NONREC; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=XFRM_MSG_DELSA" + ", flags=NLM_F_ECHO|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = XFRM_MSG_ALLOCSPI; + nlh.nlmsg_flags = NLM_F_ECHO | NLM_F_REPLACE; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=XFRM_MSG_ALLOCSPI" + ", flags=NLM_F_ECHO|%#x, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, NLM_F_REPLACE, + (unsigned) sizeof(nlh), sprintrc(rc)); +} + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_XFRM); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + printf("+++ exited with 0 +++\n"); + + return 0; +} diff --git a/tests-m32/netlink_xfrm.gen.test b/tests-m32/netlink_xfrm.gen.test new file mode 100755 index 00000000..36918982 --- /dev/null +++ b/tests-m32/netlink_xfrm.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_xfrm +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/newfstatat.c b/tests-m32/newfstatat.c index b501d880..955dce6d 100644 --- a/tests-m32/newfstatat.c +++ b/tests-m32/newfstatat.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/newfstatat.gen.test b/tests-m32/newfstatat.gen.test new file mode 100755 index 00000000..40ec797c --- /dev/null +++ b/tests-m32/newfstatat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (newfstatat -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests-m32/newfstatat.test b/tests-m32/newfstatat.test deleted file mode 100755 index 6d83ec08..00000000 --- a/tests-m32/newfstatat.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check newfstatat syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests-m32/nfnetlink_acct.c b/tests-m32/nfnetlink_acct.c new file mode 100644 index 00000000..7e4f6d5d --- /dev/null +++ b/tests-m32/nfnetlink_acct.c @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_ACCT_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_ACCT << 8 | NFNL_MSG_ACCT_NEW; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_ACCT<<8|NFNL_MSG_ACCT_NEW" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_ACCT << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_ACCT<<8|0xff /* NFNL_MSG_ACCT_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = NFNL_SUBSYS_ACCT << 8 | NFNL_MSG_ACCT_NEW; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_ACCT<<8|NFNL_MSG_ACCT_NEW" + ", flags=NLM_F_REQUEST|NLM_F_CREATE, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_ACCT << 8 | NFNL_MSG_ACCT_GET; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_MATCH; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_ACCT<<8|NFNL_MSG_ACCT_GET" + ", flags=NLM_F_REQUEST|NLM_F_MATCH, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_ACCT << 8 | NFNL_MSG_ACCT_DEL; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_NONREC; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_ACCT<<8|NFNL_MSG_ACCT_DEL" + ", flags=NLM_F_REQUEST|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_ACCT_H") + +#endif diff --git a/tests-m32/nfnetlink_acct.gen.test b/tests-m32/nfnetlink_acct.gen.test new file mode 100755 index 00000000..e3aa8892 --- /dev/null +++ b/tests-m32/nfnetlink_acct.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_acct +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nfnetlink_cthelper.c b/tests-m32/nfnetlink_cthelper.c new file mode 100644 index 00000000..860ad293 --- /dev/null +++ b/tests-m32/nfnetlink_cthelper.c @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_CTHELPER_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_CTHELPER << 8 | NFNL_MSG_CTHELPER_NEW; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTHELPER<<8|NFNL_MSG_CTHELPER_NEW" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTHELPER << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTHELPER<<8|0xff /* NFNL_MSG_CTHELPER_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = NFNL_SUBSYS_CTHELPER << 8 | NFNL_MSG_CTHELPER_NEW; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_REPLACE; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTHELPER<<8|NFNL_MSG_CTHELPER_NEW" + ", flags=NLM_F_REQUEST|NLM_F_REPLACE, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTHELPER << 8 | NFNL_MSG_CTHELPER_GET; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTHELPER<<8|NFNL_MSG_CTHELPER_GET" + ", flags=NLM_F_REQUEST|NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTHELPER << 8 | NFNL_MSG_CTHELPER_DEL; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_NONREC; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTHELPER<<8|NFNL_MSG_CTHELPER_DEL" + ", flags=NLM_F_REQUEST|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_CTHELPER_H") + +#endif diff --git a/tests-m32/nfnetlink_cthelper.gen.test b/tests-m32/nfnetlink_cthelper.gen.test new file mode 100755 index 00000000..fa26e14a --- /dev/null +++ b/tests-m32/nfnetlink_cthelper.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_cthelper +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nfnetlink_ctnetlink.c b/tests-m32/nfnetlink_ctnetlink.c new file mode 100644 index 00000000..ee53ef88 --- /dev/null +++ b/tests-m32/nfnetlink_ctnetlink.c @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_CONNTRACK_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK << 8 | IPCTNL_MSG_CT_NEW; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK<<8|IPCTNL_MSG_CT_NEW" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK<<8|0xff /* IPCTNL_MSG_CT_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK << 8 | IPCTNL_MSG_CT_NEW; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_REPLACE; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK<<8|IPCTNL_MSG_CT_NEW" + ", flags=NLM_F_REQUEST|NLM_F_REPLACE, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK << 8 | IPCTNL_MSG_CT_GET; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK<<8|IPCTNL_MSG_CT_GET" + ", flags=NLM_F_REQUEST|NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK << 8 | IPCTNL_MSG_CT_DELETE; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_NONREC; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK<<8|IPCTNL_MSG_CT_DELETE" + ", flags=NLM_F_REQUEST|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_CONNTRACK_H") + +#endif diff --git a/tests-m32/nfnetlink_ctnetlink.gen.test b/tests-m32/nfnetlink_ctnetlink.gen.test new file mode 100755 index 00000000..9e9ad153 --- /dev/null +++ b/tests-m32/nfnetlink_ctnetlink.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_ctnetlink +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nfnetlink_ctnetlink_exp.c b/tests-m32/nfnetlink_ctnetlink_exp.c new file mode 100644 index 00000000..13c8a3bc --- /dev/null +++ b/tests-m32/nfnetlink_ctnetlink_exp.c @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_CONNTRACK_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK_EXP << 8 | IPCTNL_MSG_EXP_NEW; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_EXP<<8|IPCTNL_MSG_EXP_NEW" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK_EXP << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_EXP<<8|0xff /* IPCTNL_MSG_EXP_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK_EXP << 8 | IPCTNL_MSG_EXP_NEW; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_EXCL; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_EXP<<8|IPCTNL_MSG_EXP_NEW" + ", flags=NLM_F_REQUEST|NLM_F_EXCL, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK_EXP << 8 | IPCTNL_MSG_EXP_GET; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ROOT; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_EXP<<8|IPCTNL_MSG_EXP_GET" + ", flags=NLM_F_REQUEST|NLM_F_ROOT, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK_EXP << 8 | IPCTNL_MSG_EXP_DELETE; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_NONREC; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_EXP<<8|IPCTNL_MSG_EXP_DELETE" + ", flags=NLM_F_REQUEST|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_CONNTRACK_H") + +#endif diff --git a/tests-m32/nfnetlink_ctnetlink_exp.gen.test b/tests-m32/nfnetlink_ctnetlink_exp.gen.test new file mode 100755 index 00000000..4ed3707e --- /dev/null +++ b/tests-m32/nfnetlink_ctnetlink_exp.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_ctnetlink_exp +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nfnetlink_cttimeout.c b/tests-m32/nfnetlink_cttimeout.c new file mode 100644 index 00000000..9602df7c --- /dev/null +++ b/tests-m32/nfnetlink_cttimeout.c @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_CTTIMEOUT_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = + NFNL_SUBSYS_CTNETLINK_TIMEOUT << 8 | IPCTNL_MSG_TIMEOUT_NEW; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_TIMEOUT<<8|IPCTNL_MSG_TIMEOUT_NEW" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK_TIMEOUT << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_TIMEOUT<<8|0xff /* IPCTNL_MSG_TIMEOUT_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = + NFNL_SUBSYS_CTNETLINK_TIMEOUT << 8 | IPCTNL_MSG_TIMEOUT_NEW; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_APPEND; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_TIMEOUT<<8|IPCTNL_MSG_TIMEOUT_NEW" + ", flags=NLM_F_REQUEST|NLM_F_APPEND, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = + NFNL_SUBSYS_CTNETLINK_TIMEOUT << 8 | IPCTNL_MSG_TIMEOUT_GET; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ATOMIC; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_TIMEOUT<<8|IPCTNL_MSG_TIMEOUT_GET" + ", flags=NLM_F_REQUEST|NLM_F_ATOMIC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = + NFNL_SUBSYS_CTNETLINK_TIMEOUT << 8 | IPCTNL_MSG_TIMEOUT_DELETE; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_NONREC; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_TIMEOUT<<8|IPCTNL_MSG_TIMEOUT_DELETE" + ", flags=NLM_F_REQUEST|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_CTTIMEOUT_H") + +#endif diff --git a/tests-m32/nfnetlink_cttimeout.gen.test b/tests-m32/nfnetlink_cttimeout.gen.test new file mode 100755 index 00000000..ab42fc78 --- /dev/null +++ b/tests-m32/nfnetlink_cttimeout.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_cttimeout +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nfnetlink_ipset.c b/tests-m32/nfnetlink_ipset.c new file mode 100644 index 00000000..853ac307 --- /dev/null +++ b/tests-m32/nfnetlink_ipset.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_IPSET_IP_SET_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_IPSET << 8 | IPSET_CMD_NONE; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_IPSET<<8|IPSET_CMD_NONE" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_IPSET << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_IPSET<<8|0xff /* IPSET_CMD_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_IPSET_IP_SET_H") + +#endif diff --git a/tests-m32/nfnetlink_ipset.gen.test b/tests-m32/nfnetlink_ipset.gen.test new file mode 100755 index 00000000..ea129fbc --- /dev/null +++ b/tests-m32/nfnetlink_ipset.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_ipset +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nfnetlink_nft_compat.c b/tests-m32/nfnetlink_nft_compat.c new file mode 100644 index 00000000..e5514f66 --- /dev/null +++ b/tests-m32/nfnetlink_nft_compat.c @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NF_TABLES_COMPAT_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_NFT_COMPAT << 8 | NFNL_MSG_COMPAT_GET; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFT_COMPAT<<8|NFNL_MSG_COMPAT_GET" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_NFT_COMPAT << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFT_COMPAT<<8|0xff /* NFNL_MSG_COMPAT_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = NFNL_SUBSYS_NFT_COMPAT << 8 | NFNL_MSG_COMPAT_GET; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFT_COMPAT<<8|NFNL_MSG_COMPAT_GET" + ", flags=NLM_F_REQUEST|NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NF_TABLES_COMPAT_H") + +#endif diff --git a/tests-m32/nfnetlink_nft_compat.gen.test b/tests-m32/nfnetlink_nft_compat.gen.test new file mode 100755 index 00000000..aff04c5f --- /dev/null +++ b/tests-m32/nfnetlink_nft_compat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_nft_compat +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nfnetlink_nftables.c b/tests-m32/nfnetlink_nftables.c new file mode 100644 index 00000000..e959f703 --- /dev/null +++ b/tests-m32/nfnetlink_nftables.c @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NF_TABLES_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_NFTABLES << 8 | NFT_MSG_NEWTABLE; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_NEWTABLE" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_NFTABLES << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFTABLES<<8|0xff /* NFT_MSG_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = NFNL_SUBSYS_NFTABLES << 8 | NFT_MSG_NEWTABLE; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_REPLACE; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_NEWTABLE" + ", flags=NLM_F_REQUEST|NLM_F_REPLACE, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_NFTABLES << 8 | NFT_MSG_GETTABLE; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_GETTABLE" + ", flags=NLM_F_REQUEST|NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_NFTABLES << 8 | NFT_MSG_DELTABLE; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_NONREC; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_DELTABLE" + ", flags=NLM_F_REQUEST|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NF_TABLES_H") + +#endif diff --git a/tests-m32/nfnetlink_nftables.gen.test b/tests-m32/nfnetlink_nftables.gen.test new file mode 100755 index 00000000..c23ad330 --- /dev/null +++ b/tests-m32/nfnetlink_nftables.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_nftables +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nfnetlink_osf.c b/tests-m32/nfnetlink_osf.c new file mode 100644 index 00000000..755615fc --- /dev/null +++ b/tests-m32/nfnetlink_osf.c @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_XT_OSF_H + +# include +# include +# include "netlink.h" +# include +# include +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_OSF << 8 | OSF_MSG_ADD; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_OSF<<8|OSF_MSG_ADD" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_OSF << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_OSF<<8|0xff /* OSF_MSG_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_XT_OSF_H") + +#endif diff --git a/tests-m32/nfnetlink_osf.gen.test b/tests-m32/nfnetlink_osf.gen.test new file mode 100755 index 00000000..aa540907 --- /dev/null +++ b/tests-m32/nfnetlink_osf.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_osf +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nfnetlink_queue.c b/tests-m32/nfnetlink_queue.c new file mode 100644 index 00000000..960c497e --- /dev/null +++ b/tests-m32/nfnetlink_queue.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_QUEUE_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_QUEUE << 8 | NFQNL_MSG_PACKET; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_QUEUE<<8|NFQNL_MSG_PACKET" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_QUEUE << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_QUEUE<<8|0xff /* NFQNL_MSG_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_QUEUE_H") + +#endif diff --git a/tests-m32/nfnetlink_queue.gen.test b/tests-m32/nfnetlink_queue.gen.test new file mode 100755 index 00000000..965e0d24 --- /dev/null +++ b/tests-m32/nfnetlink_queue.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_queue +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nfnetlink_ulog.c b/tests-m32/nfnetlink_ulog.c new file mode 100644 index 00000000..294e9a7e --- /dev/null +++ b/tests-m32/nfnetlink_ulog.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_LOG_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_ULOG << 8 | NFULNL_MSG_PACKET; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_ULOG<<8|NFULNL_MSG_PACKET" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_ULOG << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_ULOG<<8|0xff /* NFULNL_MSG_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_LOG_H") + +#endif diff --git a/tests-m32/nfnetlink_ulog.gen.test b/tests-m32/nfnetlink_ulog.gen.test new file mode 100755 index 00000000..825ad9f6 --- /dev/null +++ b/tests-m32/nfnetlink_ulog.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_ulog +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr.c b/tests-m32/nlattr.c new file mode 100644 index 00000000..2c5927b2 --- /dev/null +++ b/tests-m32/nlattr.c @@ -0,0 +1,313 @@ +/* + * Check decoding of netlink attribute. + * + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include "netlink.h" +#include +#include +#include + +static void +test_nlattr(const int fd) +{ + static const struct msg { + struct nlmsghdr nlh; + struct unix_diag_msg udm; + } c_msg = { + .nlh = { + .nlmsg_len = sizeof(struct msg), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP + }, + .udm = { + .udiag_family = AF_UNIX, + .udiag_type = SOCK_STREAM, + .udiag_state = TCP_FIN_WAIT1 + } + }; + struct msg *msg; + struct nlattr *nla; + unsigned int msg_len; + long rc; + + /* fetch fail: len < sizeof(struct nlattr) */ + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + 2; + msg = tail_memdup(&c_msg, msg_len); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + memcpy(nla, "12", 2); + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, \"\\x31\\x32\"}, %u" + ", MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, msg_len, sprintrc(rc)); + + /* fetch fail: short read */ + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + sizeof(*nla); + msg = tail_memdup(&c_msg, msg_len - 1); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, %p}, %u" + ", MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, (void *) msg + NLMSG_SPACE(sizeof(msg->udm)), + msg_len, sprintrc(rc)); + + /* print one struct nlattr */ + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + sizeof(*nla); + msg = tail_memdup(&c_msg, msg_len); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + *nla = (struct nlattr) { + .nla_len = sizeof(*nla), + .nla_type = UNIX_DIAG_NAME + }; + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {nla_len=%u" + ", nla_type=UNIX_DIAG_NAME}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, msg_len, sprintrc(rc)); + + /* print one struct nlattr with nla_len out of msg_len bounds */ + nla->nla_len += 8; + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {nla_len=%u" + ", nla_type=UNIX_DIAG_NAME}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, msg_len, sprintrc(rc)); + + /* print one struct nlattr and some data */ + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + NLA_HDRLEN + 4; + msg = tail_memdup(&c_msg, msg_len); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + *nla = (struct nlattr) { + .nla_len = NLA_HDRLEN + 4, + .nla_type = UNIX_DIAG_SHUTDOWN + 1 + }; + memcpy(RTA_DATA(nla), "1234", 4); + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {{nla_len=%u" + ", nla_type=%#x /* UNIX_DIAG_??? */}" + ", \"\\x31\\x32\\x33\\x34\"}}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, UNIX_DIAG_SHUTDOWN + 1, + msg_len, sprintrc(rc)); + + /* print one struct nlattr and fetch fail second struct nlattr */ + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + NLA_HDRLEN + 2; + msg = tail_memdup(&c_msg, msg_len); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + SET_STRUCT(struct nlattr, nla, + .nla_len = NLA_HDRLEN, + .nla_type = UNIX_DIAG_NAME + ); + memcpy(nla + 1, "12", 2); + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, [{nla_len=%u" + ", nla_type=UNIX_DIAG_NAME}, \"\\x31\\x32\"]}, %u" + ", MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, NLA_HDRLEN, msg_len, sprintrc(rc)); + + /* print one struct nlattr and short read of second struct nlattr */ + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + NLA_HDRLEN * 2; + msg = tail_memdup(&c_msg, msg_len - 1); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + SET_STRUCT(struct nlattr, nla, + .nla_len = NLA_HDRLEN, + .nla_type = UNIX_DIAG_NAME + ); + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, [{nla_len=%u" + ", nla_type=UNIX_DIAG_NAME}, ... /* %p */]}, %u" + ", MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, NLA_HDRLEN, nla + 1, msg_len, sprintrc(rc)); + + /* print two struct nlattr */ + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + NLA_HDRLEN * 2; + msg = tail_memdup(&c_msg, msg_len); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + *nla = (struct nlattr) { + .nla_len = NLA_HDRLEN, + .nla_type = UNIX_DIAG_NAME + }; + *(nla + 1) = (struct nlattr) { + .nla_len = NLA_HDRLEN, + .nla_type = UNIX_DIAG_PEER + }; + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, [{nla_len=%u" + ", nla_type=UNIX_DIAG_NAME}, {nla_len=%u" + ", nla_type=UNIX_DIAG_PEER}]}, %u" + ", MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, nla->nla_len, + msg_len, sprintrc(rc)); + + /* print first nlattr only when its nla_len is less than NLA_HDRLEN */ + nla->nla_len = NLA_HDRLEN - 1; + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {nla_len=%u" + ", nla_type=UNIX_DIAG_NAME}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, msg_len, sprintrc(rc)); + + /* unrecognized attribute data, abbreviated output */ +#define ABBREV_LEN (DEFAULT_STRLEN + 1) + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + NLA_HDRLEN * ABBREV_LEN * 2; + msg = tail_alloc(msg_len); + memcpy(msg, &c_msg, sizeof(c_msg)); + msg->nlh.nlmsg_len = msg_len; + unsigned int i; + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + for (i = 0; i < ABBREV_LEN; ++i) { + nla[i * 2] = (struct nlattr) { + .nla_len = NLA_HDRLEN * 2 - 1, + .nla_type = UNIX_DIAG_SHUTDOWN + 1 + i + }; + fill_memory_ex(&nla[i * 2 + 1], NLA_HDRLEN, + '0' + i, '~' - '0' - i); + } + + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}" + ", {udiag_family=AF_UNIX, udiag_type=SOCK_STREAM" + ", udiag_state=TCP_FIN_WAIT1, udiag_ino=0" + ", udiag_cookie=[0, 0]}, [", + fd, msg_len); + for (i = 0; i < DEFAULT_STRLEN; ++i) { + if (i) + printf(", "); + printf("{{nla_len=%u, nla_type=%#x /* UNIX_DIAG_??? */}, ", + nla->nla_len, UNIX_DIAG_SHUTDOWN + 1 + i); + print_quoted_hex(&nla[i * 2 + 1], NLA_HDRLEN - 1); + printf("}"); + } + printf(", ...]}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + msg_len, sprintrc(rc)); +} + +static void +test_nla_type(const int fd) +{ + static const struct msg { + struct nlmsghdr nlh; + struct unix_diag_msg udm; + } c_msg = { + .nlh = { + .nlmsg_len = sizeof(struct msg), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP + }, + .udm = { + .udiag_family = AF_UNIX, + .udiag_type = SOCK_STREAM, + .udiag_state = TCP_FIN_WAIT1 + } + }; + struct msg *msg; + struct nlattr *nla; + unsigned int msg_len; + long rc; + + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + sizeof(*nla); + msg = tail_memdup(&c_msg, msg_len); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + *nla = (struct nlattr) { + .nla_len = sizeof(*nla), + .nla_type = NLA_F_NESTED | UNIX_DIAG_NAME + }; + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {nla_len=%u" + ", nla_type=NLA_F_NESTED|UNIX_DIAG_NAME}}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, msg_len, sprintrc(rc)); + + nla->nla_type = NLA_F_NET_BYTEORDER | UNIX_DIAG_NAME; + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {nla_len=%u" + ", nla_type=NLA_F_NET_BYTEORDER|UNIX_DIAG_NAME}}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, msg_len, sprintrc(rc)); + + nla->nla_type = NLA_F_NESTED | NLA_F_NET_BYTEORDER | UNIX_DIAG_NAME; + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {nla_len=%u" + ", nla_type=NLA_F_NESTED|NLA_F_NET_BYTEORDER|UNIX_DIAG_NAME}}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, msg_len, sprintrc(rc)); + + nla->nla_type = NLA_F_NESTED | (UNIX_DIAG_SHUTDOWN + 1); + rc = sendto(fd, msg, msg->nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {nla_len=%u" + ", nla_type=NLA_F_NESTED|%#x /* UNIX_DIAG_??? */}}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg->nlh.nlmsg_len, nla->nla_len, UNIX_DIAG_SHUTDOWN + 1, + msg->nlh.nlmsg_len, sprintrc(rc)); +} + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_SOCK_DIAG); + + test_nlattr(fd); + test_nla_type(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} diff --git a/tests-m32/nlattr.gen.test b/tests-m32/nlattr.gen.test new file mode 100755 index 00000000..0ea2f185 --- /dev/null +++ b/tests-m32/nlattr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_br_port_msg.c b/tests-m32/nlattr_br_port_msg.c new file mode 100644 index 00000000..9a7c3f25 --- /dev/null +++ b/tests-m32/nlattr_br_port_msg.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_BR_PORT_MSG + +# include +# include +# include "test_nlattr.h" +# include +# include + +static void +init_br_port_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETMDB, + .nlmsg_flags = NLM_F_DUMP + ); + + struct br_port_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct br_port_msg, msg, + .family = AF_UNIX, + .ifindex = ifindex_lo() + ); +} + +static void +print_br_port_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETMDB, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {family=AF_UNIX" + ", ifindex=" IFINDEX_LO_STR "}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + + const unsigned int hdrlen = sizeof(struct br_port_msg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 4); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* MDBA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_br_port_msg, print_br_port_msg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_BR_PORT_MSG") + +#endif diff --git a/tests-m32/nlattr_br_port_msg.gen.test b/tests-m32/nlattr_br_port_msg.gen.test new file mode 100755 index 00000000..c9572759 --- /dev/null +++ b/tests-m32/nlattr_br_port_msg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_br_port_msg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_crypto_user_alg.c b/tests-m32/nlattr_crypto_user_alg.c new file mode 100644 index 00000000..f90c6208 --- /dev/null +++ b/tests-m32/nlattr_crypto_user_alg.c @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_CRYPTOUSER_H + +# include +# include +# include "test_nlattr.h" +# include + +# define CRYPTOCFGA_REPORT_LARVAL 2 + +static void +init_crypto_user_alg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = CRYPTO_MSG_GETALG, + .nlmsg_flags = NLM_F_DUMP + ); + + struct crypto_user_alg *const alg = NLMSG_DATA(nlh); + SET_STRUCT(struct crypto_user_alg, alg, + .cru_name = "abcd", + .cru_driver_name = "efgh", + .cru_module_name = "ijkl", + ); +} + +static void +print_crypto_user_alg(const unsigned int msg_len) +{ + printf("{len=%u, type=CRYPTO_MSG_GETALG" + ", flags=NLM_F_DUMP, seq=0, pid=0}" + ", {cru_name=\"abcd\", cru_driver_name=\"efgh\"" + ", cru_module_name=\"ijkl\", cru_type=0" + ", cru_mask=0, cru_refcnt=0, cru_flags=0}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_CRYPTO); + const unsigned int hdrlen = sizeof(struct crypto_user_alg); + /* + * There are also other structures, but they are not bigger than + * DEFAULT_STRLEN so far. + */ + void *const nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + DEFAULT_STRLEN); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + char *const str = tail_alloc(DEFAULT_STRLEN); + fill_memory_ex(str, DEFAULT_STRLEN, '0', 10); + TEST_NLATTR(fd, nlh0, hdrlen, + init_crypto_user_alg, print_crypto_user_alg, + CRYPTOCFGA_REPORT_LARVAL, + DEFAULT_STRLEN, str, DEFAULT_STRLEN, + printf("{type=\"%.*s\"...}", DEFAULT_STRLEN, str)); + str[DEFAULT_STRLEN - 1] = '\0'; + TEST_NLATTR(fd, nlh0, hdrlen, + init_crypto_user_alg, print_crypto_user_alg, + CRYPTOCFGA_REPORT_LARVAL, + DEFAULT_STRLEN, str, DEFAULT_STRLEN, + printf("{type=\"%s\"}", str)); + +# ifdef HAVE_STRUCT_CRYPTO_REPORT_HASH + static const struct crypto_report_hash rhash = { + .type = "efgh", + .blocksize = 0xabcdefdc, + .digestsize = 0xfebcdacd + }; + TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen, + init_crypto_user_alg, print_crypto_user_alg, + CRYPTOCFGA_REPORT_HASH, + pattern, rhash, print_quoted_memory, + printf("{type=\"efgh\""); + PRINT_FIELD_U(", ", rhash, blocksize); + PRINT_FIELD_U(", ", rhash, digestsize); + printf("}")); +# endif + +# ifdef HAVE_STRUCT_CRYPTO_REPORT_BLKCIPHER + static const struct crypto_report_blkcipher rblkcipher = { + .type = "abcd", + .geniv = "efgh", + .blocksize = 0xabcdefac, + .min_keysize = 0xfeadbcda, + .max_keysize = 0xbdacdeac, + .ivsize = 0xefacbdac + }; + TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen, + init_crypto_user_alg, print_crypto_user_alg, + CRYPTOCFGA_REPORT_BLKCIPHER, + pattern, rblkcipher, print_quoted_memory, + printf("{type=\"abcd\", geniv=\"efgh\""); + PRINT_FIELD_U(", ", rblkcipher, blocksize); + PRINT_FIELD_U(", ", rblkcipher, min_keysize); + PRINT_FIELD_U(", ", rblkcipher, max_keysize); + PRINT_FIELD_U(", ", rblkcipher, ivsize); + printf("}")); +# endif + +# ifdef HAVE_STRUCT_CRYPTO_REPORT_AEAD + static const struct crypto_report_aead raead = { + .type = "abcd", + .geniv = "efgh", + .blocksize = 0xbaefdbac, + .maxauthsize = 0xfdbdbcda, + .ivsize = 0xacbefdac + }; + TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen, + init_crypto_user_alg, print_crypto_user_alg, + CRYPTOCFGA_REPORT_AEAD, + pattern, raead, print_quoted_memory, + printf("{type=\"abcd\", geniv=\"efgh\""); + PRINT_FIELD_U(", ", raead, blocksize); + PRINT_FIELD_U(", ", raead, maxauthsize); + PRINT_FIELD_U(", ", raead, ivsize); + printf("}")); +# endif + +# ifdef HAVE_STRUCT_CRYPTO_REPORT_RNG + static const struct crypto_report_rng rrng = { + .type = "abcd", + .seedsize = 0xabcdefac + }; + TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen, + init_crypto_user_alg, print_crypto_user_alg, + CRYPTOCFGA_REPORT_RNG, + pattern, rrng, print_quoted_memory, + printf("{type=\"abcd\""); + PRINT_FIELD_U(", ", rrng, seedsize); + printf("}")); +# endif + +# ifdef HAVE_STRUCT_CRYPTO_REPORT_CIPHER + static const struct crypto_report_cipher rcipher = { + .type = "abcd", + .blocksize = 0xabcdefac, + .min_keysize = 0xfeadbcda, + .max_keysize = 0xbdacdeac, + }; + TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen, + init_crypto_user_alg, print_crypto_user_alg, + CRYPTOCFGA_REPORT_CIPHER, + pattern, rcipher, print_quoted_memory, + printf("{type=\"abcd\""); + PRINT_FIELD_U(", ", rcipher, blocksize); + PRINT_FIELD_U(", ", rcipher, min_keysize); + PRINT_FIELD_U(", ", rcipher, max_keysize); + printf("}")); +# endif + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_CRYPTOUSER_H"); + +#endif diff --git a/tests-m32/nlattr_crypto_user_alg.gen.test b/tests-m32/nlattr_crypto_user_alg.gen.test new file mode 100755 index 00000000..e52b6be7 --- /dev/null +++ b/tests-m32/nlattr_crypto_user_alg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_crypto_user_alg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_dcbmsg.c b/tests-m32/nlattr_dcbmsg.c new file mode 100644 index 00000000..06efb283 --- /dev/null +++ b/tests-m32/nlattr_dcbmsg.c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_DCBMSG + +# include +# include "test_nlattr.h" +# include +# include + +static void +init_dcbmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETDCB, + .nlmsg_flags = NLM_F_DUMP + ); + + struct dcbmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct dcbmsg, msg, + .dcb_family = AF_UNIX, + .cmd = DCB_CMD_UNDEFINED + ); +} + +static void +print_dcbmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETDCB, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {dcb_family=AF_UNIX" + ", cmd=DCB_CMD_UNDEFINED}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct dcbmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 4); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* DCB_ATTR_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_dcbmsg, print_dcbmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_DCBMSG") + +#endif diff --git a/tests-m32/nlattr_dcbmsg.gen.test b/tests-m32/nlattr_dcbmsg.gen.test new file mode 100755 index 00000000..f9ef39f7 --- /dev/null +++ b/tests-m32/nlattr_dcbmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_dcbmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_fib_rule_hdr.c b/tests-m32/nlattr_fib_rule_hdr.c new file mode 100644 index 00000000..d5ba13e2 --- /dev/null +++ b/tests-m32/nlattr_fib_rule_hdr.c @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_FIB_RULES_H + +# include +# include +# include "test_nlattr.h" +# include +# include +# include +# include + +# define FRA_TUN_ID 12 +# define FRA_TABLE 15 +# define FRA_UID_RANGE 20 +# define FRA_PROTOCOL 21 +# define FRA_IP_PROTO 22 +# define FRA_SPORT_RANGE 23 +# define FRA_DPORT_RANGE 24 + +# ifndef HAVE_STRUCT_FIB_RULE_PORT_RANGE +struct fib_rule_port_range { + uint16_t start; + uint16_t end; +}; +# endif /* HAVE_STRUCT_FIB_RULE_PORT_RANGE */ + +static void +init_rtmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETRULE, + .nlmsg_flags = NLM_F_DUMP + ); + + struct rtmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct rtmsg, msg, + .rtm_family = AF_UNIX, + .rtm_tos = IPTOS_LOWDELAY, + .rtm_table = RT_TABLE_UNSPEC, + .rtm_type = FR_ACT_TO_TBL, + .rtm_flags = FIB_RULE_INVERT + ); +} + +static void +print_rtmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETRULE, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {family=AF_UNIX" + ", dst_len=0, src_len=0" + ", tos=IPTOS_LOWDELAY" + ", table=RT_TABLE_UNSPEC" + ", action=FR_ACT_TO_TBL" + ", flags=FIB_RULE_INVERT}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct rtmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 8); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* FRA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_DST, 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + const uint32_t table_id = RT_TABLE_DEFAULT; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_TABLE, pattern, table_id, + printf("RT_TABLE_DEFAULT")); + +# ifdef HAVE_STRUCT_FIB_RULE_UID_RANGE + static const struct fib_rule_uid_range range = { + .start = 0xabcdedad, + .end = 0xbcdeadba + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_UID_RANGE, pattern, range, + PRINT_FIELD_U("{", range, start); + PRINT_FIELD_U(", ", range, end); + printf("}")); +# endif +# if defined HAVE_BE64TOH || defined be64toh + const uint64_t tun_id = 0xabcdcdbeedabadef; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_TUN_ID, pattern, tun_id, + printf("htobe64(%" PRIu64 ")", be64toh(tun_id))); +# endif + + uint8_t proto; + + static const struct { + uint8_t arg; + const char *str; + } proto_args[] = { + { ARG_STR(RTPROT_UNSPEC) }, + { 5, "0x5 /* RTPROT_??? */" }, + { 17, "RTPROT_MROUTED" }, + { 42, "RTPROT_BABEL" }, + { 43, "0x2b /* RTPROT_??? */" }, + { ARG_STR(0xde) " /* RTPROT_??? */" }, + }; + + for (unsigned i = 0; i < ARRAY_SIZE(proto_args); i++) { + proto = proto_args[i].arg; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_PROTOCOL, pattern, proto, + printf("%s", proto_args[i].str)); + } + + static const struct { + uint8_t arg; + const char *str; + } ipproto_args[] = { + { ARG_STR(IPPROTO_TCP) }, + { 254, "0xfe /* IPPROTO_??? */" }, + { ARG_STR(IPPROTO_RAW) }, + }; + + for (unsigned i = 0; i < ARRAY_SIZE(ipproto_args); i++) { + proto = ipproto_args[i].arg; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_IP_PROTO, pattern, proto, + printf("%s", ipproto_args[i].str)); + } + + static const struct fib_rule_port_range prange = { + .start = 0xabcd, + .end = 0xfeed, + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_SPORT_RANGE, pattern, prange, + PRINT_FIELD_U("{", prange, start); + PRINT_FIELD_U(", ", prange, end); + printf("}")); + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_DPORT_RANGE, pattern, prange, + PRINT_FIELD_U("{", prange, start); + PRINT_FIELD_U(", ", prange, end); + printf("}")); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_FIB_RULES_H") + +#endif diff --git a/tests-m32/nlattr_fib_rule_hdr.gen.test b/tests-m32/nlattr_fib_rule_hdr.gen.test new file mode 100755 index 00000000..fb61343d --- /dev/null +++ b/tests-m32/nlattr_fib_rule_hdr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_fib_rule_hdr +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_ifaddrlblmsg.c b/tests-m32/nlattr_ifaddrlblmsg.c new file mode 100644 index 00000000..ce9d7a80 --- /dev/null +++ b/tests-m32/nlattr_ifaddrlblmsg.c @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_IFADDRLBLMSG + +# include +# include "test_nlattr.h" +# include +# include + +static void +init_ifaddrlblmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETADDRLABEL, + .nlmsg_flags = NLM_F_DUMP + ); + + struct ifaddrlblmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct ifaddrlblmsg, msg, + .ifal_family = AF_UNIX, + .ifal_index = ifindex_lo() + ); +} + +static void +print_ifaddrlblmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETADDRLABEL, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {ifal_family=AF_UNIX" + ", ifal_prefixlen=0, ifal_flags=0" + ", ifal_index=" IFINDEX_LO_STR + ", ifal_seq=0}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct ifaddrlblmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 4); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* IFAL_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_ifaddrlblmsg, print_ifaddrlblmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifaddrlblmsg, print_ifaddrlblmsg, + IFAL_ADDRESS, 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_IFADDRLBLMSG") + +#endif diff --git a/tests-m32/nlattr_ifaddrlblmsg.gen.test b/tests-m32/nlattr_ifaddrlblmsg.gen.test new file mode 100755 index 00000000..0f51430f --- /dev/null +++ b/tests-m32/nlattr_ifaddrlblmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifaddrlblmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_ifaddrmsg.c b/tests-m32/nlattr_ifaddrmsg.c new file mode 100644 index 00000000..4e952555 --- /dev/null +++ b/tests-m32/nlattr_ifaddrmsg.c @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include "test_nlattr.h" +#ifdef HAVE_LINUX_IF_ADDR_H +# include +#endif +#include + +#define IFA_FLAGS 8 + +#define SET_IFA_FAMILY(af) \ + do { \ + ifa_family = af; \ + ifa_family_str = #af; \ + } \ + while (0) + +uint8_t ifa_family; +const char *ifa_family_str; + +static void +init_ifaddrmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETADDR, + .nlmsg_flags = NLM_F_DUMP + ); + + struct ifaddrmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct ifaddrmsg, msg, + .ifa_family = ifa_family, + .ifa_flags = IFA_F_SECONDARY, + .ifa_scope = RT_SCOPE_UNIVERSE, + .ifa_index = ifindex_lo() + ); +} + +static void +print_ifaddrmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETADDR, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {ifa_family=%s" + ", ifa_prefixlen=0" + ", ifa_flags=IFA_F_SECONDARY" + ", ifa_scope=RT_SCOPE_UNIVERSE" + ", ifa_index=" IFINDEX_LO_STR "}", + msg_len, ifa_family_str); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + static const char address4[] = "12.34.56.78"; + static const char address6[] = "12:34:56:78:90:ab:cd:ef"; + static const struct ifa_cacheinfo ci = { + .ifa_prefered = 0xabcdefac, + .ifa_valid = 0xbcdadbca, + .cstamp = 0xcdabedba, + .tstamp = 0xdebabdac + }; + + struct in_addr a4; + struct in6_addr a6; + const uint32_t ifa_flags = IFA_F_SECONDARY | IFA_F_PERMANENT; + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct ifaddrmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + MAX(sizeof(ci), sizeof(a6))); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + SET_IFA_FAMILY(AF_UNSPEC); + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* IFA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_ifaddrmsg, print_ifaddrmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifaddrmsg, print_ifaddrmsg, + IFA_ADDRESS, 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + SET_IFA_FAMILY(AF_INET); + + if (!inet_pton(AF_INET, address4, &a4)) + perror_msg_and_skip("inet_pton"); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifaddrmsg, print_ifaddrmsg, + IFA_ADDRESS, pattern, a4, + printf("inet_addr(\"%s\")", address4)); + + SET_IFA_FAMILY(AF_INET6); + + if (!inet_pton(AF_INET6, address6, &a6)) + perror_msg_and_skip("inet_pton"); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifaddrmsg, print_ifaddrmsg, + IFA_ADDRESS, pattern, a6, + printf("inet_pton(AF_INET6, \"%s\")", address6)); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifaddrmsg, print_ifaddrmsg, + IFA_CACHEINFO, pattern, ci, + PRINT_FIELD_U("{", ci, ifa_prefered); + PRINT_FIELD_U(", ", ci, ifa_valid); + PRINT_FIELD_U(", ", ci, cstamp); + PRINT_FIELD_U(", ", ci, tstamp); + printf("}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifaddrmsg, print_ifaddrmsg, + IFA_FLAGS, pattern, ifa_flags, + printf("IFA_F_SECONDARY|IFA_F_PERMANENT")); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/nlattr_ifaddrmsg.gen.test b/tests-m32/nlattr_ifaddrmsg.gen.test new file mode 100755 index 00000000..3fb81bdb --- /dev/null +++ b/tests-m32/nlattr_ifaddrmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifaddrmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_ifinfomsg.c b/tests-m32/nlattr_ifinfomsg.c new file mode 100644 index 00000000..a8660196 --- /dev/null +++ b/tests-m32/nlattr_ifinfomsg.c @@ -0,0 +1,346 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include "test_nlattr.h" + +#include +#include +#ifdef HAVE_LINUX_IF_LINK_H +# include +#endif +#include + +#ifndef IFLA_LINKINFO +# define IFLA_LINKINFO 18 +#endif +#ifndef IFLA_VF_PORTS +# define IFLA_VF_PORTS 24 +#endif +#define IFLA_LINK_NETNSID 37 +#define IFLA_EVENT 44 + +#ifndef IFLA_INFO_KIND +# define IFLA_INFO_KIND 1 +#endif + +#ifndef IFLA_VF_PORT +# define IFLA_VF_PORT 1 +#endif + +static void +init_ifinfomsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETLINK, + .nlmsg_flags = NLM_F_DUMP + ); + + struct ifinfomsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct ifinfomsg, msg, + .ifi_family = AF_UNIX, + .ifi_type = ARPHRD_LOOPBACK, + .ifi_index = ifindex_lo(), + .ifi_flags = IFF_UP, + ); +} + +static void +print_ifinfomsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETLINK, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {ifi_family=AF_UNIX" + ", ifi_type=ARPHRD_LOOPBACK" + ", ifi_index=" IFINDEX_LO_STR + ", ifi_flags=IFF_UP, ifi_change=0}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + static const struct rtnl_link_stats st = { + .rx_packets = 0xabcdefac, + .tx_packets = 0xbcdacdab, + .rx_bytes = 0xcdbafaab, + .tx_bytes = 0xdafabadb, + .rx_errors = 0xeabcdaeb, + .tx_errors = 0xfefabeab, + .rx_dropped = 0xadbafafb, + .tx_dropped = 0xbdffabda, + .multicast = 0xcdabdfea, + .collisions = 0xefadbaeb, + .rx_length_errors = 0xfabffabd, + .rx_over_errors = 0xafbafabc, + .rx_crc_errors = 0xbfdabdad, + .rx_frame_errors = 0xcfdabfad, + .rx_fifo_errors = 0xddfdebad, + .rx_missed_errors = 0xefabdcba, + .tx_aborted_errors = 0xefdadbfa, + .tx_carrier_errors = 0xfaefbada, + .tx_fifo_errors = 0xaebdffab, + .tx_heartbeat_errors = 0xbadebaaf, + .tx_window_errors = 0xcdafbada, + .rx_compressed = 0xdeffadbd, + .tx_compressed = 0xefdadfab + }; + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct ifinfomsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(st)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* IFLA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + const int32_t netnsid = 0xacbdabda; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_LINK_NETNSID, pattern, netnsid, + printf("%d", netnsid)); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_STATS, pattern, st, + PRINT_FIELD_U("{", st, rx_packets); + PRINT_FIELD_U(", ", st, tx_packets); + PRINT_FIELD_U(", ", st, rx_bytes); + PRINT_FIELD_U(", ", st, tx_bytes); + PRINT_FIELD_U(", ", st, rx_errors); + PRINT_FIELD_U(", ", st, tx_errors); + PRINT_FIELD_U(", ", st, rx_dropped); + PRINT_FIELD_U(", ", st, tx_dropped); + PRINT_FIELD_U(", ", st, multicast); + PRINT_FIELD_U(", ", st, collisions); + PRINT_FIELD_U(", ", st, rx_length_errors); + PRINT_FIELD_U(", ", st, rx_over_errors); + PRINT_FIELD_U(", ", st, rx_crc_errors); + PRINT_FIELD_U(", ", st, rx_frame_errors); + PRINT_FIELD_U(", ", st, rx_fifo_errors); + PRINT_FIELD_U(", ", st, rx_missed_errors); + PRINT_FIELD_U(", ", st, tx_aborted_errors); + PRINT_FIELD_U(", ", st, tx_carrier_errors); + PRINT_FIELD_U(", ", st, tx_fifo_errors); + PRINT_FIELD_U(", ", st, tx_heartbeat_errors); + PRINT_FIELD_U(", ", st, tx_window_errors); + PRINT_FIELD_U(", ", st, rx_compressed); + PRINT_FIELD_U(", ", st, tx_compressed); +#ifdef HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER + PRINT_FIELD_U(", ", st, rx_nohandler); +#endif + printf("}")); + +#ifdef HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER + const unsigned int sizeof_stats = + offsetofend(struct rtnl_link_stats, tx_compressed); + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_STATS, sizeof_stats, &st, sizeof_stats, + PRINT_FIELD_U("{", st, rx_packets); + PRINT_FIELD_U(", ", st, tx_packets); + PRINT_FIELD_U(", ", st, rx_bytes); + PRINT_FIELD_U(", ", st, tx_bytes); + PRINT_FIELD_U(", ", st, rx_errors); + PRINT_FIELD_U(", ", st, tx_errors); + PRINT_FIELD_U(", ", st, rx_dropped); + PRINT_FIELD_U(", ", st, tx_dropped); + PRINT_FIELD_U(", ", st, multicast); + PRINT_FIELD_U(", ", st, collisions); + PRINT_FIELD_U(", ", st, rx_length_errors); + PRINT_FIELD_U(", ", st, rx_over_errors); + PRINT_FIELD_U(", ", st, rx_crc_errors); + PRINT_FIELD_U(", ", st, rx_frame_errors); + PRINT_FIELD_U(", ", st, rx_fifo_errors); + PRINT_FIELD_U(", ", st, rx_missed_errors); + PRINT_FIELD_U(", ", st, tx_aborted_errors); + PRINT_FIELD_U(", ", st, tx_carrier_errors); + PRINT_FIELD_U(", ", st, tx_fifo_errors); + PRINT_FIELD_U(", ", st, tx_heartbeat_errors); + PRINT_FIELD_U(", ", st, tx_window_errors); + PRINT_FIELD_U(", ", st, rx_compressed); + PRINT_FIELD_U(", ", st, tx_compressed); + printf("}")); +#endif /* HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER */ + + static const struct rtnl_link_ifmap map = { + .mem_start = 0xadcbefedefbcdedb, + .mem_end = 0xefcbeabdecdcdefa, + .base_addr = 0xaddbeabdfaacdbae, + .irq = 0xefaf, + .dma = 0xab, + .port = 0xcd + }; + const unsigned int sizeof_ifmap = + offsetofend(struct rtnl_link_ifmap, port); + const unsigned int plen = sizeof_ifmap - 1 > DEFAULT_STRLEN + ? DEFAULT_STRLEN + : (int) sizeof_ifmap - 1; + /* len < sizeof_ifmap */ + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_MAP, plen, pattern, plen, + print_quoted_hex(pattern, plen)); + + /* short read of sizeof_ifmap */ + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_MAP, sizeof_ifmap, &map, sizeof_ifmap - 1, + printf("%p", RTA_DATA(TEST_NLATTR_nla))); + + /* sizeof_ifmap */ + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_MAP, sizeof_ifmap, &map, sizeof_ifmap, + PRINT_FIELD_X("{", map, mem_start); + PRINT_FIELD_X(", ", map, mem_end); + PRINT_FIELD_X(", ", map, base_addr); + PRINT_FIELD_U(", ", map, irq); + PRINT_FIELD_U(", ", map, dma); + PRINT_FIELD_U(", ", map, port); + printf("}")); + +#ifdef HAVE_STRUCT_RTNL_LINK_STATS64 + static const struct rtnl_link_stats64 st64 = { + .rx_packets = 0xadcbefedefbcdedb, + .tx_packets = 0xbdabdedabdcdeabd, + .rx_bytes = 0xcdbaefbaeadfabec, + .tx_bytes = 0xdbaedbafabbeacdb, + .rx_errors = 0xefabfdaefabaefab, + .tx_errors = 0xfaebfabfabbaeabf, + .rx_dropped = 0xacdbaedbadbabeba, + .tx_dropped = 0xbcdeffebdabeadbe, + .multicast = 0xeeffbaeabaeffabe, + .collisions = 0xffbaefcefbafacef, + .rx_length_errors = 0xaabbdeabceffdecb, + .rx_over_errors = 0xbbdcdadebadeaeed, + .rx_crc_errors= 0xccdeabecefaedbef, + .rx_frame_errors = 0xddbedaedebcedaef, + .rx_fifo_errors = 0xeffbadefafdaeaab, + .rx_missed_errors = 0xfefaebccceadeecd, + .tx_aborted_errors = 0xabcdadefcdadef, + .tx_carrier_errors = 0xbccdafaeeaaefe, + .tx_fifo_errors = 0xcddefdbedeadce, + .tx_heartbeat_errors = 0xedaededdadcdea, + .tx_window_errors = 0xfdacdeaccedcda, + .rx_compressed = 0xacdbbcacdbccef, + .tx_compressed = 0xbcdadefcdedfea + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_STATS64, pattern, st64, + PRINT_FIELD_U("{", st64, rx_packets); + PRINT_FIELD_U(", ", st64, tx_packets); + PRINT_FIELD_U(", ", st64, rx_bytes); + PRINT_FIELD_U(", ", st64, tx_bytes); + PRINT_FIELD_U(", ", st64, rx_errors); + PRINT_FIELD_U(", ", st64, tx_errors); + PRINT_FIELD_U(", ", st64, rx_dropped); + PRINT_FIELD_U(", ", st64, tx_dropped); + PRINT_FIELD_U(", ", st64, multicast); + PRINT_FIELD_U(", ", st64, collisions); + PRINT_FIELD_U(", ", st64, rx_length_errors); + PRINT_FIELD_U(", ", st64, rx_over_errors); + PRINT_FIELD_U(", ", st64, rx_crc_errors); + PRINT_FIELD_U(", ", st64, rx_frame_errors); + PRINT_FIELD_U(", ", st64, rx_fifo_errors); + PRINT_FIELD_U(", ", st64, rx_missed_errors); + PRINT_FIELD_U(", ", st64, tx_aborted_errors); + PRINT_FIELD_U(", ", st64, tx_carrier_errors); + PRINT_FIELD_U(", ", st64, tx_fifo_errors); + PRINT_FIELD_U(", ", st64, tx_heartbeat_errors); + PRINT_FIELD_U(", ", st64, tx_window_errors); + PRINT_FIELD_U(", ", st64, rx_compressed); + PRINT_FIELD_U(", ", st64, tx_compressed); +# ifdef HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER + PRINT_FIELD_U(", ", st64, rx_nohandler); +# endif + printf("}")); + +# ifdef HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER + const unsigned int sizeof_stats64 = + offsetofend(struct rtnl_link_stats64, tx_compressed); + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_STATS64, sizeof_stats64, &st64, sizeof_stats64, + PRINT_FIELD_U("{", st64, rx_packets); + PRINT_FIELD_U(", ", st64, tx_packets); + PRINT_FIELD_U(", ", st64, rx_bytes); + PRINT_FIELD_U(", ", st64, tx_bytes); + PRINT_FIELD_U(", ", st64, rx_errors); + PRINT_FIELD_U(", ", st64, tx_errors); + PRINT_FIELD_U(", ", st64, rx_dropped); + PRINT_FIELD_U(", ", st64, tx_dropped); + PRINT_FIELD_U(", ", st64, multicast); + PRINT_FIELD_U(", ", st64, collisions); + PRINT_FIELD_U(", ", st64, rx_length_errors); + PRINT_FIELD_U(", ", st64, rx_over_errors); + PRINT_FIELD_U(", ", st64, rx_crc_errors); + PRINT_FIELD_U(", ", st64, rx_frame_errors); + PRINT_FIELD_U(", ", st64, rx_fifo_errors); + PRINT_FIELD_U(", ", st64, rx_missed_errors); + PRINT_FIELD_U(", ", st64, tx_aborted_errors); + PRINT_FIELD_U(", ", st64, tx_carrier_errors); + PRINT_FIELD_U(", ", st64, tx_fifo_errors); + PRINT_FIELD_U(", ", st64, tx_heartbeat_errors); + PRINT_FIELD_U(", ", st64, tx_window_errors); + PRINT_FIELD_U(", ", st64, rx_compressed); + PRINT_FIELD_U(", ", st64, tx_compressed); + printf("}")); +# endif /* HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER */ +#endif /* HAVE_STRUCT_RTNL_LINK_STATS64 */ + + struct nlattr nla = { + .nla_len = sizeof(nla), + .nla_type = IFLA_INFO_KIND, + }; + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_LINKINFO, sizeof(nla), &nla, sizeof(nla), + printf("{nla_len=%u, nla_type=IFLA_INFO_KIND}", + nla.nla_len)); + + nla.nla_type = IFLA_VF_PORT; + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_VF_PORTS, sizeof(nla), &nla, sizeof(nla), + printf("{nla_len=%u, nla_type=IFLA_VF_PORT}", + nla.nla_len)); + + static const struct { + uint32_t val; + const char *str; + } ifla_events[] = { + { 0, "IFLA_EVENT_NONE" }, + { 6, "IFLA_EVENT_BONDING_OPTIONS" }, + { ARG_STR(0x7) " /* IFLA_EVENT_??? */" }, + { ARG_STR(0xdeadfeed) " /* IFLA_EVENT_??? */" }, + }; + for (size_t i = 0; i < ARRAY_SIZE(ifla_events); i++) { + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_EVENT, pattern, ifla_events[i].val, + printf("%s", ifla_events[i].str)); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/nlattr_ifinfomsg.gen.test b/tests-m32/nlattr_ifinfomsg.gen.test new file mode 100755 index 00000000..b9a6456a --- /dev/null +++ b/tests-m32/nlattr_ifinfomsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifinfomsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_ifla.h b/tests-m32/nlattr_ifla.h new file mode 100644 index 00000000..6772ae29 --- /dev/null +++ b/tests-m32/nlattr_ifla.h @@ -0,0 +1,58 @@ +/* + * netlink attribute ifinfomsg common code. + * + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef STRACE_TESTS_NLATTR_IFLA_H +# define STRACE_TESTS_NLATTR_IFLA_H + +# include "tests.h" + +# ifndef IFLA_ATTR +# error "Please define IFLA_ATTR before including this file" +# endif + +static const unsigned int hdrlen = sizeof(struct ifinfomsg); + +static void +init_ifinfomsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETLINK, + .nlmsg_flags = NLM_F_DUMP + ); + + struct ifinfomsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct ifinfomsg, msg, + .ifi_family = AF_UNIX, + .ifi_type = ARPHRD_LOOPBACK, + .ifi_index = ifindex_lo(), + .ifi_flags = IFF_UP, + ); + + struct nlattr *const nla = NLMSG_ATTR(nlh, sizeof(*msg)); + SET_STRUCT(struct nlattr, nla, + .nla_len = msg_len - NLMSG_SPACE(hdrlen), + .nla_type = IFLA_ATTR + ); +} + +static void +print_ifinfomsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETLINK, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {ifi_family=AF_UNIX" + ", ifi_type=ARPHRD_LOOPBACK" + ", ifi_index=" IFINDEX_LO_STR + ", ifi_flags=IFF_UP, ifi_change=0}" + ", {{nla_len=%u, nla_type=" STRINGIFY_VAL(IFLA_ATTR) "}", + msg_len, msg_len - NLMSG_SPACE(hdrlen)); +} + +#endif /* STRACE_TESTS_NLATTR_IFLA_H */ diff --git a/tests-m32/nlattr_ifla_af_spec.c b/tests-m32/nlattr_ifla_af_spec.c new file mode 100644 index 00000000..e5e76c60 --- /dev/null +++ b/tests-m32/nlattr_ifla_af_spec.c @@ -0,0 +1,303 @@ +/* + * IFLA_AF_SPEC netlink attribute decoding check. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include "test_nlattr.h" + +#include +#include +#ifdef HAVE_LINUX_IF_LINK_H +# include +#endif +#include + +#if !HAVE_DECL_IFLA_AF_SPEC +enum { IFLA_AF_SPEC = 26 }; +#endif + +#define XLAT_MACROS_ONLY +#include "xlat/rtnl_ifla_af_spec_inet_attrs.h" +#include "xlat/rtnl_ifla_af_spec_inet6_attrs.h" +#undef XLAT_MACROS_ONLY + +#ifndef HAVE_STRUCT_IFLA_CACHEINFO +struct ifla_cacheinfo { + uint32_t max_reasm_len; + uint32_t tstamp; + uint32_t reachable_time; + uint32_t retrans_time; +}; +#endif + +#define IFLA_ATTR IFLA_AF_SPEC +#include "nlattr_ifla.h" + +#define AF_SPEC_FUNCS(family_) \ + static void \ + init_##family_##_msg(struct nlmsghdr *const nlh, \ + const unsigned int msg_len) \ + { \ + init_ifinfomsg(nlh, msg_len); \ + \ + struct nlattr *nla = NLMSG_ATTR(nlh, hdrlen); \ + nla += 1; \ + SET_STRUCT(struct nlattr, nla, \ + .nla_len = msg_len - NLMSG_SPACE(hdrlen) \ + - NLA_HDRLEN, \ + .nla_type = family_, \ + ); \ + } \ + \ + static void \ + print_##family_##_msg(const unsigned int msg_len) \ + { \ + print_ifinfomsg(msg_len); \ + printf(", {{nla_len=%u, nla_type=" #family_ "}", \ + msg_len - NLMSG_SPACE(hdrlen) - NLA_HDRLEN); \ + } \ + /* end of AF_SPEC_FUNCS definition */ + +AF_SPEC_FUNCS(AF_INET) +AF_SPEC_FUNCS(AF_INET6) + +static void +print_arr_val(uint32_t *val, size_t idx, const char *idx_str) +{ + if (idx_str) + printf("[%s] = ", idx_str); + else + printf("[%zu] = ", idx); + + printf("%d", *val); +} + +static void +print_arr_uval(uint64_t *val, size_t idx, const char *idx_str) +{ + if (idx_str) + printf("[%s] = ", idx_str); + else + printf("[%zu] = ", idx); + + printf("%" PRIu64, *val); +} + +static void +print_inet_conf_val(uint32_t *val, size_t idx) +{ + static const char * const strs[] = { + "IPV4_DEVCONF_FORWARDING-1", + "IPV4_DEVCONF_MC_FORWARDING-1", + }; + + print_arr_val(val, idx, idx < ARRAY_SIZE(strs) ? strs[idx] : NULL); +} + + +static void +print_inet6_conf_val(uint32_t *val, size_t idx) +{ + static const char * const strs[] = { + "DEVCONF_FORWARDING", + "DEVCONF_HOPLIMIT", + }; + + print_arr_val(val, idx, idx < ARRAY_SIZE(strs) ? strs[idx] : NULL); +} + +static void +print_inet6_stats_val(uint64_t *val, size_t idx) +{ + static const char * const strs[] = { + "IPSTATS_MIB_NUM", + "IPSTATS_MIB_INPKTS", + }; + + print_arr_uval(val, idx, idx < ARRAY_SIZE(strs) ? strs[idx] : NULL); +} + +static void +print_icmp6_stats_val(uint64_t *val, size_t idx) +{ + static const char * const strs[] = { + "ICMP6_MIB_NUM", + "ICMP6_MIB_INMSGS", + "ICMP6_MIB_INERRORS", + "ICMP6_MIB_OUTMSGS", + "ICMP6_MIB_OUTERRORS", + "ICMP6_MIB_CSUMERRORS", + "6 /* ICMP6_MIB_??? */", + }; + + print_arr_uval(val, idx, idx < ARRAY_SIZE(strs) ? strs[idx] : NULL); +} + +int +main(void) +{ + static const uint8_t unknown_msg[] = { 0xab, 0xac, 0xdb, 0xcd }; + + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + + const unsigned int hdrlen = sizeof(struct ifinfomsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), 3 * NLA_HDRLEN + 256); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + + /* unknown AF_* */ + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + AF_UNIX, pattern, unknown_msg, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + /* AF_INET */ + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET_msg, print_AF_INET_msg, + 0, "IFLA_INET_UNSPEC", pattern, + unknown_msg, print_quoted_hex, 2, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET_msg, print_AF_INET_msg, + 2, "0x2 /* IFLA_INET_??? */", pattern, + unknown_msg, print_quoted_hex, 2, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + /* AF_INET: IFLA_INET_CONF */ + uint32_t inet_conf_vals[] = { 0xdeadc0de, 0xda7aface }; + TEST_NESTED_NLATTR_ARRAY_EX(fd, nlh0, hdrlen, + init_AF_INET_msg, print_AF_INET_msg, + IFLA_INET_CONF, pattern, + inet_conf_vals, 2, print_inet_conf_val); + + /* AF_INET6 */ + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + 0, "IFLA_INET6_UNSPEC", pattern, + unknown_msg, print_quoted_hex, 2, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + 9, "0x9 /* IFLA_INET6_??? */", pattern, + unknown_msg, print_quoted_hex, 2, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + /* AF_INET6: IFLA_INET6_FLAGS */ + static const struct { + uint32_t flags; + const char *str; + } inet6_flags[] = { + { 0xf, "0xf /* IF_??? */" }, + { 0x10, "IF_RS_SENT" }, + { 0xc0, "IF_RA_MANAGED|IF_RA_OTHERCONF" }, + { 0xdeadc0de, "IF_RS_SENT|IF_RA_MANAGED|IF_RA_OTHERCONF" + "|IF_READY|0x5eadc00e" }, + }; + + for (size_t i = 0; i < ARRAY_SIZE(inet6_flags); i++) { + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET6_msg, + print_AF_INET6_msg, + 1, "IFLA_INET6_FLAGS", pattern, + inet6_flags[i].flags, + print_quoted_hex, 2, + printf("%s", inet6_flags[i].str)); + } + + /* AF_INET6: IFLA_INET6_CONF */ + uint32_t inet6_conf_vals[] = { 0xdeadc0de, 0xda7aface }; + TEST_NESTED_NLATTR_ARRAY_EX(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + IFLA_INET6_CONF, pattern, + inet6_conf_vals, 2, print_inet6_conf_val); + + /* AF_INET6: IFLA_INET6_STATS */ + uint64_t inet6_stats_vals[] = { 0xdeadc0deda7aface, 0xdec0deedbadc0ded }; + TEST_NESTED_NLATTR_ARRAY_EX(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + IFLA_INET6_STATS, pattern, + inet6_stats_vals, 2, print_inet6_stats_val); + + /* AF_INET6: IFLA_INET6_MCAST */ + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + 4, "IFLA_INET6_MCAST", pattern, + unknown_msg, print_quoted_hex, 2, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + /* AF_INET6: IFLA_INET6_CACHEINFO */ + static const struct ifla_cacheinfo ci = { + 0xbadc0ded, 0xfacebeef, 0xdecafeed, 0xdeadfeed, + }; + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + 5, "IFLA_INET6_CACHEINFO", pattern, + ci, print_quoted_hex, 2, + PRINT_FIELD_U("{", ci, max_reasm_len); + PRINT_FIELD_U(", ", ci, tstamp); + PRINT_FIELD_U(", ", ci, reachable_time); + PRINT_FIELD_U(", ", ci, retrans_time); + printf("}")); + + /* AF_INET6: IFLA_INET6_ICMP6STATS */ + uint64_t icmp6_stats_vals[] = { + 0xdeadc0deda7aface, 0xdec0deedbadc0ded, 0xfacebeefdeadfeed, + 0xdeadc0deda7afacd, 0xdec0deedbadc0dee, 0xfacebeefdeadfeef, + 0xdeadc0deda7afacc + }; + TEST_NESTED_NLATTR_ARRAY_EX(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + IFLA_INET6_ICMP6STATS, pattern, + icmp6_stats_vals, 2, print_icmp6_stats_val); + + /* AF_INET6: IFLA_INET6_TOKEN */ + uint8_t inet6_addr[16] = { + 0xba, 0xdc, 0x0d, 0xed, 0xfa, 0xce, 0xbe, 0xef, + 0xde, 0xca, 0xfe, 0xed, 0xde, 0xad, 0xfe, 0xed, + }; + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + 7, "IFLA_INET6_TOKEN", pattern, + inet6_addr, print_quoted_hex, 2, + printf("inet_pton(AF_INET6" + ", \"badc:ded:face:beef" + ":deca:feed:dead:feed\")")); + + /* AF_INET6: IFLA_INET6_ */ + static const struct { + uint8_t flags; + const char *str; + } agms[] = { + { 0x0, "IN6_ADDR_GEN_MODE_EUI64" }, + { 0x3, "IN6_ADDR_GEN_MODE_RANDOM" }, + { 0x4, "0x4 /* IN6_ADDR_GEN_MODE_??? */" }, + { 0xff, "0xff /* IN6_ADDR_GEN_MODE_??? */" }, + }; + + for (size_t i = 0; i < ARRAY_SIZE(agms); i++) { + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET6_msg, + print_AF_INET6_msg, + 8, "IFLA_INET6_ADDR_GEN_MODE", + pattern, agms[i].flags, + print_quoted_hex, 2, + printf("%s", agms[i].str)); + } + + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/nlattr_ifla_af_spec.gen.test b/tests-m32/nlattr_ifla_af_spec.gen.test new file mode 100755 index 00000000..601eeb22 --- /dev/null +++ b/tests-m32/nlattr_ifla_af_spec.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifla_af_spec +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_ifla_brport.c b/tests-m32/nlattr_ifla_brport.c new file mode 100644 index 00000000..f8ef1caf --- /dev/null +++ b/tests-m32/nlattr_ifla_brport.c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include "test_nlattr.h" +#include +#include +#ifdef HAVE_LINUX_IF_LINK_H +# include +#endif +#include + +#if !HAVE_DECL_IFLA_PROTINFO +enum { IFLA_PROTINFO = 12 }; +#endif + +#define IFLA_BRPORT_PRIORITY 2 +#define IFLA_BRPORT_MESSAGE_AGE_TIMER 21 + +#define IFLA_ATTR IFLA_PROTINFO +#include "nlattr_ifla.h" + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const uint16_t u16 = 0xabcd; + const uint64_t u64 = 0xabcdedeeefeafeab; + const int fd = create_nl_socket(NETLINK_ROUTE); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN * 2 + sizeof(u64)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_BRPORT_PRIORITY, pattern, u16, + printf("%u", u16)); + + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_BRPORT_MESSAGE_AGE_TIMER, pattern, u64, + printf("%" PRIu64, u64)); + +#ifdef HAVE_STRUCT_IFLA_BRIDGE_ID + static const struct ifla_bridge_id id = { + .prio = { 0xab, 0xcd }, + .addr = { 0xab, 0xcd, 0xef, 0xac, 0xbc, 0xcd } + }; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_BRPORT_ROOT_ID, pattern, id, + printf("{prio=[%u, %u]" + ", addr=%02x:%02x:%02x:%02x:%02x:%02x}", + id.prio[0], id.prio[1], + id.addr[0], id.addr[1], id.addr[2], + id.addr[3], id.addr[4], id.addr[5])); +#endif + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/nlattr_ifla_brport.gen.test b/tests-m32/nlattr_ifla_brport.gen.test new file mode 100755 index 00000000..6758d8d1 --- /dev/null +++ b/tests-m32/nlattr_ifla_brport.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifla_brport +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_ifla_linkinfo.c b/tests-m32/nlattr_ifla_linkinfo.c new file mode 100644 index 00000000..080e7371 --- /dev/null +++ b/tests-m32/nlattr_ifla_linkinfo.c @@ -0,0 +1,692 @@ +/* + * IFLA_LINKINFO netlink attribute decoding check. + * + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include + +#include "test_nlattr.h" + +#include +#include +#ifdef HAVE_LINUX_IF_LINK_H +# include +#endif +#include + +#define XLAT_MACROS_ONLY +#include +#include +#undef XLAT_MACROS_ONLY + +#define IFLA_ATTR IFLA_LINKINFO +#include "nlattr_ifla.h" + +#define COMMA , +#define TEST_UNKNOWN_TUNNELS(fd_, nlh0_, objtype_, objtype_str_, \ + obj_, objsz_, arrstrs_, ...) \ + do { \ + /* 64 is guestimate for maximum unknown type len */ \ + char buf[8 * 2 + 64 + objsz_]; \ + const char **arrstrs[] = arrstrs_; \ + const char ***arrstrs_pos = arrstrs; \ + const char **arrstr = *arrstrs_pos; \ + const char *type = NULL; \ + \ + for (type = arrstr ? arrstr[0] : NULL; type && arrstr; \ + type = (++arrstr)[0] ? arrstr[0] \ + : (++arrstrs_pos)[0] \ + ? (arrstr = arrstrs_pos[0])[0] \ + : NULL) \ + { \ + size_t type_len = strlen(type) + 1; \ + \ + if (type_len > 64) \ + error_msg_and_fail("Unexpectedly long " \ + "unknown type: \"%s\" " \ + "(length is %zu)", \ + type, type_len); \ + \ + struct nlattr obj_nla = { \ + .nla_len = NLA_HDRLEN + (objsz_), \ + .nla_type = (objtype_), \ + }; \ + \ + char *pos = buf; \ + memcpy(pos, type, type_len); \ + pos += NLA_ALIGN(type_len); \ + memcpy(pos, &obj_nla, sizeof(obj_nla)); \ + pos += sizeof(obj_nla); \ + memcpy(pos, (obj_), (objsz_)); \ + \ + TEST_NLATTR_EX_((fd_), \ + (nlh0_) - hdrlen - (pos - buf), \ + hdrlen + NLA_HDRLEN, \ + init_ifinfomsg, print_ifinfomsg, \ + IFLA_INFO_KIND, "IFLA_INFO_KIND", \ + type_len, objsz_ + (pos - buf), \ + buf, objsz_ + (pos - buf), \ + printf("\"%s\"}", type); \ + printf(", {{nla_len=%zu" \ + ", nla_type=%s}, ", \ + (objsz_) + NLA_HDRLEN, \ + (objtype_str_)); \ + \ + { __VA_ARGS__; } \ + \ + printf("}")); \ + } \ + } while (0) + +#define TEST_LINKINFO_(fd_, nlh0_, nla_type_, nla_type_str_, tuntype_, \ + obj_, objsz_, pattern_, fallback_func_, ...) \ + do { \ + size_t tuntype_len = strlen(tuntype_) + 1; \ + char *buf = tail_alloc(NLA_ALIGN(tuntype_len) \ + + NLA_HDRLEN + (objsz_)); \ + char *pos = buf; \ + \ + struct nlattr obj_nla = { \ + .nla_len = NLA_HDRLEN + (objsz_), \ + .nla_type = (nla_type_), \ + }; \ + \ + memcpy(pos, (tuntype_), tuntype_len); \ + pos += NLA_ALIGN(tuntype_len); \ + memcpy(pos, &obj_nla, sizeof(obj_nla)); \ + pos += sizeof(obj_nla); \ + memcpy(pos, &(obj_), (objsz_)); \ + \ + if (fallback_func_ == print_quoted_hex) { \ + TEST_NLATTR_EX_((fd_), \ + (nlh0_) - NLA_HDRLEN, \ + hdrlen + NLA_HDRLEN, \ + init_ifinfomsg, print_ifinfomsg, \ + IFLA_INFO_KIND, "IFLA_INFO_KIND", \ + tuntype_len, \ + objsz_ + (pos - buf) - 1, \ + buf, objsz_ + (pos - buf) - 1, \ + printf("\"%s\"}", (tuntype_)); \ + printf(", {{nla_len=%zu" \ + ", nla_type=%s}, ", \ + (objsz_) + NLA_HDRLEN, \ + (nla_type_str_)); \ + (fallback_func_)((obj_), \ + (objsz_) - 1); \ + printf("}")); \ + } \ + \ + TEST_NLATTR_EX_((fd_), (nlh0_) - NLA_HDRLEN, \ + hdrlen + NLA_HDRLEN, \ + init_ifinfomsg, print_ifinfomsg, \ + IFLA_INFO_KIND, "IFLA_INFO_KIND", \ + tuntype_len, objsz_ + (pos - buf), \ + buf, objsz_ + (pos - buf) - 1, \ + printf("\"%s\"}", (tuntype_)); \ + printf(", {{nla_len=%zu, nla_type=%s}, ", \ + (objsz_) + NLA_HDRLEN, \ + (nla_type_str_)); \ + printf("%p}", \ + RTA_DATA(NLMSG_ATTR(nlh, \ + (hdrlen + NLA_HDRLEN + (pos - buf)))) \ + ) \ + ); \ + \ + TEST_NLATTR_EX_((fd_), (nlh0_) - NLA_HDRLEN, \ + hdrlen + NLA_HDRLEN, \ + init_ifinfomsg, print_ifinfomsg, \ + IFLA_INFO_KIND, "IFLA_INFO_KIND", \ + tuntype_len, objsz_ + (pos - buf), \ + buf, objsz_ + (pos - buf), \ + printf("\"%s\"}", (tuntype_)); \ + printf(", {{nla_len=%zu, nla_type=%s}, ", \ + (objsz_) + NLA_HDRLEN, \ + (nla_type_str_)); \ + \ + { __VA_ARGS__; } \ + \ + printf("}")); \ + } while (0) + +#define TEST_LINKINFO(fd_, nlh0_, nla_type_, tuntype_, \ + obj_, pattern_, fallback_func_, ...) \ + TEST_LINKINFO_((fd_), (nlh0_), nla_type_, #nla_type_, (tuntype_), \ + (obj_), sizeof(obj_), pattern_, fallback_func_, \ + __VA_ARGS__) + +#define TEST_NESTED_LINKINFO(fd_, nlh0_, \ + nla_type_, nla_type_str_, tuntype_, \ + subnla_type_, subnla_type_str_, \ + obj_, pattern_, ...) \ + do { \ + size_t tuntype_len = strlen(tuntype_) + 1; \ + struct { \ + size_t sz; \ + const char *str; \ + } attrs[] = { __VA_ARGS__ }; \ + size_t tunhdrlen; \ + size_t buflen = NLA_ALIGN(tuntype_len) + NLA_HDRLEN; \ + size_t attrsz = 0; \ + \ + for (size_t i = 0; i < ARRAY_SIZE(attrs); i++) \ + attrsz += NLA_HDRLEN + NLA_ALIGN(attrs[i].sz); \ + \ + buflen += attrsz; \ + \ + char *buf = tail_alloc(buflen); \ + char *pos = buf; \ + \ + struct nlattr nla = { \ + .nla_len = NLA_HDRLEN + attrsz, \ + .nla_type = (nla_type_), \ + }; \ + \ + memcpy(pos, (tuntype_), tuntype_len); \ + pos += NLA_ALIGN(tuntype_len); \ + memcpy(pos, &nla, sizeof(nla)); \ + pos += sizeof(nla); \ + \ + tunhdrlen = pos - buf; \ + \ + nla.nla_type = subnla_type_; \ + \ + for (size_t i = 0; i < ARRAY_SIZE(attrs); i++) { \ + nla.nla_len = NLA_HDRLEN + attrs[i].sz; \ + memcpy(pos, &nla, sizeof(nla)); \ + pos += sizeof(nla); \ + \ + memcpy(pos, &(obj_), MIN(sizeof(obj_), attrs[i].sz)); \ + \ + if (attrs[i].sz > sizeof(obj_)) \ + memcpy(pos + sizeof(obj_), \ + &(pattern_), \ + attrs[i].sz - sizeof(obj_)); \ + \ + pos += NLA_ALIGN(attrs[i].sz); \ + } \ + \ + TEST_NLATTR_EX_((fd_), (nlh0_) - hdrlen - tunhdrlen, \ + hdrlen + NLA_HDRLEN, \ + init_ifinfomsg, print_ifinfomsg, \ + IFLA_INFO_KIND, "IFLA_INFO_KIND", \ + tuntype_len, buflen, \ + buf, buflen, \ + printf("\"%s\"}", (tuntype_)); \ + printf(", {{nla_len=%zu, nla_type=%s}, [", \ + attrsz + NLA_HDRLEN, \ + (nla_type_str_)); \ + \ + for (size_t i = 0; i < ARRAY_SIZE(attrs); i++) \ + printf("%s%s{nla_len=%zu" \ + ", nla_type=%s}%s%s%s", \ + i ? ", " : "", \ + attrs[i].str ? "{": "", \ + attrs[i].sz + NLA_HDRLEN, \ + subnla_type_str_, \ + attrs[i].str ? ", ": "", \ + attrs[i].str ?: "", \ + attrs[i].str ? "}" : ""); \ + \ + printf("]}")); \ + } while (0) + +int +main(void) +{ + static const uint8_t unknown_msg[] = { 0xab, 0xac, 0xdb, 0xcd }; + static const char *unsupported_tunnel_types[] = { + "batadv", "bond", + "caif", "cfhsi", + "dummy", + "erspan", + "geneve", "gre", "gretap", "gtp", + "hsr", + "ifb", "ip6erspan", "ip6gre", "ip6gretap", "ip6tnl", + "ipip", "ipoib", "ipvlan", "ipvtap", + "lowpan", + "macsec", "macvlan", "macvtap", + "netdevsim", "nlmon", + "openvswitch", + "ppp", + "rmnet", + "sit", + "team", + "vcan", "veth", "vlan", "vrf", "vsockmon", + "vti", "vti6", "vxcan", "vxlan", + NULL + }; + static const char *unsupported_xstats_types[] = { + "bridge", + "tun", + NULL + }; + static const char *unsupported_data_types[] = { + "can", + NULL + }; + + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + + const unsigned int hdrlen = sizeof(struct ifinfomsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), 2 * NLA_HDRLEN + 256); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + + /* unknown AF_INFO_* type */ + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_INFO_UNSPEC, pattern, unknown_msg, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + 6, "0x6 /* IFLA_INFO_??? */", pattern, + unknown_msg, print_quoted_hex, 1, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + + /* IFLA_INFO_KIND */ + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_INFO_KIND, "IFLA_INFO_KIND", pattern, + unknown_msg, print_quoted_stringn, 1, + printf("\"\\253\\254\\333\\315\"...")); + + + /* IFLA_INFO_KIND + IFLA_INFO_UNSPEC */ + TEST_UNKNOWN_TUNNELS(fd, nlh0, IFLA_INFO_UNSPEC, "IFLA_INFO_UNSPEC", + unknown_msg, sizeof(unknown_msg), + {unsupported_tunnel_types COMMA + unsupported_xstats_types COMMA + unsupported_data_types COMMA + NULL}, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + + /* IFLA_INFO_KIND + IFLA_INFO_KIND */ + TEST_UNKNOWN_TUNNELS(fd, nlh0, IFLA_INFO_KIND, "IFLA_INFO_KIND", + unknown_msg, sizeof(unknown_msg), + {unsupported_tunnel_types COMMA + unsupported_xstats_types COMMA + unsupported_data_types COMMA + NULL}, + printf("\"\\253\\254\\333\\315\"...")); + + + /* IFLA_INFO_KIND + IFLA_INFO_DATA */ + TEST_UNKNOWN_TUNNELS(fd, nlh0, IFLA_INFO_DATA, "IFLA_INFO_DATA", + unknown_msg, sizeof(unknown_msg), + {unsupported_tunnel_types COMMA + unsupported_data_types COMMA + NULL}, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + struct val_name { + unsigned int val; + const char *name; + }; + + static const uint64_t u64_val = 0xdeadc0defacefeedULL; + static const uint32_t u32_val = 0xbadc0dedU; + static const uint16_t u16_val = 0xdeed; + static const uint8_t u8_val = 0xa1; + + /* bridge attrs */ + static const struct val_name und_br_attrs[] = { + { 0, "IFLA_BR_UNSPEC" }, + { 20, "IFLA_BR_GROUP_ADDR" }, + { 21, "IFLA_BR_FDB_FLUSH" }, + { 40, "IFLA_BR_PAD" }, + { 47, "0x2f /* IFLA_BR_??? */" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(und_br_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + und_br_attrs[k].val, und_br_attrs[k].name, + unknown_msg, pattern, + { 2, "\"\\xab\\xac\"" }, + { 4, "\"\\xab\\xac\\xdb\\xcd\"" }, + { 6, + "\"\\xab\\xac\\xdb\\xcd\\x61\\x62\"" }, + { 8, "\"\\xab\\xac\\xdb\\xcd\\x61\\x62" + "\\x63\\x64\"" }, + { 10, "\"\\xab\\xac\\xdb\\xcd\\x61\\x62" + "\\x63\\x64\\x65\\x66\"" }); + } + + static const struct val_name u64_br_attrs[] = { + { 16, "IFLA_BR_HELLO_TIMER" }, + { 17, "IFLA_BR_TCN_TIMER" }, + { 18, "IFLA_BR_TOPOLOGY_CHANGE_TIMER" }, + { 19, "IFLA_BR_GC_TIMER" }, + { 30, "IFLA_BR_MCAST_LAST_MEMBER_INTVL" }, + { 31, "IFLA_BR_MCAST_MEMBERSHIP_INTVL" }, + { 32, "IFLA_BR_MCAST_QUERIER_INTVL" }, + { 33, "IFLA_BR_MCAST_QUERY_INTVL" }, + { 34, "IFLA_BR_MCAST_QUERY_RESPONSE_INTVL" }, + { 35, "IFLA_BR_MCAST_STARTUP_QUERY_INTVL" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(u64_br_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + u64_br_attrs[k].val, u64_br_attrs[k].name, + u64_val, pattern, + { 7, "\"" +#if WORDS_BIGENDIAN + "\\xde\\xad\\xc0\\xde\\xfa\\xce\\xfe" +#else + "\\xed\\xfe\\xce\\xfa\\xde\\xc0\\xad" +#endif + "\"" }, + { 8, "16045693111314087661" }, + { 9, "16045693111314087661" }); + } + + static const struct val_name u32_br_attrs[] = { + { 1, "IFLA_BR_FORWARD_DELAY" }, + { 2, "IFLA_BR_HELLO_TIME" }, + { 3, "IFLA_BR_MAX_AGE" }, + { 4, "IFLA_BR_AGEING_TIME" }, + { 5, "IFLA_BR_STP_STATE" }, + { 13, "IFLA_BR_ROOT_PATH_COST" }, + { 26, "IFLA_BR_MCAST_HASH_ELASTICITY" }, + { 27, "IFLA_BR_MCAST_HASH_MAX" }, + { 28, "IFLA_BR_MCAST_LAST_MEMBER_CNT" }, + { 29, "IFLA_BR_MCAST_STARTUP_QUERY_CNT" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(u32_br_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + u32_br_attrs[k].val, u32_br_attrs[k].name, + u32_val, pattern, + { 3, "\"" +#if WORDS_BIGENDIAN + "\\xba\\xdc\\x0d" +#else + "\\xed\\x0d\\xdc" +#endif + "\"" }, + { 4, "3134983661" }, + { 5, "3134983661" }); + } + + static const struct val_name u16_br_attrs[] = { + { 6, "IFLA_BR_PRIORITY" }, + { 12, "IFLA_BR_ROOT_PORT" }, + { 39, "IFLA_BR_VLAN_DEFAULT_PVID" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(u16_br_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + u16_br_attrs[k].val, u16_br_attrs[k].name, + u16_val, pattern, + { 1, "\"" +#if WORDS_BIGENDIAN + "\\xde" +#else + "\\xed" +#endif + "\"" }, + { 2, "57069" }, + { 3, "57069" }); + } + + + static const struct val_name x16_br_attrs[] = { + { 9, "IFLA_BR_GROUP_FWD_MASK" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(x16_br_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + x16_br_attrs[k].val, x16_br_attrs[k].name, + u16_val, pattern, + { 1, "\"" +#if WORDS_BIGENDIAN + "\\xde" +#else + "\\xed" +#endif + "\"" }, + { 2, "0xdeed" }, + { 3, "0xdeed" }); + } + + static const struct val_name u8_br_attrs[] = { + { 7, "IFLA_BR_VLAN_FILTERING" }, + { 14, "IFLA_BR_TOPOLOGY_CHANGE" }, + { 15, "IFLA_BR_TOPOLOGY_CHANGE_DETECTED" }, + { 22, "IFLA_BR_MCAST_ROUTER" }, + { 23, "IFLA_BR_MCAST_SNOOPING" }, + { 24, "IFLA_BR_MCAST_QUERY_USE_IFADDR" }, + { 25, "IFLA_BR_MCAST_QUERIER" }, + { 36, "IFLA_BR_NF_CALL_IPTABLES" }, + { 37, "IFLA_BR_NF_CALL_IP6TABLES" }, + { 38, "IFLA_BR_NF_CALL_ARPTABLES" }, + { 41, "IFLA_BR_VLAN_STATS_ENABLED" }, + { 42, "IFLA_BR_MCAST_STATS_ENABLED" }, + { 43, "IFLA_BR_MCAST_IGMP_VERSION" }, + { 44, "IFLA_BR_MCAST_MLD_VERSION" }, + { 45, "IFLA_BR_VLAN_STATS_PER_PORT" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(u8_br_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + u8_br_attrs[k].val, u8_br_attrs[k].name, + u8_val, pattern, + { 0, NULL }, + { 1, "161" }, + { 2, "161" }); + } + + unsigned short eth_p = htons(0x88C7); + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + 8, "IFLA_BR_VLAN_PROTOCOL", + eth_p, pattern, + { 1, "\"\\x88\"" }, + { 2, "htons(ETH_P_PREAUTH)" }, + { 2, "htons(ETH_P_PREAUTH)" }); + + static const uint8_t bridge_id[] + = { 0xbe, 0xef, 0xfa, 0xce, 0xde, 0xc0, 0xde, 0xad }; + static const struct val_name br_id_attrs[] = { + { 10, "IFLA_BR_ROOT_ID" }, + { 11, "IFLA_BR_BRIDGE_ID" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(br_id_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + br_id_attrs[k].val, br_id_attrs[k].name, + bridge_id, pattern, + { 7, "\"\\xbe\\xef\\xfa\\xce" + "\\xde\\xc0\\xde\"" }, + { 8, "{prio=[190, 239]" + ", addr=fa:ce:de:c0:de:ad}" }, + { 9, "{prio=[190, 239]" + ", addr=fa:ce:de:c0:de:ad}" }); + } + + /* tun attrs */ + static const struct val_name u8_tun_attrs[] = { + { 4, "IFLA_TUN_PI" }, + { 5, "IFLA_TUN_VNET_HDR" }, + { 6, "IFLA_TUN_PERSIST" }, + { 7, "IFLA_TUN_MULTI_QUEUE" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(u8_tun_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "tun", + u8_tun_attrs[k].val, u8_tun_attrs[k].name, + u8_val, pattern, + { 0, NULL }, + { 1, "161" }, + { 2, "161" }); + } + + static const struct val_name u32_tun_attrs[] = { + { 8, "IFLA_TUN_NUM_QUEUES" }, + { 9, "IFLA_TUN_NUM_DISABLED_QUEUES" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(u32_tun_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "tun", + u32_tun_attrs[k].val, + u32_tun_attrs[k].name, + u32_val, pattern, + { 3, "\"" +#if WORDS_BIGENDIAN + "\\xba\\xdc\\x0d" +#else + "\\xed\\x0d\\xdc" +#endif + "\"" }, + { 4, "3134983661" }, + { 5, "3134983661" }); + } + + static const struct val_name und_tun_attrs[] = { + { 0, "IFLA_TUN_UNSPEC" }, + { 10, "0xa /* IFLA_TUN_??? */" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(und_tun_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "tun", + und_tun_attrs[k].val, + und_tun_attrs[k].name, + unknown_msg, pattern, + { 2, "\"\\xab\\xac\"" }, + { 4, "\"\\xab\\xac\\xdb\\xcd\"" }, + { 6, + "\"\\xab\\xac\\xdb\\xcd\\x61\\x62\"" }, + { 8, "\"\\xab\\xac\\xdb\\xcd\\x61\\x62" + "\\x63\\x64\"" }, + { 10, "\"\\xab\\xac\\xdb\\xcd\\x61\\x62" + "\\x63\\x64\\x65\\x66\"" }); + } + + static const uint32_t minus_one = 0xffffffffU; + static const struct val_name uid_tun_attrs[] = { + { 1, "IFLA_TUN_OWNER" }, + { 2, "IFLA_TUN_GROUP" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(uid_tun_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "tun", + uid_tun_attrs[k].val, + uid_tun_attrs[k].name, + u32_val, pattern, + { 3, "\"" +#if WORDS_BIGENDIAN + "\\xba\\xdc\\x0d" +#else + "\\xed\\x0d\\xdc" +#endif + "\"" }, + { 4, "3134983661" }, + { 5, "3134983661" }); + + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "tun", + uid_tun_attrs[k].val, + uid_tun_attrs[k].name, + minus_one, pattern, + { 3, "\"\\xff\\xff\\xff\"" }, + { 4, "-1" }, + { 5, "-1" }); + } + + static const struct { + uint8_t val; + const char *str; + } tun_types[] = { + { 0, "0 /* IFF_??? */"}, + { 1, "IFF_TUN"}, + { 2, "IFF_TAP"}, + { 3, "0x3 /* IFF_??? */"}, + { 0xda, "0xda /* IFF_??? */"}, + }; + + for (size_t k = 0; k < ARRAY_SIZE(tun_types); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "tun", + 3, "IFLA_TUN_TYPE", + tun_types[k].val, pattern, + { 0, NULL }, + { 1, tun_types[k].str }, + { 2, tun_types[k].str }); + } + + + /* IFLA_INFO_KIND + IFLA_INFO_XSTATS */ + TEST_UNKNOWN_TUNNELS(fd, nlh0, IFLA_INFO_XSTATS, "IFLA_INFO_XSTATS", + unknown_msg, sizeof(unknown_msg), + {unsupported_tunnel_types COMMA + /* + * can decoder decodes its data only if it's big + * enough. + */ + unsupported_xstats_types COMMA + unsupported_data_types COMMA + NULL}, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + uint32_t can_stats_data[] = { + 0xbadc0de0, 0xbadc0de1, 0xbadc0de2, 0xbadc0de3, + 0xbadc0de4, 0xbadc0de5, + }; + + TEST_LINKINFO(fd, nlh0, IFLA_INFO_XSTATS, "can", + can_stats_data, pattern, print_quoted_hex, + printf("{bus_error=3134983648" + ", error_warning=3134983649" + ", error_passive=3134983650" + ", bus_off=3134983651" + ", arbitration_lost=3134983652" + ", restarts=3134983653}")); + + + /* IFLA_INFO_KIND + IFLA_INFO_SLVAE_KIND */ + TEST_UNKNOWN_TUNNELS(fd, nlh0, + IFLA_INFO_SLAVE_KIND, "IFLA_INFO_SLAVE_KIND", + unknown_msg, sizeof(unknown_msg), + {unsupported_tunnel_types COMMA + unsupported_xstats_types COMMA + unsupported_data_types COMMA + NULL}, + printf("\"\\253\\254\\333\\315\"...")); + + + /* IFLA_INFO_KIND + IFLA_INFO_SLAVE_DATA */ + TEST_UNKNOWN_TUNNELS(fd, nlh0, + IFLA_INFO_SLAVE_DATA, "IFLA_INFO_SLAVE_DATA", + unknown_msg, sizeof(unknown_msg), + {unsupported_tunnel_types COMMA + unsupported_xstats_types COMMA + unsupported_data_types COMMA + NULL}, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + + /* IFLA_INFO_KIND + unknown type */ + TEST_UNKNOWN_TUNNELS(fd, nlh0, 6, "0x6 /* IFLA_INFO_??? */", + unknown_msg, sizeof(unknown_msg), + {unsupported_tunnel_types COMMA + unsupported_xstats_types COMMA + unsupported_data_types COMMA + NULL}, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/nlattr_ifla_linkinfo.gen.test b/tests-m32/nlattr_ifla_linkinfo.gen.test new file mode 100755 index 00000000..816ba99c --- /dev/null +++ b/tests-m32/nlattr_ifla_linkinfo.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifla_linkinfo +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_ifla_port.c b/tests-m32/nlattr_ifla_port.c new file mode 100644 index 00000000..df2a2ef6 --- /dev/null +++ b/tests-m32/nlattr_ifla_port.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include "test_nlattr.h" +#include +#include +#ifdef HAVE_LINUX_IF_LINK_H +# include +#endif +#include + +#if !HAVE_DECL_IFLA_PORT_SELF +enum { IFLA_PORT_SELF = 25 }; +#endif +#ifndef IFLA_PORT_VF +# define IFLA_PORT_VF 1 +#endif + +#define IFLA_ATTR IFLA_PORT_SELF +#include "nlattr_ifla.h" + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), 2 * NLA_HDRLEN + 8); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const uint32_t num = 0xabacdbcd; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_PORT_VF, pattern, num, + printf("%u", num)); + +#ifdef HAVE_STRUCT_IFLA_PORT_VSI + static const struct ifla_port_vsi vsi = { + .vsi_mgr_id = 0xab, + .vsi_type_id = "abc", + .vsi_type_version = 0xef + }; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_PORT_VSI_TYPE, pattern, vsi, + PRINT_FIELD_U("{", vsi, vsi_mgr_id); + printf(", vsi_type_id=\"\\x61\\x62\\x63\""); + PRINT_FIELD_U(", ", vsi, vsi_type_version); + printf("}")); +#endif + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/nlattr_ifla_port.gen.test b/tests-m32/nlattr_ifla_port.gen.test new file mode 100755 index 00000000..ecea89a4 --- /dev/null +++ b/tests-m32/nlattr_ifla_port.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifla_port +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_ifla_xdp.c b/tests-m32/nlattr_ifla_xdp.c new file mode 100644 index 00000000..232f2145 --- /dev/null +++ b/tests-m32/nlattr_ifla_xdp.c @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include "test_nlattr.h" +#include +#include +#ifdef HAVE_LINUX_IF_LINK_H +# include +#endif +#include + +#if !HAVE_DECL_IFLA_XDP +enum { IFLA_XDP = 43 }; +#endif +#ifndef IFLA_XDP_FD +# define IFLA_XDP_FD 1 +#endif + +#ifndef IFLA_XDP_ATTACHED +# define IFLA_XDP_ATTACHED 2 +#endif + +#ifndef IFLA_XDP_PROG_ID +# define IFLA_XDP_PROG_ID 4 +#endif + +#ifndef IFLA_XDP_DRV_PROG_ID +# define IFLA_XDP_DRV_PROG_ID 5 +#endif + +#ifndef IFLA_XDP_SKB_PROG_ID +# define IFLA_XDP_SKB_PROG_ID 6 +#endif + +#ifndef IFLA_XDP_HW_PROG_ID +# define IFLA_XDP_HW_PROG_ID 7 +#endif + +#ifndef XDP_ATTACHED_NONE +# define XDP_ATTACHED_NONE 0 +#endif + +#ifndef XDP_ATTACHED_MULTI +# define XDP_ATTACHED_MULTI 4 +#endif + +#define IFLA_ATTR IFLA_XDP +#include "nlattr_ifla.h" + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int32_t num = 0xabacdbcd; + const int fd = create_nl_socket(NETLINK_ROUTE); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(num)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_XDP_FD, pattern, num, + printf("%d", num)); + + static const struct { + uint8_t val; + const char *str; + } attach_types[] = { + { ARG_STR(XDP_ATTACHED_NONE) }, + { ARG_STR(XDP_ATTACHED_MULTI) }, + { ARG_STR(0x5) " /* XDP_ATTACHED_??? */" }, + { ARG_STR(0xfe) " /* XDP_ATTACHED_??? */" }, + }; + + for (size_t i = 0; i < ARRAY_SIZE(attach_types); i++) { + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_XDP_ATTACHED, pattern, + attach_types[i].val, + printf("%s", attach_types[i].str)); + } + +#ifdef XDP_FLAGS_UPDATE_IF_NOEXIST + const uint32_t flags = XDP_FLAGS_UPDATE_IF_NOEXIST; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_XDP_FLAGS, pattern, flags, + printf("XDP_FLAGS_UPDATE_IF_NOEXIST")); +#endif + + static const struct { + uint32_t val; + const char *str; + } attrs[] = { + { ARG_STR(IFLA_XDP_PROG_ID) }, + { ARG_STR(IFLA_XDP_DRV_PROG_ID) }, + { ARG_STR(IFLA_XDP_SKB_PROG_ID) }, + { ARG_STR(IFLA_XDP_HW_PROG_ID) }, + }; + + for (size_t i = 0; i < ARRAY_SIZE(attrs); i++) { + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + attrs[i].val, attrs[i].str, + pattern, num, + print_quoted_hex, 1, + printf("%u", num)); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/nlattr_ifla_xdp.gen.test b/tests-m32/nlattr_ifla_xdp.gen.test new file mode 100755 index 00000000..c6e0fab3 --- /dev/null +++ b/tests-m32/nlattr_ifla_xdp.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifla_xdp +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_inet_diag_msg.c b/tests-m32/nlattr_inet_diag_msg.c new file mode 100644 index 00000000..97f5a95e --- /dev/null +++ b/tests-m32/nlattr_inet_diag_msg.c @@ -0,0 +1,205 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include "test_nlattr.h" +#include +#include + +static const char * const sk_meminfo_strs[] = { + "SK_MEMINFO_RMEM_ALLOC", + "SK_MEMINFO_RCVBUF", + "SK_MEMINFO_WMEM_ALLOC", + "SK_MEMINFO_SNDBUF", + "SK_MEMINFO_FWD_ALLOC", + "SK_MEMINFO_WMEM_QUEUED", + "SK_MEMINFO_OPTMEM", + "SK_MEMINFO_BACKLOG", + "SK_MEMINFO_DROPS", +}; + +static const char address[] = "10.11.12.13"; + +static void +init_inet_diag_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP + ); + + struct inet_diag_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct inet_diag_msg, msg, + .idiag_family = AF_INET, + .idiag_state = TCP_LISTEN, + .id.idiag_if = ifindex_lo() + ); + + if (!inet_pton(AF_INET, address, msg->id.idiag_src) || + !inet_pton(AF_INET, address, msg->id.idiag_dst)) + perror_msg_and_skip("inet_pton"); +} + +static void +print_inet_diag_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {idiag_family=AF_INET" + ", idiag_state=TCP_LISTEN, idiag_timer=0, idiag_retrans=0" + ", id={idiag_sport=htons(0), idiag_dport=htons(0)" + ", idiag_src=inet_addr(\"%s\")" + ", idiag_dst=inet_addr(\"%s\")" + ", idiag_if=" IFINDEX_LO_STR + ", idiag_cookie=[0, 0]}" + ", idiag_expires=0, idiag_rqueue=0, idiag_wqueue=0" + ", idiag_uid=0, idiag_inode=0}", + msg_len, address, address); +} + +static void +print_uint(const unsigned int *p, size_t i) +{ + if (i >= ARRAY_SIZE(sk_meminfo_strs)) + printf("[%zu /* SK_MEMINFO_??? */", i); + else + printf("[%s", sk_meminfo_strs[i]); + + printf("] = %u", *p); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + static const struct inet_diag_meminfo minfo = { + .idiag_rmem = 0xfadcacdb, + .idiag_wmem = 0xbdabcada, + .idiag_fmem = 0xbadbfafb, + .idiag_tmem = 0xfdacdadf + }; + static const struct tcpvegas_info vegas = { + .tcpv_enabled = 0xfadcacdb, + .tcpv_rttcnt = 0xbdabcada, + .tcpv_rtt = 0xbadbfafb, + .tcpv_minrtt = 0xfdacdadf + }; + static const struct tcp_dctcp_info dctcp = { + .dctcp_enabled = 0xfdac, + .dctcp_ce_state = 0xfadc, + .dctcp_alpha = 0xbdabcada, + .dctcp_ab_ecn = 0xbadbfafb, + .dctcp_ab_tot = 0xfdacdadf + }; + static const struct tcp_bbr_info bbr = { + .bbr_bw_lo = 0xfdacdadf, + .bbr_bw_hi = 0xfadcacdb, + .bbr_min_rtt = 0xbdabcada, + .bbr_pacing_gain = 0xbadbfafb, + .bbr_cwnd_gain = 0xfdacdadf + }; + static const uint32_t mem[] = { 0xaffacbad, 0xffadbcab }; + static uint32_t bigmem[SK_MEMINFO_VARS + 1]; + static const uint32_t mark = 0xabdfadca; + static const uint8_t shutdown = 0xcd; + + const int fd = create_nl_socket(NETLINK_SOCK_DIAG); + const unsigned int hdrlen = sizeof(struct inet_diag_msg); + void *const nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + + MAX(sizeof(bigmem), DEFAULT_STRLEN)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_MEMINFO, pattern, minfo, + PRINT_FIELD_U("{", minfo, idiag_rmem); + PRINT_FIELD_U(", ", minfo, idiag_wmem); + PRINT_FIELD_U(", ", minfo, idiag_fmem); + PRINT_FIELD_U(", ", minfo, idiag_tmem); + printf("}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_VEGASINFO, pattern, vegas, + PRINT_FIELD_U("{", vegas, tcpv_enabled); + PRINT_FIELD_U(", ", vegas, tcpv_rttcnt); + PRINT_FIELD_U(", ", vegas, tcpv_rtt); + PRINT_FIELD_U(", ", vegas, tcpv_minrtt); + printf("}")); + + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_DCTCPINFO, pattern, dctcp, + PRINT_FIELD_U("{", dctcp, dctcp_enabled); + PRINT_FIELD_U(", ", dctcp, dctcp_ce_state); + PRINT_FIELD_U(", ", dctcp, dctcp_alpha); + PRINT_FIELD_U(", ", dctcp, dctcp_ab_ecn); + PRINT_FIELD_U(", ", dctcp, dctcp_ab_tot); + printf("}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_BBRINFO, pattern, bbr, + PRINT_FIELD_X("{", bbr, bbr_bw_lo); + PRINT_FIELD_X(", ", bbr, bbr_bw_hi); + PRINT_FIELD_U(", ", bbr, bbr_min_rtt); + PRINT_FIELD_U(", ", bbr, bbr_pacing_gain); + PRINT_FIELD_U(", ", bbr, bbr_cwnd_gain); + printf("}")); + + TEST_NLATTR_ARRAY(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_SKMEMINFO, pattern, mem, print_uint); + + memcpy(bigmem, pattern, sizeof(bigmem)); + + TEST_NLATTR_ARRAY(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_SKMEMINFO, pattern, bigmem, print_uint); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_MARK, pattern, mark, + printf("%u", mark)); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_CLASS_ID, pattern, mark, + printf("%u", mark)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, INET_DIAG_SHUTDOWN, + sizeof(shutdown), &shutdown, sizeof(shutdown), + printf("%u", shutdown)); + + char *const str = tail_alloc(DEFAULT_STRLEN); + fill_memory_ex(str, DEFAULT_STRLEN, '0', 10); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, INET_DIAG_CONG, + DEFAULT_STRLEN, str, DEFAULT_STRLEN, + printf("\"%.*s\"...", DEFAULT_STRLEN, str)); + str[DEFAULT_STRLEN - 1] = '\0'; + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, INET_DIAG_CONG, + DEFAULT_STRLEN, str, DEFAULT_STRLEN, + printf("\"%s\"", str)); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/nlattr_inet_diag_msg.gen.test b/tests-m32/nlattr_inet_diag_msg.gen.test new file mode 100755 index 00000000..953a23df --- /dev/null +++ b/tests-m32/nlattr_inet_diag_msg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_inet_diag_msg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_inet_diag_req_compat.c b/tests-m32/nlattr_inet_diag_req_compat.c new file mode 100644 index 00000000..8cce46cd --- /dev/null +++ b/tests-m32/nlattr_inet_diag_req_compat.c @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include "test_nlattr.h" +#include +#include +#include + +static const char address[] = "10.11.12.13"; + +static void +init_inet_diag_req(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = TCPDIAG_GETSOCK, + .nlmsg_flags = NLM_F_REQUEST + ); + + struct inet_diag_req *const req = NLMSG_DATA(nlh); + SET_STRUCT(struct inet_diag_req, req, + .idiag_family = AF_INET, + .idiag_ext = 1 << (INET_DIAG_TOS - 1), + .idiag_states = 1 << TCP_LAST_ACK, + .id.idiag_if = ifindex_lo() + ); + + if (!inet_pton(AF_INET, address, req->id.idiag_src) || + !inet_pton(AF_INET, address, req->id.idiag_dst)) + perror_msg_and_skip("inet_pton"); +} + +static void +print_inet_diag_req(const unsigned int msg_len) +{ + printf("{len=%u, type=TCPDIAG_GETSOCK, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, {idiag_family=AF_INET" + ", idiag_src_len=0, idiag_dst_len=0" + ", idiag_ext=1<<(INET_DIAG_TOS-1)" + ", id={idiag_sport=htons(0), idiag_dport=htons(0)" + ", idiag_src=inet_addr(\"%s\")" + ", idiag_dst=inet_addr(\"%s\")" + ", idiag_if=" IFINDEX_LO_STR + ", idiag_cookie=[0, 0]}" + ", idiag_states=1< + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include "test_nlattr.h" +#include +#include +#include + +static const char address[] = "10.11.12.13"; +static const unsigned int hdrlen = sizeof(struct inet_diag_req_v2); +static void *nlh0; +static char pattern[4096]; + +static void +init_inet_diag_req_v2(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_REQUEST + ); + + struct inet_diag_req_v2 *const req = NLMSG_DATA(nlh); + SET_STRUCT(struct inet_diag_req_v2, req, + .sdiag_family = AF_INET, + .idiag_ext = 1 << (INET_DIAG_CONG - 1), + .sdiag_protocol = IPPROTO_TCP, + .idiag_states = 1 << TCP_CLOSE, + .id.idiag_if = ifindex_lo() + ); + + if (!inet_pton(AF_INET, address, req->id.idiag_src) || + !inet_pton(AF_INET, address, req->id.idiag_dst)) + perror_msg_and_skip("inet_pton"); +} + +static void +print_inet_diag_req_v2(const unsigned int msg_len) +{ + printf("{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", {sdiag_family=AF_INET, sdiag_protocol=IPPROTO_TCP" + ", idiag_ext=1<<(INET_DIAG_CONG-1)" + ", idiag_states=1< DEFAULT_STRLEN ? + sizeof(op) + DEFAULT_STRLEN : sizeof(buf) - 1; + memcpy(buf + sizeof(op), &pattern, sizeof(cond)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + plen, buf, plen, + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + print_quoted_hex(buf + sizeof(op), plen - sizeof(op)); + printf("}")); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf) - 1, + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + printf("%p}", RTA_DATA(TEST_NLATTR_nla) + sizeof(op))); + + memcpy(buf + sizeof(op), &cond, sizeof(cond)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf), + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + printf("{family=AF_UNSPEC"); + PRINT_FIELD_U(", ", cond, prefix_len); + PRINT_FIELD_U(", ", cond, port); + printf("}}")); +} + +static void +print_inet_diag_hostcond(const char *const family) +{ + printf("{family=%s, prefix_len=0, port=0, ", family); +} + +static void +test_in_addr(const int fd) +{ + static const struct inet_diag_bc_op op = { + .code = INET_DIAG_BC_S_COND, + }; + static const struct inet_diag_hostcond cond = { + .family = AF_INET, + }; + struct in_addr addr; + if (!inet_pton(AF_INET, address, &addr)) + perror_msg_and_skip("inet_pton"); + + char buf[sizeof(op) + sizeof(cond) + sizeof(addr)]; + memcpy(buf, &op, sizeof(op)); + memcpy(buf + sizeof(op), &cond, sizeof(cond)); + + const unsigned int plen = sizeof(addr) - 1 > DEFAULT_STRLEN ? + sizeof(cond) + sizeof(cond) + DEFAULT_STRLEN : sizeof(buf) - 1; + memcpy(buf + sizeof(op) + sizeof(cond), &pattern, sizeof(addr)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + plen, buf, plen, + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + print_inet_diag_hostcond("AF_INET"); + printf("addr="); + print_quoted_hex(pattern, plen - sizeof(op) - sizeof(cond)); + printf("}}")); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf) - 1, + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + print_inet_diag_hostcond("AF_INET"); + printf("addr=%p}}", + RTA_DATA(TEST_NLATTR_nla) + + sizeof(op) + sizeof(cond))); + + memcpy(buf + sizeof(op) + sizeof(cond), &addr, sizeof(addr)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf), + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + print_inet_diag_hostcond("AF_INET"); + printf("addr=inet_addr(\"%s\")}}", address)); +} + +static void +test_in6_addr(const int fd) +{ + const char address6[] = "12:34:56:78:90:ab:cd:ef"; + static const struct inet_diag_bc_op op = { + .code = INET_DIAG_BC_S_COND, + }; + static const struct inet_diag_hostcond cond = { + .family = AF_INET6, + }; + struct in6_addr addr; + if (!inet_pton(AF_INET6, address6, &addr)) + perror_msg_and_skip("inet_pton"); + + char buf[sizeof(op) + sizeof(cond) + sizeof(addr)]; + memcpy(buf, &op, sizeof(op)); + memcpy(buf + sizeof(op), &cond, sizeof(cond)); + + const unsigned int plen = sizeof(addr) - 1 > DEFAULT_STRLEN ? + sizeof(cond) + sizeof(cond) + DEFAULT_STRLEN : sizeof(buf) - 1; + memcpy(buf + sizeof(op) + sizeof(cond), &pattern, sizeof(addr)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + plen, buf, plen, + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + print_inet_diag_hostcond("AF_INET6"); + printf("addr="); + print_quoted_hex(pattern, plen - sizeof(op) - sizeof(cond)); + printf("}}")); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf) - 1, + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + print_inet_diag_hostcond("AF_INET6"); + printf("addr=%p}}", + RTA_DATA(TEST_NLATTR_nla) + + sizeof(op) + sizeof(cond))); + + memcpy(buf + sizeof(op) + sizeof(cond), &addr, sizeof(addr)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf), + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + print_inet_diag_hostcond("AF_INET6"); + printf("inet_pton(AF_INET6, \"%s\", &addr)}}", address6)); +} + +static void +test_inet_diag_bc_dev_cond(const int fd) +{ + static const struct inet_diag_bc_op op = { + .code = INET_DIAG_BC_DEV_COND, + }; + const uint32_t ifindex = ifindex_lo(); + char buf[sizeof(op) + sizeof(ifindex)]; + memcpy(buf, &op, sizeof(op)); + memcpy(buf + sizeof(op), pattern, sizeof(ifindex)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf) - 1, buf, sizeof(buf) - 1, + print_inet_diag_bc_op("INET_DIAG_BC_DEV_COND"); + print_quoted_hex(pattern, sizeof(ifindex) - 1); + printf("}")); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf) - 1, + print_inet_diag_bc_op("INET_DIAG_BC_DEV_COND"); + printf("%p}", RTA_DATA(TEST_NLATTR_nla) + sizeof(op))); + + memcpy(buf + sizeof(op), &ifindex, sizeof(ifindex)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf), + print_inet_diag_bc_op("INET_DIAG_BC_DEV_COND"); + printf(IFINDEX_LO_STR "}")); +} + +static void +test_inet_diag_bc_s_le(const int fd) +{ + static const struct inet_diag_bc_op op[] = { + { + .code = INET_DIAG_BC_S_LE, + }, + { + .code = INET_DIAG_BC_DEV_COND, + .yes = 0xaf, + .no = 0xafcd + } + }; + + char buf[sizeof(op)]; + memcpy(buf, op, sizeof(op[0])); + memcpy(buf + sizeof(op[0]), pattern, sizeof(op[1])); + + const unsigned int plen = sizeof(op[1]) - 1 > DEFAULT_STRLEN ? + sizeof(op[0]) + DEFAULT_STRLEN : sizeof(buf) - 1; + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + plen, buf, plen, + print_inet_diag_bc_op("INET_DIAG_BC_S_LE"); + print_quoted_hex(buf + sizeof(op[0]), plen - sizeof(op[0])); + printf("}")); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf) - 1, + print_inet_diag_bc_op("INET_DIAG_BC_S_LE"); + printf("%p}", RTA_DATA(TEST_NLATTR_nla) + sizeof(op[0]))); + + memcpy(buf + sizeof(op[0]), &op[1], sizeof(op[1])); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf), + print_inet_diag_bc_op("INET_DIAG_BC_S_LE"); + printf("{code=INET_DIAG_BC_DEV_COND"); + PRINT_FIELD_U(", ", op[1], yes); + PRINT_FIELD_U(", ", op[1], no); + printf("}}")); +}; + +static void +test_inet_diag_bc_mark_cond(const int fd) +{ + static const struct inet_diag_bc_op op = { + .code = INET_DIAG_BC_MARK_COND, + }; + static const struct inet_diag_markcond markcond = { + .mark = 0xafbcafcd, + .mask = 0xbafaacda + }; + char buf[sizeof(op) + sizeof(markcond)]; + memcpy(buf, &op, sizeof(op)); + memcpy(buf + sizeof(op), pattern, sizeof(markcond)); + + const unsigned int plen = sizeof(markcond) - 1 > DEFAULT_STRLEN ? + sizeof(markcond) + DEFAULT_STRLEN : sizeof(buf) - 1; + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + plen, buf, plen, + print_inet_diag_bc_op("INET_DIAG_BC_MARK_COND"); + print_quoted_hex(buf + sizeof(op), plen - sizeof(op)); + printf("}")); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf) - 1, + print_inet_diag_bc_op("INET_DIAG_BC_MARK_COND"); + printf("%p}", RTA_DATA(TEST_NLATTR_nla) + sizeof(op))); + + memcpy(buf + sizeof(op), &markcond, sizeof(markcond)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf), + print_inet_diag_bc_op("INET_DIAG_BC_MARK_COND"); + PRINT_FIELD_U("{", markcond, mark); + PRINT_FIELD_U(", ", markcond, mask); + printf("}}")); +} + +static void +test_inet_diag_bc_nop(const int fd) +{ + static const struct inet_diag_bc_op op = { + .code = INET_DIAG_BC_AUTO, + }; + char buf[sizeof(op) + 4]; + memcpy(buf, &op, sizeof(op)); + memcpy(buf + sizeof(op), pattern, 4); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf), + print_inet_diag_bc_op("INET_DIAG_BC_AUTO"); + print_quoted_hex(buf + sizeof(op), + sizeof(buf) - sizeof(op)); + printf("}")); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_SOCK_DIAG); + nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + + sizeof(struct inet_diag_bc_op) + + sizeof(struct inet_diag_hostcond) + + sizeof(struct in6_addr) + DEFAULT_STRLEN); + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + test_inet_diag_bc_op(fd); + test_inet_diag_bc_s_cond(fd); + test_in_addr(fd); + test_in6_addr(fd); + test_inet_diag_bc_dev_cond(fd); + test_inet_diag_bc_s_le(fd); + test_inet_diag_bc_mark_cond(fd); + test_inet_diag_bc_nop(fd); + + printf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests-m32/nlattr_inet_diag_req_v2.gen.test b/tests-m32/nlattr_inet_diag_req_v2.gen.test new file mode 100755 index 00000000..01c73a13 --- /dev/null +++ b/tests-m32/nlattr_inet_diag_req_v2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_inet_diag_req_v2 +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_mdba_mdb_entry.c b/tests-m32/nlattr_mdba_mdb_entry.c new file mode 100644 index 00000000..7ac89ff0 --- /dev/null +++ b/tests-m32/nlattr_mdba_mdb_entry.c @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_BR_PORT_MSG + +# include +# include "test_nlattr.h" +# include +# include +# include + +# ifndef MDB_TEMPORARY +# define MDB_TEMPORARY 0 +# endif +# ifndef MDBA_MDB_ENTRY_INFO +# define MDBA_MDB_ENTRY_INFO 1 +# endif +# ifndef MDBA_MDB_EATTR_TIMER +# define MDBA_MDB_EATTR_TIMER 1 +# endif + +const unsigned int hdrlen = sizeof(struct br_port_msg); + +static void +init_br_port_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + unsigned int len = msg_len; + + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = len, + .nlmsg_type = RTM_GETMDB, + .nlmsg_flags = NLM_F_DUMP + ); + + struct br_port_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct br_port_msg, msg, + .family = AF_UNIX, + .ifindex = ifindex_lo() + ); + + struct nlattr *nla = NLMSG_ATTR(nlh, sizeof(*msg)); + len -= NLMSG_SPACE(hdrlen); + SET_STRUCT(struct nlattr, nla, + .nla_len = len, + .nla_type = MDBA_MDB + ); + + nla = nla + 1; + len -= NLA_HDRLEN; + SET_STRUCT(struct nlattr, nla, + .nla_len = len, + .nla_type = MDBA_MDB_ENTRY + ); +} + +static void +print_br_port_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETMDB, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {family=AF_UNIX" + ", ifindex=" IFINDEX_LO_STR "}" + ", {{nla_len=%u, nla_type=MDBA_MDB}" + ", {{nla_len=%u, nla_type=MDBA_MDB_ENTRY}", + msg_len, msg_len - NLMSG_SPACE(hdrlen), + msg_len - NLMSG_SPACE(hdrlen) - NLA_HDRLEN); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 4 +# ifdef HAVE_STRUCT_BR_MDB_ENTRY + - 4 + NLA_HDRLEN * 2 + sizeof(struct nlattr) + + sizeof(struct br_mdb_entry) +# endif + ); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* MDBA_MDB_ENTRY_??? */", nla_type); + TEST_NLATTR_(fd, nlh0 - NLA_HDRLEN * 2, hdrlen + NLA_HDRLEN * 2, + init_br_port_msg, print_br_port_msg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4); + printf("}}")); + +# ifdef HAVE_STRUCT_BR_MDB_ENTRY + struct br_mdb_entry entry = { + .ifindex = ifindex_lo(), + .state = MDB_TEMPORARY, +# ifdef HAVE_STRUCT_BR_MDB_ENTRY_FLAGS + .flags = MDB_FLAGS_OFFLOAD, +# endif +# ifdef HAVE_STRUCT_BR_MDB_ENTRY_VID + .vid = 0xcdef, +# endif + .addr = { + .proto = htons(AF_UNSPEC) + } + }; + + memcpy(&entry.addr.u, pattern, sizeof(entry.addr.u)); + TEST_NESTED_NLATTR_OBJECT_EX(fd, nlh0, hdrlen, + init_br_port_msg, print_br_port_msg, + MDBA_MDB_ENTRY_INFO, pattern, entry, 2, + printf("{ifindex=" IFINDEX_LO_STR); + printf(", state=MDB_TEMPORARY"); +# ifdef HAVE_STRUCT_BR_MDB_ENTRY_FLAGS + printf(", flags=MDB_FLAGS_OFFLOAD"); +# endif +# ifdef HAVE_STRUCT_BR_MDB_ENTRY_VID + PRINT_FIELD_U(", ", entry, vid); +# endif + printf(", addr={u="); + print_quoted_hex(&entry.addr.u, + sizeof(entry.addr.u)); + printf(", proto=htons(AF_UNSPEC)}}")); + + static const struct nlattr nla = { + .nla_len = sizeof(nla), + .nla_type = MDBA_MDB_EATTR_TIMER + }; + char buf[NLMSG_ALIGN(sizeof(entry)) + sizeof(nla)]; + memcpy(buf, &entry, sizeof(entry)); + memcpy(buf + NLMSG_ALIGN(sizeof(entry)), &nla, sizeof(nla)); + TEST_NLATTR(fd, nlh0 - NLA_HDRLEN * 2, hdrlen + NLA_HDRLEN * 2, + init_br_port_msg, print_br_port_msg, + MDBA_MDB_ENTRY_INFO, sizeof(buf), buf, sizeof(buf), + printf("{ifindex=" IFINDEX_LO_STR); + printf(", state=MDB_TEMPORARY"); +# ifdef HAVE_STRUCT_BR_MDB_ENTRY_FLAGS + printf(", flags=MDB_FLAGS_OFFLOAD"); +# endif +# ifdef HAVE_STRUCT_BR_MDB_ENTRY_VID + PRINT_FIELD_U(", ", entry, vid); +# endif + printf(", addr={u="); + print_quoted_hex(&entry.addr.u, sizeof(entry.addr.u)); + printf(", proto=htons(AF_UNSPEC)}}" + ", {nla_len=%u, nla_type=MDBA_MDB_EATTR_TIMER}}}", + nla.nla_len)); +# endif /* HAVE_STRUCT_BR_MDB_ENTRY */ + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_BR_PORT_MSG") + +#endif diff --git a/tests-m32/nlattr_mdba_mdb_entry.gen.test b/tests-m32/nlattr_mdba_mdb_entry.gen.test new file mode 100755 index 00000000..8d09a033 --- /dev/null +++ b/tests-m32/nlattr_mdba_mdb_entry.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_mdba_mdb_entry +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_mdba_router_port.c b/tests-m32/nlattr_mdba_router_port.c new file mode 100644 index 00000000..7ec9992a --- /dev/null +++ b/tests-m32/nlattr_mdba_router_port.c @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_BR_PORT_MSG + +# include +# include "test_nlattr.h" +# include +# include + +# ifndef MDBA_ROUTER +# define MDBA_ROUTER 2 +# endif +# ifndef MDBA_ROUTER_PORT +# define MDBA_ROUTER_PORT 1 +# endif +# ifndef MDBA_ROUTER_PATTR_TYPE +# define MDBA_ROUTER_PATTR_TYPE 2 +# endif +# ifndef MDB_RTR_TYPE_DISABLED +# define MDB_RTR_TYPE_DISABLED 0 +# endif + +const unsigned int hdrlen = sizeof(struct br_port_msg); + +static void +init_br_port_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETMDB, + .nlmsg_flags = NLM_F_DUMP + ); + + struct br_port_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct br_port_msg, msg, + .family = AF_UNIX, + .ifindex = ifindex_lo() + ); + + struct nlattr *nla = NLMSG_ATTR(nlh, sizeof(*msg)); + SET_STRUCT(struct nlattr, nla, + .nla_len = msg_len - NLMSG_SPACE(hdrlen), + .nla_type = MDBA_ROUTER + ); +} + +static void +print_br_port_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETMDB, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {family=AF_UNIX" + ", ifindex=" IFINDEX_LO_STR "}" + ", {{nla_len=%u, nla_type=MDBA_ROUTER}", + msg_len, msg_len - NLMSG_SPACE(hdrlen)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const uint32_t ifindex = ifindex_lo(); + const uint8_t type = MDB_RTR_TYPE_DISABLED; + static const struct nlattr nla = { + .nla_len = NLA_HDRLEN + sizeof(type), + .nla_type = MDBA_ROUTER_PATTR_TYPE + }; + char buf[NLMSG_ALIGN(ifindex) + NLA_HDRLEN + sizeof(type)]; + + const int fd = create_nl_socket(NETLINK_ROUTE); + + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(buf)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_br_port_msg, print_br_port_msg, + MDBA_ROUTER_PORT, pattern, ifindex, + printf(IFINDEX_LO_STR)); + + memcpy(buf, &ifindex, sizeof(ifindex)); + memcpy(buf + NLMSG_ALIGN(ifindex), &nla, sizeof(nla)); + memcpy(buf + NLMSG_ALIGN(ifindex) + NLA_HDRLEN, &type, sizeof(type)); + TEST_NLATTR(fd, nlh0 - NLA_HDRLEN, hdrlen + NLA_HDRLEN, + init_br_port_msg, print_br_port_msg, + MDBA_ROUTER_PORT, sizeof(buf), buf, sizeof(buf), + printf(IFINDEX_LO_STR + ", {{nla_len=%u, nla_type=MDBA_ROUTER_PATTR_TYPE}" + ", MDB_RTR_TYPE_DISABLED}}", + nla.nla_len)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_BR_PORT_MSG") + +#endif diff --git a/tests-m32/nlattr_mdba_router_port.gen.test b/tests-m32/nlattr_mdba_router_port.gen.test new file mode 100755 index 00000000..97230e84 --- /dev/null +++ b/tests-m32/nlattr_mdba_router_port.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_mdba_router_port +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_ndmsg.c b/tests-m32/nlattr_ndmsg.c new file mode 100644 index 00000000..2dd82ce4 --- /dev/null +++ b/tests-m32/nlattr_ndmsg.c @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include "test_nlattr.h" +#ifdef HAVE_LINUX_NEIGHBOUR_H +# include +#endif +#include + +#define NDA_PORT 6 + +static void +init_ndmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETNEIGH, + .nlmsg_flags = NLM_F_DUMP + ); + + struct ndmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct ndmsg, msg, + .ndm_family = AF_UNIX, + .ndm_ifindex = ifindex_lo(), + .ndm_state = NUD_PERMANENT, + .ndm_flags = NTF_PROXY, + .ndm_type = RTN_UNSPEC + ); +} + +static void +print_ndmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETNEIGH, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {ndm_family=AF_UNIX" + ", ndm_ifindex=" IFINDEX_LO_STR + ", ndm_state=NUD_PERMANENT" + ", ndm_flags=NTF_PROXY" + ", ndm_type=RTN_UNSPEC}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct ndmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(struct nda_cacheinfo)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* NDA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_ndmsg, print_ndmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_ndmsg, print_ndmsg, + NDA_DST, 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + static const struct nda_cacheinfo ci = { + .ndm_confirmed = 0xabcdedad, + .ndm_used = 0xbcdaedad, + .ndm_updated = 0xcdbadeda, + .ndm_refcnt = 0xdeadbeda + }; + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ndmsg, print_ndmsg, + NDA_CACHEINFO, pattern, ci, + PRINT_FIELD_U("{", ci, ndm_confirmed); + PRINT_FIELD_U(", ", ci, ndm_used); + PRINT_FIELD_U(", ", ci, ndm_updated); + PRINT_FIELD_U(", ", ci, ndm_refcnt); + printf("}")); + + const uint16_t port = 0xabcd; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ndmsg, print_ndmsg, + NDA_PORT, pattern, port, + printf("htons(%u)", ntohs(port))); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/nlattr_ndmsg.gen.test b/tests-m32/nlattr_ndmsg.gen.test new file mode 100755 index 00000000..1d2763b0 --- /dev/null +++ b/tests-m32/nlattr_ndmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ndmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_ndtmsg.c b/tests-m32/nlattr_ndtmsg.c new file mode 100644 index 00000000..c41ff40c --- /dev/null +++ b/tests-m32/nlattr_ndtmsg.c @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include "test_nlattr.h" +#ifdef HAVE_LINUX_NEIGHBOUR_H +# include +#endif +#include + +#define NDTA_PARMS 6 +#define NDTPA_IFINDEX 1 + +static void +init_ndtmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETNEIGHTBL, + .nlmsg_flags = NLM_F_DUMP + ); + + struct ndtmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct ndtmsg, msg, + .ndtm_family = AF_NETLINK + ); +} + +static void +print_ndtmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETNEIGHTBL, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {ndtm_family=AF_NETLINK}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct ndtmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 11 * 8); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* NDTA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_ndtmsg, print_ndtmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + +#ifdef HAVE_STRUCT_NDT_CONFIG + static const struct ndt_config ndtc = { + .ndtc_key_len = 0xabcd, + .ndtc_entry_size = 0xbcda, + .ndtc_entries = 0xcdabedad, + .ndtc_last_flush = 0xdebaedba, + .ndtc_last_rand = 0xedadedab, + .ndtc_hash_rnd = 0xfeadedaf, + .ndtc_hash_mask = 0xadbcdead, + .ndtc_hash_chain_gc = 0xbdaedacd, + .ndtc_proxy_qlen = 0xcdeaedab + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ndtmsg, print_ndtmsg, + NDTA_CONFIG, pattern, ndtc, + PRINT_FIELD_U("{", ndtc, ndtc_key_len); + PRINT_FIELD_U(", ", ndtc, ndtc_entry_size); + PRINT_FIELD_U(", ", ndtc, ndtc_entries); + PRINT_FIELD_U(", ", ndtc, ndtc_last_flush); + PRINT_FIELD_U(", ", ndtc, ndtc_last_rand); + PRINT_FIELD_U(", ", ndtc, ndtc_hash_rnd); + PRINT_FIELD_0X(", ", ndtc, ndtc_hash_mask); + PRINT_FIELD_U(", ", ndtc, ndtc_hash_chain_gc); + PRINT_FIELD_U(", ", ndtc, ndtc_proxy_qlen); + printf("}")); +#endif /* HAVE_STRUCT_NDT_CONFIG */ + + static const struct nlattr nla = { + .nla_len = sizeof(nla), + .nla_type = NDTPA_IFINDEX + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ndtmsg, print_ndtmsg, + NDTA_PARMS, pattern, nla, + PRINT_FIELD_U("{", nla, nla_len); + printf(", nla_type=NDTPA_IFINDEX}")); + +#ifdef HAVE_STRUCT_NDT_STATS + static const struct ndt_stats ndtst = { + .ndts_allocs = 0xabcdedabedadedfa, + .ndts_destroys = 0xbcdefabefacdbaad, + .ndts_hash_grows = 0xcdbadefacdcbaede, + .ndts_res_failed = 0xdedbaecfdbcadcfe, + .ndts_lookups = 0xedfafdedbdadedec, + .ndts_hits = 0xfebdeadebcddeade, + .ndts_rcv_probes_mcast = 0xadebfeadecddeafe, + .ndts_rcv_probes_ucast = 0xbcdefeacdadecdfe, + .ndts_periodic_gc_runs = 0xedffeadedeffbecc, + .ndts_forced_gc_runs = 0xfeefefeabedeedcd, +# ifdef HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS + .ndts_table_fulls = 0xadebfefaecdfeade +# endif /* HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS */ + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ndtmsg, print_ndtmsg, + NDTA_STATS, pattern, ndtst, + PRINT_FIELD_U("{", ndtst, ndts_allocs); + PRINT_FIELD_U(", ", ndtst, ndts_destroys); + PRINT_FIELD_U(", ", ndtst, ndts_hash_grows); + PRINT_FIELD_U(", ", ndtst, ndts_res_failed); + PRINT_FIELD_U(", ", ndtst, ndts_lookups); + PRINT_FIELD_U(", ", ndtst, ndts_hits); + PRINT_FIELD_U(", ", ndtst, ndts_rcv_probes_mcast); + PRINT_FIELD_U(", ", ndtst, ndts_rcv_probes_ucast); + PRINT_FIELD_U(", ", ndtst, ndts_periodic_gc_runs); + PRINT_FIELD_U(", ", ndtst, ndts_forced_gc_runs); +# ifdef HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS + PRINT_FIELD_U(", ", ndtst, ndts_table_fulls); +# endif /* HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS */ + printf("}")); +#endif /* HAVE_STRUCT_NDT_STATS */ + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/nlattr_ndtmsg.gen.test b/tests-m32/nlattr_ndtmsg.gen.test new file mode 100755 index 00000000..bf7d122a --- /dev/null +++ b/tests-m32/nlattr_ndtmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ndtmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_netconfmsg.c b/tests-m32/nlattr_netconfmsg.c new file mode 100644 index 00000000..52ded742 --- /dev/null +++ b/tests-m32/nlattr_netconfmsg.c @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_NETCONFMSG + +# include +# include "test_nlattr.h" +# include +# include + +static void +init_netconfmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETNETCONF, + .nlmsg_flags = NLM_F_DUMP + ); + + struct netconfmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct netconfmsg, msg, + .ncm_family = AF_INET + ); +} + +static void +print_netconfmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETNETCONF, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {ncm_family=AF_INET}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + + const unsigned int hdrlen = sizeof(struct netconfmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 4); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* NETCONFA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_netconfmsg, print_netconfmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_NETCONFMSG") + +#endif diff --git a/tests-m32/nlattr_netconfmsg.gen.test b/tests-m32/nlattr_netconfmsg.gen.test new file mode 100755 index 00000000..27f3a66b --- /dev/null +++ b/tests-m32/nlattr_netconfmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_netconfmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_netlink_diag_msg.c b/tests-m32/nlattr_netlink_diag_msg.c new file mode 100644 index 00000000..b5d71a68 --- /dev/null +++ b/tests-m32/nlattr_netlink_diag_msg.c @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include "test_nlattr.h" +#include +#include + +static void +init_netlink_diag_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP + ); + + struct netlink_diag_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct netlink_diag_msg, msg, + .ndiag_family = AF_NETLINK, + .ndiag_type = SOCK_RAW, + .ndiag_protocol = NETLINK_ROUTE, + .ndiag_state = NETLINK_CONNECTED + ); +} + +static void +print_netlink_diag_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {ndiag_family=AF_NETLINK" + ", ndiag_type=SOCK_RAW, ndiag_protocol=NETLINK_ROUTE" + ", ndiag_state=NETLINK_CONNECTED, ndiag_portid=0" + ", ndiag_dst_portid=0, ndiag_dst_group=0, ndiag_ino=0" + ", ndiag_cookie=[0, 0]}", + msg_len); +} + +static void +print_xlong(const unsigned long *p, size_t i) +{ + printf("%#lx", *p); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + static const unsigned long groups[] = { + (unsigned long) 0xdeadbeefbadc0dedULL, + (unsigned long) 0xdeadbeefbadc0dedULL + }; + static const struct netlink_diag_ring ndr = { + .ndr_block_size = 0xfabfabdc, + .ndr_block_nr = 0xabcdabda, + .ndr_frame_size = 0xcbadbafa, + .ndr_frame_nr = 0xdbcafadb + }; + static const uint32_t flags = + NDIAG_FLAG_CB_RUNNING | NDIAG_FLAG_PKTINFO; + + const int fd = create_nl_socket(NETLINK_SOCK_DIAG); + const unsigned int hdrlen = sizeof(struct netlink_diag_msg); + void *const nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + + MAX(sizeof(groups), sizeof(ndr))); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NLATTR_ARRAY(fd, nlh0, hdrlen, + init_netlink_diag_msg, print_netlink_diag_msg, + NETLINK_DIAG_GROUPS, pattern, groups, print_xlong); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_netlink_diag_msg, print_netlink_diag_msg, + NETLINK_DIAG_RX_RING, pattern, ndr, + PRINT_FIELD_U("{", ndr, ndr_block_size); + PRINT_FIELD_U(", ", ndr, ndr_block_nr); + PRINT_FIELD_U(", ", ndr, ndr_frame_size); + PRINT_FIELD_U(", ", ndr, ndr_frame_nr); + printf("}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_netlink_diag_msg, print_netlink_diag_msg, + NETLINK_DIAG_FLAGS, pattern, flags, + printf("NDIAG_FLAG_CB_RUNNING|NDIAG_FLAG_PKTINFO")); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/nlattr_netlink_diag_msg.gen.test b/tests-m32/nlattr_netlink_diag_msg.gen.test new file mode 100755 index 00000000..eacc6df4 --- /dev/null +++ b/tests-m32/nlattr_netlink_diag_msg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_netlink_diag_msg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_nlmsgerr.c b/tests-m32/nlattr_nlmsgerr.c new file mode 100644 index 00000000..75be9e75 --- /dev/null +++ b/tests-m32/nlattr_nlmsgerr.c @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include "test_nlattr.h" + +#define NLMSGERR_ATTR_COOKIE 3 + +static void +init_nlmsgerr(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = NLMSG_ERROR, + .nlmsg_flags = NLM_F_REQUEST | NLM_F_CAPPED + ); + + struct nlmsgerr *const err = NLMSG_DATA(nlh); + SET_STRUCT(struct nlmsgerr, err, + .error = -13, + .msg = { + .nlmsg_len = NLMSG_HDRLEN + 4, + .nlmsg_type = NLMSG_NOOP, + .nlmsg_flags = NLM_F_REQUEST, + } + ); +} + +static void +print_nlmsgerr(const unsigned int msg_len) +{ + printf("{len=%u, type=NLMSG_ERROR" + ", flags=NLM_F_REQUEST|NLM_F_CAPPED" + ", seq=0, pid=0}, {error=-EACCES" + ", msg={len=%u, type=NLMSG_NOOP" + ", flags=NLM_F_REQUEST, seq=0, pid=0}", + msg_len, NLMSG_HDRLEN + 4); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + static const uint8_t cookie[] = { 0xab, 0xfe }; + + const int fd = create_nl_socket(NETLINK_SOCK_DIAG); + const unsigned int hdrlen = sizeof(struct nlmsgerr); + void *const nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(cookie)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_nlmsgerr, print_nlmsgerr, + NLMSGERR_ATTR_COOKIE, + sizeof(cookie), cookie, sizeof(cookie), + printf("[%u, %u]", cookie[0], cookie[1]); + printf("}")); + + printf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests-m32/nlattr_nlmsgerr.gen.test b/tests-m32/nlattr_nlmsgerr.gen.test new file mode 100755 index 00000000..f06ea429 --- /dev/null +++ b/tests-m32/nlattr_nlmsgerr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_nlmsgerr +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_packet_diag_msg.c b/tests-m32/nlattr_packet_diag_msg.c new file mode 100644 index 00000000..0d74a2f3 --- /dev/null +++ b/tests-m32/nlattr_packet_diag_msg.c @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include "test_nlattr.h" +#include +#include +#include +#include +#include + +static void +init_packet_diag_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP + ); + + struct packet_diag_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct packet_diag_msg, msg, + .pdiag_family = AF_PACKET, + .pdiag_type = SOCK_STREAM, + .pdiag_num = 3, + ); +} + +static void +print_packet_diag_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}" + ", {pdiag_family=AF_PACKET" + ", pdiag_type=SOCK_STREAM, pdiag_num=ETH_P_ALL" + ", pdiag_ino=0, pdiag_cookie=[0, 0]}", + msg_len); +} + +static void +print_packet_diag_mclist(const struct packet_diag_mclist *const dml, size_t i) +{ + printf("{pdmc_index=" IFINDEX_LO_STR); + PRINT_FIELD_U(", ", *dml, pdmc_count); + PRINT_FIELD_U(", ", *dml, pdmc_type); + PRINT_FIELD_U(", ", *dml, pdmc_alen); + printf(", pdmc_addr="); + print_quoted_hex(dml->pdmc_addr, dml->pdmc_alen); + printf("}"); +} + +static const struct sock_filter filter[] = { + BPF_STMT(BPF_LD|BPF_B|BPF_ABS, SKF_AD_OFF+SKF_AD_PKTTYPE), + BPF_STMT(BPF_RET|BPF_K, 0x2a) +}; + +static void +print_sock_filter(const struct sock_filter *const f, size_t i) +{ + if (f == filter) + printf("BPF_STMT(BPF_LD|BPF_B|BPF_ABS" + ", SKF_AD_OFF+SKF_AD_PKTTYPE)"); + else + printf("BPF_STMT(BPF_RET|BPF_K, 0x2a)"); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + struct packet_diag_info pinfo = { + .pdi_index = ifindex_lo(), + .pdi_version = 2, + .pdi_reserve = 0xcfaacdaf, + .pdi_copy_thresh = 0xdabacdaf, + .pdi_tstamp = 0xeafbaadf, + .pdi_flags = PDI_RUNNING + }; + const struct packet_diag_mclist dml[] = { + { + .pdmc_index = ifindex_lo(), + .pdmc_count = 0xabcdaefc, + .pdmc_type = 0xcdaf, + .pdmc_alen = 4, + .pdmc_addr = "1234" + }, + { + .pdmc_index = ifindex_lo(), + .pdmc_count = 0xdaefeafc, + .pdmc_type = 0xadef, + .pdmc_alen = 4, + .pdmc_addr = "5678" + } + }; + static const struct packet_diag_ring pdr = { + .pdr_block_size = 0xabcdafed, + .pdr_block_nr = 0xbcadefae, + .pdr_frame_size = 0xcabdfeac, + .pdr_frame_nr = 0xdeaeadef, + .pdr_retire_tmo = 0xedbafeac, + .pdr_sizeof_priv = 0xfeadeacd, + .pdr_features = 0xadebadea + }; + + int fd = create_nl_socket(NETLINK_SOCK_DIAG); + const unsigned int hdrlen = sizeof(struct packet_diag_msg); + void *const nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(dml)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_packet_diag_msg, print_packet_diag_msg, + PACKET_DIAG_INFO, pattern, pinfo, + printf("{pdi_index=%s", IFINDEX_LO_STR); + printf(", pdi_version=TPACKET_V3"); + PRINT_FIELD_U(", ", pinfo, pdi_reserve); + PRINT_FIELD_U(", ", pinfo, pdi_copy_thresh); + PRINT_FIELD_U(", ", pinfo, pdi_tstamp); + printf(", pdi_flags=PDI_RUNNING}")); + + TEST_NLATTR_ARRAY(fd, nlh0, hdrlen, + init_packet_diag_msg, print_packet_diag_msg, + PACKET_DIAG_MCLIST, pattern, dml, + print_packet_diag_mclist); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_packet_diag_msg, print_packet_diag_msg, + PACKET_DIAG_RX_RING, pattern, pdr, + PRINT_FIELD_U("{", pdr, pdr_block_size); + PRINT_FIELD_U(", ", pdr, pdr_block_nr); + PRINT_FIELD_U(", ", pdr, pdr_frame_size); + PRINT_FIELD_U(", ", pdr, pdr_frame_nr); + PRINT_FIELD_U(", ", pdr, pdr_retire_tmo); + PRINT_FIELD_U(", ", pdr, pdr_sizeof_priv); + PRINT_FIELD_U(", ", pdr, pdr_features); + printf("}")); + + TEST_NLATTR_ARRAY(fd, nlh0, hdrlen, + init_packet_diag_msg, print_packet_diag_msg, + PACKET_DIAG_FILTER, pattern, filter, + print_sock_filter); + + printf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests-m32/nlattr_packet_diag_msg.gen.test b/tests-m32/nlattr_packet_diag_msg.gen.test new file mode 100755 index 00000000..7177ea2a --- /dev/null +++ b/tests-m32/nlattr_packet_diag_msg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_packet_diag_msg +netlink_sock_diag-v.sh ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag-v.sh" diff --git a/tests-m32/nlattr_rtgenmsg.c b/tests-m32/nlattr_rtgenmsg.c new file mode 100644 index 00000000..c17ab048 --- /dev/null +++ b/tests-m32/nlattr_rtgenmsg.c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include "netlink.h" +#include + +#ifdef RTM_GETNSID + +# include "test_nlattr.h" + +static void +init_rtgenmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETNSID, + .nlmsg_flags = NLM_F_DUMP + ); + + struct rtgenmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct rtgenmsg, msg, + .rtgen_family = AF_UNIX + ); +} + +static void +print_rtgenmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETNSID, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {rtgen_family=AF_UNIX}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct rtgenmsg); + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(nla_type_str)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + sprintf(nla_type_str, "%#x /* NETNSA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_rtgenmsg, print_rtgenmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("RTM_GETNSID") + +#endif diff --git a/tests-m32/nlattr_rtgenmsg.gen.test b/tests-m32/nlattr_rtgenmsg.gen.test new file mode 100755 index 00000000..37ec8425 --- /dev/null +++ b/tests-m32/nlattr_rtgenmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_rtgenmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_rtmsg.c b/tests-m32/nlattr_rtmsg.c new file mode 100644 index 00000000..f4efa4c0 --- /dev/null +++ b/tests-m32/nlattr_rtmsg.c @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include "test_nlattr.h" +#include +#include + +#define RTA_ENCAP_TYPE 21 +#define LWTUNNEL_ENCAP_NONE 0 + +static void +init_rtmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETROUTE, + .nlmsg_flags = NLM_F_DUMP + ); + + struct rtmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct rtmsg, msg, + .rtm_family = AF_UNIX, + .rtm_tos = IPTOS_LOWDELAY, + .rtm_table = RT_TABLE_DEFAULT, + .rtm_protocol = RTPROT_KERNEL, + .rtm_scope = RT_SCOPE_UNIVERSE, + .rtm_type = RTN_LOCAL, + .rtm_flags = RTM_F_NOTIFY + ); +} + +static void +print_rtmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETROUTE, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {rtm_family=AF_UNIX" + ", rtm_dst_len=0, rtm_src_len=0" + ", rtm_tos=IPTOS_LOWDELAY" + ", rtm_table=RT_TABLE_DEFAULT" + ", rtm_protocol=RTPROT_KERNEL" + ", rtm_scope=RT_SCOPE_UNIVERSE" + ", rtm_type=RTN_LOCAL" + ", rtm_flags=RTM_F_NOTIFY}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct rtmsg); + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(nla_type_str)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + sprintf(nla_type_str, "%#x /* RTA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_DST, 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + const uint32_t ifindex = ifindex_lo(); + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_OIF, pattern, ifindex, + printf(IFINDEX_LO_STR)); + + const uint32_t rt_class_id = RT_TABLE_DEFAULT; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_TABLE, pattern, rt_class_id, + printf("RT_TABLE_DEFAULT")); + + struct nlattr nla = { + .nla_type = RTAX_LOCK, + .nla_len = sizeof(nla) + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_METRICS, pattern, nla, + printf("{nla_len=%u, nla_type=RTAX_LOCK}", + nla.nla_len)); + struct rtnexthop nh = { + .rtnh_len = sizeof(nh) - 1, + .rtnh_flags = RTNH_F_DEAD, + .rtnh_hops = 0xab, + .rtnh_ifindex = ifindex_lo() + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_MULTIPATH, pattern, nh, + printf("{rtnh_len=%u, rtnh_flags=RTNH_F_DEAD" + ", rtnh_hops=%u" + ", rtnh_ifindex=" IFINDEX_LO_STR "}", + nh.rtnh_len, nh.rtnh_hops)); + + char buf[RTNH_ALIGN(sizeof(nh)) + sizeof(nla)]; + nh.rtnh_len = sizeof(buf); + nla.nla_type = RTA_DST; + memcpy(buf, &nh, sizeof(nh)); + memcpy(buf + RTNH_ALIGN(sizeof(nh)), &nla, sizeof(nla)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_MULTIPATH, sizeof(buf), buf, sizeof(buf), + printf("{rtnh_len=%u, rtnh_flags=RTNH_F_DEAD" + ", rtnh_hops=%u, rtnh_ifindex=" IFINDEX_LO_STR "}" + ", {nla_len=%u, nla_type=RTA_DST}", + nh.rtnh_len, nh.rtnh_hops, nla.nla_len)); + + static const struct rta_cacheinfo ci = { + .rta_clntref = 0xabcdefab, + .rta_lastuse = 0xbdadaedc, + .rta_expires = 0xcdadebad, + .rta_error = 0xdaedadeb, + .rta_used = 0xedfabdad, + .rta_id = 0xfeadbcda, + .rta_ts = 0xacdbaded, + .rta_tsage = 0xbadeadef + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_CACHEINFO, pattern, ci, + PRINT_FIELD_U("{", ci, rta_clntref); + PRINT_FIELD_U(", ", ci, rta_lastuse); + PRINT_FIELD_U(", ", ci, rta_expires); + PRINT_FIELD_U(", ", ci, rta_error); + PRINT_FIELD_U(", ", ci, rta_used); + PRINT_FIELD_X(", ", ci, rta_id); + PRINT_FIELD_U(", ", ci, rta_ts); + PRINT_FIELD_U(", ", ci, rta_tsage); + printf("}")); + +#ifdef HAVE_STRUCT_RTA_MFC_STATS + static const struct rta_mfc_stats mfcs = { + .mfcs_packets = 0xadcdedfdadefadcd, + .mfcs_bytes = 0xbaedadedcdedadbd, + .mfcs_wrong_if = 0xcddeabeedaedabfa + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_MFC_STATS, pattern, mfcs, + PRINT_FIELD_U("{", mfcs, mfcs_packets); + PRINT_FIELD_U(", ", mfcs, mfcs_bytes); + PRINT_FIELD_U(", ", mfcs, mfcs_wrong_if); + printf("}")); +#endif + +#ifdef HAVE_STRUCT_RTVIA + static const struct rtvia via = { + .rtvia_family = AF_INET + }; + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_VIA, pattern, via, + printf("{rtvia_family=AF_INET}")); + + static const char address4[] = "12.34.56.78"; + struct in_addr a4 = { + .s_addr = inet_addr(address4) + }; + char rtviabuf[sizeof(via) + sizeof(a4)]; + memcpy(rtviabuf, &via, sizeof(via)); + memcpy(rtviabuf + sizeof(via), &a4, sizeof(a4)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_VIA, sizeof(rtviabuf), rtviabuf, sizeof(rtviabuf), + printf("{rtvia_family=AF_INET" + ", rtvia_addr=inet_addr(\"%s\")}", address4)); +#endif + + const uint16_t encap_type = LWTUNNEL_ENCAP_NONE; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_ENCAP_TYPE, pattern, encap_type, + printf("LWTUNNEL_ENCAP_NONE")); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/nlattr_rtmsg.gen.test b/tests-m32/nlattr_rtmsg.gen.test new file mode 100755 index 00000000..f075529a --- /dev/null +++ b/tests-m32/nlattr_rtmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_rtmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_smc_diag_msg.c b/tests-m32/nlattr_smc_diag_msg.c new file mode 100644 index 00000000..3f47a515 --- /dev/null +++ b/tests-m32/nlattr_smc_diag_msg.c @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifndef AF_SMC +# define AF_SMC 43 +#endif + +#include +#include +#include +#include +#include "test_nlattr.h" +#include +#include +#include + +#ifndef SMC_CLNT +# define SMC_CLNT 0 +#endif +#ifndef SMC_ACTIVE +# define SMC_ACTIVE 1 +#endif + +static const char address[] = "12.34.56.78"; + +static void +init_smc_diag_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP + ); + + struct smc_diag_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct smc_diag_msg, msg, + .diag_family = AF_SMC, + .diag_state = SMC_ACTIVE + ); + + if (!inet_pton(AF_INET, address, msg->id.idiag_src) || + !inet_pton(AF_INET, address, msg->id.idiag_dst)) + perror_msg_and_skip("inet_pton"); +} + +static void +print_smc_diag_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}" + ", {diag_family=AF_SMC, diag_state=SMC_ACTIVE" + ", diag_fallback=SMC_DIAG_MODE_SMCR, diag_shutdown=0" + ", id={idiag_sport=htons(0), idiag_dport=htons(0)" + ", idiag_src=inet_addr(\"%s\")" + ", idiag_dst=inet_addr(\"%s\")" + ", idiag_if=0, idiag_cookie=[0, 0]}" + ", diag_uid=0, diag_inode=0}", + msg_len, address, address); +} + +#define PRINT_FIELD_SMC_DIAG_CURSOR(prefix_, where_, field_) \ + do { \ + printf("%s%s=", (prefix_), #field_); \ + PRINT_FIELD_U("{", (where_).field_, reserved); \ + PRINT_FIELD_U(", ", (where_).field_, wrap); \ + PRINT_FIELD_U(", ", (where_).field_, count); \ + printf("}"); \ + } while (0) + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + static const struct smc_diag_conninfo cinfo = { + .token = 0xabcdefac, + .sndbuf_size = 0xbcdaefad, + .rmbe_size = 0xcdbaefab, + .peer_rmbe_size = 0xdbcdedaf, + .rx_prod = { + .reserved = 0xabc1, + .wrap = 0xbca1, + .count = 0xcdedbad1 + }, + .rx_cons = { + .reserved = 0xabc2, + .wrap = 0xbca2, + .count = 0xcdedbad2 + }, + .tx_prod = { + .reserved = 0xabc3, + .wrap = 0xbca3, + .count = 0xcdedbad3 + }, + .tx_cons = { + .reserved = 0xabc4, + .wrap = 0xbca4, + .count = 0xcdedbad4 + }, + .rx_prod_flags = 0xff, + .rx_conn_state_flags = 0xff, + .tx_prod_flags = 0xff, + .tx_conn_state_flags = 0xff, + .tx_prep = { + .reserved = 0xabc5, + .wrap = 0xbca5, + .count = 0xcdedbad5 + }, + .tx_sent = { + .reserved = 0xabc6, + .wrap = 0xbca6, + .count = 0xcdedbad6 + }, + .tx_fin = { + .reserved = 0xabc7, + .wrap = 0xbca7, + .count = 0xcdedbad7 + } + }; + static const struct smc_diag_lgrinfo linfo = { + .lnk[0] = { + .link_id = 0xaf, + .ibport = 0xfa, + .ibname = "123", + .gid = "456", + .peer_gid = "789" + }, + .role = SMC_CLNT + }; + static const struct smcd_diag_dmbinfo dinfo = { + .linkid = 0xdeadc0de, + .peer_gid = 0xbefeededbadc0dedULL, + .my_gid = 0xdeec0dedfacebeefULL, + .token = 0xcafedecaffeedeedULL, + .peer_token = 0xfeedfacebeeff00dULL, + }; + static const struct smc_diag_fallback fb1 = { + .reason = 0, + .peer_diagnosis = 0x03020000, + }; + static const struct smc_diag_fallback fb2 = { + .reason = 0x03060000, + .peer_diagnosis = 0x99999999, + }; + static uint8_t sd1 = 0x23; + static uint8_t sd2 = 0x40; + + int fd = create_nl_socket(NETLINK_SOCK_DIAG); + const unsigned int hdrlen = sizeof(struct smc_diag_msg); + void *const nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + + MAX(sizeof(cinfo), sizeof(linfo))); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_smc_diag_msg, print_smc_diag_msg, + SMC_DIAG_SHUTDOWN, pattern, sd1, + printf("RCV_SHUTDOWN|SEND_SHUTDOWN|0x20")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_smc_diag_msg, print_smc_diag_msg, + SMC_DIAG_SHUTDOWN, pattern, sd2, + printf("0x40 /* ???_SHUTDOWN */")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_smc_diag_msg, print_smc_diag_msg, + SMC_DIAG_CONNINFO, pattern, cinfo, + PRINT_FIELD_U("{", cinfo, token); + PRINT_FIELD_U(", ", cinfo, sndbuf_size); + PRINT_FIELD_U(", ", cinfo, rmbe_size); + PRINT_FIELD_U(", ", cinfo, peer_rmbe_size); + PRINT_FIELD_SMC_DIAG_CURSOR(", ", cinfo, rx_prod); + PRINT_FIELD_SMC_DIAG_CURSOR(", ", cinfo, rx_cons); + PRINT_FIELD_SMC_DIAG_CURSOR(", ", cinfo, tx_prod); + PRINT_FIELD_SMC_DIAG_CURSOR(", ", cinfo, tx_cons); + printf(", rx_prod_flags=0xff"); + printf(", rx_conn_state_flags=0xff"); + printf(", tx_prod_flags=0xff"); + printf(", tx_conn_state_flags=0xff"); + PRINT_FIELD_SMC_DIAG_CURSOR(", ", cinfo, tx_prep); + PRINT_FIELD_SMC_DIAG_CURSOR(", ", cinfo, tx_sent); + PRINT_FIELD_SMC_DIAG_CURSOR(", ", cinfo, tx_fin); + printf("}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_smc_diag_msg, print_smc_diag_msg, + SMC_DIAG_LGRINFO, pattern, linfo, + PRINT_FIELD_U("{lnk[0]={", linfo.lnk[0], link_id); + printf(", ibname=\"%s\"", linfo.lnk[0].ibname); + PRINT_FIELD_U(", ", linfo.lnk[0], ibport); + printf(", gid=\"%s\"", linfo.lnk[0].gid); + printf(", peer_gid=\"%s\"}", linfo.lnk[0].peer_gid); + printf(", role=SMC_CLNT}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_smc_diag_msg, print_smc_diag_msg, + SMC_DIAG_DMBINFO, pattern, dinfo, + PRINT_FIELD_U("{", dinfo, linkid); + PRINT_FIELD_X(", ", dinfo, peer_gid); + PRINT_FIELD_X(", ", dinfo, my_gid); + PRINT_FIELD_X(", ", dinfo, token); + PRINT_FIELD_X(", ", dinfo, peer_token); + printf("}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_smc_diag_msg, print_smc_diag_msg, + SMC_DIAG_FALLBACK, pattern, fb1, + printf("{reason=0 /* SMC_CLC_DECL_??? */"); + printf(", peer_diagnosis=0x3020000" + " /* SMC_CLC_DECL_IPSEC */}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_smc_diag_msg, print_smc_diag_msg, + SMC_DIAG_FALLBACK, pattern, fb2, + printf("{reason=0x3060000" + " /* SMC_CLC_DECL_OPTUNSUPP */"); + printf(", peer_diagnosis=0x99999999" + " /* SMC_CLC_DECL_??? */}")); + + printf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests-m32/nlattr_smc_diag_msg.gen.test b/tests-m32/nlattr_smc_diag_msg.gen.test new file mode 100755 index 00000000..e64d21e2 --- /dev/null +++ b/tests-m32/nlattr_smc_diag_msg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_smc_diag_msg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_tc_stats.c b/tests-m32/nlattr_tc_stats.c new file mode 100644 index 00000000..c0ebaf89 --- /dev/null +++ b/tests-m32/nlattr_tc_stats.c @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_GNET_STATS_BASIC + +# include +# include +# include "test_nlattr.h" +# include +# include + +const unsigned int hdrlen = sizeof(struct tcmsg); + +static void +init_tcmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETQDISC, + .nlmsg_flags = NLM_F_DUMP + ); + + struct tcmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct tcmsg, msg, + .tcm_family = AF_UNIX, + .tcm_ifindex = ifindex_lo() + ); + + struct nlattr *const nla = NLMSG_ATTR(nlh, sizeof(*msg)); + SET_STRUCT(struct nlattr, nla, + .nla_len = msg_len - NLMSG_SPACE(hdrlen), + .nla_type = TCA_STATS2 + ); +} + +static void +print_tcmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETQDISC, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {tcm_family=AF_UNIX" + ", tcm_ifindex=" IFINDEX_LO_STR + ", tcm_handle=0, tcm_parent=0, tcm_info=0}" + ", {{nla_len=%u, nla_type=TCA_STATS2}", + msg_len, msg_len - NLMSG_SPACE(hdrlen)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 8 * 5); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + static const struct gnet_stats_basic sb = { + .bytes = 0xabcdebdafefeadeb, + .packets = 0xbdcdeabf + }; + char buf[offsetofend(struct gnet_stats_basic, packets)]; + memcpy(buf, &sb, sizeof(buf)); + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_STATS_BASIC, pattern, buf, + PRINT_FIELD_U("{", sb, bytes); + PRINT_FIELD_U(", ", sb, packets); + printf("}")); + +# ifdef HAVE_STRUCT_GNET_STATS_RATE_EST + static const struct gnet_stats_rate_est est = { + .bps = 0xebcdaebd, + .pps = 0xabdceade, + }; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_STATS_RATE_EST, pattern, est, + PRINT_FIELD_U("{", est, bps); + PRINT_FIELD_U(", ", est, pps); + printf("}")); +# endif + +# ifdef HAVE_STRUCT_GNET_STATS_QUEUE + static const struct gnet_stats_queue qstats = { + .qlen = 0xabcdeabd, + .backlog = 0xbcdaebad, + .drops = 0xcdbeaedb, + .requeues = 0xdebaefab, + .overlimits = 0xefaebade + }; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_STATS_QUEUE, pattern, qstats, + PRINT_FIELD_U("{", qstats, qlen); + PRINT_FIELD_U(", ", qstats, backlog); + PRINT_FIELD_U(", ", qstats, drops); + PRINT_FIELD_U(", ", qstats, requeues); + PRINT_FIELD_U(", ", qstats, overlimits); + printf("}")); +# endif + +# ifdef HAVE_STRUCT_GNET_STATS_RATE_EST64 + static const struct gnet_stats_rate_est64 est64 = { + .bps = 0xacbdcdefafecaebf, + .pps = 0xcdabeabdfeabceaf + }; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_STATS_RATE_EST64, pattern, est64, + PRINT_FIELD_U("{", est64, bps); + PRINT_FIELD_U(", ", est64, pps); + printf("}")); +# endif + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_GNET_STATS_BASIC") + +#endif diff --git a/tests-m32/nlattr_tc_stats.gen.test b/tests-m32/nlattr_tc_stats.gen.test new file mode 100755 index 00000000..11cadd2d --- /dev/null +++ b/tests-m32/nlattr_tc_stats.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_tc_stats +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_tca_stab.c b/tests-m32/nlattr_tca_stab.c new file mode 100644 index 00000000..d339dbc8 --- /dev/null +++ b/tests-m32/nlattr_tca_stab.c @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include "test_nlattr.h" +#include +#include + +#ifndef TCA_STAB +# define TCA_STAB 8 +#endif +#if !HAVE_DECL_TCA_STAB_DATA +enum { TCA_STAB_DATA = 2 }; +#endif + +const unsigned int hdrlen = sizeof(struct tcmsg); + +static void +init_tcmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETQDISC, + .nlmsg_flags = NLM_F_DUMP + ); + + struct tcmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct tcmsg, msg, + .tcm_family = AF_UNIX, + .tcm_ifindex = ifindex_lo() + ); + + struct nlattr *const nla = NLMSG_ATTR(nlh, sizeof(*msg)); + SET_STRUCT(struct nlattr, nla, + .nla_len = msg_len - NLMSG_SPACE(hdrlen), + .nla_type = TCA_STAB + ); +} + +static void +print_tcmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETQDISC, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {tcm_family=AF_UNIX" + ", tcm_ifindex=" IFINDEX_LO_STR + ", tcm_handle=0, tcm_parent=0, tcm_info=0}" + ", {{nla_len=%u, nla_type=TCA_STAB}", + msg_len, msg_len - NLMSG_SPACE(hdrlen)); +} + +static void +print_uint16(const uint16_t *p, size_t idx) +{ + printf("%u", *p); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 4 +#ifdef HAVE_STRUCT_TC_SIZESPEC + - 4 + sizeof(struct tc_sizespec) +#endif + ); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + +#ifdef HAVE_STRUCT_TC_SIZESPEC + static const struct tc_sizespec s = { + .cell_log = 0xab, + .size_log = 0xcd, + .cell_align = 0xefab, + .overhead = 0xcdadeefa, + .linklayer = 0xefbaafeb, + .mpu = 0xfebfaefb, + .mtu = 0xacdbefab, + .tsize = 0xbdeaabed + }; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_STAB_BASE, pattern, s, + PRINT_FIELD_U("{", s, cell_log); + PRINT_FIELD_U(", ", s, size_log); + PRINT_FIELD_D(", ", s, cell_align); + PRINT_FIELD_D(", ", s, overhead); + PRINT_FIELD_U(", ", s, linklayer); + PRINT_FIELD_U(", ", s, mpu); + PRINT_FIELD_U(", ", s, mtu); + PRINT_FIELD_U(", ", s, tsize); + printf("}")); +#endif + + uint16_t data[2] = { 0xacbd, 0xefba }; + TEST_NESTED_NLATTR_ARRAY(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_STAB_DATA, pattern, data, print_uint16); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/nlattr_tca_stab.gen.test b/tests-m32/nlattr_tca_stab.gen.test new file mode 100755 index 00000000..81d36c70 --- /dev/null +++ b/tests-m32/nlattr_tca_stab.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_tca_stab +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_tcamsg.c b/tests-m32/nlattr_tcamsg.c new file mode 100644 index 00000000..b8bd7e35 --- /dev/null +++ b/tests-m32/nlattr_tcamsg.c @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include "test_nlattr.h" +#include + +static void +init_tcamsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETACTION, + .nlmsg_flags = NLM_F_DUMP + ); + + struct tcamsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct tcamsg, msg, + .tca_family = AF_INET + ); +} + +static void +print_tcamsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETACTION, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {tca_family=AF_INET}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct tcamsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 4); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* TCA_ACT_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_tcamsg, print_tcamsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/nlattr_tcamsg.gen.test b/tests-m32/nlattr_tcamsg.gen.test new file mode 100755 index 00000000..1a6408d9 --- /dev/null +++ b/tests-m32/nlattr_tcamsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_tcamsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_tcmsg.c b/tests-m32/nlattr_tcmsg.c new file mode 100644 index 00000000..f76b2f87 --- /dev/null +++ b/tests-m32/nlattr_tcmsg.c @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include "test_nlattr.h" +#include +#include + +static void +init_tcmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETQDISC, + .nlmsg_flags = NLM_F_DUMP + ); + + struct tcmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct tcmsg, msg, + .tcm_family = AF_UNIX, + .tcm_ifindex = ifindex_lo() + ); + +} + +static void +print_tcmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETQDISC, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {tcm_family=AF_UNIX" + ", tcm_ifindex=" IFINDEX_LO_STR + ", tcm_handle=0, tcm_parent=0, tcm_info=0}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct tcmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(struct tc_stats)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* TCA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + static const struct tc_stats st = { + .bytes = 0xabcdcdbefeadefac, + .packets = 0xbcdeaefd, + .drops = 0xcdedafed, + .overlimits = 0xdcdbefad, + .bps = 0xefaebfad, + .pps = 0xfefbaedb, + .qlen = 0xabcdefab, + .backlog = 0xbdeabeab + }; + char buf[offsetofend(struct tc_stats, backlog)]; + memcpy(buf, &st, sizeof(buf)); + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_STATS, pattern, buf, + PRINT_FIELD_U("{", st, bytes); + PRINT_FIELD_U(", ", st, packets); + PRINT_FIELD_U(", ", st, drops); + PRINT_FIELD_U(", ", st, overlimits); + PRINT_FIELD_U(", ", st, bps); + PRINT_FIELD_U(", ", st, pps); + PRINT_FIELD_U(", ", st, qlen); + PRINT_FIELD_U(", ", st, backlog); + printf("}")); + + static const struct tc_estimator est = { + .interval = 0xcd, + .ewma_log = 0xab + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_RATE, pattern, est, + PRINT_FIELD_D("{", est, interval); + PRINT_FIELD_U(", ", est, ewma_log); + printf("}")); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/nlattr_tcmsg.gen.test b/tests-m32/nlattr_tcmsg.gen.test new file mode 100755 index 00000000..7e70ca26 --- /dev/null +++ b/tests-m32/nlattr_tcmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_tcmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nlattr_unix_diag_msg.c b/tests-m32/nlattr_unix_diag_msg.c new file mode 100644 index 00000000..4d964eab --- /dev/null +++ b/tests-m32/nlattr_unix_diag_msg.c @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include "test_nlattr.h" +#include +#include + +static void +init_unix_diag_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP + ); + + struct unix_diag_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct unix_diag_msg, msg, + .udiag_family = AF_UNIX, + .udiag_type = SOCK_STREAM, + .udiag_state = TCP_ESTABLISHED + ); +} + +static void +print_unix_diag_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_ESTABLISHED" + ", udiag_ino=0, udiag_cookie=[0, 0]}", + msg_len); +} + +static void +print_uint(const unsigned int *p, size_t i) +{ + printf("%u", *p); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + static const struct unix_diag_vfs uv = { + .udiag_vfs_dev = 0xabcddafa, + .udiag_vfs_ino = 0xbafabcda + }; + static const struct unix_diag_rqlen rql = { + .udiag_rqueue = 0xfabdcdad, + .udiag_wqueue = 0xbacdadcf + }; + static const uint32_t inode[] = { 0xadbcadbc, 0xfabdcdac }; + + const int fd = create_nl_socket(NETLINK_SOCK_DIAG); + const unsigned int hdrlen = sizeof(struct unix_diag_msg); + void *const nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(inode)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_unix_diag_msg, print_unix_diag_msg, + UNIX_DIAG_VFS, pattern, uv, + printf("{udiag_vfs_dev=makedev(%#x, %#x)", + major(uv.udiag_vfs_dev), + minor(uv.udiag_vfs_dev)); + PRINT_FIELD_U(", ", uv, udiag_vfs_ino); + printf("}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_unix_diag_msg, print_unix_diag_msg, + UNIX_DIAG_RQLEN, pattern, rql, + PRINT_FIELD_U("{", rql, udiag_rqueue); + PRINT_FIELD_U(", ", rql, udiag_wqueue); + printf("}")); + + TEST_NLATTR_ARRAY(fd, nlh0, hdrlen, + init_unix_diag_msg, print_unix_diag_msg, + UNIX_DIAG_ICONS, pattern, inode, print_uint); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/nlattr_unix_diag_msg.gen.test b/tests-m32/nlattr_unix_diag_msg.gen.test new file mode 100755 index 00000000..fd5b8286 --- /dev/null +++ b/tests-m32/nlattr_unix_diag_msg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_unix_diag_msg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-m32/nsyscalls-d.c b/tests-m32/nsyscalls-d.c new file mode 100644 index 00000000..1525dea0 --- /dev/null +++ b/tests-m32/nsyscalls-d.c @@ -0,0 +1,2 @@ +#define DEBUG_PRINT 1 +#include "nsyscalls.c" diff --git a/tests-m32/nsyscalls-d.test b/tests-m32/nsyscalls-d.test new file mode 100755 index 00000000..a6495b6b --- /dev/null +++ b/tests-m32/nsyscalls-d.test @@ -0,0 +1,31 @@ +#!/bin/sh +# +# Check decoding of out-of-range syscalls along with debug ouput +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +: ${debug_flag=-d} +NAME=nsyscalls-d + +if [ "$MIPS_ABI" = "o32" ]; then + syscall=syscall + [ -z "$debug_flag" ] || + skip_ "mips $MIPS_ABI is not supported by this test yet" +else + syscall=none +fi + +run_strace $debug_flag -e trace=$syscall ../$NAME "$STRACE_EXE" 9 \ + 2> "$LOG-err-all" > "$EXP" 9> "$EXP-err" + +[ -n "$debug_flag" ] || > "$EXP-err" + +grep "invalid syscall" "$LOG-err-all" > "$LOG-err" + +match_diff "$LOG" "$EXP" +match_diff "$LOG-err" "$EXP-err" diff --git a/tests-m32/nsyscalls-nd.test b/tests-m32/nsyscalls-nd.test new file mode 100755 index 00000000..f578f9aa --- /dev/null +++ b/tests-m32/nsyscalls-nd.test @@ -0,0 +1,9 @@ +#!/bin/sh +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +debug_flag= +. "${srcdir=.}"/nsyscalls-d.test diff --git a/tests-m32/nsyscalls.c b/tests-m32/nsyscalls.c index aecf7aa7..529f50ee 100644 --- a/tests-m32/nsyscalls.c +++ b/tests-m32/nsyscalls.c @@ -2,56 +2,32 @@ * Check decoding of out-of-range syscalls. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include "sysent.h" #include #include +#include #include #include -#define TD 0 -#define TF 0 -#define TI 0 -#define TN 0 -#define TP 0 -#define TS 0 -#define TM 0 -#define NF 0 -#define MA 0 -#define SI 0 -#define SE 0 -#define CST 0 -#define SEN(arg) 0,0 +#include "sysent_shorthand_defs.h" static const struct_sysent syscallent[] = { #include "syscallent.h" }; +#include "sysent_shorthand_undefs.h" + +#ifndef DEBUG_PRINT +# define DEBUG_PRINT 0 +#endif + #if defined __X32_SYSCALL_BIT && defined __NR_read \ && (__X32_SYSCALL_BIT & __NR_read) != 0 # define SYSCALL_BIT __X32_SYSCALL_BIT @@ -59,6 +35,11 @@ static const struct_sysent syscallent[] = { # define SYSCALL_BIT 0 #endif +#if DEBUG_PRINT +static const char *strace_name; +static FILE *debug_out; +#endif + static void test_syscall(const unsigned long nr) { @@ -73,27 +54,52 @@ test_syscall(const unsigned long nr) long rc = syscall(nr | SYSCALL_BIT, a[0], a[1], a[2], a[3], a[4], a[5]); + +#if DEBUG_PRINT + fprintf(debug_out, "%s: pid %d invalid syscall %#lx\n", + strace_name, getpid(), nr | SYSCALL_BIT); +#endif + #ifdef LINUX_MIPSO32 printf("syscall(%#lx, %#lx, %#lx, %#lx, %#lx, %#lx, %#lx)" - " = %ld ENOSYS (%m)\n", nr | SYSCALL_BIT, - a[0], a[1], a[2], a[3], a[4], a[5], rc); + " = %s\n", nr | SYSCALL_BIT, + a[0], a[1], a[2], a[3], a[4], a[5], sprintrc(rc)); #else - printf("syscall_%lu(%#llx, %#llx, %#llx, %#llx, %#llx, %#llx)" - " = %ld (errno %d)\n", nr, + printf("syscall_%#lx(%#llx, %#llx, %#llx, %#llx, %#llx, %#llx)" + " = %s\n", nr | SYSCALL_BIT, (unsigned long long) a[0], (unsigned long long) a[1], (unsigned long long) a[2], (unsigned long long) a[3], (unsigned long long) a[4], (unsigned long long) a[5], - rc, errno); + sprintrc(rc)); #endif } int -main(void) +main(int argc, char *argv[]) { +#if DEBUG_PRINT + if (argc < 3) + error_msg_and_fail("Not enough arguments. " + "Usage: %s STRACE_NAME DEBUG_OUT_FD", + argv[0]); + + strace_name = argv[1]; + + errno = 0; + int debug_out_fd = strtol(argv[2], NULL, 0); + if (errno) + error_msg_and_fail("Not a number: %s", argv[2]); + + debug_out = fdopen(debug_out_fd, "a"); + if (!debug_out) + perror_msg_and_fail("fdopen: %d", debug_out_fd); +#endif + test_syscall(ARRAY_SIZE(syscallent)); + (void) syscallent; /* workaround for clang bug #33068 */ #ifdef SYS_socket_subcall test_syscall(SYS_socket_subcall + 1); diff --git a/tests-m32/nsyscalls.test b/tests-m32/nsyscalls.test index 61f72d52..08d45ac6 100755 --- a/tests-m32/nsyscalls.test +++ b/tests-m32/nsyscalls.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check decoding of out-of-range syscalls. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests-m32/old_mmap-P.c b/tests-m32/old_mmap-P.c new file mode 100644 index 00000000..bb28e889 --- /dev/null +++ b/tests-m32/old_mmap-P.c @@ -0,0 +1,3 @@ +#define TEST_FD 9 +#define PATH_TRACING +#include "old_mmap.c" diff --git a/tests-m32/old_mmap-P.gen.test b/tests-m32/old_mmap-P.gen.test new file mode 100755 index 00000000..b1de9345 --- /dev/null +++ b/tests-m32/old_mmap-P.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (old_mmap-P -e trace=mmap -P "/dev/full" 9>>/dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=mmap -P "/dev/full" 9>>/dev/full diff --git a/tests-m32/old_mmap-Xabbrev.c b/tests-m32/old_mmap-Xabbrev.c new file mode 100644 index 00000000..033503cc --- /dev/null +++ b/tests-m32/old_mmap-Xabbrev.c @@ -0,0 +1 @@ +#include "old_mmap.c" diff --git a/tests-m32/old_mmap-Xabbrev.gen.test b/tests-m32/old_mmap-Xabbrev.gen.test new file mode 100755 index 00000000..0ee5608e --- /dev/null +++ b/tests-m32/old_mmap-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (old_mmap-Xabbrev -a11 -e trace=mmap -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=mmap -Xabbrev diff --git a/tests-m32/old_mmap-Xraw.c b/tests-m32/old_mmap-Xraw.c new file mode 100644 index 00000000..06de40b4 --- /dev/null +++ b/tests-m32/old_mmap-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "old_mmap.c" diff --git a/tests-m32/old_mmap-Xraw.gen.test b/tests-m32/old_mmap-Xraw.gen.test new file mode 100755 index 00000000..6d7d3cf4 --- /dev/null +++ b/tests-m32/old_mmap-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (old_mmap-Xraw -a11 -e trace=mmap -Xraw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=mmap -Xraw diff --git a/tests-m32/old_mmap-Xverbose.c b/tests-m32/old_mmap-Xverbose.c new file mode 100644 index 00000000..b141fec9 --- /dev/null +++ b/tests-m32/old_mmap-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "old_mmap.c" diff --git a/tests-m32/old_mmap-Xverbose.gen.test b/tests-m32/old_mmap-Xverbose.gen.test new file mode 100755 index 00000000..6534a931 --- /dev/null +++ b/tests-m32/old_mmap-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (old_mmap-Xverbose -a11 -e trace=mmap -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=mmap -Xverbose diff --git a/tests-m32/old_mmap-v-none.c b/tests-m32/old_mmap-v-none.c new file mode 100644 index 00000000..033503cc --- /dev/null +++ b/tests-m32/old_mmap-v-none.c @@ -0,0 +1 @@ +#include "old_mmap.c" diff --git a/tests-m32/old_mmap-v-none.gen.test b/tests-m32/old_mmap-v-none.gen.test new file mode 100755 index 00000000..a568d989 --- /dev/null +++ b/tests-m32/old_mmap-v-none.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (old_mmap-v-none -a11 -e trace=mmap -e verbose=none); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=mmap -e verbose=none diff --git a/tests-m32/old_mmap.c b/tests-m32/old_mmap.c index 2725fb75..92ab3efb 100644 --- a/tests-m32/old_mmap.c +++ b/tests-m32/old_mmap.c @@ -2,29 +2,10 @@ * Check decoding of "old mmap" edition of mmap syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,57 +17,86 @@ * it would require additional efforts to filter out mmap calls made by glibc. */ -#if defined __NR_mmap && \ -( defined __arm__ \ - || defined __i386__ \ - || (defined __s390__ && !defined __s390x__) \ -) +#if defined __NR_mmap \ + && (defined __arm__ || defined __i386__ || defined __m68k__ \ + || defined __s390__ || defined __s390x__) \ + && (defined PATH_TRACING || !(defined __s390x__ || defined __m68k__)) # include # include # include # include +# ifndef TEST_FD +# define TEST_FD -2LU +# endif + int main(void) { long rc = syscall(__NR_mmap, 0); +# ifndef PATH_TRACING printf("mmap(NULL) = %ld %s (%m)\n", rc, errno2name()); +# endif - const unsigned int args1_c[6] = { - 0xdeadbeef, /* addr */ - 0xfacefeed, /* len */ + const unsigned long args1_c[6] = { + (unsigned long) 0xbadc0deddeadbeefULL, /* addr */ + (unsigned long) 0xdeefacedfacefeedULL, /* len */ PROT_READ|PROT_EXEC, /* prot */ MAP_FILE|MAP_FIXED, /* flags */ - -2U, /* fd */ - 0xbadc0ded /* offset */ + TEST_FD, /* fd */ + (unsigned long) 0xdecaffedbadc0dedULL /* offset */ }; - const unsigned int page_size = get_page_size(); - const unsigned int args2_c[6] = { + const unsigned long page_size = get_page_size(); + const unsigned long args2_c[6] = { 0, page_size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, - -1U, - 0xfaced000 & -page_size + -1LU, + (unsigned long) 0xda7a1057faced000ULL & -page_size }; void *args = tail_memdup(args1_c, sizeof(args1_c)); rc = syscall(__NR_mmap, args); - printf("mmap(%#x, %u, PROT_READ|PROT_EXEC, MAP_FILE|MAP_FIXED" - ", %d, %#x) = %ld %s (%m)\n", - args1_c[0], args1_c[1], args1_c[4], args1_c[5], +# if XLAT_RAW + printf("mmap(%#lx, %lu, %#x, %#x, %d, %#lx) = %ld %s (%m)\n", + args1_c[0], args1_c[1], PROT_READ|PROT_EXEC, MAP_FILE | MAP_FIXED, + (int) args1_c[4], args1_c[5], rc, errno2name()); +# elif XLAT_VERBOSE + printf("mmap(%#lx, %lu, %#x /* PROT_READ|PROT_EXEC */" + ", %#x /* MAP_FILE|MAP_FIXED */, %d, %#lx) = %ld %s (%m)\n", + args1_c[0], args1_c[1], PROT_READ|PROT_EXEC, MAP_FILE | MAP_FIXED, + (int) args1_c[4], args1_c[5], rc, errno2name()); +# else + printf("mmap(%#lx, %lu, PROT_READ|PROT_EXEC, MAP_FILE|MAP_FIXED" + ", %d, %#lx) = %ld %s (%m)\n", + args1_c[0], args1_c[1], (int) args1_c[4], args1_c[5], rc, errno2name()); +# endif memcpy(args, args2_c, sizeof(args2_c)); rc = syscall(__NR_mmap, args); - printf("mmap(NULL, %u, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS" - ", %d, %#x) = %#lx\n", - args2_c[1], args2_c[4], args2_c[5], rc); +# ifndef PATH_TRACING +# if XLAT_RAW + printf("mmap(NULL, %lu, %#x, %#x, %d, %#lx) = %#lx\n", + args2_c[1], PROT_READ|PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, + (int) args2_c[4], args2_c[5], rc); +# elif XLAT_VERBOSE + printf("mmap(NULL, %lu, %#x /* PROT_READ|PROT_WRITE */" + ", %#x /* MAP_PRIVATE|MAP_ANONYMOUS */, %d, %#lx) = %#lx\n", + args2_c[1], PROT_READ|PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, + (int) args2_c[4], args2_c[5], rc); +# else + printf("mmap(NULL, %lu, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS" + ", %d, %#lx) = %#lx\n", + args2_c[1], (int) args2_c[4], args2_c[5], rc); +# endif +# endif void *addr = (void *) rc; if (mprotect(addr, page_size, PROT_NONE)) - perror_msg_and_fail("mprotect(%p, %u, PROT_NONE)", + perror_msg_and_fail("mprotect(%p, %lu, PROT_NONE)", addr, page_size); puts("+++ exited with 0 +++"); @@ -95,7 +105,9 @@ main(void) #else -SKIP_MAIN_UNDEFINED("__NR_mmap && (__arm__ || __i386__" - " || (__s390__ && !__s390x__))") +SKIP_MAIN_UNDEFINED("defined __NR_mmap " + "&& (defined __arm__ || defined __i386__ || defined __m68k__ " + "|| defined __s390__ || defined __s390x__) " + "&& (defined PATH_TRACING || !(defined __s390x__ || defined __m68k__))") #endif diff --git a/tests-m32/old_mmap.gen.test b/tests-m32/old_mmap.gen.test new file mode 100755 index 00000000..1913eec2 --- /dev/null +++ b/tests-m32/old_mmap.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (old_mmap -a11 -e trace=mmap); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=mmap diff --git a/tests-m32/old_mmap.test b/tests-m32/old_mmap.test deleted file mode 100755 index af776ff7..00000000 --- a/tests-m32/old_mmap.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of "old mmap" edition of mmap syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a11 -e trace=mmap diff --git a/tests-m32/oldfstat.c b/tests-m32/oldfstat.c index f5a94416..c2624777 100644 --- a/tests-m32/oldfstat.c +++ b/tests-m32/oldfstat.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/oldfstat.gen.test b/tests-m32/oldfstat.gen.test new file mode 100755 index 00000000..2b48b397 --- /dev/null +++ b/tests-m32/oldfstat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (oldfstat -a18 -v -P stat.sample); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 -v -P stat.sample diff --git a/tests-m32/oldfstat.test b/tests-m32/oldfstat.test deleted file mode 100755 index 66a10561..00000000 --- a/tests-m32/oldfstat.test +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -# Check oldfstat syscall decoding. - -. "${srcdir=.}/init.sh" - -# strace -P is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - -syscall=$NAME -run_prog > /dev/null -sample=$syscall.sample -> "$sample" -run_strace -ve$syscall -P$sample -a21 $args > "$OUT" -match_diff "$LOG" "$OUT" -rm -f "$OUT" - -exit 0 diff --git a/tests-m32/oldlstat.c b/tests-m32/oldlstat.c index 66132370..0444b17f 100644 --- a/tests-m32/oldlstat.c +++ b/tests-m32/oldlstat.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/oldlstat.gen.test b/tests-m32/oldlstat.gen.test new file mode 100755 index 00000000..3202b924 --- /dev/null +++ b/tests-m32/oldlstat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (oldlstat -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests-m32/oldlstat.test b/tests-m32/oldlstat.test deleted file mode 100755 index a0f9ab93..00000000 --- a/tests-m32/oldlstat.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check oldlstat syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests-m32/oldselect-P.c b/tests-m32/oldselect-P.c new file mode 100644 index 00000000..67e21343 --- /dev/null +++ b/tests-m32/oldselect-P.c @@ -0,0 +1,2 @@ +#define PATH_TRACING_FD 9 +#include "oldselect.c" diff --git a/tests-m32/oldselect-P.gen.test b/tests-m32/oldselect-P.gen.test new file mode 100755 index 00000000..3486ffd6 --- /dev/null +++ b/tests-m32/oldselect-P.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (oldselect-P -a13 -e trace=select -P /dev/full 9>>/dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 -e trace=select -P /dev/full 9>>/dev/full diff --git a/tests-m32/oldselect-efault-P.c b/tests-m32/oldselect-efault-P.c new file mode 100644 index 00000000..9ebf73d2 --- /dev/null +++ b/tests-m32/oldselect-efault-P.c @@ -0,0 +1,2 @@ +#define PATH_TRACING_FD 9 +#include "oldselect-efault.c" diff --git a/tests-m32/oldselect-efault-P.gen.test b/tests-m32/oldselect-efault-P.gen.test new file mode 100755 index 00000000..a3d71768 --- /dev/null +++ b/tests-m32/oldselect-efault-P.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (oldselect-efault-P -a13 -e trace=select -P /dev/full 9>>/dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 -e trace=select -P /dev/full 9>>/dev/full diff --git a/tests-m32/oldselect-efault.c b/tests-m32/oldselect-efault.c new file mode 100644 index 00000000..4e927521 --- /dev/null +++ b/tests-m32/oldselect-efault.c @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#if defined __NR_select && defined __NR__newselect \ + && __NR_select != __NR__newselect \ + && !defined __sparc__ + +# include +# include +# include +# include +# include + +static const char *errstr; + +static long +xselect(const kernel_ulong_t args) +{ + static const kernel_ulong_t dummy = F8ILL_KULONG_MASK | 0xfacefeed; + long rc = syscall(__NR_select, args, dummy, dummy, dummy, dummy, dummy); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + unsigned long *const args = tail_alloc(sizeof(*args) * 4); + memset(args, 0, sizeof(*args) * 4); + + xselect(0); +# ifndef PATH_TRACING_FD + printf("select(NULL) = %s\n", errstr); +# endif + + xselect((uintptr_t) args); +# ifndef PATH_TRACING_FD + printf("select(%p) = %s\n", args, errstr); +# endif + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_select && __NR__newselect" + " && __NR_select != __NR__newselect" + " && !defined __sparc__") + +#endif diff --git a/tests-m32/oldselect-efault.gen.test b/tests-m32/oldselect-efault.gen.test new file mode 100755 index 00000000..bfeb5571 --- /dev/null +++ b/tests-m32/oldselect-efault.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (oldselect-efault -a13 -e trace=select); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 -e trace=select diff --git a/tests-m32/oldselect.c b/tests-m32/oldselect.c index 7413fc33..0af35541 100644 --- a/tests-m32/oldselect.c +++ b/tests-m32/oldselect.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -30,37 +10,38 @@ #if defined __NR_select && defined __NR__newselect \ && __NR_select != __NR__newselect \ - && !defined SPARC - -# include -# include + && !defined __sparc__ -int -main(void) -{ - int fds[2]; - fd_set r = {}, w = {}; - struct timeval timeout = { .tv_sec = 0, .tv_usec = 42 }; - long args[] = { - 2, (long) &r, (long) &w, 0, (long) &timeout, - 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded, 0xdeadbeef - }; +# define TEST_SYSCALL_NR __NR_select +# define TEST_SYSCALL_STR "select" +# define xselect xselect +# include "xselect.c" - (void) close(0); - (void) close(1); - if (pipe(fds)) - perror_msg_and_fail("pipe"); +static uint32_t *args; - FD_SET(0, &w); - FD_SET(1, &r); - if (syscall(__NR_select, args)) - perror_msg_and_skip("select"); - - return 0; +static long +xselect(const kernel_ulong_t nfds, + const kernel_ulong_t rs, + const kernel_ulong_t ws, + const kernel_ulong_t es, + const kernel_ulong_t tv) +{ + if (!args) + args = tail_alloc(sizeof(*args) * 5); + args[0] = nfds; + args[1] = rs; + args[2] = ws; + args[3] = es; + args[4] = tv; + long rc = syscall(TEST_SYSCALL_NR, args); + errstr = sprintrc(rc); + return rc; } #else -SKIP_MAIN_UNDEFINED("__NR_select && __NR__newselect") +SKIP_MAIN_UNDEFINED("__NR_select && __NR__newselect" + " && __NR_select != __NR__newselect" + " && !defined __sparc__") #endif diff --git a/tests-m32/oldselect.expected b/tests-m32/oldselect.expected deleted file mode 100644 index d6e7f3c4..00000000 --- a/tests-m32/oldselect.expected +++ /dev/null @@ -1,2 +0,0 @@ -select(2, [1], [0], NULL, {tv_sec=0, tv_usec=42}) = 0 (Timeout) -+++ exited with 0 +++ diff --git a/tests-m32/oldselect.gen.test b/tests-m32/oldselect.gen.test new file mode 100755 index 00000000..1f10cbe3 --- /dev/null +++ b/tests-m32/oldselect.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (oldselect -a13 -e trace=select); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 -e trace=select diff --git a/tests-m32/oldselect.test b/tests-m32/oldselect.test deleted file mode 100755 index 35661ad4..00000000 --- a/tests-m32/oldselect.test +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# Check old select syscall decoding. - -. "${srcdir=.}/init.sh" - -run_prog -run_strace -a34 -eselect $args -match_diff - -exit 0 diff --git a/tests-m32/oldstat.c b/tests-m32/oldstat.c index d06e2bc6..03b40335 100644 --- a/tests-m32/oldstat.c +++ b/tests-m32/oldstat.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/oldstat.gen.test b/tests-m32/oldstat.gen.test new file mode 100755 index 00000000..f265ac56 --- /dev/null +++ b/tests-m32/oldstat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (oldstat -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests-m32/oldstat.test b/tests-m32/oldstat.test deleted file mode 100755 index 42d70f7f..00000000 --- a/tests-m32/oldstat.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check oldstat syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests-m32/open.c b/tests-m32/open.c index 01e89b0f..43a3ae68 100644 --- a/tests-m32/open.c +++ b/tests-m32/open.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -30,7 +11,7 @@ #ifdef __NR_open -# include +# include # include # include @@ -56,16 +37,11 @@ main(void) sample, sprintrc(fd)); } -#ifdef O_TMPFILE -# if O_TMPFILE == (O_TMPFILE & ~O_DIRECTORY) -# define STR_O_TMPFILE "O_TMPFILE" -# else -# define STR_O_TMPFILE "O_DIRECTORY|O_TMPFILE" -# endif +# ifdef O_TMPFILE fd = syscall(__NR_open, sample, O_WRONLY|O_TMPFILE, 0600); - printf("open(\"%s\", O_WRONLY|%s, 0600) = %s\n", - sample, STR_O_TMPFILE, sprintrc(fd)); -#endif /* O_TMPFILE */ + printf("open(\"%s\", O_WRONLY|O_TMPFILE, 0600) = %s\n", + sample, sprintrc(fd)); +# endif /* O_TMPFILE */ puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/open.gen.test b/tests-m32/open.gen.test new file mode 100755 index 00000000..eb931a34 --- /dev/null +++ b/tests-m32/open.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (open -a30 -P $NAME.sample); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 -P $NAME.sample diff --git a/tests-m32/open.test b/tests-m32/open.test deleted file mode 100755 index 6df19cb8..00000000 --- a/tests-m32/open.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check open syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a30 -P $NAME.sample diff --git a/tests-m32/openat.c b/tests-m32/openat.c index 1d6765cf..d4a74178 100644 --- a/tests-m32/openat.c +++ b/tests-m32/openat.c @@ -1,44 +1,44 @@ /* * Copyright (c) 2016 Katerina Koukiou + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include -#if defined __NR_openat +#ifdef __NR_openat -# include +# include # include # include +# ifdef O_TMPFILE +/* The kernel & C libraries often inline O_DIRECTORY. */ +# define STRACE_O_TMPFILE (O_TMPFILE & ~O_DIRECTORY) +# else +# define STRACE_O_TMPFILE 0 +# endif + +static const char sample[] = "openat.sample"; + +static void +test_mode_flag(unsigned int mode_val, const char *mode_str, + unsigned int flag_val, const char *flag_str) +{ + long rc = syscall(__NR_openat, -1, sample, mode_val | flag_val, 0); + printf("openat(-1, \"%s\", %s%s%s%s) = %s\n", + sample, mode_str, + flag_val ? "|" : "", flag_str, + flag_val & (O_CREAT | STRACE_O_TMPFILE) ? ", 000" : "", + sprintrc(rc)); +} + int main(void) { - static const char sample[] = "openat.sample"; - long fd = syscall(__NR_openat, -100, sample, O_RDONLY|O_CREAT, 0400); printf("openat(AT_FDCWD, \"%s\", O_RDONLY|O_CREAT, 0400) = %s\n", sample, sprintrc(fd)); @@ -53,6 +53,54 @@ main(void) sample, sprintrc(fd)); } + struct { + unsigned int val; + const char *str; + } modes[] = { + { ARG_STR(O_RDONLY) }, + { ARG_STR(O_WRONLY) }, + { ARG_STR(O_RDWR) }, + { ARG_STR(O_ACCMODE) } + }, flags[] = { + { ARG_STR(O_APPEND) }, + { ARG_STR(O_DIRECT) }, + { ARG_STR(O_DIRECTORY) }, + { ARG_STR(O_EXCL) }, + { ARG_STR(O_LARGEFILE) }, + { ARG_STR(O_NOATIME) }, + { ARG_STR(O_NOCTTY) }, + { ARG_STR(O_NOFOLLOW) }, + { ARG_STR(O_NONBLOCK) }, + { ARG_STR(O_SYNC) }, + { ARG_STR(O_TRUNC) }, + { ARG_STR(O_CREAT) }, +# ifdef O_CLOEXEC + { ARG_STR(O_CLOEXEC) }, +# endif +# ifdef O_DSYNC + { ARG_STR(O_DSYNC) }, +# endif +# ifdef __O_SYNC + { ARG_STR(__O_SYNC) }, +# endif +# ifdef O_PATH + { ARG_STR(O_PATH) }, +# endif +# ifdef O_TMPFILE + { ARG_STR(O_TMPFILE) }, +# endif +# ifdef __O_TMPFILE + { ARG_STR(__O_TMPFILE) }, +# endif + { ARG_STR(0x80000000) }, + { 0, "" } + }; + + for (unsigned int m = 0; m < ARRAY_SIZE(modes); ++m) + for (unsigned int f = 0; f < ARRAY_SIZE(flags); ++f) + test_mode_flag(modes[m].val, modes[m].str, + flags[f].val, flags[f].str); + puts("+++ exited with 0 +++"); return 0; } diff --git a/tests-m32/openat.gen.test b/tests-m32/openat.gen.test new file mode 100755 index 00000000..29dd3491 --- /dev/null +++ b/tests-m32/openat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (openat -a36 -P $NAME.sample); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 -P $NAME.sample diff --git a/tests-m32/openat.test b/tests-m32/openat.test deleted file mode 100755 index 68c4cee1..00000000 --- a/tests-m32/openat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check openat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -P $NAME.sample diff --git a/tests-m32/opipe.test b/tests-m32/opipe.test index 90e6838a..d6777250 100755 --- a/tests-m32/opipe.test +++ b/tests-m32/opipe.test @@ -1,16 +1,19 @@ #!/bin/sh - +# # Check how -o '|pipe' works. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" check_prog grep -run_prog grep chdir $srcdir/umovestr.expected > "$EXP" -run_prog ./umovestr +grep chdir $srcdir/umovestr.expected > "$EXP" +run_prog ../umovestr -> "$LOG" || fail_ "failed to write $LOG" $STRACE -o "|cat > $LOG && $SLEEP_A_BIT && grep chdir < $LOG > $OUT" -e chdir $args || dump_log_and_fail_with "$STRACE $args failed" match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-m32/options-syntax.test b/tests-m32/options-syntax.test index 592b0e03..5e43b3ab 100755 --- a/tests-m32/options-syntax.test +++ b/tests-m32/options-syntax.test @@ -3,62 +3,12 @@ # Check strace options syntax. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (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" +# SPDX-License-Identifier: GPL-2.0-or-later -check_exit_status_and_stderr() -{ - $STRACE "$@" 2> "$LOG" && - dump_log_and_fail_with \ - "strace $* failed to handle the error properly" - match_diff "$LOG" "$EXP" || - dump_log_and_fail_with \ - "strace $* failed to print expected diagnostics" -} - -strace_exp="${STRACE##* }" - -check_e() -{ - local pattern="$1"; shift - cat > "$EXP" << __EOF__ -$strace_exp: $pattern -__EOF__ - check_exit_status_and_stderr "$@" -} - -check_h() -{ - local pattern="$1"; shift - cat > "$EXP" << __EOF__ -$strace_exp: $pattern -Try '$strace_exp -h' for more information. -__EOF__ - check_exit_status_and_stderr "$@" -} +. "${srcdir=.}/syntax.sh" check_e "Invalid process id: '0'" -p 0 check_e "Invalid process id: '-42'" -p -42 @@ -67,26 +17,10 @@ check_e "Invalid process id: 'a'" -p 1,a check_e "Syscall 'chdir' for -b isn't supported" -b chdir check_e "Syscall 'chdir' for -b isn't supported" -b execve -b chdir -check_e "invalid system call '-1'" -e-1 -check_e "invalid system call '-2'" -e -2 -check_e "invalid system call '-3'" -etrace=-3 -check_e "invalid system call '-4'" -e trace=-4 -check_e "invalid system call '-5'" -e trace=1,-5 -check_e "invalid system call '2147483647'" -e 2147483647 -check_e "invalid system call '2147483648'" -e 2147483648 -check_e "invalid system call '4294967295'" -e 4294967295 -check_e "invalid system call '4294967296'" -e 4294967296 +check_e_using_grep 'exec: File *name too long' "$(printf '%4096s' ' ')" -check_e "invalid descriptor '-1'" -eread=-1 -check_e "invalid descriptor '-42'" -ewrite=-42 -check_e "invalid descriptor '2147483648'" -eread=2147483648 -check_e "invalid descriptor '4294967296'" -ewrite=4294967296 -check_e "invalid descriptor 'foo'" -eread=foo -check_e "invalid descriptor ''" -ewrite= -check_e "invalid descriptor ','" -eread=, -check_e "invalid descriptor '!'" -ewrite='!' -check_e "invalid descriptor '!'" -eread='0,!' -check_e "invalid descriptor '!,'" -ewrite='!,' +ff_name="$(printf '%4084s' ' ')" +check_e_using_grep "$ff_name: File *name too long" -ff -o "$ff_name" true check_h 'must have PROG [ARGS] or -p PID' check_h 'PROG [ARGS] must be specified with -D' -D -p $$ @@ -100,10 +34,63 @@ check_h 'piping the output and -ff are mutually exclusive' -o '!' -ff true check_h "invalid -a argument: '-42'" -a -42 check_h "invalid -O argument: '-42'" -O -42 check_h "invalid -s argument: '-42'" -s -42 +check_h "invalid -s argument: '1073741824'" -s 1073741824 check_h "invalid -I argument: '5'" -I 5 +check_h "invalid -X argument: 'test'" -Xtest +check_h "invalid -X argument: 'a'" -Xa +check_h "invalid -X argument: 'abbreviated'" -X abbreviated + +check_h "incorrect personality designator '' in qualification 'getcwd@'" -e trace=getcwd@ +check_h "incorrect personality designator '42' in qualification 'getcwd@42'" -e trace=getcwd@42 +check_h "incorrect personality designator '42' in qualification 'getcwd@42'" -e trace=gettid,getcwd@42 +check_h "incorrect personality designator '42' in qualification '23@42'" -e trace=23@42,123 + +check_e "invalid system call '/getcwd@ohmy'" -e trace=/getcwd@ohmy +check_e "invalid -e kvm= argument: 'chdir'" -e kvm=chdir + +case "$STRACE_NATIVE_ARCH" in +x86_64) + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@64 + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@32 + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@x32 + ;; +x32) + check_h "incorrect personality designator '64' in qualification 'getcwd@64'" -e trace=getcwd@64 + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@32 + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@x32 + ;; +aarch64|powerpc64|riscv|s390x|sparc64|tile) + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@64 + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@32 + check_h "incorrect personality designator 'x32' in qualification 'getcwd@x32'" -e trace=getcwd@x32 + ;; +*) + pers="$((SIZEOF_LONG * 8))" + inv_pers="$((96 - pers))" + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@"$pers" + check_h "incorrect personality designator '$inv_pers' in qualification 'getcwd@$inv_pers'" -e trace=getcwd@"$inv_pers" + check_h "incorrect personality designator 'x32' in qualification 'getcwd@x32'" -e trace=getcwd@x32 +esac + +../zeroargc "$STRACE_EXE" /bin/true 2> "$LOG" && + dump_log_and_fail_with \ + 'zeroargc strace failed to handle the error properly' +cat > "$EXP" << __EOF__ +$STRACE_EXE: must have PROG [ARGS] or -p PID +Try '$STRACE_EXE -h' for more information. +__EOF__ +diff -u -- "$EXP" "$LOG" > /dev/null || { + cat > "$EXP" <<- '__EOF__' + strace: must have PROG [ARGS] or -p PID + Try 'strace -h' for more information. + __EOF__ + match_diff "$LOG" "$EXP" \ + "zeroargc $STRACE $args output mismatch" +} -if [ -n "${UID-}" ]; then - if [ "${UID-}" = 0 ]; then +uid="${UID:-`id -u`}" +if [ "$uid" -ge 0 ]; then + if [ "$uid" -eq 0 ]; then umsg="Cannot find user ':nosuchuser:'" else umsg='You must be root to use the -u option' @@ -113,17 +100,14 @@ if [ -n "${UID-}" ]; then for c in i r t T y; do check_e "-$c has no effect with -c -$strace_exp: $umsg" -u :nosuchuser: -c -$c true +$STRACE_EXE: $umsg" -u :nosuchuser: -c -$c true done check_e "-i has no effect with -c -$strace_exp: -r has no effect with -c -$strace_exp: -t has no effect with -c -$strace_exp: -T has no effect with -c -$strace_exp: -y has no effect with -c -$strace_exp: $umsg" -u :nosuchuser: -cirtTy true - - check_e "-tt has no effect with -r -$strace_exp: $umsg" -u :nosuchuser: -r -tt true +$STRACE_EXE: -r has no effect with -c +$STRACE_EXE: -t has no effect with -c +$STRACE_EXE: -T has no effect with -c +$STRACE_EXE: -y has no effect with -c +$STRACE_EXE: $umsg" -u :nosuchuser: -cirtTy true fi args='-p 2147483647' @@ -133,7 +117,7 @@ $STRACE $args 2> "$LOG" && for cmd in PTRACE_SEIZE PTRACE_ATTACH; do cat > "$EXP" << __EOF__ -$strace_exp: attach: ptrace($cmd, 2147483647): No such process +$STRACE_EXE: attach: ptrace($cmd, 2147483647): No such process __EOF__ diff -- "$EXP" "$LOG" || continue @@ -144,5 +128,3 @@ done [ -z "$args" ] || dump_log_and_fail_with \ "strace $args failed to print expected diagnostics" - -rm -f "$EXP" diff --git a/tests-m32/orphaned_process_group.c b/tests-m32/orphaned_process_group.c new file mode 100644 index 00000000..83ab6e39 --- /dev/null +++ b/tests-m32/orphaned_process_group.c @@ -0,0 +1,155 @@ +/* + * Check tracing of orphaned process group. + * + * Copyright (c) 2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +#define TIMEOUT 5 + +static void +alarm_handler(const int no) +{ + error_msg_and_skip("Orphaned process group semantics" + " is not supported by the kernel"); +} + +int +main(void) +{ + int status; + + /* + * Unblock all signals. + */ + static sigset_t mask; + if (sigprocmask(SIG_SETMASK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + /* + * Create a pipe to track termination of processes. + */ + int pipe_fds[2]; + if (pipe(pipe_fds)) + perror_msg_and_fail("pipe"); + + /* + * Create a leader for its own new process group. + */ + pid_t leader = fork(); + if (leader < 0) + perror_msg_and_fail("fork"); + + if (leader) { + /* + * Close the writing end of the pipe. + */ + close(pipe_fds[1]); + + /* + * Install the SIGALRM signal handler. + */ + static const struct sigaction sa = { + .sa_handler = alarm_handler + }; + if (sigaction(SIGALRM, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + /* + * Set an alarm clock. + */ + alarm(TIMEOUT); + + /* + * Wait for termination of the child process. + */ + if (waitpid(leader, &status, 0) != leader) + perror_msg_and_fail("waitpid leader"); + if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) + error_msg_and_fail("waitpid leader: " + "unexpected wait status %d", + status); + + /* + * Wait for termination of all processes + * in the process group of the child process. + */ + if (read(pipe_fds[0], &status, sizeof(status)) != 0) + perror_msg_and_fail("read"); + + /* + * At this point all processes are gone. + * Let the tracer time to catch up. + */ + alarm(0); + sleep(1); + return 0; + } + + /* + * Close the reading end of the pipe. + */ + close(pipe_fds[0]); + + /* + * Create a new process group. + */ + if (setpgid(0, 0)) + perror_msg_and_fail("setpgid"); + + /* + * When the leader process terminates, the process group becomes orphaned. + * If any member of the orphaned process group is stopped, then + * a SIGHUP signal followed by a SIGCONT signal is sent to each process + * in the orphaned process group. + * Create a process in a stopped state to activate this behaviour. + */ + const pid_t stopped = fork(); + if (stopped < 0) + perror_msg_and_fail("fork"); + if (!stopped) { + static const struct sigaction sa = { .sa_handler = SIG_DFL }; + if (sigaction(SIGHUP, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + raise(SIGSTOP); + _exit(0); + } + + /* + * Wait for the process to stop. + */ + if (waitpid(stopped, &status, WUNTRACED) != stopped) + perror_msg_and_fail("waitpid WUNTRACED"); + if (!WIFSTOPPED(status) || WSTOPSIG(status) != SIGSTOP) + error_msg_and_fail("unexpected wait status %d", status); + + /* + * Print the expected output. + */ + leader = getpid(); + printf("%-5d --- %s {si_signo=%s, si_code=SI_TKILL" + ", si_pid=%d, si_uid=%u} ---\n", + stopped, "SIGSTOP", "SIGSTOP", stopped, geteuid()); + printf("%-5d --- stopped by SIGSTOP ---\n", stopped); + printf("%-5d +++ exited with 0 +++\n", leader); + printf("%-5d --- %s {si_signo=%s, si_code=SI_KERNEL} ---\n", + stopped, "SIGHUP", "SIGHUP"); + printf("%-5d +++ killed by %s +++\n", stopped, "SIGHUP"); + printf("%-5d +++ exited with 0 +++\n", getppid()); + + /* + * Make the process group orphaned. + */ + return 0; +} diff --git a/tests-m32/orphaned_process_group.gen.test b/tests-m32/orphaned_process_group.gen.test new file mode 100755 index 00000000..c000fd5f --- /dev/null +++ b/tests-m32/orphaned_process_group.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (orphaned_process_group . "${srcdir=.}/PTRACE_SEIZE.sh"; run_strace_match_diff -f -e trace=none -e signal='!chld'); do not edit. +. "${srcdir=.}/init.sh" +. "${srcdir=.}/PTRACE_SEIZE.sh"; run_strace_match_diff -f -e trace=none -e signal='!chld' diff --git a/tests-m32/osf_utimes.c b/tests-m32/osf_utimes.c new file mode 100644 index 00000000..d721e394 --- /dev/null +++ b/tests-m32/osf_utimes.c @@ -0,0 +1,25 @@ +/* + * Check decoding of osf_utimes syscall. + * + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_osf_utimes + +# define TEST_SYSCALL_NR __NR_osf_utimes +# define TEST_SYSCALL_STR "osf_utimes" +# define TEST_STRUCT struct timeval32 +struct timeval32 { int tv_sec, tv_usec; }; +# include "xutimes.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_osf_utimes") + +#endif diff --git a/tests-m32/osf_utimes.gen.test b/tests-m32/osf_utimes.gen.test new file mode 100755 index 00000000..9e683b47 --- /dev/null +++ b/tests-m32/osf_utimes.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (osf_utimes -a21 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests-m32/overflowuid.c b/tests-m32/overflowuid.c index a3c742b4..6a7a8f93 100644 --- a/tests-m32/overflowuid.c +++ b/tests-m32/overflowuid.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2014-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/pause.c b/tests-m32/pause.c index 86873620..0260a6bc 100644 --- a/tests-m32/pause.c +++ b/tests-m32/pause.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Fei Jie + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/pause.gen.test b/tests-m32/pause.gen.test new file mode 100755 index 00000000..76492b6c --- /dev/null +++ b/tests-m32/pause.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pause -a8 -esignal=none); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 -esignal=none diff --git a/tests-m32/pause.test b/tests-m32/pause.test deleted file mode 100755 index c5fdacde..00000000 --- a/tests-m32/pause.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of pause syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a8 -esignal=none diff --git a/tests-m32/pc.c b/tests-m32/pc.c index f53acd45..0bc28d18 100644 --- a/tests-m32/pc.c +++ b/tests-m32/pc.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/pc.test b/tests-m32/pc.test index beadb7d7..40221e57 100755 --- a/tests-m32/pc.test +++ b/tests-m32/pc.test @@ -3,29 +3,10 @@ # Check -i option. # # Copyright (c) 2015 Dmitry V. Levin +# Copyright (c) 2015-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -47,15 +28,11 @@ addr="$(echo "$ip" |sed -r 's/^0+//')" && [ -n "$addr" ] || dump_log_and_fail_with -EXPECTED="$LOG.expected" -cat > "$EXPECTED" << __EOF__ +cat > "$EXP" << __EOF__ \\[[[:xdigit:]]{$len}\\] munmap\\(0x[[:xdigit:]]+, 0\\) += -1 .* \\[pid +$pid\\] \\[$ip\\] --- SIGSEGV \\{si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x$addr\\} --- \\[pid +$pid\\] \\[\\?{$len}\\] \\+\\+\\+ killed by SIGSEGV( \\(core dumped\\))? \\+\\+\\+ \\[\\?{$len}\\] \\+\\+\\+ exited with 0 \\+\\+\\+ __EOF__ -match_grep "$LOG" "$EXPECTED" -rm -f "$EXPECTED" - -exit 0 +match_grep "$LOG" "$EXP" diff --git a/tests-m32/perf_event_open.c b/tests-m32/perf_event_open.c index 0ffea292..ae38b6de 100644 --- a/tests-m32/perf_event_open.c +++ b/tests-m32/perf_event_open.c @@ -2,29 +2,10 @@ * Check verbose decoding of perf_event_open syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -34,7 +15,6 @@ # include # include -# include # include # include # include @@ -72,36 +52,37 @@ struct u64_val_str { const char *str; }; -/* In order to avoid endianess-specific hackery */ +/* In order to avoid endianness-specific hackery. */ struct pea_flags { - uint64_t disabled :1, - inherit :1, - pinned :1, - exclusive :1, - exclude_user :1, - exclude_kernel :1, - exclude_hv :1, - exclude_idle :1, - mmap :1, - comm :1, - freq :1, - inherit_stat :1, - enable_on_exec :1, - task :1, - watermark :1, - precise_ip :2, - mmap_data :1, - sample_id_all :1, - exclude_host :1, - exclude_guest :1, - exclude_callchain_kernel :1, - exclude_callchain_user :1, - mmap2 :1, - comm_exec :1, - use_clockid :1, - context_switch :1, - write_backward :1, - __reserved_1 :36; + uint64_t disabled :1, + inherit :1, + pinned :1, + exclusive :1, + exclude_user :1, + exclude_kernel :1, + exclude_hv :1, + exclude_idle :1, + mmap :1, + comm :1, + freq :1, + inherit_stat :1, + enable_on_exec :1, + task :1, + watermark :1, + precise_ip :2, + mmap_data :1, + sample_id_all :1, + exclude_host :1, + exclude_guest :1, + exclude_callchain_kernel :1, + exclude_callchain_user :1, + mmap2 :1, + comm_exec :1, + use_clockid :1, + context_switch :1, + write_backward :1, + namespaces :1, + __reserved_1 :35; }; static const char * @@ -255,104 +236,112 @@ print_event_attr(struct perf_event_attr *attr_ptr, size_t size, flags_data.raw = ((uint64_t *) attr)[5]; val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_PRECISE_IP +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_PRECISE_IP attr->precise_ip; -# else +# else flags_data.flags.precise_ip; -# endif +# endif printf(", precise_ip=%" PRIu64 " /* %s */", val, precise_ip_desc); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP_DATA +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP_DATA attr->mmap_data; -# else +# else flags_data.flags.mmap_data; -# endif +# endif printf(", mmap_data=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_ID_ALL +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_ID_ALL attr->sample_id_all; -# else +# else flags_data.flags.sample_id_all; -# endif +# endif printf(", sample_id_all=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_HOST +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_HOST attr->exclude_host; -# else +# else flags_data.flags.exclude_host; -# endif +# endif printf(", exclude_host=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_GUEST +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_GUEST attr->exclude_guest; -# else +# else flags_data.flags.exclude_guest; -# endif +# endif printf(", exclude_guest=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_KERNEL +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_KERNEL attr->exclude_callchain_kernel; -# else +# else flags_data.flags.exclude_callchain_kernel; -# endif +# endif printf(", exclude_callchain_kernel=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_USER +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_USER attr->exclude_callchain_user; -# else +# else flags_data.flags.exclude_callchain_user; -# endif +# endif printf(", exclude_callchain_user=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP2 +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP2 attr->mmap2; -# else +# else flags_data.flags.mmap2; -# endif +# endif printf(", mmap2=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_COMM_EXEC +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_COMM_EXEC attr->comm_exec; -# else +# else flags_data.flags.comm_exec; -# endif +# endif printf(", comm_exec=%" PRIu64, val); use_clockid = val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_USE_CLOCKID +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_USE_CLOCKID attr->use_clockid; -# else +# else flags_data.flags.use_clockid; -# endif +# endif printf(", use_clockid=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONTEXT_SWITCH +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONTEXT_SWITCH attr->context_switch; -# else +# else flags_data.flags.context_switch; -# endif +# endif printf(", context_switch=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_WRITE_BACKWARD +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_WRITE_BACKWARD attr->write_backward; -# else +# else flags_data.flags.write_backward; -# endif +# endif printf(", write_backward=%" PRIu64, val); + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_NAMESPACES + attr->namespaces; +# else + flags_data.flags.namespaces; +# endif + printf(", namespaces=%" PRIu64, val); + val = flags_data.flags.__reserved_1; if (val) - printf(", __reserved_1=%#" PRIx64 " /* Bits 63..28 */", val); + printf(", __reserved_1=%#" PRIx64 " /* Bits 63..29 */", val); printf(", %s=%u", attr->watermark ? "wakeup_watermark" : "wakeup_events", @@ -362,11 +351,11 @@ print_event_attr(struct perf_event_attr *attr_ptr, size_t size, printf(", bp_type=%s", bp_type); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG1 +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG1 attr->config1; -# else +# else ((uint64_t *) attr)[56 / sizeof(uint64_t)]; -# endif +# endif printf(", %s=%#" PRIx64, attr->type == PERF_TYPE_BREAKPOINT ? "bp_addr" : "config1", val); @@ -378,11 +367,11 @@ print_event_attr(struct perf_event_attr *attr_ptr, size_t size, } val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG2 +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG2 attr->config2; -# else +# else ((uint64_t *) attr)[64 / sizeof(uint64_t)]; -# endif +# endif if (attr->type == PERF_TYPE_BREAKPOINT) printf(", bp_len=%" PRIu64, val); else @@ -408,11 +397,11 @@ print_event_attr(struct perf_event_attr *attr_ptr, size_t size, } val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_USER +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_USER attr->sample_regs_user; -# else +# else ((uint64_t *) attr)[80 / sizeof(uint64_t)]; -# endif +# endif printf(", sample_regs_user=%#" PRIx64, val); if (size <= 88) { @@ -421,11 +410,11 @@ print_event_attr(struct perf_event_attr *attr_ptr, size_t size, } val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_STACK_USER +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_STACK_USER attr->sample_stack_user; -# else +# else ((uint32_t *) attr)[88 / sizeof(uint32_t)]; -# endif +# endif /* * Print branch sample type only in case PERF_SAMPLE_STACK_USER * is set in the sample_type field. @@ -448,42 +437,42 @@ print_event_attr(struct perf_event_attr *attr_ptr, size_t size, } val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_INTR +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_INTR attr->sample_regs_intr; -# else +# else ((uint64_t *) attr)[96 / sizeof(uint64_t)]; -# endif +# endif printf(", sample_regs_intr=%#" PRIx64, val); /* End of version 4 of the structure */ if (size <= 104) { - cutoff =104; + cutoff = 104; goto end; } val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_AUX_WATERMARK +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_AUX_WATERMARK attr->aux_watermark; -# else +# else ((uint32_t *) attr)[104 / sizeof(uint32_t)]; -# endif +# endif printf(", aux_watermark=%" PRIu32, (uint32_t) val); if (size <= 108) { - cutoff =108; + cutoff = 108; goto end; } val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_MAX_STACK +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_MAX_STACK attr->sample_max_stack; -# else +# else ((uint16_t *) attr)[108 / sizeof(uint16_t)]; -# endif +# endif printf(", sample_max_stack=%" PRIu16, (uint16_t) val); if (size <= 110) { - cutoff =110; + cutoff = 110; goto end; } @@ -522,7 +511,8 @@ end: "PERF_SAMPLE_BRANCH_IND_JUMP|" \ "PERF_SAMPLE_BRANCH_CALL|" \ "PERF_SAMPLE_BRANCH_NO_FLAGS|" \ - "PERF_SAMPLE_BRANCH_NO_CYCLES" + "PERF_SAMPLE_BRANCH_NO_CYCLES|" \ + "PERF_SAMPLE_BRANCH_TYPE_SAVE" int main(void) @@ -607,7 +597,7 @@ main(void) static const struct u64_val_str sample_types[] = { { ARG_STR(0) }, { 0x800, "PERF_SAMPLE_BRANCH_STACK" }, - { ARG_ULL_STR(0xdeadc0deda780000) " /* PERF_SAMPLE_??? */" }, + { ARG_ULL_STR(0xdeadc0deda700000) " /* PERF_SAMPLE_??? */" }, { 0xffffffffffffffffULL, "PERF_SAMPLE_IP|PERF_SAMPLE_TID|PERF_SAMPLE_TIME|" "PERF_SAMPLE_ADDR|PERF_SAMPLE_READ|" @@ -617,7 +607,8 @@ main(void) "PERF_SAMPLE_REGS_USER|PERF_SAMPLE_STACK_USER|" "PERF_SAMPLE_WEIGHT|PERF_SAMPLE_DATA_SRC|" "PERF_SAMPLE_IDENTIFIER|PERF_SAMPLE_TRANSACTION|" - "PERF_SAMPLE_REGS_INTR|0xfffffffffff80000" }, + "PERF_SAMPLE_REGS_INTR|PERF_SAMPLE_PHYS_ADDR|" + "0xfffffffffff00000" }, }; static const struct u64_val_str read_formats[] = { { ARG_STR(0) }, @@ -649,11 +640,11 @@ main(void) static const struct u64_val_str branch_sample_types[] = { { ARG_STR(0) }, { 0x80, "PERF_SAMPLE_BRANCH_ABORT_TX" }, - { 0xffff, BRANCH_TYPE_ALL }, - { ARG_ULL_STR(0xdeadcaffeeed0000) + { 0x1ffff, BRANCH_TYPE_ALL }, + { ARG_ULL_STR(0xdeadcaffeeec0000) " /* PERF_SAMPLE_BRANCH_??? */" }, { 0xffffffffffffffffULL, - BRANCH_TYPE_ALL "|0xffffffffffff0000" } + BRANCH_TYPE_ALL "|0xfffffffffffe0000" } }; static const struct s32_val_str clockids[] = { { 11, "CLOCK_TAI" }, @@ -681,7 +672,7 @@ main(void) ATTR_REC(attr_big_size), }; - struct perf_event_attr *small_attr = tail_alloc(sizeof(*small_attr)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct perf_event_attr, small_attr); struct { struct perf_event_attr *attr; @@ -717,7 +708,7 @@ main(void) for (i = 0; i < ARRAY_SIZE(args); i++) { rc = syscall(__NR_perf_event_open, args[i].attr, args[i].pid, - args[i].cpu, args[i].group_fd, args[i].flags); + args[i].cpu, args[i].group_fd, args[i].flags); printf("perf_event_open(%s, %d, %d, %d, %s) = %s\n", printaddr(args[i].attr), args[i].pid, args[i].cpu, args[i].group_fd, args[i].flags_str, sprintrc(rc)); @@ -792,19 +783,19 @@ main(void) attr->size = 0; rc = syscall(__NR_perf_event_open, attr, args[args_idx].pid, - args[args_idx].cpu, args[args_idx].group_fd, - args[args_idx].flags); + args[args_idx].cpu, args[args_idx].group_fd, + args[args_idx].flags); printf("perf_event_open("); print_event_attr(attr, i ? ((i == 1) ? 0 : size) : size + 8, - attr_types[type_idx].str, - attr_configs[type_idx][config_idx].str, - sample_types[sample_type_idx].str, - read_formats[read_format_idx].str, - ip_desc_str, - bp_types[bp_type_idx].str, - branch_sample_types[branch_sample_type_idx].str, - clockids[clockid_idx].str, size); + attr_types[type_idx].str, + attr_configs[type_idx][config_idx].str, + sample_types[sample_type_idx].str, + read_formats[read_format_idx].str, + ip_desc_str, + bp_types[bp_type_idx].str, + branch_sample_types[branch_sample_type_idx].str, + clockids[clockid_idx].str, size); printf(", %d, %d, %d, %s) = %s\n", args[args_idx].pid, args[args_idx].cpu, args[args_idx].group_fd, args[args_idx].flags_str, sprintrc(rc)); diff --git a/tests-m32/perf_event_open.gen.test b/tests-m32/perf_event_open.gen.test new file mode 100755 index 00000000..02d468ab --- /dev/null +++ b/tests-m32/perf_event_open.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (perf_event_open -a1 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a1 diff --git a/tests-m32/perf_event_open.test b/tests-m32/perf_event_open.test deleted file mode 100755 index 499134b4..00000000 --- a/tests-m32/perf_event_open.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# Check perf_event_open syscall decoding. - -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a1 diff --git a/tests-m32/perf_event_open_nonverbose.c b/tests-m32/perf_event_open_nonverbose.c index 45d7c8f2..b87cb2c6 100644 --- a/tests-m32/perf_event_open_nonverbose.c +++ b/tests-m32/perf_event_open_nonverbose.c @@ -2,29 +2,10 @@ * Check decoding of perf_event_open syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -41,11 +22,11 @@ # include "xlat.h" # include "xlat/perf_event_open_flags.h" -#if ULONG_MAX > UINT_MAX -#define LONG_STR_PREFIX "ffffffff" -#else -#define LONG_STR_PREFIX "" -#endif +# if ULONG_MAX > UINT_MAX +# define LONG_STR_PREFIX "ffffffff" +# else +# define LONG_STR_PREFIX "" +# endif static const char *printaddr(void *ptr) { @@ -62,7 +43,7 @@ static const char *printaddr(void *ptr) int main(void) { - struct perf_event_attr *attr = tail_alloc(sizeof(*attr)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct perf_event_attr, attr); attr->type = PERF_TYPE_HARDWARE; attr->size = sizeof(*attr); diff --git a/tests-m32/perf_event_open_nonverbose.gen.test b/tests-m32/perf_event_open_nonverbose.gen.test new file mode 100755 index 00000000..f1ed333e --- /dev/null +++ b/tests-m32/perf_event_open_nonverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (perf_event_open_nonverbose -a34 -e verbose=none -e trace=perf_event_open); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a34 -e verbose=none -e trace=perf_event_open diff --git a/tests-m32/perf_event_open_nonverbose.test b/tests-m32/perf_event_open_nonverbose.test deleted file mode 100755 index 404827fe..00000000 --- a/tests-m32/perf_event_open_nonverbose.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of perf_event_open syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a34 -e verbose=none -e trace=perf_event_open diff --git a/tests-m32/perf_event_open_unabbrev.gen.test b/tests-m32/perf_event_open_unabbrev.gen.test new file mode 100755 index 00000000..1d9bd851 --- /dev/null +++ b/tests-m32/perf_event_open_unabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (perf_event_open_unabbrev -a1 -v -e trace=perf_event_open); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a1 -v -e trace=perf_event_open diff --git a/tests-m32/perf_event_open_unabbrev.test b/tests-m32/perf_event_open_unabbrev.test deleted file mode 100755 index f17fd17e..00000000 --- a/tests-m32/perf_event_open_unabbrev.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# Check perf_event_open syscall decoding. - -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a1 -v -e trace=perf_event_open diff --git a/tests-m32/personality-Xabbrev.c b/tests-m32/personality-Xabbrev.c new file mode 100644 index 00000000..2e993dc1 --- /dev/null +++ b/tests-m32/personality-Xabbrev.c @@ -0,0 +1 @@ +#include "personality.c" diff --git a/tests-m32/personality-Xabbrev.gen.test b/tests-m32/personality-Xabbrev.gen.test new file mode 100755 index 00000000..df93e6cb --- /dev/null +++ b/tests-m32/personality-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (personality-Xabbrev +personality.test -Xabbrev); do not edit. +set -- -Xabbrev +. "${srcdir=.}/personality.test" diff --git a/tests-m32/personality-Xraw.c b/tests-m32/personality-Xraw.c new file mode 100644 index 00000000..59702f8b --- /dev/null +++ b/tests-m32/personality-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "personality.c" diff --git a/tests-m32/personality-Xraw.gen.test b/tests-m32/personality-Xraw.gen.test new file mode 100755 index 00000000..559f0f3a --- /dev/null +++ b/tests-m32/personality-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (personality-Xraw +personality.test -a15 -Xraw); do not edit. +set -- -a15 -Xraw +. "${srcdir=.}/personality.test" diff --git a/tests-m32/personality-Xverbose.c b/tests-m32/personality-Xverbose.c new file mode 100644 index 00000000..545ebe71 --- /dev/null +++ b/tests-m32/personality-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "personality.c" diff --git a/tests-m32/personality-Xverbose.gen.test b/tests-m32/personality-Xverbose.gen.test new file mode 100755 index 00000000..b6ce2094 --- /dev/null +++ b/tests-m32/personality-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (personality-Xverbose +personality.test -Xverbose); do not edit. +set -- -Xverbose +. "${srcdir=.}/personality.test" diff --git a/tests-m32/personality.c b/tests-m32/personality.c index 7a279a14..5169c1d4 100644 --- a/tests-m32/personality.c +++ b/tests-m32/personality.c @@ -1,78 +1,84 @@ /* * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include #include +#if XLAT_RAW +# define linux_type_str "0" +# define good_type_str "0x6" +# define bad_type_str "0x1f" +# define good_flags_str "0x7000000" +# define bad_flags_str "0x10000" +# define good_bad_flags_str "0x7010000" +#elif XLAT_VERBOSE +# define linux_type_str "0 /\\* PER_LINUX \\*/" +# define good_type_str "0x6 /\\* PER_BSD \\*/" +# define bad_type_str "0x1f /\\* PER_\\?\\?\\? \\*/" +# define good_flags_str \ + "0x7000000 /\\* SHORT_INODE\\|WHOLE_SECONDS\\|STICKY_TIMEOUTS \\*/" +# define bad_flags_str "0x10000" +# define good_bad_flags_str \ + "0x7010000 /\\* SHORT_INODE\\|WHOLE_SECONDS\\|STICKY_TIMEOUTS" \ + "\\|0x10000 \\*/" +#else +# define linux_type_str "PER_LINUX" +# define good_type_str "PER_BSD" +# define bad_type_str "0x1f /\\* PER_\\?\\?\\? \\*/" +# define good_flags_str "SHORT_INODE\\|WHOLE_SECONDS\\|STICKY_TIMEOUTS" +# define bad_flags_str "0x10000" +# define good_bad_flags_str \ + "SHORT_INODE\\|WHOLE_SECONDS\\|STICKY_TIMEOUTS\\|0x10000" +#endif + 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); + printf("personality\\(%s\\) = %#x \\([^)]*\\)\n", + linux_type_str, saved_pers); personality(0xffffffff); - puts("personality\\(0xffffffff\\) = 0 \\(PER_LINUX\\)"); + printf("personality\\(0xffffffff\\) = 0 \\(%s\\)\n", linux_type_str); personality(good_flags); - printf("personality\\(PER_LINUX\\|%s\\) = 0 \\(PER_LINUX\\)\n", - good_flags_str); + printf("personality\\(%s\\|%s\\) = 0 \\(%s\\)\n", + linux_type_str, good_flags_str, linux_type_str); personality(bad_flags); - printf("personality\\(PER_LINUX\\|%s\\)" - " = %#x \\(PER_LINUX\\|%s\\)\n", - bad_flags_str, good_flags, good_flags_str); + printf("personality\\(%s\\|%s\\)" + " = %#x \\(%s\\|%s\\)\n", + linux_type_str, bad_flags_str, + good_flags, linux_type_str, 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); + printf("personality\\(%s\\|%s\\)" + " = %#x \\(%s\\|%s\\)\n", + linux_type_str, good_bad_flags_str, + bad_flags, linux_type_str, bad_flags_str); /* another valid type */ personality(good_type); - printf("personality\\(%s\\) = %#x \\(PER_LINUX\\|%s\\|%s\\)\n", + printf("personality\\(%s\\) = %#x \\(%s\\|%s\\)\n", good_type_str, good_flags | bad_flags, - good_flags_str, bad_flags_str); + linux_type_str, good_bad_flags_str); personality(good_type | good_flags); printf("personality\\(%s\\|%s\\) = %#x \\(%s\\)\n", @@ -84,16 +90,16 @@ int main(void) 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, + printf("personality\\(%s\\|%s\\) = %#x \\(%s\\|%s\\)\n", + good_type_str, good_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", + printf("personality\\(%s\\) = %#x \\(%s\\|%s\\)\n", bad_type_str, good_type | good_flags | bad_flags, - good_type_str, good_flags_str, bad_flags_str); + good_type_str, good_bad_flags_str); personality(bad_type | good_flags); printf("personality\\(%s\\|%s\\) = %#x \\(%s\\)\n", @@ -105,14 +111,14 @@ int main(void) 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, + printf("personality\\(%s\\|%s\\) = %#x \\(%s\\|%s\\)\n", + bad_type_str, good_bad_flags_str, bad_type | bad_flags, bad_type_str, bad_flags_str); personality(saved_pers); - printf("personality\\([^)]*\\) = %#x \\(%s\\|%s\\|%s\\)\n", + printf("personality\\([^)]*\\) = %#x \\(%s\\|%s\\)\n", bad_type | good_flags | bad_flags, - bad_type_str, good_flags_str, bad_flags_str); + bad_type_str, good_bad_flags_str); return 0; } diff --git a/tests-m32/personality.test b/tests-m32/personality.test index 8f8c0adb..6d2b65c7 100755 --- a/tests-m32/personality.test +++ b/tests-m32/personality.test @@ -1,12 +1,14 @@ #!/bin/sh - +# # Check personality syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog > /dev/null -run_strace -a20 -epersonality $args > "$OUT" -match_grep "$LOG" "$OUT" -rm -f "$OUT" - -exit 0 +run_strace -a20 -epersonality "$@" $args > "$EXP" +match_grep "$LOG" "$EXP" diff --git a/tests-m32/pidfd_send_signal.c b/tests-m32/pidfd_send_signal.c new file mode 100644 index 00000000..014e43de --- /dev/null +++ b/tests-m32/pidfd_send_signal.c @@ -0,0 +1,71 @@ +/* + * Check decoding of pidfd_send_signal syscall. + * + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include "scno.h" + +#ifdef __NR_pidfd_send_signal + +# include +# include +# include + +static const char *errstr; + +static long +sys_pidfd_send_signal(int pidfd, int sig, const void *info, int flags) +{ + kernel_ulong_t fill = (kernel_ulong_t) 0xdefaced00000000ULL; + kernel_ulong_t arg1 = fill | (unsigned int) pidfd; + kernel_ulong_t arg2 = fill | (unsigned int) sig; + kernel_ulong_t arg3 = (unsigned long) info; + kernel_ulong_t arg4 = fill | (unsigned int) flags; + + long rc = syscall(__NR_pidfd_send_signal, arg1, arg2, arg3, arg4); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const char null_path[] = "/dev/null"; + + int fd = open(null_path, O_RDONLY); + if (fd < 0) + perror_msg_and_fail("open: %s", null_path); + + TAIL_ALLOC_OBJECT_CONST_PTR(siginfo_t, si); + const void *esi = (const void *) si + 1; + + sys_pidfd_send_signal(fd, SIGUSR1, esi, 0); + printf("pidfd_send_signal(%d, SIGUSR1, %p, 0) = %s\n", + fd, esi, errstr); + + si->si_signo = SIGUSR1; + si->si_code = SI_QUEUE; + + sys_pidfd_send_signal(fd, SIGUSR2, si, -1); + printf("pidfd_send_signal(%d, SIGUSR2, {si_signo=SIGUSR1" + ", si_code=SI_QUEUE, si_errno=%d, si_pid=%u, si_uid=%u" + ", si_value={int=%d, ptr=%p}}, %#x) = %s\n", + fd, si->si_errno, si->si_pid, si->si_uid, si->si_int, si->si_ptr, + -1U, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pidfd_send_signal") + +#endif diff --git a/tests-m32/pidfd_send_signal.gen.test b/tests-m32/pidfd_send_signal.gen.test new file mode 100755 index 00000000..a1e8466c --- /dev/null +++ b/tests-m32/pidfd_send_signal.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pidfd_send_signal ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/pipe.c b/tests-m32/pipe.c index 41c7f215..bdfc7565 100644 --- a/tests-m32/pipe.c +++ b/tests-m32/pipe.c @@ -2,29 +2,10 @@ * Check decoding of pipe syscall. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/pipe.test b/tests-m32/pipe.test index 0ae414d4..af70b08d 100755 --- a/tests-m32/pipe.test +++ b/tests-m32/pipe.test @@ -1,6 +1,12 @@ #!/bin/sh - +# # Check decoding of pipe syscall. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" run_prog diff --git a/tests-m32/pipe2.c b/tests-m32/pipe2.c index 375ae74f..d948a1c6 100644 --- a/tests-m32/pipe2.c +++ b/tests-m32/pipe2.c @@ -1,30 +1,10 @@ /* * Check decoding of pipe2 syscall. * - * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -39,18 +19,16 @@ int main(void) { - static const kernel_ulong_t bogus_zero = - (kernel_ulong_t) 0xffffffff00000000ULL; int *const fds = tail_alloc(sizeof(*fds) * 2); int *const efault = fds + 1; long rc; - rc = syscall(__NR_pipe2, fds, bogus_zero | O_NONBLOCK); + rc = syscall(__NR_pipe2, fds, F8ILL_KULONG_MASK | O_NONBLOCK); if (rc) perror_msg_and_skip("pipe2"); printf("pipe2([%d, %d], O_NONBLOCK) = 0\n", fds[0], fds[1]); - rc = syscall(__NR_pipe2, efault, bogus_zero); + rc = syscall(__NR_pipe2, efault, F8ILL_KULONG_MASK); printf("pipe2(%p, 0) = %s\n", efault, sprintrc(rc)); if (F8ILL_KULONG_SUPPORTED) { diff --git a/tests-m32/pipe2.gen.test b/tests-m32/pipe2.gen.test new file mode 100755 index 00000000..50b8fd64 --- /dev/null +++ b/tests-m32/pipe2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pipe2 -a15 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests-m32/pipe2.test b/tests-m32/pipe2.test deleted file mode 100755 index aff6cd44..00000000 --- a/tests-m32/pipe2.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of pipe2 syscall. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a15 diff --git a/tests-m32/pipe_maxfd.c b/tests-m32/pipe_maxfd.c index a1343f91..a4ec48c4 100644 --- a/tests-m32/pipe_maxfd.c +++ b/tests-m32/pipe_maxfd.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/pkey_alloc.c b/tests-m32/pkey_alloc.c index 45772787..6a92be40 100644 --- a/tests-m32/pkey_alloc.c +++ b/tests-m32/pkey_alloc.c @@ -2,29 +2,10 @@ * Check decoding of pkey_alloc syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -53,10 +34,12 @@ main(void) sizeof(kernel_ulong_t) > sizeof(int) ? "PKEY_DISABLE_WRITE|0xbadc0ded00000000" : "PKEY_DISABLE_WRITE" }, - { 0xdec0ded, "PKEY_DISABLE_ACCESS|0xdec0dec" }, - { 0x3, "PKEY_DISABLE_ACCESS|PKEY_DISABLE_WRITE" }, + { 0xdec0ded, "PKEY_DISABLE_ACCESS|PKEY_DISABLE_EXECUTE|" + "0xdec0de8" }, + { 0x7, "PKEY_DISABLE_ACCESS|PKEY_DISABLE_WRITE|" + "PKEY_DISABLE_EXECUTE" }, { ARG_STR(0) }, - { 0xbadc0dec, "0xbadc0dec /* PKEY_??? */" }, + { 0xbadc0de8, "0xbadc0de8 /* PKEY_??? */" }, }; long rc; diff --git a/tests-m32/pkey_alloc.gen.test b/tests-m32/pkey_alloc.gen.test new file mode 100755 index 00000000..fb554efc --- /dev/null +++ b/tests-m32/pkey_alloc.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pkey_alloc -a17 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-m32/pkey_alloc.test b/tests-m32/pkey_alloc.test deleted file mode 100755 index f168c21a..00000000 --- a/tests-m32/pkey_alloc.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of pkey_alloc syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a17 diff --git a/tests-m32/pkey_free.c b/tests-m32/pkey_free.c index 95a2ad26..7bcb3f9a 100644 --- a/tests-m32/pkey_free.c +++ b/tests-m32/pkey_free.c @@ -2,29 +2,10 @@ * Check decoding of pkey_free syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/pkey_free.gen.test b/tests-m32/pkey_free.gen.test new file mode 100755 index 00000000..0374cc73 --- /dev/null +++ b/tests-m32/pkey_free.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pkey_free -a13 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 diff --git a/tests-m32/pkey_free.test b/tests-m32/pkey_free.test deleted file mode 100755 index 9c01c3e7..00000000 --- a/tests-m32/pkey_free.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of pkey_free syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a13 diff --git a/tests-m32/pkey_mprotect.c b/tests-m32/pkey_mprotect.c index 529abd1f..c9c96daa 100644 --- a/tests-m32/pkey_mprotect.c +++ b/tests-m32/pkey_mprotect.c @@ -2,29 +2,10 @@ * Check decoding of pkey_mprotect syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/pkey_mprotect.gen.test b/tests-m32/pkey_mprotect.gen.test new file mode 100755 index 00000000..11a902a5 --- /dev/null +++ b/tests-m32/pkey_mprotect.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pkey_mprotect -a37 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a37 diff --git a/tests-m32/pkey_mprotect.test b/tests-m32/pkey_mprotect.test deleted file mode 100755 index 922d4919..00000000 --- a/tests-m32/pkey_mprotect.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of pkey_mprotect syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a37 diff --git a/tests-m32/poll-P.c b/tests-m32/poll-P.c new file mode 100644 index 00000000..7bbeb795 --- /dev/null +++ b/tests-m32/poll-P.c @@ -0,0 +1,2 @@ +#define PATH_TRACING_FD 9 +#include "poll.c" diff --git a/tests-m32/poll-P.test b/tests-m32/poll-P.test new file mode 100755 index 00000000..8ba2d303 --- /dev/null +++ b/tests-m32/poll-P.test @@ -0,0 +1,22 @@ +#!/bin/sh +# +# Check path tracing of poll syscall. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a16 -vepoll -P /dev/full 9>>/dev/full \ + $args > "$EXP" +match_diff "$LOG" "$EXP" + +for abbrev in 0 1 2 3 4 5; do + run_prog "../$NAME" $abbrev > /dev/null + run_strace -a16 -epoll -s$abbrev -P /dev/full 9>>/dev/full \ + $args > "$EXP" + match_diff "$LOG" "$EXP" +done diff --git a/tests-m32/poll.c b/tests-m32/poll.c index c47c97e5..c08bee8e 100644 --- a/tests-m32/poll.c +++ b/tests-m32/poll.c @@ -1,30 +1,10 @@ /* - * This file is part of poll strace test. + * Check decoding of poll syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -37,15 +17,18 @@ # include # include # include +# include # include -#define PRINT_EVENT(flag, member) \ - if (member & flag) { \ - if (member != pfd->member) \ - tprintf("|"); \ - tprintf(#flag); \ - member &= ~flag; \ - } +# define PRINT_EVENT(flag, member) \ + do { \ + if (member & flag) { \ + if (member != pfd->member) \ + tprintf("|"); \ + tprintf(#flag); \ + member &= ~flag; \ + } \ + } while (0) static void print_pollfd_entering(const struct pollfd *const pfd) @@ -56,24 +39,24 @@ print_pollfd_entering(const struct pollfd *const pfd) short events = pfd->events; if (pfd->events) { - PRINT_EVENT(POLLIN, events) - PRINT_EVENT(POLLPRI, events) - PRINT_EVENT(POLLOUT, events) -#ifdef POLLRDNORM - PRINT_EVENT(POLLRDNORM, events) -#endif -#ifdef POLLWRNORM - PRINT_EVENT(POLLWRNORM, events) -#endif -#ifdef POLLRDBAND - PRINT_EVENT(POLLRDBAND, events) -#endif -#ifdef POLLWRBAND - PRINT_EVENT(POLLWRBAND, events) -#endif - PRINT_EVENT(POLLERR, events) - PRINT_EVENT(POLLHUP, events) - PRINT_EVENT(POLLNVAL, events) + PRINT_EVENT(POLLIN, events); + PRINT_EVENT(POLLPRI, events); + PRINT_EVENT(POLLOUT, events); +# ifdef POLLRDNORM + PRINT_EVENT(POLLRDNORM, events); +# endif +# ifdef POLLWRNORM + PRINT_EVENT(POLLWRNORM, events); +# endif +# ifdef POLLRDBAND + PRINT_EVENT(POLLRDBAND, events); +# endif +# ifdef POLLWRBAND + PRINT_EVENT(POLLWRBAND, events); +# endif + PRINT_EVENT(POLLERR, events); + PRINT_EVENT(POLLHUP, events); + PRINT_EVENT(POLLNVAL, events); } else tprintf("0"); } @@ -92,7 +75,7 @@ print_pollfd_array_entering(const struct pollfd *const pfd, if (i) tprintf(", "); if (i >= valid) { - tprintf("%p", &pfd[i]); + tprintf("... /* %p */", &pfd[i]); break; } if (i >= abbrev) { @@ -123,24 +106,24 @@ print_pollfd_exiting(const struct pollfd *const pfd, tprintf("{fd=%d, revents=", pfd->fd); short revents = pfd->revents; - PRINT_EVENT(POLLIN, revents) - PRINT_EVENT(POLLPRI, revents) - PRINT_EVENT(POLLOUT, revents) -#ifdef POLLRDNORM - PRINT_EVENT(POLLRDNORM, revents) -#endif -#ifdef POLLWRNORM - PRINT_EVENT(POLLWRNORM, revents) -#endif -#ifdef POLLRDBAND - PRINT_EVENT(POLLRDBAND, revents) -#endif -#ifdef POLLWRBAND - PRINT_EVENT(POLLWRBAND, revents) -#endif - PRINT_EVENT(POLLERR, revents) - PRINT_EVENT(POLLHUP, revents) - PRINT_EVENT(POLLNVAL, revents) + PRINT_EVENT(POLLIN, revents); + PRINT_EVENT(POLLPRI, revents); + PRINT_EVENT(POLLOUT, revents); +# ifdef POLLRDNORM + PRINT_EVENT(POLLRDNORM, revents); +# endif +# ifdef POLLWRNORM + PRINT_EVENT(POLLWRNORM, revents); +# endif +# ifdef POLLRDBAND + PRINT_EVENT(POLLRDBAND, revents); +# endif +# ifdef POLLWRBAND + PRINT_EVENT(POLLWRBAND, revents); +# endif + PRINT_EVENT(POLLERR, revents); + PRINT_EVENT(POLLHUP, revents); + PRINT_EVENT(POLLNVAL, revents); tprintf("}"); } @@ -160,12 +143,19 @@ print_pollfd_array_exiting(const struct pollfd *const pfd, int main(int ac, char **av) { +# ifdef PATH_TRACING_FD + skip_if_unavailable("/proc/self/fd/"); +# endif + tprintf("%s", ""); assert(syscall(__NR_poll, NULL, 42, 0) == -1); if (ENOSYS == errno) perror_msg_and_skip("poll"); + +# ifndef PATH_TRACING_FD tprintf("poll(NULL, 42, 0) = -1 EFAULT (%m)\n"); +# endif int fds[2]; if (pipe(fds) || pipe(fds)) @@ -184,17 +174,22 @@ main(int ac, char **av) int rc = syscall(__NR_poll, tail_fds0, 0, timeout); assert(rc == 0); +# ifndef PATH_TRACING_FD tprintf("poll([], 0, %d) = %d (Timeout)\n", timeout, rc); +# endif rc = syscall(__NR_poll, tail_fds0, ARRAY_SIZE(pfds0), timeout); assert(rc == 3); +# ifndef PATH_TRACING_FD tprintf("poll("); print_pollfd_array_entering(tail_fds0, ARRAY_SIZE(pfds0), ARRAY_SIZE(pfds0), abbrev); - tprintf(", %u, %d) = %d (", ARRAY_SIZE(pfds0), timeout, rc); + tprintf(", %u, %d) = %d (", + (unsigned int) ARRAY_SIZE(pfds0), timeout, rc); print_pollfd_array_exiting(tail_fds0, ARRAY_SIZE(pfds0), abbrev); tprintf(")\n"); +# endif /* !PATH_TRACING_FD */ tail_fds0[0].fd = -1; tail_fds0[2].fd = -3; @@ -202,24 +197,30 @@ main(int ac, char **av) rc = syscall(__NR_poll, tail_fds0, ARRAY_SIZE(pfds0), timeout); assert(rc == 2); +# ifndef PATH_TRACING_FD tprintf("poll("); print_pollfd_array_entering(tail_fds0, ARRAY_SIZE(pfds0), ARRAY_SIZE(pfds0), abbrev); - tprintf(", %u, %d) = %d (", ARRAY_SIZE(pfds0), timeout, rc); + tprintf(", %u, %d) = %d (", + (unsigned int) ARRAY_SIZE(pfds0), timeout, rc); print_pollfd_array_exiting(tail_fds0, ARRAY_SIZE(pfds0), abbrev); tprintf(")\n"); +# endif /* !PATH_TRACING_FD */ tail_fds0[1].fd = -2; tail_fds0[4].fd = -5; rc = syscall(__NR_poll, tail_fds0, ARRAY_SIZE(pfds0), timeout); assert(rc == 1); +# ifndef PATH_TRACING_FD tprintf("poll("); print_pollfd_array_entering(tail_fds0, ARRAY_SIZE(pfds0), ARRAY_SIZE(pfds0), abbrev); - tprintf(", %u, %d) = %d (", ARRAY_SIZE(pfds0), timeout, rc); + tprintf(", %u, %d) = %d (", + (unsigned int) ARRAY_SIZE(pfds0), timeout, rc); print_pollfd_array_exiting(tail_fds0, ARRAY_SIZE(pfds0), abbrev); tprintf(")\n"); +# endif /* !PATH_TRACING_FD */ struct pollfd pfds1[] = { { .fd = 1, .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, @@ -229,24 +230,58 @@ main(int ac, char **av) rc = syscall(__NR_poll, tail_fds1, ARRAY_SIZE(pfds1), timeout); assert(rc == 0); +# ifndef PATH_TRACING_FD tprintf("poll("); print_pollfd_array_entering(tail_fds1, ARRAY_SIZE(pfds1), ARRAY_SIZE(pfds1), abbrev); - tprintf(", %u, %d) = %d (Timeout)\n", ARRAY_SIZE(pfds1), timeout, rc); + tprintf(", %u, %d) = %d (Timeout)\n", + (unsigned int) ARRAY_SIZE(pfds1), timeout, rc); +# endif /* !PATH_TRACING_FD */ const void *const efault = tail_fds0 + ARRAY_SIZE(pfds0); rc = syscall(__NR_poll, efault, 1, 0); assert(rc == -1); + +# ifndef PATH_TRACING_FD tprintf("poll(%p, 1, 0) = -1 EFAULT (%m)\n", efault); +# endif const unsigned int valid = 1; const void *const epfds = tail_fds0 + ARRAY_SIZE(pfds0) - valid; rc = syscall(__NR_poll, epfds, valid + 1, 0); assert(rc == -1); + +# ifndef PATH_TRACING_FD + tprintf("poll("); + print_pollfd_array_entering(epfds, valid + 1, valid, abbrev); + errno = EFAULT; + tprintf(", %u, 0) = -1 EFAULT (%m)\n", valid + 1); +# endif /* !PATH_TRACING_FD */ + +# ifdef PATH_TRACING_FD + memcpy(tail_fds0, pfds0, sizeof(pfds0)); + tail_fds0[4].fd = PATH_TRACING_FD; + + rc = syscall(__NR_poll, tail_fds0, ARRAY_SIZE(pfds0), timeout); + assert(rc == 3); + + tprintf("poll("); + print_pollfd_array_entering(tail_fds0, ARRAY_SIZE(pfds0), + ARRAY_SIZE(pfds0), abbrev); + tprintf(", %u, %d) = %d (", + (unsigned int) ARRAY_SIZE(pfds0), timeout, rc); + print_pollfd_array_exiting(tail_fds0, ARRAY_SIZE(pfds0), abbrev); + tprintf(")\n"); + + rc = syscall(__NR_poll, epfds, valid + 1, 0); + assert(rc == -1); + + /* the 1st pollfd element is readable and contains PATH_TRACING_FD */ tprintf("poll("); print_pollfd_array_entering(epfds, valid + 1, valid, abbrev); errno = EFAULT; tprintf(", %u, 0) = -1 EFAULT (%m)\n", valid + 1); +# endif /* PATH_TRACING_FD */ tprintf("+++ exited with 0 +++\n"); return 0; diff --git a/tests-m32/poll.test b/tests-m32/poll.test index b74be29e..0e8691e2 100755 --- a/tests-m32/poll.test +++ b/tests-m32/poll.test @@ -1,17 +1,20 @@ #!/bin/sh - +# # Check poll syscall decoding. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog > /dev/null -run_strace -a16 -vepoll $args > "$OUT" -match_diff "$LOG" "$OUT" +run_strace -a16 -vepoll $args > "$EXP" +match_diff "$LOG" "$EXP" for abbrev in 0 1 2 3 4 5; do - run_prog "./$NAME" $abbrev > /dev/null - run_strace -a16 -epoll -s$abbrev $args > "$OUT" - match_diff "$LOG" "$OUT" + run_prog "../$NAME" $abbrev > /dev/null + run_strace -a16 -epoll -s$abbrev $args > "$EXP" + match_diff "$LOG" "$EXP" done - -rm -f "$OUT" diff --git a/tests-m32/ppoll-P.c b/tests-m32/ppoll-P.c new file mode 100644 index 00000000..c2c572e2 --- /dev/null +++ b/tests-m32/ppoll-P.c @@ -0,0 +1,2 @@ +#define PATH_TRACING_FD 9 +#include "ppoll.c" diff --git a/tests-m32/ppoll-P.gen.test b/tests-m32/ppoll-P.gen.test new file mode 100755 index 00000000..25a97048 --- /dev/null +++ b/tests-m32/ppoll-P.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ppoll-P -s2 -e trace=ppoll -P /dev/full 9>>/dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s2 -e trace=ppoll -P /dev/full 9>>/dev/full diff --git a/tests-m32/ppoll-v.c b/tests-m32/ppoll-v.c new file mode 100644 index 00000000..cf4fdea7 --- /dev/null +++ b/tests-m32/ppoll-v.c @@ -0,0 +1,3 @@ +/* This file is part of ppoll-v strace test. */ +#define VERBOSE 1 +#include "ppoll.c" diff --git a/tests-m32/ppoll-v.expected b/tests-m32/ppoll-v.expected deleted file mode 100644 index 31070ad1..00000000 --- a/tests-m32/ppoll-v.expected +++ /dev/null @@ -1,3 +0,0 @@ -ppoll\(\[\{fd=0, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=1, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}, \{fd=3, events=POLLIN\|POLLPRI\}, \{fd=4, events=POLLOUT\}\], 4, \{tv_sec=42, tv_nsec=999999999\}, \[(USR2 CHLD|CHLD USR2)\], (4|8|16)\) = 2 \(\[\{fd=1, revents=POLLOUT(\|POLLWRNORM)?\}, \{fd=4, revents=POLLOUT\}\], left \{tv_sec=42, tv_nsec=9[0-9]{8}\}\) -ppoll\(\[\{fd=1, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=0, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}\], 2, \{tv_sec=0, tv_nsec=999\}, ~\[HUP KILL STOP[^]]*\], (4|8|16)\) = 0 \(Timeout\) -ppoll\(NULL, 42, NULL, NULL, (4|8|16)\) = -1 EFAULT .* diff --git a/tests-m32/ppoll-v.gen.test b/tests-m32/ppoll-v.gen.test new file mode 100755 index 00000000..cd1fcc60 --- /dev/null +++ b/tests-m32/ppoll-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ppoll-v -v -s2 -e trace=ppoll); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -s2 -e trace=ppoll diff --git a/tests-m32/ppoll.c b/tests-m32/ppoll.c index 46d7e816..e7a4474f 100644 --- a/tests-m32/ppoll.c +++ b/tests-m32/ppoll.c @@ -1,94 +1,221 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin - * All rights reserved. + * Check decoding of ppoll syscall. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" -#include -#include -#include -#include +#include + +#ifdef __NR_ppoll + +# include +# include +# include +# include +# include +# include + +static const char *errstr; -static void -test1(void) +static long +sys_ppoll(const kernel_ulong_t ufds, + const kernel_ulong_t nfds, + const kernel_ulong_t tsp, + const kernel_ulong_t sigmask, + const kernel_ulong_t sigsetsize) { - const struct timespec timeout = { .tv_sec = 42, .tv_nsec = 999999999 }; - struct pollfd fds[] = { - { .fd = 0, .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, - { .fd = 1, .events = POLLOUT | POLLWRNORM | POLLWRBAND }, - { .fd = 3, .events = POLLIN | POLLPRI }, - { .fd = 4, .events = POLLOUT } - }; + long rc = syscall(__NR_ppoll, ufds, nfds, tsp, sigmask, sigsetsize); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ +# ifdef PATH_TRACING_FD + skip_if_unavailable("/proc/self/fd/"); +# endif + static const kernel_ulong_t bogus_nfds = + (kernel_ulong_t) 0xdeadbeeffacefeedULL; + static const kernel_ulong_t bogus_sigsetsize = + (kernel_ulong_t) 0xdeadbeefbadc0dedULL; + static const char *const POLLWRNORM_str = + (POLLWRNORM == POLLOUT) ? "" : "|POLLWRNORM"; + static const char *const USR2_CHLD_str = + (SIGUSR2 < SIGCHLD) ? "USR2 CHLD" : "CHLD USR2"; + void *const efault = tail_alloc(1024) + 1024; + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, ts); + const unsigned int sigset_size = get_sigset_size(); + void *const sigmask = tail_alloc(sigset_size); + struct pollfd *fds; sigset_t mask; + int pipe_fd[4]; + long rc; + + sys_ppoll(0, bogus_nfds, 0, 0, bogus_sigsetsize); + if (ENOSYS == errno) + perror_msg_and_skip("ppoll"); +# ifndef PATH_TRACING_FD + printf("ppoll(NULL, %u, NULL, NULL, %llu) = %s\n", + (unsigned) bogus_nfds, (unsigned long long) bogus_sigsetsize, + errstr); +# endif + + sys_ppoll((unsigned long) efault, 42, (unsigned long) efault + 8, + (unsigned long) efault + 16, sigset_size); +# ifndef PATH_TRACING_FD + printf("ppoll(%p, %u, %p, %p, %u) = %s\n", + efault, 42, efault + 8, efault + 16, sigset_size, errstr); +# endif + + ts->tv_sec = 0xdeadbeefU; + ts->tv_nsec = 0xfacefeedU; + sys_ppoll(0, 0, (unsigned long) ts, 0, sigset_size); +# ifndef PATH_TRACING_FD + printf("ppoll(NULL, 0, {tv_sec=%lld, tv_nsec=%llu}, NULL, %u) = %s\n", + (long long) ts->tv_sec, zero_extend_signed_to_ull(ts->tv_nsec), + sigset_size, errstr); +# endif + + ts->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + ts->tv_nsec = (long) 0xbadc0dedfacefeedL; + sys_ppoll(0, 0, (unsigned long) ts, 0, sigset_size); +# ifndef PATH_TRACING_FD + printf("ppoll(NULL, 0, {tv_sec=%lld, tv_nsec=%llu}, NULL, %u) = %s\n", + (long long) ts->tv_sec, zero_extend_signed_to_ull(ts->tv_nsec), + sigset_size, errstr); +# endif + + if (pipe(pipe_fd) || pipe(pipe_fd + 2)) + perror_msg_and_fail("pipe"); + + ts->tv_sec = 42; + ts->tv_nsec = 999999999; + + const struct pollfd fds1[] = { + { .fd = pipe_fd[0], .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, + { .fd = pipe_fd[1], .events = POLLOUT | POLLWRNORM | POLLWRBAND }, + { .fd = pipe_fd[2], .events = POLLIN | POLLPRI }, + { .fd = pipe_fd[3], .events = POLLOUT } + }; + fds = efault - sizeof(fds1); + memcpy(fds, fds1, sizeof(fds1)); + sigemptyset(&mask); sigaddset(&mask, SIGUSR2); sigaddset(&mask, SIGCHLD); + memcpy(sigmask, &mask, sigset_size); - int rc = ppoll(fds, sizeof(fds) / sizeof(*fds), &timeout, &mask); - if (rc < 0) - perror_msg_and_skip("ppoll"); - assert(rc == 2); -} + rc = sys_ppoll((unsigned long) fds, + F8ILL_KULONG_MASK | ARRAY_SIZE(fds1), (unsigned long) ts, + (unsigned long) sigmask, sigset_size); + if (rc != 2) + perror_msg_and_fail("ppoll 1"); +# ifndef PATH_TRACING_FD + printf("ppoll([{fd=%d, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}" + ", {fd=%d, events=POLLOUT%s|POLLWRBAND}" +# if VERBOSE + ", {fd=%d, events=POLLIN|POLLPRI}, {fd=%d, events=POLLOUT}]" +# else + ", ...]" +# endif + ", %u, {tv_sec=42, tv_nsec=999999999}, [%s], %u) = %ld" + " ([{fd=%d, revents=POLLOUT%s}, {fd=%d, revents=POLLOUT}]" + ", left {tv_sec=%u, tv_nsec=%u})\n", + pipe_fd[0], pipe_fd[1], POLLWRNORM_str, +# if VERBOSE + pipe_fd[2], pipe_fd[3], +# endif + (unsigned int) ARRAY_SIZE(fds1), USR2_CHLD_str, + (unsigned int) sigset_size, rc, pipe_fd[1], POLLWRNORM_str, + pipe_fd[3], (unsigned int) ts->tv_sec, + (unsigned int) ts->tv_nsec); +# endif /* !PATH_TRACING_FD */ -static void -test2(void) -{ - const struct timespec timeout = { .tv_sec = 0, .tv_nsec = 999 }; - struct pollfd fds[] = { - { .fd = 1, .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, - { .fd = 0, .events = POLLOUT | POLLWRNORM | POLLWRBAND } +# ifdef PATH_TRACING_FD + ts->tv_sec = 123; + ts->tv_nsec = 987654321; + fds[3].fd = PATH_TRACING_FD; + + rc = sys_ppoll((unsigned long) fds, + F8ILL_KULONG_MASK | ARRAY_SIZE(fds1), (unsigned long) ts, + (unsigned long) sigmask, sigset_size); + if (rc != 2) + perror_msg_and_fail("ppoll -P"); + printf("ppoll([{fd=%d, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}" + ", {fd=%d, events=POLLOUT%s|POLLWRBAND}" +# if VERBOSE + ", {fd=%d, events=POLLIN|POLLPRI}, {fd=%d, events=POLLOUT}]" +# else + ", ...]" +# endif + ", %u, {tv_sec=123, tv_nsec=987654321}, [%s], %u) = %ld" + " ([{fd=%d, revents=POLLOUT%s}, {fd=%d, revents=POLLOUT}]" + ", left {tv_sec=%u, tv_nsec=%u})\n", + pipe_fd[0], pipe_fd[1], POLLWRNORM_str, +# if VERBOSE + pipe_fd[2], PATH_TRACING_FD, +# endif + (unsigned int) ARRAY_SIZE(fds1), USR2_CHLD_str, + (unsigned int) sigset_size, rc, pipe_fd[1], POLLWRNORM_str, + PATH_TRACING_FD, (unsigned int) ts->tv_sec, + (unsigned int) ts->tv_nsec); +# endif /* PATH_TRACING_FD */ + + ts->tv_sec = 0; + ts->tv_nsec = 999; + const struct pollfd fds2[] = { + { .fd = pipe_fd[1], .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, + { .fd = pipe_fd[0], .events = POLLOUT | POLLWRNORM | POLLWRBAND } }; + fds = efault - sizeof(fds2); + memcpy(fds, fds2, sizeof(fds2)); - sigset_t mask; - sigfillset(&mask); + memset(&mask, -1, sizeof(mask)); sigdelset(&mask, SIGHUP); sigdelset(&mask, SIGKILL); sigdelset(&mask, SIGSTOP); + memcpy(sigmask, &mask, sigset_size); - int rc = ppoll(fds, sizeof(fds) / sizeof(*fds), &timeout, &mask); - if (rc < 0) - perror_msg_and_skip("ppoll"); - assert(rc == 0); -} + rc = sys_ppoll((unsigned long) fds, + F8ILL_KULONG_MASK | ARRAY_SIZE(fds2), (unsigned long) ts, + (unsigned long) sigmask, sigset_size); + if (rc != 0) + perror_msg_and_fail("ppoll 2"); +# ifndef PATH_TRACING_FD + printf("ppoll([{fd=%d, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}" + ", {fd=%d, events=POLLOUT%s|POLLWRBAND}], %u" + ", {tv_sec=0, tv_nsec=999}, ~[HUP KILL STOP], %u)" + " = %ld (Timeout)\n", + pipe_fd[1], pipe_fd[0], POLLWRNORM_str, + (unsigned) ARRAY_SIZE(fds2), sigset_size, rc); +# endif /* !PATH_TRACING_FD */ -int -main(void) -{ - int fds[2]; - - (void) close(0); - (void) close(1); - (void) close(3); - (void) close(4); - if (pipe(fds) || pipe(fds)) - perror_msg_and_fail("pipe"); + if (F8ILL_KULONG_SUPPORTED) { + sys_ppoll(f8ill_ptr_to_kulong(fds), ARRAY_SIZE(fds2), + f8ill_ptr_to_kulong(ts), f8ill_ptr_to_kulong(sigmask), + sigset_size); +# ifndef PATH_TRACING_FD + printf("ppoll(%#llx, %u, %#llx, %#llx, %u) = %s\n", + (unsigned long long) f8ill_ptr_to_kulong(fds), + (unsigned) ARRAY_SIZE(fds2), + (unsigned long long) f8ill_ptr_to_kulong(ts), + (unsigned long long) f8ill_ptr_to_kulong(sigmask), + (unsigned) sigset_size, errstr); +# endif /* !PATH_TRACING_FD */ + } - test1(); - test2(); - - assert(ppoll(NULL, 42, NULL, NULL) < 0); + puts("+++ exited with 0 +++"); return 0; } + +#else + +SKIP_MAIN_UNDEFINED("__NR_ppoll") + +#endif diff --git a/tests-m32/ppoll.expected b/tests-m32/ppoll.expected deleted file mode 100644 index c38a2062..00000000 --- a/tests-m32/ppoll.expected +++ /dev/null @@ -1,3 +0,0 @@ -ppoll\(\[\{fd=0, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=1, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}, \.\.\.\], 4, \{tv_sec=42, tv_nsec=999999999\}, \[(USR2 CHLD|CHLD USR2)\], (4|8|16)\) = 2 \(\[\{fd=1, revents=POLLOUT(\|POLLWRNORM)?\}, \{fd=4, revents=POLLOUT\}\], left \{tv_sec=42, tv_nsec=9[0-9]{8}\}\) -ppoll\(\[\{fd=1, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=0, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}\], 2, \{tv_sec=0, tv_nsec=999\}, ~\[HUP KILL STOP[^]]*\], (4|8|16)\) = 0 \(Timeout\) -ppoll\(NULL, 42, NULL, NULL, (4|8|16)\) = -1 EFAULT .* diff --git a/tests-m32/ppoll.gen.test b/tests-m32/ppoll.gen.test new file mode 100755 index 00000000..120e9536 --- /dev/null +++ b/tests-m32/ppoll.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ppoll -s2 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s2 diff --git a/tests-m32/ppoll.test b/tests-m32/ppoll.test deleted file mode 100755 index 98389ee6..00000000 --- a/tests-m32/ppoll.test +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -# Check ppoll syscall decoding. - -. "${srcdir=.}/init.sh" - -run_prog -run_strace -a30 -s2 -e ppoll $args -match_grep -run_strace -a30 -v -s2 -e ppoll $args -match_grep "$LOG" "$srcdir/$NAME-v.expected" - -exit 0 diff --git a/tests-m32/prctl-arg2-intptr.c b/tests-m32/prctl-arg2-intptr.c index ee000ebe..be894270 100644 --- a/tests-m32/prctl-arg2-intptr.c +++ b/tests-m32/prctl-arg2-intptr.c @@ -4,29 +4,10 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -70,7 +51,7 @@ main(void) { 11, "PR_GET_FPEXC" }, }; - unsigned int *ptr = tail_alloc(sizeof(*ptr)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, ptr); long rc; unsigned int i; diff --git a/tests-m32/prctl-arg2-intptr.test b/tests-m32/prctl-arg2-intptr.test index bcef8065..feb5a2b9 100755 --- a/tests-m32/prctl-arg2-intptr.test +++ b/tests-m32/prctl-arg2-intptr.test @@ -1,7 +1,13 @@ #!/bin/sh - +# # Check decoding of prctl PR_GET_CHILD_SUBREAPER, PR_GET_ENDIAN, PR_GET_FPEMU, # and PR_GET_FPEXC operations. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" check_prog grep @@ -10,5 +16,3 @@ run_strace -a25 -eprctl $args > "$EXP" LC_ALL=C grep -Ev '^prctl\(PR_[GS]ET_([^CEF]|.[^HNP]|..[^DEI])' \ < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-m32/prctl-dumpable.c b/tests-m32/prctl-dumpable.c index 1049bcee..7740d52a 100644 --- a/tests-m32/prctl-dumpable.c +++ b/tests-m32/prctl-dumpable.c @@ -3,36 +3,18 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include #include -#if defined __NR_prctl && defined PR_GET_DUMPABLE && defined PR_SET_DUMPABLE +#if defined __NR_prctl && defined PR_GET_DUMPABLE && defined PR_SET_DUMPABLE \ + && !defined __ia64__ # include # include @@ -101,6 +83,7 @@ main(void) #else -SKIP_MAIN_UNDEFINED("__NR_prctl && PR_GET_DUMPABLE && PR_SET_DUMPABLE") +SKIP_MAIN_UNDEFINED("__NR_prctl && PR_GET_DUMPABLE && PR_SET_DUMPABLE" + " && !__ia64__") #endif diff --git a/tests-m32/prctl-dumpable.test b/tests-m32/prctl-dumpable.test index 08acb8b9..8662f79c 100755 --- a/tests-m32/prctl-dumpable.test +++ b/tests-m32/prctl-dumpable.test @@ -1,6 +1,12 @@ #!/bin/sh - +# # Check decoding of prctl PR_GET_DUMPABLE and PR_SET_DUMPABLE operations. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" check_prog grep @@ -8,5 +14,3 @@ run_prog > /dev/null run_strace -a23 -eprctl $args > "$EXP" grep -v '^prctl(PR_[GS]ET_[^D][^U]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-m32/prctl-name.c b/tests-m32/prctl-name.c index 308c275f..16d85911 100644 --- a/tests-m32/prctl-name.c +++ b/tests-m32/prctl-name.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/prctl-name.test b/tests-m32/prctl-name.test index 071179c5..b19efc0f 100755 --- a/tests-m32/prctl-name.test +++ b/tests-m32/prctl-name.test @@ -1,6 +1,12 @@ #!/bin/sh - +# # Check decoding of prctl PR_GET_NAME/PR_SET_NAME operations. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" check_prog grep @@ -8,5 +14,3 @@ run_prog > /dev/null run_strace -a23 -eprctl $args > "$EXP" grep -v '^prctl(PR_GET_[^N][^A]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-m32/prctl-no-args.c b/tests-m32/prctl-no-args.c index 57e1b733..8ce13d80 100644 --- a/tests-m32/prctl-no-args.c +++ b/tests-m32/prctl-no-args.c @@ -4,29 +4,10 @@ * PR_TASK_PERF_EVENTS_DISABLE, and PR_TASK_PERF_EVENTS_ENABLE. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -57,7 +38,7 @@ main(void) { 32, "PR_TASK_PERF_EVENTS_ENABLE" }, }; - unsigned int *ptr = tail_alloc(sizeof(*ptr)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, ptr); unsigned int i; for (i = 0; i < ARRAY_SIZE(options); i++) { diff --git a/tests-m32/prctl-no-args.test b/tests-m32/prctl-no-args.test index ce8ca67b..72d0f525 100755 --- a/tests-m32/prctl-no-args.test +++ b/tests-m32/prctl-no-args.test @@ -1,8 +1,14 @@ #!/bin/sh - +# # Check decoding of prctl PR_GET_KEEPCAPS, PR_GET_SECCOMP, PR_GET_TIMERSLACK, # PR_GET_TIMING, PR_TASK_PERF_EVENTS_DISABLE, and PR_TASK_PERF_EVENTS_ENABLE # operations. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" check_prog grep @@ -10,5 +16,3 @@ run_prog > /dev/null run_strace -a21 -eprctl $args > "$EXP" grep -v '^prctl(PR_[GS]ET_[^KST][^EI][^CEM]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-m32/prctl-pdeathsig.c b/tests-m32/prctl-pdeathsig.c index c1760307..6ffbbad7 100644 --- a/tests-m32/prctl-pdeathsig.c +++ b/tests-m32/prctl-pdeathsig.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 JingPiao Chen * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -44,7 +25,7 @@ main(void) static const kernel_ulong_t bogus_signal = (kernel_ulong_t) 0xbadc0deddeadfeedULL; - int *pdeathsig = tail_alloc(sizeof(*pdeathsig)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, pdeathsig); long rc; rc = syscall(__NR_prctl, PR_SET_PDEATHSIG, bogus_signal); diff --git a/tests-m32/prctl-pdeathsig.test b/tests-m32/prctl-pdeathsig.test index 2777503a..faa40dbb 100755 --- a/tests-m32/prctl-pdeathsig.test +++ b/tests-m32/prctl-pdeathsig.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check prctl PR_GET_PDEATHSIG PR_SET_PDEATHSIG decoding. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -9,5 +14,3 @@ run_prog > /dev/null run_strace -a30 -eprctl $args > "$EXP" grep -v '^prctl(PR_[GS]ET_[^P][^D]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-m32/prctl-seccomp-filter-v.c b/tests-m32/prctl-seccomp-filter-v.c index 69316fbe..f29cfad6 100644 --- a/tests-m32/prctl-seccomp-filter-v.c +++ b/tests-m32/prctl-seccomp-filter-v.c @@ -2,29 +2,10 @@ * Check verbose decoding of prctl PR_SET_SECCOMP SECCOMP_MODE_FILTER. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,9 +21,7 @@ #ifdef HAVE_LINUX_SECCOMP_H # include #endif -#ifdef HAVE_LINUX_FILTER_H -# include -#endif +#include #if defined HAVE_PRCTL \ && defined PR_SET_NO_NEW_PRIVS \ @@ -52,23 +31,23 @@ && defined BPF_JUMP \ && defined BPF_STMT -#define SOCK_FILTER_ALLOW_SYSCALL(nr) \ +# define SOCK_FILTER_ALLOW_SYSCALL(nr) \ BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW) -#define SOCK_FILTER_DENY_SYSCALL(nr, err) \ +# define SOCK_FILTER_DENY_SYSCALL(nr, err) \ BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|(SECCOMP_RET_DATA & (err))) -#define SOCK_FILTER_KILL_PROCESS \ +# define SOCK_FILTER_KILL_PROCESS \ BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL) -#define PRINT_ALLOW_SYSCALL(nr) \ +# define PRINT_ALLOW_SYSCALL(nr) \ printf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW), ", \ __NR_ ## nr) -#define PRINT_DENY_SYSCALL(nr, err) \ +# define PRINT_DENY_SYSCALL(nr, err) \ printf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|%#x), ", \ __NR_ ## nr, err) @@ -115,7 +94,7 @@ main(void) PRINT_DENY_SYSCALL(sync, EBUSY), PRINT_DENY_SYSCALL(setsid, EPERM), - printf("BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL)"); + printf("BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL_THREAD)"); puts("]}) = 0"); puts("+++ exited with 0 +++"); diff --git a/tests-m32/prctl-seccomp-filter-v.test b/tests-m32/prctl-seccomp-filter-v.test index 44e4a782..9f94a66e 100755 --- a/tests-m32/prctl-seccomp-filter-v.test +++ b/tests-m32/prctl-seccomp-filter-v.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check verbose decoding of prctl PR_SET_SECCOMP SECCOMP_MODE_FILTER. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -9,5 +14,3 @@ run_prog > /dev/null run_strace -v -eprctl $args > "$EXP" grep -v '^prctl(PR_GET_' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-m32/prctl-seccomp-strict.c b/tests-m32/prctl-seccomp-strict.c index a78f8173..0573126e 100644 --- a/tests-m32/prctl-seccomp-strict.c +++ b/tests-m32/prctl-seccomp-strict.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/prctl-seccomp-strict.test b/tests-m32/prctl-seccomp-strict.test index 1f987df7..e7e23df2 100755 --- a/tests-m32/prctl-seccomp-strict.test +++ b/tests-m32/prctl-seccomp-strict.test @@ -1,11 +1,16 @@ #!/bin/sh - +# # Check how prctl PR_SET_SECCOMP SECCOMP_MODE_STRICT is decoded. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" check_prog grep -set -- "./$NAME" +set -- "../$NAME" "$@" > /dev/null || { case $? in 77) skip_ "$* exited with code 77" ;; @@ -16,4 +21,3 @@ set -- "./$NAME" run_strace -eprctl "$@" > "$EXP" grep -v '^prctl(PR_GET_' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-m32/prctl-securebits.c b/tests-m32/prctl-securebits.c index 741973af..5b32f5b5 100644 --- a/tests-m32/prctl-securebits.c +++ b/tests-m32/prctl-securebits.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/prctl-securebits.test b/tests-m32/prctl-securebits.test index c91e62a6..e50dc2eb 100755 --- a/tests-m32/prctl-securebits.test +++ b/tests-m32/prctl-securebits.test @@ -1,6 +1,12 @@ #!/bin/sh - +# # Check decoding of prctl PR_GET_SECUREBITS/PR_SET_SECUREBITS operations. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" check_prog grep @@ -8,5 +14,3 @@ run_prog > /dev/null run_strace -a25 -eprctl $args > "$EXP" grep -v '^prctl(PR_[GS]ET_[^S][^E][^C][^U]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-m32/prctl-spec-inject.c b/tests-m32/prctl-spec-inject.c new file mode 100644 index 00000000..3fa2df2d --- /dev/null +++ b/tests-m32/prctl-spec-inject.c @@ -0,0 +1,148 @@ +/* + * Check decoding of PR_SET_SPECULATION_CTRL and PR_GET_SPECULATION_CTRL + * prctl operations. + * + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_prctl + +# include +# include +# include +# include + +static long injected_val; + +long +do_prctl(kernel_ulong_t cmd, kernel_ulong_t arg2, kernel_ulong_t arg3) +{ + long rc = syscall(__NR_prctl, cmd, arg2, arg3); + + if (rc != injected_val) + error_msg_and_fail("Return value (%ld) differs from expected " + "injected value (%ld)", + rc, injected_val); + + return rc; +} + +int +main(int argc, char **argv) +{ + static const kernel_ulong_t bogus_arg2 = + (kernel_ulong_t) 0xdeadfacebadc0dedULL; + static const kernel_ulong_t bogus_arg3 = + (kernel_ulong_t) 0xdecafeedbeefda7eULL; + + static const struct { + long arg; + const char *str; + } spec_strs[] = { + { 0, "PR_SPEC_STORE_BYPASS" }, + { 1, "PR_SPEC_INDIRECT_BRANCH" }, + }; + + static const struct { + long arg; + const char *str; + } get_strs[] = { + { -1, "" }, + { 0, " (PR_SPEC_NOT_AFFECTED)" }, + { 1, " (PR_SPEC_PRCTL)" }, + { 3, " (PR_SPEC_PRCTL|PR_SPEC_ENABLE)" }, + { 8, " (PR_SPEC_FORCE_DISABLE)" }, + { 16, " (PR_SPEC_DISABLE_NOEXEC)" }, + { 32, " (0x20)" }, + { 42, " (PR_SPEC_ENABLE|PR_SPEC_FORCE_DISABLE|0x20)" }, + }; + static const struct { + kernel_ulong_t arg; + const char *str; + } set_strs[] = { + { 0, "0 /* PR_SPEC_??? */" }, + { 1, "0x1 /* PR_SPEC_??? */" }, + { 2, "PR_SPEC_ENABLE" }, + { 3, "0x3 /* PR_SPEC_??? */" }, + { 8, "PR_SPEC_FORCE_DISABLE" }, + { 16, "PR_SPEC_DISABLE_NOEXEC" }, + { 32, "0x20 /* PR_SPEC_??? */" }, + { (kernel_ulong_t) 0xdecafeedbeefda7eULL, "0x" +# if SIZEOF_KERNEL_LONG_T == 8 + "decafeed" +# endif + "beefda7e /* PR_SPEC_??? */" }, + }; + + long rc; + const char *str = NULL; + + if (argc < 2) + error_msg_and_fail("Usage: %s INJECTED_VAL", argv[0]); + + injected_val = strtol(argv[1], NULL, 0); + + /* PR_GET_SPECULATION_CTRL */ + rc = do_prctl(52, 2, bogus_arg3); + printf("prctl(PR_GET_SPECULATION_CTRL, 0x2 /* PR_SPEC_??? */) " + "= %s (INJECTED)\n", sprintrc(rc)); + + rc = do_prctl(52, bogus_arg2, bogus_arg3); + printf("prctl(PR_GET_SPECULATION_CTRL, %#llx /* PR_SPEC_??? */) " + "= %s (INJECTED)\n", + (unsigned long long) bogus_arg2, sprintrc(rc)); + + for (unsigned c = 0; c < ARRAY_SIZE(spec_strs); c++) { + rc = do_prctl(52, spec_strs[c].arg, bogus_arg3); + + for (unsigned i = 0; i < ARRAY_SIZE(get_strs); i++) { + if (get_strs[i].arg == rc) { + str = get_strs[i].str; + break; + } + } + if (!str) + error_msg_and_fail("Unknown return value: %ld", rc); + + printf("prctl(PR_GET_SPECULATION_CTRL, %s) = %s%s (INJECTED)\n", + spec_strs[c].str, sprintrc(rc), str); + } + + + /* PR_SET_SPECULATION_CTRL*/ + rc = do_prctl(53, 2, bogus_arg3); + printf("prctl(PR_SET_SPECULATION_CTRL, 0x2 /* PR_SPEC_??? */, %#llx) " + "= %s (INJECTED)\n", + (unsigned long long) bogus_arg3, sprintrc(rc)); + + rc = do_prctl(53, bogus_arg2, bogus_arg3); + printf("prctl(PR_SET_SPECULATION_CTRL, %#llx /* PR_SPEC_??? */, %#llx) " + "= %s (INJECTED)\n", + (unsigned long long) bogus_arg2, + (unsigned long long) bogus_arg3, + sprintrc(rc)); + + for (unsigned c = 0; c < ARRAY_SIZE(spec_strs); c++) { + for (unsigned i = 0; i < ARRAY_SIZE(set_strs); i++) { + rc = do_prctl(53, spec_strs[c].arg, set_strs[i].arg); + printf("prctl(PR_SET_SPECULATION_CTRL, %s" + ", %s) = %s (INJECTED)\n", + spec_strs[c].str, set_strs[i].str, sprintrc(rc)); + } + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl") + +#endif diff --git a/tests-m32/prctl-spec-inject.test b/tests-m32/prctl-spec-inject.test new file mode 100755 index 00000000..c86fc204 --- /dev/null +++ b/tests-m32/prctl-spec-inject.test @@ -0,0 +1,35 @@ +#!/bin/sh -efu +# +# Check decoding of PR_SET_SPECULATION_CTRL and PR_GET_SPECULATION_CTRL +# prctl operations. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +fault_args='-a53 -e trace=prctl -e inject=prctl:' +prog="../$NAME" + +test_run_rval() +{ + local run rval injexpr + run="$1"; shift + rval="$1"; shift + injexpr="$1"; shift + + run_strace $fault_args$injexpr $prog $rval > "$EXP" + LC_ALL=C grep -Ev '^prctl\(PR_[GS]ET_([^S][^P][^E][^C]])' \ + < "$LOG" > "$OUT" + match_diff "$OUT" "$EXP" +} + +test_run_rval 0 -1 "error=ENOTTY" +test_run_rval 1 0 "retval=0" +test_run_rval 2 1 "retval=1" +test_run_rval 3 3 "retval=3" +test_run_rval 4 8 "retval=8" +test_run_rval 5 16 "retval=16" +test_run_rval 6 42 "retval=42" diff --git a/tests-m32/prctl-tid_address.c b/tests-m32/prctl-tid_address.c index 24e45031..9652f00d 100644 --- a/tests-m32/prctl-tid_address.c +++ b/tests-m32/prctl-tid_address.c @@ -2,29 +2,10 @@ * Check decoding of prctl PR_GET_TID_ADDRESS operation. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -59,7 +40,7 @@ main(void) (kernel_ulong_t) 0xfffffffffffffffdULL; /* Note that kernel puts kernel-sized pointer even on x32 */ - kernel_ulong_t *ptr = tail_alloc(sizeof(*ptr)); + TAIL_ALLOC_OBJECT_CONST_PTR(kernel_ulong_t, ptr); long rc; long set_ok; diff --git a/tests-m32/prctl-tid_address.test b/tests-m32/prctl-tid_address.test index dc7b7c32..f4a229f9 100755 --- a/tests-m32/prctl-tid_address.test +++ b/tests-m32/prctl-tid_address.test @@ -1,6 +1,12 @@ #!/bin/sh - +# # Check decoding of prctl PR_GET_TID_ADDRESS operation. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" check_prog grep @@ -8,5 +14,3 @@ run_prog > /dev/null run_strace -a23 -eprctl $args > "$EXP" LC_ALL=C grep -Ev '^prctl\(PR_[GS]ET_([^T]|.[^I]|..[^D])' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-m32/prctl-tsc.c b/tests-m32/prctl-tsc.c index fd9362d7..0ac27ecd 100644 --- a/tests-m32/prctl-tsc.c +++ b/tests-m32/prctl-tsc.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 JingPiao Chen * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -43,7 +24,7 @@ main(void) static const kernel_ulong_t bogus_tsc = (kernel_ulong_t) 0xdeadc0defacebeefULL; - int *tsc = tail_alloc(sizeof(*tsc)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, tsc); long rc; rc = syscall(__NR_prctl, PR_SET_TSC, 0); diff --git a/tests-m32/prctl-tsc.test b/tests-m32/prctl-tsc.test index a906ba89..6dd891d6 100755 --- a/tests-m32/prctl-tsc.test +++ b/tests-m32/prctl-tsc.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check prctl PR_GET_TSC PR_SET_TSC decoding. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -9,5 +14,3 @@ run_prog > /dev/null run_strace -a24 -eprctl $args > "$EXP" grep -v '^prctl(PR_[GS]ET_[^T][^S]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-m32/pread64-pwrite64.c b/tests-m32/pread64-pwrite64.c index 4a0932a9..83cb9bac 100644 --- a/tests-m32/pread64-pwrite64.c +++ b/tests-m32/pread64-pwrite64.c @@ -2,29 +2,10 @@ * Check decoding of pread64 and pwrite64 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -123,7 +104,9 @@ main(void) { tprintf("%s", ""); - static char tmp[] = "pread64-pwrite64-tmpfile"; + skip_if_unavailable("/proc/self/fd/"); + + static const char tmp[] = "pread64-pwrite64-tmpfile"; if (open(tmp, O_CREAT|O_RDONLY|O_TRUNC, 0600) != 0) perror_msg_and_fail("creat: %s", tmp); if (open(tmp, O_WRONLY) != 1) @@ -166,6 +149,7 @@ main(void) if (rc != -1) perror_msg_and_fail("pwrite64: expected -1, returned %ld", rc); tprintf("pwrite64(1, \"\\0\", 1, -3) = -1 EINVAL (%m)\n"); + dump_str(nil, 1); rc = pwrite(1, w, w_len, 0); if (rc != (int) w_len) diff --git a/tests-m32/pread64-pwrite64.gen.test b/tests-m32/pread64-pwrite64.gen.test new file mode 100755 index 00000000..b53e0697 --- /dev/null +++ b/tests-m32/pread64-pwrite64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pread64-pwrite64 -a21 -eread=0 -ewrite=1 -e trace=pread64,pwrite64 -P pread64-pwrite64-tmpfile -P /dev/zero -P /dev/null); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 -eread=0 -ewrite=1 -e trace=pread64,pwrite64 -P pread64-pwrite64-tmpfile -P /dev/zero -P /dev/null diff --git a/tests-m32/pread64-pwrite64.test b/tests-m32/pread64-pwrite64.test deleted file mode 100755 index e585406d..00000000 --- a/tests-m32/pread64-pwrite64.test +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# Check decoding and dumping of pread64 and pwrite64 syscalls. - -. "${srcdir=.}/init.sh" - -# strace -P is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - -tmpfile=pread64-pwrite64-tmpfile -> $tmpfile - -run_strace_match_diff \ - -a21 -eread=0 -ewrite=1 -e trace=pread64,pwrite64 \ - -P $tmpfile -P /dev/zero -P /dev/null - -rm -f $tmpfile diff --git a/tests-m32/preadv-pwritev.c b/tests-m32/preadv-pwritev.c index b2d2a824..abbe63d5 100644 --- a/tests-m32/preadv-pwritev.c +++ b/tests-m32/preadv-pwritev.c @@ -2,29 +2,10 @@ * Check decoding of preadv and pwritev syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -98,7 +79,7 @@ main(void) tprintf("pwritev(1, [], 0, 0) = 0\n"); rc = pwritev(1, w_iov + ARRAY_SIZE(w_iov_) - 1, 2, 0); - tprintf("pwritev(1, [{iov_base=\"%s\", iov_len=%u}, %p], 2, 0)" + tprintf("pwritev(1, [{iov_base=\"%s\", iov_len=%u}, ... /* %p */], 2, 0)" " = %ld %s (%m)\n", w2_c, LENGTH_OF(w2_c), w_iov + ARRAY_SIZE(w_iov_), rc, errno2name()); @@ -121,7 +102,7 @@ main(void) " * %u bytes in buffer 2\n" " | 00000 %-49s %-16s |\n", w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), - w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w_iov_), w_len, + w2_c, LENGTH_OF(w2_c), (unsigned int) ARRAY_SIZE(w_iov_), w_len, LENGTH_OF(w0_c), w0_d, w0_c, LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); @@ -142,7 +123,8 @@ main(void) tprintf("preadv(0, [{iov_base=\"%s\", iov_len=%u}], %u, 0) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + r0_c, r_len, (unsigned int) ARRAY_SIZE(r0_iov_), + r_len, r_len, r0_d, r0_c); void *r1 = tail_alloc(r_len); void *r2 = tail_alloc(w_len); @@ -166,7 +148,7 @@ main(void) ", {iov_base=\"\", iov_len=%u}], %u, %u) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), + r1_c, r_len, w_len, (unsigned int) ARRAY_SIZE(r1_iov_), r_len, w_len - r_len, w_len - r_len, r1_d, r1_c); close(0); diff --git a/tests-m32/preadv-pwritev.gen.test b/tests-m32/preadv-pwritev.gen.test new file mode 100755 index 00000000..5ed8297c --- /dev/null +++ b/tests-m32/preadv-pwritev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (preadv-pwritev -a19 -eread=0 -ewrite=1 -e trace=preadv,pwritev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 -eread=0 -ewrite=1 -e trace=preadv,pwritev diff --git a/tests-m32/preadv-pwritev.test b/tests-m32/preadv-pwritev.test deleted file mode 100755 index cb2a0772..00000000 --- a/tests-m32/preadv-pwritev.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding and dumping of preadv and pwritev syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a19 -eread=0 -ewrite=1 -e trace=preadv,pwritev diff --git a/tests-m32/preadv.c b/tests-m32/preadv.c index fb5d3ad7..3d1b504e 100644 --- a/tests-m32/preadv.c +++ b/tests-m32/preadv.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -66,7 +47,7 @@ main(void) { const off_t offset = 0xdefaceddeadbeefLL; char *buf = tail_alloc(LEN); - struct iovec *iov = tail_alloc(sizeof(*iov)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct iovec, iov); iov->iov_base = buf; iov->iov_len = LEN; @@ -124,7 +105,7 @@ main(void) perror_msg_and_fail("preadv: expected %u, returned %ld", r_len, rc); printf("preadv(%d, [{iov_base=\"%s\", iov_len=%u}], %u, 0) = %u\n", - fd, r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len); + fd, r0_c, r_len, (unsigned int) ARRAY_SIZE(r0_iov_), r_len); void *r1 = tail_alloc(r_len); void *r2 = tail_alloc(LENGTH_OF(w)); @@ -146,8 +127,9 @@ main(void) (int) LENGTH_OF(w) - r_len, rc); printf("preadv(%d, [{iov_base=\"%s\", iov_len=%u}" ", {iov_base=\"\", iov_len=%u}], %u, %u) = %u\n", - fd, r1_c, r_len, LENGTH_OF(w), ARRAY_SIZE(r1_iov_), - r_len, LENGTH_OF(w) - r_len); + fd, r1_c, r_len, LENGTH_OF(w), + (unsigned int) ARRAY_SIZE(r1_iov_), + r_len, LENGTH_OF(w) - r_len); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/preadv.gen.test b/tests-m32/preadv.gen.test new file mode 100755 index 00000000..c3fabe6f --- /dev/null +++ b/tests-m32/preadv.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (preadv -a21 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests-m32/preadv.test b/tests-m32/preadv.test deleted file mode 100755 index d1abdb7d..00000000 --- a/tests-m32/preadv.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check preadv syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a21 diff --git a/tests-m32/preadv2-pwritev2.c b/tests-m32/preadv2-pwritev2.c index f7c46c0a..1266562e 100644 --- a/tests-m32/preadv2-pwritev2.c +++ b/tests-m32/preadv2-pwritev2.c @@ -2,29 +2,10 @@ * Check decoding of preadv2 and pwritev2 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -103,7 +84,7 @@ dumpio(void) tprintf("pwritev2(1, [], 0, 0, 0) = 0\n"); rc = pw(1, w_iov + ARRAY_SIZE(w_iov_) - 1, 2, 0); - tprintf("pwritev2(1, [{iov_base=\"%s\", iov_len=%u}, %p], 2, 0, 0)" + tprintf("pwritev2(1, [{iov_base=\"%s\", iov_len=%u}, ... /* %p */], 2, 0, 0)" " = %ld %s (%m)\n", w2_c, LENGTH_OF(w2_c), w_iov + ARRAY_SIZE(w_iov_), rc, errno2name()); @@ -126,7 +107,7 @@ dumpio(void) " * %u bytes in buffer 2\n" " | 00000 %-49s %-16s |\n", w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), - w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w_iov_), w_len, + w2_c, LENGTH_OF(w2_c), (unsigned int) ARRAY_SIZE(w_iov_), w_len, LENGTH_OF(w0_c), w0_d, w0_c, LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); @@ -147,7 +128,8 @@ dumpio(void) tprintf("preadv2(0, [{iov_base=\"%s\", iov_len=%u}], %u, 0, 0) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + r0_c, r_len, (unsigned int) ARRAY_SIZE(r0_iov_), + r_len, r_len, r0_d, r0_c); void *r1 = tail_alloc(r_len); void *r2 = tail_alloc(w_len); @@ -171,7 +153,7 @@ dumpio(void) ", {iov_base=\"\", iov_len=%u}], %u, %u, 0) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), + r1_c, r_len, w_len, (unsigned int) ARRAY_SIZE(r1_iov_), r_len, w_len - r_len, w_len - r_len, r1_d, r1_c); close(0); @@ -181,28 +163,64 @@ int main(void) { const kernel_ulong_t vlen = (kernel_ulong_t) 0xfac1fed2dad3bef4ULL; - const unsigned long long pos = 0xfac5fed6dad7bef8; + const unsigned long long pos = 0x7ac5fed6dad7bef8; const kernel_ulong_t pos_l = (kernel_ulong_t) pos; - const kernel_ulong_t pos_h = - (sizeof(kernel_ulong_t) == sizeof(long long)) ? - (kernel_ulong_t) 0xbadc0deddeadbeefULL : 0xfac5fed6UL; - int test_dumpio = 1; + long rc; + bool skip_dumpio_test = false; tprintf("%s", ""); - syscall(__NR_preadv2, -1, NULL, vlen, pos_l, pos_h, 1); - if (ENOSYS == errno) - test_dumpio = 0; - tprintf("preadv2(-1, NULL, %lu, %lld, RWF_HIPRI) = -1 %s (%m)\n", - (unsigned long) vlen, pos, errno2name()); - - syscall(__NR_pwritev2, -1, NULL, vlen, pos_l, pos_h, 1); - if (ENOSYS == errno) - test_dumpio = 0; - tprintf("pwritev2(-1, NULL, %lu, %lld, RWF_HIPRI) = -1 %s (%m)\n", - (unsigned long) vlen, pos, errno2name()); - - if (test_dumpio) +# if defined __x86_64__ && defined __ILP32__ + /* + * x32 is the only architecture where preadv2 takes 5 arguments, + * see preadv64v2 in kernel sources. + */ + rc = syscall(__NR_preadv2, -1, NULL, vlen, pos_l, 1); +# else + const kernel_ulong_t pos_h = + (sizeof(pos_l) == sizeof(pos)) ? + (kernel_ulong_t) 0xbadc0deddeadbeefULL : + (kernel_ulong_t) (pos >> 32); + rc = syscall(__NR_preadv2, -1, NULL, vlen, pos_l, pos_h, 1); +# endif + if (rc != -1) + error_msg_and_fail("preadv2: expected -1, returned %ld", rc); + switch (errno) { + case ENOSYS: + skip_dumpio_test = true; + break; + case EBADF: + break; + default: + perror_msg_and_fail("preadv2"); + } + tprintf("preadv2(-1, NULL, %lu, %lld, RWF_HIPRI) = %s\n", + (unsigned long) vlen, pos, sprintrc(rc)); + +# if defined __x86_64__ && defined __ILP32__ + /* + * x32 is the only architecture where pwritev2 takes 5 arguments, + * see pwritev64v2 in kernel sources. + */ + rc = syscall(__NR_pwritev2, -1, NULL, vlen, pos_l, 1); +# else + rc = syscall(__NR_pwritev2, -1, NULL, vlen, pos_l, pos_h, 1); +# endif + if (rc != -1) + error_msg_and_fail("pwritev2: expected -1, returned %ld", rc); + switch (errno) { + case ENOSYS: + skip_dumpio_test = true; + break; + case EBADF: + break; + default: + perror_msg_and_fail("pwritev2"); + } + tprintf("pwritev2(-1, NULL, %lu, %lld, RWF_HIPRI) = %s\n", + (unsigned long) vlen, pos, sprintrc(rc)); + + if (!skip_dumpio_test) dumpio(); tprintf("%s\n", "+++ exited with 0 +++"); diff --git a/tests-m32/preadv2-pwritev2.gen.test b/tests-m32/preadv2-pwritev2.gen.test new file mode 100755 index 00000000..2f89b413 --- /dev/null +++ b/tests-m32/preadv2-pwritev2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (preadv2-pwritev2 -a22 -eread=0 -ewrite=1 -e trace=preadv2,pwritev2); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -eread=0 -ewrite=1 -e trace=preadv2,pwritev2 diff --git a/tests-m32/preadv2-pwritev2.test b/tests-m32/preadv2-pwritev2.test deleted file mode 100755 index 5641ef46..00000000 --- a/tests-m32/preadv2-pwritev2.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding and dumping of preadv2 and pwritev2 syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a22 -eread=0 -ewrite=1 -e trace=preadv2,pwritev2 diff --git a/tests-m32/print_maxfd.c b/tests-m32/print_maxfd.c index c3d4ea88..bb3ada40 100644 --- a/tests-m32/print_maxfd.c +++ b/tests-m32/print_maxfd.c @@ -1,30 +1,10 @@ /* * Print the maximum descriptor number available. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/print_quoted_string.c b/tests-m32/print_quoted_string.c index 3ad86024..ba4b5ec2 100644 --- a/tests-m32/print_quoted_string.c +++ b/tests-m32/print_quoted_string.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -9,6 +16,12 @@ * Assumes instr is NUL-terminated. */ +void +print_quoted_string_ex(const char *instr, bool quote, const char *escape_chars) +{ + print_quoted_memory_ex(instr, strlen(instr), quote, escape_chars); +} + void print_quoted_string(const char *instr) { @@ -16,11 +29,62 @@ print_quoted_string(const char *instr) } void -print_quoted_memory(const char *instr, const size_t len) +print_quoted_cstring(const char *instr, const size_t size) +{ + const size_t len = strnlen(instr, size); + if (len < size) { + print_quoted_memory(instr, len); + } else { + print_quoted_memory(instr, size - 1); + printf("..."); + } +} + +void +print_quoted_stringn(const char *instr, const size_t size) { - const unsigned char *str = (const unsigned char*) instr; + const size_t len = strnlen(instr, size); + if (len < size) { + print_quoted_memory(instr, len); + } else { + print_quoted_memory(instr, size); + printf("..."); + } +} + +static void +print_octal(unsigned char c, char next) +{ + putchar('\\'); + + char c1 = '0' + (c & 0x7); + char c2 = '0' + ((c >> 3) & 0x7); + char c3 = '0' + (c >> 6); + + if (next >= '0' && next <= '7') { + /* Print \octal */ + putchar(c3); + putchar(c2); + } else { + /* Print \[[o]o]o */ + if (c3 != '0') + putchar(c3); + if (c3 != '0' || c2 != '0') + putchar(c2); + } + putchar(c1); +} + +void +print_quoted_memory_ex(const void *const instr, const size_t len, + bool quote, const char *escape_chars) +{ + const unsigned char *str = (const unsigned char *) instr; size_t i; + if (quote) + putchar('"'); + for (i = 0; i < len; ++i) { const int c = str[i]; switch (c) { @@ -46,30 +110,36 @@ print_quoted_memory(const char *instr, const size_t len) printf("\\v"); break; default: - if (c >= ' ' && c <= 0x7e) + if (c >= ' ' && c <= 0x7e && + !(escape_chars && strchr(escape_chars, c))) { putchar(c); - else { - putchar('\\'); - - char c1 = '0' + (c & 0x7); - char c2 = '0' + ((c >> 3) & 0x7); - char c3 = '0' + (c >> 6); - - if (*str >= '0' && *str <= '9') { - /* Print \octal */ - putchar(c3); - putchar(c2); - } else { - /* Print \[[o]o]o */ - if (c3 != '0') - putchar(c3); - if (c3 != '0' || c2 != '0') - putchar(c2); - } - putchar(c1); + } else { + print_octal(c, + i < (len - 1) ? str[i + 1] : 0); } + break; } } + if (quote) + putchar('"'); +} + +void +print_quoted_memory(const void *const instr, const size_t len) +{ + print_quoted_memory_ex(instr, len, true, NULL); +} + +void +print_quoted_hex(const void *const instr, const size_t len) +{ + const unsigned char *str = instr; + size_t i; + + printf("\""); + for (i = 0; i < len; i++) + printf("\\x%02x", str[i]); + printf("\""); } diff --git a/tests-m32/print_time.c b/tests-m32/print_time.c new file mode 100644 index 00000000..9d7abde5 --- /dev/null +++ b/tests-m32/print_time.c @@ -0,0 +1,54 @@ +/* + * Print time_t and nanoseconds in symbolic format. + * + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include + +static void +print_time_t_ex(const time_t t, const unsigned long long part_sec, + const unsigned int max_part_sec, const int width, + const int comment) +{ + + if ((!t && !part_sec) || part_sec > max_part_sec) + return; + + const struct tm *const p = localtime(&t); + char buf[256]; + if (!p || !strftime(buf, sizeof(buf), "%FT%T", p)) + return; + + if (comment) + fputs(" /* ", stdout); + + fputs(buf, stdout); + + if (part_sec) + printf(".%0*llu", width, part_sec); + + if (strftime(buf, sizeof(buf), "%z", p)) + fputs(buf, stdout); + + if (comment) + fputs(" */", stdout); +} + +void +print_time_t_nsec(const time_t t, const unsigned long long nsec, int comment) +{ + print_time_t_ex(t, nsec, 999999999, 9, comment); +} + +void +print_time_t_usec(const time_t t, const unsigned long long usec, int comment) +{ + print_time_t_ex(t, usec, 999999, 6, comment); +} diff --git a/tests-m32/print_user_desc.c b/tests-m32/print_user_desc.c new file mode 100644 index 00000000..55f304c0 --- /dev/null +++ b/tests-m32/print_user_desc.c @@ -0,0 +1,58 @@ +/* + * Auxiliary printing function for the struct user_desc type. + * Used by modify_ldt and xet_thread_area tests. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_USER_DESC + +# include + +/** + * Print user_desc structure. + * + * @param us Pointer to struct user_desc to print. + * @param entry_str If not NULL, the string is printed as a value of + * entry_number field. + */ +static void +print_user_desc(struct user_desc *us, const char *entry_str) +{ + if (entry_str) + printf("{entry_number=%s", entry_str); + else + printf("{entry_number=%u", us->entry_number); + + printf(", base_addr=%#08x" + ", limit=%#08x" + ", seg_32bit=%u" + ", contents=%u" + ", read_exec_only=%u" + ", limit_in_pages=%u" + ", seg_not_present=%u" + ", useable=%u" +# ifdef __x86_64__ + ", lm=%u" +# endif + "}", + us->base_addr, + us->limit, + us->seg_32bit, + us->contents, + us->read_exec_only, + us->limit_in_pages, + us->seg_not_present, + us->useable +# ifdef __x86_64__ + , us->lm +# endif + ); +} + +#endif /* HAVE_STRUCT_USER_DESC */ diff --git a/tests-m32/printflags.c b/tests-m32/printflags.c index badc85d3..e9d66471 100644 --- a/tests-m32/printflags.c +++ b/tests-m32/printflags.c @@ -3,30 +3,10 @@ * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman - * Copyright (c) 2005-2016 Dmitry V. Levin + * Copyright (c) 2005-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/printpath-umovestr-legacy.test b/tests-m32/printpath-umovestr-legacy.test new file mode 100755 index 00000000..bc5c98bb --- /dev/null +++ b/tests-m32/printpath-umovestr-legacy.test @@ -0,0 +1,32 @@ +#!/bin/sh +# +# Force legacy printpath/umovestr using process_vm_readv fault injection. +# +# Copyright (c) 2017-2018 Dmitry V. Levin +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +> "$LOG" || fail_ "failed to write $LOG" +fault_args='-qq -esignal=none -etrace=process_vm_readv -efault=process_vm_readv' +args='../printpath-umovestr-peekdata' + +$STRACE -o "$LOG" $fault_args $args > /dev/null || { + rc=$? + if [ $rc -eq 77 ]; then + skip_ "$fault_args $args exited with code 77" + else + fail_ "$fault_args $args failed with code $rc" + fi +} + +> "$LOG" || fail_ "failed to write $LOG" +args="-a11 -e signal=none -e trace=chdir $args skip-process_vm_readv-check" + +$STRACE -o /dev/null $fault_args \ + $STRACE -o "$LOG" $args > "$EXP" || + dump_log_and_fail_with "$STRACE $args failed with code $?" + +match_diff "$LOG" "$EXP" diff --git a/tests-m32/printpath-umovestr-peekdata.c b/tests-m32/printpath-umovestr-peekdata.c new file mode 100644 index 00000000..c4093a32 --- /dev/null +++ b/tests-m32/printpath-umovestr-peekdata.c @@ -0,0 +1,27 @@ +/* + * Test PTRACE_PEEKDATA-based printpath/umovestr. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include "test_ucopy.h" +#include + +int +main(int ac, char **av) +{ + if (ac < 2 && test_process_vm_readv()) + error_msg_and_skip("process_vm_readv is available"); + + if (!test_ptrace_peekdata()) + perror_msg_and_skip("PTRACE_PEEKDATA"); + + test_printpath(sizeof(long) * 4); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/printpath-umovestr-peekdata.gen.test b/tests-m32/printpath-umovestr-peekdata.gen.test new file mode 100755 index 00000000..6fe65eeb --- /dev/null +++ b/tests-m32/printpath-umovestr-peekdata.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printpath-umovestr-peekdata -a11 -e signal=none -e trace=chdir); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e signal=none -e trace=chdir diff --git a/tests-m32/printpath-umovestr-undumpable.c b/tests-m32/printpath-umovestr-undumpable.c new file mode 100644 index 00000000..216b6cac --- /dev/null +++ b/tests-m32/printpath-umovestr-undumpable.c @@ -0,0 +1,51 @@ +/* + * Force legacy printpath/umovestr using PR_SET_DUMPABLE. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_PRCTL +# include +#endif + +#if defined HAVE_PRCTL && defined PR_SET_DUMPABLE + +# include +# include + +# include "test_ucopy.h" + +int +main(void) +{ + if (!test_process_vm_readv()) + perror_msg_and_skip("process_vm_readv"); + + /* + * Clearing dumpable flag disallows process_vm_readv. + * If the kernel does not contain commit + * 84d77d3f06e7e8dea057d10e8ec77ad71f721be3, then + * PTRACE_PEEKDATA remains allowed. + */ + if (prctl(PR_SET_DUMPABLE, 0)) + perror_msg_and_skip("PR_SET_DUMPABLE 0"); + + if (!test_ptrace_peekdata()) + perror_msg_and_skip("PTRACE_PEEKDATA"); + + test_printpath(sizeof(long) * 4); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PRCTL && PR_SET_DUMPABLE") + +#endif diff --git a/tests-m32/printpath-umovestr-undumpable.gen.test b/tests-m32/printpath-umovestr-undumpable.gen.test new file mode 100755 index 00000000..cca64424 --- /dev/null +++ b/tests-m32/printpath-umovestr-undumpable.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printpath-umovestr-undumpable -a11 -e signal=none -e trace=chdir); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e signal=none -e trace=chdir diff --git a/tests-m32/printpath-umovestr.c b/tests-m32/printpath-umovestr.c new file mode 100644 index 00000000..2782a988 --- /dev/null +++ b/tests-m32/printpath-umovestr.c @@ -0,0 +1,26 @@ +/* + * Test regular printpath/umovestr. + * + * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include "test_ucopy.h" +#include +#include + +int +main(void) +{ + if (!test_process_vm_readv()) + perror_msg_and_skip("process_vm_readv"); + + test_printpath(PATH_MAX); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/printpath-umovestr.gen.test b/tests-m32/printpath-umovestr.gen.test new file mode 100755 index 00000000..c827a7d2 --- /dev/null +++ b/tests-m32/printpath-umovestr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printpath-umovestr -a11 -e signal=none -e trace=chdir); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e signal=none -e trace=chdir diff --git a/tests-m32/printsignal-Xabbrev.c b/tests-m32/printsignal-Xabbrev.c new file mode 100644 index 00000000..dfd93eee --- /dev/null +++ b/tests-m32/printsignal-Xabbrev.c @@ -0,0 +1 @@ +#include "printsignal.c" diff --git a/tests-m32/printsignal-Xabbrev.gen.test b/tests-m32/printsignal-Xabbrev.gen.test new file mode 100755 index 00000000..fbb7a435 --- /dev/null +++ b/tests-m32/printsignal-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printsignal-Xabbrev -a11 -Xabbrev -e signal=none -e trace=kill); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -Xabbrev -e signal=none -e trace=kill diff --git a/tests-m32/printsignal-Xraw.c b/tests-m32/printsignal-Xraw.c new file mode 100644 index 00000000..47d75b77 --- /dev/null +++ b/tests-m32/printsignal-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "printsignal.c" diff --git a/tests-m32/printsignal-Xraw.gen.test b/tests-m32/printsignal-Xraw.gen.test new file mode 100755 index 00000000..ede2f5e1 --- /dev/null +++ b/tests-m32/printsignal-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printsignal-Xraw -a11 -Xraw -e signal=none -e trace=kill); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -Xraw -e signal=none -e trace=kill diff --git a/tests-m32/printsignal-Xverbose.c b/tests-m32/printsignal-Xverbose.c new file mode 100644 index 00000000..4bb13302 --- /dev/null +++ b/tests-m32/printsignal-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "printsignal.c" diff --git a/tests-m32/printsignal-Xverbose.gen.test b/tests-m32/printsignal-Xverbose.gen.test new file mode 100755 index 00000000..ae0560df --- /dev/null +++ b/tests-m32/printsignal-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printsignal-Xverbose -a11 -Xverbose -e signal=none -e trace=kill); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -Xverbose -e signal=none -e trace=kill diff --git a/tests-m32/printsignal.c b/tests-m32/printsignal.c new file mode 100644 index 00000000..4f5f9866 --- /dev/null +++ b/tests-m32/printsignal.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include "tests.h" +#include +#include +#include + +int +main(void) +{ + const pid_t pid = getpid(); + int rc = kill(pid, SIGCONT); +#if XLAT_RAW + printf("kill(%d, %d) = %s\n", pid, SIGCONT, sprintrc(rc)); +#elif XLAT_VERBOSE + printf("kill(%d, %d /* SIGCONT */) = %s\n", pid, SIGCONT, sprintrc(rc)); +#else /* XLAT_ABBREV */ + printf("kill(%d, SIGCONT) = %s\n", pid, sprintrc(rc)); +#endif + + static const int sigs[] = { 0, 256, -1 }; + for (unsigned int i = 0; i < ARRAY_SIZE(sigs); ++i) { + rc = kill(pid, sigs[i]); + printf("kill(%d, %d) = %s\n", pid, sigs[i], sprintrc(rc)); + } + + printf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests-m32/printstr.c b/tests-m32/printstr.c index 330234f1..f1204e00 100644 --- a/tests-m32/printstr.c +++ b/tests-m32/printstr.c @@ -2,29 +2,10 @@ * Check decoding of non-NUL-terminated strings when len == -1. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -34,13 +15,11 @@ #include #include -#define DEFAULT_STRLEN 32 - int main(void) { char *const buf = tail_alloc(DEFAULT_STRLEN + 1); - const struct iovec io = { + struct iovec io = { .iov_base = buf, .iov_len = -1 }; @@ -64,6 +43,11 @@ main(void) tprintf("writev(-1, [{iov_base=\"\\0%*s\"..., iov_len=%lu}], 1)" " = %s\n", DEFAULT_STRLEN - 1, buf + 1, -1UL, sprintrc(rc)); + ++io.iov_base; + rc = writev(-1, &io, 1); + tprintf("writev(-1, [{iov_base=%p, iov_len=%lu}], 1) = %s\n", + io.iov_base, -1UL, sprintrc(rc)); + tprintf("+++ exited with 0 +++\n"); return 0; } diff --git a/tests-m32/printstr.gen.test b/tests-m32/printstr.gen.test new file mode 100755 index 00000000..c3bd93a3 --- /dev/null +++ b/tests-m32/printstr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printstr -e trace=writev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=writev diff --git a/tests-m32/printstr.test b/tests-m32/printstr.test deleted file mode 100755 index 5f164eb7..00000000 --- a/tests-m32/printstr.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of non-NUL-terminated strings when len == -1. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -e trace=writev diff --git a/tests-m32/printstrn-umoven-legacy.test b/tests-m32/printstrn-umoven-legacy.test new file mode 100755 index 00000000..062b8b07 --- /dev/null +++ b/tests-m32/printstrn-umoven-legacy.test @@ -0,0 +1,32 @@ +#!/bin/sh +# +# Force legacy printstrn/umoven using process_vm_readv fault injection. +# +# Copyright (c) 2017-2018 Dmitry V. Levin +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +> "$LOG" || fail_ "failed to write $LOG" +fault_args='-qq -esignal=none -etrace=process_vm_readv -efault=process_vm_readv' +args='../printstrn-umoven-peekdata' + +$STRACE -o "$LOG" $fault_args $args > /dev/null || { + rc=$? + if [ $rc -eq 77 ]; then + skip_ "$fault_args $args exited with code 77" + else + fail_ "$fault_args $args failed with code $rc" + fi +} + +> "$LOG" || fail_ "failed to write $LOG" +args="-e signal=none -e trace=add_key $args skip-process_vm_readv-check" + +$STRACE -o /dev/null $fault_args \ + $STRACE -o "$LOG" $args > "$EXP" || + dump_log_and_fail_with "$STRACE $args failed with code $?" + +match_diff "$LOG" "$EXP" diff --git a/tests-m32/printstrn-umoven-peekdata.c b/tests-m32/printstrn-umoven-peekdata.c new file mode 100644 index 00000000..c80d9124 --- /dev/null +++ b/tests-m32/printstrn-umoven-peekdata.c @@ -0,0 +1,27 @@ +/* + * Test PTRACE_PEEKDATA-based printstrn/umoven. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include "test_ucopy.h" +#include + +int +main(int ac, char **av) +{ + if (ac < 2 && test_process_vm_readv()) + error_msg_and_skip("process_vm_readv is available"); + + if (!test_ptrace_peekdata()) + perror_msg_and_skip("PTRACE_PEEKDATA"); + + test_printstrn(DEFAULT_STRLEN); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/printstrn-umoven-peekdata.gen.test b/tests-m32/printstrn-umoven-peekdata.gen.test new file mode 100755 index 00000000..61f648ae --- /dev/null +++ b/tests-m32/printstrn-umoven-peekdata.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printstrn-umoven-peekdata -e signal=none -e trace=add_key); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e signal=none -e trace=add_key diff --git a/tests-m32/printstrn-umoven-undumpable.c b/tests-m32/printstrn-umoven-undumpable.c new file mode 100644 index 00000000..be3f8d4b --- /dev/null +++ b/tests-m32/printstrn-umoven-undumpable.c @@ -0,0 +1,51 @@ +/* + * Force legacy printpath/umovestr using PR_SET_DUMPABLE. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_PRCTL +# include +#endif + +#if defined HAVE_PRCTL && defined PR_SET_DUMPABLE + +# include +# include + +# include "test_ucopy.h" + +int +main(void) +{ + if (!test_process_vm_readv()) + perror_msg_and_skip("process_vm_readv"); + + /* + * Clearing dumpable flag disallows process_vm_readv. + * If the kernel does not contain commit + * 84d77d3f06e7e8dea057d10e8ec77ad71f721be3, then + * PTRACE_PEEKDATA remains allowed. + */ + if (prctl(PR_SET_DUMPABLE, 0)) + perror_msg_and_skip("PR_SET_DUMPABLE 0"); + + if (!test_ptrace_peekdata()) + perror_msg_and_skip("PTRACE_PEEKDATA"); + + test_printstrn(DEFAULT_STRLEN); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PRCTL && PR_SET_DUMPABLE") + +#endif diff --git a/tests-m32/printstrn-umoven-undumpable.gen.test b/tests-m32/printstrn-umoven-undumpable.gen.test new file mode 100755 index 00000000..1dee526f --- /dev/null +++ b/tests-m32/printstrn-umoven-undumpable.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printstrn-umoven-undumpable -e signal=none -e trace=add_key); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e signal=none -e trace=add_key diff --git a/tests-m32/printstrn-umoven.c b/tests-m32/printstrn-umoven.c new file mode 100644 index 00000000..f9aa75dc --- /dev/null +++ b/tests-m32/printstrn-umoven.c @@ -0,0 +1,24 @@ +/* + * Test regular printstrn/umoven. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include "test_ucopy.h" +#include + +int +main(void) +{ + if (!test_process_vm_readv()) + perror_msg_and_skip("process_vm_readv"); + + test_printstrn(4096); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/printstrn-umoven.gen.test b/tests-m32/printstrn-umoven.gen.test new file mode 100755 index 00000000..4187238c --- /dev/null +++ b/tests-m32/printstrn-umoven.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printstrn-umoven -s4096 -e signal=none -e trace=add_key); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s4096 -e signal=none -e trace=add_key diff --git a/tests-m32/printxval.c b/tests-m32/printxval.c index 4fb61c84..0cd629e4 100644 --- a/tests-m32/printxval.c +++ b/tests-m32/printxval.c @@ -3,30 +3,10 @@ * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman - * Copyright (c) 2005-2016 Dmitry V. Levin + * Copyright (c) 2005-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/prlimit64.c b/tests-m32/prlimit64.c index 1e651161..688ca75f 100644 --- a/tests-m32/prlimit64.c +++ b/tests-m32/prlimit64.c @@ -1,30 +1,10 @@ /* * Check decoding of prlimit64 syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/prlimit64.gen.test b/tests-m32/prlimit64.gen.test new file mode 100755 index 00000000..2c94fc9d --- /dev/null +++ b/tests-m32/prlimit64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (prlimit64 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/prlimit64.test b/tests-m32/prlimit64.test deleted file mode 100755 index 2d2240d7..00000000 --- a/tests-m32/prlimit64.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of prlimit64 syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/process_vm_readv.c b/tests-m32/process_vm_readv.c index cfb8f786..422000b8 100644 --- a/tests-m32/process_vm_readv.c +++ b/tests-m32/process_vm_readv.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/process_vm_readv.gen.test b/tests-m32/process_vm_readv.gen.test new file mode 100755 index 00000000..31425887 --- /dev/null +++ b/tests-m32/process_vm_readv.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (process_vm_readv -s5 -a37); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s5 -a37 diff --git a/tests-m32/process_vm_readv.test b/tests-m32/process_vm_readv.test deleted file mode 100755 index c092f5a3..00000000 --- a/tests-m32/process_vm_readv.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of process_vm_readv syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s5 -a37 diff --git a/tests-m32/process_vm_readv_writev.c b/tests-m32/process_vm_readv_writev.c index 2a089395..9309135a 100644 --- a/tests-m32/process_vm_readv_writev.c +++ b/tests-m32/process_vm_readv_writev.c @@ -2,29 +2,10 @@ * Check decoding of process_vm_readv/process_vm_writev syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -51,7 +32,7 @@ enum { MAX_SEGM_COUNT = 2, MAX_STR_LEN = 5 }; struct print_iov_arg { uint32_t count; uint32_t valid :1, - string :1, + string :1, addr_term:1, check_rc :1; uint32_t str_segms; @@ -134,7 +115,7 @@ print_iov(const struct iovec *iov, const void *arg_ptr, long rc) } if (arg->addr_term) - printf(", %p", iov + arg->count); + printf(", ... /* %p */", iov + arg->count); printf("]"); } @@ -247,14 +228,15 @@ main(void) 2, {SEGM1_BASE, SEGM2_BASE}, {SIZE_1, SIZE_2} }; struct print_iov_arg rmt_arg = { ARRAY_SIZE(rmt_iovec), 1 }; - struct print_iov_arg bogus_arg_cut = - { ARRAY_SIZE(bogus_iovec) - 2, 1, 0, 1 }; - struct print_iov_arg lcl_arg_cut = - { ARRAY_SIZE(lcl_iovec) - 2, 1, 1, 1, 0, 2, - {SEGM1_BASE + SIZE_11 + SIZE_12, SEGM2_BASE}, - {SIZE_13, SIZE_2} }; - struct print_iov_arg rmt_arg_cut = - { ARRAY_SIZE(rmt_iovec) - 2, 1 }; + struct print_iov_arg bogus_arg_cut = { + ARRAY_SIZE(bogus_iovec) - 2, 1, 0, 1 + }; + struct print_iov_arg lcl_arg_cut = { + ARRAY_SIZE(lcl_iovec) - 2, 1, 1, 1, 0, 2, + { SEGM1_BASE + SIZE_11 + SIZE_12, SEGM2_BASE }, + {SIZE_13, SIZE_2} + }; + struct print_iov_arg rmt_arg_cut = { ARRAY_SIZE(rmt_iovec) - 2, 1 }; fill_memory_ex(data1_out, SIZE_1, SEGM1_BASE, SIZE_1); diff --git a/tests-m32/process_vm_writev.c b/tests-m32/process_vm_writev.c index 6271c01b..848a9e91 100644 --- a/tests-m32/process_vm_writev.c +++ b/tests-m32/process_vm_writev.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/process_vm_writev.gen.test b/tests-m32/process_vm_writev.gen.test new file mode 100755 index 00000000..0b912c09 --- /dev/null +++ b/tests-m32/process_vm_writev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (process_vm_writev -s5 -a38); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s5 -a38 diff --git a/tests-m32/process_vm_writev.test b/tests-m32/process_vm_writev.test deleted file mode 100755 index f690e6a9..00000000 --- a/tests-m32/process_vm_writev.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of process_vm_writev syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s5 -a38 diff --git a/tests-m32/pselect6.c b/tests-m32/pselect6.c index f2644853..c8122e27 100644 --- a/tests-m32/pselect6.c +++ b/tests-m32/pselect6.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ /* @@ -95,20 +76,20 @@ int main(int ac, char **av) FD_SET(fds[0], set[1]); FD_SET(fds[1], set[1]); assert(syscall(__NR_pselect6, fds[1] + 1, NULL, set[1], NULL, &tm.ts, NULL) == 3); - printf("pselect6(%d, NULL, [1 2 %d %d], NULL, " - "{tv_sec=%lld, tv_nsec=%lld}, NULL) = 3 (out [1 2 %d], left " - "{tv_sec=%lld, tv_nsec=%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], - (long long) tm.ts.tv_sec, (long long) tm.ts.tv_nsec); + printf("pselect6(%d, NULL, [1 2 %d %d], NULL" + ", {tv_sec=%lld, tv_nsec=%llu}, NULL) = 3 (out [1 2 %d]" + ", left {tv_sec=%lld, tv_nsec=%llu})\n", + fds[1] + 1, fds[0], fds[1], (long long) tm_in.ts.tv_sec, + zero_extend_signed_to_ull(tm_in.ts.tv_nsec), + fds[1], (long long) tm.ts.tv_sec, + zero_extend_signed_to_ull(tm.ts.tv_nsec)); /* * Now the crash case that trinity found, negative nfds * but with a pointer to a large chunk of valid memory. */ FD_ZERO(set[0]); - FD_SET(fds[1],set[0]); + FD_SET(fds[1], set[0]); assert(pselect(-1, NULL, set[0], NULL, NULL, &mask) == -1); printf("pselect6(-1, NULL, %p, NULL, NULL, {[HUP CHLD], %u}) " "= -1 EINVAL (%m)\n", set[0], NSIG_BYTES); @@ -117,26 +98,45 @@ int main(int ac, char **av) * Another variant, with nfds exceeding FD_SETSIZE limit. */ FD_ZERO(set[0]); - FD_SET(fds[0],set[0]); + FD_SET(fds[0], set[0]); FD_ZERO(set[1]); tm.ts.tv_sec = 0; tm.ts.tv_nsec = 123; assert(pselect(FD_SETSIZE + 1, set[0], set[1], NULL, &tm.ts, &mask) == 0); - printf("pselect6(%d, [%d], [], NULL, {tv_sec=0, tv_nsec=123}, " - "{[HUP CHLD], %u}) = 0 (Timeout)\n", + printf("pselect6(%d, [%d], [], NULL, {tv_sec=0, tv_nsec=123}" + ", {[HUP CHLD], %u}) = 0 (Timeout)\n", FD_SETSIZE + 1, fds[0], NSIG_BYTES); /* * See how timeouts are decoded. */ + tm.ts.tv_sec = 0xdeadbeefU; + tm.ts.tv_nsec = 0xfacefeedU; + assert(pselect(0, NULL, NULL, NULL, &tm.ts, NULL) == -1); + printf("pselect6(0, NULL, NULL, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}, {NULL, %u}) = %s\n", + (long long) tm.ts.tv_sec, + zero_extend_signed_to_ull(tm.ts.tv_nsec), + NSIG_BYTES, sprintrc(-1)); + + tm.ts.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + tm.ts.tv_nsec = (long) 0xbadc0dedfacefeedLL; + assert(pselect(0, NULL, NULL, NULL, &tm.ts, NULL) == -1); + printf("pselect6(0, NULL, NULL, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}, {NULL, %u}) = %s\n", + (long long) tm.ts.tv_sec, + zero_extend_signed_to_ull(tm.ts.tv_nsec), + NSIG_BYTES, sprintrc(-1)); + assert(sigaction(SIGALRM, &act, NULL) == 0); assert(setitimer(ITIMER_REAL, &itv, NULL) == 0); + tm.ts.tv_sec = 0; tm.ts.tv_nsec = 222222222; assert(pselect(0, NULL, NULL, NULL, &tm.ts, &mask) == -1); - printf("pselect6(0, NULL, NULL, NULL, {tv_sec=0, tv_nsec=222222222}, " - "{[HUP CHLD], %u}) = " - "? ERESTARTNOHAND (To be restarted if no handler)\n", + printf("pselect6(0, NULL, NULL, NULL, {tv_sec=0, tv_nsec=222222222}" + ", {[HUP CHLD], %u})" + " = ? ERESTARTNOHAND (To be restarted if no handler)\n", NSIG_BYTES); puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); diff --git a/tests-m32/pselect6.gen.test b/tests-m32/pselect6.gen.test new file mode 100755 index 00000000..29d38963 --- /dev/null +++ b/tests-m32/pselect6.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pselect6 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/pselect6.test b/tests-m32/pselect6.test deleted file mode 100755 index 203f8e24..00000000 --- a/tests-m32/pselect6.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check pselect6 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/ptrace.c b/tests-m32/ptrace.c index 80ce8cbb..63435a76 100644 --- a/tests-m32/ptrace.c +++ b/tests-m32/ptrace.c @@ -2,44 +2,25 @@ * Check decoding of ptrace syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include -#ifdef __NR_rt_sigprocmask - -# include -# include -# include -# include -# include -# include -# include "ptrace.h" -# include +#include +#include "ptrace.h" +#include +#include +#include +#include +#include +#include +#include +#include static const char *errstr; @@ -59,10 +40,11 @@ test_peeksiginfo(unsigned long pid, const unsigned long bad_request) printf("ptrace(PTRACE_PEEKSIGINFO, %u, NULL, %#lx) = %s\n", (unsigned) pid, bad_request, errstr); - struct { + struct psi { unsigned long long off; unsigned int flags, nr; - } *const psi = tail_alloc(sizeof(*psi)); + }; + TAIL_ALLOC_OBJECT_CONST_PTR(struct psi, psi); psi->off = 0xdeadbeeffacefeedULL; psi->flags = 1; @@ -115,7 +97,7 @@ test_peeksiginfo(unsigned long pid, const unsigned long bad_request) if (errno == EINTR) continue; saved = errno; - kill (pid, SIGKILL); + kill(pid, SIGKILL); errno = saved; perror_msg_and_fail("wait"); } @@ -160,11 +142,11 @@ test_peeksiginfo(unsigned long pid, const unsigned long bad_request) if (do_ptrace(PTRACE_CONT, pid, 0, 0)) { saved = errno; - kill (pid, SIGKILL); + kill(pid, SIGKILL); errno = saved; perror_msg_and_fail("ptrace"); } - printf("ptrace(PTRACE_CONT, %ld, NULL, SIG_0) = 0\n", pid); + printf("ptrace(PTRACE_CONT, %ld, NULL, 0) = 0\n", pid); } } @@ -178,46 +160,40 @@ main(void) const unsigned long pid = (unsigned long) 0xdefaced00000000ULL | (unsigned) getpid(); - unsigned int sigset_size; + TAIL_ALLOC_OBJECT_CONST_PTR(uint64_t, filter_off); - for (sigset_size = 1024 / 8; sigset_size; sigset_size >>= 1) { - if (!syscall(__NR_rt_sigprocmask, - SIG_SETMASK, NULL, NULL, sigset_size)) - break; - } - if (!sigset_size) - perror_msg_and_fail("rt_sigprocmask"); + const unsigned int sigset_size = get_sigset_size(); void *const k_set = tail_alloc(sigset_size); - siginfo_t *const sip = tail_alloc(sizeof(*sip)); + TAIL_ALLOC_OBJECT_CONST_PTR(siginfo_t, sip); do_ptrace(bad_request, pid, 0, 0); printf("ptrace(%#lx /* PTRACE_??? */, %u, NULL, NULL) = %s\n", bad_request, (unsigned) pid, errstr); do_ptrace(PTRACE_PEEKDATA, pid, bad_request, bad_data); -# ifdef IA64 +#ifdef IA64 printf("ptrace(PTRACE_PEEKDATA, %u, %#lx) = %s\n", (unsigned) pid, bad_request, errstr); -# else +#else printf("ptrace(PTRACE_PEEKDATA, %u, %#lx, %#lx) = %s\n", (unsigned) pid, bad_request, bad_data, errstr); #endif do_ptrace(PTRACE_PEEKTEXT, pid, bad_request, bad_data); -# ifdef IA64 +#ifdef IA64 printf("ptrace(PTRACE_PEEKTEXT, %u, %#lx) = %s\n", (unsigned) pid, bad_request, errstr); -# else +#else printf("ptrace(PTRACE_PEEKTEXT, %u, %#lx, %#lx) = %s\n", (unsigned) pid, bad_request, bad_data, errstr); #endif do_ptrace(PTRACE_PEEKUSER, pid, bad_request, bad_data); -# ifdef IA64 +#ifdef IA64 printf("ptrace(PTRACE_PEEKUSER, %u, %#lx) = %s\n", (unsigned) pid, bad_request, errstr); -# else +#else printf("ptrace(PTRACE_PEEKUSER, %u, %#lx, %#lx) = %s\n", (unsigned) pid, bad_request, bad_data, errstr); #endif @@ -255,6 +231,22 @@ main(void) printf("ptrace(PTRACE_SECCOMP_GET_FILTER, %u, 42, NULL) = %s\n", (unsigned) pid, errstr); + do_ptrace(PTRACE_SECCOMP_GET_METADATA, pid, bad_data, 0); + printf("ptrace(PTRACE_SECCOMP_GET_METADATA, %u, %lu, NULL) = %s\n", + (unsigned) pid, bad_data, errstr); + + do_ptrace(PTRACE_SECCOMP_GET_METADATA, pid, 7, + (unsigned long) filter_off); + printf("ptrace(PTRACE_SECCOMP_GET_METADATA, %u, 7, %p) = %s\n", + (unsigned) pid, filter_off, errstr); + + *filter_off = 0xfacefeeddeadc0deULL; + do_ptrace(PTRACE_SECCOMP_GET_METADATA, pid, bad_data, + (unsigned long) filter_off); + printf("ptrace(PTRACE_SECCOMP_GET_METADATA, %u, %lu, " + "{filter_off=%" PRIu64 "}) = %s\n", + (unsigned) pid, bad_data, *filter_off, errstr); + do_ptrace(PTRACE_GETEVENTMSG, pid, bad_request, bad_data); printf("ptrace(PTRACE_GETEVENTMSG, %u, %#lx, %#lx) = %s\n", (unsigned) pid, bad_request, bad_data, errstr); @@ -446,10 +438,3 @@ main(void) puts("+++ exited with 0 +++"); return 0; } - - -#else - -SKIP_MAIN_UNDEFINED("__NR_rt_sigprocmask") - -#endif diff --git a/tests-m32/ptrace.gen.test b/tests-m32/ptrace.gen.test new file mode 100755 index 00000000..4b932509 --- /dev/null +++ b/tests-m32/ptrace.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ptrace -a23 -e signal=none); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 -e signal=none diff --git a/tests-m32/ptrace.test b/tests-m32/ptrace.test deleted file mode 100755 index 5add9be4..00000000 --- a/tests-m32/ptrace.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of ptrace syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a23 -e signal=none diff --git a/tests-m32/ptrace_syscall_info.c b/tests-m32/ptrace_syscall_info.c new file mode 100644 index 00000000..ea29d22e --- /dev/null +++ b/tests-m32/ptrace_syscall_info.c @@ -0,0 +1,460 @@ +/* + * Check decoding of ptrace PTRACE_GET_SYSCALL_INFO request. + * + * Copyright (c) 2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include "ptrace.h" +#include +#include "scno.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "xlat.h" +#include "xlat/audit_arch.h" + +static const char *errstr; + +static long +do_ptrace(unsigned long request, unsigned long pid, + unsigned long addr, unsigned long data) +{ + long rc = syscall(__NR_ptrace, request, pid, addr, data); + errstr = sprintrc(rc); + return rc; +} + +static pid_t pid; + +static void +kill_tracee(void) +{ + if (!pid) + return; + int saved_errno = errno; + kill(pid, SIGKILL); + errno = saved_errno; +} + +#define FAIL(fmt_, ...) \ + do { \ + kill_tracee(); \ + error_msg_and_fail("%s:%d: " fmt_, \ + __FILE__, __LINE__, ##__VA_ARGS__); \ + } while (0) + +#define PFAIL(fmt_, ...) \ + do { \ + kill_tracee(); \ + perror_msg_and_fail("%s:%d: " fmt_, \ + __FILE__, __LINE__, ##__VA_ARGS__); \ + } while (0) + +static const unsigned long args[][7] = { + /* a sequence of architecture-agnostic syscalls */ + { + __NR_chdir, + (unsigned long) "", + 0xbad1fed1, + 0xbad2fed2, + 0xbad3fed3, + 0xbad4fed4, + 0xbad5fed5 + }, + { + __NR_gettid, + 0xcaf0bea0, + 0xcaf1bea1, + 0xcaf2bea2, + 0xcaf3bea3, + 0xcaf4bea4, + 0xcaf5bea5 + }, + { + __NR_exit_group, + 0, + 0xfac1c0d1, + 0xfac2c0d2, + 0xfac3c0d3, + 0xfac4c0d4, + 0xfac5c0d5 + } +}; + +static const unsigned int expected_none_size = + offsetof(struct ptrace_syscall_info, entry); +static const unsigned int expected_entry_size = + offsetofend(struct ptrace_syscall_info, entry.args); +static const unsigned int expected_exit_size = + offsetofend(struct ptrace_syscall_info, exit.is_error); + +static unsigned long end_of_page; +static unsigned int ptrace_stop; + +static bool +test_none(void) +{ + do_ptrace(PTRACE_GET_SYSCALL_INFO, pid, 1, 0); + printf("ptrace(PTRACE_GET_SYSCALL_INFO, %d, 1, NULL) = %s\n", + pid, errstr); + + do_ptrace(PTRACE_GET_SYSCALL_INFO, pid, 1, end_of_page); + printf("ptrace(PTRACE_GET_SYSCALL_INFO, %d, 1, %#lx) = %s\n", + pid, end_of_page, errstr); + + for (unsigned int size = 0; + size <= sizeof(struct ptrace_syscall_info); ++size) { + unsigned long buf = end_of_page - size; + memset((void *) buf, -1, size); + + long rc = do_ptrace(PTRACE_GET_SYSCALL_INFO, pid, size, buf); + if (rc < 0) { + printf("ptrace(PTRACE_GET_SYSCALL_INFO, %d, %u, %#lx)" + " = %s\n", + pid, (unsigned int) size, buf, errstr); + return false; + } + if (rc < (long) expected_none_size) + FAIL("signal stop mismatch"); + + printf("ptrace(PTRACE_GET_SYSCALL_INFO, %d, %u, ", + pid, size); + if (!size) { + printf("%#lx) = %s\n", buf, errstr); + continue; + } + + /* copy to a local structure to avoid unaligned access */ + struct ptrace_syscall_info info; + memcpy(&info, (void *) buf, MIN(size, expected_none_size)); + + if (info.op != PTRACE_SYSCALL_INFO_NONE) + FAIL("signal stop mismatch"); + printf("{op=PTRACE_SYSCALL_INFO_NONE"); + + if (size < offsetofend(struct ptrace_syscall_info, arch)) + goto printed_none; + if (!info.arch) + FAIL("signal stop mismatch"); + printf(", arch="); + printxval(audit_arch, info.arch, "AUDIT_ARCH_???"); + + if (size < offsetofend(struct ptrace_syscall_info, + instruction_pointer)) + goto printed_none; + if (!info.instruction_pointer) + FAIL("signal stop mismatch"); + printf(", instruction_pointer=%#llx", + (unsigned long long) info.instruction_pointer); + + if (size < offsetofend(struct ptrace_syscall_info, + stack_pointer)) + goto printed_none; + if (!info.stack_pointer) + FAIL("signal stop mismatch"); + printf(", stack_pointer=%#llx", + (unsigned long long) info.stack_pointer); + +printed_none: + printf("}) = %s\n", errstr); + } + + return true; +} + +static void +test_entry(void) +{ + for (unsigned int size = 0; + size <= sizeof(struct ptrace_syscall_info); ++size) { + unsigned long buf = end_of_page - size; + memset((void *) buf, -1, size); + + long rc = do_ptrace(PTRACE_GET_SYSCALL_INFO, pid, size, buf); + if (rc < 0) + PFAIL("PTRACE_GET_SYSCALL_INFO"); + + if (rc < (long) expected_entry_size) + FAIL("#%d: entry stop mismatch", ptrace_stop); + + printf("ptrace(PTRACE_GET_SYSCALL_INFO, %d, %u, ", + pid, size); + if (!size) { + printf("%#lx) = %s\n", buf, errstr); + continue; + } + + /* copy to a local structure to avoid unaligned access */ + struct ptrace_syscall_info info; + memcpy(&info, (void *) buf, MIN(size, expected_entry_size)); + + if (info.op != PTRACE_SYSCALL_INFO_ENTRY) + FAIL("#%d: entry stop mismatch", ptrace_stop); + printf("{op=PTRACE_SYSCALL_INFO_ENTRY"); + + if (size < offsetofend(struct ptrace_syscall_info, arch)) + goto printed_entry_common; + if (!info.arch) + FAIL("#%d: entry stop mismatch", ptrace_stop); + printf(", arch="); + printxval(audit_arch, info.arch, "AUDIT_ARCH_???"); + + if (size < offsetofend(struct ptrace_syscall_info, + instruction_pointer)) + goto printed_entry_common; + if (!info.instruction_pointer) + FAIL("#%d: entry stop mismatch", ptrace_stop); + printf(", instruction_pointer=%#llx", + (unsigned long long) info.instruction_pointer); + + if (size < offsetofend(struct ptrace_syscall_info, + stack_pointer)) + goto printed_entry_common; + if (!info.stack_pointer) + FAIL("#%d: entry stop mismatch", ptrace_stop); + printf(", stack_pointer=%#llx", + (unsigned long long) info.stack_pointer); + + if (size < offsetofend(struct ptrace_syscall_info, entry.nr)) + goto printed_entry_common; + const unsigned long *exp_args = args[ptrace_stop / 2]; + if (info.entry.nr != exp_args[0]) + FAIL("#%d: entry stop mismatch", ptrace_stop); + printf(", entry={nr=%llu", (unsigned long long) info.entry.nr); + + for (unsigned int i = 0; i < ARRAY_SIZE(info.entry.args); ++i) { + const unsigned int i_size = + offsetofend(struct ptrace_syscall_info, + entry.args[i]); + if (size < i_size) { + if (i) + break; + goto printed_entry_nr; + } + if (info.entry.args[i] != exp_args[i + 1]) + FAIL("#%d: entry stop mismatch", ptrace_stop); + printf("%s%#llx", (i ? ", " : ", arg=["), + (unsigned long long) info.entry.args[i]); + } + printf("]"); + +printed_entry_nr: + printf("}"); + +printed_entry_common: + printf("}) = %s\n", errstr); + } +} + +static void +test_exit(void) +{ + for (unsigned int size = 0; + size <= sizeof(struct ptrace_syscall_info); ++size) { + unsigned long buf = end_of_page - size; + memset((void *) buf, -1, size); + + long rc = do_ptrace(PTRACE_GET_SYSCALL_INFO, pid, size, buf); + if (rc < 0) + PFAIL("PTRACE_GET_SYSCALL_INFO"); + + if (rc < (long) expected_exit_size) + FAIL("#%d: exit stop mismatch", ptrace_stop); + + printf("ptrace(PTRACE_GET_SYSCALL_INFO, %d, %u, ", + pid, size); + if (!size) { + printf("%#lx) = %s\n", buf, errstr); + continue; + } + + /* copy to a local structure to avoid unaligned access */ + struct ptrace_syscall_info info; + memcpy(&info, (void *) buf, MIN(size, expected_exit_size)); + + if (info.op != PTRACE_SYSCALL_INFO_EXIT) + FAIL("#%d: exit stop mismatch", ptrace_stop); + printf("{op=PTRACE_SYSCALL_INFO_EXIT"); + + if (size < offsetofend(struct ptrace_syscall_info, arch)) + goto printed_exit_common; + if (!info.arch) + FAIL("#%d: exit stop mismatch", ptrace_stop); + printf(", arch="); + printxval(audit_arch, info.arch, "AUDIT_ARCH_???"); + + if (size < offsetofend(struct ptrace_syscall_info, + instruction_pointer)) + goto printed_exit_common; + if (!info.instruction_pointer) + FAIL("#%d: exit stop mismatch", ptrace_stop); + printf(", instruction_pointer=%#llx", + (unsigned long long) info.instruction_pointer); + + if (size < offsetofend(struct ptrace_syscall_info, + stack_pointer)) + goto printed_exit_common; + if (!info.stack_pointer) + FAIL("#%d: exit stop mismatch", ptrace_stop); + printf(", stack_pointer=%#llx", + (unsigned long long) info.stack_pointer); + + const struct { + unsigned int is_error; + int rval; + const char *str; + } exit_param[] = { + { 1, -ENOENT, "-ENOENT" }, /* chdir */ + { 0, pid, NULL } /* gettid */ + }, *exp_param = &exit_param[ptrace_stop / 2 - 1]; + + if (size < offsetofend(struct ptrace_syscall_info, exit.rval)) + goto printed_exit_common; + if (info.exit.rval != exp_param->rval) + FAIL("#%d: exit stop mismatch", ptrace_stop); + if (size >= expected_exit_size && info.exit.is_error) { + printf(", exit={rval=%s", exp_param->str); + } else { + printf(", exit={rval=%lld", (long long) info.exit.rval); + } + + if (size >= expected_exit_size) { + if (info.exit.is_error != exp_param->is_error) + FAIL("#%d: exit stop mismatch", ptrace_stop); + printf(", is_error=%u", + (unsigned int) info.exit.is_error); + } + + printf("}"); + +printed_exit_common: + printf("}) = %s\n", errstr); + } +} + +int +main(void) +{ + end_of_page = (unsigned long) tail_alloc(1) + 1; + + pid = getpid(); + do_ptrace(PTRACE_GET_SYSCALL_INFO, pid, 0, 0); + printf("ptrace(PTRACE_GET_SYSCALL_INFO, %d, 0, NULL) = %s\n", + pid, errstr); + + pid = fork(); + if (pid < 0) + PFAIL("fork"); + + if (pid == 0) { + /* get the pid before PTRACE_TRACEME */ + pid = getpid(); + if (do_ptrace(PTRACE_TRACEME, 0, 0, 0) < 0) { + /* exit with a nonzero exit status */ + PFAIL("PTRACE_TRACEME"); + } + kill(pid, SIGSTOP); + for (unsigned int i = 0; i < ARRAY_SIZE(args); ++i) { + syscall(args[i][0], + args[i][1], args[i][2], args[i][3], + args[i][4], args[i][5], args[i][6]); + } + /* unreachable */ + _exit(1); + } + + for (ptrace_stop = 0; ; ++ptrace_stop) { + int status; + long rc = waitpid(pid, &status, 0); + if (rc != pid) { + /* cannot happen */ + PFAIL("#%d: unexpected wait result %ld", + ptrace_stop, rc); + } + if (WIFEXITED(status)) { + /* tracee is no more */ + pid = 0; + if (WEXITSTATUS(status) == 0) + break; + FAIL("#%d: unexpected exit status %u", + ptrace_stop, WEXITSTATUS(status)); + } + if (WIFSIGNALED(status)) { + /* tracee is no more */ + pid = 0; + FAIL("#%d: unexpected signal %u", + ptrace_stop, WTERMSIG(status)); + } + if (!WIFSTOPPED(status)) { + /* cannot happen */ + FAIL("#%d: unexpected wait status %#x", + ptrace_stop, status); + } + + switch (WSTOPSIG(status)) { + case SIGSTOP: + if (ptrace_stop) + FAIL("#%d: unexpected signal stop", + ptrace_stop); + if (do_ptrace(PTRACE_SETOPTIONS, pid, 0, + PTRACE_O_TRACESYSGOOD) < 0) { + /* cannot happen */ + PFAIL("PTRACE_SETOPTIONS"); + } + printf("ptrace(PTRACE_SETOPTIONS, %d, NULL" + ", PTRACE_O_TRACESYSGOOD) = 0\n", pid); + + if (!test_none()) + goto done; + break; + + case SIGTRAP | 0x80: + switch (ptrace_stop) { + case 1: /* entering chdir */ + case 3: /* entering gettid */ + case 5: /* entering exit_group */ + test_entry(); + break; + case 2: /* exiting chdir */ + case 4: /* exiting gettid */ + test_exit(); + break; + default: + FAIL("#%d: unexpected syscall stop", + ptrace_stop); + } + break; + + default: + FAIL("#%d: unexpected stop signal %#x", + ptrace_stop, WSTOPSIG(status)); + } + + if (do_ptrace(PTRACE_SYSCALL, pid, 0, 0) < 0) { + /* cannot happen */ + PFAIL("PTRACE_SYSCALL"); + } + printf("ptrace(PTRACE_SYSCALL, %d, NULL, 0) = 0\n", pid); + } + +done: + if (pid) { + kill_tracee(); + waitpid(pid, NULL, 0); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/ptrace_syscall_info.gen.test b/tests-m32/ptrace_syscall_info.gen.test new file mode 100755 index 00000000..1314eee6 --- /dev/null +++ b/tests-m32/ptrace_syscall_info.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ptrace_syscall_info -a35 -e signal=none -e trace=ptrace); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 -e signal=none -e trace=ptrace diff --git a/tests-m32/pure_executables.am b/tests-m32/pure_executables.am new file mode 100644 index 00000000..cc844502 --- /dev/null +++ b/tests-m32/pure_executables.am @@ -0,0 +1,522 @@ +# Generated by ./tests/gen_pure_executables.sh from ./tests/pure_executables.list; do not edit. +PURE_EXECUTABLES = \ + _newselect \ + accept \ + accept4 \ + access \ + acct \ + add_key \ + adjtimex \ + aio \ + aio_pgetevents \ + alarm \ + bpf \ + bpf-obj_get_info_by_fd \ + bpf-obj_get_info_by_fd-prog \ + bpf-obj_get_info_by_fd-prog-v \ + bpf-obj_get_info_by_fd-v \ + bpf-v \ + brk \ + btrfs \ + caps \ + chmod \ + chown \ + chown32 \ + chroot \ + clock_adjtime \ + clock_nanosleep \ + clock_xettime \ + copy_file_range \ + creat \ + delete_module \ + dev-yy \ + dup \ + dup2 \ + dup3 \ + epoll_create \ + epoll_create1 \ + epoll_ctl \ + epoll_pwait \ + epoll_wait \ + erestartsys \ + eventfd \ + execve \ + execveat \ + faccessat \ + fadvise64 \ + fadvise64_64 \ + fallocate \ + fanotify_init \ + fanotify_mark \ + fanotify_mark-Xabbrev \ + fanotify_mark-Xraw \ + fanotify_mark-Xverbose \ + fchdir \ + fchmod \ + fchmodat \ + fchown \ + fchown32 \ + fchownat \ + fcntl \ + fcntl64 \ + fdatasync \ + fflush \ + file_handle \ + file_ioctl \ + finit_module \ + flock \ + fstat \ + fstat-Xabbrev \ + fstat-Xraw \ + fstat-Xverbose \ + fstat64 \ + fstat64-Xabbrev \ + fstat64-Xraw \ + fstat64-Xverbose \ + fstatat64 \ + fstatfs \ + fstatfs64 \ + fsync \ + ftruncate \ + ftruncate64 \ + futex \ + futimesat \ + get_mempolicy \ + getcpu \ + getcwd \ + getdents \ + getdents64 \ + getegid \ + getegid32 \ + geteuid \ + geteuid32 \ + getgid \ + getgid32 \ + getgroups \ + getgroups32 \ + getpeername \ + getpgrp \ + getpid \ + getppid \ + getrandom \ + getresgid \ + getresgid32 \ + getresuid \ + getresuid32 \ + getrlimit \ + getrusage \ + getsid \ + getsockname \ + getuid \ + getuid32 \ + getxxid \ + group_req \ + inet-cmsg \ + init_module \ + inotify \ + inotify_init1 \ + io_uring_enter \ + io_uring_register \ + io_uring_setup \ + ioctl \ + ioctl_block \ + ioctl_dm \ + ioctl_evdev \ + ioctl_inotify \ + ioctl_kvm_run \ + ioctl_kvm_run-v \ + ioctl_kvm_run_auxstr_vcpu \ + ioctl_loop \ + ioctl_mtd \ + ioctl_nbd \ + ioctl_perf \ + ioctl_ptp \ + ioctl_random \ + ioctl_rtc \ + ioctl_scsi \ + ioctl_sg_io_v3 \ + ioctl_sg_io_v4 \ + ioctl_sock_gifconf \ + ioctl_uffdio \ + ioctl_v4l2 \ + ioperm \ + iopl \ + ioprio \ + ioprio-Xabbrev \ + ioprio-Xraw \ + ioprio-Xverbose \ + ip_mreq \ + ipc \ + ipc_msg \ + ipc_msg-Xabbrev \ + ipc_msg-Xraw \ + ipc_msg-Xverbose \ + ipc_msgbuf \ + ipc_msgbuf-Xabbrev \ + ipc_msgbuf-Xraw \ + ipc_msgbuf-Xverbose \ + ipc_sem \ + ipc_sem-Xabbrev \ + ipc_sem-Xraw \ + ipc_sem-Xverbose \ + ipc_shm \ + ipc_shm-Xabbrev \ + ipc_shm-Xraw \ + ipc_shm-Xverbose \ + kcmp \ + kcmp-y \ + kern_features \ + kernel_version \ + kernel_version-Xabbrev \ + kernel_version-Xraw \ + kernel_version-Xverbose \ + kexec_file_load \ + kexec_load \ + keyctl \ + keyctl-Xabbrev \ + keyctl-Xraw \ + keyctl-Xverbose \ + kill \ + lchown \ + lchown32 \ + link \ + linkat \ + llseek \ + lookup_dcookie \ + lseek \ + lstat \ + lstat64 \ + madvise \ + mbind \ + membarrier \ + memfd_create \ + memfd_create-Xabbrev \ + memfd_create-Xraw \ + memfd_create-Xverbose \ + migrate_pages \ + mincore \ + mkdir \ + mkdirat \ + mknod \ + mknodat \ + mlock \ + mlock2 \ + mlockall \ + mmap \ + mmap-Xabbrev \ + mmap-Xraw \ + mmap-Xverbose \ + mmap64 \ + mmap64-Xabbrev \ + mmap64-Xraw \ + mmap64-Xverbose \ + mmsg \ + mmsg_name \ + modify_ldt \ + mount \ + mount-Xabbrev \ + mount-Xraw \ + mount-Xverbose \ + move_pages \ + move_pages-Xabbrev \ + move_pages-Xraw \ + move_pages-Xverbose \ + mq \ + mq_sendrecv \ + mq_sendrecv-read \ + mq_sendrecv-write \ + msg_control \ + msg_name \ + munlockall \ + nanosleep \ + net-icmp_filter \ + net-packet_mreq \ + net-packet_mreq-Xabbrev \ + net-packet_mreq-Xraw \ + net-packet_mreq-Xverbose \ + net-sockaddr \ + net-tpacket_req \ + net-tpacket_stats \ + net-y-unix \ + net-yy-inet \ + net-yy-inet6 \ + net-yy-netlink \ + net-yy-unix \ + netlink_audit \ + netlink_crypto \ + netlink_generic \ + netlink_kobject_uevent \ + netlink_netfilter \ + netlink_protocol \ + netlink_route \ + netlink_selinux \ + netlink_sock_diag \ + netlink_xfrm \ + newfstatat \ + nfnetlink_acct \ + nfnetlink_cthelper \ + nfnetlink_ctnetlink \ + nfnetlink_ctnetlink_exp \ + nfnetlink_cttimeout \ + nfnetlink_ipset \ + nfnetlink_nft_compat \ + nfnetlink_nftables \ + nfnetlink_osf \ + nfnetlink_queue \ + nfnetlink_ulog \ + nlattr \ + nlattr_br_port_msg \ + nlattr_crypto_user_alg \ + nlattr_dcbmsg \ + nlattr_fib_rule_hdr \ + nlattr_ifaddrlblmsg \ + nlattr_ifaddrmsg \ + nlattr_ifinfomsg \ + nlattr_ifla_af_spec \ + nlattr_ifla_brport \ + nlattr_ifla_linkinfo \ + nlattr_ifla_port \ + nlattr_ifla_xdp \ + nlattr_inet_diag_msg \ + nlattr_inet_diag_req_compat \ + nlattr_inet_diag_req_v2 \ + nlattr_mdba_mdb_entry \ + nlattr_mdba_router_port \ + nlattr_ndmsg \ + nlattr_ndtmsg \ + nlattr_netconfmsg \ + nlattr_netlink_diag_msg \ + nlattr_nlmsgerr \ + nlattr_packet_diag_msg \ + nlattr_rtgenmsg \ + nlattr_rtmsg \ + nlattr_smc_diag_msg \ + nlattr_tc_stats \ + nlattr_tca_stab \ + nlattr_tcamsg \ + nlattr_tcmsg \ + nlattr_unix_diag_msg \ + old_mmap \ + old_mmap-P \ + old_mmap-Xabbrev \ + old_mmap-Xraw \ + old_mmap-Xverbose \ + old_mmap-v-none \ + oldfstat \ + oldlstat \ + oldselect \ + oldselect-efault \ + oldstat \ + open \ + openat \ + osf_utimes \ + pause \ + perf_event_open \ + personality \ + personality-Xabbrev \ + personality-Xraw \ + personality-Xverbose \ + pidfd_send_signal \ + pipe \ + pipe2 \ + pkey_alloc \ + pkey_free \ + pkey_mprotect \ + poll \ + poll-P \ + ppoll \ + ppoll-P \ + prctl-arg2-intptr \ + prctl-dumpable \ + prctl-name \ + prctl-no-args \ + prctl-pdeathsig \ + prctl-securebits \ + prctl-tid_address \ + prctl-tsc \ + pread64-pwrite64 \ + preadv \ + preadv-pwritev \ + preadv2-pwritev2 \ + printpath-umovestr \ + printpath-umovestr-peekdata \ + printpath-umovestr-undumpable \ + printsignal-Xabbrev \ + printsignal-Xraw \ + printsignal-Xverbose \ + printstr \ + printstrn-umoven \ + printstrn-umoven-peekdata \ + printstrn-umoven-undumpable \ + prlimit64 \ + process_vm_readv \ + process_vm_writev \ + pselect6 \ + ptrace \ + ptrace_syscall_info \ + pwritev \ + quotactl \ + quotactl-Xabbrev \ + quotactl-Xraw \ + quotactl-Xverbose \ + quotactl-xfs \ + read-write \ + readahead \ + readdir \ + readlink \ + readlinkat \ + readv \ + reboot \ + recvfrom \ + recvmmsg-timeout \ + recvmsg \ + remap_file_pages \ + remap_file_pages-Xabbrev \ + remap_file_pages-Xraw \ + remap_file_pages-Xverbose \ + rename \ + renameat \ + renameat2 \ + request_key \ + riscv_flush_icache \ + rmdir \ + rt_sigaction \ + rt_sigpending \ + rt_sigprocmask \ + rt_sigqueueinfo \ + rt_sigreturn \ + rt_sigsuspend \ + rt_sigtimedwait \ + rt_tgsigqueueinfo \ + s390_guarded_storage \ + s390_guarded_storage-v \ + s390_pci_mmio_read_write \ + s390_runtime_instr \ + s390_sthyi \ + s390_sthyi-v \ + sched_get_priority_mxx \ + sched_rr_get_interval \ + sched_xetaffinity \ + sched_xetattr \ + sched_xetparam \ + sched_xetscheduler \ + sched_yield \ + seccomp-filter \ + seccomp_get_action_avail \ + select \ + semop \ + sendfile \ + sendfile64 \ + set_mempolicy \ + setdomainname \ + setfsgid \ + setfsgid32 \ + setfsuid \ + setfsuid32 \ + setgid \ + setgid32 \ + setgroups \ + setgroups32 \ + sethostname \ + setns \ + setregid \ + setregid32 \ + setresgid \ + setresgid32 \ + setresuid \ + setresuid32 \ + setreuid \ + setreuid32 \ + setrlimit \ + setrlimit-Xabbrev \ + setrlimit-Xraw \ + setrlimit-Xverbose \ + setuid \ + setuid32 \ + shmxt \ + shutdown \ + sigaction \ + sigaltstack \ + siginfo \ + signal \ + signalfd4 \ + sigpending \ + sigprocmask \ + sigreturn \ + sigsuspend \ + so_error \ + so_linger \ + so_peercred \ + so_peercred-Xabbrev \ + so_peercred-Xraw \ + so_peercred-Xverbose \ + sock_filter-v \ + sock_filter-v-Xabbrev \ + sock_filter-v-Xraw \ + sock_filter-v-Xverbose \ + sockaddr_xlat-Xabbrev \ + sockaddr_xlat-Xraw \ + sockaddr_xlat-Xverbose \ + socketcall \ + sockopt-sol_netlink \ + sockopt-timestamp \ + splice \ + stat \ + stat64 \ + statfs \ + statfs64 \ + statx \ + swap \ + sxetmask \ + symlink \ + symlinkat \ + sync \ + sync_file_range \ + sync_file_range2 \ + sysinfo \ + syslog \ + tee \ + time \ + timer_create \ + timer_xettime \ + timerfd_xettime \ + times \ + times-fail \ + truncate \ + truncate64 \ + ugetrlimit \ + uio \ + umask \ + umount \ + umount2 \ + umoven-illptr \ + umovestr \ + umovestr-illptr \ + umovestr2 \ + umovestr3 \ + uname \ + unlink \ + unlinkat \ + unshare \ + userfaultfd \ + ustat \ + utime \ + utimensat \ + utimensat-Xabbrev \ + utimensat-Xraw \ + utimensat-Xverbose \ + utimes \ + vhangup \ + vmsplice \ + wait4 \ + waitid \ + waitpid \ + xattr \ + xattr-strings \ + xet_robust_list \ + xet_thread_area_x86 \ + xetitimer \ + xetpgid \ + xetpriority \ + xettimeofday \ + # diff --git a/tests-m32/pure_executables.list b/tests-m32/pure_executables.list new file mode 100755 index 00000000..37225209 --- /dev/null +++ b/tests-m32/pure_executables.list @@ -0,0 +1,526 @@ +# Executables without side effects. +# +# Copyright (c) 2017-2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +_newselect +accept +accept4 +access +acct +add_key +adjtimex +aio +aio_pgetevents +alarm +bpf +bpf-obj_get_info_by_fd +bpf-obj_get_info_by_fd-prog +bpf-obj_get_info_by_fd-prog-v +bpf-obj_get_info_by_fd-v +bpf-v +brk +btrfs +caps +chmod +chown +chown32 +chroot +clock_adjtime +clock_nanosleep +clock_xettime +copy_file_range +creat +delete_module +dev-yy +dup +dup2 +dup3 +epoll_create +epoll_create1 +epoll_ctl +epoll_pwait +epoll_wait +erestartsys +eventfd +execve +execveat +faccessat +fadvise64 +fadvise64_64 +fallocate +fanotify_init +fanotify_mark +fanotify_mark-Xabbrev +fanotify_mark-Xraw +fanotify_mark-Xverbose +fchdir +fchmod +fchmodat +fchown +fchown32 +fchownat +fcntl +fcntl64 +fdatasync +fflush +file_handle +file_ioctl +finit_module +flock +fstat +fstat-Xabbrev +fstat-Xraw +fstat-Xverbose +fstat64 +fstat64-Xabbrev +fstat64-Xraw +fstat64-Xverbose +fstatat64 +fstatfs +fstatfs64 +fsync +ftruncate +ftruncate64 +futex +futimesat +get_mempolicy +getcpu +getcwd +getdents +getdents64 +getegid +getegid32 +geteuid +geteuid32 +getgid +getgid32 +getgroups +getgroups32 +getpeername +getpgrp +getpid +getppid +getrandom +getresgid +getresgid32 +getresuid +getresuid32 +getrlimit +getrusage +getsid +getsockname +getuid +getuid32 +getxxid +group_req +inet-cmsg +init_module +inotify +inotify_init1 +io_uring_enter +io_uring_register +io_uring_setup +ioctl +ioctl_block +ioctl_dm +ioctl_evdev +ioctl_inotify +ioctl_kvm_run +ioctl_kvm_run-v +ioctl_kvm_run_auxstr_vcpu +ioctl_loop +ioctl_mtd +ioctl_nbd +ioctl_perf +ioctl_ptp +ioctl_random +ioctl_rtc +ioctl_scsi +ioctl_sg_io_v3 +ioctl_sg_io_v4 +ioctl_sock_gifconf +ioctl_uffdio +ioctl_v4l2 +ioperm +iopl +ioprio +ioprio-Xabbrev +ioprio-Xraw +ioprio-Xverbose +ip_mreq +ipc +ipc_msg +ipc_msg-Xabbrev +ipc_msg-Xraw +ipc_msg-Xverbose +ipc_msgbuf +ipc_msgbuf-Xabbrev +ipc_msgbuf-Xraw +ipc_msgbuf-Xverbose +ipc_sem +ipc_sem-Xabbrev +ipc_sem-Xraw +ipc_sem-Xverbose +ipc_shm +ipc_shm-Xabbrev +ipc_shm-Xraw +ipc_shm-Xverbose +kcmp +kcmp-y +kern_features +kernel_version +kernel_version-Xabbrev +kernel_version-Xraw +kernel_version-Xverbose +kexec_file_load +kexec_load +keyctl +keyctl-Xabbrev +keyctl-Xraw +keyctl-Xverbose +kill +lchown +lchown32 +link +linkat +llseek +lookup_dcookie +lseek +lstat +lstat64 +madvise +mbind +membarrier +memfd_create +memfd_create-Xabbrev +memfd_create-Xraw +memfd_create-Xverbose +migrate_pages +mincore +mkdir +mkdirat +mknod +mknodat +mlock +mlock2 +mlockall +mmap +mmap-Xabbrev +mmap-Xraw +mmap-Xverbose +mmap64 +mmap64-Xabbrev +mmap64-Xraw +mmap64-Xverbose +mmsg +mmsg_name +modify_ldt +mount +mount-Xabbrev +mount-Xraw +mount-Xverbose +move_pages +move_pages-Xabbrev +move_pages-Xraw +move_pages-Xverbose +mq +mq_sendrecv +mq_sendrecv-read +mq_sendrecv-write +msg_control +msg_name +munlockall +nanosleep +net-icmp_filter +net-packet_mreq +net-packet_mreq-Xabbrev +net-packet_mreq-Xraw +net-packet_mreq-Xverbose +net-sockaddr +net-tpacket_req +net-tpacket_stats +net-y-unix +net-yy-inet +net-yy-inet6 +net-yy-netlink +net-yy-unix +netlink_audit +netlink_crypto +netlink_generic +netlink_kobject_uevent +netlink_netfilter +netlink_protocol +netlink_route +netlink_selinux +netlink_sock_diag +netlink_xfrm +newfstatat +nfnetlink_acct +nfnetlink_cthelper +nfnetlink_ctnetlink +nfnetlink_ctnetlink_exp +nfnetlink_cttimeout +nfnetlink_ipset +nfnetlink_nft_compat +nfnetlink_nftables +nfnetlink_osf +nfnetlink_queue +nfnetlink_ulog +nlattr +nlattr_br_port_msg +nlattr_crypto_user_alg +nlattr_dcbmsg +nlattr_fib_rule_hdr +nlattr_ifaddrlblmsg +nlattr_ifaddrmsg +nlattr_ifinfomsg +nlattr_ifla_af_spec +nlattr_ifla_brport +nlattr_ifla_linkinfo +nlattr_ifla_port +nlattr_ifla_xdp +nlattr_inet_diag_msg +nlattr_inet_diag_req_compat +nlattr_inet_diag_req_v2 +nlattr_mdba_mdb_entry +nlattr_mdba_router_port +nlattr_ndmsg +nlattr_ndtmsg +nlattr_netconfmsg +nlattr_netlink_diag_msg +nlattr_nlmsgerr +nlattr_packet_diag_msg +nlattr_rtgenmsg +nlattr_rtmsg +nlattr_smc_diag_msg +nlattr_tc_stats +nlattr_tca_stab +nlattr_tcamsg +nlattr_tcmsg +nlattr_unix_diag_msg +old_mmap +old_mmap-P +old_mmap-Xabbrev +old_mmap-Xraw +old_mmap-Xverbose +old_mmap-v-none +oldfstat +oldlstat +oldselect +oldselect-efault +oldstat +open +openat +osf_utimes +pause +perf_event_open +personality +personality-Xabbrev +personality-Xraw +personality-Xverbose +pidfd_send_signal +pipe +pipe2 +pkey_alloc +pkey_free +pkey_mprotect +poll +poll-P +ppoll +ppoll-P +prctl-arg2-intptr +prctl-dumpable +prctl-name +prctl-no-args +prctl-pdeathsig +prctl-securebits +prctl-tid_address +prctl-tsc +pread64-pwrite64 +preadv +preadv-pwritev +preadv2-pwritev2 +printpath-umovestr +printpath-umovestr-peekdata +printpath-umovestr-undumpable +printsignal-Xabbrev +printsignal-Xraw +printsignal-Xverbose +printstr +printstrn-umoven +printstrn-umoven-peekdata +printstrn-umoven-undumpable +prlimit64 +process_vm_readv +process_vm_writev +pselect6 +ptrace +ptrace_syscall_info +pwritev +quotactl +quotactl-Xabbrev +quotactl-Xraw +quotactl-Xverbose +quotactl-xfs +read-write +readahead +readdir +readlink +readlinkat +readv +reboot +recvfrom +recvmmsg-timeout +recvmsg +remap_file_pages +remap_file_pages-Xabbrev +remap_file_pages-Xraw +remap_file_pages-Xverbose +rename +renameat +renameat2 +request_key +riscv_flush_icache +rmdir +rt_sigaction +rt_sigpending +rt_sigprocmask +rt_sigqueueinfo +rt_sigreturn +rt_sigsuspend +rt_sigtimedwait +rt_tgsigqueueinfo +s390_guarded_storage +s390_guarded_storage-v +s390_pci_mmio_read_write +s390_runtime_instr +s390_sthyi +s390_sthyi-v +sched_get_priority_mxx +sched_rr_get_interval +sched_xetaffinity +sched_xetattr +sched_xetparam +sched_xetscheduler +sched_yield +seccomp-filter +seccomp_get_action_avail +select +semop +sendfile +sendfile64 +set_mempolicy +setdomainname +setfsgid +setfsgid32 +setfsuid +setfsuid32 +setgid +setgid32 +setgroups +setgroups32 +sethostname +setns +setregid +setregid32 +setresgid +setresgid32 +setresuid +setresuid32 +setreuid +setreuid32 +setrlimit +setrlimit-Xabbrev +setrlimit-Xraw +setrlimit-Xverbose +setuid +setuid32 +shmxt +shutdown +sigaction +sigaltstack +siginfo +signal +signalfd4 +sigpending +sigprocmask +sigreturn +sigsuspend +so_error +so_linger +so_peercred +so_peercred-Xabbrev +so_peercred-Xraw +so_peercred-Xverbose +sock_filter-v +sock_filter-v-Xabbrev +sock_filter-v-Xraw +sock_filter-v-Xverbose +sockaddr_xlat-Xabbrev +sockaddr_xlat-Xraw +sockaddr_xlat-Xverbose +socketcall +sockopt-sol_netlink +sockopt-timestamp +splice +stat +stat64 +statfs +statfs64 +statx +swap +sxetmask +symlink +symlinkat +sync +sync_file_range +sync_file_range2 +sysinfo +syslog +tee +time +timer_create +timer_xettime +timerfd_xettime +times +times-fail +truncate +truncate64 +ugetrlimit +uio +umask +umount +umount2 +umoven-illptr +umovestr +umovestr-illptr +umovestr2 +umovestr3 +uname +unlink +unlinkat +unshare +userfaultfd +ustat +utime +utimensat +utimensat-Xabbrev +utimensat-Xraw +utimensat-Xverbose +utimes +vhangup +vmsplice +wait4 +waitid +waitpid +xattr +xattr-strings +xet_robust_list +xet_thread_area_x86 +xetitimer +xetpgid +xetpriority +xettimeofday diff --git a/tests-m32/pwritev.c b/tests-m32/pwritev.c index 58e5b41e..a1442ab4 100644 --- a/tests-m32/pwritev.c +++ b/tests-m32/pwritev.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -65,7 +46,7 @@ print_iovec(const struct iovec *iov, unsigned int cnt, unsigned int size) if (i) fputs(", ", stdout); if (i == size) { - printf("%p", &iov[i]); + printf("... /* %p */", &iov[i]); break; } if (i == LIM) { diff --git a/tests-m32/pwritev.gen.test b/tests-m32/pwritev.gen.test new file mode 100755 index 00000000..e54fd154 --- /dev/null +++ b/tests-m32/pwritev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pwritev -a22 -s7); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -s7 diff --git a/tests-m32/pwritev.test b/tests-m32/pwritev.test deleted file mode 100755 index 0aed6835..00000000 --- a/tests-m32/pwritev.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check pwritev syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a22 -s7 diff --git a/tests-m32/qual_fault-exit_group.test b/tests-m32/qual_fault-exit_group.test index c98ffc6e..48a1b8c8 100755 --- a/tests-m32/qual_fault-exit_group.test +++ b/tests-m32/qual_fault-exit_group.test @@ -3,29 +3,10 @@ # Check decoding of fault injected exit_group syscall. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/scno_tampering.sh" @@ -41,13 +22,13 @@ test_with() match_diff } -test_with -eexit,exit_group -efault=exit_group:error=ENOSYS ./answer +test_with -eexit,exit_group -efault=exit_group:error=ENOSYS ../answer test_with -eexit,exit_group -efault=exit_group:error=ENOSYS \ - -efault=\!process:error=1 ./answer + -efault=\!process:error=1 ../answer test_with -eexit,exit_group -efault=all:error=ENOSYS \ - -efault=exit:error=1:when=2+ ./answer + -efault=exit:error=1:when=2+ ../answer test_with -eexit,exit_group -efault=exit_group:error=ENOSYS \ - -efault=\!desc,file,memory,process,signal,network,ipc:error=1 ./answer + -efault=\!%desc,%file,%memory,%process,%signal,%network,%ipc:error=1 ../answer diff --git a/tests-m32/qual_fault-syntax.test b/tests-m32/qual_fault-syntax.test index 85093fc7..c4fd27bf 100755 --- a/tests-m32/qual_fault-syntax.test +++ b/tests-m32/qual_fault-syntax.test @@ -2,30 +2,10 @@ # # Check -e fault= syntax. # -# Copyright (c) 2016=2017 Dmitry V. Levin +# Copyright (c) 2016-2018 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -40,16 +20,7 @@ fail_with() "strace -e fault=$* failed to handle an argument error properly" } -for arg in '' , ,, ,,, : :: ::: \! \!, \!: \ - invalid_syscall_name \ - invalid_syscall_name:when=3 \ - -1 \!-1 \ - -1:when=4 \ - -2 \ - -2:when=5 \ - 32767 \!32767 \ - 32767:when=6 \ - chdir:42 \!chdir:42 \ +for arg in chdir:42 \!chdir:42 \ chdir:42:when=7 \ chdir:invalid \ chdir:invalid:when=8 \ @@ -92,15 +63,15 @@ for arg in '' , ,, ,,, : :: ::: \! \!, \!: \ chdir:when=65536:error=30 \ chdir:when=1+65536 \ chdir:when=1+65536:error=31 \ - file,nonsense \ - \!desc,nonsense \ - chdir,nonsense \ - \!chdir,nonsense \ - 1,nonsense \ - \!1,nonsense \ chdir:retval=0 \ chdir:signal=1 \ chdir:error=1:error=2 \ + chdir:syscall=invalid \ + chdir:syscall=chdir \ + chdir:syscall=%file \ + chdir:syscall=-42 \ + chdir:syscall=42 \ + chdir:syscall=gettid:syscall=gettid \ ; do $STRACE -e fault="$arg" true 2> "$LOG" && fail_with "$arg" diff --git a/tests-m32/qual_fault-syscall.test b/tests-m32/qual_fault-syscall.test new file mode 100755 index 00000000..cae97f5e --- /dev/null +++ b/tests-m32/qual_fault-syscall.test @@ -0,0 +1,3 @@ +suffix=:syscall=gettid +name_override=qual_fault +. "${srcdir=.}/qual_fault.test" diff --git a/tests-m32/qual_fault.c b/tests-m32/qual_fault.c index d26dc7ce..63bbade0 100644 --- a/tests-m32/qual_fault.c +++ b/tests-m32/qual_fault.c @@ -2,44 +2,29 @@ * Check that fault injection works properly. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include #include +#include +#include #include #include #include #include #include #include +#include -static const int expfd = 4; -static const int gotfd = 5; +static int exp_fd; +static int got_fd; +static int out_fd; #define DEFAULT_ERRNO ENOSYS @@ -57,13 +42,13 @@ invoke(int fail) int rc; if (!fail) { - rc = write(expfd, io.iov_base, io.iov_len); + rc = write(exp_fd, io.iov_base, io.iov_len); if (rc != (int) io.iov_len) perror_msg_and_fail("write"); } errno = 0; - rc = writev(gotfd, &io, 1); + rc = writev(got_fd, &io, 1); if (fail) { if (!(rc == -1 && errno == err)) @@ -72,12 +57,13 @@ invoke(int fail) err, rc, errno); if (is_raw) - tprintf("writev(%#x, %p, 0x1) = -1 (errno %d)" - " (INJECTED)\n", gotfd, &io, err); + tprintf("writev(%#x, %p, 0x1)" + " = -1 %s (%m) (INJECTED)\n", + got_fd, &io, errstr); else tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%d}], 1)" " = -1 %s (%m) (INJECTED)\n", - gotfd, buf, (int) io.iov_len, errstr); + got_fd, buf, (int) io.iov_len, errstr); } else { if (rc != (int) io.iov_len) perror_msg_and_fail("expected %d" @@ -85,23 +71,35 @@ invoke(int fail) (int) io.iov_len, rc, errno); if (is_raw) - tprintf("writev(%#x, %p, 0x1) = %#x\n", gotfd, &io, rc); + tprintf("writev(%#x, %p, 0x1) = %#x\n", + got_fd, &io, rc); else tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%d}], 1)" " = %d\n", - gotfd, buf, (int) io.iov_len, (int) io.iov_len); + got_fd, buf, (int) io.iov_len, + (int) io.iov_len); } } -int -main(int argc, char *argv[]) +static int +open_file(const char *prefix, int proc) { - struct stat st; + static const int open_flags = O_WRONLY | O_TRUNC | O_CREAT; + static char path[PATH_MAX + 1]; + + snprintf(path, sizeof(path), "%s.%d", prefix, proc); - assert(fstat(expfd, &st) == 0); - assert(fstat(gotfd, &st) == 0); + int fd = open(path, open_flags, 0600); + if (fd < 0) + perror_msg_and_fail("open: %s", path); - assert(argc == 6); + return fd; +} + +int +main(int argc, char *argv[]) +{ + assert(argc == 11); is_raw = !strcmp("raw", argv[1]); @@ -124,25 +122,71 @@ main(int argc, char *argv[]) first = atoi(argv[3]); step = atoi(argv[4]); iter = atoi(argv[5]); + int num_procs = atoi(argv[6]); + char *exp_prefix = argv[7]; + char *got_prefix = argv[8]; + char *out_prefix = argv[9]; + char *pid_prefix = argv[10]; assert(first > 0); assert(step >= 0); + assert(num_procs > 0); + + int proc; + for (proc = 0; proc < num_procs; ++proc) { + int ret = fork(); - tprintf("%s", ""); + if (ret < 0) + perror_msg_and_fail("fork"); - int i; - for (i = 1; i <= iter; ++i) { - int fail = 0; - if (first > 0) { - --first; - if (first == 0) { - fail = 1; - first = step; + if (ret > 0) { + int pidfd = open_file(pid_prefix, proc); + + char pidstr[sizeof(ret) * 3]; + int len = snprintf(pidstr, sizeof(pidstr), "%d", ret); + assert(len > 0 && len < (int) sizeof(pidstr)); + assert(write(pidfd, pidstr, len) == len); + + close(pidfd); + + continue; + } + + tprintf("%s", ""); + + exp_fd = open_file(exp_prefix, proc); + got_fd = open_file(got_prefix, proc); + out_fd = open_file(out_prefix, proc); + + /* This magic forces tprintf to write where we want it. */ + dup2(out_fd, 3); + + int i; + for (i = 1; i <= iter; ++i) { + int fail = 0; + if (first > 0) { + --first; + if (first == 0) { + fail = 1; + first = step; + } } + invoke(fail); } - invoke(fail); + + tprintf("%s\n", "+++ exited with 0 +++"); + return 0; + } + + for (proc = 0; proc < num_procs; ++proc) { + int status; + int ret = wait(&status); + if (ret <= 0) + perror_msg_and_fail("wait %d", proc); + if (status) + error_msg_and_fail("wait: pid=%d status=%d", + ret, status); } - tprintf("%s\n", "+++ exited with 0 +++"); return 0; } diff --git a/tests-m32/qual_fault.test b/tests-m32/qual_fault.test index e194a787..497e35ea 100755 --- a/tests-m32/qual_fault.test +++ b/tests-m32/qual_fault.test @@ -1,31 +1,12 @@ -#!/bin/sh +#!/bin/sh -efu # # Check that fault injection works properly. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/scno_tampering.sh" @@ -34,16 +15,20 @@ # F+ # F+S -N=16 +N=100 + +: ${suffix=} +[ -z "${name_override-}" ] || NAME="$name_override" check_fault_injection() { - local trace fault err first step extra + local trace fault err first step procs extra trace=$1; shift fault=$1; shift err=$1; shift first=$1; shift step=$1; shift + procs=$1; shift extra="$*" local when= @@ -73,31 +58,39 @@ check_fault_injection() outexp="$NAME.out.exp" outgot="$NAME.out.got" + outout="$NAME.out.out" + outpid="$NAME.pid" + + run_strace -a11 -ff -e trace=$trace \ + "$@" -e fault=$fault$when$error$suffix $extra \ + ../$NAME $raw "$err" "$first" "$step" $N \ + "$procs" "$outexp" "$outgot" "$outout" "$outpid" - run_strace -a11 -e trace=$trace \ - "$@" -e fault=$fault$when$error $extra \ - ./$NAME $raw "$err" "$first" "$step" $N \ - > "$EXP" 4> "$outexp" 5> "$outgot" + for i in $(seq 0 $((procs - 1)) ) + do + pid=$(cat "$outpid.$i") - match_diff "$EXP" "$LOG" - match_diff "$outexp" "$outgot" - rm -f "$EXP" "$outexp" "$outgot" + match_diff "$LOG.$pid" "$outout.$i" + match_diff "$outgot.$i" "$outexp.$i" + done } for err in '' ENOSYS 22 einval; do for fault in writev desc,51; do check_fault_injection \ - writev $fault "$err" '' '' -efault=chdir + writev $fault "$err" '' '' 1 -efault=chdir check_fault_injection \ - writev $fault "$err" '' '' -efault=chdir -efault=none + writev $fault "$err" '' '' 1 -efault=chdir -efault=none for F in 1 2 3 5 7 11; do check_fault_injection \ - writev $fault "$err" $F '' + writev $fault "$err" $F '' 1 check_fault_injection \ - writev $fault "$err" $F + + writev $fault "$err" $F + 1 for S in 1 2 3 5 7 11; do check_fault_injection \ - writev $fault "$err" $F $S + writev $fault "$err" $F $S 1 + check_fault_injection \ + writev $fault "$err" $F $S 4 done done done diff --git a/tests-m32/qual_inject-error-signal-syscall.test b/tests-m32/qual_inject-error-signal-syscall.test new file mode 100755 index 00000000..0adb35d7 --- /dev/null +++ b/tests-m32/qual_inject-error-signal-syscall.test @@ -0,0 +1,3 @@ +suffix=:syscall=gettid +name_override=qual_inject-error-signal +. "${srcdir=.}/qual_inject-error-signal.test" diff --git a/tests-m32/qual_inject-error-signal.c b/tests-m32/qual_inject-error-signal.c index f4ccd824..4c89d78a 100644 --- a/tests-m32/qual_inject-error-signal.c +++ b/tests-m32/qual_inject-error-signal.c @@ -1,30 +1,10 @@ /* * Check fault injection along with signal injection. * - * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/qual_inject-error-signal.test b/tests-m32/qual_inject-error-signal.test index fcbcc398..2392e8bd 100755 --- a/tests-m32/qual_inject-error-signal.test +++ b/tests-m32/qual_inject-error-signal.test @@ -1,8 +1,18 @@ #!/bin/sh - +# # Check fault injection along with signal injection. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/scno_tampering.sh" -run_strace -a12 -echdir,exit_group -einject=chdir:error=ENOENT:signal=USR1 \ - "./$NAME" +: ${suffix=} +[ -z "${name_override-}" ] || NAME="$name_override" + +run_strace -a12 -echdir,exit_group \ + -einject=chdir:error=ENOENT:signal=USR1"$suffix" \ + "../$NAME" match_diff diff --git a/tests-m32/qual_inject-retval-syscall.test b/tests-m32/qual_inject-retval-syscall.test new file mode 100755 index 00000000..fca9354c --- /dev/null +++ b/tests-m32/qual_inject-retval-syscall.test @@ -0,0 +1,3 @@ +suffix=:syscall=gettid +name_override=qual_inject-retval +. "${srcdir=.}/qual_inject-retval.test" diff --git a/tests-m32/qual_inject-retval.c b/tests-m32/qual_inject-retval.c index ac9801eb..16419a49 100644 --- a/tests-m32/qual_inject-retval.c +++ b/tests-m32/qual_inject-retval.c @@ -2,29 +2,10 @@ * Check success injection. * * Copyright (c) 2017 Elvira Khabirova + * Copyright (c) 2017-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/qual_inject-retval.test b/tests-m32/qual_inject-retval.test index 419030ad..956d373d 100755 --- a/tests-m32/qual_inject-retval.test +++ b/tests-m32/qual_inject-retval.test @@ -1,9 +1,17 @@ #!/bin/sh - +# # Check success injection. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/scno_tampering.sh" +: ${suffix=} +[ -z "${name_override-}" ] || NAME="$name_override" + check_injection() { local syscall rval @@ -11,10 +19,9 @@ check_injection() syscall=chdir rval="$1"; shift - run_strace -a12 -e$syscall -einject="$syscall:retval=$rval" "$@" \ - ./qual_inject-retval "$rval" > "$EXP" + run_strace -a12 -e$syscall -einject="$syscall:retval=$rval$suffix" "$@" \ + ../qual_inject-retval "$rval" > "$EXP" match_diff "$LOG" "$EXP" - rm -f "$EXP" } check_injection 0 diff --git a/tests-m32/qual_inject-signal-syscall.test b/tests-m32/qual_inject-signal-syscall.test new file mode 100755 index 00000000..42e9a268 --- /dev/null +++ b/tests-m32/qual_inject-signal-syscall.test @@ -0,0 +1,3 @@ +suffix=:syscall=gettid +name_override=qual_inject-signal +. "${srcdir=.}/qual_inject-signal.test" diff --git a/tests-m32/qual_inject-signal.c b/tests-m32/qual_inject-signal.c index ff56a286..c09b8322 100644 --- a/tests-m32/qual_inject-signal.c +++ b/tests-m32/qual_inject-signal.c @@ -1,30 +1,10 @@ /* * Check that signal injection works properly. * - * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/qual_inject-signal.test b/tests-m32/qual_inject-signal.test index 88002ce9..54a3498d 100755 --- a/tests-m32/qual_inject-signal.test +++ b/tests-m32/qual_inject-signal.test @@ -1,8 +1,17 @@ #!/bin/sh - +# # Check signal injection. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" -run_strace -a12 -echdir,exit_group -einject=chdir:signal=USR1 \ - ./$NAME +: ${suffix=} +[ -z "${name_override-}" ] || NAME="$name_override" + +run_strace -a12 -echdir,exit_group -einject=chdir:signal=USR1"$suffix" \ + ../$NAME match_diff diff --git a/tests-m32/qual_inject-syntax.test b/tests-m32/qual_inject-syntax.test index a9e44d74..53245345 100755 --- a/tests-m32/qual_inject-syntax.test +++ b/tests-m32/qual_inject-syntax.test @@ -2,30 +2,10 @@ # # Check -e inject= syntax. # -# Copyright (c) 2016-2017 Dmitry V. Levin +# Copyright (c) 2016-2018 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -40,17 +20,7 @@ fail_with() "strace -e inject=$* failed to handle an argument error properly" } -for arg in '' , ,, ,,, : :: ::: \! \!, \!: \ - invalid_syscall_name \ - invalid_syscall_name:when=3 \ - -1 \!-1 \ - -1:when=4 \ - -2 \ - -2:when=5 \ - 32767 \!32767 \ - 32767:when=6 \ - 42 \ - chdir \ +for arg in 42 chdir \ chdir:42 \!chdir:42 \ chdir:42:when=7 \ chdir:invalid \ @@ -94,20 +64,30 @@ for arg in '' , ,, ,,, : :: ::: \! \!, \!: \ chdir:when=65536:error=30 \ chdir:when=1+65536 \ chdir:when=1+65536:error=31 \ - file,nonsense \ - \!desc,nonsense \ - chdir,nonsense \ - \!chdir,nonsense \ - 1,nonsense \ - \!1,nonsense \ - chdir:retval=-1 \ + chdir:retval=a \ + chdir:retval=0b \ + chdir:retval=0x10000000000000000 \ chdir:signal=0 \ chdir:signal=129 \ + chdir:signal=1:signal=2 \ + chdir:signal=1:retval=0:signal=2 \ chdir:retval=0:retval=1 \ chdir:error=1:error=2 \ chdir:retval=0:error=1 \ chdir:error=1:retval=0 \ chdir:retval=0:signal=1:error=1 \ + chdir:delay_enter=-1 \ + chdir:delay_exit=-2 \ + chdir:delay_enter=1:delay_enter=2 \ + chdir:delay_exit=3:delay_exit=4 \ + chdir:delay_enter=5:delay_exit=6:delay_enter=7 \ + chdir:delay_exit=8:delay_enter=9:delay_exit=10 \ + chdir:syscall=invalid \ + chdir:syscall=chdir \ + chdir:syscall=%file \ + chdir:syscall=-42 \ + chdir:syscall=42 \ + chdir:syscall=gettid:syscall=gettid \ ; do $STRACE -e inject="$arg" true 2> "$LOG" && fail_with "$arg" diff --git a/tests-m32/qual_signal.c b/tests-m32/qual_signal.c index 106dabea..31dc8f7d 100644 --- a/tests-m32/qual_signal.c +++ b/tests-m32/qual_signal.c @@ -1,30 +1,10 @@ /* * Check how strace -e signal=set works. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/qual_signal.test b/tests-m32/qual_signal.test index 54a37a30..8fd2b69d 100755 --- a/tests-m32/qual_signal.test +++ b/tests-m32/qual_signal.test @@ -3,29 +3,10 @@ # Check how strace -e signal=set works. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -34,10 +15,9 @@ test_one_sig() local sigs sigs="$1"; shift - run_prog "./$NAME" "$@" > /dev/null - run_strace -e trace=none -e signal="$sigs" "./$NAME" "$@" > "$EXP" + run_prog "../$NAME" "$@" > /dev/null + run_strace -e trace=none -e signal="$sigs" "../$NAME" "$@" > "$EXP" match_diff "$LOG" "$EXP" - rm -f "$EXP" } test_sigs() diff --git a/tests-m32/qual_syscall.test b/tests-m32/qual_syscall.test index f7eb06d5..945fc8c7 100755 --- a/tests-m32/qual_syscall.test +++ b/tests-m32/qual_syscall.test @@ -2,20 +2,25 @@ # Check how strace -e abbrev=set, -e raw=set, -e trace=set, # and -e verbose=set work. +# +# Copyright (c) 2014-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./umovestr -pattern_abbrev_verbose='execve("\./umovestr", \["\./umovestr"\], \[/\* [[:digit:]]* vars \*/\]) = 0' -pattern_nonabbrev_verbose='execve("\./umovestr", \["\./umovestr"\], \[".*\"\(\.\.\.\)\?\]) = 0' -pattern_nonverbose='execve("\./umovestr", 0x[[:xdigit:]]*, 0x[[:xdigit:]]*) = 0' +run_prog ../umovestr +pattern_abbrev_verbose='execve("\.\./umovestr", \["\.\./umovestr"\], 0x[[:xdigit:]]* /\* [[:digit:]]* vars \*/) = 0' +pattern_nonabbrev_verbose='execve("\.\./umovestr", \["\.\./umovestr"\], \[".*\"\(\.\.\.\)\?\]) = 0' +pattern_nonverbose='execve("\.\./umovestr", 0x[[:xdigit:]]*, 0x[[:xdigit:]]*) = 0' pattern_raw='execve(0x[[:xdigit:]]*, 0x[[:xdigit:]]*, 0x[[:xdigit:]]*) = 0' check_output_mismatch() { local pattern pattern="$1"; shift - run_strace "$@" ./umovestr + run_strace "$@" ../umovestr LC_ALL=C grep -x "$pattern" "$LOG" > /dev/null || { printf '%s\n%s\n' \ 'Failed patterns of expected output:' "$pattern" @@ -28,15 +33,19 @@ LC_ALL=C grep -v -x "$pattern_abbrev_verbose" "$LOG" | LC_ALL=C grep '^[[:alnum:]_]*(' > /dev/null && dump_log_and_fail_with "$STRACE $args unexpected output" -check_output_mismatch "$pattern_abbrev_verbose" -e trace=process +check_output_mismatch "$pattern_abbrev_verbose" -e trace=%process LC_ALL=C grep '^chdir' "$LOG" > /dev/null && dump_log_and_fail_with "$STRACE $args unexpected output" -run_strace -e 42 ./umovestr +run_strace -e 42 ../umovestr LC_ALL=C grep '^[[:alnum:]_]*(' "$LOG" > /dev/null && dump_log_and_fail_with "$STRACE $args unexpected output" -for a in execve \!chdir all \!none \ +run_strace -e/ -e42 ../umovestr +LC_ALL=C grep '^[[:alnum:]_]*(' "$LOG" > /dev/null && + dump_log_and_fail_with "$STRACE $args unexpected output" + +for a in execve \!chdir /. all \!none \ file process \!desc \!ipc \!memory \!network \!signal; do check_output_mismatch \ "$pattern_abbrev_verbose" -e abbrev="$a" -e execve diff --git a/tests-m32/qualify_personality.sh b/tests-m32/qualify_personality.sh new file mode 100644 index 00000000..d57314fc --- /dev/null +++ b/tests-m32/qualify_personality.sh @@ -0,0 +1,74 @@ +#! /bin/sh -efu +# +# Common code for per-personality qualification tests +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +[ 2 -le "$#" ] || + fail_ 'No personality designation ("64", "32", "x32") specified' + +pers="$1" +shift +trace_expr="$1" +shift +skip="${1-}" + +case "$STRACE_NATIVE_ARCH" in +x86_64) + supported_pers='64 32 x32' + ;; +x32) + supported_pers='x32 32' + ;; +aarch64|powerpc64|riscv|s390x|sparc64|tile) + supported_pers='64 32' + ;; +*) + supported_pers="$(($SIZEOF_LONG * 8))" + ;; +esac + +# Detect current personality designation +if [ "x$STRACE_NATIVE_ARCH" = "x$STRACE_ARCH" ]; then + case "$STRACE_NATIVE_ARCH" in + x32) + cur_pers=x32 + ;; + *) + cur_pers="$(($SIZEOF_LONG * 8))" + ;; + esac +else + if [ "x$SIZEOF_KERNEL_LONG_T" = "x$SIZEOF_LONG" ]; then + [ 4 -eq "$SIZEOF_LONG" ] || + fail_ "sizeof(long) = $SIZEOF_LONG != 4" + cur_pers=32 + else + [ 8 -eq "$SIZEOF_KERNEL_LONG_T" ] || + fail_ "sizeof(kernel_long_t) = $SIZEOF_KERNEL_LONG_T != 8" + [ 4 -eq "$SIZEOF_LONG" ] || + fail_ "sizeof(long) = $SIZEOF_LONG != 4" + cur_pers=x32 + fi +fi + +pers_found=0 +set -- $supported_pers +for i; do + [ "x$pers" != "x$i" ] || pers_found=1 +done + +[ "$pers_found" = 1 ] || + skip_ "Personality '$pers' is not supported on architecture" \ + "'$STRACE_NATIVE_ARCH' (supported personalities: $supported_pers)" + +# If tested personality is not equivalent to current personality, reset $NAME, +# so "$NAME.in", which is used by test_trace_expr, points to an empty file. +[ "x$pers" = "x$cur_pers" ] || NAME=qualify_personality_empty + +test_trace_expr "$skip" -e trace="${trace_expr}@${pers}" diff --git a/tests-m32/qualify_personality_empty.in b/tests-m32/qualify_personality_empty.in new file mode 100644 index 00000000..e69de29b diff --git a/tests-m32/quotactl-Xabbrev.c b/tests-m32/quotactl-Xabbrev.c new file mode 100644 index 00000000..e2b3c502 --- /dev/null +++ b/tests-m32/quotactl-Xabbrev.c @@ -0,0 +1 @@ +#include "quotactl.c" diff --git a/tests-m32/quotactl-Xabbrev.gen.test b/tests-m32/quotactl-Xabbrev.gen.test new file mode 100755 index 00000000..67c27d35 --- /dev/null +++ b/tests-m32/quotactl-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (quotactl-Xabbrev -Xabbrev -e trace=quotactl); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xabbrev -e trace=quotactl diff --git a/tests-m32/quotactl-Xraw.c b/tests-m32/quotactl-Xraw.c new file mode 100644 index 00000000..f6dd8ffe --- /dev/null +++ b/tests-m32/quotactl-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "quotactl.c" diff --git a/tests-m32/quotactl-Xraw.gen.test b/tests-m32/quotactl-Xraw.gen.test new file mode 100755 index 00000000..8f2f25b0 --- /dev/null +++ b/tests-m32/quotactl-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (quotactl-Xraw -a27 -Xraw -e trace=quotactl); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 -Xraw -e trace=quotactl diff --git a/tests-m32/quotactl-Xverbose.c b/tests-m32/quotactl-Xverbose.c new file mode 100644 index 00000000..55d484e8 --- /dev/null +++ b/tests-m32/quotactl-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "quotactl.c" diff --git a/tests-m32/quotactl-Xverbose.gen.test b/tests-m32/quotactl-Xverbose.gen.test new file mode 100755 index 00000000..7d06db57 --- /dev/null +++ b/tests-m32/quotactl-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (quotactl-Xverbose -Xverbose -e trace=quotactl); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xverbose -e trace=quotactl diff --git a/tests-m32/quotactl-success-v.c b/tests-m32/quotactl-success-v.c new file mode 100644 index 00000000..4d1c7b30 --- /dev/null +++ b/tests-m32/quotactl-success-v.c @@ -0,0 +1,2 @@ +#define INJECT_RETVAL 42 +#include "quotactl-v.c" diff --git a/tests-m32/quotactl-success-v.test b/tests-m32/quotactl-success-v.test new file mode 100755 index 00000000..b8112042 --- /dev/null +++ b/tests-m32/quotactl-success-v.test @@ -0,0 +1,11 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +run_strace -v -e trace=quotactl -e inject=quotactl:retval=42 ../quotactl-success-v > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests-m32/quotactl-success.c b/tests-m32/quotactl-success.c new file mode 100644 index 00000000..aa2b9dc0 --- /dev/null +++ b/tests-m32/quotactl-success.c @@ -0,0 +1,2 @@ +#define INJECT_RETVAL 42 +#include "quotactl.c" diff --git a/tests-m32/quotactl-success.test b/tests-m32/quotactl-success.test new file mode 100755 index 00000000..d041ebd9 --- /dev/null +++ b/tests-m32/quotactl-success.test @@ -0,0 +1,11 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +run_strace -e trace=quotactl -e inject=quotactl:retval=42 ../quotactl-success > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests-m32/quotactl-v.gen.test b/tests-m32/quotactl-v.gen.test new file mode 100755 index 00000000..8659ed23 --- /dev/null +++ b/tests-m32/quotactl-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (quotactl-v -v -e trace=quotactl); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=quotactl diff --git a/tests-m32/quotactl-v.test b/tests-m32/quotactl-v.test deleted file mode 100755 index 6adaf82c..00000000 --- a/tests-m32/quotactl-v.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check non-abbreviated decoding of quotactl syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -e trace=quotactl diff --git a/tests-m32/quotactl-xfs-success-v.c b/tests-m32/quotactl-xfs-success-v.c new file mode 100644 index 00000000..6e7b2b51 --- /dev/null +++ b/tests-m32/quotactl-xfs-success-v.c @@ -0,0 +1,2 @@ +#define INJECT_RETVAL 42 +#include "quotactl-xfs-v.c" diff --git a/tests-m32/quotactl-xfs-success-v.test b/tests-m32/quotactl-xfs-success-v.test new file mode 100755 index 00000000..7bcfa8ac --- /dev/null +++ b/tests-m32/quotactl-xfs-success-v.test @@ -0,0 +1,11 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +run_strace -v -e trace=quotactl -e inject=quotactl:retval=42 ../quotactl-xfs-success-v > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests-m32/quotactl-xfs-success.c b/tests-m32/quotactl-xfs-success.c new file mode 100644 index 00000000..f498b8ae --- /dev/null +++ b/tests-m32/quotactl-xfs-success.c @@ -0,0 +1,2 @@ +#define INJECT_RETVAL 42 +#include "quotactl-xfs.c" diff --git a/tests-m32/quotactl-xfs-success.test b/tests-m32/quotactl-xfs-success.test new file mode 100755 index 00000000..e9041dad --- /dev/null +++ b/tests-m32/quotactl-xfs-success.test @@ -0,0 +1,11 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +run_strace -e trace=quotactl -e inject=quotactl:retval=42 ../quotactl-xfs-success > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests-m32/quotactl-xfs-v.gen.test b/tests-m32/quotactl-xfs-v.gen.test new file mode 100755 index 00000000..f1f7e0ae --- /dev/null +++ b/tests-m32/quotactl-xfs-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (quotactl-xfs-v -v -e trace=quotactl); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=quotactl diff --git a/tests-m32/quotactl-xfs-v.test b/tests-m32/quotactl-xfs-v.test deleted file mode 100755 index d5ffc7d6..00000000 --- a/tests-m32/quotactl-xfs-v.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check non-abbreviated decoding of quotactl xfs subcommands. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -e trace=quotactl diff --git a/tests-m32/quotactl-xfs.c b/tests-m32/quotactl-xfs.c index e420d1c9..1fae566d 100644 --- a/tests-m32/quotactl-xfs.c +++ b/tests-m32/quotactl-xfs.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -70,7 +51,7 @@ struct fs_quota_statv { struct fs_qfilestatv qs_pquota; /* project quota information */ int32_t qs_btimelimit; /* limit for blks timer */ int32_t qs_itimelimit; /* limit for inodes timer */ - int32_t qs_rtbtimelimit; /* limit for rt blks timer */ + int32_t qs_rtbtimelimit; /* limit for rt blks timer */ uint16_t qs_bwarnlimit; /* limit for num warnings */ uint16_t qs_iwarnlimit; /* limit for num warnings */ uint64_t qs_pad2[8]; /* for future proofing */ @@ -91,34 +72,34 @@ print_xdisk_quota(int rc, void *ptr, void *arg) struct fs_disk_quota *dq = ptr; long out_arg = (long) arg; - if (((rc != 0) && out_arg) || (out_arg > 1)) { + if (((rc < 0) && out_arg) || (out_arg > 1)) { printf("%p", dq); return; } - PRINT_FIELD_D("{", dq, d_version); + PRINT_FIELD_D("{", *dq, d_version); printf(", d_flags="); printflags(xfs_dqblk_flags, (uint8_t) dq->d_flags, "XFS_???_QUOTA"); - PRINT_FIELD_X(", ", dq, d_fieldmask); - PRINT_FIELD_U(", ", dq, d_id); - PRINT_FIELD_U(", ", dq, d_blk_hardlimit); - PRINT_FIELD_U(", ", dq, d_blk_softlimit); - PRINT_FIELD_U(", ", dq, d_ino_hardlimit); - PRINT_FIELD_U(", ", dq, d_ino_softlimit); - PRINT_FIELD_U(", ", dq, d_bcount); - PRINT_FIELD_U(", ", dq, d_icount); + PRINT_FIELD_X(", ", *dq, d_fieldmask); + PRINT_FIELD_U(", ", *dq, d_id); + PRINT_FIELD_U(", ", *dq, d_blk_hardlimit); + PRINT_FIELD_U(", ", *dq, d_blk_softlimit); + PRINT_FIELD_U(", ", *dq, d_ino_hardlimit); + PRINT_FIELD_U(", ", *dq, d_ino_softlimit); + PRINT_FIELD_U(", ", *dq, d_bcount); + PRINT_FIELD_U(", ", *dq, d_icount); # if VERBOSE - PRINT_FIELD_D(", ", dq, d_itimer); - PRINT_FIELD_D(", ", dq, d_btimer); - PRINT_FIELD_U(", ", dq, d_iwarns); - PRINT_FIELD_U(", ", dq, d_bwarns); - PRINT_FIELD_U(", ", dq, d_rtb_hardlimit); - PRINT_FIELD_U(", ", dq, d_rtb_softlimit); - PRINT_FIELD_U(", ", dq, d_rtbcount); - PRINT_FIELD_D(", ", dq, d_rtbtimer); - PRINT_FIELD_U(", ", dq, d_rtbwarns); + PRINT_FIELD_D(", ", *dq, d_itimer); + PRINT_FIELD_D(", ", *dq, d_btimer); + PRINT_FIELD_U(", ", *dq, d_iwarns); + PRINT_FIELD_U(", ", *dq, d_bwarns); + PRINT_FIELD_U(", ", *dq, d_rtb_hardlimit); + PRINT_FIELD_U(", ", *dq, d_rtb_softlimit); + PRINT_FIELD_U(", ", *dq, d_rtbcount); + PRINT_FIELD_D(", ", *dq, d_rtbtimer); + PRINT_FIELD_U(", ", *dq, d_rtbwarns); # else printf(", ..."); # endif /* !VERBOSE */ @@ -131,28 +112,28 @@ print_xquota_stat(int rc, void *ptr, void *arg) struct fs_quota_stat *qs = ptr; long out_arg = (long) arg; - if (((rc != 0) && out_arg) || (out_arg > 1)) { + if (((rc < 0) && out_arg) || (out_arg > 1)) { printf("%p", qs); return; } - PRINT_FIELD_D("{", qs, qs_version); + PRINT_FIELD_D("{", *qs, qs_version); # if VERBOSE printf(", qs_flags="); printflags(xfs_quota_flags, qs->qs_flags, "XFS_QUOTA_???"); - PRINT_FIELD_U(", qs_uquota={", &qs->qs_uquota, qfs_ino); - PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nblks); - PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nextents); - PRINT_FIELD_U("}, qs_gquota={", &qs->qs_gquota, qfs_ino); - PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nblks); - PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nextents); - PRINT_FIELD_U("}, ", qs, qs_incoredqs); - PRINT_FIELD_D(", ", qs, qs_btimelimit); - PRINT_FIELD_D(", ", qs, qs_itimelimit); - PRINT_FIELD_D(", ", qs, qs_rtbtimelimit); - PRINT_FIELD_U(", ", qs, qs_bwarnlimit); - PRINT_FIELD_U(", ", qs, qs_iwarnlimit); + PRINT_FIELD_U(", qs_uquota={", qs->qs_uquota, qfs_ino); + PRINT_FIELD_U(", ", qs->qs_uquota, qfs_nblks); + PRINT_FIELD_U(", ", qs->qs_uquota, qfs_nextents); + PRINT_FIELD_U("}, qs_gquota={", qs->qs_gquota, qfs_ino); + PRINT_FIELD_U(", ", qs->qs_gquota, qfs_nblks); + PRINT_FIELD_U(", ", qs->qs_gquota, qfs_nextents); + PRINT_FIELD_U("}, ", *qs, qs_incoredqs); + PRINT_FIELD_D(", ", *qs, qs_btimelimit); + PRINT_FIELD_D(", ", *qs, qs_itimelimit); + PRINT_FIELD_D(", ", *qs, qs_rtbtimelimit); + PRINT_FIELD_U(", ", *qs, qs_bwarnlimit); + PRINT_FIELD_U(", ", *qs, qs_iwarnlimit); # else printf(", ..."); # endif /* !VERBOSE */ @@ -165,31 +146,31 @@ print_xquota_statv(int rc, void *ptr, void *arg) struct fs_quota_statv *qs = ptr; long out_arg = (long) arg; - if (((rc != 0) && out_arg) || (out_arg > 1)) { + if (((rc < 0) && out_arg) || (out_arg > 1)) { printf("%p", qs); return; } - PRINT_FIELD_D("{", qs, qs_version); + PRINT_FIELD_D("{", *qs, qs_version); # if VERBOSE printf(", qs_flags="); printflags(xfs_quota_flags, qs->qs_flags, "XFS_QUOTA_???"); - PRINT_FIELD_U(", ", qs, qs_incoredqs); - PRINT_FIELD_U(", qs_uquota={", &qs->qs_uquota, qfs_ino); - PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nblks); - PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nextents); - PRINT_FIELD_U("}, qs_gquota={", &qs->qs_gquota, qfs_ino); - PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nblks); - PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nextents); - PRINT_FIELD_U("}, qs_pquota={", &qs->qs_pquota, qfs_ino); - PRINT_FIELD_U(", ", &qs->qs_pquota, qfs_nblks); - PRINT_FIELD_U(", ", &qs->qs_pquota, qfs_nextents); - PRINT_FIELD_D("}, ", qs, qs_btimelimit); - PRINT_FIELD_D(", ", qs, qs_itimelimit); - PRINT_FIELD_D(", ", qs, qs_rtbtimelimit); - PRINT_FIELD_U(", ", qs, qs_bwarnlimit); - PRINT_FIELD_U(", ", qs, qs_iwarnlimit); + PRINT_FIELD_U(", ", *qs, qs_incoredqs); + PRINT_FIELD_U(", qs_uquota={", qs->qs_uquota, qfs_ino); + PRINT_FIELD_U(", ", qs->qs_uquota, qfs_nblks); + PRINT_FIELD_U(", ", qs->qs_uquota, qfs_nextents); + PRINT_FIELD_U("}, qs_gquota={", qs->qs_gquota, qfs_ino); + PRINT_FIELD_U(", ", qs->qs_gquota, qfs_nblks); + PRINT_FIELD_U(", ", qs->qs_gquota, qfs_nextents); + PRINT_FIELD_U("}, qs_pquota={", qs->qs_pquota, qfs_ino); + PRINT_FIELD_U(", ", qs->qs_pquota, qfs_nblks); + PRINT_FIELD_U(", ", qs->qs_pquota, qfs_nextents); + PRINT_FIELD_D("}, ", *qs, qs_btimelimit); + PRINT_FIELD_D(", ", *qs, qs_itimelimit); + PRINT_FIELD_D(", ", *qs, qs_rtbtimelimit); + PRINT_FIELD_U(", ", *qs, qs_bwarnlimit); + PRINT_FIELD_U(", ", *qs, qs_iwarnlimit); # else printf(", ..."); # endif /* !VERBOSE */ @@ -206,13 +187,13 @@ main(void) char bogus_addr_str[sizeof(void *) * 2 + sizeof("0x")]; char unterminated_str[sizeof(void *) * 2 + sizeof("0x")]; - long rc; - struct fs_disk_quota *xdq = tail_alloc(sizeof(*xdq)); - struct fs_quota_stat *xqstat = tail_alloc(sizeof(*xqstat)); - struct fs_quota_statv *xqstatv = tail_alloc(sizeof(*xqstatv)); - uint32_t *flags = tail_alloc(sizeof(*flags)); + static char invalid_cmd_str[1024]; + TAIL_ALLOC_OBJECT_CONST_PTR(struct fs_disk_quota, xdq); + TAIL_ALLOC_OBJECT_CONST_PTR(struct fs_quota_stat, xqstat); + TAIL_ALLOC_OBJECT_CONST_PTR(struct fs_quota_statv, xqstatv); + TAIL_ALLOC_OBJECT_CONST_PTR(uint32_t, flags); char *unterminated = tail_memdup(unterminated_data, - sizeof(unterminated_data)); + sizeof(unterminated_data)); snprintf(bogus_special_str, sizeof(bogus_special_str), "%p", bogus_special); @@ -233,12 +214,12 @@ main(void) "|XFS_QUOTA_GDQ_ACCT|XFS_QUOTA_GDQ_ENFD" "|XFS_QUOTA_PDQ_ENFD|0xdeadbec0]"); - rc = syscall(__NR_quotactl, QCMD(Q_XQUOTAON, 0xfacefeed), bogus_dev, - bogus_id, bogus_addr); - printf("quotactl(QCMD(Q_XQUOTAON, %#x /* ???QUOTA */)" - ", %s, %p) = %s\n", - QCMD_TYPE(QCMD(Q_XQUOTAON, 0xfacefeed)), - bogus_dev_str, bogus_addr, sprintrc(rc)); + snprintf(invalid_cmd_str, sizeof(invalid_cmd_str), + "QCMD(Q_XQUOTAON, %#x /* ???QUOTA */)", + QCMD_TYPE(QCMD(Q_XQUOTAON, 0xfacefeed))); + check_quota(CQF_ID_SKIP, + QCMD(Q_XQUOTAON, 0xfacefeed), invalid_cmd_str, + bogus_dev, bogus_dev_str, bogus_addr); /* Q_XQUOTAOFF */ @@ -263,12 +244,12 @@ main(void) /* Q_XGETQUOTA */ /* Trying our best to get successful result */ - check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, USRQUOTA)), + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_XGETQUOTA, USRQUOTA)), ARG_STR("/dev/sda1"), getuid(), xdq, print_xdisk_quota, (intptr_t) 1); - check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, GRPQUOTA)), - ARG_STR(NULL), -1, xdq, print_xdisk_quota, (intptr_t) 2); + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_XGETQUOTA, GRPQUOTA)), + ARG_STR(NULL), -1, xdq, print_xdisk_quota, (intptr_t) 1); /* Q_XGETNEXTQUOTA */ @@ -297,20 +278,29 @@ main(void) ARG_STR("/dev/sda1"), xqstat, print_xquota_stat, (intptr_t) 1); check_quota(CQF_ID_SKIP | CQF_ADDR_CB, - ARG_STR(QCMD(Q_XGETQSTATV, PRJQUOTA)), + ARG_STR(QCMD(Q_XGETQSTAT, USRQUOTA)), + ARG_STR("NULL"), xqstat, print_xquota_stat, (intptr_t) 1); + + check_quota(CQF_ID_SKIP, + ARG_STR(QCMD(Q_XGETQSTAT, PRJQUOTA)), unterminated, unterminated_str, - xqstat + 1, print_xquota_stat, (intptr_t) 2); + xqstat + 1); /* Q_XGETQSTATV */ check_quota(CQF_ID_SKIP | CQF_ADDR_CB, - ARG_STR(QCMD(Q_XGETQSTAT, USRQUOTA)), - ARG_STR("/dev/sda1"), xqstatv, print_xquota_statv, 1); + ARG_STR(QCMD(Q_XGETQSTATV, USRQUOTA)), + ARG_STR("/dev/sda1"), xqstatv, print_xquota_statv, (intptr_t) 1); check_quota(CQF_ID_SKIP | CQF_ADDR_CB, ARG_STR(QCMD(Q_XGETQSTATV, GRPQUOTA)), - ARG_STR(NULL), xqstatv, print_xquota_statv, (intptr_t) 2); + ARG_STR(NULL), xqstatv, print_xquota_statv, (intptr_t) 1); + + check_quota(CQF_ID_SKIP, + ARG_STR(QCMD(Q_XGETQSTATV, PRJQUOTA)), + unterminated, unterminated_str, + xqstatv + 1); /* Q_XQUOTARM */ diff --git a/tests-m32/quotactl-xfs.gen.test b/tests-m32/quotactl-xfs.gen.test new file mode 100755 index 00000000..cd7d11c5 --- /dev/null +++ b/tests-m32/quotactl-xfs.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (quotactl-xfs -e trace=quotactl); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=quotactl diff --git a/tests-m32/quotactl-xfs.test b/tests-m32/quotactl-xfs.test deleted file mode 100755 index 404a7372..00000000 --- a/tests-m32/quotactl-xfs.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of quotactl xfs subcommands. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=quotactl diff --git a/tests-m32/quotactl.c b/tests-m32/quotactl.c index 3a7c1132..3a995276 100644 --- a/tests-m32/quotactl.c +++ b/tests-m32/quotactl.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -76,27 +57,31 @@ struct if_nextdqblk { # include "xlat/if_dqinfo_flags.h" # include "xlat/if_dqinfo_valid.h" +# define QUOTA_STR(_arg) (_arg), gen_quotacmd(#_arg, _arg) +# define QUOTA_ID_STR(_arg) (_arg), gen_quotaid(#_arg, _arg) +# define QUOTA_STR_INVALID(_arg, str) (_arg), gen_quotacmd(str, _arg) + void print_dqblk(long rc, void *ptr, void *arg) { struct if_dqblk *db = ptr; long out_arg = (long) arg; - if (((rc != 0) && out_arg) || (out_arg > 1)) { + if (((rc < 0) && out_arg) || (out_arg > 1)) { printf("%p", db); return; } - PRINT_FIELD_U("{", db, dqb_bhardlimit); - PRINT_FIELD_U(", ", db, dqb_bsoftlimit); - PRINT_FIELD_U(", ", db, dqb_curspace); - PRINT_FIELD_U(", ", db, dqb_ihardlimit); - PRINT_FIELD_U(", ", db, dqb_isoftlimit); - PRINT_FIELD_U(", ", db, dqb_curinodes); + PRINT_FIELD_U("{", *db, dqb_bhardlimit); + PRINT_FIELD_U(", ", *db, dqb_bsoftlimit); + PRINT_FIELD_U(", ", *db, dqb_curspace); + PRINT_FIELD_U(", ", *db, dqb_ihardlimit); + PRINT_FIELD_U(", ", *db, dqb_isoftlimit); + PRINT_FIELD_U(", ", *db, dqb_curinodes); # if VERBOSE - PRINT_FIELD_U(", ", db, dqb_btime); - PRINT_FIELD_U(", ", db, dqb_itime); + PRINT_FIELD_U(", ", *db, dqb_btime); + PRINT_FIELD_U(", ", *db, dqb_itime); printf(", dqb_valid="); printflags(if_dqblk_valid, db->dqb_valid, "QIF_???"); @@ -112,28 +97,28 @@ print_nextdqblk(long rc, void *ptr, void *arg) struct if_nextdqblk *db = ptr; long out_arg = (long) arg; - if (((rc != 0) && out_arg) || (out_arg > 1)) { + if (((rc < 0) && out_arg) || (out_arg > 1)) { printf("%p", db); return; } - PRINT_FIELD_U("{", db, dqb_bhardlimit); - PRINT_FIELD_U(", ", db, dqb_bsoftlimit); - PRINT_FIELD_U(", ", db, dqb_curspace); - PRINT_FIELD_U(", ", db, dqb_ihardlimit); - PRINT_FIELD_U(", ", db, dqb_isoftlimit); - PRINT_FIELD_U(", ", db, dqb_curinodes); + PRINT_FIELD_U("{", *db, dqb_bhardlimit); + PRINT_FIELD_U(", ", *db, dqb_bsoftlimit); + PRINT_FIELD_U(", ", *db, dqb_curspace); + PRINT_FIELD_U(", ", *db, dqb_ihardlimit); + PRINT_FIELD_U(", ", *db, dqb_isoftlimit); + PRINT_FIELD_U(", ", *db, dqb_curinodes); # if VERBOSE - PRINT_FIELD_U(", ", db, dqb_btime); - PRINT_FIELD_U(", ", db, dqb_itime); + PRINT_FIELD_U(", ", *db, dqb_btime); + PRINT_FIELD_U(", ", *db, dqb_itime); printf(", dqb_valid="); printflags(if_dqblk_valid, db->dqb_valid, "QIF_???"); - PRINT_FIELD_U(", ", db, dqb_id); + PRINT_FIELD_U(", ", *db, dqb_id); # else - PRINT_FIELD_U(", ", db, dqb_id); + PRINT_FIELD_U(", ", *db, dqb_id); printf(", ..."); # endif /* !VERBOSE */ printf("}"); @@ -145,21 +130,107 @@ print_dqinfo(long rc, void *ptr, void *arg) struct if_dqinfo *di = ptr; long out_arg = (long) arg; - if (((rc != 0) && out_arg) || (out_arg > 1)) { + if (((rc < 0) && out_arg) || (out_arg > 1)) { printf("%p", di); return; } - PRINT_FIELD_U("{", di, dqi_bgrace); - PRINT_FIELD_U(", ", di, dqi_igrace); + PRINT_FIELD_U("{", *di, dqi_bgrace); + PRINT_FIELD_U(", ", *di, dqi_igrace); printf(", dqi_flags="); +# if XLAT_RAW + printf("%#x", di->dqi_flags); +# elif XLAT_VERBOSE + printf("%#x /* ", di->dqi_flags); printflags(if_dqinfo_flags, di->dqi_flags, "DQF_???"); + printf(" */"); +# else /* XLAT_ABBREV */ + printflags(if_dqinfo_flags, di->dqi_flags, "DQF_???"); +# endif printf(", dqi_valid="); +# if XLAT_RAW + printf("%#x", di->dqi_valid); +# elif XLAT_VERBOSE + printf("%#x /* ", di->dqi_valid); + printflags(if_dqinfo_valid, di->dqi_valid, "IIF_???"); + printf(" */"); +# else /* XLAT_ABBREV */ printflags(if_dqinfo_valid, di->dqi_valid, "IIF_???"); +# endif printf("}"); } +void +print_dqfmt(long rc, void *ptr, void *arg) +{ + uint32_t *fmtval = ptr; + long out_arg = (long) arg; + const char *fmtstr; + + if (((rc < 0) && out_arg) || (out_arg > 1)) { + printf("%p", fmtval); + return; + } + printf("["); +# if XLAT_RAW + printf("%#x]", *fmtval); + return; +# else + switch (*fmtval) { + case 1: + fmtstr = "QFMT_VFS_OLD"; + break; + case 2: + fmtstr = "QFMT_VFS_V0"; + break; + case 3: + fmtstr = "QFMT_OCFS2"; + break; + case 4: + fmtstr = "QFMT_VFS_V1"; + break; + default: + printf("%#x /* QFMT_VFS_??? */]", *fmtval); + return; + } +# endif +# if XLAT_VERBOSE + printf("%#x /* %s */]", *fmtval, fmtstr); +# else + printf("%s]", fmtstr); +# endif +} + +const char * +gen_quotacmd(const char *abbrev_str, const uint32_t cmd) +{ + static char quotacmd_str[2048]; + +# if XLAT_RAW + snprintf(quotacmd_str, sizeof(quotacmd_str), "%u", cmd); +# elif XLAT_VERBOSE + snprintf(quotacmd_str, sizeof(quotacmd_str), "%u /* %s */", cmd, abbrev_str); +# else + return abbrev_str; +# endif + return quotacmd_str; +} + +const char * +gen_quotaid(const char *abbrev_str, const uint32_t id) +{ + static char quotaid_str[1024]; + +# if XLAT_RAW + snprintf(quotaid_str, sizeof(quotaid_str), "%#x", id); +# elif XLAT_VERBOSE + snprintf(quotaid_str, sizeof(quotaid_str), "%#x /* %s */", id, abbrev_str); +# else + return abbrev_str; +# endif + return quotaid_str; +} int main(void) @@ -170,14 +241,14 @@ main(void) char bogus_special_str[sizeof(void *) * 2 + sizeof("0x")]; char unterminated_str[sizeof(void *) * 2 + sizeof("0x")]; - long rc; + static char invalid_cmd_str[1024]; + static char invalid_id_str[1024]; char *unterminated = tail_memdup(unterminated_data, sizeof(unterminated_data)); - struct if_dqblk *dqblk = tail_alloc(sizeof(*dqblk)); - struct if_dqinfo *dqinfo = tail_alloc(sizeof(*dqinfo)); - uint32_t *fmt = tail_alloc(sizeof(*fmt)); - struct if_nextdqblk *nextdqblk = tail_alloc(sizeof(*nextdqblk)); - + TAIL_ALLOC_OBJECT_CONST_PTR(struct if_dqblk, dqblk); + TAIL_ALLOC_OBJECT_CONST_PTR(struct if_dqinfo, dqinfo); + TAIL_ALLOC_OBJECT_CONST_PTR(uint32_t, fmt); + TAIL_ALLOC_OBJECT_CONST_PTR(struct if_nextdqblk, nextdqblk); snprintf(bogus_special_str, sizeof(bogus_special_str), "%p", bogus_special); @@ -186,63 +257,71 @@ main(void) /* Invalid commands */ + snprintf(invalid_cmd_str, sizeof(invalid_cmd_str), + "QCMD(%#x /* Q_??? */, %#x /* ???QUOTA */)", + QCMD_CMD(bogus_cmd), QCMD_TYPE(bogus_cmd)); + check_quota(CQF_NONE, bogus_cmd, gen_quotacmd(invalid_cmd_str, bogus_cmd), + bogus_special, bogus_special_str, bogus_id, bogus_addr); - rc = syscall(__NR_quotactl, bogus_cmd, bogus_special, bogus_id, - bogus_addr); - printf("quotactl(QCMD(%#x /* Q_??? */, %#x /* ???QUOTA */)" - ", %p, %u, %p) = %s\n", - QCMD_CMD(bogus_cmd), QCMD_TYPE(bogus_cmd), - bogus_special, bogus_id, bogus_addr, sprintrc(rc)); - - rc = syscall(__NR_quotactl, 0, NULL, -1, NULL); - printf("quotactl(QCMD(0 /* Q_??? */, USRQUOTA), NULL, -1, NULL) = %s\n", - sprintrc(rc)); + snprintf(invalid_cmd_str, sizeof(invalid_cmd_str), + "QCMD(0 /* Q_??? */, USRQUOTA)"); + check_quota(CQF_ADDR_STR, 0, gen_quotacmd(invalid_cmd_str, 0), + ARG_STR(NULL), -1, ARG_STR(NULL)); /* Q_QUOTAON */ check_quota(CQF_ID_STR | CQF_ADDR_STR, - ARG_STR(QCMD(Q_QUOTAON, USRQUOTA)), - ARG_STR("/dev/bogus/"), ARG_STR(QFMT_VFS_OLD), + QUOTA_STR(QCMD(Q_QUOTAON, USRQUOTA)), + ARG_STR("/dev/bogus/"), QUOTA_ID_STR(QFMT_VFS_OLD), ARG_STR("/tmp/bogus/")); - rc = syscall(__NR_quotactl, QCMD(Q_QUOTAON, 0xfacefeed), bogus_dev, - bogus_id, bogus_addr); - printf("quotactl(QCMD(Q_QUOTAON, %#x /* ???QUOTA */)" - ", %s, %#x /* QFMT_VFS_??? */, %p) = %s\n", - QCMD_TYPE(QCMD(Q_QUOTAON, 0xfacefeed)), - bogus_dev_str, bogus_id, bogus_addr, sprintrc(rc)); + snprintf(invalid_cmd_str, sizeof(invalid_cmd_str), + "QCMD(Q_QUOTAON, %#x /* ???QUOTA */)", + QCMD_TYPE(QCMD(Q_QUOTAON, 0xfacefeed))); +# if XLAT_RAW + snprintf(invalid_id_str, sizeof(invalid_id_str), + "%#x", bogus_id); +# else + snprintf(invalid_id_str, sizeof(invalid_id_str), + "%#x /* QFMT_VFS_??? */", bogus_id); +# endif + check_quota(CQF_ID_STR, QCMD(Q_QUOTAON, 0xfacefeed), + gen_quotacmd(invalid_cmd_str, QCMD(Q_QUOTAON, 0xfacefeed)), + bogus_dev, bogus_dev_str, + bogus_id, invalid_id_str, bogus_addr); /* Q_QUOTAOFF */ check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, - ARG_STR(QCMD(Q_QUOTAOFF, USRQUOTA)), + QUOTA_STR(QCMD(Q_QUOTAOFF, USRQUOTA)), bogus_special, bogus_special_str); check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, - ARG_STR(QCMD(Q_QUOTAOFF, GRPQUOTA)), + QUOTA_STR(QCMD(Q_QUOTAOFF, GRPQUOTA)), ARG_STR("/dev/bogus/")); check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, - ARG_STR(QCMD(Q_QUOTAOFF, PRJQUOTA)), ARG_STR(NULL)); + QUOTA_STR(QCMD(Q_QUOTAOFF, PRJQUOTA)), ARG_STR(NULL)); + const char *cmd_str = "QCMD(Q_QUOTAOFF, 0x3 /* ???QUOTA */)"; check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, - QCMD(Q_QUOTAOFF, 3), "QCMD(Q_QUOTAOFF, 0x3 /* ???QUOTA */)", + QUOTA_STR_INVALID(QCMD(Q_QUOTAOFF, 3), cmd_str), ARG_STR(NULL)); /* Q_GETQUOTA */ /* Trying our best to get successful result */ - check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, USRQUOTA)), + check_quota(CQF_ADDR_CB, QUOTA_STR(QCMD(Q_GETQUOTA, USRQUOTA)), ARG_STR("/dev/sda1"), getuid(), dqblk, print_dqblk, (intptr_t) 1); - check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, GRPQUOTA)), - ARG_STR(NULL), -1, dqblk, print_dqblk, (intptr_t) 2); + check_quota(CQF_ADDR_CB, QUOTA_STR(QCMD(Q_GETQUOTA, GRPQUOTA)), + ARG_STR(NULL), -1, dqblk, print_dqblk, (intptr_t) 1); /* Q_GETNEXTQUOTA */ - check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETNEXTQUOTA, USRQUOTA)), + check_quota(CQF_ADDR_CB, QUOTA_STR(QCMD(Q_GETNEXTQUOTA, USRQUOTA)), ARG_STR("/dev/sda1"), 0, nextdqblk, print_nextdqblk, (intptr_t) 1); @@ -251,10 +330,10 @@ main(void) fill_memory(dqblk, sizeof(*dqblk)); - check_quota(CQF_NONE, ARG_STR(QCMD(Q_SETQUOTA, PRJQUOTA)), + check_quota(CQF_NONE, QUOTA_STR(QCMD(Q_SETQUOTA, PRJQUOTA)), bogus_special, bogus_special_str, 0, bogus_addr); - check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_SETQUOTA, PRJQUOTA)), + check_quota(CQF_ADDR_CB, QUOTA_STR(QCMD(Q_SETQUOTA, PRJQUOTA)), ARG_STR("/dev/bogus/"), 3141592653U, dqblk, print_dqblk, (intptr_t) 0); @@ -262,13 +341,13 @@ main(void) /* Q_GETINFO */ check_quota(CQF_ID_SKIP | CQF_ADDR_CB, - ARG_STR(QCMD(Q_GETINFO, GRPQUOTA)), + QUOTA_STR(QCMD(Q_GETINFO, GRPQUOTA)), ARG_STR("/dev/sda1"), dqinfo, print_dqinfo, (intptr_t) 1); check_quota(CQF_ID_SKIP | CQF_ADDR_CB, - ARG_STR(QCMD(Q_GETINFO, GRPQUOTA)), + QUOTA_STR(QCMD(Q_GETINFO, GRPQUOTA)), bogus_special, bogus_special_str, dqinfo, - print_dqinfo, (intptr_t) 2); + print_dqinfo, (intptr_t) 1); /* Q_SETINFO */ @@ -277,34 +356,40 @@ main(void) dqinfo->dqi_flags = 0xdeadabcd; check_quota(CQF_ID_SKIP | CQF_ADDR_STR, - ARG_STR(QCMD(Q_SETINFO, PRJQUOTA)), + QUOTA_STR(QCMD(Q_SETINFO, PRJQUOTA)), bogus_special, bogus_special_str, ARG_STR(NULL)); check_quota(CQF_ID_SKIP | CQF_ADDR_CB, - ARG_STR(QCMD(Q_SETINFO, USRQUOTA)), + QUOTA_STR(QCMD(Q_SETINFO, USRQUOTA)), ARG_STR("/dev/bogus/"), dqinfo, print_dqinfo, (intptr_t) 0); /* Q_GETFMT */ check_quota(CQF_ID_SKIP | CQF_ADDR_STR, - ARG_STR(QCMD(Q_GETFMT, PRJQUOTA)), + QUOTA_STR(QCMD(Q_GETFMT, PRJQUOTA)), bogus_special, bogus_special_str, ARG_STR(NULL)); check_quota(CQF_ID_SKIP, - ARG_STR(QCMD(Q_GETFMT, USRQUOTA)), + QUOTA_STR(QCMD(Q_GETFMT, USRQUOTA)), unterminated, unterminated_str, fmt + 1); - check_quota(CQF_ID_SKIP, - ARG_STR(QCMD(Q_GETFMT, GRPQUOTA)), - ARG_STR("/dev/sda1"), fmt); + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + QUOTA_STR(QCMD(Q_GETFMT, GRPQUOTA)), + ARG_STR("/dev/sda1"), fmt, print_dqfmt, (uintptr_t) 1); + /* Try to check valid quota format */ + *fmt = QFMT_VFS_OLD; + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + QUOTA_STR(QCMD(Q_GETFMT, GRPQUOTA)), + ARG_STR("/dev/sda1"), fmt, print_dqfmt, (uintptr_t) 1); /* Q_SYNC */ check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, - ARG_STR(QCMD(Q_SYNC, USRQUOTA)), + QUOTA_STR(QCMD(Q_SYNC, USRQUOTA)), bogus_special, bogus_special_str); + cmd_str = "QCMD(Q_SYNC, 0xff /* ???QUOTA */)"; check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, - QCMD(Q_SYNC, 0xfff), "QCMD(Q_SYNC, 0xff /* ???QUOTA */)", + QUOTA_STR_INVALID(QCMD(Q_SYNC, 0xfff), cmd_str), ARG_STR(NULL)); puts("+++ exited with 0 +++"); diff --git a/tests-m32/quotactl.gen.test b/tests-m32/quotactl.gen.test new file mode 100755 index 00000000..6d2dc754 --- /dev/null +++ b/tests-m32/quotactl.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (quotactl ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/quotactl.h b/tests-m32/quotactl.h index 31eaec58..4d29ac11 100644 --- a/tests-m32/quotactl.h +++ b/tests-m32/quotactl.h @@ -3,37 +3,19 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef STRACE_TESTS_QUOTACTL_H -#define STRACE_TESTS_QUOTACTL_H +# define STRACE_TESTS_QUOTACTL_H # include # include # include +# include "print_fields.h" # ifdef HAVE_LINUX_QUOTA_H /* Broken in CentOS 5: has extern spinlock_t dq_data_lock; declaration */ @@ -57,18 +39,6 @@ # define PRJQUOTA 2 # endif -# define PRINT_FIELD_D(prefix, where, field) \ - printf("%s%s=%lld", (prefix), #field, \ - sign_extend_unsigned_to_ll((where)->field)) - -# define PRINT_FIELD_U(prefix, where, field) \ - printf("%s%s=%llu", (prefix), #field, \ - zero_extend_signed_to_ull((where)->field)) - -# define PRINT_FIELD_X(prefix, where, field) \ - printf("%s%s=%#llx", (prefix), #field, \ - zero_extend_signed_to_ull((where)->field)) - typedef void (*print_cb)(long rc, void *addr, void *arg); enum check_quotactl_flag_bits { @@ -88,7 +58,73 @@ enum check_quotactl_flags { CQF_ADDR_CB = 1 << CQF_ADDR_CB_BIT, }; +static const char *errstr; +/** + * Generic quotactl syscall checker function. Call convention: + * + * check_quota(flags, cmd, cmd_str, special, special_str + * [, id [, id_str]] + * [, addr [, { addr_cb, addr_cb_arg | addr_str }]]) + * + * check_quota performs a syscall invocation and prints the expected output + * for it. + * + * It might be useful to employ ARG_STR macro for passing cmd/cmd_str, + * special_special_str, id/id_str, and addr/addr_str argument pairs. + * + * @param flags Check flags: + * - CQF_ID_SKIP: the "id" syscall argument is ignored + * in the syscall invocation. No id and id_str arguments + * should be provided if this flag is set. + * This flag has priority over the CQF_ID_STR flag. + * - CQF_ID_STR: the "id" syscall argument has a special string + * representation. id_str argument should be provided if this + * flag is set; no id_str argument should be provided and id + * argument is printed as unsigned integer (with an exception + * for -1, which is printed as signed) if this flag is not set. + * - CQF_ADDR_SKIP: the "addr" syscall argument is ignored + * in the syscall invocation. None of the addr, addr_cb, + * addr_cb_arg, and/or addr_str arguments should be provided + * if this flag is set. This flag has priority + * over the CQF_ADDR_STR and CQF_ADDR_CB flags. + * - CQF_ADDR_CB: the "addr" syscall argument printing is handled + * via a callback function. addr_cb (that points to a callback + * function of type print_cb) and addr_cb_arg (an opaque pointer + * that is passed to addr_cb in the third argument) should + * be provided if this flag is set. + * This flag has priority over the CQF_ADDR_STR flag. + * - CQF_ADDR_STR: addr syscall argument has a special string + * representation. addr_str argument should be provided if this + * flag is set. If both CQF_ADDR_CB and CQF_ADDR_STR flags + * are not set, addr syscall argument is printed using "%p" + * printf format. + * @param cmd Value of the "cmd" syscall argument that should be passed + * in the syscall invocation. + * @param cmd_str String representation of the "cmd" syscall argument. + * @param special Value of the "special" syscall argument that should be passed + * in the syscall invocation. + * @param special_str String representation of the "special" syscall argument. + * @param ... Additional arguments depend on the flags being set: + * - id: Value of the "id" syscall argument. Provided + * if CQF_ID_SKIP is not set, otherwise -1 is passed + * in the syscall invocation and the argument is not printed + * in the expected output. + * - id_str: String representation of the "id" syscall argument. + * Provided if CQF_ID_SKIP is not set and CQF_ID_STR is set. + * - addr: Value of the "addr" syscall argument. Provided + * if CQF_ADDR_SKIP is not set, otherwise NULL is passed + * in the syscall invocation and the argument is not printed + * in the expected output. + * - addr_cb: Callback function that is called for the "addr" + * syscall argument printing. Should be of print_cb type. + * Provided if CQF_ADDR_SKIP is not set and CQF_ADDR_CB is set. + * - addr_cb_arg: Opaque pointer that is passed to addr_cb, + * Provided if CQF_ADDR_SKIP is not set and CQF_ADDR_CB is set. + * - addr_str: String representation of the "addr" syscall argument. + * Provided if CQF_ADDR_SKIP is not set, CQF_ADDR_CB is not set, + * and CQF_ADDR_STR is set. + */ static inline void check_quota(uint32_t flags, int cmd, const char *cmd_str, const char *special, const char *special_str, ...) @@ -126,6 +162,20 @@ check_quota(uint32_t flags, int cmd, const char *cmd_str, va_end(ap); rc = syscall(__NR_quotactl, cmd, special, id, addr); + + errstr = sprintrc(rc); + +# ifdef INJECT_RETVAL + if (rc != INJECT_RETVAL) + error_msg_and_fail("Got a return value of %ld != %d", + rc, INJECT_RETVAL); + + static char inj_errstr[4096]; + + snprintf(inj_errstr, sizeof(inj_errstr), "%s (INJECTED)", errstr); + errstr = inj_errstr; +# endif + printf("quotactl(%s, %s", cmd_str, special_str); if (!(flags & CQF_ID_SKIP)) { @@ -150,7 +200,7 @@ check_quota(uint32_t flags, int cmd, const char *cmd_str, } } - printf(") = %s\n", sprintrc(rc)); + printf(") = %s\n", errstr); } diff --git a/tests-m32/quotactl.test b/tests-m32/quotactl.test deleted file mode 100755 index d0101f46..00000000 --- a/tests-m32/quotactl.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of quotactl syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/read-write.c b/tests-m32/read-write.c index 262e07b5..0217670b 100644 --- a/tests-m32/read-write.c +++ b/tests-m32/read-write.c @@ -2,29 +2,10 @@ * Check decoding and dumping of read and write syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,31 +17,52 @@ #include static void -dump_str(const char *str, const unsigned int len) +dump_str_ex(const char *str, const unsigned int len, const int idx_w) { - static const char dots[16] = "................"; + static const char chars[256] = + "................................" + " !\"#$%&'()*+,-./0123456789:;<=>?" + "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" + "`abcdefghijklmnopqrstuvwxyz{|}~." + "................................" + "................................" + "................................" + "................................"; unsigned int i; for (i = 0; i < len; i += 16) { unsigned int n = len - i > 16 ? 16 : len - i; const char *dump = hexdump_memdup(str + i, n); - tprintf(" | %05x %-49s %-16.*s |\n", - i, dump, n, dots); + tprintf(" | %0*x %-49s %-16.*s |\n", + idx_w, i, dump, n, chars + i % 0x100); free((void *) dump); } } +static inline void +dump_str(const char *str, const unsigned int len) +{ + dump_str_ex(str, len, 5); +} + static void print_hex(const char *str, const unsigned int len) { const unsigned char *ustr = (const unsigned char *) str; unsigned int i; + tprintf("\""); + for (i = 0; i < len; ++i) { unsigned int c = ustr[i]; + if (i >= DEFAULT_STRLEN) { + tprintf("\"..."); + return; + } + switch (c) { case '\t': tprintf("\\t"); break; @@ -76,6 +78,8 @@ print_hex(const char *str, const unsigned int len) tprintf("\\%o", ustr[i]); } } + + tprintf("\""); } static long @@ -93,9 +97,12 @@ k_write(unsigned int fd, const void *buf, size_t count) } static void -test_dump(const unsigned int len) +test_dump(const unsigned int len, bool err_desc) { static char *buf; + const char *rc_str; + int in_fd = err_desc ? 5 : 0; + int out_fd = err_desc ? 4 : 1; if (buf) { size_t ps1 = get_page_size() - 1; @@ -104,28 +111,34 @@ test_dump(const unsigned int len) buf = tail_alloc(len); } - long rc = k_read(0, buf, len); - if (rc != (int) len) + long rc = k_read(in_fd, buf, len); + rc_str = sprintrc(rc); + if (err_desc ^ (rc != (int) len)) perror_msg_and_fail("read: expected %d, returned %ld", - len, rc); + err_desc ? -1 : (int) len, rc); - tprintf("%s(%d, \"", "read", 0); - print_hex(buf, len); - tprintf("\", %d) = %ld\n", len, rc); - dump_str(buf, len); + tprintf("%s(%d, ", "read", in_fd); + if (!err_desc) + print_hex(buf, len); + else + tprintf("%p", buf); + tprintf(", %d) = %s\n", len, rc_str); + if (!err_desc) + dump_str(buf, len); unsigned int i; for (i = 0; i < len; ++i) buf[i] = i; - rc = k_write(1, buf, len); - if (rc != (int) len) + rc = k_write(out_fd, buf, len); + rc_str = sprintrc(rc); + if (err_desc ^ (rc != (int) len)) perror_msg_and_fail("write: expected %d, returned %ld", - len, rc); + err_desc ? -1 : (int) len, rc); - tprintf("%s(%d, \"", "write", 1); + tprintf("%s(%d, ", "write", out_fd); print_hex(buf, len); - tprintf("\", %d) = %ld\n", len, rc); + tprintf(", %d) = %s\n", len, rc_str); dump_str(buf, len); if (!len) @@ -137,7 +150,9 @@ main(void) { tprintf("%s", ""); - static char tmp[] = "read-write-tmpfile"; + skip_if_unavailable("/proc/self/fd/"); + + static const char tmp[] = "read-write-tmpfile"; if (open(tmp, O_CREAT|O_RDONLY|O_TRUNC, 0600) != 0) perror_msg_and_fail("creat: %s", tmp); if (open(tmp, O_WRONLY) != 1) @@ -180,7 +195,6 @@ main(void) tprintf("write(1, \"%s\", %u) = %ld\n" " | 00000 %-49s %-16s |\n", w_c, w_len, rc, w_d, w_c); - close(1); rc = k_read(0, r0, 0); if (rc) @@ -209,15 +223,64 @@ main(void) r1_c, w_len, rc, r1_d, r1_c); close(0); + /* + * Check partial dump; relies on dumpstr() implementation details + * (maximum size of chunk to be copied at once). + */ + static const size_t six_wide_size = 1 << 20; + static const size_t fetch_size = 1 << 16; + static const char big_buf_str[] = + "\\0\\1\\2\\3\\4\\5\\6\\7" + "\\10\\t\\n\\v\\f\\r\\16\\17" + "\\20\\21\\22\\23\\24\\25\\26\\27" + "\\30\\31\\32\\33\\34\\35\\36\\37"; + const size_t buf_size = six_wide_size + fetch_size; + const size_t sizes[] = { + six_wide_size, + six_wide_size + 1, + buf_size, + buf_size + 1, + buf_size + 2, + }; + char *big_buf = tail_alloc(buf_size); + + fill_memory_ex(big_buf, buf_size, 0, 0x100); + + for (size_t i = 0; i < ARRAY_SIZE(sizes); i++) { + rc = k_write(1, big_buf, sizes[i]); + tprintf("write(1, \"%s\"..., %zu) = %s\n", + big_buf_str, sizes[i], sprintrc(rc)); + dump_str_ex(big_buf, MIN(sizes[i], buf_size), + sizes[i] > six_wide_size ? 6 : 5); + + if (sizes[i] == buf_size + 1) + tprintf(" | \n", + getpid(), big_buf + buf_size); + + if (sizes[i] == buf_size + 2) + tprintf(" | \n", + getpid(), big_buf + buf_size); + } + + close(1); + if (open("/dev/zero", O_RDONLY)) perror_msg_and_fail("open"); if (open("/dev/null", O_WRONLY) != 1) perror_msg_and_fail("open"); + if (open("/dev/zero", O_RDONLY) != 4) + perror_msg_and_fail("open"); + + if (open("/dev/null", O_WRONLY) != 5) + perror_msg_and_fail("open"); + unsigned int i; - for (i = 0; i <= 32; ++i) - test_dump(i); + for (i = 0; i <= DEFAULT_STRLEN; ++i) + test_dump(i, false); + + test_dump(256, true); tprintf("+++ exited with 0 +++\n"); return 0; diff --git a/tests-m32/read-write.gen.test b/tests-m32/read-write.gen.test new file mode 100755 index 00000000..c66628f2 --- /dev/null +++ b/tests-m32/read-write.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (read-write -a15 -eread=0,5 -ewrite=1,4 -e trace=read,write -P read-write-tmpfile -P /dev/zero -P /dev/null); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 -eread=0,5 -ewrite=1,4 -e trace=read,write -P read-write-tmpfile -P /dev/zero -P /dev/null diff --git a/tests-m32/read-write.test b/tests-m32/read-write.test deleted file mode 100755 index 3700541f..00000000 --- a/tests-m32/read-write.test +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# Check decoding and dumping of read and write syscalls. - -. "${srcdir=.}/init.sh" - -# strace -P is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - -tmpfile=read-write-tmpfile -> $tmpfile - -run_strace_match_diff \ - -a15 -eread=0 -ewrite=1 -e trace=read,write \ - -P $tmpfile -P /dev/zero -P /dev/null - -rm -f $tmpfile diff --git a/tests-m32/readahead.c b/tests-m32/readahead.c index c11b577d..1b21fe59 100644 --- a/tests-m32/readahead.c +++ b/tests-m32/readahead.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,7 +17,7 @@ * see https://sourceware.org/bugzilla/show_bug.cgi?id=5208 */ # if !(defined __GLIBC_MINOR__ && \ - (__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 8) + (__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 8) # undef HAVE_READAHEAD # endif /* glibc < 2.8 */ /* @@ -44,7 +25,7 @@ * see https://sourceware.org/bugzilla/show_bug.cgi?id=21026 */ # if defined LINUX_MIPSN64 && !(defined __GLIBC_MINOR__ && \ - (__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 25) + (__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 25) # undef HAVE_READAHEAD # endif /* LINUX_MIPSN64 && glibc < 2.25 */ # endif /* __GLIBC__ */ diff --git a/tests-m32/readahead.gen.test b/tests-m32/readahead.gen.test new file mode 100755 index 00000000..c27ab0d0 --- /dev/null +++ b/tests-m32/readahead.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (readahead -a1 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a1 diff --git a/tests-m32/readahead.test b/tests-m32/readahead.test deleted file mode 100755 index 397c6903..00000000 --- a/tests-m32/readahead.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check readahead syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a1 diff --git a/tests-m32/readdir.c b/tests-m32/readdir.c index 8c483620..284c221e 100644 --- a/tests-m32/readdir.c +++ b/tests-m32/readdir.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -58,9 +39,9 @@ static const char qname[] = "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nZ"; int -main(int ac, const char **av) +main(void) { - char *dname; + static const char dname[] = "readdir.test.tmp.dir"; struct { unsigned long d_ino; unsigned long d_off; @@ -69,8 +50,6 @@ main(int ac, const char **av) } e; int rc; - assert(ac == 1); - assert(asprintf(&dname, "%s.test.tmp.dir", av[0]) > 0); assert(!mkdir(dname, 0700)); assert(!chdir(dname)); (void) close(0); diff --git a/tests-m32/readdir.gen.test b/tests-m32/readdir.gen.test new file mode 100755 index 00000000..09aad4f6 --- /dev/null +++ b/tests-m32/readdir.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (readdir -a16 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 diff --git a/tests-m32/readdir.test b/tests-m32/readdir.test deleted file mode 100755 index e3132737..00000000 --- a/tests-m32/readdir.test +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -# Check readdir syscall decoding. - -. "${srcdir=.}/init.sh" - -rm -rf -- "$LOG".dir -run_strace_match_diff -a16 diff --git a/tests-m32/readlink.c b/tests-m32/readlink.c index 4ddf5fac..c2a9b22c 100644 --- a/tests-m32/readlink.c +++ b/tests-m32/readlink.c @@ -1,29 +1,9 @@ /* * Copyright (c) 2015 Gleb Fotengauer-Malinovskiy - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/readlink.gen.test b/tests-m32/readlink.gen.test new file mode 100755 index 00000000..42632341 --- /dev/null +++ b/tests-m32/readlink.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (readlink -xx ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -xx diff --git a/tests-m32/readlink.test b/tests-m32/readlink.test deleted file mode 100755 index c026ecbe..00000000 --- a/tests-m32/readlink.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check readlink syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -xx diff --git a/tests-m32/readlinkat.c b/tests-m32/readlinkat.c index 4d3b516c..6909ac0b 100644 --- a/tests-m32/readlinkat.c +++ b/tests-m32/readlinkat.c @@ -1,29 +1,9 @@ /* * Copyright (c) 2015 Gleb Fotengauer-Malinovskiy - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/readlinkat.gen.test b/tests-m32/readlinkat.gen.test new file mode 100755 index 00000000..d7de9932 --- /dev/null +++ b/tests-m32/readlinkat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (readlinkat -xx ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -xx diff --git a/tests-m32/readlinkat.test b/tests-m32/readlinkat.test deleted file mode 100755 index 229c8e1e..00000000 --- a/tests-m32/readlinkat.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check readlinkat syscall decoding. - -. "${srcdir=.}/readlink.test" diff --git a/tests-m32/readv.c b/tests-m32/readv.c index 0e5aab65..185d12cc 100644 --- a/tests-m32/readv.c +++ b/tests-m32/readv.c @@ -2,29 +2,10 @@ * Check decoding of readv and writev syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -88,7 +69,7 @@ main(void) fds[1], (long) writev(fds[1], w_iov, 0)); rc = writev(fds[1], w_iov + ARRAY_SIZE(w_iov_) - 1, 2); - tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%u}, %p], 2)" + tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%u}, ... /* %p */], 2)" " = %ld %s (%m)\n", fds[1], w2_c, LENGTH_OF(w2_c), w_iov + ARRAY_SIZE(w_iov_), rc, errno2name()); @@ -108,7 +89,7 @@ main(void) " * %u bytes in buffer 2\n" " | 00000 %-49s %-16s |\n", fds[1], w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), - w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w_iov_), w_len, + w2_c, LENGTH_OF(w2_c), (unsigned int) ARRAY_SIZE(w_iov_), w_len, LENGTH_OF(w0_c), w0_d, w0_c, LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); @@ -126,8 +107,8 @@ main(void) tprintf("readv(%d, [{iov_base=\"%s\", iov_len=%u}], %u) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - fds[0], - r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + fds[0], r0_c, r_len, (unsigned int) ARRAY_SIZE(r0_iov_), + r_len, r_len, r0_d, r0_c); void *r1 = tail_alloc(r_len); void *r2 = tail_alloc(w_len); @@ -148,8 +129,8 @@ main(void) ", {iov_base=\"\", iov_len=%u}], %u) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - fds[0], r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), w_len - r_len, - w_len - r_len, r1_d, r1_c); + fds[0], r1_c, r_len, w_len, (unsigned int) ARRAY_SIZE(r1_iov_), + w_len - r_len, w_len - r_len, r1_d, r1_c); close(fds[0]); tprintf("+++ exited with 0 +++\n"); diff --git a/tests-m32/readv.test b/tests-m32/readv.test index dc187996..ddeb6f97 100755 --- a/tests-m32/readv.test +++ b/tests-m32/readv.test @@ -3,29 +3,10 @@ # Check decoding and dumping of readv and writev syscalls. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -38,7 +19,7 @@ run_strace_match_diff -a16 -e trace=readv,writev \ run_strace_match_diff -a16 -e trace=readv,writev \ -eread='!all' -ewrite=none -eread='!0,1,2' -ewrite='!0,1,2' -wfd="$(./print_maxfd)" +wfd="$(../print_maxfd)" rfd="$(($wfd - 1))" run_strace_match_diff -a16 -e trace=readv,writev \ -eread="$rfd" -ewrite="$wfd" diff --git a/tests-m32/reboot.c b/tests-m32/reboot.c index 9b09e647..8bc9c6b0 100644 --- a/tests-m32/reboot.c +++ b/tests-m32/reboot.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -10,21 +17,83 @@ # define INVALID_MAGIC 319887762 # define INVALID_CMD 0x01234568 +# define STR32 "AbCdEfGhIjKlMnOpQrStUvWxYz012345" +# define STR128 STR32 STR32 STR32 STR32 + int main(void) { + static const kernel_ulong_t bogus_magic1 = + (kernel_ulong_t) 0xFFFFFFFFFFFFFFFFULL; + static const kernel_ulong_t bogus_magic2 = + (kernel_ulong_t) 0xdeadfacefa57beefULL; + static const kernel_ulong_t bogus_cmd = + (kernel_ulong_t) 0xbadda7a09caffee1ULL; static const char buf[] = "reboot"; - long rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, \ - INVALID_MAGIC, LINUX_REBOOT_CMD_RESTART2, buf); + static const char str256_buf[] = STR128 STR128; + + long rc; + char *str256 = tail_memdup(str256_buf, sizeof(str256_buf) - 1); + + rc = syscall(__NR_reboot, 0, 0, 0, 0); + printf("reboot(0 /* LINUX_REBOOT_MAGIC_??? */, " + "0 /* LINUX_REBOOT_MAGIC_??? */, " + "LINUX_REBOOT_CMD_CAD_OFF) = %s\n", + sprintrc(rc)); + + rc = syscall(__NR_reboot, bogus_magic1, bogus_magic2, bogus_cmd, -1); + printf("reboot(%#x /* LINUX_REBOOT_MAGIC_??? */, " + "%#x /* LINUX_REBOOT_MAGIC_??? */, " + "%#x /* LINUX_REBOOT_CMD_??? */) = %s\n", + (unsigned int) bogus_magic1, (unsigned int) bogus_magic2, + (unsigned int) bogus_cmd, sprintrc(rc)); + + rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, + INVALID_MAGIC, LINUX_REBOOT_CMD_RESTART2, buf); printf("reboot(LINUX_REBOOT_MAGIC1, %#x /* LINUX_REBOOT_MAGIC_??? */," - " LINUX_REBOOT_CMD_RESTART2, \"%s\") = %ld %s (%m)\n", - INVALID_MAGIC, buf, rc, errno2name()); + " LINUX_REBOOT_CMD_RESTART2, \"%s\") = %s\n", + INVALID_MAGIC, buf, sprintrc(rc)); - rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, \ - LINUX_REBOOT_MAGIC2, INVALID_CMD); + rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, + LINUX_REBOOT_MAGIC2, INVALID_CMD); printf("reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2," - " %#x /* LINUX_REBOOT_CMD_??? */) = %ld %s (%m)\n", - INVALID_CMD, rc, errno2name()); + " %#x /* LINUX_REBOOT_CMD_??? */) = %s\n", + INVALID_CMD, sprintrc(rc)); + + rc = syscall(__NR_reboot, INVALID_MAGIC, LINUX_REBOOT_MAGIC2A, + LINUX_REBOOT_CMD_RESTART2, str256); + printf("reboot(%#x /* LINUX_REBOOT_MAGIC_??? */, LINUX_REBOOT_MAGIC2A, " + "LINUX_REBOOT_CMD_RESTART2, \"%.255s\"...) = %s\n", + INVALID_MAGIC, str256, sprintrc(rc)); + + rc = syscall(__NR_reboot, INVALID_MAGIC, LINUX_REBOOT_MAGIC2B, + LINUX_REBOOT_CMD_RESTART2, str256 + 1); + printf("reboot(%#x /* LINUX_REBOOT_MAGIC_??? */, LINUX_REBOOT_MAGIC2B, " + "LINUX_REBOOT_CMD_RESTART2, \"%.255s\"...) = %s\n", + INVALID_MAGIC, str256 + 1, sprintrc(rc)); + + rc = syscall(__NR_reboot, INVALID_MAGIC, LINUX_REBOOT_MAGIC2C, + LINUX_REBOOT_CMD_RESTART2, str256 + 2); + printf("reboot(%#x /* LINUX_REBOOT_MAGIC_??? */, LINUX_REBOOT_MAGIC2C, " + "LINUX_REBOOT_CMD_RESTART2, %p) = %s\n", + INVALID_MAGIC, str256 + 2, sprintrc(rc)); + + str256[255] = '\0'; + rc = syscall(__NR_reboot, INVALID_MAGIC, bogus_magic1, + LINUX_REBOOT_CMD_RESTART2, str256); + printf("reboot(%#x /* LINUX_REBOOT_MAGIC_??? */, " + "%#x /* LINUX_REBOOT_MAGIC_??? */, " + "LINUX_REBOOT_CMD_RESTART2, \"%.255s\"...) = %s\n", + INVALID_MAGIC, (unsigned int) bogus_magic1, str256, + sprintrc(rc)); + + rc = syscall(__NR_reboot, INVALID_MAGIC, bogus_magic1, + LINUX_REBOOT_CMD_RESTART2, str256 + 1); + printf("reboot(%#x /* LINUX_REBOOT_MAGIC_??? */, " + "%#x /* LINUX_REBOOT_MAGIC_??? */, " + "LINUX_REBOOT_CMD_RESTART2, \"%.254s\") = %s\n", + INVALID_MAGIC, (unsigned int) bogus_magic1, str256 + 1, + sprintrc(rc)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/reboot.gen.test b/tests-m32/reboot.gen.test new file mode 100755 index 00000000..06d2f0cb --- /dev/null +++ b/tests-m32/reboot.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (reboot -s 256); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s 256 diff --git a/tests-m32/reboot.test b/tests-m32/reboot.test deleted file mode 100755 index a97dd21a..00000000 --- a/tests-m32/reboot.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check reboot syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/recvfrom.c b/tests-m32/recvfrom.c index b12454d2..c363f6fa 100644 --- a/tests-m32/recvfrom.c +++ b/tests-m32/recvfrom.c @@ -1,30 +1,10 @@ /* * Check decoding of sockaddr related arguments of recvfrom syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #define TEST_SYSCALL_NAME recvfrom diff --git a/tests-m32/recvfrom.gen.test b/tests-m32/recvfrom.gen.test new file mode 100755 index 00000000..2741d210 --- /dev/null +++ b/tests-m32/recvfrom.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (recvfrom -a35 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests-m32/recvfrom.test b/tests-m32/recvfrom.test deleted file mode 100755 index 9dfbc898..00000000 --- a/tests-m32/recvfrom.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of sockaddr related arguments of recvfrom syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a35 diff --git a/tests-m32/recvmmsg-timeout.c b/tests-m32/recvmmsg-timeout.c index 7cf064db..2e703da0 100644 --- a/tests-m32/recvmmsg-timeout.c +++ b/tests-m32/recvmmsg-timeout.c @@ -2,29 +2,10 @@ * Check decoding of timeout argument of recvmmsg syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -50,13 +31,15 @@ main(void) .msg_iovlen = 1 } }; - struct timespec t = { .tv_sec = 0, .tv_nsec = 12345678 }; + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, ts); + ts->tv_sec = 0; + ts->tv_nsec = 12345678; - int rc = recv_mmsg(-1, &mh, 1, 0, &t); + int rc = recv_mmsg(-1, &mh, 1, 0, ts); printf("recvmmsg(-1, %p, 1, 0, {tv_sec=0, tv_nsec=12345678})" - " = %d %s (%m)\n", &mh, rc, errno2name()); + " = %s\n", &mh, sprintrc(rc)); - rc = recv_mmsg(fds[0], &mh, 1, 0, &t); + rc = recv_mmsg(fds[0], &mh, 1, 0, ts); if (rc < 0) perror_msg_and_skip("recvmmsg"); printf("recvmmsg(%d, [{msg_hdr={msg_name=NULL, msg_namelen=0" @@ -64,7 +47,23 @@ main(void) ", msg_controllen=0, msg_flags=0}, msg_len=1}], 1, 0" ", {tv_sec=0, tv_nsec=12345678}) = " "%d (left {tv_sec=0, tv_nsec=%d})\n", - fds[0], rc, (int) t.tv_nsec); + fds[0], rc, (int) ts->tv_nsec); + + ts->tv_sec = 0xdeadbeefU; + ts->tv_nsec = 0xfacefeedU; + + rc = recv_mmsg(fds[0], &mh, 1, 0, ts); + printf("recvmmsg(%d, %p, 1, 0, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + fds[0], &mh, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), sprintrc(rc)); + + ts->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + ts->tv_nsec = (long) 0xbadc0dedfacefeedLL; + + rc = recv_mmsg(fds[0], &mh, 1, 0, ts); + printf("recvmmsg(%d, %p, 1, 0, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + fds[0], &mh, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), sprintrc(rc)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/recvmmsg-timeout.gen.test b/tests-m32/recvmmsg-timeout.gen.test new file mode 100755 index 00000000..6306de76 --- /dev/null +++ b/tests-m32/recvmmsg-timeout.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (recvmmsg-timeout -a25 -e trace=recvmmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 -e trace=recvmmsg diff --git a/tests-m32/recvmmsg-timeout.test b/tests-m32/recvmmsg-timeout.test deleted file mode 100755 index 36a12221..00000000 --- a/tests-m32/recvmmsg-timeout.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of timeout argument of recvmmsg syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a25 -e trace=recvmmsg diff --git a/tests-m32/recvmsg.c b/tests-m32/recvmsg.c index fa41a9d4..f61fffb7 100644 --- a/tests-m32/recvmsg.c +++ b/tests-m32/recvmsg.c @@ -2,29 +2,10 @@ * Check decoding of recvmsg and sendmsg syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -100,7 +81,7 @@ main(void) w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), w2_c, LENGTH_OF(w2_c), - ARRAY_SIZE(w_iov_), w_len, + (unsigned int) ARRAY_SIZE(w_iov_), w_len, LENGTH_OF(w0_c), w0_d, w0_c, LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); @@ -127,7 +108,8 @@ main(void) ", msg_controllen=0, msg_flags=0}, 0) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + r0_c, r_len, (unsigned int) ARRAY_SIZE(r0_iov_), + r_len, r_len, r0_d, r0_c); void *r1 = tail_alloc(r_len); void *r2 = tail_alloc(w_len); @@ -151,8 +133,8 @@ main(void) ", msg_iovlen=%u, msg_controllen=0, msg_flags=0}, 0) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), w_len - r_len, - w_len - r_len, r1_d, r1_c); + r1_c, r_len, w_len, (unsigned int) ARRAY_SIZE(r1_iov_), + w_len - r_len, w_len - r_len, r1_d, r1_c); close(0); tprintf("+++ exited with 0 +++\n"); diff --git a/tests-m32/recvmsg.gen.test b/tests-m32/recvmsg.gen.test new file mode 100755 index 00000000..fc8ef067 --- /dev/null +++ b/tests-m32/recvmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (recvmsg -eread=0 -ewrite=1 -e trace=recvmsg,sendmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -eread=0 -ewrite=1 -e trace=recvmsg,sendmsg diff --git a/tests-m32/recvmsg.test b/tests-m32/recvmsg.test deleted file mode 100755 index e373a20a..00000000 --- a/tests-m32/recvmsg.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of recvmsg and sendmsg syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -eread=0 -ewrite=1 -e trace=recvmsg,sendmsg diff --git a/tests-m32/redirect-fds.c b/tests-m32/redirect-fds.c index fc1073a7..afce7d4c 100644 --- a/tests-m32/redirect-fds.c +++ b/tests-m32/redirect-fds.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/redirect-fds.test b/tests-m32/redirect-fds.test index ddef8fab..a833a586 100755 --- a/tests-m32/redirect-fds.test +++ b/tests-m32/redirect-fds.test @@ -3,29 +3,10 @@ # Check that strace does not leak placeholder descriptors. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -47,18 +28,17 @@ check_fd() a2="$2" a3="$3" + rm -f "$LOG" "$fd0" "$fd1" "$fd2" touch "$LOG" "$fd0" || framework_skip_ 'failed to create files' - set -- "\"./$NAME\"" "\"$1\"" "\"$2\"" "\"$3\"" + set -- "\"../$NAME\"" "\"$1\"" "\"$2\"" "\"$3\"" eval "$@" "<${a1:-&-}" ">${a2:-&-}" "2>${a3:-&-}" || fail_ "$* failed with code $rc" set -- "$STRACE" -o"$LOG" -echdir "$@" eval "$@" "<${a1:-&-}" ">${a2:-&-}" "2>${a3:-&-}" || dump_log_and_fail_with "$* failed with code $?" - - rm -f "$LOG" "$fd0" "$fd1" "$fd2" } check_fd "$fd0" "$fd1" "$fd2" diff --git a/tests-m32/redirect.test b/tests-m32/redirect.test index fa0c5369..ebf91bec 100755 --- a/tests-m32/redirect.test +++ b/tests-m32/redirect.test @@ -3,29 +3,10 @@ # Ensure that strace does not retain stdin and stdout descriptors. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -74,5 +55,3 @@ $STRACE -qq -enone -esignal=none \ if [ -s "$OUT" ]; then fail_ "$STRACE failed to redirect standard output" fi - -rm -f -- "$OUT" diff --git a/tests-m32/regex.gen.test b/tests-m32/regex.gen.test new file mode 100755 index 00000000..71a02d67 --- /dev/null +++ b/tests-m32/regex.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (regex test_trace_expr '' -etrace='/^(.*_)?statv?fs'); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -etrace='/^(.*_)?statv?fs' diff --git a/tests-m32/regex.in b/tests-m32/regex.in new file mode 100755 index 00000000..7c4adfe1 --- /dev/null +++ b/tests-m32/regex.in @@ -0,0 +1,2 @@ +statfs -a17 +statfs64 -a23 diff --git a/tests-m32/remap_file_pages-Xabbrev.c b/tests-m32/remap_file_pages-Xabbrev.c new file mode 100644 index 00000000..d808f423 --- /dev/null +++ b/tests-m32/remap_file_pages-Xabbrev.c @@ -0,0 +1 @@ +#include "remap_file_pages.c" diff --git a/tests-m32/remap_file_pages-Xabbrev.gen.test b/tests-m32/remap_file_pages-Xabbrev.gen.test new file mode 100755 index 00000000..76c45daa --- /dev/null +++ b/tests-m32/remap_file_pages-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (remap_file_pages-Xabbrev -Xabbrev -e trace=remap_file_pages); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xabbrev -e trace=remap_file_pages diff --git a/tests-m32/remap_file_pages-Xraw.c b/tests-m32/remap_file_pages-Xraw.c new file mode 100644 index 00000000..f01d20af --- /dev/null +++ b/tests-m32/remap_file_pages-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "remap_file_pages.c" diff --git a/tests-m32/remap_file_pages-Xraw.gen.test b/tests-m32/remap_file_pages-Xraw.gen.test new file mode 100755 index 00000000..2e022399 --- /dev/null +++ b/tests-m32/remap_file_pages-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (remap_file_pages-Xraw -Xraw -e trace=remap_file_pages); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xraw -e trace=remap_file_pages diff --git a/tests-m32/remap_file_pages-Xverbose.c b/tests-m32/remap_file_pages-Xverbose.c new file mode 100644 index 00000000..51e0e34e --- /dev/null +++ b/tests-m32/remap_file_pages-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "remap_file_pages.c" diff --git a/tests-m32/remap_file_pages-Xverbose.gen.test b/tests-m32/remap_file_pages-Xverbose.gen.test new file mode 100755 index 00000000..eb1e0f65 --- /dev/null +++ b/tests-m32/remap_file_pages-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (remap_file_pages-Xverbose -Xverbose -e trace=remap_file_pages); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xverbose -e trace=remap_file_pages diff --git a/tests-m32/remap_file_pages.c b/tests-m32/remap_file_pages.c index 452d2de7..2a2bfc6e 100644 --- a/tests-m32/remap_file_pages.c +++ b/tests-m32/remap_file_pages.c @@ -1,54 +1,111 @@ /* * Check decoding of remap_file_pages syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2017 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include +#include "scno.h" #ifdef __NR_remap_file_pages # include -# include +# include # include +# include + +static const char *errstr; + +static long +k_remap_file_pages(const kernel_ulong_t addr, + const kernel_ulong_t size, + const kernel_ulong_t prot, + const kernel_ulong_t pgoff, + const kernel_ulong_t flags) +{ + const long rc = syscall(__NR_remap_file_pages, + addr, size, prot, pgoff, flags); + errstr = sprintrc(rc); + return rc; +} int main(void) { - const unsigned long addr = (unsigned long) 0xfacefeeddeadbeefULL; - const unsigned long size = (unsigned long) 0xdefaced1bad2f00dULL; - const unsigned long prot = PROT_READ|PROT_WRITE|PROT_EXEC; - const unsigned long pgoff = (unsigned long) 0xcaf3babebad4deedULL; - const unsigned long flags = MAP_PRIVATE|MAP_ANONYMOUS; - - long rc = syscall(__NR_remap_file_pages, addr, size, prot, pgoff, flags); - printf("remap_file_pages(%#lx, %lu, %s, %lu, %s) = %ld %s (%m)\n", - addr, size, "PROT_READ|PROT_WRITE|PROT_EXEC", pgoff, - "MAP_PRIVATE|MAP_ANONYMOUS", rc, errno2name()); + kernel_ulong_t addr = (kernel_ulong_t) 0xfacefeeddeadbeefULL; + kernel_ulong_t size = (kernel_ulong_t) 0xdefaced1bad2f00dULL; + kernel_ulong_t prot = PROT_READ|PROT_WRITE|PROT_EXEC; + kernel_ulong_t pgoff = (kernel_ulong_t) 0xcaf3babebad4deedULL; + kernel_ulong_t flags = MAP_PRIVATE|MAP_ANONYMOUS; +# define prot1_str "PROT_READ|PROT_WRITE|PROT_EXEC" +# define flags1_str "MAP_PRIVATE|MAP_ANONYMOUS" + + k_remap_file_pages(addr, size, prot, pgoff, flags); +# if XLAT_RAW + printf("remap_file_pages(%#jx, %ju, %#jx, %ju, %#jx) = %s\n", + (uintmax_t) addr, (uintmax_t) size, (uintmax_t) prot, + (uintmax_t) pgoff, (uintmax_t) flags, errstr); +# elif XLAT_VERBOSE + printf("remap_file_pages(%#jx, %ju, %#jx /* %s */, %ju, %#jx /* %s */)" + " = %s\n", + (uintmax_t) addr, (uintmax_t) size, (uintmax_t) prot, prot1_str, + (uintmax_t) pgoff, (uintmax_t) flags, + flags1_str, errstr); +# else /* XLAT_ABBREV */ + printf("remap_file_pages(%#jx, %ju, %s, %ju, %s) = %s\n", + (uintmax_t) addr, (uintmax_t) size, prot1_str, + (uintmax_t) pgoff, flags1_str, errstr); +# endif + +# ifdef MAP_HUGETLB +# ifndef MAP_HUGE_2MB +# ifndef MAP_HUGE_SHIFT +# define MAP_HUGE_SHIFT 26 +# endif +# define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT) +# endif /* !MAP_HUGE_2MB */ + addr = (kernel_ulong_t) 0xfacefeeddeadf00dULL; + size = (kernel_ulong_t) 0xdefaced1bad2beefULL; + prot = (kernel_ulong_t) 0xdefaced00000000ULL | PROT_NONE; + flags = MAP_TYPE | MAP_FIXED | MAP_NORESERVE | MAP_HUGETLB | MAP_HUGE_2MB; + + k_remap_file_pages(addr, size, prot, pgoff, flags); + +/* + * HP PA-RISC is the only architecture that has MAP_TYPE defined to 0x3, which + * is also used for MAP_SHARED_VALIDATE since Linux commit v4.15-rc1~71^2^2~23. + */ +# ifdef __hppa__ +# define MAP_TYPE_str "MAP_SHARED_VALIDATE" +# else +# define MAP_TYPE_str "0xf /* MAP_??? */" +# endif +# define flags2_str \ + MAP_TYPE_str "|MAP_FIXED|MAP_NORESERVE|MAP_HUGETLB|21< diff --git a/tests-m32/rename.gen.test b/tests-m32/rename.gen.test new file mode 100755 index 00000000..81fb0398 --- /dev/null +++ b/tests-m32/rename.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rename -a35 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests-m32/rename.test b/tests-m32/rename.test deleted file mode 100755 index 9067e4cc..00000000 --- a/tests-m32/rename.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check rename syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a35 diff --git a/tests-m32/renameat.c b/tests-m32/renameat.c index 2b874efa..7f11893f 100644 --- a/tests-m32/renameat.c +++ b/tests-m32/renameat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/renameat.gen.test b/tests-m32/renameat.gen.test new file mode 100755 index 00000000..dbc6e05b --- /dev/null +++ b/tests-m32/renameat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (renameat ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/renameat.test b/tests-m32/renameat.test deleted file mode 100755 index 9b0a61dd..00000000 --- a/tests-m32/renameat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check renameat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/renameat2.c b/tests-m32/renameat2.c index 33f88988..663c0638 100644 --- a/tests-m32/renameat2.c +++ b/tests-m32/renameat2.c @@ -1,30 +1,10 @@ /* * Check decoding of renameat2 syscall. * - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/renameat2.gen.test b/tests-m32/renameat2.gen.test new file mode 100755 index 00000000..78251cb2 --- /dev/null +++ b/tests-m32/renameat2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (renameat2 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/renameat2.test b/tests-m32/renameat2.test deleted file mode 100755 index 4c176bbd..00000000 --- a/tests-m32/renameat2.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check renameat2 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/request_key.c b/tests-m32/request_key.c index fea977b2..20ae12f6 100644 --- a/tests-m32/request_key.c +++ b/tests-m32/request_key.c @@ -2,29 +2,10 @@ * Check decoding of request_key syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -69,8 +50,7 @@ main(void) { static const char unterminated1[] = { '\1', '\2', '\3', '\4', '\5' }; static const char unterminated2[] = { '\6', '\7', '\10', '\11', '\12' }; - static const char unterminated3[] = - { '\16', '\17', '\20', '\21', '\22' }; + static const char unterminated3[] = { '\16', '\17', '\20', '\21', '\22' }; char *bogus_type = tail_memdup(unterminated1, sizeof(unterminated1)); char *bogus_desc = tail_memdup(unterminated2, sizeof(unterminated2)); @@ -101,7 +81,7 @@ main(void) { bogus_desc, NULL }, { ARG_STR("\25\26\27\30\31") }, { ARG_STR("desc") }, - { "overly long description", _STR("overly long ") "..." }, + { "overly long description", STRINGIFY("overly long ") "..." }, }; struct { @@ -113,7 +93,7 @@ main(void) { bogus_info, NULL }, { ARG_STR("\32\33\34\35\36") }, { ARG_STR("info") }, - { "overly long info", _STR("overly long ") "..." }, + { "overly long info", STRINGIFY("overly long ") "..." }, }; struct { diff --git a/tests-m32/request_key.gen.test b/tests-m32/request_key.gen.test new file mode 100755 index 00000000..aeac708f --- /dev/null +++ b/tests-m32/request_key.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (request_key -a33 -s12); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -s12 diff --git a/tests-m32/request_key.test b/tests-m32/request_key.test deleted file mode 100755 index 9812a18e..00000000 --- a/tests-m32/request_key.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of request_key syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a33 -s12 diff --git a/tests-m32/restart_syscall.c b/tests-m32/restart_syscall.c index e492e62e..9a8f7e3a 100644 --- a/tests-m32/restart_syscall.c +++ b/tests-m32/restart_syscall.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -55,23 +36,24 @@ main(void) if (nanosleep(&req, &rem)) perror_msg_and_fail("nanosleep"); - printf("nanosleep\\(\\{tv_sec=%jd, tv_nsec=%jd\\}, " - "\\{tv_sec=%jd, tv_nsec=%jd\\}\\)" + printf("nanosleep\\(\\{tv_sec=%lld, tv_nsec=%llu\\}" + ", \\{tv_sec=%lld, tv_nsec=%llu\\}\\)" " = \\? ERESTART_RESTARTBLOCK \\(Interrupted by signal\\)\n", - (intmax_t) req.tv_sec, (intmax_t) req.tv_nsec, - (intmax_t) rem.tv_sec, (intmax_t) rem.tv_nsec); + (long long) req.tv_sec, zero_extend_signed_to_ull(req.tv_nsec), + (long long) rem.tv_sec, zero_extend_signed_to_ull(rem.tv_nsec)); puts("--- SIGALRM \\{si_signo=SIGALRM, si_code=SI_KERNEL\\} ---"); -#ifdef __arm__ +# 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\\{tv_sec=%jd, tv_nsec=%jd\\}), " - "%p|restart_syscall\\(<\\.\\.\\." +# define ALTERNATIVE_NANOSLEEP_REQ "0xfffffffc|" +# else +# define ALTERNATIVE_NANOSLEEP_REQ "" +# endif + printf("(nanosleep\\((%s\\{tv_sec=%lld, tv_nsec=%llu\\})" + ", %p|restart_syscall\\(<\\.\\.\\." " resuming interrupted nanosleep \\.\\.\\.>)\\) = 0\n", ALTERNATIVE_NANOSLEEP_REQ, - (intmax_t) req.tv_sec, (intmax_t) req.tv_nsec, &rem); + (long long) req.tv_sec, zero_extend_signed_to_ull(req.tv_nsec), + &rem); puts("\\+\\+\\+ exited with 0 \\+\\+\\+"); return 0; diff --git a/tests-m32/restart_syscall.test b/tests-m32/restart_syscall.test index 6dfda168..8dde6684 100755 --- a/tests-m32/restart_syscall.test +++ b/tests-m32/restart_syscall.test @@ -1,13 +1,15 @@ #!/bin/sh - +# # Check how "resuming interrupted nanosleep" works. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog > /dev/null syscalls=nanosleep,restart_syscall -run_strace -a20 -e trace=$syscalls $args > "$OUT" -match_grep "$LOG" "$OUT" -rm -f "$OUT" - -exit 0 +run_strace -a20 -e trace=$syscalls $args > "$EXP" +match_grep "$LOG" "$EXP" diff --git a/tests-m32/riscv_flush_icache.c b/tests-m32/riscv_flush_icache.c new file mode 100644 index 00000000..27abf75b --- /dev/null +++ b/tests-m32/riscv_flush_icache.c @@ -0,0 +1,73 @@ +/* + * Check decoding of riscv_flush_icache syscall. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include + +#include "scno.h" + +#ifdef __NR_riscv_flush_icache + +# include +# include +# include + +int main(void) +{ + static struct { + kernel_ulong_t addr; + const char *str; + } addrs[] = { + { (kernel_ulong_t) (uintptr_t) ARG_STR(NULL) }, + { (kernel_ulong_t) 0xbadc0deddeadf157ULL, + sizeof(kernel_ulong_t) == 8 ? "0xbadc0deddeadf157" : + "0xdeadf157" }, + }; + static struct { + kernel_ulong_t val; + const char *str; + } flags[] = { + { ARG_STR(0) }, + { 1, "SYS_RISCV_FLUSH_ICACHE_LOCAL" }, + { (kernel_ulong_t) 0xfacefeedfffffffeULL, + sizeof(kernel_ulong_t) == 8 ? + "0xfacefeedfffffffe /* SYS_RISCV_FLUSH_ICACHE_??? */" : + "0xfffffffe /* SYS_RISCV_FLUSH_ICACHE_??? */" }, + { (kernel_ulong_t) 0xfacefeedffffffffULL, + sizeof(kernel_ulong_t) == 8 ? + "SYS_RISCV_FLUSH_ICACHE_LOCAL|0xfacefeedfffffffe" : + "SYS_RISCV_FLUSH_ICACHE_LOCAL|0xfffffffe" }, + }; + + for (size_t i = 0; i < ARRAY_SIZE(addrs); i++) { + for (size_t j = 0; j < ARRAY_SIZE(addrs); j++) { + for (size_t k = 0; k < ARRAY_SIZE(flags); k++) { + long rc = syscall(__NR_riscv_flush_icache, + addrs[i].addr, + addrs[j].addr, + flags[k].val); + + printf("riscv_flush_icache(%s, %s, %s) = %s\n", + addrs[i].str, addrs[j].str, flags[k].str, + sprintrc(rc)); + } + } + } + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_riscv_flush_icache"); + +#endif diff --git a/tests-m32/riscv_flush_icache.gen.test b/tests-m32/riscv_flush_icache.gen.test new file mode 100755 index 00000000..1a1f793a --- /dev/null +++ b/tests-m32/riscv_flush_icache.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (riscv_flush_icache -a34 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a34 diff --git a/tests-m32/rmdir.c b/tests-m32/rmdir.c index 20952d84..505303ad 100644 --- a/tests-m32/rmdir.c +++ b/tests-m32/rmdir.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/rmdir.gen.test b/tests-m32/rmdir.gen.test new file mode 100755 index 00000000..8b346af9 --- /dev/null +++ b/tests-m32/rmdir.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rmdir -a22 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests-m32/rmdir.test b/tests-m32/rmdir.test deleted file mode 100755 index 81ee66b8..00000000 --- a/tests-m32/rmdir.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check rmdir syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a22 diff --git a/tests-m32/rt_sigaction.awk b/tests-m32/rt_sigaction.awk new file mode 100644 index 00000000..81dd8130 --- /dev/null +++ b/tests-m32/rt_sigaction.awk @@ -0,0 +1,76 @@ +#!/bin/gawk +# +# Copyright (c) 2014-2015 Dmitry V. Levin +# Copyright (c) 2016 Elvira Khabirova +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +BEGIN { + n1[1][1] = n2[1][1] = "SIG_IGN" + n1[1][2] = n2[1][2] = "\\[HUP INT\\]" + n1[1][3] = "SA_RESTORER\\|SA_RESTART" + n2[1][3] = "SA_RESTART" + n1[1][4] = ", sa_restorer=0x[0-9a-f]+" + n2[1][4] = "" + + n1[2][1] = n2[2][1] = "0x[0-9a-f]+" + n1[2][2] = n2[2][2] = "\\[QUIT TERM\\]" + n1[2][3] = "SA_RESTORER\\|SA_SIGINFO" + n2[2][3] = "SA_SIGINFO" + n1[2][4] = ", sa_restorer=0x[0-9a-f]+" + n2[2][4] = "" + + n1[3][1] = n2[3][1] = "SIG_DFL" + n1[3][2] = n2[3][2] = "\\[\\]" + n1[3][3] = "SA_RESTORER" + n2[3][3] = "0" + n1[3][4] = ", sa_restorer=0x[0-9a-f]+" + n2[3][4] = "" + + n1[4][1] = n2[4][1] = "SIG_DFL" + n1[4][2] = n2[4][2] = "~\\[HUP( ((RT|SIGRT)[^] ]+|[3-9][0-9]|1[0-9][0-9]))*\\]" + n1[4][3] = "SA_RESTORER" + n2[4][3] = "0" + n1[4][4] = ", sa_restorer=0x[0-9a-f]+" + n2[4][4] = "" + + o1[1][1] = o2[1][1] = "SIG_DFL" + o1[1][2] = o2[1][2] = "\\[\\]" + o1[1][3] = o2[1][3] = "0" + o1[1][4] = o2[1][4] = "" + + for (i = 2; i < 5; i++) { + for (j = 1; j < 5; j++) { + o1[i][j] = n1[i - 1][j] + o2[i][j] = n2[i - 1][j] + } + } + + a1 = "(0x[0-9a-f]+, )?(4|8|16)" + a2 = "(4|8|16)(, 0x[0-9a-f]+)?" + a3 = "0x[0-9a-f]+, (4|8|16)" + + for (i = 1; i < 5; i++) { + r[i] = "^rt_sigaction\\(SIGUSR2, (" \ + "\\{sa_handler=" n1[i][1] ", sa_mask=" n1[i][2] \ + ", sa_flags=" n1[i][3] n1[i][4] "\\}, \\{sa_handler=" \ + o1[i][1] ", sa_mask=" o1[i][2] ", sa_flags=" o1[i][3] \ + o1[i][4] "\\}, " a1 "|" \ + "\\{sa_handler=" n2[i][1] ", sa_mask=" n2[i][2] \ + ", sa_flags=" n2[i][3] n2[i][4] "\\}, \\{sa_handler=" \ + o2[i][1] ", sa_mask=" o2[i][2] ", sa_flags=" o2[i][3] \ + o2[i][4] "\\}, " a2 "|" \ + "\\{sa_handler=" n2[i][1] ", sa_mask=" n2[i][2] \ + ", sa_flags=" n2[i][3] n2[i][4] "\\}, \\{sa_handler=" \ + o2[i][1] ", sa_mask=" o2[i][2] ", sa_flags=" o2[i][3] \ + o2[i][4] "\\}, " a3 ")\\) = 0$" + } + s[5] = "+++ exited with 0 +++" + + lines = 5 + fail = 0 +} + +@include "match.awk" diff --git a/tests-m32/rt_sigaction.c b/tests-m32/rt_sigaction.c new file mode 100644 index 00000000..852b417b --- /dev/null +++ b/tests-m32/rt_sigaction.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2014-2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include +#include +#include +#include + +static void handle_signal(int no) +{ + _exit(128 + no); +} + +int +main(void) +{ + struct sigaction sa, sa0; + + sa.sa_handler = SIG_IGN; + sigemptyset(&sa.sa_mask); + sigaddset(&sa.sa_mask, SIGHUP); + sigaddset(&sa.sa_mask, SIGINT); + sa.sa_flags = SA_RESTART; + assert(!sigaction(SIGUSR2, &sa, &sa0)); + + sa.sa_handler = handle_signal; + sigemptyset(&sa.sa_mask); + sigaddset(&sa.sa_mask, SIGQUIT); + sigaddset(&sa.sa_mask, SIGTERM); + sa.sa_flags = SA_SIGINFO; + assert(!sigaction(SIGUSR2, &sa, &sa0)); + + sa.sa_handler = SIG_DFL; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + assert(!sigaction(SIGUSR2, &sa, &sa0)); + + sigfillset(&sa.sa_mask); + sigdelset(&sa.sa_mask, SIGHUP); + assert(!sigaction(SIGUSR2, &sa, &sa0)); + + return 0; +} diff --git a/tests-m32/rt_sigaction.test b/tests-m32/rt_sigaction.test new file mode 100755 index 00000000..afbbb540 --- /dev/null +++ b/tests-m32/rt_sigaction.test @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Check rt_sigaction decoding. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -ert_sigaction $args +match_awk + +exit 0 diff --git a/tests-m32/rt_sigpending.c b/tests-m32/rt_sigpending.c index accf6913..06b15db2 100644 --- a/tests-m32/rt_sigpending.c +++ b/tests-m32/rt_sigpending.c @@ -2,29 +2,10 @@ * This file is part of rt_sigpending strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -54,12 +35,12 @@ iterate(const char *const text, unsigned int size, void *set) break; } if (size) { -#if WORDS_BIGENDIAN +# if WORDS_BIGENDIAN if (size < sizeof(long)) tprintf("rt_sigpending(%s, %u) = 0\n", "[]", size); else -#endif +# endif tprintf("rt_sigpending(%s, %u) = 0\n", text, size); } else { @@ -78,7 +59,7 @@ main(void) const unsigned int big_size = 1024 / 8; void *k_set = tail_alloc(big_size); - sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(sigset_t, libc_set); sigemptyset(libc_set); if (sigprocmask(SIG_SETMASK, libc_set, NULL)) diff --git a/tests-m32/rt_sigpending.gen.test b/tests-m32/rt_sigpending.gen.test new file mode 100755 index 00000000..d52858af --- /dev/null +++ b/tests-m32/rt_sigpending.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rt_sigpending -a20 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-m32/rt_sigpending.test b/tests-m32/rt_sigpending.test deleted file mode 100755 index 40c83a81..00000000 --- a/tests-m32/rt_sigpending.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check rt_sigpending syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 diff --git a/tests-m32/rt_sigprocmask.c b/tests-m32/rt_sigprocmask.c index 27e357fa..e6f513da 100644 --- a/tests-m32/rt_sigprocmask.c +++ b/tests-m32/rt_sigprocmask.c @@ -2,29 +2,10 @@ * This file is part of rt_sigprocmask strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -91,7 +72,7 @@ main(void) void *const k_set = tail_alloc(set_size); void *const old_set = tail_alloc(set_size); - sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(sigset_t, libc_set); memset(k_set, 0, set_size); if (k_sigprocmask(SIG_SETMASK, k_set, NULL, set_size)) diff --git a/tests-m32/rt_sigprocmask.gen.test b/tests-m32/rt_sigprocmask.gen.test new file mode 100755 index 00000000..67fcdc0f --- /dev/null +++ b/tests-m32/rt_sigprocmask.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rt_sigprocmask ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/rt_sigprocmask.test b/tests-m32/rt_sigprocmask.test deleted file mode 100755 index 1e60ebde..00000000 --- a/tests-m32/rt_sigprocmask.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check rt_sigprocmask syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/rt_sigqueueinfo.c b/tests-m32/rt_sigqueueinfo.c index aba6776c..0455dd40 100644 --- a/tests-m32/rt_sigqueueinfo.c +++ b/tests-m32/rt_sigqueueinfo.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015 Elvira Khabirova + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,7 +13,7 @@ #include int -main (void) +main(void) { struct sigaction sa = { .sa_handler = SIG_IGN diff --git a/tests-m32/rt_sigqueueinfo.gen.test b/tests-m32/rt_sigqueueinfo.gen.test new file mode 100755 index 00000000..d11eecc0 --- /dev/null +++ b/tests-m32/rt_sigqueueinfo.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rt_sigqueueinfo -esignal=none ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests-m32/rt_sigqueueinfo.test b/tests-m32/rt_sigqueueinfo.test deleted file mode 100755 index c03c76f2..00000000 --- a/tests-m32/rt_sigqueueinfo.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of rt_sigqueueinfo syscall - -. "${srcdir=.}/init.sh" -run_strace_match_diff -esignal=none diff --git a/tests-m32/rt_sigreturn.c b/tests-m32/rt_sigreturn.c new file mode 100644 index 00000000..4a45b5d5 --- /dev/null +++ b/tests-m32/rt_sigreturn.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +#ifdef ASM_SIGRTMIN +# define RT_0 ASM_SIGRTMIN +#else +/* Linux kernel >= 3.18 defines SIGRTMIN to 32 on all architectures. */ +# define RT_0 32 +#endif + +static void +handler(int no, siginfo_t *si, void *uc) +{ +} + +int +main(void) +{ + static sigset_t set; + sigemptyset(&set); + sigaddset(&set, SIGINT); + sigaddset(&set, SIGUSR2); + sigaddset(&set, SIGCHLD); + sigaddset(&set, RT_0 + 3); + sigaddset(&set, RT_0 + 4); + sigaddset(&set, RT_0 + 5); + sigaddset(&set, RT_0 + 26); + sigaddset(&set, RT_0 + 27); + if (sigprocmask(SIG_SETMASK, &set, NULL)) + perror_msg_and_fail("sigprocmask"); + sigemptyset(&set); + + static const struct sigaction sa = { + .sa_sigaction = handler, + .sa_flags = SA_SIGINFO + }; + if (sigaction(SIGUSR1, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + if (raise(SIGUSR1)) + perror_msg_and_fail("raise"); + + static const char *const sigs = + (SIGUSR2 < SIGCHLD) ? "INT USR2 CHLD" : "INT CHLD USR2"; + static const char *const rt_sigs = "RT_3 RT_4 RT_5 RT_26 RT_27"; + printf("rt_sigreturn({mask=[%s %s]}) = 0\n", sigs, rt_sigs); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/rt_sigreturn.gen.test b/tests-m32/rt_sigreturn.gen.test new file mode 100755 index 00000000..d8b153e3 --- /dev/null +++ b/tests-m32/rt_sigreturn.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rt_sigreturn -esignal='!USR1' ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal='!USR1' diff --git a/tests-m32/rt_sigsuspend.c b/tests-m32/rt_sigsuspend.c index 73e13364..55ae6239 100644 --- a/tests-m32/rt_sigsuspend.c +++ b/tests-m32/rt_sigsuspend.c @@ -2,29 +2,10 @@ * This file is part of rt_sigsuspend strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -88,7 +69,7 @@ main(void) void *k_set = tail_alloc(big_size); memset(k_set, 0, big_size); - sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(sigset_t, libc_set); sigemptyset(libc_set); sigaddset(libc_set, SIGUSR1); if (sigprocmask(SIG_SETMASK, libc_set, NULL)) diff --git a/tests-m32/rt_sigsuspend.gen.test b/tests-m32/rt_sigsuspend.gen.test new file mode 100755 index 00000000..d5d1d5f3 --- /dev/null +++ b/tests-m32/rt_sigsuspend.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rt_sigsuspend -a20 -esignal=none); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -esignal=none diff --git a/tests-m32/rt_sigsuspend.test b/tests-m32/rt_sigsuspend.test deleted file mode 100755 index 2e30fd4b..00000000 --- a/tests-m32/rt_sigsuspend.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check rt_sigsuspend syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 -esignal=none diff --git a/tests-m32/rt_sigtimedwait.c b/tests-m32/rt_sigtimedwait.c index 10311e6e..56144f52 100644 --- a/tests-m32/rt_sigtimedwait.c +++ b/tests-m32/rt_sigtimedwait.c @@ -2,29 +2,10 @@ * This file is part of rt_sigtimedwait strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -54,25 +35,27 @@ iterate(const char *const text, const void *set, for (;;) { assert(k_sigtimedwait(set, NULL, timeout, size) == -1); if (EINTR == errno) { - tprintf("rt_sigtimedwait(%s, NULL, " - "{tv_sec=%jd, tv_nsec=%jd}, %u)" + tprintf("rt_sigtimedwait(%s, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}, %u)" " = -1 EAGAIN (%m)\n", text, - (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, + (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), size); } else { if (size < sizeof(long)) - tprintf("rt_sigtimedwait(%p, NULL, " - "{tv_sec=%jd, tv_nsec=%jd}" + tprintf("rt_sigtimedwait(%p, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}" ", %u) = -1 EINVAL (%m)\n", - set, (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, size); + set, (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), + size); else - tprintf("rt_sigtimedwait(%s, NULL, " - "{tv_sec=%jd, tv_nsec=%jd}" + tprintf("rt_sigtimedwait(%s, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}" ", %u) = -1 EINVAL (%m)\n", - text, (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, size); + text, (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), + size); } if (!size) break; @@ -86,8 +69,8 @@ main(void) { tprintf("%s", ""); - siginfo_t *const info = tail_alloc(sizeof(*info)); - struct timespec *const timeout = tail_alloc(sizeof(*timeout)); + TAIL_ALLOC_OBJECT_CONST_PTR(siginfo_t, info); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, timeout); timeout->tv_sec = 0; timeout->tv_nsec = 42; @@ -100,37 +83,58 @@ main(void) assert(k_sigtimedwait(k_set, NULL, timeout, set_size) == -1); if (EAGAIN == errno) break; - tprintf("rt_sigtimedwait(%p, NULL, {tv_sec=%jd, tv_nsec=%jd}, %u)" - " = -1 EINVAL (%m)\n", - k_set, (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, set_size); + tprintf("rt_sigtimedwait(%p, NULL, {tv_sec=%lld, tv_nsec=%llu}" + ", %u) = -1 EINVAL (%m)\n", + k_set, (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); } if (!set_size) perror_msg_and_fail("rt_sigtimedwait"); - tprintf("rt_sigtimedwait([], NULL, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", - (intmax_t) timeout->tv_sec, (intmax_t) timeout->tv_nsec, - set_size); + tprintf("rt_sigtimedwait([], NULL, {tv_sec=%lld, tv_nsec=%llu}, %u)" + " = -1 EAGAIN (%m)\n", + (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); + + timeout->tv_sec = 0xdeadbeefU; + timeout->tv_nsec = 0xfacefeedU; + assert(k_sigtimedwait(k_set, NULL, timeout, set_size) == -1); + tprintf("rt_sigtimedwait([], NULL, {tv_sec=%lld, tv_nsec=%llu}" + ", %u) = -1 EINVAL (%m)\n", + (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); + + timeout->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + timeout->tv_nsec = (long) 0xbadc0dedfacefeedLL; + assert(k_sigtimedwait(k_set, NULL, timeout, set_size) == -1); + tprintf("rt_sigtimedwait([], NULL, {tv_sec=%lld, tv_nsec=%llu}" + ", %u) = -1 EINVAL (%m)\n", + (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); + + timeout->tv_sec = 0; + timeout->tv_nsec = 42; - sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(sigset_t, libc_set); sigemptyset(libc_set); sigaddset(libc_set, SIGHUP); memcpy(k_set, libc_set, set_size); assert(k_sigtimedwait(k_set, info, timeout, set_size) == -1); assert(EAGAIN == errno); - tprintf("rt_sigtimedwait([HUP], %p, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", - info, (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, set_size); + tprintf("rt_sigtimedwait([HUP], %p, {tv_sec=%lld, tv_nsec=%llu}, %u)" + " = -1 EAGAIN (%m)\n", + info, (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); sigaddset(libc_set, SIGINT); memcpy(k_set, libc_set, set_size); assert(k_sigtimedwait(k_set, info, timeout, set_size) == -1); assert(EAGAIN == errno); - tprintf("rt_sigtimedwait([HUP INT], %p, {tv_sec=%jd, tv_nsec=%jd}, %u)" + tprintf("rt_sigtimedwait([HUP INT], %p, {tv_sec=%lld, tv_nsec=%llu}, %u)" " = -1 EAGAIN (%m)\n", - info, (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, set_size); + info, (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); sigaddset(libc_set, SIGQUIT); sigaddset(libc_set, SIGALRM); @@ -139,17 +143,19 @@ main(void) assert(k_sigtimedwait(k_set, info, timeout, set_size) == -1); assert(EAGAIN == errno); - tprintf("rt_sigtimedwait(%s, %p, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", + tprintf("rt_sigtimedwait(%s, %p, {tv_sec=%lld, tv_nsec=%llu}, %u)" + " = -1 EAGAIN (%m)\n", "[HUP INT QUIT ALRM TERM]", - info, (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, set_size); + info, (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); memset(k_set - set_size, -1, set_size); assert(k_sigtimedwait(k_set - set_size, info, timeout, set_size) == -1); assert(EAGAIN == errno); - tprintf("rt_sigtimedwait(~[], %p, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", - info, (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, set_size); + tprintf("rt_sigtimedwait(~[], %p, {tv_sec=%lld, tv_nsec=%llu}, %u)" + " = -1 EAGAIN (%m)\n", + info, (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); if (sigprocmask(SIG_SETMASK, libc_set, NULL)) perror_msg_and_fail("sigprocmask"); @@ -164,9 +170,11 @@ main(void) raise(SIGALRM); assert(k_sigtimedwait(k_set, info, timeout, set_size) == SIGALRM); tprintf("rt_sigtimedwait(%s, {si_signo=%s, si_code=SI_TKILL" - ", si_pid=%d, si_uid=%d}, {tv_sec=%jd, tv_nsec=%jd}, %u) = %d (%s)\n", + ", si_pid=%d, si_uid=%d}, {tv_sec=%lld, tv_nsec=%llu}, %u)" + " = %d (%s)\n", "[HUP INT QUIT ALRM TERM]", "SIGALRM", getpid(), getuid(), - (intmax_t) timeout->tv_sec, (intmax_t) timeout->tv_nsec, + (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size, SIGALRM, "SIGALRM"); raise(SIGALRM); diff --git a/tests-m32/rt_sigtimedwait.gen.test b/tests-m32/rt_sigtimedwait.gen.test new file mode 100755 index 00000000..a9409ae9 --- /dev/null +++ b/tests-m32/rt_sigtimedwait.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rt_sigtimedwait -a38 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a38 diff --git a/tests-m32/rt_sigtimedwait.test b/tests-m32/rt_sigtimedwait.test deleted file mode 100755 index e15fb779..00000000 --- a/tests-m32/rt_sigtimedwait.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check rt_sigtimedwait syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a38 diff --git a/tests-m32/rt_tgsigqueueinfo.c b/tests-m32/rt_tgsigqueueinfo.c index ec093481..e3ad0e22 100644 --- a/tests-m32/rt_tgsigqueueinfo.c +++ b/tests-m32/rt_tgsigqueueinfo.c @@ -2,29 +2,10 @@ * This file is part of rt_tgsigqueueinfo strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -42,14 +23,14 @@ static long k_tgsigqueueinfo(const pid_t pid, const int sig, const void *const info) { return syscall(__NR_rt_tgsigqueueinfo, - (unsigned long) 0xffffffff00000000ULL | pid, - (unsigned long) 0xffffffff00000000ULL | pid, - (unsigned long) 0xffffffff00000000ULL | sig, + F8ILL_KULONG_MASK | pid, + F8ILL_KULONG_MASK | pid, + F8ILL_KULONG_MASK | sig, info); } int -main (void) +main(void) { const struct sigaction sa = { .sa_handler = SIG_IGN @@ -57,14 +38,15 @@ main (void) if (sigaction(SIGUSR1, &sa, NULL)) perror_msg_and_fail("sigaction"); - siginfo_t *const info = tail_alloc(sizeof(*info)); + TAIL_ALLOC_OBJECT_CONST_PTR(siginfo_t, info); memset(info, 0, sizeof(*info)); info->si_signo = SIGUSR1; info->si_errno = ENOENT; info->si_code = SI_QUEUE; info->si_pid = getpid(); info->si_uid = getuid(); - info->si_value.sival_ptr = (void *) (unsigned long) 0xdeadbeeffacefeedULL; + info->si_value.sival_ptr = + (void *) (unsigned long) 0xdeadbeeffacefeedULL; if (k_tgsigqueueinfo(info->si_pid, SIGUSR1, info)) (errno == ENOSYS ? perror_msg_and_skip : perror_msg_and_fail)( diff --git a/tests-m32/rt_tgsigqueueinfo.gen.test b/tests-m32/rt_tgsigqueueinfo.gen.test new file mode 100755 index 00000000..0539e35a --- /dev/null +++ b/tests-m32/rt_tgsigqueueinfo.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rt_tgsigqueueinfo -esignal=none ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests-m32/rt_tgsigqueueinfo.test b/tests-m32/rt_tgsigqueueinfo.test deleted file mode 100755 index ab24e2d6..00000000 --- a/tests-m32/rt_tgsigqueueinfo.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of rt_tgsigqueueinfo syscall - -. "${srcdir=.}/init.sh" -run_strace_match_diff -esignal=none diff --git a/tests-m32/run.sh b/tests-m32/run.sh index 02d99123..1a0aa7e5 100755 --- a/tests-m32/run.sh +++ b/tests-m32/run.sh @@ -1,12 +1,22 @@ #!/bin/sh +# +# Copyright (c) 2013-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" $STRACE -V > /dev/null || framework_failure_ "$STRACE is not available" -TIMEOUT="timeout -s 9 $TIMEOUT_DURATION" +TIMEOUT="timeout -k 5 -s XCPU $TIMEOUT_DURATION" $TIMEOUT true > /dev/null 2>&1 || TIMEOUT= -exec $TIMEOUT "$@" +if [ $# -eq 0 ]; then + echo 'No command or test-file specified' >&2 + exit 1 +fi + +exec $TIMEOUT "$@" < /dev/null diff --git a/tests-m32/run_expect_termsig.c b/tests-m32/run_expect_termsig.c new file mode 100644 index 00000000..f6b72d07 --- /dev/null +++ b/tests-m32/run_expect_termsig.c @@ -0,0 +1,38 @@ +/* + * Execute a command, expect its termination with a specified signal. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include + +int +main(int ac, char **av) +{ + if (ac < 3) + error_msg_and_fail("usage: run_expect_termsig signo path..."); + + signal(SIGCHLD, SIG_DFL); + + pid_t pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + execvp(av[2], av + 2); + perror_msg_and_fail("execvp: %s", av[2]); + } + + int status; + if (waitpid(pid, &status, 0) != pid) + perror_msg_and_fail("waitpid"); + + return !(WIFSIGNALED(status) && WTERMSIG(status) == atoi(av[1])); +} diff --git a/tests-m32/s390_guarded_storage-v.c b/tests-m32/s390_guarded_storage-v.c new file mode 100644 index 00000000..05afd9fe --- /dev/null +++ b/tests-m32/s390_guarded_storage-v.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "s390_guarded_storage.c" diff --git a/tests-m32/s390_guarded_storage-v.gen.test b/tests-m32/s390_guarded_storage-v.gen.test new file mode 100755 index 00000000..045ff762 --- /dev/null +++ b/tests-m32/s390_guarded_storage-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (s390_guarded_storage-v -e trace=s390_guarded_storage -a32 -v); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=s390_guarded_storage -a32 -v diff --git a/tests-m32/s390_guarded_storage.c b/tests-m32/s390_guarded_storage.c new file mode 100644 index 00000000..a84c1413 --- /dev/null +++ b/tests-m32/s390_guarded_storage.c @@ -0,0 +1,208 @@ +/* + * Check decoding of s390_guarded_storage syscall. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#if defined __NR_s390_guarded_storage && defined HAVE_ASM_GUARDED_STORAGE_H + +# include +# include +# include +# include + +# include + +# ifndef VERBOSE +# define VERBOSE 0 +# endif + +static void +gs_no_arg(kernel_ulong_t val, const char *val_str) +{ + static const kernel_ulong_t bogus_addr = + (kernel_ulong_t) 0xcaffeedadeadbed5ULL; + static const kernel_ulong_t bogus_cmd_mask = + (kernel_ulong_t) 0xbadc0ded00000000ULL; + long rc; + + rc = syscall(__NR_s390_guarded_storage, val | bogus_cmd_mask, + bogus_addr); + printf("s390_guarded_storage(%s) = %s\n", val_str, sprintrc(rc)); +} + +static void +gs_print_epl(uint64_t addr, bool valid, const char *str) +{ + if (!valid) { + if (str) + printf("%s", str); + else + printf("%#" PRIx64, addr); + + return; + } + + struct gs_epl *gsepl = (struct gs_epl *) (uintptr_t) addr; + + printf("[{"); + +# if VERBOSE + if (gsepl->pad1) + printf("pad1=%#02x, ", gsepl->pad1); + + printf("gs_eam=%#02x /* extended addressing mode: %u, " + "basic addressing mode: %u */" + ", gs_eci=%#02x /* CPU in TX: %u, CPU in CX: %u, " + "instruction: %s */" + ", gs_eai=%#02x /* DAT: %u, address space indication: %u, " + "AR number: %u */, ", + gsepl->gs_eam, gsepl->e, gsepl->b, + gsepl->gs_eci, gsepl->tx, gsepl->cx, + gsepl->in ? "LLGFGS": "LGG", + gsepl->gs_eai, gsepl->t, gsepl->as, gsepl->ar); + + if (gsepl->pad2) + printf("pad2=%#08x, ", gsepl->pad2); +# endif /* VERBOSE */ + + printf("gs_eha=%#llx, ", (unsigned long long) gsepl->gs_eha); + +# if VERBOSE + printf("gs_eia=%#llx, gs_eoa=%#llx, gs_eir=%#llx, gs_era=%#llx", + (unsigned long long) gsepl->gs_eia, + (unsigned long long) gsepl->gs_eoa, + (unsigned long long) gsepl->gs_eir, + (unsigned long long) gsepl->gs_era); +# else /* !VERBOSE */ + printf("..."); +# endif /* VERBOSE */ + + printf("}]"); +} + +static void +gs_set_cb(kernel_ulong_t addr, bool valid, bool epl_valid, + const char *bc_str, const char *epl_str) +{ + static const kernel_ulong_t bogus_cmd_mask = + (kernel_ulong_t) 0xda7a105700000000ULL; + + long rc; + + printf("s390_guarded_storage(GS_SET_BC_CB, "); + + if (valid) { + struct gs_cb *gscb = (struct gs_cb *) (uintptr_t) addr; + + printf("{"); + + if (gscb->reserved) + printf("reserved=%#016llx, ", + (unsigned long long) gscb->reserved); + + printf("gsd=%#16llx", + (unsigned long long) gscb->gsd); +# if VERBOSE + printf(" /* GS origin: "); + + unsigned int gsc = gscb->gsd & 0x3F; + unsigned int gls = (gscb->gsd >> 8) & 7; + bool gsc_valid = gsc >= 25 && gsc <= 56; + + if (gsc_valid) { + uint64_t gls = gscb->gsd >> gsc; + int field_size = 2 + (67 - gsc) / 4; + + printf("%#0*" PRIx64, field_size, gls); + } else { + printf("[invalid]"); + } + + printf(", guard load shift: %u, GS characteristic: %u */", + gls, gsc); +# endif /* VERBOSE */ + + printf(", gssm=%#016llx, gs_epl_a=", + (unsigned long long) gscb->gssm); + + gs_print_epl(gscb->gs_epl_a, epl_valid, epl_str); + + printf("}"); + } else { + if (bc_str) + printf("%s", bc_str); + else + printf("%#llx", (unsigned long long) addr); + } + + rc = syscall(__NR_s390_guarded_storage, + GS_SET_BC_CB | bogus_cmd_mask, addr); + printf(") = %s\n", sprintrc(rc)); +} + +int +main(void) +{ + static const kernel_ulong_t bogus_cmd = + (kernel_ulong_t) 0xdeafbeefdeadc0deULL; + static const kernel_ulong_t bogus_addr = + (kernel_ulong_t) 0xfacefeedac0ffeedULL; + + TAIL_ALLOC_OBJECT_CONST_PTR(struct gs_cb, gscb); + TAIL_ALLOC_OBJECT_CONST_PTR(struct gs_epl, gsepl); + + long rc; + + rc = syscall(__NR_s390_guarded_storage, 5, 0); + printf("s390_guarded_storage(0x5 /* GS_??? */, NULL) = %s\n", + sprintrc(rc)); + + rc = syscall(__NR_s390_guarded_storage, bogus_cmd, bogus_addr); + printf("s390_guarded_storage(%#x /* GS_??? */, %#lx) = %s\n", + (unsigned) bogus_cmd, (unsigned long) bogus_addr, sprintrc(rc)); + + gs_no_arg(ARG_STR(GS_BROADCAST)); + gs_no_arg(ARG_STR(GS_CLEAR_BC_CB)); + gs_no_arg(ARG_STR(GS_DISABLE)); + gs_no_arg(ARG_STR(GS_ENABLE)); + + fill_memory(gscb, sizeof(*gscb)); + fill_memory_ex(gsepl, sizeof(*gsepl), 0xA5, 0x5A); + + gs_set_cb(0, false, false, "NULL", NULL); + gs_set_cb((uintptr_t) (gscb + 1), false, false, NULL, NULL); + + gscb->gs_epl_a = 0; + gs_set_cb((uintptr_t) gscb, true, false, NULL, "NULL"); + + fill_memory_ex(gscb, sizeof(*gscb), 0x5A, 0xA5); + gscb->gs_epl_a = (uintptr_t) (gsepl + 1) | + (sizeof(kernel_ulong_t) < sizeof(uint64_t) ? + 0xc0debad000000000ULL : 0); + gs_set_cb((uintptr_t) gscb, true, false, NULL, NULL); + + fill_memory_ex(gscb, sizeof(*gscb), 0xA7, 0xA5); + gscb->gs_epl_a = (uintptr_t) gsepl; + gs_set_cb((uintptr_t) gscb, true, true, NULL, NULL); + + fill_memory_ex(gscb, sizeof(*gscb), 0x55, 0xAA); + fill_memory_ex(gsepl, sizeof(*gsepl), 0x5A, 0xA5); + gscb->gs_epl_a = (uintptr_t) gsepl; + gs_set_cb((uintptr_t) gscb, true, true, NULL, NULL); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_s390_guarded_storage && HAVE_ASM_GUARDED_STORAGE_H") + +#endif diff --git a/tests-m32/s390_guarded_storage.gen.test b/tests-m32/s390_guarded_storage.gen.test new file mode 100755 index 00000000..28b59814 --- /dev/null +++ b/tests-m32/s390_guarded_storage.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (s390_guarded_storage -a32 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 diff --git a/tests-m32/s390_pci_mmio_read_write.c b/tests-m32/s390_pci_mmio_read_write.c new file mode 100644 index 00000000..0cd160c6 --- /dev/null +++ b/tests-m32/s390_pci_mmio_read_write.c @@ -0,0 +1,134 @@ +/* + * Check decoding of s390_pci_mmio_read and s390_pci_mmio_write syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#if defined __NR_s390_pci_mmio_read && defined __NR_s390_pci_mmio_write + +# include +# include +# include +# include + +static void +do_call(bool wr, kernel_ulong_t mmio_addr, kernel_ulong_t buf, + kernel_ulong_t len, bool buf_valid, const char *buf_str) +{ + long saved_errno = 0; + long rc = 0; + + printf("s390_pci_mmio_%s(%#llx, ", wr ? "write" : "read", + (unsigned long long) mmio_addr); + + if (!wr) { + rc = syscall(__NR_s390_pci_mmio_read, mmio_addr, buf, len); + saved_errno = errno; + } + + if (buf_valid && !rc) { + char *buf_ptr = (char *) (uintptr_t) buf; + + print_quoted_hex(buf_ptr, + len > DEFAULT_STRLEN ? DEFAULT_STRLEN : len); + + if (len > DEFAULT_STRLEN) + printf("..."); + } else { + if (buf_str) + printf("%s", buf_str); + else + printf("%#llx", (unsigned long long) buf); + } + + printf(", %llu) = ", (unsigned long long) len); + + if (wr) + rc = syscall(__NR_s390_pci_mmio_write, mmio_addr, buf, len); + else + errno = saved_errno; + + puts(sprintrc(rc)); +} + +int +main(void) +{ + static const size_t buf_size = DEFAULT_STRLEN + 10; + + char *buf = tail_alloc(buf_size); + + bool bools[] = { true, false }; + + kernel_ulong_t addrs[] = { + 0, + (kernel_ulong_t) 0xdeafbeefdeadc0deULL, + }; + + struct { + kernel_ulong_t buf; + const char *str; + size_t size; + } bufs[] = { + { (kernel_ulong_t) ARG_STR(NULL), 0 }, + { (kernel_ulong_t) (buf + buf_size), NULL, 0 }, + { (kernel_ulong_t) (buf), NULL, buf_size }, + { (kernel_ulong_t) (buf + 9), NULL, buf_size - 9 }, + { (kernel_ulong_t) (buf + 10), NULL, buf_size - 10 }, + { (kernel_ulong_t) (buf + 16), NULL, buf_size - 16 }, + { (kernel_ulong_t) (buf + 26), NULL, buf_size - 26 }, + { (kernel_ulong_t) (buf + 28), NULL, buf_size - 28 }, + }; + + kernel_ulong_t sizes[] = { + 0, + DEFAULT_STRLEN / 2, + DEFAULT_STRLEN - 10, + DEFAULT_STRLEN, + DEFAULT_STRLEN + 1, + buf_size, + buf_size + 10, + (kernel_ulong_t) 0xfacefeedac0ffeedULL, + }; + + unsigned int i, j, k, l; + unsigned int ctr = 0; + + for (i = 0; i < ARRAY_SIZE(addrs); i++) { + for (j = 0; j < ARRAY_SIZE(bufs); j++) { + for (k = 0; k < ARRAY_SIZE(sizes); k++) { + for (l = 0; l < ARRAY_SIZE(bools); l++) { + bool valid = bufs[j].buf && + bufs[j].size >= + MIN(sizes[k], + DEFAULT_STRLEN + 1); + + if (bufs[j].size && bools[l]) + fill_memory_ex((char *) buf, + bufs[j].size, + 0xC0 + ctr, 255); + + do_call(bools[l], addrs[i], bufs[j].buf, + sizes[k], valid, bufs[j].str); + + ctr++; + } + } + } + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_s390_pci_mmio_read && __NR_s390_pci_mmio_write"); + +#endif diff --git a/tests-m32/s390_pci_mmio_read_write.gen.test b/tests-m32/s390_pci_mmio_read_write.gen.test new file mode 100755 index 00000000..cf32e0b3 --- /dev/null +++ b/tests-m32/s390_pci_mmio_read_write.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (s390_pci_mmio_read_write -e trace=s390_pci_mmio_read,s390_pci_mmio_write -a30); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=s390_pci_mmio_read,s390_pci_mmio_write -a30 diff --git a/tests-m32/s390_runtime_instr.c b/tests-m32/s390_runtime_instr.c new file mode 100644 index 00000000..db31719b --- /dev/null +++ b/tests-m32/s390_runtime_instr.c @@ -0,0 +1,78 @@ +/* + * Check decoding of s390_runtime_instr syscall. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#if defined __NR_s390_runtime_instr + +# include +# include +# include +# include + +int +main(void) +{ + static struct { + kernel_ulong_t cmd; + const char * cmd_str; + } cmd_args[] = { + { 0, "0 /* S390_RUNTIME_INSTR_??? */" }, + { 4, "4 /* S390_RUNTIME_INSTR_??? */" }, + { (kernel_ulong_t) 0xdeafbeefdeadc0deULL, + "-559038242 /* S390_RUNTIME_INSTR_??? */" }, + { 2, "S390_RUNTIME_INSTR_STOP" }, + }; + + static struct { + kernel_ulong_t sig; + const char * sig_str; + } start_sig_args[] = { + { 0, "0" }, + { (kernel_ulong_t) 0xfacefeedac0ffeedULL, NULL }, + { ARG_STR(SIGALRM) }, + { 33, "SIGRT_1" }, + { 63, "SIGRT_31" }, + }; + + unsigned int i; + long rc; + + for (i = 0; i < ARRAY_SIZE(cmd_args); i++) { + rc = syscall(__NR_s390_runtime_instr, cmd_args[i].cmd, 0xdead); + printf("s390_runtime_instr(%s) = %s\n", + cmd_args[i].cmd_str, sprintrc(rc)); + } + + for (i = 0; i < ARRAY_SIZE(start_sig_args); i++) { + long saved_errno; + + rc = syscall(__NR_s390_runtime_instr, 1, start_sig_args[i].sig); + saved_errno = errno; + printf("s390_runtime_instr(S390_RUNTIME_INSTR_START, "); + + if (start_sig_args[i].sig_str) + printf("%s", start_sig_args[i].sig_str); + else + printf("%d", (int) start_sig_args[i].sig); + + errno = saved_errno; + printf(") = %s\n", sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_s390_runtime_instr") + +#endif diff --git a/tests-m32/s390_runtime_instr.gen.test b/tests-m32/s390_runtime_instr.gen.test new file mode 100755 index 00000000..83e81502 --- /dev/null +++ b/tests-m32/s390_runtime_instr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (s390_runtime_instr -a44 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a44 diff --git a/tests-m32/s390_sthyi-v.c b/tests-m32/s390_sthyi-v.c new file mode 100644 index 00000000..86055203 --- /dev/null +++ b/tests-m32/s390_sthyi-v.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "s390_sthyi.c" diff --git a/tests-m32/s390_sthyi-v.gen.test b/tests-m32/s390_sthyi-v.gen.test new file mode 100755 index 00000000..27ab447b --- /dev/null +++ b/tests-m32/s390_sthyi-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (s390_sthyi-v -e trace=s390_sthyi -a47 -v); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=s390_sthyi -a47 -v diff --git a/tests-m32/s390_sthyi.c b/tests-m32/s390_sthyi.c new file mode 100644 index 00000000..5186fdc9 --- /dev/null +++ b/tests-m32/s390_sthyi.c @@ -0,0 +1,763 @@ +/* + * Check decoding of s390_sthyi syscall. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#if defined HAVE_ICONV_H && defined HAVE_ICONV_OPEN && defined __NR_s390_sthyi + +# include +# include +# include +# include +# include +# include + +# include + +# define EBCDIC_MAX_LEN 16 + +# ifndef VERBOSE +# define VERBOSE 0 +# endif + +static inline bool +print_0x8(const char *prefix, unsigned char *buf, unsigned int offs, bool zero) +{ + if (!zero && !buf[offs]) + return false; + + printf("%s=%#02hhx", prefix, buf[offs]); + + return true; +} + +static inline bool +print_u8(const char *prefix, unsigned char *buf, unsigned int offs, bool zero) +{ + if (!zero && !buf[offs]) + return false; + + printf("%s=%hhu", prefix, buf[offs]); + + return true; +} + +static inline bool +print_u16(const char *prefix, unsigned char *buf, unsigned int offs, bool zero) +{ + uint16_t val = *(uint16_t *) (buf + offs); + + if (!zero && !val) + return false; + + printf("%s=%" PRIu16, prefix, val); + + return true; +} + +static inline bool +print_x32(const char *prefix, unsigned char *buf, unsigned int offs, bool zero) +{ + uint32_t val = *(uint32_t *) (buf + offs); + + if (!zero && !val) + return false; + + printf("%s=%#" PRIx32, prefix, val); + + return true; +} + +static inline bool +print_weight(const char *prefix, unsigned char *buf, unsigned int offs, + bool zero) +{ + uint32_t val = *(uint32_t *) (buf + offs); + + if (print_x32(prefix, buf, offs, zero)) { + if (val) + printf(" /* %u %u/65536 cores */", + val >> 16, val & 0xFFFF); + else + printf(" /* unlimited */"); + + return true; + } + + return false; +} + +static inline char * +ebcdic2ascii(unsigned char *ebcdic, size_t size) +{ + static char ascii_buf[EBCDIC_MAX_LEN]; + + char *ebcdic_pos = (char *) ebcdic; + char *ascii_pos = ascii_buf; + size_t ebcdic_left = size; + size_t ascii_left = size; + size_t ret; + + iconv_t cd = iconv_open("ASCII", "EBCDICUS"); + + if (size > sizeof(ascii_buf)) + error_msg_and_fail("ebcdic2ascii: EBCDIC string is too big: " + "%zu (maximum is %zu)", + size, sizeof(ascii_buf)); + if (cd == (iconv_t) -1) + perror_msg_and_fail("ebcdic2ascii: unable to allocate a " + "conversion descriptior for converting " + "EBCDIC to ASCII"); + + while ((ret = iconv(cd, &ebcdic_pos, &ebcdic_left, + &ascii_pos, &ascii_left)) == (size_t) -1) { + switch (errno) { + case EILSEQ: + case EINVAL: /* That one is quite unexpected, actually */ + if (!ebcdic_left || !ascii_left) + goto ebcdic2ascii_end; + + *ascii_pos++ = ' '; + ebcdic_pos++; + ebcdic_left--; + + break; + + case E2BIG: + perror_msg_and_fail("ebcdic2ascii: ran out of " + "ASCII buffer unexpectedly"); + default: + perror_msg_and_fail("ebcdic2ascii: unexpected error"); + } + } + +ebcdic2ascii_end: + iconv_close(cd); + + if (ebcdic_left != ascii_left) + error_msg_and_fail("ebcdic2ascii: ASCII string differs in size " + "from EBCDIC"); + + return ascii_buf; +} + +static inline bool +is_empty(unsigned char *ptr, size_t size) +{ + size_t i; + + for (i = 0; !*ptr && i < size; ptr++, i++) + ; + + return i == size; +} + +static inline bool +print_ebcdic(const char *prefix, unsigned char *addr, unsigned int offs, + size_t size, bool zero, bool blank) +{ + const char *ascii = ebcdic2ascii(addr + offs, size); + + if (!zero) { + size_t i; + + for (i = 0; (addr[offs + i] == (blank ? 64 : 0)) && (i < size); + i++) + ; + + if (i == size) + return false; + } + + printf("%s=", prefix); + print_quoted_hex((char *) (addr + offs), size); + printf(" /* "); + print_quoted_memory(ascii, size); + printf(" */"); + + return true; +} + +static void +print_hypervisor_header(unsigned char *buf, int level, unsigned int offs_pos, + unsigned int len_pos, bool mt) +{ + uint16_t offs = *(uint16_t *) (buf + offs_pos); + uint16_t hdr_size = *(uint16_t *) (buf + len_pos); + unsigned char *cur; + + if (!offs) + return; + if (hdr_size < 32) + error_msg_and_fail("sthyi: hypervisor %d section is too small " + "(got %hu, 32 expected)", level, hdr_size); + + cur = buf + offs; + + printf(", /* hypervisor %d */ {infyflg1", level); + print_0x8("", cur, 0, true); +# if VERBOSE + if (cur[0]) { + bool printed = false; + + printf(" /* "); + if (cur[0] & 0x80) { + printf("0x80 - guest CPU usage had limiting is using " + "the consumption method"); + printed = true; + } + if (cur[0] & 0x40) { + if (printed) + printf(", "); + printf("0x40 - LIMITHARD caps use prorated core time " + "for capping"); + printed = true; + } + if (cur[0] & 0x3F) { + if (printed) + printf(", "); + printf("%#hhx - ???", cur[0] & 0x3F); + } + printf(" */"); + } + + print_0x8(", infyflg2", cur, 1, false); + print_0x8(", infyval1", cur, 2, false); + print_0x8(", infyval2", cur, 3, false); + + print_u8(", infytype", cur, 4, true); + if (cur[4] == 1) + printf(" /* z/VM is the hypervisor */"); + else + printf(" /* unknown hypervisor type */"); + + if (cur[5]) + printf(", reserved_1__=\"\\x%#02hhx\"", cur[5]); + + print_u8(", infycpt", cur, 6, mt); + print_u8(", infyiflt", cur, 7, mt); +# endif /* !VERBOSE */ + + print_ebcdic(", infysyid", cur, 8, 8, VERBOSE, true); + print_ebcdic(", infyclnm", cur, 16, 8, VERBOSE, true); + + print_u16(", infyscps", cur, 24, VERBOSE); + print_u16(", infydcps", cur, 26, VERBOSE); + print_u16(", infysifl", cur, 28, VERBOSE); + print_u16(", infydifl", cur, 30, VERBOSE); + +# if VERBOSE + if (hdr_size > 32 && !is_empty(cur + 32, hdr_size - 32)) { + printf(", "); + print_quoted_hex((char *) (cur + 32), hdr_size - 32); + } +# else /* !VERBOSE */ + printf(", ..."); +# endif /* !VERBOSE */ + + printf("}"); +} + +static void +print_guest_header(unsigned char *buf, int level, unsigned int offs_pos, + unsigned int len_pos) +{ + uint16_t offs = *(uint16_t *) (buf + offs_pos); + uint16_t hdr_size = *(uint16_t *) (buf + len_pos); + unsigned char *cur; + + if (!offs) + return; + if (hdr_size < 56) + error_msg_and_fail("sthyi: guest %d section is too small " + "(got %hu, 56 expected)", level, hdr_size); + + cur = buf + offs; + + printf(", /* guest %d */ {infgflg1", level); + print_0x8("", cur, 0, true); +# if VERBOSE + if (cur[0]) { + bool printed = false; + + printf(" /* "); + if (cur[0] & 0x80) { + printf("0x80 - guest is mobility enabled"); + printed = true; + } + if (cur[0] & 0x40) { + if (printed) + printf(", "); + printf("0x40 - guest has multiple virtual CPU types"); + printed = true; + } + if (cur[0] & 0x20) { + if (printed) + printf(", "); + printf("0x20 - guest CP dispatch type has LIMITHARD " + "cap"); + printed = true; + } + if (cur[0] & 0x10) { + if (printed) + printf(", "); + printf("0x10 - guest IFL dispatch type has LIMITHARD " + "cap"); + printed = true; + } + if (cur[0] & 0x08) { + if (printed) + printf(", "); + printf("0x08 - virtual CPs are thread dispatched"); + printed = true; + } + if (cur[0] & 0x04) { + if (printed) + printf(", "); + printf("0x04 - virtual IFLs are thread dispatched"); + printed = true; + } + if (cur[0] & 0x3) { + if (printed) + printf(", "); + printf("%#hhx - ???", cur[0] & 0x3); + } + printf(" */"); + } + + print_0x8(", infgflg2", cur, 1, false); + print_0x8(", infgval1", cur, 2, false); + print_0x8(", infgval2", cur, 3, false); +# endif /* !VERBOSE */ + + print_ebcdic(", infgusid", cur, 4, 8, true, false); + + print_u16(", infgscps", cur, 12, VERBOSE); + print_u16(", infgdcps", cur, 14, VERBOSE); + +# if VERBOSE + print_u8(", infgcpdt", cur, 16, true); + if (cur[16] == 0) + printf(" /* General Purpose (CP) */"); + else + printf(" /* unknown */"); + + if (cur[17] || cur[18] || cur[19]) + printf(", reserved_1__=\"\\x%#02hhx\\x%#02hhx\\x%#02hhx\"", + cur[17], cur[18], cur[19]); +# endif /* !VERBOSE */ + + print_weight(", infgcpcc", cur, 20, VERBOSE); + + print_u16(", infgsifl", cur, 24, VERBOSE); + print_u16(", infgdifl", cur, 26, VERBOSE); + +# if VERBOSE + print_u8(", infgifdt", cur, 28, true); + if (cur[28] == 0) + printf(" /* General Purpose (CP) */"); + else if (cur[28] == 3) + printf(" /* Integrated Facility for Linux (IFL) */"); + else + printf(" /* unknown */"); + + if (cur[29] || cur[30] || cur[31]) + printf(", reserved_2__=\"\\x%#02hhx\\x%#02hhx\\x%#02hhx\"", + cur[29], cur[30], cur[31]); +# endif /* !VERBOSE */ + + print_weight(", infgifcc", cur, 32, VERBOSE); + + print_0x8(", infgpflg", cur, 36, true); +# if VERBOSE + if (cur[36]) { + bool printed = false; + + printf(" /* "); + if (cur[36] & 0x80) { + printf("0x80 - CPU pool's CP virtual type has " + "LIMITHARD cap"); + printed = true; + } + if (cur[36] & 0x40) { + if (printed) + printf(", "); + printf("0x40 - CPU pool's CP virtual type has " + "CAPACITY cap"); + printed = true; + } + if (cur[36] & 0x20) { + if (printed) + printf(", "); + printf("0x20 - CPU pool's IFL virtual type has " + "LIMITHARD cap"); + printed = true; + } + if (cur[36] & 0x10) { + if (printed) + printf(", "); + printf("0x10 - CPU pool's IFL virtual type has " + "CAPACITY cap"); + printed = true; + } + if (cur[36] & 0x08) { + if (printed) + printf(", "); + printf("0x08 - CPU pool uses prorated core time"); + printed = true; + } + if (cur[36] & 0x7) { + if (printed) + printf(", "); + printf("%#hhx - ???", cur[36] & 0x7); + } + printf(" */"); + } + + if (cur[37] || cur[38] || cur[39]) + printf(", reserved_3__=\"\\x%#02hhx\\x%#02hhx\\x%#02hhx\"", + cur[37], cur[38], cur[39]); + + print_ebcdic(", infgpnam", cur, 40, 8, false, true); + + print_weight(", infgpccc", cur, 48, true); + print_weight(", infgpicc", cur, 52, true); + + if (hdr_size > 56 && !is_empty(cur + 56, hdr_size - 56)) { + printf(", "); + print_quoted_hex((char *) (cur + 56), hdr_size - 56); + } +# else /* !VERBOSE */ + printf(", ..."); +# endif /* !VERBOSE */ + + printf("}"); +} + +static void +print_sthyi(unsigned char *buf) +{ + unsigned char *cur; + uint16_t hdr_size; + uint16_t offs; + bool mt = false; + + hdr_size = *(uint16_t *) (buf + 10); + if (hdr_size < 44) + error_msg_and_fail("sthyi: header section is too small " + "(got %hu, 44 expected)", hdr_size); + + /* INFHFLG1 */ + print_0x8("{/* header */ {infhflg1", buf, 0, true); +# if VERBOSE + if (buf[0]) { + bool printed = false; + + printf(" /* "); + if (buf[0] & 0x80) { + printf("0x80 - Global Performance Data unavailable"); + printed = true; + } + if (buf[0] & 0x40) { + if (printed) + printf(", "); + printf("0x40 - One or more hypervisor levels below " + "this level does not support the STHYI " + "instruction"); + printed = true; + } + if (buf[0] & 0x20) { + if (printed) + printf(", "); + printf("0x20 - Virtualization stack is incomplete"); + printed = true; + } + if (buf[0] & 0x10) { + if (printed) + printf(", "); + printf("0x10 - Execution environment is not within a " + "logical partition"); + printed = true; + } + if (buf[0] & 0xF) { + if (printed) + printf(", "); + printf("%#hhx - ???", buf[0] & 0xF); + } + printf(" */"); + } + + print_0x8(", infhflg2", buf, 1, false); + print_0x8(", infhval1", buf, 2, false); + print_0x8(", infhval2", buf, 3, false); + + /* Reserved */ + if (buf[4] || buf[5] || buf[6]) + printf(", reserved_1__=\"\\x%#02hhx\\x%#02hhx\\x%#02hhx\"", + buf[4], buf[5], buf[6]); + + print_u8(", infhygct", buf, 7, true); + print_u16(", infhtotl", buf, 8, true); + print_u16(", infhdln", buf, 10, true); + print_u16(", infmoff", buf, 12, true); + print_u16(", infmlen", buf, 14, true); + print_u16(", infpoff", buf, 16, true); + print_u16(", infplen", buf, 18, true); + print_u16(", infhoff1", buf, 20, true); + print_u16(", infhlen1", buf, 22, true); + print_u16(", infgoff1", buf, 24, true); + print_u16(", infglen1", buf, 26, true); + print_u16(", infhoff2", buf, 28, true); + print_u16(", infhlen2", buf, 30, true); + print_u16(", infgoff2", buf, 32, true); + print_u16(", infglen2", buf, 34, true); + print_u16(", infhoff3", buf, 36, true); + print_u16(", infhlen3", buf, 38, true); + print_u16(", infgoff3", buf, 40, true); + print_u16(", infglen3", buf, 42, true); + + if (hdr_size > 44 && !is_empty(buf + 44, hdr_size - 44)) { + printf(", "); + print_quoted_hex((char *) (buf + 44), hdr_size - 44); + } +# else /* !VERBOSE */ + printf(", ..."); +# endif /* !VERBOSE */ + + printf("}"); + + /* Machine header */ + offs = *(uint16_t *) (buf + 12); + if (!offs) + goto partition_hdr; + + hdr_size = *(uint16_t *) (buf + 14); + if (hdr_size < 60) + error_msg_and_fail("sthyi: machine section is too small " + "(got %hu, 60 expected)", hdr_size); + + cur = buf + offs; + + printf(", /* machine */ {"); + +# if VERBOSE + print_0x8("infmflg1", cur, 0, false); + if (cur[0]) + printf(", "); + print_0x8("infmflg2", cur, 1, false); + if (cur[1]) + printf(", "); +# endif /* !VERBOSE */ + print_0x8("infmval1", cur, 2, true); + + bool cnt_valid = cur[2] & 0x80; +# if VERBOSE + bool id_valid = cur[2] & 0x40; + bool name_valid = cur[2] & 0x20; + + printf(" /* processor count validity: %d, machine ID validity: %d, " + "machine name validity: %d", + !!cnt_valid, !!id_valid, !!name_valid); + if (cur[2] & 0x1F) + printf(", %#hhx - ???", cur[2] & 0x1F); + printf(" */"); + print_0x8(", infmval2", cur, 3, false); +# endif /* !VERBOSE */ + + print_u16(", infmscps", cur, 4, cnt_valid); + print_u16(", infmdcps", cur, 6, cnt_valid); + print_u16(", infmsifl", cur, 8, cnt_valid); + print_u16(", infmdifl", cur, 10, cnt_valid); + +# if VERBOSE + print_ebcdic(", infmname", cur, 12, 8, name_valid, false); + + print_ebcdic(", infmtype", cur, 20, 4, id_valid, false); + print_ebcdic(", infmmanu", cur, 24, 16, id_valid, false); + print_ebcdic(", infmseq", cur, 40, 16, id_valid, false); + print_ebcdic(", infmpman", cur, 56, 4, id_valid, false); + + if (hdr_size > 60 && !is_empty(cur + 60, hdr_size - 60)) { + printf(", "); + print_quoted_hex((char *) (cur + 60), hdr_size - 60); + } +# else /* !VERBOSE */ + printf(", ..."); +# endif /* !VERBOSE */ + + printf("}"); + +partition_hdr: + /* Partition header */ + offs = *(uint16_t *) (buf + 16); + if (!offs) + goto hv_hdr; + + hdr_size = *(uint16_t *) (buf + 18); + if (hdr_size < 56) + error_msg_and_fail("sthyi: partition section is too small " + "(got %hu, 56 expected)", hdr_size); + + cur = buf + offs; + + print_0x8(", /* partition */ {infpflg1", cur, 0, true); + mt = !!(cur[0] & 0x80); +# if VERBOSE + if (cur[0]) { + bool printed = false; + + printf(" /* "); + if (cur[0] & 0x80) { + printf("0x80 - multithreading is enabled"); + printed = true; + } + if (cur[0] & 0x7F) { + if (printed) + printf(", "); + printf("%#hhx - ???", cur[0] & 0x7F); + } + printf(" */"); + } + print_0x8(", infpflg2", cur, 1, false); +# endif /* !VERBOSE */ + print_0x8(", infpval1", cur, 2, true); + + bool pcnt_valid = cur[2] & 0x80; + bool pid_valid = cur[2] & 0x10; +# if VERBOSE + bool pwcap_valid = cur[2] & 0x40; + bool pacap_valid = cur[2] & 0x20; + bool lpar_valid = cur[2] & 0x08; +# endif /* !VERBOSE */ + +# if VERBOSE + printf(" /* processor count validity: %d, partition weight-based " + "capacity validity: %d, partition absolute capacity validity: " + "%d, partition ID validity: %d, LPAR group absolute capacity " + "capping information validity: %d", + !!pcnt_valid, !!pwcap_valid, !!pacap_valid, !!pid_valid, + !!lpar_valid); + if (cur[2] & 0x7) + printf(", %#hhx - ???", cur[2] & 0x7); + printf(" */"); + + print_0x8(", infpval2", cur, 3, false); +# endif /* !VERBOSE */ + + print_u16(", infppnum", cur, 4, pid_valid); + + print_u16(", infpscps", cur, 6, pcnt_valid); + print_u16(", infpdcps", cur, 8, pcnt_valid); + print_u16(", infpsifl", cur, 10, pcnt_valid); + print_u16(", infpdifl", cur, 12, pcnt_valid); + +# if VERBOSE + if (cur[14] || cur[15]) + printf(", reserved_1__=\"\\x%#02hhx\\x%#02hhx\"", + cur[14], cur[15]); +# endif /* !VERBOSE */ + + print_ebcdic(", infppnam", cur, 16, 8, pid_valid, false); + +# if VERBOSE + print_weight(", infpwbcp", cur, 24, pwcap_valid); + print_weight(", infpabcp", cur, 28, pacap_valid); + print_weight(", infpwbif", cur, 32, pwcap_valid); + print_weight(", infpabif", cur, 36, pacap_valid); + + if (print_ebcdic(", infplgnm", cur, 40, 8, false, false)) { + + print_weight(", infplgcp", cur, 48, false); + print_weight(", infplgif", cur, 52, false); + } else { + if (lpar_valid) { + printf(", infplgnm="); + print_quoted_hex((char *) (cur + 40), 8); + } + + print_x32(", infplgcp", cur, 48, false); + print_x32(", infplgif", cur, 52, false); + } + + if (hdr_size > 56 && !is_empty(cur + 56, hdr_size - 56)) { + printf(", "); + print_quoted_hex((char *) (cur + 56), hdr_size - 56); + } +# else /* !VERBOSE */ + printf(", ..."); +# endif /* !VERBOSE */ + + printf("}"); + +hv_hdr: + /* Hypervisor/guest headers */ + print_hypervisor_header(buf, 1, 20, 22, mt); + print_guest_header(buf, 1, 24, 26); + print_hypervisor_header(buf, 2, 28, 30, mt); + print_guest_header(buf, 2, 32, 34); + print_hypervisor_header(buf, 3, 36, 38, mt); + print_guest_header(buf, 3, 40, 42); + + printf("}"); +} + +int +main(void) +{ + static const kernel_ulong_t bogus_func = + (kernel_ulong_t) 0xdeafbeefdeadc0deULL; + static const kernel_ulong_t bogus_resp_buf = + (kernel_ulong_t) 0xfacefeedac0ffeedULL; + static const kernel_ulong_t bogus_ret_code = + (kernel_ulong_t) 0xf00dfa57decaffedULL; + static const kernel_ulong_t bogus_flags = + (kernel_ulong_t) 0xfee1deadfa57beefULL; + + unsigned char *buf = tail_alloc(PAGE_SIZE); + TAIL_ALLOC_OBJECT_CONST_PTR(uint64_t, ret); + + long rc; + + rc = syscall(__NR_s390_sthyi, 0, 0, 0, 0); + printf("s390_sthyi(STHYI_FC_CP_IFL_CAP, NULL, NULL, 0) = %s\n", + sprintrc(rc)); + + rc = syscall(__NR_s390_sthyi, bogus_func, bogus_resp_buf, + bogus_ret_code, bogus_flags); + printf("s390_sthyi(%#llx /* STHYI_FC_??? */, %#llx, %#llx, %#llx) = " + "%s\n", + (unsigned long long) bogus_func, + (unsigned long long) bogus_resp_buf, + (unsigned long long) bogus_ret_code, + (unsigned long long) bogus_flags, + sprintrc(rc)); + + rc = syscall(__NR_s390_sthyi, bogus_func, buf, ret, 0); + printf("s390_sthyi(%#llx /* STHYI_FC_??? */, %p, %p, 0) = %s\n", + (unsigned long long) bogus_func, buf, ret, sprintrc(rc)); + + rc = syscall(__NR_s390_sthyi, 0, buf, ret, 0); + if (rc) + error_msg_and_skip("syscall(__NR_s390_sthyi, 0, buf, ret, 0) " + "returned unexpected value of %ld", rc); + + printf("s390_sthyi(STHYI_FC_CP_IFL_CAP, "); + print_sthyi(buf); + printf(", [0], 0) = 0\n"); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_ICONV_H && HAVE_ICONV_OPEN && __NR_s390_sthyi") + +#endif diff --git a/tests-m32/s390_sthyi.gen.test b/tests-m32/s390_sthyi.gen.test new file mode 100755 index 00000000..cf271374 --- /dev/null +++ b/tests-m32/s390_sthyi.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (s390_sthyi -a47 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a47 diff --git a/tests-m32/sched.gen.test b/tests-m32/sched.gen.test new file mode 100755 index 00000000..67471176 --- /dev/null +++ b/tests-m32/sched.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched test_trace_expr times -e/sched); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr times -e/sched diff --git a/tests-m32/sched.in b/tests-m32/sched.in new file mode 100755 index 00000000..46031d6c --- /dev/null +++ b/tests-m32/sched.in @@ -0,0 +1,7 @@ +sched_xetaffinity -a28 +sched_xetparam -a23 +sched_rr_get_interval -a31 +sched_get_priority_mxx -a33 +sched_xetattr -a29 +sched_xetscheduler -a22 +sched_yield -a14 diff --git a/tests-m32/sched_get_priority_mxx.c b/tests-m32/sched_get_priority_mxx.c index fc14b27c..7715d286 100644 --- a/tests-m32/sched_get_priority_mxx.c +++ b/tests-m32/sched_get_priority_mxx.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -24,6 +31,6 @@ main(void) #else SKIP_MAIN_UNDEFINED("__NR_sched_get_priority_min" - " && defined __NR_sched_get_priority_max"); + " && defined __NR_sched_get_priority_max"); #endif diff --git a/tests-m32/sched_get_priority_mxx.gen.test b/tests-m32/sched_get_priority_mxx.gen.test new file mode 100755 index 00000000..a2359972 --- /dev/null +++ b/tests-m32/sched_get_priority_mxx.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched_get_priority_mxx -a33 -e trace=sched_get_priority_min,sched_get_priority_max); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -e trace=sched_get_priority_min,sched_get_priority_max diff --git a/tests-m32/sched_get_priority_mxx.test b/tests-m32/sched_get_priority_mxx.test deleted file mode 100755 index 0d1a1a78..00000000 --- a/tests-m32/sched_get_priority_mxx.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sched_get_priority_min and sched_get_priority_max syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a33 -e trace=sched_get_priority_min,sched_get_priority_max diff --git a/tests-m32/sched_rr_get_interval.c b/tests-m32/sched_rr_get_interval.c index 0aacd2b7..b1117f3b 100644 --- a/tests-m32/sched_rr_get_interval.c +++ b/tests-m32/sched_rr_get_interval.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -11,7 +18,7 @@ int main(void) { - struct timespec *const tp = tail_alloc(sizeof(struct timespec)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, tp); long rc; rc = syscall(__NR_sched_rr_get_interval, 0, NULL); @@ -25,8 +32,10 @@ main(void) rc = syscall(__NR_sched_rr_get_interval, 0, tp); if (rc == 0) - printf("sched_rr_get_interval(0, {tv_sec=%jd, tv_nsec=%jd}) = " - "0\n", (intmax_t)tp->tv_sec, (intmax_t)tp->tv_nsec); + printf("sched_rr_get_interval(0, {tv_sec=%lld, tv_nsec=%llu})" + " = 0\n", + (long long) tp->tv_sec, + zero_extend_signed_to_ull(tp->tv_nsec)); else printf("sched_rr_get_interval(-1, %p) = %s\n", tp, sprintrc(rc)); diff --git a/tests-m32/sched_rr_get_interval.gen.test b/tests-m32/sched_rr_get_interval.gen.test new file mode 100755 index 00000000..02aad002 --- /dev/null +++ b/tests-m32/sched_rr_get_interval.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched_rr_get_interval -a31 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 diff --git a/tests-m32/sched_rr_get_interval.test b/tests-m32/sched_rr_get_interval.test deleted file mode 100755 index 828ba5d0..00000000 --- a/tests-m32/sched_rr_get_interval.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sched_rr_get_interval syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a31 diff --git a/tests-m32/sched_xetaffinity.c b/tests-m32/sched_xetaffinity.c index 41a18202..4e6fbe20 100644 --- a/tests-m32/sched_xetaffinity.c +++ b/tests-m32/sched_xetaffinity.c @@ -1,30 +1,10 @@ /* * This file is part of sched_xetaffinity strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/sched_xetaffinity.gen.test b/tests-m32/sched_xetaffinity.gen.test new file mode 100755 index 00000000..7a1c75be --- /dev/null +++ b/tests-m32/sched_xetaffinity.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched_xetaffinity -a28 -e trace=sched_getaffinity,sched_setaffinity); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 -e trace=sched_getaffinity,sched_setaffinity diff --git a/tests-m32/sched_xetaffinity.test b/tests-m32/sched_xetaffinity.test deleted file mode 100755 index 246ea21a..00000000 --- a/tests-m32/sched_xetaffinity.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sched_getaffinity and sched_setaffinity syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 -e trace=sched_getaffinity,sched_setaffinity diff --git a/tests-m32/sched_xetattr.c b/tests-m32/sched_xetattr.c index 1b484915..3440876b 100644 --- a/tests-m32/sched_xetattr.c +++ b/tests-m32/sched_xetattr.c @@ -1,28 +1,9 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,95 +13,254 @@ # include # include +# include # include +# include "sched_attr.h" +# include "xlat.h" +# include "xlat/schedulers.h" + +static const char *errstr; + +static long +sys_sched_getattr(kernel_ulong_t pid, kernel_ulong_t attr, + kernel_ulong_t size, kernel_ulong_t flags) +{ + long rc = syscall(__NR_sched_getattr, pid, attr, size, flags); + errstr = sprintrc(rc); + return rc; +} + +static long +sys_sched_setattr(kernel_ulong_t pid, kernel_ulong_t attr, kernel_ulong_t flags) +{ + long rc = syscall(__NR_sched_setattr, pid, attr, flags); + errstr = sprintrc(rc); + return rc; +} int main(void) { - struct { - uint32_t size; - uint32_t sched_policy; - uint64_t sched_flags; - int32_t sched_nice; - uint32_t sched_priority; - uint64_t sched_runtime; - uint64_t sched_deadline; - uint64_t sched_period; - } *sched_attr = tail_alloc(sizeof(*sched_attr)); - - long rc = syscall(__NR_sched_getattr, 0xdeadface, NULL, 0, 0); - printf("sched_getattr\\(%d, NULL, 0, 0\\) += %s\n", - 0xdeadface, sprintrc_grep(rc)); - - rc = syscall(__NR_sched_getattr, -1, - sched_attr, 0xbadfaced, 0xc0defeed); - printf("sched_getattr\\(-1, %p, %u, %u\\) += %s\n", - sched_attr, 0xbadfaced, 0xc0defeed, sprintrc_grep(rc)); - - rc = syscall(__NR_sched_getattr, 0, - sched_attr + 1, sizeof(*sched_attr), 0); - printf("sched_getattr\\(0, %p, %u, 0\\) += %s\n", - sched_attr + 1, (unsigned)sizeof(*sched_attr), - sprintrc_grep(rc)); - - if (syscall(__NR_sched_getattr, 0, sched_attr, sizeof(*sched_attr), 0)) - perror_msg_and_skip("sched_getattr"); + static const kernel_ulong_t bogus_pid = + (kernel_ulong_t) 0xdefacedfacefeedULL; + static const kernel_ulong_t bogus_size = + (kernel_ulong_t) 0xdefacedcafef00dULL; + static const kernel_ulong_t bogus_flags = + (kernel_ulong_t) 0xdefaceddeadc0deULL; + + TAIL_ALLOC_OBJECT_CONST_PTR(struct sched_attr, attr); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, psize); + void *const efault = attr + 1; + + sys_sched_getattr(0, 0, 0, 0); + printf("sched_getattr(0, NULL, 0, 0) = %s\n", errstr); - printf("sched_getattr\\(0, \\{size=%u, sched_policy=SCHED_[A-Z]+" - ", sched_flags=%s, sched_nice=%d, sched_priority=%u" + sys_sched_getattr(0, (unsigned long) attr, 0, 0); + printf("sched_getattr(0, %p, 0, 0) = %s\n", attr, errstr); + + sys_sched_getattr(bogus_pid, 0, 0, 0); + printf("sched_getattr(%d, NULL, 0, 0) = %s\n", (int) bogus_pid, errstr); + + sys_sched_getattr(-1U, (unsigned long) attr, bogus_size, bogus_flags); + printf("sched_getattr(-1, %p, %s%u, %u) = %s\n", + attr, +# if defined __arm64__ || defined __aarch64__ + "0xdefaced<<32|", +# else + "", +# endif + (unsigned) bogus_size, (unsigned) bogus_flags, errstr); + + sys_sched_getattr(0, (unsigned long) efault, sizeof(*attr), 0); + printf("sched_getattr(0, %p, %u, 0) = %s\n", + efault, (unsigned) sizeof(*attr), errstr); + + if (sys_sched_getattr(0, (unsigned long) attr, sizeof(*attr), 0)) + perror_msg_and_skip("sched_getattr"); + printf("sched_getattr(0, {size=%u, sched_policy=", attr->size); + printxval(schedulers, attr->sched_policy, NULL); + printf(", sched_flags=%s, sched_nice=%d, sched_priority=%u" ", sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 - ", sched_period=%" PRIu64 "\\}, %u, 0\\) += 0\n", - sched_attr->size, - sched_attr->sched_flags ? "SCHED_FLAG_RESET_ON_FORK" : "0", - sched_attr->sched_nice, - sched_attr->sched_priority, - sched_attr->sched_runtime, - sched_attr->sched_deadline, - sched_attr->sched_period, - (unsigned) sizeof(*sched_attr)); - - sched_attr->sched_flags |= 1; - if (syscall(__NR_sched_setattr, 0, sched_attr, 0)) + ", sched_period=%" PRIu64 "}, %u, 0) = 0\n", + attr->sched_flags ? "SCHED_FLAG_RESET_ON_FORK" : "0", + attr->sched_nice, + attr->sched_priority, + attr->sched_runtime, + attr->sched_deadline, + attr->sched_period, + (unsigned) sizeof(*attr)); + +# if defined __arm64__ || defined __aarch64__ + long rc = +# endif + sys_sched_getattr(F8ILL_KULONG_MASK, (unsigned long) attr, + F8ILL_KULONG_MASK | sizeof(*attr), F8ILL_KULONG_MASK); +# if defined __arm64__ || defined __aarch64__ + if (rc) { + printf("sched_getattr(0, %p, 0xffffffff<<32|%u, 0) = %s\n", + attr, (unsigned) sizeof(*attr), errstr); + } else +# endif + { + printf("sched_getattr(0, {size=%u, sched_policy=", attr->size); + printxval(schedulers, attr->sched_policy, NULL); + printf(", sched_flags=%s, sched_nice=%d, sched_priority=%u" + ", sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 + ", sched_period=%" PRIu64 "}, %u, 0) = 0\n", + attr->sched_flags ? "SCHED_FLAG_RESET_ON_FORK" : "0", + attr->sched_nice, + attr->sched_priority, + attr->sched_runtime, + attr->sched_deadline, + attr->sched_period, + (unsigned) sizeof(*attr)); + } + + sys_sched_setattr(bogus_pid, 0, 0); + printf("sched_setattr(%d, NULL, 0) = %s\n", (int) bogus_pid, errstr); + + attr->sched_flags |= 1; + + if (sys_sched_setattr(0, (unsigned long) attr, 0)) perror_msg_and_skip("sched_setattr"); + printf("sched_setattr(0, {size=%u, sched_policy=", attr->size); + printxval(schedulers, attr->sched_policy, NULL); + printf(", sched_flags=%s, sched_nice=%d, sched_priority=%u" + ", sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 + ", sched_period=%" PRIu64 "}, 0) = 0\n", + "SCHED_FLAG_RESET_ON_FORK", + attr->sched_nice, + attr->sched_priority, + attr->sched_runtime, + attr->sched_deadline, + attr->sched_period); - printf("sched_setattr\\(0, \\{size=%u, sched_policy=SCHED_[A-Z]+" - ", sched_flags=%s, sched_nice=%d, sched_priority=%u" + sys_sched_setattr(F8ILL_KULONG_MASK, (unsigned long) attr, + F8ILL_KULONG_MASK); + printf("sched_setattr(0, {size=%u, sched_policy=", attr->size); + printxval(schedulers, attr->sched_policy, NULL); + printf(", sched_flags=%s, sched_nice=%d, sched_priority=%u" ", sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 - ", sched_period=%" PRIu64 "\\}, 0\\) += 0\n", - sched_attr->size, + ", sched_period=%" PRIu64 "}, 0) = 0\n", "SCHED_FLAG_RESET_ON_FORK", - sched_attr->sched_nice, - sched_attr->sched_priority, - sched_attr->sched_runtime, - sched_attr->sched_deadline, - sched_attr->sched_period); - - sched_attr->size = 0x90807060; - sched_attr->sched_policy = 0xca7faced; - sched_attr->sched_flags = 0xbadc0ded1057da7aULL; - sched_attr->sched_nice = 0xafbfcfdf; - sched_attr->sched_priority = 0xb8c8d8e8; - sched_attr->sched_runtime = 0xbadcaffedeadf157ULL; - sched_attr->sched_deadline = 0xc0de70a57badac75ULL; - sched_attr->sched_period = 0xded1ca7edda7aca7ULL; - - rc = syscall(__NR_sched_setattr, 0xfacec0de, sched_attr, 0xbeeff00d); - - printf("sched_setattr\\(%d, \\{size=%u, " - "sched_policy=%#x /\\* SCHED_\\?\\?\\? \\*/, " - "sched_flags=%#" PRIx64 " /\\* SCHED_FLAG_\\?\\?\\? \\*/, " - "sched_nice=%d, sched_priority=%u, sched_runtime=%" PRIu64 ", " - "sched_deadline=%" PRIu64 ", sched_period=%" PRIu64 "\\}, " - "%u\\) += %s\n", - 0xfacec0de, sched_attr->size, - sched_attr->sched_policy, - sched_attr->sched_flags, - sched_attr->sched_nice, - sched_attr->sched_priority, - sched_attr->sched_runtime, - sched_attr->sched_deadline, - sched_attr->sched_period, 0xbeeff00d, sprintrc_grep(rc)); + attr->sched_nice, + attr->sched_priority, + attr->sched_runtime, + attr->sched_deadline, + attr->sched_period); + + *psize = attr->size; + + sys_sched_setattr(0, (unsigned long) psize, 0); + printf("sched_setattr(0, %p, 0) = %s\n", psize, errstr); + + attr->size = 0; + + sys_sched_setattr(0, (unsigned long) attr, 0); + printf("sched_setattr(0, {size=%u, sched_policy=", attr->size); + printxval(schedulers, attr->sched_policy, NULL); + printf(", sched_flags=%s, sched_nice=%d, sched_priority=%u" + ", sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 + ", sched_period=%" PRIu64 "}, 0) = 0\n", + "SCHED_FLAG_RESET_ON_FORK", + attr->sched_nice, + attr->sched_priority, + attr->sched_runtime, + attr->sched_deadline, + attr->sched_period); + + attr->size = 1; + + sys_sched_setattr(0, (unsigned long) attr, 0); + printf("sched_setattr(0, {size=%u} => {size=%u}, 0) = %s\n", + 1, attr->size, errstr); + + attr->size = SCHED_ATTR_MIN_SIZE - 1; + + sys_sched_setattr(0, (unsigned long) attr, 0); + printf("sched_setattr(0, {size=%u} => {size=%u}, 0) = %s\n", + SCHED_ATTR_MIN_SIZE - 1, attr->size, errstr); + + attr->size = 0x90807060; + attr->sched_policy = 0xca7faced; + attr->sched_flags = 0xbadc0ded1057da78ULL; + attr->sched_nice = 0xafbfcfdf; + attr->sched_priority = 0xb8c8d8e8; + attr->sched_runtime = 0xbadcaffedeadf157ULL; + attr->sched_deadline = 0xc0de70a57badac75ULL; + attr->sched_period = 0xded1ca7edda7aca7ULL; + + sys_sched_setattr(bogus_pid, (unsigned long) attr, bogus_flags); + printf("sched_setattr(%d, {size=%u, sched_policy=%#x /* SCHED_??? */, " + "sched_flags=%#" PRIx64 " /* SCHED_FLAG_??? */, " + "sched_nice=%d, sched_priority=%u, sched_runtime=%" PRIu64 ", " + "sched_deadline=%" PRIu64 ", sched_period=%" PRIu64 ", ...}, %u)" + " = %s\n", + (int) bogus_pid, + attr->size, + attr->sched_policy, + attr->sched_flags, + attr->sched_nice, + attr->sched_priority, + attr->sched_runtime, + attr->sched_deadline, + attr->sched_period, + (unsigned) bogus_flags, errstr); + + if (F8ILL_KULONG_SUPPORTED) { + const kernel_ulong_t ill = f8ill_ptr_to_kulong(attr); + + sys_sched_getattr(0, ill, sizeof(*attr), 0); + printf("sched_getattr(0, %#llx, %u, 0) = %s\n", + (unsigned long long) ill, (unsigned) sizeof(*attr), + errstr); + + sys_sched_setattr(0, ill, 0); + printf("sched_setattr(0, %#llx, 0) = %s\n", + (unsigned long long) ill, errstr); + } + + + attr->size = 0x90807060; + attr->sched_policy = 0xca7faced; + attr->sched_flags = 0xfULL; + attr->sched_nice = 0xafbfcfdf; + attr->sched_priority = 0xb8c8d8e8; + attr->sched_runtime = 0xbadcaffedeadf157ULL; + attr->sched_deadline = 0xc0de70a57badac75ULL; + attr->sched_period = 0xded1ca7edda7aca7ULL; + + sys_sched_setattr(bogus_pid, (unsigned long) attr, bogus_flags); + printf("sched_setattr(%d, {size=%u, sched_policy=%#x /* SCHED_??? */, " + "sched_flags=SCHED_FLAG_RESET_ON_FORK|SCHED_FLAG_RECLAIM|" + "SCHED_FLAG_DL_OVERRUN|0x8, " + "sched_nice=%d, sched_priority=%u, sched_runtime=%" PRIu64 ", " + "sched_deadline=%" PRIu64 ", sched_period=%" PRIu64 ", ...}, %u)" + " = %s\n", + (int) bogus_pid, + attr->size, + attr->sched_policy, + attr->sched_nice, + attr->sched_priority, + attr->sched_runtime, + attr->sched_deadline, + attr->sched_period, + (unsigned) bogus_flags, errstr); + + if (F8ILL_KULONG_SUPPORTED) { + const kernel_ulong_t ill = f8ill_ptr_to_kulong(attr); + + sys_sched_getattr(0, ill, sizeof(*attr), 0); + printf("sched_getattr(0, %#llx, %u, 0) = %s\n", + (unsigned long long) ill, (unsigned) sizeof(*attr), + errstr); + + sys_sched_setattr(0, ill, 0); + printf("sched_setattr(0, %#llx, 0) = %s\n", + (unsigned long long) ill, errstr); + } + puts("+++ exited with 0 +++"); return 0; } diff --git a/tests-m32/sched_xetattr.gen.test b/tests-m32/sched_xetattr.gen.test new file mode 100755 index 00000000..e4f31c52 --- /dev/null +++ b/tests-m32/sched_xetattr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched_xetattr -a29 -e trace=sched_getattr,sched_setattr); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a29 -e trace=sched_getattr,sched_setattr diff --git a/tests-m32/sched_xetattr.test b/tests-m32/sched_xetattr.test deleted file mode 100755 index c2c7914c..00000000 --- a/tests-m32/sched_xetattr.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check sched_getattr and sched_setattr syscalls decoding. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -e sched_getattr,sched_setattr $args > "$OUT" -match_grep "$LOG" "$OUT" -rm -f "$OUT" - -exit 0 diff --git a/tests-m32/sched_xetparam.c b/tests-m32/sched_xetparam.c index e761a9d0..e1325a6f 100644 --- a/tests-m32/sched_xetparam.c +++ b/tests-m32/sched_xetparam.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/sched_xetparam.gen.test b/tests-m32/sched_xetparam.gen.test new file mode 100755 index 00000000..220ffb26 --- /dev/null +++ b/tests-m32/sched_xetparam.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched_xetparam -a23 -e trace=sched_getparam,sched_setparam); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 -e trace=sched_getparam,sched_setparam diff --git a/tests-m32/sched_xetparam.test b/tests-m32/sched_xetparam.test deleted file mode 100755 index c9fede13..00000000 --- a/tests-m32/sched_xetparam.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sched_getparam and sched_setparam syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a23 -e trace=sched_getparam,sched_setparam diff --git a/tests-m32/sched_xetscheduler.c b/tests-m32/sched_xetscheduler.c index 7faee8cd..bc48085a 100644 --- a/tests-m32/sched_xetscheduler.c +++ b/tests-m32/sched_xetscheduler.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -10,7 +17,7 @@ int main(void) { - struct sched_param *const param = tail_alloc(sizeof(struct sched_param)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sched_param, param); long rc = syscall(__NR_sched_getscheduler, 0); const char *scheduler; switch (rc) { diff --git a/tests-m32/sched_xetscheduler.gen.test b/tests-m32/sched_xetscheduler.gen.test new file mode 100755 index 00000000..0a800725 --- /dev/null +++ b/tests-m32/sched_xetscheduler.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched_xetscheduler -a22 -e trace=sched_getscheduler,sched_setscheduler); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -e trace=sched_getscheduler,sched_setscheduler diff --git a/tests-m32/sched_xetscheduler.test b/tests-m32/sched_xetscheduler.test deleted file mode 100755 index 07c93f31..00000000 --- a/tests-m32/sched_xetscheduler.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sched_getscheduler and sched_setscheduler syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a22 -e trace=sched_getscheduler,sched_setscheduler diff --git a/tests-m32/sched_yield.c b/tests-m32/sched_yield.c index 355e7e8d..40b55617 100644 --- a/tests-m32/sched_yield.c +++ b/tests-m32/sched_yield.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/sched_yield.gen.test b/tests-m32/sched_yield.gen.test new file mode 100755 index 00000000..4b035fd8 --- /dev/null +++ b/tests-m32/sched_yield.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched_yield -a14 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests-m32/sched_yield.test b/tests-m32/sched_yield.test deleted file mode 100755 index f0c2c303..00000000 --- a/tests-m32/sched_yield.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sched_yield syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a14 diff --git a/tests-m32/scm_rights-fd.test b/tests-m32/scm_rights-fd.test index 8447375f..b053aa82 100755 --- a/tests-m32/scm_rights-fd.test +++ b/tests-m32/scm_rights-fd.test @@ -3,29 +3,10 @@ # Check how SCM_RIGHTS and SCM_CREDENTIALS control messages are decoded in -y mode. # # Copyright (c) 2014-2015 Dmitry V. Levin +# Copyright (c) 2014-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -34,22 +15,19 @@ framework_skip_ '/proc/self/fd/ is not available' check_prog mkdir -check_prog rm check_prog seq check_prog touch -dir="$LOG.dir" -rm -rf -- "$dir" -mkdir -- "$dir" || +mkdir dir || framework_skip_ 'failed to create a directory' -file="$dir/$(for i in $(seq 1 127); do echo A; done; echo Z)" +file="dir/$(for i in $(seq 1 127); do echo A; done; echo Z)" touch -- "$file" || framework_skip_ 'failed to create a file' -run_prog ./scm_rights /dev/zero -run_strace -y -x -enetwork $args "$file" +run_prog ../scm_rights /dev/zero +run_strace -y -x -e%network $args "$file" hex='[[:xdigit:]]' n='[1-9][0-9]*' @@ -66,15 +44,9 @@ msg_tail=', msg_controllen='"$n"', msg_flags=0' rights='\{cmsg_len='"$n"', cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, cmsg_data='"$rights_data"'\}' creds='\{cmsg_len='"$n"', cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS, cmsg_data='"$ids"'\}' -EXPECTED="$LOG.expected" - -cat > "$EXPECTED" << __EOF__ +cat > "$EXP" << __EOF__ sendmsg\\(3$socket, $msg_head\\[$rights\\]$msg_tail\\}, 0\\) = 15 recvmsg\\(0$socket, $msg_head\\[$creds, $rights\\]$msg_tail\\}, 0\\) = 15 __EOF__ -match_grep "$LOG" "$EXPECTED" -rm -f "$EXPECTED" -rm -rf -- "$dir" - -exit 0 +match_grep "$LOG" "$EXP" diff --git a/tests-m32/scm_rights.c b/tests-m32/scm_rights.c index 42caed7c..f1171064 100644 --- a/tests-m32/scm_rights.c +++ b/tests-m32/scm_rights.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -44,11 +25,11 @@ int main(int ac, const char **av) void *data = tail_alloc(data_size); memcpy(data, sample, data_size); - struct iovec *iov = tail_alloc(sizeof(struct iovec)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct iovec, iov); iov->iov_base = data; iov->iov_len = data_size; - struct msghdr *mh = tail_alloc(sizeof(struct msghdr)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct msghdr, mh); memset(mh, 0, sizeof(*mh)); mh->msg_iov = iov; mh->msg_iovlen = 1; diff --git a/tests-m32/scno_tampering.sh b/tests-m32/scno_tampering.sh index 6aa78432..8c921dfe 100755 --- a/tests-m32/scno_tampering.sh +++ b/tests-m32/scno_tampering.sh @@ -3,29 +3,10 @@ # Skip the test if arch+kernel combination is not supported. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -49,10 +30,17 @@ case "$STRACE_ARCH" in require_min_kernel_version_or_skip 4.5 ;; mips) # Only the native ABI is supported by the kernel properly, see - # https://sourceforge.net/p/strace/mailman/message/35587571/ + # https://lists.strace.io/pipermail/strace-devel/2017-January/005896.html + msg_prefix="mips $MIPS_ABI scno tampering does not work" uname_m="$(uname -m)" case "$MIPS_ABI:$uname_m" in - o32:mips|n64:mips64) ;; - *) skip_ "$MIPS_ABI scno tampering does not work on $uname_m yet" ;; + n64:mips64) ;; + o32:mips) + # is it really mips32? + if ../is_linux_mips_n64; then + skip_ "$msg_prefix on mips n64 yet" + fi + ;; + *) skip_ "$msg_prefix on $uname_m yet" ;; esac ;; esac diff --git a/tests-m32/seccomp-filter-v.c b/tests-m32/seccomp-filter-v.c index dbf686d1..98eaeee5 100644 --- a/tests-m32/seccomp-filter-v.c +++ b/tests-m32/seccomp-filter-v.c @@ -2,29 +2,10 @@ * Check verbose decoding of seccomp SECCOMP_SET_MODE_FILTER. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -41,9 +22,7 @@ #ifdef HAVE_LINUX_SECCOMP_H # include #endif -#ifdef HAVE_LINUX_FILTER_H -# include -#endif +#include #if defined __NR_seccomp \ && defined PR_SET_NO_NEW_PRIVS \ @@ -52,23 +31,23 @@ && defined BPF_JUMP \ && defined BPF_STMT -#define SOCK_FILTER_ALLOW_SYSCALL(nr) \ +# define SOCK_FILTER_ALLOW_SYSCALL(nr) \ BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW) -#define SOCK_FILTER_DENY_SYSCALL(nr, err) \ +# define SOCK_FILTER_DENY_SYSCALL(nr, err) \ BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|(SECCOMP_RET_DATA & (err))) -#define SOCK_FILTER_KILL_PROCESS \ +# define SOCK_FILTER_KILL_PROCESS \ BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL) -#define PRINT_ALLOW_SYSCALL(nr) \ +# define PRINT_ALLOW_SYSCALL(nr) \ tprintf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW), ", \ __NR_ ## nr) -#define PRINT_DENY_SYSCALL(nr, err) \ +# define PRINT_DENY_SYSCALL(nr, err) \ tprintf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|%#x), ", \ __NR_ ## nr, err) @@ -90,22 +69,18 @@ static const struct sock_filter filter_c[] = { SOCK_FILTER_KILL_PROCESS }; -#ifndef BPF_MAXINSNS -# define BPF_MAXINSNS 4096 -#endif - int main(void) { tprintf("%s", ""); static const char kill_stmt_txt[] = - "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL)"; + "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL_THREAD)"; struct sock_filter *const filter = tail_memdup(filter_c, sizeof(filter_c)); struct sock_filter *const big_filter = tail_alloc(sizeof(*big_filter) * (BPF_MAXINSNS + 1)); - struct sock_fprog *const prog = tail_alloc(sizeof(*prog)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sock_fprog, prog); int fds[2]; if (pipe(fds)) @@ -123,7 +98,7 @@ main(void) prog->len = 3; syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, 0, prog); tprintf("seccomp(SECCOMP_SET_MODE_FILTER, 0, {len=%u" - ", filter=[%s, %p]}) = -1 EFAULT (%m)\n", + ", filter=[%s, ... /* %p */]}) = -1 EFAULT (%m)\n", prog->len, kill_stmt_txt, filter + ARRAY_SIZE(filter_c)); prog->len = 0; @@ -141,11 +116,14 @@ main(void) prog->filter = big_filter; prog->len = BPF_MAXINSNS + 1; tprintf("seccomp(SECCOMP_SET_MODE_FILTER, %s, {len=%u, filter=[", - "SECCOMP_FILTER_FLAG_TSYNC|0xfffffffe", prog->len); + "SECCOMP_FILTER_FLAG_TSYNC|SECCOMP_FILTER_FLAG_LOG|" + "SECCOMP_FILTER_FLAG_SPEC_ALLOW|" + "SECCOMP_FILTER_FLAG_NEW_LISTENER|0xfffffff0", + prog->len); for (i = 0; i < BPF_MAXINSNS; ++i) { if (i) tprintf(", "); - switch(BPF_CLASS(i)) { + switch (BPF_CLASS(i)) { case BPF_LD: tprintf("BPF_STMT(BPF_LD|BPF_W|BPF_IMM, %#x)", i << 16); break; diff --git a/tests-m32/seccomp-filter-v.gen.test b/tests-m32/seccomp-filter-v.gen.test new file mode 100755 index 00000000..efce6372 --- /dev/null +++ b/tests-m32/seccomp-filter-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (seccomp-filter-v -v -e trace=seccomp); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=seccomp diff --git a/tests-m32/seccomp-filter-v.test b/tests-m32/seccomp-filter-v.test deleted file mode 100755 index f873eb6f..00000000 --- a/tests-m32/seccomp-filter-v.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check verbose decoding of seccomp SECCOMP_SET_MODE_FILTER. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -e trace=seccomp diff --git a/tests-m32/seccomp-filter.c b/tests-m32/seccomp-filter.c index d4d76dd3..5e28ffca 100644 --- a/tests-m32/seccomp-filter.c +++ b/tests-m32/seccomp-filter.c @@ -2,29 +2,10 @@ * Check decoding of seccomp SECCOMP_SET_MODE_FILTER. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,9 +17,7 @@ #ifdef HAVE_LINUX_SECCOMP_H # include #endif -#ifdef HAVE_LINUX_FILTER_H -# include -#endif +#include #if defined __NR_seccomp && defined SECCOMP_SET_MODE_FILTER @@ -49,19 +28,22 @@ main(void) { struct sock_filter *const filter = tail_alloc(sizeof(*filter) * N); const void *const efault = tail_alloc(1); - struct sock_fprog *const prog = tail_alloc(sizeof(*prog)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sock_fprog, prog); long rc; prog->filter = filter; prog->len = N; rc = syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, -1, prog); printf("seccomp(SECCOMP_SET_MODE_FILTER, %s, {len=%u, filter=%p})" - " = %ld %s (%m)\n", "SECCOMP_FILTER_FLAG_TSYNC|0xfffffffe", + " = %ld %s (%m)\n", + "SECCOMP_FILTER_FLAG_TSYNC|SECCOMP_FILTER_FLAG_LOG|" + "SECCOMP_FILTER_FLAG_SPEC_ALLOW|" + "SECCOMP_FILTER_FLAG_NEW_LISTENER|0xfffffff0", prog->len, prog->filter, rc, errno2name()); - rc = syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, -2L, efault); + rc = syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, -16L, efault); printf("seccomp(SECCOMP_SET_MODE_FILTER, %s, %p) = %ld %s (%m)\n", - "0xfffffffe /* SECCOMP_FILTER_FLAG_??? */", + "0xfffffff0 /* SECCOMP_FILTER_FLAG_??? */", efault, rc, errno2name()); puts("+++ exited with 0 +++"); diff --git a/tests-m32/seccomp-filter.gen.test b/tests-m32/seccomp-filter.gen.test new file mode 100755 index 00000000..52af0d54 --- /dev/null +++ b/tests-m32/seccomp-filter.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (seccomp-filter -e trace=seccomp); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=seccomp diff --git a/tests-m32/seccomp-filter.test b/tests-m32/seccomp-filter.test deleted file mode 100755 index 65c6d495..00000000 --- a/tests-m32/seccomp-filter.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of seccomp SECCOMP_SET_MODE_FILTER. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=seccomp diff --git a/tests-m32/seccomp-strict.c b/tests-m32/seccomp-strict.c index 237b0eca..1d088109 100644 --- a/tests-m32/seccomp-strict.c +++ b/tests-m32/seccomp-strict.c @@ -1,30 +1,10 @@ /* * Check how seccomp SECCOMP_SET_MODE_STRICT is decoded. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/seccomp-strict.test b/tests-m32/seccomp-strict.test index b354c6a2..3525e20c 100755 --- a/tests-m32/seccomp-strict.test +++ b/tests-m32/seccomp-strict.test @@ -1,10 +1,15 @@ #!/bin/sh - +# # Check how seccomp SECCOMP_SET_MODE_STRICT is decoded. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -set -- "./$NAME" +set -- "../$NAME" "$@" > /dev/null || { case $? in 77) skip_ "$* exited with code 77" ;; @@ -14,4 +19,3 @@ set -- "./$NAME" } run_strace -eseccomp "$@" > "$EXP" match_diff "$LOG" "$EXP" -rm -f "$EXP" diff --git a/tests-m32/seccomp_get_action_avail.c b/tests-m32/seccomp_get_action_avail.c new file mode 100644 index 00000000..e61678f4 --- /dev/null +++ b/tests-m32/seccomp_get_action_avail.c @@ -0,0 +1,108 @@ +/* + * Check decoding of seccomp SECCOMP_GET_ACTION_AVAIL. + * + * Copyright (c) 2017-2019 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_seccomp + +# include +# include +# include + +# ifdef HAVE_LINUX_SECCOMP_H +# include +# endif + +# ifndef SECCOMP_GET_ACTION_AVAIL +# define SECCOMP_GET_ACTION_AVAIL 2 +# endif + +static const char *errstr; + +static long +k_seccomp(const kernel_ulong_t op, const kernel_ulong_t flags, + const kernel_ulong_t args) +{ + const long rc = syscall(__NR_seccomp, op, flags, args); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(uint32_t, act); + kernel_ulong_t op = (kernel_ulong_t) 0xfacefeed00000000ULL + | SECCOMP_GET_ACTION_AVAIL; + kernel_ulong_t flags = (kernel_ulong_t) 0xdeadbeef00000000ULL; + unsigned int i; + + struct { + uint32_t val; + const char *str; + } actions [] = { + { 0, "SECCOMP_RET_KILL_THREAD" }, +# ifdef SECCOMP_RET_KILL_PROCESS + { ARG_STR(SECCOMP_RET_KILL_PROCESS) }, +# endif +# ifdef SECCOMP_RET_TRAP + { ARG_STR(SECCOMP_RET_TRAP) }, +# endif +# ifdef SECCOMP_RET_ERRNO + { ARG_STR(SECCOMP_RET_ERRNO) }, +# endif +# ifdef SECCOMP_RET_USER_NOTIF + { ARG_STR(SECCOMP_RET_USER_NOTIF) }, +# endif +# ifdef SECCOMP_RET_TRACE + { ARG_STR(SECCOMP_RET_TRACE) }, +# endif +# ifdef SECCOMP_RET_LOG + { ARG_STR(SECCOMP_RET_LOG) }, +# endif +# ifdef SECCOMP_RET_ALLOW + { ARG_STR(SECCOMP_RET_ALLOW) }, +# endif + { 0xffffffff, "0xffffffff /* SECCOMP_RET_??? */" } + }; + + for (i = 0; i < ARRAY_SIZE(actions); ++i) { + *act = actions[i].val; + k_seccomp(op, flags, (uintptr_t) act); + printf("seccomp(SECCOMP_GET_ACTION_AVAIL, 0, [%s]) = %s\n", + actions[i].str, errstr); + } + + *act = actions[0].val; + + k_seccomp(op, flags, (uintptr_t) (act + 1)); + printf("seccomp(SECCOMP_GET_ACTION_AVAIL, 0, %p) = %s\n", + act + 1, errstr); + + if (F8ILL_KULONG_SUPPORTED) { + k_seccomp(op, flags, f8ill_ptr_to_kulong(act)); + printf("seccomp(SECCOMP_GET_ACTION_AVAIL, 0, %#jx) = %s\n", + (uintmax_t) f8ill_ptr_to_kulong(act), errstr); + } + + flags |= 0xcafef00d; + k_seccomp(op, flags, 0); + printf("seccomp(SECCOMP_GET_ACTION_AVAIL, %u, NULL) = %s\n", + (unsigned int) flags, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_seccomp") + +#endif diff --git a/tests-m32/seccomp_get_action_avail.gen.test b/tests-m32/seccomp_get_action_avail.gen.test new file mode 100755 index 00000000..49974510 --- /dev/null +++ b/tests-m32/seccomp_get_action_avail.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (seccomp_get_action_avail -e trace=seccomp); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=seccomp diff --git a/tests-m32/select-P.c b/tests-m32/select-P.c new file mode 100644 index 00000000..868deed6 --- /dev/null +++ b/tests-m32/select-P.c @@ -0,0 +1,2 @@ +#define PATH_TRACING_FD 9 +#include "select.c" diff --git a/tests-m32/select-P.gen.test b/tests-m32/select-P.gen.test new file mode 100755 index 00000000..2f6fc7bc --- /dev/null +++ b/tests-m32/select-P.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (select-P -a36 -e trace=select -P /dev/full 9>>/dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 -e trace=select -P /dev/full 9>>/dev/full diff --git a/tests-m32/select.c b/tests-m32/select.c index b5ff259d..7935032b 100644 --- a/tests-m32/select.c +++ b/tests-m32/select.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/select.gen.test b/tests-m32/select.gen.test new file mode 100755 index 00000000..23836149 --- /dev/null +++ b/tests-m32/select.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (select -a36 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests-m32/select.test b/tests-m32/select.test deleted file mode 100755 index 60b88caf..00000000 --- a/tests-m32/select.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check select syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a36 diff --git a/tests-m32/semop.c b/tests-m32/semop.c index a2ff2635..f7f04701 100644 --- a/tests-m32/semop.c +++ b/tests-m32/semop.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include @@ -9,8 +16,7 @@ #include "xlat.h" #include "xlat/semop_flags.h" -union semun -{ +union semun { int val; struct semid_ds *buf; unsigned short *array; @@ -33,9 +39,7 @@ main(void) static void * const bogus_sops = (void *) -1L; static const size_t bogus_nsops = (size_t) 0xdefaceddeadbeefULL; - static const struct timespec ts_data = { 1, 123456789 }; - - struct timespec *ts = tail_memdup(&ts_data, sizeof(*ts)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, ts); int rc; id = semget(IPC_PRIVATE, 1, 0600); @@ -47,8 +51,8 @@ main(void) if (semctl(id, 0, SETVAL, sem_union) == -1) perror_msg_and_skip("semctl"); - struct sembuf *const sem_b = tail_alloc(sizeof(*sem_b)); - struct sembuf *const sem_b2 = tail_alloc(sizeof(*sem_b2)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sembuf, sem_b); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sembuf, sem_b2); rc = semop(bogus_semid, NULL, bogus_nsops); printf("semop(%d, NULL, %u) = %s\n", @@ -67,11 +71,11 @@ main(void) sem_b2->sem_flg = 0xbeef; rc = semop(bogus_semid, sem_b2, 2); - printf("semop(%d, [{%hu, %hd, %s%s%#hx}, %p], %u) = %s\n", + printf("semop(%d, [{%hu, %hd, %s%s%#hx}, ... /* %p */], %u) = %s\n", bogus_semid, sem_b2->sem_num, sem_b2->sem_op, sem_b2->sem_flg & SEM_UNDO ? "SEM_UNDO|" : "", sem_b2->sem_flg & IPC_NOWAIT ? "IPC_NOWAIT|" : "", - sem_b2->sem_flg & ~(SEM_UNDO | IPC_NOWAIT), + (short) (sem_b2->sem_flg & ~(SEM_UNDO | IPC_NOWAIT)), sem_b2 + 1, 2, sprintrc(rc)); if (semop(id, sem_b, 1)) @@ -91,15 +95,17 @@ main(void) printf("semtimedop(%d, %p, 1, %p) = %s\n", id, sem_b + 1, ts + 1, sprintrc(rc)); + ts->tv_sec = 1; + ts->tv_nsec = 123456789; rc = semtimedop(bogus_semid, sem_b2, 2, ts); - printf("semtimedop(%d, [{%hu, %hd, %s%s%#hx}, %p], %u, " - "{tv_sec=%jd, tv_nsec=%jd}) = %s\n", + printf("semtimedop(%d, [{%hu, %hd, %s%s%#hx}, ... /* %p */], %u" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", bogus_semid, sem_b2->sem_num, sem_b2->sem_op, sem_b2->sem_flg & SEM_UNDO ? "SEM_UNDO|" : "", sem_b2->sem_flg & IPC_NOWAIT ? "IPC_NOWAIT|" : "", - sem_b2->sem_flg & ~(SEM_UNDO | IPC_NOWAIT), + (short) (sem_b2->sem_flg & ~(SEM_UNDO | IPC_NOWAIT)), sem_b2 + 1, 2, - (intmax_t) ts->tv_sec, (intmax_t) ts->tv_nsec, + (long long) ts->tv_sec, zero_extend_signed_to_ull(ts->tv_nsec), sprintrc(rc)); sem_b->sem_op = 1; @@ -110,9 +116,27 @@ main(void) sem_b->sem_op = -1; if (semtimedop(id, sem_b, 1, ts)) perror_msg_and_skip("semtimedop, -1"); - printf("semtimedop(%d, [{0, -1, SEM_UNDO}], 1, " - "{tv_sec=%jd, tv_nsec=%jd}) = 0\n", id, - (intmax_t) ts->tv_sec, (intmax_t) ts->tv_nsec); + printf("semtimedop(%d, [{0, -1, SEM_UNDO}], 1" + ", {tv_sec=%lld, tv_nsec=%llu}) = 0\n", id, + (long long) ts->tv_sec, zero_extend_signed_to_ull(ts->tv_nsec)); + + sem_b->sem_op = 1; + ts->tv_sec = 0xdeadbeefU; + ts->tv_nsec = 0xfacefeedU; + rc = semtimedop(id, sem_b, 1, ts); + printf("semtimedop(%d, [{0, 1, SEM_UNDO}], 1" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + id, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), sprintrc(rc)); + + sem_b->sem_op = -1; + ts->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + ts->tv_nsec = (long) 0xbadc0dedfacefeedLL; + rc = semtimedop(id, sem_b, 1, ts); + printf("semtimedop(%d, [{0, -1, SEM_UNDO}], 1" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + id, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), sprintrc(rc)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/semop.gen.test b/tests-m32/semop.gen.test new file mode 100755 index 00000000..21b67ead --- /dev/null +++ b/tests-m32/semop.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (semop -a32 -e trace=semop,semtimedop); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -e trace=semop,semtimedop diff --git a/tests-m32/semop.test b/tests-m32/semop.test deleted file mode 100755 index 3e77d2f9..00000000 --- a/tests-m32/semop.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check semop syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a32 -e trace=semop,semtimedop diff --git a/tests-m32/sendfile.c b/tests-m32/sendfile.c index 23f096b6..6ef3232e 100644 --- a/tests-m32/sendfile.c +++ b/tests-m32/sendfile.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -35,15 +16,13 @@ # include # include # include +# include # include # include -# include int -main(int ac, const char **av) +main(void) { - assert(ac == 1); - (void) close(0); if (open("/dev/zero", O_RDONLY) != 0) perror_msg_and_skip("open: %s", "/dev/zero"); @@ -52,58 +31,62 @@ main(int ac, const char **av) if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) perror_msg_and_skip("socketpair"); - int reg_in = open(av[0], O_RDONLY); - if (reg_in < 0) - perror_msg_and_fail("open: %s", av[0]); - - struct stat stb; - assert(fstat(reg_in, &stb) == 0); - const size_t blen = stb.st_size / 3; - const size_t alen = stb.st_size - blen; - assert(S_ISREG(stb.st_mode) && blen > 0); - - const size_t page_len = get_page_size(); - assert(syscall(__NR_sendfile, 0, 1, NULL, page_len) == -1); + const unsigned int page_size = get_page_size(); + assert(syscall(__NR_sendfile, 0, 1, NULL, page_size) == -1); if (EBADF != errno) perror_msg_and_skip("sendfile"); - printf("sendfile(0, 1, NULL, %lu) = -1 EBADF (%m)\n", - (unsigned long) page_len); + printf("sendfile(0, 1, NULL, %u) = -1 EBADF (%m)\n", page_size); + + unsigned int file_size = 0; + socklen_t optlen = sizeof(file_size); + if (getsockopt(sv[1], SOL_SOCKET, SO_SNDBUF, &file_size, &optlen)) + perror_msg_and_fail("getsockopt"); + if (file_size < 1024) + error_msg_and_skip("SO_SNDBUF too small: %u", file_size); + + file_size /= 4; + if (file_size / 16 > page_size) + file_size = page_size * 16; + const unsigned int blen = file_size / 3; + const unsigned int alen = file_size - blen; + + static const char fname[] = "sendfile-tmpfile"; + int reg_in = open(fname, O_RDWR | O_CREAT | O_TRUNC, 0600); + if (reg_in < 0) + perror_msg_and_fail("open: %s", fname); + if (unlink(fname)) + perror_msg_and_fail("unlink: %s", fname); + if (ftruncate(reg_in, file_size)) + perror_msg_and_fail("ftruncate: %s", fname); - uint32_t *p_off = tail_alloc(sizeof(uint32_t)); + TAIL_ALLOC_OBJECT_VAR_PTR(uint32_t, p_off); void *p = p_off + 1; *p_off = 0; - assert(syscall(__NR_sendfile, 0, 1, p, page_len) == -1); - printf("sendfile(0, 1, %#lx, %lu) = -1 EFAULT (%m)\n", - (unsigned long) p, (unsigned long) page_len); + assert(syscall(__NR_sendfile, 0, 1, p, page_size) == -1); + printf("sendfile(0, 1, %p, %u) = -1 EFAULT (%m)\n", p, page_size); assert(syscall(__NR_sendfile, sv[1], reg_in, NULL, alen) == (long) alen); - printf("sendfile(%d, %d, NULL, %lu) = %lu\n", - sv[1], reg_in, (unsigned long) alen, - (unsigned long) alen); + printf("sendfile(%d, %d, NULL, %u) = %u\n", + sv[1], reg_in, alen, alen); p = p_off; if (syscall(__NR_sendfile, sv[1], reg_in, p_off, alen) != (long) alen) { - printf("sendfile(%d, %d, %#lx, %lu) = -1 EFAULT (%m)\n", - sv[1], reg_in, (unsigned long) p_off, - (unsigned long) alen); + printf("sendfile(%d, %d, %#lx, %u) = -1 EFAULT (%m)\n", + sv[1], reg_in, (unsigned long) p_off, alen); --p_off; *p_off = 0; assert(syscall(__NR_sendfile, sv[1], reg_in, p_off, alen) == (long) alen); } - printf("sendfile(%d, %d, [0] => [%lu], %lu) = %lu\n", - sv[1], reg_in, (unsigned long) alen, - (unsigned long) alen, (unsigned long) alen); + printf("sendfile(%d, %d, [0] => [%u], %u) = %u\n", + sv[1], reg_in, alen, alen, alen); - assert(syscall(__NR_sendfile, sv[1], reg_in, p_off, stb.st_size + 1) + assert(syscall(__NR_sendfile, sv[1], reg_in, p_off, file_size + 1) == (long) blen); - printf("sendfile(%d, %d, [%lu] => [%lu], %lu) = %lu\n", - sv[1], reg_in, (unsigned long) alen, - (unsigned long) stb.st_size, - (unsigned long) stb.st_size + 1, - (unsigned long) blen); + printf("sendfile(%d, %d, [%u] => [%u], %u) = %u\n", + sv[1], reg_in, alen, file_size, file_size + 1, blen); if (p_off != p) { uint64_t *p_off64 = (uint64_t *) p_off; diff --git a/tests-m32/sendfile.gen.test b/tests-m32/sendfile.gen.test new file mode 100755 index 00000000..d32ef3ad --- /dev/null +++ b/tests-m32/sendfile.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sendfile -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-m32/sendfile.test b/tests-m32/sendfile.test deleted file mode 100755 index 48dba585..00000000 --- a/tests-m32/sendfile.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sendfile syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests-m32/sendfile64.c b/tests-m32/sendfile64.c index 7208c300..c318ace8 100644 --- a/tests-m32/sendfile64.c +++ b/tests-m32/sendfile64.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -35,15 +16,13 @@ # include # include # include +# include # include # include -# include int -main(int ac, const char **av) +main(void) { - assert(ac == 1); - (void) close(0); if (open("/dev/zero", O_RDONLY) != 0) perror_msg_and_skip("open: %s", "/dev/zero"); @@ -52,50 +31,55 @@ main(int ac, const char **av) if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) perror_msg_and_skip("socketpair"); - int reg_in = open(av[0], O_RDONLY); - if (reg_in < 0) - perror_msg_and_fail("open: %s", av[0]); - - struct stat stb; - assert(fstat(reg_in, &stb) == 0); - const size_t blen = stb.st_size / 3; - const size_t alen = stb.st_size - blen; - assert(S_ISREG(stb.st_mode) && blen > 0); - - const size_t page_len = get_page_size(); - assert(syscall(__NR_sendfile64, 0, 1, NULL, page_len) == -1); + const unsigned int page_size = get_page_size(); + assert(syscall(__NR_sendfile64, 0, 1, NULL, page_size) == -1); if (EBADF != errno) perror_msg_and_skip("sendfile64"); - printf("sendfile64(0, 1, NULL, %lu) = -1 EBADF (%m)\n", - (unsigned long) page_len); + printf("sendfile64(0, 1, NULL, %u) = -1 EBADF (%m)\n", page_size); + + unsigned int file_size = 0; + socklen_t optlen = sizeof(file_size); + if (getsockopt(sv[1], SOL_SOCKET, SO_SNDBUF, &file_size, &optlen)) + perror_msg_and_fail("getsockopt"); + if (file_size < 1024) + error_msg_and_skip("SO_SNDBUF too small: %u", file_size); + + file_size /= 4; + if (file_size / 16 > page_size) + file_size = page_size * 16; + const unsigned int blen = file_size / 3; + const unsigned int alen = file_size - blen; + + static const char fname[] = "sendfile64-tmpfile"; + int reg_in = open(fname, O_RDWR | O_CREAT | O_TRUNC, 0600); + if (reg_in < 0) + perror_msg_and_fail("open: %s", fname); + if (unlink(fname)) + perror_msg_and_fail("unlink: %s", fname); + if (ftruncate(reg_in, file_size)) + perror_msg_and_fail("ftruncate: %s", fname); - uint64_t *p_off = tail_alloc(sizeof(uint64_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(uint64_t, p_off); void *p = p_off + 1; *p_off = 0; - assert(syscall(__NR_sendfile64, 0, 1, p, page_len) == -1); - printf("sendfile64(0, 1, %#lx, %lu) = -1 EFAULT (%m)\n", - (unsigned long) p, (unsigned long) page_len); + assert(syscall(__NR_sendfile64, 0, 1, p, page_size) == -1); + printf("sendfile64(0, 1, %p, %u) = -1 EFAULT (%m)\n", p, page_size); assert(syscall(__NR_sendfile64, sv[1], reg_in, NULL, alen) == (long) alen); - printf("sendfile64(%d, %d, NULL, %lu) = %lu\n", - sv[1], reg_in, (unsigned long) alen, - (unsigned long) alen); + printf("sendfile64(%d, %d, NULL, %u) = %u\n", + sv[1], reg_in, alen, alen); assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, alen) == (long) alen); - printf("sendfile64(%d, %d, [0] => [%lu], %lu) = %lu\n", - sv[1], reg_in, (unsigned long) alen, - (unsigned long) alen, (unsigned long) alen); + printf("sendfile64(%d, %d, [0] => [%u], %u) = %u\n", + sv[1], reg_in, alen, alen, alen); - assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, stb.st_size + 1) + assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, file_size + 1) == (long) blen); - printf("sendfile64(%d, %d, [%lu] => [%lu], %lu) = %lu\n", - sv[1], reg_in, (unsigned long) alen, - (unsigned long) stb.st_size, - (unsigned long) stb.st_size + 1, - (unsigned long) blen); + printf("sendfile64(%d, %d, [%u] => [%u], %u) = %u\n", + sv[1], reg_in, alen, file_size, file_size + 1, blen); *p_off = 0xcafef00dfacefeedULL; assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, 1) == -1); diff --git a/tests-m32/sendfile64.gen.test b/tests-m32/sendfile64.gen.test new file mode 100755 index 00000000..24f0746f --- /dev/null +++ b/tests-m32/sendfile64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sendfile64 -a29 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a29 diff --git a/tests-m32/sendfile64.test b/tests-m32/sendfile64.test deleted file mode 100755 index faa05254..00000000 --- a/tests-m32/sendfile64.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sendfile64 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a29 diff --git a/tests-m32/set_mempolicy.c b/tests-m32/set_mempolicy.c index f3261a09..46703713 100644 --- a/tests-m32/set_mempolicy.c +++ b/tests-m32/set_mempolicy.c @@ -2,29 +2,10 @@ * Check decoding of set_mempolicy syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -76,7 +57,7 @@ print_nodes(const unsigned long maxnode, unsigned int offset) printf("%#0*lx", (int) sizeof(long) * 2 + 2, nodemask[i]); } else { - printf("%p", nodemask + i); + printf("... /* %p */", nodemask + i); break; } } diff --git a/tests-m32/set_mempolicy.gen.test b/tests-m32/set_mempolicy.gen.test new file mode 100755 index 00000000..f8c81c75 --- /dev/null +++ b/tests-m32/set_mempolicy.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (set_mempolicy -s3 -a35); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 -a35 diff --git a/tests-m32/set_mempolicy.test b/tests-m32/set_mempolicy.test deleted file mode 100755 index 0ed6666c..00000000 --- a/tests-m32/set_mempolicy.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check set_mempolicy syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s3 -a35 diff --git a/tests-m32/set_ptracer_any.c b/tests-m32/set_ptracer_any.c index bc2f90ca..747359c2 100644 --- a/tests-m32/set_ptracer_any.c +++ b/tests-m32/set_ptracer_any.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2013-2015 Dmitry V. Levin + * Copyright (c) 2013-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,10 +17,16 @@ int main(int argc, char **argv) { if (argc < 2) return 99; -#if defined HAVE_PRCTL && defined PR_SET_PTRACER && defined PR_SET_PTRACER_ANY - /* Turn off restrictions on tracing if applicable. If the options +#ifdef HAVE_PRCTL + /* Turn off restrictions on tracing if applicable. If the command * aren't available on this system, that's OK too. */ - (void) prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY); +# ifndef PR_SET_PTRACER +# define PR_SET_PTRACER 0x59616d61 +# endif +# ifndef PR_SET_PTRACER_ANY +# define PR_SET_PTRACER_ANY -1UL +# endif + (void) prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0); #endif if (write(1, "\n", 1) != 1) { perror("write"); diff --git a/tests-m32/set_sigblock.c b/tests-m32/set_sigblock.c new file mode 100644 index 00000000..6ac1bedd --- /dev/null +++ b/tests-m32/set_sigblock.c @@ -0,0 +1,33 @@ +/* + * Execute a command with the specified signal blocked/unblocked. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +int +main(int ac, char **av) +{ + if (ac < 4) + error_msg_and_fail("usage: set_sigblock 0|1 signum path..."); + + const int block = atoi(av[1]); + const int signum = atoi(av[2]); + sigset_t mask; + + sigemptyset(&mask); + if (sigaddset(&mask, signum)) + perror_msg_and_fail("sigaddset: %s", av[2]); + if (sigprocmask(block ? SIG_BLOCK : SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + execvp(av[3], av + 3); + perror_msg_and_fail("execvp: %s", av[3]); +} diff --git a/tests-m32/set_sigign.c b/tests-m32/set_sigign.c new file mode 100644 index 00000000..faf5a741 --- /dev/null +++ b/tests-m32/set_sigign.c @@ -0,0 +1,29 @@ +/* + * Execute a command with a signal handler set to SIG_IGN/SIG_DFL. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +int +main(int ac, char **av) +{ + if (ac < 4) + error_msg_and_fail("usage: set_sigign 0|1 signum path..."); + + const int ign = atoi(av[1]); + const int signum = atoi(av[2]); + + if (signal(signum, ign ? SIG_IGN : SIG_DFL) == SIG_ERR) + perror_msg_and_fail("signal: %s", av[2]); + + execvp(av[3], av + 3); + perror_msg_and_fail("execvp: %s", av[3]); +} diff --git a/tests-m32/setdomainname.c b/tests-m32/setdomainname.c index f3e24840..177c0fd7 100644 --- a/tests-m32/setdomainname.c +++ b/tests-m32/setdomainname.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/setdomainname.gen.test b/tests-m32/setdomainname.gen.test new file mode 100755 index 00000000..1f29563f --- /dev/null +++ b/tests-m32/setdomainname.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setdomainname -a24 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-m32/setdomainname.test b/tests-m32/setdomainname.test deleted file mode 100755 index 2159e7c4..00000000 --- a/tests-m32/setdomainname.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setdomainname syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 diff --git a/tests-m32/setfsgid.c b/tests-m32/setfsgid.c index 871f4b35..496b2679 100644 --- a/tests-m32/setfsgid.c +++ b/tests-m32/setfsgid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/setfsgid.gen.test b/tests-m32/setfsgid.gen.test new file mode 100755 index 00000000..bbb30cc1 --- /dev/null +++ b/tests-m32/setfsgid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setfsgid -a12 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests-m32/setfsgid.test b/tests-m32/setfsgid.test deleted file mode 100755 index 0ae2b0a2..00000000 --- a/tests-m32/setfsgid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setfsgid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a12 diff --git a/tests-m32/setfsgid32.c b/tests-m32/setfsgid32.c index 6279abd3..a931602c 100644 --- a/tests-m32/setfsgid32.c +++ b/tests-m32/setfsgid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/setfsgid32.gen.test b/tests-m32/setfsgid32.gen.test new file mode 100755 index 00000000..63b3eca0 --- /dev/null +++ b/tests-m32/setfsgid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setfsgid32 -a14 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests-m32/setfsgid32.test b/tests-m32/setfsgid32.test deleted file mode 100755 index 9b7a2bf8..00000000 --- a/tests-m32/setfsgid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setfsgid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a14 diff --git a/tests-m32/setfsugid.c b/tests-m32/setfsugid.c index 79ba34d8..0447544a 100644 --- a/tests-m32/setfsugid.c +++ b/tests-m32/setfsugid.c @@ -2,29 +2,10 @@ * Check decoding of setfsuid/setfsgid/setfsuid32/setfsgid32 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -47,7 +28,7 @@ main(void) const kernel_ulong_t tests[] = { ugid, 0xffff0000U | ugid, - (kernel_ulong_t) 0xffffffff00000000ULL | ugid, + F8ILL_KULONG_MASK | ugid, 0xffffU, -1U, -1L, diff --git a/tests-m32/setfsuid.c b/tests-m32/setfsuid.c index d6faf971..269d38f2 100644 --- a/tests-m32/setfsuid.c +++ b/tests-m32/setfsuid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/setfsuid.gen.test b/tests-m32/setfsuid.gen.test new file mode 100755 index 00000000..5896b303 --- /dev/null +++ b/tests-m32/setfsuid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setfsuid -a12 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests-m32/setfsuid.test b/tests-m32/setfsuid.test deleted file mode 100755 index 18a10219..00000000 --- a/tests-m32/setfsuid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setfsuid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a12 diff --git a/tests-m32/setfsuid32.c b/tests-m32/setfsuid32.c index b71cf235..cfcc0f83 100644 --- a/tests-m32/setfsuid32.c +++ b/tests-m32/setfsuid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/setfsuid32.gen.test b/tests-m32/setfsuid32.gen.test new file mode 100755 index 00000000..52d0820f --- /dev/null +++ b/tests-m32/setfsuid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setfsuid32 -a14 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests-m32/setfsuid32.test b/tests-m32/setfsuid32.test deleted file mode 100755 index 2dce3cc9..00000000 --- a/tests-m32/setfsuid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setfsuid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a14 diff --git a/tests-m32/setgid.c b/tests-m32/setgid.c index 8794a0a4..3374924a 100644 --- a/tests-m32/setgid.c +++ b/tests-m32/setgid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/setgid.gen.test b/tests-m32/setgid.gen.test new file mode 100755 index 00000000..be188d1f --- /dev/null +++ b/tests-m32/setgid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setgid -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-m32/setgid.test b/tests-m32/setgid.test deleted file mode 100755 index a3a90041..00000000 --- a/tests-m32/setgid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setgid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 diff --git a/tests-m32/setgid32.c b/tests-m32/setgid32.c index 17f43c58..427c77b0 100644 --- a/tests-m32/setgid32.c +++ b/tests-m32/setgid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/setgid32.gen.test b/tests-m32/setgid32.gen.test new file mode 100755 index 00000000..9020b809 --- /dev/null +++ b/tests-m32/setgid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setgid32 -a12 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests-m32/setgid32.test b/tests-m32/setgid32.test deleted file mode 100755 index 11a87e12..00000000 --- a/tests-m32/setgid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setgid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a12 diff --git a/tests-m32/setgroups.c b/tests-m32/setgroups.c index 1ec8333f..a47f1024 100644 --- a/tests-m32/setgroups.c +++ b/tests-m32/setgroups.c @@ -2,29 +2,10 @@ * Check decoding of setgroups/setgroups32 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifdef __NR_setgroups32 @@ -75,7 +56,7 @@ main(void) long rc = syscall(SYSCALL_NR, 0, 0); printf("%s(0, NULL) = %s\n", SYSCALL_NAME, sprintrc(rc)); - rc = syscall(SYSCALL_NR, (long) 0xffffffff00000000ULL, 0); + rc = syscall(SYSCALL_NR, F8ILL_KULONG_MASK, 0); printf("%s(0, NULL) = %s\n", SYSCALL_NAME, sprintrc(rc)); rc = syscall(SYSCALL_NR, 1, 0); @@ -91,7 +72,7 @@ main(void) printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, -1, sprintrc(rc)); /* check how the second argument is decoded */ - const GID_TYPE *const g1 = tail_alloc(sizeof(*g1)); + TAIL_ALLOC_OBJECT_CONST_PTR(const GID_TYPE, g1); GID_TYPE *const g2 = tail_alloc(sizeof(*g2) * 2); GID_TYPE *const g3 = tail_alloc(sizeof(*g3) * 3); @@ -114,7 +95,7 @@ main(void) errstr = sprintrc(rc); printf("%s(2, [", SYSCALL_NAME); printuid(*g1); - printf(", %p]) = %s\n", g1 + 1, errstr); + printf(", ... /* %p */]) = %s\n", g1 + 1, errstr); g2[0] = -2; g2[1] = -3; @@ -132,7 +113,7 @@ main(void) printuid(g2[0]); printf(", "); printuid(g2[1]); - printf(", %p]) = %s\n", g2 + 2, errstr); + printf(", ... /* %p */]) = %s\n", g2 + 2, errstr); g3[0] = 0; g3[1] = 1; @@ -164,9 +145,7 @@ main(void) printuid(g3[1]); printf(", ...]) = %s\n", errstr); - const unsigned long size = - (unsigned long) 0xffffffff00000000ULL | ngroups_max; - rc = syscall(SYSCALL_NR, size, g3); + rc = syscall(SYSCALL_NR, F8ILL_KULONG_MASK | ngroups_max, g3); errstr = sprintrc(rc); printf("%s(%d, [", SYSCALL_NAME, ngroups_max); printuid(g3[0]); diff --git a/tests-m32/setgroups.gen.test b/tests-m32/setgroups.gen.test new file mode 100755 index 00000000..01ec2e71 --- /dev/null +++ b/tests-m32/setgroups.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setgroups -s2 -a17); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s2 -a17 diff --git a/tests-m32/setgroups.test b/tests-m32/setgroups.test deleted file mode 100755 index 0dcc8f75..00000000 --- a/tests-m32/setgroups.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setgroups syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s2 -a17 diff --git a/tests-m32/setgroups32.c b/tests-m32/setgroups32.c index ecf00bbd..935b73a9 100644 --- a/tests-m32/setgroups32.c +++ b/tests-m32/setgroups32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/setgroups32.gen.test b/tests-m32/setgroups32.gen.test new file mode 100755 index 00000000..e9e70ad3 --- /dev/null +++ b/tests-m32/setgroups32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setgroups32 -s2 -a19); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s2 -a19 diff --git a/tests-m32/setgroups32.test b/tests-m32/setgroups32.test deleted file mode 100755 index ee4750d1..00000000 --- a/tests-m32/setgroups32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setgroups32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s2 -a19 diff --git a/tests-m32/sethostname.c b/tests-m32/sethostname.c index e1b2f069..c9b89c12 100644 --- a/tests-m32/sethostname.c +++ b/tests-m32/sethostname.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Fei Jie * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,13 +17,13 @@ # include # include -#ifdef HAVE_LINUX_UTSNAME_H -# include -#endif +# ifdef HAVE_LINUX_UTSNAME_H +# include +# endif -#ifndef __NEW_UTS_LEN -# define __NEW_UTS_LEN 64 -#endif +# ifndef __NEW_UTS_LEN +# define __NEW_UTS_LEN 64 +# endif int main(void) diff --git a/tests-m32/sethostname.gen.test b/tests-m32/sethostname.gen.test new file mode 100755 index 00000000..d68ed189 --- /dev/null +++ b/tests-m32/sethostname.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sethostname -a22 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests-m32/sethostname.test b/tests-m32/sethostname.test deleted file mode 100755 index 78f8c58e..00000000 --- a/tests-m32/sethostname.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sethostname syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a22 diff --git a/tests-m32/setns.c b/tests-m32/setns.c index 54a15317..8ef7a19b 100644 --- a/tests-m32/setns.c +++ b/tests-m32/setns.c @@ -2,29 +2,10 @@ * Check decoding of setns syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/setns.gen.test b/tests-m32/setns.gen.test new file mode 100755 index 00000000..e25738bf --- /dev/null +++ b/tests-m32/setns.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setns -a21 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests-m32/setns.test b/tests-m32/setns.test deleted file mode 100755 index e9a905ab..00000000 --- a/tests-m32/setns.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of setns syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a21 diff --git a/tests-m32/setregid.c b/tests-m32/setregid.c index e1da7862..68639e6a 100644 --- a/tests-m32/setregid.c +++ b/tests-m32/setregid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/setregid.gen.test b/tests-m32/setregid.gen.test new file mode 100755 index 00000000..f84b1acb --- /dev/null +++ b/tests-m32/setregid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setregid -a15 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests-m32/setregid.test b/tests-m32/setregid.test deleted file mode 100755 index 101c7bdf..00000000 --- a/tests-m32/setregid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setregid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a15 diff --git a/tests-m32/setregid32.c b/tests-m32/setregid32.c index 3cf0daf6..6291bc58 100644 --- a/tests-m32/setregid32.c +++ b/tests-m32/setregid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/setregid32.gen.test b/tests-m32/setregid32.gen.test new file mode 100755 index 00000000..7320c8cf --- /dev/null +++ b/tests-m32/setregid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setregid32 -a17 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-m32/setregid32.test b/tests-m32/setregid32.test deleted file mode 100755 index e57e66c4..00000000 --- a/tests-m32/setregid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setregid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a17 diff --git a/tests-m32/setresgid.c b/tests-m32/setresgid.c index 8701df8e..f3a160e3 100644 --- a/tests-m32/setresgid.c +++ b/tests-m32/setresgid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/setresgid.gen.test b/tests-m32/setresgid.gen.test new file mode 100755 index 00000000..792313c2 --- /dev/null +++ b/tests-m32/setresgid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setresgid -a19 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests-m32/setresgid.test b/tests-m32/setresgid.test deleted file mode 100755 index 5a695742..00000000 --- a/tests-m32/setresgid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setresgid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a19 diff --git a/tests-m32/setresgid32.c b/tests-m32/setresgid32.c index dfce4572..e05ae8f8 100644 --- a/tests-m32/setresgid32.c +++ b/tests-m32/setresgid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/setresgid32.gen.test b/tests-m32/setresgid32.gen.test new file mode 100755 index 00000000..6ecf936b --- /dev/null +++ b/tests-m32/setresgid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setresgid32 -a21 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests-m32/setresgid32.test b/tests-m32/setresgid32.test deleted file mode 100755 index 528b2c9e..00000000 --- a/tests-m32/setresgid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setresgid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a21 diff --git a/tests-m32/setresugid.c b/tests-m32/setresugid.c index 711bd317..07322cd7 100644 --- a/tests-m32/setresugid.c +++ b/tests-m32/setresugid.c @@ -1,30 +1,10 @@ /* * Check decoding of setresuid/setresgid/setresuid32/setresgid32 syscalls. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include diff --git a/tests-m32/setresuid.c b/tests-m32/setresuid.c index 3a9dbd1f..855a9bf7 100644 --- a/tests-m32/setresuid.c +++ b/tests-m32/setresuid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/setresuid.gen.test b/tests-m32/setresuid.gen.test new file mode 100755 index 00000000..a0dcb4ba --- /dev/null +++ b/tests-m32/setresuid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setresuid -a19 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests-m32/setresuid.test b/tests-m32/setresuid.test deleted file mode 100755 index f1219e06..00000000 --- a/tests-m32/setresuid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setresuid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a19 diff --git a/tests-m32/setresuid32.c b/tests-m32/setresuid32.c index 387268a7..ccfc2a51 100644 --- a/tests-m32/setresuid32.c +++ b/tests-m32/setresuid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/setresuid32.gen.test b/tests-m32/setresuid32.gen.test new file mode 100755 index 00000000..a9f43969 --- /dev/null +++ b/tests-m32/setresuid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setresuid32 -a21 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests-m32/setresuid32.test b/tests-m32/setresuid32.test deleted file mode 100755 index 942a3a65..00000000 --- a/tests-m32/setresuid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setresuid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a21 diff --git a/tests-m32/setreugid.c b/tests-m32/setreugid.c index 38c80d57..f195fd51 100644 --- a/tests-m32/setreugid.c +++ b/tests-m32/setreugid.c @@ -1,30 +1,10 @@ /* * Check decoding of setreuid/setregid/setreuid32/setregid32 syscalls. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include diff --git a/tests-m32/setreuid.c b/tests-m32/setreuid.c index 68e75192..1e34dd18 100644 --- a/tests-m32/setreuid.c +++ b/tests-m32/setreuid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/setreuid.gen.test b/tests-m32/setreuid.gen.test new file mode 100755 index 00000000..0ecaef0b --- /dev/null +++ b/tests-m32/setreuid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setreuid -a15 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests-m32/setreuid.test b/tests-m32/setreuid.test deleted file mode 100755 index b6db3c1d..00000000 --- a/tests-m32/setreuid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setreuid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a15 diff --git a/tests-m32/setreuid32.c b/tests-m32/setreuid32.c index ba017621..c0345db7 100644 --- a/tests-m32/setreuid32.c +++ b/tests-m32/setreuid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/setreuid32.gen.test b/tests-m32/setreuid32.gen.test new file mode 100755 index 00000000..3eb0e95a --- /dev/null +++ b/tests-m32/setreuid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setreuid32 -a17 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-m32/setreuid32.test b/tests-m32/setreuid32.test deleted file mode 100755 index 23323d47..00000000 --- a/tests-m32/setreuid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setreuid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a17 diff --git a/tests-m32/setrlimit-Xabbrev.c b/tests-m32/setrlimit-Xabbrev.c new file mode 100644 index 00000000..d5cf2ad3 --- /dev/null +++ b/tests-m32/setrlimit-Xabbrev.c @@ -0,0 +1 @@ +#include "setrlimit.c" diff --git a/tests-m32/setrlimit-Xabbrev.gen.test b/tests-m32/setrlimit-Xabbrev.gen.test new file mode 100755 index 00000000..82d97839 --- /dev/null +++ b/tests-m32/setrlimit-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setrlimit-Xabbrev -a27 -e trace=setrlimit -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 -e trace=setrlimit -Xabbrev diff --git a/tests-m32/setrlimit-Xraw.c b/tests-m32/setrlimit-Xraw.c new file mode 100644 index 00000000..1a5ead0b --- /dev/null +++ b/tests-m32/setrlimit-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "setrlimit.c" diff --git a/tests-m32/setrlimit-Xraw.gen.test b/tests-m32/setrlimit-Xraw.gen.test new file mode 100755 index 00000000..b079d510 --- /dev/null +++ b/tests-m32/setrlimit-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setrlimit-Xraw -a19 -e trace=setrlimit -Xraw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 -e trace=setrlimit -Xraw diff --git a/tests-m32/setrlimit-Xverbose.c b/tests-m32/setrlimit-Xverbose.c new file mode 100644 index 00000000..20cd135f --- /dev/null +++ b/tests-m32/setrlimit-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "setrlimit.c" diff --git a/tests-m32/setrlimit-Xverbose.gen.test b/tests-m32/setrlimit-Xverbose.gen.test new file mode 100755 index 00000000..03dd8b04 --- /dev/null +++ b/tests-m32/setrlimit-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setrlimit-Xverbose -a36 -e trace=setrlimit -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 -e trace=setrlimit -Xverbose diff --git a/tests-m32/setrlimit.c b/tests-m32/setrlimit.c index e93c8e37..099e2402 100644 --- a/tests-m32/setrlimit.c +++ b/tests-m32/setrlimit.c @@ -1,30 +1,11 @@ /* * Check decoding of setrlimit syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -43,7 +24,16 @@ main(void) for (xlat = resources; xlat->str; ++xlat) { unsigned long res = 0xfacefeed00000000ULL | xlat->val; long rc = syscall(__NR_setrlimit, res, 0); +# if XLAT_RAW + printf("setrlimit(%#x, NULL) = %s\n", + (unsigned int) xlat->val, sprintrc(rc)); +# elif XLAT_VERBOSE + printf("setrlimit(%#x /* %s */, NULL) = %s\n", + (unsigned int) xlat->val, + xlat->str, sprintrc(rc)); +# else printf("setrlimit(%s, NULL) = %s\n", xlat->str, sprintrc(rc)); +# endif struct rlimit libc_rlim = {}; if (getrlimit((int) res, &libc_rlim)) @@ -53,10 +43,23 @@ main(void) rc = syscall(__NR_setrlimit, res, rlimit); const char *errstr = sprintrc(rc); +# if XLAT_RAW + printf("setrlimit(%#x, {rlim_cur=%s, rlim_max=%s}) = %s\n", + (unsigned int) xlat->val, + sprint_rlim(rlimit[0]), sprint_rlim(rlimit[1]), + errstr); +# elif XLAT_VERBOSE + printf("setrlimit(%#x /* %s */," + " {rlim_cur=%s, rlim_max=%s}) = %s\n", + (unsigned int) xlat->val, xlat->str, + sprint_rlim(rlimit[0]), sprint_rlim(rlimit[1]), + errstr); +# else printf("setrlimit(%s, {rlim_cur=%s, rlim_max=%s}) = %s\n", xlat->str, sprint_rlim(rlimit[0]), sprint_rlim(rlimit[1]), errstr); +# endif } puts("+++ exited with 0 +++"); diff --git a/tests-m32/setrlimit.gen.test b/tests-m32/setrlimit.gen.test new file mode 100755 index 00000000..0d1508d3 --- /dev/null +++ b/tests-m32/setrlimit.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setrlimit -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-m32/setrlimit.test b/tests-m32/setrlimit.test deleted file mode 100755 index 79206089..00000000 --- a/tests-m32/setrlimit.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of getrlimit/ugetrlimit/setrlimit syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests-m32/setugid.c b/tests-m32/setugid.c index aba277c5..b09cacb4 100644 --- a/tests-m32/setugid.c +++ b/tests-m32/setugid.c @@ -2,29 +2,10 @@ * Check decoding of setuid/setgid/setuid32/setgid32 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -61,6 +42,8 @@ main(void) const unsigned int num = (unsigned UGID_TYPE) tests[i]; long expected; + errno = 0; + if (num == ugid) expected = 0; else if ((UGID_TYPE) num == (UGID_TYPE) -1U) @@ -77,8 +60,9 @@ main(void) SYSCALL_NAME, ugid, errstr); break; } - perror_msg_and_fail("%s(%#lx) != %ld", - SYSCALL_NAME, tests[i], expected); + perror_msg_and_fail("%s(%#lx) = %ld != %ld", + SYSCALL_NAME, tests[i], + rc, expected); } printf("%s(", SYSCALL_NAME); diff --git a/tests-m32/setuid.c b/tests-m32/setuid.c index df2e46b1..4a8243e8 100644 --- a/tests-m32/setuid.c +++ b/tests-m32/setuid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/setuid.gen.test b/tests-m32/setuid.gen.test new file mode 100755 index 00000000..00aeb7a2 --- /dev/null +++ b/tests-m32/setuid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setuid -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-m32/setuid.test b/tests-m32/setuid.test deleted file mode 100755 index 9279233a..00000000 --- a/tests-m32/setuid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setuid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 diff --git a/tests-m32/setuid32.c b/tests-m32/setuid32.c index c837d547..ba1b2e2d 100644 --- a/tests-m32/setuid32.c +++ b/tests-m32/setuid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/setuid32.gen.test b/tests-m32/setuid32.gen.test new file mode 100755 index 00000000..ac8df8f2 --- /dev/null +++ b/tests-m32/setuid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setuid32 -a12 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests-m32/setuid32.test b/tests-m32/setuid32.test deleted file mode 100755 index 7998392a..00000000 --- a/tests-m32/setuid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setuid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a12 diff --git a/tests-m32/shmxt.c b/tests-m32/shmxt.c index 23cc7ccf..3742a484 100644 --- a/tests-m32/shmxt.c +++ b/tests-m32/shmxt.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include @@ -18,6 +25,10 @@ cleanup(void) # define SHMAT "shmat" #endif +#ifndef SHM_EXEC +# define SHM_EXEC 0100000 +#endif + int main(void) { @@ -34,8 +45,8 @@ main(void) atexit(cleanup); rc = (long) shmat(bogus_shmid, bogus_shmaddr, bogus_shmflg); - printf("%s(%d, %p, SHM_REMAP|SHM_RDONLY|SHM_RND|%#x) = %s\n", - SHMAT, bogus_shmid, bogus_shmaddr, bogus_shmflg & ~0x7000, + printf("%s(%d, %p, SHM_RDONLY|SHM_RND|SHM_REMAP|SHM_EXEC|%#x) = %s\n", + SHMAT, bogus_shmid, bogus_shmaddr, bogus_shmflg & ~0xf000, sprintrc(rc)); shmat(id, NULL, SHM_REMAP); @@ -50,18 +61,31 @@ main(void) rc = shmdt(NULL); printf("shmdt(NULL) = %s\n", sprintrc(rc)); - if (shmdt(shmaddr)) - perror_msg_and_skip("shmdt"); - printf("shmdt(%p) = 0\n", shmaddr); + rc = shmdt(shmaddr); + printf("shmdt(%p) = %s\n", shmaddr, sprintrc(rc)); ++shmaddr; void *shmaddr2 = shmat(id, shmaddr, SHM_RND); if (shmaddr2 == (void *)(-1)) printf("%s(%d, %p, SHM_RND) = -1 %s (%m)\n", SHMAT, id, shmaddr, errno2name()); - else + else { printf("%s(%d, %p, SHM_RND) = %p\n", SHMAT, id, shmaddr, shmaddr2); + rc = shmdt(shmaddr2); + printf("shmdt(%p) = %s\n", shmaddr2, sprintrc(rc)); + } + + shmaddr = shmat(id, NULL, SHM_RDONLY|SHM_EXEC); + if (shmaddr == (void *)(-1)) + printf("%s(%d, NULL, SHM_RDONLY|SHM_EXEC) = %s\n", + SHMAT, id, sprintrc(-1)); + else { + printf("%s(%d, NULL, SHM_RDONLY|SHM_EXEC) = %p\n", + SHMAT, id, shmaddr); + rc = shmdt(shmaddr); + printf("shmdt(%p) = %s\n", shmaddr, sprintrc(rc)); + } puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/shmxt.gen.test b/tests-m32/shmxt.gen.test new file mode 100755 index 00000000..dd9d35f0 --- /dev/null +++ b/tests-m32/shmxt.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (shmxt -a11 -e trace='/(osf_)?shmat,shmdt'); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace='/(osf_)?shmat,shmdt' diff --git a/tests-m32/shmxt.test b/tests-m32/shmxt.test deleted file mode 100755 index 3757cfa4..00000000 --- a/tests-m32/shmxt.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check shmat and shmdt syscalls decoding. - -. "${srcdir=.}/init.sh" - -case "$STRACE_ARCH" in - alpha) shmat=osf_shmat ;; - *) shmat=shmat ;; -esac - -run_strace_match_diff -e trace=$shmat,shmdt -a11 diff --git a/tests-m32/shutdown.c b/tests-m32/shutdown.c index d770c43a..5297a0eb 100644 --- a/tests-m32/shutdown.c +++ b/tests-m32/shutdown.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + /* Check decoding of shutdown syscall. */ #include "tests.h" diff --git a/tests-m32/shutdown.gen.test b/tests-m32/shutdown.gen.test new file mode 100755 index 00000000..7fde46ee --- /dev/null +++ b/tests-m32/shutdown.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (shutdown -a24 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-m32/shutdown.test b/tests-m32/shutdown.test deleted file mode 100755 index 22f0d5ab..00000000 --- a/tests-m32/shutdown.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of shutdown syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 diff --git a/tests-m32/sigaction.awk b/tests-m32/sigaction.awk deleted file mode 100644 index 9c3a9ed3..00000000 --- a/tests-m32/sigaction.awk +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/gawk -# -# Copyright (c) 2014-2015 Dmitry V. Levin -# Copyright (c) 2016 Elvira Khabirova -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (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][1] = n2[1][1] = "SIG_IGN" - n1[1][2] = n2[1][2] = "\\[HUP INT\\]" - n1[1][3] = "SA_RESTORER\\|SA_RESTART" - n2[1][3] = "SA_RESTART" - n1[1][4] = ", sa_restorer=0x[0-9a-f]+" - n2[1][4] = "" - - n1[2][1] = n2[2][1] = "0x[0-9a-f]+" - n1[2][2] = n2[2][2] = "\\[QUIT TERM\\]" - n1[2][3] = "SA_RESTORER\\|SA_SIGINFO" - n2[2][3] = "SA_SIGINFO" - n1[2][4] = ", sa_restorer=0x[0-9a-f]+" - n2[2][4] = "" - - n1[3][1] = n2[3][1] = "SIG_DFL" - n1[3][2] = n2[3][2] = "\\[\\]" - n1[3][3] = "SA_RESTORER" - n2[3][3] = "0" - n1[3][4] = ", sa_restorer=0x[0-9a-f]+" - n2[3][4] = "" - - n1[4][1] = n2[4][1] = "SIG_DFL" - n1[4][2] = n2[4][2] = "~\\[HUP( ((RT|SIGRT)[^] ]+|[3-9][0-9]|1[0-9][0-9]))*\\]" - n1[4][3] = "SA_RESTORER" - n2[4][3] = "0" - n1[4][4] = ", sa_restorer=0x[0-9a-f]+" - n2[4][4] = "" - - o1[1][1] = o2[1][1] = "SIG_DFL" - o1[1][2] = o2[1][2] = "\\[\\]" - o1[1][3] = o2[1][3] = "0" - o1[1][4] = o2[1][4] = "" - - for (i = 2; i < 5; i++) { - for (j = 1; j < 5; j++) { - o1[i][j] = n1[i - 1][j] - o2[i][j] = n2[i - 1][j] - } - } - - a1 = "(0x[0-9a-f]+, )?(4|8|16)" - a2 = "(4|8|16)(, 0x[0-9a-f]+)?" - a3 = "0x[0-9a-f]+, (4|8|16)" - - for (i = 1; i < 5; i++) { - r[i] = "^rt_sigaction\\(SIGUSR2, (" \ - "\\{sa_handler=" n1[i][1] ", sa_mask=" n1[i][2] \ - ", sa_flags=" n1[i][3] n1[i][4] "\\}, \\{sa_handler=" \ - o1[i][1] ", sa_mask=" o1[i][2] ", sa_flags=" o1[i][3] \ - o1[i][4] "\\}, " a1 "|" \ - "\\{sa_handler=" n2[i][1] ", sa_mask=" n2[i][2] \ - ", sa_flags=" n2[i][3] n2[i][4] "\\}, \\{sa_handler=" \ - o2[i][1] ", sa_mask=" o2[i][2] ", sa_flags=" o2[i][3] \ - o2[i][4] "\\}, " a2 "|" \ - "\\{sa_handler=" n2[i][1] ", sa_mask=" n2[i][2] \ - ", sa_flags=" n2[i][3] n2[i][4] "\\}, \\{sa_handler=" \ - o2[i][1] ", sa_mask=" o2[i][2] ", sa_flags=" o2[i][3] \ - o2[i][4] "\\}, " a3 ")\\) = 0$" - } - s[5] = "+++ exited with 0 +++" - - lines = 5 - fail = 0 -} - -@include "match.awk" diff --git a/tests-m32/sigaction.c b/tests-m32/sigaction.c index 1c034ff3..fe6280ce 100644 --- a/tests-m32/sigaction.c +++ b/tests-m32/sigaction.c @@ -1,67 +1,185 @@ /* - * Copyright (c) 2014-2015 Dmitry V. Levin - * All rights reserved. + * Check decoding of sigaction syscall. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Copyright (c) 2014-2018 Dmitry V. Levin + * All rights reserved. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ -#include -#include -#include -#include +#include "tests.h" +#include + +#ifdef __NR_sigaction + +# include +# include +# include +# include +# include + +struct set_sa { +# if defined MIPS + unsigned int flags; + unsigned long handler; + unsigned long mask[1]; +# elif defined ALPHA + unsigned long handler; + unsigned long mask[1]; + unsigned int flags; +# else + unsigned long handler; + unsigned long mask[1]; + unsigned long flags; + unsigned long restorer; +# endif +} +# ifdef ALPHA + ATTRIBUTE_PACKED +# endif +; + +typedef struct set_sa struct_set_sa; + +# ifdef MIPS + +struct get_sa { + unsigned int flags; + unsigned long handler; + unsigned long mask[4]; +}; + +typedef struct get_sa struct_get_sa; -static void handle_signal(int no) +# else + +typedef struct set_sa struct_get_sa; + +# endif + +static long +k_sigaction(const kernel_ulong_t signum, const kernel_ulong_t new_act, + const kernel_ulong_t old_act) { - _exit(128 + no); + return syscall(__NR_sigaction, signum, new_act, old_act); } +# if defined SPARC || defined SPARC64 +/* + * See arch/sparc/kernel/sys_sparc_32.c:sys_sparc_sigaction + * and arch/sparc/kernel/sys_sparc32.c:compat_sys_sparc_sigaction + */ +# define ADDR_INT ((unsigned int) -0xdefaced) +# define SIGNO_INT ((unsigned int) -SIGUSR1) +# define SIG_STR "-SIGUSR1" +# else +# define ADDR_INT ((unsigned int) 0xdefaced) +# define SIGNO_INT ((unsigned int) SIGUSR1) +# define SIG_STR "SIGUSR1" +# endif +static const kernel_ulong_t signo = + (kernel_ulong_t) 0xbadc0ded00000000ULL | SIGNO_INT; +static const kernel_ulong_t addr = + (kernel_ulong_t) 0xfacefeed00000000ULL | ADDR_INT; + int main(void) { - struct sigaction sa, sa0; - - sa.sa_handler = SIG_IGN; - sigemptyset(&sa.sa_mask); - sigaddset(&sa.sa_mask, SIGHUP); - sigaddset(&sa.sa_mask, SIGINT); - sa.sa_flags = SA_RESTART; - assert(!sigaction(SIGUSR2, &sa, &sa0)); - - sa.sa_handler = handle_signal; - sigemptyset(&sa.sa_mask); - sigaddset(&sa.sa_mask, SIGQUIT); - sigaddset(&sa.sa_mask, SIGTERM); - sa.sa_flags = SA_SIGINFO; - assert(!sigaction(SIGUSR2, &sa, &sa0)); - - sa.sa_handler = SIG_DFL; - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - assert(!sigaction(SIGUSR2, &sa, &sa0)); - - sigfillset(&sa.sa_mask); - sigdelset(&sa.sa_mask, SIGHUP); - assert(!sigaction(SIGUSR2, &sa, &sa0)); + union { + sigset_t libc[1]; + unsigned long old[1]; + } mask; + + TAIL_ALLOC_OBJECT_CONST_PTR(struct_set_sa, new_act); + TAIL_ALLOC_OBJECT_CONST_PTR(struct_get_sa, old_act); + + if (k_sigaction(signo, 0, 0)) + perror_msg_and_skip("sigaction"); + puts("sigaction(" SIG_STR ", NULL, NULL) = 0"); + + k_sigaction(signo, 0, 0); + puts("sigaction(" SIG_STR ", NULL, NULL) = 0"); + k_sigaction(signo, (uintptr_t) (new_act + 1), 0); + printf("sigaction(" SIG_STR ", %p, NULL) = -1 EFAULT (%m)\n", + new_act + 1); + + k_sigaction(signo, (uintptr_t) new_act + 2, 0); + printf("sigaction(" SIG_STR ", %#lx, NULL) = -1 EFAULT (%m)\n", + (unsigned long) new_act + 2); + + k_sigaction(signo, 0, (uintptr_t) (old_act + 1)); + printf("sigaction(" SIG_STR ", NULL, %p) = -1 EFAULT (%m)\n", + old_act + 1); + + k_sigaction(signo, 0, (uintptr_t) old_act + 2); + printf("sigaction(" SIG_STR ", NULL, %#lx) = -1 EFAULT (%m)\n", + (unsigned long) old_act + 2); + + k_sigaction(addr, 0, 0); + printf("sigaction(%d, NULL, NULL) = -1 EINVAL (%m)\n", ADDR_INT); + + memset(new_act, 0, sizeof(*new_act)); + + k_sigaction(signo, (uintptr_t) new_act, 0); + puts("sigaction(" SIG_STR ", {sa_handler=SIG_DFL, sa_mask=[]" + ", sa_flags=0}, NULL) = 0"); + + sigemptyset(mask.libc); + sigaddset(mask.libc, SIGHUP); + sigaddset(mask.libc, SIGINT); + + new_act->handler = (uintptr_t) SIG_IGN; + memcpy(new_act->mask, mask.old, sizeof(mask.old)); + new_act->flags = SA_SIGINFO; + + k_sigaction(signo, (uintptr_t) new_act, (uintptr_t) old_act); + puts("sigaction(" SIG_STR ", {sa_handler=SIG_IGN, sa_mask=[HUP INT]" + ", sa_flags=SA_SIGINFO}, {sa_handler=SIG_DFL, sa_mask=[]" + ", sa_flags=0}) = 0"); + + sigemptyset(mask.libc); + sigaddset(mask.libc, SIGQUIT); + sigaddset(mask.libc, SIGTERM); + + new_act->handler = (unsigned long) addr; + memcpy(new_act->mask, mask.old, sizeof(mask.old)); + new_act->flags = SA_ONSTACK | SA_RESTART; + + k_sigaction(signo, (uintptr_t) new_act, (uintptr_t) old_act); + printf("sigaction(" SIG_STR ", {sa_handler=%#lx, sa_mask=[QUIT TERM]" + ", sa_flags=SA_ONSTACK|SA_RESTART}, {sa_handler=SIG_IGN" + ", sa_mask=[HUP INT], sa_flags=SA_SIGINFO}) = 0\n", + new_act->handler); + + memset(mask.old, -1, sizeof(mask.old)); + sigdelset(mask.libc, SIGHUP); + + memcpy(new_act->mask, mask.old, sizeof(mask.old)); +# ifdef SA_RESTORER + new_act->flags = SA_RESTORER; + new_act->restorer = (unsigned long) 0xdeadfacecafef00dULL; +# define SA_RESTORER_FMT ", sa_flags=SA_RESTORER, sa_restorer=%#lx" +# define SA_RESTORER_ARGS , new_act->restorer +# else + new_act->flags = SA_NODEFER; +# define SA_RESTORER_FMT ", sa_flags=SA_NODEFER" +# define SA_RESTORER_ARGS +# endif + + k_sigaction(signo, (uintptr_t) new_act, (uintptr_t) old_act); + printf("sigaction(" SIG_STR ", {sa_handler=%#lx, sa_mask=~[HUP]" + SA_RESTORER_FMT "}, {sa_handler=%#lx, sa_mask=[QUIT TERM]" + ", sa_flags=SA_ONSTACK|SA_RESTART}) = 0\n", + new_act->handler SA_RESTORER_ARGS, + new_act->handler); + + puts("+++ exited with 0 +++"); return 0; } + +#else + +SKIP_MAIN_UNDEFINED("__NR_sigaction") + +#endif diff --git a/tests-m32/sigaction.gen.test b/tests-m32/sigaction.gen.test new file mode 100755 index 00000000..1db6b3aa --- /dev/null +++ b/tests-m32/sigaction.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sigaction -a31 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 diff --git a/tests-m32/sigaction.test b/tests-m32/sigaction.test deleted file mode 100755 index fcde3baf..00000000 --- a/tests-m32/sigaction.test +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# Check rt_sigaction decoding. - -. "${srcdir=.}/init.sh" - -run_prog -run_strace -ert_sigaction $args -match_awk - -exit 0 diff --git a/tests-m32/sigaltstack.c b/tests-m32/sigaltstack.c index 884e3c55..905f71c7 100644 --- a/tests-m32/sigaltstack.c +++ b/tests-m32/sigaltstack.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/sigaltstack.test b/tests-m32/sigaltstack.test index ff83c2ea..a2ff4414 100755 --- a/tests-m32/sigaltstack.test +++ b/tests-m32/sigaltstack.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check sigaltstack syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests-m32/sigblock.test b/tests-m32/sigblock.test new file mode 100755 index 00000000..ab1eaeb7 --- /dev/null +++ b/tests-m32/sigblock.test @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Check signal mask transparency. +# Starting with commit v4.17-5-gf83b49b strace is expected +# to forward the signal mask to tracees unchanged. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog ../list_sigaction_signum > /dev/null +saved_STRACE="$STRACE" + +for sig in $(../list_sigaction_signum); do + for block in 0 1; do + set_cmd="../set_sigblock $block $sig" + check_cmd="../check_sigblock $block $sig" + run_prog $set_cmd $check_cmd + STRACE="$set_cmd $saved_STRACE" + for i in '' -I1 -I2 -I3 -I4; do + run_strace $i -enone $check_cmd + done + done +done diff --git a/tests-m32/sigign.test b/tests-m32/sigign.test new file mode 100755 index 00000000..07a8180c --- /dev/null +++ b/tests-m32/sigign.test @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Check signal disposition transparency. +# Starting with commit v4.17-8-ge97a66f strace is expected +# to forward the signal disposition to tracees unchanged. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog ../list_sigaction_signum > /dev/null +saved_STRACE="$STRACE" + +for sig in $(../list_sigaction_signum); do + for ign in 0 1; do + set_cmd="../set_sigign $ign $sig" + check_cmd="../check_sigign $ign $sig" + run_prog $set_cmd $check_cmd + STRACE="$set_cmd $saved_STRACE" + for i in '' -I1 -I2 -I3 -I4; do + run_strace $i -enone $check_cmd + done + done +done diff --git a/tests-m32/siginfo.c b/tests-m32/siginfo.c index 2ecb13fd..7789ff27 100644 --- a/tests-m32/siginfo.c +++ b/tests-m32/siginfo.c @@ -1,30 +1,10 @@ /* * Check SIGCHLD siginfo_t decoding. * - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/siginfo.gen.test b/tests-m32/siginfo.gen.test new file mode 100755 index 00000000..33792b94 --- /dev/null +++ b/tests-m32/siginfo.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (siginfo -e trace=none); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=none diff --git a/tests-m32/siginfo.test b/tests-m32/siginfo.test deleted file mode 100755 index 725f714f..00000000 --- a/tests-m32/siginfo.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check SIGCHLD siginfo_t decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=none diff --git a/tests-m32/signal.c b/tests-m32/signal.c new file mode 100644 index 00000000..40cd77f5 --- /dev/null +++ b/tests-m32/signal.c @@ -0,0 +1,112 @@ +/* + * Check decoding of signal syscall. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_signal + +# include +# include +# include +# include +# include +# include + +static long +k_signal(const kernel_ulong_t signum, const kernel_ulong_t handler) +{ + return syscall(__NR_signal, signum, handler); +} + +int +main(void) +{ + static const uintptr_t sig_ign = (uintptr_t) SIG_IGN; + static const uintptr_t sig_dfl = (uintptr_t) SIG_DFL; + static const kernel_ulong_t sigusr1 = + (kernel_ulong_t) 0xfacefeed00000000ULL | SIGUSR1; + static const struct sigaction act = { .sa_handler = SIG_DFL }; + long rc; + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + if (sigprocmask(SIG_BLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask SIG_BLOCK"); + + if (sigaction(SIGUSR1, &act, NULL)) + perror_msg_and_fail("sigaction"); + + rc = k_signal(sigusr1, sig_ign); + + if (rc == -1L) { + printf("signal(SIGUSR1, SIG_IGN) = %s\n", sprintrc(rc)); + } else if (rc != (long) sig_dfl) { + error_msg_and_fail("signal(SIGUSR1, SIG_IGN) = %#lx\n", rc); + } else { + printf("signal(SIGUSR1, SIG_IGN) = %#lx (SIG_DFL)\n", rc); + + /* + * Raise and unblock SIGUSR1. + * If signal syscall failed to set SIGUSR1 handler to SIG_IGN, + * the process will be terminated by SIGUSR1. + */ + raise(SIGUSR1); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask SIG_UNBLOCK"); + + if (sigprocmask(SIG_BLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask SIG_BLOCK"); + } + + rc = k_signal(SIGUSR1, sig_dfl); + + if (rc == -1L) { + printf("signal(SIGUSR1, SIG_DFL) = %s\n", sprintrc(rc)); + } else if (rc != (long) sig_ign) { + error_msg_and_fail("signal(SIGUSR1, SIG_DFL) = %#lx\n", rc); + } else { + printf("signal(SIGUSR1, SIG_DFL) = %#lx (SIG_IGN)\n", rc); + } + + const kernel_ulong_t addr = (kernel_ulong_t) 0xfacefeeddeadbeefULL; + rc = k_signal(SIGUSR1, addr); + + if (rc == -1L) { + printf("signal(SIGUSR1, %#llx) = %s\n", + (unsigned long long) addr, sprintrc(rc)); + } else if (rc != (long) sig_dfl) { + error_msg_and_fail("signal(SIGUSR1, %#llx) = %#lx\n", + (unsigned long long) addr, rc); + } else { + printf("signal(SIGUSR1, %#llx) = %#lx (SIG_DFL)\n", + (unsigned long long) addr, rc); + } + + rc = k_signal(SIGUSR1, sig_ign); + + if (rc == -1L) { + printf("signal(SIGUSR1, SIG_IGN) = %s\n", sprintrc(rc)); + } else { + printf("signal(SIGUSR1, SIG_IGN) = %#lx\n", rc); + } + + rc = k_signal(addr, sig_ign); + printf("signal(%d, SIG_IGN) = %s\n", (int) addr, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_signal") + +#endif diff --git a/tests-m32/signal.gen.test b/tests-m32/signal.gen.test new file mode 100755 index 00000000..81359ca5 --- /dev/null +++ b/tests-m32/signal.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (signal -a25 -e signal=none -e trace='/^signal$'); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 -e signal=none -e trace='/^signal$' diff --git a/tests-m32/signal2name.c b/tests-m32/signal2name.c index e301f4ee..1d8e7c59 100644 --- a/tests-m32/signal2name.c +++ b/tests-m32/signal2name.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -50,6 +57,7 @@ signal2name(int sig) CASE(SIGPWR); CASE(SIGSTKFLT); #endif - default: perror_msg_and_fail("unknown signal number %d", sig); + default: + perror_msg_and_fail("unknown signal number %d", sig); } } diff --git a/tests-m32/signal_receive.c b/tests-m32/signal_receive.c index 1c4293e5..ad3b4ebd 100644 --- a/tests-m32/signal_receive.c +++ b/tests-m32/signal_receive.c @@ -1,43 +1,107 @@ +/* + * Check decoding of signal delivery. + * + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include #include -void sig_print(const char *signame, const int pid, const int uid) -{ - printf("kill(%d, %s) = 0\n" - "--- %s {si_signo=%s, si_code=SI_USER, si_pid=%d" - ", si_uid=%d} ---\n", - pid, signame, signame, signame, pid, uid); -} +static volatile int s_sig, s_code, s_pid, s_uid; static void -handler(int sig) +handler(int sig, siginfo_t *info, void *ucontext) { + s_sig = info->si_signo; + s_code = info->si_code; + s_pid = info->si_pid; + s_uid = info->si_uid; } int main(void) { - int sig, pid = getpid(), uid = getuid(); - const struct sigaction act = { .sa_handler = handler }; - sigset_t mask; - sigemptyset(&mask); - - for (sig = 1; sig <= 31; sig++) { - if( sig != SIGKILL && sig != SIGSTOP) { - sigaction(sig, &act, NULL); - sigaddset(&mask, sig); + static const char prefix[] = "KERNEL BUG"; + int printed = 0; + + const int pid = getpid(); + const int uid = geteuid(); + + for (int sig = 1; sig <= 31; ++sig) { + if (sig == SIGKILL || sig == SIGSTOP) + continue; + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, sig); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + static const struct sigaction act = { + .sa_sigaction = handler, + .sa_flags = SA_SIGINFO + }; + if (sigaction(sig, &act, NULL)) + perror_msg_and_fail("sigaction: %d", sig); + + if (kill(pid, sig) != 0) + perror_msg_and_fail("kill: %d", sig); + +#ifdef MPERS_IS_m32 + /* + * The tracee has received a compat siginfo_t but + * the tracer has received a native siginfo_t. + */ + const int e_sig = sig; + const int e_pid = pid; + const int e_uid = uid; +#else + /* + * If the tracee is a native process, + * then the tracer is also native. + * If the tracee is a compat process, + * then the tracer is also compat. + * Anyway, both the tracee and the tracer + * have received the same siginfo_t. + */ + const int e_sig = s_sig; + const int e_pid = s_pid; + const int e_uid = s_uid; +#endif + printf("kill(%d, %s) = 0\n", pid, signal2name(sig)); + printf("--- %s {si_signo=%s, si_code=SI_USER, si_pid=%d" + ", si_uid=%d} ---\n", + signal2name(sig), signal2name(e_sig), e_pid, e_uid); + + if (s_code || sig != s_sig || pid != s_pid || uid != s_uid) { + /* + * The kernel has failed to initialize siginfo_t + * properly. There is nothing that could be done + * on the strace side to workaround the kernel bug, + * so just print some useful diagnostics. + */ + if (!printed) { + printed = 1; + fprintf(stderr, "%s: siginfo_t\n", prefix); + } + fprintf(stderr, + "%s: expected: si_signo=%d, si_code=%d" + ", si_pid=%d, si_uid=%d\n" + "%s: received: si_signo=%d, si_code=%d" + ", si_pid=%d, si_uid=%d\n", + prefix, sig, SI_USER, pid, uid, + prefix, sig, s_code, s_pid, s_uid); } } - sigprocmask(SIG_UNBLOCK, &mask, NULL); - for (sig = 1; sig <= 31; sig++) { - if(sig != SIGKILL && sig != SIGSTOP) { - if (kill(pid, sig) != 0) - perror_msg_and_fail("kill: %d", sig); - sig_print(signal2name(sig), pid, uid); - } + if (printed) { + fprintf(stderr, "%s: end of diagnostics\n" + "*** PLEASE FIX THE KERNEL ***\n", prefix); } puts("+++ exited with 0 +++"); diff --git a/tests-m32/signal_receive.gen.test b/tests-m32/signal_receive.gen.test new file mode 100755 index 00000000..79e8fb84 --- /dev/null +++ b/tests-m32/signal_receive.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (signal_receive -a16 -e trace=kill); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 -e trace=kill diff --git a/tests-m32/signal_receive.test b/tests-m32/signal_receive.test deleted file mode 100755 index 9685b666..00000000 --- a/tests-m32/signal_receive.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check whether strace traces signals properly. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a16 -e trace=kill diff --git a/tests-m32/signalfd4.c b/tests-m32/signalfd4.c index 47e49b50..71df2dcc 100644 --- a/tests-m32/signalfd4.c +++ b/tests-m32/signalfd4.c @@ -2,37 +2,17 @@ * Check decoding of signalfd4 syscall. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include #include -#if defined __NR_rt_sigprocmask \ - && defined HAVE_SYS_SIGNALFD_H \ +#if defined HAVE_SYS_SIGNALFD_H \ && defined HAVE_SIGNALFD \ && defined O_CLOEXEC @@ -41,24 +21,6 @@ # include # include -static unsigned int -get_sigset_size(void) -{ - const unsigned int big_size = 1024 / 8; - unsigned int set_size; - - for (set_size = big_size; set_size; set_size >>= 1) { - if (!syscall(__NR_rt_sigprocmask, SIG_SETMASK, - NULL, NULL, set_size)) - break; - } - - if (!set_size) - perror_msg_and_fail("rt_sigprocmask"); - - return set_size; -} - int main(void) { @@ -80,7 +42,6 @@ main(void) #else -SKIP_MAIN_UNDEFINED("__NR_rt_sigprocmask && HAVE_SYS_SIGNALFD_H" - " && HAVE_SIGNALFD && O_CLOEXEC") +SKIP_MAIN_UNDEFINED("HAVE_SYS_SIGNALFD_H && HAVE_SIGNALFD && O_CLOEXEC") #endif diff --git a/tests-m32/signalfd4.gen.test b/tests-m32/signalfd4.gen.test new file mode 100755 index 00000000..dee4274c --- /dev/null +++ b/tests-m32/signalfd4.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (signalfd4 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/signalfd4.test b/tests-m32/signalfd4.test deleted file mode 100755 index a615a5bf..00000000 --- a/tests-m32/signalfd4.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of signalfd4 syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/sigpending.c b/tests-m32/sigpending.c new file mode 100644 index 00000000..f065c873 --- /dev/null +++ b/tests-m32/sigpending.c @@ -0,0 +1,86 @@ +/* + * Check decoding of sigpending syscall. + * + * Copyright (c) 2016-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_sigpending + +# include +# include +# include +# include +# include + +static const char *errstr; + +static long +k_sigpending(const kernel_ulong_t set) +{ + const long rc = syscall(__NR_sigpending, set); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(kernel_ulong_t, k_set); + TAIL_ALLOC_OBJECT_CONST_PTR(sigset_t, libc_set); + + sigemptyset(libc_set); + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + + if (k_sigpending((uintptr_t) libc_set)) + perror_msg_and_skip("sigpending"); + else + puts("sigpending([]) = 0"); + + k_sigpending((uintptr_t) k_set); + puts("sigpending([]) = 0"); + + k_sigpending((uintptr_t) (k_set + 1)); + printf("sigpending(%p) = -1 EFAULT (%m)\n", k_set + 1); + + uintptr_t efault = sizeof(*k_set) / 2 + (uintptr_t) k_set; + k_sigpending(efault); + printf("sigpending(%#jx) = -1 EFAULT (%m)\n", (uintmax_t) efault); + + sigaddset(libc_set, SIGHUP); + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + raise(SIGHUP); + + k_sigpending((uintptr_t) k_set); + puts("sigpending([HUP]) = 0"); + + sigaddset(libc_set, SIGINT); + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + raise(SIGINT); + + k_sigpending((uintptr_t) k_set); + puts("sigpending([HUP INT]) = 0"); + + if (F8ILL_KULONG_SUPPORTED) { + k_sigpending(f8ill_ptr_to_kulong(k_set)); + printf("sigpending(%#jx) = %s\n", + (uintmax_t) f8ill_ptr_to_kulong(k_set), errstr); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sigpending") + +#endif diff --git a/tests-m32/sigpending.gen.test b/tests-m32/sigpending.gen.test new file mode 100755 index 00000000..c061868c --- /dev/null +++ b/tests-m32/sigpending.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sigpending -a15 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests-m32/sigprocmask.c b/tests-m32/sigprocmask.c new file mode 100644 index 00000000..566b8346 --- /dev/null +++ b/tests-m32/sigprocmask.c @@ -0,0 +1,131 @@ +/* + * Check decoding of sigprocmask syscall. + * + * Copyright (c) 2016-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_sigprocmask + +# include +# include +# include +# include +# include + +static const char *errstr; + +static long +k_sigprocmask(const kernel_ulong_t how, const kernel_ulong_t new_set, + const kernel_ulong_t old_set) +{ + const long rc = syscall(__NR_sigprocmask, how, new_set, old_set); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const kernel_ulong_t sig_block = + (kernel_ulong_t) 0xfacefeed00000000ULL | SIG_BLOCK; + static const kernel_ulong_t sig_unblock = + (kernel_ulong_t) 0xfacefeed00000000ULL | SIG_UNBLOCK; + static const kernel_ulong_t sig_setmask = + (kernel_ulong_t) 0xfacefeed00000000ULL | SIG_SETMASK; + + if (k_sigprocmask(sig_setmask, 0, 0)) + perror_msg_and_skip("sigprocmask"); + puts("sigprocmask(SIG_SETMASK, NULL, NULL) = 0"); + + TAIL_ALLOC_OBJECT_CONST_PTR(kernel_ulong_t, new_set); + TAIL_ALLOC_OBJECT_CONST_PTR(kernel_ulong_t, old_set); + TAIL_ALLOC_OBJECT_CONST_PTR(sigset_t, libc_set); + + memset(new_set, 0, sizeof(*new_set)); + k_sigprocmask(sig_setmask, (uintptr_t) new_set, 0); + printf("sigprocmask(SIG_SETMASK, [], NULL) = %s\n", errstr); + + k_sigprocmask(sig_unblock, + (uintptr_t) (new_set - 1), (uintptr_t) old_set); + puts("sigprocmask(SIG_UNBLOCK, ~[], []) = 0"); + + if (F8ILL_KULONG_SUPPORTED) { + k_sigprocmask(sig_unblock, f8ill_ptr_to_kulong(new_set), 0); + printf("sigprocmask(SIG_UNBLOCK, %#jx, NULL) = %s\n", + (uintmax_t) f8ill_ptr_to_kulong(new_set), errstr); + + k_sigprocmask(sig_unblock, 0, f8ill_ptr_to_kulong(old_set)); + printf("sigprocmask(SIG_UNBLOCK, NULL, %#jx) = %s\n", + (uintmax_t) f8ill_ptr_to_kulong(old_set), errstr); + } + + sigemptyset(libc_set); + sigaddset(libc_set, SIGHUP); + memcpy(new_set, libc_set, sizeof(*new_set)); + + k_sigprocmask(sig_block, (uintptr_t) new_set, (uintptr_t) old_set); + puts("sigprocmask(SIG_BLOCK, [HUP], []) = 0"); + + memset(libc_set, -1, sizeof(*libc_set)); + sigdelset(libc_set, SIGHUP); + memcpy(new_set, libc_set, sizeof(*new_set)); + + k_sigprocmask(sig_unblock, (uintptr_t) new_set, (uintptr_t) old_set); + puts("sigprocmask(SIG_UNBLOCK, ~[HUP], [HUP]) = 0"); + + sigdelset(libc_set, SIGKILL); + memcpy(new_set, libc_set, sizeof(*new_set)); + + k_sigprocmask(sig_unblock, (uintptr_t) new_set, (uintptr_t) old_set); + puts("sigprocmask(SIG_UNBLOCK, ~[HUP KILL], [HUP]) = 0"); + + sigemptyset(libc_set); + sigaddset(libc_set, SIGHUP); + sigaddset(libc_set, SIGINT); + sigaddset(libc_set, SIGQUIT); + sigaddset(libc_set, SIGALRM); + sigaddset(libc_set, SIGTERM); + memcpy(new_set, libc_set, sizeof(*new_set)); + + k_sigprocmask(sig_block, (uintptr_t) new_set, (uintptr_t) old_set); + printf("sigprocmask(SIG_BLOCK, %s, [HUP]) = 0\n", + "[HUP INT QUIT ALRM TERM]"); + + k_sigprocmask(sig_setmask, 0, (uintptr_t) old_set); + printf("sigprocmask(SIG_SETMASK, NULL, %s) = 0\n", + "[HUP INT QUIT ALRM TERM]"); + + k_sigprocmask(sig_setmask, (uintptr_t) (new_set + 1), 0); + printf("sigprocmask(SIG_SETMASK, %p, NULL) = %s\n", + new_set + 1, errstr); + + k_sigprocmask(sig_setmask, + (uintptr_t) new_set, (uintptr_t) (old_set + 1)); + printf("sigprocmask(SIG_SETMASK, %s, %p) = %s\n", + "[HUP INT QUIT ALRM TERM]", old_set + 1, errstr); + + uintptr_t efault = sizeof(*new_set) / 2 + (uintptr_t) new_set; + + k_sigprocmask(sig_setmask, efault, 0); + printf("sigprocmask(SIG_SETMASK, %#jx, NULL) = %s\n", + (uintmax_t) efault, errstr); + + k_sigprocmask(sig_setmask, 0, efault); + printf("sigprocmask(SIG_SETMASK, NULL, %#jx) = %s\n", + (uintmax_t) efault, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sigprocmask") + +#endif diff --git a/tests-m32/sigprocmask.gen.test b/tests-m32/sigprocmask.gen.test new file mode 100755 index 00000000..065b74d7 --- /dev/null +++ b/tests-m32/sigprocmask.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sigprocmask -a34 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a34 diff --git a/tests-m32/sigreturn.c b/tests-m32/sigreturn.c index dace040a..5dece0a4 100644 --- a/tests-m32/sigreturn.c +++ b/tests-m32/sigreturn.c @@ -1,48 +1,43 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" -#include -#include +#include -#ifdef ASM_SIGRTMIN -# define RT_0 ASM_SIGRTMIN -#else -/* Linux kernel >= 3.18 defines SIGRTMIN to 32 on all architectures. */ -# define RT_0 32 +#if defined __powerpc64__ \ + || (defined __sparc__ && defined __arch64__) +/* Old sigreturn is defined but not implemented in the kernel. */ +# undef __NR_sigreturn #endif -static void handler(int sig) +#ifdef __NR_sigreturn + +# include +# include +# include + +# ifdef ASM_SIGRTMIN +# define RT_0 ASM_SIGRTMIN +# else +/* Linux kernel >= 3.18 defines SIGRTMIN to 32 on all architectures. */ +# define RT_0 32 +# endif + +static void +handler(int sig) { } -int main(void) { - sigset_t set; +int +main(void) +{ + static sigset_t set; sigemptyset(&set); + sigaddset(&set, SIGINT); sigaddset(&set, SIGUSR2); sigaddset(&set, SIGCHLD); sigaddset(&set, RT_0 + 3); @@ -50,8 +45,28 @@ int main(void) { sigaddset(&set, RT_0 + 5); sigaddset(&set, RT_0 + 26); sigaddset(&set, RT_0 + 27); - sigprocmask(SIG_SETMASK, &set, NULL); - signal(SIGUSR1, handler); - raise(SIGUSR1); + if (sigprocmask(SIG_SETMASK, &set, NULL)) + perror_msg_and_fail("sigprocmask"); + sigemptyset(&set); + + /* This should result to old sigreturn. */ + if (signal(SIGUSR1, handler) == SIG_ERR) + perror_msg_and_fail("sigaction"); + + if (raise(SIGUSR1)) + perror_msg_and_fail("raise"); + + static const char *const sigs = + (SIGUSR2 < SIGCHLD) ? "INT USR2 CHLD" : "INT CHLD USR2"; + static const char *const rt_sigs = "RT_3 RT_4 RT_5 RT_26 RT_27"; + printf("sigreturn({mask=[%s %s]}) = 0\n", sigs, rt_sigs); + + puts("+++ exited with 0 +++"); return 0; } + +#else + +SKIP_MAIN_UNDEFINED("__NR_sigreturn") + +#endif diff --git a/tests-m32/sigreturn.gen.test b/tests-m32/sigreturn.gen.test new file mode 100755 index 00000000..3b67c9d0 --- /dev/null +++ b/tests-m32/sigreturn.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sigreturn -esignal='!USR1' ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal='!USR1' diff --git a/tests-m32/sigreturn.test b/tests-m32/sigreturn.test deleted file mode 100755 index f9a612bf..00000000 --- a/tests-m32/sigreturn.test +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# -# Check rt_sigprocmask and sigreturn/rt_sigreturn decoding. -# -# Copyright (c) 2015-2016 Dmitry V. Levin -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (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" - -run_prog -run_strace -esignal $args - -mask='\[(USR2 CHLD|CHLD USR2) RT_3 RT_4 RT_5 RT_26 RT_27\]' -rt_sigprocmask='rt_sigprocmask\(SIG_SETMASK, '"$mask"', NULL, [[:digit:]]+\) += 0' -osf_sigprocmask='osf_sigprocmask\(SIG_SETMASK, '"$mask"'\) += 0 +\(old mask \[[^]]*\]\)' -EXPECTED="$LOG.expected" - -cat > "$EXPECTED" << __EOF__ -$rt_sigprocmask|$osf_sigprocmask -(rt_)?sigreturn\\((\\{mask=$mask\\})?\\) += 0 -__EOF__ - -match_grep "$LOG" "$EXPECTED" -rm -f "$EXPECTED" - -exit 0 diff --git a/tests-m32/sigsuspend.c b/tests-m32/sigsuspend.c new file mode 100644 index 00000000..11ffae83 --- /dev/null +++ b/tests-m32/sigsuspend.c @@ -0,0 +1,97 @@ +/* + * Check decoding of sigsuspend syscall. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_sigsuspend + +# include +# include +# include +# include +# include +# include +# include + +# ifdef MIPS +# define SIGNAL_MASK_BY_REF 1 +# else +# define SIGNAL_MASK_BY_REF 0 +# endif + +static long +k_sigsuspend(const kernel_ulong_t arg1, + const kernel_ulong_t arg2, + const kernel_ulong_t arg3) +{ + return syscall(__NR_sigsuspend, arg1, arg2, arg3); +} + +static int signo; +static const char *sigtxt[] = { + [SIGUSR1] = "USR1", + [SIGUSR2] = "USR2" +}; + +static void +handler(int i) +{ + signo = i; +} + +int +main(void) +{ + union { + sigset_t libc_mask; + unsigned long old_mask; + } u; + + sigemptyset(&u.libc_mask); + sigaddset(&u.libc_mask, SIGUSR1); + sigaddset(&u.libc_mask, SIGUSR2); + if (sigprocmask(SIG_SETMASK, &u.libc_mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + const struct sigaction sa = { .sa_handler = handler }; + if (sigaction(SIGUSR1, &sa, NULL) || sigaction(SIGUSR2, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + raise(SIGUSR1); + raise(SIGUSR2); + + u.old_mask = -1UL; + sigdelset(&u.libc_mask, SIGUSR1); + const unsigned long mask1 = u.old_mask; + + u.old_mask = -1UL; + sigdelset(&u.libc_mask, SIGUSR2); + const unsigned long mask2 = u.old_mask; + +# if SIGNAL_MASK_BY_REF + k_sigsuspend((uintptr_t) &mask1, 0xdeadbeef, (uintptr_t) &mask2); +# else + k_sigsuspend(mask1, 0xdeadbeef, mask2); +# endif + if (EINTR != errno) + perror_msg_and_skip("sigsuspend"); + + printf("sigsuspend(~[%s]) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", sigtxt[signo]); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sigsuspend") + +#endif diff --git a/tests-m32/sigsuspend.gen.test b/tests-m32/sigsuspend.gen.test new file mode 100755 index 00000000..afd0207e --- /dev/null +++ b/tests-m32/sigsuspend.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sigsuspend -a19 -esignal=none); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 -esignal=none diff --git a/tests-m32/skip_unavailable.c b/tests-m32/skip_unavailable.c new file mode 100644 index 00000000..761a10c3 --- /dev/null +++ b/tests-m32/skip_unavailable.c @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include + +void +skip_if_unavailable(const char *const path) +{ + struct stat st; + + if (stat(path, &st)) + perror_msg_and_skip("stat: %s", path); +} diff --git a/tests-m32/sleep.c b/tests-m32/sleep.c index f4bce3cd..0cdfcebc 100644 --- a/tests-m32/sleep.c +++ b/tests-m32/sleep.c @@ -1,30 +1,10 @@ /* * A simple nanosleep based sleep(1) replacement. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/so_error.c b/tests-m32/so_error.c new file mode 100644 index 00000000..2592a3c1 --- /dev/null +++ b/tests-m32/so_error.c @@ -0,0 +1,103 @@ +/* + * Check decoding of SO_ERROR socket option. + * + * Copyright (c) 2018 Masatake YAMATO + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +static in_port_t +reserve_ephemeral_port(void) +{ + int sd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + if (sd < 0) + perror_msg_and_skip("server socket AF_UNIX SOCK_STREAM"); + + struct sockaddr_in addr = { + .sin_family = AF_INET, + .sin_addr.s_addr = htonl(INADDR_LOOPBACK), + }; + + /* + * The range is defined in /proc/sys/net/ipv4/ip_local_port_range. + * We use the default range here. + */ + for (in_port_t port = 49152; port < 61000; port++) { + /* Just bind here. No listen. */ + addr.sin_port = htons(port); + if (bind(sd, &addr, sizeof(addr)) == 0) + return port; + } + error_msg_and_skip("no ephemeral port available for test purposes"); +} + +int +main(void) +{ + in_port_t port = reserve_ephemeral_port (); + + /* + * Connect to the reserved port in NONBLOCK mode. + * The port is reserved but not listened. So + * the client doing "connect" gets error asynchronously. + */ + int fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + if (fd < 0) + perror_msg_and_skip("socket AF_UNIX SOCK_STREAM"); + + int flag = fcntl(fd, F_GETFL); + if (flag < 0) + perror_msg_and_skip("fcntl F_GETFL"); + flag |= O_NONBLOCK; + if (fcntl(fd, F_SETFL, flag) < 0) + perror_msg_and_skip("fcntl F_SETFL"); + + struct sockaddr_in addr = { + .sin_family = AF_INET, + .sin_addr.s_addr = htonl(INADDR_LOOPBACK), + .sin_port = htons(port), + }; + if (connect(fd, &addr, sizeof(addr)) == 0) + error_msg_and_skip("connect unexpectedly succeeded"); + if (errno != EINPROGRESS) + perror_msg_and_skip("connect failed for unexpected reason"); + + struct timeval to = { + .tv_sec = 1, + .tv_usec = 0, + }; + fd_set wfds; + FD_ZERO(&wfds); + FD_SET(fd, &wfds); + if (select(fd + 1, NULL, &wfds, NULL, &to) < 0) + perror_msg_and_skip("select"); + + int sock_errno; + socklen_t optlen = sizeof(sock_errno); + if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &sock_errno, &optlen) < 0) + perror_msg_and_skip("getsockopt"); + if (sock_errno != ECONNREFUSED) { + errno = sock_errno; + perror_msg_and_skip("unexpected socket error"); + } + if (optlen != sizeof(sock_errno)) + error_msg_and_skip("unexpected data size for error option: %d", + optlen); + + printf("getsockopt(%d, SOL_SOCKET, SO_ERROR, [ECONNREFUSED], [%u]) = 0\n", + fd, optlen); + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/so_error.gen.test b/tests-m32/so_error.gen.test new file mode 100755 index 00000000..9083e4d4 --- /dev/null +++ b/tests-m32/so_error.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (so_error -e trace=getsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt diff --git a/tests-m32/so_linger.c b/tests-m32/so_linger.c new file mode 100644 index 00000000..b10fa067 --- /dev/null +++ b/tests-m32/so_linger.c @@ -0,0 +1,161 @@ +/* + * Check decoding of SO_LINGER socket option. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +static const char *errstr; + +static int +get_linger(int fd, void *val, socklen_t *len) +{ + int rc = getsockopt(fd, SOL_SOCKET, SO_LINGER, val, len); + errstr = sprintrc(rc); + return rc; +} + +static int +set_linger(int fd, void *val, socklen_t len) +{ + int rc = setsockopt(fd, SOL_SOCKET, SO_LINGER, val, len); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct linger, linger); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); + + const unsigned int sizeof_l_onoff = sizeof(linger->l_onoff); + struct linger *const l_onoff = tail_alloc(sizeof_l_onoff); + + const unsigned int sizeof_l_onoff_truncated = sizeof_l_onoff - 1; + struct linger *const l_onoff_truncated = + tail_alloc(sizeof_l_onoff_truncated); + + const unsigned int sizeof_l_linger_truncated = + offsetofend(struct linger, l_linger) - 1; + struct linger *const l_linger_truncated = + tail_alloc(sizeof_l_linger_truncated); + + int fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (fd < 0) + perror_msg_and_skip("socket AF_UNIX SOCK_STREAM"); + + /* classic getsockopt */ + *len = sizeof(*linger); + get_linger(fd, linger, len); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, {l_onoff=%d, l_linger=%d}" + ", [%d]) = %s\n", + fd, linger->l_onoff, linger->l_linger, *len, errstr); + + /* classic setsockopt */ + linger->l_onoff = -15; + linger->l_linger = -42; + set_linger(fd, linger, sizeof(*linger)); + printf("setsockopt(%d, SOL_SOCKET, SO_LINGER, {l_onoff=%d, l_linger=%d}" + ", %d) = %s\n", + fd, linger->l_onoff, linger->l_linger, + (unsigned int) sizeof(*linger), errstr); + + /* setsockopt with optlen larger than necessary */ + set_linger(fd, linger, sizeof(*linger) + 1); + printf("setsockopt(%d, SOL_SOCKET, SO_LINGER, {l_onoff=%d, l_linger=%d}" + ", %d) = %s\n", + fd, linger->l_onoff, linger->l_linger, + (unsigned int) sizeof(*linger) + 1, errstr); + + /* setsockopt with optlen < 0 - EINVAL */ + set_linger(fd, linger, -1U); + printf("setsockopt(%d, SOL_SOCKET, SO_LINGER, %p, -1) = %s\n", + fd, linger, errstr); + + /* setsockopt with optlen smaller than necessary - EINVAL */ + set_linger(fd, linger, sizeof(linger->l_onoff)); + printf("setsockopt(%d, SOL_SOCKET, SO_LINGER, %p, %d) = %s\n", + fd, linger, (unsigned int) sizeof(linger->l_onoff), errstr); + + /* setsockopt optval EFAULT */ + set_linger(fd, &linger->l_linger, sizeof(*linger)); + printf("setsockopt(%d, SOL_SOCKET, SO_LINGER, %p, %d) = %s\n", + fd, &linger->l_linger, (unsigned int) sizeof(*linger), errstr); + + /* getsockopt with zero optlen */ + *len = 0; + get_linger(fd, linger, len); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, %p, [0]) = %s\n", + fd, linger, errstr); + + /* getsockopt with optlen larger than necessary - shortened */ + *len = sizeof(*linger) + 1; + get_linger(fd, linger, len); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, {l_onoff=%d, l_linger=%d}" + ", [%u->%d]) = %s\n", + fd, linger->l_onoff, linger->l_linger, + (unsigned int) sizeof(*linger) + 1, *len, errstr); + + /* + * getsockopt with optlen less than sizeof(linger->l_onoff): + * the part of struct linger.l_onoff is printed in hex. + */ + *len = sizeof_l_onoff_truncated; + get_linger(fd, l_onoff_truncated, len); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, {l_onoff=", fd); + print_quoted_hex(l_onoff_truncated, *len); + printf("}, [%d]) = %s\n", *len, errstr); + + /* + * getsockopt with optlen equals to sizeof(struct linger.l_onoff): + * struct linger.l_linger is not printed. + */ + *len = sizeof_l_onoff; + get_linger(fd, l_onoff, len); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, {l_onoff=%d}" + ", [%d]) = %s\n", + fd, l_onoff->l_onoff, *len, errstr); + + /* + * getsockopt with optlen greater than sizeof(struct linger.l_onoff) + * but smaller than sizeof(struct linger): + * the part of struct linger.l_linger is printed in hex. + */ + *len = sizeof_l_linger_truncated; + get_linger(fd, l_linger_truncated, len); + /* + * Copy to a properly aligned structure to avoid unaligned access + * to struct linger.l_onoff field. + */ + memcpy(linger, l_linger_truncated, sizeof_l_linger_truncated); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, {l_onoff=%d, l_linger=", + fd, linger->l_onoff); + print_quoted_hex(&linger->l_linger, sizeof_l_linger_truncated - + offsetof(struct linger, l_linger)); + printf("}, [%d]) = %s\n", *len, errstr); + + /* getsockopt optval EFAULT */ + *len = sizeof(*linger); + get_linger(fd, &linger->l_linger, len); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, %p, [%d]) = %s\n", + fd, &linger->l_linger, *len, errstr); + + /* getsockopt optlen EFAULT */ + get_linger(fd, linger, len + 1); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, %p, %p) = %s\n", + fd, linger, len + 1, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/so_linger.gen.test b/tests-m32/so_linger.gen.test new file mode 100755 index 00000000..8362163a --- /dev/null +++ b/tests-m32/so_linger.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (so_linger -e trace=getsockopt,setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt,setsockopt diff --git a/tests-m32/so_peercred-Xabbrev.c b/tests-m32/so_peercred-Xabbrev.c new file mode 100644 index 00000000..a7056a66 --- /dev/null +++ b/tests-m32/so_peercred-Xabbrev.c @@ -0,0 +1 @@ +#include "so_peercred.c" diff --git a/tests-m32/so_peercred-Xabbrev.gen.test b/tests-m32/so_peercred-Xabbrev.gen.test new file mode 100755 index 00000000..64a5538b --- /dev/null +++ b/tests-m32/so_peercred-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (so_peercred-Xabbrev -e trace=getsockopt -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt -Xabbrev diff --git a/tests-m32/so_peercred-Xraw.c b/tests-m32/so_peercred-Xraw.c new file mode 100644 index 00000000..e45f2df4 --- /dev/null +++ b/tests-m32/so_peercred-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "so_peercred.c" diff --git a/tests-m32/so_peercred-Xraw.gen.test b/tests-m32/so_peercred-Xraw.gen.test new file mode 100755 index 00000000..471ae599 --- /dev/null +++ b/tests-m32/so_peercred-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (so_peercred-Xraw -e trace=getsockopt -Xraw -a39); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt -Xraw -a39 diff --git a/tests-m32/so_peercred-Xverbose.c b/tests-m32/so_peercred-Xverbose.c new file mode 100644 index 00000000..1bb47e98 --- /dev/null +++ b/tests-m32/so_peercred-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "so_peercred.c" diff --git a/tests-m32/so_peercred-Xverbose.gen.test b/tests-m32/so_peercred-Xverbose.gen.test new file mode 100755 index 00000000..2926517b --- /dev/null +++ b/tests-m32/so_peercred-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (so_peercred-Xverbose -e trace=getsockopt -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt -Xverbose diff --git a/tests-m32/so_peercred.c b/tests-m32/so_peercred.c new file mode 100644 index 00000000..151bb175 --- /dev/null +++ b/tests-m32/so_peercred.c @@ -0,0 +1,190 @@ +/* + * Check decoding of SO_PEERCRED socket option. + * + * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +#include "print_fields.h" + +static const char *errstr; + +static int +get_peercred(int fd, void *val, socklen_t *len) +{ + int rc = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, val, len); + errstr = sprintrc(rc); + return rc; +} + +static const char * +so_str(void) +{ + static char buf[256]; + + if (!buf[0]) { +#if XLAT_RAW + snprintf(buf, sizeof(buf), + "%#x, %#x", SOL_SOCKET, SO_PEERCRED); +#elif XLAT_VERBOSE + snprintf(buf, sizeof(buf), + "%#x /* SOL_SOCKET */, %#x /* SO_PEERCRED */", + SOL_SOCKET, SO_PEERCRED); +#else + snprintf(buf, sizeof(buf), + "SOL_SOCKET, SO_PEERCRED"); +#endif + } + + return buf; +} + +int +main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct ucred, peercred); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); + + const unsigned int sizeof_pid = sizeof(peercred->pid); + struct ucred *const pid = tail_alloc(sizeof_pid); + + const unsigned int sizeof_pid_truncated = sizeof_pid - 1; + struct ucred *const pid_truncated = + tail_alloc(sizeof_pid_truncated); + + const unsigned int sizeof_uid = offsetofend(struct ucred, uid); + struct ucred *const uid = tail_alloc(sizeof_uid); + + const unsigned int sizeof_uid_truncated = sizeof_uid - 1; + struct ucred *const uid_truncated = + tail_alloc(sizeof_uid_truncated); + + const unsigned int sizeof_gid_truncated = + offsetofend(struct ucred, gid) - 1; + struct ucred *const gid_truncated = + tail_alloc(sizeof_gid_truncated); + + int sv[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) + perror_msg_and_skip("socketpair AF_UNIX SOCK_STREAM"); + + /* classic getsockopt */ + *len = sizeof(*peercred); + get_peercred(sv[0], peercred, len); + printf("getsockopt(%d, %s", sv[0], so_str()); + PRINT_FIELD_D(", {", *peercred, pid); + PRINT_FIELD_UID(", ", *peercred, uid); + PRINT_FIELD_UID(", ", *peercred, gid); + printf("}, [%d]) = %s\n", *len, errstr); + + /* getsockopt with zero optlen */ + *len = 0; + get_peercred(sv[0], peercred, len); + printf("getsockopt(%d, %s, %p, [0]) = %s\n", + sv[0], so_str(), peercred, errstr); + + /* getsockopt with optlen larger than necessary - shortened */ + *len = sizeof(*peercred) + 1; + get_peercred(sv[0], peercred, len); + printf("getsockopt(%d, %s", sv[0], so_str()); + PRINT_FIELD_D(", {", *peercred, pid); + PRINT_FIELD_UID(", ", *peercred, uid); + PRINT_FIELD_UID(", ", *peercred, gid); + printf("}, [%u->%d]) = %s\n", + (unsigned int) sizeof(*peercred) + 1, *len, errstr); + + /* + * getsockopt with optlen less than offsetofend(struct ucred, pid): + * the part of struct ucred.pid is printed in hex. + */ + *len = sizeof_pid_truncated; + get_peercred(sv[0], pid_truncated, len); + printf("getsockopt(%d, %s, {pid=", sv[0], so_str()); + print_quoted_hex(pid_truncated, *len); + printf("}, [%d]) = %s\n", *len, errstr); + + /* + * getsockopt with optlen equals to sizeof(struct ucred.pid): + * struct ucred.uid and struct ucred.gid are not printed. + */ + *len = sizeof_pid; + get_peercred(sv[0], pid, len); + printf("getsockopt(%d, %s", sv[0], so_str()); + PRINT_FIELD_D(", {", *pid, pid); + printf("}, [%d]) = %s\n", *len, errstr); + + /* + * getsockopt with optlen greater than sizeof(struct ucred.pid) + * but smaller than offsetofend(struct ucred, uid): + * the part of struct ucred.uid is printed in hex. + */ + *len = sizeof_uid_truncated; + get_peercred(sv[0], uid_truncated, len); + /* + * Copy to a properly aligned structure to avoid unaligned access + * to struct ucred.pid field. + */ + memcpy(uid, uid_truncated, sizeof_uid_truncated); + printf("getsockopt(%d, %s", sv[0], so_str()); + PRINT_FIELD_D(", {", *uid, pid); + printf(", uid="); + print_quoted_hex(&uid->uid, sizeof_uid_truncated - + offsetof(struct ucred, uid)); + printf("}, [%d]) = %s\n", *len, errstr); + + /* + * getsockopt with optlen equals to offsetofend(struct ucred, uid): + * struct ucred.gid is not printed. + */ + *len = sizeof_uid; + get_peercred(sv[0], uid, len); + printf("getsockopt(%d, %s", sv[0], so_str()); + PRINT_FIELD_D(", {", *uid, pid); + PRINT_FIELD_UID(", ", *uid, uid); + printf("}, [%d]) = %s\n", *len, errstr); + + /* + * getsockopt with optlen greater than sizeof(struct ucred.uid) + * but smaller than offsetofend(struct ucred, gid): + * the part of struct ucred.gid is printed in hex. + */ + *len = sizeof_gid_truncated; + get_peercred(sv[0], gid_truncated, len); + /* + * Copy to a properly aligned structure to avoid unaligned access + * to struct ucred.pid and struct ucred.uid fields. + */ + memcpy(peercred, gid_truncated, sizeof_gid_truncated); + printf("getsockopt(%d, %s", sv[0], so_str()); + PRINT_FIELD_D(", {", *peercred, pid); + PRINT_FIELD_UID(", ", *peercred, uid); + printf(", gid="); + print_quoted_hex(&peercred->gid, sizeof_gid_truncated - + offsetof(struct ucred, gid)); + printf("}, [%d]) = %s\n", *len, errstr); + + /* getsockopt optval EFAULT */ + *len = sizeof(*peercred); + get_peercred(sv[0], &peercred->uid, len); + printf("getsockopt(%d, %s, %p, [%d]) = %s\n", + sv[0], so_str(), &peercred->uid, *len, errstr); + + /* getsockopt optlen EFAULT */ + get_peercred(sv[0], peercred, len + 1); + printf("getsockopt(%d, %s, %p, %p) = %s\n", + sv[0], so_str(), peercred, len + 1, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/so_peercred.gen.test b/tests-m32/so_peercred.gen.test new file mode 100755 index 00000000..02eb4793 --- /dev/null +++ b/tests-m32/so_peercred.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (so_peercred -e trace=getsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt diff --git a/tests-m32/sock_filter-v-Xabbrev.c b/tests-m32/sock_filter-v-Xabbrev.c new file mode 100644 index 00000000..ac680e2c --- /dev/null +++ b/tests-m32/sock_filter-v-Xabbrev.c @@ -0,0 +1 @@ +#include "sock_filter-v.c" diff --git a/tests-m32/sock_filter-v-Xabbrev.gen.test b/tests-m32/sock_filter-v-Xabbrev.gen.test new file mode 100755 index 00000000..e52763fa --- /dev/null +++ b/tests-m32/sock_filter-v-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sock_filter-v-Xabbrev -v -e trace=getsockopt,setsockopt -X abbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=getsockopt,setsockopt -X abbrev diff --git a/tests-m32/sock_filter-v-Xraw.c b/tests-m32/sock_filter-v-Xraw.c new file mode 100644 index 00000000..e85309c1 --- /dev/null +++ b/tests-m32/sock_filter-v-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "sock_filter-v.c" diff --git a/tests-m32/sock_filter-v-Xraw.gen.test b/tests-m32/sock_filter-v-Xraw.gen.test new file mode 100755 index 00000000..3c7df814 --- /dev/null +++ b/tests-m32/sock_filter-v-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sock_filter-v-Xraw -a 37 -v -e trace=getsockopt,setsockopt -X raw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a 37 -v -e trace=getsockopt,setsockopt -X raw diff --git a/tests-m32/sock_filter-v-Xverbose.c b/tests-m32/sock_filter-v-Xverbose.c new file mode 100644 index 00000000..59d76bdf --- /dev/null +++ b/tests-m32/sock_filter-v-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "sock_filter-v.c" diff --git a/tests-m32/sock_filter-v-Xverbose.gen.test b/tests-m32/sock_filter-v-Xverbose.gen.test new file mode 100755 index 00000000..b58c5b51 --- /dev/null +++ b/tests-m32/sock_filter-v-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sock_filter-v-Xverbose -v -e trace=getsockopt,setsockopt -X verbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=getsockopt,setsockopt -X verbose diff --git a/tests-m32/sock_filter-v.c b/tests-m32/sock_filter-v.c new file mode 100644 index 00000000..ac483646 --- /dev/null +++ b/tests-m32/sock_filter-v.c @@ -0,0 +1,211 @@ +/* + * Check decoding of socket filters. + * + * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +/* SO_GET_FILTER was introduced by Linux commit v3.8-rc1~139^2~518 */ +#ifndef SO_GET_FILTER +# define SO_GET_FILTER SO_ATTACH_FILTER +#endif + +#define HEX_FMT "%#x" + +#if XLAT_RAW +# define XLAT_FMT HEX_FMT +# define XLAT_ARGS(a_) (a_) +#elif XLAT_VERBOSE +# define XLAT_FMT HEX_FMT " /* %s */" +# define XLAT_ARGS(a_) (a_), #a_ +#else +# define XLAT_FMT "%s" +# define XLAT_ARGS(a_) #a_ +#endif + +#define PRINT_STMT(pfx, code_fmt, k_fmt, ...) \ + printf("%sBPF_STMT(" code_fmt ", " k_fmt ")", pfx, __VA_ARGS__) + +#define PRINT_JUMP(pfx, code_fmt, k, jt, jf, ...) \ + printf("%sBPF_JUMP(" code_fmt ", %#x, %#x, %#x)", \ + pfx, __VA_ARGS__, k, jt, jf) + +static const struct sock_filter bpf_filter[] = { + BPF_STMT(BPF_LD|BPF_B|BPF_ABS, SKF_LL_OFF+4), + BPF_STMT(BPF_LD|BPF_B|BPF_ABS, SKF_NET_OFF+8), + BPF_STMT(BPF_LD|BPF_B|BPF_ABS, SKF_AD_OFF+SKF_AD_PROTOCOL), + BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, IPPROTO_UDP, 0, 5), + BPF_STMT(BPF_LD|BPF_W|BPF_LEN, 0), + BPF_JUMP(BPF_JMP|BPF_K|BPF_JGE, 100, 0, 3), + BPF_STMT(BPF_LD|BPF_B|BPF_ABS, 42), + BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, 'a', 0, 1), + BPF_STMT(BPF_RET|BPF_K, -1U), + BPF_STMT(BPF_RET|BPF_K, 0) +}; + +static void +print_filter(void) +{ + PRINT_STMT("[", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + XLAT_FMT "+4", + XLAT_ARGS(BPF_LD), XLAT_ARGS(BPF_B), XLAT_ARGS(BPF_ABS), + XLAT_ARGS(SKF_LL_OFF)); + PRINT_STMT(", ", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + XLAT_FMT "+8", + XLAT_ARGS(BPF_LD), XLAT_ARGS(BPF_B), XLAT_ARGS(BPF_ABS), + XLAT_ARGS(SKF_NET_OFF)); + PRINT_STMT(", ", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + XLAT_FMT "+" XLAT_FMT, + XLAT_ARGS(BPF_LD), XLAT_ARGS(BPF_B), XLAT_ARGS(BPF_ABS), + XLAT_ARGS(SKF_AD_OFF), XLAT_ARGS(SKF_AD_PROTOCOL)); + PRINT_JUMP(", ", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + IPPROTO_UDP, 0, 5, + XLAT_ARGS(BPF_JMP), XLAT_ARGS(BPF_K), XLAT_ARGS(BPF_JEQ)); + PRINT_STMT(", ", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + HEX_FMT, + XLAT_ARGS(BPF_LD), XLAT_ARGS(BPF_W), XLAT_ARGS(BPF_LEN), + 0); + PRINT_JUMP(", ", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + 100, 0, 3, + XLAT_ARGS(BPF_JMP), XLAT_ARGS(BPF_K), XLAT_ARGS(BPF_JGE)); + PRINT_STMT(", ", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + HEX_FMT, + XLAT_ARGS(BPF_LD), XLAT_ARGS(BPF_B), XLAT_ARGS(BPF_ABS), + 42); + PRINT_JUMP(", ", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + 'a', 0, 1, + XLAT_ARGS(BPF_JMP), XLAT_ARGS(BPF_K), XLAT_ARGS(BPF_JEQ)); + PRINT_STMT(", ", XLAT_FMT "|" XLAT_FMT, + HEX_FMT, + XLAT_ARGS(BPF_RET), XLAT_ARGS(BPF_K), + -1U); + PRINT_STMT(", ", XLAT_FMT "|" XLAT_FMT, + HEX_FMT, + XLAT_ARGS(BPF_RET), XLAT_ARGS(BPF_K), + 0); + putchar(']'); +} + +static const char *errstr; + +static int +get_filter(int fd, void *val, socklen_t *len) +{ + int rc = getsockopt(fd, SOL_SOCKET, SO_GET_FILTER, val, len); + errstr = sprintrc(rc); + return rc; +} + +static int +set_filter(int fd, void *val, socklen_t len) +{ + int rc = setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER, val, len); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + int rc; + struct sock_filter *const filter = + tail_memdup(bpf_filter, sizeof(bpf_filter)); + void *const efault = filter + ARRAY_SIZE(bpf_filter); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sock_fprog, prog); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); + + prog->len = ARRAY_SIZE(bpf_filter); + prog->filter = filter; + + int fd = socket(AF_INET, SOCK_DGRAM, 0); + if (fd < 0) + perror_msg_and_skip("socket AF_INET SOCK_DGRAM"); + + /* query sock_filter program length -> 0 */ + *len = BPF_MAXINSNS; + rc = get_filter(fd, NULL, len); + if (rc) + perror_msg_and_skip("getsockopt SOL_SOCKET SO_GET_FILTER"); + printf("getsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", NULL, [%u->0]) " + "= 0\n", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_GET_FILTER), + BPF_MAXINSNS); + + /* getsockopt NULL optlen - EFAULT */ + rc = get_filter(fd, NULL, NULL); + printf("getsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", NULL, NULL) " + "= %s\n", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_GET_FILTER), errstr); + + /* attach a filter */ + rc = set_filter(fd, prog, sizeof(*prog)); + if (rc) + perror_msg_and_skip("setsockopt SOL_SOCKET SO_ATTACH_FILTER"); + printf("setsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", {len=%u, filter=", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_ATTACH_FILTER), + prog->len); + print_filter(); + printf("}, %u) = 0\n", (unsigned int) sizeof(*prog)); + + /* setsockopt optlen is too small - EINVAL */ + rc = set_filter(fd, prog, sizeof(*prog) - 4); + printf("setsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", %p, %u) = %s\n", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_ATTACH_FILTER), prog, + (unsigned int) sizeof(*prog) - 4, errstr); + +#ifdef SO_ATTACH_REUSEPORT_CBPF + rc = setsockopt(fd, SOL_SOCKET, SO_ATTACH_REUSEPORT_CBPF, + prog, sizeof(*prog)); + errstr = sprintrc(rc); + printf("setsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", {len=%u, filter=", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_ATTACH_REUSEPORT_CBPF), + prog->len); + print_filter(); + printf("}, %u) = %s\n", (unsigned int) sizeof(*prog), errstr); +#endif + + /* query sock_filter program length -> ARRAY_SIZE(bpf_filter) */ + *len = 0; + rc = get_filter(fd, efault, len); + printf("getsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", %p, [0->%u]) " + "= %s\n", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_GET_FILTER), efault, + (unsigned int) ARRAY_SIZE(bpf_filter), errstr); + + /* getsockopt optlen is too small - EINVAL */ + *len = ARRAY_SIZE(bpf_filter) - 1; + rc = get_filter(fd, efault, len); + printf("getsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", %p, [%u]) = %s\n", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_GET_FILTER), efault, + (unsigned int) ARRAY_SIZE(bpf_filter) - 1, errstr); + + /* getsockopt optval EFAULT */ + *len = ARRAY_SIZE(bpf_filter); + rc = get_filter(fd, filter + 1, len); + printf("getsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", %p, [%u]) = %s\n", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_GET_FILTER), + filter + 1, (unsigned int) ARRAY_SIZE(bpf_filter), errstr); + + /* getsockopt optlen is too large - truncated */ + *len = ARRAY_SIZE(bpf_filter) + 1; + rc = get_filter(fd, filter, len); + printf("getsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", ", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_GET_FILTER)); + print_filter(); + printf(", [%u->%d]) = %s\n", + (unsigned int) ARRAY_SIZE(bpf_filter) + 1, *len, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/sock_filter-v.gen.test b/tests-m32/sock_filter-v.gen.test new file mode 100755 index 00000000..611c2de9 --- /dev/null +++ b/tests-m32/sock_filter-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sock_filter-v -v -e trace=getsockopt,setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=getsockopt,setsockopt diff --git a/tests-m32/sockaddr_xlat-Xabbrev.c b/tests-m32/sockaddr_xlat-Xabbrev.c new file mode 100644 index 00000000..e994e5ea --- /dev/null +++ b/tests-m32/sockaddr_xlat-Xabbrev.c @@ -0,0 +1 @@ +#include "sockaddr_xlat.c" diff --git a/tests-m32/sockaddr_xlat-Xabbrev.gen.test b/tests-m32/sockaddr_xlat-Xabbrev.gen.test new file mode 100755 index 00000000..efdf0ac7 --- /dev/null +++ b/tests-m32/sockaddr_xlat-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sockaddr_xlat-Xabbrev -Xabbrev -e trace=connect); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xabbrev -e trace=connect diff --git a/tests-m32/sockaddr_xlat-Xraw.c b/tests-m32/sockaddr_xlat-Xraw.c new file mode 100644 index 00000000..fb2d73df --- /dev/null +++ b/tests-m32/sockaddr_xlat-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "sockaddr_xlat.c" diff --git a/tests-m32/sockaddr_xlat-Xraw.gen.test b/tests-m32/sockaddr_xlat-Xraw.gen.test new file mode 100755 index 00000000..d5339a7b --- /dev/null +++ b/tests-m32/sockaddr_xlat-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sockaddr_xlat-Xraw -Xraw -e trace=connect); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xraw -e trace=connect diff --git a/tests-m32/sockaddr_xlat-Xverbose.c b/tests-m32/sockaddr_xlat-Xverbose.c new file mode 100644 index 00000000..d628975b --- /dev/null +++ b/tests-m32/sockaddr_xlat-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "sockaddr_xlat.c" diff --git a/tests-m32/sockaddr_xlat-Xverbose.gen.test b/tests-m32/sockaddr_xlat-Xverbose.gen.test new file mode 100755 index 00000000..bde087b1 --- /dev/null +++ b/tests-m32/sockaddr_xlat-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sockaddr_xlat-Xverbose -Xverbose -e trace=connect); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xverbose -e trace=connect diff --git a/tests-m32/sockaddr_xlat.c b/tests-m32/sockaddr_xlat.c new file mode 100644 index 00000000..b467c934 --- /dev/null +++ b/tests-m32/sockaddr_xlat.c @@ -0,0 +1,271 @@ +/* + * Check decoding of sockaddr fields under xlat styles. + * + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_BLUETOOTH_BLUETOOTH_H +# include +# include +# include +# include +# include +#endif + +static void +check_ll(void) +{ + struct sockaddr_ll c_ll = { + .sll_family = AF_PACKET, + .sll_protocol = htons(ETH_P_ALL), + .sll_ifindex = 0xfacefeed, + .sll_hatype = ARPHRD_ETHER, + .sll_pkttype = PACKET_HOST, + .sll_halen = sizeof(c_ll.sll_addr), + .sll_addr = "abcdefgh" + }; + unsigned int len = sizeof(c_ll); + int rc = connect(-1, (void *) &c_ll, len); + const char *errstr = sprintrc(rc); + +#if XLAT_RAW + printf("connect(-1, {sa_family=%#x, sll_protocol=", AF_PACKET); + print_quoted_hex(&c_ll.sll_protocol, sizeof(c_ll.sll_protocol)); + printf(", sll_ifindex=%u, sll_hatype=%#x" + ", sll_pkttype=%u, sll_halen=%u, sll_addr=" + "[%#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x]" + "}, %u) = %s\n", + c_ll.sll_ifindex, ARPHRD_ETHER, + PACKET_HOST, c_ll.sll_halen, + c_ll.sll_addr[0], c_ll.sll_addr[1], + c_ll.sll_addr[2], c_ll.sll_addr[3], + c_ll.sll_addr[4], c_ll.sll_addr[5], + c_ll.sll_addr[6], c_ll.sll_addr[7], + len, errstr); +#elif XLAT_VERBOSE + printf("connect(-1, {sa_family=%#x /* AF_PACKET */" + ", sll_protocol=", AF_PACKET); + print_quoted_hex(&c_ll.sll_protocol, sizeof(c_ll.sll_protocol)); + printf(" /* htons(ETH_P_ALL) */" + ", sll_ifindex=%u, sll_hatype=%#x /* ARPHRD_ETHER */" + ", sll_pkttype=%u /* PACKET_HOST */, sll_halen=%u, sll_addr=" + "[%#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x]" + "}, %u) = %s\n", + c_ll.sll_ifindex, ARPHRD_ETHER, + PACKET_HOST, c_ll.sll_halen, + c_ll.sll_addr[0], c_ll.sll_addr[1], + c_ll.sll_addr[2], c_ll.sll_addr[3], + c_ll.sll_addr[4], c_ll.sll_addr[5], + c_ll.sll_addr[6], c_ll.sll_addr[7], + len, errstr); + +#else /* XLAT_ABBREV */ + printf("connect(-1, {sa_family=AF_PACKET" + ", sll_protocol=htons(ETH_P_ALL)" + ", sll_ifindex=%u, sll_hatype=ARPHRD_ETHER" + ", sll_pkttype=PACKET_HOST, sll_halen=%u, sll_addr=" + "[%#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x]" + "}, %u) = %s\n", + c_ll.sll_ifindex, c_ll.sll_halen, + c_ll.sll_addr[0], c_ll.sll_addr[1], + c_ll.sll_addr[2], c_ll.sll_addr[3], + c_ll.sll_addr[4], c_ll.sll_addr[5], + c_ll.sll_addr[6], c_ll.sll_addr[7], + len, errstr); +#endif +} + +static void +check_in(void) +{ + const unsigned short h_port = 12345; + static const char h_addr[] = "127.0.0.1"; + struct sockaddr_in in = { + .sin_family = AF_INET, + .sin_port = htons(h_port), + .sin_addr.s_addr = inet_addr(h_addr) + }; + unsigned int len = sizeof(in); + int rc = connect(-1, (void *) &in, len); + const char * errstr = sprintrc(rc); +#if XLAT_RAW + printf("connect(-1, {sa_family=%#x, sin_port=", AF_INET); + print_quoted_hex((const void *) &in.sin_port, sizeof(in.sin_port)); + printf(", sin_addr="); + print_quoted_hex((const void *) &in.sin_addr.s_addr, + sizeof(in.sin_addr.s_addr)); + printf("}, %u) = %s\n", len, errstr); +#elif XLAT_VERBOSE + printf("connect(-1, {sa_family=%#x /* AF_INET */, sin_port=", AF_INET); + print_quoted_hex((const void *) &in.sin_port, sizeof(in.sin_port)); + printf(" /* htons(%hu) */, sin_addr=", h_port); + print_quoted_hex((const void *) &in.sin_addr.s_addr, + sizeof(in.sin_addr.s_addr)); + printf(" /* inet_addr(\"%s\") */}, %u) = %s\n", + h_addr, len, errstr); +#else /* XLAT_ABBREV */ + printf("connect(-1, {sa_family=AF_INET, sin_port=htons(%hu)" + ", sin_addr=inet_addr(\"%s\")}, %u) = %s\n", + h_port, h_addr, len, errstr); +#endif +} + +static void +validate_in6(struct sockaddr_in6 *const in6, const char *const h_addr) +{ + inet_pton(AF_INET6, h_addr, &in6->sin6_addr); + + unsigned int len = sizeof(*in6); + int rc = connect(-1, (void *) in6, len); + const char *errstr = sprintrc(rc); +#if XLAT_RAW + printf("connect(-1, {sa_family=%#x, sin6_port=", AF_INET6); + print_quoted_hex(&in6->sin6_port, sizeof(in6->sin6_port)); + printf(", sin6_flowinfo="); + print_quoted_hex(&in6->sin6_flowinfo, sizeof(in6->sin6_flowinfo)); + printf(", sin6_addr="); + print_quoted_hex(&in6->sin6_addr, sizeof(struct in6_addr)); + printf(", sin6_scope_id=%u}, %u) = %s\n", + in6->sin6_scope_id, len, errstr); +#elif XLAT_VERBOSE + printf("connect(-1, {sa_family=%#x /* AF_INET6 */", AF_INET6); + printf(", sin6_port="); + print_quoted_hex(&in6->sin6_port, sizeof(in6->sin6_port)); + printf(" /* htons(%hu) */", ntohs(in6->sin6_port)); + printf(", sin6_flowinfo="); + print_quoted_hex(&in6->sin6_flowinfo, sizeof(in6->sin6_flowinfo)); + printf(" /* htonl(%u) */", ntohl(in6->sin6_flowinfo)); + printf(", sin6_addr="); + print_quoted_hex(&in6->sin6_addr, sizeof(struct in6_addr)); + printf(" /* inet_pton(AF_INET6, \"%s\") */", h_addr); + printf(", sin6_scope_id=%u}, %u) = %s\n", + in6->sin6_scope_id, len, errstr); +#else + printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", sin6_flowinfo=htonl(%u)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" + ", sin6_scope_id=%u}, %u)" + " = %s\n", + ntohs(in6->sin6_port), ntohl(in6->sin6_flowinfo), + h_addr, in6->sin6_scope_id, len, errstr); +#endif +} + +static void +check_in6(void) +{ + struct sockaddr_in6 in6 = { + .sin6_family = AF_INET6, + .sin6_port = htons(12345), + .sin6_flowinfo = htonl(123456890), + .sin6_scope_id = 0xfacefeed + }; + + validate_in6(&in6, "12:34:56:78:90:ab:cd:ef"); + validate_in6(&in6, "::"); + validate_in6(&in6, "::1"); +} + +#ifdef HAVE_BLUETOOTH_BLUETOOTH_H +static void +check_sco(void) +{ + const struct sockaddr_sco c_sco = { + .sco_family = AF_BLUETOOTH, + .sco_bdaddr.b = "abcdef" + }; + void *sco = tail_memdup(&c_sco, sizeof(c_sco)); + unsigned int len = sizeof(c_sco); + int ret = connect(-1, sco, len); + const char *errstr = sprintrc(ret); +# if XLAT_RAW + printf("connect(-1, {sa_family=%#x, sco_bdaddr=", AF_BLUETOOTH); + print_quoted_hex((const void *) &c_sco.sco_bdaddr, + sizeof(c_sco.sco_bdaddr)); + printf("}, %u) = %s\n", len, errstr); +# elif XLAT_VERBOSE + printf("connect(-1, {sa_family=%#x /* AF_BLUETOOTH */" + ", sco_bdaddr=", AF_BLUETOOTH); + print_quoted_hex((const void *) &c_sco.sco_bdaddr, + sizeof(c_sco.sco_bdaddr)); + printf(" /* %02x:%02x:%02x:%02x:%02x:%02x */" + "}, %u) = %s\n", + c_sco.sco_bdaddr.b[0], c_sco.sco_bdaddr.b[1], + c_sco.sco_bdaddr.b[2], c_sco.sco_bdaddr.b[3], + c_sco.sco_bdaddr.b[4], c_sco.sco_bdaddr.b[5], + len, errstr); +# else + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", sco_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + "}, %u) = %s\n", + c_sco.sco_bdaddr.b[0], c_sco.sco_bdaddr.b[1], + c_sco.sco_bdaddr.b[2], c_sco.sco_bdaddr.b[3], + c_sco.sco_bdaddr.b[4], c_sco.sco_bdaddr.b[5], + len, errstr); +# endif +} + +static void +check_rc(void) +{ + const struct sockaddr_rc c_rc = { + .rc_family = AF_BLUETOOTH, + .rc_bdaddr.b = "abcdef", + .rc_channel = 42 + }; + void *rc = tail_memdup(&c_rc, sizeof(c_rc)); + unsigned int len = sizeof(c_rc); + int ret = connect(-1, rc, len); + const char *errstr = sprintrc(ret); +# if XLAT_RAW + printf("connect(-1, {sa_family=%#x, rc_bdaddr=", AF_BLUETOOTH); + print_quoted_hex((const void *) &c_rc.rc_bdaddr, + sizeof(c_rc.rc_bdaddr)); + printf(", rc_channel=%u}, %u) = %s\n", c_rc.rc_channel, len, errstr); +# elif XLAT_VERBOSE + printf("connect(-1, {sa_family=%#x /* AF_BLUETOOTH */" + ", rc_bdaddr=", AF_BLUETOOTH); + print_quoted_hex((const void *) &c_rc.rc_bdaddr, + sizeof(c_rc.rc_bdaddr)); + printf(" /* %02x:%02x:%02x:%02x:%02x:%02x */" + ", rc_channel=%u}, %u) = %s\n", + c_rc.rc_bdaddr.b[0], c_rc.rc_bdaddr.b[1], + c_rc.rc_bdaddr.b[2], c_rc.rc_bdaddr.b[3], + c_rc.rc_bdaddr.b[4], c_rc.rc_bdaddr.b[5], + c_rc.rc_channel, len, errstr); +# else + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", rc_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + ", rc_channel=%u}, %u) = %s\n", + c_rc.rc_bdaddr.b[0], c_rc.rc_bdaddr.b[1], + c_rc.rc_bdaddr.b[2], c_rc.rc_bdaddr.b[3], + c_rc.rc_bdaddr.b[4], c_rc.rc_bdaddr.b[5], + c_rc.rc_channel, len, errstr); +# endif +} +#endif /* HAVE_BLUETOOTH_BLUETOOTH_H */ + +int +main(void) +{ + check_ll(); + check_in(); + check_in6(); +#ifdef HAVE_BLUETOOTH_BLUETOOTH_H + check_sco(); + check_rc(); +#endif + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/socketcall.c b/tests-m32/socketcall.c index 4fe1ea3a..aa68a7eb 100644 --- a/tests-m32/socketcall.c +++ b/tests-m32/socketcall.c @@ -1,30 +1,10 @@ /* * Check decoding of socketcall syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/socketcall.gen.test b/tests-m32/socketcall.gen.test new file mode 100755 index 00000000..d18b0364 --- /dev/null +++ b/tests-m32/socketcall.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (socketcall -a20 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-m32/socketcall.test b/tests-m32/socketcall.test deleted file mode 100755 index 959bc83d..00000000 --- a/tests-m32/socketcall.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of socketcall syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 diff --git a/tests-m32/sockname.c b/tests-m32/sockname.c index c5072cac..cac4f4e2 100644 --- a/tests-m32/sockname.c +++ b/tests-m32/sockname.c @@ -2,29 +2,10 @@ * Check decoding of sockname family syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -41,9 +22,9 @@ # error TEST_SYSCALL_NAME must be defined #endif -#define TEST_SYSCALL_STR__(a) #a -#define TEST_SYSCALL_STR_(a) TEST_SYSCALL_STR__(a) -#define TEST_SYSCALL_STR TEST_SYSCALL_STR_(TEST_SYSCALL_NAME) +#ifndef TEST_SYSCALL_STR +# define TEST_SYSCALL_STR STRINGIFY_VAL(TEST_SYSCALL_NAME) +#endif #define TEST_SOCKET TEST_SYSCALL_STR ".socket" #ifdef TEST_SYSCALL_PREPARE @@ -74,7 +55,7 @@ static void test_sockname_syscall(const int fd) { - socklen_t *const plen = tail_alloc(sizeof(*plen)); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, plen); *plen = sizeof(struct sockaddr_un); struct sockaddr_un *addr = tail_alloc(*plen); diff --git a/tests-m32/sockopt-sol_netlink.c b/tests-m32/sockopt-sol_netlink.c new file mode 100644 index 00000000..a797a6f1 --- /dev/null +++ b/tests-m32/sockopt-sol_netlink.c @@ -0,0 +1,193 @@ +/* + * Check decoding of getsockopt and setsockopt for SOL_NETLINK level. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include "netlink.h" +#include + +#ifndef SOL_NETLINK +# define SOL_NETLINK 270 +#endif + +static int rc; +static const char *errstr; + +static int +get_sockopt(int fd, int name, void *val, socklen_t *len) +{ + rc = getsockopt(fd, SOL_NETLINK, name, val, len); + errstr = sprintrc(rc); + return rc; +} + +static int +set_sockopt(int fd, int name, void *val, socklen_t len) +{ + rc = setsockopt(fd, SOL_NETLINK, name, val, len); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const struct { + int val; + const char *str; + } names[] = { +#ifdef NETLINK_ADD_MEMBERSHIP + { ARG_STR(NETLINK_ADD_MEMBERSHIP) }, +#endif +#ifdef NETLINK_DROP_MEMBERSHIP + { ARG_STR(NETLINK_DROP_MEMBERSHIP) }, +#endif +#ifdef NETLINK_PKTINFO + { ARG_STR(NETLINK_PKTINFO) }, +#endif +#ifdef NETLINK_BROADCAST_ERROR + { ARG_STR(NETLINK_BROADCAST_ERROR) }, +#endif +#ifdef NETLINK_NO_ENOBUFS + { ARG_STR(NETLINK_NO_ENOBUFS) }, +#endif +#ifdef NETLINK_RX_RING + { ARG_STR(NETLINK_RX_RING) }, +#endif +#ifdef NETLINK_TX_RING + { ARG_STR(NETLINK_TX_RING) }, +#endif +#ifdef NETLINK_LISTEN_ALL_NSID + { ARG_STR(NETLINK_LISTEN_ALL_NSID) }, +#endif +#ifdef NETLINK_LIST_MEMBERSHIPS + { ARG_STR(NETLINK_LIST_MEMBERSHIPS) }, +#endif +#ifdef NETLINK_CAP_ACK + { ARG_STR(NETLINK_CAP_ACK) }, +#endif +#ifdef NETLINK_EXT_ACK + { ARG_STR(NETLINK_EXT_ACK) }, +#endif + }; + + TAIL_ALLOC_OBJECT_CONST_PTR(int, val); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); + void *const efault = val + 1; + int fd = socket(AF_NETLINK, SOCK_RAW, 0); + if (fd < 0) + perror_msg_and_skip("socket AF_NETLINK SOCK_RAW"); + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(names); ++i) { + /* getsockopt */ + + /* classic */ + *len = sizeof(*val); + get_sockopt(fd, names[i].val, val, len); + printf("getsockopt(%d, SOL_NETLINK, %s, ", fd, names[i].str); + if (rc) + printf("%p", val); + else + printf("[%d]", *val); + printf(", [%d]) = %s\n", *len, errstr); + + /* optlen larger than necessary - shortened */ + *len = sizeof(*val) + 1; + get_sockopt(fd, names[i].val, val, len); + printf("getsockopt(%d, SOL_NETLINK, %s, ", fd, names[i].str); + if (rc) + printf("%p", val); + else + printf("[%d]", *val); + printf(", [%d", (int) sizeof(*val) + 1); + if ((int) sizeof(*val) + 1 != *len) + printf("->%d", *len); + printf("]) = %s\n", errstr); + + /* zero optlen - print returned optlen */ + *len = 0; + get_sockopt(fd, names[i].val, NULL, len); + printf("getsockopt(%d, SOL_NETLINK, %s, NULL, [0", + fd, names[i].str); + if (*len) + printf("->%d", *len); + printf("]) = %s\n", errstr); + +#ifdef NETLINK_LIST_MEMBERSHIPS + if (names[i].val != NETLINK_LIST_MEMBERSHIPS) { +#endif + /* optlen shorter than necessary - print address */ + *len = sizeof(*val) - 1; + get_sockopt(fd, names[i].val, val, len); + printf("getsockopt(%d, SOL_NETLINK, %s, %p, [%d", + fd, names[i].str, val, (int) sizeof(*val) - 1); + if ((int) sizeof(*val) - 1 != *len) + printf("->%d", *len); + printf("]) = %s\n", errstr); +#ifdef NETLINK_LIST_MEMBERSHIPS + } else { + /* optlen shorter than required for the first element */ + *len = sizeof(*val) - 1; + get_sockopt(fd, names[i].val, efault, len); + printf("getsockopt(%d, SOL_NETLINK, %s, ", + fd, names[i].str); + if (rc) + printf("%p", efault); + else + printf("[]"); + printf(", [%d", (int) sizeof(*val) - 1); + if ((int) sizeof(*val) - 1 != *len) + printf("->%d", *len); + printf("]) = %s\n", errstr); + } +#endif + + /* optval EFAULT - print address */ + *len = sizeof(*val); + get_sockopt(fd, names[i].val, efault, len); + printf("getsockopt(%d, SOL_NETLINK, %s, %p, [%d]) = %s\n", + fd, names[i].str, efault, *len, errstr); + + /* optlen EFAULT - print address */ + get_sockopt(fd, names[i].val, val, len + 1); + printf("getsockopt(%d, SOL_NETLINK, %s, %p, %p) = %s\n", + fd, names[i].str, val, len + 1, errstr); + + /* setsockopt */ + + /* classic */ + *val = 0xdefaced; + set_sockopt(fd, names[i].val, val, sizeof(*val)); + printf("setsockopt(%d, SOL_NETLINK, %s, [%d], %d) = %s\n", + fd, names[i].str, *val, (int) sizeof(*val), errstr); + + /* optlen larger than necessary - shortened */ + set_sockopt(fd, names[i].val, val, sizeof(*val) + 1); + printf("setsockopt(%d, SOL_NETLINK, %s, [%d], %d) = %s\n", + fd, names[i].str, *val, (int) sizeof(*val) + 1, errstr); + + /* optlen < 0 - print address */ + set_sockopt(fd, names[i].val, val, -1U); + printf("setsockopt(%d, SOL_NETLINK, %s, %p, -1) = %s\n", + fd, names[i].str, val, errstr); + + /* optlen smaller than necessary - print address */ + set_sockopt(fd, names[i].val, val, sizeof(*val) - 1); + printf("setsockopt(%d, SOL_NETLINK, %s, %p, %d) = %s\n", + fd, names[i].str, val, (int) sizeof(*val) - 1, errstr); + + /* optval EFAULT - print address */ + set_sockopt(fd, names[i].val, efault, sizeof(*val)); + printf("setsockopt(%d, SOL_NETLINK, %s, %p, %d) = %s\n", + fd, names[i].str, efault, (int) sizeof(*val), errstr); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/sockopt-sol_netlink.gen.test b/tests-m32/sockopt-sol_netlink.gen.test new file mode 100755 index 00000000..a2ba06dd --- /dev/null +++ b/tests-m32/sockopt-sol_netlink.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sockopt-sol_netlink -e trace=getsockopt,setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt,setsockopt diff --git a/tests-m32/sockopt-timestamp.c b/tests-m32/sockopt-timestamp.c new file mode 100644 index 00000000..c2659925 --- /dev/null +++ b/tests-m32/sockopt-timestamp.c @@ -0,0 +1,197 @@ +/* + * Check decoding of timestamp control messages. + * + * Copyright (c) 2019 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +#if defined HAVE_STRUCT___KERNEL_SOCK_TIMEVAL \ + || defined HAVE_STRUCT___KERNEL_TIMESPEC +# include +#endif + +#define XLAT_MACROS_ONLY +#include "xlat/sock_options.h" +#undef XLAT_MACROS_ONLY + +static void +print_timestamp_old(const struct cmsghdr *c) +{ + const void *cmsg_header = c; + const void *cmsg_data = CMSG_DATA(c); + const struct timeval *tv = cmsg_data; + const unsigned int expected_len = sizeof(*tv); + const unsigned int data_len = c->cmsg_len - (cmsg_data - cmsg_header); + + if (expected_len != data_len) + perror_msg_and_fail("sizeof(struct timeval) = %u" + ", data_len = %u\n", + expected_len, data_len); + printf("{tv_sec=%lld, tv_usec=%lld}", + (long long) tv->tv_sec, (long long) tv->tv_usec); +} + +static void +print_timestampns_old(const struct cmsghdr *c) +{ + const void *cmsg_header = c; + const void *cmsg_data = CMSG_DATA(c); + const struct timespec *ts = cmsg_data; + const unsigned int expected_len = sizeof(*ts); + const unsigned int data_len = c->cmsg_len - (cmsg_data - cmsg_header); + + if (expected_len != data_len) + perror_msg_and_fail("sizeof(struct timespec) = %u" + ", data_len = %u\n", + expected_len, data_len); + printf("{tv_sec=%lld, tv_nsec=%lld}", + (long long) ts->tv_sec, (long long) ts->tv_nsec); +} + +#ifdef HAVE_STRUCT___KERNEL_SOCK_TIMEVAL +static void +print_timestamp_new(const struct cmsghdr *c) +{ + const void *cmsg_header = c; + const void *cmsg_data = CMSG_DATA(c); + const struct __kernel_sock_timeval *tv = cmsg_data; + const unsigned int expected_len = sizeof(*tv); + const unsigned int data_len = c->cmsg_len - (cmsg_data - cmsg_header); + + if (expected_len != data_len) + perror_msg_and_fail("sizeof(struct __kernel_sock_timeval) = %u" + ", data_len = %u\n", + expected_len, data_len); + printf("{tv_sec=%lld, tv_usec=%lld}", + (long long) tv->tv_sec, (long long) tv->tv_usec); +} +#endif /* HAVE_STRUCT___KERNEL_SOCK_TIMEVAL */ + +#ifdef HAVE_STRUCT___KERNEL_TIMESPEC +static void +print_timestampns_new(const struct cmsghdr *c) +{ + const void *cmsg_header = c; + const void *cmsg_data = CMSG_DATA(c); + const struct __kernel_timespec *ts = cmsg_data; + const unsigned int expected_len = sizeof(*ts); + const unsigned int data_len = c->cmsg_len - (cmsg_data - cmsg_header); + + if (expected_len != data_len) + perror_msg_and_fail("sizeof(struct __kernel_timespec) = %u" + ", data_len = %u\n", + expected_len, data_len); + printf("{tv_sec=%lld, tv_nsec=%lld}", + (long long) ts->tv_sec, (long long) ts->tv_nsec); +} +#endif /* HAVE_STRUCT___KERNEL_TIMESPEC */ + +static unsigned int +test_sockopt(int so_val, const char *str, void (*fun)(const struct cmsghdr *)) +{ + static const char data[] = "socketpair"; + const size_t size = sizeof(data) - 1; + + int sv[2]; + if (socketpair(AF_UNIX, SOCK_DGRAM, 0, sv)) + perror_msg_and_skip(data); + + const int opt_1 = 1; + if (setsockopt(sv[0], SOL_SOCKET, so_val, &opt_1, sizeof(opt_1))) { + perror(str); + return 0; + } + + if (send(sv[1], data, size, 0) != (int) size) + perror_msg_and_fail("send"); + if (close(sv[1])) + perror_msg_and_fail("close send"); + + char buf[size]; + struct iovec iov = { + .iov_base = buf, + .iov_len = sizeof(buf) + }; + struct cmsghdr control[16]; + struct msghdr mh = { + .msg_iov = &iov, + .msg_iovlen = 1, + .msg_control = control, + .msg_controllen = sizeof(control) + }; + + if (recvmsg(sv[0], &mh, 0) != (int) size) + perror_msg_and_fail("recvmsg"); + if (close(sv[0])) + perror_msg_and_fail("close recv"); + + printf("recvmsg(%d, {msg_name=NULL, msg_namelen=0" + ", msg_iov=[{iov_base=\"%s\", iov_len=%u}], msg_iovlen=1", + sv[0], data, (unsigned int) size); + + unsigned int tested = 0; + if (mh.msg_controllen) { + printf(", msg_control=["); + for (struct cmsghdr *c = CMSG_FIRSTHDR(&mh); c; + c = CMSG_NXTHDR(&mh, c)) { + printf("%s{cmsg_len=%lu, cmsg_level=", + (c == control ? "" : ", "), + (unsigned long) c->cmsg_len); + if (c->cmsg_level == SOL_SOCKET) { + printf("SOL_SOCKET"); + } else { + printf("%d", c->cmsg_level); + } + printf(", cmsg_type="); + if (c->cmsg_type == so_val) { + printf("%s, cmsg_data=", str); + fun(c); + tested = 1; + } else { + printf("%d", c->cmsg_type); + } + printf("}"); + } + printf("]"); + } + printf(", msg_controllen=%lu, msg_flags=0}, 0) = %u\n", + (unsigned long) mh.msg_controllen, (unsigned int) size); + + return tested; +} + +int +main(void) +{ + static const struct { + int val; + const char *str; + void (*fun)(const struct cmsghdr *); + } tests[] = { + { SO_TIMESTAMP_OLD, "SO_TIMESTAMP_OLD", print_timestamp_old }, + { SO_TIMESTAMPNS_OLD, "SO_TIMESTAMPNS_OLD", print_timestampns_old }, +#ifdef HAVE_STRUCT___KERNEL_SOCK_TIMEVAL + { SO_TIMESTAMP_NEW, "SO_TIMESTAMP_NEW", print_timestamp_new }, +#endif +#ifdef HAVE_STRUCT___KERNEL_TIMESPEC + { SO_TIMESTAMPNS_NEW, "SO_TIMESTAMPNS_NEW", print_timestampns_new }, +#endif + }; + unsigned int tested = 0; + for (unsigned int i = 0; i < ARRAY_SIZE(tests); ++i) + tested |= test_sockopt(tests[i].val, + tests[i].str, + tests[i].fun); + if (!tested) + return 77; + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/sockopt-timestamp.gen.test b/tests-m32/sockopt-timestamp.gen.test new file mode 100755 index 00000000..a71ca4c4 --- /dev/null +++ b/tests-m32/sockopt-timestamp.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sockopt-timestamp -e trace=recvmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=recvmsg diff --git a/tests-m32/splice.c b/tests-m32/splice.c index b6f25256..2acdde7f 100644 --- a/tests-m32/splice.c +++ b/tests-m32/splice.c @@ -2,29 +2,10 @@ * This file is part of splice strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,8 +21,8 @@ main(void) { const long int fd_in = (long int) 0xdeadbeefffffffffULL; const long int fd_out = (long int) 0xdeadbeeffffffffeULL; - long long int *const off_in = tail_alloc(sizeof(*off_in)); - long long int *const off_out = tail_alloc(sizeof(*off_out)); + TAIL_ALLOC_OBJECT_CONST_PTR(long long int, off_in); + TAIL_ALLOC_OBJECT_CONST_PTR(long long int, off_out); *off_in = 0xdeadbef1facefed1ULL; *off_out = 0xdeadbef2facefed2ULL; const size_t len = (size_t) 0xdeadbef3facefed3ULL; diff --git a/tests-m32/splice.gen.test b/tests-m32/splice.gen.test new file mode 100755 index 00000000..75660806 --- /dev/null +++ b/tests-m32/splice.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (splice ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/splice.test b/tests-m32/splice.test deleted file mode 100755 index cc5c327e..00000000 --- a/tests-m32/splice.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check splice syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/sprintrc.c b/tests-m32/sprintrc.c index 7423afb6..5266ef18 100644 --- a/tests-m32/sprintrc.c +++ b/tests-m32/sprintrc.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -54,9 +35,6 @@ sprintrc_ex(long rc, enum sprintrc_fmt fmt) }; static char buf[4096]; - if (fmt >= ARRAY_SIZE(formats)) - perror_msg_and_fail("sprintrc_ex: incorrect format provided"); - if (rc == 0) return "0"; diff --git a/tests-m32/stack-fcall-0.c b/tests-m32/stack-fcall-0.c index 12a260de..8a26a79c 100644 --- a/tests-m32/stack-fcall-0.c +++ b/tests-m32/stack-fcall-0.c @@ -1,4 +1,11 @@ -int f1(int i); +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "stack-fcall.h" int f0(int i) { diff --git a/tests-m32/stack-fcall-1.c b/tests-m32/stack-fcall-1.c index 8716702d..b5cd89b3 100644 --- a/tests-m32/stack-fcall-1.c +++ b/tests-m32/stack-fcall-1.c @@ -1,4 +1,11 @@ -int f2(int i); +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "stack-fcall.h" int f1(int i) { diff --git a/tests-m32/stack-fcall-2.c b/tests-m32/stack-fcall-2.c index 19f8cf83..16beee58 100644 --- a/tests-m32/stack-fcall-2.c +++ b/tests-m32/stack-fcall-2.c @@ -1,4 +1,11 @@ -int f3(int i); +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "stack-fcall.h" int f2(int i) { diff --git a/tests-m32/stack-fcall-3.c b/tests-m32/stack-fcall-3.c index 3af1667f..538b6565 100644 --- a/tests-m32/stack-fcall-3.c +++ b/tests-m32/stack-fcall-3.c @@ -1,6 +1,23 @@ +/* + * Copyright (c) 2014-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include #include +#include "stack-fcall.h" + int f3(int i) { - return getpid() + i; + switch (i) { + case 1: + return kill(getpid(), SIGURG); + + default: + return chdir("") + i; + } + } diff --git a/tests-m32/stack-fcall-mangled-0.c b/tests-m32/stack-fcall-mangled-0.c new file mode 100644 index 00000000..47549401 --- /dev/null +++ b/tests-m32/stack-fcall-mangled-0.c @@ -0,0 +1,2 @@ +#define MANGLE +#include "stack-fcall-0.c" diff --git a/tests-m32/stack-fcall-mangled-1.c b/tests-m32/stack-fcall-mangled-1.c new file mode 100644 index 00000000..492c562b --- /dev/null +++ b/tests-m32/stack-fcall-mangled-1.c @@ -0,0 +1,2 @@ +#define MANGLE +#include "stack-fcall-1.c" diff --git a/tests-m32/stack-fcall-mangled-2.c b/tests-m32/stack-fcall-mangled-2.c new file mode 100644 index 00000000..eb7c3624 --- /dev/null +++ b/tests-m32/stack-fcall-mangled-2.c @@ -0,0 +1,2 @@ +#define MANGLE +#include "stack-fcall-2.c" diff --git a/tests-m32/stack-fcall-mangled-3.c b/tests-m32/stack-fcall-mangled-3.c new file mode 100644 index 00000000..98f738b4 --- /dev/null +++ b/tests-m32/stack-fcall-mangled-3.c @@ -0,0 +1,2 @@ +#define MANGLE +#include "stack-fcall-3.c" diff --git a/tests-m32/stack-fcall-mangled.c b/tests-m32/stack-fcall-mangled.c new file mode 100644 index 00000000..67862059 --- /dev/null +++ b/tests-m32/stack-fcall-mangled.c @@ -0,0 +1,2 @@ +#define MANGLE +#include "stack-fcall.c" diff --git a/tests-m32/stack-fcall.c b/tests-m32/stack-fcall.c index 134d54f6..cf4000e5 100644 --- a/tests-m32/stack-fcall.c +++ b/tests-m32/stack-fcall.c @@ -1,7 +1,15 @@ -int f0(int i); +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ -int main(int argc, char** argv) +#include "stack-fcall.h" + +int main(void) { - f0(argc); + f0(0); + f0(1); return 0; } diff --git a/tests-m32/stack-fcall.h b/tests-m32/stack-fcall.h new file mode 100644 index 00000000..cca0f94f --- /dev/null +++ b/tests-m32/stack-fcall.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifdef MANGLE + +# define f0 _ZN2ns2f0Ei +# define f1 _ZN2ns2f1Ei +# define f2 _ZN2ns2f2Ei +# define f3 _ZN2ns2f3Ei + +#endif + +int f0(int i); +int f1(int i); +int f2(int i); +int f3(int i); diff --git a/tests-m32/stat.c b/tests-m32/stat.c index d4ca7b0b..8c8daad1 100644 --- a/tests-m32/stat.c +++ b/tests-m32/stat.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/stat.gen.test b/tests-m32/stat.gen.test new file mode 100755 index 00000000..13ccd0b8 --- /dev/null +++ b/tests-m32/stat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (stat -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests-m32/stat.test b/tests-m32/stat.test deleted file mode 100755 index ba8938c0..00000000 --- a/tests-m32/stat.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check stat syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests-m32/stat64.c b/tests-m32/stat64.c index 782de33d..12ded432 100644 --- a/tests-m32/stat64.c +++ b/tests-m32/stat64.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/stat64.gen.test b/tests-m32/stat64.gen.test new file mode 100755 index 00000000..f49df37a --- /dev/null +++ b/tests-m32/stat64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (stat64 -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests-m32/stat64.test b/tests-m32/stat64.test deleted file mode 100755 index abcfb9ec..00000000 --- a/tests-m32/stat64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check stat64 syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests-m32/statfs.c b/tests-m32/statfs.c index 6032a668..5672a7fc 100644 --- a/tests-m32/statfs.c +++ b/tests-m32/statfs.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2014-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/statfs.expected b/tests-m32/statfs.expected deleted file mode 100644 index 11e9f0b1..00000000 --- a/tests-m32/statfs.expected +++ /dev/null @@ -1 +0,0 @@ -statfs(64)?\("/proc/self/status"(, [1-9][0-9]*)?, \{f_type=PROC_SUPER_MAGIC, f_bsize=[1-9][0-9]*, f_blocks=[0-9]+, f_bfree=[0-9]+, f_bavail=[0-9]+, f_files=[0-9]+, f_ffree=[0-9]+, f_fsid=\{val=\[[0-9]+, [0-9]+\]\}, f_namelen=[1-9][0-9]*(, f_frsize=[0-9]+)?(, f_flags=ST_VALID(\|ST_[A-Z]+)*)?\}\) += 0 diff --git a/tests-m32/statfs.gen.test b/tests-m32/statfs.gen.test new file mode 100755 index 00000000..32204a14 --- /dev/null +++ b/tests-m32/statfs.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (statfs -a17 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-m32/statfs.test b/tests-m32/statfs.test deleted file mode 100755 index 6075576f..00000000 --- a/tests-m32/statfs.test +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# Check statfs syscall decoding. - -. "${srcdir=.}/init.sh" - -# this test probes /proc/self/status -[ -f /proc/self/status ] || - framework_skip_ '/proc/self/status is not available' - -run_strace_match_diff -a17 diff --git a/tests-m32/statfs64.c b/tests-m32/statfs64.c index f46e7670..1e0a4b24 100644 --- a/tests-m32/statfs64.c +++ b/tests-m32/statfs64.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/statfs64.gen.test b/tests-m32/statfs64.gen.test new file mode 100755 index 00000000..8f6f06f7 --- /dev/null +++ b/tests-m32/statfs64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (statfs64 -a23 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 diff --git a/tests-m32/statfs64.test b/tests-m32/statfs64.test deleted file mode 100755 index 9c0aa278..00000000 --- a/tests-m32/statfs64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check statfs64 syscall decoding. - -. "${srcdir=.}/statfs.test" diff --git a/tests-m32/statx.c b/tests-m32/statx.c new file mode 100644 index 00000000..c5e86ad2 --- /dev/null +++ b/tests-m32/statx.c @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_statx + +# include +# include "xlat.h" +# include "xlat/statx_masks.h" +# include "xlat/statx_attrs.h" +# include "xlat/at_statx_sync_types.h" + +# define IS_STATX 1 +# define TEST_SYSCALL_STR "statx" +# define STRUCT_STAT struct statx +# define STRUCT_STAT_STR "struct statx" +# define STRUCT_STAT_IS_STAT64 0 + +static unsigned TEST_SYSCALL_STATX_FLAGS = AT_STATX_SYNC_AS_STAT; +static const char *TEST_SYSCALL_STATX_FLAGS_STR = "AT_STATX_SYNC_AS_STAT"; +static unsigned TEST_SYSCALL_STATX_MASK = STATX_ALL; +static const char *TEST_SYSCALL_STATX_MASK_STR = "STATX_ALL"; + +# define TEST_SYSCALL_INVOKE(sample, pst) \ + syscall(__NR_statx, AT_FDCWD, sample, TEST_SYSCALL_STATX_FLAGS, \ + TEST_SYSCALL_STATX_MASK, pst) +# define PRINT_SYSCALL_HEADER(sample) \ + do { \ + int saved_errno = errno; \ + printf("%s(AT_FDCWD, \"%s\", %s, %s, ", \ + TEST_SYSCALL_STR, sample, TEST_SYSCALL_STATX_FLAGS_STR, \ + TEST_SYSCALL_STATX_MASK_STR) +# define PRINT_SYSCALL_FOOTER(rc) \ + errno = saved_errno; \ + printf(") = %s\n", sprintrc(rc)); \ + } while (0) + +# include "xstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_statx") + +#endif diff --git a/tests-m32/statx.gen.test b/tests-m32/statx.gen.test new file mode 100755 index 00000000..bff3e3f2 --- /dev/null +++ b/tests-m32/statx.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (statx -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests-m32/statx.sh b/tests-m32/statx.sh deleted file mode 100755 index a630193d..00000000 --- a/tests-m32/statx.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of stat family syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -P $NAME.sample -P /dev/full -a32 diff --git a/tests-m32/strace-C.test b/tests-m32/strace-C.test index ccca9a09..5d3e37dc 100755 --- a/tests-m32/strace-C.test +++ b/tests-m32/strace-C.test @@ -1,9 +1,14 @@ #!/bin/sh - +# # Check -C option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./sleep 0 -run_strace -a24 -C -enanosleep ./sleep 1 +run_prog ../sleep 0 +run_strace -a24 -C -enanosleep ../sleep 1 match_grep diff --git a/tests-m32/strace-E.expected b/tests-m32/strace-E.expected index d7823b7a..3ae2c28e 100644 --- a/tests-m32/strace-E.expected +++ b/tests-m32/strace-E.expected @@ -1 +1 @@ -execve\("\./sleep", \["\./sleep", "0"\], \[.*"option_E_var=OPTION_E_VAL".*\]\) = 0 +execve\("\.\./sleep", \["\.\./sleep", "0"\], \[.*"option_E_var=OPTION_E_VAL".*\]\) = 0 diff --git a/tests-m32/strace-E.test b/tests-m32/strace-E.test index d76ec3f5..82b95df5 100755 --- a/tests-m32/strace-E.test +++ b/tests-m32/strace-E.test @@ -1,9 +1,14 @@ #!/bin/sh - +# # Check -E option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./sleep 0 > /dev/null +run_prog ../sleep 0 > /dev/null run_strace -E option_E_var=OPTION_E_VAL -v $args match_grep diff --git a/tests-m32/strace-S.test b/tests-m32/strace-S.test index 3ea315ce..4b5be6d9 100755 --- a/tests-m32/strace-S.test +++ b/tests-m32/strace-S.test @@ -1,10 +1,15 @@ #!/bin/sh - +# # Check -S option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./readv > /dev/null +run_prog ../readv > /dev/null test_c() { @@ -13,7 +18,7 @@ test_c() sortopts="$1"; shift sedexpr="$1"; shift - run_strace -c -w -S "$sortby" ./readv > /dev/null + run_strace -c -w -S "$sortby" ../readv > /dev/null sed -r -n -e "$sedexpr" < "$LOG" > "$OUT" [ -s "$OUT" ] || @@ -28,5 +33,3 @@ test_c() c='[[:space:]]+([^[:space:]]+)' test_c calls '-n -r' '/^[[:space:]]+[0-9]/ s/^'"$c$c$c$c"'[[:space:]].*/\4/p' test_c name '' '/^[[:space:]]+[0-9]/ s/^'"$c$c$c$c"'([[:space:]]+[0-9]+)?'"$c"'$/\6/p' - -rm -f "$OUT" diff --git a/tests-m32/strace-T.test b/tests-m32/strace-T.test index 7ab84a74..7c3136b7 100755 --- a/tests-m32/strace-T.test +++ b/tests-m32/strace-T.test @@ -1,9 +1,14 @@ #!/bin/sh - +# # Check -T option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./sleep 0 -run_strace -a24 -T -enanosleep ./sleep 1 +run_prog ../sleep 0 +run_strace -a24 -T -enanosleep ../sleep 1 match_grep diff --git a/tests-m32/strace-V.test b/tests-m32/strace-V.test index 9a051e00..a0274c28 100755 --- a/tests-m32/strace-V.test +++ b/tests-m32/strace-V.test @@ -8,17 +8,62 @@ year="$(date +%Y)" run_strace -V > "$LOG" -getval() +getstr() { - sed -r -n 's/#define[[:space:]]*'"$1"'[[:space:]]*"([^"]*)".*/\1/p' ../config.h + sed -r -n 's/#define[[:space:]]*'"$1"'[[:space:]]*"([^"]*)".*/\1/p' \ + ../../config.h } +# getoption OPTION YES_STRING [NO_STRING] +# +# Returns YES_STRING in case OPTION is enabled (present in config.h and has +# a non-zero numeric value). Otherwise, NO_STRING (or empty string, if not +# specified) is returned. +getoption() +{ + local opt + opt=$(sed -r -n 's/#define[[:space:]]*'"$1"'[[:space:]]*([0-9]+)$/\1/p' \ + ../../config.h) + if [ -n "$opt" -a "$opt" -ne 0 ]; then + printf "%s" "$2" + else + printf "%s" "${3-}" + fi +} + +config_year=$(getstr COPYRIGHT_YEAR) + +[ "$year" -ge "$config_year" ] && [ "$config_year" -ge 2017 ] || { + echo >&2 "The year derived from config.h (${config_year}) does not pass sanity checks." + exit 1 +} + +option_unwind=$(getoption ENABLE_STACKTRACE \ + " stack-trace=$(getstr USE_UNWINDER)") +option_demangle=$(getoption USE_DEMANGLE " stack-demangle") + +option_m32= +option_mx32= +case "$STRACE_NATIVE_ARCH" in +x86_64) + option_m32=$(getoption HAVE_M32_MPERS ' m32-mpers' ' no-m32-mpers') + option_mx32=$(getoption HAVE_MX32_MPERS ' mx32-mpers' ' no-mx32-mpers') + ;; +aarch64|powerpc64|riscv|s390x|sparc64|tile|x32) + option_m32=$(getoption HAVE_M32_MPERS ' m32-mpers' ' no-m32-mpers') + ;; +esac + +features="${option_unwind}${option_demangle}${option_m32}${option_mx32}" +[ -n "$features" ] || features=" (none)" + cat > "$EXP" << __EOF__ -$(getval PACKAGE_NAME) -- version $(getval PACKAGE_VERSION) -Copyright (C) 1991-$year The strace developers <$(getval PACKAGE_URL)>. +$(getstr PACKAGE_NAME) -- version $(getstr PACKAGE_VERSION) +Copyright (c) 1991-${config_year} The strace developers <$(getstr PACKAGE_URL)>. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +Optional features enabled:${features} __EOF__ -match_diff "$EXP" "$LOG" -rm -f "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests-m32/strace-ff.test b/tests-m32/strace-ff.test index 2ce06f19..429549f2 100755 --- a/tests-m32/strace-ff.test +++ b/tests-m32/strace-ff.test @@ -1,13 +1,18 @@ #!/bin/sh - +# # Check -ff option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog_skip_if_failed \ kill -0 $$ -./set_ptracer_any ./sleep 1 > "$OUT" & +../set_ptracer_any ../sleep 3 > "$OUT" & tracee_pid=$! while ! [ -s "$OUT" ]; do @@ -15,7 +20,6 @@ while ! [ -s "$OUT" ]; do fail_ 'set_ptracer_any sleep failed' done -rm -f "$LOG".* run_strace -a14 -eexit_group -ff -p $tracee_pid # check that output matches @@ -25,5 +29,3 @@ match_diff "$LOG.$tracee_pid" set -- "$LOG".* [ "$LOG.$tracee_pid" = "$*" ] || fail_ "too many output files: $*" - -rm -f "$OUT" "$LOG.$tracee_pid" diff --git a/tests-m32/strace-k-demangle.expected b/tests-m32/strace-k-demangle.expected new file mode 100644 index 00000000..c1b48037 --- /dev/null +++ b/tests-m32/strace-k-demangle.expected @@ -0,0 +1,2 @@ +^chdir .*(__kernel_vsyscall )?(__)?chdir ns::f3\(int\) ns::f2\(int\) ns::f1\(int\) ns::f0\(int\) main +^SIGURG .*(__kernel_vsyscall )?(__)?kill ns::f3\(int\) ns::f2\(int\) ns::f1\(int\) ns::f0\(int\) main diff --git a/tests-m32/strace-k-demangle.test b/tests-m32/strace-k-demangle.test new file mode 100755 index 00000000..3789d0ea --- /dev/null +++ b/tests-m32/strace-k-demangle.test @@ -0,0 +1,12 @@ +#!/bin/sh +# +# Check strace -k symbol names demangling. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +test_prog=../stack-fcall-mangled + +. "${srcdir=.}"/strace-k.test diff --git a/tests-m32/strace-k.expected b/tests-m32/strace-k.expected new file mode 100644 index 00000000..e40c339e --- /dev/null +++ b/tests-m32/strace-k.expected @@ -0,0 +1,2 @@ +^chdir .*(__kernel_vsyscaln )?(__)?chdir f3 f2 f1 f0 main +^SIGURG .*(__kernel_vsyscaln )?(__)?kill f3 f2 f1 f0 main diff --git a/tests-m32/strace-k.test b/tests-m32/strace-k.test index d5e8ed2b..7a323431 100755 --- a/tests-m32/strace-k.test +++ b/tests-m32/strace-k.test @@ -4,29 +4,10 @@ # # Copyright (c) 2014 Masatake YAMATO # Copyright (c) 2014-2016 Dmitry V. Levin +# Copyright (c) 2014-2019 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -34,20 +15,66 @@ [ -f /proc/self/maps ] || framework_skip_ '/proc/self/maps is not available' +check_prog grep check_prog sed check_prog tr -run_prog ./stack-fcall -run_strace -e getpid -k $args +run_prog "${test_prog=../stack-fcall}" +run_strace -e chdir -k $args -expected='getpid f3 f2 f1 f0 main ' -result=$(sed -r -n '1,/\(main\+0x[a-f0-9]+\) .*/ s/^.*\(([^+]+)\+0x[a-f0-9]+\) .*/\1/p' "$LOG" | - tr '\n' ' ') +expected="$srcdir/$NAME.expected" +awk ' +/^[^ ]/ { + if (out != "") + print out -test "$result" = "$expected" || { - echo "expected: \"$expected\"" - echo "result: \"$result\"" - dump_log_and_fail_with "$STRACE $args output mismatch" + syscall = gensub(/^([[:alnum:]_]+)\(.*/, "\\1", 1) + signal = gensub(/^--- ([A-Z]+) .*/, "\\1", 1) + + if (syscall != $0) { + out = syscall + stop = 0 + } else if (signal != $0) { + out = signal + stop = 0 + } else { + out = "" + } } -exit 0 +/^ >[^(]+\(([^+]+)\+0x[a-f0-9]+\) / && !stop { + sym = gensub(/^ >[^(]+\(([^+]+)\+0x[a-f0-9]+\) .*$/, "\\1", 1) + out = out " " sym + if (sym == "main") + stop = 1 +}' "$LOG" > "$OUT" + +LC_ALL=C grep -E -x -f "$expected" < "$OUT" > /dev/null || { + cat >&2 <<__EOF__ +Failed pattern of expected output: +$(cat "$expected") +Actual output: +$(cat "$OUT") +__EOF__ + + pattern= + case "$STRACE_ARCH" in + aarch64|i386|ppc*|s390*|sparc*|x32|x86*) + # These architectures are supported by elfutils libdw, + # see grep '\.*\' elfutils/backends + ;; + arm) pattern='No DWARF information found' + # This is also supported by elfutils libdw + # but the latter needs debuginfo for unwinding. + ;; + *) pattern='Unwinding not supported for this architecture' + ;; + esac + if [ -n "$pattern" ] && + LC_ALL=C grep -x " > $pattern" < "$LOG" > /dev/null; then + cat < "$LOG" >&2 + skip_ "stack tracing is not fully supported on $STRACE_ARCH yet" + fi + + dump_log_and_fail_with "$STRACE $args output mismatch" +} diff --git a/tests-m32/strace-log-merge-error.test b/tests-m32/strace-log-merge-error.test new file mode 100755 index 00000000..35a2de82 --- /dev/null +++ b/tests-m32/strace-log-merge-error.test @@ -0,0 +1,37 @@ +#!/bin/sh +# +# Check strace-log-merge error diagnostics. +# +# Copyright (c) 2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +rm -f -- "$LOG".[0-9]* +echo "strace-log-merge: $LOG: strace output not found" > "$EXP" + +check_strace_log_merge() +{ + "$srcdir"/../strace-log-merge "$LOG" > "$OUT" 2> "$LOG" + rc=$? + + [ $rc -gt 0 ] || + dump_log_and_fail_with 'strace-log-merge unexpectedly succeeded' + + [ ! -s "$OUT" ] || + dump_log_and_fail_with 'strace-log-merge unexpectedly produced output' + + match_diff "$LOG" "$EXP" 'strace-log-merge error diagnostics mismatch' +} + +check_strace_log_merge + +echo '1234567890.123456 +++ exited with 0 +++' > "$LOG".0 +check_strace_log_merge + +echo > "$LOG".1 +check_strace_log_merge + +rm -f -- "$LOG".[0-9]* diff --git a/tests-m32/strace-log-merge-suffix.test b/tests-m32/strace-log-merge-suffix.test new file mode 100755 index 00000000..51a2e5fb --- /dev/null +++ b/tests-m32/strace-log-merge-suffix.test @@ -0,0 +1,29 @@ +#!/bin/sh +# +# Check strace-log-merge pid formatting. +# +# Copyright (c) 2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +rm -f -- "$LOG".[0-9]* + +echo '3456789012.345678 +++ exited with 3 +++' > "$LOG".4294967295 +echo '1234567890.123456 +++ exited with 2 +++' > "$LOG".65535 +echo '2345678901.234567 +++ exited with 1 +++' > "$LOG".1 + +cat > "$EXP" <<'EOF' +65535 1234567890.123456 +++ exited with 2 +++ +1 2345678901.234567 +++ exited with 1 +++ +4294967295 3456789012.345678 +++ exited with 3 +++ +EOF + +"$srcdir"/../strace-log-merge "$LOG" > "$OUT" 2> "$LOG" || + dump_log_and_fail_with 'strace-log-merge failed' + +match_diff "$OUT" "$EXP" 'strace-log-merge output mismatch' + +rm -f -- "$LOG".[0-9]* diff --git a/tests-m32/strace-r.expected b/tests-m32/strace-r.expected index 8009c353..2a5b9773 100644 --- a/tests-m32/strace-r.expected +++ b/tests-m32/strace-r.expected @@ -1,2 +1,2 @@ -[ ]{5}0\.0{6} execve\("\./sleep", \["\./sleep", "1"\], \[/\* [[:digit:]]+ vars \*/\]\) = 0 +[ ]{5}0\.0{6} execve\("\.\./sleep", \["\.\./sleep", "1"\], 0x[[:xdigit:]]* /\* [[:digit:]]* vars \*/\) = 0 [ ]{5}(1\.[01]|0\.9)[[:digit:]]{5} \+\+\+ exited with 0 \+\+\+ diff --git a/tests-m32/strace-r.test b/tests-m32/strace-r.test index 4ba01f12..936f4a15 100755 --- a/tests-m32/strace-r.test +++ b/tests-m32/strace-r.test @@ -1,9 +1,14 @@ #!/bin/sh - +# # Check -r option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./sleep 0 -run_strace -r -eexecve ./sleep 1 +run_prog ../sleep 0 +run_strace -r -eexecve ../sleep 1 match_grep diff --git a/tests-m32/strace-t.test b/tests-m32/strace-t.test index 1d213e63..a06408db 100755 --- a/tests-m32/strace-t.test +++ b/tests-m32/strace-t.test @@ -1,20 +1,34 @@ #!/bin/sh - +# # Check -t option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog_skip_if_failed date +%T > /dev/null -run_prog ./sleep 0 +run_prog_skip_if_failed date +%s > "$LOG" +run_prog_skip_if_failed date +%T --date "@$(cat "$LOG")" > /dev/null +run_prog ../sleep 0 -t0="$(date +%T)" +s0="$(date +%s)" run_strace -t -eexecve $args -t1="$(date +%T)" +s1="$(date +%s)" + +s="$s0" +t_reg= +while [ "$s" -le "$s1" ]; do + t="$(date +%T --date "@$s")" + [ -z "$t_reg" ] && t_reg="$t" || t_reg="$t_reg|$t" + s=$(($s + 1)) +done +t_reg="($t_reg)" -EXPECTED="$LOG.expected" -cat > "$EXPECTED" << __EOF__ -($t0|$t1) execve\\("\\./sleep", \\["\\./sleep", "0"\\], \\[/\\* [[:digit:]]+ vars \\*/\\]\\) = 0 +cat > "$EXP" << __EOF__ +$t_reg execve\\("\\.\\./sleep", \\["\\.\\./sleep", "0"\\], 0x[[:xdigit:]]* /\\* [[:digit:]]* vars \\*/\\) = 0 +$t_reg \\+\\+\\+ exited with 0 \\+\\+\\+ __EOF__ -match_grep "$LOG" "$EXPECTED" -rm -f "$EXPECTED" +match_grep "$LOG" "$EXP" diff --git a/tests-m32/strace-tt.test b/tests-m32/strace-tt.test index 3f80001e..4d1331b1 100755 --- a/tests-m32/strace-tt.test +++ b/tests-m32/strace-tt.test @@ -1,12 +1,17 @@ #!/bin/sh - +# # Check -tt option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog_skip_if_failed date +%s > "$LOG" run_prog_skip_if_failed date +%T --date "@$(cat "$LOG")" > /dev/null -run_prog ./sleep 0 +run_prog ../sleep 0 s0="$(date +%s)" run_strace -tt -eexecve $args @@ -21,8 +26,7 @@ while [ "$s" -le "$s1" ]; do done cat > "$EXP" << __EOF__ -($t_reg)\\.[[:digit:]]{6} execve\\("\\./sleep", \\["\\./sleep", "0"\\], \\[/\\* [[:digit:]]+ vars \\*/\\]\\) = 0 +($t_reg)\\.[[:digit:]]{6} execve\\("\\.\\./sleep", \\["\\.\\./sleep", "0"\\], 0x[[:xdigit:]]* /\\* [[:digit:]]* vars \\*/\\) = 0 __EOF__ match_grep "$LOG" "$EXP" -rm -f "$EXP" diff --git a/tests-m32/strace-ttt.test b/tests-m32/strace-ttt.test index 4439715b..089ff064 100755 --- a/tests-m32/strace-ttt.test +++ b/tests-m32/strace-ttt.test @@ -1,11 +1,16 @@ #!/bin/sh - +# # Check -ttt option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog_skip_if_failed date +%s > /dev/null -run_prog ./sleep 0 +run_prog ../sleep 0 s0="$(date +%s)" run_strace -ttt -eexecve $args @@ -19,8 +24,7 @@ while [ "$s" -le "$s1" ]; do done cat > "$EXP" << __EOF__ -($t_reg)\\.[[:digit:]]{6} execve\\("\\./sleep", \\["\\./sleep", "0"\\], \\[/\\* [[:digit:]]+ vars \\*/\\]\\) = 0 +($t_reg)\\.[[:digit:]]{6} execve\\("\\.\\./sleep", \\["\\.\\./sleep", "0"\\], 0x[[:xdigit:]]* /\\* [[:digit:]]+ vars \\*/\\) = 0 __EOF__ match_grep "$LOG" "$EXP" -rm -f "$EXP" diff --git a/tests-m32/strace.supp b/tests-m32/strace.supp index 578b0a25..248a4716 100644 --- a/tests-m32/strace.supp +++ b/tests-m32/strace.supp @@ -5,3 +5,13 @@ fun:sched_getaffinity* fun:get_cpuset_size } + +{ + qualify_tokens: memleak before error_msg_and_die + Memcheck:Leak + match-leak-kinds: possible + fun:malloc + fun:strdup + fun:xstrdup + fun:qualify_tokens +} diff --git a/tests-m32/struct_flock.c b/tests-m32/struct_flock.c deleted file mode 100644 index 34cf58e6..00000000 --- a/tests-m32/struct_flock.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2015-2016 Dmitry V. Levin - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (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 -#include -#include -#include -#include "flock.h" - -#define FILE_LEN 4096 -#define EINVAL_STR "-1 EINVAL (Invalid argument)" - -#define TEST_FLOCK_EINVAL(cmd) test_flock_einval(cmd, #cmd) - -#ifdef HAVE_TYPEOF -# define TYPEOF_FLOCK_OFF_T typeof(((struct_kernel_flock *) NULL)->l_len) -#else -# define TYPEOF_FLOCK_OFF_T off_t -#endif - -static long -invoke_test_syscall(const unsigned int cmd, void *const p) -{ - const unsigned long op = (unsigned long) 0xffffffff00000000ULL | cmd; - - return syscall(TEST_SYSCALL_NR, 0, op, (unsigned long) p); -} - -static void -test_flock_einval(const int cmd, const char *name) -{ - struct_kernel_flock fl = { - .l_type = F_RDLCK, - .l_start = (TYPEOF_FLOCK_OFF_T) 0xdefaced1facefeedULL, - .l_len = (TYPEOF_FLOCK_OFF_T) 0xdefaced2cafef00dULL - }; - invoke_test_syscall(cmd, &fl); - printf("%s(0, %s, {l_type=F_RDLCK, l_whence=SEEK_SET" - ", l_start=%jd, l_len=%jd}) = %s\n", TEST_SYSCALL_STR, name, - (intmax_t) fl.l_start, (intmax_t) fl.l_len, EINVAL_STR); -} - -static void -test_flock(void) -{ - TEST_FLOCK_EINVAL(F_SETLK); - TEST_FLOCK_EINVAL(F_SETLKW); - - struct_kernel_flock fl = { - .l_type = F_RDLCK, - .l_len = FILE_LEN - }; - long rc = invoke_test_syscall(F_SETLK, &fl); - printf("%s(0, F_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET" - ", l_start=0, l_len=%d}) = %s\n", - TEST_SYSCALL_STR, FILE_LEN, rc ? EINVAL_STR : "0"); - if (rc) - return; - - invoke_test_syscall(F_GETLK, &fl); - printf("%s(0, F_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET" - ", l_start=0, l_len=%d, l_pid=0}) = 0\n", - TEST_SYSCALL_STR, FILE_LEN); - - invoke_test_syscall(F_SETLK, &fl); - printf("%s(0, F_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET" - ", l_start=0, l_len=%d}) = 0\n", - TEST_SYSCALL_STR, FILE_LEN); -} - -static void -create_sample(void) -{ - char fname[] = TEST_SYSCALL_STR "_XXXXXX"; - - (void) close(0); - if (mkstemp(fname)) - perror_msg_and_fail("mkstemp: %s", fname); - if (unlink(fname)) - perror_msg_and_fail("unlink: %s", fname); - if (ftruncate(0, FILE_LEN)) - perror_msg_and_fail("ftruncate"); -} diff --git a/tests-m32/sun_path.test b/tests-m32/sun_path.test index 728328a8..a2aab664 100755 --- a/tests-m32/sun_path.test +++ b/tests-m32/sun_path.test @@ -1,10 +1,15 @@ #!/bin/sh - +# # Check how long sun_path addresses are traced. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./net-accept-connect 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678 +run_prog ../net-accept-connect 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678 run_strace_merge -ebind,connect,getsockname $args match_grep diff --git a/tests-m32/swap.c b/tests-m32/swap.c index 77b25050..a854182e 100644 --- a/tests-m32/swap.c +++ b/tests-m32/swap.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/swap.gen.test b/tests-m32/swap.gen.test new file mode 100755 index 00000000..4ca78914 --- /dev/null +++ b/tests-m32/swap.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (swap -a23 -e trace=swapon,swapoff); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 -e trace=swapon,swapoff diff --git a/tests-m32/swap.test b/tests-m32/swap.test deleted file mode 100755 index a30e1fd8..00000000 --- a/tests-m32/swap.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check swapon and swapoff syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a23 -e trace=swapon,swapoff diff --git a/tests-m32/sxetmask.c b/tests-m32/sxetmask.c new file mode 100644 index 00000000..3ad2368e --- /dev/null +++ b/tests-m32/sxetmask.c @@ -0,0 +1,104 @@ +/* + * Check decoding of sgetmask and ssetmask syscalls. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#if defined __NR_sgetmask && defined __NR_ssetmask + +# include +# include +# include +# include +# include +# include + +static long +k_sgetmask(void) +{ + return syscall(__NR_sgetmask); +} + +static long +k_ssetmask(const kernel_ulong_t arg) +{ + return syscall(__NR_ssetmask, arg); +} + +int +main(void) +{ + union { + sigset_t libc_mask; + unsigned long old_mask; + } uset, uget; + long rc; + + /* + * Block, reset, and raise SIGUSR1. + * If a subsequent ssetmask call fails to set the proper mask, + * the process will be terminated by SIGUSR1. + */ + sigemptyset(&uset.libc_mask); + sigaddset(&uset.libc_mask, SIGUSR1); + if (sigprocmask(SIG_SETMASK, &uset.libc_mask, NULL)) + perror_msg_and_fail("sigprocmask"); + if (signal(SIGUSR1, SIG_DFL) == SIG_ERR) + perror_msg_and_fail("signal"); + raise(SIGUSR1); + + sigaddset(&uset.libc_mask, SIGUSR2); + rc = k_ssetmask((kernel_ulong_t) 0xfacefeed00000000ULL | uset.old_mask); + if (rc == -1L) { + printf("ssetmask([USR1 USR2]) = %s\n", sprintrc(rc)); + } else { + printf("ssetmask([USR1 USR2]) = %#lx (old mask [USR1])\n", rc); + /* + * Use a regular sigprocmask call to check the value + * returned by the ssetmask call being tested. + */ + if (sigprocmask(SIG_SETMASK, NULL, &uget.libc_mask)) + perror_msg_and_fail("sigprocmask"); + if (uset.old_mask != uget.old_mask) + error_msg_and_fail("sigprocmask returned %#lx" + " instead of %#lx", + uget.old_mask, uset.old_mask); + } + + rc = k_sgetmask(); + if (rc == -1L) { + printf("sgetmask() = %s\n", sprintrc(rc)); + } else { + printf("sgetmask() = %#lx (mask [USR1 USR2])\n", rc); + if (uget.old_mask != (unsigned long) rc) + error_msg_and_fail("sigprocmask returned %#lx", + uget.old_mask); + + if (sizeof(long) > 4) { + sigaddset(&uset.libc_mask, 32 + 27); + if (sigprocmask(SIG_SETMASK, &uset.libc_mask, NULL)) + perror_msg_and_fail("sigprocmask"); + rc = k_sgetmask(); + printf("sgetmask() = %#lx" + " (mask [USR1 USR2 RT_27])\n", rc); + if (uset.old_mask != (unsigned long) rc) + error_msg_and_fail("sigprocmask set %#lx", + uset.old_mask); + } + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sgetmask && __NR_ssetmask") + +#endif diff --git a/tests-m32/sxetmask.gen.test b/tests-m32/sxetmask.gen.test new file mode 100755 index 00000000..fea9e4a0 --- /dev/null +++ b/tests-m32/sxetmask.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sxetmask -a11 -e trace=sgetmask,ssetmask); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=sgetmask,ssetmask diff --git a/tests-m32/symlink.c b/tests-m32/symlink.c index 72cb4908..8283a8e2 100644 --- a/tests-m32/symlink.c +++ b/tests-m32/symlink.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -7,14 +14,12 @@ # include int -main(void) +main(int ac, char **av) { - static const char sample_1[] = "symlink_new"; - static const char sample_2[] = "symlink"; + static const char sample[] = "symlink.sample"; - long rc = syscall(__NR_symlink, sample_1, sample_2); - printf("symlink(\"%s\", \"%s\") = %ld %s (%m)\n", - sample_1, sample_2, rc, errno2name()); + long rc = syscall(__NR_symlink, sample, av[0]); + printf("symlink(\"%s\", \"%s\") = %s\n", sample, av[0], sprintrc(rc)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/symlink.gen.test b/tests-m32/symlink.gen.test new file mode 100755 index 00000000..8cedfbf4 --- /dev/null +++ b/tests-m32/symlink.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (symlink -a34 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a34 diff --git a/tests-m32/symlink.test b/tests-m32/symlink.test deleted file mode 100755 index 79b93baa..00000000 --- a/tests-m32/symlink.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check symlink syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a34 diff --git a/tests-m32/symlinkat.c b/tests-m32/symlinkat.c index 6e5d617d..be36b941 100644 --- a/tests-m32/symlinkat.c +++ b/tests-m32/symlinkat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/symlinkat.gen.test b/tests-m32/symlinkat.gen.test new file mode 100755 index 00000000..12455dd9 --- /dev/null +++ b/tests-m32/symlinkat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (symlinkat ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/symlinkat.test b/tests-m32/symlinkat.test deleted file mode 100755 index d8501ffd..00000000 --- a/tests-m32/symlinkat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check symlinkat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/sync.c b/tests-m32/sync.c index e6e7ce37..e0b654d0 100644 --- a/tests-m32/sync.c +++ b/tests-m32/sync.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/sync.gen.test b/tests-m32/sync.gen.test new file mode 100755 index 00000000..8436a1fa --- /dev/null +++ b/tests-m32/sync.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sync -a7 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a7 diff --git a/tests-m32/sync.test b/tests-m32/sync.test deleted file mode 100755 index f6bf6c8f..00000000 --- a/tests-m32/sync.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sync syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a7 diff --git a/tests-m32/sync_file_range.c b/tests-m32/sync_file_range.c index 67d31a89..9eba7815 100644 --- a/tests-m32/sync_file_range.c +++ b/tests-m32/sync_file_range.c @@ -1,30 +1,10 @@ /* * Check decoding of sync_file_range syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/sync_file_range.gen.test b/tests-m32/sync_file_range.gen.test new file mode 100755 index 00000000..2f41c7db --- /dev/null +++ b/tests-m32/sync_file_range.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sync_file_range ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/sync_file_range.test b/tests-m32/sync_file_range.test deleted file mode 100755 index 6aa86d6c..00000000 --- a/tests-m32/sync_file_range.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sync_file_range syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/sync_file_range2.c b/tests-m32/sync_file_range2.c index 6ce7db26..03af1005 100644 --- a/tests-m32/sync_file_range2.c +++ b/tests-m32/sync_file_range2.c @@ -1,30 +1,10 @@ /* * Check decoding of sync_file_range2 syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/sync_file_range2.gen.test b/tests-m32/sync_file_range2.gen.test new file mode 100755 index 00000000..d432647a --- /dev/null +++ b/tests-m32/sync_file_range2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sync_file_range2 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/sync_file_range2.test b/tests-m32/sync_file_range2.test deleted file mode 100755 index 0d9945ed..00000000 --- a/tests-m32/sync_file_range2.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sync_file_range2 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/syntax.sh b/tests-m32/syntax.sh new file mode 100644 index 00000000..2e30e6a1 --- /dev/null +++ b/tests-m32/syntax.sh @@ -0,0 +1,59 @@ +#!/bin/sh +# +# Define syntax testing primitives. +# +# Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +check_exit_status_and_stderr() +{ + $STRACE "$@" 2> "$LOG" && + dump_log_and_fail_with \ + "strace $* failed to handle the error properly" + match_diff "$LOG" "$EXP" || + dump_log_and_fail_with \ + "strace $* failed to print expected diagnostics" +} + +check_exit_status_and_stderr_using_grep() +{ + $STRACE "$@" 2> "$LOG" && + dump_log_and_fail_with \ + "strace $* failed to handle the error properly" + match_grep "$LOG" "$EXP" || + dump_log_and_fail_with \ + "strace $* failed to print expected diagnostics" +} + +check_e() +{ + local pattern="$1"; shift + cat > "$EXP" << __EOF__ +$STRACE_EXE: $pattern +__EOF__ + check_exit_status_and_stderr "$@" +} + +check_e_using_grep() +{ + local pattern="$1"; shift + cat > "$EXP" << __EOF__ +$STRACE_EXE: $pattern +__EOF__ + check_exit_status_and_stderr_using_grep "$@" +} + +check_h() +{ + local pattern="$1"; shift + cat > "$EXP" << __EOF__ +$STRACE_EXE: $pattern +Try '$STRACE_EXE -h' for more information. +__EOF__ + check_exit_status_and_stderr "$@" +} diff --git a/tests-m32/sysinfo.c b/tests-m32/sysinfo.c index 377bdc9c..bf07661a 100644 --- a/tests-m32/sysinfo.c +++ b/tests-m32/sysinfo.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015 Elvira Khabirova * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -38,7 +19,7 @@ main(void) sysinfo(NULL); printf("sysinfo(NULL) = -1 EFAULT (%m)\n"); - struct sysinfo * const si = tail_alloc(sizeof(*si)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sysinfo, si); if (sysinfo(si)) perror_msg_and_skip("sysinfo"); diff --git a/tests-m32/sysinfo.gen.test b/tests-m32/sysinfo.gen.test new file mode 100755 index 00000000..fa462376 --- /dev/null +++ b/tests-m32/sysinfo.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sysinfo -a14 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests-m32/sysinfo.test b/tests-m32/sysinfo.test deleted file mode 100755 index 806d8b61..00000000 --- a/tests-m32/sysinfo.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of sysinfo syscall - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a14 diff --git a/tests-m32/syslog.c b/tests-m32/syslog.c index 5df96cb8..363fdf96 100644 --- a/tests-m32/syslog.c +++ b/tests-m32/syslog.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/syslog.gen.test b/tests-m32/syslog.gen.test new file mode 100755 index 00000000..5707a3e2 --- /dev/null +++ b/tests-m32/syslog.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (syslog -a36 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests-m32/syslog.test b/tests-m32/syslog.test deleted file mode 100755 index 1c2158e4..00000000 --- a/tests-m32/syslog.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check syslog syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a36 diff --git a/tests-m32/tail_alloc.c b/tests-m32/tail_alloc.c index 08081d4f..693196ef 100644 --- a/tests-m32/tail_alloc.c +++ b/tests-m32/tail_alloc.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/tee.c b/tests-m32/tee.c index 66d1c94f..2137c351 100644 --- a/tests-m32/tee.c +++ b/tests-m32/tee.c @@ -1,30 +1,10 @@ /* * This file is part of tee strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/tee.gen.test b/tests-m32/tee.gen.test new file mode 100755 index 00000000..b5fbfc05 --- /dev/null +++ b/tests-m32/tee.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (tee ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/tee.test b/tests-m32/tee.test deleted file mode 100755 index 76b60003..00000000 --- a/tests-m32/tee.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check tee syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/termsig.test b/tests-m32/termsig.test new file mode 100755 index 00000000..d41ddf0a --- /dev/null +++ b/tests-m32/termsig.test @@ -0,0 +1,20 @@ +#!/bin/sh +# +# Check termination signal forwarding. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_expect_termsig="../run_expect_termsig 15" +unblock_reset_raise="../unblock_reset_raise 15" + +run_prog $run_expect_termsig $unblock_reset_raise +STRACE="$run_expect_termsig $STRACE" + +for i in 1 2 3 4; do + run_strace -I$i -enone -esignal=none $unblock_reset_raise +done diff --git a/tests-m32/test_netlink.h b/tests-m32/test_netlink.h new file mode 100644 index 00000000..2ce476d5 --- /dev/null +++ b/tests-m32/test_netlink.h @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include "print_fields.h" + +#include +#include +#include +#include +#include "netlink.h" + +#define TEST_NETLINK_(fd_, nlh0_, \ + type_, type_str_, \ + flags_, flags_str_, \ + data_len_, src_, slen_, ...) \ + do { \ + struct nlmsghdr *const TEST_NETLINK_nlh = \ + (nlh0_) - (slen_); \ + const unsigned int msg_len = \ + NLMSG_HDRLEN + (data_len_); \ + \ + SET_STRUCT(struct nlmsghdr, TEST_NETLINK_nlh, \ + .nlmsg_len = msg_len, \ + .nlmsg_type = (type_), \ + .nlmsg_flags = (flags_) \ + ); \ + memcpy(NLMSG_DATA(TEST_NETLINK_nlh), (src_), (slen_)); \ + \ + const char *const errstr = \ + sprintrc(sendto((fd_), TEST_NETLINK_nlh, \ + msg_len, MSG_DONTWAIT, \ + NULL, 0)); \ + \ + printf("sendto(%d, {{len=%u, type=%s" \ + ", flags=%s, seq=0, pid=0}, ", \ + (fd_), msg_len, (type_str_), (flags_str_)); \ + \ + { __VA_ARGS__; } \ + \ + printf("}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", \ + msg_len, errstr); \ + } while (0) + +#define TEST_NETLINK(fd_, nlh0_, type_, flags_, \ + data_len_, src_, slen_, ...) \ + TEST_NETLINK_((fd_), (nlh0_), \ + (type_), #type_, \ + (flags_), #flags_, \ + (data_len_), (src_), (slen_), __VA_ARGS__) + +#define TEST_NETLINK_OBJECT_EX_(fd_, nlh0_, \ + type_, type_str_, \ + flags_, flags_str_, \ + obj_, fallback_func, ...) \ + do { \ + char pattern[DEFAULT_STRLEN]; \ + fill_memory_ex(pattern, sizeof(pattern), \ + 'a', 'z' - 'a' + 1); \ + const unsigned int plen = \ + sizeof(obj_) - 1 > DEFAULT_STRLEN \ + ? DEFAULT_STRLEN : (int) sizeof(obj_) - 1; \ + /* len < sizeof(obj_) */ \ + TEST_NETLINK_((fd_), (nlh0_), \ + (type_), (type_str_), \ + (flags_), (flags_str_), \ + plen, pattern, plen, \ + (fallback_func)(pattern, plen)); \ + /* short read of sizeof(obj_) */ \ + TEST_NETLINK_((fd_), (nlh0_), \ + (type_), (type_str_), \ + (flags_), (flags_str_), \ + sizeof(obj_), \ + pattern, plen, \ + printf("%p", \ + NLMSG_DATA(TEST_NETLINK_nlh))); \ + /* sizeof(obj_) */ \ + TEST_NETLINK_((fd_), (nlh0_), \ + (type_), (type_str_), \ + (flags_), (flags_str_), \ + sizeof(obj_), \ + &(obj_), sizeof(obj_), \ + __VA_ARGS__); \ + } while (0) + +#define TEST_NETLINK_OBJECT_EX(fd_, nlh0_, \ + type_, flags_, \ + obj_, fallback_func, ...) \ + TEST_NETLINK_OBJECT_EX_((fd_), (nlh0), \ + (type_), #type_, \ + (flags_), #flags_, \ + (obj_), (fallback_func), __VA_ARGS__) + +#define TEST_NETLINK_OBJECT(fd_, nlh0_, \ + type_, flags_, \ + obj_, ...) \ + TEST_NETLINK_OBJECT_EX_((fd_), (nlh0), \ + (type_), #type_, \ + (flags_), #flags_, \ + (obj_), print_quoted_hex, __VA_ARGS__) diff --git a/tests-m32/test_nlattr.h b/tests-m32/test_nlattr.h new file mode 100644 index 00000000..8b8c66b8 --- /dev/null +++ b/tests-m32/test_nlattr.h @@ -0,0 +1,343 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include "print_fields.h" + +#include +#include +#include +#include +#include "netlink.h" +#include + +static void +init_nlattr(struct nlattr *const nla, + const uint16_t nla_len, + const uint16_t nla_type, + const void *const src, + const size_t n) +{ + SET_STRUCT(struct nlattr, nla, + .nla_len = nla_len, + .nla_type = nla_type, + ); + + memcpy(RTA_DATA(nla), src, n); +} + +static void +print_nlattr(const unsigned int nla_len, const char *const nla_type, bool add_data) +{ + printf(", %s{{nla_len=%u, nla_type=%s}, ", + add_data ? "[" : "", nla_len, nla_type); +} + +#define TEST_NLATTR_EX_(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, nla_type_str_, \ + nla_data_len_, nla_total_len_, \ + src_, slen_, ...) \ + do { \ + struct nlmsghdr *const nlh = \ + (nlh0_) - (NLA_HDRLEN + (slen_)); \ + struct nlattr *const TEST_NLATTR_nla = \ + NLMSG_ATTR(nlh, (hdrlen_)); \ + const unsigned int nla_len = \ + NLA_HDRLEN + (nla_data_len_); \ + const unsigned int msg_len = \ + NLMSG_SPACE(hdrlen_) + NLA_HDRLEN + (nla_total_len_); \ + \ + (init_msg_)(nlh, msg_len); \ + init_nlattr(TEST_NLATTR_nla, nla_len, (nla_type_), \ + (src_), (slen_)); \ + \ + const char *const errstr = \ + sprintrc(sendto((fd_), nlh, msg_len, \ + MSG_DONTWAIT, NULL, 0)); \ + \ + printf("sendto(%d, {", (fd_)); \ + (print_msg_)(msg_len); \ + print_nlattr(nla_len, (nla_type_str_), \ + (nla_total_len_) > (nla_data_len_)); \ + \ + { __VA_ARGS__; } \ + \ + if ((nla_total_len_) > (nla_data_len_)) \ + printf("]"); \ + \ + printf("}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", \ + msg_len, errstr); \ + } while (0) + +#define TEST_NLATTR_(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, nla_type_str_, \ + nla_data_len_, src_, slen_, ...) \ + TEST_NLATTR_EX_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), (nla_type_str_), \ + (nla_data_len_), (nla_data_len_), \ + (src_), (slen_), __VA_ARGS__) + +#define TEST_NLATTR(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, \ + nla_data_len_, src_, slen_, ...) \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + (nla_data_len_), (src_), (slen_), __VA_ARGS__) + +#define TEST_NLATTR_OBJECT_EX_(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, nla_type_str_, \ + pattern_, obj_, fallback_func, ...) \ + do { \ + const unsigned int plen = \ + sizeof(obj_) - 1 > DEFAULT_STRLEN \ + ? DEFAULT_STRLEN : (int) sizeof(obj_) - 1; \ + /* len < sizeof(obj_) */ \ + if (plen > 0) \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), (nla_type_str_), \ + plen, (pattern_), plen, \ + (fallback_func)((pattern_), plen)); \ + /* short read of sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), (nla_type_str_), \ + sizeof(obj_), \ + (pattern_), sizeof(obj_) - 1, \ + printf("%p", \ + RTA_DATA(NLMSG_ATTR(nlh, (hdrlen_))))); \ + /* sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), (nla_type_str_), \ + sizeof(obj_), \ + &(obj_), sizeof(obj_), \ + __VA_ARGS__); \ + } while (0) + +#define TEST_NLATTR_OBJECT_EX(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, \ + pattern_, obj_, fallback_func, ...) \ + TEST_NLATTR_OBJECT_EX_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + (pattern_), (obj_), (fallback_func), \ + __VA_ARGS__) + +#define TEST_NLATTR_OBJECT(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, pattern_, obj_, ...) \ + TEST_NLATTR_OBJECT_EX_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + (pattern_), (obj_), print_quoted_hex, \ + __VA_ARGS__) + +#define TEST_NLATTR_ARRAY(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, pattern_, obj_, print_elem_) \ + do { \ + const unsigned int plen = \ + sizeof((obj_)[0]) - 1 > DEFAULT_STRLEN \ + ? DEFAULT_STRLEN : (int) sizeof((obj_)[0]) - 1; \ + /* len < sizeof((obj_)[0]) */ \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + plen, (pattern_), plen, \ + print_quoted_hex((pattern_), plen)); \ + /* sizeof((obj_)[0]) < len < sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + sizeof(obj_) - 1, \ + &(obj_), sizeof(obj_) - 1, \ + printf("["); \ + size_t i; \ + for (i = 0; i < ARRAY_SIZE(obj_) - 1; ++i) { \ + if (i) printf(", "); \ + (print_elem_)(&(obj_)[i], i); \ + } \ + printf("]")); \ + /* short read of sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + sizeof(obj_), \ + &(obj_), sizeof(obj_) - 1, \ + printf("["); \ + size_t i; \ + for (i = 0; i < ARRAY_SIZE(obj_) - 1; ++i) { \ + if (i) printf(", "); \ + (print_elem_)(&(obj_)[i], i); \ + } \ + printf(", ... /* %p */]", \ + RTA_DATA(NLMSG_ATTR(nlh, (hdrlen_))) \ + + sizeof(obj_) - sizeof((obj_)[0]))); \ + /* sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + sizeof(obj_), \ + &(obj_), sizeof(obj_), \ + printf("["); \ + size_t i; \ + for (i = 0; i < ARRAY_SIZE(obj_); ++i) { \ + if (i) printf(", "); \ + (print_elem_)(&(obj_)[i], i); \ + } \ + printf("]")); \ + } while (0) + +#define TEST_NESTED_NLATTR_OBJECT_EX_(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, nla_type_str_, \ + pattern_, obj_, fallback_func, \ + depth_, ...) \ + do { \ + const unsigned int plen = \ + sizeof(obj_) - 1 > DEFAULT_STRLEN \ + ? DEFAULT_STRLEN : (int) sizeof(obj_) - 1; \ + /* len < sizeof(obj_) */ \ + if (plen > 0) \ + TEST_NLATTR_((fd_), (nlh0_) - NLA_HDRLEN * depth_, \ + (hdrlen_) + NLA_HDRLEN * depth_, \ + (init_msg_), (print_msg_), \ + (nla_type_), (nla_type_str_), \ + plen, (pattern_), plen, \ + (fallback_func)((pattern_), plen); \ + size_t i; \ + for (i = 0; i < depth_; ++i) \ + printf("}")); \ + /* short read of sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_) - NLA_HDRLEN * depth_, \ + (hdrlen_) + NLA_HDRLEN * depth_, \ + (init_msg_), (print_msg_), \ + (nla_type_), (nla_type_str_), \ + sizeof(obj_), \ + (pattern_), sizeof(obj_) - 1, \ + printf("%p", RTA_DATA(TEST_NLATTR_nla)); \ + size_t i; \ + for (i = 0; i < depth_; ++i) \ + printf("}")); \ + /* sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_) - NLA_HDRLEN * depth_, \ + (hdrlen_) + NLA_HDRLEN * depth_, \ + (init_msg_), (print_msg_), \ + (nla_type_), (nla_type_str_), \ + sizeof(obj_), \ + &(obj_), sizeof(obj_), \ + __VA_ARGS__; \ + size_t i; \ + for (i = 0; i < depth_; ++i) \ + printf("}")); \ + } while (0) + +#define TEST_NESTED_NLATTR_OBJECT_EX(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, pattern_, obj_, \ + depth_, ...) \ + TEST_NESTED_NLATTR_OBJECT_EX_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + (pattern_), (obj_), \ + print_quoted_hex, (depth_), \ + __VA_ARGS__) + +#define TEST_NESTED_NLATTR_OBJECT(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, pattern_, obj_, ...) \ + TEST_NESTED_NLATTR_OBJECT_EX_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + (pattern_), (obj_), \ + print_quoted_hex, 1, \ + __VA_ARGS__) + +#define TEST_NESTED_NLATTR_ARRAY_EX(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, pattern_, obj_, depth_, \ + print_elem_) \ + do { \ + const unsigned int plen = \ + sizeof((obj_)[0]) - 1 > DEFAULT_STRLEN \ + ? DEFAULT_STRLEN : (int) sizeof((obj_)[0]) - 1; \ + /* len < sizeof((obj_)[0]) */ \ + TEST_NLATTR_((fd_), (nlh0_) - NLA_HDRLEN * depth_, \ + (hdrlen_) + NLA_HDRLEN * depth_, \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + plen, (pattern_), plen, \ + print_quoted_hex((pattern_), plen); \ + for (size_t i = 0; i < depth_; ++i) \ + printf("}")); \ + /* sizeof((obj_)[0]) < len < sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_) - NLA_HDRLEN * depth_, \ + (hdrlen_) + NLA_HDRLEN * depth_, \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + sizeof(obj_) - 1, \ + &(obj_), sizeof(obj_) - 1, \ + printf("["); \ + size_t i; \ + for (i = 0; i < ARRAY_SIZE(obj_) - 1; ++i) { \ + if (i) printf(", "); \ + (print_elem_)(&(obj_)[i], i); \ + } \ + printf("]"); \ + for (i = 0; i < depth_; ++i) \ + printf("}")); \ + /* short read of sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_) - NLA_HDRLEN * depth_, \ + (hdrlen_) + NLA_HDRLEN * depth_, \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + sizeof(obj_), \ + &(obj_), sizeof(obj_) - 1, \ + printf("["); \ + size_t i; \ + for (i = 0; i < ARRAY_SIZE(obj_) - 1; ++i) { \ + if (i) printf(", "); \ + (print_elem_)(&(obj_)[i], i); \ + } \ + printf(", ... /* %p */]", \ + RTA_DATA(TEST_NLATTR_nla) \ + + sizeof(obj_) - sizeof((obj_)[0])); \ + for (i = 0; i < depth_; ++i) \ + printf("}")); \ + /* sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_) - NLA_HDRLEN * depth_, \ + (hdrlen_) + NLA_HDRLEN * depth_, \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + sizeof(obj_), \ + &(obj_), sizeof(obj_), \ + printf("["); \ + size_t i; \ + for (i = 0; i < ARRAY_SIZE(obj_); ++i) { \ + if (i) printf(", "); \ + (print_elem_)(&(obj_)[i], i); \ + } \ + printf("]"); \ + for (i = 0; i < depth_; ++i) \ + printf("}")); \ + } while (0) + +#define TEST_NESTED_NLATTR_ARRAY(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, pattern_, obj_, print_elem_)\ + TEST_NESTED_NLATTR_ARRAY_EX((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + nla_type_, (pattern_), (obj_), 1, \ + (print_elem_)) diff --git a/tests-m32/test_printpath.c b/tests-m32/test_printpath.c new file mode 100644 index 00000000..e341e389 --- /dev/null +++ b/tests-m32/test_printpath.c @@ -0,0 +1,91 @@ +/* + * Test printpath/umovestr. + * + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include + +#include "test_ucopy.h" + +static void +test_printpath_at(char *const p, const unsigned int test_max) +{ + /* + * / + * /. + * /.. + * /... + * /../. + * /../.. + * /../../ + */ + + char *const eop = p + (test_max - 1); + *eop = '\0'; + unsigned int i; + for (i = 1; i < test_max; ++i) { + const unsigned int i_1 = i - 1; + memmove(eop - i, eop - i_1, i_1); + eop[-1] = "/.."[i_1 % 3]; + if (chdir(eop - i)) + perror_msg_and_fail("chdir"); + printf("chdir(\"%s\") = 0\n", eop - i); + } +} + +static void +test_efault(const unsigned int test_max) +{ + char *p = tail_alloc(test_max); + const char *const efault = p + test_max; + memset(p, '/', test_max); + + for (; p <= efault; ++p) { + if (p <= efault - PATH_MAX) + continue; + printf("chdir(%p) = %s\n", p, sprintrc(chdir(p))); + } +} + +static void +test_enametoolong(void) +{ + char *p = tail_alloc(PATH_MAX); + memset(p, '/', PATH_MAX); + + printf("chdir(\"%.*s\"...) = %s\n", + PATH_MAX - 1, p, sprintrc(chdir(p))); +} + +void +test_printpath(const unsigned int test_max) +{ + /* + * /../..| + * /../.|. + * /../|.. + * /..|/.. + * /.|./.. + * /|../.. + * |/../.. + */ + const unsigned int page_size = get_page_size(); + char *p = tail_alloc(test_max + page_size); + unsigned int i; + for (i = 1; i < sizeof(long); ++i) + test_printpath_at(p + i, test_max); + for (i = 0; i < sizeof(long); ++i) + test_printpath_at(p + page_size - i, test_max); + test_efault(test_max); + test_enametoolong(); +} diff --git a/tests-m32/test_printstrn.c b/tests-m32/test_printstrn.c new file mode 100644 index 00000000..09c438d1 --- /dev/null +++ b/tests-m32/test_printstrn.c @@ -0,0 +1,99 @@ +/* + * Test printstrn/umoven. + * + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include + +#include "scno.h" +#include "test_ucopy.h" + +static const char *errstr; + +static void add_key(const char *addr, const unsigned int len) +{ + errstr = sprintrc(syscall(__NR_add_key, 0, 0, addr, len, -1)); +} + +static void +test_printstrn_at(char *const p, const unsigned int test_max) +{ + unsigned int i; + + for (i = 0; i <= test_max; ++i) { + add_key(p + (test_max - i), i); + printf("add_key(NULL, NULL, \"%.*s\", %u" + ", KEY_SPEC_THREAD_KEYRING) = %s\n", + (int) i, p + (test_max - i), i, errstr); + } +} + +static void +test_efault(const unsigned int test_max) +{ + char *p = tail_alloc(test_max); + memset(p, '/', test_max); + unsigned int i; + + for (i = 0; i <= test_max; ++i) { + unsigned int j; + for (j = 1; j <= sizeof(long); ++j) { + add_key(p + (test_max - i), i + j); + printf("add_key(NULL, NULL, %p, %u" + ", KEY_SPEC_THREAD_KEYRING) = %s\n", + p + (test_max - i), i + j, errstr); + } + } +} + +static void +test_print_memory(char *const p, const unsigned int test_max) +{ + add_key(p, test_max); + printf("add_key(NULL, NULL, "); + print_quoted_memory(p, test_max); + printf(", %u, KEY_SPEC_THREAD_KEYRING) = %s\n", test_max, errstr); +} + +void +test_printstrn(const unsigned int test_max) +{ + /* + * abcdefgh| + * abcdefg|h + * abcdef|gh + * abcde|fgh + * abcd|efgh + * abc|defgh + * ab|cdefgh + * a|bcdefgh + * |abcdefgh + */ + const unsigned int page_size = get_page_size(); + char *p = tail_alloc(test_max + page_size); + fill_memory_ex(p, test_max + page_size, 'a', 'z' - 'a' + 1); + + unsigned int i; + for (i = 1; i <= sizeof(long); ++i) + test_printstrn_at(p + i, test_max); + for (i = 0; i < sizeof(long); ++i) + test_printstrn_at(p + page_size - i, test_max); + test_efault(test_max); + + fill_memory_ex(p, test_max + page_size, 0x00, 0xFF); + /* Test corner cases when octal quoting goes before digit */ + for (i = 0; i < 11; i++) + p[2 + 3 * i] = '0' + i - 1; + + test_print_memory(p, test_max); +} diff --git a/tests-m32/test_ucopy.c b/tests-m32/test_ucopy.c new file mode 100644 index 00000000..78d393b2 --- /dev/null +++ b/tests-m32/test_ucopy.c @@ -0,0 +1,143 @@ +/* + * Test whether process_vm_readv and PTRACE_PEEKDATA work. + * + * Copyright (c) 2016-2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "test_ucopy.h" + +#ifndef HAVE_PROCESS_VM_READV + +# include +# include "scno.h" +static ssize_t +strace_process_vm_readv(pid_t pid, + const struct iovec *lvec, + unsigned long liovcnt, + const struct iovec *rvec, + unsigned long riovcnt, + unsigned long flags) +{ + return syscall(__NR_process_vm_readv, + (long) pid, lvec, liovcnt, rvec, riovcnt, flags); +} +# define process_vm_readv strace_process_vm_readv + +#endif /* !HAVE_PROCESS_VM_READV */ + +static bool +call_process_vm_readv(const int pid, long *const addr) +{ + long data = 0; + + const struct iovec local = { + .iov_base = &data, + .iov_len = sizeof(data) + }; + const struct iovec remote = { + .iov_base = addr, + .iov_len = sizeof(*addr) + }; + + return process_vm_readv(pid, &local, 1, &remote, 1, 0) == sizeof(data) + && data == 1; +} + +static bool +call_ptrace_peekdata(const int pid, long *const addr) +{ + return ptrace(PTRACE_PEEKDATA, pid, addr, 0) == 1; +} + +static bool +test_ucopy(bool (*fn)(int pid, long *addr)) +{ + static long data; + + data = 0; + bool rc = false; + int saved = 0; + + pid_t pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + data = 1; + if (ptrace(PTRACE_TRACEME, 0, 0, 0)) + perror_msg_and_fail("PTRACE_TRACEME"); + raise(SIGSTOP); + _exit(0); + } + + for (;;) { + int status, tracee; + + errno = 0; + tracee = wait(&status); + if (tracee != pid) { + if (errno == EINTR) + continue; + saved = errno; + kill(pid, SIGKILL); + errno = saved; + perror_msg_and_fail("wait"); + } + if (WIFEXITED(status)) { + if (WEXITSTATUS(status) == 0) + break; + error_msg_and_fail("unexpected exit status %u", + WEXITSTATUS(status)); + } + if (WIFSIGNALED(status)) + error_msg_and_fail("unexpected signal %u", + WTERMSIG(status)); + if (!WIFSTOPPED(status) || WSTOPSIG(status) != SIGSTOP) { + kill(pid, SIGKILL); + error_msg_and_fail("unexpected wait status %x", + status); + } + + errno = 0; + rc = fn(pid, &data); + if (!rc) + saved = errno; + + if (ptrace(PTRACE_CONT, pid, 0, 0)) { + saved = errno; + kill(pid, SIGKILL); + errno = saved; + perror_msg_and_fail("PTRACE_CONT"); + } + } + + if (!rc) + errno = saved; + return rc; +} + +bool +test_process_vm_readv(void) +{ + return test_ucopy(call_process_vm_readv); +} + +bool +test_ptrace_peekdata(void) +{ + return test_ucopy(call_ptrace_peekdata); +} diff --git a/tests-m32/test_ucopy.h b/tests-m32/test_ucopy.h new file mode 100644 index 00000000..1a3b2819 --- /dev/null +++ b/tests-m32/test_ucopy.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include + +extern bool +test_process_vm_readv(void); + +extern bool +test_ptrace_peekdata(void); + +extern void +test_printpath(unsigned int test_max_size); + +extern void +test_printstrn(unsigned int test_max_size); diff --git a/tests-m32/tests.h b/tests-m32/tests.h index d4294de9..1a1b02c3 100644 --- a/tests-m32/tests.h +++ b/tests-m32/tests.h @@ -1,49 +1,66 @@ /* * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef STRACE_TESTS_H -#define STRACE_TESTS_H +# define STRACE_TESTS_H # ifdef HAVE_CONFIG_H # include "config.h" # endif +# ifdef TESTS_SIZEOF_KERNEL_LONG_T +# undef SIZEOF_KERNEL_LONG_T +# define SIZEOF_KERNEL_LONG_T TESTS_SIZEOF_KERNEL_LONG_T +# endif + +# ifdef TESTS_SIZEOF_LONG +# undef SIZEOF_LONG +# define SIZEOF_LONG TESTS_SIZEOF_LONG +# endif + +# include # include # include "kernel_types.h" # include "gcc_compat.h" +# include "macros.h" + +/* + * The printf-like function to use in header files + * shared between strace and its tests. + */ +# ifndef STRACE_PRINTF +# define STRACE_PRINTF printf +# endif /* Tests of "strace -v" are expected to define VERBOSE to 1. */ -#ifndef VERBOSE -# define VERBOSE 0 -#endif +# ifndef VERBOSE +# define VERBOSE 0 +# endif + +/* xlat verbosity defaults */ +# ifndef XLAT_RAW +# define XLAT_RAW 0 +# endif +# ifndef XLAT_VERBOSE +# define XLAT_VERBOSE 0 +# endif + +# ifndef DEFAULT_STRLEN +/* Default maximum # of bytes printed in printstr et al. */ +# define DEFAULT_STRLEN 32 +# endif /* Cached sysconf(_SC_PAGESIZE). */ size_t get_page_size(void); +/* The size of kernel's sigset_t. */ +unsigned int get_sigset_size(void); + /* Print message and strerror(errno) to stderr, then exit(1). */ void perror_msg_and_fail(const char *, ...) ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; @@ -57,9 +74,21 @@ void error_msg_and_skip(const char *, ...) void perror_msg_and_skip(const char *, ...) ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; +# ifndef perror_msg_and_fail +# define perror_msg_and_fail(fmt_, ...) \ + perror_msg_and_fail("%s:%d: " fmt_, __FILE__, __LINE__, ##__VA_ARGS__) +# endif +# ifndef perror_msg_and_fail +# define error_msg_and_fail(fmt_, ...) \ + error_msg_and_fail("%s:%d: " fmt_, __FILE__, __LINE__, ##__VA_ARGS__) +# endif + +/* Stat the specified file and skip the test if the stat call failed. */ +void skip_if_unavailable(const char *); + /* * Allocate memory that ends on the page boundary. - * Pages allocated by this call are preceeded by an unmapped page + * Pages allocated by this call are preceded by an unmapped page * and followed also by an unmapped page. */ void *tail_alloc(const size_t) @@ -68,13 +97,32 @@ void *tail_alloc(const size_t) void *tail_memdup(const void *, const size_t) ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((2)); +# define midtail_alloc(after_, before_) \ + ((void *) ((char *) tail_alloc(((before_) + (after_))) + (before_))) + +/* + * Allocate an object of the specified type at the end + * of a mapped memory region. + * Assign its address to the specified constant pointer. + */ +# define TAIL_ALLOC_OBJECT_CONST_PTR(type_name, type_ptr) \ + type_name *const type_ptr = tail_alloc(sizeof(*type_ptr)) + +/* + * Allocate an object of the specified type at the end + * of a mapped memory region. + * Assign its address to the specified variable pointer. + */ +# define TAIL_ALLOC_OBJECT_VAR_PTR(type_name, type_ptr) \ + type_name *type_ptr = tail_alloc(sizeof(*type_ptr)) + /* * Fill memory (pointed by ptr, having size bytes) with different bytes (with * values starting with start and resetting every period) in order to catch * sign, byte order and/or alignment errors. */ void fill_memory_ex(void *ptr, size_t size, unsigned char start, - unsigned char period); + unsigned int period); /* Shortcut for fill_memory_ex(ptr, size, 0x80, 0x80) */ void fill_memory(void *ptr, size_t size); @@ -94,11 +142,39 @@ const char *hexquote_strndup(const char *, size_t); /* Return inode number of socket descriptor. */ unsigned long inode_of_sockfd(int); +/* Print string in a quoted form with optional escape characters. */ +void print_quoted_string_ex(const char *, bool quote, const char *escape_str); + /* Print string in a quoted form. */ void print_quoted_string(const char *); +/* + * Print a NUL-terminated string `str' of length up to `size' - 1 + * in a quoted form. + */ +void print_quoted_cstring(const char *str, size_t size); + +/* + * Print a NUL-terminated string `str' of length up to `size' + * in a quoted form. + */ +void print_quoted_stringn(const char *str, size_t size); + +/* Print memory in a quoted form with optional escape characters. */ +void print_quoted_memory_ex(const void *, size_t, bool quote, + const char *escape_chars); + /* Print memory in a quoted form. */ -void print_quoted_memory(const char *, size_t); +void print_quoted_memory(const void *, size_t); + +/* Print memory in a hexquoted form. */ +void print_quoted_hex(const void *, size_t); + +/* Print time_t and nanoseconds in symbolic format. */ +void print_time_t_nsec(time_t, unsigned long long, int); + +/* Print time_t and microseconds in symbolic format. */ +void print_time_t_usec(time_t, unsigned long long, int); /* Read an int from the file. */ int read_int_from_file(const char *, int *); @@ -138,11 +214,24 @@ struct timespec; int recv_mmsg(int, struct mmsghdr *, unsigned int, unsigned int, struct timespec *); int send_mmsg(int, struct mmsghdr *, unsigned int, unsigned int); +/* Create a netlink socket. */ +int create_nl_socket_ext(int proto, const char *name); +# define create_nl_socket(proto) create_nl_socket_ext((proto), #proto) + /* Create a pipe with maximized descriptor numbers. */ void pipe_maxfd(int pipefd[2]); -#define F8ILL_KULONG_SUPPORTED (sizeof(void *) < sizeof(kernel_ulong_t)) -#define F8ILL_KULONG_MASK ((kernel_ulong_t) 0xffffffff00000000ULL) +/* if_nametoindex("lo") */ +unsigned int ifindex_lo(void); + +# ifdef HAVE_IF_INDEXTONAME +# define IFINDEX_LO_STR "if_nametoindex(\"lo\")" +# else +# define IFINDEX_LO_STR "1" +# endif + +# define F8ILL_KULONG_SUPPORTED (sizeof(void *) < sizeof(kernel_ulong_t)) +# define F8ILL_KULONG_MASK ((kernel_ulong_t) 0xffffffff00000000ULL) /* * For 64-bit kernel_ulong_t and 32-bit pointer, @@ -157,11 +246,10 @@ f8ill_ptr_to_kulong(const void *const ptr) ? F8ILL_KULONG_MASK | uptr : (kernel_ulong_t) uptr; } -# define ARRAY_SIZE(arg) ((unsigned int) (sizeof(arg) / sizeof((arg)[0]))) # define LENGTH_OF(arg) ((unsigned int) sizeof(arg) - 1) /* Zero-extend a signed integer type to unsigned long long. */ -#define zero_extend_signed_to_ull(v) \ +# define zero_extend_signed_to_ull(v) \ (sizeof(v) == sizeof(char) ? (unsigned long long) (unsigned char) (v) : \ sizeof(v) == sizeof(short) ? (unsigned long long) (unsigned short) (v) : \ sizeof(v) == sizeof(int) ? (unsigned long long) (unsigned int) (v) : \ @@ -169,7 +257,7 @@ f8ill_ptr_to_kulong(const void *const ptr) (unsigned long long) (v)) /* Sign-extend an unsigned integer type to long long. */ -#define sign_extend_unsigned_to_ll(v) \ +# define sign_extend_unsigned_to_ll(v) \ (sizeof(v) == sizeof(char) ? (long long) (char) (v) : \ sizeof(v) == sizeof(short) ? (long long) (short) (v) : \ sizeof(v) == sizeof(int) ? (long long) (int) (v) : \ @@ -179,26 +267,6 @@ f8ill_ptr_to_kulong(const void *const ptr) # define SKIP_MAIN_UNDEFINED(arg) \ int main(void) { error_msg_and_skip("undefined: %s", arg); } -/* - * The kernel used to define 64-bit types on 64-bit systems on a per-arch - * basis. Some architectures would use unsigned long and others would use - * unsigned long long. These types were exported as part of the - * kernel-userspace ABI and now must be maintained forever. This matches - * what the kernel exports for each architecture so we don't need to cast - * every printing of __u64 or __s64 to stdint types. - */ -# if SIZEOF_LONG == 4 -# define PRI__64 "ll" -# elif defined ALPHA || defined IA64 || defined MIPS || defined POWERPC -# define PRI__64 "l" -# else -# define PRI__64 "ll" -# endif - -# define PRI__d64 PRI__64"d" -# define PRI__u64 PRI__64"u" -# define PRI__x64 PRI__64"x" - # if WORDS_BIGENDIAN # define LL_PAIR(HI, LO) (HI), (LO) # else @@ -206,8 +274,19 @@ f8ill_ptr_to_kulong(const void *const ptr) # endif # define LL_VAL_TO_PAIR(llval) LL_PAIR((long) ((llval) >> 32), (long) (llval)) -# define _STR(_arg) #_arg # define ARG_STR(_arg) (_arg), #_arg # define ARG_ULL_STR(_arg) _arg##ULL, #_arg +/* + * Assign an object of type DEST_TYPE at address DEST_ADDR + * using memcpy to avoid potential unaligned access. + */ +# define SET_STRUCT(DEST_TYPE, DEST_ADDR, ...) \ + do { \ + DEST_TYPE dest_type_tmp_var = { __VA_ARGS__ }; \ + memcpy(DEST_ADDR, &dest_type_tmp_var, sizeof(dest_type_tmp_var)); \ + } while (0) + +# define NLMSG_ATTR(nlh, hdrlen) ((void *)(nlh) + NLMSG_SPACE(hdrlen)) + #endif /* !STRACE_TESTS_H */ diff --git a/tests-m32/threads-execve.c b/tests-m32/threads-execve.c index 853645ff..56fab529 100644 --- a/tests-m32/threads-execve.c +++ b/tests-m32/threads-execve.c @@ -2,29 +2,10 @@ * Check decoding of threads when a non-leader thread invokes execve. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -136,31 +117,31 @@ thread(void *arg) switch (action % NUMBER_OF_ACTIONS) { case ACTION_exit: printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" - ", [/* %u vars */] \n", + ", %p /* %u vars */ \n", tid, argv[0], argv[0], argv[1], argv[2], - arglen(environ), leader); + environ, arglen(environ), leader); break; case ACTION_rt_sigsuspend: printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" - ", [/* %u vars */] \n" + ", %p /* %u vars */ \n" "%-5d <... rt_sigsuspend resumed>) = ?\n", tid, argv[0], argv[0], argv[1], argv[2], - arglen(environ), + environ, arglen(environ), leader); break; case ACTION_nanosleep: printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" - ", [/* %u vars */] \n" + ", %p /* %u vars */ \n" "%-5d <... nanosleep resumed> )" " = ?\n", tid, argv[0], argv[0], argv[1], argv[2], - arglen(environ), + environ, arglen(environ), leader); break; } printf("%-5d +++ superseded by execve in pid %u +++\n" - "%-5d <... execve resumed> ) = 0\n", + "%-5d <... execve resumed>) = 0\n", leader, tid, leader); @@ -180,18 +161,15 @@ main(int ac, char **av) if (clock_nanosleep(CLOCK_REALTIME, 0, &ts, NULL)) perror_msg_and_skip("clock_nanosleep CLOCK_REALTIME"); - printf("%-5d execve(\"%s\", [\"%s\"], [/* %u vars */]) = 0\n", - leader, av[0], av[0], arglen(environ)); - get_sigsetsize(); static char buf[sizeof(sigsetsize) * 3]; sprintf(buf, "%u", sigsetsize); char *argv[] = { av[0], buf, (char *) "0", NULL }; printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" - ", [/* %u vars */]) = 0\n", + ", %p /* %u vars */) = 0\n", leader, argv[0], argv[0], argv[1], argv[2], - arglen(environ)); + environ, arglen(environ)); execve(argv[0], argv, environ); perror_msg_and_fail("execve"); } diff --git a/tests-m32/threads-execve.test b/tests-m32/threads-execve.test index 4a771467..04ce15df 100755 --- a/tests-m32/threads-execve.test +++ b/tests-m32/threads-execve.test @@ -3,29 +3,10 @@ # Check decoding of threads when a non-leader thread invokes execve. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2019 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -34,17 +15,20 @@ require_min_kernel_version_or_skip 3.1 check_prog diff +run_prog_skip_if_failed date +%s > /dev/null +s0="$(date +%s)" + run_prog > /dev/null set -- -a21 -f -esignal=none -e trace=execve,exit,nanosleep,rt_sigsuspend $args # Due to probabilistic nature of the test, try it several times. -i=0 -while [ $i -le 9 ]; do +while :; do run_strace "$@" > "$EXP" - diff -- "$EXP" "$LOG" || continue - rm -f "$EXP" - exit 0 + sed 1d < "$LOG" > "$OUT" + diff -- "$EXP" "$OUT" && exit 0 + s1="$(date +%s)" + if [ "$(($s1-$s0))" -gt "$(($TIMEOUT_DURATION/2))" ]; then + fail_ "$STRACE $* output mismatch" + fi done - -fail_ "$STRACE $* output mismatch" diff --git a/tests-m32/time.c b/tests-m32/time.c index 4a5cde9c..330c8846 100644 --- a/tests-m32/time.c +++ b/tests-m32/time.c @@ -2,29 +2,10 @@ * This file is part of time strace test. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,15 +21,24 @@ int main(void) { - time_t *p = tail_alloc(sizeof(time_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(time_t, p); time_t t = syscall(__NR_time, NULL); if ((time_t) -1 == t) perror_msg_and_skip("time"); - printf("time(NULL) = %jd\n", (intmax_t) t); + printf("time(NULL) = %lld (", (long long) t); + print_time_t_nsec(t, 0, 0); + puts(")"); + + t = syscall(__NR_time, p + 1); + printf("time(%p) = %s\n", p + 1, sprintrc(t)); t = syscall(__NR_time, p); - printf("time([%jd]) = %jd\n", (intmax_t) *p, (intmax_t) t); + printf("time([%lld", (long long) *p); + print_time_t_nsec((time_t) *p, 0, 1), + printf("]) = %lld (", (long long) t); + print_time_t_nsec(t, 0, 0); + puts(")"); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/time.gen.test b/tests-m32/time.gen.test new file mode 100755 index 00000000..3269b164 --- /dev/null +++ b/tests-m32/time.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (time -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-m32/time.test b/tests-m32/time.test deleted file mode 100755 index 6ab193a4..00000000 --- a/tests-m32/time.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check time syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 diff --git a/tests-m32/timer_create.c b/tests-m32/timer_create.c index 1a259627..c9c64813 100644 --- a/tests-m32/timer_create.c +++ b/tests-m32/timer_create.c @@ -1,30 +1,10 @@ /* * This file is part of timer_create strace test. * - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -98,9 +78,9 @@ main(void) sev.sigev_un.sigev_thread.attribute, tid[2]); -#ifndef SIGEV_THREAD_ID -# define SIGEV_THREAD_ID 4 -#endif +# ifndef SIGEV_THREAD_ID +# define SIGEV_THREAD_ID 4 +# endif sev.sigev_notify = SIGEV_THREAD_ID; sev.sigev_un.tid = getpid(); if (syscall(__NR_timer_create, CLOCK_MONOTONIC, &sev, &tid[3])) diff --git a/tests-m32/timer_create.gen.test b/tests-m32/timer_create.gen.test new file mode 100755 index 00000000..bf652612 --- /dev/null +++ b/tests-m32/timer_create.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (timer_create ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/timer_create.test b/tests-m32/timer_create.test deleted file mode 100755 index 870a1795..00000000 --- a/tests-m32/timer_create.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check timer_create syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/timer_xettime.c b/tests-m32/timer_xettime.c index 9eabbf08..17390c2d 100644 --- a/tests-m32/timer_xettime.c +++ b/tests-m32/timer_xettime.c @@ -2,29 +2,10 @@ * This file is part of timer_xettime strace test. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -47,6 +28,7 @@ main(void) printf("timer_settime(%d, TIMER_ABSTIME, NULL, NULL)" " = -1 EINVAL (%m)\n", 0xdefaced); + long rc; int tid; struct sigevent sev = { .sigev_notify = SIGEV_NONE }; @@ -55,51 +37,61 @@ main(void) printf("timer_create(CLOCK_MONOTONIC, {sigev_signo=0" ", sigev_notify=SIGEV_NONE}, [%d]) = 0\n", tid); - struct { - struct itimerspec its; - uint32_t pad[4]; - } old = { - .its = { - .it_interval = { 0xdeface5, 0xdeface6 }, - .it_value = { 0xdeface7, 0xdeface8 } - }, - .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } - }, new = { - .its = { - .it_interval = { 0xdeface1, 0xdeface2 }, - .it_value = { 0xdeface3, 0xdeface4 } - }, - .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } - }; - - if (syscall(__NR_timer_settime, tid, 0, &new.its, &old.its)) + TAIL_ALLOC_OBJECT_CONST_PTR(struct itimerspec, its_new); + TAIL_ALLOC_OBJECT_CONST_PTR(struct itimerspec, its_old); + + its_new->it_interval.tv_sec = 0xdeadbeefU; + its_new->it_interval.tv_nsec = 0xfacefeedU; + its_new->it_value.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + its_new->it_value.tv_nsec = (long) 0xbadc0dedfacefeedLL; + + rc = syscall(__NR_timer_settime, tid, 0, its_new, its_old); + printf("timer_settime(%d, 0" + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}, %p) = %s\n", + tid, (long long) its_new->it_interval.tv_sec, + zero_extend_signed_to_ull(its_new->it_interval.tv_nsec), + (long long) its_new->it_value.tv_sec, + zero_extend_signed_to_ull(its_new->it_value.tv_nsec), + its_old, sprintrc(rc)); + + its_new->it_interval.tv_sec = 0xdeface1; + its_new->it_interval.tv_nsec = 0xdeface2; + its_new->it_value.tv_sec = 0xdeface3; + its_new->it_value.tv_nsec = 0xdeface4; + its_old->it_interval.tv_sec = 0xdeface5; + its_old->it_interval.tv_nsec = 0xdeface6; + its_old->it_value.tv_sec = 0xdeface7; + its_old->it_value.tv_nsec = 0xdeface8; + + if (syscall(__NR_timer_settime, tid, 0, its_new, its_old)) perror_msg_and_skip("timer_settime"); printf("timer_settime(%d, 0" - ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" - ", it_value={tv_sec=%jd, tv_nsec=%jd}}" - ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" - ", it_value={tv_sec=%jd, tv_nsec=%jd}}" + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}" + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}" ") = 0\n", tid, - (intmax_t) new.its.it_interval.tv_sec, - (intmax_t) new.its.it_interval.tv_nsec, - (intmax_t) new.its.it_value.tv_sec, - (intmax_t) new.its.it_value.tv_nsec, - (intmax_t) old.its.it_interval.tv_sec, - (intmax_t) old.its.it_interval.tv_nsec, - (intmax_t) old.its.it_value.tv_sec, - (intmax_t) old.its.it_value.tv_nsec); - - if (syscall(__NR_timer_gettime, tid, &old.its)) + (long long) its_new->it_interval.tv_sec, + zero_extend_signed_to_ull(its_new->it_interval.tv_nsec), + (long long) its_new->it_value.tv_sec, + zero_extend_signed_to_ull(its_new->it_value.tv_nsec), + (long long) its_old->it_interval.tv_sec, + zero_extend_signed_to_ull(its_old->it_interval.tv_nsec), + (long long) its_old->it_value.tv_sec, + zero_extend_signed_to_ull(its_old->it_value.tv_nsec)); + + if (syscall(__NR_timer_gettime, tid, its_old)) perror_msg_and_skip("timer_gettime"); printf("timer_gettime(%d" - ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" - ", it_value={tv_sec=%jd, tv_nsec=%jd}}) = 0\n", + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}) = 0\n", tid, - (intmax_t) old.its.it_interval.tv_sec, - (intmax_t) old.its.it_interval.tv_nsec, - (intmax_t) old.its.it_value.tv_sec, - (intmax_t) old.its.it_value.tv_nsec); + (long long) its_old->it_interval.tv_sec, + zero_extend_signed_to_ull(its_old->it_interval.tv_nsec), + (long long) its_old->it_value.tv_sec, + zero_extend_signed_to_ull(its_old->it_value.tv_nsec)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/timer_xettime.gen.test b/tests-m32/timer_xettime.gen.test new file mode 100755 index 00000000..6e2dffaa --- /dev/null +++ b/tests-m32/timer_xettime.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (timer_xettime -e trace=timer_create,timer_settime,timer_gettime); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=timer_create,timer_settime,timer_gettime diff --git a/tests-m32/timer_xettime.test b/tests-m32/timer_xettime.test deleted file mode 100755 index 08bcdd68..00000000 --- a/tests-m32/timer_xettime.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check timer_create, timer_settime, and timer_gettime syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=timer_create,timer_settime,timer_gettime diff --git a/tests-m32/timerfd_xettime.c b/tests-m32/timerfd_xettime.c index ca7124ec..73616677 100644 --- a/tests-m32/timerfd_xettime.c +++ b/tests-m32/timerfd_xettime.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -47,49 +28,59 @@ main(void) perror_msg_and_skip("timerfd_create"); puts("timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC|TFD_NONBLOCK) = 0"); - struct { - struct itimerspec its; - uint32_t pad[4]; - } old = { - .its = { - .it_interval = { 0xdeface5, 0xdeface6 }, - .it_value = { 0xdeface7, 0xdeface8 } - }, - .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } - }, new = { - .its = { - .it_interval = { 0xdeface1, 0xdeface2 }, - .it_value = { 0xdeface3, 0xdeface4 } - }, - .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } - }; + TAIL_ALLOC_OBJECT_CONST_PTR(struct itimerspec, its_new); + TAIL_ALLOC_OBJECT_CONST_PTR(struct itimerspec, its_old); + + its_new->it_interval.tv_sec = 0xdeadbeefU; + its_new->it_interval.tv_nsec = 0xfacefeedU; + its_new->it_value.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + its_new->it_value.tv_nsec = (long) 0xbadc0dedfacefeedLL; + + long rc = syscall(__NR_timerfd_settime, 0, 0, its_new, its_old); + printf("timerfd_settime(0, 0" + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}, %p) = %s\n", + (long long) its_new->it_interval.tv_sec, + zero_extend_signed_to_ull(its_new->it_interval.tv_nsec), + (long long) its_new->it_value.tv_sec, + zero_extend_signed_to_ull(its_new->it_value.tv_nsec), + its_old, sprintrc(rc)); + + its_new->it_interval.tv_sec = 0xdeface1; + its_new->it_interval.tv_nsec = 0xdeface2; + its_new->it_value.tv_sec = 0xdeface3; + its_new->it_value.tv_nsec = 0xdeface4; + its_old->it_interval.tv_sec = 0xdeface5; + its_old->it_interval.tv_nsec = 0xdeface6; + its_old->it_value.tv_sec = 0xdeface7; + its_old->it_value.tv_nsec = 0xdeface8; - if (syscall(__NR_timerfd_settime, 0, 0, &new.its, &old.its)) + if (syscall(__NR_timerfd_settime, 0, 0, its_new, its_old)) perror_msg_and_skip("timerfd_settime"); printf("timerfd_settime(0, 0" - ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" - ", it_value={tv_sec=%jd, tv_nsec=%jd}}" - ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" - ", it_value={tv_sec=%jd, tv_nsec=%jd}}" + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}" + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}" ") = 0\n", - (intmax_t) new.its.it_interval.tv_sec, - (intmax_t) new.its.it_interval.tv_nsec, - (intmax_t) new.its.it_value.tv_sec, - (intmax_t) new.its.it_value.tv_nsec, - (intmax_t) old.its.it_interval.tv_sec, - (intmax_t) old.its.it_interval.tv_nsec, - (intmax_t) old.its.it_value.tv_sec, - (intmax_t) old.its.it_value.tv_nsec); + (long long) its_new->it_interval.tv_sec, + zero_extend_signed_to_ull(its_new->it_interval.tv_nsec), + (long long) its_new->it_value.tv_sec, + zero_extend_signed_to_ull(its_new->it_value.tv_nsec), + (long long) its_old->it_interval.tv_sec, + zero_extend_signed_to_ull(its_old->it_interval.tv_nsec), + (long long) its_old->it_value.tv_sec, + zero_extend_signed_to_ull(its_old->it_value.tv_nsec)); - if (syscall(__NR_timerfd_gettime, 0, &old.its)) + if (syscall(__NR_timerfd_gettime, 0, its_old)) perror_msg_and_skip("timerfd_gettime"); printf("timerfd_gettime(0" - ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" - ", it_value={tv_sec=%jd, tv_nsec=%jd}}) = 0\n", - (intmax_t) old.its.it_interval.tv_sec, - (intmax_t) old.its.it_interval.tv_nsec, - (intmax_t) old.its.it_value.tv_sec, - (intmax_t) old.its.it_value.tv_nsec); + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}) = 0\n", + (long long) its_old->it_interval.tv_sec, + zero_extend_signed_to_ull(its_old->it_interval.tv_nsec), + (long long) its_old->it_value.tv_sec, + zero_extend_signed_to_ull(its_old->it_value.tv_nsec)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/timerfd_xettime.gen.test b/tests-m32/timerfd_xettime.gen.test new file mode 100755 index 00000000..97e560bd --- /dev/null +++ b/tests-m32/timerfd_xettime.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (timerfd_xettime -e trace=timerfd_create,timerfd_settime,timerfd_gettime); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=timerfd_create,timerfd_settime,timerfd_gettime diff --git a/tests-m32/timerfd_xettime.test b/tests-m32/timerfd_xettime.test deleted file mode 100755 index 75aa21c2..00000000 --- a/tests-m32/timerfd_xettime.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check timerfd_create, timerfd_settime, and timerfd_gettime syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=timerfd_create,timerfd_settime,timerfd_gettime diff --git a/tests-m32/times-fail.c b/tests-m32/times-fail.c index cb69bd43..551803df 100644 --- a/tests-m32/times-fail.c +++ b/tests-m32/times-fail.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include @@ -5,7 +12,7 @@ #include int -main (void) +main(void) { assert(syscall(__NR_times, 0x42) == -1); printf("times(0x42) = -1 EFAULT (%m)\n"); diff --git a/tests-m32/times-fail.gen.test b/tests-m32/times-fail.gen.test new file mode 100755 index 00000000..9934d193 --- /dev/null +++ b/tests-m32/times-fail.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (times-fail -a12 -e trace=times); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 -e trace=times diff --git a/tests-m32/times-fail.test b/tests-m32/times-fail.test deleted file mode 100755 index ee28a060..00000000 --- a/tests-m32/times-fail.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of failing times syscall - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a12 -e trace=times diff --git a/tests-m32/times.c b/tests-m32/times.c index 2c7b95e5..a390dde4 100644 --- a/tests-m32/times.c +++ b/tests-m32/times.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2015 Eugene Syromyatnikov * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ /** @@ -49,7 +30,7 @@ enum { }; int -main (void) +main(void) { struct timespec ts; volatile int dummy = 0; diff --git a/tests-m32/times.gen.test b/tests-m32/times.gen.test new file mode 100755 index 00000000..06b036fc --- /dev/null +++ b/tests-m32/times.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (times -esignal=none ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests-m32/times.test b/tests-m32/times.test deleted file mode 100755 index b97e0d33..00000000 --- a/tests-m32/times.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of times syscall - -. "${srcdir=.}/init.sh" -run_strace_match_diff -esignal=none diff --git a/tests-m32/tprintf.c b/tests-m32/tprintf.c index a759d8af..060af760 100644 --- a/tests-m32/tprintf.c +++ b/tests-m32/tprintf.c @@ -1,30 +1,10 @@ /* * Close stdin, move stdout to a non-standard descriptor, and print. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/trace_fstat.gen.test b/tests-m32/trace_fstat.gen.test new file mode 100755 index 00000000..c3aede16 --- /dev/null +++ b/tests-m32/trace_fstat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_fstat test_trace_expr '' -e%fstat -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e%fstat -v -P stat.sample -P /dev/full diff --git a/tests-m32/trace_fstat.in b/tests-m32/trace_fstat.in new file mode 100644 index 00000000..3fde131d --- /dev/null +++ b/tests-m32/trace_fstat.in @@ -0,0 +1,11 @@ +fstat -a15 +fstat-Xabbrev -a15 -Xabbrev +fstat-Xraw -a15 -Xraw +fstat-Xverbose -a15 -Xverbose +fstat64 -a17 +fstat64-Xabbrev -a17 -Xabbrev +fstat64-Xraw -a17 -Xraw +fstat64-Xverbose -a17 -Xverbose +fstatat64 -a32 +newfstatat -a32 +oldfstat -a21 diff --git a/tests-m32/trace_fstatfs.gen.test b/tests-m32/trace_fstatfs.gen.test new file mode 100755 index 00000000..063f624c --- /dev/null +++ b/tests-m32/trace_fstatfs.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_fstatfs test_trace_expr '' -e%fstatfs); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e%fstatfs diff --git a/tests-m32/trace_fstatfs.in b/tests-m32/trace_fstatfs.in new file mode 100644 index 00000000..6441a079 --- /dev/null +++ b/tests-m32/trace_fstatfs.in @@ -0,0 +1,2 @@ +fstatfs -a18 +fstatfs64 -a24 diff --git a/tests-m32/trace_lstat.gen.test b/tests-m32/trace_lstat.gen.test new file mode 100755 index 00000000..a05b7a15 --- /dev/null +++ b/tests-m32/trace_lstat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_lstat test_trace_expr '' -e%lstat -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e%lstat -v -P stat.sample -P /dev/full diff --git a/tests-m32/trace_lstat.in b/tests-m32/trace_lstat.in new file mode 100644 index 00000000..abbabc49 --- /dev/null +++ b/tests-m32/trace_lstat.in @@ -0,0 +1,3 @@ +lstat -a32 +lstat64 -a32 +oldlstat -a32 diff --git a/tests-m32/trace_personality_32.gen.test b/tests-m32/trace_personality_32.gen.test new file mode 100755 index 00000000..a5f5c7d1 --- /dev/null +++ b/tests-m32/trace_personality_32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_personality_32 +qualify_personality.sh 32 'getcwd' 'fsync-y'); do not edit. +set -- 32 'getcwd' 'fsync-y' +. "${srcdir=.}/qualify_personality.sh" diff --git a/tests-m32/trace_personality_32.in b/tests-m32/trace_personality_32.in new file mode 100644 index 00000000..9da47c1a --- /dev/null +++ b/tests-m32/trace_personality_32.in @@ -0,0 +1 @@ +getcwd -a18 diff --git a/tests-m32/trace_personality_64.gen.test b/tests-m32/trace_personality_64.gen.test new file mode 100755 index 00000000..5b961efa --- /dev/null +++ b/tests-m32/trace_personality_64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_personality_64 +qualify_personality.sh 64 'getcwd' 'fsync-y'); do not edit. +set -- 64 'getcwd' 'fsync-y' +. "${srcdir=.}/qualify_personality.sh" diff --git a/tests-m32/trace_personality_64.in b/tests-m32/trace_personality_64.in new file mode 100644 index 00000000..9da47c1a --- /dev/null +++ b/tests-m32/trace_personality_64.in @@ -0,0 +1 @@ +getcwd -a18 diff --git a/tests-m32/trace_personality_regex_32.gen.test b/tests-m32/trace_personality_regex_32.gen.test new file mode 100755 index 00000000..f2800d2a --- /dev/null +++ b/tests-m32/trace_personality_regex_32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_personality_regex_32 +qualify_personality.sh 32 '/clock.*' 'times|fcntl.*'); do not edit. +set -- 32 '/clock.*' 'times|fcntl.*' +. "${srcdir=.}/qualify_personality.sh" diff --git a/tests-m32/trace_personality_regex_32.in b/tests-m32/trace_personality_regex_32.in new file mode 100755 index 00000000..864de290 --- /dev/null +++ b/tests-m32/trace_personality_regex_32.in @@ -0,0 +1,3 @@ +clock_adjtime -a37 +clock_nanosleep +clock_xettime -a36 diff --git a/tests-m32/trace_personality_regex_64.gen.test b/tests-m32/trace_personality_regex_64.gen.test new file mode 100755 index 00000000..4b19f1b0 --- /dev/null +++ b/tests-m32/trace_personality_regex_64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_personality_regex_64 +qualify_personality.sh 64 '/clock.*' 'times|fcntl.*'); do not edit. +set -- 64 '/clock.*' 'times|fcntl.*' +. "${srcdir=.}/qualify_personality.sh" diff --git a/tests-m32/trace_personality_regex_64.in b/tests-m32/trace_personality_regex_64.in new file mode 100755 index 00000000..864de290 --- /dev/null +++ b/tests-m32/trace_personality_regex_64.in @@ -0,0 +1,3 @@ +clock_adjtime -a37 +clock_nanosleep +clock_xettime -a36 diff --git a/tests-m32/trace_personality_regex_x32.gen.test b/tests-m32/trace_personality_regex_x32.gen.test new file mode 100755 index 00000000..7f416712 --- /dev/null +++ b/tests-m32/trace_personality_regex_x32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_personality_regex_x32 +qualify_personality.sh x32 '/clock.*' 'times|fcntl.*'); do not edit. +set -- x32 '/clock.*' 'times|fcntl.*' +. "${srcdir=.}/qualify_personality.sh" diff --git a/tests-m32/trace_personality_regex_x32.in b/tests-m32/trace_personality_regex_x32.in new file mode 100755 index 00000000..864de290 --- /dev/null +++ b/tests-m32/trace_personality_regex_x32.in @@ -0,0 +1,3 @@ +clock_adjtime -a37 +clock_nanosleep +clock_xettime -a36 diff --git a/tests-m32/trace_personality_x32.gen.test b/tests-m32/trace_personality_x32.gen.test new file mode 100755 index 00000000..724499ae --- /dev/null +++ b/tests-m32/trace_personality_x32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_personality_x32 +qualify_personality.sh x32 'getcwd' 'fsync-y'); do not edit. +set -- x32 'getcwd' 'fsync-y' +. "${srcdir=.}/qualify_personality.sh" diff --git a/tests-m32/trace_personality_x32.in b/tests-m32/trace_personality_x32.in new file mode 100644 index 00000000..9da47c1a --- /dev/null +++ b/tests-m32/trace_personality_x32.in @@ -0,0 +1 @@ +getcwd -a18 diff --git a/tests-m32/trace_question.gen.test b/tests-m32/trace_question.gen.test new file mode 100755 index 00000000..76b3578c --- /dev/null +++ b/tests-m32/trace_question.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_question test_trace_expr '' -e?osf_utimes,?/^pkey_.*); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e?osf_utimes,?/^pkey_.* diff --git a/tests-m32/trace_question.in b/tests-m32/trace_question.in new file mode 100644 index 00000000..74d662c5 --- /dev/null +++ b/tests-m32/trace_question.in @@ -0,0 +1,4 @@ +osf_utimes -a21 +pkey_alloc -a17 +pkey_free -a13 +pkey_mprotect -a37 diff --git a/tests-m32/trace_stat.gen.test b/tests-m32/trace_stat.gen.test new file mode 100755 index 00000000..ae95ab86 --- /dev/null +++ b/tests-m32/trace_stat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_stat test_trace_expr '' -e%stat -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e%stat -v -P stat.sample -P /dev/full diff --git a/tests-m32/trace_stat.in b/tests-m32/trace_stat.in new file mode 100644 index 00000000..f105d784 --- /dev/null +++ b/tests-m32/trace_stat.in @@ -0,0 +1,3 @@ +oldstat -a32 +stat -a32 +stat64 -a32 diff --git a/tests-m32/trace_stat_like.gen.test b/tests-m32/trace_stat_like.gen.test new file mode 100755 index 00000000..5681a8a3 --- /dev/null +++ b/tests-m32/trace_stat_like.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_stat_like test_trace_expr '' -e%%stat -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e%%stat -v -P stat.sample -P /dev/full diff --git a/tests-m32/trace_stat_like.in b/tests-m32/trace_stat_like.in new file mode 100644 index 00000000..c48addbf --- /dev/null +++ b/tests-m32/trace_stat_like.in @@ -0,0 +1,18 @@ +fstat -a15 +fstat-Xabbrev -a15 -Xabbrev +fstat-Xraw -a15 -Xraw +fstat-Xverbose -a15 -Xverbose +fstat64 -a17 +fstat64-Xabbrev -a17 -Xabbrev +fstat64-Xraw -a17 -Xraw +fstat64-Xverbose -a17 -Xverbose +fstatat64 -a32 +lstat -a32 +lstat64 -a32 +newfstatat -a32 +oldfstat -a21 +oldlstat -a32 +oldstat -a32 +stat -a32 +stat64 -a32 +statx -a32 diff --git a/tests-m32/trace_statfs.gen.test b/tests-m32/trace_statfs.gen.test new file mode 100755 index 00000000..957412b9 --- /dev/null +++ b/tests-m32/trace_statfs.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_statfs test_trace_expr '' -e%statfs); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e%statfs diff --git a/tests-m32/trace_statfs.in b/tests-m32/trace_statfs.in new file mode 100644 index 00000000..7c4adfe1 --- /dev/null +++ b/tests-m32/trace_statfs.in @@ -0,0 +1,2 @@ +statfs -a17 +statfs64 -a23 diff --git a/tests-m32/trace_statfs_like.gen.test b/tests-m32/trace_statfs_like.gen.test new file mode 100755 index 00000000..be1a9c03 --- /dev/null +++ b/tests-m32/trace_statfs_like.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_statfs_like test_trace_expr '' -e%%statfs); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e%%statfs diff --git a/tests-m32/trace_statfs_like.in b/tests-m32/trace_statfs_like.in new file mode 100644 index 00000000..285aec6c --- /dev/null +++ b/tests-m32/trace_statfs_like.in @@ -0,0 +1,5 @@ +statfs -a17 +statfs64 -a23 +fstatfs -a18 +fstatfs64 -a24 +ustat -a33 diff --git a/tests-m32/truncate.c b/tests-m32/truncate.c index d9529334..bfb6299b 100644 --- a/tests-m32/truncate.c +++ b/tests-m32/truncate.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/truncate.gen.test b/tests-m32/truncate.gen.test new file mode 100755 index 00000000..7a631ef0 --- /dev/null +++ b/tests-m32/truncate.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (truncate ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/truncate.test b/tests-m32/truncate.test deleted file mode 100755 index 6bf1e702..00000000 --- a/tests-m32/truncate.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check truncate syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/truncate64.c b/tests-m32/truncate64.c index 8c29ea81..1dceb414 100644 --- a/tests-m32/truncate64.c +++ b/tests-m32/truncate64.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/truncate64.gen.test b/tests-m32/truncate64.gen.test new file mode 100755 index 00000000..2b368f44 --- /dev/null +++ b/tests-m32/truncate64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (truncate64 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-m32/truncate64.test b/tests-m32/truncate64.test deleted file mode 100755 index c4668062..00000000 --- a/tests-m32/truncate64.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check truncate64 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-m32/ugetrlimit.c b/tests-m32/ugetrlimit.c index a99e496d..49627c1f 100644 --- a/tests-m32/ugetrlimit.c +++ b/tests-m32/ugetrlimit.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/ugetrlimit.gen.test b/tests-m32/ugetrlimit.gen.test new file mode 100755 index 00000000..a412fe6a --- /dev/null +++ b/tests-m32/ugetrlimit.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ugetrlimit -a28 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-m32/ugetrlimit.test b/tests-m32/ugetrlimit.test deleted file mode 100755 index f4648ff1..00000000 --- a/tests-m32/ugetrlimit.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of ugetrlimit syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 diff --git a/tests-m32/uio.c b/tests-m32/uio.c index 6291f972..d1a1cc51 100644 --- a/tests-m32/uio.c +++ b/tests-m32/uio.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -39,16 +20,16 @@ main(void) { const off_t offset = 0xdefaceddeadbeefLL; char buf[4]; - struct iovec iov = { buf, sizeof buf }; + struct iovec iov = { buf, sizeof(buf) }; (void) close(0); assert(open("/dev/zero", O_RDONLY) == 0); - assert(pread(0, buf, sizeof buf, offset) == 4); + assert(pread(0, buf, sizeof(buf), offset) == 4); assert(preadv(0, &iov, 1, offset) == 4); assert(!close(0)); assert(open("/dev/null", O_WRONLY) == 0); - assert(pwrite(0, buf, sizeof buf, offset) == 4); + assert(pwrite(0, buf, sizeof(buf), offset) == 4); assert(pwritev(0, &iov, 1, offset) == 4); assert(!close(0)); diff --git a/tests-m32/uio.test b/tests-m32/uio.test index 020b97e9..75eb5de2 100755 --- a/tests-m32/uio.test +++ b/tests-m32/uio.test @@ -1,11 +1,16 @@ #!/bin/sh - +# # Check how pread/pwrite and preadv/pwritev syscalls are traced. +# +# Copyright (c) 2014-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog -run_strace -edesc $args +run_strace -e%desc $args match_grep exit 0 diff --git a/tests-m32/umask.c b/tests-m32/umask.c index 86903a95..1a196f43 100644 --- a/tests-m32/umask.c +++ b/tests-m32/umask.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include #include diff --git a/tests-m32/umask.gen.test b/tests-m32/umask.gen.test new file mode 100755 index 00000000..5d6c3187 --- /dev/null +++ b/tests-m32/umask.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (umask -a11 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 diff --git a/tests-m32/umask.test b/tests-m32/umask.test deleted file mode 100755 index 1351721f..00000000 --- a/tests-m32/umask.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check umask syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a11 diff --git a/tests-m32/umode_t.c b/tests-m32/umode_t.c index 5041638e..9c4e304f 100644 --- a/tests-m32/umode_t.c +++ b/tests-m32/umode_t.c @@ -2,29 +2,10 @@ * Check decoding of umode_t type syscall arguments. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -38,7 +19,7 @@ # define TEST_SYSCALL_PREFIX_STR "" #endif -static const char sample[] = TEST_SYSCALL_STR; +static const char *sample; static void test_syscall(unsigned short mode) @@ -49,17 +30,18 @@ test_syscall(unsigned short mode) if (mode <= 07) printf("%s(%s\"%s\", 00%d) = %ld %s (%m)\n", - sample, TEST_SYSCALL_PREFIX_STR, + TEST_SYSCALL_STR, TEST_SYSCALL_PREFIX_STR, sample, (int) mode, rc, errno2name()); else printf("%s(%s\"%s\", %#03ho) = %ld %s (%m)\n", - sample, TEST_SYSCALL_PREFIX_STR, + TEST_SYSCALL_STR, TEST_SYSCALL_PREFIX_STR, sample, mode, rc, errno2name()); } int -main(void) +main(int ac, char **av) { + sample = av[0]; test_syscall(0); test_syscall(0xffff); test_syscall(06); diff --git a/tests-m32/umount.c b/tests-m32/umount.c index eda7ae5c..cd89aa0b 100644 --- a/tests-m32/umount.c +++ b/tests-m32/umount.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2019 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -35,7 +15,7 @@ #ifdef __NR_oldumount # define TEST_SYSCALL_STR "oldumount" #else -# if defined __NR_umount && defined __NR_umount2 +# if defined __NR_umount && defined __NR_umount2 && __NR_umount != __NR_umount2 # define __NR_oldumount __NR_umount # define TEST_SYSCALL_STR "umount" # endif diff --git a/tests-m32/umount.test b/tests-m32/umount.test index a5840d54..e98ad9f3 100755 --- a/tests-m32/umount.test +++ b/tests-m32/umount.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check umount syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests-m32/umount2.c b/tests-m32/umount2.c index 1a6d8451..d313d597 100644 --- a/tests-m32/umount2.c +++ b/tests-m32/umount2.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2019 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,7 +12,7 @@ #include #include -#ifdef __NR_umount2 +#if defined __NR_umount2 && (!defined __NR_umount || __NR_umount2 != __NR_umount) # define TEST_SYSCALL_STR "umount2" #else # define __NR_umount2 __NR_umount diff --git a/tests-m32/umount2.test b/tests-m32/umount2.test index c43b38db..33b466d5 100755 --- a/tests-m32/umount2.test +++ b/tests-m32/umount2.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check umount2 syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests-m32/umoven-illptr.c b/tests-m32/umoven-illptr.c index 4deee163..25839f77 100644 --- a/tests-m32/umoven-illptr.c +++ b/tests-m32/umoven-illptr.c @@ -1,30 +1,10 @@ /* * Check decoding of invalid pointer by umoven. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/umoven-illptr.gen.test b/tests-m32/umoven-illptr.gen.test new file mode 100755 index 00000000..eea7b1c2 --- /dev/null +++ b/tests-m32/umoven-illptr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (umoven-illptr -a36 -e trace=nanosleep); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 -e trace=nanosleep diff --git a/tests-m32/umoven-illptr.test b/tests-m32/umoven-illptr.test deleted file mode 100755 index 7b8cb314..00000000 --- a/tests-m32/umoven-illptr.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of invalid pointer by umoven. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a36 -e trace=nanosleep diff --git a/tests-m32/umovestr-illptr.c b/tests-m32/umovestr-illptr.c index dea6885d..5a24357a 100644 --- a/tests-m32/umovestr-illptr.c +++ b/tests-m32/umovestr-illptr.c @@ -1,30 +1,10 @@ /* * Check decoding of invalid pointer by umovestr. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/umovestr-illptr.gen.test b/tests-m32/umovestr-illptr.gen.test new file mode 100755 index 00000000..7685d442 --- /dev/null +++ b/tests-m32/umovestr-illptr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (umovestr-illptr -a11 -e trace=chdir); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=chdir diff --git a/tests-m32/umovestr-illptr.test b/tests-m32/umovestr-illptr.test deleted file mode 100755 index 6f1cc862..00000000 --- a/tests-m32/umovestr-illptr.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of invalid pointer by umovestr. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a11 -e trace=chdir diff --git a/tests-m32/umovestr.c b/tests-m32/umovestr.c index 95fccb67..6cb5f78d 100644 --- a/tests-m32/umovestr.c +++ b/tests-m32/umovestr.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/umovestr.test b/tests-m32/umovestr.test index 5ae8ffa9..3bfe1900 100755 --- a/tests-m32/umovestr.test +++ b/tests-m32/umovestr.test @@ -1,4 +1,9 @@ #!/bin/sh +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later # umovestr short read regression test diff --git a/tests-m32/umovestr2.c b/tests-m32/umovestr2.c index b2c63d80..a8bbf5ca 100644 --- a/tests-m32/umovestr2.c +++ b/tests-m32/umovestr2.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/umovestr2.test b/tests-m32/umovestr2.test index 5c5d561f..278a9675 100755 --- a/tests-m32/umovestr2.test +++ b/tests-m32/umovestr2.test @@ -1,4 +1,9 @@ #!/bin/sh +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later # umovestr short read regression test @@ -9,7 +14,3 @@ run_strace -veexecve -s262144 $args > "$EXP" check_prog sed sed 1d < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" - -exit 0 diff --git a/tests-m32/umovestr3.c b/tests-m32/umovestr3.c index cf2fa7d4..524ee33f 100644 --- a/tests-m32/umovestr3.c +++ b/tests-m32/umovestr3.c @@ -1,34 +1,15 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" +#include #include #include -#include int main(void) diff --git a/tests-m32/umovestr3.gen.test b/tests-m32/umovestr3.gen.test new file mode 100755 index 00000000..b16e1edd --- /dev/null +++ b/tests-m32/umovestr3.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (umovestr3 -a14 -e trace=chdir); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 -e trace=chdir diff --git a/tests-m32/umovestr3.test b/tests-m32/umovestr3.test deleted file mode 100755 index d5be2832..00000000 --- a/tests-m32/umovestr3.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# yet another umovestr short read test - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a14 -e trace=chdir diff --git a/tests-m32/uname.c b/tests-m32/uname.c index cd6f51cd..386fd99b 100644 --- a/tests-m32/uname.c +++ b/tests-m32/uname.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -10,26 +17,25 @@ int main(int ac, char **av) { int abbrev = ac > 1; - struct utsname *const uname = tail_alloc(sizeof(struct utsname)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct utsname, uname); int rc = syscall(__NR_uname, uname); - printf("uname({sysname=\""); + printf("uname({sysname="); print_quoted_string(uname->sysname); - printf("\", nodename=\""); + printf(", nodename="); print_quoted_string(uname->nodename); if (abbrev) { - printf("\", ..."); + printf(", ..."); } else { - printf("\", release=\""); + printf(", release="); print_quoted_string(uname->release); - printf("\", version=\""); + printf(", version="); print_quoted_string(uname->version); - printf("\", machine=\""); + printf(", machine="); print_quoted_string(uname->machine); # ifdef HAVE_STRUCT_UTSNAME_DOMAINNAME - printf("\", domainname=\""); + printf(", domainname="); print_quoted_string(uname->domainname); # endif - printf("\""); } printf("}) = %d\n", rc); diff --git a/tests-m32/uname.test b/tests-m32/uname.test index 03fe30cd..2272c4f0 100755 --- a/tests-m32/uname.test +++ b/tests-m32/uname.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check uname syscall decoding. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -10,9 +15,8 @@ run_prog > /dev/null run_strace -v -euname $args > "$EXP" uniq < "$LOG" > "$OUT" -run_prog "./$NAME" abbrev > /dev/null +run_prog "../$NAME" abbrev > /dev/null run_strace -euname $args >> "$EXP" uniq < "$LOG" >> "$OUT" match_diff "$OUT" "$EXP" -rm -f "$OUT" "$EXP" diff --git a/tests-m32/unblock_reset_raise.c b/tests-m32/unblock_reset_raise.c new file mode 100644 index 00000000..68479b76 --- /dev/null +++ b/tests-m32/unblock_reset_raise.c @@ -0,0 +1,34 @@ +/* + * Unblock, reset, and raise a signal. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +int +main(int ac, char **av) +{ + if (ac != 2) + error_msg_and_fail("usage: unblock_raise signo"); + + sigset_t mask; + sigemptyset(&mask); + const int signo = atoi(av[1]); + if (sigaddset(&mask, signo)) + perror_msg_and_fail("sigaddset: %s", av[1]); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + if (signal(signo, SIG_DFL) == SIG_ERR) + perror_msg_and_fail("signal: %s", av[1]); + if (raise(signo)) + perror_msg_and_fail("raise: %s", av[1]); + + return 0; +} diff --git a/tests-m32/unix-pair-send-recv.c b/tests-m32/unix-pair-send-recv.c index d4ac0d23..73ddd1e0 100644 --- a/tests-m32/unix-pair-send-recv.c +++ b/tests-m32/unix-pair-send-recv.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/unix-pair-send-recv.test b/tests-m32/unix-pair-send-recv.test index 4defdebb..60def6ab 100755 --- a/tests-m32/unix-pair-send-recv.test +++ b/tests-m32/unix-pair-send-recv.test @@ -1,10 +1,15 @@ #!/bin/sh - +# # Check decoding and dumping of send and recv syscalls. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./unix-pair-send-recv abcdefghijklmnopqrstuvwxyz +run_prog ../unix-pair-send-recv abcdefghijklmnopqrstuvwxyz run_strace -a32 -esignal=none -esend,recv -eread=0 -ewrite=0 $args match_diff diff --git a/tests-m32/unix-pair-sendto-recvfrom.c b/tests-m32/unix-pair-sendto-recvfrom.c index cea382c9..98508e2d 100644 --- a/tests-m32/unix-pair-sendto-recvfrom.c +++ b/tests-m32/unix-pair-sendto-recvfrom.c @@ -2,29 +2,10 @@ * Check decoding and dumping of sendto and recvfrom syscalls. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -71,7 +52,7 @@ main(int ac, char **av) assert(recvfrom(0, av[1], len, MSG_WAITALL, NULL, NULL) == len); assert(close(0) == 0); - int status; + int status; assert(waitpid(pid, &status, 0) == pid); assert(status == 0); } else { diff --git a/tests-m32/unix-pair-sendto-recvfrom.test b/tests-m32/unix-pair-sendto-recvfrom.test index 21afe236..bd59ab7d 100755 --- a/tests-m32/unix-pair-sendto-recvfrom.test +++ b/tests-m32/unix-pair-sendto-recvfrom.test @@ -1,10 +1,15 @@ #!/bin/sh - +# # Check decoding and dumping of sendto and recvfrom syscalls. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./unix-pair-sendto-recvfrom abcdefghijklmnopqrstuvwxyz +run_prog ../unix-pair-sendto-recvfrom abcdefghijklmnopqrstuvwxyz run_strace -esignal=none -esendto,recvfrom -eread=0 -ewrite=0 $args match_diff diff --git a/tests-m32/unlink.c b/tests-m32/unlink.c index bbb1de15..9c33b624 100644 --- a/tests-m32/unlink.c +++ b/tests-m32/unlink.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/unlink.gen.test b/tests-m32/unlink.gen.test new file mode 100755 index 00000000..63bc0c42 --- /dev/null +++ b/tests-m32/unlink.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (unlink -a24 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-m32/unlink.test b/tests-m32/unlink.test deleted file mode 100755 index 09bf79a7..00000000 --- a/tests-m32/unlink.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check unlink syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 diff --git a/tests-m32/unlinkat.c b/tests-m32/unlinkat.c index 22c3de39..0ae67964 100644 --- a/tests-m32/unlinkat.c +++ b/tests-m32/unlinkat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/unlinkat.gen.test b/tests-m32/unlinkat.gen.test new file mode 100755 index 00000000..5de79084 --- /dev/null +++ b/tests-m32/unlinkat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (unlinkat -a35 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests-m32/unlinkat.test b/tests-m32/unlinkat.test deleted file mode 100755 index 864261f7..00000000 --- a/tests-m32/unlinkat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check unlinkat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a35 diff --git a/tests-m32/unshare.c b/tests-m32/unshare.c index 5aedde47..a49f9ef9 100644 --- a/tests-m32/unshare.c +++ b/tests-m32/unshare.c @@ -2,29 +2,10 @@ * Check decoding of unshare syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/unshare.gen.test b/tests-m32/unshare.gen.test new file mode 100755 index 00000000..782ce47a --- /dev/null +++ b/tests-m32/unshare.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (unshare -a11 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 diff --git a/tests-m32/unshare.test b/tests-m32/unshare.test deleted file mode 100755 index ccb9575e..00000000 --- a/tests-m32/unshare.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of setns syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a11 diff --git a/tests-m32/userfaultfd.c b/tests-m32/userfaultfd.c index 60432fa3..9e59c0fe 100644 --- a/tests-m32/userfaultfd.c +++ b/tests-m32/userfaultfd.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/userfaultfd.gen.test b/tests-m32/userfaultfd.gen.test new file mode 100755 index 00000000..61b6988e --- /dev/null +++ b/tests-m32/userfaultfd.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (userfaultfd -a38 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a38 diff --git a/tests-m32/userfaultfd.test b/tests-m32/userfaultfd.test deleted file mode 100755 index af8b6fbe..00000000 --- a/tests-m32/userfaultfd.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check userfaultfd syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a38 diff --git a/tests-m32/ustat.c b/tests-m32/ustat.c index 57bb29c2..0945a70d 100644 --- a/tests-m32/ustat.c +++ b/tests-m32/ustat.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -47,7 +28,7 @@ main(void) long rc; # ifdef HAVE_USTAT_H - struct ustat *const ust = tail_alloc(sizeof(*ust)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct ustat, ust); struct stat st; if (stat(".", &st)) perror_msg_and_fail("stat"); @@ -55,10 +36,10 @@ main(void) dev = (unsigned int) st.st_dev; rc = syscall(__NR_ustat, dev, ust); if (rc) - printf("ustat(makedev(%u, %u), %p) = %s\n", + printf("ustat(makedev(%#x, %#x), %p) = %s\n", major(dev), minor(dev), ust, sprintrc(rc)); else - printf("ustat(makedev(%u, %u)" + printf("ustat(makedev(%#x, %#x)" ", {f_tfree=%llu, f_tinode=%llu}) = 0\n", major(dev), minor(dev), zero_extend_signed_to_ull(ust->f_tfree), @@ -67,11 +48,11 @@ main(void) dev = (unsigned int) magic; rc = syscall(__NR_ustat, magic, 0); - printf("ustat(makedev(%u, %u), NULL) = %s\n", + printf("ustat(makedev(%#x, %#x), NULL) = %s\n", major(dev), minor(dev), sprintrc(rc)); rc = syscall(__NR_ustat, magic, buf); - printf("ustat(makedev(%u, %u), %p) = %s\n", + printf("ustat(makedev(%#x, %#x), %p) = %s\n", major(dev), minor(dev), buf, sprintrc(rc)); puts("+++ exited with 0 +++"); diff --git a/tests-m32/ustat.gen.test b/tests-m32/ustat.gen.test new file mode 100755 index 00000000..2b09f7e9 --- /dev/null +++ b/tests-m32/ustat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ustat -a33 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 diff --git a/tests-m32/ustat.test b/tests-m32/ustat.test deleted file mode 100755 index 60a88e0a..00000000 --- a/tests-m32/ustat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check ustat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a33 diff --git a/tests-m32/utime.c b/tests-m32/utime.c index 8fd594f0..151b31a9 100644 --- a/tests-m32/utime.c +++ b/tests-m32/utime.c @@ -2,29 +2,10 @@ * Check decoding of utime syscall. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -38,17 +19,6 @@ # include # include - -static void -print_tm(const struct tm * const p) -{ - char buf[256]; - - strftime(buf, sizeof(buf), "%FT%T%z", p); - - printf("%s", buf); -} - static long k_utime(const void *const filename, const void *const times) { @@ -60,8 +30,7 @@ main(void) { static const char *const dummy_str = "dummy filename"; - const time_t t = time(NULL); - const struct tm * const p = localtime(&t); + const time_t t = 1492350678; const struct utimbuf u = { .actime = t, .modtime = t }; const struct utimbuf *const tail_u = tail_memdup(&u, sizeof(u)); const char *const dummy_filename = @@ -80,10 +49,10 @@ main(void) rc = k_utime("utime\nfilename", tail_u); const char *errstr = sprintrc(rc); - printf("utime(\"utime\\nfilename\", {actime="); - print_tm(p); - printf(", modtime="); - print_tm(p); + printf("utime(\"utime\\nfilename\", {actime=%lld", (long long) t); + print_time_t_nsec(t, 0, 1); + printf(", modtime=%lld", (long long) t); + print_time_t_nsec(t, 0, 1); printf("}) = %s\n", errstr); puts("+++ exited with 0 +++"); diff --git a/tests-m32/utime.gen.test b/tests-m32/utime.gen.test new file mode 100755 index 00000000..58ebc5ac --- /dev/null +++ b/tests-m32/utime.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (utime -a16 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 diff --git a/tests-m32/utime.test b/tests-m32/utime.test deleted file mode 100755 index bd64c532..00000000 --- a/tests-m32/utime.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of utime syscall. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a 16 -e trace=utime diff --git a/tests-m32/utimensat-Xabbrev.c b/tests-m32/utimensat-Xabbrev.c new file mode 100644 index 00000000..77a4ca03 --- /dev/null +++ b/tests-m32/utimensat-Xabbrev.c @@ -0,0 +1 @@ +#include "utimensat.c" diff --git a/tests-m32/utimensat-Xabbrev.gen.test b/tests-m32/utimensat-Xabbrev.gen.test new file mode 100755 index 00000000..2bd1c40f --- /dev/null +++ b/tests-m32/utimensat-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (utimensat-Xabbrev -a33 -Xabbrev -e trace=utimensat); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -Xabbrev -e trace=utimensat diff --git a/tests-m32/utimensat-Xraw.c b/tests-m32/utimensat-Xraw.c new file mode 100644 index 00000000..5cd1f01c --- /dev/null +++ b/tests-m32/utimensat-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "utimensat.c" diff --git a/tests-m32/utimensat-Xraw.gen.test b/tests-m32/utimensat-Xraw.gen.test new file mode 100755 index 00000000..7cf0d58c --- /dev/null +++ b/tests-m32/utimensat-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (utimensat-Xraw -a29 -Xraw -e trace=utimensat); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a29 -Xraw -e trace=utimensat diff --git a/tests-m32/utimensat-Xverbose.c b/tests-m32/utimensat-Xverbose.c new file mode 100644 index 00000000..cbcceae1 --- /dev/null +++ b/tests-m32/utimensat-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "utimensat.c" diff --git a/tests-m32/utimensat-Xverbose.gen.test b/tests-m32/utimensat-Xverbose.gen.test new file mode 100755 index 00000000..c49f2668 --- /dev/null +++ b/tests-m32/utimensat-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (utimensat-Xverbose -a44 -Xverbose -e trace=utimensat); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a44 -Xverbose -e trace=utimensat diff --git a/tests-m32/utimensat.c b/tests-m32/utimensat.c index 6d9faac2..170b2c89 100644 --- a/tests-m32/utimensat.c +++ b/tests-m32/utimensat.c @@ -1,93 +1,220 @@ /* - * This file is part of utimensat strace test. + * Check decoding of utimensat syscall. * - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" -#include -#include #include #include #include #include #include - -#if defined HAVE_UTIMENSAT \ - && defined AT_FDCWD && defined AT_SYMLINK_NOFOLLOW \ - && defined UTIME_NOW && defined UTIME_OMIT +#include +#include + +#if defined __NR_utimensat && defined UTIME_NOW && defined UTIME_OMIT + +# if SIZEOF_KERNEL_LONG_T == 4 +# define big_tv_sec "-559038737" +# define huge_tv_sec "-559038737" +# else +# define big_tv_sec "3735928559" +# define huge_tv_sec "-3819351491602432273" +# endif + +# if XLAT_RAW +# define str_at_fdcwd "-100" +# define str_at_symlink_nofollow "0x100" +# define str_at_removedir "0x200" +# define str_flags1 "0x600" +# define str_flags2 "0xffffffff" +# define str_utime_now_omit \ + "[{tv_sec=" big_tv_sec ", tv_nsec=1073741823}, " \ + "{tv_sec=" huge_tv_sec ", tv_nsec=1073741822}]" +# elif XLAT_VERBOSE +# define str_at_fdcwd "-100 /* AT_FDCWD */" +# define str_at_symlink_nofollow "0x100 /* AT_SYMLINK_NOFOLLOW */" +# define str_at_removedir "0x200 /* AT_REMOVEDIR */" +# define str_flags1 \ + "0x600 /* AT_REMOVEDIR|AT_SYMLINK_FOLLOW */" +# define str_flags2 \ + "0xffffffff /* AT_SYMLINK_NOFOLLOW|AT_REMOVEDIR|AT_SYMLINK_FOLLOW" \ + "|AT_NO_AUTOMOUNT|AT_EMPTY_PATH|0xffffe0ff */" +# define str_utime_now_omit \ + "[{tv_sec=" big_tv_sec ", tv_nsec=1073741823} /* UTIME_NOW */, " \ + "{tv_sec=" huge_tv_sec ", tv_nsec=1073741822} /* UTIME_OMIT */]" +# else +# define str_at_fdcwd "AT_FDCWD" +# define str_at_symlink_nofollow "AT_SYMLINK_NOFOLLOW" +# define str_at_removedir "AT_REMOVEDIR" +# define str_flags1 "AT_REMOVEDIR|AT_SYMLINK_FOLLOW" +# define str_flags2 \ + "AT_SYMLINK_NOFOLLOW|AT_REMOVEDIR|AT_SYMLINK_FOLLOW" \ + "|AT_NO_AUTOMOUNT|AT_EMPTY_PATH|0xffffe0ff" +# define str_utime_now_omit "[UTIME_NOW, UTIME_OMIT]" +# endif static void print_ts(const struct timespec *ts) { - printf("{tv_sec=%ju, tv_nsec=%ju}", (uintmax_t) ts->tv_sec, - (uintmax_t) ts->tv_nsec); + printf("{tv_sec=%lld, tv_nsec=%llu}", (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec)); + print_time_t_nsec(ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), 1); +} + +static const char *errstr; + +static long +k_utimensat(const kernel_ulong_t dirfd, + const kernel_ulong_t pathname, + const kernel_ulong_t times, + const kernel_ulong_t flags) +{ + long rc = syscall(__NR_utimensat, dirfd, pathname, times, flags); + errstr = sprintrc(rc); + return rc; } int main(void) { - static const char fname[] = "utimensat\nfilename"; + static const kernel_ulong_t bogus_fd = + (kernel_ulong_t) 0xbadc0deddeadbeef; + static const kernel_ulong_t kfdcwd = + (kernel_ulong_t) 0xdefaced00000000 | -100U; + static const char proto_fname[] = "utimensat\nfilename"; + static const char qname[] = "\"utimensat\\nfilename\""; + + char *const fname = tail_memdup(proto_fname, sizeof(proto_fname)); + const kernel_ulong_t kfname = (uintptr_t) fname; + struct timespec *const ts = tail_alloc(sizeof(*ts) * 2); + + (void) close(0); + + /* dirfd */ + k_utimensat(0, kfname, 0, 0); + printf("utimensat(0, %s, NULL, 0) = %s\n", qname, errstr); + + k_utimensat(bogus_fd, kfname, 0, 0); + printf("utimensat(%d, %s, NULL, 0) = %s\n", + (int) bogus_fd, qname, errstr); + + k_utimensat(-100U, kfname, 0, 0); + printf("utimensat(" str_at_fdcwd ", %s, NULL, 0) = %s\n", qname, errstr); + + k_utimensat(kfdcwd, kfname, 0, 0); + printf("utimensat(" str_at_fdcwd ", %s, NULL, 0) = %s\n", qname, errstr); + + /* pathname */ + k_utimensat(kfdcwd, 0, 0, 0); + printf("utimensat(" str_at_fdcwd ", NULL, NULL, 0) = %s\n", errstr); + + k_utimensat(kfdcwd, kfname + sizeof(proto_fname) - 1, 0, 0); + printf("utimensat(" str_at_fdcwd ", \"\", NULL, 0) = %s\n", errstr); + + fname[sizeof(proto_fname) - 1] = '+'; + k_utimensat(kfdcwd, kfname, 0, 0); + fname[sizeof(proto_fname) - 1] = '\0'; + printf("utimensat(" str_at_fdcwd ", %p, NULL, 0) = %s\n", fname, errstr); + + if (F8ILL_KULONG_SUPPORTED) { + k_utimensat(kfdcwd, f8ill_ptr_to_kulong(fname), 0, 0); + printf("utimensat(" str_at_fdcwd ", %#jx, NULL, 0) = %s\n", + (uintmax_t) f8ill_ptr_to_kulong(fname), errstr); + } + + /* times */ + k_utimensat(kfdcwd, kfname, (uintptr_t) (ts + 1), 0); + printf("utimensat(" str_at_fdcwd ", %s, %p, 0) = %s\n", + qname, ts + 1, errstr); + + k_utimensat(kfdcwd, kfname, (uintptr_t) (ts + 2), 0); + printf("utimensat(" str_at_fdcwd ", %s, %p, 0)" + " = %s\n", qname, ts + 2, errstr); + + ts[0].tv_sec = 1492358706; + ts[0].tv_nsec = 123456789; + ts[1].tv_sec = 1492357068; + ts[1].tv_nsec = 234567890; + + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, 0x100); + printf("utimensat(" str_at_fdcwd ", %s, [", qname); + print_ts(&ts[0]); + printf(", "); + print_ts(&ts[1]); + printf("], " str_at_symlink_nofollow ") = %s\n", errstr); - assert(utimensat(AT_FDCWD, fname, NULL, 0) == -1); - if (ENOENT != errno) - error_msg_and_skip("utimensat"); + ts[0].tv_sec = -1; + ts[0].tv_nsec = 2000000000; + ts[1].tv_sec = (time_t) -0x100000001LL; + ts[1].tv_nsec = 2345678900U; - #define PREFIX "utimensat(AT_FDCWD, \"utimensat\\nfilename\", " - printf(PREFIX "NULL, 0) = -1 ENOENT (%m)\n"); + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, 0x100); + printf("utimensat(" str_at_fdcwd ", %s, [", qname); + print_ts(&ts[0]); + printf(", "); + print_ts(&ts[1]); + printf("], " str_at_symlink_nofollow ") = %s\n", errstr); - struct timeval tv; - struct timespec ts[2]; + ts[0].tv_sec = 0; + ts[0].tv_nsec = 0; + ts[1].tv_sec = (time_t) 0xcafef00ddeadbeefLL; + ts[1].tv_nsec = 0; - if (gettimeofday(&tv, NULL)) - perror_msg_and_skip("gettimeofday"); + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, 0x100); + printf("utimensat(" str_at_fdcwd ", %s, [", qname); + print_ts(&ts[0]); + printf(", "); + print_ts(&ts[1]); + printf("], " str_at_symlink_nofollow ") = %s\n", errstr); - ts[0].tv_sec = tv.tv_sec; - ts[0].tv_nsec = tv.tv_usec; - ts[1].tv_sec = tv.tv_sec - 1; - ts[1].tv_nsec = tv.tv_usec + 1; + ts[0].tv_sec = 0xdeadbeefU; + ts[0].tv_nsec = 0xfacefeedU; + ts[1].tv_sec = (time_t) 0xcafef00ddeadbeefLL; + ts[1].tv_nsec = (long) 0xbadc0dedfacefeedLL; - printf(PREFIX "["); + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, 0x100); + printf("utimensat(" str_at_fdcwd ", %s, [", qname); print_ts(&ts[0]); printf(", "); print_ts(&ts[1]); - printf("], AT_SYMLINK_NOFOLLOW) = -1 ENOENT "); - - assert(utimensat(AT_FDCWD, fname, ts, AT_SYMLINK_NOFOLLOW) == -1); - if (ENOENT != errno) - error_msg_and_skip("utimensat"); - printf("(%m)\n"); + printf("], " str_at_symlink_nofollow ") = %s\n", errstr); ts[0].tv_nsec = UTIME_NOW; ts[1].tv_nsec = UTIME_OMIT; - assert(utimensat(AT_FDCWD, fname, ts, AT_SYMLINK_NOFOLLOW) == -1); - if (ENOENT != errno) - error_msg_and_skip("utimensat"); - printf(PREFIX "[UTIME_NOW, UTIME_OMIT], AT_SYMLINK_NOFOLLOW)" - " = -1 ENOENT (%m)\n"); + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, 0x100); + printf("utimensat(" str_at_fdcwd ", %s, " str_utime_now_omit + ", " str_at_symlink_nofollow ") = %s\n", qname, errstr); + + if (F8ILL_KULONG_SUPPORTED) { + k_utimensat(kfdcwd, kfname, f8ill_ptr_to_kulong(ts), 0); + printf("utimensat(" str_at_fdcwd ", %s, %#jx, 0) = %s\n", + qname, (uintmax_t) f8ill_ptr_to_kulong(ts), errstr); + } + + /* flags */ + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, + (kernel_ulong_t) 0xdefaced00000200); + printf("utimensat(" str_at_fdcwd ", %s, " str_utime_now_omit + ", " str_at_removedir ") = %s\n", + qname, errstr); + + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, + (kernel_ulong_t) 0xdefaced00000600); + printf("utimensat(" str_at_fdcwd ", %s, " str_utime_now_omit + ", " str_flags1 ") = %s\n", + qname, errstr); + + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, (kernel_ulong_t) -1ULL); + printf("utimensat(" str_at_fdcwd ", %s, " str_utime_now_omit + ", " str_flags2 ") = %s\n", + qname, errstr); puts("+++ exited with 0 +++"); return 0; @@ -95,7 +222,6 @@ main(void) #else -SKIP_MAIN_UNDEFINED("HAVE_UTIMENSAT && AT_FDCWD && AT_SYMLINK_NOFOLLOW" - " && UTIME_NOW && UTIME_OMIT") +SKIP_MAIN_UNDEFINED("__NR_utimensat && UTIME_NOW && UTIME_OMIT") #endif diff --git a/tests-m32/utimensat.gen.test b/tests-m32/utimensat.gen.test new file mode 100755 index 00000000..07dffa37 --- /dev/null +++ b/tests-m32/utimensat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (utimensat -a33 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 diff --git a/tests-m32/utimensat.test b/tests-m32/utimensat.test deleted file mode 100755 index 52e3f316..00000000 --- a/tests-m32/utimensat.test +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -# Check decoding of utimensat syscall. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -e utimensat $args > "$OUT" - -check_prog grep -LC_ALL=C grep -x "utimensat(.*" "$LOG" > /dev/null || { - rm -f "$OUT" - skip_ 'test executable does not use utimensat syscall' -} - -match_diff "$LOG" "$OUT" - -rm -f "$OUT" - -exit 0 diff --git a/tests-m32/utimes.c b/tests-m32/utimes.c index bbfa0310..1aee6db3 100644 --- a/tests-m32/utimes.c +++ b/tests-m32/utimes.c @@ -1,30 +1,10 @@ /* * Check decoding of utimes syscall. * - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,50 +12,10 @@ #ifdef __NR_utimes -# include -# include -# include -# include - -int -main(void) -{ - struct timeval tv; - if (gettimeofday(&tv, NULL)) - perror_msg_and_fail("gettimeofday"); - - static const char sample[] = "utimes_sample"; - - long rc = syscall(__NR_utimes, sample, 0); - printf("utimes(\"%s\", NULL) = %ld %s (%m)\n", - sample, rc, errno2name()); - - struct timeval *const ts = tail_alloc(sizeof(*ts) * 2); - - ts[0].tv_sec = tv.tv_sec; - ts[0].tv_usec = tv.tv_usec; - ts[1].tv_sec = tv.tv_sec - 1; - ts[1].tv_usec = tv.tv_usec + 1; - - rc = syscall(__NR_utimes, 0, ts + 2); - printf("utimes(NULL, %p) = %ld %s (%m)\n", ts + 2, rc, errno2name()); - - rc = syscall(__NR_utimes, 0, ts + 1); - printf("utimes(NULL, [{tv_sec=%jd, tv_usec=%jd}, %p]) = " - "%ld %s (%m)\n", - (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, - ts + 2, rc, errno2name()); - - rc = syscall(__NR_utimes, "", ts); - printf("utimes(\"\", [{tv_sec=%jd, tv_usec=%jd}, " - "{tv_sec=%jd, tv_usec=%jd}]) = %ld %s (%m)\n", - (intmax_t) ts[0].tv_sec, (intmax_t) ts[0].tv_usec, - (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, - rc, errno2name()); - - puts("+++ exited with 0 +++"); - return 0; -} +# define TEST_SYSCALL_NR __NR_utimes +# define TEST_SYSCALL_STR "utimes" +# define TEST_STRUCT struct timeval +# include "xutimes.c" #else diff --git a/tests-m32/utimes.gen.test b/tests-m32/utimes.gen.test new file mode 100755 index 00000000..559243e9 --- /dev/null +++ b/tests-m32/utimes.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (utimes -a17 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-m32/utimes.test b/tests-m32/utimes.test deleted file mode 100755 index 99143a0b..00000000 --- a/tests-m32/utimes.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check utimes syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a21 diff --git a/tests-m32/vfork-f.c b/tests-m32/vfork-f.c index b14e4b49..ec31da96 100644 --- a/tests-m32/vfork-f.c +++ b/tests-m32/vfork-f.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/vfork-f.gen.test b/tests-m32/vfork-f.gen.test new file mode 100755 index 00000000..b3c1c6b0 --- /dev/null +++ b/tests-m32/vfork-f.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (vfork-f -a26 -qq -f -e signal=none -e trace=chdir); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a26 -qq -f -e signal=none -e trace=chdir diff --git a/tests-m32/vfork-f.test b/tests-m32/vfork-f.test deleted file mode 100755 index ff4422b2..00000000 --- a/tests-m32/vfork-f.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check how strace -f follows vfork syscall. - -. "${srcdir=.}/fork-f.test" diff --git a/tests-m32/vhangup.c b/tests-m32/vhangup.c index e7ddabba..1a786cc3 100644 --- a/tests-m32/vhangup.c +++ b/tests-m32/vhangup.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-m32/vhangup.gen.test b/tests-m32/vhangup.gen.test new file mode 100755 index 00000000..da192169 --- /dev/null +++ b/tests-m32/vhangup.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (vhangup -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-m32/vhangup.test b/tests-m32/vhangup.test deleted file mode 100755 index 8fe1cacb..00000000 --- a/tests-m32/vhangup.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# Check vhangup syscall decoding. - -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a10 diff --git a/tests-m32/vmsplice.c b/tests-m32/vmsplice.c index f29962e3..b986dafa 100644 --- a/tests-m32/vmsplice.c +++ b/tests-m32/vmsplice.c @@ -2,29 +2,10 @@ * This file is part of vmsplice strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -86,7 +67,7 @@ main(void) " * %u bytes in buffer 2\n" " | 00000 %-49s %-16s |\n", w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), - w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(iov_), + w2_c, LENGTH_OF(w2_c), (unsigned int) ARRAY_SIZE(iov_), "SPLICE_F_NONBLOCK", len, LENGTH_OF(w0_c), w0_d, w0_c, LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); diff --git a/tests-m32/vmsplice.gen.test b/tests-m32/vmsplice.gen.test new file mode 100755 index 00000000..0dc18b63 --- /dev/null +++ b/tests-m32/vmsplice.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (vmsplice -ewrite=1 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -ewrite=1 diff --git a/tests-m32/vmsplice.test b/tests-m32/vmsplice.test deleted file mode 100755 index 8a80650e..00000000 --- a/tests-m32/vmsplice.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of vmsplice syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -ewrite=1 diff --git a/tests-m32/wait4-v.gen.test b/tests-m32/wait4-v.gen.test new file mode 100755 index 00000000..5b23f422 --- /dev/null +++ b/tests-m32/wait4-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (wait4-v -v -e signal=none -e trace=wait4); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e signal=none -e trace=wait4 diff --git a/tests-m32/wait4-v.test b/tests-m32/wait4-v.test deleted file mode 100755 index 58e55f25..00000000 --- a/tests-m32/wait4-v.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check verbose decoding of wait4 syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -e signal=none -e trace=wait4 diff --git a/tests-m32/wait4.c b/tests-m32/wait4.c index ccb3ebb9..29b0cadd 100644 --- a/tests-m32/wait4.c +++ b/tests-m32/wait4.c @@ -2,29 +2,10 @@ * Check decoding of wait4 syscall. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,8 +21,8 @@ sprint_rusage(const struct rusage *const ru) { static char buf[1024]; snprintf(buf, sizeof(buf), - "{ru_utime={tv_sec=%lu, tv_usec=%lu}" - ", ru_stime={tv_sec=%lu, tv_usec=%lu}" + "{ru_utime={tv_sec=%lld, tv_usec=%llu}" + ", ru_stime={tv_sec=%lld, tv_usec=%llu}" #if VERBOSE ", ru_maxrss=%lu" ", ru_ixrss=%lu" @@ -60,10 +41,10 @@ sprint_rusage(const struct rusage *const ru) #else ", ...}" #endif - , (long) ru->ru_utime.tv_sec - , (long) ru->ru_utime.tv_usec - , (long) ru->ru_stime.tv_sec - , (long) ru->ru_stime.tv_usec + , (long long) ru->ru_utime.tv_sec + , zero_extend_signed_to_ull(ru->ru_utime.tv_usec) + , (long long) ru->ru_stime.tv_sec + , zero_extend_signed_to_ull(ru->ru_stime.tv_usec) #if VERBOSE , (long) ru->ru_maxrss , (long) ru->ru_ixrss @@ -119,12 +100,12 @@ main(void) (void) close(0); - int *const s = tail_alloc(sizeof(*s)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, s); if (wait4(pid, s, WNOHANG|__WALL, NULL)) perror_msg_and_fail("wait4 #1"); tprintf("wait4(%d, %p, WNOHANG|__WALL, NULL) = 0\n", pid, s); - struct rusage *const rusage = tail_alloc(sizeof(*rusage)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct rusage, rusage); if (wait4(pid, s, WNOHANG|__WALL, rusage)) perror_msg_and_fail("wait4 #2"); tprintf("wait4(%d, %p, WNOHANG|__WALL, %p) = 0\n", pid, s, rusage); diff --git a/tests-m32/wait4.gen.test b/tests-m32/wait4.gen.test new file mode 100755 index 00000000..22a982fd --- /dev/null +++ b/tests-m32/wait4.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (wait4 -esignal=none ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests-m32/wait4.test b/tests-m32/wait4.test deleted file mode 100755 index 6338d1f6..00000000 --- a/tests-m32/wait4.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of wait4 syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -esignal=none diff --git a/tests-m32/waitid-v.gen.test b/tests-m32/waitid-v.gen.test new file mode 100755 index 00000000..45744cd5 --- /dev/null +++ b/tests-m32/waitid-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (waitid-v -v -e signal=none -e trace=waitid); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e signal=none -e trace=waitid diff --git a/tests-m32/waitid-v.test b/tests-m32/waitid-v.test deleted file mode 100755 index eb498cb0..00000000 --- a/tests-m32/waitid-v.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check verbose decoding of waitid syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -e signal=none -e trace=waitid diff --git a/tests-m32/waitid.c b/tests-m32/waitid.c index 6a102990..f4e4a0a8 100644 --- a/tests-m32/waitid.c +++ b/tests-m32/waitid.c @@ -2,29 +2,10 @@ * Check decoding of waitid syscall. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -42,8 +23,8 @@ sprint_rusage(const struct rusage *const ru) { static char buf[1024]; snprintf(buf, sizeof(buf), - "{ru_utime={tv_sec=%lld, tv_usec=%lld}" - ", ru_stime={tv_sec=%lld, tv_usec=%lld}" + "{ru_utime={tv_sec=%lld, tv_usec=%llu}" + ", ru_stime={tv_sec=%lld, tv_usec=%llu}" #if VERBOSE ", ru_maxrss=%llu" ", ru_ixrss=%llu" @@ -63,9 +44,9 @@ sprint_rusage(const struct rusage *const ru) ", ...}" #endif , (long long) ru->ru_utime.tv_sec - , (long long) ru->ru_utime.tv_usec + , zero_extend_signed_to_ull(ru->ru_utime.tv_usec) , (long long) ru->ru_stime.tv_sec - , (long long) ru->ru_stime.tv_usec + , zero_extend_signed_to_ull(ru->ru_stime.tv_usec) #if VERBOSE , zero_extend_signed_to_ull(ru->ru_maxrss) , zero_extend_signed_to_ull(ru->ru_ixrss) @@ -110,7 +91,8 @@ si_code_2_name(const int code) #ifdef CLD_CONTINUED CASE(CLD_CONTINUED); #endif - default: perror_msg_and_fail("unknown si_code %d", code); + default: + perror_msg_and_fail("unknown si_code %d", code); } } @@ -185,9 +167,9 @@ main(void) perror_msg_and_fail("waitid #1"); tprintf("waitid(P_PID, %d, NULL, WNOHANG|WEXITED, NULL) = 0\n", pid); - siginfo_t *const sinfo = tail_alloc(sizeof(*sinfo)); + TAIL_ALLOC_OBJECT_CONST_PTR(siginfo_t, sinfo); memset(sinfo, 0, sizeof(*sinfo)); - struct rusage *const rusage = tail_alloc(sizeof(*rusage)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct rusage, rusage); if (do_waitid(P_PID, pid, sinfo, WNOHANG|WEXITED|WSTOPPED, rusage)) perror_msg_and_fail("waitid #2"); tprintf("waitid(P_PID, %d, {}, WNOHANG|WEXITED|WSTOPPED, %s) = 0\n", diff --git a/tests-m32/waitid.gen.test b/tests-m32/waitid.gen.test new file mode 100755 index 00000000..22edd673 --- /dev/null +++ b/tests-m32/waitid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (waitid -esignal=none ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests-m32/waitid.test b/tests-m32/waitid.test deleted file mode 100755 index 3bcba3ab..00000000 --- a/tests-m32/waitid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of waitid syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -esignal=none diff --git a/tests-m32/waitpid.c b/tests-m32/waitpid.c index 2e22e245..7069bec8 100644 --- a/tests-m32/waitpid.c +++ b/tests-m32/waitpid.c @@ -1,30 +1,10 @@ /* * Check decoding of waitpid syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-m32/waitpid.gen.test b/tests-m32/waitpid.gen.test new file mode 100755 index 00000000..a5678a1a --- /dev/null +++ b/tests-m32/waitpid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (waitpid -a28 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-m32/waitpid.test b/tests-m32/waitpid.test deleted file mode 100755 index 93807d1f..00000000 --- a/tests-m32/waitpid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of waitpid syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 diff --git a/tests-m32/xattr-strings.c b/tests-m32/xattr-strings.c index 310929a9..a3fdabbd 100644 --- a/tests-m32/xattr-strings.c +++ b/tests-m32/xattr-strings.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #ifdef HAVE_SYS_XATTR_H diff --git a/tests-m32/xattr-strings.gen.test b/tests-m32/xattr-strings.gen.test new file mode 100755 index 00000000..33178926 --- /dev/null +++ b/tests-m32/xattr-strings.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (xattr-strings -a22 -s 4 -e trace=fsetxattr); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -s 4 -e trace=fsetxattr diff --git a/tests-m32/xattr-strings.test b/tests-m32/xattr-strings.test deleted file mode 100755 index 25ef360b..00000000 --- a/tests-m32/xattr-strings.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# Check *xattr syscalls decoding when limiting string size. - -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a22 -s 4 -e trace=fsetxattr diff --git a/tests-m32/xattr.c b/tests-m32/xattr.c index a772eced..56783694 100644 --- a/tests-m32/xattr.c +++ b/tests-m32/xattr.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,8 +17,6 @@ # define XATTR_SIZE_MAX 65536 # endif -#define DEFAULT_STRLEN 32 - int main(void) { @@ -114,9 +93,7 @@ main(void) else { const int ellipsis = rc > DEFAULT_STRLEN; - putchar('"'); print_quoted_memory(big, ellipsis ? DEFAULT_STRLEN : rc); - putchar('"'); if (ellipsis) fputs("...", stdout); } diff --git a/tests-m32/xattr.gen.test b/tests-m32/xattr.gen.test new file mode 100755 index 00000000..030f2ce0 --- /dev/null +++ b/tests-m32/xattr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (xattr -a22 -e trace=getxattr,fgetxattr,lgetxattr,setxattr,fsetxattr,lsetxattr,listxattr,flistxattr,llistxattr,removexattr,fremovexattr,lremovexattr); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -e trace=getxattr,fgetxattr,lgetxattr,setxattr,fsetxattr,lsetxattr,listxattr,flistxattr,llistxattr,removexattr,fremovexattr,lremovexattr diff --git a/tests-m32/xattr.test b/tests-m32/xattr.test deleted file mode 100755 index 8c7a87b9..00000000 --- a/tests-m32/xattr.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check *xattr syscalls decoding. - -. "${srcdir=.}/init.sh" - -syscalls= -for n in getxattr setxattr listxattr removexattr; do - syscalls="$syscalls,${n},f${n},l${n}" -done - -run_strace_match_diff -a22 -e trace=$syscalls diff --git a/tests-m32/xchownx.c b/tests-m32/xchownx.c index fe582835..8820e00d 100644 --- a/tests-m32/xchownx.c +++ b/tests-m32/xchownx.c @@ -2,29 +2,10 @@ * Check decoding of chown/chown32/lchown/lchown32/fchown/fchown32 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -45,10 +26,17 @@ # define CHECK_OVERFLOWGID(arg) #endif -#define UNLINK_SAMPLE \ - if (unlink(sample)) perror_msg_and_fail("unlink") -#define CLOSE_SAMPLE \ - if (close(fd)) perror_msg_and_fail("close") +#define UNLINK_SAMPLE \ + do { \ + if (unlink(sample)) \ + perror_msg_and_fail("unlink"); \ + } while (0) + +#define CLOSE_SAMPLE \ + do { \ + if (close(fd)) \ + perror_msg_and_fail("close"); \ + } while (0) #ifdef ACCESS_BY_DESCRIPTOR # define SYSCALL_ARG1 fd diff --git a/tests-m32/xet_robust_list.c b/tests-m32/xet_robust_list.c index 211dec45..cf4f2234 100644 --- a/tests-m32/xet_robust_list.c +++ b/tests-m32/xet_robust_list.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -51,8 +32,8 @@ main(void) { const pid_t pid = getpid(); const long long_pid = (unsigned long) (0xdeadbeef00000000LL | pid); - void **p_head = tail_alloc(sizeof(void *)); - size_t *p_len = tail_alloc(sizeof(size_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(void *, p_head); + TAIL_ALLOC_OBJECT_CONST_PTR(size_t, p_len); if (syscall(__NR_get_robust_list, long_pid, p_head, p_len)) perror_msg_and_skip("get_robust_list"); diff --git a/tests-m32/xet_robust_list.gen.test b/tests-m32/xet_robust_list.gen.test new file mode 100755 index 00000000..798cdff5 --- /dev/null +++ b/tests-m32/xet_robust_list.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (xet_robust_list -a24 -e trace=get_robust_list,set_robust_list); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 -e trace=get_robust_list,set_robust_list diff --git a/tests-m32/xet_robust_list.test b/tests-m32/xet_robust_list.test deleted file mode 100755 index 8a3a3820..00000000 --- a/tests-m32/xet_robust_list.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check get_robust_list and set_robust_list syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 -e trace=get_robust_list,set_robust_list diff --git a/tests-m32/xet_thread_area_x86.c b/tests-m32/xet_thread_area_x86.c new file mode 100644 index 00000000..a1efd319 --- /dev/null +++ b/tests-m32/xet_thread_area_x86.c @@ -0,0 +1,206 @@ +/* + * Check decoding of set_thread_area and get_thread_area syscalls on x86 + * architecture. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include + +#if defined __NR_get_thread_area && defined __NR_set_thread_area \ + && defined HAVE_STRUCT_USER_DESC + +# include +# include +# include +# include +# include +# include + +# include "print_user_desc.c" + +long errnum; + +static void +printptr(kernel_ulong_t ptr, const char *ptr_str) +{ + if (ptr_str) + printf("%s", ptr_str); + else + printf("%#llx", zero_extend_signed_to_ull(ptr)); +} + +/** + * Perform set_thread_area call along with printing the expected output. + * + * @param ptr_val Pointer to thread area argument. + * @param ptr_str Explicit string representation of the argument. + * @param valid Whether argument points to the valid memory and its contents + * should be decoded. + * @param entry_number_str explicit decoding of the entry_number field. + */ +static long +set_thread_area(kernel_ulong_t ptr_val, const char *ptr_str, bool valid, + const char *entry_number_str) +{ + struct user_desc *ptr = (struct user_desc *) (uintptr_t) ptr_val; + long rc = -1; + int saved_errno; + + rc = syscall(__NR_set_thread_area, ptr_val); + saved_errno = errno; + printf("set_thread_area("); + + if (valid) + print_user_desc(ptr, entry_number_str); + else + printptr(ptr_val, ptr_str); + + errno = saved_errno; + printf(") = %s", sprintrc(rc)); + if (!rc) + printf(" (entry_number=%u)", ptr->entry_number); + + puts(""); + + return rc; +} + +/** + * Perform get_thread_are call along with printing the expected output and + * checking the result against the argument of the previous set_thread_area + * call, if it had place. + * + * @param ptr_val Pointer to thread area argument. + * @param ptr_str Explicit string representation of the argument. + * @param valid Whether argument points to the valid memory and its contents + * should be decoded. + * @param set_rc Return code of the previous set_thread_area call. + * @param expected The value of the argument passed to the previous + * set_thread_area call. + */ +static void +get_thread_area(kernel_ulong_t ptr_val, const char *ptr_str, bool valid, + long set_rc, kernel_ulong_t expected) +{ + struct user_desc *ptr = (struct user_desc *) (uintptr_t) ptr_val; + struct user_desc *expected_ptr = + (struct user_desc *) (uintptr_t) expected; + int saved_errno; + long rc; + + rc = syscall(__NR_get_thread_area, ptr_val); + saved_errno = errno; + + printf("get_thread_area("); + + if (valid && !rc) { + if (!set_rc) { + assert(ptr->entry_number == expected_ptr->entry_number); + assert(ptr->base_addr == expected_ptr->base_addr); + assert(ptr->limit == expected_ptr->limit); + assert(ptr->seg_32bit == expected_ptr->seg_32bit); + assert(ptr->contents == expected_ptr->contents); + assert(ptr->read_exec_only == + expected_ptr->read_exec_only); + assert(ptr->limit_in_pages == + expected_ptr->limit_in_pages); + assert(ptr->seg_not_present == + expected_ptr->seg_not_present); + assert(ptr->useable == expected_ptr->useable); + /* + * We do not check lm as 32-bit processes ignore it, and + * only 32-bit processes can successfully execute + * get_thread_area. + */ + } + + print_user_desc(ptr, + (int) ptr->entry_number == -1 ? "-1" : NULL); + } else { + printptr(ptr_val, ptr_str); + } + + errno = saved_errno; + printf(") = %s\n", sprintrc(rc)); +} + +int main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct user_desc, ta1); + TAIL_ALLOC_OBJECT_CONST_PTR(struct user_desc, ta2); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, bogus_entry_number); + + long set_rc = -1; + + /* + * Let's do some weird syscall, it will mark the beginning of our + * expected output. + */ + syscall(__NR_reboot, 0, 0, 0, 0); + + set_rc = set_thread_area((uintptr_t) ARG_STR(NULL), false, NULL); + get_thread_area((uintptr_t) ARG_STR(NULL), false, set_rc, + (uintptr_t) NULL); + + set_rc = set_thread_area(-1, NULL, false, NULL); + get_thread_area(-1, NULL, false, set_rc, -1); + + fill_memory(ta1, sizeof(*ta1)); + fill_memory_ex(ta2, sizeof(*ta2), 0xA5, 0x5A); + + set_thread_area((uintptr_t) (ta1 + 1), NULL, false, NULL); + + set_thread_area((uintptr_t) bogus_entry_number, NULL, false, NULL); + + set_thread_area((uintptr_t) ta1, NULL, true, NULL); + + ta1->entry_number = -1; + ta1->base_addr = 0; + ta1->limit = 0; + ta1->contents = 1; + ta1->seg_32bit = 1; + ta1->seg_not_present = 0; + + set_rc = set_thread_area((uintptr_t) ta1, NULL, true, "-1"); + + *bogus_entry_number = 2718281828U; + get_thread_area((uintptr_t) bogus_entry_number, + "{entry_number=2718281828, ...}", + false, set_rc, (uintptr_t) ta1); + + /* That one should return -EFAULT on i386 */ + *bogus_entry_number = 12; + get_thread_area((uintptr_t) bogus_entry_number, + "{entry_number=12, ...}", + false, set_rc, (uintptr_t) ta1); + + ta2->entry_number = 3141592653U; + get_thread_area((uintptr_t) ta2, "{entry_number=3141592653, ...}", + false, set_rc, (uintptr_t) ta1); + + ta2->entry_number = -1; + get_thread_area((uintptr_t) ta2, "{entry_number=-1, ...}", + false, set_rc, (uintptr_t) ta1); + + ta2->entry_number = ta1->entry_number; + assert(set_rc == 0 || (int) ta2->entry_number == -1); + get_thread_area((uintptr_t) ta2, "{entry_number=-1, ...}", + true, set_rc, (uintptr_t) ta1); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_get_thread_area && __NR_set_thread_area" + " && HAVE_STRUCT_USER_DESC"); + +#endif diff --git a/tests-m32/xet_thread_area_x86.test b/tests-m32/xet_thread_area_x86.test new file mode 100755 index 00000000..2f7fe27a --- /dev/null +++ b/tests-m32/xet_thread_area_x86.test @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Check decoding of set_thread_area and get_thread_area syscalls on x86. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +check_prog sed +run_prog > /dev/null +run_strace -a22 -e trace=reboot,/[gs]et_thread_area $args > "$EXP" +sed '0,/^reboot/d' "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests-m32/xetitimer.c b/tests-m32/xetitimer.c index 4b17edd3..8d758974 100644 --- a/tests-m32/xetitimer.c +++ b/tests-m32/xetitimer.c @@ -1,76 +1,163 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin - * All rights reserved. + * Check decoding of setitimer and getitimer syscalls. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include #include #include +#include +#include int main(void) { - struct { - struct itimerval itv; - uint32_t pad[4]; - } old = { - .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } - }, new = { - .itv = { - .it_interval = { 0xc0de1, 0xc0de2 }, - .it_value = { 0xc0de3, 0xc0de4 } - }, - .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } + static const struct itimerval new = { + .it_interval = { 0xc0de1, 0xc0de2 }, + .it_value = { 0xc0de3, 0xc0de4 } }; + static const kernel_ulong_t long_timer = + F8ILL_KULONG_MASK | ITIMER_REAL; + static const kernel_ulong_t bogus_timer = + (kernel_ulong_t) 0xfacefeeddeadbeefULL; + + TAIL_ALLOC_OBJECT_CONST_PTR(struct itimerval, p_old); + struct itimerval *const p_new = tail_memdup(&new, sizeof(new)); + void *const efault = tail_alloc(sizeof(new) - 8); + long rc; - if (setitimer(ITIMER_REAL, &new.itv, &old.itv)) + if (setitimer(ITIMER_REAL, p_new, NULL)) perror_msg_and_skip("setitimer"); printf("setitimer(ITIMER_REAL" - ", {it_interval={tv_sec=%jd, tv_usec=%jd}, " - "it_value={tv_sec=%jd, tv_usec=%jd}}" - ", {it_interval={tv_sec=%jd, tv_usec=%jd}, " - "it_value={tv_sec=%jd, tv_usec=%jd}}) = 0\n", - (intmax_t) new.itv.it_interval.tv_sec, - (intmax_t) new.itv.it_interval.tv_usec, - (intmax_t) new.itv.it_value.tv_sec, - (intmax_t) new.itv.it_value.tv_usec, - (intmax_t) old.itv.it_interval.tv_sec, - (intmax_t) old.itv.it_interval.tv_usec, - (intmax_t) old.itv.it_value.tv_sec, - (intmax_t) old.itv.it_value.tv_usec); - - if (getitimer(ITIMER_REAL, &old.itv)) + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}" + ", NULL) = 0\n", + (long long) new.it_interval.tv_sec, + zero_extend_signed_to_ull(new.it_interval.tv_usec), + (long long) new.it_value.tv_sec, + zero_extend_signed_to_ull(new.it_value.tv_usec)); + + fill_memory(p_old, sizeof(*p_old)); + if (getitimer(ITIMER_REAL, p_old)) perror_msg_and_skip("getitimer"); printf("getitimer(ITIMER_REAL" - ", {it_interval={tv_sec=%jd, tv_usec=%jd}, " - "it_value={tv_sec=%jd, tv_usec=%jd}}) = 0\n", - (intmax_t) old.itv.it_interval.tv_sec, - (intmax_t) old.itv.it_interval.tv_usec, - (intmax_t) old.itv.it_value.tv_sec, - (intmax_t) old.itv.it_value.tv_usec); + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}) = 0\n", + (long long) p_old->it_interval.tv_sec, + zero_extend_signed_to_ull(p_old->it_interval.tv_usec), + (long long) p_old->it_value.tv_sec, + zero_extend_signed_to_ull(p_old->it_value.tv_usec)); + + fill_memory(p_old, sizeof(*p_old)); + setitimer(ITIMER_REAL, p_new, p_old); + printf("setitimer(ITIMER_REAL" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}) = 0\n", + (long long) new.it_interval.tv_sec, + zero_extend_signed_to_ull(new.it_interval.tv_usec), + (long long) new.it_value.tv_sec, + zero_extend_signed_to_ull(new.it_value.tv_usec), + (long long) p_old->it_interval.tv_sec, + zero_extend_signed_to_ull(p_old->it_interval.tv_usec), + (long long) p_old->it_value.tv_sec, + zero_extend_signed_to_ull(p_old->it_value.tv_usec)); + + rc = getitimer(ITIMER_REAL, efault); + printf("getitimer(ITIMER_REAL, %p) = %s\n", efault, sprintrc(rc)); + + rc = setitimer(ITIMER_REAL, p_new, efault); + printf("setitimer(ITIMER_REAL" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}, %p) = %s\n", + (long long) new.it_interval.tv_sec, + zero_extend_signed_to_ull(new.it_interval.tv_usec), + (long long) new.it_value.tv_sec, + zero_extend_signed_to_ull(new.it_value.tv_usec), + efault, sprintrc(rc)); + + rc = setitimer(ITIMER_REAL, efault, p_old); + printf("setitimer(ITIMER_REAL, %p, %p) = %s\n", + efault, p_old, sprintrc(rc)); + + fill_memory(p_old, sizeof(*p_old)); + rc = syscall(__NR_setitimer, long_timer, p_new, p_old); + printf("setitimer(ITIMER_REAL" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}) = %s\n", + (long long) new.it_interval.tv_sec, + zero_extend_signed_to_ull(new.it_interval.tv_usec), + (long long) new.it_value.tv_sec, + zero_extend_signed_to_ull(new.it_value.tv_usec), + (long long) p_old->it_interval.tv_sec, + zero_extend_signed_to_ull(p_old->it_interval.tv_usec), + (long long) p_old->it_value.tv_sec, + zero_extend_signed_to_ull(p_old->it_value.tv_usec), + sprintrc(rc)); + + fill_memory(p_old, sizeof(*p_old)); + rc = syscall(__NR_getitimer, long_timer, p_old); + printf("getitimer(ITIMER_REAL" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}) = %s\n", + (long long) p_old->it_interval.tv_sec, + zero_extend_signed_to_ull(p_old->it_interval.tv_usec), + (long long) p_old->it_value.tv_sec, + zero_extend_signed_to_ull(p_old->it_value.tv_usec), + sprintrc(rc)); + + rc = syscall(__NR_setitimer, bogus_timer, p_new, p_old); + printf("setitimer(%#x /* ITIMER_??? */" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}, %p) = %s\n", + (int) bogus_timer, + (long long) new.it_interval.tv_sec, + zero_extend_signed_to_ull(new.it_interval.tv_usec), + (long long) new.it_value.tv_sec, + zero_extend_signed_to_ull(new.it_value.tv_usec), + p_old, sprintrc(rc)); + + rc = syscall(__NR_getitimer, bogus_timer, p_old); + printf("getitimer(%#x /* ITIMER_??? */, %p) = %s\n", + (int) bogus_timer, p_old, sprintrc(rc)); + + if (F8ILL_KULONG_SUPPORTED) { + const kernel_ulong_t ill_new = f8ill_ptr_to_kulong(p_new); + const kernel_ulong_t ill_old = f8ill_ptr_to_kulong(p_old); + + rc = syscall(__NR_setitimer, long_timer, ill_new, ill_old); + printf("setitimer(ITIMER_REAL, %#llx, %#llx) = %s\n", + (unsigned long long) ill_new, + (unsigned long long) ill_old, + sprintrc(rc)); + + rc = syscall(__NR_getitimer, long_timer, ill_old); + printf("getitimer(ITIMER_REAL, %#llx) = %s\n", + (unsigned long long) ill_old, sprintrc(rc)); + } + + p_new->it_interval.tv_sec = 0xdeadbeefU; + p_new->it_interval.tv_usec = 0xfacefeedU; + p_new->it_value.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + p_new->it_value.tv_usec = (suseconds_t) 0xbadc0dedfacefeedLL; + + rc = setitimer(ITIMER_REAL, p_new, p_old); + printf("setitimer(ITIMER_REAL" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}, %p) = %s\n", + (long long) p_new->it_interval.tv_sec, + zero_extend_signed_to_ull(p_new->it_interval.tv_usec), + (long long) p_new->it_value.tv_sec, + zero_extend_signed_to_ull(p_new->it_value.tv_usec), + p_old, sprintrc(rc)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/xetitimer.gen.test b/tests-m32/xetitimer.gen.test new file mode 100755 index 00000000..0cdb9267 --- /dev/null +++ b/tests-m32/xetitimer.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (xetitimer -a29 -e trace=setitimer,getitimer); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a29 -e trace=setitimer,getitimer diff --git a/tests-m32/xetitimer.test b/tests-m32/xetitimer.test deleted file mode 100755 index 4aa00cce..00000000 --- a/tests-m32/xetitimer.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setitimer and getitimer syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=setitimer,getitimer diff --git a/tests-m32/xetpgid.c b/tests-m32/xetpgid.c index 24e0d7f0..46dd332d 100644 --- a/tests-m32/xetpgid.c +++ b/tests-m32/xetpgid.c @@ -2,29 +2,10 @@ * This file is part of xetpgid strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -39,13 +20,10 @@ int main(void) { const int pid = getpid(); - long rc = syscall(__NR_getpgid, - (unsigned long) 0xffffffff00000000ULL | pid); + long rc = syscall(__NR_getpgid, F8ILL_KULONG_MASK | pid); printf("getpgid(%d) = %ld\n", pid, rc); - rc = syscall(__NR_setpgid, - (unsigned long) 0xffffffff00000000ULL, - (unsigned long) 0xffffffff00000000ULL | pid); + rc = syscall(__NR_setpgid, F8ILL_KULONG_MASK, F8ILL_KULONG_MASK | pid); printf("setpgid(0, %d) = %ld\n", pid, rc); puts("+++ exited with 0 +++"); diff --git a/tests-m32/xetpgid.gen.test b/tests-m32/xetpgid.gen.test new file mode 100755 index 00000000..fc57fc41 --- /dev/null +++ b/tests-m32/xetpgid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (xetpgid -a11 -e trace=getpgid,setpgid); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=getpgid,setpgid diff --git a/tests-m32/xetpgid.test b/tests-m32/xetpgid.test deleted file mode 100755 index 07f4f9e8..00000000 --- a/tests-m32/xetpgid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getpgid and setpgid syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a11 -e trace=getpgid,setpgid diff --git a/tests-m32/xetpriority.c b/tests-m32/xetpriority.c index ed552598..5cd97ea9 100644 --- a/tests-m32/xetpriority.c +++ b/tests-m32/xetpriority.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -12,12 +19,11 @@ main(void) { const int pid = getpid(); long rc = syscall(__NR_getpriority, PRIO_PROCESS, - (unsigned long) 0xffffffff00000000ULL | pid); + F8ILL_KULONG_MASK | pid); printf("getpriority(PRIO_PROCESS, %d) = %ld\n", pid, rc); rc = syscall(__NR_setpriority, PRIO_PROCESS, - (unsigned long) 0xffffffff00000000ULL | pid, - (unsigned long) 0xffffffff00000000ULL); + F8ILL_KULONG_MASK | pid, F8ILL_KULONG_MASK); printf("setpriority(PRIO_PROCESS, %d, 0) = %s\n", pid, sprintrc(rc)); puts("+++ exited with 0 +++"); diff --git a/tests-m32/xetpriority.gen.test b/tests-m32/xetpriority.gen.test new file mode 100755 index 00000000..4b955247 --- /dev/null +++ b/tests-m32/xetpriority.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (xetpriority -a29 -e trace=getpriority,setpriority); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a29 -e trace=getpriority,setpriority diff --git a/tests-m32/xetpriority.test b/tests-m32/xetpriority.test deleted file mode 100755 index 2c84ba41..00000000 --- a/tests-m32/xetpriority.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getpriority and setpriority syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a29 -e trace=getpriority,setpriority diff --git a/tests-m32/xettimeofday.c b/tests-m32/xettimeofday.c index d36c57b4..9c811262 100644 --- a/tests-m32/xettimeofday.c +++ b/tests-m32/xettimeofday.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,36 +17,49 @@ int main(void) { - struct { - struct timeval tv; - uint32_t pad0[2]; - struct timezone tz; - uint32_t pad1[2]; - } t = { - .pad0 = { 0xdeadbeef, 0xbadc0ded }, - .pad1 = { 0xdeadbeef, 0xbadc0ded } - }; + TAIL_ALLOC_OBJECT_CONST_PTR(struct timeval, tv); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timezone, tz); - if (syscall(__NR_gettimeofday, &t.tv, NULL)) + if (syscall(__NR_gettimeofday, tv, NULL)) perror_msg_and_skip("gettimeofday"); - printf("gettimeofday({tv_sec=%jd, tv_usec=%jd}, NULL) = 0\n", - (intmax_t) t.tv.tv_sec, (intmax_t) t.tv.tv_usec); + printf("gettimeofday({tv_sec=%lld, tv_usec=%llu}, NULL) = 0\n", + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); - if (syscall(__NR_gettimeofday, &t.tv, &t.tz)) + if (syscall(__NR_gettimeofday, tv, tz)) perror_msg_and_skip("gettimeofday"); - printf("gettimeofday({tv_sec=%jd, tv_usec=%jd}" + printf("gettimeofday({tv_sec=%lld, tv_usec=%llu}" ", {tz_minuteswest=%d, tz_dsttime=%d}) = 0\n", - (intmax_t) t.tv.tv_sec, (intmax_t) t.tv.tv_usec, - t.tz.tz_minuteswest, t.tz.tz_dsttime); + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec), + tz->tz_minuteswest, tz->tz_dsttime); + + tv->tv_sec = -1; + tv->tv_usec = 1000000; + assert(syscall(__NR_settimeofday, tv, tz) == -1); + printf("settimeofday({tv_sec=%lld, tv_usec=%llu}" + ", {tz_minuteswest=%d, tz_dsttime=%d}) = %s\n", + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec), + tz->tz_minuteswest, tz->tz_dsttime, sprintrc(-1)); + + tv->tv_sec = 0xdeadbeefU; + tv->tv_usec = 0xfacefeedU; + assert(syscall(__NR_settimeofday, tv, tz) == -1); + printf("settimeofday({tv_sec=%lld, tv_usec=%llu}" + ", {tz_minuteswest=%d, tz_dsttime=%d}) = %s\n", + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec), + tz->tz_minuteswest, tz->tz_dsttime, sprintrc(-1)); - t.tv.tv_sec = -1; - t.tv.tv_usec = 1000000000; - assert(syscall(__NR_settimeofday, &t.tv, &t.tz) == -1); - printf("settimeofday({tv_sec=%jd, tv_usec=%jd}" - ", {tz_minuteswest=%d, tz_dsttime=%d})" - " = -1 EINVAL (%m)\n", - (intmax_t) t.tv.tv_sec, (intmax_t) t.tv.tv_usec, - t.tz.tz_minuteswest, t.tz.tz_dsttime); + tv->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + tv->tv_usec = (suseconds_t) 0xbadc0dedfacefeedLL; + assert(syscall(__NR_settimeofday, tv, tz) == -1); + printf("settimeofday({tv_sec=%lld, tv_usec=%llu}" + ", {tz_minuteswest=%d, tz_dsttime=%d}) = %s\n", + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec), + tz->tz_minuteswest, tz->tz_dsttime, sprintrc(-1)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/xettimeofday.gen.test b/tests-m32/xettimeofday.gen.test new file mode 100755 index 00000000..1a021e49 --- /dev/null +++ b/tests-m32/xettimeofday.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (xettimeofday -a20 -e trace=gettimeofday,settimeofday); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -e trace=gettimeofday,settimeofday diff --git a/tests-m32/xettimeofday.test b/tests-m32/xettimeofday.test deleted file mode 100755 index 68764e46..00000000 --- a/tests-m32/xettimeofday.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check gettimeofday and settimeofday syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 -e trace=gettimeofday,settimeofday diff --git a/tests-m32/xgetrlimit.c b/tests-m32/xgetrlimit.c index 78d9cb99..a1c89e9b 100644 --- a/tests-m32/xgetrlimit.c +++ b/tests-m32/xgetrlimit.c @@ -1,30 +1,11 @@ /* * Check decoding of getrlimit/ugetrlimit syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -39,23 +20,55 @@ const char * sprint_rlim(kernel_ulong_t lim) { + static char buf[2][ /* space for 2 llu strings */ + 2*sizeof(lim)*3 + + /* space for XLAT_STYLE_ABBREV decoding */ + sizeof("*1024") + sizeof("RLIM64_INFINITY") + + /* space for C style comments */ + 6]; + static unsigned int i; + + i &= 1; + +#if XLAT_RAW + sprintf(buf[i], "%llu", (unsigned long long) lim); + return buf[i++]; +#else if (sizeof(lim) == sizeof(uint64_t)) { - if (lim == (kernel_ulong_t) -1ULL) + if (lim == (kernel_ulong_t) -1ULL) { +# if XLAT_VERBOSE + sprintf(buf[i], "%llu /* RLIM64_INFINITY */", + (unsigned long long) lim); + return buf[i++]; +# else /* XLAT_ABBREV */ return "RLIM64_INFINITY"; +# endif + } } else { - if (lim == (kernel_ulong_t) -1U) + if (lim == (kernel_ulong_t) -1U) { +# if XLAT_VERBOSE + sprintf(buf[i], "%llu /* RLIM_INFINITY */", + (unsigned long long) lim); + return buf[i++]; +# else /* XLAT_ABBREV */ return "RLIM_INFINITY"; +# endif + } } - static char buf[2][sizeof(lim)*3 + sizeof("*1024")]; - static int i; - i &= 1; if (lim > 1024 && lim % 1024 == 0) +# if XLAT_VERBOSE + sprintf(buf[i], "%llu /* %llu*1024 */", + (unsigned long long) lim, + (unsigned long long) lim / 1024); +# else /* XLAT_ABBREV */ sprintf(buf[i], "%llu*1024", (unsigned long long) lim / 1024); +# endif else sprintf(buf[i], "%llu", (unsigned long long) lim); return buf[i++]; +#endif /* !XLAT_RAW */ } #ifdef NR_GETRLIMIT @@ -71,13 +84,13 @@ main(void) long rc = syscall(NR_GETRLIMIT, res, 0); if (rc && ENOSYS == errno) perror_msg_and_skip(STR_GETRLIMIT); - printf("%s(%s, NULL) = %ld %s (%m)\n", - STR_GETRLIMIT, xlat->str, rc, errno2name()); + printf("%s(%s, NULL) = %s\n", + STR_GETRLIMIT, xlat->str, sprintrc(rc)); rc = syscall(NR_GETRLIMIT, res, rlimit); if (rc) - printf("%s(%s, NULL) = %ld %s (%m)\n", - STR_GETRLIMIT, xlat->str, rc, errno2name()); + printf("%s(%s, %p) = %s\n", + STR_GETRLIMIT, xlat->str, rlimit, sprintrc(rc)); else printf("%s(%s, {rlim_cur=%s, rlim_max=%s})" " = 0\n", STR_GETRLIMIT, xlat->str, diff --git a/tests-m32/xselect.c b/tests-m32/xselect.c index 39e87ac7..f6048f25 100644 --- a/tests-m32/xselect.c +++ b/tests-m32/xselect.c @@ -1,104 +1,453 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin - * All rights reserved. + * Check decoding of select/_newselect syscalls. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Copyright (c) 2015-2018 Dmitry V. Levin + * Copyright (c) 2015-2017 The strace developers. + * All rights reserved. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ /* * Based on test by Dr. David Alan Gilbert */ -#include +#include +#include +#include #include +#include #include #include -static fd_set set[0x1000000 / sizeof(fd_set)]; +static const char *errstr; -int main(void) +static long +xselect(const kernel_ulong_t nfds, + const kernel_ulong_t rs, + const kernel_ulong_t ws, + const kernel_ulong_t es, + const kernel_ulong_t tv) +#ifndef xselect { - int fds[2]; - struct { - struct timeval tv; - int pad[2]; - } tm_in = { - .tv = { .tv_sec = 0xc0de1, .tv_usec = 0xc0de2 }, - .pad = { 0xdeadbeef, 0xbadc0ded } - }, tm = tm_in; + long rc = syscall(TEST_SYSCALL_NR, + F8ILL_KULONG_MASK | nfds, rs, ws, es, tv); + errstr = sprintrc(rc); + return rc; +} +#else + ; +#endif + +#define XSELECT(expected_, ...) \ + do { \ + long rc = xselect(__VA_ARGS__); \ + if (rc != (expected_)) \ + perror_msg_and_fail(TEST_SYSCALL_STR \ + ": expected %d" \ + ", returned %ld", \ + (expected_), rc); \ + } while (0) \ +/* End of XSELECT definition. */ + +int +main(void) +{ +#ifdef PATH_TRACING_FD + skip_if_unavailable("/proc/self/fd/"); +#endif + for (int i = 3; i < FD_SETSIZE; ++i) { +#ifdef PATH_TRACING_FD + if (i == PATH_TRACING_FD) + continue; +#endif + (void) close(i); + } + + int fds[2]; if (pipe(fds)) perror_msg_and_fail("pipe"); + static const int smallset_size = sizeof(kernel_ulong_t) * 8; + const int nfds = fds[1] + 1; + if (nfds > smallset_size) + error_msg_and_fail("nfds[%d] > smallset_size[%d]\n", + nfds, smallset_size); + + struct timeval tv_in = { 0, 123 }; + struct timeval *const tv = tail_memdup(&tv_in, sizeof(tv_in)); + const uintptr_t a_tv = (uintptr_t) tv; + + TAIL_ALLOC_OBJECT_VAR_PTR(kernel_ulong_t, l_rs); + fd_set *const rs = (void *) l_rs; + const uintptr_t a_rs = (uintptr_t) rs; + + TAIL_ALLOC_OBJECT_VAR_PTR(kernel_ulong_t, l_ws); + fd_set *const ws = (void *) l_ws; + const uintptr_t a_ws = (uintptr_t) ws; + + TAIL_ALLOC_OBJECT_VAR_PTR(kernel_ulong_t, l_es); + fd_set *const es = (void *) l_es; + const uintptr_t a_es = (uintptr_t) es; + + long rc; + /* - * Start with a nice simple select. + * An equivalent of nanosleep. */ - FD_ZERO(set); - FD_SET(fds[0], set); - FD_SET(fds[1], set); - int rc = syscall(TEST_SYSCALL_NR, fds[1] + 1, set, set, set, NULL); - if (rc < 0) - perror_msg_and_skip(TEST_SYSCALL_STR); - assert(rc == 1); - printf("%s(%d, [%d %d], [%d %d], [%d %d], NULL) = 1 ()\n", - TEST_SYSCALL_STR, fds[1] + 1, fds[0], fds[1], - fds[0], fds[1], fds[0], fds[1]); + if (xselect(0, 0, 0, 0, a_tv)) { + if (errno == ENOSYS) + perror_msg_and_skip(TEST_SYSCALL_STR); + else + perror_msg_and_fail(TEST_SYSCALL_STR); + } +#ifndef PATH_TRACING_FD + printf("%s(0, NULL, NULL, NULL, {tv_sec=%lld, tv_usec=%llu})" + " = 0 (Timeout)\n", + TEST_SYSCALL_STR, (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec)); +#endif + + /* EFAULT on tv argument */ + XSELECT(-1, 0, 0, 0, 0, a_tv + 1); +#ifndef PATH_TRACING_FD + printf("%s(0, NULL, NULL, NULL, %#lx) = %s\n", + TEST_SYSCALL_STR, (unsigned long) a_tv + 1, errstr); +#endif + + /* + * Start with a nice simple select with the same set. + */ + for (int i = nfds; i <= smallset_size; ++i) { + *l_rs = (1UL << fds[0]) | (1UL << fds[1]); + XSELECT(1, i, a_rs, a_rs, a_rs, 0); +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [%d %d], [%d %d], NULL) = 1 ()\n", + TEST_SYSCALL_STR, i, fds[0], fds[1], + fds[0], fds[1], fds[0], fds[1]); +#else + *l_rs = (1UL << fds[0]) | (1UL << fds[1]) | + (1UL << PATH_TRACING_FD); + XSELECT(i > PATH_TRACING_FD ? 3 : 1, i, a_rs, a_rs, a_rs, 0); + if (i > PATH_TRACING_FD) { + printf("%s(%d, [%d %d %d], [%d %d %d], [%d %d %d]" + ", NULL) = 3 ()\n", + TEST_SYSCALL_STR, i, + fds[0], fds[1], PATH_TRACING_FD, + fds[0], fds[1], PATH_TRACING_FD, + fds[0], fds[1], PATH_TRACING_FD); + } +#endif + } + + /* + * Odd timeout. + */ + *l_rs = (1UL << fds[0]) | (1UL << fds[1]); + tv_in.tv_sec = 0xdeadbeefU; + tv_in.tv_usec = 0xfacefeedU; + memcpy(tv, &tv_in, sizeof(tv_in)); + rc = xselect(nfds, a_rs, a_rs, a_rs, a_tv); + if (rc < 0) { +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [%d %d], [%d %d]" + ", {tv_sec=%lld, tv_usec=%llu}) = %s\n", + TEST_SYSCALL_STR, nfds, fds[0], fds[1], + fds[0], fds[1], fds[0], fds[1], + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + errstr); +#endif /* !PATH_TRACING_FD */ + } else { +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [%d %d], [%d %d]" + ", {tv_sec=%lld, tv_usec=%llu}) = %ld" + " (left {tv_sec=%lld, tv_usec=%llu})\n", + TEST_SYSCALL_STR, nfds, fds[0], fds[1], + fds[0], fds[1], fds[0], fds[1], + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + rc, (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); +#endif /* !PATH_TRACING_FD */ + } + + /* + * Very odd timeout. + */ + *l_rs = (1UL << fds[0]) | (1UL << fds[1]); + tv_in.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + tv_in.tv_usec = (suseconds_t) 0xbadc0dedfacefeedLL; + memcpy(tv, &tv_in, sizeof(tv_in)); + rc = xselect(nfds, a_rs, a_rs, a_rs, a_tv); + if (rc < 0) { +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [%d %d], [%d %d]" + ", {tv_sec=%lld, tv_usec=%llu}) = %s\n", + TEST_SYSCALL_STR, nfds, fds[0], fds[1], + fds[0], fds[1], fds[0], fds[1], + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + errstr); +#endif /* PATH_TRACING_FD */ + } else { +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [%d %d], [%d %d]" + ", {tv_sec=%lld, tv_usec=%llu}) = %ld" + " (left {tv_sec=%lld, tv_usec=%llu})\n", + TEST_SYSCALL_STR, nfds, fds[0], fds[1], + fds[0], fds[1], fds[0], fds[1], + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + rc, (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); +#endif /* PATH_TRACING_FD */ + } /* * Another simple one, with a timeout. */ - FD_SET(1, set); - FD_SET(2, set); - FD_SET(fds[0], set); - FD_SET(fds[1], set); - assert(syscall(TEST_SYSCALL_NR, fds[1] + 1, NULL, set, NULL, &tm.tv) == 3); - printf("%s(%d, NULL, [1 2 %d %d], NULL, {tv_sec=%lld, tv_usec=%lld})" - " = 3 (out [1 2 %d], left {tv_sec=%lld, tv_usec=%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], - (long long) tm.tv.tv_sec, (long long) tm.tv.tv_usec); + for (int i = nfds; i <= smallset_size; ++i) { + *l_rs = (1UL << fds[0]) | (1UL << fds[1]); + *l_ws = (1UL << 1) | (1UL << 2) | + (1UL << fds[0]) | (1UL << fds[1]); + *l_es = 0; + tv_in.tv_sec = 0xc0de1; + tv_in.tv_usec = 0xc0de2; + memcpy(tv, &tv_in, sizeof(tv_in)); + XSELECT(3, i, a_rs, a_ws, a_es, a_tv); +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [%d %d %d %d], []" + ", {tv_sec=%lld, tv_usec=%llu}) = 3 (out [1 2 %d]" + ", left {tv_sec=%lld, tv_usec=%llu})\n", + TEST_SYSCALL_STR, i, fds[0], fds[1], + 1, 2, fds[0], fds[1], + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + fds[1], + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); +#else + *l_rs = (1UL << fds[0]) | (1UL << fds[1]) | + (1UL << PATH_TRACING_FD); + *l_ws = (1UL << 1) | (1UL << 2) | + (1UL << fds[0]) | (1UL << fds[1]); + tv_in.tv_sec = 0xc0de1; + tv_in.tv_usec = 0xc0de2; + memcpy(tv, &tv_in, sizeof(tv_in)); + XSELECT(3 + (i > PATH_TRACING_FD), i, a_rs, a_ws, a_es, a_tv); + if (i > PATH_TRACING_FD) { + printf("%s(%d, [%d %d %d], [%d %d %d %d], []" + ", {tv_sec=%lld, tv_usec=%llu})" + " = 4 (in [%d], out [1 2 %d]" + ", left {tv_sec=%lld, tv_usec=%llu})\n", + TEST_SYSCALL_STR, i, + fds[0], fds[1], PATH_TRACING_FD, + 1, 2, fds[0], fds[1], + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + PATH_TRACING_FD, fds[1], + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); + } + + *l_rs = (1UL << fds[0]) | (1UL << fds[1]); + *l_ws = (1UL << 1) | (1UL << 2) | + (1UL << fds[0]) | (1UL << fds[1]) | + (1UL << PATH_TRACING_FD); + tv_in.tv_sec = 0xc0de1; + tv_in.tv_usec = 0xc0de2; + memcpy(tv, &tv_in, sizeof(tv_in)); + XSELECT(3 + (i > PATH_TRACING_FD), i, a_rs, a_ws, a_es, a_tv); + if (i > PATH_TRACING_FD) { + printf("%s(%d, [%d %d], [%d %d %d %d %d], []" + ", {tv_sec=%lld, tv_usec=%llu})" + " = 4 (out [1 2 %d %d]" + ", left {tv_sec=%lld, tv_usec=%llu})\n", + TEST_SYSCALL_STR, i, + fds[0], fds[1], + 1, 2, fds[0], fds[1], PATH_TRACING_FD, + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + fds[1], PATH_TRACING_FD, + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); + } + + *l_rs = (1UL << fds[0]) | (1UL << fds[1]); + *l_ws = (1UL << 1) | (1UL << 2) | + (1UL << fds[0]) | (1UL << fds[1]); + *l_es = (1UL << PATH_TRACING_FD); + tv_in.tv_sec = 0xc0de1; + tv_in.tv_usec = 0xc0de2; + memcpy(tv, &tv_in, sizeof(tv_in)); + XSELECT(3, i, a_rs, a_ws, a_es, a_tv); + if (i > PATH_TRACING_FD) { + printf("%s(%d, [%d %d], [%d %d %d %d], [%d]" + ", {tv_sec=%lld, tv_usec=%llu}) = 3 (out [1 2 %d]" + ", left {tv_sec=%lld, tv_usec=%llu})\n", + TEST_SYSCALL_STR, i, + fds[0], fds[1], + 1, 2, fds[0], fds[1], PATH_TRACING_FD, + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + fds[1], + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); + } + +#endif /* PATH_TRACING_FD */ + } /* * Now the crash case that trinity found, negative nfds * but with a pointer to a large chunk of valid memory. */ - FD_ZERO(set); - FD_SET(fds[1],set); - assert(syscall(TEST_SYSCALL_NR, -1, NULL, set, NULL, NULL) == -1); - printf("%s(-1, NULL, %p, NULL, NULL) = -1 EINVAL (%m)\n", - TEST_SYSCALL_STR, set); + static fd_set set[0x1000000 / sizeof(fd_set)]; + FD_SET(fds[1], set); + XSELECT(-1, -1U, 0, (uintptr_t) set, 0, 0); +#ifndef PATH_TRACING_FD + printf("%s(-1, NULL, %p, NULL, NULL) = %s\n", + TEST_SYSCALL_STR, set, errstr); +#endif + + /* + * Big sets, nfds exceeds FD_SETSIZE limit. + */ + const size_t big_size = sizeof(fd_set) + sizeof(long); + fd_set *const big_rs = tail_alloc(big_size); + const uintptr_t a_big_rs = (uintptr_t) big_rs; + + fd_set *const big_ws = tail_alloc(big_size); + const uintptr_t a_big_ws = (uintptr_t) big_ws; + + for (unsigned int i = FD_SETSIZE; i <= big_size * 8; ++i) { + memset(big_rs, 0, big_size); + memset(big_ws, 0, big_size); + FD_SET(fds[0], big_rs); + tv->tv_sec = 0; + tv->tv_usec = 10 + (i - FD_SETSIZE); + XSELECT(0, i, a_big_rs, a_big_ws, 0, a_tv); +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d], [], NULL, {tv_sec=0, tv_usec=%d})" + " = 0 (Timeout)\n", + TEST_SYSCALL_STR, i, fds[0], 10 + (i - FD_SETSIZE)); +#else + FD_SET(fds[0], big_rs); + FD_SET(PATH_TRACING_FD, big_rs); + tv->tv_sec = 0; + tv->tv_usec = 10 + (i - FD_SETSIZE); + XSELECT(1, i, a_big_rs, a_big_ws, 0, a_tv); + printf("%s(%d, [%d %d], [], NULL, {tv_sec=0, tv_usec=%d})" + " = 1 (in [%d], left {tv_sec=0, tv_usec=%llu})\n", + TEST_SYSCALL_STR, i, fds[0], PATH_TRACING_FD, + 10 + (i - FD_SETSIZE), PATH_TRACING_FD, + zero_extend_signed_to_ull(tv->tv_usec)); +#endif /* PATH_TRACING_FD */ + } + + /* + * Huge sets, nfds equals to INT_MAX. + */ + FD_SET(fds[0], set); + FD_SET(fds[1], set); + tv->tv_sec = 0; + tv->tv_usec = 123; + XSELECT(0, INT_MAX, (uintptr_t) set, (uintptr_t) &set[1], + (uintptr_t) &set[2], a_tv); +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [], [], {tv_sec=0, tv_usec=123})" + " = 0 (Timeout)\n", + TEST_SYSCALL_STR, INT_MAX, fds[0], fds[1]); +#else + FD_SET(fds[0], set); + FD_SET(fds[1], set); + FD_SET(PATH_TRACING_FD, set); + tv->tv_sec = 0; + tv->tv_usec = 123; + XSELECT(1, INT_MAX, (uintptr_t) set, (uintptr_t) &set[1], + (uintptr_t) &set[2], a_tv); + printf("%s(%d, [%d %d %d], [], [], {tv_sec=0, tv_usec=123})" + " = 1 (in [%d], left {tv_sec=0, tv_usec=%llu})\n", + TEST_SYSCALL_STR, INT_MAX, fds[0], fds[1], PATH_TRACING_FD, + PATH_TRACING_FD, zero_extend_signed_to_ull(tv->tv_usec)); +#endif /* PATH_TRACING_FD */ + + /* + * Small sets, nfds exceeds FD_SETSIZE limit. + * The kernel seems to be fine with it but strace cannot follow. + */ + *l_rs = (1UL << fds[0]) | (1UL << fds[1]) +#ifdef PATH_TRACING_FD + | (1UL << PATH_TRACING_FD) +#endif + ; + *l_ws = (1UL << fds[0]); + *l_es = (1UL << fds[0]) | (1UL << fds[1]) +#ifdef PATH_TRACING_FD + | (1UL << PATH_TRACING_FD) +#endif + ; + tv->tv_sec = 0; + tv->tv_usec = 123; + rc = xselect(FD_SETSIZE + 1, a_rs, a_ws, a_es, a_tv); + if (rc < 0) { +#ifndef PATH_TRACING_FD + printf("%s(%d, %p, %p, %p, {tv_sec=0, tv_usec=123}) = %s\n", + TEST_SYSCALL_STR, FD_SETSIZE + 1, rs, ws, es, errstr); +#endif + } else { +#ifndef PATH_TRACING_FD + printf("%s(%d, %p, %p, %p, {tv_sec=0, tv_usec=123})" + " = 0 (Timeout)\n", + TEST_SYSCALL_STR, FD_SETSIZE + 1, rs, ws, es); +#endif + } + + /* + * Small sets, one of allocated descriptors exceeds smallset_size. + */ + if (dup2(fds[1], smallset_size) != smallset_size) + perror_msg_and_fail("dup2"); +#ifdef PATH_TRACING_FD + FD_SET(PATH_TRACING_FD, rs); + FD_SET(PATH_TRACING_FD, ws); + FD_SET(PATH_TRACING_FD, es); +#endif + XSELECT(-1, smallset_size + 1, a_rs, a_ws, a_es, 0); +#ifndef PATH_TRACING_FD + printf("%s(%d, %p, %p, %p, NULL) = %s\n", + TEST_SYSCALL_STR, smallset_size + 1, rs, ws, es, errstr); +#endif /* - * Another variant, with nfds exceeding FD_SETSIZE limit. + * Small and big sets, + * one of allocated descriptors exceeds smallset_size. */ - FD_ZERO(set); - FD_SET(fds[0],set); - tm.tv.tv_sec = 0; - tm.tv.tv_usec = 123; - assert(syscall(TEST_SYSCALL_NR, FD_SETSIZE + 1, set, set + 1, NULL, &tm.tv) == 0); - printf("%s(%d, [%d], [], NULL, {tv_sec=0, tv_usec=123}) = 0 (Timeout)\n", - TEST_SYSCALL_STR, FD_SETSIZE + 1, fds[0]); + memset(big_rs, 0, big_size); + FD_SET(fds[0], big_rs); + FD_SET(smallset_size, big_rs); + memset(big_ws, 0, big_size); + FD_SET(fds[1], big_ws); + FD_SET(smallset_size, big_ws); + XSELECT(-1, smallset_size + 1, a_big_rs, a_big_ws, a_es, 0); +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [%d %d], %p, NULL) = %s\n", + TEST_SYSCALL_STR, smallset_size + 1, + fds[0], smallset_size, + fds[1], smallset_size, + es, errstr); +#endif /* !PATH_TRACING_FD */ + XSELECT(-1, smallset_size + 1, a_es, a_big_ws, a_big_rs, 0); +#ifndef PATH_TRACING_FD + printf("%s(%d, %p, [%d %d], [%d %d], NULL) = %s\n", + TEST_SYSCALL_STR, smallset_size + 1, + es, + fds[1], smallset_size, + fds[0], smallset_size, + errstr); +#endif /* !PATH_TRACING_FD */ puts("+++ exited with 0 +++"); return 0; diff --git a/tests-m32/xstatfs.c b/tests-m32/xstatfs.c index 26c43dee..a7f7dd2d 100644 --- a/tests-m32/xstatfs.c +++ b/tests-m32/xstatfs.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #define SYSCALL_INVOKE(file, desc, ptr, size) \ diff --git a/tests-m32/xstatfs64.c b/tests-m32/xstatfs64.c index 8f50de29..5a3dcb47 100644 --- a/tests-m32/xstatfs64.c +++ b/tests-m32/xstatfs64.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #define SYSCALL_INVOKE(file, desc, ptr, size) \ diff --git a/tests-m32/xstatfsx.c b/tests-m32/xstatfsx.c index d8288f1f..1b91e844 100644 --- a/tests-m32/xstatfsx.c +++ b/tests-m32/xstatfsx.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -37,12 +18,17 @@ #include "xlat/statfs_flags.h" #define PRINT_NUM(arg) \ - if (sizeof(b->arg) == sizeof(int)) \ - printf(", %s=%u", #arg, (unsigned int) b->arg); \ - else if (sizeof(b->arg) == sizeof(long)) \ - printf(", %s=%lu", #arg, (unsigned long) b->arg); \ - else \ - printf(", %s=%llu", #arg, (unsigned long long) b->arg) + do { \ + if (sizeof(b->arg) == sizeof(int)) \ + printf(", %s=%u", #arg, \ + (unsigned int) b->arg); \ + else if (sizeof(b->arg) == sizeof(long)) \ + printf(", %s=%lu", #arg, \ + (unsigned long) b->arg); \ + else \ + printf(", %s=%llu", #arg, \ + (unsigned long long) b->arg); \ + } while (0) static void print_statfs_type(const char *const prefix, const unsigned int magic) @@ -62,9 +48,9 @@ print_statfs(const char *const sample, const char *magic_str) { int fd = open(sample, O_RDONLY); if (fd < 0) - perror_msg_and_fail("open: %s", sample); + perror_msg_and_skip("open: %s", sample); - STRUCT_STATFS *const b = tail_alloc(sizeof(*b)); + TAIL_ALLOC_OBJECT_CONST_PTR(STRUCT_STATFS, b); long rc = SYSCALL_INVOKE(sample, fd, b, sizeof(*b)); if (rc) perror_msg_and_skip(SYSCALL_NAME); diff --git a/tests-m32/xstatx.c b/tests-m32/xstatx.c index 0d5fca87..0d223bdc 100644 --- a/tests-m32/xstatx.c +++ b/tests-m32/xstatx.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #if defined HAVE_FTRUNCATE && defined HAVE_FUTIMENS @@ -47,26 +28,8 @@ # include # include -static void -print_time(const time_t t) -{ - if (!t) { - printf("0"); - return; - } - - struct tm *p = localtime(&t); - - if (p) { - char buf[256]; - - strftime(buf, sizeof(buf), "%FT%T%z", p); - - printf("%s", buf); - } else { - printf("%llu", zero_extend_signed_to_ull(t)); - } -} +# include "print_fields.h" +# include "statx.h" # ifndef STRUCT_STAT # define STRUCT_STAT struct stat @@ -81,10 +44,14 @@ typedef off_t libc_off_t; # define stat libc_stat # define stat64 libc_stat64 +# define statx libc_statx +# define statx_timestamp libc_statx_timestamp # include # include -# undef stat +# undef statx_timestamp +# undef statx # undef stat64 +# undef stat # undef st_atime # undef st_mtime @@ -130,6 +97,11 @@ typedef off_t libc_off_t; # define OLD_STAT 0 # endif +# ifndef IS_STATX +# define IS_STATX 0 +# endif + +# if !XLAT_RAW /* Fixes -Wunused warning */ static void print_ftype(const unsigned int mode) { @@ -150,59 +122,168 @@ print_perms(const unsigned int mode) { printf("%#o", mode & ~S_IFMT); } +# endif + +static void +print_st_mode(const unsigned int mode) +{ +# if XLAT_RAW + printf("%#o", mode); +# elif XLAT_VERBOSE + printf("%#o /* ", mode); + print_ftype(mode); + printf("|"); + print_perms(mode); + printf(" */"); +# else + print_ftype(mode); + printf("|"); + print_perms(mode); +# endif +} + +# if !IS_STATX + +static const char * +sprint_makedev(const unsigned long long val) +{ + static char devid[256]; + int ret; + +# if XLAT_RAW + ret = snprintf(devid, sizeof(devid), + "%#llx", val); +# elif XLAT_VERBOSE + ret = snprintf(devid, sizeof(devid), + "%#llx /* makedev(%#x, %#x) */", + val, major(val), minor(val)); +# else /* XLAT_ABBREV */ + ret = snprintf(devid, sizeof(devid), + "makedev(%#x, %#x)", + major(val), minor(val)); +# endif + if (ret < 0) + perror_msg_and_fail("sprint_makedev(%llx)", val); + if ((unsigned) ret >= sizeof(devid)) + error_msg_and_fail("sprint_makedev(%llx): buffer " + "overflow", val); + return devid; +} + static void print_stat(const STRUCT_STAT *st) { - printf("{st_dev=makedev(%u, %u)", - (unsigned int) major(zero_extend_signed_to_ull(st->st_dev)), - (unsigned int) minor(zero_extend_signed_to_ull(st->st_dev))); + unsigned long long dev, rdev; + + dev = zero_extend_signed_to_ull(st->st_dev); + rdev = zero_extend_signed_to_ull(st->st_rdev); + printf("{st_dev=%s", sprint_makedev(dev)); printf(", st_ino=%llu", zero_extend_signed_to_ull(st->st_ino)); printf(", st_mode="); - print_ftype(st->st_mode); - printf("|"); - print_perms(st->st_mode); + print_st_mode(st->st_mode); printf(", st_nlink=%llu", zero_extend_signed_to_ull(st->st_nlink)); printf(", st_uid=%llu", zero_extend_signed_to_ull(st->st_uid)); printf(", st_gid=%llu", zero_extend_signed_to_ull(st->st_gid)); -# if OLD_STAT +# if OLD_STAT printf(", st_blksize=0, st_blocks=0"); -# else /* !OLD_STAT */ +# else /* !OLD_STAT */ printf(", st_blksize=%llu", zero_extend_signed_to_ull(st->st_blksize)); printf(", st_blocks=%llu", zero_extend_signed_to_ull(st->st_blocks)); -# endif /* OLD_STAT */ +# endif /* OLD_STAT */ switch (st->st_mode & S_IFMT) { case S_IFCHR: case S_IFBLK: - printf(", st_rdev=makedev(%u, %u)", - (unsigned int) major(zero_extend_signed_to_ull(st->st_rdev)), - (unsigned int) minor(zero_extend_signed_to_ull(st->st_rdev))); + printf(", st_rdev=%s", sprint_makedev(rdev)); break; default: printf(", st_size=%llu", zero_extend_signed_to_ull(st->st_size)); } - printf(", st_atime="); - print_time(sign_extend_unsigned_to_ll(st->st_atime)); -# if defined(HAVE_STRUCT_STAT_ST_MTIME_NSEC) && !OLD_STAT - if (st->st_atime_nsec) - printf(".%09llu", zero_extend_signed_to_ull(st->st_atime_nsec)); -# endif - printf(", st_mtime="); - print_time(sign_extend_unsigned_to_ll(st->st_mtime)); -# if defined(HAVE_STRUCT_STAT_ST_MTIME_NSEC) && !OLD_STAT - if (st->st_mtime_nsec) - printf(".%09llu", zero_extend_signed_to_ull(st->st_mtime_nsec)); -# endif - printf(", st_ctime="); - print_time(sign_extend_unsigned_to_ll(st->st_ctime)); -# if defined(HAVE_STRUCT_STAT_ST_MTIME_NSEC) && !OLD_STAT - if (st->st_ctime_nsec) - printf(".%09llu", zero_extend_signed_to_ull(st->st_ctime_nsec)); -# endif +# if defined(HAVE_STRUCT_STAT_ST_MTIME_NSEC) && !OLD_STAT +# define TIME_NSEC(val) zero_extend_signed_to_ull(val) +# define HAVE_NSEC 1 +# else +# define TIME_NSEC(val) 0ULL +# define HAVE_NSEC 0 +# endif + +# define PRINT_ST_TIME(field) \ + do { \ + printf(", st_" #field "=%lld", \ + sign_extend_unsigned_to_ll(st->st_ ## field)); \ + print_time_t_nsec(sign_extend_unsigned_to_ll(st->st_ ## field), \ + TIME_NSEC(st->st_ ## field ## _nsec), 1); \ + if (HAVE_NSEC) \ + printf(", st_" #field "_nsec=%llu", \ + TIME_NSEC(st->st_ ## field ## _nsec)); \ + } while (0) + + PRINT_ST_TIME(atime); + PRINT_ST_TIME(mtime); + PRINT_ST_TIME(ctime); printf("}"); } +# else /* !IS_STATX */ + +static void +print_stat(const STRUCT_STAT *st) +{ +# define PRINT_FIELD_U32_UID(field) \ + do { \ + if (st->field == (uint32_t) -1) \ + printf(", %s=-1", #field); \ + else \ + printf(", %s=%llu", #field, \ + (unsigned long long) st->field); \ + } while (0) + +# define PRINT_FIELD_TIME(field) \ + do { \ + printf(", %s={tv_sec=%lld, tv_nsec=%u}", \ + #field, (long long) st->field.tv_sec, \ + (unsigned) st->field.tv_nsec); \ + print_time_t_nsec(st->field.tv_sec, \ + zero_extend_signed_to_ull(st->field.tv_nsec), \ + 1); \ + } while (0) + + printf("{stx_mask="); + printflags(statx_masks, st->stx_mask, "STATX_???"); + + PRINT_FIELD_U(", ", *st, stx_blksize); + + printf(", stx_attributes="); + printflags(statx_attrs, st->stx_attributes, "STATX_ATTR_???"); + + PRINT_FIELD_U(", ", *st, stx_nlink); + PRINT_FIELD_U32_UID(stx_uid); + PRINT_FIELD_U32_UID(stx_gid); + + printf(", stx_mode="); + print_st_mode(st->stx_mode); + + PRINT_FIELD_U(", ", *st, stx_ino); + PRINT_FIELD_U(", ", *st, stx_size); + PRINT_FIELD_U(", ", *st, stx_blocks); + + printf(", stx_attributes_mask="); + printflags(statx_attrs, st->stx_attributes_mask, "STATX_ATTR_???"); + + PRINT_FIELD_TIME(stx_atime); + PRINT_FIELD_TIME(stx_btime); + PRINT_FIELD_TIME(stx_ctime); + PRINT_FIELD_TIME(stx_mtime); + PRINT_FIELD_U(", ", *st, stx_rdev_major); + PRINT_FIELD_U(", ", *st, stx_rdev_minor); + PRINT_FIELD_U(", ", *st, stx_dev_major); + PRINT_FIELD_U(", ", *st, stx_dev_minor); + printf("}"); +} + +# endif /* !IS_STATX */ + static int create_sample(const char *fname, const libc_off_t size) { @@ -229,19 +310,19 @@ create_sample(const char *fname, const libc_off_t size) int main(void) { -# if !IS_FSTAT +# if IS_FSTAT + skip_if_unavailable("/proc/self/fd/"); +# else static const char full[] = "/dev/full"; # endif - static const char sample[] = TEST_SYSCALL_STR ".sample"; - STRUCT_STAT st[2]; + static const char sample[] = "stat.sample"; + TAIL_ALLOC_OBJECT_CONST_PTR(STRUCT_STAT, st); int rc; rc = create_sample(sample, SAMPLE_SIZE); - if (rc) { - (void) unlink(sample); + if (rc) return rc; - } # if TEST_BOGUS_STRUCT_STAT STRUCT_STAT *st_cut = tail_alloc(sizeof(long) * 4); @@ -262,46 +343,71 @@ main(void) # endif if ((rc = TEST_SYSCALL_INVOKE(sample, st))) { -# if OLD_STAT - if (errno != EOVERFLOW) -# endif - { + if (errno != EOVERFLOW) { + rc = (errno == ENOSYS) ? 77 : 1; perror(TEST_SYSCALL_STR); - (void) unlink(sample); - return 77; + return rc; } } - (void) unlink(sample); + +# if IS_STATX +# define ST_SIZE_FIELD stx_size +# else +# define ST_SIZE_FIELD st_size +# endif if (!rc && zero_extend_signed_to_ull(SAMPLE_SIZE) != - zero_extend_signed_to_ull(st[0].st_size)) { + zero_extend_signed_to_ull(st->ST_SIZE_FIELD)) { fprintf(stderr, "Size mismatch: " "requested size(%llu) != st_size(%llu)\n", zero_extend_signed_to_ull(SAMPLE_SIZE), - zero_extend_signed_to_ull(st[0].st_size)); + zero_extend_signed_to_ull(st->ST_SIZE_FIELD)); fprintf(stderr, "The most likely reason for this is incorrect" " definition of %s.\n" "Here is some diagnostics that might help:\n", STRUCT_STAT_STR); -#define LOG_STAT_OFFSETOF_SIZEOF(object, member) \ +# define LOG_STAT_OFFSETOF_SIZEOF(object, member) \ fprintf(stderr, "offsetof(%s, %s) = %zu" \ ", sizeof(%s) = %zu\n", \ STRUCT_STAT_STR, #member, \ offsetof(STRUCT_STAT, member), \ #member, sizeof((object).member)) - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_dev); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_ino); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_mode); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_nlink); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_uid); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_gid); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_rdev); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_size); -# if !OLD_STAT - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_blksize); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_blocks); -# endif /* !OLD_STAT */ +# if IS_STATX + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_mask); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_blksize); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_attributes); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_nlink); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_uid); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_gid); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_mode); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_ino); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_size); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_blocks); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_attributes_mask); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_atime); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_btime); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_ctime); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_mtime); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_rdev_major); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_rdev_minor); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_dev_major); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_dev_minor); +# else + LOG_STAT_OFFSETOF_SIZEOF(*st, st_dev); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_ino); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_mode); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_nlink); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_uid); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_gid); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_rdev); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_size); +# if !OLD_STAT + LOG_STAT_OFFSETOF_SIZEOF(*st, st_blksize); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_blocks); +# endif /* !OLD_STAT */ + +# endif /* IS_STATX */ return 1; } @@ -313,6 +419,69 @@ main(void) print_stat(st); PRINT_SYSCALL_FOOTER(rc); +# if IS_STATX + +# define INVOKE() \ + do { \ + rc = TEST_SYSCALL_INVOKE(sample, st); \ + PRINT_SYSCALL_HEADER(sample); \ + if (rc) \ + printf("%p", st); \ + else \ + print_stat(st); \ + PRINT_SYSCALL_FOOTER(rc); \ + } while (0) + +# define SET_FLAGS_INVOKE(flags, flags_str) \ + do { \ + TEST_SYSCALL_STATX_FLAGS = flags; \ + TEST_SYSCALL_STATX_FLAGS_STR = flags_str; \ + INVOKE(); \ + } while (0) + +# define SET_MASK_INVOKE(mask, mask_str) \ + do { \ + TEST_SYSCALL_STATX_MASK = mask; \ + TEST_SYSCALL_STATX_MASK_STR = mask_str; \ + INVOKE(); \ + } while (0) + + unsigned old_flags = TEST_SYSCALL_STATX_FLAGS; + const char *old_flags_str = TEST_SYSCALL_STATX_FLAGS_STR; + unsigned old_mask = TEST_SYSCALL_STATX_MASK; + const char *old_mask_str = TEST_SYSCALL_STATX_MASK_STR; + + SET_FLAGS_INVOKE(AT_SYMLINK_FOLLOW | 0xffff0000U, + "AT_STATX_SYNC_AS_STAT|AT_SYMLINK_FOLLOW|0xffff0000"); + + SET_FLAGS_INVOKE(AT_STATX_SYNC_TYPE, + "AT_STATX_FORCE_SYNC|AT_STATX_DONT_SYNC"); + + SET_FLAGS_INVOKE(0xffffff, + "AT_STATX_FORCE_SYNC|AT_STATX_DONT_SYNC|AT_SYMLINK_NOFOLLOW|" + "AT_REMOVEDIR|AT_SYMLINK_FOLLOW|AT_NO_AUTOMOUNT|AT_EMPTY_PATH|" + "0xff80ff"); + + /* We're done playing with flags. */ + TEST_SYSCALL_STATX_FLAGS = old_flags; + TEST_SYSCALL_STATX_FLAGS_STR = old_flags_str; + + SET_MASK_INVOKE(0, "0"); + SET_MASK_INVOKE(0xfffff000U, "0xfffff000 /* STATX_??? */"); + + SET_MASK_INVOKE(0xfffffffbU, + "STATX_TYPE|STATX_MODE|STATX_UID|STATX_GID|STATX_ATIME|" + "STATX_MTIME|STATX_CTIME|STATX_INO|STATX_SIZE|STATX_BLOCKS|" + "STATX_BTIME|0xfffff000"); + + SET_MASK_INVOKE(STATX_UID, "STATX_UID"); + + /* ...and with mask. */ + TEST_SYSCALL_STATX_MASK = old_mask; + TEST_SYSCALL_STATX_MASK_STR = old_mask_str; + +# endif /* IS_STATX */ + puts("+++ exited with 0 +++"); return 0; } diff --git a/tests-m32/xutimes.c b/tests-m32/xutimes.c new file mode 100644 index 00000000..7ad123cc --- /dev/null +++ b/tests-m32/xutimes.c @@ -0,0 +1,129 @@ +/* + * Check decoding of utimes/osf_utimes syscall. + * + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef TEST_SYSCALL_NR +# error TEST_SYSCALL_NR must be defined +#endif + +#ifndef TEST_SYSCALL_STR +# error TEST_SYSCALL_STR must be defined +#endif + +#ifndef TEST_STRUCT +# error TEST_STRUCT must be defined +#endif + +#include +#include +#include +#include + +static void +print_tv(const TEST_STRUCT *const tv) +{ + printf("{tv_sec=%lld, tv_usec=%llu}", + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); + print_time_t_usec(tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec), 1); +} + +static const char *errstr; + +static long +k_utimes(const kernel_ulong_t pathname, const kernel_ulong_t times) +{ + long rc = syscall(TEST_SYSCALL_NR, pathname, times); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const char proto_fname[] = TEST_SYSCALL_STR "_sample"; + static const char qname[] = "\"" TEST_SYSCALL_STR "_sample\""; + + char *const fname = tail_memdup(proto_fname, sizeof(proto_fname)); + const kernel_ulong_t kfname = (uintptr_t) fname; + TEST_STRUCT *const tv = tail_alloc(sizeof(*tv) * 2); + + /* pathname */ + k_utimes(0, 0); + printf("%s(NULL, NULL) = %s\n", TEST_SYSCALL_STR, errstr); + + k_utimes(kfname + sizeof(proto_fname) - 1, 0); + printf("%s(\"\", NULL) = %s\n", TEST_SYSCALL_STR, errstr); + + k_utimes(kfname, 0); + printf("%s(%s, NULL) = %s\n", TEST_SYSCALL_STR, qname, errstr); + + fname[sizeof(proto_fname) - 1] = '+'; + k_utimes(kfname, 0); + fname[sizeof(proto_fname) - 1] = '\0'; + printf("%s(%p, NULL) = %s\n", TEST_SYSCALL_STR, fname, errstr); + + if (F8ILL_KULONG_SUPPORTED) { + k_utimes(f8ill_ptr_to_kulong(fname), 0); + printf("%s(%#jx, NULL) = %s\n", TEST_SYSCALL_STR, + (uintmax_t) f8ill_ptr_to_kulong(fname), errstr); + } + + /* times */ + k_utimes(kfname, (uintptr_t) (tv + 1)); + printf("%s(%s, %p) = %s\n", TEST_SYSCALL_STR, + qname, tv + 1, errstr); + + k_utimes(kfname, (uintptr_t) (tv + 2)); + printf("%s(%s, %p) = %s\n", TEST_SYSCALL_STR, + qname, tv + 2, errstr); + + tv[0].tv_sec = 0xdeadbeefU; + tv[0].tv_usec = 0xfacefeedU; + tv[1].tv_sec = (time_t) 0xcafef00ddeadbeefLL; + tv[1].tv_usec = (suseconds_t) 0xbadc0dedfacefeedLL; + + k_utimes(kfname, (uintptr_t) tv); + printf("%s(%s, [", TEST_SYSCALL_STR, qname); + print_tv(&tv[0]); + printf(", "); + print_tv(&tv[1]); + printf("]) = %s\n", errstr); + + tv[0].tv_sec = 1492358607; + tv[0].tv_usec = 1000000; + tv[1].tv_sec = 1492356078; + tv[1].tv_usec = 1000001; + + k_utimes(kfname, (uintptr_t) tv); + printf("%s(%s, [", TEST_SYSCALL_STR, qname); + print_tv(&tv[0]); + printf(", "); + print_tv(&tv[1]); + printf("]) = %s\n", errstr); + + tv[0].tv_usec = 345678; + tv[1].tv_usec = 456789; + + k_utimes(kfname, (uintptr_t) tv); + printf("%s(%s, [", TEST_SYSCALL_STR, qname); + print_tv(&tv[0]); + printf(", "); + print_tv(&tv[1]); + printf("]) = %s\n", errstr); + + if (F8ILL_KULONG_SUPPORTED) { + k_utimes(kfname, f8ill_ptr_to_kulong(tv)); + printf("%s(%s, %#jx) = %s\n", TEST_SYSCALL_STR, + qname, (uintmax_t) f8ill_ptr_to_kulong(tv), errstr); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-m32/zeroargc.c b/tests-m32/zeroargc.c new file mode 100644 index 00000000..672959c4 --- /dev/null +++ b/tests-m32/zeroargc.c @@ -0,0 +1,23 @@ +/* + * Execute an executable with zero argc and specified anvironment. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include + +int +main(const int ac, char **const av) +{ + if (ac < 2) + error_msg_and_fail("missing operand"); + const char *const path = av[1]; + av[1] = 0; + execve(path, av + 1, av + 2); + perror_msg_and_fail("execve: %s", path); +} diff --git a/tests-mx32/COPYING b/tests-mx32/COPYING new file mode 100644 index 00000000..6aba5919 --- /dev/null +++ b/tests-mx32/COPYING @@ -0,0 +1,11 @@ +Copyright (c) 2011-2019 The strace developers. +All rights reserved. + +strace test suite is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +strace test suite is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See GPL-2.0-or-later for more details. diff --git a/tests-mx32/GPL-2.0-or-later b/tests-mx32/GPL-2.0-or-later new file mode 100644 index 00000000..2a166946 --- /dev/null +++ b/tests-mx32/GPL-2.0-or-later @@ -0,0 +1,339 @@ +GNU GENERAL PUBLIC LICENSE + +Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. + +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 , USA + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away your freedom +to share and change it. By contrast, the GNU General Public License is +intended to guarantee your freedom to share and change free software--to +make sure the software is free for all its users. This General Public +License applies to most of the Free Software Foundation's software and +to any other program whose authors commit to using it. (Some other Free +Software Foundation software is covered by the GNU Lesser General Public +License instead.) You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it in +new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid anyone +to deny you these rights or to ask you to surrender the rights. These +restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or +for a fee, you must give the recipients all the rights that you have. You +must make sure that they, too, receive or can get the source code. And +you must show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, +we want its recipients to know that what they have is not the original, +so that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains + a notice placed by the copyright holder saying it may be distributed + under the terms of this General Public License. The "Program", below, + refers to any such program or work, and a "work based on the Program" + means either the Program or any derivative work under copyright law: + that is to say, a work containing the Program or a portion of it, + either verbatim or with modifications and/or translated into another + language. (Hereinafter, translation is included without limitation + in the term "modification".) Each licensee is addressed as "you". + + Activities other than copying, distribution and modification are not + covered by this License; they are outside its scope. The act of running + the Program is not restricted, and the output from the Program is + covered only if its contents constitute a work based on the Program + (independent of having been made by running the Program). Whether + that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's source + code as you receive it, in any medium, provided that you conspicuously + and appropriately publish on each copy an appropriate copyright notice + and disclaimer of warranty; keep intact all the notices that refer + to this License and to the absence of any warranty; and give any + other recipients of the Program a copy of this License along with + the Program. + + You may charge a fee for the physical act of transferring a copy, and + you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion of + it, thus forming a work based on the Program, and copy and distribute + such modifications or work under the terms of Section 1 above, + provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that + in whole or in part contains or is derived from the Program or + any part thereof, to be licensed as a whole at no charge to all + third parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display + an announcement including an appropriate copyright notice and + a notice that there is no warranty (or else, saying that you + provide a warranty) and that users may redistribute the program + under these conditions, and telling the user how to view a copy + of this License. (Exception: if the Program itself is interactive + but does not normally print such an announcement, your work based + on the Program is not required to print an announcement.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the Program, + and can be reasonably considered independent and separate works in + themselves, then this License, and its terms, do not apply to those + sections when you distribute them as separate works. But when you + distribute the same sections as part of a whole which is a work + based on the Program, the distribution of the whole must be on the + terms of this License, whose permissions for other licensees extend + to the entire whole, and thus to each and every part regardless of + who wrote it. + + Thus, it is not the intent of this section to claim rights or contest + your rights to work written entirely by you; rather, the intent is + to exercise the right to control the distribution of derivative or + collective works based on the Program. + + In addition, mere aggregation of another work not based on the Program + with the Program (or with a work based on the Program) on a volume + of a storage or distribution medium does not bring the other work + under the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, + under Section 2) in object code or executable form under the terms of + Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; + or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer to + distribute corresponding source code. (This alternative is allowed + only for noncommercial distribution and only if you received the + program in object code or executable form with such an offer, + in accord with Subsection b above.) + + The source code for a work means the preferred form of the work + for making modifications to it. For an executable work, complete + source code means all the source code for all modules it contains, + plus any associated interface definition files, plus the scripts used + to control compilation and installation of the executable. However, + as a special exception, the source code distributed need not include + anything that is normally distributed (in either source or binary + form) with the major components (compiler, kernel, and so on) of the + operating system on which the executable runs, unless that component + itself accompanies the executable. + + If distribution of executable or object code is made by offering access + to copy from a designated place, then offering equivalent access to + copy the source code from the same place counts as distribution of + the source code, even though third parties are not compelled to copy + the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program + except as expressly provided under this License. Any attempt otherwise + to copy, modify, sublicense or distribute the Program is void, and + will automatically terminate your rights under this License. However, + parties who have received copies, or rights, from you under this + License will not have their licenses terminated so long as such + parties remain in full compliance. + + 5. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify + or distribute the Program or its derivative works. These actions + are prohibited by law if you do not accept this License. Therefore, + by modifying or distributing the Program (or any work based on the + Program), you indicate your acceptance of this License to do so, and + all its terms and conditions for copying, distributing or modifying + the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the + Program), the recipient automatically receives a license from the + original licensor to copy, distribute or modify the Program subject to + these terms and conditions. You may not impose any further restrictions + on the recipients' exercise of the rights granted herein. You are not + responsible for enforcing compliance by third parties to this License. + + 7. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent issues), + conditions are imposed on you (whether by court order, agreement + or otherwise) that contradict the conditions of this License, they + do not excuse you from the conditions of this License. If you cannot + distribute so as to satisfy simultaneously your obligations under this + License and any other pertinent obligations, then as a consequence + you may not distribute the Program at all. For example, if a patent + license would not permit royalty-free redistribution of the Program + by all those who receive copies directly or indirectly through you, + then the only way you could satisfy both it and this License would + be to refrain entirely from distribution of the Program. + + If any portion of this section is held invalid or unenforceable under + any particular circumstance, the balance of the section is intended + to apply and the section as a whole is intended to apply in other + circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of + any such claims; this section has the sole purpose of protecting + the integrity of the free software distribution system, which + is implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is willing + to distribute software through any other system and a licensee cannot + impose that choice. + + This section is intended to make thoroughly clear what is believed + to be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in + certain countries either by patents or by copyrighted interfaces, the + original copyright holder who places the Program under this License + may add an explicit geographical distribution limitation excluding + those countries, so that distribution is permitted only in or among + countries not thus excluded. In such case, this License incorporates + the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions + of the General Public License from time to time. Such new versions + will be similar in spirit to the present version, but may differ in + detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the Program + specifies a version number of this License which applies to it and + "any later version", you have the option of following the terms and + conditions either of that version or of any later version published + by the Free Software Foundation. If the Program does not specify + a version number of this License, you may choose any version ever + published by the Free Software Foundation. + + 10. If you wish to incorporate parts of the Program into other free + programs whose distribution conditions are different, write to the + author to ask for permission. For software which is copyrighted by the + Free Software Foundation, write to the Free Software Foundation; we + sometimes make exceptions for this. Our decision will be guided by the + two goals of preserving the free status of all derivatives of our free + software and of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO + WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE + LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS + AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF + ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE + PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME + THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO + IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY + MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE + TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR + CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE + THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING + RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR + A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN + IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF + SUCH DAMAGES. END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + +Copyright (C) + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 , USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author Gnomovision +comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is +free software, and you are welcome to redistribute it under certain +conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the +appropriate parts of the General Public License. Of course, the commands +you use may be called something other than `show w' and `show c'; they +could even be mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or +your school, if any, to sign a "copyright disclaimer" for the program, +if necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +< signature of Ty Coon > , 1 April 1989 Ty Coon, President of Vice This +General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/tests-mx32/Makefile.am b/tests-mx32/Makefile.am index 58efd3e2..6ea036b5 100644 --- a/tests-mx32/Makefile.am +++ b/tests-mx32/Makefile.am @@ -1,34 +1,19 @@ # Automake input for strace tests. # # Copyright (c) 2011-2016 Dmitry V. Levin +# Copyright (c) 2011-2019 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later OS = linux ARCH = @arch_mx32@ +NATIVE_ARCH = @arch_native@ +SIZEOF_KERNEL_LONG_T = @SIZEOF_KERNEL_LONG_T@ +SIZEOF_LONG = 4 MPERS_NAME = mx32 -ARCH_MFLAGS = -DMPERS_IS_$(MPERS_NAME) -mx32 +MPERS_CC_FLAGS = @cc_flags_mx32@ +ARCH_MFLAGS = -DMPERS_IS_$(MPERS_NAME) $(MPERS_CC_FLAGS) AM_CFLAGS = $(WARN_CFLAGS) AM_CPPFLAGS = $(ARCH_MFLAGS) \ -I$(builddir) \ @@ -37,27 +22,40 @@ AM_CPPFLAGS = $(ARCH_MFLAGS) \ -I$(top_builddir)/$(OS) \ -I$(top_srcdir)/$(OS) \ -I$(top_builddir) \ - -I$(top_srcdir) + -I$(top_srcdir) \ + -DTESTS_SIZEOF_KERNEL_LONG_T=$(SIZEOF_KERNEL_LONG_T) \ + -DTESTS_SIZEOF_LONG=$(SIZEOF_LONG) AM_LDFLAGS = $(ARCH_MFLAGS) libtests_a_SOURCES = \ + create_nl_socket.c \ errno2name.c \ error_msg.c \ fill_memory.c \ get_page_size.c \ + get_sigset_size.c \ hexdump_strdup.c \ hexquote_strndup.c \ + ifindex.c \ inode_of_sockfd.c \ libmmsg.c \ libsocketcall.c \ overflowuid.c \ pipe_maxfd.c \ print_quoted_string.c \ + print_time.c \ printflags.c \ printxval.c \ signal2name.c \ + skip_unavailable.c \ sprintrc.c \ tail_alloc.c \ + test_netlink.h \ + test_nlattr.h \ + test_printpath.c \ + test_printstrn.c \ + test_ucopy.c \ + test_ucopy.h \ tests.h \ tprintf.c \ # end of libtests_a_SOURCES @@ -65,396 +63,125 @@ libtests_a_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 check_LIBRARIES = libtests.a LDADD = libtests.a -check_PROGRAMS = \ - _newselect \ - accept \ - accept4 \ - access \ - acct \ - add_key \ - adjtimex \ - aio \ - alarm \ +include pure_executables.am + +check_PROGRAMS = $(PURE_EXECUTABLES) \ + _newselect-P \ answer \ attach-f-p \ attach-f-p-cmd \ attach-p-cmd-cmd \ attach-p-cmd-p \ - bpf \ - brk \ - btrfs \ - caps \ + block_reset_raise_run \ + bpf-obj_get_info_by_fd \ + bpf-obj_get_info_by_fd-prog \ + bpf-obj_get_info_by_fd-prog-v \ + bpf-obj_get_info_by_fd-v \ + bpf-success \ + bpf-success-v \ caps-abbrev \ - chmod \ - chown \ - chown32 \ - chroot \ - clock_adjtime \ - clock_nanosleep \ - clock_xettime \ - copy_file_range \ + check_sigblock \ + check_sigign \ + clone_parent \ + clone_ptrace \ count-f \ - creat \ - delete_module \ - dup \ - dup2 \ - dup3 \ - epoll_create \ - epoll_create1 \ - epoll_ctl \ - epoll_pwait \ - epoll_wait \ - erestartsys \ - eventfd \ - execve \ + delay \ execve-v \ - execveat \ execveat-v \ - faccessat \ - fadvise64 \ - fadvise64_64 \ - fallocate \ - fanotify_init \ - fanotify_mark \ - fchdir \ - fchmod \ - fchmodat \ - fchown \ - fchown32 \ - fchownat \ - fcntl \ - fcntl64 \ - fdatasync \ - file_handle \ - file_ioctl \ filter-unavailable \ - finit_module \ - flock \ fork-f \ - fstat \ - fstat64 \ - fstatat64 \ - fstatfs \ - fstatfs64 \ - fsync \ - ftruncate \ - ftruncate64 \ - futex \ - futimesat \ - get_mempolicy \ - getcpu \ - getcwd \ - getdents \ - getdents64 \ - getegid \ - getegid32 \ - geteuid \ - geteuid32 \ - getgid \ - getgid32 \ - getgroups \ - getgroups32 \ - getpeername \ - getpgrp \ - getrandom \ - getresgid \ - getresgid32 \ - getresuid \ - getresuid32 \ - getrlimit \ - getrusage \ - getsid \ - getsockname \ - getuid \ - getuid32 \ - getxxid \ - inet-cmsg \ - init_module \ - inotify \ - inotify_init1 \ - ioctl \ - ioctl_block \ - ioctl_dm \ + fsync-y \ + getpid \ + getppid \ + gettid \ + inject-nf \ + int_0x80 \ ioctl_dm-v \ - ioctl_evdev \ + ioctl_evdev-success \ + ioctl_evdev-success-v \ ioctl_evdev-v \ - ioctl_loop \ ioctl_loop-nv \ ioctl_loop-v \ - ioctl_mtd \ - ioctl_rtc \ + ioctl_nsfs \ + ioctl_perf-success \ ioctl_rtc-v \ - ioctl_scsi \ - ioctl_sg_io_v3 \ - ioctl_sg_io_v4 \ - ioctl_sock_gifconf \ - ioctl_uffdio \ - ioctl_v4l2 \ - ioperm \ - iopl \ - ioprio \ - ip_mreq \ - ipc \ - ipc_msg \ - ipc_msgbuf \ - ipc_sem \ - ipc_shm \ - kcmp \ - kexec_file_load \ - kexec_load \ - keyctl \ - kill \ + is_linux_mips_n64 \ + kill_child \ ksysent \ - lchown \ - lchown32 \ - link \ - linkat \ - llseek \ - lookup_dcookie \ - lseek \ - lstat \ - lstat64 \ - mbind \ - membarrier \ - memfd_create \ - migrate_pages \ - mincore \ - mkdir \ - mkdirat \ - mknod \ - mknodat \ - mlock \ - mlock2 \ - mlockall \ - mmap \ - mmap64 \ - mmsg \ + list_sigaction_signum \ + localtime \ + looping_threads \ mmsg-silent \ - mmsg_name \ mmsg_name-v \ - mount \ - move_pages \ - mq \ - mq_sendrecv \ - mq_sendrecv-read \ - mq_sendrecv-write \ - msg_control \ msg_control-v \ - msg_name \ - munlockall \ - nanosleep \ net-accept-connect \ - net-icmp_filter \ - net-sockaddr \ - net-y-unix \ - net-yy-inet \ - net-yy-netlink \ - net-yy-unix \ + net-tpacket_stats-success \ netlink_inet_diag \ netlink_netlink_diag \ - netlink_protocol \ netlink_unix_diag \ - newfstatat \ nsyscalls \ - old_mmap \ - oldfstat \ - oldlstat \ - oldselect \ - oldstat \ - open \ - openat \ - pause \ + nsyscalls-d \ + oldselect-P \ + oldselect-efault-P \ + orphaned_process_group \ pc \ - perf_event_open \ perf_event_open_nonverbose \ perf_event_open_unabbrev \ - personality \ - pipe \ - pipe2 \ - pkey_alloc \ - pkey_free \ - pkey_mprotect \ - poll \ - ppoll \ - prctl-arg2-intptr \ - prctl-dumpable \ - prctl-name \ - prctl-no-args \ - prctl-pdeathsig \ + ppoll-v \ prctl-seccomp-filter-v \ prctl-seccomp-strict \ - prctl-securebits \ - prctl-tid_address \ - prctl-tsc \ - pread64-pwrite64 \ - preadv \ - preadv-pwritev \ - preadv2-pwritev2 \ + prctl-spec-inject \ print_maxfd \ - printstr \ - prlimit64 \ - process_vm_readv \ - process_vm_writev \ - pselect6 \ - ptrace \ - pwritev \ qual_fault \ qual_inject-error-signal \ qual_inject-retval \ qual_inject-signal \ qual_signal \ - quotactl \ + quotactl-success \ + quotactl-success-v \ quotactl-v \ - quotactl-xfs \ + quotactl-xfs-success \ + quotactl-xfs-success-v \ quotactl-xfs-v \ - read-write \ - readahead \ - readdir \ - readlink \ - readlinkat \ - readv \ - reboot \ - recvfrom \ - recvmmsg-timeout \ - recvmsg \ redirect-fds \ - remap_file_pages \ - rename \ - renameat \ - renameat2 \ - request_key \ restart_syscall \ - rmdir \ - rt_sigpending \ - rt_sigprocmask \ - rt_sigqueueinfo \ - rt_sigsuspend \ - rt_sigtimedwait \ - rt_tgsigqueueinfo \ - sched_get_priority_mxx \ - sched_rr_get_interval \ - sched_xetaffinity \ - sched_xetattr \ - sched_xetparam \ - sched_xetscheduler \ - sched_yield \ + run_expect_termsig \ scm_rights \ - seccomp-filter \ seccomp-filter-v \ seccomp-strict \ - select \ - semop \ - sendfile \ - sendfile64 \ - set_mempolicy \ + select-P \ set_ptracer_any \ - setdomainname \ - setfsgid \ - setfsgid32 \ - setfsuid \ - setfsuid32 \ - setgid \ - setgid32 \ - setgroups \ - setgroups32 \ - sethostname \ - setns \ - setregid \ - setregid32 \ - setresgid \ - setresgid32 \ - setresuid \ - setresuid32 \ - setreuid \ - setreuid32 \ - setrlimit \ - setuid \ - setuid32 \ - shmxt \ - shutdown \ - sigaction \ - sigaltstack \ - siginfo \ + set_sigblock \ + set_sigign \ signal_receive \ - signalfd4 \ - sigreturn \ sleep \ - socketcall \ - splice \ stack-fcall \ - stat \ - stat64 \ - statfs \ - statfs64 \ - swap \ - symlink \ - symlinkat \ - sync \ - sync_file_range \ - sync_file_range2 \ - sysinfo \ - syslog \ - tee \ + stack-fcall-mangled \ threads-execve \ - time \ - timer_create \ - timer_xettime \ - timerfd_xettime \ - times \ - times-fail \ - truncate \ - truncate64 \ - ugetrlimit \ - uio \ - umask \ - umount \ - umount2 \ - umoven-illptr \ - umovestr \ - umovestr-illptr \ - umovestr2 \ - umovestr3 \ - uname \ + unblock_reset_raise \ unix-pair-send-recv \ unix-pair-sendto-recvfrom \ - unlink \ - unlinkat \ - unshare \ - userfaultfd \ - ustat \ - utime \ - utimensat \ - utimes \ vfork-f \ - vhangup \ - vmsplice \ - wait4 \ wait4-v \ - waitid \ waitid-v \ - waitpid \ - xattr \ - xattr-strings \ - xet_robust_list \ - xetitimer \ - xetpgid \ - xetpriority \ - xettimeofday \ + zeroargc \ # end of check_PROGRAMS -attach_f_p_LDADD = -lrt -lpthread $(LDADD) -clock_xettime_LDADD = -lrt $(LDADD) +attach_f_p_LDADD = -lpthread $(LDADD) count_f_LDADD = -lpthread $(LDADD) +delay_LDADD = $(clock_LIBS) $(LDADD) filter_unavailable_LDADD = -lpthread $(LDADD) fstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 fstatat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 ftruncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +localtime_LDADD = $(clock_LIBS) $(LDADD) +looping_threads_LDADD = -lpthread $(LDADD) lstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 mmap64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 -mq_LDADD = -lrt $(LDADD) -mq_sendrecv_LDADD = -lrt $(LDADD) -mq_sendrecv_read_LDADD = -lrt $(LDADD) -mq_sendrecv_write_LDADD = -lrt $(LDADD) +mmap64_Xabbrev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mmap64_Xraw_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mmap64_Xverbose_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mq_LDADD = $(mq_LIBS) $(LDADD) newfstatat_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 pc_LDADD = $(dl_LIBS) $(LDADD) pread64_pwrite64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 @@ -463,221 +190,72 @@ preadv_pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 stat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 statfs_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 -threads_execve_LDADD = -lrt -lpthread $(LDADD) -times_LDADD = -lrt $(LDADD) +threads_execve_LDADD = -lpthread $(clock_LIBS) $(LDADD) +times_LDADD = $(clock_LIBS) $(LDADD) truncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 uio_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 stack_fcall_SOURCES = stack-fcall.c \ stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c -if USE_LIBUNWIND -LIBUNWIND_TESTS = strace-k.test +stack_fcall_mangled_SOURCES = stack-fcall-mangled.c \ + stack-fcall-mangled-0.c stack-fcall-mangled-1.c \ + stack-fcall-mangled-2.c stack-fcall-mangled-3.c + +include gen_tests.am + +if ENABLE_STACKTRACE +STACKTRACE_TESTS = strace-k.test +if USE_DEMANGLE +STACKTRACE_TESTS += strace-k-demangle.test +endif else -LIBUNWIND_TESTS = +STACKTRACE_TESTS = endif DECODER_TESTS = \ - _newselect.test \ - accept.test \ - accept4.test \ - access.test \ - acct.test \ - add_key.test \ - adjtimex.test \ - aio.test \ - alarm.test \ - bpf.test \ + bpf-success-v.test \ + bpf-success.test \ brk.test \ + btrfs-X.test \ btrfs-v.test \ + btrfs-vX.test \ btrfs-vw.test \ + btrfs-vwX.test \ btrfs-w.test \ - btrfs.test \ + btrfs-wX.test \ caps-abbrev.test \ caps.test \ - chmod.test \ - chown.test \ - chown32.test \ - chroot.test \ - clock_adjtime.test \ - clock_nanosleep.test \ - clock_xettime.test \ - copy_file_range.test \ - creat.test \ - delete_module.test \ - dup.test \ - dup2.test \ - dup3.test \ - epoll_create.test \ - epoll_create1.test \ - epoll_ctl.test \ - epoll_pwait.test \ - epoll_wait.test \ - erestartsys.test \ eventfd.test \ execve-v.test \ execve.test \ - execveat-v.test \ - execveat.test \ - faccessat.test \ fadvise64.test \ - fadvise64_64.test \ - fallocate.test \ - fanotify_init.test \ - fanotify_mark.test \ - fchdir.test \ - fchmod.test \ - fchmodat.test \ - fchown.test \ - fchown32.test \ - fchownat.test \ - fcntl.test \ - fcntl64.test \ - fdatasync.test \ - file_handle.test \ - file_ioctl.test \ - finit_module.test \ - flock.test \ - fstat.test \ - fstat64.test \ - fstatat64.test \ - fstatfs.test \ - fstatfs64.test \ - fsync.test \ - ftruncate.test \ - ftruncate64.test \ futex.test \ - futimesat.test \ - get_mempolicy.test \ - getcpu.test \ - getcwd.test \ - getdents.test \ - getdents64.test \ - getegid.test \ - getegid32.test \ - geteuid.test \ - geteuid32.test \ - getgid.test \ - getgid32.test \ - getgroups.test \ - getgroups32.test \ - getpeername.test \ - getpgrp.test \ - getrandom.test \ - getresgid.test \ - getresgid32.test \ - getresuid.test \ - getresuid32.test \ - getrlimit.test \ - getrusage.test \ - getsid.test \ - getsockname.test \ getuid.test \ - getuid32.test \ - getxxid.test \ - inet-cmsg.test \ - init_module.test \ - inotify.test \ - inotify_init1.test \ + int_0x80.test \ ioctl.test \ - ioctl_block.test \ - ioctl_dm-v.test \ - ioctl_dm.test \ - ioctl_evdev-v.test \ - ioctl_evdev.test \ - ioctl_loop-nv.test \ - ioctl_loop-v.test \ - ioctl_loop.test \ - ioctl_mtd.test \ - ioctl_rtc-v.test \ - ioctl_rtc.test \ - ioctl_scsi.test \ - ioctl_sg_io_v3.test \ - ioctl_sg_io_v4.test \ - ioctl_sock_gifconf.test \ - ioctl_uffdio.test \ - ioctl_v4l2.test \ - ioperm.test \ - iopl.test \ - ioprio.test \ - ip_mreq.test \ - ipc.test \ - ipc_msg.test \ + ioctl_evdev-success-v.test \ + ioctl_evdev-success.test \ + ioctl_perf-success.test \ ipc_msgbuf.test \ - ipc_sem.test \ - ipc_shm.test \ - kcmp.test \ - kexec_file_load.test \ - kexec_load.test \ - keyctl.test \ - kill.test \ - lchown.test \ - lchown32.test \ - link.test \ - linkat.test \ + kern_features-fault.test \ llseek.test \ - lookup_dcookie.test \ lseek.test \ - lstat.test \ - lstat64.test \ - mbind.test \ - membarrier.test \ - memfd_create.test \ - migrate_pages.test \ - mincore.test \ - mkdir.test \ - mkdirat.test \ - mknod.test \ - mknodat.test \ - mlock.test \ - mlock2.test \ - mlockall.test \ mmap.test \ - mmap64.test \ - mmsg-silent.test \ - mmsg.test \ - mmsg_name-v.test \ - mmsg_name.test \ - mount.test \ - move_pages.test \ - mq.test \ - mq_sendrecv-read.test \ - mq_sendrecv-write.test \ - mq_sendrecv.test \ - msg_control-v.test \ - msg_control.test \ - msg_name.test \ - munlockall.test \ - nanosleep.test \ - net-icmp_filter.test \ - net-sockaddr.test \ + net-tpacket_stats-success.test \ net-y-unix.test \ net-yy-inet.test \ net-yy-netlink.test \ net-yy-unix.test \ net.test \ - netlink_protocol.test \ - newfstatat.test \ + netlink_sock_diag.test \ + nsyscalls-d.test \ + nsyscalls-nd.test \ nsyscalls.test \ - old_mmap.test \ - oldfstat.test \ - oldlstat.test \ - oldselect.test \ - oldstat.test \ - open.test \ - openat.test \ - pause.test \ - perf_event_open.test \ - perf_event_open_nonverbose.test \ - perf_event_open_unabbrev.test \ personality.test \ pipe.test \ - pipe2.test \ - pkey_alloc.test \ - pkey_free.test \ - pkey_mprotect.test \ + poll-P.test \ poll.test \ - ppoll.test \ prctl-arg2-intptr.test \ prctl-dumpable.test \ prctl-name.test \ @@ -686,171 +264,68 @@ DECODER_TESTS = \ prctl-seccomp-filter-v.test \ prctl-seccomp-strict.test \ prctl-securebits.test \ + prctl-spec-inject.test \ prctl-tid_address.test \ prctl-tsc.test \ - pread64-pwrite64.test \ - preadv-pwritev.test \ - preadv.test \ - preadv2-pwritev2.test \ - printstr.test \ - prlimit64.test \ - process_vm_readv.test \ - process_vm_writev.test \ - pselect6.test \ - ptrace.test \ - pwritev.test \ qual_fault-exit_group.test \ - quotactl-v.test \ - quotactl-xfs-v.test \ - quotactl-xfs.test \ - quotactl.test \ - read-write.test \ - readahead.test \ - readdir.test \ - readlink.test \ - readlinkat.test \ + quotactl-success-v.test \ + quotactl-success.test \ + quotactl-xfs-success-v.test \ + quotactl-xfs-success.test \ readv.test \ - reboot.test \ - recvfrom.test \ - recvmmsg-timeout.test \ - recvmsg.test \ - remap_file_pages.test \ - rename.test \ - renameat.test \ - renameat2.test \ - request_key.test \ - rmdir.test \ - rt_sigpending.test \ - rt_sigprocmask.test \ - rt_sigqueueinfo.test \ - rt_sigsuspend.test \ - rt_sigtimedwait.test \ - rt_tgsigqueueinfo.test \ - sched_get_priority_mxx.test \ - sched_rr_get_interval.test \ - sched_xetaffinity.test \ - sched_xetattr.test \ - sched_xetparam.test \ - sched_xetscheduler.test \ - sched_yield.test \ + rt_sigaction.test \ scm_rights-fd.test \ - seccomp-filter-v.test \ - seccomp-filter.test \ seccomp-strict.test \ - select.test \ - semop.test \ - sendfile.test \ - sendfile64.test \ - set_mempolicy.test \ - setdomainname.test \ - setfsgid.test \ - setfsgid32.test \ - setfsuid.test \ - setfsuid32.test \ - setgid.test \ - setgid32.test \ - setgroups.test \ - setgroups32.test \ - sethostname.test \ - setns.test \ - setregid.test \ - setregid32.test \ - setresgid.test \ - setresgid32.test \ - setresuid.test \ - setresuid32.test \ - setreuid.test \ - setreuid32.test \ - setrlimit.test \ - setuid.test \ - setuid32.test \ - shmxt.test \ - shutdown.test \ - sigaction.test \ sigaltstack.test \ - siginfo.test \ - signalfd4.test \ - sigreturn.test \ - socketcall.test \ - splice.test \ - stat.test \ - stat64.test \ - statfs.test \ - statfs64.test \ sun_path.test \ - swap.test \ - symlink.test \ - symlinkat.test \ - sync.test \ - sync_file_range.test \ - sync_file_range2.test \ - sysinfo.test \ - syslog.test \ - tee.test \ - time.test \ - timer_create.test \ - timer_xettime.test \ - timerfd_xettime.test \ - times-fail.test \ - times.test \ - truncate.test \ - truncate64.test \ - ugetrlimit.test \ uio.test \ - umask.test \ umount.test \ umount2.test \ - umoven-illptr.test \ - umovestr-illptr.test \ umovestr.test \ umovestr2.test \ - umovestr3.test \ uname.test \ unix-pair-send-recv.test \ unix-pair-sendto-recvfrom.test \ - unlink.test \ - unlinkat.test \ - unshare.test \ - userfaultfd.test \ - ustat.test \ - utime.test \ - utimensat.test \ - utimes.test \ - vhangup.test \ - vmsplice.test \ - wait4-v.test \ - wait4.test \ - waitid-v.test \ - waitid.test \ - waitpid.test \ - xattr-strings.test \ - xattr.test \ - xet_robust_list.test \ - xetitimer.test \ - xetpgid.test \ - xetpriority.test \ - xettimeofday.test \ + xet_thread_area_x86.test \ # end of DECODER_TESTS MISC_TESTS = \ attach-f-p.test \ attach-p-cmd.test \ bexecve.test \ + clone_parent.test \ + clone_ptrace.test \ count-f.test \ count.test \ + delay.test \ detach-running.test \ detach-sleeping.test \ detach-stopped.test \ + fflush.test \ filter-unavailable.test \ - fork-f.test \ + filtering_fd-syntax.test \ + filtering_syscall-syntax.test \ + first_exec_failure.test \ + get_regs.test \ + inject-nf.test \ + interactive_block.test \ + kill_child.test \ ksysent.test \ + localtime.test \ + looping_threads.test \ opipe.test \ options-syntax.test \ pc.test \ + printpath-umovestr-legacy.test \ + printstrn-umoven-legacy.test \ qual_fault-syntax.test \ + qual_fault-syscall.test \ qual_fault.test \ + qual_inject-error-signal-syscall.test \ qual_inject-error-signal.test \ + qual_inject-retval-syscall.test \ qual_inject-retval.test \ + qual_inject-signal-syscall.test \ qual_inject-signal.test \ qual_inject-syntax.test \ qual_signal.test \ @@ -858,92 +333,135 @@ MISC_TESTS = \ redirect-fds.test \ redirect.test \ restart_syscall.test \ - signal_receive.test \ + sigblock.test \ + sigign.test \ strace-C.test \ strace-E.test \ strace-S.test \ strace-T.test \ strace-V.test \ strace-ff.test \ + strace-log-merge-error.test \ + strace-log-merge-suffix.test \ strace-r.test \ strace-t.test \ strace-tt.test \ strace-ttt.test \ + termsig.test \ threads-execve.test \ - vfork-f.test \ # end of MISC_TESTS -TESTS = $(DECODER_TESTS) $(MISC_TESTS) $(LIBUNWIND_TESTS) +TESTS = $(GEN_TESTS) $(DECODER_TESTS) $(MISC_TESTS) $(STACKTRACE_TESTS) XFAIL_TESTS_ = -XFAIL_TESTS_m32 = $(LIBUNWIND_TESTS) -XFAIL_TESTS_mx32 = $(LIBUNWIND_TESTS) -XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) +XFAIL_TESTS_m32 = $(STACKTRACE_TESTS) +XFAIL_TESTS_mx32 = $(STACKTRACE_TESTS) +XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) $(XFAIL_TESTS_$(ARCH)) TEST_LOG_COMPILER = env -AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) MIPS_ABI=$(MIPS_ABI) $(srcdir)/run.sh +AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) STRACE_NATIVE_ARCH=$(NATIVE_ARCH) \ + SIZEOF_KERNEL_LONG_T=$(SIZEOF_KERNEL_LONG_T) \ + SIZEOF_LONG=$(SIZEOF_LONG) \ + MIPS_ABI=$(MIPS_ABI) $(srcdir)/run.sh @VALGRIND_CHECK_RULES@ VALGRIND_FLAGS = --quiet -VALGRIND_SUPPRESSIONS_FILES = $(srcdir)/strace.supp +VALGRIND_SUPPRESSIONS_FILES = $(abs_srcdir)/strace.supp -EXTRA_DIST = init.sh run.sh match.awk \ - caps-abbrev.awk \ - caps.awk \ - count-f.expected \ - eventfd.expected \ - fadvise.h \ - filter-unavailable.expected \ - fstatat.c \ - fstatx.c \ - getresugid.c \ - init_delete_module.h \ - ipc.sh \ - ipc_msgbuf.expected \ - ksysent.sed \ - lstatx.c \ - net.expected \ - oldselect.expected \ - pipe.expected \ - ppoll-v.expected \ - ppoll.expected \ - process_vm_readv_writev.c \ - qual_fault-exit_group.expected \ - qual_inject-error-signal.expected \ - qual_inject-signal.expected \ - quotactl.h \ - scno_tampering.sh \ - setfsugid.c \ - setresugid.c \ - setreugid.c \ - setugid.c \ - sigaction.awk \ - sigaltstack.expected \ - sockname.c \ - statfs.expected \ - statx.sh \ - strace-C.expected \ - strace-E.expected \ - strace-T.expected \ - strace-ff.expected \ - strace-k.test \ - strace-r.expected \ - strace.supp \ - struct_flock.c \ - sun_path.expected \ - uio.expected \ - umode_t.c \ - umovestr.expected \ - unix-pair-send-recv.expected \ - unix-pair-sendto-recvfrom.expected \ - xchownx.c \ - xgetrlimit.c \ - xselect.c \ - xstatfs.c \ - xstatfs64.c \ - xstatfsx.c \ - xstatx.c \ - $(TESTS) +EXTRA_DIST = \ + COPYING \ + GPL-2.0-or-later \ + PTRACE_SEIZE.sh \ + accept_compat.h \ + attach-p-cmd.h \ + caps-abbrev.awk \ + caps.awk \ + clock.in \ + count-f.expected \ + eventfd.expected \ + fadvise.h \ + fcntl-common.c \ + filter-unavailable.expected \ + fstatat.c \ + fstatx.c \ + gen_pure_executables.sh \ + gen_tests.in \ + gen_tests.sh \ + getresugid.c \ + init.sh \ + init_delete_module.h \ + ioctl_kvm_run_common.c \ + ipc.sh \ + ksysent.sed \ + lstatx.c \ + match.awk \ + net.expected \ + netlink_sock_diag-v.sh \ + nlattr_ifla.h \ + pipe.expected \ + print_user_desc.c \ + printsignal.c \ + process_vm_readv_writev.c \ + pure_executables.list \ + qual_fault-exit_group.expected \ + qual_inject-error-signal.expected \ + qual_inject-signal.expected \ + qualify_personality.sh \ + qualify_personality_empty.in \ + quotactl.h \ + regex.in \ + rt_sigaction.awk \ + run.sh \ + sched.in \ + scno_tampering.sh \ + setfsugid.c \ + setresugid.c \ + setreugid.c \ + setugid.c \ + sigaltstack.expected \ + sockaddr_xlat.c \ + sockname.c \ + stack-fcall.h \ + strace-C.expected \ + strace-E.expected \ + strace-T.expected \ + strace-ff.expected \ + strace-k-demangle.expected \ + strace-k-demangle.test \ + strace-k.expected \ + strace-k.test \ + strace-r.expected \ + strace.supp \ + sun_path.expected \ + syntax.sh \ + trace_fstat.in \ + trace_fstatfs.in \ + trace_lstat.in \ + trace_personality_32.in \ + trace_personality_64.in \ + trace_personality_regex_32.in \ + trace_personality_regex_64.in \ + trace_personality_regex_x32.in \ + trace_personality_x32.in \ + trace_question.in \ + trace_stat.in \ + trace_stat_like.in \ + trace_statfs.in \ + trace_statfs_like.in \ + uio.expected \ + umode_t.c \ + umovestr.expected \ + unix-pair-send-recv.expected \ + unix-pair-sendto-recvfrom.expected \ + xchownx.c \ + xgetrlimit.c \ + xselect.c \ + xstatfs.c \ + xstatfs64.c \ + xstatfsx.c \ + xstatx.c \ + xutimes.c \ + $(TESTS) ksysent.h: $(srcdir)/ksysent.sed echo '#include ' | \ @@ -957,6 +475,15 @@ ksysent.$(OBJEXT): ksysent.h objects = $(filter %.$(OBJEXT),$(SOURCES:.c=.$(OBJEXT))) $(objects): scno.h -CLEANFILES = ksysent.h $(TESTS:=.tmp) +clean-local: clean-local-check +.PHONY: clean-local-check +clean-local-check: + -rm -rf -- $(TESTS:.test=.dir) $(GEN_TESTS:.gen.test=.dir) + +.PHONY: check-valgrind-local +check-valgrind-local: $(check_LIBRARIES) $(check_PROGRAMS) + +BUILT_SOURCES = ksysent.h +CLEANFILES = ksysent.h include ../scno.am diff --git a/tests-mx32/Makefile.in b/tests-mx32/Makefile.in index 47838a3f..c2557caa 100644 --- a/tests-mx32/Makefile.in +++ b/tests-mx32/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -17,58 +17,29 @@ # Automake input for strace tests. # # Copyright (c) 2011-2016 Dmitry V. Levin +# Copyright (c) 2011-2019 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later # scno.h make rules for strace. # -# Copyright (c) 2017 Dmitry V. Levin +# Copyright (c) 2017-2019 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: LGPL-2.1-or-later VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -131,163 +102,288 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -check_PROGRAMS = _newselect$(EXEEXT) accept$(EXEEXT) accept4$(EXEEXT) \ - access$(EXEEXT) acct$(EXEEXT) add_key$(EXEEXT) \ - adjtimex$(EXEEXT) aio$(EXEEXT) alarm$(EXEEXT) answer$(EXEEXT) \ +check_PROGRAMS = $(am__EXEEXT_1) _newselect-P$(EXEEXT) answer$(EXEEXT) \ attach-f-p$(EXEEXT) attach-f-p-cmd$(EXEEXT) \ - attach-p-cmd-cmd$(EXEEXT) attach-p-cmd-p$(EXEEXT) bpf$(EXEEXT) \ - brk$(EXEEXT) btrfs$(EXEEXT) caps$(EXEEXT) caps-abbrev$(EXEEXT) \ - chmod$(EXEEXT) chown$(EXEEXT) chown32$(EXEEXT) chroot$(EXEEXT) \ - clock_adjtime$(EXEEXT) clock_nanosleep$(EXEEXT) \ - clock_xettime$(EXEEXT) copy_file_range$(EXEEXT) \ - count-f$(EXEEXT) creat$(EXEEXT) delete_module$(EXEEXT) \ - dup$(EXEEXT) dup2$(EXEEXT) dup3$(EXEEXT) epoll_create$(EXEEXT) \ - epoll_create1$(EXEEXT) epoll_ctl$(EXEEXT) epoll_pwait$(EXEEXT) \ - epoll_wait$(EXEEXT) erestartsys$(EXEEXT) eventfd$(EXEEXT) \ - execve$(EXEEXT) execve-v$(EXEEXT) execveat$(EXEEXT) \ - execveat-v$(EXEEXT) faccessat$(EXEEXT) fadvise64$(EXEEXT) \ + attach-p-cmd-cmd$(EXEEXT) attach-p-cmd-p$(EXEEXT) \ + block_reset_raise_run$(EXEEXT) bpf-obj_get_info_by_fd$(EXEEXT) \ + bpf-obj_get_info_by_fd-prog$(EXEEXT) \ + bpf-obj_get_info_by_fd-prog-v$(EXEEXT) \ + bpf-obj_get_info_by_fd-v$(EXEEXT) bpf-success$(EXEEXT) \ + bpf-success-v$(EXEEXT) caps-abbrev$(EXEEXT) \ + check_sigblock$(EXEEXT) check_sigign$(EXEEXT) \ + clone_parent$(EXEEXT) clone_ptrace$(EXEEXT) count-f$(EXEEXT) \ + delay$(EXEEXT) execve-v$(EXEEXT) execveat-v$(EXEEXT) \ + filter-unavailable$(EXEEXT) fork-f$(EXEEXT) fsync-y$(EXEEXT) \ + getpid$(EXEEXT) getppid$(EXEEXT) gettid$(EXEEXT) \ + inject-nf$(EXEEXT) int_0x80$(EXEEXT) ioctl_dm-v$(EXEEXT) \ + ioctl_evdev-success$(EXEEXT) ioctl_evdev-success-v$(EXEEXT) \ + ioctl_evdev-v$(EXEEXT) ioctl_loop-nv$(EXEEXT) \ + ioctl_loop-v$(EXEEXT) ioctl_nsfs$(EXEEXT) \ + ioctl_perf-success$(EXEEXT) ioctl_rtc-v$(EXEEXT) \ + is_linux_mips_n64$(EXEEXT) kill_child$(EXEEXT) \ + ksysent$(EXEEXT) list_sigaction_signum$(EXEEXT) \ + localtime$(EXEEXT) looping_threads$(EXEEXT) \ + mmsg-silent$(EXEEXT) mmsg_name-v$(EXEEXT) \ + msg_control-v$(EXEEXT) net-accept-connect$(EXEEXT) \ + net-tpacket_stats-success$(EXEEXT) netlink_inet_diag$(EXEEXT) \ + netlink_netlink_diag$(EXEEXT) netlink_unix_diag$(EXEEXT) \ + nsyscalls$(EXEEXT) nsyscalls-d$(EXEEXT) oldselect-P$(EXEEXT) \ + oldselect-efault-P$(EXEEXT) orphaned_process_group$(EXEEXT) \ + pc$(EXEEXT) perf_event_open_nonverbose$(EXEEXT) \ + perf_event_open_unabbrev$(EXEEXT) ppoll-v$(EXEEXT) \ + prctl-seccomp-filter-v$(EXEEXT) prctl-seccomp-strict$(EXEEXT) \ + prctl-spec-inject$(EXEEXT) print_maxfd$(EXEEXT) \ + qual_fault$(EXEEXT) qual_inject-error-signal$(EXEEXT) \ + qual_inject-retval$(EXEEXT) qual_inject-signal$(EXEEXT) \ + qual_signal$(EXEEXT) quotactl-success$(EXEEXT) \ + quotactl-success-v$(EXEEXT) quotactl-v$(EXEEXT) \ + quotactl-xfs-success$(EXEEXT) quotactl-xfs-success-v$(EXEEXT) \ + quotactl-xfs-v$(EXEEXT) redirect-fds$(EXEEXT) \ + restart_syscall$(EXEEXT) run_expect_termsig$(EXEEXT) \ + scm_rights$(EXEEXT) seccomp-filter-v$(EXEEXT) \ + seccomp-strict$(EXEEXT) select-P$(EXEEXT) \ + set_ptracer_any$(EXEEXT) set_sigblock$(EXEEXT) \ + set_sigign$(EXEEXT) signal_receive$(EXEEXT) sleep$(EXEEXT) \ + stack-fcall$(EXEEXT) stack-fcall-mangled$(EXEEXT) \ + threads-execve$(EXEEXT) unblock_reset_raise$(EXEEXT) \ + unix-pair-send-recv$(EXEEXT) \ + unix-pair-sendto-recvfrom$(EXEEXT) vfork-f$(EXEEXT) \ + wait4-v$(EXEEXT) waitid-v$(EXEEXT) zeroargc$(EXEEXT) +@ENABLE_STACKTRACE_TRUE@@USE_DEMANGLE_TRUE@am__append_1 = strace-k-demangle.test +TESTS = $(GEN_TESTS) $(DECODER_TESTS) $(MISC_TESTS) $(am__EXEEXT_2) +subdir = tests-mx32 +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ + $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ + $(top_srcdir)/m4/ax_valgrind_check.m4 \ + $(top_srcdir)/m4/bpf_attr.m4 $(top_srcdir)/m4/mpers.m4 \ + $(top_srcdir)/m4/st_demangle.m4 $(top_srcdir)/m4/st_libdw.m4 \ + $(top_srcdir)/m4/st_libunwind.m4 \ + $(top_srcdir)/m4/st_save_restore_var.m4 \ + $(top_srcdir)/m4/st_stacktrace.m4 \ + $(top_srcdir)/m4/st_warn_cflags.m4 \ + $(top_srcdir)/m4/warnings.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__EXEEXT_1 = _newselect$(EXEEXT) accept$(EXEEXT) accept4$(EXEEXT) \ + access$(EXEEXT) acct$(EXEEXT) add_key$(EXEEXT) \ + adjtimex$(EXEEXT) aio$(EXEEXT) aio_pgetevents$(EXEEXT) \ + alarm$(EXEEXT) bpf$(EXEEXT) bpf-obj_get_info_by_fd$(EXEEXT) \ + bpf-obj_get_info_by_fd-prog$(EXEEXT) \ + bpf-obj_get_info_by_fd-prog-v$(EXEEXT) \ + bpf-obj_get_info_by_fd-v$(EXEEXT) bpf-v$(EXEEXT) brk$(EXEEXT) \ + btrfs$(EXEEXT) caps$(EXEEXT) chmod$(EXEEXT) chown$(EXEEXT) \ + chown32$(EXEEXT) chroot$(EXEEXT) clock_adjtime$(EXEEXT) \ + clock_nanosleep$(EXEEXT) clock_xettime$(EXEEXT) \ + copy_file_range$(EXEEXT) creat$(EXEEXT) delete_module$(EXEEXT) \ + dev-yy$(EXEEXT) dup$(EXEEXT) dup2$(EXEEXT) dup3$(EXEEXT) \ + epoll_create$(EXEEXT) epoll_create1$(EXEEXT) \ + epoll_ctl$(EXEEXT) epoll_pwait$(EXEEXT) epoll_wait$(EXEEXT) \ + erestartsys$(EXEEXT) eventfd$(EXEEXT) execve$(EXEEXT) \ + execveat$(EXEEXT) faccessat$(EXEEXT) fadvise64$(EXEEXT) \ fadvise64_64$(EXEEXT) fallocate$(EXEEXT) \ - fanotify_init$(EXEEXT) fanotify_mark$(EXEEXT) fchdir$(EXEEXT) \ + fanotify_init$(EXEEXT) fanotify_mark$(EXEEXT) \ + fanotify_mark-Xabbrev$(EXEEXT) fanotify_mark-Xraw$(EXEEXT) \ + fanotify_mark-Xverbose$(EXEEXT) fchdir$(EXEEXT) \ fchmod$(EXEEXT) fchmodat$(EXEEXT) fchown$(EXEEXT) \ fchown32$(EXEEXT) fchownat$(EXEEXT) fcntl$(EXEEXT) \ - fcntl64$(EXEEXT) fdatasync$(EXEEXT) file_handle$(EXEEXT) \ - file_ioctl$(EXEEXT) filter-unavailable$(EXEEXT) \ - finit_module$(EXEEXT) flock$(EXEEXT) fork-f$(EXEEXT) \ - fstat$(EXEEXT) fstat64$(EXEEXT) fstatat64$(EXEEXT) \ - fstatfs$(EXEEXT) fstatfs64$(EXEEXT) fsync$(EXEEXT) \ - ftruncate$(EXEEXT) ftruncate64$(EXEEXT) futex$(EXEEXT) \ - futimesat$(EXEEXT) get_mempolicy$(EXEEXT) getcpu$(EXEEXT) \ - getcwd$(EXEEXT) getdents$(EXEEXT) getdents64$(EXEEXT) \ - getegid$(EXEEXT) getegid32$(EXEEXT) geteuid$(EXEEXT) \ - geteuid32$(EXEEXT) getgid$(EXEEXT) getgid32$(EXEEXT) \ - getgroups$(EXEEXT) getgroups32$(EXEEXT) getpeername$(EXEEXT) \ - getpgrp$(EXEEXT) getrandom$(EXEEXT) getresgid$(EXEEXT) \ - getresgid32$(EXEEXT) getresuid$(EXEEXT) getresuid32$(EXEEXT) \ - getrlimit$(EXEEXT) getrusage$(EXEEXT) getsid$(EXEEXT) \ - getsockname$(EXEEXT) getuid$(EXEEXT) getuid32$(EXEEXT) \ - getxxid$(EXEEXT) inet-cmsg$(EXEEXT) init_module$(EXEEXT) \ - inotify$(EXEEXT) inotify_init1$(EXEEXT) ioctl$(EXEEXT) \ - ioctl_block$(EXEEXT) ioctl_dm$(EXEEXT) ioctl_dm-v$(EXEEXT) \ - ioctl_evdev$(EXEEXT) ioctl_evdev-v$(EXEEXT) \ - ioctl_loop$(EXEEXT) ioctl_loop-nv$(EXEEXT) \ - ioctl_loop-v$(EXEEXT) ioctl_mtd$(EXEEXT) ioctl_rtc$(EXEEXT) \ - ioctl_rtc-v$(EXEEXT) ioctl_scsi$(EXEEXT) \ - ioctl_sg_io_v3$(EXEEXT) ioctl_sg_io_v4$(EXEEXT) \ - ioctl_sock_gifconf$(EXEEXT) ioctl_uffdio$(EXEEXT) \ - ioctl_v4l2$(EXEEXT) ioperm$(EXEEXT) iopl$(EXEEXT) \ - ioprio$(EXEEXT) ip_mreq$(EXEEXT) ipc$(EXEEXT) ipc_msg$(EXEEXT) \ - ipc_msgbuf$(EXEEXT) ipc_sem$(EXEEXT) ipc_shm$(EXEEXT) \ - kcmp$(EXEEXT) kexec_file_load$(EXEEXT) kexec_load$(EXEEXT) \ - keyctl$(EXEEXT) kill$(EXEEXT) ksysent$(EXEEXT) lchown$(EXEEXT) \ - lchown32$(EXEEXT) link$(EXEEXT) linkat$(EXEEXT) \ - llseek$(EXEEXT) lookup_dcookie$(EXEEXT) lseek$(EXEEXT) \ - lstat$(EXEEXT) lstat64$(EXEEXT) mbind$(EXEEXT) \ - membarrier$(EXEEXT) memfd_create$(EXEEXT) \ + fcntl64$(EXEEXT) fdatasync$(EXEEXT) fflush$(EXEEXT) \ + file_handle$(EXEEXT) file_ioctl$(EXEEXT) finit_module$(EXEEXT) \ + flock$(EXEEXT) fstat$(EXEEXT) fstat-Xabbrev$(EXEEXT) \ + fstat-Xraw$(EXEEXT) fstat-Xverbose$(EXEEXT) fstat64$(EXEEXT) \ + fstat64-Xabbrev$(EXEEXT) fstat64-Xraw$(EXEEXT) \ + fstat64-Xverbose$(EXEEXT) fstatat64$(EXEEXT) fstatfs$(EXEEXT) \ + fstatfs64$(EXEEXT) fsync$(EXEEXT) ftruncate$(EXEEXT) \ + ftruncate64$(EXEEXT) futex$(EXEEXT) futimesat$(EXEEXT) \ + get_mempolicy$(EXEEXT) getcpu$(EXEEXT) getcwd$(EXEEXT) \ + getdents$(EXEEXT) getdents64$(EXEEXT) getegid$(EXEEXT) \ + getegid32$(EXEEXT) geteuid$(EXEEXT) geteuid32$(EXEEXT) \ + getgid$(EXEEXT) getgid32$(EXEEXT) getgroups$(EXEEXT) \ + getgroups32$(EXEEXT) getpeername$(EXEEXT) getpgrp$(EXEEXT) \ + getpid$(EXEEXT) getppid$(EXEEXT) getrandom$(EXEEXT) \ + getresgid$(EXEEXT) getresgid32$(EXEEXT) getresuid$(EXEEXT) \ + getresuid32$(EXEEXT) getrlimit$(EXEEXT) getrusage$(EXEEXT) \ + getsid$(EXEEXT) getsockname$(EXEEXT) getuid$(EXEEXT) \ + getuid32$(EXEEXT) getxxid$(EXEEXT) group_req$(EXEEXT) \ + inet-cmsg$(EXEEXT) init_module$(EXEEXT) inotify$(EXEEXT) \ + inotify_init1$(EXEEXT) io_uring_enter$(EXEEXT) \ + io_uring_register$(EXEEXT) io_uring_setup$(EXEEXT) \ + ioctl$(EXEEXT) ioctl_block$(EXEEXT) ioctl_dm$(EXEEXT) \ + ioctl_evdev$(EXEEXT) ioctl_inotify$(EXEEXT) \ + ioctl_kvm_run$(EXEEXT) ioctl_kvm_run-v$(EXEEXT) \ + ioctl_kvm_run_auxstr_vcpu$(EXEEXT) ioctl_loop$(EXEEXT) \ + ioctl_mtd$(EXEEXT) ioctl_nbd$(EXEEXT) ioctl_perf$(EXEEXT) \ + ioctl_ptp$(EXEEXT) ioctl_random$(EXEEXT) ioctl_rtc$(EXEEXT) \ + ioctl_scsi$(EXEEXT) ioctl_sg_io_v3$(EXEEXT) \ + ioctl_sg_io_v4$(EXEEXT) ioctl_sock_gifconf$(EXEEXT) \ + ioctl_uffdio$(EXEEXT) ioctl_v4l2$(EXEEXT) ioperm$(EXEEXT) \ + iopl$(EXEEXT) ioprio$(EXEEXT) ioprio-Xabbrev$(EXEEXT) \ + ioprio-Xraw$(EXEEXT) ioprio-Xverbose$(EXEEXT) ip_mreq$(EXEEXT) \ + ipc$(EXEEXT) ipc_msg$(EXEEXT) ipc_msg-Xabbrev$(EXEEXT) \ + ipc_msg-Xraw$(EXEEXT) ipc_msg-Xverbose$(EXEEXT) \ + ipc_msgbuf$(EXEEXT) ipc_msgbuf-Xabbrev$(EXEEXT) \ + ipc_msgbuf-Xraw$(EXEEXT) ipc_msgbuf-Xverbose$(EXEEXT) \ + ipc_sem$(EXEEXT) ipc_sem-Xabbrev$(EXEEXT) \ + ipc_sem-Xraw$(EXEEXT) ipc_sem-Xverbose$(EXEEXT) \ + ipc_shm$(EXEEXT) ipc_shm-Xabbrev$(EXEEXT) \ + ipc_shm-Xraw$(EXEEXT) ipc_shm-Xverbose$(EXEEXT) kcmp$(EXEEXT) \ + kcmp-y$(EXEEXT) kern_features$(EXEEXT) kernel_version$(EXEEXT) \ + kernel_version-Xabbrev$(EXEEXT) kernel_version-Xraw$(EXEEXT) \ + kernel_version-Xverbose$(EXEEXT) kexec_file_load$(EXEEXT) \ + kexec_load$(EXEEXT) keyctl$(EXEEXT) keyctl-Xabbrev$(EXEEXT) \ + keyctl-Xraw$(EXEEXT) keyctl-Xverbose$(EXEEXT) kill$(EXEEXT) \ + lchown$(EXEEXT) lchown32$(EXEEXT) link$(EXEEXT) \ + linkat$(EXEEXT) llseek$(EXEEXT) lookup_dcookie$(EXEEXT) \ + lseek$(EXEEXT) lstat$(EXEEXT) lstat64$(EXEEXT) \ + madvise$(EXEEXT) mbind$(EXEEXT) membarrier$(EXEEXT) \ + memfd_create$(EXEEXT) memfd_create-Xabbrev$(EXEEXT) \ + memfd_create-Xraw$(EXEEXT) memfd_create-Xverbose$(EXEEXT) \ migrate_pages$(EXEEXT) mincore$(EXEEXT) mkdir$(EXEEXT) \ mkdirat$(EXEEXT) mknod$(EXEEXT) mknodat$(EXEEXT) \ mlock$(EXEEXT) mlock2$(EXEEXT) mlockall$(EXEEXT) mmap$(EXEEXT) \ - mmap64$(EXEEXT) mmsg$(EXEEXT) mmsg-silent$(EXEEXT) \ - mmsg_name$(EXEEXT) mmsg_name-v$(EXEEXT) mount$(EXEEXT) \ - move_pages$(EXEEXT) mq$(EXEEXT) mq_sendrecv$(EXEEXT) \ + mmap-Xabbrev$(EXEEXT) mmap-Xraw$(EXEEXT) \ + mmap-Xverbose$(EXEEXT) mmap64$(EXEEXT) mmap64-Xabbrev$(EXEEXT) \ + mmap64-Xraw$(EXEEXT) mmap64-Xverbose$(EXEEXT) mmsg$(EXEEXT) \ + mmsg_name$(EXEEXT) modify_ldt$(EXEEXT) mount$(EXEEXT) \ + mount-Xabbrev$(EXEEXT) mount-Xraw$(EXEEXT) \ + mount-Xverbose$(EXEEXT) move_pages$(EXEEXT) \ + move_pages-Xabbrev$(EXEEXT) move_pages-Xraw$(EXEEXT) \ + move_pages-Xverbose$(EXEEXT) mq$(EXEEXT) mq_sendrecv$(EXEEXT) \ mq_sendrecv-read$(EXEEXT) mq_sendrecv-write$(EXEEXT) \ - msg_control$(EXEEXT) msg_control-v$(EXEEXT) msg_name$(EXEEXT) \ - munlockall$(EXEEXT) nanosleep$(EXEEXT) \ - net-accept-connect$(EXEEXT) net-icmp_filter$(EXEEXT) \ - net-sockaddr$(EXEEXT) net-y-unix$(EXEEXT) net-yy-inet$(EXEEXT) \ + msg_control$(EXEEXT) msg_name$(EXEEXT) munlockall$(EXEEXT) \ + nanosleep$(EXEEXT) net-icmp_filter$(EXEEXT) \ + net-packet_mreq$(EXEEXT) net-packet_mreq-Xabbrev$(EXEEXT) \ + net-packet_mreq-Xraw$(EXEEXT) \ + net-packet_mreq-Xverbose$(EXEEXT) net-sockaddr$(EXEEXT) \ + net-tpacket_req$(EXEEXT) net-tpacket_stats$(EXEEXT) \ + net-y-unix$(EXEEXT) net-yy-inet$(EXEEXT) net-yy-inet6$(EXEEXT) \ net-yy-netlink$(EXEEXT) net-yy-unix$(EXEEXT) \ - netlink_inet_diag$(EXEEXT) netlink_netlink_diag$(EXEEXT) \ - netlink_protocol$(EXEEXT) netlink_unix_diag$(EXEEXT) \ - newfstatat$(EXEEXT) nsyscalls$(EXEEXT) old_mmap$(EXEEXT) \ - oldfstat$(EXEEXT) oldlstat$(EXEEXT) oldselect$(EXEEXT) \ - oldstat$(EXEEXT) open$(EXEEXT) openat$(EXEEXT) pause$(EXEEXT) \ - pc$(EXEEXT) perf_event_open$(EXEEXT) \ - perf_event_open_nonverbose$(EXEEXT) \ - perf_event_open_unabbrev$(EXEEXT) personality$(EXEEXT) \ + netlink_audit$(EXEEXT) netlink_crypto$(EXEEXT) \ + netlink_generic$(EXEEXT) netlink_kobject_uevent$(EXEEXT) \ + netlink_netfilter$(EXEEXT) netlink_protocol$(EXEEXT) \ + netlink_route$(EXEEXT) netlink_selinux$(EXEEXT) \ + netlink_sock_diag$(EXEEXT) netlink_xfrm$(EXEEXT) \ + newfstatat$(EXEEXT) nfnetlink_acct$(EXEEXT) \ + nfnetlink_cthelper$(EXEEXT) nfnetlink_ctnetlink$(EXEEXT) \ + nfnetlink_ctnetlink_exp$(EXEEXT) nfnetlink_cttimeout$(EXEEXT) \ + nfnetlink_ipset$(EXEEXT) nfnetlink_nft_compat$(EXEEXT) \ + nfnetlink_nftables$(EXEEXT) nfnetlink_osf$(EXEEXT) \ + nfnetlink_queue$(EXEEXT) nfnetlink_ulog$(EXEEXT) \ + nlattr$(EXEEXT) nlattr_br_port_msg$(EXEEXT) \ + nlattr_crypto_user_alg$(EXEEXT) nlattr_dcbmsg$(EXEEXT) \ + nlattr_fib_rule_hdr$(EXEEXT) nlattr_ifaddrlblmsg$(EXEEXT) \ + nlattr_ifaddrmsg$(EXEEXT) nlattr_ifinfomsg$(EXEEXT) \ + nlattr_ifla_af_spec$(EXEEXT) nlattr_ifla_brport$(EXEEXT) \ + nlattr_ifla_linkinfo$(EXEEXT) nlattr_ifla_port$(EXEEXT) \ + nlattr_ifla_xdp$(EXEEXT) nlattr_inet_diag_msg$(EXEEXT) \ + nlattr_inet_diag_req_compat$(EXEEXT) \ + nlattr_inet_diag_req_v2$(EXEEXT) \ + nlattr_mdba_mdb_entry$(EXEEXT) \ + nlattr_mdba_router_port$(EXEEXT) nlattr_ndmsg$(EXEEXT) \ + nlattr_ndtmsg$(EXEEXT) nlattr_netconfmsg$(EXEEXT) \ + nlattr_netlink_diag_msg$(EXEEXT) nlattr_nlmsgerr$(EXEEXT) \ + nlattr_packet_diag_msg$(EXEEXT) nlattr_rtgenmsg$(EXEEXT) \ + nlattr_rtmsg$(EXEEXT) nlattr_smc_diag_msg$(EXEEXT) \ + nlattr_tc_stats$(EXEEXT) nlattr_tca_stab$(EXEEXT) \ + nlattr_tcamsg$(EXEEXT) nlattr_tcmsg$(EXEEXT) \ + nlattr_unix_diag_msg$(EXEEXT) old_mmap$(EXEEXT) \ + old_mmap-P$(EXEEXT) old_mmap-Xabbrev$(EXEEXT) \ + old_mmap-Xraw$(EXEEXT) old_mmap-Xverbose$(EXEEXT) \ + old_mmap-v-none$(EXEEXT) oldfstat$(EXEEXT) oldlstat$(EXEEXT) \ + oldselect$(EXEEXT) oldselect-efault$(EXEEXT) oldstat$(EXEEXT) \ + open$(EXEEXT) openat$(EXEEXT) osf_utimes$(EXEEXT) \ + pause$(EXEEXT) perf_event_open$(EXEEXT) personality$(EXEEXT) \ + personality-Xabbrev$(EXEEXT) personality-Xraw$(EXEEXT) \ + personality-Xverbose$(EXEEXT) pidfd_send_signal$(EXEEXT) \ pipe$(EXEEXT) pipe2$(EXEEXT) pkey_alloc$(EXEEXT) \ pkey_free$(EXEEXT) pkey_mprotect$(EXEEXT) poll$(EXEEXT) \ - ppoll$(EXEEXT) prctl-arg2-intptr$(EXEEXT) \ - prctl-dumpable$(EXEEXT) prctl-name$(EXEEXT) \ - prctl-no-args$(EXEEXT) prctl-pdeathsig$(EXEEXT) \ - prctl-seccomp-filter-v$(EXEEXT) prctl-seccomp-strict$(EXEEXT) \ - prctl-securebits$(EXEEXT) prctl-tid_address$(EXEEXT) \ - prctl-tsc$(EXEEXT) pread64-pwrite64$(EXEEXT) preadv$(EXEEXT) \ + poll-P$(EXEEXT) ppoll$(EXEEXT) ppoll-P$(EXEEXT) \ + prctl-arg2-intptr$(EXEEXT) prctl-dumpable$(EXEEXT) \ + prctl-name$(EXEEXT) prctl-no-args$(EXEEXT) \ + prctl-pdeathsig$(EXEEXT) prctl-securebits$(EXEEXT) \ + prctl-tid_address$(EXEEXT) prctl-tsc$(EXEEXT) \ + pread64-pwrite64$(EXEEXT) preadv$(EXEEXT) \ preadv-pwritev$(EXEEXT) preadv2-pwritev2$(EXEEXT) \ - print_maxfd$(EXEEXT) printstr$(EXEEXT) prlimit64$(EXEEXT) \ + printpath-umovestr$(EXEEXT) \ + printpath-umovestr-peekdata$(EXEEXT) \ + printpath-umovestr-undumpable$(EXEEXT) \ + printsignal-Xabbrev$(EXEEXT) printsignal-Xraw$(EXEEXT) \ + printsignal-Xverbose$(EXEEXT) printstr$(EXEEXT) \ + printstrn-umoven$(EXEEXT) printstrn-umoven-peekdata$(EXEEXT) \ + printstrn-umoven-undumpable$(EXEEXT) prlimit64$(EXEEXT) \ process_vm_readv$(EXEEXT) process_vm_writev$(EXEEXT) \ - pselect6$(EXEEXT) ptrace$(EXEEXT) pwritev$(EXEEXT) \ - qual_fault$(EXEEXT) qual_inject-error-signal$(EXEEXT) \ - qual_inject-retval$(EXEEXT) qual_inject-signal$(EXEEXT) \ - qual_signal$(EXEEXT) quotactl$(EXEEXT) quotactl-v$(EXEEXT) \ - quotactl-xfs$(EXEEXT) quotactl-xfs-v$(EXEEXT) \ - read-write$(EXEEXT) readahead$(EXEEXT) readdir$(EXEEXT) \ - readlink$(EXEEXT) readlinkat$(EXEEXT) readv$(EXEEXT) \ - reboot$(EXEEXT) recvfrom$(EXEEXT) recvmmsg-timeout$(EXEEXT) \ - recvmsg$(EXEEXT) redirect-fds$(EXEEXT) \ - remap_file_pages$(EXEEXT) rename$(EXEEXT) renameat$(EXEEXT) \ - renameat2$(EXEEXT) request_key$(EXEEXT) \ - restart_syscall$(EXEEXT) rmdir$(EXEEXT) rt_sigpending$(EXEEXT) \ + pselect6$(EXEEXT) ptrace$(EXEEXT) ptrace_syscall_info$(EXEEXT) \ + pwritev$(EXEEXT) quotactl$(EXEEXT) quotactl-Xabbrev$(EXEEXT) \ + quotactl-Xraw$(EXEEXT) quotactl-Xverbose$(EXEEXT) \ + quotactl-xfs$(EXEEXT) read-write$(EXEEXT) readahead$(EXEEXT) \ + readdir$(EXEEXT) readlink$(EXEEXT) readlinkat$(EXEEXT) \ + readv$(EXEEXT) reboot$(EXEEXT) recvfrom$(EXEEXT) \ + recvmmsg-timeout$(EXEEXT) recvmsg$(EXEEXT) \ + remap_file_pages$(EXEEXT) remap_file_pages-Xabbrev$(EXEEXT) \ + remap_file_pages-Xraw$(EXEEXT) \ + remap_file_pages-Xverbose$(EXEEXT) rename$(EXEEXT) \ + renameat$(EXEEXT) renameat2$(EXEEXT) request_key$(EXEEXT) \ + riscv_flush_icache$(EXEEXT) rmdir$(EXEEXT) \ + rt_sigaction$(EXEEXT) rt_sigpending$(EXEEXT) \ rt_sigprocmask$(EXEEXT) rt_sigqueueinfo$(EXEEXT) \ - rt_sigsuspend$(EXEEXT) rt_sigtimedwait$(EXEEXT) \ - rt_tgsigqueueinfo$(EXEEXT) sched_get_priority_mxx$(EXEEXT) \ - sched_rr_get_interval$(EXEEXT) sched_xetaffinity$(EXEEXT) \ - sched_xetattr$(EXEEXT) sched_xetparam$(EXEEXT) \ - sched_xetscheduler$(EXEEXT) sched_yield$(EXEEXT) \ - scm_rights$(EXEEXT) seccomp-filter$(EXEEXT) \ - seccomp-filter-v$(EXEEXT) seccomp-strict$(EXEEXT) \ - select$(EXEEXT) semop$(EXEEXT) sendfile$(EXEEXT) \ - sendfile64$(EXEEXT) set_mempolicy$(EXEEXT) \ - set_ptracer_any$(EXEEXT) setdomainname$(EXEEXT) \ + rt_sigreturn$(EXEEXT) rt_sigsuspend$(EXEEXT) \ + rt_sigtimedwait$(EXEEXT) rt_tgsigqueueinfo$(EXEEXT) \ + s390_guarded_storage$(EXEEXT) s390_guarded_storage-v$(EXEEXT) \ + s390_pci_mmio_read_write$(EXEEXT) s390_runtime_instr$(EXEEXT) \ + s390_sthyi$(EXEEXT) s390_sthyi-v$(EXEEXT) \ + sched_get_priority_mxx$(EXEEXT) sched_rr_get_interval$(EXEEXT) \ + sched_xetaffinity$(EXEEXT) sched_xetattr$(EXEEXT) \ + sched_xetparam$(EXEEXT) sched_xetscheduler$(EXEEXT) \ + sched_yield$(EXEEXT) seccomp-filter$(EXEEXT) \ + seccomp_get_action_avail$(EXEEXT) select$(EXEEXT) \ + semop$(EXEEXT) sendfile$(EXEEXT) sendfile64$(EXEEXT) \ + set_mempolicy$(EXEEXT) setdomainname$(EXEEXT) \ setfsgid$(EXEEXT) setfsgid32$(EXEEXT) setfsuid$(EXEEXT) \ setfsuid32$(EXEEXT) setgid$(EXEEXT) setgid32$(EXEEXT) \ setgroups$(EXEEXT) setgroups32$(EXEEXT) sethostname$(EXEEXT) \ setns$(EXEEXT) setregid$(EXEEXT) setregid32$(EXEEXT) \ setresgid$(EXEEXT) setresgid32$(EXEEXT) setresuid$(EXEEXT) \ setresuid32$(EXEEXT) setreuid$(EXEEXT) setreuid32$(EXEEXT) \ - setrlimit$(EXEEXT) setuid$(EXEEXT) setuid32$(EXEEXT) \ - shmxt$(EXEEXT) shutdown$(EXEEXT) sigaction$(EXEEXT) \ - sigaltstack$(EXEEXT) siginfo$(EXEEXT) signal_receive$(EXEEXT) \ - signalfd4$(EXEEXT) sigreturn$(EXEEXT) sleep$(EXEEXT) \ - socketcall$(EXEEXT) splice$(EXEEXT) stack-fcall$(EXEEXT) \ - stat$(EXEEXT) stat64$(EXEEXT) statfs$(EXEEXT) \ - statfs64$(EXEEXT) swap$(EXEEXT) symlink$(EXEEXT) \ - symlinkat$(EXEEXT) sync$(EXEEXT) sync_file_range$(EXEEXT) \ + setrlimit$(EXEEXT) setrlimit-Xabbrev$(EXEEXT) \ + setrlimit-Xraw$(EXEEXT) setrlimit-Xverbose$(EXEEXT) \ + setuid$(EXEEXT) setuid32$(EXEEXT) shmxt$(EXEEXT) \ + shutdown$(EXEEXT) sigaction$(EXEEXT) sigaltstack$(EXEEXT) \ + siginfo$(EXEEXT) signal$(EXEEXT) signalfd4$(EXEEXT) \ + sigpending$(EXEEXT) sigprocmask$(EXEEXT) sigreturn$(EXEEXT) \ + sigsuspend$(EXEEXT) so_error$(EXEEXT) so_linger$(EXEEXT) \ + so_peercred$(EXEEXT) so_peercred-Xabbrev$(EXEEXT) \ + so_peercred-Xraw$(EXEEXT) so_peercred-Xverbose$(EXEEXT) \ + sock_filter-v$(EXEEXT) sock_filter-v-Xabbrev$(EXEEXT) \ + sock_filter-v-Xraw$(EXEEXT) sock_filter-v-Xverbose$(EXEEXT) \ + sockaddr_xlat-Xabbrev$(EXEEXT) sockaddr_xlat-Xraw$(EXEEXT) \ + sockaddr_xlat-Xverbose$(EXEEXT) socketcall$(EXEEXT) \ + sockopt-sol_netlink$(EXEEXT) sockopt-timestamp$(EXEEXT) \ + splice$(EXEEXT) stat$(EXEEXT) stat64$(EXEEXT) statfs$(EXEEXT) \ + statfs64$(EXEEXT) statx$(EXEEXT) swap$(EXEEXT) \ + sxetmask$(EXEEXT) symlink$(EXEEXT) symlinkat$(EXEEXT) \ + sync$(EXEEXT) sync_file_range$(EXEEXT) \ sync_file_range2$(EXEEXT) sysinfo$(EXEEXT) syslog$(EXEEXT) \ - tee$(EXEEXT) threads-execve$(EXEEXT) time$(EXEEXT) \ - timer_create$(EXEEXT) timer_xettime$(EXEEXT) \ - timerfd_xettime$(EXEEXT) times$(EXEEXT) times-fail$(EXEEXT) \ - truncate$(EXEEXT) truncate64$(EXEEXT) ugetrlimit$(EXEEXT) \ - uio$(EXEEXT) umask$(EXEEXT) umount$(EXEEXT) umount2$(EXEEXT) \ - umoven-illptr$(EXEEXT) umovestr$(EXEEXT) \ - umovestr-illptr$(EXEEXT) umovestr2$(EXEEXT) umovestr3$(EXEEXT) \ - uname$(EXEEXT) unix-pair-send-recv$(EXEEXT) \ - unix-pair-sendto-recvfrom$(EXEEXT) unlink$(EXEEXT) \ + tee$(EXEEXT) time$(EXEEXT) timer_create$(EXEEXT) \ + timer_xettime$(EXEEXT) timerfd_xettime$(EXEEXT) times$(EXEEXT) \ + times-fail$(EXEEXT) truncate$(EXEEXT) truncate64$(EXEEXT) \ + ugetrlimit$(EXEEXT) uio$(EXEEXT) umask$(EXEEXT) \ + umount$(EXEEXT) umount2$(EXEEXT) umoven-illptr$(EXEEXT) \ + umovestr$(EXEEXT) umovestr-illptr$(EXEEXT) umovestr2$(EXEEXT) \ + umovestr3$(EXEEXT) uname$(EXEEXT) unlink$(EXEEXT) \ unlinkat$(EXEEXT) unshare$(EXEEXT) userfaultfd$(EXEEXT) \ ustat$(EXEEXT) utime$(EXEEXT) utimensat$(EXEEXT) \ - utimes$(EXEEXT) vfork-f$(EXEEXT) vhangup$(EXEEXT) \ - vmsplice$(EXEEXT) wait4$(EXEEXT) wait4-v$(EXEEXT) \ - waitid$(EXEEXT) waitid-v$(EXEEXT) waitpid$(EXEEXT) \ - xattr$(EXEEXT) xattr-strings$(EXEEXT) xet_robust_list$(EXEEXT) \ + utimensat-Xabbrev$(EXEEXT) utimensat-Xraw$(EXEEXT) \ + utimensat-Xverbose$(EXEEXT) utimes$(EXEEXT) vhangup$(EXEEXT) \ + vmsplice$(EXEEXT) wait4$(EXEEXT) waitid$(EXEEXT) \ + waitpid$(EXEEXT) xattr$(EXEEXT) xattr-strings$(EXEEXT) \ + xet_robust_list$(EXEEXT) xet_thread_area_x86$(EXEEXT) \ xetitimer$(EXEEXT) xetpgid$(EXEEXT) xetpriority$(EXEEXT) \ xettimeofday$(EXEEXT) -TESTS = $(DECODER_TESTS) $(MISC_TESTS) $(am__EXEEXT_1) -DIST_COMMON = $(srcdir)/../scno.am $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am $(top_srcdir)/depcomp \ - $(top_srcdir)/test-driver -subdir = tests-mx32 -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ - $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ - $(top_srcdir)/m4/ax_valgrind_check.m4 \ - $(top_srcdir)/m4/mpers.m4 \ - $(top_srcdir)/m4/st_save_restore_var.m4 \ - $(top_srcdir)/m4/st_warn_cflags.m4 \ - $(top_srcdir)/m4/warnings.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = AR = ar ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) @@ -296,26 +392,37 @@ am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libtests_a_AR = $(AR) $(ARFLAGS) libtests_a_LIBADD = -am_libtests_a_OBJECTS = libtests_a-errno2name.$(OBJEXT) \ - libtests_a-error_msg.$(OBJEXT) \ +am_libtests_a_OBJECTS = libtests_a-create_nl_socket.$(OBJEXT) \ + libtests_a-errno2name.$(OBJEXT) libtests_a-error_msg.$(OBJEXT) \ libtests_a-fill_memory.$(OBJEXT) \ libtests_a-get_page_size.$(OBJEXT) \ + libtests_a-get_sigset_size.$(OBJEXT) \ libtests_a-hexdump_strdup.$(OBJEXT) \ libtests_a-hexquote_strndup.$(OBJEXT) \ + libtests_a-ifindex.$(OBJEXT) \ libtests_a-inode_of_sockfd.$(OBJEXT) \ libtests_a-libmmsg.$(OBJEXT) \ libtests_a-libsocketcall.$(OBJEXT) \ libtests_a-overflowuid.$(OBJEXT) \ libtests_a-pipe_maxfd.$(OBJEXT) \ libtests_a-print_quoted_string.$(OBJEXT) \ + libtests_a-print_time.$(OBJEXT) \ libtests_a-printflags.$(OBJEXT) libtests_a-printxval.$(OBJEXT) \ - libtests_a-signal2name.$(OBJEXT) libtests_a-sprintrc.$(OBJEXT) \ - libtests_a-tail_alloc.$(OBJEXT) libtests_a-tprintf.$(OBJEXT) + libtests_a-signal2name.$(OBJEXT) \ + libtests_a-skip_unavailable.$(OBJEXT) \ + libtests_a-sprintrc.$(OBJEXT) libtests_a-tail_alloc.$(OBJEXT) \ + libtests_a-test_printpath.$(OBJEXT) \ + libtests_a-test_printstrn.$(OBJEXT) \ + libtests_a-test_ucopy.$(OBJEXT) libtests_a-tprintf.$(OBJEXT) libtests_a_OBJECTS = $(am_libtests_a_OBJECTS) _newselect_SOURCES = _newselect.c _newselect_OBJECTS = _newselect.$(OBJEXT) _newselect_LDADD = $(LDADD) _newselect_DEPENDENCIES = libtests.a +_newselect_P_SOURCES = _newselect-P.c +_newselect_P_OBJECTS = _newselect-P.$(OBJEXT) +_newselect_P_LDADD = $(LDADD) +_newselect_P_DEPENDENCIES = libtests.a accept_SOURCES = accept.c accept_OBJECTS = accept.$(OBJEXT) accept_LDADD = $(LDADD) @@ -344,6 +451,10 @@ aio_SOURCES = aio.c aio_OBJECTS = aio.$(OBJEXT) aio_LDADD = $(LDADD) aio_DEPENDENCIES = libtests.a +aio_pgetevents_SOURCES = aio_pgetevents.c +aio_pgetevents_OBJECTS = aio_pgetevents.$(OBJEXT) +aio_pgetevents_LDADD = $(LDADD) +aio_pgetevents_DEPENDENCIES = libtests.a alarm_SOURCES = alarm.c alarm_OBJECTS = alarm.$(OBJEXT) alarm_LDADD = $(LDADD) @@ -367,10 +478,45 @@ attach_p_cmd_p_SOURCES = attach-p-cmd-p.c attach_p_cmd_p_OBJECTS = attach-p-cmd-p.$(OBJEXT) attach_p_cmd_p_LDADD = $(LDADD) attach_p_cmd_p_DEPENDENCIES = libtests.a +block_reset_raise_run_SOURCES = block_reset_raise_run.c +block_reset_raise_run_OBJECTS = block_reset_raise_run.$(OBJEXT) +block_reset_raise_run_LDADD = $(LDADD) +block_reset_raise_run_DEPENDENCIES = libtests.a bpf_SOURCES = bpf.c bpf_OBJECTS = bpf.$(OBJEXT) bpf_LDADD = $(LDADD) bpf_DEPENDENCIES = libtests.a +bpf_obj_get_info_by_fd_SOURCES = bpf-obj_get_info_by_fd.c +bpf_obj_get_info_by_fd_OBJECTS = bpf-obj_get_info_by_fd.$(OBJEXT) +bpf_obj_get_info_by_fd_LDADD = $(LDADD) +bpf_obj_get_info_by_fd_DEPENDENCIES = libtests.a +bpf_obj_get_info_by_fd_prog_SOURCES = bpf-obj_get_info_by_fd-prog.c +bpf_obj_get_info_by_fd_prog_OBJECTS = \ + bpf-obj_get_info_by_fd-prog.$(OBJEXT) +bpf_obj_get_info_by_fd_prog_LDADD = $(LDADD) +bpf_obj_get_info_by_fd_prog_DEPENDENCIES = libtests.a +bpf_obj_get_info_by_fd_prog_v_SOURCES = \ + bpf-obj_get_info_by_fd-prog-v.c +bpf_obj_get_info_by_fd_prog_v_OBJECTS = \ + bpf-obj_get_info_by_fd-prog-v.$(OBJEXT) +bpf_obj_get_info_by_fd_prog_v_LDADD = $(LDADD) +bpf_obj_get_info_by_fd_prog_v_DEPENDENCIES = libtests.a +bpf_obj_get_info_by_fd_v_SOURCES = bpf-obj_get_info_by_fd-v.c +bpf_obj_get_info_by_fd_v_OBJECTS = bpf-obj_get_info_by_fd-v.$(OBJEXT) +bpf_obj_get_info_by_fd_v_LDADD = $(LDADD) +bpf_obj_get_info_by_fd_v_DEPENDENCIES = libtests.a +bpf_success_SOURCES = bpf-success.c +bpf_success_OBJECTS = bpf-success.$(OBJEXT) +bpf_success_LDADD = $(LDADD) +bpf_success_DEPENDENCIES = libtests.a +bpf_success_v_SOURCES = bpf-success-v.c +bpf_success_v_OBJECTS = bpf-success-v.$(OBJEXT) +bpf_success_v_LDADD = $(LDADD) +bpf_success_v_DEPENDENCIES = libtests.a +bpf_v_SOURCES = bpf-v.c +bpf_v_OBJECTS = bpf-v.$(OBJEXT) +bpf_v_LDADD = $(LDADD) +bpf_v_DEPENDENCIES = libtests.a brk_SOURCES = brk.c brk_OBJECTS = brk.$(OBJEXT) brk_LDADD = $(LDADD) @@ -387,6 +533,14 @@ caps_abbrev_SOURCES = caps-abbrev.c caps_abbrev_OBJECTS = caps-abbrev.$(OBJEXT) caps_abbrev_LDADD = $(LDADD) caps_abbrev_DEPENDENCIES = libtests.a +check_sigblock_SOURCES = check_sigblock.c +check_sigblock_OBJECTS = check_sigblock.$(OBJEXT) +check_sigblock_LDADD = $(LDADD) +check_sigblock_DEPENDENCIES = libtests.a +check_sigign_SOURCES = check_sigign.c +check_sigign_OBJECTS = check_sigign.$(OBJEXT) +check_sigign_LDADD = $(LDADD) +check_sigign_DEPENDENCIES = libtests.a chmod_SOURCES = chmod.c chmod_OBJECTS = chmod.$(OBJEXT) chmod_LDADD = $(LDADD) @@ -413,7 +567,16 @@ clock_nanosleep_LDADD = $(LDADD) clock_nanosleep_DEPENDENCIES = libtests.a clock_xettime_SOURCES = clock_xettime.c clock_xettime_OBJECTS = clock_xettime.$(OBJEXT) -clock_xettime_DEPENDENCIES = $(LDADD) +clock_xettime_LDADD = $(LDADD) +clock_xettime_DEPENDENCIES = libtests.a +clone_parent_SOURCES = clone_parent.c +clone_parent_OBJECTS = clone_parent.$(OBJEXT) +clone_parent_LDADD = $(LDADD) +clone_parent_DEPENDENCIES = libtests.a +clone_ptrace_SOURCES = clone_ptrace.c +clone_ptrace_OBJECTS = clone_ptrace.$(OBJEXT) +clone_ptrace_LDADD = $(LDADD) +clone_ptrace_DEPENDENCIES = libtests.a copy_file_range_SOURCES = copy_file_range.c copy_file_range_OBJECTS = copy_file_range.$(OBJEXT) copy_file_range_LDADD = $(LDADD) @@ -425,10 +588,18 @@ creat_SOURCES = creat.c creat_OBJECTS = creat.$(OBJEXT) creat_LDADD = $(LDADD) creat_DEPENDENCIES = libtests.a +delay_SOURCES = delay.c +delay_OBJECTS = delay.$(OBJEXT) +am__DEPENDENCIES_1 = +delay_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LDADD) delete_module_SOURCES = delete_module.c delete_module_OBJECTS = delete_module.$(OBJEXT) delete_module_LDADD = $(LDADD) delete_module_DEPENDENCIES = libtests.a +dev_yy_SOURCES = dev-yy.c +dev_yy_OBJECTS = dev-yy.$(OBJEXT) +dev_yy_LDADD = $(LDADD) +dev_yy_DEPENDENCIES = libtests.a dup_SOURCES = dup.c dup_OBJECTS = dup.$(OBJEXT) dup_LDADD = $(LDADD) @@ -509,6 +680,18 @@ fanotify_mark_SOURCES = fanotify_mark.c fanotify_mark_OBJECTS = fanotify_mark.$(OBJEXT) fanotify_mark_LDADD = $(LDADD) fanotify_mark_DEPENDENCIES = libtests.a +fanotify_mark_Xabbrev_SOURCES = fanotify_mark-Xabbrev.c +fanotify_mark_Xabbrev_OBJECTS = fanotify_mark-Xabbrev.$(OBJEXT) +fanotify_mark_Xabbrev_LDADD = $(LDADD) +fanotify_mark_Xabbrev_DEPENDENCIES = libtests.a +fanotify_mark_Xraw_SOURCES = fanotify_mark-Xraw.c +fanotify_mark_Xraw_OBJECTS = fanotify_mark-Xraw.$(OBJEXT) +fanotify_mark_Xraw_LDADD = $(LDADD) +fanotify_mark_Xraw_DEPENDENCIES = libtests.a +fanotify_mark_Xverbose_SOURCES = fanotify_mark-Xverbose.c +fanotify_mark_Xverbose_OBJECTS = fanotify_mark-Xverbose.$(OBJEXT) +fanotify_mark_Xverbose_LDADD = $(LDADD) +fanotify_mark_Xverbose_DEPENDENCIES = libtests.a fchdir_SOURCES = fchdir.c fchdir_OBJECTS = fchdir.$(OBJEXT) fchdir_LDADD = $(LDADD) @@ -545,6 +728,10 @@ fdatasync_SOURCES = fdatasync.c fdatasync_OBJECTS = fdatasync.$(OBJEXT) fdatasync_LDADD = $(LDADD) fdatasync_DEPENDENCIES = libtests.a +fflush_SOURCES = fflush.c +fflush_OBJECTS = fflush.$(OBJEXT) +fflush_LDADD = $(LDADD) +fflush_DEPENDENCIES = libtests.a file_handle_SOURCES = file_handle.c file_handle_OBJECTS = file_handle.$(OBJEXT) file_handle_LDADD = $(LDADD) @@ -572,10 +759,34 @@ fstat_SOURCES = fstat.c fstat_OBJECTS = fstat.$(OBJEXT) fstat_LDADD = $(LDADD) fstat_DEPENDENCIES = libtests.a +fstat_Xabbrev_SOURCES = fstat-Xabbrev.c +fstat_Xabbrev_OBJECTS = fstat-Xabbrev.$(OBJEXT) +fstat_Xabbrev_LDADD = $(LDADD) +fstat_Xabbrev_DEPENDENCIES = libtests.a +fstat_Xraw_SOURCES = fstat-Xraw.c +fstat_Xraw_OBJECTS = fstat-Xraw.$(OBJEXT) +fstat_Xraw_LDADD = $(LDADD) +fstat_Xraw_DEPENDENCIES = libtests.a +fstat_Xverbose_SOURCES = fstat-Xverbose.c +fstat_Xverbose_OBJECTS = fstat-Xverbose.$(OBJEXT) +fstat_Xverbose_LDADD = $(LDADD) +fstat_Xverbose_DEPENDENCIES = libtests.a fstat64_SOURCES = fstat64.c fstat64_OBJECTS = fstat64-fstat64.$(OBJEXT) fstat64_LDADD = $(LDADD) fstat64_DEPENDENCIES = libtests.a +fstat64_Xabbrev_SOURCES = fstat64-Xabbrev.c +fstat64_Xabbrev_OBJECTS = fstat64-Xabbrev.$(OBJEXT) +fstat64_Xabbrev_LDADD = $(LDADD) +fstat64_Xabbrev_DEPENDENCIES = libtests.a +fstat64_Xraw_SOURCES = fstat64-Xraw.c +fstat64_Xraw_OBJECTS = fstat64-Xraw.$(OBJEXT) +fstat64_Xraw_LDADD = $(LDADD) +fstat64_Xraw_DEPENDENCIES = libtests.a +fstat64_Xverbose_SOURCES = fstat64-Xverbose.c +fstat64_Xverbose_OBJECTS = fstat64-Xverbose.$(OBJEXT) +fstat64_Xverbose_LDADD = $(LDADD) +fstat64_Xverbose_DEPENDENCIES = libtests.a fstatat64_SOURCES = fstatat64.c fstatat64_OBJECTS = fstatat64-fstatat64.$(OBJEXT) fstatat64_LDADD = $(LDADD) @@ -592,6 +803,10 @@ fsync_SOURCES = fsync.c fsync_OBJECTS = fsync.$(OBJEXT) fsync_LDADD = $(LDADD) fsync_DEPENDENCIES = libtests.a +fsync_y_SOURCES = fsync-y.c +fsync_y_OBJECTS = fsync-y.$(OBJEXT) +fsync_y_LDADD = $(LDADD) +fsync_y_DEPENDENCIES = libtests.a ftruncate_SOURCES = ftruncate.c ftruncate_OBJECTS = ftruncate.$(OBJEXT) ftruncate_LDADD = $(LDADD) @@ -668,6 +883,14 @@ getpgrp_SOURCES = getpgrp.c getpgrp_OBJECTS = getpgrp.$(OBJEXT) getpgrp_LDADD = $(LDADD) getpgrp_DEPENDENCIES = libtests.a +getpid_SOURCES = getpid.c +getpid_OBJECTS = getpid.$(OBJEXT) +getpid_LDADD = $(LDADD) +getpid_DEPENDENCIES = libtests.a +getppid_SOURCES = getppid.c +getppid_OBJECTS = getppid.$(OBJEXT) +getppid_LDADD = $(LDADD) +getppid_DEPENDENCIES = libtests.a getrandom_SOURCES = getrandom.c getrandom_OBJECTS = getrandom.$(OBJEXT) getrandom_LDADD = $(LDADD) @@ -704,6 +927,10 @@ getsockname_SOURCES = getsockname.c getsockname_OBJECTS = getsockname.$(OBJEXT) getsockname_LDADD = $(LDADD) getsockname_DEPENDENCIES = libtests.a +gettid_SOURCES = gettid.c +gettid_OBJECTS = gettid.$(OBJEXT) +gettid_LDADD = $(LDADD) +gettid_DEPENDENCIES = libtests.a getuid_SOURCES = getuid.c getuid_OBJECTS = getuid.$(OBJEXT) getuid_LDADD = $(LDADD) @@ -716,6 +943,10 @@ getxxid_SOURCES = getxxid.c getxxid_OBJECTS = getxxid.$(OBJEXT) getxxid_LDADD = $(LDADD) getxxid_DEPENDENCIES = libtests.a +group_req_SOURCES = group_req.c +group_req_OBJECTS = group_req.$(OBJEXT) +group_req_LDADD = $(LDADD) +group_req_DEPENDENCIES = libtests.a inet_cmsg_SOURCES = inet-cmsg.c inet_cmsg_OBJECTS = inet-cmsg.$(OBJEXT) inet_cmsg_LDADD = $(LDADD) @@ -724,6 +955,10 @@ init_module_SOURCES = init_module.c init_module_OBJECTS = init_module.$(OBJEXT) init_module_LDADD = $(LDADD) init_module_DEPENDENCIES = libtests.a +inject_nf_SOURCES = inject-nf.c +inject_nf_OBJECTS = inject-nf.$(OBJEXT) +inject_nf_LDADD = $(LDADD) +inject_nf_DEPENDENCIES = libtests.a inotify_SOURCES = inotify.c inotify_OBJECTS = inotify.$(OBJEXT) inotify_LDADD = $(LDADD) @@ -732,6 +967,22 @@ inotify_init1_SOURCES = inotify_init1.c inotify_init1_OBJECTS = inotify_init1.$(OBJEXT) inotify_init1_LDADD = $(LDADD) inotify_init1_DEPENDENCIES = libtests.a +int_0x80_SOURCES = int_0x80.c +int_0x80_OBJECTS = int_0x80.$(OBJEXT) +int_0x80_LDADD = $(LDADD) +int_0x80_DEPENDENCIES = libtests.a +io_uring_enter_SOURCES = io_uring_enter.c +io_uring_enter_OBJECTS = io_uring_enter.$(OBJEXT) +io_uring_enter_LDADD = $(LDADD) +io_uring_enter_DEPENDENCIES = libtests.a +io_uring_register_SOURCES = io_uring_register.c +io_uring_register_OBJECTS = io_uring_register.$(OBJEXT) +io_uring_register_LDADD = $(LDADD) +io_uring_register_DEPENDENCIES = libtests.a +io_uring_setup_SOURCES = io_uring_setup.c +io_uring_setup_OBJECTS = io_uring_setup.$(OBJEXT) +io_uring_setup_LDADD = $(LDADD) +io_uring_setup_DEPENDENCIES = libtests.a ioctl_SOURCES = ioctl.c ioctl_OBJECTS = ioctl.$(OBJEXT) ioctl_LDADD = $(LDADD) @@ -752,10 +1003,35 @@ ioctl_evdev_SOURCES = ioctl_evdev.c ioctl_evdev_OBJECTS = ioctl_evdev.$(OBJEXT) ioctl_evdev_LDADD = $(LDADD) ioctl_evdev_DEPENDENCIES = libtests.a +ioctl_evdev_success_SOURCES = ioctl_evdev-success.c +ioctl_evdev_success_OBJECTS = ioctl_evdev-success.$(OBJEXT) +ioctl_evdev_success_LDADD = $(LDADD) +ioctl_evdev_success_DEPENDENCIES = libtests.a +ioctl_evdev_success_v_SOURCES = ioctl_evdev-success-v.c +ioctl_evdev_success_v_OBJECTS = ioctl_evdev-success-v.$(OBJEXT) +ioctl_evdev_success_v_LDADD = $(LDADD) +ioctl_evdev_success_v_DEPENDENCIES = libtests.a ioctl_evdev_v_SOURCES = ioctl_evdev-v.c ioctl_evdev_v_OBJECTS = ioctl_evdev-v.$(OBJEXT) ioctl_evdev_v_LDADD = $(LDADD) ioctl_evdev_v_DEPENDENCIES = libtests.a +ioctl_inotify_SOURCES = ioctl_inotify.c +ioctl_inotify_OBJECTS = ioctl_inotify.$(OBJEXT) +ioctl_inotify_LDADD = $(LDADD) +ioctl_inotify_DEPENDENCIES = libtests.a +ioctl_kvm_run_SOURCES = ioctl_kvm_run.c +ioctl_kvm_run_OBJECTS = ioctl_kvm_run.$(OBJEXT) +ioctl_kvm_run_LDADD = $(LDADD) +ioctl_kvm_run_DEPENDENCIES = libtests.a +ioctl_kvm_run_v_SOURCES = ioctl_kvm_run-v.c +ioctl_kvm_run_v_OBJECTS = ioctl_kvm_run-v.$(OBJEXT) +ioctl_kvm_run_v_LDADD = $(LDADD) +ioctl_kvm_run_v_DEPENDENCIES = libtests.a +ioctl_kvm_run_auxstr_vcpu_SOURCES = ioctl_kvm_run_auxstr_vcpu.c +ioctl_kvm_run_auxstr_vcpu_OBJECTS = \ + ioctl_kvm_run_auxstr_vcpu.$(OBJEXT) +ioctl_kvm_run_auxstr_vcpu_LDADD = $(LDADD) +ioctl_kvm_run_auxstr_vcpu_DEPENDENCIES = libtests.a ioctl_loop_SOURCES = ioctl_loop.c ioctl_loop_OBJECTS = ioctl_loop.$(OBJEXT) ioctl_loop_LDADD = $(LDADD) @@ -772,6 +1048,30 @@ ioctl_mtd_SOURCES = ioctl_mtd.c ioctl_mtd_OBJECTS = ioctl_mtd.$(OBJEXT) ioctl_mtd_LDADD = $(LDADD) ioctl_mtd_DEPENDENCIES = libtests.a +ioctl_nbd_SOURCES = ioctl_nbd.c +ioctl_nbd_OBJECTS = ioctl_nbd.$(OBJEXT) +ioctl_nbd_LDADD = $(LDADD) +ioctl_nbd_DEPENDENCIES = libtests.a +ioctl_nsfs_SOURCES = ioctl_nsfs.c +ioctl_nsfs_OBJECTS = ioctl_nsfs.$(OBJEXT) +ioctl_nsfs_LDADD = $(LDADD) +ioctl_nsfs_DEPENDENCIES = libtests.a +ioctl_perf_SOURCES = ioctl_perf.c +ioctl_perf_OBJECTS = ioctl_perf.$(OBJEXT) +ioctl_perf_LDADD = $(LDADD) +ioctl_perf_DEPENDENCIES = libtests.a +ioctl_perf_success_SOURCES = ioctl_perf-success.c +ioctl_perf_success_OBJECTS = ioctl_perf-success.$(OBJEXT) +ioctl_perf_success_LDADD = $(LDADD) +ioctl_perf_success_DEPENDENCIES = libtests.a +ioctl_ptp_SOURCES = ioctl_ptp.c +ioctl_ptp_OBJECTS = ioctl_ptp.$(OBJEXT) +ioctl_ptp_LDADD = $(LDADD) +ioctl_ptp_DEPENDENCIES = libtests.a +ioctl_random_SOURCES = ioctl_random.c +ioctl_random_OBJECTS = ioctl_random.$(OBJEXT) +ioctl_random_LDADD = $(LDADD) +ioctl_random_DEPENDENCIES = libtests.a ioctl_rtc_SOURCES = ioctl_rtc.c ioctl_rtc_OBJECTS = ioctl_rtc.$(OBJEXT) ioctl_rtc_LDADD = $(LDADD) @@ -816,6 +1116,18 @@ ioprio_SOURCES = ioprio.c ioprio_OBJECTS = ioprio.$(OBJEXT) ioprio_LDADD = $(LDADD) ioprio_DEPENDENCIES = libtests.a +ioprio_Xabbrev_SOURCES = ioprio-Xabbrev.c +ioprio_Xabbrev_OBJECTS = ioprio-Xabbrev.$(OBJEXT) +ioprio_Xabbrev_LDADD = $(LDADD) +ioprio_Xabbrev_DEPENDENCIES = libtests.a +ioprio_Xraw_SOURCES = ioprio-Xraw.c +ioprio_Xraw_OBJECTS = ioprio-Xraw.$(OBJEXT) +ioprio_Xraw_LDADD = $(LDADD) +ioprio_Xraw_DEPENDENCIES = libtests.a +ioprio_Xverbose_SOURCES = ioprio-Xverbose.c +ioprio_Xverbose_OBJECTS = ioprio-Xverbose.$(OBJEXT) +ioprio_Xverbose_LDADD = $(LDADD) +ioprio_Xverbose_DEPENDENCIES = libtests.a ip_mreq_SOURCES = ip_mreq.c ip_mreq_OBJECTS = ip_mreq.$(OBJEXT) ip_mreq_LDADD = $(LDADD) @@ -828,22 +1140,98 @@ ipc_msg_SOURCES = ipc_msg.c ipc_msg_OBJECTS = ipc_msg.$(OBJEXT) ipc_msg_LDADD = $(LDADD) ipc_msg_DEPENDENCIES = libtests.a +ipc_msg_Xabbrev_SOURCES = ipc_msg-Xabbrev.c +ipc_msg_Xabbrev_OBJECTS = ipc_msg-Xabbrev.$(OBJEXT) +ipc_msg_Xabbrev_LDADD = $(LDADD) +ipc_msg_Xabbrev_DEPENDENCIES = libtests.a +ipc_msg_Xraw_SOURCES = ipc_msg-Xraw.c +ipc_msg_Xraw_OBJECTS = ipc_msg-Xraw.$(OBJEXT) +ipc_msg_Xraw_LDADD = $(LDADD) +ipc_msg_Xraw_DEPENDENCIES = libtests.a +ipc_msg_Xverbose_SOURCES = ipc_msg-Xverbose.c +ipc_msg_Xverbose_OBJECTS = ipc_msg-Xverbose.$(OBJEXT) +ipc_msg_Xverbose_LDADD = $(LDADD) +ipc_msg_Xverbose_DEPENDENCIES = libtests.a ipc_msgbuf_SOURCES = ipc_msgbuf.c ipc_msgbuf_OBJECTS = ipc_msgbuf.$(OBJEXT) ipc_msgbuf_LDADD = $(LDADD) ipc_msgbuf_DEPENDENCIES = libtests.a +ipc_msgbuf_Xabbrev_SOURCES = ipc_msgbuf-Xabbrev.c +ipc_msgbuf_Xabbrev_OBJECTS = ipc_msgbuf-Xabbrev.$(OBJEXT) +ipc_msgbuf_Xabbrev_LDADD = $(LDADD) +ipc_msgbuf_Xabbrev_DEPENDENCIES = libtests.a +ipc_msgbuf_Xraw_SOURCES = ipc_msgbuf-Xraw.c +ipc_msgbuf_Xraw_OBJECTS = ipc_msgbuf-Xraw.$(OBJEXT) +ipc_msgbuf_Xraw_LDADD = $(LDADD) +ipc_msgbuf_Xraw_DEPENDENCIES = libtests.a +ipc_msgbuf_Xverbose_SOURCES = ipc_msgbuf-Xverbose.c +ipc_msgbuf_Xverbose_OBJECTS = ipc_msgbuf-Xverbose.$(OBJEXT) +ipc_msgbuf_Xverbose_LDADD = $(LDADD) +ipc_msgbuf_Xverbose_DEPENDENCIES = libtests.a ipc_sem_SOURCES = ipc_sem.c ipc_sem_OBJECTS = ipc_sem.$(OBJEXT) ipc_sem_LDADD = $(LDADD) ipc_sem_DEPENDENCIES = libtests.a +ipc_sem_Xabbrev_SOURCES = ipc_sem-Xabbrev.c +ipc_sem_Xabbrev_OBJECTS = ipc_sem-Xabbrev.$(OBJEXT) +ipc_sem_Xabbrev_LDADD = $(LDADD) +ipc_sem_Xabbrev_DEPENDENCIES = libtests.a +ipc_sem_Xraw_SOURCES = ipc_sem-Xraw.c +ipc_sem_Xraw_OBJECTS = ipc_sem-Xraw.$(OBJEXT) +ipc_sem_Xraw_LDADD = $(LDADD) +ipc_sem_Xraw_DEPENDENCIES = libtests.a +ipc_sem_Xverbose_SOURCES = ipc_sem-Xverbose.c +ipc_sem_Xverbose_OBJECTS = ipc_sem-Xverbose.$(OBJEXT) +ipc_sem_Xverbose_LDADD = $(LDADD) +ipc_sem_Xverbose_DEPENDENCIES = libtests.a ipc_shm_SOURCES = ipc_shm.c ipc_shm_OBJECTS = ipc_shm.$(OBJEXT) ipc_shm_LDADD = $(LDADD) ipc_shm_DEPENDENCIES = libtests.a +ipc_shm_Xabbrev_SOURCES = ipc_shm-Xabbrev.c +ipc_shm_Xabbrev_OBJECTS = ipc_shm-Xabbrev.$(OBJEXT) +ipc_shm_Xabbrev_LDADD = $(LDADD) +ipc_shm_Xabbrev_DEPENDENCIES = libtests.a +ipc_shm_Xraw_SOURCES = ipc_shm-Xraw.c +ipc_shm_Xraw_OBJECTS = ipc_shm-Xraw.$(OBJEXT) +ipc_shm_Xraw_LDADD = $(LDADD) +ipc_shm_Xraw_DEPENDENCIES = libtests.a +ipc_shm_Xverbose_SOURCES = ipc_shm-Xverbose.c +ipc_shm_Xverbose_OBJECTS = ipc_shm-Xverbose.$(OBJEXT) +ipc_shm_Xverbose_LDADD = $(LDADD) +ipc_shm_Xverbose_DEPENDENCIES = libtests.a +is_linux_mips_n64_SOURCES = is_linux_mips_n64.c +is_linux_mips_n64_OBJECTS = is_linux_mips_n64.$(OBJEXT) +is_linux_mips_n64_LDADD = $(LDADD) +is_linux_mips_n64_DEPENDENCIES = libtests.a kcmp_SOURCES = kcmp.c kcmp_OBJECTS = kcmp.$(OBJEXT) kcmp_LDADD = $(LDADD) kcmp_DEPENDENCIES = libtests.a +kcmp_y_SOURCES = kcmp-y.c +kcmp_y_OBJECTS = kcmp-y.$(OBJEXT) +kcmp_y_LDADD = $(LDADD) +kcmp_y_DEPENDENCIES = libtests.a +kern_features_SOURCES = kern_features.c +kern_features_OBJECTS = kern_features.$(OBJEXT) +kern_features_LDADD = $(LDADD) +kern_features_DEPENDENCIES = libtests.a +kernel_version_SOURCES = kernel_version.c +kernel_version_OBJECTS = kernel_version.$(OBJEXT) +kernel_version_LDADD = $(LDADD) +kernel_version_DEPENDENCIES = libtests.a +kernel_version_Xabbrev_SOURCES = kernel_version-Xabbrev.c +kernel_version_Xabbrev_OBJECTS = kernel_version-Xabbrev.$(OBJEXT) +kernel_version_Xabbrev_LDADD = $(LDADD) +kernel_version_Xabbrev_DEPENDENCIES = libtests.a +kernel_version_Xraw_SOURCES = kernel_version-Xraw.c +kernel_version_Xraw_OBJECTS = kernel_version-Xraw.$(OBJEXT) +kernel_version_Xraw_LDADD = $(LDADD) +kernel_version_Xraw_DEPENDENCIES = libtests.a +kernel_version_Xverbose_SOURCES = kernel_version-Xverbose.c +kernel_version_Xverbose_OBJECTS = kernel_version-Xverbose.$(OBJEXT) +kernel_version_Xverbose_LDADD = $(LDADD) +kernel_version_Xverbose_DEPENDENCIES = libtests.a kexec_file_load_SOURCES = kexec_file_load.c kexec_file_load_OBJECTS = kexec_file_load.$(OBJEXT) kexec_file_load_LDADD = $(LDADD) @@ -856,10 +1244,26 @@ keyctl_SOURCES = keyctl.c keyctl_OBJECTS = keyctl.$(OBJEXT) keyctl_LDADD = $(LDADD) keyctl_DEPENDENCIES = libtests.a +keyctl_Xabbrev_SOURCES = keyctl-Xabbrev.c +keyctl_Xabbrev_OBJECTS = keyctl-Xabbrev.$(OBJEXT) +keyctl_Xabbrev_LDADD = $(LDADD) +keyctl_Xabbrev_DEPENDENCIES = libtests.a +keyctl_Xraw_SOURCES = keyctl-Xraw.c +keyctl_Xraw_OBJECTS = keyctl-Xraw.$(OBJEXT) +keyctl_Xraw_LDADD = $(LDADD) +keyctl_Xraw_DEPENDENCIES = libtests.a +keyctl_Xverbose_SOURCES = keyctl-Xverbose.c +keyctl_Xverbose_OBJECTS = keyctl-Xverbose.$(OBJEXT) +keyctl_Xverbose_LDADD = $(LDADD) +keyctl_Xverbose_DEPENDENCIES = libtests.a kill_SOURCES = kill.c kill_OBJECTS = kill.$(OBJEXT) kill_LDADD = $(LDADD) kill_DEPENDENCIES = libtests.a +kill_child_SOURCES = kill_child.c +kill_child_OBJECTS = kill_child.$(OBJEXT) +kill_child_LDADD = $(LDADD) +kill_child_DEPENDENCIES = libtests.a ksysent_SOURCES = ksysent.c ksysent_OBJECTS = ksysent.$(OBJEXT) ksysent_LDADD = $(LDADD) @@ -880,14 +1284,24 @@ linkat_SOURCES = linkat.c linkat_OBJECTS = linkat.$(OBJEXT) linkat_LDADD = $(LDADD) linkat_DEPENDENCIES = libtests.a +list_sigaction_signum_SOURCES = list_sigaction_signum.c +list_sigaction_signum_OBJECTS = list_sigaction_signum.$(OBJEXT) +list_sigaction_signum_LDADD = $(LDADD) +list_sigaction_signum_DEPENDENCIES = libtests.a llseek_SOURCES = llseek.c llseek_OBJECTS = llseek.$(OBJEXT) llseek_LDADD = $(LDADD) llseek_DEPENDENCIES = libtests.a +localtime_SOURCES = localtime.c +localtime_OBJECTS = localtime.$(OBJEXT) +localtime_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LDADD) lookup_dcookie_SOURCES = lookup_dcookie.c lookup_dcookie_OBJECTS = lookup_dcookie.$(OBJEXT) lookup_dcookie_LDADD = $(LDADD) lookup_dcookie_DEPENDENCIES = libtests.a +looping_threads_SOURCES = looping_threads.c +looping_threads_OBJECTS = looping_threads.$(OBJEXT) +looping_threads_DEPENDENCIES = $(LDADD) lseek_SOURCES = lseek.c lseek_OBJECTS = lseek.$(OBJEXT) lseek_LDADD = $(LDADD) @@ -900,6 +1314,10 @@ lstat64_SOURCES = lstat64.c lstat64_OBJECTS = lstat64-lstat64.$(OBJEXT) lstat64_LDADD = $(LDADD) lstat64_DEPENDENCIES = libtests.a +madvise_SOURCES = madvise.c +madvise_OBJECTS = madvise.$(OBJEXT) +madvise_LDADD = $(LDADD) +madvise_DEPENDENCIES = libtests.a mbind_SOURCES = mbind.c mbind_OBJECTS = mbind.$(OBJEXT) mbind_LDADD = $(LDADD) @@ -912,6 +1330,18 @@ memfd_create_SOURCES = memfd_create.c memfd_create_OBJECTS = memfd_create.$(OBJEXT) memfd_create_LDADD = $(LDADD) memfd_create_DEPENDENCIES = libtests.a +memfd_create_Xabbrev_SOURCES = memfd_create-Xabbrev.c +memfd_create_Xabbrev_OBJECTS = memfd_create-Xabbrev.$(OBJEXT) +memfd_create_Xabbrev_LDADD = $(LDADD) +memfd_create_Xabbrev_DEPENDENCIES = libtests.a +memfd_create_Xraw_SOURCES = memfd_create-Xraw.c +memfd_create_Xraw_OBJECTS = memfd_create-Xraw.$(OBJEXT) +memfd_create_Xraw_LDADD = $(LDADD) +memfd_create_Xraw_DEPENDENCIES = libtests.a +memfd_create_Xverbose_SOURCES = memfd_create-Xverbose.c +memfd_create_Xverbose_OBJECTS = memfd_create-Xverbose.$(OBJEXT) +memfd_create_Xverbose_LDADD = $(LDADD) +memfd_create_Xverbose_DEPENDENCIES = libtests.a migrate_pages_SOURCES = migrate_pages.c migrate_pages_OBJECTS = migrate_pages.$(OBJEXT) migrate_pages_LDADD = $(LDADD) @@ -952,10 +1382,34 @@ mmap_SOURCES = mmap.c mmap_OBJECTS = mmap.$(OBJEXT) mmap_LDADD = $(LDADD) mmap_DEPENDENCIES = libtests.a +mmap_Xabbrev_SOURCES = mmap-Xabbrev.c +mmap_Xabbrev_OBJECTS = mmap-Xabbrev.$(OBJEXT) +mmap_Xabbrev_LDADD = $(LDADD) +mmap_Xabbrev_DEPENDENCIES = libtests.a +mmap_Xraw_SOURCES = mmap-Xraw.c +mmap_Xraw_OBJECTS = mmap-Xraw.$(OBJEXT) +mmap_Xraw_LDADD = $(LDADD) +mmap_Xraw_DEPENDENCIES = libtests.a +mmap_Xverbose_SOURCES = mmap-Xverbose.c +mmap_Xverbose_OBJECTS = mmap-Xverbose.$(OBJEXT) +mmap_Xverbose_LDADD = $(LDADD) +mmap_Xverbose_DEPENDENCIES = libtests.a mmap64_SOURCES = mmap64.c mmap64_OBJECTS = mmap64-mmap64.$(OBJEXT) mmap64_LDADD = $(LDADD) mmap64_DEPENDENCIES = libtests.a +mmap64_Xabbrev_SOURCES = mmap64-Xabbrev.c +mmap64_Xabbrev_OBJECTS = mmap64_Xabbrev-mmap64-Xabbrev.$(OBJEXT) +mmap64_Xabbrev_LDADD = $(LDADD) +mmap64_Xabbrev_DEPENDENCIES = libtests.a +mmap64_Xraw_SOURCES = mmap64-Xraw.c +mmap64_Xraw_OBJECTS = mmap64_Xraw-mmap64-Xraw.$(OBJEXT) +mmap64_Xraw_LDADD = $(LDADD) +mmap64_Xraw_DEPENDENCIES = libtests.a +mmap64_Xverbose_SOURCES = mmap64-Xverbose.c +mmap64_Xverbose_OBJECTS = mmap64_Xverbose-mmap64-Xverbose.$(OBJEXT) +mmap64_Xverbose_LDADD = $(LDADD) +mmap64_Xverbose_DEPENDENCIES = libtests.a mmsg_SOURCES = mmsg.c mmsg_OBJECTS = mmsg.$(OBJEXT) mmsg_LDADD = $(LDADD) @@ -972,26 +1426,57 @@ mmsg_name_v_SOURCES = mmsg_name-v.c mmsg_name_v_OBJECTS = mmsg_name-v.$(OBJEXT) mmsg_name_v_LDADD = $(LDADD) mmsg_name_v_DEPENDENCIES = libtests.a +modify_ldt_SOURCES = modify_ldt.c +modify_ldt_OBJECTS = modify_ldt.$(OBJEXT) +modify_ldt_LDADD = $(LDADD) +modify_ldt_DEPENDENCIES = libtests.a mount_SOURCES = mount.c mount_OBJECTS = mount.$(OBJEXT) mount_LDADD = $(LDADD) mount_DEPENDENCIES = libtests.a +mount_Xabbrev_SOURCES = mount-Xabbrev.c +mount_Xabbrev_OBJECTS = mount-Xabbrev.$(OBJEXT) +mount_Xabbrev_LDADD = $(LDADD) +mount_Xabbrev_DEPENDENCIES = libtests.a +mount_Xraw_SOURCES = mount-Xraw.c +mount_Xraw_OBJECTS = mount-Xraw.$(OBJEXT) +mount_Xraw_LDADD = $(LDADD) +mount_Xraw_DEPENDENCIES = libtests.a +mount_Xverbose_SOURCES = mount-Xverbose.c +mount_Xverbose_OBJECTS = mount-Xverbose.$(OBJEXT) +mount_Xverbose_LDADD = $(LDADD) +mount_Xverbose_DEPENDENCIES = libtests.a move_pages_SOURCES = move_pages.c move_pages_OBJECTS = move_pages.$(OBJEXT) move_pages_LDADD = $(LDADD) move_pages_DEPENDENCIES = libtests.a +move_pages_Xabbrev_SOURCES = move_pages-Xabbrev.c +move_pages_Xabbrev_OBJECTS = move_pages-Xabbrev.$(OBJEXT) +move_pages_Xabbrev_LDADD = $(LDADD) +move_pages_Xabbrev_DEPENDENCIES = libtests.a +move_pages_Xraw_SOURCES = move_pages-Xraw.c +move_pages_Xraw_OBJECTS = move_pages-Xraw.$(OBJEXT) +move_pages_Xraw_LDADD = $(LDADD) +move_pages_Xraw_DEPENDENCIES = libtests.a +move_pages_Xverbose_SOURCES = move_pages-Xverbose.c +move_pages_Xverbose_OBJECTS = move_pages-Xverbose.$(OBJEXT) +move_pages_Xverbose_LDADD = $(LDADD) +move_pages_Xverbose_DEPENDENCIES = libtests.a mq_SOURCES = mq.c mq_OBJECTS = mq.$(OBJEXT) -mq_DEPENDENCIES = $(LDADD) +mq_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LDADD) mq_sendrecv_SOURCES = mq_sendrecv.c mq_sendrecv_OBJECTS = mq_sendrecv.$(OBJEXT) -mq_sendrecv_DEPENDENCIES = $(LDADD) +mq_sendrecv_LDADD = $(LDADD) +mq_sendrecv_DEPENDENCIES = libtests.a mq_sendrecv_read_SOURCES = mq_sendrecv-read.c mq_sendrecv_read_OBJECTS = mq_sendrecv-read.$(OBJEXT) -mq_sendrecv_read_DEPENDENCIES = $(LDADD) +mq_sendrecv_read_LDADD = $(LDADD) +mq_sendrecv_read_DEPENDENCIES = libtests.a mq_sendrecv_write_SOURCES = mq_sendrecv-write.c mq_sendrecv_write_OBJECTS = mq_sendrecv-write.$(OBJEXT) -mq_sendrecv_write_DEPENDENCIES = $(LDADD) +mq_sendrecv_write_LDADD = $(LDADD) +mq_sendrecv_write_DEPENDENCIES = libtests.a msg_control_SOURCES = msg_control.c msg_control_OBJECTS = msg_control.$(OBJEXT) msg_control_LDADD = $(LDADD) @@ -1020,10 +1505,39 @@ net_icmp_filter_SOURCES = net-icmp_filter.c net_icmp_filter_OBJECTS = net-icmp_filter.$(OBJEXT) net_icmp_filter_LDADD = $(LDADD) net_icmp_filter_DEPENDENCIES = libtests.a +net_packet_mreq_SOURCES = net-packet_mreq.c +net_packet_mreq_OBJECTS = net-packet_mreq.$(OBJEXT) +net_packet_mreq_LDADD = $(LDADD) +net_packet_mreq_DEPENDENCIES = libtests.a +net_packet_mreq_Xabbrev_SOURCES = net-packet_mreq-Xabbrev.c +net_packet_mreq_Xabbrev_OBJECTS = net-packet_mreq-Xabbrev.$(OBJEXT) +net_packet_mreq_Xabbrev_LDADD = $(LDADD) +net_packet_mreq_Xabbrev_DEPENDENCIES = libtests.a +net_packet_mreq_Xraw_SOURCES = net-packet_mreq-Xraw.c +net_packet_mreq_Xraw_OBJECTS = net-packet_mreq-Xraw.$(OBJEXT) +net_packet_mreq_Xraw_LDADD = $(LDADD) +net_packet_mreq_Xraw_DEPENDENCIES = libtests.a +net_packet_mreq_Xverbose_SOURCES = net-packet_mreq-Xverbose.c +net_packet_mreq_Xverbose_OBJECTS = net-packet_mreq-Xverbose.$(OBJEXT) +net_packet_mreq_Xverbose_LDADD = $(LDADD) +net_packet_mreq_Xverbose_DEPENDENCIES = libtests.a net_sockaddr_SOURCES = net-sockaddr.c net_sockaddr_OBJECTS = net-sockaddr.$(OBJEXT) net_sockaddr_LDADD = $(LDADD) net_sockaddr_DEPENDENCIES = libtests.a +net_tpacket_req_SOURCES = net-tpacket_req.c +net_tpacket_req_OBJECTS = net-tpacket_req.$(OBJEXT) +net_tpacket_req_LDADD = $(LDADD) +net_tpacket_req_DEPENDENCIES = libtests.a +net_tpacket_stats_SOURCES = net-tpacket_stats.c +net_tpacket_stats_OBJECTS = net-tpacket_stats.$(OBJEXT) +net_tpacket_stats_LDADD = $(LDADD) +net_tpacket_stats_DEPENDENCIES = libtests.a +net_tpacket_stats_success_SOURCES = net-tpacket_stats-success.c +net_tpacket_stats_success_OBJECTS = \ + net-tpacket_stats-success.$(OBJEXT) +net_tpacket_stats_success_LDADD = $(LDADD) +net_tpacket_stats_success_DEPENDENCIES = libtests.a net_y_unix_SOURCES = net-y-unix.c net_y_unix_OBJECTS = net-y-unix.$(OBJEXT) net_y_unix_LDADD = $(LDADD) @@ -1032,6 +1546,10 @@ net_yy_inet_SOURCES = net-yy-inet.c net_yy_inet_OBJECTS = net-yy-inet.$(OBJEXT) net_yy_inet_LDADD = $(LDADD) net_yy_inet_DEPENDENCIES = libtests.a +net_yy_inet6_SOURCES = net-yy-inet6.c +net_yy_inet6_OBJECTS = net-yy-inet6.$(OBJEXT) +net_yy_inet6_LDADD = $(LDADD) +net_yy_inet6_DEPENDENCIES = libtests.a net_yy_netlink_SOURCES = net-yy-netlink.c net_yy_netlink_OBJECTS = net-yy-netlink.$(OBJEXT) net_yy_netlink_LDADD = $(LDADD) @@ -1040,10 +1558,30 @@ net_yy_unix_SOURCES = net-yy-unix.c net_yy_unix_OBJECTS = net-yy-unix.$(OBJEXT) net_yy_unix_LDADD = $(LDADD) net_yy_unix_DEPENDENCIES = libtests.a +netlink_audit_SOURCES = netlink_audit.c +netlink_audit_OBJECTS = netlink_audit.$(OBJEXT) +netlink_audit_LDADD = $(LDADD) +netlink_audit_DEPENDENCIES = libtests.a +netlink_crypto_SOURCES = netlink_crypto.c +netlink_crypto_OBJECTS = netlink_crypto.$(OBJEXT) +netlink_crypto_LDADD = $(LDADD) +netlink_crypto_DEPENDENCIES = libtests.a +netlink_generic_SOURCES = netlink_generic.c +netlink_generic_OBJECTS = netlink_generic.$(OBJEXT) +netlink_generic_LDADD = $(LDADD) +netlink_generic_DEPENDENCIES = libtests.a netlink_inet_diag_SOURCES = netlink_inet_diag.c netlink_inet_diag_OBJECTS = netlink_inet_diag.$(OBJEXT) netlink_inet_diag_LDADD = $(LDADD) netlink_inet_diag_DEPENDENCIES = libtests.a +netlink_kobject_uevent_SOURCES = netlink_kobject_uevent.c +netlink_kobject_uevent_OBJECTS = netlink_kobject_uevent.$(OBJEXT) +netlink_kobject_uevent_LDADD = $(LDADD) +netlink_kobject_uevent_DEPENDENCIES = libtests.a +netlink_netfilter_SOURCES = netlink_netfilter.c +netlink_netfilter_OBJECTS = netlink_netfilter.$(OBJEXT) +netlink_netfilter_LDADD = $(LDADD) +netlink_netfilter_DEPENDENCIES = libtests.a netlink_netlink_diag_SOURCES = netlink_netlink_diag.c netlink_netlink_diag_OBJECTS = netlink_netlink_diag.$(OBJEXT) netlink_netlink_diag_LDADD = $(LDADD) @@ -1052,22 +1590,235 @@ netlink_protocol_SOURCES = netlink_protocol.c netlink_protocol_OBJECTS = netlink_protocol.$(OBJEXT) netlink_protocol_LDADD = $(LDADD) netlink_protocol_DEPENDENCIES = libtests.a +netlink_route_SOURCES = netlink_route.c +netlink_route_OBJECTS = netlink_route.$(OBJEXT) +netlink_route_LDADD = $(LDADD) +netlink_route_DEPENDENCIES = libtests.a +netlink_selinux_SOURCES = netlink_selinux.c +netlink_selinux_OBJECTS = netlink_selinux.$(OBJEXT) +netlink_selinux_LDADD = $(LDADD) +netlink_selinux_DEPENDENCIES = libtests.a +netlink_sock_diag_SOURCES = netlink_sock_diag.c +netlink_sock_diag_OBJECTS = netlink_sock_diag.$(OBJEXT) +netlink_sock_diag_LDADD = $(LDADD) +netlink_sock_diag_DEPENDENCIES = libtests.a netlink_unix_diag_SOURCES = netlink_unix_diag.c netlink_unix_diag_OBJECTS = netlink_unix_diag.$(OBJEXT) netlink_unix_diag_LDADD = $(LDADD) netlink_unix_diag_DEPENDENCIES = libtests.a +netlink_xfrm_SOURCES = netlink_xfrm.c +netlink_xfrm_OBJECTS = netlink_xfrm.$(OBJEXT) +netlink_xfrm_LDADD = $(LDADD) +netlink_xfrm_DEPENDENCIES = libtests.a newfstatat_SOURCES = newfstatat.c newfstatat_OBJECTS = newfstatat-newfstatat.$(OBJEXT) newfstatat_LDADD = $(LDADD) newfstatat_DEPENDENCIES = libtests.a +nfnetlink_acct_SOURCES = nfnetlink_acct.c +nfnetlink_acct_OBJECTS = nfnetlink_acct.$(OBJEXT) +nfnetlink_acct_LDADD = $(LDADD) +nfnetlink_acct_DEPENDENCIES = libtests.a +nfnetlink_cthelper_SOURCES = nfnetlink_cthelper.c +nfnetlink_cthelper_OBJECTS = nfnetlink_cthelper.$(OBJEXT) +nfnetlink_cthelper_LDADD = $(LDADD) +nfnetlink_cthelper_DEPENDENCIES = libtests.a +nfnetlink_ctnetlink_SOURCES = nfnetlink_ctnetlink.c +nfnetlink_ctnetlink_OBJECTS = nfnetlink_ctnetlink.$(OBJEXT) +nfnetlink_ctnetlink_LDADD = $(LDADD) +nfnetlink_ctnetlink_DEPENDENCIES = libtests.a +nfnetlink_ctnetlink_exp_SOURCES = nfnetlink_ctnetlink_exp.c +nfnetlink_ctnetlink_exp_OBJECTS = nfnetlink_ctnetlink_exp.$(OBJEXT) +nfnetlink_ctnetlink_exp_LDADD = $(LDADD) +nfnetlink_ctnetlink_exp_DEPENDENCIES = libtests.a +nfnetlink_cttimeout_SOURCES = nfnetlink_cttimeout.c +nfnetlink_cttimeout_OBJECTS = nfnetlink_cttimeout.$(OBJEXT) +nfnetlink_cttimeout_LDADD = $(LDADD) +nfnetlink_cttimeout_DEPENDENCIES = libtests.a +nfnetlink_ipset_SOURCES = nfnetlink_ipset.c +nfnetlink_ipset_OBJECTS = nfnetlink_ipset.$(OBJEXT) +nfnetlink_ipset_LDADD = $(LDADD) +nfnetlink_ipset_DEPENDENCIES = libtests.a +nfnetlink_nft_compat_SOURCES = nfnetlink_nft_compat.c +nfnetlink_nft_compat_OBJECTS = nfnetlink_nft_compat.$(OBJEXT) +nfnetlink_nft_compat_LDADD = $(LDADD) +nfnetlink_nft_compat_DEPENDENCIES = libtests.a +nfnetlink_nftables_SOURCES = nfnetlink_nftables.c +nfnetlink_nftables_OBJECTS = nfnetlink_nftables.$(OBJEXT) +nfnetlink_nftables_LDADD = $(LDADD) +nfnetlink_nftables_DEPENDENCIES = libtests.a +nfnetlink_osf_SOURCES = nfnetlink_osf.c +nfnetlink_osf_OBJECTS = nfnetlink_osf.$(OBJEXT) +nfnetlink_osf_LDADD = $(LDADD) +nfnetlink_osf_DEPENDENCIES = libtests.a +nfnetlink_queue_SOURCES = nfnetlink_queue.c +nfnetlink_queue_OBJECTS = nfnetlink_queue.$(OBJEXT) +nfnetlink_queue_LDADD = $(LDADD) +nfnetlink_queue_DEPENDENCIES = libtests.a +nfnetlink_ulog_SOURCES = nfnetlink_ulog.c +nfnetlink_ulog_OBJECTS = nfnetlink_ulog.$(OBJEXT) +nfnetlink_ulog_LDADD = $(LDADD) +nfnetlink_ulog_DEPENDENCIES = libtests.a +nlattr_SOURCES = nlattr.c +nlattr_OBJECTS = nlattr.$(OBJEXT) +nlattr_LDADD = $(LDADD) +nlattr_DEPENDENCIES = libtests.a +nlattr_br_port_msg_SOURCES = nlattr_br_port_msg.c +nlattr_br_port_msg_OBJECTS = nlattr_br_port_msg.$(OBJEXT) +nlattr_br_port_msg_LDADD = $(LDADD) +nlattr_br_port_msg_DEPENDENCIES = libtests.a +nlattr_crypto_user_alg_SOURCES = nlattr_crypto_user_alg.c +nlattr_crypto_user_alg_OBJECTS = nlattr_crypto_user_alg.$(OBJEXT) +nlattr_crypto_user_alg_LDADD = $(LDADD) +nlattr_crypto_user_alg_DEPENDENCIES = libtests.a +nlattr_dcbmsg_SOURCES = nlattr_dcbmsg.c +nlattr_dcbmsg_OBJECTS = nlattr_dcbmsg.$(OBJEXT) +nlattr_dcbmsg_LDADD = $(LDADD) +nlattr_dcbmsg_DEPENDENCIES = libtests.a +nlattr_fib_rule_hdr_SOURCES = nlattr_fib_rule_hdr.c +nlattr_fib_rule_hdr_OBJECTS = nlattr_fib_rule_hdr.$(OBJEXT) +nlattr_fib_rule_hdr_LDADD = $(LDADD) +nlattr_fib_rule_hdr_DEPENDENCIES = libtests.a +nlattr_ifaddrlblmsg_SOURCES = nlattr_ifaddrlblmsg.c +nlattr_ifaddrlblmsg_OBJECTS = nlattr_ifaddrlblmsg.$(OBJEXT) +nlattr_ifaddrlblmsg_LDADD = $(LDADD) +nlattr_ifaddrlblmsg_DEPENDENCIES = libtests.a +nlattr_ifaddrmsg_SOURCES = nlattr_ifaddrmsg.c +nlattr_ifaddrmsg_OBJECTS = nlattr_ifaddrmsg.$(OBJEXT) +nlattr_ifaddrmsg_LDADD = $(LDADD) +nlattr_ifaddrmsg_DEPENDENCIES = libtests.a +nlattr_ifinfomsg_SOURCES = nlattr_ifinfomsg.c +nlattr_ifinfomsg_OBJECTS = nlattr_ifinfomsg.$(OBJEXT) +nlattr_ifinfomsg_LDADD = $(LDADD) +nlattr_ifinfomsg_DEPENDENCIES = libtests.a +nlattr_ifla_af_spec_SOURCES = nlattr_ifla_af_spec.c +nlattr_ifla_af_spec_OBJECTS = nlattr_ifla_af_spec.$(OBJEXT) +nlattr_ifla_af_spec_LDADD = $(LDADD) +nlattr_ifla_af_spec_DEPENDENCIES = libtests.a +nlattr_ifla_brport_SOURCES = nlattr_ifla_brport.c +nlattr_ifla_brport_OBJECTS = nlattr_ifla_brport.$(OBJEXT) +nlattr_ifla_brport_LDADD = $(LDADD) +nlattr_ifla_brport_DEPENDENCIES = libtests.a +nlattr_ifla_linkinfo_SOURCES = nlattr_ifla_linkinfo.c +nlattr_ifla_linkinfo_OBJECTS = nlattr_ifla_linkinfo.$(OBJEXT) +nlattr_ifla_linkinfo_LDADD = $(LDADD) +nlattr_ifla_linkinfo_DEPENDENCIES = libtests.a +nlattr_ifla_port_SOURCES = nlattr_ifla_port.c +nlattr_ifla_port_OBJECTS = nlattr_ifla_port.$(OBJEXT) +nlattr_ifla_port_LDADD = $(LDADD) +nlattr_ifla_port_DEPENDENCIES = libtests.a +nlattr_ifla_xdp_SOURCES = nlattr_ifla_xdp.c +nlattr_ifla_xdp_OBJECTS = nlattr_ifla_xdp.$(OBJEXT) +nlattr_ifla_xdp_LDADD = $(LDADD) +nlattr_ifla_xdp_DEPENDENCIES = libtests.a +nlattr_inet_diag_msg_SOURCES = nlattr_inet_diag_msg.c +nlattr_inet_diag_msg_OBJECTS = nlattr_inet_diag_msg.$(OBJEXT) +nlattr_inet_diag_msg_LDADD = $(LDADD) +nlattr_inet_diag_msg_DEPENDENCIES = libtests.a +nlattr_inet_diag_req_compat_SOURCES = nlattr_inet_diag_req_compat.c +nlattr_inet_diag_req_compat_OBJECTS = \ + nlattr_inet_diag_req_compat.$(OBJEXT) +nlattr_inet_diag_req_compat_LDADD = $(LDADD) +nlattr_inet_diag_req_compat_DEPENDENCIES = libtests.a +nlattr_inet_diag_req_v2_SOURCES = nlattr_inet_diag_req_v2.c +nlattr_inet_diag_req_v2_OBJECTS = nlattr_inet_diag_req_v2.$(OBJEXT) +nlattr_inet_diag_req_v2_LDADD = $(LDADD) +nlattr_inet_diag_req_v2_DEPENDENCIES = libtests.a +nlattr_mdba_mdb_entry_SOURCES = nlattr_mdba_mdb_entry.c +nlattr_mdba_mdb_entry_OBJECTS = nlattr_mdba_mdb_entry.$(OBJEXT) +nlattr_mdba_mdb_entry_LDADD = $(LDADD) +nlattr_mdba_mdb_entry_DEPENDENCIES = libtests.a +nlattr_mdba_router_port_SOURCES = nlattr_mdba_router_port.c +nlattr_mdba_router_port_OBJECTS = nlattr_mdba_router_port.$(OBJEXT) +nlattr_mdba_router_port_LDADD = $(LDADD) +nlattr_mdba_router_port_DEPENDENCIES = libtests.a +nlattr_ndmsg_SOURCES = nlattr_ndmsg.c +nlattr_ndmsg_OBJECTS = nlattr_ndmsg.$(OBJEXT) +nlattr_ndmsg_LDADD = $(LDADD) +nlattr_ndmsg_DEPENDENCIES = libtests.a +nlattr_ndtmsg_SOURCES = nlattr_ndtmsg.c +nlattr_ndtmsg_OBJECTS = nlattr_ndtmsg.$(OBJEXT) +nlattr_ndtmsg_LDADD = $(LDADD) +nlattr_ndtmsg_DEPENDENCIES = libtests.a +nlattr_netconfmsg_SOURCES = nlattr_netconfmsg.c +nlattr_netconfmsg_OBJECTS = nlattr_netconfmsg.$(OBJEXT) +nlattr_netconfmsg_LDADD = $(LDADD) +nlattr_netconfmsg_DEPENDENCIES = libtests.a +nlattr_netlink_diag_msg_SOURCES = nlattr_netlink_diag_msg.c +nlattr_netlink_diag_msg_OBJECTS = nlattr_netlink_diag_msg.$(OBJEXT) +nlattr_netlink_diag_msg_LDADD = $(LDADD) +nlattr_netlink_diag_msg_DEPENDENCIES = libtests.a +nlattr_nlmsgerr_SOURCES = nlattr_nlmsgerr.c +nlattr_nlmsgerr_OBJECTS = nlattr_nlmsgerr.$(OBJEXT) +nlattr_nlmsgerr_LDADD = $(LDADD) +nlattr_nlmsgerr_DEPENDENCIES = libtests.a +nlattr_packet_diag_msg_SOURCES = nlattr_packet_diag_msg.c +nlattr_packet_diag_msg_OBJECTS = nlattr_packet_diag_msg.$(OBJEXT) +nlattr_packet_diag_msg_LDADD = $(LDADD) +nlattr_packet_diag_msg_DEPENDENCIES = libtests.a +nlattr_rtgenmsg_SOURCES = nlattr_rtgenmsg.c +nlattr_rtgenmsg_OBJECTS = nlattr_rtgenmsg.$(OBJEXT) +nlattr_rtgenmsg_LDADD = $(LDADD) +nlattr_rtgenmsg_DEPENDENCIES = libtests.a +nlattr_rtmsg_SOURCES = nlattr_rtmsg.c +nlattr_rtmsg_OBJECTS = nlattr_rtmsg.$(OBJEXT) +nlattr_rtmsg_LDADD = $(LDADD) +nlattr_rtmsg_DEPENDENCIES = libtests.a +nlattr_smc_diag_msg_SOURCES = nlattr_smc_diag_msg.c +nlattr_smc_diag_msg_OBJECTS = nlattr_smc_diag_msg.$(OBJEXT) +nlattr_smc_diag_msg_LDADD = $(LDADD) +nlattr_smc_diag_msg_DEPENDENCIES = libtests.a +nlattr_tc_stats_SOURCES = nlattr_tc_stats.c +nlattr_tc_stats_OBJECTS = nlattr_tc_stats.$(OBJEXT) +nlattr_tc_stats_LDADD = $(LDADD) +nlattr_tc_stats_DEPENDENCIES = libtests.a +nlattr_tca_stab_SOURCES = nlattr_tca_stab.c +nlattr_tca_stab_OBJECTS = nlattr_tca_stab.$(OBJEXT) +nlattr_tca_stab_LDADD = $(LDADD) +nlattr_tca_stab_DEPENDENCIES = libtests.a +nlattr_tcamsg_SOURCES = nlattr_tcamsg.c +nlattr_tcamsg_OBJECTS = nlattr_tcamsg.$(OBJEXT) +nlattr_tcamsg_LDADD = $(LDADD) +nlattr_tcamsg_DEPENDENCIES = libtests.a +nlattr_tcmsg_SOURCES = nlattr_tcmsg.c +nlattr_tcmsg_OBJECTS = nlattr_tcmsg.$(OBJEXT) +nlattr_tcmsg_LDADD = $(LDADD) +nlattr_tcmsg_DEPENDENCIES = libtests.a +nlattr_unix_diag_msg_SOURCES = nlattr_unix_diag_msg.c +nlattr_unix_diag_msg_OBJECTS = nlattr_unix_diag_msg.$(OBJEXT) +nlattr_unix_diag_msg_LDADD = $(LDADD) +nlattr_unix_diag_msg_DEPENDENCIES = libtests.a nsyscalls_SOURCES = nsyscalls.c nsyscalls_OBJECTS = nsyscalls.$(OBJEXT) nsyscalls_LDADD = $(LDADD) nsyscalls_DEPENDENCIES = libtests.a +nsyscalls_d_SOURCES = nsyscalls-d.c +nsyscalls_d_OBJECTS = nsyscalls-d.$(OBJEXT) +nsyscalls_d_LDADD = $(LDADD) +nsyscalls_d_DEPENDENCIES = libtests.a old_mmap_SOURCES = old_mmap.c old_mmap_OBJECTS = old_mmap.$(OBJEXT) old_mmap_LDADD = $(LDADD) old_mmap_DEPENDENCIES = libtests.a +old_mmap_P_SOURCES = old_mmap-P.c +old_mmap_P_OBJECTS = old_mmap-P.$(OBJEXT) +old_mmap_P_LDADD = $(LDADD) +old_mmap_P_DEPENDENCIES = libtests.a +old_mmap_Xabbrev_SOURCES = old_mmap-Xabbrev.c +old_mmap_Xabbrev_OBJECTS = old_mmap-Xabbrev.$(OBJEXT) +old_mmap_Xabbrev_LDADD = $(LDADD) +old_mmap_Xabbrev_DEPENDENCIES = libtests.a +old_mmap_Xraw_SOURCES = old_mmap-Xraw.c +old_mmap_Xraw_OBJECTS = old_mmap-Xraw.$(OBJEXT) +old_mmap_Xraw_LDADD = $(LDADD) +old_mmap_Xraw_DEPENDENCIES = libtests.a +old_mmap_Xverbose_SOURCES = old_mmap-Xverbose.c +old_mmap_Xverbose_OBJECTS = old_mmap-Xverbose.$(OBJEXT) +old_mmap_Xverbose_LDADD = $(LDADD) +old_mmap_Xverbose_DEPENDENCIES = libtests.a +old_mmap_v_none_SOURCES = old_mmap-v-none.c +old_mmap_v_none_OBJECTS = old_mmap-v-none.$(OBJEXT) +old_mmap_v_none_LDADD = $(LDADD) +old_mmap_v_none_DEPENDENCIES = libtests.a oldfstat_SOURCES = oldfstat.c oldfstat_OBJECTS = oldfstat.$(OBJEXT) oldfstat_LDADD = $(LDADD) @@ -1080,6 +1831,18 @@ oldselect_SOURCES = oldselect.c oldselect_OBJECTS = oldselect.$(OBJEXT) oldselect_LDADD = $(LDADD) oldselect_DEPENDENCIES = libtests.a +oldselect_P_SOURCES = oldselect-P.c +oldselect_P_OBJECTS = oldselect-P.$(OBJEXT) +oldselect_P_LDADD = $(LDADD) +oldselect_P_DEPENDENCIES = libtests.a +oldselect_efault_SOURCES = oldselect-efault.c +oldselect_efault_OBJECTS = oldselect-efault.$(OBJEXT) +oldselect_efault_LDADD = $(LDADD) +oldselect_efault_DEPENDENCIES = libtests.a +oldselect_efault_P_SOURCES = oldselect-efault-P.c +oldselect_efault_P_OBJECTS = oldselect-efault-P.$(OBJEXT) +oldselect_efault_P_LDADD = $(LDADD) +oldselect_efault_P_DEPENDENCIES = libtests.a oldstat_SOURCES = oldstat.c oldstat_OBJECTS = oldstat.$(OBJEXT) oldstat_LDADD = $(LDADD) @@ -1092,13 +1855,20 @@ openat_SOURCES = openat.c openat_OBJECTS = openat.$(OBJEXT) openat_LDADD = $(LDADD) openat_DEPENDENCIES = libtests.a +orphaned_process_group_SOURCES = orphaned_process_group.c +orphaned_process_group_OBJECTS = orphaned_process_group.$(OBJEXT) +orphaned_process_group_LDADD = $(LDADD) +orphaned_process_group_DEPENDENCIES = libtests.a +osf_utimes_SOURCES = osf_utimes.c +osf_utimes_OBJECTS = osf_utimes.$(OBJEXT) +osf_utimes_LDADD = $(LDADD) +osf_utimes_DEPENDENCIES = libtests.a pause_SOURCES = pause.c pause_OBJECTS = pause.$(OBJEXT) pause_LDADD = $(LDADD) pause_DEPENDENCIES = libtests.a pc_SOURCES = pc.c pc_OBJECTS = pc.$(OBJEXT) -am__DEPENDENCIES_1 = pc_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LDADD) perf_event_open_SOURCES = perf_event_open.c perf_event_open_OBJECTS = perf_event_open.$(OBJEXT) @@ -1117,6 +1887,22 @@ personality_SOURCES = personality.c personality_OBJECTS = personality.$(OBJEXT) personality_LDADD = $(LDADD) personality_DEPENDENCIES = libtests.a +personality_Xabbrev_SOURCES = personality-Xabbrev.c +personality_Xabbrev_OBJECTS = personality-Xabbrev.$(OBJEXT) +personality_Xabbrev_LDADD = $(LDADD) +personality_Xabbrev_DEPENDENCIES = libtests.a +personality_Xraw_SOURCES = personality-Xraw.c +personality_Xraw_OBJECTS = personality-Xraw.$(OBJEXT) +personality_Xraw_LDADD = $(LDADD) +personality_Xraw_DEPENDENCIES = libtests.a +personality_Xverbose_SOURCES = personality-Xverbose.c +personality_Xverbose_OBJECTS = personality-Xverbose.$(OBJEXT) +personality_Xverbose_LDADD = $(LDADD) +personality_Xverbose_DEPENDENCIES = libtests.a +pidfd_send_signal_SOURCES = pidfd_send_signal.c +pidfd_send_signal_OBJECTS = pidfd_send_signal.$(OBJEXT) +pidfd_send_signal_LDADD = $(LDADD) +pidfd_send_signal_DEPENDENCIES = libtests.a pipe_SOURCES = pipe.c pipe_OBJECTS = pipe.$(OBJEXT) pipe_LDADD = $(LDADD) @@ -1141,10 +1927,22 @@ poll_SOURCES = poll.c poll_OBJECTS = poll.$(OBJEXT) poll_LDADD = $(LDADD) poll_DEPENDENCIES = libtests.a +poll_P_SOURCES = poll-P.c +poll_P_OBJECTS = poll-P.$(OBJEXT) +poll_P_LDADD = $(LDADD) +poll_P_DEPENDENCIES = libtests.a ppoll_SOURCES = ppoll.c ppoll_OBJECTS = ppoll.$(OBJEXT) ppoll_LDADD = $(LDADD) ppoll_DEPENDENCIES = libtests.a +ppoll_P_SOURCES = ppoll-P.c +ppoll_P_OBJECTS = ppoll-P.$(OBJEXT) +ppoll_P_LDADD = $(LDADD) +ppoll_P_DEPENDENCIES = libtests.a +ppoll_v_SOURCES = ppoll-v.c +ppoll_v_OBJECTS = ppoll-v.$(OBJEXT) +ppoll_v_LDADD = $(LDADD) +ppoll_v_DEPENDENCIES = libtests.a prctl_arg2_intptr_SOURCES = prctl-arg2-intptr.c prctl_arg2_intptr_OBJECTS = prctl-arg2-intptr.$(OBJEXT) prctl_arg2_intptr_LDADD = $(LDADD) @@ -1177,6 +1975,10 @@ prctl_securebits_SOURCES = prctl-securebits.c prctl_securebits_OBJECTS = prctl-securebits.$(OBJEXT) prctl_securebits_LDADD = $(LDADD) prctl_securebits_DEPENDENCIES = libtests.a +prctl_spec_inject_SOURCES = prctl-spec-inject.c +prctl_spec_inject_OBJECTS = prctl-spec-inject.$(OBJEXT) +prctl_spec_inject_LDADD = $(LDADD) +prctl_spec_inject_DEPENDENCIES = libtests.a prctl_tid_address_SOURCES = prctl-tid_address.c prctl_tid_address_OBJECTS = prctl-tid_address.$(OBJEXT) prctl_tid_address_LDADD = $(LDADD) @@ -1206,10 +2008,51 @@ print_maxfd_SOURCES = print_maxfd.c print_maxfd_OBJECTS = print_maxfd.$(OBJEXT) print_maxfd_LDADD = $(LDADD) print_maxfd_DEPENDENCIES = libtests.a +printpath_umovestr_SOURCES = printpath-umovestr.c +printpath_umovestr_OBJECTS = printpath-umovestr.$(OBJEXT) +printpath_umovestr_LDADD = $(LDADD) +printpath_umovestr_DEPENDENCIES = libtests.a +printpath_umovestr_peekdata_SOURCES = printpath-umovestr-peekdata.c +printpath_umovestr_peekdata_OBJECTS = \ + printpath-umovestr-peekdata.$(OBJEXT) +printpath_umovestr_peekdata_LDADD = $(LDADD) +printpath_umovestr_peekdata_DEPENDENCIES = libtests.a +printpath_umovestr_undumpable_SOURCES = \ + printpath-umovestr-undumpable.c +printpath_umovestr_undumpable_OBJECTS = \ + printpath-umovestr-undumpable.$(OBJEXT) +printpath_umovestr_undumpable_LDADD = $(LDADD) +printpath_umovestr_undumpable_DEPENDENCIES = libtests.a +printsignal_Xabbrev_SOURCES = printsignal-Xabbrev.c +printsignal_Xabbrev_OBJECTS = printsignal-Xabbrev.$(OBJEXT) +printsignal_Xabbrev_LDADD = $(LDADD) +printsignal_Xabbrev_DEPENDENCIES = libtests.a +printsignal_Xraw_SOURCES = printsignal-Xraw.c +printsignal_Xraw_OBJECTS = printsignal-Xraw.$(OBJEXT) +printsignal_Xraw_LDADD = $(LDADD) +printsignal_Xraw_DEPENDENCIES = libtests.a +printsignal_Xverbose_SOURCES = printsignal-Xverbose.c +printsignal_Xverbose_OBJECTS = printsignal-Xverbose.$(OBJEXT) +printsignal_Xverbose_LDADD = $(LDADD) +printsignal_Xverbose_DEPENDENCIES = libtests.a printstr_SOURCES = printstr.c printstr_OBJECTS = printstr.$(OBJEXT) printstr_LDADD = $(LDADD) printstr_DEPENDENCIES = libtests.a +printstrn_umoven_SOURCES = printstrn-umoven.c +printstrn_umoven_OBJECTS = printstrn-umoven.$(OBJEXT) +printstrn_umoven_LDADD = $(LDADD) +printstrn_umoven_DEPENDENCIES = libtests.a +printstrn_umoven_peekdata_SOURCES = printstrn-umoven-peekdata.c +printstrn_umoven_peekdata_OBJECTS = \ + printstrn-umoven-peekdata.$(OBJEXT) +printstrn_umoven_peekdata_LDADD = $(LDADD) +printstrn_umoven_peekdata_DEPENDENCIES = libtests.a +printstrn_umoven_undumpable_SOURCES = printstrn-umoven-undumpable.c +printstrn_umoven_undumpable_OBJECTS = \ + printstrn-umoven-undumpable.$(OBJEXT) +printstrn_umoven_undumpable_LDADD = $(LDADD) +printstrn_umoven_undumpable_DEPENDENCIES = libtests.a prlimit64_SOURCES = prlimit64.c prlimit64_OBJECTS = prlimit64.$(OBJEXT) prlimit64_LDADD = $(LDADD) @@ -1230,6 +2073,10 @@ ptrace_SOURCES = ptrace.c ptrace_OBJECTS = ptrace.$(OBJEXT) ptrace_LDADD = $(LDADD) ptrace_DEPENDENCIES = libtests.a +ptrace_syscall_info_SOURCES = ptrace_syscall_info.c +ptrace_syscall_info_OBJECTS = ptrace_syscall_info.$(OBJEXT) +ptrace_syscall_info_LDADD = $(LDADD) +ptrace_syscall_info_DEPENDENCIES = libtests.a pwritev_SOURCES = pwritev.c pwritev_OBJECTS = pwritev-pwritev.$(OBJEXT) pwritev_LDADD = $(LDADD) @@ -1258,6 +2105,26 @@ quotactl_SOURCES = quotactl.c quotactl_OBJECTS = quotactl.$(OBJEXT) quotactl_LDADD = $(LDADD) quotactl_DEPENDENCIES = libtests.a +quotactl_Xabbrev_SOURCES = quotactl-Xabbrev.c +quotactl_Xabbrev_OBJECTS = quotactl-Xabbrev.$(OBJEXT) +quotactl_Xabbrev_LDADD = $(LDADD) +quotactl_Xabbrev_DEPENDENCIES = libtests.a +quotactl_Xraw_SOURCES = quotactl-Xraw.c +quotactl_Xraw_OBJECTS = quotactl-Xraw.$(OBJEXT) +quotactl_Xraw_LDADD = $(LDADD) +quotactl_Xraw_DEPENDENCIES = libtests.a +quotactl_Xverbose_SOURCES = quotactl-Xverbose.c +quotactl_Xverbose_OBJECTS = quotactl-Xverbose.$(OBJEXT) +quotactl_Xverbose_LDADD = $(LDADD) +quotactl_Xverbose_DEPENDENCIES = libtests.a +quotactl_success_SOURCES = quotactl-success.c +quotactl_success_OBJECTS = quotactl-success.$(OBJEXT) +quotactl_success_LDADD = $(LDADD) +quotactl_success_DEPENDENCIES = libtests.a +quotactl_success_v_SOURCES = quotactl-success-v.c +quotactl_success_v_OBJECTS = quotactl-success-v.$(OBJEXT) +quotactl_success_v_LDADD = $(LDADD) +quotactl_success_v_DEPENDENCIES = libtests.a quotactl_v_SOURCES = quotactl-v.c quotactl_v_OBJECTS = quotactl-v.$(OBJEXT) quotactl_v_LDADD = $(LDADD) @@ -1266,6 +2133,14 @@ quotactl_xfs_SOURCES = quotactl-xfs.c quotactl_xfs_OBJECTS = quotactl-xfs.$(OBJEXT) quotactl_xfs_LDADD = $(LDADD) quotactl_xfs_DEPENDENCIES = libtests.a +quotactl_xfs_success_SOURCES = quotactl-xfs-success.c +quotactl_xfs_success_OBJECTS = quotactl-xfs-success.$(OBJEXT) +quotactl_xfs_success_LDADD = $(LDADD) +quotactl_xfs_success_DEPENDENCIES = libtests.a +quotactl_xfs_success_v_SOURCES = quotactl-xfs-success-v.c +quotactl_xfs_success_v_OBJECTS = quotactl-xfs-success-v.$(OBJEXT) +quotactl_xfs_success_v_LDADD = $(LDADD) +quotactl_xfs_success_v_DEPENDENCIES = libtests.a quotactl_xfs_v_SOURCES = quotactl-xfs-v.c quotactl_xfs_v_OBJECTS = quotactl-xfs-v.$(OBJEXT) quotactl_xfs_v_LDADD = $(LDADD) @@ -1318,6 +2193,19 @@ remap_file_pages_SOURCES = remap_file_pages.c remap_file_pages_OBJECTS = remap_file_pages.$(OBJEXT) remap_file_pages_LDADD = $(LDADD) remap_file_pages_DEPENDENCIES = libtests.a +remap_file_pages_Xabbrev_SOURCES = remap_file_pages-Xabbrev.c +remap_file_pages_Xabbrev_OBJECTS = remap_file_pages-Xabbrev.$(OBJEXT) +remap_file_pages_Xabbrev_LDADD = $(LDADD) +remap_file_pages_Xabbrev_DEPENDENCIES = libtests.a +remap_file_pages_Xraw_SOURCES = remap_file_pages-Xraw.c +remap_file_pages_Xraw_OBJECTS = remap_file_pages-Xraw.$(OBJEXT) +remap_file_pages_Xraw_LDADD = $(LDADD) +remap_file_pages_Xraw_DEPENDENCIES = libtests.a +remap_file_pages_Xverbose_SOURCES = remap_file_pages-Xverbose.c +remap_file_pages_Xverbose_OBJECTS = \ + remap_file_pages-Xverbose.$(OBJEXT) +remap_file_pages_Xverbose_LDADD = $(LDADD) +remap_file_pages_Xverbose_DEPENDENCIES = libtests.a rename_SOURCES = rename.c rename_OBJECTS = rename.$(OBJEXT) rename_LDADD = $(LDADD) @@ -1338,10 +2226,18 @@ restart_syscall_SOURCES = restart_syscall.c restart_syscall_OBJECTS = restart_syscall.$(OBJEXT) restart_syscall_LDADD = $(LDADD) restart_syscall_DEPENDENCIES = libtests.a +riscv_flush_icache_SOURCES = riscv_flush_icache.c +riscv_flush_icache_OBJECTS = riscv_flush_icache.$(OBJEXT) +riscv_flush_icache_LDADD = $(LDADD) +riscv_flush_icache_DEPENDENCIES = libtests.a rmdir_SOURCES = rmdir.c rmdir_OBJECTS = rmdir.$(OBJEXT) rmdir_LDADD = $(LDADD) rmdir_DEPENDENCIES = libtests.a +rt_sigaction_SOURCES = rt_sigaction.c +rt_sigaction_OBJECTS = rt_sigaction.$(OBJEXT) +rt_sigaction_LDADD = $(LDADD) +rt_sigaction_DEPENDENCIES = libtests.a rt_sigpending_SOURCES = rt_sigpending.c rt_sigpending_OBJECTS = rt_sigpending.$(OBJEXT) rt_sigpending_LDADD = $(LDADD) @@ -1354,6 +2250,10 @@ rt_sigqueueinfo_SOURCES = rt_sigqueueinfo.c rt_sigqueueinfo_OBJECTS = rt_sigqueueinfo.$(OBJEXT) rt_sigqueueinfo_LDADD = $(LDADD) rt_sigqueueinfo_DEPENDENCIES = libtests.a +rt_sigreturn_SOURCES = rt_sigreturn.c +rt_sigreturn_OBJECTS = rt_sigreturn.$(OBJEXT) +rt_sigreturn_LDADD = $(LDADD) +rt_sigreturn_DEPENDENCIES = libtests.a rt_sigsuspend_SOURCES = rt_sigsuspend.c rt_sigsuspend_OBJECTS = rt_sigsuspend.$(OBJEXT) rt_sigsuspend_LDADD = $(LDADD) @@ -1366,6 +2266,34 @@ rt_tgsigqueueinfo_SOURCES = rt_tgsigqueueinfo.c rt_tgsigqueueinfo_OBJECTS = rt_tgsigqueueinfo.$(OBJEXT) rt_tgsigqueueinfo_LDADD = $(LDADD) rt_tgsigqueueinfo_DEPENDENCIES = libtests.a +run_expect_termsig_SOURCES = run_expect_termsig.c +run_expect_termsig_OBJECTS = run_expect_termsig.$(OBJEXT) +run_expect_termsig_LDADD = $(LDADD) +run_expect_termsig_DEPENDENCIES = libtests.a +s390_guarded_storage_SOURCES = s390_guarded_storage.c +s390_guarded_storage_OBJECTS = s390_guarded_storage.$(OBJEXT) +s390_guarded_storage_LDADD = $(LDADD) +s390_guarded_storage_DEPENDENCIES = libtests.a +s390_guarded_storage_v_SOURCES = s390_guarded_storage-v.c +s390_guarded_storage_v_OBJECTS = s390_guarded_storage-v.$(OBJEXT) +s390_guarded_storage_v_LDADD = $(LDADD) +s390_guarded_storage_v_DEPENDENCIES = libtests.a +s390_pci_mmio_read_write_SOURCES = s390_pci_mmio_read_write.c +s390_pci_mmio_read_write_OBJECTS = s390_pci_mmio_read_write.$(OBJEXT) +s390_pci_mmio_read_write_LDADD = $(LDADD) +s390_pci_mmio_read_write_DEPENDENCIES = libtests.a +s390_runtime_instr_SOURCES = s390_runtime_instr.c +s390_runtime_instr_OBJECTS = s390_runtime_instr.$(OBJEXT) +s390_runtime_instr_LDADD = $(LDADD) +s390_runtime_instr_DEPENDENCIES = libtests.a +s390_sthyi_SOURCES = s390_sthyi.c +s390_sthyi_OBJECTS = s390_sthyi.$(OBJEXT) +s390_sthyi_LDADD = $(LDADD) +s390_sthyi_DEPENDENCIES = libtests.a +s390_sthyi_v_SOURCES = s390_sthyi-v.c +s390_sthyi_v_OBJECTS = s390_sthyi-v.$(OBJEXT) +s390_sthyi_v_LDADD = $(LDADD) +s390_sthyi_v_DEPENDENCIES = libtests.a sched_get_priority_mxx_SOURCES = sched_get_priority_mxx.c sched_get_priority_mxx_OBJECTS = sched_get_priority_mxx.$(OBJEXT) sched_get_priority_mxx_LDADD = $(LDADD) @@ -1410,10 +2338,18 @@ seccomp_strict_SOURCES = seccomp-strict.c seccomp_strict_OBJECTS = seccomp-strict.$(OBJEXT) seccomp_strict_LDADD = $(LDADD) seccomp_strict_DEPENDENCIES = libtests.a +seccomp_get_action_avail_SOURCES = seccomp_get_action_avail.c +seccomp_get_action_avail_OBJECTS = seccomp_get_action_avail.$(OBJEXT) +seccomp_get_action_avail_LDADD = $(LDADD) +seccomp_get_action_avail_DEPENDENCIES = libtests.a select_SOURCES = select.c select_OBJECTS = select.$(OBJEXT) select_LDADD = $(LDADD) select_DEPENDENCIES = libtests.a +select_P_SOURCES = select-P.c +select_P_OBJECTS = select-P.$(OBJEXT) +select_P_LDADD = $(LDADD) +select_P_DEPENDENCIES = libtests.a semop_SOURCES = semop.c semop_OBJECTS = semop.$(OBJEXT) semop_LDADD = $(LDADD) @@ -1434,6 +2370,14 @@ set_ptracer_any_SOURCES = set_ptracer_any.c set_ptracer_any_OBJECTS = set_ptracer_any.$(OBJEXT) set_ptracer_any_LDADD = $(LDADD) set_ptracer_any_DEPENDENCIES = libtests.a +set_sigblock_SOURCES = set_sigblock.c +set_sigblock_OBJECTS = set_sigblock.$(OBJEXT) +set_sigblock_LDADD = $(LDADD) +set_sigblock_DEPENDENCIES = libtests.a +set_sigign_SOURCES = set_sigign.c +set_sigign_OBJECTS = set_sigign.$(OBJEXT) +set_sigign_LDADD = $(LDADD) +set_sigign_DEPENDENCIES = libtests.a setdomainname_SOURCES = setdomainname.c setdomainname_OBJECTS = setdomainname.$(OBJEXT) setdomainname_LDADD = $(LDADD) @@ -1514,6 +2458,18 @@ setrlimit_SOURCES = setrlimit.c setrlimit_OBJECTS = setrlimit.$(OBJEXT) setrlimit_LDADD = $(LDADD) setrlimit_DEPENDENCIES = libtests.a +setrlimit_Xabbrev_SOURCES = setrlimit-Xabbrev.c +setrlimit_Xabbrev_OBJECTS = setrlimit-Xabbrev.$(OBJEXT) +setrlimit_Xabbrev_LDADD = $(LDADD) +setrlimit_Xabbrev_DEPENDENCIES = libtests.a +setrlimit_Xraw_SOURCES = setrlimit-Xraw.c +setrlimit_Xraw_OBJECTS = setrlimit-Xraw.$(OBJEXT) +setrlimit_Xraw_LDADD = $(LDADD) +setrlimit_Xraw_DEPENDENCIES = libtests.a +setrlimit_Xverbose_SOURCES = setrlimit-Xverbose.c +setrlimit_Xverbose_OBJECTS = setrlimit-Xverbose.$(OBJEXT) +setrlimit_Xverbose_LDADD = $(LDADD) +setrlimit_Xverbose_DEPENDENCIES = libtests.a setuid_SOURCES = setuid.c setuid_OBJECTS = setuid.$(OBJEXT) setuid_LDADD = $(LDADD) @@ -1542,6 +2498,10 @@ siginfo_SOURCES = siginfo.c siginfo_OBJECTS = siginfo.$(OBJEXT) siginfo_LDADD = $(LDADD) siginfo_DEPENDENCIES = libtests.a +signal_SOURCES = signal.c +signal_OBJECTS = signal.$(OBJEXT) +signal_LDADD = $(LDADD) +signal_DEPENDENCIES = libtests.a signal_receive_SOURCES = signal_receive.c signal_receive_OBJECTS = signal_receive.$(OBJEXT) signal_receive_LDADD = $(LDADD) @@ -1550,18 +2510,90 @@ signalfd4_SOURCES = signalfd4.c signalfd4_OBJECTS = signalfd4.$(OBJEXT) signalfd4_LDADD = $(LDADD) signalfd4_DEPENDENCIES = libtests.a +sigpending_SOURCES = sigpending.c +sigpending_OBJECTS = sigpending.$(OBJEXT) +sigpending_LDADD = $(LDADD) +sigpending_DEPENDENCIES = libtests.a +sigprocmask_SOURCES = sigprocmask.c +sigprocmask_OBJECTS = sigprocmask.$(OBJEXT) +sigprocmask_LDADD = $(LDADD) +sigprocmask_DEPENDENCIES = libtests.a sigreturn_SOURCES = sigreturn.c sigreturn_OBJECTS = sigreturn.$(OBJEXT) sigreturn_LDADD = $(LDADD) sigreturn_DEPENDENCIES = libtests.a +sigsuspend_SOURCES = sigsuspend.c +sigsuspend_OBJECTS = sigsuspend.$(OBJEXT) +sigsuspend_LDADD = $(LDADD) +sigsuspend_DEPENDENCIES = libtests.a sleep_SOURCES = sleep.c sleep_OBJECTS = sleep.$(OBJEXT) sleep_LDADD = $(LDADD) sleep_DEPENDENCIES = libtests.a +so_error_SOURCES = so_error.c +so_error_OBJECTS = so_error.$(OBJEXT) +so_error_LDADD = $(LDADD) +so_error_DEPENDENCIES = libtests.a +so_linger_SOURCES = so_linger.c +so_linger_OBJECTS = so_linger.$(OBJEXT) +so_linger_LDADD = $(LDADD) +so_linger_DEPENDENCIES = libtests.a +so_peercred_SOURCES = so_peercred.c +so_peercred_OBJECTS = so_peercred.$(OBJEXT) +so_peercred_LDADD = $(LDADD) +so_peercred_DEPENDENCIES = libtests.a +so_peercred_Xabbrev_SOURCES = so_peercred-Xabbrev.c +so_peercred_Xabbrev_OBJECTS = so_peercred-Xabbrev.$(OBJEXT) +so_peercred_Xabbrev_LDADD = $(LDADD) +so_peercred_Xabbrev_DEPENDENCIES = libtests.a +so_peercred_Xraw_SOURCES = so_peercred-Xraw.c +so_peercred_Xraw_OBJECTS = so_peercred-Xraw.$(OBJEXT) +so_peercred_Xraw_LDADD = $(LDADD) +so_peercred_Xraw_DEPENDENCIES = libtests.a +so_peercred_Xverbose_SOURCES = so_peercred-Xverbose.c +so_peercred_Xverbose_OBJECTS = so_peercred-Xverbose.$(OBJEXT) +so_peercred_Xverbose_LDADD = $(LDADD) +so_peercred_Xverbose_DEPENDENCIES = libtests.a +sock_filter_v_SOURCES = sock_filter-v.c +sock_filter_v_OBJECTS = sock_filter-v.$(OBJEXT) +sock_filter_v_LDADD = $(LDADD) +sock_filter_v_DEPENDENCIES = libtests.a +sock_filter_v_Xabbrev_SOURCES = sock_filter-v-Xabbrev.c +sock_filter_v_Xabbrev_OBJECTS = sock_filter-v-Xabbrev.$(OBJEXT) +sock_filter_v_Xabbrev_LDADD = $(LDADD) +sock_filter_v_Xabbrev_DEPENDENCIES = libtests.a +sock_filter_v_Xraw_SOURCES = sock_filter-v-Xraw.c +sock_filter_v_Xraw_OBJECTS = sock_filter-v-Xraw.$(OBJEXT) +sock_filter_v_Xraw_LDADD = $(LDADD) +sock_filter_v_Xraw_DEPENDENCIES = libtests.a +sock_filter_v_Xverbose_SOURCES = sock_filter-v-Xverbose.c +sock_filter_v_Xverbose_OBJECTS = sock_filter-v-Xverbose.$(OBJEXT) +sock_filter_v_Xverbose_LDADD = $(LDADD) +sock_filter_v_Xverbose_DEPENDENCIES = libtests.a +sockaddr_xlat_Xabbrev_SOURCES = sockaddr_xlat-Xabbrev.c +sockaddr_xlat_Xabbrev_OBJECTS = sockaddr_xlat-Xabbrev.$(OBJEXT) +sockaddr_xlat_Xabbrev_LDADD = $(LDADD) +sockaddr_xlat_Xabbrev_DEPENDENCIES = libtests.a +sockaddr_xlat_Xraw_SOURCES = sockaddr_xlat-Xraw.c +sockaddr_xlat_Xraw_OBJECTS = sockaddr_xlat-Xraw.$(OBJEXT) +sockaddr_xlat_Xraw_LDADD = $(LDADD) +sockaddr_xlat_Xraw_DEPENDENCIES = libtests.a +sockaddr_xlat_Xverbose_SOURCES = sockaddr_xlat-Xverbose.c +sockaddr_xlat_Xverbose_OBJECTS = sockaddr_xlat-Xverbose.$(OBJEXT) +sockaddr_xlat_Xverbose_LDADD = $(LDADD) +sockaddr_xlat_Xverbose_DEPENDENCIES = libtests.a socketcall_SOURCES = socketcall.c socketcall_OBJECTS = socketcall.$(OBJEXT) socketcall_LDADD = $(LDADD) socketcall_DEPENDENCIES = libtests.a +sockopt_sol_netlink_SOURCES = sockopt-sol_netlink.c +sockopt_sol_netlink_OBJECTS = sockopt-sol_netlink.$(OBJEXT) +sockopt_sol_netlink_LDADD = $(LDADD) +sockopt_sol_netlink_DEPENDENCIES = libtests.a +sockopt_timestamp_SOURCES = sockopt-timestamp.c +sockopt_timestamp_OBJECTS = sockopt-timestamp.$(OBJEXT) +sockopt_timestamp_LDADD = $(LDADD) +sockopt_timestamp_DEPENDENCIES = libtests.a splice_SOURCES = splice.c splice_OBJECTS = splice.$(OBJEXT) splice_LDADD = $(LDADD) @@ -1572,6 +2604,14 @@ am_stack_fcall_OBJECTS = stack-fcall.$(OBJEXT) stack-fcall-0.$(OBJEXT) \ stack_fcall_OBJECTS = $(am_stack_fcall_OBJECTS) stack_fcall_LDADD = $(LDADD) stack_fcall_DEPENDENCIES = libtests.a +am_stack_fcall_mangled_OBJECTS = stack-fcall-mangled.$(OBJEXT) \ + stack-fcall-mangled-0.$(OBJEXT) \ + stack-fcall-mangled-1.$(OBJEXT) \ + stack-fcall-mangled-2.$(OBJEXT) \ + stack-fcall-mangled-3.$(OBJEXT) +stack_fcall_mangled_OBJECTS = $(am_stack_fcall_mangled_OBJECTS) +stack_fcall_mangled_LDADD = $(LDADD) +stack_fcall_mangled_DEPENDENCIES = libtests.a stat_SOURCES = stat.c stat_OBJECTS = stat.$(OBJEXT) stat_LDADD = $(LDADD) @@ -1588,10 +2628,18 @@ statfs64_SOURCES = statfs64.c statfs64_OBJECTS = statfs64.$(OBJEXT) statfs64_LDADD = $(LDADD) statfs64_DEPENDENCIES = libtests.a +statx_SOURCES = statx.c +statx_OBJECTS = statx.$(OBJEXT) +statx_LDADD = $(LDADD) +statx_DEPENDENCIES = libtests.a swap_SOURCES = swap.c swap_OBJECTS = swap.$(OBJEXT) swap_LDADD = $(LDADD) swap_DEPENDENCIES = libtests.a +sxetmask_SOURCES = sxetmask.c +sxetmask_OBJECTS = sxetmask.$(OBJEXT) +sxetmask_LDADD = $(LDADD) +sxetmask_DEPENDENCIES = libtests.a symlink_SOURCES = symlink.c symlink_OBJECTS = symlink.$(OBJEXT) symlink_LDADD = $(LDADD) @@ -1626,7 +2674,7 @@ tee_LDADD = $(LDADD) tee_DEPENDENCIES = libtests.a threads_execve_SOURCES = threads-execve.c threads_execve_OBJECTS = threads-execve.$(OBJEXT) -threads_execve_DEPENDENCIES = $(LDADD) +threads_execve_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LDADD) time_SOURCES = time.c time_OBJECTS = time.$(OBJEXT) time_LDADD = $(LDADD) @@ -1645,7 +2693,7 @@ timerfd_xettime_LDADD = $(LDADD) timerfd_xettime_DEPENDENCIES = libtests.a times_SOURCES = times.c times_OBJECTS = times.$(OBJEXT) -times_DEPENDENCIES = $(LDADD) +times_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LDADD) times_fail_SOURCES = times-fail.c times_fail_OBJECTS = times-fail.$(OBJEXT) times_fail_LDADD = $(LDADD) @@ -1702,6 +2750,10 @@ uname_SOURCES = uname.c uname_OBJECTS = uname.$(OBJEXT) uname_LDADD = $(LDADD) uname_DEPENDENCIES = libtests.a +unblock_reset_raise_SOURCES = unblock_reset_raise.c +unblock_reset_raise_OBJECTS = unblock_reset_raise.$(OBJEXT) +unblock_reset_raise_LDADD = $(LDADD) +unblock_reset_raise_DEPENDENCIES = libtests.a unix_pair_send_recv_SOURCES = unix-pair-send-recv.c unix_pair_send_recv_OBJECTS = unix-pair-send-recv.$(OBJEXT) unix_pair_send_recv_LDADD = $(LDADD) @@ -1739,6 +2791,18 @@ utimensat_SOURCES = utimensat.c utimensat_OBJECTS = utimensat.$(OBJEXT) utimensat_LDADD = $(LDADD) utimensat_DEPENDENCIES = libtests.a +utimensat_Xabbrev_SOURCES = utimensat-Xabbrev.c +utimensat_Xabbrev_OBJECTS = utimensat-Xabbrev.$(OBJEXT) +utimensat_Xabbrev_LDADD = $(LDADD) +utimensat_Xabbrev_DEPENDENCIES = libtests.a +utimensat_Xraw_SOURCES = utimensat-Xraw.c +utimensat_Xraw_OBJECTS = utimensat-Xraw.$(OBJEXT) +utimensat_Xraw_LDADD = $(LDADD) +utimensat_Xraw_DEPENDENCIES = libtests.a +utimensat_Xverbose_SOURCES = utimensat-Xverbose.c +utimensat_Xverbose_OBJECTS = utimensat-Xverbose.$(OBJEXT) +utimensat_Xverbose_LDADD = $(LDADD) +utimensat_Xverbose_DEPENDENCIES = libtests.a utimes_SOURCES = utimes.c utimes_OBJECTS = utimes.$(OBJEXT) utimes_LDADD = $(LDADD) @@ -1787,6 +2851,10 @@ xet_robust_list_SOURCES = xet_robust_list.c xet_robust_list_OBJECTS = xet_robust_list.$(OBJEXT) xet_robust_list_LDADD = $(LDADD) xet_robust_list_DEPENDENCIES = libtests.a +xet_thread_area_x86_SOURCES = xet_thread_area_x86.c +xet_thread_area_x86_OBJECTS = xet_thread_area_x86.$(OBJEXT) +xet_thread_area_x86_LDADD = $(LDADD) +xet_thread_area_x86_DEPENDENCIES = libtests.a xetitimer_SOURCES = xetitimer.c xetitimer_OBJECTS = xetitimer.$(OBJEXT) xetitimer_LDADD = $(LDADD) @@ -1803,6 +2871,10 @@ xettimeofday_SOURCES = xettimeofday.c xettimeofday_OBJECTS = xettimeofday.$(OBJEXT) xettimeofday_LDADD = $(LDADD) xettimeofday_DEPENDENCIES = libtests.a +zeroargc_SOURCES = zeroargc.c +zeroargc_OBJECTS = zeroargc.$(OBJEXT) +zeroargc_LDADD = $(LDADD) +zeroargc_DEPENDENCIES = libtests.a AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -1817,7 +2889,402 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/_newselect-P.Po \ + ./$(DEPDIR)/_newselect.Po ./$(DEPDIR)/accept.Po \ + ./$(DEPDIR)/accept4.Po ./$(DEPDIR)/access.Po \ + ./$(DEPDIR)/acct.Po ./$(DEPDIR)/add_key.Po \ + ./$(DEPDIR)/adjtimex.Po ./$(DEPDIR)/aio.Po \ + ./$(DEPDIR)/aio_pgetevents.Po ./$(DEPDIR)/alarm.Po \ + ./$(DEPDIR)/answer.Po ./$(DEPDIR)/attach-f-p-cmd.Po \ + ./$(DEPDIR)/attach-f-p.Po ./$(DEPDIR)/attach-p-cmd-cmd.Po \ + ./$(DEPDIR)/attach-p-cmd-p.Po \ + ./$(DEPDIR)/block_reset_raise_run.Po \ + ./$(DEPDIR)/bpf-obj_get_info_by_fd-prog-v.Po \ + ./$(DEPDIR)/bpf-obj_get_info_by_fd-prog.Po \ + ./$(DEPDIR)/bpf-obj_get_info_by_fd-v.Po \ + ./$(DEPDIR)/bpf-obj_get_info_by_fd.Po \ + ./$(DEPDIR)/bpf-success-v.Po ./$(DEPDIR)/bpf-success.Po \ + ./$(DEPDIR)/bpf-v.Po ./$(DEPDIR)/bpf.Po ./$(DEPDIR)/brk.Po \ + ./$(DEPDIR)/btrfs.Po ./$(DEPDIR)/caps-abbrev.Po \ + ./$(DEPDIR)/caps.Po ./$(DEPDIR)/check_sigblock.Po \ + ./$(DEPDIR)/check_sigign.Po ./$(DEPDIR)/chmod.Po \ + ./$(DEPDIR)/chown.Po ./$(DEPDIR)/chown32.Po \ + ./$(DEPDIR)/chroot.Po ./$(DEPDIR)/clock_adjtime.Po \ + ./$(DEPDIR)/clock_nanosleep.Po ./$(DEPDIR)/clock_xettime.Po \ + ./$(DEPDIR)/clone_parent.Po ./$(DEPDIR)/clone_ptrace.Po \ + ./$(DEPDIR)/copy_file_range.Po ./$(DEPDIR)/count-f.Po \ + ./$(DEPDIR)/creat.Po ./$(DEPDIR)/delay.Po \ + ./$(DEPDIR)/delete_module.Po ./$(DEPDIR)/dev-yy.Po \ + ./$(DEPDIR)/dup.Po ./$(DEPDIR)/dup2.Po ./$(DEPDIR)/dup3.Po \ + ./$(DEPDIR)/epoll_create.Po ./$(DEPDIR)/epoll_create1.Po \ + ./$(DEPDIR)/epoll_ctl.Po ./$(DEPDIR)/epoll_pwait.Po \ + ./$(DEPDIR)/epoll_wait.Po ./$(DEPDIR)/erestartsys.Po \ + ./$(DEPDIR)/eventfd.Po ./$(DEPDIR)/execve-v.Po \ + ./$(DEPDIR)/execve.Po ./$(DEPDIR)/execveat-v.Po \ + ./$(DEPDIR)/execveat.Po ./$(DEPDIR)/faccessat.Po \ + ./$(DEPDIR)/fadvise64.Po ./$(DEPDIR)/fadvise64_64.Po \ + ./$(DEPDIR)/fallocate.Po ./$(DEPDIR)/fanotify_init.Po \ + ./$(DEPDIR)/fanotify_mark-Xabbrev.Po \ + ./$(DEPDIR)/fanotify_mark-Xraw.Po \ + ./$(DEPDIR)/fanotify_mark-Xverbose.Po \ + ./$(DEPDIR)/fanotify_mark.Po ./$(DEPDIR)/fchdir.Po \ + ./$(DEPDIR)/fchmod.Po ./$(DEPDIR)/fchmodat.Po \ + ./$(DEPDIR)/fchown.Po ./$(DEPDIR)/fchown32.Po \ + ./$(DEPDIR)/fchownat.Po ./$(DEPDIR)/fcntl.Po \ + ./$(DEPDIR)/fcntl64.Po ./$(DEPDIR)/fdatasync.Po \ + ./$(DEPDIR)/fflush.Po ./$(DEPDIR)/file_handle.Po \ + ./$(DEPDIR)/file_ioctl.Po ./$(DEPDIR)/filter-unavailable.Po \ + ./$(DEPDIR)/finit_module.Po ./$(DEPDIR)/flock.Po \ + ./$(DEPDIR)/fork-f.Po ./$(DEPDIR)/fstat-Xabbrev.Po \ + ./$(DEPDIR)/fstat-Xraw.Po ./$(DEPDIR)/fstat-Xverbose.Po \ + ./$(DEPDIR)/fstat.Po ./$(DEPDIR)/fstat64-Xabbrev.Po \ + ./$(DEPDIR)/fstat64-Xraw.Po ./$(DEPDIR)/fstat64-Xverbose.Po \ + ./$(DEPDIR)/fstat64-fstat64.Po \ + ./$(DEPDIR)/fstatat64-fstatat64.Po ./$(DEPDIR)/fstatfs.Po \ + ./$(DEPDIR)/fstatfs64.Po ./$(DEPDIR)/fsync-y.Po \ + ./$(DEPDIR)/fsync.Po ./$(DEPDIR)/ftruncate.Po \ + ./$(DEPDIR)/ftruncate64-ftruncate64.Po ./$(DEPDIR)/futex.Po \ + ./$(DEPDIR)/futimesat.Po ./$(DEPDIR)/get_mempolicy.Po \ + ./$(DEPDIR)/getcpu.Po ./$(DEPDIR)/getcwd.Po \ + ./$(DEPDIR)/getdents.Po ./$(DEPDIR)/getdents64.Po \ + ./$(DEPDIR)/getegid.Po ./$(DEPDIR)/getegid32.Po \ + ./$(DEPDIR)/geteuid.Po ./$(DEPDIR)/geteuid32.Po \ + ./$(DEPDIR)/getgid.Po ./$(DEPDIR)/getgid32.Po \ + ./$(DEPDIR)/getgroups.Po ./$(DEPDIR)/getgroups32.Po \ + ./$(DEPDIR)/getpeername.Po ./$(DEPDIR)/getpgrp.Po \ + ./$(DEPDIR)/getpid.Po ./$(DEPDIR)/getppid.Po \ + ./$(DEPDIR)/getrandom.Po ./$(DEPDIR)/getresgid.Po \ + ./$(DEPDIR)/getresgid32.Po ./$(DEPDIR)/getresuid.Po \ + ./$(DEPDIR)/getresuid32.Po ./$(DEPDIR)/getrlimit.Po \ + ./$(DEPDIR)/getrusage.Po ./$(DEPDIR)/getsid.Po \ + ./$(DEPDIR)/getsockname.Po ./$(DEPDIR)/gettid.Po \ + ./$(DEPDIR)/getuid.Po ./$(DEPDIR)/getuid32.Po \ + ./$(DEPDIR)/getxxid.Po ./$(DEPDIR)/group_req.Po \ + ./$(DEPDIR)/inet-cmsg.Po ./$(DEPDIR)/init_module.Po \ + ./$(DEPDIR)/inject-nf.Po ./$(DEPDIR)/inotify.Po \ + ./$(DEPDIR)/inotify_init1.Po ./$(DEPDIR)/int_0x80.Po \ + ./$(DEPDIR)/io_uring_enter.Po ./$(DEPDIR)/io_uring_register.Po \ + ./$(DEPDIR)/io_uring_setup.Po ./$(DEPDIR)/ioctl.Po \ + ./$(DEPDIR)/ioctl_block.Po ./$(DEPDIR)/ioctl_dm-v.Po \ + ./$(DEPDIR)/ioctl_dm.Po ./$(DEPDIR)/ioctl_evdev-success-v.Po \ + ./$(DEPDIR)/ioctl_evdev-success.Po \ + ./$(DEPDIR)/ioctl_evdev-v.Po ./$(DEPDIR)/ioctl_evdev.Po \ + ./$(DEPDIR)/ioctl_inotify.Po ./$(DEPDIR)/ioctl_kvm_run-v.Po \ + ./$(DEPDIR)/ioctl_kvm_run.Po \ + ./$(DEPDIR)/ioctl_kvm_run_auxstr_vcpu.Po \ + ./$(DEPDIR)/ioctl_loop-nv.Po ./$(DEPDIR)/ioctl_loop-v.Po \ + ./$(DEPDIR)/ioctl_loop.Po ./$(DEPDIR)/ioctl_mtd.Po \ + ./$(DEPDIR)/ioctl_nbd.Po ./$(DEPDIR)/ioctl_nsfs.Po \ + ./$(DEPDIR)/ioctl_perf-success.Po ./$(DEPDIR)/ioctl_perf.Po \ + ./$(DEPDIR)/ioctl_ptp.Po ./$(DEPDIR)/ioctl_random.Po \ + ./$(DEPDIR)/ioctl_rtc-v.Po ./$(DEPDIR)/ioctl_rtc.Po \ + ./$(DEPDIR)/ioctl_scsi.Po ./$(DEPDIR)/ioctl_sg_io_v3.Po \ + ./$(DEPDIR)/ioctl_sg_io_v4.Po \ + ./$(DEPDIR)/ioctl_sock_gifconf.Po ./$(DEPDIR)/ioctl_uffdio.Po \ + ./$(DEPDIR)/ioctl_v4l2.Po ./$(DEPDIR)/ioperm.Po \ + ./$(DEPDIR)/iopl.Po ./$(DEPDIR)/ioprio-Xabbrev.Po \ + ./$(DEPDIR)/ioprio-Xraw.Po ./$(DEPDIR)/ioprio-Xverbose.Po \ + ./$(DEPDIR)/ioprio.Po ./$(DEPDIR)/ip_mreq.Po \ + ./$(DEPDIR)/ipc.Po ./$(DEPDIR)/ipc_msg-Xabbrev.Po \ + ./$(DEPDIR)/ipc_msg-Xraw.Po ./$(DEPDIR)/ipc_msg-Xverbose.Po \ + ./$(DEPDIR)/ipc_msg.Po ./$(DEPDIR)/ipc_msgbuf-Xabbrev.Po \ + ./$(DEPDIR)/ipc_msgbuf-Xraw.Po \ + ./$(DEPDIR)/ipc_msgbuf-Xverbose.Po ./$(DEPDIR)/ipc_msgbuf.Po \ + ./$(DEPDIR)/ipc_sem-Xabbrev.Po ./$(DEPDIR)/ipc_sem-Xraw.Po \ + ./$(DEPDIR)/ipc_sem-Xverbose.Po ./$(DEPDIR)/ipc_sem.Po \ + ./$(DEPDIR)/ipc_shm-Xabbrev.Po ./$(DEPDIR)/ipc_shm-Xraw.Po \ + ./$(DEPDIR)/ipc_shm-Xverbose.Po ./$(DEPDIR)/ipc_shm.Po \ + ./$(DEPDIR)/is_linux_mips_n64.Po ./$(DEPDIR)/kcmp-y.Po \ + ./$(DEPDIR)/kcmp.Po ./$(DEPDIR)/kern_features.Po \ + ./$(DEPDIR)/kernel_version-Xabbrev.Po \ + ./$(DEPDIR)/kernel_version-Xraw.Po \ + ./$(DEPDIR)/kernel_version-Xverbose.Po \ + ./$(DEPDIR)/kernel_version.Po ./$(DEPDIR)/kexec_file_load.Po \ + ./$(DEPDIR)/kexec_load.Po ./$(DEPDIR)/keyctl-Xabbrev.Po \ + ./$(DEPDIR)/keyctl-Xraw.Po ./$(DEPDIR)/keyctl-Xverbose.Po \ + ./$(DEPDIR)/keyctl.Po ./$(DEPDIR)/kill.Po \ + ./$(DEPDIR)/kill_child.Po ./$(DEPDIR)/ksysent.Po \ + ./$(DEPDIR)/lchown.Po ./$(DEPDIR)/lchown32.Po \ + ./$(DEPDIR)/libtests_a-create_nl_socket.Po \ + ./$(DEPDIR)/libtests_a-errno2name.Po \ + ./$(DEPDIR)/libtests_a-error_msg.Po \ + ./$(DEPDIR)/libtests_a-fill_memory.Po \ + ./$(DEPDIR)/libtests_a-get_page_size.Po \ + ./$(DEPDIR)/libtests_a-get_sigset_size.Po \ + ./$(DEPDIR)/libtests_a-hexdump_strdup.Po \ + ./$(DEPDIR)/libtests_a-hexquote_strndup.Po \ + ./$(DEPDIR)/libtests_a-ifindex.Po \ + ./$(DEPDIR)/libtests_a-inode_of_sockfd.Po \ + ./$(DEPDIR)/libtests_a-libmmsg.Po \ + ./$(DEPDIR)/libtests_a-libsocketcall.Po \ + ./$(DEPDIR)/libtests_a-overflowuid.Po \ + ./$(DEPDIR)/libtests_a-pipe_maxfd.Po \ + ./$(DEPDIR)/libtests_a-print_quoted_string.Po \ + ./$(DEPDIR)/libtests_a-print_time.Po \ + ./$(DEPDIR)/libtests_a-printflags.Po \ + ./$(DEPDIR)/libtests_a-printxval.Po \ + ./$(DEPDIR)/libtests_a-signal2name.Po \ + ./$(DEPDIR)/libtests_a-skip_unavailable.Po \ + ./$(DEPDIR)/libtests_a-sprintrc.Po \ + ./$(DEPDIR)/libtests_a-tail_alloc.Po \ + ./$(DEPDIR)/libtests_a-test_printpath.Po \ + ./$(DEPDIR)/libtests_a-test_printstrn.Po \ + ./$(DEPDIR)/libtests_a-test_ucopy.Po \ + ./$(DEPDIR)/libtests_a-tprintf.Po ./$(DEPDIR)/link.Po \ + ./$(DEPDIR)/linkat.Po ./$(DEPDIR)/list_sigaction_signum.Po \ + ./$(DEPDIR)/llseek.Po ./$(DEPDIR)/localtime.Po \ + ./$(DEPDIR)/lookup_dcookie.Po ./$(DEPDIR)/looping_threads.Po \ + ./$(DEPDIR)/lseek.Po ./$(DEPDIR)/lstat.Po \ + ./$(DEPDIR)/lstat64-lstat64.Po ./$(DEPDIR)/madvise.Po \ + ./$(DEPDIR)/mbind.Po ./$(DEPDIR)/membarrier.Po \ + ./$(DEPDIR)/memfd_create-Xabbrev.Po \ + ./$(DEPDIR)/memfd_create-Xraw.Po \ + ./$(DEPDIR)/memfd_create-Xverbose.Po \ + ./$(DEPDIR)/memfd_create.Po ./$(DEPDIR)/migrate_pages.Po \ + ./$(DEPDIR)/mincore.Po ./$(DEPDIR)/mkdir.Po \ + ./$(DEPDIR)/mkdirat.Po ./$(DEPDIR)/mknod.Po \ + ./$(DEPDIR)/mknodat.Po ./$(DEPDIR)/mlock.Po \ + ./$(DEPDIR)/mlock2.Po ./$(DEPDIR)/mlockall.Po \ + ./$(DEPDIR)/mmap-Xabbrev.Po ./$(DEPDIR)/mmap-Xraw.Po \ + ./$(DEPDIR)/mmap-Xverbose.Po ./$(DEPDIR)/mmap.Po \ + ./$(DEPDIR)/mmap64-mmap64.Po \ + ./$(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Po \ + ./$(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Po \ + ./$(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Po \ + ./$(DEPDIR)/mmsg-silent.Po ./$(DEPDIR)/mmsg.Po \ + ./$(DEPDIR)/mmsg_name-v.Po ./$(DEPDIR)/mmsg_name.Po \ + ./$(DEPDIR)/modify_ldt.Po ./$(DEPDIR)/mount-Xabbrev.Po \ + ./$(DEPDIR)/mount-Xraw.Po ./$(DEPDIR)/mount-Xverbose.Po \ + ./$(DEPDIR)/mount.Po ./$(DEPDIR)/move_pages-Xabbrev.Po \ + ./$(DEPDIR)/move_pages-Xraw.Po \ + ./$(DEPDIR)/move_pages-Xverbose.Po ./$(DEPDIR)/move_pages.Po \ + ./$(DEPDIR)/mq.Po ./$(DEPDIR)/mq_sendrecv-read.Po \ + ./$(DEPDIR)/mq_sendrecv-write.Po ./$(DEPDIR)/mq_sendrecv.Po \ + ./$(DEPDIR)/msg_control-v.Po ./$(DEPDIR)/msg_control.Po \ + ./$(DEPDIR)/msg_name.Po ./$(DEPDIR)/munlockall.Po \ + ./$(DEPDIR)/nanosleep.Po ./$(DEPDIR)/net-accept-connect.Po \ + ./$(DEPDIR)/net-icmp_filter.Po \ + ./$(DEPDIR)/net-packet_mreq-Xabbrev.Po \ + ./$(DEPDIR)/net-packet_mreq-Xraw.Po \ + ./$(DEPDIR)/net-packet_mreq-Xverbose.Po \ + ./$(DEPDIR)/net-packet_mreq.Po ./$(DEPDIR)/net-sockaddr.Po \ + ./$(DEPDIR)/net-tpacket_req.Po \ + ./$(DEPDIR)/net-tpacket_stats-success.Po \ + ./$(DEPDIR)/net-tpacket_stats.Po ./$(DEPDIR)/net-y-unix.Po \ + ./$(DEPDIR)/net-yy-inet.Po ./$(DEPDIR)/net-yy-inet6.Po \ + ./$(DEPDIR)/net-yy-netlink.Po ./$(DEPDIR)/net-yy-unix.Po \ + ./$(DEPDIR)/netlink_audit.Po ./$(DEPDIR)/netlink_crypto.Po \ + ./$(DEPDIR)/netlink_generic.Po \ + ./$(DEPDIR)/netlink_inet_diag.Po \ + ./$(DEPDIR)/netlink_kobject_uevent.Po \ + ./$(DEPDIR)/netlink_netfilter.Po \ + ./$(DEPDIR)/netlink_netlink_diag.Po \ + ./$(DEPDIR)/netlink_protocol.Po ./$(DEPDIR)/netlink_route.Po \ + ./$(DEPDIR)/netlink_selinux.Po \ + ./$(DEPDIR)/netlink_sock_diag.Po \ + ./$(DEPDIR)/netlink_unix_diag.Po ./$(DEPDIR)/netlink_xfrm.Po \ + ./$(DEPDIR)/newfstatat-newfstatat.Po \ + ./$(DEPDIR)/nfnetlink_acct.Po \ + ./$(DEPDIR)/nfnetlink_cthelper.Po \ + ./$(DEPDIR)/nfnetlink_ctnetlink.Po \ + ./$(DEPDIR)/nfnetlink_ctnetlink_exp.Po \ + ./$(DEPDIR)/nfnetlink_cttimeout.Po \ + ./$(DEPDIR)/nfnetlink_ipset.Po \ + ./$(DEPDIR)/nfnetlink_nft_compat.Po \ + ./$(DEPDIR)/nfnetlink_nftables.Po ./$(DEPDIR)/nfnetlink_osf.Po \ + ./$(DEPDIR)/nfnetlink_queue.Po ./$(DEPDIR)/nfnetlink_ulog.Po \ + ./$(DEPDIR)/nlattr.Po ./$(DEPDIR)/nlattr_br_port_msg.Po \ + ./$(DEPDIR)/nlattr_crypto_user_alg.Po \ + ./$(DEPDIR)/nlattr_dcbmsg.Po \ + ./$(DEPDIR)/nlattr_fib_rule_hdr.Po \ + ./$(DEPDIR)/nlattr_ifaddrlblmsg.Po \ + ./$(DEPDIR)/nlattr_ifaddrmsg.Po \ + ./$(DEPDIR)/nlattr_ifinfomsg.Po \ + ./$(DEPDIR)/nlattr_ifla_af_spec.Po \ + ./$(DEPDIR)/nlattr_ifla_brport.Po \ + ./$(DEPDIR)/nlattr_ifla_linkinfo.Po \ + ./$(DEPDIR)/nlattr_ifla_port.Po ./$(DEPDIR)/nlattr_ifla_xdp.Po \ + ./$(DEPDIR)/nlattr_inet_diag_msg.Po \ + ./$(DEPDIR)/nlattr_inet_diag_req_compat.Po \ + ./$(DEPDIR)/nlattr_inet_diag_req_v2.Po \ + ./$(DEPDIR)/nlattr_mdba_mdb_entry.Po \ + ./$(DEPDIR)/nlattr_mdba_router_port.Po \ + ./$(DEPDIR)/nlattr_ndmsg.Po ./$(DEPDIR)/nlattr_ndtmsg.Po \ + ./$(DEPDIR)/nlattr_netconfmsg.Po \ + ./$(DEPDIR)/nlattr_netlink_diag_msg.Po \ + ./$(DEPDIR)/nlattr_nlmsgerr.Po \ + ./$(DEPDIR)/nlattr_packet_diag_msg.Po \ + ./$(DEPDIR)/nlattr_rtgenmsg.Po ./$(DEPDIR)/nlattr_rtmsg.Po \ + ./$(DEPDIR)/nlattr_smc_diag_msg.Po \ + ./$(DEPDIR)/nlattr_tc_stats.Po ./$(DEPDIR)/nlattr_tca_stab.Po \ + ./$(DEPDIR)/nlattr_tcamsg.Po ./$(DEPDIR)/nlattr_tcmsg.Po \ + ./$(DEPDIR)/nlattr_unix_diag_msg.Po ./$(DEPDIR)/nsyscalls-d.Po \ + ./$(DEPDIR)/nsyscalls.Po ./$(DEPDIR)/old_mmap-P.Po \ + ./$(DEPDIR)/old_mmap-Xabbrev.Po ./$(DEPDIR)/old_mmap-Xraw.Po \ + ./$(DEPDIR)/old_mmap-Xverbose.Po \ + ./$(DEPDIR)/old_mmap-v-none.Po ./$(DEPDIR)/old_mmap.Po \ + ./$(DEPDIR)/oldfstat.Po ./$(DEPDIR)/oldlstat.Po \ + ./$(DEPDIR)/oldselect-P.Po ./$(DEPDIR)/oldselect-efault-P.Po \ + ./$(DEPDIR)/oldselect-efault.Po ./$(DEPDIR)/oldselect.Po \ + ./$(DEPDIR)/oldstat.Po ./$(DEPDIR)/open.Po \ + ./$(DEPDIR)/openat.Po ./$(DEPDIR)/orphaned_process_group.Po \ + ./$(DEPDIR)/osf_utimes.Po ./$(DEPDIR)/pause.Po \ + ./$(DEPDIR)/pc.Po ./$(DEPDIR)/perf_event_open.Po \ + ./$(DEPDIR)/perf_event_open_nonverbose.Po \ + ./$(DEPDIR)/perf_event_open_unabbrev.Po \ + ./$(DEPDIR)/personality-Xabbrev.Po \ + ./$(DEPDIR)/personality-Xraw.Po \ + ./$(DEPDIR)/personality-Xverbose.Po ./$(DEPDIR)/personality.Po \ + ./$(DEPDIR)/pidfd_send_signal.Po ./$(DEPDIR)/pipe.Po \ + ./$(DEPDIR)/pipe2.Po ./$(DEPDIR)/pkey_alloc.Po \ + ./$(DEPDIR)/pkey_free.Po ./$(DEPDIR)/pkey_mprotect.Po \ + ./$(DEPDIR)/poll-P.Po ./$(DEPDIR)/poll.Po \ + ./$(DEPDIR)/ppoll-P.Po ./$(DEPDIR)/ppoll-v.Po \ + ./$(DEPDIR)/ppoll.Po ./$(DEPDIR)/prctl-arg2-intptr.Po \ + ./$(DEPDIR)/prctl-dumpable.Po ./$(DEPDIR)/prctl-name.Po \ + ./$(DEPDIR)/prctl-no-args.Po ./$(DEPDIR)/prctl-pdeathsig.Po \ + ./$(DEPDIR)/prctl-seccomp-filter-v.Po \ + ./$(DEPDIR)/prctl-seccomp-strict.Po \ + ./$(DEPDIR)/prctl-securebits.Po \ + ./$(DEPDIR)/prctl-spec-inject.Po \ + ./$(DEPDIR)/prctl-tid_address.Po ./$(DEPDIR)/prctl-tsc.Po \ + ./$(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po \ + ./$(DEPDIR)/preadv-preadv.Po ./$(DEPDIR)/preadv2-pwritev2.Po \ + ./$(DEPDIR)/preadv_pwritev-preadv-pwritev.Po \ + ./$(DEPDIR)/print_maxfd.Po \ + ./$(DEPDIR)/printpath-umovestr-peekdata.Po \ + ./$(DEPDIR)/printpath-umovestr-undumpable.Po \ + ./$(DEPDIR)/printpath-umovestr.Po \ + ./$(DEPDIR)/printsignal-Xabbrev.Po \ + ./$(DEPDIR)/printsignal-Xraw.Po \ + ./$(DEPDIR)/printsignal-Xverbose.Po ./$(DEPDIR)/printstr.Po \ + ./$(DEPDIR)/printstrn-umoven-peekdata.Po \ + ./$(DEPDIR)/printstrn-umoven-undumpable.Po \ + ./$(DEPDIR)/printstrn-umoven.Po ./$(DEPDIR)/prlimit64.Po \ + ./$(DEPDIR)/process_vm_readv.Po \ + ./$(DEPDIR)/process_vm_writev.Po ./$(DEPDIR)/pselect6.Po \ + ./$(DEPDIR)/ptrace.Po ./$(DEPDIR)/ptrace_syscall_info.Po \ + ./$(DEPDIR)/pwritev-pwritev.Po ./$(DEPDIR)/qual_fault.Po \ + ./$(DEPDIR)/qual_inject-error-signal.Po \ + ./$(DEPDIR)/qual_inject-retval.Po \ + ./$(DEPDIR)/qual_inject-signal.Po ./$(DEPDIR)/qual_signal.Po \ + ./$(DEPDIR)/quotactl-Xabbrev.Po ./$(DEPDIR)/quotactl-Xraw.Po \ + ./$(DEPDIR)/quotactl-Xverbose.Po \ + ./$(DEPDIR)/quotactl-success-v.Po \ + ./$(DEPDIR)/quotactl-success.Po ./$(DEPDIR)/quotactl-v.Po \ + ./$(DEPDIR)/quotactl-xfs-success-v.Po \ + ./$(DEPDIR)/quotactl-xfs-success.Po \ + ./$(DEPDIR)/quotactl-xfs-v.Po ./$(DEPDIR)/quotactl-xfs.Po \ + ./$(DEPDIR)/quotactl.Po ./$(DEPDIR)/read-write.Po \ + ./$(DEPDIR)/readahead.Po ./$(DEPDIR)/readdir.Po \ + ./$(DEPDIR)/readlink.Po ./$(DEPDIR)/readlinkat.Po \ + ./$(DEPDIR)/readv.Po ./$(DEPDIR)/reboot.Po \ + ./$(DEPDIR)/recvfrom.Po ./$(DEPDIR)/recvmmsg-timeout.Po \ + ./$(DEPDIR)/recvmsg.Po ./$(DEPDIR)/redirect-fds.Po \ + ./$(DEPDIR)/remap_file_pages-Xabbrev.Po \ + ./$(DEPDIR)/remap_file_pages-Xraw.Po \ + ./$(DEPDIR)/remap_file_pages-Xverbose.Po \ + ./$(DEPDIR)/remap_file_pages.Po ./$(DEPDIR)/rename.Po \ + ./$(DEPDIR)/renameat.Po ./$(DEPDIR)/renameat2.Po \ + ./$(DEPDIR)/request_key.Po ./$(DEPDIR)/restart_syscall.Po \ + ./$(DEPDIR)/riscv_flush_icache.Po ./$(DEPDIR)/rmdir.Po \ + ./$(DEPDIR)/rt_sigaction.Po ./$(DEPDIR)/rt_sigpending.Po \ + ./$(DEPDIR)/rt_sigprocmask.Po ./$(DEPDIR)/rt_sigqueueinfo.Po \ + ./$(DEPDIR)/rt_sigreturn.Po ./$(DEPDIR)/rt_sigsuspend.Po \ + ./$(DEPDIR)/rt_sigtimedwait.Po \ + ./$(DEPDIR)/rt_tgsigqueueinfo.Po \ + ./$(DEPDIR)/run_expect_termsig.Po \ + ./$(DEPDIR)/s390_guarded_storage-v.Po \ + ./$(DEPDIR)/s390_guarded_storage.Po \ + ./$(DEPDIR)/s390_pci_mmio_read_write.Po \ + ./$(DEPDIR)/s390_runtime_instr.Po ./$(DEPDIR)/s390_sthyi-v.Po \ + ./$(DEPDIR)/s390_sthyi.Po \ + ./$(DEPDIR)/sched_get_priority_mxx.Po \ + ./$(DEPDIR)/sched_rr_get_interval.Po \ + ./$(DEPDIR)/sched_xetaffinity.Po ./$(DEPDIR)/sched_xetattr.Po \ + ./$(DEPDIR)/sched_xetparam.Po \ + ./$(DEPDIR)/sched_xetscheduler.Po ./$(DEPDIR)/sched_yield.Po \ + ./$(DEPDIR)/scm_rights.Po ./$(DEPDIR)/seccomp-filter-v.Po \ + ./$(DEPDIR)/seccomp-filter.Po ./$(DEPDIR)/seccomp-strict.Po \ + ./$(DEPDIR)/seccomp_get_action_avail.Po \ + ./$(DEPDIR)/select-P.Po ./$(DEPDIR)/select.Po \ + ./$(DEPDIR)/semop.Po ./$(DEPDIR)/sendfile.Po \ + ./$(DEPDIR)/sendfile64.Po ./$(DEPDIR)/set_mempolicy.Po \ + ./$(DEPDIR)/set_ptracer_any.Po ./$(DEPDIR)/set_sigblock.Po \ + ./$(DEPDIR)/set_sigign.Po ./$(DEPDIR)/setdomainname.Po \ + ./$(DEPDIR)/setfsgid.Po ./$(DEPDIR)/setfsgid32.Po \ + ./$(DEPDIR)/setfsuid.Po ./$(DEPDIR)/setfsuid32.Po \ + ./$(DEPDIR)/setgid.Po ./$(DEPDIR)/setgid32.Po \ + ./$(DEPDIR)/setgroups.Po ./$(DEPDIR)/setgroups32.Po \ + ./$(DEPDIR)/sethostname.Po ./$(DEPDIR)/setns.Po \ + ./$(DEPDIR)/setregid.Po ./$(DEPDIR)/setregid32.Po \ + ./$(DEPDIR)/setresgid.Po ./$(DEPDIR)/setresgid32.Po \ + ./$(DEPDIR)/setresuid.Po ./$(DEPDIR)/setresuid32.Po \ + ./$(DEPDIR)/setreuid.Po ./$(DEPDIR)/setreuid32.Po \ + ./$(DEPDIR)/setrlimit-Xabbrev.Po ./$(DEPDIR)/setrlimit-Xraw.Po \ + ./$(DEPDIR)/setrlimit-Xverbose.Po ./$(DEPDIR)/setrlimit.Po \ + ./$(DEPDIR)/setuid.Po ./$(DEPDIR)/setuid32.Po \ + ./$(DEPDIR)/shmxt.Po ./$(DEPDIR)/shutdown.Po \ + ./$(DEPDIR)/sigaction.Po ./$(DEPDIR)/sigaltstack.Po \ + ./$(DEPDIR)/siginfo.Po ./$(DEPDIR)/signal.Po \ + ./$(DEPDIR)/signal_receive.Po ./$(DEPDIR)/signalfd4.Po \ + ./$(DEPDIR)/sigpending.Po ./$(DEPDIR)/sigprocmask.Po \ + ./$(DEPDIR)/sigreturn.Po ./$(DEPDIR)/sigsuspend.Po \ + ./$(DEPDIR)/sleep.Po ./$(DEPDIR)/so_error.Po \ + ./$(DEPDIR)/so_linger.Po ./$(DEPDIR)/so_peercred-Xabbrev.Po \ + ./$(DEPDIR)/so_peercred-Xraw.Po \ + ./$(DEPDIR)/so_peercred-Xverbose.Po ./$(DEPDIR)/so_peercred.Po \ + ./$(DEPDIR)/sock_filter-v-Xabbrev.Po \ + ./$(DEPDIR)/sock_filter-v-Xraw.Po \ + ./$(DEPDIR)/sock_filter-v-Xverbose.Po \ + ./$(DEPDIR)/sock_filter-v.Po \ + ./$(DEPDIR)/sockaddr_xlat-Xabbrev.Po \ + ./$(DEPDIR)/sockaddr_xlat-Xraw.Po \ + ./$(DEPDIR)/sockaddr_xlat-Xverbose.Po \ + ./$(DEPDIR)/socketcall.Po ./$(DEPDIR)/sockopt-sol_netlink.Po \ + ./$(DEPDIR)/sockopt-timestamp.Po ./$(DEPDIR)/splice.Po \ + ./$(DEPDIR)/stack-fcall-0.Po ./$(DEPDIR)/stack-fcall-1.Po \ + ./$(DEPDIR)/stack-fcall-2.Po ./$(DEPDIR)/stack-fcall-3.Po \ + ./$(DEPDIR)/stack-fcall-mangled-0.Po \ + ./$(DEPDIR)/stack-fcall-mangled-1.Po \ + ./$(DEPDIR)/stack-fcall-mangled-2.Po \ + ./$(DEPDIR)/stack-fcall-mangled-3.Po \ + ./$(DEPDIR)/stack-fcall-mangled.Po ./$(DEPDIR)/stack-fcall.Po \ + ./$(DEPDIR)/stat.Po ./$(DEPDIR)/stat64-stat64.Po \ + ./$(DEPDIR)/statfs-statfs.Po ./$(DEPDIR)/statfs64.Po \ + ./$(DEPDIR)/statx.Po ./$(DEPDIR)/swap.Po \ + ./$(DEPDIR)/sxetmask.Po ./$(DEPDIR)/symlink.Po \ + ./$(DEPDIR)/symlinkat.Po ./$(DEPDIR)/sync.Po \ + ./$(DEPDIR)/sync_file_range.Po ./$(DEPDIR)/sync_file_range2.Po \ + ./$(DEPDIR)/sysinfo.Po ./$(DEPDIR)/syslog.Po \ + ./$(DEPDIR)/tee.Po ./$(DEPDIR)/threads-execve.Po \ + ./$(DEPDIR)/time.Po ./$(DEPDIR)/timer_create.Po \ + ./$(DEPDIR)/timer_xettime.Po ./$(DEPDIR)/timerfd_xettime.Po \ + ./$(DEPDIR)/times-fail.Po ./$(DEPDIR)/times.Po \ + ./$(DEPDIR)/truncate.Po ./$(DEPDIR)/truncate64-truncate64.Po \ + ./$(DEPDIR)/ugetrlimit.Po ./$(DEPDIR)/uio-uio.Po \ + ./$(DEPDIR)/umask.Po ./$(DEPDIR)/umount.Po \ + ./$(DEPDIR)/umount2.Po ./$(DEPDIR)/umoven-illptr.Po \ + ./$(DEPDIR)/umovestr-illptr.Po ./$(DEPDIR)/umovestr.Po \ + ./$(DEPDIR)/umovestr2.Po ./$(DEPDIR)/umovestr3.Po \ + ./$(DEPDIR)/uname.Po ./$(DEPDIR)/unblock_reset_raise.Po \ + ./$(DEPDIR)/unix-pair-send-recv.Po \ + ./$(DEPDIR)/unix-pair-sendto-recvfrom.Po ./$(DEPDIR)/unlink.Po \ + ./$(DEPDIR)/unlinkat.Po ./$(DEPDIR)/unshare.Po \ + ./$(DEPDIR)/userfaultfd.Po ./$(DEPDIR)/ustat.Po \ + ./$(DEPDIR)/utime.Po ./$(DEPDIR)/utimensat-Xabbrev.Po \ + ./$(DEPDIR)/utimensat-Xraw.Po \ + ./$(DEPDIR)/utimensat-Xverbose.Po ./$(DEPDIR)/utimensat.Po \ + ./$(DEPDIR)/utimes.Po ./$(DEPDIR)/vfork-f.Po \ + ./$(DEPDIR)/vhangup.Po ./$(DEPDIR)/vmsplice.Po \ + ./$(DEPDIR)/wait4-v.Po ./$(DEPDIR)/wait4.Po \ + ./$(DEPDIR)/waitid-v.Po ./$(DEPDIR)/waitid.Po \ + ./$(DEPDIR)/waitpid.Po ./$(DEPDIR)/xattr-strings.Po \ + ./$(DEPDIR)/xattr.Po ./$(DEPDIR)/xet_robust_list.Po \ + ./$(DEPDIR)/xet_thread_area_x86.Po ./$(DEPDIR)/xetitimer.Po \ + ./$(DEPDIR)/xetpgid.Po ./$(DEPDIR)/xetpriority.Po \ + ./$(DEPDIR)/xettimeofday.Po ./$(DEPDIR)/zeroargc.Po am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -1835,182 +3302,349 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(libtests_a_SOURCES) _newselect.c accept.c accept4.c \ - access.c acct.c add_key.c adjtimex.c aio.c alarm.c answer.c \ - attach-f-p.c attach-f-p-cmd.c attach-p-cmd-cmd.c \ - attach-p-cmd-p.c bpf.c brk.c btrfs.c caps.c caps-abbrev.c \ - chmod.c chown.c chown32.c chroot.c clock_adjtime.c \ - clock_nanosleep.c clock_xettime.c copy_file_range.c count-f.c \ - creat.c delete_module.c dup.c dup2.c dup3.c epoll_create.c \ - epoll_create1.c epoll_ctl.c epoll_pwait.c epoll_wait.c \ - erestartsys.c eventfd.c execve.c execve-v.c execveat.c \ - execveat-v.c faccessat.c fadvise64.c fadvise64_64.c \ - fallocate.c fanotify_init.c fanotify_mark.c fchdir.c fchmod.c \ - fchmodat.c fchown.c fchown32.c fchownat.c fcntl.c fcntl64.c \ - fdatasync.c file_handle.c file_ioctl.c filter-unavailable.c \ - finit_module.c flock.c fork-f.c fstat.c fstat64.c fstatat64.c \ - fstatfs.c fstatfs64.c fsync.c ftruncate.c ftruncate64.c \ - futex.c futimesat.c get_mempolicy.c getcpu.c getcwd.c \ - getdents.c getdents64.c getegid.c getegid32.c geteuid.c \ - geteuid32.c getgid.c getgid32.c getgroups.c getgroups32.c \ - getpeername.c getpgrp.c getrandom.c getresgid.c getresgid32.c \ +SOURCES = $(libtests_a_SOURCES) _newselect.c _newselect-P.c accept.c \ + accept4.c access.c acct.c add_key.c adjtimex.c aio.c \ + aio_pgetevents.c alarm.c answer.c attach-f-p.c \ + attach-f-p-cmd.c attach-p-cmd-cmd.c attach-p-cmd-p.c \ + block_reset_raise_run.c bpf.c bpf-obj_get_info_by_fd.c \ + bpf-obj_get_info_by_fd-prog.c bpf-obj_get_info_by_fd-prog-v.c \ + bpf-obj_get_info_by_fd-v.c bpf-success.c bpf-success-v.c \ + bpf-v.c brk.c btrfs.c caps.c caps-abbrev.c check_sigblock.c \ + check_sigign.c chmod.c chown.c chown32.c chroot.c \ + clock_adjtime.c clock_nanosleep.c clock_xettime.c \ + clone_parent.c clone_ptrace.c copy_file_range.c count-f.c \ + creat.c delay.c delete_module.c dev-yy.c dup.c dup2.c dup3.c \ + epoll_create.c epoll_create1.c epoll_ctl.c epoll_pwait.c \ + epoll_wait.c erestartsys.c eventfd.c execve.c execve-v.c \ + execveat.c execveat-v.c faccessat.c fadvise64.c fadvise64_64.c \ + fallocate.c fanotify_init.c fanotify_mark.c \ + fanotify_mark-Xabbrev.c fanotify_mark-Xraw.c \ + fanotify_mark-Xverbose.c fchdir.c fchmod.c fchmodat.c fchown.c \ + fchown32.c fchownat.c fcntl.c fcntl64.c fdatasync.c fflush.c \ + file_handle.c file_ioctl.c filter-unavailable.c finit_module.c \ + flock.c fork-f.c fstat.c fstat-Xabbrev.c fstat-Xraw.c \ + fstat-Xverbose.c fstat64.c fstat64-Xabbrev.c fstat64-Xraw.c \ + fstat64-Xverbose.c fstatat64.c fstatfs.c fstatfs64.c fsync.c \ + fsync-y.c ftruncate.c ftruncate64.c futex.c futimesat.c \ + get_mempolicy.c getcpu.c getcwd.c getdents.c getdents64.c \ + getegid.c getegid32.c geteuid.c geteuid32.c getgid.c \ + getgid32.c getgroups.c getgroups32.c getpeername.c getpgrp.c \ + getpid.c getppid.c getrandom.c getresgid.c getresgid32.c \ getresuid.c getresuid32.c getrlimit.c getrusage.c getsid.c \ - getsockname.c getuid.c getuid32.c getxxid.c inet-cmsg.c \ - init_module.c inotify.c inotify_init1.c ioctl.c ioctl_block.c \ - ioctl_dm.c ioctl_dm-v.c ioctl_evdev.c ioctl_evdev-v.c \ + getsockname.c gettid.c getuid.c getuid32.c getxxid.c \ + group_req.c inet-cmsg.c init_module.c inject-nf.c inotify.c \ + inotify_init1.c int_0x80.c io_uring_enter.c \ + io_uring_register.c io_uring_setup.c ioctl.c ioctl_block.c \ + ioctl_dm.c ioctl_dm-v.c ioctl_evdev.c ioctl_evdev-success.c \ + ioctl_evdev-success-v.c ioctl_evdev-v.c ioctl_inotify.c \ + ioctl_kvm_run.c ioctl_kvm_run-v.c ioctl_kvm_run_auxstr_vcpu.c \ ioctl_loop.c ioctl_loop-nv.c ioctl_loop-v.c ioctl_mtd.c \ - ioctl_rtc.c ioctl_rtc-v.c ioctl_scsi.c ioctl_sg_io_v3.c \ - ioctl_sg_io_v4.c ioctl_sock_gifconf.c ioctl_uffdio.c \ - ioctl_v4l2.c ioperm.c iopl.c ioprio.c ip_mreq.c ipc.c \ - ipc_msg.c ipc_msgbuf.c ipc_sem.c ipc_shm.c kcmp.c \ - kexec_file_load.c kexec_load.c keyctl.c kill.c ksysent.c \ - lchown.c lchown32.c link.c linkat.c llseek.c lookup_dcookie.c \ - lseek.c lstat.c lstat64.c mbind.c membarrier.c memfd_create.c \ - migrate_pages.c mincore.c mkdir.c mkdirat.c mknod.c mknodat.c \ - mlock.c mlock2.c mlockall.c mmap.c mmap64.c mmsg.c \ - mmsg-silent.c mmsg_name.c mmsg_name-v.c mount.c move_pages.c \ + ioctl_nbd.c ioctl_nsfs.c ioctl_perf.c ioctl_perf-success.c \ + ioctl_ptp.c ioctl_random.c ioctl_rtc.c ioctl_rtc-v.c \ + ioctl_scsi.c ioctl_sg_io_v3.c ioctl_sg_io_v4.c \ + ioctl_sock_gifconf.c ioctl_uffdio.c ioctl_v4l2.c ioperm.c \ + iopl.c ioprio.c ioprio-Xabbrev.c ioprio-Xraw.c \ + ioprio-Xverbose.c ip_mreq.c ipc.c ipc_msg.c ipc_msg-Xabbrev.c \ + ipc_msg-Xraw.c ipc_msg-Xverbose.c ipc_msgbuf.c \ + ipc_msgbuf-Xabbrev.c ipc_msgbuf-Xraw.c ipc_msgbuf-Xverbose.c \ + ipc_sem.c ipc_sem-Xabbrev.c ipc_sem-Xraw.c ipc_sem-Xverbose.c \ + ipc_shm.c ipc_shm-Xabbrev.c ipc_shm-Xraw.c ipc_shm-Xverbose.c \ + is_linux_mips_n64.c kcmp.c kcmp-y.c kern_features.c \ + kernel_version.c kernel_version-Xabbrev.c \ + kernel_version-Xraw.c kernel_version-Xverbose.c \ + kexec_file_load.c kexec_load.c keyctl.c keyctl-Xabbrev.c \ + keyctl-Xraw.c keyctl-Xverbose.c kill.c kill_child.c ksysent.c \ + lchown.c lchown32.c link.c linkat.c list_sigaction_signum.c \ + llseek.c localtime.c lookup_dcookie.c looping_threads.c \ + lseek.c lstat.c lstat64.c madvise.c mbind.c membarrier.c \ + memfd_create.c memfd_create-Xabbrev.c memfd_create-Xraw.c \ + memfd_create-Xverbose.c migrate_pages.c mincore.c mkdir.c \ + mkdirat.c mknod.c mknodat.c mlock.c mlock2.c mlockall.c mmap.c \ + mmap-Xabbrev.c mmap-Xraw.c mmap-Xverbose.c mmap64.c \ + mmap64-Xabbrev.c mmap64-Xraw.c mmap64-Xverbose.c mmsg.c \ + mmsg-silent.c mmsg_name.c mmsg_name-v.c modify_ldt.c mount.c \ + mount-Xabbrev.c mount-Xraw.c mount-Xverbose.c move_pages.c \ + move_pages-Xabbrev.c move_pages-Xraw.c move_pages-Xverbose.c \ mq.c mq_sendrecv.c mq_sendrecv-read.c mq_sendrecv-write.c \ msg_control.c msg_control-v.c msg_name.c munlockall.c \ nanosleep.c net-accept-connect.c net-icmp_filter.c \ - net-sockaddr.c net-y-unix.c net-yy-inet.c net-yy-netlink.c \ - net-yy-unix.c netlink_inet_diag.c netlink_netlink_diag.c \ - netlink_protocol.c netlink_unix_diag.c newfstatat.c \ - nsyscalls.c old_mmap.c oldfstat.c oldlstat.c oldselect.c \ - oldstat.c open.c openat.c pause.c pc.c perf_event_open.c \ - perf_event_open_nonverbose.c perf_event_open_unabbrev.c \ - personality.c pipe.c pipe2.c pkey_alloc.c pkey_free.c \ - pkey_mprotect.c poll.c ppoll.c prctl-arg2-intptr.c \ + net-packet_mreq.c net-packet_mreq-Xabbrev.c \ + net-packet_mreq-Xraw.c net-packet_mreq-Xverbose.c \ + net-sockaddr.c net-tpacket_req.c net-tpacket_stats.c \ + net-tpacket_stats-success.c net-y-unix.c net-yy-inet.c \ + net-yy-inet6.c net-yy-netlink.c net-yy-unix.c netlink_audit.c \ + netlink_crypto.c netlink_generic.c netlink_inet_diag.c \ + netlink_kobject_uevent.c netlink_netfilter.c \ + netlink_netlink_diag.c netlink_protocol.c netlink_route.c \ + netlink_selinux.c netlink_sock_diag.c netlink_unix_diag.c \ + netlink_xfrm.c newfstatat.c nfnetlink_acct.c \ + nfnetlink_cthelper.c nfnetlink_ctnetlink.c \ + nfnetlink_ctnetlink_exp.c nfnetlink_cttimeout.c \ + nfnetlink_ipset.c nfnetlink_nft_compat.c nfnetlink_nftables.c \ + nfnetlink_osf.c nfnetlink_queue.c nfnetlink_ulog.c nlattr.c \ + nlattr_br_port_msg.c nlattr_crypto_user_alg.c nlattr_dcbmsg.c \ + nlattr_fib_rule_hdr.c nlattr_ifaddrlblmsg.c nlattr_ifaddrmsg.c \ + nlattr_ifinfomsg.c nlattr_ifla_af_spec.c nlattr_ifla_brport.c \ + nlattr_ifla_linkinfo.c nlattr_ifla_port.c nlattr_ifla_xdp.c \ + nlattr_inet_diag_msg.c nlattr_inet_diag_req_compat.c \ + nlattr_inet_diag_req_v2.c nlattr_mdba_mdb_entry.c \ + nlattr_mdba_router_port.c nlattr_ndmsg.c nlattr_ndtmsg.c \ + nlattr_netconfmsg.c nlattr_netlink_diag_msg.c \ + nlattr_nlmsgerr.c nlattr_packet_diag_msg.c nlattr_rtgenmsg.c \ + nlattr_rtmsg.c nlattr_smc_diag_msg.c nlattr_tc_stats.c \ + nlattr_tca_stab.c nlattr_tcamsg.c nlattr_tcmsg.c \ + nlattr_unix_diag_msg.c nsyscalls.c nsyscalls-d.c old_mmap.c \ + old_mmap-P.c old_mmap-Xabbrev.c old_mmap-Xraw.c \ + old_mmap-Xverbose.c old_mmap-v-none.c oldfstat.c oldlstat.c \ + oldselect.c oldselect-P.c oldselect-efault.c \ + oldselect-efault-P.c oldstat.c open.c openat.c \ + orphaned_process_group.c osf_utimes.c pause.c pc.c \ + perf_event_open.c perf_event_open_nonverbose.c \ + perf_event_open_unabbrev.c personality.c personality-Xabbrev.c \ + personality-Xraw.c personality-Xverbose.c pidfd_send_signal.c \ + pipe.c pipe2.c pkey_alloc.c pkey_free.c pkey_mprotect.c poll.c \ + poll-P.c ppoll.c ppoll-P.c ppoll-v.c prctl-arg2-intptr.c \ prctl-dumpable.c prctl-name.c prctl-no-args.c \ prctl-pdeathsig.c prctl-seccomp-filter-v.c \ - prctl-seccomp-strict.c prctl-securebits.c prctl-tid_address.c \ - prctl-tsc.c pread64-pwrite64.c preadv.c preadv-pwritev.c \ - preadv2-pwritev2.c print_maxfd.c printstr.c prlimit64.c \ - process_vm_readv.c process_vm_writev.c pselect6.c ptrace.c \ + prctl-seccomp-strict.c prctl-securebits.c prctl-spec-inject.c \ + prctl-tid_address.c prctl-tsc.c pread64-pwrite64.c preadv.c \ + preadv-pwritev.c preadv2-pwritev2.c print_maxfd.c \ + printpath-umovestr.c printpath-umovestr-peekdata.c \ + printpath-umovestr-undumpable.c printsignal-Xabbrev.c \ + printsignal-Xraw.c printsignal-Xverbose.c printstr.c \ + printstrn-umoven.c printstrn-umoven-peekdata.c \ + printstrn-umoven-undumpable.c prlimit64.c process_vm_readv.c \ + process_vm_writev.c pselect6.c ptrace.c ptrace_syscall_info.c \ pwritev.c qual_fault.c qual_inject-error-signal.c \ qual_inject-retval.c qual_inject-signal.c qual_signal.c \ - quotactl.c quotactl-v.c quotactl-xfs.c quotactl-xfs-v.c \ - read-write.c readahead.c readdir.c readlink.c readlinkat.c \ - readv.c reboot.c recvfrom.c recvmmsg-timeout.c recvmsg.c \ - redirect-fds.c remap_file_pages.c rename.c renameat.c \ - renameat2.c request_key.c restart_syscall.c rmdir.c \ - rt_sigpending.c rt_sigprocmask.c rt_sigqueueinfo.c \ + quotactl.c quotactl-Xabbrev.c quotactl-Xraw.c \ + quotactl-Xverbose.c quotactl-success.c quotactl-success-v.c \ + quotactl-v.c quotactl-xfs.c quotactl-xfs-success.c \ + quotactl-xfs-success-v.c quotactl-xfs-v.c read-write.c \ + readahead.c readdir.c readlink.c readlinkat.c readv.c reboot.c \ + recvfrom.c recvmmsg-timeout.c recvmsg.c redirect-fds.c \ + remap_file_pages.c remap_file_pages-Xabbrev.c \ + remap_file_pages-Xraw.c remap_file_pages-Xverbose.c rename.c \ + renameat.c renameat2.c request_key.c restart_syscall.c \ + riscv_flush_icache.c rmdir.c rt_sigaction.c rt_sigpending.c \ + rt_sigprocmask.c rt_sigqueueinfo.c rt_sigreturn.c \ rt_sigsuspend.c rt_sigtimedwait.c rt_tgsigqueueinfo.c \ + run_expect_termsig.c s390_guarded_storage.c \ + s390_guarded_storage-v.c s390_pci_mmio_read_write.c \ + s390_runtime_instr.c s390_sthyi.c s390_sthyi-v.c \ sched_get_priority_mxx.c sched_rr_get_interval.c \ sched_xetaffinity.c sched_xetattr.c sched_xetparam.c \ sched_xetscheduler.c sched_yield.c scm_rights.c \ - seccomp-filter.c seccomp-filter-v.c seccomp-strict.c select.c \ - semop.c sendfile.c sendfile64.c set_mempolicy.c \ - set_ptracer_any.c setdomainname.c setfsgid.c setfsgid32.c \ - setfsuid.c setfsuid32.c setgid.c setgid32.c setgroups.c \ - setgroups32.c sethostname.c setns.c setregid.c setregid32.c \ - setresgid.c setresgid32.c setresuid.c setresuid32.c setreuid.c \ - setreuid32.c setrlimit.c setuid.c setuid32.c shmxt.c \ - shutdown.c sigaction.c sigaltstack.c siginfo.c \ - signal_receive.c signalfd4.c sigreturn.c sleep.c socketcall.c \ - splice.c $(stack_fcall_SOURCES) stat.c stat64.c statfs.c \ - statfs64.c swap.c symlink.c symlinkat.c sync.c \ - sync_file_range.c sync_file_range2.c sysinfo.c syslog.c tee.c \ - threads-execve.c time.c timer_create.c timer_xettime.c \ - timerfd_xettime.c times.c times-fail.c truncate.c truncate64.c \ - ugetrlimit.c uio.c umask.c umount.c umount2.c umoven-illptr.c \ - umovestr.c umovestr-illptr.c umovestr2.c umovestr3.c uname.c \ - unix-pair-send-recv.c unix-pair-sendto-recvfrom.c unlink.c \ - unlinkat.c unshare.c userfaultfd.c ustat.c utime.c utimensat.c \ - utimes.c vfork-f.c vhangup.c vmsplice.c wait4.c wait4-v.c \ - waitid.c waitid-v.c waitpid.c xattr.c xattr-strings.c \ - xet_robust_list.c xetitimer.c xetpgid.c xetpriority.c \ - xettimeofday.c -DIST_SOURCES = $(libtests_a_SOURCES) _newselect.c accept.c accept4.c \ - access.c acct.c add_key.c adjtimex.c aio.c alarm.c answer.c \ - attach-f-p.c attach-f-p-cmd.c attach-p-cmd-cmd.c \ - attach-p-cmd-p.c bpf.c brk.c btrfs.c caps.c caps-abbrev.c \ - chmod.c chown.c chown32.c chroot.c clock_adjtime.c \ - clock_nanosleep.c clock_xettime.c copy_file_range.c count-f.c \ - creat.c delete_module.c dup.c dup2.c dup3.c epoll_create.c \ - epoll_create1.c epoll_ctl.c epoll_pwait.c epoll_wait.c \ - erestartsys.c eventfd.c execve.c execve-v.c execveat.c \ - execveat-v.c faccessat.c fadvise64.c fadvise64_64.c \ - fallocate.c fanotify_init.c fanotify_mark.c fchdir.c fchmod.c \ - fchmodat.c fchown.c fchown32.c fchownat.c fcntl.c fcntl64.c \ - fdatasync.c file_handle.c file_ioctl.c filter-unavailable.c \ - finit_module.c flock.c fork-f.c fstat.c fstat64.c fstatat64.c \ - fstatfs.c fstatfs64.c fsync.c ftruncate.c ftruncate64.c \ - futex.c futimesat.c get_mempolicy.c getcpu.c getcwd.c \ - getdents.c getdents64.c getegid.c getegid32.c geteuid.c \ - geteuid32.c getgid.c getgid32.c getgroups.c getgroups32.c \ - getpeername.c getpgrp.c getrandom.c getresgid.c getresgid32.c \ + seccomp-filter.c seccomp-filter-v.c seccomp-strict.c \ + seccomp_get_action_avail.c select.c select-P.c semop.c \ + sendfile.c sendfile64.c set_mempolicy.c set_ptracer_any.c \ + set_sigblock.c set_sigign.c setdomainname.c setfsgid.c \ + setfsgid32.c setfsuid.c setfsuid32.c setgid.c setgid32.c \ + setgroups.c setgroups32.c sethostname.c setns.c setregid.c \ + setregid32.c setresgid.c setresgid32.c setresuid.c \ + setresuid32.c setreuid.c setreuid32.c setrlimit.c \ + setrlimit-Xabbrev.c setrlimit-Xraw.c setrlimit-Xverbose.c \ + setuid.c setuid32.c shmxt.c shutdown.c sigaction.c \ + sigaltstack.c siginfo.c signal.c signal_receive.c signalfd4.c \ + sigpending.c sigprocmask.c sigreturn.c sigsuspend.c sleep.c \ + so_error.c so_linger.c so_peercred.c so_peercred-Xabbrev.c \ + so_peercred-Xraw.c so_peercred-Xverbose.c sock_filter-v.c \ + sock_filter-v-Xabbrev.c sock_filter-v-Xraw.c \ + sock_filter-v-Xverbose.c sockaddr_xlat-Xabbrev.c \ + sockaddr_xlat-Xraw.c sockaddr_xlat-Xverbose.c socketcall.c \ + sockopt-sol_netlink.c sockopt-timestamp.c splice.c \ + $(stack_fcall_SOURCES) $(stack_fcall_mangled_SOURCES) stat.c \ + stat64.c statfs.c statfs64.c statx.c swap.c sxetmask.c \ + symlink.c symlinkat.c sync.c sync_file_range.c \ + sync_file_range2.c sysinfo.c syslog.c tee.c threads-execve.c \ + time.c timer_create.c timer_xettime.c timerfd_xettime.c \ + times.c times-fail.c truncate.c truncate64.c ugetrlimit.c \ + uio.c umask.c umount.c umount2.c umoven-illptr.c umovestr.c \ + umovestr-illptr.c umovestr2.c umovestr3.c uname.c \ + unblock_reset_raise.c unix-pair-send-recv.c \ + unix-pair-sendto-recvfrom.c unlink.c unlinkat.c unshare.c \ + userfaultfd.c ustat.c utime.c utimensat.c utimensat-Xabbrev.c \ + utimensat-Xraw.c utimensat-Xverbose.c utimes.c vfork-f.c \ + vhangup.c vmsplice.c wait4.c wait4-v.c waitid.c waitid-v.c \ + waitpid.c xattr.c xattr-strings.c xet_robust_list.c \ + xet_thread_area_x86.c xetitimer.c xetpgid.c xetpriority.c \ + xettimeofday.c zeroargc.c +DIST_SOURCES = $(libtests_a_SOURCES) _newselect.c _newselect-P.c \ + accept.c accept4.c access.c acct.c add_key.c adjtimex.c aio.c \ + aio_pgetevents.c alarm.c answer.c attach-f-p.c \ + attach-f-p-cmd.c attach-p-cmd-cmd.c attach-p-cmd-p.c \ + block_reset_raise_run.c bpf.c bpf-obj_get_info_by_fd.c \ + bpf-obj_get_info_by_fd-prog.c bpf-obj_get_info_by_fd-prog-v.c \ + bpf-obj_get_info_by_fd-v.c bpf-success.c bpf-success-v.c \ + bpf-v.c brk.c btrfs.c caps.c caps-abbrev.c check_sigblock.c \ + check_sigign.c chmod.c chown.c chown32.c chroot.c \ + clock_adjtime.c clock_nanosleep.c clock_xettime.c \ + clone_parent.c clone_ptrace.c copy_file_range.c count-f.c \ + creat.c delay.c delete_module.c dev-yy.c dup.c dup2.c dup3.c \ + epoll_create.c epoll_create1.c epoll_ctl.c epoll_pwait.c \ + epoll_wait.c erestartsys.c eventfd.c execve.c execve-v.c \ + execveat.c execveat-v.c faccessat.c fadvise64.c fadvise64_64.c \ + fallocate.c fanotify_init.c fanotify_mark.c \ + fanotify_mark-Xabbrev.c fanotify_mark-Xraw.c \ + fanotify_mark-Xverbose.c fchdir.c fchmod.c fchmodat.c fchown.c \ + fchown32.c fchownat.c fcntl.c fcntl64.c fdatasync.c fflush.c \ + file_handle.c file_ioctl.c filter-unavailable.c finit_module.c \ + flock.c fork-f.c fstat.c fstat-Xabbrev.c fstat-Xraw.c \ + fstat-Xverbose.c fstat64.c fstat64-Xabbrev.c fstat64-Xraw.c \ + fstat64-Xverbose.c fstatat64.c fstatfs.c fstatfs64.c fsync.c \ + fsync-y.c ftruncate.c ftruncate64.c futex.c futimesat.c \ + get_mempolicy.c getcpu.c getcwd.c getdents.c getdents64.c \ + getegid.c getegid32.c geteuid.c geteuid32.c getgid.c \ + getgid32.c getgroups.c getgroups32.c getpeername.c getpgrp.c \ + getpid.c getppid.c getrandom.c getresgid.c getresgid32.c \ getresuid.c getresuid32.c getrlimit.c getrusage.c getsid.c \ - getsockname.c getuid.c getuid32.c getxxid.c inet-cmsg.c \ - init_module.c inotify.c inotify_init1.c ioctl.c ioctl_block.c \ - ioctl_dm.c ioctl_dm-v.c ioctl_evdev.c ioctl_evdev-v.c \ + getsockname.c gettid.c getuid.c getuid32.c getxxid.c \ + group_req.c inet-cmsg.c init_module.c inject-nf.c inotify.c \ + inotify_init1.c int_0x80.c io_uring_enter.c \ + io_uring_register.c io_uring_setup.c ioctl.c ioctl_block.c \ + ioctl_dm.c ioctl_dm-v.c ioctl_evdev.c ioctl_evdev-success.c \ + ioctl_evdev-success-v.c ioctl_evdev-v.c ioctl_inotify.c \ + ioctl_kvm_run.c ioctl_kvm_run-v.c ioctl_kvm_run_auxstr_vcpu.c \ ioctl_loop.c ioctl_loop-nv.c ioctl_loop-v.c ioctl_mtd.c \ - ioctl_rtc.c ioctl_rtc-v.c ioctl_scsi.c ioctl_sg_io_v3.c \ - ioctl_sg_io_v4.c ioctl_sock_gifconf.c ioctl_uffdio.c \ - ioctl_v4l2.c ioperm.c iopl.c ioprio.c ip_mreq.c ipc.c \ - ipc_msg.c ipc_msgbuf.c ipc_sem.c ipc_shm.c kcmp.c \ - kexec_file_load.c kexec_load.c keyctl.c kill.c ksysent.c \ - lchown.c lchown32.c link.c linkat.c llseek.c lookup_dcookie.c \ - lseek.c lstat.c lstat64.c mbind.c membarrier.c memfd_create.c \ - migrate_pages.c mincore.c mkdir.c mkdirat.c mknod.c mknodat.c \ - mlock.c mlock2.c mlockall.c mmap.c mmap64.c mmsg.c \ - mmsg-silent.c mmsg_name.c mmsg_name-v.c mount.c move_pages.c \ + ioctl_nbd.c ioctl_nsfs.c ioctl_perf.c ioctl_perf-success.c \ + ioctl_ptp.c ioctl_random.c ioctl_rtc.c ioctl_rtc-v.c \ + ioctl_scsi.c ioctl_sg_io_v3.c ioctl_sg_io_v4.c \ + ioctl_sock_gifconf.c ioctl_uffdio.c ioctl_v4l2.c ioperm.c \ + iopl.c ioprio.c ioprio-Xabbrev.c ioprio-Xraw.c \ + ioprio-Xverbose.c ip_mreq.c ipc.c ipc_msg.c ipc_msg-Xabbrev.c \ + ipc_msg-Xraw.c ipc_msg-Xverbose.c ipc_msgbuf.c \ + ipc_msgbuf-Xabbrev.c ipc_msgbuf-Xraw.c ipc_msgbuf-Xverbose.c \ + ipc_sem.c ipc_sem-Xabbrev.c ipc_sem-Xraw.c ipc_sem-Xverbose.c \ + ipc_shm.c ipc_shm-Xabbrev.c ipc_shm-Xraw.c ipc_shm-Xverbose.c \ + is_linux_mips_n64.c kcmp.c kcmp-y.c kern_features.c \ + kernel_version.c kernel_version-Xabbrev.c \ + kernel_version-Xraw.c kernel_version-Xverbose.c \ + kexec_file_load.c kexec_load.c keyctl.c keyctl-Xabbrev.c \ + keyctl-Xraw.c keyctl-Xverbose.c kill.c kill_child.c ksysent.c \ + lchown.c lchown32.c link.c linkat.c list_sigaction_signum.c \ + llseek.c localtime.c lookup_dcookie.c looping_threads.c \ + lseek.c lstat.c lstat64.c madvise.c mbind.c membarrier.c \ + memfd_create.c memfd_create-Xabbrev.c memfd_create-Xraw.c \ + memfd_create-Xverbose.c migrate_pages.c mincore.c mkdir.c \ + mkdirat.c mknod.c mknodat.c mlock.c mlock2.c mlockall.c mmap.c \ + mmap-Xabbrev.c mmap-Xraw.c mmap-Xverbose.c mmap64.c \ + mmap64-Xabbrev.c mmap64-Xraw.c mmap64-Xverbose.c mmsg.c \ + mmsg-silent.c mmsg_name.c mmsg_name-v.c modify_ldt.c mount.c \ + mount-Xabbrev.c mount-Xraw.c mount-Xverbose.c move_pages.c \ + move_pages-Xabbrev.c move_pages-Xraw.c move_pages-Xverbose.c \ mq.c mq_sendrecv.c mq_sendrecv-read.c mq_sendrecv-write.c \ msg_control.c msg_control-v.c msg_name.c munlockall.c \ nanosleep.c net-accept-connect.c net-icmp_filter.c \ - net-sockaddr.c net-y-unix.c net-yy-inet.c net-yy-netlink.c \ - net-yy-unix.c netlink_inet_diag.c netlink_netlink_diag.c \ - netlink_protocol.c netlink_unix_diag.c newfstatat.c \ - nsyscalls.c old_mmap.c oldfstat.c oldlstat.c oldselect.c \ - oldstat.c open.c openat.c pause.c pc.c perf_event_open.c \ - perf_event_open_nonverbose.c perf_event_open_unabbrev.c \ - personality.c pipe.c pipe2.c pkey_alloc.c pkey_free.c \ - pkey_mprotect.c poll.c ppoll.c prctl-arg2-intptr.c \ + net-packet_mreq.c net-packet_mreq-Xabbrev.c \ + net-packet_mreq-Xraw.c net-packet_mreq-Xverbose.c \ + net-sockaddr.c net-tpacket_req.c net-tpacket_stats.c \ + net-tpacket_stats-success.c net-y-unix.c net-yy-inet.c \ + net-yy-inet6.c net-yy-netlink.c net-yy-unix.c netlink_audit.c \ + netlink_crypto.c netlink_generic.c netlink_inet_diag.c \ + netlink_kobject_uevent.c netlink_netfilter.c \ + netlink_netlink_diag.c netlink_protocol.c netlink_route.c \ + netlink_selinux.c netlink_sock_diag.c netlink_unix_diag.c \ + netlink_xfrm.c newfstatat.c nfnetlink_acct.c \ + nfnetlink_cthelper.c nfnetlink_ctnetlink.c \ + nfnetlink_ctnetlink_exp.c nfnetlink_cttimeout.c \ + nfnetlink_ipset.c nfnetlink_nft_compat.c nfnetlink_nftables.c \ + nfnetlink_osf.c nfnetlink_queue.c nfnetlink_ulog.c nlattr.c \ + nlattr_br_port_msg.c nlattr_crypto_user_alg.c nlattr_dcbmsg.c \ + nlattr_fib_rule_hdr.c nlattr_ifaddrlblmsg.c nlattr_ifaddrmsg.c \ + nlattr_ifinfomsg.c nlattr_ifla_af_spec.c nlattr_ifla_brport.c \ + nlattr_ifla_linkinfo.c nlattr_ifla_port.c nlattr_ifla_xdp.c \ + nlattr_inet_diag_msg.c nlattr_inet_diag_req_compat.c \ + nlattr_inet_diag_req_v2.c nlattr_mdba_mdb_entry.c \ + nlattr_mdba_router_port.c nlattr_ndmsg.c nlattr_ndtmsg.c \ + nlattr_netconfmsg.c nlattr_netlink_diag_msg.c \ + nlattr_nlmsgerr.c nlattr_packet_diag_msg.c nlattr_rtgenmsg.c \ + nlattr_rtmsg.c nlattr_smc_diag_msg.c nlattr_tc_stats.c \ + nlattr_tca_stab.c nlattr_tcamsg.c nlattr_tcmsg.c \ + nlattr_unix_diag_msg.c nsyscalls.c nsyscalls-d.c old_mmap.c \ + old_mmap-P.c old_mmap-Xabbrev.c old_mmap-Xraw.c \ + old_mmap-Xverbose.c old_mmap-v-none.c oldfstat.c oldlstat.c \ + oldselect.c oldselect-P.c oldselect-efault.c \ + oldselect-efault-P.c oldstat.c open.c openat.c \ + orphaned_process_group.c osf_utimes.c pause.c pc.c \ + perf_event_open.c perf_event_open_nonverbose.c \ + perf_event_open_unabbrev.c personality.c personality-Xabbrev.c \ + personality-Xraw.c personality-Xverbose.c pidfd_send_signal.c \ + pipe.c pipe2.c pkey_alloc.c pkey_free.c pkey_mprotect.c poll.c \ + poll-P.c ppoll.c ppoll-P.c ppoll-v.c prctl-arg2-intptr.c \ prctl-dumpable.c prctl-name.c prctl-no-args.c \ prctl-pdeathsig.c prctl-seccomp-filter-v.c \ - prctl-seccomp-strict.c prctl-securebits.c prctl-tid_address.c \ - prctl-tsc.c pread64-pwrite64.c preadv.c preadv-pwritev.c \ - preadv2-pwritev2.c print_maxfd.c printstr.c prlimit64.c \ - process_vm_readv.c process_vm_writev.c pselect6.c ptrace.c \ + prctl-seccomp-strict.c prctl-securebits.c prctl-spec-inject.c \ + prctl-tid_address.c prctl-tsc.c pread64-pwrite64.c preadv.c \ + preadv-pwritev.c preadv2-pwritev2.c print_maxfd.c \ + printpath-umovestr.c printpath-umovestr-peekdata.c \ + printpath-umovestr-undumpable.c printsignal-Xabbrev.c \ + printsignal-Xraw.c printsignal-Xverbose.c printstr.c \ + printstrn-umoven.c printstrn-umoven-peekdata.c \ + printstrn-umoven-undumpable.c prlimit64.c process_vm_readv.c \ + process_vm_writev.c pselect6.c ptrace.c ptrace_syscall_info.c \ pwritev.c qual_fault.c qual_inject-error-signal.c \ qual_inject-retval.c qual_inject-signal.c qual_signal.c \ - quotactl.c quotactl-v.c quotactl-xfs.c quotactl-xfs-v.c \ - read-write.c readahead.c readdir.c readlink.c readlinkat.c \ - readv.c reboot.c recvfrom.c recvmmsg-timeout.c recvmsg.c \ - redirect-fds.c remap_file_pages.c rename.c renameat.c \ - renameat2.c request_key.c restart_syscall.c rmdir.c \ - rt_sigpending.c rt_sigprocmask.c rt_sigqueueinfo.c \ + quotactl.c quotactl-Xabbrev.c quotactl-Xraw.c \ + quotactl-Xverbose.c quotactl-success.c quotactl-success-v.c \ + quotactl-v.c quotactl-xfs.c quotactl-xfs-success.c \ + quotactl-xfs-success-v.c quotactl-xfs-v.c read-write.c \ + readahead.c readdir.c readlink.c readlinkat.c readv.c reboot.c \ + recvfrom.c recvmmsg-timeout.c recvmsg.c redirect-fds.c \ + remap_file_pages.c remap_file_pages-Xabbrev.c \ + remap_file_pages-Xraw.c remap_file_pages-Xverbose.c rename.c \ + renameat.c renameat2.c request_key.c restart_syscall.c \ + riscv_flush_icache.c rmdir.c rt_sigaction.c rt_sigpending.c \ + rt_sigprocmask.c rt_sigqueueinfo.c rt_sigreturn.c \ rt_sigsuspend.c rt_sigtimedwait.c rt_tgsigqueueinfo.c \ + run_expect_termsig.c s390_guarded_storage.c \ + s390_guarded_storage-v.c s390_pci_mmio_read_write.c \ + s390_runtime_instr.c s390_sthyi.c s390_sthyi-v.c \ sched_get_priority_mxx.c sched_rr_get_interval.c \ sched_xetaffinity.c sched_xetattr.c sched_xetparam.c \ sched_xetscheduler.c sched_yield.c scm_rights.c \ - seccomp-filter.c seccomp-filter-v.c seccomp-strict.c select.c \ - semop.c sendfile.c sendfile64.c set_mempolicy.c \ - set_ptracer_any.c setdomainname.c setfsgid.c setfsgid32.c \ - setfsuid.c setfsuid32.c setgid.c setgid32.c setgroups.c \ - setgroups32.c sethostname.c setns.c setregid.c setregid32.c \ - setresgid.c setresgid32.c setresuid.c setresuid32.c setreuid.c \ - setreuid32.c setrlimit.c setuid.c setuid32.c shmxt.c \ - shutdown.c sigaction.c sigaltstack.c siginfo.c \ - signal_receive.c signalfd4.c sigreturn.c sleep.c socketcall.c \ - splice.c $(stack_fcall_SOURCES) stat.c stat64.c statfs.c \ - statfs64.c swap.c symlink.c symlinkat.c sync.c \ - sync_file_range.c sync_file_range2.c sysinfo.c syslog.c tee.c \ - threads-execve.c time.c timer_create.c timer_xettime.c \ - timerfd_xettime.c times.c times-fail.c truncate.c truncate64.c \ - ugetrlimit.c uio.c umask.c umount.c umount2.c umoven-illptr.c \ - umovestr.c umovestr-illptr.c umovestr2.c umovestr3.c uname.c \ - unix-pair-send-recv.c unix-pair-sendto-recvfrom.c unlink.c \ - unlinkat.c unshare.c userfaultfd.c ustat.c utime.c utimensat.c \ - utimes.c vfork-f.c vhangup.c vmsplice.c wait4.c wait4-v.c \ - waitid.c waitid-v.c waitpid.c xattr.c xattr-strings.c \ - xet_robust_list.c xetitimer.c xetpgid.c xetpriority.c \ - xettimeofday.c + seccomp-filter.c seccomp-filter-v.c seccomp-strict.c \ + seccomp_get_action_avail.c select.c select-P.c semop.c \ + sendfile.c sendfile64.c set_mempolicy.c set_ptracer_any.c \ + set_sigblock.c set_sigign.c setdomainname.c setfsgid.c \ + setfsgid32.c setfsuid.c setfsuid32.c setgid.c setgid32.c \ + setgroups.c setgroups32.c sethostname.c setns.c setregid.c \ + setregid32.c setresgid.c setresgid32.c setresuid.c \ + setresuid32.c setreuid.c setreuid32.c setrlimit.c \ + setrlimit-Xabbrev.c setrlimit-Xraw.c setrlimit-Xverbose.c \ + setuid.c setuid32.c shmxt.c shutdown.c sigaction.c \ + sigaltstack.c siginfo.c signal.c signal_receive.c signalfd4.c \ + sigpending.c sigprocmask.c sigreturn.c sigsuspend.c sleep.c \ + so_error.c so_linger.c so_peercred.c so_peercred-Xabbrev.c \ + so_peercred-Xraw.c so_peercred-Xverbose.c sock_filter-v.c \ + sock_filter-v-Xabbrev.c sock_filter-v-Xraw.c \ + sock_filter-v-Xverbose.c sockaddr_xlat-Xabbrev.c \ + sockaddr_xlat-Xraw.c sockaddr_xlat-Xverbose.c socketcall.c \ + sockopt-sol_netlink.c sockopt-timestamp.c splice.c \ + $(stack_fcall_SOURCES) $(stack_fcall_mangled_SOURCES) stat.c \ + stat64.c statfs.c statfs64.c statx.c swap.c sxetmask.c \ + symlink.c symlinkat.c sync.c sync_file_range.c \ + sync_file_range2.c sysinfo.c syslog.c tee.c threads-execve.c \ + time.c timer_create.c timer_xettime.c timerfd_xettime.c \ + times.c times-fail.c truncate.c truncate64.c ugetrlimit.c \ + uio.c umask.c umount.c umount2.c umoven-illptr.c umovestr.c \ + umovestr-illptr.c umovestr2.c umovestr3.c uname.c \ + unblock_reset_raise.c unix-pair-send-recv.c \ + unix-pair-sendto-recvfrom.c unlink.c unlinkat.c unshare.c \ + userfaultfd.c ustat.c utime.c utimensat.c utimensat-Xabbrev.c \ + utimensat-Xraw.c utimensat-Xverbose.c utimes.c vfork-f.c \ + vhangup.c vmsplice.c wait4.c wait4-v.c waitid.c waitid-v.c \ + waitpid.c xattr.c xattr-strings.c xet_robust_list.c \ + xet_thread_area_x86.c xetitimer.c xetpgid.c xetpriority.c \ + xettimeofday.c zeroargc.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac -am__extra_recursive_targets = check-valgrind-recursive +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -2214,7 +3848,7 @@ am__set_TESTS_bases = \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck -@USE_LIBUNWIND_TRUE@am__EXEEXT_1 = strace-k.test +@ENABLE_STACKTRACE_TRUE@am__EXEEXT_2 = strace-k.test $(am__append_1) TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test am__test_logs1 = $(TESTS:=.log) @@ -2233,6 +3867,9 @@ am__set_b = \ *) \ b='$*';; \ esac +am__DIST_COMMON = $(srcdir)/../scno.am $(srcdir)/Makefile.in \ + $(srcdir)/gen_tests.am $(srcdir)/pure_executables.am \ + $(top_srcdir)/depcomp $(top_srcdir)/test-driver COPYING DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -2253,6 +3890,8 @@ CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ +COPYRIGHT_YEAR = @COPYRIGHT_YEAR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ @@ -2286,6 +3925,7 @@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANPAGE_DATE = @MANPAGE_DATE@ MIPS_ABI = @MIPS_ABI@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ @@ -2299,10 +3939,13 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ +READELF = @READELF@ RPM_CHANGELOGTIME = @RPM_CHANGELOGTIME@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIZEOF_KERNEL_LONG_T = @SIZEOF_KERNEL_LONG_T@ +SIZEOF_LONG = 4 STRIP = @STRIP@ VALGRIND = @VALGRIND@ VALGRIND_ENABLED = @VALGRIND_ENABLED@ @@ -2323,6 +3966,7 @@ am__untar = @am__untar@ arch = @arch@ arch_m32 = @arch_m32@ arch_mx32 = @arch_mx32@ +arch_native = @arch_native@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -2330,6 +3974,9 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +cc_flags_m32 = @cc_flags_m32@ +cc_flags_mx32 = @cc_flags_mx32@ +clock_LIBS = @clock_LIBS@ datadir = @datadir@ datarootdir = @datarootdir@ dl_LIBS = @dl_LIBS@ @@ -2346,7 +3993,14 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ +libdw_CFLAGS = @libdw_CFLAGS@ +libdw_CPPFLAGS = @libdw_CPPFLAGS@ +libdw_LDFLAGS = @libdw_LDFLAGS@ +libdw_LIBS = @libdw_LIBS@ libexecdir = @libexecdir@ +libiberty_CPPFLAGS = @libiberty_CPPFLAGS@ +libiberty_LDFLAGS = @libiberty_LDFLAGS@ +libiberty_LIBS = @libiberty_LIBS@ libunwind_CPPFLAGS = @libunwind_CPPFLAGS@ libunwind_LDFLAGS = @libunwind_LDFLAGS@ libunwind_LIBS = @libunwind_LIBS@ @@ -2354,6 +4008,7 @@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ +mq_LIBS = @mq_LIBS@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ @@ -2364,6 +4019,7 @@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +timer_LIBS = @timer_LIBS@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @@ -2371,8 +4027,10 @@ valgrind_enabled_tools = @valgrind_enabled_tools@ valgrind_tools = @valgrind_tools@ OS = linux ARCH = @arch_mx32@ +NATIVE_ARCH = @arch_native@ MPERS_NAME = mx32 -ARCH_MFLAGS = -DMPERS_IS_$(MPERS_NAME) -mx32 +MPERS_CC_FLAGS = @cc_flags_mx32@ +ARCH_MFLAGS = -DMPERS_IS_$(MPERS_NAME) $(MPERS_CC_FLAGS) AM_CFLAGS = $(WARN_CFLAGS) AM_CPPFLAGS = $(ARCH_MFLAGS) \ -I$(builddir) \ @@ -2381,27 +4039,40 @@ AM_CPPFLAGS = $(ARCH_MFLAGS) \ -I$(top_builddir)/$(OS) \ -I$(top_srcdir)/$(OS) \ -I$(top_builddir) \ - -I$(top_srcdir) + -I$(top_srcdir) \ + -DTESTS_SIZEOF_KERNEL_LONG_T=$(SIZEOF_KERNEL_LONG_T) \ + -DTESTS_SIZEOF_LONG=$(SIZEOF_LONG) AM_LDFLAGS = $(ARCH_MFLAGS) libtests_a_SOURCES = \ + create_nl_socket.c \ errno2name.c \ error_msg.c \ fill_memory.c \ get_page_size.c \ + get_sigset_size.c \ hexdump_strdup.c \ hexquote_strndup.c \ + ifindex.c \ inode_of_sockfd.c \ libmmsg.c \ libsocketcall.c \ overflowuid.c \ pipe_maxfd.c \ print_quoted_string.c \ + print_time.c \ printflags.c \ printxval.c \ signal2name.c \ + skip_unavailable.c \ sprintrc.c \ tail_alloc.c \ + test_netlink.h \ + test_nlattr.h \ + test_printpath.c \ + test_printstrn.c \ + test_ucopy.c \ + test_ucopy.h \ tests.h \ tprintf.c \ # end of libtests_a_SOURCES @@ -2409,19 +4080,545 @@ libtests_a_SOURCES = \ libtests_a_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 check_LIBRARIES = libtests.a LDADD = libtests.a -attach_f_p_LDADD = -lrt -lpthread $(LDADD) -clock_xettime_LDADD = -lrt $(LDADD) + +# Generated by ./tests/gen_pure_executables.sh from ./tests/pure_executables.list; do not edit. +PURE_EXECUTABLES = \ + _newselect \ + accept \ + accept4 \ + access \ + acct \ + add_key \ + adjtimex \ + aio \ + aio_pgetevents \ + alarm \ + bpf \ + bpf-obj_get_info_by_fd \ + bpf-obj_get_info_by_fd-prog \ + bpf-obj_get_info_by_fd-prog-v \ + bpf-obj_get_info_by_fd-v \ + bpf-v \ + brk \ + btrfs \ + caps \ + chmod \ + chown \ + chown32 \ + chroot \ + clock_adjtime \ + clock_nanosleep \ + clock_xettime \ + copy_file_range \ + creat \ + delete_module \ + dev-yy \ + dup \ + dup2 \ + dup3 \ + epoll_create \ + epoll_create1 \ + epoll_ctl \ + epoll_pwait \ + epoll_wait \ + erestartsys \ + eventfd \ + execve \ + execveat \ + faccessat \ + fadvise64 \ + fadvise64_64 \ + fallocate \ + fanotify_init \ + fanotify_mark \ + fanotify_mark-Xabbrev \ + fanotify_mark-Xraw \ + fanotify_mark-Xverbose \ + fchdir \ + fchmod \ + fchmodat \ + fchown \ + fchown32 \ + fchownat \ + fcntl \ + fcntl64 \ + fdatasync \ + fflush \ + file_handle \ + file_ioctl \ + finit_module \ + flock \ + fstat \ + fstat-Xabbrev \ + fstat-Xraw \ + fstat-Xverbose \ + fstat64 \ + fstat64-Xabbrev \ + fstat64-Xraw \ + fstat64-Xverbose \ + fstatat64 \ + fstatfs \ + fstatfs64 \ + fsync \ + ftruncate \ + ftruncate64 \ + futex \ + futimesat \ + get_mempolicy \ + getcpu \ + getcwd \ + getdents \ + getdents64 \ + getegid \ + getegid32 \ + geteuid \ + geteuid32 \ + getgid \ + getgid32 \ + getgroups \ + getgroups32 \ + getpeername \ + getpgrp \ + getpid \ + getppid \ + getrandom \ + getresgid \ + getresgid32 \ + getresuid \ + getresuid32 \ + getrlimit \ + getrusage \ + getsid \ + getsockname \ + getuid \ + getuid32 \ + getxxid \ + group_req \ + inet-cmsg \ + init_module \ + inotify \ + inotify_init1 \ + io_uring_enter \ + io_uring_register \ + io_uring_setup \ + ioctl \ + ioctl_block \ + ioctl_dm \ + ioctl_evdev \ + ioctl_inotify \ + ioctl_kvm_run \ + ioctl_kvm_run-v \ + ioctl_kvm_run_auxstr_vcpu \ + ioctl_loop \ + ioctl_mtd \ + ioctl_nbd \ + ioctl_perf \ + ioctl_ptp \ + ioctl_random \ + ioctl_rtc \ + ioctl_scsi \ + ioctl_sg_io_v3 \ + ioctl_sg_io_v4 \ + ioctl_sock_gifconf \ + ioctl_uffdio \ + ioctl_v4l2 \ + ioperm \ + iopl \ + ioprio \ + ioprio-Xabbrev \ + ioprio-Xraw \ + ioprio-Xverbose \ + ip_mreq \ + ipc \ + ipc_msg \ + ipc_msg-Xabbrev \ + ipc_msg-Xraw \ + ipc_msg-Xverbose \ + ipc_msgbuf \ + ipc_msgbuf-Xabbrev \ + ipc_msgbuf-Xraw \ + ipc_msgbuf-Xverbose \ + ipc_sem \ + ipc_sem-Xabbrev \ + ipc_sem-Xraw \ + ipc_sem-Xverbose \ + ipc_shm \ + ipc_shm-Xabbrev \ + ipc_shm-Xraw \ + ipc_shm-Xverbose \ + kcmp \ + kcmp-y \ + kern_features \ + kernel_version \ + kernel_version-Xabbrev \ + kernel_version-Xraw \ + kernel_version-Xverbose \ + kexec_file_load \ + kexec_load \ + keyctl \ + keyctl-Xabbrev \ + keyctl-Xraw \ + keyctl-Xverbose \ + kill \ + lchown \ + lchown32 \ + link \ + linkat \ + llseek \ + lookup_dcookie \ + lseek \ + lstat \ + lstat64 \ + madvise \ + mbind \ + membarrier \ + memfd_create \ + memfd_create-Xabbrev \ + memfd_create-Xraw \ + memfd_create-Xverbose \ + migrate_pages \ + mincore \ + mkdir \ + mkdirat \ + mknod \ + mknodat \ + mlock \ + mlock2 \ + mlockall \ + mmap \ + mmap-Xabbrev \ + mmap-Xraw \ + mmap-Xverbose \ + mmap64 \ + mmap64-Xabbrev \ + mmap64-Xraw \ + mmap64-Xverbose \ + mmsg \ + mmsg_name \ + modify_ldt \ + mount \ + mount-Xabbrev \ + mount-Xraw \ + mount-Xverbose \ + move_pages \ + move_pages-Xabbrev \ + move_pages-Xraw \ + move_pages-Xverbose \ + mq \ + mq_sendrecv \ + mq_sendrecv-read \ + mq_sendrecv-write \ + msg_control \ + msg_name \ + munlockall \ + nanosleep \ + net-icmp_filter \ + net-packet_mreq \ + net-packet_mreq-Xabbrev \ + net-packet_mreq-Xraw \ + net-packet_mreq-Xverbose \ + net-sockaddr \ + net-tpacket_req \ + net-tpacket_stats \ + net-y-unix \ + net-yy-inet \ + net-yy-inet6 \ + net-yy-netlink \ + net-yy-unix \ + netlink_audit \ + netlink_crypto \ + netlink_generic \ + netlink_kobject_uevent \ + netlink_netfilter \ + netlink_protocol \ + netlink_route \ + netlink_selinux \ + netlink_sock_diag \ + netlink_xfrm \ + newfstatat \ + nfnetlink_acct \ + nfnetlink_cthelper \ + nfnetlink_ctnetlink \ + nfnetlink_ctnetlink_exp \ + nfnetlink_cttimeout \ + nfnetlink_ipset \ + nfnetlink_nft_compat \ + nfnetlink_nftables \ + nfnetlink_osf \ + nfnetlink_queue \ + nfnetlink_ulog \ + nlattr \ + nlattr_br_port_msg \ + nlattr_crypto_user_alg \ + nlattr_dcbmsg \ + nlattr_fib_rule_hdr \ + nlattr_ifaddrlblmsg \ + nlattr_ifaddrmsg \ + nlattr_ifinfomsg \ + nlattr_ifla_af_spec \ + nlattr_ifla_brport \ + nlattr_ifla_linkinfo \ + nlattr_ifla_port \ + nlattr_ifla_xdp \ + nlattr_inet_diag_msg \ + nlattr_inet_diag_req_compat \ + nlattr_inet_diag_req_v2 \ + nlattr_mdba_mdb_entry \ + nlattr_mdba_router_port \ + nlattr_ndmsg \ + nlattr_ndtmsg \ + nlattr_netconfmsg \ + nlattr_netlink_diag_msg \ + nlattr_nlmsgerr \ + nlattr_packet_diag_msg \ + nlattr_rtgenmsg \ + nlattr_rtmsg \ + nlattr_smc_diag_msg \ + nlattr_tc_stats \ + nlattr_tca_stab \ + nlattr_tcamsg \ + nlattr_tcmsg \ + nlattr_unix_diag_msg \ + old_mmap \ + old_mmap-P \ + old_mmap-Xabbrev \ + old_mmap-Xraw \ + old_mmap-Xverbose \ + old_mmap-v-none \ + oldfstat \ + oldlstat \ + oldselect \ + oldselect-efault \ + oldstat \ + open \ + openat \ + osf_utimes \ + pause \ + perf_event_open \ + personality \ + personality-Xabbrev \ + personality-Xraw \ + personality-Xverbose \ + pidfd_send_signal \ + pipe \ + pipe2 \ + pkey_alloc \ + pkey_free \ + pkey_mprotect \ + poll \ + poll-P \ + ppoll \ + ppoll-P \ + prctl-arg2-intptr \ + prctl-dumpable \ + prctl-name \ + prctl-no-args \ + prctl-pdeathsig \ + prctl-securebits \ + prctl-tid_address \ + prctl-tsc \ + pread64-pwrite64 \ + preadv \ + preadv-pwritev \ + preadv2-pwritev2 \ + printpath-umovestr \ + printpath-umovestr-peekdata \ + printpath-umovestr-undumpable \ + printsignal-Xabbrev \ + printsignal-Xraw \ + printsignal-Xverbose \ + printstr \ + printstrn-umoven \ + printstrn-umoven-peekdata \ + printstrn-umoven-undumpable \ + prlimit64 \ + process_vm_readv \ + process_vm_writev \ + pselect6 \ + ptrace \ + ptrace_syscall_info \ + pwritev \ + quotactl \ + quotactl-Xabbrev \ + quotactl-Xraw \ + quotactl-Xverbose \ + quotactl-xfs \ + read-write \ + readahead \ + readdir \ + readlink \ + readlinkat \ + readv \ + reboot \ + recvfrom \ + recvmmsg-timeout \ + recvmsg \ + remap_file_pages \ + remap_file_pages-Xabbrev \ + remap_file_pages-Xraw \ + remap_file_pages-Xverbose \ + rename \ + renameat \ + renameat2 \ + request_key \ + riscv_flush_icache \ + rmdir \ + rt_sigaction \ + rt_sigpending \ + rt_sigprocmask \ + rt_sigqueueinfo \ + rt_sigreturn \ + rt_sigsuspend \ + rt_sigtimedwait \ + rt_tgsigqueueinfo \ + s390_guarded_storage \ + s390_guarded_storage-v \ + s390_pci_mmio_read_write \ + s390_runtime_instr \ + s390_sthyi \ + s390_sthyi-v \ + sched_get_priority_mxx \ + sched_rr_get_interval \ + sched_xetaffinity \ + sched_xetattr \ + sched_xetparam \ + sched_xetscheduler \ + sched_yield \ + seccomp-filter \ + seccomp_get_action_avail \ + select \ + semop \ + sendfile \ + sendfile64 \ + set_mempolicy \ + setdomainname \ + setfsgid \ + setfsgid32 \ + setfsuid \ + setfsuid32 \ + setgid \ + setgid32 \ + setgroups \ + setgroups32 \ + sethostname \ + setns \ + setregid \ + setregid32 \ + setresgid \ + setresgid32 \ + setresuid \ + setresuid32 \ + setreuid \ + setreuid32 \ + setrlimit \ + setrlimit-Xabbrev \ + setrlimit-Xraw \ + setrlimit-Xverbose \ + setuid \ + setuid32 \ + shmxt \ + shutdown \ + sigaction \ + sigaltstack \ + siginfo \ + signal \ + signalfd4 \ + sigpending \ + sigprocmask \ + sigreturn \ + sigsuspend \ + so_error \ + so_linger \ + so_peercred \ + so_peercred-Xabbrev \ + so_peercred-Xraw \ + so_peercred-Xverbose \ + sock_filter-v \ + sock_filter-v-Xabbrev \ + sock_filter-v-Xraw \ + sock_filter-v-Xverbose \ + sockaddr_xlat-Xabbrev \ + sockaddr_xlat-Xraw \ + sockaddr_xlat-Xverbose \ + socketcall \ + sockopt-sol_netlink \ + sockopt-timestamp \ + splice \ + stat \ + stat64 \ + statfs \ + statfs64 \ + statx \ + swap \ + sxetmask \ + symlink \ + symlinkat \ + sync \ + sync_file_range \ + sync_file_range2 \ + sysinfo \ + syslog \ + tee \ + time \ + timer_create \ + timer_xettime \ + timerfd_xettime \ + times \ + times-fail \ + truncate \ + truncate64 \ + ugetrlimit \ + uio \ + umask \ + umount \ + umount2 \ + umoven-illptr \ + umovestr \ + umovestr-illptr \ + umovestr2 \ + umovestr3 \ + uname \ + unlink \ + unlinkat \ + unshare \ + userfaultfd \ + ustat \ + utime \ + utimensat \ + utimensat-Xabbrev \ + utimensat-Xraw \ + utimensat-Xverbose \ + utimes \ + vhangup \ + vmsplice \ + wait4 \ + waitid \ + waitpid \ + xattr \ + xattr-strings \ + xet_robust_list \ + xet_thread_area_x86 \ + xetitimer \ + xetpgid \ + xetpriority \ + xettimeofday \ + # + +attach_f_p_LDADD = -lpthread $(LDADD) count_f_LDADD = -lpthread $(LDADD) +delay_LDADD = $(clock_LIBS) $(LDADD) filter_unavailable_LDADD = -lpthread $(LDADD) fstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 fstatat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 ftruncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +localtime_LDADD = $(clock_LIBS) $(LDADD) +looping_threads_LDADD = -lpthread $(LDADD) lstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 mmap64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 -mq_LDADD = -lrt $(LDADD) -mq_sendrecv_LDADD = -lrt $(LDADD) -mq_sendrecv_read_LDADD = -lrt $(LDADD) -mq_sendrecv_write_LDADD = -lrt $(LDADD) +mmap64_Xabbrev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mmap64_Xraw_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mmap64_Xverbose_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mq_LDADD = $(mq_LIBS) $(LDADD) newfstatat_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 pc_LDADD = $(dl_LIBS) $(LDADD) pread64_pwrite64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 @@ -2430,216 +4627,286 @@ preadv_pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 stat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 statfs_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 -threads_execve_LDADD = -lrt -lpthread $(LDADD) -times_LDADD = -lrt $(LDADD) +threads_execve_LDADD = -lpthread $(clock_LIBS) $(LDADD) +times_LDADD = $(clock_LIBS) $(LDADD) truncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 uio_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 stack_fcall_SOURCES = stack-fcall.c \ stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c -@USE_LIBUNWIND_FALSE@LIBUNWIND_TESTS = -@USE_LIBUNWIND_TRUE@LIBUNWIND_TESTS = strace-k.test +stack_fcall_mangled_SOURCES = stack-fcall-mangled.c \ + stack-fcall-mangled-0.c stack-fcall-mangled-1.c \ + stack-fcall-mangled-2.c stack-fcall-mangled-3.c + + +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in; do not edit. +GEN_TESTS = _newselect.gen.test _newselect-P.gen.test accept.gen.test \ + accept4.gen.test access.gen.test acct.gen.test \ + add_key.gen.test adjtimex.gen.test aio.gen.test \ + aio_pgetevents.gen.test alarm.gen.test bpf.gen.test \ + bpf-obj_get_info_by_fd.gen.test \ + bpf-obj_get_info_by_fd-prog.gen.test \ + bpf-obj_get_info_by_fd-prog-v.gen.test \ + bpf-obj_get_info_by_fd-v.gen.test bpf-v.gen.test \ + btrfs.gen.test chmod.gen.test chown.gen.test chown32.gen.test \ + chroot.gen.test clock.gen.test clock_adjtime.gen.test \ + clock_nanosleep.gen.test clock_xettime.gen.test \ + copy_file_range.gen.test creat.gen.test delete_module.gen.test \ + dev-yy.gen.test dup.gen.test dup2.gen.test dup3.gen.test \ + epoll_create.gen.test epoll_create1.gen.test \ + epoll_ctl.gen.test epoll_pwait.gen.test epoll_wait.gen.test \ + erestartsys.gen.test execveat.gen.test execveat-v.gen.test \ + faccessat.gen.test fadvise64_64.gen.test fallocate.gen.test \ + fanotify_init.gen.test fanotify_mark.gen.test \ + fanotify_mark-Xabbrev.gen.test fanotify_mark-Xraw.gen.test \ + fanotify_mark-Xverbose.gen.test fchdir.gen.test \ + fchmod.gen.test fchmodat.gen.test fchown.gen.test \ + fchown32.gen.test fchownat.gen.test fcntl.gen.test \ + fcntl64.gen.test fdatasync.gen.test file_handle.gen.test \ + file_ioctl.gen.test finit_module.gen.test flock.gen.test \ + fork-f.gen.test fstat.gen.test fstat-Xabbrev.gen.test \ + fstat-Xraw.gen.test fstat-Xverbose.gen.test fstat64.gen.test \ + fstat64-Xabbrev.gen.test fstat64-Xraw.gen.test \ + fstat64-Xverbose.gen.test fstatat64.gen.test fstatfs.gen.test \ + fstatfs64.gen.test fsync.gen.test fsync-y.gen.test \ + ftruncate.gen.test ftruncate64.gen.test futimesat.gen.test \ + get_mempolicy.gen.test getcpu.gen.test getcwd.gen.test \ + getdents.gen.test getdents64.gen.test getegid.gen.test \ + getegid32.gen.test geteuid.gen.test geteuid32.gen.test \ + getgid.gen.test getgid32.gen.test getgroups.gen.test \ + getgroups32.gen.test getpeername.gen.test getpgrp.gen.test \ + getpid.gen.test getppid.gen.test getrandom.gen.test \ + getresgid.gen.test getresgid32.gen.test getresuid.gen.test \ + getresuid32.gen.test getrlimit.gen.test getrusage.gen.test \ + getsid.gen.test getsockname.gen.test gettid.gen.test \ + getuid32.gen.test getxxid.gen.test group_req.gen.test \ + inet-cmsg.gen.test init_module.gen.test inotify.gen.test \ + inotify_init1.gen.test io_uring_enter.gen.test \ + io_uring_register.gen.test io_uring_setup.gen.test \ + ioctl_block.gen.test ioctl_dm.gen.test ioctl_dm-v.gen.test \ + ioctl_evdev.gen.test ioctl_evdev-v.gen.test \ + ioctl_inotify.gen.test ioctl_kvm_run.gen.test \ + ioctl_kvm_run-v.gen.test ioctl_kvm_run_auxstr_vcpu.gen.test \ + ioctl_loop.gen.test ioctl_loop-nv.gen.test \ + ioctl_loop-v.gen.test ioctl_mtd.gen.test ioctl_nbd.gen.test \ + ioctl_nsfs.gen.test ioctl_perf.gen.test ioctl_ptp.gen.test \ + ioctl_random.gen.test ioctl_rtc.gen.test ioctl_rtc-v.gen.test \ + ioctl_scsi.gen.test ioctl_sg_io_v3.gen.test \ + ioctl_sg_io_v4.gen.test ioctl_sock_gifconf.gen.test \ + ioctl_uffdio.gen.test ioctl_v4l2.gen.test ioperm.gen.test \ + iopl.gen.test ioprio.gen.test ioprio-Xabbrev.gen.test \ + ioprio-Xraw.gen.test ioprio-Xverbose.gen.test ip_mreq.gen.test \ + ipc.gen.test ipc_msg.gen.test ipc_msg-Xabbrev.gen.test \ + ipc_msg-Xraw.gen.test ipc_msg-Xverbose.gen.test \ + ipc_msgbuf-Xabbrev.gen.test ipc_msgbuf-Xraw.gen.test \ + ipc_msgbuf-Xverbose.gen.test ipc_sem.gen.test \ + ipc_sem-Xabbrev.gen.test ipc_sem-Xraw.gen.test \ + ipc_sem-Xverbose.gen.test ipc_shm.gen.test \ + ipc_shm-Xabbrev.gen.test ipc_shm-Xraw.gen.test \ + ipc_shm-Xverbose.gen.test kcmp.gen.test kcmp-y.gen.test \ + kern_features.gen.test kernel_version.gen.test \ + kernel_version-Xabbrev.gen.test kernel_version-Xraw.gen.test \ + kernel_version-Xverbose.gen.test kexec_file_load.gen.test \ + kexec_load.gen.test keyctl.gen.test keyctl-Xabbrev.gen.test \ + keyctl-Xraw.gen.test keyctl-Xverbose.gen.test kill.gen.test \ + lchown.gen.test lchown32.gen.test link.gen.test \ + linkat.gen.test lookup_dcookie.gen.test lstat.gen.test \ + lstat64.gen.test madvise.gen.test mbind.gen.test \ + membarrier.gen.test memfd_create.gen.test \ + memfd_create-Xabbrev.gen.test memfd_create-Xraw.gen.test \ + memfd_create-Xverbose.gen.test migrate_pages.gen.test \ + mincore.gen.test mkdir.gen.test mkdirat.gen.test \ + mknod.gen.test mknodat.gen.test mlock.gen.test mlock2.gen.test \ + mlockall.gen.test mmap-Xabbrev.gen.test mmap-Xraw.gen.test \ + mmap-Xverbose.gen.test mmap64.gen.test mmap64-Xabbrev.gen.test \ + mmap64-Xraw.gen.test mmap64-Xverbose.gen.test mmsg.gen.test \ + mmsg-silent.gen.test mmsg_name.gen.test mmsg_name-v.gen.test \ + modify_ldt.gen.test mount.gen.test mount-Xabbrev.gen.test \ + mount-Xraw.gen.test mount-Xverbose.gen.test \ + move_pages.gen.test move_pages-Xabbrev.gen.test \ + move_pages-Xraw.gen.test move_pages-Xverbose.gen.test \ + mq.gen.test mq_sendrecv.gen.test mq_sendrecv-read.gen.test \ + mq_sendrecv-write.gen.test msg_control.gen.test \ + msg_control-v.gen.test msg_name.gen.test munlockall.gen.test \ + nanosleep.gen.test net-icmp_filter.gen.test \ + net-packet_mreq.gen.test net-packet_mreq-Xabbrev.gen.test \ + net-packet_mreq-Xraw.gen.test \ + net-packet_mreq-Xverbose.gen.test net-sockaddr.gen.test \ + net-tpacket_req.gen.test net-tpacket_stats.gen.test \ + net-yy-inet6.gen.test netlink_audit.gen.test \ + netlink_crypto.gen.test netlink_generic.gen.test \ + netlink_kobject_uevent.gen.test netlink_netfilter.gen.test \ + netlink_protocol.gen.test netlink_route.gen.test \ + netlink_selinux.gen.test netlink_xfrm.gen.test \ + newfstatat.gen.test nfnetlink_acct.gen.test \ + nfnetlink_cthelper.gen.test nfnetlink_ctnetlink.gen.test \ + nfnetlink_ctnetlink_exp.gen.test nfnetlink_cttimeout.gen.test \ + nfnetlink_ipset.gen.test nfnetlink_nft_compat.gen.test \ + nfnetlink_nftables.gen.test nfnetlink_osf.gen.test \ + nfnetlink_queue.gen.test nfnetlink_ulog.gen.test \ + nlattr.gen.test nlattr_br_port_msg.gen.test \ + nlattr_crypto_user_alg.gen.test nlattr_dcbmsg.gen.test \ + nlattr_fib_rule_hdr.gen.test nlattr_ifaddrlblmsg.gen.test \ + nlattr_ifaddrmsg.gen.test nlattr_ifinfomsg.gen.test \ + nlattr_ifla_af_spec.gen.test nlattr_ifla_brport.gen.test \ + nlattr_ifla_linkinfo.gen.test nlattr_ifla_port.gen.test \ + nlattr_ifla_xdp.gen.test nlattr_inet_diag_msg.gen.test \ + nlattr_inet_diag_req_compat.gen.test \ + nlattr_inet_diag_req_v2.gen.test \ + nlattr_mdba_mdb_entry.gen.test \ + nlattr_mdba_router_port.gen.test nlattr_ndmsg.gen.test \ + nlattr_ndtmsg.gen.test nlattr_netconfmsg.gen.test \ + nlattr_netlink_diag_msg.gen.test nlattr_nlmsgerr.gen.test \ + nlattr_packet_diag_msg.gen.test nlattr_rtgenmsg.gen.test \ + nlattr_rtmsg.gen.test nlattr_smc_diag_msg.gen.test \ + nlattr_tc_stats.gen.test nlattr_tca_stab.gen.test \ + nlattr_tcamsg.gen.test nlattr_tcmsg.gen.test \ + nlattr_unix_diag_msg.gen.test old_mmap.gen.test \ + old_mmap-P.gen.test old_mmap-Xabbrev.gen.test \ + old_mmap-Xraw.gen.test old_mmap-Xverbose.gen.test \ + old_mmap-v-none.gen.test oldfstat.gen.test oldlstat.gen.test \ + oldselect.gen.test oldselect-P.gen.test \ + oldselect-efault.gen.test oldselect-efault-P.gen.test \ + oldstat.gen.test open.gen.test openat.gen.test \ + orphaned_process_group.gen.test osf_utimes.gen.test \ + pause.gen.test perf_event_open.gen.test \ + perf_event_open_nonverbose.gen.test \ + perf_event_open_unabbrev.gen.test personality-Xabbrev.gen.test \ + personality-Xraw.gen.test personality-Xverbose.gen.test \ + pidfd_send_signal.gen.test pipe2.gen.test pkey_alloc.gen.test \ + pkey_free.gen.test pkey_mprotect.gen.test ppoll.gen.test \ + ppoll-P.gen.test ppoll-v.gen.test pread64-pwrite64.gen.test \ + preadv.gen.test preadv-pwritev.gen.test \ + preadv2-pwritev2.gen.test printpath-umovestr.gen.test \ + printpath-umovestr-peekdata.gen.test \ + printpath-umovestr-undumpable.gen.test \ + printsignal-Xabbrev.gen.test printsignal-Xraw.gen.test \ + printsignal-Xverbose.gen.test printstr.gen.test \ + printstrn-umoven.gen.test printstrn-umoven-peekdata.gen.test \ + printstrn-umoven-undumpable.gen.test prlimit64.gen.test \ + process_vm_readv.gen.test process_vm_writev.gen.test \ + pselect6.gen.test ptrace.gen.test ptrace_syscall_info.gen.test \ + pwritev.gen.test quotactl.gen.test quotactl-Xabbrev.gen.test \ + quotactl-Xraw.gen.test quotactl-Xverbose.gen.test \ + quotactl-v.gen.test quotactl-xfs.gen.test \ + quotactl-xfs-v.gen.test read-write.gen.test readahead.gen.test \ + readdir.gen.test readlink.gen.test readlinkat.gen.test \ + reboot.gen.test recvfrom.gen.test recvmmsg-timeout.gen.test \ + recvmsg.gen.test regex.gen.test remap_file_pages.gen.test \ + remap_file_pages-Xabbrev.gen.test \ + remap_file_pages-Xraw.gen.test \ + remap_file_pages-Xverbose.gen.test rename.gen.test \ + renameat.gen.test renameat2.gen.test request_key.gen.test \ + riscv_flush_icache.gen.test rmdir.gen.test \ + rt_sigpending.gen.test rt_sigprocmask.gen.test \ + rt_sigqueueinfo.gen.test rt_sigreturn.gen.test \ + rt_sigsuspend.gen.test rt_sigtimedwait.gen.test \ + rt_tgsigqueueinfo.gen.test s390_guarded_storage.gen.test \ + s390_guarded_storage-v.gen.test \ + s390_pci_mmio_read_write.gen.test s390_runtime_instr.gen.test \ + s390_sthyi.gen.test s390_sthyi-v.gen.test sched.gen.test \ + sched_get_priority_mxx.gen.test sched_rr_get_interval.gen.test \ + sched_xetaffinity.gen.test sched_xetattr.gen.test \ + sched_xetparam.gen.test sched_xetscheduler.gen.test \ + sched_yield.gen.test seccomp-filter.gen.test \ + seccomp-filter-v.gen.test seccomp_get_action_avail.gen.test \ + select.gen.test select-P.gen.test semop.gen.test \ + sendfile.gen.test sendfile64.gen.test set_mempolicy.gen.test \ + setdomainname.gen.test setfsgid.gen.test setfsgid32.gen.test \ + setfsuid.gen.test setfsuid32.gen.test setgid.gen.test \ + setgid32.gen.test setgroups.gen.test setgroups32.gen.test \ + sethostname.gen.test setns.gen.test setregid.gen.test \ + setregid32.gen.test setresgid.gen.test setresgid32.gen.test \ + setresuid.gen.test setresuid32.gen.test setreuid.gen.test \ + setreuid32.gen.test setrlimit.gen.test \ + setrlimit-Xabbrev.gen.test setrlimit-Xraw.gen.test \ + setrlimit-Xverbose.gen.test setuid.gen.test setuid32.gen.test \ + shmxt.gen.test shutdown.gen.test sigaction.gen.test \ + siginfo.gen.test signal.gen.test signal_receive.gen.test \ + signalfd4.gen.test sigpending.gen.test sigprocmask.gen.test \ + sigreturn.gen.test sigsuspend.gen.test so_error.gen.test \ + so_linger.gen.test so_peercred.gen.test \ + so_peercred-Xabbrev.gen.test so_peercred-Xraw.gen.test \ + so_peercred-Xverbose.gen.test sock_filter-v.gen.test \ + sock_filter-v-Xabbrev.gen.test sock_filter-v-Xraw.gen.test \ + sock_filter-v-Xverbose.gen.test sockaddr_xlat-Xabbrev.gen.test \ + sockaddr_xlat-Xraw.gen.test sockaddr_xlat-Xverbose.gen.test \ + socketcall.gen.test sockopt-sol_netlink.gen.test \ + sockopt-timestamp.gen.test splice.gen.test stat.gen.test \ + stat64.gen.test statfs.gen.test statfs64.gen.test \ + statx.gen.test swap.gen.test sxetmask.gen.test \ + symlink.gen.test symlinkat.gen.test sync.gen.test \ + sync_file_range.gen.test sync_file_range2.gen.test \ + sysinfo.gen.test syslog.gen.test tee.gen.test time.gen.test \ + timer_create.gen.test timer_xettime.gen.test \ + timerfd_xettime.gen.test times.gen.test times-fail.gen.test \ + trace_fstat.gen.test trace_fstatfs.gen.test \ + trace_lstat.gen.test trace_personality_32.gen.test \ + trace_personality_64.gen.test \ + trace_personality_regex_32.gen.test \ + trace_personality_regex_64.gen.test \ + trace_personality_regex_x32.gen.test \ + trace_personality_x32.gen.test trace_question.gen.test \ + trace_stat.gen.test trace_stat_like.gen.test \ + trace_statfs.gen.test trace_statfs_like.gen.test \ + truncate.gen.test truncate64.gen.test ugetrlimit.gen.test \ + umask.gen.test umoven-illptr.gen.test umovestr-illptr.gen.test \ + umovestr3.gen.test unlink.gen.test unlinkat.gen.test \ + unshare.gen.test userfaultfd.gen.test ustat.gen.test \ + utime.gen.test utimensat.gen.test utimensat-Xabbrev.gen.test \ + utimensat-Xraw.gen.test utimensat-Xverbose.gen.test \ + utimes.gen.test vfork-f.gen.test vhangup.gen.test \ + vmsplice.gen.test wait4.gen.test wait4-v.gen.test \ + waitid.gen.test waitid-v.gen.test waitpid.gen.test \ + xattr.gen.test xattr-strings.gen.test xet_robust_list.gen.test \ + xetitimer.gen.test xetpgid.gen.test xetpriority.gen.test \ + xettimeofday.gen.test +@ENABLE_STACKTRACE_FALSE@STACKTRACE_TESTS = +@ENABLE_STACKTRACE_TRUE@STACKTRACE_TESTS = strace-k.test \ +@ENABLE_STACKTRACE_TRUE@ $(am__append_1) DECODER_TESTS = \ - _newselect.test \ - accept.test \ - accept4.test \ - access.test \ - acct.test \ - add_key.test \ - adjtimex.test \ - aio.test \ - alarm.test \ - bpf.test \ + bpf-success-v.test \ + bpf-success.test \ brk.test \ + btrfs-X.test \ btrfs-v.test \ + btrfs-vX.test \ btrfs-vw.test \ + btrfs-vwX.test \ btrfs-w.test \ - btrfs.test \ + btrfs-wX.test \ caps-abbrev.test \ caps.test \ - chmod.test \ - chown.test \ - chown32.test \ - chroot.test \ - clock_adjtime.test \ - clock_nanosleep.test \ - clock_xettime.test \ - copy_file_range.test \ - creat.test \ - delete_module.test \ - dup.test \ - dup2.test \ - dup3.test \ - epoll_create.test \ - epoll_create1.test \ - epoll_ctl.test \ - epoll_pwait.test \ - epoll_wait.test \ - erestartsys.test \ eventfd.test \ execve-v.test \ execve.test \ - execveat-v.test \ - execveat.test \ - faccessat.test \ fadvise64.test \ - fadvise64_64.test \ - fallocate.test \ - fanotify_init.test \ - fanotify_mark.test \ - fchdir.test \ - fchmod.test \ - fchmodat.test \ - fchown.test \ - fchown32.test \ - fchownat.test \ - fcntl.test \ - fcntl64.test \ - fdatasync.test \ - file_handle.test \ - file_ioctl.test \ - finit_module.test \ - flock.test \ - fstat.test \ - fstat64.test \ - fstatat64.test \ - fstatfs.test \ - fstatfs64.test \ - fsync.test \ - ftruncate.test \ - ftruncate64.test \ futex.test \ - futimesat.test \ - get_mempolicy.test \ - getcpu.test \ - getcwd.test \ - getdents.test \ - getdents64.test \ - getegid.test \ - getegid32.test \ - geteuid.test \ - geteuid32.test \ - getgid.test \ - getgid32.test \ - getgroups.test \ - getgroups32.test \ - getpeername.test \ - getpgrp.test \ - getrandom.test \ - getresgid.test \ - getresgid32.test \ - getresuid.test \ - getresuid32.test \ - getrlimit.test \ - getrusage.test \ - getsid.test \ - getsockname.test \ getuid.test \ - getuid32.test \ - getxxid.test \ - inet-cmsg.test \ - init_module.test \ - inotify.test \ - inotify_init1.test \ + int_0x80.test \ ioctl.test \ - ioctl_block.test \ - ioctl_dm-v.test \ - ioctl_dm.test \ - ioctl_evdev-v.test \ - ioctl_evdev.test \ - ioctl_loop-nv.test \ - ioctl_loop-v.test \ - ioctl_loop.test \ - ioctl_mtd.test \ - ioctl_rtc-v.test \ - ioctl_rtc.test \ - ioctl_scsi.test \ - ioctl_sg_io_v3.test \ - ioctl_sg_io_v4.test \ - ioctl_sock_gifconf.test \ - ioctl_uffdio.test \ - ioctl_v4l2.test \ - ioperm.test \ - iopl.test \ - ioprio.test \ - ip_mreq.test \ - ipc.test \ - ipc_msg.test \ + ioctl_evdev-success-v.test \ + ioctl_evdev-success.test \ + ioctl_perf-success.test \ ipc_msgbuf.test \ - ipc_sem.test \ - ipc_shm.test \ - kcmp.test \ - kexec_file_load.test \ - kexec_load.test \ - keyctl.test \ - kill.test \ - lchown.test \ - lchown32.test \ - link.test \ - linkat.test \ + kern_features-fault.test \ llseek.test \ - lookup_dcookie.test \ lseek.test \ - lstat.test \ - lstat64.test \ - mbind.test \ - membarrier.test \ - memfd_create.test \ - migrate_pages.test \ - mincore.test \ - mkdir.test \ - mkdirat.test \ - mknod.test \ - mknodat.test \ - mlock.test \ - mlock2.test \ - mlockall.test \ mmap.test \ - mmap64.test \ - mmsg-silent.test \ - mmsg.test \ - mmsg_name-v.test \ - mmsg_name.test \ - mount.test \ - move_pages.test \ - mq.test \ - mq_sendrecv-read.test \ - mq_sendrecv-write.test \ - mq_sendrecv.test \ - msg_control-v.test \ - msg_control.test \ - msg_name.test \ - munlockall.test \ - nanosleep.test \ - net-icmp_filter.test \ - net-sockaddr.test \ + net-tpacket_stats-success.test \ net-y-unix.test \ net-yy-inet.test \ net-yy-netlink.test \ net-yy-unix.test \ net.test \ - netlink_protocol.test \ - newfstatat.test \ + netlink_sock_diag.test \ + nsyscalls-d.test \ + nsyscalls-nd.test \ nsyscalls.test \ - old_mmap.test \ - oldfstat.test \ - oldlstat.test \ - oldselect.test \ - oldstat.test \ - open.test \ - openat.test \ - pause.test \ - perf_event_open.test \ - perf_event_open_nonverbose.test \ - perf_event_open_unabbrev.test \ personality.test \ pipe.test \ - pipe2.test \ - pkey_alloc.test \ - pkey_free.test \ - pkey_mprotect.test \ + poll-P.test \ poll.test \ - ppoll.test \ prctl-arg2-intptr.test \ prctl-dumpable.test \ prctl-name.test \ @@ -2648,171 +4915,68 @@ DECODER_TESTS = \ prctl-seccomp-filter-v.test \ prctl-seccomp-strict.test \ prctl-securebits.test \ + prctl-spec-inject.test \ prctl-tid_address.test \ prctl-tsc.test \ - pread64-pwrite64.test \ - preadv-pwritev.test \ - preadv.test \ - preadv2-pwritev2.test \ - printstr.test \ - prlimit64.test \ - process_vm_readv.test \ - process_vm_writev.test \ - pselect6.test \ - ptrace.test \ - pwritev.test \ qual_fault-exit_group.test \ - quotactl-v.test \ - quotactl-xfs-v.test \ - quotactl-xfs.test \ - quotactl.test \ - read-write.test \ - readahead.test \ - readdir.test \ - readlink.test \ - readlinkat.test \ + quotactl-success-v.test \ + quotactl-success.test \ + quotactl-xfs-success-v.test \ + quotactl-xfs-success.test \ readv.test \ - reboot.test \ - recvfrom.test \ - recvmmsg-timeout.test \ - recvmsg.test \ - remap_file_pages.test \ - rename.test \ - renameat.test \ - renameat2.test \ - request_key.test \ - rmdir.test \ - rt_sigpending.test \ - rt_sigprocmask.test \ - rt_sigqueueinfo.test \ - rt_sigsuspend.test \ - rt_sigtimedwait.test \ - rt_tgsigqueueinfo.test \ - sched_get_priority_mxx.test \ - sched_rr_get_interval.test \ - sched_xetaffinity.test \ - sched_xetattr.test \ - sched_xetparam.test \ - sched_xetscheduler.test \ - sched_yield.test \ + rt_sigaction.test \ scm_rights-fd.test \ - seccomp-filter-v.test \ - seccomp-filter.test \ seccomp-strict.test \ - select.test \ - semop.test \ - sendfile.test \ - sendfile64.test \ - set_mempolicy.test \ - setdomainname.test \ - setfsgid.test \ - setfsgid32.test \ - setfsuid.test \ - setfsuid32.test \ - setgid.test \ - setgid32.test \ - setgroups.test \ - setgroups32.test \ - sethostname.test \ - setns.test \ - setregid.test \ - setregid32.test \ - setresgid.test \ - setresgid32.test \ - setresuid.test \ - setresuid32.test \ - setreuid.test \ - setreuid32.test \ - setrlimit.test \ - setuid.test \ - setuid32.test \ - shmxt.test \ - shutdown.test \ - sigaction.test \ sigaltstack.test \ - siginfo.test \ - signalfd4.test \ - sigreturn.test \ - socketcall.test \ - splice.test \ - stat.test \ - stat64.test \ - statfs.test \ - statfs64.test \ sun_path.test \ - swap.test \ - symlink.test \ - symlinkat.test \ - sync.test \ - sync_file_range.test \ - sync_file_range2.test \ - sysinfo.test \ - syslog.test \ - tee.test \ - time.test \ - timer_create.test \ - timer_xettime.test \ - timerfd_xettime.test \ - times-fail.test \ - times.test \ - truncate.test \ - truncate64.test \ - ugetrlimit.test \ uio.test \ - umask.test \ umount.test \ umount2.test \ - umoven-illptr.test \ - umovestr-illptr.test \ umovestr.test \ umovestr2.test \ - umovestr3.test \ uname.test \ unix-pair-send-recv.test \ unix-pair-sendto-recvfrom.test \ - unlink.test \ - unlinkat.test \ - unshare.test \ - userfaultfd.test \ - ustat.test \ - utime.test \ - utimensat.test \ - utimes.test \ - vhangup.test \ - vmsplice.test \ - wait4-v.test \ - wait4.test \ - waitid-v.test \ - waitid.test \ - waitpid.test \ - xattr-strings.test \ - xattr.test \ - xet_robust_list.test \ - xetitimer.test \ - xetpgid.test \ - xetpriority.test \ - xettimeofday.test \ + xet_thread_area_x86.test \ # end of DECODER_TESTS MISC_TESTS = \ attach-f-p.test \ attach-p-cmd.test \ bexecve.test \ + clone_parent.test \ + clone_ptrace.test \ count-f.test \ count.test \ + delay.test \ detach-running.test \ detach-sleeping.test \ detach-stopped.test \ + fflush.test \ filter-unavailable.test \ - fork-f.test \ + filtering_fd-syntax.test \ + filtering_syscall-syntax.test \ + first_exec_failure.test \ + get_regs.test \ + inject-nf.test \ + interactive_block.test \ + kill_child.test \ ksysent.test \ + localtime.test \ + looping_threads.test \ opipe.test \ options-syntax.test \ pc.test \ + printpath-umovestr-legacy.test \ + printstrn-umoven-legacy.test \ qual_fault-syntax.test \ + qual_fault-syscall.test \ qual_fault.test \ + qual_inject-error-signal-syscall.test \ qual_inject-error-signal.test \ + qual_inject-retval-syscall.test \ qual_inject-retval.test \ + qual_inject-signal-syscall.test \ qual_inject-signal.test \ qual_inject-syntax.test \ qual_signal.test \ @@ -2820,100 +4984,146 @@ MISC_TESTS = \ redirect-fds.test \ redirect.test \ restart_syscall.test \ - signal_receive.test \ + sigblock.test \ + sigign.test \ strace-C.test \ strace-E.test \ strace-S.test \ strace-T.test \ strace-V.test \ strace-ff.test \ + strace-log-merge-error.test \ + strace-log-merge-suffix.test \ strace-r.test \ strace-t.test \ strace-tt.test \ strace-ttt.test \ + termsig.test \ threads-execve.test \ - vfork-f.test \ # end of MISC_TESTS XFAIL_TESTS_ = -XFAIL_TESTS_m32 = $(LIBUNWIND_TESTS) -XFAIL_TESTS_mx32 = $(LIBUNWIND_TESTS) -XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) +XFAIL_TESTS_m32 = $(STACKTRACE_TESTS) +XFAIL_TESTS_mx32 = $(STACKTRACE_TESTS) +XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) $(XFAIL_TESTS_$(ARCH)) TEST_LOG_COMPILER = env -AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) MIPS_ABI=$(MIPS_ABI) $(srcdir)/run.sh +AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) STRACE_NATIVE_ARCH=$(NATIVE_ARCH) \ + SIZEOF_KERNEL_LONG_T=$(SIZEOF_KERNEL_LONG_T) \ + SIZEOF_LONG=$(SIZEOF_LONG) \ + MIPS_ABI=$(MIPS_ABI) $(srcdir)/run.sh + VALGRIND_FLAGS = --quiet -VALGRIND_SUPPRESSIONS_FILES = $(srcdir)/strace.supp -EXTRA_DIST = init.sh run.sh match.awk \ - caps-abbrev.awk \ - caps.awk \ - count-f.expected \ - eventfd.expected \ - fadvise.h \ - filter-unavailable.expected \ - fstatat.c \ - fstatx.c \ - getresugid.c \ - init_delete_module.h \ - ipc.sh \ - ipc_msgbuf.expected \ - ksysent.sed \ - lstatx.c \ - net.expected \ - oldselect.expected \ - pipe.expected \ - ppoll-v.expected \ - ppoll.expected \ - process_vm_readv_writev.c \ - qual_fault-exit_group.expected \ - qual_inject-error-signal.expected \ - qual_inject-signal.expected \ - quotactl.h \ - scno_tampering.sh \ - setfsugid.c \ - setresugid.c \ - setreugid.c \ - setugid.c \ - sigaction.awk \ - sigaltstack.expected \ - sockname.c \ - statfs.expected \ - statx.sh \ - strace-C.expected \ - strace-E.expected \ - strace-T.expected \ - strace-ff.expected \ - strace-k.test \ - strace-r.expected \ - strace.supp \ - struct_flock.c \ - sun_path.expected \ - uio.expected \ - umode_t.c \ - umovestr.expected \ - unix-pair-send-recv.expected \ - unix-pair-sendto-recvfrom.expected \ - xchownx.c \ - xgetrlimit.c \ - xselect.c \ - xstatfs.c \ - xstatfs64.c \ - xstatfsx.c \ - xstatx.c \ - $(TESTS) +VALGRIND_SUPPRESSIONS_FILES = $(abs_srcdir)/strace.supp +EXTRA_DIST = \ + COPYING \ + GPL-2.0-or-later \ + PTRACE_SEIZE.sh \ + accept_compat.h \ + attach-p-cmd.h \ + caps-abbrev.awk \ + caps.awk \ + clock.in \ + count-f.expected \ + eventfd.expected \ + fadvise.h \ + fcntl-common.c \ + filter-unavailable.expected \ + fstatat.c \ + fstatx.c \ + gen_pure_executables.sh \ + gen_tests.in \ + gen_tests.sh \ + getresugid.c \ + init.sh \ + init_delete_module.h \ + ioctl_kvm_run_common.c \ + ipc.sh \ + ksysent.sed \ + lstatx.c \ + match.awk \ + net.expected \ + netlink_sock_diag-v.sh \ + nlattr_ifla.h \ + pipe.expected \ + print_user_desc.c \ + printsignal.c \ + process_vm_readv_writev.c \ + pure_executables.list \ + qual_fault-exit_group.expected \ + qual_inject-error-signal.expected \ + qual_inject-signal.expected \ + qualify_personality.sh \ + qualify_personality_empty.in \ + quotactl.h \ + regex.in \ + rt_sigaction.awk \ + run.sh \ + sched.in \ + scno_tampering.sh \ + setfsugid.c \ + setresugid.c \ + setreugid.c \ + setugid.c \ + sigaltstack.expected \ + sockaddr_xlat.c \ + sockname.c \ + stack-fcall.h \ + strace-C.expected \ + strace-E.expected \ + strace-T.expected \ + strace-ff.expected \ + strace-k-demangle.expected \ + strace-k-demangle.test \ + strace-k.expected \ + strace-k.test \ + strace-r.expected \ + strace.supp \ + sun_path.expected \ + syntax.sh \ + trace_fstat.in \ + trace_fstatfs.in \ + trace_lstat.in \ + trace_personality_32.in \ + trace_personality_64.in \ + trace_personality_regex_32.in \ + trace_personality_regex_64.in \ + trace_personality_regex_x32.in \ + trace_personality_x32.in \ + trace_question.in \ + trace_stat.in \ + trace_stat_like.in \ + trace_statfs.in \ + trace_statfs_like.in \ + uio.expected \ + umode_t.c \ + umovestr.expected \ + unix-pair-send-recv.expected \ + unix-pair-sendto-recvfrom.expected \ + xchownx.c \ + xgetrlimit.c \ + xselect.c \ + xstatfs.c \ + xstatfs64.c \ + xstatfsx.c \ + xstatx.c \ + xutimes.c \ + $(TESTS) objects = $(filter %.$(OBJEXT),$(SOURCES:.c=.$(OBJEXT))) -CLEANFILES = ksysent.h $(TESTS:=.tmp) syscallent.i scno.h +BUILT_SOURCES = ksysent.h scno.h +CLEANFILES = ksysent.h syscallent.i scno.h SCNO_CPPFLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(ARCH_MFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) digits = [[:digit:]][[:digit:]]* al_nums = [[:alnum:]_][[:alnum:]_]* -SCNO_SED = /TRACE_INDIRECT_SUBCALL/d; s/^\[[[:space:]]*\($(digits)\)\][[:space:]]*=[[:space:]]*{[^,]*,[^,]*,[^,]*,[[:space:]]*"\($(al_nums)\)"[[:space:]]*},.*/\#ifndef __NR_\2\n\# define __NR_\2 (SYSCALL_BIT | \1)\n\#endif/p -all: all-am +SCNO_SED = /TRACE_INDIRECT_SUBCALL/d; s/^\[[[:space:]]*\($(digits)\([[:space:]]*+[[:space:]]*$(digits)\)\?\)\][[:space:]]*=[[:space:]]*{[^,]*,[^,]*,[^,]*,[[:space:]]*"\($(al_nums)\)"[[:space:]]*},.*/\#ifndef __NR_\3\n\# define __NR_\3 (SYSCALL_BIT | (\1))\n\#endif/p +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .log .o .obj .test .test$(EXEEXT) .trs -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../scno.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/pure_executables.am $(srcdir)/gen_tests.am $(srcdir)/../scno.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -2925,16 +5135,15 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/.. echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests-mx32/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests-mx32/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; -$(srcdir)/../scno.am: +$(srcdir)/pure_executables.am $(srcdir)/gen_tests.am $(srcdir)/../scno.am $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -2945,6 +5154,9 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) + clean-checkLIBRARIES: -test -z "$(check_LIBRARIES)" || rm -f $(check_LIBRARIES) @@ -2953,13 +5165,14 @@ libtests.a: $(libtests_a_OBJECTS) $(libtests_a_DEPENDENCIES) $(EXTRA_libtests_a_ $(AM_V_AR)$(libtests_a_AR) libtests.a $(libtests_a_OBJECTS) $(libtests_a_LIBADD) $(AM_V_at)$(RANLIB) libtests.a -clean-checkPROGRAMS: - -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) - _newselect$(EXEEXT): $(_newselect_OBJECTS) $(_newselect_DEPENDENCIES) $(EXTRA__newselect_DEPENDENCIES) @rm -f _newselect$(EXEEXT) $(AM_V_CCLD)$(LINK) $(_newselect_OBJECTS) $(_newselect_LDADD) $(LIBS) +_newselect-P$(EXEEXT): $(_newselect_P_OBJECTS) $(_newselect_P_DEPENDENCIES) $(EXTRA__newselect_P_DEPENDENCIES) + @rm -f _newselect-P$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(_newselect_P_OBJECTS) $(_newselect_P_LDADD) $(LIBS) + accept$(EXEEXT): $(accept_OBJECTS) $(accept_DEPENDENCIES) $(EXTRA_accept_DEPENDENCIES) @rm -f accept$(EXEEXT) $(AM_V_CCLD)$(LINK) $(accept_OBJECTS) $(accept_LDADD) $(LIBS) @@ -2988,6 +5201,10 @@ aio$(EXEEXT): $(aio_OBJECTS) $(aio_DEPENDENCIES) $(EXTRA_aio_DEPENDENCIES) @rm -f aio$(EXEEXT) $(AM_V_CCLD)$(LINK) $(aio_OBJECTS) $(aio_LDADD) $(LIBS) +aio_pgetevents$(EXEEXT): $(aio_pgetevents_OBJECTS) $(aio_pgetevents_DEPENDENCIES) $(EXTRA_aio_pgetevents_DEPENDENCIES) + @rm -f aio_pgetevents$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(aio_pgetevents_OBJECTS) $(aio_pgetevents_LDADD) $(LIBS) + alarm$(EXEEXT): $(alarm_OBJECTS) $(alarm_DEPENDENCIES) $(EXTRA_alarm_DEPENDENCIES) @rm -f alarm$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alarm_OBJECTS) $(alarm_LDADD) $(LIBS) @@ -3012,10 +5229,42 @@ attach-p-cmd-p$(EXEEXT): $(attach_p_cmd_p_OBJECTS) $(attach_p_cmd_p_DEPENDENCIES @rm -f attach-p-cmd-p$(EXEEXT) $(AM_V_CCLD)$(LINK) $(attach_p_cmd_p_OBJECTS) $(attach_p_cmd_p_LDADD) $(LIBS) +block_reset_raise_run$(EXEEXT): $(block_reset_raise_run_OBJECTS) $(block_reset_raise_run_DEPENDENCIES) $(EXTRA_block_reset_raise_run_DEPENDENCIES) + @rm -f block_reset_raise_run$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(block_reset_raise_run_OBJECTS) $(block_reset_raise_run_LDADD) $(LIBS) + bpf$(EXEEXT): $(bpf_OBJECTS) $(bpf_DEPENDENCIES) $(EXTRA_bpf_DEPENDENCIES) @rm -f bpf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bpf_OBJECTS) $(bpf_LDADD) $(LIBS) +bpf-obj_get_info_by_fd$(EXEEXT): $(bpf_obj_get_info_by_fd_OBJECTS) $(bpf_obj_get_info_by_fd_DEPENDENCIES) $(EXTRA_bpf_obj_get_info_by_fd_DEPENDENCIES) + @rm -f bpf-obj_get_info_by_fd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_obj_get_info_by_fd_OBJECTS) $(bpf_obj_get_info_by_fd_LDADD) $(LIBS) + +bpf-obj_get_info_by_fd-prog$(EXEEXT): $(bpf_obj_get_info_by_fd_prog_OBJECTS) $(bpf_obj_get_info_by_fd_prog_DEPENDENCIES) $(EXTRA_bpf_obj_get_info_by_fd_prog_DEPENDENCIES) + @rm -f bpf-obj_get_info_by_fd-prog$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_obj_get_info_by_fd_prog_OBJECTS) $(bpf_obj_get_info_by_fd_prog_LDADD) $(LIBS) + +bpf-obj_get_info_by_fd-prog-v$(EXEEXT): $(bpf_obj_get_info_by_fd_prog_v_OBJECTS) $(bpf_obj_get_info_by_fd_prog_v_DEPENDENCIES) $(EXTRA_bpf_obj_get_info_by_fd_prog_v_DEPENDENCIES) + @rm -f bpf-obj_get_info_by_fd-prog-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_obj_get_info_by_fd_prog_v_OBJECTS) $(bpf_obj_get_info_by_fd_prog_v_LDADD) $(LIBS) + +bpf-obj_get_info_by_fd-v$(EXEEXT): $(bpf_obj_get_info_by_fd_v_OBJECTS) $(bpf_obj_get_info_by_fd_v_DEPENDENCIES) $(EXTRA_bpf_obj_get_info_by_fd_v_DEPENDENCIES) + @rm -f bpf-obj_get_info_by_fd-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_obj_get_info_by_fd_v_OBJECTS) $(bpf_obj_get_info_by_fd_v_LDADD) $(LIBS) + +bpf-success$(EXEEXT): $(bpf_success_OBJECTS) $(bpf_success_DEPENDENCIES) $(EXTRA_bpf_success_DEPENDENCIES) + @rm -f bpf-success$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_success_OBJECTS) $(bpf_success_LDADD) $(LIBS) + +bpf-success-v$(EXEEXT): $(bpf_success_v_OBJECTS) $(bpf_success_v_DEPENDENCIES) $(EXTRA_bpf_success_v_DEPENDENCIES) + @rm -f bpf-success-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_success_v_OBJECTS) $(bpf_success_v_LDADD) $(LIBS) + +bpf-v$(EXEEXT): $(bpf_v_OBJECTS) $(bpf_v_DEPENDENCIES) $(EXTRA_bpf_v_DEPENDENCIES) + @rm -f bpf-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_v_OBJECTS) $(bpf_v_LDADD) $(LIBS) + brk$(EXEEXT): $(brk_OBJECTS) $(brk_DEPENDENCIES) $(EXTRA_brk_DEPENDENCIES) @rm -f brk$(EXEEXT) $(AM_V_CCLD)$(LINK) $(brk_OBJECTS) $(brk_LDADD) $(LIBS) @@ -3032,6 +5281,14 @@ caps-abbrev$(EXEEXT): $(caps_abbrev_OBJECTS) $(caps_abbrev_DEPENDENCIES) $(EXTRA @rm -f caps-abbrev$(EXEEXT) $(AM_V_CCLD)$(LINK) $(caps_abbrev_OBJECTS) $(caps_abbrev_LDADD) $(LIBS) +check_sigblock$(EXEEXT): $(check_sigblock_OBJECTS) $(check_sigblock_DEPENDENCIES) $(EXTRA_check_sigblock_DEPENDENCIES) + @rm -f check_sigblock$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(check_sigblock_OBJECTS) $(check_sigblock_LDADD) $(LIBS) + +check_sigign$(EXEEXT): $(check_sigign_OBJECTS) $(check_sigign_DEPENDENCIES) $(EXTRA_check_sigign_DEPENDENCIES) + @rm -f check_sigign$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(check_sigign_OBJECTS) $(check_sigign_LDADD) $(LIBS) + chmod$(EXEEXT): $(chmod_OBJECTS) $(chmod_DEPENDENCIES) $(EXTRA_chmod_DEPENDENCIES) @rm -f chmod$(EXEEXT) $(AM_V_CCLD)$(LINK) $(chmod_OBJECTS) $(chmod_LDADD) $(LIBS) @@ -3060,6 +5317,14 @@ clock_xettime$(EXEEXT): $(clock_xettime_OBJECTS) $(clock_xettime_DEPENDENCIES) $ @rm -f clock_xettime$(EXEEXT) $(AM_V_CCLD)$(LINK) $(clock_xettime_OBJECTS) $(clock_xettime_LDADD) $(LIBS) +clone_parent$(EXEEXT): $(clone_parent_OBJECTS) $(clone_parent_DEPENDENCIES) $(EXTRA_clone_parent_DEPENDENCIES) + @rm -f clone_parent$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(clone_parent_OBJECTS) $(clone_parent_LDADD) $(LIBS) + +clone_ptrace$(EXEEXT): $(clone_ptrace_OBJECTS) $(clone_ptrace_DEPENDENCIES) $(EXTRA_clone_ptrace_DEPENDENCIES) + @rm -f clone_ptrace$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(clone_ptrace_OBJECTS) $(clone_ptrace_LDADD) $(LIBS) + copy_file_range$(EXEEXT): $(copy_file_range_OBJECTS) $(copy_file_range_DEPENDENCIES) $(EXTRA_copy_file_range_DEPENDENCIES) @rm -f copy_file_range$(EXEEXT) $(AM_V_CCLD)$(LINK) $(copy_file_range_OBJECTS) $(copy_file_range_LDADD) $(LIBS) @@ -3072,10 +5337,18 @@ creat$(EXEEXT): $(creat_OBJECTS) $(creat_DEPENDENCIES) $(EXTRA_creat_DEPENDENCIE @rm -f creat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(creat_OBJECTS) $(creat_LDADD) $(LIBS) +delay$(EXEEXT): $(delay_OBJECTS) $(delay_DEPENDENCIES) $(EXTRA_delay_DEPENDENCIES) + @rm -f delay$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(delay_OBJECTS) $(delay_LDADD) $(LIBS) + delete_module$(EXEEXT): $(delete_module_OBJECTS) $(delete_module_DEPENDENCIES) $(EXTRA_delete_module_DEPENDENCIES) @rm -f delete_module$(EXEEXT) $(AM_V_CCLD)$(LINK) $(delete_module_OBJECTS) $(delete_module_LDADD) $(LIBS) +dev-yy$(EXEEXT): $(dev_yy_OBJECTS) $(dev_yy_DEPENDENCIES) $(EXTRA_dev_yy_DEPENDENCIES) + @rm -f dev-yy$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(dev_yy_OBJECTS) $(dev_yy_LDADD) $(LIBS) + dup$(EXEEXT): $(dup_OBJECTS) $(dup_DEPENDENCIES) $(EXTRA_dup_DEPENDENCIES) @rm -f dup$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dup_OBJECTS) $(dup_LDADD) $(LIBS) @@ -3156,6 +5429,18 @@ fanotify_mark$(EXEEXT): $(fanotify_mark_OBJECTS) $(fanotify_mark_DEPENDENCIES) $ @rm -f fanotify_mark$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fanotify_mark_OBJECTS) $(fanotify_mark_LDADD) $(LIBS) +fanotify_mark-Xabbrev$(EXEEXT): $(fanotify_mark_Xabbrev_OBJECTS) $(fanotify_mark_Xabbrev_DEPENDENCIES) $(EXTRA_fanotify_mark_Xabbrev_DEPENDENCIES) + @rm -f fanotify_mark-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fanotify_mark_Xabbrev_OBJECTS) $(fanotify_mark_Xabbrev_LDADD) $(LIBS) + +fanotify_mark-Xraw$(EXEEXT): $(fanotify_mark_Xraw_OBJECTS) $(fanotify_mark_Xraw_DEPENDENCIES) $(EXTRA_fanotify_mark_Xraw_DEPENDENCIES) + @rm -f fanotify_mark-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fanotify_mark_Xraw_OBJECTS) $(fanotify_mark_Xraw_LDADD) $(LIBS) + +fanotify_mark-Xverbose$(EXEEXT): $(fanotify_mark_Xverbose_OBJECTS) $(fanotify_mark_Xverbose_DEPENDENCIES) $(EXTRA_fanotify_mark_Xverbose_DEPENDENCIES) + @rm -f fanotify_mark-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fanotify_mark_Xverbose_OBJECTS) $(fanotify_mark_Xverbose_LDADD) $(LIBS) + fchdir$(EXEEXT): $(fchdir_OBJECTS) $(fchdir_DEPENDENCIES) $(EXTRA_fchdir_DEPENDENCIES) @rm -f fchdir$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fchdir_OBJECTS) $(fchdir_LDADD) $(LIBS) @@ -3192,6 +5477,10 @@ fdatasync$(EXEEXT): $(fdatasync_OBJECTS) $(fdatasync_DEPENDENCIES) $(EXTRA_fdata @rm -f fdatasync$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fdatasync_OBJECTS) $(fdatasync_LDADD) $(LIBS) +fflush$(EXEEXT): $(fflush_OBJECTS) $(fflush_DEPENDENCIES) $(EXTRA_fflush_DEPENDENCIES) + @rm -f fflush$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fflush_OBJECTS) $(fflush_LDADD) $(LIBS) + file_handle$(EXEEXT): $(file_handle_OBJECTS) $(file_handle_DEPENDENCIES) $(EXTRA_file_handle_DEPENDENCIES) @rm -f file_handle$(EXEEXT) $(AM_V_CCLD)$(LINK) $(file_handle_OBJECTS) $(file_handle_LDADD) $(LIBS) @@ -3220,10 +5509,34 @@ fstat$(EXEEXT): $(fstat_OBJECTS) $(fstat_DEPENDENCIES) $(EXTRA_fstat_DEPENDENCIE @rm -f fstat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fstat_OBJECTS) $(fstat_LDADD) $(LIBS) +fstat-Xabbrev$(EXEEXT): $(fstat_Xabbrev_OBJECTS) $(fstat_Xabbrev_DEPENDENCIES) $(EXTRA_fstat_Xabbrev_DEPENDENCIES) + @rm -f fstat-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat_Xabbrev_OBJECTS) $(fstat_Xabbrev_LDADD) $(LIBS) + +fstat-Xraw$(EXEEXT): $(fstat_Xraw_OBJECTS) $(fstat_Xraw_DEPENDENCIES) $(EXTRA_fstat_Xraw_DEPENDENCIES) + @rm -f fstat-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat_Xraw_OBJECTS) $(fstat_Xraw_LDADD) $(LIBS) + +fstat-Xverbose$(EXEEXT): $(fstat_Xverbose_OBJECTS) $(fstat_Xverbose_DEPENDENCIES) $(EXTRA_fstat_Xverbose_DEPENDENCIES) + @rm -f fstat-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat_Xverbose_OBJECTS) $(fstat_Xverbose_LDADD) $(LIBS) + fstat64$(EXEEXT): $(fstat64_OBJECTS) $(fstat64_DEPENDENCIES) $(EXTRA_fstat64_DEPENDENCIES) @rm -f fstat64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fstat64_OBJECTS) $(fstat64_LDADD) $(LIBS) +fstat64-Xabbrev$(EXEEXT): $(fstat64_Xabbrev_OBJECTS) $(fstat64_Xabbrev_DEPENDENCIES) $(EXTRA_fstat64_Xabbrev_DEPENDENCIES) + @rm -f fstat64-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat64_Xabbrev_OBJECTS) $(fstat64_Xabbrev_LDADD) $(LIBS) + +fstat64-Xraw$(EXEEXT): $(fstat64_Xraw_OBJECTS) $(fstat64_Xraw_DEPENDENCIES) $(EXTRA_fstat64_Xraw_DEPENDENCIES) + @rm -f fstat64-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat64_Xraw_OBJECTS) $(fstat64_Xraw_LDADD) $(LIBS) + +fstat64-Xverbose$(EXEEXT): $(fstat64_Xverbose_OBJECTS) $(fstat64_Xverbose_DEPENDENCIES) $(EXTRA_fstat64_Xverbose_DEPENDENCIES) + @rm -f fstat64-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat64_Xverbose_OBJECTS) $(fstat64_Xverbose_LDADD) $(LIBS) + fstatat64$(EXEEXT): $(fstatat64_OBJECTS) $(fstatat64_DEPENDENCIES) $(EXTRA_fstatat64_DEPENDENCIES) @rm -f fstatat64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fstatat64_OBJECTS) $(fstatat64_LDADD) $(LIBS) @@ -3240,6 +5553,10 @@ fsync$(EXEEXT): $(fsync_OBJECTS) $(fsync_DEPENDENCIES) $(EXTRA_fsync_DEPENDENCIE @rm -f fsync$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fsync_OBJECTS) $(fsync_LDADD) $(LIBS) +fsync-y$(EXEEXT): $(fsync_y_OBJECTS) $(fsync_y_DEPENDENCIES) $(EXTRA_fsync_y_DEPENDENCIES) + @rm -f fsync-y$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fsync_y_OBJECTS) $(fsync_y_LDADD) $(LIBS) + ftruncate$(EXEEXT): $(ftruncate_OBJECTS) $(ftruncate_DEPENDENCIES) $(EXTRA_ftruncate_DEPENDENCIES) @rm -f ftruncate$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ftruncate_OBJECTS) $(ftruncate_LDADD) $(LIBS) @@ -3316,6 +5633,14 @@ getpgrp$(EXEEXT): $(getpgrp_OBJECTS) $(getpgrp_DEPENDENCIES) $(EXTRA_getpgrp_DEP @rm -f getpgrp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getpgrp_OBJECTS) $(getpgrp_LDADD) $(LIBS) +getpid$(EXEEXT): $(getpid_OBJECTS) $(getpid_DEPENDENCIES) $(EXTRA_getpid_DEPENDENCIES) + @rm -f getpid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getpid_OBJECTS) $(getpid_LDADD) $(LIBS) + +getppid$(EXEEXT): $(getppid_OBJECTS) $(getppid_DEPENDENCIES) $(EXTRA_getppid_DEPENDENCIES) + @rm -f getppid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getppid_OBJECTS) $(getppid_LDADD) $(LIBS) + getrandom$(EXEEXT): $(getrandom_OBJECTS) $(getrandom_DEPENDENCIES) $(EXTRA_getrandom_DEPENDENCIES) @rm -f getrandom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getrandom_OBJECTS) $(getrandom_LDADD) $(LIBS) @@ -3352,6 +5677,10 @@ getsockname$(EXEEXT): $(getsockname_OBJECTS) $(getsockname_DEPENDENCIES) $(EXTRA @rm -f getsockname$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getsockname_OBJECTS) $(getsockname_LDADD) $(LIBS) +gettid$(EXEEXT): $(gettid_OBJECTS) $(gettid_DEPENDENCIES) $(EXTRA_gettid_DEPENDENCIES) + @rm -f gettid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gettid_OBJECTS) $(gettid_LDADD) $(LIBS) + getuid$(EXEEXT): $(getuid_OBJECTS) $(getuid_DEPENDENCIES) $(EXTRA_getuid_DEPENDENCIES) @rm -f getuid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getuid_OBJECTS) $(getuid_LDADD) $(LIBS) @@ -3364,6 +5693,10 @@ getxxid$(EXEEXT): $(getxxid_OBJECTS) $(getxxid_DEPENDENCIES) $(EXTRA_getxxid_DEP @rm -f getxxid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getxxid_OBJECTS) $(getxxid_LDADD) $(LIBS) +group_req$(EXEEXT): $(group_req_OBJECTS) $(group_req_DEPENDENCIES) $(EXTRA_group_req_DEPENDENCIES) + @rm -f group_req$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(group_req_OBJECTS) $(group_req_LDADD) $(LIBS) + inet-cmsg$(EXEEXT): $(inet_cmsg_OBJECTS) $(inet_cmsg_DEPENDENCIES) $(EXTRA_inet_cmsg_DEPENDENCIES) @rm -f inet-cmsg$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inet_cmsg_OBJECTS) $(inet_cmsg_LDADD) $(LIBS) @@ -3372,6 +5705,10 @@ init_module$(EXEEXT): $(init_module_OBJECTS) $(init_module_DEPENDENCIES) $(EXTRA @rm -f init_module$(EXEEXT) $(AM_V_CCLD)$(LINK) $(init_module_OBJECTS) $(init_module_LDADD) $(LIBS) +inject-nf$(EXEEXT): $(inject_nf_OBJECTS) $(inject_nf_DEPENDENCIES) $(EXTRA_inject_nf_DEPENDENCIES) + @rm -f inject-nf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(inject_nf_OBJECTS) $(inject_nf_LDADD) $(LIBS) + inotify$(EXEEXT): $(inotify_OBJECTS) $(inotify_DEPENDENCIES) $(EXTRA_inotify_DEPENDENCIES) @rm -f inotify$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inotify_OBJECTS) $(inotify_LDADD) $(LIBS) @@ -3380,6 +5717,22 @@ inotify_init1$(EXEEXT): $(inotify_init1_OBJECTS) $(inotify_init1_DEPENDENCIES) $ @rm -f inotify_init1$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inotify_init1_OBJECTS) $(inotify_init1_LDADD) $(LIBS) +int_0x80$(EXEEXT): $(int_0x80_OBJECTS) $(int_0x80_DEPENDENCIES) $(EXTRA_int_0x80_DEPENDENCIES) + @rm -f int_0x80$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(int_0x80_OBJECTS) $(int_0x80_LDADD) $(LIBS) + +io_uring_enter$(EXEEXT): $(io_uring_enter_OBJECTS) $(io_uring_enter_DEPENDENCIES) $(EXTRA_io_uring_enter_DEPENDENCIES) + @rm -f io_uring_enter$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(io_uring_enter_OBJECTS) $(io_uring_enter_LDADD) $(LIBS) + +io_uring_register$(EXEEXT): $(io_uring_register_OBJECTS) $(io_uring_register_DEPENDENCIES) $(EXTRA_io_uring_register_DEPENDENCIES) + @rm -f io_uring_register$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(io_uring_register_OBJECTS) $(io_uring_register_LDADD) $(LIBS) + +io_uring_setup$(EXEEXT): $(io_uring_setup_OBJECTS) $(io_uring_setup_DEPENDENCIES) $(EXTRA_io_uring_setup_DEPENDENCIES) + @rm -f io_uring_setup$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(io_uring_setup_OBJECTS) $(io_uring_setup_LDADD) $(LIBS) + ioctl$(EXEEXT): $(ioctl_OBJECTS) $(ioctl_DEPENDENCIES) $(EXTRA_ioctl_DEPENDENCIES) @rm -f ioctl$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ioctl_OBJECTS) $(ioctl_LDADD) $(LIBS) @@ -3400,10 +5753,34 @@ ioctl_evdev$(EXEEXT): $(ioctl_evdev_OBJECTS) $(ioctl_evdev_DEPENDENCIES) $(EXTRA @rm -f ioctl_evdev$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ioctl_evdev_OBJECTS) $(ioctl_evdev_LDADD) $(LIBS) +ioctl_evdev-success$(EXEEXT): $(ioctl_evdev_success_OBJECTS) $(ioctl_evdev_success_DEPENDENCIES) $(EXTRA_ioctl_evdev_success_DEPENDENCIES) + @rm -f ioctl_evdev-success$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_evdev_success_OBJECTS) $(ioctl_evdev_success_LDADD) $(LIBS) + +ioctl_evdev-success-v$(EXEEXT): $(ioctl_evdev_success_v_OBJECTS) $(ioctl_evdev_success_v_DEPENDENCIES) $(EXTRA_ioctl_evdev_success_v_DEPENDENCIES) + @rm -f ioctl_evdev-success-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_evdev_success_v_OBJECTS) $(ioctl_evdev_success_v_LDADD) $(LIBS) + ioctl_evdev-v$(EXEEXT): $(ioctl_evdev_v_OBJECTS) $(ioctl_evdev_v_DEPENDENCIES) $(EXTRA_ioctl_evdev_v_DEPENDENCIES) @rm -f ioctl_evdev-v$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ioctl_evdev_v_OBJECTS) $(ioctl_evdev_v_LDADD) $(LIBS) +ioctl_inotify$(EXEEXT): $(ioctl_inotify_OBJECTS) $(ioctl_inotify_DEPENDENCIES) $(EXTRA_ioctl_inotify_DEPENDENCIES) + @rm -f ioctl_inotify$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_inotify_OBJECTS) $(ioctl_inotify_LDADD) $(LIBS) + +ioctl_kvm_run$(EXEEXT): $(ioctl_kvm_run_OBJECTS) $(ioctl_kvm_run_DEPENDENCIES) $(EXTRA_ioctl_kvm_run_DEPENDENCIES) + @rm -f ioctl_kvm_run$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_kvm_run_OBJECTS) $(ioctl_kvm_run_LDADD) $(LIBS) + +ioctl_kvm_run-v$(EXEEXT): $(ioctl_kvm_run_v_OBJECTS) $(ioctl_kvm_run_v_DEPENDENCIES) $(EXTRA_ioctl_kvm_run_v_DEPENDENCIES) + @rm -f ioctl_kvm_run-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_kvm_run_v_OBJECTS) $(ioctl_kvm_run_v_LDADD) $(LIBS) + +ioctl_kvm_run_auxstr_vcpu$(EXEEXT): $(ioctl_kvm_run_auxstr_vcpu_OBJECTS) $(ioctl_kvm_run_auxstr_vcpu_DEPENDENCIES) $(EXTRA_ioctl_kvm_run_auxstr_vcpu_DEPENDENCIES) + @rm -f ioctl_kvm_run_auxstr_vcpu$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_kvm_run_auxstr_vcpu_OBJECTS) $(ioctl_kvm_run_auxstr_vcpu_LDADD) $(LIBS) + ioctl_loop$(EXEEXT): $(ioctl_loop_OBJECTS) $(ioctl_loop_DEPENDENCIES) $(EXTRA_ioctl_loop_DEPENDENCIES) @rm -f ioctl_loop$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ioctl_loop_OBJECTS) $(ioctl_loop_LDADD) $(LIBS) @@ -3420,6 +5797,30 @@ ioctl_mtd$(EXEEXT): $(ioctl_mtd_OBJECTS) $(ioctl_mtd_DEPENDENCIES) $(EXTRA_ioctl @rm -f ioctl_mtd$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ioctl_mtd_OBJECTS) $(ioctl_mtd_LDADD) $(LIBS) +ioctl_nbd$(EXEEXT): $(ioctl_nbd_OBJECTS) $(ioctl_nbd_DEPENDENCIES) $(EXTRA_ioctl_nbd_DEPENDENCIES) + @rm -f ioctl_nbd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_nbd_OBJECTS) $(ioctl_nbd_LDADD) $(LIBS) + +ioctl_nsfs$(EXEEXT): $(ioctl_nsfs_OBJECTS) $(ioctl_nsfs_DEPENDENCIES) $(EXTRA_ioctl_nsfs_DEPENDENCIES) + @rm -f ioctl_nsfs$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_nsfs_OBJECTS) $(ioctl_nsfs_LDADD) $(LIBS) + +ioctl_perf$(EXEEXT): $(ioctl_perf_OBJECTS) $(ioctl_perf_DEPENDENCIES) $(EXTRA_ioctl_perf_DEPENDENCIES) + @rm -f ioctl_perf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_perf_OBJECTS) $(ioctl_perf_LDADD) $(LIBS) + +ioctl_perf-success$(EXEEXT): $(ioctl_perf_success_OBJECTS) $(ioctl_perf_success_DEPENDENCIES) $(EXTRA_ioctl_perf_success_DEPENDENCIES) + @rm -f ioctl_perf-success$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_perf_success_OBJECTS) $(ioctl_perf_success_LDADD) $(LIBS) + +ioctl_ptp$(EXEEXT): $(ioctl_ptp_OBJECTS) $(ioctl_ptp_DEPENDENCIES) $(EXTRA_ioctl_ptp_DEPENDENCIES) + @rm -f ioctl_ptp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_ptp_OBJECTS) $(ioctl_ptp_LDADD) $(LIBS) + +ioctl_random$(EXEEXT): $(ioctl_random_OBJECTS) $(ioctl_random_DEPENDENCIES) $(EXTRA_ioctl_random_DEPENDENCIES) + @rm -f ioctl_random$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_random_OBJECTS) $(ioctl_random_LDADD) $(LIBS) + ioctl_rtc$(EXEEXT): $(ioctl_rtc_OBJECTS) $(ioctl_rtc_DEPENDENCIES) $(EXTRA_ioctl_rtc_DEPENDENCIES) @rm -f ioctl_rtc$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ioctl_rtc_OBJECTS) $(ioctl_rtc_LDADD) $(LIBS) @@ -3464,6 +5865,18 @@ ioprio$(EXEEXT): $(ioprio_OBJECTS) $(ioprio_DEPENDENCIES) $(EXTRA_ioprio_DEPENDE @rm -f ioprio$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ioprio_OBJECTS) $(ioprio_LDADD) $(LIBS) +ioprio-Xabbrev$(EXEEXT): $(ioprio_Xabbrev_OBJECTS) $(ioprio_Xabbrev_DEPENDENCIES) $(EXTRA_ioprio_Xabbrev_DEPENDENCIES) + @rm -f ioprio-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioprio_Xabbrev_OBJECTS) $(ioprio_Xabbrev_LDADD) $(LIBS) + +ioprio-Xraw$(EXEEXT): $(ioprio_Xraw_OBJECTS) $(ioprio_Xraw_DEPENDENCIES) $(EXTRA_ioprio_Xraw_DEPENDENCIES) + @rm -f ioprio-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioprio_Xraw_OBJECTS) $(ioprio_Xraw_LDADD) $(LIBS) + +ioprio-Xverbose$(EXEEXT): $(ioprio_Xverbose_OBJECTS) $(ioprio_Xverbose_DEPENDENCIES) $(EXTRA_ioprio_Xverbose_DEPENDENCIES) + @rm -f ioprio-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioprio_Xverbose_OBJECTS) $(ioprio_Xverbose_LDADD) $(LIBS) + ip_mreq$(EXEEXT): $(ip_mreq_OBJECTS) $(ip_mreq_DEPENDENCIES) $(EXTRA_ip_mreq_DEPENDENCIES) @rm -f ip_mreq$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ip_mreq_OBJECTS) $(ip_mreq_LDADD) $(LIBS) @@ -3476,22 +5889,98 @@ ipc_msg$(EXEEXT): $(ipc_msg_OBJECTS) $(ipc_msg_DEPENDENCIES) $(EXTRA_ipc_msg_DEP @rm -f ipc_msg$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ipc_msg_OBJECTS) $(ipc_msg_LDADD) $(LIBS) +ipc_msg-Xabbrev$(EXEEXT): $(ipc_msg_Xabbrev_OBJECTS) $(ipc_msg_Xabbrev_DEPENDENCIES) $(EXTRA_ipc_msg_Xabbrev_DEPENDENCIES) + @rm -f ipc_msg-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msg_Xabbrev_OBJECTS) $(ipc_msg_Xabbrev_LDADD) $(LIBS) + +ipc_msg-Xraw$(EXEEXT): $(ipc_msg_Xraw_OBJECTS) $(ipc_msg_Xraw_DEPENDENCIES) $(EXTRA_ipc_msg_Xraw_DEPENDENCIES) + @rm -f ipc_msg-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msg_Xraw_OBJECTS) $(ipc_msg_Xraw_LDADD) $(LIBS) + +ipc_msg-Xverbose$(EXEEXT): $(ipc_msg_Xverbose_OBJECTS) $(ipc_msg_Xverbose_DEPENDENCIES) $(EXTRA_ipc_msg_Xverbose_DEPENDENCIES) + @rm -f ipc_msg-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msg_Xverbose_OBJECTS) $(ipc_msg_Xverbose_LDADD) $(LIBS) + ipc_msgbuf$(EXEEXT): $(ipc_msgbuf_OBJECTS) $(ipc_msgbuf_DEPENDENCIES) $(EXTRA_ipc_msgbuf_DEPENDENCIES) @rm -f ipc_msgbuf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ipc_msgbuf_OBJECTS) $(ipc_msgbuf_LDADD) $(LIBS) +ipc_msgbuf-Xabbrev$(EXEEXT): $(ipc_msgbuf_Xabbrev_OBJECTS) $(ipc_msgbuf_Xabbrev_DEPENDENCIES) $(EXTRA_ipc_msgbuf_Xabbrev_DEPENDENCIES) + @rm -f ipc_msgbuf-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msgbuf_Xabbrev_OBJECTS) $(ipc_msgbuf_Xabbrev_LDADD) $(LIBS) + +ipc_msgbuf-Xraw$(EXEEXT): $(ipc_msgbuf_Xraw_OBJECTS) $(ipc_msgbuf_Xraw_DEPENDENCIES) $(EXTRA_ipc_msgbuf_Xraw_DEPENDENCIES) + @rm -f ipc_msgbuf-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msgbuf_Xraw_OBJECTS) $(ipc_msgbuf_Xraw_LDADD) $(LIBS) + +ipc_msgbuf-Xverbose$(EXEEXT): $(ipc_msgbuf_Xverbose_OBJECTS) $(ipc_msgbuf_Xverbose_DEPENDENCIES) $(EXTRA_ipc_msgbuf_Xverbose_DEPENDENCIES) + @rm -f ipc_msgbuf-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msgbuf_Xverbose_OBJECTS) $(ipc_msgbuf_Xverbose_LDADD) $(LIBS) + ipc_sem$(EXEEXT): $(ipc_sem_OBJECTS) $(ipc_sem_DEPENDENCIES) $(EXTRA_ipc_sem_DEPENDENCIES) @rm -f ipc_sem$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ipc_sem_OBJECTS) $(ipc_sem_LDADD) $(LIBS) +ipc_sem-Xabbrev$(EXEEXT): $(ipc_sem_Xabbrev_OBJECTS) $(ipc_sem_Xabbrev_DEPENDENCIES) $(EXTRA_ipc_sem_Xabbrev_DEPENDENCIES) + @rm -f ipc_sem-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_sem_Xabbrev_OBJECTS) $(ipc_sem_Xabbrev_LDADD) $(LIBS) + +ipc_sem-Xraw$(EXEEXT): $(ipc_sem_Xraw_OBJECTS) $(ipc_sem_Xraw_DEPENDENCIES) $(EXTRA_ipc_sem_Xraw_DEPENDENCIES) + @rm -f ipc_sem-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_sem_Xraw_OBJECTS) $(ipc_sem_Xraw_LDADD) $(LIBS) + +ipc_sem-Xverbose$(EXEEXT): $(ipc_sem_Xverbose_OBJECTS) $(ipc_sem_Xverbose_DEPENDENCIES) $(EXTRA_ipc_sem_Xverbose_DEPENDENCIES) + @rm -f ipc_sem-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_sem_Xverbose_OBJECTS) $(ipc_sem_Xverbose_LDADD) $(LIBS) + ipc_shm$(EXEEXT): $(ipc_shm_OBJECTS) $(ipc_shm_DEPENDENCIES) $(EXTRA_ipc_shm_DEPENDENCIES) @rm -f ipc_shm$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ipc_shm_OBJECTS) $(ipc_shm_LDADD) $(LIBS) +ipc_shm-Xabbrev$(EXEEXT): $(ipc_shm_Xabbrev_OBJECTS) $(ipc_shm_Xabbrev_DEPENDENCIES) $(EXTRA_ipc_shm_Xabbrev_DEPENDENCIES) + @rm -f ipc_shm-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_shm_Xabbrev_OBJECTS) $(ipc_shm_Xabbrev_LDADD) $(LIBS) + +ipc_shm-Xraw$(EXEEXT): $(ipc_shm_Xraw_OBJECTS) $(ipc_shm_Xraw_DEPENDENCIES) $(EXTRA_ipc_shm_Xraw_DEPENDENCIES) + @rm -f ipc_shm-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_shm_Xraw_OBJECTS) $(ipc_shm_Xraw_LDADD) $(LIBS) + +ipc_shm-Xverbose$(EXEEXT): $(ipc_shm_Xverbose_OBJECTS) $(ipc_shm_Xverbose_DEPENDENCIES) $(EXTRA_ipc_shm_Xverbose_DEPENDENCIES) + @rm -f ipc_shm-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_shm_Xverbose_OBJECTS) $(ipc_shm_Xverbose_LDADD) $(LIBS) + +is_linux_mips_n64$(EXEEXT): $(is_linux_mips_n64_OBJECTS) $(is_linux_mips_n64_DEPENDENCIES) $(EXTRA_is_linux_mips_n64_DEPENDENCIES) + @rm -f is_linux_mips_n64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(is_linux_mips_n64_OBJECTS) $(is_linux_mips_n64_LDADD) $(LIBS) + kcmp$(EXEEXT): $(kcmp_OBJECTS) $(kcmp_DEPENDENCIES) $(EXTRA_kcmp_DEPENDENCIES) @rm -f kcmp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(kcmp_OBJECTS) $(kcmp_LDADD) $(LIBS) +kcmp-y$(EXEEXT): $(kcmp_y_OBJECTS) $(kcmp_y_DEPENDENCIES) $(EXTRA_kcmp_y_DEPENDENCIES) + @rm -f kcmp-y$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kcmp_y_OBJECTS) $(kcmp_y_LDADD) $(LIBS) + +kern_features$(EXEEXT): $(kern_features_OBJECTS) $(kern_features_DEPENDENCIES) $(EXTRA_kern_features_DEPENDENCIES) + @rm -f kern_features$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kern_features_OBJECTS) $(kern_features_LDADD) $(LIBS) + +kernel_version$(EXEEXT): $(kernel_version_OBJECTS) $(kernel_version_DEPENDENCIES) $(EXTRA_kernel_version_DEPENDENCIES) + @rm -f kernel_version$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kernel_version_OBJECTS) $(kernel_version_LDADD) $(LIBS) + +kernel_version-Xabbrev$(EXEEXT): $(kernel_version_Xabbrev_OBJECTS) $(kernel_version_Xabbrev_DEPENDENCIES) $(EXTRA_kernel_version_Xabbrev_DEPENDENCIES) + @rm -f kernel_version-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kernel_version_Xabbrev_OBJECTS) $(kernel_version_Xabbrev_LDADD) $(LIBS) + +kernel_version-Xraw$(EXEEXT): $(kernel_version_Xraw_OBJECTS) $(kernel_version_Xraw_DEPENDENCIES) $(EXTRA_kernel_version_Xraw_DEPENDENCIES) + @rm -f kernel_version-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kernel_version_Xraw_OBJECTS) $(kernel_version_Xraw_LDADD) $(LIBS) + +kernel_version-Xverbose$(EXEEXT): $(kernel_version_Xverbose_OBJECTS) $(kernel_version_Xverbose_DEPENDENCIES) $(EXTRA_kernel_version_Xverbose_DEPENDENCIES) + @rm -f kernel_version-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kernel_version_Xverbose_OBJECTS) $(kernel_version_Xverbose_LDADD) $(LIBS) + kexec_file_load$(EXEEXT): $(kexec_file_load_OBJECTS) $(kexec_file_load_DEPENDENCIES) $(EXTRA_kexec_file_load_DEPENDENCIES) @rm -f kexec_file_load$(EXEEXT) $(AM_V_CCLD)$(LINK) $(kexec_file_load_OBJECTS) $(kexec_file_load_LDADD) $(LIBS) @@ -3504,10 +5993,26 @@ keyctl$(EXEEXT): $(keyctl_OBJECTS) $(keyctl_DEPENDENCIES) $(EXTRA_keyctl_DEPENDE @rm -f keyctl$(EXEEXT) $(AM_V_CCLD)$(LINK) $(keyctl_OBJECTS) $(keyctl_LDADD) $(LIBS) +keyctl-Xabbrev$(EXEEXT): $(keyctl_Xabbrev_OBJECTS) $(keyctl_Xabbrev_DEPENDENCIES) $(EXTRA_keyctl_Xabbrev_DEPENDENCIES) + @rm -f keyctl-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(keyctl_Xabbrev_OBJECTS) $(keyctl_Xabbrev_LDADD) $(LIBS) + +keyctl-Xraw$(EXEEXT): $(keyctl_Xraw_OBJECTS) $(keyctl_Xraw_DEPENDENCIES) $(EXTRA_keyctl_Xraw_DEPENDENCIES) + @rm -f keyctl-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(keyctl_Xraw_OBJECTS) $(keyctl_Xraw_LDADD) $(LIBS) + +keyctl-Xverbose$(EXEEXT): $(keyctl_Xverbose_OBJECTS) $(keyctl_Xverbose_DEPENDENCIES) $(EXTRA_keyctl_Xverbose_DEPENDENCIES) + @rm -f keyctl-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(keyctl_Xverbose_OBJECTS) $(keyctl_Xverbose_LDADD) $(LIBS) + kill$(EXEEXT): $(kill_OBJECTS) $(kill_DEPENDENCIES) $(EXTRA_kill_DEPENDENCIES) @rm -f kill$(EXEEXT) $(AM_V_CCLD)$(LINK) $(kill_OBJECTS) $(kill_LDADD) $(LIBS) +kill_child$(EXEEXT): $(kill_child_OBJECTS) $(kill_child_DEPENDENCIES) $(EXTRA_kill_child_DEPENDENCIES) + @rm -f kill_child$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kill_child_OBJECTS) $(kill_child_LDADD) $(LIBS) + ksysent$(EXEEXT): $(ksysent_OBJECTS) $(ksysent_DEPENDENCIES) $(EXTRA_ksysent_DEPENDENCIES) @rm -f ksysent$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ksysent_OBJECTS) $(ksysent_LDADD) $(LIBS) @@ -3528,14 +6033,26 @@ linkat$(EXEEXT): $(linkat_OBJECTS) $(linkat_DEPENDENCIES) $(EXTRA_linkat_DEPENDE @rm -f linkat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(linkat_OBJECTS) $(linkat_LDADD) $(LIBS) +list_sigaction_signum$(EXEEXT): $(list_sigaction_signum_OBJECTS) $(list_sigaction_signum_DEPENDENCIES) $(EXTRA_list_sigaction_signum_DEPENDENCIES) + @rm -f list_sigaction_signum$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(list_sigaction_signum_OBJECTS) $(list_sigaction_signum_LDADD) $(LIBS) + llseek$(EXEEXT): $(llseek_OBJECTS) $(llseek_DEPENDENCIES) $(EXTRA_llseek_DEPENDENCIES) @rm -f llseek$(EXEEXT) $(AM_V_CCLD)$(LINK) $(llseek_OBJECTS) $(llseek_LDADD) $(LIBS) +localtime$(EXEEXT): $(localtime_OBJECTS) $(localtime_DEPENDENCIES) $(EXTRA_localtime_DEPENDENCIES) + @rm -f localtime$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(localtime_OBJECTS) $(localtime_LDADD) $(LIBS) + lookup_dcookie$(EXEEXT): $(lookup_dcookie_OBJECTS) $(lookup_dcookie_DEPENDENCIES) $(EXTRA_lookup_dcookie_DEPENDENCIES) @rm -f lookup_dcookie$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lookup_dcookie_OBJECTS) $(lookup_dcookie_LDADD) $(LIBS) +looping_threads$(EXEEXT): $(looping_threads_OBJECTS) $(looping_threads_DEPENDENCIES) $(EXTRA_looping_threads_DEPENDENCIES) + @rm -f looping_threads$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(looping_threads_OBJECTS) $(looping_threads_LDADD) $(LIBS) + lseek$(EXEEXT): $(lseek_OBJECTS) $(lseek_DEPENDENCIES) $(EXTRA_lseek_DEPENDENCIES) @rm -f lseek$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lseek_OBJECTS) $(lseek_LDADD) $(LIBS) @@ -3548,6 +6065,10 @@ lstat64$(EXEEXT): $(lstat64_OBJECTS) $(lstat64_DEPENDENCIES) $(EXTRA_lstat64_DEP @rm -f lstat64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lstat64_OBJECTS) $(lstat64_LDADD) $(LIBS) +madvise$(EXEEXT): $(madvise_OBJECTS) $(madvise_DEPENDENCIES) $(EXTRA_madvise_DEPENDENCIES) + @rm -f madvise$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(madvise_OBJECTS) $(madvise_LDADD) $(LIBS) + mbind$(EXEEXT): $(mbind_OBJECTS) $(mbind_DEPENDENCIES) $(EXTRA_mbind_DEPENDENCIES) @rm -f mbind$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mbind_OBJECTS) $(mbind_LDADD) $(LIBS) @@ -3560,6 +6081,18 @@ memfd_create$(EXEEXT): $(memfd_create_OBJECTS) $(memfd_create_DEPENDENCIES) $(EX @rm -f memfd_create$(EXEEXT) $(AM_V_CCLD)$(LINK) $(memfd_create_OBJECTS) $(memfd_create_LDADD) $(LIBS) +memfd_create-Xabbrev$(EXEEXT): $(memfd_create_Xabbrev_OBJECTS) $(memfd_create_Xabbrev_DEPENDENCIES) $(EXTRA_memfd_create_Xabbrev_DEPENDENCIES) + @rm -f memfd_create-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(memfd_create_Xabbrev_OBJECTS) $(memfd_create_Xabbrev_LDADD) $(LIBS) + +memfd_create-Xraw$(EXEEXT): $(memfd_create_Xraw_OBJECTS) $(memfd_create_Xraw_DEPENDENCIES) $(EXTRA_memfd_create_Xraw_DEPENDENCIES) + @rm -f memfd_create-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(memfd_create_Xraw_OBJECTS) $(memfd_create_Xraw_LDADD) $(LIBS) + +memfd_create-Xverbose$(EXEEXT): $(memfd_create_Xverbose_OBJECTS) $(memfd_create_Xverbose_DEPENDENCIES) $(EXTRA_memfd_create_Xverbose_DEPENDENCIES) + @rm -f memfd_create-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(memfd_create_Xverbose_OBJECTS) $(memfd_create_Xverbose_LDADD) $(LIBS) + migrate_pages$(EXEEXT): $(migrate_pages_OBJECTS) $(migrate_pages_DEPENDENCIES) $(EXTRA_migrate_pages_DEPENDENCIES) @rm -f migrate_pages$(EXEEXT) $(AM_V_CCLD)$(LINK) $(migrate_pages_OBJECTS) $(migrate_pages_LDADD) $(LIBS) @@ -3600,10 +6133,34 @@ mmap$(EXEEXT): $(mmap_OBJECTS) $(mmap_DEPENDENCIES) $(EXTRA_mmap_DEPENDENCIES) @rm -f mmap$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mmap_OBJECTS) $(mmap_LDADD) $(LIBS) +mmap-Xabbrev$(EXEEXT): $(mmap_Xabbrev_OBJECTS) $(mmap_Xabbrev_DEPENDENCIES) $(EXTRA_mmap_Xabbrev_DEPENDENCIES) + @rm -f mmap-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap_Xabbrev_OBJECTS) $(mmap_Xabbrev_LDADD) $(LIBS) + +mmap-Xraw$(EXEEXT): $(mmap_Xraw_OBJECTS) $(mmap_Xraw_DEPENDENCIES) $(EXTRA_mmap_Xraw_DEPENDENCIES) + @rm -f mmap-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap_Xraw_OBJECTS) $(mmap_Xraw_LDADD) $(LIBS) + +mmap-Xverbose$(EXEEXT): $(mmap_Xverbose_OBJECTS) $(mmap_Xverbose_DEPENDENCIES) $(EXTRA_mmap_Xverbose_DEPENDENCIES) + @rm -f mmap-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap_Xverbose_OBJECTS) $(mmap_Xverbose_LDADD) $(LIBS) + mmap64$(EXEEXT): $(mmap64_OBJECTS) $(mmap64_DEPENDENCIES) $(EXTRA_mmap64_DEPENDENCIES) @rm -f mmap64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mmap64_OBJECTS) $(mmap64_LDADD) $(LIBS) +mmap64-Xabbrev$(EXEEXT): $(mmap64_Xabbrev_OBJECTS) $(mmap64_Xabbrev_DEPENDENCIES) $(EXTRA_mmap64_Xabbrev_DEPENDENCIES) + @rm -f mmap64-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap64_Xabbrev_OBJECTS) $(mmap64_Xabbrev_LDADD) $(LIBS) + +mmap64-Xraw$(EXEEXT): $(mmap64_Xraw_OBJECTS) $(mmap64_Xraw_DEPENDENCIES) $(EXTRA_mmap64_Xraw_DEPENDENCIES) + @rm -f mmap64-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap64_Xraw_OBJECTS) $(mmap64_Xraw_LDADD) $(LIBS) + +mmap64-Xverbose$(EXEEXT): $(mmap64_Xverbose_OBJECTS) $(mmap64_Xverbose_DEPENDENCIES) $(EXTRA_mmap64_Xverbose_DEPENDENCIES) + @rm -f mmap64-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap64_Xverbose_OBJECTS) $(mmap64_Xverbose_LDADD) $(LIBS) + mmsg$(EXEEXT): $(mmsg_OBJECTS) $(mmsg_DEPENDENCIES) $(EXTRA_mmsg_DEPENDENCIES) @rm -f mmsg$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mmsg_OBJECTS) $(mmsg_LDADD) $(LIBS) @@ -3620,14 +6177,42 @@ mmsg_name-v$(EXEEXT): $(mmsg_name_v_OBJECTS) $(mmsg_name_v_DEPENDENCIES) $(EXTRA @rm -f mmsg_name-v$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mmsg_name_v_OBJECTS) $(mmsg_name_v_LDADD) $(LIBS) +modify_ldt$(EXEEXT): $(modify_ldt_OBJECTS) $(modify_ldt_DEPENDENCIES) $(EXTRA_modify_ldt_DEPENDENCIES) + @rm -f modify_ldt$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(modify_ldt_OBJECTS) $(modify_ldt_LDADD) $(LIBS) + mount$(EXEEXT): $(mount_OBJECTS) $(mount_DEPENDENCIES) $(EXTRA_mount_DEPENDENCIES) @rm -f mount$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mount_OBJECTS) $(mount_LDADD) $(LIBS) +mount-Xabbrev$(EXEEXT): $(mount_Xabbrev_OBJECTS) $(mount_Xabbrev_DEPENDENCIES) $(EXTRA_mount_Xabbrev_DEPENDENCIES) + @rm -f mount-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mount_Xabbrev_OBJECTS) $(mount_Xabbrev_LDADD) $(LIBS) + +mount-Xraw$(EXEEXT): $(mount_Xraw_OBJECTS) $(mount_Xraw_DEPENDENCIES) $(EXTRA_mount_Xraw_DEPENDENCIES) + @rm -f mount-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mount_Xraw_OBJECTS) $(mount_Xraw_LDADD) $(LIBS) + +mount-Xverbose$(EXEEXT): $(mount_Xverbose_OBJECTS) $(mount_Xverbose_DEPENDENCIES) $(EXTRA_mount_Xverbose_DEPENDENCIES) + @rm -f mount-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mount_Xverbose_OBJECTS) $(mount_Xverbose_LDADD) $(LIBS) + move_pages$(EXEEXT): $(move_pages_OBJECTS) $(move_pages_DEPENDENCIES) $(EXTRA_move_pages_DEPENDENCIES) @rm -f move_pages$(EXEEXT) $(AM_V_CCLD)$(LINK) $(move_pages_OBJECTS) $(move_pages_LDADD) $(LIBS) +move_pages-Xabbrev$(EXEEXT): $(move_pages_Xabbrev_OBJECTS) $(move_pages_Xabbrev_DEPENDENCIES) $(EXTRA_move_pages_Xabbrev_DEPENDENCIES) + @rm -f move_pages-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(move_pages_Xabbrev_OBJECTS) $(move_pages_Xabbrev_LDADD) $(LIBS) + +move_pages-Xraw$(EXEEXT): $(move_pages_Xraw_OBJECTS) $(move_pages_Xraw_DEPENDENCIES) $(EXTRA_move_pages_Xraw_DEPENDENCIES) + @rm -f move_pages-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(move_pages_Xraw_OBJECTS) $(move_pages_Xraw_LDADD) $(LIBS) + +move_pages-Xverbose$(EXEEXT): $(move_pages_Xverbose_OBJECTS) $(move_pages_Xverbose_DEPENDENCIES) $(EXTRA_move_pages_Xverbose_DEPENDENCIES) + @rm -f move_pages-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(move_pages_Xverbose_OBJECTS) $(move_pages_Xverbose_LDADD) $(LIBS) + mq$(EXEEXT): $(mq_OBJECTS) $(mq_DEPENDENCIES) $(EXTRA_mq_DEPENDENCIES) @rm -f mq$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mq_OBJECTS) $(mq_LDADD) $(LIBS) @@ -3672,10 +6257,38 @@ net-icmp_filter$(EXEEXT): $(net_icmp_filter_OBJECTS) $(net_icmp_filter_DEPENDENC @rm -f net-icmp_filter$(EXEEXT) $(AM_V_CCLD)$(LINK) $(net_icmp_filter_OBJECTS) $(net_icmp_filter_LDADD) $(LIBS) +net-packet_mreq$(EXEEXT): $(net_packet_mreq_OBJECTS) $(net_packet_mreq_DEPENDENCIES) $(EXTRA_net_packet_mreq_DEPENDENCIES) + @rm -f net-packet_mreq$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_packet_mreq_OBJECTS) $(net_packet_mreq_LDADD) $(LIBS) + +net-packet_mreq-Xabbrev$(EXEEXT): $(net_packet_mreq_Xabbrev_OBJECTS) $(net_packet_mreq_Xabbrev_DEPENDENCIES) $(EXTRA_net_packet_mreq_Xabbrev_DEPENDENCIES) + @rm -f net-packet_mreq-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_packet_mreq_Xabbrev_OBJECTS) $(net_packet_mreq_Xabbrev_LDADD) $(LIBS) + +net-packet_mreq-Xraw$(EXEEXT): $(net_packet_mreq_Xraw_OBJECTS) $(net_packet_mreq_Xraw_DEPENDENCIES) $(EXTRA_net_packet_mreq_Xraw_DEPENDENCIES) + @rm -f net-packet_mreq-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_packet_mreq_Xraw_OBJECTS) $(net_packet_mreq_Xraw_LDADD) $(LIBS) + +net-packet_mreq-Xverbose$(EXEEXT): $(net_packet_mreq_Xverbose_OBJECTS) $(net_packet_mreq_Xverbose_DEPENDENCIES) $(EXTRA_net_packet_mreq_Xverbose_DEPENDENCIES) + @rm -f net-packet_mreq-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_packet_mreq_Xverbose_OBJECTS) $(net_packet_mreq_Xverbose_LDADD) $(LIBS) + net-sockaddr$(EXEEXT): $(net_sockaddr_OBJECTS) $(net_sockaddr_DEPENDENCIES) $(EXTRA_net_sockaddr_DEPENDENCIES) @rm -f net-sockaddr$(EXEEXT) $(AM_V_CCLD)$(LINK) $(net_sockaddr_OBJECTS) $(net_sockaddr_LDADD) $(LIBS) +net-tpacket_req$(EXEEXT): $(net_tpacket_req_OBJECTS) $(net_tpacket_req_DEPENDENCIES) $(EXTRA_net_tpacket_req_DEPENDENCIES) + @rm -f net-tpacket_req$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_tpacket_req_OBJECTS) $(net_tpacket_req_LDADD) $(LIBS) + +net-tpacket_stats$(EXEEXT): $(net_tpacket_stats_OBJECTS) $(net_tpacket_stats_DEPENDENCIES) $(EXTRA_net_tpacket_stats_DEPENDENCIES) + @rm -f net-tpacket_stats$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_tpacket_stats_OBJECTS) $(net_tpacket_stats_LDADD) $(LIBS) + +net-tpacket_stats-success$(EXEEXT): $(net_tpacket_stats_success_OBJECTS) $(net_tpacket_stats_success_DEPENDENCIES) $(EXTRA_net_tpacket_stats_success_DEPENDENCIES) + @rm -f net-tpacket_stats-success$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_tpacket_stats_success_OBJECTS) $(net_tpacket_stats_success_LDADD) $(LIBS) + net-y-unix$(EXEEXT): $(net_y_unix_OBJECTS) $(net_y_unix_DEPENDENCIES) $(EXTRA_net_y_unix_DEPENDENCIES) @rm -f net-y-unix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(net_y_unix_OBJECTS) $(net_y_unix_LDADD) $(LIBS) @@ -3684,6 +6297,10 @@ net-yy-inet$(EXEEXT): $(net_yy_inet_OBJECTS) $(net_yy_inet_DEPENDENCIES) $(EXTRA @rm -f net-yy-inet$(EXEEXT) $(AM_V_CCLD)$(LINK) $(net_yy_inet_OBJECTS) $(net_yy_inet_LDADD) $(LIBS) +net-yy-inet6$(EXEEXT): $(net_yy_inet6_OBJECTS) $(net_yy_inet6_DEPENDENCIES) $(EXTRA_net_yy_inet6_DEPENDENCIES) + @rm -f net-yy-inet6$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_yy_inet6_OBJECTS) $(net_yy_inet6_LDADD) $(LIBS) + net-yy-netlink$(EXEEXT): $(net_yy_netlink_OBJECTS) $(net_yy_netlink_DEPENDENCIES) $(EXTRA_net_yy_netlink_DEPENDENCIES) @rm -f net-yy-netlink$(EXEEXT) $(AM_V_CCLD)$(LINK) $(net_yy_netlink_OBJECTS) $(net_yy_netlink_LDADD) $(LIBS) @@ -3692,10 +6309,30 @@ net-yy-unix$(EXEEXT): $(net_yy_unix_OBJECTS) $(net_yy_unix_DEPENDENCIES) $(EXTRA @rm -f net-yy-unix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(net_yy_unix_OBJECTS) $(net_yy_unix_LDADD) $(LIBS) +netlink_audit$(EXEEXT): $(netlink_audit_OBJECTS) $(netlink_audit_DEPENDENCIES) $(EXTRA_netlink_audit_DEPENDENCIES) + @rm -f netlink_audit$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_audit_OBJECTS) $(netlink_audit_LDADD) $(LIBS) + +netlink_crypto$(EXEEXT): $(netlink_crypto_OBJECTS) $(netlink_crypto_DEPENDENCIES) $(EXTRA_netlink_crypto_DEPENDENCIES) + @rm -f netlink_crypto$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_crypto_OBJECTS) $(netlink_crypto_LDADD) $(LIBS) + +netlink_generic$(EXEEXT): $(netlink_generic_OBJECTS) $(netlink_generic_DEPENDENCIES) $(EXTRA_netlink_generic_DEPENDENCIES) + @rm -f netlink_generic$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_generic_OBJECTS) $(netlink_generic_LDADD) $(LIBS) + netlink_inet_diag$(EXEEXT): $(netlink_inet_diag_OBJECTS) $(netlink_inet_diag_DEPENDENCIES) $(EXTRA_netlink_inet_diag_DEPENDENCIES) @rm -f netlink_inet_diag$(EXEEXT) $(AM_V_CCLD)$(LINK) $(netlink_inet_diag_OBJECTS) $(netlink_inet_diag_LDADD) $(LIBS) +netlink_kobject_uevent$(EXEEXT): $(netlink_kobject_uevent_OBJECTS) $(netlink_kobject_uevent_DEPENDENCIES) $(EXTRA_netlink_kobject_uevent_DEPENDENCIES) + @rm -f netlink_kobject_uevent$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_kobject_uevent_OBJECTS) $(netlink_kobject_uevent_LDADD) $(LIBS) + +netlink_netfilter$(EXEEXT): $(netlink_netfilter_OBJECTS) $(netlink_netfilter_DEPENDENCIES) $(EXTRA_netlink_netfilter_DEPENDENCIES) + @rm -f netlink_netfilter$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_netfilter_OBJECTS) $(netlink_netfilter_LDADD) $(LIBS) + netlink_netlink_diag$(EXEEXT): $(netlink_netlink_diag_OBJECTS) $(netlink_netlink_diag_DEPENDENCIES) $(EXTRA_netlink_netlink_diag_DEPENDENCIES) @rm -f netlink_netlink_diag$(EXEEXT) $(AM_V_CCLD)$(LINK) $(netlink_netlink_diag_OBJECTS) $(netlink_netlink_diag_LDADD) $(LIBS) @@ -3704,22 +6341,234 @@ netlink_protocol$(EXEEXT): $(netlink_protocol_OBJECTS) $(netlink_protocol_DEPEND @rm -f netlink_protocol$(EXEEXT) $(AM_V_CCLD)$(LINK) $(netlink_protocol_OBJECTS) $(netlink_protocol_LDADD) $(LIBS) +netlink_route$(EXEEXT): $(netlink_route_OBJECTS) $(netlink_route_DEPENDENCIES) $(EXTRA_netlink_route_DEPENDENCIES) + @rm -f netlink_route$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_route_OBJECTS) $(netlink_route_LDADD) $(LIBS) + +netlink_selinux$(EXEEXT): $(netlink_selinux_OBJECTS) $(netlink_selinux_DEPENDENCIES) $(EXTRA_netlink_selinux_DEPENDENCIES) + @rm -f netlink_selinux$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_selinux_OBJECTS) $(netlink_selinux_LDADD) $(LIBS) + +netlink_sock_diag$(EXEEXT): $(netlink_sock_diag_OBJECTS) $(netlink_sock_diag_DEPENDENCIES) $(EXTRA_netlink_sock_diag_DEPENDENCIES) + @rm -f netlink_sock_diag$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_sock_diag_OBJECTS) $(netlink_sock_diag_LDADD) $(LIBS) + netlink_unix_diag$(EXEEXT): $(netlink_unix_diag_OBJECTS) $(netlink_unix_diag_DEPENDENCIES) $(EXTRA_netlink_unix_diag_DEPENDENCIES) @rm -f netlink_unix_diag$(EXEEXT) $(AM_V_CCLD)$(LINK) $(netlink_unix_diag_OBJECTS) $(netlink_unix_diag_LDADD) $(LIBS) +netlink_xfrm$(EXEEXT): $(netlink_xfrm_OBJECTS) $(netlink_xfrm_DEPENDENCIES) $(EXTRA_netlink_xfrm_DEPENDENCIES) + @rm -f netlink_xfrm$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_xfrm_OBJECTS) $(netlink_xfrm_LDADD) $(LIBS) + newfstatat$(EXEEXT): $(newfstatat_OBJECTS) $(newfstatat_DEPENDENCIES) $(EXTRA_newfstatat_DEPENDENCIES) @rm -f newfstatat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(newfstatat_OBJECTS) $(newfstatat_LDADD) $(LIBS) +nfnetlink_acct$(EXEEXT): $(nfnetlink_acct_OBJECTS) $(nfnetlink_acct_DEPENDENCIES) $(EXTRA_nfnetlink_acct_DEPENDENCIES) + @rm -f nfnetlink_acct$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_acct_OBJECTS) $(nfnetlink_acct_LDADD) $(LIBS) + +nfnetlink_cthelper$(EXEEXT): $(nfnetlink_cthelper_OBJECTS) $(nfnetlink_cthelper_DEPENDENCIES) $(EXTRA_nfnetlink_cthelper_DEPENDENCIES) + @rm -f nfnetlink_cthelper$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_cthelper_OBJECTS) $(nfnetlink_cthelper_LDADD) $(LIBS) + +nfnetlink_ctnetlink$(EXEEXT): $(nfnetlink_ctnetlink_OBJECTS) $(nfnetlink_ctnetlink_DEPENDENCIES) $(EXTRA_nfnetlink_ctnetlink_DEPENDENCIES) + @rm -f nfnetlink_ctnetlink$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_ctnetlink_OBJECTS) $(nfnetlink_ctnetlink_LDADD) $(LIBS) + +nfnetlink_ctnetlink_exp$(EXEEXT): $(nfnetlink_ctnetlink_exp_OBJECTS) $(nfnetlink_ctnetlink_exp_DEPENDENCIES) $(EXTRA_nfnetlink_ctnetlink_exp_DEPENDENCIES) + @rm -f nfnetlink_ctnetlink_exp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_ctnetlink_exp_OBJECTS) $(nfnetlink_ctnetlink_exp_LDADD) $(LIBS) + +nfnetlink_cttimeout$(EXEEXT): $(nfnetlink_cttimeout_OBJECTS) $(nfnetlink_cttimeout_DEPENDENCIES) $(EXTRA_nfnetlink_cttimeout_DEPENDENCIES) + @rm -f nfnetlink_cttimeout$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_cttimeout_OBJECTS) $(nfnetlink_cttimeout_LDADD) $(LIBS) + +nfnetlink_ipset$(EXEEXT): $(nfnetlink_ipset_OBJECTS) $(nfnetlink_ipset_DEPENDENCIES) $(EXTRA_nfnetlink_ipset_DEPENDENCIES) + @rm -f nfnetlink_ipset$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_ipset_OBJECTS) $(nfnetlink_ipset_LDADD) $(LIBS) + +nfnetlink_nft_compat$(EXEEXT): $(nfnetlink_nft_compat_OBJECTS) $(nfnetlink_nft_compat_DEPENDENCIES) $(EXTRA_nfnetlink_nft_compat_DEPENDENCIES) + @rm -f nfnetlink_nft_compat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_nft_compat_OBJECTS) $(nfnetlink_nft_compat_LDADD) $(LIBS) + +nfnetlink_nftables$(EXEEXT): $(nfnetlink_nftables_OBJECTS) $(nfnetlink_nftables_DEPENDENCIES) $(EXTRA_nfnetlink_nftables_DEPENDENCIES) + @rm -f nfnetlink_nftables$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_nftables_OBJECTS) $(nfnetlink_nftables_LDADD) $(LIBS) + +nfnetlink_osf$(EXEEXT): $(nfnetlink_osf_OBJECTS) $(nfnetlink_osf_DEPENDENCIES) $(EXTRA_nfnetlink_osf_DEPENDENCIES) + @rm -f nfnetlink_osf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_osf_OBJECTS) $(nfnetlink_osf_LDADD) $(LIBS) + +nfnetlink_queue$(EXEEXT): $(nfnetlink_queue_OBJECTS) $(nfnetlink_queue_DEPENDENCIES) $(EXTRA_nfnetlink_queue_DEPENDENCIES) + @rm -f nfnetlink_queue$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_queue_OBJECTS) $(nfnetlink_queue_LDADD) $(LIBS) + +nfnetlink_ulog$(EXEEXT): $(nfnetlink_ulog_OBJECTS) $(nfnetlink_ulog_DEPENDENCIES) $(EXTRA_nfnetlink_ulog_DEPENDENCIES) + @rm -f nfnetlink_ulog$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_ulog_OBJECTS) $(nfnetlink_ulog_LDADD) $(LIBS) + +nlattr$(EXEEXT): $(nlattr_OBJECTS) $(nlattr_DEPENDENCIES) $(EXTRA_nlattr_DEPENDENCIES) + @rm -f nlattr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_OBJECTS) $(nlattr_LDADD) $(LIBS) + +nlattr_br_port_msg$(EXEEXT): $(nlattr_br_port_msg_OBJECTS) $(nlattr_br_port_msg_DEPENDENCIES) $(EXTRA_nlattr_br_port_msg_DEPENDENCIES) + @rm -f nlattr_br_port_msg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_br_port_msg_OBJECTS) $(nlattr_br_port_msg_LDADD) $(LIBS) + +nlattr_crypto_user_alg$(EXEEXT): $(nlattr_crypto_user_alg_OBJECTS) $(nlattr_crypto_user_alg_DEPENDENCIES) $(EXTRA_nlattr_crypto_user_alg_DEPENDENCIES) + @rm -f nlattr_crypto_user_alg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_crypto_user_alg_OBJECTS) $(nlattr_crypto_user_alg_LDADD) $(LIBS) + +nlattr_dcbmsg$(EXEEXT): $(nlattr_dcbmsg_OBJECTS) $(nlattr_dcbmsg_DEPENDENCIES) $(EXTRA_nlattr_dcbmsg_DEPENDENCIES) + @rm -f nlattr_dcbmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_dcbmsg_OBJECTS) $(nlattr_dcbmsg_LDADD) $(LIBS) + +nlattr_fib_rule_hdr$(EXEEXT): $(nlattr_fib_rule_hdr_OBJECTS) $(nlattr_fib_rule_hdr_DEPENDENCIES) $(EXTRA_nlattr_fib_rule_hdr_DEPENDENCIES) + @rm -f nlattr_fib_rule_hdr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_fib_rule_hdr_OBJECTS) $(nlattr_fib_rule_hdr_LDADD) $(LIBS) + +nlattr_ifaddrlblmsg$(EXEEXT): $(nlattr_ifaddrlblmsg_OBJECTS) $(nlattr_ifaddrlblmsg_DEPENDENCIES) $(EXTRA_nlattr_ifaddrlblmsg_DEPENDENCIES) + @rm -f nlattr_ifaddrlblmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifaddrlblmsg_OBJECTS) $(nlattr_ifaddrlblmsg_LDADD) $(LIBS) + +nlattr_ifaddrmsg$(EXEEXT): $(nlattr_ifaddrmsg_OBJECTS) $(nlattr_ifaddrmsg_DEPENDENCIES) $(EXTRA_nlattr_ifaddrmsg_DEPENDENCIES) + @rm -f nlattr_ifaddrmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifaddrmsg_OBJECTS) $(nlattr_ifaddrmsg_LDADD) $(LIBS) + +nlattr_ifinfomsg$(EXEEXT): $(nlattr_ifinfomsg_OBJECTS) $(nlattr_ifinfomsg_DEPENDENCIES) $(EXTRA_nlattr_ifinfomsg_DEPENDENCIES) + @rm -f nlattr_ifinfomsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifinfomsg_OBJECTS) $(nlattr_ifinfomsg_LDADD) $(LIBS) + +nlattr_ifla_af_spec$(EXEEXT): $(nlattr_ifla_af_spec_OBJECTS) $(nlattr_ifla_af_spec_DEPENDENCIES) $(EXTRA_nlattr_ifla_af_spec_DEPENDENCIES) + @rm -f nlattr_ifla_af_spec$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifla_af_spec_OBJECTS) $(nlattr_ifla_af_spec_LDADD) $(LIBS) + +nlattr_ifla_brport$(EXEEXT): $(nlattr_ifla_brport_OBJECTS) $(nlattr_ifla_brport_DEPENDENCIES) $(EXTRA_nlattr_ifla_brport_DEPENDENCIES) + @rm -f nlattr_ifla_brport$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifla_brport_OBJECTS) $(nlattr_ifla_brport_LDADD) $(LIBS) + +nlattr_ifla_linkinfo$(EXEEXT): $(nlattr_ifla_linkinfo_OBJECTS) $(nlattr_ifla_linkinfo_DEPENDENCIES) $(EXTRA_nlattr_ifla_linkinfo_DEPENDENCIES) + @rm -f nlattr_ifla_linkinfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifla_linkinfo_OBJECTS) $(nlattr_ifla_linkinfo_LDADD) $(LIBS) + +nlattr_ifla_port$(EXEEXT): $(nlattr_ifla_port_OBJECTS) $(nlattr_ifla_port_DEPENDENCIES) $(EXTRA_nlattr_ifla_port_DEPENDENCIES) + @rm -f nlattr_ifla_port$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifla_port_OBJECTS) $(nlattr_ifla_port_LDADD) $(LIBS) + +nlattr_ifla_xdp$(EXEEXT): $(nlattr_ifla_xdp_OBJECTS) $(nlattr_ifla_xdp_DEPENDENCIES) $(EXTRA_nlattr_ifla_xdp_DEPENDENCIES) + @rm -f nlattr_ifla_xdp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifla_xdp_OBJECTS) $(nlattr_ifla_xdp_LDADD) $(LIBS) + +nlattr_inet_diag_msg$(EXEEXT): $(nlattr_inet_diag_msg_OBJECTS) $(nlattr_inet_diag_msg_DEPENDENCIES) $(EXTRA_nlattr_inet_diag_msg_DEPENDENCIES) + @rm -f nlattr_inet_diag_msg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_inet_diag_msg_OBJECTS) $(nlattr_inet_diag_msg_LDADD) $(LIBS) + +nlattr_inet_diag_req_compat$(EXEEXT): $(nlattr_inet_diag_req_compat_OBJECTS) $(nlattr_inet_diag_req_compat_DEPENDENCIES) $(EXTRA_nlattr_inet_diag_req_compat_DEPENDENCIES) + @rm -f nlattr_inet_diag_req_compat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_inet_diag_req_compat_OBJECTS) $(nlattr_inet_diag_req_compat_LDADD) $(LIBS) + +nlattr_inet_diag_req_v2$(EXEEXT): $(nlattr_inet_diag_req_v2_OBJECTS) $(nlattr_inet_diag_req_v2_DEPENDENCIES) $(EXTRA_nlattr_inet_diag_req_v2_DEPENDENCIES) + @rm -f nlattr_inet_diag_req_v2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_inet_diag_req_v2_OBJECTS) $(nlattr_inet_diag_req_v2_LDADD) $(LIBS) + +nlattr_mdba_mdb_entry$(EXEEXT): $(nlattr_mdba_mdb_entry_OBJECTS) $(nlattr_mdba_mdb_entry_DEPENDENCIES) $(EXTRA_nlattr_mdba_mdb_entry_DEPENDENCIES) + @rm -f nlattr_mdba_mdb_entry$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_mdba_mdb_entry_OBJECTS) $(nlattr_mdba_mdb_entry_LDADD) $(LIBS) + +nlattr_mdba_router_port$(EXEEXT): $(nlattr_mdba_router_port_OBJECTS) $(nlattr_mdba_router_port_DEPENDENCIES) $(EXTRA_nlattr_mdba_router_port_DEPENDENCIES) + @rm -f nlattr_mdba_router_port$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_mdba_router_port_OBJECTS) $(nlattr_mdba_router_port_LDADD) $(LIBS) + +nlattr_ndmsg$(EXEEXT): $(nlattr_ndmsg_OBJECTS) $(nlattr_ndmsg_DEPENDENCIES) $(EXTRA_nlattr_ndmsg_DEPENDENCIES) + @rm -f nlattr_ndmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ndmsg_OBJECTS) $(nlattr_ndmsg_LDADD) $(LIBS) + +nlattr_ndtmsg$(EXEEXT): $(nlattr_ndtmsg_OBJECTS) $(nlattr_ndtmsg_DEPENDENCIES) $(EXTRA_nlattr_ndtmsg_DEPENDENCIES) + @rm -f nlattr_ndtmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ndtmsg_OBJECTS) $(nlattr_ndtmsg_LDADD) $(LIBS) + +nlattr_netconfmsg$(EXEEXT): $(nlattr_netconfmsg_OBJECTS) $(nlattr_netconfmsg_DEPENDENCIES) $(EXTRA_nlattr_netconfmsg_DEPENDENCIES) + @rm -f nlattr_netconfmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_netconfmsg_OBJECTS) $(nlattr_netconfmsg_LDADD) $(LIBS) + +nlattr_netlink_diag_msg$(EXEEXT): $(nlattr_netlink_diag_msg_OBJECTS) $(nlattr_netlink_diag_msg_DEPENDENCIES) $(EXTRA_nlattr_netlink_diag_msg_DEPENDENCIES) + @rm -f nlattr_netlink_diag_msg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_netlink_diag_msg_OBJECTS) $(nlattr_netlink_diag_msg_LDADD) $(LIBS) + +nlattr_nlmsgerr$(EXEEXT): $(nlattr_nlmsgerr_OBJECTS) $(nlattr_nlmsgerr_DEPENDENCIES) $(EXTRA_nlattr_nlmsgerr_DEPENDENCIES) + @rm -f nlattr_nlmsgerr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_nlmsgerr_OBJECTS) $(nlattr_nlmsgerr_LDADD) $(LIBS) + +nlattr_packet_diag_msg$(EXEEXT): $(nlattr_packet_diag_msg_OBJECTS) $(nlattr_packet_diag_msg_DEPENDENCIES) $(EXTRA_nlattr_packet_diag_msg_DEPENDENCIES) + @rm -f nlattr_packet_diag_msg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_packet_diag_msg_OBJECTS) $(nlattr_packet_diag_msg_LDADD) $(LIBS) + +nlattr_rtgenmsg$(EXEEXT): $(nlattr_rtgenmsg_OBJECTS) $(nlattr_rtgenmsg_DEPENDENCIES) $(EXTRA_nlattr_rtgenmsg_DEPENDENCIES) + @rm -f nlattr_rtgenmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_rtgenmsg_OBJECTS) $(nlattr_rtgenmsg_LDADD) $(LIBS) + +nlattr_rtmsg$(EXEEXT): $(nlattr_rtmsg_OBJECTS) $(nlattr_rtmsg_DEPENDENCIES) $(EXTRA_nlattr_rtmsg_DEPENDENCIES) + @rm -f nlattr_rtmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_rtmsg_OBJECTS) $(nlattr_rtmsg_LDADD) $(LIBS) + +nlattr_smc_diag_msg$(EXEEXT): $(nlattr_smc_diag_msg_OBJECTS) $(nlattr_smc_diag_msg_DEPENDENCIES) $(EXTRA_nlattr_smc_diag_msg_DEPENDENCIES) + @rm -f nlattr_smc_diag_msg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_smc_diag_msg_OBJECTS) $(nlattr_smc_diag_msg_LDADD) $(LIBS) + +nlattr_tc_stats$(EXEEXT): $(nlattr_tc_stats_OBJECTS) $(nlattr_tc_stats_DEPENDENCIES) $(EXTRA_nlattr_tc_stats_DEPENDENCIES) + @rm -f nlattr_tc_stats$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_tc_stats_OBJECTS) $(nlattr_tc_stats_LDADD) $(LIBS) + +nlattr_tca_stab$(EXEEXT): $(nlattr_tca_stab_OBJECTS) $(nlattr_tca_stab_DEPENDENCIES) $(EXTRA_nlattr_tca_stab_DEPENDENCIES) + @rm -f nlattr_tca_stab$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_tca_stab_OBJECTS) $(nlattr_tca_stab_LDADD) $(LIBS) + +nlattr_tcamsg$(EXEEXT): $(nlattr_tcamsg_OBJECTS) $(nlattr_tcamsg_DEPENDENCIES) $(EXTRA_nlattr_tcamsg_DEPENDENCIES) + @rm -f nlattr_tcamsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_tcamsg_OBJECTS) $(nlattr_tcamsg_LDADD) $(LIBS) + +nlattr_tcmsg$(EXEEXT): $(nlattr_tcmsg_OBJECTS) $(nlattr_tcmsg_DEPENDENCIES) $(EXTRA_nlattr_tcmsg_DEPENDENCIES) + @rm -f nlattr_tcmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_tcmsg_OBJECTS) $(nlattr_tcmsg_LDADD) $(LIBS) + +nlattr_unix_diag_msg$(EXEEXT): $(nlattr_unix_diag_msg_OBJECTS) $(nlattr_unix_diag_msg_DEPENDENCIES) $(EXTRA_nlattr_unix_diag_msg_DEPENDENCIES) + @rm -f nlattr_unix_diag_msg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_unix_diag_msg_OBJECTS) $(nlattr_unix_diag_msg_LDADD) $(LIBS) + nsyscalls$(EXEEXT): $(nsyscalls_OBJECTS) $(nsyscalls_DEPENDENCIES) $(EXTRA_nsyscalls_DEPENDENCIES) @rm -f nsyscalls$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nsyscalls_OBJECTS) $(nsyscalls_LDADD) $(LIBS) +nsyscalls-d$(EXEEXT): $(nsyscalls_d_OBJECTS) $(nsyscalls_d_DEPENDENCIES) $(EXTRA_nsyscalls_d_DEPENDENCIES) + @rm -f nsyscalls-d$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nsyscalls_d_OBJECTS) $(nsyscalls_d_LDADD) $(LIBS) + old_mmap$(EXEEXT): $(old_mmap_OBJECTS) $(old_mmap_DEPENDENCIES) $(EXTRA_old_mmap_DEPENDENCIES) @rm -f old_mmap$(EXEEXT) $(AM_V_CCLD)$(LINK) $(old_mmap_OBJECTS) $(old_mmap_LDADD) $(LIBS) +old_mmap-P$(EXEEXT): $(old_mmap_P_OBJECTS) $(old_mmap_P_DEPENDENCIES) $(EXTRA_old_mmap_P_DEPENDENCIES) + @rm -f old_mmap-P$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(old_mmap_P_OBJECTS) $(old_mmap_P_LDADD) $(LIBS) + +old_mmap-Xabbrev$(EXEEXT): $(old_mmap_Xabbrev_OBJECTS) $(old_mmap_Xabbrev_DEPENDENCIES) $(EXTRA_old_mmap_Xabbrev_DEPENDENCIES) + @rm -f old_mmap-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(old_mmap_Xabbrev_OBJECTS) $(old_mmap_Xabbrev_LDADD) $(LIBS) + +old_mmap-Xraw$(EXEEXT): $(old_mmap_Xraw_OBJECTS) $(old_mmap_Xraw_DEPENDENCIES) $(EXTRA_old_mmap_Xraw_DEPENDENCIES) + @rm -f old_mmap-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(old_mmap_Xraw_OBJECTS) $(old_mmap_Xraw_LDADD) $(LIBS) + +old_mmap-Xverbose$(EXEEXT): $(old_mmap_Xverbose_OBJECTS) $(old_mmap_Xverbose_DEPENDENCIES) $(EXTRA_old_mmap_Xverbose_DEPENDENCIES) + @rm -f old_mmap-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(old_mmap_Xverbose_OBJECTS) $(old_mmap_Xverbose_LDADD) $(LIBS) + +old_mmap-v-none$(EXEEXT): $(old_mmap_v_none_OBJECTS) $(old_mmap_v_none_DEPENDENCIES) $(EXTRA_old_mmap_v_none_DEPENDENCIES) + @rm -f old_mmap-v-none$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(old_mmap_v_none_OBJECTS) $(old_mmap_v_none_LDADD) $(LIBS) + oldfstat$(EXEEXT): $(oldfstat_OBJECTS) $(oldfstat_DEPENDENCIES) $(EXTRA_oldfstat_DEPENDENCIES) @rm -f oldfstat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(oldfstat_OBJECTS) $(oldfstat_LDADD) $(LIBS) @@ -3732,6 +6581,18 @@ oldselect$(EXEEXT): $(oldselect_OBJECTS) $(oldselect_DEPENDENCIES) $(EXTRA_oldse @rm -f oldselect$(EXEEXT) $(AM_V_CCLD)$(LINK) $(oldselect_OBJECTS) $(oldselect_LDADD) $(LIBS) +oldselect-P$(EXEEXT): $(oldselect_P_OBJECTS) $(oldselect_P_DEPENDENCIES) $(EXTRA_oldselect_P_DEPENDENCIES) + @rm -f oldselect-P$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(oldselect_P_OBJECTS) $(oldselect_P_LDADD) $(LIBS) + +oldselect-efault$(EXEEXT): $(oldselect_efault_OBJECTS) $(oldselect_efault_DEPENDENCIES) $(EXTRA_oldselect_efault_DEPENDENCIES) + @rm -f oldselect-efault$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(oldselect_efault_OBJECTS) $(oldselect_efault_LDADD) $(LIBS) + +oldselect-efault-P$(EXEEXT): $(oldselect_efault_P_OBJECTS) $(oldselect_efault_P_DEPENDENCIES) $(EXTRA_oldselect_efault_P_DEPENDENCIES) + @rm -f oldselect-efault-P$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(oldselect_efault_P_OBJECTS) $(oldselect_efault_P_LDADD) $(LIBS) + oldstat$(EXEEXT): $(oldstat_OBJECTS) $(oldstat_DEPENDENCIES) $(EXTRA_oldstat_DEPENDENCIES) @rm -f oldstat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(oldstat_OBJECTS) $(oldstat_LDADD) $(LIBS) @@ -3744,6 +6605,14 @@ openat$(EXEEXT): $(openat_OBJECTS) $(openat_DEPENDENCIES) $(EXTRA_openat_DEPENDE @rm -f openat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(openat_OBJECTS) $(openat_LDADD) $(LIBS) +orphaned_process_group$(EXEEXT): $(orphaned_process_group_OBJECTS) $(orphaned_process_group_DEPENDENCIES) $(EXTRA_orphaned_process_group_DEPENDENCIES) + @rm -f orphaned_process_group$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(orphaned_process_group_OBJECTS) $(orphaned_process_group_LDADD) $(LIBS) + +osf_utimes$(EXEEXT): $(osf_utimes_OBJECTS) $(osf_utimes_DEPENDENCIES) $(EXTRA_osf_utimes_DEPENDENCIES) + @rm -f osf_utimes$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(osf_utimes_OBJECTS) $(osf_utimes_LDADD) $(LIBS) + pause$(EXEEXT): $(pause_OBJECTS) $(pause_DEPENDENCIES) $(EXTRA_pause_DEPENDENCIES) @rm -f pause$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pause_OBJECTS) $(pause_LDADD) $(LIBS) @@ -3768,6 +6637,22 @@ personality$(EXEEXT): $(personality_OBJECTS) $(personality_DEPENDENCIES) $(EXTRA @rm -f personality$(EXEEXT) $(AM_V_CCLD)$(LINK) $(personality_OBJECTS) $(personality_LDADD) $(LIBS) +personality-Xabbrev$(EXEEXT): $(personality_Xabbrev_OBJECTS) $(personality_Xabbrev_DEPENDENCIES) $(EXTRA_personality_Xabbrev_DEPENDENCIES) + @rm -f personality-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(personality_Xabbrev_OBJECTS) $(personality_Xabbrev_LDADD) $(LIBS) + +personality-Xraw$(EXEEXT): $(personality_Xraw_OBJECTS) $(personality_Xraw_DEPENDENCIES) $(EXTRA_personality_Xraw_DEPENDENCIES) + @rm -f personality-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(personality_Xraw_OBJECTS) $(personality_Xraw_LDADD) $(LIBS) + +personality-Xverbose$(EXEEXT): $(personality_Xverbose_OBJECTS) $(personality_Xverbose_DEPENDENCIES) $(EXTRA_personality_Xverbose_DEPENDENCIES) + @rm -f personality-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(personality_Xverbose_OBJECTS) $(personality_Xverbose_LDADD) $(LIBS) + +pidfd_send_signal$(EXEEXT): $(pidfd_send_signal_OBJECTS) $(pidfd_send_signal_DEPENDENCIES) $(EXTRA_pidfd_send_signal_DEPENDENCIES) + @rm -f pidfd_send_signal$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pidfd_send_signal_OBJECTS) $(pidfd_send_signal_LDADD) $(LIBS) + pipe$(EXEEXT): $(pipe_OBJECTS) $(pipe_DEPENDENCIES) $(EXTRA_pipe_DEPENDENCIES) @rm -f pipe$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pipe_OBJECTS) $(pipe_LDADD) $(LIBS) @@ -3792,10 +6677,22 @@ poll$(EXEEXT): $(poll_OBJECTS) $(poll_DEPENDENCIES) $(EXTRA_poll_DEPENDENCIES) @rm -f poll$(EXEEXT) $(AM_V_CCLD)$(LINK) $(poll_OBJECTS) $(poll_LDADD) $(LIBS) +poll-P$(EXEEXT): $(poll_P_OBJECTS) $(poll_P_DEPENDENCIES) $(EXTRA_poll_P_DEPENDENCIES) + @rm -f poll-P$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(poll_P_OBJECTS) $(poll_P_LDADD) $(LIBS) + ppoll$(EXEEXT): $(ppoll_OBJECTS) $(ppoll_DEPENDENCIES) $(EXTRA_ppoll_DEPENDENCIES) @rm -f ppoll$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ppoll_OBJECTS) $(ppoll_LDADD) $(LIBS) +ppoll-P$(EXEEXT): $(ppoll_P_OBJECTS) $(ppoll_P_DEPENDENCIES) $(EXTRA_ppoll_P_DEPENDENCIES) + @rm -f ppoll-P$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ppoll_P_OBJECTS) $(ppoll_P_LDADD) $(LIBS) + +ppoll-v$(EXEEXT): $(ppoll_v_OBJECTS) $(ppoll_v_DEPENDENCIES) $(EXTRA_ppoll_v_DEPENDENCIES) + @rm -f ppoll-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ppoll_v_OBJECTS) $(ppoll_v_LDADD) $(LIBS) + prctl-arg2-intptr$(EXEEXT): $(prctl_arg2_intptr_OBJECTS) $(prctl_arg2_intptr_DEPENDENCIES) $(EXTRA_prctl_arg2_intptr_DEPENDENCIES) @rm -f prctl-arg2-intptr$(EXEEXT) $(AM_V_CCLD)$(LINK) $(prctl_arg2_intptr_OBJECTS) $(prctl_arg2_intptr_LDADD) $(LIBS) @@ -3828,6 +6725,10 @@ prctl-securebits$(EXEEXT): $(prctl_securebits_OBJECTS) $(prctl_securebits_DEPEND @rm -f prctl-securebits$(EXEEXT) $(AM_V_CCLD)$(LINK) $(prctl_securebits_OBJECTS) $(prctl_securebits_LDADD) $(LIBS) +prctl-spec-inject$(EXEEXT): $(prctl_spec_inject_OBJECTS) $(prctl_spec_inject_DEPENDENCIES) $(EXTRA_prctl_spec_inject_DEPENDENCIES) + @rm -f prctl-spec-inject$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_spec_inject_OBJECTS) $(prctl_spec_inject_LDADD) $(LIBS) + prctl-tid_address$(EXEEXT): $(prctl_tid_address_OBJECTS) $(prctl_tid_address_DEPENDENCIES) $(EXTRA_prctl_tid_address_DEPENDENCIES) @rm -f prctl-tid_address$(EXEEXT) $(AM_V_CCLD)$(LINK) $(prctl_tid_address_OBJECTS) $(prctl_tid_address_LDADD) $(LIBS) @@ -3856,10 +6757,46 @@ print_maxfd$(EXEEXT): $(print_maxfd_OBJECTS) $(print_maxfd_DEPENDENCIES) $(EXTRA @rm -f print_maxfd$(EXEEXT) $(AM_V_CCLD)$(LINK) $(print_maxfd_OBJECTS) $(print_maxfd_LDADD) $(LIBS) +printpath-umovestr$(EXEEXT): $(printpath_umovestr_OBJECTS) $(printpath_umovestr_DEPENDENCIES) $(EXTRA_printpath_umovestr_DEPENDENCIES) + @rm -f printpath-umovestr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printpath_umovestr_OBJECTS) $(printpath_umovestr_LDADD) $(LIBS) + +printpath-umovestr-peekdata$(EXEEXT): $(printpath_umovestr_peekdata_OBJECTS) $(printpath_umovestr_peekdata_DEPENDENCIES) $(EXTRA_printpath_umovestr_peekdata_DEPENDENCIES) + @rm -f printpath-umovestr-peekdata$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printpath_umovestr_peekdata_OBJECTS) $(printpath_umovestr_peekdata_LDADD) $(LIBS) + +printpath-umovestr-undumpable$(EXEEXT): $(printpath_umovestr_undumpable_OBJECTS) $(printpath_umovestr_undumpable_DEPENDENCIES) $(EXTRA_printpath_umovestr_undumpable_DEPENDENCIES) + @rm -f printpath-umovestr-undumpable$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printpath_umovestr_undumpable_OBJECTS) $(printpath_umovestr_undumpable_LDADD) $(LIBS) + +printsignal-Xabbrev$(EXEEXT): $(printsignal_Xabbrev_OBJECTS) $(printsignal_Xabbrev_DEPENDENCIES) $(EXTRA_printsignal_Xabbrev_DEPENDENCIES) + @rm -f printsignal-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printsignal_Xabbrev_OBJECTS) $(printsignal_Xabbrev_LDADD) $(LIBS) + +printsignal-Xraw$(EXEEXT): $(printsignal_Xraw_OBJECTS) $(printsignal_Xraw_DEPENDENCIES) $(EXTRA_printsignal_Xraw_DEPENDENCIES) + @rm -f printsignal-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printsignal_Xraw_OBJECTS) $(printsignal_Xraw_LDADD) $(LIBS) + +printsignal-Xverbose$(EXEEXT): $(printsignal_Xverbose_OBJECTS) $(printsignal_Xverbose_DEPENDENCIES) $(EXTRA_printsignal_Xverbose_DEPENDENCIES) + @rm -f printsignal-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printsignal_Xverbose_OBJECTS) $(printsignal_Xverbose_LDADD) $(LIBS) + printstr$(EXEEXT): $(printstr_OBJECTS) $(printstr_DEPENDENCIES) $(EXTRA_printstr_DEPENDENCIES) @rm -f printstr$(EXEEXT) $(AM_V_CCLD)$(LINK) $(printstr_OBJECTS) $(printstr_LDADD) $(LIBS) +printstrn-umoven$(EXEEXT): $(printstrn_umoven_OBJECTS) $(printstrn_umoven_DEPENDENCIES) $(EXTRA_printstrn_umoven_DEPENDENCIES) + @rm -f printstrn-umoven$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printstrn_umoven_OBJECTS) $(printstrn_umoven_LDADD) $(LIBS) + +printstrn-umoven-peekdata$(EXEEXT): $(printstrn_umoven_peekdata_OBJECTS) $(printstrn_umoven_peekdata_DEPENDENCIES) $(EXTRA_printstrn_umoven_peekdata_DEPENDENCIES) + @rm -f printstrn-umoven-peekdata$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printstrn_umoven_peekdata_OBJECTS) $(printstrn_umoven_peekdata_LDADD) $(LIBS) + +printstrn-umoven-undumpable$(EXEEXT): $(printstrn_umoven_undumpable_OBJECTS) $(printstrn_umoven_undumpable_DEPENDENCIES) $(EXTRA_printstrn_umoven_undumpable_DEPENDENCIES) + @rm -f printstrn-umoven-undumpable$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printstrn_umoven_undumpable_OBJECTS) $(printstrn_umoven_undumpable_LDADD) $(LIBS) + prlimit64$(EXEEXT): $(prlimit64_OBJECTS) $(prlimit64_DEPENDENCIES) $(EXTRA_prlimit64_DEPENDENCIES) @rm -f prlimit64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(prlimit64_OBJECTS) $(prlimit64_LDADD) $(LIBS) @@ -3880,6 +6817,10 @@ ptrace$(EXEEXT): $(ptrace_OBJECTS) $(ptrace_DEPENDENCIES) $(EXTRA_ptrace_DEPENDE @rm -f ptrace$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ptrace_OBJECTS) $(ptrace_LDADD) $(LIBS) +ptrace_syscall_info$(EXEEXT): $(ptrace_syscall_info_OBJECTS) $(ptrace_syscall_info_DEPENDENCIES) $(EXTRA_ptrace_syscall_info_DEPENDENCIES) + @rm -f ptrace_syscall_info$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ptrace_syscall_info_OBJECTS) $(ptrace_syscall_info_LDADD) $(LIBS) + pwritev$(EXEEXT): $(pwritev_OBJECTS) $(pwritev_DEPENDENCIES) $(EXTRA_pwritev_DEPENDENCIES) @rm -f pwritev$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pwritev_OBJECTS) $(pwritev_LDADD) $(LIBS) @@ -3908,6 +6849,26 @@ quotactl$(EXEEXT): $(quotactl_OBJECTS) $(quotactl_DEPENDENCIES) $(EXTRA_quotactl @rm -f quotactl$(EXEEXT) $(AM_V_CCLD)$(LINK) $(quotactl_OBJECTS) $(quotactl_LDADD) $(LIBS) +quotactl-Xabbrev$(EXEEXT): $(quotactl_Xabbrev_OBJECTS) $(quotactl_Xabbrev_DEPENDENCIES) $(EXTRA_quotactl_Xabbrev_DEPENDENCIES) + @rm -f quotactl-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_Xabbrev_OBJECTS) $(quotactl_Xabbrev_LDADD) $(LIBS) + +quotactl-Xraw$(EXEEXT): $(quotactl_Xraw_OBJECTS) $(quotactl_Xraw_DEPENDENCIES) $(EXTRA_quotactl_Xraw_DEPENDENCIES) + @rm -f quotactl-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_Xraw_OBJECTS) $(quotactl_Xraw_LDADD) $(LIBS) + +quotactl-Xverbose$(EXEEXT): $(quotactl_Xverbose_OBJECTS) $(quotactl_Xverbose_DEPENDENCIES) $(EXTRA_quotactl_Xverbose_DEPENDENCIES) + @rm -f quotactl-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_Xverbose_OBJECTS) $(quotactl_Xverbose_LDADD) $(LIBS) + +quotactl-success$(EXEEXT): $(quotactl_success_OBJECTS) $(quotactl_success_DEPENDENCIES) $(EXTRA_quotactl_success_DEPENDENCIES) + @rm -f quotactl-success$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_success_OBJECTS) $(quotactl_success_LDADD) $(LIBS) + +quotactl-success-v$(EXEEXT): $(quotactl_success_v_OBJECTS) $(quotactl_success_v_DEPENDENCIES) $(EXTRA_quotactl_success_v_DEPENDENCIES) + @rm -f quotactl-success-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_success_v_OBJECTS) $(quotactl_success_v_LDADD) $(LIBS) + quotactl-v$(EXEEXT): $(quotactl_v_OBJECTS) $(quotactl_v_DEPENDENCIES) $(EXTRA_quotactl_v_DEPENDENCIES) @rm -f quotactl-v$(EXEEXT) $(AM_V_CCLD)$(LINK) $(quotactl_v_OBJECTS) $(quotactl_v_LDADD) $(LIBS) @@ -3916,6 +6877,14 @@ quotactl-xfs$(EXEEXT): $(quotactl_xfs_OBJECTS) $(quotactl_xfs_DEPENDENCIES) $(EX @rm -f quotactl-xfs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(quotactl_xfs_OBJECTS) $(quotactl_xfs_LDADD) $(LIBS) +quotactl-xfs-success$(EXEEXT): $(quotactl_xfs_success_OBJECTS) $(quotactl_xfs_success_DEPENDENCIES) $(EXTRA_quotactl_xfs_success_DEPENDENCIES) + @rm -f quotactl-xfs-success$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_xfs_success_OBJECTS) $(quotactl_xfs_success_LDADD) $(LIBS) + +quotactl-xfs-success-v$(EXEEXT): $(quotactl_xfs_success_v_OBJECTS) $(quotactl_xfs_success_v_DEPENDENCIES) $(EXTRA_quotactl_xfs_success_v_DEPENDENCIES) + @rm -f quotactl-xfs-success-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_xfs_success_v_OBJECTS) $(quotactl_xfs_success_v_LDADD) $(LIBS) + quotactl-xfs-v$(EXEEXT): $(quotactl_xfs_v_OBJECTS) $(quotactl_xfs_v_DEPENDENCIES) $(EXTRA_quotactl_xfs_v_DEPENDENCIES) @rm -f quotactl-xfs-v$(EXEEXT) $(AM_V_CCLD)$(LINK) $(quotactl_xfs_v_OBJECTS) $(quotactl_xfs_v_LDADD) $(LIBS) @@ -3968,6 +6937,18 @@ remap_file_pages$(EXEEXT): $(remap_file_pages_OBJECTS) $(remap_file_pages_DEPEND @rm -f remap_file_pages$(EXEEXT) $(AM_V_CCLD)$(LINK) $(remap_file_pages_OBJECTS) $(remap_file_pages_LDADD) $(LIBS) +remap_file_pages-Xabbrev$(EXEEXT): $(remap_file_pages_Xabbrev_OBJECTS) $(remap_file_pages_Xabbrev_DEPENDENCIES) $(EXTRA_remap_file_pages_Xabbrev_DEPENDENCIES) + @rm -f remap_file_pages-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(remap_file_pages_Xabbrev_OBJECTS) $(remap_file_pages_Xabbrev_LDADD) $(LIBS) + +remap_file_pages-Xraw$(EXEEXT): $(remap_file_pages_Xraw_OBJECTS) $(remap_file_pages_Xraw_DEPENDENCIES) $(EXTRA_remap_file_pages_Xraw_DEPENDENCIES) + @rm -f remap_file_pages-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(remap_file_pages_Xraw_OBJECTS) $(remap_file_pages_Xraw_LDADD) $(LIBS) + +remap_file_pages-Xverbose$(EXEEXT): $(remap_file_pages_Xverbose_OBJECTS) $(remap_file_pages_Xverbose_DEPENDENCIES) $(EXTRA_remap_file_pages_Xverbose_DEPENDENCIES) + @rm -f remap_file_pages-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(remap_file_pages_Xverbose_OBJECTS) $(remap_file_pages_Xverbose_LDADD) $(LIBS) + rename$(EXEEXT): $(rename_OBJECTS) $(rename_DEPENDENCIES) $(EXTRA_rename_DEPENDENCIES) @rm -f rename$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rename_OBJECTS) $(rename_LDADD) $(LIBS) @@ -3988,10 +6969,18 @@ restart_syscall$(EXEEXT): $(restart_syscall_OBJECTS) $(restart_syscall_DEPENDENC @rm -f restart_syscall$(EXEEXT) $(AM_V_CCLD)$(LINK) $(restart_syscall_OBJECTS) $(restart_syscall_LDADD) $(LIBS) +riscv_flush_icache$(EXEEXT): $(riscv_flush_icache_OBJECTS) $(riscv_flush_icache_DEPENDENCIES) $(EXTRA_riscv_flush_icache_DEPENDENCIES) + @rm -f riscv_flush_icache$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(riscv_flush_icache_OBJECTS) $(riscv_flush_icache_LDADD) $(LIBS) + rmdir$(EXEEXT): $(rmdir_OBJECTS) $(rmdir_DEPENDENCIES) $(EXTRA_rmdir_DEPENDENCIES) @rm -f rmdir$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rmdir_OBJECTS) $(rmdir_LDADD) $(LIBS) +rt_sigaction$(EXEEXT): $(rt_sigaction_OBJECTS) $(rt_sigaction_DEPENDENCIES) $(EXTRA_rt_sigaction_DEPENDENCIES) + @rm -f rt_sigaction$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_sigaction_OBJECTS) $(rt_sigaction_LDADD) $(LIBS) + rt_sigpending$(EXEEXT): $(rt_sigpending_OBJECTS) $(rt_sigpending_DEPENDENCIES) $(EXTRA_rt_sigpending_DEPENDENCIES) @rm -f rt_sigpending$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rt_sigpending_OBJECTS) $(rt_sigpending_LDADD) $(LIBS) @@ -4004,6 +6993,10 @@ rt_sigqueueinfo$(EXEEXT): $(rt_sigqueueinfo_OBJECTS) $(rt_sigqueueinfo_DEPENDENC @rm -f rt_sigqueueinfo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rt_sigqueueinfo_OBJECTS) $(rt_sigqueueinfo_LDADD) $(LIBS) +rt_sigreturn$(EXEEXT): $(rt_sigreturn_OBJECTS) $(rt_sigreturn_DEPENDENCIES) $(EXTRA_rt_sigreturn_DEPENDENCIES) + @rm -f rt_sigreturn$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_sigreturn_OBJECTS) $(rt_sigreturn_LDADD) $(LIBS) + rt_sigsuspend$(EXEEXT): $(rt_sigsuspend_OBJECTS) $(rt_sigsuspend_DEPENDENCIES) $(EXTRA_rt_sigsuspend_DEPENDENCIES) @rm -f rt_sigsuspend$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rt_sigsuspend_OBJECTS) $(rt_sigsuspend_LDADD) $(LIBS) @@ -4016,6 +7009,34 @@ rt_tgsigqueueinfo$(EXEEXT): $(rt_tgsigqueueinfo_OBJECTS) $(rt_tgsigqueueinfo_DEP @rm -f rt_tgsigqueueinfo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rt_tgsigqueueinfo_OBJECTS) $(rt_tgsigqueueinfo_LDADD) $(LIBS) +run_expect_termsig$(EXEEXT): $(run_expect_termsig_OBJECTS) $(run_expect_termsig_DEPENDENCIES) $(EXTRA_run_expect_termsig_DEPENDENCIES) + @rm -f run_expect_termsig$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(run_expect_termsig_OBJECTS) $(run_expect_termsig_LDADD) $(LIBS) + +s390_guarded_storage$(EXEEXT): $(s390_guarded_storage_OBJECTS) $(s390_guarded_storage_DEPENDENCIES) $(EXTRA_s390_guarded_storage_DEPENDENCIES) + @rm -f s390_guarded_storage$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(s390_guarded_storage_OBJECTS) $(s390_guarded_storage_LDADD) $(LIBS) + +s390_guarded_storage-v$(EXEEXT): $(s390_guarded_storage_v_OBJECTS) $(s390_guarded_storage_v_DEPENDENCIES) $(EXTRA_s390_guarded_storage_v_DEPENDENCIES) + @rm -f s390_guarded_storage-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(s390_guarded_storage_v_OBJECTS) $(s390_guarded_storage_v_LDADD) $(LIBS) + +s390_pci_mmio_read_write$(EXEEXT): $(s390_pci_mmio_read_write_OBJECTS) $(s390_pci_mmio_read_write_DEPENDENCIES) $(EXTRA_s390_pci_mmio_read_write_DEPENDENCIES) + @rm -f s390_pci_mmio_read_write$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(s390_pci_mmio_read_write_OBJECTS) $(s390_pci_mmio_read_write_LDADD) $(LIBS) + +s390_runtime_instr$(EXEEXT): $(s390_runtime_instr_OBJECTS) $(s390_runtime_instr_DEPENDENCIES) $(EXTRA_s390_runtime_instr_DEPENDENCIES) + @rm -f s390_runtime_instr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(s390_runtime_instr_OBJECTS) $(s390_runtime_instr_LDADD) $(LIBS) + +s390_sthyi$(EXEEXT): $(s390_sthyi_OBJECTS) $(s390_sthyi_DEPENDENCIES) $(EXTRA_s390_sthyi_DEPENDENCIES) + @rm -f s390_sthyi$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(s390_sthyi_OBJECTS) $(s390_sthyi_LDADD) $(LIBS) + +s390_sthyi-v$(EXEEXT): $(s390_sthyi_v_OBJECTS) $(s390_sthyi_v_DEPENDENCIES) $(EXTRA_s390_sthyi_v_DEPENDENCIES) + @rm -f s390_sthyi-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(s390_sthyi_v_OBJECTS) $(s390_sthyi_v_LDADD) $(LIBS) + sched_get_priority_mxx$(EXEEXT): $(sched_get_priority_mxx_OBJECTS) $(sched_get_priority_mxx_DEPENDENCIES) $(EXTRA_sched_get_priority_mxx_DEPENDENCIES) @rm -f sched_get_priority_mxx$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sched_get_priority_mxx_OBJECTS) $(sched_get_priority_mxx_LDADD) $(LIBS) @@ -4060,10 +7081,18 @@ seccomp-strict$(EXEEXT): $(seccomp_strict_OBJECTS) $(seccomp_strict_DEPENDENCIES @rm -f seccomp-strict$(EXEEXT) $(AM_V_CCLD)$(LINK) $(seccomp_strict_OBJECTS) $(seccomp_strict_LDADD) $(LIBS) +seccomp_get_action_avail$(EXEEXT): $(seccomp_get_action_avail_OBJECTS) $(seccomp_get_action_avail_DEPENDENCIES) $(EXTRA_seccomp_get_action_avail_DEPENDENCIES) + @rm -f seccomp_get_action_avail$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(seccomp_get_action_avail_OBJECTS) $(seccomp_get_action_avail_LDADD) $(LIBS) + select$(EXEEXT): $(select_OBJECTS) $(select_DEPENDENCIES) $(EXTRA_select_DEPENDENCIES) @rm -f select$(EXEEXT) $(AM_V_CCLD)$(LINK) $(select_OBJECTS) $(select_LDADD) $(LIBS) +select-P$(EXEEXT): $(select_P_OBJECTS) $(select_P_DEPENDENCIES) $(EXTRA_select_P_DEPENDENCIES) + @rm -f select-P$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(select_P_OBJECTS) $(select_P_LDADD) $(LIBS) + semop$(EXEEXT): $(semop_OBJECTS) $(semop_DEPENDENCIES) $(EXTRA_semop_DEPENDENCIES) @rm -f semop$(EXEEXT) $(AM_V_CCLD)$(LINK) $(semop_OBJECTS) $(semop_LDADD) $(LIBS) @@ -4084,6 +7113,14 @@ set_ptracer_any$(EXEEXT): $(set_ptracer_any_OBJECTS) $(set_ptracer_any_DEPENDENC @rm -f set_ptracer_any$(EXEEXT) $(AM_V_CCLD)$(LINK) $(set_ptracer_any_OBJECTS) $(set_ptracer_any_LDADD) $(LIBS) +set_sigblock$(EXEEXT): $(set_sigblock_OBJECTS) $(set_sigblock_DEPENDENCIES) $(EXTRA_set_sigblock_DEPENDENCIES) + @rm -f set_sigblock$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(set_sigblock_OBJECTS) $(set_sigblock_LDADD) $(LIBS) + +set_sigign$(EXEEXT): $(set_sigign_OBJECTS) $(set_sigign_DEPENDENCIES) $(EXTRA_set_sigign_DEPENDENCIES) + @rm -f set_sigign$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(set_sigign_OBJECTS) $(set_sigign_LDADD) $(LIBS) + setdomainname$(EXEEXT): $(setdomainname_OBJECTS) $(setdomainname_DEPENDENCIES) $(EXTRA_setdomainname_DEPENDENCIES) @rm -f setdomainname$(EXEEXT) $(AM_V_CCLD)$(LINK) $(setdomainname_OBJECTS) $(setdomainname_LDADD) $(LIBS) @@ -4164,6 +7201,18 @@ setrlimit$(EXEEXT): $(setrlimit_OBJECTS) $(setrlimit_DEPENDENCIES) $(EXTRA_setrl @rm -f setrlimit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(setrlimit_OBJECTS) $(setrlimit_LDADD) $(LIBS) +setrlimit-Xabbrev$(EXEEXT): $(setrlimit_Xabbrev_OBJECTS) $(setrlimit_Xabbrev_DEPENDENCIES) $(EXTRA_setrlimit_Xabbrev_DEPENDENCIES) + @rm -f setrlimit-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setrlimit_Xabbrev_OBJECTS) $(setrlimit_Xabbrev_LDADD) $(LIBS) + +setrlimit-Xraw$(EXEEXT): $(setrlimit_Xraw_OBJECTS) $(setrlimit_Xraw_DEPENDENCIES) $(EXTRA_setrlimit_Xraw_DEPENDENCIES) + @rm -f setrlimit-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setrlimit_Xraw_OBJECTS) $(setrlimit_Xraw_LDADD) $(LIBS) + +setrlimit-Xverbose$(EXEEXT): $(setrlimit_Xverbose_OBJECTS) $(setrlimit_Xverbose_DEPENDENCIES) $(EXTRA_setrlimit_Xverbose_DEPENDENCIES) + @rm -f setrlimit-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setrlimit_Xverbose_OBJECTS) $(setrlimit_Xverbose_LDADD) $(LIBS) + setuid$(EXEEXT): $(setuid_OBJECTS) $(setuid_DEPENDENCIES) $(EXTRA_setuid_DEPENDENCIES) @rm -f setuid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(setuid_OBJECTS) $(setuid_LDADD) $(LIBS) @@ -4192,6 +7241,10 @@ siginfo$(EXEEXT): $(siginfo_OBJECTS) $(siginfo_DEPENDENCIES) $(EXTRA_siginfo_DEP @rm -f siginfo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(siginfo_OBJECTS) $(siginfo_LDADD) $(LIBS) +signal$(EXEEXT): $(signal_OBJECTS) $(signal_DEPENDENCIES) $(EXTRA_signal_DEPENDENCIES) + @rm -f signal$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(signal_OBJECTS) $(signal_LDADD) $(LIBS) + signal_receive$(EXEEXT): $(signal_receive_OBJECTS) $(signal_receive_DEPENDENCIES) $(EXTRA_signal_receive_DEPENDENCIES) @rm -f signal_receive$(EXEEXT) $(AM_V_CCLD)$(LINK) $(signal_receive_OBJECTS) $(signal_receive_LDADD) $(LIBS) @@ -4200,18 +7253,90 @@ signalfd4$(EXEEXT): $(signalfd4_OBJECTS) $(signalfd4_DEPENDENCIES) $(EXTRA_signa @rm -f signalfd4$(EXEEXT) $(AM_V_CCLD)$(LINK) $(signalfd4_OBJECTS) $(signalfd4_LDADD) $(LIBS) +sigpending$(EXEEXT): $(sigpending_OBJECTS) $(sigpending_DEPENDENCIES) $(EXTRA_sigpending_DEPENDENCIES) + @rm -f sigpending$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sigpending_OBJECTS) $(sigpending_LDADD) $(LIBS) + +sigprocmask$(EXEEXT): $(sigprocmask_OBJECTS) $(sigprocmask_DEPENDENCIES) $(EXTRA_sigprocmask_DEPENDENCIES) + @rm -f sigprocmask$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sigprocmask_OBJECTS) $(sigprocmask_LDADD) $(LIBS) + sigreturn$(EXEEXT): $(sigreturn_OBJECTS) $(sigreturn_DEPENDENCIES) $(EXTRA_sigreturn_DEPENDENCIES) @rm -f sigreturn$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sigreturn_OBJECTS) $(sigreturn_LDADD) $(LIBS) +sigsuspend$(EXEEXT): $(sigsuspend_OBJECTS) $(sigsuspend_DEPENDENCIES) $(EXTRA_sigsuspend_DEPENDENCIES) + @rm -f sigsuspend$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sigsuspend_OBJECTS) $(sigsuspend_LDADD) $(LIBS) + sleep$(EXEEXT): $(sleep_OBJECTS) $(sleep_DEPENDENCIES) $(EXTRA_sleep_DEPENDENCIES) @rm -f sleep$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sleep_OBJECTS) $(sleep_LDADD) $(LIBS) +so_error$(EXEEXT): $(so_error_OBJECTS) $(so_error_DEPENDENCIES) $(EXTRA_so_error_DEPENDENCIES) + @rm -f so_error$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(so_error_OBJECTS) $(so_error_LDADD) $(LIBS) + +so_linger$(EXEEXT): $(so_linger_OBJECTS) $(so_linger_DEPENDENCIES) $(EXTRA_so_linger_DEPENDENCIES) + @rm -f so_linger$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(so_linger_OBJECTS) $(so_linger_LDADD) $(LIBS) + +so_peercred$(EXEEXT): $(so_peercred_OBJECTS) $(so_peercred_DEPENDENCIES) $(EXTRA_so_peercred_DEPENDENCIES) + @rm -f so_peercred$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(so_peercred_OBJECTS) $(so_peercred_LDADD) $(LIBS) + +so_peercred-Xabbrev$(EXEEXT): $(so_peercred_Xabbrev_OBJECTS) $(so_peercred_Xabbrev_DEPENDENCIES) $(EXTRA_so_peercred_Xabbrev_DEPENDENCIES) + @rm -f so_peercred-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(so_peercred_Xabbrev_OBJECTS) $(so_peercred_Xabbrev_LDADD) $(LIBS) + +so_peercred-Xraw$(EXEEXT): $(so_peercred_Xraw_OBJECTS) $(so_peercred_Xraw_DEPENDENCIES) $(EXTRA_so_peercred_Xraw_DEPENDENCIES) + @rm -f so_peercred-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(so_peercred_Xraw_OBJECTS) $(so_peercred_Xraw_LDADD) $(LIBS) + +so_peercred-Xverbose$(EXEEXT): $(so_peercred_Xverbose_OBJECTS) $(so_peercred_Xverbose_DEPENDENCIES) $(EXTRA_so_peercred_Xverbose_DEPENDENCIES) + @rm -f so_peercred-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(so_peercred_Xverbose_OBJECTS) $(so_peercred_Xverbose_LDADD) $(LIBS) + +sock_filter-v$(EXEEXT): $(sock_filter_v_OBJECTS) $(sock_filter_v_DEPENDENCIES) $(EXTRA_sock_filter_v_DEPENDENCIES) + @rm -f sock_filter-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sock_filter_v_OBJECTS) $(sock_filter_v_LDADD) $(LIBS) + +sock_filter-v-Xabbrev$(EXEEXT): $(sock_filter_v_Xabbrev_OBJECTS) $(sock_filter_v_Xabbrev_DEPENDENCIES) $(EXTRA_sock_filter_v_Xabbrev_DEPENDENCIES) + @rm -f sock_filter-v-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sock_filter_v_Xabbrev_OBJECTS) $(sock_filter_v_Xabbrev_LDADD) $(LIBS) + +sock_filter-v-Xraw$(EXEEXT): $(sock_filter_v_Xraw_OBJECTS) $(sock_filter_v_Xraw_DEPENDENCIES) $(EXTRA_sock_filter_v_Xraw_DEPENDENCIES) + @rm -f sock_filter-v-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sock_filter_v_Xraw_OBJECTS) $(sock_filter_v_Xraw_LDADD) $(LIBS) + +sock_filter-v-Xverbose$(EXEEXT): $(sock_filter_v_Xverbose_OBJECTS) $(sock_filter_v_Xverbose_DEPENDENCIES) $(EXTRA_sock_filter_v_Xverbose_DEPENDENCIES) + @rm -f sock_filter-v-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sock_filter_v_Xverbose_OBJECTS) $(sock_filter_v_Xverbose_LDADD) $(LIBS) + +sockaddr_xlat-Xabbrev$(EXEEXT): $(sockaddr_xlat_Xabbrev_OBJECTS) $(sockaddr_xlat_Xabbrev_DEPENDENCIES) $(EXTRA_sockaddr_xlat_Xabbrev_DEPENDENCIES) + @rm -f sockaddr_xlat-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sockaddr_xlat_Xabbrev_OBJECTS) $(sockaddr_xlat_Xabbrev_LDADD) $(LIBS) + +sockaddr_xlat-Xraw$(EXEEXT): $(sockaddr_xlat_Xraw_OBJECTS) $(sockaddr_xlat_Xraw_DEPENDENCIES) $(EXTRA_sockaddr_xlat_Xraw_DEPENDENCIES) + @rm -f sockaddr_xlat-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sockaddr_xlat_Xraw_OBJECTS) $(sockaddr_xlat_Xraw_LDADD) $(LIBS) + +sockaddr_xlat-Xverbose$(EXEEXT): $(sockaddr_xlat_Xverbose_OBJECTS) $(sockaddr_xlat_Xverbose_DEPENDENCIES) $(EXTRA_sockaddr_xlat_Xverbose_DEPENDENCIES) + @rm -f sockaddr_xlat-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sockaddr_xlat_Xverbose_OBJECTS) $(sockaddr_xlat_Xverbose_LDADD) $(LIBS) + socketcall$(EXEEXT): $(socketcall_OBJECTS) $(socketcall_DEPENDENCIES) $(EXTRA_socketcall_DEPENDENCIES) @rm -f socketcall$(EXEEXT) $(AM_V_CCLD)$(LINK) $(socketcall_OBJECTS) $(socketcall_LDADD) $(LIBS) +sockopt-sol_netlink$(EXEEXT): $(sockopt_sol_netlink_OBJECTS) $(sockopt_sol_netlink_DEPENDENCIES) $(EXTRA_sockopt_sol_netlink_DEPENDENCIES) + @rm -f sockopt-sol_netlink$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sockopt_sol_netlink_OBJECTS) $(sockopt_sol_netlink_LDADD) $(LIBS) + +sockopt-timestamp$(EXEEXT): $(sockopt_timestamp_OBJECTS) $(sockopt_timestamp_DEPENDENCIES) $(EXTRA_sockopt_timestamp_DEPENDENCIES) + @rm -f sockopt-timestamp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sockopt_timestamp_OBJECTS) $(sockopt_timestamp_LDADD) $(LIBS) + splice$(EXEEXT): $(splice_OBJECTS) $(splice_DEPENDENCIES) $(EXTRA_splice_DEPENDENCIES) @rm -f splice$(EXEEXT) $(AM_V_CCLD)$(LINK) $(splice_OBJECTS) $(splice_LDADD) $(LIBS) @@ -4220,6 +7345,10 @@ stack-fcall$(EXEEXT): $(stack_fcall_OBJECTS) $(stack_fcall_DEPENDENCIES) $(EXTRA @rm -f stack-fcall$(EXEEXT) $(AM_V_CCLD)$(LINK) $(stack_fcall_OBJECTS) $(stack_fcall_LDADD) $(LIBS) +stack-fcall-mangled$(EXEEXT): $(stack_fcall_mangled_OBJECTS) $(stack_fcall_mangled_DEPENDENCIES) $(EXTRA_stack_fcall_mangled_DEPENDENCIES) + @rm -f stack-fcall-mangled$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(stack_fcall_mangled_OBJECTS) $(stack_fcall_mangled_LDADD) $(LIBS) + stat$(EXEEXT): $(stat_OBJECTS) $(stat_DEPENDENCIES) $(EXTRA_stat_DEPENDENCIES) @rm -f stat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(stat_OBJECTS) $(stat_LDADD) $(LIBS) @@ -4236,10 +7365,18 @@ statfs64$(EXEEXT): $(statfs64_OBJECTS) $(statfs64_DEPENDENCIES) $(EXTRA_statfs64 @rm -f statfs64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(statfs64_OBJECTS) $(statfs64_LDADD) $(LIBS) +statx$(EXEEXT): $(statx_OBJECTS) $(statx_DEPENDENCIES) $(EXTRA_statx_DEPENDENCIES) + @rm -f statx$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(statx_OBJECTS) $(statx_LDADD) $(LIBS) + swap$(EXEEXT): $(swap_OBJECTS) $(swap_DEPENDENCIES) $(EXTRA_swap_DEPENDENCIES) @rm -f swap$(EXEEXT) $(AM_V_CCLD)$(LINK) $(swap_OBJECTS) $(swap_LDADD) $(LIBS) +sxetmask$(EXEEXT): $(sxetmask_OBJECTS) $(sxetmask_DEPENDENCIES) $(EXTRA_sxetmask_DEPENDENCIES) + @rm -f sxetmask$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sxetmask_OBJECTS) $(sxetmask_LDADD) $(LIBS) + symlink$(EXEEXT): $(symlink_OBJECTS) $(symlink_DEPENDENCIES) $(EXTRA_symlink_DEPENDENCIES) @rm -f symlink$(EXEEXT) $(AM_V_CCLD)$(LINK) $(symlink_OBJECTS) $(symlink_LDADD) $(LIBS) @@ -4352,6 +7489,10 @@ uname$(EXEEXT): $(uname_OBJECTS) $(uname_DEPENDENCIES) $(EXTRA_uname_DEPENDENCIE @rm -f uname$(EXEEXT) $(AM_V_CCLD)$(LINK) $(uname_OBJECTS) $(uname_LDADD) $(LIBS) +unblock_reset_raise$(EXEEXT): $(unblock_reset_raise_OBJECTS) $(unblock_reset_raise_DEPENDENCIES) $(EXTRA_unblock_reset_raise_DEPENDENCIES) + @rm -f unblock_reset_raise$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unblock_reset_raise_OBJECTS) $(unblock_reset_raise_LDADD) $(LIBS) + unix-pair-send-recv$(EXEEXT): $(unix_pair_send_recv_OBJECTS) $(unix_pair_send_recv_DEPENDENCIES) $(EXTRA_unix_pair_send_recv_DEPENDENCIES) @rm -f unix-pair-send-recv$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unix_pair_send_recv_OBJECTS) $(unix_pair_send_recv_LDADD) $(LIBS) @@ -4388,6 +7529,18 @@ utimensat$(EXEEXT): $(utimensat_OBJECTS) $(utimensat_DEPENDENCIES) $(EXTRA_utime @rm -f utimensat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(utimensat_OBJECTS) $(utimensat_LDADD) $(LIBS) +utimensat-Xabbrev$(EXEEXT): $(utimensat_Xabbrev_OBJECTS) $(utimensat_Xabbrev_DEPENDENCIES) $(EXTRA_utimensat_Xabbrev_DEPENDENCIES) + @rm -f utimensat-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(utimensat_Xabbrev_OBJECTS) $(utimensat_Xabbrev_LDADD) $(LIBS) + +utimensat-Xraw$(EXEEXT): $(utimensat_Xraw_OBJECTS) $(utimensat_Xraw_DEPENDENCIES) $(EXTRA_utimensat_Xraw_DEPENDENCIES) + @rm -f utimensat-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(utimensat_Xraw_OBJECTS) $(utimensat_Xraw_LDADD) $(LIBS) + +utimensat-Xverbose$(EXEEXT): $(utimensat_Xverbose_OBJECTS) $(utimensat_Xverbose_DEPENDENCIES) $(EXTRA_utimensat_Xverbose_DEPENDENCIES) + @rm -f utimensat-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(utimensat_Xverbose_OBJECTS) $(utimensat_Xverbose_LDADD) $(LIBS) + utimes$(EXEEXT): $(utimes_OBJECTS) $(utimes_DEPENDENCIES) $(EXTRA_utimes_DEPENDENCIES) @rm -f utimes$(EXEEXT) $(AM_V_CCLD)$(LINK) $(utimes_OBJECTS) $(utimes_LDADD) $(LIBS) @@ -4436,6 +7589,10 @@ xet_robust_list$(EXEEXT): $(xet_robust_list_OBJECTS) $(xet_robust_list_DEPENDENC @rm -f xet_robust_list$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xet_robust_list_OBJECTS) $(xet_robust_list_LDADD) $(LIBS) +xet_thread_area_x86$(EXEEXT): $(xet_thread_area_x86_OBJECTS) $(xet_thread_area_x86_DEPENDENCIES) $(EXTRA_xet_thread_area_x86_DEPENDENCIES) + @rm -f xet_thread_area_x86$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xet_thread_area_x86_OBJECTS) $(xet_thread_area_x86_LDADD) $(LIBS) + xetitimer$(EXEEXT): $(xetitimer_OBJECTS) $(xetitimer_DEPENDENCIES) $(EXTRA_xetitimer_DEPENDENCIES) @rm -f xetitimer$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xetitimer_OBJECTS) $(xetitimer_LDADD) $(LIBS) @@ -4452,408 +7609,668 @@ xettimeofday$(EXEEXT): $(xettimeofday_OBJECTS) $(xettimeofday_DEPENDENCIES) $(EX @rm -f xettimeofday$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xettimeofday_OBJECTS) $(xettimeofday_LDADD) $(LIBS) +zeroargc$(EXEEXT): $(zeroargc_OBJECTS) $(zeroargc_DEPENDENCIES) $(EXTRA_zeroargc_DEPENDENCIES) + @rm -f zeroargc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(zeroargc_OBJECTS) $(zeroargc_LDADD) $(LIBS) + mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_newselect.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept4.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/access.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acct.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_key.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adjtimex.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aio.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alarm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/answer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-f-p-cmd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-f-p.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-p-cmd-cmd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-p-cmd-p.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/brk.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/btrfs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caps-abbrev.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caps.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chmod.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chown.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chown32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chroot.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_adjtime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_nanosleep.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_xettime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/copy_file_range.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/count-f.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/delete_module.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup3.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_create.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_create1.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_ctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_pwait.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_wait.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/erestartsys.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eventfd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execve-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execve.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execveat-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execveat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/faccessat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fadvise64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fadvise64_64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fallocate.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_init.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchdir.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmod.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmodat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchown.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchown32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchownat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdatasync.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_handle.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_ioctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter-unavailable.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit_module.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fork-f.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat64-fstat64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatat64-fstatat64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatfs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatfs64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsync.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftruncate.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftruncate64-ftruncate64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/futex.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/futimesat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_mempolicy.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcpu.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcwd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdents.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdents64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getegid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getegid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geteuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geteuid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgroups.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgroups32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpeername.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpgrp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrandom.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresgid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresgid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresuid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrlimit.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrusage.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getsid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getsockname.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getuid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getxxid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet-cmsg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init_module.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inotify.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inotify_init1.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_block.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_dm-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_dm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop-nv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_mtd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_rtc-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_rtc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_scsi.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sg_io_v3.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sg_io_v4.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sock_gifconf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_uffdio.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_v4l2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioperm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iopl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioprio.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ip_mreq.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msgbuf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_sem.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_shm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kcmp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kexec_file_load.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kexec_load.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kill.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ksysent.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-errno2name.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-error_msg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-fill_memory.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-get_page_size.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-hexdump_strdup.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-hexquote_strndup.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-inode_of_sockfd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-libmmsg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-libsocketcall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-overflowuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-pipe_maxfd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-print_quoted_string.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-printflags.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-printxval.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-signal2name.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-sprintrc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-tail_alloc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-tprintf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/link.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linkat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/llseek.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lookup_dcookie.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lseek.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat64-lstat64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbind.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/membarrier.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memfd_create.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/migrate_pages.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mincore.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdir.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdirat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mknod.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mknodat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlock2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlockall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap64-mmap64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg-silent.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg_name-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg_name.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_pages.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv-read.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv-write.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_control-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_control.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_name.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/munlockall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nanosleep.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-accept-connect.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-icmp_filter.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-sockaddr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-y-unix.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-inet.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-netlink.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-unix.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_inet_diag.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_netlink_diag.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_protocol.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_unix_diag.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/newfstatat-newfstatat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nsyscalls.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldfstat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldlstat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldselect.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldstat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pause.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open_nonverbose.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open_unabbrev.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/personality.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_alloc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_free.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_mprotect.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poll.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppoll.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-arg2-intptr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-dumpable.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-name.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-no-args.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-pdeathsig.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-seccomp-filter-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-seccomp-strict.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-securebits.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-tid_address.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-tsc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv-preadv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv2-pwritev2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv_pwritev-preadv-pwritev.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print_maxfd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printstr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prlimit64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process_vm_readv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process_vm_writev.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pselect6.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptrace.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pwritev-pwritev.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_fault.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-error-signal.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-retval.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-signal.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_signal.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read-write.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readahead.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readdir.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlinkat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reboot.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvfrom.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvmmsg-timeout.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvmsg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/redirect-fds.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remap_file_pages.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rename.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renameat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renameat2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/request_key.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/restart_syscall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rmdir.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigpending.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigprocmask.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigqueueinfo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigsuspend.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigtimedwait.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_tgsigqueueinfo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_get_priority_mxx.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_rr_get_interval.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetaffinity.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetattr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetparam.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetscheduler.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_yield.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scm_rights.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-filter-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-filter.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-strict.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/semop.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendfile.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendfile64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_mempolicy.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_ptracer_any.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setdomainname.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsgid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsgid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsuid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgroups.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgroups32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sethostname.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setns.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setregid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setregid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresgid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresgid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresuid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setreuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setreuid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setrlimit.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setuid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shmxt.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shutdown.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaction.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaltstack.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siginfo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal_receive.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signalfd4.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigreturn.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sleep.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socketcall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/splice.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-0.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-1.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-3.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat64-stat64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statfs-statfs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statfs64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlink.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlinkat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync_file_range.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync_file_range2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysinfo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syslog.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tee.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threads-execve.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer_create.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer_xettime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timerfd_xettime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/times-fail.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/times.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/truncate.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/truncate64-truncate64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ugetrlimit.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uio-uio.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umask.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umount.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umount2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umoven-illptr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr-illptr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr3.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uname.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix-pair-send-recv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix-pair-sendto-recvfrom.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlink.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlinkat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unshare.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/userfaultfd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ustat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimensat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimes.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfork-f.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vhangup.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmsplice.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait4-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait4.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitid-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitpid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xattr-strings.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xattr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xet_robust_list.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetitimer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetpgid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetpriority.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xettimeofday.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_newselect-P.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_newselect.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept4.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/access.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acct.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_key.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adjtimex.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aio_pgetevents.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alarm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/answer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-f-p-cmd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-f-p.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-p-cmd-cmd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-p-cmd-p.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/block_reset_raise_run.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf-obj_get_info_by_fd-prog-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf-obj_get_info_by_fd-prog.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf-obj_get_info_by_fd-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf-obj_get_info_by_fd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf-success-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf-success.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/brk.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/btrfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caps-abbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caps.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_sigblock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_sigign.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chmod.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chown.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chown32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chroot.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_adjtime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_nanosleep.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_xettime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clone_parent.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clone_ptrace.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/copy_file_range.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/count-f.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/delay.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/delete_module.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dev-yy.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup3.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_create.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_create1.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_ctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_pwait.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_wait.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/erestartsys.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eventfd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execve-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execve.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execveat-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execveat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/faccessat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fadvise64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fadvise64_64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fallocate.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_init.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchdir.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmod.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmodat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchown.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchown32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchownat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdatasync.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fflush.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_handle.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_ioctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter-unavailable.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit_module.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fork-f.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat64-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat64-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat64-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat64-fstat64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatat64-fstatat64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatfs64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsync-y.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsync.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftruncate.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftruncate64-ftruncate64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/futex.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/futimesat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_mempolicy.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcpu.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcwd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdents.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdents64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getegid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getegid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geteuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geteuid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgroups.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgroups32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpeername.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpgrp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getppid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrandom.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresgid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresgid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresuid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrlimit.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrusage.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getsid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getsockname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getuid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getxxid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/group_req.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet-cmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init_module.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inject-nf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inotify.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inotify_init1.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/int_0x80.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io_uring_enter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io_uring_register.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io_uring_setup.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_block.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_dm-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_dm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev-success-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev-success.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_inotify.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_kvm_run-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_kvm_run.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_kvm_run_auxstr_vcpu.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop-nv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_mtd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_nbd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_nsfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_perf-success.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_perf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_ptp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_random.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_rtc-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_rtc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_scsi.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sg_io_v3.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sg_io_v4.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sock_gifconf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_uffdio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_v4l2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioperm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iopl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioprio-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioprio-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioprio-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioprio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ip_mreq.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msg-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msg-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msg-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msgbuf-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msgbuf-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msgbuf-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msgbuf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_sem-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_sem-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_sem-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_sem.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_shm-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_shm-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_shm-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_shm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/is_linux_mips_n64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kcmp-y.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kcmp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kern_features.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kernel_version-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kernel_version-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kernel_version-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kernel_version.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kexec_file_load.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kexec_load.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyctl-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyctl-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyctl-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kill.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kill_child.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ksysent.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-create_nl_socket.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-errno2name.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-error_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-fill_memory.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-get_page_size.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-get_sigset_size.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-hexdump_strdup.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-hexquote_strndup.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-ifindex.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-inode_of_sockfd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-libmmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-libsocketcall.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-overflowuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-pipe_maxfd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-print_quoted_string.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-print_time.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-printflags.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-printxval.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-signal2name.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-skip_unavailable.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-sprintrc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-tail_alloc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-test_printpath.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-test_printstrn.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-test_ucopy.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-tprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/link.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linkat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list_sigaction_signum.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/llseek.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localtime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lookup_dcookie.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/looping_threads.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lseek.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat64-lstat64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madvise.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbind.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/membarrier.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memfd_create-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memfd_create-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memfd_create-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memfd_create.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/migrate_pages.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mincore.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdir.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdirat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mknod.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mknodat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlock2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlockall.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap64-mmap64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg-silent.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg_name-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg_name.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modify_ldt.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_pages-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_pages-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_pages-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_pages.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv-read.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv-write.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_control-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_control.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_name.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/munlockall.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nanosleep.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-accept-connect.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-icmp_filter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-packet_mreq-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-packet_mreq-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-packet_mreq-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-packet_mreq.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-sockaddr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-tpacket_req.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-tpacket_stats-success.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-tpacket_stats.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-y-unix.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-inet.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-inet6.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-netlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-unix.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_audit.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_crypto.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_generic.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_inet_diag.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_kobject_uevent.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_netfilter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_netlink_diag.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_protocol.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_route.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_selinux.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_sock_diag.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_unix_diag.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_xfrm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/newfstatat-newfstatat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_acct.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_cthelper.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_ctnetlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_ctnetlink_exp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_cttimeout.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_ipset.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_nft_compat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_nftables.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_osf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_queue.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_ulog.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_br_port_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_crypto_user_alg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_dcbmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_fib_rule_hdr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifaddrlblmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifaddrmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifinfomsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifla_af_spec.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifla_brport.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifla_linkinfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifla_port.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifla_xdp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_inet_diag_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_inet_diag_req_compat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_inet_diag_req_v2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_mdba_mdb_entry.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_mdba_router_port.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ndmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ndtmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_netconfmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_netlink_diag_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_nlmsgerr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_packet_diag_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_rtgenmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_rtmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_smc_diag_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_tc_stats.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_tca_stab.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_tcamsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_tcmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_unix_diag_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nsyscalls-d.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nsyscalls.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap-P.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap-v-none.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldfstat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldlstat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldselect-P.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldselect-efault-P.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldselect-efault.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldselect.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldstat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orphaned_process_group.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osf_utimes.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pause.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open_nonverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open_unabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/personality-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/personality-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/personality-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/personality.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pidfd_send_signal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_alloc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_free.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_mprotect.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poll-P.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poll.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppoll-P.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppoll-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppoll.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-arg2-intptr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-dumpable.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-name.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-no-args.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-pdeathsig.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-seccomp-filter-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-seccomp-strict.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-securebits.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-spec-inject.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-tid_address.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-tsc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv-preadv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv2-pwritev2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv_pwritev-preadv-pwritev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print_maxfd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printpath-umovestr-peekdata.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printpath-umovestr-undumpable.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printpath-umovestr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printsignal-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printsignal-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printsignal-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printstr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printstrn-umoven-peekdata.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printstrn-umoven-undumpable.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printstrn-umoven.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prlimit64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process_vm_readv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process_vm_writev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pselect6.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptrace.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptrace_syscall_info.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pwritev-pwritev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_fault.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-error-signal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-retval.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-signal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_signal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-success-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-success.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs-success-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs-success.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read-write.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readahead.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readdir.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlinkat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reboot.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvfrom.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvmmsg-timeout.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/redirect-fds.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remap_file_pages-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remap_file_pages-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remap_file_pages-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remap_file_pages.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rename.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renameat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renameat2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/request_key.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/restart_syscall.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/riscv_flush_icache.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rmdir.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigaction.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigpending.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigprocmask.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigqueueinfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigreturn.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigsuspend.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigtimedwait.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_tgsigqueueinfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run_expect_termsig.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s390_guarded_storage-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s390_guarded_storage.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s390_pci_mmio_read_write.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s390_runtime_instr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s390_sthyi-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s390_sthyi.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_get_priority_mxx.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_rr_get_interval.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetaffinity.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetattr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetparam.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetscheduler.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_yield.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scm_rights.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-filter-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-filter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-strict.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp_get_action_avail.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select-P.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/semop.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendfile.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendfile64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_mempolicy.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_ptracer_any.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_sigblock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_sigign.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setdomainname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsgid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsgid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsuid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgroups.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgroups32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sethostname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setns.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setregid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setregid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresgid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresgid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresuid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setreuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setreuid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setrlimit-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setrlimit-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setrlimit-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setrlimit.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setuid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shmxt.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shutdown.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaction.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaltstack.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siginfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal_receive.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signalfd4.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigpending.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigprocmask.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigreturn.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigsuspend.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sleep.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/so_error.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/so_linger.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/so_peercred-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/so_peercred-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/so_peercred-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/so_peercred.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sock_filter-v-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sock_filter-v-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sock_filter-v-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sock_filter-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockaddr_xlat-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockaddr_xlat-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockaddr_xlat-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socketcall.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockopt-sol_netlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockopt-timestamp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/splice.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-0.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-1.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-3.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled-0.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled-1.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled-2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled-3.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat64-stat64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statfs-statfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statfs64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statx.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sxetmask.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlinkat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync_file_range.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync_file_range2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysinfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syslog.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tee.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threads-execve.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer_create.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer_xettime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timerfd_xettime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/times-fail.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/times.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/truncate.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/truncate64-truncate64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ugetrlimit.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uio-uio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umask.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umount.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umount2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umoven-illptr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr-illptr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr3.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unblock_reset_raise.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix-pair-send-recv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix-pair-sendto-recvfrom.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlinkat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unshare.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/userfaultfd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ustat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimensat-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimensat-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimensat-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimensat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimes.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfork-f.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vhangup.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmsplice.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait4-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait4.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitid-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitpid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xattr-strings.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xattr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xet_robust_list.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xet_thread_area_x86.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetitimer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetpgid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetpriority.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xettimeofday.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zeroargc.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -4869,6 +8286,20 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +libtests_a-create_nl_socket.o: create_nl_socket.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-create_nl_socket.o -MD -MP -MF $(DEPDIR)/libtests_a-create_nl_socket.Tpo -c -o libtests_a-create_nl_socket.o `test -f 'create_nl_socket.c' || echo '$(srcdir)/'`create_nl_socket.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-create_nl_socket.Tpo $(DEPDIR)/libtests_a-create_nl_socket.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='create_nl_socket.c' object='libtests_a-create_nl_socket.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-create_nl_socket.o `test -f 'create_nl_socket.c' || echo '$(srcdir)/'`create_nl_socket.c + +libtests_a-create_nl_socket.obj: create_nl_socket.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-create_nl_socket.obj -MD -MP -MF $(DEPDIR)/libtests_a-create_nl_socket.Tpo -c -o libtests_a-create_nl_socket.obj `if test -f 'create_nl_socket.c'; then $(CYGPATH_W) 'create_nl_socket.c'; else $(CYGPATH_W) '$(srcdir)/create_nl_socket.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-create_nl_socket.Tpo $(DEPDIR)/libtests_a-create_nl_socket.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='create_nl_socket.c' object='libtests_a-create_nl_socket.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-create_nl_socket.obj `if test -f 'create_nl_socket.c'; then $(CYGPATH_W) 'create_nl_socket.c'; else $(CYGPATH_W) '$(srcdir)/create_nl_socket.c'; fi` + libtests_a-errno2name.o: errno2name.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-errno2name.o -MD -MP -MF $(DEPDIR)/libtests_a-errno2name.Tpo -c -o libtests_a-errno2name.o `test -f 'errno2name.c' || echo '$(srcdir)/'`errno2name.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-errno2name.Tpo $(DEPDIR)/libtests_a-errno2name.Po @@ -4925,6 +8356,20 @@ libtests_a-get_page_size.obj: get_page_size.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-get_page_size.obj `if test -f 'get_page_size.c'; then $(CYGPATH_W) 'get_page_size.c'; else $(CYGPATH_W) '$(srcdir)/get_page_size.c'; fi` +libtests_a-get_sigset_size.o: get_sigset_size.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-get_sigset_size.o -MD -MP -MF $(DEPDIR)/libtests_a-get_sigset_size.Tpo -c -o libtests_a-get_sigset_size.o `test -f 'get_sigset_size.c' || echo '$(srcdir)/'`get_sigset_size.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-get_sigset_size.Tpo $(DEPDIR)/libtests_a-get_sigset_size.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='get_sigset_size.c' object='libtests_a-get_sigset_size.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-get_sigset_size.o `test -f 'get_sigset_size.c' || echo '$(srcdir)/'`get_sigset_size.c + +libtests_a-get_sigset_size.obj: get_sigset_size.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-get_sigset_size.obj -MD -MP -MF $(DEPDIR)/libtests_a-get_sigset_size.Tpo -c -o libtests_a-get_sigset_size.obj `if test -f 'get_sigset_size.c'; then $(CYGPATH_W) 'get_sigset_size.c'; else $(CYGPATH_W) '$(srcdir)/get_sigset_size.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-get_sigset_size.Tpo $(DEPDIR)/libtests_a-get_sigset_size.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='get_sigset_size.c' object='libtests_a-get_sigset_size.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-get_sigset_size.obj `if test -f 'get_sigset_size.c'; then $(CYGPATH_W) 'get_sigset_size.c'; else $(CYGPATH_W) '$(srcdir)/get_sigset_size.c'; fi` + libtests_a-hexdump_strdup.o: hexdump_strdup.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-hexdump_strdup.o -MD -MP -MF $(DEPDIR)/libtests_a-hexdump_strdup.Tpo -c -o libtests_a-hexdump_strdup.o `test -f 'hexdump_strdup.c' || echo '$(srcdir)/'`hexdump_strdup.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-hexdump_strdup.Tpo $(DEPDIR)/libtests_a-hexdump_strdup.Po @@ -4953,6 +8398,20 @@ libtests_a-hexquote_strndup.obj: hexquote_strndup.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-hexquote_strndup.obj `if test -f 'hexquote_strndup.c'; then $(CYGPATH_W) 'hexquote_strndup.c'; else $(CYGPATH_W) '$(srcdir)/hexquote_strndup.c'; fi` +libtests_a-ifindex.o: ifindex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-ifindex.o -MD -MP -MF $(DEPDIR)/libtests_a-ifindex.Tpo -c -o libtests_a-ifindex.o `test -f 'ifindex.c' || echo '$(srcdir)/'`ifindex.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-ifindex.Tpo $(DEPDIR)/libtests_a-ifindex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ifindex.c' object='libtests_a-ifindex.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-ifindex.o `test -f 'ifindex.c' || echo '$(srcdir)/'`ifindex.c + +libtests_a-ifindex.obj: ifindex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-ifindex.obj -MD -MP -MF $(DEPDIR)/libtests_a-ifindex.Tpo -c -o libtests_a-ifindex.obj `if test -f 'ifindex.c'; then $(CYGPATH_W) 'ifindex.c'; else $(CYGPATH_W) '$(srcdir)/ifindex.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-ifindex.Tpo $(DEPDIR)/libtests_a-ifindex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ifindex.c' object='libtests_a-ifindex.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-ifindex.obj `if test -f 'ifindex.c'; then $(CYGPATH_W) 'ifindex.c'; else $(CYGPATH_W) '$(srcdir)/ifindex.c'; fi` + libtests_a-inode_of_sockfd.o: inode_of_sockfd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-inode_of_sockfd.o -MD -MP -MF $(DEPDIR)/libtests_a-inode_of_sockfd.Tpo -c -o libtests_a-inode_of_sockfd.o `test -f 'inode_of_sockfd.c' || echo '$(srcdir)/'`inode_of_sockfd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-inode_of_sockfd.Tpo $(DEPDIR)/libtests_a-inode_of_sockfd.Po @@ -5037,6 +8496,20 @@ libtests_a-print_quoted_string.obj: print_quoted_string.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-print_quoted_string.obj `if test -f 'print_quoted_string.c'; then $(CYGPATH_W) 'print_quoted_string.c'; else $(CYGPATH_W) '$(srcdir)/print_quoted_string.c'; fi` +libtests_a-print_time.o: print_time.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-print_time.o -MD -MP -MF $(DEPDIR)/libtests_a-print_time.Tpo -c -o libtests_a-print_time.o `test -f 'print_time.c' || echo '$(srcdir)/'`print_time.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-print_time.Tpo $(DEPDIR)/libtests_a-print_time.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_time.c' object='libtests_a-print_time.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-print_time.o `test -f 'print_time.c' || echo '$(srcdir)/'`print_time.c + +libtests_a-print_time.obj: print_time.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-print_time.obj -MD -MP -MF $(DEPDIR)/libtests_a-print_time.Tpo -c -o libtests_a-print_time.obj `if test -f 'print_time.c'; then $(CYGPATH_W) 'print_time.c'; else $(CYGPATH_W) '$(srcdir)/print_time.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-print_time.Tpo $(DEPDIR)/libtests_a-print_time.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_time.c' object='libtests_a-print_time.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-print_time.obj `if test -f 'print_time.c'; then $(CYGPATH_W) 'print_time.c'; else $(CYGPATH_W) '$(srcdir)/print_time.c'; fi` + libtests_a-printflags.o: printflags.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-printflags.o -MD -MP -MF $(DEPDIR)/libtests_a-printflags.Tpo -c -o libtests_a-printflags.o `test -f 'printflags.c' || echo '$(srcdir)/'`printflags.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-printflags.Tpo $(DEPDIR)/libtests_a-printflags.Po @@ -5079,6 +8552,20 @@ libtests_a-signal2name.obj: signal2name.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-signal2name.obj `if test -f 'signal2name.c'; then $(CYGPATH_W) 'signal2name.c'; else $(CYGPATH_W) '$(srcdir)/signal2name.c'; fi` +libtests_a-skip_unavailable.o: skip_unavailable.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-skip_unavailable.o -MD -MP -MF $(DEPDIR)/libtests_a-skip_unavailable.Tpo -c -o libtests_a-skip_unavailable.o `test -f 'skip_unavailable.c' || echo '$(srcdir)/'`skip_unavailable.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-skip_unavailable.Tpo $(DEPDIR)/libtests_a-skip_unavailable.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='skip_unavailable.c' object='libtests_a-skip_unavailable.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-skip_unavailable.o `test -f 'skip_unavailable.c' || echo '$(srcdir)/'`skip_unavailable.c + +libtests_a-skip_unavailable.obj: skip_unavailable.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-skip_unavailable.obj -MD -MP -MF $(DEPDIR)/libtests_a-skip_unavailable.Tpo -c -o libtests_a-skip_unavailable.obj `if test -f 'skip_unavailable.c'; then $(CYGPATH_W) 'skip_unavailable.c'; else $(CYGPATH_W) '$(srcdir)/skip_unavailable.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-skip_unavailable.Tpo $(DEPDIR)/libtests_a-skip_unavailable.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='skip_unavailable.c' object='libtests_a-skip_unavailable.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-skip_unavailable.obj `if test -f 'skip_unavailable.c'; then $(CYGPATH_W) 'skip_unavailable.c'; else $(CYGPATH_W) '$(srcdir)/skip_unavailable.c'; fi` + libtests_a-sprintrc.o: sprintrc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-sprintrc.o -MD -MP -MF $(DEPDIR)/libtests_a-sprintrc.Tpo -c -o libtests_a-sprintrc.o `test -f 'sprintrc.c' || echo '$(srcdir)/'`sprintrc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-sprintrc.Tpo $(DEPDIR)/libtests_a-sprintrc.Po @@ -5107,6 +8594,48 @@ libtests_a-tail_alloc.obj: tail_alloc.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-tail_alloc.obj `if test -f 'tail_alloc.c'; then $(CYGPATH_W) 'tail_alloc.c'; else $(CYGPATH_W) '$(srcdir)/tail_alloc.c'; fi` +libtests_a-test_printpath.o: test_printpath.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-test_printpath.o -MD -MP -MF $(DEPDIR)/libtests_a-test_printpath.Tpo -c -o libtests_a-test_printpath.o `test -f 'test_printpath.c' || echo '$(srcdir)/'`test_printpath.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-test_printpath.Tpo $(DEPDIR)/libtests_a-test_printpath.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_printpath.c' object='libtests_a-test_printpath.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-test_printpath.o `test -f 'test_printpath.c' || echo '$(srcdir)/'`test_printpath.c + +libtests_a-test_printpath.obj: test_printpath.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-test_printpath.obj -MD -MP -MF $(DEPDIR)/libtests_a-test_printpath.Tpo -c -o libtests_a-test_printpath.obj `if test -f 'test_printpath.c'; then $(CYGPATH_W) 'test_printpath.c'; else $(CYGPATH_W) '$(srcdir)/test_printpath.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-test_printpath.Tpo $(DEPDIR)/libtests_a-test_printpath.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_printpath.c' object='libtests_a-test_printpath.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-test_printpath.obj `if test -f 'test_printpath.c'; then $(CYGPATH_W) 'test_printpath.c'; else $(CYGPATH_W) '$(srcdir)/test_printpath.c'; fi` + +libtests_a-test_printstrn.o: test_printstrn.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-test_printstrn.o -MD -MP -MF $(DEPDIR)/libtests_a-test_printstrn.Tpo -c -o libtests_a-test_printstrn.o `test -f 'test_printstrn.c' || echo '$(srcdir)/'`test_printstrn.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-test_printstrn.Tpo $(DEPDIR)/libtests_a-test_printstrn.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_printstrn.c' object='libtests_a-test_printstrn.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-test_printstrn.o `test -f 'test_printstrn.c' || echo '$(srcdir)/'`test_printstrn.c + +libtests_a-test_printstrn.obj: test_printstrn.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-test_printstrn.obj -MD -MP -MF $(DEPDIR)/libtests_a-test_printstrn.Tpo -c -o libtests_a-test_printstrn.obj `if test -f 'test_printstrn.c'; then $(CYGPATH_W) 'test_printstrn.c'; else $(CYGPATH_W) '$(srcdir)/test_printstrn.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-test_printstrn.Tpo $(DEPDIR)/libtests_a-test_printstrn.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_printstrn.c' object='libtests_a-test_printstrn.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-test_printstrn.obj `if test -f 'test_printstrn.c'; then $(CYGPATH_W) 'test_printstrn.c'; else $(CYGPATH_W) '$(srcdir)/test_printstrn.c'; fi` + +libtests_a-test_ucopy.o: test_ucopy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-test_ucopy.o -MD -MP -MF $(DEPDIR)/libtests_a-test_ucopy.Tpo -c -o libtests_a-test_ucopy.o `test -f 'test_ucopy.c' || echo '$(srcdir)/'`test_ucopy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-test_ucopy.Tpo $(DEPDIR)/libtests_a-test_ucopy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_ucopy.c' object='libtests_a-test_ucopy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-test_ucopy.o `test -f 'test_ucopy.c' || echo '$(srcdir)/'`test_ucopy.c + +libtests_a-test_ucopy.obj: test_ucopy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-test_ucopy.obj -MD -MP -MF $(DEPDIR)/libtests_a-test_ucopy.Tpo -c -o libtests_a-test_ucopy.obj `if test -f 'test_ucopy.c'; then $(CYGPATH_W) 'test_ucopy.c'; else $(CYGPATH_W) '$(srcdir)/test_ucopy.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-test_ucopy.Tpo $(DEPDIR)/libtests_a-test_ucopy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_ucopy.c' object='libtests_a-test_ucopy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-test_ucopy.obj `if test -f 'test_ucopy.c'; then $(CYGPATH_W) 'test_ucopy.c'; else $(CYGPATH_W) '$(srcdir)/test_ucopy.c'; fi` + libtests_a-tprintf.o: tprintf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-tprintf.o -MD -MP -MF $(DEPDIR)/libtests_a-tprintf.Tpo -c -o libtests_a-tprintf.o `test -f 'tprintf.c' || echo '$(srcdir)/'`tprintf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-tprintf.Tpo $(DEPDIR)/libtests_a-tprintf.Po @@ -5191,6 +8720,48 @@ mmap64-mmap64.obj: mmap64.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64-mmap64.obj `if test -f 'mmap64.c'; then $(CYGPATH_W) 'mmap64.c'; else $(CYGPATH_W) '$(srcdir)/mmap64.c'; fi` +mmap64_Xabbrev-mmap64-Xabbrev.o: mmap64-Xabbrev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xabbrev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64_Xabbrev-mmap64-Xabbrev.o -MD -MP -MF $(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Tpo -c -o mmap64_Xabbrev-mmap64-Xabbrev.o `test -f 'mmap64-Xabbrev.c' || echo '$(srcdir)/'`mmap64-Xabbrev.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Tpo $(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64-Xabbrev.c' object='mmap64_Xabbrev-mmap64-Xabbrev.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xabbrev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64_Xabbrev-mmap64-Xabbrev.o `test -f 'mmap64-Xabbrev.c' || echo '$(srcdir)/'`mmap64-Xabbrev.c + +mmap64_Xabbrev-mmap64-Xabbrev.obj: mmap64-Xabbrev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xabbrev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64_Xabbrev-mmap64-Xabbrev.obj -MD -MP -MF $(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Tpo -c -o mmap64_Xabbrev-mmap64-Xabbrev.obj `if test -f 'mmap64-Xabbrev.c'; then $(CYGPATH_W) 'mmap64-Xabbrev.c'; else $(CYGPATH_W) '$(srcdir)/mmap64-Xabbrev.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Tpo $(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64-Xabbrev.c' object='mmap64_Xabbrev-mmap64-Xabbrev.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xabbrev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64_Xabbrev-mmap64-Xabbrev.obj `if test -f 'mmap64-Xabbrev.c'; then $(CYGPATH_W) 'mmap64-Xabbrev.c'; else $(CYGPATH_W) '$(srcdir)/mmap64-Xabbrev.c'; fi` + +mmap64_Xraw-mmap64-Xraw.o: mmap64-Xraw.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xraw_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64_Xraw-mmap64-Xraw.o -MD -MP -MF $(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Tpo -c -o mmap64_Xraw-mmap64-Xraw.o `test -f 'mmap64-Xraw.c' || echo '$(srcdir)/'`mmap64-Xraw.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Tpo $(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64-Xraw.c' object='mmap64_Xraw-mmap64-Xraw.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xraw_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64_Xraw-mmap64-Xraw.o `test -f 'mmap64-Xraw.c' || echo '$(srcdir)/'`mmap64-Xraw.c + +mmap64_Xraw-mmap64-Xraw.obj: mmap64-Xraw.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xraw_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64_Xraw-mmap64-Xraw.obj -MD -MP -MF $(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Tpo -c -o mmap64_Xraw-mmap64-Xraw.obj `if test -f 'mmap64-Xraw.c'; then $(CYGPATH_W) 'mmap64-Xraw.c'; else $(CYGPATH_W) '$(srcdir)/mmap64-Xraw.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Tpo $(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64-Xraw.c' object='mmap64_Xraw-mmap64-Xraw.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xraw_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64_Xraw-mmap64-Xraw.obj `if test -f 'mmap64-Xraw.c'; then $(CYGPATH_W) 'mmap64-Xraw.c'; else $(CYGPATH_W) '$(srcdir)/mmap64-Xraw.c'; fi` + +mmap64_Xverbose-mmap64-Xverbose.o: mmap64-Xverbose.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xverbose_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64_Xverbose-mmap64-Xverbose.o -MD -MP -MF $(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Tpo -c -o mmap64_Xverbose-mmap64-Xverbose.o `test -f 'mmap64-Xverbose.c' || echo '$(srcdir)/'`mmap64-Xverbose.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Tpo $(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64-Xverbose.c' object='mmap64_Xverbose-mmap64-Xverbose.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xverbose_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64_Xverbose-mmap64-Xverbose.o `test -f 'mmap64-Xverbose.c' || echo '$(srcdir)/'`mmap64-Xverbose.c + +mmap64_Xverbose-mmap64-Xverbose.obj: mmap64-Xverbose.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xverbose_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64_Xverbose-mmap64-Xverbose.obj -MD -MP -MF $(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Tpo -c -o mmap64_Xverbose-mmap64-Xverbose.obj `if test -f 'mmap64-Xverbose.c'; then $(CYGPATH_W) 'mmap64-Xverbose.c'; else $(CYGPATH_W) '$(srcdir)/mmap64-Xverbose.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Tpo $(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64-Xverbose.c' object='mmap64_Xverbose-mmap64-Xverbose.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xverbose_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64_Xverbose-mmap64-Xverbose.obj `if test -f 'mmap64-Xverbose.c'; then $(CYGPATH_W) 'mmap64-Xverbose.c'; else $(CYGPATH_W) '$(srcdir)/mmap64-Xverbose.c'; fi` + newfstatat-newfstatat.o: newfstatat.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(newfstatat_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT newfstatat-newfstatat.o -MD -MP -MF $(DEPDIR)/newfstatat-newfstatat.Tpo -c -o newfstatat-newfstatat.o `test -f 'newfstatat.c' || echo '$(srcdir)/'`newfstatat.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/newfstatat-newfstatat.Tpo $(DEPDIR)/newfstatat-newfstatat.Po @@ -5317,6 +8888,10 @@ uio-uio.obj: uio.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o uio-uio.obj `if test -f 'uio.c'; then $(CYGPATH_W) 'uio.c'; else $(CYGPATH_W) '$(srcdir)/uio.c'; fi` check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -5400,7 +8975,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ - else \ + elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ @@ -5490,7 +9065,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) fi; \ $$success || exit 1 -check-TESTS: +check-TESTS: $(check_PROGRAMS) $(check_LIBRARIES) @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @@ -5500,7 +9075,7 @@ check-TESTS: log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; -recheck: all $(check_LIBRARIES) $(check_PROGRAMS) +recheck: all $(check_PROGRAMS) $(check_LIBRARIES) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ @@ -5526,7 +9101,10 @@ recheck: all $(check_LIBRARIES) $(check_PROGRAMS) @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -5557,12 +9135,14 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) $(check_LIBRARIES) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_LIBRARIES) $(MAKE) $(AM_MAKEFLAGS) check-TESTS -check: check-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile installdirs: -install: install-am +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -5596,17 +9176,679 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) check-valgrind: check-valgrind-am check-valgrind-am: check-valgrind-local +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + clean: clean-am clean-am: clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \ - mostlyclean-am + clean-local mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/_newselect-P.Po + -rm -f ./$(DEPDIR)/_newselect.Po + -rm -f ./$(DEPDIR)/accept.Po + -rm -f ./$(DEPDIR)/accept4.Po + -rm -f ./$(DEPDIR)/access.Po + -rm -f ./$(DEPDIR)/acct.Po + -rm -f ./$(DEPDIR)/add_key.Po + -rm -f ./$(DEPDIR)/adjtimex.Po + -rm -f ./$(DEPDIR)/aio.Po + -rm -f ./$(DEPDIR)/aio_pgetevents.Po + -rm -f ./$(DEPDIR)/alarm.Po + -rm -f ./$(DEPDIR)/answer.Po + -rm -f ./$(DEPDIR)/attach-f-p-cmd.Po + -rm -f ./$(DEPDIR)/attach-f-p.Po + -rm -f ./$(DEPDIR)/attach-p-cmd-cmd.Po + -rm -f ./$(DEPDIR)/attach-p-cmd-p.Po + -rm -f ./$(DEPDIR)/block_reset_raise_run.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd-prog-v.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd-prog.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd-v.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd.Po + -rm -f ./$(DEPDIR)/bpf-success-v.Po + -rm -f ./$(DEPDIR)/bpf-success.Po + -rm -f ./$(DEPDIR)/bpf-v.Po + -rm -f ./$(DEPDIR)/bpf.Po + -rm -f ./$(DEPDIR)/brk.Po + -rm -f ./$(DEPDIR)/btrfs.Po + -rm -f ./$(DEPDIR)/caps-abbrev.Po + -rm -f ./$(DEPDIR)/caps.Po + -rm -f ./$(DEPDIR)/check_sigblock.Po + -rm -f ./$(DEPDIR)/check_sigign.Po + -rm -f ./$(DEPDIR)/chmod.Po + -rm -f ./$(DEPDIR)/chown.Po + -rm -f ./$(DEPDIR)/chown32.Po + -rm -f ./$(DEPDIR)/chroot.Po + -rm -f ./$(DEPDIR)/clock_adjtime.Po + -rm -f ./$(DEPDIR)/clock_nanosleep.Po + -rm -f ./$(DEPDIR)/clock_xettime.Po + -rm -f ./$(DEPDIR)/clone_parent.Po + -rm -f ./$(DEPDIR)/clone_ptrace.Po + -rm -f ./$(DEPDIR)/copy_file_range.Po + -rm -f ./$(DEPDIR)/count-f.Po + -rm -f ./$(DEPDIR)/creat.Po + -rm -f ./$(DEPDIR)/delay.Po + -rm -f ./$(DEPDIR)/delete_module.Po + -rm -f ./$(DEPDIR)/dev-yy.Po + -rm -f ./$(DEPDIR)/dup.Po + -rm -f ./$(DEPDIR)/dup2.Po + -rm -f ./$(DEPDIR)/dup3.Po + -rm -f ./$(DEPDIR)/epoll_create.Po + -rm -f ./$(DEPDIR)/epoll_create1.Po + -rm -f ./$(DEPDIR)/epoll_ctl.Po + -rm -f ./$(DEPDIR)/epoll_pwait.Po + -rm -f ./$(DEPDIR)/epoll_wait.Po + -rm -f ./$(DEPDIR)/erestartsys.Po + -rm -f ./$(DEPDIR)/eventfd.Po + -rm -f ./$(DEPDIR)/execve-v.Po + -rm -f ./$(DEPDIR)/execve.Po + -rm -f ./$(DEPDIR)/execveat-v.Po + -rm -f ./$(DEPDIR)/execveat.Po + -rm -f ./$(DEPDIR)/faccessat.Po + -rm -f ./$(DEPDIR)/fadvise64.Po + -rm -f ./$(DEPDIR)/fadvise64_64.Po + -rm -f ./$(DEPDIR)/fallocate.Po + -rm -f ./$(DEPDIR)/fanotify_init.Po + -rm -f ./$(DEPDIR)/fanotify_mark-Xabbrev.Po + -rm -f ./$(DEPDIR)/fanotify_mark-Xraw.Po + -rm -f ./$(DEPDIR)/fanotify_mark-Xverbose.Po + -rm -f ./$(DEPDIR)/fanotify_mark.Po + -rm -f ./$(DEPDIR)/fchdir.Po + -rm -f ./$(DEPDIR)/fchmod.Po + -rm -f ./$(DEPDIR)/fchmodat.Po + -rm -f ./$(DEPDIR)/fchown.Po + -rm -f ./$(DEPDIR)/fchown32.Po + -rm -f ./$(DEPDIR)/fchownat.Po + -rm -f ./$(DEPDIR)/fcntl.Po + -rm -f ./$(DEPDIR)/fcntl64.Po + -rm -f ./$(DEPDIR)/fdatasync.Po + -rm -f ./$(DEPDIR)/fflush.Po + -rm -f ./$(DEPDIR)/file_handle.Po + -rm -f ./$(DEPDIR)/file_ioctl.Po + -rm -f ./$(DEPDIR)/filter-unavailable.Po + -rm -f ./$(DEPDIR)/finit_module.Po + -rm -f ./$(DEPDIR)/flock.Po + -rm -f ./$(DEPDIR)/fork-f.Po + -rm -f ./$(DEPDIR)/fstat-Xabbrev.Po + -rm -f ./$(DEPDIR)/fstat-Xraw.Po + -rm -f ./$(DEPDIR)/fstat-Xverbose.Po + -rm -f ./$(DEPDIR)/fstat.Po + -rm -f ./$(DEPDIR)/fstat64-Xabbrev.Po + -rm -f ./$(DEPDIR)/fstat64-Xraw.Po + -rm -f ./$(DEPDIR)/fstat64-Xverbose.Po + -rm -f ./$(DEPDIR)/fstat64-fstat64.Po + -rm -f ./$(DEPDIR)/fstatat64-fstatat64.Po + -rm -f ./$(DEPDIR)/fstatfs.Po + -rm -f ./$(DEPDIR)/fstatfs64.Po + -rm -f ./$(DEPDIR)/fsync-y.Po + -rm -f ./$(DEPDIR)/fsync.Po + -rm -f ./$(DEPDIR)/ftruncate.Po + -rm -f ./$(DEPDIR)/ftruncate64-ftruncate64.Po + -rm -f ./$(DEPDIR)/futex.Po + -rm -f ./$(DEPDIR)/futimesat.Po + -rm -f ./$(DEPDIR)/get_mempolicy.Po + -rm -f ./$(DEPDIR)/getcpu.Po + -rm -f ./$(DEPDIR)/getcwd.Po + -rm -f ./$(DEPDIR)/getdents.Po + -rm -f ./$(DEPDIR)/getdents64.Po + -rm -f ./$(DEPDIR)/getegid.Po + -rm -f ./$(DEPDIR)/getegid32.Po + -rm -f ./$(DEPDIR)/geteuid.Po + -rm -f ./$(DEPDIR)/geteuid32.Po + -rm -f ./$(DEPDIR)/getgid.Po + -rm -f ./$(DEPDIR)/getgid32.Po + -rm -f ./$(DEPDIR)/getgroups.Po + -rm -f ./$(DEPDIR)/getgroups32.Po + -rm -f ./$(DEPDIR)/getpeername.Po + -rm -f ./$(DEPDIR)/getpgrp.Po + -rm -f ./$(DEPDIR)/getpid.Po + -rm -f ./$(DEPDIR)/getppid.Po + -rm -f ./$(DEPDIR)/getrandom.Po + -rm -f ./$(DEPDIR)/getresgid.Po + -rm -f ./$(DEPDIR)/getresgid32.Po + -rm -f ./$(DEPDIR)/getresuid.Po + -rm -f ./$(DEPDIR)/getresuid32.Po + -rm -f ./$(DEPDIR)/getrlimit.Po + -rm -f ./$(DEPDIR)/getrusage.Po + -rm -f ./$(DEPDIR)/getsid.Po + -rm -f ./$(DEPDIR)/getsockname.Po + -rm -f ./$(DEPDIR)/gettid.Po + -rm -f ./$(DEPDIR)/getuid.Po + -rm -f ./$(DEPDIR)/getuid32.Po + -rm -f ./$(DEPDIR)/getxxid.Po + -rm -f ./$(DEPDIR)/group_req.Po + -rm -f ./$(DEPDIR)/inet-cmsg.Po + -rm -f ./$(DEPDIR)/init_module.Po + -rm -f ./$(DEPDIR)/inject-nf.Po + -rm -f ./$(DEPDIR)/inotify.Po + -rm -f ./$(DEPDIR)/inotify_init1.Po + -rm -f ./$(DEPDIR)/int_0x80.Po + -rm -f ./$(DEPDIR)/io_uring_enter.Po + -rm -f ./$(DEPDIR)/io_uring_register.Po + -rm -f ./$(DEPDIR)/io_uring_setup.Po + -rm -f ./$(DEPDIR)/ioctl.Po + -rm -f ./$(DEPDIR)/ioctl_block.Po + -rm -f ./$(DEPDIR)/ioctl_dm-v.Po + -rm -f ./$(DEPDIR)/ioctl_dm.Po + -rm -f ./$(DEPDIR)/ioctl_evdev-success-v.Po + -rm -f ./$(DEPDIR)/ioctl_evdev-success.Po + -rm -f ./$(DEPDIR)/ioctl_evdev-v.Po + -rm -f ./$(DEPDIR)/ioctl_evdev.Po + -rm -f ./$(DEPDIR)/ioctl_inotify.Po + -rm -f ./$(DEPDIR)/ioctl_kvm_run-v.Po + -rm -f ./$(DEPDIR)/ioctl_kvm_run.Po + -rm -f ./$(DEPDIR)/ioctl_kvm_run_auxstr_vcpu.Po + -rm -f ./$(DEPDIR)/ioctl_loop-nv.Po + -rm -f ./$(DEPDIR)/ioctl_loop-v.Po + -rm -f ./$(DEPDIR)/ioctl_loop.Po + -rm -f ./$(DEPDIR)/ioctl_mtd.Po + -rm -f ./$(DEPDIR)/ioctl_nbd.Po + -rm -f ./$(DEPDIR)/ioctl_nsfs.Po + -rm -f ./$(DEPDIR)/ioctl_perf-success.Po + -rm -f ./$(DEPDIR)/ioctl_perf.Po + -rm -f ./$(DEPDIR)/ioctl_ptp.Po + -rm -f ./$(DEPDIR)/ioctl_random.Po + -rm -f ./$(DEPDIR)/ioctl_rtc-v.Po + -rm -f ./$(DEPDIR)/ioctl_rtc.Po + -rm -f ./$(DEPDIR)/ioctl_scsi.Po + -rm -f ./$(DEPDIR)/ioctl_sg_io_v3.Po + -rm -f ./$(DEPDIR)/ioctl_sg_io_v4.Po + -rm -f ./$(DEPDIR)/ioctl_sock_gifconf.Po + -rm -f ./$(DEPDIR)/ioctl_uffdio.Po + -rm -f ./$(DEPDIR)/ioctl_v4l2.Po + -rm -f ./$(DEPDIR)/ioperm.Po + -rm -f ./$(DEPDIR)/iopl.Po + -rm -f ./$(DEPDIR)/ioprio-Xabbrev.Po + -rm -f ./$(DEPDIR)/ioprio-Xraw.Po + -rm -f ./$(DEPDIR)/ioprio-Xverbose.Po + -rm -f ./$(DEPDIR)/ioprio.Po + -rm -f ./$(DEPDIR)/ip_mreq.Po + -rm -f ./$(DEPDIR)/ipc.Po + -rm -f ./$(DEPDIR)/ipc_msg-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_msg-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_msg-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_msg.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf.Po + -rm -f ./$(DEPDIR)/ipc_sem-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_sem-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_sem-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_sem.Po + -rm -f ./$(DEPDIR)/ipc_shm-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_shm-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_shm-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_shm.Po + -rm -f ./$(DEPDIR)/is_linux_mips_n64.Po + -rm -f ./$(DEPDIR)/kcmp-y.Po + -rm -f ./$(DEPDIR)/kcmp.Po + -rm -f ./$(DEPDIR)/kern_features.Po + -rm -f ./$(DEPDIR)/kernel_version-Xabbrev.Po + -rm -f ./$(DEPDIR)/kernel_version-Xraw.Po + -rm -f ./$(DEPDIR)/kernel_version-Xverbose.Po + -rm -f ./$(DEPDIR)/kernel_version.Po + -rm -f ./$(DEPDIR)/kexec_file_load.Po + -rm -f ./$(DEPDIR)/kexec_load.Po + -rm -f ./$(DEPDIR)/keyctl-Xabbrev.Po + -rm -f ./$(DEPDIR)/keyctl-Xraw.Po + -rm -f ./$(DEPDIR)/keyctl-Xverbose.Po + -rm -f ./$(DEPDIR)/keyctl.Po + -rm -f ./$(DEPDIR)/kill.Po + -rm -f ./$(DEPDIR)/kill_child.Po + -rm -f ./$(DEPDIR)/ksysent.Po + -rm -f ./$(DEPDIR)/lchown.Po + -rm -f ./$(DEPDIR)/lchown32.Po + -rm -f ./$(DEPDIR)/libtests_a-create_nl_socket.Po + -rm -f ./$(DEPDIR)/libtests_a-errno2name.Po + -rm -f ./$(DEPDIR)/libtests_a-error_msg.Po + -rm -f ./$(DEPDIR)/libtests_a-fill_memory.Po + -rm -f ./$(DEPDIR)/libtests_a-get_page_size.Po + -rm -f ./$(DEPDIR)/libtests_a-get_sigset_size.Po + -rm -f ./$(DEPDIR)/libtests_a-hexdump_strdup.Po + -rm -f ./$(DEPDIR)/libtests_a-hexquote_strndup.Po + -rm -f ./$(DEPDIR)/libtests_a-ifindex.Po + -rm -f ./$(DEPDIR)/libtests_a-inode_of_sockfd.Po + -rm -f ./$(DEPDIR)/libtests_a-libmmsg.Po + -rm -f ./$(DEPDIR)/libtests_a-libsocketcall.Po + -rm -f ./$(DEPDIR)/libtests_a-overflowuid.Po + -rm -f ./$(DEPDIR)/libtests_a-pipe_maxfd.Po + -rm -f ./$(DEPDIR)/libtests_a-print_quoted_string.Po + -rm -f ./$(DEPDIR)/libtests_a-print_time.Po + -rm -f ./$(DEPDIR)/libtests_a-printflags.Po + -rm -f ./$(DEPDIR)/libtests_a-printxval.Po + -rm -f ./$(DEPDIR)/libtests_a-signal2name.Po + -rm -f ./$(DEPDIR)/libtests_a-skip_unavailable.Po + -rm -f ./$(DEPDIR)/libtests_a-sprintrc.Po + -rm -f ./$(DEPDIR)/libtests_a-tail_alloc.Po + -rm -f ./$(DEPDIR)/libtests_a-test_printpath.Po + -rm -f ./$(DEPDIR)/libtests_a-test_printstrn.Po + -rm -f ./$(DEPDIR)/libtests_a-test_ucopy.Po + -rm -f ./$(DEPDIR)/libtests_a-tprintf.Po + -rm -f ./$(DEPDIR)/link.Po + -rm -f ./$(DEPDIR)/linkat.Po + -rm -f ./$(DEPDIR)/list_sigaction_signum.Po + -rm -f ./$(DEPDIR)/llseek.Po + -rm -f ./$(DEPDIR)/localtime.Po + -rm -f ./$(DEPDIR)/lookup_dcookie.Po + -rm -f ./$(DEPDIR)/looping_threads.Po + -rm -f ./$(DEPDIR)/lseek.Po + -rm -f ./$(DEPDIR)/lstat.Po + -rm -f ./$(DEPDIR)/lstat64-lstat64.Po + -rm -f ./$(DEPDIR)/madvise.Po + -rm -f ./$(DEPDIR)/mbind.Po + -rm -f ./$(DEPDIR)/membarrier.Po + -rm -f ./$(DEPDIR)/memfd_create-Xabbrev.Po + -rm -f ./$(DEPDIR)/memfd_create-Xraw.Po + -rm -f ./$(DEPDIR)/memfd_create-Xverbose.Po + -rm -f ./$(DEPDIR)/memfd_create.Po + -rm -f ./$(DEPDIR)/migrate_pages.Po + -rm -f ./$(DEPDIR)/mincore.Po + -rm -f ./$(DEPDIR)/mkdir.Po + -rm -f ./$(DEPDIR)/mkdirat.Po + -rm -f ./$(DEPDIR)/mknod.Po + -rm -f ./$(DEPDIR)/mknodat.Po + -rm -f ./$(DEPDIR)/mlock.Po + -rm -f ./$(DEPDIR)/mlock2.Po + -rm -f ./$(DEPDIR)/mlockall.Po + -rm -f ./$(DEPDIR)/mmap-Xabbrev.Po + -rm -f ./$(DEPDIR)/mmap-Xraw.Po + -rm -f ./$(DEPDIR)/mmap-Xverbose.Po + -rm -f ./$(DEPDIR)/mmap.Po + -rm -f ./$(DEPDIR)/mmap64-mmap64.Po + -rm -f ./$(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Po + -rm -f ./$(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Po + -rm -f ./$(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Po + -rm -f ./$(DEPDIR)/mmsg-silent.Po + -rm -f ./$(DEPDIR)/mmsg.Po + -rm -f ./$(DEPDIR)/mmsg_name-v.Po + -rm -f ./$(DEPDIR)/mmsg_name.Po + -rm -f ./$(DEPDIR)/modify_ldt.Po + -rm -f ./$(DEPDIR)/mount-Xabbrev.Po + -rm -f ./$(DEPDIR)/mount-Xraw.Po + -rm -f ./$(DEPDIR)/mount-Xverbose.Po + -rm -f ./$(DEPDIR)/mount.Po + -rm -f ./$(DEPDIR)/move_pages-Xabbrev.Po + -rm -f ./$(DEPDIR)/move_pages-Xraw.Po + -rm -f ./$(DEPDIR)/move_pages-Xverbose.Po + -rm -f ./$(DEPDIR)/move_pages.Po + -rm -f ./$(DEPDIR)/mq.Po + -rm -f ./$(DEPDIR)/mq_sendrecv-read.Po + -rm -f ./$(DEPDIR)/mq_sendrecv-write.Po + -rm -f ./$(DEPDIR)/mq_sendrecv.Po + -rm -f ./$(DEPDIR)/msg_control-v.Po + -rm -f ./$(DEPDIR)/msg_control.Po + -rm -f ./$(DEPDIR)/msg_name.Po + -rm -f ./$(DEPDIR)/munlockall.Po + -rm -f ./$(DEPDIR)/nanosleep.Po + -rm -f ./$(DEPDIR)/net-accept-connect.Po + -rm -f ./$(DEPDIR)/net-icmp_filter.Po + -rm -f ./$(DEPDIR)/net-packet_mreq-Xabbrev.Po + -rm -f ./$(DEPDIR)/net-packet_mreq-Xraw.Po + -rm -f ./$(DEPDIR)/net-packet_mreq-Xverbose.Po + -rm -f ./$(DEPDIR)/net-packet_mreq.Po + -rm -f ./$(DEPDIR)/net-sockaddr.Po + -rm -f ./$(DEPDIR)/net-tpacket_req.Po + -rm -f ./$(DEPDIR)/net-tpacket_stats-success.Po + -rm -f ./$(DEPDIR)/net-tpacket_stats.Po + -rm -f ./$(DEPDIR)/net-y-unix.Po + -rm -f ./$(DEPDIR)/net-yy-inet.Po + -rm -f ./$(DEPDIR)/net-yy-inet6.Po + -rm -f ./$(DEPDIR)/net-yy-netlink.Po + -rm -f ./$(DEPDIR)/net-yy-unix.Po + -rm -f ./$(DEPDIR)/netlink_audit.Po + -rm -f ./$(DEPDIR)/netlink_crypto.Po + -rm -f ./$(DEPDIR)/netlink_generic.Po + -rm -f ./$(DEPDIR)/netlink_inet_diag.Po + -rm -f ./$(DEPDIR)/netlink_kobject_uevent.Po + -rm -f ./$(DEPDIR)/netlink_netfilter.Po + -rm -f ./$(DEPDIR)/netlink_netlink_diag.Po + -rm -f ./$(DEPDIR)/netlink_protocol.Po + -rm -f ./$(DEPDIR)/netlink_route.Po + -rm -f ./$(DEPDIR)/netlink_selinux.Po + -rm -f ./$(DEPDIR)/netlink_sock_diag.Po + -rm -f ./$(DEPDIR)/netlink_unix_diag.Po + -rm -f ./$(DEPDIR)/netlink_xfrm.Po + -rm -f ./$(DEPDIR)/newfstatat-newfstatat.Po + -rm -f ./$(DEPDIR)/nfnetlink_acct.Po + -rm -f ./$(DEPDIR)/nfnetlink_cthelper.Po + -rm -f ./$(DEPDIR)/nfnetlink_ctnetlink.Po + -rm -f ./$(DEPDIR)/nfnetlink_ctnetlink_exp.Po + -rm -f ./$(DEPDIR)/nfnetlink_cttimeout.Po + -rm -f ./$(DEPDIR)/nfnetlink_ipset.Po + -rm -f ./$(DEPDIR)/nfnetlink_nft_compat.Po + -rm -f ./$(DEPDIR)/nfnetlink_nftables.Po + -rm -f ./$(DEPDIR)/nfnetlink_osf.Po + -rm -f ./$(DEPDIR)/nfnetlink_queue.Po + -rm -f ./$(DEPDIR)/nfnetlink_ulog.Po + -rm -f ./$(DEPDIR)/nlattr.Po + -rm -f ./$(DEPDIR)/nlattr_br_port_msg.Po + -rm -f ./$(DEPDIR)/nlattr_crypto_user_alg.Po + -rm -f ./$(DEPDIR)/nlattr_dcbmsg.Po + -rm -f ./$(DEPDIR)/nlattr_fib_rule_hdr.Po + -rm -f ./$(DEPDIR)/nlattr_ifaddrlblmsg.Po + -rm -f ./$(DEPDIR)/nlattr_ifaddrmsg.Po + -rm -f ./$(DEPDIR)/nlattr_ifinfomsg.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_af_spec.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_brport.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_linkinfo.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_port.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_xdp.Po + -rm -f ./$(DEPDIR)/nlattr_inet_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_inet_diag_req_compat.Po + -rm -f ./$(DEPDIR)/nlattr_inet_diag_req_v2.Po + -rm -f ./$(DEPDIR)/nlattr_mdba_mdb_entry.Po + -rm -f ./$(DEPDIR)/nlattr_mdba_router_port.Po + -rm -f ./$(DEPDIR)/nlattr_ndmsg.Po + -rm -f ./$(DEPDIR)/nlattr_ndtmsg.Po + -rm -f ./$(DEPDIR)/nlattr_netconfmsg.Po + -rm -f ./$(DEPDIR)/nlattr_netlink_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_nlmsgerr.Po + -rm -f ./$(DEPDIR)/nlattr_packet_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_rtgenmsg.Po + -rm -f ./$(DEPDIR)/nlattr_rtmsg.Po + -rm -f ./$(DEPDIR)/nlattr_smc_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_tc_stats.Po + -rm -f ./$(DEPDIR)/nlattr_tca_stab.Po + -rm -f ./$(DEPDIR)/nlattr_tcamsg.Po + -rm -f ./$(DEPDIR)/nlattr_tcmsg.Po + -rm -f ./$(DEPDIR)/nlattr_unix_diag_msg.Po + -rm -f ./$(DEPDIR)/nsyscalls-d.Po + -rm -f ./$(DEPDIR)/nsyscalls.Po + -rm -f ./$(DEPDIR)/old_mmap-P.Po + -rm -f ./$(DEPDIR)/old_mmap-Xabbrev.Po + -rm -f ./$(DEPDIR)/old_mmap-Xraw.Po + -rm -f ./$(DEPDIR)/old_mmap-Xverbose.Po + -rm -f ./$(DEPDIR)/old_mmap-v-none.Po + -rm -f ./$(DEPDIR)/old_mmap.Po + -rm -f ./$(DEPDIR)/oldfstat.Po + -rm -f ./$(DEPDIR)/oldlstat.Po + -rm -f ./$(DEPDIR)/oldselect-P.Po + -rm -f ./$(DEPDIR)/oldselect-efault-P.Po + -rm -f ./$(DEPDIR)/oldselect-efault.Po + -rm -f ./$(DEPDIR)/oldselect.Po + -rm -f ./$(DEPDIR)/oldstat.Po + -rm -f ./$(DEPDIR)/open.Po + -rm -f ./$(DEPDIR)/openat.Po + -rm -f ./$(DEPDIR)/orphaned_process_group.Po + -rm -f ./$(DEPDIR)/osf_utimes.Po + -rm -f ./$(DEPDIR)/pause.Po + -rm -f ./$(DEPDIR)/pc.Po + -rm -f ./$(DEPDIR)/perf_event_open.Po + -rm -f ./$(DEPDIR)/perf_event_open_nonverbose.Po + -rm -f ./$(DEPDIR)/perf_event_open_unabbrev.Po + -rm -f ./$(DEPDIR)/personality-Xabbrev.Po + -rm -f ./$(DEPDIR)/personality-Xraw.Po + -rm -f ./$(DEPDIR)/personality-Xverbose.Po + -rm -f ./$(DEPDIR)/personality.Po + -rm -f ./$(DEPDIR)/pidfd_send_signal.Po + -rm -f ./$(DEPDIR)/pipe.Po + -rm -f ./$(DEPDIR)/pipe2.Po + -rm -f ./$(DEPDIR)/pkey_alloc.Po + -rm -f ./$(DEPDIR)/pkey_free.Po + -rm -f ./$(DEPDIR)/pkey_mprotect.Po + -rm -f ./$(DEPDIR)/poll-P.Po + -rm -f ./$(DEPDIR)/poll.Po + -rm -f ./$(DEPDIR)/ppoll-P.Po + -rm -f ./$(DEPDIR)/ppoll-v.Po + -rm -f ./$(DEPDIR)/ppoll.Po + -rm -f ./$(DEPDIR)/prctl-arg2-intptr.Po + -rm -f ./$(DEPDIR)/prctl-dumpable.Po + -rm -f ./$(DEPDIR)/prctl-name.Po + -rm -f ./$(DEPDIR)/prctl-no-args.Po + -rm -f ./$(DEPDIR)/prctl-pdeathsig.Po + -rm -f ./$(DEPDIR)/prctl-seccomp-filter-v.Po + -rm -f ./$(DEPDIR)/prctl-seccomp-strict.Po + -rm -f ./$(DEPDIR)/prctl-securebits.Po + -rm -f ./$(DEPDIR)/prctl-spec-inject.Po + -rm -f ./$(DEPDIR)/prctl-tid_address.Po + -rm -f ./$(DEPDIR)/prctl-tsc.Po + -rm -f ./$(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po + -rm -f ./$(DEPDIR)/preadv-preadv.Po + -rm -f ./$(DEPDIR)/preadv2-pwritev2.Po + -rm -f ./$(DEPDIR)/preadv_pwritev-preadv-pwritev.Po + -rm -f ./$(DEPDIR)/print_maxfd.Po + -rm -f ./$(DEPDIR)/printpath-umovestr-peekdata.Po + -rm -f ./$(DEPDIR)/printpath-umovestr-undumpable.Po + -rm -f ./$(DEPDIR)/printpath-umovestr.Po + -rm -f ./$(DEPDIR)/printsignal-Xabbrev.Po + -rm -f ./$(DEPDIR)/printsignal-Xraw.Po + -rm -f ./$(DEPDIR)/printsignal-Xverbose.Po + -rm -f ./$(DEPDIR)/printstr.Po + -rm -f ./$(DEPDIR)/printstrn-umoven-peekdata.Po + -rm -f ./$(DEPDIR)/printstrn-umoven-undumpable.Po + -rm -f ./$(DEPDIR)/printstrn-umoven.Po + -rm -f ./$(DEPDIR)/prlimit64.Po + -rm -f ./$(DEPDIR)/process_vm_readv.Po + -rm -f ./$(DEPDIR)/process_vm_writev.Po + -rm -f ./$(DEPDIR)/pselect6.Po + -rm -f ./$(DEPDIR)/ptrace.Po + -rm -f ./$(DEPDIR)/ptrace_syscall_info.Po + -rm -f ./$(DEPDIR)/pwritev-pwritev.Po + -rm -f ./$(DEPDIR)/qual_fault.Po + -rm -f ./$(DEPDIR)/qual_inject-error-signal.Po + -rm -f ./$(DEPDIR)/qual_inject-retval.Po + -rm -f ./$(DEPDIR)/qual_inject-signal.Po + -rm -f ./$(DEPDIR)/qual_signal.Po + -rm -f ./$(DEPDIR)/quotactl-Xabbrev.Po + -rm -f ./$(DEPDIR)/quotactl-Xraw.Po + -rm -f ./$(DEPDIR)/quotactl-Xverbose.Po + -rm -f ./$(DEPDIR)/quotactl-success-v.Po + -rm -f ./$(DEPDIR)/quotactl-success.Po + -rm -f ./$(DEPDIR)/quotactl-v.Po + -rm -f ./$(DEPDIR)/quotactl-xfs-success-v.Po + -rm -f ./$(DEPDIR)/quotactl-xfs-success.Po + -rm -f ./$(DEPDIR)/quotactl-xfs-v.Po + -rm -f ./$(DEPDIR)/quotactl-xfs.Po + -rm -f ./$(DEPDIR)/quotactl.Po + -rm -f ./$(DEPDIR)/read-write.Po + -rm -f ./$(DEPDIR)/readahead.Po + -rm -f ./$(DEPDIR)/readdir.Po + -rm -f ./$(DEPDIR)/readlink.Po + -rm -f ./$(DEPDIR)/readlinkat.Po + -rm -f ./$(DEPDIR)/readv.Po + -rm -f ./$(DEPDIR)/reboot.Po + -rm -f ./$(DEPDIR)/recvfrom.Po + -rm -f ./$(DEPDIR)/recvmmsg-timeout.Po + -rm -f ./$(DEPDIR)/recvmsg.Po + -rm -f ./$(DEPDIR)/redirect-fds.Po + -rm -f ./$(DEPDIR)/remap_file_pages-Xabbrev.Po + -rm -f ./$(DEPDIR)/remap_file_pages-Xraw.Po + -rm -f ./$(DEPDIR)/remap_file_pages-Xverbose.Po + -rm -f ./$(DEPDIR)/remap_file_pages.Po + -rm -f ./$(DEPDIR)/rename.Po + -rm -f ./$(DEPDIR)/renameat.Po + -rm -f ./$(DEPDIR)/renameat2.Po + -rm -f ./$(DEPDIR)/request_key.Po + -rm -f ./$(DEPDIR)/restart_syscall.Po + -rm -f ./$(DEPDIR)/riscv_flush_icache.Po + -rm -f ./$(DEPDIR)/rmdir.Po + -rm -f ./$(DEPDIR)/rt_sigaction.Po + -rm -f ./$(DEPDIR)/rt_sigpending.Po + -rm -f ./$(DEPDIR)/rt_sigprocmask.Po + -rm -f ./$(DEPDIR)/rt_sigqueueinfo.Po + -rm -f ./$(DEPDIR)/rt_sigreturn.Po + -rm -f ./$(DEPDIR)/rt_sigsuspend.Po + -rm -f ./$(DEPDIR)/rt_sigtimedwait.Po + -rm -f ./$(DEPDIR)/rt_tgsigqueueinfo.Po + -rm -f ./$(DEPDIR)/run_expect_termsig.Po + -rm -f ./$(DEPDIR)/s390_guarded_storage-v.Po + -rm -f ./$(DEPDIR)/s390_guarded_storage.Po + -rm -f ./$(DEPDIR)/s390_pci_mmio_read_write.Po + -rm -f ./$(DEPDIR)/s390_runtime_instr.Po + -rm -f ./$(DEPDIR)/s390_sthyi-v.Po + -rm -f ./$(DEPDIR)/s390_sthyi.Po + -rm -f ./$(DEPDIR)/sched_get_priority_mxx.Po + -rm -f ./$(DEPDIR)/sched_rr_get_interval.Po + -rm -f ./$(DEPDIR)/sched_xetaffinity.Po + -rm -f ./$(DEPDIR)/sched_xetattr.Po + -rm -f ./$(DEPDIR)/sched_xetparam.Po + -rm -f ./$(DEPDIR)/sched_xetscheduler.Po + -rm -f ./$(DEPDIR)/sched_yield.Po + -rm -f ./$(DEPDIR)/scm_rights.Po + -rm -f ./$(DEPDIR)/seccomp-filter-v.Po + -rm -f ./$(DEPDIR)/seccomp-filter.Po + -rm -f ./$(DEPDIR)/seccomp-strict.Po + -rm -f ./$(DEPDIR)/seccomp_get_action_avail.Po + -rm -f ./$(DEPDIR)/select-P.Po + -rm -f ./$(DEPDIR)/select.Po + -rm -f ./$(DEPDIR)/semop.Po + -rm -f ./$(DEPDIR)/sendfile.Po + -rm -f ./$(DEPDIR)/sendfile64.Po + -rm -f ./$(DEPDIR)/set_mempolicy.Po + -rm -f ./$(DEPDIR)/set_ptracer_any.Po + -rm -f ./$(DEPDIR)/set_sigblock.Po + -rm -f ./$(DEPDIR)/set_sigign.Po + -rm -f ./$(DEPDIR)/setdomainname.Po + -rm -f ./$(DEPDIR)/setfsgid.Po + -rm -f ./$(DEPDIR)/setfsgid32.Po + -rm -f ./$(DEPDIR)/setfsuid.Po + -rm -f ./$(DEPDIR)/setfsuid32.Po + -rm -f ./$(DEPDIR)/setgid.Po + -rm -f ./$(DEPDIR)/setgid32.Po + -rm -f ./$(DEPDIR)/setgroups.Po + -rm -f ./$(DEPDIR)/setgroups32.Po + -rm -f ./$(DEPDIR)/sethostname.Po + -rm -f ./$(DEPDIR)/setns.Po + -rm -f ./$(DEPDIR)/setregid.Po + -rm -f ./$(DEPDIR)/setregid32.Po + -rm -f ./$(DEPDIR)/setresgid.Po + -rm -f ./$(DEPDIR)/setresgid32.Po + -rm -f ./$(DEPDIR)/setresuid.Po + -rm -f ./$(DEPDIR)/setresuid32.Po + -rm -f ./$(DEPDIR)/setreuid.Po + -rm -f ./$(DEPDIR)/setreuid32.Po + -rm -f ./$(DEPDIR)/setrlimit-Xabbrev.Po + -rm -f ./$(DEPDIR)/setrlimit-Xraw.Po + -rm -f ./$(DEPDIR)/setrlimit-Xverbose.Po + -rm -f ./$(DEPDIR)/setrlimit.Po + -rm -f ./$(DEPDIR)/setuid.Po + -rm -f ./$(DEPDIR)/setuid32.Po + -rm -f ./$(DEPDIR)/shmxt.Po + -rm -f ./$(DEPDIR)/shutdown.Po + -rm -f ./$(DEPDIR)/sigaction.Po + -rm -f ./$(DEPDIR)/sigaltstack.Po + -rm -f ./$(DEPDIR)/siginfo.Po + -rm -f ./$(DEPDIR)/signal.Po + -rm -f ./$(DEPDIR)/signal_receive.Po + -rm -f ./$(DEPDIR)/signalfd4.Po + -rm -f ./$(DEPDIR)/sigpending.Po + -rm -f ./$(DEPDIR)/sigprocmask.Po + -rm -f ./$(DEPDIR)/sigreturn.Po + -rm -f ./$(DEPDIR)/sigsuspend.Po + -rm -f ./$(DEPDIR)/sleep.Po + -rm -f ./$(DEPDIR)/so_error.Po + -rm -f ./$(DEPDIR)/so_linger.Po + -rm -f ./$(DEPDIR)/so_peercred-Xabbrev.Po + -rm -f ./$(DEPDIR)/so_peercred-Xraw.Po + -rm -f ./$(DEPDIR)/so_peercred-Xverbose.Po + -rm -f ./$(DEPDIR)/so_peercred.Po + -rm -f ./$(DEPDIR)/sock_filter-v-Xabbrev.Po + -rm -f ./$(DEPDIR)/sock_filter-v-Xraw.Po + -rm -f ./$(DEPDIR)/sock_filter-v-Xverbose.Po + -rm -f ./$(DEPDIR)/sock_filter-v.Po + -rm -f ./$(DEPDIR)/sockaddr_xlat-Xabbrev.Po + -rm -f ./$(DEPDIR)/sockaddr_xlat-Xraw.Po + -rm -f ./$(DEPDIR)/sockaddr_xlat-Xverbose.Po + -rm -f ./$(DEPDIR)/socketcall.Po + -rm -f ./$(DEPDIR)/sockopt-sol_netlink.Po + -rm -f ./$(DEPDIR)/sockopt-timestamp.Po + -rm -f ./$(DEPDIR)/splice.Po + -rm -f ./$(DEPDIR)/stack-fcall-0.Po + -rm -f ./$(DEPDIR)/stack-fcall-1.Po + -rm -f ./$(DEPDIR)/stack-fcall-2.Po + -rm -f ./$(DEPDIR)/stack-fcall-3.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-0.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-1.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-2.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-3.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled.Po + -rm -f ./$(DEPDIR)/stack-fcall.Po + -rm -f ./$(DEPDIR)/stat.Po + -rm -f ./$(DEPDIR)/stat64-stat64.Po + -rm -f ./$(DEPDIR)/statfs-statfs.Po + -rm -f ./$(DEPDIR)/statfs64.Po + -rm -f ./$(DEPDIR)/statx.Po + -rm -f ./$(DEPDIR)/swap.Po + -rm -f ./$(DEPDIR)/sxetmask.Po + -rm -f ./$(DEPDIR)/symlink.Po + -rm -f ./$(DEPDIR)/symlinkat.Po + -rm -f ./$(DEPDIR)/sync.Po + -rm -f ./$(DEPDIR)/sync_file_range.Po + -rm -f ./$(DEPDIR)/sync_file_range2.Po + -rm -f ./$(DEPDIR)/sysinfo.Po + -rm -f ./$(DEPDIR)/syslog.Po + -rm -f ./$(DEPDIR)/tee.Po + -rm -f ./$(DEPDIR)/threads-execve.Po + -rm -f ./$(DEPDIR)/time.Po + -rm -f ./$(DEPDIR)/timer_create.Po + -rm -f ./$(DEPDIR)/timer_xettime.Po + -rm -f ./$(DEPDIR)/timerfd_xettime.Po + -rm -f ./$(DEPDIR)/times-fail.Po + -rm -f ./$(DEPDIR)/times.Po + -rm -f ./$(DEPDIR)/truncate.Po + -rm -f ./$(DEPDIR)/truncate64-truncate64.Po + -rm -f ./$(DEPDIR)/ugetrlimit.Po + -rm -f ./$(DEPDIR)/uio-uio.Po + -rm -f ./$(DEPDIR)/umask.Po + -rm -f ./$(DEPDIR)/umount.Po + -rm -f ./$(DEPDIR)/umount2.Po + -rm -f ./$(DEPDIR)/umoven-illptr.Po + -rm -f ./$(DEPDIR)/umovestr-illptr.Po + -rm -f ./$(DEPDIR)/umovestr.Po + -rm -f ./$(DEPDIR)/umovestr2.Po + -rm -f ./$(DEPDIR)/umovestr3.Po + -rm -f ./$(DEPDIR)/uname.Po + -rm -f ./$(DEPDIR)/unblock_reset_raise.Po + -rm -f ./$(DEPDIR)/unix-pair-send-recv.Po + -rm -f ./$(DEPDIR)/unix-pair-sendto-recvfrom.Po + -rm -f ./$(DEPDIR)/unlink.Po + -rm -f ./$(DEPDIR)/unlinkat.Po + -rm -f ./$(DEPDIR)/unshare.Po + -rm -f ./$(DEPDIR)/userfaultfd.Po + -rm -f ./$(DEPDIR)/ustat.Po + -rm -f ./$(DEPDIR)/utime.Po + -rm -f ./$(DEPDIR)/utimensat-Xabbrev.Po + -rm -f ./$(DEPDIR)/utimensat-Xraw.Po + -rm -f ./$(DEPDIR)/utimensat-Xverbose.Po + -rm -f ./$(DEPDIR)/utimensat.Po + -rm -f ./$(DEPDIR)/utimes.Po + -rm -f ./$(DEPDIR)/vfork-f.Po + -rm -f ./$(DEPDIR)/vhangup.Po + -rm -f ./$(DEPDIR)/vmsplice.Po + -rm -f ./$(DEPDIR)/wait4-v.Po + -rm -f ./$(DEPDIR)/wait4.Po + -rm -f ./$(DEPDIR)/waitid-v.Po + -rm -f ./$(DEPDIR)/waitid.Po + -rm -f ./$(DEPDIR)/waitpid.Po + -rm -f ./$(DEPDIR)/xattr-strings.Po + -rm -f ./$(DEPDIR)/xattr.Po + -rm -f ./$(DEPDIR)/xet_robust_list.Po + -rm -f ./$(DEPDIR)/xet_thread_area_x86.Po + -rm -f ./$(DEPDIR)/xetitimer.Po + -rm -f ./$(DEPDIR)/xetpgid.Po + -rm -f ./$(DEPDIR)/xetpriority.Po + -rm -f ./$(DEPDIR)/xettimeofday.Po + -rm -f ./$(DEPDIR)/zeroargc.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -5652,7 +9894,652 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/_newselect-P.Po + -rm -f ./$(DEPDIR)/_newselect.Po + -rm -f ./$(DEPDIR)/accept.Po + -rm -f ./$(DEPDIR)/accept4.Po + -rm -f ./$(DEPDIR)/access.Po + -rm -f ./$(DEPDIR)/acct.Po + -rm -f ./$(DEPDIR)/add_key.Po + -rm -f ./$(DEPDIR)/adjtimex.Po + -rm -f ./$(DEPDIR)/aio.Po + -rm -f ./$(DEPDIR)/aio_pgetevents.Po + -rm -f ./$(DEPDIR)/alarm.Po + -rm -f ./$(DEPDIR)/answer.Po + -rm -f ./$(DEPDIR)/attach-f-p-cmd.Po + -rm -f ./$(DEPDIR)/attach-f-p.Po + -rm -f ./$(DEPDIR)/attach-p-cmd-cmd.Po + -rm -f ./$(DEPDIR)/attach-p-cmd-p.Po + -rm -f ./$(DEPDIR)/block_reset_raise_run.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd-prog-v.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd-prog.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd-v.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd.Po + -rm -f ./$(DEPDIR)/bpf-success-v.Po + -rm -f ./$(DEPDIR)/bpf-success.Po + -rm -f ./$(DEPDIR)/bpf-v.Po + -rm -f ./$(DEPDIR)/bpf.Po + -rm -f ./$(DEPDIR)/brk.Po + -rm -f ./$(DEPDIR)/btrfs.Po + -rm -f ./$(DEPDIR)/caps-abbrev.Po + -rm -f ./$(DEPDIR)/caps.Po + -rm -f ./$(DEPDIR)/check_sigblock.Po + -rm -f ./$(DEPDIR)/check_sigign.Po + -rm -f ./$(DEPDIR)/chmod.Po + -rm -f ./$(DEPDIR)/chown.Po + -rm -f ./$(DEPDIR)/chown32.Po + -rm -f ./$(DEPDIR)/chroot.Po + -rm -f ./$(DEPDIR)/clock_adjtime.Po + -rm -f ./$(DEPDIR)/clock_nanosleep.Po + -rm -f ./$(DEPDIR)/clock_xettime.Po + -rm -f ./$(DEPDIR)/clone_parent.Po + -rm -f ./$(DEPDIR)/clone_ptrace.Po + -rm -f ./$(DEPDIR)/copy_file_range.Po + -rm -f ./$(DEPDIR)/count-f.Po + -rm -f ./$(DEPDIR)/creat.Po + -rm -f ./$(DEPDIR)/delay.Po + -rm -f ./$(DEPDIR)/delete_module.Po + -rm -f ./$(DEPDIR)/dev-yy.Po + -rm -f ./$(DEPDIR)/dup.Po + -rm -f ./$(DEPDIR)/dup2.Po + -rm -f ./$(DEPDIR)/dup3.Po + -rm -f ./$(DEPDIR)/epoll_create.Po + -rm -f ./$(DEPDIR)/epoll_create1.Po + -rm -f ./$(DEPDIR)/epoll_ctl.Po + -rm -f ./$(DEPDIR)/epoll_pwait.Po + -rm -f ./$(DEPDIR)/epoll_wait.Po + -rm -f ./$(DEPDIR)/erestartsys.Po + -rm -f ./$(DEPDIR)/eventfd.Po + -rm -f ./$(DEPDIR)/execve-v.Po + -rm -f ./$(DEPDIR)/execve.Po + -rm -f ./$(DEPDIR)/execveat-v.Po + -rm -f ./$(DEPDIR)/execveat.Po + -rm -f ./$(DEPDIR)/faccessat.Po + -rm -f ./$(DEPDIR)/fadvise64.Po + -rm -f ./$(DEPDIR)/fadvise64_64.Po + -rm -f ./$(DEPDIR)/fallocate.Po + -rm -f ./$(DEPDIR)/fanotify_init.Po + -rm -f ./$(DEPDIR)/fanotify_mark-Xabbrev.Po + -rm -f ./$(DEPDIR)/fanotify_mark-Xraw.Po + -rm -f ./$(DEPDIR)/fanotify_mark-Xverbose.Po + -rm -f ./$(DEPDIR)/fanotify_mark.Po + -rm -f ./$(DEPDIR)/fchdir.Po + -rm -f ./$(DEPDIR)/fchmod.Po + -rm -f ./$(DEPDIR)/fchmodat.Po + -rm -f ./$(DEPDIR)/fchown.Po + -rm -f ./$(DEPDIR)/fchown32.Po + -rm -f ./$(DEPDIR)/fchownat.Po + -rm -f ./$(DEPDIR)/fcntl.Po + -rm -f ./$(DEPDIR)/fcntl64.Po + -rm -f ./$(DEPDIR)/fdatasync.Po + -rm -f ./$(DEPDIR)/fflush.Po + -rm -f ./$(DEPDIR)/file_handle.Po + -rm -f ./$(DEPDIR)/file_ioctl.Po + -rm -f ./$(DEPDIR)/filter-unavailable.Po + -rm -f ./$(DEPDIR)/finit_module.Po + -rm -f ./$(DEPDIR)/flock.Po + -rm -f ./$(DEPDIR)/fork-f.Po + -rm -f ./$(DEPDIR)/fstat-Xabbrev.Po + -rm -f ./$(DEPDIR)/fstat-Xraw.Po + -rm -f ./$(DEPDIR)/fstat-Xverbose.Po + -rm -f ./$(DEPDIR)/fstat.Po + -rm -f ./$(DEPDIR)/fstat64-Xabbrev.Po + -rm -f ./$(DEPDIR)/fstat64-Xraw.Po + -rm -f ./$(DEPDIR)/fstat64-Xverbose.Po + -rm -f ./$(DEPDIR)/fstat64-fstat64.Po + -rm -f ./$(DEPDIR)/fstatat64-fstatat64.Po + -rm -f ./$(DEPDIR)/fstatfs.Po + -rm -f ./$(DEPDIR)/fstatfs64.Po + -rm -f ./$(DEPDIR)/fsync-y.Po + -rm -f ./$(DEPDIR)/fsync.Po + -rm -f ./$(DEPDIR)/ftruncate.Po + -rm -f ./$(DEPDIR)/ftruncate64-ftruncate64.Po + -rm -f ./$(DEPDIR)/futex.Po + -rm -f ./$(DEPDIR)/futimesat.Po + -rm -f ./$(DEPDIR)/get_mempolicy.Po + -rm -f ./$(DEPDIR)/getcpu.Po + -rm -f ./$(DEPDIR)/getcwd.Po + -rm -f ./$(DEPDIR)/getdents.Po + -rm -f ./$(DEPDIR)/getdents64.Po + -rm -f ./$(DEPDIR)/getegid.Po + -rm -f ./$(DEPDIR)/getegid32.Po + -rm -f ./$(DEPDIR)/geteuid.Po + -rm -f ./$(DEPDIR)/geteuid32.Po + -rm -f ./$(DEPDIR)/getgid.Po + -rm -f ./$(DEPDIR)/getgid32.Po + -rm -f ./$(DEPDIR)/getgroups.Po + -rm -f ./$(DEPDIR)/getgroups32.Po + -rm -f ./$(DEPDIR)/getpeername.Po + -rm -f ./$(DEPDIR)/getpgrp.Po + -rm -f ./$(DEPDIR)/getpid.Po + -rm -f ./$(DEPDIR)/getppid.Po + -rm -f ./$(DEPDIR)/getrandom.Po + -rm -f ./$(DEPDIR)/getresgid.Po + -rm -f ./$(DEPDIR)/getresgid32.Po + -rm -f ./$(DEPDIR)/getresuid.Po + -rm -f ./$(DEPDIR)/getresuid32.Po + -rm -f ./$(DEPDIR)/getrlimit.Po + -rm -f ./$(DEPDIR)/getrusage.Po + -rm -f ./$(DEPDIR)/getsid.Po + -rm -f ./$(DEPDIR)/getsockname.Po + -rm -f ./$(DEPDIR)/gettid.Po + -rm -f ./$(DEPDIR)/getuid.Po + -rm -f ./$(DEPDIR)/getuid32.Po + -rm -f ./$(DEPDIR)/getxxid.Po + -rm -f ./$(DEPDIR)/group_req.Po + -rm -f ./$(DEPDIR)/inet-cmsg.Po + -rm -f ./$(DEPDIR)/init_module.Po + -rm -f ./$(DEPDIR)/inject-nf.Po + -rm -f ./$(DEPDIR)/inotify.Po + -rm -f ./$(DEPDIR)/inotify_init1.Po + -rm -f ./$(DEPDIR)/int_0x80.Po + -rm -f ./$(DEPDIR)/io_uring_enter.Po + -rm -f ./$(DEPDIR)/io_uring_register.Po + -rm -f ./$(DEPDIR)/io_uring_setup.Po + -rm -f ./$(DEPDIR)/ioctl.Po + -rm -f ./$(DEPDIR)/ioctl_block.Po + -rm -f ./$(DEPDIR)/ioctl_dm-v.Po + -rm -f ./$(DEPDIR)/ioctl_dm.Po + -rm -f ./$(DEPDIR)/ioctl_evdev-success-v.Po + -rm -f ./$(DEPDIR)/ioctl_evdev-success.Po + -rm -f ./$(DEPDIR)/ioctl_evdev-v.Po + -rm -f ./$(DEPDIR)/ioctl_evdev.Po + -rm -f ./$(DEPDIR)/ioctl_inotify.Po + -rm -f ./$(DEPDIR)/ioctl_kvm_run-v.Po + -rm -f ./$(DEPDIR)/ioctl_kvm_run.Po + -rm -f ./$(DEPDIR)/ioctl_kvm_run_auxstr_vcpu.Po + -rm -f ./$(DEPDIR)/ioctl_loop-nv.Po + -rm -f ./$(DEPDIR)/ioctl_loop-v.Po + -rm -f ./$(DEPDIR)/ioctl_loop.Po + -rm -f ./$(DEPDIR)/ioctl_mtd.Po + -rm -f ./$(DEPDIR)/ioctl_nbd.Po + -rm -f ./$(DEPDIR)/ioctl_nsfs.Po + -rm -f ./$(DEPDIR)/ioctl_perf-success.Po + -rm -f ./$(DEPDIR)/ioctl_perf.Po + -rm -f ./$(DEPDIR)/ioctl_ptp.Po + -rm -f ./$(DEPDIR)/ioctl_random.Po + -rm -f ./$(DEPDIR)/ioctl_rtc-v.Po + -rm -f ./$(DEPDIR)/ioctl_rtc.Po + -rm -f ./$(DEPDIR)/ioctl_scsi.Po + -rm -f ./$(DEPDIR)/ioctl_sg_io_v3.Po + -rm -f ./$(DEPDIR)/ioctl_sg_io_v4.Po + -rm -f ./$(DEPDIR)/ioctl_sock_gifconf.Po + -rm -f ./$(DEPDIR)/ioctl_uffdio.Po + -rm -f ./$(DEPDIR)/ioctl_v4l2.Po + -rm -f ./$(DEPDIR)/ioperm.Po + -rm -f ./$(DEPDIR)/iopl.Po + -rm -f ./$(DEPDIR)/ioprio-Xabbrev.Po + -rm -f ./$(DEPDIR)/ioprio-Xraw.Po + -rm -f ./$(DEPDIR)/ioprio-Xverbose.Po + -rm -f ./$(DEPDIR)/ioprio.Po + -rm -f ./$(DEPDIR)/ip_mreq.Po + -rm -f ./$(DEPDIR)/ipc.Po + -rm -f ./$(DEPDIR)/ipc_msg-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_msg-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_msg-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_msg.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf.Po + -rm -f ./$(DEPDIR)/ipc_sem-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_sem-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_sem-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_sem.Po + -rm -f ./$(DEPDIR)/ipc_shm-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_shm-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_shm-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_shm.Po + -rm -f ./$(DEPDIR)/is_linux_mips_n64.Po + -rm -f ./$(DEPDIR)/kcmp-y.Po + -rm -f ./$(DEPDIR)/kcmp.Po + -rm -f ./$(DEPDIR)/kern_features.Po + -rm -f ./$(DEPDIR)/kernel_version-Xabbrev.Po + -rm -f ./$(DEPDIR)/kernel_version-Xraw.Po + -rm -f ./$(DEPDIR)/kernel_version-Xverbose.Po + -rm -f ./$(DEPDIR)/kernel_version.Po + -rm -f ./$(DEPDIR)/kexec_file_load.Po + -rm -f ./$(DEPDIR)/kexec_load.Po + -rm -f ./$(DEPDIR)/keyctl-Xabbrev.Po + -rm -f ./$(DEPDIR)/keyctl-Xraw.Po + -rm -f ./$(DEPDIR)/keyctl-Xverbose.Po + -rm -f ./$(DEPDIR)/keyctl.Po + -rm -f ./$(DEPDIR)/kill.Po + -rm -f ./$(DEPDIR)/kill_child.Po + -rm -f ./$(DEPDIR)/ksysent.Po + -rm -f ./$(DEPDIR)/lchown.Po + -rm -f ./$(DEPDIR)/lchown32.Po + -rm -f ./$(DEPDIR)/libtests_a-create_nl_socket.Po + -rm -f ./$(DEPDIR)/libtests_a-errno2name.Po + -rm -f ./$(DEPDIR)/libtests_a-error_msg.Po + -rm -f ./$(DEPDIR)/libtests_a-fill_memory.Po + -rm -f ./$(DEPDIR)/libtests_a-get_page_size.Po + -rm -f ./$(DEPDIR)/libtests_a-get_sigset_size.Po + -rm -f ./$(DEPDIR)/libtests_a-hexdump_strdup.Po + -rm -f ./$(DEPDIR)/libtests_a-hexquote_strndup.Po + -rm -f ./$(DEPDIR)/libtests_a-ifindex.Po + -rm -f ./$(DEPDIR)/libtests_a-inode_of_sockfd.Po + -rm -f ./$(DEPDIR)/libtests_a-libmmsg.Po + -rm -f ./$(DEPDIR)/libtests_a-libsocketcall.Po + -rm -f ./$(DEPDIR)/libtests_a-overflowuid.Po + -rm -f ./$(DEPDIR)/libtests_a-pipe_maxfd.Po + -rm -f ./$(DEPDIR)/libtests_a-print_quoted_string.Po + -rm -f ./$(DEPDIR)/libtests_a-print_time.Po + -rm -f ./$(DEPDIR)/libtests_a-printflags.Po + -rm -f ./$(DEPDIR)/libtests_a-printxval.Po + -rm -f ./$(DEPDIR)/libtests_a-signal2name.Po + -rm -f ./$(DEPDIR)/libtests_a-skip_unavailable.Po + -rm -f ./$(DEPDIR)/libtests_a-sprintrc.Po + -rm -f ./$(DEPDIR)/libtests_a-tail_alloc.Po + -rm -f ./$(DEPDIR)/libtests_a-test_printpath.Po + -rm -f ./$(DEPDIR)/libtests_a-test_printstrn.Po + -rm -f ./$(DEPDIR)/libtests_a-test_ucopy.Po + -rm -f ./$(DEPDIR)/libtests_a-tprintf.Po + -rm -f ./$(DEPDIR)/link.Po + -rm -f ./$(DEPDIR)/linkat.Po + -rm -f ./$(DEPDIR)/list_sigaction_signum.Po + -rm -f ./$(DEPDIR)/llseek.Po + -rm -f ./$(DEPDIR)/localtime.Po + -rm -f ./$(DEPDIR)/lookup_dcookie.Po + -rm -f ./$(DEPDIR)/looping_threads.Po + -rm -f ./$(DEPDIR)/lseek.Po + -rm -f ./$(DEPDIR)/lstat.Po + -rm -f ./$(DEPDIR)/lstat64-lstat64.Po + -rm -f ./$(DEPDIR)/madvise.Po + -rm -f ./$(DEPDIR)/mbind.Po + -rm -f ./$(DEPDIR)/membarrier.Po + -rm -f ./$(DEPDIR)/memfd_create-Xabbrev.Po + -rm -f ./$(DEPDIR)/memfd_create-Xraw.Po + -rm -f ./$(DEPDIR)/memfd_create-Xverbose.Po + -rm -f ./$(DEPDIR)/memfd_create.Po + -rm -f ./$(DEPDIR)/migrate_pages.Po + -rm -f ./$(DEPDIR)/mincore.Po + -rm -f ./$(DEPDIR)/mkdir.Po + -rm -f ./$(DEPDIR)/mkdirat.Po + -rm -f ./$(DEPDIR)/mknod.Po + -rm -f ./$(DEPDIR)/mknodat.Po + -rm -f ./$(DEPDIR)/mlock.Po + -rm -f ./$(DEPDIR)/mlock2.Po + -rm -f ./$(DEPDIR)/mlockall.Po + -rm -f ./$(DEPDIR)/mmap-Xabbrev.Po + -rm -f ./$(DEPDIR)/mmap-Xraw.Po + -rm -f ./$(DEPDIR)/mmap-Xverbose.Po + -rm -f ./$(DEPDIR)/mmap.Po + -rm -f ./$(DEPDIR)/mmap64-mmap64.Po + -rm -f ./$(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Po + -rm -f ./$(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Po + -rm -f ./$(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Po + -rm -f ./$(DEPDIR)/mmsg-silent.Po + -rm -f ./$(DEPDIR)/mmsg.Po + -rm -f ./$(DEPDIR)/mmsg_name-v.Po + -rm -f ./$(DEPDIR)/mmsg_name.Po + -rm -f ./$(DEPDIR)/modify_ldt.Po + -rm -f ./$(DEPDIR)/mount-Xabbrev.Po + -rm -f ./$(DEPDIR)/mount-Xraw.Po + -rm -f ./$(DEPDIR)/mount-Xverbose.Po + -rm -f ./$(DEPDIR)/mount.Po + -rm -f ./$(DEPDIR)/move_pages-Xabbrev.Po + -rm -f ./$(DEPDIR)/move_pages-Xraw.Po + -rm -f ./$(DEPDIR)/move_pages-Xverbose.Po + -rm -f ./$(DEPDIR)/move_pages.Po + -rm -f ./$(DEPDIR)/mq.Po + -rm -f ./$(DEPDIR)/mq_sendrecv-read.Po + -rm -f ./$(DEPDIR)/mq_sendrecv-write.Po + -rm -f ./$(DEPDIR)/mq_sendrecv.Po + -rm -f ./$(DEPDIR)/msg_control-v.Po + -rm -f ./$(DEPDIR)/msg_control.Po + -rm -f ./$(DEPDIR)/msg_name.Po + -rm -f ./$(DEPDIR)/munlockall.Po + -rm -f ./$(DEPDIR)/nanosleep.Po + -rm -f ./$(DEPDIR)/net-accept-connect.Po + -rm -f ./$(DEPDIR)/net-icmp_filter.Po + -rm -f ./$(DEPDIR)/net-packet_mreq-Xabbrev.Po + -rm -f ./$(DEPDIR)/net-packet_mreq-Xraw.Po + -rm -f ./$(DEPDIR)/net-packet_mreq-Xverbose.Po + -rm -f ./$(DEPDIR)/net-packet_mreq.Po + -rm -f ./$(DEPDIR)/net-sockaddr.Po + -rm -f ./$(DEPDIR)/net-tpacket_req.Po + -rm -f ./$(DEPDIR)/net-tpacket_stats-success.Po + -rm -f ./$(DEPDIR)/net-tpacket_stats.Po + -rm -f ./$(DEPDIR)/net-y-unix.Po + -rm -f ./$(DEPDIR)/net-yy-inet.Po + -rm -f ./$(DEPDIR)/net-yy-inet6.Po + -rm -f ./$(DEPDIR)/net-yy-netlink.Po + -rm -f ./$(DEPDIR)/net-yy-unix.Po + -rm -f ./$(DEPDIR)/netlink_audit.Po + -rm -f ./$(DEPDIR)/netlink_crypto.Po + -rm -f ./$(DEPDIR)/netlink_generic.Po + -rm -f ./$(DEPDIR)/netlink_inet_diag.Po + -rm -f ./$(DEPDIR)/netlink_kobject_uevent.Po + -rm -f ./$(DEPDIR)/netlink_netfilter.Po + -rm -f ./$(DEPDIR)/netlink_netlink_diag.Po + -rm -f ./$(DEPDIR)/netlink_protocol.Po + -rm -f ./$(DEPDIR)/netlink_route.Po + -rm -f ./$(DEPDIR)/netlink_selinux.Po + -rm -f ./$(DEPDIR)/netlink_sock_diag.Po + -rm -f ./$(DEPDIR)/netlink_unix_diag.Po + -rm -f ./$(DEPDIR)/netlink_xfrm.Po + -rm -f ./$(DEPDIR)/newfstatat-newfstatat.Po + -rm -f ./$(DEPDIR)/nfnetlink_acct.Po + -rm -f ./$(DEPDIR)/nfnetlink_cthelper.Po + -rm -f ./$(DEPDIR)/nfnetlink_ctnetlink.Po + -rm -f ./$(DEPDIR)/nfnetlink_ctnetlink_exp.Po + -rm -f ./$(DEPDIR)/nfnetlink_cttimeout.Po + -rm -f ./$(DEPDIR)/nfnetlink_ipset.Po + -rm -f ./$(DEPDIR)/nfnetlink_nft_compat.Po + -rm -f ./$(DEPDIR)/nfnetlink_nftables.Po + -rm -f ./$(DEPDIR)/nfnetlink_osf.Po + -rm -f ./$(DEPDIR)/nfnetlink_queue.Po + -rm -f ./$(DEPDIR)/nfnetlink_ulog.Po + -rm -f ./$(DEPDIR)/nlattr.Po + -rm -f ./$(DEPDIR)/nlattr_br_port_msg.Po + -rm -f ./$(DEPDIR)/nlattr_crypto_user_alg.Po + -rm -f ./$(DEPDIR)/nlattr_dcbmsg.Po + -rm -f ./$(DEPDIR)/nlattr_fib_rule_hdr.Po + -rm -f ./$(DEPDIR)/nlattr_ifaddrlblmsg.Po + -rm -f ./$(DEPDIR)/nlattr_ifaddrmsg.Po + -rm -f ./$(DEPDIR)/nlattr_ifinfomsg.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_af_spec.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_brport.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_linkinfo.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_port.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_xdp.Po + -rm -f ./$(DEPDIR)/nlattr_inet_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_inet_diag_req_compat.Po + -rm -f ./$(DEPDIR)/nlattr_inet_diag_req_v2.Po + -rm -f ./$(DEPDIR)/nlattr_mdba_mdb_entry.Po + -rm -f ./$(DEPDIR)/nlattr_mdba_router_port.Po + -rm -f ./$(DEPDIR)/nlattr_ndmsg.Po + -rm -f ./$(DEPDIR)/nlattr_ndtmsg.Po + -rm -f ./$(DEPDIR)/nlattr_netconfmsg.Po + -rm -f ./$(DEPDIR)/nlattr_netlink_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_nlmsgerr.Po + -rm -f ./$(DEPDIR)/nlattr_packet_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_rtgenmsg.Po + -rm -f ./$(DEPDIR)/nlattr_rtmsg.Po + -rm -f ./$(DEPDIR)/nlattr_smc_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_tc_stats.Po + -rm -f ./$(DEPDIR)/nlattr_tca_stab.Po + -rm -f ./$(DEPDIR)/nlattr_tcamsg.Po + -rm -f ./$(DEPDIR)/nlattr_tcmsg.Po + -rm -f ./$(DEPDIR)/nlattr_unix_diag_msg.Po + -rm -f ./$(DEPDIR)/nsyscalls-d.Po + -rm -f ./$(DEPDIR)/nsyscalls.Po + -rm -f ./$(DEPDIR)/old_mmap-P.Po + -rm -f ./$(DEPDIR)/old_mmap-Xabbrev.Po + -rm -f ./$(DEPDIR)/old_mmap-Xraw.Po + -rm -f ./$(DEPDIR)/old_mmap-Xverbose.Po + -rm -f ./$(DEPDIR)/old_mmap-v-none.Po + -rm -f ./$(DEPDIR)/old_mmap.Po + -rm -f ./$(DEPDIR)/oldfstat.Po + -rm -f ./$(DEPDIR)/oldlstat.Po + -rm -f ./$(DEPDIR)/oldselect-P.Po + -rm -f ./$(DEPDIR)/oldselect-efault-P.Po + -rm -f ./$(DEPDIR)/oldselect-efault.Po + -rm -f ./$(DEPDIR)/oldselect.Po + -rm -f ./$(DEPDIR)/oldstat.Po + -rm -f ./$(DEPDIR)/open.Po + -rm -f ./$(DEPDIR)/openat.Po + -rm -f ./$(DEPDIR)/orphaned_process_group.Po + -rm -f ./$(DEPDIR)/osf_utimes.Po + -rm -f ./$(DEPDIR)/pause.Po + -rm -f ./$(DEPDIR)/pc.Po + -rm -f ./$(DEPDIR)/perf_event_open.Po + -rm -f ./$(DEPDIR)/perf_event_open_nonverbose.Po + -rm -f ./$(DEPDIR)/perf_event_open_unabbrev.Po + -rm -f ./$(DEPDIR)/personality-Xabbrev.Po + -rm -f ./$(DEPDIR)/personality-Xraw.Po + -rm -f ./$(DEPDIR)/personality-Xverbose.Po + -rm -f ./$(DEPDIR)/personality.Po + -rm -f ./$(DEPDIR)/pidfd_send_signal.Po + -rm -f ./$(DEPDIR)/pipe.Po + -rm -f ./$(DEPDIR)/pipe2.Po + -rm -f ./$(DEPDIR)/pkey_alloc.Po + -rm -f ./$(DEPDIR)/pkey_free.Po + -rm -f ./$(DEPDIR)/pkey_mprotect.Po + -rm -f ./$(DEPDIR)/poll-P.Po + -rm -f ./$(DEPDIR)/poll.Po + -rm -f ./$(DEPDIR)/ppoll-P.Po + -rm -f ./$(DEPDIR)/ppoll-v.Po + -rm -f ./$(DEPDIR)/ppoll.Po + -rm -f ./$(DEPDIR)/prctl-arg2-intptr.Po + -rm -f ./$(DEPDIR)/prctl-dumpable.Po + -rm -f ./$(DEPDIR)/prctl-name.Po + -rm -f ./$(DEPDIR)/prctl-no-args.Po + -rm -f ./$(DEPDIR)/prctl-pdeathsig.Po + -rm -f ./$(DEPDIR)/prctl-seccomp-filter-v.Po + -rm -f ./$(DEPDIR)/prctl-seccomp-strict.Po + -rm -f ./$(DEPDIR)/prctl-securebits.Po + -rm -f ./$(DEPDIR)/prctl-spec-inject.Po + -rm -f ./$(DEPDIR)/prctl-tid_address.Po + -rm -f ./$(DEPDIR)/prctl-tsc.Po + -rm -f ./$(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po + -rm -f ./$(DEPDIR)/preadv-preadv.Po + -rm -f ./$(DEPDIR)/preadv2-pwritev2.Po + -rm -f ./$(DEPDIR)/preadv_pwritev-preadv-pwritev.Po + -rm -f ./$(DEPDIR)/print_maxfd.Po + -rm -f ./$(DEPDIR)/printpath-umovestr-peekdata.Po + -rm -f ./$(DEPDIR)/printpath-umovestr-undumpable.Po + -rm -f ./$(DEPDIR)/printpath-umovestr.Po + -rm -f ./$(DEPDIR)/printsignal-Xabbrev.Po + -rm -f ./$(DEPDIR)/printsignal-Xraw.Po + -rm -f ./$(DEPDIR)/printsignal-Xverbose.Po + -rm -f ./$(DEPDIR)/printstr.Po + -rm -f ./$(DEPDIR)/printstrn-umoven-peekdata.Po + -rm -f ./$(DEPDIR)/printstrn-umoven-undumpable.Po + -rm -f ./$(DEPDIR)/printstrn-umoven.Po + -rm -f ./$(DEPDIR)/prlimit64.Po + -rm -f ./$(DEPDIR)/process_vm_readv.Po + -rm -f ./$(DEPDIR)/process_vm_writev.Po + -rm -f ./$(DEPDIR)/pselect6.Po + -rm -f ./$(DEPDIR)/ptrace.Po + -rm -f ./$(DEPDIR)/ptrace_syscall_info.Po + -rm -f ./$(DEPDIR)/pwritev-pwritev.Po + -rm -f ./$(DEPDIR)/qual_fault.Po + -rm -f ./$(DEPDIR)/qual_inject-error-signal.Po + -rm -f ./$(DEPDIR)/qual_inject-retval.Po + -rm -f ./$(DEPDIR)/qual_inject-signal.Po + -rm -f ./$(DEPDIR)/qual_signal.Po + -rm -f ./$(DEPDIR)/quotactl-Xabbrev.Po + -rm -f ./$(DEPDIR)/quotactl-Xraw.Po + -rm -f ./$(DEPDIR)/quotactl-Xverbose.Po + -rm -f ./$(DEPDIR)/quotactl-success-v.Po + -rm -f ./$(DEPDIR)/quotactl-success.Po + -rm -f ./$(DEPDIR)/quotactl-v.Po + -rm -f ./$(DEPDIR)/quotactl-xfs-success-v.Po + -rm -f ./$(DEPDIR)/quotactl-xfs-success.Po + -rm -f ./$(DEPDIR)/quotactl-xfs-v.Po + -rm -f ./$(DEPDIR)/quotactl-xfs.Po + -rm -f ./$(DEPDIR)/quotactl.Po + -rm -f ./$(DEPDIR)/read-write.Po + -rm -f ./$(DEPDIR)/readahead.Po + -rm -f ./$(DEPDIR)/readdir.Po + -rm -f ./$(DEPDIR)/readlink.Po + -rm -f ./$(DEPDIR)/readlinkat.Po + -rm -f ./$(DEPDIR)/readv.Po + -rm -f ./$(DEPDIR)/reboot.Po + -rm -f ./$(DEPDIR)/recvfrom.Po + -rm -f ./$(DEPDIR)/recvmmsg-timeout.Po + -rm -f ./$(DEPDIR)/recvmsg.Po + -rm -f ./$(DEPDIR)/redirect-fds.Po + -rm -f ./$(DEPDIR)/remap_file_pages-Xabbrev.Po + -rm -f ./$(DEPDIR)/remap_file_pages-Xraw.Po + -rm -f ./$(DEPDIR)/remap_file_pages-Xverbose.Po + -rm -f ./$(DEPDIR)/remap_file_pages.Po + -rm -f ./$(DEPDIR)/rename.Po + -rm -f ./$(DEPDIR)/renameat.Po + -rm -f ./$(DEPDIR)/renameat2.Po + -rm -f ./$(DEPDIR)/request_key.Po + -rm -f ./$(DEPDIR)/restart_syscall.Po + -rm -f ./$(DEPDIR)/riscv_flush_icache.Po + -rm -f ./$(DEPDIR)/rmdir.Po + -rm -f ./$(DEPDIR)/rt_sigaction.Po + -rm -f ./$(DEPDIR)/rt_sigpending.Po + -rm -f ./$(DEPDIR)/rt_sigprocmask.Po + -rm -f ./$(DEPDIR)/rt_sigqueueinfo.Po + -rm -f ./$(DEPDIR)/rt_sigreturn.Po + -rm -f ./$(DEPDIR)/rt_sigsuspend.Po + -rm -f ./$(DEPDIR)/rt_sigtimedwait.Po + -rm -f ./$(DEPDIR)/rt_tgsigqueueinfo.Po + -rm -f ./$(DEPDIR)/run_expect_termsig.Po + -rm -f ./$(DEPDIR)/s390_guarded_storage-v.Po + -rm -f ./$(DEPDIR)/s390_guarded_storage.Po + -rm -f ./$(DEPDIR)/s390_pci_mmio_read_write.Po + -rm -f ./$(DEPDIR)/s390_runtime_instr.Po + -rm -f ./$(DEPDIR)/s390_sthyi-v.Po + -rm -f ./$(DEPDIR)/s390_sthyi.Po + -rm -f ./$(DEPDIR)/sched_get_priority_mxx.Po + -rm -f ./$(DEPDIR)/sched_rr_get_interval.Po + -rm -f ./$(DEPDIR)/sched_xetaffinity.Po + -rm -f ./$(DEPDIR)/sched_xetattr.Po + -rm -f ./$(DEPDIR)/sched_xetparam.Po + -rm -f ./$(DEPDIR)/sched_xetscheduler.Po + -rm -f ./$(DEPDIR)/sched_yield.Po + -rm -f ./$(DEPDIR)/scm_rights.Po + -rm -f ./$(DEPDIR)/seccomp-filter-v.Po + -rm -f ./$(DEPDIR)/seccomp-filter.Po + -rm -f ./$(DEPDIR)/seccomp-strict.Po + -rm -f ./$(DEPDIR)/seccomp_get_action_avail.Po + -rm -f ./$(DEPDIR)/select-P.Po + -rm -f ./$(DEPDIR)/select.Po + -rm -f ./$(DEPDIR)/semop.Po + -rm -f ./$(DEPDIR)/sendfile.Po + -rm -f ./$(DEPDIR)/sendfile64.Po + -rm -f ./$(DEPDIR)/set_mempolicy.Po + -rm -f ./$(DEPDIR)/set_ptracer_any.Po + -rm -f ./$(DEPDIR)/set_sigblock.Po + -rm -f ./$(DEPDIR)/set_sigign.Po + -rm -f ./$(DEPDIR)/setdomainname.Po + -rm -f ./$(DEPDIR)/setfsgid.Po + -rm -f ./$(DEPDIR)/setfsgid32.Po + -rm -f ./$(DEPDIR)/setfsuid.Po + -rm -f ./$(DEPDIR)/setfsuid32.Po + -rm -f ./$(DEPDIR)/setgid.Po + -rm -f ./$(DEPDIR)/setgid32.Po + -rm -f ./$(DEPDIR)/setgroups.Po + -rm -f ./$(DEPDIR)/setgroups32.Po + -rm -f ./$(DEPDIR)/sethostname.Po + -rm -f ./$(DEPDIR)/setns.Po + -rm -f ./$(DEPDIR)/setregid.Po + -rm -f ./$(DEPDIR)/setregid32.Po + -rm -f ./$(DEPDIR)/setresgid.Po + -rm -f ./$(DEPDIR)/setresgid32.Po + -rm -f ./$(DEPDIR)/setresuid.Po + -rm -f ./$(DEPDIR)/setresuid32.Po + -rm -f ./$(DEPDIR)/setreuid.Po + -rm -f ./$(DEPDIR)/setreuid32.Po + -rm -f ./$(DEPDIR)/setrlimit-Xabbrev.Po + -rm -f ./$(DEPDIR)/setrlimit-Xraw.Po + -rm -f ./$(DEPDIR)/setrlimit-Xverbose.Po + -rm -f ./$(DEPDIR)/setrlimit.Po + -rm -f ./$(DEPDIR)/setuid.Po + -rm -f ./$(DEPDIR)/setuid32.Po + -rm -f ./$(DEPDIR)/shmxt.Po + -rm -f ./$(DEPDIR)/shutdown.Po + -rm -f ./$(DEPDIR)/sigaction.Po + -rm -f ./$(DEPDIR)/sigaltstack.Po + -rm -f ./$(DEPDIR)/siginfo.Po + -rm -f ./$(DEPDIR)/signal.Po + -rm -f ./$(DEPDIR)/signal_receive.Po + -rm -f ./$(DEPDIR)/signalfd4.Po + -rm -f ./$(DEPDIR)/sigpending.Po + -rm -f ./$(DEPDIR)/sigprocmask.Po + -rm -f ./$(DEPDIR)/sigreturn.Po + -rm -f ./$(DEPDIR)/sigsuspend.Po + -rm -f ./$(DEPDIR)/sleep.Po + -rm -f ./$(DEPDIR)/so_error.Po + -rm -f ./$(DEPDIR)/so_linger.Po + -rm -f ./$(DEPDIR)/so_peercred-Xabbrev.Po + -rm -f ./$(DEPDIR)/so_peercred-Xraw.Po + -rm -f ./$(DEPDIR)/so_peercred-Xverbose.Po + -rm -f ./$(DEPDIR)/so_peercred.Po + -rm -f ./$(DEPDIR)/sock_filter-v-Xabbrev.Po + -rm -f ./$(DEPDIR)/sock_filter-v-Xraw.Po + -rm -f ./$(DEPDIR)/sock_filter-v-Xverbose.Po + -rm -f ./$(DEPDIR)/sock_filter-v.Po + -rm -f ./$(DEPDIR)/sockaddr_xlat-Xabbrev.Po + -rm -f ./$(DEPDIR)/sockaddr_xlat-Xraw.Po + -rm -f ./$(DEPDIR)/sockaddr_xlat-Xverbose.Po + -rm -f ./$(DEPDIR)/socketcall.Po + -rm -f ./$(DEPDIR)/sockopt-sol_netlink.Po + -rm -f ./$(DEPDIR)/sockopt-timestamp.Po + -rm -f ./$(DEPDIR)/splice.Po + -rm -f ./$(DEPDIR)/stack-fcall-0.Po + -rm -f ./$(DEPDIR)/stack-fcall-1.Po + -rm -f ./$(DEPDIR)/stack-fcall-2.Po + -rm -f ./$(DEPDIR)/stack-fcall-3.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-0.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-1.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-2.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-3.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled.Po + -rm -f ./$(DEPDIR)/stack-fcall.Po + -rm -f ./$(DEPDIR)/stat.Po + -rm -f ./$(DEPDIR)/stat64-stat64.Po + -rm -f ./$(DEPDIR)/statfs-statfs.Po + -rm -f ./$(DEPDIR)/statfs64.Po + -rm -f ./$(DEPDIR)/statx.Po + -rm -f ./$(DEPDIR)/swap.Po + -rm -f ./$(DEPDIR)/sxetmask.Po + -rm -f ./$(DEPDIR)/symlink.Po + -rm -f ./$(DEPDIR)/symlinkat.Po + -rm -f ./$(DEPDIR)/sync.Po + -rm -f ./$(DEPDIR)/sync_file_range.Po + -rm -f ./$(DEPDIR)/sync_file_range2.Po + -rm -f ./$(DEPDIR)/sysinfo.Po + -rm -f ./$(DEPDIR)/syslog.Po + -rm -f ./$(DEPDIR)/tee.Po + -rm -f ./$(DEPDIR)/threads-execve.Po + -rm -f ./$(DEPDIR)/time.Po + -rm -f ./$(DEPDIR)/timer_create.Po + -rm -f ./$(DEPDIR)/timer_xettime.Po + -rm -f ./$(DEPDIR)/timerfd_xettime.Po + -rm -f ./$(DEPDIR)/times-fail.Po + -rm -f ./$(DEPDIR)/times.Po + -rm -f ./$(DEPDIR)/truncate.Po + -rm -f ./$(DEPDIR)/truncate64-truncate64.Po + -rm -f ./$(DEPDIR)/ugetrlimit.Po + -rm -f ./$(DEPDIR)/uio-uio.Po + -rm -f ./$(DEPDIR)/umask.Po + -rm -f ./$(DEPDIR)/umount.Po + -rm -f ./$(DEPDIR)/umount2.Po + -rm -f ./$(DEPDIR)/umoven-illptr.Po + -rm -f ./$(DEPDIR)/umovestr-illptr.Po + -rm -f ./$(DEPDIR)/umovestr.Po + -rm -f ./$(DEPDIR)/umovestr2.Po + -rm -f ./$(DEPDIR)/umovestr3.Po + -rm -f ./$(DEPDIR)/uname.Po + -rm -f ./$(DEPDIR)/unblock_reset_raise.Po + -rm -f ./$(DEPDIR)/unix-pair-send-recv.Po + -rm -f ./$(DEPDIR)/unix-pair-sendto-recvfrom.Po + -rm -f ./$(DEPDIR)/unlink.Po + -rm -f ./$(DEPDIR)/unlinkat.Po + -rm -f ./$(DEPDIR)/unshare.Po + -rm -f ./$(DEPDIR)/userfaultfd.Po + -rm -f ./$(DEPDIR)/ustat.Po + -rm -f ./$(DEPDIR)/utime.Po + -rm -f ./$(DEPDIR)/utimensat-Xabbrev.Po + -rm -f ./$(DEPDIR)/utimensat-Xraw.Po + -rm -f ./$(DEPDIR)/utimensat-Xverbose.Po + -rm -f ./$(DEPDIR)/utimensat.Po + -rm -f ./$(DEPDIR)/utimes.Po + -rm -f ./$(DEPDIR)/vfork-f.Po + -rm -f ./$(DEPDIR)/vhangup.Po + -rm -f ./$(DEPDIR)/vmsplice.Po + -rm -f ./$(DEPDIR)/wait4-v.Po + -rm -f ./$(DEPDIR)/wait4.Po + -rm -f ./$(DEPDIR)/waitid-v.Po + -rm -f ./$(DEPDIR)/waitid.Po + -rm -f ./$(DEPDIR)/waitpid.Po + -rm -f ./$(DEPDIR)/xattr-strings.Po + -rm -f ./$(DEPDIR)/xattr.Po + -rm -f ./$(DEPDIR)/xet_robust_list.Po + -rm -f ./$(DEPDIR)/xet_thread_area_x86.Po + -rm -f ./$(DEPDIR)/xetitimer.Po + -rm -f ./$(DEPDIR)/xetpgid.Po + -rm -f ./$(DEPDIR)/xetpriority.Po + -rm -f ./$(DEPDIR)/xettimeofday.Po + -rm -f ./$(DEPDIR)/zeroargc.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -5670,38 +10557,1624 @@ ps-am: uninstall-am: -.MAKE: check-am install-am install-strip +.MAKE: all check check-am install install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am \ - check-valgrind-am check-valgrind-local clean \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \ - cscopelist-am ctags ctags-am distclean distclean-compile \ - distclean-generic distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ + clean-local cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am recheck tags tags-am \ uninstall uninstall-am +.PRECIOUS: Makefile -@VALGRIND_CHECK_RULES@ -ksysent.h: $(srcdir)/ksysent.sed - echo '#include ' | \ - $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -dM - > $@.t1 - LC_COLLATE=C sed -r -n -f $(srcdir)/ksysent.sed < $@.t1 > $@.t2 - mv -f $@.t2 $@ - rm -f $@.t1 +$(srcdir)/_newselect.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ -ksysent.$(OBJEXT): ksysent.h -$(objects): scno.h +$(srcdir)/_newselect-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/accept.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/accept4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/access.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/acct.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/add_key.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/adjtimex.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/aio.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/aio_pgetevents.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/alarm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd-prog.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd-prog-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/btrfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chmod.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chown32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chroot.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock_adjtime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock_nanosleep.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock_xettime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/copy_file_range.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/creat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/delete_module.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dev-yy.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dup.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dup2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dup3.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_create.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_create1.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_ctl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_pwait.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_wait.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/erestartsys.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/execveat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/execveat-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/faccessat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fadvise64_64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fallocate.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_init.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchmod.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchmodat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchown32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchownat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fcntl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fcntl64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fdatasync.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/file_handle.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/file_ioctl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/finit_module.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/flock.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fork-f.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstatat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstatfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstatfs64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fsync.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fsync-y.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ftruncate.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ftruncate64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/futimesat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/get_mempolicy.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getcpu.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getcwd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getdents.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getdents64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getegid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getegid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/geteuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/geteuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgroups.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgroups32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getpeername.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getpgrp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getpid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getppid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getrandom.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getrlimit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getrusage.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getsid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getsockname.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/gettid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getxxid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/group_req.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/inet-cmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/init_module.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/inotify.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/inotify_init1.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/io_uring_enter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/io_uring_register.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/io_uring_setup.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_block.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_dm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_dm-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_evdev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_evdev-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_inotify.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_kvm_run.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_kvm_run-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_kvm_run_auxstr_vcpu.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_loop.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_loop-nv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_loop-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_mtd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_nbd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_nsfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_perf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_ptp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_random.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_rtc.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_rtc-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_scsi.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_sg_io_v3.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_sg_io_v4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_sock_gifconf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_uffdio.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_v4l2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioperm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/iopl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ip_mreq.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msgbuf-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msgbuf-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msgbuf-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kcmp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kcmp-y.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kern_features.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kexec_file_load.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kexec_load.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kill.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lchown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lchown32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/link.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/linkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lookup_dcookie.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lstat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/madvise.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mbind.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/membarrier.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/migrate_pages.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mincore.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mkdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mkdirat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mknod.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mknodat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mlock.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mlock2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mlockall.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg-silent.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg_name.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg_name-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/modify_ldt.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq_sendrecv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq_sendrecv-read.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq_sendrecv-write.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/msg_control.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/msg_control-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/msg_name.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/munlockall.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nanosleep.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-icmp_filter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-sockaddr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-tpacket_req.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-tpacket_stats.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-yy-inet6.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_audit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_crypto.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_generic.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_kobject_uevent.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_netfilter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_protocol.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_route.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_selinux.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_xfrm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/newfstatat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_acct.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_cthelper.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ctnetlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ctnetlink_exp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_cttimeout.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ipset.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_nft_compat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_nftables.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_osf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_queue.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ulog.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_br_port_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_crypto_user_alg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_dcbmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_fib_rule_hdr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifaddrlblmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifaddrmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifinfomsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_af_spec.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_brport.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_linkinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_port.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_xdp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_inet_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_inet_diag_req_compat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_inet_diag_req_v2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_mdba_mdb_entry.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_mdba_router_port.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ndmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ndtmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_netconfmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_netlink_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_nlmsgerr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_packet_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_rtgenmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_rtmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_smc_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tc_stats.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tca_stab.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tcamsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tcmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_unix_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-v-none.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldfstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldlstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect-efault.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect-efault-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/open.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/openat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/orphaned_process_group.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/osf_utimes.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pause.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/perf_event_open.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/perf_event_open_nonverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/perf_event_open_unabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/personality-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/personality-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/personality-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pidfd_send_signal.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pipe2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pkey_alloc.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pkey_free.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pkey_mprotect.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ppoll.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ppoll-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ppoll-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pread64-pwrite64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/preadv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/preadv-pwritev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/preadv2-pwritev2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printpath-umovestr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printpath-umovestr-peekdata.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printpath-umovestr-undumpable.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printsignal-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printsignal-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printsignal-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstrn-umoven.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstrn-umoven-peekdata.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstrn-umoven-undumpable.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/prlimit64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/process_vm_readv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/process_vm_writev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pselect6.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ptrace.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ptrace_syscall_info.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pwritev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-xfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-xfs-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/read-write.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readahead.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readlinkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/reboot.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/recvfrom.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/recvmmsg-timeout.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/recvmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/regex.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rename.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/renameat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/renameat2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/request_key.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/riscv_flush_icache.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rmdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigpending.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigprocmask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigqueueinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigreturn.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigsuspend.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigtimedwait.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_tgsigqueueinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_guarded_storage.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_guarded_storage-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_pci_mmio_read_write.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_runtime_instr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_sthyi.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_sthyi-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_get_priority_mxx.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_rr_get_interval.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetaffinity.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetattr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetparam.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetscheduler.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_yield.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/seccomp-filter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/seccomp-filter-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/seccomp_get_action_avail.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/select.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/select-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/semop.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sendfile.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sendfile64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/set_mempolicy.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setdomainname.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgroups.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgroups32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sethostname.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setns.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setregid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setregid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setreuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setreuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/shmxt.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/shutdown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigaction.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/siginfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/signal.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/signal_receive.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/signalfd4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigpending.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigprocmask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigreturn.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigsuspend.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_error.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_linger.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockaddr_xlat-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockaddr_xlat-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockaddr_xlat-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/socketcall.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockopt-sol_netlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockopt-timestamp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/splice.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/stat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/stat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/statfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/statfs64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/statx.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/swap.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sxetmask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/symlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/symlinkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sync.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sync_file_range.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sync_file_range2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sysinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/syslog.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/tee.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/time.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/timer_create.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/timer_xettime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/timerfd_xettime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/times.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/times-fail.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_fstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_fstatfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_lstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_regex_32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_regex_64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_regex_x32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_x32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_question.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_stat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_stat_like.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_statfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_statfs_like.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/truncate.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/truncate64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ugetrlimit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umoven-illptr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umovestr-illptr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umovestr3.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/unlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/unlinkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/unshare.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/userfaultfd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ustat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimes.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/vfork-f.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/vhangup.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/vmsplice.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/wait4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/wait4-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/waitid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/waitid-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/waitpid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xattr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xattr-strings.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xet_robust_list.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xetitimer.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xetpgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xetpriority.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xettimeofday.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +@VALGRIND_CHECK_RULES@ + +ksysent.h: $(srcdir)/ksysent.sed + echo '#include ' | \ + $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -dM - > $@.t1 + LC_COLLATE=C sed -r -n -f $(srcdir)/ksysent.sed < $@.t1 > $@.t2 + mv -f $@.t2 $@ + rm -f $@.t1 + +ksysent.$(OBJEXT): ksysent.h +$(objects): scno.h + +clean-local: clean-local-check +.PHONY: clean-local-check +clean-local-check: + -rm -rf -- $(TESTS:.test=.dir) $(GEN_TESTS:.gen.test=.dir) + +.PHONY: check-valgrind-local +check-valgrind-local: $(check_LIBRARIES) $(check_PROGRAMS) -syscallent.i: $(top_srcdir)/$(OS)/$(ARCH)/syscallent.h - $(CPP) -P $(SCNO_CPPFLAGS) $^ -o $@ +syscallent.i: $(top_builddir)/config.h $(top_srcdir)/$(OS)/$(ARCH)/syscallent.h + $(CPP) -P $(SCNO_CPPFLAGS) -include $^ -o $@ scno.h: $(top_srcdir)/scno.head syscallent.i echo '/* Generated by Makefile from $^; do not edit. */' > $@-t diff --git a/tests-mx32/PTRACE_SEIZE.sh b/tests-mx32/PTRACE_SEIZE.sh new file mode 100755 index 00000000..9ffe4c78 --- /dev/null +++ b/tests-mx32/PTRACE_SEIZE.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# +# Skip the test if PTRACE_SEIZE is not supported. +# +# Copyright (c) 2014-2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +$STRACE -d -enone / > /dev/null 2> "$LOG" ||: +if grep -x "[^:]*strace: PTRACE_SEIZE doesn't work" "$LOG" > /dev/null; then + skip_ "PTRACE_SEIZE doesn't work" +fi diff --git a/tests-mx32/_newselect-P.c b/tests-mx32/_newselect-P.c new file mode 100644 index 00000000..561fbfe2 --- /dev/null +++ b/tests-mx32/_newselect-P.c @@ -0,0 +1,2 @@ +#define PATH_TRACING_FD 9 +#include "_newselect.c" diff --git a/tests-mx32/_newselect-P.gen.test b/tests-mx32/_newselect-P.gen.test new file mode 100755 index 00000000..9c4247a1 --- /dev/null +++ b/tests-mx32/_newselect-P.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (_newselect-P -e trace=_newselect -P /dev/full 9>>/dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=_newselect -P /dev/full 9>>/dev/full diff --git a/tests-mx32/_newselect.c b/tests-mx32/_newselect.c index ae2bc51a..bfba2edb 100644 --- a/tests-mx32/_newselect.c +++ b/tests-mx32/_newselect.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/_newselect.gen.test b/tests-mx32/_newselect.gen.test new file mode 100755 index 00000000..8e4d5f24 --- /dev/null +++ b/tests-mx32/_newselect.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (_newselect ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/_newselect.test b/tests-mx32/_newselect.test deleted file mode 100755 index 3371d4db..00000000 --- a/tests-mx32/_newselect.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check _newselect syscall decoding. - -. "${srcdir=.}/select.test" diff --git a/tests-mx32/accept.c b/tests-mx32/accept.c index 8d42ba15..df5dee80 100644 --- a/tests-mx32/accept.c +++ b/tests-mx32/accept.c @@ -2,34 +2,40 @@ * Check decoding of accept syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ -#ifndef TEST_SYSCALL_NAME -# define TEST_SYSCALL_NAME accept -#endif +#include "tests.h" + +#include + +#include + +#if defined __NR_accept + +# ifndef TEST_SYSCALL_NAME +# define TEST_SYSCALL_NAME do_accept + +# ifndef TEST_SYSCALL_STR +# define TEST_SYSCALL_STR "accept" +# endif + +int do_accept(int sockfd, void *addr, void *addrlen) +{ + return syscall(__NR_accept, sockfd, addr, addrlen); +} +# endif /* !TEST_SYSCALL_NAME */ + +#else /* !__NR_accept */ + +# ifndef TEST_SYSCALL_NAME +# define TEST_SYSCALL_NAME accept +# endif + +#endif /* __NR_accept */ #define TEST_SYSCALL_PREPARE connect_un() static void connect_un(void); diff --git a/tests-mx32/accept.gen.test b/tests-mx32/accept.gen.test new file mode 100755 index 00000000..45d9239e --- /dev/null +++ b/tests-mx32/accept.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (accept -a22 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests-mx32/accept.test b/tests-mx32/accept.test deleted file mode 100755 index b5e07904..00000000 --- a/tests-mx32/accept.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of accept syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a22 diff --git a/tests-mx32/accept4.c b/tests-mx32/accept4.c index d26e15c5..692b7661 100644 --- a/tests-mx32/accept4.c +++ b/tests-mx32/accept4.c @@ -1,30 +1,10 @@ /* * Check decoding of accept4 syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/accept4.gen.test b/tests-mx32/accept4.gen.test new file mode 100755 index 00000000..71199703 --- /dev/null +++ b/tests-mx32/accept4.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (accept4 -a37 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a37 diff --git a/tests-mx32/accept4.test b/tests-mx32/accept4.test deleted file mode 100755 index 722f25a5..00000000 --- a/tests-mx32/accept4.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of accept4 syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a37 diff --git a/tests-mx32/accept_compat.h b/tests-mx32/accept_compat.h new file mode 100644 index 00000000..0fbdc690 --- /dev/null +++ b/tests-mx32/accept_compat.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef _STRACE_TESTS_ACCEPT_COMPAT_H_ +# define _STRACE_TESTS_ACCEPT_COMPAT_H_ + +# include +# include +# include + +# if defined __NR_socketcall && defined __sparc__ +/* + * Work around the fact that + * - glibc >= 2.26 uses accept4 syscall to implement accept() call on sparc; + * - accept syscall had not been wired up on sparc until v4.4-rc8~4^2~1. + */ +static inline int +do_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen) +{ + const long args[] = { sockfd, (long) addr, (long) addrlen }; + + return syscall(__NR_socketcall, 5, args); +} +# else +# define do_accept accept +# endif + +#endif /* !_STRACE_TESTS_ACCEPT_COMPAT_H_ */ diff --git a/tests-mx32/access.c b/tests-mx32/access.c index e6f169b2..cbdde6a2 100644 --- a/tests-mx32/access.c +++ b/tests-mx32/access.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -19,6 +26,7 @@ main(void) printf("access(\"%s\", R_OK|W_OK|X_OK) = %ld %s (%m)\n", sample, rc, errno2name()); + puts("+++ exited with 0 +++"); return 0; } diff --git a/tests-mx32/access.gen.test b/tests-mx32/access.gen.test new file mode 100755 index 00000000..7d80e6f8 --- /dev/null +++ b/tests-mx32/access.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (access -a30 -P access_sample); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 -P access_sample diff --git a/tests-mx32/access.test b/tests-mx32/access.test deleted file mode 100755 index 3ab2eb4b..00000000 --- a/tests-mx32/access.test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -# Check access syscall decoding. - -. "${srcdir=.}/init.sh" - -check_prog grep -run_prog > /dev/null -run_strace -eaccess -a30 $args > "$EXP" - -# Filter out access() calls made by libc. -grep -F access_sample < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/acct.c b/tests-mx32/acct.c index 1cc3fa56..2127df60 100644 --- a/tests-mx32/acct.c +++ b/tests-mx32/acct.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/acct.gen.test b/tests-mx32/acct.gen.test new file mode 100755 index 00000000..4a98dd46 --- /dev/null +++ b/tests-mx32/acct.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (acct -a20 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-mx32/acct.test b/tests-mx32/acct.test deleted file mode 100755 index b9bca754..00000000 --- a/tests-mx32/acct.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check acct syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 diff --git a/tests-mx32/add_key.c b/tests-mx32/add_key.c index d2696f9b..c1014927 100644 --- a/tests-mx32/add_key.c +++ b/tests-mx32/add_key.c @@ -2,29 +2,10 @@ * Check decoding of add_key syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -70,8 +51,7 @@ main(void) { static const char unterminated1[] = { '\1', '\2', '\3', '\4', '\5' }; static const char unterminated2[] = { '\6', '\7', '\10', '\11', '\12' }; - static const char unterminated3[] = - { '\16', '\17', '\20', '\21', '\22' }; + static const char unterminated3[] = { '\16', '\17', '\20', '\21', '\22' }; char *bogus_type = tail_memdup(unterminated1, sizeof(unterminated1)); char *bogus_desc = tail_memdup(unterminated2, sizeof(unterminated2)); @@ -102,7 +82,7 @@ main(void) { bogus_desc, NULL }, { ARG_STR("\25\26\27\30\31") }, { ARG_STR("desc") }, - { "overly long description", _STR("overly long ") "..." }, + { "overly long description", STRINGIFY("overly long ") "..." }, }; struct { @@ -113,10 +93,10 @@ main(void) { ARG_STR(NULL), 0 }, { bogus_payload + sizeof(unterminated3), NULL, (size_t) 0xdeadbeefbadc0dedULL }, - { bogus_payload, _STR(""), 0 }, - { bogus_payload, _STR("\16\17\20\21\22"), 5 }, + { bogus_payload, STRINGIFY(""), 0 }, + { bogus_payload, STRINGIFY("\16\17\20\21\22"), 5 }, { bogus_payload, NULL, 10 }, - { "overly long payload", _STR("overly long ") "...", 15 }, + { "overly long payload", STRINGIFY("overly long ") "...", 15 }, }; struct { diff --git a/tests-mx32/add_key.gen.test b/tests-mx32/add_key.gen.test new file mode 100755 index 00000000..d6ffbc86 --- /dev/null +++ b/tests-mx32/add_key.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (add_key -a30 -s12); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 -s12 diff --git a/tests-mx32/add_key.test b/tests-mx32/add_key.test deleted file mode 100755 index eadd8c2b..00000000 --- a/tests-mx32/add_key.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of add_key syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a30 -s12 diff --git a/tests-mx32/adjtimex.c b/tests-mx32/adjtimex.c index 1638b535..87d3acdc 100644 --- a/tests-mx32/adjtimex.c +++ b/tests-mx32/adjtimex.c @@ -1,70 +1,56 @@ /* * This file is part of adjtimex strace test. * - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2019 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" +#include #include #include #include #include +#include "xlat.h" +#include "xlat/adjtimex_state.h" +#include "xlat/adjtimex_status.h" + int main(void) { - adjtimex(NULL); - printf("adjtimex\\(NULL\\) = -1 EFAULT \\(%m\\)\n"); + int state = adjtimex(NULL); + printf("adjtimex(NULL) = %s\n", sprintrc(state)); - struct timex * const tx = tail_alloc(sizeof(*tx)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timex, tx); memset(tx, 0, sizeof(*tx)); - int state = adjtimex(tx); + state = adjtimex(tx); if (state < 0) perror_msg_and_skip("adjtimex"); - printf("adjtimex\\(\\{modes=0, offset=%jd, freq=%jd, maxerror=%jd" - ", esterror=%jd, status=%s, constant=%jd, precision=%jd" - ", tolerance=%jd, time=\\{tv_sec=%jd, tv_usec=%jd\\}, tick=%jd, " - "ppsfreq=%jd, jitter=%jd, shift=%d, stabil=%jd, jitcnt=%jd, " - "calcnt=%jd, errcnt=%jd, stbcnt=%jd" -#ifdef HAVE_STRUCT_TIMEX_TAI - ", tai=%d" -#endif - "\\}\\) = %d \\(TIME_[A-Z]+\\)\n", + printf("adjtimex({modes=0, offset=%jd, freq=%jd, maxerror=%jd" + ", esterror=%jd, status=", (intmax_t) tx->offset, (intmax_t) tx->freq, (intmax_t) tx->maxerror, - (intmax_t) tx->esterror, - tx->status ? "STA_[A-Z]+(\\|STA_[A-Z]+)*" : "0", + (intmax_t) tx->esterror); + if (tx->status) + printflags(adjtimex_status, (unsigned int) tx->status, NULL); + else + putchar('0'); + printf(", constant=%jd, precision=%jd" + ", tolerance=%jd, time={tv_sec=%lld, tv_usec=%llu}, tick=%jd" + ", ppsfreq=%jd, jitter=%jd, shift=%d, stabil=%jd, jitcnt=%jd" + ", calcnt=%jd, errcnt=%jd, stbcnt=%jd, tai=%d" + "}) = %d (", (intmax_t) tx->constant, (intmax_t) tx->precision, (intmax_t) tx->tolerance, - (intmax_t) tx->time.tv_sec, - (intmax_t) tx->time.tv_usec, + (long long) tx->time.tv_sec, + zero_extend_signed_to_ull(tx->time.tv_usec), (intmax_t) tx->tick, (intmax_t) tx->ppsfreq, (intmax_t) tx->jitter, @@ -76,8 +62,13 @@ main(void) (intmax_t) tx->stbcnt, #ifdef HAVE_STRUCT_TIMEX_TAI tx->tai, +#else + *(const int *)((const void *) tx + offsetofend(struct timex, stbcnt)), #endif state); + printxval(adjtimex_state, (unsigned int) state, NULL); + puts(")"); + puts("+++ exited with 0 +++"); return 0; } diff --git a/tests-mx32/adjtimex.gen.test b/tests-mx32/adjtimex.gen.test new file mode 100755 index 00000000..e6024431 --- /dev/null +++ b/tests-mx32/adjtimex.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (adjtimex -a15 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests-mx32/adjtimex.test b/tests-mx32/adjtimex.test deleted file mode 100755 index 01405501..00000000 --- a/tests-mx32/adjtimex.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check adjtimex syscall decoding. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a 15 -e adjtimex $args > "$OUT" -match_grep "$LOG" "$OUT" -rm -f "$OUT" - -exit 0 diff --git a/tests-mx32/aio.c b/tests-mx32/aio.c index 0766d23a..13821998 100644 --- a/tests-mx32/aio.c +++ b/tests-mx32/aio.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -198,15 +179,14 @@ main(void) }; const long *cbvs2 = tail_memdup(proto_cbvs2, sizeof(proto_cbvs2)); - unsigned long *ctx = tail_alloc(sizeof(unsigned long)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned long, ctx); *ctx = 0; const unsigned int nr = ARRAY_SIZE(proto_cb); const unsigned long lnr = (unsigned long) (0xdeadbeef00000000ULL | nr); const struct io_event *ev = tail_alloc(nr * sizeof(struct io_event)); - const struct timespec proto_ts = { .tv_nsec = 123456789 }; - const struct timespec *ts = tail_memdup(&proto_ts, sizeof(proto_ts)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, ts); (void) close(0); if (open("/dev/zero", O_RDONLY)) @@ -239,11 +219,12 @@ main(void) if (rc != (long) nr) perror_msg_and_skip("io_submit"); printf("io_submit(%#lx, %u, [" - "{data=%#" PRI__x64 ", pread, reqprio=11, fildes=0, " - "buf=%p, nbytes=%u, offset=%" PRI__d64 "}, " - "{data=%#" PRI__x64 ", pread, reqprio=22, fildes=0, " - "buf=%p, nbytes=%u, offset=%" PRI__d64 "}" - "]) = %s\n", + "{aio_data=%#" PRI__x64 ", aio_lio_opcode=IOCB_CMD_PREAD" + ", aio_reqprio=11, aio_fildes=0, aio_buf=%p, aio_nbytes=%u" + ", aio_offset=%" PRI__d64 + "}, {aio_data=%#" PRI__x64 ", aio_lio_opcode=IOCB_CMD_PREAD" + ", aio_reqprio=22, aio_fildes=0, aio_buf=%p, aio_nbytes=%u" + ", aio_offset=%" PRI__d64 "}]) = %s\n", *ctx, nr, cb[0].aio_data, data0, sizeof_data0, cb[0].aio_offset, cb[1].aio_data, data1, sizeof_data1, cb[1].aio_offset, @@ -263,6 +244,24 @@ main(void) bogus_ctx, (long) 0xca7faceddeadf00dLL, (long) 0xba5e1e505ca571e0LL, ts + 1, sprintrc(rc)); + ts->tv_sec = 0xdeadbeefU; + ts->tv_nsec = 0xfacefeedU; + rc = syscall(__NR_io_getevents, bogus_ctx, 0, 0, 0, ts); + printf("io_getevents(%#lx, 0, 0, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + bogus_ctx, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), sprintrc(rc)); + + ts->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + ts->tv_nsec = (long) 0xbadc0dedfacefeedLL; + rc = syscall(__NR_io_getevents, bogus_ctx, 0, 0, 0, ts); + printf("io_getevents(%#lx, 0, 0, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + bogus_ctx, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), sprintrc(rc)); + + ts->tv_sec = 0; + ts->tv_nsec = 123456789; rc = syscall(__NR_io_getevents, *ctx, nr, nr + 1, ev, ts); printf("io_getevents(%#lx, %ld, %ld, [" "{data=%#" PRI__x64 ", obj=%p, res=%u, res2=0}, " @@ -281,8 +280,9 @@ main(void) sprintrc(rc)); rc = syscall(__NR_io_cancel, *ctx, cbc, ev); - printf("io_cancel(%#lx, {data=%#" PRI__x64 - ", pread, reqprio=99, fildes=-42}, %p) = %s\n", + printf("io_cancel(%#lx, {aio_data=%#" PRI__x64 + ", aio_lio_opcode=IOCB_CMD_PREAD, aio_reqprio=99" + ", aio_fildes=-42}, %p) = %s\n", *ctx, cbc->aio_data, ev, sprintrc(rc)); rc = syscall(__NR_io_submit, (unsigned long) 0xfacef157beeff00dULL, @@ -295,23 +295,26 @@ main(void) printf("io_submit(%#lx, %ld, %p) = %s\n", *ctx, -1L, cbvs + nr, sprintrc(rc)); - rc = syscall(__NR_io_submit, *ctx, 1057L, cbvs2); printf("io_submit(%#lx, %ld, [" - "{data=%#" PRI__x64 ", key=%u, %hu /* SUB_??? */, fildes=%d}, " - "{key=%u, pwrite, reqprio=%hd, fildes=%d, str=NULL" - ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 + "{aio_data=%#" PRI__x64 ", aio_key=%u" + ", aio_lio_opcode=%hu /* IOCB_CMD_??? */, aio_fildes=%d}" + ", {aio_key=%u, aio_lio_opcode=IOCB_CMD_PWRITE, aio_reqprio=%hd" + ", aio_fildes=%d, aio_buf=NULL" + ", aio_nbytes=%" PRI__u64 ", aio_offset=%" PRI__d64 # ifdef IOCB_FLAG_RESFD - ", resfd=%d, flags=%#x" + ", aio_resfd=%d, aio_flags=%#x" # endif - "}, " - "{key=%u, pwrite, reqprio=%hd, fildes=%d, buf=%#" PRI__x64 - ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}, " - "{key=%u, pwrite, reqprio=%hd, fildes=%d" - ", str=\"\\0\\1\\2\\3%.28s\"..." - ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}, " - "{key=%u, pwritev, reqprio=%hd, fildes=%d, buf=%#" PRI__x64 - ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}" - ", {NULL}, {%#lx}, %p]) = %s\n", + "}, {aio_key=%u, aio_lio_opcode=IOCB_CMD_PWRITE" + ", aio_reqprio=%hd, aio_fildes=%d, aio_buf=%#" PRI__x64 + ", aio_nbytes=%" PRI__u64 ", aio_offset=%" PRI__d64 + "}, {aio_key=%u, aio_lio_opcode=IOCB_CMD_PWRITE" + ", aio_reqprio=%hd, aio_fildes=%d" + ", aio_buf=\"\\0\\1\\2\\3%.28s\"..." + ", aio_nbytes=%" PRI__u64 ", aio_offset=%" PRI__d64 + "}, {aio_key=%u, aio_lio_opcode=IOCB_CMD_PWRITEV" + ", aio_reqprio=%hd, aio_fildes=%d, aio_buf=%#" PRI__x64 + ", aio_nbytes=%" PRI__u64 ", aio_offset=%" PRI__d64 + "}, NULL, %#lx, ... /* %p */]) = ", *ctx, 1057L, cbv2[0].aio_data, cbv2[0].aio_key, cbv2[0].aio_lio_opcode, cbv2[0].aio_fildes, @@ -326,18 +329,22 @@ main(void) data2 + 4, cbv2[3].aio_nbytes, cbv2[3].aio_offset, cbv2[4].aio_key, cbv2[4].aio_reqprio, cbv2[4].aio_fildes, cbv2[4].aio_buf, cbv2[4].aio_nbytes, cbv2[4].aio_offset, - cbvs2[6], cbvs2 + 7, sprintrc(rc)); + cbvs2[6], cbvs2 + 7); + rc = syscall(__NR_io_submit, *ctx, 1057L, cbvs2); + puts(sprintrc(rc)); rc = syscall(__NR_io_submit, *ctx, nr, cbvs); if (rc != (long) nr) perror_msg_and_skip("io_submit"); printf("io_submit(%#lx, %u, [" - "{data=%#" PRI__x64 ", preadv, reqprio=%hd, fildes=0, " - "iovec=[{iov_base=%p, iov_len=%u}" - ", {iov_base=%p, iov_len=%u}], offset=%" PRI__d64 "}, " - "{data=%#" PRI__x64 ", preadv, reqprio=%hd, fildes=0, " - "iovec=[{iov_base=%p, iov_len=%u}" - ", {iov_base=%p, iov_len=%u}], offset=%" PRI__d64 "}" + "{aio_data=%#" PRI__x64 ", aio_lio_opcode=IOCB_CMD_PREADV" + ", aio_reqprio=%hd, aio_fildes=0, " + "aio_buf=[{iov_base=%p, iov_len=%u}" + ", {iov_base=%p, iov_len=%u}], aio_offset=%" PRI__d64 "}, " + "{aio_data=%#" PRI__x64 ", aio_lio_opcode=IOCB_CMD_PREADV" + ", aio_reqprio=%hd, aio_fildes=0" + ", aio_buf=[{iov_base=%p, iov_len=%u}" + ", {iov_base=%p, iov_len=%u}], aio_offset=%" PRI__d64 "}" "]) = %s\n", *ctx, nr, cbv[0].aio_data, cbv[0].aio_reqprio, diff --git a/tests-mx32/aio.gen.test b/tests-mx32/aio.gen.test new file mode 100755 index 00000000..8c8cbd5c --- /dev/null +++ b/tests-mx32/aio.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (aio -a14 -e trace=io_setup,io_submit,io_getevents,io_cancel,io_destroy); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 -e trace=io_setup,io_submit,io_getevents,io_cancel,io_destroy diff --git a/tests-mx32/aio.test b/tests-mx32/aio.test deleted file mode 100755 index 2ba90da8..00000000 --- a/tests-mx32/aio.test +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -# Check io_* syscalls decoding. - -. "${srcdir=.}/init.sh" - -syscalls=io_setup,io_submit,io_getevents,io_cancel,io_destroy -run_strace_match_diff -a14 -e trace=$syscalls diff --git a/tests-mx32/aio_pgetevents.c b/tests-mx32/aio_pgetevents.c new file mode 100644 index 00000000..8bea0b7b --- /dev/null +++ b/tests-mx32/aio_pgetevents.c @@ -0,0 +1,170 @@ +/* + * Check decoding of io_pgetevents syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include "scno.h" + +#if defined __NR_io_setup && defined __NR_io_pgetevents + +# include +# include +# include +# include + +# include "nsig.h" + +# include + +# if !HAVE_STRUCT___AIO_SIGSET +struct __aio_sigset { + sigset_t *sigmask; + size_t sigsetsize; +}; +# endif + +static const char *errstr; + +static long +sys_io_pgetevents(const kernel_ulong_t ctx_id, + const kernel_long_t min_nr, + const kernel_long_t nr, + const kernel_ulong_t events, + const kernel_ulong_t timeout, + const kernel_ulong_t usig) +{ + long rc = syscall(__NR_io_pgetevents, ctx_id, min_nr, nr, + events, timeout, usig); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const kernel_ulong_t bogus_ctx = + (kernel_ulong_t) 0xface1e55deadbeefLL; + static const kernel_long_t bogus_min_nr = + (kernel_long_t) 0xca7faceddeadf00dLL; + static const kernel_long_t bogus_nr = + (kernel_long_t) 0xba5e1e505ca571e0LL; + static const size_t bogus_sigsetsize = + (size_t) 0xdeadbeefbadcaffeULL; + + const unsigned int sizeof_data0 = 4096; + const unsigned int sizeof_data1 = 8192; + void *data0 = tail_alloc(sizeof_data0); + void *data1 = tail_alloc(sizeof_data1); + + const struct iocb proto_cb[] = { + { + .aio_data = (unsigned long) 0xfeedface11111111ULL, + .aio_reqprio = 11, + .aio_buf = (unsigned long) data0, + .aio_offset = (unsigned long) 0xdeface1facefeedULL, + .aio_nbytes = sizeof_data0 + }, + { + .aio_data = (unsigned long) 0xfeedface22222222ULL, + .aio_reqprio = 22, + .aio_buf = (unsigned long) data1, + .aio_offset = (unsigned long) 0xdeface2cafef00dULL, + .aio_nbytes = sizeof_data1 + } + }; + const struct iocb *cb = tail_memdup(proto_cb, sizeof(proto_cb)); + + const long proto_cbs[] = { + (long) &cb[0], (long) &cb[1] + }; + const long *cbs = tail_memdup(proto_cbs, sizeof(proto_cbs)); + + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned long, ctx); + *ctx = 0; + + const unsigned int nr = ARRAY_SIZE(proto_cb); + + const struct io_event *ev = tail_alloc(nr * sizeof(struct io_event)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, ts); + TAIL_ALLOC_OBJECT_CONST_PTR(struct __aio_sigset, ss); + TAIL_ALLOC_OBJECT_CONST_PTR(sigset_t, sigs); + + (void) close(0); + if (open("/dev/zero", O_RDONLY)) + perror_msg_and_skip("open: %s", "/dev/zero"); + + if (syscall(__NR_io_setup, nr, ctx)) + perror_msg_and_skip("io_setup"); + + if (syscall(__NR_io_submit, *ctx, nr, cbs) != (long) nr) + perror_msg_and_skip("io_submit"); + + sys_io_pgetevents(bogus_ctx, bogus_min_nr, bogus_nr, + (uintptr_t) (ev + 1), 0, 0); + printf("io_pgetevents(%#jx, %ld, %ld, %p, NULL, NULL) = %s\n", + (uintmax_t) bogus_ctx, (long) bogus_min_nr, + (long) bogus_nr, ev + 1, errstr); + + sys_io_pgetevents(bogus_ctx, bogus_min_nr, bogus_nr, + 0, (uintptr_t) (ts + 1), 0); + printf("io_pgetevents(%#jx, %ld, %ld, NULL, %p, NULL) = %s\n", + (uintmax_t) bogus_ctx, (long) bogus_min_nr, + (long) bogus_nr, ts + 1, errstr); + + sys_io_pgetevents(bogus_ctx, bogus_min_nr, bogus_nr, + 0, 0, (uintptr_t) (ss + 1)); + printf("io_pgetevents(%#jx, %ld, %ld, NULL, NULL, %p) = %s\n", + (uintmax_t) bogus_ctx, (long) bogus_min_nr, + (long) bogus_nr, ss + 1, errstr); + + ss->sigmask = sigs + 1; + ss->sigsetsize = bogus_sigsetsize; + sys_io_pgetevents(bogus_ctx, bogus_min_nr, bogus_nr, + 0, 0, (uintptr_t) ss); + printf("io_pgetevents(%#jx, %ld, %ld, NULL, NULL" + ", {sigmask=%p, sigsetsize=%zu}) = %s\n", + (uintmax_t) bogus_ctx, (long) bogus_min_nr, + (long) bogus_nr, sigs + 1, bogus_sigsetsize, errstr); + + ts->tv_sec = 0xdeadbeefU; + ts->tv_nsec = 0xfacefeedU; + ss->sigmask = sigs; + ss->sigsetsize = NSIG_BYTES; + sys_io_pgetevents(bogus_ctx, 0, 0, 0, (uintptr_t) ts, (uintptr_t) ss); + printf("io_pgetevents(%#jx, 0, 0, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}" + ", {sigmask=~[], sigsetsize=%u}) = %s\n", + (uintmax_t) bogus_ctx, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), NSIG_BYTES, + errstr); + + sigemptyset(sigs); + sigaddset(sigs, SIGSYS); + + ts->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + ts->tv_nsec = (long) 0xbadc0dedfacefeedLL; + sys_io_pgetevents(bogus_ctx, 0, 0, 0, (uintptr_t) ts, (uintptr_t) ss); + printf("io_pgetevents(%#jx, 0, 0, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}" + ", {sigmask=[SYS], sigsetsize=%u}) = %s\n", + (uintmax_t) bogus_ctx, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), NSIG_BYTES, + errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_io_setup && __NR_io_pgetevents") + +#endif diff --git a/tests-mx32/aio_pgetevents.gen.test b/tests-mx32/aio_pgetevents.gen.test new file mode 100755 index 00000000..7ea3874d --- /dev/null +++ b/tests-mx32/aio_pgetevents.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (aio_pgetevents -e trace=io_pgetevents); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=io_pgetevents diff --git a/tests-mx32/alarm.c b/tests-mx32/alarm.c index 291b26ad..35404535 100644 --- a/tests-mx32/alarm.c +++ b/tests-mx32/alarm.c @@ -1,30 +1,10 @@ /* * This file is part of alarm strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/alarm.gen.test b/tests-mx32/alarm.gen.test new file mode 100755 index 00000000..25982e14 --- /dev/null +++ b/tests-mx32/alarm.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (alarm -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-mx32/alarm.test b/tests-mx32/alarm.test deleted file mode 100755 index 267b2239..00000000 --- a/tests-mx32/alarm.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check alarm syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 diff --git a/tests-mx32/answer.c b/tests-mx32/answer.c index ae3059a4..a69adc39 100644 --- a/tests-mx32/answer.c +++ b/tests-mx32/answer.c @@ -1,30 +1,10 @@ /* * Check decoding of fault injected exit_group syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/attach-f-p-cmd.c b/tests-mx32/attach-f-p-cmd.c index 77594beb..ab293839 100644 --- a/tests-mx32/attach-f-p-cmd.c +++ b/tests-mx32/attach-f-p-cmd.c @@ -2,29 +2,10 @@ * This file is part of attach-f-p strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -34,6 +15,8 @@ int main(void) { + skip_if_unavailable("/proc/self/task/"); + static const char dir[] = "attach-f-p.test cmd"; pid_t pid = getpid(); int rc = chdir(dir); diff --git a/tests-mx32/attach-f-p.c b/tests-mx32/attach-f-p.c index 3f9a7e3e..3b7aed85 100644 --- a/tests-mx32/attach-f-p.c +++ b/tests-mx32/attach-f-p.c @@ -1,30 +1,10 @@ /* * This file is part of attach-f-p strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/attach-f-p.test b/tests-mx32/attach-f-p.test index f4170740..b7a4a0d1 100755 --- a/tests-mx32/attach-f-p.test +++ b/tests-mx32/attach-f-p.test @@ -3,48 +3,24 @@ # Check that -f -p attaches to threads properly. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -# strace -f -p is implemented using /proc/$pid/task/ -[ -d /proc/self/task/ ] || - framework_skip_ '/proc/self/task/ is not available' run_prog_skip_if_failed \ kill -0 $$ -run_prog ./attach-f-p-cmd > /dev/null +run_prog ../attach-f-p-cmd > /dev/null -rm -f "$OUT" -./set_ptracer_any sh -c "exec ./attach-f-p >> $OUT" > /dev/null & +../set_ptracer_any sh -c "exec ../attach-f-p >> $EXP" > /dev/null & tracee_pid=$! -while ! [ -s "$OUT" ]; do +while ! [ -s "$EXP" ]; do kill -0 $tracee_pid 2> /dev/null || fail_ 'set_ptracer_any sh failed' done -run_strace -a32 -f -echdir -p $tracee_pid ./attach-f-p-cmd > "$OUT" -match_diff "$LOG" "$OUT" -rm -f "$OUT" +run_strace -a32 -f -echdir -p $tracee_pid ../attach-f-p-cmd > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests-mx32/attach-p-cmd-cmd.c b/tests-mx32/attach-p-cmd-cmd.c index d0f824e9..aa0f3f58 100644 --- a/tests-mx32/attach-p-cmd-cmd.c +++ b/tests-mx32/attach-p-cmd-cmd.c @@ -1,30 +1,10 @@ /* * This file is part of attach-p-cmd strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,19 +12,41 @@ #include #include #include +#include "attach-p-cmd.h" -int -main(void) +static void +write_pidfile(const pid_t pid) +{ + FILE *fp = fopen(pidfile, "w"); + if (!fp) + perror_msg_and_fail("fopen: %s", pidfile); + + if (fprintf(fp, "%d", pid) < 0) + perror_msg_and_fail("fprintf: %s", pidfile); + + if (fclose(fp)) + perror_msg_and_fail("fclose: %s", pidfile); +} + +static void +wait_for_peer_invocation(void) { - static const char lockdir[] = "attach-p-cmd.test-lock"; /* wait for the lock directory to be created by peer */ while (rmdir(lockdir)) { if (ENOENT != errno) perror_msg_and_fail("rmdir: %s", lockdir); } +} + +int +main(void) +{ + const pid_t pid = getpid(); + write_pidfile(pid); + + wait_for_peer_invocation(); static const char dir[] = "attach-p-cmd.test cmd"; - pid_t pid = getpid(); int rc = chdir(dir); printf("%-5d chdir(\"%s\") = %s\n" diff --git a/tests-mx32/attach-p-cmd-p.c b/tests-mx32/attach-p-cmd-p.c index 254d19ae..5fde01e2 100644 --- a/tests-mx32/attach-p-cmd-p.c +++ b/tests-mx32/attach-p-cmd-p.c @@ -1,30 +1,10 @@ /* * This file is part of attach-p-cmd strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -33,27 +13,14 @@ #include #include #include +#include #include +#include "attach-p-cmd.h" static void -handler(int signo) -{ -} - -int -main(void) +wait_for_peer_invocation(void) { - const struct sigaction act = { .sa_handler = handler }; - if (sigaction(SIGALRM, &act, NULL)) - perror_msg_and_fail("sigaction"); - - sigset_t mask = {}; - sigaddset(&mask, SIGALRM); - if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) - perror_msg_and_fail("sigprocmask"); - - static const char lockdir[] = "attach-p-cmd.test-lock"; - /* create a lock directory */ + /* create the lock directory */ if (mkdir(lockdir, 0700)) perror_msg_and_fail("mkdir: %s", lockdir); @@ -63,21 +30,51 @@ main(void) perror_msg_and_fail("mkdir: %s", lockdir); } - /* remove the lock directory */ + /* cleanup the lock directory */ if (rmdir(lockdir)) perror_msg_and_fail("rmdir: %s", lockdir); +} + +static void +wait_for_peer_termination(void) +{ + FILE *fp = fopen(pidfile, "r"); + if (!fp) + perror_msg_and_fail("fopen: %s", pidfile); + + pid_t pid; + if (fscanf(fp, "%d", &pid) < 0) + perror_msg_and_fail("fscanf: %s", pidfile); + if (pid < 0) + error_msg_and_fail("pid = %d", pid); + + if (fclose(fp)) + perror_msg_and_fail("fclose: %s", pidfile); + + if (unlink(pidfile)) + perror_msg_and_fail("unlink: %s", pidfile); + + while (kill(pid, 0) == 0) + ; +} + +int +main(void) +{ + wait_for_peer_invocation(); + wait_for_peer_termination(); - alarm(1); - pause(); + static const struct timespec ts = { .tv_nsec = 123456789 }; + if (nanosleep(&ts, NULL)) + perror_msg_and_fail("nanosleep"); static const char dir[] = "attach-p-cmd.test -p"; pid_t pid = getpid(); int rc = chdir(dir); - printf("%-5d --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---\n" - "%-5d chdir(\"%s\") = %d %s (%m)\n" + printf("%-5d chdir(\"%s\") = %s\n" "%-5d +++ exited with 0 +++\n", - pid, pid, dir, rc, errno2name(), pid); + pid, dir, sprintrc(rc), pid); return 0; } diff --git a/tests-mx32/attach-p-cmd.h b/tests-mx32/attach-p-cmd.h new file mode 100644 index 00000000..5f27cd10 --- /dev/null +++ b/tests-mx32/attach-p-cmd.h @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +static const char lockdir[] = "attach-p-cmd.test-lock"; +static const char pidfile[] = "attach-p-cmd.test-pid"; diff --git a/tests-mx32/attach-p-cmd.test b/tests-mx32/attach-p-cmd.test index 2068cf1d..6240ca94 100755 --- a/tests-mx32/attach-p-cmd.test +++ b/tests-mx32/attach-p-cmd.test @@ -3,45 +3,23 @@ # Check that simultaneous use of -p option and tracing of a command works. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog_skip_if_failed \ kill -0 $$ -rm -rf attach-p-cmd.test-lock -rm -f "$OUT" -./set_ptracer_any ./attach-p-cmd-p >> "$OUT" & +../set_ptracer_any ../attach-p-cmd-p >> "$EXP" & tracee_pid=$! -while ! [ -s "$OUT" ]; do +while ! [ -s "$EXP" ]; do kill -0 $tracee_pid 2> /dev/null || - fail_ 'set_ptracer_any ./attach-p-cmd-p failed' + fail_ 'set_ptracer_any ../attach-p-cmd-p failed' done -run_strace -a30 -echdir -p $tracee_pid ./attach-p-cmd-cmd > "$OUT" -match_diff "$LOG" "$OUT" -rm -f "$OUT" +run_strace -a30 -echdir -p $tracee_pid ../attach-p-cmd-cmd > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests-mx32/bexecve.test b/tests-mx32/bexecve.test index f1ab04f1..7a135871 100755 --- a/tests-mx32/bexecve.test +++ b/tests-mx32/bexecve.test @@ -3,29 +3,10 @@ # Check -bexecve behavior. # # Copyright (c) 2015 Dmitry V. Levin +# Copyright (c) 2015-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -35,14 +16,14 @@ run_strace_redir() $STRACE "$@" 2> "$LOG" } -run_strace_redir -enone ./set_ptracer_any true || +run_strace_redir -enone ../set_ptracer_any true || dump_log_and_fail_with "$STRACE $args: unexpected exit status" -run_strace_redir -enone ./set_ptracer_any false +run_strace_redir -enone ../set_ptracer_any false [ $? -eq 1 ] || dump_log_and_fail_with "$STRACE $args: unexpected exit status" -run_strace_redir -bexecve -enone ./set_ptracer_any false || +run_strace_redir -bexecve -enone ../set_ptracer_any false || dump_log_and_fail_with "$STRACE $args: unexpected exit status" pattern_detached='[^:]*strace: Process [1-9][0-9]* detached' diff --git a/tests-mx32/block_reset_raise_run.c b/tests-mx32/block_reset_raise_run.c new file mode 100644 index 00000000..45387b9e --- /dev/null +++ b/tests-mx32/block_reset_raise_run.c @@ -0,0 +1,35 @@ +/* + * Execute a command with blocked, reset, and raised signal. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +int +main(int ac, char **av) +{ + if (ac < 3) + error_msg_and_fail("usage: block_reset_raise_run signo path..."); + + sigset_t mask; + sigemptyset(&mask); + const int signo = atoi(av[1]); + if (sigaddset(&mask, signo)) + perror_msg_and_fail("sigaddset: %s", av[1]); + if (sigprocmask(SIG_BLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + if (signal(signo, SIG_DFL) == SIG_ERR) + perror_msg_and_fail("signal: %s", av[1]); + if (raise(signo)) + perror_msg_and_fail("raise: %s", av[1]); + + execvp(av[2], av + 2); + perror_msg_and_fail("execvp: %s", av[2]); +} diff --git a/tests-mx32/bpf-obj_get_info_by_fd-prog-v.c b/tests-mx32/bpf-obj_get_info_by_fd-prog-v.c new file mode 100644 index 00000000..d7e10b43 --- /dev/null +++ b/tests-mx32/bpf-obj_get_info_by_fd-prog-v.c @@ -0,0 +1,3 @@ +#define CHECK_OBJ_PROG 1 +#define VERBOSE 1 +#include "bpf-obj_get_info_by_fd.c" diff --git a/tests-mx32/bpf-obj_get_info_by_fd-prog-v.gen.test b/tests-mx32/bpf-obj_get_info_by_fd-prog-v.gen.test new file mode 100755 index 00000000..fcaa1d8b --- /dev/null +++ b/tests-mx32/bpf-obj_get_info_by_fd-prog-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (bpf-obj_get_info_by_fd-prog-v -a20 -y -v -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -y -v -e trace=bpf diff --git a/tests-mx32/bpf-obj_get_info_by_fd-prog.c b/tests-mx32/bpf-obj_get_info_by_fd-prog.c new file mode 100644 index 00000000..19a5f75a --- /dev/null +++ b/tests-mx32/bpf-obj_get_info_by_fd-prog.c @@ -0,0 +1,2 @@ +#define CHECK_OBJ_PROG 1 +#include "bpf-obj_get_info_by_fd.c" diff --git a/tests-mx32/bpf-obj_get_info_by_fd-prog.gen.test b/tests-mx32/bpf-obj_get_info_by_fd-prog.gen.test new file mode 100755 index 00000000..8cbd7c04 --- /dev/null +++ b/tests-mx32/bpf-obj_get_info_by_fd-prog.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (bpf-obj_get_info_by_fd-prog -a20 -y -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -y -e trace=bpf diff --git a/tests-mx32/bpf-obj_get_info_by_fd-v.c b/tests-mx32/bpf-obj_get_info_by_fd-v.c new file mode 100644 index 00000000..2debc5f1 --- /dev/null +++ b/tests-mx32/bpf-obj_get_info_by_fd-v.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "bpf-obj_get_info_by_fd.c" diff --git a/tests-mx32/bpf-obj_get_info_by_fd-v.gen.test b/tests-mx32/bpf-obj_get_info_by_fd-v.gen.test new file mode 100755 index 00000000..255d91e9 --- /dev/null +++ b/tests-mx32/bpf-obj_get_info_by_fd-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (bpf-obj_get_info_by_fd-v -a20 -y -v -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -y -v -e trace=bpf diff --git a/tests-mx32/bpf-obj_get_info_by_fd.c b/tests-mx32/bpf-obj_get_info_by_fd.c new file mode 100644 index 00000000..3e18591d --- /dev/null +++ b/tests-mx32/bpf-obj_get_info_by_fd.c @@ -0,0 +1,608 @@ +/* + * Check bpf(BPF_OBJ_GET_INFO_BY_FD) decoding. + * + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifndef CHECK_OBJ_PROG +# define CHECK_OBJ_PROG 0 +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "print_fields.h" +#include "scno.h" + +#ifdef HAVE_LINUX_BPF_H +# include +#endif + +#include "bpf_attr.h" + +#include "xlat.h" +#include "xlat/bpf_map_flags.h" +#include "xlat/bpf_map_types.h" +#include "xlat/bpf_prog_types.h" + +#define XLAT_MACROS_ONLY +#include "xlat/bpf_commands.h" +#include "xlat/bpf_op_alu.h" +#include "xlat/bpf_op_jmp.h" +#include "xlat/bpf_size.h" +#include "xlat/bpf_src.h" +#include "xlat/ebpf_class.h" +#include "xlat/ebpf_mode.h" +#include "xlat/ebpf_op_alu.h" +#include "xlat/ebpf_regs.h" +#include "xlat/ebpf_size.h" + +#ifndef HAVE_STRUCT_BPF_INSN +struct bpf_insn { + uint8_t code; + uint8_t dst_reg:4; + uint8_t src_reg:4; + int16_t off; + int32_t imm; +}; +#endif + +static const char *errstr; + +static long +sys_bpf(kernel_ulong_t cmd, void *attr, kernel_ulong_t size) +{ + long rc = syscall(__NR_bpf, cmd, attr, size); + errstr = sprintrc(rc); + return rc; +} + +static void +print_map_create(void *attr_void, size_t size, long rc) +{ + /* struct BPF_MAP_CREATE_struct *attr = attr_void; */ + + printf("bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_ARRAY, key_size=4" + ", value_size=8, max_entries=1"); + if (size > offsetof(struct BPF_MAP_CREATE_struct, map_flags)) + printf(", map_flags=0"); + if (size > offsetof(struct BPF_MAP_CREATE_struct, inner_map_fd)) + printf(", inner_map_fd=0"); + if (size > offsetof(struct BPF_MAP_CREATE_struct, map_name)) + printf(", map_name=\"test_map\""); + if (size > offsetof(struct BPF_MAP_CREATE_struct, map_ifindex)) + printf(", map_ifindex=0"); + if (size > offsetof(struct BPF_MAP_CREATE_struct, btf_fd)) { + printf(", btf_fd=0" + ", btf_key_type_id=0, btf_value_type_id=0"); + } + printf("}, %zu) = ", size); + if (rc >= 0) + printf("%ld\n", rc); + else + puts(errstr); +} + +#if CHECK_OBJ_PROG +static struct bpf_insn socket_prog[] = { + { /* 0 */ + .code = BPF_ALU64 | BPF_K | BPF_MOV, + .dst_reg = BPF_REG_1, + .imm = 0, + }, + { /* 1 */ + .code = BPF_STX | BPF_W | BPF_MEM, + .dst_reg = BPF_REG_10, + .src_reg = BPF_REG_1, + .off = -4, + }, + { /* 2 */ + .code = BPF_ALU64 | BPF_X | BPF_MOV, + .dst_reg = BPF_REG_2, + .src_reg = BPF_REG_10, + }, + { /* 3 */ + .code = BPF_ALU64 | BPF_K | BPF_ADD, + .dst_reg = BPF_REG_2, + .imm = -4, + }, + { /* 4 */ + .code = BPF_LD | BPF_DW | BPF_IMM, + .dst_reg = BPF_REG_1, + .src_reg = 1 /* BPF_PSEUDO_MAP_FD */, + .imm = 0, /* to be set to map fd */ + }, + { /* 5 */ + .imm = 0, + }, + { /* 6 */ + .code = BPF_JMP | BPF_K | BPF_CALL, + .imm = 0x1, /* BPF_FUNC_map_lookup_elem */ + }, + { /* 7 */ + .code = BPF_ALU64 | BPF_K | BPF_MOV, + .dst_reg = BPF_REG_0, + .imm = 0, + }, + { /* 8 */ + .code = BPF_JMP | BPF_K | BPF_EXIT, + }, +}; + +# if VERBOSE +static const char *socket_prog_fmt = + "[{code=BPF_ALU64|BPF_K|BPF_MOV" + ", dst_reg=BPF_REG_1, src_reg=BPF_REG_0, off=0, imm=0}" + ", {code=BPF_STX|BPF_W|BPF_MEM" + ", dst_reg=BPF_REG_10, src_reg=BPF_REG_1, off=-4, imm=0}" + ", {code=BPF_ALU64|BPF_X|BPF_MOV" + ", dst_reg=BPF_REG_2, src_reg=BPF_REG_10, off=0, imm=0}" + ", {code=BPF_ALU64|BPF_K|BPF_ADD" + ", dst_reg=BPF_REG_2, src_reg=BPF_REG_0, off=0, imm=0xfffffffc}" + ", {code=BPF_LD|BPF_DW|BPF_IMM" + ", dst_reg=BPF_REG_1, src_reg=BPF_REG_1, off=0, imm=%#x}" + ", {code=BPF_LD|BPF_W|BPF_IMM" + ", dst_reg=BPF_REG_0, src_reg=BPF_REG_0, off=0, imm=0}" + ", {code=BPF_JMP|BPF_K|BPF_CALL" + ", dst_reg=BPF_REG_0, src_reg=BPF_REG_0, off=0, imm=0x1}" + ", {code=BPF_ALU64|BPF_K|BPF_MOV" + ", dst_reg=BPF_REG_0, src_reg=BPF_REG_0, off=0, imm=0}" + ", {code=BPF_JMP|BPF_K|BPF_EXIT" + ", dst_reg=BPF_REG_0, src_reg=BPF_REG_0, off=0, imm=0}" + "]"; +# endif /* VERBOSE */ + +static const char *license = "BSD"; +static char log_buf[4096]; + +static void +print_prog_load(void *attr_void, size_t size, long rc) +{ + printf("bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_SOCKET_FILTER" + ", insn_cnt=%zu, insns=", ARRAY_SIZE(socket_prog)); +# if VERBOSE + printf(socket_prog_fmt, socket_prog[4].imm); +# else + printf("%p", socket_prog); +# endif + if (size > offsetof(struct BPF_PROG_LOAD_struct, license)) + printf(", license=\"BSD\""); + if (size > offsetof(struct BPF_PROG_LOAD_struct, log_buf)) + printf(", log_level=7, log_size=%zu, log_buf=\"\"", + sizeof(log_buf)); + if (size > offsetof(struct BPF_PROG_LOAD_struct, kern_version)) + printf(", kern_version=KERNEL_VERSION(57005, 192, 222)"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, prog_flags)) + printf(", prog_flags=0"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, prog_name)) + printf(", prog_name=\"test_prog\""); + if (size > offsetof(struct BPF_PROG_LOAD_struct, prog_ifindex)) + printf(", prog_ifindex=0"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, expected_attach_type)) + printf(", expected_attach_type=BPF_CGROUP_INET_INGRESS"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, prog_btf_fd)) + printf(", prog_btf_fd=0"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, func_info_rec_size)) + printf(", func_info_rec_size=0"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, func_info)) + printf(", func_info=NULL"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, func_info_cnt)) + printf(", func_info_cnt=0"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, line_info_rec_size)) + printf(", line_info_rec_size=0"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, line_info)) + printf(", line_info=NULL"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, line_info_cnt)) + printf(", line_info_cnt=0"); + printf("}, %zu) = ", size); + if (rc >= 0) + printf("%ld\n", rc); + else + puts(errstr); +} +#endif /* CHECK_OBJ_PROG */ + +static long +try_bpf(kernel_ulong_t cmd, void (*printer)(void *attr, size_t size, long rc), + void *attr, size_t **sizes) +{ + long rc; + + for (rc = -1; **sizes; (*sizes)++) { + rc = sys_bpf(cmd, attr, **sizes); + printer(attr, **sizes, rc); + + if (rc >= 0) + break; + } + + return rc; +} + +int +main(void) +{ + struct BPF_MAP_CREATE_struct bpf_map_create_attr = { + .map_type = BPF_MAP_TYPE_ARRAY, + .key_size = 4, + .value_size = 8, + .max_entries = 1, + .map_name = "test_map", + }; + size_t bpf_map_create_attr_sizes[] = { + sizeof(bpf_map_create_attr), + offsetofend(struct BPF_MAP_CREATE_struct, max_entries), + 0, + }; + +#if CHECK_OBJ_PROG + struct BPF_PROG_LOAD_struct bpf_prog_load_attr = { + .prog_type = BPF_PROG_TYPE_SOCKET_FILTER, + .insn_cnt = ARRAY_SIZE(socket_prog), + .insns = (uintptr_t) socket_prog, + .license = (uintptr_t) license, + .log_level = 7, + .log_size = sizeof(log_buf), + .log_buf = (uintptr_t) log_buf, + .kern_version = 0xdeadc0de, + .prog_name = "test_prog", + }; + size_t bpf_prog_load_attr_sizes[] = { + sizeof(bpf_prog_load_attr), + offsetofend(struct BPF_PROG_LOAD_struct, prog_name), + offsetofend(struct BPF_PROG_LOAD_struct, prog_flags), + offsetofend(struct BPF_PROG_LOAD_struct, kern_version), + offsetofend(struct BPF_PROG_LOAD_struct, log_buf), + offsetofend(struct BPF_PROG_LOAD_struct, license), + offsetofend(struct BPF_PROG_LOAD_struct, insns), + 0, + }; +#endif /* CHECK_OBJ_PROG */ + + size_t *bpf_map_create_attr_size = bpf_map_create_attr_sizes; + int map_fd = try_bpf(BPF_MAP_CREATE, print_map_create, + &bpf_map_create_attr, &bpf_map_create_attr_size); + if (map_fd < 0) + perror_msg_and_skip("BPF_MAP_CREATE failed"); + +#if CHECK_OBJ_PROG + socket_prog[4].imm = map_fd; + + size_t *bpf_prog_load_attr_size = bpf_prog_load_attr_sizes; + int prog_fd = try_bpf(BPF_PROG_LOAD, print_prog_load, + &bpf_prog_load_attr, &bpf_prog_load_attr_size); + if (prog_fd < 0) + perror_msg_and_skip("BPF_PROG_LOAD failed (log: \"%s\")", + log_buf); +#endif /* CHECK_OBJ_PROG */ + + /* + * This has to be a macro, otherwise the compiler complains that + * initializer element is not constant. + */ +#define MAP_INFO_SZ (sizeof(*map_info) + 64) + struct bpf_map_info_struct *map_info = tail_alloc(MAP_INFO_SZ); + struct BPF_OBJ_GET_INFO_BY_FD_struct bpf_map_get_info_attr = { + .bpf_fd = map_fd, + .info_len = MAP_INFO_SZ, + .info = (uintptr_t) map_info, + }; + + memset(map_info, 0, MAP_INFO_SZ); + int ret = sys_bpf(BPF_OBJ_GET_INFO_BY_FD, &bpf_map_get_info_attr, + sizeof(bpf_map_get_info_attr)); + if (ret < 0) + perror_msg_and_skip("BPF_OBJ_GET_INFO_BY_FD map failed"); + + printf("bpf(BPF_OBJ_GET_INFO_BY_FD" + ", {info={bpf_fd=%d, info_len=%zu", + map_fd, MAP_INFO_SZ); + if (bpf_map_get_info_attr.info_len != MAP_INFO_SZ) + printf(" => %u", bpf_map_get_info_attr.info_len); + + printf(", info="); +#if VERBOSE + printf("{type="); + printxval(bpf_map_types, map_info->type, "BPF_MAP_TYPE_???"); + PRINT_FIELD_U(", ", *map_info, id); + PRINT_FIELD_U(", ", *map_info, key_size); + PRINT_FIELD_U(", ", *map_info, value_size); + PRINT_FIELD_U(", ", *map_info, max_entries); + printf(", map_flags="); + printflags(bpf_map_flags, map_info->map_flags, "BPF_F_???"); + + if (bpf_map_get_info_attr.info_len > + offsetof(struct bpf_map_info_struct, name)) { + printf(", name="); + print_quoted_cstring(map_info->name, sizeof(map_info->name)); + } + if (bpf_map_get_info_attr.info_len > + offsetof(struct bpf_map_info_struct, ifindex)) + printf(", ifindex=%u", map_info->ifindex); + if (bpf_map_get_info_attr.info_len > + offsetof(struct bpf_map_info_struct, netns_dev)) + printf(", netns_dev=makedev(%#x, %#x)", + major(map_info->netns_dev), minor(map_info->netns_dev)); + if (bpf_map_get_info_attr.info_len > + offsetof(struct bpf_map_info_struct, netns_ino)) + printf(", netns_ino=%" PRIu64, map_info->netns_ino); + if (bpf_map_get_info_attr.info_len > + offsetof(struct bpf_map_info_struct, btf_id)) + PRINT_FIELD_U(", ", *map_info, btf_id); + if (bpf_map_get_info_attr.info_len > + offsetof(struct bpf_map_info_struct, btf_key_type_id)) + PRINT_FIELD_U(", ", *map_info, btf_key_type_id); + if (bpf_map_get_info_attr.info_len > + offsetof(struct bpf_map_info_struct, btf_value_type_id)) + PRINT_FIELD_U(", ", *map_info, btf_value_type_id); + printf("}"); +#else /* !VERBOSE */ + printf("%p", map_info); +#endif /* VERBOSE */ + printf("}}, %zu) = %s\n", sizeof(bpf_map_get_info_attr), errstr); + +#if CHECK_OBJ_PROG + /* + * This has to be a macro, otherwise the compiler complains that + * initializer element is not constant. + */ +# define PROG_INFO_SZ (sizeof(*prog_info) + 64) + struct bpf_prog_info_struct *prog_info = tail_alloc(PROG_INFO_SZ); + struct bpf_insn *xlated_prog = tail_alloc(sizeof(*xlated_prog) * 42); + uint32_t *map_ids = tail_alloc(sizeof(*map_ids) * 2); + struct BPF_OBJ_GET_INFO_BY_FD_struct bpf_prog_get_info_attr = { + .bpf_fd = prog_fd, + .info_len = PROG_INFO_SZ, + .info = (uintptr_t) prog_info, + }; + size_t old_prog_info_len = PROG_INFO_SZ; + + memset(prog_info, 0, PROG_INFO_SZ); + for (unsigned int i = 0; i < 4; i++) { + prog_info->jited_prog_len = 0; + prog_info->nr_jited_ksyms = 0; + prog_info->nr_jited_func_lens = 0; + prog_info->func_info_rec_size = 0; + prog_info->nr_func_info = 0; + prog_info->nr_line_info = 0; + prog_info->nr_jited_line_info = 0; + prog_info->jited_line_info = 0; + prog_info->line_info_rec_size = 0; + prog_info->jited_line_info_rec_size = 0; + prog_info->nr_prog_tags = 0; + memset(prog_info + 1, 0, PROG_INFO_SZ - sizeof(*prog_info)); + switch (i) { + case 1: + prog_info->xlated_prog_insns = + (uintptr_t) (xlated_prog + 42); + prog_info->xlated_prog_len = 336; + prog_info->map_ids = (uintptr_t) (map_ids + 2); + prog_info->nr_map_ids = 2; + break; + case 2: + prog_info->xlated_prog_insns = (uintptr_t) xlated_prog; + /* TODO: check xlated_prog output */ + prog_info->xlated_prog_len = 0; + prog_info->map_ids = (uintptr_t) map_ids; + prog_info->nr_map_ids = 0; + break; + case 3: + prog_info->xlated_prog_insns = (uintptr_t) xlated_prog; + prog_info->xlated_prog_len = 0; + prog_info->map_ids = (uintptr_t) map_ids; + prog_info->nr_map_ids = 2; + break; + } + + ret = sys_bpf(BPF_OBJ_GET_INFO_BY_FD, &bpf_prog_get_info_attr, + sizeof(bpf_prog_get_info_attr)); + if (i != 1 && ret < 0) + perror_msg_and_skip("BPF_OBJ_GET_INFO_BY_FD" + " prog %u failed", i); + + printf("bpf(BPF_OBJ_GET_INFO_BY_FD" + ", {info={bpf_fd=%d, info_len=%zu", + prog_fd, old_prog_info_len); + if (!i && bpf_prog_get_info_attr.info_len != PROG_INFO_SZ) + printf(" => %u", bpf_prog_get_info_attr.info_len); + old_prog_info_len = bpf_prog_get_info_attr.info_len; + + printf(", info="); +# if VERBOSE + printf("{type="); + printxval(bpf_prog_types, prog_info->type, "BPF_PROG_TYPE_???"); + PRINT_FIELD_U(", ", *prog_info, id); + printf(", tag="); + print_quoted_hex(prog_info->tag, sizeof(prog_info->tag)); + printf(", jited_prog_len=0"); + if (prog_info->jited_prog_len) + printf(" => %u", prog_info->jited_prog_len); + printf(", jited_prog_insns=NULL"); + switch (i) { + case 0: + printf(", xlated_prog_len=0"); + if (prog_info->xlated_prog_len) + printf(" => %u", prog_info->xlated_prog_len); + printf(", xlated_prog_insns=NULL"); + break; + case 1: + printf(", xlated_prog_len=336"); + if (prog_info->xlated_prog_len != 336) + printf(" => %u", prog_info->xlated_prog_len); + if (prog_info->xlated_prog_len) + printf(", xlated_prog_insns=%p", xlated_prog + 42); + else + printf(", xlated_prog_insns=[]"); + break; + case 2: + case 3: + printf(", xlated_prog_len=0"); + if (prog_info->xlated_prog_len) + printf(" => %u", prog_info->xlated_prog_len); + printf(", xlated_prog_insns=[]"); + break; + } + + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, load_time)) + printf(", load_time=%" PRIu64, prog_info->load_time); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, created_by_uid)) + printf(", created_by_uid=%u", + prog_info->created_by_uid); + + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, map_ids)) { + switch (i) { + case 0: + printf(", nr_map_ids=0"); + if (prog_info->nr_map_ids) + printf(" => 1"); + printf(", map_ids=NULL"); + break; + case 1: + printf(", nr_map_ids=2, map_ids=%p", + map_ids + 2); + break; + case 2: + printf(", nr_map_ids=0"); + if (prog_info->nr_map_ids) + printf(" => 1"); + printf(", map_ids=[]"); + break; + case 3: + printf(", nr_map_ids=2"); + if (prog_info->nr_map_ids != 2) + printf(" => 1"); + printf(", map_ids=[%u]", map_info->id); + break; + } + } + + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, name)) + printf(", name=\"test_prog\""); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, ifindex)) + printf(", ifindex=%u", prog_info->ifindex); + if (bpf_prog_get_info_attr.info_len > + offsetofend(struct bpf_prog_info_struct, ifindex)) + printf(", gpl_compatible=%u", prog_info->gpl_compatible); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, netns_dev)) + printf(", netns_dev=makedev(%#x, %#x)", + major(prog_info->netns_dev), + minor(prog_info->netns_dev)); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, netns_ino)) + printf(", netns_ino=%" PRIu64, prog_info->netns_ino); + + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, nr_jited_ksyms)) { + printf(", nr_jited_ksyms=0"); + if (prog_info->nr_jited_ksyms) + printf(" => %u", prog_info->nr_jited_ksyms); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, nr_jited_func_lens)) { + printf(", nr_jited_func_lens=0"); + if (prog_info->nr_jited_func_lens) + printf(" => %u", prog_info->nr_jited_func_lens); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, jited_ksyms)) + printf(", jited_ksyms=NULL"); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, jited_func_lens)) + printf(", jited_func_lens=NULL"); + + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, btf_id)) + PRINT_FIELD_U(", ", *prog_info, btf_id); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, func_info_rec_size)) { + printf(", func_info_rec_size=0"); + if (prog_info->func_info_rec_size) + printf(" => %u", prog_info->func_info_rec_size); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, func_info)) + printf(", func_info=NULL"); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, nr_func_info)) { + printf(", nr_func_info=0"); + if (prog_info->nr_func_info) + printf(" => %u", prog_info->nr_func_info); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, nr_line_info)) { + printf(", nr_line_info=0"); + if (prog_info->nr_line_info) + printf(" => %u", prog_info->nr_line_info); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, line_info)) + printf(", line_info=NULL"); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, jited_line_info)) + printf(", jited_line_info=NULL"); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, nr_jited_line_info)) { + printf(", nr_jited_line_info=0"); + if (prog_info->nr_jited_line_info) + printf(" => %u", prog_info->nr_jited_line_info); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, line_info_rec_size)) { + printf(", line_info_rec_size=0"); + if (prog_info->line_info_rec_size) + printf(" => %u", prog_info->line_info_rec_size); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, jited_line_info_rec_size)) { + printf(", jited_line_info_rec_size=0"); + if (prog_info->jited_line_info_rec_size) + printf(" => %u", prog_info->jited_line_info_rec_size); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, nr_prog_tags)) { + printf(", nr_prog_tags=0"); + if (prog_info->nr_prog_tags) + printf(" => %u", prog_info->nr_prog_tags); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, prog_tags)) + printf(", prog_tags=NULL"); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, run_time_ns)) + printf(", run_time_ns=%llu", + (unsigned long long) prog_info->run_time_ns); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, run_cnt)) + printf(", run_cnt=%llu", + (unsigned long long) prog_info->run_cnt); + + printf("}"); +# else /* !VERBOSE */ + printf("%p", prog_info); +# endif /* VERBOSE */ + printf("}}, %zu) = %s\n", + sizeof(bpf_prog_get_info_attr), errstr); + } +#endif /* CHECK_OBJ_PROG */ + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/bpf-obj_get_info_by_fd.gen.test b/tests-mx32/bpf-obj_get_info_by_fd.gen.test new file mode 100755 index 00000000..0efa59a4 --- /dev/null +++ b/tests-mx32/bpf-obj_get_info_by_fd.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (bpf-obj_get_info_by_fd -a20 -y -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -y -e trace=bpf diff --git a/tests-mx32/bpf-success-v.c b/tests-mx32/bpf-success-v.c new file mode 100644 index 00000000..48c2a16d --- /dev/null +++ b/tests-mx32/bpf-success-v.c @@ -0,0 +1,2 @@ +#define INJECT_RETVAL 42 +#include "bpf-v.c" diff --git a/tests-mx32/bpf-success-v.test b/tests-mx32/bpf-success-v.test new file mode 100755 index 00000000..9afcb148 --- /dev/null +++ b/tests-mx32/bpf-success-v.test @@ -0,0 +1,11 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +run_strace -a20 -v -e trace=bpf -e inject=bpf:retval=42 ../bpf-success-v > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests-mx32/bpf-success.c b/tests-mx32/bpf-success.c new file mode 100644 index 00000000..06f46956 --- /dev/null +++ b/tests-mx32/bpf-success.c @@ -0,0 +1,2 @@ +#define INJECT_RETVAL 42 +#include "bpf.c" diff --git a/tests-mx32/bpf-success.test b/tests-mx32/bpf-success.test new file mode 100755 index 00000000..4321e532 --- /dev/null +++ b/tests-mx32/bpf-success.test @@ -0,0 +1,11 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +run_strace -a20 -e trace=bpf -e inject=bpf:retval=42 ../bpf-success > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests-mx32/bpf-v.c b/tests-mx32/bpf-v.c new file mode 100644 index 00000000..3f44f249 --- /dev/null +++ b/tests-mx32/bpf-v.c @@ -0,0 +1,3 @@ +/* This file is part of bpf-v strace test. */ +#define VERBOSE 1 +#include "bpf.c" diff --git a/tests-mx32/bpf-v.gen.test b/tests-mx32/bpf-v.gen.test new file mode 100755 index 00000000..e57154e3 --- /dev/null +++ b/tests-mx32/bpf-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (bpf-v -a20 -v -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -v -e trace=bpf diff --git a/tests-mx32/bpf.c b/tests-mx32/bpf.c index 7ef16c9f..fd29ab44 100644 --- a/tests-mx32/bpf.c +++ b/tests-mx32/bpf.c @@ -1,234 +1,1252 @@ /* + * Check bpf syscall decoding. + * * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2015-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" + +#include +#include +#include +#include +#include + #include +#include "scno.h" -#if defined HAVE_UNION_BPF_ATTR_LOG_BUF && defined __NR_bpf -# include -# include -# include +#ifdef HAVE_LINUX_BPF_H # include +#endif -static const struct bpf_insn insns[] = { - { .code = BPF_JMP | BPF_EXIT } +#include "bpf_attr.h" +#include "print_fields.h" + +#include "xlat.h" +#include "xlat/bpf_commands.h" + +#if defined MPERS_IS_m32 || SIZEOF_KERNEL_LONG_T > 4 +# define BIG_ADDR(addr64_, addr32_) addr64_ +# define BIG_ADDR_MAYBE(addr_) +#elif defined __arm__ || defined __i386__ || defined __mips__ \ + || defined __powerpc__ || defined __riscv__ || defined __s390__ \ + || defined __sparc__ || defined __tile__ +# define BIG_ADDR(addr64_, addr32_) addr64_ " or " addr32_ +# define BIG_ADDR_MAYBE(addr_) addr_ " or " +#else +# define BIG_ADDR(addr64_, addr32_) addr32_ +# define BIG_ADDR_MAYBE(addr_) +#endif + +#ifndef HAVE_STRUCT_BPF_INSN +struct bpf_insn { + uint8_t code; + uint8_t dst_reg:4; + uint8_t src_reg:4; + int16_t off; + int32_t imm; +}; +#endif + +#define BPF_ATTR_DATA_FIELD(cmd_) struct cmd_ ## _struct cmd_ ## _data + +union bpf_attr_data { + BPF_ATTR_DATA_FIELD(BPF_MAP_CREATE); + BPF_ATTR_DATA_FIELD(BPF_MAP_LOOKUP_ELEM); + BPF_ATTR_DATA_FIELD(BPF_MAP_UPDATE_ELEM); + BPF_ATTR_DATA_FIELD(BPF_MAP_DELETE_ELEM); + BPF_ATTR_DATA_FIELD(BPF_MAP_GET_NEXT_KEY); + BPF_ATTR_DATA_FIELD(BPF_PROG_LOAD); + BPF_ATTR_DATA_FIELD(BPF_OBJ_PIN); + BPF_ATTR_DATA_FIELD(BPF_PROG_ATTACH); + BPF_ATTR_DATA_FIELD(BPF_PROG_DETACH); + BPF_ATTR_DATA_FIELD(BPF_PROG_TEST_RUN); + BPF_ATTR_DATA_FIELD(BPF_PROG_GET_NEXT_ID); + BPF_ATTR_DATA_FIELD(BPF_PROG_GET_FD_BY_ID); + BPF_ATTR_DATA_FIELD(BPF_MAP_GET_FD_BY_ID); + BPF_ATTR_DATA_FIELD(BPF_OBJ_GET_INFO_BY_FD); + BPF_ATTR_DATA_FIELD(BPF_PROG_QUERY); + BPF_ATTR_DATA_FIELD(BPF_RAW_TRACEPOINT_OPEN); + BPF_ATTR_DATA_FIELD(BPF_BTF_LOAD); + BPF_ATTR_DATA_FIELD(BPF_BTF_GET_FD_BY_ID); + BPF_ATTR_DATA_FIELD(BPF_TASK_FD_QUERY); + char char_data[256]; +}; + +struct bpf_attr_check { + union bpf_attr_data data; + size_t size; + const char *str; + void (*init_fn)(struct bpf_attr_check *check); + void (*print_fn)(const struct bpf_attr_check *check, + unsigned long addr); +}; + +struct bpf_check { + kernel_ulong_t cmd; + const char *cmd_str; + const struct bpf_attr_check *checks; + size_t count; }; +static const kernel_ulong_t long_bits = (kernel_ulong_t) 0xfacefeed00000000ULL; static const char *errstr; -static char log_buf[4096]; +static unsigned int sizeof_attr = sizeof(union bpf_attr_data); +static unsigned int page_size; +static unsigned long end_of_page; static long sys_bpf(kernel_ulong_t cmd, kernel_ulong_t attr, kernel_ulong_t size) { long rc = syscall(__NR_bpf, cmd, attr, size); + errstr = sprintrc(rc); + +#ifdef INJECT_RETVAL + if (rc != INJECT_RETVAL) + error_msg_and_fail("Got a return value of %ld != %d", + rc, INJECT_RETVAL); + + static char inj_errstr[4096]; + + snprintf(inj_errstr, sizeof(inj_errstr), "%s (INJECTED)", errstr); + errstr = inj_errstr; +#endif + return rc; } -static int -map_create(void) +#if VERBOSE +# define print_extra_data(addr_, offs_, size_) \ + do { \ + printf("/* bytes %u..%u */ ", (offs_), (size_) + (offs_) - 1); \ + print_quoted_hex((addr_) + (offs_), (size_)); \ + } while (0) +#else +# define print_extra_data(addr_, offs_, size_) printf("...") +#endif + +static void +print_bpf_attr(const struct bpf_attr_check *check, unsigned long addr) { - union bpf_attr attr = { - .key_size = 4, - .value_size = 8, - .max_entries = 256 - }; - void *const t_attr = tail_memdup(&attr, sizeof(attr)); - return sys_bpf(BPF_MAP_CREATE, (unsigned long) t_attr, sizeof(attr)); + if (check->print_fn) + check->print_fn(check, addr); + else + printf("%s", check->str); } -static int -map_any(int cmd) +static void +test_bpf(const struct bpf_check *cmd_check) { - union bpf_attr attr = { - .map_fd = -1, - .key = 0xdeadbeef, - .value = 0xbadc0ded - }; - void *const t_attr = tail_memdup(&attr, sizeof(attr)); - return sys_bpf(cmd, (unsigned long) t_attr, sizeof(attr)); + const struct bpf_attr_check *check = 0; + const union bpf_attr_data *data = 0; + unsigned int offset = 0; + + /* zero addr */ + sys_bpf(cmd_check->cmd, 0, long_bits | sizeof(union bpf_attr_data)); + printf("bpf(%s, NULL, %u) = %s\n", + cmd_check->cmd_str, sizeof_attr, errstr); + + /* zero size */ + unsigned long addr = end_of_page - sizeof_attr; + sys_bpf(cmd_check->cmd, addr, long_bits); + printf("bpf(%s, %#lx, 0) = %s\n", + cmd_check->cmd_str, addr, errstr); + + for (size_t i = 0; i < cmd_check->count; i++) { + check = &cmd_check->checks[i]; + if (check->init_fn) + check->init_fn((struct bpf_attr_check *) check); + data = &check->data; + offset = check->size; + + addr = end_of_page - offset; + memcpy((void *) addr, data, offset); + + /* starting piece of bpf_attr_data */ + sys_bpf(cmd_check->cmd, addr, offset); + printf("bpf(%s, {", cmd_check->cmd_str); + print_bpf_attr(check, addr); + printf("}, %u) = %s\n", offset, errstr); + + /* short read of the starting piece */ + sys_bpf(cmd_check->cmd, addr + 1, offset); + printf("bpf(%s, %#lx, %u) = %s\n", + cmd_check->cmd_str, addr + 1, offset, errstr); + } + + if (offset < sizeof_attr) { + /* short read of the whole bpf_attr_data */ + memcpy((void *) end_of_page - sizeof_attr + 1, data, offset); + addr = end_of_page - sizeof_attr + 1; + memset((void *) addr + offset, 0, sizeof_attr - offset - 1); + sys_bpf(cmd_check->cmd, addr, sizeof_attr); + printf("bpf(%s, %#lx, %u) = %s\n", + cmd_check->cmd_str, addr, sizeof_attr, errstr); + + /* the whole bpf_attr_data */ + memcpy((void *) end_of_page - sizeof_attr, data, offset); + addr = end_of_page - sizeof_attr; + memset((void *) addr + offset, 0, sizeof_attr - offset); + sys_bpf(cmd_check->cmd, addr, sizeof_attr); + printf("bpf(%s, {", cmd_check->cmd_str); + print_bpf_attr(check, addr); + printf("}, %u) = %s\n", sizeof_attr, errstr); + + /* non-zero bytes after the relevant part */ + fill_memory_ex((void *) addr + offset, + sizeof_attr - offset, '0', 10); + sys_bpf(cmd_check->cmd, addr, sizeof_attr); + printf("bpf(%s, {", cmd_check->cmd_str); + print_bpf_attr(check, addr); + printf(", "); + print_extra_data((char *) addr, offset, + sizeof_attr - offset); + printf("}, %u) = %s\n", sizeof_attr, errstr); + } + + /* short read of the whole page */ + memcpy((void *) end_of_page - page_size + 1, data, offset); + addr = end_of_page - page_size + 1; + memset((void *) addr + offset, 0, page_size - offset - 1); + sys_bpf(cmd_check->cmd, addr, page_size); + printf("bpf(%s, %#lx, %u) = %s\n", + cmd_check->cmd_str, addr, page_size, errstr); + + /* the whole page */ + memcpy((void *) end_of_page - page_size, data, offset); + addr = end_of_page - page_size; + memset((void *) addr + offset, 0, page_size - offset); + sys_bpf(cmd_check->cmd, addr, page_size); + printf("bpf(%s, {", cmd_check->cmd_str); + print_bpf_attr(check, addr); + printf("}, %u) = %s\n", page_size, errstr); + + /* non-zero bytes after the whole bpf_attr_data */ + fill_memory_ex((void *) addr + offset, + page_size - offset, '0', 10); + sys_bpf(cmd_check->cmd, addr, page_size); + printf("bpf(%s, {", cmd_check->cmd_str); + print_bpf_attr(check, addr); + printf(", "); + print_extra_data((char *) addr, offset, + page_size - offset); + printf("}, %u) = %s\n", page_size, errstr); + + /* more than a page */ + sys_bpf(cmd_check->cmd, addr, page_size + 1); + printf("bpf(%s, %#lx, %u) = %s\n", + cmd_check->cmd_str, addr, page_size + 1, errstr); } -static int -prog_load(void) +static void +init_BPF_MAP_CREATE_attr7(struct bpf_attr_check *check) { - union bpf_attr attr = { - .insn_cnt = sizeof(insns) / sizeof(insns[0]), - .insns = (unsigned long) insns, - .license = (unsigned long) "GPL", - .log_level = 42, - .log_size = sizeof(log_buf), - .log_buf = (unsigned long) log_buf - }; - void *const t_attr = tail_memdup(&attr, sizeof(attr)); - return sys_bpf(BPF_PROG_LOAD, (unsigned long) t_attr, sizeof(attr)); + struct BPF_MAP_CREATE_struct *attr = &check->data.BPF_MAP_CREATE_data; + attr->map_ifindex = ifindex_lo(); } +static struct bpf_attr_check BPF_MAP_CREATE_checks[] = { + { + .data = { .BPF_MAP_CREATE_data = { .map_type = 2 } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, map_type), + .str = "map_type=BPF_MAP_TYPE_ARRAY, key_size=0, value_size=0" + ", max_entries=0" + }, + { /* 1 */ + .data = { .BPF_MAP_CREATE_data = { + .map_type = 20, + .key_size = 4, + .value_size = 8, + .max_entries = 256, + .map_flags = 63, + .inner_map_fd = -1, + .numa_node = 3141592653, + .map_name = "0123456789abcde", + } }, + .size = offsetof(struct BPF_MAP_CREATE_struct, map_name) + 8, + .str = "map_type=BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, key_size=4" + ", value_size=8, max_entries=256" + ", map_flags=BPF_F_NO_PREALLOC|BPF_F_NO_COMMON_LRU" + "|BPF_F_NUMA_NODE|BPF_F_RDONLY|BPF_F_WRONLY" + "|BPF_F_STACK_BUILD_ID" + ", inner_map_fd=-1" + ", numa_node=3141592653" + ", map_name=\"0123456\"...", + + }, + { /* 2 */ + .data = { .BPF_MAP_CREATE_data = { + .map_type = 24, + .key_size = 0xface1e55, + .value_size = 0xbadc0ded, + .max_entries = 0xbeefcafe, + .map_flags = 0xffffff80, + .inner_map_fd = 2718281828, + .numa_node = -1, + .map_name = "", + .map_ifindex = 3141592653, + } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, map_ifindex), + .str = "map_type=0x18 /* BPF_MAP_TYPE_??? */" + ", key_size=4207812181, value_size=3134983661" + ", max_entries=3203386110" + ", map_flags=0xffffff80 /* BPF_F_??? */" + ", inner_map_fd=-1576685468" + ", map_name=\"\", map_ifindex=3141592653", + + }, + { /* 3 */ + .data = { .BPF_MAP_CREATE_data = { + .map_type = 0xdeadf00d, + .key_size = 0xface1e55, + .value_size = 0xbadc0ded, + .max_entries = 0xbeefcafe, + .map_flags = 0xc0dedead, + .inner_map_fd = 2718281828, + .numa_node = -1, + } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, map_flags), + .str = "map_type=0xdeadf00d /* BPF_MAP_TYPE_??? */" + ", key_size=4207812181, value_size=3134983661" + ", max_entries=3203386110" + ", map_flags=BPF_F_NO_PREALLOC|BPF_F_NUMA_NODE" + "|BPF_F_RDONLY|BPF_F_STACK_BUILD_ID" + "|0xc0dede80", + }, + { /* 4 */ + .data = { .BPF_MAP_CREATE_data = { + .map_type = 0xdeadf00d, + .key_size = 0xface1e55, + .value_size = 0xbadc0ded, + .max_entries = 0xbeefcafe, + .map_flags = 0xc0dedead, + .inner_map_fd = 2718281828, + .numa_node = -1, + } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, inner_map_fd), + .str = "map_type=0xdeadf00d /* BPF_MAP_TYPE_??? */" + ", key_size=4207812181, value_size=3134983661" + ", max_entries=3203386110" + ", map_flags=BPF_F_NO_PREALLOC|BPF_F_NUMA_NODE" + "|BPF_F_RDONLY|BPF_F_STACK_BUILD_ID" + "|0xc0dede80" + ", inner_map_fd=-1576685468", + }, + { /* 5 */ + .data = { .BPF_MAP_CREATE_data = { + .map_type = 0xdeadf00d, + .key_size = 0xface1e55, + .value_size = 0xbadc0ded, + .max_entries = 0xbeefcafe, + .map_flags = 0xc0dedead, + .inner_map_fd = 2718281828, + .numa_node = -1, + } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, numa_node), + .str = "map_type=0xdeadf00d /* BPF_MAP_TYPE_??? */" + ", key_size=4207812181, value_size=3134983661" + ", max_entries=3203386110" + ", map_flags=BPF_F_NO_PREALLOC|BPF_F_NUMA_NODE" + "|BPF_F_RDONLY|BPF_F_STACK_BUILD_ID" + "|0xc0dede80" + ", inner_map_fd=-1576685468" + ", numa_node=4294967295 /* NUMA_NO_NODE */", + }, + { /* 6 */ + .data = { .BPF_MAP_CREATE_data = { + .map_type = 0xdeadf00d, + .key_size = 0xface1e55, + .value_size = 0xbadc0ded, + .max_entries = 0xbeefcafe, + .map_flags = 0xc0dedead, + .inner_map_fd = 2718281828, + .numa_node = -1, + .map_name = "fedcba9876543210", + } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, map_name), + .str = "map_type=0xdeadf00d /* BPF_MAP_TYPE_??? */" + ", key_size=4207812181, value_size=3134983661" + ", max_entries=3203386110" + ", map_flags=BPF_F_NO_PREALLOC|BPF_F_NUMA_NODE" + "|BPF_F_RDONLY|BPF_F_STACK_BUILD_ID" + "|0xc0dede80" + ", inner_map_fd=-1576685468" + ", numa_node=4294967295 /* NUMA_NO_NODE */" + ", map_name=\"fedcba987654321\"...", + }, + { /* 7 */ + .data = { .BPF_MAP_CREATE_data = { + .map_type = 0xdeadf00d, + .key_size = 0xface1e55, + .value_size = 0xbadc0ded, + .max_entries = 0xbeefcafe, + .map_flags = 0xc0dedead, + .inner_map_fd = 2718281828, + .numa_node = -1, + .map_name = "0123456789abcde", + } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, map_ifindex), + .str = "map_type=0xdeadf00d /* BPF_MAP_TYPE_??? */" + ", key_size=4207812181, value_size=3134983661" + ", max_entries=3203386110" + ", map_flags=BPF_F_NO_PREALLOC|BPF_F_NUMA_NODE" + "|BPF_F_RDONLY|BPF_F_STACK_BUILD_ID" + "|0xc0dede80" + ", inner_map_fd=-1576685468" + ", numa_node=4294967295 /* NUMA_NO_NODE */" + ", map_name=\"0123456789abcde\"" + ", map_ifindex=" IFINDEX_LO_STR, + .init_fn = init_BPF_MAP_CREATE_attr7, + }, + { /* 8 */ + .data = { .BPF_MAP_CREATE_data = { + .btf_fd = 0xbadc0ded, + .btf_key_type_id = 0xfacefeed, + .btf_value_type_id = 0xcafef00d + } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, + btf_value_type_id), + .str = "map_type=BPF_MAP_TYPE_UNSPEC" + ", key_size=0" + ", value_size=0" + ", max_entries=0" + ", map_flags=0" + ", inner_map_fd=0" + ", map_name=\"\"" + ", map_ifindex=0" + ", btf_fd=-1159983635" + ", btf_key_type_id=4207869677" + ", btf_value_type_id=3405705229" + }, +}; + +static const struct bpf_attr_check BPF_MAP_LOOKUP_ELEM_checks[] = { + { + .data = { .BPF_MAP_LOOKUP_ELEM_data = { .map_fd = -1 } }, + .size = offsetofend(struct BPF_MAP_LOOKUP_ELEM_struct, map_fd), + .str = "map_fd=-1, key=NULL, value=NULL" + }, + { + .data = { .BPF_MAP_LOOKUP_ELEM_data = { + .map_fd = -1, + .key = 0xdeadbeef, + .value = 0xbadc0ded + } }, + .size = offsetofend(struct BPF_MAP_LOOKUP_ELEM_struct, value), + .str = "map_fd=-1, key=0xdeadbeef, value=0xbadc0ded" + } +}; + +#define BPF_MAP_LOOKUP_AND_DELETE_ELEM_checks BPF_MAP_LOOKUP_ELEM_checks + +static const struct bpf_attr_check BPF_MAP_UPDATE_ELEM_checks[] = { + { + .data = { .BPF_MAP_UPDATE_ELEM_data = { .map_fd = -1 } }, + .size = offsetofend(struct BPF_MAP_UPDATE_ELEM_struct, map_fd), + .str = "map_fd=-1, key=NULL, value=NULL, flags=BPF_ANY" + }, + { + .data = { .BPF_MAP_UPDATE_ELEM_data = { + .map_fd = -1, + .key = 0xdeadbeef, + .value = 0xbadc0ded, + .flags = 2 + } }, + .size = offsetofend(struct BPF_MAP_UPDATE_ELEM_struct, flags), + .str = "map_fd=-1, key=0xdeadbeef, value=0xbadc0ded" + ", flags=BPF_EXIST" + } +}; + +static const struct bpf_attr_check BPF_MAP_DELETE_ELEM_checks[] = { + { + .data = { .BPF_MAP_DELETE_ELEM_data = { .map_fd = -1 } }, + .size = offsetofend(struct BPF_MAP_DELETE_ELEM_struct, map_fd), + .str = "map_fd=-1, key=NULL" + }, + { + .data = { .BPF_MAP_DELETE_ELEM_data = { + .map_fd = -1, + .key = 0xdeadbeef + } }, + .size = offsetofend(struct BPF_MAP_DELETE_ELEM_struct, key), + .str = "map_fd=-1, key=0xdeadbeef" + } +}; + +static const struct bpf_attr_check BPF_MAP_GET_NEXT_KEY_checks[] = { + { + .data = { .BPF_MAP_GET_NEXT_KEY_data = { .map_fd = -1 } }, + .size = offsetofend(struct BPF_MAP_GET_NEXT_KEY_struct, map_fd), + .str = "map_fd=-1, key=NULL, next_key=NULL" + }, + { + .data = { .BPF_MAP_GET_NEXT_KEY_data = { + .map_fd = -1, + .key = 0xdeadbeef, + .next_key = 0xbadc0ded + } }, + .size = offsetofend(struct BPF_MAP_GET_NEXT_KEY_struct, next_key), + .str = "map_fd=-1, key=0xdeadbeef, next_key=0xbadc0ded" + } +}; + +static const struct bpf_insn insns[] = { + { + .code = 0x95, + .dst_reg = 10, + .src_reg = 11, + .off = 0xdead, + .imm = 0xbadc0ded, + }, +}; +static const char license[] = "GPL"; +static const char pathname[] = "/sys/fs/bpf/foo/bar"; + +static char *log_buf; /* - * bpf() syscall and its first six commands were introduced in Linux kernel - * 3.18. Some additional commands were added afterwards, so we need to take - * precautions to make sure the tests compile. - * - * BPF_OBJ_PIN and BPF_OBJ_GET commands appear in kernel 4.4. + * This has to be a macro, otherwise the compiler complains that + * initializer element is not constant. */ -# ifdef HAVE_UNION_BPF_ATTR_BPF_FD -static int -obj_manage(int cmd) +#define log_buf_size 4096U + +static inline char * +get_log_buf(void) { - union bpf_attr attr = { - .pathname = (unsigned long) "/sys/fs/bpf/foo/bar", - .bpf_fd = -1 - }; - void *const t_attr = tail_memdup(&attr, sizeof(attr)); - return sys_bpf(cmd, (unsigned long) t_attr, sizeof(attr)); + if (!log_buf) + log_buf = tail_alloc(log_buf_size); + return log_buf; } -# endif -/* BPF_PROG_ATTACH and BPF_PROG_DETACH commands appear in kernel 4.10. */ -# ifdef HAVE_UNION_BPF_ATTR_ATTACH_TYPE -static int -prog_cgroup(int cmd) +static inline char * +get_log_buf_tail(void) { - union bpf_attr attr = { - .target_fd = -1, - .attach_bpf_fd = -1, - .attach_type = 0 - }; - void *const t_attr = tail_memdup(&attr, sizeof(attr)); - return sys_bpf(cmd, (unsigned long) t_attr, sizeof(attr)); + return get_log_buf() + log_buf_size; } -# endif -static unsigned long efault; +#if VERBOSE +# define INSNS_FMT \ + "[{code=BPF_JMP|BPF_K|BPF_EXIT, dst_reg=BPF_REG_10" \ + ", src_reg=0xb /* BPF_REG_??? */, off=%d, imm=%#x}]" +# define INSNS_ARG insns[0].off, insns[0].imm +#else +# define INSNS_FMT "%p" +# define INSNS_ARG insns +#endif + +static void +init_BPF_PROG_LOAD_attr3(struct bpf_attr_check *check) +{ + struct BPF_PROG_LOAD_struct *attr = &check->data.BPF_PROG_LOAD_data; + + attr->insns = (uintptr_t) insns; + attr->license = (uintptr_t) license; + attr->log_buf = (uintptr_t) get_log_buf_tail(); +} static void -bogus_bpf(int cmd, const char *name) +print_BPF_PROG_LOAD_attr3(const struct bpf_attr_check *check, unsigned long addr) { - const unsigned long bogus_size = 1024; - const unsigned long bogus_addr = efault - bogus_size; + printf("prog_type=BPF_PROG_TYPE_SOCKET_FILTER, insn_cnt=%u" + ", insns=" INSNS_FMT ", license=\"%s\", log_level=2718281828" + ", log_size=%u, log_buf=%p" + ", kern_version=KERNEL_VERSION(51966, 240, 13)" + ", prog_flags=0x4 /* BPF_F_??? */" + ", prog_name=\"0123456789abcde\"..., prog_ifindex=3203399405", + (unsigned int) ARRAY_SIZE(insns), INSNS_ARG, license, + log_buf_size, get_log_buf_tail()); +} - sys_bpf(cmd, efault, 4); - printf("bpf(%s, %#lx, %lu) = %s\n", - name, efault, 4UL, errstr); +static void +init_BPF_PROG_LOAD_attr4(struct bpf_attr_check *check) +{ + struct BPF_PROG_LOAD_struct *attr = &check->data.BPF_PROG_LOAD_data; - sys_bpf(cmd, efault, bogus_size); - printf("bpf(%s, %#lx, %lu) = %s\n", - name, efault, bogus_size, errstr); + attr->insns = (uintptr_t) insns; + attr->license = (uintptr_t) license; + attr->log_buf = (uintptr_t) get_log_buf(); + attr->prog_ifindex = ifindex_lo(); - sys_bpf(cmd, bogus_addr, 0); - printf("bpf(%s, %#lx, %lu) = %s\n", - name, bogus_addr, 0UL, errstr); + strncpy(log_buf, "log test", 9); } -#define BOGUS_BPF(cmd) bogus_bpf(cmd, #cmd) +static void +print_BPF_PROG_LOAD_attr4(const struct bpf_attr_check *check, unsigned long addr) +{ + printf("prog_type=BPF_PROG_TYPE_UNSPEC, insn_cnt=%u, insns=" INSNS_FMT + ", license=\"%s\", log_level=2718281828, log_size=4" + ", log_buf=\"log \"..." + ", kern_version=KERNEL_VERSION(51966, 240, 13)" + ", prog_flags=BPF_F_STRICT_ALIGNMENT|BPF_F_ANY_ALIGNMENT|0x4" + ", prog_name=\"0123456789abcde\"..., prog_ifindex=%s" + ", expected_attach_type=BPF_CGROUP_INET6_BIND", + (unsigned int) ARRAY_SIZE(insns), INSNS_ARG, + license, IFINDEX_LO_STR); +} -int -main(void) +static struct bpf_attr_check BPF_PROG_LOAD_checks[] = { + { + .data = { .BPF_PROG_LOAD_data = { .prog_type = 1 } }, + .size = offsetofend(struct BPF_PROG_LOAD_struct, prog_type), + .str = "prog_type=BPF_PROG_TYPE_SOCKET_FILTER" + ", insn_cnt=0, insns=NULL, license=NULL" + }, + { /* 1 */ + .data = { .BPF_PROG_LOAD_data = { + .prog_type = 22, + .insn_cnt = 0xbadc0ded, + .insns = 0, + .license = 0, + .log_level = 42, + .log_size = 3141592653U, + .log_buf = 0, + .kern_version = 0xcafef00d, + .prog_flags = 0, + } }, + .size = offsetofend(struct BPF_PROG_LOAD_struct, prog_flags), + .str = "prog_type=0x16 /* BPF_PROG_TYPE_??? */" + ", insn_cnt=3134983661, insns=NULL, license=NULL" + ", log_level=42, log_size=3141592653, log_buf=NULL" + ", kern_version=KERNEL_VERSION(51966, 240, 13)" + ", prog_flags=0", + }, + { /* 2 */ + .data = { .BPF_PROG_LOAD_data = { + .prog_type = 20, + .insn_cnt = 0xbadc0ded, + .insns = 0xffffffff00000000, + .license = 0xffffffff00000000, + .log_level = 2718281828U, + .log_size = log_buf_size, + .log_buf = 0xffffffff00000000, + .kern_version = 0xcafef00d, + .prog_flags = 1, + .prog_name = "fedcba987654321", + } }, + .size = offsetofend(struct BPF_PROG_LOAD_struct, prog_name), + .str = "prog_type=BPF_PROG_TYPE_SK_REUSEPORT" + ", insn_cnt=3134983661" + ", insns=" BIG_ADDR("0xffffffff00000000", "NULL") + ", license=" BIG_ADDR("0xffffffff00000000", "NULL") + ", log_level=2718281828, log_size=4096" + ", log_buf=" BIG_ADDR("0xffffffff00000000", "NULL") + ", kern_version=KERNEL_VERSION(51966, 240, 13)" + ", prog_flags=BPF_F_STRICT_ALIGNMENT" + ", prog_name=\"fedcba987654321\"", + }, + { /* 3 */ + .data = { .BPF_PROG_LOAD_data = { + .prog_type = 1, + .insn_cnt = ARRAY_SIZE(insns), + .log_level = 2718281828U, + .log_size = log_buf_size, + .kern_version = 0xcafef00d, + .prog_flags = 4, + .prog_name = "0123456789abcdef", + .prog_ifindex = 0xbeeffeed, + } }, + .size = offsetofend(struct BPF_PROG_LOAD_struct, prog_ifindex), + .init_fn = init_BPF_PROG_LOAD_attr3, + .print_fn = print_BPF_PROG_LOAD_attr3 + }, + { /* 4 */ + .data = { .BPF_PROG_LOAD_data = { + .prog_type = 0, + .insn_cnt = ARRAY_SIZE(insns), + .log_level = 2718281828U, + .log_size = 4, + .kern_version = 0xcafef00d, + .prog_flags = 7, + .prog_name = "0123456789abcdef", + .expected_attach_type = 9, + } }, + .size = offsetofend(struct BPF_PROG_LOAD_struct, + expected_attach_type), + .init_fn = init_BPF_PROG_LOAD_attr4, + .print_fn = print_BPF_PROG_LOAD_attr4 + }, + { /* 5 */ + .data = { .BPF_PROG_LOAD_data = { + .prog_flags = 2, + .expected_attach_type = 17, + .prog_btf_fd = 0xbadc0ded, + .func_info_rec_size = 0xdad1bef2, + .func_info = 0xfac1fed2fac3fed4, + .func_info_cnt = 0xdad3bef4, + .line_info_rec_size = 0xdad5bef6, + .line_info = 0xfac5fed5fac7fed8, + .line_info_cnt = 0xdad7bef8 + } }, + .size = offsetofend(struct BPF_PROG_LOAD_struct, + line_info_cnt), + .str = "prog_type=BPF_PROG_TYPE_UNSPEC" + ", insn_cnt=0" + ", insns=NULL" + ", license=NULL" + ", log_level=0" + ", log_size=0" + ", log_buf=NULL" + ", kern_version=KERNEL_VERSION(0, 0, 0)" + ", prog_flags=BPF_F_ANY_ALIGNMENT" + ", prog_name=\"\"" + ", prog_ifindex=0" + ", expected_attach_type=BPF_FLOW_DISSECTOR" + ", prog_btf_fd=-1159983635" + ", func_info_rec_size=3671178994" + ", func_info=0xfac1fed2fac3fed4" + ", func_info_cnt=3671310068" + ", line_info_rec_size=3671441142" + ", line_info=0xfac5fed5fac7fed8" + ", line_info_cnt=3671572216" + }, +}; + +static void +init_BPF_OBJ_PIN_attr(struct bpf_attr_check *check) { - efault = (unsigned long) tail_alloc(1) + 1; - - map_create(); - printf("bpf(BPF_MAP_CREATE" - ", {map_type=BPF_MAP_TYPE_UNSPEC, key_size=4" - ", value_size=8, max_entries=256}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_MAP_CREATE); - - map_any(BPF_MAP_LOOKUP_ELEM); - printf("bpf(BPF_MAP_LOOKUP_ELEM" - ", {map_fd=-1, key=0xdeadbeef}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_MAP_LOOKUP_ELEM); - - map_any(BPF_MAP_UPDATE_ELEM); - printf("bpf(BPF_MAP_UPDATE_ELEM" - ", {map_fd=-1, key=0xdeadbeef" - ", value=0xbadc0ded, flags=BPF_ANY}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_MAP_UPDATE_ELEM); - - map_any(BPF_MAP_DELETE_ELEM); - printf("bpf(BPF_MAP_DELETE_ELEM" - ", {map_fd=-1, key=0xdeadbeef}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_MAP_DELETE_ELEM); - - map_any(BPF_MAP_GET_NEXT_KEY); - printf("bpf(BPF_MAP_GET_NEXT_KEY" - ", {map_fd=-1, key=0xdeadbeef}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_MAP_GET_NEXT_KEY); - - prog_load(); - printf("bpf(BPF_PROG_LOAD" - ", {prog_type=BPF_PROG_TYPE_UNSPEC, insn_cnt=1, insns=%p" - ", license=\"GPL\", log_level=42, log_size=4096, log_buf=%p" - ", kern_version=0}, %u) = %s\n", - insns, log_buf, (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_PROG_LOAD); - -# ifdef HAVE_UNION_BPF_ATTR_BPF_FD - obj_manage(BPF_OBJ_PIN); - printf("bpf(BPF_OBJ_PIN" - ", {pathname=\"/sys/fs/bpf/foo/bar\", bpf_fd=-1}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_OBJ_PIN); - - obj_manage(BPF_OBJ_GET); - printf("bpf(BPF_OBJ_GET" - ", {pathname=\"/sys/fs/bpf/foo/bar\", bpf_fd=-1}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_OBJ_GET); -# endif - -# ifdef HAVE_UNION_BPF_ATTR_ATTACH_TYPE - prog_cgroup(BPF_PROG_ATTACH); - printf("bpf(BPF_PROG_ATTACH" - ", {target_fd=-1, attach_bpf_fd=-1" - ", attach_type=BPF_CGROUP_INET_INGRESS}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_PROG_ATTACH); - - prog_cgroup(BPF_PROG_DETACH); - printf("bpf(BPF_PROG_DETACH" - ", {target_fd=-1, attach_type=BPF_CGROUP_INET_INGRESS}, %u)" - " = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_PROG_DETACH); -# endif - - bogus_bpf(0xfacefeed, "0xfacefeed /* BPF_??? */"); + struct BPF_OBJ_PIN_struct *attr = &check->data.BPF_OBJ_PIN_data; + attr->pathname = (uintptr_t) pathname; +} - puts("+++ exited with 0 +++"); - return 0; +static struct bpf_attr_check BPF_OBJ_PIN_checks[] = { + { + .data = { .BPF_OBJ_PIN_data = { .pathname = 0 } }, + .size = offsetofend(struct BPF_OBJ_PIN_struct, pathname), + .str = "pathname=NULL, bpf_fd=0" + }, + { + .data = { .BPF_OBJ_PIN_data = { + .pathname = 0xFFFFFFFFFFFFFFFFULL + } }, + .size = offsetofend(struct BPF_OBJ_PIN_struct, pathname), + .str = "pathname=" BIG_ADDR("0xffffffffffffffff", "0xffffffff") + ", bpf_fd=0", + }, + { + .data = { .BPF_OBJ_PIN_data = { .bpf_fd = -1 } }, + .size = offsetofend(struct BPF_OBJ_PIN_struct, bpf_fd), + .init_fn = init_BPF_OBJ_PIN_attr, + .str = "pathname=\"/sys/fs/bpf/foo/bar\", bpf_fd=-1" + }, + { + .data = { .BPF_OBJ_PIN_data = { + .bpf_fd = -1, + .file_flags = 0x18 + } }, + .size = offsetofend(struct BPF_OBJ_PIN_struct, file_flags), + .init_fn = init_BPF_OBJ_PIN_attr, + .str = "pathname=\"/sys/fs/bpf/foo/bar\", bpf_fd=-1" + ", file_flags=BPF_F_RDONLY|BPF_F_WRONLY" + } +}; + +#define BPF_OBJ_GET_checks BPF_OBJ_PIN_checks + +static const struct bpf_attr_check BPF_PROG_ATTACH_checks[] = { + { + .data = { .BPF_PROG_ATTACH_data = { .target_fd = -1 } }, + .size = offsetofend(struct BPF_PROG_ATTACH_struct, target_fd), + .str = "target_fd=-1, attach_bpf_fd=0" + ", attach_type=BPF_CGROUP_INET_INGRESS, attach_flags=0" + }, + { + .data = { .BPF_PROG_ATTACH_data = { + .target_fd = -1, + .attach_bpf_fd = -2, + .attach_type = 2, + .attach_flags = 1 + } }, + .size = offsetofend(struct BPF_PROG_ATTACH_struct, attach_flags), + .str = "target_fd=-1, attach_bpf_fd=-2" + ", attach_type=BPF_CGROUP_INET_SOCK_CREATE" + ", attach_flags=BPF_F_ALLOW_OVERRIDE" + } +}; + + +static const struct bpf_attr_check BPF_PROG_DETACH_checks[] = { + { + .data = { .BPF_PROG_DETACH_data = { .target_fd = -1 } }, + .size = offsetofend(struct BPF_PROG_DETACH_struct, target_fd), + .str = "target_fd=-1, attach_type=BPF_CGROUP_INET_INGRESS" + }, + { + .data = { .BPF_PROG_DETACH_data = { + .target_fd = -1, + .attach_type = 2 + } }, + .size = offsetofend(struct BPF_PROG_DETACH_struct, attach_type), + .str = "target_fd=-1, attach_type=BPF_CGROUP_INET_SOCK_CREATE" + } +}; + +static const struct bpf_attr_check BPF_PROG_TEST_RUN_checks[] = { + { + .data = { .BPF_PROG_TEST_RUN_data = { .prog_fd = -1 } }, + .size = offsetofend(struct BPF_PROG_TEST_RUN_struct, prog_fd), + .str = "test={prog_fd=-1, retval=0, data_size_in=0" + ", data_size_out=0, data_in=NULL, data_out=NULL" + ", repeat=0, duration=0}" + }, + { + .data = { .BPF_PROG_TEST_RUN_data = { + .prog_fd = -1, + .retval = 0xfac1fed2, + .data_size_in = 0xfac3fed4, + .data_size_out = 0xfac5fed6, + .data_in = (uint64_t) 0xfacef11dbadc2dedULL, + .data_out = (uint64_t) 0xfacef33dbadc4dedULL, + .repeat = 0xfac7fed8, + .duration = 0xfac9feda + } }, + .size = offsetofend(struct BPF_PROG_TEST_RUN_struct, duration), + .str = "test={prog_fd=-1, retval=4207017682" + ", data_size_in=4207148756, data_size_out=4207279830" + ", data_in=0xfacef11dbadc2ded" + ", data_out=0xfacef33dbadc4ded" + ", repeat=4207410904, duration=4207541978}" + } +}; + +static const struct bpf_attr_check BPF_PROG_GET_NEXT_ID_checks[] = { + { + .data = { .BPF_PROG_GET_NEXT_ID_data = { + .start_id = 0xdeadbeef + } }, + .size = offsetofend(struct BPF_PROG_GET_NEXT_ID_struct, start_id), + .str = "start_id=3735928559, next_id=0" + }, + { + .data = { .BPF_PROG_GET_NEXT_ID_data = { + .start_id = 0xdeadbeef + } }, + .size = 1, + .str = "start_id=" +#if WORDS_BIGENDIAN + "3724541952" /* 0xde000000 */ +#else + "239" /* 0x000000ef */ +#endif + ", next_id=0" + }, + { + .data = { .BPF_PROG_GET_NEXT_ID_data = { + .start_id = 0xbadc0ded, + .next_id = 0xcafef00d + } }, + .size = offsetofend(struct BPF_PROG_GET_NEXT_ID_struct, next_id), + .str = "start_id=3134983661, next_id=3405705229" + }, + { + .data = { .BPF_PROG_GET_NEXT_ID_data = { + .start_id = 0xbadc0ded, + .next_id = 0xcafef00d, + .open_flags = 0xffffff27 + } }, + .size = offsetofend(struct BPF_PROG_GET_NEXT_ID_struct, open_flags), + .str = "start_id=3134983661, next_id=3405705229" + ", open_flags=0xffffff27 /* BPF_F_??? */" + } +}; + +#define BPF_MAP_GET_NEXT_ID_checks BPF_PROG_GET_NEXT_ID_checks + +static const struct bpf_attr_check BPF_PROG_GET_FD_BY_ID_checks[] = { + { + .data = { .BPF_PROG_GET_FD_BY_ID_data = { + .prog_id = 0xdeadbeef + } }, + .size = offsetofend(struct BPF_PROG_GET_FD_BY_ID_struct, prog_id), + .str = "prog_id=3735928559, next_id=0" + }, + { + .data = { .BPF_PROG_GET_FD_BY_ID_data = { + .prog_id = 0xbadc0ded, + .next_id = 0xcafef00d + } }, + .size = offsetofend(struct BPF_PROG_GET_FD_BY_ID_struct, next_id), + .str = "prog_id=3134983661, next_id=3405705229" + }, + { + .data = { .BPF_PROG_GET_FD_BY_ID_data = { + .prog_id = 0xbadc0ded, + .next_id = 0xcafef00d, + .open_flags = 0xffffff27 + } }, + .size = offsetofend(struct BPF_PROG_GET_FD_BY_ID_struct, open_flags), + .str = "prog_id=3134983661, next_id=3405705229" + ", open_flags=0xffffff27 /* BPF_F_??? */" + } +}; + +static const struct bpf_attr_check BPF_MAP_GET_FD_BY_ID_checks[] = { + { + .data = { .BPF_MAP_GET_FD_BY_ID_data = { + .map_id = 0xdeadbeef + } }, + .size = offsetofend(struct BPF_MAP_GET_FD_BY_ID_struct, map_id), + .str = "map_id=3735928559, next_id=0" + }, + { + .data = { .BPF_MAP_GET_FD_BY_ID_data = { + .map_id = 0xbadc0ded, + .next_id = 0xcafef00d + } }, + .size = offsetofend(struct BPF_MAP_GET_FD_BY_ID_struct, next_id), + .str = "map_id=3134983661, next_id=3405705229" + }, + { + .data = { .BPF_MAP_GET_FD_BY_ID_data = { + .map_id = 0xbadc0ded, + .next_id = 0xcafef00d, + .open_flags = 0xffffff27 + } }, + .size = offsetofend(struct BPF_MAP_GET_FD_BY_ID_struct, open_flags), + .str = "map_id=3134983661, next_id=3405705229" + ", open_flags=0xffffff27 /* BPF_F_??? */" + } +}; + +static const struct bpf_attr_check BPF_OBJ_GET_INFO_BY_FD_checks[] = { + { + .data = { .BPF_OBJ_GET_INFO_BY_FD_data = { .bpf_fd = -1 } }, + .size = offsetofend(struct BPF_OBJ_GET_INFO_BY_FD_struct, bpf_fd), + .str = "info={bpf_fd=-1, info_len=0, info=NULL}" + }, + { + .data = { .BPF_OBJ_GET_INFO_BY_FD_data = { + .bpf_fd = -1, + .info_len = 0xdeadbeef, + .info = (uint64_t) 0xfacefeedbadc0dedULL + } }, + .size = offsetofend(struct BPF_OBJ_GET_INFO_BY_FD_struct, info), + .str = "info={bpf_fd=-1, info_len=3735928559" + ", info=0xfacefeedbadc0ded}" + } +}; + + +static uint32_t prog_load_ids[] = { 0, 1, 0xffffffff, 2718281828, }; +uint32_t *prog_load_ids_ptr; + +static void +init_BPF_PROG_QUERY_attr4(struct bpf_attr_check *check) +{ + struct BPF_PROG_QUERY_struct *attr = &check->data.BPF_PROG_QUERY_data; + + if (!prog_load_ids_ptr) + prog_load_ids_ptr = tail_memdup(prog_load_ids, + sizeof(prog_load_ids)); + + attr->prog_ids = (uintptr_t) prog_load_ids_ptr; + attr->prog_cnt = ARRAY_SIZE(prog_load_ids); } +static void +print_BPF_PROG_QUERY_attr4(const struct bpf_attr_check *check, unsigned long addr) +{ + printf("query={target_fd=-1153374643" + ", attach_type=0xfeedface /* BPF_??? */" + ", query_flags=BPF_F_QUERY_EFFECTIVE|0xdeadf00c" + ", attach_flags=BPF_F_ALLOW_MULTI|0xbeefcafc" +#if defined(INJECT_RETVAL) && INJECT_RETVAL > 0 + ", prog_ids=[0, 1, 4294967295, 2718281828], prog_cnt=4}" #else + ", prog_ids=%p, prog_cnt=4}", prog_load_ids_ptr +#endif + ); +} + +static void +init_BPF_PROG_QUERY_attr5(struct bpf_attr_check *check) +{ + struct BPF_PROG_QUERY_struct *attr = &check->data.BPF_PROG_QUERY_data; -SKIP_MAIN_UNDEFINED("__NR_bpf") + if (!prog_load_ids_ptr) + prog_load_ids_ptr = tail_memdup(prog_load_ids, + sizeof(prog_load_ids)); + attr->prog_ids = (uintptr_t) prog_load_ids_ptr; + attr->prog_cnt = ARRAY_SIZE(prog_load_ids) + 1; +} + +static void +print_BPF_PROG_QUERY_attr5(const struct bpf_attr_check *check, unsigned long addr) +{ + printf("query={target_fd=-1153374643" + ", attach_type=0xfeedface /* BPF_??? */" + ", query_flags=BPF_F_QUERY_EFFECTIVE|0xdeadf00c" + ", attach_flags=BPF_F_ALLOW_MULTI|0xbeefcafc" +#if defined(INJECT_RETVAL) && INJECT_RETVAL > 0 + ", prog_ids=[0, 1, 4294967295, 2718281828, ... /* %p */]" + ", prog_cnt=5}", + prog_load_ids_ptr + ARRAY_SIZE(prog_load_ids) +#else + ", prog_ids=%p, prog_cnt=5}", prog_load_ids_ptr #endif + ); +} + +static struct bpf_attr_check BPF_PROG_QUERY_checks[] = { + { + .data = { .BPF_PROG_QUERY_data = { .target_fd = -1 } }, + .size = offsetofend(struct BPF_PROG_QUERY_struct, target_fd), + .str = "query={target_fd=-1" + ", attach_type=BPF_CGROUP_INET_INGRESS, query_flags=0" + ", attach_flags=0, prog_ids=NULL, prog_cnt=0}", + }, + { /* 1 */ + .data = { .BPF_PROG_QUERY_data = { + .target_fd = 3141592653U, + .attach_type = 16, + .query_flags = 1, + .attach_flags = 3, + } }, + .size = offsetofend(struct BPF_PROG_QUERY_struct, attach_flags), + .str = "query={target_fd=-1153374643" + ", attach_type=BPF_LIRC_MODE2" + ", query_flags=BPF_F_QUERY_EFFECTIVE" + ", attach_flags=BPF_F_ALLOW_OVERRIDE|BPF_F_ALLOW_MULTI" + ", prog_ids=NULL, prog_cnt=0}", + }, + { /* 2 */ + .data = { .BPF_PROG_QUERY_data = { + .target_fd = 3141592653U, + .attach_type = 18, + .query_flags = 0xfffffffe, + .attach_flags = 0xfffffffc, + .prog_ids = 0xffffffffffffffffULL, + .prog_cnt = 2718281828, + } }, + .size = offsetofend(struct BPF_PROG_QUERY_struct, prog_cnt), + .str = "query={target_fd=-1153374643" + ", attach_type=0x12 /* BPF_??? */" + ", query_flags=0xfffffffe /* BPF_F_QUERY_??? */" + ", attach_flags=0xfffffffc /* BPF_F_??? */" + ", prog_ids=" + BIG_ADDR("0xffffffffffffffff", "0xffffffff") + ", prog_cnt=2718281828}", + }, + { /* 3 */ + .data = { .BPF_PROG_QUERY_data = { + .target_fd = 3141592653U, + .attach_type = 0xfeedface, + .query_flags = 0xdeadf00d, + .attach_flags = 0xbeefcafe, + .prog_ids = 0xffffffffffffffffULL, + .prog_cnt = 0, + } }, + .size = offsetofend(struct BPF_PROG_QUERY_struct, prog_cnt), + .str = "query={target_fd=-1153374643" + ", attach_type=0xfeedface /* BPF_??? */" + ", query_flags=BPF_F_QUERY_EFFECTIVE|0xdeadf00c" + ", attach_flags=BPF_F_ALLOW_MULTI|0xbeefcafc" + ", prog_ids=" BIG_ADDR_MAYBE("0xffffffffffffffff") "[]" + ", prog_cnt=0}", + }, + { /* 4 */ + .data = { .BPF_PROG_QUERY_data = { + .target_fd = 3141592653U, + .attach_type = 0xfeedface, + .query_flags = 0xdeadf00d, + .attach_flags = 0xbeefcafe, + } }, + .size = offsetofend(struct BPF_PROG_QUERY_struct, prog_cnt), + .init_fn = init_BPF_PROG_QUERY_attr4, + .print_fn = print_BPF_PROG_QUERY_attr4, + }, + { /* 5 */ + .data = { .BPF_PROG_QUERY_data = { + .target_fd = 3141592653U, + .attach_type = 0xfeedface, + .query_flags = 0xdeadf00d, + .attach_flags = 0xbeefcafe, + } }, + .size = offsetofend(struct BPF_PROG_QUERY_struct, prog_cnt), + .init_fn = init_BPF_PROG_QUERY_attr5, + .print_fn = print_BPF_PROG_QUERY_attr5, + }, +}; + + +static void +init_BPF_RAW_TRACEPOINT_attr2(struct bpf_attr_check *check) +{ + /* TODO: test the 128 byte limit */ + static const char tp_name[] = "0123456789qwertyuiop0123456789qwe"; + + struct BPF_RAW_TRACEPOINT_OPEN_struct *attr = + &check->data.BPF_RAW_TRACEPOINT_OPEN_data; + + attr->name = (uintptr_t) tp_name; +} + +static struct bpf_attr_check BPF_RAW_TRACEPOINT_OPEN_checks[] = { + { + .data = { .BPF_RAW_TRACEPOINT_OPEN_data = { .name = 0 } }, + .size = offsetofend(struct BPF_RAW_TRACEPOINT_OPEN_struct, + name), + .str = "raw_tracepoint={name=NULL, prog_fd=0}", + }, + { /* 1 */ + .data = { .BPF_RAW_TRACEPOINT_OPEN_data = { + .name = 0xffffffff00000000ULL, + .prog_fd = 0xdeadbeef, + } }, + .size = offsetofend(struct BPF_RAW_TRACEPOINT_OPEN_struct, + prog_fd), + .str = "raw_tracepoint=" + "{name=" BIG_ADDR("0xffffffff00000000", "NULL") + ", prog_fd=-559038737}", + }, + { + .data = { .BPF_RAW_TRACEPOINT_OPEN_data = { + .prog_fd = 0xdeadbeef, + } }, + .size = offsetofend(struct BPF_RAW_TRACEPOINT_OPEN_struct, + prog_fd), + .init_fn = init_BPF_RAW_TRACEPOINT_attr2, + .str = "raw_tracepoint=" + "{name=\"0123456789qwertyuiop0123456789qw\"..." + ", prog_fd=-559038737}", + } +}; + +static void +init_BPF_BTF_LOAD_attr(struct bpf_attr_check *check) +{ + static const char sample_btf_data[] = "bPf\0daTum"; + + static char *btf_data; + if (!btf_data) + btf_data = tail_memdup(sample_btf_data, + sizeof(sample_btf_data) - 1); + + struct BPF_BTF_LOAD_struct *attr = &check->data.BPF_BTF_LOAD_data; + attr->btf = (uintptr_t) btf_data; +} + +static struct bpf_attr_check BPF_BTF_LOAD_checks[] = { + { + .data = { .BPF_BTF_LOAD_data = { .btf = 0 } }, + .size = offsetofend(struct BPF_BTF_LOAD_struct, btf), + .str = "btf=NULL, btf_log_buf=NULL, btf_size=0" + ", btf_log_size=0, btf_log_level=0" + }, + { /* 1 */ + .data = { .BPF_BTF_LOAD_data = { + .btf_log_buf = 0xfacefeeddeadbeefULL, + .btf_size = 9, + .btf_log_size = -1U, + .btf_log_level = 42 + } }, + .size = offsetofend(struct BPF_BTF_LOAD_struct, btf_log_level), + .init_fn = init_BPF_BTF_LOAD_attr, + .str = "btf=\"bPf\\0daTum\"" + ", btf_log_buf=0xfacefeeddeadbeef" + ", btf_size=9" + ", btf_log_size=4294967295" + ", btf_log_level=42" + } +}; + +static const struct bpf_attr_check BPF_BTF_GET_FD_BY_ID_checks[] = { + { + .data = { .BPF_BTF_GET_FD_BY_ID_data = { .btf_id = 0xdeadbeef } }, + .size = offsetofend(struct BPF_BTF_GET_FD_BY_ID_struct, btf_id), + .str = "btf_id=3735928559" + } +}; + +static const struct bpf_attr_check BPF_TASK_FD_QUERY_checks[] = { + { + .data = { .BPF_TASK_FD_QUERY_data = { .pid = 0xdeadbeef } }, + .size = offsetofend(struct BPF_TASK_FD_QUERY_struct, pid), + .str = "task_fd_query={pid=3735928559, fd=0, flags=0" + ", buf_len=0, buf=NULL, prog_id=0" + ", fd_type=BPF_FD_TYPE_RAW_TRACEPOINT" + ", probe_offset=0, probe_addr=0}" + }, + { /* 1 */ + .data = { .BPF_TASK_FD_QUERY_data = { + .pid = 0xcafef00d, + .fd = 0xdeadbeef, + .flags = 0xfacefeed, + .buf_len = 0xdefaced, + .buf = 0xfffffffffffffffe, + .prog_id = 0xbadc0ded, + .fd_type = 5, + .probe_offset = 0xfac1fed2fac3fed4, + .probe_addr = 0xfac5fed5fac7fed8 + } }, + .size = offsetofend(struct BPF_TASK_FD_QUERY_struct, probe_addr), + .str = "task_fd_query={pid=3405705229" + ", fd=-559038737" + ", flags=4207869677" + ", buf_len=233811181" + ", buf=" BIG_ADDR("0xfffffffffffffffe", "0xfffffffe") + ", prog_id=3134983661" + ", fd_type=BPF_FD_TYPE_URETPROBE" + ", probe_offset=0xfac1fed2fac3fed4" + ", probe_addr=0xfac5fed5fac7fed8}" + } +}; + + +#define CHK(cmd_) \ + { \ + cmd_, #cmd_, \ + cmd_##_checks, ARRAY_SIZE(cmd_##_checks), \ + } \ + /* End of CHK definition */ + +int +main(void) +{ + static const struct bpf_check checks[] = { + CHK(BPF_MAP_CREATE), + CHK(BPF_MAP_LOOKUP_ELEM), + CHK(BPF_MAP_UPDATE_ELEM), + CHK(BPF_MAP_DELETE_ELEM), + CHK(BPF_MAP_GET_NEXT_KEY), + CHK(BPF_PROG_LOAD), + CHK(BPF_OBJ_PIN), + CHK(BPF_OBJ_GET), + CHK(BPF_PROG_ATTACH), + CHK(BPF_PROG_DETACH), + CHK(BPF_PROG_TEST_RUN), + CHK(BPF_PROG_GET_NEXT_ID), + CHK(BPF_MAP_GET_NEXT_ID), + CHK(BPF_PROG_GET_FD_BY_ID), + CHK(BPF_MAP_GET_FD_BY_ID), + CHK(BPF_OBJ_GET_INFO_BY_FD), + CHK(BPF_PROG_QUERY), + CHK(BPF_RAW_TRACEPOINT_OPEN), + CHK(BPF_BTF_LOAD), + CHK(BPF_BTF_GET_FD_BY_ID), + CHK(BPF_TASK_FD_QUERY), + CHK(BPF_MAP_LOOKUP_AND_DELETE_ELEM), + }; + + page_size = get_page_size(); + end_of_page = (unsigned long) tail_alloc(1) + 1; + + for (size_t i = 0; i < ARRAY_SIZE(checks); i++) + test_bpf(checks + i); + + sys_bpf(0xfacefeed, 0, (kernel_ulong_t) 0xfacefeedbadc0dedULL); + printf("bpf(0xfacefeed /* BPF_??? */, NULL, %u) = %s\n", + 0xbadc0dedu, errstr); + + sys_bpf(0xfacefeed, end_of_page, 40); + printf("bpf(0xfacefeed /* BPF_??? */, %#lx, 40) = %s\n", + end_of_page, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/bpf.gen.test b/tests-mx32/bpf.gen.test new file mode 100755 index 00000000..1391d6b8 --- /dev/null +++ b/tests-mx32/bpf.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (bpf -a20 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-mx32/bpf.test b/tests-mx32/bpf.test deleted file mode 100755 index adf0d576..00000000 --- a/tests-mx32/bpf.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check bpf syscall decoding. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a20 diff --git a/tests-mx32/brk.c b/tests-mx32/brk.c index 572ebd61..caf40e13 100644 --- a/tests-mx32/brk.c +++ b/tests-mx32/brk.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/brk.test b/tests-mx32/brk.test index 8c0e2e49..e90cf8ab 100755 --- a/tests-mx32/brk.test +++ b/tests-mx32/brk.test @@ -1,10 +1,14 @@ #!/bin/sh - +# # Check brk syscall decoding. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog > /dev/null run_strace -a10 -ebrk $args > "$EXP" match_grep "$LOG" "$EXP" -rm -f "$EXP" diff --git a/tests-mx32/btrfs-X.test b/tests-mx32/btrfs-X.test new file mode 100755 index 00000000..58770ae0 --- /dev/null +++ b/tests-mx32/btrfs-X.test @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Check verbose xlat decoding of btrfs ioctl. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog ../btrfs -X > /dev/null +run_strace -a16 -Xverbose -eioctl $args > "$EXP" +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests-mx32/btrfs-v.test b/tests-mx32/btrfs-v.test index 1ee17b4b..f67d4126 100755 --- a/tests-mx32/btrfs-v.test +++ b/tests-mx32/btrfs-v.test @@ -1,15 +1,16 @@ #!/bin/sh - -# Check verbose decoding of btrfs ioctl +# +# Check verbose decoding of btrfs ioctl. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./btrfs -v > /dev/null -run_strace -a16 -veioctl $args > "$EXP" check_prog grep +run_prog ../btrfs -v > /dev/null +run_strace -a16 -veioctl $args > "$EXP" grep -v '^ioctl([012],' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" - -exit 0 diff --git a/tests-mx32/btrfs-vX.test b/tests-mx32/btrfs-vX.test new file mode 100755 index 00000000..db15a50c --- /dev/null +++ b/tests-mx32/btrfs-vX.test @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Check verbose, verbose xlat decoding of btrfs ioctl. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog ../btrfs -v -X > /dev/null +run_strace -a16 -Xverbose -veioctl $args > "$EXP" +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests-mx32/btrfs-vw.test b/tests-mx32/btrfs-vw.test index c7e40ad7..eba59d7a 100755 --- a/tests-mx32/btrfs-vw.test +++ b/tests-mx32/btrfs-vw.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check verbose decoding of btrfs ioctl w/ live ioctls. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later # WARNING: USE OF THIS TEST WILL MODIFY AN EXISTING BTRFS FILE SYSTEM @@ -18,12 +23,8 @@ elif [ ! -d "${BTRFS_MOUNTPOINT}" ]; then skip_ "\$BTRFS_MOUNTPOINT does not point to a directory" fi -run_prog ./btrfs -v -w "${BTRFS_MOUNTPOINT}" > /dev/null -run_strace -a16 -veioctl $args > "$EXP" check_prog grep +run_prog ../btrfs -v -w "${BTRFS_MOUNTPOINT}" > /dev/null +run_strace -a16 -veioctl $args > "$EXP" grep -v '^ioctl([012],' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" - -exit 0 diff --git a/tests-mx32/btrfs-vwX.test b/tests-mx32/btrfs-vwX.test new file mode 100755 index 00000000..20f60abe --- /dev/null +++ b/tests-mx32/btrfs-vwX.test @@ -0,0 +1,30 @@ +#!/bin/sh +# +# Check verbose, verbose xlat decoding of btrfs ioctl w/ live ioctls. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +# WARNING: USE OF THIS TEST WILL MODIFY AN EXISTING BTRFS FILE SYSTEM + +# Typical usage: +# mkfs.btrfs +# mount /mnt +# BTRFS_MOUNTPOINT=/mnt make check TESTS="btrfs-vwX" +# umount /mnt + +. "${srcdir=.}/init.sh" + +if [ -z "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT not set" +elif [ ! -d "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT does not point to a directory" +fi + +check_prog grep +run_prog ../btrfs -v -w -X "${BTRFS_MOUNTPOINT}" > /dev/null +run_strace -a16 -Xverbose -veioctl $args > "$EXP" +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests-mx32/btrfs-w.test b/tests-mx32/btrfs-w.test index 6238dca8..ba9b220d 100755 --- a/tests-mx32/btrfs-w.test +++ b/tests-mx32/btrfs-w.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check decoding of btrfs ioctl w/ live ioctls. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later # WARNING: USE OF THIS TEST WILL MODIFY AN EXISTING BTRFS FILE SYSTEM @@ -18,12 +23,8 @@ elif [ ! -d "${BTRFS_MOUNTPOINT}" ]; then skip_ "\$BTRFS_MOUNTPOINT does not point to a directory" fi -run_prog ./btrfs -w "${BTRFS_MOUNTPOINT}" > /dev/null -run_strace -a16 -eioctl $args > "$EXP" check_prog grep +run_prog ../btrfs -w "${BTRFS_MOUNTPOINT}" > /dev/null +run_strace -a16 -eioctl $args > "$EXP" grep -v '^ioctl([012],' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" - -exit 0 diff --git a/tests-mx32/btrfs-wX.test b/tests-mx32/btrfs-wX.test new file mode 100755 index 00000000..1a7dea2e --- /dev/null +++ b/tests-mx32/btrfs-wX.test @@ -0,0 +1,30 @@ +#!/bin/sh +# +# Check verbose xlat decoding of btrfs ioctl w/ live ioctls. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +# WARNING: USE OF THIS TEST WILL MODIFY AN EXISTING BTRFS FILE SYSTEM + +# Typical usage: +# mkfs.btrfs +# mount /mnt +# BTRFS_MOUNTPOINT=/mnt make check TESTS="btrfs-wX" +# umount /mnt + +. "${srcdir=.}/init.sh" + +if [ -z "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT not set" +elif [ ! -d "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT does not point to a directory" +fi + +check_prog grep +run_prog ../btrfs -w -X "${BTRFS_MOUNTPOINT}" > /dev/null +run_strace -a16 -Xverbose -eioctl $args > "$EXP" +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests-mx32/btrfs.c b/tests-mx32/btrfs.c index b3e23f80..f1a26bf3 100644 --- a/tests-mx32/btrfs.c +++ b/tests-mx32/btrfs.c @@ -1,57 +1,73 @@ +/* + * Copyright (c) 2016-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #ifdef HAVE_LINUX_BTRFS_H -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "xlat.h" - -#include "xlat/btrfs_balance_args.h" -#include "xlat/btrfs_balance_flags.h" -#include "xlat/btrfs_balance_state.h" -#include "xlat/btrfs_compress_types.h" -#include "xlat/btrfs_defrag_flags.h" -#include "xlat/btrfs_dev_stats_values.h" -#include "xlat/btrfs_dev_stats_flags.h" -#include "xlat/btrfs_qgroup_inherit_flags.h" -#include "xlat/btrfs_qgroup_limit_flags.h" -#include "xlat/btrfs_scrub_flags.h" -#include "xlat/btrfs_send_flags.h" -#include "xlat/btrfs_space_info_flags.h" -#include "xlat/btrfs_snap_flags_v2.h" -#include "xlat/btrfs_tree_objectids.h" -#include "xlat/btrfs_features_compat.h" -#include "xlat/btrfs_features_compat_ro.h" -#include "xlat/btrfs_features_incompat.h" -#include "xlat/btrfs_key_types.h" - -#ifdef HAVE_LINUX_FIEMAP_H -# include -# include "xlat/fiemap_flags.h" -# include "xlat/fiemap_extent_flags.h" -#endif - -#ifndef BTRFS_LABEL_SIZE -# define BTRFS_LABEL_SIZE 256 -#endif - -#ifndef BTRFS_NAME_LEN -# define BTRFS_NAME_LEN 255 -#endif +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include "xlat.h" + +# include "xlat/btrfs_balance_args.h" +# include "xlat/btrfs_balance_flags.h" +# include "xlat/btrfs_balance_state.h" +# include "xlat/btrfs_compress_types.h" +# include "xlat/btrfs_cont_reading_from_srcdev_mode.h" +# include "xlat/btrfs_defrag_flags.h" +# include "xlat/btrfs_dev_stats_values.h" +# include "xlat/btrfs_dev_stats_flags.h" +# include "xlat/btrfs_qgroup_inherit_flags.h" +# include "xlat/btrfs_qgroup_limit_flags.h" +# include "xlat/btrfs_scrub_flags.h" +# include "xlat/btrfs_send_flags.h" +# include "xlat/btrfs_space_info_flags.h" +# include "xlat/btrfs_snap_flags_v2.h" +# include "xlat/btrfs_tree_objectids.h" +# include "xlat/btrfs_features_compat.h" +# include "xlat/btrfs_features_compat_ro.h" +# include "xlat/btrfs_features_incompat.h" +# include "xlat/btrfs_key_types.h" + +# ifdef HAVE_LINUX_FIEMAP_H +# include +# include "xlat/fiemap_flags.h" +# include "xlat/fiemap_extent_flags.h" +# endif + +# ifndef BTRFS_LABEL_SIZE +# define BTRFS_LABEL_SIZE 256 +# endif + +# ifndef BTRFS_NAME_LEN +# define BTRFS_NAME_LEN 255 +# endif + +# ifndef FS_IOC_GETFSLABEL +# define FS_IOC_GETFSLABEL BTRFS_IOC_GET_FSLABEL +# endif + +# ifndef FS_IOC_SETFSLABEL +# define FS_IOC_SETFSLABEL BTRFS_IOC_SET_FSLABEL +# endif /* * Prior to Linux 3.12, the BTRFS_IOC_DEFAULT_SUBVOL used u64 in @@ -61,8 +77,13 @@ typedef __u64 u64; static const char *btrfs_test_root; static int btrfs_test_dir_fd; -static bool verbose = false; -static bool write_ok = false; +static bool verbose; +static bool write_ok; +static bool verbose_xlat; + +static const char *path; +static const char dir_name_fmt[] = "strace-test-%d"; +static char dir_name[sizeof(dir_name_fmt) + sizeof(int) * 3]; const unsigned char uuid_reference[BTRFS_UUID_SIZE] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, @@ -71,50 +92,50 @@ const unsigned char uuid_reference[BTRFS_UUID_SIZE] = { const char uuid_reference_string[] = "01234567-89ab-cdef-fedc-ba9876543210"; -#ifndef BTRFS_IOC_QUOTA_RESCAN +# ifndef BTRFS_IOC_QUOTA_RESCAN struct btrfs_ioctl_quota_rescan_args { uint64_t flags, progress, reserved[6]; }; -# define BTRFS_IOC_QUOTA_RESCAN _IOW(BTRFS_IOCTL_MAGIC, 44, \ - struct btrfs_ioctl_quota_rescan_args) -# define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \ - struct btrfs_ioctl_quota_rescan_args) -#endif - -#ifndef BTRFS_IOC_QUOTA_RESCAN_WAIT -# define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46) -#endif - -#ifndef BTRFS_IOC_GET_FEATURES -# define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \ - struct btrfs_ioctl_feature_flags) -# define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, \ - struct btrfs_ioctl_feature_flags[2]) -# define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \ - struct btrfs_ioctl_feature_flags[3]) -#endif - -#ifndef HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS +# define BTRFS_IOC_QUOTA_RESCAN \ + _IOW(BTRFS_IOCTL_MAGIC, 44, struct btrfs_ioctl_quota_rescan_args) +# define BTRFS_IOC_QUOTA_RESCAN_STATUS \ + _IOR(BTRFS_IOCTL_MAGIC, 45, struct btrfs_ioctl_quota_rescan_args) +# endif + +# ifndef BTRFS_IOC_QUOTA_RESCAN_WAIT +# define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46) +# endif + +# ifndef BTRFS_IOC_GET_FEATURES +# define BTRFS_IOC_GET_FEATURES \ + _IOR(BTRFS_IOCTL_MAGIC, 57, struct btrfs_ioctl_feature_flags) +# define BTRFS_IOC_SET_FEATURES \ + _IOW(BTRFS_IOCTL_MAGIC, 57, struct btrfs_ioctl_feature_flags[2]) +# define BTRFS_IOC_GET_SUPPORTED_FEATURES \ + _IOR(BTRFS_IOCTL_MAGIC, 57, struct btrfs_ioctl_feature_flags[3]) +# endif + +# ifndef HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS struct btrfs_ioctl_feature_flags { - uint64_t compat_flags; - uint64_t compat_ro_flags; - uint64_t incompat_flags; + uint64_t compat_flags; + uint64_t compat_ro_flags; + uint64_t incompat_flags; }; -#endif +# endif -#ifndef HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START +# ifndef HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START struct btrfs_ioctl_defrag_range_args { - uint64_t start; - uint64_t len; - uint64_t flags; - uint32_t extent_thresh; - uint32_t compress_type; - uint32_t unused[4]; + uint64_t start; + uint64_t len; + uint64_t flags; + uint32_t extent_thresh; + uint32_t compress_type; + uint32_t unused[4]; }; -#endif +# endif -#ifndef FIDEDUPERANGE -# define FIDEDUPERANGE _IOWR(0x94, 54, struct file_dedupe_range) +# ifndef FIDEDUPERANGE +# define FIDEDUPERANGE _IOWR(0x94, 54, struct file_dedupe_range) struct file_dedupe_range_info { int64_t dest_fd; /* in - destination file */ uint64_t dest_offset; /* in - start of extent in destination */ @@ -137,27 +158,99 @@ struct file_dedupe_range { uint32_t reserved2; /* must be zero */ struct file_dedupe_range_info info[0]; }; -#endif +# endif -#ifndef BTRFS_IOC_TREE_SEARCH_V2 -# define BTRFS_IOC_TREE_SEARCH_V2 _IOWR(BTRFS_IOCTL_MAGIC, 17, \ - struct btrfs_ioctl_search_args_v2) +# ifndef BTRFS_IOC_TREE_SEARCH_V2 +# define BTRFS_IOC_TREE_SEARCH_V2 \ + _IOWR(BTRFS_IOCTL_MAGIC, 17, struct btrfs_ioctl_search_args_v2) struct btrfs_ioctl_search_args_v2 { struct btrfs_ioctl_search_key key; /* in/out - search parameters */ uint64_t buf_size; /* in - size of buffer * out - on EOVERFLOW: needed size * to store item */ - uint64_t buf[0]; /* out - found items */ + uint64_t buf[0]; /* out - found items */ }; -#endif +# endif + + +static const char * +sprint_xlat_(uint32_t val, const char *xlat) +{ + static char str[256]; + int ret; + + if (verbose_xlat) { + ret = snprintf(str, sizeof(str), "%#x /* %s */", val, xlat); + if (ret < 0) + perror_msg_and_fail("sprint_ioc(%#x, %s)", val, xlat); + if ((unsigned) ret >= sizeof(str)) + error_msg_and_fail("sprint_ioc(%#x, %s): buffer " + "overflow", val, xlat); + + return str; + } + + return xlat; +} static const char * -maybe_print_uint64max(uint64_t val) +sprint_makedev(unsigned long long val) +{ + static char devid[256]; + int ret; + + if (verbose_xlat) + ret = snprintf(devid, sizeof(devid), + "%#llx /* makedev(%#x, %#x) */", + val, major(val), minor(val)); + else + ret = snprintf(devid, sizeof(devid), + "makedev(%#x, %#x)", major(val), minor(val)); + + if (ret < 0) + perror_msg_and_fail("sprint_makedev(%llx)", val); + if ((unsigned) ret >= sizeof(devid)) + error_msg_and_fail("sprint_makedev(%llx): buffer " + "overflow", val); + return devid; +} + +# define ioc(x_) sprint_xlat_(x_, #x_) + +void +prfl_btrfs(const struct xlat *xlat, const unsigned long long val, + const char *str) +{ + if (verbose_xlat && val) + printf("%#llx /* ", val); + printflags(xlat, val, str); + if (verbose_xlat && val) + printf(" */"); +} + +void +prxval_btrfs(const struct xlat *xlat, const unsigned long long val, + const char *str, bool known) { - if (val == UINT64_MAX) - return " /* UINT64_MAX */"; - return ""; + if (verbose_xlat && known) + printf("%#llx /* ", val); + printxval(xlat, val, str); + if (verbose_xlat && known) + printf(" */"); +} + +static void +print_uint64(const char *prefix, uint64_t val) +{ + if (val == UINT64_MAX) { + if (verbose_xlat) + printf("%s%" PRIu64 " /* UINT64_MAX */", prefix, val); + else + printf("%sUINT64_MAX", prefix); + } else { + printf("%s%" PRIu64, prefix, val); + } } /* takes highest valid flag bit */ @@ -183,10 +276,10 @@ static void btrfs_test_trans_ioctls(void) { ioctl(-1, BTRFS_IOC_TRANS_START, NULL); - printf("ioctl(-1, BTRFS_IOC_TRANS_START) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_TRANS_START)); ioctl(-1, BTRFS_IOC_TRANS_END, NULL); - printf("ioctl(-1, BTRFS_IOC_TRANS_END) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_TRANS_END)); } /* @@ -202,14 +295,15 @@ btrfs_test_sync_ioctls(void) uint64_t u64val = 0xdeadbeefbadc0dedULL; ioctl(-1, BTRFS_IOC_SYNC, NULL); - printf("ioctl(-1, BTRFS_IOC_SYNC) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_SYNC)); ioctl(-1, BTRFS_IOC_WAIT_SYNC, NULL); - printf("ioctl(-1, BTRFS_IOC_WAIT_SYNC, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_WAIT_SYNC)); ioctl(-1, BTRFS_IOC_WAIT_SYNC, &u64val); - printf("ioctl(-1, BTRFS_IOC_WAIT_SYNC, [%" PRIu64 - "]) = -1 EBADF (%m)\n", u64val); + printf("ioctl(-1, %s, [%" PRIu64 "]) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_WAIT_SYNC), u64val); /* * The live test of BTRFS_IOC_SYNC happens as a part of the test @@ -221,24 +315,24 @@ static void btrfs_print_qgroup_inherit(struct btrfs_qgroup_inherit *inherit) { printf("{flags="); - printflags(btrfs_qgroup_inherit_flags, inherit->flags, + prfl_btrfs(btrfs_qgroup_inherit_flags, inherit->flags, "BTRFS_QGROUP_INHERIT_???"); printf(", num_qgroups=%" PRI__u64 ", num_ref_copies=%" PRI__u64 - ", num_excl_copies=%" PRI__u64", lim={flags=", + ", num_excl_copies=%" PRI__u64 ", lim={flags=", inherit->num_qgroups, inherit->num_ref_copies, inherit->num_excl_copies); - printflags(btrfs_qgroup_limit_flags, + prfl_btrfs(btrfs_qgroup_limit_flags, inherit->lim.flags, "BTRFS_QGROUP_LIMIT_???"); printf(", max_rfer=%" PRI__u64 ", max_excl=%" PRI__u64 ", rsv_rfer=%" PRI__u64 ", rsv_excl=%" PRI__u64 - "}, qgroups=", + "}, ", inherit->lim.max_rfer, inherit->lim.max_excl, inherit->lim.rsv_rfer, inherit->lim.rsv_excl); if (verbose) { unsigned int i; - printf("["); + printf("qgroups=["); for (i = 0; i < inherit->num_qgroups; i++) { if (i > 0) printf(", "); @@ -255,7 +349,7 @@ static void btrfs_print_vol_args_v2(struct btrfs_ioctl_vol_args_v2 *args, int print_qgroups) { printf("{fd=%d, flags=", (int) args->fd); - printflags(btrfs_snap_flags_v2, args->flags, "BTRFS_SUBVOL_???"); + prfl_btrfs(btrfs_snap_flags_v2, args->flags, "BTRFS_SUBVOL_???"); if (args->flags & BTRFS_SUBVOL_QGROUP_INHERIT) { printf(", size=%" PRI__u64 ", qgroup_inherit=", args->size); @@ -303,61 +397,64 @@ btrfs_test_subvol_ioctls(void) strcpy(vol_args.name, subvol_name); ioctl(-1, BTRFS_IOC_SNAP_CREATE, NULL); - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SNAP_CREATE)); ioctl(-1, BTRFS_IOC_SNAP_CREATE, &vol_args); - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE, " - "{fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + printf("ioctl(-1, %s, {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SNAP_CREATE), vol_args.name); ioctl(-1, BTRFS_IOC_SUBVOL_CREATE, &vol_args); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE, " - "{fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + printf("ioctl(-1, %s, {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SUBVOL_CREATE), vol_args.name); ioctl(-1, BTRFS_IOC_SNAP_DESTROY, &vol_args); - printf("ioctl(-1, BTRFS_IOC_SNAP_DESTROY," - " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + printf("ioctl(-1, %s, {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SNAP_DESTROY), vol_args.name); strncpy(vol_args.name, long_subvol_name, BTRFS_PATH_NAME_MAX); ioctl(-1, BTRFS_IOC_SNAP_CREATE, &vol_args); - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE," - " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + printf("ioctl(-1, %s, {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SNAP_CREATE), vol_args.name); ioctl(-1, BTRFS_IOC_SUBVOL_CREATE, &vol_args); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE," - " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + printf("ioctl(-1, %s, {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SUBVOL_CREATE), vol_args.name); ioctl(-1, BTRFS_IOC_SNAP_DESTROY, &vol_args); - printf("ioctl(-1, BTRFS_IOC_SNAP_DESTROY," - " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + printf("ioctl(-1, %s, {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SNAP_DESTROY), vol_args.name); long_subvol_name = realloc(long_subvol_name, BTRFS_SUBVOL_NAME_MAX); if (!long_subvol_name) perror_msg_and_fail("realloc failed"); ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, NULL); - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SNAP_CREATE_V2)); ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, NULL); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SUBVOL_CREATE_V2)); strcpy(vol_args_v2.name, subvol_name); - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SNAP_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 1); ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SUBVOL_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 1); ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); strncpy(vol_args_v2.name, long_subvol_name, BTRFS_SUBVOL_NAME_MAX); - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SNAP_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 1); ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SUBVOL_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 1); ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); @@ -365,12 +462,12 @@ btrfs_test_subvol_ioctls(void) strcpy(vol_args_v2.name, subvol_name); vol_args_v2.qgroup_inherit = bad_pointer; - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SNAP_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 0); ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SUBVOL_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 0); ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); @@ -395,31 +492,33 @@ btrfs_test_subvol_ioctls(void) inherit->lim.rsv_excl = u64val; vol_args_v2.qgroup_inherit = inherit; - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SNAP_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 1); ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SUBVOL_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 1); ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, NULL); - printf("ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_DEFAULT_SUBVOL)); ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, &u64val); - printf("ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, [%" - PRIu64 "]) = -1 EBADF (%m)\n", u64val); + printf("ioctl(-1, %s, [%" PRIu64 "]) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_DEFAULT_SUBVOL), u64val); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_SETFLAGS, "); - printflags(btrfs_snap_flags_v2, vol_args_v2.flags, + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SUBVOL_SETFLAGS)); + prfl_btrfs(btrfs_snap_flags_v2, vol_args_v2.flags, "BTRFS_SUBVOL_???"); ioctl(-1, BTRFS_IOC_SUBVOL_SETFLAGS, &vol_args_v2.flags); printf(") = -1 EBADF (%m)\n"); if (write_ok) { struct btrfs_ioctl_vol_args_v2 args_passed; + long ret; /* * Returns transid if flags & BTRFS_SUBVOL_CREATE_ASYNC * - BTRFS_IOC_SNAP_CREATE_V2 @@ -433,12 +532,15 @@ btrfs_test_subvol_ioctls(void) vol_args_v2.size = 0; vol_args_v2.qgroup_inherit = NULL; args_passed = vol_args_v2; - printf("ioctl(%d, BTRFS_IOC_SUBVOL_CREATE_V2, ", - btrfs_test_dir_fd); + printf("ioctl(%d, %s, ", + btrfs_test_dir_fd, ioc(BTRFS_IOC_SUBVOL_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 1); - ioctl(btrfs_test_dir_fd, BTRFS_IOC_SUBVOL_CREATE_V2, + ret = ioctl(btrfs_test_dir_fd, BTRFS_IOC_SUBVOL_CREATE_V2, &args_passed); - printf(" => {transid=%" PRI__u64"}) = 0\n", + if (ret < 0) + perror_msg_and_fail("ioctl(BTRFS_IOC_SUBVOL_CREATE_V2) " + "failed"); + printf(" => {transid=%" PRI__u64 "}) = 0\n", args_passed.transid); subvolfd = openat(btrfs_test_dir_fd, subvol_name, @@ -449,27 +551,27 @@ btrfs_test_subvol_ioctls(void) strncpy(vol_args_v2.name, long_subvol_name, BTRFS_NAME_LEN); vol_args_v2.fd = subvolfd; args_passed = vol_args_v2; - printf("ioctl(%d, BTRFS_IOC_SNAP_CREATE_V2, ", - btrfs_test_dir_fd); + printf("ioctl(%d, %s, ", + btrfs_test_dir_fd, ioc(BTRFS_IOC_SNAP_CREATE_V2)); btrfs_print_vol_args_v2(&args_passed, 1); ioctl(btrfs_test_dir_fd, BTRFS_IOC_SNAP_CREATE_V2, &args_passed); - printf(" => {transid=%" PRI__u64"}) = 0\n", + printf(" => {transid=%" PRI__u64 "}) = 0\n", args_passed.transid); /* This only works when mounted w/ -ouser_subvol_rm_allowed */ strncpy(vol_args.name, long_subvol_name, 255); vol_args.name[255] = 0; ioctl(btrfs_test_dir_fd, BTRFS_IOC_SNAP_DESTROY, &vol_args); - printf("ioctl(%d, BTRFS_IOC_SNAP_DESTROY, " - "{fd=%d, name=\"%.*s\"}) = 0\n", - btrfs_test_dir_fd, (int) vol_args.fd, 255, long_subvol_name); + printf("ioctl(%d, %s, {fd=%d, name=\"%.*s\"}) = 0\n", + btrfs_test_dir_fd, ioc(BTRFS_IOC_SNAP_DESTROY), + (int) vol_args.fd, 255, long_subvol_name); strcpy(vol_args.name, subvol_name); ioctl(btrfs_test_dir_fd, BTRFS_IOC_SNAP_DESTROY, &vol_args); - printf("ioctl(%d, BTRFS_IOC_SNAP_DESTROY, " - "{fd=%d, name=\"%s\"}) = 0\n", - btrfs_test_dir_fd, (int) vol_args.fd, subvol_name); + printf("ioctl(%d, %s, {fd=%d, name=\"%s\"}) = 0\n", + btrfs_test_dir_fd, ioc(BTRFS_IOC_SNAP_DESTROY), + (int) vol_args.fd, subvol_name); close(subvolfd); } @@ -480,19 +582,17 @@ static void btrfs_print_balance_args(struct btrfs_balance_args *args) { printf("{profiles="); - printflags(btrfs_space_info_flags, args->profiles, + prfl_btrfs(btrfs_space_info_flags, args->profiles, "BTRFS_BLOCK_GROUP_???"); - printf(", usage=%"PRI__u64 "%s, devid=%"PRI__u64 "%s, pstart=%"PRI__u64 - "%s, pend=%"PRI__u64 "%s, vstart=%"PRI__u64 "%s, vend=%"PRI__u64 - "%s, target=%"PRI__u64 "%s, flags=", - args->usage, maybe_print_uint64max(args->usage), - args->devid, maybe_print_uint64max(args->devid), - args->pstart, maybe_print_uint64max(args->pstart), - args->pend, maybe_print_uint64max(args->pend), - args->vstart, maybe_print_uint64max(args->vstart), - args->vend, maybe_print_uint64max(args->vend), - args->target, maybe_print_uint64max(args->target)); - printflags(btrfs_balance_args, args->flags, "BTRFS_BALANCE_ARGS_???"); + print_uint64(", usage=", args->usage); + printf(", devid=%s", sprint_makedev(args->devid)); + print_uint64(", pstart=", args->pstart); + print_uint64(", pend=", args->pend); + print_uint64(", vstart=", args->vstart); + print_uint64(", vend=", args->vend); + print_uint64(", target=", args->target); + printf(", flags="); + prfl_btrfs(btrfs_balance_args, args->flags, "BTRFS_BALANCE_ARGS_???"); printf("}"); } @@ -532,25 +632,31 @@ btrfs_test_balance_ioctls(void) struct btrfs_ioctl_vol_args vol_args = {}; ioctl(-1, BTRFS_IOC_BALANCE_CTL, 1); - printf("ioctl(-1, BTRFS_IOC_BALANCE_CTL, " - "BTRFS_BALANCE_CTL_PAUSE) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, %sBTRFS_BALANCE_CTL_PAUSE%s) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_BALANCE_CTL), + verbose_xlat ? "0x1 /* " : "", + verbose_xlat ? " */" : ""); ioctl(-1, BTRFS_IOC_BALANCE_CTL, 2); - printf("ioctl(-1, BTRFS_IOC_BALANCE_CTL, " - "BTRFS_BALANCE_CTL_CANCEL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, " + "%sBTRFS_BALANCE_CTL_CANCEL%s) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_BALANCE_CTL), + verbose_xlat ? "0x2 /* " : "", + verbose_xlat ? " */" : ""); ioctl(-1, BTRFS_IOC_BALANCE, NULL); - printf("ioctl(-1, BTRFS_IOC_BALANCE) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_BALANCE)); ioctl(-1, BTRFS_IOC_BALANCE, &vol_args); - printf("ioctl(-1, BTRFS_IOC_BALANCE) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_BALANCE)); /* struct btrfs_ioctl_balance_args */ ioctl(-1, BTRFS_IOC_BALANCE_V2, NULL); - printf("ioctl(-1, BTRFS_IOC_BALANCE_V2, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_BALANCE_V2)); - printf("ioctl(-1, BTRFS_IOC_BALANCE_V2, {flags="); - printflags(btrfs_balance_flags, args.flags, "BTRFS_BALANCE_???"); + printf("ioctl(-1, %s, {flags=", ioc(BTRFS_IOC_BALANCE_V2)); + prfl_btrfs(btrfs_balance_flags, args.flags, "BTRFS_BALANCE_???"); printf(", data="); btrfs_print_balance_args(&args.data); printf(", meta="); @@ -561,6 +667,8 @@ btrfs_test_balance_ioctls(void) printf("}) = -1 EBADF (%m)\n"); if (write_ok) { + long ret; + args.flags = BTRFS_BALANCE_DATA | BTRFS_BALANCE_METADATA | BTRFS_BALANCE_SYSTEM; args.data.flags = 0; @@ -569,31 +677,43 @@ btrfs_test_balance_ioctls(void) args.meta.profiles = 0; args.sys.flags = 0; args.sys.profiles = 0; - printf("ioctl(%d, BTRFS_IOC_BALANCE_V2, {flags=", - btrfs_test_dir_fd); - printflags(btrfs_balance_flags, args.flags, - "BTRFS_BALANCE_???"); - printf(", data="); - btrfs_print_balance_args(&args.data); - printf(", meta="); - btrfs_print_balance_args(&args.meta); - printf(", sys="); - btrfs_print_balance_args(&args.sys); - ioctl(btrfs_test_dir_fd, BTRFS_IOC_BALANCE_V2, &args); - printf("} => {flags="); - printflags(btrfs_balance_flags, args.flags, + /* + * We should keep args the same for data in meta in case + * volume-under-tests uses mixed groups data and metadata. + */ + args.meta.pend = -1ULL; + args.meta.vend = -1ULL; + + printf("ioctl(%d, %s, {flags=", + btrfs_test_dir_fd, ioc(BTRFS_IOC_BALANCE_V2)); + + prfl_btrfs(btrfs_balance_flags, args.flags, "BTRFS_BALANCE_???"); - printf(", state="); - printflags(btrfs_balance_state, args.state, - "BTRFS_BALANCE_STATE_???"); printf(", data="); btrfs_print_balance_args(&args.data); printf(", meta="); btrfs_print_balance_args(&args.meta); printf(", sys="); btrfs_print_balance_args(&args.sys); - printf("}) = 0\n"); + ret = ioctl(btrfs_test_dir_fd, BTRFS_IOC_BALANCE_V2, &args); + if (ret < 0) { + printf("}) = %s\n", sprintrc(ret)); + } else { + printf("} => {flags="); + prfl_btrfs(btrfs_balance_flags, args.flags, + "BTRFS_BALANCE_???"); + printf(", state="); + prfl_btrfs(btrfs_balance_state, args.state, + "BTRFS_BALANCE_STATE_???"); + printf(", data="); + btrfs_print_balance_args(&args.data); + printf(", meta="); + btrfs_print_balance_args(&args.meta); + printf(", sys="); + btrfs_print_balance_args(&args.sys); + printf("}) = %ld\n", ret); + } } } @@ -616,38 +736,46 @@ btrfs_test_device_ioctls(void) }; ioctl(-1, BTRFS_IOC_RESIZE, NULL); - printf("ioctl(-1, BTRFS_IOC_RESIZE, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_RESIZE)); strcpy(args.name, devid); ioctl(-1, BTRFS_IOC_RESIZE, &args); - printf("ioctl(-1, BTRFS_IOC_RESIZE, " - "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", - (int) args.fd, args.name); + printf("ioctl(-1, %s, {fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_RESIZE), (int) args.fd, args.name); ioctl(-1, BTRFS_IOC_SCAN_DEV, NULL); - printf("ioctl(-1, BTRFS_IOC_SCAN_DEV, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SCAN_DEV)); strcpy(args.name, devname); ioctl(-1, BTRFS_IOC_SCAN_DEV, &args); - printf("ioctl(-1, BTRFS_IOC_SCAN_DEV, " - "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", - (int) args.fd, args.name); + printf("ioctl(-1, %s, {fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SCAN_DEV), (int) args.fd, args.name); + +# ifdef BTRFS_IOC_FORGET_DEV + ioctl(-1, BTRFS_IOC_FORGET_DEV, NULL); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_FORGET_DEV)); + + strcpy(args.name, devname); + ioctl(-1, BTRFS_IOC_FORGET_DEV, &args); + printf("ioctl(-1, %s, {fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_FORGET_DEV), (int) args.fd, args.name); +# endif ioctl(-1, BTRFS_IOC_ADD_DEV, NULL); - printf("ioctl(-1, BTRFS_IOC_ADD_DEV, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_ADD_DEV)); ioctl(-1, BTRFS_IOC_ADD_DEV, &args); - printf("ioctl(-1, BTRFS_IOC_ADD_DEV, " - "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", - (int) args.fd, args.name); + printf("ioctl(-1, %s, {fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_ADD_DEV), (int) args.fd, args.name); ioctl(-1, BTRFS_IOC_RM_DEV, NULL); - printf("ioctl(-1, BTRFS_IOC_RM_DEV, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_RM_DEV)); ioctl(-1, BTRFS_IOC_RM_DEV, &args); - printf("ioctl(-1, BTRFS_IOC_RM_DEV, " - "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", - (int) args.fd, args.name); + printf("ioctl(-1, %s, {fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_RM_DEV), (int) args.fd, args.name); } @@ -668,35 +796,40 @@ btrfs_test_clone_ioctls(void) }; ioctl(-1, BTRFS_IOC_CLONE, clone_fd); - printf("ioctl(-1, BTRFS_IOC_CLONE or FICLONE, %x) = -1 EBADF (%m)\n", - clone_fd); + printf("ioctl(-1, %s, %x) = -1 EBADF (%m)\n", + sprint_xlat_(BTRFS_IOC_CLONE, "BTRFS_IOC_CLONE or FICLONE"), + clone_fd); ioctl(-1, BTRFS_IOC_CLONE_RANGE, NULL); - printf("ioctl(-1, BTRFS_IOC_CLONE_RANGE or FICLONERANGE, " - "NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + sprint_xlat_(BTRFS_IOC_CLONE_RANGE, + "BTRFS_IOC_CLONE_RANGE or FICLONERANGE")); ioctl(-1, BTRFS_IOC_CLONE_RANGE, &args); - printf("ioctl(-1, BTRFS_IOC_CLONE_RANGE or FICLONERANGE, " + printf("ioctl(-1, %s, " "{src_fd=%d, src_offset=%" PRI__u64 ", src_length=%" PRI__u64 ", dest_offset=%" PRI__u64 "}) = -1 EBADF (%m)\n", + sprint_xlat_(BTRFS_IOC_CLONE_RANGE, + "BTRFS_IOC_CLONE_RANGE or FICLONERANGE"), (int) args.src_fd, args.src_offset, args.src_length, args.dest_offset); } -#define BTRFS_COMPRESS_TYPES 2 -#define BTRFS_INVALID_COMPRESS (BTRFS_COMPRESS_TYPES + 1) +# define BTRFS_COMPRESS_TYPES 2 +# define BTRFS_INVALID_COMPRESS (BTRFS_COMPRESS_TYPES + 1) static void -btrfs_print_defrag_range_args(struct btrfs_ioctl_defrag_range_args *args) +btrfs_print_defrag_range_args(struct btrfs_ioctl_defrag_range_args *args, + bool compress_type_known) { - printf("{start=%" PRIu64", len=%" PRIu64 "%s, flags=", - (uint64_t) args->start, (uint64_t) args->len, - maybe_print_uint64max(args->len)); + printf("{start=%" PRIu64, (uint64_t) args->start); + print_uint64(", len=", args->len); - printflags(btrfs_defrag_flags, args->flags, "BTRFS_DEFRAG_RANGE_???"); + printf(", flags="); + prfl_btrfs(btrfs_defrag_flags, args->flags, "BTRFS_DEFRAG_RANGE_???"); printf(", extent_thresh=%u, compress_type=", args->extent_thresh); - printxval(btrfs_compress_types, args->compress_type, - "BTRFS_COMPRESS_???"); + prxval_btrfs(btrfs_compress_types, args->compress_type, + "BTRFS_COMPRESS_???", compress_type_known); printf("}"); } @@ -722,29 +855,30 @@ btrfs_test_defrag_ioctls(void) * actually consume it. */ ioctl(-1, BTRFS_IOC_DEFRAG, NULL); - printf("ioctl(-1, BTRFS_IOC_DEFRAG) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_DEFRAG)); ioctl(-1, BTRFS_IOC_DEFRAG, &vol_args); - printf("ioctl(-1, BTRFS_IOC_DEFRAG) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_DEFRAG)); /* struct btrfs_ioctl_defrag_range_args */ ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, NULL); - printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_DEFRAG_RANGE)); - printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, "); - btrfs_print_defrag_range_args(&args); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_DEFRAG_RANGE)); + btrfs_print_defrag_range_args(&args, true); ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, &args); printf(") = -1 EBADF (%m)\n"); args.compress_type = BTRFS_INVALID_COMPRESS; - printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, "); - btrfs_print_defrag_range_args(&args); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_DEFRAG_RANGE)); + btrfs_print_defrag_range_args(&args, false); ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, &args); printf(") = -1 EBADF (%m)\n"); args.len--; - printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, "); - btrfs_print_defrag_range_args(&args); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_DEFRAG_RANGE)); + btrfs_print_defrag_range_args(&args, false); ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, &args); printf(") = -1 EBADF (%m)\n"); } @@ -762,18 +896,28 @@ static void btrfs_print_objectid(uint64_t objectid) { const char *str = xlookup(btrfs_tree_objectids, objectid); - printf("%" PRIu64, objectid); - if (str) - printf(" /* %s */", str); + if (str) { + if (verbose_xlat) + printf("%" PRIu64 " /* %s */", objectid, str); + else + printf("%s", str); + } else { + printf("%" PRIu64, objectid); + } } static void btrfs_print_key_type(uint32_t type) { const char *str = xlookup(btrfs_key_types, type); - printf("%u", type); - if (str) - printf(" /* %s */", str); + if (str) { + if (verbose_xlat) + printf("%u /* %s */", type, str); + else + printf("%s", str); + } else { + printf("%u", type); + } } static void @@ -789,18 +933,10 @@ btrfs_print_search_key(struct btrfs_ioctl_search_key *key) printf(", max_objectid="); btrfs_print_objectid(key->max_objectid); } - if (key->min_offset) - printf(", min_offset=%" PRI__u64 "%s", - key->min_offset, maybe_print_uint64max(key->min_offset)); - if (key->max_offset) - printf(", max_offset=%" PRI__u64 "%s", - key->max_offset, maybe_print_uint64max(key->max_offset)); - if (key->min_transid) - printf(", min_transid=%" PRI__u64"%s", key->min_transid, - maybe_print_uint64max(key->min_transid)); - if (key->max_transid) - printf(", max_transid=%" PRI__u64"%s", key->max_transid, - maybe_print_uint64max(key->max_transid)); + print_uint64(", min_offset=", key->min_offset); + print_uint64(", max_offset=", key->max_offset); + print_uint64(", min_transid=", key->min_transid); + print_uint64(", max_transid=", key->max_transid); printf(", min_type="); btrfs_print_key_type(key->min_type); printf(", max_type="); @@ -815,7 +951,7 @@ btrfs_print_tree_search_buf(struct btrfs_ioctl_search_key *key, if (verbose) { uint64_t i; uint64_t off = 0; - printf("["); + printf("buf=["); for (i = 0; i < key->nr_items; i++) { struct btrfs_ioctl_search_header *sh; sh = (typeof(sh))(buf + off); @@ -860,19 +996,21 @@ btrfs_test_search_ioctls(void) }; ioctl(-1, BTRFS_IOC_TREE_SEARCH, NULL); - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_TREE_SEARCH)); ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, NULL); - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_TREE_SEARCH_V2)); search_args.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH)); btrfs_print_search_key(&search_args.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); printf("}) = -1 EBADF (%m)\n"); search_args_v2.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH_V2)); btrfs_print_search_key(&search_args_v2.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", @@ -881,13 +1019,13 @@ btrfs_test_search_ioctls(void) key_reference.min_objectid = 6; key_reference.max_objectid = 7; search_args.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH)); btrfs_print_search_key(&search_args.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); printf("}) = -1 EBADF (%m)\n"); search_args_v2.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH_V2)); btrfs_print_search_key(&search_args_v2.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", @@ -896,13 +1034,13 @@ btrfs_test_search_ioctls(void) key_reference.min_offset++; key_reference.max_offset--; search_args.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH)); btrfs_print_search_key(&search_args.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); printf("}) = -1 EBADF (%m)\n"); search_args_v2.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH_V2)); btrfs_print_search_key(&search_args_v2.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", @@ -911,13 +1049,13 @@ btrfs_test_search_ioctls(void) key_reference.min_transid++; key_reference.max_transid--; search_args.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH)); btrfs_print_search_key(&search_args.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); printf("}) = -1 EBADF (%m)\n"); search_args_v2.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH_V2)); btrfs_print_search_key(&search_args_v2.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", @@ -926,13 +1064,13 @@ btrfs_test_search_ioctls(void) key_reference.min_type = 1; key_reference.max_type = 12; search_args.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH)); btrfs_print_search_key(&search_args.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); printf("}) = -1 EBADF (%m)\n"); search_args_v2.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH_V2)); btrfs_print_search_key(&search_args_v2.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", @@ -951,11 +1089,11 @@ btrfs_test_search_ioctls(void) key_reference.max_offset = -1ULL; search_args.key = key_reference; - printf("ioctl(%d, BTRFS_IOC_TREE_SEARCH, {", - btrfs_test_dir_fd); + printf("ioctl(%d, %s, {", + btrfs_test_dir_fd, ioc(BTRFS_IOC_TREE_SEARCH)); btrfs_print_search_key(&search_args.key); ioctl(btrfs_test_dir_fd, BTRFS_IOC_TREE_SEARCH, &search_args); - printf("} => {key={nr_items=%u}, buf=", + printf("} => {key={nr_items=%u}, ", search_args.key.nr_items); btrfs_print_tree_search_buf(&search_args.key, search_args.buf, sizeof(search_args.buf)); @@ -967,12 +1105,12 @@ btrfs_test_search_ioctls(void) args->key = key_reference; args->buf_size = bufsize; - printf("ioctl(%d, BTRFS_IOC_TREE_SEARCH_V2, {", - btrfs_test_dir_fd); + printf("ioctl(%d, %s, {", + btrfs_test_dir_fd, ioc(BTRFS_IOC_TREE_SEARCH_V2)); btrfs_print_search_key(&key_reference); printf(", buf_size=%" PRIu64 "}", (uint64_t) args->buf_size); ioctl(btrfs_test_dir_fd, BTRFS_IOC_TREE_SEARCH_V2, args); - printf(" => {key={nr_items=%u}, buf_size=%" PRIu64 ", buf=", + printf(" => {key={nr_items=%u}, buf_size=%" PRIu64 ", ", args->key.nr_items, (uint64_t)args->buf_size); btrfs_print_tree_search_buf(&args->key, args->buf, args->buf_size); @@ -980,8 +1118,8 @@ btrfs_test_search_ioctls(void) args->key = key_reference; args->buf_size = sizeof(struct btrfs_ioctl_search_header); - printf("ioctl(%d, BTRFS_IOC_TREE_SEARCH_V2, {", - btrfs_test_dir_fd); + printf("ioctl(%d, %s, {", + btrfs_test_dir_fd, ioc(BTRFS_IOC_TREE_SEARCH_V2)); btrfs_print_search_key(&args->key); printf(", buf_size=%" PRIu64 "}", (uint64_t)args->buf_size); ioctl(btrfs_test_dir_fd, BTRFS_IOC_TREE_SEARCH_V2, args); @@ -1004,9 +1142,10 @@ btrfs_test_ino_lookup_ioctl(void) }; ioctl(-1, BTRFS_IOC_INO_LOOKUP, NULL); - printf("ioctl(-1, BTRFS_IOC_INO_LOOKUP, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_INO_LOOKUP)); - printf("ioctl(-1, BTRFS_IOC_INO_LOOKUP, {treeid="); + printf("ioctl(-1, %s, {treeid=", ioc(BTRFS_IOC_INO_LOOKUP)); btrfs_print_objectid(args.treeid); printf(", objectid="); btrfs_print_objectid(args.objectid); @@ -1014,8 +1153,8 @@ btrfs_test_ino_lookup_ioctl(void) printf("}) = -1 EBADF (%m)\n"); if (btrfs_test_root) { - printf("ioctl(%d, BTRFS_IOC_INO_LOOKUP, {treeid=", - btrfs_test_dir_fd); + printf("ioctl(%d, %s, {treeid=", + btrfs_test_dir_fd, ioc(BTRFS_IOC_INO_LOOKUP)); btrfs_print_objectid(args.treeid); printf(", objectid="); btrfs_print_objectid(args.objectid); @@ -1034,20 +1173,20 @@ btrfs_test_space_info_ioctl(void) struct btrfs_ioctl_space_args args = {}; ioctl(-1, BTRFS_IOC_SPACE_INFO, NULL); - printf("ioctl(-1, BTRFS_IOC_SPACE_INFO, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SPACE_INFO)); ioctl(-1, BTRFS_IOC_SPACE_INFO, &args); - printf("ioctl(-1, BTRFS_IOC_SPACE_INFO, " - "{space_slots=%" PRI__u64 "}) = -1 EBADF (%m)\n", - args.space_slots); + printf("ioctl(-1, %s, {space_slots=%" PRI__u64 "}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SPACE_INFO), args.space_slots); if (btrfs_test_root) { struct btrfs_ioctl_space_args args_passed; struct btrfs_ioctl_space_args *argsp; args_passed = args; - printf("ioctl(%d, BTRFS_IOC_SPACE_INFO, " - "{space_slots=%" PRI__u64 "}", - btrfs_test_dir_fd, args_passed.space_slots); + printf("ioctl(%d, %s, {space_slots=%" PRI__u64 "}", + btrfs_test_dir_fd, ioc(BTRFS_IOC_SPACE_INFO), + args_passed.space_slots); ioctl(btrfs_test_dir_fd, BTRFS_IOC_SPACE_INFO, &args_passed); printf(" => {total_spaces=%" PRI__u64 "}) = 0\n", args_passed.total_spaces); @@ -1059,22 +1198,22 @@ btrfs_test_space_info_ioctl(void) *argsp = args; argsp->space_slots = args_passed.total_spaces; - printf("ioctl(%d, BTRFS_IOC_SPACE_INFO, " - "{space_slots=%" PRI__u64 "}", - btrfs_test_dir_fd, argsp->space_slots); + printf("ioctl(%d, %s, {space_slots=%" PRI__u64 "}", + btrfs_test_dir_fd, ioc(BTRFS_IOC_SPACE_INFO), + argsp->space_slots); ioctl(btrfs_test_dir_fd, BTRFS_IOC_SPACE_INFO, argsp); - printf(" => {total_spaces=%" PRI__u64 ", spaces=", + printf(" => {total_spaces=%" PRI__u64 ", ", argsp->total_spaces); if (verbose) { unsigned int i; - printf("["); + printf("spaces=["); for (i = 0; i < argsp->total_spaces; i++) { struct btrfs_ioctl_space_info *info; info = &argsp->spaces[i]; if (i) printf(", "); printf("{flags="); - printflags(btrfs_space_info_flags, info->flags, + prfl_btrfs(btrfs_space_info_flags, info->flags, "BTRFS_SPACE_INFO_???"); printf(", total_bytes=%" PRI__u64 ", used_bytes=%" PRI__u64 "}", @@ -1107,25 +1246,28 @@ btrfs_test_scrub_ioctls(void) }; ioctl(-1, BTRFS_IOC_SCRUB, NULL); - printf("ioctl(-1, BTRFS_IOC_SCRUB, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_SCRUB)); ioctl(-1, BTRFS_IOC_SCRUB_CANCEL, NULL); - printf("ioctl(-1, BTRFS_IOC_SCRUB_CANCEL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_SCRUB_CANCEL)); - printf("ioctl(-1, BTRFS_IOC_SCRUB, {devid=%" PRI__u64 ", start=%" - PRI__u64 "%s, end=%" PRI__u64"%s, flags=", - args.devid, args.start, maybe_print_uint64max(args.start), - args.end, maybe_print_uint64max(args.end)); - printflags(btrfs_scrub_flags, args.flags, "BTRFS_SCRUB_???"); + printf("ioctl(-1, %s, {devid=%s", + ioc(BTRFS_IOC_SCRUB), sprint_makedev(args.devid)); + print_uint64(", start=", args.start); + print_uint64(", end=", args.end); + printf(", flags="); + prfl_btrfs(btrfs_scrub_flags, args.flags, "BTRFS_SCRUB_???"); ioctl(-1, BTRFS_IOC_SCRUB, &args); printf("}) = -1 EBADF (%m)\n"); ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, NULL); - printf("ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SCRUB_PROGRESS)); ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, &args); - printf("ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, " - "{devid=%" PRI__u64 "}) = -1 EBADF (%m)\n", args.devid); + printf("ioctl(-1, %s, {devid=%s}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SCRUB_PROGRESS), + sprint_makedev(args.devid)); } /* @@ -1141,12 +1283,14 @@ btrfs_test_dev_info_ioctl(void) memcpy(&args.uuid, uuid_reference, BTRFS_UUID_SIZE); ioctl(-1, BTRFS_IOC_DEV_INFO, NULL); - printf("ioctl(-1, BTRFS_IOC_DEV_INFO, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_DEV_INFO)); ioctl(-1, BTRFS_IOC_DEV_INFO, &args); - printf("ioctl(-1, BTRFS_IOC_DEV_INFO, " - "{devid=%" PRI__u64", uuid=%s}) = -1 EBADF (%m)\n", - args.devid, uuid_reference_string); + printf("ioctl(-1, %s, " + "{devid=%s, uuid=%s}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_DEV_INFO), sprint_makedev(args.devid), + uuid_reference_string); } /* @@ -1161,27 +1305,84 @@ btrfs_test_ino_path_ioctls(void) struct btrfs_ioctl_ino_path_args args = { .inum = 256, .size = sizeof(buf), - .fspath = (unsigned long)buf, + .reserved = { + 0xdeadc0defacefeebULL, + 0xdeadc0defacefeecULL, + 0xdeadc0defacefeedULL, + }, + .fspath = 0, }; +# ifdef HAVE_BTRFS_IOCTL_LOGICAL_INO_ARGS + args.flags = +# else + args.reserved[3] = +# endif + 0xdeadc0defacefeeeULL; + + ioctl(-1, BTRFS_IOC_INO_PATHS, NULL); - printf("ioctl(-1, BTRFS_IOC_INO_PATHS, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_INO_PATHS)); ioctl(-1, BTRFS_IOC_LOGICAL_INO, NULL); - printf("ioctl(-1, BTRFS_IOC_LOGICAL_INO, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_LOGICAL_INO)); ioctl(-1, BTRFS_IOC_INO_PATHS, &args); - printf("ioctl(-1, BTRFS_IOC_INO_PATHS, " - "{inum=%" PRI__u64", size=%" PRI__u64 + printf("ioctl(-1, %s, {inum=%" PRI__u64 ", size=%" PRI__u64 + ", fspath=NULL}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_INO_PATHS), args.inum, args.size); + + args.fspath = (uintptr_t) buf; + ioctl(-1, BTRFS_IOC_INO_PATHS, &args); + printf("ioctl(-1, %s, {inum=%" PRI__u64 ", size=%" PRI__u64 ", fspath=0x%" PRI__x64 "}) = -1 EBADF (%m)\n", - args.inum, args.size, args.fspath); + ioc(BTRFS_IOC_INO_PATHS), args.inum, args.size, args.fspath); + args.fspath = 0; ioctl(-1, BTRFS_IOC_LOGICAL_INO, &args); - printf("ioctl(-1, BTRFS_IOC_LOGICAL_INO, {logical=%" PRI__u64 - ", size=%" PRI__u64", inodes=0x%" PRI__x64 - "}) = -1 EBADF (%m)\n", args.inum, args.size, args.fspath); + printf("ioctl(-1, %s, {logical=%" PRI__u64 + ", size=%" PRI__u64 ", reserved=[0xdeadc0defacefeeb" + ", 0xdeadc0defacefeec, 0xdeadc0defacefeed]" + ", flags=0xdeadc0defacefeee /* BTRFS_LOGICAL_INO_ARGS_??? */" + ", inodes=NULL}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_LOGICAL_INO), args.inum, args.size); + + args.fspath = (uintptr_t) buf; + args.reserved[0] = 0; + args.reserved[2] = 0; +# ifdef HAVE_BTRFS_IOCTL_LOGICAL_INO_ARGS + args.flags = +# else + args.reserved[3] = +# endif + 1; -#ifdef HAVE_LINUX_FIEMAP_H + ioctl(-1, BTRFS_IOC_LOGICAL_INO, &args); + printf("ioctl(-1, %s, {logical=%" PRI__u64 + ", size=%" PRI__u64 ", reserved=[0, 0xdeadc0defacefeec, 0]" + ", flags=%sBTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET%s" + ", inodes=0x%" PRI__x64 "}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_LOGICAL_INO), args.inum, args.size, + verbose_xlat ? "0x1 /* " : "", verbose_xlat ? " */" : "", + args.fspath); + + args.reserved[1] = 0; +# ifdef HAVE_BTRFS_IOCTL_LOGICAL_INO_ARGS + args.flags = +# else + args.reserved[3] = +# endif + 0; + + ioctl(-1, BTRFS_IOC_LOGICAL_INO, &args); + printf("ioctl(-1, %s, {logical=%" PRI__u64 + ", size=%" PRI__u64 ", flags=0, inodes=0x%" PRI__x64 + "}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_LOGICAL_INO), args.inum, args.size, args.fspath); + +# ifdef HAVE_LINUX_FIEMAP_H if (btrfs_test_root) { int size; struct stat si; @@ -1195,17 +1396,16 @@ btrfs_test_ino_path_ioctls(void) perror_msg_and_fail("fstat failed"); args.inum = si.st_ino; - printf("ioctl(%d, BTRFS_IOC_INO_PATHS, " - "{inum=%" PRI__u64", size=%" PRI__u64 - ", fspath=0x%" PRI__x64"}", - btrfs_test_dir_fd, args.inum, args.size, - args.fspath); + printf("ioctl(%d, %s, {inum=%" PRI__u64 ", size=%" PRI__u64 + ", fspath=0x%" PRI__x64 "}", + btrfs_test_dir_fd, ioc(BTRFS_IOC_INO_PATHS), + args.inum, args.size, args.fspath); ioctl(btrfs_test_dir_fd, BTRFS_IOC_INO_PATHS, &args); - printf(" => {fspath={bytes_left=%u, bytes_missing=%u, elem_cnt=%u, elem_missed=%u, val=", + printf(" => {fspath={bytes_left=%u, bytes_missing=%u, elem_cnt=%u, elem_missed=%u, ", data->bytes_left, data->bytes_missing, data->elem_cnt, data->elem_missed); if (verbose) { - printf("[\"strace-test\"]"); + printf("val=[\"%s\"]", dir_name); } else printf("..."); printf("}}) = 0\n"); @@ -1227,7 +1427,7 @@ btrfs_test_ino_path_ioctls(void) */ fsync(fd); ioctl(fd, BTRFS_IOC_SYNC, NULL); - printf("ioctl(%d, BTRFS_IOC_SYNC) = 0\n", fd); + printf("ioctl(%d, %s) = 0\n", fd, ioc(BTRFS_IOC_SYNC)); size = sizeof(*fiemap) + 2 * sizeof(fiemap->fm_extents[0]); fiemap = malloc(size); @@ -1239,18 +1439,19 @@ btrfs_test_ino_path_ioctls(void) fiemap->fm_extent_count = 2; /* This is also a live test for FIEMAP */ - printf("ioctl(%d, FS_IOC_FIEMAP, {fm_start=%" PRI__u64 - ", fm_length=%" PRI__u64", fm_flags=", - fd, fiemap->fm_start, fiemap->fm_length); - printflags(fiemap_flags, fiemap->fm_flags, "FIEMAP_FLAG_???"); + printf("ioctl(%d, %s, {fm_start=%" PRI__u64 + ", fm_length=%" PRI__u64 ", fm_flags=", + fd, ioc(FS_IOC_FIEMAP), + fiemap->fm_start, fiemap->fm_length); + prfl_btrfs(fiemap_flags, fiemap->fm_flags, "FIEMAP_FLAG_???"); printf(", fm_extent_count=%u}", fiemap->fm_extent_count); ioctl(fd, FS_IOC_FIEMAP, fiemap); printf(" => {fm_flags="); - printflags(fiemap_flags, fiemap->fm_flags, "FIEMAP_FLAG_???"); - printf(", fm_mapped_extents=%u, fm_extents=", + prfl_btrfs(fiemap_flags, fiemap->fm_flags, "FIEMAP_FLAG_???"); + printf(", fm_mapped_extents=%u, ", fiemap->fm_mapped_extents); if (verbose) { - printf("["); + printf("fm_extents=["); unsigned int i; for (i = 0; i < fiemap->fm_mapped_extents; i++) { struct fiemap_extent *fe; @@ -1263,7 +1464,7 @@ btrfs_test_ino_path_ioctls(void) ", ", fe->fe_logical, fe->fe_physical, fe->fe_length); - printflags(fiemap_extent_flags, fe->fe_flags, + prfl_btrfs(fiemap_extent_flags, fe->fe_flags, "FIEMAP_EXTENT_???"); printf("}"); } @@ -1273,15 +1474,16 @@ btrfs_test_ino_path_ioctls(void) printf("}) = 0\n"); args.inum = fiemap->fm_extents[0].fe_physical; - printf("ioctl(%d, BTRFS_IOC_LOGICAL_INO, {logical=%" PRI__u64 - ", size=%" PRI__u64", inodes=0x%" PRI__x64"}", - fd, args.inum, args.size, args.fspath); + printf("ioctl(%d, %s, {logical=%" PRI__u64 + ", size=%" PRI__u64 ", flags=0, inodes=0x%" PRI__x64 "}", + fd, ioc(BTRFS_IOC_LOGICAL_INO), + args.inum, args.size, args.fspath); ioctl(fd, BTRFS_IOC_LOGICAL_INO, &args); - printf(" => {inodes={bytes_left=%u, bytes_missing=%u, elem_cnt=%u, elem_missed=%u, val=", + printf(" => {inodes={bytes_left=%u, bytes_missing=%u, elem_cnt=%u, elem_missed=%u, ", data->bytes_left, data->bytes_missing, data->elem_cnt, data->elem_missed); if (verbose) { - printf("[{inum=%llu, offset=0, root=5}]", + printf("val=[{inum=%llu, offset=0, root=5}]", (unsigned long long) si.st_ino); } else printf("..."); @@ -1289,7 +1491,7 @@ btrfs_test_ino_path_ioctls(void) close(fd); free(fiemap); } -#endif /* HAVE_LINUX_FIEMAP_H */ +# endif /* HAVE_LINUX_FIEMAP_H */ } /* @@ -1306,18 +1508,23 @@ btrfs_test_set_received_subvol_ioctl(void) .nsec = 12345, }, }; + int saved_errno; + memcpy(&args.uuid, uuid_reference, BTRFS_UUID_SIZE); ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, NULL); - printf("ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, " - "NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SET_RECEIVED_SUBVOL)); ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, &args); - printf("ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, " - "{uuid=%s, stransid=%" PRI__u64", stime=%" PRI__u64 - ".%u, flags=0}) = -1 EBADF (%m)\n", - uuid_reference_string, args.stransid, args.stime.sec, - args.stime.nsec); + saved_errno = errno; + printf("ioctl(-1, %s, {uuid=%s, stransid=%" PRI__u64 + ", stime={sec=%" PRI__u64 ", nsec=%u}", + ioc(BTRFS_IOC_SET_RECEIVED_SUBVOL), uuid_reference_string, + args.stransid, args.stime.sec, args.stime.nsec); + print_time_t_nsec(args.stime.sec, args.stime.nsec, true); + errno = saved_errno; + printf(", flags=0}) = -1 EBADF (%m)\n"); } /* @@ -1335,29 +1542,25 @@ btrfs_test_send_ioctl(void) }; ioctl(-1, BTRFS_IOC_SEND, NULL); - printf("ioctl(-1, BTRFS_IOC_SEND, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_SEND)); - printf("ioctl(-1, BTRFS_IOC_SEND, " - "{send_fd=%d, clone_sources_count=%" PRI__u64 - ", clone_sources=", + printf("ioctl(-1, %s, {send_fd=%d, clone_sources_count=%" PRI__u64 + ", clone_sources=NULL", + ioc(BTRFS_IOC_SEND), (int) args.send_fd, args.clone_sources_count); - if (verbose) - printf("NULL"); - else - printf("..."); printf(", parent_root="); btrfs_print_objectid(args.parent_root); printf(", flags="); - printflags(btrfs_send_flags, args.flags, "BTRFS_SEND_FLAGS_???"); + prfl_btrfs(btrfs_send_flags, args.flags, "BTRFS_SEND_FLAGS_???"); ioctl(-1, BTRFS_IOC_SEND, &args); printf("}) = -1 EBADF (%m)\n"); args.clone_sources_count = 2; args.clone_sources = (__u64 *) (void *) u64_array; - printf("ioctl(-1, BTRFS_IOC_SEND, " - "{send_fd=%d, clone_sources_count=%" PRI__u64 + printf("ioctl(-1, %s, {send_fd=%d, clone_sources_count=%" PRI__u64 ", clone_sources=", + ioc(BTRFS_IOC_SEND), (int) args.send_fd, args.clone_sources_count); if (verbose) { printf("["); @@ -1366,11 +1569,11 @@ btrfs_test_send_ioctl(void) btrfs_print_objectid(u64_array[1]); printf("]"); } else - printf("..."); + printf("%p", args.clone_sources); printf(", parent_root="); btrfs_print_objectid(args.parent_root); printf(", flags="); - printflags(btrfs_send_flags, args.flags, "BTRFS_SEND_FLAGS_???"); + prfl_btrfs(btrfs_send_flags, args.flags, "BTRFS_SEND_FLAGS_???"); ioctl(-1, BTRFS_IOC_SEND, &args); printf("}) = -1 EBADF (%m)\n"); } @@ -1387,26 +1590,37 @@ btrfs_test_quota_ctl_ioctl(void) }; ioctl(-1, BTRFS_IOC_QUOTA_CTL, NULL); - printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_CTL)); ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); - printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " - "BTRFS_QUOTA_CTL_ENABLE}) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, {cmd=%sBTRFS_QUOTA_CTL_ENABLE%s}) " + "= -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_CTL), + verbose_xlat ? "0x1 /* " : "", + verbose_xlat ? " */" : ""); args.cmd = 2; ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); - printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " - "BTRFS_QUOTA_CTL_DISABLE}) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, {cmd=%sBTRFS_QUOTA_CTL_DISABLE%s}) " + "= -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_CTL), + verbose_xlat ? "0x2 /* " : "", + verbose_xlat ? " */" : ""); args.cmd = 3; ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); - printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " - "BTRFS_QUOTA_CTL_RESCAN__NOTUSED}) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, " + "{cmd=%sBTRFS_QUOTA_CTL_RESCAN__NOTUSED%s}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_CTL), + verbose_xlat ? "0x3 /* " : "", + verbose_xlat ? " */" : ""); args.cmd = 4; ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); - printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " - "0x4 /* BTRFS_QUOTA_CTL_??? */}) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, " + "{cmd=0x4 /* BTRFS_QUOTA_CTL_??? */}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_CTL)); } /* @@ -1423,12 +1637,14 @@ btrfs_test_qgroup_assign_ioctl(void) }; ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, NULL); - printf("ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QGROUP_ASSIGN)); ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, &args); - printf("ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, " - "{assign=%" PRI__u64", src=%" PRI__u64", dst=%" PRI__u64 - "}) = -1 EBADF (%m)\n", args.assign, args.src, args.dst); + printf("ioctl(-1, %s, " + "{assign=%" PRI__u64 ", src=%" PRI__u64 ", dst=%" PRI__u64 + "}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QGROUP_ASSIGN), args.assign, args.src, args.dst); } /* @@ -1444,12 +1660,13 @@ btrfs_test_qgroup_create_ioctl(void) }; ioctl(-1, BTRFS_IOC_QGROUP_CREATE, NULL); - printf("ioctl(-1, BTRFS_IOC_QGROUP_CREATE, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_QGROUP_CREATE)); ioctl(-1, BTRFS_IOC_QGROUP_CREATE, &args); - printf("ioctl(-1, BTRFS_IOC_QGROUP_CREATE, " - "{create=%" PRI__u64", qgroupid=%" PRI__u64 - "}) = -1 EBADF (%m)\n", args.create, args.qgroupid); + printf("ioctl(-1, %s, " + "{create=%" PRI__u64 ", qgroupid=%" PRI__u64 + "}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QGROUP_CREATE), args.create, args.qgroupid); } /* @@ -1466,43 +1683,46 @@ btrfs_test_quota_rescan_ioctl(void) }; ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, NULL); - printf("ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_RESCAN)); ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, &args); - printf("ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, " - "{flags=0}) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, {flags=0}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_RESCAN)); ioctl(-1, BTRFS_IOC_QUOTA_RESCAN_WAIT, NULL); - printf("ioctl(-1, BTRFS_IOC_QUOTA_RESCAN_WAIT) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_RESCAN_WAIT)); } /* * Consumes argument, returns nothing: - * - BTRFS_IOC_SET_FSLABEL + * - FS_IOC_SETFSLABEL * * Consumes no argument, returns argument: - * - BTRFS_IOC_GET_FS_LABEL + * - FS_IOC_GETFSLABEL */ static void btrfs_test_label_ioctls(void) { char label[BTRFS_LABEL_SIZE] = "btrfs-label"; - ioctl(-1, BTRFS_IOC_SET_FSLABEL, NULL); - printf("ioctl(-1, BTRFS_IOC_SET_FSLABEL, NULL) = -1 EBADF (%m)\n"); + ioctl(-1, FS_IOC_SETFSLABEL, NULL); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(FS_IOC_SETFSLABEL)); - ioctl(-1, BTRFS_IOC_SET_FSLABEL, label); - printf("ioctl(-1, BTRFS_IOC_SET_FSLABEL, \"%s\") = -1 EBADF (%m)\n", - label); + ioctl(-1, FS_IOC_SETFSLABEL, label); + printf("ioctl(-1, %s, \"%s\") = -1 EBADF (%m)\n", + ioc(FS_IOC_SETFSLABEL), label); if (write_ok) { - ioctl(btrfs_test_dir_fd, BTRFS_IOC_SET_FSLABEL, label); - printf("ioctl(%d, BTRFS_IOC_SET_FSLABEL, \"%s\") = 0\n", - btrfs_test_dir_fd, label); + ioctl(btrfs_test_dir_fd, FS_IOC_SETFSLABEL, label); + printf("ioctl(%d, %s, \"%s\") = 0\n", + btrfs_test_dir_fd, ioc(FS_IOC_SETFSLABEL), label); - ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_FSLABEL, label); - printf("ioctl(%d, BTRFS_IOC_GET_FSLABEL, \"%s\") = 0\n", - btrfs_test_dir_fd, label); + ioctl(btrfs_test_dir_fd, FS_IOC_GETFSLABEL, label); + printf("ioctl(%d, %s, \"%s\") = 0\n", + btrfs_test_dir_fd, ioc(FS_IOC_GETFSLABEL), label); } } @@ -1518,14 +1738,14 @@ btrfs_test_get_dev_stats_ioctl(void) .nr_items = 5, .flags = max_flags_plus_one(0), }; - ioctl(-1, BTRFS_IOC_GET_DEV_STATS, NULL); - printf("ioctl(-1, BTRFS_IOC_GET_DEV_STATS, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_GET_DEV_STATS)); - printf("ioctl(-1, BTRFS_IOC_GET_DEV_STATS, {devid=%" PRI__u64 - ", nr_items=%" PRI__u64", flags=", - args.devid, args.nr_items); - printflags(btrfs_dev_stats_flags, args.flags, + printf("ioctl(-1, %s, {devid=%s" + ", nr_items=%" PRI__u64 ", flags=", + ioc(BTRFS_IOC_GET_DEV_STATS), + sprint_makedev(args.devid), args.nr_items); + prfl_btrfs(btrfs_dev_stats_flags, args.flags, "BTRFS_DEV_STATS_???"); ioctl(-1, BTRFS_IOC_GET_DEV_STATS, &args); printf("}) = -1 EBADF (%m)\n"); @@ -1533,23 +1753,32 @@ btrfs_test_get_dev_stats_ioctl(void) if (write_ok) { unsigned int i; args.flags = BTRFS_DEV_STATS_RESET; - printf("ioctl(%d, BTRFS_IOC_GET_DEV_STATS, {devid=%" PRI__u64 - ", nr_items=%" PRI__u64", flags=", - btrfs_test_dir_fd, args.devid, args.nr_items); - printflags(btrfs_dev_stats_flags, args.flags, + printf("ioctl(%d, %s, {devid=%s" + ", nr_items=%" PRI__u64 ", flags=", + btrfs_test_dir_fd, ioc(BTRFS_IOC_GET_DEV_STATS), + sprint_makedev(args.devid), args.nr_items); + prfl_btrfs(btrfs_dev_stats_flags, args.flags, "BTRFS_DEV_STATS_???"); ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_DEV_STATS, &args); printf("} => {nr_items=%" PRI__u64 ", flags=", args.nr_items); - printflags(btrfs_dev_stats_flags, args.flags, + prfl_btrfs(btrfs_dev_stats_flags, args.flags, "BTRFS_DEV_STATS_???"); printf(", ["); for (i = 0; i < args.nr_items; i++) { const char *name = xlookup(btrfs_dev_stats_values, i); if (i) printf(", "); - if (name) - printf("/* %s */ ", name); + + if (name) { + if (verbose_xlat) + printf("[%u /* %s */] = ", i, name); + else + printf("[%s] = ", name); + } else { + printf("[%u] = ", i); + } + printf("%" PRI__u64, args.values[i]); } printf("]}) = 0\n"); @@ -1574,28 +1803,45 @@ btrfs_test_dev_replace_ioctl(void) /* struct btrfs_ioctl_dev_replace_args */ ioctl(-1, BTRFS_IOC_DEV_REPLACE, NULL); - printf("ioctl(-1, BTRFS_IOC_DEV_REPLACE, NULL) = -1 EBADF (%m)\n"); - - ioctl(-1, BTRFS_IOC_DEV_REPLACE, &args); - printf("ioctl(-1, BTRFS_IOC_DEV_REPLACE, " - "{cmd=BTRFS_IOCTL_DEV_REPLACE_CMD_START, start={srcdevid=%" - PRI__u64", cont_reading_from_srcdev_mode=%" PRI__u64 - ", srcdev_name=\"%s\", tgtdev_name=\"%s\"}}) = -1 EBADF (%m)\n", - args.start.srcdevid, - args.start.cont_reading_from_srcdev_mode, - (char *)args.start.srcdev_name, - (char *)args.start.tgtdev_name); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_DEV_REPLACE)); + + for (unsigned long i = 0; i < 3; i++) { + int saved_errno; + + args.start.cont_reading_from_srcdev_mode = i; + ioctl(-1, BTRFS_IOC_DEV_REPLACE, &args); + saved_errno = errno; + printf("ioctl(-1, %s, " + "{cmd=%sBTRFS_IOCTL_DEV_REPLACE_CMD_START%s" + ", start={srcdevid=%s" + ", cont_reading_from_srcdev_mode=", + ioc(BTRFS_IOC_DEV_REPLACE), + verbose_xlat ? "0 /* " : "", verbose_xlat ? " */" : "", + sprint_makedev(args.start.srcdevid) + ); + prxval_btrfs(btrfs_cont_reading_from_srcdev_mode, + args.start.cont_reading_from_srcdev_mode, + "BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV" + "_MODE_???", i < 2); + errno = saved_errno; + printf(", srcdev_name=\"%s\", tgtdev_name=\"%s\"}}) " + "= -1 EBADF (%m)\n", + (char *)args.start.srcdev_name, + (char *)args.start.tgtdev_name); + } args.cmd = 1; ioctl(-1, BTRFS_IOC_DEV_REPLACE, &args); - printf("ioctl(-1, BTRFS_IOC_DEV_REPLACE, " - "{cmd=BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS}) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, {cmd=%sBTRFS_IOCTL_DEV_REPLACE_CMD_STATUS%s}) " + "= -1 EBADF (%m)\n", + ioc(BTRFS_IOC_DEV_REPLACE), + verbose_xlat ? "0x1 /* " : "", verbose_xlat ? " */" : ""); } static void btrfs_test_extent_same_ioctl(void) { -#ifdef BTRFS_IOC_FILE_EXTENT_SAME +# ifdef BTRFS_IOC_FILE_EXTENT_SAME struct file_dedupe_range args = { .src_offset = 1024, .src_length = 10240, @@ -1603,13 +1849,16 @@ btrfs_test_extent_same_ioctl(void) struct file_dedupe_range *argsp; ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME, NULL); - printf("ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " - "NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + sprint_xlat_(BTRFS_IOC_FILE_EXTENT_SAME, + "BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE")); - printf("ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " + printf("ioctl(-1, %s, " "{src_offset=%" PRIu64 ", src_length=%" PRIu64 ", dest_count=%hu, info=[]", + sprint_xlat_(BTRFS_IOC_FILE_EXTENT_SAME, + "BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE"), (uint64_t)args.src_offset, (uint64_t)args.src_length, args.dest_count); ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME, &args); @@ -1629,10 +1878,12 @@ btrfs_test_extent_same_ioctl(void) argsp->info[2].dest_fd = 2; argsp->info[2].dest_offset = 20480; - printf("ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " + printf("ioctl(-1, %s, " "{src_offset=%" PRIu64 ", src_length=%" PRIu64 ", dest_count=%hu, info=", + sprint_xlat_(BTRFS_IOC_FILE_EXTENT_SAME, + "BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE"), (int64_t)argsp->src_offset, (uint64_t)argsp->src_length, argsp->dest_count); printf("[{dest_fd=%" PRId64 ", dest_offset=%" PRIu64 @@ -1691,9 +1942,12 @@ btrfs_test_extent_same_ioctl(void) argsp->info[2].dest_fd = fd2; argsp->info[2].dest_offset = 20480; - printf("ioctl(%d, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " + printf("ioctl(%d, %s, " "{src_offset=%" PRIu64 ", src_length=%" PRIu64 ", dest_count=%hu, info=", fd1, + sprint_xlat_(BTRFS_IOC_FILE_EXTENT_SAME, + "BTRFS_IOC_FILE_EXTENT_SAME" + " or FIDEDUPERANGE"), (uint64_t)argsp->src_offset, (uint64_t)argsp->src_length, argsp->dest_count); printf("[{dest_fd=%" PRId64 ", dest_offset=%" PRIu64 @@ -1733,7 +1987,7 @@ btrfs_test_extent_same_ioctl(void) close(fd2); } free(argsp); -#endif /* BTRFS_IOC_FILE_EXTENT_SAME */ +# endif /* BTRFS_IOC_FILE_EXTENT_SAME */ } static void @@ -1744,11 +1998,11 @@ btrfs_print_features(struct btrfs_ioctl_feature_flags *flags) "BTRFS_FEATURE_COMPAT_???"); printf(", compat_ro_flags="); - printflags(btrfs_features_compat_ro, flags->compat_ro_flags, + prfl_btrfs(btrfs_features_compat_ro, flags->compat_ro_flags, "BTRFS_FEATURE_COMPAT_RO_???"); printf(", incompat_flags="); - printflags(btrfs_features_incompat, flags->incompat_flags, + prfl_btrfs(btrfs_features_incompat, flags->incompat_flags, "BTRFS_FEATURE_INCOMPAT_???"); printf("}"); } @@ -1778,9 +2032,10 @@ btrfs_test_features_ioctls(void) struct btrfs_ioctl_feature_flags supported_features[3]; ioctl(-1, BTRFS_IOC_SET_FEATURES, NULL); - printf("ioctl(-1, BTRFS_IOC_SET_FEATURES, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SET_FEATURES)); - printf("ioctl(-1, BTRFS_IOC_SET_FEATURES, ["); + printf("ioctl(-1, %s, [", ioc(BTRFS_IOC_SET_FEATURES)); btrfs_print_features(&args[0]); printf(", "); btrfs_print_features(&args[1]); @@ -1788,8 +2043,8 @@ btrfs_test_features_ioctls(void) printf("]) = -1 EBADF (%m)\n"); if (btrfs_test_root) { - printf("ioctl(%d, BTRFS_IOC_GET_FEATURES, ", - btrfs_test_dir_fd); + printf("ioctl(%d, %s, ", + btrfs_test_dir_fd, ioc(BTRFS_IOC_GET_FEATURES)); ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_FEATURES, &supported_features); btrfs_print_features(&supported_features[0]); @@ -1797,15 +2052,16 @@ btrfs_test_features_ioctls(void) ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_SUPPORTED_FEATURES, &supported_features); - printf("ioctl(%d, BTRFS_IOC_GET_SUPPORTED_FEATURES, ", - btrfs_test_dir_fd); - printf("[ /* supported */ "); + printf("ioctl(%d, %s, ", + btrfs_test_dir_fd, + ioc(BTRFS_IOC_GET_SUPPORTED_FEATURES)); + printf("["); btrfs_print_features(&supported_features[0]); - printf(", /* safe to set */ "); + printf(" /* supported */, "); btrfs_print_features(&supported_features[1]); - printf(", /* safe to clear */ "); + printf(" /* safe to set */, "); btrfs_print_features(&supported_features[2]); - printf("]) = 0\n"); + printf(" /* safe to clear */]) = 0\n"); } } @@ -1816,7 +2072,7 @@ btrfs_test_read_ioctls(void) XLAT(BTRFS_IOC_BALANCE_PROGRESS), XLAT(BTRFS_IOC_FS_INFO), XLAT(BTRFS_IOC_GET_FEATURES), - XLAT(BTRFS_IOC_GET_FSLABEL), + XLAT(FS_IOC_GETFSLABEL), XLAT(BTRFS_IOC_GET_SUPPORTED_FEATURES), XLAT(BTRFS_IOC_QGROUP_LIMIT), XLAT(BTRFS_IOC_QUOTA_RESCAN_STATUS), @@ -1827,19 +2083,28 @@ btrfs_test_read_ioctls(void) unsigned int i; for (i = 0; i < ARRAY_SIZE(btrfs_read_cmd); ++i) { ioctl(-1, (unsigned long) btrfs_read_cmd[i].val, 0); - printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", btrfs_read_cmd[i].str); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + sprint_xlat_(btrfs_read_cmd[i].val, + btrfs_read_cmd[i].str)); } } +static void +rm_test_dir(void) +{ + int rootfd = open(path, O_RDONLY|O_DIRECTORY); + + unlinkat(rootfd, dir_name, AT_REMOVEDIR); +} + int main(int argc, char *argv[]) { int opt; int ret; - const char *path; - while ((opt = getopt(argc, argv, "wv")) != -1) { + while ((opt = getopt(argc, argv, "wvX")) != -1) { switch (opt) { case 'v': /* @@ -1851,11 +2116,18 @@ main(int argc, char *argv[]) case 'w': write_ok = true; break; + case 'X': + verbose_xlat = true; + break; default: - error_msg_and_fail("usage: btrfs [-v] [-w] [path]"); + error_msg_and_fail("usage: btrfs [-vwX] [path]"); } } + ret = snprintf(dir_name, sizeof(dir_name), dir_name_fmt, getpid()); + if (ret < 0) + perror_msg_and_fail("snprintf(dir_name)"); + /* * This will enable optional tests that require a valid file descriptor */ @@ -1877,14 +2149,18 @@ main(int argc, char *argv[]) if (rootfd < 0) perror_msg_and_fail("open(%s) failed", path); - ret = mkdirat(rootfd, "strace-test", 0755); + ret = mkdirat(rootfd, dir_name, 0755); if (ret < 0 && errno != EEXIST) - perror_msg_and_fail("mkdirat(strace-test) failed"); + perror_msg_and_fail("mkdirat(%s) failed", dir_name); + + /* Register removal of the created directory. */ + if (ret == 0) + atexit(rm_test_dir); - btrfs_test_dir_fd = openat(rootfd, "strace-test", + btrfs_test_dir_fd = openat(rootfd, dir_name, O_RDONLY|O_DIRECTORY); if (btrfs_test_dir_fd < 0) - perror_msg_and_fail("openat(strace-test) failed"); + perror_msg_and_fail("openat(%s) failed", dir_name); close(rootfd); } else write_ok = false; diff --git a/tests-mx32/btrfs.gen.test b/tests-mx32/btrfs.gen.test new file mode 100755 index 00000000..3976cf5d --- /dev/null +++ b/tests-mx32/btrfs.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (btrfs +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/btrfs.test b/tests-mx32/btrfs.test deleted file mode 100755 index 2121b5b8..00000000 --- a/tests-mx32/btrfs.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check basic btrfs ioctl decoding. - -. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/caps-abbrev.awk b/tests-mx32/caps-abbrev.awk index 86de7f23..c00023b4 100644 --- a/tests-mx32/caps-abbrev.awk +++ b/tests-mx32/caps-abbrev.awk @@ -2,30 +2,10 @@ # # This file is part of caps strace test. # -# Copyright (c) 2014-2016 Dmitry V. Levin +# Copyright (c) 2014-2018 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later BEGIN { cap = "(0|1< +# Copyright (c) 2014-2018 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later BEGIN { cap = "(0|1< + * Copyright (c) 2014-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/caps.test b/tests-mx32/caps.test index 607a75bb..ac68364e 100755 --- a/tests-mx32/caps.test +++ b/tests-mx32/caps.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check capget/capset syscalls decoding. +# +# Copyright (c) 2014-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests-mx32/check_sigblock.c b/tests-mx32/check_sigblock.c new file mode 100644 index 00000000..cd781f19 --- /dev/null +++ b/tests-mx32/check_sigblock.c @@ -0,0 +1,29 @@ +/* + * Check that the specified signal number is blocked/unblocked. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include + +int +main(int ac, char **av) +{ + if (ac != 3) + error_msg_and_fail("usage: check_sigblock 0|1 signum"); + + const int block = !!atoi(av[1]); + const int signum = atoi(av[2]); + sigset_t mask; + + sigemptyset(&mask); + if (sigprocmask(SIG_SETMASK, NULL, &mask)) + perror_msg_and_fail("sigprocmask"); + + return block ^ sigismember(&mask, signum); +} diff --git a/tests-mx32/check_sigign.c b/tests-mx32/check_sigign.c new file mode 100644 index 00000000..a04f5d6b --- /dev/null +++ b/tests-mx32/check_sigign.c @@ -0,0 +1,29 @@ +/* + * Check that the signal handler for the specified signal number is set + * to SIG_IGN/SIG_DFL. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include + +int +main(int ac, char **av) +{ + if (ac != 3) + error_msg_and_fail("usage: check_sigign 0|1 signum"); + + const int ign = !!atoi(av[1]); + const int signum = atoi(av[2]); + struct sigaction act; + + if (sigaction(signum, NULL, &act)) + perror_msg_and_fail("sigaction: %s", av[2]); + + return ign ^ (act.sa_handler == SIG_IGN); +} diff --git a/tests-mx32/chmod.c b/tests-mx32/chmod.c index f6f98ece..d7c9fbab 100644 --- a/tests-mx32/chmod.c +++ b/tests-mx32/chmod.c @@ -1,29 +1,9 @@ /* * Copyright (c) 2016 Anchit Jain - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -31,10 +11,10 @@ #if defined __NR_chmod -#include -#include -#include -#include +# include +# include +# include +# include int main(void) diff --git a/tests-mx32/chmod.gen.test b/tests-mx32/chmod.gen.test new file mode 100755 index 00000000..40330885 --- /dev/null +++ b/tests-mx32/chmod.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (chmod -a28 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-mx32/chmod.test b/tests-mx32/chmod.test deleted file mode 100755 index 70e561a1..00000000 --- a/tests-mx32/chmod.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check chmod syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 diff --git a/tests-mx32/chown.c b/tests-mx32/chown.c index 12aa8b71..05fe9af1 100644 --- a/tests-mx32/chown.c +++ b/tests-mx32/chown.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/chown.gen.test b/tests-mx32/chown.gen.test new file mode 100755 index 00000000..87cc0f02 --- /dev/null +++ b/tests-mx32/chown.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (chown -a28 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-mx32/chown.test b/tests-mx32/chown.test deleted file mode 100755 index eb356ce4..00000000 --- a/tests-mx32/chown.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check chown syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 diff --git a/tests-mx32/chown32.c b/tests-mx32/chown32.c index 4fffd769..f2726203 100644 --- a/tests-mx32/chown32.c +++ b/tests-mx32/chown32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/chown32.gen.test b/tests-mx32/chown32.gen.test new file mode 100755 index 00000000..8d9d8916 --- /dev/null +++ b/tests-mx32/chown32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (chown32 -a31 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 diff --git a/tests-mx32/chown32.test b/tests-mx32/chown32.test deleted file mode 100755 index 0fa04c20..00000000 --- a/tests-mx32/chown32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check chown32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a31 diff --git a/tests-mx32/chroot.c b/tests-mx32/chroot.c index a084cf33..3fc441e3 100644 --- a/tests-mx32/chroot.c +++ b/tests-mx32/chroot.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/chroot.gen.test b/tests-mx32/chroot.gen.test new file mode 100755 index 00000000..40eb55ba --- /dev/null +++ b/tests-mx32/chroot.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (chroot -a24 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-mx32/chroot.test b/tests-mx32/chroot.test deleted file mode 100755 index 3b384f5e..00000000 --- a/tests-mx32/chroot.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check chroot syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 diff --git a/tests-mx32/clock.gen.test b/tests-mx32/clock.gen.test new file mode 100755 index 00000000..b76eaf53 --- /dev/null +++ b/tests-mx32/clock.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (clock test_trace_expr 'times|fcntl.*' -e/clock); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr 'times|fcntl.*' -e/clock diff --git a/tests-mx32/clock.in b/tests-mx32/clock.in new file mode 100755 index 00000000..864de290 --- /dev/null +++ b/tests-mx32/clock.in @@ -0,0 +1,3 @@ +clock_adjtime -a37 +clock_nanosleep +clock_xettime -a36 diff --git a/tests-mx32/clock_adjtime.c b/tests-mx32/clock_adjtime.c index 01089b54..8e5a12fb 100644 --- a/tests-mx32/clock_adjtime.c +++ b/tests-mx32/clock_adjtime.c @@ -1,30 +1,10 @@ /* * This file is part of clock_adjtime strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/clock_adjtime.gen.test b/tests-mx32/clock_adjtime.gen.test new file mode 100755 index 00000000..22d5dbcd --- /dev/null +++ b/tests-mx32/clock_adjtime.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (clock_adjtime -a37 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a37 diff --git a/tests-mx32/clock_adjtime.test b/tests-mx32/clock_adjtime.test deleted file mode 100755 index df2c0601..00000000 --- a/tests-mx32/clock_adjtime.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check clock_adjtime syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a37 diff --git a/tests-mx32/clock_nanosleep.c b/tests-mx32/clock_nanosleep.c index 98407d7e..258c3ac1 100644 --- a/tests-mx32/clock_nanosleep.c +++ b/tests-mx32/clock_nanosleep.c @@ -1,28 +1,11 @@ /* + * Check decoding of clock_nanosleep and clock_gettime syscalls. + * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -62,9 +45,10 @@ main(void) if (syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, &req.ts, NULL)) perror_msg_and_skip("clock_nanosleep CLOCK_REALTIME"); - printf("clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=%jd, tv_nsec=%jd}, " - "NULL) = 0\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec); + printf("clock_nanosleep(CLOCK_REALTIME, 0" + ", {tv_sec=%lld, tv_nsec=%llu}, NULL) = 0\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec)); assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, NULL, &rem.ts) == -1); @@ -73,52 +57,71 @@ main(void) assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, &req.ts, &rem.ts) == 0); - printf("clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=%jd, tv_nsec=%jd}, " - "%p) = 0\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + printf("clock_nanosleep(CLOCK_REALTIME, 0" + ", {tv_sec=%lld, tv_nsec=%llu}, %p) = 0\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); req.ts.tv_nsec = 999999999 + 1; assert(syscall(__NR_clock_nanosleep, CLOCK_MONOTONIC, 0, &req.ts, &rem.ts) == -1); printf("clock_nanosleep(CLOCK_MONOTONIC, 0" - ", {tv_sec=%jd, tv_nsec=%jd}, %p) = -1 EINVAL (%m)\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + ", {tv_sec=%lld, tv_nsec=%llu}, %p) = -1 EINVAL (%m)\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); + + req.ts.tv_sec = 0xdeadbeefU; + req.ts.tv_nsec = 0xfacefeedU; + assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, + &req.ts, &rem.ts) == -1); + printf("clock_nanosleep(CLOCK_REALTIME, 0" + ", {tv_sec=%lld, tv_nsec=%llu}, %p) = -1 EINVAL (%m)\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); + + req.ts.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + req.ts.tv_nsec = (long) 0xbadc0dedfacefeedLL; + assert(syscall(__NR_clock_nanosleep, CLOCK_MONOTONIC, 0, + &req.ts, &rem.ts) == -1); + printf("clock_nanosleep(CLOCK_MONOTONIC, 0" + ", {tv_sec=%lld, tv_nsec=%llu}, %p) = -1 EINVAL (%m)\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); assert(sigaction(SIGALRM, &act, NULL) == 0); assert(sigprocmask(SIG_SETMASK, &set, NULL) == 0); if (setitimer(ITIMER_REAL, &itv, NULL)) perror_msg_and_skip("setitimer"); - printf("setitimer(ITIMER_REAL, {it_interval={tv_sec=%jd, tv_usec=%jd}" - ", it_value={tv_sec=%jd, tv_usec=%jd}}, NULL) = 0\n", - (intmax_t) itv.it_interval.tv_sec, - (intmax_t) itv.it_interval.tv_usec, - (intmax_t) itv.it_value.tv_sec, - (intmax_t) itv.it_value.tv_usec); - --req.ts.tv_nsec; + req.ts.tv_sec = 0; + req.ts.tv_nsec = 999999999; assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, &req.ts, &rem.ts) == -1); - printf("clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=%jd, tv_nsec=%jd}, " - "{tv_sec=%jd, tv_nsec=%jd})" + printf("clock_nanosleep(CLOCK_REALTIME, 0" + ", {tv_sec=%lld, tv_nsec=%llu}, {tv_sec=%lld, tv_nsec=%llu})" " = ? ERESTART_RESTARTBLOCK (Interrupted by signal)\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, - (intmax_t) rem.ts.tv_sec, (intmax_t) rem.ts.tv_nsec); + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), + (long long) rem.ts.tv_sec, + zero_extend_signed_to_ull(rem.ts.tv_nsec)); puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); assert(syscall(__NR_clock_gettime, CLOCK_REALTIME, &req.ts) == 0); - printf("clock_gettime(CLOCK_REALTIME, {tv_sec=%jd, tv_nsec=%jd}) = 0\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec); + printf("clock_gettime(CLOCK_REALTIME, {tv_sec=%lld, tv_nsec=%llu}) = 0\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec)); ++req.ts.tv_sec; rem.ts.tv_sec = 0xc0de4; rem.ts.tv_nsec = 0xc0de5; assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, TIMER_ABSTIME, &req.ts, &rem.ts) == -1); - printf("clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, {tv_sec=%jd, " - "tv_nsec=%jd}, %p)" + printf("clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME" + ", {tv_sec=%lld, tv_nsec=%llu}, %p)" " = ? ERESTARTNOHAND (To be restarted if no handler)\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); puts("+++ exited with 0 +++"); diff --git a/tests-mx32/clock_nanosleep.gen.test b/tests-mx32/clock_nanosleep.gen.test new file mode 100755 index 00000000..7a6025bb --- /dev/null +++ b/tests-mx32/clock_nanosleep.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (clock_nanosleep -e trace=clock_nanosleep,clock_gettime); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=clock_nanosleep,clock_gettime diff --git a/tests-mx32/clock_nanosleep.test b/tests-mx32/clock_nanosleep.test deleted file mode 100755 index ec434a60..00000000 --- a/tests-mx32/clock_nanosleep.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check clock_nanosleep, clock_gettime, and setitimer syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=clock_nanosleep,clock_gettime,setitimer diff --git a/tests-mx32/clock_xettime.c b/tests-mx32/clock_xettime.c index 3ef5695f..c25240da 100644 --- a/tests-mx32/clock_xettime.c +++ b/tests-mx32/clock_xettime.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -45,29 +26,45 @@ main(void) } t = { .pad = { 0xdeadbeef, 0xbadc0ded } }; + long rc; if (syscall(__NR_clock_getres, CLOCK_REALTIME, &t.ts)) perror_msg_and_skip("clock_getres CLOCK_REALTIME"); - printf("clock_getres(CLOCK_REALTIME, {tv_sec=%jd, tv_nsec=%jd}) = 0\n", - (intmax_t) t.ts.tv_sec, - (intmax_t) t.ts.tv_nsec); + printf("clock_getres(CLOCK_REALTIME, {tv_sec=%lld, tv_nsec=%llu})" + " = 0\n", + (long long) t.ts.tv_sec, + zero_extend_signed_to_ull(t.ts.tv_nsec)); if (syscall(__NR_clock_gettime, CLOCK_PROCESS_CPUTIME_ID, &t.ts)) perror_msg_and_skip("clock_gettime CLOCK_PROCESS_CPUTIME_ID"); - printf("clock_gettime(CLOCK_PROCESS_CPUTIME_ID, " - "{tv_sec=%jd, tv_nsec=%jd}) = 0\n", - (intmax_t) t.ts.tv_sec, - (intmax_t) t.ts.tv_nsec); + printf("clock_gettime(CLOCK_PROCESS_CPUTIME_ID" + ", {tv_sec=%lld, tv_nsec=%llu}) = 0\n", + (long long) t.ts.tv_sec, + zero_extend_signed_to_ull(t.ts.tv_nsec)); t.ts.tv_sec = 0xdeface1; t.ts.tv_nsec = 0xdeface2; - if (!syscall(__NR_clock_settime, CLOCK_THREAD_CPUTIME_ID, &t.ts)) - error_msg_and_skip("clock_settime CLOCK_THREAD_CPUTIME_ID:" - " EINVAL expected"); - printf("clock_settime(CLOCK_THREAD_CPUTIME_ID, {tv_sec=%jd, " - "tv_nsec=%jd}) = -1 EINVAL (%m)\n", - (intmax_t) t.ts.tv_sec, - (intmax_t) t.ts.tv_nsec); + rc = syscall(__NR_clock_settime, CLOCK_THREAD_CPUTIME_ID, &t.ts); + printf("clock_settime(CLOCK_THREAD_CPUTIME_ID" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + (long long) t.ts.tv_sec, + zero_extend_signed_to_ull(t.ts.tv_nsec), sprintrc(rc)); + + t.ts.tv_sec = 0xdeadbeefU; + t.ts.tv_nsec = 0xfacefeedU; + rc = syscall(__NR_clock_settime, CLOCK_THREAD_CPUTIME_ID, &t.ts); + printf("clock_settime(CLOCK_THREAD_CPUTIME_ID" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + (long long) t.ts.tv_sec, + zero_extend_signed_to_ull(t.ts.tv_nsec), sprintrc(rc)); + + t.ts.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + t.ts.tv_nsec = (long) 0xbadc0dedfacefeedLL; + rc = syscall(__NR_clock_settime, CLOCK_THREAD_CPUTIME_ID, &t.ts); + printf("clock_settime(CLOCK_THREAD_CPUTIME_ID" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + (long long) t.ts.tv_sec, + zero_extend_signed_to_ull(t.ts.tv_nsec), sprintrc(rc)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/clock_xettime.gen.test b/tests-mx32/clock_xettime.gen.test new file mode 100755 index 00000000..590f058e --- /dev/null +++ b/tests-mx32/clock_xettime.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (clock_xettime -a36 -e trace=clock_getres,clock_gettime,clock_settime); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 -e trace=clock_getres,clock_gettime,clock_settime diff --git a/tests-mx32/clock_xettime.test b/tests-mx32/clock_xettime.test deleted file mode 100755 index f045a66e..00000000 --- a/tests-mx32/clock_xettime.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check clock_getres, clock_gettime, and clock_settime syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a36 -e trace=clock_getres,clock_gettime,clock_settime diff --git a/tests-mx32/clone_parent.c b/tests-mx32/clone_parent.c new file mode 100644 index 00000000..111f98d1 --- /dev/null +++ b/tests-mx32/clone_parent.c @@ -0,0 +1,60 @@ +/* + * Check handling of CLONE_PARENT'ed processes. + * + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include + +static int +child(void *const arg) +{ + return 42; +} + +#define child_stack_size (get_page_size() / 2) + +#ifdef IA64 +extern int __clone2(int (*)(void *), void *, size_t, int, void *, ...); +# define clone(fn, child_stack, flags, arg) \ + __clone2(fn, child_stack, child_stack_size, flags, arg) +#endif + +int +main(void) +{ + const pid_t pid = clone(child, tail_alloc(child_stack_size), + CLONE_PARENT | SIGCHLD, 0); + if (pid < 0) + perror_msg_and_fail("clone"); + + int status; + if (wait(&status) >= 0) + error_msg_and_fail("unexpected return code from wait"); + + while (!kill(pid, 0)) + ; + if (errno != ESRCH) + perror_msg_and_fail("kill"); + + FILE *const fp = fdopen(3, "a"); + if (!fp) + perror_msg_and_fail("fdopen"); + if (fprintf(fp, "%s: Exit of unknown pid %d ignored\n", + getenv("STRACE_EXE") ?: "strace", pid) < 0) + perror_msg_and_fail("fprintf"); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/clone_parent.test b/tests-mx32/clone_parent.test new file mode 100755 index 00000000..a5b077f3 --- /dev/null +++ b/tests-mx32/clone_parent.test @@ -0,0 +1,10 @@ +#!/bin/sh -efu +# +# Check handling of CLONE_PARENT'ed processes. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/clone_ptrace.test" diff --git a/tests-mx32/clone_ptrace.c b/tests-mx32/clone_ptrace.c new file mode 100644 index 00000000..ee366ab9 --- /dev/null +++ b/tests-mx32/clone_ptrace.c @@ -0,0 +1,90 @@ +/* + * Check handling of CLONE_PTRACE'ed processes. + * + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +static siginfo_t sinfo; + +static void +handler(const int no, siginfo_t *const si, void *const uc) +{ + memcpy(&sinfo, si, sizeof(sinfo)); +} + +static int +child(void *const arg) +{ + for(;;) + pause(); + return 0; +} + +#define child_stack_size (get_page_size() / 2) + +#ifdef IA64 +extern int __clone2(int (*)(void *), void *, size_t, int, void *, ...); +# define clone(fn, child_stack, flags, arg) \ + __clone2(fn, child_stack, child_stack_size, flags, arg) +#endif + +int +main(void) +{ + const int sig = SIGUSR1; + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, sig); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + const pid_t pid = clone(child, tail_alloc(child_stack_size), + CLONE_PTRACE | SIGCHLD, 0); + if (pid < 0) + perror_msg_and_fail("clone"); + + static const struct sigaction sa = { + .sa_sigaction = handler, + .sa_flags = SA_SIGINFO + }; + if (sigaction(SIGCHLD, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + kill(pid, sig); + + FILE *const fp = fdopen(3, "a"); + if (!fp) + perror_msg_and_fail("fdopen"); + if (fprintf(fp, "%s: Detached unknown pid %d\n", + getenv("STRACE_EXE") ?: "strace", pid) < 0) + perror_msg_and_fail("fprintf"); + + int status; + while (wait(&status) != pid) { + if (errno != EINTR) + perror_msg_and_fail("wait"); + } + if (!WIFSIGNALED(status) || WTERMSIG(status) != sig) + error_msg_and_fail("unexpected child exit status %d", status); + + printf("--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=%d" + ", si_uid=%u, si_status=%s, si_utime=%u, si_stime=%u} ---\n" + "+++ exited with 0 +++\n", pid, geteuid(), "SIGUSR1", + (unsigned int) sinfo.si_utime, (unsigned int) sinfo.si_stime); + + return 0; +} diff --git a/tests-mx32/clone_ptrace.test b/tests-mx32/clone_ptrace.test new file mode 100755 index 00000000..24c4298a --- /dev/null +++ b/tests-mx32/clone_ptrace.test @@ -0,0 +1,24 @@ +#!/bin/sh -efu +# +# Check handling of CLONE_PTRACE'ed processes. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null 3>&1 +args="-e trace=none $args" +> "$LOG" || fail_ "failed to write $LOG" + +$STRACE -o "$LOG" $args > "$EXP" 2> "$OUT"-err 3> "$EXP"-err || { + msg="$STRACE $args failed with code $?" + cat "$OUT"-err "$LOG" >&2 + fail_ "$msg" +} + +cat "$OUT"-err >&2 +match_diff "$LOG" "$EXP" +match_diff "$OUT"-err "$EXP"-err diff --git a/tests-mx32/copy_file_range.c b/tests-mx32/copy_file_range.c index 085010af..c1f142c6 100644 --- a/tests-mx32/copy_file_range.c +++ b/tests-mx32/copy_file_range.c @@ -2,29 +2,10 @@ * This file is part of copy_file_range strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -41,8 +22,8 @@ main(void) { const long int fd_in = (long int) 0xdeadbeefffffffff; const long int fd_out = (long int) 0xdeadbeeffffffffe; - long long int *const off_in = tail_alloc(sizeof(*off_in)); - long long int *const off_out = tail_alloc(sizeof(*off_out)); + TAIL_ALLOC_OBJECT_CONST_PTR(long long int, off_in); + TAIL_ALLOC_OBJECT_CONST_PTR(long long int, off_out); *off_in = 0xdeadbef1facefed1; *off_out = 0xdeadbef2facefed2; const size_t len = (size_t) 0xdeadbef3facefed3ULL; diff --git a/tests-mx32/copy_file_range.gen.test b/tests-mx32/copy_file_range.gen.test new file mode 100755 index 00000000..e90c6c18 --- /dev/null +++ b/tests-mx32/copy_file_range.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (copy_file_range ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/copy_file_range.test b/tests-mx32/copy_file_range.test deleted file mode 100755 index c39f6acd..00000000 --- a/tests-mx32/copy_file_range.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check copy_file_range syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/count-f.c b/tests-mx32/count-f.c index 6992b16b..505b6900 100644 --- a/tests-mx32/count-f.c +++ b/tests-mx32/count-f.c @@ -1,30 +1,10 @@ /* * This file is part of count-f strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/count-f.test b/tests-mx32/count-f.test index 67515efa..4f3d45f8 100755 --- a/tests-mx32/count-f.test +++ b/tests-mx32/count-f.test @@ -1,6 +1,11 @@ #!/bin/sh - -# Check whether -c counts through forks and clones properly +# +# Check whether -c counts through forks and clones properly. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests-mx32/count.test b/tests-mx32/count.test index e75dc6b0..6abb1772 100755 --- a/tests-mx32/count.test +++ b/tests-mx32/count.test @@ -3,40 +3,21 @@ # Check whether -c and -w options work. # # Copyright (c) 2014-2016 Dmitry V. Levin +# Copyright (c) 2014-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./sleep 0 +run_prog ../sleep 0 check_prog grep grep_log() { local pattern="$1"; shift - run_strace "$@" ./sleep 1 + run_strace "$@" ../sleep 1 grep nanosleep "$LOG" > /dev/null || framework_skip_ 'sleep does not use nanosleep' @@ -49,8 +30,12 @@ grep_log() } grep_log ' *[^ ]+ +0\.0[^n]*nanosleep' -c +grep_log ' *[^ ]+ +0\.0[^n]*nanosleep' -c -O1 grep_log ' *[^ ]+ +0\.0[^n]*nanosleep' -c -enanosleep +grep_log ' *[^ ]+ +0\.0[^n]*nanosleep' -c -O1 -enanosleep grep_log ' *[^ ]+ +(1\.[01]|0\.99)[^n]*nanosleep' -cw +grep_log ' *[^ ]+ +(1\.[01]|0\.99)[^n]*nanosleep' -cw -O1 grep_log '100\.00 +(1\.[01]|0\.99)[^n]*nanosleep' -cw -enanosleep +grep_log '100\.00 +(1\.[01]|0\.99)[^n]*nanosleep' -cw -O1 -enanosleep exit 0 diff --git a/tests-mx32/creat.c b/tests-mx32/creat.c index f22fdaaa..71819d5b 100644 --- a/tests-mx32/creat.c +++ b/tests-mx32/creat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/creat.gen.test b/tests-mx32/creat.gen.test new file mode 100755 index 00000000..baff9169 --- /dev/null +++ b/tests-mx32/creat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (creat -a20 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-mx32/creat.test b/tests-mx32/creat.test deleted file mode 100755 index 069648f7..00000000 --- a/tests-mx32/creat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check creat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 diff --git a/tests-mx32/create_nl_socket.c b/tests-mx32/create_nl_socket.c new file mode 100644 index 00000000..ee187201 --- /dev/null +++ b/tests-mx32/create_nl_socket.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include "netlink.h" + +int +create_nl_socket_ext(const int proto, const char *const name) +{ + const int fd = socket(AF_NETLINK, SOCK_RAW, proto); + if (fd < 0) + perror_msg_and_skip("socket AF_NETLINK %s", name); + + const struct sockaddr_nl addr = { .nl_family = AF_NETLINK }; + socklen_t len = sizeof(addr); + + if (bind(fd, (const struct sockaddr *) &addr, len)) + perror_msg_and_skip("bind AF_NETLINK %s", name); + + /* one more operation on this socket to win the race */ + int listening; + len = sizeof(listening); + if (getsockopt(fd, SOL_SOCKET, SO_ACCEPTCONN, &listening, &len)) + perror_msg_and_fail("getsockopt"); + + return fd; +} diff --git a/tests-mx32/delay.c b/tests-mx32/delay.c new file mode 100644 index 00000000..fb19b157 --- /dev/null +++ b/tests-mx32/delay.c @@ -0,0 +1,115 @@ +/* + * Check delay injection. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int64_t +usecs_from_tv(const struct timeval *const tv) +{ + return (int64_t) tv->tv_sec * 1000000 + tv->tv_usec; +} + +static int64_t +usecs_from_ts(const struct timespec *const ts) +{ + return (int64_t) ts->tv_sec * 1000000 + ts->tv_nsec / 1000; +} + +static void +check_delay(const struct timeval *const tv0, + const struct timespec *const ts, + const struct timeval *const tv1, + const int nproc, + const int64_t delay_enter, + const int64_t delay_exit) +{ + const int64_t us0 = usecs_from_tv(tv0); + const int64_t us = usecs_from_ts(ts); + const int64_t us1 = usecs_from_tv(tv1); + + if (us - us0 < delay_exit * (nproc - 1) / nproc) + _exit(1); + + if (us - us0 > delay_exit * (nproc + 1) / nproc) + _exit(2); + + if (us1 - us < delay_enter * (nproc - 1) / nproc) + _exit(3); + + if (us1 - us > delay_enter * (nproc + 1) / nproc) + _exit(4); +} + +static void +run(const int nproc, const int delay_enter, const int delay_exit) +{ + struct timeval prev = { 0, 0 }, now; + + for (int i = 0; i < nproc; ++i, prev = now) { + struct timespec ts; + + if (i && clock_gettime(CLOCK_REALTIME, &ts)) + perror_msg_and_fail("clock_gettime"); + + if (syscall(__NR_gettimeofday, &now, NULL)) + perror_msg_and_fail("gettimeofday"); + + if (!i) + continue; + + check_delay(&prev, &ts, &now, nproc, delay_enter, delay_exit); + } + + _exit(0); +} + +int +main(int ac, char *av[]) +{ + if (ac != 4) + error_msg_and_fail("usage: delay "); + + const int nproc = atoi(av[1]); + if (nproc <= 1) + perror_msg_and_fail("invalid nproc: %s", av[1]); + + const int delay_enter = atoi(av[2]); + if (delay_enter <= 0) + perror_msg_and_fail("invalid delay_enter: %s", av[2]); + + const int delay_exit = atoi(av[3]); + if (delay_exit <= 0) + perror_msg_and_fail("invalid delay_exit: %s", av[3]); + + for (int i = 0; i < nproc; ++i) { + pid_t pid = fork(); + + if (pid) + usleep(MAX(delay_enter, delay_exit) / nproc); + else + run(nproc, delay_enter, delay_exit); + } + + int status; + while (wait(&status) > 0) { + if (status) + perror_msg_and_fail("wait status %d", status); + } + + return 0; +} diff --git a/tests-mx32/delay.test b/tests-mx32/delay.test new file mode 100755 index 00000000..df8552c7 --- /dev/null +++ b/tests-mx32/delay.test @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Check delay injection. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +delay_enter=800000 +delay_exit=1600000 +run_strace -f -r -egettimeofday \ + -einject=gettimeofday:delay_enter=$delay_enter:delay_exit=$delay_exit \ + ../delay 4 $delay_enter $delay_exit diff --git a/tests-mx32/delete_module.c b/tests-mx32/delete_module.c index 5a317603..3b2614c1 100644 --- a/tests-mx32/delete_module.c +++ b/tests-mx32/delete_module.c @@ -2,29 +2,10 @@ * Check decoding of delete_module syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -48,8 +29,7 @@ main(void) unsigned int val_prefix, val_suffix; } flags[] = { { ARG_STR(0), 0, 0 }, - { (kernel_ulong_t) 0xffffffff00000000ULL | O_NONBLOCK, - "O_NONBLOCK", 0, 0 }, + { F8ILL_KULONG_MASK | O_NONBLOCK, "O_NONBLOCK", 0, 0 }, { (kernel_ulong_t) 0xbadc0dedfacef157ULL & ~(O_NONBLOCK | O_TRUNC), " /* O_??? */", 0xfacef157U & ~(O_NONBLOCK | O_TRUNC), 0}, { (kernel_ulong_t) (0xfacef157deade71cULL & ~O_NONBLOCK) | O_TRUNC, @@ -65,7 +45,7 @@ main(void) fill_memory_ex(bogus_param1, PARAM1_LEN, PARAM1_BASE, PARAM1_LEN); fill_memory_ex(bogus_param2, PARAM2_LEN, PARAM2_BASE, PARAM2_LEN); - rc = syscall(__NR_delete_module, NULL, bogus_zero); + rc = syscall(__NR_delete_module, NULL, F8ILL_KULONG_MASK); printf("delete_module(NULL, 0) = %s\n", sprintrc(rc)); rc = syscall(__NR_delete_module, bogus_param1, flags[0].val); diff --git a/tests-mx32/delete_module.gen.test b/tests-mx32/delete_module.gen.test new file mode 100755 index 00000000..028515ff --- /dev/null +++ b/tests-mx32/delete_module.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (delete_module -a23 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 diff --git a/tests-mx32/delete_module.test b/tests-mx32/delete_module.test deleted file mode 100755 index fb86ec9a..00000000 --- a/tests-mx32/delete_module.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of delete_module syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a23 diff --git a/tests-mx32/detach-running.test b/tests-mx32/detach-running.test index 006efb85..5eaf3754 100755 --- a/tests-mx32/detach-running.test +++ b/tests-mx32/detach-running.test @@ -3,29 +3,10 @@ # Ensure that strace can detach from running processes. # # Copyright (c) 2013-2015 Dmitry V. Levin +# Copyright (c) 2014-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -34,9 +15,15 @@ run_prog_skip_if_failed \ check_prog sleep +trap - TERM +sleep $TIMEOUT_DURATION & +kill -TERM $! +wait $! +expected_rc=$? + set -e -./set_ptracer_any sh -c "echo > $LOG; while :; do :; done" > /dev/null & +../set_ptracer_any sh -c "echo > $LOG; while :; do :; done" > /dev/null & while ! [ -s "$LOG" ]; do kill -0 $! 2> /dev/null || @@ -54,7 +41,6 @@ cleanup() return 0 } -rm -f "$LOG" $STRACE -p $tracee_pid 2> "$LOG" & while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do @@ -65,13 +51,18 @@ while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do $SLEEP_A_BIT done -kill -INT $! -wait $! +kill -TERM $! +wait $! && rc=0 || rc=$? grep -F "Process $tracee_pid detached" "$LOG" > /dev/null || { - cleanup - dump_log_and_fail_with "$STRACE -p failed to detach" - } + cleanup + dump_log_and_fail_with "$STRACE -p failed to detach" +} + +[ "$rc" = "$expected_rc" ] || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to terminate itself" +} if [ -f /proc/self/status ]; then $SLEEP_A_BIT diff --git a/tests-mx32/detach-sleeping.test b/tests-mx32/detach-sleeping.test index 54304f31..857cc2f7 100755 --- a/tests-mx32/detach-sleeping.test +++ b/tests-mx32/detach-sleeping.test @@ -3,29 +3,10 @@ # Ensure that strace can detach from sleeping processes. # # Copyright (c) 2013-2015 Dmitry V. Levin +# Copyright (c) 2014-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -34,10 +15,15 @@ run_prog_skip_if_failed \ check_prog sleep +trap - TERM +sleep $TIMEOUT_DURATION & +kill -TERM $! +wait $! +expected_rc=$? + set -e -rm -f "$LOG" -./set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > "$LOG" & +../set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > "$LOG" & while ! [ -s "$LOG" ]; do kill -0 $! 2> /dev/null || @@ -55,7 +41,6 @@ cleanup() return 0 } -rm -f "$LOG" $STRACE -p $tracee_pid 2> "$LOG" & while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do @@ -66,14 +51,19 @@ while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do $SLEEP_A_BIT done -kill -INT $! -wait $! +kill -TERM $! +wait $! && rc=0 || rc=$? grep -F "Process $tracee_pid detached" "$LOG" > /dev/null || { cleanup dump_log_and_fail_with "$STRACE -p failed to detach" } +[ "$rc" = "$expected_rc" ] || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to terminate itself" +} + if [ -f /proc/self/status ]; then $SLEEP_A_BIT test -d /proc/$tracee_pid || { diff --git a/tests-mx32/detach-stopped.test b/tests-mx32/detach-stopped.test index 8f480e7f..5dcde9b9 100755 --- a/tests-mx32/detach-stopped.test +++ b/tests-mx32/detach-stopped.test @@ -3,46 +3,29 @@ # Ensure that strace can detach from stopped processes. # # Copyright (c) 2013-2015 Dmitry V. Levin +# Copyright (c) 2014-2019 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" +. "${srcdir=.}/PTRACE_SEIZE.sh" run_prog_skip_if_failed \ kill -0 $$ check_prog sleep -$STRACE -d -enone / > /dev/null 2> "$LOG" -if grep -x "[^:]*strace: PTRACE_SEIZE doesn't work" "$LOG" > /dev/null; then - skip_ "PTRACE_SEIZE doesn't work" -fi +trap - TERM +sleep $TIMEOUT_DURATION & +kill -TERM $! +wait $! +expected_rc=$? set -e -rm -f "$LOG" -./set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > "$LOG" & +> "$LOG" +../set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > "$LOG" & while ! [ -s "$LOG" ]; do kill -0 $! 2> /dev/null || @@ -62,7 +45,7 @@ cleanup() return 0 } -rm -f "$LOG" +> "$LOG" $STRACE -p $tracee_pid 2> "$LOG" & while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do @@ -81,14 +64,19 @@ while ! grep -F -e '--- stopped by ' "$LOG" > /dev/null; do $SLEEP_A_BIT done -kill -INT $! -wait $! +kill -TERM $! +wait $! && rc=0 || rc=$? grep -F "Process $tracee_pid detached" "$LOG" > /dev/null || { cleanup dump_log_and_fail_with "$STRACE -p failed to detach" } +[ "$rc" = "$expected_rc" ] || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to terminate itself" +} + if [ -f /proc/self/status ]; then $SLEEP_A_BIT test -d /proc/$tracee_pid || { diff --git a/tests-mx32/dev-yy.c b/tests-mx32/dev-yy.c new file mode 100644 index 00000000..b9f55fa4 --- /dev/null +++ b/tests-mx32/dev-yy.c @@ -0,0 +1,81 @@ +/* + * Check printing of character/block device numbers in -yy mode. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include + +#include + +#include + +#include + +#if defined __NR_openat && defined O_PATH + +int +main(void) +{ + static const struct { + const char *path; + unsigned int major; + unsigned int minor; + bool blk; + bool optional; + } checks[] = { + { "/dev/zero", 1, 5, false, false }, + { "/dev/full", 1, 7, false, false }, + { "/dev/sda", 8, 0, true, true }, + }; + + for (unsigned int i = 0; i < ARRAY_SIZE(checks); i++) { + /* + * We can't have nice things here and call openat() directly as + * some libcs (yes, musl, I'm looking at you now) are too + * frivolous in passing flags to the kernel. + */ + long fd = syscall(__NR_openat, AT_FDCWD, checks[i].path, + O_RDONLY|O_PATH); + + printf("openat(AT_FDCWD, \"%s\", O_RDONLY|O_PATH) = %s", + checks[i].path, sprintrc(fd)); + if (fd >= 0) + printf("<%s<%s %u:%u>>", + checks[i].path, + checks[i].blk ? "block" : "char", + checks[i].major, checks[i].minor); + puts(""); + + if (fd < 0) { + if (checks[i].optional) + continue; + else + perror_msg_and_fail("openat(\"%s\")", + checks[i].path); + } + + int rc = fsync(fd); + + printf("fsync(%ld<%s<%s %u:%u>>) = %s\n", + fd, checks[i].path, checks[i].blk ? "block" : "char", + checks[i].major, checks[i].minor, sprintrc(rc)); + + close(fd); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_openat && O_PATH") + +#endif diff --git a/tests-mx32/dev-yy.gen.test b/tests-mx32/dev-yy.gen.test new file mode 100755 index 00000000..d83d2e10 --- /dev/null +++ b/tests-mx32/dev-yy.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (dev-yy -a30 -e trace=openat,fsync -P "/dev/full" -P "/dev/zero" -P "/dev/sda" -yy); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 -e trace=openat,fsync -P "/dev/full" -P "/dev/zero" -P "/dev/sda" -yy diff --git a/tests-mx32/dup.c b/tests-mx32/dup.c index 62157e2f..5cf5df7c 100644 --- a/tests-mx32/dup.c +++ b/tests-mx32/dup.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include diff --git a/tests-mx32/dup.gen.test b/tests-mx32/dup.gen.test new file mode 100755 index 00000000..e559cdbc --- /dev/null +++ b/tests-mx32/dup.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (dup -a8 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 diff --git a/tests-mx32/dup.test b/tests-mx32/dup.test deleted file mode 100755 index 1dc19198..00000000 --- a/tests-mx32/dup.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check dup syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a8 diff --git a/tests-mx32/dup2.c b/tests-mx32/dup2.c index 9f3addfa..fba8fca5 100644 --- a/tests-mx32/dup2.c +++ b/tests-mx32/dup2.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/dup2.gen.test b/tests-mx32/dup2.gen.test new file mode 100755 index 00000000..6a6d2f58 --- /dev/null +++ b/tests-mx32/dup2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (dup2 -a13 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 diff --git a/tests-mx32/dup2.test b/tests-mx32/dup2.test deleted file mode 100755 index 509c5db1..00000000 --- a/tests-mx32/dup2.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check dup2 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a13 diff --git a/tests-mx32/dup3.c b/tests-mx32/dup3.c index 252e8469..741e06f8 100644 --- a/tests-mx32/dup3.c +++ b/tests-mx32/dup3.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include @@ -23,6 +30,6 @@ main(void) #else -SKIP_MAIN_UNDEFINED("__NR_dup3 && && O_CLOEXEC") +SKIP_MAIN_UNDEFINED("__NR_dup3 && O_CLOEXEC") #endif diff --git a/tests-mx32/dup3.gen.test b/tests-mx32/dup3.gen.test new file mode 100755 index 00000000..776b9a79 --- /dev/null +++ b/tests-mx32/dup3.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (dup3 -a24 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-mx32/dup3.test b/tests-mx32/dup3.test deleted file mode 100755 index 293f78f9..00000000 --- a/tests-mx32/dup3.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check dup3 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 diff --git a/tests-mx32/epoll_create.c b/tests-mx32/epoll_create.c index 44262c7d..42cc8d04 100644 --- a/tests-mx32/epoll_create.c +++ b/tests-mx32/epoll_create.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/epoll_create.gen.test b/tests-mx32/epoll_create.gen.test new file mode 100755 index 00000000..277a5aab --- /dev/null +++ b/tests-mx32/epoll_create.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (epoll_create -a17 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-mx32/epoll_create.test b/tests-mx32/epoll_create.test deleted file mode 100755 index 472a9bdb..00000000 --- a/tests-mx32/epoll_create.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check epoll_create syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a17 diff --git a/tests-mx32/epoll_create1.c b/tests-mx32/epoll_create1.c index cd905ecb..81b33825 100644 --- a/tests-mx32/epoll_create1.c +++ b/tests-mx32/epoll_create1.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/epoll_create1.gen.test b/tests-mx32/epoll_create1.gen.test new file mode 100755 index 00000000..c510c322 --- /dev/null +++ b/tests-mx32/epoll_create1.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (epoll_create1 -a28 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-mx32/epoll_create1.test b/tests-mx32/epoll_create1.test deleted file mode 100755 index 7a926a97..00000000 --- a/tests-mx32/epoll_create1.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check epoll_create1 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 diff --git a/tests-mx32/epoll_ctl.c b/tests-mx32/epoll_ctl.c index e6660555..85a288cd 100644 --- a/tests-mx32/epoll_ctl.c +++ b/tests-mx32/epoll_ctl.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -11,14 +18,14 @@ static long invoke_syscall(unsigned long epfd, unsigned long op, unsigned long fd, void *ev) { - op |= (unsigned long) 0xffffffff00000000ULL; - return syscall(__NR_epoll_ctl, epfd, op, fd, (unsigned long) ev); + return syscall(__NR_epoll_ctl, epfd, F8ILL_KULONG_MASK | op, + fd, (unsigned long) ev); } int main(void) { - struct epoll_event *const ev = tail_alloc(sizeof(*ev)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct epoll_event, ev); ev->events = EPOLLIN; long rc = invoke_syscall(-1U, EPOLL_CTL_ADD, -2U, ev); diff --git a/tests-mx32/epoll_ctl.gen.test b/tests-mx32/epoll_ctl.gen.test new file mode 100755 index 00000000..dba65f7d --- /dev/null +++ b/tests-mx32/epoll_ctl.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (epoll_ctl ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/epoll_ctl.test b/tests-mx32/epoll_ctl.test deleted file mode 100755 index 1aded543..00000000 --- a/tests-mx32/epoll_ctl.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check epoll_ctl syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/epoll_pwait.c b/tests-mx32/epoll_pwait.c index eaaa34d6..ce95e6dc 100644 --- a/tests-mx32/epoll_pwait.c +++ b/tests-mx32/epoll_pwait.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -12,7 +19,7 @@ int main(void) { sigset_t set[2]; - struct epoll_event *const ev = tail_alloc(sizeof(*ev)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct epoll_event, ev); long rc = syscall(__NR_epoll_pwait, -1, ev, 1, -2, set, (kernel_ulong_t) sizeof(set)); diff --git a/tests-mx32/epoll_pwait.gen.test b/tests-mx32/epoll_pwait.gen.test new file mode 100755 index 00000000..f98e2b55 --- /dev/null +++ b/tests-mx32/epoll_pwait.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (epoll_pwait ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/epoll_pwait.test b/tests-mx32/epoll_pwait.test deleted file mode 100755 index c7aeeace..00000000 --- a/tests-mx32/epoll_pwait.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of epoll_pwait syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/epoll_wait.c b/tests-mx32/epoll_wait.c index 038bf1f7..3981905d 100644 --- a/tests-mx32/epoll_wait.c +++ b/tests-mx32/epoll_wait.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -10,7 +17,7 @@ int main(void) { - struct epoll_event *const ev = tail_alloc(sizeof(*ev)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct epoll_event, ev); long rc = syscall(__NR_epoll_wait, -1, ev, 1, -2); printf("epoll_wait(-1, %p, 1, -2) = %ld %s (%m)\n", diff --git a/tests-mx32/epoll_wait.gen.test b/tests-mx32/epoll_wait.gen.test new file mode 100755 index 00000000..d90fbeb9 --- /dev/null +++ b/tests-mx32/epoll_wait.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (epoll_wait -a26 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a26 diff --git a/tests-mx32/epoll_wait.test b/tests-mx32/epoll_wait.test deleted file mode 100755 index 83ae161f..00000000 --- a/tests-mx32/epoll_wait.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check epoll_wait syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a26 diff --git a/tests-mx32/erestartsys.c b/tests-mx32/erestartsys.c index 97c9699c..c6767b52 100644 --- a/tests-mx32/erestartsys.c +++ b/tests-mx32/erestartsys.c @@ -1,30 +1,10 @@ /* * Check decoding of ERESTARTSYS error code. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/erestartsys.gen.test b/tests-mx32/erestartsys.gen.test new file mode 100755 index 00000000..0fc3215f --- /dev/null +++ b/tests-mx32/erestartsys.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (erestartsys -a34 -e signal=none -e trace=recvfrom); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a34 -e signal=none -e trace=recvfrom diff --git a/tests-mx32/erestartsys.test b/tests-mx32/erestartsys.test deleted file mode 100755 index 91f711f3..00000000 --- a/tests-mx32/erestartsys.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of ERESTARTSYS error code. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a34 -e signal=none -e trace=recvfrom diff --git a/tests-mx32/errno2name.c b/tests-mx32/errno2name.c index 4a176993..56340d75 100644 --- a/tests-mx32/errno2name.c +++ b/tests-mx32/errno2name.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -476,6 +457,7 @@ errno2name(void) #ifdef EXFULL CASE(EXFULL); #endif - default: perror_msg_and_fail("unknown errno %d", errno); + default: + perror_msg_and_fail("unknown errno %d", errno); } } diff --git a/tests-mx32/error_msg.c b/tests-mx32/error_msg.c index 498a8821..caefa947 100644 --- a/tests-mx32/error_msg.c +++ b/tests-mx32/error_msg.c @@ -1,30 +1,14 @@ /* * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ +#define perror_msg_and_fail perror_msg_and_fail +#define error_msg_and_fail error_msg_and_fail + #include "tests.h" #include #include diff --git a/tests-mx32/eventfd.c b/tests-mx32/eventfd.c index d6ad6492..75d33dd7 100644 --- a/tests-mx32/eventfd.c +++ b/tests-mx32/eventfd.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/eventfd.test b/tests-mx32/eventfd.test index e181ed6e..b6d24454 100755 --- a/tests-mx32/eventfd.test +++ b/tests-mx32/eventfd.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check eventfd2 syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests-mx32/execve-v.test b/tests-mx32/execve-v.test index cce58601..f8bafb91 100755 --- a/tests-mx32/execve-v.test +++ b/tests-mx32/execve-v.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check verbose decoding of execve syscall. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -11,5 +16,3 @@ run_strace -veexecve $args > "$EXP" # Filter out execve() call made by strace. grep -F test.execve < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/execve.c b/tests-mx32/execve.c index 74749e73..db7206d8 100644 --- a/tests-mx32/execve.c +++ b/tests-mx32/execve.c @@ -2,29 +2,10 @@ * This file is part of execve strace test. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -58,34 +39,40 @@ main(void) execve(FILENAME, tail_argv, tail_envp); printf("execve(\"%s\"" - ", [\"%s\", \"%s\", \"%s\", %p, %p, %p, ???]" + ", [\"%s\", \"%s\", \"%s\", %p, %p, %p, ... /* %p */]" #if VERBOSE - ", [\"%s\", \"%s\", %p, %p, %p, ???]" + ", [\"%s\", \"%s\", %p, %p, %p, ... /* %p */]" #else - ", [/* 5 vars, unterminated */]" + ", %p /* 5 vars, unterminated */" #endif ") = -1 ENOENT (%m)\n", Q_FILENAME, q_argv[0], q_argv[1], q_argv[2], - argv[3], argv[4], argv[5] + argv[3], argv[4], argv[5], (char *) tail_argv + sizeof(argv) #if VERBOSE - , q_envp[0], q_envp[1], envp[2], envp[3], envp[4] + , q_envp[0], q_envp[1], envp[2], envp[3], envp[4], + (char *) tail_envp + sizeof(envp) +#else + , tail_envp #endif ); tail_argv[ARRAY_SIZE(q_argv)] = NULL; tail_envp[ARRAY_SIZE(q_envp)] = NULL; + (void) q_envp; /* workaround for clang bug #33068 */ execve(FILENAME, tail_argv, tail_envp); printf("execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" #if VERBOSE ", [\"%s\", \"%s\"]" #else - ", [/* 2 vars */]" + ", %p /* 2 vars */" #endif ") = -1 ENOENT (%m)\n", Q_FILENAME, q_argv[0], q_argv[1], q_argv[2] #if VERBOSE , q_envp[0], q_envp[1] +#else + , tail_envp #endif ); @@ -94,16 +81,18 @@ main(void) #if VERBOSE ", [\"%s\"]" #else - ", [/* 1 var */]" + ", %p /* 1 var */" #endif ") = -1 ENOENT (%m)\n", Q_FILENAME, q_argv[2] #if VERBOSE , q_envp[1] +#else + , tail_envp + 1 #endif ); - char **const empty = tail_alloc(sizeof(*empty)); + TAIL_ALLOC_OBJECT_CONST_PTR(char *, empty); char **const efault = empty + 1; *empty = NULL; @@ -112,13 +101,22 @@ main(void) #if VERBOSE ", []" #else - ", [/* 0 vars */]" + ", %p /* 0 vars */" #endif - ") = -1 ENOENT (%m)\n", Q_FILENAME); + ") = -1 ENOENT (%m)\n", Q_FILENAME +#if !VERBOSE + , empty +#endif + ); + + char *const str_a = tail_alloc(DEFAULT_STRLEN + 2); + fill_memory_ex(str_a, DEFAULT_STRLEN + 1, '0', 10); + str_a[DEFAULT_STRLEN + 1] = '\0'; + + char *const str_b = tail_alloc(DEFAULT_STRLEN + 2); + fill_memory_ex(str_b, DEFAULT_STRLEN + 1, '_', 32); + str_b[DEFAULT_STRLEN + 1] = '\0'; - char str_a[] = "012345678901234567890123456789012"; - char str_b[] = "_abcdefghijklmnopqrstuvwxyz()[]{}"; -#define DEFAULT_STRLEN ((unsigned int) sizeof(str_a) - 2) char **const a = tail_alloc(sizeof(*a) * (DEFAULT_STRLEN + 2)); char **const b = tail_alloc(sizeof(*b) * (DEFAULT_STRLEN + 2)); unsigned int i; @@ -141,10 +139,11 @@ main(void) printf("], [\"%.*s\"...", DEFAULT_STRLEN, b[0]); for (i = 1; i <= DEFAULT_STRLEN; ++i) printf(", \"%s\"", b[i]); + printf("]"); #else - printf("], [/* %u vars */", DEFAULT_STRLEN + 1); + printf("], %p /* %u vars */", b, DEFAULT_STRLEN + 1); #endif - printf("]) = -1 ENOENT (%m)\n"); + printf(") = -1 ENOENT (%m)\n"); execve(FILENAME, a + 1, b + 1); printf("execve(\"%s\", [\"%s\"", Q_FILENAME, a[1]); @@ -154,10 +153,11 @@ main(void) printf("], [\"%s\"", b[1]); for (i = 2; i <= DEFAULT_STRLEN; ++i) printf(", \"%s\"", b[i]); + printf("]"); #else - printf("], [/* %d vars */", DEFAULT_STRLEN); + printf("], %p /* %d vars */", b + 1, DEFAULT_STRLEN); #endif - printf("]) = -1 ENOENT (%m)\n"); + printf(") = -1 ENOENT (%m)\n"); execve(FILENAME, (char **) tail_argv[ARRAY_SIZE(q_argv)], efault); printf("execve(\"%s\", NULL, %p) = -1 ENOENT (%m)\n", diff --git a/tests-mx32/execve.test b/tests-mx32/execve.test index 263b6fc5..0824bab4 100755 --- a/tests-mx32/execve.test +++ b/tests-mx32/execve.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check execve syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -11,5 +16,3 @@ run_strace -eexecve $args > "$EXP" # Filter out execve() call made by strace. grep -F test.execve < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/execveat-v.gen.test b/tests-mx32/execveat-v.gen.test new file mode 100755 index 00000000..f7d572f3 --- /dev/null +++ b/tests-mx32/execveat-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (execveat-v -v -e trace=execveat); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=execveat diff --git a/tests-mx32/execveat-v.test b/tests-mx32/execveat-v.test deleted file mode 100755 index a9052248..00000000 --- a/tests-mx32/execveat-v.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check verbose decoding of execveat syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -e trace=execveat diff --git a/tests-mx32/execveat.c b/tests-mx32/execveat.c index 9083830e..629a69ab 100644 --- a/tests-mx32/execveat.c +++ b/tests-mx32/execveat.c @@ -2,29 +2,10 @@ * This file is part of execveat strace test. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -63,68 +44,85 @@ main(void) syscall(__NR_execveat, -100, FILENAME, tail_argv, tail_envp, 0x1100); printf("execveat(AT_FDCWD, \"%s\"" - ", [\"%s\", \"%s\", \"%s\", %p, %p, %p, ???]" -#if VERBOSE - ", [\"%s\", \"%s\", %p, %p, %p, ???]" -#else - ", [/* 5 vars, unterminated */]" -#endif + ", [\"%s\", \"%s\", \"%s\", %p, %p, %p, ... /* %p */]" +# if VERBOSE + ", [\"%s\", \"%s\", %p, %p, %p, ... /* %p */]" +# else + ", %p /* 5 vars, unterminated */" +# endif ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", Q_FILENAME, q_argv[0], q_argv[1], q_argv[2], - argv[3], argv[4], argv[5], -#if VERBOSE + argv[3], argv[4], argv[5], (char *) tail_argv + sizeof(argv), +# if VERBOSE q_envp[0], q_envp[1], envp[2], envp[3], envp[4], -#endif + (char *) tail_envp + sizeof(envp), +# else + tail_envp, +# endif errno2name()); tail_argv[ARRAY_SIZE(q_argv)] = NULL; tail_envp[ARRAY_SIZE(q_envp)] = NULL; + (void) q_envp; /* workaround for clang bug #33068 */ syscall(__NR_execveat, -100, FILENAME, tail_argv, tail_envp, 0x1100); printf("execveat(AT_FDCWD, \"%s\", [\"%s\", \"%s\", \"%s\"]" -#if VERBOSE +# if VERBOSE ", [\"%s\", \"%s\"]" -#else - ", [/* 2 vars */]" -#endif +# else + ", %p /* 2 vars */" +# endif ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", Q_FILENAME, q_argv[0], q_argv[1], q_argv[2], -#if VERBOSE +# if VERBOSE q_envp[0], q_envp[1], -#endif +# else + tail_envp, +# endif errno2name()); syscall(__NR_execveat, -100, FILENAME, tail_argv + 2, tail_envp + 1, 0x1100); printf("execveat(AT_FDCWD, \"%s\", [\"%s\"]" -#if VERBOSE +# if VERBOSE ", [\"%s\"]" -#else - ", [/* 1 var */]" -#endif +# else + ", %p /* 1 var */" +# endif ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", Q_FILENAME, q_argv[2], -#if VERBOSE +# if VERBOSE q_envp[1], -#endif +# else + tail_envp + 1, +# endif errno2name()); - char **const empty = tail_alloc(sizeof(*empty)); + TAIL_ALLOC_OBJECT_CONST_PTR(char *, empty); char **const efault = empty + 1; *empty = NULL; syscall(__NR_execveat, -100, FILENAME, empty, empty, 0x1100); printf("execveat(AT_FDCWD, \"%s\", []" -#if VERBOSE +# if VERBOSE ", []" -#else - ", [/* 0 vars */]" -#endif +# else + ", %p /* 0 vars */" +# endif ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", - Q_FILENAME, errno2name()); + Q_FILENAME, +# if !VERBOSE + empty, +# endif + errno2name()); + + char *const str_a = tail_alloc(DEFAULT_STRLEN + 2); + fill_memory_ex(str_a, DEFAULT_STRLEN + 1, '0', 10); + str_a[DEFAULT_STRLEN + 1] = '\0'; + + char *const str_b = tail_alloc(DEFAULT_STRLEN + 2); + fill_memory_ex(str_b, DEFAULT_STRLEN + 1, '_', 32); + str_b[DEFAULT_STRLEN + 1] = '\0'; - char str_a[] = "012345678901234567890123456789012"; - char str_b[] = "_abcdefghijklmnopqrstuvwxyz()[]{}"; -#define DEFAULT_STRLEN ((unsigned int) sizeof(str_a) - 2) char **const a = tail_alloc(sizeof(*a) * (DEFAULT_STRLEN + 2)); char **const b = tail_alloc(sizeof(*b) * (DEFAULT_STRLEN + 2)); unsigned int i; @@ -138,33 +136,35 @@ main(void) printf("execveat(AT_FDCWD, \"%s\", [\"%.*s\"...", Q_FILENAME, DEFAULT_STRLEN, a[0]); for (i = 1; i < DEFAULT_STRLEN; ++i) printf(", \"%s\"", a[i]); -#if VERBOSE +# if VERBOSE printf(", \"%s\"", a[i]); -#else +# else printf(", ..."); -#endif -#if VERBOSE +# endif +# if VERBOSE printf("], [\"%.*s\"...", DEFAULT_STRLEN, b[0]); for (i = 1; i <= DEFAULT_STRLEN; ++i) printf(", \"%s\"", b[i]); -#else - printf("], [/* %u vars */", DEFAULT_STRLEN + 1); -#endif - printf("], AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + printf("]"); +# else + printf("], %p /* %u vars */", b, DEFAULT_STRLEN + 1); +# endif + printf(", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", errno2name()); syscall(__NR_execveat, -100, FILENAME, a + 1, b + 1, 0x1100); printf("execveat(AT_FDCWD, \"%s\", [\"%s\"", Q_FILENAME, a[1]); for (i = 2; i <= DEFAULT_STRLEN; ++i) printf(", \"%s\"", a[i]); -#if VERBOSE +# if VERBOSE printf("], [\"%s\"", b[1]); for (i = 2; i <= DEFAULT_STRLEN; ++i) printf(", \"%s\"", b[i]); -#else - printf("], [/* %d vars */", DEFAULT_STRLEN); -#endif - printf("], AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + printf("]"); +# else + printf("], %p /* %d vars */", b + 1, DEFAULT_STRLEN); +# endif + printf(", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", errno2name()); syscall(__NR_execveat, -100, FILENAME, NULL, efault, 0x1100); diff --git a/tests-mx32/execveat.gen.test b/tests-mx32/execveat.gen.test new file mode 100755 index 00000000..180b8299 --- /dev/null +++ b/tests-mx32/execveat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (execveat ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/execveat.test b/tests-mx32/execveat.test deleted file mode 100755 index 879e03e2..00000000 --- a/tests-mx32/execveat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check execveat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/faccessat.c b/tests-mx32/faccessat.c index ce81349d..6d95555a 100644 --- a/tests-mx32/faccessat.c +++ b/tests-mx32/faccessat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/faccessat.gen.test b/tests-mx32/faccessat.gen.test new file mode 100755 index 00000000..4ccec2aa --- /dev/null +++ b/tests-mx32/faccessat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (faccessat -P $NAME.sample); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -P $NAME.sample diff --git a/tests-mx32/faccessat.test b/tests-mx32/faccessat.test deleted file mode 100755 index 61e7e2fd..00000000 --- a/tests-mx32/faccessat.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check faccessat syscall decoding. - -. "${srcdir=.}/openat.test" diff --git a/tests-mx32/fadvise.h b/tests-mx32/fadvise.h index 7a75f73b..f8ef089b 100644 --- a/tests-mx32/fadvise.h +++ b/tests-mx32/fadvise.h @@ -3,33 +3,14 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef STRACE_TESTS_FADVISE_H -#define STRACE_TESTS_FADVISE_H +# define STRACE_TESTS_FADVISE_H # include # include diff --git a/tests-mx32/fadvise64.c b/tests-mx32/fadvise64.c index 930680be..1d7b6681 100644 --- a/tests-mx32/fadvise64.c +++ b/tests-mx32/fadvise64.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/fadvise64.test b/tests-mx32/fadvise64.test index 9f746720..c4e1415e 100755 --- a/tests-mx32/fadvise64.test +++ b/tests-mx32/fadvise64.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check decoding of fadvise64 syscall. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -9,4 +14,3 @@ run_strace -e $NAME $args > "$EXP" check_prog grep grep -v "^$NAME([0123]," < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/fadvise64_64.c b/tests-mx32/fadvise64_64.c index c23df97f..1520b7e4 100644 --- a/tests-mx32/fadvise64_64.c +++ b/tests-mx32/fadvise64_64.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/fadvise64_64.gen.test b/tests-mx32/fadvise64_64.gen.test new file mode 100755 index 00000000..e46bf810 --- /dev/null +++ b/tests-mx32/fadvise64_64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fadvise64_64 +fadvise64.test ); do not edit. +set -- +. "${srcdir=.}/fadvise64.test" diff --git a/tests-mx32/fadvise64_64.test b/tests-mx32/fadvise64_64.test deleted file mode 100755 index a50fe2b9..00000000 --- a/tests-mx32/fadvise64_64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of fadvise64_64 syscall. - -. "${srcdir=.}/fadvise64.test" diff --git a/tests-mx32/fallocate.c b/tests-mx32/fallocate.c index a31711b3..0e2284de 100644 --- a/tests-mx32/fallocate.c +++ b/tests-mx32/fallocate.c @@ -2,29 +2,10 @@ * Check decoding of fallocate syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/fallocate.gen.test b/tests-mx32/fallocate.gen.test new file mode 100755 index 00000000..3bb5bbf0 --- /dev/null +++ b/tests-mx32/fallocate.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fallocate -a18 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests-mx32/fallocate.test b/tests-mx32/fallocate.test deleted file mode 100755 index 405187e5..00000000 --- a/tests-mx32/fallocate.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getcwd syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a18 diff --git a/tests-mx32/fanotify_init.c b/tests-mx32/fanotify_init.c index c14b4131..a3eeff53 100644 --- a/tests-mx32/fanotify_init.c +++ b/tests-mx32/fanotify_init.c @@ -2,29 +2,10 @@ * Check decoding of fanotify_init syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -60,17 +41,19 @@ int main(void) { static const struct strval flags[] = { - { (kernel_ulong_t) 0xffffffff00000000ULL, "FAN_CLASS_NOTIF" }, + { F8ILL_KULONG_MASK, "FAN_CLASS_NOTIF" }, { (kernel_ulong_t) 0xffffffff0000000cULL, "0xc /* FAN_CLASS_??? */" }, - { (kernel_ulong_t) 0xdec0deddefaced04ULL, - "FAN_CLASS_CONTENT|0xefaced00 /* FAN_??? */" }, + { (kernel_ulong_t) 0xdec0deddefacec04ULL, + "FAN_CLASS_CONTENT|0xefacec00 /* FAN_??? */" }, { (kernel_ulong_t) 0xffffffffffffffffULL, "0xc /* FAN_CLASS_??? */|FAN_CLOEXEC|FAN_NONBLOCK|" - "FAN_UNLIMITED_QUEUE|FAN_UNLIMITED_MARKS|0xffffffc0" }, + "FAN_UNLIMITED_QUEUE|FAN_UNLIMITED_MARKS|" + "FAN_ENABLE_AUDIT|FAN_REPORT_TID|FAN_REPORT_FID|" + "0xfffffc80" }, }; static const struct strval event_f_flags[] = { - { (kernel_ulong_t) 0xffffffff00000000ULL, "O_RDONLY" }, + { F8ILL_KULONG_MASK, "O_RDONLY" }, { (kernel_ulong_t) 0xdeadbeef80000001ULL, "O_WRONLY|0x80000000" } }; diff --git a/tests-mx32/fanotify_init.gen.test b/tests-mx32/fanotify_init.gen.test new file mode 100755 index 00000000..69807a7a --- /dev/null +++ b/tests-mx32/fanotify_init.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fanotify_init ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/fanotify_init.test b/tests-mx32/fanotify_init.test deleted file mode 100755 index 8d26af42..00000000 --- a/tests-mx32/fanotify_init.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of fanotify_init syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/fanotify_mark-Xabbrev.c b/tests-mx32/fanotify_mark-Xabbrev.c new file mode 100644 index 00000000..2dc9fa12 --- /dev/null +++ b/tests-mx32/fanotify_mark-Xabbrev.c @@ -0,0 +1 @@ +#include "fanotify_mark.c" diff --git a/tests-mx32/fanotify_mark-Xabbrev.gen.test b/tests-mx32/fanotify_mark-Xabbrev.gen.test new file mode 100755 index 00000000..86c40340 --- /dev/null +++ b/tests-mx32/fanotify_mark-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fanotify_mark-Xabbrev -a32 -Xabbrev -e trace=fanotify_mark); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -Xabbrev -e trace=fanotify_mark diff --git a/tests-mx32/fanotify_mark-Xraw.c b/tests-mx32/fanotify_mark-Xraw.c new file mode 100644 index 00000000..f02c886a --- /dev/null +++ b/tests-mx32/fanotify_mark-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "fanotify_mark.c" diff --git a/tests-mx32/fanotify_mark-Xraw.gen.test b/tests-mx32/fanotify_mark-Xraw.gen.test new file mode 100755 index 00000000..5be964d0 --- /dev/null +++ b/tests-mx32/fanotify_mark-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fanotify_mark-Xraw -a32 -Xraw -e trace=fanotify_mark); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -Xraw -e trace=fanotify_mark diff --git a/tests-mx32/fanotify_mark-Xverbose.c b/tests-mx32/fanotify_mark-Xverbose.c new file mode 100644 index 00000000..b76f46f3 --- /dev/null +++ b/tests-mx32/fanotify_mark-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "fanotify_mark.c" diff --git a/tests-mx32/fanotify_mark-Xverbose.gen.test b/tests-mx32/fanotify_mark-Xverbose.gen.test new file mode 100755 index 00000000..ef1a99d6 --- /dev/null +++ b/tests-mx32/fanotify_mark-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fanotify_mark-Xverbose -a32 -Xverbose -e trace=fanotify_mark); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -Xverbose -e trace=fanotify_mark diff --git a/tests-mx32/fanotify_mark.c b/tests-mx32/fanotify_mark.c index 43f285d3..33d18253 100644 --- a/tests-mx32/fanotify_mark.c +++ b/tests-mx32/fanotify_mark.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2015-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,6 +21,20 @@ # include # include +# if XLAT_RAW +# define str_fan_mark_add "0x1" +# define str_fan_modify_ondir "0x40000002" +# define str_at_fdcwd "-100" +# elif XLAT_VERBOSE +# define str_fan_mark_add "0x1 /* FAN_MARK_ADD */" +# define str_fan_modify_ondir "0x40000002 /* FAN_MODIFY|FAN_ONDIR */" +# define str_at_fdcwd "-100 /* AT_FDCWD */" +# else +# define str_fan_mark_add "FAN_MARK_ADD" +# define str_fan_modify_ondir "FAN_MODIFY|FAN_ONDIR" +# define str_at_fdcwd "AT_FDCWD" +# endif + /* Performs fanotify_mark call via the syscall interface. */ static void do_call(kernel_ulong_t fd, kernel_ulong_t flags, const char *flags_str, @@ -78,8 +73,8 @@ struct strval64 { const char *str; }; -#define STR16 "0123456789abcdef" -#define STR64 STR16 STR16 STR16 STR16 +# define STR16 "0123456789abcdef" +# define STR64 STR16 STR16 STR16 STR16 int main(void) @@ -90,32 +85,97 @@ main(void) static const kernel_ulong_t fds[] = { (kernel_ulong_t) 0xdeadfeed12345678ULL, - (kernel_ulong_t) 0xffffffff00000000ULL, + F8ILL_KULONG_MASK, (kernel_ulong_t) 0xdeb0d1edffffffffULL, }; static const struct strval flags[] = { - { (kernel_ulong_t) 0xffffffff00000000ULL, "0" }, - { (kernel_ulong_t) 0xdec0deddefaced00ULL, - "0xefaced00 /* FAN_MARK_??? */" }, + { F8ILL_KULONG_MASK, "0" }, + { (kernel_ulong_t) 0xdec0deddefacec00ULL, + "0xefacec00" +# if !XLAT_RAW + " /* FAN_MARK_??? */" +# endif + }, { (kernel_ulong_t) 0xda7a105700000040ULL, - "FAN_MARK_IGNORED_SURV_MODIFY" }, - { (kernel_ulong_t) 0xbadc0deddeadfeedULL, - "FAN_MARK_ADD|FAN_MARK_DONT_FOLLOW|FAN_MARK_ONLYDIR|" - "FAN_MARK_IGNORED_MASK|FAN_MARK_IGNORED_SURV_MODIFY|" - "FAN_MARK_FLUSH|0xdeadfe00" }, +# if XLAT_RAW + "0x40" +# elif XLAT_VERBOSE + "0x40 /* FAN_MARK_IGNORED_SURV_MODIFY */" +# else + "FAN_MARK_IGNORED_SURV_MODIFY" +# endif + }, + { (kernel_ulong_t) 0xbadc0deddeadffffULL, +# if XLAT_RAW || XLAT_VERBOSE + "0xdeadffff" +# endif +# if XLAT_VERBOSE + " /* " +# endif +# if !XLAT_RAW + "FAN_MARK_ADD|FAN_MARK_REMOVE|FAN_MARK_DONT_FOLLOW|" + "FAN_MARK_ONLYDIR|FAN_MARK_MOUNT|FAN_MARK_IGNORED_MASK|" + "FAN_MARK_IGNORED_SURV_MODIFY|FAN_MARK_FLUSH|" + "FAN_MARK_FILESYSTEM|0xdeadfe00" +# endif +# if XLAT_VERBOSE + " */" +# endif + }, }; static const struct strval64 masks[] = { { ARG_ULL_STR(0) }, - { 0xdeadfeedfacebeefULL, - "FAN_ACCESS|FAN_MODIFY|FAN_CLOSE_WRITE|FAN_OPEN|" - "FAN_ACCESS_PERM|FAN_ONDIR|FAN_EVENT_ON_CHILD|" - "0xdeadfeedb2ccbec4" }, - { ARG_ULL_STR(0xffffffffb7fcbfc4) " /* FAN_??? */" }, + { 0xdeadfeedffffffffULL, +# if XLAT_RAW || XLAT_VERBOSE + "0xdeadfeedffffffff" +# endif +# if XLAT_VERBOSE + " /* " +# endif +# if !XLAT_RAW + "FAN_ACCESS|" + "FAN_MODIFY|" + "FAN_ATTRIB|" + "FAN_CLOSE_WRITE|" + "FAN_CLOSE_NOWRITE|" + "FAN_OPEN|" + "FAN_MOVED_FROM|" + "FAN_MOVED_TO|" + "FAN_CREATE|" + "FAN_DELETE|" + "FAN_DELETE_SELF|" + "FAN_MOVE_SELF|" + "FAN_OPEN_EXEC|" + "FAN_Q_OVERFLOW|" + "FAN_OPEN_PERM|" + "FAN_ACCESS_PERM|" + "FAN_OPEN_EXEC_PERM|" + "FAN_ONDIR|" + "FAN_EVENT_ON_CHILD|" + "0xdeadfeedb7f8a000" +# endif +# if XLAT_VERBOSE + " */" +# endif + }, + { ARG_ULL_STR(0xffffffffb7f8a000) +# if !XLAT_RAW + " /* FAN_??? */" +# endif + }, }; static const struct strval dirfds[] = { { (kernel_ulong_t) 0xfacefeed00000001ULL, "1" }, - { (kernel_ulong_t) 0xdec0ded0ffffffffULL, "FAN_NOFD" }, - { (kernel_ulong_t) 0xbadfacedffffff9cULL, "AT_FDCWD" }, + { (kernel_ulong_t) 0xdec0ded0ffffffffULL, +# if XLAT_RAW + "-1" +# elif XLAT_VERBOSE + "-1 /* FAN_NOFD */" +# else + "FAN_NOFD" +# endif + }, + { (kernel_ulong_t) 0xbadfacedffffff9cULL, str_at_fdcwd }, { (kernel_ulong_t) 0xdefaced1beeff00dULL, "-1091571699" }, }; static const char str64[] = STR64; @@ -148,8 +208,9 @@ main(void) rc = fanotify_mark(-1, FAN_MARK_ADD, FAN_MODIFY | FAN_ONDIR, -100, "."); - printf("fanotify_mark(-1, FAN_MARK_ADD, FAN_MODIFY|FAN_ONDIR" - ", AT_FDCWD, \".\") = %s\n", sprintrc(rc)); + printf("fanotify_mark(-1, %s, %s, %s, \".\") = %s\n", + str_fan_mark_add, str_fan_modify_ondir, str_at_fdcwd, + sprintrc(rc)); for (i = 0; i < ARRAY_SIZE(fds); i++) { for (j = 0; j < ARRAY_SIZE(flags); j++) { diff --git a/tests-mx32/fanotify_mark.gen.test b/tests-mx32/fanotify_mark.gen.test new file mode 100755 index 00000000..46512608 --- /dev/null +++ b/tests-mx32/fanotify_mark.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fanotify_mark -a32 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 diff --git a/tests-mx32/fanotify_mark.test b/tests-mx32/fanotify_mark.test deleted file mode 100755 index fd671387..00000000 --- a/tests-mx32/fanotify_mark.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of fanotify_mark syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a32 diff --git a/tests-mx32/fchdir.c b/tests-mx32/fchdir.c index 3cde5e63..118e5fea 100644 --- a/tests-mx32/fchdir.c +++ b/tests-mx32/fchdir.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/fchdir.gen.test b/tests-mx32/fchdir.gen.test new file mode 100755 index 00000000..a352a21b --- /dev/null +++ b/tests-mx32/fchdir.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fchdir -a11 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 diff --git a/tests-mx32/fchdir.test b/tests-mx32/fchdir.test deleted file mode 100755 index 3a4296ed..00000000 --- a/tests-mx32/fchdir.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check fchdir syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a11 diff --git a/tests-mx32/fchmod.c b/tests-mx32/fchmod.c index 932d0830..4fa06727 100644 --- a/tests-mx32/fchmod.c +++ b/tests-mx32/fchmod.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Fabien Siron * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/fchmod.gen.test b/tests-mx32/fchmod.gen.test new file mode 100755 index 00000000..828c9b50 --- /dev/null +++ b/tests-mx32/fchmod.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fchmod -a15 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests-mx32/fchmod.test b/tests-mx32/fchmod.test deleted file mode 100755 index 4cb12632..00000000 --- a/tests-mx32/fchmod.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check fchmod syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a15 diff --git a/tests-mx32/fchmodat.c b/tests-mx32/fchmodat.c index c52a1cab..f2fa5dd0 100644 --- a/tests-mx32/fchmodat.c +++ b/tests-mx32/fchmodat.c @@ -1,30 +1,10 @@ /* * Check decoding of fchmodat syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/fchmodat.gen.test b/tests-mx32/fchmodat.gen.test new file mode 100755 index 00000000..36461858 --- /dev/null +++ b/tests-mx32/fchmodat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fchmodat ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/fchmodat.test b/tests-mx32/fchmodat.test deleted file mode 100755 index 13cbe806..00000000 --- a/tests-mx32/fchmodat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of fchmodat syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/fchown.c b/tests-mx32/fchown.c index d7119032..98bfd9de 100644 --- a/tests-mx32/fchown.c +++ b/tests-mx32/fchown.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/fchown.gen.test b/tests-mx32/fchown.gen.test new file mode 100755 index 00000000..ec7f7c54 --- /dev/null +++ b/tests-mx32/fchown.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fchown -a16 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 diff --git a/tests-mx32/fchown.test b/tests-mx32/fchown.test deleted file mode 100755 index 63a0f2e3..00000000 --- a/tests-mx32/fchown.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check fchown syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a16 diff --git a/tests-mx32/fchown32.c b/tests-mx32/fchown32.c index 2d9d60f8..9d52f9a8 100644 --- a/tests-mx32/fchown32.c +++ b/tests-mx32/fchown32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/fchown32.gen.test b/tests-mx32/fchown32.gen.test new file mode 100755 index 00000000..16705832 --- /dev/null +++ b/tests-mx32/fchown32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fchown32 -a18 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests-mx32/fchown32.test b/tests-mx32/fchown32.test deleted file mode 100755 index e837f54e..00000000 --- a/tests-mx32/fchown32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check fchown32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a18 diff --git a/tests-mx32/fchownat.c b/tests-mx32/fchownat.c index f2f37ae3..32167bc7 100644 --- a/tests-mx32/fchownat.c +++ b/tests-mx32/fchownat.c @@ -1,30 +1,10 @@ /* * Check decoding of fchownat syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/fchownat.gen.test b/tests-mx32/fchownat.gen.test new file mode 100755 index 00000000..54bd0430 --- /dev/null +++ b/tests-mx32/fchownat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fchownat ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/fchownat.test b/tests-mx32/fchownat.test deleted file mode 100755 index e5d0f285..00000000 --- a/tests-mx32/fchownat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of fchownat syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/fcntl-common.c b/tests-mx32/fcntl-common.c new file mode 100644 index 00000000..b2125171 --- /dev/null +++ b/tests-mx32/fcntl-common.c @@ -0,0 +1,379 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include +#include +#include +#include +#include +#include +#include "flock.h" + +#define FILE_LEN 4096 + +#define TEST_FLOCK_EINVAL(cmd) test_flock_einval(cmd, #cmd) +#define TEST_FLOCK64_EINVAL(cmd) test_flock64_einval(cmd, #cmd) + +#ifdef HAVE_TYPEOF +# define TYPEOF_FLOCK_OFF_T typeof(((struct_kernel_flock *) NULL)->l_len) +#else +# define TYPEOF_FLOCK_OFF_T off_t +#endif + +static const char *errstr; + +static long +invoke_test_syscall(const unsigned int fd, const unsigned int cmd, void *const p) +{ + const kernel_ulong_t kfd = F8ILL_KULONG_MASK | fd; + const kernel_ulong_t op = F8ILL_KULONG_MASK | cmd; + + long rc = syscall(TEST_SYSCALL_NR, kfd, op, (uintptr_t) p); + errstr = sprintrc(rc); + return rc; +} + +static void +test_flock_einval(const int cmd, const char *name) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct_kernel_flock, fl); + memset(fl, 0, sizeof(*fl)); + fl->l_type = F_RDLCK; + fl->l_start = (TYPEOF_FLOCK_OFF_T) 0xdefaced1facefeedULL; + fl->l_len = (TYPEOF_FLOCK_OFF_T) 0xdefaced2cafef00dULL; + + invoke_test_syscall(0, cmd, fl); + printf("%s(0, %s, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=%jd, l_len=%jd}) = %s\n", TEST_SYSCALL_STR, name, + (intmax_t) fl->l_start, (intmax_t) fl->l_len, errstr); + + void *const bad_addr = (void *) fl + 1; + invoke_test_syscall(0, cmd, bad_addr); + printf("%s(0, %s, %p) = %s\n", + TEST_SYSCALL_STR, name, bad_addr, errstr); +} + +/* + * This function is not declared static to avoid potential + * "defined but not used" warning when included by fcntl.c + */ +void +test_flock64_einval(const int cmd, const char *name) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct_kernel_flock64, fl); + memset(fl, 0, sizeof(*fl)); + fl->l_type = F_RDLCK; + fl->l_start = (TYPEOF_FLOCK_OFF_T) 0xdefaced1facefeedULL; + fl->l_len = (TYPEOF_FLOCK_OFF_T) 0xdefaced2cafef00dULL; + + invoke_test_syscall(0, cmd, fl); + printf("%s(0, %s, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=%jd, l_len=%jd}) = %s\n", TEST_SYSCALL_STR, name, + (intmax_t) fl->l_start, (intmax_t) fl->l_len, errstr); + + void *const bad_addr = (void *) fl + 1; + invoke_test_syscall(0, cmd, bad_addr); + printf("%s(0, %s, %p) = %s\n", + TEST_SYSCALL_STR, name, bad_addr, errstr); +} + +static void +test_flock(void) +{ + TEST_FLOCK_EINVAL(F_SETLK); + TEST_FLOCK_EINVAL(F_SETLKW); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct_kernel_flock, fl); + memset(fl, 0, sizeof(*fl)); + fl->l_type = F_RDLCK; + fl->l_len = FILE_LEN; + + long rc = invoke_test_syscall(0, F_SETLK, fl); + printf("%s(0, F_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = %s\n", + TEST_SYSCALL_STR, FILE_LEN, errstr); + if (rc) + return; + + invoke_test_syscall(0, F_GETLK, fl); + printf("%s(0, F_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d, l_pid=0}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); + + invoke_test_syscall(0, F_SETLKW, fl); + printf("%s(0, F_SETLKW, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); +} + +static void +test_flock64_ofd(void) +{ +#if defined F_OFD_GETLK && defined F_OFD_SETLK && defined F_OFD_SETLKW + TEST_FLOCK64_EINVAL(F_OFD_SETLK); + TEST_FLOCK64_EINVAL(F_OFD_SETLKW); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct_kernel_flock64, fl); + memset(fl, 0, sizeof(*fl)); + fl->l_type = F_RDLCK; + fl->l_len = FILE_LEN; + + long rc = invoke_test_syscall(0, F_OFD_SETLK, fl); + printf("%s(0, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = %s\n", + TEST_SYSCALL_STR, FILE_LEN, errstr); + if (rc) + return; + + invoke_test_syscall(0, F_OFD_GETLK, fl); + printf("%s(0, F_OFD_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d, l_pid=0}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); + + invoke_test_syscall(0, F_OFD_SETLKW, fl); + printf("%s(0, F_OFD_SETLKW, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); +#endif /* F_OFD_GETLK && F_OFD_SETLK && F_OFD_SETLKW */ +} + +static void test_flock64_lk64(void); + +static void +test_flock64(void) +{ + test_flock64_ofd(); + test_flock64_lk64(); +} + +/* + * F_[GS]ETOWN_EX had conflicting values with F_[SG]ETLK64 + * in kernel revisions v2.6.32-rc1~96..v2.6.32-rc7~23. + */ +#undef TEST_F_OWNER_EX +#if defined F_GETOWN_EX && defined F_SETOWN_EX \ + && (F_GETOWN_EX != F_SETLK64) && (F_SETOWN_EX != F_GETLK64) +# define TEST_F_OWNER_EX +#endif + +#ifdef TEST_F_OWNER_EX +# include "f_owner_ex.h" + +static long +test_f_owner_ex_type_pid(const int cmd, const char *const cmd_name, + const int type, const char *const type_name, + pid_t pid) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct_kernel_f_owner_ex, fo); + + fo->type = type; + fo->pid = pid; + long rc = invoke_test_syscall(0, cmd, fo); + printf("%s(0, %s, {type=%s, pid=%d}) = %s\n", + TEST_SYSCALL_STR, cmd_name, type_name, fo->pid, errstr); + + void *bad_addr = (void *) fo + 1; + invoke_test_syscall(0, cmd, bad_addr); + printf("%s(0, %s, %p) = %s\n", + TEST_SYSCALL_STR, cmd_name, bad_addr, errstr); + + return rc; +} + +static void +test_f_owner_ex_umove_or_printaddr(const int type, const char *const type_name, + pid_t pid) +{ + long rc = test_f_owner_ex_type_pid(ARG_STR(F_SETOWN_EX), + type, type_name, pid); + if (!rc) + test_f_owner_ex_type_pid(ARG_STR(F_GETOWN_EX), + type, type_name, pid); +} + +static void +test_f_owner_ex(void) +{ + static const struct { + int type; + const char *type_name; + pid_t pid[2]; + } a[] = { + { ARG_STR(F_OWNER_TID), { 1234567890, 20 } }, + { ARG_STR(F_OWNER_PID), { 1298126790, 30 } }, + { ARG_STR(F_OWNER_PGRP), { 1294567890, 40 } } + }; + + for (unsigned int i = 0; i < ARRAY_SIZE(a); i++) { + for (unsigned int j = 0; j < ARRAY_SIZE(a[0].pid); j++) { + test_f_owner_ex_umove_or_printaddr(a[i].type, + a[i].type_name, + a[i].pid[j]); + } + } +} +#endif /* TEST_F_OWNER_EX */ + +struct fcntl_cmd_check { + int fd; + int cmd; + const char *cmd_str; + long arg; + const char *arg_str; + void (*print_flags)(long rc); +}; + +static void +print_retval_flags(const struct fcntl_cmd_check *check, long rc) +{ + if (check->print_flags) { + check->print_flags(rc); + } else { + printf("%s", errstr); + } + printf("\n"); +} + +static void +test_other_set_cmd(const struct fcntl_cmd_check *check) +{ + invoke_test_syscall(check->fd, check->cmd, (void *) check->arg); + printf("%s(%d, %s, %s) = %s\n", + TEST_SYSCALL_STR, check->fd, + check->cmd_str, check->arg_str, errstr); + + /* bad file fd */ + invoke_test_syscall(-1, check->cmd, (void *) check->arg); + printf("%s(-1, %s, %s) = %s\n", + TEST_SYSCALL_STR, check->cmd_str, + check->arg_str, errstr); +} + +static void +test_other_get_cmd(const struct fcntl_cmd_check *check) +{ + long rc = invoke_test_syscall(check->fd, check->cmd, NULL); + printf("%s(%d, %s) = ", + TEST_SYSCALL_STR, check->fd, check->cmd_str); + print_retval_flags(check, rc); + + /* bad file fd */ + invoke_test_syscall(-1, check->cmd, NULL); + printf("%s(-1, %s) = %s\n", + TEST_SYSCALL_STR, check->cmd_str, errstr); +} + +static void +print_flags_getfd(long rc) +{ + assert(rc >= 0); + printf("%#lx%s", rc, rc & 1 ? " (flags FD_CLOEXEC)" : ""); +} + +static void +print_flags_getsig(long rc) +{ + assert(rc >= 0); + + if (!rc) { + printf("%ld", rc); + } else { + printf("%ld (%s)", rc, signal2name((int) rc)); + } +} + +static void +print_flags_getlease(long rc) +{ + assert(rc >= 0); + const char *text; + + switch (rc) { + case F_RDLCK: + text = "F_RDLCK"; + break; + case F_WRLCK: + text = "F_WRLCK"; + break; + case F_UNLCK: + text = "F_UNLCK"; + break; + default: + error_msg_and_fail("fcntl returned %#lx, does the" + " test have to be updated?", rc); + } + printf("%#lx (%s)", rc, text); +} + +static void +test_fcntl_others(void) +{ + static const struct fcntl_cmd_check set_checks[] = { + { 0, ARG_STR(F_SETFD), ARG_STR(FD_CLOEXEC) }, + { 0, ARG_STR(F_SETOWN), ARG_STR(20) }, +#ifdef F_SETPIPE_SZ + { 0, ARG_STR(F_SETPIPE_SZ), ARG_STR(4097) }, +#endif + { 0, ARG_STR(F_DUPFD), ARG_STR(0) }, +#ifdef F_DUPFD_CLOEXEC + { 0, ARG_STR(F_DUPFD_CLOEXEC), ARG_STR(0) }, +#endif + { 0, ARG_STR(F_SETFL), ARG_STR(O_RDWR|O_LARGEFILE) }, + { 0, ARG_STR(F_NOTIFY), ARG_STR(DN_ACCESS) }, + { 1, ARG_STR(F_SETLEASE), ARG_STR(F_RDLCK) }, + { 0, ARG_STR(F_SETSIG), 0, "0" }, + { 1, ARG_STR(F_SETSIG), 1, "SIGHUP" } + }; + for (unsigned int i = 0; i < ARRAY_SIZE(set_checks); i++) { + test_other_set_cmd(set_checks + i); + } + + static const struct fcntl_cmd_check get_checks[] = { + { 0, ARG_STR(F_GETFD), .print_flags = print_flags_getfd }, + { 1, ARG_STR(F_GETFD), .print_flags = print_flags_getfd }, + { 0, ARG_STR(F_GETOWN) }, +#ifdef F_GETPIPE_SZ + { 0, ARG_STR(F_GETPIPE_SZ) }, +#endif + { 1, ARG_STR(F_GETLEASE), .print_flags = print_flags_getlease }, + { 0, ARG_STR(F_GETSIG), .print_flags = print_flags_getsig }, + { 1, ARG_STR(F_GETSIG), .print_flags = print_flags_getsig } + }; + for (unsigned int j = 0; j < ARRAY_SIZE(get_checks); j++) { + test_other_get_cmd(get_checks + j); + } +} + +static void +create_sample(void) +{ + char fname[] = TEST_SYSCALL_STR "_XXXXXX"; + + (void) close(0); + if (mkstemp(fname)) + perror_msg_and_fail("mkstemp: %s", fname); + if (unlink(fname)) + perror_msg_and_fail("unlink: %s", fname); + if (ftruncate(0, FILE_LEN)) + perror_msg_and_fail("ftruncate"); +} + +int +main(void) +{ + create_sample(); + test_flock(); + test_flock64(); +#ifdef TEST_F_OWNER_EX + test_f_owner_ex(); +#endif + test_fcntl_others(); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/fcntl.c b/tests-mx32/fcntl.c index f060cdf8..bd9ffbdd 100644 --- a/tests-mx32/fcntl.c +++ b/tests-mx32/fcntl.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,51 +13,40 @@ # define TEST_SYSCALL_NR __NR_fcntl # define TEST_SYSCALL_STR "fcntl" -# include "struct_flock.c" - -# define TEST_FLOCK64_EINVAL(cmd) test_flock64_einval(cmd, #cmd) +# include "fcntl-common.c" static void -test_flock64_einval(const int cmd, const char *name) +test_flock64_undecoded(const int cmd, const char *name) { struct_kernel_flock64 fl = { .l_type = F_RDLCK, .l_start = 0xdefaced1facefeedULL, .l_len = 0xdefaced2cafef00dULL }; - invoke_test_syscall(cmd, &fl); + invoke_test_syscall(0, cmd, &fl); printf("%s(0, %s, %p) = %s\n", - TEST_SYSCALL_STR, name, &fl, EINVAL_STR); + TEST_SYSCALL_STR, name, &fl, errstr); } +# define TEST_FLOCK64_UNDECODED(cmd) test_flock64_undecoded(cmd, #cmd) + static void -test_flock64(void) +test_flock64_lk64(void) { /* * F_[GS]ETOWN_EX had conflicting values with F_[GS]ETLK64 * in kernel revisions v2.6.32-rc1~96..v2.6.32-rc7~23. */ -#if !defined(F_GETOWN_EX) || F_GETOWN_EX != F_SETLK64 - TEST_FLOCK64_EINVAL(F_SETLK64); -#endif +# if !defined(F_GETOWN_EX) || F_GETOWN_EX != F_SETLK64 + TEST_FLOCK64_UNDECODED(F_SETLK64); +# endif /* F_GETLK and F_SETLKW64 have conflicting values on mips64 */ -#if !defined(__mips64) || F_GETLK != F_SETLKW64 - TEST_FLOCK64_EINVAL(F_SETLKW64); -#endif -#if !defined(F_SETOWN_EX) || F_SETOWN_EX != F_GETLK64 - TEST_FLOCK64_EINVAL(F_GETLK64); -#endif -} - -int -main(void) -{ - create_sample(); - test_flock(); - test_flock64(); - - puts("+++ exited with 0 +++"); - return 0; +# if !defined(__mips64) || F_GETLK != F_SETLKW64 + TEST_FLOCK64_UNDECODED(F_SETLKW64); +# endif +# if !defined(F_SETOWN_EX) || F_SETOWN_EX != F_GETLK64 + TEST_FLOCK64_UNDECODED(F_GETLK64); +# endif } #else diff --git a/tests-mx32/fcntl.gen.test b/tests-mx32/fcntl.gen.test new file mode 100755 index 00000000..9de26c00 --- /dev/null +++ b/tests-mx32/fcntl.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fcntl -a8 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 diff --git a/tests-mx32/fcntl.test b/tests-mx32/fcntl.test deleted file mode 100755 index 9aea122d..00000000 --- a/tests-mx32/fcntl.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check fcntl decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a8 diff --git a/tests-mx32/fcntl64.c b/tests-mx32/fcntl64.c index 5ecd6eb9..97277b2f 100644 --- a/tests-mx32/fcntl64.c +++ b/tests-mx32/fcntl64.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,68 +13,38 @@ # define TEST_SYSCALL_NR __NR_fcntl64 # define TEST_SYSCALL_STR "fcntl64" -# include "struct_flock.c" - -# define TEST_FLOCK64_EINVAL(cmd) test_flock64_einval(cmd, #cmd) - -static void -test_flock64_einval(const int cmd, const char *name) -{ - struct_kernel_flock64 fl = { - .l_type = F_RDLCK, - .l_start = 0xdefaced1facefeedULL, - .l_len = 0xdefaced2cafef00dULL - }; - invoke_test_syscall(cmd, &fl); - printf("%s(0, %s, {l_type=F_RDLCK, l_whence=SEEK_SET" - ", l_start=%jd, l_len=%jd}) = %s\n", TEST_SYSCALL_STR, name, - (intmax_t) fl.l_start, (intmax_t) fl.l_len, EINVAL_STR); -} +# include "fcntl-common.c" static void -test_flock64(void) +test_flock64_lk64(void) { TEST_FLOCK64_EINVAL(F_SETLK64); TEST_FLOCK64_EINVAL(F_SETLKW64); -# ifdef F_OFD_SETLK - TEST_FLOCK64_EINVAL(F_OFD_SETLK); - TEST_FLOCK64_EINVAL(F_OFD_SETLKW); -# endif - struct_kernel_flock64 fl = { - .l_type = F_RDLCK, - .l_len = FILE_LEN - }; - long rc = invoke_test_syscall(F_SETLK64, &fl); + TAIL_ALLOC_OBJECT_CONST_PTR(struct_kernel_flock64, fl); + memset(fl, 0, sizeof(*fl)); + fl->l_type = F_RDLCK; + fl->l_len = FILE_LEN; + + long rc = invoke_test_syscall(0, F_SETLK64, fl); printf("%s(0, F_SETLK64, {l_type=F_RDLCK, l_whence=SEEK_SET" ", l_start=0, l_len=%d}) = %s\n", - TEST_SYSCALL_STR, FILE_LEN, rc ? EINVAL_STR : "0"); + TEST_SYSCALL_STR, FILE_LEN, errstr); if (rc) return; - invoke_test_syscall(F_GETLK64, &fl); + invoke_test_syscall(0, F_GETLK64, fl); printf("%s(0, F_GETLK64, {l_type=F_UNLCK, l_whence=SEEK_SET" ", l_start=0, l_len=%d, l_pid=0}) = 0\n", TEST_SYSCALL_STR, FILE_LEN); - invoke_test_syscall(F_SETLK64, &fl); - printf("%s(0, F_SETLK64, {l_type=F_UNLCK, l_whence=SEEK_SET" + invoke_test_syscall(0, F_SETLKW64, fl); + printf("%s(0, F_SETLKW64, {l_type=F_UNLCK, l_whence=SEEK_SET" ", l_start=0, l_len=%d}) = 0\n", TEST_SYSCALL_STR, FILE_LEN); } -int -main(void) -{ - create_sample(); - test_flock(); - test_flock64(); - - puts("+++ exited with 0 +++"); - return 0; -} - #else SKIP_MAIN_UNDEFINED("__NR_fcntl64") diff --git a/tests-mx32/fcntl64.gen.test b/tests-mx32/fcntl64.gen.test new file mode 100755 index 00000000..fee01b66 --- /dev/null +++ b/tests-mx32/fcntl64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fcntl64 -a8 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 diff --git a/tests-mx32/fcntl64.test b/tests-mx32/fcntl64.test deleted file mode 100755 index 00ba671a..00000000 --- a/tests-mx32/fcntl64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check fcntl64 syscall decoding. - -. "${srcdir=.}/fcntl.test" diff --git a/tests-mx32/fdatasync.c b/tests-mx32/fdatasync.c index fc82ade3..f4c8d55f 100644 --- a/tests-mx32/fdatasync.c +++ b/tests-mx32/fdatasync.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/fdatasync.gen.test b/tests-mx32/fdatasync.gen.test new file mode 100755 index 00000000..9aa5f2a6 --- /dev/null +++ b/tests-mx32/fdatasync.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fdatasync -a14 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests-mx32/fdatasync.test b/tests-mx32/fdatasync.test deleted file mode 100755 index ff59749f..00000000 --- a/tests-mx32/fdatasync.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check fdatasync syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a14 diff --git a/tests-mx32/fflush.c b/tests-mx32/fflush.c new file mode 100644 index 00000000..e14ee195 --- /dev/null +++ b/tests-mx32/fflush.c @@ -0,0 +1,22 @@ +/* + * Check fflush error diagnostics. + * + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include + +int +main(void) +{ + errno = ENOSPC; + printf("%s: /dev/full: %m\n", getenv("STRACE_EXE") ?: "strace"); + return 0; +} diff --git a/tests-mx32/fflush.test b/tests-mx32/fflush.test new file mode 100755 index 00000000..b0186497 --- /dev/null +++ b/tests-mx32/fflush.test @@ -0,0 +1,21 @@ +#!/bin/sh -efu +# +# Check fflush error diagnostics. +# +# Copyright (c) 2011-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +args="-o /dev/full -e trace=none $args" + +$STRACE $args > "$EXP" 2> "$LOG" || { + msg="$STRACE $args failed with code $?" + cat "$LOG" >&2 + fail_ "$msg" +} + +match_diff "$LOG" "$EXP" diff --git a/tests-mx32/file_handle.c b/tests-mx32/file_handle.c index a5ad6c73..38cd5af8 100644 --- a/tests-mx32/file_handle.c +++ b/tests-mx32/file_handle.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -38,7 +19,6 @@ # include # include # include -# include # include enum assert_rc { @@ -157,8 +137,8 @@ struct strval { const char *str; }; -#define STR16 "0123456789abcdef" -#define STR64 STR16 STR16 STR16 STR16 +# define STR16 "0123456789abcdef" +# define STR64 STR16 STR16 STR16 STR16 int main(void) @@ -187,7 +167,7 @@ main(void) (kernel_ulong_t) 0x12345678ffffff9cULL, }; static const struct strval open_flags[] = { - { (kernel_ulong_t) 0xffffffff00000000ULL, "O_RDONLY" }, + { F8ILL_KULONG_MASK, "O_RDONLY" }, { (kernel_ulong_t) 0xdeadbeef80000001ULL, "O_WRONLY|0x80000000" } }; @@ -208,7 +188,7 @@ main(void) tail_alloc(sizeof(struct file_handle) + 128); struct file_handle *handle_256 = tail_alloc(sizeof(struct file_handle) + 256); - int *bogus_mount_id = tail_alloc(sizeof(*bogus_mount_id)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, bogus_mount_id); char handle_0_addr[sizeof("0x") + sizeof(void *) * 2]; diff --git a/tests-mx32/file_handle.gen.test b/tests-mx32/file_handle.gen.test new file mode 100755 index 00000000..8280f9f4 --- /dev/null +++ b/tests-mx32/file_handle.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (file_handle -e trace=name_to_handle_at,open_by_handle_at); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=name_to_handle_at,open_by_handle_at diff --git a/tests-mx32/file_handle.test b/tests-mx32/file_handle.test deleted file mode 100755 index 1ccc9d45..00000000 --- a/tests-mx32/file_handle.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check name_to_handle_at and open_by_handle_at syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=name_to_handle_at,open_by_handle_at diff --git a/tests-mx32/file_ioctl.c b/tests-mx32/file_ioctl.c index 0fe17b15..7a2a905c 100644 --- a/tests-mx32/file_ioctl.c +++ b/tests-mx32/file_ioctl.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #ifdef HAVE_LINUX_FIEMAP_H @@ -13,7 +20,7 @@ static void test_fiemap(void) { (void) tail_alloc(1); - struct fiemap *const args = tail_alloc(sizeof(*args)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct fiemap, args); printf("ioctl(-1, FS_IOC_FIEMAP, {fm_start=%" PRI__u64 ", fm_length=%" PRI__u64", fm_flags=", diff --git a/tests-mx32/file_ioctl.gen.test b/tests-mx32/file_ioctl.gen.test new file mode 100755 index 00000000..0abab81a --- /dev/null +++ b/tests-mx32/file_ioctl.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (file_ioctl +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/file_ioctl.test b/tests-mx32/file_ioctl.test deleted file mode 100755 index 7b8b8ce8..00000000 --- a/tests-mx32/file_ioctl.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check FS_IOC_FIEMAP ioctl decoding. - -. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/fill_memory.c b/tests-mx32/fill_memory.c index a0aeccba..3e09d597 100644 --- a/tests-mx32/fill_memory.c +++ b/tests-mx32/fill_memory.c @@ -1,8 +1,15 @@ +/* + * Copyright (c) 2016-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" void fill_memory_ex(void *ptr, size_t size, unsigned char start, - unsigned char period) + unsigned int period) { unsigned char *p = ptr; size_t i; diff --git a/tests-mx32/filter-unavailable.c b/tests-mx32/filter-unavailable.c index 6368b2cb..de920753 100644 --- a/tests-mx32/filter-unavailable.c +++ b/tests-mx32/filter-unavailable.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/filter-unavailable.test b/tests-mx32/filter-unavailable.test index 15a9ad1d..8e7e67ee 100755 --- a/tests-mx32/filter-unavailable.test +++ b/tests-mx32/filter-unavailable.test @@ -1,6 +1,11 @@ #!/bin/sh - -# check that syscalls are filtered properly +# +# Check that syscalls are filtered properly. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests-mx32/filtering_fd-syntax.test b/tests-mx32/filtering_fd-syntax.test new file mode 100755 index 00000000..53bf1b1c --- /dev/null +++ b/tests-mx32/filtering_fd-syntax.test @@ -0,0 +1,40 @@ +#!/bin/sh +# +# Check descriptor set parsing syntax. +# +# Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/syntax.sh" + +check_fd_qualify() +{ + check_e "invalid descriptor '$1'" -e"read=$2" + check_e "invalid descriptor '$1'" -e "read=$2" + check_e "invalid descriptor '$1'" -e"write=$2" + check_e "invalid descriptor '$1'" -e "write=$2" +} + +for arg in '' , ,, ,,, ; do + check_fd_qualify "$arg" "$arg" + check_fd_qualify "!$arg" "!$arg" +done + +for arg in -1 -42 \ + not_fd \ + 2147483648 \ + 4294967296 \ + ; do + check_fd_qualify "$arg" "$arg" + check_fd_qualify "$arg" "1,$arg" + check_fd_qualify "$arg" "$arg,1" + check_fd_qualify "$arg" "!$arg" +done + +for arg in ! all none; do + check_fd_qualify "$arg" "1,$arg" + check_fd_qualify "!$arg" "1,!$arg" +done diff --git a/tests-mx32/filtering_syscall-syntax.test b/tests-mx32/filtering_syscall-syntax.test new file mode 100755 index 00000000..fe42edbe --- /dev/null +++ b/tests-mx32/filtering_syscall-syntax.test @@ -0,0 +1,101 @@ +#!/bin/sh +# +# Check syscall set parsing syntax. +# +# Copyright (c) 2016-2018 Dmitry V. Levin +# Copyright (c) 2017 Nikolay Marchuk +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/syntax.sh" + +check_syscall() +{ + [ -z "$2" ] || check_e "invalid system call '$1'" -e"$2" + + check_e "invalid system call '$1'" -e "$2" + check_e "invalid system call '$1'" -etrace="$2" + check_e "invalid system call '$1'" -e trace="$2" + + check_e "invalid system call '$1'" -eabbrev="$2" + check_e "invalid system call '$1'" -e abbrev="$2" + + check_e "invalid system call '$1'" -everbose="$2" + check_e "invalid system call '$1'" -e verbose="$2" + + check_e "invalid system call '$1'" -eraw="$2" + check_e "invalid system call '$1'" -e raw="$2" + + check_e "invalid system call '$1'" -einject="$2" + check_e "invalid system call '$1'" -e inject="$2" + check_e "invalid system call '$1'" -einject="$2:" + check_e "invalid system call '$1'" -einject="$2::" + check_e "invalid system call '$1'" -einject="$2:::" + check_e "invalid system call '$1'" -e inject="$2:" + check_e "invalid system call '$1'" -e inject="$2::" + check_e "invalid system call '$1'" -e inject="$2:::" + check_e "invalid system call '$1'" -einject="$2:when=3" + check_e "invalid system call '$1'" -e inject="$2:when=3" + + check_e "invalid system call '$1'" -efault="$2" + check_e "invalid system call '$1'" -e fault="$2" + check_e "invalid system call '$1'" -efault="$2:" + check_e "invalid system call '$1'" -efault="$2::" + check_e "invalid system call '$1'" -efault="$2:::" + check_e "invalid system call '$1'" -e fault="$2:" + check_e "invalid system call '$1'" -e fault="$2::" + check_e "invalid system call '$1'" -e fault="$2:::" + check_e "invalid system call '$1'" -efault="$2:when=4" + check_e "invalid system call '$1'" -e fault="$2:when=4" +} + +for arg in '' , ,, ,,, ; do + check_syscall "$arg" "$arg" + check_syscall "!$arg" "!$arg" +done + +for arg in -1 -2 -3 -4 -5 \ + invalid_syscall_name \ + 0x 0y \ + 32767 \ + 2147483647 \ + 2147483648 \ + 4294967295 \ + 4294967296 \ + /non_syscall \ + % %not_a_class \ + ; do + check_syscall "$arg" "$arg" + check_syscall "$arg" "!$arg" + check_syscall "$arg" "1,$arg" +done + +for arg in '!chdir' none all; do + check_syscall "$arg" "1,$arg" +done + +# invalid syscall, multiple syscalls +for arg in %desc \ + %file \ + %memory \ + %process \ + %network \ + chdir \ + 1 \ + ?32767 \ + ?invalid \ + ?%not_a_class \ + ?/non_syscall \ + ; do + check_syscall nonsense "$arg,nonsense" + check_syscall nonsense "!$arg,nonsense" + check_syscall nonsense "nonsense,$arg" + check_syscall nonsense "!nonsense,$arg" +done + +check_e_using_grep 'regcomp: \+id: [[:alpha:]].+' -e trace='/+id' +check_e_using_grep 'regcomp: \*id: [[:alpha:]].+' -e trace='/*id' +check_e_using_grep 'regcomp: \{id: [[:alpha:]].+' -e trace='/{id' +check_e_using_grep 'regcomp: \(id: [[:alpha:]].+' -e trace='/(id' +check_e_using_grep 'regcomp: \[id: [[:alpha:]].+' -e trace='/[id' diff --git a/tests-mx32/finit_module.c b/tests-mx32/finit_module.c index 3f0178f7..64e6df02 100644 --- a/tests-mx32/finit_module.c +++ b/tests-mx32/finit_module.c @@ -2,29 +2,10 @@ * Check decoding of finit_module syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -68,7 +49,8 @@ main(void) fill_memory_ex(bogus_param1, PARAM1_LEN, PARAM1_BASE, PARAM1_LEN); fill_memory_ex(bogus_param2, PARAM2_LEN, PARAM2_BASE, PARAM2_LEN); - rc = syscall(__NR_finit_module, bogus_zero, NULL, bogus_zero); + rc = syscall(__NR_finit_module, F8ILL_KULONG_MASK, NULL, + F8ILL_KULONG_MASK); printf("finit_module(0, NULL, 0) = %s\n", sprintrc(rc)); rc = syscall(__NR_finit_module, bogus_fd, bogus_param1, flags[0].val); diff --git a/tests-mx32/finit_module.gen.test b/tests-mx32/finit_module.gen.test new file mode 100755 index 00000000..5ffafd32 --- /dev/null +++ b/tests-mx32/finit_module.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (finit_module -a25 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests-mx32/finit_module.test b/tests-mx32/finit_module.test deleted file mode 100755 index bd644f38..00000000 --- a/tests-mx32/finit_module.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of finit_module syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a25 diff --git a/tests-mx32/first_exec_failure.test b/tests-mx32/first_exec_failure.test new file mode 100755 index 00000000..175b084b --- /dev/null +++ b/tests-mx32/first_exec_failure.test @@ -0,0 +1,30 @@ +#!/bin/sh +# +# Check error diagnostics when the first exec fails. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +$STRACE / 2> "$LOG" && + dump_log_and_fail_with \ + "$STRACE / failed to handle the error properly" + +check_prog head +check_prog tail + +head -n1 < "$LOG" > "$OUT" +cat > "$EXP" <<__EOF__ +execve\("/", \["/"\], 0x[[:xdigit:]]+ /\* [[:digit:]]+ vars \*/\) += -1 EACCES \(Permission denied\) +__EOF__ +match_grep "$OUT" "$EXP" + +tail -n +2 < "$LOG" > "$OUT" +cat > "$EXP" <<__EOF__ +$STRACE_EXE: exec: Permission denied ++++ exited with 1 +++ +__EOF__ +match_diff "$OUT" "$EXP" diff --git a/tests-mx32/flock.c b/tests-mx32/flock.c index c154e437..4f044409 100644 --- a/tests-mx32/flock.c +++ b/tests-mx32/flock.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/flock.gen.test b/tests-mx32/flock.gen.test new file mode 100755 index 00000000..67a9d8c6 --- /dev/null +++ b/tests-mx32/flock.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (flock -a19 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests-mx32/flock.test b/tests-mx32/flock.test deleted file mode 100755 index 24fcd74c..00000000 --- a/tests-mx32/flock.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check flock syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a19 diff --git a/tests-mx32/fork-f.c b/tests-mx32/fork-f.c index 11ac3d97..0e71c500 100644 --- a/tests-mx32/fork-f.c +++ b/tests-mx32/fork-f.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/fork-f.gen.test b/tests-mx32/fork-f.gen.test new file mode 100755 index 00000000..b534e13a --- /dev/null +++ b/tests-mx32/fork-f.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fork-f -a26 -qq -f -e signal=none -e trace=chdir); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a26 -qq -f -e signal=none -e trace=chdir diff --git a/tests-mx32/fork-f.test b/tests-mx32/fork-f.test deleted file mode 100755 index d8ca1e3b..00000000 --- a/tests-mx32/fork-f.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check how strace -f follows fork syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a26 -qq -f -e trace=chdir -e signal=none diff --git a/tests-mx32/fstat-Xabbrev.c b/tests-mx32/fstat-Xabbrev.c new file mode 100644 index 00000000..3fb61e09 --- /dev/null +++ b/tests-mx32/fstat-Xabbrev.c @@ -0,0 +1 @@ +#include "fstat.c" diff --git a/tests-mx32/fstat-Xabbrev.gen.test b/tests-mx32/fstat-Xabbrev.gen.test new file mode 100755 index 00000000..827d5940 --- /dev/null +++ b/tests-mx32/fstat-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat-Xabbrev -a15 -v -Xabbrev -P stat.sample -e trace=fstat); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 -v -Xabbrev -P stat.sample -e trace=fstat diff --git a/tests-mx32/fstat-Xraw.c b/tests-mx32/fstat-Xraw.c new file mode 100644 index 00000000..04284612 --- /dev/null +++ b/tests-mx32/fstat-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "fstat.c" diff --git a/tests-mx32/fstat-Xraw.gen.test b/tests-mx32/fstat-Xraw.gen.test new file mode 100755 index 00000000..99fdc908 --- /dev/null +++ b/tests-mx32/fstat-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat-Xraw -a15 -v -Xraw -P stat.sample -e trace=fstat); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 -v -Xraw -P stat.sample -e trace=fstat diff --git a/tests-mx32/fstat-Xverbose.c b/tests-mx32/fstat-Xverbose.c new file mode 100644 index 00000000..e2b20427 --- /dev/null +++ b/tests-mx32/fstat-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "fstat.c" diff --git a/tests-mx32/fstat-Xverbose.gen.test b/tests-mx32/fstat-Xverbose.gen.test new file mode 100755 index 00000000..9a7ef89f --- /dev/null +++ b/tests-mx32/fstat-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat-Xverbose -a15 -v -Xverbose -P stat.sample -e trace=fstat); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 -v -Xverbose -P stat.sample -e trace=fstat diff --git a/tests-mx32/fstat.c b/tests-mx32/fstat.c index 12df3e19..7a52e0cc 100644 --- a/tests-mx32/fstat.c +++ b/tests-mx32/fstat.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/fstat.gen.test b/tests-mx32/fstat.gen.test new file mode 100755 index 00000000..8686ec80 --- /dev/null +++ b/tests-mx32/fstat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat -a15 -v -P stat.sample); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 -v -P stat.sample diff --git a/tests-mx32/fstat.test b/tests-mx32/fstat.test deleted file mode 100755 index 2ba0fbaa..00000000 --- a/tests-mx32/fstat.test +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -# Check fstat syscall decoding. - -. "${srcdir=.}/init.sh" - -# strace -P is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - -syscall=$NAME -run_prog > /dev/null -sample=$syscall.sample -> "$sample" -run_strace -ve$syscall -P$sample -a21 $args > "$OUT" -match_diff "$LOG" "$OUT" -rm -f "$OUT" - -exit 0 diff --git a/tests-mx32/fstat64-Xabbrev.c b/tests-mx32/fstat64-Xabbrev.c new file mode 100644 index 00000000..dc44b3d9 --- /dev/null +++ b/tests-mx32/fstat64-Xabbrev.c @@ -0,0 +1 @@ +#include "fstat64.c" diff --git a/tests-mx32/fstat64-Xabbrev.gen.test b/tests-mx32/fstat64-Xabbrev.gen.test new file mode 100755 index 00000000..21b601f8 --- /dev/null +++ b/tests-mx32/fstat64-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat64-Xabbrev -a17 -Xabbrev -v -P stat.sample -e trace=fstat64); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 -Xabbrev -v -P stat.sample -e trace=fstat64 diff --git a/tests-mx32/fstat64-Xraw.c b/tests-mx32/fstat64-Xraw.c new file mode 100644 index 00000000..f8930d72 --- /dev/null +++ b/tests-mx32/fstat64-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "fstat64.c" diff --git a/tests-mx32/fstat64-Xraw.gen.test b/tests-mx32/fstat64-Xraw.gen.test new file mode 100755 index 00000000..a31dd848 --- /dev/null +++ b/tests-mx32/fstat64-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat64-Xraw -a17 -Xraw -v -P stat.sample -e trace=fstat64); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 -Xraw -v -P stat.sample -e trace=fstat64 diff --git a/tests-mx32/fstat64-Xverbose.c b/tests-mx32/fstat64-Xverbose.c new file mode 100644 index 00000000..61e33aef --- /dev/null +++ b/tests-mx32/fstat64-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "fstat64.c" diff --git a/tests-mx32/fstat64-Xverbose.gen.test b/tests-mx32/fstat64-Xverbose.gen.test new file mode 100755 index 00000000..8b789e49 --- /dev/null +++ b/tests-mx32/fstat64-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat64-Xverbose -a17 -Xverbose -v -P stat.sample -e trace=fstat64); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 -Xverbose -v -P stat.sample -e trace=fstat64 diff --git a/tests-mx32/fstat64.c b/tests-mx32/fstat64.c index a9c2e072..5d30ca41 100644 --- a/tests-mx32/fstat64.c +++ b/tests-mx32/fstat64.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/fstat64.gen.test b/tests-mx32/fstat64.gen.test new file mode 100755 index 00000000..a452b845 --- /dev/null +++ b/tests-mx32/fstat64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat64 -a17 -v -P stat.sample); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 -v -P stat.sample diff --git a/tests-mx32/fstat64.test b/tests-mx32/fstat64.test deleted file mode 100755 index 8b4f5ef1..00000000 --- a/tests-mx32/fstat64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check fstat64 syscall decoding. - -. "${srcdir=.}/fstat.test" diff --git a/tests-mx32/fstatat.c b/tests-mx32/fstatat.c index 66138c25..fde507c3 100644 --- a/tests-mx32/fstatat.c +++ b/tests-mx32/fstatat.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifdef HAVE_FSTATAT diff --git a/tests-mx32/fstatat64.c b/tests-mx32/fstatat64.c index 03082a8f..949463c9 100644 --- a/tests-mx32/fstatat64.c +++ b/tests-mx32/fstatat64.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/fstatat64.gen.test b/tests-mx32/fstatat64.gen.test new file mode 100755 index 00000000..8da5c7f2 --- /dev/null +++ b/tests-mx32/fstatat64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstatat64 -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests-mx32/fstatat64.test b/tests-mx32/fstatat64.test deleted file mode 100755 index 484008ac..00000000 --- a/tests-mx32/fstatat64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check fstatat64 syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests-mx32/fstatfs.c b/tests-mx32/fstatfs.c index 9e68c8d3..f1609405 100644 --- a/tests-mx32/fstatfs.c +++ b/tests-mx32/fstatfs.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/fstatfs.gen.test b/tests-mx32/fstatfs.gen.test new file mode 100755 index 00000000..27deaf34 --- /dev/null +++ b/tests-mx32/fstatfs.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstatfs -a18 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests-mx32/fstatfs.test b/tests-mx32/fstatfs.test deleted file mode 100755 index 646e66f2..00000000 --- a/tests-mx32/fstatfs.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check fstatfs syscall decoding. - -. "${srcdir=.}/statfs.test" diff --git a/tests-mx32/fstatfs64.c b/tests-mx32/fstatfs64.c index afc54aa9..14da042a 100644 --- a/tests-mx32/fstatfs64.c +++ b/tests-mx32/fstatfs64.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/fstatfs64.gen.test b/tests-mx32/fstatfs64.gen.test new file mode 100755 index 00000000..d6937269 --- /dev/null +++ b/tests-mx32/fstatfs64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstatfs64 -a24 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-mx32/fstatfs64.test b/tests-mx32/fstatfs64.test deleted file mode 100755 index 179ff1bf..00000000 --- a/tests-mx32/fstatfs64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check fstatfs64 syscall decoding. - -. "${srcdir=.}/statfs.test" diff --git a/tests-mx32/fstatx.c b/tests-mx32/fstatx.c index f88d9a9c..275fe65a 100644 --- a/tests-mx32/fstatx.c +++ b/tests-mx32/fstatx.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #define IS_FSTAT 1 diff --git a/tests-mx32/fsync-y.c b/tests-mx32/fsync-y.c new file mode 100644 index 00000000..f42f8345 --- /dev/null +++ b/tests-mx32/fsync-y.c @@ -0,0 +1,51 @@ +/* + * Check printing of file name in strace -y mode. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include + +int +main(void) +{ + char dir[PATH_MAX + 1]; + + const struct { + const char *path; + const char *cstr; + const char *fdstr; + } checks[] = { + { ARG_STR("\1\0020\v\0047\f\58\t\79\n\10\0171\r\0167\218\37 \\\'\"<<0::0>>1~\177\200\377"), + "\\1\\0020\\v\\0047\\f\\58\\t\\79\\n\\10\\0171\\r\\0167" + "\\218\\37 \\\\\'\\\"\\74\\0740::0\\76\\0761~\\177\\200\\377" }, + }; + + if (!getcwd(dir, sizeof(dir))) + perror_msg_and_fail("getcwd"); + + for (unsigned int i = 0; i < ARRAY_SIZE(checks); i++) { + long fd = open(checks[i].path, O_RDONLY|O_CREAT, 0600); + if (fd < 0) + perror_msg_and_fail("open(%s)", checks[i].cstr); + + int rc = fsync(fd); + + printf("fsync(%ld<", fd); + print_quoted_string_ex(dir, false, ">:"); + printf("/%s>) = %s\n", checks[i].fdstr, sprintrc(rc)); + + close(fd); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/fsync-y.gen.test b/tests-mx32/fsync-y.gen.test new file mode 100755 index 00000000..055a580f --- /dev/null +++ b/tests-mx32/fsync-y.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fsync-y -y -e trace=fsync); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -y -e trace=fsync diff --git a/tests-mx32/fsync.c b/tests-mx32/fsync.c index 2f504106..5624096b 100644 --- a/tests-mx32/fsync.c +++ b/tests-mx32/fsync.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/fsync.gen.test b/tests-mx32/fsync.gen.test new file mode 100755 index 00000000..5e72cc25 --- /dev/null +++ b/tests-mx32/fsync.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fsync -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-mx32/fsync.test b/tests-mx32/fsync.test deleted file mode 100755 index a58b67be..00000000 --- a/tests-mx32/fsync.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check fsync syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 diff --git a/tests-mx32/ftruncate.c b/tests-mx32/ftruncate.c index ee17455f..6c77d4b1 100644 --- a/tests-mx32/ftruncate.c +++ b/tests-mx32/ftruncate.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/ftruncate.gen.test b/tests-mx32/ftruncate.gen.test new file mode 100755 index 00000000..6e5926b2 --- /dev/null +++ b/tests-mx32/ftruncate.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ftruncate -a24 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-mx32/ftruncate.test b/tests-mx32/ftruncate.test deleted file mode 100755 index ec8a1e05..00000000 --- a/tests-mx32/ftruncate.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check ftruncate syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 diff --git a/tests-mx32/ftruncate64.c b/tests-mx32/ftruncate64.c index 90d9938f..b7e350b4 100644 --- a/tests-mx32/ftruncate64.c +++ b/tests-mx32/ftruncate64.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/ftruncate64.gen.test b/tests-mx32/ftruncate64.gen.test new file mode 100755 index 00000000..d910f617 --- /dev/null +++ b/tests-mx32/ftruncate64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ftruncate64 -a36 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests-mx32/ftruncate64.test b/tests-mx32/ftruncate64.test deleted file mode 100755 index 90682102..00000000 --- a/tests-mx32/ftruncate64.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check ftruncate64 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a36 diff --git a/tests-mx32/futex.c b/tests-mx32/futex.c index 586b95d5..47191f27 100644 --- a/tests-mx32/futex.c +++ b/tests-mx32/futex.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -33,7 +14,6 @@ # include # include -# include # include # include # include @@ -55,18 +35,18 @@ # include "xlat/futexwakeops.h" # include "xlat/futexwakecmps.h" -static struct timespec *tmout; - void futex_error(int *uaddr, int op, unsigned long val, unsigned long timeout, - int *uaddr2, unsigned long val3, int rc) + int *uaddr2, unsigned long val3, int rc, const char *func, int line) { - perror_msg_and_fail("futex(%p, %#x, %#x, %#lx, %p, %#x) = %d", - uaddr, op, (unsigned) val, timeout, uaddr, (unsigned) val3, rc); + perror_msg_and_fail("%s:%d: futex(%p, %#x, %#x, %#lx, %p, %#x) = %d", + func, line, uaddr, op, (unsigned) val, timeout, uaddr, + (unsigned) val3, rc); } # define CHECK_FUTEX_GENERIC(uaddr, op, val, timeout, uaddr2, val3, check, \ enosys) \ do { \ + errno = 0; \ rc = syscall(__NR_futex, (uaddr), (op), (val), (timeout), \ (uaddr2), (val3)); \ /* It is here due to EPERM on WAKE_OP on AArch64 */ \ @@ -77,7 +57,7 @@ void futex_error(int *uaddr, int op, unsigned long val, unsigned long timeout, if (!(check)) \ futex_error((uaddr), (op), (val), \ (unsigned long) (timeout), (int *) (uaddr2), \ - (val3), rc); \ + (val3), rc, __func__, __LINE__); \ } while (0) # define CHECK_FUTEX_ENOSYS(uaddr, op, val, timeout, uaddr2, val3, check) \ @@ -151,20 +131,29 @@ void invalid_op(int *val, int op, uint32_t argmask, ...) } while (0) /* Value which differs from one stored in int *val */ -# define VAL ((unsigned long) 0xbadda7a0facefeedLLU) -# define VAL_PR ((unsigned) VAL) +# define VAL ((unsigned long) 0xbadda7a0facefeedLLU) +# define VAL_PR ((unsigned) VAL) + +# define VALP ((unsigned long) 0xbadda7a01acefeedLLU) +# define VALP_PR ((unsigned) VALP) -# define VAL2 ((unsigned long) 0xbadda7a0ca7b100dLLU) -# define VAL2_PR ((unsigned) VAL2) +# define VAL2 ((unsigned long) 0xbadda7a0ca7b100dLLU) +# define VAL2_PR ((unsigned) VAL2) -# define VAL3 ((unsigned long) 0xbadda7a09caffee1LLU) -# define VAL3_PR ((unsigned) VAL3) +# define VAL2P ((unsigned long) 0xbadda7a07a7b100dLLU) +# define VAL2P_PR ((unsigned) VAL2P) + +# define VAL3 ((unsigned long) 0xbadda7a09caffee1LLU) +# define VAL3_PR ((unsigned) VAL3) + +# define VAL3A ((unsigned long) 0xbadda7a0ffffffffLLU) +# define VAL3A_PR "FUTEX_BITSET_MATCH_ANY" int main(int argc, char *argv[]) { - int *uaddr = tail_alloc(sizeof(*uaddr)); - int *uaddr2 = tail_alloc(sizeof(*uaddr2)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, uaddr); + TAIL_ALLOC_OBJECT_CONST_PTR(int, uaddr2); int rc; unsigned i; unsigned j; @@ -172,7 +161,7 @@ main(int argc, char *argv[]) uaddr[0] = 0x1deadead; uaddr2[0] = 0xbadf00d; - tmout = tail_alloc(sizeof(*tmout)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, tmout); tmout->tv_sec = 123; tmout->tv_nsec = 0xbadc0de; @@ -189,37 +178,59 @@ main(int argc, char *argv[]) /* uaddr is NULL */ CHECK_FUTEX(NULL, FUTEX_WAIT, VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EFAULT)); - printf("futex(NULL, FUTEX_WAIT, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", - VAL_PR, (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, - sprintrc(rc)); + printf("futex(NULL, FUTEX_WAIT, %u, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); /* uaddr is faulty */ CHECK_FUTEX(uaddr + 1, FUTEX_WAIT, VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EFAULT)); - printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", - uaddr + 1, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + uaddr + 1, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); /* timeout is faulty */ CHECK_FUTEX(uaddr, FUTEX_WAIT, VAL, tmout + 1, uaddr2, VAL3, (rc == -1) && (errno == EFAULT)); printf("futex(%p, FUTEX_WAIT, %u, %p) = %s\n", - uaddr, 0xfacefeed, tmout + 1, sprintrc(rc)); + uaddr, 0xfacefeed, tmout + 1, sprintrc(rc)); + + /* timeout is invalid */ + tmout->tv_sec = 0xdeadbeefU; + tmout->tv_nsec = 0xfacefeedU; + + CHECK_FUTEX(uaddr, FUTEX_WAIT, VAL, tmout, uaddr2, VAL3, + (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); + + tmout->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + tmout->tv_nsec = (long) 0xbadc0dedfacefeedLL; + + CHECK_FUTEX(uaddr, FUTEX_WAIT, VAL, tmout, uaddr2, VAL3, + (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); + + tmout->tv_sec = 123; + tmout->tv_nsec = 0xbadc0de; /* uaddr is not as provided; uaddr2 is faulty but ignored */ CHECK_FUTEX(uaddr, FUTEX_WAIT, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", - uaddr, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); /* uaddr is not as provided; uaddr2 is faulty but ignored */ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAIT, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_PRIVATE, %u, {tv_sec=%jd, tv_nsec=%jd}) = " - "%s\n", - uaddr, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_PRIVATE, %u, {tv_sec=%lld, tv_nsec=%llu})" + " = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); /* Next 2 tests are with CLOCKRT bit set */ @@ -227,18 +238,18 @@ main(int argc, char *argv[]) CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_WAIT, VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT|FUTEX_CLOCK_REALTIME, %u, " - "{tv_sec=%jd, tv_nsec=%jd}) = %s\n", uaddr, VAL_PR, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, - sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT|FUTEX_CLOCK_REALTIME, %u" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); CHECK_FUTEX_ENOSYS(uaddr, - FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | FUTEX_WAIT , + FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | FUTEX_WAIT, VAL, tmout, uaddr2, 0, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_PRIVATE|FUTEX_CLOCK_REALTIME, %u, " - "{tv_sec=%jd, tv_nsec=%jd}) = %s\n", uaddr, VAL_PR, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, - sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_PRIVATE|FUTEX_CLOCK_REALTIME, %u" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); /* FUTEX_WAIT_BITSET - FUTEX_WAIT which provides additional bitmask * which should be matched at least in one bit with @@ -254,50 +265,62 @@ main(int argc, char *argv[]) CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_BITSET, %u, {tv_sec=%jd, tv_nsec=%jd}, " - "%#x) = %s\n", - uaddr, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, VAL3_PR, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_BITSET, %u, {tv_sec=%lld, tv_nsec=%llu}" + ", %#x) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), VAL3_PR, + sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, + VAL3A, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_BITSET, %u, {tv_sec=%lld, tv_nsec=%llu}" + ", %s) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), VAL3A_PR, + sprintrc(rc)); /* val3 of 0 is invalid */ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, 0, (rc == -1) && (errno == EINVAL)); - printf("futex(%p, FUTEX_WAIT_BITSET, %u, {tv_sec=%jd, tv_nsec=%jd}, " - "%#x) = %s\n", - uaddr, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, 0, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_BITSET, %u, {tv_sec=%lld, tv_nsec=%llu}" + ", %#x) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), 0, sprintrc(rc)); CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_BITSET_PRIVATE, %u, " - "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", - uaddr, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, VAL3_PR, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_BITSET_PRIVATE, %u" + ", {tv_sec=%lld, tv_nsec=%llu}, %#x) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), VAL3_PR, + sprintrc(rc)); /* Next 3 tests are with CLOCKRT bit set */ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, %u, " - "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", uaddr, VAL_PR, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, VAL3_PR, - sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, %u" + ", {tv_sec=%lld, tv_nsec=%llu}, %#x) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), VAL3_PR, + sprintrc(rc)); /* val3 of 0 is invalid */ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, 0, (rc == -1) && (errno == EINVAL)); - printf("futex(%p, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, %u, " - "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", uaddr, VAL_PR, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, 0, - sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, %u" + ", {tv_sec=%lld, tv_nsec=%llu}, %#x) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), 0, sprintrc(rc)); CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, %u, " - "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", uaddr, VAL_PR, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, VAL3_PR, - sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, %u" + ", {tv_sec=%lld, tv_nsec=%llu}, %#x) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), VAL3_PR, + sprintrc(rc)); /* FUTEX_WAKE - wake val processes waiting for uaddr * Possible flags: PRIVATE @@ -343,6 +366,11 @@ main(int argc, char *argv[]) printf("futex(%p, FUTEX_WAKE_BITSET, %u, %#x) = %s\n", uaddr, 10, VAL3_PR, sprintrc(rc)); + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAKE_BITSET, 10, NULL, NULL, + VAL3A, (rc == 0)); + printf("futex(%p, FUTEX_WAKE_BITSET, %u, %s) = %s\n", uaddr, 10, + VAL3A_PR, sprintrc(rc)); + /* bitset 0 is invalid */ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAKE_BITSET, 10, NULL, NULL, 0, (rc == -1) && (errno == EINVAL)); @@ -392,16 +420,26 @@ main(int argc, char *argv[]) /* Trying to re-queue some processes but there's nothing to re-queue */ CHECK_FUTEX(uaddr, FUTEX_REQUEUE, VAL, VAL2, uaddr2, VAL3, - (rc == 0)); + (rc == 0) || ((rc == -1) && (errno == EINVAL))); printf("futex(%p, FUTEX_REQUEUE, %u, %u, %p) = %s\n", uaddr, VAL_PR, VAL2_PR, uaddr2, sprintrc(rc)); + CHECK_FUTEX(uaddr, FUTEX_REQUEUE, VALP, VAL2P, uaddr2, VAL3, + (rc == 0)); + printf("futex(%p, FUTEX_REQUEUE, %u, %u, %p) = %s\n", + uaddr, VALP_PR, VAL2P_PR, uaddr2, sprintrc(rc)); + /* Trying to re-queue some processes but there's nothing to re-queue */ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_REQUEUE, VAL, VAL2, - uaddr2, VAL3, (rc == 0)); + uaddr2, VAL3, (rc == 0) || ((rc == -1) && (errno == EINVAL))); printf("futex(%p, FUTEX_REQUEUE_PRIVATE, %u, %u, %p) = %s\n", uaddr, VAL_PR, VAL2_PR, uaddr2, sprintrc(rc)); + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_REQUEUE, VALP, + VAL2P, uaddr2, VAL3, (rc == 0)); + printf("futex(%p, FUTEX_REQUEUE_PRIVATE, %u, %u, %p) = %s\n", + uaddr, VALP_PR, VAL2P_PR, uaddr2, sprintrc(rc)); + CHECK_INVALID_CLOCKRT(FUTEX_REQUEUE, ARG3 | ARG4 | ARG5, "%u", "%u", "%#lx"); @@ -418,22 +456,38 @@ main(int argc, char *argv[]) /* Comparison re-queue with wrong val value */ CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VAL, VAL2, uaddr2, VAL3, - (rc == -1) && (errno == EAGAIN)); + (rc == -1) && (errno == EAGAIN || errno == EINVAL)); printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n", uaddr, VAL_PR, VAL2_PR, uaddr2, VAL3_PR, sprintrc(rc)); + CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VALP, VAL2P, uaddr2, VAL3, + (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n", + uaddr, VALP_PR, VAL2P_PR, uaddr2, VAL3_PR, sprintrc(rc)); + /* Successful comparison re-queue */ CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VAL, VAL2, uaddr2, *uaddr, - (rc == 0)); + (rc == 0) || ((rc == -1) && (errno == EINVAL))); printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n", uaddr, VAL_PR, VAL2_PR, uaddr2, *uaddr, sprintrc(rc)); + CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VALP, VAL2P, uaddr2, *uaddr, + (rc == 0)); + printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n", + uaddr, VALP_PR, VAL2P_PR, uaddr2, *uaddr, sprintrc(rc)); + /* Successful comparison re-queue */ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_CMP_REQUEUE, VAL, - VAL2, uaddr2, *uaddr, (rc == 0)); + VAL2, uaddr2, *uaddr, + (rc == 0) || ((rc == -1) && (errno == EINVAL))); printf("futex(%p, FUTEX_CMP_REQUEUE_PRIVATE, %u, %u, %p, %u) = %s\n", uaddr, VAL_PR, VAL2_PR, uaddr2, *uaddr, sprintrc(rc)); + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_CMP_REQUEUE, VALP, + VAL2P, uaddr2, *uaddr, (rc == 0)); + printf("futex(%p, FUTEX_CMP_REQUEUE_PRIVATE, %u, %u, %p, %u) = %s\n", + uaddr, VALP_PR, VAL2P_PR, uaddr2, *uaddr, sprintrc(rc)); + CHECK_INVALID_CLOCKRT(FUTEX_CMP_REQUEUE, ARG3 | ARG4 | ARG5 | ARG6, "%u", "%u", "%#lx", "%u"); @@ -471,8 +525,16 @@ main(int argc, char *argv[]) static const struct { uint32_t val; const char *str; + + /* + * Peculiar semantics: + * * err == 0 and err2 != 0 => expect both either the absence + * of error or presence of err2 + * * err != 0 and err2 == 0 => expect err only, no success + * expected. + */ int err; - const char *errstr; + int err2; } wake_ops[] = { { 0x00000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, { 0x00fff000, "FUTEX_OP_SET<<28|0xfff<<12|FUTEX_OP_CMP_EQ<<24|" @@ -486,13 +548,13 @@ main(int argc, char *argv[]) { 0x30000000, "FUTEX_OP_ANDN<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, { 0x40000000, "FUTEX_OP_XOR<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, { 0x50000000, "0x5<<28 /* FUTEX_OP_??? */|0<<12|" - "FUTEX_OP_CMP_EQ<<24|0", ENOSYS, "ENOSYS" }, + "FUTEX_OP_CMP_EQ<<24|0", ENOSYS }, { 0x70000000, "0x7<<28 /* FUTEX_OP_??? */|0<<12|" - "FUTEX_OP_CMP_EQ<<24|0", ENOSYS, "ENOSYS" }, + "FUTEX_OP_CMP_EQ<<24|0", ENOSYS }, { 0x80000000, "FUTEX_OP_OPARG_SHIFT<<28|FUTEX_OP_SET<<28|0<<12|" "FUTEX_OP_CMP_EQ<<24|0" }, { 0xa0caffee, "FUTEX_OP_OPARG_SHIFT<<28|FUTEX_OP_OR<<28|" - "0xcaf<<12|FUTEX_OP_CMP_EQ<<24|0xfee" }, + "0xcaf<<12|FUTEX_OP_CMP_EQ<<24|0xfee", 0, EINVAL }, { 0x01000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_NE<<24|0" }, { 0x01234567, "FUTEX_OP_SET<<28|0x234<<12|FUTEX_OP_CMP_NE<<24|" "0x567" }, @@ -501,30 +563,41 @@ main(int argc, char *argv[]) { 0x04000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_GT<<24|0" }, { 0x05000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_GE<<24|0" }, { 0x06000000, "FUTEX_OP_SET<<28|0<<12|" - "0x6<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + "0x6<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS }, { 0x07000000, "FUTEX_OP_SET<<28|0<<12|" - "0x7<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + "0x7<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS }, { 0x08000000, "FUTEX_OP_SET<<28|0<<12|" - "0x8<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + "0x8<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS }, { 0x0f000000, "FUTEX_OP_SET<<28|0<<12|" - "0xf<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + "0xf<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS }, { 0xbadfaced, "FUTEX_OP_OPARG_SHIFT<<28|FUTEX_OP_ANDN<<28|" "0xdfa<<12|0xa<<24 /* FUTEX_OP_CMP_??? */|0xced", - ENOSYS, "ENOSYS" }, + ENOSYS, EINVAL }, { 0xffffffff, "FUTEX_OP_OPARG_SHIFT<<28|" "0x7<<28 /* FUTEX_OP_??? */|0xfff<<12|" "0xf<<24 /* FUTEX_OP_CMP_??? */|0xfff", - ENOSYS, "ENOSYS" }, + ENOSYS, EINVAL }, }; for (i = 0; i < ARRAY_SIZE(wake_ops); i++) { for (j = 0; j < 2; j++) { CHECK_FUTEX_ENOSYS(uaddr, j ? FUTEX_WAKE_OP_PRIVATE : FUTEX_WAKE_OP, - VAL, i, uaddr2, wake_ops[i].val, (rc == 0)); - printf("futex(%p, FUTEX_WAKE_OP%s, %u, %u, %p, %s) = " - "%s\n", uaddr, j ? "_PRIVATE" : "", VAL_PR, i, - uaddr2, wake_ops[i].str, sprintrc(rc)); + VAL, i, uaddr2, wake_ops[i].val, + /* + * Either one of errs is 0 or rc == 0 is not + * allowed. + */ + ((!wake_ops[i].err || !wake_ops[i].err2 || + (rc != 0)) && + ((!wake_ops[i].err && (rc == 0)) || + (wake_ops[i].err && (rc == -1) && + (errno == wake_ops[i].err)) || + (wake_ops[i].err2 && (rc == -1) && + (errno == wake_ops[i].err2))))); + printf("futex(%p, FUTEX_WAKE_OP%s, %u, %u, %p, %s)" + " = %s\n", uaddr, j ? "_PRIVATE" : "", VAL_PR, + i, uaddr2, wake_ops[i].str, sprintrc(rc)); } } @@ -552,16 +625,16 @@ main(int argc, char *argv[]) CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_LOCK_PI, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EFAULT)); - printf("futex(%p, FUTEX_LOCK_PI, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", - uaddr + 1, (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, - sprintrc(rc)); + printf("futex(%p, FUTEX_LOCK_PI, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + uaddr + 1, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_PRIVATE_FLAG | FUTEX_LOCK_PI, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EFAULT)); - printf("futex(%p, FUTEX_LOCK_PI_PRIVATE, {tv_sec=%jd, tv_nsec=%jd}) = " - "%s\n", - uaddr + 1, (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, - sprintrc(rc)); + printf("futex(%p, FUTEX_LOCK_PI_PRIVATE, {tv_sec=%lld, tv_nsec=%llu})" + " = %s\n", + uaddr + 1, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); /* NULL is passed by invalid_op() in cases valid timeout address is * needed */ @@ -587,7 +660,7 @@ main(int argc, char *argv[]) CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_PRIVATE_FLAG | FUTEX_UNLOCK_PI, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EFAULT)); - printf("futex(%p, FUTEX_UNLOCK_PI_PRIVATE) = %s\n", uaddr +1, + printf("futex(%p, FUTEX_UNLOCK_PI_PRIVATE) = %s\n", uaddr + 1, sprintrc(rc)); CHECK_INVALID_CLOCKRT(FUTEX_UNLOCK_PI, 0); @@ -633,32 +706,32 @@ main(int argc, char *argv[]) CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAIT_REQUEUE_PI, VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_REQUEUE_PI, %u, " - "{tv_sec=%jd, tv_nsec=%jd}, %p) = %s\n", - uaddr, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, uaddr2, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI, %u" + ", {tv_sec=%lld, tv_nsec=%llu}, %p) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), uaddr2, sprintrc(rc)); CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAIT_REQUEUE_PI, VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_REQUEUE_PI_PRIVATE, %u, " - "{tv_sec=%jd, tv_nsec=%jd}, %p) " - "= %s\n", uaddr, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, uaddr2, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI_PRIVATE, %u" + ", {tv_sec=%lld, tv_nsec=%llu}, %p) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), uaddr2, sprintrc(rc)); CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_WAIT_REQUEUE_PI, VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_REQUEUE_PI|FUTEX_CLOCK_REALTIME, %u, " - "{tv_sec=%jd, tv_nsec=%jd}, %p) = %s\n", uaddr, VAL_PR, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, uaddr2, - sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI|FUTEX_CLOCK_REALTIME, %u" + ", {tv_sec=%lld, tv_nsec=%llu}, %p) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), uaddr2, sprintrc(rc)); CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | FUTEX_WAIT_REQUEUE_PI, VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_REQUEUE_PI_PRIVATE|FUTEX_CLOCK_REALTIME, " - "%u, {tv_sec=%jd, tv_nsec=%jd}, %p) = %s\n", uaddr, VAL_PR, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, uaddr2, - sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI_PRIVATE|FUTEX_CLOCK_REALTIME" + ", %u, {tv_sec=%lld, tv_nsec=%llu}, %p) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), uaddr2, sprintrc(rc)); /* FUTEX_CMP_REQUEUE_PI - version of FUTEX_CMP_REQUEUE which re-queues * on PI-aware futex. diff --git a/tests-mx32/futex.test b/tests-mx32/futex.test index fc98267a..889eec61 100755 --- a/tests-mx32/futex.test +++ b/tests-mx32/futex.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check futex syscall decoding. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests-mx32/futimesat.c b/tests-mx32/futimesat.c index c3566291..8024f87b 100644 --- a/tests-mx32/futimesat.c +++ b/tests-mx32/futimesat.c @@ -1,30 +1,10 @@ /* * Check decoding of futimesat syscall. * - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -37,46 +17,123 @@ # include # include - -int -main(void) +static void +print_tv(const struct timeval *tv) { - struct timeval tv; - if (gettimeofday(&tv, NULL)) - perror_msg_and_fail("gettimeofday"); - - static const char sample[] = "futimesat_sample"; - unsigned long dirfd = (unsigned long) 0xdeadbeef00000000ULL | -100U; - - long rc = syscall(__NR_futimesat, dirfd, sample, 0); - printf("futimesat(AT_FDCWD, \"%s\", NULL) = %ld %s (%m)\n", - sample, rc, errno2name()); + printf("{tv_sec=%lld, tv_usec=%llu}", + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); + print_time_t_usec(tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec), 1); +} - struct timeval *const ts = tail_alloc(sizeof(*ts) * 2); - dirfd = (unsigned long) 0xdeadbeefffffffffULL; +static const char *errstr; - ts[0].tv_sec = tv.tv_sec; - ts[0].tv_usec = tv.tv_usec; - ts[1].tv_sec = tv.tv_sec - 1; - ts[1].tv_usec = tv.tv_usec + 1; +static long +k_futimesat(const kernel_ulong_t dirfd, + const kernel_ulong_t pathname, + const kernel_ulong_t times) +{ + long rc = syscall(__NR_futimesat, dirfd, pathname, times); + errstr = sprintrc(rc); + return rc; +} - rc = syscall(__NR_futimesat, dirfd, 0, ts + 2); - printf("futimesat(%d, NULL, %p) = %ld %s (%m)\n", - (int) dirfd, ts + 2, rc, errno2name()); +int +main(void) +{ + static const kernel_ulong_t bogus_fd = + (kernel_ulong_t) 0xbadfaceddeadbeaf; + static const kernel_ulong_t kfdcwd = + (kernel_ulong_t) 0xdefaced00000000 | -100U; + static const char proto_fname[] = "futimesat_sample"; + static const char qname[] = "\"futimesat_sample\""; - rc = syscall(__NR_futimesat, dirfd, 0, ts + 1); - printf("futimesat(%d, NULL, [{tv_sec=%jd, tv_usec=%jd}, %p]) = " - "%ld %s (%m)\n", (int) dirfd, - (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, - ts + 2, rc, errno2name()); + char *const fname = tail_memdup(proto_fname, sizeof(proto_fname)); + const kernel_ulong_t kfname = (uintptr_t) fname; + struct timeval *const tv = tail_alloc(sizeof(*tv) * 2); (void) close(0); - rc = syscall(__NR_futimesat, 0, "", ts); - printf("futimesat(0, \"\", [{tv_sec=%jd, tv_usec=%jd}, " - "{tv_sec=%jd, tv_usec=%jd}]) = %ld %s (%m)\n", - (intmax_t) ts[0].tv_sec, (intmax_t) ts[0].tv_usec, - (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, - rc, errno2name()); + + /* dirfd */ + k_futimesat(0, kfname, 0); + printf("futimesat(0, %s, NULL) = %s\n", qname, errstr); + + k_futimesat(bogus_fd, kfname, 0); + printf("futimesat(%d, %s, NULL) = %s\n", (int) bogus_fd, qname, errstr); + + k_futimesat(-100U, kfname, 0); + printf("futimesat(AT_FDCWD, %s, NULL) = %s\n", qname, errstr); + + k_futimesat(kfdcwd, kfname, 0); + printf("futimesat(AT_FDCWD, %s, NULL) = %s\n", qname, errstr); + + /* pathname */ + k_futimesat(kfdcwd, 0, 0); + printf("futimesat(AT_FDCWD, NULL, NULL) = %s\n", errstr); + + k_futimesat(kfdcwd, kfname + sizeof(proto_fname) - 1, 0); + printf("futimesat(AT_FDCWD, \"\", NULL) = %s\n", errstr); + + fname[sizeof(proto_fname) - 1] = '+'; + k_futimesat(kfdcwd, kfname, 0); + fname[sizeof(proto_fname) - 1] = '\0'; + printf("futimesat(AT_FDCWD, %p, NULL) = %s\n", fname, errstr); + + if (F8ILL_KULONG_SUPPORTED) { + k_futimesat(kfdcwd, f8ill_ptr_to_kulong(fname), 0); + printf("futimesat(AT_FDCWD, %#jx, NULL) = %s\n", + (uintmax_t) f8ill_ptr_to_kulong(fname), errstr); + } + + /* times */ + k_futimesat(kfdcwd, kfname, (uintptr_t) (tv + 1)); + printf("futimesat(AT_FDCWD, %s, %p) = %s\n", + qname, tv + 1, errstr); + + k_futimesat(kfdcwd, kfname, (uintptr_t) (tv + 2)); + printf("futimesat(AT_FDCWD, %s, %p) = %s\n", + qname, tv + 2, errstr); + + tv[0].tv_sec = 0xdeadbeefU; + tv[0].tv_usec = 0xfacefeedU; + tv[1].tv_sec = (time_t) 0xcafef00ddeadbeefLL; + tv[1].tv_usec = (suseconds_t) 0xbadc0dedfacefeedLL; + + k_futimesat(kfdcwd, kfname, (uintptr_t) tv); + printf("futimesat(AT_FDCWD, %s, [", qname); + print_tv(&tv[0]); + printf(", "); + print_tv(&tv[1]); + printf("]) = %s\n", errstr); + + tv[0].tv_sec = 1492356708; + tv[0].tv_usec = 567891234; + tv[1].tv_sec = 1492357086; + tv[1].tv_usec = 678902345; + + k_futimesat(kfdcwd, kfname, (uintptr_t) tv); + printf("futimesat(AT_FDCWD, %s, [", qname); + print_tv(&tv[0]); + printf(", "); + print_tv(&tv[1]); + printf("]) = %s\n", errstr); + + tv[0].tv_usec = 567891; + tv[1].tv_usec = 678902; + + k_futimesat(kfdcwd, kfname, (uintptr_t) tv); + printf("futimesat(AT_FDCWD, %s, [", qname); + print_tv(&tv[0]); + printf(", "); + print_tv(&tv[1]); + printf("]) = %s\n", errstr); + + if (F8ILL_KULONG_SUPPORTED) { + k_futimesat(kfdcwd, kfname, f8ill_ptr_to_kulong(tv)); + printf("futimesat(AT_FDCWD, %s, %#jx) = %s\n", + qname, (uintmax_t) f8ill_ptr_to_kulong(tv), errstr); + } puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/futimesat.gen.test b/tests-mx32/futimesat.gen.test new file mode 100755 index 00000000..80d7a8bc --- /dev/null +++ b/tests-mx32/futimesat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (futimesat -a28 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-mx32/futimesat.test b/tests-mx32/futimesat.test deleted file mode 100755 index 3a67c042..00000000 --- a/tests-mx32/futimesat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check futimesat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 diff --git a/tests-mx32/gen_pure_executables.sh b/tests-mx32/gen_pure_executables.sh new file mode 100755 index 00000000..735f53a6 --- /dev/null +++ b/tests-mx32/gen_pure_executables.sh @@ -0,0 +1,30 @@ +#!/bin/sh -efu +# +# Copyright (c) 2017-2018 Dmitry V. Levin +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +usage() +{ + cat >&2 < []] + +Generate pure_executables.am from list. +Deduce output file from unless an is specified. +EOF + exit 1 +} + +input="${0%/*}/pure_executables.list" +[ $# -eq 0 ] || { input="$1"; shift; } +output="$(dirname "$input")/pure_executables.am" +[ $# -eq 0 ] || { output="$1"; shift; } +[ $# -eq 0 ] || usage + +exec > "$output" + +echo "# Generated by $0 from $input; do not edit." +echo 'PURE_EXECUTABLES = \' +sed -n 's/^[^#].*/ & \\/p' < "$input" +echo ' #' diff --git a/tests-mx32/gen_tests.am b/tests-mx32/gen_tests.am new file mode 100644 index 00000000..e6d1fc7b --- /dev/null +++ b/tests-mx32/gen_tests.am @@ -0,0 +1,1574 @@ +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in; do not edit. +GEN_TESTS = _newselect.gen.test _newselect-P.gen.test accept.gen.test accept4.gen.test access.gen.test acct.gen.test add_key.gen.test adjtimex.gen.test aio.gen.test aio_pgetevents.gen.test alarm.gen.test bpf.gen.test bpf-obj_get_info_by_fd.gen.test bpf-obj_get_info_by_fd-prog.gen.test bpf-obj_get_info_by_fd-prog-v.gen.test bpf-obj_get_info_by_fd-v.gen.test bpf-v.gen.test btrfs.gen.test chmod.gen.test chown.gen.test chown32.gen.test chroot.gen.test clock.gen.test clock_adjtime.gen.test clock_nanosleep.gen.test clock_xettime.gen.test copy_file_range.gen.test creat.gen.test delete_module.gen.test dev-yy.gen.test dup.gen.test dup2.gen.test dup3.gen.test epoll_create.gen.test epoll_create1.gen.test epoll_ctl.gen.test epoll_pwait.gen.test epoll_wait.gen.test erestartsys.gen.test execveat.gen.test execveat-v.gen.test faccessat.gen.test fadvise64_64.gen.test fallocate.gen.test fanotify_init.gen.test fanotify_mark.gen.test fanotify_mark-Xabbrev.gen.test fanotify_mark-Xraw.gen.test fanotify_mark-Xverbose.gen.test fchdir.gen.test fchmod.gen.test fchmodat.gen.test fchown.gen.test fchown32.gen.test fchownat.gen.test fcntl.gen.test fcntl64.gen.test fdatasync.gen.test file_handle.gen.test file_ioctl.gen.test finit_module.gen.test flock.gen.test fork-f.gen.test fstat.gen.test fstat-Xabbrev.gen.test fstat-Xraw.gen.test fstat-Xverbose.gen.test fstat64.gen.test fstat64-Xabbrev.gen.test fstat64-Xraw.gen.test fstat64-Xverbose.gen.test fstatat64.gen.test fstatfs.gen.test fstatfs64.gen.test fsync.gen.test fsync-y.gen.test ftruncate.gen.test ftruncate64.gen.test futimesat.gen.test get_mempolicy.gen.test getcpu.gen.test getcwd.gen.test getdents.gen.test getdents64.gen.test getegid.gen.test getegid32.gen.test geteuid.gen.test geteuid32.gen.test getgid.gen.test getgid32.gen.test getgroups.gen.test getgroups32.gen.test getpeername.gen.test getpgrp.gen.test getpid.gen.test getppid.gen.test getrandom.gen.test getresgid.gen.test getresgid32.gen.test getresuid.gen.test getresuid32.gen.test getrlimit.gen.test getrusage.gen.test getsid.gen.test getsockname.gen.test gettid.gen.test getuid32.gen.test getxxid.gen.test group_req.gen.test inet-cmsg.gen.test init_module.gen.test inotify.gen.test inotify_init1.gen.test io_uring_enter.gen.test io_uring_register.gen.test io_uring_setup.gen.test ioctl_block.gen.test ioctl_dm.gen.test ioctl_dm-v.gen.test ioctl_evdev.gen.test ioctl_evdev-v.gen.test ioctl_inotify.gen.test ioctl_kvm_run.gen.test ioctl_kvm_run-v.gen.test ioctl_kvm_run_auxstr_vcpu.gen.test ioctl_loop.gen.test ioctl_loop-nv.gen.test ioctl_loop-v.gen.test ioctl_mtd.gen.test ioctl_nbd.gen.test ioctl_nsfs.gen.test ioctl_perf.gen.test ioctl_ptp.gen.test ioctl_random.gen.test ioctl_rtc.gen.test ioctl_rtc-v.gen.test ioctl_scsi.gen.test ioctl_sg_io_v3.gen.test ioctl_sg_io_v4.gen.test ioctl_sock_gifconf.gen.test ioctl_uffdio.gen.test ioctl_v4l2.gen.test ioperm.gen.test iopl.gen.test ioprio.gen.test ioprio-Xabbrev.gen.test ioprio-Xraw.gen.test ioprio-Xverbose.gen.test ip_mreq.gen.test ipc.gen.test ipc_msg.gen.test ipc_msg-Xabbrev.gen.test ipc_msg-Xraw.gen.test ipc_msg-Xverbose.gen.test ipc_msgbuf-Xabbrev.gen.test ipc_msgbuf-Xraw.gen.test ipc_msgbuf-Xverbose.gen.test ipc_sem.gen.test ipc_sem-Xabbrev.gen.test ipc_sem-Xraw.gen.test ipc_sem-Xverbose.gen.test ipc_shm.gen.test ipc_shm-Xabbrev.gen.test ipc_shm-Xraw.gen.test ipc_shm-Xverbose.gen.test kcmp.gen.test kcmp-y.gen.test kern_features.gen.test kernel_version.gen.test kernel_version-Xabbrev.gen.test kernel_version-Xraw.gen.test kernel_version-Xverbose.gen.test kexec_file_load.gen.test kexec_load.gen.test keyctl.gen.test keyctl-Xabbrev.gen.test keyctl-Xraw.gen.test keyctl-Xverbose.gen.test kill.gen.test lchown.gen.test lchown32.gen.test link.gen.test linkat.gen.test lookup_dcookie.gen.test lstat.gen.test lstat64.gen.test madvise.gen.test mbind.gen.test membarrier.gen.test memfd_create.gen.test memfd_create-Xabbrev.gen.test memfd_create-Xraw.gen.test memfd_create-Xverbose.gen.test migrate_pages.gen.test mincore.gen.test mkdir.gen.test mkdirat.gen.test mknod.gen.test mknodat.gen.test mlock.gen.test mlock2.gen.test mlockall.gen.test mmap-Xabbrev.gen.test mmap-Xraw.gen.test mmap-Xverbose.gen.test mmap64.gen.test mmap64-Xabbrev.gen.test mmap64-Xraw.gen.test mmap64-Xverbose.gen.test mmsg.gen.test mmsg-silent.gen.test mmsg_name.gen.test mmsg_name-v.gen.test modify_ldt.gen.test mount.gen.test mount-Xabbrev.gen.test mount-Xraw.gen.test mount-Xverbose.gen.test move_pages.gen.test move_pages-Xabbrev.gen.test move_pages-Xraw.gen.test move_pages-Xverbose.gen.test mq.gen.test mq_sendrecv.gen.test mq_sendrecv-read.gen.test mq_sendrecv-write.gen.test msg_control.gen.test msg_control-v.gen.test msg_name.gen.test munlockall.gen.test nanosleep.gen.test net-icmp_filter.gen.test net-packet_mreq.gen.test net-packet_mreq-Xabbrev.gen.test net-packet_mreq-Xraw.gen.test net-packet_mreq-Xverbose.gen.test net-sockaddr.gen.test net-tpacket_req.gen.test net-tpacket_stats.gen.test net-yy-inet6.gen.test netlink_audit.gen.test netlink_crypto.gen.test netlink_generic.gen.test netlink_kobject_uevent.gen.test netlink_netfilter.gen.test netlink_protocol.gen.test netlink_route.gen.test netlink_selinux.gen.test netlink_xfrm.gen.test newfstatat.gen.test nfnetlink_acct.gen.test nfnetlink_cthelper.gen.test nfnetlink_ctnetlink.gen.test nfnetlink_ctnetlink_exp.gen.test nfnetlink_cttimeout.gen.test nfnetlink_ipset.gen.test nfnetlink_nft_compat.gen.test nfnetlink_nftables.gen.test nfnetlink_osf.gen.test nfnetlink_queue.gen.test nfnetlink_ulog.gen.test nlattr.gen.test nlattr_br_port_msg.gen.test nlattr_crypto_user_alg.gen.test nlattr_dcbmsg.gen.test nlattr_fib_rule_hdr.gen.test nlattr_ifaddrlblmsg.gen.test nlattr_ifaddrmsg.gen.test nlattr_ifinfomsg.gen.test nlattr_ifla_af_spec.gen.test nlattr_ifla_brport.gen.test nlattr_ifla_linkinfo.gen.test nlattr_ifla_port.gen.test nlattr_ifla_xdp.gen.test nlattr_inet_diag_msg.gen.test nlattr_inet_diag_req_compat.gen.test nlattr_inet_diag_req_v2.gen.test nlattr_mdba_mdb_entry.gen.test nlattr_mdba_router_port.gen.test nlattr_ndmsg.gen.test nlattr_ndtmsg.gen.test nlattr_netconfmsg.gen.test nlattr_netlink_diag_msg.gen.test nlattr_nlmsgerr.gen.test nlattr_packet_diag_msg.gen.test nlattr_rtgenmsg.gen.test nlattr_rtmsg.gen.test nlattr_smc_diag_msg.gen.test nlattr_tc_stats.gen.test nlattr_tca_stab.gen.test nlattr_tcamsg.gen.test nlattr_tcmsg.gen.test nlattr_unix_diag_msg.gen.test old_mmap.gen.test old_mmap-P.gen.test old_mmap-Xabbrev.gen.test old_mmap-Xraw.gen.test old_mmap-Xverbose.gen.test old_mmap-v-none.gen.test oldfstat.gen.test oldlstat.gen.test oldselect.gen.test oldselect-P.gen.test oldselect-efault.gen.test oldselect-efault-P.gen.test oldstat.gen.test open.gen.test openat.gen.test orphaned_process_group.gen.test osf_utimes.gen.test pause.gen.test perf_event_open.gen.test perf_event_open_nonverbose.gen.test perf_event_open_unabbrev.gen.test personality-Xabbrev.gen.test personality-Xraw.gen.test personality-Xverbose.gen.test pidfd_send_signal.gen.test pipe2.gen.test pkey_alloc.gen.test pkey_free.gen.test pkey_mprotect.gen.test ppoll.gen.test ppoll-P.gen.test ppoll-v.gen.test pread64-pwrite64.gen.test preadv.gen.test preadv-pwritev.gen.test preadv2-pwritev2.gen.test printpath-umovestr.gen.test printpath-umovestr-peekdata.gen.test printpath-umovestr-undumpable.gen.test printsignal-Xabbrev.gen.test printsignal-Xraw.gen.test printsignal-Xverbose.gen.test printstr.gen.test printstrn-umoven.gen.test printstrn-umoven-peekdata.gen.test printstrn-umoven-undumpable.gen.test prlimit64.gen.test process_vm_readv.gen.test process_vm_writev.gen.test pselect6.gen.test ptrace.gen.test ptrace_syscall_info.gen.test pwritev.gen.test quotactl.gen.test quotactl-Xabbrev.gen.test quotactl-Xraw.gen.test quotactl-Xverbose.gen.test quotactl-v.gen.test quotactl-xfs.gen.test quotactl-xfs-v.gen.test read-write.gen.test readahead.gen.test readdir.gen.test readlink.gen.test readlinkat.gen.test reboot.gen.test recvfrom.gen.test recvmmsg-timeout.gen.test recvmsg.gen.test regex.gen.test remap_file_pages.gen.test remap_file_pages-Xabbrev.gen.test remap_file_pages-Xraw.gen.test remap_file_pages-Xverbose.gen.test rename.gen.test renameat.gen.test renameat2.gen.test request_key.gen.test riscv_flush_icache.gen.test rmdir.gen.test rt_sigpending.gen.test rt_sigprocmask.gen.test rt_sigqueueinfo.gen.test rt_sigreturn.gen.test rt_sigsuspend.gen.test rt_sigtimedwait.gen.test rt_tgsigqueueinfo.gen.test s390_guarded_storage.gen.test s390_guarded_storage-v.gen.test s390_pci_mmio_read_write.gen.test s390_runtime_instr.gen.test s390_sthyi.gen.test s390_sthyi-v.gen.test sched.gen.test sched_get_priority_mxx.gen.test sched_rr_get_interval.gen.test sched_xetaffinity.gen.test sched_xetattr.gen.test sched_xetparam.gen.test sched_xetscheduler.gen.test sched_yield.gen.test seccomp-filter.gen.test seccomp-filter-v.gen.test seccomp_get_action_avail.gen.test select.gen.test select-P.gen.test semop.gen.test sendfile.gen.test sendfile64.gen.test set_mempolicy.gen.test setdomainname.gen.test setfsgid.gen.test setfsgid32.gen.test setfsuid.gen.test setfsuid32.gen.test setgid.gen.test setgid32.gen.test setgroups.gen.test setgroups32.gen.test sethostname.gen.test setns.gen.test setregid.gen.test setregid32.gen.test setresgid.gen.test setresgid32.gen.test setresuid.gen.test setresuid32.gen.test setreuid.gen.test setreuid32.gen.test setrlimit.gen.test setrlimit-Xabbrev.gen.test setrlimit-Xraw.gen.test setrlimit-Xverbose.gen.test setuid.gen.test setuid32.gen.test shmxt.gen.test shutdown.gen.test sigaction.gen.test siginfo.gen.test signal.gen.test signal_receive.gen.test signalfd4.gen.test sigpending.gen.test sigprocmask.gen.test sigreturn.gen.test sigsuspend.gen.test so_error.gen.test so_linger.gen.test so_peercred.gen.test so_peercred-Xabbrev.gen.test so_peercred-Xraw.gen.test so_peercred-Xverbose.gen.test sock_filter-v.gen.test sock_filter-v-Xabbrev.gen.test sock_filter-v-Xraw.gen.test sock_filter-v-Xverbose.gen.test sockaddr_xlat-Xabbrev.gen.test sockaddr_xlat-Xraw.gen.test sockaddr_xlat-Xverbose.gen.test socketcall.gen.test sockopt-sol_netlink.gen.test sockopt-timestamp.gen.test splice.gen.test stat.gen.test stat64.gen.test statfs.gen.test statfs64.gen.test statx.gen.test swap.gen.test sxetmask.gen.test symlink.gen.test symlinkat.gen.test sync.gen.test sync_file_range.gen.test sync_file_range2.gen.test sysinfo.gen.test syslog.gen.test tee.gen.test time.gen.test timer_create.gen.test timer_xettime.gen.test timerfd_xettime.gen.test times.gen.test times-fail.gen.test trace_fstat.gen.test trace_fstatfs.gen.test trace_lstat.gen.test trace_personality_32.gen.test trace_personality_64.gen.test trace_personality_regex_32.gen.test trace_personality_regex_64.gen.test trace_personality_regex_x32.gen.test trace_personality_x32.gen.test trace_question.gen.test trace_stat.gen.test trace_stat_like.gen.test trace_statfs.gen.test trace_statfs_like.gen.test truncate.gen.test truncate64.gen.test ugetrlimit.gen.test umask.gen.test umoven-illptr.gen.test umovestr-illptr.gen.test umovestr3.gen.test unlink.gen.test unlinkat.gen.test unshare.gen.test userfaultfd.gen.test ustat.gen.test utime.gen.test utimensat.gen.test utimensat-Xabbrev.gen.test utimensat-Xraw.gen.test utimensat-Xverbose.gen.test utimes.gen.test vfork-f.gen.test vhangup.gen.test vmsplice.gen.test wait4.gen.test wait4-v.gen.test waitid.gen.test waitid-v.gen.test waitpid.gen.test xattr.gen.test xattr-strings.gen.test xet_robust_list.gen.test xetitimer.gen.test xetpgid.gen.test xetpriority.gen.test xettimeofday.gen.test + +$(srcdir)/_newselect.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/_newselect-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/accept.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/accept4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/access.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/acct.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/add_key.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/adjtimex.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/aio.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/aio_pgetevents.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/alarm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd-prog.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd-prog-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/btrfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chmod.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chown32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chroot.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock_adjtime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock_nanosleep.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock_xettime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/copy_file_range.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/creat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/delete_module.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dev-yy.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dup.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dup2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dup3.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_create.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_create1.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_ctl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_pwait.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_wait.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/erestartsys.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/execveat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/execveat-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/faccessat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fadvise64_64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fallocate.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_init.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchmod.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchmodat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchown32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchownat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fcntl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fcntl64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fdatasync.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/file_handle.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/file_ioctl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/finit_module.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/flock.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fork-f.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstatat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstatfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstatfs64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fsync.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fsync-y.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ftruncate.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ftruncate64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/futimesat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/get_mempolicy.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getcpu.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getcwd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getdents.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getdents64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getegid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getegid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/geteuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/geteuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgroups.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgroups32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getpeername.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getpgrp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getpid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getppid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getrandom.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getrlimit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getrusage.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getsid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getsockname.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/gettid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getxxid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/group_req.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/inet-cmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/init_module.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/inotify.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/inotify_init1.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/io_uring_enter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/io_uring_register.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/io_uring_setup.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_block.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_dm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_dm-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_evdev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_evdev-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_inotify.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_kvm_run.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_kvm_run-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_kvm_run_auxstr_vcpu.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_loop.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_loop-nv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_loop-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_mtd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_nbd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_nsfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_perf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_ptp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_random.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_rtc.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_rtc-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_scsi.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_sg_io_v3.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_sg_io_v4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_sock_gifconf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_uffdio.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_v4l2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioperm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/iopl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ip_mreq.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msgbuf-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msgbuf-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msgbuf-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kcmp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kcmp-y.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kern_features.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kexec_file_load.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kexec_load.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kill.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lchown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lchown32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/link.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/linkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lookup_dcookie.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lstat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/madvise.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mbind.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/membarrier.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/migrate_pages.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mincore.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mkdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mkdirat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mknod.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mknodat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mlock.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mlock2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mlockall.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg-silent.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg_name.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg_name-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/modify_ldt.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq_sendrecv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq_sendrecv-read.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq_sendrecv-write.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/msg_control.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/msg_control-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/msg_name.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/munlockall.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nanosleep.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-icmp_filter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-sockaddr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-tpacket_req.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-tpacket_stats.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-yy-inet6.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_audit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_crypto.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_generic.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_kobject_uevent.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_netfilter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_protocol.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_route.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_selinux.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_xfrm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/newfstatat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_acct.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_cthelper.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ctnetlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ctnetlink_exp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_cttimeout.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ipset.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_nft_compat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_nftables.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_osf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_queue.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ulog.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_br_port_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_crypto_user_alg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_dcbmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_fib_rule_hdr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifaddrlblmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifaddrmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifinfomsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_af_spec.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_brport.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_linkinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_port.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_xdp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_inet_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_inet_diag_req_compat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_inet_diag_req_v2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_mdba_mdb_entry.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_mdba_router_port.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ndmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ndtmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_netconfmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_netlink_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_nlmsgerr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_packet_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_rtgenmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_rtmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_smc_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tc_stats.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tca_stab.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tcamsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tcmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_unix_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-v-none.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldfstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldlstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect-efault.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect-efault-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/open.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/openat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/orphaned_process_group.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/osf_utimes.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pause.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/perf_event_open.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/perf_event_open_nonverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/perf_event_open_unabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/personality-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/personality-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/personality-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pidfd_send_signal.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pipe2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pkey_alloc.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pkey_free.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pkey_mprotect.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ppoll.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ppoll-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ppoll-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pread64-pwrite64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/preadv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/preadv-pwritev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/preadv2-pwritev2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printpath-umovestr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printpath-umovestr-peekdata.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printpath-umovestr-undumpable.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printsignal-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printsignal-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printsignal-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstrn-umoven.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstrn-umoven-peekdata.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstrn-umoven-undumpable.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/prlimit64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/process_vm_readv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/process_vm_writev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pselect6.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ptrace.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ptrace_syscall_info.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pwritev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-xfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-xfs-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/read-write.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readahead.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readlinkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/reboot.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/recvfrom.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/recvmmsg-timeout.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/recvmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/regex.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rename.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/renameat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/renameat2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/request_key.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/riscv_flush_icache.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rmdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigpending.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigprocmask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigqueueinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigreturn.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigsuspend.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigtimedwait.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_tgsigqueueinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_guarded_storage.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_guarded_storage-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_pci_mmio_read_write.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_runtime_instr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_sthyi.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_sthyi-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_get_priority_mxx.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_rr_get_interval.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetaffinity.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetattr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetparam.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetscheduler.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_yield.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/seccomp-filter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/seccomp-filter-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/seccomp_get_action_avail.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/select.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/select-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/semop.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sendfile.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sendfile64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/set_mempolicy.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setdomainname.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgroups.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgroups32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sethostname.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setns.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setregid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setregid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setreuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setreuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/shmxt.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/shutdown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigaction.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/siginfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/signal.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/signal_receive.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/signalfd4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigpending.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigprocmask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigreturn.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigsuspend.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_error.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_linger.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockaddr_xlat-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockaddr_xlat-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockaddr_xlat-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/socketcall.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockopt-sol_netlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockopt-timestamp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/splice.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/stat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/stat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/statfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/statfs64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/statx.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/swap.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sxetmask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/symlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/symlinkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sync.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sync_file_range.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sync_file_range2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sysinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/syslog.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/tee.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/time.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/timer_create.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/timer_xettime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/timerfd_xettime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/times.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/times-fail.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_fstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_fstatfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_lstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_regex_32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_regex_64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_regex_x32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_x32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_question.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_stat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_stat_like.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_statfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_statfs_like.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/truncate.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/truncate64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ugetrlimit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umoven-illptr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umovestr-illptr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umovestr3.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/unlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/unlinkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/unshare.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/userfaultfd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ustat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimes.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/vfork-f.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/vhangup.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/vmsplice.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/wait4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/wait4-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/waitid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/waitid-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/waitpid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xattr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xattr-strings.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xet_robust_list.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xetitimer.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xetpgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xetpriority.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xettimeofday.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ diff --git a/tests-mx32/gen_tests.in b/tests-mx32/gen_tests.in new file mode 100644 index 00000000..487b9608 --- /dev/null +++ b/tests-mx32/gen_tests.in @@ -0,0 +1,531 @@ +# Input for gen_tests.sh +# +# Copyright (c) 2017-2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +_newselect +_newselect-P -e trace=_newselect -P /dev/full 9>>/dev/full +accept -a22 +accept4 -a37 +access -a30 -P access_sample +acct -a20 +add_key -a30 -s12 +adjtimex -a15 +aio -a14 -e trace=io_setup,io_submit,io_getevents,io_cancel,io_destroy +aio_pgetevents -e trace=io_pgetevents +alarm -a10 +bpf -a20 +bpf-obj_get_info_by_fd -a20 -y -e trace=bpf +bpf-obj_get_info_by_fd-prog -a20 -y -e trace=bpf +bpf-obj_get_info_by_fd-prog-v -a20 -y -v -e trace=bpf +bpf-obj_get_info_by_fd-v -a20 -y -v -e trace=bpf +bpf-v -a20 -v -e trace=bpf +btrfs +ioctl.test +chmod -a28 +chown -a28 +chown32 -a31 +chroot -a24 +clock test_trace_expr 'times|fcntl.*' -e/clock +clock_adjtime -a37 +clock_nanosleep -e trace=clock_nanosleep,clock_gettime +clock_xettime -a36 -e trace=clock_getres,clock_gettime,clock_settime +copy_file_range +creat -a20 +delete_module -a23 +dev-yy -a30 -e trace=openat,fsync -P "/dev/full" -P "/dev/zero" -P "/dev/sda" -yy +dup -a8 +dup2 -a13 +dup3 -a24 +epoll_create -a17 +epoll_create1 -a28 +epoll_ctl +epoll_pwait +epoll_wait -a26 +erestartsys -a34 -e signal=none -e trace=recvfrom +execveat +execveat-v -v -e trace=execveat +faccessat -P $NAME.sample +fadvise64_64 +fadvise64.test +fallocate -a18 +fanotify_init +fanotify_mark -a32 +fanotify_mark-Xabbrev -a32 -Xabbrev -e trace=fanotify_mark +fanotify_mark-Xraw -a32 -Xraw -e trace=fanotify_mark +fanotify_mark-Xverbose -a32 -Xverbose -e trace=fanotify_mark +fchdir -a11 +fchmod -a15 +fchmodat +fchown -a16 +fchown32 -a18 +fchownat +fcntl -a8 +fcntl64 -a8 +fdatasync -a14 +file_handle -e trace=name_to_handle_at,open_by_handle_at +file_ioctl +ioctl.test +finit_module -a25 +flock -a19 +fork-f -a26 -qq -f -e signal=none -e trace=chdir +fstat -a15 -v -P stat.sample +fstat-Xabbrev -a15 -v -Xabbrev -P stat.sample -e trace=fstat +fstat-Xraw -a15 -v -Xraw -P stat.sample -e trace=fstat +fstat-Xverbose -a15 -v -Xverbose -P stat.sample -e trace=fstat +fstat64 -a17 -v -P stat.sample +fstat64-Xabbrev -a17 -Xabbrev -v -P stat.sample -e trace=fstat64 +fstat64-Xraw -a17 -Xraw -v -P stat.sample -e trace=fstat64 +fstat64-Xverbose -a17 -Xverbose -v -P stat.sample -e trace=fstat64 +fstatat64 -a32 -v -P stat.sample -P /dev/full +fstatfs -a18 +fstatfs64 -a24 +fsync -a10 +fsync-y -y -e trace=fsync +ftruncate -a24 +ftruncate64 -a36 +futimesat -a28 +get_mempolicy -s3 -a38 +getcpu -a25 +getcwd -a18 +getdents -a22 -v +getdents64 -a24 -v +getegid +getuid.test +getegid32 +getuid.test +geteuid +getuid.test +geteuid32 +getuid.test +getgid +getuid.test +getgid32 +getuid.test +getgroups -a17 +getgroups32 -a19 +getpeername -a27 +getpgrp -a10 +getpid -a9 +getppid -a10 +getrandom -a32 -s3 +getresgid -a25 +getresgid32 -a27 +getresuid -a25 +getresuid32 -a27 +getrlimit -a27 +getrusage -v +getsid -a10 +getsockname -a27 +gettid -a9 +getuid32 +getuid.test +getxxid -a10 -e trace=getxpid,getxuid,getxgid +group_req -e trace=setsockopt +inet-cmsg -e trace=recvmsg +init_module -a27 +inotify -a23 -e trace=inotify_add_watch,inotify_rm_watch +inotify_init1 -a27 +io_uring_enter -y +io_uring_register -y +io_uring_setup -a26 -y +ioctl_block +ioctl.test +ioctl_dm +ioctl.test -s9 +ioctl_dm-v +ioctl.test -v -s9 +ioctl_evdev +ioctl.test +ioctl_evdev-v +ioctl.test -v +ioctl_inotify +ioctl.test +ioctl_kvm_run +ioctl.test -a36 -y +ioctl_kvm_run-v +ioctl.test -v -a36 -y +ioctl_kvm_run_auxstr_vcpu +ioctl.test -a36 -y -e kvm=vcpu +ioctl_loop +ioctl.test +ioctl_loop-nv +ioctl.test -a22 -e verbose=none +ioctl_loop-v +ioctl.test -v +ioctl_mtd +ioctl.test +ioctl_nbd +ioctl.test -y +ioctl_nsfs +ioctl.test -esignal=none +ioctl_perf +ioctl.test +ioctl_ptp +ioctl.test +ioctl_random +ioctl.test +ioctl_rtc +ioctl.test +ioctl_rtc-v +ioctl.test -v +ioctl_scsi +ioctl.test +ioctl_sg_io_v3 +ioctl.test +ioctl_sg_io_v4 +ioctl.test +ioctl_sock_gifconf +ioctl.test -a28 -s1 +ioctl_uffdio +ioctl.test +ioctl_v4l2 +ioctl.test +ioperm -a27 +iopl -a8 +ioprio -a18 -e trace=ioprio_get,ioprio_set +ioprio-Xabbrev -a18 -e trace=ioprio_get,ioprio_set -Xabbrev +ioprio-Xraw -a18 -e trace=ioprio_get,ioprio_set -Xraw +ioprio-Xverbose -a18 -e trace=ioprio_get,ioprio_set -Xverbose +ip_mreq -e trace=setsockopt +ipc -a19 +ipc_msg +ipc.sh -a26 +ipc_msg-Xabbrev +ipc.sh -Xabbrev -a26 +ipc_msg-Xraw +ipc.sh -Xraw -a16 +ipc_msg-Xverbose +ipc.sh -Xverbose -a34 +ipc_msgbuf-Xabbrev +ipc_msgbuf.test -Xabbrev +ipc_msgbuf-Xraw +ipc_msgbuf.test -Xraw -a22 +ipc_msgbuf-Xverbose +ipc_msgbuf.test -Xverbose +ipc_sem +ipc.sh -a29 +ipc_sem-Xabbrev +ipc.sh -Xabbrev -a29 +ipc_sem-Xraw +ipc.sh -Xraw -a19 +ipc_sem-Xverbose +ipc.sh -Xverbose -a36 +ipc_shm +ipc.sh -a29 +ipc_shm-Xabbrev +ipc.sh -Xabbrev -a29 +ipc_shm-Xraw +ipc.sh -Xraw -a19 +ipc_shm-Xverbose +ipc.sh -Xverbose -a36 +kcmp -a22 +kcmp-y -a22 -y -e trace=kcmp +kern_features -a16 +kernel_version -a16 -v -e trace=bpf +kernel_version-Xabbrev -a16 -Xabbrev -v -e trace=bpf +kernel_version-Xraw -a16 -Xraw -v -e trace=bpf +kernel_version-Xverbose -a16 -Xverbose -v -e trace=bpf +kexec_file_load -s9 +kexec_load -s9 +keyctl -a31 -s10 +keyctl-Xabbrev -a31 -s10 -e trace=keyctl -Xabbrev +keyctl-Xraw -a13 -s10 -e trace=keyctl -Xraw +keyctl-Xverbose -a41 -s10 -e trace=keyctl -Xverbose +kill -a12 -esignal=none +lchown -a30 +lchown32 -a32 +link +linkat +lookup_dcookie -a27 +lstat -a32 -v -P stat.sample -P /dev/full +lstat64 -a32 -v -P stat.sample -P /dev/full +madvise -a33 +mbind +membarrier -a36 +memfd_create +memfd_create-Xabbrev -Xabbrev -e trace=memfd_create +memfd_create-Xraw -a30 -Xraw -e trace=memfd_create +memfd_create-Xverbose -Xverbose -e trace=memfd_create +migrate_pages -a33 +mincore -a22 +mkdir -a20 +mkdirat -a28 +mknod -a18 +mknodat -a35 +mlock -a20 -e trace=mlock,munlock +mlock2 +mlockall -a12 +mmap-Xabbrev +mmap.test abbrev +mmap-Xraw +mmap.test raw 14 +mmap-Xverbose +mmap.test verbose +mmap64 +mmap.test +mmap64-Xabbrev +mmap.test abbrev +mmap64-Xraw +mmap.test raw 14 +mmap64-Xverbose +mmap.test verbose +mmsg -e read=0 -e write=1 -e trace=recvmmsg,sendmmsg +mmsg-silent -a25 -e verbose=none -e trace=sendmmsg,recvmmsg +mmsg_name -a25 -e trace=sendmmsg,recvmmsg +mmsg_name-v -v -a25 -e trace=sendmmsg,recvmmsg +modify_ldt -a23 +mount -a33 +mount-Xabbrev -a33 -e trace=mount -Xabbrev +mount-Xraw -a33 -e trace=mount -Xraw +mount-Xverbose -a33 -e trace=mount -Xverbose +move_pages -s3 +move_pages-Xabbrev -s3 -e trace=move_pages -Xabbrev +move_pages-Xraw -s3 -a36 -e trace=move_pages -Xraw +move_pages-Xverbose -s3 -e trace=move_pages -Xverbose +mq -a32 -e trace=mq_getsetattr,mq_open,mq_unlink +mq_sendrecv -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink +mq_sendrecv-read -eread=0 -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink +mq_sendrecv-write -ewrite=0 -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink +msg_control -a21 -e trace=sendmsg +msg_control-v -v -a21 -e trace=sendmsg +msg_name -a20 -e trace=recvmsg +munlockall -a13 +nanosleep -a20 +net-icmp_filter -e trace=getsockopt,setsockopt +net-packet_mreq -e trace=setsockopt +net-packet_mreq-Xabbrev -e trace=setsockopt -Xabbrev +net-packet_mreq-Xraw -e trace=setsockopt -Xraw +net-packet_mreq-Xverbose -e trace=setsockopt -Xverbose +net-sockaddr -a24 -e trace=connect +net-tpacket_req -e trace=setsockopt +net-tpacket_stats -e trace=getsockopt +net-yy-inet6 +net-yy-inet.test +netlink_audit +netlink_sock_diag.test +netlink_crypto +netlink_sock_diag.test +netlink_generic +netlink_sock_diag.test +netlink_kobject_uevent +netlink_sock_diag.test +netlink_netfilter +netlink_sock_diag.test +netlink_protocol -e trace=sendto +netlink_route +netlink_sock_diag.test +netlink_selinux +netlink_sock_diag.test +netlink_xfrm +netlink_sock_diag.test +newfstatat -a32 -v -P stat.sample -P /dev/full +nfnetlink_acct +netlink_sock_diag.test +nfnetlink_cthelper +netlink_sock_diag.test +nfnetlink_ctnetlink +netlink_sock_diag.test +nfnetlink_ctnetlink_exp +netlink_sock_diag.test +nfnetlink_cttimeout +netlink_sock_diag.test +nfnetlink_ipset +netlink_sock_diag.test +nfnetlink_nft_compat +netlink_sock_diag.test +nfnetlink_nftables +netlink_sock_diag.test +nfnetlink_osf +netlink_sock_diag.test +nfnetlink_queue +netlink_sock_diag.test +nfnetlink_ulog +netlink_sock_diag.test +nlattr +netlink_sock_diag.test +nlattr_br_port_msg +netlink_sock_diag.test +nlattr_crypto_user_alg +netlink_sock_diag.test +nlattr_dcbmsg +netlink_sock_diag.test +nlattr_fib_rule_hdr +netlink_sock_diag.test +nlattr_ifaddrlblmsg +netlink_sock_diag.test +nlattr_ifaddrmsg +netlink_sock_diag.test +nlattr_ifinfomsg +netlink_sock_diag.test +nlattr_ifla_af_spec +netlink_sock_diag.test +nlattr_ifla_brport +netlink_sock_diag.test +nlattr_ifla_linkinfo +netlink_sock_diag.test +nlattr_ifla_port +netlink_sock_diag.test +nlattr_ifla_xdp +netlink_sock_diag.test +nlattr_inet_diag_msg +netlink_sock_diag.test +nlattr_inet_diag_req_compat +netlink_sock_diag.test +nlattr_inet_diag_req_v2 +netlink_sock_diag.test +nlattr_mdba_mdb_entry +netlink_sock_diag.test +nlattr_mdba_router_port +netlink_sock_diag.test +nlattr_ndmsg +netlink_sock_diag.test +nlattr_ndtmsg +netlink_sock_diag.test +nlattr_netconfmsg +netlink_sock_diag.test +nlattr_netlink_diag_msg +netlink_sock_diag.test +nlattr_nlmsgerr +netlink_sock_diag.test +nlattr_packet_diag_msg +netlink_sock_diag-v.sh +nlattr_rtgenmsg +netlink_sock_diag.test +nlattr_rtmsg +netlink_sock_diag.test +nlattr_smc_diag_msg +netlink_sock_diag.test +nlattr_tc_stats +netlink_sock_diag.test +nlattr_tca_stab +netlink_sock_diag.test +nlattr_tcamsg +netlink_sock_diag.test +nlattr_tcmsg +netlink_sock_diag.test +nlattr_unix_diag_msg +netlink_sock_diag.test +old_mmap -a11 -e trace=mmap +old_mmap-P -e trace=mmap -P "/dev/full" 9>>/dev/full +old_mmap-Xabbrev -a11 -e trace=mmap -Xabbrev +old_mmap-Xraw -a11 -e trace=mmap -Xraw +old_mmap-Xverbose -a11 -e trace=mmap -Xverbose +old_mmap-v-none -a11 -e trace=mmap -e verbose=none +oldfstat -a18 -v -P stat.sample +oldlstat -a32 -v -P stat.sample -P /dev/full +oldselect -a13 -e trace=select +oldselect-P -a13 -e trace=select -P /dev/full 9>>/dev/full +oldselect-efault -a13 -e trace=select +oldselect-efault-P -a13 -e trace=select -P /dev/full 9>>/dev/full +oldstat -a32 -v -P stat.sample -P /dev/full +open -a30 -P $NAME.sample +openat -a36 -P $NAME.sample +orphaned_process_group . "${srcdir=.}/PTRACE_SEIZE.sh"; run_strace_match_diff -f -e trace=none -e signal='!chld' +osf_utimes -a21 +pause -a8 -esignal=none +perf_event_open -a1 +perf_event_open_nonverbose -a34 -e verbose=none -e trace=perf_event_open +perf_event_open_unabbrev -a1 -v -e trace=perf_event_open +personality-Xabbrev +personality.test -Xabbrev +personality-Xraw +personality.test -a15 -Xraw +personality-Xverbose +personality.test -Xverbose +pidfd_send_signal +pipe2 -a15 +pkey_alloc -a17 +pkey_free -a13 +pkey_mprotect -a37 +ppoll -s2 +ppoll-P -s2 -e trace=ppoll -P /dev/full 9>>/dev/full +ppoll-v -v -s2 -e trace=ppoll +pread64-pwrite64 -a21 -eread=0 -ewrite=1 -e trace=pread64,pwrite64 -P pread64-pwrite64-tmpfile -P /dev/zero -P /dev/null +preadv -a21 +preadv-pwritev -a19 -eread=0 -ewrite=1 -e trace=preadv,pwritev +preadv2-pwritev2 -a22 -eread=0 -ewrite=1 -e trace=preadv2,pwritev2 +printpath-umovestr -a11 -e signal=none -e trace=chdir +printpath-umovestr-peekdata -a11 -e signal=none -e trace=chdir +printpath-umovestr-undumpable -a11 -e signal=none -e trace=chdir +printsignal-Xabbrev -a11 -Xabbrev -e signal=none -e trace=kill +printsignal-Xraw -a11 -Xraw -e signal=none -e trace=kill +printsignal-Xverbose -a11 -Xverbose -e signal=none -e trace=kill +printstr -e trace=writev +printstrn-umoven -s4096 -e signal=none -e trace=add_key +printstrn-umoven-peekdata -e signal=none -e trace=add_key +printstrn-umoven-undumpable -e signal=none -e trace=add_key +prlimit64 +process_vm_readv -s5 -a37 +process_vm_writev -s5 -a38 +pselect6 +ptrace -a23 -e signal=none +ptrace_syscall_info -a35 -e signal=none -e trace=ptrace +pwritev -a22 -s7 +quotactl +quotactl-Xabbrev -Xabbrev -e trace=quotactl +quotactl-Xraw -a27 -Xraw -e trace=quotactl +quotactl-Xverbose -Xverbose -e trace=quotactl +quotactl-v -v -e trace=quotactl +quotactl-xfs -e trace=quotactl +quotactl-xfs-v -v -e trace=quotactl +read-write -a15 -eread=0,5 -ewrite=1,4 -e trace=read,write -P read-write-tmpfile -P /dev/zero -P /dev/null +readahead -a1 +readdir -a16 +readlink -xx +readlinkat -xx +reboot -s 256 +recvfrom -a35 +recvmmsg-timeout -a25 -e trace=recvmmsg +recvmsg -eread=0 -ewrite=1 -e trace=recvmsg,sendmsg +regex test_trace_expr '' -etrace='/^(.*_)?statv?fs' +remap_file_pages +remap_file_pages-Xabbrev -Xabbrev -e trace=remap_file_pages +remap_file_pages-Xraw -Xraw -e trace=remap_file_pages +remap_file_pages-Xverbose -Xverbose -e trace=remap_file_pages +rename -a35 +renameat +renameat2 +request_key -a33 -s12 +riscv_flush_icache -a34 +rmdir -a22 +rt_sigpending -a20 +rt_sigprocmask +rt_sigqueueinfo -esignal=none +rt_sigreturn -esignal='!USR1' +rt_sigsuspend -a20 -esignal=none +rt_sigtimedwait -a38 +rt_tgsigqueueinfo -esignal=none +s390_guarded_storage -a32 +s390_guarded_storage-v -e trace=s390_guarded_storage -a32 -v +s390_pci_mmio_read_write -e trace=s390_pci_mmio_read,s390_pci_mmio_write -a30 +s390_runtime_instr -a44 +s390_sthyi -a47 +s390_sthyi-v -e trace=s390_sthyi -a47 -v +sched test_trace_expr times -e/sched +sched_get_priority_mxx -a33 -e trace=sched_get_priority_min,sched_get_priority_max +sched_rr_get_interval -a31 +sched_xetaffinity -a28 -e trace=sched_getaffinity,sched_setaffinity +sched_xetattr -a29 -e trace=sched_getattr,sched_setattr +sched_xetparam -a23 -e trace=sched_getparam,sched_setparam +sched_xetscheduler -a22 -e trace=sched_getscheduler,sched_setscheduler +sched_yield -a14 +seccomp-filter -e trace=seccomp +seccomp-filter-v -v -e trace=seccomp +seccomp_get_action_avail -e trace=seccomp +select -a36 +select-P -a36 -e trace=select -P /dev/full 9>>/dev/full +semop -a32 -e trace=semop,semtimedop +sendfile -a27 +sendfile64 -a29 +set_mempolicy -s3 -a35 +setdomainname -a24 +setfsgid -a12 +setfsgid32 -a14 +setfsuid -a12 +setfsuid32 -a14 +setgid -a10 +setgid32 -a12 +setgroups -s2 -a17 +setgroups32 -s2 -a19 +sethostname -a22 +setns -a21 +setregid -a15 +setregid32 -a17 +setresgid -a19 +setresgid32 -a21 +setresuid -a19 +setresuid32 -a21 +setreuid -a15 +setreuid32 -a17 +setrlimit -a27 +setrlimit-Xabbrev -a27 -e trace=setrlimit -Xabbrev +setrlimit-Xraw -a19 -e trace=setrlimit -Xraw +setrlimit-Xverbose -a36 -e trace=setrlimit -Xverbose +setuid -a10 +setuid32 -a12 +shmxt -a11 -e trace='/(osf_)?shmat,shmdt' +shutdown -a24 +sigaction -a31 +siginfo -e trace=none +signal -a25 -e signal=none -e trace='/^signal$' +signal_receive -a16 -e trace=kill +signalfd4 +sigpending -a15 +sigprocmask -a34 +sigreturn -esignal='!USR1' +sigsuspend -a19 -esignal=none +so_error -e trace=getsockopt +so_linger -e trace=getsockopt,setsockopt +so_peercred -e trace=getsockopt +so_peercred-Xabbrev -e trace=getsockopt -Xabbrev +so_peercred-Xraw -e trace=getsockopt -Xraw -a39 +so_peercred-Xverbose -e trace=getsockopt -Xverbose +sock_filter-v -v -e trace=getsockopt,setsockopt +sock_filter-v-Xabbrev -v -e trace=getsockopt,setsockopt -X abbrev +sock_filter-v-Xraw -a 37 -v -e trace=getsockopt,setsockopt -X raw +sock_filter-v-Xverbose -v -e trace=getsockopt,setsockopt -X verbose +sockaddr_xlat-Xabbrev -Xabbrev -e trace=connect +sockaddr_xlat-Xraw -Xraw -e trace=connect +sockaddr_xlat-Xverbose -Xverbose -e trace=connect +socketcall -a20 +sockopt-sol_netlink -e trace=getsockopt,setsockopt +sockopt-timestamp -e trace=recvmsg +splice +stat -a32 -v -P stat.sample -P /dev/full +stat64 -a32 -v -P stat.sample -P /dev/full +statfs -a17 +statfs64 -a23 +statx -a32 -v -P stat.sample -P /dev/full +swap -a23 -e trace=swapon,swapoff +sxetmask -a11 -e trace=sgetmask,ssetmask +symlink -a34 +symlinkat +sync -a7 +sync_file_range +sync_file_range2 +sysinfo -a14 +syslog -a36 +tee +time -a10 +timer_create +timer_xettime -e trace=timer_create,timer_settime,timer_gettime +timerfd_xettime -e trace=timerfd_create,timerfd_settime,timerfd_gettime +times -esignal=none +times-fail -a12 -e trace=times +trace_fstat test_trace_expr '' -e%fstat -v -P stat.sample -P /dev/full +trace_fstatfs test_trace_expr '' -e%fstatfs +trace_lstat test_trace_expr '' -e%lstat -v -P stat.sample -P /dev/full +trace_personality_32 +qualify_personality.sh 32 'getcwd' 'fsync-y' +trace_personality_64 +qualify_personality.sh 64 'getcwd' 'fsync-y' +trace_personality_regex_32 +qualify_personality.sh 32 '/clock.*' 'times|fcntl.*' +trace_personality_regex_64 +qualify_personality.sh 64 '/clock.*' 'times|fcntl.*' +trace_personality_regex_x32 +qualify_personality.sh x32 '/clock.*' 'times|fcntl.*' +trace_personality_x32 +qualify_personality.sh x32 'getcwd' 'fsync-y' +trace_question test_trace_expr '' -e?osf_utimes,?/^pkey_.* +trace_stat test_trace_expr '' -e%stat -v -P stat.sample -P /dev/full +trace_stat_like test_trace_expr '' -e%%stat -v -P stat.sample -P /dev/full +trace_statfs test_trace_expr '' -e%statfs +trace_statfs_like test_trace_expr '' -e%%statfs +truncate +truncate64 +ugetrlimit -a28 +umask -a11 +umoven-illptr -a36 -e trace=nanosleep +umovestr-illptr -a11 -e trace=chdir +umovestr3 -a14 -e trace=chdir +unlink -a24 +unlinkat -a35 +unshare -a11 +userfaultfd -a38 +ustat -a33 +utime -a16 +utimensat -a33 +utimensat-Xabbrev -a33 -Xabbrev -e trace=utimensat +utimensat-Xraw -a29 -Xraw -e trace=utimensat +utimensat-Xverbose -a44 -Xverbose -e trace=utimensat +utimes -a17 +vfork-f -a26 -qq -f -e signal=none -e trace=chdir +vhangup -a10 +vmsplice -ewrite=1 +wait4 -esignal=none +wait4-v -v -e signal=none -e trace=wait4 +waitid -esignal=none +waitid-v -v -e signal=none -e trace=waitid +waitpid -a28 +xattr -a22 -e trace=getxattr,fgetxattr,lgetxattr,setxattr,fsetxattr,lsetxattr,listxattr,flistxattr,llistxattr,removexattr,fremovexattr,lremovexattr +xattr-strings -a22 -s 4 -e trace=fsetxattr +xet_robust_list -a24 -e trace=get_robust_list,set_robust_list +xetitimer -a29 -e trace=setitimer,getitimer +xetpgid -a11 -e trace=getpgid,setpgid +xetpriority -a29 -e trace=getpriority,setpriority +xettimeofday -a20 -e trace=gettimeofday,settimeofday diff --git a/tests-mx32/gen_tests.sh b/tests-mx32/gen_tests.sh new file mode 100755 index 00000000..35402042 --- /dev/null +++ b/tests-mx32/gen_tests.sh @@ -0,0 +1,92 @@ +#!/bin/sh -efu +# +# Copyright (c) 2017 Dmitry V. Levin +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +usage() +{ + cat >&2 < []] + +Generate test script(s) from table. +If a is specified, generate the script for this test only, +otherwise generate scripts for all tests specified in table. +EOF + exit 1 +} + +input="${0%/*}/gen_tests.in" +[ $# -eq 0 ] || { input="$1"; shift; } +output= +[ $# -eq 0 ] || { output="$1"; shift; } +[ $# -eq 0 ] || usage + +if [ -n "$output" ]; then + match="${output##*/}" + match="${match%.gen.test}" + [ -n "$match" ] || usage +else + match= + dir="$(dirname "$input")" +fi + +names= + +while read -r name arg0 args; do { + [ -n "${name###*}" ] || continue + if [ -z "$match" ]; then + names="$names $name" + output="$dir/$name.gen.test" + else + [ "$match" = "$name" ] || continue + fi + + hdr="\ +#!/bin/sh -efu +# Generated by $0 from $input ($name $arg0 $args); do not edit." + + case "$arg0" in + +*) + cat <<-EOF + $hdr + set -- $args + . "\${srcdir=.}/${arg0#+}" + EOF + ;; + + ''|-*) + cat <<-EOF + $hdr + . "\${srcdir=.}/init.sh" + run_strace_match_diff $arg0 $args + EOF + ;; + + *) + cat <<-EOF + $hdr + . "\${srcdir=.}/init.sh" + $arg0 $args + EOF + ;; + esac > "$output" + + chmod a+x "$output" +} < /dev/null; done < "$input" + +if [ -n "$names" ]; then + { + printf '# Generated by %s from %s; do not edit.\n' "$0" "$input" + printf 'GEN_TESTS =' + printf ' %s.gen.test' $names + echo + target='$(srcdir)/%s.gen.test' + dep1='$(abs_srcdir)/gen_tests.sh' + dep2='$(srcdir)/gen_tests.in' + recipe='$(AM_V_GEN) $^ $@' + printf "\\n$target: $dep1 $dep2\\n\\t$recipe\\n" $names + } > "$dir/gen_tests.am" +fi diff --git a/tests-mx32/get_mempolicy.c b/tests-mx32/get_mempolicy.c index 03d1bffc..7667bdb0 100644 --- a/tests-mx32/get_mempolicy.c +++ b/tests-mx32/get_mempolicy.c @@ -1,30 +1,10 @@ /* * Check decoding of get_mempolicy syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/get_mempolicy.gen.test b/tests-mx32/get_mempolicy.gen.test new file mode 100755 index 00000000..ec6efb30 --- /dev/null +++ b/tests-mx32/get_mempolicy.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (get_mempolicy -s3 -a38); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 -a38 diff --git a/tests-mx32/get_mempolicy.test b/tests-mx32/get_mempolicy.test deleted file mode 100755 index 92270970..00000000 --- a/tests-mx32/get_mempolicy.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check get_mempolicy syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s3 -a38 diff --git a/tests-mx32/get_page_size.c b/tests-mx32/get_page_size.c index aeea861c..12ee929d 100644 --- a/tests-mx32/get_page_size.c +++ b/tests-mx32/get_page_size.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/get_regs.test b/tests-mx32/get_regs.test new file mode 100755 index 00000000..e7628d24 --- /dev/null +++ b/tests-mx32/get_regs.test @@ -0,0 +1,33 @@ +#!/bin/sh +# +# Check that get_regs is skipped for filtered syscalls. +# +# Copyright (c) 2017-2018 Dmitry V. Levin +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +check_prog env +check_prog grep +run_prog ../gettid > /dev/null + +run_strace -qq -esignal=none -eraw=all -etrace=none ../gettid > /dev/null + +run_strace -qq -esignal=none -eraw=all -eptrace -o '|grep -c ^ptrace > less' \ + -- "$STRACE_EXE" -o "$LOG" $args > /dev/null + +[ "$(cat less)" -gt 0 ] || + fail_ "$STRACE $args failed to catch any ptrace syscalls" + +run_strace -qq -esignal=none -eraw=all -etrace=all ../gettid > /dev/null + +run_strace -qq -esignal=none -eraw=all -eptrace -o '|grep -c ^ptrace > more' \ + -- "$STRACE_EXE" -o "$LOG" $args > /dev/null + +[ "$(cat more)" -gt 0 ] || + fail_ "$STRACE $args failed to catch any ptrace syscalls" + +[ "$(cat more)" -gt "$(cat less)" ] || + fail_ "$STRACE failed to skip get_regs for filtered syscalls" diff --git a/tests-mx32/get_sigset_size.c b/tests-mx32/get_sigset_size.c new file mode 100644 index 00000000..f58d1f51 --- /dev/null +++ b/tests-mx32/get_sigset_size.c @@ -0,0 +1,46 @@ +/* + * Find out the size of kernel's sigset_t. + * + * Copyright (c) 2016-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +/* + * If the sigset size specified to rt_sigprocmask is not equal to the size + * of kernel's sigset_t, the kernel does not look at anything else and fails + * with EINVAL. + * + * Otherwise, if both pointers specified to rt_sigprocmask are NULL, + * the kernel just returns 0. + * + * This vaguely documented kernel feature can be used to probe + * the kernel and find out the size of kernel's sigset_t. + */ + +unsigned int +get_sigset_size(void) +{ + static unsigned int set_size; + + if (!set_size) { + static const unsigned int big_size = 1024 / 8; + + for (set_size = big_size; set_size; set_size >>= 1) { + if (!syscall(__NR_rt_sigprocmask, SIG_SETMASK, + NULL, NULL, set_size)) + break; + } + + if (!set_size) + perror_msg_and_fail("rt_sigprocmask"); + } + + return set_size; +} diff --git a/tests-mx32/getcpu.c b/tests-mx32/getcpu.c index ec671f1e..ecbaf0dc 100644 --- a/tests-mx32/getcpu.c +++ b/tests-mx32/getcpu.c @@ -2,29 +2,10 @@ * Check decoding of getcpu syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,16 +21,16 @@ int main(void) { unsigned *bogus_cpu = - (unsigned *) tail_alloc(sizeof(* bogus_cpu)) + 1; + (unsigned *) tail_alloc(sizeof(*bogus_cpu)) + 1; unsigned *bogus_node = - (unsigned *) tail_alloc(sizeof(* bogus_node)) + 1; + (unsigned *) tail_alloc(sizeof(*bogus_node)) + 1; unsigned *bogus_tcache = - (unsigned *) tail_alloc(sizeof(* bogus_tcache)) + 1; + (unsigned *) tail_alloc(sizeof(*bogus_tcache)) + 1; long res; - unsigned *cpu = tail_alloc(sizeof(*cpu)); - unsigned *node = tail_alloc(sizeof(*node)); - long * tcache = tail_alloc(128); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned, cpu); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned, node); + long *tcache = tail_alloc(128); res = syscall(__NR_getcpu, NULL, NULL, NULL); printf("getcpu(NULL, NULL, NULL) = %s\n", sprintrc(res)); diff --git a/tests-mx32/getcpu.gen.test b/tests-mx32/getcpu.gen.test new file mode 100755 index 00000000..ae38aaa0 --- /dev/null +++ b/tests-mx32/getcpu.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getcpu -a25 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests-mx32/getcpu.test b/tests-mx32/getcpu.test deleted file mode 100755 index fe212658..00000000 --- a/tests-mx32/getcpu.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of getcpu syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a25 diff --git a/tests-mx32/getcwd.c b/tests-mx32/getcwd.c index 707c25c9..5f9a7293 100644 --- a/tests-mx32/getcwd.c +++ b/tests-mx32/getcwd.c @@ -1,12 +1,19 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #ifdef __NR_getcwd +# include # include # include -# include int main(void) @@ -20,9 +27,9 @@ main(void) if (res <= 0) perror_msg_and_fail("getcwd"); - printf("getcwd(\""); + printf("getcwd("); print_quoted_string(cur_dir); - printf("\", %zu) = %ld\n", sizeof(cur_dir), res); + printf(", %zu) = %ld\n", sizeof(cur_dir), res); res = syscall(__NR_getcwd, cur_dir, 0); printf("getcwd(%p, 0) = %s\n", cur_dir, sprintrc(res)); diff --git a/tests-mx32/getcwd.gen.test b/tests-mx32/getcwd.gen.test new file mode 100755 index 00000000..f783a5b1 --- /dev/null +++ b/tests-mx32/getcwd.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getcwd -a18 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests-mx32/getcwd.test b/tests-mx32/getcwd.test deleted file mode 100755 index 405187e5..00000000 --- a/tests-mx32/getcwd.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getcwd syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a18 diff --git a/tests-mx32/getdents.c b/tests-mx32/getdents.c index b787c837..998e667f 100644 --- a/tests-mx32/getdents.c +++ b/tests-mx32/getdents.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -92,12 +73,10 @@ print_dirent(const kernel_dirent *d) } int -main(int ac, const char **av) +main(void) { - char *dname; + static const char dname[] = "getdents.test.tmp.dir"; - assert(ac == 1); - assert(asprintf(&dname, "%s.test.tmp.dir", av[0]) > 0); assert(!mkdir(dname, 0700)); assert(!chdir(dname)); (void) close(0); diff --git a/tests-mx32/getdents.gen.test b/tests-mx32/getdents.gen.test new file mode 100755 index 00000000..0db5f20a --- /dev/null +++ b/tests-mx32/getdents.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getdents -a22 -v); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -v diff --git a/tests-mx32/getdents.test b/tests-mx32/getdents.test deleted file mode 100755 index 23c4ac3a..00000000 --- a/tests-mx32/getdents.test +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -# Check getdents syscall decoding. - -. "${srcdir=.}/init.sh" - -rm -rf -- "$LOG".dir -run_strace_match_diff -a22 -v diff --git a/tests-mx32/getdents64.c b/tests-mx32/getdents64.c index 9da2a23c..e0575cf4 100644 --- a/tests-mx32/getdents64.c +++ b/tests-mx32/getdents64.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -98,12 +79,10 @@ print_dirent(const kernel_dirent64 *d) } int -main(int ac, const char **av) +main(void) { - char *dname; + static const char dname[] = "getdents64.test.tmp.dir"; - assert(ac == 1); - assert(asprintf(&dname, "%s.test.tmp.dir", av[0]) > 0); assert(!mkdir(dname, 0700)); assert(!chdir(dname)); (void) close(0); diff --git a/tests-mx32/getdents64.gen.test b/tests-mx32/getdents64.gen.test new file mode 100755 index 00000000..6e24d400 --- /dev/null +++ b/tests-mx32/getdents64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getdents64 -a24 -v); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 -v diff --git a/tests-mx32/getdents64.test b/tests-mx32/getdents64.test deleted file mode 100755 index 401cfc7c..00000000 --- a/tests-mx32/getdents64.test +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -# Check getdents64 syscall decoding. - -. "${srcdir=.}/init.sh" - -rm -rf -- "$LOG".dir -run_strace_match_diff -a24 -v diff --git a/tests-mx32/getegid.c b/tests-mx32/getegid.c index 98f8b9cb..2e0754b7 100644 --- a/tests-mx32/getegid.c +++ b/tests-mx32/getegid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/getegid.gen.test b/tests-mx32/getegid.gen.test new file mode 100755 index 00000000..ddf8fa9a --- /dev/null +++ b/tests-mx32/getegid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getegid +getuid.test ); do not edit. +set -- +. "${srcdir=.}/getuid.test" diff --git a/tests-mx32/getegid.test b/tests-mx32/getegid.test deleted file mode 100755 index 4354158b..00000000 --- a/tests-mx32/getegid.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check getegid syscall decoding. - -. "${srcdir=.}/getuid.test" diff --git a/tests-mx32/getegid32.c b/tests-mx32/getegid32.c index d9951864..b7f5cb08 100644 --- a/tests-mx32/getegid32.c +++ b/tests-mx32/getegid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/getegid32.gen.test b/tests-mx32/getegid32.gen.test new file mode 100755 index 00000000..a773f56a --- /dev/null +++ b/tests-mx32/getegid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getegid32 +getuid.test ); do not edit. +set -- +. "${srcdir=.}/getuid.test" diff --git a/tests-mx32/getegid32.test b/tests-mx32/getegid32.test deleted file mode 100755 index a266620e..00000000 --- a/tests-mx32/getegid32.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check getegid32 syscall decoding. - -. "${srcdir=.}/getuid.test" diff --git a/tests-mx32/geteuid.c b/tests-mx32/geteuid.c index ef8269f9..430df1c6 100644 --- a/tests-mx32/geteuid.c +++ b/tests-mx32/geteuid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/geteuid.gen.test b/tests-mx32/geteuid.gen.test new file mode 100755 index 00000000..c7da2aa9 --- /dev/null +++ b/tests-mx32/geteuid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (geteuid +getuid.test ); do not edit. +set -- +. "${srcdir=.}/getuid.test" diff --git a/tests-mx32/geteuid.test b/tests-mx32/geteuid.test deleted file mode 100755 index 14ff6a69..00000000 --- a/tests-mx32/geteuid.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check geteuid syscall decoding. - -. "${srcdir=.}/getuid.test" diff --git a/tests-mx32/geteuid32.c b/tests-mx32/geteuid32.c index 4341e46f..94174f32 100644 --- a/tests-mx32/geteuid32.c +++ b/tests-mx32/geteuid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/geteuid32.gen.test b/tests-mx32/geteuid32.gen.test new file mode 100755 index 00000000..75c3f12e --- /dev/null +++ b/tests-mx32/geteuid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (geteuid32 +getuid.test ); do not edit. +set -- +. "${srcdir=.}/getuid.test" diff --git a/tests-mx32/geteuid32.test b/tests-mx32/geteuid32.test deleted file mode 100755 index 9dd173d9..00000000 --- a/tests-mx32/geteuid32.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check geteuid32 syscall decoding. - -. "${srcdir=.}/getuid.test" diff --git a/tests-mx32/getgid.c b/tests-mx32/getgid.c index 2e060390..1bd70502 100644 --- a/tests-mx32/getgid.c +++ b/tests-mx32/getgid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/getgid.gen.test b/tests-mx32/getgid.gen.test new file mode 100755 index 00000000..fc6ac3bc --- /dev/null +++ b/tests-mx32/getgid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getgid +getuid.test ); do not edit. +set -- +. "${srcdir=.}/getuid.test" diff --git a/tests-mx32/getgid.test b/tests-mx32/getgid.test deleted file mode 100755 index f4f0c2e6..00000000 --- a/tests-mx32/getgid.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check getgid syscall decoding. - -. "${srcdir=.}/getuid.test" diff --git a/tests-mx32/getgid32.c b/tests-mx32/getgid32.c index 52e4d76a..c6859cf4 100644 --- a/tests-mx32/getgid32.c +++ b/tests-mx32/getgid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/getgid32.gen.test b/tests-mx32/getgid32.gen.test new file mode 100755 index 00000000..b3a87561 --- /dev/null +++ b/tests-mx32/getgid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getgid32 +getuid.test ); do not edit. +set -- +. "${srcdir=.}/getuid.test" diff --git a/tests-mx32/getgid32.test b/tests-mx32/getgid32.test deleted file mode 100755 index 3bc98d1a..00000000 --- a/tests-mx32/getgid32.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check getgid32 syscall decoding. - -. "${srcdir=.}/getuid.test" diff --git a/tests-mx32/getgroups.c b/tests-mx32/getgroups.c index 2617303f..36c095df 100644 --- a/tests-mx32/getgroups.c +++ b/tests-mx32/getgroups.c @@ -2,29 +2,10 @@ * Check decoding of getgroups/getgroups32 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifdef __NR_getgroups32 @@ -57,7 +38,7 @@ # include # include -#define MAX_STRLEN 32 +# define MAX_STRLEN 32 static long ngroups; static void @@ -91,7 +72,7 @@ main(void) if (ngroups < 0) perror_msg_and_fail(SYSCALL_NAME); - rc = syscall(SYSCALL_NR, (long) 0xffffffff00000000ULL, 0); + rc = syscall(SYSCALL_NR, F8ILL_KULONG_MASK, 0); printf("%s(0, NULL) = %ld\n", SYSCALL_NAME, rc); rc = syscall(SYSCALL_NR, -1U, 0); @@ -105,7 +86,7 @@ main(void) rc = syscall(SYSCALL_NR, ngroups_max, 0); printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, ngroups_max, sprintrc(rc)); - rc = syscall(SYSCALL_NR, (long) 0xffffffff00000000ULL | ngroups_max, 0); + rc = syscall(SYSCALL_NR, F8ILL_KULONG_MASK | ngroups_max, 0); printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, ngroups_max, sprintrc(rc)); /* check how the second argument is decoded */ diff --git a/tests-mx32/getgroups.gen.test b/tests-mx32/getgroups.gen.test new file mode 100755 index 00000000..ae196d05 --- /dev/null +++ b/tests-mx32/getgroups.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getgroups -a17 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-mx32/getgroups.test b/tests-mx32/getgroups.test deleted file mode 100755 index 2eb3056d..00000000 --- a/tests-mx32/getgroups.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getgroups syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a17 diff --git a/tests-mx32/getgroups32.c b/tests-mx32/getgroups32.c index d0a356de..d005792d 100644 --- a/tests-mx32/getgroups32.c +++ b/tests-mx32/getgroups32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/getgroups32.gen.test b/tests-mx32/getgroups32.gen.test new file mode 100755 index 00000000..54b71d5f --- /dev/null +++ b/tests-mx32/getgroups32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getgroups32 -a19 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests-mx32/getgroups32.test b/tests-mx32/getgroups32.test deleted file mode 100755 index 12a8bcc0..00000000 --- a/tests-mx32/getgroups32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getgroups32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a19 diff --git a/tests-mx32/getpeername.c b/tests-mx32/getpeername.c index c842acec..cdc9ef08 100644 --- a/tests-mx32/getpeername.c +++ b/tests-mx32/getpeername.c @@ -1,30 +1,10 @@ /* * Check decoding of getpeername syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #define TEST_SYSCALL_NAME getpeername diff --git a/tests-mx32/getpeername.gen.test b/tests-mx32/getpeername.gen.test new file mode 100755 index 00000000..020583ab --- /dev/null +++ b/tests-mx32/getpeername.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getpeername -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-mx32/getpeername.test b/tests-mx32/getpeername.test deleted file mode 100755 index 81f01bb1..00000000 --- a/tests-mx32/getpeername.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of getpeername syscall. - -. "${srcdir=.}/getsockname.test" diff --git a/tests-mx32/getpgrp.c b/tests-mx32/getpgrp.c index 8b9d0882..3d45f718 100644 --- a/tests-mx32/getpgrp.c +++ b/tests-mx32/getpgrp.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/getpgrp.gen.test b/tests-mx32/getpgrp.gen.test new file mode 100755 index 00000000..26989cdb --- /dev/null +++ b/tests-mx32/getpgrp.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getpgrp -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-mx32/getpgrp.test b/tests-mx32/getpgrp.test deleted file mode 100755 index e116bb51..00000000 --- a/tests-mx32/getpgrp.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getpgrp syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 diff --git a/tests-mx32/getpid.c b/tests-mx32/getpid.c new file mode 100644 index 00000000..5e88e052 --- /dev/null +++ b/tests-mx32/getpid.c @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_getpid + +# include +# include + +int +main(void) +{ + printf("getpid() = %ld\n", syscall(__NR_getpid)); + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getpid") + +#endif diff --git a/tests-mx32/getpid.gen.test b/tests-mx32/getpid.gen.test new file mode 100755 index 00000000..2a3eb1cf --- /dev/null +++ b/tests-mx32/getpid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getpid -a9 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a9 diff --git a/tests-mx32/getppid.c b/tests-mx32/getppid.c new file mode 100644 index 00000000..718d0691 --- /dev/null +++ b/tests-mx32/getppid.c @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_getppid + +# include +# include + +int +main(void) +{ + printf("getppid() = %ld\n", syscall(__NR_getppid)); + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getppid") + +#endif diff --git a/tests-mx32/getppid.gen.test b/tests-mx32/getppid.gen.test new file mode 100755 index 00000000..655b0b7d --- /dev/null +++ b/tests-mx32/getppid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getppid -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-mx32/getrandom.c b/tests-mx32/getrandom.c index de1a0874..eb6cdb1b 100644 --- a/tests-mx32/getrandom.c +++ b/tests-mx32/getrandom.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/getrandom.gen.test b/tests-mx32/getrandom.gen.test new file mode 100755 index 00000000..2f5b9891 --- /dev/null +++ b/tests-mx32/getrandom.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getrandom -a32 -s3); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -s3 diff --git a/tests-mx32/getrandom.test b/tests-mx32/getrandom.test deleted file mode 100755 index ad34048f..00000000 --- a/tests-mx32/getrandom.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getrandom syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a32 -s3 diff --git a/tests-mx32/getresgid.c b/tests-mx32/getresgid.c index b8c687b1..3ad2c190 100644 --- a/tests-mx32/getresgid.c +++ b/tests-mx32/getresgid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/getresgid.gen.test b/tests-mx32/getresgid.gen.test new file mode 100755 index 00000000..dc32c62c --- /dev/null +++ b/tests-mx32/getresgid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getresgid -a25 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests-mx32/getresgid.test b/tests-mx32/getresgid.test deleted file mode 100755 index 9f5186e8..00000000 --- a/tests-mx32/getresgid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getresgid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a25 diff --git a/tests-mx32/getresgid32.c b/tests-mx32/getresgid32.c index 71f11344..b78afaed 100644 --- a/tests-mx32/getresgid32.c +++ b/tests-mx32/getresgid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/getresgid32.gen.test b/tests-mx32/getresgid32.gen.test new file mode 100755 index 00000000..0ee28299 --- /dev/null +++ b/tests-mx32/getresgid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getresgid32 -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-mx32/getresgid32.test b/tests-mx32/getresgid32.test deleted file mode 100755 index a9798911..00000000 --- a/tests-mx32/getresgid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getresgid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests-mx32/getresugid.c b/tests-mx32/getresugid.c index 0ee721cf..b369f8f7 100644 --- a/tests-mx32/getresugid.c +++ b/tests-mx32/getresugid.c @@ -2,29 +2,10 @@ * Check decoding of getresuid/getresgid/getresuid32/getresgid32 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -34,9 +15,9 @@ int main(void) { - unsigned UGID_TYPE *const r = tail_alloc(sizeof(*r)); - unsigned UGID_TYPE *const e = tail_alloc(sizeof(*e)); - unsigned UGID_TYPE *const s = tail_alloc(sizeof(*s)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned UGID_TYPE, r); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned UGID_TYPE, e); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned UGID_TYPE, s); if (syscall(SYSCALL_NR, r, e, s)) perror_msg_and_fail(SYSCALL_NAME); diff --git a/tests-mx32/getresuid.c b/tests-mx32/getresuid.c index b00f20ba..5bb2e301 100644 --- a/tests-mx32/getresuid.c +++ b/tests-mx32/getresuid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/getresuid.gen.test b/tests-mx32/getresuid.gen.test new file mode 100755 index 00000000..b0f478ce --- /dev/null +++ b/tests-mx32/getresuid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getresuid -a25 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests-mx32/getresuid.test b/tests-mx32/getresuid.test deleted file mode 100755 index eee1ac05..00000000 --- a/tests-mx32/getresuid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getresuid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a25 diff --git a/tests-mx32/getresuid32.c b/tests-mx32/getresuid32.c index 4c9a83df..13acc695 100644 --- a/tests-mx32/getresuid32.c +++ b/tests-mx32/getresuid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/getresuid32.gen.test b/tests-mx32/getresuid32.gen.test new file mode 100755 index 00000000..1b2f232c --- /dev/null +++ b/tests-mx32/getresuid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getresuid32 -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-mx32/getresuid32.test b/tests-mx32/getresuid32.test deleted file mode 100755 index fdc76a31..00000000 --- a/tests-mx32/getresuid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getresuid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests-mx32/getrlimit.c b/tests-mx32/getrlimit.c index bd9d0b0f..6d3b4cd5 100644 --- a/tests-mx32/getrlimit.c +++ b/tests-mx32/getrlimit.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/getrlimit.gen.test b/tests-mx32/getrlimit.gen.test new file mode 100755 index 00000000..08daf2d0 --- /dev/null +++ b/tests-mx32/getrlimit.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getrlimit -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-mx32/getrlimit.test b/tests-mx32/getrlimit.test deleted file mode 100755 index 6fd88aed..00000000 --- a/tests-mx32/getrlimit.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of getrlimit syscall. - -. "${srcdir=.}/setrlimit.test" diff --git a/tests-mx32/getrusage.c b/tests-mx32/getrusage.c index 8b76eff6..412d8a00 100644 --- a/tests-mx32/getrusage.c +++ b/tests-mx32/getrusage.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2016 Fei Jie * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -35,27 +16,46 @@ # include # include # include +# include + +# include "xlat.h" +# include "xlat/usagewho.h" int -main(void) +invoke_print(int who, const char *who_str, struct rusage *usage) { - struct rusage *const usage = tail_alloc(sizeof(struct rusage)); - int rc = syscall(__NR_getrusage, RUSAGE_SELF, usage); - printf("getrusage(RUSAGE_SELF, {ru_utime={tv_sec=%jd, tv_usec=%jd}" - ", ru_stime={tv_sec=%jd, tv_usec=%jd}, ru_maxrss=%lu" + int rc = syscall(__NR_getrusage, who, usage); + int saved_errno = errno; + printf("getrusage(%s, {ru_utime={tv_sec=%lld, tv_usec=%llu}" + ", ru_stime={tv_sec=%lld, tv_usec=%llu}, ru_maxrss=%lu" ", ru_ixrss=%lu, ru_idrss=%lu, ru_isrss=%lu, ru_minflt=%lu" ", ru_majflt=%lu, ru_nswap=%lu, ru_inblock=%lu" ", ru_oublock=%lu, ru_msgsnd=%lu, ru_msgrcv=%lu" - ", ru_nsignals=%lu, ru_nvcsw=%lu, ru_nivcsw=%lu}) = %d\n", - (intmax_t) usage->ru_utime.tv_sec, - (intmax_t) usage->ru_utime.tv_usec, - (intmax_t) usage->ru_stime.tv_sec, - (intmax_t) usage->ru_stime.tv_usec, + ", ru_nsignals=%lu, ru_nvcsw=%lu, ru_nivcsw=%lu}) = %s\n", + who_str, + (long long) usage->ru_utime.tv_sec, + zero_extend_signed_to_ull(usage->ru_utime.tv_usec), + (long long) usage->ru_stime.tv_sec, + zero_extend_signed_to_ull(usage->ru_stime.tv_usec), usage->ru_maxrss, usage->ru_ixrss, usage->ru_idrss, usage->ru_isrss, usage->ru_minflt, usage->ru_majflt, usage->ru_nswap, usage->ru_inblock, usage->ru_oublock, usage->ru_msgsnd, usage->ru_msgrcv, usage->ru_nsignals, - usage->ru_nvcsw, usage->ru_nivcsw, rc); + usage->ru_nvcsw, usage->ru_nivcsw, sprintrc(rc)); + errno = saved_errno; + return rc; +} + +int +main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct rusage, usage); + if (invoke_print(ARG_STR(RUSAGE_SELF), usage)) { + perror_msg_and_fail("RUSAGE_SELF"); + } + if (invoke_print(ARG_STR(RUSAGE_THREAD), usage) && errno != EINVAL) { + perror_msg_and_fail("RUSAGE_THREAD"); + } puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/getrusage.gen.test b/tests-mx32/getrusage.gen.test new file mode 100755 index 00000000..161818aa --- /dev/null +++ b/tests-mx32/getrusage.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getrusage -v ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v diff --git a/tests-mx32/getrusage.test b/tests-mx32/getrusage.test deleted file mode 100755 index 4a3e8ed0..00000000 --- a/tests-mx32/getrusage.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getrusage syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v diff --git a/tests-mx32/getsid.c b/tests-mx32/getsid.c index b563de9d..588ea4ab 100644 --- a/tests-mx32/getsid.c +++ b/tests-mx32/getsid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include diff --git a/tests-mx32/getsid.gen.test b/tests-mx32/getsid.gen.test new file mode 100755 index 00000000..2b9084a4 --- /dev/null +++ b/tests-mx32/getsid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getsid -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-mx32/getsid.test b/tests-mx32/getsid.test deleted file mode 100755 index 3fcf9799..00000000 --- a/tests-mx32/getsid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getsid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 diff --git a/tests-mx32/getsockname.c b/tests-mx32/getsockname.c index 66ac4e63..8883015c 100644 --- a/tests-mx32/getsockname.c +++ b/tests-mx32/getsockname.c @@ -1,30 +1,10 @@ /* * Check decoding of getsockname syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #define TEST_SYSCALL_NAME getsockname diff --git a/tests-mx32/getsockname.gen.test b/tests-mx32/getsockname.gen.test new file mode 100755 index 00000000..64cdeea8 --- /dev/null +++ b/tests-mx32/getsockname.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getsockname -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-mx32/getsockname.test b/tests-mx32/getsockname.test deleted file mode 100755 index 99b28506..00000000 --- a/tests-mx32/getsockname.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of getsockname syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests-mx32/gettid.c b/tests-mx32/gettid.c new file mode 100644 index 00000000..24947e89 --- /dev/null +++ b/tests-mx32/gettid.c @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +int +main(void) +{ + printf("gettid() = %ld\n", syscall(__NR_gettid)); + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/gettid.gen.test b/tests-mx32/gettid.gen.test new file mode 100755 index 00000000..f5ad317e --- /dev/null +++ b/tests-mx32/gettid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (gettid -a9 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a9 diff --git a/tests-mx32/getuid.c b/tests-mx32/getuid.c index 57311f72..56f6c902 100644 --- a/tests-mx32/getuid.c +++ b/tests-mx32/getuid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/getuid.test b/tests-mx32/getuid.test index 9aaf74ba..a0bbb3ed 100755 --- a/tests-mx32/getuid.test +++ b/tests-mx32/getuid.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check getuid syscall decoding. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -9,4 +14,3 @@ run_prog > /dev/null run_strace -qq -a9 -e$NAME $args > "$EXP" uniq < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" -rm -f "$OUT" "$EXP" diff --git a/tests-mx32/getuid32.c b/tests-mx32/getuid32.c index 397dd08f..1222dbcb 100644 --- a/tests-mx32/getuid32.c +++ b/tests-mx32/getuid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/getuid32.gen.test b/tests-mx32/getuid32.gen.test new file mode 100755 index 00000000..e81eb064 --- /dev/null +++ b/tests-mx32/getuid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getuid32 +getuid.test ); do not edit. +set -- +. "${srcdir=.}/getuid.test" diff --git a/tests-mx32/getuid32.test b/tests-mx32/getuid32.test deleted file mode 100755 index ae0c557b..00000000 --- a/tests-mx32/getuid32.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check getuid32 syscall decoding. - -. "${srcdir=.}/getuid.test" diff --git a/tests-mx32/getxxid.c b/tests-mx32/getxxid.c index 6eee52c5..864cea5b 100644 --- a/tests-mx32/getxxid.c +++ b/tests-mx32/getxxid.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/getxxid.gen.test b/tests-mx32/getxxid.gen.test new file mode 100755 index 00000000..5aa89f65 --- /dev/null +++ b/tests-mx32/getxxid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getxxid -a10 -e trace=getxpid,getxuid,getxgid); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 -e trace=getxpid,getxuid,getxgid diff --git a/tests-mx32/getxxid.test b/tests-mx32/getxxid.test deleted file mode 100755 index 9b89d7cf..00000000 --- a/tests-mx32/getxxid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getxpid, getxuid, and getxgid syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 -e trace=getxpid,getxuid,getxgid diff --git a/tests-mx32/group_req.c b/tests-mx32/group_req.c new file mode 100644 index 00000000..6a804bd2 --- /dev/null +++ b/tests-mx32/group_req.c @@ -0,0 +1,141 @@ +/* + * Check decoding of MCAST_JOIN_GROUP/MCAST_LEAVE_GROUP. + * + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2017-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include + +#if defined MCAST_JOIN_GROUP && defined MCAST_LEAVE_GROUP + +# include +# include +# include +# include +# include + +# define multi4addr "224.0.0.3" +# define multi6addr "ff01::c" + +static const char *errstr; + +static int +set_opt(const int fd, const int level, const int opt, + const void *const val, const socklen_t len) +{ + int rc = setsockopt(fd, level, opt, val, len); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct group_req, greq4); + TAIL_ALLOC_OBJECT_CONST_PTR(struct group_req, greq6); + unsigned int i; + + greq6->gr_interface = greq4->gr_interface = ifindex_lo(); + if (!greq4->gr_interface) + perror_msg_and_skip("lo"); + + greq4->gr_group.ss_family = AF_INET; + inet_pton(AF_INET, multi4addr, &greq4->gr_group.ss_family + 2); + + greq6->gr_group.ss_family = AF_INET6; + inet_pton(AF_INET6, multi6addr, &greq6->gr_group.ss_family + 4); + + (void) close(0); + if (socket(AF_INET, SOCK_DGRAM, 0)) + perror_msg_and_skip("socket"); + + struct { + const int level; + const char *const str_level; + const int name; + const char *const str_name; + const struct group_req *const val; + const char *const addr; + } opts[] = { + { + ARG_STR(SOL_IP), ARG_STR(MCAST_JOIN_GROUP), greq4, + "gr_group={sa_family=AF_INET, sin_port=htons(65535)" + ", sin_addr=inet_addr(\"" multi4addr "\")}" + }, + { + ARG_STR(SOL_IP), ARG_STR(MCAST_LEAVE_GROUP), greq4, + "gr_group={sa_family=AF_INET, sin_port=htons(65535)" + ", sin_addr=inet_addr(\"" multi4addr "\")}" + }, + { + ARG_STR(SOL_IPV6), ARG_STR(MCAST_JOIN_GROUP), greq6, + "gr_group={sa_family=AF_INET6, sin6_port=htons(65535)" + ", sin6_flowinfo=htonl(4294967295)" + ", inet_pton(AF_INET6, \"" multi6addr "\", &sin6_addr)" + ", sin6_scope_id=4294967295}" + }, + { + ARG_STR(SOL_IPV6), ARG_STR(MCAST_LEAVE_GROUP), greq6, + "gr_group={sa_family=AF_INET6, sin6_port=htons(65535)" + ", sin6_flowinfo=htonl(4294967295)" + ", inet_pton(AF_INET6, \"" multi6addr "\", &sin6_addr)" + ", sin6_scope_id=4294967295}" + } + }; + + for (i = 0; i < ARRAY_SIZE(opts); ++i) { + /* optlen < 0, EINVAL */ + set_opt(0, opts[i].level, opts[i].name, opts[i].val, -1U); + printf("setsockopt(0, %s, %s, %p, -1) = %s\n", + opts[i].str_level, opts[i].str_name, + opts[i].val, errstr); + + /* optlen < sizeof(struct group_req), EINVAL */ + set_opt(0, opts[i].level, opts[i].name, opts[i].val, + sizeof(*opts[i].val) - 1); + printf("setsockopt(0, %s, %s, %p, %u) = %s\n", + opts[i].str_level, opts[i].str_name, + opts[i].val, (unsigned int) sizeof(*opts[i].val) - 1, + errstr); + + /* optval EFAULT */ + set_opt(0, opts[i].level, opts[i].name, + (const char *) opts[i].val + 1, sizeof(*opts[i].val)); + printf("setsockopt(0, %s, %s, %p, %u) = %s\n", + opts[i].str_level, opts[i].str_name, + (const char *) opts[i].val + 1, + (unsigned int) sizeof(*opts[i].val), errstr); + + /* classic */ + set_opt(0, opts[i].level, opts[i].name, + opts[i].val, sizeof(*opts[i].val)); + printf("setsockopt(0, %s, %s" + ", {gr_interface=%s, %s}, %u) = %s\n", + opts[i].str_level, opts[i].str_name, + IFINDEX_LO_STR, opts[i].addr, + (unsigned int) sizeof(*opts[i].val), errstr); + + /* optlen > sizeof(struct group_req), shortened */ + set_opt(0, opts[i].level, opts[i].name, opts[i].val, INT_MAX); + printf("setsockopt(0, %s, %s" + ", {gr_interface=%s, %s}, %u) = %s\n", + opts[i].str_level, opts[i].str_name, + IFINDEX_LO_STR, opts[i].addr, + INT_MAX, errstr); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("MCAST_JOIN_GROUP && MCAST_LEAVE_GROUP") + +#endif diff --git a/tests-mx32/group_req.gen.test b/tests-mx32/group_req.gen.test new file mode 100755 index 00000000..0e753b6e --- /dev/null +++ b/tests-mx32/group_req.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (group_req -e trace=setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt diff --git a/tests-mx32/hexdump_strdup.c b/tests-mx32/hexdump_strdup.c index 4d6b53f4..d2b83448 100644 --- a/tests-mx32/hexdump_strdup.c +++ b/tests-mx32/hexdump_strdup.c @@ -1,30 +1,10 @@ /* * Make a hexdump copy of C string * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/hexquote_strndup.c b/tests-mx32/hexquote_strndup.c index 3ad3970c..bb1e101e 100644 --- a/tests-mx32/hexquote_strndup.c +++ b/tests-mx32/hexquote_strndup.c @@ -1,30 +1,10 @@ /* * Make a hexquoted copy of a string * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/ifindex.c b/tests-mx32/ifindex.c new file mode 100644 index 00000000..ae0eaa1f --- /dev/null +++ b/tests-mx32/ifindex.c @@ -0,0 +1,35 @@ +/* + * Proxy wrappers for if_nametoindex. + * + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_IF_INDEXTONAME + +# include + +unsigned int +ifindex_lo(void) +{ + static unsigned int index; + + if (!index) + index = if_nametoindex("lo"); + + return index; +} + +#else /* !HAVE_IF_INDEXTONAME */ + +unsigned int +ifindex_lo(void) +{ + return 1; +} + +#endif diff --git a/tests-mx32/inet-cmsg.c b/tests-mx32/inet-cmsg.c index b530016d..44ae4c64 100644 --- a/tests-mx32/inet-cmsg.c +++ b/tests-mx32/inet-cmsg.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -38,9 +19,10 @@ static void print_pktinfo(const struct cmsghdr *c) { - printf("IP_PKTINFO, cmsg_data={ipi_ifindex=if_nametoindex(\"lo\")" - ", ipi_spec_dst=inet_addr(\"127.0.0.1\")" - ", ipi_addr=inet_addr(\"127.0.0.1\")}"); + printf("IP_PKTINFO, cmsg_data={ipi_ifindex=%s" + ", ipi_spec_dst=inet_addr(\"%s\")" + ", ipi_addr=inet_addr(\"%s\")}", + IFINDEX_LO_STR, "127.0.0.1", "127.0.0.1"); } static void diff --git a/tests-mx32/inet-cmsg.gen.test b/tests-mx32/inet-cmsg.gen.test new file mode 100755 index 00000000..8eeb7c90 --- /dev/null +++ b/tests-mx32/inet-cmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (inet-cmsg -e trace=recvmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=recvmsg diff --git a/tests-mx32/inet-cmsg.test b/tests-mx32/inet-cmsg.test deleted file mode 100755 index 52ff5f59..00000000 --- a/tests-mx32/inet-cmsg.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check IPPROTO_IP control messages decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=recvmsg diff --git a/tests-mx32/init.sh b/tests-mx32/init.sh index f368b98a..40e62188 100644 --- a/tests-mx32/init.sh +++ b/tests-mx32/init.sh @@ -1,35 +1,16 @@ #!/bin/sh # # Copyright (c) 2011-2016 Dmitry V. Levin +# Copyright (c) 2011-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later +export LC_ALL=C ME_="${0##*/}" -LOG="$ME_.tmp" -OUT="$LOG.out" -EXP="$LOG.exp" -NAME="${ME_%.test}" +LOG="log" +OUT="out" +EXP="exp" warn_() { printf >&2 '%s\n' "$*"; } fail_() { warn_ "$ME_: failed test: $*"; exit 1; } @@ -45,14 +26,14 @@ check_prog() dump_log_and_fail_with() { - cat < "$LOG" + cat < "$LOG" >&2 fail_ "$*" } run_prog() { if [ $# -eq 0 ]; then - set -- "./$NAME" + set -- "../$NAME" fi args="$*" "$@" || { @@ -72,6 +53,20 @@ run_prog_skip_if_failed() "$@" || framework_skip_ "$args failed with code $?" } +try_run_prog() +{ + local rc + + "$@" > /dev/null || { + rc=$? + if [ $rc -eq 77 ]; then + return 1 + else + fail_ "$* failed with code $rc" + fi + } +} + run_strace() { > "$LOG" || fail_ "failed to write $LOG" @@ -155,7 +150,7 @@ match_diff() check_prog diff - diff -- "$expected" "$output" || + diff -u -- "$expected" "$output" || fail_ "$error" } @@ -213,7 +208,17 @@ run_strace_match_diff() run_prog > /dev/null run_strace "$@" $args > "$EXP" match_diff "$LOG" "$EXP" - rm -f "$EXP" +} + +# Usage: run_strace_match_grep [args to run_strace] +run_strace_match_grep() +{ + args="$*" + [ -n "$args" -a -z "${args##*-e trace=*}" ] || + set -- -e trace="$NAME" "$@" + run_prog > /dev/null + run_strace "$@" $args > "$EXP" + match_grep "$LOG" "$EXP" } # Print kernel version code. @@ -223,7 +228,7 @@ kernel_version_code() ( set -f IFS=. - set -- $1 + set -- $1 0 0 v1="${1%%[!0-9]*}" && [ -n "$v1" ] || v1=0 v2="${2%%[!0-9]*}" && [ -n "$v2" ] || v2=0 v3="${3%%[!0-9]*}" && [ -n "$v3" ] || v3=0 @@ -250,22 +255,117 @@ grep_pid_status() cat < "/proc/$pid/status" | grep "$@" } +# Subtracts one program set from another. +# If an optional regular expression is specified, the lines in the minuend file +# that match this regular expression are elso excluded from the output. +# +# Usage: prog_set_subtract minuend_file subtrahend_file [subtrahend_regexp] +prog_set_subtract() +{ + local min sub re pat + min="$1"; shift + sub="$1"; shift + re="${1-}" + pat="$re|$(sed 's/[[:space:]].*//' < "$sub" | tr -s '\n' '|')" + grep -E -v -x -e "$pat" < "$min" +} + +# Usage: test_pure_prog_set [--expfile FILE] COMMON_ARGS < tests_file +# stdin should consist of lines in "test_name strace_args..." format. +test_pure_prog_set() +{ + local expfile + + expfile="$EXP" + + while [ -n "$1" ]; do + case "$1" in + --expfile) + shift + expfile="$1" + shift + ;; + *) + break + ;; + esac + done + + while read -r t prog_args; do { + # skip lines beginning with "#" symbol + [ "${t###}" = "$t" ] || continue + + try_run_prog "../$t" || continue + run_strace $prog_args "$@" "../$t" > "$expfile" + match_diff "$LOG" "$expfile" + } < /dev/null; done +} + +# Run strace against list of programs put in "$NAME.in" and then against the +# rest of pure_executables.list with the expectation of empty output in the +# latter case. +# +# Usage: source this file after init.sh and call: +# test_trace_expr subtrahend_regexp strace_args +# Environment: +# $NAME: test name, used for "$NAME.in" file containing list of tests +# for positive trace expression match; +# $srcdir: used to find pure_executables.list and "$NAME.in" files. +# Files created: +# negative.list: File containing list of tests for negative match. +test_trace_expr() +{ + local subtrahend_regexp + subtrahend_regexp="$1"; shift + test_pure_prog_set "$@" < "$srcdir/$NAME.in" + prog_set_subtract "$srcdir/pure_executables.list" "$srcdir/$NAME.in" \ + "$subtrahend_regexp" > negative.list + test_pure_prog_set --expfile /dev/null -qq -esignal=none "$@" \ + < negative.list +} + check_prog cat check_prog rm -rm -f "$LOG" +case "$ME_" in + *.gen.test) NAME="${ME_%.gen.test}" ;; + *.test) NAME="${ME_%.test}" ;; + *) NAME= +esac + +STRACE_EXE= +if [ -n "$NAME" ]; then + TESTDIR="$NAME.dir" + rm -rf -- "$TESTDIR" + mkdir -- "$TESTDIR" + cd "$TESTDIR" + + case "$srcdir" in + /*) ;; + *) srcdir="../$srcdir" ;; + esac -[ -n "${STRACE-}" ] || { - STRACE=../strace - case "${LOG_COMPILER-} ${LOG_FLAGS-}" in - *--suppressions=*--error-exitcode=*--tool=*) + [ -n "${STRACE-}" ] || { + STRACE=../../strace + case "${LOG_COMPILER-} ${LOG_FLAGS-}" in + *--suppressions=*--error-exitcode=*--tool=*) + STRACE_EXE="$STRACE" # add valgrind command prefix STRACE="${LOG_COMPILER-} ${LOG_FLAGS-} $STRACE" ;; - esac -} + esac + } + + trap 'dump_log_and_fail_with "time limit ($TIMEOUT_DURATION) exceeded"' XCPU +else + : "${STRACE:=../strace}" +fi + +# Export $STRACE_EXE to check_PROGRAMS. +: "${STRACE_EXE:=$STRACE}" +export STRACE_EXE -: "${TIMEOUT_DURATION:=60}" +: "${TIMEOUT_DURATION:=600}" : "${SLEEP_A_BIT:=sleep 1}" [ -z "${VERBOSE-}" ] || diff --git a/tests-mx32/init_delete_module.h b/tests-mx32/init_delete_module.h index db550c33..85a4a396 100644 --- a/tests-mx32/init_delete_module.h +++ b/tests-mx32/init_delete_module.h @@ -3,33 +3,14 @@ * and delete_module tests. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef STRACE_TESTS_INIT_DELETE_MODULE_H -#define STRACE_TESTS_INIT_DELETE_MODULE_H +# define STRACE_TESTS_INIT_DELETE_MODULE_H # include # include @@ -42,9 +23,6 @@ enum { MAX_STRLEN = 32, }; -static const kernel_ulong_t bogus_zero = - (kernel_ulong_t) 0xffffffff00000000ULL; - static void print_str(unsigned int base, unsigned int len, bool escape) { diff --git a/tests-mx32/init_module.c b/tests-mx32/init_module.c index 88ef9ec8..601f7f92 100644 --- a/tests-mx32/init_module.c +++ b/tests-mx32/init_module.c @@ -2,29 +2,10 @@ * Check decoding of init_module syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -55,9 +36,9 @@ main(void) fill_memory_ex(bogus_param1, PARAM1_LEN, PARAM1_BASE, PARAM1_LEN); fill_memory_ex(bogus_param2, PARAM2_LEN, PARAM2_BASE, PARAM2_LEN); - rc = syscall(__NR_init_module, NULL, bogus_zero, NULL); + rc = syscall(__NR_init_module, NULL, F8ILL_KULONG_MASK, NULL); printf("init_module(NULL, %llu, NULL) = %s\n", - (unsigned long long) bogus_zero, sprintrc(rc)); + (unsigned long long) F8ILL_KULONG_MASK, sprintrc(rc)); rc = syscall(__NR_init_module, bogus_addr, 0, bogus_param1); errstr = sprintrc(rc); diff --git a/tests-mx32/init_module.gen.test b/tests-mx32/init_module.gen.test new file mode 100755 index 00000000..b6961be6 --- /dev/null +++ b/tests-mx32/init_module.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (init_module -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-mx32/init_module.test b/tests-mx32/init_module.test deleted file mode 100755 index ef7c7325..00000000 --- a/tests-mx32/init_module.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of init_module syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests-mx32/inject-nf.c b/tests-mx32/inject-nf.c new file mode 100644 index 00000000..b419984f --- /dev/null +++ b/tests-mx32/inject-nf.c @@ -0,0 +1,66 @@ +/* + * Check decoding of return values injected into a syscall that "never fails". + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include + +#include "raw_syscall.h" + +#ifdef __alpha__ +/* alpha has no getpid */ +# define SC_NR __NR_getpgrp +# define SC_NAME "getpgrp" +# define getpid getpgrp +#else +# define SC_NR __NR_getpid +# define SC_NAME "getpid" +#endif + +#ifdef raw_syscall_0 +# define INVOKE_SC(err) raw_syscall_0(SC_NR, &err) +#else +/* No raw_syscall_0, let's use getpid() and hope for the best. */ +# define INVOKE_SC(err) getpid() +#endif + +/* + * This prototype is intentionally different + * from the prototype provided by . + */ +extern kernel_ulong_t getpid(void); + +int +main(int ac, char **av) +{ + assert(ac == 1 || ac == 2); + + kernel_ulong_t expected = + (ac == 1) ? getpid() : strtoull(av[1], NULL, 0); + kernel_ulong_t err = 0; + kernel_ulong_t rc = INVOKE_SC(err); + + if (err || rc != expected) + error_msg_and_fail("expected %#llx, got rval=%#llx err=%#llx", + (unsigned long long) expected, + (unsigned long long) rc, + (unsigned long long) err); + + if (ac == 2) { + printf("%s() = %llu (INJECTED)\n", + SC_NAME, (unsigned long long) rc); + + puts("+++ exited with 0 +++"); + } + + return 0; +} diff --git a/tests-mx32/inject-nf.test b/tests-mx32/inject-nf.test new file mode 100755 index 00000000..cadb5adb --- /dev/null +++ b/tests-mx32/inject-nf.test @@ -0,0 +1,55 @@ +#!/bin/sh -efu +# +# Check decoding of return values injected into a syscall that "never fails". +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +case "$STRACE_ARCH" in +alpha) + SYSCALL=getpgrp + ;; +*) + SYSCALL=getpid + ;; +esac + +run_prog +prog="$args" +fault_args="-a9 -e trace=${SYSCALL} -e inject=${SYSCALL}:retval=" + +test_rval() +{ + local rval + rval="$1"; shift + + run_strace $fault_args$rval $prog $rval > "$EXP" + match_diff "$LOG" "$EXP" +} + +test_rval 0 +test_rval 1 +test_rval 0x7fffffff +test_rval 0x80000000 +test_rval 0xfffff000 +test_rval 0xfffffffe +test_rval 0xffffffff + +case "$SIZEOF_KERNEL_LONG_T" in +8) + test_rval 0x80000000 + test_rval 0xfffff000 + test_rval 0xfffffffe + test_rval 0xffffffff + test_rval 0x100000000 + test_rval 0x7fffffffffffffff + test_rval 0x8000000000000000 + test_rval 0xfffffffffffff000 + test_rval 0xfffffffffffffffe + test_rval 0xffffffffffffffff + ;; +esac diff --git a/tests-mx32/inode_of_sockfd.c b/tests-mx32/inode_of_sockfd.c index b227f306..b9ad78ee 100644 --- a/tests-mx32/inode_of_sockfd.c +++ b/tests-mx32/inode_of_sockfd.c @@ -2,38 +2,19 @@ * This file is part of strace test suite. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include +#include #include #include #include #include -#include unsigned long inode_of_sockfd(const int fd) diff --git a/tests-mx32/inotify.c b/tests-mx32/inotify.c index 925d69ff..db751d4e 100644 --- a/tests-mx32/inotify.c +++ b/tests-mx32/inotify.c @@ -2,29 +2,10 @@ * Check decoding of inotify_add_watch and inotify_rm_watch syscalls. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -52,8 +33,8 @@ main(void) static const char *bogus_mask_str = "IN_ACCESS|IN_ATTRIB|" "IN_CLOSE_WRITE|IN_OPEN|IN_MOVED_TO|IN_DELETE|IN_DELETE_SELF|" "IN_MOVE_SELF|IN_Q_OVERFLOW|IN_IGNORED|IN_ONLYDIR|" - "IN_DONT_FOLLOW|IN_EXCL_UNLINK|IN_MASK_ADD|IN_ISDIR|IN_ONESHOT|" - "0x18ff1000"; + "IN_DONT_FOLLOW|IN_EXCL_UNLINK|IN_MASK_CREATE|IN_MASK_ADD|" + "IN_ISDIR|IN_ONESHOT|0x8ff1000"; long rc; char *bogus_path = tail_memdup(bogus_path_str.path, diff --git a/tests-mx32/inotify.gen.test b/tests-mx32/inotify.gen.test new file mode 100755 index 00000000..70102065 --- /dev/null +++ b/tests-mx32/inotify.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (inotify -a23 -e trace=inotify_add_watch,inotify_rm_watch); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 -e trace=inotify_add_watch,inotify_rm_watch diff --git a/tests-mx32/inotify.test b/tests-mx32/inotify.test deleted file mode 100755 index 436f3bc8..00000000 --- a/tests-mx32/inotify.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of inotify_add_watch and inotify_rm_watch syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=inotify_add_watch,inotify_rm_watch -a23 diff --git a/tests-mx32/inotify_init1.c b/tests-mx32/inotify_init1.c index 0325150d..4f352b70 100644 --- a/tests-mx32/inotify_init1.c +++ b/tests-mx32/inotify_init1.c @@ -2,29 +2,10 @@ * Check decoding of inotify_init1 syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/inotify_init1.gen.test b/tests-mx32/inotify_init1.gen.test new file mode 100755 index 00000000..a1060c5d --- /dev/null +++ b/tests-mx32/inotify_init1.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (inotify_init1 -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-mx32/inotify_init1.test b/tests-mx32/inotify_init1.test deleted file mode 100755 index 1a7c9261..00000000 --- a/tests-mx32/inotify_init1.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of inotify_init1 syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests-mx32/int_0x80.c b/tests-mx32/int_0x80.c new file mode 100644 index 00000000..abdc94a7 --- /dev/null +++ b/tests-mx32/int_0x80.c @@ -0,0 +1,32 @@ +/* + * Check decoding of int 0x80 on x86_64, x32, and x86. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#if defined __x86_64__ || defined __i386__ + +# include +# include + +int +main(void) +{ + /* 200 is __NR_getgid32 on x86 and __NR_tkill on x86_64. */ + __asm__("movl $200, %eax; int $0x80"); + printf("getgid32() = %d\n", getegid()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__x86_64__ || __i386__") + +#endif diff --git a/tests-mx32/int_0x80.test b/tests-mx32/int_0x80.test new file mode 100755 index 00000000..6b3ca25f --- /dev/null +++ b/tests-mx32/int_0x80.test @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Check decoding of int 0x80 on x86_64, x32, and x86. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +$STRACE -d -enone / > /dev/null 2> "$LOG" +grep -x "[^:]*strace: PTRACE_GET_SYSCALL_INFO works" "$LOG" > /dev/null || + skip_ 'PTRACE_GET_SYSCALL_INFO does not work' + +run_strace_match_diff -a11 -e trace=getgid32 diff --git a/tests-mx32/interactive_block.test b/tests-mx32/interactive_block.test new file mode 100755 index 00000000..57df767a --- /dev/null +++ b/tests-mx32/interactive_block.test @@ -0,0 +1,20 @@ +#!/bin/sh +# +# Check that in interactive mode those signals that were blocked +# at strace startup will remain blocked. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +strace0="$STRACE" +for signo in 1 2 3 13 14 15; do + blocksig="../block_reset_raise_run $signo" + run_prog $blocksig ../umovestr + STRACE="$blocksig $strace0" + run_strace -I2 -echdir ../umovestr + match_diff "$LOG" "$srcdir/umovestr.expected" +done diff --git a/tests-mx32/io_uring_enter.c b/tests-mx32/io_uring_enter.c new file mode 100644 index 00000000..3284ebac --- /dev/null +++ b/tests-mx32/io_uring_enter.c @@ -0,0 +1,83 @@ +/* + * Check decoding of io_uring_enter syscall. + * + * Copyright (c) 2019 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include "scno.h" + +#ifdef __NR_io_uring_enter + +# include +# include +# include +# include + +static const char *errstr; + +static long +sys_io_uring_enter(unsigned int fd, unsigned int to_submit, + unsigned int min_complete, unsigned int flags, + const void *sigset_addr, kernel_ulong_t sigset_size) + +{ + kernel_ulong_t fill = (kernel_ulong_t) 0xdefaced00000000ULL; + kernel_ulong_t arg1 = fill | fd; + kernel_ulong_t arg2 = fill | to_submit; + kernel_ulong_t arg3 = fill | min_complete; + kernel_ulong_t arg4 = fill | flags; + kernel_ulong_t arg5 = (unsigned long) sigset_addr; + kernel_ulong_t arg6 = sigset_size; + + long rc = syscall(__NR_io_uring_enter, + arg1, arg2, arg3, arg4, arg5, arg6); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const char path[] = "/dev/null"; + + skip_if_unavailable("/proc/self/fd/"); + + int fd = open(path, O_RDONLY); + if (fd < 0) + perror_msg_and_fail("open: %s", path); + + const unsigned int size = get_sigset_size(); + void *const sigmask = tail_alloc(size); + sigset_t mask; + + memset(&mask, -1, sizeof(mask)); + sigdelset(&mask, SIGHUP); + sigdelset(&mask, SIGKILL); + sigdelset(&mask, SIGSTOP); + memcpy(sigmask, &mask, size); + + const unsigned int to_submit = 0xdeadbeef; + const unsigned int min_complete = 0xcafef00d; + + sys_io_uring_enter(fd, to_submit, min_complete, -1U, sigmask, size); + printf("io_uring_enter(%u<%s>, %u, %u" + ", IORING_ENTER_GETEVENTS|IORING_ENTER_SQ_WAKEUP|%#x" + ", %s, %u) = %s\n", + fd, path, to_submit, min_complete, -1U - 3, + "~[HUP KILL STOP]", size, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_io_uring_enter") + +#endif diff --git a/tests-mx32/io_uring_enter.gen.test b/tests-mx32/io_uring_enter.gen.test new file mode 100755 index 00000000..7e68909e --- /dev/null +++ b/tests-mx32/io_uring_enter.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (io_uring_enter -y ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -y diff --git a/tests-mx32/io_uring_register.c b/tests-mx32/io_uring_register.c new file mode 100644 index 00000000..a0327ed8 --- /dev/null +++ b/tests-mx32/io_uring_register.c @@ -0,0 +1,100 @@ +/* + * Check decoding of io_uring_register syscall. + * + * Copyright (c) 2019 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include "scno.h" + +#ifdef __NR_io_uring_register + +# include +# include +# include +# include + +static const char *errstr; + +static long +sys_io_uring_register(unsigned int fd, unsigned int opcode, + const void *arg, unsigned int nargs) + +{ + kernel_ulong_t fill = (kernel_ulong_t) 0xdefaced00000000ULL; + kernel_ulong_t bad = (kernel_ulong_t) 0xbadc0dedbadc0dedULL; + kernel_ulong_t arg1 = fill | fd; + kernel_ulong_t arg2 = fill | opcode; + kernel_ulong_t arg3 = (unsigned long) arg; + kernel_ulong_t arg4 = fill | nargs; + + long rc = syscall(__NR_io_uring_register, + arg1, arg2, arg3, arg4, bad, bad); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const char path_null[] = "/dev/null"; + static const char path_full[] = "/dev/full"; + const struct iovec iov[] = { + { + .iov_base = (void *) (unsigned long) 0xfacefeedcafef00d, + .iov_len = (unsigned long) 0xdeadfacebeefcafe + }, + { + .iov_base = (void *) path_null, + .iov_len = sizeof(path_null) + } + }; + const struct iovec *arg_iov = tail_memdup(iov, sizeof(iov)); + + skip_if_unavailable("/proc/self/fd/"); + + int fd_null = open(path_null, O_RDONLY); + if (fd_null < 0) + perror_msg_and_fail("open: %s", path_null); + + int fd_full = open(path_full, O_RDONLY); + if (fd_full < 0) + perror_msg_and_fail("open: %s", path_null); + + int fds[] = { fd_full, fd_null }; + const int *arg_fds = tail_memdup(fds, sizeof(fds)); + + sys_io_uring_register(fd_null, 0xbadc0ded, path_null, 0xdeadbeef); + printf("io_uring_register(%u<%s>, %#x /* IORING_REGISTER_??? */" + ", %p, %u) = %s\n", + fd_null, path_null, 0xbadc0ded, path_null, 0xdeadbeef, errstr); + + sys_io_uring_register(fd_null, 0, arg_iov, ARRAY_SIZE(iov)); + printf("io_uring_register(%u<%s>, IORING_REGISTER_BUFFERS" + ", [{iov_base=%p, iov_len=%lu}, {iov_base=%p, iov_len=%lu}]" + ", %u) = %s\n", + fd_null, path_null, iov[0].iov_base, + (unsigned long) iov[0].iov_len, + iov[1].iov_base, (unsigned long) iov[1].iov_len, + (unsigned int) ARRAY_SIZE(iov), errstr); + + sys_io_uring_register(fd_null, 2, arg_fds, ARRAY_SIZE(fds)); + printf("io_uring_register(%u<%s>, IORING_REGISTER_FILES" + ", [%u<%s>, %u<%s>], %u) = %s\n", + fd_null, path_null, fd_full, path_full, fd_null, path_null, + (unsigned int) ARRAY_SIZE(fds), errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_io_uring_register") + +#endif diff --git a/tests-mx32/io_uring_register.gen.test b/tests-mx32/io_uring_register.gen.test new file mode 100755 index 00000000..b3fda203 --- /dev/null +++ b/tests-mx32/io_uring_register.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (io_uring_register -y ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -y diff --git a/tests-mx32/io_uring_setup.c b/tests-mx32/io_uring_setup.c new file mode 100644 index 00000000..f48095bb --- /dev/null +++ b/tests-mx32/io_uring_setup.c @@ -0,0 +1,103 @@ +/* + * Check decoding of io_uring_setup syscall. + * + * Copyright (c) 2019 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include "scno.h" + +#if defined HAVE_LINUX_IO_URING_H && defined __NR_io_uring_setup + +# include +# include +# include +# include + +# include "print_fields.h" + +static const char *errstr; + +static long +sys_io_uring_setup(uint32_t nentries, const void *params) +{ + kernel_ulong_t fill = (kernel_ulong_t) 0xdefaced00000000ULL; + kernel_ulong_t bad = (kernel_ulong_t) 0xbadc0dedbadc0dedULL; + kernel_ulong_t arg1 = fill | nentries; + kernel_ulong_t arg2 = (unsigned long) params; + + long rc = syscall(__NR_io_uring_setup, arg1, arg2, bad, bad, bad, bad); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + long rc; + TAIL_ALLOC_OBJECT_CONST_PTR(struct io_uring_params, params); + const void *efault = (const void *) params + 1; + + skip_if_unavailable("/proc/self/fd/"); + + sys_io_uring_setup(-1U, NULL); + printf("io_uring_setup(%u, NULL) = %s\n", -1U, errstr); + + sys_io_uring_setup(0, efault); + printf("io_uring_setup(%u, %p) = %s\n", 0, efault, errstr); + + fill_memory(params, sizeof(*params)); + params->flags = -1; + sys_io_uring_setup(1, params); + printf("io_uring_setup(%u, {flags=IORING_SETUP_IOPOLL" + "|IORING_SETUP_SQPOLL|IORING_SETUP_SQ_AFF|%#x" + ", sq_thread_cpu=%#x, sq_thread_idle=%u, resv={", + 1, -1U - 7, params->sq_thread_cpu, params->sq_thread_idle); + for (unsigned int i = 0; i < ARRAY_SIZE(params->resv); ++i) + printf("%s%#x", i ? ", " : "", params->resv[i]); + printf("}}) = %s\n", errstr); + + memset(params, 0, sizeof(*params)); + rc = sys_io_uring_setup(2, params); + printf("io_uring_setup(%u, {flags=0, sq_thread_cpu=0" + ", sq_thread_idle=0", 2); + if (rc < 0) + printf("}) = %s\n", errstr); + else + printf(", sq_entries=%u, cq_entries=%u" + ", sq_off={head=%u, tail=%u, ring_mask=%u" + ", ring_entries=%u, flags=%u, dropped=%u, array=%u}" + ", cq_off={head=%u, tail=%u, ring_mask=%u" + ", ring_entries=%u, overflow=%u, cqes=%u}" + "}) = %ld\n", + params->sq_entries, + params->cq_entries, + params->sq_off.head, + params->sq_off.tail, + params->sq_off.ring_mask, + params->sq_off.ring_entries, + params->sq_off.flags, + params->sq_off.dropped, + params->sq_off.array, + params->cq_off.head, + params->cq_off.tail, + params->cq_off.ring_mask, + params->cq_off.ring_entries, + params->cq_off.overflow, + params->cq_off.cqes, + rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_IO_URING_H && __NR_io_uring_setup") + +#endif diff --git a/tests-mx32/io_uring_setup.gen.test b/tests-mx32/io_uring_setup.gen.test new file mode 100755 index 00000000..bec63a8a --- /dev/null +++ b/tests-mx32/io_uring_setup.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (io_uring_setup -a26 -y); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a26 -y diff --git a/tests-mx32/ioctl.c b/tests-mx32/ioctl.c index 92a3191d..ec4e3670 100644 --- a/tests-mx32/ioctl.c +++ b/tests-mx32/ioctl.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -53,16 +34,16 @@ && defined EV_KEY int -main(void ) +main(void) { uint64_t data = 0; -#ifndef POWERPC +# ifndef POWERPC struct termios tty; (void) ioctl(-1, TCGETS, &tty); printf("ioctl(-1, TCGETS, %p)" " = -1 EBADF (%m)\n", &tty); -#endif +# endif (void) ioctl(-1, MMTIMER_GETRES, &data); printf("ioctl(-1, MMTIMER_GETRES, %p)" @@ -85,8 +66,13 @@ main(void ) " = -1 EBADF (%m)\n", &data); (void) ioctl(-1, _IOR('M', 13, int), &data); +# ifdef HAVE_STRUCT_MTD_WRITE_REQ printf("ioctl(-1, MIXER_READ(13) or OTPSELECT, [MTD_OTP_OFF])" " = -1 EBADF (%m)\n"); +# else + printf("ioctl(-1, MIXER_READ(13) or OTPSELECT, %p)" + " = -1 EBADF (%m)\n", &data); +# endif (void) ioctl(-1, _IOC(_IOC_WRITE, 0xde, 0, 0), (kernel_ulong_t) -1ULL); printf("ioctl(-1, _IOC(_IOC_WRITE, 0xde, 0, 0), %#lx)" diff --git a/tests-mx32/ioctl.test b/tests-mx32/ioctl.test index 94bc5d42..5e11f589 100755 --- a/tests-mx32/ioctl.test +++ b/tests-mx32/ioctl.test @@ -1,15 +1,16 @@ #!/bin/sh - +# # Check ioctl syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog > /dev/null -run_strace -a16 -eioctl $args > "$EXP" check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" +run_prog > /dev/null +run_strace -a16 -eioctl "$@" $args > "$EXP" +grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" - -exit 0 diff --git a/tests-mx32/ioctl_block.c b/tests-mx32/ioctl_block.c index f62b0b36..65f434c8 100644 --- a/tests-mx32/ioctl_block.c +++ b/tests-mx32/ioctl_block.c @@ -2,29 +2,10 @@ * This file is part of ioctl_block strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -57,9 +38,11 @@ static struct xlat block_argless[] = { #endif }; -#define TEST_NULL_ARG(cmd) \ - ioctl(-1, cmd, 0); \ - printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd) +#define TEST_NULL_ARG(cmd) \ + do { \ + ioctl(-1, cmd, 0); \ + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd); \ + } while (0) int main(void) @@ -113,7 +96,7 @@ main(void) ioctl(-1, BLKFRASET, lmagic); printf("ioctl(-1, BLKFRASET, %lu) = -1 EBADF (%m)\n", lmagic); - int *const val_int = tail_alloc(sizeof(*val_int)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, val_int); *val_int = magic; ioctl(-1, BLKROSET, val_int); @@ -144,19 +127,19 @@ main(void) " = -1 EBADF (%m)\n", pair_int64[0], pair_int64[1]); #endif - struct blkpg_ioctl_arg *const blkpg = tail_alloc(sizeof(*blkpg)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct blkpg_ioctl_arg, blkpg); blkpg->op = 3; blkpg->flags = 0xdeadbeef; blkpg->datalen = 0xbadc0ded; blkpg->data = (void *) (unsigned long) 0xcafef00dfffffeedULL; ioctl(-1, BLKPG, blkpg); - printf("ioctl(-1, BLKPG, {%s, flags=%d, datalen=%d" + printf("ioctl(-1, BLKPG, {op=%s, flags=%d, datalen=%d" ", data=%#lx}) = -1 EBADF (%m)\n", "BLKPG_RESIZE_PARTITION", blkpg->flags, blkpg->datalen, (unsigned long) blkpg->data); - struct blkpg_partition *const bp = tail_alloc(sizeof(*bp)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct blkpg_partition, bp); bp->start = 0xfac1fed2dad3bef4ULL; bp->length = 0xfac5fed6dad7bef8ULL; bp->pno = magic; @@ -166,9 +149,9 @@ main(void) blkpg->data = bp; ioctl(-1, BLKPG, blkpg); - printf("ioctl(-1, BLKPG, {%s, flags=%d, datalen=%d" + printf("ioctl(-1, BLKPG, {op=%s, flags=%d, datalen=%d" ", data={start=%lld, length=%lld, pno=%d" - ", devname=\"%.*s\", volname=\"%.*s\"}})" + ", devname=\"%.*s\"..., volname=\"%.*s\"...}})" " = -1 EBADF (%m)\n", "BLKPG_ADD_PARTITION", blkpg->flags, blkpg->datalen, @@ -177,7 +160,7 @@ main(void) (int) sizeof(bp->volname) - 1, bp->volname); #if defined BLKTRACESETUP && defined HAVE_STRUCT_BLK_USER_TRACE_SETUP - struct blk_user_trace_setup *const buts = tail_alloc(sizeof(*buts)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct blk_user_trace_setup, buts); fill_memory(buts, sizeof(*buts)); ioctl(-1, BLKTRACESETUP, buts); diff --git a/tests-mx32/ioctl_block.gen.test b/tests-mx32/ioctl_block.gen.test new file mode 100755 index 00000000..8b2c3df6 --- /dev/null +++ b/tests-mx32/ioctl_block.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_block +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_block.test b/tests-mx32/ioctl_block.test deleted file mode 100755 index 0bf2500f..00000000 --- a/tests-mx32/ioctl_block.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of BLK* ioctls. - -. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_dm-v.gen.test b/tests-mx32/ioctl_dm-v.gen.test new file mode 100755 index 00000000..66fa5856 --- /dev/null +++ b/tests-mx32/ioctl_dm-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_dm-v +ioctl.test -v -s9); do not edit. +set -- -v -s9 +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_dm-v.test b/tests-mx32/ioctl_dm-v.test deleted file mode 100755 index ade3b9e8..00000000 --- a/tests-mx32/ioctl_dm-v.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check unabbreviated decoding of DM* ioctls. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a16 -s9 -veioctl $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/ioctl_dm.c b/tests-mx32/ioctl_dm.c index 08f036c6..f05528f9 100644 --- a/tests-mx32/ioctl_dm.c +++ b/tests-mx32/ioctl_dm.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Mikulas Patocka * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -34,7 +15,6 @@ # include # include -# include # include # include # include @@ -53,6 +33,10 @@ # define ALIGNED_OFFSET(t_, m_) \ ALIGNED_SIZE(offsetof(t_, m_), t_) +# ifndef DM_DEV_ARM_POLL +# define DM_DEV_ARM_POLL _IOWR(DM_IOCTL, 0x10, struct dm_ioctl) +# endif + static const char str129[] = STR32 STR32 STR32 STR32 "6"; static const __u64 dts_sector_base = (__u64) 0xdeadca75facef157ULL; @@ -138,7 +122,7 @@ init_dm_target_spec(struct dm_target_spec *ptr, uint32_t id) ptr->length = dts_length_base + dts_length_step * id; ptr->status = dts_status_base + dts_status_step * id; - strncpy(ptr->target_type, str129 + + memcpy(ptr->target_type, str129 + id % (sizeof(str129) - sizeof(ptr->target_type)), id % (sizeof(ptr->target_type) + 1)); if (id % (sizeof(ptr->target_type) + 1) < sizeof(ptr->target_type)) @@ -181,6 +165,7 @@ main(void) { ARG_STR(DM_TABLE_CLEAR), false }, { ARG_STR(DM_TABLE_DEPS), true }, { ARG_STR(DM_TABLE_STATUS), true }, + { ARG_STR(DM_DEV_ARM_POLL), false }, }; struct dm_ioctl *unaligned_dm_arg = @@ -234,23 +219,23 @@ main(void) dm_arg->version[1] = 0xbadc0dee; dm_arg->version[2] = 0xbadc0def; ioctl(-1, DM_VERSION, dm_arg); - printf("ioctl(-1, DM_VERSION, {version=%u.%u.%u, " - "/* Unsupported device mapper ABI version */ ...}) = " + printf("ioctl(-1, DM_VERSION, {version=%u.%u.%u" + " /* unsupported device mapper ABI version */}) = " "-1 EBADF (%m)\n", 0xbadc0ded, 0xbadc0dee, 0xbadc0def); /* Incorrect data_size */ init_s(dm_arg, 14, 64); ioctl(-1, DM_VERSION, dm_arg); - printf("ioctl(-1, DM_VERSION, {version=4.1.2, data_size=14, " - "/* Incorrect data_size */ ...}) = -1 EBADF (%m)\n"); + printf("ioctl(-1, DM_VERSION, {version=4.1.2, data_size=14" + " /* data_size too small */}) = -1 EBADF (%m)\n"); /* Unterminated name/uuid */ init_s(dm_arg, min_sizeof_dm_ioctl, 0); - strncpy(dm_arg->name, str129, sizeof(dm_arg->name)); - strncpy(dm_arg->uuid, str129, sizeof(dm_arg->uuid)); + memcpy(dm_arg->name, str129, sizeof(dm_arg->name)); + memcpy(dm_arg->uuid, str129, sizeof(dm_arg->uuid)); ioctl(-1, DM_VERSION, dm_arg); printf("ioctl(-1, DM_VERSION, {version=4.1.2, data_size=%zu, " - "dev=makedev(18, 52), name=\"%.127s\", uuid=\"%.128s\", " + "dev=makedev(0x12, 0x34), name=\"%.127s\"..., uuid=\"%.128s\"..., " "flags=0}) = -1 EBADF (%m)\n", min_sizeof_dm_ioctl, str129, str129); @@ -259,7 +244,7 @@ main(void) ioctl(-1, DM_VERSION, dm_arg); printf("ioctl(-1, DM_VERSION, " "{version=4.1.2, data_size=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0}) = " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0}) = " "-1 EBADF (%m)\n", min_sizeof_dm_ioctl); /* Zero dev, name, uuid */ @@ -279,7 +264,7 @@ main(void) ioctl(-1, DM_VERSION, dm_arg); printf("ioctl(-1, DM_VERSION, " "{version=4.1.2, data_size=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=" + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=" "DM_READONLY_FLAG|DM_SUSPEND_FLAG|DM_EXISTS_FLAG|" "DM_PERSISTENT_DEV_FLAG|DM_STATUS_TABLE_FLAG|" "DM_ACTIVE_PRESENT_FLAG|DM_INACTIVE_PRESENT_FLAG|" @@ -295,7 +280,7 @@ main(void) ioctl(-1, DM_VERSION, &s); printf("ioctl(-1, DM_VERSION, " "{version=4.1.2, data_size=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0}) = " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0}) = " "-1 EBADF (%m)\n", sizeof(s.ioc)); @@ -325,7 +310,7 @@ main(void) init_s(dm_arg, min_sizeof_dm_ioctl, 0); ioctl(-1, dummy_check_cmds[i].arg, dm_arg); printf("ioctl(-1, %s, {version=4.1.2, data_size=%zu%s, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\"%s, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\"%s, " "flags=0}) = -1 EBADF (%m)\n", dummy_check_cmds[i].str, min_sizeof_dm_ioctl, dummy_check_cmds[i].has_params ? ", data_start=0" : "", @@ -340,14 +325,14 @@ main(void) ioctl(-1, DM_DEV_SUSPEND, &s); printf("ioctl(-1, DM_DEV_SUSPEND, " "{version=4.1.2, data_size=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "flags=DM_SUSPEND_FLAG}) = -1 EBADF (%m)\n", sizeof(s.ioc)); init_s(&s.ioc, sizeof(s.ioc), 0); s.ioc.event_nr = 0xbadc0ded; ioctl(-1, DM_DEV_SUSPEND, &s); printf("ioctl(-1, DM_DEV_SUSPEND, " - "{version=4.1.2, data_size=%zu, dev=makedev(18, 52), " + "{version=4.1.2, data_size=%zu, dev=makedev(0x12, 0x34), " "name=\"nnn\", uuid=\"uuu\", event_nr=3134983661, " "flags=0}) = -1 EBADF (%m)\n", sizeof(s.ioc)); @@ -364,7 +349,7 @@ main(void) ioctl(-1, DM_TABLE_LOAD, &s); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%u, data_start=%u, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=1, flags=0, " # if VERBOSE "{sector_start=16, length=32, target_type=\"tgt\", " @@ -381,7 +366,7 @@ main(void) ioctl(-1, DM_TABLE_LOAD, dm_arg); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=0, flags=0}) = -1 EBADF (%m)\n", sizeof(*dm_arg), min_sizeof_dm_ioctl); @@ -392,11 +377,11 @@ main(void) ioctl(-1, DM_TABLE_LOAD, dm_arg); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%zu, data_start=%u, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=1234, flags=0, " # if VERBOSE - "/* misplaced struct dm_target_spec */ ..." -# else /* !VERBOSE */ + "??? /* misplaced struct dm_target_spec */" +# else "..." # endif /* VERBOSE */ "}) = -1 EBADF (%m)\n", sizeof(*dm_arg), 0xfffffff8); @@ -409,7 +394,7 @@ main(void) ioctl(-1, DM_TABLE_LOAD, dm_arg_open1); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=3735936673, flags=0, " # if VERBOSE "%p" @@ -437,7 +422,7 @@ main(void) errstr = sprintrc(rc); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=2, flags=0, ", sizeof(*dm_arg_open2), offsetof(struct dm_table_open_test, target1)); @@ -481,7 +466,7 @@ main(void) errstr = sprintrc(rc); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=4, flags=0, ", offsetof(struct dm_table_open_test, target5), offsetof(struct dm_table_open_test, target0)); @@ -491,13 +476,13 @@ main(void) print_dm_target_spec(&dm_arg_open3->target1, 15); printf("\"\\377\"}, "); print_dm_target_spec(&dm_arg_open3->target1, 42); - printf("\"\\1\\2\"}, /* misplaced struct dm_target_spec */ ..."); + printf("\"\\1\\2\"}, ??? /* misplaced struct dm_target_spec */"); # else /* !VERBOSE */ printf("..."); # endif /* VERBOSE */ printf("}) = %s\n", errstr); - #define FILL_DM_TARGET(id, id_next) \ +# define FILL_DM_TARGET(id, id_next) \ do { \ init_dm_target_spec(&dm_arg_open3->target##id, id); \ dm_arg_open3->target##id.next = \ @@ -505,10 +490,10 @@ main(void) target##id_next) - \ offsetof(struct dm_table_open_test, \ target##id); \ - strncpy(dm_arg_open3->param##id, str129 + id * 2, id); \ + memcpy(dm_arg_open3->param##id, str129 + id * 2, id); \ dm_arg_open3->param##id[id] = '\0'; \ } while (0) - #define PRINT_DM_TARGET(id) \ +# define PRINT_DM_TARGET(id) \ do { \ print_dm_target_spec(&dm_arg_open3->target##id, id); \ printf("\"%.*s\"}, ", id, str129 + id * 2); \ @@ -532,7 +517,7 @@ main(void) errstr = sprintrc(rc); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=3134983661, flags=0, ", sizeof(*dm_arg_open3), offsetof(struct dm_table_open_test, target0)); @@ -558,7 +543,7 @@ main(void) ioctl(-1, DM_TARGET_MSG, &s); printf("ioctl(-1, DM_TARGET_MSG, " "{version=4.1.2, data_size=%u, data_start=%u, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0, " # if VERBOSE "{sector=4660, message=\"long targ\"...}" # else /* !VERBOSE */ @@ -573,9 +558,9 @@ main(void) ioctl(-1, DM_TARGET_MSG, dm_arg); printf("ioctl(-1, DM_TARGET_MSG, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0, " # if VERBOSE - "/* misplaced struct dm_target_msg */" + "??? /* misplaced struct dm_target_msg */" # else /* !VERBOSE */ "..." # endif /* VERBOSE */ @@ -588,9 +573,9 @@ main(void) ioctl(-1, DM_TARGET_MSG, dm_arg); printf("ioctl(-1, DM_TARGET_MSG, " "{version=4.1.2, data_size=%zu, data_start=%u, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0, " # if VERBOSE - "/* misplaced struct dm_target_msg */" + "??? /* misplaced struct dm_target_msg */" # else /* !VERBOSE */ "..." # endif /* VERBOSE */ @@ -604,7 +589,7 @@ main(void) ioctl(-1, DM_TARGET_MSG, dm_arg); printf("ioctl(-1, DM_TARGET_MSG, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0, " # if VERBOSE "%p" # else /* !VERBOSE */ @@ -627,7 +612,7 @@ main(void) errstr = sprintrc(rc); printf("ioctl(-1, DM_TARGET_MSG, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, ", + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0, ", sizeof(*dm_arg_msg) + 1, offsetof(struct dm_target_msg_test, msg)); # if VERBOSE @@ -648,7 +633,7 @@ main(void) errstr = sprintrc(rc); printf("ioctl(-1, DM_TARGET_MSG, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, ", + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0, ", sizeof(*dm_arg_msg), offsetof(struct dm_target_msg_test, msg)); # if VERBOSE printf("{sector=%" PRI__u64 ", message=\"\"}", @@ -665,7 +650,7 @@ main(void) ioctl(-1, DM_DEV_SET_GEOMETRY, &s); printf("ioctl(-1, DM_DEV_SET_GEOMETRY, " "{version=4.1.2, data_size=%u, data_start=%u, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0, " # if VERBOSE "string=\"10 20 30 \"..." # else /* !VERBOSE */ @@ -683,7 +668,7 @@ main(void) ioctl(-1, DM_DEV_RENAME, unaligned_dm_arg); printf("ioctl(-1, DM_DEV_RENAME, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", event_nr=0, " "flags=0, " # if VERBOSE "string=%p" @@ -703,10 +688,10 @@ main(void) ioctl(-1, DM_DEV_RENAME, &s); printf("ioctl(-1, DM_DEV_RENAME, " "{version=4.1.2, data_size=%u, data_start=3735928559, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", event_nr=0, " "flags=0, " # if VERBOSE - "/* misplaced string */" + "??? /* misplaced string */" # else /* !VERBOSE */ "..." # endif /* VERBOSE */ @@ -720,7 +705,7 @@ main(void) ioctl(-1, DM_DEV_RENAME, &s); printf("ioctl(-1, DM_DEV_RENAME, " "{version=4.1.2, data_size=%u, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", event_nr=0, " "flags=0, " # if VERBOSE "string=\"nn\"" @@ -737,7 +722,7 @@ main(void) ioctl(-1, DM_DEV_RENAME, &s); printf("ioctl(-1, DM_DEV_RENAME, " "{version=4.1.2, data_size=%u, data_start=%u, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", event_nr=0, " "flags=0, " # if VERBOSE "string=\"new long \"..." @@ -754,13 +739,15 @@ main(void) ioctl(-1, DM_TABLE_LOAD, &s); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%u, data_start=%u, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=4294967295, flags=0, " # if VERBOSE - "{sector_start=0, length=0, target_type=\"\", string=\"\"}, " - "/* misplaced struct dm_target_spec */ " + "{sector_start=0, length=0, target_type=\"\", string=\"\"}" + ", ??? /* misplaced struct dm_target_spec */" +# else + "..." # endif /* VERBOSE */ - "...}) = -1 EBADF (%m)\n", + "}) = -1 EBADF (%m)\n", s.ioc.data_size, s.ioc.data_start); puts("+++ exited with 0 +++"); diff --git a/tests-mx32/ioctl_dm.gen.test b/tests-mx32/ioctl_dm.gen.test new file mode 100755 index 00000000..b60c7175 --- /dev/null +++ b/tests-mx32/ioctl_dm.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_dm +ioctl.test -s9); do not edit. +set -- -s9 +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_dm.test b/tests-mx32/ioctl_dm.test deleted file mode 100755 index 64852051..00000000 --- a/tests-mx32/ioctl_dm.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check decoding of DM* ioctls. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a16 -s9 -eioctl $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/ioctl_evdev-success-v.c b/tests-mx32/ioctl_evdev-success-v.c new file mode 100644 index 00000000..6fc35477 --- /dev/null +++ b/tests-mx32/ioctl_evdev-success-v.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "ioctl_evdev-success.c" diff --git a/tests-mx32/ioctl_evdev-success-v.test b/tests-mx32/ioctl_evdev-success-v.test new file mode 100755 index 00000000..faedee30 --- /dev/null +++ b/tests-mx32/ioctl_evdev-success-v.test @@ -0,0 +1,18 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +: ${IOCTL_INJECT_START=256} +: ${IOCTL_INJECT_RETVAL=8} + +run_prog +run_strace -a16 -v -e trace=ioctl \ + -e inject=ioctl:retval="${IOCTL_INJECT_RETVAL}":when="${IOCTL_INJECT_START}+" \ + ../ioctl_evdev-success-v "${IOCTL_INJECT_START}" "${IOCTL_INJECT_RETVAL}"> "$EXP" +grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests-mx32/ioctl_evdev-success.c b/tests-mx32/ioctl_evdev-success.c new file mode 100644 index 00000000..7887d417 --- /dev/null +++ b/tests-mx32/ioctl_evdev-success.c @@ -0,0 +1,239 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_INPUT_H + +# include +# include +# include +# include +# include +# include "print_fields.h" + +static const char *errstr; + +struct evdev_check { + unsigned long cmd; + const char *cmd_str; + void *arg_ptr; + void (*print_arg)(long rc, void *ptr, void *arg); +}; + +static long +invoke_test_syscall(unsigned long cmd, void *p) +{ + long rc = ioctl(-1, cmd, p); + errstr = sprintrc(rc); + static char inj_errstr[4096]; + + snprintf(inj_errstr, sizeof(inj_errstr), "%s (INJECTED)", errstr); + errstr = inj_errstr; + return rc; +} + +static void +test_evdev(struct evdev_check *check, void *arg) +{ + long rc = invoke_test_syscall(check->cmd, check->arg_ptr); + printf("ioctl(-1, %s, ", check->cmd_str); + if (check->print_arg) + check->print_arg(rc, check->arg_ptr, arg); + else + printf("%p", check->arg_ptr); + printf(") = %s\n", errstr); +} + +static void +print_input_absinfo(long rc, void *ptr, void *arg) +{ + struct input_absinfo *absinfo = ptr; + + if (rc < 0) { + printf("%p", absinfo); + return; + } + PRINT_FIELD_U("{", *absinfo, value); + PRINT_FIELD_U(", ", *absinfo, minimum); +# if VERBOSE + PRINT_FIELD_U(", ", *absinfo, maximum); + PRINT_FIELD_U(", ", *absinfo, fuzz); + PRINT_FIELD_U(", ", *absinfo, flat); +# ifdef HAVE_STRUCT_INPUT_ABSINFO_RESOLUTION + PRINT_FIELD_U(", ", *absinfo, resolution); +# endif +# else + printf(", ..."); +# endif + printf("}"); +} + +static void +print_input_id(long rc, void *ptr, void *arg) +{ + struct input_id *id = ptr; + + if (rc < 0) { + printf("%p", id); + return; + } + printf("{ID_BUS=%" PRIu16 + ", ID_VENDOR=%" PRIu16 + ", ID_PRODUCT=%" PRIu16 + ", ID_VERSION=%" PRIu16 "}", + id->bustype, id->vendor, id->product, id->version); +} + +# ifdef EVIOCGMTSLOTS +static void +print_mtslots(long rc, void *ptr, void *arg) +{ + int *buffer = ptr; + const char **str = arg; + int num = atoi(*(str + 1)); + + if (rc < 0) { + printf("%p", buffer); + return; + } + + printf("{code=%s", *str); + printf(", values=["); + for (unsigned int i = 1; i <= (unsigned) num; i++) + printf("%s%s", i > 1 ? ", " : "", *(str + i + 1)); + printf("]}"); +} +# endif + +static void +print_getbit(long rc, void *ptr, void *arg) +{ + const char **str = arg; + int num = atoi(*str); + + if (rc < 0) { + printf("%p", ptr); + return; + } + + printf("["); + printf("%s", *(str + 1)); + for (unsigned int i = 2; i <= (unsigned) num; i++) { +# if ! VERBOSE + if (i > 4) { + printf(", ..."); + break; + } +# endif + printf(", "); + printf("%s", *(str + i)); + } + printf("]"); +} + +int +main(int argc, char **argv) +{ + unsigned long num_skip; + long inject_retval; + bool locked = false; + + if (argc == 1) + return 0; + + if (argc < 3) + error_msg_and_fail("Usage: %s NUM_SKIP INJECT_RETVAL", argv[0]); + + num_skip = strtoul(argv[1], NULL, 0); + inject_retval = strtol(argv[2], NULL, 0); + + if (inject_retval < 0) + error_msg_and_fail("Expected non-negative INJECT_RETVAL, " + "but got %ld", inject_retval); + + for (unsigned int i = 0; i < num_skip; i++) { + long rc = ioctl(-1, EVIOCGID, NULL); + printf("ioctl(-1, EVIOCGID, NULL) = %s%s\n", + sprintrc(rc), + rc == inject_retval ? " (INJECTED)" : ""); + + if (rc != inject_retval) + continue; + + locked = true; + break; + } + + if (!locked) + error_msg_and_fail("Hasn't locked on ioctl(-1" + ", EVIOCGID, NULL) returning %lu", + inject_retval); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct input_id, id); + TAIL_ALLOC_OBJECT_CONST_PTR(struct input_absinfo, absinfo); + TAIL_ALLOC_OBJECT_CONST_PTR(int, bad_addr_slot); +# ifdef EVIOCGMTSLOTS + int mtslots[] = { ABS_MT_SLOT, 1, 3 }; + /* we use the second element to indicate the number of values */ + /* mtslots_str[1] is "2" so the number of values is 2 */ + const char *mtslots_str[] = { "ABS_MT_SLOT", "2", "1", "3" }; + + /* invalid flag */ + int invalid_mtslot[] = { -1, 1 }; + char invalid_str[4096]; + snprintf(invalid_str, sizeof(invalid_str), "%#x /* ABS_MT_??? */", invalid_mtslot[0]); + const char *invalid_mtslot_str[] = { invalid_str, "1", "1" }; +# endif + + /* set more than 4 bits */ + unsigned long ev_more[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED | 1 << EV_SND | 1 << EV_PWR }; + /* we use the first element to indicate the number of set bits */ + /* ev_more_str[0] is "5" so the number of set bits is 5 */ + const char *ev_more_str[] = { "5", "EV_ABS", "EV_MSC", "EV_LED", "EV_SND", "EV_PWR" }; + + /* set less than 4 bits */ + unsigned long ev_less[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED }; + const char *ev_less_str[] = { "3", "EV_ABS", "EV_MSC", "EV_LED" }; + + /* set zero bit */ + unsigned long ev_zero[] = { 0x0 }; + const char *ev_zero_str[] = { "0", " 0 " }; + + /* KEY_MAX is 0x2ff which is greater than retval * 8 */ + unsigned long key[] = { 1 << KEY_1 | 1 << KEY_2, 0 }; + const char *key_str[] = { "2", "KEY_1", "KEY_2" }; + + struct { + struct evdev_check check; + void *ptr; + } a[] = { + { { ARG_STR(EVIOCGID), id, print_input_id }, NULL }, + { { ARG_STR(EVIOCGABS(ABS_X)), absinfo, print_input_absinfo }, NULL }, + { { ARG_STR(EVIOCGABS(ABS_Y)), absinfo, print_input_absinfo }, NULL }, + { { ARG_STR(EVIOCGABS(ABS_Y)), absinfo, print_input_absinfo }, NULL }, + { { ARG_STR(EVIOCGBIT(0, 0)), ev_more, print_getbit }, &ev_more_str }, + { { ARG_STR(EVIOCGBIT(0, 0)), ev_less, print_getbit }, &ev_less_str }, + { { ARG_STR(EVIOCGBIT(0, 0)), ev_zero, print_getbit }, &ev_zero_str }, + { { ARG_STR(EVIOCGBIT(EV_KEY, 0)), key, print_getbit }, &key_str}, +# ifdef EVIOCGMTSLOTS + { { ARG_STR(EVIOCGMTSLOTS(12)), mtslots, print_mtslots }, &mtslots_str }, + { { ARG_STR(EVIOCGMTSLOTS(8)), invalid_mtslot, print_mtslots }, &invalid_mtslot_str } +# endif + }; + for (unsigned int i = 0; i < ARRAY_SIZE(a); i++) { + test_evdev(&a[i].check, a[i].ptr); + } + + puts("+++ exited with 0 +++"); + return 0; +} +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_INPUT_H") + +#endif diff --git a/tests-mx32/ioctl_evdev-success.test b/tests-mx32/ioctl_evdev-success.test new file mode 100755 index 00000000..54b0a20a --- /dev/null +++ b/tests-mx32/ioctl_evdev-success.test @@ -0,0 +1,18 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +: ${IOCTL_INJECT_START=256} +: ${IOCTL_INJECT_RETVAL=8} + +run_prog +run_strace -a16 -e trace=ioctl \ + -e inject=ioctl:retval="${IOCTL_INJECT_RETVAL}":when="${IOCTL_INJECT_START}+" \ + ../ioctl_evdev-success "${IOCTL_INJECT_START}" "${IOCTL_INJECT_RETVAL}"> "$EXP" +grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests-mx32/ioctl_evdev-v.gen.test b/tests-mx32/ioctl_evdev-v.gen.test new file mode 100755 index 00000000..bf74ef4c --- /dev/null +++ b/tests-mx32/ioctl_evdev-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_evdev-v +ioctl.test -v); do not edit. +set -- -v +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_evdev-v.test b/tests-mx32/ioctl_evdev-v.test deleted file mode 100755 index 87941010..00000000 --- a/tests-mx32/ioctl_evdev-v.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check verbose decoding EVIOC* ioctls. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a16 -veioctl $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/ioctl_evdev.c b/tests-mx32/ioctl_evdev.c index d12323ee..02be472c 100644 --- a/tests-mx32/ioctl_evdev.c +++ b/tests-mx32/ioctl_evdev.c @@ -2,29 +2,10 @@ * This file is part of ioctl_evdev strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -38,6 +19,13 @@ # include # include +# ifndef EV_SW +# define EV_SW 5 +# endif +# ifndef ABS_MT_TOOL_Y +# define ABS_MT_TOOL_Y 0x3d +# endif + static const unsigned int magic = 0xdeadbeef; static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; @@ -66,9 +54,13 @@ print_ffe_common(const struct ff_effect *const ffe, const char *const type_str) # endif /* VERBOSE */ } -# define TEST_NULL_ARG(cmd) \ - ioctl(-1, cmd, 0); \ - printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd) +# define TEST_NULL_ARG_EX(cmd, str) \ + do { \ + ioctl(-1, cmd, 0); \ + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", str); \ + } while (0) + +# define TEST_NULL_ARG(cmd) TEST_NULL_ARG_EX(cmd, #cmd) int main(void) @@ -102,6 +94,7 @@ main(void) TEST_NULL_ARG(EVIOCGLED(0)); # ifdef EVIOCGMTSLOTS TEST_NULL_ARG(EVIOCGMTSLOTS(0)); + TEST_NULL_ARG(EVIOCGMTSLOTS(8)); # endif # ifdef EVIOCGPROP TEST_NULL_ARG(EVIOCGPROP(0)); @@ -114,14 +107,24 @@ main(void) TEST_NULL_ARG(EVIOCGABS(ABS_X)); TEST_NULL_ARG(EVIOCSABS(ABS_X)); - TEST_NULL_ARG(EVIOCGBIT(EV_SYN, 0)); + TEST_NULL_ARG_EX(EVIOCGABS(0xe), "EVIOCGABS(0xe /* ABS_??? */)"); + TEST_NULL_ARG_EX(EVIOCSABS(0xe), "EVIOCSABS(0xe /* ABS_??? */)"); + + TEST_NULL_ARG(EVIOCGABS(ABS_MT_TOOL_Y)); + TEST_NULL_ARG(EVIOCSABS(ABS_MT_TOOL_Y)); + + TEST_NULL_ARG_EX(EVIOCGABS(0x3e), "EVIOCGABS(0x3e /* ABS_??? */)"); + TEST_NULL_ARG_EX(EVIOCSABS(0x3e), "EVIOCSABS(0x3e /* ABS_??? */)"); + + TEST_NULL_ARG_EX(EVIOCGABS(0x3f), "EVIOCGABS(0x3f /* ABS_??? */)"); + TEST_NULL_ARG_EX(EVIOCSABS(0x3f), "EVIOCSABS(0x3f /* ABS_??? */)"); + + TEST_NULL_ARG(EVIOCGBIT(0, 0)); TEST_NULL_ARG(EVIOCGBIT(EV_KEY, 1)); TEST_NULL_ARG(EVIOCGBIT(EV_REL, 2)); TEST_NULL_ARG(EVIOCGBIT(EV_ABS, 3)); TEST_NULL_ARG(EVIOCGBIT(EV_MSC, 4)); -# ifdef EV_SW TEST_NULL_ARG(EVIOCGBIT(EV_SW, 5)); -# endif TEST_NULL_ARG(EVIOCGBIT(EV_LED, 6)); TEST_NULL_ARG(EVIOCGBIT(EV_SND, 7)); TEST_NULL_ARG(EVIOCGBIT(EV_REP, 8)); @@ -129,6 +132,12 @@ main(void) TEST_NULL_ARG(EVIOCGBIT(EV_PWR, 10)); TEST_NULL_ARG(EVIOCGBIT(EV_FF_STATUS, 11)); + TEST_NULL_ARG_EX(EVIOCGBIT(0x6, 12), "EVIOCGBIT(0x6 /* EV_??? */, 12)"); + TEST_NULL_ARG_EX(EVIOCGBIT(0x18, 13), + "EVIOCGBIT(0x18 /* EV_??? */, 13)"); + TEST_NULL_ARG_EX(EVIOCGBIT(0x1f, 14), + "EVIOCGBIT(0x1f /* EV_??? */, 14)"); + ioctl(-1, EVIOCGBIT(EV_MAX, 42), 0); printf("ioctl(-1, EVIOCGBIT(%#x /* EV_??? */, 42), NULL)" " = -1 EBADF (%m)\n", EV_MAX); @@ -148,7 +157,7 @@ main(void) void *const page = tail_alloc(size); fill_memory(page, size); - int *const val_int = tail_alloc(sizeof(*val_int)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, val_int); *val_int = magic; # ifdef EVIOCSCLOCKID @@ -172,7 +181,7 @@ main(void) pair_int[0], "KEY_ESC"); # ifdef EVIOCSKEYCODE_V2 - struct input_keymap_entry *const ike = tail_alloc(sizeof(*ike)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct input_keymap_entry, ike); fill_memory(ike, sizeof(*ike)); ike->keycode = 2; @@ -196,24 +205,24 @@ main(void) printf("}) = -1 EBADF (%m)\n"); # endif - struct ff_effect *const ffe = tail_alloc(sizeof(*ffe)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct ff_effect, ffe); fill_memory(ffe, sizeof(*ffe)); ffe->type = FF_CONSTANT; ioctl(-1, EVIOCSFF, ffe); print_ffe_common(ffe, "FF_CONSTANT"); -# if VERBOSE +# if VERBOSE printf(", constant={level=%hd", ffe->u.constant.level); print_envelope(&ffe->u.constant.envelope); printf("}"); -# else +# else printf("..."); -# endif +# endif errno = EBADF; printf("}) = -1 EBADF (%m)\n"); -# if VERBOSE +# if VERBOSE ffe->type = FF_RAMP; ioctl(-1, EVIOCSFF, ffe); print_ffe_common(ffe, "FF_RAMP"); @@ -250,7 +259,7 @@ main(void) print_ffe_common(ffe, "0xff /* FF_??? */"); errno = EBADF; printf("}) = -1 EBADF (%m)\n"); -# endif +# endif ioctl(-1, _IOC(_IOC_READ, 0x45, 0x1, 0xff), lmagic); printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", diff --git a/tests-mx32/ioctl_evdev.gen.test b/tests-mx32/ioctl_evdev.gen.test new file mode 100755 index 00000000..68a43f7c --- /dev/null +++ b/tests-mx32/ioctl_evdev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_evdev +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_evdev.test b/tests-mx32/ioctl_evdev.test deleted file mode 100755 index 7ed2e98a..00000000 --- a/tests-mx32/ioctl_evdev.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of EVIOC* ioctls. - -. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_inotify.c b/tests-mx32/ioctl_inotify.c new file mode 100644 index 00000000..6be0c0ee --- /dev/null +++ b/tests-mx32/ioctl_inotify.c @@ -0,0 +1,61 @@ +/* + * This file is part of ioctl_inotify strace test. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include + +#ifndef INOTIFY_IOC_SETNEXTWD +# define INOTIFY_IOC_SETNEXTWD _IOW('I', 0, int32_t) +#endif + +static long +sys_ioctl(kernel_long_t fd, kernel_ulong_t cmd, kernel_ulong_t arg) +{ + return syscall(__NR_ioctl, fd, cmd, arg); +} + +int +main(void) +{ + static const kernel_ulong_t unknown_inotify_cmd = + (kernel_ulong_t) 0xbadc0dedfeed49edULL; + static const kernel_ulong_t magic = + (kernel_ulong_t) 0xdeadbeefbadc0dedULL; + + /* Unknown inotify commands */ + sys_ioctl(-1, unknown_inotify_cmd, magic); + printf("ioctl(-1, _IOC(%s_IOC_READ|_IOC_WRITE, 0x49, %#x, %#x), " + "%#lx) = -1 EBADF (%m)\n", + _IOC_DIR((unsigned int) unknown_inotify_cmd) & _IOC_NONE ? + "_IOC_NONE|" : "", + _IOC_NR((unsigned int) unknown_inotify_cmd), + _IOC_SIZE((unsigned int) unknown_inotify_cmd), + (unsigned long) magic); + + sys_ioctl(-1, INOTIFY_IOC_SETNEXTWD + 1, magic); + printf("ioctl(-1, _IOC(_IOC_WRITE, 0x49, %#x, %#x), %#lx)" + " = -1 EBADF (%m)\n", + (unsigned int) _IOC_NR(INOTIFY_IOC_SETNEXTWD + 1), + (unsigned int) _IOC_SIZE(INOTIFY_IOC_SETNEXTWD + 1), + (unsigned long) magic); + + /* INOTIFY_IOC_SETNEXTWD */ + sys_ioctl(-1, INOTIFY_IOC_SETNEXTWD, magic); + printf("ioctl(-1, INOTIFY_IOC_SETNEXTWD, %d) = -1 EBADF (%m)\n", + (int) magic); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/ioctl_inotify.gen.test b/tests-mx32/ioctl_inotify.gen.test new file mode 100755 index 00000000..237a98b8 --- /dev/null +++ b/tests-mx32/ioctl_inotify.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_inotify +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_kvm_run-v.c b/tests-mx32/ioctl_kvm_run-v.c new file mode 100644 index 00000000..388339b0 --- /dev/null +++ b/tests-mx32/ioctl_kvm_run-v.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "ioctl_kvm_run.c" diff --git a/tests-mx32/ioctl_kvm_run-v.gen.test b/tests-mx32/ioctl_kvm_run-v.gen.test new file mode 100755 index 00000000..6f20ee48 --- /dev/null +++ b/tests-mx32/ioctl_kvm_run-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_kvm_run-v +ioctl.test -v -a36 -y); do not edit. +set -- -v -a36 -y +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_kvm_run.c b/tests-mx32/ioctl_kvm_run.c new file mode 100644 index 00000000..4a569708 --- /dev/null +++ b/tests-mx32/ioctl_kvm_run.c @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "ioctl_kvm_run_common.c" + +#if need_print_KVM_RUN + +static void +print_KVM_RUN(const int fd, const char *const dev, const unsigned int reason) +{ + printf("ioctl(%d<%s>, KVM_RUN, 0) = 0\n", fd, dev); +} + +#endif diff --git a/tests-mx32/ioctl_kvm_run.gen.test b/tests-mx32/ioctl_kvm_run.gen.test new file mode 100755 index 00000000..7ab473ba --- /dev/null +++ b/tests-mx32/ioctl_kvm_run.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_kvm_run +ioctl.test -a36 -y); do not edit. +set -- -a36 -y +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_kvm_run_auxstr_vcpu.c b/tests-mx32/ioctl_kvm_run_auxstr_vcpu.c new file mode 100644 index 00000000..9140d3b2 --- /dev/null +++ b/tests-mx32/ioctl_kvm_run_auxstr_vcpu.c @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#define KVM_NO_CPUID_CALLBACK \ + error_msg_and_skip("newer kernel (>= 4.16) is needed") + +#include "ioctl_kvm_run_common.c" + +#if need_print_KVM_RUN + +static void +print_KVM_RUN(const int fd, const char *const dev, const unsigned int reason) +{ + const char *str; + +# define CASE_ENTRY(R) case R: str = #R; break + switch (reason) { + CASE_ENTRY(KVM_EXIT_HLT); + CASE_ENTRY(KVM_EXIT_IO); + CASE_ENTRY(KVM_EXIT_MMIO); + default: str = "???"; + } + + printf("ioctl(%d<%s>, KVM_RUN, 0) = 0 (%s)\n", fd, dev, str); +} + +#endif diff --git a/tests-mx32/ioctl_kvm_run_auxstr_vcpu.gen.test b/tests-mx32/ioctl_kvm_run_auxstr_vcpu.gen.test new file mode 100755 index 00000000..d2995db8 --- /dev/null +++ b/tests-mx32/ioctl_kvm_run_auxstr_vcpu.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_kvm_run_auxstr_vcpu +ioctl.test -a36 -y -e kvm=vcpu); do not edit. +set -- -a36 -y -e kvm=vcpu +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_kvm_run_common.c b/tests-mx32/ioctl_kvm_run_common.c new file mode 100644 index 00000000..26e72cec --- /dev/null +++ b/tests-mx32/ioctl_kvm_run_common.c @@ -0,0 +1,412 @@ +/* + * Check decoding of KVM_* commands of ioctl syscall using /dev/kvm API. + * Based on kvmtest.c from https://lwn.net/Articles/658512/ + * + * kvmtest.c author: Josh Triplett + * Copyright (c) 2015 Intel Corporation + * Copyright (c) 2017-2018 The strace developers. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include "tests.h" + +#if defined HAVE_LINUX_KVM_H \ + && defined HAVE_STRUCT_KVM_CPUID2 \ + && defined HAVE_STRUCT_KVM_REGS \ + && defined HAVE_STRUCT_KVM_SREGS \ + && defined HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION \ + &&(defined __x86_64__ || defined __i386__) + +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# ifndef KVM_MAX_CPUID_ENTRIES +# define KVM_MAX_CPUID_ENTRIES 80 +# endif + +# include "xlat.h" +# include "xlat/kvm_cpuid_flags.h" + +static int +kvm_ioctl(int fd, unsigned long cmd, const char *cmd_str, void *arg) +{ + int rc = ioctl(fd, cmd, arg); + if (rc < 0) + perror_msg_and_skip("%s", cmd_str); + return rc; +} + +# define KVM_IOCTL(fd_, cmd_, arg_) \ + kvm_ioctl((fd_), (cmd_), #cmd_, (arg_)) + +static const char dev[] = "/dev/kvm"; +static const char vm_dev[] = "anon_inode:kvm-vm"; +static char vcpu_dev[] = "anon_inode:kvm-vcpu:0"; +static size_t page_size; + +extern const char code[]; +extern const unsigned short code_size; + +__asm__( + ".type code, @object \n" + "code: \n" + " mov $0xd80003f8, %edx \n" + " mov $'\n', %al \n" + " out %al, (%dx) \n" + " hlt \n" + ".size code, . - code \n" + ".type code_size, @object \n" + "code_size: \n" + " .short . - code \n" + ".size code_size, . - code_size \n" + ); + +static void +print_kvm_segment(const struct kvm_segment *seg) +{ + printf("{base=%#jx, limit=%u, selector=%u, type=%u, present=%u, " + "dpl=%u, db=%u, s=%u, l=%u, g=%u, avl=%u}", + (uintmax_t) seg->base, seg->limit, seg->selector, seg->type, + seg->present, seg->dpl, seg->db, seg->s, seg->l, seg->g, + seg->avl); +} + +static void +print_kvm_sregs(const struct kvm_sregs *sregs) +{ + printf("{cs="); + print_kvm_segment(&sregs->cs); +# if VERBOSE + printf(", ds="); + print_kvm_segment(&sregs->ds); + printf(", es="); + print_kvm_segment(&sregs->es); + printf(", fs="); + print_kvm_segment(&sregs->fs); + printf(", gs="); + print_kvm_segment(&sregs->gs); + printf(", ss="); + print_kvm_segment(&sregs->ss); + printf(", tr="); + print_kvm_segment(&sregs->tr); + printf(", ldt="); + print_kvm_segment(&sregs->ldt); + printf(", gdt={base=%#jx, limit=%u}, idt={base=%#jx, limit=%u}, " + "cr0=%llu, cr2=%llu, cr3=%llu, cr4=%llu, cr8=%llu, efer=%llu, " + "apic_base=%#jx", (uintmax_t) sregs->gdt.base, sregs->gdt.limit, + (uintmax_t) sregs->idt.base, sregs->idt.limit, sregs->cr0, + sregs->cr2, sregs->cr3, sregs->cr4, sregs->cr8, sregs->efer, + (uintmax_t)sregs->apic_base); + printf(", interrupt_bitmap=["); + for (size_t i = 0; i < ARRAY_SIZE(sregs->interrupt_bitmap); i++) { + if (i) + printf(", "); + printf("%#jx", (uintmax_t) sregs->interrupt_bitmap[i]); + } + printf("]"); +# else + printf(", ..."); +# endif + printf("}"); +} + +static void +print_kvm_regs(const struct kvm_regs *regs) +{ + printf("{rax=%#jx", (uintmax_t) regs->rax); +# if VERBOSE + printf(", rbx=%#jx, rcx=%#jx, rdx=%#jx, rsi=%#jx, rdi=%#jx", + (uintmax_t) regs->rbx, (uintmax_t) regs->rcx, + (uintmax_t) regs->rdx, (uintmax_t) regs->rsi, + (uintmax_t) regs->rdi); +# else + printf(", ..."); +# endif + printf(", rsp=%#jx, rbp=%#jx", (uintmax_t) regs->rsp, + (uintmax_t) regs->rbp); +# if VERBOSE + printf(", r8=%#jx, r9=%#jx, r10=%#jx, r11=%#jx, r12=%#jx, r13=%#jx" + ", r14=%#jx, r15=%#jx", + (uintmax_t) regs->r8, (uintmax_t) regs->r9, + (uintmax_t) regs->r10, (uintmax_t) regs->r11, + (uintmax_t) regs->r12, (uintmax_t) regs->r13, + (uintmax_t) regs->r14, (uintmax_t) regs->r15); +# else + printf(", ..."); +# endif + printf(", rip=%#jx, rflags=%#jx}", (uintmax_t) regs->rip, + (uintmax_t) regs->rflags); +} + +# define need_print_KVM_RUN 1 + +static void +print_KVM_RUN(const int fd, const char *const dev, const unsigned int reason); + +static void +run_kvm(const int vcpu_fd, struct kvm_run *const run, const size_t mmap_size, + void *const mem) +{ + /* Initialize CS to point at 0, via a read-modify-write of sregs. */ + struct kvm_sregs sregs; + KVM_IOCTL(vcpu_fd, KVM_GET_SREGS, &sregs); + printf("ioctl(%d<%s>, KVM_GET_SREGS, ", vcpu_fd, vcpu_dev); + print_kvm_sregs(&sregs); + printf(") = 0\n"); + + sregs.cs.base = 0; + sregs.cs.selector = 0; + KVM_IOCTL(vcpu_fd, KVM_SET_SREGS, &sregs); + printf("ioctl(%d<%s>, KVM_SET_SREGS, ", vcpu_fd, vcpu_dev); + print_kvm_sregs(&sregs); + printf(") = 0\n"); + + /* + * Initialize registers: instruction pointer for our code, addends, + * and initial flags required by x86 architecture. + */ + struct kvm_regs regs = { + .rip = page_size, + .rax = 2, + .rbx = 2, + .rflags = 0x2, + }; + KVM_IOCTL(vcpu_fd, KVM_SET_REGS, ®s); + printf("ioctl(%d<%s>, KVM_SET_REGS, ", vcpu_fd, vcpu_dev); + print_kvm_regs(®s); + printf(") = 0\n"); + + /* Copy the code */ + memcpy(mem, code, code_size); + + const char *p = "\n"; + + /* Repeatedly run code and handle VM exits. */ + for (;;) { + KVM_IOCTL(vcpu_fd, KVM_RUN, NULL); + print_KVM_RUN(vcpu_fd, vcpu_dev, run->exit_reason); + + switch (run->exit_reason) { + case KVM_EXIT_HLT: + if (p) + error_msg_and_fail("premature KVM_EXIT_HLT"); + return; + case KVM_EXIT_IO: + if (run->io.direction == KVM_EXIT_IO_OUT + && run->io.size == 1 + && run->io.port == 0x03f8 + && run->io.count == 1 + && run->io.data_offset < mmap_size + && p && *p == ((char *) run)[run->io.data_offset]) + p = NULL; + else + error_msg_and_fail("unhandled KVM_EXIT_IO"); + break; + case KVM_EXIT_MMIO: + error_msg_and_fail("Got an unexpected MMIO exit:" + " phys_addr %#llx," + " data %02x %02x %02x %02x" + " %02x %02x %02x %02x," + " len %u, is_write %hhu", + (unsigned long long) run->mmio.phys_addr, + run->mmio.data[0], run->mmio.data[1], + run->mmio.data[2], run->mmio.data[3], + run->mmio.data[4], run->mmio.data[5], + run->mmio.data[6], run->mmio.data[7], + run->mmio.len, run->mmio.is_write); + + default: + error_msg_and_fail("exit_reason = %#x", + run->exit_reason); + } + } +} + +static int +vcpu_dev_should_have_cpuid(int fd) +{ + int r = 0; + char *filename = NULL; + char buf[sizeof(vcpu_dev)]; + + if (asprintf(&filename, "/proc/%d/fd/%d", getpid(), fd) < 0) + error_msg_and_fail("asprintf"); + + if (readlink(filename, buf, sizeof(buf)) == sizeof(buf) - 1 + && (memcmp(buf, vcpu_dev, sizeof(buf) - 1) == 0)) + r = 1; + free(filename); + return r; +} + +static void +print_cpuid_ioctl(int fd, const char *fd_dev, + const char *ioctl_name, const struct kvm_cpuid2 *cpuid) +{ + printf("ioctl(%d<%s>, %s, {nent=%u, entries=[", + fd, fd_dev, ioctl_name, cpuid->nent); +# if VERBOSE + for (size_t i = 0; i < cpuid->nent; i++) { + if (i) + printf(", "); + printf("{function=%#x, index=%#x, flags=", + cpuid->entries[i].function, cpuid->entries[i].index); + printflags(kvm_cpuid_flags, cpuid->entries[i].flags, + "KVM_CPUID_FLAG_???"); + printf(", eax=%#x, ebx=%#x, ecx=%#x, edx=%#x}", + cpuid->entries[i].eax, cpuid->entries[i].ebx, + cpuid->entries[i].ecx, cpuid->entries[i].edx); + } +# else + if (cpuid->nent) + printf("..."); +# endif + printf("]}) = 0\n"); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int kvm = open(dev, O_RDWR); + if (kvm < 0) + perror_msg_and_skip("open: %s", dev); + + /* Make sure we have the stable version of the API */ + int ret = KVM_IOCTL(kvm, KVM_GET_API_VERSION, 0); + if (ret != KVM_API_VERSION) + error_msg_and_skip("KVM_GET_API_VERSION returned %d" + ", KVM_API_VERSION is %d", + kvm, KVM_API_VERSION); + printf("ioctl(%d<%s>, KVM_GET_API_VERSION, 0) = %d\n", + kvm, dev, ret); + + ret = KVM_IOCTL(kvm, KVM_CHECK_EXTENSION, + (void *) (uintptr_t) KVM_CAP_USER_MEMORY); + printf("ioctl(%d<%s>, KVM_CHECK_EXTENSION, KVM_CAP_USER_MEMORY) = %d\n", + kvm, dev, ret); + + int vm_fd = KVM_IOCTL(kvm, KVM_CREATE_VM, 0); + printf("ioctl(%d<%s>, KVM_CREATE_VM, 0) = %d<%s>\n", + kvm, dev, vm_fd, vm_dev); + + /* Allocate one aligned page of guest memory to hold the code. */ + page_size = get_page_size(); + void *const mem = mmap(NULL, page_size, PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_ANONYMOUS, -1, 0); + if (mem == MAP_FAILED) + perror_msg_and_fail("mmap page"); + + /* Map it to the second page frame (to avoid the real-mode IDT at 0). */ + struct kvm_userspace_memory_region region = { + .slot = 0, + .guest_phys_addr = page_size, + .memory_size = page_size, + .userspace_addr = (uintptr_t) mem, + }; + KVM_IOCTL(vm_fd, KVM_SET_USER_MEMORY_REGION, ®ion); + printf("ioctl(%d<%s>, KVM_SET_USER_MEMORY_REGION" + ", {slot=0, flags=0, guest_phys_addr=%#lx, memory_size=%lu" + ", userspace_addr=%p}) = 0\n", vm_fd, vm_dev, + (unsigned long) page_size, (unsigned long) page_size, mem); + + int vcpu_fd = KVM_IOCTL(vm_fd, KVM_CREATE_VCPU, NULL); + if (!vcpu_dev_should_have_cpuid(vcpu_fd)) { + /* + * This is an older kernel that doesn't place a cpuid + * at the end of the dentry associated with vcpu_fd. + * Trim the cpuid part of vcpu_dev like: + * "anon_inode:kvm-vcpu:0" -> "anon_inode:kvm-vcpu" + */ + vcpu_dev[strlen (vcpu_dev) - 2] = '\0'; +# ifdef KVM_NO_CPUID_CALLBACK + KVM_NO_CPUID_CALLBACK; +# endif + } + + printf("ioctl(%d<%s>, KVM_CREATE_VCPU, 0) = %d<%s>\n", + vm_fd, vm_dev, vcpu_fd, vcpu_dev); + + /* Map the shared kvm_run structure and following data. */ + ret = KVM_IOCTL(kvm, KVM_GET_VCPU_MMAP_SIZE, NULL); + struct kvm_run *run; + if (ret < (int) sizeof(*run)) + error_msg_and_fail("KVM_GET_VCPU_MMAP_SIZE returned %d < %d", + ret, (int) sizeof(*run)); + printf("ioctl(%d<%s>, KVM_GET_VCPU_MMAP_SIZE, 0) = %d\n", + kvm, dev, ret); + + const size_t mmap_size = (ret + page_size - 1) & -page_size; + run = mmap(NULL, mmap_size, PROT_READ | PROT_WRITE, + MAP_SHARED, vcpu_fd, 0); + if (run == MAP_FAILED) + perror_msg_and_fail("mmap vcpu"); + + size_t cpuid_nent = KVM_MAX_CPUID_ENTRIES; + struct kvm_cpuid2 *cpuid = tail_alloc(sizeof(*cpuid) + + cpuid_nent * + sizeof(*cpuid->entries)); + + cpuid->nent = 0; + ioctl(kvm, KVM_GET_SUPPORTED_CPUID, cpuid); + printf("ioctl(%d<%s>, KVM_GET_SUPPORTED_CPUID, %p) = -1 E2BIG (%m)\n", + kvm, dev, cpuid); + + cpuid->nent = cpuid_nent; + + KVM_IOCTL(kvm, KVM_GET_SUPPORTED_CPUID, cpuid); + print_cpuid_ioctl(kvm, dev, "KVM_GET_SUPPORTED_CPUID", cpuid); + + struct kvm_cpuid2 cpuid_tmp = { .nent = 0 }; + KVM_IOCTL(vcpu_fd, KVM_SET_CPUID2, &cpuid_tmp); + printf("ioctl(%d<%s>, KVM_SET_CPUID2, {nent=%u, entries=[]}) = 0\n", + vcpu_fd, vcpu_dev, cpuid_tmp.nent); + + KVM_IOCTL(vcpu_fd, KVM_SET_CPUID2, cpuid); + print_cpuid_ioctl(vcpu_fd, vcpu_dev, "KVM_SET_CPUID2", cpuid); + + ioctl(vcpu_fd, KVM_SET_CPUID2, NULL); + printf("ioctl(%d<%s>, KVM_SET_CPUID2, NULL) = -1 EFAULT (%m)\n", + vcpu_fd, vcpu_dev); + + run_kvm(vcpu_fd, run, mmap_size, mem); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else /* !HAVE_LINUX_KVM_H */ + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_KVM_H && HAVE_STRUCT_KVM_CPUID2 && " + "HAVE_STRUCT_KVM_REGS && HAVE_STRUCT_KVM_SREGS && " + "HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION && " + "(__x86_64__ || __i386__)") + +# define need_print_KVM_RUN 0 + +#endif diff --git a/tests-mx32/ioctl_loop-nv.gen.test b/tests-mx32/ioctl_loop-nv.gen.test new file mode 100755 index 00000000..d9da86a2 --- /dev/null +++ b/tests-mx32/ioctl_loop-nv.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_loop-nv +ioctl.test -a22 -e verbose=none); do not edit. +set -- -a22 -e verbose=none +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_loop-nv.test b/tests-mx32/ioctl_loop-nv.test deleted file mode 100755 index dcc27e1d..00000000 --- a/tests-mx32/ioctl_loop-nv.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check non-verbose decoding of LOOP_* ioctls. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a22 -eioctl -e verbose=none $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/ioctl_loop-v.gen.test b/tests-mx32/ioctl_loop-v.gen.test new file mode 100755 index 00000000..b03bf784 --- /dev/null +++ b/tests-mx32/ioctl_loop-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_loop-v +ioctl.test -v); do not edit. +set -- -v +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_loop-v.test b/tests-mx32/ioctl_loop-v.test deleted file mode 100755 index ff3995d8..00000000 --- a/tests-mx32/ioctl_loop-v.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check non-abbreviated decoding of LOOP_* ioctls. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a22 -v -eioctl $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/ioctl_loop.c b/tests-mx32/ioctl_loop.c index a95e775d..53665603 100644 --- a/tests-mx32/ioctl_loop.c +++ b/tests-mx32/ioctl_loop.c @@ -3,47 +3,39 @@ * * Copyright (c) 2016 JingPiao Chen * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include -#include #include #include +#include #include #include +#include #include #include +#include "print_fields.h" + +#define XLAT_MACROS_ONLY #include "xlat/loop_cmds.h" +#undef XLAT_MACROS_ONLY #ifndef ABBREV # define ABBREV 0 #endif +static long +sys_ioctl(kernel_long_t fd, kernel_ulong_t cmd, kernel_ulong_t arg) +{ + return syscall(__NR_ioctl, fd, cmd, arg); +} + static void print_loop_info(struct loop_info * const info, bool print_encrypt, const char *encrypt_type, const char *encrypt_key, @@ -54,8 +46,8 @@ print_loop_info(struct loop_info * const info, bool print_encrypt, #else printf("{lo_number=%d", info->lo_number); # if VERBOSE - printf(", lo_device=makedev(%u, %u), lo_inode=%lu, " - "lo_rdevice=makedev(%u, %u)", + printf(", lo_device=makedev(%#x, %#x), lo_inode=%lu, " + "lo_rdevice=makedev(%#x, %#x)", major(info->lo_device), minor(info->lo_device), info->lo_inode, major(info->lo_rdevice), minor(info->lo_rdevice)); @@ -80,8 +72,7 @@ print_loop_info(struct loop_info * const info, bool print_encrypt, else printf("%#x /* LO_FLAGS_??? */", info->lo_flags); - printf(", lo_name=\"%.*s\"", - (int) sizeof(info->lo_name) - 1, info->lo_name); + PRINT_FIELD_CSTRING(", ", *info, lo_name); if (VERBOSE || print_encrypt) printf(", lo_encrypt_key=\"%.*s\"", @@ -111,8 +102,8 @@ print_loop_info64(struct loop_info64 * const info64, bool print_encrypt, printf("%p", info64); #else # if VERBOSE - printf("{lo_device=makedev(%u, %u), lo_inode=%" PRIu64 - ", lo_rdevice=makedev(%u, %u), lo_offset=%#" PRIx64 + printf("{lo_device=makedev(%#x, %#x), lo_inode=%" PRIu64 + ", lo_rdevice=makedev(%#x, %#x), lo_offset=%#" PRIx64 ", lo_sizelimit=%" PRIu64 ", lo_number=%" PRIu32, major(info64->lo_device), minor(info64->lo_device), (uint64_t) info64->lo_inode, @@ -143,17 +134,16 @@ print_loop_info64(struct loop_info64 * const info64, bool print_encrypt, printf("%s", flags); else printf("%#x /* LO_FLAGS_??? */", info64->lo_flags); - printf(", lo_file_name=\"%.*s\"", - (int) sizeof(info64->lo_file_name) - 1, info64->lo_file_name); + PRINT_FIELD_CSTRING(", ", *info64, lo_file_name); - if (VERBOSE || print_encrypt) - printf(", lo_crypt_name=\"%.*s\", lo_encrypt_key=\"%.*s\"", - (int) sizeof(info64->lo_crypt_name) - 1, - info64->lo_crypt_name, + if (VERBOSE || print_encrypt) { + PRINT_FIELD_CSTRING(", ", *info64, lo_crypt_name); + printf(", lo_encrypt_key=\"%.*s\"", encrypt_key ? (int) strlen(encrypt_key) : (int) sizeof(info64->lo_encrypt_key), encrypt_key ? encrypt_key : (char *) info64->lo_encrypt_key); + } # if VERBOSE printf(", lo_init=[%#" PRIx64 ", %#" PRIx64 "]}", @@ -175,35 +165,37 @@ main(void) static const kernel_ulong_t kernel_mask = ((kernel_ulong_t) -1) - ((unsigned long) -1L); - struct loop_info * const info = tail_alloc(sizeof(*info)); - struct loop_info64 * const info64 = tail_alloc(sizeof(*info64)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct loop_info, info); + TAIL_ALLOC_OBJECT_CONST_PTR(struct loop_info64, info64); /* Unknown loop commands */ - ioctl(-1, unknown_loop_cmd, magic); - printf("ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE%s, 0x4c, %#x, %#x), " + sys_ioctl(-1, unknown_loop_cmd, magic); + printf("ioctl(-1, _IOC(%s_IOC_READ|_IOC_WRITE, 0x4c, %#x, %#x), " "%#lx) = -1 EBADF (%m)\n", _IOC_DIR((unsigned int) unknown_loop_cmd) & _IOC_NONE ? - "|_IOC_NONE" : "", + "_IOC_NONE|" : "", _IOC_NR((unsigned int) unknown_loop_cmd), _IOC_SIZE((unsigned int) unknown_loop_cmd), (unsigned long) magic); - ioctl(-1, LOOP_SET_DIRECT_IO + 1, magic); - printf("ioctl(-1, _IOC(0, 0x4c, %#x, %#x), %#lx) = " + sys_ioctl(-1, LOOP_SET_BLOCK_SIZE + 1, magic); + printf("ioctl(-1, _IOC(%s, 0x4c, %#x, %#x), %#lx) = " "-1 EBADF (%m)\n", - _IOC_NR(LOOP_SET_DIRECT_IO + 1), - _IOC_SIZE(LOOP_SET_DIRECT_IO + 1), + _IOC_NONE ? "0" : "_IOC_NONE", + _IOC_NR(LOOP_SET_BLOCK_SIZE + 1), + _IOC_SIZE(LOOP_SET_BLOCK_SIZE + 1), (unsigned long) magic); - ioctl(-1, LOOP_CTL_GET_FREE + 1, magic); - printf("ioctl(-1, _IOC(0, 0x4c, %#x, %#x), %#lx) = " + sys_ioctl(-1, LOOP_CTL_GET_FREE + 1, magic); + printf("ioctl(-1, _IOC(%s, 0x4c, %#x, %#x), %#lx) = " "-1 EBADF (%m)\n", + _IOC_NONE ? "0" : "_IOC_NONE", _IOC_NR(LOOP_CTL_GET_FREE + 1), _IOC_SIZE(LOOP_CTL_GET_FREE + 1), (unsigned long) magic); /* LOOP_SET_FD */ - ioctl(-1, LOOP_SET_FD, magic); + sys_ioctl(-1, LOOP_SET_FD, magic); printf("ioctl(-1, LOOP_SET_FD, %d) = -1 EBADF (%m)\n", (unsigned int) magic); @@ -290,7 +282,7 @@ main(void) printf("ioctl(-1, LOOP_GET_STATUS64, %p) = -1 EBADF (%m)\n", info64); /* LOOP_CHANGE_FD */ - ioctl(-1, LOOP_CHANGE_FD, magic); + sys_ioctl(-1, LOOP_CHANGE_FD, magic); printf("ioctl(-1, LOOP_CHANGE_FD, %d) = -1 EBADF (%m)\n", (unsigned int) magic); @@ -299,17 +291,22 @@ main(void) printf("ioctl(-1, LOOP_SET_CAPACITY) = -1 EBADF (%m)\n"); /* LOOP_SET_DIRECT_IO */ - ioctl(-1, LOOP_SET_DIRECT_IO, magic); + sys_ioctl(-1, LOOP_SET_DIRECT_IO, magic); printf("ioctl(-1, LOOP_SET_DIRECT_IO, %lu) = -1 EBADF (%m)\n", (unsigned long) magic); + /* LOOP_SET_BLOCK_SIZE */ + sys_ioctl(-1, LOOP_SET_BLOCK_SIZE, magic); + printf("ioctl(-1, LOOP_SET_BLOCK_SIZE, %lu) = -1 EBADF (%m)\n", + (unsigned long) magic); + /* LOOP_CTL_ADD */ - ioctl(-1, LOOP_CTL_ADD, magic); + sys_ioctl(-1, LOOP_CTL_ADD, magic); printf("ioctl(-1, LOOP_CTL_ADD, %d) = -1 EBADF (%m)\n", (unsigned int) magic); /* LOOP_CTL_REMOVE */ - ioctl(-1, LOOP_CTL_REMOVE, magic); + sys_ioctl(-1, LOOP_CTL_REMOVE, magic); printf("ioctl(-1, LOOP_CTL_REMOVE, %d) = -1 EBADF (%m)\n", (unsigned int) magic); diff --git a/tests-mx32/ioctl_loop.gen.test b/tests-mx32/ioctl_loop.gen.test new file mode 100755 index 00000000..d4ec35ac --- /dev/null +++ b/tests-mx32/ioctl_loop.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_loop +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_loop.test b/tests-mx32/ioctl_loop.test deleted file mode 100755 index 112cd636..00000000 --- a/tests-mx32/ioctl_loop.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check decoding of LOOP_* ioctls. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a22 -eioctl $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/ioctl_mtd.c b/tests-mx32/ioctl_mtd.c index a37d5d0f..cfc1d442 100644 --- a/tests-mx32/ioctl_mtd.c +++ b/tests-mx32/ioctl_mtd.c @@ -2,49 +2,28 @@ * This file is part of ioctl_mtd strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" -#include -#include -#include -#include -#include -#include -#include -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) -# include "mtd-abi.h" -#else +#ifdef HAVE_STRUCT_MTD_WRITE_REQ + +# include +# include +# include +# include +# include +# include +# include # include -#endif static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; -#define TEST_NULL_ARG(cmd) \ +# define TEST_NULL_ARG(cmd) \ do { \ ioctl(-1, cmd, 0); \ if (_IOC_DIR(cmd) == _IOC_WRITE) \ @@ -57,15 +36,17 @@ static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; (unsigned int) _IOC_NR(cmd), #cmd); \ else \ printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd); \ - } while (0) - -#define TEST_erase_info_user(cmd, eiu) \ - ioctl(-1, cmd, eiu); \ - printf("ioctl(-1, MIXER_%s(%u) or %s, {start=%#x, length=%#x})" \ - " = -1 EBADF (%m)\n", \ - (_IOC_DIR(cmd) == _IOC_READ) ? "READ" : "WRITE", \ - (unsigned int) _IOC_NR(cmd), #cmd, \ - eiu->start, eiu->length) + } while (0) + +# define TEST_erase_info_user(cmd, eiu) \ + do { \ + ioctl(-1, cmd, eiu); \ + printf("ioctl(-1, MIXER_%s(%u) or %s, {start=%#x, length=%#x})" \ + " = -1 EBADF (%m)\n", \ + (_IOC_DIR(cmd) == _IOC_READ) ? "READ" : "WRITE", \ + (unsigned int) _IOC_NR(cmd), #cmd, \ + eiu->start, eiu->length); \ + } while (0) int main(void) @@ -95,13 +76,13 @@ main(void) ioctl(-1, MTDFILEMODE, MTD_FILE_MODE_NORMAL); printf("ioctl(-1, MTDFILEMODE, MTD_FILE_MODE_NORMAL) = -1 EBADF (%m)\n"); - int *const opt = tail_alloc(sizeof(*opt)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, opt); *opt = MTD_OTP_OFF; ioctl(-1, OTPSELECT, opt); printf("ioctl(-1, MIXER_READ(%u) or OTPSELECT, [MTD_OTP_OFF])" " = -1 EBADF (%m)\n", (unsigned int) _IOC_NR(OTPSELECT)); - uint64_t *const v64 = tail_alloc(sizeof(*v64)); + TAIL_ALLOC_OBJECT_CONST_PTR(uint64_t, v64); fill_memory(v64, sizeof(*v64)); ioctl(-1, MEMGETBADBLOCK, v64); @@ -114,17 +95,17 @@ main(void) " = -1 EBADF (%m)\n", (unsigned int) _IOC_NR(MEMSETBADBLOCK), *v64); - struct region_info_user *const riu = tail_alloc(sizeof(*riu)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct region_info_user, riu); fill_memory(riu, sizeof(*riu)); ioctl(-1, MEMGETREGIONINFO, riu); printf("ioctl(-1, %s, {regionindex=%#x}) = -1 EBADF (%m)\n", "MEMGETREGIONINFO" -#ifdef __i386__ +# ifdef __i386__ " or MTRRIOC_GET_PAGE_ENTRY" -#endif +# endif , riu->regionindex); - struct erase_info_user *const eiu = tail_alloc(sizeof(*eiu)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct erase_info_user, eiu); fill_memory(eiu, sizeof(*eiu)); TEST_erase_info_user(MEMERASE, eiu); @@ -132,7 +113,7 @@ main(void) TEST_erase_info_user(MEMUNLOCK, eiu); TEST_erase_info_user(MEMISLOCKED, eiu); - struct erase_info_user64 *const eiu64 = tail_alloc(sizeof(*eiu64)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct erase_info_user64, eiu64); fill_memory(eiu64, sizeof(*eiu64)); ioctl(-1, MEMERASE64, eiu64); printf("ioctl(-1, MIXER_WRITE(%u) or %s, {start=%#llx, length=%#llx})" @@ -141,7 +122,7 @@ main(void) (unsigned long long) eiu64->start, (unsigned long long) eiu64->length); - struct mtd_oob_buf *const oob = tail_alloc(sizeof(*oob)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct mtd_oob_buf, oob); fill_memory(oob, sizeof(*oob)); ioctl(-1, MEMWRITEOOB, oob); @@ -152,7 +133,7 @@ main(void) printf("ioctl(-1, MEMREADOOB, {start=%#x, length=%#x, ptr=%p})" " = -1 EBADF (%m)\n", oob->start, oob->length, oob->ptr); - struct mtd_oob_buf64 *const oob64 = tail_alloc(sizeof(*oob64)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct mtd_oob_buf64, oob64); fill_memory(oob64, sizeof(*oob64)); ioctl(-1, MEMWRITEOOB64, oob64); @@ -168,14 +149,14 @@ main(void) (unsigned long long) oob64->usr_ptr); - struct otp_info *const oi = tail_alloc(sizeof(*oi)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct otp_info, oi); fill_memory(oi, sizeof(*oi)); ioctl(-1, OTPLOCK, oi); printf("ioctl(-1, MIXER_READ(%u) or OTPLOCK" ", {start=%#x, length=%#x, locked=%u}) = -1 EBADF (%m)\n", (unsigned int) _IOC_NR(OTPLOCK), oi->start, oi->length, oi->locked); - struct mtd_write_req *const wr = tail_alloc(sizeof(*wr)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct mtd_write_req, wr); fill_memory(wr, sizeof(*wr)); wr->mode = MTD_OPS_PLACE_OOB; ioctl(-1, MEMWRITE, wr); @@ -195,3 +176,9 @@ main(void) puts("+++ exited with 0 +++"); return 0; } + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_MTD_WRITE_REQ") + +#endif diff --git a/tests-mx32/ioctl_mtd.gen.test b/tests-mx32/ioctl_mtd.gen.test new file mode 100755 index 00000000..65b00037 --- /dev/null +++ b/tests-mx32/ioctl_mtd.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_mtd +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_mtd.test b/tests-mx32/ioctl_mtd.test deleted file mode 100755 index 08428073..00000000 --- a/tests-mx32/ioctl_mtd.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of 'M' type ioctls. - -. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_nbd.c b/tests-mx32/ioctl_nbd.c new file mode 100644 index 00000000..0992ca28 --- /dev/null +++ b/tests-mx32/ioctl_nbd.c @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +#define XLAT_MACROS_ONLY +#include "xlat/nbd_ioctl_cmds.h" +#include "xlat/nbd_ioctl_flags.h" +#undef XLAT_MACROS_ONLY + +#define RVAL_EBADF " = -1 EBADF (%m)\n" + +int +main(void) +{ + static const unsigned long ubeef = (unsigned long) 0xcafef00ddeadbeefULL; + static const char null_path[] = "/dev/null"; + + int fd = open(null_path, O_RDONLY); + if (fd < 0) + perror_msg_and_fail("open(\"%s\")", null_path); + + skip_if_unavailable("/proc/self/fd/"); + + ioctl(-1, NBD_DISCONNECT, NULL); + printf("ioctl(-1, NBD_DISCONNECT)" RVAL_EBADF); + ioctl(-1, NBD_CLEAR_SOCK, NULL); + printf("ioctl(-1, NBD_CLEAR_SOCK)" RVAL_EBADF); + ioctl(-1, NBD_DO_IT, NULL); + printf("ioctl(-1, NBD_DO_IT)" RVAL_EBADF); + ioctl(-1, NBD_CLEAR_QUE, NULL); + printf("ioctl(-1, NBD_CLEAR_QUE)" RVAL_EBADF); + ioctl(-1, NBD_PRINT_DEBUG, NULL); + printf("ioctl(-1, NBD_PRINT_DEBUG)" RVAL_EBADF); + ioctl(-1, NBD_SET_SOCK, fd); + printf("ioctl(-1, NBD_SET_SOCK, %d)" RVAL_EBADF, fd); + + ioctl(-1, NBD_SET_BLKSIZE, ubeef); + printf("ioctl(-1, NBD_SET_BLKSIZE, %lu)" RVAL_EBADF, ubeef); + ioctl(-1, NBD_SET_SIZE, ubeef); + printf("ioctl(-1, NBD_SET_SIZE, %lu)" RVAL_EBADF, ubeef); + ioctl(-1, NBD_SET_SIZE_BLOCKS, ubeef); + printf("ioctl(-1, NBD_SET_SIZE_BLOCKS, %lu)" RVAL_EBADF, ubeef); + + ioctl(-1, NBD_SET_TIMEOUT, ubeef); + printf("ioctl(-1, NBD_SET_TIMEOUT, %lu)" RVAL_EBADF, ubeef); + + ioctl(-1, NBD_SET_FLAGS, 0); + printf("ioctl(-1, NBD_SET_FLAGS, 0)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_HAS_FLAGS); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_HAS_FLAGS)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_READ_ONLY); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_READ_ONLY)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_FLUSH); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_FLUSH)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_FUA); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_FUA)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_TRIM); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_TRIM)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_WRITE_ZEROES); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_WRITE_ZEROES)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_DF); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_DF)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_CAN_MULTI_CONN); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_CAN_MULTI_CONN)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_RESIZE); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_RESIZE)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_CACHE); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_CACHE)" RVAL_EBADF); + + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_HAS_FLAGS|NBD_FLAG_READ_ONLY| + NBD_FLAG_SEND_FUA|NBD_FLAG_SEND_CACHE| + (1 << 15)|(1<<31)); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_HAS_FLAGS|NBD_FLAG_READ_ONLY|" + "NBD_FLAG_SEND_FUA|NBD_FLAG_SEND_CACHE|0x80008000)" RVAL_EBADF); + + ioctl(-1, _IOC(_IOC_NONE, 0xab, 0xb, 0), NULL); + printf("ioctl(-1, _IOC(_IOC_NONE, 0xab, 0xb, 0), 0)" RVAL_EBADF); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/ioctl_nbd.gen.test b/tests-mx32/ioctl_nbd.gen.test new file mode 100755 index 00000000..55e287a2 --- /dev/null +++ b/tests-mx32/ioctl_nbd.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_nbd +ioctl.test -y); do not edit. +set -- -y +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_nsfs.c b/tests-mx32/ioctl_nsfs.c new file mode 100644 index 00000000..74dbe6e9 --- /dev/null +++ b/tests-mx32/ioctl_nsfs.c @@ -0,0 +1,126 @@ +/* + * Check decoding of NS_* commands of ioctl syscall. + * + * Copyright (c) 2017 Nikolay Marchuk + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include +#include "nsfs.h" + +#ifndef CLONE_NEWUSER +# define CLONE_NEWUSER 0x10000000 +#endif + +static void +test_no_namespace(void) +{ + ioctl(-1, NS_GET_USERNS); + printf("ioctl(-1, NS_GET_USERNS) = -1 EBADF (%m)\n"); + ioctl(-1, NS_GET_PARENT); + printf("ioctl(-1, NS_GET_PARENT) = -1 EBADF (%m)\n"); + ioctl(-1, NS_GET_NSTYPE); + printf("ioctl(-1, NS_GET_NSTYPE) = -1 EBADF (%m)\n"); + ioctl(-1, NS_GET_OWNER_UID, NULL); + printf("ioctl(-1, NS_GET_OWNER_UID, NULL) = -1 EBADF (%m)\n"); +} + +static void +test_clone(pid_t pid) +{ + char path[sizeof("/proc/%d/ns/user") + sizeof(int)*3]; + snprintf(path, sizeof(path), "/proc/%d/ns/user", pid); + + int ns_fd = open(path, O_RDONLY); + if (ns_fd == -1) + perror_msg_and_skip("open: %s", path); + + int userns_fd = ioctl(ns_fd, NS_GET_USERNS); + printf("ioctl(%d, NS_GET_USERNS) = %s\n", ns_fd, sprintrc(userns_fd)); + + int parent_ns_fd = ioctl(userns_fd, NS_GET_PARENT); + printf("ioctl(%d, NS_GET_PARENT) = %s\n", + userns_fd, sprintrc(parent_ns_fd)); + + int nstype = ioctl(userns_fd, NS_GET_NSTYPE); + if (nstype == -1) { + printf("ioctl(%d, NS_GET_NSTYPE) = %s\n", + userns_fd, sprintrc(nstype)); + } else { + printf("ioctl(%d, NS_GET_NSTYPE) = %d (CLONE_NEWUSER)\n", + userns_fd, nstype); + } + + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, uid); + int rc = ioctl(userns_fd, NS_GET_OWNER_UID, uid); + if (rc == -1) { + printf("ioctl(%d, NS_GET_OWNER_UID, %p) = %s\n", + userns_fd, uid, sprintrc(rc)); + } else { + printf("ioctl(%d, NS_GET_OWNER_UID, [%u]) = %d\n", + userns_fd, *uid, rc); + } +} + +static int +child(void *arg) +{ + int *pipefd = (int *) arg; + close(pipefd[1]); + /* Wait for EOF from pipe. */ + if (read(pipefd[0], &pipefd[1], 1)) + perror_msg_and_fail("read"); + return 0; +} + +#ifdef IA64 +extern int __clone2(int (*)(void *), void *, size_t, int, void *, ...); +# define clone(fn, child_stack, flags, arg) \ + __clone2(fn, child_stack, get_page_size() / 2, flags, arg) +#endif + +static void +test_user_namespace(void) +{ + pid_t pid; + int pipefd[2]; + int status; + + if (pipe(pipefd)) + perror_msg_and_fail("pipe"); + + pid = clone(child, tail_alloc(get_page_size() / 2), + CLONE_NEWUSER | CLONE_UNTRACED | SIGCHLD, pipefd); + if (pid == -1) { + perror("clone"); + return; + } + close(pipefd[0]); + test_clone(pid); + close(pipefd[1]); + if (wait(&status) != pid) { + perror_msg_and_fail("wait"); + } else if (status != 0) { + error_msg_and_fail("unexpected child exit status %d", status); + } +} + +int +main(void) +{ + test_no_namespace(); + test_user_namespace(); + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/ioctl_nsfs.gen.test b/tests-mx32/ioctl_nsfs.gen.test new file mode 100755 index 00000000..f9adc5f0 --- /dev/null +++ b/tests-mx32/ioctl_nsfs.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_nsfs +ioctl.test -esignal=none); do not edit. +set -- -esignal=none +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_perf-success.c b/tests-mx32/ioctl_perf-success.c new file mode 100644 index 00000000..eaf572ac --- /dev/null +++ b/tests-mx32/ioctl_perf-success.c @@ -0,0 +1,145 @@ +/* + * Check decoding of successful PERF_EVENT_IOC_{ID,QUERY_BPF} ioctls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_PERF_EVENT_H + +# include +# include +# include +# include +# include +# include +# include + +# ifndef PERF_EVENT_IOC_ID +# define PERF_EVENT_IOC_ID _IOR('$', 7, void *) +# endif + +# ifndef PERF_EVENT_IOC_QUERY_BPF +# define PERF_EVENT_IOC_QUERY_BPF _IOWR('$', 10, void *) + +struct perf_event_query_bpf { + uint32_t ids_len; + uint32_t prog_cnt; + uint32_t ids[0]; +}; +# endif + +int +main(int argc, char **argv) +{ + static const uint64_t magic64 = 0xfacefeeddeadc0deULL; + + TAIL_ALLOC_OBJECT_CONST_PTR(uint64_t, u64_ptr); + uint64_t *const u64_efault = u64_ptr + 1; + uint32_t *const u32_arr = tail_alloc(sizeof(uint32_t) * 4); + uint32_t *const u32_efault = u32_arr + 4; + + unsigned long num_skip; + long inject_retval; + bool locked = false; + + *u64_ptr = magic64; + + if (argc == 1) + return 0; + + if (argc < 3) + error_msg_and_fail("Usage: %s NUM_SKIP INJECT_RETVAL", argv[0]); + + num_skip = strtoul(argv[1], NULL, 0); + inject_retval = strtol(argv[2], NULL, 0); + + if (inject_retval < 0) + error_msg_and_fail("Expected non-negative INJECT_RETVAL, " + "but got %ld", inject_retval); + + for (unsigned long i = 0; i < num_skip; i++) { + long ret = ioctl(-1, PERF_EVENT_IOC_ID, NULL); + + printf("ioctl(-1, PERF_EVENT_IOC_ID, NULL) = %s%s\n", + sprintrc(ret), + ret == inject_retval ? " (INJECTED)" : ""); + + if (ret != inject_retval) + continue; + + locked = true; + break; + } + + if (!locked) + error_msg_and_fail("Hasn't locked on ioctl(-1" + ", PERF_EVENT_IOC_ID, NULL) returning %lu", + inject_retval); + + /* PERF_EVENT_IOC_ID */ + assert(ioctl(-1, PERF_EVENT_IOC_ID, NULL) == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_ID, NULL) = %ld (INJECTED)\n", + inject_retval); + + assert(ioctl(-1, PERF_EVENT_IOC_ID, u64_efault) == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_ID, %p) = %ld (INJECTED)\n", + u64_efault, inject_retval); + + assert(ioctl(-1, PERF_EVENT_IOC_ID, u64_ptr) == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_ID, [%" PRIu64 "]) = %ld (INJECTED)\n", + magic64, inject_retval); + + /* PERF_EVENT_IOC_QUERY_BPF */ + assert(ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, NULL) == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, NULL) = %ld (INJECTED)\n", + inject_retval); + + assert(ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, u32_efault) + == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, %p) = %ld (INJECTED)\n", + u32_efault, inject_retval); + + u32_arr[3] = 0xdeadbeef; + assert(ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, u32_arr + 3) + == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, {ids_len=3735928559, ...}) " + "= %ld (INJECTED)\n", + inject_retval); + + u32_arr[2] = 0xdecaffed; + assert(ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, u32_arr + 2) + == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, {ids_len=3737845741" + ", prog_cnt=3735928559, ids=%p})" + " = %ld (INJECTED)\n", + u32_efault, inject_retval); + + u32_arr[0] = 0xbadc0ded; + u32_arr[1] = 5; + assert(ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, u32_arr) == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, {ids_len=3134983661" + ", prog_cnt=5, ids=[3737845741, 3735928559, ... /* %p */]})" + " = %ld (INJECTED)\n", + u32_efault, inject_retval); + + u32_arr[1] = 2; + assert(ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, u32_arr) == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, {ids_len=3134983661" + ", prog_cnt=2, ids=[3737845741, 3735928559]})" + " = %ld (INJECTED)\n", + inject_retval); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_PERF_EVENT_H"); + +#endif diff --git a/tests-mx32/ioctl_perf-success.test b/tests-mx32/ioctl_perf-success.test new file mode 100755 index 00000000..2edd1d34 --- /dev/null +++ b/tests-mx32/ioctl_perf-success.test @@ -0,0 +1,20 @@ +#!/bin/sh -efu +# +# Check decoding of successful PERF_EVENT_IOC_{ID,QUERY_BPF} ioctls. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +: ${IOCTL_INJECT_START=256} +: ${IOCTL_INJECT_RETVAL=42} + +run_prog +run_strace -a35 -e trace=ioctl \ + -e inject=ioctl:retval="${IOCTL_INJECT_RETVAL}":when="${IOCTL_INJECT_START}+" \ + ../ioctl_perf-success "${IOCTL_INJECT_START}" "${IOCTL_INJECT_RETVAL}" > "$EXP" +grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests-mx32/ioctl_perf.c b/tests-mx32/ioctl_perf.c new file mode 100644 index 00000000..30cb35f6 --- /dev/null +++ b/tests-mx32/ioctl_perf.c @@ -0,0 +1,218 @@ +/* + * Check decoding of PERF_EVENT_IOC_* commands of ioctl syscall. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_PERF_EVENT_H + +# include +# include +# include +# include +# include +# include +# include + +/* + * Workaround the bug in kernel UAPI that was fixed + * in Linux commit v2.6.33-rc1~48^2~288^2~19. + */ +# ifndef u64 +# define u64 uint64_t +# endif + +# define XLAT_MACROS_ONLY +# include "xlat/perf_ioctl_cmds.h" +# undef XLAT_MACROS_ONLY + +# define STR16 "0123456789abcdef" + +static long +sys_ioctl(kernel_long_t fd, kernel_ulong_t cmd, kernel_ulong_t arg) +{ + return syscall(__NR_ioctl, fd, cmd, arg); +} + +int +main(void) +{ + static const kernel_ulong_t unknown_perf_cmd = + (kernel_ulong_t) 0xbadc0dedfeed24edULL; + static const kernel_ulong_t magic = + (kernel_ulong_t) 0xdeadbeefbadc0dedULL; + static const uint64_t magic64 = 0xfacefeeddeadc0deULL; + static const char str[] = STR16 STR16 STR16 STR16; + + static struct { + unsigned int cmd; + const char *str; + } flag_iocs[] = { + { ARG_STR(PERF_EVENT_IOC_ENABLE) }, + { ARG_STR(PERF_EVENT_IOC_DISABLE) }, + { ARG_STR(PERF_EVENT_IOC_RESET) }, + }; + + TAIL_ALLOC_OBJECT_CONST_PTR(uint64_t, u64_ptr); + uint64_t *const u64_efault = u64_ptr + 1; + uint32_t *const u32_arr = tail_alloc(sizeof(uint32_t) * 4); + uint32_t *const u32_efault = u32_arr + 4; + char *const str_ptr = tail_memdup(str, sizeof(str)); + char *const str_efault = str_ptr + sizeof(str); + TAIL_ALLOC_OBJECT_CONST_PTR(struct perf_event_attr, pea_ptr); + + *u64_ptr = magic64; + fill_memory_ex(pea_ptr, sizeof(*pea_ptr), 0xaa, 0x55); + + /* Unknown perf commands */ + sys_ioctl(-1, unknown_perf_cmd, magic); + printf("ioctl(-1, _IOC(%s_IOC_READ|_IOC_WRITE, 0x24, %#x, %#x), " + "%#lx) = -1 EBADF (%m)\n", + _IOC_DIR((unsigned int) unknown_perf_cmd) & _IOC_NONE ? + "_IOC_NONE|" : "", + _IOC_NR((unsigned int) unknown_perf_cmd), + _IOC_SIZE((unsigned int) unknown_perf_cmd), + (unsigned long) magic); + + sys_ioctl(-1, PERF_EVENT_IOC_MODIFY_ATTRIBUTES + 1, magic); + printf("ioctl(-1, _IOC(_IOC_WRITE, 0x24, %#x, %#x), %#lx)" + " = -1 EBADF (%m)\n", + (unsigned int) _IOC_NR(PERF_EVENT_IOC_MODIFY_ATTRIBUTES + 1), + (unsigned int) _IOC_SIZE(PERF_EVENT_IOC_MODIFY_ATTRIBUTES + 1), + (unsigned long) magic); + + /* PERF_EVENT_IOC_{ENABLE,DISABLE,RESET} */ + for (unsigned i = 0; i < ARRAY_SIZE(flag_iocs); i++) { + ioctl(-1, flag_iocs[i].cmd, 0); + printf("ioctl(-1, %s, 0) = -1 EBADF (%m)\n", flag_iocs[i].str); + + ioctl(-1, flag_iocs[i].cmd, 1); + printf("ioctl(-1, %s, PERF_IOC_FLAG_GROUP) = -1 EBADF (%m)\n", + flag_iocs[i].str); + + ioctl(-1, flag_iocs[i].cmd, 2); + printf("ioctl(-1, %s, 0x2 /* PERF_IOC_FLAG_??? */) " + "= -1 EBADF (%m)\n", + flag_iocs[i].str); + + sys_ioctl(-1, flag_iocs[i].cmd, magic); + printf("ioctl(-1, %s, PERF_IOC_FLAG_GROUP|%#x) " + "= -1 EBADF (%m)\n", + flag_iocs[i].str, (unsigned int) magic & ~1U); + } + + /* PERF_EVENT_IOC_REFRESH */ + sys_ioctl(-1, PERF_EVENT_IOC_REFRESH, magic); + printf("ioctl(-1, PERF_EVENT_IOC_REFRESH, %d) = -1 EBADF (%m)\n", + (int) magic); + + /* PERF_EVENT_IOC_PERIOD */ + ioctl(-1, PERF_EVENT_IOC_PERIOD, NULL); + printf("ioctl(-1, PERF_EVENT_IOC_PERIOD, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, PERF_EVENT_IOC_PERIOD, u64_efault); + printf("ioctl(-1, PERF_EVENT_IOC_PERIOD, %p) = -1 EBADF (%m)\n", + u64_efault); + + ioctl(-1, PERF_EVENT_IOC_PERIOD, u64_ptr); + printf("ioctl(-1, PERF_EVENT_IOC_PERIOD, [%" PRIu64 "])" + " = -1 EBADF (%m)\n", + magic64); + + /* PERF_EVENT_IOC_SET_OUTPUT */ + sys_ioctl(-1, PERF_EVENT_IOC_SET_OUTPUT, magic); + printf("ioctl(-1, PERF_EVENT_IOC_SET_OUTPUT, %d) = -1 EBADF (%m)\n", + (int) magic); + + /* PERF_EVENT_IOC_SET_FILTER */ + ioctl(-1, PERF_EVENT_IOC_SET_FILTER, NULL); + printf("ioctl(-1, PERF_EVENT_IOC_SET_FILTER, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, PERF_EVENT_IOC_SET_FILTER, str_efault); + printf("ioctl(-1, PERF_EVENT_IOC_SET_FILTER, %p) = -1 EBADF (%m)\n", + str_efault); + + ioctl(-1, PERF_EVENT_IOC_SET_FILTER, str_ptr); + printf("ioctl(-1, PERF_EVENT_IOC_SET_FILTER, \"%.32s\"...)" + " = -1 EBADF (%m)\n", + str_ptr); + + ioctl(-1, PERF_EVENT_IOC_SET_FILTER, str_ptr + 40); + printf("ioctl(-1, PERF_EVENT_IOC_SET_FILTER, \"%.32s\")" + " = -1 EBADF (%m)\n", + str_ptr + 40); + + str_ptr[sizeof(str) - 1] = '0'; + ioctl(-1, PERF_EVENT_IOC_SET_FILTER, str_ptr + 40); + printf("ioctl(-1, PERF_EVENT_IOC_SET_FILTER, %p)" + " = -1 EBADF (%m)\n", + str_ptr + 40); + + /* PERF_EVENT_IOC_ID */ + ioctl(-1, PERF_EVENT_IOC_ID, NULL); + printf("ioctl(-1, PERF_EVENT_IOC_ID, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, PERF_EVENT_IOC_ID, u64_efault); + printf("ioctl(-1, PERF_EVENT_IOC_ID, %p) = -1 EBADF (%m)\n", + u64_efault); + + ioctl(-1, PERF_EVENT_IOC_ID, u64_ptr); + printf("ioctl(-1, PERF_EVENT_IOC_ID, %p) = -1 EBADF (%m)\n", + u64_ptr); + + /* PERF_EVENT_IOC_SET_BPF */ + sys_ioctl(-1, PERF_EVENT_IOC_SET_BPF, magic); + printf("ioctl(-1, PERF_EVENT_IOC_SET_BPF, %d) = -1 EBADF (%m)\n", + (int) magic); + + /* PERF_EVENT_IOC_PAUSE_OUTPUT */ + sys_ioctl(-1, PERF_EVENT_IOC_PAUSE_OUTPUT, magic); + printf("ioctl(-1, PERF_EVENT_IOC_PAUSE_OUTPUT, %lu) = -1 EBADF (%m)\n", + (unsigned long) magic); + + /* PERF_EVENT_IOC_QUERY_BPF */ + ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, NULL); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, u32_efault); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, %p) = -1 EBADF (%m)\n", + u32_efault); + + u32_arr[0] = 0xbadc0ded; + ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, u32_arr); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, {ids_len=3134983661, ...})" + " = -1 EBADF (%m)\n"); + + /* PERF_EVENT_IOC_MODIFY_ATTRIBUTES */ + ioctl(-1, PERF_EVENT_IOC_MODIFY_ATTRIBUTES, NULL); + printf("ioctl(-1, PERF_EVENT_IOC_MODIFY_ATTRIBUTES, NULL)" + " = -1 EBADF (%m)\n"); + + ioctl(-1, PERF_EVENT_IOC_MODIFY_ATTRIBUTES, pea_ptr + 1); + printf("ioctl(-1, PERF_EVENT_IOC_MODIFY_ATTRIBUTES, %p)" + " = -1 EBADF (%m)\n", + pea_ptr + 1); + + printf("ioctl(-1, PERF_EVENT_IOC_MODIFY_ATTRIBUTES" + ", {type=%#x /* PERF_TYPE_??? */" + ", size=%#x /* PERF_ATTR_SIZE_??? */" + ", config=%#llx, ...}) = -1 EBADF (%m)\n", + (unsigned int) pea_ptr->type, + (unsigned int) pea_ptr->size, + (unsigned long long) pea_ptr->config); + ioctl(-1, PERF_EVENT_IOC_MODIFY_ATTRIBUTES, pea_ptr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_PERF_EVENT_H"); + +#endif diff --git a/tests-mx32/ioctl_perf.gen.test b/tests-mx32/ioctl_perf.gen.test new file mode 100755 index 00000000..0264f349 --- /dev/null +++ b/tests-mx32/ioctl_perf.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_perf +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_ptp.c b/tests-mx32/ioctl_ptp.c new file mode 100644 index 00000000..52d9698a --- /dev/null +++ b/tests-mx32/ioctl_ptp.c @@ -0,0 +1,111 @@ +/* + * Check decoding of PTP_* commands of ioctl syscall. + * + * Copyright (c) 2018 Harsha Sharma + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_PTP_SYS_OFFSET + +# include +# include +# include +# include +# include +# include +# include +# include + +# include "xlat.h" +# include "xlat/ptp_flags_options.h" + +static void +test_no_device(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct ptp_clock_caps, caps); + fill_memory(caps, sizeof(*caps)); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct ptp_sys_offset, sysoff); + fill_memory(sysoff, sizeof(*sysoff)); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct ptp_extts_request, extts); + fill_memory(extts, sizeof(*extts)); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct ptp_perout_request, perout); + fill_memory(perout, sizeof(*perout)); + + int saved_errno; + + /* PTP_CLOCK_GETCAPS */ + ioctl(-1, PTP_CLOCK_GETCAPS, NULL); + printf("ioctl(-1, PTP_CLOCK_GETCAPS, NULL) = -1 EBADF (%m)\n"); + ioctl(-1, PTP_CLOCK_GETCAPS, caps); + printf("ioctl(-1, PTP_CLOCK_GETCAPS, %p) = -1 EBADF (%m)\n", caps); + + /* PTP_SYS_OFFSET */ + ioctl(-1, PTP_SYS_OFFSET, NULL); + printf("ioctl(-1, PTP_SYS_OFFSET, NULL) = -1 EBADF (%m)\n"); + ioctl(-1, PTP_SYS_OFFSET, sysoff); + printf("ioctl(-1, PTP_SYS_OFFSET, {n_samples=%u}) = -1 EBADF (%m)\n", + sysoff->n_samples); + + /* PTP_ENABLE_PPS */ + ioctl(-1, PTP_ENABLE_PPS, 0); + printf("ioctl(-1, PTP_ENABLE_PPS, 0) = -1 EBADF (%m)\n"); + ioctl(-1, PTP_ENABLE_PPS, 1); + printf("ioctl(-1, PTP_ENABLE_PPS, 1) = -1 EBADF (%m)\n"); + + /* PTP_EXTTS_REQUEST */ + ioctl(-1, PTP_EXTTS_REQUEST, NULL); + printf("ioctl(-1, PTP_EXTTS_REQUEST, NULL) = -1 EBADF (%m)\n"); + ioctl(-1, PTP_EXTTS_REQUEST, extts); + saved_errno = errno; + printf("ioctl(-1, PTP_EXTTS_REQUEST, {index=%d, flags=", extts->index); + printflags(ptp_flags_options, extts->flags, "PTP_???"); + errno = saved_errno; + printf("}) = -1 EBADF (%m)\n"); + + /* PTP_PEROUT_REQUEST */ + ioctl(-1, PTP_PEROUT_REQUEST, NULL); + printf("ioctl(-1, PTP_PEROUT_REQUEST, NULL) = -1 EBADF (%m)\n"); + ioctl(-1, PTP_PEROUT_REQUEST, perout); + saved_errno = errno; + printf("ioctl(-1, PTP_PEROUT_REQUEST, {start={sec=%" PRId64 + ", nsec=%" PRIu32 "}, period={sec=%" PRId64 ", nsec=%" PRIu32 "}" + ", index=%d, flags=", + (int64_t) perout->start.sec, perout->start.nsec, + (int64_t)perout->period.sec, perout->period.nsec, perout->index); + printflags(ptp_flags_options, perout->flags, "PTP_???"); + errno = saved_errno; + printf("}) = -1 EBADF (%m)\n"); + + /* unrecognized */ + ioctl(-1, _IOC(_IOC_READ, PTP_CLK_MAGIC, 0xff, 0xfe), 0); + printf("ioctl(-1, _IOC(_IOC_READ, %#x, 0xff, 0xfe), 0)" + " = -1 EBADF (%m)\n", PTP_CLK_MAGIC); + + const unsigned long arg = (unsigned long) 0xfacefeeddeadbeefULL; + ioctl(-1, _IOC(_IOC_WRITE, PTP_CLK_MAGIC, 0xfd, 0xfc), arg); + printf("ioctl(-1, _IOC(_IOC_WRITE, %#x, 0xfd, 0xfc), %#lx)" + " = -1 EBADF (%m)\n", PTP_CLK_MAGIC, arg); +} + +int +main(void) +{ + test_no_device(); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_PTP_SYS_OFFSET") + +#endif /* HAVE_STRUCT_PTP_SYS_OFFSET */ diff --git a/tests-mx32/ioctl_ptp.gen.test b/tests-mx32/ioctl_ptp.gen.test new file mode 100755 index 00000000..6c0b0a92 --- /dev/null +++ b/tests-mx32/ioctl_ptp.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_ptp +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_random.c b/tests-mx32/ioctl_random.c new file mode 100644 index 00000000..0d8e9f28 --- /dev/null +++ b/tests-mx32/ioctl_random.c @@ -0,0 +1,61 @@ +/* + * Check decoding of RND* commands of ioctl syscall. + * + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +#define XLAT_MACROS_ONLY +#include "xlat/random_ioctl_cmds.h" +#undef XLAT_MACROS_ONLY + +#define RVAL_EBADF " = -1 EBADF (%m)\n" + +int +main(void) +{ + union { + char c[sizeof(struct rand_pool_info) + 8]; + struct rand_pool_info info; + } u; + struct rand_pool_info *info = &u.info; + int cnt = 6; + + memcpy(info->buf, "12345678", 8); + info->buf_size = 8; + info->entropy_count = 3; + + ioctl(-1, RNDGETENTCNT, &cnt); + printf("ioctl(-1, RNDGETENTCNT, %p)" RVAL_EBADF, &cnt); + ioctl(-1, RNDADDTOENTCNT, &cnt); + printf("ioctl(-1, RNDADDTOENTCNT, [6])" RVAL_EBADF); + + ioctl(-1, RNDADDENTROPY, NULL); + printf("ioctl(-1, RNDADDENTROPY, NULL)" RVAL_EBADF); + ioctl(-1, RNDADDENTROPY, info); + printf("ioctl(-1, RNDADDENTROPY, {entropy_count=3, buf_size=8, buf=\"12345678\"})" RVAL_EBADF); + + ioctl(-1, RNDZAPENTCNT); + printf("ioctl(-1, FASTRPC_IOCTL_INIT_ATTACH or RNDZAPENTCNT)" + RVAL_EBADF); + ioctl(-1, RNDCLEARPOOL); + printf("ioctl(-1, RNDCLEARPOOL)" RVAL_EBADF); + ioctl(-1, RNDRESEEDCRNG); + printf("ioctl(-1, RNDRESEEDCRNG)" RVAL_EBADF); + + ioctl(-1, _IO('R', 0xff), NULL); + printf("ioctl(-1, _IOC(_IOC_NONE, %#x, 0xff, 0), 0)" RVAL_EBADF, 'R'); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/ioctl_random.gen.test b/tests-mx32/ioctl_random.gen.test new file mode 100755 index 00000000..3afcab0a --- /dev/null +++ b/tests-mx32/ioctl_random.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_random +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_rtc-v.gen.test b/tests-mx32/ioctl_rtc-v.gen.test new file mode 100755 index 00000000..820181b0 --- /dev/null +++ b/tests-mx32/ioctl_rtc-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_rtc-v +ioctl.test -v); do not edit. +set -- -v +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_rtc-v.test b/tests-mx32/ioctl_rtc-v.test deleted file mode 100755 index a255322d..00000000 --- a/tests-mx32/ioctl_rtc-v.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check verbose decoding of RTC_* ioctls. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a16 -veioctl $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/ioctl_rtc.c b/tests-mx32/ioctl_rtc.c index 49d7ec7b..d192e378 100644 --- a/tests-mx32/ioctl_rtc.c +++ b/tests-mx32/ioctl_rtc.c @@ -2,29 +2,10 @@ * This file is part of ioctl_rtc strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -73,13 +54,13 @@ main(void) void *const page = tail_alloc(size); fill_memory(page, size); - struct rtc_time *rt = tail_alloc(sizeof(*rt)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct rtc_time, rt); fill_memory(rt, sizeof(*rt)); - struct rtc_wkalrm *wk = tail_alloc(sizeof(*wk)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct rtc_wkalrm, wk); fill_memory(wk, sizeof(*wk)); - struct rtc_pll_info *pll = tail_alloc(sizeof(*pll)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct rtc_pll_info, pll); fill_memory(pll, sizeof(*pll)); /* RTC_ALM_READ */ diff --git a/tests-mx32/ioctl_rtc.gen.test b/tests-mx32/ioctl_rtc.gen.test new file mode 100755 index 00000000..310b5588 --- /dev/null +++ b/tests-mx32/ioctl_rtc.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_rtc +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_rtc.test b/tests-mx32/ioctl_rtc.test deleted file mode 100755 index 4545f2ae..00000000 --- a/tests-mx32/ioctl_rtc.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check basic decoding of RTC_* ioctls. - -. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_scsi.c b/tests-mx32/ioctl_scsi.c index 0db94d84..b6347b62 100644 --- a/tests-mx32/ioctl_scsi.c +++ b/tests-mx32/ioctl_scsi.c @@ -2,29 +2,10 @@ * Check decoding of SCSI ioctl commands. * * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -69,7 +50,7 @@ int main(void) { - int *const pint = tail_alloc(sizeof(*pint)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, pint); *pint = (int) 0xfacefeed; TEST_NO_ARG(SG_GET_TIMEOUT); @@ -137,13 +118,14 @@ main(void) "SG_SCSI_RESET"); ioctl(-1, 0x22ff, 0); - printf("ioctl(-1, _IOC(0, 0x22, 0xff, 0), 0) = -1 EBADF (%m)\n"); + printf("ioctl(-1, _IOC(%s, 0x22, 0xff, 0), 0) = -1 EBADF (%m)\n", + _IOC_NONE ? "0" : "_IOC_NONE"); static const unsigned long magic = (unsigned long) 0xdeadbeeffacefeedULL; ioctl(-1, 0x22ff, magic); - printf("ioctl(-1, _IOC(0, 0x22, 0xff, 0), %#lx) = -1 EBADF (%m)\n", - magic); + printf("ioctl(-1, _IOC(%s, 0x22, 0xff, 0), %#lx) = -1 EBADF (%m)\n", + _IOC_NONE ? "0" : "_IOC_NONE", magic); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/ioctl_scsi.gen.test b/tests-mx32/ioctl_scsi.gen.test new file mode 100755 index 00000000..499bfc49 --- /dev/null +++ b/tests-mx32/ioctl_scsi.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_scsi +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_scsi.test b/tests-mx32/ioctl_scsi.test deleted file mode 100755 index 2710f12b..00000000 --- a/tests-mx32/ioctl_scsi.test +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -# Check decoding of SCSI ioctl commands. -. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_sg_io_v3.c b/tests-mx32/ioctl_sg_io_v3.c index ef25795b..b857892f 100644 --- a/tests-mx32/ioctl_sg_io_v3.c +++ b/tests-mx32/ioctl_sg_io_v3.c @@ -1,30 +1,10 @@ /* * Check decoding of ioctl SG_IO v3 commands. * - * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -43,7 +23,7 @@ main(void) ioctl(-1, SG_IO, 0); printf("ioctl(-1, SG_IO, NULL) = -1 EBADF (%m)\n"); - struct sg_io_hdr *const sg_io = tail_alloc(sizeof(*sg_io)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sg_io_hdr, sg_io); fill_memory(sg_io, sizeof(*sg_io)); const void *const efault = sg_io + 1; @@ -53,7 +33,7 @@ main(void) ioctl(-1, SG_IO, sg_io); printf("ioctl(-1, SG_IO, [%u]) = -1 EBADF (%m)\n", sg_io->interface_id); - unsigned int *const piid = tail_alloc(sizeof(*piid)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, piid); *piid = (unsigned char) 'S'; ioctl(-1, SG_IO, piid); printf("ioctl(-1, SG_IO, {interface_id='S', %p}) = -1 EBADF (%m)\n", piid + 1); @@ -198,12 +178,12 @@ main(void) sg_io->iovec_count, sg_io->dxfer_len, sg_io->timeout, - * (unsigned char *) (iov[0].iov_base + 0), - * (unsigned char *) (iov[0].iov_base + 1), + *(unsigned char *) (iov[0].iov_base + 0), + *(unsigned char *) (iov[0].iov_base + 1), (unsigned int) iov[0].iov_len, - * (unsigned char *) (iov[1].iov_base + 0), - * (unsigned char *) (iov[1].iov_base + 1), - * (unsigned char *) (iov[1].iov_base + 2), + *(unsigned char *) (iov[1].iov_base + 0), + *(unsigned char *) (iov[1].iov_base + 1), + *(unsigned char *) (iov[1].iov_base + 2), (unsigned int) iov[1].iov_len, sg_io->status, sg_io->masked_status, @@ -248,12 +228,12 @@ main(void) sg_io->iovec_count, sg_io->dxfer_len, sg_io->timeout, - * (unsigned char *) (iov[0].iov_base + 0), - * (unsigned char *) (iov[0].iov_base + 1), + *(unsigned char *) (iov[0].iov_base + 0), + *(unsigned char *) (iov[0].iov_base + 1), (unsigned int) iov[0].iov_len, - * (unsigned char *) (iov[1].iov_base + 0), - * (unsigned char *) (iov[1].iov_base + 1), - * (unsigned char *) (iov[1].iov_base + 2), + *(unsigned char *) (iov[1].iov_base + 0), + *(unsigned char *) (iov[1].iov_base + 1), + *(unsigned char *) (iov[1].iov_base + 2), (unsigned int) iov[1].iov_len, sg_io->status, sg_io->masked_status, @@ -300,10 +280,10 @@ main(void) sg_io->iovec_count, sg_io->dxfer_len, sg_io->timeout, - * (unsigned char *) (sg_io->dxferp + 0), - * (unsigned char *) (sg_io->dxferp + 1), - * (unsigned char *) (sg_io->dxferp + 2), - * (unsigned char *) (sg_io->dxferp + 3), + *(unsigned char *) (sg_io->dxferp + 0), + *(unsigned char *) (sg_io->dxferp + 1), + *(unsigned char *) (sg_io->dxferp + 2), + *(unsigned char *) (sg_io->dxferp + 3), sg_io->status, sg_io->masked_status, sg_io->msg_status, @@ -348,11 +328,11 @@ main(void) sg_io->iovec_count, sg_io->dxfer_len, sg_io->timeout, - * (unsigned char *) (sg_io->dxferp + 0), - * (unsigned char *) (sg_io->dxferp + 1), - * (unsigned char *) (sg_io->dxferp + 2), - * (unsigned char *) (sg_io->dxferp + 0), - * (unsigned char *) (sg_io->dxferp + 1), + *(unsigned char *) (sg_io->dxferp + 0), + *(unsigned char *) (sg_io->dxferp + 1), + *(unsigned char *) (sg_io->dxferp + 2), + *(unsigned char *) (sg_io->dxferp + 0), + *(unsigned char *) (sg_io->dxferp + 1), sg_io->status, sg_io->masked_status, sg_io->msg_status, @@ -394,9 +374,9 @@ main(void) sg_io->iovec_count, sg_io->dxfer_len, sg_io->timeout, - * (unsigned char *) (sg_io->dxferp + 0), - * (unsigned char *) (sg_io->dxferp + 1), - * (unsigned char *) (sg_io->dxferp + 2), + *(unsigned char *) (sg_io->dxferp + 0), + *(unsigned char *) (sg_io->dxferp + 1), + *(unsigned char *) (sg_io->dxferp + 2), sg_io->status, sg_io->masked_status, sg_io->msg_status, diff --git a/tests-mx32/ioctl_sg_io_v3.gen.test b/tests-mx32/ioctl_sg_io_v3.gen.test new file mode 100755 index 00000000..ef8fd14d --- /dev/null +++ b/tests-mx32/ioctl_sg_io_v3.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_sg_io_v3 +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_sg_io_v3.test b/tests-mx32/ioctl_sg_io_v3.test deleted file mode 100755 index dacacdf4..00000000 --- a/tests-mx32/ioctl_sg_io_v3.test +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -# Check decoding of ioctl SG_IO v3 commands. -. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_sg_io_v4.c b/tests-mx32/ioctl_sg_io_v4.c index 5f899eee..59438285 100644 --- a/tests-mx32/ioctl_sg_io_v4.c +++ b/tests-mx32/ioctl_sg_io_v4.c @@ -1,30 +1,10 @@ /* * Check decoding of ioctl SG_IO v4 commands. * - * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -45,7 +25,7 @@ main(void) ioctl(-1, SG_IO, 0); printf("ioctl(-1, SG_IO, NULL) = -1 EBADF (%m)\n"); - struct sg_io_v4 *const sg_io = tail_alloc(sizeof(*sg_io)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sg_io_v4, sg_io); fill_memory(sg_io, sizeof(*sg_io)); const void *const efault = sg_io + 1; @@ -55,7 +35,7 @@ main(void) ioctl(-1, SG_IO, sg_io); printf("ioctl(-1, SG_IO, [%u]) = -1 EBADF (%m)\n", sg_io->guard); - unsigned int *const pguard = tail_alloc(sizeof(*pguard)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, pguard); *pguard = (unsigned char) 'Q'; ioctl(-1, SG_IO, pguard); printf("ioctl(-1, SG_IO, {guard='Q', %p}) = -1 EBADF (%m)\n", pguard + 1); @@ -189,9 +169,9 @@ main(void) ", dout_resid=%d" ", generated_tag=%#" PRI__x64 "}) = -1 EBADF (%m)\n", sg_io->request_len, - * (unsigned char *) ((unsigned long) sg_io->request + 0), - * (unsigned char *) ((unsigned long) sg_io->request + 1), - * (unsigned char *) ((unsigned long) sg_io->request + 2), + *(unsigned char *) ((unsigned long) sg_io->request + 0), + *(unsigned char *) ((unsigned long) sg_io->request + 1), + *(unsigned char *) ((unsigned long) sg_io->request + 2), sg_io->request_tag, sg_io->request_attr, sg_io->request_priority, @@ -201,22 +181,22 @@ main(void) sg_io->dout_xfer_len, sg_io->din_iovec_count, sg_io->din_xfer_len, - * (unsigned char *) (iov[0].iov_base + 0), - * (unsigned char *) (iov[0].iov_base + 1), + *(unsigned char *) (iov[0].iov_base + 0), + *(unsigned char *) (iov[0].iov_base + 1), (unsigned int) iov[0].iov_len, - * (unsigned char *) (iov[1].iov_base + 0), - * (unsigned char *) (iov[1].iov_base + 1), - * (unsigned char *) (iov[1].iov_base + 2), + *(unsigned char *) (iov[1].iov_base + 0), + *(unsigned char *) (iov[1].iov_base + 1), + *(unsigned char *) (iov[1].iov_base + 2), (unsigned int) iov[1].iov_len, sg_io->timeout, sg_io->usr_ptr, sg_io->response_len, - * (unsigned char *) ((unsigned long) sg_io->response + 0), - * (unsigned char *) ((unsigned long) sg_io->response + 1), - * (unsigned char *) ((unsigned long) sg_io->din_xferp + 0), - * (unsigned char *) ((unsigned long) sg_io->din_xferp + 1), - * (unsigned char *) ((unsigned long) sg_io->din_xferp + 2), - * (unsigned char *) ((unsigned long) sg_io->din_xferp + 3), + *(unsigned char *) ((unsigned long) sg_io->response + 0), + *(unsigned char *) ((unsigned long) sg_io->response + 1), + *(unsigned char *) ((unsigned long) sg_io->din_xferp + 0), + *(unsigned char *) ((unsigned long) sg_io->din_xferp + 1), + *(unsigned char *) ((unsigned long) sg_io->din_xferp + 2), + *(unsigned char *) ((unsigned long) sg_io->din_xferp + 3), sg_io->driver_status, sg_io->transport_status, sg_io->device_status, diff --git a/tests-mx32/ioctl_sg_io_v4.gen.test b/tests-mx32/ioctl_sg_io_v4.gen.test new file mode 100755 index 00000000..4aa4e4e9 --- /dev/null +++ b/tests-mx32/ioctl_sg_io_v4.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_sg_io_v4 +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_sg_io_v4.test b/tests-mx32/ioctl_sg_io_v4.test deleted file mode 100755 index 25567224..00000000 --- a/tests-mx32/ioctl_sg_io_v4.test +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -# Check decoding of ioctl SG_IO v4 commands. -. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_sock_gifconf.c b/tests-mx32/ioctl_sock_gifconf.c index ae0bea4f..0db9d7da 100644 --- a/tests-mx32/ioctl_sock_gifconf.c +++ b/tests-mx32/ioctl_sock_gifconf.c @@ -2,34 +2,14 @@ * Check decoding of SIOCGIFCONF command of ioctl syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" -#include #include #include @@ -104,7 +84,7 @@ print_ifconf(struct ifconf *ifc, int in_len, char *in_buf, long rc) static void gifconf_ioctl(int fd, struct ifconf *ifc, bool ifc_valid) { - const char * errstr; + const char *errstr; int in_len; char *in_buf; long rc; @@ -134,7 +114,7 @@ int main(int argc, char *argv[]) { struct ifreq *ifr = tail_alloc(2 * sizeof(*ifr)); - struct ifconf *ifc = tail_alloc(sizeof(*ifc)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct ifconf, ifc); struct sockaddr_in addr; int fd; diff --git a/tests-mx32/ioctl_sock_gifconf.gen.test b/tests-mx32/ioctl_sock_gifconf.gen.test new file mode 100755 index 00000000..5d6fe2f4 --- /dev/null +++ b/tests-mx32/ioctl_sock_gifconf.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_sock_gifconf +ioctl.test -a28 -s1); do not edit. +set -- -a28 -s1 +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_sock_gifconf.test b/tests-mx32/ioctl_sock_gifconf.test deleted file mode 100755 index 2e2fc019..00000000 --- a/tests-mx32/ioctl_sock_gifconf.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check decoding of SIOCGIFCONF ioctl. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a28 -s1 -eioctl $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/ioctl_uffdio.c b/tests-mx32/ioctl_uffdio.c index 10b8b843..19104442 100644 --- a/tests-mx32/ioctl_uffdio.c +++ b/tests-mx32/ioctl_uffdio.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Red Hat, Inc. + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -43,6 +24,9 @@ # include # include +# include "xlat.h" +# include "xlat/uffd_api_features.h" + int main(void) { @@ -54,7 +38,7 @@ main(void) perror_msg_and_skip("userfaultfd"); /* ---- API ---- */ - struct uffdio_api *api_struct = tail_alloc(sizeof(*api_struct)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct uffdio_api, api_struct); /* With a bad fd */ memset(api_struct, 0, sizeof(*api_struct)); @@ -69,10 +53,14 @@ main(void) api_struct->api = UFFD_API; api_struct->features = 0; rc = ioctl(fd, UFFDIO_API, api_struct); - printf("ioctl(%d, UFFDIO_API, {api=0xaa, features=0, " - "features.out=%#" PRIx64 ", " "ioctls=1<<_UFFDIO_REGISTER|" - "1<<_UFFDIO_UNREGISTER|1<<_UFFDIO_API", - fd, (uint64_t)api_struct->features); + printf("ioctl(%d, UFFDIO_API, {api=0xaa, features=0", fd); + if (api_struct->features) { + printf(" => features="); + printflags(uffd_api_features, api_struct->features, + "UFFD_FEATURE_???"); + } + printf(", ioctls=1<<_UFFDIO_REGISTER|" + "1<<_UFFDIO_UNREGISTER|1<<_UFFDIO_API"); api_struct->ioctls &= ~(1ull<<_UFFDIO_REGISTER| 1ull<<_UFFDIO_UNREGISTER| 1ull<<_UFFDIO_API); @@ -127,7 +115,7 @@ main(void) * userfaultfd will cause us to stall. */ /* ---- COPY ---- */ - struct uffdio_copy *copy_struct = tail_alloc(sizeof(*copy_struct)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct uffdio_copy, copy_struct); memset(copy_struct, 0, sizeof(*copy_struct)); rc = ioctl(-1, UFFDIO_COPY, copy_struct); @@ -148,7 +136,7 @@ main(void) fd, area2, area1, pagesize, pagesize, rc); /* ---- ZEROPAGE ---- */ - struct uffdio_zeropage *zero_struct = tail_alloc(sizeof(*zero_struct)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct uffdio_zeropage, zero_struct); madvise(area2, pagesize, MADV_DONTNEED); memset(zero_struct, 0, sizeof(*zero_struct)); @@ -169,7 +157,7 @@ main(void) fd, area2, pagesize, pagesize, rc); /* ---- WAKE ---- */ - struct uffdio_range *range_struct = tail_alloc(sizeof(*range_struct)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct uffdio_range, range_struct); memset(range_struct, 0, sizeof(*range_struct)); rc = ioctl(-1, UFFDIO_WAKE, range_struct); diff --git a/tests-mx32/ioctl_uffdio.gen.test b/tests-mx32/ioctl_uffdio.gen.test new file mode 100755 index 00000000..ed73c5f0 --- /dev/null +++ b/tests-mx32/ioctl_uffdio.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_uffdio +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_uffdio.test b/tests-mx32/ioctl_uffdio.test deleted file mode 100755 index fae9b556..00000000 --- a/tests-mx32/ioctl_uffdio.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check userfaultfd ioctl decoding. - -. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_v4l2.c b/tests-mx32/ioctl_v4l2.c index af8c3419..54e9ee7c 100644 --- a/tests-mx32/ioctl_v4l2.c +++ b/tests-mx32/ioctl_v4l2.c @@ -1,66 +1,365 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" +#include #include #include #include #include #include -#if WORDS_BIGENDIAN -# define cc0(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 24)) -# define cc1(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 16)) -# define cc2(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 8)) -# define cc3(arg) ((unsigned int) (unsigned char) (arg)) -# define fourcc(a0, a1, a2, a3) \ - ((unsigned int)(a3) | \ - ((unsigned int)(a2) << 8) | \ - ((unsigned int)(a1) << 16) | \ - ((unsigned int)(a0) << 24)) -#else -# define cc0(arg) ((unsigned int) (unsigned char) (arg)) -# define cc1(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 8)) -# define cc2(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 16)) -# define cc3(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 24)) -# define fourcc(a0, a1, a2, a3) \ +#define cc0(arg) ((unsigned int) (unsigned char) (arg)) +#define cc1(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 8)) +#define cc2(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 16)) +#define cc3(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 24)) +#define fourcc(a0, a1, a2, a3) \ ((unsigned int)(a0) | \ ((unsigned int)(a1) << 8) | \ ((unsigned int)(a2) << 16) | \ ((unsigned int)(a3) << 24)) -#endif static const unsigned int magic = 0xdeadbeef; +static const unsigned int pf_magic = fourcc('S', '5', '0', '8'); +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT +static const unsigned int sf_magic = fourcc('R', 'U', '1', '2'); +#endif + +static void +init_v4l2_format(struct v4l2_format *const f, + const unsigned int buf_type) +{ + memset(f, -1, sizeof(*f)); + f->type = buf_type; + switch (buf_type) { + case V4L2_BUF_TYPE_VIDEO_CAPTURE: + case V4L2_BUF_TYPE_VIDEO_OUTPUT: + f->fmt.pix.width = 0x657b8160; + f->fmt.pix.height = 0x951c0047; + if (buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE) + f->fmt.pix.pixelformat = magic; + else + f->fmt.pix.pixelformat = pf_magic; + f->fmt.pix.field = V4L2_FIELD_NONE; + f->fmt.pix.bytesperline = 0xdf20d185; + f->fmt.pix.sizeimage = 0x0cf7be41; + f->fmt.pix.colorspace = V4L2_COLORSPACE_JPEG; + break; +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE + case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: + case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: { + unsigned int i; + + f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; + f->fmt.pix_mp.width = 0x1f3b774b; + f->fmt.pix_mp.height = 0xab96a8d6; + if (buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) + f->fmt.pix_mp.pixelformat = magic; + else + f->fmt.pix_mp.pixelformat = pf_magic; + f->fmt.pix_mp.field = V4L2_FIELD_NONE; + f->fmt.pix_mp.colorspace = V4L2_COLORSPACE_JPEG; + struct v4l2_plane_pix_format *cur_pix = + f->fmt.pix_mp.plane_fmt; + for (i = 0; + i < ARRAY_SIZE(f->fmt.pix_mp.plane_fmt); + i++) { + cur_pix[i].sizeimage = 0x1e3c531c | i; + cur_pix[i].bytesperline = 0xa983d721 | i; + } + break; + } +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY + case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: +#endif + case V4L2_BUF_TYPE_VIDEO_OVERLAY: + f->fmt.win.w.left = 0xe8373662; + f->fmt.win.w.top = 0x0336d283; + f->fmt.win.w.width = 0x9235fe72; + f->fmt.win.w.height = 0xbbd886c8; + f->fmt.win.field = V4L2_FIELD_ANY; + f->fmt.win.chromakey = 0xdb1f991f; + f->fmt.win.clipcount = 2; + f->fmt.win.clips = + tail_alloc(sizeof(*f->fmt.win.clips) * + f->fmt.win.clipcount); + f->fmt.win.clips[0].c.left = 0x3313d36e; + f->fmt.win.clips[0].c.top = 0xcdffe510; + f->fmt.win.clips[0].c.width = 0x2064f3a8; + f->fmt.win.clips[0].c.height = 0xd06d314a; + f->fmt.win.clips[1].c.left = 0xd8c8a83f; + f->fmt.win.clips[1].c.top = 0x336e87ba; + f->fmt.win.clips[1].c.width = 0x9e3a6fb3; + f->fmt.win.clips[1].c.height = 0x05617b76; + + f->fmt.win.bitmap = (void *) -2UL; +#ifdef HAVE_STRUCT_V4L2_WINDOW_GLOBAL_ALPHA + f->fmt.win.global_alpha = 0xce; +#endif + break; + case V4L2_BUF_TYPE_VBI_CAPTURE: + case V4L2_BUF_TYPE_VBI_OUTPUT: + f->fmt.vbi.sampling_rate = 0x3d9b5b79; + f->fmt.vbi.offset = 0x055b3a09; + f->fmt.vbi.samples_per_line = 0xf176d436; + if (buf_type == V4L2_BUF_TYPE_VBI_CAPTURE) + f->fmt.vbi.sample_format = magic; + else + f->fmt.vbi.sample_format = pf_magic; + f->fmt.vbi.start[0] = 0x9858e2eb; + f->fmt.vbi.start[1] = 0x8a4dc8c1; + f->fmt.vbi.count[0] = 0x4bcf36a3; + f->fmt.vbi.count[1] = 0x97dff65f; + f->fmt.vbi.flags = V4L2_VBI_INTERLACED; + break; +#if HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE + case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: + case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: { + unsigned int i; + + f->fmt.sliced.service_set = V4L2_SLICED_VPS; + f->fmt.sliced.io_size = 0xd897925a; + for (i = 0; + i < ARRAY_SIZE(f->fmt.sliced.service_lines[0]); + i++) { + f->fmt.sliced.service_lines[0][i] = 0xc38e | i; + f->fmt.sliced.service_lines[1][i] = 0x3abb | i; + } + break; + } +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT + case V4L2_BUF_TYPE_SDR_OUTPUT: + f->fmt.sdr.pixelformat = sf_magic; +# ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE + f->fmt.sdr.buffersize = 0x25afabfb; +# endif + break; +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE + case V4L2_BUF_TYPE_SDR_CAPTURE: + f->fmt.sdr.pixelformat = magic; +# ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE + f->fmt.sdr.buffersize = 0x25afabfb; +# endif + break; +#endif + } +} + +static void +dprint_ioctl_v4l2(struct v4l2_format *const f, + const char *request, const unsigned int buf_type, + const char *buf_type_string) +{ + int saved_errno; + + switch (buf_type) { + case V4L2_BUF_TYPE_VIDEO_CAPTURE: + case V4L2_BUF_TYPE_VIDEO_OUTPUT: + saved_errno = errno; + printf("ioctl(-1, %s, {type=%s" + ", fmt.pix={width=%u, height=%u, pixelformat=", + request, + buf_type_string, + f->fmt.pix.width, f->fmt.pix.height); + + if (buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE) + printf("v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')", + cc0(magic), cc1(magic), cc2(magic), cc3(magic)); + else + printf("v4l2_fourcc('%c', '%c', '%c', '%c') " + "/* V4L2_PIX_FMT_SPCA508 */", + cc0(pf_magic), cc1(pf_magic), cc2(pf_magic), + cc3(pf_magic)); + + errno = saved_errno; + printf(", field=V4L2_FIELD_NONE, bytesperline=%u, sizeimage=%u" + ", colorspace=V4L2_COLORSPACE_JPEG}}) = -1 EBADF (%m)\n", + f->fmt.pix.bytesperline, + f->fmt.pix.sizeimage); + break; +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE + case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: + case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: { + unsigned int i; + + saved_errno = errno; + printf("ioctl(-1, %s" + ", {type=%s" + ", fmt.pix_mp={width=%u, height=%u, pixelformat=", + request, + buf_type_string, + f->fmt.pix_mp.width, f->fmt.pix_mp.height); + + if (buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) + printf("v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')", + cc0(magic), cc1(magic), cc2(magic), cc3(magic)); + else + printf("v4l2_fourcc('%c', '%c', '%c', '%c') " + "/* V4L2_PIX_FMT_SPCA508 */", + cc0(pf_magic), cc1(pf_magic), cc2(pf_magic), + cc3(pf_magic)); + + printf(", field=V4L2_FIELD_NONE, colorspace=" + "V4L2_COLORSPACE_JPEG, plane_fmt=["); + for (i = 0; + i < ARRAY_SIZE(f->fmt.pix_mp.plane_fmt); + ++i) { + if (i) + printf(", "); + printf("{sizeimage=%u, bytesperline=%u}", + f->fmt.pix_mp.plane_fmt[i].sizeimage, + f->fmt.pix_mp.plane_fmt[i].bytesperline); + } + errno = saved_errno; + printf("], num_planes=%u}}) = -1 EBADF (%m)\n", + f->fmt.pix_mp.num_planes); + break; + } +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY + case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: +#endif + case V4L2_BUF_TYPE_VIDEO_OVERLAY: + printf("ioctl(-1, %s, {type=%s" + ", fmt.win={left=%d, top=%d, width=%u, height=%u" + ", field=V4L2_FIELD_ANY, chromakey=%#x, clips=" + "[{left=%d, top=%d, width=%u, height=%u}, " + "{left=%d, top=%d, width=%u, height=%u}]" + ", clipcount=%u, bitmap=%p" +#ifdef HAVE_STRUCT_V4L2_WINDOW_GLOBAL_ALPHA + ", global_alpha=%#x" +#endif + "}}) = -1 EBADF (%m)\n", + request, + buf_type_string, + f->fmt.win.w.left, f->fmt.win.w.top, + f->fmt.win.w.width, f->fmt.win.w.height, + f->fmt.win.chromakey, + f->fmt.win.clips[0].c.left, + f->fmt.win.clips[0].c.top, + f->fmt.win.clips[0].c.width, + f->fmt.win.clips[0].c.height, + f->fmt.win.clips[1].c.left, + f->fmt.win.clips[1].c.top, + f->fmt.win.clips[1].c.width, + f->fmt.win.clips[1].c.height, + f->fmt.win.clipcount, f->fmt.win.bitmap +#ifdef HAVE_STRUCT_V4L2_WINDOW_GLOBAL_ALPHA + , f->fmt.win.global_alpha +#endif + ); + break; + case V4L2_BUF_TYPE_VBI_CAPTURE: + case V4L2_BUF_TYPE_VBI_OUTPUT: + saved_errno = errno; + printf("ioctl(-1, %s, {type=%s" + ", fmt.vbi={sampling_rate=%u, offset=%u" + ", samples_per_line=%u, sample_format=", + request, + buf_type_string, + f->fmt.vbi.sampling_rate, f->fmt.vbi.offset, + f->fmt.vbi.samples_per_line); + + if (buf_type == V4L2_BUF_TYPE_VBI_CAPTURE) + printf("v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')", + cc0(magic), cc1(magic), cc2(magic), cc3(magic)); + else + printf("v4l2_fourcc('%c', '%c', '%c', '%c') " + "/* V4L2_PIX_FMT_SPCA508 */", + cc0(pf_magic), cc1(pf_magic), cc2(pf_magic), + cc3(pf_magic)); + + errno = saved_errno; + printf(", start=[%u, %u], count=[%u, %u]" + ", flags=V4L2_VBI_INTERLACED}})" + " = -1 EBADF (%m)\n", + f->fmt.vbi.start[0], f->fmt.vbi.start[1], + f->fmt.vbi.count[0], f->fmt.vbi.count[1]); + break; +#if HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE + case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: + case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: { + unsigned int i, j; + + printf("ioctl(-1, %s, {type=%s" + ", fmt.sliced={service_set=V4L2_SLICED_VPS" + ", io_size=%u, service_lines=[", + request, + buf_type_string, + f->fmt.sliced.io_size); + for (i = 0; + i < ARRAY_SIZE(f->fmt.sliced.service_lines); + i++) { + if (i > 0) + printf(", "); + printf("["); + for (j = 0; + j < ARRAY_SIZE(f->fmt.sliced.service_lines[0]); + j++) { + if (j > 0) + printf(", "); + printf("%#x", + f->fmt.sliced.service_lines[i][j]); + } + printf("]"); + } + printf("]}}) = -1 EBADF (%m)\n"); + break; + } +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT + case V4L2_BUF_TYPE_SDR_OUTPUT: +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE + case V4L2_BUF_TYPE_SDR_CAPTURE: + saved_errno = errno; + printf("ioctl(-1, %s, {type=%s" + ", fmt.sdr={pixelformat=", + request, + buf_type_string); + + if (buf_type == V4L2_BUF_TYPE_SDR_CAPTURE) + printf("v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')", + cc0(magic), cc1(magic), cc2(magic), cc3(magic)); +# if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT + else + printf("v4l2_fourcc('%c', '%c', '%c', '%c') " + "/* V4L2_SDR_FMT_RU12LE */", + cc0(sf_magic), cc1(sf_magic), cc2(sf_magic), + cc3(sf_magic)); +# endif + + errno = saved_errno; + printf( +# ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE + ", buffersize=%u" +# endif + "}}) = -1 EBADF (%m)\n" +# ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE + , f->fmt.sdr.buffersize +# endif + ); + break; +#endif + } +} +#define print_ioctl_v4l2(v4l2_format, request, buf_type) \ + dprint_ioctl_v4l2((v4l2_format), (request), (buf_type), #buf_type) int -main(void ) +main(void) { const unsigned int size = get_page_size(); void *const page = tail_alloc(size); + void *const page_end = page + size; fill_memory(page, size); unsigned char cc[sizeof(int)] = { 'A', '\'', '\\', '\xfa' }; @@ -76,7 +375,7 @@ main(void ) ioctl(-1, VIDIOC_ENUM_FMT, 0); printf("ioctl(-1, VIDIOC_ENUM_FMT, NULL) = -1 EBADF (%m)\n"); - struct v4l2_fmtdesc *const p_fmtdesc = tail_alloc(sizeof(*p_fmtdesc)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_fmtdesc, p_fmtdesc); p_fmtdesc->index = magic; p_fmtdesc->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ioctl(-1, VIDIOC_ENUM_FMT, p_fmtdesc); @@ -88,99 +387,167 @@ main(void ) ioctl(-1, VIDIOC_G_FMT, 0); printf("ioctl(-1, VIDIOC_G_FMT, NULL) = -1 EBADF (%m)\n"); - struct v4l2_format *const p_format = tail_alloc(sizeof(*p_format)); - p_format->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_format, p_format); + p_format->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ioctl(-1, VIDIOC_G_FMT, p_format); printf("ioctl(-1, VIDIOC_G_FMT" ", {type=V4L2_BUF_TYPE_VIDEO_CAPTURE}) = -1 EBADF (%m)\n"); +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE + p_format->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE}) =" + " -1 EBADF (%m)\n"); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY + p_format->type = V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY; + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY}) =" + " -1 EBADF (%m)\n"); +#endif + p_format->type = V4L2_BUF_TYPE_VIDEO_OVERLAY; + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_VIDEO_OVERLAY}) =" + " -1 EBADF (%m)\n"); + p_format->type = V4L2_BUF_TYPE_VBI_CAPTURE; + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_VBI_CAPTURE}) = -1 EBADF (%m)\n"); +#if HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE + p_format->type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE; + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_SLICED_VBI_CAPTURE}) = -1 EBADF (%m)\n"); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE + p_format->type = V4L2_BUF_TYPE_SDR_CAPTURE; + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_SDR_CAPTURE}) = -1 EBADF (%m)\n"); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT + p_format->type = V4L2_BUF_TYPE_SDR_OUTPUT; + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_SDR_OUTPUT}) = -1 EBADF (%m)\n"); +#endif /* VIDIOC_S_FMT */ ioctl(-1, VIDIOC_S_FMT, 0); printf("ioctl(-1, VIDIOC_S_FMT, NULL) = -1 EBADF (%m)\n"); - p_format->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; - p_format->fmt.pix.width = 0xdad1beaf; - p_format->fmt.pix.height = 0xdad2beaf; - p_format->fmt.pix.pixelformat = magic; - p_format->fmt.pix.field = V4L2_FIELD_NONE; - p_format->fmt.pix.bytesperline = 0xdad3beaf; - p_format->fmt.pix.sizeimage = 0xdad4beaf; - p_format->fmt.pix.colorspace = V4L2_COLORSPACE_JPEG; - + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_OUTPUT); ioctl(-1, VIDIOC_S_FMT, p_format); - printf("ioctl(-1, VIDIOC_S_FMT, {type=V4L2_BUF_TYPE_VIDEO_OUTPUT" - ", fmt.pix={width=%u, height=%u, pixelformat=" - "v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')" - ", field=V4L2_FIELD_NONE, bytesperline=%u, sizeimage=%u" - ", colorspace=V4L2_COLORSPACE_JPEG}}) = -1 EBADF (%m)\n", - p_format->fmt.pix.width, p_format->fmt.pix.height, - cc0(magic), cc1(magic), cc2(magic), cc3(magic), - p_format->fmt.pix.bytesperline, p_format->fmt.pix.sizeimage); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", V4L2_BUF_TYPE_VIDEO_OUTPUT); +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); + ioctl(-1, VIDIOC_S_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", + V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY); + ioctl(-1, VIDIOC_S_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", + V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY); +#endif + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_OVERLAY); + ioctl(-1, VIDIOC_S_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", + V4L2_BUF_TYPE_VIDEO_OVERLAY); + init_v4l2_format(p_format, V4L2_BUF_TYPE_VBI_CAPTURE); + ioctl(-1, VIDIOC_S_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", V4L2_BUF_TYPE_VBI_CAPTURE); +#if HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE + init_v4l2_format(p_format, V4L2_BUF_TYPE_SLICED_VBI_CAPTURE); + ioctl(-1, VIDIOC_S_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", + V4L2_BUF_TYPE_SLICED_VBI_CAPTURE); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE + init_v4l2_format(p_format, V4L2_BUF_TYPE_SDR_CAPTURE); + ioctl(-1, VIDIOC_S_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", V4L2_BUF_TYPE_SDR_CAPTURE); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT + init_v4l2_format(p_format, V4L2_BUF_TYPE_SDR_OUTPUT); + ioctl(-1, VIDIOC_S_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", V4L2_BUF_TYPE_SDR_OUTPUT); +#endif /* VIDIOC_TRY_FMT */ ioctl(-1, VIDIOC_TRY_FMT, 0); printf("ioctl(-1, VIDIOC_TRY_FMT, NULL) = -1 EBADF (%m)\n"); + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_OUTPUT); + ioctl(-1, VIDIOC_TRY_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", + V4L2_BUF_TYPE_VIDEO_OUTPUT); #if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE - memset(p_format, -1, sizeof(*p_format)); - p_format->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; - p_format->fmt.pix_mp.width = 0xdad1beaf; - p_format->fmt.pix_mp.height = 0xdad2beaf; - p_format->fmt.pix_mp.pixelformat = magic; - p_format->fmt.pix_mp.field = V4L2_FIELD_NONE; - p_format->fmt.pix_mp.colorspace = V4L2_COLORSPACE_JPEG; - unsigned int i; - for (i = 0; i < ARRAY_SIZE(p_format->fmt.pix_mp.plane_fmt); ++i) { - p_format->fmt.pix_mp.plane_fmt[i].sizeimage = 0xbadc0de0 | i; - p_format->fmt.pix_mp.plane_fmt[i].bytesperline = 0xdadbeaf0 | i; - } + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); ioctl(-1, VIDIOC_TRY_FMT, p_format); - printf("ioctl(-1, VIDIOC_TRY_FMT" - ", {type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE" - ", fmt.pix_mp={width=%u, height=%u, pixelformat=" - "v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')" - ", field=V4L2_FIELD_NONE, colorspace=V4L2_COLORSPACE_JPEG" - ", plane_fmt=[", - p_format->fmt.pix_mp.width, p_format->fmt.pix_mp.height, - cc0(magic), cc1(magic), cc2(magic), cc3(magic)); - for (i = 0; i < ARRAY_SIZE(p_format->fmt.pix_mp.plane_fmt); ++i) { - if (i) - printf(", "); - printf("{sizeimage=%u, bytesperline=%u}", - p_format->fmt.pix_mp.plane_fmt[i].sizeimage, - p_format->fmt.pix_mp.plane_fmt[i].bytesperline); - } - printf("], num_planes=%u}}) = -1 EBADF (%m)\n", - p_format->fmt.pix_mp.num_planes); -#else + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", + V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY); + ioctl(-1, VIDIOC_TRY_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", + V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY); +#endif + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_OVERLAY); + ioctl(-1, VIDIOC_TRY_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", + V4L2_BUF_TYPE_VIDEO_OVERLAY); + + init_v4l2_format(p_format, V4L2_BUF_TYPE_VBI_CAPTURE); + ioctl(-1, VIDIOC_TRY_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", V4L2_BUF_TYPE_VBI_CAPTURE); +#if HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE + init_v4l2_format(p_format, V4L2_BUF_TYPE_SLICED_VBI_CAPTURE); + ioctl(-1, VIDIOC_TRY_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", + V4L2_BUF_TYPE_SLICED_VBI_CAPTURE); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE + init_v4l2_format(p_format, V4L2_BUF_TYPE_SDR_CAPTURE); + ioctl(-1, VIDIOC_TRY_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", V4L2_BUF_TYPE_SDR_CAPTURE); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT + init_v4l2_format(p_format, V4L2_BUF_TYPE_SDR_OUTPUT); + ioctl(-1, VIDIOC_TRY_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", V4L2_BUF_TYPE_SDR_OUTPUT); +#endif struct v4l2_format *const p_v4l2_format = - page + size - sizeof(*p_v4l2_format); + page_end - sizeof(*p_v4l2_format); ioctl(-1, VIDIOC_TRY_FMT, p_v4l2_format); printf("ioctl(-1, VIDIOC_TRY_FMT, {type=%#x /* V4L2_BUF_TYPE_??? */})" " = -1 EBADF (%m)\n", p_v4l2_format->type); -#endif /* VIDIOC_REQBUFS */ ioctl(-1, VIDIOC_REQBUFS, 0); printf("ioctl(-1, VIDIOC_REQBUFS, NULL) = -1 EBADF (%m)\n"); struct v4l2_requestbuffers *const p_v4l2_requestbuffers = - page + size - sizeof(*p_v4l2_requestbuffers); + page_end - sizeof(*p_v4l2_requestbuffers); ioctl(-1, VIDIOC_REQBUFS, p_v4l2_requestbuffers); - printf("ioctl(-1, VIDIOC_REQBUFS, {count=%u, type=%#x" - " /* V4L2_BUF_TYPE_??? */, memory=%#x /* V4L2_MEMORY_??? */})" + printf("ioctl(-1, VIDIOC_REQBUFS, {type=%#x /* V4L2_BUF_TYPE_??? */, " + "memory=%#x /* V4L2_MEMORY_??? */, count=%u})" " = -1 EBADF (%m)\n", - p_v4l2_requestbuffers->count, p_v4l2_requestbuffers->type, - p_v4l2_requestbuffers->memory); + p_v4l2_requestbuffers->memory, + p_v4l2_requestbuffers->count); /* VIDIOC_QUERYBUF */ ioctl(-1, VIDIOC_QUERYBUF, 0); printf("ioctl(-1, VIDIOC_QUERYBUF, NULL) = -1 EBADF (%m)\n"); struct v4l2_buffer *const p_v4l2_buffer = - page + size - sizeof(*p_v4l2_buffer); + page_end - sizeof(*p_v4l2_buffer); ioctl(-1, VIDIOC_QUERYBUF, p_v4l2_buffer); printf("ioctl(-1, VIDIOC_QUERYBUF, {type=%#x /* V4L2_BUF_TYPE_??? */" ", index=%u}) = -1 EBADF (%m)\n", @@ -216,7 +583,7 @@ main(void ) printf("ioctl(-1, VIDIOC_S_FBUF, NULL) = -1 EBADF (%m)\n"); struct v4l2_framebuffer *const p_v4l2_framebuffer = - page + size - sizeof(*p_v4l2_framebuffer); + page_end - sizeof(*p_v4l2_framebuffer); ioctl(-1, VIDIOC_S_FBUF, p_v4l2_framebuffer); printf("ioctl(-1, VIDIOC_S_FBUF, {capability=%#x" ", flags=%#x, base=%p}) = -1 EBADF (%m)\n", @@ -228,7 +595,7 @@ main(void ) ioctl(-1, VIDIOC_STREAMON, 0); printf("ioctl(-1, VIDIOC_STREAMON, NULL) = -1 EBADF (%m)\n"); - int *const p_int = page + size - sizeof(int); + int *const p_int = page_end - sizeof(int); ioctl(-1, VIDIOC_STREAMON, p_int); printf("ioctl(-1, VIDIOC_STREAMON, [%#x /* V4L2_BUF_TYPE_??? */])" " = -1 EBADF (%m)\n", *p_int); @@ -246,7 +613,7 @@ main(void ) printf("ioctl(-1, VIDIOC_G_PARM, NULL) = -1 EBADF (%m)\n"); struct v4l2_streamparm *const p_v4l2_streamparm = - page + size - sizeof(*p_v4l2_streamparm); + page_end - sizeof(*p_v4l2_streamparm); ioctl(-1, VIDIOC_G_PARM, p_v4l2_streamparm); printf("ioctl(-1, VIDIOC_G_PARM, {type=%#x /* V4L2_BUF_TYPE_??? */})" " = -1 EBADF (%m)\n", p_v4l2_streamparm->type); @@ -259,8 +626,7 @@ main(void ) printf("ioctl(-1, VIDIOC_S_PARM, {type=%#x /* V4L2_BUF_TYPE_??? */})" " = -1 EBADF (%m)\n", p_v4l2_streamparm->type); - struct v4l2_streamparm *const p_streamparm = - tail_alloc(sizeof(*p_streamparm)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_streamparm, p_streamparm); p_streamparm->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; p_streamparm->parm.capture.capability = V4L2_CAP_TIMEPERFRAME; p_streamparm->parm.capture.capturemode = V4L2_MODE_HIGHQUALITY; @@ -295,7 +661,7 @@ main(void ) ioctl(-1, VIDIOC_S_STD, 0); printf("ioctl(-1, VIDIOC_S_STD, NULL) = -1 EBADF (%m)\n"); - long long *const p_longlong = page + size - sizeof(*p_longlong); + long long *const p_longlong = page_end - sizeof(*p_longlong); ioctl(-1, VIDIOC_S_STD, p_longlong); printf("ioctl(-1, VIDIOC_S_STD, [%#llx]) = -1 EBADF (%m)\n", *p_longlong); @@ -305,7 +671,7 @@ main(void ) printf("ioctl(-1, VIDIOC_ENUMSTD, NULL) = -1 EBADF (%m)\n"); struct v4l2_standard *const p_v4l2_standard = - page + size - sizeof(*p_v4l2_standard); + page_end - sizeof(*p_v4l2_standard); ioctl(-1, VIDIOC_ENUMSTD, p_v4l2_standard); printf("ioctl(-1, VIDIOC_ENUMSTD, {index=%u}) = -1 EBADF (%m)\n", p_v4l2_standard->index); @@ -315,7 +681,7 @@ main(void ) printf("ioctl(-1, VIDIOC_ENUMINPUT, NULL) = -1 EBADF (%m)\n"); struct v4l2_input *const p_v4l2_input = - page + size - sizeof(*p_v4l2_input); + page_end - sizeof(*p_v4l2_input); ioctl(-1, VIDIOC_ENUMINPUT, p_v4l2_input); printf("ioctl(-1, VIDIOC_ENUMINPUT, {index=%u}) = -1 EBADF (%m)\n", p_v4l2_input->index); @@ -325,7 +691,7 @@ main(void ) printf("ioctl(-1, VIDIOC_G_CTRL, NULL) = -1 EBADF (%m)\n"); struct v4l2_control *const p_v4l2_control = - page + size - sizeof(*p_v4l2_control); + page_end - sizeof(*p_v4l2_control); ioctl(-1, VIDIOC_G_CTRL, p_v4l2_control); printf("ioctl(-1, VIDIOC_G_CTRL, {id=%#x /* V4L2_CID_??? */})" " = -1 EBADF (%m)\n", p_v4l2_control->id); @@ -339,24 +705,59 @@ main(void ) ", value=%d}) = -1 EBADF (%m)\n", p_v4l2_control->id, p_v4l2_control->value); + /* VIDIOC_G_TUNER */ + ioctl(-1, VIDIOC_G_TUNER, 0); + printf("ioctl(-1, VIDIOC_G_TUNER, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_tuner *const p_v4l2_tuner = + page_end - sizeof(*p_v4l2_tuner); + ioctl(-1, VIDIOC_G_TUNER, p_v4l2_tuner); + printf("ioctl(-1, VIDIOC_G_TUNER, {index=%u})" + " = -1 EBADF (%m)\n", p_v4l2_tuner->index); + + /* VIDIOC_S_TUNER */ + ioctl(-1, VIDIOC_S_TUNER, 0); + printf("ioctl(-1, VIDIOC_S_TUNER, NULL) = -1 EBADF (%m)\n"); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_tuner, p_tuner); + p_tuner->index = 0x4fb6df39; + strcpy((char *) p_tuner->name, "cum tacent clamant"); + p_tuner->type = V4L2_TUNER_RADIO; + p_tuner->capability = V4L2_TUNER_CAP_LOW; + p_tuner->rangelow = 0xa673bc29; + p_tuner->rangehigh = 0xbaf16d12; + p_tuner->rxsubchans = V4L2_TUNER_SUB_MONO; + p_tuner->audmode = V4L2_TUNER_MODE_MONO; + p_tuner->signal = 0x10bf92c8; + p_tuner->afc = 0x3bf7e18b; + ioctl(-1, VIDIOC_S_TUNER, p_tuner); + printf("ioctl(-1, VIDIOC_S_TUNER, {index=%u" + ", name=\"cum tacent clamant\"" + ", type=V4L2_TUNER_RADIO, capability=V4L2_TUNER_CAP_LOW" + ", rangelow=%u, rangehigh=%u" + ", rxsubchans=V4L2_TUNER_SUB_MONO" + ", audmode=V4L2_TUNER_MODE_MONO, signal=%d, afc=%d" + "}) = -1 EBADF (%m)\n", + p_tuner->index, p_tuner->rangelow, + p_tuner->rangehigh, p_tuner->signal, p_tuner->afc); + /* VIDIOC_QUERYCTRL */ ioctl(-1, VIDIOC_QUERYCTRL, 0); printf("ioctl(-1, VIDIOC_QUERYCTRL, NULL) = -1 EBADF (%m)\n"); struct v4l2_queryctrl *const p_v4l2_queryctrl = - page + size - sizeof(*p_v4l2_queryctrl); + page_end - sizeof(*p_v4l2_queryctrl); ioctl(-1, VIDIOC_QUERYCTRL, p_v4l2_queryctrl); -# ifdef V4L2_CTRL_FLAG_NEXT_CTRL +#ifdef V4L2_CTRL_FLAG_NEXT_CTRL printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=V4L2_CTRL_FLAG_NEXT_CTRL" "|%#x /* V4L2_CID_??? */}) = -1 EBADF (%m)\n", p_v4l2_queryctrl->id & ~V4L2_CTRL_FLAG_NEXT_CTRL); -# else +#else printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=%#x /* V4L2_CID_??? */})" " = -1 EBADF (%m)\n", p_v4l2_queryctrl->id); -# endif +#endif - struct v4l2_queryctrl *const p_queryctrl = - tail_alloc(sizeof(*p_queryctrl)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_queryctrl, p_queryctrl); p_queryctrl->id = V4L2_CID_SATURATION; ioctl(-1, VIDIOC_QUERYCTRL, p_queryctrl); printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=V4L2_CID_SATURATION})" @@ -381,7 +782,7 @@ main(void ) printf("ioctl(-1, VIDIOC_CROPCAP, NULL) = -1 EBADF (%m)\n"); struct v4l2_cropcap *const p_v4l2_cropcap = - page + size - sizeof(*p_v4l2_cropcap); + page_end - sizeof(*p_v4l2_cropcap); ioctl(-1, VIDIOC_CROPCAP, p_v4l2_cropcap); printf("ioctl(-1, VIDIOC_CROPCAP, {type=%#x /* V4L2_BUF_TYPE_??? */})" " = -1 EBADF (%m)\n", p_v4l2_cropcap->type); @@ -391,7 +792,7 @@ main(void ) printf("ioctl(-1, VIDIOC_G_CROP, NULL) = -1 EBADF (%m)\n"); struct v4l2_crop *const p_v4l2_crop = - page + size - sizeof(*p_v4l2_crop); + page_end - sizeof(*p_v4l2_crop); ioctl(-1, VIDIOC_G_CROP, p_v4l2_crop); printf("ioctl(-1, VIDIOC_G_CROP, {type=%#x /* V4L2_BUF_TYPE_??? */})" " = -1 EBADF (%m)\n", p_v4l2_crop->type); @@ -414,8 +815,7 @@ main(void ) ioctl(-1, VIDIOC_S_EXT_CTRLS, 0); printf("ioctl(-1, VIDIOC_S_EXT_CTRLS, NULL) = -1 EBADF (%m)\n"); - struct v4l2_ext_controls *const p_ext_controls = - tail_alloc(sizeof(*p_ext_controls)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_ext_controls, p_ext_controls); p_ext_controls->ctrl_class = V4L2_CTRL_CLASS_USER; p_ext_controls->count = 0; p_ext_controls->controls = (void *) -2UL; @@ -423,6 +823,21 @@ main(void ) printf("ioctl(-1, VIDIOC_S_EXT_CTRLS, {ctrl_class=V4L2_CTRL_CLASS_USER" ", count=%u}) = -1 EBADF (%m)\n", p_ext_controls->count); + p_ext_controls->ctrl_class = 0x00a30000; + p_ext_controls->count = magic; + ioctl(-1, VIDIOC_S_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_S_EXT_CTRLS, {ctrl_class=V4L2_CTRL_CLASS_DETECT" + ", count=%u, controls=%p}) = -1 EBADF (%m)\n", + p_ext_controls->count, p_ext_controls->controls); + + p_ext_controls->ctrl_class = 0x00a40000; + p_ext_controls->count = magic; + ioctl(-1, VIDIOC_S_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_S_EXT_CTRLS" + ", {ctrl_class=0xa40000 /* V4L2_CTRL_CLASS_??? */" + ", count=%u, controls=%p}) = -1 EBADF (%m)\n", + p_ext_controls->count, p_ext_controls->controls); + p_ext_controls->ctrl_class = V4L2_CTRL_CLASS_MPEG; p_ext_controls->count = magic; ioctl(-1, VIDIOC_S_EXT_CTRLS, p_ext_controls); @@ -464,7 +879,7 @@ main(void ) ", {ctrl_class=V4L2_CTRL_CLASS_MPEG, count=%u, controls=" "[{id=V4L2_CID_BRIGHTNESS, size=0, value=%d, value64=%lld}" ", {id=V4L2_CID_CONTRAST, size=2, string=\"\\377\\377\"}" - ", %p]}) = -1 EBADF (%m)\n", + ", ... /* %p */]}) = -1 EBADF (%m)\n", p_ext_controls->count, p_ext_controls->controls[0].value, (long long) p_ext_controls->controls[0].value64, @@ -500,8 +915,7 @@ main(void ) ioctl(-1, VIDIOC_ENUM_FRAMESIZES, 0); printf("ioctl(-1, VIDIOC_ENUM_FRAMESIZES, NULL) = -1 EBADF (%m)\n"); - struct v4l2_frmsizeenum *const p_frmsizeenum = - tail_alloc(sizeof(*p_frmsizeenum)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_frmsizeenum, p_frmsizeenum); p_frmsizeenum->index = magic; p_frmsizeenum->pixel_format = fourcc(cc[0], cc[1], cc[2], cc[3]); @@ -517,7 +931,7 @@ main(void ) printf("ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, NULL) = -1 EBADF (%m)\n"); struct v4l2_frmivalenum *const p_v4l2_frmivalenum = - page + size - sizeof(*p_v4l2_frmivalenum); + page_end - sizeof(*p_v4l2_frmivalenum); ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, p_v4l2_frmivalenum); printf("ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, {index=%u" ", pixel_format=v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')" @@ -536,7 +950,7 @@ main(void ) printf("ioctl(-1, VIDIOC_CREATE_BUFS, NULL) = -1 EBADF (%m)\n"); struct v4l2_create_buffers *const p_v4l2_create_buffers = - page + size - sizeof(*p_v4l2_create_buffers); + page_end - sizeof(*p_v4l2_create_buffers); ioctl(-1, VIDIOC_CREATE_BUFS, p_v4l2_create_buffers); printf("ioctl(-1, VIDIOC_CREATE_BUFS, {count=%u, memory=%#x" " /* V4L2_MEMORY_??? */, format={type=%#x" diff --git a/tests-mx32/ioctl_v4l2.gen.test b/tests-mx32/ioctl_v4l2.gen.test new file mode 100755 index 00000000..4c571447 --- /dev/null +++ b/tests-mx32/ioctl_v4l2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_v4l2 +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioctl_v4l2.test b/tests-mx32/ioctl_v4l2.test deleted file mode 100755 index a092a3cd..00000000 --- a/tests-mx32/ioctl_v4l2.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check basic VIDIOC_* ioctl decoding. - -. "${srcdir=.}/ioctl.test" diff --git a/tests-mx32/ioperm.c b/tests-mx32/ioperm.c index 2f02b523..3f99b2db 100644 --- a/tests-mx32/ioperm.c +++ b/tests-mx32/ioperm.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/ioperm.gen.test b/tests-mx32/ioperm.gen.test new file mode 100755 index 00000000..bc69f69e --- /dev/null +++ b/tests-mx32/ioperm.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioperm -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-mx32/ioperm.test b/tests-mx32/ioperm.test deleted file mode 100755 index 8c1c1cc7..00000000 --- a/tests-mx32/ioperm.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check ioperm syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests-mx32/iopl.c b/tests-mx32/iopl.c index 14ec29e3..f8904030 100644 --- a/tests-mx32/iopl.c +++ b/tests-mx32/iopl.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/iopl.gen.test b/tests-mx32/iopl.gen.test new file mode 100755 index 00000000..f7769d23 --- /dev/null +++ b/tests-mx32/iopl.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (iopl -a8 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 diff --git a/tests-mx32/iopl.test b/tests-mx32/iopl.test deleted file mode 100755 index d0b5b113..00000000 --- a/tests-mx32/iopl.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check iopl syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a8 diff --git a/tests-mx32/ioprio-Xabbrev.c b/tests-mx32/ioprio-Xabbrev.c new file mode 100644 index 00000000..01a07f48 --- /dev/null +++ b/tests-mx32/ioprio-Xabbrev.c @@ -0,0 +1 @@ +#include "ioprio.c" diff --git a/tests-mx32/ioprio-Xabbrev.gen.test b/tests-mx32/ioprio-Xabbrev.gen.test new file mode 100755 index 00000000..156c048b --- /dev/null +++ b/tests-mx32/ioprio-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioprio-Xabbrev -a18 -e trace=ioprio_get,ioprio_set -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 -e trace=ioprio_get,ioprio_set -Xabbrev diff --git a/tests-mx32/ioprio-Xraw.c b/tests-mx32/ioprio-Xraw.c new file mode 100644 index 00000000..6a815069 --- /dev/null +++ b/tests-mx32/ioprio-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "ioprio.c" diff --git a/tests-mx32/ioprio-Xraw.gen.test b/tests-mx32/ioprio-Xraw.gen.test new file mode 100755 index 00000000..92c614e5 --- /dev/null +++ b/tests-mx32/ioprio-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioprio-Xraw -a18 -e trace=ioprio_get,ioprio_set -Xraw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 -e trace=ioprio_get,ioprio_set -Xraw diff --git a/tests-mx32/ioprio-Xverbose.c b/tests-mx32/ioprio-Xverbose.c new file mode 100644 index 00000000..3c12bb6c --- /dev/null +++ b/tests-mx32/ioprio-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "ioprio.c" diff --git a/tests-mx32/ioprio-Xverbose.gen.test b/tests-mx32/ioprio-Xverbose.gen.test new file mode 100755 index 00000000..97e6154b --- /dev/null +++ b/tests-mx32/ioprio-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioprio-Xverbose -a18 -e trace=ioprio_get,ioprio_set -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 -e trace=ioprio_get,ioprio_set -Xverbose diff --git a/tests-mx32/ioprio.c b/tests-mx32/ioprio.c index 44ace6c3..65775963 100644 --- a/tests-mx32/ioprio.c +++ b/tests-mx32/ioprio.c @@ -2,29 +2,10 @@ * Check decoding of ioprio_get and ioprio_set syscalls. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -46,14 +27,6 @@ enum { # include "xlat.h" # include "xlat/ioprio_class.h" -void -print_ioprio(unsigned long val) -{ - printf(" (IOPRIO_PRIO_VALUE("); - printxval(ioprio_class, val >> 13, "IOPRIO_CLASS_???"); - printf(", %d))", (int) (val & 0x1fff)); -} - int main(void) { @@ -63,32 +36,78 @@ main(void) (kernel_ulong_t) 0xbadc0dedda7a1057ULL; static const kernel_ulong_t bogus_ioprio = (kernel_ulong_t) 0xdec0ded1facefeedULL; +# if !XLAT_RAW static const char * const bogus_ioprio_str = "IOPRIO_PRIO_VALUE(0x7d677 /* IOPRIO_CLASS_??? */, 7917)"; +# endif long rc; + const char *errstr; rc = syscall(__NR_ioprio_get, bogus_which, bogus_who); + errstr = sprintrc(rc); +# if XLAT_RAW + printf("ioprio_get(%#x, %d) = %s\n", + (int) bogus_which, (int) bogus_who, errstr); +# else /* XLAT_ABBREV || XLAT_VERBOSE */ printf("ioprio_get(%#x /* IOPRIO_WHO_??? */, %d) = %s\n", - (int) bogus_which, (int) bogus_who, sprintrc(rc)); + (int) bogus_which, (int) bogus_who, errstr); +# endif rc = syscall(__NR_ioprio_get, 1, 0); - printf("ioprio_get(IOPRIO_WHO_PROCESS, 0) = %s", sprintrc(rc)); - - if (rc >= -1) - print_ioprio(rc); - + errstr = sprintrc(rc); +# if XLAT_RAW + printf("ioprio_get(0x1, 0) = %s\n", errstr); +# elif XLAT_VERBOSE + printf("ioprio_get(0x1 /* IOPRIO_WHO_PROCESS */, 0) = %s", errstr); + if (rc >= 0) { + printf(" (IOPRIO_PRIO_VALUE(%u /* ", (unsigned int) rc >> 13); + printxval(ioprio_class, (unsigned int) rc >> 13, + "IOPRIO_CLASS_???"); + printf(" */, %u))", (unsigned int) rc & 0x1fff); + } + puts(""); +# else /* XLAT_ABBREV */ + printf("ioprio_get(IOPRIO_WHO_PROCESS, 0) = %s", errstr); + if (rc >= 0) { + printf(" (IOPRIO_PRIO_VALUE("); + printxval(ioprio_class, (unsigned int) rc >> 13, + "IOPRIO_CLASS_???"); + printf(", %u))", (unsigned int) rc & 0x1fff); + } puts(""); +# endif rc = syscall(__NR_ioprio_set, 2, 0, 8191); - printf("ioprio_set(IOPRIO_WHO_PGRP, 0, " - "IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 8191)) = %s\n", - sprintrc(rc)); + errstr = sprintrc(rc); +# if XLAT_RAW + printf("ioprio_set(%#x, 0, 8191) = %s\n", 2, errstr); +# elif XLAT_VERBOSE + printf("ioprio_set(%#x /* IOPRIO_WHO_PGRP */, 0, 8191" + " /* IOPRIO_PRIO_VALUE(0 /* IOPRIO_CLASS_NONE */, 8191) */)" + " = %s\n", + 2, errstr); +# else /* XLAT_ABBREV */ + printf("ioprio_set(IOPRIO_WHO_PGRP, 0" + ", IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 8191)) = %s\n", + errstr); +# endif rc = syscall(__NR_ioprio_set, bogus_which, bogus_who, bogus_ioprio); + errstr = sprintrc(rc); +# if XLAT_RAW + printf("ioprio_set(%#x, %d, %d) = %s\n", + (int) bogus_which, (int) bogus_who, (int) bogus_ioprio, + errstr); +# elif XLAT_VERBOSE + printf("ioprio_set(%#x /* IOPRIO_WHO_??? */, %d, %d /* %s */) = %s\n", + (int) bogus_which, (int) bogus_who, (int) bogus_ioprio, + bogus_ioprio_str, errstr); +# else /* XLAT_ABBREV */ printf("ioprio_set(%#x /* IOPRIO_WHO_??? */, %d, %s) = %s\n", (int) bogus_which, (int) bogus_who, bogus_ioprio_str, - sprintrc(rc)); + errstr); +# endif puts("+++ exited with 0 +++"); diff --git a/tests-mx32/ioprio.gen.test b/tests-mx32/ioprio.gen.test new file mode 100755 index 00000000..f43f78ed --- /dev/null +++ b/tests-mx32/ioprio.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioprio -a18 -e trace=ioprio_get,ioprio_set); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 -e trace=ioprio_get,ioprio_set diff --git a/tests-mx32/ioprio.test b/tests-mx32/ioprio.test deleted file mode 100755 index e79310b3..00000000 --- a/tests-mx32/ioprio.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check iprio_get and iprio_set syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a18 -e trace=ioprio_get,ioprio_set diff --git a/tests-mx32/ip_mreq.c b/tests-mx32/ip_mreq.c index fa0c504b..4744bd38 100644 --- a/tests-mx32/ip_mreq.c +++ b/tests-mx32/ip_mreq.c @@ -1,51 +1,33 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include #if defined IP_ADD_MEMBERSHIP && defined IPV6_ADD_MEMBERSHIP \ - && defined IPV6_JOIN_ANYCAST && defined HAVE_IF_INDEXTONAME + && defined IPV6_JOIN_ANYCAST +# include # include # include # include # include # include +# define multi4addr "224.0.0.3" +# define multi6addr "ff01::c" +# define interface "127.0.0.1" + int main(void) { - static const char multi4addr[] = "224.0.0.3"; - static const char multi6addr[] = "ff01::c"; - static const char interface[] = "127.0.0.1"; - - struct ip_mreq *const m4 = tail_alloc(sizeof(*m4)); - struct ipv6_mreq *const m6 = tail_alloc(sizeof(*m6)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct ip_mreq, m4); + TAIL_ALLOC_OBJECT_CONST_PTR(struct ipv6_mreq, m6); unsigned int i; int rc; @@ -53,7 +35,7 @@ main(void) inet_pton(AF_INET, interface, &m4->imr_interface); inet_pton(AF_INET6, multi6addr, &m6->ipv6mr_multiaddr); - m6->ipv6mr_interface = if_nametoindex("lo"); + m6->ipv6mr_interface = ifindex_lo(); if (!m6->ipv6mr_interface) perror_msg_and_skip("lo"); @@ -62,87 +44,91 @@ main(void) perror_msg_and_skip("socket"); struct { - int level; - const char *str_level; - int optname; - const char *str_optname; - void *optval; - unsigned int optsize; - } short_any[] = { + const int level; + const char *const str_level; + const int name; + const char *str_name; + const void *const val; + unsigned int size; + const char *const addr; + } opts[] = { { ARG_STR(SOL_IP), ARG_STR(IP_ADD_MEMBERSHIP), - m4, sizeof(*m4) + m4, sizeof(*m4), + "{imr_multiaddr=inet_addr(\"" multi4addr + "\"), imr_interface=inet_addr(\"" interface "\")}" }, { ARG_STR(SOL_IP), ARG_STR(IP_DROP_MEMBERSHIP), - m4, sizeof(*m4) + m4, sizeof(*m4), + "{imr_multiaddr=inet_addr(\"" multi4addr + "\"), imr_interface=inet_addr(\"" interface "\")}" }, { ARG_STR(SOL_IPV6), ARG_STR(IPV6_ADD_MEMBERSHIP), - m6, sizeof(*m6) + m6, sizeof(*m6), + "{inet_pton(AF_INET6, \"" multi6addr + "\", &ipv6mr_multiaddr)" + ", ipv6mr_interface=" IFINDEX_LO_STR "}" }, { ARG_STR(SOL_IPV6), ARG_STR(IPV6_DROP_MEMBERSHIP), - m6, sizeof(*m6) + m6, sizeof(*m6), + "{inet_pton(AF_INET6, \"" multi6addr + "\", &ipv6mr_multiaddr)" + ", ipv6mr_interface=" IFINDEX_LO_STR "}" }, { ARG_STR(SOL_IPV6), ARG_STR(IPV6_JOIN_ANYCAST), - m6, sizeof(*m6) + m6, sizeof(*m6), + "{inet_pton(AF_INET6, \"" multi6addr + "\", &ipv6mr_multiaddr)" + ", ipv6mr_interface=" IFINDEX_LO_STR "}" }, { ARG_STR(SOL_IPV6), ARG_STR(IPV6_LEAVE_ANYCAST), - m6, sizeof(*m6) + m6, sizeof(*m6), + "{inet_pton(AF_INET6, \"" multi6addr + "\", &ipv6mr_multiaddr)" + ", ipv6mr_interface=" IFINDEX_LO_STR "}" } }; - for (i = 0; i < ARRAY_SIZE(short_any); ++i) { - rc = setsockopt(0, short_any[i].level, short_any[i].optname, - short_any[i].optval, 1); - printf("setsockopt(0, %s, %s, \"\\%hho\", 1) = %s\n", - short_any[i].str_level, short_any[i].str_optname, - * (unsigned char *) short_any[i].optval, - sprintrc(rc)); - - rc = setsockopt(0, short_any[i].level, short_any[i].optname, - short_any[i].optval + 1, short_any[i].optsize); + for (i = 0; i < ARRAY_SIZE(opts); ++i) { + /* optlen < 0, EINVAL */ + rc = setsockopt(0, opts[i].level, opts[i].name, + opts[i].val, -1); + printf("setsockopt(0, %s, %s, %p, -1) = %s\n", + opts[i].str_level, opts[i].str_name, + opts[i].val, sprintrc(rc)); + + /* optlen < sizeof(struct), EINVAL */ + rc = setsockopt(0, opts[i].level, opts[i].name, + opts[i].val, opts[i].size - 1); printf("setsockopt(0, %s, %s, %p, %u) = %s\n", - short_any[i].str_level, short_any[i].str_optname, - short_any[i].optval + 1, short_any[i].optsize, - sprintrc(rc)); - } + opts[i].str_level, opts[i].str_name, + opts[i].val, opts[i].size - 1, sprintrc(rc)); - struct { - int optname; - const char *str_optname; - } long_ip[] = { - { ARG_STR(IP_ADD_MEMBERSHIP) }, - { ARG_STR(IP_DROP_MEMBERSHIP) } - }, long_ipv6[] = { - { ARG_STR(IPV6_ADD_MEMBERSHIP) }, - { ARG_STR(IPV6_DROP_MEMBERSHIP) }, - { ARG_STR(IPV6_JOIN_ANYCAST) }, - { ARG_STR(IPV6_LEAVE_ANYCAST) } - }; - - for (i = 0; i < ARRAY_SIZE(long_ip); ++i) { - rc = setsockopt(0, SOL_IP, long_ip[i].optname, - m4, sizeof(*m4)); - printf("setsockopt(0, SOL_IP, %s" - ", {imr_multiaddr=inet_addr(\"%s\")" - ", imr_interface=inet_addr(\"%s\")}, %u) = %s\n", - long_ip[i].str_optname, multi4addr, - interface, (unsigned) sizeof(*m4), sprintrc(rc)); - } - - for (i = 0; i < ARRAY_SIZE(long_ipv6); ++i) { - rc = setsockopt(0, SOL_IPV6, long_ipv6[i].optname, - m6, sizeof(*m6)); - printf("setsockopt(0, SOL_IPV6, %s" - ", {ipv6mr_multiaddr=inet_pton(\"%s\")" - ", ipv6mr_interface=if_nametoindex(\"lo\")}" - ", %u) = %s\n", - long_ipv6[i].str_optname, multi6addr, - (unsigned) sizeof(*m6), sprintrc(rc)); + /* optval EFAULT */ + rc = setsockopt(0, opts[i].level, opts[i].name, + opts[i].val + 1, opts[i].size); + printf("setsockopt(0, %s, %s, %p, %u) = %s\n", + opts[i].str_level, opts[i].str_name, + opts[i].val + 1, opts[i].size, sprintrc(rc)); + + /* classic */ + rc = setsockopt(0, opts[i].level, opts[i].name, + opts[i].val, opts[i].size); + printf("setsockopt(0, %s, %s, %s, %u) = %s\n", + opts[i].str_level, opts[i].str_name, + opts[i].addr, opts[i].size, sprintrc(rc)); + + /* optlen > sizeof(struct), shortened */ + rc = setsockopt(0, opts[i].level, opts[i].name, + opts[i].val, INT_MAX); + printf("setsockopt(0, %s, %s, %s, %u) = %s\n", + opts[i].str_level, opts[i].str_name, + opts[i].addr, INT_MAX, sprintrc(rc)); } puts("+++ exited with 0 +++"); @@ -152,6 +138,6 @@ main(void) #else SKIP_MAIN_UNDEFINED("IP_ADD_MEMBERSHIP && IPV6_ADD_MEMBERSHIP" - " && IPV6_JOIN_ANYCAST && HAVE_IF_INDEXTONAME") + " && IPV6_JOIN_ANYCAST") #endif diff --git a/tests-mx32/ip_mreq.gen.test b/tests-mx32/ip_mreq.gen.test new file mode 100755 index 00000000..990387a6 --- /dev/null +++ b/tests-mx32/ip_mreq.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ip_mreq -e trace=setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt diff --git a/tests-mx32/ip_mreq.test b/tests-mx32/ip_mreq.test deleted file mode 100755 index d0a9e0f1..00000000 --- a/tests-mx32/ip_mreq.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check {IP,IPV6}_{ADD,DROP}_MEMBERSHIP setsockopt decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=setsockopt diff --git a/tests-mx32/ipc.c b/tests-mx32/ipc.c index c64d3716..5c86f207 100644 --- a/tests-mx32/ipc.c +++ b/tests-mx32/ipc.c @@ -1,30 +1,10 @@ /* * Check decoding of ipc syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/ipc.gen.test b/tests-mx32/ipc.gen.test new file mode 100755 index 00000000..0aa75789 --- /dev/null +++ b/tests-mx32/ipc.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc -a19 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests-mx32/ipc.sh b/tests-mx32/ipc.sh index 752d4bb2..58e4309b 100644 --- a/tests-mx32/ipc.sh +++ b/tests-mx32/ipc.sh @@ -1,13 +1,16 @@ #!/bin/sh - +# # Check decoding of ipc syscalls +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog > /dev/null -run_strace -eipc $args > "$OUT" -match_grep "$LOG" "$OUT" - -rm -f "$OUT" +run_strace -eipc "$@" $args > "$EXP" +match_grep "$LOG" "$EXP" exit 0 diff --git a/tests-mx32/ipc.test b/tests-mx32/ipc.test deleted file mode 100755 index aa33fa61..00000000 --- a/tests-mx32/ipc.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of ipc syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a19 diff --git a/tests-mx32/ipc_msg-Xabbrev.c b/tests-mx32/ipc_msg-Xabbrev.c new file mode 100644 index 00000000..f4535e8b --- /dev/null +++ b/tests-mx32/ipc_msg-Xabbrev.c @@ -0,0 +1 @@ +#include "ipc_msg.c" diff --git a/tests-mx32/ipc_msg-Xabbrev.gen.test b/tests-mx32/ipc_msg-Xabbrev.gen.test new file mode 100755 index 00000000..0969ee1e --- /dev/null +++ b/tests-mx32/ipc_msg-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_msg-Xabbrev +ipc.sh -Xabbrev -a26); do not edit. +set -- -Xabbrev -a26 +. "${srcdir=.}/ipc.sh" diff --git a/tests-mx32/ipc_msg-Xraw.c b/tests-mx32/ipc_msg-Xraw.c new file mode 100644 index 00000000..9c016d30 --- /dev/null +++ b/tests-mx32/ipc_msg-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "ipc_msg.c" diff --git a/tests-mx32/ipc_msg-Xraw.gen.test b/tests-mx32/ipc_msg-Xraw.gen.test new file mode 100755 index 00000000..5d5d7322 --- /dev/null +++ b/tests-mx32/ipc_msg-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_msg-Xraw +ipc.sh -Xraw -a16); do not edit. +set -- -Xraw -a16 +. "${srcdir=.}/ipc.sh" diff --git a/tests-mx32/ipc_msg-Xverbose.c b/tests-mx32/ipc_msg-Xverbose.c new file mode 100644 index 00000000..3f59f984 --- /dev/null +++ b/tests-mx32/ipc_msg-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "ipc_msg.c" diff --git a/tests-mx32/ipc_msg-Xverbose.gen.test b/tests-mx32/ipc_msg-Xverbose.gen.test new file mode 100755 index 00000000..88c79a00 --- /dev/null +++ b/tests-mx32/ipc_msg-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_msg-Xverbose +ipc.sh -Xverbose -a34); do not edit. +set -- -Xverbose -a34 +. "${srcdir=.}/ipc.sh" diff --git a/tests-mx32/ipc_msg.c b/tests-mx32/ipc_msg.c index b4938439..b12f4af3 100644 --- a/tests-mx32/ipc_msg.c +++ b/tests-mx32/ipc_msg.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2015 Elvira Khabirova * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -35,6 +16,10 @@ #include "xlat.h" #include "xlat/resource_flags.h" +#ifndef MSG_STAT_ANY +# define MSG_STAT_ANY 13 +#endif + /* * Before glibc-2.22-122-gbe48165, ppc64 code tried to retrieve data * provided in third argument of msgctl call (in case of IPC_SET cmd) @@ -52,13 +37,50 @@ # define TEST_MSGCTL_BOGUS_ADDR 1 #endif +#if XLAT_RAW +# define str_ipc_excl_nowait "0xface1c00" +# define str_ipc_private "0" +# define str_ipc_rmid "0" +# define str_ipc_set "0x1" +# define str_ipc_stat "0x2" +# define str_msg_stat "0xb" +# define str_msg_info "0xc" +# define str_msg_stat_any "0xd" +# define str_ipc_64 "0x100" +# define str_bogus_cmd "0xdeadbeef" +#elif XLAT_VERBOSE +# define str_ipc_excl_nowait \ + "0xface1c00 /\\* IPC_EXCL\\|IPC_NOWAIT\\|0xface1000 \\*/" +# define str_ipc_private "0 /\\* IPC_PRIVATE \\*/" +# define str_ipc_rmid "0 /\\* IPC_RMID \\*/" +# define str_ipc_set "0x1 /\\* IPC_SET \\*/" +# define str_ipc_stat "0x2 /\\* IPC_STAT \\*/" +# define str_msg_stat "0xb /\\* MSG_STAT \\*/" +# define str_msg_info "0xc /\\* MSG_INFO \\*/" +# define str_msg_stat_any "0xd /\\* MSG_STAT_ANY \\*/" +# define str_ipc_64 "0x100 /\\* IPC_64 \\*/" +# define str_bogus_cmd "0xdeadbeef /\\* MSG_\\?\\?\\? \\*/" +#else +# define str_ipc_excl_nowait "IPC_EXCL\\|IPC_NOWAIT\\|0xface1000" +# define str_ipc_private "IPC_PRIVATE" +# define str_ipc_rmid "IPC_RMID" +# define str_ipc_set "IPC_SET" +# define str_ipc_stat "IPC_STAT" +# define str_msg_stat "MSG_STAT" +# define str_msg_info "MSG_INFO" +# define str_msg_stat_any "MSG_STAT_ANY" +# define str_ipc_64 "IPC_64" +# define str_bogus_cmd "0xdeadbeef /\\* MSG_\\?\\?\\? \\*/" +#endif + static int id = -1; static void cleanup(void) { msgctl(id, IPC_RMID, NULL); - printf("msgctl\\(%d, (IPC_64\\|)?IPC_RMID, NULL\\) += 0\n", id); + printf("msgctl\\(%d, (%s\\|)?%s, NULL\\) += 0\n", + id, str_ipc_64, str_ipc_rmid); id = -1; } @@ -67,7 +89,7 @@ main(void) { static const key_t private_key = (key_t) (0xffffffff00000000ULL | IPC_PRIVATE); - static const key_t bogus_key = (key_t) 0xeca86420fdb97531ULL; + static const key_t bogus_key = (key_t) 0xeca86420fdb9f531ULL; static const int bogus_msgid = 0xfdb97531; static const int bogus_cmd = 0xdeadbeef; #if TEST_MSGCTL_BOGUS_ADDR @@ -79,37 +101,36 @@ main(void) struct msqid_ds ds; rc = msgget(bogus_key, bogus_flags); - printf("msgget\\(%#llx, %s%s%s%#x\\|%#04o\\) += %s\n", + printf("msgget\\(%#llx, %s\\|%#04o\\) = %s\n", zero_extend_signed_to_ull(bogus_key), - IPC_CREAT & bogus_flags ? "IPC_CREAT\\|" : "", - IPC_EXCL & bogus_flags ? "IPC_EXCL\\|" : "", - IPC_NOWAIT & bogus_flags ? "IPC_NOWAIT\\|" : "", - bogus_flags & ~(0777 | IPC_CREAT | IPC_EXCL | IPC_NOWAIT), + str_ipc_excl_nowait, bogus_flags & 0777, sprintrc_grep(rc)); id = msgget(private_key, 0600); if (id < 0) perror_msg_and_skip("msgget"); - printf("msgget\\(IPC_PRIVATE, 0600\\) += %d\n", id); + printf("msgget\\(%s, 0600\\) = %d\n", str_ipc_private, id); atexit(cleanup); rc = msgctl(bogus_msgid, bogus_cmd, NULL); - printf("msgctl\\(%d, (IPC_64\\|)?%#x /\\* MSG_\\?\\?\\? \\*/, NULL\\)" - " += %s\n", bogus_msgid, bogus_cmd, sprintrc_grep(rc)); + printf("msgctl\\(%d, (%s\\|)?%s, NULL\\) = %s\n", + bogus_msgid, str_ipc_64, str_bogus_cmd, sprintrc_grep(rc)); #if TEST_MSGCTL_BOGUS_ADDR rc = msgctl(bogus_msgid, IPC_SET, bogus_addr); - printf("msgctl\\(%d, (IPC_64\\|)?IPC_SET, %p\\) += %s\n", - bogus_msgid, bogus_addr, sprintrc_grep(rc)); + printf("msgctl\\(%d, (%s\\|)?%s, %p\\) = %s\n", + bogus_msgid, str_ipc_64, str_ipc_set, bogus_addr, + sprintrc_grep(rc)); #endif if (msgctl(id, IPC_STAT, &ds)) perror_msg_and_skip("msgctl IPC_STAT"); - printf("msgctl\\(%d, (IPC_64\\|)?IPC_STAT, \\{msg_perm=\\{uid=%u" + printf("msgctl\\(%d, (%s\\|)?%s, \\{msg_perm=\\{uid=%u" ", gid=%u, mode=%#o, key=%u, cuid=%u, cgid=%u\\}, msg_stime=%u" ", msg_rtime=%u, msg_ctime=%u, msg_qnum=%u, msg_qbytes=%u" - ", msg_lspid=%u, msg_lrpid=%u\\}\\) += 0\n", - id, (unsigned) ds.msg_perm.uid, (unsigned) ds.msg_perm.gid, + ", msg_lspid=%u, msg_lrpid=%u\\}\\) = 0\n", + id, str_ipc_64, str_ipc_stat, + (unsigned) ds.msg_perm.uid, (unsigned) ds.msg_perm.gid, (unsigned) ds.msg_perm.mode, (unsigned) ds.msg_perm.__key, (unsigned) ds.msg_perm.cuid, (unsigned) ds.msg_perm.cgid, (unsigned) ds.msg_stime, (unsigned) ds.msg_rtime, @@ -119,18 +140,22 @@ main(void) if (msgctl(id, IPC_SET, &ds)) perror_msg_and_skip("msgctl IPC_SET"); - printf("msgctl\\(%d, (IPC_64\\|)?IPC_SET, \\{msg_perm=\\{uid=%u" - ", gid=%u, mode=%#o\\}, ...\\}\\) += 0\n", - id, (unsigned) ds.msg_perm.uid, (unsigned) ds.msg_perm.gid, - (unsigned) ds.msg_perm.mode); + printf("msgctl\\(%d, (%s\\|)?%s, \\{msg_perm=\\{uid=%u" + ", gid=%u, mode=%#o\\}, ...\\}\\) = 0\n", + id, str_ipc_64, str_ipc_set, (unsigned) ds.msg_perm.uid, + (unsigned) ds.msg_perm.gid, (unsigned) ds.msg_perm.mode); rc = msgctl(0, MSG_INFO, &ds); - printf("msgctl\\(0, (IPC_64\\|)?MSG_INFO, %p\\) += %s\n", - &ds, sprintrc_grep(rc)); + printf("msgctl\\(0, (%s\\|)?%s, %p\\) = %s\n", + str_ipc_64, str_msg_info, &ds, sprintrc_grep(rc)); rc = msgctl(id, MSG_STAT, &ds); - printf("msgctl\\(%d, (IPC_64\\|)?MSG_STAT, %p\\) += %s\n", - id, &ds, sprintrc_grep(rc)); + printf("msgctl\\(%d, (%s\\|)?%s, %p\\) = %s\n", + id, str_ipc_64, str_msg_stat, &ds, sprintrc_grep(rc)); + + rc = msgctl(id, MSG_STAT_ANY, &ds); + printf("msgctl\\(%d, (%s\\|)?%s, %p\\) = %s\n", + id, str_ipc_64, str_msg_stat_any, &ds, sprintrc_grep(rc)); return 0; } diff --git a/tests-mx32/ipc_msg.gen.test b/tests-mx32/ipc_msg.gen.test new file mode 100755 index 00000000..82026198 --- /dev/null +++ b/tests-mx32/ipc_msg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_msg +ipc.sh -a26); do not edit. +set -- -a26 +. "${srcdir=.}/ipc.sh" diff --git a/tests-mx32/ipc_msg.test b/tests-mx32/ipc_msg.test deleted file mode 100755 index 177495b0..00000000 --- a/tests-mx32/ipc_msg.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of ipc msgget/msgctl syscalls - -. "${srcdir=.}/ipc.sh" diff --git a/tests-mx32/ipc_msgbuf-Xabbrev.c b/tests-mx32/ipc_msgbuf-Xabbrev.c new file mode 100644 index 00000000..e2f09eb1 --- /dev/null +++ b/tests-mx32/ipc_msgbuf-Xabbrev.c @@ -0,0 +1 @@ +#include "ipc_msgbuf.c" diff --git a/tests-mx32/ipc_msgbuf-Xabbrev.gen.test b/tests-mx32/ipc_msgbuf-Xabbrev.gen.test new file mode 100755 index 00000000..402d804e --- /dev/null +++ b/tests-mx32/ipc_msgbuf-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_msgbuf-Xabbrev +ipc_msgbuf.test -Xabbrev); do not edit. +set -- -Xabbrev +. "${srcdir=.}/ipc_msgbuf.test" diff --git a/tests-mx32/ipc_msgbuf-Xraw.c b/tests-mx32/ipc_msgbuf-Xraw.c new file mode 100644 index 00000000..c6f8a31b --- /dev/null +++ b/tests-mx32/ipc_msgbuf-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "ipc_msgbuf.c" diff --git a/tests-mx32/ipc_msgbuf-Xraw.gen.test b/tests-mx32/ipc_msgbuf-Xraw.gen.test new file mode 100755 index 00000000..c1112cb6 --- /dev/null +++ b/tests-mx32/ipc_msgbuf-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_msgbuf-Xraw +ipc_msgbuf.test -Xraw -a22); do not edit. +set -- -Xraw -a22 +. "${srcdir=.}/ipc_msgbuf.test" diff --git a/tests-mx32/ipc_msgbuf-Xverbose.c b/tests-mx32/ipc_msgbuf-Xverbose.c new file mode 100644 index 00000000..ae09a4ad --- /dev/null +++ b/tests-mx32/ipc_msgbuf-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "ipc_msgbuf.c" diff --git a/tests-mx32/ipc_msgbuf-Xverbose.gen.test b/tests-mx32/ipc_msgbuf-Xverbose.gen.test new file mode 100755 index 00000000..2c72eb71 --- /dev/null +++ b/tests-mx32/ipc_msgbuf-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_msgbuf-Xverbose +ipc_msgbuf.test -Xverbose); do not edit. +set -- -Xverbose +. "${srcdir=.}/ipc_msgbuf.test" diff --git a/tests-mx32/ipc_msgbuf.c b/tests-mx32/ipc_msgbuf.c index 1c34494d..92525f94 100644 --- a/tests-mx32/ipc_msgbuf.c +++ b/tests-mx32/ipc_msgbuf.c @@ -1,33 +1,17 @@ /* * Copyright (c) 2015 Elvira Khabirova * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" +#include #include +#include +#include #include #include #include @@ -37,17 +21,54 @@ static int msqid = -1; -static void +#if XLAT_RAW +# define str_ipc_creat "0x200" +# define str_ipc_private "0" +# define str_ipc_rmid "0" +# define str_ipc_64 "0x100" +#elif XLAT_VERBOSE +# define str_ipc_creat "0x200 /\\* IPC_CREAT \\*/" +# define str_ipc_private "0 /\\* IPC_PRIVATE \\*/" +# define str_ipc_rmid "0 /\\* IPC_RMID \\*/" +# define str_ipc_64 "0x100 /\\* IPC_64 \\*/" +#else +# define str_ipc_creat "IPC_CREAT" +# define str_ipc_private "IPC_PRIVATE" +# define str_ipc_rmid "IPC_RMID" +# define str_ipc_64 "IPC_64" +#endif + +static int cleanup(void) { - msgctl(msqid, IPC_RMID, 0); - msqid = -1; + if (msqid != -1) { + int rc = msgctl(msqid, IPC_RMID, 0); + printf("msgctl\\(%d, (%s\\|)?%s, NULL\\) = 0\n", + msqid, str_ipc_64, str_ipc_rmid); + msqid = -1; + if (rc == -1) + return 77; + puts("\\+\\+\\+ exited with 0 \\+\\+\\+"); + } + return 0; +} + +int +sys_msgrcv(int msqid, void *msgp, size_t sz, kernel_long_t msgtyp, + int msgflg) +{ +#if defined __x86_64__ && defined __ILP32__ + return syscall(__NR_msgrcv, msqid, msgp, sz, msgtyp, msgflg); +#else + return msgrcv(msqid, msgp, sz, msgtyp, msgflg); +#endif } int -main (void) +main(void) { - const long mtype = 0xdefaced; + /* mtype has to be positive */ + const kernel_long_t mtype = (kernel_long_t) 0x7facefed5adc0dedULL; struct { kernel_long_t mtype; char mtext[msgsz]; @@ -58,10 +79,23 @@ main (void) msqid = msgget(IPC_PRIVATE, IPC_CREAT | S_IRWXU); if (msqid == -1) perror_msg_and_skip("msgget"); - atexit(cleanup); + printf("msgget\\(%s, %s\\|0700\\) = %d\n", + str_ipc_private, str_ipc_creat, msqid); + + typedef void (*atexit_func)(void); + atexit((atexit_func) cleanup); + + printf("msgsnd\\(%d, \\{%lld, \"" text_string "\\\\0\"\\}, 14, 0\\)" + " = 0\n", + msqid, (long long) mtype); if (msgsnd(msqid, &msg, msgsz, 0) == -1) perror_msg_and_skip("msgsnd"); - if (msgrcv(msqid, &msg, msgsz, mtype, 0) != msgsz) + + if (sys_msgrcv(msqid, &msg, msgsz, -mtype, 0) != msgsz) perror_msg_and_skip("msgrcv"); - return 0; + printf("msgrcv\\(%d, \\{%lld, \"" text_string "\\\\0\"\\}, 14, %lld" + ", 0\\) = 14\n", + msqid, (long long) mtype, -(long long) mtype); + + return cleanup(); } diff --git a/tests-mx32/ipc_msgbuf.expected b/tests-mx32/ipc_msgbuf.expected deleted file mode 100644 index 880424bf..00000000 --- a/tests-mx32/ipc_msgbuf.expected +++ /dev/null @@ -1,4 +0,0 @@ -msgget\(IPC_PRIVATE, IPC_CREAT\|0700\) += [0-9]* -msgsnd\([0-9]*, \{233811181, "STRACE_STRING\\0"\}, 14, 0\) += 0 -msgrcv\([0-9]*, \{233811181, "STRACE_STRING\\0"\}, 14, 233811181, 0\) += 14 -msgctl\([0-9]*, (IPC_64\|)?IPC_RMID, NULL\) += 0 diff --git a/tests-mx32/ipc_msgbuf.test b/tests-mx32/ipc_msgbuf.test index d0b65d1a..4e26578a 100755 --- a/tests-mx32/ipc_msgbuf.test +++ b/tests-mx32/ipc_msgbuf.test @@ -1,11 +1,16 @@ #!/bin/sh - +# # Check msgget, msgsnd, msgrcv, msgctl syscalls decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog -run_strace -v -e msgget,msgsnd,msgrcv,msgctl $args -match_grep +run_strace -a26 -v -e msgget,msgsnd,msgrcv,msgctl "$@" $args > "$EXP" +match_grep "$LOG" "$EXP" exit 0 diff --git a/tests-mx32/ipc_sem-Xabbrev.c b/tests-mx32/ipc_sem-Xabbrev.c new file mode 100644 index 00000000..727005ad --- /dev/null +++ b/tests-mx32/ipc_sem-Xabbrev.c @@ -0,0 +1 @@ +#include "ipc_sem.c" diff --git a/tests-mx32/ipc_sem-Xabbrev.gen.test b/tests-mx32/ipc_sem-Xabbrev.gen.test new file mode 100755 index 00000000..0757a48b --- /dev/null +++ b/tests-mx32/ipc_sem-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_sem-Xabbrev +ipc.sh -Xabbrev -a29); do not edit. +set -- -Xabbrev -a29 +. "${srcdir=.}/ipc.sh" diff --git a/tests-mx32/ipc_sem-Xraw.c b/tests-mx32/ipc_sem-Xraw.c new file mode 100644 index 00000000..0a57c0ac --- /dev/null +++ b/tests-mx32/ipc_sem-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "ipc_sem.c" diff --git a/tests-mx32/ipc_sem-Xraw.gen.test b/tests-mx32/ipc_sem-Xraw.gen.test new file mode 100755 index 00000000..07d59e51 --- /dev/null +++ b/tests-mx32/ipc_sem-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_sem-Xraw +ipc.sh -Xraw -a19); do not edit. +set -- -Xraw -a19 +. "${srcdir=.}/ipc.sh" diff --git a/tests-mx32/ipc_sem-Xverbose.c b/tests-mx32/ipc_sem-Xverbose.c new file mode 100644 index 00000000..56e83806 --- /dev/null +++ b/tests-mx32/ipc_sem-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "ipc_sem.c" diff --git a/tests-mx32/ipc_sem-Xverbose.gen.test b/tests-mx32/ipc_sem-Xverbose.gen.test new file mode 100755 index 00000000..43a61d08 --- /dev/null +++ b/tests-mx32/ipc_sem-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_sem-Xverbose +ipc.sh -Xverbose -a36); do not edit. +set -- -Xverbose -a36 +. "${srcdir=.}/ipc.sh" diff --git a/tests-mx32/ipc_sem.c b/tests-mx32/ipc_sem.c index 8f6382cc..7341f728 100644 --- a/tests-mx32/ipc_sem.c +++ b/tests-mx32/ipc_sem.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2015 Andreas Schwab * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -35,11 +16,48 @@ #include "xlat.h" #include "xlat/resource_flags.h" +#ifndef SEM_STAT_ANY +# define SEM_STAT_ANY 20 +#endif + +#if XLAT_RAW +# define str_ipc_flags "0xface1e00" +# define str_ipc_private "0" +# define str_ipc_rmid "0" +# define str_ipc_stat "0x2" +# define str_sem_stat "0x12" +# define str_sem_info "0x13" +# define str_sem_stat_any "0x14" +# define str_ipc_64 "0x100" +# define str_bogus_cmd "0xdeadbeef" +#elif XLAT_VERBOSE +# define str_ipc_flags \ + "0xface1e00 /\\* IPC_CREAT\\|IPC_EXCL\\|IPC_NOWAIT\\|0xface1000 \\*/" +# define str_ipc_private "0 /\\* IPC_PRIVATE \\*/" +# define str_ipc_rmid "0 /\\* IPC_RMID \\*/" +# define str_ipc_stat "0x2 /\\* IPC_STAT \\*/" +# define str_sem_stat "0x12 /\\* SEM_STAT \\*/" +# define str_sem_info "0x13 /\\* SEM_INFO \\*/" +# define str_sem_stat_any "0x14 /\\* SEM_STAT_ANY \\*/" +# define str_ipc_64 "0x100 /\\* IPC_64 \\*/" +# define str_bogus_cmd "0xdeadbeef /\\* SEM_\\?\\?\\? \\*/" +#else +# define str_ipc_flags "IPC_CREAT\\|IPC_EXCL\\|IPC_NOWAIT\\|0xface1000" +# define str_ipc_private "IPC_PRIVATE" +# define str_ipc_rmid "IPC_RMID" +# define str_ipc_stat "IPC_STAT" +# define str_sem_stat "SEM_STAT" +# define str_sem_info "SEM_INFO" +# define str_sem_stat_any "SEM_STAT_ANY" +# define str_ipc_64 "IPC_64" +# define str_bogus_cmd "0xdeadbeef /\\* SEM_\\?\\?\\? \\*/" +#endif + union semun { - int val; /* Value for SETVAL */ - struct semid_ds *buf; /* Buffer for IPC_STAT, IPC_SET */ - unsigned short *array; /* Array for GETALL, SETALL */ - struct seminfo *__buf; /* Buffer for IPC_INFO + int val; /* Value for SETVAL */ + struct semid_ds *buf; /* Buffer for IPC_STAT, IPC_SET */ + unsigned short *array; /* Array for GETALL, SETALL */ + struct seminfo *__buf; /* Buffer for IPC_INFO (Linux-specific) */ }; @@ -49,8 +67,8 @@ static void cleanup(void) { semctl(id, 0, IPC_RMID, 0); - printf("semctl\\(%d, 0, (IPC_64\\|)?IPC_RMID, \\[?NULL\\]?\\) += 0\n", - id); + printf("semctl\\(%d, 0, (%s\\|)?%s, \\[?NULL\\]?\\) = 0\n", + id, str_ipc_64, str_ipc_rmid); id = -1; } @@ -74,42 +92,41 @@ main(void) struct seminfo info; rc = semget(bogus_key, bogus_size, bogus_flags); - printf("semget\\(%#llx, %d, %s%s%s%#x\\|%#04o\\) += %s\n", + printf("semget\\(%#llx, %d, %s\\|%#04o\\) = %s\n", zero_extend_signed_to_ull(bogus_key), bogus_size, - IPC_CREAT & bogus_flags ? "IPC_CREAT\\|" : "", - IPC_EXCL & bogus_flags ? "IPC_EXCL\\|" : "", - IPC_NOWAIT & bogus_flags ? "IPC_NOWAIT\\|" : "", - bogus_flags & ~(0777 | IPC_CREAT | IPC_EXCL | IPC_NOWAIT), - bogus_flags & 0777, sprintrc_grep(rc)); + str_ipc_flags, bogus_flags & 0777, sprintrc_grep(rc)); id = semget(private_key, 1, 0600); if (id < 0) perror_msg_and_skip("semget"); - printf("semget\\(IPC_PRIVATE, 1, 0600\\) += %d\n", id); + printf("semget\\(%s, 1, 0600\\) = %d\n", str_ipc_private, id); atexit(cleanup); rc = semctl(bogus_semid, bogus_semnum, bogus_cmd, bogus_arg); #define SEMCTL_BOGUS_ARG_FMT "(%#lx|\\[(%#lx|NULL)\\]|NULL)" - printf("semctl\\(%d, %d, (IPC_64\\|)?%#x /\\* SEM_\\?\\?\\? \\*/" - ", " SEMCTL_BOGUS_ARG_FMT "\\) += %s\n", - bogus_semid, bogus_semnum, bogus_cmd, + printf("semctl\\(%d, %d, (%s\\|)?%s, " SEMCTL_BOGUS_ARG_FMT "\\) = %s\n", + bogus_semid, bogus_semnum, str_ipc_64, str_bogus_cmd, bogus_arg, bogus_arg, sprintrc_grep(rc)); un.buf = &ds; if (semctl(id, 0, IPC_STAT, un)) perror_msg_and_skip("semctl IPC_STAT"); - printf("semctl\\(%d, 0, (IPC_64\\|)?IPC_STAT, \\[?%p\\]?\\) += 0\n", - id, &ds); + printf("semctl\\(%d, 0, (%s\\|)?%s, \\[?%p\\]?\\) = 0\n", + id, str_ipc_64, str_ipc_stat, &ds); un.__buf = &info; rc = semctl(0, 0, SEM_INFO, un); - printf("semctl\\(0, 0, (IPC_64\\|)?SEM_INFO, \\[?%p\\]?\\) += %s\n", - &info, sprintrc_grep(rc)); + printf("semctl\\(0, 0, (%s\\|)?%s, \\[?%p\\]?\\) = %s\n", + str_ipc_64, str_sem_info, &info, sprintrc_grep(rc)); un.buf = &ds; rc = semctl(id, 0, SEM_STAT, un); - printf("semctl\\(%d, 0, (IPC_64\\|)?SEM_STAT, \\[?%p\\]?\\) += %s\n", - id, &ds, sprintrc_grep(rc)); + printf("semctl\\(%d, 0, (%s\\|)?%s, \\[?%p\\]?\\) = %s\n", + id, str_ipc_64, str_sem_stat, &ds, sprintrc_grep(rc)); + + rc = semctl(id, 0, SEM_STAT_ANY, un); + printf("semctl\\(%d, 0, (%s\\|)?%s, (%p|\\[(%p|NULL)\\]|NULL)\\) = %s\n", + id, str_ipc_64, str_sem_stat_any, &ds, &ds, sprintrc_grep(rc)); return 0; } diff --git a/tests-mx32/ipc_sem.gen.test b/tests-mx32/ipc_sem.gen.test new file mode 100755 index 00000000..173b3af3 --- /dev/null +++ b/tests-mx32/ipc_sem.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_sem +ipc.sh -a29); do not edit. +set -- -a29 +. "${srcdir=.}/ipc.sh" diff --git a/tests-mx32/ipc_sem.test b/tests-mx32/ipc_sem.test deleted file mode 100755 index cc93d07b..00000000 --- a/tests-mx32/ipc_sem.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of ipc semget/semctl syscalls - -. "${srcdir=.}/ipc.sh" diff --git a/tests-mx32/ipc_shm-Xabbrev.c b/tests-mx32/ipc_shm-Xabbrev.c new file mode 100644 index 00000000..c191aeaa --- /dev/null +++ b/tests-mx32/ipc_shm-Xabbrev.c @@ -0,0 +1 @@ +#include "ipc_shm.c" diff --git a/tests-mx32/ipc_shm-Xabbrev.gen.test b/tests-mx32/ipc_shm-Xabbrev.gen.test new file mode 100755 index 00000000..d68c2462 --- /dev/null +++ b/tests-mx32/ipc_shm-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_shm-Xabbrev +ipc.sh -Xabbrev -a29); do not edit. +set -- -Xabbrev -a29 +. "${srcdir=.}/ipc.sh" diff --git a/tests-mx32/ipc_shm-Xraw.c b/tests-mx32/ipc_shm-Xraw.c new file mode 100644 index 00000000..08e09ac1 --- /dev/null +++ b/tests-mx32/ipc_shm-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "ipc_shm.c" diff --git a/tests-mx32/ipc_shm-Xraw.gen.test b/tests-mx32/ipc_shm-Xraw.gen.test new file mode 100755 index 00000000..071eef67 --- /dev/null +++ b/tests-mx32/ipc_shm-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_shm-Xraw +ipc.sh -Xraw -a19); do not edit. +set -- -Xraw -a19 +. "${srcdir=.}/ipc.sh" diff --git a/tests-mx32/ipc_shm-Xverbose.c b/tests-mx32/ipc_shm-Xverbose.c new file mode 100644 index 00000000..b936785f --- /dev/null +++ b/tests-mx32/ipc_shm-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "ipc_shm.c" diff --git a/tests-mx32/ipc_shm-Xverbose.gen.test b/tests-mx32/ipc_shm-Xverbose.gen.test new file mode 100755 index 00000000..170adeee --- /dev/null +++ b/tests-mx32/ipc_shm-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_shm-Xverbose +ipc.sh -Xverbose -a36); do not edit. +set -- -Xverbose -a36 +. "${srcdir=.}/ipc.sh" diff --git a/tests-mx32/ipc_shm.c b/tests-mx32/ipc_shm.c index 66960ff9..76c19d8d 100644 --- a/tests-mx32/ipc_shm.c +++ b/tests-mx32/ipc_shm.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2015 Elvira Khabirova * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,16 +13,70 @@ #include #include +#ifndef SHM_HUGE_SHIFT +# define SHM_HUGE_SHIFT 26 +#endif + +#ifndef SHM_HUGE_MASK +# define SHM_HUGE_MASK 0x3f +#endif + +#ifndef SHM_STAT_ANY +# define SHM_STAT_ANY 15 +#endif + #include "xlat.h" #include "xlat/shm_resource_flags.h" +#if XLAT_RAW +# define str_ipc_flags "0x2ce1e00" +# define str_shm_huge "21<<26" +# define str_ipc_private "0" +# define str_ipc_rmid "0" +# define str_ipc_set "0x1" +# define str_ipc_stat "0x2" +# define str_shm_stat "0xd" +# define str_shm_info "0xe" +# define str_shm_stat_any "0xf" +# define str_ipc_64 "0x100" +# define str_bogus_cmd "0xdefaced2" +#elif XLAT_VERBOSE +# define str_ipc_flags \ + "0x2ce1e00 /\\* IPC_CREAT\\|IPC_EXCL\\|SHM_HUGETLB\\|SHM_NORESERVE" \ + "\\|0x2ce0000 \\*/" +# define str_shm_huge "21<<26 /\\* SHM_HUGE_SHIFT \\*/" +# define str_ipc_private "0 /\\* IPC_PRIVATE \\*/" +# define str_ipc_rmid "0 /\\* IPC_RMID \\*/" +# define str_ipc_set "0x1 /\\* IPC_SET \\*/" +# define str_ipc_stat "0x2 /\\* IPC_STAT \\*/" +# define str_shm_stat "0xd /\\* SHM_STAT \\*/" +# define str_shm_info "0xe /\\* SHM_INFO \\*/" +# define str_shm_stat_any "0xf /\\* SHM_STAT_ANY \\*/" +# define str_ipc_64 "0x100 /\\* IPC_64 \\*/" +# define str_bogus_cmd "0xdefaced2 /\\* SHM_\\?\\?\\? \\*/" +#else +# define str_ipc_flags \ + "IPC_CREAT\\|IPC_EXCL\\|SHM_HUGETLB\\|SHM_NORESERVE\\|0x2ce0000" +# define str_shm_huge "21< + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef MIPS + +int +main(void) +{ + __asm__(".set noreorder; li $a0, 0; li $v0, 5058; syscall"); + return 77; +} + +#else + +SKIP_MAIN_UNDEFINED("MIPS") + +#endif diff --git a/tests-mx32/kcmp-y.c b/tests-mx32/kcmp-y.c new file mode 100644 index 00000000..02ad90e5 --- /dev/null +++ b/tests-mx32/kcmp-y.c @@ -0,0 +1,3 @@ +#define VERBOSE_FD 1 + +#include "kcmp.c" diff --git a/tests-mx32/kcmp-y.gen.test b/tests-mx32/kcmp-y.gen.test new file mode 100755 index 00000000..065db9d0 --- /dev/null +++ b/tests-mx32/kcmp-y.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kcmp-y -a22 -y -e trace=kcmp); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -y -e trace=kcmp diff --git a/tests-mx32/kcmp.c b/tests-mx32/kcmp.c index cb497c9f..4e3433ee 100644 --- a/tests-mx32/kcmp.c +++ b/tests-mx32/kcmp.c @@ -1,30 +1,11 @@ /* * Check decoding of kcmp syscall. * - * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2017 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -34,15 +15,67 @@ #ifdef __NR_kcmp +# include +# include +# include # include +# include # include -# define KCMP_FILE 0 -# define KCMP_SYSVSEM 6 +# ifndef VERBOSE_FD +# define VERBOSE_FD 0 +# endif + +/* + * We prefer to use system headers in order to catch some possible deviations in + * system's headers from our perception of reality, but happy to include our own + * definitions as well. + */ +# ifdef HAVE_LINUX_KCMP_H +# include +# else +# define KCMP_FILE 0 +# define KCMP_VM 1 +# define KCMP_FILES 2 +# define KCMP_FS 3 +# define KCMP_SIGHAND 4 +# define KCMP_IO 5 +# define KCMP_SYSVSEM 6 +# endif + +/* All other kcmp types have been added atomically */ +# define KCMP_EPOLL_TFD 7 + +# ifndef HAVE_STRUCT_KCMP_EPOLL_SLOT +struct kcmp_epoll_slot { + uint32_t efd; + uint32_t tfd; + uint32_t toff; +}; +# endif + +static const kernel_ulong_t kcmp_max_type = KCMP_EPOLL_TFD; + +static const char null_path[] = "/dev/null"; +static const char zero_path[] = "/dev/zero"; + +# define NULL_FD 23 +# define ZERO_FD 42 +static void +printpidfd(const char *prefix, pid_t pid, unsigned fd) +{ + printf("%s%d", prefix, fd); +} + +/* + * Last argument is optional and is used as follows: + * * When type is KCMP_EPOLL_TFD, it signalises whether idx2 is a valid + * pointer. + */ static void do_kcmp(kernel_ulong_t pid1, kernel_ulong_t pid2, kernel_ulong_t type, - const char *type_str, kernel_ulong_t idx1, kernel_ulong_t idx2) + const char *type_str, kernel_ulong_t idx1, kernel_ulong_t idx2, ...) { long rc; const char *errstr; @@ -57,11 +90,37 @@ do_kcmp(kernel_ulong_t pid1, kernel_ulong_t pid2, kernel_ulong_t type, else printf("%#x /* KCMP_??? */", (int) type); - if (type == KCMP_FILE) - printf(", %u, %u", (unsigned) idx1, (unsigned) idx2); - else if (type > KCMP_SYSVSEM) + if (type == KCMP_FILE) { + printpidfd(", ", pid1, idx1); + printpidfd(", ", pid2, idx2); + } else if (type == KCMP_EPOLL_TFD) { + va_list ap; + int valid_ptr; + + va_start(ap, idx2); + valid_ptr = va_arg(ap, int); + va_end(ap); + + printpidfd(", ", pid1, idx1); + printf(", "); + + if (valid_ptr) { + struct kcmp_epoll_slot *slot = + (struct kcmp_epoll_slot *) (uintptr_t) idx2; + + printpidfd("{efd=", pid2, slot->efd); + printpidfd(", tfd=", pid2, slot->tfd); + printf(", toff=%llu}", (unsigned long long) slot->toff); + } else { + if (idx2) + printf("%#llx", (unsigned long long) idx2); + else + printf("NULL"); + } + } else if (type > kcmp_max_type) { printf(", %#llx, %#llx", (unsigned long long) idx1, (unsigned long long) idx2); + } printf(") = %s\n", errstr); } @@ -79,18 +138,71 @@ main(void) (kernel_ulong_t) 0xdec0ded3dec0ded4ULL; static const kernel_ulong_t bogus_idx2 = (kernel_ulong_t) 0xba5e1e55deadc0deULL; + static const struct kcmp_epoll_slot slot_data[] = { + { 0xdeadc0de, 0xfacef157, 0xbadc0ded }, + { NULL_FD, ZERO_FD, 0 }, + { 0, 0, 0 }, + }; + static kernel_ulong_t ptr_check = + F8ILL_KULONG_SUPPORTED ? F8ILL_KULONG_MASK : 0; + + int fd; + unsigned i; + TAIL_ALLOC_OBJECT_CONST_PTR(struct kcmp_epoll_slot, slot); + + /* Open some files to test printpidfd */ + fd = open(null_path, O_RDONLY); + if (fd < 0) + perror_msg_and_fail("open(\"%s\")", null_path); + if (fd != NULL_FD) { + if (dup2(fd, NULL_FD) < 0) + perror_msg_and_fail("dup2(fd, NULL_FD)"); + close(fd); + } + + fd = open(zero_path, O_RDONLY); + if (fd < 0) + perror_msg_and_fail("open(\"%s\")", zero_path); + if (fd != ZERO_FD) { + if (dup2(fd, ZERO_FD) < 0) + perror_msg_and_fail("dup2(fd, ZERO_FD)"); + close(fd); + } + + close(0); /* Invalid values */ do_kcmp(bogus_pid1, bogus_pid2, bogus_type, NULL, bogus_idx1, bogus_idx2); - do_kcmp(0, 0, KCMP_SYSVSEM + 1, NULL, 0, 0); + do_kcmp(F8ILL_KULONG_MASK, F8ILL_KULONG_MASK, kcmp_max_type + 1, NULL, + 0, 0); /* KCMP_FILE is the only type which has additional args */ do_kcmp(3141592653U, 2718281828U, ARG_STR(KCMP_FILE), bogus_idx1, bogus_idx2); - /* Some type without additional args */ + do_kcmp(-1, -1, ARG_STR(KCMP_FILE), NULL_FD, ZERO_FD); + + /* Types without additional args */ + do_kcmp(-1, -1, ARG_STR(KCMP_VM), bogus_idx1, bogus_idx2); + do_kcmp(-1, -1, ARG_STR(KCMP_FILES), bogus_idx1, bogus_idx2); + do_kcmp(-1, -1, ARG_STR(KCMP_FS), bogus_idx1, bogus_idx2); + do_kcmp(-1, -1, ARG_STR(KCMP_SIGHAND), bogus_idx1, bogus_idx2); + do_kcmp(-1, -1, ARG_STR(KCMP_IO), bogus_idx1, bogus_idx2); do_kcmp(-1, -1, ARG_STR(KCMP_SYSVSEM), bogus_idx1, bogus_idx2); + /* KCMP_EPOLL_TFD checks */ + do_kcmp(-1, -1, ARG_STR(KCMP_EPOLL_TFD), + F8ILL_KULONG_MASK | 2718281828U, ptr_check, 0); + do_kcmp(-1, -1, ARG_STR(KCMP_EPOLL_TFD), + 3141592653U, (uintptr_t) slot + 1, 0); + + for (i = 0; i < ARRAY_SIZE(slot_data); i++) { + memcpy(slot, slot_data + i, sizeof(*slot)); + + do_kcmp(getpid(), getppid(), ARG_STR(KCMP_EPOLL_TFD), NULL_FD, + (uintptr_t) slot, 1); + } + puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/kcmp.gen.test b/tests-mx32/kcmp.gen.test new file mode 100755 index 00000000..139e909b --- /dev/null +++ b/tests-mx32/kcmp.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kcmp -a22 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests-mx32/kcmp.test b/tests-mx32/kcmp.test deleted file mode 100755 index d022aeba..00000000 --- a/tests-mx32/kcmp.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of kcmp syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests-mx32/kern_features-fault.test b/tests-mx32/kern_features-fault.test new file mode 100755 index 00000000..a46c839f --- /dev/null +++ b/tests-mx32/kern_features-fault.test @@ -0,0 +1,43 @@ +#!/bin/sh +# +# Check decoding of SPARC-specific kern_features syscall. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +run_prog ../kern_features > /dev/null +prog="$args" +fault_args='-a16 -e trace=kern_features -e inject=kern_features:retval=' + +test_run_rval() +{ + local run rval + run="$1"; shift + rval="$1"; shift + + run_strace $fault_args$rval $prog $run > "$EXP" + match_diff "$LOG" "$EXP" +} + +test_run_rval 0 0 +test_run_rval 1 1 +test_run_rval 2 2 +test_run_rval 3 2147483646 # 0x7ffffffe +test_run_rval 4 2147483647 # 0x7fffffff + +exit 0 # injecting retval < 0 not supported yet + +case "$SIZEOF_KERNEL_LONG_T" in +4) + test_run_rval 5 3735943886 # 0xdeadface + test_run_rval 6 4294967295 # 0xffffffff + ;; +8) + test_run_rval 5 13464652301225294542 # 0xbadc0deddeadface + test_run_rval 6 18446744073709551615 # 0xffffffffffffffff + ;; +esac diff --git a/tests-mx32/kern_features.c b/tests-mx32/kern_features.c new file mode 100644 index 00000000..4814414d --- /dev/null +++ b/tests-mx32/kern_features.c @@ -0,0 +1,100 @@ +/* + * Check decoding of SPARC-specific kern_features syscall. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include + +#include "raw_syscall.h" +#include "scno.h" + +#if defined __NR_kern_features && defined raw_syscall_0 + +# include +# include +# include +# include + +static void +test_kern_features(unsigned int num) +{ + /* The expected return codes, as enforced by fault injection */ + static struct { + kernel_ulong_t ret; + const char *str; + } checks[] = { + { 0, NULL }, + { 1, "KERN_FEATURE_MIXED_MODE_STACK" }, + { 2, "0x2" }, + { 0x7ffffffe, "0x7ffffffe" }, + { 0x7fffffff, "KERN_FEATURE_MIXED_MODE_STACK|0x7ffffffe" }, + { (kernel_ulong_t) 0xbadc0deddeadfaceULL, + sizeof(kernel_ulong_t) == 8 ? + "0xbadc0deddeadface" : "0xdeadface" }, + { (kernel_ulong_t) -1ULL, + sizeof(kernel_ulong_t) == 8 ? + "KERN_FEATURE_MIXED_MODE_STACK|0xfffffffffffffffe" : + "KERN_FEATURE_MIXED_MODE_STACK|0xfffffffe" }, + }; + + kernel_ulong_t err = 0; + kernel_ulong_t rc = raw_syscall_0(__NR_kern_features, &err); + + if (err) { + errno = rc; + printf("kern_features() = %s\n", sprintrc(-1)); + return; + } + + printf("kern_features() = %#llx", (unsigned long long) rc); + + if (num < ARRAY_SIZE(checks)) { + if (rc != checks[num].ret) + error_msg_and_fail("Expected return value (%llx) " + "doesn't match expected one (%#llx)", + (unsigned long long) rc, + (unsigned long long) checks[num].ret); + + if (checks[num].str) + printf(" (%s)", checks[num].str); + + printf(" (INJECTED)"); + } else if (rc) { + printf(" ("); + + if (rc & 1) + printf("KERN_FEATURE_MIXED_MODE_STACK"); + + if (rc & ~1ULL) { + if (rc & 1) + printf("|"); + + printf("%#llx", rc & ~1ULL); + } + + printf(")"); + } + + puts(""); +} + +int +main(int ac, char **av) +{ + test_kern_features(ac > 1 ? atoi(av[1]) : -1); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_kern_features && raw_syscall_0"); + +#endif diff --git a/tests-mx32/kern_features.gen.test b/tests-mx32/kern_features.gen.test new file mode 100755 index 00000000..317614a4 --- /dev/null +++ b/tests-mx32/kern_features.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kern_features -a16 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 diff --git a/tests-mx32/kernel_version-Xabbrev.c b/tests-mx32/kernel_version-Xabbrev.c new file mode 100644 index 00000000..2d6da358 --- /dev/null +++ b/tests-mx32/kernel_version-Xabbrev.c @@ -0,0 +1 @@ +#include "kernel_version.c" diff --git a/tests-mx32/kernel_version-Xabbrev.gen.test b/tests-mx32/kernel_version-Xabbrev.gen.test new file mode 100755 index 00000000..abfd5676 --- /dev/null +++ b/tests-mx32/kernel_version-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kernel_version-Xabbrev -a16 -Xabbrev -v -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 -Xabbrev -v -e trace=bpf diff --git a/tests-mx32/kernel_version-Xraw.c b/tests-mx32/kernel_version-Xraw.c new file mode 100644 index 00000000..cf27608b --- /dev/null +++ b/tests-mx32/kernel_version-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "kernel_version.c" diff --git a/tests-mx32/kernel_version-Xraw.gen.test b/tests-mx32/kernel_version-Xraw.gen.test new file mode 100755 index 00000000..e274faad --- /dev/null +++ b/tests-mx32/kernel_version-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kernel_version-Xraw -a16 -Xraw -v -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 -Xraw -v -e trace=bpf diff --git a/tests-mx32/kernel_version-Xverbose.c b/tests-mx32/kernel_version-Xverbose.c new file mode 100644 index 00000000..cc6eb1b7 --- /dev/null +++ b/tests-mx32/kernel_version-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "kernel_version.c" diff --git a/tests-mx32/kernel_version-Xverbose.gen.test b/tests-mx32/kernel_version-Xverbose.gen.test new file mode 100755 index 00000000..b9536ca3 --- /dev/null +++ b/tests-mx32/kernel_version-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kernel_version-Xverbose -a16 -Xverbose -v -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 -Xverbose -v -e trace=bpf diff --git a/tests-mx32/kernel_version.c b/tests-mx32/kernel_version.c new file mode 100644 index 00000000..6e1c0eac --- /dev/null +++ b/tests-mx32/kernel_version.c @@ -0,0 +1,104 @@ +/* + * Check kernel version decoding. + * + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +#include +#include "scno.h" + +#ifdef HAVE_LINUX_BPF_H +# include +#endif + +#include "bpf_attr.h" +#include "print_fields.h" + +#include "xlat.h" +#include "xlat/bpf_commands.h" + +#define CMD_STR(x) #x +static const char *errstr; + +static void +print_bpf_attr(void) +{ +#if XLAT_RAW + printf("{prog_type=0x16" +#else + printf("{prog_type=0x16 /* BPF_PROG_TYPE_??? */" +#endif + ", insn_cnt=3134983661" + ", insns=NULL" + ", license=NULL" + ", log_level=24" + ", log_size=3141592653" + ", log_buf=NULL" +#if XLAT_RAW + ", kern_version=0xcafef00d" +#elif XLAT_VERBOSE + ", kern_version=0xcafef00d" + " /* KERNEL_VERSION(51966, 240, 13) */" +#else + ", kern_version=KERNEL_VERSION(51966, 240, 13)" +#endif + ", prog_flags=0" + ", prog_name=\"\"" + ", prog_ifindex=0" + ", expected_attach_type=" +#if XLAT_RAW + "0" +#elif XLAT_VERBOSE + "0 /* BPF_CGROUP_INET_INGRESS */" +#else /* XLAT_ABBREV */ + "BPF_CGROUP_INET_INGRESS" +#endif + ", prog_btf_fd=0" + ", func_info_rec_size=0" + ", func_info=NULL" + ", func_info_cnt=0" + ", line_info_rec_size=0" + ", line_info=NULL" + ", line_info_cnt=0}"); +} + +int +main(void) +{ + long ret; + struct BPF_PROG_LOAD_struct prog = { + .prog_type = 22, + .insn_cnt = 0xbadc0ded, + .insns = 0, + .license = 0, + .log_level = 24, + .log_size = 3141592653U, + .log_buf = 0, + .kern_version = 0xcafef00d, + .prog_flags = 0, + }; + ret = syscall(__NR_bpf, BPF_PROG_LOAD, &prog, sizeof(prog)); + errstr = sprintrc(ret); +#if XLAT_RAW + printf("bpf(%#x, ", BPF_PROG_LOAD); +#elif XLAT_VERBOSE + printf("bpf(%#x /* %s */, ", BPF_PROG_LOAD, CMD_STR(BPF_PROG_LOAD)); +#else + printf("bpf(%s, ", CMD_STR(BPF_PROG_LOAD)); +#endif + print_bpf_attr(); + printf(", %u) = %s\n", (unsigned int) sizeof(prog), errstr); + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/kernel_version.gen.test b/tests-mx32/kernel_version.gen.test new file mode 100755 index 00000000..8430c763 --- /dev/null +++ b/tests-mx32/kernel_version.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kernel_version -a16 -v -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 -v -e trace=bpf diff --git a/tests-mx32/kexec_file_load.c b/tests-mx32/kexec_file_load.c index be90a37d..5e5d91ed 100644 --- a/tests-mx32/kexec_file_load.c +++ b/tests-mx32/kexec_file_load.c @@ -2,29 +2,10 @@ * Check decoding of kexec_file_load syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -44,7 +25,7 @@ struct strval { const char *str; }; -#define CMDLINE_STR "deadcodebaddatadefaced"; +# define CMDLINE_STR "deadcodebaddatadefaced" int main(void) diff --git a/tests-mx32/kexec_file_load.gen.test b/tests-mx32/kexec_file_load.gen.test new file mode 100755 index 00000000..11013497 --- /dev/null +++ b/tests-mx32/kexec_file_load.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kexec_file_load -s9 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s9 diff --git a/tests-mx32/kexec_file_load.test b/tests-mx32/kexec_file_load.test deleted file mode 100755 index c95e1238..00000000 --- a/tests-mx32/kexec_file_load.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of kexec_file_load syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s9 diff --git a/tests-mx32/kexec_load.c b/tests-mx32/kexec_load.c index 330238de..ae7a72c0 100644 --- a/tests-mx32/kexec_load.c +++ b/tests-mx32/kexec_load.c @@ -2,29 +2,10 @@ * Check decoding of kexec_load syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -62,8 +43,7 @@ main(void) }; static const kernel_ulong_t bogus_zero = - sizeof(long) < sizeof(kernel_long_t) ? - (kernel_ulong_t) 0xffffffff00000000ULL : 0; + sizeof(long) < sizeof(kernel_long_t) ? F8ILL_KULONG_MASK : 0; static const kernel_ulong_t bogus_entry = (kernel_ulong_t) 0xdeadca57badda7a1ULL; static const kernel_ulong_t bogus_nsegs = @@ -129,7 +109,7 @@ main(void) printf("{buf=%p, bufsz=%zu, mem=%p, memsz=%zu}, ", segms[i].buf, segms[i].bufsz, segms[i].mem, segms[i].memsz); - printf("%p], %s%s) = %s\n", + printf("... /* %p */], %s%s) = %s\n", segms + NUM_SEGMS, sizeof(long) == 8 ? flags[0].str64 : flags[0].str32, flags[0].str, errstr); diff --git a/tests-mx32/kexec_load.gen.test b/tests-mx32/kexec_load.gen.test new file mode 100755 index 00000000..6ce18317 --- /dev/null +++ b/tests-mx32/kexec_load.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kexec_load -s9 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s9 diff --git a/tests-mx32/kexec_load.test b/tests-mx32/kexec_load.test deleted file mode 100755 index 4b1511e9..00000000 --- a/tests-mx32/kexec_load.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of kexec_load syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s9 diff --git a/tests-mx32/keyctl-Xabbrev.c b/tests-mx32/keyctl-Xabbrev.c new file mode 100644 index 00000000..7b6b0dcc --- /dev/null +++ b/tests-mx32/keyctl-Xabbrev.c @@ -0,0 +1 @@ +#include "keyctl.c" diff --git a/tests-mx32/keyctl-Xabbrev.gen.test b/tests-mx32/keyctl-Xabbrev.gen.test new file mode 100755 index 00000000..0068a032 --- /dev/null +++ b/tests-mx32/keyctl-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (keyctl-Xabbrev -a31 -s10 -e trace=keyctl -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 -s10 -e trace=keyctl -Xabbrev diff --git a/tests-mx32/keyctl-Xraw.c b/tests-mx32/keyctl-Xraw.c new file mode 100644 index 00000000..202c22a9 --- /dev/null +++ b/tests-mx32/keyctl-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "keyctl.c" diff --git a/tests-mx32/keyctl-Xraw.gen.test b/tests-mx32/keyctl-Xraw.gen.test new file mode 100755 index 00000000..2d89ea79 --- /dev/null +++ b/tests-mx32/keyctl-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (keyctl-Xraw -a13 -s10 -e trace=keyctl -Xraw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 -s10 -e trace=keyctl -Xraw diff --git a/tests-mx32/keyctl-Xverbose.c b/tests-mx32/keyctl-Xverbose.c new file mode 100644 index 00000000..9f9d744a --- /dev/null +++ b/tests-mx32/keyctl-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "keyctl.c" diff --git a/tests-mx32/keyctl-Xverbose.gen.test b/tests-mx32/keyctl-Xverbose.gen.test new file mode 100755 index 00000000..a0cdd7de --- /dev/null +++ b/tests-mx32/keyctl-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (keyctl-Xverbose -a41 -s10 -e trace=keyctl -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a41 -s10 -e trace=keyctl -Xverbose diff --git a/tests-mx32/keyctl.c b/tests-mx32/keyctl.c index 2e26076b..ccfd3b44 100644 --- a/tests-mx32/keyctl.c +++ b/tests-mx32/keyctl.c @@ -2,29 +2,10 @@ * Check decoding of keyctl syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,10 +17,10 @@ # include # include +# include # include # include # include -# include # include # include # include @@ -55,6 +36,15 @@ struct keyctl_dh_params { }; # endif +# ifndef HAVE_STRUCT_KEYCTL_KDF_PARAMS +struct keyctl_kdf_params { + char *hashname; + char *otherinfo; + uint32_t otherinfolen; + uint32_t __spare[8]; +}; +# endif + # include "xlat.h" # include "xlat/keyctl_commands.h" @@ -74,7 +64,18 @@ static const size_t limit = 10; * significantly breaking interface. */ bool nul_terminated_buf = true; -bool buf_in_arg = false; +bool buf_in_arg; + +/* From ioctl_dm.c */ +# define STR32 "AbCdEfGhIjKlMnOpQrStUvWxYz012345" + +# if XLAT_RAW +# define XARG_STR(v_) (v_), STRINGIFY(v_) +# elif XLAT_VERBOSE +# define XARG_STR(v_) (v_), STRINGIFY(v_) " /* " #v_ " */" +# else +# define XARG_STR ARG_STR +# endif /* * When this is called with positive size, the buffer provided is an "out" @@ -97,17 +98,11 @@ print_quoted_string_limit(const char *str, size_t size, long rc) if (!nul_terminated_buf || (strnlen(str, limited_size) == limited_size)) { - printf("\""); print_quoted_memory(str, limited_size); if (print_size > limit) - printf("\"..."); - else - printf("\""); - } else { - printf("\""); + printf("..."); + } else print_quoted_string(str); - printf("\""); - } } static void @@ -121,9 +116,9 @@ print_arg(kernel_ulong_t arg, const char *str, const char *fmt, size_t size, printf("%s", str); } else { if (size == sizeof(uint64_t)) - printf(fmt, (uint64_t)arg); + printf(fmt, (uint64_t) arg); else if (size == sizeof(uint32_t)) - printf(fmt, (uint32_t)arg); + printf(fmt, (uint32_t) arg); else print_quoted_string_limit((void *) (uintptr_t) arg, size, rc); @@ -180,7 +175,13 @@ do_keyctl(kernel_ulong_t cmd, const char *cmd_str, ...) long rc = syscall(__NR_keyctl, cmd, args[0], args[1], args[2], args[3]); const char *errstr = sprintrc(rc); +# if XLAT_RAW + printf("keyctl(%#x", (unsigned) cmd); +# elif XLAT_VERBOSE + printf("keyctl(%#x /* %s */", (unsigned) cmd, cmd_str); +# else printf("keyctl(%s", cmd_str); +# endif for (i = 0; i < cnt; i++) { printf(", "); print_arg(args[i], arg_str[i], arg_fmt[i], arg_sz[i], rc); @@ -188,6 +189,85 @@ do_keyctl(kernel_ulong_t cmd, const char *cmd_str, ...) printf(") = %s\n", errstr); } +int +append_str(char **buf, size_t *left, const char *fmt, ...) +{ + int ret; + va_list ap; + + va_start(ap, fmt); + ret = vsnprintf(*buf, *left, fmt, ap); + va_end(ap); + + assert((ret >= 0) && ((unsigned) ret < *left)); + + *left -= ret; + *buf += ret; + + return ret; +} + +const char * +kckdfp_to_str(struct keyctl_kdf_params *kdf, bool deref_hash, bool deref_oi, + bool print_spare, const char *hash_str, const char *oi_str) +{ + static char buf[4096]; + + size_t left = sizeof(buf); + char *pos = buf; + + append_str(&pos, &left, "{hashname="); + + if (deref_hash && hash_str) { + append_str(&pos, &left, "%s", hash_str); + } else if (!kdf->hashname) { + append_str(&pos, &left, "NULL"); + } else if (deref_hash) { + append_str(&pos, &left, "\"%.*s\"", limit, kdf->hashname); + + if (strnlen(kdf->hashname, limit + 1) > limit) + append_str(&pos, &left, "..."); + } else { + append_str(&pos, &left, "%p", kdf->hashname); + } + + append_str(&pos, &left, ", otherinfo="); + + if (deref_oi && oi_str) { + append_str(&pos, &left, "%s", oi_str); + } else if (!kdf->otherinfo) { + append_str(&pos, &left, "NULL"); + } else if (deref_oi) { + append_str(&pos, &left, "\"%.*s\"", limit, kdf->otherinfo); + + if (strnlen(kdf->otherinfo, limit + 1) > limit) + append_str(&pos, &left, "..."); + } else { + append_str(&pos, &left, "%p", kdf->otherinfo); + } + + append_str(&pos, &left, ", otherinfolen=%u", kdf->otherinfolen); + + if (print_spare) { + size_t i; + + append_str(&pos, &left, ", __spare=["); + + for (i = 0; i < ARRAY_SIZE(kdf->__spare); i++) { + if (i) + append_str(&pos, &left, ", "); + + append_str(&pos, &left, "%#x", kdf->__spare[i]); + } + + append_str(&pos, &left, "]"); + } + + append_str(&pos, &left, "}"); + + return buf; +} + int main(void) { @@ -212,9 +292,50 @@ main(void) static const char *bogus_key3_str = "-557785390"; static const struct keyctl_dh_params kcdhp_data = { - KEY_SPEC_GROUP_KEYRING, 1234567890, 3141592653U }; - static const char *kcdhp_str = "{private=KEY_SPEC_GROUP_KEYRING, " - "prime=1234567890, base=-1153374643}"; + .private = KEY_SPEC_GROUP_KEYRING, + .prime = 1234567890, + .base = 3141592653U + }; + static const char *kcdhp_str = "{private=" +# if XLAT_RAW || XLAT_VERBOSE + "-6" +# endif +# if XLAT_VERBOSE + " /* " +# endif +# if !XLAT_RAW + "KEY_SPEC_GROUP_KEYRING" +# endif +# if XLAT_VERBOSE + " */" +# endif + ", prime=1234567890, base=-1153374643}"; + + /* + * It's bigger than current hash name size limit, but since it's + * implementation-dependent and totally internal, we do not rely + * on it much. + */ + static const char long_hash_data[] = STR32 STR32 STR32 STR32 "xxx"; + static const char short_hash_data[] = "hmac(aes)"; + static const char otherinfo1_data[] = "\1\2 OH HAI THAR\255\0\1"; + static const char otherinfo2_data[] = "\1\2\n\255\0\1"; + static const struct keyctl_kdf_params kckdfp_data[] = { + [0] = { NULL, NULL, 0, { 0 } }, + [1] = { NULL /* Changed to unaccessible address in copy */, + NULL, 0xbadc0dedU, { [7] = 0xdeadfeedU } }, + [2] = { NULL /* long_hash_data */, + NULL /* Changed to unaccessible address in copy */, + 0, { 0 } }, + [3] = { NULL /* unterminated1 */, + NULL /* otherinfo_data */, 0, { 1 } }, + [4] = { NULL /* short_hash_data */, + NULL /* otherinfo1_data */, sizeof(otherinfo1_data), + { 0, 0xfacebeef, 0, 0xba5e1ead } }, + [5] = { NULL /* short_hash_data */, + NULL /* otherinfo2_data */, sizeof(otherinfo2_data), + { 0 } }, + }; char *bogus_str = tail_memdup(unterminated1, sizeof(unterminated1)); char *bogus_desc = tail_memdup(unterminated2, sizeof(unterminated2)); @@ -223,6 +344,15 @@ main(void) char *long_type = tail_memdup(long_type_str, sizeof(long_type_str)); char *long_desc = tail_memdup(long_desc_str, sizeof(long_desc_str)); char *kcdhp = tail_memdup(&kcdhp_data, sizeof(kcdhp_data)); + char *kckdfp_long_hash = tail_memdup(long_hash_data, + sizeof(long_hash_data)); + char *kckdfp_short_hash = tail_memdup(short_hash_data, + sizeof(short_hash_data)); + char *kckdfp_otherinfo1 = tail_memdup(otherinfo1_data, + sizeof(otherinfo1_data)); + char *kckdfp_otherinfo2 = tail_memdup(otherinfo2_data, + sizeof(otherinfo2_data)); + char *kckdfp_char = tail_alloc(sizeof(kckdfp_data[0])); struct iovec *key_iov = tail_alloc(sizeof(*key_iov) * IOV_SIZE); char *bogus_buf1 = tail_alloc(9); char *bogus_buf2 = tail_alloc(256); @@ -230,7 +360,7 @@ main(void) char *key_iov_str2 = tail_alloc(4096); ssize_t ret; ssize_t kis_size = 0; - int i; + size_t i; key_iov[0].iov_base = short_type; key_iov[0].iov_len = sizeof(short_type_str); @@ -297,42 +427,58 @@ main(void) /* Invalid command */ do_keyctl((kernel_ulong_t) 0xbadc0dedfacefeedULL, - "0xfacefeed /* KEYCTL_??? */", +# if XLAT_VERBOSE + "KEYCTL_???" +# else + "0xfacefeed" +# if !XLAT_RAW + " /* KEYCTL_??? */" +# endif +# endif + , sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfee1badc0de5ULL, NULL, kulong_fmt, + (kernel_ulong_t) 0xdeadfee1badc0de5ULL, NULL, + kulong_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfee2badc0de6ULL, NULL, kulong_fmt, + (kernel_ulong_t) 0xdeadfee2badc0de6ULL, NULL, + kulong_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfee3badc0de7ULL, NULL, kulong_fmt, + (kernel_ulong_t) 0xdeadfee3badc0de7ULL, NULL, + kulong_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, kulong_fmt); + (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, + kulong_fmt); /* GET_KEYRING_ID */ do_keyctl(ARG_STR(KEYCTL_GET_KEYRING_ID), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xbadc0dedffffffffLLU, "-1", - NULL, 0UL); + (kernel_ulong_t) 0xbadc0dedffffffffLLU, "-1", NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_GET_KEYRING_ID), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), "%d", - sizeof(int), 3141592653U, NULL, "%d", - NULL, 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), "%d", + sizeof(int), 3141592653U, NULL, "%d", NULL, + 0UL); /* KEYCTL_JOIN_SESSION_KEYRING */ do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), - sizeof(char *), ARG_STR(NULL), NULL, 0UL); + sizeof(char *), ARG_STR(NULL), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, 0UL); do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), - sizeof(char *), bogus_str, NULL, ptr_fmt, 0UL); + sizeof(char *), bogus_str, NULL, ptr_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), - sizeof(char *), ARG_STR("bogus name"), NULL, 0UL); + sizeof(char *), ARG_STR("bogus name"), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), sizeof(char *), "very long keyring name", "\"very long \"...", - NULL, 0UL); + NULL, + 0UL); /* KEYCTL_UPDATE */ @@ -340,21 +486,21 @@ main(void) buf_in_arg = true; do_keyctl(ARG_STR(KEYCTL_UPDATE), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, sizeof(char *), ARG_STR(NULL), NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 0, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 0, NULL, ksize_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_UPDATE), sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, ksize_fmt, + (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, ksize_fmt, 0UL); do_keyctl(ARG_STR(KEYCTL_UPDATE), sizeof(int32_t), bogus_key2, NULL, "%d", sizeof(char *), bogus_str, NULL, ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, ksize_fmt, + (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, ksize_fmt, 0UL); do_keyctl(ARG_STR(KEYCTL_UPDATE), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, @@ -369,11 +515,14 @@ main(void) /* KEYCTL_REVOKE */ do_keyctl(ARG_STR(KEYCTL_REVOKE), - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_REVOKE), - sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key1, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_REVOKE), - sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key2, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_REVOKE), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, 0UL); @@ -381,34 +530,55 @@ main(void) /* KEYCTL_CHOWN */ do_keyctl(ARG_STR(KEYCTL_CHOWN), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, sizeof(uid_t), ARG_STR(-1), NULL, - sizeof(gid_t), ARG_STR(-1), NULL, 0UL); + sizeof(gid_t), ARG_STR(-1), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_CHOWN), sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(uid_t), 2718281828U, NULL, "%u", - sizeof(gid_t), 3141592653U, NULL, "%u", 0UL); + sizeof(gid_t), 3141592653U, NULL, "%u", + 0UL); /* KEYCTL_SETPERM */ do_keyctl(ARG_STR(KEYCTL_SETPERM), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQKEY_AUTH_KEY), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_REQKEY_AUTH_KEY), NULL, sizeof(uint32_t), 0xffffffffU, - "KEY_POS_VIEW|KEY_POS_READ|KEY_POS_WRITE|" - "KEY_POS_SEARCH|KEY_POS_LINK|KEY_POS_SETATTR|" - "KEY_USR_VIEW|KEY_USR_READ|KEY_USR_WRITE|" - "KEY_USR_SEARCH|KEY_USR_LINK|KEY_USR_SETATTR|" - "KEY_GRP_VIEW|KEY_GRP_READ|KEY_GRP_WRITE|" - "KEY_GRP_SEARCH|KEY_GRP_LINK|KEY_GRP_SETATTR|" - "KEY_OTH_VIEW|KEY_OTH_READ|KEY_OTH_WRITE|" - "KEY_OTH_SEARCH|KEY_OTH_LINK|KEY_OTH_SETATTR|" - "0xc0c0c0c0", NULL, 0UL); +# if XLAT_RAW || XLAT_VERBOSE + "0xffffffff" +# endif +# if XLAT_VERBOSE + " /* " +# endif +# if !XLAT_RAW + "KEY_POS_VIEW|KEY_POS_READ|KEY_POS_WRITE|" + "KEY_POS_SEARCH|KEY_POS_LINK|KEY_POS_SETATTR|" + "KEY_USR_VIEW|KEY_USR_READ|KEY_USR_WRITE|" + "KEY_USR_SEARCH|KEY_USR_LINK|KEY_USR_SETATTR|" + "KEY_GRP_VIEW|KEY_GRP_READ|KEY_GRP_WRITE|" + "KEY_GRP_SEARCH|KEY_GRP_LINK|KEY_GRP_SETATTR|" + "KEY_OTH_VIEW|KEY_OTH_READ|KEY_OTH_WRITE|" + "KEY_OTH_SEARCH|KEY_OTH_LINK|KEY_OTH_SETATTR|" + "0xc0c0c0c0" +# endif +# if XLAT_VERBOSE + " */" +# endif + , NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_SETPERM), sizeof(int32_t), bogus_key1, NULL, "%d", - sizeof(uint32_t), 0, NULL, "%#x", 0UL); + sizeof(uint32_t), 0, NULL, "%#x", + 0UL); do_keyctl(ARG_STR(KEYCTL_SETPERM), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, - sizeof(uint32_t), 0xc0c0c0c0, "0xc0c0c0c0 /* KEY_??? */", + sizeof(uint32_t), 0xc0c0c0c0, + "0xc0c0c0c0" +# if !XLAT_RAW + " /* KEY_??? */" +# endif + , NULL, 0UL); @@ -418,38 +588,41 @@ main(void) sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, 0UL); do_keyctl(ARG_STR(KEYCTL_DESCRIBE), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, 0UL); do_keyctl(ARG_STR(KEYCTL_DESCRIBE), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 9, NULL, ksize_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_DESCRIBE), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 256, NULL, ksize_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_DESCRIBE), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) -4, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) -4, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) -4, NULL, ksize_fmt, + 0UL); /* KEYCTL_CLEAR */ do_keyctl(ARG_STR(KEYCTL_CLEAR), - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_CLEAR), - sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key1, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_CLEAR), - sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key2, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_CLEAR), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, 0UL); @@ -458,12 +631,14 @@ main(void) /* KEYCTL_LINK */ do_keyctl(ARG_STR(KEYCTL_LINK), sizeof(int32_t), bogus_key1, NULL, "%d", - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_LINK), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, - sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), bogus_key2, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_LINK), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, 0UL); @@ -471,13 +646,14 @@ main(void) /* KEYCTL_UNLINK */ do_keyctl(ARG_STR(KEYCTL_UNLINK), sizeof(int32_t), bogus_key1, NULL, "%d", - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); do_keyctl(ARG_STR(KEYCTL_UNLINK), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, - sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), bogus_key2, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_UNLINK), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, 0UL); @@ -486,7 +662,7 @@ main(void) buf_in_arg = true; do_keyctl(ARG_STR(KEYCTL_SEARCH), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, sizeof(char *), ARG_STR(NULL), NULL, sizeof(char *), ARG_STR(NULL), NULL, sizeof(int32_t), 0, NULL, "%d"); @@ -494,7 +670,7 @@ main(void) sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, sizeof(char *), (char *) 0xfffff00dfffff157ULL, NULL, ptr_fmt, - sizeof(int32_t), ARG_STR(KEY_SPEC_USER_SESSION_KEYRING), + sizeof(int32_t), XARG_STR(KEY_SPEC_USER_SESSION_KEYRING), NULL); do_keyctl(ARG_STR(KEYCTL_SEARCH), sizeof(int32_t), bogus_key2, NULL, "%d", @@ -512,6 +688,34 @@ main(void) sizeof(long_type_str), long_desc, NULL, NULL, sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); + /* KEYCTL_RESTRICT_KEYRING */ + + do_keyctl(ARG_STR(KEYCTL_RESTRICT_KEYRING), + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(char *), ARG_STR(NULL), NULL, + sizeof(char *), ARG_STR(NULL), NULL, + NULL); + do_keyctl(ARG_STR(KEYCTL_RESTRICT_KEYRING), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, + sizeof(char *), (char *) 0xfffff00dfffff157ULL, NULL, ptr_fmt, + NULL); + do_keyctl(ARG_STR(KEYCTL_RESTRICT_KEYRING), + sizeof(int32_t), bogus_key2, NULL, "%d", + sizeof(char *), bogus_str, NULL, ptr_fmt, + sizeof(char *), bogus_desc, NULL, ptr_fmt, + NULL); + do_keyctl(ARG_STR(KEYCTL_RESTRICT_KEYRING), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(short_type_str), short_type, NULL, NULL, + sizeof(short_desc_str), short_desc, NULL, NULL, + NULL); + do_keyctl(ARG_STR(KEYCTL_RESTRICT_KEYRING), + sizeof(int32_t), 0, NULL, "%d", + sizeof(long_type_str), long_type, NULL, NULL, + sizeof(long_type_str), long_desc, NULL, NULL, + NULL); + buf_in_arg = false; @@ -532,23 +736,23 @@ main(void) sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, 0UL); do_keyctl(ARG_STR(KEYCTL_READ), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 9, NULL, ksize_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_READ), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 256, NULL, ksize_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_READ), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) -4, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) -4, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) -4, NULL, ksize_fmt, + 0UL); nul_terminated_buf = true; @@ -559,33 +763,33 @@ main(void) sizeof(int32_t), 0, NULL, "%d", sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, sizeof(int32_t), 0, NULL, "%d"); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfeedLLU, NULL, ksize_fmt, + (kernel_ulong_t) 0xdeadfeedLLU, NULL, ksize_fmt, sizeof(int32_t), bogus_key1, NULL, "%d"); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), sizeof(int32_t), bogus_key2, NULL, "%d", sizeof(char *), bogus_str, NULL, ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 32LLU, NULL, ksize_fmt, + (kernel_ulong_t) 32LLU, NULL, ksize_fmt, sizeof(int32_t), bogus_key2, NULL, "%d"); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(short_type_str), short_desc, NULL, NULL, sizeof(kernel_ulong_t), - (kernel_ulong_t) sizeof(short_type_str) - 1, NULL, - ksize_fmt, + (kernel_ulong_t) sizeof(short_type_str) - 1, NULL, + ksize_fmt, sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, sizeof(long_type_str), long_desc, NULL, NULL, sizeof(kernel_ulong_t), - (kernel_ulong_t) sizeof(long_type_str), NULL, ksize_fmt, - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL); + (kernel_ulong_t) sizeof(long_type_str), NULL, ksize_fmt, + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL); buf_in_arg = false; @@ -594,16 +798,20 @@ main(void) do_keyctl(ARG_STR(KEYCTL_NEGATE), sizeof(int32_t), 0, NULL, "%d", sizeof(uint32_t), 0, NULL, "%u", - sizeof(int32_t), 0, NULL, "%d", 0UL); + sizeof(int32_t), 0, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_NEGATE), sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(uint32_t), 3141592653U, NULL, "%u", - sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key1, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_NEGATE), sizeof(int32_t), bogus_key2, NULL, "%d", sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, - sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", + NULL, + sizeof(int32_t), bogus_key2, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_NEGATE), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(kernel_ulong_t), @@ -614,7 +822,7 @@ main(void) /* KEYCTL_SET_REQKEY_KEYRING */ do_keyctl(ARG_STR(KEYCTL_SET_REQKEY_KEYRING), - sizeof(int32_t), ARG_STR(KEY_REQKEY_DEFL_NO_CHANGE), NULL, + sizeof(int32_t), XARG_STR(KEY_REQKEY_DEFL_NO_CHANGE), NULL, 0UL); /* * Keep it commented out until proper way of faking syscalls is not @@ -622,34 +830,44 @@ main(void) */ /* do_keyctl(ARG_STR(KEYCTL_SET_REQKEY_KEYRING), sizeof(int32_t), - ARG_STR(KEY_REQKEY_DEFL_REQUESTOR_KEYRING), NULL, 0UL); */ + XARG_STR(KEY_REQKEY_DEFL_REQUESTOR_KEYRING), NULL, 0UL); */ do_keyctl(ARG_STR(KEYCTL_SET_REQKEY_KEYRING), sizeof(kernel_ulong_t), (kernel_ulong_t) 0xfeedf157badc0dedLLU, - "0xbadc0ded /* KEY_REQKEY_DEFL_??? */", NULL, 0UL); + "-1159983635" +# if !XLAT_RAW + " /* KEY_REQKEY_DEFL_??? */" +# endif + , NULL, 0UL); /* KEYCTL_SET_TIMEOUT */ do_keyctl(ARG_STR(KEYCTL_SET_TIMEOUT), sizeof(int32_t), 0, NULL, "%d", - sizeof(uint32_t), 0, NULL, "%u", 0UL); + sizeof(uint32_t), 0, NULL, "%u", + 0UL); do_keyctl(ARG_STR(KEYCTL_SET_TIMEOUT), sizeof(int32_t), bogus_key1, NULL, "%d", - sizeof(uint32_t), 3141592653U, NULL, "%u", 0UL); + sizeof(uint32_t), 3141592653U, NULL, "%u", + 0UL); do_keyctl(ARG_STR(KEYCTL_SET_TIMEOUT), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", + NULL, 0UL); /* KEYCTL_ASSUME_AUTHORITY */ do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), - sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key1, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), - sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key2, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, 0UL); @@ -659,28 +877,29 @@ main(void) do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(char *), ARG_STR(NULL), ptr_fmt, - sizeof(uint32_t), 0xbadc0dedU, NULL, "%u", 0UL); + sizeof(uint32_t), 0xbadc0dedU, NULL, "%u", + 0UL); do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, 0UL); do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 9, NULL, ksize_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 256, NULL, ksize_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) -4, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) -4, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) -4, NULL, ksize_fmt, + 0UL); /* KEYCTL_SESSION_TO_PARENT */ @@ -701,15 +920,18 @@ main(void) do_keyctl(ARG_STR(KEYCTL_REJECT), sizeof(int32_t), bogus_key2, NULL, "%d", sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadca75facef157LLU, "4207866199", NULL, + (kernel_ulong_t) 0xdeadca75facef157LLU, "4207866199", + NULL, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", + NULL, sizeof(int32_t), bogus_key2, NULL, "%d"); do_keyctl(ARG_STR(KEYCTL_REJECT), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, - sizeof(uint32_t), ARG_STR(ENODEV), NULL, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", + NULL, + sizeof(uint32_t), XARG_STR(ENODEV), NULL, sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); @@ -718,19 +940,19 @@ main(void) sizeof(int32_t), 0, NULL, "%d", sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, sizeof(int32_t), 0, NULL, "%d"); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfeedLLU, NULL, ksize_fmt, + sizeof(kernel_ulong_t), (kernel_ulong_t) 0xdeadfeedLLU, NULL, + ksize_fmt, sizeof(int32_t), bogus_key1, NULL, "%d"); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), sizeof(int32_t), bogus_key2, NULL, "%d", sizeof(char *), key_iov + IOV_SIZE, NULL, ptr_fmt, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 32LLU, NULL, ksize_fmt, + sizeof(kernel_ulong_t), (kernel_ulong_t) 32LLU, NULL, + ksize_fmt, sizeof(int32_t), bogus_key2, NULL, "%d"); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, @@ -739,20 +961,23 @@ main(void) ksize_fmt, sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, sizeof(key_iov), key_iov, key_iov_str2, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) IOV_SIZE, NULL, ksize_fmt, - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL); + sizeof(kernel_ulong_t), (kernel_ulong_t) IOV_SIZE, NULL, + ksize_fmt, + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL); /* KEYCTL_INVALIDATE */ do_keyctl(ARG_STR(KEYCTL_INVALIDATE), - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_INVALIDATE), - sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key1, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_INVALIDATE), - sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key2, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_INVALIDATE), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, 0UL); @@ -761,10 +986,12 @@ main(void) /* KEYCTL_GET_PERSISTENT */ do_keyctl(ARG_STR(KEYCTL_GET_PERSISTENT), sizeof(uid_t), ARG_STR(-1), NULL, - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_GET_PERSISTENT), sizeof(uid_t), 2718281828U, NULL, "%u", - sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key1, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_GET_PERSISTENT), sizeof(uid_t), 2718281828U, NULL, "%u", sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, @@ -782,29 +1009,86 @@ main(void) sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, - 0UL); + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + sizeof(char *), ARG_STR(NULL), ptr_fmt); do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), sizeof(char *), kcdhp + 1, NULL, ptr_fmt, sizeof(char *), (char *) 0xfffff157ffffdeadULL, NULL, ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, - 0UL); + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + sizeof(char *), ARG_STR(NULL), ptr_fmt); do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), sizeof(kcdhp), kcdhp, kcdhp_str, NULL, (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 9, NULL, ksize_fmt, + sizeof(char *), ARG_STR(NULL), ptr_fmt); do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), sizeof(kcdhp), kcdhp, kcdhp_str, NULL, (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 256, NULL, ksize_fmt, + sizeof(char *), ARG_STR(NULL), ptr_fmt); do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), sizeof(kcdhp), kcdhp, kcdhp_str, NULL, (size_t) -1, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) -1, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) -1, NULL, ksize_fmt, + sizeof(char *), kckdfp_char + 1, NULL, ptr_fmt); + + /* KEYCTL_DH_COMPUTE + KDF */ + + for (i = 0; i < ARRAY_SIZE(kckdfp_data); i++) { + struct keyctl_kdf_params *kckdfp = + (struct keyctl_kdf_params *) kckdfp_char; + bool deref_hash = true; + bool deref_opts = true; + bool print_spare = false; + const char *hash_str = NULL; + const char *oi_str = NULL; + + memcpy(kckdfp, kckdfp_data + i, sizeof(kckdfp_data[i])); + + switch (i) { + case 1: + deref_hash = false; + print_spare = true; + kckdfp->hashname = + kckdfp_short_hash + sizeof(short_hash_data); + break; + case 2: + deref_opts = false; + kckdfp->hashname = kckdfp_long_hash; + kckdfp->otherinfo = + kckdfp_otherinfo1 + sizeof(otherinfo1_data); + break; + case 3: + deref_opts = false; + deref_hash = false; + print_spare = true; + kckdfp->hashname = bogus_str; + kckdfp->otherinfo = kckdfp_otherinfo1; + break; + case 4: + oi_str = "\"\\1\\2 OH HAI \"..."; + print_spare = true; + kckdfp->hashname = kckdfp_short_hash; + kckdfp->otherinfo = kckdfp_otherinfo1; + break; + case 5: + oi_str = "\"\\1\\2\\n\\255\\0\\1\\0\""; + kckdfp->hashname = kckdfp_short_hash; + kckdfp->otherinfo = kckdfp_otherinfo2; + break; + } + + do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), + sizeof(kcdhp), kcdhp, kcdhp_str, NULL, + (size_t) -1, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), (kernel_ulong_t) -1, NULL, + ksize_fmt, + sizeof(kckdfp), kckdfp_char, + kckdfp_to_str(kckdfp, deref_hash, deref_opts, + print_spare, hash_str, oi_str), + NULL); + } nul_terminated_buf = true; diff --git a/tests-mx32/keyctl.gen.test b/tests-mx32/keyctl.gen.test new file mode 100755 index 00000000..82afad99 --- /dev/null +++ b/tests-mx32/keyctl.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (keyctl -a31 -s10); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 -s10 diff --git a/tests-mx32/keyctl.test b/tests-mx32/keyctl.test deleted file mode 100755 index 875a82d3..00000000 --- a/tests-mx32/keyctl.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of keyctl syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a31 -s10 diff --git a/tests-mx32/kill.c b/tests-mx32/kill.c index cb884aa1..4ef9b628 100644 --- a/tests-mx32/kill.c +++ b/tests-mx32/kill.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Fei Jie + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -66,7 +47,7 @@ main(void) (int) big_pid, (int) big_sig, rc, errno2name()); rc = syscall(__NR_kill, (long) 0xdefaced00000000ULL | pid, 0); - printf("kill(%d, SIG_0) = %ld\n", pid, rc); + printf("kill(%d, 0) = %ld\n", pid, rc); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/kill.gen.test b/tests-mx32/kill.gen.test new file mode 100755 index 00000000..08a004e9 --- /dev/null +++ b/tests-mx32/kill.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kill -a12 -esignal=none); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 -esignal=none diff --git a/tests-mx32/kill.test b/tests-mx32/kill.test deleted file mode 100755 index 7a3a51aa..00000000 --- a/tests-mx32/kill.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of kill syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a12 -esignal=none diff --git a/tests-mx32/kill_child.c b/tests-mx32/kill_child.c new file mode 100644 index 00000000..55b83aba --- /dev/null +++ b/tests-mx32/kill_child.c @@ -0,0 +1,69 @@ +/* + * Check for the corner case that previously lead to segfault + * due to an attempt to access unitialised tcp->s_ent. + * + * 13994 ????( + * ... + * 13994 <... ???? resumed>) = ? + * + * Copyright (c) 2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +#define ITERS 10000 +#define SC_ITERS 10000 + +int +main(void) +{ + volatile sig_atomic_t *const mem = + mmap(NULL, get_page_size(), PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_ANONYMOUS, -1, 0); + if (mem == MAP_FAILED) + perror_msg_and_fail("mmap"); + + for (unsigned int i = 0; i < ITERS; ++i) { + mem[0] = mem[1] = 0; + + const pid_t pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + /* wait for the parent */ + while (!mem[0]) + ; + /* let the parent know we are running */ + mem[1] = 1; + + for (unsigned int j = 0; j < SC_ITERS; j++) + sched_yield(); + + pause(); + return 0; + } + + /* let the child know we are running */ + mem[0] = 1; + /* wait for the child */ + while (!mem[1]) + ; + + if (kill(pid, SIGKILL)) + perror_msg_and_fail("kill"); + if (wait(NULL) != pid) + perror_msg_and_fail("wait"); + } + + return 0; +} diff --git a/tests-mx32/kill_child.test b/tests-mx32/kill_child.test new file mode 100755 index 00000000..312592bd --- /dev/null +++ b/tests-mx32/kill_child.test @@ -0,0 +1,31 @@ +#!/bin/sh +# +# Check whether repeated killing of just forked processes crashes strace. +# +# Copyright (c) 2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed date +%s > /dev/null +s0="$(date +%s)" + +run_prog +args="-f -qq -e signal=none -e trace=sched_yield,/kill $args" + +# Run strace until the known corner case is observed. +while :; do + run_strace $args + + # Printing of "<... SYSCALL resumed>" in strace.c:print_event_exit + # used to segfault when the syscall number had not been obtained + # on syscall entering. + grep -q '^[1-9][0-9]* <\.\.\. ???? resumed>) \+= ?$' "$LOG" && exit 0 + + s1="$(date +%s)" + if [ "$(($s1-$s0))" -gt "$(($TIMEOUT_DURATION/2))" ]; then + skip_ 'Unable to reproduce <... ???? resumed>' + fi +done diff --git a/tests-mx32/ksysent.c b/tests-mx32/ksysent.c index 8cac93ca..4319bdb2 100644 --- a/tests-mx32/ksysent.c +++ b/tests-mx32/ksysent.c @@ -2,29 +2,10 @@ * Validate syscallent.h file. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -33,24 +14,14 @@ #include #include -#define TD 0 -#define TF 0 -#define TI 0 -#define TN 0 -#define TP 0 -#define TS 0 -#define TM 0 -#define NF 0 -#define MA 0 -#define SI 0 -#define SE 0 -#define CST 0 -#define SEN(arg) 0,0 +#include "sysent_shorthand_defs.h" static const struct_sysent syscallent[] = { #include "syscallent.h" }; +#include "sysent_shorthand_undefs.h" + typedef const char *pstr_t; static const pstr_t ksyslist[] = { #include "ksysent.h" diff --git a/tests-mx32/ksysent.sed b/tests-mx32/ksysent.sed index 63ded4a9..c35ba22f 100644 --- a/tests-mx32/ksysent.sed +++ b/tests-mx32/ksysent.sed @@ -1,9 +1,14 @@ #!/bin/sed -rnf +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later # should not have been exported at all -/#define[[:space:]]+__NR_(sys_epoll_|arch_specific_syscall|syscalls|syscall_count|syscall_max|available|reserved|unused)/d +/#define[[:space:]]+__NR_(sys_epoll_|arch_specific_syscall|arm_sync_file_range|syscalls|syscall_count|syscall_max|available|reserved|unused)/d -# should not have been named this way +# should not have been named this way s/__NR_(arm|xtensa)_fadvise64_64/__NR_fadvise64_64/ # legacy names diff --git a/tests-mx32/ksysent.test b/tests-mx32/ksysent.test index 80266488..347ed675 100755 --- a/tests-mx32/ksysent.test +++ b/tests-mx32/ksysent.test @@ -1,4 +1,9 @@ #!/bin/sh +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later # Validate syscallent.h diff --git a/tests-mx32/lchown.c b/tests-mx32/lchown.c index a07c878c..c9008219 100644 --- a/tests-mx32/lchown.c +++ b/tests-mx32/lchown.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/lchown.gen.test b/tests-mx32/lchown.gen.test new file mode 100755 index 00000000..d346c76d --- /dev/null +++ b/tests-mx32/lchown.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (lchown -a30 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 diff --git a/tests-mx32/lchown.test b/tests-mx32/lchown.test deleted file mode 100755 index ceeaa859..00000000 --- a/tests-mx32/lchown.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check lchown syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a30 diff --git a/tests-mx32/lchown32.c b/tests-mx32/lchown32.c index 29cb01db..1a505e1f 100644 --- a/tests-mx32/lchown32.c +++ b/tests-mx32/lchown32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/lchown32.gen.test b/tests-mx32/lchown32.gen.test new file mode 100755 index 00000000..5da2349c --- /dev/null +++ b/tests-mx32/lchown32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (lchown32 -a32 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 diff --git a/tests-mx32/lchown32.test b/tests-mx32/lchown32.test deleted file mode 100755 index 6ee1ac95..00000000 --- a/tests-mx32/lchown32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check lchown32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a32 diff --git a/tests-mx32/libmmsg.c b/tests-mx32/libmmsg.c index b0db26d2..0f23597d 100644 --- a/tests-mx32/libmmsg.c +++ b/tests-mx32/libmmsg.c @@ -1,30 +1,10 @@ /* * Wrappers for recvmmsg and sendmmsg syscalls. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/libsocketcall.c b/tests-mx32/libsocketcall.c index 04d6710f..34f65478 100644 --- a/tests-mx32/libsocketcall.c +++ b/tests-mx32/libsocketcall.c @@ -1,30 +1,10 @@ /* * Invoke a socket syscall, either directly or via __NR_socketcall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -43,7 +23,7 @@ socketcall(const int nr, const int call, int rc = -1; errno = ENOSYS; -# ifdef __NR_socketcall +#ifdef __NR_socketcall static int have_socketcall = -1; if (have_socketcall < 0) { @@ -59,7 +39,7 @@ socketcall(const int nr, const int call, const long args[] = { a1, a2, a3, a4, a5 }; rc = syscall(__NR_socketcall, call, args); } else -# endif +#endif { if (nr != -1) rc = syscall(nr, a1, a2, a3, a4, a5); diff --git a/tests-mx32/link.c b/tests-mx32/link.c index d6550fd3..357eb0be 100644 --- a/tests-mx32/link.c +++ b/tests-mx32/link.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/link.gen.test b/tests-mx32/link.gen.test new file mode 100755 index 00000000..2ec3f5b8 --- /dev/null +++ b/tests-mx32/link.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (link ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/link.test b/tests-mx32/link.test deleted file mode 100755 index cfa2b0cc..00000000 --- a/tests-mx32/link.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check link syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/linkat.c b/tests-mx32/linkat.c index 64b900ea..748ddf18 100644 --- a/tests-mx32/linkat.c +++ b/tests-mx32/linkat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/linkat.gen.test b/tests-mx32/linkat.gen.test new file mode 100755 index 00000000..8bdf78b4 --- /dev/null +++ b/tests-mx32/linkat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (linkat ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/linkat.test b/tests-mx32/linkat.test deleted file mode 100755 index 5627de7f..00000000 --- a/tests-mx32/linkat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check linkat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/list_sigaction_signum.c b/tests-mx32/list_sigaction_signum.c new file mode 100644 index 00000000..bf495406 --- /dev/null +++ b/tests-mx32/list_sigaction_signum.c @@ -0,0 +1,37 @@ +/* + * List signal numbers that are valid arguments for sigaction syscall. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include + +int +main(void) +{ + unsigned int i; + + for (i = 1; i < 32; ++i) { + static const struct sigaction ign = { .sa_handler = SIG_IGN }; + static const struct sigaction dfl = { .sa_handler = SIG_DFL }; + struct sigaction act; + + if (sigaction(i, &ign, NULL) || + sigaction(i, NULL, &act) || + ign.sa_handler != act.sa_handler || + sigaction(i, &dfl, NULL) || + sigaction(i, NULL, &act) || + dfl.sa_handler != act.sa_handler) + continue; + + printf("%u\n", i); + } + + return 0; +} diff --git a/tests-mx32/llseek.c b/tests-mx32/llseek.c index e687e947..169fa913 100644 --- a/tests-mx32/llseek.c +++ b/tests-mx32/llseek.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/llseek.test b/tests-mx32/llseek.test index cf1607ed..a2858398 100755 --- a/tests-mx32/llseek.test +++ b/tests-mx32/llseek.test @@ -1,15 +1,16 @@ #!/bin/sh - +# # Check _llseek syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" check_prog grep run_prog > /dev/null run_strace -e_llseek $args > "$EXP" -grep -v '^lseek([0-9]' < "$LOG" > "$OUT" +grep -v '^_llseek([0-9]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" - -exit 0 diff --git a/tests-mx32/localtime.c b/tests-mx32/localtime.c new file mode 100644 index 00000000..652d3e6a --- /dev/null +++ b/tests-mx32/localtime.c @@ -0,0 +1,37 @@ +/* + * Check handling of localtime() returning NULL in printleader(). + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include + +#include + +int +main(void) +{ + struct timespec ts; + int pid; + + assert(!clock_gettime(CLOCK_REALTIME, &ts)); + + pid = syscall(__NR_gettid); + + /* We expect localtime to fail here */ + printf("%lld.%06ld gettid() = %d\n", + (long long) ts.tv_sec, (long) (ts.tv_nsec / 1000), pid); + + printf("%lld.%06ld +++ exited with 0 +++\n", + (long long) ts.tv_sec, (long) (ts.tv_nsec / 1000)); + + return 0; +} diff --git a/tests-mx32/localtime.test b/tests-mx32/localtime.test new file mode 100755 index 00000000..e2ce1325 --- /dev/null +++ b/tests-mx32/localtime.test @@ -0,0 +1,18 @@ +#!/bin/sh +# +# Check handling of localtime() failure in printleader(). +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +check_prog faketime +faketime -f +1000000000000000000x0 ../$NAME | grep -q '^100000000' \ + || framework_skip_ 'faketime failed to fake time' + +STRACE="faketime -f +1000000000000000000x0 $STRACE" + +run_strace_match_diff -tt -a10 -e trace=gettid diff --git a/tests-mx32/lookup_dcookie.c b/tests-mx32/lookup_dcookie.c index 986180ce..430ae135 100644 --- a/tests-mx32/lookup_dcookie.c +++ b/tests-mx32/lookup_dcookie.c @@ -2,29 +2,10 @@ * Check decoding of lookup_dcookie syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/lookup_dcookie.gen.test b/tests-mx32/lookup_dcookie.gen.test new file mode 100755 index 00000000..616c7057 --- /dev/null +++ b/tests-mx32/lookup_dcookie.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (lookup_dcookie -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-mx32/lookup_dcookie.test b/tests-mx32/lookup_dcookie.test deleted file mode 100755 index 47e1c2d6..00000000 --- a/tests-mx32/lookup_dcookie.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of lookup_cookie syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests-mx32/looping_threads.c b/tests-mx32/looping_threads.c new file mode 100644 index 00000000..2f5e9550 --- /dev/null +++ b/tests-mx32/looping_threads.c @@ -0,0 +1,121 @@ +/* + * Check tracing of looping threads. + * + * Copyright (c) 2009-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +static void * +thread(void *arg) +{ + for (;;) + getuid(); + return arg; +} + +int +main(int ac, const char *av[]) +{ + assert(ac == 3); + + int timeout = atoi(av[1]); + assert(timeout > 0); + + int num_threads = atoi(av[2]); + assert(num_threads > 0); + + /* + * Unblock all signals. + */ + static sigset_t mask; + if (sigprocmask(SIG_SETMASK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + /* + * Reset SIGALRM and SIGHUP signal handlers. + */ + static const struct sigaction sa_def = { .sa_handler = SIG_DFL }; + if (sigaction(SIGHUP, &sa_def, NULL)) + perror_msg_and_fail("sigaction SIGHUP"); + if (sigaction(SIGALRM, &sa_def, NULL)) + perror_msg_and_fail("sigaction SIGALRM"); + + /* + * Create a new process group. + */ + if (setpgid(0, 0)) + perror_msg_and_fail("setpgid"); + + /* + * Set an alarm clock. + */ + alarm(timeout); + + /* + * When the main process terminates, the process group becomes orphaned. + * If any member of the orphaned process group is stopped, then + * a SIGHUP signal followed by a SIGCONT signal is sent to each process + * in the orphaned process group. + * Create a process in a stopped state to activate this behaviour. + */ + const pid_t stopped = fork(); + if (stopped < 0) + perror_msg_and_fail("fork"); + if (!stopped) { + raise(SIGSTOP); + _exit(0); + } + + /* + * Wait for the process to stop. + */ + int status; + if (waitpid(stopped, &status, WUNTRACED) != stopped) + perror_msg_and_fail("waitpid WUNTRACED"); + if (!WIFSTOPPED(status) || WSTOPSIG(status) != SIGSTOP) + error_msg_and_fail("waitpid WUNTRACED: " + "unexpected wait status %d", status); + /* + * Create all threads in a subprocess, this guarantees that + * their tracer will not be their parent. + */ + pid_t pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + if (!pid) { + for (int i = 0; i < num_threads; i++) { + pthread_t t; + if ((errno = pthread_create(&t, NULL, thread, NULL))) { + if (EAGAIN == errno) + break; + perror_msg_and_fail("pthread_create #%d", i); + } + } + + /* This terminates all threads created above. */ + _exit(0); + } + + if (waitpid(pid, &status, 0) != pid) + perror_msg_and_fail("waitpid"); + if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) + error_msg_and_fail("waitpid: unexpected wait status %d", + status); + + /* + * Make the process group orphaned. + */ + return 0; +} diff --git a/tests-mx32/looping_threads.test b/tests-mx32/looping_threads.test new file mode 100755 index 00000000..e8b0bbb5 --- /dev/null +++ b/tests-mx32/looping_threads.test @@ -0,0 +1,38 @@ +#!/bin/sh +# +# Check tracing of looping threads. +# +# Copyright (c) 2009-2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" +. "${srcdir=.}/PTRACE_SEIZE.sh" + +run_prog ../orphaned_process_group > /dev/null + +run_prog_skip_if_failed date +%s > /dev/null +s0="$(date +%s)" + +check_prog nproc +inc="$(nproc)" +[ "$inc" -ge 1 ] || inc=1 + +timeout_2="$(($TIMEOUT_DURATION/2))" +timeout_8="$(($TIMEOUT_DURATION/8))" +nproc=1 + +run_prog "../$NAME" "$timeout_8" "$nproc" + +while :; do + run_strace -f -qq -enone -esignal=none "../$NAME" "$timeout_2" "$nproc" + + s1="$(date +%s)" + [ "$(($s1-$s0))" -lt "$timeout_8" ] || + break + + nproc="$(($nproc+$inc))" +done + +warn_ "$ME_: nproc=$nproc elapsed=$(($s1-$s0))" diff --git a/tests-mx32/lseek.c b/tests-mx32/lseek.c index 4428c4e9..0e12bf9c 100644 --- a/tests-mx32/lseek.c +++ b/tests-mx32/lseek.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/lseek.test b/tests-mx32/lseek.test index f96a91d1..646f7313 100755 --- a/tests-mx32/lseek.test +++ b/tests-mx32/lseek.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check lseek syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -9,7 +14,3 @@ run_prog > /dev/null run_strace -a30 -elseek $args > "$EXP" grep -v '^lseek([0-9]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" - -exit 0 diff --git a/tests-mx32/lstat.c b/tests-mx32/lstat.c index 3754f766..1a200fe7 100644 --- a/tests-mx32/lstat.c +++ b/tests-mx32/lstat.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/lstat.gen.test b/tests-mx32/lstat.gen.test new file mode 100755 index 00000000..7231c491 --- /dev/null +++ b/tests-mx32/lstat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (lstat -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests-mx32/lstat.test b/tests-mx32/lstat.test deleted file mode 100755 index f513bb48..00000000 --- a/tests-mx32/lstat.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check lstat syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests-mx32/lstat64.c b/tests-mx32/lstat64.c index da06609d..0c0cf879 100644 --- a/tests-mx32/lstat64.c +++ b/tests-mx32/lstat64.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/lstat64.gen.test b/tests-mx32/lstat64.gen.test new file mode 100755 index 00000000..124cce4b --- /dev/null +++ b/tests-mx32/lstat64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (lstat64 -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests-mx32/lstat64.test b/tests-mx32/lstat64.test deleted file mode 100755 index fcafe79d..00000000 --- a/tests-mx32/lstat64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check lstat64 syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests-mx32/lstatx.c b/tests-mx32/lstatx.c index cdd1124b..b49c4055 100644 --- a/tests-mx32/lstatx.c +++ b/tests-mx32/lstatx.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #define TEST_SYSCALL_INVOKE(sample, pst) \ diff --git a/tests-mx32/madvise.c b/tests-mx32/madvise.c new file mode 100644 index 00000000..33a7abbe --- /dev/null +++ b/tests-mx32/madvise.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +static const char *errstr; + +static long +k_madvise(const kernel_ulong_t addr, + const kernel_ulong_t length, + const kernel_ulong_t advice) +{ + long rc = syscall(__NR_madvise, addr, length, advice); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + const unsigned long length = get_page_size(); + void *const addr = tail_alloc(length); + long rc; + + rc = madvise(addr, length, MADV_NORMAL); + printf("madvise(%p, %lu, MADV_NORMAL) = %s\n", + addr, length, sprintrc(rc)); + + static const kernel_ulong_t advice = + (kernel_ulong_t) 0xfacefeed00000000ULL | MADV_RANDOM; + rc = k_madvise((uintptr_t) addr, length, advice); + printf("madvise(%p, %lu, MADV_RANDOM) = %s\n", + addr, length, sprintrc(rc)); + + static const kernel_ulong_t bogus_length = + (kernel_ulong_t) 0xfffffffffffffaceULL; + rc = k_madvise(0, bogus_length, MADV_SEQUENTIAL); + printf("madvise(NULL, %llu, MADV_SEQUENTIAL) = %s\n", + (unsigned long long) bogus_length, sprintrc(rc)); + + if (F8ILL_KULONG_SUPPORTED) { + rc = k_madvise(f8ill_ptr_to_kulong(addr), length, MADV_NORMAL); + printf("madvise(%#llx, %lu, MADV_NORMAL) = %s\n", + (unsigned long long) f8ill_ptr_to_kulong(addr), + length, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/madvise.gen.test b/tests-mx32/madvise.gen.test new file mode 100755 index 00000000..a549cf94 --- /dev/null +++ b/tests-mx32/madvise.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (madvise -a33 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 diff --git a/tests-mx32/match.awk b/tests-mx32/match.awk index abfbae92..d91c5182 100644 --- a/tests-mx32/match.awk +++ b/tests-mx32/match.awk @@ -1,29 +1,9 @@ #!/bin/gawk # -# Copyright (c) 2014-2015 Dmitry V. Levin +# Copyright (c) 2014-2018 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later # s[] is array of match strings # r[] is array of match patterns diff --git a/tests-mx32/mbind.c b/tests-mx32/mbind.c index b0544263..8e478a6f 100644 --- a/tests-mx32/mbind.c +++ b/tests-mx32/mbind.c @@ -1,30 +1,10 @@ /* * Check decoding of mbind syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/mbind.gen.test b/tests-mx32/mbind.gen.test new file mode 100755 index 00000000..c47e0fc1 --- /dev/null +++ b/tests-mx32/mbind.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mbind ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/mbind.test b/tests-mx32/mbind.test deleted file mode 100755 index 2a07cac6..00000000 --- a/tests-mx32/mbind.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of mbind syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/membarrier.c b/tests-mx32/membarrier.c index 330893b6..0e55497b 100644 --- a/tests-mx32/membarrier.c +++ b/tests-mx32/membarrier.c @@ -1,28 +1,9 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -44,10 +25,49 @@ main(void) printf("membarrier(0x3 /* MEMBARRIER_CMD_??? */, 255) = %s\n", sprintrc(-1)); if (saved_errno != ENOSYS) { - /* the test needs to be updated? */ - assert(syscall(__NR_membarrier, 0, 0) == 1); - puts("membarrier(MEMBARRIER_CMD_QUERY, 0)" - " = 0x1 (MEMBARRIER_CMD_SHARED)"); + const char *text_global; + const char *text; + int rc = syscall(__NR_membarrier, 0, 0); + + assert(rc >= 0); + + text_global = rc & 1 ? "MEMBARRIER_CMD_GLOBAL" : ""; + + switch (rc & ~1) { + case 0: + text = ""; + break; + case 8: + text = "MEMBARRIER_CMD_PRIVATE_EXPEDITED"; + break; + case 8|16: + text = "MEMBARRIER_CMD_PRIVATE_EXPEDITED|" + "MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED"; + break; + + case 2|4|8|16: + text = "MEMBARRIER_CMD_GLOBAL_EXPEDITED|" + "MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED|" + "MEMBARRIER_CMD_PRIVATE_EXPEDITED|" + "MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED"; + break; + + case 2|4|8|16|32|64: + text = "MEMBARRIER_CMD_GLOBAL_EXPEDITED|" + "MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED|" + "MEMBARRIER_CMD_PRIVATE_EXPEDITED|" + "MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED|" + "MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE|" + "MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE"; + break; + + default: + error_msg_and_fail("membarrier returned %#x, does" + " the test have to be updated?", rc); + } + printf("membarrier(MEMBARRIER_CMD_QUERY, 0) = %#x (%s%s%s)\n", + rc, text_global, text[0] && text_global[0] ? "|" : "", + text); } puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/membarrier.gen.test b/tests-mx32/membarrier.gen.test new file mode 100755 index 00000000..6ae6e915 --- /dev/null +++ b/tests-mx32/membarrier.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (membarrier -a36 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests-mx32/membarrier.test b/tests-mx32/membarrier.test deleted file mode 100755 index ad1f713b..00000000 --- a/tests-mx32/membarrier.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check membarrier syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a36 diff --git a/tests-mx32/memfd_create-Xabbrev.c b/tests-mx32/memfd_create-Xabbrev.c new file mode 100644 index 00000000..f738c743 --- /dev/null +++ b/tests-mx32/memfd_create-Xabbrev.c @@ -0,0 +1 @@ +#include "memfd_create.c" diff --git a/tests-mx32/memfd_create-Xabbrev.gen.test b/tests-mx32/memfd_create-Xabbrev.gen.test new file mode 100755 index 00000000..32f3e23e --- /dev/null +++ b/tests-mx32/memfd_create-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (memfd_create-Xabbrev -Xabbrev -e trace=memfd_create); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xabbrev -e trace=memfd_create diff --git a/tests-mx32/memfd_create-Xraw.c b/tests-mx32/memfd_create-Xraw.c new file mode 100644 index 00000000..0673d2d0 --- /dev/null +++ b/tests-mx32/memfd_create-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "memfd_create.c" diff --git a/tests-mx32/memfd_create-Xraw.gen.test b/tests-mx32/memfd_create-Xraw.gen.test new file mode 100755 index 00000000..97bd6029 --- /dev/null +++ b/tests-mx32/memfd_create-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (memfd_create-Xraw -a30 -Xraw -e trace=memfd_create); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 -Xraw -e trace=memfd_create diff --git a/tests-mx32/memfd_create-Xverbose.c b/tests-mx32/memfd_create-Xverbose.c new file mode 100644 index 00000000..4c428c48 --- /dev/null +++ b/tests-mx32/memfd_create-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "memfd_create.c" diff --git a/tests-mx32/memfd_create-Xverbose.gen.test b/tests-mx32/memfd_create-Xverbose.gen.test new file mode 100755 index 00000000..c3c6846e --- /dev/null +++ b/tests-mx32/memfd_create-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (memfd_create-Xverbose -Xverbose -e trace=memfd_create); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xverbose -e trace=memfd_create diff --git a/tests-mx32/memfd_create.c b/tests-mx32/memfd_create.c index 480fd177..2658a1ba 100644 --- a/tests-mx32/memfd_create.c +++ b/tests-mx32/memfd_create.c @@ -1,3 +1,12 @@ +/* + * Check decoding of memfd_create syscall. + * + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include "scno.h" @@ -5,16 +14,95 @@ #ifdef __NR_memfd_create # include +# include # include +# ifdef HAVE_LINUX_MEMFD_H +# include +# endif + +# ifndef MFD_HUGE_SHIFT +# define MFD_HUGE_SHIFT 26 +# endif + +# ifndef MFD_HUGE_MASK +# define MFD_HUGE_MASK 0x3f +# endif + +static const char *errstr; + +static long +k_memfd_create(const kernel_ulong_t name, const kernel_ulong_t flags) +{ + const long rc = syscall(__NR_memfd_create, name, flags); + errstr = sprintrc(rc); + return rc; +} + int main(void) { - static const char text[] = "strace"; - int rc = syscall(__NR_memfd_create, text, 7); + const size_t size = 255 - (sizeof("memfd:") - 1) + 1; + char *pattern = tail_alloc(size); + fill_memory_ex(pattern, size, '0', 10); + + k_memfd_create((uintptr_t) pattern, 0); + printf("memfd_create(\"%.*s\"..., 0) = %s\n", + (int) size - 1, pattern, errstr); + + kernel_ulong_t flags = (kernel_ulong_t) 0xfacefeed00000007ULL; +# define flags1_str "MFD_CLOEXEC|MFD_ALLOW_SEALING|MFD_HUGETLB" + + k_memfd_create((uintptr_t) pattern, flags); +# if XLAT_VERBOSE + printf("memfd_create(\"%.*s\"..., %s /* %s */) = %s\n", + (int) size - 1, pattern, + "0x7", flags1_str, errstr); +# else + printf("memfd_create(\"%.*s\"..., %s) = %s\n", + (int) size - 1, pattern, +# if XLAT_RAW + "0x7", +# else + flags1_str, +# endif + errstr); +# endif + + pattern[size - 1] = '\0'; + flags = 30 << MFD_HUGE_SHIFT; + k_memfd_create((uintptr_t) pattern, flags); +# if XLAT_RAW + printf("memfd_create(\"%s\", %#x) = %s\n", + pattern, (unsigned int) flags, errstr); +# elif XLAT_VERBOSE + printf("memfd_create(\"%s\", %#x /* %s */) = %s\n", + pattern, (unsigned int) flags, "30< + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/migrate_pages.gen.test b/tests-mx32/migrate_pages.gen.test new file mode 100755 index 00000000..0ea017d0 --- /dev/null +++ b/tests-mx32/migrate_pages.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (migrate_pages -a33 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 diff --git a/tests-mx32/migrate_pages.test b/tests-mx32/migrate_pages.test deleted file mode 100755 index fad53b79..00000000 --- a/tests-mx32/migrate_pages.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check migrate_pages syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a33 diff --git a/tests-mx32/mincore.c b/tests-mx32/mincore.c index ea2b49e3..01619b05 100644 --- a/tests-mx32/mincore.c +++ b/tests-mx32/mincore.c @@ -1,36 +1,15 @@ /* * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include #include -#define DEFAULT_STRLEN 32 - static void print_mincore(const unsigned int pages, void *const addr, const size_t size, unsigned char *const vec) diff --git a/tests-mx32/mincore.gen.test b/tests-mx32/mincore.gen.test new file mode 100755 index 00000000..45e43e25 --- /dev/null +++ b/tests-mx32/mincore.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mincore -a22 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests-mx32/mincore.test b/tests-mx32/mincore.test deleted file mode 100755 index 6af9f492..00000000 --- a/tests-mx32/mincore.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mincore syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a22 diff --git a/tests-mx32/mkdir.c b/tests-mx32/mkdir.c index d971b188..e6e62ef6 100644 --- a/tests-mx32/mkdir.c +++ b/tests-mx32/mkdir.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/mkdir.gen.test b/tests-mx32/mkdir.gen.test new file mode 100755 index 00000000..8d34c8b2 --- /dev/null +++ b/tests-mx32/mkdir.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mkdir -a20 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-mx32/mkdir.test b/tests-mx32/mkdir.test deleted file mode 100755 index 38ed6928..00000000 --- a/tests-mx32/mkdir.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mkdir syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 diff --git a/tests-mx32/mkdirat.c b/tests-mx32/mkdirat.c index 6bfe4a5f..91bf06be 100644 --- a/tests-mx32/mkdirat.c +++ b/tests-mx32/mkdirat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/mkdirat.gen.test b/tests-mx32/mkdirat.gen.test new file mode 100755 index 00000000..eef8e526 --- /dev/null +++ b/tests-mx32/mkdirat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mkdirat -a28 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-mx32/mkdirat.test b/tests-mx32/mkdirat.test deleted file mode 100755 index 0fcb841a..00000000 --- a/tests-mx32/mkdirat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mkdirat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 diff --git a/tests-mx32/mknod.c b/tests-mx32/mknod.c index 4cc1c5cb..94d80284 100644 --- a/tests-mx32/mknod.c +++ b/tests-mx32/mknod.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -8,7 +15,7 @@ # include # include -static const char sample[] = "mknod"; +static const char *sample; static long call_mknod(unsigned short mode, unsigned long dev) @@ -18,9 +25,10 @@ call_mknod(unsigned short mode, unsigned long dev) } int -main(void) +main(int ac, char **av) { unsigned long dev = (unsigned long) 0xdeadbeefbadc0dedULL; + sample = av[0]; long rc = call_mknod(0, dev); printf("mknod(\"%s\", 000) = %ld %s (%m)\n", @@ -49,7 +57,7 @@ main(void) dev = (unsigned long) 0xdeadbeef00000000ULL | makedev(1, 7); rc = call_mknod(S_IFCHR | 024, dev); - printf("mknod(\"%s\", S_IFCHR|024, makedev(1, 7)) = %ld %s (%m)\n", + printf("mknod(\"%s\", S_IFCHR|024, makedev(0x1, 0x7)) = %ld %s (%m)\n", sample, rc, errno2name()); const unsigned short mode = (0xffff & ~S_IFMT) | S_IFBLK; @@ -57,8 +65,8 @@ main(void) rc = call_mknod(mode, dev); printf("mknod(\"%s\", S_IFBLK|S_ISUID|S_ISGID|S_ISVTX|%#03ho" - ", makedev(%u, %u)) = %ld %s (%m)\n", - sample, mode & ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX), + ", makedev(%#x, %#x)) = %ld %s (%m)\n", + sample, (short) (mode & ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX)), major((unsigned) dev), minor((unsigned) dev), rc, errno2name()); diff --git a/tests-mx32/mknod.gen.test b/tests-mx32/mknod.gen.test new file mode 100755 index 00000000..ce08e99f --- /dev/null +++ b/tests-mx32/mknod.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mknod -a18 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests-mx32/mknod.test b/tests-mx32/mknod.test deleted file mode 100755 index 195f1e33..00000000 --- a/tests-mx32/mknod.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mknod syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a18 diff --git a/tests-mx32/mknodat.c b/tests-mx32/mknodat.c index 756e2771..34b34d80 100644 --- a/tests-mx32/mknodat.c +++ b/tests-mx32/mknodat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -50,7 +57,7 @@ main(void) dev = (unsigned long) 0xdeadbeef00000000ULL | makedev(1, 7); rc = call_mknodat(S_IFCHR | 024, dev); - printf("mknodat(-1, \"%s\", S_IFCHR|024, makedev(1, 7)) = %ld %s (%m)\n", + printf("mknodat(-1, \"%s\", S_IFCHR|024, makedev(0x1, 0x7)) = %ld %s (%m)\n", sample, rc, errno2name()); const unsigned short mode = (0xffff & ~S_IFMT) | S_IFBLK; @@ -58,8 +65,8 @@ main(void) rc = call_mknodat(mode, dev); printf("mknodat(-1, \"%s\", S_IFBLK|S_ISUID|S_ISGID|S_ISVTX|%#03ho" - ", makedev(%u, %u)) = %ld %s (%m)\n", - sample, mode & ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX), + ", makedev(%#x, %#x)) = %ld %s (%m)\n", + sample, (short) (mode & ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX)), major((unsigned) dev), minor((unsigned) dev), rc, errno2name()); diff --git a/tests-mx32/mknodat.gen.test b/tests-mx32/mknodat.gen.test new file mode 100755 index 00000000..dce7d449 --- /dev/null +++ b/tests-mx32/mknodat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mknodat -a35 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests-mx32/mknodat.test b/tests-mx32/mknodat.test deleted file mode 100755 index 1701a368..00000000 --- a/tests-mx32/mknodat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mknodat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a35 diff --git a/tests-mx32/mlock.c b/tests-mx32/mlock.c index 8e9806bd..0f31d20c 100644 --- a/tests-mx32/mlock.c +++ b/tests-mx32/mlock.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/mlock.gen.test b/tests-mx32/mlock.gen.test new file mode 100755 index 00000000..2c8ea5e1 --- /dev/null +++ b/tests-mx32/mlock.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mlock -a20 -e trace=mlock,munlock); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -e trace=mlock,munlock diff --git a/tests-mx32/mlock.test b/tests-mx32/mlock.test deleted file mode 100755 index 9a73a306..00000000 --- a/tests-mx32/mlock.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mlock and munlock syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=mlock,munlock -a20 diff --git a/tests-mx32/mlock2.c b/tests-mx32/mlock2.c index 71a2003e..23f1cd9a 100644 --- a/tests-mx32/mlock2.c +++ b/tests-mx32/mlock2.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/mlock2.gen.test b/tests-mx32/mlock2.gen.test new file mode 100755 index 00000000..ff94eb89 --- /dev/null +++ b/tests-mx32/mlock2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mlock2 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/mlock2.test b/tests-mx32/mlock2.test deleted file mode 100755 index bc412e97..00000000 --- a/tests-mx32/mlock2.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mlock2 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/mlockall.c b/tests-mx32/mlockall.c index 682d070d..20428ce7 100644 --- a/tests-mx32/mlockall.c +++ b/tests-mx32/mlockall.c @@ -1,30 +1,10 @@ /* * Check decoding of mlockall syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/mlockall.gen.test b/tests-mx32/mlockall.gen.test new file mode 100755 index 00000000..59ef67f8 --- /dev/null +++ b/tests-mx32/mlockall.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mlockall -a12 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests-mx32/mlockall.test b/tests-mx32/mlockall.test deleted file mode 100755 index d7a6182d..00000000 --- a/tests-mx32/mlockall.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of mlockall syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a12 diff --git a/tests-mx32/mmap-Xabbrev.c b/tests-mx32/mmap-Xabbrev.c new file mode 100644 index 00000000..b31ce427 --- /dev/null +++ b/tests-mx32/mmap-Xabbrev.c @@ -0,0 +1 @@ +#include "mmap.c" diff --git a/tests-mx32/mmap-Xabbrev.gen.test b/tests-mx32/mmap-Xabbrev.gen.test new file mode 100755 index 00000000..b11a84ff --- /dev/null +++ b/tests-mx32/mmap-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmap-Xabbrev +mmap.test abbrev); do not edit. +set -- abbrev +. "${srcdir=.}/mmap.test" diff --git a/tests-mx32/mmap-Xraw.c b/tests-mx32/mmap-Xraw.c new file mode 100644 index 00000000..ef25c030 --- /dev/null +++ b/tests-mx32/mmap-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "mmap.c" diff --git a/tests-mx32/mmap-Xraw.gen.test b/tests-mx32/mmap-Xraw.gen.test new file mode 100755 index 00000000..3caca91d --- /dev/null +++ b/tests-mx32/mmap-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmap-Xraw +mmap.test raw 14); do not edit. +set -- raw 14 +. "${srcdir=.}/mmap.test" diff --git a/tests-mx32/mmap-Xverbose.c b/tests-mx32/mmap-Xverbose.c new file mode 100644 index 00000000..08e9e305 --- /dev/null +++ b/tests-mx32/mmap-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "mmap.c" diff --git a/tests-mx32/mmap-Xverbose.gen.test b/tests-mx32/mmap-Xverbose.gen.test new file mode 100755 index 00000000..99b41c02 --- /dev/null +++ b/tests-mx32/mmap-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmap-Xverbose +mmap.test verbose); do not edit. +set -- verbose +. "${srcdir=.}/mmap.test" diff --git a/tests-mx32/mmap.c b/tests-mx32/mmap.c index f726f63e..1f6322fe 100644 --- a/tests-mx32/mmap.c +++ b/tests-mx32/mmap.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -57,25 +38,59 @@ main(int ac, char **av) (void) close(0); (void) close(0); +#if XLAT_RAW + printf("%s(NULL, 0, %#x, %#x, 0, 0) = -1 EBADF (%m)\n", + name, PROT_NONE, MAP_FILE); +#elif XLAT_VERBOSE + printf("%s(NULL, 0, %#x /* PROT_NONE */, %#x /* MAP_FILE */, 0, 0) " + "= -1 EBADF (%m)\n", + name, PROT_NONE, MAP_FILE); +#else printf("%s(NULL, 0, PROT_NONE, MAP_FILE, 0, 0) = -1 EBADF (%m)\n", name); +#endif mmap(NULL, 0, PROT_NONE, MAP_FILE, 0, 0); p = mmap(addr, length1, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, fd, offset); if (MAP_FAILED == p) perror_msg_and_fail("mmap"); +#if XLAT_RAW + printf("%s(%p, %lu, %#x, " + "%#x, %d, %#jx) = %p\n", + name, addr, length1, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, fd, uoffset, p); +#elif XLAT_VERBOSE + printf("%s(%p, %lu, %#x /* PROT_READ|PROT_WRITE */, " + "%#x /* MAP_PRIVATE|MAP_ANONYMOUS */, %d, %#jx) = %p\n", + name, addr, length1, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, fd, uoffset, p); +#else printf("%s(%p, %lu, PROT_READ|PROT_WRITE, " "MAP_PRIVATE|MAP_ANONYMOUS, %d, %#jx) = %p\n", name, addr, length1, fd, uoffset, p); +#endif if (msync(p, length1, MS_SYNC)) perror_msg_and_fail("msync"); +#if XLAT_RAW + printf("msync(%p, %lu, %#x) = 0\n", p, length1, MS_SYNC); +#elif XLAT_VERBOSE + printf("msync(%p, %lu, %#x /* MS_SYNC */) = 0\n", p, length1, MS_SYNC); +#else printf("msync(%p, %lu, MS_SYNC) = 0\n", p, length1); +#endif if (mprotect(p, length1, PROT_NONE)) perror_msg_and_fail("mprotect"); +#if XLAT_RAW + printf("mprotect(%p, %lu, %#x) = 0\n", p, length1, PROT_NONE); +#elif XLAT_VERBOSE + printf("mprotect(%p, %lu, %#x /* PROT_NONE */) = 0\n", + p, length1, PROT_NONE); +#else printf("mprotect(%p, %lu, PROT_NONE) = 0\n", p, length1); +#endif addr = mremap(p, length1, length2, 0); if (MAP_FAILED == addr) @@ -86,20 +101,33 @@ main(int ac, char **av) addr + length2); if (MAP_FAILED == p) perror_msg_and_fail("mremap"); +#if XLAT_RAW + printf("mremap(%p, %lu, %lu, %#x, %p) = %p\n", + addr, length2, length3, MREMAP_MAYMOVE | MREMAP_FIXED, + addr + length2, p); +#elif XLAT_VERBOSE + printf("mremap(%p, %lu, %lu, %#x /* MREMAP_MAYMOVE|MREMAP_FIXED */" + ", %p) = %p\n", + addr, length2, length3, MREMAP_MAYMOVE | MREMAP_FIXED, + addr + length2, p); +#else printf("mremap(%p, %lu, %lu, MREMAP_MAYMOVE|MREMAP_FIXED" ", %p) = %p\n", addr, length2, length3, addr + length2, p); - - if (madvise(p, length3, MADV_NORMAL)) - perror_msg_and_fail("madvise"); - printf("madvise(%p, %lu, MADV_NORMAL) = 0\n", p, length3); +#endif if (munmap(p, length3)) perror_msg_and_fail("munmap"); printf("munmap(%p, %lu) = 0\n", p, length3); - if (mlockall(MCL_FUTURE)) - perror_msg_and_fail("mlockall"); - puts("mlockall(MCL_FUTURE) = 0"); + printf("mlockall("); +#if XLAT_RAW + printf("%#x", MCL_FUTURE); +#elif XLAT_VERBOSE + printf("%#x /* MCL_FUTURE */", MCL_FUTURE); +#else + printf("MCL_FUTURE"); +#endif + printf(") = %s\n", sprintrc(mlockall(MCL_FUTURE))); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/mmap.test b/tests-mx32/mmap.test index 0b87114a..a47f0db0 100755 --- a/tests-mx32/mmap.test +++ b/tests-mx32/mmap.test @@ -4,29 +4,10 @@ # syscalls decoding. # # Copyright (c) 2015-2016 Dmitry V. Levin +# Copyright (c) 2015-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -34,15 +15,20 @@ check_prog grep check_prog sed run_prog > /dev/null +xlat_opt="" +[ "$#" -gt 0 ] && xlat_opt="-X$1" +align=20 +[ "$#" -gt 1 ] && align="$2" + syscall= for n in mmap mmap2; do $STRACE -e$n -h > /dev/null && syscall=$syscall,$n done run_strace -e$syscall $args > /dev/null -if grep '^mmap(NULL, 0, PROT_NONE,' < "$LOG" > /dev/null; then +if grep '^mmap(NULL, 0, \(0 /* PROT_NONE */\|0\|PROT_NONE\),' < "$LOG" > /dev/null; then mmap=mmap -elif grep '^mmap2(NULL, 0, PROT_NONE,' < "$LOG" > /dev/null; then +elif grep '^mmap2(NULL, 0, \(0 \/\* PROT_NONE \*\/\|0\|PROT_NONE\),' < "$LOG" > /dev/null; then mmap=mmap2 else dump_log_and_fail_with "mmap/mmap2 not found in $STRACE $args output" @@ -50,9 +36,7 @@ fi syscall=$mmap,madvise,mlockall,mprotect,mremap,msync,munmap -run_prog "./$NAME" $mmap > /dev/null -run_strace -a20 -e$syscall $args > "$EXP" -sed -n "/^$mmap(NULL, 0, PROT_NONE,/,\$p" < "$LOG" > "$OUT" +run_prog "../$NAME" $mmap > /dev/null +run_strace -a$align -e$syscall $xlat_opt $args > "$EXP" +sed -n "/^$mmap(NULL, 0, \(0 \/\* PROT_NONE \*\/\|0\|PROT_NONE\),/,\$p" < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/mmap64-Xabbrev.c b/tests-mx32/mmap64-Xabbrev.c new file mode 100644 index 00000000..cbd77896 --- /dev/null +++ b/tests-mx32/mmap64-Xabbrev.c @@ -0,0 +1 @@ +#include "mmap64.c" diff --git a/tests-mx32/mmap64-Xabbrev.gen.test b/tests-mx32/mmap64-Xabbrev.gen.test new file mode 100755 index 00000000..3e2c94ba --- /dev/null +++ b/tests-mx32/mmap64-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmap64-Xabbrev +mmap.test abbrev); do not edit. +set -- abbrev +. "${srcdir=.}/mmap.test" diff --git a/tests-mx32/mmap64-Xraw.c b/tests-mx32/mmap64-Xraw.c new file mode 100644 index 00000000..f75f235f --- /dev/null +++ b/tests-mx32/mmap64-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "mmap64.c" diff --git a/tests-mx32/mmap64-Xraw.gen.test b/tests-mx32/mmap64-Xraw.gen.test new file mode 100755 index 00000000..7aeed02f --- /dev/null +++ b/tests-mx32/mmap64-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmap64-Xraw +mmap.test raw 14); do not edit. +set -- raw 14 +. "${srcdir=.}/mmap.test" diff --git a/tests-mx32/mmap64-Xverbose.c b/tests-mx32/mmap64-Xverbose.c new file mode 100644 index 00000000..f72513e1 --- /dev/null +++ b/tests-mx32/mmap64-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "mmap64.c" diff --git a/tests-mx32/mmap64-Xverbose.gen.test b/tests-mx32/mmap64-Xverbose.gen.test new file mode 100755 index 00000000..0d675d98 --- /dev/null +++ b/tests-mx32/mmap64-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmap64-Xverbose +mmap.test verbose); do not edit. +set -- verbose +. "${srcdir=.}/mmap.test" diff --git a/tests-mx32/mmap64.gen.test b/tests-mx32/mmap64.gen.test new file mode 100755 index 00000000..0ecd5294 --- /dev/null +++ b/tests-mx32/mmap64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmap64 +mmap.test ); do not edit. +set -- +. "${srcdir=.}/mmap.test" diff --git a/tests-mx32/mmap64.test b/tests-mx32/mmap64.test deleted file mode 100755 index 51f1896e..00000000 --- a/tests-mx32/mmap64.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mmap/mprotect/munmap syscalls decoding. -# Target executable was compiled with -D_FILE_OFFSET_BITS=64. - -. "${srcdir=.}/mmap.test" diff --git a/tests-mx32/mmsg-silent.c b/tests-mx32/mmsg-silent.c index 47d0a504..82e373d2 100644 --- a/tests-mx32/mmsg-silent.c +++ b/tests-mx32/mmsg-silent.c @@ -1,30 +1,10 @@ /* * Check silent decoding of sendmmsg and recvmmsg syscalls. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/mmsg-silent.gen.test b/tests-mx32/mmsg-silent.gen.test new file mode 100755 index 00000000..47863f26 --- /dev/null +++ b/tests-mx32/mmsg-silent.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmsg-silent -a25 -e verbose=none -e trace=sendmmsg,recvmmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 -e verbose=none -e trace=sendmmsg,recvmmsg diff --git a/tests-mx32/mmsg-silent.test b/tests-mx32/mmsg-silent.test deleted file mode 100755 index 775e0ad3..00000000 --- a/tests-mx32/mmsg-silent.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check silent decoding of sendmmsg and recvmmsg syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a25 -e verbose=none -e trace=sendmmsg,recvmmsg diff --git a/tests-mx32/mmsg.c b/tests-mx32/mmsg.c index 88805d16..ab8fdf6e 100644 --- a/tests-mx32/mmsg.c +++ b/tests-mx32/mmsg.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2014 Masatake YAMATO * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -113,14 +94,16 @@ main(void) " | 00000 %-49s %-16s |\n", w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), - ARRAY_SIZE(w0_iov_), + (unsigned int) ARRAY_SIZE(w0_iov_), LENGTH_OF(w0_c) + LENGTH_OF(w1_c), - w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w1_iov_), + w2_c, LENGTH_OF(w2_c), (unsigned int) ARRAY_SIZE(w1_iov_), LENGTH_OF(w2_c), n_w_mmh, r, - ARRAY_SIZE(w0_iov_), LENGTH_OF(w0_c), w0_d, w0_c, + (unsigned int) ARRAY_SIZE(w0_iov_), + LENGTH_OF(w0_c), w0_d, w0_c, LENGTH_OF(w1_c), w1_d, w1_c, - ARRAY_SIZE(w1_iov_), LENGTH_OF(w2_c), w2_d, w2_c); + (unsigned int) ARRAY_SIZE(w1_iov_), + LENGTH_OF(w2_c), w2_d, w2_c); const unsigned int w_len = LENGTH_OF(w0_c) + LENGTH_OF(w1_c) + LENGTH_OF(w2_c); @@ -184,11 +167,14 @@ main(void) " = %u buffers in vector 1\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - r0_c, r_len, ARRAY_SIZE(r0_iov_), LENGTH_OF(r0_c), - r1_c, r_len, r_len, ARRAY_SIZE(r1_iov_), LENGTH_OF(r1_c), + r0_c, r_len, (unsigned int) ARRAY_SIZE(r0_iov_), + LENGTH_OF(r0_c), r1_c, r_len, r_len, + (unsigned int) ARRAY_SIZE(r1_iov_), LENGTH_OF(r1_c), n_r_mmh, r, - ARRAY_SIZE(r0_iov_), LENGTH_OF(r0_c), r0_d, r0_c, - ARRAY_SIZE(r1_iov_), LENGTH_OF(r1_c), r1_d, r1_c); + (unsigned int) ARRAY_SIZE(r0_iov_), LENGTH_OF(r0_c), + r0_d, r0_c, + (unsigned int) ARRAY_SIZE(r1_iov_), LENGTH_OF(r1_c), + r1_d, r1_c); tprintf("+++ exited with 0 +++\n"); return 0; diff --git a/tests-mx32/mmsg.gen.test b/tests-mx32/mmsg.gen.test new file mode 100755 index 00000000..4d90e3d2 --- /dev/null +++ b/tests-mx32/mmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmsg -e read=0 -e write=1 -e trace=recvmmsg,sendmmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e read=0 -e write=1 -e trace=recvmmsg,sendmmsg diff --git a/tests-mx32/mmsg.test b/tests-mx32/mmsg.test deleted file mode 100755 index a8148ba8..00000000 --- a/tests-mx32/mmsg.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check how iovecs in struct mmsghdr are decoded. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=recvmmsg,sendmmsg -e read=0 -e write=1 diff --git a/tests-mx32/mmsg_name-v.gen.test b/tests-mx32/mmsg_name-v.gen.test new file mode 100755 index 00000000..e34946fc --- /dev/null +++ b/tests-mx32/mmsg_name-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmsg_name-v -v -a25 -e trace=sendmmsg,recvmmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -a25 -e trace=sendmmsg,recvmmsg diff --git a/tests-mx32/mmsg_name-v.test b/tests-mx32/mmsg_name-v.test deleted file mode 100755 index ab8dfba6..00000000 --- a/tests-mx32/mmsg_name-v.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# Check verbose decoding of msg_name* fields of struct msghdr array argument -# of sendmmsg and recvmmsg syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -a25 -e trace=sendmmsg,recvmmsg diff --git a/tests-mx32/mmsg_name.c b/tests-mx32/mmsg_name.c index a7a55c55..fce004bb 100644 --- a/tests-mx32/mmsg_name.c +++ b/tests-mx32/mmsg_name.c @@ -3,29 +3,10 @@ * of sendmmsg and recvmmsg syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,8 +21,6 @@ #include "msghdr.h" -#define DEFAULT_STRLEN 32 - #define IOV_MAX1 (IOV_MAX + 1) #ifndef TEST_NAME @@ -77,7 +56,7 @@ print_msghdr(const struct msghdr *const msg, const int user_msg_namelen) } printf("%d, msg_iov=[{iov_base=\"%c\", iov_len=1}]" ", msg_iovlen=1, msg_controllen=0, msg_flags=0}", - (int) msg->msg_namelen, * (char *) msg->msg_iov[0].iov_base); + (int) msg->msg_namelen, *(char *) msg->msg_iov[0].iov_base); } static void @@ -121,9 +100,9 @@ test_mmsg_name(const int send_fd, const int recv_fd) if (i) printf(", "); if (i >= IOV_MAX -# if !VERBOSE +#if !VERBOSE || i >= DEFAULT_STRLEN -# endif +#endif ) { printf("..."); break; @@ -153,7 +132,7 @@ test_mmsg_name(const int send_fd, const int recv_fd) printf("sendmmsg(-1, [{msg_hdr="); print_msghdr(&send_mh[IOV_MAX].msg_hdr, 0); errno = saved_errno; - printf("}, %p], %u, MSG_DONTWAIT) = %d %s (%m)\n", + printf("}, ... /* %p */], %u, MSG_DONTWAIT) = %d %s (%m)\n", &send_mh[IOV_MAX1], 2, rc, errno2name()); rc = send_mmsg(send_fd, send_mh, IOV_MAX1, MSG_DONTWAIT); diff --git a/tests-mx32/mmsg_name.gen.test b/tests-mx32/mmsg_name.gen.test new file mode 100755 index 00000000..ac542946 --- /dev/null +++ b/tests-mx32/mmsg_name.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmsg_name -a25 -e trace=sendmmsg,recvmmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 -e trace=sendmmsg,recvmmsg diff --git a/tests-mx32/mmsg_name.test b/tests-mx32/mmsg_name.test deleted file mode 100755 index e18c9722..00000000 --- a/tests-mx32/mmsg_name.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# Check decoding of msg_name* fields of struct msghdr array argument -# of sendmmsg and recvmmsg syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a25 -e trace=sendmmsg,recvmmsg diff --git a/tests-mx32/modify_ldt.c b/tests-mx32/modify_ldt.c new file mode 100644 index 00000000..78e370e4 --- /dev/null +++ b/tests-mx32/modify_ldt.c @@ -0,0 +1,117 @@ +/* + * Check decoding of modify_ldt syscall. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include + +#if defined __NR_modify_ldt && defined HAVE_STRUCT_USER_DESC + +# include +# include +# include + +# include "print_user_desc.c" + +void +printrc(long rc) +{ +# ifdef __x86_64__ + int err = -rc; + + /* Thanks, long return type of syscall(2) */ + printf("%lld", zero_extend_signed_to_ull(rc)); + + if (err > 0 && err < 0x1000) { + errno = err; + printf(" %s (%m)", errno2name()); + } +# else + printf("%s", sprintrc(rc)); +# endif + + puts(""); +} + +int +main(void) +{ + static const kernel_ulong_t bogus_func = + (kernel_ulong_t) 0xbadc0dedda7a1057ULL; + static const kernel_ulong_t bogus_bytecount = + (kernel_ulong_t) 0xdeadfacefa57beefULL; + + TAIL_ALLOC_OBJECT_CONST_PTR(struct user_desc, us); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, bogus_int); + long rc; + + fill_memory(us, sizeof(*us)); + + rc = syscall(__NR_modify_ldt, 0, 0, 0); + printf("modify_ldt(0, NULL, 0) = "); + printrc(rc); + + rc = syscall(__NR_modify_ldt, bogus_func, (kernel_long_t) -1, + bogus_bytecount); + printf("modify_ldt(%d, %#llx, %llu) = ", + (int) bogus_func, + zero_extend_signed_to_ull((kernel_long_t) -1), + (unsigned long long) bogus_bytecount); + printrc(rc); + + rc = syscall(__NR_modify_ldt, bogus_func, us + 1, 0); + printf("modify_ldt(%d, %p, 0) = ", (int) bogus_func, us + 1); + printrc(rc); + + rc = syscall(__NR_modify_ldt, bogus_func, us, 42); + printf("modify_ldt(%d, %p, 42) = ", (int) bogus_func, us); + printrc(rc); + + rc = syscall(__NR_modify_ldt, bogus_func, us + 1, sizeof(*us)); + printf("modify_ldt(%d, %p, %zu) = ", + (int) bogus_func, us + 1, sizeof(*us)); + printrc(rc); + + /* + * print_user_desc handles entry_number field in a special way for + * get_thread_area syscall, so let's also check here that we don't + * retrieve it accidentally. + */ + rc = syscall(__NR_modify_ldt, bogus_func, bogus_int, sizeof(*us)); + printf("modify_ldt(%d, %p, %zu) = ", + (int) bogus_func, bogus_int, sizeof(*us)); + printrc(rc); + + rc = syscall(__NR_modify_ldt, bogus_func, us, sizeof(*us)); + printf("modify_ldt(%d, ", (int) bogus_func); + print_user_desc(us, NULL); + printf(", %zu) = ", sizeof(*us)); + printrc(rc); + + fill_memory_ex(us, sizeof(*us), 0x55, 80); + us->entry_number = -1; + us->base_addr = 0; + us->limit = 0; + + rc = syscall(__NR_modify_ldt, bogus_func, us, sizeof(*us)); + printf("modify_ldt(%d, ", (int) bogus_func); + print_user_desc(us, "-1"); + printf(", %zu) = ", sizeof(*us)); + printrc(rc); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_modify_ldt && HAVE_STRUCT_USER_DESC"); + +#endif diff --git a/tests-mx32/modify_ldt.gen.test b/tests-mx32/modify_ldt.gen.test new file mode 100755 index 00000000..1a85b067 --- /dev/null +++ b/tests-mx32/modify_ldt.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (modify_ldt -a23 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 diff --git a/tests-mx32/mount-Xabbrev.c b/tests-mx32/mount-Xabbrev.c new file mode 100644 index 00000000..0f6fecde --- /dev/null +++ b/tests-mx32/mount-Xabbrev.c @@ -0,0 +1 @@ +#include "mount.c" diff --git a/tests-mx32/mount-Xabbrev.gen.test b/tests-mx32/mount-Xabbrev.gen.test new file mode 100755 index 00000000..10e261ff --- /dev/null +++ b/tests-mx32/mount-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mount-Xabbrev -a33 -e trace=mount -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -e trace=mount -Xabbrev diff --git a/tests-mx32/mount-Xraw.c b/tests-mx32/mount-Xraw.c new file mode 100644 index 00000000..3aa1f084 --- /dev/null +++ b/tests-mx32/mount-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "mount.c" diff --git a/tests-mx32/mount-Xraw.gen.test b/tests-mx32/mount-Xraw.gen.test new file mode 100755 index 00000000..ce852f88 --- /dev/null +++ b/tests-mx32/mount-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mount-Xraw -a33 -e trace=mount -Xraw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -e trace=mount -Xraw diff --git a/tests-mx32/mount-Xverbose.c b/tests-mx32/mount-Xverbose.c new file mode 100644 index 00000000..0b211c7a --- /dev/null +++ b/tests-mx32/mount-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "mount.c" diff --git a/tests-mx32/mount-Xverbose.gen.test b/tests-mx32/mount-Xverbose.gen.test new file mode 100755 index 00000000..c780070e --- /dev/null +++ b/tests-mx32/mount-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mount-Xverbose -a33 -e trace=mount -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -e trace=mount -Xverbose diff --git a/tests-mx32/mount.c b/tests-mx32/mount.c index cbfe42f8..05bc310d 100644 --- a/tests-mx32/mount.c +++ b/tests-mx32/mount.c @@ -2,29 +2,10 @@ * Check decoding of mount syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,7 +21,34 @@ # define MS_RELATIME (1ul << 21) #endif -#define str_ro_nosuid_nodev_noexec "MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC" +#if XLAT_RAW +# define str_unknown "0x300" +# define str_submount_200 "0x4000200" +# define str_mgc_val "0xc0ed0000" +# define str_remount "0x20" +# define str_bind "0x1000" +# define str_ro_nosuid_nodev_noexec "0xf" +# define str_ro_nosuid_nodev_noexec_relatime "0x20000f" +#elif XLAT_VERBOSE +# define str_unknown "0x300 /* MS_??? */" +# define str_submount_200 "0x4000200 /* MS_SUBMOUNT|0x200 */" +# define str_mgc_val "0xc0ed0000 /* MS_MGC_VAL */" +# define str_remount "0x20 /* MS_REMOUNT */" +# define str_bind "0x1000 /* MS_BIND */" +# define str_ro_nosuid_nodev_noexec \ + "0xf /* MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC */" +# define str_ro_nosuid_nodev_noexec_relatime \ + "0x20000f /* MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_RELATIME */" +#else /* !XLAT_RAW && !XLAT_VERBOSE */ +# define str_unknown "0x300 /* MS_??? */" +# define str_submount_200 "MS_SUBMOUNT|0x200" +# define str_mgc_val "MS_MGC_VAL" +# define str_remount "MS_REMOUNT" +# define str_bind "MS_BIND" +# define str_ro_nosuid_nodev_noexec "MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC" +# define str_ro_nosuid_nodev_noexec_relatime \ + "MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_RELATIME" +#endif /* XLAT_RAW, XLAT_VERBOSE */ int main(void) @@ -49,35 +57,59 @@ main(void) static const char target[] = "mount_target"; static const char fstype[] = "mount_fstype"; static const char data[] = "mount_data"; + TAIL_ALLOC_OBJECT_CONST_PTR(char, bogus); + + bogus[0] = 'a'; + + int rc = mount(NULL, NULL, NULL, 0, NULL); + printf("mount(NULL, NULL, NULL, 0, NULL) = %s\n", + sprintrc(rc)); + + rc = mount(bogus, bogus, bogus, 768, bogus); + printf("mount(%p, %p, %p, %s, %p) = %s\n", + bogus, bogus, bogus, str_unknown, bogus, sprintrc(rc)); - int rc = mount(source, target, fstype, 15, data); - printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", + rc = mount(bogus + 1, bogus + 1, bogus + 1, 0x4000200, bogus + 1); + printf("mount(%p, %p, %p, %s, %p) = %s\n", + bogus + 1, bogus + 1, bogus + 1, str_submount_200, + bogus + 1, sprintrc(rc)); + + rc = mount(source, target, fstype, 15, data); + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %s\n", source, target, fstype, str_ro_nosuid_nodev_noexec, - data, rc, errno2name()); + data, sprintrc(rc)); rc = mount(source, target, fstype, MS_RELATIME | 15, data); - printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %s\n", source, target, fstype, - str_ro_nosuid_nodev_noexec "|MS_RELATIME", - data, rc, errno2name()); + str_ro_nosuid_nodev_noexec_relatime, + data, sprintrc(rc)); rc = mount(source, target, fstype, MS_MGC_VAL, data); - printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", - source, target, fstype, "MS_MGC_VAL", data, rc, errno2name()); + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %s\n", + source, target, fstype, str_mgc_val, data, sprintrc(rc)); rc = mount(source, target, fstype, MS_MGC_VAL | 15, data); - printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %s\n", source, target, fstype, - "MS_MGC_VAL|" str_ro_nosuid_nodev_noexec, - data, rc, errno2name()); + str_mgc_val "|" str_ro_nosuid_nodev_noexec, + data, sprintrc(rc)); + + rc = mount(source, target, NULL, MS_REMOUNT, data); + printf("mount(\"%s\", \"%s\", NULL, %s, \"%s\") = %s\n", + source, target, str_remount, data, sprintrc(rc)); rc = mount(source, target, fstype, MS_REMOUNT, data); - printf("mount(\"%s\", \"%s\", %p, %s, \"%s\") = %d %s (%m)\n", - source, target, fstype, "MS_REMOUNT", data, rc, errno2name()); + printf("mount(\"%s\", \"%s\", %p, %s, \"%s\") = %s\n", + source, target, fstype, str_remount, data, sprintrc(rc)); + + rc = mount(source, target, NULL, MS_BIND, data); + printf("mount(\"%s\", \"%s\", NULL, %s, %p) = %s\n", + source, target, str_bind, data, sprintrc(rc)); - rc = mount(source, target, fstype, MS_BIND, data); - printf("mount(\"%s\", \"%s\", %p, %s, %p) = %d %s (%m)\n", - source, target, fstype, "MS_BIND", data, rc, errno2name()); + rc = mount(source, target, fstype, MS_BIND, NULL); + printf("mount(\"%s\", \"%s\", %p, %s, NULL) = %s\n", + source, target, fstype, str_bind, sprintrc(rc)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/mount.gen.test b/tests-mx32/mount.gen.test new file mode 100755 index 00000000..2a3639c8 --- /dev/null +++ b/tests-mx32/mount.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mount -a33 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 diff --git a/tests-mx32/mount.test b/tests-mx32/mount.test deleted file mode 100755 index 40fdca95..00000000 --- a/tests-mx32/mount.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of mount syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/move_pages-Xabbrev.c b/tests-mx32/move_pages-Xabbrev.c new file mode 100644 index 00000000..d0949884 --- /dev/null +++ b/tests-mx32/move_pages-Xabbrev.c @@ -0,0 +1 @@ +#include "move_pages.c" diff --git a/tests-mx32/move_pages-Xabbrev.gen.test b/tests-mx32/move_pages-Xabbrev.gen.test new file mode 100755 index 00000000..4a17a0db --- /dev/null +++ b/tests-mx32/move_pages-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (move_pages-Xabbrev -s3 -e trace=move_pages -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 -e trace=move_pages -Xabbrev diff --git a/tests-mx32/move_pages-Xraw.c b/tests-mx32/move_pages-Xraw.c new file mode 100644 index 00000000..e9a6cc08 --- /dev/null +++ b/tests-mx32/move_pages-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "move_pages.c" diff --git a/tests-mx32/move_pages-Xraw.gen.test b/tests-mx32/move_pages-Xraw.gen.test new file mode 100755 index 00000000..6465b0f9 --- /dev/null +++ b/tests-mx32/move_pages-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (move_pages-Xraw -s3 -a36 -e trace=move_pages -Xraw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 -a36 -e trace=move_pages -Xraw diff --git a/tests-mx32/move_pages-Xverbose.c b/tests-mx32/move_pages-Xverbose.c new file mode 100644 index 00000000..71fcdee6 --- /dev/null +++ b/tests-mx32/move_pages-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "move_pages.c" diff --git a/tests-mx32/move_pages-Xverbose.gen.test b/tests-mx32/move_pages-Xverbose.gen.test new file mode 100755 index 00000000..15e95c94 --- /dev/null +++ b/tests-mx32/move_pages-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (move_pages-Xverbose -s3 -e trace=move_pages -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 -e trace=move_pages -Xverbose diff --git a/tests-mx32/move_pages.c b/tests-mx32/move_pages.c index f4ccafa2..895c7c6f 100644 --- a/tests-mx32/move_pages.c +++ b/tests-mx32/move_pages.c @@ -2,29 +2,10 @@ * Check decoding of move_pages syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -62,7 +43,7 @@ print_page_array(const void **const pages, break; } } else { - printf("%p", pages + i); + printf("... /* %p */", pages + i); break; } const void *const addr = pages[i]; @@ -98,7 +79,7 @@ print_node_array(const int *const nodes, break; } } else { - printf("%p", nodes + i); + printf("... /* %p */", nodes + i); break; } printf("%d", nodes[i]); @@ -125,8 +106,16 @@ print_status_array(const int *const status, const unsigned long count) if (status[i] >= 0) { printf("%d", status[i]); } else { +# if !XLAT_RAW errno = -status[i]; - printf("%s", errno2name()); +# endif +# if XLAT_RAW + printf("%d", status[i]); +# elif XLAT_VERBOSE + printf("%d /* -%s */", status[i], errno2name()); +# else + printf("-%s", errno2name()); +# endif } } printf("]"); @@ -152,7 +141,13 @@ print_stat_pages(const unsigned long pid, const unsigned long count, } else { print_status_array(status, count); } +# if XLAT_RAW + printf(", 0x2) = %s\n", errstr); +# elif XLAT_VERBOSE + printf(", 0x2 /* MPOL_MF_MOVE */) = %s\n", errstr); +# else /* XLAT_ABBREV */ printf(", MPOL_MF_MOVE) = %s\n", errstr); +# endif } static void @@ -178,7 +173,13 @@ print_move_pages(const unsigned long pid, printf("%p", status); else printf("[]"); +# if XLAT_RAW + printf(", 0x4) = %s\n", errstr); +# elif XLAT_VERBOSE + printf(", 0x4 /* MPOL_MF_MOVE_ALL */) = %s\n", errstr); +# else /* XLAT_ABBREV */ printf(", MPOL_MF_MOVE_ALL) = %s\n", errstr); +# endif } int @@ -190,9 +191,9 @@ main(void) const unsigned page_size = get_page_size(); const void *const page = tail_alloc(page_size); const void *const efault = page + page_size; - const void **pages = tail_alloc(sizeof(*pages)); - int *nodes = tail_alloc(sizeof(*nodes)); - int *status = tail_alloc(sizeof(*status)); + TAIL_ALLOC_OBJECT_VAR_PTR(const void *, pages); + TAIL_ALLOC_OBJECT_VAR_PTR(int, nodes); + TAIL_ALLOC_OBJECT_VAR_PTR(int, status); print_stat_pages(pid, 0, pages, status); print_move_pages(pid, 0, 0, pages, nodes, status); diff --git a/tests-mx32/move_pages.gen.test b/tests-mx32/move_pages.gen.test new file mode 100755 index 00000000..9d472ef9 --- /dev/null +++ b/tests-mx32/move_pages.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (move_pages -s3 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 diff --git a/tests-mx32/move_pages.test b/tests-mx32/move_pages.test deleted file mode 100755 index f9577172..00000000 --- a/tests-mx32/move_pages.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of move_pages syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s3 diff --git a/tests-mx32/mq.c b/tests-mx32/mq.c index 9c2ffc8e..a083e5a1 100644 --- a/tests-mx32/mq.c +++ b/tests-mx32/mq.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2015 Elvira Khabirova * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -37,17 +18,19 @@ # include # include -# define NAME "strace-mq.test" - int -main (void) +main(void) { struct mq_attr attr; (void) close(0); - if (mq_open("/" NAME, O_CREAT, 0700, NULL)) + char *name; + if (asprintf(&name, "/strace-mq-%u.sample", getpid()) < 0) + perror_msg_and_fail("asprintf"); + + if (mq_open(name, O_CREAT, 0700, NULL)) perror_msg_and_skip("mq_open"); - printf("mq_open(\"%s\", O_RDONLY|O_CREAT, 0700, NULL) = 0\n", NAME); + printf("mq_open(\"%s\", O_RDONLY|O_CREAT, 0700, NULL) = 0\n", name + 1); if (mq_getattr(0, &attr)) perror_msg_and_skip("mq_getattr"); @@ -63,9 +46,9 @@ main (void) (long long) attr.mq_maxmsg, (long long) attr.mq_msgsize); - if (mq_unlink("/" NAME)) + if (mq_unlink(name)) perror_msg_and_skip("mq_unlink"); - printf("mq_unlink(\"%s\") = 0\n", NAME); + printf("mq_unlink(\"%s\") = 0\n", name + 1); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/mq.gen.test b/tests-mx32/mq.gen.test new file mode 100755 index 00000000..8be520d6 --- /dev/null +++ b/tests-mx32/mq.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mq -a32 -e trace=mq_getsetattr,mq_open,mq_unlink); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -e trace=mq_getsetattr,mq_open,mq_unlink diff --git a/tests-mx32/mq.test b/tests-mx32/mq.test deleted file mode 100755 index 746b07b7..00000000 --- a/tests-mx32/mq.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of mq_open, mq_getsetattr, and mq_unlink syscalls. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a28 -e trace=mq_getsetattr,mq_open,mq_unlink diff --git a/tests-mx32/mq_sendrecv-read.gen.test b/tests-mx32/mq_sendrecv-read.gen.test new file mode 100755 index 00000000..278e9b7b --- /dev/null +++ b/tests-mx32/mq_sendrecv-read.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mq_sendrecv-read -eread=0 -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -eread=0 -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink diff --git a/tests-mx32/mq_sendrecv-read.test b/tests-mx32/mq_sendrecv-read.test deleted file mode 100755 index eb4ad75e..00000000 --- a/tests-mx32/mq_sendrecv-read.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of mq_open, mq_notify, mq_timedsend, mq_timedreceive syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink -eread=0 -a14 diff --git a/tests-mx32/mq_sendrecv-write.gen.test b/tests-mx32/mq_sendrecv-write.gen.test new file mode 100755 index 00000000..5963eb41 --- /dev/null +++ b/tests-mx32/mq_sendrecv-write.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mq_sendrecv-write -ewrite=0 -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -ewrite=0 -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink diff --git a/tests-mx32/mq_sendrecv-write.test b/tests-mx32/mq_sendrecv-write.test deleted file mode 100755 index 38277ec6..00000000 --- a/tests-mx32/mq_sendrecv-write.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of mq_open, mq_notify, mq_timedsend, mq_timedreceive syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink -ewrite=0 -a14 diff --git a/tests-mx32/mq_sendrecv.c b/tests-mx32/mq_sendrecv.c index c151542c..7af0f36e 100644 --- a/tests-mx32/mq_sendrecv.c +++ b/tests-mx32/mq_sendrecv.c @@ -3,29 +3,10 @@ * mq_unlink syscalls. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,7 +21,6 @@ # include # include # include -# include # include # include # include @@ -49,10 +29,6 @@ # include "sigevent.h" -# ifndef MQ_NAME -# define MQ_NAME "mq_sendrecv.sample" -# endif - # ifndef DUMPIO_READ # define DUMPIO_READ 0 # endif @@ -61,6 +37,7 @@ # define DUMPIO_WRITE 0 # endif +static char *mq_name; enum { NUM_ATTRS = 8, @@ -83,7 +60,7 @@ printstr(unsigned char start, unsigned int count) printf("\""); } -#if DUMPIO_READ || DUMPIO_WRITE +# if DUMPIO_READ || DUMPIO_WRITE static void dumpstr(unsigned char start, unsigned int count) { @@ -117,15 +94,15 @@ dumpstr(unsigned char start, unsigned int count) } } } -#endif /* DUMPIO_READ || DUMPIO_WRITE */ +# endif /* DUMPIO_READ || DUMPIO_WRITE */ static void cleanup(void) { long rc; - rc = syscall(__NR_mq_unlink, MQ_NAME); - printf("mq_unlink(\"" MQ_NAME "\") = %s\n", sprintrc(rc)); + rc = syscall(__NR_mq_unlink, mq_name); + printf("mq_unlink(\"%s\") = %s\n", mq_name, sprintrc(rc)); puts("+++ exited with 0 +++"); } @@ -147,9 +124,9 @@ do_send(int fd, char *msg, unsigned int msg_size, struct timespec *tmout, if (cropped) printf("..."); errno = saved_errno; - printf(", %u, 42, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", msg_size, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, - sprintrc(rc)); + printf(", %u, 42, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", msg_size, + (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); errno = saved_errno; if (rc == -1) { @@ -185,9 +162,9 @@ do_recv(int fd, char *msg, unsigned int msg_size, struct timespec *tmout, printf("%p", msg); } errno = saved_errno; - printf(", %u, [42], {tv_sec=%jd, tv_nsec=%jd}) = %s\n", MSG_SIZE, - (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, sprintrc(rc)); + printf(", %u, [42], {tv_sec=%lld, tv_nsec=%llu}) = %s\n", MSG_SIZE, + (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); errno = saved_errno; if (rc == -1) { @@ -230,7 +207,7 @@ main(void) static const struct timespec future_tmout_data = { .tv_sec = (time_t) 0x7ea1fade7e57faceLL, .tv_nsec = 999999999, - };; + }; struct_sigevent bogus_sev_data = { .sigev_notify = 0xdefaced, .sigev_signo = 0xfacefeed, @@ -242,7 +219,7 @@ main(void) kernel_long_t *bogus_attrs = tail_alloc(sizeof(*bogus_attrs) * NUM_ATTRS); char *msg = tail_alloc(MSG_SIZE); - unsigned *bogus_prio_ptr = tail_alloc(sizeof(*bogus_prio_ptr)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned, bogus_prio_ptr); struct timespec *bogus_tmout = tail_memdup(&bogus_tmout_data, sizeof(*bogus_tmout)); struct timespec *future_tmout = tail_memdup(&future_tmout_data, @@ -278,8 +255,8 @@ main(void) /* Valid attributes structure */ rc = syscall(__NR_mq_open, msg, O_CREAT | bogus_oflags, bogus_mode, bogus_attrs); - printf("mq_open(%p, O_ACCMODE|O_CREAT, %#o, {mq_flags=%#llx, " - "mq_maxmsg=%lld, mq_msgsize=%lld, mq_curmsgs=%lld}) = %s\n", + printf("mq_open(%p, O_ACCMODE|O_CREAT, %#o, {mq_flags=%#llx" + ", mq_maxmsg=%lld, mq_msgsize=%lld, mq_curmsgs=%lld}) = %s\n", msg, (unsigned short) bogus_mode, (unsigned long long) (kernel_ulong_t) bogus_attrs[0], (long long) bogus_attrs[1], @@ -304,12 +281,12 @@ main(void) /* Partially invalid message (memory only partially available) */ rc = syscall(__NR_mq_timedsend, bogus_fd, msg + MSG_SIZE - MSG_CUT, MSG_SIZE, bogus_prio, bogus_tmout); - printf("mq_timedsend(%d, %p, %llu, %u, {tv_sec=%jd, tv_nsec=%jd}) = " - "%s\n", + printf("mq_timedsend(%d, %p, %llu, %u, {tv_sec=%lld, tv_nsec=%llu})" + " = %s\n", (int) bogus_fd, msg + MSG_SIZE - MSG_CUT, (unsigned long long) MSG_SIZE, (unsigned) bogus_prio, - (intmax_t) bogus_tmout->tv_sec, (intmax_t) bogus_tmout->tv_nsec, - sprintrc(rc)); + (long long) bogus_tmout->tv_sec, + zero_extend_signed_to_ull(bogus_tmout->tv_nsec), sprintrc(rc)); /* Fully valid message, uncut */ rc = syscall(__NR_mq_timedsend, bogus_fd, msg + MSG_SIZE - MSG_CUT, @@ -317,10 +294,10 @@ main(void) errstr = sprintrc(rc); printf("mq_timedsend(%d, ", (int) bogus_fd); printstr(MSG_START + MSG_SIZE - MSG_CUT, MSG_CUT); - printf(", %llu, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + printf(", %llu, %u, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", (unsigned long long) MSG_CUT, (unsigned) bogus_prio, - (intmax_t) bogus_tmout->tv_sec, (intmax_t) bogus_tmout->tv_nsec, - errstr); + (long long) bogus_tmout->tv_sec, + zero_extend_signed_to_ull(bogus_tmout->tv_nsec), errstr); /* Partially invalid message, cut at maxstrlen */ rc = syscall(__NR_mq_timedsend, bogus_fd, msg + MSG_CUT, MSG_SIZE, @@ -328,10 +305,10 @@ main(void) errstr = sprintrc(rc); printf("mq_timedsend(%d, ", (int) bogus_fd); printstr(MSG_START + MSG_CUT, MSG_MAX_UNCUT); - printf("..., %llu, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + printf("..., %llu, %u, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", (unsigned long long) MSG_SIZE, (unsigned) bogus_prio, - (intmax_t) bogus_tmout->tv_sec, (intmax_t) bogus_tmout->tv_nsec, - errstr); + (long long) bogus_tmout->tv_sec, + zero_extend_signed_to_ull(bogus_tmout->tv_nsec), errstr); /* mq_timedreceive */ @@ -351,11 +328,11 @@ main(void) /* Invalid fd, valid msg pointer */ rc = syscall(__NR_mq_timedreceive, bogus_fd, msg, bogus_size, bogus_prio_ptr, bogus_tmout); - printf("mq_timedreceive(%d, %p, %llu, %p, {tv_sec=%jd, tv_nsec=%jd}) = " - "%s\n", + printf("mq_timedreceive(%d, %p, %llu, %p, {tv_sec=%lld, tv_nsec=%llu}) " + "= %s\n", (int) bogus_fd, msg, (unsigned long long) bogus_size, - bogus_prio_ptr, (intmax_t) bogus_tmout->tv_sec, - (intmax_t) bogus_tmout->tv_nsec, sprintrc(rc)); + bogus_prio_ptr, (long long) bogus_tmout->tv_sec, + zero_extend_signed_to_ull(bogus_tmout->tv_nsec), sprintrc(rc)); /* mq_notify */ @@ -381,8 +358,8 @@ main(void) /* SIGEV_NONE */ bogus_sev->sigev_notify = SIGEV_NONE; rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); - printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}, " - "sigev_signo=%u, sigev_notify=SIGEV_NONE}) = %s\n", + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}" + ", sigev_signo=%u, sigev_notify=SIGEV_NONE}) = %s\n", (int) bogus_fd, bogus_sev->sigev_value.sival_int, bogus_sev->sigev_value.sival_ptr, bogus_sev->sigev_signo, sprintrc(rc)); @@ -391,8 +368,8 @@ main(void) bogus_sev->sigev_notify = SIGEV_SIGNAL; bogus_sev->sigev_signo = SIGALRM; rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); - printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}, " - "sigev_signo=SIGALRM, sigev_notify=SIGEV_SIGNAL}) = %s\n", + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}" + ", sigev_signo=SIGALRM, sigev_notify=SIGEV_SIGNAL}) = %s\n", (int) bogus_fd, bogus_sev->sigev_value.sival_int, bogus_sev->sigev_value.sival_ptr, sprintrc(rc)); @@ -403,10 +380,10 @@ main(void) bogus_sev->sigev_un.sigev_thread.attribute = (unsigned long) 0xcafef00dfacefeedULL; rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); - printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}, " - "sigev_signo=SIGALRM, sigev_notify=SIGEV_THREAD, " - "sigev_notify_function=%#lx, sigev_notify_attributes=%#lx}) = " - "%s\n", + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}" + ", sigev_signo=SIGALRM, sigev_notify=SIGEV_THREAD" + ", sigev_notify_function=%#lx, sigev_notify_attributes=%#lx})" + " = %s\n", (int) bogus_fd, bogus_sev->sigev_value.sival_int, bogus_sev->sigev_value.sival_ptr, bogus_sev->sigev_un.sigev_thread.function, @@ -430,13 +407,16 @@ main(void) /* Sending and receiving test */ + if (asprintf(&mq_name, "strace-mq_sendrecv-%u.sample", getpid()) < 0) + perror_msg_and_fail("asprintf"); + # if DUMPIO_READ || DUMPIO_WRITE close(0); # endif bogus_attrs[1] = 2; bogus_attrs[2] = MSG_SIZE; - fd = rc = syscall(__NR_mq_open, MQ_NAME, - O_CREAT|O_RDWR|O_NONBLOCK, S_IRWXU, bogus_attrs); + fd = rc = syscall(__NR_mq_open, mq_name, + O_CREAT|O_RDWR|O_NONBLOCK, S_IRWXU, bogus_attrs); errstr = sprintrc(rc); if (rc < 0) perror_msg_and_skip("mq_open"); @@ -448,11 +428,11 @@ main(void) # endif fill_memory_ex(bogus_attrs, sizeof(*bogus_attrs) * NUM_ATTRS, 0xbb, 0x70); - printf("mq_open(\"" MQ_NAME "\", O_RDWR|O_CREAT|O_NONBLOCK, " - "0700, {mq_flags=%#llx, mq_maxmsg=2, mq_msgsize=%u, " - "mq_curmsgs=%lld}) = %s\n", - (unsigned long long) (kernel_ulong_t) bogus_attrs[0], MSG_SIZE, - (long long) bogus_attrs[3], errstr); + printf("mq_open(\"%s\", O_RDWR|O_CREAT|O_NONBLOCK, 0700" + ", {mq_flags=%#llx, mq_maxmsg=2, mq_msgsize=%u" + ", mq_curmsgs=%lld}) = %s\n", + mq_name, (unsigned long long) (kernel_ulong_t) bogus_attrs[0], + MSG_SIZE, (long long) bogus_attrs[3], errstr); rc = syscall(__NR_mq_getsetattr, fd, NULL, bogus_attrs); if (rc < 0) diff --git a/tests-mx32/mq_sendrecv.gen.test b/tests-mx32/mq_sendrecv.gen.test new file mode 100755 index 00000000..d82576f9 --- /dev/null +++ b/tests-mx32/mq_sendrecv.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mq_sendrecv -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink diff --git a/tests-mx32/mq_sendrecv.test b/tests-mx32/mq_sendrecv.test deleted file mode 100755 index 67f4d63c..00000000 --- a/tests-mx32/mq_sendrecv.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of mq_open, mq_notify, mq_timedsend, mq_timedreceive syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink -a14 diff --git a/tests-mx32/msg_control-v.gen.test b/tests-mx32/msg_control-v.gen.test new file mode 100755 index 00000000..0a0de15e --- /dev/null +++ b/tests-mx32/msg_control-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (msg_control-v -v -a21 -e trace=sendmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -a21 -e trace=sendmsg diff --git a/tests-mx32/msg_control-v.test b/tests-mx32/msg_control-v.test deleted file mode 100755 index 41f98428..00000000 --- a/tests-mx32/msg_control-v.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check verbose decoding of struct msghdr ancillary data. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -a21 -e trace=sendmsg diff --git a/tests-mx32/msg_control.c b/tests-mx32/msg_control.c index 709a3075..a4a32a88 100644 --- a/tests-mx32/msg_control.c +++ b/tests-mx32/msg_control.c @@ -2,29 +2,10 @@ * Check decoding of struct msghdr ancillary data. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -39,6 +20,17 @@ #include #include +#if defined HAVE_STRUCT___KERNEL_SOCK_TIMEVAL \ + || defined HAVE_STRUCT___KERNEL_TIMESPEC +# include +#endif + +#include "xlat.h" +#define XLAT_MACROS_ONLY +#include "xlat/sock_options.h" +#include "xlat/scmvals.h" +#undef XLAT_MACROS_ONLY + #ifndef SOL_IP # define SOL_IP 0 #endif @@ -46,10 +38,6 @@ # define SOL_TCP 6 #endif -#ifndef SCM_SECURITY -# define SCM_SECURITY 3 -#endif - #define MIN_SIZE_OF(type, member) \ (offsetof(type, member) + sizeof(((type *) 0)->member)) @@ -59,8 +47,6 @@ get_cmsghdr(void *const page, const size_t len) return page - CMSG_ALIGN(len); } -#define DEFAULT_STRLEN 32 - static void print_fds(const struct cmsghdr *const cmsg, const size_t cmsg_len) { @@ -130,7 +116,7 @@ test_scm_rights1(struct msghdr *const mh, print_fds(cmsg, src_len); printf("}"); if (aligned_cms_len < msg_controllen) - printf(", %p", (void *) cmsg + aligned_cms_len); + printf(", ... /* %p */", (void *) cmsg + aligned_cms_len); printf("]"); } @@ -193,7 +179,7 @@ test_scm_rights2(struct msghdr *const mh, print_fds(cmsg[1], src1_len); printf("}"); if (aligned_cms_len[1] < msg_controllen1) - printf(", %p", (void *) cmsg[1] + aligned_cms_len[1]); + printf(", ... /* %p */", (void *) cmsg[1] + aligned_cms_len[1]); printf("]"); errno = saved_errno; @@ -228,6 +214,308 @@ test_scm_rights3(struct msghdr *const mh, void *const page, const size_t nfds) (unsigned long) len, rc, errno2name()); } +static void +test_scm_timestamp_old(struct msghdr *const mh, void *const page) +{ + size_t len = CMSG_SPACE(sizeof(struct timeval)); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct timeval)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMP_OLD; + struct timeval *tv = (struct timeval *) CMSG_DATA(cmsg); + tv->tv_sec = 123456789; + tv->tv_usec = 987654; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMP_OLD" + ", cmsg_data={tv_sec=%lld, tv_usec=%llu}}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, + (long long) tv->tv_sec, zero_extend_signed_to_ull(tv->tv_usec), + (unsigned long) len, rc, errno2name()); + + len = CMSG_SPACE(sizeof(struct timeval) - sizeof(long)); + cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct timeval) - sizeof(long)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMP_OLD; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMP_OLD, cmsg_data=?}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, + (unsigned long) len, rc, errno2name()); +} + +static void +test_scm_timestampns_old(struct msghdr *const mh, void *const page) +{ + size_t len = CMSG_SPACE(sizeof(struct timespec)); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct timespec)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPNS_OLD; + struct timespec *ts = (struct timespec *) CMSG_DATA(cmsg); + ts->tv_sec = 123456789; + ts->tv_nsec = 987654321; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPNS_OLD" + ", cmsg_data={tv_sec=%lld, tv_nsec=%llu}}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, + (long long) ts->tv_sec, zero_extend_signed_to_ull(ts->tv_nsec), + (unsigned long) len, rc, errno2name()); + + len = CMSG_SPACE(sizeof(struct timespec) - sizeof(long)); + cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct timespec) - sizeof(long)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPNS_OLD; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPNS_OLD" + ", cmsg_data=?}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, + (unsigned long) len, rc, errno2name()); +} + +static void +test_scm_timestamping_old(struct msghdr *const mh, void *const page) +{ + size_t len = CMSG_SPACE(3 * sizeof(struct timespec)); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(3 * sizeof(struct timespec)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPING_OLD; + struct timespec *ts = (struct timespec *) CMSG_DATA(cmsg); + ts[0].tv_sec = 123456789; + ts[0].tv_nsec = 987654321; + ts[1].tv_sec = 123456790; + ts[1].tv_nsec = 987654320; + ts[2].tv_sec = 123456791; + ts[2].tv_nsec = 987654319; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPING_OLD" + ", cmsg_data=[{tv_sec=%lld, tv_nsec=%llu}" + ", {tv_sec=%lld, tv_nsec=%llu}, {tv_sec=%lld, tv_nsec=%llu}]}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, (long long) ts[0].tv_sec, + zero_extend_signed_to_ull(ts[0].tv_nsec), + (long long) ts[1].tv_sec, + zero_extend_signed_to_ull(ts[1].tv_nsec), + (long long) ts[2].tv_sec, + zero_extend_signed_to_ull(ts[2].tv_nsec), + (unsigned long) len, rc, errno2name()); + + len = CMSG_SPACE(3 * sizeof(struct timespec) - sizeof(long)); + cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(3 * sizeof(struct timespec) - sizeof(long)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPING_OLD; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPING_OLD" + ", cmsg_data=?}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, + (unsigned long) len, rc, errno2name()); +} + +#ifdef HAVE_STRUCT___KERNEL_SOCK_TIMEVAL +static void +test_scm_timestamp_new(struct msghdr *const mh, void *const page) +{ + size_t len = CMSG_SPACE(sizeof(struct __kernel_sock_timeval)); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct __kernel_sock_timeval)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMP_NEW; + struct __kernel_sock_timeval *tv = + (struct __kernel_sock_timeval *) CMSG_DATA(cmsg); + tv->tv_sec = 0xdefaceddeadbeef; + tv->tv_usec = 0xdec0dedcafef00d; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMP_NEW" + ", cmsg_data={tv_sec=%lld, tv_usec=%llu}}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %s\n", + (unsigned) cmsg->cmsg_len, + (long long) tv->tv_sec, zero_extend_signed_to_ull(tv->tv_usec), + (unsigned long) len, sprintrc(rc)); + + len = CMSG_SPACE(sizeof(struct __kernel_sock_timeval) - sizeof(long)); + cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = + CMSG_LEN(sizeof(struct __kernel_sock_timeval) - sizeof(long)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMP_NEW; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMP_NEW, cmsg_data=?}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %s\n", + (unsigned) cmsg->cmsg_len, + (unsigned long) len, sprintrc(rc)); +} +#endif /* HAVE_STRUCT___KERNEL_SOCK_TIMEVAL */ + +#ifdef HAVE_STRUCT___KERNEL_TIMESPEC +static void +test_scm_timestampns_new(struct msghdr *const mh, void *const page) +{ + size_t len = CMSG_SPACE(sizeof(struct __kernel_timespec)); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct __kernel_timespec)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPNS_NEW; + struct __kernel_timespec *ts = + (struct __kernel_timespec *) CMSG_DATA(cmsg); + ts->tv_sec = 0xdefaceddeadbeef; + ts->tv_nsec = 0xdec0dedcafef00d; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPNS_NEW" + ", cmsg_data={tv_sec=%lld, tv_nsec=%llu}}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %s\n", + (unsigned) cmsg->cmsg_len, + (long long) ts->tv_sec, zero_extend_signed_to_ull(ts->tv_nsec), + (unsigned long) len, sprintrc(rc)); + + len = CMSG_SPACE(sizeof(struct __kernel_timespec) - sizeof(long)); + cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = + CMSG_LEN(sizeof(struct __kernel_timespec) - sizeof(long)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPNS_NEW; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPNS_NEW" + ", cmsg_data=?}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %s\n", + (unsigned) cmsg->cmsg_len, + (unsigned long) len, sprintrc(rc)); +} + +static void +test_scm_timestamping_new(struct msghdr *const mh, void *const page) +{ + size_t len = CMSG_SPACE(3 * sizeof(struct __kernel_timespec)); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(3 * sizeof(struct __kernel_timespec)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPING_NEW; + struct __kernel_timespec *ts = + (struct __kernel_timespec *) CMSG_DATA(cmsg); + ts[0].tv_sec = 0xdeface0deadbef1; + ts[0].tv_nsec = 0xdec0de2cafef0d3; + ts[1].tv_sec = 0xdeface4deadbef5; + ts[1].tv_nsec = 0xdec0de6cafef0d7; + ts[2].tv_sec = 0xdeface8deadbef9; + ts[2].tv_nsec = 0xdec0dedcafef00d; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPING_NEW" + ", cmsg_data=[{tv_sec=%lld, tv_nsec=%llu}" + ", {tv_sec=%lld, tv_nsec=%llu}, {tv_sec=%lld, tv_nsec=%llu}]}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %s\n", + (unsigned) cmsg->cmsg_len, (long long) ts[0].tv_sec, + zero_extend_signed_to_ull(ts[0].tv_nsec), + (long long) ts[1].tv_sec, + zero_extend_signed_to_ull(ts[1].tv_nsec), + (long long) ts[2].tv_sec, + zero_extend_signed_to_ull(ts[2].tv_nsec), + (unsigned long) len, sprintrc(rc)); + + len = CMSG_SPACE(3 * sizeof(struct __kernel_timespec) - sizeof(long)); + cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = + CMSG_LEN(3 * sizeof(struct __kernel_timespec) - sizeof(long)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPING_NEW; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPING_NEW" + ", cmsg_data=?}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %s\n", + (unsigned) cmsg->cmsg_len, + (unsigned long) len, sprintrc(rc)); +} +#endif /* HAVE_STRUCT___KERNEL_TIMESPEC */ + static void print_security(const struct cmsghdr *const cmsg, const size_t cmsg_len) { @@ -277,7 +565,7 @@ test_scm_security(struct msghdr *const mh, print_security(cmsg, src_len); printf("}"); if (aligned_cms_len < msg_controllen) - printf(", %p", (void *) cmsg + aligned_cms_len); + printf(", ... /* %p */", (void *) cmsg + aligned_cms_len); printf("]"); errno = saved_errno; @@ -377,12 +665,23 @@ test_sol_socket(struct msghdr *const mh, void *const page) test_scm_rights3(mh, page, DEFAULT_STRLEN); test_scm_rights3(mh, page, DEFAULT_STRLEN + 1); + test_scm_timestamp_old(mh, page); + test_scm_timestampns_old(mh, page); + test_scm_timestamping_old(mh, page); +#ifdef HAVE_STRUCT___KERNEL_SOCK_TIMEVAL + test_scm_timestamp_new(mh, page); +#endif +#ifdef HAVE_STRUCT___KERNEL_TIMESPEC + test_scm_timestampns_new(mh, page); + test_scm_timestamping_new(mh, page); +#endif + test_unknown_type(mh, page, ARG_STR(SOL_SOCKET), "SCM_???"); } static void test_ip_pktinfo(struct msghdr *const mh, void *const page, - const int cmsg_type, const char *const cmsg_type_str) + const int cmsg_type, const char *const cmsg_type_str) { const unsigned int len = CMSG_SPACE(sizeof(struct in_pktinfo)); struct cmsghdr *const cmsg = get_cmsghdr(page, len); @@ -392,11 +691,7 @@ test_ip_pktinfo(struct msghdr *const mh, void *const page, cmsg->cmsg_type = cmsg_type; struct in_pktinfo *const info = (struct in_pktinfo *) CMSG_DATA(cmsg); -#ifdef HAVE_IF_INDEXTONAME - info->ipi_ifindex = if_nametoindex("lo"); -#else - info->ipi_ifindex = 1; -#endif + info->ipi_ifindex = ifindex_lo(); info->ipi_spec_dst.s_addr = inet_addr("1.2.3.4"); info->ipi_addr.s_addr = inet_addr("5.6.7.8"); @@ -411,12 +706,7 @@ test_ip_pktinfo(struct msghdr *const mh, void *const page, ", ipi_addr=inet_addr(\"%s\")}}]" ", msg_controllen=%u, msg_flags=0}, 0) = %d %s (%m)\n", (unsigned) cmsg->cmsg_len, cmsg_type_str, -#ifdef HAVE_IF_INDEXTONAME - "if_nametoindex(\"lo\")", -#else - "1", -#endif - "1.2.3.4", "5.6.7.8", len, rc, errno2name()); + IFINDEX_LO_STR, "1.2.3.4", "5.6.7.8", len, rc, errno2name()); } static void @@ -447,7 +737,7 @@ test_ip_uint(struct msghdr *const mh, void *const page, static void test_ip_uint8_t(struct msghdr *const mh, void *const page, - const int cmsg_type, const char *const cmsg_type_str) + const int cmsg_type, const char *const cmsg_type_str) { const unsigned int len = CMSG_SPACE(1); struct cmsghdr *const cmsg = get_cmsghdr(page, len); @@ -529,7 +819,7 @@ struct sock_ee { static void test_ip_recverr(struct msghdr *const mh, void *const page, - const int cmsg_type, const char *const cmsg_type_str) + const int cmsg_type, const char *const cmsg_type_str) { const unsigned int len = CMSG_SPACE(sizeof(struct sock_ee)); struct cmsghdr *const cmsg = get_cmsghdr(page, len); @@ -689,7 +979,7 @@ int main(int ac, const char **av) int rc = sendmsg(-1, 0, 0); printf("sendmsg(-1, NULL, 0) = %d %s (%m)\n", rc, errno2name()); - struct msghdr *mh = tail_alloc(sizeof(*mh)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct msghdr, mh); memset(mh, 0, sizeof(*mh)); test_big_len(mh); diff --git a/tests-mx32/msg_control.gen.test b/tests-mx32/msg_control.gen.test new file mode 100755 index 00000000..446ebcb3 --- /dev/null +++ b/tests-mx32/msg_control.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (msg_control -a21 -e trace=sendmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 -e trace=sendmsg diff --git a/tests-mx32/msg_control.test b/tests-mx32/msg_control.test deleted file mode 100755 index 809ec7bb..00000000 --- a/tests-mx32/msg_control.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of struct msghdr ancillary data. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a21 -e trace=sendmsg diff --git a/tests-mx32/msg_name.c b/tests-mx32/msg_name.c index c2ddda2a..d4973e08 100644 --- a/tests-mx32/msg_name.c +++ b/tests-mx32/msg_name.c @@ -2,29 +2,10 @@ * Check decoding of struct msghdr.msg_name* arguments of recvmsg syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -47,13 +28,13 @@ send_recv(const int send_fd, const int recv_fd, static void test_msg_name(const int send_fd, const int recv_fd) { - char *const recv_buf = tail_alloc(sizeof(*recv_buf)); - struct iovec *const iov = tail_alloc(sizeof(*iov)); + TAIL_ALLOC_OBJECT_CONST_PTR(char, recv_buf); + TAIL_ALLOC_OBJECT_CONST_PTR(struct iovec, iov); iov->iov_base = recv_buf; iov->iov_len = sizeof(*recv_buf); - struct sockaddr_un *const addr = tail_alloc(sizeof(*addr)); - struct msghdr *const msg = tail_alloc(sizeof(*msg)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sockaddr_un, addr); + TAIL_ALLOC_OBJECT_CONST_PTR(struct msghdr, msg); msg->msg_name = addr; msg->msg_namelen = sizeof(*addr); msg->msg_iov = iov; diff --git a/tests-mx32/msg_name.gen.test b/tests-mx32/msg_name.gen.test new file mode 100755 index 00000000..2d0ae902 --- /dev/null +++ b/tests-mx32/msg_name.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (msg_name -a20 -e trace=recvmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -e trace=recvmsg diff --git a/tests-mx32/msg_name.test b/tests-mx32/msg_name.test deleted file mode 100755 index ac06dd55..00000000 --- a/tests-mx32/msg_name.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of struct msghdr.msg_name* arguments of recvmsg syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 -e trace=recvmsg diff --git a/tests-mx32/munlockall.c b/tests-mx32/munlockall.c index 9ac69423..0f103c8f 100644 --- a/tests-mx32/munlockall.c +++ b/tests-mx32/munlockall.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -6,7 +13,7 @@ int main(void) { - printf("munlockall() = %d\n", munlockall()); + printf("munlockall() = %s\n", sprintrc(munlockall())); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/munlockall.gen.test b/tests-mx32/munlockall.gen.test new file mode 100755 index 00000000..2e4e0c4f --- /dev/null +++ b/tests-mx32/munlockall.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (munlockall -a13 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 diff --git a/tests-mx32/munlockall.test b/tests-mx32/munlockall.test deleted file mode 100755 index e25d60a8..00000000 --- a/tests-mx32/munlockall.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check munlockall syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a13 diff --git a/tests-mx32/nanosleep.c b/tests-mx32/nanosleep.c index 9f0e626f..c7ebf496 100644 --- a/tests-mx32/nanosleep.c +++ b/tests-mx32/nanosleep.c @@ -1,28 +1,11 @@ /* + * Check decoding of nanosleep syscall. + * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -57,40 +40,62 @@ main(void) if (nanosleep(&req.ts, NULL)) perror_msg_and_fail("nanosleep"); - printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, NULL) = 0\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec); + printf("nanosleep({tv_sec=%lld, tv_nsec=%llu}, NULL) = 0\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec)); assert(nanosleep(NULL, &rem.ts) == -1); printf("nanosleep(NULL, %p) = -1 EFAULT (%m)\n", &rem.ts); if (nanosleep(&req.ts, &rem.ts)) perror_msg_and_fail("nanosleep"); - printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, %p) = 0\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + printf("nanosleep({tv_sec=%lld, tv_nsec=%llu}, %p) = 0\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); req.ts.tv_nsec = 1000000000; assert(nanosleep(&req.ts, &rem.ts) == -1); - printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, %p) = -1 EINVAL (%m)\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + printf("nanosleep({tv_sec=%lld, tv_nsec=%llu}, %p) = -1 EINVAL (%m)\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); + + req.ts.tv_sec = 0xdeadbeefU; + req.ts.tv_nsec = 0xfacefeedU; + assert(nanosleep(&req.ts, &rem.ts) == -1); + printf("nanosleep({tv_sec=%lld, tv_nsec=%llu}, %p) = -1 EINVAL (%m)\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); + + req.ts.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + req.ts.tv_nsec = (long) 0xbadc0dedfacefeedLL; + assert(nanosleep(&req.ts, &rem.ts) == -1); + printf("nanosleep({tv_sec=%lld, tv_nsec=%llu}, %p) = -1 EINVAL (%m)\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); + + req.ts.tv_sec = -1; + req.ts.tv_nsec = -1; + assert(nanosleep(&req.ts, &rem.ts) == -1); + printf("nanosleep({tv_sec=%lld, tv_nsec=%llu}, %p) = -1 EINVAL (%m)\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); assert(sigaction(SIGALRM, &act, NULL) == 0); assert(sigprocmask(SIG_SETMASK, &set, NULL) == 0); if (setitimer(ITIMER_REAL, &itv, NULL)) perror_msg_and_skip("setitimer"); - printf("setitimer(ITIMER_REAL, {it_interval={tv_sec=%jd, tv_usec=%jd}" - ", it_value={tv_sec=%jd, tv_usec=%jd}}, NULL) = 0\n", - (intmax_t) itv.it_interval.tv_sec, - (intmax_t) itv.it_interval.tv_usec, - (intmax_t) itv.it_value.tv_sec, - (intmax_t) itv.it_value.tv_usec); + req.ts.tv_sec = 0; req.ts.tv_nsec = 999999999; assert(nanosleep(&req.ts, &rem.ts) == -1); - printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, {tv_sec=%jd, tv_nsec=%jd})" + printf("nanosleep({tv_sec=%lld, tv_nsec=%llu}" + ", {tv_sec=%lld, tv_nsec=%llu})" " = ? ERESTART_RESTARTBLOCK (Interrupted by signal)\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, - (intmax_t) rem.ts.tv_sec, (intmax_t) rem.ts.tv_nsec); + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), + (long long) rem.ts.tv_sec, + zero_extend_signed_to_ull(rem.ts.tv_nsec)); puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); puts("+++ exited with 0 +++"); diff --git a/tests-mx32/nanosleep.gen.test b/tests-mx32/nanosleep.gen.test new file mode 100755 index 00000000..41928ded --- /dev/null +++ b/tests-mx32/nanosleep.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nanosleep -a20 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-mx32/nanosleep.test b/tests-mx32/nanosleep.test deleted file mode 100755 index 055a8dcd..00000000 --- a/tests-mx32/nanosleep.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check nanosleep and setitimer syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 -e trace=nanosleep,setitimer diff --git a/tests-mx32/net-accept-connect.c b/tests-mx32/net-accept-connect.c index 04c05a60..326cd8c1 100644 --- a/tests-mx32/net-accept-connect.c +++ b/tests-mx32/net-accept-connect.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2013-2016 Dmitry V. Levin + * Copyright (c) 2013-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -48,15 +29,16 @@ main(int ac, const char **av) struct sockaddr_un addr = { .sun_family = AF_UNIX, }; - socklen_t len; assert(ac == 2); - assert(strlen(av[1]) > 0); + socklen_t len = strlen(av[1]); + assert(len > 0 && len <= sizeof(addr.sun_path)); - strncpy(addr.sun_path, av[1], sizeof(addr.sun_path)); - len = offsetof(struct sockaddr_un, sun_path) + strlen(av[1]) + 1; - if (len > sizeof(addr)) - len = sizeof(addr); + if (++len > sizeof(addr.sun_path)) + len = sizeof(addr.sun_path); + + memcpy(addr.sun_path, av[1], len); + len += offsetof(struct sockaddr_un, sun_path); unlink(av[1]); close(0); @@ -69,7 +51,7 @@ main(int ac, const char **av) if (listen(0, 5)) perror_msg_and_skip("listen"); - memset(&addr, 0, sizeof addr); + memset(&addr, 0, sizeof(addr)); assert(getsockname(0, (struct sockaddr *) &addr, &len) == 0); if (len > sizeof(addr)) len = sizeof(addr); diff --git a/tests-mx32/net-icmp_filter.c b/tests-mx32/net-icmp_filter.c index f3f99f14..81b24293 100644 --- a/tests-mx32/net-icmp_filter.c +++ b/tests-mx32/net-icmp_filter.c @@ -2,29 +2,10 @@ * Check decoding of ICMP_FILTER. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -43,13 +24,13 @@ main(void) printf("setsockopt(-1, SOL_RAW, ICMP_FILTER, NULL, 0) = -1 %s (%m)\n", errno2name()); - socklen_t *const plen = tail_alloc(sizeof(*plen)); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, plen); void *const efault = plen + 1; - struct icmp_filter *const f = tail_alloc(sizeof(*f)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct icmp_filter, f); getsockopt(-1, SOL_RAW, ICMP_FILTER, f, plen); - printf("getsockopt(-1, SOL_RAW, ICMP_FILTER, %p, %p) = -1 %s (%m)\n", - f, plen, errno2name()); + printf("getsockopt(-1, SOL_RAW, ICMP_FILTER, %p, [%d]) = -1 %s (%m)\n", + f, *plen, errno2name()); setsockopt(-1, SOL_RAW, ICMP_FILTER, efault, sizeof(*f)); printf("setsockopt(-1, SOL_RAW, ICMP_FILTER, %p, %u) = -1 %s (%m)\n", diff --git a/tests-mx32/net-icmp_filter.gen.test b/tests-mx32/net-icmp_filter.gen.test new file mode 100755 index 00000000..bf6c765f --- /dev/null +++ b/tests-mx32/net-icmp_filter.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-icmp_filter -e trace=getsockopt,setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt,setsockopt diff --git a/tests-mx32/net-icmp_filter.test b/tests-mx32/net-icmp_filter.test deleted file mode 100755 index c05a5e65..00000000 --- a/tests-mx32/net-icmp_filter.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of ICMP_FILTER. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=getsockopt,setsockopt diff --git a/tests-mx32/net-packet_mreq-Xabbrev.c b/tests-mx32/net-packet_mreq-Xabbrev.c new file mode 100644 index 00000000..027bf5a4 --- /dev/null +++ b/tests-mx32/net-packet_mreq-Xabbrev.c @@ -0,0 +1 @@ +#include "net-packet_mreq.c" diff --git a/tests-mx32/net-packet_mreq-Xabbrev.gen.test b/tests-mx32/net-packet_mreq-Xabbrev.gen.test new file mode 100755 index 00000000..66c5243b --- /dev/null +++ b/tests-mx32/net-packet_mreq-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-packet_mreq-Xabbrev -e trace=setsockopt -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt -Xabbrev diff --git a/tests-mx32/net-packet_mreq-Xraw.c b/tests-mx32/net-packet_mreq-Xraw.c new file mode 100644 index 00000000..0b041c3e --- /dev/null +++ b/tests-mx32/net-packet_mreq-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "net-packet_mreq.c" diff --git a/tests-mx32/net-packet_mreq-Xraw.gen.test b/tests-mx32/net-packet_mreq-Xraw.gen.test new file mode 100755 index 00000000..67ba710f --- /dev/null +++ b/tests-mx32/net-packet_mreq-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-packet_mreq-Xraw -e trace=setsockopt -Xraw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt -Xraw diff --git a/tests-mx32/net-packet_mreq-Xverbose.c b/tests-mx32/net-packet_mreq-Xverbose.c new file mode 100644 index 00000000..02185bab --- /dev/null +++ b/tests-mx32/net-packet_mreq-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "net-packet_mreq.c" diff --git a/tests-mx32/net-packet_mreq-Xverbose.gen.test b/tests-mx32/net-packet_mreq-Xverbose.gen.test new file mode 100755 index 00000000..d1c96342 --- /dev/null +++ b/tests-mx32/net-packet_mreq-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-packet_mreq-Xverbose -e trace=setsockopt -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt -Xverbose diff --git a/tests-mx32/net-packet_mreq.c b/tests-mx32/net-packet_mreq.c new file mode 100644 index 00000000..6b64e9eb --- /dev/null +++ b/tests-mx32/net-packet_mreq.c @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +static const char *errstr; + +static long +packet_mreq_membership(int optname, void *optval, socklen_t len) +{ + long rc = setsockopt(-1, SOL_PACKET, optname, optval, len); + errstr = sprintrc(rc); + return rc; +} + +static void +test_packet_mreq(const int optname, const char *const optname_str) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct packet_mreq, pmreq); + socklen_t len = sizeof(struct packet_mreq); + + /* setsockopt with optname unknown */ + packet_mreq_membership(-1, NULL, 0); +#if XLAT_RAW + printf("setsockopt(-1, %#x, %#x, NULL, 0) = %s\n", + SOL_PACKET, -1, errstr); +#elif XLAT_VERBOSE + printf("setsockopt(-1, %#x /* SOL_PACKET */, %#x /* PACKET_??? */" + ", NULL, 0) = %s\n", SOL_PACKET, -1, errstr); +#else + printf("setsockopt(-1, SOL_PACKET, %#x /* PACKET_??? */, NULL, 0) = %s\n", + -1, errstr); +#endif + + /* setsockopt with mr_type unknown */ + pmreq->mr_ifindex = 0; + pmreq->mr_alen = ARRAY_SIZE(pmreq->mr_address); + packet_mreq_membership(optname, pmreq, len); +#if XLAT_RAW + printf("setsockopt(-1, %#x, %#x, {mr_ifindex=%d," + " mr_type=%#x, mr_alen=%d, mr_address=", + SOL_PACKET, optname, pmreq->mr_ifindex, + pmreq->mr_type, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, + ARRAY_SIZE(pmreq->mr_address)); + printf("}, %d) = %s\n", len, errstr); +#elif XLAT_VERBOSE + printf("setsockopt(-1, %#x /* SOL_PACKET */, %#x /* %s */" + ", {mr_ifindex=%d, mr_type=%#x /* PACKET_MR_??? */" + ", mr_alen=%d, mr_address=", + SOL_PACKET, optname, optname_str, pmreq->mr_ifindex, + pmreq->mr_type, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, + ARRAY_SIZE(pmreq->mr_address)); + printf(" /* "); + for (unsigned int i = 0; i < ARRAY_SIZE(pmreq->mr_address); i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf(" */}, %d) = %s\n", len, errstr); +#else + printf("setsockopt(-1, SOL_PACKET, %s, {mr_ifindex=%d," + " mr_type=%#x /* PACKET_MR_??? */, mr_alen=%d, mr_address=", + optname_str, pmreq->mr_ifindex, pmreq->mr_type, pmreq->mr_alen); + for (unsigned int i = 0; i < ARRAY_SIZE(pmreq->mr_address); i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf("}, %d) = %s\n", len, errstr); +#endif + + /* setsockopt with mr_type unknown and mr_alen > sizeof(mr_address) */ + pmreq->mr_alen = ARRAY_SIZE(pmreq->mr_address) + 1; + packet_mreq_membership(optname, pmreq, len); +#if XLAT_RAW + printf("setsockopt(-1, %#x, %#x, {mr_ifindex=%d," + " mr_type=%#x, mr_alen=%d, mr_address=", + SOL_PACKET, optname, pmreq->mr_ifindex, + pmreq->mr_type, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, + ARRAY_SIZE(pmreq->mr_address)); + printf("}, %d) = %s\n", len, errstr); +#elif XLAT_VERBOSE + printf("setsockopt(-1, %#x /* SOL_PACKET */, %#x /* %s */" + ", {mr_ifindex=%d, mr_type=%#x /* PACKET_MR_??? */" + ", mr_alen=%d, mr_address=", + SOL_PACKET, optname, optname_str, pmreq->mr_ifindex, + pmreq->mr_type, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, + ARRAY_SIZE(pmreq->mr_address)); + printf(" /* "); + for (unsigned int i = 0; i < ARRAY_SIZE(pmreq->mr_address); i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf(" */}, %d) = %s\n", len, errstr); +#else + printf("setsockopt(-1, SOL_PACKET, %s, {mr_ifindex=%d," + " mr_type=%#x /* PACKET_MR_??? */, mr_alen=%d, mr_address=", + optname_str, pmreq->mr_ifindex, pmreq->mr_type, pmreq->mr_alen); + for (unsigned int i = 0; i < ARRAY_SIZE(pmreq->mr_address); i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf("}, %d) = %s\n", len, errstr); +#endif + + /* setsockopt with mr_type unknown and mr_alen < sizeof(mr_address) */ + pmreq->mr_alen = ARRAY_SIZE(pmreq->mr_address) - 1; + packet_mreq_membership(optname, pmreq, len); +#if XLAT_RAW + printf("setsockopt(-1, %#x, %#x, {mr_ifindex=%d," + " mr_type=%#x, mr_alen=%d, mr_address=", + SOL_PACKET, optname, pmreq->mr_ifindex, + pmreq->mr_type, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, pmreq->mr_alen); + printf("}, %d) = %s\n", len, errstr); +#elif XLAT_VERBOSE + printf("setsockopt(-1, %#x /* SOL_PACKET */, %#x /* %s */" + ", {mr_ifindex=%d, mr_type=%#x /* PACKET_MR_??? */" + ", mr_alen=%d, mr_address=", + SOL_PACKET, optname, optname_str, pmreq->mr_ifindex, + pmreq->mr_type, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, pmreq->mr_alen); + printf(" /* "); + for (unsigned int i = 0; i < pmreq->mr_alen; i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf(" */}, %d) = %s\n", len, errstr); +#else + printf("setsockopt(-1, SOL_PACKET, %s, {mr_ifindex=%d," + " mr_type=%#x /* PACKET_MR_??? */, mr_alen=%d, mr_address=", + optname_str, pmreq->mr_ifindex, pmreq->mr_type, pmreq->mr_alen); + for (unsigned int i = 0; i < pmreq->mr_alen; i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf("}, %d) = %s\n", len, errstr); +#endif + + /* setsockopt with valid mr_type */ + pmreq->mr_alen = ARRAY_SIZE(pmreq->mr_address); + static const struct { + unsigned short type; + const char *const type_str; + } a[] = { + { ARG_STR(PACKET_MR_MULTICAST) }, + { ARG_STR(PACKET_MR_PROMISC) }, + { ARG_STR(PACKET_MR_ALLMULTI) }, +#ifdef PACKET_MR_UNICAST + { ARG_STR(PACKET_MR_UNICAST) }, +#endif + }; + + for (unsigned int i = 0; i < ARRAY_SIZE(a); i++) { + pmreq->mr_type = a[i].type; + packet_mreq_membership(optname, pmreq, len); +#if XLAT_RAW + printf("setsockopt(-1, %#x, %#x, {mr_ifindex=%d," + " mr_type=%#x, mr_alen=%d, mr_address=", + SOL_PACKET, optname, pmreq->mr_ifindex, + pmreq->mr_type, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, pmreq->mr_alen); + printf("}, %d) = %s\n", len, errstr); +#elif XLAT_VERBOSE + printf("setsockopt(-1, %#x /* SOL_PACKET */, %#x /* %s */" + ", {mr_ifindex=%d, mr_type=%#x /* %s */" + ", mr_alen=%d, mr_address=", + SOL_PACKET, optname, optname_str, pmreq->mr_ifindex, + pmreq->mr_type, a[i].type_str, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, pmreq->mr_alen); + printf(" /* "); + for (unsigned int i = 0; i < pmreq->mr_alen; i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf(" */}, %d) = %s\n", len, errstr); +#else + printf("setsockopt(-1, SOL_PACKET, %s, {mr_ifindex=%d," + " mr_type=%s, mr_alen=%d, mr_address=", + optname_str, pmreq->mr_ifindex, a[i].type_str, pmreq->mr_alen); + for (unsigned int i = 0; i < pmreq->mr_alen; i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf("}, %d) = %s\n", len, errstr); +#endif + } + + /* setsockopt with optlen larger than usual */ + len = len + 1; + packet_mreq_membership(optname, pmreq, len); +#if XLAT_RAW + printf("setsockopt(-1, %#x, %#x, %p, %d) = %s\n", + SOL_PACKET, optname, pmreq, len, errstr); +#elif XLAT_VERBOSE + printf("setsockopt(-1, %#x /* SOL_PACKET */, %#x /* %s */" + ", %p, %d) = %s\n", SOL_PACKET, optname, optname_str, + pmreq, len, errstr); +#else + printf("setsockopt(-1, SOL_PACKET, %s, %p," + " %d) = %s\n", optname_str, pmreq, len, errstr); +#endif +} + +int +main(void) +{ + test_packet_mreq(ARG_STR(PACKET_ADD_MEMBERSHIP)); + test_packet_mreq(ARG_STR(PACKET_DROP_MEMBERSHIP)); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/net-packet_mreq.gen.test b/tests-mx32/net-packet_mreq.gen.test new file mode 100755 index 00000000..9dd034a9 --- /dev/null +++ b/tests-mx32/net-packet_mreq.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-packet_mreq -e trace=setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt diff --git a/tests-mx32/net-sockaddr.c b/tests-mx32/net-sockaddr.c index bf37779f..cd973922 100644 --- a/tests-mx32/net-sockaddr.c +++ b/tests-mx32/net-sockaddr.c @@ -2,29 +2,10 @@ * Check decoding of sockaddr structures * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,11 +17,13 @@ #include #include #include +#include "netlink.h" +#include #include #include #include +#include #include -#include #ifdef HAVE_BLUETOOTH_BLUETOOTH_H # include # include @@ -49,15 +32,10 @@ # include #endif -#ifdef HAVE_IF_INDEXTONAME -/* used to conflict with */ -extern unsigned int if_nametoindex(const char *); -#endif - static void check_un(void) { - struct sockaddr_un *un = tail_alloc(sizeof(*un)); + TAIL_ALLOC_OBJECT_VAR_PTR(struct sockaddr_un, un); un->sun_family = AF_UNIX; memset(un->sun_path, '0', sizeof(un->sun_path)); unsigned int len = sizeof(*un); @@ -133,7 +111,7 @@ check_in(void) const unsigned short h_port = 12345; static const char h_addr[] = "12.34.56.78"; - struct sockaddr_in *in = tail_alloc(sizeof(*in)); + TAIL_ALLOC_OBJECT_VAR_PTR(struct sockaddr_in, in); in->sin_family = AF_INET; in->sin_port = htons(h_port); in->sin_addr.s_addr = inet_addr(h_addr); @@ -178,26 +156,24 @@ check_in6_linklocal(struct sockaddr_in6 *const in6, const char *const h_addr) unsigned int len = sizeof(*in6); int ret = connect(-1, (void *) in6, len); printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" - ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" ", sin6_flowinfo=htonl(%u)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" ", sin6_scope_id=%u}, %u)" " = %d EBADF (%m)\n", - ntohs(in6->sin6_port), h_addr, - ntohl(in6->sin6_flowinfo), in6->sin6_scope_id, len, ret); + ntohs(in6->sin6_port), ntohl(in6->sin6_flowinfo), + h_addr, in6->sin6_scope_id, len, ret); -#ifdef HAVE_IF_INDEXTONAME - in6->sin6_scope_id = if_nametoindex("lo"); + in6->sin6_scope_id = ifindex_lo(); if (in6->sin6_scope_id) { ret = connect(-1, (void *) in6, len); printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" - ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" ", sin6_flowinfo=htonl(%u)" - ", sin6_scope_id=if_nametoindex(\"lo\")}, %u)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" + ", sin6_scope_id=%s}, %u)" " = %d EBADF (%m)\n", - ntohs(in6->sin6_port), h_addr, - ntohl(in6->sin6_flowinfo), len, ret); + ntohs(in6->sin6_port), ntohl(in6->sin6_flowinfo), h_addr, + IFINDEX_LO_STR, len, ret); } -#endif } static void @@ -207,7 +183,7 @@ check_in6(void) const unsigned int h_flowinfo = 1234567890; static const char h_addr[] = "12:34:56:78:90:ab:cd:ef"; - struct sockaddr_in6 *in6 = tail_alloc(sizeof(*in6)); + TAIL_ALLOC_OBJECT_VAR_PTR(struct sockaddr_in6, in6); in6->sin6_family = AF_INET6; in6->sin6_port = htons(h_port); in6->sin6_flowinfo = htonl(h_flowinfo); @@ -216,10 +192,11 @@ check_in6(void) unsigned int len = sizeof(*in6); int ret = connect(-1, (void *) in6, len); printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", sin6_flowinfo=htonl(%u)" ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" - ", sin6_flowinfo=htonl(%u), sin6_scope_id=%u}, %u)" + ", sin6_scope_id=%u}, %u)" " = %d EBADF (%m)\n", - h_port, h_addr, h_flowinfo, in6->sin6_scope_id, len, ret); + h_port, h_flowinfo, h_addr, in6->sin6_scope_id, len, ret); check_in6_linklocal(in6, "fe80::"); check_in6_linklocal(in6, "ff42::"); @@ -233,10 +210,11 @@ check_in6(void) len = sizeof(*in6) + 4; ret = connect(-1, (void *) in6, len); printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", sin6_flowinfo=htonl(%u)" ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" - ", sin6_flowinfo=htonl(%u), sin6_scope_id=%u}, %u)" + ", sin6_scope_id=%u}, %u)" " = %d EBADF (%m)\n", - h_port, h_addr, h_flowinfo, in6->sin6_scope_id, len, ret); + h_port, h_flowinfo, h_addr, in6->sin6_scope_id, len, ret); in6 = ((void *) in6) + 4 + sizeof(in6->sin6_scope_id); in6->sin6_family = AF_INET6; @@ -246,10 +224,10 @@ check_in6(void) len = sizeof(*in6) - sizeof(in6->sin6_scope_id); ret = connect(-1, (void *) in6, len); printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" - ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" - ", sin6_flowinfo=htonl(%u)}, %u)" + ", sin6_flowinfo=htonl(%u)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)}, %u)" " = %d EBADF (%m)\n", - h_port, h_addr, h_flowinfo, len, ret); + h_port, h_flowinfo, h_addr, len, ret); in6 = ((void *) in6) + 4; in6->sin6_family = AF_INET6; @@ -295,10 +273,185 @@ check_ipx(void) c_ipx.sipx_type, len, ret); } +/* for a bit more compact AX.25 address definitions */ +#define AX25_ADDR(c_, s_) \ + { { (c_)[0] << 1, (c_)[1] << 1, (c_)[2] << 1, \ + (c_)[3] << 1, (c_)[4] << 1, (c_)[5] << 1, (s_) << 1 } } \ + /* End of AX25_ADDR definition */ + +static void +check_ax25(void) +{ + const struct full_sockaddr_ax25 ax25 = { + .fsa_ax25 = { + .sax25_family = AF_AX25, + .sax25_call = AX25_ADDR("VALID ", 13), + .sax25_ndigis = 8, + }, + .fsa_digipeater = { + AX25_ADDR("SPA CE", 0), + AX25_ADDR("SSID ", 16), + AX25_ADDR(" ", 0), + AX25_ADDR("NULL\0", 3), + AX25_ADDR("A-B-C", 4), + AX25_ADDR(",}]\"\\'", 5), + AX25_ADDR("DASH-0", 6), + AX25_ADDR("\n\tABCD", 7), + }, + }; + const ax25_address aux_addrs[] = { + AX25_ADDR("VALID2", 7), + AX25_ADDR("OK ", 15), + AX25_ADDR("FINE ", 2), + AX25_ADDR("smalls", 9), + }; + + enum { AX25_ALIGN = ALIGNOF(struct full_sockaddr_ax25), }; + size_t size = sizeof(ax25); + size_t surplus = ROUNDUP(sizeof(ax25_address), AX25_ALIGN); + void *sax_void = midtail_alloc(size, surplus); + struct full_sockaddr_ax25 *sax = sax_void; + long rc; + + fill_memory(sax, size); + sax->fsa_ax25.sax25_family = AF_AX25; + rc = connect(-1, sax_void, sizeof(struct sockaddr_ax25) - 1); + printf("connect(-1, {sa_family=AF_AX25, sa_data=\"\\202\\203\\204\\205" + "\\206\\207\\210\\211\\212\\213\\214\\215\\216\"}, %zu) = %s\n", + sizeof(struct sockaddr_ax25) - 1, sprintrc(rc)); + + memcpy(sax, &ax25, sizeof(ax25)); + rc = connect(-1, sax_void, sizeof(struct sockaddr_ax25)); + printf("connect(-1, {sa_family=AF_AX25, fsa_ax25={sax25_call=VALID-13" + ", sax25_ndigis=8}, fsa_digipeater=[/* ??? */]}, %zu) = %s\n", + sizeof(struct sockaddr_ax25), sprintrc(rc)); + + sax->fsa_ax25.sax25_ndigis = 0; + rc = connect(-1, sax_void, sizeof(struct sockaddr_ax25)); + printf("connect(-1, {sa_family=AF_AX25, sax25_call=VALID-13" + ", sax25_ndigis=0}, %zu) = %s\n", + sizeof(struct sockaddr_ax25), sprintrc(rc)); + + sax->fsa_ax25.sax25_ndigis = 8; + size = sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 3 + 1; + rc = connect(-1, sax_void, size); + printf("connect(-1, {sa_family=AF_AX25, fsa_ax25={sax25_call=VALID-13" + ", sax25_ndigis=8}, fsa_digipeater" + "=[{ax25_call=\"\\xa6\\xa0\\x82\\x40\\x86\\x8a\\x00\"" + "} /* SPA CE-0 */" + ", {ax25_call=\"\\xa6\\xa6\\x92\\x88\\x40\\x40\\x20\"" + "} /* SSID-0 */" + ", *" + ", /* ??? */], ...}, %zu) = %s\n", + size, sprintrc(rc)); + + sax->fsa_digipeater[2].ax25_call[6] = 0x4; + size = sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 4; + rc = connect(-1, sax_void, size); + printf("connect(-1, {sa_family=AF_AX25, fsa_ax25={sax25_call=VALID-13" + ", sax25_ndigis=8}, fsa_digipeater" + "=[{ax25_call=\"\\xa6\\xa0\\x82\\x40\\x86\\x8a\\x00\"" + "} /* SPA CE-0 */" + ", {ax25_call=\"\\xa6\\xa6\\x92\\x88\\x40\\x40\\x20\"" + "} /* SSID-0 */" + ", {ax25_call=\"\\x40\\x40\\x40\\x40\\x40\\x40\\x04\"} /* -2 */" + ", {ax25_call=\"\\x9c\\xaa\\x98\\x98\\x00\\x00\\x06\"}" + ", /* ??? */]}, %zu) = %s\n", + size, sprintrc(rc)); + + memcpy(sax->fsa_digipeater, aux_addrs, sizeof(aux_addrs)); + sax->fsa_digipeater[2].ax25_call[6] = 0xa5; + sax->fsa_digipeater[4].ax25_call[5] = 0x40; + for (size_t i = 0; i < 3; i++) { + size = sizeof(ax25) + sizeof(ax25_address) * (i / 2); + rc = connect(-1, sax_void, size); + printf("connect(-1, {sa_family=AF_AX25" + ", fsa_ax25={sax25_call=VALID-13, sax25_ndigis=%d}" + ", fsa_digipeater=[VALID2-7, OK-15, %s /* FINE-2 */" + ", {ax25_call=\"\\xe6\\xda\\xc2\\xd8\\xd8\\xe6\\x12\"" + "} /* smalls-9 */" + ", {ax25_call=\"\\x%s\\x%s\\x84\\x5a\\x86\\x40\\x08\"" + "} /* %sB-C-4 */" + ", {ax25_call=\"\\x58\\xfa\\xba\\x44\\x%s\\x%s\\x0a\"" + "}%s" + ", {ax25_call=\"\\x88\\x82\\xa6\\x90\\x5a\\x%s\\x0c\"" + "}%s" + "%s]%s}, %zu) = %s\n" + , sax->fsa_ax25.sax25_ndigis + , i + ? "{ax25_call=\"\\x8c\\x92\\x9c\\x8a\\x40\\x41\\x04\"}" + : "{ax25_call=\"\\x8c\\x92\\x9c\\x8a\\x40\\x40\\xa5\"}" + , i ? "40" : "82" + , i ? "40" : "5a" + , i ? " " : "A-" + , i ? "54" : "b8" + , i ? "5e" : "4e" + , i ? "" : " /* ,}]\"\\'-5 */" + , i ? "fe" : "60" + , i ? "" : " /* DASH-0-6 */" + , i == 1 + ? "" + : ", {ax25_call=\"\\x14\\x12\\x82\\x84\\x86\\x88\\x0e\"}" + , i > 1 ? ", ..." : "" + , size, sprintrc(rc)); + + if (i == 1) { + sax_void = (char *) sax_void - surplus; + memmove(sax_void, sax, sizeof(ax25)); + sax = sax_void; + } + + sax->fsa_ax25.sax25_ndigis = 7 + 2 * i; + + sax->fsa_digipeater[2].ax25_call[5] = 0x41; + sax->fsa_digipeater[2].ax25_call[6] = 0x4; + + sax->fsa_digipeater[4].ax25_call[0] = 0x40; + sax->fsa_digipeater[4].ax25_call[1] = 0x40; + + sax->fsa_digipeater[5].ax25_call[4] = '*' << 1; + sax->fsa_digipeater[5].ax25_call[5] = '/' << 1; + + sax->fsa_digipeater[6].ax25_call[5] = 0xfe; + } +} + +static void +check_x25(void) +{ + static const struct sockaddr_x25 c_x25 = { + .sx25_family = AF_X25, + .sx25_addr = { "0123456789abcdef" }, + }; + void *x25_void = tail_memdup(&c_x25, sizeof(c_x25) + 1); + struct sockaddr_x25 *x25 = x25_void; + long rc; + + rc = connect(-1, x25, sizeof(c_x25) - 1); + printf("connect(-1, {sa_family=AF_X25" + ", sa_data=\"0123456789abcde\"}, %zu) = %s\n", + sizeof(c_x25) - 1, sprintrc(rc)); + + for (size_t i = 0; i < 2; i++) { + rc = connect(-1, x25, sizeof(c_x25) + i); + printf("connect(-1, {sa_family=AF_X25" + ", sx25_addr={x25_addr=\"0123456789abcde\"...}" + "}, %zu) = %s\n", + sizeof(c_x25) + i, sprintrc(rc)); + } + + x25->sx25_addr.x25_addr[10] = '\0'; + rc = connect(-1, x25, sizeof(c_x25)); + printf("connect(-1, {sa_family=AF_X25" + ", sx25_addr={x25_addr=\"0123456789\"}" + "}, %zu) = %s\n", + sizeof(c_x25), sprintrc(rc)); +} + static void check_nl(void) { - struct sockaddr_nl *nl = tail_alloc(sizeof(*nl)); + TAIL_ALLOC_OBJECT_VAR_PTR(struct sockaddr_nl, nl); nl->nl_family = AF_NETLINK; nl->nl_pid = 1234567890; nl->nl_groups = 0xfacefeed; @@ -370,19 +523,16 @@ check_ll(void) ", sll_pkttype=PACKET_HOST, sll_halen=0}, %u)" " = %d EBADF (%m)\n", c_ll.sll_ifindex, len, ret); -#ifdef HAVE_IF_INDEXTONAME - const int id = if_nametoindex("lo"); - if (id) { - ((struct sockaddr_ll *) ll)->sll_ifindex = id; + ((struct sockaddr_ll *) ll)->sll_ifindex = ifindex_lo(); + if (((struct sockaddr_ll *) ll)->sll_ifindex) { ret = connect(-1, ll, len); printf("connect(-1, {sa_family=AF_PACKET" ", sll_protocol=htons(ETH_P_ALL)" - ", sll_ifindex=if_nametoindex(\"lo\")" + ", sll_ifindex=%s" ", sll_hatype=ARPHRD_ETHER" ", sll_pkttype=PACKET_HOST, sll_halen=0}, %u)" - " = %d EBADF (%m)\n", len, ret); + " = %d EBADF (%m)\n", IFINDEX_LO_STR, len, ret); } -#endif } #ifdef HAVE_BLUETOOTH_BLUETOOTH_H @@ -390,7 +540,7 @@ static void check_hci(void) { const unsigned short h_port = 12345; - struct sockaddr_hci *hci = tail_alloc(sizeof(*hci)); + TAIL_ALLOC_OBJECT_VAR_PTR(struct sockaddr_hci, hci); hci->hci_family = AF_BLUETOOTH; hci->hci_dev = htobs(h_port); hci->hci_channel = HCI_CHANNEL_RAW; @@ -445,25 +595,86 @@ check_l2(void) { const unsigned short h_psm = 12345; const unsigned short h_cid = 13579; - const struct sockaddr_l2 c_l2 = { + struct sockaddr_l2 c_l2 = { .l2_family = AF_BLUETOOTH, .l2_psm = htobs(h_psm), .l2_bdaddr.b = "abcdef", .l2_cid = htobs(h_cid), - .l2_bdaddr_type = 42 +# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE + .l2_bdaddr_type = 0xce, +# endif }; void *l2 = tail_memdup(&c_l2, sizeof(c_l2)); unsigned int len = sizeof(c_l2); + int ret = connect(-1, l2, len); printf("connect(-1, {sa_family=AF_BLUETOOTH" - ", l2_psm=htobs(%hu)" + ", l2_psm=htobs(L2CAP_PSM_DYN_START + %hu)" + ", l2_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + ", l2_cid=htobs(L2CAP_CID_DYN_START + %hu)" +# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE + ", l2_bdaddr_type=0xce /* BDADDR_??? */" +# endif + "}, %u) = %d EBADF (%m)\n", + (short) (h_psm - 0x1001), + c_l2.l2_bdaddr.b[0], c_l2.l2_bdaddr.b[1], + c_l2.l2_bdaddr.b[2], c_l2.l2_bdaddr.b[3], + c_l2.l2_bdaddr.b[4], c_l2.l2_bdaddr.b[5], + (short) (h_cid - 0x40), len, ret); + + c_l2.l2_psm = htobs(1); + c_l2.l2_cid = htobs(1); +# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE + c_l2.l2_bdaddr_type = BDADDR_LE_RANDOM; +# endif + memcpy(l2, &c_l2, sizeof(c_l2)); + ret = connect(-1, l2, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", l2_psm=htobs(L2CAP_PSM_SDP)" + ", l2_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + ", l2_cid=htobs(L2CAP_CID_SIGNALING)" +# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE + ", l2_bdaddr_type=BDADDR_LE_RANDOM" +# endif + "}, %u) = %d EBADF (%m)\n", + c_l2.l2_bdaddr.b[0], c_l2.l2_bdaddr.b[1], + c_l2.l2_bdaddr.b[2], c_l2.l2_bdaddr.b[3], + c_l2.l2_bdaddr.b[4], c_l2.l2_bdaddr.b[5], + len, ret); + + c_l2.l2_psm = htobs(0xbad); + c_l2.l2_cid = htobs(8); +# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE + c_l2.l2_bdaddr_type = 3; +# endif + memcpy(l2, &c_l2, sizeof(c_l2)); + ret = connect(-1, l2, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", l2_psm=htobs(0xbad /* L2CAP_PSM_??? */)" + ", l2_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + ", l2_cid=htobs(0x8 /* L2CAP_CID_??? */)" +# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE + ", l2_bdaddr_type=0x3 /* BDADDR_??? */" +# endif + "}, %u) = %d EBADF (%m)\n", + c_l2.l2_bdaddr.b[0], c_l2.l2_bdaddr.b[1], + c_l2.l2_bdaddr.b[2], c_l2.l2_bdaddr.b[3], + c_l2.l2_bdaddr.b[4], c_l2.l2_bdaddr.b[5], + len, ret); + + c_l2.l2_psm = htobs(0x10ff); + c_l2.l2_cid = htobs(0xffff); + memcpy(l2, &c_l2, 12); + ret = connect(-1, l2, 12); + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", l2_psm=htobs(L2CAP_PSM_AUTO_END)" ", l2_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" - ", l2_cid=htobs(%hu), l2_bdaddr_type=%u}" - ", %u) = %d EBADF (%m)\n", h_psm, + ", l2_cid=htobs(L2CAP_CID_DYN_END)" + "}, 12) = %d EBADF (%m)\n", c_l2.l2_bdaddr.b[0], c_l2.l2_bdaddr.b[1], c_l2.l2_bdaddr.b[2], c_l2.l2_bdaddr.b[3], c_l2.l2_bdaddr.b[4], c_l2.l2_bdaddr.b[5], - h_cid, c_l2.l2_bdaddr_type, len, ret); + ret); } #endif @@ -502,6 +713,8 @@ main(void) check_in(); check_in6(); check_ipx(); + check_ax25(); + check_x25(); check_nl(); check_ll(); #ifdef HAVE_BLUETOOTH_BLUETOOTH_H diff --git a/tests-mx32/net-sockaddr.gen.test b/tests-mx32/net-sockaddr.gen.test new file mode 100755 index 00000000..53c8335a --- /dev/null +++ b/tests-mx32/net-sockaddr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-sockaddr -a24 -e trace=connect); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 -e trace=connect diff --git a/tests-mx32/net-sockaddr.test b/tests-mx32/net-sockaddr.test deleted file mode 100755 index cdfe536f..00000000 --- a/tests-mx32/net-sockaddr.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of sockaddr structures. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 -e trace=connect diff --git a/tests-mx32/net-tpacket_req.c b/tests-mx32/net-tpacket_req.c new file mode 100644 index 00000000..b11ddf8e --- /dev/null +++ b/tests-mx32/net-tpacket_req.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +static const char *errstr; + +static long +set_tpacket_req(int optname, void *optval, socklen_t len) +{ + long rc = setsockopt(-1, SOL_PACKET, optname, optval, len); + errstr = sprintrc(rc); + return rc; +} + +static void +test_tpacket_req(const int optname, const char *const optname_str) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct tpacket_req, tpreq); + socklen_t len; + + /* setsockopt with optname unknown */ + set_tpacket_req(-1, NULL, 0); + printf("setsockopt(-1, SOL_PACKET, %#x /* PACKET_??? */, NULL, 0) = %s\n", + -1, errstr); + + /* classic setsockopt */ + len = sizeof(struct tpacket_req); + set_tpacket_req(optname, tpreq, len); + printf("setsockopt(-1, SOL_PACKET, %s, {tp_block_size=%u," + " tp_block_nr=%u, tp_frame_size=%u, tp_frame_nr=%u}, %d) = %s\n", + optname_str, tpreq->tp_block_size, tpreq->tp_block_nr, + tpreq->tp_frame_size, tpreq->tp_frame_nr, len, errstr); + + /* setsockopt with optlen larger than usual */ + len = len + 1; + set_tpacket_req(optname, tpreq, len); + printf("setsockopt(-1, SOL_PACKET, %s, %p," + " %d) = %s\n", optname_str, tpreq, len, errstr); +} + +int +main(void) +{ + test_tpacket_req(ARG_STR(PACKET_RX_RING)); +#ifdef PACKET_TX_RING + test_tpacket_req(ARG_STR(PACKET_TX_RING)); +#endif + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/net-tpacket_req.gen.test b/tests-mx32/net-tpacket_req.gen.test new file mode 100755 index 00000000..6fc4e601 --- /dev/null +++ b/tests-mx32/net-tpacket_req.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-tpacket_req -e trace=setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt diff --git a/tests-mx32/net-tpacket_stats-success.c b/tests-mx32/net-tpacket_stats-success.c new file mode 100644 index 00000000..883ec048 --- /dev/null +++ b/tests-mx32/net-tpacket_stats-success.c @@ -0,0 +1,2 @@ +#define INJECT_RETVAL 42 +#include "net-tpacket_stats.c" diff --git a/tests-mx32/net-tpacket_stats-success.test b/tests-mx32/net-tpacket_stats-success.test new file mode 100755 index 00000000..47ab84ef --- /dev/null +++ b/tests-mx32/net-tpacket_stats-success.test @@ -0,0 +1,11 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + + . "${srcdir=.}/scno_tampering.sh" + +run_strace -e trace=getsockopt -e inject=getsockopt:retval=42 ../net-tpacket_stats-success > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests-mx32/net-tpacket_stats.c b/tests-mx32/net-tpacket_stats.c new file mode 100644 index 00000000..22f5fa25 --- /dev/null +++ b/tests-mx32/net-tpacket_stats.c @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include "print_fields.h" + +static const char *errstr; + +struct tp_stats { + unsigned int tp_packets, tp_drops, tp_freeze_q_cnt; +}; + +static long +get_tpacket_stats(void *optval, socklen_t *len) +{ + struct tp_stats *tpstats = optval; + socklen_t optlen = *len; + long rc = getsockopt(-1, SOL_PACKET, PACKET_STATISTICS, tpstats, len); + errstr = sprintrc(rc); +#ifdef INJECT_RETVAL + if (rc != INJECT_RETVAL) + error_msg_and_fail("Got a return value of %ld != %d", + rc, INJECT_RETVAL); + + static char inj_errstr[4096]; + + snprintf(inj_errstr, sizeof(inj_errstr), "%s (INJECTED)", errstr); + errstr = inj_errstr; +#endif + printf("getsockopt(-1, SOL_PACKET, PACKET_STATISTICS"); + if (rc < 0 || optlen <= 0) { + printf(", %p", tpstats); + } else if (optlen < sizeof(tpstats->tp_packets)) { + printf(", {tp_packets="); + print_quoted_hex(tpstats, optlen); + printf("}"); + } else { + PRINT_FIELD_U(", {", *tpstats, tp_packets); + + if (optlen > offsetof(struct tp_stats, tp_drops)) { + optlen -= offsetof(struct tp_stats, tp_drops); + if (optlen < sizeof(tpstats->tp_drops)) { + printf(", tp_drops="); + print_quoted_hex(tpstats, optlen); + } else { + PRINT_FIELD_U(", ", *tpstats, tp_drops); + + if (optlen > offsetof(struct tp_stats, tp_freeze_q_cnt) - + offsetof(struct tp_stats, tp_drops)) { + optlen -= offsetof(struct tp_stats, tp_freeze_q_cnt) - + offsetof(struct tp_stats, tp_drops); + if (optlen < sizeof(tpstats->tp_freeze_q_cnt)) { + printf(", tp_freeze_q_cnt="); + print_quoted_hex(tpstats, optlen); + } else { + PRINT_FIELD_U(", ", *tpstats, tp_freeze_q_cnt); + } + } + } + } + printf("}"); + } + printf(", [%d]) = %s\n", *len, errstr); + + return rc; +} + +int +main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct tp_stats, tp_stats); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); + + /* offset of (truncated) struct tp_stats.tp_packets */ + const unsigned int offset_tp_packets = offsetofend(struct tp_stats, tp_packets); + const unsigned int tp_packets_truncated = offset_tp_packets - 1; + /* offset of (truncated) struct tp_stats.tp_drops */ + const unsigned int offset_tp_drops = offsetofend(struct tp_stats, tp_drops); + const unsigned int tp_drops_truncated = offset_tp_drops - 1; + /* offset of (truncated) struct tp_stats.tp_freeze_q_cnt */ + const unsigned int offset_tp_freeze_q_cnt = offsetofend(struct tp_stats, tp_freeze_q_cnt); + const unsigned int tp_freeze_q_cnt_truncated = offset_tp_freeze_q_cnt - 1; + + *len = sizeof(*tp_stats); + + /* classic getsockopt */ + unsigned int optlen = *len; + get_tpacket_stats(tp_stats, &optlen); + + /* getsockopt with zero optlen */ + optlen = 0; + get_tpacket_stats(tp_stats, &optlen); + + /* + * getsockopt with optlen less than offsetofend(struct tp_stats.tp_packets): + * the part of struct tp_stats.tp_packets is printed in hex. + */ + optlen = tp_packets_truncated; + get_tpacket_stats(tp_stats, &optlen); + + /* + * getsockopt with optlen equals to offsetofend(struct tp_stats.tp_packets): + * struct tp_stats.tp_drops and struct tp_stats.offset_tp_freeze_q_cnt + * are not printed. + */ + optlen = offset_tp_packets; + get_tpacket_stats(tp_stats, &optlen); + + /* + * getsockopt with optlen greater than offsetofend(struct tp_stats.tp_packets) + * but less than offsetofend(struct tp_stats, tp_drops): + * the part of struct tp_stats.tp_drops is printed in hex. + */ + optlen = tp_drops_truncated; + get_tpacket_stats(tp_stats, &optlen); + + /* + * getsockopt with optlen equals to offsetofend(struct tp_stats.tp_drops): + * struct tp_stats.tp_freeze_q_cnt is not printed. + */ + optlen = offset_tp_drops; + get_tpacket_stats(tp_stats, &optlen); + + /* + * getsockopt with optlen greater than offsetofend(struct tp_stats.tp_drops) + * but less than offsetofend(struct tp_stats, tp_freeze_q_cnt): + * the part of struct tp_stats.tp_freeze_q_cnt is printed in hex. + */ + optlen = tp_freeze_q_cnt_truncated; + get_tpacket_stats(tp_stats, &optlen); + + /* + * getsockopt with optlen equals to offsetofend(struct tp_stats.tp_freeze_q_cnt): + */ + optlen = offset_tp_freeze_q_cnt; + get_tpacket_stats(tp_stats, &optlen); + + /* + * getsockopt with optlen greater than sizeof(struct tp_stats) + */ + optlen = offset_tp_freeze_q_cnt + 1; + get_tpacket_stats(tp_stats, &optlen); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/net-tpacket_stats.gen.test b/tests-mx32/net-tpacket_stats.gen.test new file mode 100755 index 00000000..2df46550 --- /dev/null +++ b/tests-mx32/net-tpacket_stats.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-tpacket_stats -e trace=getsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt diff --git a/tests-mx32/net-y-unix.c b/tests-mx32/net-y-unix.c index 3efc2f64..e9d218b5 100644 --- a/tests-mx32/net-y-unix.c +++ b/tests-mx32/net-y-unix.c @@ -1,30 +1,11 @@ /* * This file is part of net-y-unix strace test. * - * Copyright (c) 2013-2016 Dmitry V. Levin + * Copyright (c) 2013-2017 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -34,23 +15,26 @@ #include #include #include -#include #include #include +#include "accept_compat.h" + +#define TEST_SOCKET "net-y-unix.socket" + int -main(int ac, const char **av) +main(void) { - assert(ac == 2); + skip_if_unavailable("/proc/self/fd/"); - struct sockaddr_un addr = { .sun_family = AF_UNIX }; - unsigned int sun_path_len = strlen(av[1]); - assert(sun_path_len > 0 && sun_path_len <= sizeof(addr.sun_path)); - strncpy(addr.sun_path, av[1], sizeof(addr.sun_path)); + static const struct sockaddr_un addr = { + .sun_family = AF_UNIX, + .sun_path = TEST_SOCKET + }; struct sockaddr * const listen_sa = tail_memdup(&addr, sizeof(addr)); - socklen_t * const len = tail_alloc(sizeof(socklen_t)); - *len = offsetof(struct sockaddr_un, sun_path) + strlen(av[1]) + 1; + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); + *len = offsetof(struct sockaddr_un, sun_path) + strlen(TEST_SOCKET) + 1; if (*len > sizeof(addr)) *len = sizeof(addr); @@ -61,17 +45,18 @@ main(int ac, const char **av) printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", listen_fd, listen_inode); - (void) unlink(av[1]); + (void) unlink(TEST_SOCKET); if (bind(listen_fd, listen_sa, *len)) perror_msg_and_skip("bind"); printf("bind(%d, {sa_family=AF_UNIX, sun_path=\"%s\"}" - ", %u) = 0\n", listen_fd, listen_inode, av[1], (unsigned) *len); + ", %u) = 0\n", + listen_fd, listen_inode, TEST_SOCKET, (unsigned) *len); if (listen(listen_fd, 1)) perror_msg_and_skip("listen"); printf("listen(%d, 1) = 0\n", listen_fd, listen_inode); - unsigned int * const optval = tail_alloc(sizeof(unsigned int)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, optval); *len = sizeof(*optval); if (getsockopt(listen_fd, SOL_SOCKET, SO_PASSCRED, optval, len)) perror_msg_and_fail("getsockopt"); @@ -85,7 +70,7 @@ main(int ac, const char **av) perror_msg_and_fail("getsockname"); printf("getsockname(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", listen_fd, listen_inode, - av[1], (int) sizeof(addr), (int) *len); + TEST_SOCKET, (int) sizeof(addr), (int) *len); int connect_fd = socket(AF_UNIX, SOCK_STREAM, 0); if (connect_fd < 0) @@ -98,12 +83,12 @@ main(int ac, const char **av) perror_msg_and_fail("connect"); printf("connect(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, %u) = 0\n", - connect_fd, connect_inode, av[1], (unsigned) *len); + connect_fd, connect_inode, TEST_SOCKET, (unsigned) *len); struct sockaddr * const accept_sa = tail_alloc(sizeof(addr)); memset(accept_sa, 0, sizeof(addr)); *len = sizeof(addr); - int accept_fd = accept(listen_fd, accept_sa, len); + int accept_fd = do_accept(listen_fd, accept_sa, len); if (accept_fd < 0) perror_msg_and_fail("accept"); unsigned long accept_inode = inode_of_sockfd(accept_fd); @@ -119,7 +104,7 @@ main(int ac, const char **av) perror_msg_and_fail("getpeername"); printf("getpeername(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", connect_fd, connect_inode, - av[1], (int) sizeof(addr), (int) *len); + TEST_SOCKET, (int) sizeof(addr), (int) *len); char text[] = "text"; assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, 0) @@ -163,23 +148,23 @@ main(int ac, const char **av) perror_msg_and_fail("getsockname"); printf("getsockname(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", - listen_fd, listen_inode, av[1], + listen_fd, listen_inode, TEST_SOCKET, (int) sizeof(addr), (int) *len); if (connect(connect_fd, listen_sa, *len)) perror_msg_and_fail("connect"); printf("connect(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, %u) = 0\n", - connect_fd, connect_inode, av[1], (unsigned) *len); + connect_fd, connect_inode, TEST_SOCKET, (unsigned) *len); memset(accept_sa, 0, sizeof(addr)); *len = sizeof(addr); - accept_fd = accept(listen_fd, accept_sa, len); + accept_fd = do_accept(listen_fd, accept_sa, len); if (accept_fd < 0) perror_msg_and_fail("accept"); accept_inode = inode_of_sockfd(accept_fd); const char * const sun_path1 = - ((struct sockaddr_un *) accept_sa) -> sun_path + 1; + ((struct sockaddr_un *) accept_sa)->sun_path + 1; printf("accept(%d, {sa_family=AF_UNIX" ", sun_path=@\"%s\"}, [%d->%d]) = %d\n", listen_fd, listen_inode, sun_path1, @@ -192,7 +177,7 @@ main(int ac, const char **av) perror_msg_and_fail("getpeername"); printf("getpeername(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", - connect_fd, connect_inode, av[1], + connect_fd, connect_inode, TEST_SOCKET, (int) sizeof(addr), (int) *len); memset(accept_sa, 0, sizeof(addr)); @@ -224,7 +209,7 @@ main(int ac, const char **av) assert(close(accept_fd) == 0); printf("close(%d) = 0\n", accept_fd, accept_inode); - assert(unlink(av[1]) == 0); + assert(unlink(TEST_SOCKET) == 0); assert(close(listen_fd) == 0); printf("close(%d) = 0\n", diff --git a/tests-mx32/net-y-unix.test b/tests-mx32/net-y-unix.test index aec8159f..aaaf9705 100755 --- a/tests-mx32/net-y-unix.test +++ b/tests-mx32/net-y-unix.test @@ -2,45 +2,18 @@ # # Check decoding of network syscalls in -y mode. # -# Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -# strace -y is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - check_prog sed -addr="$NAME-local-stream" -run_prog "./$NAME" $addr > /dev/null - +run_prog > /dev/null run_strace -a20 -y -eclose,network $args > "$EXP" + # Filter out close() calls made by ld.so and libc. sed -n '/socket/,$p' < "$LOG" > "$OUT" - match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/net-yy-inet.c b/tests-mx32/net-yy-inet.c index f76f941d..03264faa 100644 --- a/tests-mx32/net-yy-inet.c +++ b/tests-mx32/net-yy-inet.c @@ -2,29 +2,10 @@ * This file is part of net-yy-inet strace test. * * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -38,78 +19,99 @@ #include #include +#include "accept_compat.h" + +#ifndef ADDR_FAMILY +# define ADDR_FAMILY_FIELD sin_family +# define ADDR_FAMILY AF_INET +# define AF_STR "AF_INET" +# define LOOPBACK_FIELD .sin_addr.s_addr = htonl(INADDR_LOOPBACK) +# define LOOPBACK "127.0.0.1" +# define SOCKADDR_TYPE sockaddr_in +# define TCP_STR "TCP" +# define INPORT sin_port +# define INPORT_STR "sin_port" +# define INADDR_STR "sin_addr=inet_addr(\"" LOOPBACK "\")" +# define SA_FIELDS "" +#endif + int main(void) { - const struct sockaddr_in addr = { - .sin_family = AF_INET, - .sin_addr.s_addr = htonl(INADDR_LOOPBACK) + skip_if_unavailable("/proc/self/fd/"); + + const struct SOCKADDR_TYPE addr = { + .ADDR_FAMILY_FIELD = ADDR_FAMILY, + LOOPBACK_FIELD }; struct sockaddr * const listen_sa = tail_memdup(&addr, sizeof(addr)); - socklen_t * const len = tail_alloc(sizeof(socklen_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); *len = sizeof(addr); - const int listen_fd = socket(AF_INET, SOCK_STREAM, 0); + const int listen_fd = socket(ADDR_FAMILY, SOCK_STREAM, 0); if (listen_fd < 0) perror_msg_and_skip("socket"); const unsigned long listen_inode = inode_of_sockfd(listen_fd); - printf("socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = %d\n", + printf("socket(" AF_STR ", SOCK_STREAM, IPPROTO_IP) = %d<" TCP_STR + ":[%lu]>\n", listen_fd, listen_inode); if (bind(listen_fd, listen_sa, *len)) perror_msg_and_skip("bind"); - printf("bind(%d, {sa_family=AF_INET, sin_port=htons(0)" - ", sin_addr=inet_addr(\"127.0.0.1\")}, %u) = 0\n", + printf("bind(%d<" TCP_STR ":[%lu]>, {sa_family=" AF_STR ", " INPORT_STR + "=htons(0), " INADDR_STR SA_FIELDS "}, %u) = 0\n", listen_fd, listen_inode, (unsigned) *len); if (listen(listen_fd, 1)) perror_msg_and_skip("listen"); - printf("listen(%d, 1) = 0\n", listen_fd, listen_inode); + printf("listen(%d<" TCP_STR ":[%lu]>, 1) = 0\n", + listen_fd, listen_inode); memset(listen_sa, 0, sizeof(addr)); *len = sizeof(addr); if (getsockname(listen_fd, listen_sa, len)) perror_msg_and_fail("getsockname"); const unsigned int listen_port = - ntohs(((struct sockaddr_in *) listen_sa) -> sin_port); - printf("getsockname(%d, {sa_family=AF_INET" - ", sin_port=htons(%u), sin_addr=inet_addr(\"127.0.0.1\")}" + ntohs(((struct SOCKADDR_TYPE *) listen_sa)->INPORT); + printf("getsockname(%d<" TCP_STR ":[" LOOPBACK ":%u]>, {sa_family=" + AF_STR ", " INPORT_STR "=htons(%u), " INADDR_STR SA_FIELDS "}" ", [%u]) = 0\n", listen_fd, listen_port, listen_port, (unsigned) *len); - unsigned int * const optval = tail_alloc(sizeof(unsigned int)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, optval); *len = sizeof(*optval); if (getsockopt(listen_fd, SOL_TCP, TCP_MAXSEG, optval, len)) perror_msg_and_fail("getsockopt"); - printf("getsockopt(%d, SOL_TCP, TCP_MAXSEG" - ", [%u], [%u]) = 0\n", + printf("getsockopt(%d<" TCP_STR ":[" LOOPBACK ":%u]>, SOL_TCP, " + "TCP_MAXSEG, [%u], [%u]) = 0\n", listen_fd, listen_port, *optval, (unsigned) *len); - const int connect_fd = socket(AF_INET, SOCK_STREAM, 0); + const int connect_fd = socket(ADDR_FAMILY, SOCK_STREAM, 0); if (connect_fd < 0) perror_msg_and_fail("socket"); const unsigned long connect_inode = inode_of_sockfd(connect_fd); - printf("socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = %d\n", + printf("socket(" AF_STR ", SOCK_STREAM, IPPROTO_IP) = %d<" TCP_STR + ":[%lu]>\n", connect_fd, connect_inode); *len = sizeof(addr); if (connect(connect_fd, listen_sa, *len)) perror_msg_and_fail("connect"); - printf("connect(%d, {sa_family=AF_INET, sin_port=htons(%u)" - ", sin_addr=inet_addr(\"127.0.0.1\")}, %u) = 0\n", + printf("connect(%d<" TCP_STR ":[%lu]>, {sa_family=" AF_STR ", " + INPORT_STR "=htons(%u), " INADDR_STR SA_FIELDS "}, %u) = 0\n", connect_fd, connect_inode, listen_port, (unsigned) *len); struct sockaddr * const accept_sa = tail_alloc(sizeof(addr)); memset(accept_sa, 0, sizeof(addr)); *len = sizeof(addr); - const int accept_fd = accept(listen_fd, accept_sa, len); + const int accept_fd = do_accept(listen_fd, accept_sa, len); if (accept_fd < 0) perror_msg_and_fail("accept"); const unsigned int connect_port = - ntohs(((struct sockaddr_in *) accept_sa) -> sin_port); - printf("accept(%d, {sa_family=AF_INET" - ", sin_port=htons(%u), sin_addr=inet_addr(\"127.0.0.1\")}" - ", [%u]) = %d127.0.0.1:%u]>\n", + ntohs(((struct SOCKADDR_TYPE *) accept_sa)->INPORT); + printf("accept(%d<" TCP_STR ":[" LOOPBACK ":%u]>, {sa_family=" AF_STR + ", " INPORT_STR "=htons(%u), " INADDR_STR SA_FIELDS "}" + ", [%u]) = %d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>\n", listen_fd, listen_port, connect_port, (unsigned) *len, accept_fd, listen_port, connect_port); @@ -117,9 +119,9 @@ main(void) *len = sizeof(addr); if (getpeername(accept_fd, accept_sa, len)) perror_msg_and_fail("getpeername"); - printf("getpeername(%d127.0.0.1:%u]>" - ", {sa_family=AF_INET, sin_port=htons(%u)" - ", sin_addr=inet_addr(\"127.0.0.1\")}, [%u]) = 0\n", + printf("getpeername(%d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>" + ", {sa_family=" AF_STR ", " INPORT_STR "=htons(%u)" + ", " INADDR_STR SA_FIELDS "}, [%u]) = 0\n", accept_fd, listen_port, connect_port, connect_port, (unsigned) *len); @@ -127,16 +129,16 @@ main(void) *len = sizeof(addr); if (getpeername(connect_fd, listen_sa, len)) perror_msg_and_fail("getpeername"); - printf("getpeername(%d127.0.0.1:%u]>" - ", {sa_family=AF_INET, sin_port=htons(%u)" - ", sin_addr=inet_addr(\"127.0.0.1\")}, [%u]) = 0\n", + printf("getpeername(%d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>" + ", {sa_family=" AF_STR ", " INPORT_STR "=htons(%u)" + ", " INADDR_STR SA_FIELDS "}, [%u]) = 0\n", connect_fd, connect_port, listen_port, listen_port, (unsigned) *len); *len = sizeof(*optval); if (setsockopt(connect_fd, SOL_TCP, TCP_MAXSEG, optval, *len)) perror_msg_and_fail("setsockopt"); - printf("setsockopt(%d127.0.0.1:%u]>" + printf("setsockopt(%d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>" ", SOL_TCP, TCP_MAXSEG, [%u], %u) = 0\n", connect_fd, connect_port, listen_port, *optval, (unsigned) *len); @@ -144,28 +146,30 @@ main(void) char text[] = "text"; assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTROUTE | MSG_DONTWAIT, NULL, 0) == sizeof(text) - 1); - printf("sendto(%d127.0.0.1:%u]>, \"%s\", %u" - ", MSG_DONTROUTE|MSG_DONTWAIT, NULL, 0) = %u\n", + printf("sendto(%d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>, " + "\"%s\", %u, MSG_DONTROUTE|MSG_DONTWAIT, NULL, 0) = %u\n", connect_fd, connect_port, listen_port, text, (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); assert(close(connect_fd) == 0); - printf("close(%d127.0.0.1:%u]>) = 0\n", + printf("close(%d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>) = " + "0\n", connect_fd, connect_port, listen_port); assert(recvfrom(accept_fd, text, sizeof(text) - 1, MSG_WAITALL, NULL, NULL) == sizeof(text) - 1); - printf("recvfrom(%d127.0.0.1:%u]>, \"%s\", %u" - ", MSG_WAITALL, NULL, NULL) = %u\n", + printf("recvfrom(%d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>, " + "\"%s\", %u, MSG_WAITALL, NULL, NULL) = %u\n", accept_fd, listen_port, connect_port, text, (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); assert(close(accept_fd) == 0); - printf("close(%d127.0.0.1:%u]>) = 0\n", + printf("close(%d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>) = " + "0\n", accept_fd, listen_port, connect_port); assert(close(listen_fd) == 0); - printf("close(%d) = 0\n", + printf("close(%d<" TCP_STR ":[" LOOPBACK ":%u]>) = 0\n", listen_fd, listen_port); puts("+++ exited with 0 +++"); diff --git a/tests-mx32/net-yy-inet.test b/tests-mx32/net-yy-inet.test index 2ebf91fa..71a2a0c7 100755 --- a/tests-mx32/net-yy-inet.test +++ b/tests-mx32/net-yy-inet.test @@ -3,44 +3,19 @@ # Check decoding of ip:port pairs associated with socket descriptors # # Copyright (c) 2014-2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -# strace -yy is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - check_prog sed -run_prog ./netlink_inet_diag - -run_prog "./$NAME" > /dev/null +run_prog ../netlink_inet_diag +run_prog > /dev/null run_strace -a22 -yy -eclose,network $args > "$EXP" + # Filter out close() calls made by ld.so and libc. sed -n '/socket/,$p' < "$LOG" > "$OUT" - match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/net-yy-inet6.c b/tests-mx32/net-yy-inet6.c new file mode 100644 index 00000000..b8a7e240 --- /dev/null +++ b/tests-mx32/net-yy-inet6.c @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#define ADDR_FAMILY_FIELD sin6_family +#define ADDR_FAMILY AF_INET6 +#define AF_STR "AF_INET6" +#define LOOPBACK_FIELD .sin6_addr = IN6ADDR_LOOPBACK_INIT +#define LOOPBACK "[::1]" +#define SOCKADDR_TYPE sockaddr_in6 +#define TCP_STR "TCPv6" +#define INPORT sin6_port +#define INPORT_STR "sin6_port" +#define INADDR_STR "sin6_flowinfo=htonl(0)" \ + ", inet_pton(AF_INET6, \"::1\", &sin6_addr)" +#define SA_FIELDS ", sin6_scope_id=0" + +#include "net-yy-inet.c" diff --git a/tests-mx32/net-yy-inet6.gen.test b/tests-mx32/net-yy-inet6.gen.test new file mode 100755 index 00000000..afa38c6e --- /dev/null +++ b/tests-mx32/net-yy-inet6.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-yy-inet6 +net-yy-inet.test ); do not edit. +set -- +. "${srcdir=.}/net-yy-inet.test" diff --git a/tests-mx32/net-yy-netlink.c b/tests-mx32/net-yy-netlink.c index 64d0efca..38b1a0d4 100644 --- a/tests-mx32/net-yy-netlink.c +++ b/tests-mx32/net-yy-netlink.c @@ -1,31 +1,12 @@ /* * This file is part of net-yy-netlink strace test. * - * Copyright (c) 2013-2016 Dmitry V. Levin + * Copyright (c) 2013-2017 Dmitry V. Levin * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,24 +17,21 @@ #include #include #include -#include +#include "netlink.h" #include #include -#if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG -# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG -#endif - int main(void) { - unsigned magic = 1234; + skip_if_unavailable("/proc/self/fd/"); + struct sockaddr_nl addr = { .nl_family = AF_NETLINK, - .nl_pid = 1234 + .nl_pid = getpid() }; struct sockaddr *const sa = tail_memdup(&addr, sizeof(addr)); - socklen_t * const len = tail_alloc(sizeof(socklen_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); *len = sizeof(addr); const int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG); @@ -67,17 +45,17 @@ main(void) perror_msg_and_skip("bind"); printf("bind(%d, {sa_family=AF_NETLINK" ", nl_pid=%u, nl_groups=00000000}, %u) = 0\n", - fd, inode, magic, (unsigned) *len); + fd, inode, addr.nl_pid, (unsigned) *len); if (getsockname(fd, sa, len)) perror_msg_and_fail("getsockname"); printf("getsockname(%d, {sa_family=AF_NETLINK" ", nl_pid=%u, nl_groups=00000000}, [%u]) = 0\n", - fd, magic, magic, (unsigned) *len); + fd, addr.nl_pid, addr.nl_pid, (unsigned) *len); if (close(fd)) perror_msg_and_fail("close"); - printf("close(%d) = 0\n", fd, magic); + printf("close(%d) = 0\n", fd, addr.nl_pid); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/net-yy-netlink.test b/tests-mx32/net-yy-netlink.test index bff1d861..892c9799 100755 --- a/tests-mx32/net-yy-netlink.test +++ b/tests-mx32/net-yy-netlink.test @@ -6,44 +6,19 @@ # Copyright (c) 2014 Masatake YAMATO # Copyright (c) 2014-2016 Dmitry V. Levin # Copyright (c) 2016 Fabien Siron +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -# strace -yy is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - check_prog sed -run_prog ./netlink_netlink_diag - -run_prog "./$NAME" > /dev/null +run_prog ../netlink_netlink_diag +run_prog > /dev/null run_strace -a22 -yy -eclose,network $args > "$EXP" + # Filter out close() calls made by ld.so and libc. sed -n '/socket/,$p' < "$LOG" > "$OUT" - match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/net-yy-unix.c b/tests-mx32/net-yy-unix.c index 63637bdd..0380da3f 100644 --- a/tests-mx32/net-yy-unix.c +++ b/tests-mx32/net-yy-unix.c @@ -1,30 +1,11 @@ /* * This file is part of net-yy-unix strace test. * - * Copyright (c) 2013-2016 Dmitry V. Levin + * Copyright (c) 2013-2017 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -34,23 +15,26 @@ #include #include #include -#include #include #include +#include "accept_compat.h" + +#define TEST_SOCKET "net-yy-unix.socket" + int -main(int ac, const char **av) +main(void) { - assert(ac == 2); + skip_if_unavailable("/proc/self/fd/"); - struct sockaddr_un addr = { .sun_family = AF_UNIX }; - unsigned int sun_path_len = strlen(av[1]); - assert(sun_path_len > 0 && sun_path_len <= sizeof(addr.sun_path)); - strncpy(addr.sun_path, av[1], sizeof(addr.sun_path)); + struct sockaddr_un addr = { + .sun_family = AF_UNIX, + .sun_path = TEST_SOCKET + }; struct sockaddr * const listen_sa = tail_memdup(&addr, sizeof(addr)); - socklen_t * const len = tail_alloc(sizeof(socklen_t)); - *len = offsetof(struct sockaddr_un, sun_path) + strlen(av[1]) + 1; + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); + *len = offsetof(struct sockaddr_un, sun_path) + strlen(TEST_SOCKET) + 1; if (*len > sizeof(addr)) *len = sizeof(addr); @@ -61,24 +45,25 @@ main(int ac, const char **av) printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", listen_fd, listen_inode); - (void) unlink(av[1]); + (void) unlink(TEST_SOCKET); if (bind(listen_fd, listen_sa, *len)) perror_msg_and_skip("bind"); printf("bind(%d, {sa_family=AF_UNIX, sun_path=\"%s\"}" - ", %u) = 0\n", listen_fd, listen_inode, av[1], (unsigned) *len); + ", %u) = 0\n", + listen_fd, listen_inode, TEST_SOCKET, (unsigned) *len); if (listen(listen_fd, 1)) perror_msg_and_skip("listen"); printf("listen(%d, 1) = 0\n", - listen_fd, listen_inode, av[1]); + listen_fd, listen_inode, TEST_SOCKET); - unsigned int * const optval = tail_alloc(sizeof(unsigned int)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, optval); *len = sizeof(*optval); if (getsockopt(listen_fd, SOL_SOCKET, SO_PASSCRED, optval, len)) perror_msg_and_fail("getsockopt"); printf("getsockopt(%d, SOL_SOCKET, SO_PASSCRED" ", [%u], [%u]) = 0\n", - listen_fd, listen_inode, av[1], *optval, (unsigned) *len); + listen_fd, listen_inode, TEST_SOCKET, *optval, (unsigned) *len); memset(listen_sa, 0, sizeof(addr)); *len = sizeof(addr); @@ -86,7 +71,7 @@ main(int ac, const char **av) perror_msg_and_fail("getsockname"); printf("getsockname(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", listen_fd, listen_inode, - av[1], av[1], (int) sizeof(addr), (int) *len); + TEST_SOCKET, TEST_SOCKET, (int) sizeof(addr), (int) *len); int connect_fd = socket(AF_UNIX, SOCK_STREAM, 0); if (connect_fd < 0) @@ -99,19 +84,20 @@ main(int ac, const char **av) perror_msg_and_fail("connect"); printf("connect(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, %u) = 0\n", - connect_fd, connect_inode, av[1], (unsigned) *len); + connect_fd, connect_inode, TEST_SOCKET, (unsigned) *len); struct sockaddr * const accept_sa = tail_alloc(sizeof(addr)); memset(accept_sa, 0, sizeof(addr)); *len = sizeof(addr); - int accept_fd = accept(listen_fd, accept_sa, len); + int accept_fd = do_accept(listen_fd, accept_sa, len); if (accept_fd < 0) perror_msg_and_fail("accept"); unsigned long accept_inode = inode_of_sockfd(accept_fd); printf("accept(%d, {sa_family=AF_UNIX}" ", [%d->%d]) = %d%lu,\"%s\"]>\n", - listen_fd, listen_inode, av[1], (int) sizeof(addr), (int) *len, - accept_fd, accept_inode, connect_inode, av[1]); + listen_fd, listen_inode, TEST_SOCKET, + (int) sizeof(addr), (int) *len, + accept_fd, accept_inode, connect_inode, TEST_SOCKET); memset(listen_sa, 0, sizeof(addr)); *len = sizeof(addr); @@ -120,7 +106,7 @@ main(int ac, const char **av) printf("getpeername(%d%lu]>, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", connect_fd, connect_inode, - accept_inode, av[1], (int) sizeof(addr), (int) *len); + accept_inode, TEST_SOCKET, (int) sizeof(addr), (int) *len); char text[] = "text"; assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, 0) @@ -134,7 +120,7 @@ main(int ac, const char **av) == sizeof(text) - 1); printf("recvfrom(%d%lu,\"%s\"]>, \"%s\", %u, MSG_DONTWAIT" ", NULL, NULL) = %u\n", - accept_fd, accept_inode, connect_inode, av[1], text, + accept_fd, accept_inode, connect_inode, TEST_SOCKET, text, (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); assert(close(connect_fd) == 0); @@ -143,7 +129,7 @@ main(int ac, const char **av) assert(close(accept_fd) == 0); printf("close(%d%lu,\"%s\"]>) = 0\n", - accept_fd, accept_inode, connect_inode, av[1]); + accept_fd, accept_inode, connect_inode, TEST_SOCKET); connect_fd = socket(AF_UNIX, SOCK_STREAM, 0); if (connect_fd < 0) @@ -166,27 +152,27 @@ main(int ac, const char **av) perror_msg_and_fail("getsockname"); printf("getsockname(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", listen_fd, listen_inode, - av[1], av[1], (int) sizeof(addr), (int) *len); + TEST_SOCKET, TEST_SOCKET, (int) sizeof(addr), (int) *len); if (connect(connect_fd, listen_sa, *len)) perror_msg_and_fail("connect"); printf("connect(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, %u) = 0\n", - connect_fd, connect_inode, av[1], (unsigned) *len); + connect_fd, connect_inode, TEST_SOCKET, (unsigned) *len); memset(accept_sa, 0, sizeof(addr)); *len = sizeof(addr); - accept_fd = accept(listen_fd, accept_sa, len); + accept_fd = do_accept(listen_fd, accept_sa, len); if (accept_fd < 0) perror_msg_and_fail("accept"); accept_inode = inode_of_sockfd(accept_fd); const char * const sun_path1 = - ((struct sockaddr_un *) accept_sa) -> sun_path + 1; + ((struct sockaddr_un *) accept_sa)->sun_path + 1; printf("accept(%d, {sa_family=AF_UNIX" ", sun_path=@\"%s\"}, [%d->%d]) = %d%lu,\"%s\"]>\n", - listen_fd, listen_inode, av[1], sun_path1, + listen_fd, listen_inode, TEST_SOCKET, sun_path1, (int) sizeof(addr), (int) *len, - accept_fd, accept_inode, connect_inode, av[1]); + accept_fd, accept_inode, connect_inode, TEST_SOCKET); memset(listen_sa, 0, sizeof(addr)); *len = sizeof(addr); @@ -194,7 +180,7 @@ main(int ac, const char **av) perror_msg_and_fail("getpeername"); printf("getpeername(%d%lu,@\"%s\"]>, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", connect_fd, connect_inode, - accept_inode, sun_path1, av[1], (int) sizeof(addr), (int) *len); + accept_inode, sun_path1, TEST_SOCKET, (int) sizeof(addr), (int) *len); assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, 0) == sizeof(text) - 1); @@ -207,7 +193,7 @@ main(int ac, const char **av) == sizeof(text) - 1); printf("recvfrom(%d%lu,\"%s\"]>, \"%s\", %u, MSG_DONTWAIT" ", NULL, NULL) = %u\n", - accept_fd, accept_inode, connect_inode, av[1], text, + accept_fd, accept_inode, connect_inode, TEST_SOCKET, text, (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); assert(close(connect_fd) == 0); @@ -216,13 +202,13 @@ main(int ac, const char **av) assert(close(accept_fd) == 0); printf("close(%d%lu,\"%s\"]>) = 0\n", - accept_fd, accept_inode, connect_inode, av[1]); + accept_fd, accept_inode, connect_inode, TEST_SOCKET); - assert(unlink(av[1]) == 0); + assert(unlink(TEST_SOCKET) == 0); assert(close(listen_fd) == 0); printf("close(%d) = 0\n", - listen_fd, listen_inode, av[1]); + listen_fd, listen_inode, TEST_SOCKET); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/net-yy-unix.test b/tests-mx32/net-yy-unix.test index b82761c3..d00dd2c1 100755 --- a/tests-mx32/net-yy-unix.test +++ b/tests-mx32/net-yy-unix.test @@ -4,46 +4,19 @@ # associated with unix domain socket descriptors. # # Copyright (c) 2014 Masatake YAMATO -# Copyright (c) 2014-2016 Dmitry V. Levin +# Copyright (c) 2014-2018 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -# strace -yy is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - check_prog sed -run_prog ./netlink_unix_diag - -addr="$NAME-local-stream" -run_prog "./$NAME" $addr > /dev/null +run_prog ../netlink_unix_diag +run_prog > /dev/null run_strace -a22 -yy -eclose,network $args > "$EXP" + # Filter out close() calls made by ld.so and libc. sed -n '/socket/,$p' < "$LOG" > "$OUT" - match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/net.expected b/tests-mx32/net.expected index 80dd0701..e33e2966 100644 --- a/tests-mx32/net.expected +++ b/tests-mx32/net.expected @@ -3,5 +3,5 @@ [1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +bind\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="net-local-stream"\}, 19\) += 0 [1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +listen\(0, 5\) += 0 [1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +getsockname\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="net-local-stream"\}, \[19\]\) += 0 -[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +accept\(0, \{sa_family=AF_(LOCAL|UNIX|FILE)\}, \[19->2\]\) += 1 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +accept4?\(0, \{sa_family=AF_(LOCAL|UNIX|FILE)\}, \[19->2\](, 0)?\) += 1 [1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +connect\(1, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="net-local-stream"\}, 19\) += 0 diff --git a/tests-mx32/net.test b/tests-mx32/net.test index cf943ffa..cca850a9 100755 --- a/tests-mx32/net.test +++ b/tests-mx32/net.test @@ -1,11 +1,16 @@ #!/bin/sh - +# # Check how network syscalls are traced. +# +# Copyright (c) 2014-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./net-accept-connect net-local-stream -run_strace_merge -enetwork $args +run_prog ../net-accept-connect net-local-stream +run_strace_merge -e%network $args match_grep exit 0 diff --git a/tests-mx32/netlink_audit.c b/tests-mx32/netlink_audit.c new file mode 100644 index 00000000..eba609a1 --- /dev/null +++ b/tests-mx32/netlink_audit.c @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include "netlink.h" + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = AUDIT_GET, + .nlmsg_flags = NLM_F_REQUEST, + }; + + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=AUDIT_GET" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_AUDIT); + + test_nlmsg_type(fd); + + printf("+++ exited with 0 +++\n"); + + return 0; +} diff --git a/tests-mx32/netlink_audit.gen.test b/tests-mx32/netlink_audit.gen.test new file mode 100755 index 00000000..5c17038e --- /dev/null +++ b/tests-mx32/netlink_audit.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_audit +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/netlink_crypto.c b/tests-mx32/netlink_crypto.c new file mode 100644 index 00000000..e2a5be0c --- /dev/null +++ b/tests-mx32/netlink_crypto.c @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_CRYPTOUSER_H + +# include +# include +# include +# include +# include "test_netlink.h" + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = CRYPTO_MSG_NEWALG, + .nlmsg_flags = NLM_F_REQUEST, + }; + + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=CRYPTO_MSG_NEWALG" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = CRYPTO_MSG_GETALG; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=CRYPTO_MSG_GETALG" + ", flags=NLM_F_REQUEST|NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = CRYPTO_MSG_NEWALG; + nlh.nlmsg_flags = NLM_F_ECHO | NLM_F_REPLACE; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=CRYPTO_MSG_NEWALG" + ", flags=NLM_F_ECHO|NLM_F_REPLACE, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = CRYPTO_MSG_DELALG; + nlh.nlmsg_flags = NLM_F_ECHO | NLM_F_NONREC; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=CRYPTO_MSG_DELALG" + ", flags=NLM_F_ECHO|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = CRYPTO_MSG_UPDATEALG; + nlh.nlmsg_flags = NLM_F_REPLACE; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=CRYPTO_MSG_UPDATEALG" + ", flags=%#x /* NLM_F_??? */, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, NLM_F_REPLACE, + (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_crypto_msg_newalg(const int fd) +{ + struct crypto_user_alg alg = { + .cru_name = "abcd", + .cru_driver_name = "efgh", + .cru_module_name = "dcba", + .cru_type = 0xabcdfabc, + .cru_mask = 0xfedabacd, + .cru_refcnt = 0xbcacfacd, + .cru_flags = 0xefacdbad + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(alg)); + + TEST_NETLINK_OBJECT_EX(fd, nlh0, + CRYPTO_MSG_NEWALG, NLM_F_REQUEST, + alg, print_quoted_memory, + printf("{cru_name=\"abcd\"" + ", cru_driver_name=\"efgh\"" + ", cru_module_name=\"dcba\""); + PRINT_FIELD_X(", ", alg, cru_type); + PRINT_FIELD_X(", ", alg, cru_mask); + PRINT_FIELD_U(", ", alg, cru_refcnt); + PRINT_FIELD_X(", ", alg, cru_flags); + printf("}")); + + fill_memory_ex(alg.cru_name, sizeof(alg.cru_name), '0', 10); + fill_memory_ex(alg.cru_driver_name, sizeof(alg.cru_driver_name), + 'a', 'z' - 'a' + 1); + fill_memory_ex(alg.cru_module_name, sizeof(alg.cru_module_name), + 'A', 'Z' - 'A' + 1); + + TEST_NETLINK_OBJECT_EX(fd, nlh0, + CRYPTO_MSG_NEWALG, NLM_F_REQUEST, + alg, print_quoted_memory, + printf("{cru_name="); + print_quoted_memory(alg.cru_name, + sizeof(alg.cru_name) - 1); + printf("..., cru_driver_name="); + print_quoted_memory(alg.cru_driver_name, + sizeof(alg.cru_driver_name) - 1); + printf("..., cru_module_name="); + print_quoted_memory(alg.cru_module_name, + sizeof(alg.cru_module_name) - 1); + PRINT_FIELD_X("..., ", alg, cru_type); + PRINT_FIELD_X(", ", alg, cru_mask); + PRINT_FIELD_U(", ", alg, cru_refcnt); + PRINT_FIELD_X(", ", alg, cru_flags); + printf("}")); +} + +static void +test_crypto_msg_unspec(const int fd) +{ + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, 4); + + TEST_NETLINK_(fd, nlh0, + 0xffff, "0xffff /* CRYPTO_MSG_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + 4, "abcd", 4, printf("\"\\x61\\x62\\x63\\x64\"")); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_CRYPTO); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + test_crypto_msg_newalg(fd); + test_crypto_msg_unspec(fd); + + printf("+++ exited with 0 +++\n"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_CRYPTOUSER_H") + +#endif diff --git a/tests-mx32/netlink_crypto.gen.test b/tests-mx32/netlink_crypto.gen.test new file mode 100755 index 00000000..fcb4c3d9 --- /dev/null +++ b/tests-mx32/netlink_crypto.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_crypto +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/netlink_generic.c b/tests-mx32/netlink_generic.c new file mode 100644 index 00000000..485ece11 --- /dev/null +++ b/tests-mx32/netlink_generic.c @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +/* This test case is based on netlink_selinux.c */ + +#include "tests.h" + +#include +#include +#include +#include +#include "netlink.h" +#include + +static void +test_nlmsg_type(const int fd) +{ + /* + * Though GENL_ID_CTRL number is statically fixed in this test case, + * strace does not have a builtin knowledge that the corresponding + * string is "nlctrl". + */ + long rc; + struct { + const struct nlmsghdr nlh; + struct genlmsghdr gnlh; + } req = { + .nlh = { + .nlmsg_len = sizeof(req), + .nlmsg_type = GENL_ID_CTRL, + .nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST + }, + .gnlh = { + .cmd = CTRL_CMD_GETFAMILY + } + }; + + rc = sendto(fd, &req, sizeof(req), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=nlctrl" + ", flags=NLM_F_REQUEST|0x300, seq=0, pid=0}" + ", \"\\x03\\x00\\x00\\x00\"}, %u" + ", MSG_DONTWAIT, NULL, 0) = %s\n", + fd, req.nlh.nlmsg_len, + (unsigned int) sizeof(req), sprintrc(rc)); +} + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_GENERIC); + + test_nlmsg_type(fd); + + printf("+++ exited with 0 +++\n"); + + return 0; +} diff --git a/tests-mx32/netlink_generic.gen.test b/tests-mx32/netlink_generic.gen.test new file mode 100755 index 00000000..6f304d3a --- /dev/null +++ b/tests-mx32/netlink_generic.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_generic +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/netlink_inet_diag.c b/tests-mx32/netlink_inet_diag.c index 2332e203..e3ccc05c 100644 --- a/tests-mx32/netlink_inet_diag.c +++ b/tests-mx32/netlink_inet_diag.c @@ -2,29 +2,10 @@ * This file is part of inet-yy strace test. * * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,7 +13,7 @@ #include #include #include -#include +#include "netlink.h" #include #include @@ -99,8 +80,8 @@ check_responses(const int fd) perror_msg_and_skip("recvmsg"); struct nlmsghdr *h = &hdr_buf.hdr; - if (!NLMSG_OK(h, ret)) - error_msg_and_skip("!NLMSG_OK"); + if (!is_nlmsg_ok(h, ret)) + error_msg_and_skip("!is_nlmsg_ok"); if (h->nlmsg_type == NLMSG_ERROR) { const struct nlmsgerr *err = NLMSG_DATA(h); if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err))) diff --git a/tests-mx32/netlink_kobject_uevent.c b/tests-mx32/netlink_kobject_uevent.c new file mode 100644 index 00000000..17f3e1ea --- /dev/null +++ b/tests-mx32/netlink_kobject_uevent.c @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include "netlink.h" +#include "netlink_kobject_uevent.h" + +static const char *errstr; + +static ssize_t +sys_send(const int fd, const void *const buf, const size_t len) +{ + const ssize_t rc = sendto(fd, buf, len, MSG_DONTWAIT, NULL, 0); + errstr = sprintrc(rc); + return rc; +} + +static void +test_nlmsg_type_udev(const int fd) +{ + static const char extra[] = "12345678"; + struct udev_monitor_netlink_header uh = { + .prefix = "libudev", + .magic = htonl(0xfeedcafe), + .header_size = sizeof(uh), + .properties_off = 40, + .properties_len = 299, + .filter_subsystem_hash = htonl(0xc370b302), + .filter_devtype_hash = htonl(0x10800000), + .filter_tag_bloom_hi = htonl(0x2000400), + .filter_tag_bloom_lo = htonl(0x10800000), + }; + const unsigned int extra_len = LENGTH_OF(extra); + const unsigned int uh_len = sizeof(uh); + + char *const buf = tail_alloc(uh_len + extra_len); + memcpy(buf + extra_len, &uh, uh_len); + + sys_send(fd, buf + extra_len, uh_len); + printf("sendto(%d, {{prefix=\"%s\", magic=htonl(%#x)" + ", header_size=%u, properties_off=%u, properties_len=%u" + ", filter_subsystem_hash=htonl(%#x)" + ", filter_devtype_hash=htonl(%#x)" + ", filter_tag_bloom_hi=htonl(%#x)" + ", filter_tag_bloom_lo=htonl(%#x)}}, %u, MSG_DONTWAIT, NULL, " + "0) = %s\n" + , fd, uh.prefix, + ntohl(uh.magic), uh.header_size, uh.properties_off, + uh.properties_len, ntohl(uh.filter_subsystem_hash), + ntohl(uh.filter_devtype_hash), ntohl(uh.filter_tag_bloom_hi), + ntohl(uh.filter_tag_bloom_lo), uh_len, errstr); + + memcpy(buf, &uh, uh_len); + memcpy(buf + uh_len, extra, extra_len); + sys_send(fd, buf, uh_len + extra_len); + printf("sendto(%d, {{prefix=\"%s\", magic=htonl(%#x)" + ", header_size=%u, properties_off=%u, properties_len=%u" + ", filter_subsystem_hash=htonl(%#x)" + ", filter_devtype_hash=htonl(%#x)" + ", filter_tag_bloom_hi=htonl(%#x)" + ", filter_tag_bloom_lo=htonl(%#x)}, " + , fd, uh.prefix, + ntohl(uh.magic), uh.header_size, uh.properties_off, + uh.properties_len, ntohl(uh.filter_subsystem_hash), + ntohl(uh.filter_devtype_hash), ntohl(uh.filter_tag_bloom_hi), + ntohl(uh.filter_tag_bloom_lo)); + print_quoted_memory(buf + uh_len, extra_len); + printf("}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + uh_len + extra_len, errstr); + + memcpy(buf + extra_len + 1, &uh, uh_len - 1); + sys_send(fd, buf + extra_len + 1, uh_len); + printf("sendto(%d, ", fd); + print_quoted_memory(&uh, MIN(uh_len - 1, DEFAULT_STRLEN)); + printf("%s, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + (uh_len - 1 > DEFAULT_STRLEN ? "..." : ""), + uh_len, errstr); +} + +static void +test_nlmsg_type_kernel(const int fd) +{ + struct udev_monitor_netlink_header uh = { + .prefix = "change@", + .magic = htonl(0xfeedcafe), + .header_size = sizeof(uh), + .properties_off = 10, + .properties_len = 299, + .filter_subsystem_hash = htonl(0xfffffff), + .filter_devtype_hash = htonl(0x10000000), + .filter_tag_bloom_hi = htonl(0x2000400), + }; + const unsigned int uh_len = sizeof(uh); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct udev_monitor_netlink_header, p); + memcpy(p, &uh, uh_len); + + sys_send(fd, p, uh_len); + printf("sendto(%d, ", fd); + print_quoted_memory(&uh, MIN(uh_len, DEFAULT_STRLEN)); + printf("%s, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + (uh_len > DEFAULT_STRLEN ? "..." : ""), + uh_len, errstr); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_KOBJECT_UEVENT); + + test_nlmsg_type_udev(fd); + test_nlmsg_type_kernel(fd); + /* test using data that looks like a zero-length C string */ + char *const buf = tail_alloc(DEFAULT_STRLEN + 1); + buf[0] = '='; + fill_memory_ex(buf + 1, DEFAULT_STRLEN, 0, DEFAULT_STRLEN); + + sys_send(fd, buf + 1, DEFAULT_STRLEN); + printf("sendto(%d, ", fd); + print_quoted_memory(buf + 1, DEFAULT_STRLEN); + printf(", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + DEFAULT_STRLEN, errstr); + + sys_send(fd, buf, DEFAULT_STRLEN + 1); + printf("sendto(%d, ", fd); + print_quoted_memory(buf, DEFAULT_STRLEN); + printf("..., %u, MSG_DONTWAIT, NULL, 0) = %s\n", + DEFAULT_STRLEN + 1, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/netlink_kobject_uevent.gen.test b/tests-mx32/netlink_kobject_uevent.gen.test new file mode 100755 index 00000000..46bdebd1 --- /dev/null +++ b/tests-mx32/netlink_kobject_uevent.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_kobject_uevent +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/netlink_netfilter.c b/tests-mx32/netlink_netfilter.c new file mode 100644 index 00000000..6f535d4b --- /dev/null +++ b/tests-mx32/netlink_netfilter.c @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2017, 2018 Chen Jingpiao + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_H + +# include +# include +# include +# include +# include +# include +# include "test_netlink.h" +# include +# ifdef HAVE_LINUX_NETFILTER_NF_TABLES_H +# include +# endif + +# ifndef NFNETLINK_V0 +# define NFNETLINK_V0 0 +# endif +# ifndef NFNL_SUBSYS_NFTABLES +# define NFNL_SUBSYS_NFTABLES 10 +# endif +# ifndef NFT_MSG_NEWTABLE +# define NFT_MSG_NEWTABLE 0 +# endif + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + +# ifdef NFNL_MSG_BATCH_BEGIN + nlh.nlmsg_type = NFNL_MSG_BATCH_BEGIN; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=NFNL_MSG_BATCH_BEGIN" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +# endif + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK << 8 | 0xff; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK<<8|0xff /* IPCTNL_MSG_CT_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = 0xffff; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=0xff /* NFNL_SUBSYS_??? */<<8|0xff" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_nlmsg_done(const int fd) +{ + const int num = 0xabcdefad; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(num)); + + TEST_NETLINK(fd, nlh0, NLMSG_DONE, NLM_F_REQUEST, + sizeof(num), &num, sizeof(num), + printf("%d", num)); +} + +static void +test_nfgenmsg(const int fd) +{ + static const struct nlattr nla = { + .nla_len = sizeof(nla), + .nla_type = 0x0bcd + }; + + struct nfgenmsg msg = { + .nfgen_family = AF_UNIX, + .version = NFNETLINK_V0, + .res_id = NFNL_SUBSYS_NFTABLES + }; + char str_buf[NLMSG_ALIGN(sizeof(msg)) + 4]; + char nla_buf[NLMSG_ALIGN(sizeof(msg)) + sizeof(nla)]; + + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, + MAX(sizeof(str_buf), sizeof(nla_buf))); + + TEST_NETLINK_OBJECT_EX_(fd, nlh0, + NFNL_SUBSYS_NFTABLES << 8 | NFT_MSG_NEWTABLE, + "NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_NEWTABLE", + NLM_F_REQUEST, "NLM_F_REQUEST", + msg, print_quoted_hex, + printf("{nfgen_family=AF_UNIX"); + printf(", version=NFNETLINK_V0"); + printf(", res_id="); + if (htons(NFNL_SUBSYS_NFTABLES) == NFNL_SUBSYS_NFTABLES) + printf("htons(NFNL_SUBSYS_NFTABLES)"); + else + printf("NFNL_SUBSYS_NFTABLES"); + ); + + msg.res_id = htons(NFNL_SUBSYS_NFTABLES); + TEST_NETLINK_(fd, nlh0, + NFNL_SUBSYS_NFTABLES << 8 | NFT_MSG_NEWTABLE, + "NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_NEWTABLE", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(msg), &msg, sizeof(msg), + printf("{nfgen_family=AF_UNIX"); + printf(", version=NFNETLINK_V0"); + printf(", res_id=htons(NFNL_SUBSYS_NFTABLES)")); + + msg.res_id = htons(0xabcd); + TEST_NETLINK_(fd, nlh0, + NFNL_SUBSYS_NFTABLES << 8 | NFT_MSG_NEWTABLE, + "NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_NEWTABLE", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(msg), &msg, sizeof(msg), + printf("{nfgen_family=AF_UNIX"); + printf(", version=NFNETLINK_V0"); + printf(", res_id=htons(%d)", 0xabcd)); + +# ifdef NFNL_MSG_BATCH_BEGIN + msg.res_id = htons(NFNL_SUBSYS_NFTABLES); + TEST_NETLINK(fd, nlh0, + NFNL_MSG_BATCH_BEGIN, NLM_F_REQUEST, + sizeof(msg), &msg, sizeof(msg), + printf("{nfgen_family=AF_UNIX"); + printf(", version=NFNETLINK_V0"); + printf(", res_id=htons(%d)", NFNL_SUBSYS_NFTABLES)); + + msg.res_id = htons(0xabcd); + memcpy(str_buf, &msg, sizeof(msg)); + memcpy(str_buf + NLMSG_ALIGN(sizeof(msg)), "1234", 4); + + TEST_NETLINK(fd, nlh0, + NFNL_MSG_BATCH_BEGIN, NLM_F_REQUEST, + sizeof(str_buf), str_buf, sizeof(str_buf), + printf("{nfgen_family=AF_UNIX"); + printf(", version=NFNETLINK_V0"); + printf(", res_id=htons(%d)" + ", \"\\x31\\x32\\x33\\x34\"", 0xabcd)); +# endif /* NFNL_MSG_BATCH_BEGIN */ + + msg.res_id = htons(NFNL_SUBSYS_NFTABLES); + memcpy(nla_buf, &msg, sizeof(msg)); + memcpy(nla_buf + NLMSG_ALIGN(sizeof(msg)), &nla, sizeof(nla)); + + TEST_NETLINK_(fd, nlh0, + NFNL_SUBSYS_NFTABLES << 8 | 0xff, + "NFNL_SUBSYS_NFTABLES<<8|0xff /* NFT_MSG_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(nla_buf), nla_buf, sizeof(nla_buf), + printf("{nfgen_family=AF_UNIX"); + printf(", version=NFNETLINK_V0"); + printf(", res_id=htons(NFNL_SUBSYS_NFTABLES)" + ", {nla_len=%d, nla_type=%#x}", + nla.nla_len, nla.nla_type)); +} + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_done(fd); + test_nfgenmsg(fd); + + printf("+++ exited with 0 +++\n"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_H") + +#endif diff --git a/tests-mx32/netlink_netfilter.gen.test b/tests-mx32/netlink_netfilter.gen.test new file mode 100755 index 00000000..94b3f369 --- /dev/null +++ b/tests-mx32/netlink_netfilter.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_netfilter +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/netlink_netlink_diag.c b/tests-mx32/netlink_netlink_diag.c index fc32822b..f397605f 100644 --- a/tests-mx32/netlink_netlink_diag.c +++ b/tests-mx32/netlink_netlink_diag.c @@ -3,29 +3,10 @@ * * Copyright (c) 2014-2016 Dmitry V. Levin * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -33,14 +14,10 @@ #include #include #include -#include +#include "netlink.h" #include #include -#if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG -# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG -#endif - static void send_query(const int fd) { @@ -58,8 +35,7 @@ send_query(const int fd) }, .ndr = { .sdiag_family = AF_NETLINK, - .sdiag_protocol = NDIAG_PROTO_ALL, - .ndiag_show = NDIAG_SHOW_MEMINFO + .sdiag_protocol = NDIAG_PROTO_ALL } }; struct iovec iov = { @@ -104,8 +80,8 @@ check_responses(const int fd) perror_msg_and_skip("recvmsg"); struct nlmsghdr *h = &hdr_buf.hdr; - if (!NLMSG_OK(h, ret)) - error_msg_and_skip("!NLMSG_OK"); + if (!is_nlmsg_ok(h, ret)) + error_msg_and_skip("!is_nlmsg_ok"); if (h->nlmsg_type == NLMSG_ERROR) { const struct nlmsgerr *err = NLMSG_DATA(h); if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err))) diff --git a/tests-mx32/netlink_protocol.c b/tests-mx32/netlink_protocol.c index 34e114be..fd901d88 100644 --- a/tests-mx32/netlink_protocol.c +++ b/tests-mx32/netlink_protocol.c @@ -1,31 +1,12 @@ /* * Check decoding of netlink protocol. * - * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2014-2017 Dmitry V. Levin * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -38,14 +19,10 @@ # include # include # include -# include +# include "netlink.h" # include # include -# if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG -# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG -# endif - static void send_query(const int fd) { @@ -87,21 +64,23 @@ send_query(const int fd) /* whole message length < sizeof(struct nlmsghdr) */ rc = sendto(fd, req->magic, sizeof(req->magic), MSG_DONTWAIT, NULL, 0); - printf("sendto(%d, \"abcd\", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + printf("sendto(%d, \"\\x61\\x62\\x63\\x64\"" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, (unsigned) sizeof(req->magic), sprintrc(rc)); /* a single message with some data */ rc = sendto(fd, req, sizeof(*req), MSG_DONTWAIT, NULL, 0); printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}, \"abcd\"}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + ", seq=0, pid=0}, \"\\x61\\x62\\x63\\x64\"}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, req->nlh.nlmsg_len, NLM_F_DUMP, (unsigned) sizeof(*req), sprintrc(rc)); /* a single message without data */ req->nlh.nlmsg_len = sizeof(req->nlh); rc = sendto(fd, &req->nlh, sizeof(req->nlh), MSG_DONTWAIT, NULL, 0); - printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + printf("sendto(%d, {len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, req->nlh.nlmsg_len, NLM_F_DUMP, (unsigned) sizeof(req->nlh), sprintrc(rc)); @@ -109,15 +88,16 @@ send_query(const int fd) req->nlh.nlmsg_len = sizeof(*req) + 8; rc = sendto(fd, req, sizeof(*req), MSG_DONTWAIT, NULL, 0); printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}, \"abcd\"}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + ", seq=0, pid=0}, \"\\x61\\x62\\x63\\x64\"}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, req->nlh.nlmsg_len, NLM_F_DUMP, (unsigned) sizeof(*req), sprintrc(rc)); /* nlmsg_len < sizeof(struct nlmsghdr) */ req->nlh.nlmsg_len = 8; rc = sendto(fd, req, sizeof(*req), MSG_DONTWAIT, NULL, 0); - printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + printf("sendto(%d, {len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, req->nlh.nlmsg_len, NLM_F_DUMP, (unsigned) sizeof(*req), sprintrc(rc)); @@ -126,14 +106,16 @@ send_query(const int fd) struct req req1; char padding[NLMSG_ALIGN(sizeof(struct req)) - sizeof(struct req)]; struct req req2; - } *const reqs = tail_alloc(sizeof(*reqs)); + }; + TAIL_ALLOC_OBJECT_CONST_PTR(struct reqs, reqs); memcpy(&reqs->req1, &c_req, sizeof(c_req)); memcpy(&reqs->req2, &c_req, sizeof(c_req)); rc = sendto(fd, reqs, sizeof(*reqs), MSG_DONTWAIT, NULL, 0); printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}, \"abcd\"}, {{len=%u, type=NLMSG_NOOP" - ", flags=NLM_F_REQUEST|0x%x, seq=0, pid=0}, \"abcd\"}]" + ", seq=0, pid=0}, \"\\x61\\x62\\x63\\x64\"}" + ", {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, \"\\x61\\x62\\x63\\x64\"}]" ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP, reqs->req2.nlh.nlmsg_len, NLM_F_DUMP, @@ -143,8 +125,8 @@ send_query(const int fd) void *const efault2 = tail_memdup(&reqs->req1, sizeof(reqs->req1)); rc = sendto(fd, efault2, sizeof(*reqs), MSG_DONTWAIT, NULL, 0); printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}, \"abcd\"}, %p], %u, MSG_DONTWAIT, NULL, 0)" - " = %s\n", + ", seq=0, pid=0}, \"\\x61\\x62\\x63\\x64\"}" + ", ... /* %p */], %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP, &((struct reqs *) efault2)->req2, (unsigned) sizeof(*reqs), sprintrc(rc)); @@ -154,26 +136,25 @@ send_query(const int fd) NULL, 0); errstr = sprintrc(rc); printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}, \"abcd\"}, \"", + ", seq=0, pid=0}, \"\\x61\\x62\\x63\\x64\"}, ", fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP); - print_quoted_memory((void *) &reqs->req2.nlh, - sizeof(reqs->req2) - sizeof(req->nlh)); - printf("\"], %u, MSG_DONTWAIT, NULL, 0) = %s\n", + print_quoted_hex(&reqs->req2.nlh, + sizeof(reqs->req2) - sizeof(req->nlh)); + printf("], %u, MSG_DONTWAIT, NULL, 0) = %s\n", (unsigned) (sizeof(*reqs) - sizeof(req->nlh)), errstr); /* second nlmsg_len < sizeof(struct nlmsghdr) */ reqs->req2.nlh.nlmsg_len = 4; rc = sendto(fd, reqs, sizeof(*reqs), MSG_DONTWAIT, NULL, 0); printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}, \"abcd\"}, {{len=%u, type=NLMSG_NOOP" - ", flags=NLM_F_REQUEST|0x%x, seq=0, pid=0}}], %u" - ", MSG_DONTWAIT, NULL, 0) = %s\n", + ", seq=0, pid=0}, \"\\x61\\x62\\x63\\x64\"}" + ", {len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}], %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP, reqs->req2.nlh.nlmsg_len, NLM_F_DUMP, (unsigned) sizeof(*reqs), sprintrc(rc)); /* abbreviated output */ -# define DEFAULT_STRLEN 32 # define ABBREV_LEN (DEFAULT_STRLEN + 1) const unsigned int msg_len = sizeof(struct nlmsghdr) * ABBREV_LEN; struct nlmsghdr *const msgs = tail_alloc(msg_len); @@ -192,31 +173,220 @@ send_query(const int fd) for (i = 0; i < DEFAULT_STRLEN; ++i) { if (i) printf(", "); - printf("{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=%u, pid=0}}", + printf("{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=%u, pid=0}", msgs[i].nlmsg_len, NLM_F_DUMP, msgs[i].nlmsg_seq); } printf(", ...], %u, MSG_DONTWAIT, NULL, 0) = %s\n", msg_len, errstr); } -int main(void) +static void +test_nlmsgerr(const int fd) +{ + struct nlmsgerr *err; + struct nlmsghdr *nlh; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(*err) + 4); + long rc; + + /* error message without enough room for the error code */ + nlh = nlh0; + nlh->nlmsg_len = NLMSG_HDRLEN + 4; + nlh->nlmsg_type = NLMSG_ERROR; + nlh->nlmsg_flags = NLM_F_REQUEST; + nlh->nlmsg_seq = 0; + nlh->nlmsg_pid = 0; + + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_ERROR, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, %p}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh->nlmsg_len, nlh0 + NLMSG_HDRLEN, + nlh->nlmsg_len, sprintrc(rc)); + + nlh->nlmsg_len = NLMSG_HDRLEN + 2; + nlh = nlh0 - 2; + memmove(nlh, nlh0, sizeof(*nlh)); + memcpy(NLMSG_DATA(nlh), "42", 2); + + rc = sendto(fd, nlh, NLMSG_HDRLEN + 2, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_ERROR, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, \"\\x34\\x32\"}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, NLMSG_HDRLEN + 2, NLMSG_HDRLEN + 2, sprintrc(rc)); + + /* error message with room for the error code only */ + nlh = nlh0 - sizeof(err->error); + nlh->nlmsg_len = NLMSG_HDRLEN + sizeof(err->error); + nlh->nlmsg_type = NLMSG_ERROR; + nlh->nlmsg_flags = NLM_F_REQUEST; + nlh->nlmsg_seq = 0; + nlh->nlmsg_pid = 0; + err = NLMSG_DATA(nlh); + err->error = 42; + + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_ERROR, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, {error=42}}, %u, MSG_DONTWAIT, NULL, 0)" + " = %s\n", fd, nlh->nlmsg_len, nlh->nlmsg_len, sprintrc(rc)); + + err->error = -1; + + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_ERROR, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, {error=-EPERM}}, %u, MSG_DONTWAIT, NULL, 0)" + " = %s\n", fd, nlh->nlmsg_len, nlh->nlmsg_len, sprintrc(rc)); + + err->error = -32767; + nlh->nlmsg_len += sizeof(err->msg.nlmsg_len); + + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_ERROR, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, {error=-32767, msg=%p}}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh->nlmsg_len, nlh0 + NLMSG_HDRLEN, + nlh->nlmsg_len, sprintrc(rc)); + + /* error message with room for the error code and a header */ + nlh = nlh0 - sizeof(*err); + nlh->nlmsg_len = NLMSG_HDRLEN + sizeof(*err); + nlh->nlmsg_type = NLMSG_ERROR; + nlh->nlmsg_flags = NLM_F_REQUEST; + nlh->nlmsg_seq = 0; + nlh->nlmsg_pid = 0; + err = NLMSG_DATA(nlh); + err->error = -13; + err->msg.nlmsg_len = NLMSG_HDRLEN; + err->msg.nlmsg_type = NLMSG_NOOP; + err->msg.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST; + err->msg.nlmsg_seq = 42; + err->msg.nlmsg_pid = 1234; + + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_ERROR, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, {error=-EACCES" + ", msg={len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=%u, pid=%u}}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh->nlmsg_len, err->msg.nlmsg_len, NLM_F_DUMP, + err->msg.nlmsg_seq, err->msg.nlmsg_pid, + nlh->nlmsg_len, sprintrc(rc)); + + /* error message with room for the error code, a header, and some data */ + nlh = nlh0 - sizeof(*err) - 4; + nlh->nlmsg_len = NLMSG_HDRLEN + sizeof(*err) + 4; + nlh->nlmsg_type = NLMSG_ERROR; + nlh->nlmsg_flags = NLM_F_REQUEST; + nlh->nlmsg_seq = 0; + nlh->nlmsg_pid = 0; + err = NLMSG_DATA(nlh); + err->error = -13; + err->msg.nlmsg_len = NLMSG_HDRLEN + 4; + err->msg.nlmsg_type = NLMSG_NOOP; + err->msg.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST; + err->msg.nlmsg_seq = 421; + err->msg.nlmsg_pid = 12345; + memcpy(NLMSG_DATA(&err->msg), "abcd", 4); + + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_ERROR, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, {error=-EACCES" + ", msg={{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=%u, pid=%u}, \"\\x61\\x62\\x63\\x64\"}}}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh->nlmsg_len, err->msg.nlmsg_len, NLM_F_DUMP, + err->msg.nlmsg_seq, err->msg.nlmsg_pid, + nlh->nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_done(const int fd) { - struct sockaddr_nl addr; - socklen_t len = sizeof(addr); - int fd; + struct nlmsghdr *nlh; + const int num = 0xfacefeed; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(num)); + long rc; + + /* NLMSG_DONE message without enough room for an integer payload */ + nlh = nlh0; + *nlh = (struct nlmsghdr) { + .nlmsg_len = NLMSG_HDRLEN + sizeof(num), + .nlmsg_type = NLMSG_DONE, + .nlmsg_flags = NLM_F_MULTI + }; + + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_DONE, flags=NLM_F_MULTI" + ", seq=0, pid=0}, %p}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh->nlmsg_len, nlh0 + NLMSG_HDRLEN, + nlh->nlmsg_len, sprintrc(rc)); + + /* NLMSG_DONE message with enough room for an oddly short payload */ + nlh->nlmsg_len = NLMSG_HDRLEN + 2; + nlh = nlh0 - 2; + /* Beware of unaligned access to nlh members. */ + memmove(nlh, nlh0, sizeof(*nlh)); + memcpy(NLMSG_DATA(nlh), "42", 2); + + rc = sendto(fd, nlh, NLMSG_HDRLEN + 2, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_DONE, flags=NLM_F_MULTI, seq=0" + ", pid=0}, \"\\x34\\x32\"}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, NLMSG_HDRLEN + 2, NLMSG_HDRLEN + 2, sprintrc(rc)); + + /* NLMSG_DONE message with enough room for an integer payload */ + nlh = nlh0 - sizeof(num); + *nlh = (struct nlmsghdr) { + .nlmsg_len = NLMSG_HDRLEN + sizeof(num), + .nlmsg_type = NLMSG_DONE, + .nlmsg_flags = NLM_F_MULTI + }; + memcpy(NLMSG_DATA(nlh), &num, sizeof(num)); - memset(&addr, 0, sizeof(addr)); - addr.nl_family = AF_NETLINK; + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_DONE, flags=NLM_F_MULTI" + ", seq=0, pid=0}, %d}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh->nlmsg_len, num, nlh->nlmsg_len, sprintrc(rc)); +} + +# if defined NLM_F_CAPPED || defined NLM_F_ACK_TLVS +static void +test_ack_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = NLMSG_ERROR, + }; - if ((fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG)) == -1) - perror_msg_and_skip("socket AF_NETLINK"); +# ifdef NLM_F_CAPPED + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_CAPPED, + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=NLMSG_ERROR" + ", flags=NLM_F_REQUEST|NLM_F_CAPPED, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +# endif + +# ifdef NLM_F_ACK_TLVS + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK_TLVS; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=NLMSG_ERROR" + ", flags=NLM_F_REQUEST|NLM_F_ACK_TLVS, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +# endif + +# if defined NLM_F_CAPPED && defined NLM_F_ACK_TLVS + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_CAPPED | NLM_F_ACK_TLVS; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=NLMSG_ERROR" + ", flags=NLM_F_REQUEST|NLM_F_CAPPED|NLM_F_ACK_TLVS, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +# endif +} +# endif - printf("socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG) = %d\n", - fd); - if (bind(fd, (struct sockaddr *) &addr, len)) - perror_msg_and_skip("bind"); - printf("bind(%d, {sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}" - ", %u) = 0\n", fd, len); +int main(void) +{ + const int fd = create_nl_socket(NETLINK_SOCK_DIAG); char *path; if (asprintf(&path, "/proc/self/fd/%u", fd) < 0) @@ -227,9 +397,13 @@ int main(void) free(path); send_query(fd); + test_nlmsgerr(fd); + test_nlmsg_done(fd); +# if defined NLM_F_CAPPED || defined NLM_F_ACK_TLVS + test_ack_flags(fd); +# endif - printf("+++ exited with 0 +++\n"); - + puts("+++ exited with 0 +++"); return 0; } diff --git a/tests-mx32/netlink_protocol.gen.test b/tests-mx32/netlink_protocol.gen.test new file mode 100755 index 00000000..18d06677 --- /dev/null +++ b/tests-mx32/netlink_protocol.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_protocol -e trace=sendto); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=sendto diff --git a/tests-mx32/netlink_protocol.test b/tests-mx32/netlink_protocol.test deleted file mode 100755 index ab2bb1e8..00000000 --- a/tests-mx32/netlink_protocol.test +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# Check decoding of netlink protocol. - -. "${srcdir=.}/init.sh" - -# getfdproto is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - -run_strace_match_diff -e trace=network diff --git a/tests-mx32/netlink_route.c b/tests-mx32/netlink_route.c new file mode 100644 index 00000000..9281e9a4 --- /dev/null +++ b/tests-mx32/netlink_route.c @@ -0,0 +1,477 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include "test_netlink.h" +#ifdef HAVE_STRUCT_DCBMSG +# include +#endif +#ifdef HAVE_LINUX_FIB_RULES_H +# include +#endif +#ifdef HAVE_LINUX_IF_ADDR_H +# include +#endif +#ifdef HAVE_STRUCT_IFADDRLBLMSG +# include +#endif +#include +#include +#include +#ifdef HAVE_LINUX_NEIGHBOUR_H +# include +#endif +#ifdef HAVE_STRUCT_NETCONFMSG +# include +#endif +#include + +#define TEST_NL_ROUTE(fd_, nlh0_, type_, obj_, print_family_, ...) \ + do { \ + /* family and string */ \ + TEST_NETLINK((fd_), (nlh0_), \ + type_, NLM_F_REQUEST, \ + sizeof(obj_) - 1, \ + &(obj_), sizeof(obj_) - 1, \ + (print_family_); \ + printf(", ...}")); \ + \ + /* sizeof(obj_) */ \ + TEST_NETLINK((fd_), (nlh0_), \ + type_, NLM_F_REQUEST, \ + sizeof(obj_), &(obj_), sizeof(obj_), \ + (print_family_); \ + __VA_ARGS__); \ + \ + /* short read of sizeof(obj_) */ \ + TEST_NETLINK((fd_), (nlh0_), \ + type_, NLM_F_REQUEST, \ + sizeof(obj_), &(obj_), sizeof(obj_) - 1, \ + (print_family_); \ + printf(", %p}", \ + NLMSG_DATA(TEST_NETLINK_nlh) + 1)); \ + } while (0) + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = RTM_GETLINK, + .nlmsg_flags = NLM_F_REQUEST, + }; + + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=RTM_GETLINK" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = RTM_GETLINK; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=RTM_GETLINK" + ", flags=NLM_F_REQUEST|NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = RTM_DELACTION; + nlh.nlmsg_flags = NLM_F_ROOT; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=RTM_DELACTION" + ", flags=NLM_F_ROOT, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = RTM_NEWLINK; + nlh.nlmsg_flags = NLM_F_ECHO | NLM_F_REPLACE; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=RTM_NEWLINK" + ", flags=NLM_F_ECHO|NLM_F_REPLACE, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = RTM_DELLINK; + nlh.nlmsg_flags = NLM_F_NONREC; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=RTM_DELLINK" + ", flags=NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_nlmsg_done(const int fd) +{ + const int num = 0xabcdefad; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(num)); + + TEST_NETLINK(fd, nlh0, NLMSG_DONE, NLM_F_REQUEST, + sizeof(num), &num, sizeof(num), + printf("%d", num)); +} + +static void +test_rtnl_unspec(const int fd) +{ + uint8_t family = 0; + char buf[sizeof(family) + 4]; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(buf)); + + /* unspecified family only */ + TEST_NETLINK_(fd, nlh0, + 0xffff, "0xffff /* RTM_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(family), &family, sizeof(family), + printf("{family=AF_UNSPEC}")); + + /* unknown family only */ + family = 0xff; + TEST_NETLINK_(fd, nlh0, + 0xffff, "0xffff /* RTM_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(family), &family, sizeof(family), + printf("{family=0xff /* AF_??? */}")); + + /* short read of family */ + TEST_NETLINK_(fd, nlh0, + 0xffff, "0xffff /* RTM_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(family), &family, sizeof(family) - 1, + printf("%p", NLMSG_DATA(TEST_NETLINK_nlh))); + + /* unspecified family and string */ + family = 0; + memcpy(buf, &family, sizeof(family)); + memcpy(buf + sizeof(family), "1234", 4); + TEST_NETLINK_(fd, nlh0, + 0xffff, "0xffff /* RTM_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(buf), buf, sizeof(buf), + printf("{family=AF_UNSPEC, \"\\x31\\x32\\x33\\x34\"}")); + + /* unknown family and string */ + family = 0xfd; + memcpy(buf, &family, sizeof(family)); + TEST_NETLINK_(fd, nlh0, + 0xffff, "0xffff /* RTM_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(buf), buf, sizeof(buf), + printf("{family=%#x /* AF_??? */" + ", \"\\x31\\x32\\x33\\x34\"}", family)); +} + +static void +test_rtnl_link(const int fd) +{ + const struct ifinfomsg ifinfo = { + .ifi_family = AF_UNIX, + .ifi_type = ARPHRD_LOOPBACK, + .ifi_index = ifindex_lo(), + .ifi_flags = IFF_UP, + .ifi_change = 0xfabcdeba + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(ifinfo)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETLINK, ifinfo, + printf("{ifi_family=AF_UNIX"), + printf(", ifi_type=ARPHRD_LOOPBACK" + ", ifi_index=" IFINDEX_LO_STR + ", ifi_flags=IFF_UP"); + PRINT_FIELD_X(", ", ifinfo, ifi_change); + printf("}")); +} + +static void +test_rtnl_addr(const int fd) +{ + const struct ifaddrmsg msg = { + .ifa_family = AF_UNIX, + .ifa_prefixlen = 0xde, + .ifa_flags = IFA_F_SECONDARY, + .ifa_scope = RT_SCOPE_UNIVERSE, + .ifa_index = ifindex_lo() + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETADDR, msg, + printf("{ifa_family=AF_UNIX"), + PRINT_FIELD_U(", ", msg, ifa_prefixlen); + printf(", ifa_flags=IFA_F_SECONDARY" + ", ifa_scope=RT_SCOPE_UNIVERSE" + ", ifa_index=" IFINDEX_LO_STR); + printf("}")); +} + +static void +test_rtnl_route(const int fd) +{ + static const struct rtmsg msg = { + .rtm_family = AF_UNIX, + .rtm_dst_len = 0xaf, + .rtm_src_len = 0xda, + .rtm_tos = IPTOS_LOWDELAY, + .rtm_table = RT_TABLE_DEFAULT, + .rtm_protocol = RTPROT_KERNEL, + .rtm_scope = RT_SCOPE_UNIVERSE, + .rtm_type = RTN_LOCAL, + .rtm_flags = RTM_F_NOTIFY + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETROUTE, msg, + printf("{rtm_family=AF_UNIX"), + PRINT_FIELD_U(", ", msg, rtm_dst_len); + PRINT_FIELD_U(", ", msg, rtm_src_len); + printf(", rtm_tos=IPTOS_LOWDELAY" + ", rtm_table=RT_TABLE_DEFAULT" + ", rtm_protocol=RTPROT_KERNEL" + ", rtm_scope=RT_SCOPE_UNIVERSE" + ", rtm_type=RTN_LOCAL" + ", rtm_flags=RTM_F_NOTIFY}")); +} + +#ifdef HAVE_LINUX_FIB_RULES_H +static void +test_rtnl_rule(const int fd) +{ + struct rtmsg msg = { + .rtm_family = AF_UNIX, + .rtm_dst_len = 0xaf, + .rtm_src_len = 0xda, + .rtm_tos = IPTOS_LOWDELAY, + .rtm_table = RT_TABLE_UNSPEC, + .rtm_type = FR_ACT_TO_TBL, + .rtm_flags = FIB_RULE_INVERT + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETRULE, msg, + printf("{family=AF_UNIX"), + printf(", dst_len=%u, src_len=%u" + ", tos=IPTOS_LOWDELAY" + ", table=RT_TABLE_UNSPEC" + ", action=FR_ACT_TO_TBL" + ", flags=FIB_RULE_INVERT}", + msg.rtm_dst_len, + msg.rtm_src_len)); +} +#endif + +static void +test_rtnl_neigh(const int fd) +{ + const struct ndmsg msg = { + .ndm_family = AF_UNIX, + .ndm_ifindex = ifindex_lo(), + .ndm_state = NUD_PERMANENT, + .ndm_flags = NTF_PROXY, + .ndm_type = RTN_UNSPEC + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETNEIGH, msg, + printf("{ndm_family=AF_UNIX"), + printf(", ndm_ifindex=" IFINDEX_LO_STR + ", ndm_state=NUD_PERMANENT" + ", ndm_flags=NTF_PROXY" + ", ndm_type=RTN_UNSPEC}")); +} + +static void +test_rtnl_neightbl(const int fd) +{ + static const struct ndtmsg msg = { + .ndtm_family = AF_NETLINK + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NETLINK(fd, nlh0, + RTM_GETNEIGHTBL, NLM_F_REQUEST, + sizeof(msg), &msg, sizeof(msg), + printf("{ndtm_family=AF_NETLINK}")); +} + +static void +test_rtnl_tc(const int fd) +{ + const struct tcmsg msg = { + .tcm_family = AF_UNIX, + .tcm_ifindex = ifindex_lo(), + .tcm_handle = 0xfadcdafb, + .tcm_parent = 0xafbcadab, + .tcm_info = 0xbcaedafa + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETQDISC, msg, + printf("{tcm_family=AF_UNIX"), + printf(", tcm_ifindex=" IFINDEX_LO_STR); + PRINT_FIELD_U(", ", msg, tcm_handle); + PRINT_FIELD_U(", ", msg, tcm_parent); + PRINT_FIELD_U(", ", msg, tcm_info); + printf("}")); +} + +static void +test_rtnl_tca(const int fd) +{ + struct tcamsg msg = { + .tca_family = AF_INET + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NETLINK(fd, nlh0, + RTM_GETACTION, NLM_F_REQUEST, + sizeof(msg), &msg, sizeof(msg), + printf("{tca_family=AF_INET}")); +} + +#ifdef HAVE_STRUCT_IFADDRLBLMSG +static void +test_rtnl_addrlabel(const int fd) +{ + const struct ifaddrlblmsg msg = { + .ifal_family = AF_UNIX, + .ifal_prefixlen = 0xaf, + .ifal_flags = 0xbd, + .ifal_index = ifindex_lo(), + .ifal_seq = 0xfadcdafb + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETADDRLABEL, msg, + printf("{ifal_family=AF_UNIX"), + PRINT_FIELD_U(", ", msg, ifal_prefixlen); + PRINT_FIELD_U(", ", msg, ifal_flags); + printf(", ifal_index=" IFINDEX_LO_STR); + PRINT_FIELD_U(", ", msg, ifal_seq); + printf("}")); +} +#endif + +#ifdef HAVE_STRUCT_DCBMSG +static void +test_rtnl_dcb(const int fd) +{ + static const struct dcbmsg msg = { + .dcb_family = AF_UNIX, + .cmd = DCB_CMD_UNDEFINED + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETDCB, msg, + printf("{dcb_family=AF_UNIX"), + printf(", cmd=DCB_CMD_UNDEFINED}")); +} +#endif + +#ifdef HAVE_STRUCT_NETCONFMSG +static void +test_rtnl_netconf(const int fd) +{ + static const struct netconfmsg msg = { + .ncm_family = AF_INET + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NETLINK(fd, nlh0, + RTM_GETNETCONF, NLM_F_REQUEST, + sizeof(msg), &msg, sizeof(msg), + printf("{ncm_family=AF_INET}")); +} +#endif + +#ifdef HAVE_STRUCT_BR_PORT_MSG +static void +test_rtnl_mdb(const int fd) +{ + const struct br_port_msg msg = { + .family = AF_UNIX, + .ifindex = ifindex_lo() + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETMDB, msg, + printf("{family=AF_UNIX"), + printf(", ifindex=" IFINDEX_LO_STR "}")); +} +#endif + +#ifdef RTM_NEWNSID +static void +test_rtnl_nsid(const int fd) +{ + static const struct rtgenmsg msg = { + .rtgen_family = AF_UNIX + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NETLINK(fd, nlh0, + RTM_GETNSID, NLM_F_REQUEST, + sizeof(msg), &msg, sizeof(msg), + printf("{rtgen_family=AF_UNIX}")); +} +#endif + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_ROUTE); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + test_nlmsg_done(fd); + test_rtnl_unspec(fd); + test_rtnl_link(fd); + test_rtnl_addr(fd); + test_rtnl_route(fd); +#ifdef HAVE_LINUX_FIB_RULES_H + test_rtnl_rule(fd); +#endif + test_rtnl_neigh(fd); + test_rtnl_neightbl(fd); + test_rtnl_tc(fd); + test_rtnl_tca(fd); +#ifdef HAVE_STRUCT_IFADDRLBLMSG + test_rtnl_addrlabel(fd); +#endif +#ifdef HAVE_STRUCT_DCBMSG + test_rtnl_dcb(fd); +#endif +#ifdef HAVE_STRUCT_NETCONFMSG + test_rtnl_netconf(fd); +#endif +#ifdef HAVE_STRUCT_BR_PORT_MSG + test_rtnl_mdb(fd); +#endif +#ifdef RTM_NEWNSID + test_rtnl_nsid(fd); +#endif + + printf("+++ exited with 0 +++\n"); + + return 0; +} diff --git a/tests-mx32/netlink_route.gen.test b/tests-mx32/netlink_route.gen.test new file mode 100755 index 00000000..bd9c0d95 --- /dev/null +++ b/tests-mx32/netlink_route.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_route +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/netlink_selinux.c b/tests-mx32/netlink_selinux.c new file mode 100644 index 00000000..85b50478 --- /dev/null +++ b/tests-mx32/netlink_selinux.c @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include "test_netlink.h" +#include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = SELNL_MSG_SETENFORCE, + .nlmsg_flags = NLM_F_REQUEST, + }; + + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=SELNL_MSG_SETENFORCE" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_selnl_msg_unspec(const int fd) +{ + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, 4); + + TEST_NETLINK_(fd, nlh0, + 0xffff, "0xffff /* SELNL_MSG_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + 4, "1234", 4, + printf("\"\\x31\\x32\\x33\\x34\"")); +} + +static void +test_selnl_msg_setenforce(const int fd) +{ + static const struct selnl_msg_setenforce msg = { + .val = 0xfbdcdfab + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NETLINK_OBJECT(fd, nlh0, + SELNL_MSG_SETENFORCE, NLM_F_REQUEST, msg, + PRINT_FIELD_D("{", msg, val); + printf("}")); +} + +static void +test_selnl_msg_policyload(const int fd) +{ + static const struct selnl_msg_policyload msg = { + .seqno = 0xabdcfabc + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NETLINK_OBJECT(fd, nlh0, + SELNL_MSG_POLICYLOAD, NLM_F_REQUEST, msg, + PRINT_FIELD_U("{", msg, seqno); + printf("}")); +} + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_SELINUX); + + test_nlmsg_type(fd); + test_selnl_msg_unspec(fd); + test_selnl_msg_setenforce(fd); + test_selnl_msg_policyload(fd); + + printf("+++ exited with 0 +++\n"); + + return 0; +} diff --git a/tests-mx32/netlink_selinux.gen.test b/tests-mx32/netlink_selinux.gen.test new file mode 100755 index 00000000..484ffae7 --- /dev/null +++ b/tests-mx32/netlink_selinux.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_selinux +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/netlink_sock_diag-v.sh b/tests-mx32/netlink_sock_diag-v.sh new file mode 100755 index 00000000..0fb467db --- /dev/null +++ b/tests-mx32/netlink_sock_diag-v.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# +# Check verbose decoding of NETLINK_SOCK_DIAG protocol +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog ../netlink_netlink_diag +run_strace_match_diff -v -e trace=sendto diff --git a/tests-mx32/netlink_sock_diag.c b/tests-mx32/netlink_sock_diag.c new file mode 100644 index 00000000..591c3944 --- /dev/null +++ b/tests-mx32/netlink_sock_diag.c @@ -0,0 +1,659 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include "test_netlink.h" +#include +#include +#include +#include +#ifdef AF_SMC +# include +#endif +#include +#include + +#define SMC_ACTIVE 1 + +#define TEST_SOCK_DIAG(fd_, nlh0_, \ + family_, type_, flags_, \ + obj_, print_family_, ...) \ + \ + do { \ + /* family only */ \ + uint8_t family = (family_); \ + TEST_NETLINK_((fd_), (nlh0_), \ + type_, #type_, \ + flags_, #flags_, \ + sizeof(family), &family, sizeof(family), \ + printf("{family=%s}", #family_)); \ + \ + /* family and string */ \ + char buf[sizeof(family) + 4]; \ + memcpy(buf, &family, sizeof(family)); \ + memcpy(buf + sizeof(family), "1234", 4); \ + TEST_NETLINK_((fd_), (nlh0_), \ + type_, #type_, \ + flags_, #flags_, \ + sizeof(buf), buf, sizeof(buf), \ + (print_family_); \ + printf(", ...}")); \ + \ + /* sizeof(obj_) */ \ + TEST_NETLINK_((fd_), (nlh0_), \ + type_, #type_, \ + flags_, #flags_, \ + sizeof(obj_), &(obj_), sizeof(obj_), \ + (print_family_); \ + __VA_ARGS__); \ + \ + /* short read of sizeof(obj_) */ \ + TEST_NETLINK_((fd_), (nlh0_), \ + type_, #type_, \ + flags_, #flags_, \ + sizeof(obj_), &(obj_), sizeof(obj_) - 1, \ + (print_family_); \ + printf(", %p}", \ + NLMSG_DATA(TEST_NETLINK_nlh) + 1));\ + } while (0) + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_REQUEST, + }; + + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP, + }; + + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_REQUEST|NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_odd_family_req(const int fd) +{ + uint8_t family = 0; + char buf[sizeof(family) + 4]; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(buf)); + + /* unspecified family only */ + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, + NLM_F_REQUEST, + sizeof(family), &family, sizeof(family), + printf("{family=AF_UNSPEC}")); + + /* unknown family only */ + family = 0xff; + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, + NLM_F_REQUEST, + sizeof(family), &family, sizeof(family), + printf("{family=%#x /* AF_??? */}", family)); + + /* short read of family */ + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, + NLM_F_REQUEST, + sizeof(family), &family, sizeof(family) - 1, + printf("%p", NLMSG_DATA(TEST_NETLINK_nlh))); + + /* unspecified family and string */ + family = 0; + memcpy(buf, &family, sizeof(family)); + memcpy(buf + sizeof(family), "1234", 4); + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, + NLM_F_REQUEST, + sizeof(buf), buf, sizeof(buf), + printf("{family=AF_UNSPEC, \"\\x31\\x32\\x33\\x34\"}")); + + /* unknown family and string */ + family = 0xfd; + memcpy(buf, &family, sizeof(family)); + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, + NLM_F_REQUEST, + sizeof(buf), buf, sizeof(buf), + printf("{family=%#x /* AF_??? */" + ", \"\\x31\\x32\\x33\\x34\"}", family)); +} + +static void +test_odd_family_msg(const int fd) +{ + uint8_t family = 0; + char buf[sizeof(family) + 4]; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(buf)); + + /* unspecified family only */ + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, NLM_F_DUMP, + sizeof(family), &family, sizeof(family), + printf("{family=AF_UNSPEC}")); + + /* unknown family only */ + family = 0xff; + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, NLM_F_DUMP, + sizeof(family), &family, sizeof(family), + printf("{family=%#x /* AF_??? */}", family)); + + /* short read of family */ + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, NLM_F_DUMP, + sizeof(family), &family, sizeof(family) - 1, + printf("%p", NLMSG_DATA(TEST_NETLINK_nlh))); + + /* unspecified family and string */ + family = 0; + memcpy(buf, &family, sizeof(family)); + memcpy(buf + sizeof(family), "1234", 4); + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, NLM_F_DUMP, + sizeof(buf), buf, sizeof(buf), + printf("{family=AF_UNSPEC, \"\\x31\\x32\\x33\\x34\"}")); + + /* unknown family and string */ + family = 0xfd; + memcpy(buf, &family, sizeof(family)); + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, NLM_F_DUMP, + sizeof(buf), buf, sizeof(buf), + printf("{family=%#x /* AF_??? */" + ", \"\\x31\\x32\\x33\\x34\"}", family)); +} + +static void +test_unix_diag_req(const int fd) +{ + static const struct unix_diag_req req = { + .sdiag_family = AF_UNIX, + .sdiag_protocol = 253, + .udiag_states = 1 << TCP_ESTABLISHED | 1 << TCP_LISTEN, + .udiag_ino = 0xfacefeed, + .udiag_show = UDIAG_SHOW_NAME, + .udiag_cookie = { 0xdeadbeef, 0xbadc0ded } + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(req)); + TEST_SOCK_DIAG(fd, nlh0, AF_UNIX, + SOCK_DIAG_BY_FAMILY, NLM_F_REQUEST, req, + printf("{sdiag_family=AF_UNIX"), + PRINT_FIELD_U(", ", req, sdiag_protocol); + printf(", udiag_states=1< + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,14 +17,10 @@ #include #include #include -#include +#include "netlink.h" #include #include -#if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG -# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG -#endif - static void send_query(const int fd) { @@ -107,8 +84,8 @@ check_responses(const int fd) perror_msg_and_skip("recvmsg"); struct nlmsghdr *h = &hdr_buf.hdr; - if (!NLMSG_OK(h, ret)) - error_msg_and_skip("!NLMSG_OK"); + if (!is_nlmsg_ok(h, ret)) + error_msg_and_skip("!is_nlmsg_ok"); if (h->nlmsg_type == NLMSG_ERROR) { const struct nlmsgerr *err = NLMSG_DATA(h); if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err))) diff --git a/tests-mx32/netlink_xfrm.c b/tests-mx32/netlink_xfrm.c new file mode 100644 index 00000000..26095fba --- /dev/null +++ b/tests-mx32/netlink_xfrm.c @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include "netlink.h" +#include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = XFRM_MSG_NEWSA, + .nlmsg_flags = NLM_F_REQUEST, + }; + + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=XFRM_MSG_NEWSA" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = XFRM_MSG_GETSA; + nlh.nlmsg_flags = NLM_F_DUMP; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=XFRM_MSG_GETSA" + ", flags=NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = XFRM_MSG_NEWSA; + nlh.nlmsg_flags = NLM_F_REPLACE; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=XFRM_MSG_NEWSA" + ", flags=NLM_F_REPLACE, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = XFRM_MSG_DELSA; + nlh.nlmsg_flags = NLM_F_ECHO | NLM_F_NONREC; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=XFRM_MSG_DELSA" + ", flags=NLM_F_ECHO|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = XFRM_MSG_ALLOCSPI; + nlh.nlmsg_flags = NLM_F_ECHO | NLM_F_REPLACE; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=XFRM_MSG_ALLOCSPI" + ", flags=NLM_F_ECHO|%#x, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, NLM_F_REPLACE, + (unsigned) sizeof(nlh), sprintrc(rc)); +} + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_XFRM); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + printf("+++ exited with 0 +++\n"); + + return 0; +} diff --git a/tests-mx32/netlink_xfrm.gen.test b/tests-mx32/netlink_xfrm.gen.test new file mode 100755 index 00000000..36918982 --- /dev/null +++ b/tests-mx32/netlink_xfrm.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_xfrm +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/newfstatat.c b/tests-mx32/newfstatat.c index b501d880..955dce6d 100644 --- a/tests-mx32/newfstatat.c +++ b/tests-mx32/newfstatat.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/newfstatat.gen.test b/tests-mx32/newfstatat.gen.test new file mode 100755 index 00000000..40ec797c --- /dev/null +++ b/tests-mx32/newfstatat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (newfstatat -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests-mx32/newfstatat.test b/tests-mx32/newfstatat.test deleted file mode 100755 index 6d83ec08..00000000 --- a/tests-mx32/newfstatat.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check newfstatat syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests-mx32/nfnetlink_acct.c b/tests-mx32/nfnetlink_acct.c new file mode 100644 index 00000000..7e4f6d5d --- /dev/null +++ b/tests-mx32/nfnetlink_acct.c @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_ACCT_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_ACCT << 8 | NFNL_MSG_ACCT_NEW; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_ACCT<<8|NFNL_MSG_ACCT_NEW" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_ACCT << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_ACCT<<8|0xff /* NFNL_MSG_ACCT_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = NFNL_SUBSYS_ACCT << 8 | NFNL_MSG_ACCT_NEW; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_ACCT<<8|NFNL_MSG_ACCT_NEW" + ", flags=NLM_F_REQUEST|NLM_F_CREATE, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_ACCT << 8 | NFNL_MSG_ACCT_GET; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_MATCH; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_ACCT<<8|NFNL_MSG_ACCT_GET" + ", flags=NLM_F_REQUEST|NLM_F_MATCH, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_ACCT << 8 | NFNL_MSG_ACCT_DEL; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_NONREC; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_ACCT<<8|NFNL_MSG_ACCT_DEL" + ", flags=NLM_F_REQUEST|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_ACCT_H") + +#endif diff --git a/tests-mx32/nfnetlink_acct.gen.test b/tests-mx32/nfnetlink_acct.gen.test new file mode 100755 index 00000000..e3aa8892 --- /dev/null +++ b/tests-mx32/nfnetlink_acct.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_acct +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nfnetlink_cthelper.c b/tests-mx32/nfnetlink_cthelper.c new file mode 100644 index 00000000..860ad293 --- /dev/null +++ b/tests-mx32/nfnetlink_cthelper.c @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_CTHELPER_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_CTHELPER << 8 | NFNL_MSG_CTHELPER_NEW; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTHELPER<<8|NFNL_MSG_CTHELPER_NEW" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTHELPER << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTHELPER<<8|0xff /* NFNL_MSG_CTHELPER_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = NFNL_SUBSYS_CTHELPER << 8 | NFNL_MSG_CTHELPER_NEW; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_REPLACE; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTHELPER<<8|NFNL_MSG_CTHELPER_NEW" + ", flags=NLM_F_REQUEST|NLM_F_REPLACE, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTHELPER << 8 | NFNL_MSG_CTHELPER_GET; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTHELPER<<8|NFNL_MSG_CTHELPER_GET" + ", flags=NLM_F_REQUEST|NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTHELPER << 8 | NFNL_MSG_CTHELPER_DEL; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_NONREC; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTHELPER<<8|NFNL_MSG_CTHELPER_DEL" + ", flags=NLM_F_REQUEST|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_CTHELPER_H") + +#endif diff --git a/tests-mx32/nfnetlink_cthelper.gen.test b/tests-mx32/nfnetlink_cthelper.gen.test new file mode 100755 index 00000000..fa26e14a --- /dev/null +++ b/tests-mx32/nfnetlink_cthelper.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_cthelper +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nfnetlink_ctnetlink.c b/tests-mx32/nfnetlink_ctnetlink.c new file mode 100644 index 00000000..ee53ef88 --- /dev/null +++ b/tests-mx32/nfnetlink_ctnetlink.c @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_CONNTRACK_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK << 8 | IPCTNL_MSG_CT_NEW; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK<<8|IPCTNL_MSG_CT_NEW" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK<<8|0xff /* IPCTNL_MSG_CT_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK << 8 | IPCTNL_MSG_CT_NEW; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_REPLACE; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK<<8|IPCTNL_MSG_CT_NEW" + ", flags=NLM_F_REQUEST|NLM_F_REPLACE, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK << 8 | IPCTNL_MSG_CT_GET; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK<<8|IPCTNL_MSG_CT_GET" + ", flags=NLM_F_REQUEST|NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK << 8 | IPCTNL_MSG_CT_DELETE; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_NONREC; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK<<8|IPCTNL_MSG_CT_DELETE" + ", flags=NLM_F_REQUEST|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_CONNTRACK_H") + +#endif diff --git a/tests-mx32/nfnetlink_ctnetlink.gen.test b/tests-mx32/nfnetlink_ctnetlink.gen.test new file mode 100755 index 00000000..9e9ad153 --- /dev/null +++ b/tests-mx32/nfnetlink_ctnetlink.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_ctnetlink +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nfnetlink_ctnetlink_exp.c b/tests-mx32/nfnetlink_ctnetlink_exp.c new file mode 100644 index 00000000..13c8a3bc --- /dev/null +++ b/tests-mx32/nfnetlink_ctnetlink_exp.c @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_CONNTRACK_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK_EXP << 8 | IPCTNL_MSG_EXP_NEW; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_EXP<<8|IPCTNL_MSG_EXP_NEW" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK_EXP << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_EXP<<8|0xff /* IPCTNL_MSG_EXP_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK_EXP << 8 | IPCTNL_MSG_EXP_NEW; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_EXCL; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_EXP<<8|IPCTNL_MSG_EXP_NEW" + ", flags=NLM_F_REQUEST|NLM_F_EXCL, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK_EXP << 8 | IPCTNL_MSG_EXP_GET; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ROOT; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_EXP<<8|IPCTNL_MSG_EXP_GET" + ", flags=NLM_F_REQUEST|NLM_F_ROOT, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK_EXP << 8 | IPCTNL_MSG_EXP_DELETE; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_NONREC; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_EXP<<8|IPCTNL_MSG_EXP_DELETE" + ", flags=NLM_F_REQUEST|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_CONNTRACK_H") + +#endif diff --git a/tests-mx32/nfnetlink_ctnetlink_exp.gen.test b/tests-mx32/nfnetlink_ctnetlink_exp.gen.test new file mode 100755 index 00000000..4ed3707e --- /dev/null +++ b/tests-mx32/nfnetlink_ctnetlink_exp.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_ctnetlink_exp +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nfnetlink_cttimeout.c b/tests-mx32/nfnetlink_cttimeout.c new file mode 100644 index 00000000..9602df7c --- /dev/null +++ b/tests-mx32/nfnetlink_cttimeout.c @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_CTTIMEOUT_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = + NFNL_SUBSYS_CTNETLINK_TIMEOUT << 8 | IPCTNL_MSG_TIMEOUT_NEW; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_TIMEOUT<<8|IPCTNL_MSG_TIMEOUT_NEW" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK_TIMEOUT << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_TIMEOUT<<8|0xff /* IPCTNL_MSG_TIMEOUT_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = + NFNL_SUBSYS_CTNETLINK_TIMEOUT << 8 | IPCTNL_MSG_TIMEOUT_NEW; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_APPEND; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_TIMEOUT<<8|IPCTNL_MSG_TIMEOUT_NEW" + ", flags=NLM_F_REQUEST|NLM_F_APPEND, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = + NFNL_SUBSYS_CTNETLINK_TIMEOUT << 8 | IPCTNL_MSG_TIMEOUT_GET; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ATOMIC; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_TIMEOUT<<8|IPCTNL_MSG_TIMEOUT_GET" + ", flags=NLM_F_REQUEST|NLM_F_ATOMIC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = + NFNL_SUBSYS_CTNETLINK_TIMEOUT << 8 | IPCTNL_MSG_TIMEOUT_DELETE; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_NONREC; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_TIMEOUT<<8|IPCTNL_MSG_TIMEOUT_DELETE" + ", flags=NLM_F_REQUEST|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_CTTIMEOUT_H") + +#endif diff --git a/tests-mx32/nfnetlink_cttimeout.gen.test b/tests-mx32/nfnetlink_cttimeout.gen.test new file mode 100755 index 00000000..ab42fc78 --- /dev/null +++ b/tests-mx32/nfnetlink_cttimeout.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_cttimeout +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nfnetlink_ipset.c b/tests-mx32/nfnetlink_ipset.c new file mode 100644 index 00000000..853ac307 --- /dev/null +++ b/tests-mx32/nfnetlink_ipset.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_IPSET_IP_SET_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_IPSET << 8 | IPSET_CMD_NONE; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_IPSET<<8|IPSET_CMD_NONE" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_IPSET << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_IPSET<<8|0xff /* IPSET_CMD_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_IPSET_IP_SET_H") + +#endif diff --git a/tests-mx32/nfnetlink_ipset.gen.test b/tests-mx32/nfnetlink_ipset.gen.test new file mode 100755 index 00000000..ea129fbc --- /dev/null +++ b/tests-mx32/nfnetlink_ipset.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_ipset +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nfnetlink_nft_compat.c b/tests-mx32/nfnetlink_nft_compat.c new file mode 100644 index 00000000..e5514f66 --- /dev/null +++ b/tests-mx32/nfnetlink_nft_compat.c @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NF_TABLES_COMPAT_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_NFT_COMPAT << 8 | NFNL_MSG_COMPAT_GET; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFT_COMPAT<<8|NFNL_MSG_COMPAT_GET" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_NFT_COMPAT << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFT_COMPAT<<8|0xff /* NFNL_MSG_COMPAT_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = NFNL_SUBSYS_NFT_COMPAT << 8 | NFNL_MSG_COMPAT_GET; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFT_COMPAT<<8|NFNL_MSG_COMPAT_GET" + ", flags=NLM_F_REQUEST|NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NF_TABLES_COMPAT_H") + +#endif diff --git a/tests-mx32/nfnetlink_nft_compat.gen.test b/tests-mx32/nfnetlink_nft_compat.gen.test new file mode 100755 index 00000000..aff04c5f --- /dev/null +++ b/tests-mx32/nfnetlink_nft_compat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_nft_compat +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nfnetlink_nftables.c b/tests-mx32/nfnetlink_nftables.c new file mode 100644 index 00000000..e959f703 --- /dev/null +++ b/tests-mx32/nfnetlink_nftables.c @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NF_TABLES_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_NFTABLES << 8 | NFT_MSG_NEWTABLE; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_NEWTABLE" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_NFTABLES << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFTABLES<<8|0xff /* NFT_MSG_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = NFNL_SUBSYS_NFTABLES << 8 | NFT_MSG_NEWTABLE; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_REPLACE; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_NEWTABLE" + ", flags=NLM_F_REQUEST|NLM_F_REPLACE, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_NFTABLES << 8 | NFT_MSG_GETTABLE; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_GETTABLE" + ", flags=NLM_F_REQUEST|NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_NFTABLES << 8 | NFT_MSG_DELTABLE; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_NONREC; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_DELTABLE" + ", flags=NLM_F_REQUEST|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NF_TABLES_H") + +#endif diff --git a/tests-mx32/nfnetlink_nftables.gen.test b/tests-mx32/nfnetlink_nftables.gen.test new file mode 100755 index 00000000..c23ad330 --- /dev/null +++ b/tests-mx32/nfnetlink_nftables.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_nftables +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nfnetlink_osf.c b/tests-mx32/nfnetlink_osf.c new file mode 100644 index 00000000..755615fc --- /dev/null +++ b/tests-mx32/nfnetlink_osf.c @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_XT_OSF_H + +# include +# include +# include "netlink.h" +# include +# include +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_OSF << 8 | OSF_MSG_ADD; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_OSF<<8|OSF_MSG_ADD" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_OSF << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_OSF<<8|0xff /* OSF_MSG_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_XT_OSF_H") + +#endif diff --git a/tests-mx32/nfnetlink_osf.gen.test b/tests-mx32/nfnetlink_osf.gen.test new file mode 100755 index 00000000..aa540907 --- /dev/null +++ b/tests-mx32/nfnetlink_osf.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_osf +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nfnetlink_queue.c b/tests-mx32/nfnetlink_queue.c new file mode 100644 index 00000000..960c497e --- /dev/null +++ b/tests-mx32/nfnetlink_queue.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_QUEUE_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_QUEUE << 8 | NFQNL_MSG_PACKET; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_QUEUE<<8|NFQNL_MSG_PACKET" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_QUEUE << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_QUEUE<<8|0xff /* NFQNL_MSG_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_QUEUE_H") + +#endif diff --git a/tests-mx32/nfnetlink_queue.gen.test b/tests-mx32/nfnetlink_queue.gen.test new file mode 100755 index 00000000..965e0d24 --- /dev/null +++ b/tests-mx32/nfnetlink_queue.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_queue +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nfnetlink_ulog.c b/tests-mx32/nfnetlink_ulog.c new file mode 100644 index 00000000..294e9a7e --- /dev/null +++ b/tests-mx32/nfnetlink_ulog.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_LOG_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_ULOG << 8 | NFULNL_MSG_PACKET; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_ULOG<<8|NFULNL_MSG_PACKET" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_ULOG << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_ULOG<<8|0xff /* NFULNL_MSG_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_LOG_H") + +#endif diff --git a/tests-mx32/nfnetlink_ulog.gen.test b/tests-mx32/nfnetlink_ulog.gen.test new file mode 100755 index 00000000..825ad9f6 --- /dev/null +++ b/tests-mx32/nfnetlink_ulog.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_ulog +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr.c b/tests-mx32/nlattr.c new file mode 100644 index 00000000..2c5927b2 --- /dev/null +++ b/tests-mx32/nlattr.c @@ -0,0 +1,313 @@ +/* + * Check decoding of netlink attribute. + * + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include "netlink.h" +#include +#include +#include + +static void +test_nlattr(const int fd) +{ + static const struct msg { + struct nlmsghdr nlh; + struct unix_diag_msg udm; + } c_msg = { + .nlh = { + .nlmsg_len = sizeof(struct msg), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP + }, + .udm = { + .udiag_family = AF_UNIX, + .udiag_type = SOCK_STREAM, + .udiag_state = TCP_FIN_WAIT1 + } + }; + struct msg *msg; + struct nlattr *nla; + unsigned int msg_len; + long rc; + + /* fetch fail: len < sizeof(struct nlattr) */ + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + 2; + msg = tail_memdup(&c_msg, msg_len); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + memcpy(nla, "12", 2); + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, \"\\x31\\x32\"}, %u" + ", MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, msg_len, sprintrc(rc)); + + /* fetch fail: short read */ + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + sizeof(*nla); + msg = tail_memdup(&c_msg, msg_len - 1); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, %p}, %u" + ", MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, (void *) msg + NLMSG_SPACE(sizeof(msg->udm)), + msg_len, sprintrc(rc)); + + /* print one struct nlattr */ + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + sizeof(*nla); + msg = tail_memdup(&c_msg, msg_len); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + *nla = (struct nlattr) { + .nla_len = sizeof(*nla), + .nla_type = UNIX_DIAG_NAME + }; + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {nla_len=%u" + ", nla_type=UNIX_DIAG_NAME}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, msg_len, sprintrc(rc)); + + /* print one struct nlattr with nla_len out of msg_len bounds */ + nla->nla_len += 8; + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {nla_len=%u" + ", nla_type=UNIX_DIAG_NAME}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, msg_len, sprintrc(rc)); + + /* print one struct nlattr and some data */ + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + NLA_HDRLEN + 4; + msg = tail_memdup(&c_msg, msg_len); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + *nla = (struct nlattr) { + .nla_len = NLA_HDRLEN + 4, + .nla_type = UNIX_DIAG_SHUTDOWN + 1 + }; + memcpy(RTA_DATA(nla), "1234", 4); + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {{nla_len=%u" + ", nla_type=%#x /* UNIX_DIAG_??? */}" + ", \"\\x31\\x32\\x33\\x34\"}}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, UNIX_DIAG_SHUTDOWN + 1, + msg_len, sprintrc(rc)); + + /* print one struct nlattr and fetch fail second struct nlattr */ + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + NLA_HDRLEN + 2; + msg = tail_memdup(&c_msg, msg_len); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + SET_STRUCT(struct nlattr, nla, + .nla_len = NLA_HDRLEN, + .nla_type = UNIX_DIAG_NAME + ); + memcpy(nla + 1, "12", 2); + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, [{nla_len=%u" + ", nla_type=UNIX_DIAG_NAME}, \"\\x31\\x32\"]}, %u" + ", MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, NLA_HDRLEN, msg_len, sprintrc(rc)); + + /* print one struct nlattr and short read of second struct nlattr */ + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + NLA_HDRLEN * 2; + msg = tail_memdup(&c_msg, msg_len - 1); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + SET_STRUCT(struct nlattr, nla, + .nla_len = NLA_HDRLEN, + .nla_type = UNIX_DIAG_NAME + ); + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, [{nla_len=%u" + ", nla_type=UNIX_DIAG_NAME}, ... /* %p */]}, %u" + ", MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, NLA_HDRLEN, nla + 1, msg_len, sprintrc(rc)); + + /* print two struct nlattr */ + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + NLA_HDRLEN * 2; + msg = tail_memdup(&c_msg, msg_len); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + *nla = (struct nlattr) { + .nla_len = NLA_HDRLEN, + .nla_type = UNIX_DIAG_NAME + }; + *(nla + 1) = (struct nlattr) { + .nla_len = NLA_HDRLEN, + .nla_type = UNIX_DIAG_PEER + }; + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, [{nla_len=%u" + ", nla_type=UNIX_DIAG_NAME}, {nla_len=%u" + ", nla_type=UNIX_DIAG_PEER}]}, %u" + ", MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, nla->nla_len, + msg_len, sprintrc(rc)); + + /* print first nlattr only when its nla_len is less than NLA_HDRLEN */ + nla->nla_len = NLA_HDRLEN - 1; + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {nla_len=%u" + ", nla_type=UNIX_DIAG_NAME}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, msg_len, sprintrc(rc)); + + /* unrecognized attribute data, abbreviated output */ +#define ABBREV_LEN (DEFAULT_STRLEN + 1) + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + NLA_HDRLEN * ABBREV_LEN * 2; + msg = tail_alloc(msg_len); + memcpy(msg, &c_msg, sizeof(c_msg)); + msg->nlh.nlmsg_len = msg_len; + unsigned int i; + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + for (i = 0; i < ABBREV_LEN; ++i) { + nla[i * 2] = (struct nlattr) { + .nla_len = NLA_HDRLEN * 2 - 1, + .nla_type = UNIX_DIAG_SHUTDOWN + 1 + i + }; + fill_memory_ex(&nla[i * 2 + 1], NLA_HDRLEN, + '0' + i, '~' - '0' - i); + } + + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}" + ", {udiag_family=AF_UNIX, udiag_type=SOCK_STREAM" + ", udiag_state=TCP_FIN_WAIT1, udiag_ino=0" + ", udiag_cookie=[0, 0]}, [", + fd, msg_len); + for (i = 0; i < DEFAULT_STRLEN; ++i) { + if (i) + printf(", "); + printf("{{nla_len=%u, nla_type=%#x /* UNIX_DIAG_??? */}, ", + nla->nla_len, UNIX_DIAG_SHUTDOWN + 1 + i); + print_quoted_hex(&nla[i * 2 + 1], NLA_HDRLEN - 1); + printf("}"); + } + printf(", ...]}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + msg_len, sprintrc(rc)); +} + +static void +test_nla_type(const int fd) +{ + static const struct msg { + struct nlmsghdr nlh; + struct unix_diag_msg udm; + } c_msg = { + .nlh = { + .nlmsg_len = sizeof(struct msg), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP + }, + .udm = { + .udiag_family = AF_UNIX, + .udiag_type = SOCK_STREAM, + .udiag_state = TCP_FIN_WAIT1 + } + }; + struct msg *msg; + struct nlattr *nla; + unsigned int msg_len; + long rc; + + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + sizeof(*nla); + msg = tail_memdup(&c_msg, msg_len); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + *nla = (struct nlattr) { + .nla_len = sizeof(*nla), + .nla_type = NLA_F_NESTED | UNIX_DIAG_NAME + }; + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {nla_len=%u" + ", nla_type=NLA_F_NESTED|UNIX_DIAG_NAME}}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, msg_len, sprintrc(rc)); + + nla->nla_type = NLA_F_NET_BYTEORDER | UNIX_DIAG_NAME; + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {nla_len=%u" + ", nla_type=NLA_F_NET_BYTEORDER|UNIX_DIAG_NAME}}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, msg_len, sprintrc(rc)); + + nla->nla_type = NLA_F_NESTED | NLA_F_NET_BYTEORDER | UNIX_DIAG_NAME; + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {nla_len=%u" + ", nla_type=NLA_F_NESTED|NLA_F_NET_BYTEORDER|UNIX_DIAG_NAME}}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, msg_len, sprintrc(rc)); + + nla->nla_type = NLA_F_NESTED | (UNIX_DIAG_SHUTDOWN + 1); + rc = sendto(fd, msg, msg->nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {nla_len=%u" + ", nla_type=NLA_F_NESTED|%#x /* UNIX_DIAG_??? */}}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg->nlh.nlmsg_len, nla->nla_len, UNIX_DIAG_SHUTDOWN + 1, + msg->nlh.nlmsg_len, sprintrc(rc)); +} + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_SOCK_DIAG); + + test_nlattr(fd); + test_nla_type(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} diff --git a/tests-mx32/nlattr.gen.test b/tests-mx32/nlattr.gen.test new file mode 100755 index 00000000..0ea2f185 --- /dev/null +++ b/tests-mx32/nlattr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_br_port_msg.c b/tests-mx32/nlattr_br_port_msg.c new file mode 100644 index 00000000..9a7c3f25 --- /dev/null +++ b/tests-mx32/nlattr_br_port_msg.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_BR_PORT_MSG + +# include +# include +# include "test_nlattr.h" +# include +# include + +static void +init_br_port_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETMDB, + .nlmsg_flags = NLM_F_DUMP + ); + + struct br_port_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct br_port_msg, msg, + .family = AF_UNIX, + .ifindex = ifindex_lo() + ); +} + +static void +print_br_port_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETMDB, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {family=AF_UNIX" + ", ifindex=" IFINDEX_LO_STR "}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + + const unsigned int hdrlen = sizeof(struct br_port_msg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 4); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* MDBA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_br_port_msg, print_br_port_msg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_BR_PORT_MSG") + +#endif diff --git a/tests-mx32/nlattr_br_port_msg.gen.test b/tests-mx32/nlattr_br_port_msg.gen.test new file mode 100755 index 00000000..c9572759 --- /dev/null +++ b/tests-mx32/nlattr_br_port_msg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_br_port_msg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_crypto_user_alg.c b/tests-mx32/nlattr_crypto_user_alg.c new file mode 100644 index 00000000..f90c6208 --- /dev/null +++ b/tests-mx32/nlattr_crypto_user_alg.c @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_CRYPTOUSER_H + +# include +# include +# include "test_nlattr.h" +# include + +# define CRYPTOCFGA_REPORT_LARVAL 2 + +static void +init_crypto_user_alg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = CRYPTO_MSG_GETALG, + .nlmsg_flags = NLM_F_DUMP + ); + + struct crypto_user_alg *const alg = NLMSG_DATA(nlh); + SET_STRUCT(struct crypto_user_alg, alg, + .cru_name = "abcd", + .cru_driver_name = "efgh", + .cru_module_name = "ijkl", + ); +} + +static void +print_crypto_user_alg(const unsigned int msg_len) +{ + printf("{len=%u, type=CRYPTO_MSG_GETALG" + ", flags=NLM_F_DUMP, seq=0, pid=0}" + ", {cru_name=\"abcd\", cru_driver_name=\"efgh\"" + ", cru_module_name=\"ijkl\", cru_type=0" + ", cru_mask=0, cru_refcnt=0, cru_flags=0}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_CRYPTO); + const unsigned int hdrlen = sizeof(struct crypto_user_alg); + /* + * There are also other structures, but they are not bigger than + * DEFAULT_STRLEN so far. + */ + void *const nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + DEFAULT_STRLEN); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + char *const str = tail_alloc(DEFAULT_STRLEN); + fill_memory_ex(str, DEFAULT_STRLEN, '0', 10); + TEST_NLATTR(fd, nlh0, hdrlen, + init_crypto_user_alg, print_crypto_user_alg, + CRYPTOCFGA_REPORT_LARVAL, + DEFAULT_STRLEN, str, DEFAULT_STRLEN, + printf("{type=\"%.*s\"...}", DEFAULT_STRLEN, str)); + str[DEFAULT_STRLEN - 1] = '\0'; + TEST_NLATTR(fd, nlh0, hdrlen, + init_crypto_user_alg, print_crypto_user_alg, + CRYPTOCFGA_REPORT_LARVAL, + DEFAULT_STRLEN, str, DEFAULT_STRLEN, + printf("{type=\"%s\"}", str)); + +# ifdef HAVE_STRUCT_CRYPTO_REPORT_HASH + static const struct crypto_report_hash rhash = { + .type = "efgh", + .blocksize = 0xabcdefdc, + .digestsize = 0xfebcdacd + }; + TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen, + init_crypto_user_alg, print_crypto_user_alg, + CRYPTOCFGA_REPORT_HASH, + pattern, rhash, print_quoted_memory, + printf("{type=\"efgh\""); + PRINT_FIELD_U(", ", rhash, blocksize); + PRINT_FIELD_U(", ", rhash, digestsize); + printf("}")); +# endif + +# ifdef HAVE_STRUCT_CRYPTO_REPORT_BLKCIPHER + static const struct crypto_report_blkcipher rblkcipher = { + .type = "abcd", + .geniv = "efgh", + .blocksize = 0xabcdefac, + .min_keysize = 0xfeadbcda, + .max_keysize = 0xbdacdeac, + .ivsize = 0xefacbdac + }; + TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen, + init_crypto_user_alg, print_crypto_user_alg, + CRYPTOCFGA_REPORT_BLKCIPHER, + pattern, rblkcipher, print_quoted_memory, + printf("{type=\"abcd\", geniv=\"efgh\""); + PRINT_FIELD_U(", ", rblkcipher, blocksize); + PRINT_FIELD_U(", ", rblkcipher, min_keysize); + PRINT_FIELD_U(", ", rblkcipher, max_keysize); + PRINT_FIELD_U(", ", rblkcipher, ivsize); + printf("}")); +# endif + +# ifdef HAVE_STRUCT_CRYPTO_REPORT_AEAD + static const struct crypto_report_aead raead = { + .type = "abcd", + .geniv = "efgh", + .blocksize = 0xbaefdbac, + .maxauthsize = 0xfdbdbcda, + .ivsize = 0xacbefdac + }; + TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen, + init_crypto_user_alg, print_crypto_user_alg, + CRYPTOCFGA_REPORT_AEAD, + pattern, raead, print_quoted_memory, + printf("{type=\"abcd\", geniv=\"efgh\""); + PRINT_FIELD_U(", ", raead, blocksize); + PRINT_FIELD_U(", ", raead, maxauthsize); + PRINT_FIELD_U(", ", raead, ivsize); + printf("}")); +# endif + +# ifdef HAVE_STRUCT_CRYPTO_REPORT_RNG + static const struct crypto_report_rng rrng = { + .type = "abcd", + .seedsize = 0xabcdefac + }; + TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen, + init_crypto_user_alg, print_crypto_user_alg, + CRYPTOCFGA_REPORT_RNG, + pattern, rrng, print_quoted_memory, + printf("{type=\"abcd\""); + PRINT_FIELD_U(", ", rrng, seedsize); + printf("}")); +# endif + +# ifdef HAVE_STRUCT_CRYPTO_REPORT_CIPHER + static const struct crypto_report_cipher rcipher = { + .type = "abcd", + .blocksize = 0xabcdefac, + .min_keysize = 0xfeadbcda, + .max_keysize = 0xbdacdeac, + }; + TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen, + init_crypto_user_alg, print_crypto_user_alg, + CRYPTOCFGA_REPORT_CIPHER, + pattern, rcipher, print_quoted_memory, + printf("{type=\"abcd\""); + PRINT_FIELD_U(", ", rcipher, blocksize); + PRINT_FIELD_U(", ", rcipher, min_keysize); + PRINT_FIELD_U(", ", rcipher, max_keysize); + printf("}")); +# endif + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_CRYPTOUSER_H"); + +#endif diff --git a/tests-mx32/nlattr_crypto_user_alg.gen.test b/tests-mx32/nlattr_crypto_user_alg.gen.test new file mode 100755 index 00000000..e52b6be7 --- /dev/null +++ b/tests-mx32/nlattr_crypto_user_alg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_crypto_user_alg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_dcbmsg.c b/tests-mx32/nlattr_dcbmsg.c new file mode 100644 index 00000000..06efb283 --- /dev/null +++ b/tests-mx32/nlattr_dcbmsg.c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_DCBMSG + +# include +# include "test_nlattr.h" +# include +# include + +static void +init_dcbmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETDCB, + .nlmsg_flags = NLM_F_DUMP + ); + + struct dcbmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct dcbmsg, msg, + .dcb_family = AF_UNIX, + .cmd = DCB_CMD_UNDEFINED + ); +} + +static void +print_dcbmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETDCB, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {dcb_family=AF_UNIX" + ", cmd=DCB_CMD_UNDEFINED}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct dcbmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 4); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* DCB_ATTR_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_dcbmsg, print_dcbmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_DCBMSG") + +#endif diff --git a/tests-mx32/nlattr_dcbmsg.gen.test b/tests-mx32/nlattr_dcbmsg.gen.test new file mode 100755 index 00000000..f9ef39f7 --- /dev/null +++ b/tests-mx32/nlattr_dcbmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_dcbmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_fib_rule_hdr.c b/tests-mx32/nlattr_fib_rule_hdr.c new file mode 100644 index 00000000..d5ba13e2 --- /dev/null +++ b/tests-mx32/nlattr_fib_rule_hdr.c @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_FIB_RULES_H + +# include +# include +# include "test_nlattr.h" +# include +# include +# include +# include + +# define FRA_TUN_ID 12 +# define FRA_TABLE 15 +# define FRA_UID_RANGE 20 +# define FRA_PROTOCOL 21 +# define FRA_IP_PROTO 22 +# define FRA_SPORT_RANGE 23 +# define FRA_DPORT_RANGE 24 + +# ifndef HAVE_STRUCT_FIB_RULE_PORT_RANGE +struct fib_rule_port_range { + uint16_t start; + uint16_t end; +}; +# endif /* HAVE_STRUCT_FIB_RULE_PORT_RANGE */ + +static void +init_rtmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETRULE, + .nlmsg_flags = NLM_F_DUMP + ); + + struct rtmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct rtmsg, msg, + .rtm_family = AF_UNIX, + .rtm_tos = IPTOS_LOWDELAY, + .rtm_table = RT_TABLE_UNSPEC, + .rtm_type = FR_ACT_TO_TBL, + .rtm_flags = FIB_RULE_INVERT + ); +} + +static void +print_rtmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETRULE, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {family=AF_UNIX" + ", dst_len=0, src_len=0" + ", tos=IPTOS_LOWDELAY" + ", table=RT_TABLE_UNSPEC" + ", action=FR_ACT_TO_TBL" + ", flags=FIB_RULE_INVERT}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct rtmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 8); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* FRA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_DST, 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + const uint32_t table_id = RT_TABLE_DEFAULT; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_TABLE, pattern, table_id, + printf("RT_TABLE_DEFAULT")); + +# ifdef HAVE_STRUCT_FIB_RULE_UID_RANGE + static const struct fib_rule_uid_range range = { + .start = 0xabcdedad, + .end = 0xbcdeadba + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_UID_RANGE, pattern, range, + PRINT_FIELD_U("{", range, start); + PRINT_FIELD_U(", ", range, end); + printf("}")); +# endif +# if defined HAVE_BE64TOH || defined be64toh + const uint64_t tun_id = 0xabcdcdbeedabadef; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_TUN_ID, pattern, tun_id, + printf("htobe64(%" PRIu64 ")", be64toh(tun_id))); +# endif + + uint8_t proto; + + static const struct { + uint8_t arg; + const char *str; + } proto_args[] = { + { ARG_STR(RTPROT_UNSPEC) }, + { 5, "0x5 /* RTPROT_??? */" }, + { 17, "RTPROT_MROUTED" }, + { 42, "RTPROT_BABEL" }, + { 43, "0x2b /* RTPROT_??? */" }, + { ARG_STR(0xde) " /* RTPROT_??? */" }, + }; + + for (unsigned i = 0; i < ARRAY_SIZE(proto_args); i++) { + proto = proto_args[i].arg; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_PROTOCOL, pattern, proto, + printf("%s", proto_args[i].str)); + } + + static const struct { + uint8_t arg; + const char *str; + } ipproto_args[] = { + { ARG_STR(IPPROTO_TCP) }, + { 254, "0xfe /* IPPROTO_??? */" }, + { ARG_STR(IPPROTO_RAW) }, + }; + + for (unsigned i = 0; i < ARRAY_SIZE(ipproto_args); i++) { + proto = ipproto_args[i].arg; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_IP_PROTO, pattern, proto, + printf("%s", ipproto_args[i].str)); + } + + static const struct fib_rule_port_range prange = { + .start = 0xabcd, + .end = 0xfeed, + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_SPORT_RANGE, pattern, prange, + PRINT_FIELD_U("{", prange, start); + PRINT_FIELD_U(", ", prange, end); + printf("}")); + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_DPORT_RANGE, pattern, prange, + PRINT_FIELD_U("{", prange, start); + PRINT_FIELD_U(", ", prange, end); + printf("}")); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_FIB_RULES_H") + +#endif diff --git a/tests-mx32/nlattr_fib_rule_hdr.gen.test b/tests-mx32/nlattr_fib_rule_hdr.gen.test new file mode 100755 index 00000000..fb61343d --- /dev/null +++ b/tests-mx32/nlattr_fib_rule_hdr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_fib_rule_hdr +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_ifaddrlblmsg.c b/tests-mx32/nlattr_ifaddrlblmsg.c new file mode 100644 index 00000000..ce9d7a80 --- /dev/null +++ b/tests-mx32/nlattr_ifaddrlblmsg.c @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_IFADDRLBLMSG + +# include +# include "test_nlattr.h" +# include +# include + +static void +init_ifaddrlblmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETADDRLABEL, + .nlmsg_flags = NLM_F_DUMP + ); + + struct ifaddrlblmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct ifaddrlblmsg, msg, + .ifal_family = AF_UNIX, + .ifal_index = ifindex_lo() + ); +} + +static void +print_ifaddrlblmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETADDRLABEL, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {ifal_family=AF_UNIX" + ", ifal_prefixlen=0, ifal_flags=0" + ", ifal_index=" IFINDEX_LO_STR + ", ifal_seq=0}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct ifaddrlblmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 4); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* IFAL_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_ifaddrlblmsg, print_ifaddrlblmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifaddrlblmsg, print_ifaddrlblmsg, + IFAL_ADDRESS, 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_IFADDRLBLMSG") + +#endif diff --git a/tests-mx32/nlattr_ifaddrlblmsg.gen.test b/tests-mx32/nlattr_ifaddrlblmsg.gen.test new file mode 100755 index 00000000..0f51430f --- /dev/null +++ b/tests-mx32/nlattr_ifaddrlblmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifaddrlblmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_ifaddrmsg.c b/tests-mx32/nlattr_ifaddrmsg.c new file mode 100644 index 00000000..4e952555 --- /dev/null +++ b/tests-mx32/nlattr_ifaddrmsg.c @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include "test_nlattr.h" +#ifdef HAVE_LINUX_IF_ADDR_H +# include +#endif +#include + +#define IFA_FLAGS 8 + +#define SET_IFA_FAMILY(af) \ + do { \ + ifa_family = af; \ + ifa_family_str = #af; \ + } \ + while (0) + +uint8_t ifa_family; +const char *ifa_family_str; + +static void +init_ifaddrmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETADDR, + .nlmsg_flags = NLM_F_DUMP + ); + + struct ifaddrmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct ifaddrmsg, msg, + .ifa_family = ifa_family, + .ifa_flags = IFA_F_SECONDARY, + .ifa_scope = RT_SCOPE_UNIVERSE, + .ifa_index = ifindex_lo() + ); +} + +static void +print_ifaddrmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETADDR, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {ifa_family=%s" + ", ifa_prefixlen=0" + ", ifa_flags=IFA_F_SECONDARY" + ", ifa_scope=RT_SCOPE_UNIVERSE" + ", ifa_index=" IFINDEX_LO_STR "}", + msg_len, ifa_family_str); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + static const char address4[] = "12.34.56.78"; + static const char address6[] = "12:34:56:78:90:ab:cd:ef"; + static const struct ifa_cacheinfo ci = { + .ifa_prefered = 0xabcdefac, + .ifa_valid = 0xbcdadbca, + .cstamp = 0xcdabedba, + .tstamp = 0xdebabdac + }; + + struct in_addr a4; + struct in6_addr a6; + const uint32_t ifa_flags = IFA_F_SECONDARY | IFA_F_PERMANENT; + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct ifaddrmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + MAX(sizeof(ci), sizeof(a6))); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + SET_IFA_FAMILY(AF_UNSPEC); + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* IFA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_ifaddrmsg, print_ifaddrmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifaddrmsg, print_ifaddrmsg, + IFA_ADDRESS, 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + SET_IFA_FAMILY(AF_INET); + + if (!inet_pton(AF_INET, address4, &a4)) + perror_msg_and_skip("inet_pton"); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifaddrmsg, print_ifaddrmsg, + IFA_ADDRESS, pattern, a4, + printf("inet_addr(\"%s\")", address4)); + + SET_IFA_FAMILY(AF_INET6); + + if (!inet_pton(AF_INET6, address6, &a6)) + perror_msg_and_skip("inet_pton"); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifaddrmsg, print_ifaddrmsg, + IFA_ADDRESS, pattern, a6, + printf("inet_pton(AF_INET6, \"%s\")", address6)); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifaddrmsg, print_ifaddrmsg, + IFA_CACHEINFO, pattern, ci, + PRINT_FIELD_U("{", ci, ifa_prefered); + PRINT_FIELD_U(", ", ci, ifa_valid); + PRINT_FIELD_U(", ", ci, cstamp); + PRINT_FIELD_U(", ", ci, tstamp); + printf("}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifaddrmsg, print_ifaddrmsg, + IFA_FLAGS, pattern, ifa_flags, + printf("IFA_F_SECONDARY|IFA_F_PERMANENT")); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/nlattr_ifaddrmsg.gen.test b/tests-mx32/nlattr_ifaddrmsg.gen.test new file mode 100755 index 00000000..3fb81bdb --- /dev/null +++ b/tests-mx32/nlattr_ifaddrmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifaddrmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_ifinfomsg.c b/tests-mx32/nlattr_ifinfomsg.c new file mode 100644 index 00000000..a8660196 --- /dev/null +++ b/tests-mx32/nlattr_ifinfomsg.c @@ -0,0 +1,346 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include "test_nlattr.h" + +#include +#include +#ifdef HAVE_LINUX_IF_LINK_H +# include +#endif +#include + +#ifndef IFLA_LINKINFO +# define IFLA_LINKINFO 18 +#endif +#ifndef IFLA_VF_PORTS +# define IFLA_VF_PORTS 24 +#endif +#define IFLA_LINK_NETNSID 37 +#define IFLA_EVENT 44 + +#ifndef IFLA_INFO_KIND +# define IFLA_INFO_KIND 1 +#endif + +#ifndef IFLA_VF_PORT +# define IFLA_VF_PORT 1 +#endif + +static void +init_ifinfomsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETLINK, + .nlmsg_flags = NLM_F_DUMP + ); + + struct ifinfomsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct ifinfomsg, msg, + .ifi_family = AF_UNIX, + .ifi_type = ARPHRD_LOOPBACK, + .ifi_index = ifindex_lo(), + .ifi_flags = IFF_UP, + ); +} + +static void +print_ifinfomsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETLINK, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {ifi_family=AF_UNIX" + ", ifi_type=ARPHRD_LOOPBACK" + ", ifi_index=" IFINDEX_LO_STR + ", ifi_flags=IFF_UP, ifi_change=0}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + static const struct rtnl_link_stats st = { + .rx_packets = 0xabcdefac, + .tx_packets = 0xbcdacdab, + .rx_bytes = 0xcdbafaab, + .tx_bytes = 0xdafabadb, + .rx_errors = 0xeabcdaeb, + .tx_errors = 0xfefabeab, + .rx_dropped = 0xadbafafb, + .tx_dropped = 0xbdffabda, + .multicast = 0xcdabdfea, + .collisions = 0xefadbaeb, + .rx_length_errors = 0xfabffabd, + .rx_over_errors = 0xafbafabc, + .rx_crc_errors = 0xbfdabdad, + .rx_frame_errors = 0xcfdabfad, + .rx_fifo_errors = 0xddfdebad, + .rx_missed_errors = 0xefabdcba, + .tx_aborted_errors = 0xefdadbfa, + .tx_carrier_errors = 0xfaefbada, + .tx_fifo_errors = 0xaebdffab, + .tx_heartbeat_errors = 0xbadebaaf, + .tx_window_errors = 0xcdafbada, + .rx_compressed = 0xdeffadbd, + .tx_compressed = 0xefdadfab + }; + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct ifinfomsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(st)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* IFLA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + const int32_t netnsid = 0xacbdabda; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_LINK_NETNSID, pattern, netnsid, + printf("%d", netnsid)); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_STATS, pattern, st, + PRINT_FIELD_U("{", st, rx_packets); + PRINT_FIELD_U(", ", st, tx_packets); + PRINT_FIELD_U(", ", st, rx_bytes); + PRINT_FIELD_U(", ", st, tx_bytes); + PRINT_FIELD_U(", ", st, rx_errors); + PRINT_FIELD_U(", ", st, tx_errors); + PRINT_FIELD_U(", ", st, rx_dropped); + PRINT_FIELD_U(", ", st, tx_dropped); + PRINT_FIELD_U(", ", st, multicast); + PRINT_FIELD_U(", ", st, collisions); + PRINT_FIELD_U(", ", st, rx_length_errors); + PRINT_FIELD_U(", ", st, rx_over_errors); + PRINT_FIELD_U(", ", st, rx_crc_errors); + PRINT_FIELD_U(", ", st, rx_frame_errors); + PRINT_FIELD_U(", ", st, rx_fifo_errors); + PRINT_FIELD_U(", ", st, rx_missed_errors); + PRINT_FIELD_U(", ", st, tx_aborted_errors); + PRINT_FIELD_U(", ", st, tx_carrier_errors); + PRINT_FIELD_U(", ", st, tx_fifo_errors); + PRINT_FIELD_U(", ", st, tx_heartbeat_errors); + PRINT_FIELD_U(", ", st, tx_window_errors); + PRINT_FIELD_U(", ", st, rx_compressed); + PRINT_FIELD_U(", ", st, tx_compressed); +#ifdef HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER + PRINT_FIELD_U(", ", st, rx_nohandler); +#endif + printf("}")); + +#ifdef HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER + const unsigned int sizeof_stats = + offsetofend(struct rtnl_link_stats, tx_compressed); + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_STATS, sizeof_stats, &st, sizeof_stats, + PRINT_FIELD_U("{", st, rx_packets); + PRINT_FIELD_U(", ", st, tx_packets); + PRINT_FIELD_U(", ", st, rx_bytes); + PRINT_FIELD_U(", ", st, tx_bytes); + PRINT_FIELD_U(", ", st, rx_errors); + PRINT_FIELD_U(", ", st, tx_errors); + PRINT_FIELD_U(", ", st, rx_dropped); + PRINT_FIELD_U(", ", st, tx_dropped); + PRINT_FIELD_U(", ", st, multicast); + PRINT_FIELD_U(", ", st, collisions); + PRINT_FIELD_U(", ", st, rx_length_errors); + PRINT_FIELD_U(", ", st, rx_over_errors); + PRINT_FIELD_U(", ", st, rx_crc_errors); + PRINT_FIELD_U(", ", st, rx_frame_errors); + PRINT_FIELD_U(", ", st, rx_fifo_errors); + PRINT_FIELD_U(", ", st, rx_missed_errors); + PRINT_FIELD_U(", ", st, tx_aborted_errors); + PRINT_FIELD_U(", ", st, tx_carrier_errors); + PRINT_FIELD_U(", ", st, tx_fifo_errors); + PRINT_FIELD_U(", ", st, tx_heartbeat_errors); + PRINT_FIELD_U(", ", st, tx_window_errors); + PRINT_FIELD_U(", ", st, rx_compressed); + PRINT_FIELD_U(", ", st, tx_compressed); + printf("}")); +#endif /* HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER */ + + static const struct rtnl_link_ifmap map = { + .mem_start = 0xadcbefedefbcdedb, + .mem_end = 0xefcbeabdecdcdefa, + .base_addr = 0xaddbeabdfaacdbae, + .irq = 0xefaf, + .dma = 0xab, + .port = 0xcd + }; + const unsigned int sizeof_ifmap = + offsetofend(struct rtnl_link_ifmap, port); + const unsigned int plen = sizeof_ifmap - 1 > DEFAULT_STRLEN + ? DEFAULT_STRLEN + : (int) sizeof_ifmap - 1; + /* len < sizeof_ifmap */ + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_MAP, plen, pattern, plen, + print_quoted_hex(pattern, plen)); + + /* short read of sizeof_ifmap */ + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_MAP, sizeof_ifmap, &map, sizeof_ifmap - 1, + printf("%p", RTA_DATA(TEST_NLATTR_nla))); + + /* sizeof_ifmap */ + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_MAP, sizeof_ifmap, &map, sizeof_ifmap, + PRINT_FIELD_X("{", map, mem_start); + PRINT_FIELD_X(", ", map, mem_end); + PRINT_FIELD_X(", ", map, base_addr); + PRINT_FIELD_U(", ", map, irq); + PRINT_FIELD_U(", ", map, dma); + PRINT_FIELD_U(", ", map, port); + printf("}")); + +#ifdef HAVE_STRUCT_RTNL_LINK_STATS64 + static const struct rtnl_link_stats64 st64 = { + .rx_packets = 0xadcbefedefbcdedb, + .tx_packets = 0xbdabdedabdcdeabd, + .rx_bytes = 0xcdbaefbaeadfabec, + .tx_bytes = 0xdbaedbafabbeacdb, + .rx_errors = 0xefabfdaefabaefab, + .tx_errors = 0xfaebfabfabbaeabf, + .rx_dropped = 0xacdbaedbadbabeba, + .tx_dropped = 0xbcdeffebdabeadbe, + .multicast = 0xeeffbaeabaeffabe, + .collisions = 0xffbaefcefbafacef, + .rx_length_errors = 0xaabbdeabceffdecb, + .rx_over_errors = 0xbbdcdadebadeaeed, + .rx_crc_errors= 0xccdeabecefaedbef, + .rx_frame_errors = 0xddbedaedebcedaef, + .rx_fifo_errors = 0xeffbadefafdaeaab, + .rx_missed_errors = 0xfefaebccceadeecd, + .tx_aborted_errors = 0xabcdadefcdadef, + .tx_carrier_errors = 0xbccdafaeeaaefe, + .tx_fifo_errors = 0xcddefdbedeadce, + .tx_heartbeat_errors = 0xedaededdadcdea, + .tx_window_errors = 0xfdacdeaccedcda, + .rx_compressed = 0xacdbbcacdbccef, + .tx_compressed = 0xbcdadefcdedfea + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_STATS64, pattern, st64, + PRINT_FIELD_U("{", st64, rx_packets); + PRINT_FIELD_U(", ", st64, tx_packets); + PRINT_FIELD_U(", ", st64, rx_bytes); + PRINT_FIELD_U(", ", st64, tx_bytes); + PRINT_FIELD_U(", ", st64, rx_errors); + PRINT_FIELD_U(", ", st64, tx_errors); + PRINT_FIELD_U(", ", st64, rx_dropped); + PRINT_FIELD_U(", ", st64, tx_dropped); + PRINT_FIELD_U(", ", st64, multicast); + PRINT_FIELD_U(", ", st64, collisions); + PRINT_FIELD_U(", ", st64, rx_length_errors); + PRINT_FIELD_U(", ", st64, rx_over_errors); + PRINT_FIELD_U(", ", st64, rx_crc_errors); + PRINT_FIELD_U(", ", st64, rx_frame_errors); + PRINT_FIELD_U(", ", st64, rx_fifo_errors); + PRINT_FIELD_U(", ", st64, rx_missed_errors); + PRINT_FIELD_U(", ", st64, tx_aborted_errors); + PRINT_FIELD_U(", ", st64, tx_carrier_errors); + PRINT_FIELD_U(", ", st64, tx_fifo_errors); + PRINT_FIELD_U(", ", st64, tx_heartbeat_errors); + PRINT_FIELD_U(", ", st64, tx_window_errors); + PRINT_FIELD_U(", ", st64, rx_compressed); + PRINT_FIELD_U(", ", st64, tx_compressed); +# ifdef HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER + PRINT_FIELD_U(", ", st64, rx_nohandler); +# endif + printf("}")); + +# ifdef HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER + const unsigned int sizeof_stats64 = + offsetofend(struct rtnl_link_stats64, tx_compressed); + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_STATS64, sizeof_stats64, &st64, sizeof_stats64, + PRINT_FIELD_U("{", st64, rx_packets); + PRINT_FIELD_U(", ", st64, tx_packets); + PRINT_FIELD_U(", ", st64, rx_bytes); + PRINT_FIELD_U(", ", st64, tx_bytes); + PRINT_FIELD_U(", ", st64, rx_errors); + PRINT_FIELD_U(", ", st64, tx_errors); + PRINT_FIELD_U(", ", st64, rx_dropped); + PRINT_FIELD_U(", ", st64, tx_dropped); + PRINT_FIELD_U(", ", st64, multicast); + PRINT_FIELD_U(", ", st64, collisions); + PRINT_FIELD_U(", ", st64, rx_length_errors); + PRINT_FIELD_U(", ", st64, rx_over_errors); + PRINT_FIELD_U(", ", st64, rx_crc_errors); + PRINT_FIELD_U(", ", st64, rx_frame_errors); + PRINT_FIELD_U(", ", st64, rx_fifo_errors); + PRINT_FIELD_U(", ", st64, rx_missed_errors); + PRINT_FIELD_U(", ", st64, tx_aborted_errors); + PRINT_FIELD_U(", ", st64, tx_carrier_errors); + PRINT_FIELD_U(", ", st64, tx_fifo_errors); + PRINT_FIELD_U(", ", st64, tx_heartbeat_errors); + PRINT_FIELD_U(", ", st64, tx_window_errors); + PRINT_FIELD_U(", ", st64, rx_compressed); + PRINT_FIELD_U(", ", st64, tx_compressed); + printf("}")); +# endif /* HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER */ +#endif /* HAVE_STRUCT_RTNL_LINK_STATS64 */ + + struct nlattr nla = { + .nla_len = sizeof(nla), + .nla_type = IFLA_INFO_KIND, + }; + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_LINKINFO, sizeof(nla), &nla, sizeof(nla), + printf("{nla_len=%u, nla_type=IFLA_INFO_KIND}", + nla.nla_len)); + + nla.nla_type = IFLA_VF_PORT; + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_VF_PORTS, sizeof(nla), &nla, sizeof(nla), + printf("{nla_len=%u, nla_type=IFLA_VF_PORT}", + nla.nla_len)); + + static const struct { + uint32_t val; + const char *str; + } ifla_events[] = { + { 0, "IFLA_EVENT_NONE" }, + { 6, "IFLA_EVENT_BONDING_OPTIONS" }, + { ARG_STR(0x7) " /* IFLA_EVENT_??? */" }, + { ARG_STR(0xdeadfeed) " /* IFLA_EVENT_??? */" }, + }; + for (size_t i = 0; i < ARRAY_SIZE(ifla_events); i++) { + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_EVENT, pattern, ifla_events[i].val, + printf("%s", ifla_events[i].str)); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/nlattr_ifinfomsg.gen.test b/tests-mx32/nlattr_ifinfomsg.gen.test new file mode 100755 index 00000000..b9a6456a --- /dev/null +++ b/tests-mx32/nlattr_ifinfomsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifinfomsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_ifla.h b/tests-mx32/nlattr_ifla.h new file mode 100644 index 00000000..6772ae29 --- /dev/null +++ b/tests-mx32/nlattr_ifla.h @@ -0,0 +1,58 @@ +/* + * netlink attribute ifinfomsg common code. + * + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef STRACE_TESTS_NLATTR_IFLA_H +# define STRACE_TESTS_NLATTR_IFLA_H + +# include "tests.h" + +# ifndef IFLA_ATTR +# error "Please define IFLA_ATTR before including this file" +# endif + +static const unsigned int hdrlen = sizeof(struct ifinfomsg); + +static void +init_ifinfomsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETLINK, + .nlmsg_flags = NLM_F_DUMP + ); + + struct ifinfomsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct ifinfomsg, msg, + .ifi_family = AF_UNIX, + .ifi_type = ARPHRD_LOOPBACK, + .ifi_index = ifindex_lo(), + .ifi_flags = IFF_UP, + ); + + struct nlattr *const nla = NLMSG_ATTR(nlh, sizeof(*msg)); + SET_STRUCT(struct nlattr, nla, + .nla_len = msg_len - NLMSG_SPACE(hdrlen), + .nla_type = IFLA_ATTR + ); +} + +static void +print_ifinfomsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETLINK, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {ifi_family=AF_UNIX" + ", ifi_type=ARPHRD_LOOPBACK" + ", ifi_index=" IFINDEX_LO_STR + ", ifi_flags=IFF_UP, ifi_change=0}" + ", {{nla_len=%u, nla_type=" STRINGIFY_VAL(IFLA_ATTR) "}", + msg_len, msg_len - NLMSG_SPACE(hdrlen)); +} + +#endif /* STRACE_TESTS_NLATTR_IFLA_H */ diff --git a/tests-mx32/nlattr_ifla_af_spec.c b/tests-mx32/nlattr_ifla_af_spec.c new file mode 100644 index 00000000..e5e76c60 --- /dev/null +++ b/tests-mx32/nlattr_ifla_af_spec.c @@ -0,0 +1,303 @@ +/* + * IFLA_AF_SPEC netlink attribute decoding check. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include "test_nlattr.h" + +#include +#include +#ifdef HAVE_LINUX_IF_LINK_H +# include +#endif +#include + +#if !HAVE_DECL_IFLA_AF_SPEC +enum { IFLA_AF_SPEC = 26 }; +#endif + +#define XLAT_MACROS_ONLY +#include "xlat/rtnl_ifla_af_spec_inet_attrs.h" +#include "xlat/rtnl_ifla_af_spec_inet6_attrs.h" +#undef XLAT_MACROS_ONLY + +#ifndef HAVE_STRUCT_IFLA_CACHEINFO +struct ifla_cacheinfo { + uint32_t max_reasm_len; + uint32_t tstamp; + uint32_t reachable_time; + uint32_t retrans_time; +}; +#endif + +#define IFLA_ATTR IFLA_AF_SPEC +#include "nlattr_ifla.h" + +#define AF_SPEC_FUNCS(family_) \ + static void \ + init_##family_##_msg(struct nlmsghdr *const nlh, \ + const unsigned int msg_len) \ + { \ + init_ifinfomsg(nlh, msg_len); \ + \ + struct nlattr *nla = NLMSG_ATTR(nlh, hdrlen); \ + nla += 1; \ + SET_STRUCT(struct nlattr, nla, \ + .nla_len = msg_len - NLMSG_SPACE(hdrlen) \ + - NLA_HDRLEN, \ + .nla_type = family_, \ + ); \ + } \ + \ + static void \ + print_##family_##_msg(const unsigned int msg_len) \ + { \ + print_ifinfomsg(msg_len); \ + printf(", {{nla_len=%u, nla_type=" #family_ "}", \ + msg_len - NLMSG_SPACE(hdrlen) - NLA_HDRLEN); \ + } \ + /* end of AF_SPEC_FUNCS definition */ + +AF_SPEC_FUNCS(AF_INET) +AF_SPEC_FUNCS(AF_INET6) + +static void +print_arr_val(uint32_t *val, size_t idx, const char *idx_str) +{ + if (idx_str) + printf("[%s] = ", idx_str); + else + printf("[%zu] = ", idx); + + printf("%d", *val); +} + +static void +print_arr_uval(uint64_t *val, size_t idx, const char *idx_str) +{ + if (idx_str) + printf("[%s] = ", idx_str); + else + printf("[%zu] = ", idx); + + printf("%" PRIu64, *val); +} + +static void +print_inet_conf_val(uint32_t *val, size_t idx) +{ + static const char * const strs[] = { + "IPV4_DEVCONF_FORWARDING-1", + "IPV4_DEVCONF_MC_FORWARDING-1", + }; + + print_arr_val(val, idx, idx < ARRAY_SIZE(strs) ? strs[idx] : NULL); +} + + +static void +print_inet6_conf_val(uint32_t *val, size_t idx) +{ + static const char * const strs[] = { + "DEVCONF_FORWARDING", + "DEVCONF_HOPLIMIT", + }; + + print_arr_val(val, idx, idx < ARRAY_SIZE(strs) ? strs[idx] : NULL); +} + +static void +print_inet6_stats_val(uint64_t *val, size_t idx) +{ + static const char * const strs[] = { + "IPSTATS_MIB_NUM", + "IPSTATS_MIB_INPKTS", + }; + + print_arr_uval(val, idx, idx < ARRAY_SIZE(strs) ? strs[idx] : NULL); +} + +static void +print_icmp6_stats_val(uint64_t *val, size_t idx) +{ + static const char * const strs[] = { + "ICMP6_MIB_NUM", + "ICMP6_MIB_INMSGS", + "ICMP6_MIB_INERRORS", + "ICMP6_MIB_OUTMSGS", + "ICMP6_MIB_OUTERRORS", + "ICMP6_MIB_CSUMERRORS", + "6 /* ICMP6_MIB_??? */", + }; + + print_arr_uval(val, idx, idx < ARRAY_SIZE(strs) ? strs[idx] : NULL); +} + +int +main(void) +{ + static const uint8_t unknown_msg[] = { 0xab, 0xac, 0xdb, 0xcd }; + + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + + const unsigned int hdrlen = sizeof(struct ifinfomsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), 3 * NLA_HDRLEN + 256); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + + /* unknown AF_* */ + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + AF_UNIX, pattern, unknown_msg, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + /* AF_INET */ + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET_msg, print_AF_INET_msg, + 0, "IFLA_INET_UNSPEC", pattern, + unknown_msg, print_quoted_hex, 2, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET_msg, print_AF_INET_msg, + 2, "0x2 /* IFLA_INET_??? */", pattern, + unknown_msg, print_quoted_hex, 2, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + /* AF_INET: IFLA_INET_CONF */ + uint32_t inet_conf_vals[] = { 0xdeadc0de, 0xda7aface }; + TEST_NESTED_NLATTR_ARRAY_EX(fd, nlh0, hdrlen, + init_AF_INET_msg, print_AF_INET_msg, + IFLA_INET_CONF, pattern, + inet_conf_vals, 2, print_inet_conf_val); + + /* AF_INET6 */ + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + 0, "IFLA_INET6_UNSPEC", pattern, + unknown_msg, print_quoted_hex, 2, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + 9, "0x9 /* IFLA_INET6_??? */", pattern, + unknown_msg, print_quoted_hex, 2, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + /* AF_INET6: IFLA_INET6_FLAGS */ + static const struct { + uint32_t flags; + const char *str; + } inet6_flags[] = { + { 0xf, "0xf /* IF_??? */" }, + { 0x10, "IF_RS_SENT" }, + { 0xc0, "IF_RA_MANAGED|IF_RA_OTHERCONF" }, + { 0xdeadc0de, "IF_RS_SENT|IF_RA_MANAGED|IF_RA_OTHERCONF" + "|IF_READY|0x5eadc00e" }, + }; + + for (size_t i = 0; i < ARRAY_SIZE(inet6_flags); i++) { + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET6_msg, + print_AF_INET6_msg, + 1, "IFLA_INET6_FLAGS", pattern, + inet6_flags[i].flags, + print_quoted_hex, 2, + printf("%s", inet6_flags[i].str)); + } + + /* AF_INET6: IFLA_INET6_CONF */ + uint32_t inet6_conf_vals[] = { 0xdeadc0de, 0xda7aface }; + TEST_NESTED_NLATTR_ARRAY_EX(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + IFLA_INET6_CONF, pattern, + inet6_conf_vals, 2, print_inet6_conf_val); + + /* AF_INET6: IFLA_INET6_STATS */ + uint64_t inet6_stats_vals[] = { 0xdeadc0deda7aface, 0xdec0deedbadc0ded }; + TEST_NESTED_NLATTR_ARRAY_EX(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + IFLA_INET6_STATS, pattern, + inet6_stats_vals, 2, print_inet6_stats_val); + + /* AF_INET6: IFLA_INET6_MCAST */ + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + 4, "IFLA_INET6_MCAST", pattern, + unknown_msg, print_quoted_hex, 2, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + /* AF_INET6: IFLA_INET6_CACHEINFO */ + static const struct ifla_cacheinfo ci = { + 0xbadc0ded, 0xfacebeef, 0xdecafeed, 0xdeadfeed, + }; + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + 5, "IFLA_INET6_CACHEINFO", pattern, + ci, print_quoted_hex, 2, + PRINT_FIELD_U("{", ci, max_reasm_len); + PRINT_FIELD_U(", ", ci, tstamp); + PRINT_FIELD_U(", ", ci, reachable_time); + PRINT_FIELD_U(", ", ci, retrans_time); + printf("}")); + + /* AF_INET6: IFLA_INET6_ICMP6STATS */ + uint64_t icmp6_stats_vals[] = { + 0xdeadc0deda7aface, 0xdec0deedbadc0ded, 0xfacebeefdeadfeed, + 0xdeadc0deda7afacd, 0xdec0deedbadc0dee, 0xfacebeefdeadfeef, + 0xdeadc0deda7afacc + }; + TEST_NESTED_NLATTR_ARRAY_EX(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + IFLA_INET6_ICMP6STATS, pattern, + icmp6_stats_vals, 2, print_icmp6_stats_val); + + /* AF_INET6: IFLA_INET6_TOKEN */ + uint8_t inet6_addr[16] = { + 0xba, 0xdc, 0x0d, 0xed, 0xfa, 0xce, 0xbe, 0xef, + 0xde, 0xca, 0xfe, 0xed, 0xde, 0xad, 0xfe, 0xed, + }; + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + 7, "IFLA_INET6_TOKEN", pattern, + inet6_addr, print_quoted_hex, 2, + printf("inet_pton(AF_INET6" + ", \"badc:ded:face:beef" + ":deca:feed:dead:feed\")")); + + /* AF_INET6: IFLA_INET6_ */ + static const struct { + uint8_t flags; + const char *str; + } agms[] = { + { 0x0, "IN6_ADDR_GEN_MODE_EUI64" }, + { 0x3, "IN6_ADDR_GEN_MODE_RANDOM" }, + { 0x4, "0x4 /* IN6_ADDR_GEN_MODE_??? */" }, + { 0xff, "0xff /* IN6_ADDR_GEN_MODE_??? */" }, + }; + + for (size_t i = 0; i < ARRAY_SIZE(agms); i++) { + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET6_msg, + print_AF_INET6_msg, + 8, "IFLA_INET6_ADDR_GEN_MODE", + pattern, agms[i].flags, + print_quoted_hex, 2, + printf("%s", agms[i].str)); + } + + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/nlattr_ifla_af_spec.gen.test b/tests-mx32/nlattr_ifla_af_spec.gen.test new file mode 100755 index 00000000..601eeb22 --- /dev/null +++ b/tests-mx32/nlattr_ifla_af_spec.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifla_af_spec +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_ifla_brport.c b/tests-mx32/nlattr_ifla_brport.c new file mode 100644 index 00000000..f8ef1caf --- /dev/null +++ b/tests-mx32/nlattr_ifla_brport.c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include "test_nlattr.h" +#include +#include +#ifdef HAVE_LINUX_IF_LINK_H +# include +#endif +#include + +#if !HAVE_DECL_IFLA_PROTINFO +enum { IFLA_PROTINFO = 12 }; +#endif + +#define IFLA_BRPORT_PRIORITY 2 +#define IFLA_BRPORT_MESSAGE_AGE_TIMER 21 + +#define IFLA_ATTR IFLA_PROTINFO +#include "nlattr_ifla.h" + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const uint16_t u16 = 0xabcd; + const uint64_t u64 = 0xabcdedeeefeafeab; + const int fd = create_nl_socket(NETLINK_ROUTE); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN * 2 + sizeof(u64)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_BRPORT_PRIORITY, pattern, u16, + printf("%u", u16)); + + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_BRPORT_MESSAGE_AGE_TIMER, pattern, u64, + printf("%" PRIu64, u64)); + +#ifdef HAVE_STRUCT_IFLA_BRIDGE_ID + static const struct ifla_bridge_id id = { + .prio = { 0xab, 0xcd }, + .addr = { 0xab, 0xcd, 0xef, 0xac, 0xbc, 0xcd } + }; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_BRPORT_ROOT_ID, pattern, id, + printf("{prio=[%u, %u]" + ", addr=%02x:%02x:%02x:%02x:%02x:%02x}", + id.prio[0], id.prio[1], + id.addr[0], id.addr[1], id.addr[2], + id.addr[3], id.addr[4], id.addr[5])); +#endif + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/nlattr_ifla_brport.gen.test b/tests-mx32/nlattr_ifla_brport.gen.test new file mode 100755 index 00000000..6758d8d1 --- /dev/null +++ b/tests-mx32/nlattr_ifla_brport.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifla_brport +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_ifla_linkinfo.c b/tests-mx32/nlattr_ifla_linkinfo.c new file mode 100644 index 00000000..080e7371 --- /dev/null +++ b/tests-mx32/nlattr_ifla_linkinfo.c @@ -0,0 +1,692 @@ +/* + * IFLA_LINKINFO netlink attribute decoding check. + * + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include + +#include "test_nlattr.h" + +#include +#include +#ifdef HAVE_LINUX_IF_LINK_H +# include +#endif +#include + +#define XLAT_MACROS_ONLY +#include +#include +#undef XLAT_MACROS_ONLY + +#define IFLA_ATTR IFLA_LINKINFO +#include "nlattr_ifla.h" + +#define COMMA , +#define TEST_UNKNOWN_TUNNELS(fd_, nlh0_, objtype_, objtype_str_, \ + obj_, objsz_, arrstrs_, ...) \ + do { \ + /* 64 is guestimate for maximum unknown type len */ \ + char buf[8 * 2 + 64 + objsz_]; \ + const char **arrstrs[] = arrstrs_; \ + const char ***arrstrs_pos = arrstrs; \ + const char **arrstr = *arrstrs_pos; \ + const char *type = NULL; \ + \ + for (type = arrstr ? arrstr[0] : NULL; type && arrstr; \ + type = (++arrstr)[0] ? arrstr[0] \ + : (++arrstrs_pos)[0] \ + ? (arrstr = arrstrs_pos[0])[0] \ + : NULL) \ + { \ + size_t type_len = strlen(type) + 1; \ + \ + if (type_len > 64) \ + error_msg_and_fail("Unexpectedly long " \ + "unknown type: \"%s\" " \ + "(length is %zu)", \ + type, type_len); \ + \ + struct nlattr obj_nla = { \ + .nla_len = NLA_HDRLEN + (objsz_), \ + .nla_type = (objtype_), \ + }; \ + \ + char *pos = buf; \ + memcpy(pos, type, type_len); \ + pos += NLA_ALIGN(type_len); \ + memcpy(pos, &obj_nla, sizeof(obj_nla)); \ + pos += sizeof(obj_nla); \ + memcpy(pos, (obj_), (objsz_)); \ + \ + TEST_NLATTR_EX_((fd_), \ + (nlh0_) - hdrlen - (pos - buf), \ + hdrlen + NLA_HDRLEN, \ + init_ifinfomsg, print_ifinfomsg, \ + IFLA_INFO_KIND, "IFLA_INFO_KIND", \ + type_len, objsz_ + (pos - buf), \ + buf, objsz_ + (pos - buf), \ + printf("\"%s\"}", type); \ + printf(", {{nla_len=%zu" \ + ", nla_type=%s}, ", \ + (objsz_) + NLA_HDRLEN, \ + (objtype_str_)); \ + \ + { __VA_ARGS__; } \ + \ + printf("}")); \ + } \ + } while (0) + +#define TEST_LINKINFO_(fd_, nlh0_, nla_type_, nla_type_str_, tuntype_, \ + obj_, objsz_, pattern_, fallback_func_, ...) \ + do { \ + size_t tuntype_len = strlen(tuntype_) + 1; \ + char *buf = tail_alloc(NLA_ALIGN(tuntype_len) \ + + NLA_HDRLEN + (objsz_)); \ + char *pos = buf; \ + \ + struct nlattr obj_nla = { \ + .nla_len = NLA_HDRLEN + (objsz_), \ + .nla_type = (nla_type_), \ + }; \ + \ + memcpy(pos, (tuntype_), tuntype_len); \ + pos += NLA_ALIGN(tuntype_len); \ + memcpy(pos, &obj_nla, sizeof(obj_nla)); \ + pos += sizeof(obj_nla); \ + memcpy(pos, &(obj_), (objsz_)); \ + \ + if (fallback_func_ == print_quoted_hex) { \ + TEST_NLATTR_EX_((fd_), \ + (nlh0_) - NLA_HDRLEN, \ + hdrlen + NLA_HDRLEN, \ + init_ifinfomsg, print_ifinfomsg, \ + IFLA_INFO_KIND, "IFLA_INFO_KIND", \ + tuntype_len, \ + objsz_ + (pos - buf) - 1, \ + buf, objsz_ + (pos - buf) - 1, \ + printf("\"%s\"}", (tuntype_)); \ + printf(", {{nla_len=%zu" \ + ", nla_type=%s}, ", \ + (objsz_) + NLA_HDRLEN, \ + (nla_type_str_)); \ + (fallback_func_)((obj_), \ + (objsz_) - 1); \ + printf("}")); \ + } \ + \ + TEST_NLATTR_EX_((fd_), (nlh0_) - NLA_HDRLEN, \ + hdrlen + NLA_HDRLEN, \ + init_ifinfomsg, print_ifinfomsg, \ + IFLA_INFO_KIND, "IFLA_INFO_KIND", \ + tuntype_len, objsz_ + (pos - buf), \ + buf, objsz_ + (pos - buf) - 1, \ + printf("\"%s\"}", (tuntype_)); \ + printf(", {{nla_len=%zu, nla_type=%s}, ", \ + (objsz_) + NLA_HDRLEN, \ + (nla_type_str_)); \ + printf("%p}", \ + RTA_DATA(NLMSG_ATTR(nlh, \ + (hdrlen + NLA_HDRLEN + (pos - buf)))) \ + ) \ + ); \ + \ + TEST_NLATTR_EX_((fd_), (nlh0_) - NLA_HDRLEN, \ + hdrlen + NLA_HDRLEN, \ + init_ifinfomsg, print_ifinfomsg, \ + IFLA_INFO_KIND, "IFLA_INFO_KIND", \ + tuntype_len, objsz_ + (pos - buf), \ + buf, objsz_ + (pos - buf), \ + printf("\"%s\"}", (tuntype_)); \ + printf(", {{nla_len=%zu, nla_type=%s}, ", \ + (objsz_) + NLA_HDRLEN, \ + (nla_type_str_)); \ + \ + { __VA_ARGS__; } \ + \ + printf("}")); \ + } while (0) + +#define TEST_LINKINFO(fd_, nlh0_, nla_type_, tuntype_, \ + obj_, pattern_, fallback_func_, ...) \ + TEST_LINKINFO_((fd_), (nlh0_), nla_type_, #nla_type_, (tuntype_), \ + (obj_), sizeof(obj_), pattern_, fallback_func_, \ + __VA_ARGS__) + +#define TEST_NESTED_LINKINFO(fd_, nlh0_, \ + nla_type_, nla_type_str_, tuntype_, \ + subnla_type_, subnla_type_str_, \ + obj_, pattern_, ...) \ + do { \ + size_t tuntype_len = strlen(tuntype_) + 1; \ + struct { \ + size_t sz; \ + const char *str; \ + } attrs[] = { __VA_ARGS__ }; \ + size_t tunhdrlen; \ + size_t buflen = NLA_ALIGN(tuntype_len) + NLA_HDRLEN; \ + size_t attrsz = 0; \ + \ + for (size_t i = 0; i < ARRAY_SIZE(attrs); i++) \ + attrsz += NLA_HDRLEN + NLA_ALIGN(attrs[i].sz); \ + \ + buflen += attrsz; \ + \ + char *buf = tail_alloc(buflen); \ + char *pos = buf; \ + \ + struct nlattr nla = { \ + .nla_len = NLA_HDRLEN + attrsz, \ + .nla_type = (nla_type_), \ + }; \ + \ + memcpy(pos, (tuntype_), tuntype_len); \ + pos += NLA_ALIGN(tuntype_len); \ + memcpy(pos, &nla, sizeof(nla)); \ + pos += sizeof(nla); \ + \ + tunhdrlen = pos - buf; \ + \ + nla.nla_type = subnla_type_; \ + \ + for (size_t i = 0; i < ARRAY_SIZE(attrs); i++) { \ + nla.nla_len = NLA_HDRLEN + attrs[i].sz; \ + memcpy(pos, &nla, sizeof(nla)); \ + pos += sizeof(nla); \ + \ + memcpy(pos, &(obj_), MIN(sizeof(obj_), attrs[i].sz)); \ + \ + if (attrs[i].sz > sizeof(obj_)) \ + memcpy(pos + sizeof(obj_), \ + &(pattern_), \ + attrs[i].sz - sizeof(obj_)); \ + \ + pos += NLA_ALIGN(attrs[i].sz); \ + } \ + \ + TEST_NLATTR_EX_((fd_), (nlh0_) - hdrlen - tunhdrlen, \ + hdrlen + NLA_HDRLEN, \ + init_ifinfomsg, print_ifinfomsg, \ + IFLA_INFO_KIND, "IFLA_INFO_KIND", \ + tuntype_len, buflen, \ + buf, buflen, \ + printf("\"%s\"}", (tuntype_)); \ + printf(", {{nla_len=%zu, nla_type=%s}, [", \ + attrsz + NLA_HDRLEN, \ + (nla_type_str_)); \ + \ + for (size_t i = 0; i < ARRAY_SIZE(attrs); i++) \ + printf("%s%s{nla_len=%zu" \ + ", nla_type=%s}%s%s%s", \ + i ? ", " : "", \ + attrs[i].str ? "{": "", \ + attrs[i].sz + NLA_HDRLEN, \ + subnla_type_str_, \ + attrs[i].str ? ", ": "", \ + attrs[i].str ?: "", \ + attrs[i].str ? "}" : ""); \ + \ + printf("]}")); \ + } while (0) + +int +main(void) +{ + static const uint8_t unknown_msg[] = { 0xab, 0xac, 0xdb, 0xcd }; + static const char *unsupported_tunnel_types[] = { + "batadv", "bond", + "caif", "cfhsi", + "dummy", + "erspan", + "geneve", "gre", "gretap", "gtp", + "hsr", + "ifb", "ip6erspan", "ip6gre", "ip6gretap", "ip6tnl", + "ipip", "ipoib", "ipvlan", "ipvtap", + "lowpan", + "macsec", "macvlan", "macvtap", + "netdevsim", "nlmon", + "openvswitch", + "ppp", + "rmnet", + "sit", + "team", + "vcan", "veth", "vlan", "vrf", "vsockmon", + "vti", "vti6", "vxcan", "vxlan", + NULL + }; + static const char *unsupported_xstats_types[] = { + "bridge", + "tun", + NULL + }; + static const char *unsupported_data_types[] = { + "can", + NULL + }; + + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + + const unsigned int hdrlen = sizeof(struct ifinfomsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), 2 * NLA_HDRLEN + 256); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + + /* unknown AF_INFO_* type */ + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_INFO_UNSPEC, pattern, unknown_msg, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + 6, "0x6 /* IFLA_INFO_??? */", pattern, + unknown_msg, print_quoted_hex, 1, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + + /* IFLA_INFO_KIND */ + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_INFO_KIND, "IFLA_INFO_KIND", pattern, + unknown_msg, print_quoted_stringn, 1, + printf("\"\\253\\254\\333\\315\"...")); + + + /* IFLA_INFO_KIND + IFLA_INFO_UNSPEC */ + TEST_UNKNOWN_TUNNELS(fd, nlh0, IFLA_INFO_UNSPEC, "IFLA_INFO_UNSPEC", + unknown_msg, sizeof(unknown_msg), + {unsupported_tunnel_types COMMA + unsupported_xstats_types COMMA + unsupported_data_types COMMA + NULL}, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + + /* IFLA_INFO_KIND + IFLA_INFO_KIND */ + TEST_UNKNOWN_TUNNELS(fd, nlh0, IFLA_INFO_KIND, "IFLA_INFO_KIND", + unknown_msg, sizeof(unknown_msg), + {unsupported_tunnel_types COMMA + unsupported_xstats_types COMMA + unsupported_data_types COMMA + NULL}, + printf("\"\\253\\254\\333\\315\"...")); + + + /* IFLA_INFO_KIND + IFLA_INFO_DATA */ + TEST_UNKNOWN_TUNNELS(fd, nlh0, IFLA_INFO_DATA, "IFLA_INFO_DATA", + unknown_msg, sizeof(unknown_msg), + {unsupported_tunnel_types COMMA + unsupported_data_types COMMA + NULL}, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + struct val_name { + unsigned int val; + const char *name; + }; + + static const uint64_t u64_val = 0xdeadc0defacefeedULL; + static const uint32_t u32_val = 0xbadc0dedU; + static const uint16_t u16_val = 0xdeed; + static const uint8_t u8_val = 0xa1; + + /* bridge attrs */ + static const struct val_name und_br_attrs[] = { + { 0, "IFLA_BR_UNSPEC" }, + { 20, "IFLA_BR_GROUP_ADDR" }, + { 21, "IFLA_BR_FDB_FLUSH" }, + { 40, "IFLA_BR_PAD" }, + { 47, "0x2f /* IFLA_BR_??? */" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(und_br_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + und_br_attrs[k].val, und_br_attrs[k].name, + unknown_msg, pattern, + { 2, "\"\\xab\\xac\"" }, + { 4, "\"\\xab\\xac\\xdb\\xcd\"" }, + { 6, + "\"\\xab\\xac\\xdb\\xcd\\x61\\x62\"" }, + { 8, "\"\\xab\\xac\\xdb\\xcd\\x61\\x62" + "\\x63\\x64\"" }, + { 10, "\"\\xab\\xac\\xdb\\xcd\\x61\\x62" + "\\x63\\x64\\x65\\x66\"" }); + } + + static const struct val_name u64_br_attrs[] = { + { 16, "IFLA_BR_HELLO_TIMER" }, + { 17, "IFLA_BR_TCN_TIMER" }, + { 18, "IFLA_BR_TOPOLOGY_CHANGE_TIMER" }, + { 19, "IFLA_BR_GC_TIMER" }, + { 30, "IFLA_BR_MCAST_LAST_MEMBER_INTVL" }, + { 31, "IFLA_BR_MCAST_MEMBERSHIP_INTVL" }, + { 32, "IFLA_BR_MCAST_QUERIER_INTVL" }, + { 33, "IFLA_BR_MCAST_QUERY_INTVL" }, + { 34, "IFLA_BR_MCAST_QUERY_RESPONSE_INTVL" }, + { 35, "IFLA_BR_MCAST_STARTUP_QUERY_INTVL" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(u64_br_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + u64_br_attrs[k].val, u64_br_attrs[k].name, + u64_val, pattern, + { 7, "\"" +#if WORDS_BIGENDIAN + "\\xde\\xad\\xc0\\xde\\xfa\\xce\\xfe" +#else + "\\xed\\xfe\\xce\\xfa\\xde\\xc0\\xad" +#endif + "\"" }, + { 8, "16045693111314087661" }, + { 9, "16045693111314087661" }); + } + + static const struct val_name u32_br_attrs[] = { + { 1, "IFLA_BR_FORWARD_DELAY" }, + { 2, "IFLA_BR_HELLO_TIME" }, + { 3, "IFLA_BR_MAX_AGE" }, + { 4, "IFLA_BR_AGEING_TIME" }, + { 5, "IFLA_BR_STP_STATE" }, + { 13, "IFLA_BR_ROOT_PATH_COST" }, + { 26, "IFLA_BR_MCAST_HASH_ELASTICITY" }, + { 27, "IFLA_BR_MCAST_HASH_MAX" }, + { 28, "IFLA_BR_MCAST_LAST_MEMBER_CNT" }, + { 29, "IFLA_BR_MCAST_STARTUP_QUERY_CNT" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(u32_br_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + u32_br_attrs[k].val, u32_br_attrs[k].name, + u32_val, pattern, + { 3, "\"" +#if WORDS_BIGENDIAN + "\\xba\\xdc\\x0d" +#else + "\\xed\\x0d\\xdc" +#endif + "\"" }, + { 4, "3134983661" }, + { 5, "3134983661" }); + } + + static const struct val_name u16_br_attrs[] = { + { 6, "IFLA_BR_PRIORITY" }, + { 12, "IFLA_BR_ROOT_PORT" }, + { 39, "IFLA_BR_VLAN_DEFAULT_PVID" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(u16_br_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + u16_br_attrs[k].val, u16_br_attrs[k].name, + u16_val, pattern, + { 1, "\"" +#if WORDS_BIGENDIAN + "\\xde" +#else + "\\xed" +#endif + "\"" }, + { 2, "57069" }, + { 3, "57069" }); + } + + + static const struct val_name x16_br_attrs[] = { + { 9, "IFLA_BR_GROUP_FWD_MASK" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(x16_br_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + x16_br_attrs[k].val, x16_br_attrs[k].name, + u16_val, pattern, + { 1, "\"" +#if WORDS_BIGENDIAN + "\\xde" +#else + "\\xed" +#endif + "\"" }, + { 2, "0xdeed" }, + { 3, "0xdeed" }); + } + + static const struct val_name u8_br_attrs[] = { + { 7, "IFLA_BR_VLAN_FILTERING" }, + { 14, "IFLA_BR_TOPOLOGY_CHANGE" }, + { 15, "IFLA_BR_TOPOLOGY_CHANGE_DETECTED" }, + { 22, "IFLA_BR_MCAST_ROUTER" }, + { 23, "IFLA_BR_MCAST_SNOOPING" }, + { 24, "IFLA_BR_MCAST_QUERY_USE_IFADDR" }, + { 25, "IFLA_BR_MCAST_QUERIER" }, + { 36, "IFLA_BR_NF_CALL_IPTABLES" }, + { 37, "IFLA_BR_NF_CALL_IP6TABLES" }, + { 38, "IFLA_BR_NF_CALL_ARPTABLES" }, + { 41, "IFLA_BR_VLAN_STATS_ENABLED" }, + { 42, "IFLA_BR_MCAST_STATS_ENABLED" }, + { 43, "IFLA_BR_MCAST_IGMP_VERSION" }, + { 44, "IFLA_BR_MCAST_MLD_VERSION" }, + { 45, "IFLA_BR_VLAN_STATS_PER_PORT" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(u8_br_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + u8_br_attrs[k].val, u8_br_attrs[k].name, + u8_val, pattern, + { 0, NULL }, + { 1, "161" }, + { 2, "161" }); + } + + unsigned short eth_p = htons(0x88C7); + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + 8, "IFLA_BR_VLAN_PROTOCOL", + eth_p, pattern, + { 1, "\"\\x88\"" }, + { 2, "htons(ETH_P_PREAUTH)" }, + { 2, "htons(ETH_P_PREAUTH)" }); + + static const uint8_t bridge_id[] + = { 0xbe, 0xef, 0xfa, 0xce, 0xde, 0xc0, 0xde, 0xad }; + static const struct val_name br_id_attrs[] = { + { 10, "IFLA_BR_ROOT_ID" }, + { 11, "IFLA_BR_BRIDGE_ID" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(br_id_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + br_id_attrs[k].val, br_id_attrs[k].name, + bridge_id, pattern, + { 7, "\"\\xbe\\xef\\xfa\\xce" + "\\xde\\xc0\\xde\"" }, + { 8, "{prio=[190, 239]" + ", addr=fa:ce:de:c0:de:ad}" }, + { 9, "{prio=[190, 239]" + ", addr=fa:ce:de:c0:de:ad}" }); + } + + /* tun attrs */ + static const struct val_name u8_tun_attrs[] = { + { 4, "IFLA_TUN_PI" }, + { 5, "IFLA_TUN_VNET_HDR" }, + { 6, "IFLA_TUN_PERSIST" }, + { 7, "IFLA_TUN_MULTI_QUEUE" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(u8_tun_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "tun", + u8_tun_attrs[k].val, u8_tun_attrs[k].name, + u8_val, pattern, + { 0, NULL }, + { 1, "161" }, + { 2, "161" }); + } + + static const struct val_name u32_tun_attrs[] = { + { 8, "IFLA_TUN_NUM_QUEUES" }, + { 9, "IFLA_TUN_NUM_DISABLED_QUEUES" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(u32_tun_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "tun", + u32_tun_attrs[k].val, + u32_tun_attrs[k].name, + u32_val, pattern, + { 3, "\"" +#if WORDS_BIGENDIAN + "\\xba\\xdc\\x0d" +#else + "\\xed\\x0d\\xdc" +#endif + "\"" }, + { 4, "3134983661" }, + { 5, "3134983661" }); + } + + static const struct val_name und_tun_attrs[] = { + { 0, "IFLA_TUN_UNSPEC" }, + { 10, "0xa /* IFLA_TUN_??? */" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(und_tun_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "tun", + und_tun_attrs[k].val, + und_tun_attrs[k].name, + unknown_msg, pattern, + { 2, "\"\\xab\\xac\"" }, + { 4, "\"\\xab\\xac\\xdb\\xcd\"" }, + { 6, + "\"\\xab\\xac\\xdb\\xcd\\x61\\x62\"" }, + { 8, "\"\\xab\\xac\\xdb\\xcd\\x61\\x62" + "\\x63\\x64\"" }, + { 10, "\"\\xab\\xac\\xdb\\xcd\\x61\\x62" + "\\x63\\x64\\x65\\x66\"" }); + } + + static const uint32_t minus_one = 0xffffffffU; + static const struct val_name uid_tun_attrs[] = { + { 1, "IFLA_TUN_OWNER" }, + { 2, "IFLA_TUN_GROUP" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(uid_tun_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "tun", + uid_tun_attrs[k].val, + uid_tun_attrs[k].name, + u32_val, pattern, + { 3, "\"" +#if WORDS_BIGENDIAN + "\\xba\\xdc\\x0d" +#else + "\\xed\\x0d\\xdc" +#endif + "\"" }, + { 4, "3134983661" }, + { 5, "3134983661" }); + + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "tun", + uid_tun_attrs[k].val, + uid_tun_attrs[k].name, + minus_one, pattern, + { 3, "\"\\xff\\xff\\xff\"" }, + { 4, "-1" }, + { 5, "-1" }); + } + + static const struct { + uint8_t val; + const char *str; + } tun_types[] = { + { 0, "0 /* IFF_??? */"}, + { 1, "IFF_TUN"}, + { 2, "IFF_TAP"}, + { 3, "0x3 /* IFF_??? */"}, + { 0xda, "0xda /* IFF_??? */"}, + }; + + for (size_t k = 0; k < ARRAY_SIZE(tun_types); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "tun", + 3, "IFLA_TUN_TYPE", + tun_types[k].val, pattern, + { 0, NULL }, + { 1, tun_types[k].str }, + { 2, tun_types[k].str }); + } + + + /* IFLA_INFO_KIND + IFLA_INFO_XSTATS */ + TEST_UNKNOWN_TUNNELS(fd, nlh0, IFLA_INFO_XSTATS, "IFLA_INFO_XSTATS", + unknown_msg, sizeof(unknown_msg), + {unsupported_tunnel_types COMMA + /* + * can decoder decodes its data only if it's big + * enough. + */ + unsupported_xstats_types COMMA + unsupported_data_types COMMA + NULL}, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + uint32_t can_stats_data[] = { + 0xbadc0de0, 0xbadc0de1, 0xbadc0de2, 0xbadc0de3, + 0xbadc0de4, 0xbadc0de5, + }; + + TEST_LINKINFO(fd, nlh0, IFLA_INFO_XSTATS, "can", + can_stats_data, pattern, print_quoted_hex, + printf("{bus_error=3134983648" + ", error_warning=3134983649" + ", error_passive=3134983650" + ", bus_off=3134983651" + ", arbitration_lost=3134983652" + ", restarts=3134983653}")); + + + /* IFLA_INFO_KIND + IFLA_INFO_SLVAE_KIND */ + TEST_UNKNOWN_TUNNELS(fd, nlh0, + IFLA_INFO_SLAVE_KIND, "IFLA_INFO_SLAVE_KIND", + unknown_msg, sizeof(unknown_msg), + {unsupported_tunnel_types COMMA + unsupported_xstats_types COMMA + unsupported_data_types COMMA + NULL}, + printf("\"\\253\\254\\333\\315\"...")); + + + /* IFLA_INFO_KIND + IFLA_INFO_SLAVE_DATA */ + TEST_UNKNOWN_TUNNELS(fd, nlh0, + IFLA_INFO_SLAVE_DATA, "IFLA_INFO_SLAVE_DATA", + unknown_msg, sizeof(unknown_msg), + {unsupported_tunnel_types COMMA + unsupported_xstats_types COMMA + unsupported_data_types COMMA + NULL}, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + + /* IFLA_INFO_KIND + unknown type */ + TEST_UNKNOWN_TUNNELS(fd, nlh0, 6, "0x6 /* IFLA_INFO_??? */", + unknown_msg, sizeof(unknown_msg), + {unsupported_tunnel_types COMMA + unsupported_xstats_types COMMA + unsupported_data_types COMMA + NULL}, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/nlattr_ifla_linkinfo.gen.test b/tests-mx32/nlattr_ifla_linkinfo.gen.test new file mode 100755 index 00000000..816ba99c --- /dev/null +++ b/tests-mx32/nlattr_ifla_linkinfo.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifla_linkinfo +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_ifla_port.c b/tests-mx32/nlattr_ifla_port.c new file mode 100644 index 00000000..df2a2ef6 --- /dev/null +++ b/tests-mx32/nlattr_ifla_port.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include "test_nlattr.h" +#include +#include +#ifdef HAVE_LINUX_IF_LINK_H +# include +#endif +#include + +#if !HAVE_DECL_IFLA_PORT_SELF +enum { IFLA_PORT_SELF = 25 }; +#endif +#ifndef IFLA_PORT_VF +# define IFLA_PORT_VF 1 +#endif + +#define IFLA_ATTR IFLA_PORT_SELF +#include "nlattr_ifla.h" + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), 2 * NLA_HDRLEN + 8); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const uint32_t num = 0xabacdbcd; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_PORT_VF, pattern, num, + printf("%u", num)); + +#ifdef HAVE_STRUCT_IFLA_PORT_VSI + static const struct ifla_port_vsi vsi = { + .vsi_mgr_id = 0xab, + .vsi_type_id = "abc", + .vsi_type_version = 0xef + }; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_PORT_VSI_TYPE, pattern, vsi, + PRINT_FIELD_U("{", vsi, vsi_mgr_id); + printf(", vsi_type_id=\"\\x61\\x62\\x63\""); + PRINT_FIELD_U(", ", vsi, vsi_type_version); + printf("}")); +#endif + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/nlattr_ifla_port.gen.test b/tests-mx32/nlattr_ifla_port.gen.test new file mode 100755 index 00000000..ecea89a4 --- /dev/null +++ b/tests-mx32/nlattr_ifla_port.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifla_port +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_ifla_xdp.c b/tests-mx32/nlattr_ifla_xdp.c new file mode 100644 index 00000000..232f2145 --- /dev/null +++ b/tests-mx32/nlattr_ifla_xdp.c @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include "test_nlattr.h" +#include +#include +#ifdef HAVE_LINUX_IF_LINK_H +# include +#endif +#include + +#if !HAVE_DECL_IFLA_XDP +enum { IFLA_XDP = 43 }; +#endif +#ifndef IFLA_XDP_FD +# define IFLA_XDP_FD 1 +#endif + +#ifndef IFLA_XDP_ATTACHED +# define IFLA_XDP_ATTACHED 2 +#endif + +#ifndef IFLA_XDP_PROG_ID +# define IFLA_XDP_PROG_ID 4 +#endif + +#ifndef IFLA_XDP_DRV_PROG_ID +# define IFLA_XDP_DRV_PROG_ID 5 +#endif + +#ifndef IFLA_XDP_SKB_PROG_ID +# define IFLA_XDP_SKB_PROG_ID 6 +#endif + +#ifndef IFLA_XDP_HW_PROG_ID +# define IFLA_XDP_HW_PROG_ID 7 +#endif + +#ifndef XDP_ATTACHED_NONE +# define XDP_ATTACHED_NONE 0 +#endif + +#ifndef XDP_ATTACHED_MULTI +# define XDP_ATTACHED_MULTI 4 +#endif + +#define IFLA_ATTR IFLA_XDP +#include "nlattr_ifla.h" + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int32_t num = 0xabacdbcd; + const int fd = create_nl_socket(NETLINK_ROUTE); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(num)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_XDP_FD, pattern, num, + printf("%d", num)); + + static const struct { + uint8_t val; + const char *str; + } attach_types[] = { + { ARG_STR(XDP_ATTACHED_NONE) }, + { ARG_STR(XDP_ATTACHED_MULTI) }, + { ARG_STR(0x5) " /* XDP_ATTACHED_??? */" }, + { ARG_STR(0xfe) " /* XDP_ATTACHED_??? */" }, + }; + + for (size_t i = 0; i < ARRAY_SIZE(attach_types); i++) { + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_XDP_ATTACHED, pattern, + attach_types[i].val, + printf("%s", attach_types[i].str)); + } + +#ifdef XDP_FLAGS_UPDATE_IF_NOEXIST + const uint32_t flags = XDP_FLAGS_UPDATE_IF_NOEXIST; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_XDP_FLAGS, pattern, flags, + printf("XDP_FLAGS_UPDATE_IF_NOEXIST")); +#endif + + static const struct { + uint32_t val; + const char *str; + } attrs[] = { + { ARG_STR(IFLA_XDP_PROG_ID) }, + { ARG_STR(IFLA_XDP_DRV_PROG_ID) }, + { ARG_STR(IFLA_XDP_SKB_PROG_ID) }, + { ARG_STR(IFLA_XDP_HW_PROG_ID) }, + }; + + for (size_t i = 0; i < ARRAY_SIZE(attrs); i++) { + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + attrs[i].val, attrs[i].str, + pattern, num, + print_quoted_hex, 1, + printf("%u", num)); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/nlattr_ifla_xdp.gen.test b/tests-mx32/nlattr_ifla_xdp.gen.test new file mode 100755 index 00000000..c6e0fab3 --- /dev/null +++ b/tests-mx32/nlattr_ifla_xdp.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifla_xdp +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_inet_diag_msg.c b/tests-mx32/nlattr_inet_diag_msg.c new file mode 100644 index 00000000..97f5a95e --- /dev/null +++ b/tests-mx32/nlattr_inet_diag_msg.c @@ -0,0 +1,205 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include "test_nlattr.h" +#include +#include + +static const char * const sk_meminfo_strs[] = { + "SK_MEMINFO_RMEM_ALLOC", + "SK_MEMINFO_RCVBUF", + "SK_MEMINFO_WMEM_ALLOC", + "SK_MEMINFO_SNDBUF", + "SK_MEMINFO_FWD_ALLOC", + "SK_MEMINFO_WMEM_QUEUED", + "SK_MEMINFO_OPTMEM", + "SK_MEMINFO_BACKLOG", + "SK_MEMINFO_DROPS", +}; + +static const char address[] = "10.11.12.13"; + +static void +init_inet_diag_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP + ); + + struct inet_diag_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct inet_diag_msg, msg, + .idiag_family = AF_INET, + .idiag_state = TCP_LISTEN, + .id.idiag_if = ifindex_lo() + ); + + if (!inet_pton(AF_INET, address, msg->id.idiag_src) || + !inet_pton(AF_INET, address, msg->id.idiag_dst)) + perror_msg_and_skip("inet_pton"); +} + +static void +print_inet_diag_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {idiag_family=AF_INET" + ", idiag_state=TCP_LISTEN, idiag_timer=0, idiag_retrans=0" + ", id={idiag_sport=htons(0), idiag_dport=htons(0)" + ", idiag_src=inet_addr(\"%s\")" + ", idiag_dst=inet_addr(\"%s\")" + ", idiag_if=" IFINDEX_LO_STR + ", idiag_cookie=[0, 0]}" + ", idiag_expires=0, idiag_rqueue=0, idiag_wqueue=0" + ", idiag_uid=0, idiag_inode=0}", + msg_len, address, address); +} + +static void +print_uint(const unsigned int *p, size_t i) +{ + if (i >= ARRAY_SIZE(sk_meminfo_strs)) + printf("[%zu /* SK_MEMINFO_??? */", i); + else + printf("[%s", sk_meminfo_strs[i]); + + printf("] = %u", *p); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + static const struct inet_diag_meminfo minfo = { + .idiag_rmem = 0xfadcacdb, + .idiag_wmem = 0xbdabcada, + .idiag_fmem = 0xbadbfafb, + .idiag_tmem = 0xfdacdadf + }; + static const struct tcpvegas_info vegas = { + .tcpv_enabled = 0xfadcacdb, + .tcpv_rttcnt = 0xbdabcada, + .tcpv_rtt = 0xbadbfafb, + .tcpv_minrtt = 0xfdacdadf + }; + static const struct tcp_dctcp_info dctcp = { + .dctcp_enabled = 0xfdac, + .dctcp_ce_state = 0xfadc, + .dctcp_alpha = 0xbdabcada, + .dctcp_ab_ecn = 0xbadbfafb, + .dctcp_ab_tot = 0xfdacdadf + }; + static const struct tcp_bbr_info bbr = { + .bbr_bw_lo = 0xfdacdadf, + .bbr_bw_hi = 0xfadcacdb, + .bbr_min_rtt = 0xbdabcada, + .bbr_pacing_gain = 0xbadbfafb, + .bbr_cwnd_gain = 0xfdacdadf + }; + static const uint32_t mem[] = { 0xaffacbad, 0xffadbcab }; + static uint32_t bigmem[SK_MEMINFO_VARS + 1]; + static const uint32_t mark = 0xabdfadca; + static const uint8_t shutdown = 0xcd; + + const int fd = create_nl_socket(NETLINK_SOCK_DIAG); + const unsigned int hdrlen = sizeof(struct inet_diag_msg); + void *const nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + + MAX(sizeof(bigmem), DEFAULT_STRLEN)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_MEMINFO, pattern, minfo, + PRINT_FIELD_U("{", minfo, idiag_rmem); + PRINT_FIELD_U(", ", minfo, idiag_wmem); + PRINT_FIELD_U(", ", minfo, idiag_fmem); + PRINT_FIELD_U(", ", minfo, idiag_tmem); + printf("}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_VEGASINFO, pattern, vegas, + PRINT_FIELD_U("{", vegas, tcpv_enabled); + PRINT_FIELD_U(", ", vegas, tcpv_rttcnt); + PRINT_FIELD_U(", ", vegas, tcpv_rtt); + PRINT_FIELD_U(", ", vegas, tcpv_minrtt); + printf("}")); + + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_DCTCPINFO, pattern, dctcp, + PRINT_FIELD_U("{", dctcp, dctcp_enabled); + PRINT_FIELD_U(", ", dctcp, dctcp_ce_state); + PRINT_FIELD_U(", ", dctcp, dctcp_alpha); + PRINT_FIELD_U(", ", dctcp, dctcp_ab_ecn); + PRINT_FIELD_U(", ", dctcp, dctcp_ab_tot); + printf("}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_BBRINFO, pattern, bbr, + PRINT_FIELD_X("{", bbr, bbr_bw_lo); + PRINT_FIELD_X(", ", bbr, bbr_bw_hi); + PRINT_FIELD_U(", ", bbr, bbr_min_rtt); + PRINT_FIELD_U(", ", bbr, bbr_pacing_gain); + PRINT_FIELD_U(", ", bbr, bbr_cwnd_gain); + printf("}")); + + TEST_NLATTR_ARRAY(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_SKMEMINFO, pattern, mem, print_uint); + + memcpy(bigmem, pattern, sizeof(bigmem)); + + TEST_NLATTR_ARRAY(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_SKMEMINFO, pattern, bigmem, print_uint); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_MARK, pattern, mark, + printf("%u", mark)); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_CLASS_ID, pattern, mark, + printf("%u", mark)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, INET_DIAG_SHUTDOWN, + sizeof(shutdown), &shutdown, sizeof(shutdown), + printf("%u", shutdown)); + + char *const str = tail_alloc(DEFAULT_STRLEN); + fill_memory_ex(str, DEFAULT_STRLEN, '0', 10); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, INET_DIAG_CONG, + DEFAULT_STRLEN, str, DEFAULT_STRLEN, + printf("\"%.*s\"...", DEFAULT_STRLEN, str)); + str[DEFAULT_STRLEN - 1] = '\0'; + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, INET_DIAG_CONG, + DEFAULT_STRLEN, str, DEFAULT_STRLEN, + printf("\"%s\"", str)); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/nlattr_inet_diag_msg.gen.test b/tests-mx32/nlattr_inet_diag_msg.gen.test new file mode 100755 index 00000000..953a23df --- /dev/null +++ b/tests-mx32/nlattr_inet_diag_msg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_inet_diag_msg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_inet_diag_req_compat.c b/tests-mx32/nlattr_inet_diag_req_compat.c new file mode 100644 index 00000000..8cce46cd --- /dev/null +++ b/tests-mx32/nlattr_inet_diag_req_compat.c @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include "test_nlattr.h" +#include +#include +#include + +static const char address[] = "10.11.12.13"; + +static void +init_inet_diag_req(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = TCPDIAG_GETSOCK, + .nlmsg_flags = NLM_F_REQUEST + ); + + struct inet_diag_req *const req = NLMSG_DATA(nlh); + SET_STRUCT(struct inet_diag_req, req, + .idiag_family = AF_INET, + .idiag_ext = 1 << (INET_DIAG_TOS - 1), + .idiag_states = 1 << TCP_LAST_ACK, + .id.idiag_if = ifindex_lo() + ); + + if (!inet_pton(AF_INET, address, req->id.idiag_src) || + !inet_pton(AF_INET, address, req->id.idiag_dst)) + perror_msg_and_skip("inet_pton"); +} + +static void +print_inet_diag_req(const unsigned int msg_len) +{ + printf("{len=%u, type=TCPDIAG_GETSOCK, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, {idiag_family=AF_INET" + ", idiag_src_len=0, idiag_dst_len=0" + ", idiag_ext=1<<(INET_DIAG_TOS-1)" + ", id={idiag_sport=htons(0), idiag_dport=htons(0)" + ", idiag_src=inet_addr(\"%s\")" + ", idiag_dst=inet_addr(\"%s\")" + ", idiag_if=" IFINDEX_LO_STR + ", idiag_cookie=[0, 0]}" + ", idiag_states=1< + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include "test_nlattr.h" +#include +#include +#include + +static const char address[] = "10.11.12.13"; +static const unsigned int hdrlen = sizeof(struct inet_diag_req_v2); +static void *nlh0; +static char pattern[4096]; + +static void +init_inet_diag_req_v2(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_REQUEST + ); + + struct inet_diag_req_v2 *const req = NLMSG_DATA(nlh); + SET_STRUCT(struct inet_diag_req_v2, req, + .sdiag_family = AF_INET, + .idiag_ext = 1 << (INET_DIAG_CONG - 1), + .sdiag_protocol = IPPROTO_TCP, + .idiag_states = 1 << TCP_CLOSE, + .id.idiag_if = ifindex_lo() + ); + + if (!inet_pton(AF_INET, address, req->id.idiag_src) || + !inet_pton(AF_INET, address, req->id.idiag_dst)) + perror_msg_and_skip("inet_pton"); +} + +static void +print_inet_diag_req_v2(const unsigned int msg_len) +{ + printf("{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", {sdiag_family=AF_INET, sdiag_protocol=IPPROTO_TCP" + ", idiag_ext=1<<(INET_DIAG_CONG-1)" + ", idiag_states=1< DEFAULT_STRLEN ? + sizeof(op) + DEFAULT_STRLEN : sizeof(buf) - 1; + memcpy(buf + sizeof(op), &pattern, sizeof(cond)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + plen, buf, plen, + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + print_quoted_hex(buf + sizeof(op), plen - sizeof(op)); + printf("}")); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf) - 1, + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + printf("%p}", RTA_DATA(TEST_NLATTR_nla) + sizeof(op))); + + memcpy(buf + sizeof(op), &cond, sizeof(cond)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf), + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + printf("{family=AF_UNSPEC"); + PRINT_FIELD_U(", ", cond, prefix_len); + PRINT_FIELD_U(", ", cond, port); + printf("}}")); +} + +static void +print_inet_diag_hostcond(const char *const family) +{ + printf("{family=%s, prefix_len=0, port=0, ", family); +} + +static void +test_in_addr(const int fd) +{ + static const struct inet_diag_bc_op op = { + .code = INET_DIAG_BC_S_COND, + }; + static const struct inet_diag_hostcond cond = { + .family = AF_INET, + }; + struct in_addr addr; + if (!inet_pton(AF_INET, address, &addr)) + perror_msg_and_skip("inet_pton"); + + char buf[sizeof(op) + sizeof(cond) + sizeof(addr)]; + memcpy(buf, &op, sizeof(op)); + memcpy(buf + sizeof(op), &cond, sizeof(cond)); + + const unsigned int plen = sizeof(addr) - 1 > DEFAULT_STRLEN ? + sizeof(cond) + sizeof(cond) + DEFAULT_STRLEN : sizeof(buf) - 1; + memcpy(buf + sizeof(op) + sizeof(cond), &pattern, sizeof(addr)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + plen, buf, plen, + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + print_inet_diag_hostcond("AF_INET"); + printf("addr="); + print_quoted_hex(pattern, plen - sizeof(op) - sizeof(cond)); + printf("}}")); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf) - 1, + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + print_inet_diag_hostcond("AF_INET"); + printf("addr=%p}}", + RTA_DATA(TEST_NLATTR_nla) + + sizeof(op) + sizeof(cond))); + + memcpy(buf + sizeof(op) + sizeof(cond), &addr, sizeof(addr)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf), + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + print_inet_diag_hostcond("AF_INET"); + printf("addr=inet_addr(\"%s\")}}", address)); +} + +static void +test_in6_addr(const int fd) +{ + const char address6[] = "12:34:56:78:90:ab:cd:ef"; + static const struct inet_diag_bc_op op = { + .code = INET_DIAG_BC_S_COND, + }; + static const struct inet_diag_hostcond cond = { + .family = AF_INET6, + }; + struct in6_addr addr; + if (!inet_pton(AF_INET6, address6, &addr)) + perror_msg_and_skip("inet_pton"); + + char buf[sizeof(op) + sizeof(cond) + sizeof(addr)]; + memcpy(buf, &op, sizeof(op)); + memcpy(buf + sizeof(op), &cond, sizeof(cond)); + + const unsigned int plen = sizeof(addr) - 1 > DEFAULT_STRLEN ? + sizeof(cond) + sizeof(cond) + DEFAULT_STRLEN : sizeof(buf) - 1; + memcpy(buf + sizeof(op) + sizeof(cond), &pattern, sizeof(addr)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + plen, buf, plen, + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + print_inet_diag_hostcond("AF_INET6"); + printf("addr="); + print_quoted_hex(pattern, plen - sizeof(op) - sizeof(cond)); + printf("}}")); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf) - 1, + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + print_inet_diag_hostcond("AF_INET6"); + printf("addr=%p}}", + RTA_DATA(TEST_NLATTR_nla) + + sizeof(op) + sizeof(cond))); + + memcpy(buf + sizeof(op) + sizeof(cond), &addr, sizeof(addr)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf), + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + print_inet_diag_hostcond("AF_INET6"); + printf("inet_pton(AF_INET6, \"%s\", &addr)}}", address6)); +} + +static void +test_inet_diag_bc_dev_cond(const int fd) +{ + static const struct inet_diag_bc_op op = { + .code = INET_DIAG_BC_DEV_COND, + }; + const uint32_t ifindex = ifindex_lo(); + char buf[sizeof(op) + sizeof(ifindex)]; + memcpy(buf, &op, sizeof(op)); + memcpy(buf + sizeof(op), pattern, sizeof(ifindex)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf) - 1, buf, sizeof(buf) - 1, + print_inet_diag_bc_op("INET_DIAG_BC_DEV_COND"); + print_quoted_hex(pattern, sizeof(ifindex) - 1); + printf("}")); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf) - 1, + print_inet_diag_bc_op("INET_DIAG_BC_DEV_COND"); + printf("%p}", RTA_DATA(TEST_NLATTR_nla) + sizeof(op))); + + memcpy(buf + sizeof(op), &ifindex, sizeof(ifindex)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf), + print_inet_diag_bc_op("INET_DIAG_BC_DEV_COND"); + printf(IFINDEX_LO_STR "}")); +} + +static void +test_inet_diag_bc_s_le(const int fd) +{ + static const struct inet_diag_bc_op op[] = { + { + .code = INET_DIAG_BC_S_LE, + }, + { + .code = INET_DIAG_BC_DEV_COND, + .yes = 0xaf, + .no = 0xafcd + } + }; + + char buf[sizeof(op)]; + memcpy(buf, op, sizeof(op[0])); + memcpy(buf + sizeof(op[0]), pattern, sizeof(op[1])); + + const unsigned int plen = sizeof(op[1]) - 1 > DEFAULT_STRLEN ? + sizeof(op[0]) + DEFAULT_STRLEN : sizeof(buf) - 1; + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + plen, buf, plen, + print_inet_diag_bc_op("INET_DIAG_BC_S_LE"); + print_quoted_hex(buf + sizeof(op[0]), plen - sizeof(op[0])); + printf("}")); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf) - 1, + print_inet_diag_bc_op("INET_DIAG_BC_S_LE"); + printf("%p}", RTA_DATA(TEST_NLATTR_nla) + sizeof(op[0]))); + + memcpy(buf + sizeof(op[0]), &op[1], sizeof(op[1])); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf), + print_inet_diag_bc_op("INET_DIAG_BC_S_LE"); + printf("{code=INET_DIAG_BC_DEV_COND"); + PRINT_FIELD_U(", ", op[1], yes); + PRINT_FIELD_U(", ", op[1], no); + printf("}}")); +}; + +static void +test_inet_diag_bc_mark_cond(const int fd) +{ + static const struct inet_diag_bc_op op = { + .code = INET_DIAG_BC_MARK_COND, + }; + static const struct inet_diag_markcond markcond = { + .mark = 0xafbcafcd, + .mask = 0xbafaacda + }; + char buf[sizeof(op) + sizeof(markcond)]; + memcpy(buf, &op, sizeof(op)); + memcpy(buf + sizeof(op), pattern, sizeof(markcond)); + + const unsigned int plen = sizeof(markcond) - 1 > DEFAULT_STRLEN ? + sizeof(markcond) + DEFAULT_STRLEN : sizeof(buf) - 1; + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + plen, buf, plen, + print_inet_diag_bc_op("INET_DIAG_BC_MARK_COND"); + print_quoted_hex(buf + sizeof(op), plen - sizeof(op)); + printf("}")); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf) - 1, + print_inet_diag_bc_op("INET_DIAG_BC_MARK_COND"); + printf("%p}", RTA_DATA(TEST_NLATTR_nla) + sizeof(op))); + + memcpy(buf + sizeof(op), &markcond, sizeof(markcond)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf), + print_inet_diag_bc_op("INET_DIAG_BC_MARK_COND"); + PRINT_FIELD_U("{", markcond, mark); + PRINT_FIELD_U(", ", markcond, mask); + printf("}}")); +} + +static void +test_inet_diag_bc_nop(const int fd) +{ + static const struct inet_diag_bc_op op = { + .code = INET_DIAG_BC_AUTO, + }; + char buf[sizeof(op) + 4]; + memcpy(buf, &op, sizeof(op)); + memcpy(buf + sizeof(op), pattern, 4); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf), + print_inet_diag_bc_op("INET_DIAG_BC_AUTO"); + print_quoted_hex(buf + sizeof(op), + sizeof(buf) - sizeof(op)); + printf("}")); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_SOCK_DIAG); + nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + + sizeof(struct inet_diag_bc_op) + + sizeof(struct inet_diag_hostcond) + + sizeof(struct in6_addr) + DEFAULT_STRLEN); + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + test_inet_diag_bc_op(fd); + test_inet_diag_bc_s_cond(fd); + test_in_addr(fd); + test_in6_addr(fd); + test_inet_diag_bc_dev_cond(fd); + test_inet_diag_bc_s_le(fd); + test_inet_diag_bc_mark_cond(fd); + test_inet_diag_bc_nop(fd); + + printf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests-mx32/nlattr_inet_diag_req_v2.gen.test b/tests-mx32/nlattr_inet_diag_req_v2.gen.test new file mode 100755 index 00000000..01c73a13 --- /dev/null +++ b/tests-mx32/nlattr_inet_diag_req_v2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_inet_diag_req_v2 +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_mdba_mdb_entry.c b/tests-mx32/nlattr_mdba_mdb_entry.c new file mode 100644 index 00000000..7ac89ff0 --- /dev/null +++ b/tests-mx32/nlattr_mdba_mdb_entry.c @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_BR_PORT_MSG + +# include +# include "test_nlattr.h" +# include +# include +# include + +# ifndef MDB_TEMPORARY +# define MDB_TEMPORARY 0 +# endif +# ifndef MDBA_MDB_ENTRY_INFO +# define MDBA_MDB_ENTRY_INFO 1 +# endif +# ifndef MDBA_MDB_EATTR_TIMER +# define MDBA_MDB_EATTR_TIMER 1 +# endif + +const unsigned int hdrlen = sizeof(struct br_port_msg); + +static void +init_br_port_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + unsigned int len = msg_len; + + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = len, + .nlmsg_type = RTM_GETMDB, + .nlmsg_flags = NLM_F_DUMP + ); + + struct br_port_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct br_port_msg, msg, + .family = AF_UNIX, + .ifindex = ifindex_lo() + ); + + struct nlattr *nla = NLMSG_ATTR(nlh, sizeof(*msg)); + len -= NLMSG_SPACE(hdrlen); + SET_STRUCT(struct nlattr, nla, + .nla_len = len, + .nla_type = MDBA_MDB + ); + + nla = nla + 1; + len -= NLA_HDRLEN; + SET_STRUCT(struct nlattr, nla, + .nla_len = len, + .nla_type = MDBA_MDB_ENTRY + ); +} + +static void +print_br_port_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETMDB, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {family=AF_UNIX" + ", ifindex=" IFINDEX_LO_STR "}" + ", {{nla_len=%u, nla_type=MDBA_MDB}" + ", {{nla_len=%u, nla_type=MDBA_MDB_ENTRY}", + msg_len, msg_len - NLMSG_SPACE(hdrlen), + msg_len - NLMSG_SPACE(hdrlen) - NLA_HDRLEN); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 4 +# ifdef HAVE_STRUCT_BR_MDB_ENTRY + - 4 + NLA_HDRLEN * 2 + sizeof(struct nlattr) + + sizeof(struct br_mdb_entry) +# endif + ); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* MDBA_MDB_ENTRY_??? */", nla_type); + TEST_NLATTR_(fd, nlh0 - NLA_HDRLEN * 2, hdrlen + NLA_HDRLEN * 2, + init_br_port_msg, print_br_port_msg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4); + printf("}}")); + +# ifdef HAVE_STRUCT_BR_MDB_ENTRY + struct br_mdb_entry entry = { + .ifindex = ifindex_lo(), + .state = MDB_TEMPORARY, +# ifdef HAVE_STRUCT_BR_MDB_ENTRY_FLAGS + .flags = MDB_FLAGS_OFFLOAD, +# endif +# ifdef HAVE_STRUCT_BR_MDB_ENTRY_VID + .vid = 0xcdef, +# endif + .addr = { + .proto = htons(AF_UNSPEC) + } + }; + + memcpy(&entry.addr.u, pattern, sizeof(entry.addr.u)); + TEST_NESTED_NLATTR_OBJECT_EX(fd, nlh0, hdrlen, + init_br_port_msg, print_br_port_msg, + MDBA_MDB_ENTRY_INFO, pattern, entry, 2, + printf("{ifindex=" IFINDEX_LO_STR); + printf(", state=MDB_TEMPORARY"); +# ifdef HAVE_STRUCT_BR_MDB_ENTRY_FLAGS + printf(", flags=MDB_FLAGS_OFFLOAD"); +# endif +# ifdef HAVE_STRUCT_BR_MDB_ENTRY_VID + PRINT_FIELD_U(", ", entry, vid); +# endif + printf(", addr={u="); + print_quoted_hex(&entry.addr.u, + sizeof(entry.addr.u)); + printf(", proto=htons(AF_UNSPEC)}}")); + + static const struct nlattr nla = { + .nla_len = sizeof(nla), + .nla_type = MDBA_MDB_EATTR_TIMER + }; + char buf[NLMSG_ALIGN(sizeof(entry)) + sizeof(nla)]; + memcpy(buf, &entry, sizeof(entry)); + memcpy(buf + NLMSG_ALIGN(sizeof(entry)), &nla, sizeof(nla)); + TEST_NLATTR(fd, nlh0 - NLA_HDRLEN * 2, hdrlen + NLA_HDRLEN * 2, + init_br_port_msg, print_br_port_msg, + MDBA_MDB_ENTRY_INFO, sizeof(buf), buf, sizeof(buf), + printf("{ifindex=" IFINDEX_LO_STR); + printf(", state=MDB_TEMPORARY"); +# ifdef HAVE_STRUCT_BR_MDB_ENTRY_FLAGS + printf(", flags=MDB_FLAGS_OFFLOAD"); +# endif +# ifdef HAVE_STRUCT_BR_MDB_ENTRY_VID + PRINT_FIELD_U(", ", entry, vid); +# endif + printf(", addr={u="); + print_quoted_hex(&entry.addr.u, sizeof(entry.addr.u)); + printf(", proto=htons(AF_UNSPEC)}}" + ", {nla_len=%u, nla_type=MDBA_MDB_EATTR_TIMER}}}", + nla.nla_len)); +# endif /* HAVE_STRUCT_BR_MDB_ENTRY */ + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_BR_PORT_MSG") + +#endif diff --git a/tests-mx32/nlattr_mdba_mdb_entry.gen.test b/tests-mx32/nlattr_mdba_mdb_entry.gen.test new file mode 100755 index 00000000..8d09a033 --- /dev/null +++ b/tests-mx32/nlattr_mdba_mdb_entry.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_mdba_mdb_entry +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_mdba_router_port.c b/tests-mx32/nlattr_mdba_router_port.c new file mode 100644 index 00000000..7ec9992a --- /dev/null +++ b/tests-mx32/nlattr_mdba_router_port.c @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_BR_PORT_MSG + +# include +# include "test_nlattr.h" +# include +# include + +# ifndef MDBA_ROUTER +# define MDBA_ROUTER 2 +# endif +# ifndef MDBA_ROUTER_PORT +# define MDBA_ROUTER_PORT 1 +# endif +# ifndef MDBA_ROUTER_PATTR_TYPE +# define MDBA_ROUTER_PATTR_TYPE 2 +# endif +# ifndef MDB_RTR_TYPE_DISABLED +# define MDB_RTR_TYPE_DISABLED 0 +# endif + +const unsigned int hdrlen = sizeof(struct br_port_msg); + +static void +init_br_port_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETMDB, + .nlmsg_flags = NLM_F_DUMP + ); + + struct br_port_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct br_port_msg, msg, + .family = AF_UNIX, + .ifindex = ifindex_lo() + ); + + struct nlattr *nla = NLMSG_ATTR(nlh, sizeof(*msg)); + SET_STRUCT(struct nlattr, nla, + .nla_len = msg_len - NLMSG_SPACE(hdrlen), + .nla_type = MDBA_ROUTER + ); +} + +static void +print_br_port_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETMDB, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {family=AF_UNIX" + ", ifindex=" IFINDEX_LO_STR "}" + ", {{nla_len=%u, nla_type=MDBA_ROUTER}", + msg_len, msg_len - NLMSG_SPACE(hdrlen)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const uint32_t ifindex = ifindex_lo(); + const uint8_t type = MDB_RTR_TYPE_DISABLED; + static const struct nlattr nla = { + .nla_len = NLA_HDRLEN + sizeof(type), + .nla_type = MDBA_ROUTER_PATTR_TYPE + }; + char buf[NLMSG_ALIGN(ifindex) + NLA_HDRLEN + sizeof(type)]; + + const int fd = create_nl_socket(NETLINK_ROUTE); + + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(buf)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_br_port_msg, print_br_port_msg, + MDBA_ROUTER_PORT, pattern, ifindex, + printf(IFINDEX_LO_STR)); + + memcpy(buf, &ifindex, sizeof(ifindex)); + memcpy(buf + NLMSG_ALIGN(ifindex), &nla, sizeof(nla)); + memcpy(buf + NLMSG_ALIGN(ifindex) + NLA_HDRLEN, &type, sizeof(type)); + TEST_NLATTR(fd, nlh0 - NLA_HDRLEN, hdrlen + NLA_HDRLEN, + init_br_port_msg, print_br_port_msg, + MDBA_ROUTER_PORT, sizeof(buf), buf, sizeof(buf), + printf(IFINDEX_LO_STR + ", {{nla_len=%u, nla_type=MDBA_ROUTER_PATTR_TYPE}" + ", MDB_RTR_TYPE_DISABLED}}", + nla.nla_len)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_BR_PORT_MSG") + +#endif diff --git a/tests-mx32/nlattr_mdba_router_port.gen.test b/tests-mx32/nlattr_mdba_router_port.gen.test new file mode 100755 index 00000000..97230e84 --- /dev/null +++ b/tests-mx32/nlattr_mdba_router_port.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_mdba_router_port +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_ndmsg.c b/tests-mx32/nlattr_ndmsg.c new file mode 100644 index 00000000..2dd82ce4 --- /dev/null +++ b/tests-mx32/nlattr_ndmsg.c @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include "test_nlattr.h" +#ifdef HAVE_LINUX_NEIGHBOUR_H +# include +#endif +#include + +#define NDA_PORT 6 + +static void +init_ndmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETNEIGH, + .nlmsg_flags = NLM_F_DUMP + ); + + struct ndmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct ndmsg, msg, + .ndm_family = AF_UNIX, + .ndm_ifindex = ifindex_lo(), + .ndm_state = NUD_PERMANENT, + .ndm_flags = NTF_PROXY, + .ndm_type = RTN_UNSPEC + ); +} + +static void +print_ndmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETNEIGH, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {ndm_family=AF_UNIX" + ", ndm_ifindex=" IFINDEX_LO_STR + ", ndm_state=NUD_PERMANENT" + ", ndm_flags=NTF_PROXY" + ", ndm_type=RTN_UNSPEC}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct ndmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(struct nda_cacheinfo)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* NDA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_ndmsg, print_ndmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_ndmsg, print_ndmsg, + NDA_DST, 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + static const struct nda_cacheinfo ci = { + .ndm_confirmed = 0xabcdedad, + .ndm_used = 0xbcdaedad, + .ndm_updated = 0xcdbadeda, + .ndm_refcnt = 0xdeadbeda + }; + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ndmsg, print_ndmsg, + NDA_CACHEINFO, pattern, ci, + PRINT_FIELD_U("{", ci, ndm_confirmed); + PRINT_FIELD_U(", ", ci, ndm_used); + PRINT_FIELD_U(", ", ci, ndm_updated); + PRINT_FIELD_U(", ", ci, ndm_refcnt); + printf("}")); + + const uint16_t port = 0xabcd; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ndmsg, print_ndmsg, + NDA_PORT, pattern, port, + printf("htons(%u)", ntohs(port))); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/nlattr_ndmsg.gen.test b/tests-mx32/nlattr_ndmsg.gen.test new file mode 100755 index 00000000..1d2763b0 --- /dev/null +++ b/tests-mx32/nlattr_ndmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ndmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_ndtmsg.c b/tests-mx32/nlattr_ndtmsg.c new file mode 100644 index 00000000..c41ff40c --- /dev/null +++ b/tests-mx32/nlattr_ndtmsg.c @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include "test_nlattr.h" +#ifdef HAVE_LINUX_NEIGHBOUR_H +# include +#endif +#include + +#define NDTA_PARMS 6 +#define NDTPA_IFINDEX 1 + +static void +init_ndtmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETNEIGHTBL, + .nlmsg_flags = NLM_F_DUMP + ); + + struct ndtmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct ndtmsg, msg, + .ndtm_family = AF_NETLINK + ); +} + +static void +print_ndtmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETNEIGHTBL, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {ndtm_family=AF_NETLINK}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct ndtmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 11 * 8); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* NDTA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_ndtmsg, print_ndtmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + +#ifdef HAVE_STRUCT_NDT_CONFIG + static const struct ndt_config ndtc = { + .ndtc_key_len = 0xabcd, + .ndtc_entry_size = 0xbcda, + .ndtc_entries = 0xcdabedad, + .ndtc_last_flush = 0xdebaedba, + .ndtc_last_rand = 0xedadedab, + .ndtc_hash_rnd = 0xfeadedaf, + .ndtc_hash_mask = 0xadbcdead, + .ndtc_hash_chain_gc = 0xbdaedacd, + .ndtc_proxy_qlen = 0xcdeaedab + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ndtmsg, print_ndtmsg, + NDTA_CONFIG, pattern, ndtc, + PRINT_FIELD_U("{", ndtc, ndtc_key_len); + PRINT_FIELD_U(", ", ndtc, ndtc_entry_size); + PRINT_FIELD_U(", ", ndtc, ndtc_entries); + PRINT_FIELD_U(", ", ndtc, ndtc_last_flush); + PRINT_FIELD_U(", ", ndtc, ndtc_last_rand); + PRINT_FIELD_U(", ", ndtc, ndtc_hash_rnd); + PRINT_FIELD_0X(", ", ndtc, ndtc_hash_mask); + PRINT_FIELD_U(", ", ndtc, ndtc_hash_chain_gc); + PRINT_FIELD_U(", ", ndtc, ndtc_proxy_qlen); + printf("}")); +#endif /* HAVE_STRUCT_NDT_CONFIG */ + + static const struct nlattr nla = { + .nla_len = sizeof(nla), + .nla_type = NDTPA_IFINDEX + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ndtmsg, print_ndtmsg, + NDTA_PARMS, pattern, nla, + PRINT_FIELD_U("{", nla, nla_len); + printf(", nla_type=NDTPA_IFINDEX}")); + +#ifdef HAVE_STRUCT_NDT_STATS + static const struct ndt_stats ndtst = { + .ndts_allocs = 0xabcdedabedadedfa, + .ndts_destroys = 0xbcdefabefacdbaad, + .ndts_hash_grows = 0xcdbadefacdcbaede, + .ndts_res_failed = 0xdedbaecfdbcadcfe, + .ndts_lookups = 0xedfafdedbdadedec, + .ndts_hits = 0xfebdeadebcddeade, + .ndts_rcv_probes_mcast = 0xadebfeadecddeafe, + .ndts_rcv_probes_ucast = 0xbcdefeacdadecdfe, + .ndts_periodic_gc_runs = 0xedffeadedeffbecc, + .ndts_forced_gc_runs = 0xfeefefeabedeedcd, +# ifdef HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS + .ndts_table_fulls = 0xadebfefaecdfeade +# endif /* HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS */ + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ndtmsg, print_ndtmsg, + NDTA_STATS, pattern, ndtst, + PRINT_FIELD_U("{", ndtst, ndts_allocs); + PRINT_FIELD_U(", ", ndtst, ndts_destroys); + PRINT_FIELD_U(", ", ndtst, ndts_hash_grows); + PRINT_FIELD_U(", ", ndtst, ndts_res_failed); + PRINT_FIELD_U(", ", ndtst, ndts_lookups); + PRINT_FIELD_U(", ", ndtst, ndts_hits); + PRINT_FIELD_U(", ", ndtst, ndts_rcv_probes_mcast); + PRINT_FIELD_U(", ", ndtst, ndts_rcv_probes_ucast); + PRINT_FIELD_U(", ", ndtst, ndts_periodic_gc_runs); + PRINT_FIELD_U(", ", ndtst, ndts_forced_gc_runs); +# ifdef HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS + PRINT_FIELD_U(", ", ndtst, ndts_table_fulls); +# endif /* HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS */ + printf("}")); +#endif /* HAVE_STRUCT_NDT_STATS */ + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/nlattr_ndtmsg.gen.test b/tests-mx32/nlattr_ndtmsg.gen.test new file mode 100755 index 00000000..bf7d122a --- /dev/null +++ b/tests-mx32/nlattr_ndtmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ndtmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_netconfmsg.c b/tests-mx32/nlattr_netconfmsg.c new file mode 100644 index 00000000..52ded742 --- /dev/null +++ b/tests-mx32/nlattr_netconfmsg.c @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_NETCONFMSG + +# include +# include "test_nlattr.h" +# include +# include + +static void +init_netconfmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETNETCONF, + .nlmsg_flags = NLM_F_DUMP + ); + + struct netconfmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct netconfmsg, msg, + .ncm_family = AF_INET + ); +} + +static void +print_netconfmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETNETCONF, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {ncm_family=AF_INET}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + + const unsigned int hdrlen = sizeof(struct netconfmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 4); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* NETCONFA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_netconfmsg, print_netconfmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_NETCONFMSG") + +#endif diff --git a/tests-mx32/nlattr_netconfmsg.gen.test b/tests-mx32/nlattr_netconfmsg.gen.test new file mode 100755 index 00000000..27f3a66b --- /dev/null +++ b/tests-mx32/nlattr_netconfmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_netconfmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_netlink_diag_msg.c b/tests-mx32/nlattr_netlink_diag_msg.c new file mode 100644 index 00000000..b5d71a68 --- /dev/null +++ b/tests-mx32/nlattr_netlink_diag_msg.c @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include "test_nlattr.h" +#include +#include + +static void +init_netlink_diag_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP + ); + + struct netlink_diag_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct netlink_diag_msg, msg, + .ndiag_family = AF_NETLINK, + .ndiag_type = SOCK_RAW, + .ndiag_protocol = NETLINK_ROUTE, + .ndiag_state = NETLINK_CONNECTED + ); +} + +static void +print_netlink_diag_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {ndiag_family=AF_NETLINK" + ", ndiag_type=SOCK_RAW, ndiag_protocol=NETLINK_ROUTE" + ", ndiag_state=NETLINK_CONNECTED, ndiag_portid=0" + ", ndiag_dst_portid=0, ndiag_dst_group=0, ndiag_ino=0" + ", ndiag_cookie=[0, 0]}", + msg_len); +} + +static void +print_xlong(const unsigned long *p, size_t i) +{ + printf("%#lx", *p); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + static const unsigned long groups[] = { + (unsigned long) 0xdeadbeefbadc0dedULL, + (unsigned long) 0xdeadbeefbadc0dedULL + }; + static const struct netlink_diag_ring ndr = { + .ndr_block_size = 0xfabfabdc, + .ndr_block_nr = 0xabcdabda, + .ndr_frame_size = 0xcbadbafa, + .ndr_frame_nr = 0xdbcafadb + }; + static const uint32_t flags = + NDIAG_FLAG_CB_RUNNING | NDIAG_FLAG_PKTINFO; + + const int fd = create_nl_socket(NETLINK_SOCK_DIAG); + const unsigned int hdrlen = sizeof(struct netlink_diag_msg); + void *const nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + + MAX(sizeof(groups), sizeof(ndr))); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NLATTR_ARRAY(fd, nlh0, hdrlen, + init_netlink_diag_msg, print_netlink_diag_msg, + NETLINK_DIAG_GROUPS, pattern, groups, print_xlong); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_netlink_diag_msg, print_netlink_diag_msg, + NETLINK_DIAG_RX_RING, pattern, ndr, + PRINT_FIELD_U("{", ndr, ndr_block_size); + PRINT_FIELD_U(", ", ndr, ndr_block_nr); + PRINT_FIELD_U(", ", ndr, ndr_frame_size); + PRINT_FIELD_U(", ", ndr, ndr_frame_nr); + printf("}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_netlink_diag_msg, print_netlink_diag_msg, + NETLINK_DIAG_FLAGS, pattern, flags, + printf("NDIAG_FLAG_CB_RUNNING|NDIAG_FLAG_PKTINFO")); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/nlattr_netlink_diag_msg.gen.test b/tests-mx32/nlattr_netlink_diag_msg.gen.test new file mode 100755 index 00000000..eacc6df4 --- /dev/null +++ b/tests-mx32/nlattr_netlink_diag_msg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_netlink_diag_msg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_nlmsgerr.c b/tests-mx32/nlattr_nlmsgerr.c new file mode 100644 index 00000000..75be9e75 --- /dev/null +++ b/tests-mx32/nlattr_nlmsgerr.c @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include "test_nlattr.h" + +#define NLMSGERR_ATTR_COOKIE 3 + +static void +init_nlmsgerr(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = NLMSG_ERROR, + .nlmsg_flags = NLM_F_REQUEST | NLM_F_CAPPED + ); + + struct nlmsgerr *const err = NLMSG_DATA(nlh); + SET_STRUCT(struct nlmsgerr, err, + .error = -13, + .msg = { + .nlmsg_len = NLMSG_HDRLEN + 4, + .nlmsg_type = NLMSG_NOOP, + .nlmsg_flags = NLM_F_REQUEST, + } + ); +} + +static void +print_nlmsgerr(const unsigned int msg_len) +{ + printf("{len=%u, type=NLMSG_ERROR" + ", flags=NLM_F_REQUEST|NLM_F_CAPPED" + ", seq=0, pid=0}, {error=-EACCES" + ", msg={len=%u, type=NLMSG_NOOP" + ", flags=NLM_F_REQUEST, seq=0, pid=0}", + msg_len, NLMSG_HDRLEN + 4); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + static const uint8_t cookie[] = { 0xab, 0xfe }; + + const int fd = create_nl_socket(NETLINK_SOCK_DIAG); + const unsigned int hdrlen = sizeof(struct nlmsgerr); + void *const nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(cookie)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_nlmsgerr, print_nlmsgerr, + NLMSGERR_ATTR_COOKIE, + sizeof(cookie), cookie, sizeof(cookie), + printf("[%u, %u]", cookie[0], cookie[1]); + printf("}")); + + printf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests-mx32/nlattr_nlmsgerr.gen.test b/tests-mx32/nlattr_nlmsgerr.gen.test new file mode 100755 index 00000000..f06ea429 --- /dev/null +++ b/tests-mx32/nlattr_nlmsgerr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_nlmsgerr +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_packet_diag_msg.c b/tests-mx32/nlattr_packet_diag_msg.c new file mode 100644 index 00000000..0d74a2f3 --- /dev/null +++ b/tests-mx32/nlattr_packet_diag_msg.c @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include "test_nlattr.h" +#include +#include +#include +#include +#include + +static void +init_packet_diag_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP + ); + + struct packet_diag_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct packet_diag_msg, msg, + .pdiag_family = AF_PACKET, + .pdiag_type = SOCK_STREAM, + .pdiag_num = 3, + ); +} + +static void +print_packet_diag_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}" + ", {pdiag_family=AF_PACKET" + ", pdiag_type=SOCK_STREAM, pdiag_num=ETH_P_ALL" + ", pdiag_ino=0, pdiag_cookie=[0, 0]}", + msg_len); +} + +static void +print_packet_diag_mclist(const struct packet_diag_mclist *const dml, size_t i) +{ + printf("{pdmc_index=" IFINDEX_LO_STR); + PRINT_FIELD_U(", ", *dml, pdmc_count); + PRINT_FIELD_U(", ", *dml, pdmc_type); + PRINT_FIELD_U(", ", *dml, pdmc_alen); + printf(", pdmc_addr="); + print_quoted_hex(dml->pdmc_addr, dml->pdmc_alen); + printf("}"); +} + +static const struct sock_filter filter[] = { + BPF_STMT(BPF_LD|BPF_B|BPF_ABS, SKF_AD_OFF+SKF_AD_PKTTYPE), + BPF_STMT(BPF_RET|BPF_K, 0x2a) +}; + +static void +print_sock_filter(const struct sock_filter *const f, size_t i) +{ + if (f == filter) + printf("BPF_STMT(BPF_LD|BPF_B|BPF_ABS" + ", SKF_AD_OFF+SKF_AD_PKTTYPE)"); + else + printf("BPF_STMT(BPF_RET|BPF_K, 0x2a)"); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + struct packet_diag_info pinfo = { + .pdi_index = ifindex_lo(), + .pdi_version = 2, + .pdi_reserve = 0xcfaacdaf, + .pdi_copy_thresh = 0xdabacdaf, + .pdi_tstamp = 0xeafbaadf, + .pdi_flags = PDI_RUNNING + }; + const struct packet_diag_mclist dml[] = { + { + .pdmc_index = ifindex_lo(), + .pdmc_count = 0xabcdaefc, + .pdmc_type = 0xcdaf, + .pdmc_alen = 4, + .pdmc_addr = "1234" + }, + { + .pdmc_index = ifindex_lo(), + .pdmc_count = 0xdaefeafc, + .pdmc_type = 0xadef, + .pdmc_alen = 4, + .pdmc_addr = "5678" + } + }; + static const struct packet_diag_ring pdr = { + .pdr_block_size = 0xabcdafed, + .pdr_block_nr = 0xbcadefae, + .pdr_frame_size = 0xcabdfeac, + .pdr_frame_nr = 0xdeaeadef, + .pdr_retire_tmo = 0xedbafeac, + .pdr_sizeof_priv = 0xfeadeacd, + .pdr_features = 0xadebadea + }; + + int fd = create_nl_socket(NETLINK_SOCK_DIAG); + const unsigned int hdrlen = sizeof(struct packet_diag_msg); + void *const nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(dml)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_packet_diag_msg, print_packet_diag_msg, + PACKET_DIAG_INFO, pattern, pinfo, + printf("{pdi_index=%s", IFINDEX_LO_STR); + printf(", pdi_version=TPACKET_V3"); + PRINT_FIELD_U(", ", pinfo, pdi_reserve); + PRINT_FIELD_U(", ", pinfo, pdi_copy_thresh); + PRINT_FIELD_U(", ", pinfo, pdi_tstamp); + printf(", pdi_flags=PDI_RUNNING}")); + + TEST_NLATTR_ARRAY(fd, nlh0, hdrlen, + init_packet_diag_msg, print_packet_diag_msg, + PACKET_DIAG_MCLIST, pattern, dml, + print_packet_diag_mclist); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_packet_diag_msg, print_packet_diag_msg, + PACKET_DIAG_RX_RING, pattern, pdr, + PRINT_FIELD_U("{", pdr, pdr_block_size); + PRINT_FIELD_U(", ", pdr, pdr_block_nr); + PRINT_FIELD_U(", ", pdr, pdr_frame_size); + PRINT_FIELD_U(", ", pdr, pdr_frame_nr); + PRINT_FIELD_U(", ", pdr, pdr_retire_tmo); + PRINT_FIELD_U(", ", pdr, pdr_sizeof_priv); + PRINT_FIELD_U(", ", pdr, pdr_features); + printf("}")); + + TEST_NLATTR_ARRAY(fd, nlh0, hdrlen, + init_packet_diag_msg, print_packet_diag_msg, + PACKET_DIAG_FILTER, pattern, filter, + print_sock_filter); + + printf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests-mx32/nlattr_packet_diag_msg.gen.test b/tests-mx32/nlattr_packet_diag_msg.gen.test new file mode 100755 index 00000000..7177ea2a --- /dev/null +++ b/tests-mx32/nlattr_packet_diag_msg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_packet_diag_msg +netlink_sock_diag-v.sh ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag-v.sh" diff --git a/tests-mx32/nlattr_rtgenmsg.c b/tests-mx32/nlattr_rtgenmsg.c new file mode 100644 index 00000000..c17ab048 --- /dev/null +++ b/tests-mx32/nlattr_rtgenmsg.c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include "netlink.h" +#include + +#ifdef RTM_GETNSID + +# include "test_nlattr.h" + +static void +init_rtgenmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETNSID, + .nlmsg_flags = NLM_F_DUMP + ); + + struct rtgenmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct rtgenmsg, msg, + .rtgen_family = AF_UNIX + ); +} + +static void +print_rtgenmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETNSID, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {rtgen_family=AF_UNIX}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct rtgenmsg); + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(nla_type_str)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + sprintf(nla_type_str, "%#x /* NETNSA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_rtgenmsg, print_rtgenmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("RTM_GETNSID") + +#endif diff --git a/tests-mx32/nlattr_rtgenmsg.gen.test b/tests-mx32/nlattr_rtgenmsg.gen.test new file mode 100755 index 00000000..37ec8425 --- /dev/null +++ b/tests-mx32/nlattr_rtgenmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_rtgenmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_rtmsg.c b/tests-mx32/nlattr_rtmsg.c new file mode 100644 index 00000000..f4efa4c0 --- /dev/null +++ b/tests-mx32/nlattr_rtmsg.c @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include "test_nlattr.h" +#include +#include + +#define RTA_ENCAP_TYPE 21 +#define LWTUNNEL_ENCAP_NONE 0 + +static void +init_rtmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETROUTE, + .nlmsg_flags = NLM_F_DUMP + ); + + struct rtmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct rtmsg, msg, + .rtm_family = AF_UNIX, + .rtm_tos = IPTOS_LOWDELAY, + .rtm_table = RT_TABLE_DEFAULT, + .rtm_protocol = RTPROT_KERNEL, + .rtm_scope = RT_SCOPE_UNIVERSE, + .rtm_type = RTN_LOCAL, + .rtm_flags = RTM_F_NOTIFY + ); +} + +static void +print_rtmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETROUTE, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {rtm_family=AF_UNIX" + ", rtm_dst_len=0, rtm_src_len=0" + ", rtm_tos=IPTOS_LOWDELAY" + ", rtm_table=RT_TABLE_DEFAULT" + ", rtm_protocol=RTPROT_KERNEL" + ", rtm_scope=RT_SCOPE_UNIVERSE" + ", rtm_type=RTN_LOCAL" + ", rtm_flags=RTM_F_NOTIFY}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct rtmsg); + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(nla_type_str)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + sprintf(nla_type_str, "%#x /* RTA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_DST, 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + const uint32_t ifindex = ifindex_lo(); + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_OIF, pattern, ifindex, + printf(IFINDEX_LO_STR)); + + const uint32_t rt_class_id = RT_TABLE_DEFAULT; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_TABLE, pattern, rt_class_id, + printf("RT_TABLE_DEFAULT")); + + struct nlattr nla = { + .nla_type = RTAX_LOCK, + .nla_len = sizeof(nla) + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_METRICS, pattern, nla, + printf("{nla_len=%u, nla_type=RTAX_LOCK}", + nla.nla_len)); + struct rtnexthop nh = { + .rtnh_len = sizeof(nh) - 1, + .rtnh_flags = RTNH_F_DEAD, + .rtnh_hops = 0xab, + .rtnh_ifindex = ifindex_lo() + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_MULTIPATH, pattern, nh, + printf("{rtnh_len=%u, rtnh_flags=RTNH_F_DEAD" + ", rtnh_hops=%u" + ", rtnh_ifindex=" IFINDEX_LO_STR "}", + nh.rtnh_len, nh.rtnh_hops)); + + char buf[RTNH_ALIGN(sizeof(nh)) + sizeof(nla)]; + nh.rtnh_len = sizeof(buf); + nla.nla_type = RTA_DST; + memcpy(buf, &nh, sizeof(nh)); + memcpy(buf + RTNH_ALIGN(sizeof(nh)), &nla, sizeof(nla)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_MULTIPATH, sizeof(buf), buf, sizeof(buf), + printf("{rtnh_len=%u, rtnh_flags=RTNH_F_DEAD" + ", rtnh_hops=%u, rtnh_ifindex=" IFINDEX_LO_STR "}" + ", {nla_len=%u, nla_type=RTA_DST}", + nh.rtnh_len, nh.rtnh_hops, nla.nla_len)); + + static const struct rta_cacheinfo ci = { + .rta_clntref = 0xabcdefab, + .rta_lastuse = 0xbdadaedc, + .rta_expires = 0xcdadebad, + .rta_error = 0xdaedadeb, + .rta_used = 0xedfabdad, + .rta_id = 0xfeadbcda, + .rta_ts = 0xacdbaded, + .rta_tsage = 0xbadeadef + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_CACHEINFO, pattern, ci, + PRINT_FIELD_U("{", ci, rta_clntref); + PRINT_FIELD_U(", ", ci, rta_lastuse); + PRINT_FIELD_U(", ", ci, rta_expires); + PRINT_FIELD_U(", ", ci, rta_error); + PRINT_FIELD_U(", ", ci, rta_used); + PRINT_FIELD_X(", ", ci, rta_id); + PRINT_FIELD_U(", ", ci, rta_ts); + PRINT_FIELD_U(", ", ci, rta_tsage); + printf("}")); + +#ifdef HAVE_STRUCT_RTA_MFC_STATS + static const struct rta_mfc_stats mfcs = { + .mfcs_packets = 0xadcdedfdadefadcd, + .mfcs_bytes = 0xbaedadedcdedadbd, + .mfcs_wrong_if = 0xcddeabeedaedabfa + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_MFC_STATS, pattern, mfcs, + PRINT_FIELD_U("{", mfcs, mfcs_packets); + PRINT_FIELD_U(", ", mfcs, mfcs_bytes); + PRINT_FIELD_U(", ", mfcs, mfcs_wrong_if); + printf("}")); +#endif + +#ifdef HAVE_STRUCT_RTVIA + static const struct rtvia via = { + .rtvia_family = AF_INET + }; + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_VIA, pattern, via, + printf("{rtvia_family=AF_INET}")); + + static const char address4[] = "12.34.56.78"; + struct in_addr a4 = { + .s_addr = inet_addr(address4) + }; + char rtviabuf[sizeof(via) + sizeof(a4)]; + memcpy(rtviabuf, &via, sizeof(via)); + memcpy(rtviabuf + sizeof(via), &a4, sizeof(a4)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_VIA, sizeof(rtviabuf), rtviabuf, sizeof(rtviabuf), + printf("{rtvia_family=AF_INET" + ", rtvia_addr=inet_addr(\"%s\")}", address4)); +#endif + + const uint16_t encap_type = LWTUNNEL_ENCAP_NONE; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_ENCAP_TYPE, pattern, encap_type, + printf("LWTUNNEL_ENCAP_NONE")); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/nlattr_rtmsg.gen.test b/tests-mx32/nlattr_rtmsg.gen.test new file mode 100755 index 00000000..f075529a --- /dev/null +++ b/tests-mx32/nlattr_rtmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_rtmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_smc_diag_msg.c b/tests-mx32/nlattr_smc_diag_msg.c new file mode 100644 index 00000000..3f47a515 --- /dev/null +++ b/tests-mx32/nlattr_smc_diag_msg.c @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifndef AF_SMC +# define AF_SMC 43 +#endif + +#include +#include +#include +#include +#include "test_nlattr.h" +#include +#include +#include + +#ifndef SMC_CLNT +# define SMC_CLNT 0 +#endif +#ifndef SMC_ACTIVE +# define SMC_ACTIVE 1 +#endif + +static const char address[] = "12.34.56.78"; + +static void +init_smc_diag_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP + ); + + struct smc_diag_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct smc_diag_msg, msg, + .diag_family = AF_SMC, + .diag_state = SMC_ACTIVE + ); + + if (!inet_pton(AF_INET, address, msg->id.idiag_src) || + !inet_pton(AF_INET, address, msg->id.idiag_dst)) + perror_msg_and_skip("inet_pton"); +} + +static void +print_smc_diag_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}" + ", {diag_family=AF_SMC, diag_state=SMC_ACTIVE" + ", diag_fallback=SMC_DIAG_MODE_SMCR, diag_shutdown=0" + ", id={idiag_sport=htons(0), idiag_dport=htons(0)" + ", idiag_src=inet_addr(\"%s\")" + ", idiag_dst=inet_addr(\"%s\")" + ", idiag_if=0, idiag_cookie=[0, 0]}" + ", diag_uid=0, diag_inode=0}", + msg_len, address, address); +} + +#define PRINT_FIELD_SMC_DIAG_CURSOR(prefix_, where_, field_) \ + do { \ + printf("%s%s=", (prefix_), #field_); \ + PRINT_FIELD_U("{", (where_).field_, reserved); \ + PRINT_FIELD_U(", ", (where_).field_, wrap); \ + PRINT_FIELD_U(", ", (where_).field_, count); \ + printf("}"); \ + } while (0) + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + static const struct smc_diag_conninfo cinfo = { + .token = 0xabcdefac, + .sndbuf_size = 0xbcdaefad, + .rmbe_size = 0xcdbaefab, + .peer_rmbe_size = 0xdbcdedaf, + .rx_prod = { + .reserved = 0xabc1, + .wrap = 0xbca1, + .count = 0xcdedbad1 + }, + .rx_cons = { + .reserved = 0xabc2, + .wrap = 0xbca2, + .count = 0xcdedbad2 + }, + .tx_prod = { + .reserved = 0xabc3, + .wrap = 0xbca3, + .count = 0xcdedbad3 + }, + .tx_cons = { + .reserved = 0xabc4, + .wrap = 0xbca4, + .count = 0xcdedbad4 + }, + .rx_prod_flags = 0xff, + .rx_conn_state_flags = 0xff, + .tx_prod_flags = 0xff, + .tx_conn_state_flags = 0xff, + .tx_prep = { + .reserved = 0xabc5, + .wrap = 0xbca5, + .count = 0xcdedbad5 + }, + .tx_sent = { + .reserved = 0xabc6, + .wrap = 0xbca6, + .count = 0xcdedbad6 + }, + .tx_fin = { + .reserved = 0xabc7, + .wrap = 0xbca7, + .count = 0xcdedbad7 + } + }; + static const struct smc_diag_lgrinfo linfo = { + .lnk[0] = { + .link_id = 0xaf, + .ibport = 0xfa, + .ibname = "123", + .gid = "456", + .peer_gid = "789" + }, + .role = SMC_CLNT + }; + static const struct smcd_diag_dmbinfo dinfo = { + .linkid = 0xdeadc0de, + .peer_gid = 0xbefeededbadc0dedULL, + .my_gid = 0xdeec0dedfacebeefULL, + .token = 0xcafedecaffeedeedULL, + .peer_token = 0xfeedfacebeeff00dULL, + }; + static const struct smc_diag_fallback fb1 = { + .reason = 0, + .peer_diagnosis = 0x03020000, + }; + static const struct smc_diag_fallback fb2 = { + .reason = 0x03060000, + .peer_diagnosis = 0x99999999, + }; + static uint8_t sd1 = 0x23; + static uint8_t sd2 = 0x40; + + int fd = create_nl_socket(NETLINK_SOCK_DIAG); + const unsigned int hdrlen = sizeof(struct smc_diag_msg); + void *const nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + + MAX(sizeof(cinfo), sizeof(linfo))); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_smc_diag_msg, print_smc_diag_msg, + SMC_DIAG_SHUTDOWN, pattern, sd1, + printf("RCV_SHUTDOWN|SEND_SHUTDOWN|0x20")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_smc_diag_msg, print_smc_diag_msg, + SMC_DIAG_SHUTDOWN, pattern, sd2, + printf("0x40 /* ???_SHUTDOWN */")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_smc_diag_msg, print_smc_diag_msg, + SMC_DIAG_CONNINFO, pattern, cinfo, + PRINT_FIELD_U("{", cinfo, token); + PRINT_FIELD_U(", ", cinfo, sndbuf_size); + PRINT_FIELD_U(", ", cinfo, rmbe_size); + PRINT_FIELD_U(", ", cinfo, peer_rmbe_size); + PRINT_FIELD_SMC_DIAG_CURSOR(", ", cinfo, rx_prod); + PRINT_FIELD_SMC_DIAG_CURSOR(", ", cinfo, rx_cons); + PRINT_FIELD_SMC_DIAG_CURSOR(", ", cinfo, tx_prod); + PRINT_FIELD_SMC_DIAG_CURSOR(", ", cinfo, tx_cons); + printf(", rx_prod_flags=0xff"); + printf(", rx_conn_state_flags=0xff"); + printf(", tx_prod_flags=0xff"); + printf(", tx_conn_state_flags=0xff"); + PRINT_FIELD_SMC_DIAG_CURSOR(", ", cinfo, tx_prep); + PRINT_FIELD_SMC_DIAG_CURSOR(", ", cinfo, tx_sent); + PRINT_FIELD_SMC_DIAG_CURSOR(", ", cinfo, tx_fin); + printf("}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_smc_diag_msg, print_smc_diag_msg, + SMC_DIAG_LGRINFO, pattern, linfo, + PRINT_FIELD_U("{lnk[0]={", linfo.lnk[0], link_id); + printf(", ibname=\"%s\"", linfo.lnk[0].ibname); + PRINT_FIELD_U(", ", linfo.lnk[0], ibport); + printf(", gid=\"%s\"", linfo.lnk[0].gid); + printf(", peer_gid=\"%s\"}", linfo.lnk[0].peer_gid); + printf(", role=SMC_CLNT}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_smc_diag_msg, print_smc_diag_msg, + SMC_DIAG_DMBINFO, pattern, dinfo, + PRINT_FIELD_U("{", dinfo, linkid); + PRINT_FIELD_X(", ", dinfo, peer_gid); + PRINT_FIELD_X(", ", dinfo, my_gid); + PRINT_FIELD_X(", ", dinfo, token); + PRINT_FIELD_X(", ", dinfo, peer_token); + printf("}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_smc_diag_msg, print_smc_diag_msg, + SMC_DIAG_FALLBACK, pattern, fb1, + printf("{reason=0 /* SMC_CLC_DECL_??? */"); + printf(", peer_diagnosis=0x3020000" + " /* SMC_CLC_DECL_IPSEC */}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_smc_diag_msg, print_smc_diag_msg, + SMC_DIAG_FALLBACK, pattern, fb2, + printf("{reason=0x3060000" + " /* SMC_CLC_DECL_OPTUNSUPP */"); + printf(", peer_diagnosis=0x99999999" + " /* SMC_CLC_DECL_??? */}")); + + printf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests-mx32/nlattr_smc_diag_msg.gen.test b/tests-mx32/nlattr_smc_diag_msg.gen.test new file mode 100755 index 00000000..e64d21e2 --- /dev/null +++ b/tests-mx32/nlattr_smc_diag_msg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_smc_diag_msg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_tc_stats.c b/tests-mx32/nlattr_tc_stats.c new file mode 100644 index 00000000..c0ebaf89 --- /dev/null +++ b/tests-mx32/nlattr_tc_stats.c @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_GNET_STATS_BASIC + +# include +# include +# include "test_nlattr.h" +# include +# include + +const unsigned int hdrlen = sizeof(struct tcmsg); + +static void +init_tcmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETQDISC, + .nlmsg_flags = NLM_F_DUMP + ); + + struct tcmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct tcmsg, msg, + .tcm_family = AF_UNIX, + .tcm_ifindex = ifindex_lo() + ); + + struct nlattr *const nla = NLMSG_ATTR(nlh, sizeof(*msg)); + SET_STRUCT(struct nlattr, nla, + .nla_len = msg_len - NLMSG_SPACE(hdrlen), + .nla_type = TCA_STATS2 + ); +} + +static void +print_tcmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETQDISC, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {tcm_family=AF_UNIX" + ", tcm_ifindex=" IFINDEX_LO_STR + ", tcm_handle=0, tcm_parent=0, tcm_info=0}" + ", {{nla_len=%u, nla_type=TCA_STATS2}", + msg_len, msg_len - NLMSG_SPACE(hdrlen)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 8 * 5); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + static const struct gnet_stats_basic sb = { + .bytes = 0xabcdebdafefeadeb, + .packets = 0xbdcdeabf + }; + char buf[offsetofend(struct gnet_stats_basic, packets)]; + memcpy(buf, &sb, sizeof(buf)); + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_STATS_BASIC, pattern, buf, + PRINT_FIELD_U("{", sb, bytes); + PRINT_FIELD_U(", ", sb, packets); + printf("}")); + +# ifdef HAVE_STRUCT_GNET_STATS_RATE_EST + static const struct gnet_stats_rate_est est = { + .bps = 0xebcdaebd, + .pps = 0xabdceade, + }; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_STATS_RATE_EST, pattern, est, + PRINT_FIELD_U("{", est, bps); + PRINT_FIELD_U(", ", est, pps); + printf("}")); +# endif + +# ifdef HAVE_STRUCT_GNET_STATS_QUEUE + static const struct gnet_stats_queue qstats = { + .qlen = 0xabcdeabd, + .backlog = 0xbcdaebad, + .drops = 0xcdbeaedb, + .requeues = 0xdebaefab, + .overlimits = 0xefaebade + }; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_STATS_QUEUE, pattern, qstats, + PRINT_FIELD_U("{", qstats, qlen); + PRINT_FIELD_U(", ", qstats, backlog); + PRINT_FIELD_U(", ", qstats, drops); + PRINT_FIELD_U(", ", qstats, requeues); + PRINT_FIELD_U(", ", qstats, overlimits); + printf("}")); +# endif + +# ifdef HAVE_STRUCT_GNET_STATS_RATE_EST64 + static const struct gnet_stats_rate_est64 est64 = { + .bps = 0xacbdcdefafecaebf, + .pps = 0xcdabeabdfeabceaf + }; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_STATS_RATE_EST64, pattern, est64, + PRINT_FIELD_U("{", est64, bps); + PRINT_FIELD_U(", ", est64, pps); + printf("}")); +# endif + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_GNET_STATS_BASIC") + +#endif diff --git a/tests-mx32/nlattr_tc_stats.gen.test b/tests-mx32/nlattr_tc_stats.gen.test new file mode 100755 index 00000000..11cadd2d --- /dev/null +++ b/tests-mx32/nlattr_tc_stats.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_tc_stats +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_tca_stab.c b/tests-mx32/nlattr_tca_stab.c new file mode 100644 index 00000000..d339dbc8 --- /dev/null +++ b/tests-mx32/nlattr_tca_stab.c @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include "test_nlattr.h" +#include +#include + +#ifndef TCA_STAB +# define TCA_STAB 8 +#endif +#if !HAVE_DECL_TCA_STAB_DATA +enum { TCA_STAB_DATA = 2 }; +#endif + +const unsigned int hdrlen = sizeof(struct tcmsg); + +static void +init_tcmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETQDISC, + .nlmsg_flags = NLM_F_DUMP + ); + + struct tcmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct tcmsg, msg, + .tcm_family = AF_UNIX, + .tcm_ifindex = ifindex_lo() + ); + + struct nlattr *const nla = NLMSG_ATTR(nlh, sizeof(*msg)); + SET_STRUCT(struct nlattr, nla, + .nla_len = msg_len - NLMSG_SPACE(hdrlen), + .nla_type = TCA_STAB + ); +} + +static void +print_tcmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETQDISC, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {tcm_family=AF_UNIX" + ", tcm_ifindex=" IFINDEX_LO_STR + ", tcm_handle=0, tcm_parent=0, tcm_info=0}" + ", {{nla_len=%u, nla_type=TCA_STAB}", + msg_len, msg_len - NLMSG_SPACE(hdrlen)); +} + +static void +print_uint16(const uint16_t *p, size_t idx) +{ + printf("%u", *p); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 4 +#ifdef HAVE_STRUCT_TC_SIZESPEC + - 4 + sizeof(struct tc_sizespec) +#endif + ); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + +#ifdef HAVE_STRUCT_TC_SIZESPEC + static const struct tc_sizespec s = { + .cell_log = 0xab, + .size_log = 0xcd, + .cell_align = 0xefab, + .overhead = 0xcdadeefa, + .linklayer = 0xefbaafeb, + .mpu = 0xfebfaefb, + .mtu = 0xacdbefab, + .tsize = 0xbdeaabed + }; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_STAB_BASE, pattern, s, + PRINT_FIELD_U("{", s, cell_log); + PRINT_FIELD_U(", ", s, size_log); + PRINT_FIELD_D(", ", s, cell_align); + PRINT_FIELD_D(", ", s, overhead); + PRINT_FIELD_U(", ", s, linklayer); + PRINT_FIELD_U(", ", s, mpu); + PRINT_FIELD_U(", ", s, mtu); + PRINT_FIELD_U(", ", s, tsize); + printf("}")); +#endif + + uint16_t data[2] = { 0xacbd, 0xefba }; + TEST_NESTED_NLATTR_ARRAY(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_STAB_DATA, pattern, data, print_uint16); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/nlattr_tca_stab.gen.test b/tests-mx32/nlattr_tca_stab.gen.test new file mode 100755 index 00000000..81d36c70 --- /dev/null +++ b/tests-mx32/nlattr_tca_stab.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_tca_stab +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_tcamsg.c b/tests-mx32/nlattr_tcamsg.c new file mode 100644 index 00000000..b8bd7e35 --- /dev/null +++ b/tests-mx32/nlattr_tcamsg.c @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include "test_nlattr.h" +#include + +static void +init_tcamsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETACTION, + .nlmsg_flags = NLM_F_DUMP + ); + + struct tcamsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct tcamsg, msg, + .tca_family = AF_INET + ); +} + +static void +print_tcamsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETACTION, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {tca_family=AF_INET}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct tcamsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 4); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* TCA_ACT_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_tcamsg, print_tcamsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/nlattr_tcamsg.gen.test b/tests-mx32/nlattr_tcamsg.gen.test new file mode 100755 index 00000000..1a6408d9 --- /dev/null +++ b/tests-mx32/nlattr_tcamsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_tcamsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_tcmsg.c b/tests-mx32/nlattr_tcmsg.c new file mode 100644 index 00000000..f76b2f87 --- /dev/null +++ b/tests-mx32/nlattr_tcmsg.c @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include "test_nlattr.h" +#include +#include + +static void +init_tcmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETQDISC, + .nlmsg_flags = NLM_F_DUMP + ); + + struct tcmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct tcmsg, msg, + .tcm_family = AF_UNIX, + .tcm_ifindex = ifindex_lo() + ); + +} + +static void +print_tcmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETQDISC, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {tcm_family=AF_UNIX" + ", tcm_ifindex=" IFINDEX_LO_STR + ", tcm_handle=0, tcm_parent=0, tcm_info=0}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct tcmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(struct tc_stats)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* TCA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + static const struct tc_stats st = { + .bytes = 0xabcdcdbefeadefac, + .packets = 0xbcdeaefd, + .drops = 0xcdedafed, + .overlimits = 0xdcdbefad, + .bps = 0xefaebfad, + .pps = 0xfefbaedb, + .qlen = 0xabcdefab, + .backlog = 0xbdeabeab + }; + char buf[offsetofend(struct tc_stats, backlog)]; + memcpy(buf, &st, sizeof(buf)); + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_STATS, pattern, buf, + PRINT_FIELD_U("{", st, bytes); + PRINT_FIELD_U(", ", st, packets); + PRINT_FIELD_U(", ", st, drops); + PRINT_FIELD_U(", ", st, overlimits); + PRINT_FIELD_U(", ", st, bps); + PRINT_FIELD_U(", ", st, pps); + PRINT_FIELD_U(", ", st, qlen); + PRINT_FIELD_U(", ", st, backlog); + printf("}")); + + static const struct tc_estimator est = { + .interval = 0xcd, + .ewma_log = 0xab + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_RATE, pattern, est, + PRINT_FIELD_D("{", est, interval); + PRINT_FIELD_U(", ", est, ewma_log); + printf("}")); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/nlattr_tcmsg.gen.test b/tests-mx32/nlattr_tcmsg.gen.test new file mode 100755 index 00000000..7e70ca26 --- /dev/null +++ b/tests-mx32/nlattr_tcmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_tcmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nlattr_unix_diag_msg.c b/tests-mx32/nlattr_unix_diag_msg.c new file mode 100644 index 00000000..4d964eab --- /dev/null +++ b/tests-mx32/nlattr_unix_diag_msg.c @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include "test_nlattr.h" +#include +#include + +static void +init_unix_diag_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP + ); + + struct unix_diag_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct unix_diag_msg, msg, + .udiag_family = AF_UNIX, + .udiag_type = SOCK_STREAM, + .udiag_state = TCP_ESTABLISHED + ); +} + +static void +print_unix_diag_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_ESTABLISHED" + ", udiag_ino=0, udiag_cookie=[0, 0]}", + msg_len); +} + +static void +print_uint(const unsigned int *p, size_t i) +{ + printf("%u", *p); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + static const struct unix_diag_vfs uv = { + .udiag_vfs_dev = 0xabcddafa, + .udiag_vfs_ino = 0xbafabcda + }; + static const struct unix_diag_rqlen rql = { + .udiag_rqueue = 0xfabdcdad, + .udiag_wqueue = 0xbacdadcf + }; + static const uint32_t inode[] = { 0xadbcadbc, 0xfabdcdac }; + + const int fd = create_nl_socket(NETLINK_SOCK_DIAG); + const unsigned int hdrlen = sizeof(struct unix_diag_msg); + void *const nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(inode)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_unix_diag_msg, print_unix_diag_msg, + UNIX_DIAG_VFS, pattern, uv, + printf("{udiag_vfs_dev=makedev(%#x, %#x)", + major(uv.udiag_vfs_dev), + minor(uv.udiag_vfs_dev)); + PRINT_FIELD_U(", ", uv, udiag_vfs_ino); + printf("}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_unix_diag_msg, print_unix_diag_msg, + UNIX_DIAG_RQLEN, pattern, rql, + PRINT_FIELD_U("{", rql, udiag_rqueue); + PRINT_FIELD_U(", ", rql, udiag_wqueue); + printf("}")); + + TEST_NLATTR_ARRAY(fd, nlh0, hdrlen, + init_unix_diag_msg, print_unix_diag_msg, + UNIX_DIAG_ICONS, pattern, inode, print_uint); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/nlattr_unix_diag_msg.gen.test b/tests-mx32/nlattr_unix_diag_msg.gen.test new file mode 100755 index 00000000..fd5b8286 --- /dev/null +++ b/tests-mx32/nlattr_unix_diag_msg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_unix_diag_msg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests-mx32/nsyscalls-d.c b/tests-mx32/nsyscalls-d.c new file mode 100644 index 00000000..1525dea0 --- /dev/null +++ b/tests-mx32/nsyscalls-d.c @@ -0,0 +1,2 @@ +#define DEBUG_PRINT 1 +#include "nsyscalls.c" diff --git a/tests-mx32/nsyscalls-d.test b/tests-mx32/nsyscalls-d.test new file mode 100755 index 00000000..a6495b6b --- /dev/null +++ b/tests-mx32/nsyscalls-d.test @@ -0,0 +1,31 @@ +#!/bin/sh +# +# Check decoding of out-of-range syscalls along with debug ouput +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +: ${debug_flag=-d} +NAME=nsyscalls-d + +if [ "$MIPS_ABI" = "o32" ]; then + syscall=syscall + [ -z "$debug_flag" ] || + skip_ "mips $MIPS_ABI is not supported by this test yet" +else + syscall=none +fi + +run_strace $debug_flag -e trace=$syscall ../$NAME "$STRACE_EXE" 9 \ + 2> "$LOG-err-all" > "$EXP" 9> "$EXP-err" + +[ -n "$debug_flag" ] || > "$EXP-err" + +grep "invalid syscall" "$LOG-err-all" > "$LOG-err" + +match_diff "$LOG" "$EXP" +match_diff "$LOG-err" "$EXP-err" diff --git a/tests-mx32/nsyscalls-nd.test b/tests-mx32/nsyscalls-nd.test new file mode 100755 index 00000000..f578f9aa --- /dev/null +++ b/tests-mx32/nsyscalls-nd.test @@ -0,0 +1,9 @@ +#!/bin/sh +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +debug_flag= +. "${srcdir=.}"/nsyscalls-d.test diff --git a/tests-mx32/nsyscalls.c b/tests-mx32/nsyscalls.c index aecf7aa7..529f50ee 100644 --- a/tests-mx32/nsyscalls.c +++ b/tests-mx32/nsyscalls.c @@ -2,56 +2,32 @@ * Check decoding of out-of-range syscalls. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include "sysent.h" #include #include +#include #include #include -#define TD 0 -#define TF 0 -#define TI 0 -#define TN 0 -#define TP 0 -#define TS 0 -#define TM 0 -#define NF 0 -#define MA 0 -#define SI 0 -#define SE 0 -#define CST 0 -#define SEN(arg) 0,0 +#include "sysent_shorthand_defs.h" static const struct_sysent syscallent[] = { #include "syscallent.h" }; +#include "sysent_shorthand_undefs.h" + +#ifndef DEBUG_PRINT +# define DEBUG_PRINT 0 +#endif + #if defined __X32_SYSCALL_BIT && defined __NR_read \ && (__X32_SYSCALL_BIT & __NR_read) != 0 # define SYSCALL_BIT __X32_SYSCALL_BIT @@ -59,6 +35,11 @@ static const struct_sysent syscallent[] = { # define SYSCALL_BIT 0 #endif +#if DEBUG_PRINT +static const char *strace_name; +static FILE *debug_out; +#endif + static void test_syscall(const unsigned long nr) { @@ -73,27 +54,52 @@ test_syscall(const unsigned long nr) long rc = syscall(nr | SYSCALL_BIT, a[0], a[1], a[2], a[3], a[4], a[5]); + +#if DEBUG_PRINT + fprintf(debug_out, "%s: pid %d invalid syscall %#lx\n", + strace_name, getpid(), nr | SYSCALL_BIT); +#endif + #ifdef LINUX_MIPSO32 printf("syscall(%#lx, %#lx, %#lx, %#lx, %#lx, %#lx, %#lx)" - " = %ld ENOSYS (%m)\n", nr | SYSCALL_BIT, - a[0], a[1], a[2], a[3], a[4], a[5], rc); + " = %s\n", nr | SYSCALL_BIT, + a[0], a[1], a[2], a[3], a[4], a[5], sprintrc(rc)); #else - printf("syscall_%lu(%#llx, %#llx, %#llx, %#llx, %#llx, %#llx)" - " = %ld (errno %d)\n", nr, + printf("syscall_%#lx(%#llx, %#llx, %#llx, %#llx, %#llx, %#llx)" + " = %s\n", nr | SYSCALL_BIT, (unsigned long long) a[0], (unsigned long long) a[1], (unsigned long long) a[2], (unsigned long long) a[3], (unsigned long long) a[4], (unsigned long long) a[5], - rc, errno); + sprintrc(rc)); #endif } int -main(void) +main(int argc, char *argv[]) { +#if DEBUG_PRINT + if (argc < 3) + error_msg_and_fail("Not enough arguments. " + "Usage: %s STRACE_NAME DEBUG_OUT_FD", + argv[0]); + + strace_name = argv[1]; + + errno = 0; + int debug_out_fd = strtol(argv[2], NULL, 0); + if (errno) + error_msg_and_fail("Not a number: %s", argv[2]); + + debug_out = fdopen(debug_out_fd, "a"); + if (!debug_out) + perror_msg_and_fail("fdopen: %d", debug_out_fd); +#endif + test_syscall(ARRAY_SIZE(syscallent)); + (void) syscallent; /* workaround for clang bug #33068 */ #ifdef SYS_socket_subcall test_syscall(SYS_socket_subcall + 1); diff --git a/tests-mx32/nsyscalls.test b/tests-mx32/nsyscalls.test index 61f72d52..08d45ac6 100755 --- a/tests-mx32/nsyscalls.test +++ b/tests-mx32/nsyscalls.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check decoding of out-of-range syscalls. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests-mx32/old_mmap-P.c b/tests-mx32/old_mmap-P.c new file mode 100644 index 00000000..bb28e889 --- /dev/null +++ b/tests-mx32/old_mmap-P.c @@ -0,0 +1,3 @@ +#define TEST_FD 9 +#define PATH_TRACING +#include "old_mmap.c" diff --git a/tests-mx32/old_mmap-P.gen.test b/tests-mx32/old_mmap-P.gen.test new file mode 100755 index 00000000..b1de9345 --- /dev/null +++ b/tests-mx32/old_mmap-P.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (old_mmap-P -e trace=mmap -P "/dev/full" 9>>/dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=mmap -P "/dev/full" 9>>/dev/full diff --git a/tests-mx32/old_mmap-Xabbrev.c b/tests-mx32/old_mmap-Xabbrev.c new file mode 100644 index 00000000..033503cc --- /dev/null +++ b/tests-mx32/old_mmap-Xabbrev.c @@ -0,0 +1 @@ +#include "old_mmap.c" diff --git a/tests-mx32/old_mmap-Xabbrev.gen.test b/tests-mx32/old_mmap-Xabbrev.gen.test new file mode 100755 index 00000000..0ee5608e --- /dev/null +++ b/tests-mx32/old_mmap-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (old_mmap-Xabbrev -a11 -e trace=mmap -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=mmap -Xabbrev diff --git a/tests-mx32/old_mmap-Xraw.c b/tests-mx32/old_mmap-Xraw.c new file mode 100644 index 00000000..06de40b4 --- /dev/null +++ b/tests-mx32/old_mmap-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "old_mmap.c" diff --git a/tests-mx32/old_mmap-Xraw.gen.test b/tests-mx32/old_mmap-Xraw.gen.test new file mode 100755 index 00000000..6d7d3cf4 --- /dev/null +++ b/tests-mx32/old_mmap-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (old_mmap-Xraw -a11 -e trace=mmap -Xraw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=mmap -Xraw diff --git a/tests-mx32/old_mmap-Xverbose.c b/tests-mx32/old_mmap-Xverbose.c new file mode 100644 index 00000000..b141fec9 --- /dev/null +++ b/tests-mx32/old_mmap-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "old_mmap.c" diff --git a/tests-mx32/old_mmap-Xverbose.gen.test b/tests-mx32/old_mmap-Xverbose.gen.test new file mode 100755 index 00000000..6534a931 --- /dev/null +++ b/tests-mx32/old_mmap-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (old_mmap-Xverbose -a11 -e trace=mmap -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=mmap -Xverbose diff --git a/tests-mx32/old_mmap-v-none.c b/tests-mx32/old_mmap-v-none.c new file mode 100644 index 00000000..033503cc --- /dev/null +++ b/tests-mx32/old_mmap-v-none.c @@ -0,0 +1 @@ +#include "old_mmap.c" diff --git a/tests-mx32/old_mmap-v-none.gen.test b/tests-mx32/old_mmap-v-none.gen.test new file mode 100755 index 00000000..a568d989 --- /dev/null +++ b/tests-mx32/old_mmap-v-none.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (old_mmap-v-none -a11 -e trace=mmap -e verbose=none); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=mmap -e verbose=none diff --git a/tests-mx32/old_mmap.c b/tests-mx32/old_mmap.c index 2725fb75..92ab3efb 100644 --- a/tests-mx32/old_mmap.c +++ b/tests-mx32/old_mmap.c @@ -2,29 +2,10 @@ * Check decoding of "old mmap" edition of mmap syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,57 +17,86 @@ * it would require additional efforts to filter out mmap calls made by glibc. */ -#if defined __NR_mmap && \ -( defined __arm__ \ - || defined __i386__ \ - || (defined __s390__ && !defined __s390x__) \ -) +#if defined __NR_mmap \ + && (defined __arm__ || defined __i386__ || defined __m68k__ \ + || defined __s390__ || defined __s390x__) \ + && (defined PATH_TRACING || !(defined __s390x__ || defined __m68k__)) # include # include # include # include +# ifndef TEST_FD +# define TEST_FD -2LU +# endif + int main(void) { long rc = syscall(__NR_mmap, 0); +# ifndef PATH_TRACING printf("mmap(NULL) = %ld %s (%m)\n", rc, errno2name()); +# endif - const unsigned int args1_c[6] = { - 0xdeadbeef, /* addr */ - 0xfacefeed, /* len */ + const unsigned long args1_c[6] = { + (unsigned long) 0xbadc0deddeadbeefULL, /* addr */ + (unsigned long) 0xdeefacedfacefeedULL, /* len */ PROT_READ|PROT_EXEC, /* prot */ MAP_FILE|MAP_FIXED, /* flags */ - -2U, /* fd */ - 0xbadc0ded /* offset */ + TEST_FD, /* fd */ + (unsigned long) 0xdecaffedbadc0dedULL /* offset */ }; - const unsigned int page_size = get_page_size(); - const unsigned int args2_c[6] = { + const unsigned long page_size = get_page_size(); + const unsigned long args2_c[6] = { 0, page_size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, - -1U, - 0xfaced000 & -page_size + -1LU, + (unsigned long) 0xda7a1057faced000ULL & -page_size }; void *args = tail_memdup(args1_c, sizeof(args1_c)); rc = syscall(__NR_mmap, args); - printf("mmap(%#x, %u, PROT_READ|PROT_EXEC, MAP_FILE|MAP_FIXED" - ", %d, %#x) = %ld %s (%m)\n", - args1_c[0], args1_c[1], args1_c[4], args1_c[5], +# if XLAT_RAW + printf("mmap(%#lx, %lu, %#x, %#x, %d, %#lx) = %ld %s (%m)\n", + args1_c[0], args1_c[1], PROT_READ|PROT_EXEC, MAP_FILE | MAP_FIXED, + (int) args1_c[4], args1_c[5], rc, errno2name()); +# elif XLAT_VERBOSE + printf("mmap(%#lx, %lu, %#x /* PROT_READ|PROT_EXEC */" + ", %#x /* MAP_FILE|MAP_FIXED */, %d, %#lx) = %ld %s (%m)\n", + args1_c[0], args1_c[1], PROT_READ|PROT_EXEC, MAP_FILE | MAP_FIXED, + (int) args1_c[4], args1_c[5], rc, errno2name()); +# else + printf("mmap(%#lx, %lu, PROT_READ|PROT_EXEC, MAP_FILE|MAP_FIXED" + ", %d, %#lx) = %ld %s (%m)\n", + args1_c[0], args1_c[1], (int) args1_c[4], args1_c[5], rc, errno2name()); +# endif memcpy(args, args2_c, sizeof(args2_c)); rc = syscall(__NR_mmap, args); - printf("mmap(NULL, %u, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS" - ", %d, %#x) = %#lx\n", - args2_c[1], args2_c[4], args2_c[5], rc); +# ifndef PATH_TRACING +# if XLAT_RAW + printf("mmap(NULL, %lu, %#x, %#x, %d, %#lx) = %#lx\n", + args2_c[1], PROT_READ|PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, + (int) args2_c[4], args2_c[5], rc); +# elif XLAT_VERBOSE + printf("mmap(NULL, %lu, %#x /* PROT_READ|PROT_WRITE */" + ", %#x /* MAP_PRIVATE|MAP_ANONYMOUS */, %d, %#lx) = %#lx\n", + args2_c[1], PROT_READ|PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, + (int) args2_c[4], args2_c[5], rc); +# else + printf("mmap(NULL, %lu, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS" + ", %d, %#lx) = %#lx\n", + args2_c[1], (int) args2_c[4], args2_c[5], rc); +# endif +# endif void *addr = (void *) rc; if (mprotect(addr, page_size, PROT_NONE)) - perror_msg_and_fail("mprotect(%p, %u, PROT_NONE)", + perror_msg_and_fail("mprotect(%p, %lu, PROT_NONE)", addr, page_size); puts("+++ exited with 0 +++"); @@ -95,7 +105,9 @@ main(void) #else -SKIP_MAIN_UNDEFINED("__NR_mmap && (__arm__ || __i386__" - " || (__s390__ && !__s390x__))") +SKIP_MAIN_UNDEFINED("defined __NR_mmap " + "&& (defined __arm__ || defined __i386__ || defined __m68k__ " + "|| defined __s390__ || defined __s390x__) " + "&& (defined PATH_TRACING || !(defined __s390x__ || defined __m68k__))") #endif diff --git a/tests-mx32/old_mmap.gen.test b/tests-mx32/old_mmap.gen.test new file mode 100755 index 00000000..1913eec2 --- /dev/null +++ b/tests-mx32/old_mmap.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (old_mmap -a11 -e trace=mmap); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=mmap diff --git a/tests-mx32/old_mmap.test b/tests-mx32/old_mmap.test deleted file mode 100755 index af776ff7..00000000 --- a/tests-mx32/old_mmap.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of "old mmap" edition of mmap syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a11 -e trace=mmap diff --git a/tests-mx32/oldfstat.c b/tests-mx32/oldfstat.c index f5a94416..c2624777 100644 --- a/tests-mx32/oldfstat.c +++ b/tests-mx32/oldfstat.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/oldfstat.gen.test b/tests-mx32/oldfstat.gen.test new file mode 100755 index 00000000..2b48b397 --- /dev/null +++ b/tests-mx32/oldfstat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (oldfstat -a18 -v -P stat.sample); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 -v -P stat.sample diff --git a/tests-mx32/oldfstat.test b/tests-mx32/oldfstat.test deleted file mode 100755 index 66a10561..00000000 --- a/tests-mx32/oldfstat.test +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -# Check oldfstat syscall decoding. - -. "${srcdir=.}/init.sh" - -# strace -P is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - -syscall=$NAME -run_prog > /dev/null -sample=$syscall.sample -> "$sample" -run_strace -ve$syscall -P$sample -a21 $args > "$OUT" -match_diff "$LOG" "$OUT" -rm -f "$OUT" - -exit 0 diff --git a/tests-mx32/oldlstat.c b/tests-mx32/oldlstat.c index 66132370..0444b17f 100644 --- a/tests-mx32/oldlstat.c +++ b/tests-mx32/oldlstat.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/oldlstat.gen.test b/tests-mx32/oldlstat.gen.test new file mode 100755 index 00000000..3202b924 --- /dev/null +++ b/tests-mx32/oldlstat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (oldlstat -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests-mx32/oldlstat.test b/tests-mx32/oldlstat.test deleted file mode 100755 index a0f9ab93..00000000 --- a/tests-mx32/oldlstat.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check oldlstat syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests-mx32/oldselect-P.c b/tests-mx32/oldselect-P.c new file mode 100644 index 00000000..67e21343 --- /dev/null +++ b/tests-mx32/oldselect-P.c @@ -0,0 +1,2 @@ +#define PATH_TRACING_FD 9 +#include "oldselect.c" diff --git a/tests-mx32/oldselect-P.gen.test b/tests-mx32/oldselect-P.gen.test new file mode 100755 index 00000000..3486ffd6 --- /dev/null +++ b/tests-mx32/oldselect-P.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (oldselect-P -a13 -e trace=select -P /dev/full 9>>/dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 -e trace=select -P /dev/full 9>>/dev/full diff --git a/tests-mx32/oldselect-efault-P.c b/tests-mx32/oldselect-efault-P.c new file mode 100644 index 00000000..9ebf73d2 --- /dev/null +++ b/tests-mx32/oldselect-efault-P.c @@ -0,0 +1,2 @@ +#define PATH_TRACING_FD 9 +#include "oldselect-efault.c" diff --git a/tests-mx32/oldselect-efault-P.gen.test b/tests-mx32/oldselect-efault-P.gen.test new file mode 100755 index 00000000..a3d71768 --- /dev/null +++ b/tests-mx32/oldselect-efault-P.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (oldselect-efault-P -a13 -e trace=select -P /dev/full 9>>/dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 -e trace=select -P /dev/full 9>>/dev/full diff --git a/tests-mx32/oldselect-efault.c b/tests-mx32/oldselect-efault.c new file mode 100644 index 00000000..4e927521 --- /dev/null +++ b/tests-mx32/oldselect-efault.c @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#if defined __NR_select && defined __NR__newselect \ + && __NR_select != __NR__newselect \ + && !defined __sparc__ + +# include +# include +# include +# include +# include + +static const char *errstr; + +static long +xselect(const kernel_ulong_t args) +{ + static const kernel_ulong_t dummy = F8ILL_KULONG_MASK | 0xfacefeed; + long rc = syscall(__NR_select, args, dummy, dummy, dummy, dummy, dummy); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + unsigned long *const args = tail_alloc(sizeof(*args) * 4); + memset(args, 0, sizeof(*args) * 4); + + xselect(0); +# ifndef PATH_TRACING_FD + printf("select(NULL) = %s\n", errstr); +# endif + + xselect((uintptr_t) args); +# ifndef PATH_TRACING_FD + printf("select(%p) = %s\n", args, errstr); +# endif + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_select && __NR__newselect" + " && __NR_select != __NR__newselect" + " && !defined __sparc__") + +#endif diff --git a/tests-mx32/oldselect-efault.gen.test b/tests-mx32/oldselect-efault.gen.test new file mode 100755 index 00000000..bfeb5571 --- /dev/null +++ b/tests-mx32/oldselect-efault.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (oldselect-efault -a13 -e trace=select); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 -e trace=select diff --git a/tests-mx32/oldselect.c b/tests-mx32/oldselect.c index 7413fc33..0af35541 100644 --- a/tests-mx32/oldselect.c +++ b/tests-mx32/oldselect.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -30,37 +10,38 @@ #if defined __NR_select && defined __NR__newselect \ && __NR_select != __NR__newselect \ - && !defined SPARC - -# include -# include + && !defined __sparc__ -int -main(void) -{ - int fds[2]; - fd_set r = {}, w = {}; - struct timeval timeout = { .tv_sec = 0, .tv_usec = 42 }; - long args[] = { - 2, (long) &r, (long) &w, 0, (long) &timeout, - 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded, 0xdeadbeef - }; +# define TEST_SYSCALL_NR __NR_select +# define TEST_SYSCALL_STR "select" +# define xselect xselect +# include "xselect.c" - (void) close(0); - (void) close(1); - if (pipe(fds)) - perror_msg_and_fail("pipe"); +static uint32_t *args; - FD_SET(0, &w); - FD_SET(1, &r); - if (syscall(__NR_select, args)) - perror_msg_and_skip("select"); - - return 0; +static long +xselect(const kernel_ulong_t nfds, + const kernel_ulong_t rs, + const kernel_ulong_t ws, + const kernel_ulong_t es, + const kernel_ulong_t tv) +{ + if (!args) + args = tail_alloc(sizeof(*args) * 5); + args[0] = nfds; + args[1] = rs; + args[2] = ws; + args[3] = es; + args[4] = tv; + long rc = syscall(TEST_SYSCALL_NR, args); + errstr = sprintrc(rc); + return rc; } #else -SKIP_MAIN_UNDEFINED("__NR_select && __NR__newselect") +SKIP_MAIN_UNDEFINED("__NR_select && __NR__newselect" + " && __NR_select != __NR__newselect" + " && !defined __sparc__") #endif diff --git a/tests-mx32/oldselect.expected b/tests-mx32/oldselect.expected deleted file mode 100644 index d6e7f3c4..00000000 --- a/tests-mx32/oldselect.expected +++ /dev/null @@ -1,2 +0,0 @@ -select(2, [1], [0], NULL, {tv_sec=0, tv_usec=42}) = 0 (Timeout) -+++ exited with 0 +++ diff --git a/tests-mx32/oldselect.gen.test b/tests-mx32/oldselect.gen.test new file mode 100755 index 00000000..1f10cbe3 --- /dev/null +++ b/tests-mx32/oldselect.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (oldselect -a13 -e trace=select); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 -e trace=select diff --git a/tests-mx32/oldselect.test b/tests-mx32/oldselect.test deleted file mode 100755 index 35661ad4..00000000 --- a/tests-mx32/oldselect.test +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# Check old select syscall decoding. - -. "${srcdir=.}/init.sh" - -run_prog -run_strace -a34 -eselect $args -match_diff - -exit 0 diff --git a/tests-mx32/oldstat.c b/tests-mx32/oldstat.c index d06e2bc6..03b40335 100644 --- a/tests-mx32/oldstat.c +++ b/tests-mx32/oldstat.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/oldstat.gen.test b/tests-mx32/oldstat.gen.test new file mode 100755 index 00000000..f265ac56 --- /dev/null +++ b/tests-mx32/oldstat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (oldstat -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests-mx32/oldstat.test b/tests-mx32/oldstat.test deleted file mode 100755 index 42d70f7f..00000000 --- a/tests-mx32/oldstat.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check oldstat syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests-mx32/open.c b/tests-mx32/open.c index 01e89b0f..43a3ae68 100644 --- a/tests-mx32/open.c +++ b/tests-mx32/open.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -30,7 +11,7 @@ #ifdef __NR_open -# include +# include # include # include @@ -56,16 +37,11 @@ main(void) sample, sprintrc(fd)); } -#ifdef O_TMPFILE -# if O_TMPFILE == (O_TMPFILE & ~O_DIRECTORY) -# define STR_O_TMPFILE "O_TMPFILE" -# else -# define STR_O_TMPFILE "O_DIRECTORY|O_TMPFILE" -# endif +# ifdef O_TMPFILE fd = syscall(__NR_open, sample, O_WRONLY|O_TMPFILE, 0600); - printf("open(\"%s\", O_WRONLY|%s, 0600) = %s\n", - sample, STR_O_TMPFILE, sprintrc(fd)); -#endif /* O_TMPFILE */ + printf("open(\"%s\", O_WRONLY|O_TMPFILE, 0600) = %s\n", + sample, sprintrc(fd)); +# endif /* O_TMPFILE */ puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/open.gen.test b/tests-mx32/open.gen.test new file mode 100755 index 00000000..eb931a34 --- /dev/null +++ b/tests-mx32/open.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (open -a30 -P $NAME.sample); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 -P $NAME.sample diff --git a/tests-mx32/open.test b/tests-mx32/open.test deleted file mode 100755 index 6df19cb8..00000000 --- a/tests-mx32/open.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check open syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a30 -P $NAME.sample diff --git a/tests-mx32/openat.c b/tests-mx32/openat.c index 1d6765cf..d4a74178 100644 --- a/tests-mx32/openat.c +++ b/tests-mx32/openat.c @@ -1,44 +1,44 @@ /* * Copyright (c) 2016 Katerina Koukiou + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include -#if defined __NR_openat +#ifdef __NR_openat -# include +# include # include # include +# ifdef O_TMPFILE +/* The kernel & C libraries often inline O_DIRECTORY. */ +# define STRACE_O_TMPFILE (O_TMPFILE & ~O_DIRECTORY) +# else +# define STRACE_O_TMPFILE 0 +# endif + +static const char sample[] = "openat.sample"; + +static void +test_mode_flag(unsigned int mode_val, const char *mode_str, + unsigned int flag_val, const char *flag_str) +{ + long rc = syscall(__NR_openat, -1, sample, mode_val | flag_val, 0); + printf("openat(-1, \"%s\", %s%s%s%s) = %s\n", + sample, mode_str, + flag_val ? "|" : "", flag_str, + flag_val & (O_CREAT | STRACE_O_TMPFILE) ? ", 000" : "", + sprintrc(rc)); +} + int main(void) { - static const char sample[] = "openat.sample"; - long fd = syscall(__NR_openat, -100, sample, O_RDONLY|O_CREAT, 0400); printf("openat(AT_FDCWD, \"%s\", O_RDONLY|O_CREAT, 0400) = %s\n", sample, sprintrc(fd)); @@ -53,6 +53,54 @@ main(void) sample, sprintrc(fd)); } + struct { + unsigned int val; + const char *str; + } modes[] = { + { ARG_STR(O_RDONLY) }, + { ARG_STR(O_WRONLY) }, + { ARG_STR(O_RDWR) }, + { ARG_STR(O_ACCMODE) } + }, flags[] = { + { ARG_STR(O_APPEND) }, + { ARG_STR(O_DIRECT) }, + { ARG_STR(O_DIRECTORY) }, + { ARG_STR(O_EXCL) }, + { ARG_STR(O_LARGEFILE) }, + { ARG_STR(O_NOATIME) }, + { ARG_STR(O_NOCTTY) }, + { ARG_STR(O_NOFOLLOW) }, + { ARG_STR(O_NONBLOCK) }, + { ARG_STR(O_SYNC) }, + { ARG_STR(O_TRUNC) }, + { ARG_STR(O_CREAT) }, +# ifdef O_CLOEXEC + { ARG_STR(O_CLOEXEC) }, +# endif +# ifdef O_DSYNC + { ARG_STR(O_DSYNC) }, +# endif +# ifdef __O_SYNC + { ARG_STR(__O_SYNC) }, +# endif +# ifdef O_PATH + { ARG_STR(O_PATH) }, +# endif +# ifdef O_TMPFILE + { ARG_STR(O_TMPFILE) }, +# endif +# ifdef __O_TMPFILE + { ARG_STR(__O_TMPFILE) }, +# endif + { ARG_STR(0x80000000) }, + { 0, "" } + }; + + for (unsigned int m = 0; m < ARRAY_SIZE(modes); ++m) + for (unsigned int f = 0; f < ARRAY_SIZE(flags); ++f) + test_mode_flag(modes[m].val, modes[m].str, + flags[f].val, flags[f].str); + puts("+++ exited with 0 +++"); return 0; } diff --git a/tests-mx32/openat.gen.test b/tests-mx32/openat.gen.test new file mode 100755 index 00000000..29dd3491 --- /dev/null +++ b/tests-mx32/openat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (openat -a36 -P $NAME.sample); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 -P $NAME.sample diff --git a/tests-mx32/openat.test b/tests-mx32/openat.test deleted file mode 100755 index 68c4cee1..00000000 --- a/tests-mx32/openat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check openat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -P $NAME.sample diff --git a/tests-mx32/opipe.test b/tests-mx32/opipe.test index 90e6838a..d6777250 100755 --- a/tests-mx32/opipe.test +++ b/tests-mx32/opipe.test @@ -1,16 +1,19 @@ #!/bin/sh - +# # Check how -o '|pipe' works. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" check_prog grep -run_prog grep chdir $srcdir/umovestr.expected > "$EXP" -run_prog ./umovestr +grep chdir $srcdir/umovestr.expected > "$EXP" +run_prog ../umovestr -> "$LOG" || fail_ "failed to write $LOG" $STRACE -o "|cat > $LOG && $SLEEP_A_BIT && grep chdir < $LOG > $OUT" -e chdir $args || dump_log_and_fail_with "$STRACE $args failed" match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/options-syntax.test b/tests-mx32/options-syntax.test index 592b0e03..5e43b3ab 100755 --- a/tests-mx32/options-syntax.test +++ b/tests-mx32/options-syntax.test @@ -3,62 +3,12 @@ # Check strace options syntax. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (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" +# SPDX-License-Identifier: GPL-2.0-or-later -check_exit_status_and_stderr() -{ - $STRACE "$@" 2> "$LOG" && - dump_log_and_fail_with \ - "strace $* failed to handle the error properly" - match_diff "$LOG" "$EXP" || - dump_log_and_fail_with \ - "strace $* failed to print expected diagnostics" -} - -strace_exp="${STRACE##* }" - -check_e() -{ - local pattern="$1"; shift - cat > "$EXP" << __EOF__ -$strace_exp: $pattern -__EOF__ - check_exit_status_and_stderr "$@" -} - -check_h() -{ - local pattern="$1"; shift - cat > "$EXP" << __EOF__ -$strace_exp: $pattern -Try '$strace_exp -h' for more information. -__EOF__ - check_exit_status_and_stderr "$@" -} +. "${srcdir=.}/syntax.sh" check_e "Invalid process id: '0'" -p 0 check_e "Invalid process id: '-42'" -p -42 @@ -67,26 +17,10 @@ check_e "Invalid process id: 'a'" -p 1,a check_e "Syscall 'chdir' for -b isn't supported" -b chdir check_e "Syscall 'chdir' for -b isn't supported" -b execve -b chdir -check_e "invalid system call '-1'" -e-1 -check_e "invalid system call '-2'" -e -2 -check_e "invalid system call '-3'" -etrace=-3 -check_e "invalid system call '-4'" -e trace=-4 -check_e "invalid system call '-5'" -e trace=1,-5 -check_e "invalid system call '2147483647'" -e 2147483647 -check_e "invalid system call '2147483648'" -e 2147483648 -check_e "invalid system call '4294967295'" -e 4294967295 -check_e "invalid system call '4294967296'" -e 4294967296 +check_e_using_grep 'exec: File *name too long' "$(printf '%4096s' ' ')" -check_e "invalid descriptor '-1'" -eread=-1 -check_e "invalid descriptor '-42'" -ewrite=-42 -check_e "invalid descriptor '2147483648'" -eread=2147483648 -check_e "invalid descriptor '4294967296'" -ewrite=4294967296 -check_e "invalid descriptor 'foo'" -eread=foo -check_e "invalid descriptor ''" -ewrite= -check_e "invalid descriptor ','" -eread=, -check_e "invalid descriptor '!'" -ewrite='!' -check_e "invalid descriptor '!'" -eread='0,!' -check_e "invalid descriptor '!,'" -ewrite='!,' +ff_name="$(printf '%4084s' ' ')" +check_e_using_grep "$ff_name: File *name too long" -ff -o "$ff_name" true check_h 'must have PROG [ARGS] or -p PID' check_h 'PROG [ARGS] must be specified with -D' -D -p $$ @@ -100,10 +34,63 @@ check_h 'piping the output and -ff are mutually exclusive' -o '!' -ff true check_h "invalid -a argument: '-42'" -a -42 check_h "invalid -O argument: '-42'" -O -42 check_h "invalid -s argument: '-42'" -s -42 +check_h "invalid -s argument: '1073741824'" -s 1073741824 check_h "invalid -I argument: '5'" -I 5 +check_h "invalid -X argument: 'test'" -Xtest +check_h "invalid -X argument: 'a'" -Xa +check_h "invalid -X argument: 'abbreviated'" -X abbreviated + +check_h "incorrect personality designator '' in qualification 'getcwd@'" -e trace=getcwd@ +check_h "incorrect personality designator '42' in qualification 'getcwd@42'" -e trace=getcwd@42 +check_h "incorrect personality designator '42' in qualification 'getcwd@42'" -e trace=gettid,getcwd@42 +check_h "incorrect personality designator '42' in qualification '23@42'" -e trace=23@42,123 + +check_e "invalid system call '/getcwd@ohmy'" -e trace=/getcwd@ohmy +check_e "invalid -e kvm= argument: 'chdir'" -e kvm=chdir + +case "$STRACE_NATIVE_ARCH" in +x86_64) + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@64 + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@32 + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@x32 + ;; +x32) + check_h "incorrect personality designator '64' in qualification 'getcwd@64'" -e trace=getcwd@64 + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@32 + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@x32 + ;; +aarch64|powerpc64|riscv|s390x|sparc64|tile) + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@64 + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@32 + check_h "incorrect personality designator 'x32' in qualification 'getcwd@x32'" -e trace=getcwd@x32 + ;; +*) + pers="$((SIZEOF_LONG * 8))" + inv_pers="$((96 - pers))" + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@"$pers" + check_h "incorrect personality designator '$inv_pers' in qualification 'getcwd@$inv_pers'" -e trace=getcwd@"$inv_pers" + check_h "incorrect personality designator 'x32' in qualification 'getcwd@x32'" -e trace=getcwd@x32 +esac + +../zeroargc "$STRACE_EXE" /bin/true 2> "$LOG" && + dump_log_and_fail_with \ + 'zeroargc strace failed to handle the error properly' +cat > "$EXP" << __EOF__ +$STRACE_EXE: must have PROG [ARGS] or -p PID +Try '$STRACE_EXE -h' for more information. +__EOF__ +diff -u -- "$EXP" "$LOG" > /dev/null || { + cat > "$EXP" <<- '__EOF__' + strace: must have PROG [ARGS] or -p PID + Try 'strace -h' for more information. + __EOF__ + match_diff "$LOG" "$EXP" \ + "zeroargc $STRACE $args output mismatch" +} -if [ -n "${UID-}" ]; then - if [ "${UID-}" = 0 ]; then +uid="${UID:-`id -u`}" +if [ "$uid" -ge 0 ]; then + if [ "$uid" -eq 0 ]; then umsg="Cannot find user ':nosuchuser:'" else umsg='You must be root to use the -u option' @@ -113,17 +100,14 @@ if [ -n "${UID-}" ]; then for c in i r t T y; do check_e "-$c has no effect with -c -$strace_exp: $umsg" -u :nosuchuser: -c -$c true +$STRACE_EXE: $umsg" -u :nosuchuser: -c -$c true done check_e "-i has no effect with -c -$strace_exp: -r has no effect with -c -$strace_exp: -t has no effect with -c -$strace_exp: -T has no effect with -c -$strace_exp: -y has no effect with -c -$strace_exp: $umsg" -u :nosuchuser: -cirtTy true - - check_e "-tt has no effect with -r -$strace_exp: $umsg" -u :nosuchuser: -r -tt true +$STRACE_EXE: -r has no effect with -c +$STRACE_EXE: -t has no effect with -c +$STRACE_EXE: -T has no effect with -c +$STRACE_EXE: -y has no effect with -c +$STRACE_EXE: $umsg" -u :nosuchuser: -cirtTy true fi args='-p 2147483647' @@ -133,7 +117,7 @@ $STRACE $args 2> "$LOG" && for cmd in PTRACE_SEIZE PTRACE_ATTACH; do cat > "$EXP" << __EOF__ -$strace_exp: attach: ptrace($cmd, 2147483647): No such process +$STRACE_EXE: attach: ptrace($cmd, 2147483647): No such process __EOF__ diff -- "$EXP" "$LOG" || continue @@ -144,5 +128,3 @@ done [ -z "$args" ] || dump_log_and_fail_with \ "strace $args failed to print expected diagnostics" - -rm -f "$EXP" diff --git a/tests-mx32/orphaned_process_group.c b/tests-mx32/orphaned_process_group.c new file mode 100644 index 00000000..83ab6e39 --- /dev/null +++ b/tests-mx32/orphaned_process_group.c @@ -0,0 +1,155 @@ +/* + * Check tracing of orphaned process group. + * + * Copyright (c) 2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +#define TIMEOUT 5 + +static void +alarm_handler(const int no) +{ + error_msg_and_skip("Orphaned process group semantics" + " is not supported by the kernel"); +} + +int +main(void) +{ + int status; + + /* + * Unblock all signals. + */ + static sigset_t mask; + if (sigprocmask(SIG_SETMASK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + /* + * Create a pipe to track termination of processes. + */ + int pipe_fds[2]; + if (pipe(pipe_fds)) + perror_msg_and_fail("pipe"); + + /* + * Create a leader for its own new process group. + */ + pid_t leader = fork(); + if (leader < 0) + perror_msg_and_fail("fork"); + + if (leader) { + /* + * Close the writing end of the pipe. + */ + close(pipe_fds[1]); + + /* + * Install the SIGALRM signal handler. + */ + static const struct sigaction sa = { + .sa_handler = alarm_handler + }; + if (sigaction(SIGALRM, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + /* + * Set an alarm clock. + */ + alarm(TIMEOUT); + + /* + * Wait for termination of the child process. + */ + if (waitpid(leader, &status, 0) != leader) + perror_msg_and_fail("waitpid leader"); + if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) + error_msg_and_fail("waitpid leader: " + "unexpected wait status %d", + status); + + /* + * Wait for termination of all processes + * in the process group of the child process. + */ + if (read(pipe_fds[0], &status, sizeof(status)) != 0) + perror_msg_and_fail("read"); + + /* + * At this point all processes are gone. + * Let the tracer time to catch up. + */ + alarm(0); + sleep(1); + return 0; + } + + /* + * Close the reading end of the pipe. + */ + close(pipe_fds[0]); + + /* + * Create a new process group. + */ + if (setpgid(0, 0)) + perror_msg_and_fail("setpgid"); + + /* + * When the leader process terminates, the process group becomes orphaned. + * If any member of the orphaned process group is stopped, then + * a SIGHUP signal followed by a SIGCONT signal is sent to each process + * in the orphaned process group. + * Create a process in a stopped state to activate this behaviour. + */ + const pid_t stopped = fork(); + if (stopped < 0) + perror_msg_and_fail("fork"); + if (!stopped) { + static const struct sigaction sa = { .sa_handler = SIG_DFL }; + if (sigaction(SIGHUP, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + raise(SIGSTOP); + _exit(0); + } + + /* + * Wait for the process to stop. + */ + if (waitpid(stopped, &status, WUNTRACED) != stopped) + perror_msg_and_fail("waitpid WUNTRACED"); + if (!WIFSTOPPED(status) || WSTOPSIG(status) != SIGSTOP) + error_msg_and_fail("unexpected wait status %d", status); + + /* + * Print the expected output. + */ + leader = getpid(); + printf("%-5d --- %s {si_signo=%s, si_code=SI_TKILL" + ", si_pid=%d, si_uid=%u} ---\n", + stopped, "SIGSTOP", "SIGSTOP", stopped, geteuid()); + printf("%-5d --- stopped by SIGSTOP ---\n", stopped); + printf("%-5d +++ exited with 0 +++\n", leader); + printf("%-5d --- %s {si_signo=%s, si_code=SI_KERNEL} ---\n", + stopped, "SIGHUP", "SIGHUP"); + printf("%-5d +++ killed by %s +++\n", stopped, "SIGHUP"); + printf("%-5d +++ exited with 0 +++\n", getppid()); + + /* + * Make the process group orphaned. + */ + return 0; +} diff --git a/tests-mx32/orphaned_process_group.gen.test b/tests-mx32/orphaned_process_group.gen.test new file mode 100755 index 00000000..c000fd5f --- /dev/null +++ b/tests-mx32/orphaned_process_group.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (orphaned_process_group . "${srcdir=.}/PTRACE_SEIZE.sh"; run_strace_match_diff -f -e trace=none -e signal='!chld'); do not edit. +. "${srcdir=.}/init.sh" +. "${srcdir=.}/PTRACE_SEIZE.sh"; run_strace_match_diff -f -e trace=none -e signal='!chld' diff --git a/tests-mx32/osf_utimes.c b/tests-mx32/osf_utimes.c new file mode 100644 index 00000000..d721e394 --- /dev/null +++ b/tests-mx32/osf_utimes.c @@ -0,0 +1,25 @@ +/* + * Check decoding of osf_utimes syscall. + * + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_osf_utimes + +# define TEST_SYSCALL_NR __NR_osf_utimes +# define TEST_SYSCALL_STR "osf_utimes" +# define TEST_STRUCT struct timeval32 +struct timeval32 { int tv_sec, tv_usec; }; +# include "xutimes.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_osf_utimes") + +#endif diff --git a/tests-mx32/osf_utimes.gen.test b/tests-mx32/osf_utimes.gen.test new file mode 100755 index 00000000..9e683b47 --- /dev/null +++ b/tests-mx32/osf_utimes.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (osf_utimes -a21 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests-mx32/overflowuid.c b/tests-mx32/overflowuid.c index a3c742b4..6a7a8f93 100644 --- a/tests-mx32/overflowuid.c +++ b/tests-mx32/overflowuid.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2014-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/pause.c b/tests-mx32/pause.c index 86873620..0260a6bc 100644 --- a/tests-mx32/pause.c +++ b/tests-mx32/pause.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Fei Jie + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/pause.gen.test b/tests-mx32/pause.gen.test new file mode 100755 index 00000000..76492b6c --- /dev/null +++ b/tests-mx32/pause.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pause -a8 -esignal=none); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 -esignal=none diff --git a/tests-mx32/pause.test b/tests-mx32/pause.test deleted file mode 100755 index c5fdacde..00000000 --- a/tests-mx32/pause.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of pause syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a8 -esignal=none diff --git a/tests-mx32/pc.c b/tests-mx32/pc.c index f53acd45..0bc28d18 100644 --- a/tests-mx32/pc.c +++ b/tests-mx32/pc.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/pc.test b/tests-mx32/pc.test index beadb7d7..40221e57 100755 --- a/tests-mx32/pc.test +++ b/tests-mx32/pc.test @@ -3,29 +3,10 @@ # Check -i option. # # Copyright (c) 2015 Dmitry V. Levin +# Copyright (c) 2015-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -47,15 +28,11 @@ addr="$(echo "$ip" |sed -r 's/^0+//')" && [ -n "$addr" ] || dump_log_and_fail_with -EXPECTED="$LOG.expected" -cat > "$EXPECTED" << __EOF__ +cat > "$EXP" << __EOF__ \\[[[:xdigit:]]{$len}\\] munmap\\(0x[[:xdigit:]]+, 0\\) += -1 .* \\[pid +$pid\\] \\[$ip\\] --- SIGSEGV \\{si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x$addr\\} --- \\[pid +$pid\\] \\[\\?{$len}\\] \\+\\+\\+ killed by SIGSEGV( \\(core dumped\\))? \\+\\+\\+ \\[\\?{$len}\\] \\+\\+\\+ exited with 0 \\+\\+\\+ __EOF__ -match_grep "$LOG" "$EXPECTED" -rm -f "$EXPECTED" - -exit 0 +match_grep "$LOG" "$EXP" diff --git a/tests-mx32/perf_event_open.c b/tests-mx32/perf_event_open.c index 0ffea292..ae38b6de 100644 --- a/tests-mx32/perf_event_open.c +++ b/tests-mx32/perf_event_open.c @@ -2,29 +2,10 @@ * Check verbose decoding of perf_event_open syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -34,7 +15,6 @@ # include # include -# include # include # include # include @@ -72,36 +52,37 @@ struct u64_val_str { const char *str; }; -/* In order to avoid endianess-specific hackery */ +/* In order to avoid endianness-specific hackery. */ struct pea_flags { - uint64_t disabled :1, - inherit :1, - pinned :1, - exclusive :1, - exclude_user :1, - exclude_kernel :1, - exclude_hv :1, - exclude_idle :1, - mmap :1, - comm :1, - freq :1, - inherit_stat :1, - enable_on_exec :1, - task :1, - watermark :1, - precise_ip :2, - mmap_data :1, - sample_id_all :1, - exclude_host :1, - exclude_guest :1, - exclude_callchain_kernel :1, - exclude_callchain_user :1, - mmap2 :1, - comm_exec :1, - use_clockid :1, - context_switch :1, - write_backward :1, - __reserved_1 :36; + uint64_t disabled :1, + inherit :1, + pinned :1, + exclusive :1, + exclude_user :1, + exclude_kernel :1, + exclude_hv :1, + exclude_idle :1, + mmap :1, + comm :1, + freq :1, + inherit_stat :1, + enable_on_exec :1, + task :1, + watermark :1, + precise_ip :2, + mmap_data :1, + sample_id_all :1, + exclude_host :1, + exclude_guest :1, + exclude_callchain_kernel :1, + exclude_callchain_user :1, + mmap2 :1, + comm_exec :1, + use_clockid :1, + context_switch :1, + write_backward :1, + namespaces :1, + __reserved_1 :35; }; static const char * @@ -255,104 +236,112 @@ print_event_attr(struct perf_event_attr *attr_ptr, size_t size, flags_data.raw = ((uint64_t *) attr)[5]; val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_PRECISE_IP +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_PRECISE_IP attr->precise_ip; -# else +# else flags_data.flags.precise_ip; -# endif +# endif printf(", precise_ip=%" PRIu64 " /* %s */", val, precise_ip_desc); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP_DATA +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP_DATA attr->mmap_data; -# else +# else flags_data.flags.mmap_data; -# endif +# endif printf(", mmap_data=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_ID_ALL +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_ID_ALL attr->sample_id_all; -# else +# else flags_data.flags.sample_id_all; -# endif +# endif printf(", sample_id_all=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_HOST +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_HOST attr->exclude_host; -# else +# else flags_data.flags.exclude_host; -# endif +# endif printf(", exclude_host=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_GUEST +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_GUEST attr->exclude_guest; -# else +# else flags_data.flags.exclude_guest; -# endif +# endif printf(", exclude_guest=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_KERNEL +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_KERNEL attr->exclude_callchain_kernel; -# else +# else flags_data.flags.exclude_callchain_kernel; -# endif +# endif printf(", exclude_callchain_kernel=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_USER +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_USER attr->exclude_callchain_user; -# else +# else flags_data.flags.exclude_callchain_user; -# endif +# endif printf(", exclude_callchain_user=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP2 +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP2 attr->mmap2; -# else +# else flags_data.flags.mmap2; -# endif +# endif printf(", mmap2=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_COMM_EXEC +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_COMM_EXEC attr->comm_exec; -# else +# else flags_data.flags.comm_exec; -# endif +# endif printf(", comm_exec=%" PRIu64, val); use_clockid = val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_USE_CLOCKID +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_USE_CLOCKID attr->use_clockid; -# else +# else flags_data.flags.use_clockid; -# endif +# endif printf(", use_clockid=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONTEXT_SWITCH +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONTEXT_SWITCH attr->context_switch; -# else +# else flags_data.flags.context_switch; -# endif +# endif printf(", context_switch=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_WRITE_BACKWARD +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_WRITE_BACKWARD attr->write_backward; -# else +# else flags_data.flags.write_backward; -# endif +# endif printf(", write_backward=%" PRIu64, val); + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_NAMESPACES + attr->namespaces; +# else + flags_data.flags.namespaces; +# endif + printf(", namespaces=%" PRIu64, val); + val = flags_data.flags.__reserved_1; if (val) - printf(", __reserved_1=%#" PRIx64 " /* Bits 63..28 */", val); + printf(", __reserved_1=%#" PRIx64 " /* Bits 63..29 */", val); printf(", %s=%u", attr->watermark ? "wakeup_watermark" : "wakeup_events", @@ -362,11 +351,11 @@ print_event_attr(struct perf_event_attr *attr_ptr, size_t size, printf(", bp_type=%s", bp_type); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG1 +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG1 attr->config1; -# else +# else ((uint64_t *) attr)[56 / sizeof(uint64_t)]; -# endif +# endif printf(", %s=%#" PRIx64, attr->type == PERF_TYPE_BREAKPOINT ? "bp_addr" : "config1", val); @@ -378,11 +367,11 @@ print_event_attr(struct perf_event_attr *attr_ptr, size_t size, } val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG2 +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG2 attr->config2; -# else +# else ((uint64_t *) attr)[64 / sizeof(uint64_t)]; -# endif +# endif if (attr->type == PERF_TYPE_BREAKPOINT) printf(", bp_len=%" PRIu64, val); else @@ -408,11 +397,11 @@ print_event_attr(struct perf_event_attr *attr_ptr, size_t size, } val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_USER +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_USER attr->sample_regs_user; -# else +# else ((uint64_t *) attr)[80 / sizeof(uint64_t)]; -# endif +# endif printf(", sample_regs_user=%#" PRIx64, val); if (size <= 88) { @@ -421,11 +410,11 @@ print_event_attr(struct perf_event_attr *attr_ptr, size_t size, } val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_STACK_USER +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_STACK_USER attr->sample_stack_user; -# else +# else ((uint32_t *) attr)[88 / sizeof(uint32_t)]; -# endif +# endif /* * Print branch sample type only in case PERF_SAMPLE_STACK_USER * is set in the sample_type field. @@ -448,42 +437,42 @@ print_event_attr(struct perf_event_attr *attr_ptr, size_t size, } val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_INTR +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_INTR attr->sample_regs_intr; -# else +# else ((uint64_t *) attr)[96 / sizeof(uint64_t)]; -# endif +# endif printf(", sample_regs_intr=%#" PRIx64, val); /* End of version 4 of the structure */ if (size <= 104) { - cutoff =104; + cutoff = 104; goto end; } val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_AUX_WATERMARK +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_AUX_WATERMARK attr->aux_watermark; -# else +# else ((uint32_t *) attr)[104 / sizeof(uint32_t)]; -# endif +# endif printf(", aux_watermark=%" PRIu32, (uint32_t) val); if (size <= 108) { - cutoff =108; + cutoff = 108; goto end; } val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_MAX_STACK +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_MAX_STACK attr->sample_max_stack; -# else +# else ((uint16_t *) attr)[108 / sizeof(uint16_t)]; -# endif +# endif printf(", sample_max_stack=%" PRIu16, (uint16_t) val); if (size <= 110) { - cutoff =110; + cutoff = 110; goto end; } @@ -522,7 +511,8 @@ end: "PERF_SAMPLE_BRANCH_IND_JUMP|" \ "PERF_SAMPLE_BRANCH_CALL|" \ "PERF_SAMPLE_BRANCH_NO_FLAGS|" \ - "PERF_SAMPLE_BRANCH_NO_CYCLES" + "PERF_SAMPLE_BRANCH_NO_CYCLES|" \ + "PERF_SAMPLE_BRANCH_TYPE_SAVE" int main(void) @@ -607,7 +597,7 @@ main(void) static const struct u64_val_str sample_types[] = { { ARG_STR(0) }, { 0x800, "PERF_SAMPLE_BRANCH_STACK" }, - { ARG_ULL_STR(0xdeadc0deda780000) " /* PERF_SAMPLE_??? */" }, + { ARG_ULL_STR(0xdeadc0deda700000) " /* PERF_SAMPLE_??? */" }, { 0xffffffffffffffffULL, "PERF_SAMPLE_IP|PERF_SAMPLE_TID|PERF_SAMPLE_TIME|" "PERF_SAMPLE_ADDR|PERF_SAMPLE_READ|" @@ -617,7 +607,8 @@ main(void) "PERF_SAMPLE_REGS_USER|PERF_SAMPLE_STACK_USER|" "PERF_SAMPLE_WEIGHT|PERF_SAMPLE_DATA_SRC|" "PERF_SAMPLE_IDENTIFIER|PERF_SAMPLE_TRANSACTION|" - "PERF_SAMPLE_REGS_INTR|0xfffffffffff80000" }, + "PERF_SAMPLE_REGS_INTR|PERF_SAMPLE_PHYS_ADDR|" + "0xfffffffffff00000" }, }; static const struct u64_val_str read_formats[] = { { ARG_STR(0) }, @@ -649,11 +640,11 @@ main(void) static const struct u64_val_str branch_sample_types[] = { { ARG_STR(0) }, { 0x80, "PERF_SAMPLE_BRANCH_ABORT_TX" }, - { 0xffff, BRANCH_TYPE_ALL }, - { ARG_ULL_STR(0xdeadcaffeeed0000) + { 0x1ffff, BRANCH_TYPE_ALL }, + { ARG_ULL_STR(0xdeadcaffeeec0000) " /* PERF_SAMPLE_BRANCH_??? */" }, { 0xffffffffffffffffULL, - BRANCH_TYPE_ALL "|0xffffffffffff0000" } + BRANCH_TYPE_ALL "|0xfffffffffffe0000" } }; static const struct s32_val_str clockids[] = { { 11, "CLOCK_TAI" }, @@ -681,7 +672,7 @@ main(void) ATTR_REC(attr_big_size), }; - struct perf_event_attr *small_attr = tail_alloc(sizeof(*small_attr)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct perf_event_attr, small_attr); struct { struct perf_event_attr *attr; @@ -717,7 +708,7 @@ main(void) for (i = 0; i < ARRAY_SIZE(args); i++) { rc = syscall(__NR_perf_event_open, args[i].attr, args[i].pid, - args[i].cpu, args[i].group_fd, args[i].flags); + args[i].cpu, args[i].group_fd, args[i].flags); printf("perf_event_open(%s, %d, %d, %d, %s) = %s\n", printaddr(args[i].attr), args[i].pid, args[i].cpu, args[i].group_fd, args[i].flags_str, sprintrc(rc)); @@ -792,19 +783,19 @@ main(void) attr->size = 0; rc = syscall(__NR_perf_event_open, attr, args[args_idx].pid, - args[args_idx].cpu, args[args_idx].group_fd, - args[args_idx].flags); + args[args_idx].cpu, args[args_idx].group_fd, + args[args_idx].flags); printf("perf_event_open("); print_event_attr(attr, i ? ((i == 1) ? 0 : size) : size + 8, - attr_types[type_idx].str, - attr_configs[type_idx][config_idx].str, - sample_types[sample_type_idx].str, - read_formats[read_format_idx].str, - ip_desc_str, - bp_types[bp_type_idx].str, - branch_sample_types[branch_sample_type_idx].str, - clockids[clockid_idx].str, size); + attr_types[type_idx].str, + attr_configs[type_idx][config_idx].str, + sample_types[sample_type_idx].str, + read_formats[read_format_idx].str, + ip_desc_str, + bp_types[bp_type_idx].str, + branch_sample_types[branch_sample_type_idx].str, + clockids[clockid_idx].str, size); printf(", %d, %d, %d, %s) = %s\n", args[args_idx].pid, args[args_idx].cpu, args[args_idx].group_fd, args[args_idx].flags_str, sprintrc(rc)); diff --git a/tests-mx32/perf_event_open.gen.test b/tests-mx32/perf_event_open.gen.test new file mode 100755 index 00000000..02d468ab --- /dev/null +++ b/tests-mx32/perf_event_open.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (perf_event_open -a1 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a1 diff --git a/tests-mx32/perf_event_open.test b/tests-mx32/perf_event_open.test deleted file mode 100755 index 499134b4..00000000 --- a/tests-mx32/perf_event_open.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# Check perf_event_open syscall decoding. - -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a1 diff --git a/tests-mx32/perf_event_open_nonverbose.c b/tests-mx32/perf_event_open_nonverbose.c index 45d7c8f2..b87cb2c6 100644 --- a/tests-mx32/perf_event_open_nonverbose.c +++ b/tests-mx32/perf_event_open_nonverbose.c @@ -2,29 +2,10 @@ * Check decoding of perf_event_open syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -41,11 +22,11 @@ # include "xlat.h" # include "xlat/perf_event_open_flags.h" -#if ULONG_MAX > UINT_MAX -#define LONG_STR_PREFIX "ffffffff" -#else -#define LONG_STR_PREFIX "" -#endif +# if ULONG_MAX > UINT_MAX +# define LONG_STR_PREFIX "ffffffff" +# else +# define LONG_STR_PREFIX "" +# endif static const char *printaddr(void *ptr) { @@ -62,7 +43,7 @@ static const char *printaddr(void *ptr) int main(void) { - struct perf_event_attr *attr = tail_alloc(sizeof(*attr)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct perf_event_attr, attr); attr->type = PERF_TYPE_HARDWARE; attr->size = sizeof(*attr); diff --git a/tests-mx32/perf_event_open_nonverbose.gen.test b/tests-mx32/perf_event_open_nonverbose.gen.test new file mode 100755 index 00000000..f1ed333e --- /dev/null +++ b/tests-mx32/perf_event_open_nonverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (perf_event_open_nonverbose -a34 -e verbose=none -e trace=perf_event_open); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a34 -e verbose=none -e trace=perf_event_open diff --git a/tests-mx32/perf_event_open_nonverbose.test b/tests-mx32/perf_event_open_nonverbose.test deleted file mode 100755 index 404827fe..00000000 --- a/tests-mx32/perf_event_open_nonverbose.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of perf_event_open syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a34 -e verbose=none -e trace=perf_event_open diff --git a/tests-mx32/perf_event_open_unabbrev.gen.test b/tests-mx32/perf_event_open_unabbrev.gen.test new file mode 100755 index 00000000..1d9bd851 --- /dev/null +++ b/tests-mx32/perf_event_open_unabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (perf_event_open_unabbrev -a1 -v -e trace=perf_event_open); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a1 -v -e trace=perf_event_open diff --git a/tests-mx32/perf_event_open_unabbrev.test b/tests-mx32/perf_event_open_unabbrev.test deleted file mode 100755 index f17fd17e..00000000 --- a/tests-mx32/perf_event_open_unabbrev.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# Check perf_event_open syscall decoding. - -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a1 -v -e trace=perf_event_open diff --git a/tests-mx32/personality-Xabbrev.c b/tests-mx32/personality-Xabbrev.c new file mode 100644 index 00000000..2e993dc1 --- /dev/null +++ b/tests-mx32/personality-Xabbrev.c @@ -0,0 +1 @@ +#include "personality.c" diff --git a/tests-mx32/personality-Xabbrev.gen.test b/tests-mx32/personality-Xabbrev.gen.test new file mode 100755 index 00000000..df93e6cb --- /dev/null +++ b/tests-mx32/personality-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (personality-Xabbrev +personality.test -Xabbrev); do not edit. +set -- -Xabbrev +. "${srcdir=.}/personality.test" diff --git a/tests-mx32/personality-Xraw.c b/tests-mx32/personality-Xraw.c new file mode 100644 index 00000000..59702f8b --- /dev/null +++ b/tests-mx32/personality-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "personality.c" diff --git a/tests-mx32/personality-Xraw.gen.test b/tests-mx32/personality-Xraw.gen.test new file mode 100755 index 00000000..559f0f3a --- /dev/null +++ b/tests-mx32/personality-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (personality-Xraw +personality.test -a15 -Xraw); do not edit. +set -- -a15 -Xraw +. "${srcdir=.}/personality.test" diff --git a/tests-mx32/personality-Xverbose.c b/tests-mx32/personality-Xverbose.c new file mode 100644 index 00000000..545ebe71 --- /dev/null +++ b/tests-mx32/personality-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "personality.c" diff --git a/tests-mx32/personality-Xverbose.gen.test b/tests-mx32/personality-Xverbose.gen.test new file mode 100755 index 00000000..b6ce2094 --- /dev/null +++ b/tests-mx32/personality-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (personality-Xverbose +personality.test -Xverbose); do not edit. +set -- -Xverbose +. "${srcdir=.}/personality.test" diff --git a/tests-mx32/personality.c b/tests-mx32/personality.c index 7a279a14..5169c1d4 100644 --- a/tests-mx32/personality.c +++ b/tests-mx32/personality.c @@ -1,78 +1,84 @@ /* * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include #include +#if XLAT_RAW +# define linux_type_str "0" +# define good_type_str "0x6" +# define bad_type_str "0x1f" +# define good_flags_str "0x7000000" +# define bad_flags_str "0x10000" +# define good_bad_flags_str "0x7010000" +#elif XLAT_VERBOSE +# define linux_type_str "0 /\\* PER_LINUX \\*/" +# define good_type_str "0x6 /\\* PER_BSD \\*/" +# define bad_type_str "0x1f /\\* PER_\\?\\?\\? \\*/" +# define good_flags_str \ + "0x7000000 /\\* SHORT_INODE\\|WHOLE_SECONDS\\|STICKY_TIMEOUTS \\*/" +# define bad_flags_str "0x10000" +# define good_bad_flags_str \ + "0x7010000 /\\* SHORT_INODE\\|WHOLE_SECONDS\\|STICKY_TIMEOUTS" \ + "\\|0x10000 \\*/" +#else +# define linux_type_str "PER_LINUX" +# define good_type_str "PER_BSD" +# define bad_type_str "0x1f /\\* PER_\\?\\?\\? \\*/" +# define good_flags_str "SHORT_INODE\\|WHOLE_SECONDS\\|STICKY_TIMEOUTS" +# define bad_flags_str "0x10000" +# define good_bad_flags_str \ + "SHORT_INODE\\|WHOLE_SECONDS\\|STICKY_TIMEOUTS\\|0x10000" +#endif + 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); + printf("personality\\(%s\\) = %#x \\([^)]*\\)\n", + linux_type_str, saved_pers); personality(0xffffffff); - puts("personality\\(0xffffffff\\) = 0 \\(PER_LINUX\\)"); + printf("personality\\(0xffffffff\\) = 0 \\(%s\\)\n", linux_type_str); personality(good_flags); - printf("personality\\(PER_LINUX\\|%s\\) = 0 \\(PER_LINUX\\)\n", - good_flags_str); + printf("personality\\(%s\\|%s\\) = 0 \\(%s\\)\n", + linux_type_str, good_flags_str, linux_type_str); personality(bad_flags); - printf("personality\\(PER_LINUX\\|%s\\)" - " = %#x \\(PER_LINUX\\|%s\\)\n", - bad_flags_str, good_flags, good_flags_str); + printf("personality\\(%s\\|%s\\)" + " = %#x \\(%s\\|%s\\)\n", + linux_type_str, bad_flags_str, + good_flags, linux_type_str, 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); + printf("personality\\(%s\\|%s\\)" + " = %#x \\(%s\\|%s\\)\n", + linux_type_str, good_bad_flags_str, + bad_flags, linux_type_str, bad_flags_str); /* another valid type */ personality(good_type); - printf("personality\\(%s\\) = %#x \\(PER_LINUX\\|%s\\|%s\\)\n", + printf("personality\\(%s\\) = %#x \\(%s\\|%s\\)\n", good_type_str, good_flags | bad_flags, - good_flags_str, bad_flags_str); + linux_type_str, good_bad_flags_str); personality(good_type | good_flags); printf("personality\\(%s\\|%s\\) = %#x \\(%s\\)\n", @@ -84,16 +90,16 @@ int main(void) 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, + printf("personality\\(%s\\|%s\\) = %#x \\(%s\\|%s\\)\n", + good_type_str, good_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", + printf("personality\\(%s\\) = %#x \\(%s\\|%s\\)\n", bad_type_str, good_type | good_flags | bad_flags, - good_type_str, good_flags_str, bad_flags_str); + good_type_str, good_bad_flags_str); personality(bad_type | good_flags); printf("personality\\(%s\\|%s\\) = %#x \\(%s\\)\n", @@ -105,14 +111,14 @@ int main(void) 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, + printf("personality\\(%s\\|%s\\) = %#x \\(%s\\|%s\\)\n", + bad_type_str, good_bad_flags_str, bad_type | bad_flags, bad_type_str, bad_flags_str); personality(saved_pers); - printf("personality\\([^)]*\\) = %#x \\(%s\\|%s\\|%s\\)\n", + printf("personality\\([^)]*\\) = %#x \\(%s\\|%s\\)\n", bad_type | good_flags | bad_flags, - bad_type_str, good_flags_str, bad_flags_str); + bad_type_str, good_bad_flags_str); return 0; } diff --git a/tests-mx32/personality.test b/tests-mx32/personality.test index 8f8c0adb..6d2b65c7 100755 --- a/tests-mx32/personality.test +++ b/tests-mx32/personality.test @@ -1,12 +1,14 @@ #!/bin/sh - +# # Check personality syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog > /dev/null -run_strace -a20 -epersonality $args > "$OUT" -match_grep "$LOG" "$OUT" -rm -f "$OUT" - -exit 0 +run_strace -a20 -epersonality "$@" $args > "$EXP" +match_grep "$LOG" "$EXP" diff --git a/tests-mx32/pidfd_send_signal.c b/tests-mx32/pidfd_send_signal.c new file mode 100644 index 00000000..014e43de --- /dev/null +++ b/tests-mx32/pidfd_send_signal.c @@ -0,0 +1,71 @@ +/* + * Check decoding of pidfd_send_signal syscall. + * + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include "scno.h" + +#ifdef __NR_pidfd_send_signal + +# include +# include +# include + +static const char *errstr; + +static long +sys_pidfd_send_signal(int pidfd, int sig, const void *info, int flags) +{ + kernel_ulong_t fill = (kernel_ulong_t) 0xdefaced00000000ULL; + kernel_ulong_t arg1 = fill | (unsigned int) pidfd; + kernel_ulong_t arg2 = fill | (unsigned int) sig; + kernel_ulong_t arg3 = (unsigned long) info; + kernel_ulong_t arg4 = fill | (unsigned int) flags; + + long rc = syscall(__NR_pidfd_send_signal, arg1, arg2, arg3, arg4); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const char null_path[] = "/dev/null"; + + int fd = open(null_path, O_RDONLY); + if (fd < 0) + perror_msg_and_fail("open: %s", null_path); + + TAIL_ALLOC_OBJECT_CONST_PTR(siginfo_t, si); + const void *esi = (const void *) si + 1; + + sys_pidfd_send_signal(fd, SIGUSR1, esi, 0); + printf("pidfd_send_signal(%d, SIGUSR1, %p, 0) = %s\n", + fd, esi, errstr); + + si->si_signo = SIGUSR1; + si->si_code = SI_QUEUE; + + sys_pidfd_send_signal(fd, SIGUSR2, si, -1); + printf("pidfd_send_signal(%d, SIGUSR2, {si_signo=SIGUSR1" + ", si_code=SI_QUEUE, si_errno=%d, si_pid=%u, si_uid=%u" + ", si_value={int=%d, ptr=%p}}, %#x) = %s\n", + fd, si->si_errno, si->si_pid, si->si_uid, si->si_int, si->si_ptr, + -1U, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pidfd_send_signal") + +#endif diff --git a/tests-mx32/pidfd_send_signal.gen.test b/tests-mx32/pidfd_send_signal.gen.test new file mode 100755 index 00000000..a1e8466c --- /dev/null +++ b/tests-mx32/pidfd_send_signal.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pidfd_send_signal ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/pipe.c b/tests-mx32/pipe.c index 41c7f215..bdfc7565 100644 --- a/tests-mx32/pipe.c +++ b/tests-mx32/pipe.c @@ -2,29 +2,10 @@ * Check decoding of pipe syscall. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/pipe.test b/tests-mx32/pipe.test index 0ae414d4..af70b08d 100755 --- a/tests-mx32/pipe.test +++ b/tests-mx32/pipe.test @@ -1,6 +1,12 @@ #!/bin/sh - +# # Check decoding of pipe syscall. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" run_prog diff --git a/tests-mx32/pipe2.c b/tests-mx32/pipe2.c index 375ae74f..d948a1c6 100644 --- a/tests-mx32/pipe2.c +++ b/tests-mx32/pipe2.c @@ -1,30 +1,10 @@ /* * Check decoding of pipe2 syscall. * - * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -39,18 +19,16 @@ int main(void) { - static const kernel_ulong_t bogus_zero = - (kernel_ulong_t) 0xffffffff00000000ULL; int *const fds = tail_alloc(sizeof(*fds) * 2); int *const efault = fds + 1; long rc; - rc = syscall(__NR_pipe2, fds, bogus_zero | O_NONBLOCK); + rc = syscall(__NR_pipe2, fds, F8ILL_KULONG_MASK | O_NONBLOCK); if (rc) perror_msg_and_skip("pipe2"); printf("pipe2([%d, %d], O_NONBLOCK) = 0\n", fds[0], fds[1]); - rc = syscall(__NR_pipe2, efault, bogus_zero); + rc = syscall(__NR_pipe2, efault, F8ILL_KULONG_MASK); printf("pipe2(%p, 0) = %s\n", efault, sprintrc(rc)); if (F8ILL_KULONG_SUPPORTED) { diff --git a/tests-mx32/pipe2.gen.test b/tests-mx32/pipe2.gen.test new file mode 100755 index 00000000..50b8fd64 --- /dev/null +++ b/tests-mx32/pipe2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pipe2 -a15 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests-mx32/pipe2.test b/tests-mx32/pipe2.test deleted file mode 100755 index aff6cd44..00000000 --- a/tests-mx32/pipe2.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of pipe2 syscall. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a15 diff --git a/tests-mx32/pipe_maxfd.c b/tests-mx32/pipe_maxfd.c index a1343f91..a4ec48c4 100644 --- a/tests-mx32/pipe_maxfd.c +++ b/tests-mx32/pipe_maxfd.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/pkey_alloc.c b/tests-mx32/pkey_alloc.c index 45772787..6a92be40 100644 --- a/tests-mx32/pkey_alloc.c +++ b/tests-mx32/pkey_alloc.c @@ -2,29 +2,10 @@ * Check decoding of pkey_alloc syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -53,10 +34,12 @@ main(void) sizeof(kernel_ulong_t) > sizeof(int) ? "PKEY_DISABLE_WRITE|0xbadc0ded00000000" : "PKEY_DISABLE_WRITE" }, - { 0xdec0ded, "PKEY_DISABLE_ACCESS|0xdec0dec" }, - { 0x3, "PKEY_DISABLE_ACCESS|PKEY_DISABLE_WRITE" }, + { 0xdec0ded, "PKEY_DISABLE_ACCESS|PKEY_DISABLE_EXECUTE|" + "0xdec0de8" }, + { 0x7, "PKEY_DISABLE_ACCESS|PKEY_DISABLE_WRITE|" + "PKEY_DISABLE_EXECUTE" }, { ARG_STR(0) }, - { 0xbadc0dec, "0xbadc0dec /* PKEY_??? */" }, + { 0xbadc0de8, "0xbadc0de8 /* PKEY_??? */" }, }; long rc; diff --git a/tests-mx32/pkey_alloc.gen.test b/tests-mx32/pkey_alloc.gen.test new file mode 100755 index 00000000..fb554efc --- /dev/null +++ b/tests-mx32/pkey_alloc.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pkey_alloc -a17 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-mx32/pkey_alloc.test b/tests-mx32/pkey_alloc.test deleted file mode 100755 index f168c21a..00000000 --- a/tests-mx32/pkey_alloc.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of pkey_alloc syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a17 diff --git a/tests-mx32/pkey_free.c b/tests-mx32/pkey_free.c index 95a2ad26..7bcb3f9a 100644 --- a/tests-mx32/pkey_free.c +++ b/tests-mx32/pkey_free.c @@ -2,29 +2,10 @@ * Check decoding of pkey_free syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/pkey_free.gen.test b/tests-mx32/pkey_free.gen.test new file mode 100755 index 00000000..0374cc73 --- /dev/null +++ b/tests-mx32/pkey_free.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pkey_free -a13 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 diff --git a/tests-mx32/pkey_free.test b/tests-mx32/pkey_free.test deleted file mode 100755 index 9c01c3e7..00000000 --- a/tests-mx32/pkey_free.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of pkey_free syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a13 diff --git a/tests-mx32/pkey_mprotect.c b/tests-mx32/pkey_mprotect.c index 529abd1f..c9c96daa 100644 --- a/tests-mx32/pkey_mprotect.c +++ b/tests-mx32/pkey_mprotect.c @@ -2,29 +2,10 @@ * Check decoding of pkey_mprotect syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/pkey_mprotect.gen.test b/tests-mx32/pkey_mprotect.gen.test new file mode 100755 index 00000000..11a902a5 --- /dev/null +++ b/tests-mx32/pkey_mprotect.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pkey_mprotect -a37 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a37 diff --git a/tests-mx32/pkey_mprotect.test b/tests-mx32/pkey_mprotect.test deleted file mode 100755 index 922d4919..00000000 --- a/tests-mx32/pkey_mprotect.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of pkey_mprotect syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a37 diff --git a/tests-mx32/poll-P.c b/tests-mx32/poll-P.c new file mode 100644 index 00000000..7bbeb795 --- /dev/null +++ b/tests-mx32/poll-P.c @@ -0,0 +1,2 @@ +#define PATH_TRACING_FD 9 +#include "poll.c" diff --git a/tests-mx32/poll-P.test b/tests-mx32/poll-P.test new file mode 100755 index 00000000..8ba2d303 --- /dev/null +++ b/tests-mx32/poll-P.test @@ -0,0 +1,22 @@ +#!/bin/sh +# +# Check path tracing of poll syscall. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a16 -vepoll -P /dev/full 9>>/dev/full \ + $args > "$EXP" +match_diff "$LOG" "$EXP" + +for abbrev in 0 1 2 3 4 5; do + run_prog "../$NAME" $abbrev > /dev/null + run_strace -a16 -epoll -s$abbrev -P /dev/full 9>>/dev/full \ + $args > "$EXP" + match_diff "$LOG" "$EXP" +done diff --git a/tests-mx32/poll.c b/tests-mx32/poll.c index c47c97e5..c08bee8e 100644 --- a/tests-mx32/poll.c +++ b/tests-mx32/poll.c @@ -1,30 +1,10 @@ /* - * This file is part of poll strace test. + * Check decoding of poll syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -37,15 +17,18 @@ # include # include # include +# include # include -#define PRINT_EVENT(flag, member) \ - if (member & flag) { \ - if (member != pfd->member) \ - tprintf("|"); \ - tprintf(#flag); \ - member &= ~flag; \ - } +# define PRINT_EVENT(flag, member) \ + do { \ + if (member & flag) { \ + if (member != pfd->member) \ + tprintf("|"); \ + tprintf(#flag); \ + member &= ~flag; \ + } \ + } while (0) static void print_pollfd_entering(const struct pollfd *const pfd) @@ -56,24 +39,24 @@ print_pollfd_entering(const struct pollfd *const pfd) short events = pfd->events; if (pfd->events) { - PRINT_EVENT(POLLIN, events) - PRINT_EVENT(POLLPRI, events) - PRINT_EVENT(POLLOUT, events) -#ifdef POLLRDNORM - PRINT_EVENT(POLLRDNORM, events) -#endif -#ifdef POLLWRNORM - PRINT_EVENT(POLLWRNORM, events) -#endif -#ifdef POLLRDBAND - PRINT_EVENT(POLLRDBAND, events) -#endif -#ifdef POLLWRBAND - PRINT_EVENT(POLLWRBAND, events) -#endif - PRINT_EVENT(POLLERR, events) - PRINT_EVENT(POLLHUP, events) - PRINT_EVENT(POLLNVAL, events) + PRINT_EVENT(POLLIN, events); + PRINT_EVENT(POLLPRI, events); + PRINT_EVENT(POLLOUT, events); +# ifdef POLLRDNORM + PRINT_EVENT(POLLRDNORM, events); +# endif +# ifdef POLLWRNORM + PRINT_EVENT(POLLWRNORM, events); +# endif +# ifdef POLLRDBAND + PRINT_EVENT(POLLRDBAND, events); +# endif +# ifdef POLLWRBAND + PRINT_EVENT(POLLWRBAND, events); +# endif + PRINT_EVENT(POLLERR, events); + PRINT_EVENT(POLLHUP, events); + PRINT_EVENT(POLLNVAL, events); } else tprintf("0"); } @@ -92,7 +75,7 @@ print_pollfd_array_entering(const struct pollfd *const pfd, if (i) tprintf(", "); if (i >= valid) { - tprintf("%p", &pfd[i]); + tprintf("... /* %p */", &pfd[i]); break; } if (i >= abbrev) { @@ -123,24 +106,24 @@ print_pollfd_exiting(const struct pollfd *const pfd, tprintf("{fd=%d, revents=", pfd->fd); short revents = pfd->revents; - PRINT_EVENT(POLLIN, revents) - PRINT_EVENT(POLLPRI, revents) - PRINT_EVENT(POLLOUT, revents) -#ifdef POLLRDNORM - PRINT_EVENT(POLLRDNORM, revents) -#endif -#ifdef POLLWRNORM - PRINT_EVENT(POLLWRNORM, revents) -#endif -#ifdef POLLRDBAND - PRINT_EVENT(POLLRDBAND, revents) -#endif -#ifdef POLLWRBAND - PRINT_EVENT(POLLWRBAND, revents) -#endif - PRINT_EVENT(POLLERR, revents) - PRINT_EVENT(POLLHUP, revents) - PRINT_EVENT(POLLNVAL, revents) + PRINT_EVENT(POLLIN, revents); + PRINT_EVENT(POLLPRI, revents); + PRINT_EVENT(POLLOUT, revents); +# ifdef POLLRDNORM + PRINT_EVENT(POLLRDNORM, revents); +# endif +# ifdef POLLWRNORM + PRINT_EVENT(POLLWRNORM, revents); +# endif +# ifdef POLLRDBAND + PRINT_EVENT(POLLRDBAND, revents); +# endif +# ifdef POLLWRBAND + PRINT_EVENT(POLLWRBAND, revents); +# endif + PRINT_EVENT(POLLERR, revents); + PRINT_EVENT(POLLHUP, revents); + PRINT_EVENT(POLLNVAL, revents); tprintf("}"); } @@ -160,12 +143,19 @@ print_pollfd_array_exiting(const struct pollfd *const pfd, int main(int ac, char **av) { +# ifdef PATH_TRACING_FD + skip_if_unavailable("/proc/self/fd/"); +# endif + tprintf("%s", ""); assert(syscall(__NR_poll, NULL, 42, 0) == -1); if (ENOSYS == errno) perror_msg_and_skip("poll"); + +# ifndef PATH_TRACING_FD tprintf("poll(NULL, 42, 0) = -1 EFAULT (%m)\n"); +# endif int fds[2]; if (pipe(fds) || pipe(fds)) @@ -184,17 +174,22 @@ main(int ac, char **av) int rc = syscall(__NR_poll, tail_fds0, 0, timeout); assert(rc == 0); +# ifndef PATH_TRACING_FD tprintf("poll([], 0, %d) = %d (Timeout)\n", timeout, rc); +# endif rc = syscall(__NR_poll, tail_fds0, ARRAY_SIZE(pfds0), timeout); assert(rc == 3); +# ifndef PATH_TRACING_FD tprintf("poll("); print_pollfd_array_entering(tail_fds0, ARRAY_SIZE(pfds0), ARRAY_SIZE(pfds0), abbrev); - tprintf(", %u, %d) = %d (", ARRAY_SIZE(pfds0), timeout, rc); + tprintf(", %u, %d) = %d (", + (unsigned int) ARRAY_SIZE(pfds0), timeout, rc); print_pollfd_array_exiting(tail_fds0, ARRAY_SIZE(pfds0), abbrev); tprintf(")\n"); +# endif /* !PATH_TRACING_FD */ tail_fds0[0].fd = -1; tail_fds0[2].fd = -3; @@ -202,24 +197,30 @@ main(int ac, char **av) rc = syscall(__NR_poll, tail_fds0, ARRAY_SIZE(pfds0), timeout); assert(rc == 2); +# ifndef PATH_TRACING_FD tprintf("poll("); print_pollfd_array_entering(tail_fds0, ARRAY_SIZE(pfds0), ARRAY_SIZE(pfds0), abbrev); - tprintf(", %u, %d) = %d (", ARRAY_SIZE(pfds0), timeout, rc); + tprintf(", %u, %d) = %d (", + (unsigned int) ARRAY_SIZE(pfds0), timeout, rc); print_pollfd_array_exiting(tail_fds0, ARRAY_SIZE(pfds0), abbrev); tprintf(")\n"); +# endif /* !PATH_TRACING_FD */ tail_fds0[1].fd = -2; tail_fds0[4].fd = -5; rc = syscall(__NR_poll, tail_fds0, ARRAY_SIZE(pfds0), timeout); assert(rc == 1); +# ifndef PATH_TRACING_FD tprintf("poll("); print_pollfd_array_entering(tail_fds0, ARRAY_SIZE(pfds0), ARRAY_SIZE(pfds0), abbrev); - tprintf(", %u, %d) = %d (", ARRAY_SIZE(pfds0), timeout, rc); + tprintf(", %u, %d) = %d (", + (unsigned int) ARRAY_SIZE(pfds0), timeout, rc); print_pollfd_array_exiting(tail_fds0, ARRAY_SIZE(pfds0), abbrev); tprintf(")\n"); +# endif /* !PATH_TRACING_FD */ struct pollfd pfds1[] = { { .fd = 1, .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, @@ -229,24 +230,58 @@ main(int ac, char **av) rc = syscall(__NR_poll, tail_fds1, ARRAY_SIZE(pfds1), timeout); assert(rc == 0); +# ifndef PATH_TRACING_FD tprintf("poll("); print_pollfd_array_entering(tail_fds1, ARRAY_SIZE(pfds1), ARRAY_SIZE(pfds1), abbrev); - tprintf(", %u, %d) = %d (Timeout)\n", ARRAY_SIZE(pfds1), timeout, rc); + tprintf(", %u, %d) = %d (Timeout)\n", + (unsigned int) ARRAY_SIZE(pfds1), timeout, rc); +# endif /* !PATH_TRACING_FD */ const void *const efault = tail_fds0 + ARRAY_SIZE(pfds0); rc = syscall(__NR_poll, efault, 1, 0); assert(rc == -1); + +# ifndef PATH_TRACING_FD tprintf("poll(%p, 1, 0) = -1 EFAULT (%m)\n", efault); +# endif const unsigned int valid = 1; const void *const epfds = tail_fds0 + ARRAY_SIZE(pfds0) - valid; rc = syscall(__NR_poll, epfds, valid + 1, 0); assert(rc == -1); + +# ifndef PATH_TRACING_FD + tprintf("poll("); + print_pollfd_array_entering(epfds, valid + 1, valid, abbrev); + errno = EFAULT; + tprintf(", %u, 0) = -1 EFAULT (%m)\n", valid + 1); +# endif /* !PATH_TRACING_FD */ + +# ifdef PATH_TRACING_FD + memcpy(tail_fds0, pfds0, sizeof(pfds0)); + tail_fds0[4].fd = PATH_TRACING_FD; + + rc = syscall(__NR_poll, tail_fds0, ARRAY_SIZE(pfds0), timeout); + assert(rc == 3); + + tprintf("poll("); + print_pollfd_array_entering(tail_fds0, ARRAY_SIZE(pfds0), + ARRAY_SIZE(pfds0), abbrev); + tprintf(", %u, %d) = %d (", + (unsigned int) ARRAY_SIZE(pfds0), timeout, rc); + print_pollfd_array_exiting(tail_fds0, ARRAY_SIZE(pfds0), abbrev); + tprintf(")\n"); + + rc = syscall(__NR_poll, epfds, valid + 1, 0); + assert(rc == -1); + + /* the 1st pollfd element is readable and contains PATH_TRACING_FD */ tprintf("poll("); print_pollfd_array_entering(epfds, valid + 1, valid, abbrev); errno = EFAULT; tprintf(", %u, 0) = -1 EFAULT (%m)\n", valid + 1); +# endif /* PATH_TRACING_FD */ tprintf("+++ exited with 0 +++\n"); return 0; diff --git a/tests-mx32/poll.test b/tests-mx32/poll.test index b74be29e..0e8691e2 100755 --- a/tests-mx32/poll.test +++ b/tests-mx32/poll.test @@ -1,17 +1,20 @@ #!/bin/sh - +# # Check poll syscall decoding. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog > /dev/null -run_strace -a16 -vepoll $args > "$OUT" -match_diff "$LOG" "$OUT" +run_strace -a16 -vepoll $args > "$EXP" +match_diff "$LOG" "$EXP" for abbrev in 0 1 2 3 4 5; do - run_prog "./$NAME" $abbrev > /dev/null - run_strace -a16 -epoll -s$abbrev $args > "$OUT" - match_diff "$LOG" "$OUT" + run_prog "../$NAME" $abbrev > /dev/null + run_strace -a16 -epoll -s$abbrev $args > "$EXP" + match_diff "$LOG" "$EXP" done - -rm -f "$OUT" diff --git a/tests-mx32/ppoll-P.c b/tests-mx32/ppoll-P.c new file mode 100644 index 00000000..c2c572e2 --- /dev/null +++ b/tests-mx32/ppoll-P.c @@ -0,0 +1,2 @@ +#define PATH_TRACING_FD 9 +#include "ppoll.c" diff --git a/tests-mx32/ppoll-P.gen.test b/tests-mx32/ppoll-P.gen.test new file mode 100755 index 00000000..25a97048 --- /dev/null +++ b/tests-mx32/ppoll-P.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ppoll-P -s2 -e trace=ppoll -P /dev/full 9>>/dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s2 -e trace=ppoll -P /dev/full 9>>/dev/full diff --git a/tests-mx32/ppoll-v.c b/tests-mx32/ppoll-v.c new file mode 100644 index 00000000..cf4fdea7 --- /dev/null +++ b/tests-mx32/ppoll-v.c @@ -0,0 +1,3 @@ +/* This file is part of ppoll-v strace test. */ +#define VERBOSE 1 +#include "ppoll.c" diff --git a/tests-mx32/ppoll-v.expected b/tests-mx32/ppoll-v.expected deleted file mode 100644 index 31070ad1..00000000 --- a/tests-mx32/ppoll-v.expected +++ /dev/null @@ -1,3 +0,0 @@ -ppoll\(\[\{fd=0, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=1, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}, \{fd=3, events=POLLIN\|POLLPRI\}, \{fd=4, events=POLLOUT\}\], 4, \{tv_sec=42, tv_nsec=999999999\}, \[(USR2 CHLD|CHLD USR2)\], (4|8|16)\) = 2 \(\[\{fd=1, revents=POLLOUT(\|POLLWRNORM)?\}, \{fd=4, revents=POLLOUT\}\], left \{tv_sec=42, tv_nsec=9[0-9]{8}\}\) -ppoll\(\[\{fd=1, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=0, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}\], 2, \{tv_sec=0, tv_nsec=999\}, ~\[HUP KILL STOP[^]]*\], (4|8|16)\) = 0 \(Timeout\) -ppoll\(NULL, 42, NULL, NULL, (4|8|16)\) = -1 EFAULT .* diff --git a/tests-mx32/ppoll-v.gen.test b/tests-mx32/ppoll-v.gen.test new file mode 100755 index 00000000..cd1fcc60 --- /dev/null +++ b/tests-mx32/ppoll-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ppoll-v -v -s2 -e trace=ppoll); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -s2 -e trace=ppoll diff --git a/tests-mx32/ppoll.c b/tests-mx32/ppoll.c index 46d7e816..e7a4474f 100644 --- a/tests-mx32/ppoll.c +++ b/tests-mx32/ppoll.c @@ -1,94 +1,221 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin - * All rights reserved. + * Check decoding of ppoll syscall. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" -#include -#include -#include -#include +#include + +#ifdef __NR_ppoll + +# include +# include +# include +# include +# include +# include + +static const char *errstr; -static void -test1(void) +static long +sys_ppoll(const kernel_ulong_t ufds, + const kernel_ulong_t nfds, + const kernel_ulong_t tsp, + const kernel_ulong_t sigmask, + const kernel_ulong_t sigsetsize) { - const struct timespec timeout = { .tv_sec = 42, .tv_nsec = 999999999 }; - struct pollfd fds[] = { - { .fd = 0, .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, - { .fd = 1, .events = POLLOUT | POLLWRNORM | POLLWRBAND }, - { .fd = 3, .events = POLLIN | POLLPRI }, - { .fd = 4, .events = POLLOUT } - }; + long rc = syscall(__NR_ppoll, ufds, nfds, tsp, sigmask, sigsetsize); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ +# ifdef PATH_TRACING_FD + skip_if_unavailable("/proc/self/fd/"); +# endif + static const kernel_ulong_t bogus_nfds = + (kernel_ulong_t) 0xdeadbeeffacefeedULL; + static const kernel_ulong_t bogus_sigsetsize = + (kernel_ulong_t) 0xdeadbeefbadc0dedULL; + static const char *const POLLWRNORM_str = + (POLLWRNORM == POLLOUT) ? "" : "|POLLWRNORM"; + static const char *const USR2_CHLD_str = + (SIGUSR2 < SIGCHLD) ? "USR2 CHLD" : "CHLD USR2"; + void *const efault = tail_alloc(1024) + 1024; + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, ts); + const unsigned int sigset_size = get_sigset_size(); + void *const sigmask = tail_alloc(sigset_size); + struct pollfd *fds; sigset_t mask; + int pipe_fd[4]; + long rc; + + sys_ppoll(0, bogus_nfds, 0, 0, bogus_sigsetsize); + if (ENOSYS == errno) + perror_msg_and_skip("ppoll"); +# ifndef PATH_TRACING_FD + printf("ppoll(NULL, %u, NULL, NULL, %llu) = %s\n", + (unsigned) bogus_nfds, (unsigned long long) bogus_sigsetsize, + errstr); +# endif + + sys_ppoll((unsigned long) efault, 42, (unsigned long) efault + 8, + (unsigned long) efault + 16, sigset_size); +# ifndef PATH_TRACING_FD + printf("ppoll(%p, %u, %p, %p, %u) = %s\n", + efault, 42, efault + 8, efault + 16, sigset_size, errstr); +# endif + + ts->tv_sec = 0xdeadbeefU; + ts->tv_nsec = 0xfacefeedU; + sys_ppoll(0, 0, (unsigned long) ts, 0, sigset_size); +# ifndef PATH_TRACING_FD + printf("ppoll(NULL, 0, {tv_sec=%lld, tv_nsec=%llu}, NULL, %u) = %s\n", + (long long) ts->tv_sec, zero_extend_signed_to_ull(ts->tv_nsec), + sigset_size, errstr); +# endif + + ts->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + ts->tv_nsec = (long) 0xbadc0dedfacefeedL; + sys_ppoll(0, 0, (unsigned long) ts, 0, sigset_size); +# ifndef PATH_TRACING_FD + printf("ppoll(NULL, 0, {tv_sec=%lld, tv_nsec=%llu}, NULL, %u) = %s\n", + (long long) ts->tv_sec, zero_extend_signed_to_ull(ts->tv_nsec), + sigset_size, errstr); +# endif + + if (pipe(pipe_fd) || pipe(pipe_fd + 2)) + perror_msg_and_fail("pipe"); + + ts->tv_sec = 42; + ts->tv_nsec = 999999999; + + const struct pollfd fds1[] = { + { .fd = pipe_fd[0], .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, + { .fd = pipe_fd[1], .events = POLLOUT | POLLWRNORM | POLLWRBAND }, + { .fd = pipe_fd[2], .events = POLLIN | POLLPRI }, + { .fd = pipe_fd[3], .events = POLLOUT } + }; + fds = efault - sizeof(fds1); + memcpy(fds, fds1, sizeof(fds1)); + sigemptyset(&mask); sigaddset(&mask, SIGUSR2); sigaddset(&mask, SIGCHLD); + memcpy(sigmask, &mask, sigset_size); - int rc = ppoll(fds, sizeof(fds) / sizeof(*fds), &timeout, &mask); - if (rc < 0) - perror_msg_and_skip("ppoll"); - assert(rc == 2); -} + rc = sys_ppoll((unsigned long) fds, + F8ILL_KULONG_MASK | ARRAY_SIZE(fds1), (unsigned long) ts, + (unsigned long) sigmask, sigset_size); + if (rc != 2) + perror_msg_and_fail("ppoll 1"); +# ifndef PATH_TRACING_FD + printf("ppoll([{fd=%d, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}" + ", {fd=%d, events=POLLOUT%s|POLLWRBAND}" +# if VERBOSE + ", {fd=%d, events=POLLIN|POLLPRI}, {fd=%d, events=POLLOUT}]" +# else + ", ...]" +# endif + ", %u, {tv_sec=42, tv_nsec=999999999}, [%s], %u) = %ld" + " ([{fd=%d, revents=POLLOUT%s}, {fd=%d, revents=POLLOUT}]" + ", left {tv_sec=%u, tv_nsec=%u})\n", + pipe_fd[0], pipe_fd[1], POLLWRNORM_str, +# if VERBOSE + pipe_fd[2], pipe_fd[3], +# endif + (unsigned int) ARRAY_SIZE(fds1), USR2_CHLD_str, + (unsigned int) sigset_size, rc, pipe_fd[1], POLLWRNORM_str, + pipe_fd[3], (unsigned int) ts->tv_sec, + (unsigned int) ts->tv_nsec); +# endif /* !PATH_TRACING_FD */ -static void -test2(void) -{ - const struct timespec timeout = { .tv_sec = 0, .tv_nsec = 999 }; - struct pollfd fds[] = { - { .fd = 1, .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, - { .fd = 0, .events = POLLOUT | POLLWRNORM | POLLWRBAND } +# ifdef PATH_TRACING_FD + ts->tv_sec = 123; + ts->tv_nsec = 987654321; + fds[3].fd = PATH_TRACING_FD; + + rc = sys_ppoll((unsigned long) fds, + F8ILL_KULONG_MASK | ARRAY_SIZE(fds1), (unsigned long) ts, + (unsigned long) sigmask, sigset_size); + if (rc != 2) + perror_msg_and_fail("ppoll -P"); + printf("ppoll([{fd=%d, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}" + ", {fd=%d, events=POLLOUT%s|POLLWRBAND}" +# if VERBOSE + ", {fd=%d, events=POLLIN|POLLPRI}, {fd=%d, events=POLLOUT}]" +# else + ", ...]" +# endif + ", %u, {tv_sec=123, tv_nsec=987654321}, [%s], %u) = %ld" + " ([{fd=%d, revents=POLLOUT%s}, {fd=%d, revents=POLLOUT}]" + ", left {tv_sec=%u, tv_nsec=%u})\n", + pipe_fd[0], pipe_fd[1], POLLWRNORM_str, +# if VERBOSE + pipe_fd[2], PATH_TRACING_FD, +# endif + (unsigned int) ARRAY_SIZE(fds1), USR2_CHLD_str, + (unsigned int) sigset_size, rc, pipe_fd[1], POLLWRNORM_str, + PATH_TRACING_FD, (unsigned int) ts->tv_sec, + (unsigned int) ts->tv_nsec); +# endif /* PATH_TRACING_FD */ + + ts->tv_sec = 0; + ts->tv_nsec = 999; + const struct pollfd fds2[] = { + { .fd = pipe_fd[1], .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, + { .fd = pipe_fd[0], .events = POLLOUT | POLLWRNORM | POLLWRBAND } }; + fds = efault - sizeof(fds2); + memcpy(fds, fds2, sizeof(fds2)); - sigset_t mask; - sigfillset(&mask); + memset(&mask, -1, sizeof(mask)); sigdelset(&mask, SIGHUP); sigdelset(&mask, SIGKILL); sigdelset(&mask, SIGSTOP); + memcpy(sigmask, &mask, sigset_size); - int rc = ppoll(fds, sizeof(fds) / sizeof(*fds), &timeout, &mask); - if (rc < 0) - perror_msg_and_skip("ppoll"); - assert(rc == 0); -} + rc = sys_ppoll((unsigned long) fds, + F8ILL_KULONG_MASK | ARRAY_SIZE(fds2), (unsigned long) ts, + (unsigned long) sigmask, sigset_size); + if (rc != 0) + perror_msg_and_fail("ppoll 2"); +# ifndef PATH_TRACING_FD + printf("ppoll([{fd=%d, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}" + ", {fd=%d, events=POLLOUT%s|POLLWRBAND}], %u" + ", {tv_sec=0, tv_nsec=999}, ~[HUP KILL STOP], %u)" + " = %ld (Timeout)\n", + pipe_fd[1], pipe_fd[0], POLLWRNORM_str, + (unsigned) ARRAY_SIZE(fds2), sigset_size, rc); +# endif /* !PATH_TRACING_FD */ -int -main(void) -{ - int fds[2]; - - (void) close(0); - (void) close(1); - (void) close(3); - (void) close(4); - if (pipe(fds) || pipe(fds)) - perror_msg_and_fail("pipe"); + if (F8ILL_KULONG_SUPPORTED) { + sys_ppoll(f8ill_ptr_to_kulong(fds), ARRAY_SIZE(fds2), + f8ill_ptr_to_kulong(ts), f8ill_ptr_to_kulong(sigmask), + sigset_size); +# ifndef PATH_TRACING_FD + printf("ppoll(%#llx, %u, %#llx, %#llx, %u) = %s\n", + (unsigned long long) f8ill_ptr_to_kulong(fds), + (unsigned) ARRAY_SIZE(fds2), + (unsigned long long) f8ill_ptr_to_kulong(ts), + (unsigned long long) f8ill_ptr_to_kulong(sigmask), + (unsigned) sigset_size, errstr); +# endif /* !PATH_TRACING_FD */ + } - test1(); - test2(); - - assert(ppoll(NULL, 42, NULL, NULL) < 0); + puts("+++ exited with 0 +++"); return 0; } + +#else + +SKIP_MAIN_UNDEFINED("__NR_ppoll") + +#endif diff --git a/tests-mx32/ppoll.expected b/tests-mx32/ppoll.expected deleted file mode 100644 index c38a2062..00000000 --- a/tests-mx32/ppoll.expected +++ /dev/null @@ -1,3 +0,0 @@ -ppoll\(\[\{fd=0, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=1, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}, \.\.\.\], 4, \{tv_sec=42, tv_nsec=999999999\}, \[(USR2 CHLD|CHLD USR2)\], (4|8|16)\) = 2 \(\[\{fd=1, revents=POLLOUT(\|POLLWRNORM)?\}, \{fd=4, revents=POLLOUT\}\], left \{tv_sec=42, tv_nsec=9[0-9]{8}\}\) -ppoll\(\[\{fd=1, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=0, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}\], 2, \{tv_sec=0, tv_nsec=999\}, ~\[HUP KILL STOP[^]]*\], (4|8|16)\) = 0 \(Timeout\) -ppoll\(NULL, 42, NULL, NULL, (4|8|16)\) = -1 EFAULT .* diff --git a/tests-mx32/ppoll.gen.test b/tests-mx32/ppoll.gen.test new file mode 100755 index 00000000..120e9536 --- /dev/null +++ b/tests-mx32/ppoll.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ppoll -s2 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s2 diff --git a/tests-mx32/ppoll.test b/tests-mx32/ppoll.test deleted file mode 100755 index 98389ee6..00000000 --- a/tests-mx32/ppoll.test +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -# Check ppoll syscall decoding. - -. "${srcdir=.}/init.sh" - -run_prog -run_strace -a30 -s2 -e ppoll $args -match_grep -run_strace -a30 -v -s2 -e ppoll $args -match_grep "$LOG" "$srcdir/$NAME-v.expected" - -exit 0 diff --git a/tests-mx32/prctl-arg2-intptr.c b/tests-mx32/prctl-arg2-intptr.c index ee000ebe..be894270 100644 --- a/tests-mx32/prctl-arg2-intptr.c +++ b/tests-mx32/prctl-arg2-intptr.c @@ -4,29 +4,10 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -70,7 +51,7 @@ main(void) { 11, "PR_GET_FPEXC" }, }; - unsigned int *ptr = tail_alloc(sizeof(*ptr)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, ptr); long rc; unsigned int i; diff --git a/tests-mx32/prctl-arg2-intptr.test b/tests-mx32/prctl-arg2-intptr.test index bcef8065..feb5a2b9 100755 --- a/tests-mx32/prctl-arg2-intptr.test +++ b/tests-mx32/prctl-arg2-intptr.test @@ -1,7 +1,13 @@ #!/bin/sh - +# # Check decoding of prctl PR_GET_CHILD_SUBREAPER, PR_GET_ENDIAN, PR_GET_FPEMU, # and PR_GET_FPEXC operations. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" check_prog grep @@ -10,5 +16,3 @@ run_strace -a25 -eprctl $args > "$EXP" LC_ALL=C grep -Ev '^prctl\(PR_[GS]ET_([^CEF]|.[^HNP]|..[^DEI])' \ < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/prctl-dumpable.c b/tests-mx32/prctl-dumpable.c index 1049bcee..7740d52a 100644 --- a/tests-mx32/prctl-dumpable.c +++ b/tests-mx32/prctl-dumpable.c @@ -3,36 +3,18 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include #include -#if defined __NR_prctl && defined PR_GET_DUMPABLE && defined PR_SET_DUMPABLE +#if defined __NR_prctl && defined PR_GET_DUMPABLE && defined PR_SET_DUMPABLE \ + && !defined __ia64__ # include # include @@ -101,6 +83,7 @@ main(void) #else -SKIP_MAIN_UNDEFINED("__NR_prctl && PR_GET_DUMPABLE && PR_SET_DUMPABLE") +SKIP_MAIN_UNDEFINED("__NR_prctl && PR_GET_DUMPABLE && PR_SET_DUMPABLE" + " && !__ia64__") #endif diff --git a/tests-mx32/prctl-dumpable.test b/tests-mx32/prctl-dumpable.test index 08acb8b9..8662f79c 100755 --- a/tests-mx32/prctl-dumpable.test +++ b/tests-mx32/prctl-dumpable.test @@ -1,6 +1,12 @@ #!/bin/sh - +# # Check decoding of prctl PR_GET_DUMPABLE and PR_SET_DUMPABLE operations. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" check_prog grep @@ -8,5 +14,3 @@ run_prog > /dev/null run_strace -a23 -eprctl $args > "$EXP" grep -v '^prctl(PR_[GS]ET_[^D][^U]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/prctl-name.c b/tests-mx32/prctl-name.c index 308c275f..16d85911 100644 --- a/tests-mx32/prctl-name.c +++ b/tests-mx32/prctl-name.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/prctl-name.test b/tests-mx32/prctl-name.test index 071179c5..b19efc0f 100755 --- a/tests-mx32/prctl-name.test +++ b/tests-mx32/prctl-name.test @@ -1,6 +1,12 @@ #!/bin/sh - +# # Check decoding of prctl PR_GET_NAME/PR_SET_NAME operations. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" check_prog grep @@ -8,5 +14,3 @@ run_prog > /dev/null run_strace -a23 -eprctl $args > "$EXP" grep -v '^prctl(PR_GET_[^N][^A]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/prctl-no-args.c b/tests-mx32/prctl-no-args.c index 57e1b733..8ce13d80 100644 --- a/tests-mx32/prctl-no-args.c +++ b/tests-mx32/prctl-no-args.c @@ -4,29 +4,10 @@ * PR_TASK_PERF_EVENTS_DISABLE, and PR_TASK_PERF_EVENTS_ENABLE. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -57,7 +38,7 @@ main(void) { 32, "PR_TASK_PERF_EVENTS_ENABLE" }, }; - unsigned int *ptr = tail_alloc(sizeof(*ptr)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, ptr); unsigned int i; for (i = 0; i < ARRAY_SIZE(options); i++) { diff --git a/tests-mx32/prctl-no-args.test b/tests-mx32/prctl-no-args.test index ce8ca67b..72d0f525 100755 --- a/tests-mx32/prctl-no-args.test +++ b/tests-mx32/prctl-no-args.test @@ -1,8 +1,14 @@ #!/bin/sh - +# # Check decoding of prctl PR_GET_KEEPCAPS, PR_GET_SECCOMP, PR_GET_TIMERSLACK, # PR_GET_TIMING, PR_TASK_PERF_EVENTS_DISABLE, and PR_TASK_PERF_EVENTS_ENABLE # operations. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" check_prog grep @@ -10,5 +16,3 @@ run_prog > /dev/null run_strace -a21 -eprctl $args > "$EXP" grep -v '^prctl(PR_[GS]ET_[^KST][^EI][^CEM]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/prctl-pdeathsig.c b/tests-mx32/prctl-pdeathsig.c index c1760307..6ffbbad7 100644 --- a/tests-mx32/prctl-pdeathsig.c +++ b/tests-mx32/prctl-pdeathsig.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 JingPiao Chen * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -44,7 +25,7 @@ main(void) static const kernel_ulong_t bogus_signal = (kernel_ulong_t) 0xbadc0deddeadfeedULL; - int *pdeathsig = tail_alloc(sizeof(*pdeathsig)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, pdeathsig); long rc; rc = syscall(__NR_prctl, PR_SET_PDEATHSIG, bogus_signal); diff --git a/tests-mx32/prctl-pdeathsig.test b/tests-mx32/prctl-pdeathsig.test index 2777503a..faa40dbb 100755 --- a/tests-mx32/prctl-pdeathsig.test +++ b/tests-mx32/prctl-pdeathsig.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check prctl PR_GET_PDEATHSIG PR_SET_PDEATHSIG decoding. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -9,5 +14,3 @@ run_prog > /dev/null run_strace -a30 -eprctl $args > "$EXP" grep -v '^prctl(PR_[GS]ET_[^P][^D]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/prctl-seccomp-filter-v.c b/tests-mx32/prctl-seccomp-filter-v.c index 69316fbe..f29cfad6 100644 --- a/tests-mx32/prctl-seccomp-filter-v.c +++ b/tests-mx32/prctl-seccomp-filter-v.c @@ -2,29 +2,10 @@ * Check verbose decoding of prctl PR_SET_SECCOMP SECCOMP_MODE_FILTER. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,9 +21,7 @@ #ifdef HAVE_LINUX_SECCOMP_H # include #endif -#ifdef HAVE_LINUX_FILTER_H -# include -#endif +#include #if defined HAVE_PRCTL \ && defined PR_SET_NO_NEW_PRIVS \ @@ -52,23 +31,23 @@ && defined BPF_JUMP \ && defined BPF_STMT -#define SOCK_FILTER_ALLOW_SYSCALL(nr) \ +# define SOCK_FILTER_ALLOW_SYSCALL(nr) \ BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW) -#define SOCK_FILTER_DENY_SYSCALL(nr, err) \ +# define SOCK_FILTER_DENY_SYSCALL(nr, err) \ BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|(SECCOMP_RET_DATA & (err))) -#define SOCK_FILTER_KILL_PROCESS \ +# define SOCK_FILTER_KILL_PROCESS \ BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL) -#define PRINT_ALLOW_SYSCALL(nr) \ +# define PRINT_ALLOW_SYSCALL(nr) \ printf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW), ", \ __NR_ ## nr) -#define PRINT_DENY_SYSCALL(nr, err) \ +# define PRINT_DENY_SYSCALL(nr, err) \ printf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|%#x), ", \ __NR_ ## nr, err) @@ -115,7 +94,7 @@ main(void) PRINT_DENY_SYSCALL(sync, EBUSY), PRINT_DENY_SYSCALL(setsid, EPERM), - printf("BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL)"); + printf("BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL_THREAD)"); puts("]}) = 0"); puts("+++ exited with 0 +++"); diff --git a/tests-mx32/prctl-seccomp-filter-v.test b/tests-mx32/prctl-seccomp-filter-v.test index 44e4a782..9f94a66e 100755 --- a/tests-mx32/prctl-seccomp-filter-v.test +++ b/tests-mx32/prctl-seccomp-filter-v.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check verbose decoding of prctl PR_SET_SECCOMP SECCOMP_MODE_FILTER. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -9,5 +14,3 @@ run_prog > /dev/null run_strace -v -eprctl $args > "$EXP" grep -v '^prctl(PR_GET_' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/prctl-seccomp-strict.c b/tests-mx32/prctl-seccomp-strict.c index a78f8173..0573126e 100644 --- a/tests-mx32/prctl-seccomp-strict.c +++ b/tests-mx32/prctl-seccomp-strict.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/prctl-seccomp-strict.test b/tests-mx32/prctl-seccomp-strict.test index 1f987df7..e7e23df2 100755 --- a/tests-mx32/prctl-seccomp-strict.test +++ b/tests-mx32/prctl-seccomp-strict.test @@ -1,11 +1,16 @@ #!/bin/sh - +# # Check how prctl PR_SET_SECCOMP SECCOMP_MODE_STRICT is decoded. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" check_prog grep -set -- "./$NAME" +set -- "../$NAME" "$@" > /dev/null || { case $? in 77) skip_ "$* exited with code 77" ;; @@ -16,4 +21,3 @@ set -- "./$NAME" run_strace -eprctl "$@" > "$EXP" grep -v '^prctl(PR_GET_' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/prctl-securebits.c b/tests-mx32/prctl-securebits.c index 741973af..5b32f5b5 100644 --- a/tests-mx32/prctl-securebits.c +++ b/tests-mx32/prctl-securebits.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/prctl-securebits.test b/tests-mx32/prctl-securebits.test index c91e62a6..e50dc2eb 100755 --- a/tests-mx32/prctl-securebits.test +++ b/tests-mx32/prctl-securebits.test @@ -1,6 +1,12 @@ #!/bin/sh - +# # Check decoding of prctl PR_GET_SECUREBITS/PR_SET_SECUREBITS operations. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" check_prog grep @@ -8,5 +14,3 @@ run_prog > /dev/null run_strace -a25 -eprctl $args > "$EXP" grep -v '^prctl(PR_[GS]ET_[^S][^E][^C][^U]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/prctl-spec-inject.c b/tests-mx32/prctl-spec-inject.c new file mode 100644 index 00000000..3fa2df2d --- /dev/null +++ b/tests-mx32/prctl-spec-inject.c @@ -0,0 +1,148 @@ +/* + * Check decoding of PR_SET_SPECULATION_CTRL and PR_GET_SPECULATION_CTRL + * prctl operations. + * + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_prctl + +# include +# include +# include +# include + +static long injected_val; + +long +do_prctl(kernel_ulong_t cmd, kernel_ulong_t arg2, kernel_ulong_t arg3) +{ + long rc = syscall(__NR_prctl, cmd, arg2, arg3); + + if (rc != injected_val) + error_msg_and_fail("Return value (%ld) differs from expected " + "injected value (%ld)", + rc, injected_val); + + return rc; +} + +int +main(int argc, char **argv) +{ + static const kernel_ulong_t bogus_arg2 = + (kernel_ulong_t) 0xdeadfacebadc0dedULL; + static const kernel_ulong_t bogus_arg3 = + (kernel_ulong_t) 0xdecafeedbeefda7eULL; + + static const struct { + long arg; + const char *str; + } spec_strs[] = { + { 0, "PR_SPEC_STORE_BYPASS" }, + { 1, "PR_SPEC_INDIRECT_BRANCH" }, + }; + + static const struct { + long arg; + const char *str; + } get_strs[] = { + { -1, "" }, + { 0, " (PR_SPEC_NOT_AFFECTED)" }, + { 1, " (PR_SPEC_PRCTL)" }, + { 3, " (PR_SPEC_PRCTL|PR_SPEC_ENABLE)" }, + { 8, " (PR_SPEC_FORCE_DISABLE)" }, + { 16, " (PR_SPEC_DISABLE_NOEXEC)" }, + { 32, " (0x20)" }, + { 42, " (PR_SPEC_ENABLE|PR_SPEC_FORCE_DISABLE|0x20)" }, + }; + static const struct { + kernel_ulong_t arg; + const char *str; + } set_strs[] = { + { 0, "0 /* PR_SPEC_??? */" }, + { 1, "0x1 /* PR_SPEC_??? */" }, + { 2, "PR_SPEC_ENABLE" }, + { 3, "0x3 /* PR_SPEC_??? */" }, + { 8, "PR_SPEC_FORCE_DISABLE" }, + { 16, "PR_SPEC_DISABLE_NOEXEC" }, + { 32, "0x20 /* PR_SPEC_??? */" }, + { (kernel_ulong_t) 0xdecafeedbeefda7eULL, "0x" +# if SIZEOF_KERNEL_LONG_T == 8 + "decafeed" +# endif + "beefda7e /* PR_SPEC_??? */" }, + }; + + long rc; + const char *str = NULL; + + if (argc < 2) + error_msg_and_fail("Usage: %s INJECTED_VAL", argv[0]); + + injected_val = strtol(argv[1], NULL, 0); + + /* PR_GET_SPECULATION_CTRL */ + rc = do_prctl(52, 2, bogus_arg3); + printf("prctl(PR_GET_SPECULATION_CTRL, 0x2 /* PR_SPEC_??? */) " + "= %s (INJECTED)\n", sprintrc(rc)); + + rc = do_prctl(52, bogus_arg2, bogus_arg3); + printf("prctl(PR_GET_SPECULATION_CTRL, %#llx /* PR_SPEC_??? */) " + "= %s (INJECTED)\n", + (unsigned long long) bogus_arg2, sprintrc(rc)); + + for (unsigned c = 0; c < ARRAY_SIZE(spec_strs); c++) { + rc = do_prctl(52, spec_strs[c].arg, bogus_arg3); + + for (unsigned i = 0; i < ARRAY_SIZE(get_strs); i++) { + if (get_strs[i].arg == rc) { + str = get_strs[i].str; + break; + } + } + if (!str) + error_msg_and_fail("Unknown return value: %ld", rc); + + printf("prctl(PR_GET_SPECULATION_CTRL, %s) = %s%s (INJECTED)\n", + spec_strs[c].str, sprintrc(rc), str); + } + + + /* PR_SET_SPECULATION_CTRL*/ + rc = do_prctl(53, 2, bogus_arg3); + printf("prctl(PR_SET_SPECULATION_CTRL, 0x2 /* PR_SPEC_??? */, %#llx) " + "= %s (INJECTED)\n", + (unsigned long long) bogus_arg3, sprintrc(rc)); + + rc = do_prctl(53, bogus_arg2, bogus_arg3); + printf("prctl(PR_SET_SPECULATION_CTRL, %#llx /* PR_SPEC_??? */, %#llx) " + "= %s (INJECTED)\n", + (unsigned long long) bogus_arg2, + (unsigned long long) bogus_arg3, + sprintrc(rc)); + + for (unsigned c = 0; c < ARRAY_SIZE(spec_strs); c++) { + for (unsigned i = 0; i < ARRAY_SIZE(set_strs); i++) { + rc = do_prctl(53, spec_strs[c].arg, set_strs[i].arg); + printf("prctl(PR_SET_SPECULATION_CTRL, %s" + ", %s) = %s (INJECTED)\n", + spec_strs[c].str, set_strs[i].str, sprintrc(rc)); + } + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl") + +#endif diff --git a/tests-mx32/prctl-spec-inject.test b/tests-mx32/prctl-spec-inject.test new file mode 100755 index 00000000..c86fc204 --- /dev/null +++ b/tests-mx32/prctl-spec-inject.test @@ -0,0 +1,35 @@ +#!/bin/sh -efu +# +# Check decoding of PR_SET_SPECULATION_CTRL and PR_GET_SPECULATION_CTRL +# prctl operations. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +fault_args='-a53 -e trace=prctl -e inject=prctl:' +prog="../$NAME" + +test_run_rval() +{ + local run rval injexpr + run="$1"; shift + rval="$1"; shift + injexpr="$1"; shift + + run_strace $fault_args$injexpr $prog $rval > "$EXP" + LC_ALL=C grep -Ev '^prctl\(PR_[GS]ET_([^S][^P][^E][^C]])' \ + < "$LOG" > "$OUT" + match_diff "$OUT" "$EXP" +} + +test_run_rval 0 -1 "error=ENOTTY" +test_run_rval 1 0 "retval=0" +test_run_rval 2 1 "retval=1" +test_run_rval 3 3 "retval=3" +test_run_rval 4 8 "retval=8" +test_run_rval 5 16 "retval=16" +test_run_rval 6 42 "retval=42" diff --git a/tests-mx32/prctl-tid_address.c b/tests-mx32/prctl-tid_address.c index 24e45031..9652f00d 100644 --- a/tests-mx32/prctl-tid_address.c +++ b/tests-mx32/prctl-tid_address.c @@ -2,29 +2,10 @@ * Check decoding of prctl PR_GET_TID_ADDRESS operation. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -59,7 +40,7 @@ main(void) (kernel_ulong_t) 0xfffffffffffffffdULL; /* Note that kernel puts kernel-sized pointer even on x32 */ - kernel_ulong_t *ptr = tail_alloc(sizeof(*ptr)); + TAIL_ALLOC_OBJECT_CONST_PTR(kernel_ulong_t, ptr); long rc; long set_ok; diff --git a/tests-mx32/prctl-tid_address.test b/tests-mx32/prctl-tid_address.test index dc7b7c32..f4a229f9 100755 --- a/tests-mx32/prctl-tid_address.test +++ b/tests-mx32/prctl-tid_address.test @@ -1,6 +1,12 @@ #!/bin/sh - +# # Check decoding of prctl PR_GET_TID_ADDRESS operation. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" check_prog grep @@ -8,5 +14,3 @@ run_prog > /dev/null run_strace -a23 -eprctl $args > "$EXP" LC_ALL=C grep -Ev '^prctl\(PR_[GS]ET_([^T]|.[^I]|..[^D])' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/prctl-tsc.c b/tests-mx32/prctl-tsc.c index fd9362d7..0ac27ecd 100644 --- a/tests-mx32/prctl-tsc.c +++ b/tests-mx32/prctl-tsc.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 JingPiao Chen * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -43,7 +24,7 @@ main(void) static const kernel_ulong_t bogus_tsc = (kernel_ulong_t) 0xdeadc0defacebeefULL; - int *tsc = tail_alloc(sizeof(*tsc)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, tsc); long rc; rc = syscall(__NR_prctl, PR_SET_TSC, 0); diff --git a/tests-mx32/prctl-tsc.test b/tests-mx32/prctl-tsc.test index a906ba89..6dd891d6 100755 --- a/tests-mx32/prctl-tsc.test +++ b/tests-mx32/prctl-tsc.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check prctl PR_GET_TSC PR_SET_TSC decoding. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -9,5 +14,3 @@ run_prog > /dev/null run_strace -a24 -eprctl $args > "$EXP" grep -v '^prctl(PR_[GS]ET_[^T][^S]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests-mx32/pread64-pwrite64.c b/tests-mx32/pread64-pwrite64.c index 4a0932a9..83cb9bac 100644 --- a/tests-mx32/pread64-pwrite64.c +++ b/tests-mx32/pread64-pwrite64.c @@ -2,29 +2,10 @@ * Check decoding of pread64 and pwrite64 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -123,7 +104,9 @@ main(void) { tprintf("%s", ""); - static char tmp[] = "pread64-pwrite64-tmpfile"; + skip_if_unavailable("/proc/self/fd/"); + + static const char tmp[] = "pread64-pwrite64-tmpfile"; if (open(tmp, O_CREAT|O_RDONLY|O_TRUNC, 0600) != 0) perror_msg_and_fail("creat: %s", tmp); if (open(tmp, O_WRONLY) != 1) @@ -166,6 +149,7 @@ main(void) if (rc != -1) perror_msg_and_fail("pwrite64: expected -1, returned %ld", rc); tprintf("pwrite64(1, \"\\0\", 1, -3) = -1 EINVAL (%m)\n"); + dump_str(nil, 1); rc = pwrite(1, w, w_len, 0); if (rc != (int) w_len) diff --git a/tests-mx32/pread64-pwrite64.gen.test b/tests-mx32/pread64-pwrite64.gen.test new file mode 100755 index 00000000..b53e0697 --- /dev/null +++ b/tests-mx32/pread64-pwrite64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pread64-pwrite64 -a21 -eread=0 -ewrite=1 -e trace=pread64,pwrite64 -P pread64-pwrite64-tmpfile -P /dev/zero -P /dev/null); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 -eread=0 -ewrite=1 -e trace=pread64,pwrite64 -P pread64-pwrite64-tmpfile -P /dev/zero -P /dev/null diff --git a/tests-mx32/pread64-pwrite64.test b/tests-mx32/pread64-pwrite64.test deleted file mode 100755 index e585406d..00000000 --- a/tests-mx32/pread64-pwrite64.test +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# Check decoding and dumping of pread64 and pwrite64 syscalls. - -. "${srcdir=.}/init.sh" - -# strace -P is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - -tmpfile=pread64-pwrite64-tmpfile -> $tmpfile - -run_strace_match_diff \ - -a21 -eread=0 -ewrite=1 -e trace=pread64,pwrite64 \ - -P $tmpfile -P /dev/zero -P /dev/null - -rm -f $tmpfile diff --git a/tests-mx32/preadv-pwritev.c b/tests-mx32/preadv-pwritev.c index b2d2a824..abbe63d5 100644 --- a/tests-mx32/preadv-pwritev.c +++ b/tests-mx32/preadv-pwritev.c @@ -2,29 +2,10 @@ * Check decoding of preadv and pwritev syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -98,7 +79,7 @@ main(void) tprintf("pwritev(1, [], 0, 0) = 0\n"); rc = pwritev(1, w_iov + ARRAY_SIZE(w_iov_) - 1, 2, 0); - tprintf("pwritev(1, [{iov_base=\"%s\", iov_len=%u}, %p], 2, 0)" + tprintf("pwritev(1, [{iov_base=\"%s\", iov_len=%u}, ... /* %p */], 2, 0)" " = %ld %s (%m)\n", w2_c, LENGTH_OF(w2_c), w_iov + ARRAY_SIZE(w_iov_), rc, errno2name()); @@ -121,7 +102,7 @@ main(void) " * %u bytes in buffer 2\n" " | 00000 %-49s %-16s |\n", w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), - w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w_iov_), w_len, + w2_c, LENGTH_OF(w2_c), (unsigned int) ARRAY_SIZE(w_iov_), w_len, LENGTH_OF(w0_c), w0_d, w0_c, LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); @@ -142,7 +123,8 @@ main(void) tprintf("preadv(0, [{iov_base=\"%s\", iov_len=%u}], %u, 0) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + r0_c, r_len, (unsigned int) ARRAY_SIZE(r0_iov_), + r_len, r_len, r0_d, r0_c); void *r1 = tail_alloc(r_len); void *r2 = tail_alloc(w_len); @@ -166,7 +148,7 @@ main(void) ", {iov_base=\"\", iov_len=%u}], %u, %u) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), + r1_c, r_len, w_len, (unsigned int) ARRAY_SIZE(r1_iov_), r_len, w_len - r_len, w_len - r_len, r1_d, r1_c); close(0); diff --git a/tests-mx32/preadv-pwritev.gen.test b/tests-mx32/preadv-pwritev.gen.test new file mode 100755 index 00000000..5ed8297c --- /dev/null +++ b/tests-mx32/preadv-pwritev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (preadv-pwritev -a19 -eread=0 -ewrite=1 -e trace=preadv,pwritev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 -eread=0 -ewrite=1 -e trace=preadv,pwritev diff --git a/tests-mx32/preadv-pwritev.test b/tests-mx32/preadv-pwritev.test deleted file mode 100755 index cb2a0772..00000000 --- a/tests-mx32/preadv-pwritev.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding and dumping of preadv and pwritev syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a19 -eread=0 -ewrite=1 -e trace=preadv,pwritev diff --git a/tests-mx32/preadv.c b/tests-mx32/preadv.c index fb5d3ad7..3d1b504e 100644 --- a/tests-mx32/preadv.c +++ b/tests-mx32/preadv.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -66,7 +47,7 @@ main(void) { const off_t offset = 0xdefaceddeadbeefLL; char *buf = tail_alloc(LEN); - struct iovec *iov = tail_alloc(sizeof(*iov)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct iovec, iov); iov->iov_base = buf; iov->iov_len = LEN; @@ -124,7 +105,7 @@ main(void) perror_msg_and_fail("preadv: expected %u, returned %ld", r_len, rc); printf("preadv(%d, [{iov_base=\"%s\", iov_len=%u}], %u, 0) = %u\n", - fd, r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len); + fd, r0_c, r_len, (unsigned int) ARRAY_SIZE(r0_iov_), r_len); void *r1 = tail_alloc(r_len); void *r2 = tail_alloc(LENGTH_OF(w)); @@ -146,8 +127,9 @@ main(void) (int) LENGTH_OF(w) - r_len, rc); printf("preadv(%d, [{iov_base=\"%s\", iov_len=%u}" ", {iov_base=\"\", iov_len=%u}], %u, %u) = %u\n", - fd, r1_c, r_len, LENGTH_OF(w), ARRAY_SIZE(r1_iov_), - r_len, LENGTH_OF(w) - r_len); + fd, r1_c, r_len, LENGTH_OF(w), + (unsigned int) ARRAY_SIZE(r1_iov_), + r_len, LENGTH_OF(w) - r_len); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/preadv.gen.test b/tests-mx32/preadv.gen.test new file mode 100755 index 00000000..c3fabe6f --- /dev/null +++ b/tests-mx32/preadv.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (preadv -a21 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests-mx32/preadv.test b/tests-mx32/preadv.test deleted file mode 100755 index d1abdb7d..00000000 --- a/tests-mx32/preadv.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check preadv syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a21 diff --git a/tests-mx32/preadv2-pwritev2.c b/tests-mx32/preadv2-pwritev2.c index f7c46c0a..1266562e 100644 --- a/tests-mx32/preadv2-pwritev2.c +++ b/tests-mx32/preadv2-pwritev2.c @@ -2,29 +2,10 @@ * Check decoding of preadv2 and pwritev2 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -103,7 +84,7 @@ dumpio(void) tprintf("pwritev2(1, [], 0, 0, 0) = 0\n"); rc = pw(1, w_iov + ARRAY_SIZE(w_iov_) - 1, 2, 0); - tprintf("pwritev2(1, [{iov_base=\"%s\", iov_len=%u}, %p], 2, 0, 0)" + tprintf("pwritev2(1, [{iov_base=\"%s\", iov_len=%u}, ... /* %p */], 2, 0, 0)" " = %ld %s (%m)\n", w2_c, LENGTH_OF(w2_c), w_iov + ARRAY_SIZE(w_iov_), rc, errno2name()); @@ -126,7 +107,7 @@ dumpio(void) " * %u bytes in buffer 2\n" " | 00000 %-49s %-16s |\n", w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), - w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w_iov_), w_len, + w2_c, LENGTH_OF(w2_c), (unsigned int) ARRAY_SIZE(w_iov_), w_len, LENGTH_OF(w0_c), w0_d, w0_c, LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); @@ -147,7 +128,8 @@ dumpio(void) tprintf("preadv2(0, [{iov_base=\"%s\", iov_len=%u}], %u, 0, 0) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + r0_c, r_len, (unsigned int) ARRAY_SIZE(r0_iov_), + r_len, r_len, r0_d, r0_c); void *r1 = tail_alloc(r_len); void *r2 = tail_alloc(w_len); @@ -171,7 +153,7 @@ dumpio(void) ", {iov_base=\"\", iov_len=%u}], %u, %u, 0) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), + r1_c, r_len, w_len, (unsigned int) ARRAY_SIZE(r1_iov_), r_len, w_len - r_len, w_len - r_len, r1_d, r1_c); close(0); @@ -181,28 +163,64 @@ int main(void) { const kernel_ulong_t vlen = (kernel_ulong_t) 0xfac1fed2dad3bef4ULL; - const unsigned long long pos = 0xfac5fed6dad7bef8; + const unsigned long long pos = 0x7ac5fed6dad7bef8; const kernel_ulong_t pos_l = (kernel_ulong_t) pos; - const kernel_ulong_t pos_h = - (sizeof(kernel_ulong_t) == sizeof(long long)) ? - (kernel_ulong_t) 0xbadc0deddeadbeefULL : 0xfac5fed6UL; - int test_dumpio = 1; + long rc; + bool skip_dumpio_test = false; tprintf("%s", ""); - syscall(__NR_preadv2, -1, NULL, vlen, pos_l, pos_h, 1); - if (ENOSYS == errno) - test_dumpio = 0; - tprintf("preadv2(-1, NULL, %lu, %lld, RWF_HIPRI) = -1 %s (%m)\n", - (unsigned long) vlen, pos, errno2name()); - - syscall(__NR_pwritev2, -1, NULL, vlen, pos_l, pos_h, 1); - if (ENOSYS == errno) - test_dumpio = 0; - tprintf("pwritev2(-1, NULL, %lu, %lld, RWF_HIPRI) = -1 %s (%m)\n", - (unsigned long) vlen, pos, errno2name()); - - if (test_dumpio) +# if defined __x86_64__ && defined __ILP32__ + /* + * x32 is the only architecture where preadv2 takes 5 arguments, + * see preadv64v2 in kernel sources. + */ + rc = syscall(__NR_preadv2, -1, NULL, vlen, pos_l, 1); +# else + const kernel_ulong_t pos_h = + (sizeof(pos_l) == sizeof(pos)) ? + (kernel_ulong_t) 0xbadc0deddeadbeefULL : + (kernel_ulong_t) (pos >> 32); + rc = syscall(__NR_preadv2, -1, NULL, vlen, pos_l, pos_h, 1); +# endif + if (rc != -1) + error_msg_and_fail("preadv2: expected -1, returned %ld", rc); + switch (errno) { + case ENOSYS: + skip_dumpio_test = true; + break; + case EBADF: + break; + default: + perror_msg_and_fail("preadv2"); + } + tprintf("preadv2(-1, NULL, %lu, %lld, RWF_HIPRI) = %s\n", + (unsigned long) vlen, pos, sprintrc(rc)); + +# if defined __x86_64__ && defined __ILP32__ + /* + * x32 is the only architecture where pwritev2 takes 5 arguments, + * see pwritev64v2 in kernel sources. + */ + rc = syscall(__NR_pwritev2, -1, NULL, vlen, pos_l, 1); +# else + rc = syscall(__NR_pwritev2, -1, NULL, vlen, pos_l, pos_h, 1); +# endif + if (rc != -1) + error_msg_and_fail("pwritev2: expected -1, returned %ld", rc); + switch (errno) { + case ENOSYS: + skip_dumpio_test = true; + break; + case EBADF: + break; + default: + perror_msg_and_fail("pwritev2"); + } + tprintf("pwritev2(-1, NULL, %lu, %lld, RWF_HIPRI) = %s\n", + (unsigned long) vlen, pos, sprintrc(rc)); + + if (!skip_dumpio_test) dumpio(); tprintf("%s\n", "+++ exited with 0 +++"); diff --git a/tests-mx32/preadv2-pwritev2.gen.test b/tests-mx32/preadv2-pwritev2.gen.test new file mode 100755 index 00000000..2f89b413 --- /dev/null +++ b/tests-mx32/preadv2-pwritev2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (preadv2-pwritev2 -a22 -eread=0 -ewrite=1 -e trace=preadv2,pwritev2); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -eread=0 -ewrite=1 -e trace=preadv2,pwritev2 diff --git a/tests-mx32/preadv2-pwritev2.test b/tests-mx32/preadv2-pwritev2.test deleted file mode 100755 index 5641ef46..00000000 --- a/tests-mx32/preadv2-pwritev2.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding and dumping of preadv2 and pwritev2 syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a22 -eread=0 -ewrite=1 -e trace=preadv2,pwritev2 diff --git a/tests-mx32/print_maxfd.c b/tests-mx32/print_maxfd.c index c3d4ea88..bb3ada40 100644 --- a/tests-mx32/print_maxfd.c +++ b/tests-mx32/print_maxfd.c @@ -1,30 +1,10 @@ /* * Print the maximum descriptor number available. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/print_quoted_string.c b/tests-mx32/print_quoted_string.c index 3ad86024..ba4b5ec2 100644 --- a/tests-mx32/print_quoted_string.c +++ b/tests-mx32/print_quoted_string.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -9,6 +16,12 @@ * Assumes instr is NUL-terminated. */ +void +print_quoted_string_ex(const char *instr, bool quote, const char *escape_chars) +{ + print_quoted_memory_ex(instr, strlen(instr), quote, escape_chars); +} + void print_quoted_string(const char *instr) { @@ -16,11 +29,62 @@ print_quoted_string(const char *instr) } void -print_quoted_memory(const char *instr, const size_t len) +print_quoted_cstring(const char *instr, const size_t size) +{ + const size_t len = strnlen(instr, size); + if (len < size) { + print_quoted_memory(instr, len); + } else { + print_quoted_memory(instr, size - 1); + printf("..."); + } +} + +void +print_quoted_stringn(const char *instr, const size_t size) { - const unsigned char *str = (const unsigned char*) instr; + const size_t len = strnlen(instr, size); + if (len < size) { + print_quoted_memory(instr, len); + } else { + print_quoted_memory(instr, size); + printf("..."); + } +} + +static void +print_octal(unsigned char c, char next) +{ + putchar('\\'); + + char c1 = '0' + (c & 0x7); + char c2 = '0' + ((c >> 3) & 0x7); + char c3 = '0' + (c >> 6); + + if (next >= '0' && next <= '7') { + /* Print \octal */ + putchar(c3); + putchar(c2); + } else { + /* Print \[[o]o]o */ + if (c3 != '0') + putchar(c3); + if (c3 != '0' || c2 != '0') + putchar(c2); + } + putchar(c1); +} + +void +print_quoted_memory_ex(const void *const instr, const size_t len, + bool quote, const char *escape_chars) +{ + const unsigned char *str = (const unsigned char *) instr; size_t i; + if (quote) + putchar('"'); + for (i = 0; i < len; ++i) { const int c = str[i]; switch (c) { @@ -46,30 +110,36 @@ print_quoted_memory(const char *instr, const size_t len) printf("\\v"); break; default: - if (c >= ' ' && c <= 0x7e) + if (c >= ' ' && c <= 0x7e && + !(escape_chars && strchr(escape_chars, c))) { putchar(c); - else { - putchar('\\'); - - char c1 = '0' + (c & 0x7); - char c2 = '0' + ((c >> 3) & 0x7); - char c3 = '0' + (c >> 6); - - if (*str >= '0' && *str <= '9') { - /* Print \octal */ - putchar(c3); - putchar(c2); - } else { - /* Print \[[o]o]o */ - if (c3 != '0') - putchar(c3); - if (c3 != '0' || c2 != '0') - putchar(c2); - } - putchar(c1); + } else { + print_octal(c, + i < (len - 1) ? str[i + 1] : 0); } + break; } } + if (quote) + putchar('"'); +} + +void +print_quoted_memory(const void *const instr, const size_t len) +{ + print_quoted_memory_ex(instr, len, true, NULL); +} + +void +print_quoted_hex(const void *const instr, const size_t len) +{ + const unsigned char *str = instr; + size_t i; + + printf("\""); + for (i = 0; i < len; i++) + printf("\\x%02x", str[i]); + printf("\""); } diff --git a/tests-mx32/print_time.c b/tests-mx32/print_time.c new file mode 100644 index 00000000..9d7abde5 --- /dev/null +++ b/tests-mx32/print_time.c @@ -0,0 +1,54 @@ +/* + * Print time_t and nanoseconds in symbolic format. + * + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include + +static void +print_time_t_ex(const time_t t, const unsigned long long part_sec, + const unsigned int max_part_sec, const int width, + const int comment) +{ + + if ((!t && !part_sec) || part_sec > max_part_sec) + return; + + const struct tm *const p = localtime(&t); + char buf[256]; + if (!p || !strftime(buf, sizeof(buf), "%FT%T", p)) + return; + + if (comment) + fputs(" /* ", stdout); + + fputs(buf, stdout); + + if (part_sec) + printf(".%0*llu", width, part_sec); + + if (strftime(buf, sizeof(buf), "%z", p)) + fputs(buf, stdout); + + if (comment) + fputs(" */", stdout); +} + +void +print_time_t_nsec(const time_t t, const unsigned long long nsec, int comment) +{ + print_time_t_ex(t, nsec, 999999999, 9, comment); +} + +void +print_time_t_usec(const time_t t, const unsigned long long usec, int comment) +{ + print_time_t_ex(t, usec, 999999, 6, comment); +} diff --git a/tests-mx32/print_user_desc.c b/tests-mx32/print_user_desc.c new file mode 100644 index 00000000..55f304c0 --- /dev/null +++ b/tests-mx32/print_user_desc.c @@ -0,0 +1,58 @@ +/* + * Auxiliary printing function for the struct user_desc type. + * Used by modify_ldt and xet_thread_area tests. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_USER_DESC + +# include + +/** + * Print user_desc structure. + * + * @param us Pointer to struct user_desc to print. + * @param entry_str If not NULL, the string is printed as a value of + * entry_number field. + */ +static void +print_user_desc(struct user_desc *us, const char *entry_str) +{ + if (entry_str) + printf("{entry_number=%s", entry_str); + else + printf("{entry_number=%u", us->entry_number); + + printf(", base_addr=%#08x" + ", limit=%#08x" + ", seg_32bit=%u" + ", contents=%u" + ", read_exec_only=%u" + ", limit_in_pages=%u" + ", seg_not_present=%u" + ", useable=%u" +# ifdef __x86_64__ + ", lm=%u" +# endif + "}", + us->base_addr, + us->limit, + us->seg_32bit, + us->contents, + us->read_exec_only, + us->limit_in_pages, + us->seg_not_present, + us->useable +# ifdef __x86_64__ + , us->lm +# endif + ); +} + +#endif /* HAVE_STRUCT_USER_DESC */ diff --git a/tests-mx32/printflags.c b/tests-mx32/printflags.c index badc85d3..e9d66471 100644 --- a/tests-mx32/printflags.c +++ b/tests-mx32/printflags.c @@ -3,30 +3,10 @@ * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman - * Copyright (c) 2005-2016 Dmitry V. Levin + * Copyright (c) 2005-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/printpath-umovestr-legacy.test b/tests-mx32/printpath-umovestr-legacy.test new file mode 100755 index 00000000..bc5c98bb --- /dev/null +++ b/tests-mx32/printpath-umovestr-legacy.test @@ -0,0 +1,32 @@ +#!/bin/sh +# +# Force legacy printpath/umovestr using process_vm_readv fault injection. +# +# Copyright (c) 2017-2018 Dmitry V. Levin +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +> "$LOG" || fail_ "failed to write $LOG" +fault_args='-qq -esignal=none -etrace=process_vm_readv -efault=process_vm_readv' +args='../printpath-umovestr-peekdata' + +$STRACE -o "$LOG" $fault_args $args > /dev/null || { + rc=$? + if [ $rc -eq 77 ]; then + skip_ "$fault_args $args exited with code 77" + else + fail_ "$fault_args $args failed with code $rc" + fi +} + +> "$LOG" || fail_ "failed to write $LOG" +args="-a11 -e signal=none -e trace=chdir $args skip-process_vm_readv-check" + +$STRACE -o /dev/null $fault_args \ + $STRACE -o "$LOG" $args > "$EXP" || + dump_log_and_fail_with "$STRACE $args failed with code $?" + +match_diff "$LOG" "$EXP" diff --git a/tests-mx32/printpath-umovestr-peekdata.c b/tests-mx32/printpath-umovestr-peekdata.c new file mode 100644 index 00000000..c4093a32 --- /dev/null +++ b/tests-mx32/printpath-umovestr-peekdata.c @@ -0,0 +1,27 @@ +/* + * Test PTRACE_PEEKDATA-based printpath/umovestr. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include "test_ucopy.h" +#include + +int +main(int ac, char **av) +{ + if (ac < 2 && test_process_vm_readv()) + error_msg_and_skip("process_vm_readv is available"); + + if (!test_ptrace_peekdata()) + perror_msg_and_skip("PTRACE_PEEKDATA"); + + test_printpath(sizeof(long) * 4); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/printpath-umovestr-peekdata.gen.test b/tests-mx32/printpath-umovestr-peekdata.gen.test new file mode 100755 index 00000000..6fe65eeb --- /dev/null +++ b/tests-mx32/printpath-umovestr-peekdata.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printpath-umovestr-peekdata -a11 -e signal=none -e trace=chdir); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e signal=none -e trace=chdir diff --git a/tests-mx32/printpath-umovestr-undumpable.c b/tests-mx32/printpath-umovestr-undumpable.c new file mode 100644 index 00000000..216b6cac --- /dev/null +++ b/tests-mx32/printpath-umovestr-undumpable.c @@ -0,0 +1,51 @@ +/* + * Force legacy printpath/umovestr using PR_SET_DUMPABLE. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_PRCTL +# include +#endif + +#if defined HAVE_PRCTL && defined PR_SET_DUMPABLE + +# include +# include + +# include "test_ucopy.h" + +int +main(void) +{ + if (!test_process_vm_readv()) + perror_msg_and_skip("process_vm_readv"); + + /* + * Clearing dumpable flag disallows process_vm_readv. + * If the kernel does not contain commit + * 84d77d3f06e7e8dea057d10e8ec77ad71f721be3, then + * PTRACE_PEEKDATA remains allowed. + */ + if (prctl(PR_SET_DUMPABLE, 0)) + perror_msg_and_skip("PR_SET_DUMPABLE 0"); + + if (!test_ptrace_peekdata()) + perror_msg_and_skip("PTRACE_PEEKDATA"); + + test_printpath(sizeof(long) * 4); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PRCTL && PR_SET_DUMPABLE") + +#endif diff --git a/tests-mx32/printpath-umovestr-undumpable.gen.test b/tests-mx32/printpath-umovestr-undumpable.gen.test new file mode 100755 index 00000000..cca64424 --- /dev/null +++ b/tests-mx32/printpath-umovestr-undumpable.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printpath-umovestr-undumpable -a11 -e signal=none -e trace=chdir); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e signal=none -e trace=chdir diff --git a/tests-mx32/printpath-umovestr.c b/tests-mx32/printpath-umovestr.c new file mode 100644 index 00000000..2782a988 --- /dev/null +++ b/tests-mx32/printpath-umovestr.c @@ -0,0 +1,26 @@ +/* + * Test regular printpath/umovestr. + * + * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include "test_ucopy.h" +#include +#include + +int +main(void) +{ + if (!test_process_vm_readv()) + perror_msg_and_skip("process_vm_readv"); + + test_printpath(PATH_MAX); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/printpath-umovestr.gen.test b/tests-mx32/printpath-umovestr.gen.test new file mode 100755 index 00000000..c827a7d2 --- /dev/null +++ b/tests-mx32/printpath-umovestr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printpath-umovestr -a11 -e signal=none -e trace=chdir); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e signal=none -e trace=chdir diff --git a/tests-mx32/printsignal-Xabbrev.c b/tests-mx32/printsignal-Xabbrev.c new file mode 100644 index 00000000..dfd93eee --- /dev/null +++ b/tests-mx32/printsignal-Xabbrev.c @@ -0,0 +1 @@ +#include "printsignal.c" diff --git a/tests-mx32/printsignal-Xabbrev.gen.test b/tests-mx32/printsignal-Xabbrev.gen.test new file mode 100755 index 00000000..fbb7a435 --- /dev/null +++ b/tests-mx32/printsignal-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printsignal-Xabbrev -a11 -Xabbrev -e signal=none -e trace=kill); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -Xabbrev -e signal=none -e trace=kill diff --git a/tests-mx32/printsignal-Xraw.c b/tests-mx32/printsignal-Xraw.c new file mode 100644 index 00000000..47d75b77 --- /dev/null +++ b/tests-mx32/printsignal-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "printsignal.c" diff --git a/tests-mx32/printsignal-Xraw.gen.test b/tests-mx32/printsignal-Xraw.gen.test new file mode 100755 index 00000000..ede2f5e1 --- /dev/null +++ b/tests-mx32/printsignal-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printsignal-Xraw -a11 -Xraw -e signal=none -e trace=kill); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -Xraw -e signal=none -e trace=kill diff --git a/tests-mx32/printsignal-Xverbose.c b/tests-mx32/printsignal-Xverbose.c new file mode 100644 index 00000000..4bb13302 --- /dev/null +++ b/tests-mx32/printsignal-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "printsignal.c" diff --git a/tests-mx32/printsignal-Xverbose.gen.test b/tests-mx32/printsignal-Xverbose.gen.test new file mode 100755 index 00000000..ae0560df --- /dev/null +++ b/tests-mx32/printsignal-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printsignal-Xverbose -a11 -Xverbose -e signal=none -e trace=kill); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -Xverbose -e signal=none -e trace=kill diff --git a/tests-mx32/printsignal.c b/tests-mx32/printsignal.c new file mode 100644 index 00000000..4f5f9866 --- /dev/null +++ b/tests-mx32/printsignal.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include "tests.h" +#include +#include +#include + +int +main(void) +{ + const pid_t pid = getpid(); + int rc = kill(pid, SIGCONT); +#if XLAT_RAW + printf("kill(%d, %d) = %s\n", pid, SIGCONT, sprintrc(rc)); +#elif XLAT_VERBOSE + printf("kill(%d, %d /* SIGCONT */) = %s\n", pid, SIGCONT, sprintrc(rc)); +#else /* XLAT_ABBREV */ + printf("kill(%d, SIGCONT) = %s\n", pid, sprintrc(rc)); +#endif + + static const int sigs[] = { 0, 256, -1 }; + for (unsigned int i = 0; i < ARRAY_SIZE(sigs); ++i) { + rc = kill(pid, sigs[i]); + printf("kill(%d, %d) = %s\n", pid, sigs[i], sprintrc(rc)); + } + + printf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests-mx32/printstr.c b/tests-mx32/printstr.c index 330234f1..f1204e00 100644 --- a/tests-mx32/printstr.c +++ b/tests-mx32/printstr.c @@ -2,29 +2,10 @@ * Check decoding of non-NUL-terminated strings when len == -1. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -34,13 +15,11 @@ #include #include -#define DEFAULT_STRLEN 32 - int main(void) { char *const buf = tail_alloc(DEFAULT_STRLEN + 1); - const struct iovec io = { + struct iovec io = { .iov_base = buf, .iov_len = -1 }; @@ -64,6 +43,11 @@ main(void) tprintf("writev(-1, [{iov_base=\"\\0%*s\"..., iov_len=%lu}], 1)" " = %s\n", DEFAULT_STRLEN - 1, buf + 1, -1UL, sprintrc(rc)); + ++io.iov_base; + rc = writev(-1, &io, 1); + tprintf("writev(-1, [{iov_base=%p, iov_len=%lu}], 1) = %s\n", + io.iov_base, -1UL, sprintrc(rc)); + tprintf("+++ exited with 0 +++\n"); return 0; } diff --git a/tests-mx32/printstr.gen.test b/tests-mx32/printstr.gen.test new file mode 100755 index 00000000..c3bd93a3 --- /dev/null +++ b/tests-mx32/printstr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printstr -e trace=writev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=writev diff --git a/tests-mx32/printstr.test b/tests-mx32/printstr.test deleted file mode 100755 index 5f164eb7..00000000 --- a/tests-mx32/printstr.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of non-NUL-terminated strings when len == -1. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -e trace=writev diff --git a/tests-mx32/printstrn-umoven-legacy.test b/tests-mx32/printstrn-umoven-legacy.test new file mode 100755 index 00000000..062b8b07 --- /dev/null +++ b/tests-mx32/printstrn-umoven-legacy.test @@ -0,0 +1,32 @@ +#!/bin/sh +# +# Force legacy printstrn/umoven using process_vm_readv fault injection. +# +# Copyright (c) 2017-2018 Dmitry V. Levin +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +> "$LOG" || fail_ "failed to write $LOG" +fault_args='-qq -esignal=none -etrace=process_vm_readv -efault=process_vm_readv' +args='../printstrn-umoven-peekdata' + +$STRACE -o "$LOG" $fault_args $args > /dev/null || { + rc=$? + if [ $rc -eq 77 ]; then + skip_ "$fault_args $args exited with code 77" + else + fail_ "$fault_args $args failed with code $rc" + fi +} + +> "$LOG" || fail_ "failed to write $LOG" +args="-e signal=none -e trace=add_key $args skip-process_vm_readv-check" + +$STRACE -o /dev/null $fault_args \ + $STRACE -o "$LOG" $args > "$EXP" || + dump_log_and_fail_with "$STRACE $args failed with code $?" + +match_diff "$LOG" "$EXP" diff --git a/tests-mx32/printstrn-umoven-peekdata.c b/tests-mx32/printstrn-umoven-peekdata.c new file mode 100644 index 00000000..c80d9124 --- /dev/null +++ b/tests-mx32/printstrn-umoven-peekdata.c @@ -0,0 +1,27 @@ +/* + * Test PTRACE_PEEKDATA-based printstrn/umoven. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include "test_ucopy.h" +#include + +int +main(int ac, char **av) +{ + if (ac < 2 && test_process_vm_readv()) + error_msg_and_skip("process_vm_readv is available"); + + if (!test_ptrace_peekdata()) + perror_msg_and_skip("PTRACE_PEEKDATA"); + + test_printstrn(DEFAULT_STRLEN); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/printstrn-umoven-peekdata.gen.test b/tests-mx32/printstrn-umoven-peekdata.gen.test new file mode 100755 index 00000000..61f648ae --- /dev/null +++ b/tests-mx32/printstrn-umoven-peekdata.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printstrn-umoven-peekdata -e signal=none -e trace=add_key); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e signal=none -e trace=add_key diff --git a/tests-mx32/printstrn-umoven-undumpable.c b/tests-mx32/printstrn-umoven-undumpable.c new file mode 100644 index 00000000..be3f8d4b --- /dev/null +++ b/tests-mx32/printstrn-umoven-undumpable.c @@ -0,0 +1,51 @@ +/* + * Force legacy printpath/umovestr using PR_SET_DUMPABLE. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_PRCTL +# include +#endif + +#if defined HAVE_PRCTL && defined PR_SET_DUMPABLE + +# include +# include + +# include "test_ucopy.h" + +int +main(void) +{ + if (!test_process_vm_readv()) + perror_msg_and_skip("process_vm_readv"); + + /* + * Clearing dumpable flag disallows process_vm_readv. + * If the kernel does not contain commit + * 84d77d3f06e7e8dea057d10e8ec77ad71f721be3, then + * PTRACE_PEEKDATA remains allowed. + */ + if (prctl(PR_SET_DUMPABLE, 0)) + perror_msg_and_skip("PR_SET_DUMPABLE 0"); + + if (!test_ptrace_peekdata()) + perror_msg_and_skip("PTRACE_PEEKDATA"); + + test_printstrn(DEFAULT_STRLEN); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PRCTL && PR_SET_DUMPABLE") + +#endif diff --git a/tests-mx32/printstrn-umoven-undumpable.gen.test b/tests-mx32/printstrn-umoven-undumpable.gen.test new file mode 100755 index 00000000..1dee526f --- /dev/null +++ b/tests-mx32/printstrn-umoven-undumpable.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printstrn-umoven-undumpable -e signal=none -e trace=add_key); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e signal=none -e trace=add_key diff --git a/tests-mx32/printstrn-umoven.c b/tests-mx32/printstrn-umoven.c new file mode 100644 index 00000000..f9aa75dc --- /dev/null +++ b/tests-mx32/printstrn-umoven.c @@ -0,0 +1,24 @@ +/* + * Test regular printstrn/umoven. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include "test_ucopy.h" +#include + +int +main(void) +{ + if (!test_process_vm_readv()) + perror_msg_and_skip("process_vm_readv"); + + test_printstrn(4096); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/printstrn-umoven.gen.test b/tests-mx32/printstrn-umoven.gen.test new file mode 100755 index 00000000..4187238c --- /dev/null +++ b/tests-mx32/printstrn-umoven.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printstrn-umoven -s4096 -e signal=none -e trace=add_key); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s4096 -e signal=none -e trace=add_key diff --git a/tests-mx32/printxval.c b/tests-mx32/printxval.c index 4fb61c84..0cd629e4 100644 --- a/tests-mx32/printxval.c +++ b/tests-mx32/printxval.c @@ -3,30 +3,10 @@ * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman - * Copyright (c) 2005-2016 Dmitry V. Levin + * Copyright (c) 2005-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/prlimit64.c b/tests-mx32/prlimit64.c index 1e651161..688ca75f 100644 --- a/tests-mx32/prlimit64.c +++ b/tests-mx32/prlimit64.c @@ -1,30 +1,10 @@ /* * Check decoding of prlimit64 syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/prlimit64.gen.test b/tests-mx32/prlimit64.gen.test new file mode 100755 index 00000000..2c94fc9d --- /dev/null +++ b/tests-mx32/prlimit64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (prlimit64 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/prlimit64.test b/tests-mx32/prlimit64.test deleted file mode 100755 index 2d2240d7..00000000 --- a/tests-mx32/prlimit64.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of prlimit64 syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/process_vm_readv.c b/tests-mx32/process_vm_readv.c index cfb8f786..422000b8 100644 --- a/tests-mx32/process_vm_readv.c +++ b/tests-mx32/process_vm_readv.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/process_vm_readv.gen.test b/tests-mx32/process_vm_readv.gen.test new file mode 100755 index 00000000..31425887 --- /dev/null +++ b/tests-mx32/process_vm_readv.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (process_vm_readv -s5 -a37); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s5 -a37 diff --git a/tests-mx32/process_vm_readv.test b/tests-mx32/process_vm_readv.test deleted file mode 100755 index c092f5a3..00000000 --- a/tests-mx32/process_vm_readv.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of process_vm_readv syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s5 -a37 diff --git a/tests-mx32/process_vm_readv_writev.c b/tests-mx32/process_vm_readv_writev.c index 2a089395..9309135a 100644 --- a/tests-mx32/process_vm_readv_writev.c +++ b/tests-mx32/process_vm_readv_writev.c @@ -2,29 +2,10 @@ * Check decoding of process_vm_readv/process_vm_writev syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -51,7 +32,7 @@ enum { MAX_SEGM_COUNT = 2, MAX_STR_LEN = 5 }; struct print_iov_arg { uint32_t count; uint32_t valid :1, - string :1, + string :1, addr_term:1, check_rc :1; uint32_t str_segms; @@ -134,7 +115,7 @@ print_iov(const struct iovec *iov, const void *arg_ptr, long rc) } if (arg->addr_term) - printf(", %p", iov + arg->count); + printf(", ... /* %p */", iov + arg->count); printf("]"); } @@ -247,14 +228,15 @@ main(void) 2, {SEGM1_BASE, SEGM2_BASE}, {SIZE_1, SIZE_2} }; struct print_iov_arg rmt_arg = { ARRAY_SIZE(rmt_iovec), 1 }; - struct print_iov_arg bogus_arg_cut = - { ARRAY_SIZE(bogus_iovec) - 2, 1, 0, 1 }; - struct print_iov_arg lcl_arg_cut = - { ARRAY_SIZE(lcl_iovec) - 2, 1, 1, 1, 0, 2, - {SEGM1_BASE + SIZE_11 + SIZE_12, SEGM2_BASE}, - {SIZE_13, SIZE_2} }; - struct print_iov_arg rmt_arg_cut = - { ARRAY_SIZE(rmt_iovec) - 2, 1 }; + struct print_iov_arg bogus_arg_cut = { + ARRAY_SIZE(bogus_iovec) - 2, 1, 0, 1 + }; + struct print_iov_arg lcl_arg_cut = { + ARRAY_SIZE(lcl_iovec) - 2, 1, 1, 1, 0, 2, + { SEGM1_BASE + SIZE_11 + SIZE_12, SEGM2_BASE }, + {SIZE_13, SIZE_2} + }; + struct print_iov_arg rmt_arg_cut = { ARRAY_SIZE(rmt_iovec) - 2, 1 }; fill_memory_ex(data1_out, SIZE_1, SEGM1_BASE, SIZE_1); diff --git a/tests-mx32/process_vm_writev.c b/tests-mx32/process_vm_writev.c index 6271c01b..848a9e91 100644 --- a/tests-mx32/process_vm_writev.c +++ b/tests-mx32/process_vm_writev.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/process_vm_writev.gen.test b/tests-mx32/process_vm_writev.gen.test new file mode 100755 index 00000000..0b912c09 --- /dev/null +++ b/tests-mx32/process_vm_writev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (process_vm_writev -s5 -a38); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s5 -a38 diff --git a/tests-mx32/process_vm_writev.test b/tests-mx32/process_vm_writev.test deleted file mode 100755 index f690e6a9..00000000 --- a/tests-mx32/process_vm_writev.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of process_vm_writev syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s5 -a38 diff --git a/tests-mx32/pselect6.c b/tests-mx32/pselect6.c index f2644853..c8122e27 100644 --- a/tests-mx32/pselect6.c +++ b/tests-mx32/pselect6.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ /* @@ -95,20 +76,20 @@ int main(int ac, char **av) FD_SET(fds[0], set[1]); FD_SET(fds[1], set[1]); assert(syscall(__NR_pselect6, fds[1] + 1, NULL, set[1], NULL, &tm.ts, NULL) == 3); - printf("pselect6(%d, NULL, [1 2 %d %d], NULL, " - "{tv_sec=%lld, tv_nsec=%lld}, NULL) = 3 (out [1 2 %d], left " - "{tv_sec=%lld, tv_nsec=%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], - (long long) tm.ts.tv_sec, (long long) tm.ts.tv_nsec); + printf("pselect6(%d, NULL, [1 2 %d %d], NULL" + ", {tv_sec=%lld, tv_nsec=%llu}, NULL) = 3 (out [1 2 %d]" + ", left {tv_sec=%lld, tv_nsec=%llu})\n", + fds[1] + 1, fds[0], fds[1], (long long) tm_in.ts.tv_sec, + zero_extend_signed_to_ull(tm_in.ts.tv_nsec), + fds[1], (long long) tm.ts.tv_sec, + zero_extend_signed_to_ull(tm.ts.tv_nsec)); /* * Now the crash case that trinity found, negative nfds * but with a pointer to a large chunk of valid memory. */ FD_ZERO(set[0]); - FD_SET(fds[1],set[0]); + FD_SET(fds[1], set[0]); assert(pselect(-1, NULL, set[0], NULL, NULL, &mask) == -1); printf("pselect6(-1, NULL, %p, NULL, NULL, {[HUP CHLD], %u}) " "= -1 EINVAL (%m)\n", set[0], NSIG_BYTES); @@ -117,26 +98,45 @@ int main(int ac, char **av) * Another variant, with nfds exceeding FD_SETSIZE limit. */ FD_ZERO(set[0]); - FD_SET(fds[0],set[0]); + FD_SET(fds[0], set[0]); FD_ZERO(set[1]); tm.ts.tv_sec = 0; tm.ts.tv_nsec = 123; assert(pselect(FD_SETSIZE + 1, set[0], set[1], NULL, &tm.ts, &mask) == 0); - printf("pselect6(%d, [%d], [], NULL, {tv_sec=0, tv_nsec=123}, " - "{[HUP CHLD], %u}) = 0 (Timeout)\n", + printf("pselect6(%d, [%d], [], NULL, {tv_sec=0, tv_nsec=123}" + ", {[HUP CHLD], %u}) = 0 (Timeout)\n", FD_SETSIZE + 1, fds[0], NSIG_BYTES); /* * See how timeouts are decoded. */ + tm.ts.tv_sec = 0xdeadbeefU; + tm.ts.tv_nsec = 0xfacefeedU; + assert(pselect(0, NULL, NULL, NULL, &tm.ts, NULL) == -1); + printf("pselect6(0, NULL, NULL, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}, {NULL, %u}) = %s\n", + (long long) tm.ts.tv_sec, + zero_extend_signed_to_ull(tm.ts.tv_nsec), + NSIG_BYTES, sprintrc(-1)); + + tm.ts.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + tm.ts.tv_nsec = (long) 0xbadc0dedfacefeedLL; + assert(pselect(0, NULL, NULL, NULL, &tm.ts, NULL) == -1); + printf("pselect6(0, NULL, NULL, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}, {NULL, %u}) = %s\n", + (long long) tm.ts.tv_sec, + zero_extend_signed_to_ull(tm.ts.tv_nsec), + NSIG_BYTES, sprintrc(-1)); + assert(sigaction(SIGALRM, &act, NULL) == 0); assert(setitimer(ITIMER_REAL, &itv, NULL) == 0); + tm.ts.tv_sec = 0; tm.ts.tv_nsec = 222222222; assert(pselect(0, NULL, NULL, NULL, &tm.ts, &mask) == -1); - printf("pselect6(0, NULL, NULL, NULL, {tv_sec=0, tv_nsec=222222222}, " - "{[HUP CHLD], %u}) = " - "? ERESTARTNOHAND (To be restarted if no handler)\n", + printf("pselect6(0, NULL, NULL, NULL, {tv_sec=0, tv_nsec=222222222}" + ", {[HUP CHLD], %u})" + " = ? ERESTARTNOHAND (To be restarted if no handler)\n", NSIG_BYTES); puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); diff --git a/tests-mx32/pselect6.gen.test b/tests-mx32/pselect6.gen.test new file mode 100755 index 00000000..29d38963 --- /dev/null +++ b/tests-mx32/pselect6.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pselect6 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/pselect6.test b/tests-mx32/pselect6.test deleted file mode 100755 index 203f8e24..00000000 --- a/tests-mx32/pselect6.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check pselect6 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/ptrace.c b/tests-mx32/ptrace.c index 80ce8cbb..63435a76 100644 --- a/tests-mx32/ptrace.c +++ b/tests-mx32/ptrace.c @@ -2,44 +2,25 @@ * Check decoding of ptrace syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include -#ifdef __NR_rt_sigprocmask - -# include -# include -# include -# include -# include -# include -# include "ptrace.h" -# include +#include +#include "ptrace.h" +#include +#include +#include +#include +#include +#include +#include +#include static const char *errstr; @@ -59,10 +40,11 @@ test_peeksiginfo(unsigned long pid, const unsigned long bad_request) printf("ptrace(PTRACE_PEEKSIGINFO, %u, NULL, %#lx) = %s\n", (unsigned) pid, bad_request, errstr); - struct { + struct psi { unsigned long long off; unsigned int flags, nr; - } *const psi = tail_alloc(sizeof(*psi)); + }; + TAIL_ALLOC_OBJECT_CONST_PTR(struct psi, psi); psi->off = 0xdeadbeeffacefeedULL; psi->flags = 1; @@ -115,7 +97,7 @@ test_peeksiginfo(unsigned long pid, const unsigned long bad_request) if (errno == EINTR) continue; saved = errno; - kill (pid, SIGKILL); + kill(pid, SIGKILL); errno = saved; perror_msg_and_fail("wait"); } @@ -160,11 +142,11 @@ test_peeksiginfo(unsigned long pid, const unsigned long bad_request) if (do_ptrace(PTRACE_CONT, pid, 0, 0)) { saved = errno; - kill (pid, SIGKILL); + kill(pid, SIGKILL); errno = saved; perror_msg_and_fail("ptrace"); } - printf("ptrace(PTRACE_CONT, %ld, NULL, SIG_0) = 0\n", pid); + printf("ptrace(PTRACE_CONT, %ld, NULL, 0) = 0\n", pid); } } @@ -178,46 +160,40 @@ main(void) const unsigned long pid = (unsigned long) 0xdefaced00000000ULL | (unsigned) getpid(); - unsigned int sigset_size; + TAIL_ALLOC_OBJECT_CONST_PTR(uint64_t, filter_off); - for (sigset_size = 1024 / 8; sigset_size; sigset_size >>= 1) { - if (!syscall(__NR_rt_sigprocmask, - SIG_SETMASK, NULL, NULL, sigset_size)) - break; - } - if (!sigset_size) - perror_msg_and_fail("rt_sigprocmask"); + const unsigned int sigset_size = get_sigset_size(); void *const k_set = tail_alloc(sigset_size); - siginfo_t *const sip = tail_alloc(sizeof(*sip)); + TAIL_ALLOC_OBJECT_CONST_PTR(siginfo_t, sip); do_ptrace(bad_request, pid, 0, 0); printf("ptrace(%#lx /* PTRACE_??? */, %u, NULL, NULL) = %s\n", bad_request, (unsigned) pid, errstr); do_ptrace(PTRACE_PEEKDATA, pid, bad_request, bad_data); -# ifdef IA64 +#ifdef IA64 printf("ptrace(PTRACE_PEEKDATA, %u, %#lx) = %s\n", (unsigned) pid, bad_request, errstr); -# else +#else printf("ptrace(PTRACE_PEEKDATA, %u, %#lx, %#lx) = %s\n", (unsigned) pid, bad_request, bad_data, errstr); #endif do_ptrace(PTRACE_PEEKTEXT, pid, bad_request, bad_data); -# ifdef IA64 +#ifdef IA64 printf("ptrace(PTRACE_PEEKTEXT, %u, %#lx) = %s\n", (unsigned) pid, bad_request, errstr); -# else +#else printf("ptrace(PTRACE_PEEKTEXT, %u, %#lx, %#lx) = %s\n", (unsigned) pid, bad_request, bad_data, errstr); #endif do_ptrace(PTRACE_PEEKUSER, pid, bad_request, bad_data); -# ifdef IA64 +#ifdef IA64 printf("ptrace(PTRACE_PEEKUSER, %u, %#lx) = %s\n", (unsigned) pid, bad_request, errstr); -# else +#else printf("ptrace(PTRACE_PEEKUSER, %u, %#lx, %#lx) = %s\n", (unsigned) pid, bad_request, bad_data, errstr); #endif @@ -255,6 +231,22 @@ main(void) printf("ptrace(PTRACE_SECCOMP_GET_FILTER, %u, 42, NULL) = %s\n", (unsigned) pid, errstr); + do_ptrace(PTRACE_SECCOMP_GET_METADATA, pid, bad_data, 0); + printf("ptrace(PTRACE_SECCOMP_GET_METADATA, %u, %lu, NULL) = %s\n", + (unsigned) pid, bad_data, errstr); + + do_ptrace(PTRACE_SECCOMP_GET_METADATA, pid, 7, + (unsigned long) filter_off); + printf("ptrace(PTRACE_SECCOMP_GET_METADATA, %u, 7, %p) = %s\n", + (unsigned) pid, filter_off, errstr); + + *filter_off = 0xfacefeeddeadc0deULL; + do_ptrace(PTRACE_SECCOMP_GET_METADATA, pid, bad_data, + (unsigned long) filter_off); + printf("ptrace(PTRACE_SECCOMP_GET_METADATA, %u, %lu, " + "{filter_off=%" PRIu64 "}) = %s\n", + (unsigned) pid, bad_data, *filter_off, errstr); + do_ptrace(PTRACE_GETEVENTMSG, pid, bad_request, bad_data); printf("ptrace(PTRACE_GETEVENTMSG, %u, %#lx, %#lx) = %s\n", (unsigned) pid, bad_request, bad_data, errstr); @@ -446,10 +438,3 @@ main(void) puts("+++ exited with 0 +++"); return 0; } - - -#else - -SKIP_MAIN_UNDEFINED("__NR_rt_sigprocmask") - -#endif diff --git a/tests-mx32/ptrace.gen.test b/tests-mx32/ptrace.gen.test new file mode 100755 index 00000000..4b932509 --- /dev/null +++ b/tests-mx32/ptrace.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ptrace -a23 -e signal=none); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 -e signal=none diff --git a/tests-mx32/ptrace.test b/tests-mx32/ptrace.test deleted file mode 100755 index 5add9be4..00000000 --- a/tests-mx32/ptrace.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of ptrace syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a23 -e signal=none diff --git a/tests-mx32/ptrace_syscall_info.c b/tests-mx32/ptrace_syscall_info.c new file mode 100644 index 00000000..ea29d22e --- /dev/null +++ b/tests-mx32/ptrace_syscall_info.c @@ -0,0 +1,460 @@ +/* + * Check decoding of ptrace PTRACE_GET_SYSCALL_INFO request. + * + * Copyright (c) 2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include "ptrace.h" +#include +#include "scno.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "xlat.h" +#include "xlat/audit_arch.h" + +static const char *errstr; + +static long +do_ptrace(unsigned long request, unsigned long pid, + unsigned long addr, unsigned long data) +{ + long rc = syscall(__NR_ptrace, request, pid, addr, data); + errstr = sprintrc(rc); + return rc; +} + +static pid_t pid; + +static void +kill_tracee(void) +{ + if (!pid) + return; + int saved_errno = errno; + kill(pid, SIGKILL); + errno = saved_errno; +} + +#define FAIL(fmt_, ...) \ + do { \ + kill_tracee(); \ + error_msg_and_fail("%s:%d: " fmt_, \ + __FILE__, __LINE__, ##__VA_ARGS__); \ + } while (0) + +#define PFAIL(fmt_, ...) \ + do { \ + kill_tracee(); \ + perror_msg_and_fail("%s:%d: " fmt_, \ + __FILE__, __LINE__, ##__VA_ARGS__); \ + } while (0) + +static const unsigned long args[][7] = { + /* a sequence of architecture-agnostic syscalls */ + { + __NR_chdir, + (unsigned long) "", + 0xbad1fed1, + 0xbad2fed2, + 0xbad3fed3, + 0xbad4fed4, + 0xbad5fed5 + }, + { + __NR_gettid, + 0xcaf0bea0, + 0xcaf1bea1, + 0xcaf2bea2, + 0xcaf3bea3, + 0xcaf4bea4, + 0xcaf5bea5 + }, + { + __NR_exit_group, + 0, + 0xfac1c0d1, + 0xfac2c0d2, + 0xfac3c0d3, + 0xfac4c0d4, + 0xfac5c0d5 + } +}; + +static const unsigned int expected_none_size = + offsetof(struct ptrace_syscall_info, entry); +static const unsigned int expected_entry_size = + offsetofend(struct ptrace_syscall_info, entry.args); +static const unsigned int expected_exit_size = + offsetofend(struct ptrace_syscall_info, exit.is_error); + +static unsigned long end_of_page; +static unsigned int ptrace_stop; + +static bool +test_none(void) +{ + do_ptrace(PTRACE_GET_SYSCALL_INFO, pid, 1, 0); + printf("ptrace(PTRACE_GET_SYSCALL_INFO, %d, 1, NULL) = %s\n", + pid, errstr); + + do_ptrace(PTRACE_GET_SYSCALL_INFO, pid, 1, end_of_page); + printf("ptrace(PTRACE_GET_SYSCALL_INFO, %d, 1, %#lx) = %s\n", + pid, end_of_page, errstr); + + for (unsigned int size = 0; + size <= sizeof(struct ptrace_syscall_info); ++size) { + unsigned long buf = end_of_page - size; + memset((void *) buf, -1, size); + + long rc = do_ptrace(PTRACE_GET_SYSCALL_INFO, pid, size, buf); + if (rc < 0) { + printf("ptrace(PTRACE_GET_SYSCALL_INFO, %d, %u, %#lx)" + " = %s\n", + pid, (unsigned int) size, buf, errstr); + return false; + } + if (rc < (long) expected_none_size) + FAIL("signal stop mismatch"); + + printf("ptrace(PTRACE_GET_SYSCALL_INFO, %d, %u, ", + pid, size); + if (!size) { + printf("%#lx) = %s\n", buf, errstr); + continue; + } + + /* copy to a local structure to avoid unaligned access */ + struct ptrace_syscall_info info; + memcpy(&info, (void *) buf, MIN(size, expected_none_size)); + + if (info.op != PTRACE_SYSCALL_INFO_NONE) + FAIL("signal stop mismatch"); + printf("{op=PTRACE_SYSCALL_INFO_NONE"); + + if (size < offsetofend(struct ptrace_syscall_info, arch)) + goto printed_none; + if (!info.arch) + FAIL("signal stop mismatch"); + printf(", arch="); + printxval(audit_arch, info.arch, "AUDIT_ARCH_???"); + + if (size < offsetofend(struct ptrace_syscall_info, + instruction_pointer)) + goto printed_none; + if (!info.instruction_pointer) + FAIL("signal stop mismatch"); + printf(", instruction_pointer=%#llx", + (unsigned long long) info.instruction_pointer); + + if (size < offsetofend(struct ptrace_syscall_info, + stack_pointer)) + goto printed_none; + if (!info.stack_pointer) + FAIL("signal stop mismatch"); + printf(", stack_pointer=%#llx", + (unsigned long long) info.stack_pointer); + +printed_none: + printf("}) = %s\n", errstr); + } + + return true; +} + +static void +test_entry(void) +{ + for (unsigned int size = 0; + size <= sizeof(struct ptrace_syscall_info); ++size) { + unsigned long buf = end_of_page - size; + memset((void *) buf, -1, size); + + long rc = do_ptrace(PTRACE_GET_SYSCALL_INFO, pid, size, buf); + if (rc < 0) + PFAIL("PTRACE_GET_SYSCALL_INFO"); + + if (rc < (long) expected_entry_size) + FAIL("#%d: entry stop mismatch", ptrace_stop); + + printf("ptrace(PTRACE_GET_SYSCALL_INFO, %d, %u, ", + pid, size); + if (!size) { + printf("%#lx) = %s\n", buf, errstr); + continue; + } + + /* copy to a local structure to avoid unaligned access */ + struct ptrace_syscall_info info; + memcpy(&info, (void *) buf, MIN(size, expected_entry_size)); + + if (info.op != PTRACE_SYSCALL_INFO_ENTRY) + FAIL("#%d: entry stop mismatch", ptrace_stop); + printf("{op=PTRACE_SYSCALL_INFO_ENTRY"); + + if (size < offsetofend(struct ptrace_syscall_info, arch)) + goto printed_entry_common; + if (!info.arch) + FAIL("#%d: entry stop mismatch", ptrace_stop); + printf(", arch="); + printxval(audit_arch, info.arch, "AUDIT_ARCH_???"); + + if (size < offsetofend(struct ptrace_syscall_info, + instruction_pointer)) + goto printed_entry_common; + if (!info.instruction_pointer) + FAIL("#%d: entry stop mismatch", ptrace_stop); + printf(", instruction_pointer=%#llx", + (unsigned long long) info.instruction_pointer); + + if (size < offsetofend(struct ptrace_syscall_info, + stack_pointer)) + goto printed_entry_common; + if (!info.stack_pointer) + FAIL("#%d: entry stop mismatch", ptrace_stop); + printf(", stack_pointer=%#llx", + (unsigned long long) info.stack_pointer); + + if (size < offsetofend(struct ptrace_syscall_info, entry.nr)) + goto printed_entry_common; + const unsigned long *exp_args = args[ptrace_stop / 2]; + if (info.entry.nr != exp_args[0]) + FAIL("#%d: entry stop mismatch", ptrace_stop); + printf(", entry={nr=%llu", (unsigned long long) info.entry.nr); + + for (unsigned int i = 0; i < ARRAY_SIZE(info.entry.args); ++i) { + const unsigned int i_size = + offsetofend(struct ptrace_syscall_info, + entry.args[i]); + if (size < i_size) { + if (i) + break; + goto printed_entry_nr; + } + if (info.entry.args[i] != exp_args[i + 1]) + FAIL("#%d: entry stop mismatch", ptrace_stop); + printf("%s%#llx", (i ? ", " : ", arg=["), + (unsigned long long) info.entry.args[i]); + } + printf("]"); + +printed_entry_nr: + printf("}"); + +printed_entry_common: + printf("}) = %s\n", errstr); + } +} + +static void +test_exit(void) +{ + for (unsigned int size = 0; + size <= sizeof(struct ptrace_syscall_info); ++size) { + unsigned long buf = end_of_page - size; + memset((void *) buf, -1, size); + + long rc = do_ptrace(PTRACE_GET_SYSCALL_INFO, pid, size, buf); + if (rc < 0) + PFAIL("PTRACE_GET_SYSCALL_INFO"); + + if (rc < (long) expected_exit_size) + FAIL("#%d: exit stop mismatch", ptrace_stop); + + printf("ptrace(PTRACE_GET_SYSCALL_INFO, %d, %u, ", + pid, size); + if (!size) { + printf("%#lx) = %s\n", buf, errstr); + continue; + } + + /* copy to a local structure to avoid unaligned access */ + struct ptrace_syscall_info info; + memcpy(&info, (void *) buf, MIN(size, expected_exit_size)); + + if (info.op != PTRACE_SYSCALL_INFO_EXIT) + FAIL("#%d: exit stop mismatch", ptrace_stop); + printf("{op=PTRACE_SYSCALL_INFO_EXIT"); + + if (size < offsetofend(struct ptrace_syscall_info, arch)) + goto printed_exit_common; + if (!info.arch) + FAIL("#%d: exit stop mismatch", ptrace_stop); + printf(", arch="); + printxval(audit_arch, info.arch, "AUDIT_ARCH_???"); + + if (size < offsetofend(struct ptrace_syscall_info, + instruction_pointer)) + goto printed_exit_common; + if (!info.instruction_pointer) + FAIL("#%d: exit stop mismatch", ptrace_stop); + printf(", instruction_pointer=%#llx", + (unsigned long long) info.instruction_pointer); + + if (size < offsetofend(struct ptrace_syscall_info, + stack_pointer)) + goto printed_exit_common; + if (!info.stack_pointer) + FAIL("#%d: exit stop mismatch", ptrace_stop); + printf(", stack_pointer=%#llx", + (unsigned long long) info.stack_pointer); + + const struct { + unsigned int is_error; + int rval; + const char *str; + } exit_param[] = { + { 1, -ENOENT, "-ENOENT" }, /* chdir */ + { 0, pid, NULL } /* gettid */ + }, *exp_param = &exit_param[ptrace_stop / 2 - 1]; + + if (size < offsetofend(struct ptrace_syscall_info, exit.rval)) + goto printed_exit_common; + if (info.exit.rval != exp_param->rval) + FAIL("#%d: exit stop mismatch", ptrace_stop); + if (size >= expected_exit_size && info.exit.is_error) { + printf(", exit={rval=%s", exp_param->str); + } else { + printf(", exit={rval=%lld", (long long) info.exit.rval); + } + + if (size >= expected_exit_size) { + if (info.exit.is_error != exp_param->is_error) + FAIL("#%d: exit stop mismatch", ptrace_stop); + printf(", is_error=%u", + (unsigned int) info.exit.is_error); + } + + printf("}"); + +printed_exit_common: + printf("}) = %s\n", errstr); + } +} + +int +main(void) +{ + end_of_page = (unsigned long) tail_alloc(1) + 1; + + pid = getpid(); + do_ptrace(PTRACE_GET_SYSCALL_INFO, pid, 0, 0); + printf("ptrace(PTRACE_GET_SYSCALL_INFO, %d, 0, NULL) = %s\n", + pid, errstr); + + pid = fork(); + if (pid < 0) + PFAIL("fork"); + + if (pid == 0) { + /* get the pid before PTRACE_TRACEME */ + pid = getpid(); + if (do_ptrace(PTRACE_TRACEME, 0, 0, 0) < 0) { + /* exit with a nonzero exit status */ + PFAIL("PTRACE_TRACEME"); + } + kill(pid, SIGSTOP); + for (unsigned int i = 0; i < ARRAY_SIZE(args); ++i) { + syscall(args[i][0], + args[i][1], args[i][2], args[i][3], + args[i][4], args[i][5], args[i][6]); + } + /* unreachable */ + _exit(1); + } + + for (ptrace_stop = 0; ; ++ptrace_stop) { + int status; + long rc = waitpid(pid, &status, 0); + if (rc != pid) { + /* cannot happen */ + PFAIL("#%d: unexpected wait result %ld", + ptrace_stop, rc); + } + if (WIFEXITED(status)) { + /* tracee is no more */ + pid = 0; + if (WEXITSTATUS(status) == 0) + break; + FAIL("#%d: unexpected exit status %u", + ptrace_stop, WEXITSTATUS(status)); + } + if (WIFSIGNALED(status)) { + /* tracee is no more */ + pid = 0; + FAIL("#%d: unexpected signal %u", + ptrace_stop, WTERMSIG(status)); + } + if (!WIFSTOPPED(status)) { + /* cannot happen */ + FAIL("#%d: unexpected wait status %#x", + ptrace_stop, status); + } + + switch (WSTOPSIG(status)) { + case SIGSTOP: + if (ptrace_stop) + FAIL("#%d: unexpected signal stop", + ptrace_stop); + if (do_ptrace(PTRACE_SETOPTIONS, pid, 0, + PTRACE_O_TRACESYSGOOD) < 0) { + /* cannot happen */ + PFAIL("PTRACE_SETOPTIONS"); + } + printf("ptrace(PTRACE_SETOPTIONS, %d, NULL" + ", PTRACE_O_TRACESYSGOOD) = 0\n", pid); + + if (!test_none()) + goto done; + break; + + case SIGTRAP | 0x80: + switch (ptrace_stop) { + case 1: /* entering chdir */ + case 3: /* entering gettid */ + case 5: /* entering exit_group */ + test_entry(); + break; + case 2: /* exiting chdir */ + case 4: /* exiting gettid */ + test_exit(); + break; + default: + FAIL("#%d: unexpected syscall stop", + ptrace_stop); + } + break; + + default: + FAIL("#%d: unexpected stop signal %#x", + ptrace_stop, WSTOPSIG(status)); + } + + if (do_ptrace(PTRACE_SYSCALL, pid, 0, 0) < 0) { + /* cannot happen */ + PFAIL("PTRACE_SYSCALL"); + } + printf("ptrace(PTRACE_SYSCALL, %d, NULL, 0) = 0\n", pid); + } + +done: + if (pid) { + kill_tracee(); + waitpid(pid, NULL, 0); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/ptrace_syscall_info.gen.test b/tests-mx32/ptrace_syscall_info.gen.test new file mode 100755 index 00000000..1314eee6 --- /dev/null +++ b/tests-mx32/ptrace_syscall_info.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ptrace_syscall_info -a35 -e signal=none -e trace=ptrace); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 -e signal=none -e trace=ptrace diff --git a/tests-mx32/pure_executables.am b/tests-mx32/pure_executables.am new file mode 100644 index 00000000..cc844502 --- /dev/null +++ b/tests-mx32/pure_executables.am @@ -0,0 +1,522 @@ +# Generated by ./tests/gen_pure_executables.sh from ./tests/pure_executables.list; do not edit. +PURE_EXECUTABLES = \ + _newselect \ + accept \ + accept4 \ + access \ + acct \ + add_key \ + adjtimex \ + aio \ + aio_pgetevents \ + alarm \ + bpf \ + bpf-obj_get_info_by_fd \ + bpf-obj_get_info_by_fd-prog \ + bpf-obj_get_info_by_fd-prog-v \ + bpf-obj_get_info_by_fd-v \ + bpf-v \ + brk \ + btrfs \ + caps \ + chmod \ + chown \ + chown32 \ + chroot \ + clock_adjtime \ + clock_nanosleep \ + clock_xettime \ + copy_file_range \ + creat \ + delete_module \ + dev-yy \ + dup \ + dup2 \ + dup3 \ + epoll_create \ + epoll_create1 \ + epoll_ctl \ + epoll_pwait \ + epoll_wait \ + erestartsys \ + eventfd \ + execve \ + execveat \ + faccessat \ + fadvise64 \ + fadvise64_64 \ + fallocate \ + fanotify_init \ + fanotify_mark \ + fanotify_mark-Xabbrev \ + fanotify_mark-Xraw \ + fanotify_mark-Xverbose \ + fchdir \ + fchmod \ + fchmodat \ + fchown \ + fchown32 \ + fchownat \ + fcntl \ + fcntl64 \ + fdatasync \ + fflush \ + file_handle \ + file_ioctl \ + finit_module \ + flock \ + fstat \ + fstat-Xabbrev \ + fstat-Xraw \ + fstat-Xverbose \ + fstat64 \ + fstat64-Xabbrev \ + fstat64-Xraw \ + fstat64-Xverbose \ + fstatat64 \ + fstatfs \ + fstatfs64 \ + fsync \ + ftruncate \ + ftruncate64 \ + futex \ + futimesat \ + get_mempolicy \ + getcpu \ + getcwd \ + getdents \ + getdents64 \ + getegid \ + getegid32 \ + geteuid \ + geteuid32 \ + getgid \ + getgid32 \ + getgroups \ + getgroups32 \ + getpeername \ + getpgrp \ + getpid \ + getppid \ + getrandom \ + getresgid \ + getresgid32 \ + getresuid \ + getresuid32 \ + getrlimit \ + getrusage \ + getsid \ + getsockname \ + getuid \ + getuid32 \ + getxxid \ + group_req \ + inet-cmsg \ + init_module \ + inotify \ + inotify_init1 \ + io_uring_enter \ + io_uring_register \ + io_uring_setup \ + ioctl \ + ioctl_block \ + ioctl_dm \ + ioctl_evdev \ + ioctl_inotify \ + ioctl_kvm_run \ + ioctl_kvm_run-v \ + ioctl_kvm_run_auxstr_vcpu \ + ioctl_loop \ + ioctl_mtd \ + ioctl_nbd \ + ioctl_perf \ + ioctl_ptp \ + ioctl_random \ + ioctl_rtc \ + ioctl_scsi \ + ioctl_sg_io_v3 \ + ioctl_sg_io_v4 \ + ioctl_sock_gifconf \ + ioctl_uffdio \ + ioctl_v4l2 \ + ioperm \ + iopl \ + ioprio \ + ioprio-Xabbrev \ + ioprio-Xraw \ + ioprio-Xverbose \ + ip_mreq \ + ipc \ + ipc_msg \ + ipc_msg-Xabbrev \ + ipc_msg-Xraw \ + ipc_msg-Xverbose \ + ipc_msgbuf \ + ipc_msgbuf-Xabbrev \ + ipc_msgbuf-Xraw \ + ipc_msgbuf-Xverbose \ + ipc_sem \ + ipc_sem-Xabbrev \ + ipc_sem-Xraw \ + ipc_sem-Xverbose \ + ipc_shm \ + ipc_shm-Xabbrev \ + ipc_shm-Xraw \ + ipc_shm-Xverbose \ + kcmp \ + kcmp-y \ + kern_features \ + kernel_version \ + kernel_version-Xabbrev \ + kernel_version-Xraw \ + kernel_version-Xverbose \ + kexec_file_load \ + kexec_load \ + keyctl \ + keyctl-Xabbrev \ + keyctl-Xraw \ + keyctl-Xverbose \ + kill \ + lchown \ + lchown32 \ + link \ + linkat \ + llseek \ + lookup_dcookie \ + lseek \ + lstat \ + lstat64 \ + madvise \ + mbind \ + membarrier \ + memfd_create \ + memfd_create-Xabbrev \ + memfd_create-Xraw \ + memfd_create-Xverbose \ + migrate_pages \ + mincore \ + mkdir \ + mkdirat \ + mknod \ + mknodat \ + mlock \ + mlock2 \ + mlockall \ + mmap \ + mmap-Xabbrev \ + mmap-Xraw \ + mmap-Xverbose \ + mmap64 \ + mmap64-Xabbrev \ + mmap64-Xraw \ + mmap64-Xverbose \ + mmsg \ + mmsg_name \ + modify_ldt \ + mount \ + mount-Xabbrev \ + mount-Xraw \ + mount-Xverbose \ + move_pages \ + move_pages-Xabbrev \ + move_pages-Xraw \ + move_pages-Xverbose \ + mq \ + mq_sendrecv \ + mq_sendrecv-read \ + mq_sendrecv-write \ + msg_control \ + msg_name \ + munlockall \ + nanosleep \ + net-icmp_filter \ + net-packet_mreq \ + net-packet_mreq-Xabbrev \ + net-packet_mreq-Xraw \ + net-packet_mreq-Xverbose \ + net-sockaddr \ + net-tpacket_req \ + net-tpacket_stats \ + net-y-unix \ + net-yy-inet \ + net-yy-inet6 \ + net-yy-netlink \ + net-yy-unix \ + netlink_audit \ + netlink_crypto \ + netlink_generic \ + netlink_kobject_uevent \ + netlink_netfilter \ + netlink_protocol \ + netlink_route \ + netlink_selinux \ + netlink_sock_diag \ + netlink_xfrm \ + newfstatat \ + nfnetlink_acct \ + nfnetlink_cthelper \ + nfnetlink_ctnetlink \ + nfnetlink_ctnetlink_exp \ + nfnetlink_cttimeout \ + nfnetlink_ipset \ + nfnetlink_nft_compat \ + nfnetlink_nftables \ + nfnetlink_osf \ + nfnetlink_queue \ + nfnetlink_ulog \ + nlattr \ + nlattr_br_port_msg \ + nlattr_crypto_user_alg \ + nlattr_dcbmsg \ + nlattr_fib_rule_hdr \ + nlattr_ifaddrlblmsg \ + nlattr_ifaddrmsg \ + nlattr_ifinfomsg \ + nlattr_ifla_af_spec \ + nlattr_ifla_brport \ + nlattr_ifla_linkinfo \ + nlattr_ifla_port \ + nlattr_ifla_xdp \ + nlattr_inet_diag_msg \ + nlattr_inet_diag_req_compat \ + nlattr_inet_diag_req_v2 \ + nlattr_mdba_mdb_entry \ + nlattr_mdba_router_port \ + nlattr_ndmsg \ + nlattr_ndtmsg \ + nlattr_netconfmsg \ + nlattr_netlink_diag_msg \ + nlattr_nlmsgerr \ + nlattr_packet_diag_msg \ + nlattr_rtgenmsg \ + nlattr_rtmsg \ + nlattr_smc_diag_msg \ + nlattr_tc_stats \ + nlattr_tca_stab \ + nlattr_tcamsg \ + nlattr_tcmsg \ + nlattr_unix_diag_msg \ + old_mmap \ + old_mmap-P \ + old_mmap-Xabbrev \ + old_mmap-Xraw \ + old_mmap-Xverbose \ + old_mmap-v-none \ + oldfstat \ + oldlstat \ + oldselect \ + oldselect-efault \ + oldstat \ + open \ + openat \ + osf_utimes \ + pause \ + perf_event_open \ + personality \ + personality-Xabbrev \ + personality-Xraw \ + personality-Xverbose \ + pidfd_send_signal \ + pipe \ + pipe2 \ + pkey_alloc \ + pkey_free \ + pkey_mprotect \ + poll \ + poll-P \ + ppoll \ + ppoll-P \ + prctl-arg2-intptr \ + prctl-dumpable \ + prctl-name \ + prctl-no-args \ + prctl-pdeathsig \ + prctl-securebits \ + prctl-tid_address \ + prctl-tsc \ + pread64-pwrite64 \ + preadv \ + preadv-pwritev \ + preadv2-pwritev2 \ + printpath-umovestr \ + printpath-umovestr-peekdata \ + printpath-umovestr-undumpable \ + printsignal-Xabbrev \ + printsignal-Xraw \ + printsignal-Xverbose \ + printstr \ + printstrn-umoven \ + printstrn-umoven-peekdata \ + printstrn-umoven-undumpable \ + prlimit64 \ + process_vm_readv \ + process_vm_writev \ + pselect6 \ + ptrace \ + ptrace_syscall_info \ + pwritev \ + quotactl \ + quotactl-Xabbrev \ + quotactl-Xraw \ + quotactl-Xverbose \ + quotactl-xfs \ + read-write \ + readahead \ + readdir \ + readlink \ + readlinkat \ + readv \ + reboot \ + recvfrom \ + recvmmsg-timeout \ + recvmsg \ + remap_file_pages \ + remap_file_pages-Xabbrev \ + remap_file_pages-Xraw \ + remap_file_pages-Xverbose \ + rename \ + renameat \ + renameat2 \ + request_key \ + riscv_flush_icache \ + rmdir \ + rt_sigaction \ + rt_sigpending \ + rt_sigprocmask \ + rt_sigqueueinfo \ + rt_sigreturn \ + rt_sigsuspend \ + rt_sigtimedwait \ + rt_tgsigqueueinfo \ + s390_guarded_storage \ + s390_guarded_storage-v \ + s390_pci_mmio_read_write \ + s390_runtime_instr \ + s390_sthyi \ + s390_sthyi-v \ + sched_get_priority_mxx \ + sched_rr_get_interval \ + sched_xetaffinity \ + sched_xetattr \ + sched_xetparam \ + sched_xetscheduler \ + sched_yield \ + seccomp-filter \ + seccomp_get_action_avail \ + select \ + semop \ + sendfile \ + sendfile64 \ + set_mempolicy \ + setdomainname \ + setfsgid \ + setfsgid32 \ + setfsuid \ + setfsuid32 \ + setgid \ + setgid32 \ + setgroups \ + setgroups32 \ + sethostname \ + setns \ + setregid \ + setregid32 \ + setresgid \ + setresgid32 \ + setresuid \ + setresuid32 \ + setreuid \ + setreuid32 \ + setrlimit \ + setrlimit-Xabbrev \ + setrlimit-Xraw \ + setrlimit-Xverbose \ + setuid \ + setuid32 \ + shmxt \ + shutdown \ + sigaction \ + sigaltstack \ + siginfo \ + signal \ + signalfd4 \ + sigpending \ + sigprocmask \ + sigreturn \ + sigsuspend \ + so_error \ + so_linger \ + so_peercred \ + so_peercred-Xabbrev \ + so_peercred-Xraw \ + so_peercred-Xverbose \ + sock_filter-v \ + sock_filter-v-Xabbrev \ + sock_filter-v-Xraw \ + sock_filter-v-Xverbose \ + sockaddr_xlat-Xabbrev \ + sockaddr_xlat-Xraw \ + sockaddr_xlat-Xverbose \ + socketcall \ + sockopt-sol_netlink \ + sockopt-timestamp \ + splice \ + stat \ + stat64 \ + statfs \ + statfs64 \ + statx \ + swap \ + sxetmask \ + symlink \ + symlinkat \ + sync \ + sync_file_range \ + sync_file_range2 \ + sysinfo \ + syslog \ + tee \ + time \ + timer_create \ + timer_xettime \ + timerfd_xettime \ + times \ + times-fail \ + truncate \ + truncate64 \ + ugetrlimit \ + uio \ + umask \ + umount \ + umount2 \ + umoven-illptr \ + umovestr \ + umovestr-illptr \ + umovestr2 \ + umovestr3 \ + uname \ + unlink \ + unlinkat \ + unshare \ + userfaultfd \ + ustat \ + utime \ + utimensat \ + utimensat-Xabbrev \ + utimensat-Xraw \ + utimensat-Xverbose \ + utimes \ + vhangup \ + vmsplice \ + wait4 \ + waitid \ + waitpid \ + xattr \ + xattr-strings \ + xet_robust_list \ + xet_thread_area_x86 \ + xetitimer \ + xetpgid \ + xetpriority \ + xettimeofday \ + # diff --git a/tests-mx32/pure_executables.list b/tests-mx32/pure_executables.list new file mode 100755 index 00000000..37225209 --- /dev/null +++ b/tests-mx32/pure_executables.list @@ -0,0 +1,526 @@ +# Executables without side effects. +# +# Copyright (c) 2017-2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +_newselect +accept +accept4 +access +acct +add_key +adjtimex +aio +aio_pgetevents +alarm +bpf +bpf-obj_get_info_by_fd +bpf-obj_get_info_by_fd-prog +bpf-obj_get_info_by_fd-prog-v +bpf-obj_get_info_by_fd-v +bpf-v +brk +btrfs +caps +chmod +chown +chown32 +chroot +clock_adjtime +clock_nanosleep +clock_xettime +copy_file_range +creat +delete_module +dev-yy +dup +dup2 +dup3 +epoll_create +epoll_create1 +epoll_ctl +epoll_pwait +epoll_wait +erestartsys +eventfd +execve +execveat +faccessat +fadvise64 +fadvise64_64 +fallocate +fanotify_init +fanotify_mark +fanotify_mark-Xabbrev +fanotify_mark-Xraw +fanotify_mark-Xverbose +fchdir +fchmod +fchmodat +fchown +fchown32 +fchownat +fcntl +fcntl64 +fdatasync +fflush +file_handle +file_ioctl +finit_module +flock +fstat +fstat-Xabbrev +fstat-Xraw +fstat-Xverbose +fstat64 +fstat64-Xabbrev +fstat64-Xraw +fstat64-Xverbose +fstatat64 +fstatfs +fstatfs64 +fsync +ftruncate +ftruncate64 +futex +futimesat +get_mempolicy +getcpu +getcwd +getdents +getdents64 +getegid +getegid32 +geteuid +geteuid32 +getgid +getgid32 +getgroups +getgroups32 +getpeername +getpgrp +getpid +getppid +getrandom +getresgid +getresgid32 +getresuid +getresuid32 +getrlimit +getrusage +getsid +getsockname +getuid +getuid32 +getxxid +group_req +inet-cmsg +init_module +inotify +inotify_init1 +io_uring_enter +io_uring_register +io_uring_setup +ioctl +ioctl_block +ioctl_dm +ioctl_evdev +ioctl_inotify +ioctl_kvm_run +ioctl_kvm_run-v +ioctl_kvm_run_auxstr_vcpu +ioctl_loop +ioctl_mtd +ioctl_nbd +ioctl_perf +ioctl_ptp +ioctl_random +ioctl_rtc +ioctl_scsi +ioctl_sg_io_v3 +ioctl_sg_io_v4 +ioctl_sock_gifconf +ioctl_uffdio +ioctl_v4l2 +ioperm +iopl +ioprio +ioprio-Xabbrev +ioprio-Xraw +ioprio-Xverbose +ip_mreq +ipc +ipc_msg +ipc_msg-Xabbrev +ipc_msg-Xraw +ipc_msg-Xverbose +ipc_msgbuf +ipc_msgbuf-Xabbrev +ipc_msgbuf-Xraw +ipc_msgbuf-Xverbose +ipc_sem +ipc_sem-Xabbrev +ipc_sem-Xraw +ipc_sem-Xverbose +ipc_shm +ipc_shm-Xabbrev +ipc_shm-Xraw +ipc_shm-Xverbose +kcmp +kcmp-y +kern_features +kernel_version +kernel_version-Xabbrev +kernel_version-Xraw +kernel_version-Xverbose +kexec_file_load +kexec_load +keyctl +keyctl-Xabbrev +keyctl-Xraw +keyctl-Xverbose +kill +lchown +lchown32 +link +linkat +llseek +lookup_dcookie +lseek +lstat +lstat64 +madvise +mbind +membarrier +memfd_create +memfd_create-Xabbrev +memfd_create-Xraw +memfd_create-Xverbose +migrate_pages +mincore +mkdir +mkdirat +mknod +mknodat +mlock +mlock2 +mlockall +mmap +mmap-Xabbrev +mmap-Xraw +mmap-Xverbose +mmap64 +mmap64-Xabbrev +mmap64-Xraw +mmap64-Xverbose +mmsg +mmsg_name +modify_ldt +mount +mount-Xabbrev +mount-Xraw +mount-Xverbose +move_pages +move_pages-Xabbrev +move_pages-Xraw +move_pages-Xverbose +mq +mq_sendrecv +mq_sendrecv-read +mq_sendrecv-write +msg_control +msg_name +munlockall +nanosleep +net-icmp_filter +net-packet_mreq +net-packet_mreq-Xabbrev +net-packet_mreq-Xraw +net-packet_mreq-Xverbose +net-sockaddr +net-tpacket_req +net-tpacket_stats +net-y-unix +net-yy-inet +net-yy-inet6 +net-yy-netlink +net-yy-unix +netlink_audit +netlink_crypto +netlink_generic +netlink_kobject_uevent +netlink_netfilter +netlink_protocol +netlink_route +netlink_selinux +netlink_sock_diag +netlink_xfrm +newfstatat +nfnetlink_acct +nfnetlink_cthelper +nfnetlink_ctnetlink +nfnetlink_ctnetlink_exp +nfnetlink_cttimeout +nfnetlink_ipset +nfnetlink_nft_compat +nfnetlink_nftables +nfnetlink_osf +nfnetlink_queue +nfnetlink_ulog +nlattr +nlattr_br_port_msg +nlattr_crypto_user_alg +nlattr_dcbmsg +nlattr_fib_rule_hdr +nlattr_ifaddrlblmsg +nlattr_ifaddrmsg +nlattr_ifinfomsg +nlattr_ifla_af_spec +nlattr_ifla_brport +nlattr_ifla_linkinfo +nlattr_ifla_port +nlattr_ifla_xdp +nlattr_inet_diag_msg +nlattr_inet_diag_req_compat +nlattr_inet_diag_req_v2 +nlattr_mdba_mdb_entry +nlattr_mdba_router_port +nlattr_ndmsg +nlattr_ndtmsg +nlattr_netconfmsg +nlattr_netlink_diag_msg +nlattr_nlmsgerr +nlattr_packet_diag_msg +nlattr_rtgenmsg +nlattr_rtmsg +nlattr_smc_diag_msg +nlattr_tc_stats +nlattr_tca_stab +nlattr_tcamsg +nlattr_tcmsg +nlattr_unix_diag_msg +old_mmap +old_mmap-P +old_mmap-Xabbrev +old_mmap-Xraw +old_mmap-Xverbose +old_mmap-v-none +oldfstat +oldlstat +oldselect +oldselect-efault +oldstat +open +openat +osf_utimes +pause +perf_event_open +personality +personality-Xabbrev +personality-Xraw +personality-Xverbose +pidfd_send_signal +pipe +pipe2 +pkey_alloc +pkey_free +pkey_mprotect +poll +poll-P +ppoll +ppoll-P +prctl-arg2-intptr +prctl-dumpable +prctl-name +prctl-no-args +prctl-pdeathsig +prctl-securebits +prctl-tid_address +prctl-tsc +pread64-pwrite64 +preadv +preadv-pwritev +preadv2-pwritev2 +printpath-umovestr +printpath-umovestr-peekdata +printpath-umovestr-undumpable +printsignal-Xabbrev +printsignal-Xraw +printsignal-Xverbose +printstr +printstrn-umoven +printstrn-umoven-peekdata +printstrn-umoven-undumpable +prlimit64 +process_vm_readv +process_vm_writev +pselect6 +ptrace +ptrace_syscall_info +pwritev +quotactl +quotactl-Xabbrev +quotactl-Xraw +quotactl-Xverbose +quotactl-xfs +read-write +readahead +readdir +readlink +readlinkat +readv +reboot +recvfrom +recvmmsg-timeout +recvmsg +remap_file_pages +remap_file_pages-Xabbrev +remap_file_pages-Xraw +remap_file_pages-Xverbose +rename +renameat +renameat2 +request_key +riscv_flush_icache +rmdir +rt_sigaction +rt_sigpending +rt_sigprocmask +rt_sigqueueinfo +rt_sigreturn +rt_sigsuspend +rt_sigtimedwait +rt_tgsigqueueinfo +s390_guarded_storage +s390_guarded_storage-v +s390_pci_mmio_read_write +s390_runtime_instr +s390_sthyi +s390_sthyi-v +sched_get_priority_mxx +sched_rr_get_interval +sched_xetaffinity +sched_xetattr +sched_xetparam +sched_xetscheduler +sched_yield +seccomp-filter +seccomp_get_action_avail +select +semop +sendfile +sendfile64 +set_mempolicy +setdomainname +setfsgid +setfsgid32 +setfsuid +setfsuid32 +setgid +setgid32 +setgroups +setgroups32 +sethostname +setns +setregid +setregid32 +setresgid +setresgid32 +setresuid +setresuid32 +setreuid +setreuid32 +setrlimit +setrlimit-Xabbrev +setrlimit-Xraw +setrlimit-Xverbose +setuid +setuid32 +shmxt +shutdown +sigaction +sigaltstack +siginfo +signal +signalfd4 +sigpending +sigprocmask +sigreturn +sigsuspend +so_error +so_linger +so_peercred +so_peercred-Xabbrev +so_peercred-Xraw +so_peercred-Xverbose +sock_filter-v +sock_filter-v-Xabbrev +sock_filter-v-Xraw +sock_filter-v-Xverbose +sockaddr_xlat-Xabbrev +sockaddr_xlat-Xraw +sockaddr_xlat-Xverbose +socketcall +sockopt-sol_netlink +sockopt-timestamp +splice +stat +stat64 +statfs +statfs64 +statx +swap +sxetmask +symlink +symlinkat +sync +sync_file_range +sync_file_range2 +sysinfo +syslog +tee +time +timer_create +timer_xettime +timerfd_xettime +times +times-fail +truncate +truncate64 +ugetrlimit +uio +umask +umount +umount2 +umoven-illptr +umovestr +umovestr-illptr +umovestr2 +umovestr3 +uname +unlink +unlinkat +unshare +userfaultfd +ustat +utime +utimensat +utimensat-Xabbrev +utimensat-Xraw +utimensat-Xverbose +utimes +vhangup +vmsplice +wait4 +waitid +waitpid +xattr +xattr-strings +xet_robust_list +xet_thread_area_x86 +xetitimer +xetpgid +xetpriority +xettimeofday diff --git a/tests-mx32/pwritev.c b/tests-mx32/pwritev.c index 58e5b41e..a1442ab4 100644 --- a/tests-mx32/pwritev.c +++ b/tests-mx32/pwritev.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -65,7 +46,7 @@ print_iovec(const struct iovec *iov, unsigned int cnt, unsigned int size) if (i) fputs(", ", stdout); if (i == size) { - printf("%p", &iov[i]); + printf("... /* %p */", &iov[i]); break; } if (i == LIM) { diff --git a/tests-mx32/pwritev.gen.test b/tests-mx32/pwritev.gen.test new file mode 100755 index 00000000..e54fd154 --- /dev/null +++ b/tests-mx32/pwritev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pwritev -a22 -s7); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -s7 diff --git a/tests-mx32/pwritev.test b/tests-mx32/pwritev.test deleted file mode 100755 index 0aed6835..00000000 --- a/tests-mx32/pwritev.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check pwritev syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a22 -s7 diff --git a/tests-mx32/qual_fault-exit_group.test b/tests-mx32/qual_fault-exit_group.test index c98ffc6e..48a1b8c8 100755 --- a/tests-mx32/qual_fault-exit_group.test +++ b/tests-mx32/qual_fault-exit_group.test @@ -3,29 +3,10 @@ # Check decoding of fault injected exit_group syscall. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/scno_tampering.sh" @@ -41,13 +22,13 @@ test_with() match_diff } -test_with -eexit,exit_group -efault=exit_group:error=ENOSYS ./answer +test_with -eexit,exit_group -efault=exit_group:error=ENOSYS ../answer test_with -eexit,exit_group -efault=exit_group:error=ENOSYS \ - -efault=\!process:error=1 ./answer + -efault=\!process:error=1 ../answer test_with -eexit,exit_group -efault=all:error=ENOSYS \ - -efault=exit:error=1:when=2+ ./answer + -efault=exit:error=1:when=2+ ../answer test_with -eexit,exit_group -efault=exit_group:error=ENOSYS \ - -efault=\!desc,file,memory,process,signal,network,ipc:error=1 ./answer + -efault=\!%desc,%file,%memory,%process,%signal,%network,%ipc:error=1 ../answer diff --git a/tests-mx32/qual_fault-syntax.test b/tests-mx32/qual_fault-syntax.test index 85093fc7..c4fd27bf 100755 --- a/tests-mx32/qual_fault-syntax.test +++ b/tests-mx32/qual_fault-syntax.test @@ -2,30 +2,10 @@ # # Check -e fault= syntax. # -# Copyright (c) 2016=2017 Dmitry V. Levin +# Copyright (c) 2016-2018 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -40,16 +20,7 @@ fail_with() "strace -e fault=$* failed to handle an argument error properly" } -for arg in '' , ,, ,,, : :: ::: \! \!, \!: \ - invalid_syscall_name \ - invalid_syscall_name:when=3 \ - -1 \!-1 \ - -1:when=4 \ - -2 \ - -2:when=5 \ - 32767 \!32767 \ - 32767:when=6 \ - chdir:42 \!chdir:42 \ +for arg in chdir:42 \!chdir:42 \ chdir:42:when=7 \ chdir:invalid \ chdir:invalid:when=8 \ @@ -92,15 +63,15 @@ for arg in '' , ,, ,,, : :: ::: \! \!, \!: \ chdir:when=65536:error=30 \ chdir:when=1+65536 \ chdir:when=1+65536:error=31 \ - file,nonsense \ - \!desc,nonsense \ - chdir,nonsense \ - \!chdir,nonsense \ - 1,nonsense \ - \!1,nonsense \ chdir:retval=0 \ chdir:signal=1 \ chdir:error=1:error=2 \ + chdir:syscall=invalid \ + chdir:syscall=chdir \ + chdir:syscall=%file \ + chdir:syscall=-42 \ + chdir:syscall=42 \ + chdir:syscall=gettid:syscall=gettid \ ; do $STRACE -e fault="$arg" true 2> "$LOG" && fail_with "$arg" diff --git a/tests-mx32/qual_fault-syscall.test b/tests-mx32/qual_fault-syscall.test new file mode 100755 index 00000000..cae97f5e --- /dev/null +++ b/tests-mx32/qual_fault-syscall.test @@ -0,0 +1,3 @@ +suffix=:syscall=gettid +name_override=qual_fault +. "${srcdir=.}/qual_fault.test" diff --git a/tests-mx32/qual_fault.c b/tests-mx32/qual_fault.c index d26dc7ce..63bbade0 100644 --- a/tests-mx32/qual_fault.c +++ b/tests-mx32/qual_fault.c @@ -2,44 +2,29 @@ * Check that fault injection works properly. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include #include +#include +#include #include #include #include #include #include #include +#include -static const int expfd = 4; -static const int gotfd = 5; +static int exp_fd; +static int got_fd; +static int out_fd; #define DEFAULT_ERRNO ENOSYS @@ -57,13 +42,13 @@ invoke(int fail) int rc; if (!fail) { - rc = write(expfd, io.iov_base, io.iov_len); + rc = write(exp_fd, io.iov_base, io.iov_len); if (rc != (int) io.iov_len) perror_msg_and_fail("write"); } errno = 0; - rc = writev(gotfd, &io, 1); + rc = writev(got_fd, &io, 1); if (fail) { if (!(rc == -1 && errno == err)) @@ -72,12 +57,13 @@ invoke(int fail) err, rc, errno); if (is_raw) - tprintf("writev(%#x, %p, 0x1) = -1 (errno %d)" - " (INJECTED)\n", gotfd, &io, err); + tprintf("writev(%#x, %p, 0x1)" + " = -1 %s (%m) (INJECTED)\n", + got_fd, &io, errstr); else tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%d}], 1)" " = -1 %s (%m) (INJECTED)\n", - gotfd, buf, (int) io.iov_len, errstr); + got_fd, buf, (int) io.iov_len, errstr); } else { if (rc != (int) io.iov_len) perror_msg_and_fail("expected %d" @@ -85,23 +71,35 @@ invoke(int fail) (int) io.iov_len, rc, errno); if (is_raw) - tprintf("writev(%#x, %p, 0x1) = %#x\n", gotfd, &io, rc); + tprintf("writev(%#x, %p, 0x1) = %#x\n", + got_fd, &io, rc); else tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%d}], 1)" " = %d\n", - gotfd, buf, (int) io.iov_len, (int) io.iov_len); + got_fd, buf, (int) io.iov_len, + (int) io.iov_len); } } -int -main(int argc, char *argv[]) +static int +open_file(const char *prefix, int proc) { - struct stat st; + static const int open_flags = O_WRONLY | O_TRUNC | O_CREAT; + static char path[PATH_MAX + 1]; + + snprintf(path, sizeof(path), "%s.%d", prefix, proc); - assert(fstat(expfd, &st) == 0); - assert(fstat(gotfd, &st) == 0); + int fd = open(path, open_flags, 0600); + if (fd < 0) + perror_msg_and_fail("open: %s", path); - assert(argc == 6); + return fd; +} + +int +main(int argc, char *argv[]) +{ + assert(argc == 11); is_raw = !strcmp("raw", argv[1]); @@ -124,25 +122,71 @@ main(int argc, char *argv[]) first = atoi(argv[3]); step = atoi(argv[4]); iter = atoi(argv[5]); + int num_procs = atoi(argv[6]); + char *exp_prefix = argv[7]; + char *got_prefix = argv[8]; + char *out_prefix = argv[9]; + char *pid_prefix = argv[10]; assert(first > 0); assert(step >= 0); + assert(num_procs > 0); + + int proc; + for (proc = 0; proc < num_procs; ++proc) { + int ret = fork(); - tprintf("%s", ""); + if (ret < 0) + perror_msg_and_fail("fork"); - int i; - for (i = 1; i <= iter; ++i) { - int fail = 0; - if (first > 0) { - --first; - if (first == 0) { - fail = 1; - first = step; + if (ret > 0) { + int pidfd = open_file(pid_prefix, proc); + + char pidstr[sizeof(ret) * 3]; + int len = snprintf(pidstr, sizeof(pidstr), "%d", ret); + assert(len > 0 && len < (int) sizeof(pidstr)); + assert(write(pidfd, pidstr, len) == len); + + close(pidfd); + + continue; + } + + tprintf("%s", ""); + + exp_fd = open_file(exp_prefix, proc); + got_fd = open_file(got_prefix, proc); + out_fd = open_file(out_prefix, proc); + + /* This magic forces tprintf to write where we want it. */ + dup2(out_fd, 3); + + int i; + for (i = 1; i <= iter; ++i) { + int fail = 0; + if (first > 0) { + --first; + if (first == 0) { + fail = 1; + first = step; + } } + invoke(fail); } - invoke(fail); + + tprintf("%s\n", "+++ exited with 0 +++"); + return 0; + } + + for (proc = 0; proc < num_procs; ++proc) { + int status; + int ret = wait(&status); + if (ret <= 0) + perror_msg_and_fail("wait %d", proc); + if (status) + error_msg_and_fail("wait: pid=%d status=%d", + ret, status); } - tprintf("%s\n", "+++ exited with 0 +++"); return 0; } diff --git a/tests-mx32/qual_fault.test b/tests-mx32/qual_fault.test index e194a787..497e35ea 100755 --- a/tests-mx32/qual_fault.test +++ b/tests-mx32/qual_fault.test @@ -1,31 +1,12 @@ -#!/bin/sh +#!/bin/sh -efu # # Check that fault injection works properly. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/scno_tampering.sh" @@ -34,16 +15,20 @@ # F+ # F+S -N=16 +N=100 + +: ${suffix=} +[ -z "${name_override-}" ] || NAME="$name_override" check_fault_injection() { - local trace fault err first step extra + local trace fault err first step procs extra trace=$1; shift fault=$1; shift err=$1; shift first=$1; shift step=$1; shift + procs=$1; shift extra="$*" local when= @@ -73,31 +58,39 @@ check_fault_injection() outexp="$NAME.out.exp" outgot="$NAME.out.got" + outout="$NAME.out.out" + outpid="$NAME.pid" + + run_strace -a11 -ff -e trace=$trace \ + "$@" -e fault=$fault$when$error$suffix $extra \ + ../$NAME $raw "$err" "$first" "$step" $N \ + "$procs" "$outexp" "$outgot" "$outout" "$outpid" - run_strace -a11 -e trace=$trace \ - "$@" -e fault=$fault$when$error $extra \ - ./$NAME $raw "$err" "$first" "$step" $N \ - > "$EXP" 4> "$outexp" 5> "$outgot" + for i in $(seq 0 $((procs - 1)) ) + do + pid=$(cat "$outpid.$i") - match_diff "$EXP" "$LOG" - match_diff "$outexp" "$outgot" - rm -f "$EXP" "$outexp" "$outgot" + match_diff "$LOG.$pid" "$outout.$i" + match_diff "$outgot.$i" "$outexp.$i" + done } for err in '' ENOSYS 22 einval; do for fault in writev desc,51; do check_fault_injection \ - writev $fault "$err" '' '' -efault=chdir + writev $fault "$err" '' '' 1 -efault=chdir check_fault_injection \ - writev $fault "$err" '' '' -efault=chdir -efault=none + writev $fault "$err" '' '' 1 -efault=chdir -efault=none for F in 1 2 3 5 7 11; do check_fault_injection \ - writev $fault "$err" $F '' + writev $fault "$err" $F '' 1 check_fault_injection \ - writev $fault "$err" $F + + writev $fault "$err" $F + 1 for S in 1 2 3 5 7 11; do check_fault_injection \ - writev $fault "$err" $F $S + writev $fault "$err" $F $S 1 + check_fault_injection \ + writev $fault "$err" $F $S 4 done done done diff --git a/tests-mx32/qual_inject-error-signal-syscall.test b/tests-mx32/qual_inject-error-signal-syscall.test new file mode 100755 index 00000000..0adb35d7 --- /dev/null +++ b/tests-mx32/qual_inject-error-signal-syscall.test @@ -0,0 +1,3 @@ +suffix=:syscall=gettid +name_override=qual_inject-error-signal +. "${srcdir=.}/qual_inject-error-signal.test" diff --git a/tests-mx32/qual_inject-error-signal.c b/tests-mx32/qual_inject-error-signal.c index f4ccd824..4c89d78a 100644 --- a/tests-mx32/qual_inject-error-signal.c +++ b/tests-mx32/qual_inject-error-signal.c @@ -1,30 +1,10 @@ /* * Check fault injection along with signal injection. * - * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/qual_inject-error-signal.test b/tests-mx32/qual_inject-error-signal.test index fcbcc398..2392e8bd 100755 --- a/tests-mx32/qual_inject-error-signal.test +++ b/tests-mx32/qual_inject-error-signal.test @@ -1,8 +1,18 @@ #!/bin/sh - +# # Check fault injection along with signal injection. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/scno_tampering.sh" -run_strace -a12 -echdir,exit_group -einject=chdir:error=ENOENT:signal=USR1 \ - "./$NAME" +: ${suffix=} +[ -z "${name_override-}" ] || NAME="$name_override" + +run_strace -a12 -echdir,exit_group \ + -einject=chdir:error=ENOENT:signal=USR1"$suffix" \ + "../$NAME" match_diff diff --git a/tests-mx32/qual_inject-retval-syscall.test b/tests-mx32/qual_inject-retval-syscall.test new file mode 100755 index 00000000..fca9354c --- /dev/null +++ b/tests-mx32/qual_inject-retval-syscall.test @@ -0,0 +1,3 @@ +suffix=:syscall=gettid +name_override=qual_inject-retval +. "${srcdir=.}/qual_inject-retval.test" diff --git a/tests-mx32/qual_inject-retval.c b/tests-mx32/qual_inject-retval.c index ac9801eb..16419a49 100644 --- a/tests-mx32/qual_inject-retval.c +++ b/tests-mx32/qual_inject-retval.c @@ -2,29 +2,10 @@ * Check success injection. * * Copyright (c) 2017 Elvira Khabirova + * Copyright (c) 2017-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/qual_inject-retval.test b/tests-mx32/qual_inject-retval.test index 419030ad..956d373d 100755 --- a/tests-mx32/qual_inject-retval.test +++ b/tests-mx32/qual_inject-retval.test @@ -1,9 +1,17 @@ #!/bin/sh - +# # Check success injection. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/scno_tampering.sh" +: ${suffix=} +[ -z "${name_override-}" ] || NAME="$name_override" + check_injection() { local syscall rval @@ -11,10 +19,9 @@ check_injection() syscall=chdir rval="$1"; shift - run_strace -a12 -e$syscall -einject="$syscall:retval=$rval" "$@" \ - ./qual_inject-retval "$rval" > "$EXP" + run_strace -a12 -e$syscall -einject="$syscall:retval=$rval$suffix" "$@" \ + ../qual_inject-retval "$rval" > "$EXP" match_diff "$LOG" "$EXP" - rm -f "$EXP" } check_injection 0 diff --git a/tests-mx32/qual_inject-signal-syscall.test b/tests-mx32/qual_inject-signal-syscall.test new file mode 100755 index 00000000..42e9a268 --- /dev/null +++ b/tests-mx32/qual_inject-signal-syscall.test @@ -0,0 +1,3 @@ +suffix=:syscall=gettid +name_override=qual_inject-signal +. "${srcdir=.}/qual_inject-signal.test" diff --git a/tests-mx32/qual_inject-signal.c b/tests-mx32/qual_inject-signal.c index ff56a286..c09b8322 100644 --- a/tests-mx32/qual_inject-signal.c +++ b/tests-mx32/qual_inject-signal.c @@ -1,30 +1,10 @@ /* * Check that signal injection works properly. * - * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/qual_inject-signal.test b/tests-mx32/qual_inject-signal.test index 88002ce9..54a3498d 100755 --- a/tests-mx32/qual_inject-signal.test +++ b/tests-mx32/qual_inject-signal.test @@ -1,8 +1,17 @@ #!/bin/sh - +# # Check signal injection. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" -run_strace -a12 -echdir,exit_group -einject=chdir:signal=USR1 \ - ./$NAME +: ${suffix=} +[ -z "${name_override-}" ] || NAME="$name_override" + +run_strace -a12 -echdir,exit_group -einject=chdir:signal=USR1"$suffix" \ + ../$NAME match_diff diff --git a/tests-mx32/qual_inject-syntax.test b/tests-mx32/qual_inject-syntax.test index a9e44d74..53245345 100755 --- a/tests-mx32/qual_inject-syntax.test +++ b/tests-mx32/qual_inject-syntax.test @@ -2,30 +2,10 @@ # # Check -e inject= syntax. # -# Copyright (c) 2016-2017 Dmitry V. Levin +# Copyright (c) 2016-2018 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -40,17 +20,7 @@ fail_with() "strace -e inject=$* failed to handle an argument error properly" } -for arg in '' , ,, ,,, : :: ::: \! \!, \!: \ - invalid_syscall_name \ - invalid_syscall_name:when=3 \ - -1 \!-1 \ - -1:when=4 \ - -2 \ - -2:when=5 \ - 32767 \!32767 \ - 32767:when=6 \ - 42 \ - chdir \ +for arg in 42 chdir \ chdir:42 \!chdir:42 \ chdir:42:when=7 \ chdir:invalid \ @@ -94,20 +64,30 @@ for arg in '' , ,, ,,, : :: ::: \! \!, \!: \ chdir:when=65536:error=30 \ chdir:when=1+65536 \ chdir:when=1+65536:error=31 \ - file,nonsense \ - \!desc,nonsense \ - chdir,nonsense \ - \!chdir,nonsense \ - 1,nonsense \ - \!1,nonsense \ - chdir:retval=-1 \ + chdir:retval=a \ + chdir:retval=0b \ + chdir:retval=0x10000000000000000 \ chdir:signal=0 \ chdir:signal=129 \ + chdir:signal=1:signal=2 \ + chdir:signal=1:retval=0:signal=2 \ chdir:retval=0:retval=1 \ chdir:error=1:error=2 \ chdir:retval=0:error=1 \ chdir:error=1:retval=0 \ chdir:retval=0:signal=1:error=1 \ + chdir:delay_enter=-1 \ + chdir:delay_exit=-2 \ + chdir:delay_enter=1:delay_enter=2 \ + chdir:delay_exit=3:delay_exit=4 \ + chdir:delay_enter=5:delay_exit=6:delay_enter=7 \ + chdir:delay_exit=8:delay_enter=9:delay_exit=10 \ + chdir:syscall=invalid \ + chdir:syscall=chdir \ + chdir:syscall=%file \ + chdir:syscall=-42 \ + chdir:syscall=42 \ + chdir:syscall=gettid:syscall=gettid \ ; do $STRACE -e inject="$arg" true 2> "$LOG" && fail_with "$arg" diff --git a/tests-mx32/qual_signal.c b/tests-mx32/qual_signal.c index 106dabea..31dc8f7d 100644 --- a/tests-mx32/qual_signal.c +++ b/tests-mx32/qual_signal.c @@ -1,30 +1,10 @@ /* * Check how strace -e signal=set works. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/qual_signal.test b/tests-mx32/qual_signal.test index 54a37a30..8fd2b69d 100755 --- a/tests-mx32/qual_signal.test +++ b/tests-mx32/qual_signal.test @@ -3,29 +3,10 @@ # Check how strace -e signal=set works. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -34,10 +15,9 @@ test_one_sig() local sigs sigs="$1"; shift - run_prog "./$NAME" "$@" > /dev/null - run_strace -e trace=none -e signal="$sigs" "./$NAME" "$@" > "$EXP" + run_prog "../$NAME" "$@" > /dev/null + run_strace -e trace=none -e signal="$sigs" "../$NAME" "$@" > "$EXP" match_diff "$LOG" "$EXP" - rm -f "$EXP" } test_sigs() diff --git a/tests-mx32/qual_syscall.test b/tests-mx32/qual_syscall.test index f7eb06d5..945fc8c7 100755 --- a/tests-mx32/qual_syscall.test +++ b/tests-mx32/qual_syscall.test @@ -2,20 +2,25 @@ # Check how strace -e abbrev=set, -e raw=set, -e trace=set, # and -e verbose=set work. +# +# Copyright (c) 2014-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./umovestr -pattern_abbrev_verbose='execve("\./umovestr", \["\./umovestr"\], \[/\* [[:digit:]]* vars \*/\]) = 0' -pattern_nonabbrev_verbose='execve("\./umovestr", \["\./umovestr"\], \[".*\"\(\.\.\.\)\?\]) = 0' -pattern_nonverbose='execve("\./umovestr", 0x[[:xdigit:]]*, 0x[[:xdigit:]]*) = 0' +run_prog ../umovestr +pattern_abbrev_verbose='execve("\.\./umovestr", \["\.\./umovestr"\], 0x[[:xdigit:]]* /\* [[:digit:]]* vars \*/) = 0' +pattern_nonabbrev_verbose='execve("\.\./umovestr", \["\.\./umovestr"\], \[".*\"\(\.\.\.\)\?\]) = 0' +pattern_nonverbose='execve("\.\./umovestr", 0x[[:xdigit:]]*, 0x[[:xdigit:]]*) = 0' pattern_raw='execve(0x[[:xdigit:]]*, 0x[[:xdigit:]]*, 0x[[:xdigit:]]*) = 0' check_output_mismatch() { local pattern pattern="$1"; shift - run_strace "$@" ./umovestr + run_strace "$@" ../umovestr LC_ALL=C grep -x "$pattern" "$LOG" > /dev/null || { printf '%s\n%s\n' \ 'Failed patterns of expected output:' "$pattern" @@ -28,15 +33,19 @@ LC_ALL=C grep -v -x "$pattern_abbrev_verbose" "$LOG" | LC_ALL=C grep '^[[:alnum:]_]*(' > /dev/null && dump_log_and_fail_with "$STRACE $args unexpected output" -check_output_mismatch "$pattern_abbrev_verbose" -e trace=process +check_output_mismatch "$pattern_abbrev_verbose" -e trace=%process LC_ALL=C grep '^chdir' "$LOG" > /dev/null && dump_log_and_fail_with "$STRACE $args unexpected output" -run_strace -e 42 ./umovestr +run_strace -e 42 ../umovestr LC_ALL=C grep '^[[:alnum:]_]*(' "$LOG" > /dev/null && dump_log_and_fail_with "$STRACE $args unexpected output" -for a in execve \!chdir all \!none \ +run_strace -e/ -e42 ../umovestr +LC_ALL=C grep '^[[:alnum:]_]*(' "$LOG" > /dev/null && + dump_log_and_fail_with "$STRACE $args unexpected output" + +for a in execve \!chdir /. all \!none \ file process \!desc \!ipc \!memory \!network \!signal; do check_output_mismatch \ "$pattern_abbrev_verbose" -e abbrev="$a" -e execve diff --git a/tests-mx32/qualify_personality.sh b/tests-mx32/qualify_personality.sh new file mode 100644 index 00000000..d57314fc --- /dev/null +++ b/tests-mx32/qualify_personality.sh @@ -0,0 +1,74 @@ +#! /bin/sh -efu +# +# Common code for per-personality qualification tests +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +[ 2 -le "$#" ] || + fail_ 'No personality designation ("64", "32", "x32") specified' + +pers="$1" +shift +trace_expr="$1" +shift +skip="${1-}" + +case "$STRACE_NATIVE_ARCH" in +x86_64) + supported_pers='64 32 x32' + ;; +x32) + supported_pers='x32 32' + ;; +aarch64|powerpc64|riscv|s390x|sparc64|tile) + supported_pers='64 32' + ;; +*) + supported_pers="$(($SIZEOF_LONG * 8))" + ;; +esac + +# Detect current personality designation +if [ "x$STRACE_NATIVE_ARCH" = "x$STRACE_ARCH" ]; then + case "$STRACE_NATIVE_ARCH" in + x32) + cur_pers=x32 + ;; + *) + cur_pers="$(($SIZEOF_LONG * 8))" + ;; + esac +else + if [ "x$SIZEOF_KERNEL_LONG_T" = "x$SIZEOF_LONG" ]; then + [ 4 -eq "$SIZEOF_LONG" ] || + fail_ "sizeof(long) = $SIZEOF_LONG != 4" + cur_pers=32 + else + [ 8 -eq "$SIZEOF_KERNEL_LONG_T" ] || + fail_ "sizeof(kernel_long_t) = $SIZEOF_KERNEL_LONG_T != 8" + [ 4 -eq "$SIZEOF_LONG" ] || + fail_ "sizeof(long) = $SIZEOF_LONG != 4" + cur_pers=x32 + fi +fi + +pers_found=0 +set -- $supported_pers +for i; do + [ "x$pers" != "x$i" ] || pers_found=1 +done + +[ "$pers_found" = 1 ] || + skip_ "Personality '$pers' is not supported on architecture" \ + "'$STRACE_NATIVE_ARCH' (supported personalities: $supported_pers)" + +# If tested personality is not equivalent to current personality, reset $NAME, +# so "$NAME.in", which is used by test_trace_expr, points to an empty file. +[ "x$pers" = "x$cur_pers" ] || NAME=qualify_personality_empty + +test_trace_expr "$skip" -e trace="${trace_expr}@${pers}" diff --git a/tests-mx32/qualify_personality_empty.in b/tests-mx32/qualify_personality_empty.in new file mode 100644 index 00000000..e69de29b diff --git a/tests-mx32/quotactl-Xabbrev.c b/tests-mx32/quotactl-Xabbrev.c new file mode 100644 index 00000000..e2b3c502 --- /dev/null +++ b/tests-mx32/quotactl-Xabbrev.c @@ -0,0 +1 @@ +#include "quotactl.c" diff --git a/tests-mx32/quotactl-Xabbrev.gen.test b/tests-mx32/quotactl-Xabbrev.gen.test new file mode 100755 index 00000000..67c27d35 --- /dev/null +++ b/tests-mx32/quotactl-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (quotactl-Xabbrev -Xabbrev -e trace=quotactl); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xabbrev -e trace=quotactl diff --git a/tests-mx32/quotactl-Xraw.c b/tests-mx32/quotactl-Xraw.c new file mode 100644 index 00000000..f6dd8ffe --- /dev/null +++ b/tests-mx32/quotactl-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "quotactl.c" diff --git a/tests-mx32/quotactl-Xraw.gen.test b/tests-mx32/quotactl-Xraw.gen.test new file mode 100755 index 00000000..8f2f25b0 --- /dev/null +++ b/tests-mx32/quotactl-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (quotactl-Xraw -a27 -Xraw -e trace=quotactl); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 -Xraw -e trace=quotactl diff --git a/tests-mx32/quotactl-Xverbose.c b/tests-mx32/quotactl-Xverbose.c new file mode 100644 index 00000000..55d484e8 --- /dev/null +++ b/tests-mx32/quotactl-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "quotactl.c" diff --git a/tests-mx32/quotactl-Xverbose.gen.test b/tests-mx32/quotactl-Xverbose.gen.test new file mode 100755 index 00000000..7d06db57 --- /dev/null +++ b/tests-mx32/quotactl-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (quotactl-Xverbose -Xverbose -e trace=quotactl); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xverbose -e trace=quotactl diff --git a/tests-mx32/quotactl-success-v.c b/tests-mx32/quotactl-success-v.c new file mode 100644 index 00000000..4d1c7b30 --- /dev/null +++ b/tests-mx32/quotactl-success-v.c @@ -0,0 +1,2 @@ +#define INJECT_RETVAL 42 +#include "quotactl-v.c" diff --git a/tests-mx32/quotactl-success-v.test b/tests-mx32/quotactl-success-v.test new file mode 100755 index 00000000..b8112042 --- /dev/null +++ b/tests-mx32/quotactl-success-v.test @@ -0,0 +1,11 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +run_strace -v -e trace=quotactl -e inject=quotactl:retval=42 ../quotactl-success-v > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests-mx32/quotactl-success.c b/tests-mx32/quotactl-success.c new file mode 100644 index 00000000..aa2b9dc0 --- /dev/null +++ b/tests-mx32/quotactl-success.c @@ -0,0 +1,2 @@ +#define INJECT_RETVAL 42 +#include "quotactl.c" diff --git a/tests-mx32/quotactl-success.test b/tests-mx32/quotactl-success.test new file mode 100755 index 00000000..d041ebd9 --- /dev/null +++ b/tests-mx32/quotactl-success.test @@ -0,0 +1,11 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +run_strace -e trace=quotactl -e inject=quotactl:retval=42 ../quotactl-success > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests-mx32/quotactl-v.gen.test b/tests-mx32/quotactl-v.gen.test new file mode 100755 index 00000000..8659ed23 --- /dev/null +++ b/tests-mx32/quotactl-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (quotactl-v -v -e trace=quotactl); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=quotactl diff --git a/tests-mx32/quotactl-v.test b/tests-mx32/quotactl-v.test deleted file mode 100755 index 6adaf82c..00000000 --- a/tests-mx32/quotactl-v.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check non-abbreviated decoding of quotactl syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -e trace=quotactl diff --git a/tests-mx32/quotactl-xfs-success-v.c b/tests-mx32/quotactl-xfs-success-v.c new file mode 100644 index 00000000..6e7b2b51 --- /dev/null +++ b/tests-mx32/quotactl-xfs-success-v.c @@ -0,0 +1,2 @@ +#define INJECT_RETVAL 42 +#include "quotactl-xfs-v.c" diff --git a/tests-mx32/quotactl-xfs-success-v.test b/tests-mx32/quotactl-xfs-success-v.test new file mode 100755 index 00000000..7bcfa8ac --- /dev/null +++ b/tests-mx32/quotactl-xfs-success-v.test @@ -0,0 +1,11 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +run_strace -v -e trace=quotactl -e inject=quotactl:retval=42 ../quotactl-xfs-success-v > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests-mx32/quotactl-xfs-success.c b/tests-mx32/quotactl-xfs-success.c new file mode 100644 index 00000000..f498b8ae --- /dev/null +++ b/tests-mx32/quotactl-xfs-success.c @@ -0,0 +1,2 @@ +#define INJECT_RETVAL 42 +#include "quotactl-xfs.c" diff --git a/tests-mx32/quotactl-xfs-success.test b/tests-mx32/quotactl-xfs-success.test new file mode 100755 index 00000000..e9041dad --- /dev/null +++ b/tests-mx32/quotactl-xfs-success.test @@ -0,0 +1,11 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +run_strace -e trace=quotactl -e inject=quotactl:retval=42 ../quotactl-xfs-success > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests-mx32/quotactl-xfs-v.gen.test b/tests-mx32/quotactl-xfs-v.gen.test new file mode 100755 index 00000000..f1f7e0ae --- /dev/null +++ b/tests-mx32/quotactl-xfs-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (quotactl-xfs-v -v -e trace=quotactl); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=quotactl diff --git a/tests-mx32/quotactl-xfs-v.test b/tests-mx32/quotactl-xfs-v.test deleted file mode 100755 index d5ffc7d6..00000000 --- a/tests-mx32/quotactl-xfs-v.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check non-abbreviated decoding of quotactl xfs subcommands. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -e trace=quotactl diff --git a/tests-mx32/quotactl-xfs.c b/tests-mx32/quotactl-xfs.c index e420d1c9..1fae566d 100644 --- a/tests-mx32/quotactl-xfs.c +++ b/tests-mx32/quotactl-xfs.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -70,7 +51,7 @@ struct fs_quota_statv { struct fs_qfilestatv qs_pquota; /* project quota information */ int32_t qs_btimelimit; /* limit for blks timer */ int32_t qs_itimelimit; /* limit for inodes timer */ - int32_t qs_rtbtimelimit; /* limit for rt blks timer */ + int32_t qs_rtbtimelimit; /* limit for rt blks timer */ uint16_t qs_bwarnlimit; /* limit for num warnings */ uint16_t qs_iwarnlimit; /* limit for num warnings */ uint64_t qs_pad2[8]; /* for future proofing */ @@ -91,34 +72,34 @@ print_xdisk_quota(int rc, void *ptr, void *arg) struct fs_disk_quota *dq = ptr; long out_arg = (long) arg; - if (((rc != 0) && out_arg) || (out_arg > 1)) { + if (((rc < 0) && out_arg) || (out_arg > 1)) { printf("%p", dq); return; } - PRINT_FIELD_D("{", dq, d_version); + PRINT_FIELD_D("{", *dq, d_version); printf(", d_flags="); printflags(xfs_dqblk_flags, (uint8_t) dq->d_flags, "XFS_???_QUOTA"); - PRINT_FIELD_X(", ", dq, d_fieldmask); - PRINT_FIELD_U(", ", dq, d_id); - PRINT_FIELD_U(", ", dq, d_blk_hardlimit); - PRINT_FIELD_U(", ", dq, d_blk_softlimit); - PRINT_FIELD_U(", ", dq, d_ino_hardlimit); - PRINT_FIELD_U(", ", dq, d_ino_softlimit); - PRINT_FIELD_U(", ", dq, d_bcount); - PRINT_FIELD_U(", ", dq, d_icount); + PRINT_FIELD_X(", ", *dq, d_fieldmask); + PRINT_FIELD_U(", ", *dq, d_id); + PRINT_FIELD_U(", ", *dq, d_blk_hardlimit); + PRINT_FIELD_U(", ", *dq, d_blk_softlimit); + PRINT_FIELD_U(", ", *dq, d_ino_hardlimit); + PRINT_FIELD_U(", ", *dq, d_ino_softlimit); + PRINT_FIELD_U(", ", *dq, d_bcount); + PRINT_FIELD_U(", ", *dq, d_icount); # if VERBOSE - PRINT_FIELD_D(", ", dq, d_itimer); - PRINT_FIELD_D(", ", dq, d_btimer); - PRINT_FIELD_U(", ", dq, d_iwarns); - PRINT_FIELD_U(", ", dq, d_bwarns); - PRINT_FIELD_U(", ", dq, d_rtb_hardlimit); - PRINT_FIELD_U(", ", dq, d_rtb_softlimit); - PRINT_FIELD_U(", ", dq, d_rtbcount); - PRINT_FIELD_D(", ", dq, d_rtbtimer); - PRINT_FIELD_U(", ", dq, d_rtbwarns); + PRINT_FIELD_D(", ", *dq, d_itimer); + PRINT_FIELD_D(", ", *dq, d_btimer); + PRINT_FIELD_U(", ", *dq, d_iwarns); + PRINT_FIELD_U(", ", *dq, d_bwarns); + PRINT_FIELD_U(", ", *dq, d_rtb_hardlimit); + PRINT_FIELD_U(", ", *dq, d_rtb_softlimit); + PRINT_FIELD_U(", ", *dq, d_rtbcount); + PRINT_FIELD_D(", ", *dq, d_rtbtimer); + PRINT_FIELD_U(", ", *dq, d_rtbwarns); # else printf(", ..."); # endif /* !VERBOSE */ @@ -131,28 +112,28 @@ print_xquota_stat(int rc, void *ptr, void *arg) struct fs_quota_stat *qs = ptr; long out_arg = (long) arg; - if (((rc != 0) && out_arg) || (out_arg > 1)) { + if (((rc < 0) && out_arg) || (out_arg > 1)) { printf("%p", qs); return; } - PRINT_FIELD_D("{", qs, qs_version); + PRINT_FIELD_D("{", *qs, qs_version); # if VERBOSE printf(", qs_flags="); printflags(xfs_quota_flags, qs->qs_flags, "XFS_QUOTA_???"); - PRINT_FIELD_U(", qs_uquota={", &qs->qs_uquota, qfs_ino); - PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nblks); - PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nextents); - PRINT_FIELD_U("}, qs_gquota={", &qs->qs_gquota, qfs_ino); - PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nblks); - PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nextents); - PRINT_FIELD_U("}, ", qs, qs_incoredqs); - PRINT_FIELD_D(", ", qs, qs_btimelimit); - PRINT_FIELD_D(", ", qs, qs_itimelimit); - PRINT_FIELD_D(", ", qs, qs_rtbtimelimit); - PRINT_FIELD_U(", ", qs, qs_bwarnlimit); - PRINT_FIELD_U(", ", qs, qs_iwarnlimit); + PRINT_FIELD_U(", qs_uquota={", qs->qs_uquota, qfs_ino); + PRINT_FIELD_U(", ", qs->qs_uquota, qfs_nblks); + PRINT_FIELD_U(", ", qs->qs_uquota, qfs_nextents); + PRINT_FIELD_U("}, qs_gquota={", qs->qs_gquota, qfs_ino); + PRINT_FIELD_U(", ", qs->qs_gquota, qfs_nblks); + PRINT_FIELD_U(", ", qs->qs_gquota, qfs_nextents); + PRINT_FIELD_U("}, ", *qs, qs_incoredqs); + PRINT_FIELD_D(", ", *qs, qs_btimelimit); + PRINT_FIELD_D(", ", *qs, qs_itimelimit); + PRINT_FIELD_D(", ", *qs, qs_rtbtimelimit); + PRINT_FIELD_U(", ", *qs, qs_bwarnlimit); + PRINT_FIELD_U(", ", *qs, qs_iwarnlimit); # else printf(", ..."); # endif /* !VERBOSE */ @@ -165,31 +146,31 @@ print_xquota_statv(int rc, void *ptr, void *arg) struct fs_quota_statv *qs = ptr; long out_arg = (long) arg; - if (((rc != 0) && out_arg) || (out_arg > 1)) { + if (((rc < 0) && out_arg) || (out_arg > 1)) { printf("%p", qs); return; } - PRINT_FIELD_D("{", qs, qs_version); + PRINT_FIELD_D("{", *qs, qs_version); # if VERBOSE printf(", qs_flags="); printflags(xfs_quota_flags, qs->qs_flags, "XFS_QUOTA_???"); - PRINT_FIELD_U(", ", qs, qs_incoredqs); - PRINT_FIELD_U(", qs_uquota={", &qs->qs_uquota, qfs_ino); - PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nblks); - PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nextents); - PRINT_FIELD_U("}, qs_gquota={", &qs->qs_gquota, qfs_ino); - PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nblks); - PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nextents); - PRINT_FIELD_U("}, qs_pquota={", &qs->qs_pquota, qfs_ino); - PRINT_FIELD_U(", ", &qs->qs_pquota, qfs_nblks); - PRINT_FIELD_U(", ", &qs->qs_pquota, qfs_nextents); - PRINT_FIELD_D("}, ", qs, qs_btimelimit); - PRINT_FIELD_D(", ", qs, qs_itimelimit); - PRINT_FIELD_D(", ", qs, qs_rtbtimelimit); - PRINT_FIELD_U(", ", qs, qs_bwarnlimit); - PRINT_FIELD_U(", ", qs, qs_iwarnlimit); + PRINT_FIELD_U(", ", *qs, qs_incoredqs); + PRINT_FIELD_U(", qs_uquota={", qs->qs_uquota, qfs_ino); + PRINT_FIELD_U(", ", qs->qs_uquota, qfs_nblks); + PRINT_FIELD_U(", ", qs->qs_uquota, qfs_nextents); + PRINT_FIELD_U("}, qs_gquota={", qs->qs_gquota, qfs_ino); + PRINT_FIELD_U(", ", qs->qs_gquota, qfs_nblks); + PRINT_FIELD_U(", ", qs->qs_gquota, qfs_nextents); + PRINT_FIELD_U("}, qs_pquota={", qs->qs_pquota, qfs_ino); + PRINT_FIELD_U(", ", qs->qs_pquota, qfs_nblks); + PRINT_FIELD_U(", ", qs->qs_pquota, qfs_nextents); + PRINT_FIELD_D("}, ", *qs, qs_btimelimit); + PRINT_FIELD_D(", ", *qs, qs_itimelimit); + PRINT_FIELD_D(", ", *qs, qs_rtbtimelimit); + PRINT_FIELD_U(", ", *qs, qs_bwarnlimit); + PRINT_FIELD_U(", ", *qs, qs_iwarnlimit); # else printf(", ..."); # endif /* !VERBOSE */ @@ -206,13 +187,13 @@ main(void) char bogus_addr_str[sizeof(void *) * 2 + sizeof("0x")]; char unterminated_str[sizeof(void *) * 2 + sizeof("0x")]; - long rc; - struct fs_disk_quota *xdq = tail_alloc(sizeof(*xdq)); - struct fs_quota_stat *xqstat = tail_alloc(sizeof(*xqstat)); - struct fs_quota_statv *xqstatv = tail_alloc(sizeof(*xqstatv)); - uint32_t *flags = tail_alloc(sizeof(*flags)); + static char invalid_cmd_str[1024]; + TAIL_ALLOC_OBJECT_CONST_PTR(struct fs_disk_quota, xdq); + TAIL_ALLOC_OBJECT_CONST_PTR(struct fs_quota_stat, xqstat); + TAIL_ALLOC_OBJECT_CONST_PTR(struct fs_quota_statv, xqstatv); + TAIL_ALLOC_OBJECT_CONST_PTR(uint32_t, flags); char *unterminated = tail_memdup(unterminated_data, - sizeof(unterminated_data)); + sizeof(unterminated_data)); snprintf(bogus_special_str, sizeof(bogus_special_str), "%p", bogus_special); @@ -233,12 +214,12 @@ main(void) "|XFS_QUOTA_GDQ_ACCT|XFS_QUOTA_GDQ_ENFD" "|XFS_QUOTA_PDQ_ENFD|0xdeadbec0]"); - rc = syscall(__NR_quotactl, QCMD(Q_XQUOTAON, 0xfacefeed), bogus_dev, - bogus_id, bogus_addr); - printf("quotactl(QCMD(Q_XQUOTAON, %#x /* ???QUOTA */)" - ", %s, %p) = %s\n", - QCMD_TYPE(QCMD(Q_XQUOTAON, 0xfacefeed)), - bogus_dev_str, bogus_addr, sprintrc(rc)); + snprintf(invalid_cmd_str, sizeof(invalid_cmd_str), + "QCMD(Q_XQUOTAON, %#x /* ???QUOTA */)", + QCMD_TYPE(QCMD(Q_XQUOTAON, 0xfacefeed))); + check_quota(CQF_ID_SKIP, + QCMD(Q_XQUOTAON, 0xfacefeed), invalid_cmd_str, + bogus_dev, bogus_dev_str, bogus_addr); /* Q_XQUOTAOFF */ @@ -263,12 +244,12 @@ main(void) /* Q_XGETQUOTA */ /* Trying our best to get successful result */ - check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, USRQUOTA)), + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_XGETQUOTA, USRQUOTA)), ARG_STR("/dev/sda1"), getuid(), xdq, print_xdisk_quota, (intptr_t) 1); - check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, GRPQUOTA)), - ARG_STR(NULL), -1, xdq, print_xdisk_quota, (intptr_t) 2); + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_XGETQUOTA, GRPQUOTA)), + ARG_STR(NULL), -1, xdq, print_xdisk_quota, (intptr_t) 1); /* Q_XGETNEXTQUOTA */ @@ -297,20 +278,29 @@ main(void) ARG_STR("/dev/sda1"), xqstat, print_xquota_stat, (intptr_t) 1); check_quota(CQF_ID_SKIP | CQF_ADDR_CB, - ARG_STR(QCMD(Q_XGETQSTATV, PRJQUOTA)), + ARG_STR(QCMD(Q_XGETQSTAT, USRQUOTA)), + ARG_STR("NULL"), xqstat, print_xquota_stat, (intptr_t) 1); + + check_quota(CQF_ID_SKIP, + ARG_STR(QCMD(Q_XGETQSTAT, PRJQUOTA)), unterminated, unterminated_str, - xqstat + 1, print_xquota_stat, (intptr_t) 2); + xqstat + 1); /* Q_XGETQSTATV */ check_quota(CQF_ID_SKIP | CQF_ADDR_CB, - ARG_STR(QCMD(Q_XGETQSTAT, USRQUOTA)), - ARG_STR("/dev/sda1"), xqstatv, print_xquota_statv, 1); + ARG_STR(QCMD(Q_XGETQSTATV, USRQUOTA)), + ARG_STR("/dev/sda1"), xqstatv, print_xquota_statv, (intptr_t) 1); check_quota(CQF_ID_SKIP | CQF_ADDR_CB, ARG_STR(QCMD(Q_XGETQSTATV, GRPQUOTA)), - ARG_STR(NULL), xqstatv, print_xquota_statv, (intptr_t) 2); + ARG_STR(NULL), xqstatv, print_xquota_statv, (intptr_t) 1); + + check_quota(CQF_ID_SKIP, + ARG_STR(QCMD(Q_XGETQSTATV, PRJQUOTA)), + unterminated, unterminated_str, + xqstatv + 1); /* Q_XQUOTARM */ diff --git a/tests-mx32/quotactl-xfs.gen.test b/tests-mx32/quotactl-xfs.gen.test new file mode 100755 index 00000000..cd7d11c5 --- /dev/null +++ b/tests-mx32/quotactl-xfs.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (quotactl-xfs -e trace=quotactl); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=quotactl diff --git a/tests-mx32/quotactl-xfs.test b/tests-mx32/quotactl-xfs.test deleted file mode 100755 index 404a7372..00000000 --- a/tests-mx32/quotactl-xfs.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of quotactl xfs subcommands. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=quotactl diff --git a/tests-mx32/quotactl.c b/tests-mx32/quotactl.c index 3a7c1132..3a995276 100644 --- a/tests-mx32/quotactl.c +++ b/tests-mx32/quotactl.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -76,27 +57,31 @@ struct if_nextdqblk { # include "xlat/if_dqinfo_flags.h" # include "xlat/if_dqinfo_valid.h" +# define QUOTA_STR(_arg) (_arg), gen_quotacmd(#_arg, _arg) +# define QUOTA_ID_STR(_arg) (_arg), gen_quotaid(#_arg, _arg) +# define QUOTA_STR_INVALID(_arg, str) (_arg), gen_quotacmd(str, _arg) + void print_dqblk(long rc, void *ptr, void *arg) { struct if_dqblk *db = ptr; long out_arg = (long) arg; - if (((rc != 0) && out_arg) || (out_arg > 1)) { + if (((rc < 0) && out_arg) || (out_arg > 1)) { printf("%p", db); return; } - PRINT_FIELD_U("{", db, dqb_bhardlimit); - PRINT_FIELD_U(", ", db, dqb_bsoftlimit); - PRINT_FIELD_U(", ", db, dqb_curspace); - PRINT_FIELD_U(", ", db, dqb_ihardlimit); - PRINT_FIELD_U(", ", db, dqb_isoftlimit); - PRINT_FIELD_U(", ", db, dqb_curinodes); + PRINT_FIELD_U("{", *db, dqb_bhardlimit); + PRINT_FIELD_U(", ", *db, dqb_bsoftlimit); + PRINT_FIELD_U(", ", *db, dqb_curspace); + PRINT_FIELD_U(", ", *db, dqb_ihardlimit); + PRINT_FIELD_U(", ", *db, dqb_isoftlimit); + PRINT_FIELD_U(", ", *db, dqb_curinodes); # if VERBOSE - PRINT_FIELD_U(", ", db, dqb_btime); - PRINT_FIELD_U(", ", db, dqb_itime); + PRINT_FIELD_U(", ", *db, dqb_btime); + PRINT_FIELD_U(", ", *db, dqb_itime); printf(", dqb_valid="); printflags(if_dqblk_valid, db->dqb_valid, "QIF_???"); @@ -112,28 +97,28 @@ print_nextdqblk(long rc, void *ptr, void *arg) struct if_nextdqblk *db = ptr; long out_arg = (long) arg; - if (((rc != 0) && out_arg) || (out_arg > 1)) { + if (((rc < 0) && out_arg) || (out_arg > 1)) { printf("%p", db); return; } - PRINT_FIELD_U("{", db, dqb_bhardlimit); - PRINT_FIELD_U(", ", db, dqb_bsoftlimit); - PRINT_FIELD_U(", ", db, dqb_curspace); - PRINT_FIELD_U(", ", db, dqb_ihardlimit); - PRINT_FIELD_U(", ", db, dqb_isoftlimit); - PRINT_FIELD_U(", ", db, dqb_curinodes); + PRINT_FIELD_U("{", *db, dqb_bhardlimit); + PRINT_FIELD_U(", ", *db, dqb_bsoftlimit); + PRINT_FIELD_U(", ", *db, dqb_curspace); + PRINT_FIELD_U(", ", *db, dqb_ihardlimit); + PRINT_FIELD_U(", ", *db, dqb_isoftlimit); + PRINT_FIELD_U(", ", *db, dqb_curinodes); # if VERBOSE - PRINT_FIELD_U(", ", db, dqb_btime); - PRINT_FIELD_U(", ", db, dqb_itime); + PRINT_FIELD_U(", ", *db, dqb_btime); + PRINT_FIELD_U(", ", *db, dqb_itime); printf(", dqb_valid="); printflags(if_dqblk_valid, db->dqb_valid, "QIF_???"); - PRINT_FIELD_U(", ", db, dqb_id); + PRINT_FIELD_U(", ", *db, dqb_id); # else - PRINT_FIELD_U(", ", db, dqb_id); + PRINT_FIELD_U(", ", *db, dqb_id); printf(", ..."); # endif /* !VERBOSE */ printf("}"); @@ -145,21 +130,107 @@ print_dqinfo(long rc, void *ptr, void *arg) struct if_dqinfo *di = ptr; long out_arg = (long) arg; - if (((rc != 0) && out_arg) || (out_arg > 1)) { + if (((rc < 0) && out_arg) || (out_arg > 1)) { printf("%p", di); return; } - PRINT_FIELD_U("{", di, dqi_bgrace); - PRINT_FIELD_U(", ", di, dqi_igrace); + PRINT_FIELD_U("{", *di, dqi_bgrace); + PRINT_FIELD_U(", ", *di, dqi_igrace); printf(", dqi_flags="); +# if XLAT_RAW + printf("%#x", di->dqi_flags); +# elif XLAT_VERBOSE + printf("%#x /* ", di->dqi_flags); printflags(if_dqinfo_flags, di->dqi_flags, "DQF_???"); + printf(" */"); +# else /* XLAT_ABBREV */ + printflags(if_dqinfo_flags, di->dqi_flags, "DQF_???"); +# endif printf(", dqi_valid="); +# if XLAT_RAW + printf("%#x", di->dqi_valid); +# elif XLAT_VERBOSE + printf("%#x /* ", di->dqi_valid); + printflags(if_dqinfo_valid, di->dqi_valid, "IIF_???"); + printf(" */"); +# else /* XLAT_ABBREV */ printflags(if_dqinfo_valid, di->dqi_valid, "IIF_???"); +# endif printf("}"); } +void +print_dqfmt(long rc, void *ptr, void *arg) +{ + uint32_t *fmtval = ptr; + long out_arg = (long) arg; + const char *fmtstr; + + if (((rc < 0) && out_arg) || (out_arg > 1)) { + printf("%p", fmtval); + return; + } + printf("["); +# if XLAT_RAW + printf("%#x]", *fmtval); + return; +# else + switch (*fmtval) { + case 1: + fmtstr = "QFMT_VFS_OLD"; + break; + case 2: + fmtstr = "QFMT_VFS_V0"; + break; + case 3: + fmtstr = "QFMT_OCFS2"; + break; + case 4: + fmtstr = "QFMT_VFS_V1"; + break; + default: + printf("%#x /* QFMT_VFS_??? */]", *fmtval); + return; + } +# endif +# if XLAT_VERBOSE + printf("%#x /* %s */]", *fmtval, fmtstr); +# else + printf("%s]", fmtstr); +# endif +} + +const char * +gen_quotacmd(const char *abbrev_str, const uint32_t cmd) +{ + static char quotacmd_str[2048]; + +# if XLAT_RAW + snprintf(quotacmd_str, sizeof(quotacmd_str), "%u", cmd); +# elif XLAT_VERBOSE + snprintf(quotacmd_str, sizeof(quotacmd_str), "%u /* %s */", cmd, abbrev_str); +# else + return abbrev_str; +# endif + return quotacmd_str; +} + +const char * +gen_quotaid(const char *abbrev_str, const uint32_t id) +{ + static char quotaid_str[1024]; + +# if XLAT_RAW + snprintf(quotaid_str, sizeof(quotaid_str), "%#x", id); +# elif XLAT_VERBOSE + snprintf(quotaid_str, sizeof(quotaid_str), "%#x /* %s */", id, abbrev_str); +# else + return abbrev_str; +# endif + return quotaid_str; +} int main(void) @@ -170,14 +241,14 @@ main(void) char bogus_special_str[sizeof(void *) * 2 + sizeof("0x")]; char unterminated_str[sizeof(void *) * 2 + sizeof("0x")]; - long rc; + static char invalid_cmd_str[1024]; + static char invalid_id_str[1024]; char *unterminated = tail_memdup(unterminated_data, sizeof(unterminated_data)); - struct if_dqblk *dqblk = tail_alloc(sizeof(*dqblk)); - struct if_dqinfo *dqinfo = tail_alloc(sizeof(*dqinfo)); - uint32_t *fmt = tail_alloc(sizeof(*fmt)); - struct if_nextdqblk *nextdqblk = tail_alloc(sizeof(*nextdqblk)); - + TAIL_ALLOC_OBJECT_CONST_PTR(struct if_dqblk, dqblk); + TAIL_ALLOC_OBJECT_CONST_PTR(struct if_dqinfo, dqinfo); + TAIL_ALLOC_OBJECT_CONST_PTR(uint32_t, fmt); + TAIL_ALLOC_OBJECT_CONST_PTR(struct if_nextdqblk, nextdqblk); snprintf(bogus_special_str, sizeof(bogus_special_str), "%p", bogus_special); @@ -186,63 +257,71 @@ main(void) /* Invalid commands */ + snprintf(invalid_cmd_str, sizeof(invalid_cmd_str), + "QCMD(%#x /* Q_??? */, %#x /* ???QUOTA */)", + QCMD_CMD(bogus_cmd), QCMD_TYPE(bogus_cmd)); + check_quota(CQF_NONE, bogus_cmd, gen_quotacmd(invalid_cmd_str, bogus_cmd), + bogus_special, bogus_special_str, bogus_id, bogus_addr); - rc = syscall(__NR_quotactl, bogus_cmd, bogus_special, bogus_id, - bogus_addr); - printf("quotactl(QCMD(%#x /* Q_??? */, %#x /* ???QUOTA */)" - ", %p, %u, %p) = %s\n", - QCMD_CMD(bogus_cmd), QCMD_TYPE(bogus_cmd), - bogus_special, bogus_id, bogus_addr, sprintrc(rc)); - - rc = syscall(__NR_quotactl, 0, NULL, -1, NULL); - printf("quotactl(QCMD(0 /* Q_??? */, USRQUOTA), NULL, -1, NULL) = %s\n", - sprintrc(rc)); + snprintf(invalid_cmd_str, sizeof(invalid_cmd_str), + "QCMD(0 /* Q_??? */, USRQUOTA)"); + check_quota(CQF_ADDR_STR, 0, gen_quotacmd(invalid_cmd_str, 0), + ARG_STR(NULL), -1, ARG_STR(NULL)); /* Q_QUOTAON */ check_quota(CQF_ID_STR | CQF_ADDR_STR, - ARG_STR(QCMD(Q_QUOTAON, USRQUOTA)), - ARG_STR("/dev/bogus/"), ARG_STR(QFMT_VFS_OLD), + QUOTA_STR(QCMD(Q_QUOTAON, USRQUOTA)), + ARG_STR("/dev/bogus/"), QUOTA_ID_STR(QFMT_VFS_OLD), ARG_STR("/tmp/bogus/")); - rc = syscall(__NR_quotactl, QCMD(Q_QUOTAON, 0xfacefeed), bogus_dev, - bogus_id, bogus_addr); - printf("quotactl(QCMD(Q_QUOTAON, %#x /* ???QUOTA */)" - ", %s, %#x /* QFMT_VFS_??? */, %p) = %s\n", - QCMD_TYPE(QCMD(Q_QUOTAON, 0xfacefeed)), - bogus_dev_str, bogus_id, bogus_addr, sprintrc(rc)); + snprintf(invalid_cmd_str, sizeof(invalid_cmd_str), + "QCMD(Q_QUOTAON, %#x /* ???QUOTA */)", + QCMD_TYPE(QCMD(Q_QUOTAON, 0xfacefeed))); +# if XLAT_RAW + snprintf(invalid_id_str, sizeof(invalid_id_str), + "%#x", bogus_id); +# else + snprintf(invalid_id_str, sizeof(invalid_id_str), + "%#x /* QFMT_VFS_??? */", bogus_id); +# endif + check_quota(CQF_ID_STR, QCMD(Q_QUOTAON, 0xfacefeed), + gen_quotacmd(invalid_cmd_str, QCMD(Q_QUOTAON, 0xfacefeed)), + bogus_dev, bogus_dev_str, + bogus_id, invalid_id_str, bogus_addr); /* Q_QUOTAOFF */ check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, - ARG_STR(QCMD(Q_QUOTAOFF, USRQUOTA)), + QUOTA_STR(QCMD(Q_QUOTAOFF, USRQUOTA)), bogus_special, bogus_special_str); check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, - ARG_STR(QCMD(Q_QUOTAOFF, GRPQUOTA)), + QUOTA_STR(QCMD(Q_QUOTAOFF, GRPQUOTA)), ARG_STR("/dev/bogus/")); check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, - ARG_STR(QCMD(Q_QUOTAOFF, PRJQUOTA)), ARG_STR(NULL)); + QUOTA_STR(QCMD(Q_QUOTAOFF, PRJQUOTA)), ARG_STR(NULL)); + const char *cmd_str = "QCMD(Q_QUOTAOFF, 0x3 /* ???QUOTA */)"; check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, - QCMD(Q_QUOTAOFF, 3), "QCMD(Q_QUOTAOFF, 0x3 /* ???QUOTA */)", + QUOTA_STR_INVALID(QCMD(Q_QUOTAOFF, 3), cmd_str), ARG_STR(NULL)); /* Q_GETQUOTA */ /* Trying our best to get successful result */ - check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, USRQUOTA)), + check_quota(CQF_ADDR_CB, QUOTA_STR(QCMD(Q_GETQUOTA, USRQUOTA)), ARG_STR("/dev/sda1"), getuid(), dqblk, print_dqblk, (intptr_t) 1); - check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, GRPQUOTA)), - ARG_STR(NULL), -1, dqblk, print_dqblk, (intptr_t) 2); + check_quota(CQF_ADDR_CB, QUOTA_STR(QCMD(Q_GETQUOTA, GRPQUOTA)), + ARG_STR(NULL), -1, dqblk, print_dqblk, (intptr_t) 1); /* Q_GETNEXTQUOTA */ - check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETNEXTQUOTA, USRQUOTA)), + check_quota(CQF_ADDR_CB, QUOTA_STR(QCMD(Q_GETNEXTQUOTA, USRQUOTA)), ARG_STR("/dev/sda1"), 0, nextdqblk, print_nextdqblk, (intptr_t) 1); @@ -251,10 +330,10 @@ main(void) fill_memory(dqblk, sizeof(*dqblk)); - check_quota(CQF_NONE, ARG_STR(QCMD(Q_SETQUOTA, PRJQUOTA)), + check_quota(CQF_NONE, QUOTA_STR(QCMD(Q_SETQUOTA, PRJQUOTA)), bogus_special, bogus_special_str, 0, bogus_addr); - check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_SETQUOTA, PRJQUOTA)), + check_quota(CQF_ADDR_CB, QUOTA_STR(QCMD(Q_SETQUOTA, PRJQUOTA)), ARG_STR("/dev/bogus/"), 3141592653U, dqblk, print_dqblk, (intptr_t) 0); @@ -262,13 +341,13 @@ main(void) /* Q_GETINFO */ check_quota(CQF_ID_SKIP | CQF_ADDR_CB, - ARG_STR(QCMD(Q_GETINFO, GRPQUOTA)), + QUOTA_STR(QCMD(Q_GETINFO, GRPQUOTA)), ARG_STR("/dev/sda1"), dqinfo, print_dqinfo, (intptr_t) 1); check_quota(CQF_ID_SKIP | CQF_ADDR_CB, - ARG_STR(QCMD(Q_GETINFO, GRPQUOTA)), + QUOTA_STR(QCMD(Q_GETINFO, GRPQUOTA)), bogus_special, bogus_special_str, dqinfo, - print_dqinfo, (intptr_t) 2); + print_dqinfo, (intptr_t) 1); /* Q_SETINFO */ @@ -277,34 +356,40 @@ main(void) dqinfo->dqi_flags = 0xdeadabcd; check_quota(CQF_ID_SKIP | CQF_ADDR_STR, - ARG_STR(QCMD(Q_SETINFO, PRJQUOTA)), + QUOTA_STR(QCMD(Q_SETINFO, PRJQUOTA)), bogus_special, bogus_special_str, ARG_STR(NULL)); check_quota(CQF_ID_SKIP | CQF_ADDR_CB, - ARG_STR(QCMD(Q_SETINFO, USRQUOTA)), + QUOTA_STR(QCMD(Q_SETINFO, USRQUOTA)), ARG_STR("/dev/bogus/"), dqinfo, print_dqinfo, (intptr_t) 0); /* Q_GETFMT */ check_quota(CQF_ID_SKIP | CQF_ADDR_STR, - ARG_STR(QCMD(Q_GETFMT, PRJQUOTA)), + QUOTA_STR(QCMD(Q_GETFMT, PRJQUOTA)), bogus_special, bogus_special_str, ARG_STR(NULL)); check_quota(CQF_ID_SKIP, - ARG_STR(QCMD(Q_GETFMT, USRQUOTA)), + QUOTA_STR(QCMD(Q_GETFMT, USRQUOTA)), unterminated, unterminated_str, fmt + 1); - check_quota(CQF_ID_SKIP, - ARG_STR(QCMD(Q_GETFMT, GRPQUOTA)), - ARG_STR("/dev/sda1"), fmt); + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + QUOTA_STR(QCMD(Q_GETFMT, GRPQUOTA)), + ARG_STR("/dev/sda1"), fmt, print_dqfmt, (uintptr_t) 1); + /* Try to check valid quota format */ + *fmt = QFMT_VFS_OLD; + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + QUOTA_STR(QCMD(Q_GETFMT, GRPQUOTA)), + ARG_STR("/dev/sda1"), fmt, print_dqfmt, (uintptr_t) 1); /* Q_SYNC */ check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, - ARG_STR(QCMD(Q_SYNC, USRQUOTA)), + QUOTA_STR(QCMD(Q_SYNC, USRQUOTA)), bogus_special, bogus_special_str); + cmd_str = "QCMD(Q_SYNC, 0xff /* ???QUOTA */)"; check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, - QCMD(Q_SYNC, 0xfff), "QCMD(Q_SYNC, 0xff /* ???QUOTA */)", + QUOTA_STR_INVALID(QCMD(Q_SYNC, 0xfff), cmd_str), ARG_STR(NULL)); puts("+++ exited with 0 +++"); diff --git a/tests-mx32/quotactl.gen.test b/tests-mx32/quotactl.gen.test new file mode 100755 index 00000000..6d2dc754 --- /dev/null +++ b/tests-mx32/quotactl.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (quotactl ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/quotactl.h b/tests-mx32/quotactl.h index 31eaec58..4d29ac11 100644 --- a/tests-mx32/quotactl.h +++ b/tests-mx32/quotactl.h @@ -3,37 +3,19 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef STRACE_TESTS_QUOTACTL_H -#define STRACE_TESTS_QUOTACTL_H +# define STRACE_TESTS_QUOTACTL_H # include # include # include +# include "print_fields.h" # ifdef HAVE_LINUX_QUOTA_H /* Broken in CentOS 5: has extern spinlock_t dq_data_lock; declaration */ @@ -57,18 +39,6 @@ # define PRJQUOTA 2 # endif -# define PRINT_FIELD_D(prefix, where, field) \ - printf("%s%s=%lld", (prefix), #field, \ - sign_extend_unsigned_to_ll((where)->field)) - -# define PRINT_FIELD_U(prefix, where, field) \ - printf("%s%s=%llu", (prefix), #field, \ - zero_extend_signed_to_ull((where)->field)) - -# define PRINT_FIELD_X(prefix, where, field) \ - printf("%s%s=%#llx", (prefix), #field, \ - zero_extend_signed_to_ull((where)->field)) - typedef void (*print_cb)(long rc, void *addr, void *arg); enum check_quotactl_flag_bits { @@ -88,7 +58,73 @@ enum check_quotactl_flags { CQF_ADDR_CB = 1 << CQF_ADDR_CB_BIT, }; +static const char *errstr; +/** + * Generic quotactl syscall checker function. Call convention: + * + * check_quota(flags, cmd, cmd_str, special, special_str + * [, id [, id_str]] + * [, addr [, { addr_cb, addr_cb_arg | addr_str }]]) + * + * check_quota performs a syscall invocation and prints the expected output + * for it. + * + * It might be useful to employ ARG_STR macro for passing cmd/cmd_str, + * special_special_str, id/id_str, and addr/addr_str argument pairs. + * + * @param flags Check flags: + * - CQF_ID_SKIP: the "id" syscall argument is ignored + * in the syscall invocation. No id and id_str arguments + * should be provided if this flag is set. + * This flag has priority over the CQF_ID_STR flag. + * - CQF_ID_STR: the "id" syscall argument has a special string + * representation. id_str argument should be provided if this + * flag is set; no id_str argument should be provided and id + * argument is printed as unsigned integer (with an exception + * for -1, which is printed as signed) if this flag is not set. + * - CQF_ADDR_SKIP: the "addr" syscall argument is ignored + * in the syscall invocation. None of the addr, addr_cb, + * addr_cb_arg, and/or addr_str arguments should be provided + * if this flag is set. This flag has priority + * over the CQF_ADDR_STR and CQF_ADDR_CB flags. + * - CQF_ADDR_CB: the "addr" syscall argument printing is handled + * via a callback function. addr_cb (that points to a callback + * function of type print_cb) and addr_cb_arg (an opaque pointer + * that is passed to addr_cb in the third argument) should + * be provided if this flag is set. + * This flag has priority over the CQF_ADDR_STR flag. + * - CQF_ADDR_STR: addr syscall argument has a special string + * representation. addr_str argument should be provided if this + * flag is set. If both CQF_ADDR_CB and CQF_ADDR_STR flags + * are not set, addr syscall argument is printed using "%p" + * printf format. + * @param cmd Value of the "cmd" syscall argument that should be passed + * in the syscall invocation. + * @param cmd_str String representation of the "cmd" syscall argument. + * @param special Value of the "special" syscall argument that should be passed + * in the syscall invocation. + * @param special_str String representation of the "special" syscall argument. + * @param ... Additional arguments depend on the flags being set: + * - id: Value of the "id" syscall argument. Provided + * if CQF_ID_SKIP is not set, otherwise -1 is passed + * in the syscall invocation and the argument is not printed + * in the expected output. + * - id_str: String representation of the "id" syscall argument. + * Provided if CQF_ID_SKIP is not set and CQF_ID_STR is set. + * - addr: Value of the "addr" syscall argument. Provided + * if CQF_ADDR_SKIP is not set, otherwise NULL is passed + * in the syscall invocation and the argument is not printed + * in the expected output. + * - addr_cb: Callback function that is called for the "addr" + * syscall argument printing. Should be of print_cb type. + * Provided if CQF_ADDR_SKIP is not set and CQF_ADDR_CB is set. + * - addr_cb_arg: Opaque pointer that is passed to addr_cb, + * Provided if CQF_ADDR_SKIP is not set and CQF_ADDR_CB is set. + * - addr_str: String representation of the "addr" syscall argument. + * Provided if CQF_ADDR_SKIP is not set, CQF_ADDR_CB is not set, + * and CQF_ADDR_STR is set. + */ static inline void check_quota(uint32_t flags, int cmd, const char *cmd_str, const char *special, const char *special_str, ...) @@ -126,6 +162,20 @@ check_quota(uint32_t flags, int cmd, const char *cmd_str, va_end(ap); rc = syscall(__NR_quotactl, cmd, special, id, addr); + + errstr = sprintrc(rc); + +# ifdef INJECT_RETVAL + if (rc != INJECT_RETVAL) + error_msg_and_fail("Got a return value of %ld != %d", + rc, INJECT_RETVAL); + + static char inj_errstr[4096]; + + snprintf(inj_errstr, sizeof(inj_errstr), "%s (INJECTED)", errstr); + errstr = inj_errstr; +# endif + printf("quotactl(%s, %s", cmd_str, special_str); if (!(flags & CQF_ID_SKIP)) { @@ -150,7 +200,7 @@ check_quota(uint32_t flags, int cmd, const char *cmd_str, } } - printf(") = %s\n", sprintrc(rc)); + printf(") = %s\n", errstr); } diff --git a/tests-mx32/quotactl.test b/tests-mx32/quotactl.test deleted file mode 100755 index d0101f46..00000000 --- a/tests-mx32/quotactl.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of quotactl syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/read-write.c b/tests-mx32/read-write.c index 262e07b5..0217670b 100644 --- a/tests-mx32/read-write.c +++ b/tests-mx32/read-write.c @@ -2,29 +2,10 @@ * Check decoding and dumping of read and write syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,31 +17,52 @@ #include static void -dump_str(const char *str, const unsigned int len) +dump_str_ex(const char *str, const unsigned int len, const int idx_w) { - static const char dots[16] = "................"; + static const char chars[256] = + "................................" + " !\"#$%&'()*+,-./0123456789:;<=>?" + "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" + "`abcdefghijklmnopqrstuvwxyz{|}~." + "................................" + "................................" + "................................" + "................................"; unsigned int i; for (i = 0; i < len; i += 16) { unsigned int n = len - i > 16 ? 16 : len - i; const char *dump = hexdump_memdup(str + i, n); - tprintf(" | %05x %-49s %-16.*s |\n", - i, dump, n, dots); + tprintf(" | %0*x %-49s %-16.*s |\n", + idx_w, i, dump, n, chars + i % 0x100); free((void *) dump); } } +static inline void +dump_str(const char *str, const unsigned int len) +{ + dump_str_ex(str, len, 5); +} + static void print_hex(const char *str, const unsigned int len) { const unsigned char *ustr = (const unsigned char *) str; unsigned int i; + tprintf("\""); + for (i = 0; i < len; ++i) { unsigned int c = ustr[i]; + if (i >= DEFAULT_STRLEN) { + tprintf("\"..."); + return; + } + switch (c) { case '\t': tprintf("\\t"); break; @@ -76,6 +78,8 @@ print_hex(const char *str, const unsigned int len) tprintf("\\%o", ustr[i]); } } + + tprintf("\""); } static long @@ -93,9 +97,12 @@ k_write(unsigned int fd, const void *buf, size_t count) } static void -test_dump(const unsigned int len) +test_dump(const unsigned int len, bool err_desc) { static char *buf; + const char *rc_str; + int in_fd = err_desc ? 5 : 0; + int out_fd = err_desc ? 4 : 1; if (buf) { size_t ps1 = get_page_size() - 1; @@ -104,28 +111,34 @@ test_dump(const unsigned int len) buf = tail_alloc(len); } - long rc = k_read(0, buf, len); - if (rc != (int) len) + long rc = k_read(in_fd, buf, len); + rc_str = sprintrc(rc); + if (err_desc ^ (rc != (int) len)) perror_msg_and_fail("read: expected %d, returned %ld", - len, rc); + err_desc ? -1 : (int) len, rc); - tprintf("%s(%d, \"", "read", 0); - print_hex(buf, len); - tprintf("\", %d) = %ld\n", len, rc); - dump_str(buf, len); + tprintf("%s(%d, ", "read", in_fd); + if (!err_desc) + print_hex(buf, len); + else + tprintf("%p", buf); + tprintf(", %d) = %s\n", len, rc_str); + if (!err_desc) + dump_str(buf, len); unsigned int i; for (i = 0; i < len; ++i) buf[i] = i; - rc = k_write(1, buf, len); - if (rc != (int) len) + rc = k_write(out_fd, buf, len); + rc_str = sprintrc(rc); + if (err_desc ^ (rc != (int) len)) perror_msg_and_fail("write: expected %d, returned %ld", - len, rc); + err_desc ? -1 : (int) len, rc); - tprintf("%s(%d, \"", "write", 1); + tprintf("%s(%d, ", "write", out_fd); print_hex(buf, len); - tprintf("\", %d) = %ld\n", len, rc); + tprintf(", %d) = %s\n", len, rc_str); dump_str(buf, len); if (!len) @@ -137,7 +150,9 @@ main(void) { tprintf("%s", ""); - static char tmp[] = "read-write-tmpfile"; + skip_if_unavailable("/proc/self/fd/"); + + static const char tmp[] = "read-write-tmpfile"; if (open(tmp, O_CREAT|O_RDONLY|O_TRUNC, 0600) != 0) perror_msg_and_fail("creat: %s", tmp); if (open(tmp, O_WRONLY) != 1) @@ -180,7 +195,6 @@ main(void) tprintf("write(1, \"%s\", %u) = %ld\n" " | 00000 %-49s %-16s |\n", w_c, w_len, rc, w_d, w_c); - close(1); rc = k_read(0, r0, 0); if (rc) @@ -209,15 +223,64 @@ main(void) r1_c, w_len, rc, r1_d, r1_c); close(0); + /* + * Check partial dump; relies on dumpstr() implementation details + * (maximum size of chunk to be copied at once). + */ + static const size_t six_wide_size = 1 << 20; + static const size_t fetch_size = 1 << 16; + static const char big_buf_str[] = + "\\0\\1\\2\\3\\4\\5\\6\\7" + "\\10\\t\\n\\v\\f\\r\\16\\17" + "\\20\\21\\22\\23\\24\\25\\26\\27" + "\\30\\31\\32\\33\\34\\35\\36\\37"; + const size_t buf_size = six_wide_size + fetch_size; + const size_t sizes[] = { + six_wide_size, + six_wide_size + 1, + buf_size, + buf_size + 1, + buf_size + 2, + }; + char *big_buf = tail_alloc(buf_size); + + fill_memory_ex(big_buf, buf_size, 0, 0x100); + + for (size_t i = 0; i < ARRAY_SIZE(sizes); i++) { + rc = k_write(1, big_buf, sizes[i]); + tprintf("write(1, \"%s\"..., %zu) = %s\n", + big_buf_str, sizes[i], sprintrc(rc)); + dump_str_ex(big_buf, MIN(sizes[i], buf_size), + sizes[i] > six_wide_size ? 6 : 5); + + if (sizes[i] == buf_size + 1) + tprintf(" | \n", + getpid(), big_buf + buf_size); + + if (sizes[i] == buf_size + 2) + tprintf(" | \n", + getpid(), big_buf + buf_size); + } + + close(1); + if (open("/dev/zero", O_RDONLY)) perror_msg_and_fail("open"); if (open("/dev/null", O_WRONLY) != 1) perror_msg_and_fail("open"); + if (open("/dev/zero", O_RDONLY) != 4) + perror_msg_and_fail("open"); + + if (open("/dev/null", O_WRONLY) != 5) + perror_msg_and_fail("open"); + unsigned int i; - for (i = 0; i <= 32; ++i) - test_dump(i); + for (i = 0; i <= DEFAULT_STRLEN; ++i) + test_dump(i, false); + + test_dump(256, true); tprintf("+++ exited with 0 +++\n"); return 0; diff --git a/tests-mx32/read-write.gen.test b/tests-mx32/read-write.gen.test new file mode 100755 index 00000000..c66628f2 --- /dev/null +++ b/tests-mx32/read-write.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (read-write -a15 -eread=0,5 -ewrite=1,4 -e trace=read,write -P read-write-tmpfile -P /dev/zero -P /dev/null); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 -eread=0,5 -ewrite=1,4 -e trace=read,write -P read-write-tmpfile -P /dev/zero -P /dev/null diff --git a/tests-mx32/read-write.test b/tests-mx32/read-write.test deleted file mode 100755 index 3700541f..00000000 --- a/tests-mx32/read-write.test +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# Check decoding and dumping of read and write syscalls. - -. "${srcdir=.}/init.sh" - -# strace -P is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - -tmpfile=read-write-tmpfile -> $tmpfile - -run_strace_match_diff \ - -a15 -eread=0 -ewrite=1 -e trace=read,write \ - -P $tmpfile -P /dev/zero -P /dev/null - -rm -f $tmpfile diff --git a/tests-mx32/readahead.c b/tests-mx32/readahead.c index c11b577d..1b21fe59 100644 --- a/tests-mx32/readahead.c +++ b/tests-mx32/readahead.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,7 +17,7 @@ * see https://sourceware.org/bugzilla/show_bug.cgi?id=5208 */ # if !(defined __GLIBC_MINOR__ && \ - (__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 8) + (__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 8) # undef HAVE_READAHEAD # endif /* glibc < 2.8 */ /* @@ -44,7 +25,7 @@ * see https://sourceware.org/bugzilla/show_bug.cgi?id=21026 */ # if defined LINUX_MIPSN64 && !(defined __GLIBC_MINOR__ && \ - (__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 25) + (__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 25) # undef HAVE_READAHEAD # endif /* LINUX_MIPSN64 && glibc < 2.25 */ # endif /* __GLIBC__ */ diff --git a/tests-mx32/readahead.gen.test b/tests-mx32/readahead.gen.test new file mode 100755 index 00000000..c27ab0d0 --- /dev/null +++ b/tests-mx32/readahead.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (readahead -a1 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a1 diff --git a/tests-mx32/readahead.test b/tests-mx32/readahead.test deleted file mode 100755 index 397c6903..00000000 --- a/tests-mx32/readahead.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check readahead syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a1 diff --git a/tests-mx32/readdir.c b/tests-mx32/readdir.c index 8c483620..284c221e 100644 --- a/tests-mx32/readdir.c +++ b/tests-mx32/readdir.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -58,9 +39,9 @@ static const char qname[] = "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nZ"; int -main(int ac, const char **av) +main(void) { - char *dname; + static const char dname[] = "readdir.test.tmp.dir"; struct { unsigned long d_ino; unsigned long d_off; @@ -69,8 +50,6 @@ main(int ac, const char **av) } e; int rc; - assert(ac == 1); - assert(asprintf(&dname, "%s.test.tmp.dir", av[0]) > 0); assert(!mkdir(dname, 0700)); assert(!chdir(dname)); (void) close(0); diff --git a/tests-mx32/readdir.gen.test b/tests-mx32/readdir.gen.test new file mode 100755 index 00000000..09aad4f6 --- /dev/null +++ b/tests-mx32/readdir.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (readdir -a16 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 diff --git a/tests-mx32/readdir.test b/tests-mx32/readdir.test deleted file mode 100755 index e3132737..00000000 --- a/tests-mx32/readdir.test +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -# Check readdir syscall decoding. - -. "${srcdir=.}/init.sh" - -rm -rf -- "$LOG".dir -run_strace_match_diff -a16 diff --git a/tests-mx32/readlink.c b/tests-mx32/readlink.c index 4ddf5fac..c2a9b22c 100644 --- a/tests-mx32/readlink.c +++ b/tests-mx32/readlink.c @@ -1,29 +1,9 @@ /* * Copyright (c) 2015 Gleb Fotengauer-Malinovskiy - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/readlink.gen.test b/tests-mx32/readlink.gen.test new file mode 100755 index 00000000..42632341 --- /dev/null +++ b/tests-mx32/readlink.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (readlink -xx ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -xx diff --git a/tests-mx32/readlink.test b/tests-mx32/readlink.test deleted file mode 100755 index c026ecbe..00000000 --- a/tests-mx32/readlink.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check readlink syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -xx diff --git a/tests-mx32/readlinkat.c b/tests-mx32/readlinkat.c index 4d3b516c..6909ac0b 100644 --- a/tests-mx32/readlinkat.c +++ b/tests-mx32/readlinkat.c @@ -1,29 +1,9 @@ /* * Copyright (c) 2015 Gleb Fotengauer-Malinovskiy - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/readlinkat.gen.test b/tests-mx32/readlinkat.gen.test new file mode 100755 index 00000000..d7de9932 --- /dev/null +++ b/tests-mx32/readlinkat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (readlinkat -xx ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -xx diff --git a/tests-mx32/readlinkat.test b/tests-mx32/readlinkat.test deleted file mode 100755 index 229c8e1e..00000000 --- a/tests-mx32/readlinkat.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check readlinkat syscall decoding. - -. "${srcdir=.}/readlink.test" diff --git a/tests-mx32/readv.c b/tests-mx32/readv.c index 0e5aab65..185d12cc 100644 --- a/tests-mx32/readv.c +++ b/tests-mx32/readv.c @@ -2,29 +2,10 @@ * Check decoding of readv and writev syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -88,7 +69,7 @@ main(void) fds[1], (long) writev(fds[1], w_iov, 0)); rc = writev(fds[1], w_iov + ARRAY_SIZE(w_iov_) - 1, 2); - tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%u}, %p], 2)" + tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%u}, ... /* %p */], 2)" " = %ld %s (%m)\n", fds[1], w2_c, LENGTH_OF(w2_c), w_iov + ARRAY_SIZE(w_iov_), rc, errno2name()); @@ -108,7 +89,7 @@ main(void) " * %u bytes in buffer 2\n" " | 00000 %-49s %-16s |\n", fds[1], w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), - w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w_iov_), w_len, + w2_c, LENGTH_OF(w2_c), (unsigned int) ARRAY_SIZE(w_iov_), w_len, LENGTH_OF(w0_c), w0_d, w0_c, LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); @@ -126,8 +107,8 @@ main(void) tprintf("readv(%d, [{iov_base=\"%s\", iov_len=%u}], %u) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - fds[0], - r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + fds[0], r0_c, r_len, (unsigned int) ARRAY_SIZE(r0_iov_), + r_len, r_len, r0_d, r0_c); void *r1 = tail_alloc(r_len); void *r2 = tail_alloc(w_len); @@ -148,8 +129,8 @@ main(void) ", {iov_base=\"\", iov_len=%u}], %u) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - fds[0], r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), w_len - r_len, - w_len - r_len, r1_d, r1_c); + fds[0], r1_c, r_len, w_len, (unsigned int) ARRAY_SIZE(r1_iov_), + w_len - r_len, w_len - r_len, r1_d, r1_c); close(fds[0]); tprintf("+++ exited with 0 +++\n"); diff --git a/tests-mx32/readv.test b/tests-mx32/readv.test index dc187996..ddeb6f97 100755 --- a/tests-mx32/readv.test +++ b/tests-mx32/readv.test @@ -3,29 +3,10 @@ # Check decoding and dumping of readv and writev syscalls. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -38,7 +19,7 @@ run_strace_match_diff -a16 -e trace=readv,writev \ run_strace_match_diff -a16 -e trace=readv,writev \ -eread='!all' -ewrite=none -eread='!0,1,2' -ewrite='!0,1,2' -wfd="$(./print_maxfd)" +wfd="$(../print_maxfd)" rfd="$(($wfd - 1))" run_strace_match_diff -a16 -e trace=readv,writev \ -eread="$rfd" -ewrite="$wfd" diff --git a/tests-mx32/reboot.c b/tests-mx32/reboot.c index 9b09e647..8bc9c6b0 100644 --- a/tests-mx32/reboot.c +++ b/tests-mx32/reboot.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -10,21 +17,83 @@ # define INVALID_MAGIC 319887762 # define INVALID_CMD 0x01234568 +# define STR32 "AbCdEfGhIjKlMnOpQrStUvWxYz012345" +# define STR128 STR32 STR32 STR32 STR32 + int main(void) { + static const kernel_ulong_t bogus_magic1 = + (kernel_ulong_t) 0xFFFFFFFFFFFFFFFFULL; + static const kernel_ulong_t bogus_magic2 = + (kernel_ulong_t) 0xdeadfacefa57beefULL; + static const kernel_ulong_t bogus_cmd = + (kernel_ulong_t) 0xbadda7a09caffee1ULL; static const char buf[] = "reboot"; - long rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, \ - INVALID_MAGIC, LINUX_REBOOT_CMD_RESTART2, buf); + static const char str256_buf[] = STR128 STR128; + + long rc; + char *str256 = tail_memdup(str256_buf, sizeof(str256_buf) - 1); + + rc = syscall(__NR_reboot, 0, 0, 0, 0); + printf("reboot(0 /* LINUX_REBOOT_MAGIC_??? */, " + "0 /* LINUX_REBOOT_MAGIC_??? */, " + "LINUX_REBOOT_CMD_CAD_OFF) = %s\n", + sprintrc(rc)); + + rc = syscall(__NR_reboot, bogus_magic1, bogus_magic2, bogus_cmd, -1); + printf("reboot(%#x /* LINUX_REBOOT_MAGIC_??? */, " + "%#x /* LINUX_REBOOT_MAGIC_??? */, " + "%#x /* LINUX_REBOOT_CMD_??? */) = %s\n", + (unsigned int) bogus_magic1, (unsigned int) bogus_magic2, + (unsigned int) bogus_cmd, sprintrc(rc)); + + rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, + INVALID_MAGIC, LINUX_REBOOT_CMD_RESTART2, buf); printf("reboot(LINUX_REBOOT_MAGIC1, %#x /* LINUX_REBOOT_MAGIC_??? */," - " LINUX_REBOOT_CMD_RESTART2, \"%s\") = %ld %s (%m)\n", - INVALID_MAGIC, buf, rc, errno2name()); + " LINUX_REBOOT_CMD_RESTART2, \"%s\") = %s\n", + INVALID_MAGIC, buf, sprintrc(rc)); - rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, \ - LINUX_REBOOT_MAGIC2, INVALID_CMD); + rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, + LINUX_REBOOT_MAGIC2, INVALID_CMD); printf("reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2," - " %#x /* LINUX_REBOOT_CMD_??? */) = %ld %s (%m)\n", - INVALID_CMD, rc, errno2name()); + " %#x /* LINUX_REBOOT_CMD_??? */) = %s\n", + INVALID_CMD, sprintrc(rc)); + + rc = syscall(__NR_reboot, INVALID_MAGIC, LINUX_REBOOT_MAGIC2A, + LINUX_REBOOT_CMD_RESTART2, str256); + printf("reboot(%#x /* LINUX_REBOOT_MAGIC_??? */, LINUX_REBOOT_MAGIC2A, " + "LINUX_REBOOT_CMD_RESTART2, \"%.255s\"...) = %s\n", + INVALID_MAGIC, str256, sprintrc(rc)); + + rc = syscall(__NR_reboot, INVALID_MAGIC, LINUX_REBOOT_MAGIC2B, + LINUX_REBOOT_CMD_RESTART2, str256 + 1); + printf("reboot(%#x /* LINUX_REBOOT_MAGIC_??? */, LINUX_REBOOT_MAGIC2B, " + "LINUX_REBOOT_CMD_RESTART2, \"%.255s\"...) = %s\n", + INVALID_MAGIC, str256 + 1, sprintrc(rc)); + + rc = syscall(__NR_reboot, INVALID_MAGIC, LINUX_REBOOT_MAGIC2C, + LINUX_REBOOT_CMD_RESTART2, str256 + 2); + printf("reboot(%#x /* LINUX_REBOOT_MAGIC_??? */, LINUX_REBOOT_MAGIC2C, " + "LINUX_REBOOT_CMD_RESTART2, %p) = %s\n", + INVALID_MAGIC, str256 + 2, sprintrc(rc)); + + str256[255] = '\0'; + rc = syscall(__NR_reboot, INVALID_MAGIC, bogus_magic1, + LINUX_REBOOT_CMD_RESTART2, str256); + printf("reboot(%#x /* LINUX_REBOOT_MAGIC_??? */, " + "%#x /* LINUX_REBOOT_MAGIC_??? */, " + "LINUX_REBOOT_CMD_RESTART2, \"%.255s\"...) = %s\n", + INVALID_MAGIC, (unsigned int) bogus_magic1, str256, + sprintrc(rc)); + + rc = syscall(__NR_reboot, INVALID_MAGIC, bogus_magic1, + LINUX_REBOOT_CMD_RESTART2, str256 + 1); + printf("reboot(%#x /* LINUX_REBOOT_MAGIC_??? */, " + "%#x /* LINUX_REBOOT_MAGIC_??? */, " + "LINUX_REBOOT_CMD_RESTART2, \"%.254s\") = %s\n", + INVALID_MAGIC, (unsigned int) bogus_magic1, str256 + 1, + sprintrc(rc)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/reboot.gen.test b/tests-mx32/reboot.gen.test new file mode 100755 index 00000000..06d2f0cb --- /dev/null +++ b/tests-mx32/reboot.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (reboot -s 256); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s 256 diff --git a/tests-mx32/reboot.test b/tests-mx32/reboot.test deleted file mode 100755 index a97dd21a..00000000 --- a/tests-mx32/reboot.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check reboot syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/recvfrom.c b/tests-mx32/recvfrom.c index b12454d2..c363f6fa 100644 --- a/tests-mx32/recvfrom.c +++ b/tests-mx32/recvfrom.c @@ -1,30 +1,10 @@ /* * Check decoding of sockaddr related arguments of recvfrom syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #define TEST_SYSCALL_NAME recvfrom diff --git a/tests-mx32/recvfrom.gen.test b/tests-mx32/recvfrom.gen.test new file mode 100755 index 00000000..2741d210 --- /dev/null +++ b/tests-mx32/recvfrom.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (recvfrom -a35 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests-mx32/recvfrom.test b/tests-mx32/recvfrom.test deleted file mode 100755 index 9dfbc898..00000000 --- a/tests-mx32/recvfrom.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of sockaddr related arguments of recvfrom syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a35 diff --git a/tests-mx32/recvmmsg-timeout.c b/tests-mx32/recvmmsg-timeout.c index 7cf064db..2e703da0 100644 --- a/tests-mx32/recvmmsg-timeout.c +++ b/tests-mx32/recvmmsg-timeout.c @@ -2,29 +2,10 @@ * Check decoding of timeout argument of recvmmsg syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -50,13 +31,15 @@ main(void) .msg_iovlen = 1 } }; - struct timespec t = { .tv_sec = 0, .tv_nsec = 12345678 }; + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, ts); + ts->tv_sec = 0; + ts->tv_nsec = 12345678; - int rc = recv_mmsg(-1, &mh, 1, 0, &t); + int rc = recv_mmsg(-1, &mh, 1, 0, ts); printf("recvmmsg(-1, %p, 1, 0, {tv_sec=0, tv_nsec=12345678})" - " = %d %s (%m)\n", &mh, rc, errno2name()); + " = %s\n", &mh, sprintrc(rc)); - rc = recv_mmsg(fds[0], &mh, 1, 0, &t); + rc = recv_mmsg(fds[0], &mh, 1, 0, ts); if (rc < 0) perror_msg_and_skip("recvmmsg"); printf("recvmmsg(%d, [{msg_hdr={msg_name=NULL, msg_namelen=0" @@ -64,7 +47,23 @@ main(void) ", msg_controllen=0, msg_flags=0}, msg_len=1}], 1, 0" ", {tv_sec=0, tv_nsec=12345678}) = " "%d (left {tv_sec=0, tv_nsec=%d})\n", - fds[0], rc, (int) t.tv_nsec); + fds[0], rc, (int) ts->tv_nsec); + + ts->tv_sec = 0xdeadbeefU; + ts->tv_nsec = 0xfacefeedU; + + rc = recv_mmsg(fds[0], &mh, 1, 0, ts); + printf("recvmmsg(%d, %p, 1, 0, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + fds[0], &mh, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), sprintrc(rc)); + + ts->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + ts->tv_nsec = (long) 0xbadc0dedfacefeedLL; + + rc = recv_mmsg(fds[0], &mh, 1, 0, ts); + printf("recvmmsg(%d, %p, 1, 0, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + fds[0], &mh, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), sprintrc(rc)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/recvmmsg-timeout.gen.test b/tests-mx32/recvmmsg-timeout.gen.test new file mode 100755 index 00000000..6306de76 --- /dev/null +++ b/tests-mx32/recvmmsg-timeout.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (recvmmsg-timeout -a25 -e trace=recvmmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 -e trace=recvmmsg diff --git a/tests-mx32/recvmmsg-timeout.test b/tests-mx32/recvmmsg-timeout.test deleted file mode 100755 index 36a12221..00000000 --- a/tests-mx32/recvmmsg-timeout.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of timeout argument of recvmmsg syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a25 -e trace=recvmmsg diff --git a/tests-mx32/recvmsg.c b/tests-mx32/recvmsg.c index fa41a9d4..f61fffb7 100644 --- a/tests-mx32/recvmsg.c +++ b/tests-mx32/recvmsg.c @@ -2,29 +2,10 @@ * Check decoding of recvmsg and sendmsg syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -100,7 +81,7 @@ main(void) w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), w2_c, LENGTH_OF(w2_c), - ARRAY_SIZE(w_iov_), w_len, + (unsigned int) ARRAY_SIZE(w_iov_), w_len, LENGTH_OF(w0_c), w0_d, w0_c, LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); @@ -127,7 +108,8 @@ main(void) ", msg_controllen=0, msg_flags=0}, 0) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + r0_c, r_len, (unsigned int) ARRAY_SIZE(r0_iov_), + r_len, r_len, r0_d, r0_c); void *r1 = tail_alloc(r_len); void *r2 = tail_alloc(w_len); @@ -151,8 +133,8 @@ main(void) ", msg_iovlen=%u, msg_controllen=0, msg_flags=0}, 0) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), w_len - r_len, - w_len - r_len, r1_d, r1_c); + r1_c, r_len, w_len, (unsigned int) ARRAY_SIZE(r1_iov_), + w_len - r_len, w_len - r_len, r1_d, r1_c); close(0); tprintf("+++ exited with 0 +++\n"); diff --git a/tests-mx32/recvmsg.gen.test b/tests-mx32/recvmsg.gen.test new file mode 100755 index 00000000..fc8ef067 --- /dev/null +++ b/tests-mx32/recvmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (recvmsg -eread=0 -ewrite=1 -e trace=recvmsg,sendmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -eread=0 -ewrite=1 -e trace=recvmsg,sendmsg diff --git a/tests-mx32/recvmsg.test b/tests-mx32/recvmsg.test deleted file mode 100755 index e373a20a..00000000 --- a/tests-mx32/recvmsg.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of recvmsg and sendmsg syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -eread=0 -ewrite=1 -e trace=recvmsg,sendmsg diff --git a/tests-mx32/redirect-fds.c b/tests-mx32/redirect-fds.c index fc1073a7..afce7d4c 100644 --- a/tests-mx32/redirect-fds.c +++ b/tests-mx32/redirect-fds.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/redirect-fds.test b/tests-mx32/redirect-fds.test index ddef8fab..a833a586 100755 --- a/tests-mx32/redirect-fds.test +++ b/tests-mx32/redirect-fds.test @@ -3,29 +3,10 @@ # Check that strace does not leak placeholder descriptors. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -47,18 +28,17 @@ check_fd() a2="$2" a3="$3" + rm -f "$LOG" "$fd0" "$fd1" "$fd2" touch "$LOG" "$fd0" || framework_skip_ 'failed to create files' - set -- "\"./$NAME\"" "\"$1\"" "\"$2\"" "\"$3\"" + set -- "\"../$NAME\"" "\"$1\"" "\"$2\"" "\"$3\"" eval "$@" "<${a1:-&-}" ">${a2:-&-}" "2>${a3:-&-}" || fail_ "$* failed with code $rc" set -- "$STRACE" -o"$LOG" -echdir "$@" eval "$@" "<${a1:-&-}" ">${a2:-&-}" "2>${a3:-&-}" || dump_log_and_fail_with "$* failed with code $?" - - rm -f "$LOG" "$fd0" "$fd1" "$fd2" } check_fd "$fd0" "$fd1" "$fd2" diff --git a/tests-mx32/redirect.test b/tests-mx32/redirect.test index fa0c5369..ebf91bec 100755 --- a/tests-mx32/redirect.test +++ b/tests-mx32/redirect.test @@ -3,29 +3,10 @@ # Ensure that strace does not retain stdin and stdout descriptors. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -74,5 +55,3 @@ $STRACE -qq -enone -esignal=none \ if [ -s "$OUT" ]; then fail_ "$STRACE failed to redirect standard output" fi - -rm -f -- "$OUT" diff --git a/tests-mx32/regex.gen.test b/tests-mx32/regex.gen.test new file mode 100755 index 00000000..71a02d67 --- /dev/null +++ b/tests-mx32/regex.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (regex test_trace_expr '' -etrace='/^(.*_)?statv?fs'); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -etrace='/^(.*_)?statv?fs' diff --git a/tests-mx32/regex.in b/tests-mx32/regex.in new file mode 100755 index 00000000..7c4adfe1 --- /dev/null +++ b/tests-mx32/regex.in @@ -0,0 +1,2 @@ +statfs -a17 +statfs64 -a23 diff --git a/tests-mx32/remap_file_pages-Xabbrev.c b/tests-mx32/remap_file_pages-Xabbrev.c new file mode 100644 index 00000000..d808f423 --- /dev/null +++ b/tests-mx32/remap_file_pages-Xabbrev.c @@ -0,0 +1 @@ +#include "remap_file_pages.c" diff --git a/tests-mx32/remap_file_pages-Xabbrev.gen.test b/tests-mx32/remap_file_pages-Xabbrev.gen.test new file mode 100755 index 00000000..76c45daa --- /dev/null +++ b/tests-mx32/remap_file_pages-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (remap_file_pages-Xabbrev -Xabbrev -e trace=remap_file_pages); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xabbrev -e trace=remap_file_pages diff --git a/tests-mx32/remap_file_pages-Xraw.c b/tests-mx32/remap_file_pages-Xraw.c new file mode 100644 index 00000000..f01d20af --- /dev/null +++ b/tests-mx32/remap_file_pages-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "remap_file_pages.c" diff --git a/tests-mx32/remap_file_pages-Xraw.gen.test b/tests-mx32/remap_file_pages-Xraw.gen.test new file mode 100755 index 00000000..2e022399 --- /dev/null +++ b/tests-mx32/remap_file_pages-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (remap_file_pages-Xraw -Xraw -e trace=remap_file_pages); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xraw -e trace=remap_file_pages diff --git a/tests-mx32/remap_file_pages-Xverbose.c b/tests-mx32/remap_file_pages-Xverbose.c new file mode 100644 index 00000000..51e0e34e --- /dev/null +++ b/tests-mx32/remap_file_pages-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "remap_file_pages.c" diff --git a/tests-mx32/remap_file_pages-Xverbose.gen.test b/tests-mx32/remap_file_pages-Xverbose.gen.test new file mode 100755 index 00000000..eb1e0f65 --- /dev/null +++ b/tests-mx32/remap_file_pages-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (remap_file_pages-Xverbose -Xverbose -e trace=remap_file_pages); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xverbose -e trace=remap_file_pages diff --git a/tests-mx32/remap_file_pages.c b/tests-mx32/remap_file_pages.c index 452d2de7..2a2bfc6e 100644 --- a/tests-mx32/remap_file_pages.c +++ b/tests-mx32/remap_file_pages.c @@ -1,54 +1,111 @@ /* * Check decoding of remap_file_pages syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2017 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include +#include "scno.h" #ifdef __NR_remap_file_pages # include -# include +# include # include +# include + +static const char *errstr; + +static long +k_remap_file_pages(const kernel_ulong_t addr, + const kernel_ulong_t size, + const kernel_ulong_t prot, + const kernel_ulong_t pgoff, + const kernel_ulong_t flags) +{ + const long rc = syscall(__NR_remap_file_pages, + addr, size, prot, pgoff, flags); + errstr = sprintrc(rc); + return rc; +} int main(void) { - const unsigned long addr = (unsigned long) 0xfacefeeddeadbeefULL; - const unsigned long size = (unsigned long) 0xdefaced1bad2f00dULL; - const unsigned long prot = PROT_READ|PROT_WRITE|PROT_EXEC; - const unsigned long pgoff = (unsigned long) 0xcaf3babebad4deedULL; - const unsigned long flags = MAP_PRIVATE|MAP_ANONYMOUS; - - long rc = syscall(__NR_remap_file_pages, addr, size, prot, pgoff, flags); - printf("remap_file_pages(%#lx, %lu, %s, %lu, %s) = %ld %s (%m)\n", - addr, size, "PROT_READ|PROT_WRITE|PROT_EXEC", pgoff, - "MAP_PRIVATE|MAP_ANONYMOUS", rc, errno2name()); + kernel_ulong_t addr = (kernel_ulong_t) 0xfacefeeddeadbeefULL; + kernel_ulong_t size = (kernel_ulong_t) 0xdefaced1bad2f00dULL; + kernel_ulong_t prot = PROT_READ|PROT_WRITE|PROT_EXEC; + kernel_ulong_t pgoff = (kernel_ulong_t) 0xcaf3babebad4deedULL; + kernel_ulong_t flags = MAP_PRIVATE|MAP_ANONYMOUS; +# define prot1_str "PROT_READ|PROT_WRITE|PROT_EXEC" +# define flags1_str "MAP_PRIVATE|MAP_ANONYMOUS" + + k_remap_file_pages(addr, size, prot, pgoff, flags); +# if XLAT_RAW + printf("remap_file_pages(%#jx, %ju, %#jx, %ju, %#jx) = %s\n", + (uintmax_t) addr, (uintmax_t) size, (uintmax_t) prot, + (uintmax_t) pgoff, (uintmax_t) flags, errstr); +# elif XLAT_VERBOSE + printf("remap_file_pages(%#jx, %ju, %#jx /* %s */, %ju, %#jx /* %s */)" + " = %s\n", + (uintmax_t) addr, (uintmax_t) size, (uintmax_t) prot, prot1_str, + (uintmax_t) pgoff, (uintmax_t) flags, + flags1_str, errstr); +# else /* XLAT_ABBREV */ + printf("remap_file_pages(%#jx, %ju, %s, %ju, %s) = %s\n", + (uintmax_t) addr, (uintmax_t) size, prot1_str, + (uintmax_t) pgoff, flags1_str, errstr); +# endif + +# ifdef MAP_HUGETLB +# ifndef MAP_HUGE_2MB +# ifndef MAP_HUGE_SHIFT +# define MAP_HUGE_SHIFT 26 +# endif +# define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT) +# endif /* !MAP_HUGE_2MB */ + addr = (kernel_ulong_t) 0xfacefeeddeadf00dULL; + size = (kernel_ulong_t) 0xdefaced1bad2beefULL; + prot = (kernel_ulong_t) 0xdefaced00000000ULL | PROT_NONE; + flags = MAP_TYPE | MAP_FIXED | MAP_NORESERVE | MAP_HUGETLB | MAP_HUGE_2MB; + + k_remap_file_pages(addr, size, prot, pgoff, flags); + +/* + * HP PA-RISC is the only architecture that has MAP_TYPE defined to 0x3, which + * is also used for MAP_SHARED_VALIDATE since Linux commit v4.15-rc1~71^2^2~23. + */ +# ifdef __hppa__ +# define MAP_TYPE_str "MAP_SHARED_VALIDATE" +# else +# define MAP_TYPE_str "0xf /* MAP_??? */" +# endif +# define flags2_str \ + MAP_TYPE_str "|MAP_FIXED|MAP_NORESERVE|MAP_HUGETLB|21< diff --git a/tests-mx32/rename.gen.test b/tests-mx32/rename.gen.test new file mode 100755 index 00000000..81fb0398 --- /dev/null +++ b/tests-mx32/rename.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rename -a35 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests-mx32/rename.test b/tests-mx32/rename.test deleted file mode 100755 index 9067e4cc..00000000 --- a/tests-mx32/rename.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check rename syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a35 diff --git a/tests-mx32/renameat.c b/tests-mx32/renameat.c index 2b874efa..7f11893f 100644 --- a/tests-mx32/renameat.c +++ b/tests-mx32/renameat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/renameat.gen.test b/tests-mx32/renameat.gen.test new file mode 100755 index 00000000..dbc6e05b --- /dev/null +++ b/tests-mx32/renameat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (renameat ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/renameat.test b/tests-mx32/renameat.test deleted file mode 100755 index 9b0a61dd..00000000 --- a/tests-mx32/renameat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check renameat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/renameat2.c b/tests-mx32/renameat2.c index 33f88988..663c0638 100644 --- a/tests-mx32/renameat2.c +++ b/tests-mx32/renameat2.c @@ -1,30 +1,10 @@ /* * Check decoding of renameat2 syscall. * - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/renameat2.gen.test b/tests-mx32/renameat2.gen.test new file mode 100755 index 00000000..78251cb2 --- /dev/null +++ b/tests-mx32/renameat2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (renameat2 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/renameat2.test b/tests-mx32/renameat2.test deleted file mode 100755 index 4c176bbd..00000000 --- a/tests-mx32/renameat2.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check renameat2 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/request_key.c b/tests-mx32/request_key.c index fea977b2..20ae12f6 100644 --- a/tests-mx32/request_key.c +++ b/tests-mx32/request_key.c @@ -2,29 +2,10 @@ * Check decoding of request_key syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -69,8 +50,7 @@ main(void) { static const char unterminated1[] = { '\1', '\2', '\3', '\4', '\5' }; static const char unterminated2[] = { '\6', '\7', '\10', '\11', '\12' }; - static const char unterminated3[] = - { '\16', '\17', '\20', '\21', '\22' }; + static const char unterminated3[] = { '\16', '\17', '\20', '\21', '\22' }; char *bogus_type = tail_memdup(unterminated1, sizeof(unterminated1)); char *bogus_desc = tail_memdup(unterminated2, sizeof(unterminated2)); @@ -101,7 +81,7 @@ main(void) { bogus_desc, NULL }, { ARG_STR("\25\26\27\30\31") }, { ARG_STR("desc") }, - { "overly long description", _STR("overly long ") "..." }, + { "overly long description", STRINGIFY("overly long ") "..." }, }; struct { @@ -113,7 +93,7 @@ main(void) { bogus_info, NULL }, { ARG_STR("\32\33\34\35\36") }, { ARG_STR("info") }, - { "overly long info", _STR("overly long ") "..." }, + { "overly long info", STRINGIFY("overly long ") "..." }, }; struct { diff --git a/tests-mx32/request_key.gen.test b/tests-mx32/request_key.gen.test new file mode 100755 index 00000000..aeac708f --- /dev/null +++ b/tests-mx32/request_key.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (request_key -a33 -s12); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -s12 diff --git a/tests-mx32/request_key.test b/tests-mx32/request_key.test deleted file mode 100755 index 9812a18e..00000000 --- a/tests-mx32/request_key.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of request_key syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a33 -s12 diff --git a/tests-mx32/restart_syscall.c b/tests-mx32/restart_syscall.c index e492e62e..9a8f7e3a 100644 --- a/tests-mx32/restart_syscall.c +++ b/tests-mx32/restart_syscall.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -55,23 +36,24 @@ main(void) if (nanosleep(&req, &rem)) perror_msg_and_fail("nanosleep"); - printf("nanosleep\\(\\{tv_sec=%jd, tv_nsec=%jd\\}, " - "\\{tv_sec=%jd, tv_nsec=%jd\\}\\)" + printf("nanosleep\\(\\{tv_sec=%lld, tv_nsec=%llu\\}" + ", \\{tv_sec=%lld, tv_nsec=%llu\\}\\)" " = \\? ERESTART_RESTARTBLOCK \\(Interrupted by signal\\)\n", - (intmax_t) req.tv_sec, (intmax_t) req.tv_nsec, - (intmax_t) rem.tv_sec, (intmax_t) rem.tv_nsec); + (long long) req.tv_sec, zero_extend_signed_to_ull(req.tv_nsec), + (long long) rem.tv_sec, zero_extend_signed_to_ull(rem.tv_nsec)); puts("--- SIGALRM \\{si_signo=SIGALRM, si_code=SI_KERNEL\\} ---"); -#ifdef __arm__ +# 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\\{tv_sec=%jd, tv_nsec=%jd\\}), " - "%p|restart_syscall\\(<\\.\\.\\." +# define ALTERNATIVE_NANOSLEEP_REQ "0xfffffffc|" +# else +# define ALTERNATIVE_NANOSLEEP_REQ "" +# endif + printf("(nanosleep\\((%s\\{tv_sec=%lld, tv_nsec=%llu\\})" + ", %p|restart_syscall\\(<\\.\\.\\." " resuming interrupted nanosleep \\.\\.\\.>)\\) = 0\n", ALTERNATIVE_NANOSLEEP_REQ, - (intmax_t) req.tv_sec, (intmax_t) req.tv_nsec, &rem); + (long long) req.tv_sec, zero_extend_signed_to_ull(req.tv_nsec), + &rem); puts("\\+\\+\\+ exited with 0 \\+\\+\\+"); return 0; diff --git a/tests-mx32/restart_syscall.test b/tests-mx32/restart_syscall.test index 6dfda168..8dde6684 100755 --- a/tests-mx32/restart_syscall.test +++ b/tests-mx32/restart_syscall.test @@ -1,13 +1,15 @@ #!/bin/sh - +# # Check how "resuming interrupted nanosleep" works. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog > /dev/null syscalls=nanosleep,restart_syscall -run_strace -a20 -e trace=$syscalls $args > "$OUT" -match_grep "$LOG" "$OUT" -rm -f "$OUT" - -exit 0 +run_strace -a20 -e trace=$syscalls $args > "$EXP" +match_grep "$LOG" "$EXP" diff --git a/tests-mx32/riscv_flush_icache.c b/tests-mx32/riscv_flush_icache.c new file mode 100644 index 00000000..27abf75b --- /dev/null +++ b/tests-mx32/riscv_flush_icache.c @@ -0,0 +1,73 @@ +/* + * Check decoding of riscv_flush_icache syscall. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include + +#include "scno.h" + +#ifdef __NR_riscv_flush_icache + +# include +# include +# include + +int main(void) +{ + static struct { + kernel_ulong_t addr; + const char *str; + } addrs[] = { + { (kernel_ulong_t) (uintptr_t) ARG_STR(NULL) }, + { (kernel_ulong_t) 0xbadc0deddeadf157ULL, + sizeof(kernel_ulong_t) == 8 ? "0xbadc0deddeadf157" : + "0xdeadf157" }, + }; + static struct { + kernel_ulong_t val; + const char *str; + } flags[] = { + { ARG_STR(0) }, + { 1, "SYS_RISCV_FLUSH_ICACHE_LOCAL" }, + { (kernel_ulong_t) 0xfacefeedfffffffeULL, + sizeof(kernel_ulong_t) == 8 ? + "0xfacefeedfffffffe /* SYS_RISCV_FLUSH_ICACHE_??? */" : + "0xfffffffe /* SYS_RISCV_FLUSH_ICACHE_??? */" }, + { (kernel_ulong_t) 0xfacefeedffffffffULL, + sizeof(kernel_ulong_t) == 8 ? + "SYS_RISCV_FLUSH_ICACHE_LOCAL|0xfacefeedfffffffe" : + "SYS_RISCV_FLUSH_ICACHE_LOCAL|0xfffffffe" }, + }; + + for (size_t i = 0; i < ARRAY_SIZE(addrs); i++) { + for (size_t j = 0; j < ARRAY_SIZE(addrs); j++) { + for (size_t k = 0; k < ARRAY_SIZE(flags); k++) { + long rc = syscall(__NR_riscv_flush_icache, + addrs[i].addr, + addrs[j].addr, + flags[k].val); + + printf("riscv_flush_icache(%s, %s, %s) = %s\n", + addrs[i].str, addrs[j].str, flags[k].str, + sprintrc(rc)); + } + } + } + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_riscv_flush_icache"); + +#endif diff --git a/tests-mx32/riscv_flush_icache.gen.test b/tests-mx32/riscv_flush_icache.gen.test new file mode 100755 index 00000000..1a1f793a --- /dev/null +++ b/tests-mx32/riscv_flush_icache.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (riscv_flush_icache -a34 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a34 diff --git a/tests-mx32/rmdir.c b/tests-mx32/rmdir.c index 20952d84..505303ad 100644 --- a/tests-mx32/rmdir.c +++ b/tests-mx32/rmdir.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/rmdir.gen.test b/tests-mx32/rmdir.gen.test new file mode 100755 index 00000000..8b346af9 --- /dev/null +++ b/tests-mx32/rmdir.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rmdir -a22 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests-mx32/rmdir.test b/tests-mx32/rmdir.test deleted file mode 100755 index 81ee66b8..00000000 --- a/tests-mx32/rmdir.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check rmdir syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a22 diff --git a/tests-mx32/rt_sigaction.awk b/tests-mx32/rt_sigaction.awk new file mode 100644 index 00000000..81dd8130 --- /dev/null +++ b/tests-mx32/rt_sigaction.awk @@ -0,0 +1,76 @@ +#!/bin/gawk +# +# Copyright (c) 2014-2015 Dmitry V. Levin +# Copyright (c) 2016 Elvira Khabirova +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +BEGIN { + n1[1][1] = n2[1][1] = "SIG_IGN" + n1[1][2] = n2[1][2] = "\\[HUP INT\\]" + n1[1][3] = "SA_RESTORER\\|SA_RESTART" + n2[1][3] = "SA_RESTART" + n1[1][4] = ", sa_restorer=0x[0-9a-f]+" + n2[1][4] = "" + + n1[2][1] = n2[2][1] = "0x[0-9a-f]+" + n1[2][2] = n2[2][2] = "\\[QUIT TERM\\]" + n1[2][3] = "SA_RESTORER\\|SA_SIGINFO" + n2[2][3] = "SA_SIGINFO" + n1[2][4] = ", sa_restorer=0x[0-9a-f]+" + n2[2][4] = "" + + n1[3][1] = n2[3][1] = "SIG_DFL" + n1[3][2] = n2[3][2] = "\\[\\]" + n1[3][3] = "SA_RESTORER" + n2[3][3] = "0" + n1[3][4] = ", sa_restorer=0x[0-9a-f]+" + n2[3][4] = "" + + n1[4][1] = n2[4][1] = "SIG_DFL" + n1[4][2] = n2[4][2] = "~\\[HUP( ((RT|SIGRT)[^] ]+|[3-9][0-9]|1[0-9][0-9]))*\\]" + n1[4][3] = "SA_RESTORER" + n2[4][3] = "0" + n1[4][4] = ", sa_restorer=0x[0-9a-f]+" + n2[4][4] = "" + + o1[1][1] = o2[1][1] = "SIG_DFL" + o1[1][2] = o2[1][2] = "\\[\\]" + o1[1][3] = o2[1][3] = "0" + o1[1][4] = o2[1][4] = "" + + for (i = 2; i < 5; i++) { + for (j = 1; j < 5; j++) { + o1[i][j] = n1[i - 1][j] + o2[i][j] = n2[i - 1][j] + } + } + + a1 = "(0x[0-9a-f]+, )?(4|8|16)" + a2 = "(4|8|16)(, 0x[0-9a-f]+)?" + a3 = "0x[0-9a-f]+, (4|8|16)" + + for (i = 1; i < 5; i++) { + r[i] = "^rt_sigaction\\(SIGUSR2, (" \ + "\\{sa_handler=" n1[i][1] ", sa_mask=" n1[i][2] \ + ", sa_flags=" n1[i][3] n1[i][4] "\\}, \\{sa_handler=" \ + o1[i][1] ", sa_mask=" o1[i][2] ", sa_flags=" o1[i][3] \ + o1[i][4] "\\}, " a1 "|" \ + "\\{sa_handler=" n2[i][1] ", sa_mask=" n2[i][2] \ + ", sa_flags=" n2[i][3] n2[i][4] "\\}, \\{sa_handler=" \ + o2[i][1] ", sa_mask=" o2[i][2] ", sa_flags=" o2[i][3] \ + o2[i][4] "\\}, " a2 "|" \ + "\\{sa_handler=" n2[i][1] ", sa_mask=" n2[i][2] \ + ", sa_flags=" n2[i][3] n2[i][4] "\\}, \\{sa_handler=" \ + o2[i][1] ", sa_mask=" o2[i][2] ", sa_flags=" o2[i][3] \ + o2[i][4] "\\}, " a3 ")\\) = 0$" + } + s[5] = "+++ exited with 0 +++" + + lines = 5 + fail = 0 +} + +@include "match.awk" diff --git a/tests-mx32/rt_sigaction.c b/tests-mx32/rt_sigaction.c new file mode 100644 index 00000000..852b417b --- /dev/null +++ b/tests-mx32/rt_sigaction.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2014-2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include +#include +#include +#include + +static void handle_signal(int no) +{ + _exit(128 + no); +} + +int +main(void) +{ + struct sigaction sa, sa0; + + sa.sa_handler = SIG_IGN; + sigemptyset(&sa.sa_mask); + sigaddset(&sa.sa_mask, SIGHUP); + sigaddset(&sa.sa_mask, SIGINT); + sa.sa_flags = SA_RESTART; + assert(!sigaction(SIGUSR2, &sa, &sa0)); + + sa.sa_handler = handle_signal; + sigemptyset(&sa.sa_mask); + sigaddset(&sa.sa_mask, SIGQUIT); + sigaddset(&sa.sa_mask, SIGTERM); + sa.sa_flags = SA_SIGINFO; + assert(!sigaction(SIGUSR2, &sa, &sa0)); + + sa.sa_handler = SIG_DFL; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + assert(!sigaction(SIGUSR2, &sa, &sa0)); + + sigfillset(&sa.sa_mask); + sigdelset(&sa.sa_mask, SIGHUP); + assert(!sigaction(SIGUSR2, &sa, &sa0)); + + return 0; +} diff --git a/tests-mx32/rt_sigaction.test b/tests-mx32/rt_sigaction.test new file mode 100755 index 00000000..afbbb540 --- /dev/null +++ b/tests-mx32/rt_sigaction.test @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Check rt_sigaction decoding. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -ert_sigaction $args +match_awk + +exit 0 diff --git a/tests-mx32/rt_sigpending.c b/tests-mx32/rt_sigpending.c index accf6913..06b15db2 100644 --- a/tests-mx32/rt_sigpending.c +++ b/tests-mx32/rt_sigpending.c @@ -2,29 +2,10 @@ * This file is part of rt_sigpending strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -54,12 +35,12 @@ iterate(const char *const text, unsigned int size, void *set) break; } if (size) { -#if WORDS_BIGENDIAN +# if WORDS_BIGENDIAN if (size < sizeof(long)) tprintf("rt_sigpending(%s, %u) = 0\n", "[]", size); else -#endif +# endif tprintf("rt_sigpending(%s, %u) = 0\n", text, size); } else { @@ -78,7 +59,7 @@ main(void) const unsigned int big_size = 1024 / 8; void *k_set = tail_alloc(big_size); - sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(sigset_t, libc_set); sigemptyset(libc_set); if (sigprocmask(SIG_SETMASK, libc_set, NULL)) diff --git a/tests-mx32/rt_sigpending.gen.test b/tests-mx32/rt_sigpending.gen.test new file mode 100755 index 00000000..d52858af --- /dev/null +++ b/tests-mx32/rt_sigpending.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rt_sigpending -a20 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-mx32/rt_sigpending.test b/tests-mx32/rt_sigpending.test deleted file mode 100755 index 40c83a81..00000000 --- a/tests-mx32/rt_sigpending.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check rt_sigpending syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 diff --git a/tests-mx32/rt_sigprocmask.c b/tests-mx32/rt_sigprocmask.c index 27e357fa..e6f513da 100644 --- a/tests-mx32/rt_sigprocmask.c +++ b/tests-mx32/rt_sigprocmask.c @@ -2,29 +2,10 @@ * This file is part of rt_sigprocmask strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -91,7 +72,7 @@ main(void) void *const k_set = tail_alloc(set_size); void *const old_set = tail_alloc(set_size); - sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(sigset_t, libc_set); memset(k_set, 0, set_size); if (k_sigprocmask(SIG_SETMASK, k_set, NULL, set_size)) diff --git a/tests-mx32/rt_sigprocmask.gen.test b/tests-mx32/rt_sigprocmask.gen.test new file mode 100755 index 00000000..67fcdc0f --- /dev/null +++ b/tests-mx32/rt_sigprocmask.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rt_sigprocmask ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/rt_sigprocmask.test b/tests-mx32/rt_sigprocmask.test deleted file mode 100755 index 1e60ebde..00000000 --- a/tests-mx32/rt_sigprocmask.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check rt_sigprocmask syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/rt_sigqueueinfo.c b/tests-mx32/rt_sigqueueinfo.c index aba6776c..0455dd40 100644 --- a/tests-mx32/rt_sigqueueinfo.c +++ b/tests-mx32/rt_sigqueueinfo.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015 Elvira Khabirova + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,7 +13,7 @@ #include int -main (void) +main(void) { struct sigaction sa = { .sa_handler = SIG_IGN diff --git a/tests-mx32/rt_sigqueueinfo.gen.test b/tests-mx32/rt_sigqueueinfo.gen.test new file mode 100755 index 00000000..d11eecc0 --- /dev/null +++ b/tests-mx32/rt_sigqueueinfo.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rt_sigqueueinfo -esignal=none ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests-mx32/rt_sigqueueinfo.test b/tests-mx32/rt_sigqueueinfo.test deleted file mode 100755 index c03c76f2..00000000 --- a/tests-mx32/rt_sigqueueinfo.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of rt_sigqueueinfo syscall - -. "${srcdir=.}/init.sh" -run_strace_match_diff -esignal=none diff --git a/tests-mx32/rt_sigreturn.c b/tests-mx32/rt_sigreturn.c new file mode 100644 index 00000000..4a45b5d5 --- /dev/null +++ b/tests-mx32/rt_sigreturn.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +#ifdef ASM_SIGRTMIN +# define RT_0 ASM_SIGRTMIN +#else +/* Linux kernel >= 3.18 defines SIGRTMIN to 32 on all architectures. */ +# define RT_0 32 +#endif + +static void +handler(int no, siginfo_t *si, void *uc) +{ +} + +int +main(void) +{ + static sigset_t set; + sigemptyset(&set); + sigaddset(&set, SIGINT); + sigaddset(&set, SIGUSR2); + sigaddset(&set, SIGCHLD); + sigaddset(&set, RT_0 + 3); + sigaddset(&set, RT_0 + 4); + sigaddset(&set, RT_0 + 5); + sigaddset(&set, RT_0 + 26); + sigaddset(&set, RT_0 + 27); + if (sigprocmask(SIG_SETMASK, &set, NULL)) + perror_msg_and_fail("sigprocmask"); + sigemptyset(&set); + + static const struct sigaction sa = { + .sa_sigaction = handler, + .sa_flags = SA_SIGINFO + }; + if (sigaction(SIGUSR1, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + if (raise(SIGUSR1)) + perror_msg_and_fail("raise"); + + static const char *const sigs = + (SIGUSR2 < SIGCHLD) ? "INT USR2 CHLD" : "INT CHLD USR2"; + static const char *const rt_sigs = "RT_3 RT_4 RT_5 RT_26 RT_27"; + printf("rt_sigreturn({mask=[%s %s]}) = 0\n", sigs, rt_sigs); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/rt_sigreturn.gen.test b/tests-mx32/rt_sigreturn.gen.test new file mode 100755 index 00000000..d8b153e3 --- /dev/null +++ b/tests-mx32/rt_sigreturn.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rt_sigreturn -esignal='!USR1' ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal='!USR1' diff --git a/tests-mx32/rt_sigsuspend.c b/tests-mx32/rt_sigsuspend.c index 73e13364..55ae6239 100644 --- a/tests-mx32/rt_sigsuspend.c +++ b/tests-mx32/rt_sigsuspend.c @@ -2,29 +2,10 @@ * This file is part of rt_sigsuspend strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -88,7 +69,7 @@ main(void) void *k_set = tail_alloc(big_size); memset(k_set, 0, big_size); - sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(sigset_t, libc_set); sigemptyset(libc_set); sigaddset(libc_set, SIGUSR1); if (sigprocmask(SIG_SETMASK, libc_set, NULL)) diff --git a/tests-mx32/rt_sigsuspend.gen.test b/tests-mx32/rt_sigsuspend.gen.test new file mode 100755 index 00000000..d5d1d5f3 --- /dev/null +++ b/tests-mx32/rt_sigsuspend.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rt_sigsuspend -a20 -esignal=none); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -esignal=none diff --git a/tests-mx32/rt_sigsuspend.test b/tests-mx32/rt_sigsuspend.test deleted file mode 100755 index 2e30fd4b..00000000 --- a/tests-mx32/rt_sigsuspend.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check rt_sigsuspend syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 -esignal=none diff --git a/tests-mx32/rt_sigtimedwait.c b/tests-mx32/rt_sigtimedwait.c index 10311e6e..56144f52 100644 --- a/tests-mx32/rt_sigtimedwait.c +++ b/tests-mx32/rt_sigtimedwait.c @@ -2,29 +2,10 @@ * This file is part of rt_sigtimedwait strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -54,25 +35,27 @@ iterate(const char *const text, const void *set, for (;;) { assert(k_sigtimedwait(set, NULL, timeout, size) == -1); if (EINTR == errno) { - tprintf("rt_sigtimedwait(%s, NULL, " - "{tv_sec=%jd, tv_nsec=%jd}, %u)" + tprintf("rt_sigtimedwait(%s, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}, %u)" " = -1 EAGAIN (%m)\n", text, - (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, + (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), size); } else { if (size < sizeof(long)) - tprintf("rt_sigtimedwait(%p, NULL, " - "{tv_sec=%jd, tv_nsec=%jd}" + tprintf("rt_sigtimedwait(%p, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}" ", %u) = -1 EINVAL (%m)\n", - set, (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, size); + set, (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), + size); else - tprintf("rt_sigtimedwait(%s, NULL, " - "{tv_sec=%jd, tv_nsec=%jd}" + tprintf("rt_sigtimedwait(%s, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}" ", %u) = -1 EINVAL (%m)\n", - text, (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, size); + text, (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), + size); } if (!size) break; @@ -86,8 +69,8 @@ main(void) { tprintf("%s", ""); - siginfo_t *const info = tail_alloc(sizeof(*info)); - struct timespec *const timeout = tail_alloc(sizeof(*timeout)); + TAIL_ALLOC_OBJECT_CONST_PTR(siginfo_t, info); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, timeout); timeout->tv_sec = 0; timeout->tv_nsec = 42; @@ -100,37 +83,58 @@ main(void) assert(k_sigtimedwait(k_set, NULL, timeout, set_size) == -1); if (EAGAIN == errno) break; - tprintf("rt_sigtimedwait(%p, NULL, {tv_sec=%jd, tv_nsec=%jd}, %u)" - " = -1 EINVAL (%m)\n", - k_set, (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, set_size); + tprintf("rt_sigtimedwait(%p, NULL, {tv_sec=%lld, tv_nsec=%llu}" + ", %u) = -1 EINVAL (%m)\n", + k_set, (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); } if (!set_size) perror_msg_and_fail("rt_sigtimedwait"); - tprintf("rt_sigtimedwait([], NULL, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", - (intmax_t) timeout->tv_sec, (intmax_t) timeout->tv_nsec, - set_size); + tprintf("rt_sigtimedwait([], NULL, {tv_sec=%lld, tv_nsec=%llu}, %u)" + " = -1 EAGAIN (%m)\n", + (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); + + timeout->tv_sec = 0xdeadbeefU; + timeout->tv_nsec = 0xfacefeedU; + assert(k_sigtimedwait(k_set, NULL, timeout, set_size) == -1); + tprintf("rt_sigtimedwait([], NULL, {tv_sec=%lld, tv_nsec=%llu}" + ", %u) = -1 EINVAL (%m)\n", + (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); + + timeout->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + timeout->tv_nsec = (long) 0xbadc0dedfacefeedLL; + assert(k_sigtimedwait(k_set, NULL, timeout, set_size) == -1); + tprintf("rt_sigtimedwait([], NULL, {tv_sec=%lld, tv_nsec=%llu}" + ", %u) = -1 EINVAL (%m)\n", + (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); + + timeout->tv_sec = 0; + timeout->tv_nsec = 42; - sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(sigset_t, libc_set); sigemptyset(libc_set); sigaddset(libc_set, SIGHUP); memcpy(k_set, libc_set, set_size); assert(k_sigtimedwait(k_set, info, timeout, set_size) == -1); assert(EAGAIN == errno); - tprintf("rt_sigtimedwait([HUP], %p, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", - info, (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, set_size); + tprintf("rt_sigtimedwait([HUP], %p, {tv_sec=%lld, tv_nsec=%llu}, %u)" + " = -1 EAGAIN (%m)\n", + info, (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); sigaddset(libc_set, SIGINT); memcpy(k_set, libc_set, set_size); assert(k_sigtimedwait(k_set, info, timeout, set_size) == -1); assert(EAGAIN == errno); - tprintf("rt_sigtimedwait([HUP INT], %p, {tv_sec=%jd, tv_nsec=%jd}, %u)" + tprintf("rt_sigtimedwait([HUP INT], %p, {tv_sec=%lld, tv_nsec=%llu}, %u)" " = -1 EAGAIN (%m)\n", - info, (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, set_size); + info, (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); sigaddset(libc_set, SIGQUIT); sigaddset(libc_set, SIGALRM); @@ -139,17 +143,19 @@ main(void) assert(k_sigtimedwait(k_set, info, timeout, set_size) == -1); assert(EAGAIN == errno); - tprintf("rt_sigtimedwait(%s, %p, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", + tprintf("rt_sigtimedwait(%s, %p, {tv_sec=%lld, tv_nsec=%llu}, %u)" + " = -1 EAGAIN (%m)\n", "[HUP INT QUIT ALRM TERM]", - info, (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, set_size); + info, (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); memset(k_set - set_size, -1, set_size); assert(k_sigtimedwait(k_set - set_size, info, timeout, set_size) == -1); assert(EAGAIN == errno); - tprintf("rt_sigtimedwait(~[], %p, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", - info, (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, set_size); + tprintf("rt_sigtimedwait(~[], %p, {tv_sec=%lld, tv_nsec=%llu}, %u)" + " = -1 EAGAIN (%m)\n", + info, (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); if (sigprocmask(SIG_SETMASK, libc_set, NULL)) perror_msg_and_fail("sigprocmask"); @@ -164,9 +170,11 @@ main(void) raise(SIGALRM); assert(k_sigtimedwait(k_set, info, timeout, set_size) == SIGALRM); tprintf("rt_sigtimedwait(%s, {si_signo=%s, si_code=SI_TKILL" - ", si_pid=%d, si_uid=%d}, {tv_sec=%jd, tv_nsec=%jd}, %u) = %d (%s)\n", + ", si_pid=%d, si_uid=%d}, {tv_sec=%lld, tv_nsec=%llu}, %u)" + " = %d (%s)\n", "[HUP INT QUIT ALRM TERM]", "SIGALRM", getpid(), getuid(), - (intmax_t) timeout->tv_sec, (intmax_t) timeout->tv_nsec, + (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size, SIGALRM, "SIGALRM"); raise(SIGALRM); diff --git a/tests-mx32/rt_sigtimedwait.gen.test b/tests-mx32/rt_sigtimedwait.gen.test new file mode 100755 index 00000000..a9409ae9 --- /dev/null +++ b/tests-mx32/rt_sigtimedwait.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rt_sigtimedwait -a38 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a38 diff --git a/tests-mx32/rt_sigtimedwait.test b/tests-mx32/rt_sigtimedwait.test deleted file mode 100755 index e15fb779..00000000 --- a/tests-mx32/rt_sigtimedwait.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check rt_sigtimedwait syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a38 diff --git a/tests-mx32/rt_tgsigqueueinfo.c b/tests-mx32/rt_tgsigqueueinfo.c index ec093481..e3ad0e22 100644 --- a/tests-mx32/rt_tgsigqueueinfo.c +++ b/tests-mx32/rt_tgsigqueueinfo.c @@ -2,29 +2,10 @@ * This file is part of rt_tgsigqueueinfo strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -42,14 +23,14 @@ static long k_tgsigqueueinfo(const pid_t pid, const int sig, const void *const info) { return syscall(__NR_rt_tgsigqueueinfo, - (unsigned long) 0xffffffff00000000ULL | pid, - (unsigned long) 0xffffffff00000000ULL | pid, - (unsigned long) 0xffffffff00000000ULL | sig, + F8ILL_KULONG_MASK | pid, + F8ILL_KULONG_MASK | pid, + F8ILL_KULONG_MASK | sig, info); } int -main (void) +main(void) { const struct sigaction sa = { .sa_handler = SIG_IGN @@ -57,14 +38,15 @@ main (void) if (sigaction(SIGUSR1, &sa, NULL)) perror_msg_and_fail("sigaction"); - siginfo_t *const info = tail_alloc(sizeof(*info)); + TAIL_ALLOC_OBJECT_CONST_PTR(siginfo_t, info); memset(info, 0, sizeof(*info)); info->si_signo = SIGUSR1; info->si_errno = ENOENT; info->si_code = SI_QUEUE; info->si_pid = getpid(); info->si_uid = getuid(); - info->si_value.sival_ptr = (void *) (unsigned long) 0xdeadbeeffacefeedULL; + info->si_value.sival_ptr = + (void *) (unsigned long) 0xdeadbeeffacefeedULL; if (k_tgsigqueueinfo(info->si_pid, SIGUSR1, info)) (errno == ENOSYS ? perror_msg_and_skip : perror_msg_and_fail)( diff --git a/tests-mx32/rt_tgsigqueueinfo.gen.test b/tests-mx32/rt_tgsigqueueinfo.gen.test new file mode 100755 index 00000000..0539e35a --- /dev/null +++ b/tests-mx32/rt_tgsigqueueinfo.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rt_tgsigqueueinfo -esignal=none ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests-mx32/rt_tgsigqueueinfo.test b/tests-mx32/rt_tgsigqueueinfo.test deleted file mode 100755 index ab24e2d6..00000000 --- a/tests-mx32/rt_tgsigqueueinfo.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of rt_tgsigqueueinfo syscall - -. "${srcdir=.}/init.sh" -run_strace_match_diff -esignal=none diff --git a/tests-mx32/run.sh b/tests-mx32/run.sh index 02d99123..1a0aa7e5 100755 --- a/tests-mx32/run.sh +++ b/tests-mx32/run.sh @@ -1,12 +1,22 @@ #!/bin/sh +# +# Copyright (c) 2013-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" $STRACE -V > /dev/null || framework_failure_ "$STRACE is not available" -TIMEOUT="timeout -s 9 $TIMEOUT_DURATION" +TIMEOUT="timeout -k 5 -s XCPU $TIMEOUT_DURATION" $TIMEOUT true > /dev/null 2>&1 || TIMEOUT= -exec $TIMEOUT "$@" +if [ $# -eq 0 ]; then + echo 'No command or test-file specified' >&2 + exit 1 +fi + +exec $TIMEOUT "$@" < /dev/null diff --git a/tests-mx32/run_expect_termsig.c b/tests-mx32/run_expect_termsig.c new file mode 100644 index 00000000..f6b72d07 --- /dev/null +++ b/tests-mx32/run_expect_termsig.c @@ -0,0 +1,38 @@ +/* + * Execute a command, expect its termination with a specified signal. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include + +int +main(int ac, char **av) +{ + if (ac < 3) + error_msg_and_fail("usage: run_expect_termsig signo path..."); + + signal(SIGCHLD, SIG_DFL); + + pid_t pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + execvp(av[2], av + 2); + perror_msg_and_fail("execvp: %s", av[2]); + } + + int status; + if (waitpid(pid, &status, 0) != pid) + perror_msg_and_fail("waitpid"); + + return !(WIFSIGNALED(status) && WTERMSIG(status) == atoi(av[1])); +} diff --git a/tests-mx32/s390_guarded_storage-v.c b/tests-mx32/s390_guarded_storage-v.c new file mode 100644 index 00000000..05afd9fe --- /dev/null +++ b/tests-mx32/s390_guarded_storage-v.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "s390_guarded_storage.c" diff --git a/tests-mx32/s390_guarded_storage-v.gen.test b/tests-mx32/s390_guarded_storage-v.gen.test new file mode 100755 index 00000000..045ff762 --- /dev/null +++ b/tests-mx32/s390_guarded_storage-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (s390_guarded_storage-v -e trace=s390_guarded_storage -a32 -v); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=s390_guarded_storage -a32 -v diff --git a/tests-mx32/s390_guarded_storage.c b/tests-mx32/s390_guarded_storage.c new file mode 100644 index 00000000..a84c1413 --- /dev/null +++ b/tests-mx32/s390_guarded_storage.c @@ -0,0 +1,208 @@ +/* + * Check decoding of s390_guarded_storage syscall. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#if defined __NR_s390_guarded_storage && defined HAVE_ASM_GUARDED_STORAGE_H + +# include +# include +# include +# include + +# include + +# ifndef VERBOSE +# define VERBOSE 0 +# endif + +static void +gs_no_arg(kernel_ulong_t val, const char *val_str) +{ + static const kernel_ulong_t bogus_addr = + (kernel_ulong_t) 0xcaffeedadeadbed5ULL; + static const kernel_ulong_t bogus_cmd_mask = + (kernel_ulong_t) 0xbadc0ded00000000ULL; + long rc; + + rc = syscall(__NR_s390_guarded_storage, val | bogus_cmd_mask, + bogus_addr); + printf("s390_guarded_storage(%s) = %s\n", val_str, sprintrc(rc)); +} + +static void +gs_print_epl(uint64_t addr, bool valid, const char *str) +{ + if (!valid) { + if (str) + printf("%s", str); + else + printf("%#" PRIx64, addr); + + return; + } + + struct gs_epl *gsepl = (struct gs_epl *) (uintptr_t) addr; + + printf("[{"); + +# if VERBOSE + if (gsepl->pad1) + printf("pad1=%#02x, ", gsepl->pad1); + + printf("gs_eam=%#02x /* extended addressing mode: %u, " + "basic addressing mode: %u */" + ", gs_eci=%#02x /* CPU in TX: %u, CPU in CX: %u, " + "instruction: %s */" + ", gs_eai=%#02x /* DAT: %u, address space indication: %u, " + "AR number: %u */, ", + gsepl->gs_eam, gsepl->e, gsepl->b, + gsepl->gs_eci, gsepl->tx, gsepl->cx, + gsepl->in ? "LLGFGS": "LGG", + gsepl->gs_eai, gsepl->t, gsepl->as, gsepl->ar); + + if (gsepl->pad2) + printf("pad2=%#08x, ", gsepl->pad2); +# endif /* VERBOSE */ + + printf("gs_eha=%#llx, ", (unsigned long long) gsepl->gs_eha); + +# if VERBOSE + printf("gs_eia=%#llx, gs_eoa=%#llx, gs_eir=%#llx, gs_era=%#llx", + (unsigned long long) gsepl->gs_eia, + (unsigned long long) gsepl->gs_eoa, + (unsigned long long) gsepl->gs_eir, + (unsigned long long) gsepl->gs_era); +# else /* !VERBOSE */ + printf("..."); +# endif /* VERBOSE */ + + printf("}]"); +} + +static void +gs_set_cb(kernel_ulong_t addr, bool valid, bool epl_valid, + const char *bc_str, const char *epl_str) +{ + static const kernel_ulong_t bogus_cmd_mask = + (kernel_ulong_t) 0xda7a105700000000ULL; + + long rc; + + printf("s390_guarded_storage(GS_SET_BC_CB, "); + + if (valid) { + struct gs_cb *gscb = (struct gs_cb *) (uintptr_t) addr; + + printf("{"); + + if (gscb->reserved) + printf("reserved=%#016llx, ", + (unsigned long long) gscb->reserved); + + printf("gsd=%#16llx", + (unsigned long long) gscb->gsd); +# if VERBOSE + printf(" /* GS origin: "); + + unsigned int gsc = gscb->gsd & 0x3F; + unsigned int gls = (gscb->gsd >> 8) & 7; + bool gsc_valid = gsc >= 25 && gsc <= 56; + + if (gsc_valid) { + uint64_t gls = gscb->gsd >> gsc; + int field_size = 2 + (67 - gsc) / 4; + + printf("%#0*" PRIx64, field_size, gls); + } else { + printf("[invalid]"); + } + + printf(", guard load shift: %u, GS characteristic: %u */", + gls, gsc); +# endif /* VERBOSE */ + + printf(", gssm=%#016llx, gs_epl_a=", + (unsigned long long) gscb->gssm); + + gs_print_epl(gscb->gs_epl_a, epl_valid, epl_str); + + printf("}"); + } else { + if (bc_str) + printf("%s", bc_str); + else + printf("%#llx", (unsigned long long) addr); + } + + rc = syscall(__NR_s390_guarded_storage, + GS_SET_BC_CB | bogus_cmd_mask, addr); + printf(") = %s\n", sprintrc(rc)); +} + +int +main(void) +{ + static const kernel_ulong_t bogus_cmd = + (kernel_ulong_t) 0xdeafbeefdeadc0deULL; + static const kernel_ulong_t bogus_addr = + (kernel_ulong_t) 0xfacefeedac0ffeedULL; + + TAIL_ALLOC_OBJECT_CONST_PTR(struct gs_cb, gscb); + TAIL_ALLOC_OBJECT_CONST_PTR(struct gs_epl, gsepl); + + long rc; + + rc = syscall(__NR_s390_guarded_storage, 5, 0); + printf("s390_guarded_storage(0x5 /* GS_??? */, NULL) = %s\n", + sprintrc(rc)); + + rc = syscall(__NR_s390_guarded_storage, bogus_cmd, bogus_addr); + printf("s390_guarded_storage(%#x /* GS_??? */, %#lx) = %s\n", + (unsigned) bogus_cmd, (unsigned long) bogus_addr, sprintrc(rc)); + + gs_no_arg(ARG_STR(GS_BROADCAST)); + gs_no_arg(ARG_STR(GS_CLEAR_BC_CB)); + gs_no_arg(ARG_STR(GS_DISABLE)); + gs_no_arg(ARG_STR(GS_ENABLE)); + + fill_memory(gscb, sizeof(*gscb)); + fill_memory_ex(gsepl, sizeof(*gsepl), 0xA5, 0x5A); + + gs_set_cb(0, false, false, "NULL", NULL); + gs_set_cb((uintptr_t) (gscb + 1), false, false, NULL, NULL); + + gscb->gs_epl_a = 0; + gs_set_cb((uintptr_t) gscb, true, false, NULL, "NULL"); + + fill_memory_ex(gscb, sizeof(*gscb), 0x5A, 0xA5); + gscb->gs_epl_a = (uintptr_t) (gsepl + 1) | + (sizeof(kernel_ulong_t) < sizeof(uint64_t) ? + 0xc0debad000000000ULL : 0); + gs_set_cb((uintptr_t) gscb, true, false, NULL, NULL); + + fill_memory_ex(gscb, sizeof(*gscb), 0xA7, 0xA5); + gscb->gs_epl_a = (uintptr_t) gsepl; + gs_set_cb((uintptr_t) gscb, true, true, NULL, NULL); + + fill_memory_ex(gscb, sizeof(*gscb), 0x55, 0xAA); + fill_memory_ex(gsepl, sizeof(*gsepl), 0x5A, 0xA5); + gscb->gs_epl_a = (uintptr_t) gsepl; + gs_set_cb((uintptr_t) gscb, true, true, NULL, NULL); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_s390_guarded_storage && HAVE_ASM_GUARDED_STORAGE_H") + +#endif diff --git a/tests-mx32/s390_guarded_storage.gen.test b/tests-mx32/s390_guarded_storage.gen.test new file mode 100755 index 00000000..28b59814 --- /dev/null +++ b/tests-mx32/s390_guarded_storage.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (s390_guarded_storage -a32 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 diff --git a/tests-mx32/s390_pci_mmio_read_write.c b/tests-mx32/s390_pci_mmio_read_write.c new file mode 100644 index 00000000..0cd160c6 --- /dev/null +++ b/tests-mx32/s390_pci_mmio_read_write.c @@ -0,0 +1,134 @@ +/* + * Check decoding of s390_pci_mmio_read and s390_pci_mmio_write syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#if defined __NR_s390_pci_mmio_read && defined __NR_s390_pci_mmio_write + +# include +# include +# include +# include + +static void +do_call(bool wr, kernel_ulong_t mmio_addr, kernel_ulong_t buf, + kernel_ulong_t len, bool buf_valid, const char *buf_str) +{ + long saved_errno = 0; + long rc = 0; + + printf("s390_pci_mmio_%s(%#llx, ", wr ? "write" : "read", + (unsigned long long) mmio_addr); + + if (!wr) { + rc = syscall(__NR_s390_pci_mmio_read, mmio_addr, buf, len); + saved_errno = errno; + } + + if (buf_valid && !rc) { + char *buf_ptr = (char *) (uintptr_t) buf; + + print_quoted_hex(buf_ptr, + len > DEFAULT_STRLEN ? DEFAULT_STRLEN : len); + + if (len > DEFAULT_STRLEN) + printf("..."); + } else { + if (buf_str) + printf("%s", buf_str); + else + printf("%#llx", (unsigned long long) buf); + } + + printf(", %llu) = ", (unsigned long long) len); + + if (wr) + rc = syscall(__NR_s390_pci_mmio_write, mmio_addr, buf, len); + else + errno = saved_errno; + + puts(sprintrc(rc)); +} + +int +main(void) +{ + static const size_t buf_size = DEFAULT_STRLEN + 10; + + char *buf = tail_alloc(buf_size); + + bool bools[] = { true, false }; + + kernel_ulong_t addrs[] = { + 0, + (kernel_ulong_t) 0xdeafbeefdeadc0deULL, + }; + + struct { + kernel_ulong_t buf; + const char *str; + size_t size; + } bufs[] = { + { (kernel_ulong_t) ARG_STR(NULL), 0 }, + { (kernel_ulong_t) (buf + buf_size), NULL, 0 }, + { (kernel_ulong_t) (buf), NULL, buf_size }, + { (kernel_ulong_t) (buf + 9), NULL, buf_size - 9 }, + { (kernel_ulong_t) (buf + 10), NULL, buf_size - 10 }, + { (kernel_ulong_t) (buf + 16), NULL, buf_size - 16 }, + { (kernel_ulong_t) (buf + 26), NULL, buf_size - 26 }, + { (kernel_ulong_t) (buf + 28), NULL, buf_size - 28 }, + }; + + kernel_ulong_t sizes[] = { + 0, + DEFAULT_STRLEN / 2, + DEFAULT_STRLEN - 10, + DEFAULT_STRLEN, + DEFAULT_STRLEN + 1, + buf_size, + buf_size + 10, + (kernel_ulong_t) 0xfacefeedac0ffeedULL, + }; + + unsigned int i, j, k, l; + unsigned int ctr = 0; + + for (i = 0; i < ARRAY_SIZE(addrs); i++) { + for (j = 0; j < ARRAY_SIZE(bufs); j++) { + for (k = 0; k < ARRAY_SIZE(sizes); k++) { + for (l = 0; l < ARRAY_SIZE(bools); l++) { + bool valid = bufs[j].buf && + bufs[j].size >= + MIN(sizes[k], + DEFAULT_STRLEN + 1); + + if (bufs[j].size && bools[l]) + fill_memory_ex((char *) buf, + bufs[j].size, + 0xC0 + ctr, 255); + + do_call(bools[l], addrs[i], bufs[j].buf, + sizes[k], valid, bufs[j].str); + + ctr++; + } + } + } + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_s390_pci_mmio_read && __NR_s390_pci_mmio_write"); + +#endif diff --git a/tests-mx32/s390_pci_mmio_read_write.gen.test b/tests-mx32/s390_pci_mmio_read_write.gen.test new file mode 100755 index 00000000..cf32e0b3 --- /dev/null +++ b/tests-mx32/s390_pci_mmio_read_write.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (s390_pci_mmio_read_write -e trace=s390_pci_mmio_read,s390_pci_mmio_write -a30); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=s390_pci_mmio_read,s390_pci_mmio_write -a30 diff --git a/tests-mx32/s390_runtime_instr.c b/tests-mx32/s390_runtime_instr.c new file mode 100644 index 00000000..db31719b --- /dev/null +++ b/tests-mx32/s390_runtime_instr.c @@ -0,0 +1,78 @@ +/* + * Check decoding of s390_runtime_instr syscall. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#if defined __NR_s390_runtime_instr + +# include +# include +# include +# include + +int +main(void) +{ + static struct { + kernel_ulong_t cmd; + const char * cmd_str; + } cmd_args[] = { + { 0, "0 /* S390_RUNTIME_INSTR_??? */" }, + { 4, "4 /* S390_RUNTIME_INSTR_??? */" }, + { (kernel_ulong_t) 0xdeafbeefdeadc0deULL, + "-559038242 /* S390_RUNTIME_INSTR_??? */" }, + { 2, "S390_RUNTIME_INSTR_STOP" }, + }; + + static struct { + kernel_ulong_t sig; + const char * sig_str; + } start_sig_args[] = { + { 0, "0" }, + { (kernel_ulong_t) 0xfacefeedac0ffeedULL, NULL }, + { ARG_STR(SIGALRM) }, + { 33, "SIGRT_1" }, + { 63, "SIGRT_31" }, + }; + + unsigned int i; + long rc; + + for (i = 0; i < ARRAY_SIZE(cmd_args); i++) { + rc = syscall(__NR_s390_runtime_instr, cmd_args[i].cmd, 0xdead); + printf("s390_runtime_instr(%s) = %s\n", + cmd_args[i].cmd_str, sprintrc(rc)); + } + + for (i = 0; i < ARRAY_SIZE(start_sig_args); i++) { + long saved_errno; + + rc = syscall(__NR_s390_runtime_instr, 1, start_sig_args[i].sig); + saved_errno = errno; + printf("s390_runtime_instr(S390_RUNTIME_INSTR_START, "); + + if (start_sig_args[i].sig_str) + printf("%s", start_sig_args[i].sig_str); + else + printf("%d", (int) start_sig_args[i].sig); + + errno = saved_errno; + printf(") = %s\n", sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_s390_runtime_instr") + +#endif diff --git a/tests-mx32/s390_runtime_instr.gen.test b/tests-mx32/s390_runtime_instr.gen.test new file mode 100755 index 00000000..83e81502 --- /dev/null +++ b/tests-mx32/s390_runtime_instr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (s390_runtime_instr -a44 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a44 diff --git a/tests-mx32/s390_sthyi-v.c b/tests-mx32/s390_sthyi-v.c new file mode 100644 index 00000000..86055203 --- /dev/null +++ b/tests-mx32/s390_sthyi-v.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "s390_sthyi.c" diff --git a/tests-mx32/s390_sthyi-v.gen.test b/tests-mx32/s390_sthyi-v.gen.test new file mode 100755 index 00000000..27ab447b --- /dev/null +++ b/tests-mx32/s390_sthyi-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (s390_sthyi-v -e trace=s390_sthyi -a47 -v); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=s390_sthyi -a47 -v diff --git a/tests-mx32/s390_sthyi.c b/tests-mx32/s390_sthyi.c new file mode 100644 index 00000000..5186fdc9 --- /dev/null +++ b/tests-mx32/s390_sthyi.c @@ -0,0 +1,763 @@ +/* + * Check decoding of s390_sthyi syscall. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#if defined HAVE_ICONV_H && defined HAVE_ICONV_OPEN && defined __NR_s390_sthyi + +# include +# include +# include +# include +# include +# include + +# include + +# define EBCDIC_MAX_LEN 16 + +# ifndef VERBOSE +# define VERBOSE 0 +# endif + +static inline bool +print_0x8(const char *prefix, unsigned char *buf, unsigned int offs, bool zero) +{ + if (!zero && !buf[offs]) + return false; + + printf("%s=%#02hhx", prefix, buf[offs]); + + return true; +} + +static inline bool +print_u8(const char *prefix, unsigned char *buf, unsigned int offs, bool zero) +{ + if (!zero && !buf[offs]) + return false; + + printf("%s=%hhu", prefix, buf[offs]); + + return true; +} + +static inline bool +print_u16(const char *prefix, unsigned char *buf, unsigned int offs, bool zero) +{ + uint16_t val = *(uint16_t *) (buf + offs); + + if (!zero && !val) + return false; + + printf("%s=%" PRIu16, prefix, val); + + return true; +} + +static inline bool +print_x32(const char *prefix, unsigned char *buf, unsigned int offs, bool zero) +{ + uint32_t val = *(uint32_t *) (buf + offs); + + if (!zero && !val) + return false; + + printf("%s=%#" PRIx32, prefix, val); + + return true; +} + +static inline bool +print_weight(const char *prefix, unsigned char *buf, unsigned int offs, + bool zero) +{ + uint32_t val = *(uint32_t *) (buf + offs); + + if (print_x32(prefix, buf, offs, zero)) { + if (val) + printf(" /* %u %u/65536 cores */", + val >> 16, val & 0xFFFF); + else + printf(" /* unlimited */"); + + return true; + } + + return false; +} + +static inline char * +ebcdic2ascii(unsigned char *ebcdic, size_t size) +{ + static char ascii_buf[EBCDIC_MAX_LEN]; + + char *ebcdic_pos = (char *) ebcdic; + char *ascii_pos = ascii_buf; + size_t ebcdic_left = size; + size_t ascii_left = size; + size_t ret; + + iconv_t cd = iconv_open("ASCII", "EBCDICUS"); + + if (size > sizeof(ascii_buf)) + error_msg_and_fail("ebcdic2ascii: EBCDIC string is too big: " + "%zu (maximum is %zu)", + size, sizeof(ascii_buf)); + if (cd == (iconv_t) -1) + perror_msg_and_fail("ebcdic2ascii: unable to allocate a " + "conversion descriptior for converting " + "EBCDIC to ASCII"); + + while ((ret = iconv(cd, &ebcdic_pos, &ebcdic_left, + &ascii_pos, &ascii_left)) == (size_t) -1) { + switch (errno) { + case EILSEQ: + case EINVAL: /* That one is quite unexpected, actually */ + if (!ebcdic_left || !ascii_left) + goto ebcdic2ascii_end; + + *ascii_pos++ = ' '; + ebcdic_pos++; + ebcdic_left--; + + break; + + case E2BIG: + perror_msg_and_fail("ebcdic2ascii: ran out of " + "ASCII buffer unexpectedly"); + default: + perror_msg_and_fail("ebcdic2ascii: unexpected error"); + } + } + +ebcdic2ascii_end: + iconv_close(cd); + + if (ebcdic_left != ascii_left) + error_msg_and_fail("ebcdic2ascii: ASCII string differs in size " + "from EBCDIC"); + + return ascii_buf; +} + +static inline bool +is_empty(unsigned char *ptr, size_t size) +{ + size_t i; + + for (i = 0; !*ptr && i < size; ptr++, i++) + ; + + return i == size; +} + +static inline bool +print_ebcdic(const char *prefix, unsigned char *addr, unsigned int offs, + size_t size, bool zero, bool blank) +{ + const char *ascii = ebcdic2ascii(addr + offs, size); + + if (!zero) { + size_t i; + + for (i = 0; (addr[offs + i] == (blank ? 64 : 0)) && (i < size); + i++) + ; + + if (i == size) + return false; + } + + printf("%s=", prefix); + print_quoted_hex((char *) (addr + offs), size); + printf(" /* "); + print_quoted_memory(ascii, size); + printf(" */"); + + return true; +} + +static void +print_hypervisor_header(unsigned char *buf, int level, unsigned int offs_pos, + unsigned int len_pos, bool mt) +{ + uint16_t offs = *(uint16_t *) (buf + offs_pos); + uint16_t hdr_size = *(uint16_t *) (buf + len_pos); + unsigned char *cur; + + if (!offs) + return; + if (hdr_size < 32) + error_msg_and_fail("sthyi: hypervisor %d section is too small " + "(got %hu, 32 expected)", level, hdr_size); + + cur = buf + offs; + + printf(", /* hypervisor %d */ {infyflg1", level); + print_0x8("", cur, 0, true); +# if VERBOSE + if (cur[0]) { + bool printed = false; + + printf(" /* "); + if (cur[0] & 0x80) { + printf("0x80 - guest CPU usage had limiting is using " + "the consumption method"); + printed = true; + } + if (cur[0] & 0x40) { + if (printed) + printf(", "); + printf("0x40 - LIMITHARD caps use prorated core time " + "for capping"); + printed = true; + } + if (cur[0] & 0x3F) { + if (printed) + printf(", "); + printf("%#hhx - ???", cur[0] & 0x3F); + } + printf(" */"); + } + + print_0x8(", infyflg2", cur, 1, false); + print_0x8(", infyval1", cur, 2, false); + print_0x8(", infyval2", cur, 3, false); + + print_u8(", infytype", cur, 4, true); + if (cur[4] == 1) + printf(" /* z/VM is the hypervisor */"); + else + printf(" /* unknown hypervisor type */"); + + if (cur[5]) + printf(", reserved_1__=\"\\x%#02hhx\"", cur[5]); + + print_u8(", infycpt", cur, 6, mt); + print_u8(", infyiflt", cur, 7, mt); +# endif /* !VERBOSE */ + + print_ebcdic(", infysyid", cur, 8, 8, VERBOSE, true); + print_ebcdic(", infyclnm", cur, 16, 8, VERBOSE, true); + + print_u16(", infyscps", cur, 24, VERBOSE); + print_u16(", infydcps", cur, 26, VERBOSE); + print_u16(", infysifl", cur, 28, VERBOSE); + print_u16(", infydifl", cur, 30, VERBOSE); + +# if VERBOSE + if (hdr_size > 32 && !is_empty(cur + 32, hdr_size - 32)) { + printf(", "); + print_quoted_hex((char *) (cur + 32), hdr_size - 32); + } +# else /* !VERBOSE */ + printf(", ..."); +# endif /* !VERBOSE */ + + printf("}"); +} + +static void +print_guest_header(unsigned char *buf, int level, unsigned int offs_pos, + unsigned int len_pos) +{ + uint16_t offs = *(uint16_t *) (buf + offs_pos); + uint16_t hdr_size = *(uint16_t *) (buf + len_pos); + unsigned char *cur; + + if (!offs) + return; + if (hdr_size < 56) + error_msg_and_fail("sthyi: guest %d section is too small " + "(got %hu, 56 expected)", level, hdr_size); + + cur = buf + offs; + + printf(", /* guest %d */ {infgflg1", level); + print_0x8("", cur, 0, true); +# if VERBOSE + if (cur[0]) { + bool printed = false; + + printf(" /* "); + if (cur[0] & 0x80) { + printf("0x80 - guest is mobility enabled"); + printed = true; + } + if (cur[0] & 0x40) { + if (printed) + printf(", "); + printf("0x40 - guest has multiple virtual CPU types"); + printed = true; + } + if (cur[0] & 0x20) { + if (printed) + printf(", "); + printf("0x20 - guest CP dispatch type has LIMITHARD " + "cap"); + printed = true; + } + if (cur[0] & 0x10) { + if (printed) + printf(", "); + printf("0x10 - guest IFL dispatch type has LIMITHARD " + "cap"); + printed = true; + } + if (cur[0] & 0x08) { + if (printed) + printf(", "); + printf("0x08 - virtual CPs are thread dispatched"); + printed = true; + } + if (cur[0] & 0x04) { + if (printed) + printf(", "); + printf("0x04 - virtual IFLs are thread dispatched"); + printed = true; + } + if (cur[0] & 0x3) { + if (printed) + printf(", "); + printf("%#hhx - ???", cur[0] & 0x3); + } + printf(" */"); + } + + print_0x8(", infgflg2", cur, 1, false); + print_0x8(", infgval1", cur, 2, false); + print_0x8(", infgval2", cur, 3, false); +# endif /* !VERBOSE */ + + print_ebcdic(", infgusid", cur, 4, 8, true, false); + + print_u16(", infgscps", cur, 12, VERBOSE); + print_u16(", infgdcps", cur, 14, VERBOSE); + +# if VERBOSE + print_u8(", infgcpdt", cur, 16, true); + if (cur[16] == 0) + printf(" /* General Purpose (CP) */"); + else + printf(" /* unknown */"); + + if (cur[17] || cur[18] || cur[19]) + printf(", reserved_1__=\"\\x%#02hhx\\x%#02hhx\\x%#02hhx\"", + cur[17], cur[18], cur[19]); +# endif /* !VERBOSE */ + + print_weight(", infgcpcc", cur, 20, VERBOSE); + + print_u16(", infgsifl", cur, 24, VERBOSE); + print_u16(", infgdifl", cur, 26, VERBOSE); + +# if VERBOSE + print_u8(", infgifdt", cur, 28, true); + if (cur[28] == 0) + printf(" /* General Purpose (CP) */"); + else if (cur[28] == 3) + printf(" /* Integrated Facility for Linux (IFL) */"); + else + printf(" /* unknown */"); + + if (cur[29] || cur[30] || cur[31]) + printf(", reserved_2__=\"\\x%#02hhx\\x%#02hhx\\x%#02hhx\"", + cur[29], cur[30], cur[31]); +# endif /* !VERBOSE */ + + print_weight(", infgifcc", cur, 32, VERBOSE); + + print_0x8(", infgpflg", cur, 36, true); +# if VERBOSE + if (cur[36]) { + bool printed = false; + + printf(" /* "); + if (cur[36] & 0x80) { + printf("0x80 - CPU pool's CP virtual type has " + "LIMITHARD cap"); + printed = true; + } + if (cur[36] & 0x40) { + if (printed) + printf(", "); + printf("0x40 - CPU pool's CP virtual type has " + "CAPACITY cap"); + printed = true; + } + if (cur[36] & 0x20) { + if (printed) + printf(", "); + printf("0x20 - CPU pool's IFL virtual type has " + "LIMITHARD cap"); + printed = true; + } + if (cur[36] & 0x10) { + if (printed) + printf(", "); + printf("0x10 - CPU pool's IFL virtual type has " + "CAPACITY cap"); + printed = true; + } + if (cur[36] & 0x08) { + if (printed) + printf(", "); + printf("0x08 - CPU pool uses prorated core time"); + printed = true; + } + if (cur[36] & 0x7) { + if (printed) + printf(", "); + printf("%#hhx - ???", cur[36] & 0x7); + } + printf(" */"); + } + + if (cur[37] || cur[38] || cur[39]) + printf(", reserved_3__=\"\\x%#02hhx\\x%#02hhx\\x%#02hhx\"", + cur[37], cur[38], cur[39]); + + print_ebcdic(", infgpnam", cur, 40, 8, false, true); + + print_weight(", infgpccc", cur, 48, true); + print_weight(", infgpicc", cur, 52, true); + + if (hdr_size > 56 && !is_empty(cur + 56, hdr_size - 56)) { + printf(", "); + print_quoted_hex((char *) (cur + 56), hdr_size - 56); + } +# else /* !VERBOSE */ + printf(", ..."); +# endif /* !VERBOSE */ + + printf("}"); +} + +static void +print_sthyi(unsigned char *buf) +{ + unsigned char *cur; + uint16_t hdr_size; + uint16_t offs; + bool mt = false; + + hdr_size = *(uint16_t *) (buf + 10); + if (hdr_size < 44) + error_msg_and_fail("sthyi: header section is too small " + "(got %hu, 44 expected)", hdr_size); + + /* INFHFLG1 */ + print_0x8("{/* header */ {infhflg1", buf, 0, true); +# if VERBOSE + if (buf[0]) { + bool printed = false; + + printf(" /* "); + if (buf[0] & 0x80) { + printf("0x80 - Global Performance Data unavailable"); + printed = true; + } + if (buf[0] & 0x40) { + if (printed) + printf(", "); + printf("0x40 - One or more hypervisor levels below " + "this level does not support the STHYI " + "instruction"); + printed = true; + } + if (buf[0] & 0x20) { + if (printed) + printf(", "); + printf("0x20 - Virtualization stack is incomplete"); + printed = true; + } + if (buf[0] & 0x10) { + if (printed) + printf(", "); + printf("0x10 - Execution environment is not within a " + "logical partition"); + printed = true; + } + if (buf[0] & 0xF) { + if (printed) + printf(", "); + printf("%#hhx - ???", buf[0] & 0xF); + } + printf(" */"); + } + + print_0x8(", infhflg2", buf, 1, false); + print_0x8(", infhval1", buf, 2, false); + print_0x8(", infhval2", buf, 3, false); + + /* Reserved */ + if (buf[4] || buf[5] || buf[6]) + printf(", reserved_1__=\"\\x%#02hhx\\x%#02hhx\\x%#02hhx\"", + buf[4], buf[5], buf[6]); + + print_u8(", infhygct", buf, 7, true); + print_u16(", infhtotl", buf, 8, true); + print_u16(", infhdln", buf, 10, true); + print_u16(", infmoff", buf, 12, true); + print_u16(", infmlen", buf, 14, true); + print_u16(", infpoff", buf, 16, true); + print_u16(", infplen", buf, 18, true); + print_u16(", infhoff1", buf, 20, true); + print_u16(", infhlen1", buf, 22, true); + print_u16(", infgoff1", buf, 24, true); + print_u16(", infglen1", buf, 26, true); + print_u16(", infhoff2", buf, 28, true); + print_u16(", infhlen2", buf, 30, true); + print_u16(", infgoff2", buf, 32, true); + print_u16(", infglen2", buf, 34, true); + print_u16(", infhoff3", buf, 36, true); + print_u16(", infhlen3", buf, 38, true); + print_u16(", infgoff3", buf, 40, true); + print_u16(", infglen3", buf, 42, true); + + if (hdr_size > 44 && !is_empty(buf + 44, hdr_size - 44)) { + printf(", "); + print_quoted_hex((char *) (buf + 44), hdr_size - 44); + } +# else /* !VERBOSE */ + printf(", ..."); +# endif /* !VERBOSE */ + + printf("}"); + + /* Machine header */ + offs = *(uint16_t *) (buf + 12); + if (!offs) + goto partition_hdr; + + hdr_size = *(uint16_t *) (buf + 14); + if (hdr_size < 60) + error_msg_and_fail("sthyi: machine section is too small " + "(got %hu, 60 expected)", hdr_size); + + cur = buf + offs; + + printf(", /* machine */ {"); + +# if VERBOSE + print_0x8("infmflg1", cur, 0, false); + if (cur[0]) + printf(", "); + print_0x8("infmflg2", cur, 1, false); + if (cur[1]) + printf(", "); +# endif /* !VERBOSE */ + print_0x8("infmval1", cur, 2, true); + + bool cnt_valid = cur[2] & 0x80; +# if VERBOSE + bool id_valid = cur[2] & 0x40; + bool name_valid = cur[2] & 0x20; + + printf(" /* processor count validity: %d, machine ID validity: %d, " + "machine name validity: %d", + !!cnt_valid, !!id_valid, !!name_valid); + if (cur[2] & 0x1F) + printf(", %#hhx - ???", cur[2] & 0x1F); + printf(" */"); + print_0x8(", infmval2", cur, 3, false); +# endif /* !VERBOSE */ + + print_u16(", infmscps", cur, 4, cnt_valid); + print_u16(", infmdcps", cur, 6, cnt_valid); + print_u16(", infmsifl", cur, 8, cnt_valid); + print_u16(", infmdifl", cur, 10, cnt_valid); + +# if VERBOSE + print_ebcdic(", infmname", cur, 12, 8, name_valid, false); + + print_ebcdic(", infmtype", cur, 20, 4, id_valid, false); + print_ebcdic(", infmmanu", cur, 24, 16, id_valid, false); + print_ebcdic(", infmseq", cur, 40, 16, id_valid, false); + print_ebcdic(", infmpman", cur, 56, 4, id_valid, false); + + if (hdr_size > 60 && !is_empty(cur + 60, hdr_size - 60)) { + printf(", "); + print_quoted_hex((char *) (cur + 60), hdr_size - 60); + } +# else /* !VERBOSE */ + printf(", ..."); +# endif /* !VERBOSE */ + + printf("}"); + +partition_hdr: + /* Partition header */ + offs = *(uint16_t *) (buf + 16); + if (!offs) + goto hv_hdr; + + hdr_size = *(uint16_t *) (buf + 18); + if (hdr_size < 56) + error_msg_and_fail("sthyi: partition section is too small " + "(got %hu, 56 expected)", hdr_size); + + cur = buf + offs; + + print_0x8(", /* partition */ {infpflg1", cur, 0, true); + mt = !!(cur[0] & 0x80); +# if VERBOSE + if (cur[0]) { + bool printed = false; + + printf(" /* "); + if (cur[0] & 0x80) { + printf("0x80 - multithreading is enabled"); + printed = true; + } + if (cur[0] & 0x7F) { + if (printed) + printf(", "); + printf("%#hhx - ???", cur[0] & 0x7F); + } + printf(" */"); + } + print_0x8(", infpflg2", cur, 1, false); +# endif /* !VERBOSE */ + print_0x8(", infpval1", cur, 2, true); + + bool pcnt_valid = cur[2] & 0x80; + bool pid_valid = cur[2] & 0x10; +# if VERBOSE + bool pwcap_valid = cur[2] & 0x40; + bool pacap_valid = cur[2] & 0x20; + bool lpar_valid = cur[2] & 0x08; +# endif /* !VERBOSE */ + +# if VERBOSE + printf(" /* processor count validity: %d, partition weight-based " + "capacity validity: %d, partition absolute capacity validity: " + "%d, partition ID validity: %d, LPAR group absolute capacity " + "capping information validity: %d", + !!pcnt_valid, !!pwcap_valid, !!pacap_valid, !!pid_valid, + !!lpar_valid); + if (cur[2] & 0x7) + printf(", %#hhx - ???", cur[2] & 0x7); + printf(" */"); + + print_0x8(", infpval2", cur, 3, false); +# endif /* !VERBOSE */ + + print_u16(", infppnum", cur, 4, pid_valid); + + print_u16(", infpscps", cur, 6, pcnt_valid); + print_u16(", infpdcps", cur, 8, pcnt_valid); + print_u16(", infpsifl", cur, 10, pcnt_valid); + print_u16(", infpdifl", cur, 12, pcnt_valid); + +# if VERBOSE + if (cur[14] || cur[15]) + printf(", reserved_1__=\"\\x%#02hhx\\x%#02hhx\"", + cur[14], cur[15]); +# endif /* !VERBOSE */ + + print_ebcdic(", infppnam", cur, 16, 8, pid_valid, false); + +# if VERBOSE + print_weight(", infpwbcp", cur, 24, pwcap_valid); + print_weight(", infpabcp", cur, 28, pacap_valid); + print_weight(", infpwbif", cur, 32, pwcap_valid); + print_weight(", infpabif", cur, 36, pacap_valid); + + if (print_ebcdic(", infplgnm", cur, 40, 8, false, false)) { + + print_weight(", infplgcp", cur, 48, false); + print_weight(", infplgif", cur, 52, false); + } else { + if (lpar_valid) { + printf(", infplgnm="); + print_quoted_hex((char *) (cur + 40), 8); + } + + print_x32(", infplgcp", cur, 48, false); + print_x32(", infplgif", cur, 52, false); + } + + if (hdr_size > 56 && !is_empty(cur + 56, hdr_size - 56)) { + printf(", "); + print_quoted_hex((char *) (cur + 56), hdr_size - 56); + } +# else /* !VERBOSE */ + printf(", ..."); +# endif /* !VERBOSE */ + + printf("}"); + +hv_hdr: + /* Hypervisor/guest headers */ + print_hypervisor_header(buf, 1, 20, 22, mt); + print_guest_header(buf, 1, 24, 26); + print_hypervisor_header(buf, 2, 28, 30, mt); + print_guest_header(buf, 2, 32, 34); + print_hypervisor_header(buf, 3, 36, 38, mt); + print_guest_header(buf, 3, 40, 42); + + printf("}"); +} + +int +main(void) +{ + static const kernel_ulong_t bogus_func = + (kernel_ulong_t) 0xdeafbeefdeadc0deULL; + static const kernel_ulong_t bogus_resp_buf = + (kernel_ulong_t) 0xfacefeedac0ffeedULL; + static const kernel_ulong_t bogus_ret_code = + (kernel_ulong_t) 0xf00dfa57decaffedULL; + static const kernel_ulong_t bogus_flags = + (kernel_ulong_t) 0xfee1deadfa57beefULL; + + unsigned char *buf = tail_alloc(PAGE_SIZE); + TAIL_ALLOC_OBJECT_CONST_PTR(uint64_t, ret); + + long rc; + + rc = syscall(__NR_s390_sthyi, 0, 0, 0, 0); + printf("s390_sthyi(STHYI_FC_CP_IFL_CAP, NULL, NULL, 0) = %s\n", + sprintrc(rc)); + + rc = syscall(__NR_s390_sthyi, bogus_func, bogus_resp_buf, + bogus_ret_code, bogus_flags); + printf("s390_sthyi(%#llx /* STHYI_FC_??? */, %#llx, %#llx, %#llx) = " + "%s\n", + (unsigned long long) bogus_func, + (unsigned long long) bogus_resp_buf, + (unsigned long long) bogus_ret_code, + (unsigned long long) bogus_flags, + sprintrc(rc)); + + rc = syscall(__NR_s390_sthyi, bogus_func, buf, ret, 0); + printf("s390_sthyi(%#llx /* STHYI_FC_??? */, %p, %p, 0) = %s\n", + (unsigned long long) bogus_func, buf, ret, sprintrc(rc)); + + rc = syscall(__NR_s390_sthyi, 0, buf, ret, 0); + if (rc) + error_msg_and_skip("syscall(__NR_s390_sthyi, 0, buf, ret, 0) " + "returned unexpected value of %ld", rc); + + printf("s390_sthyi(STHYI_FC_CP_IFL_CAP, "); + print_sthyi(buf); + printf(", [0], 0) = 0\n"); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_ICONV_H && HAVE_ICONV_OPEN && __NR_s390_sthyi") + +#endif diff --git a/tests-mx32/s390_sthyi.gen.test b/tests-mx32/s390_sthyi.gen.test new file mode 100755 index 00000000..cf271374 --- /dev/null +++ b/tests-mx32/s390_sthyi.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (s390_sthyi -a47 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a47 diff --git a/tests-mx32/sched.gen.test b/tests-mx32/sched.gen.test new file mode 100755 index 00000000..67471176 --- /dev/null +++ b/tests-mx32/sched.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched test_trace_expr times -e/sched); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr times -e/sched diff --git a/tests-mx32/sched.in b/tests-mx32/sched.in new file mode 100755 index 00000000..46031d6c --- /dev/null +++ b/tests-mx32/sched.in @@ -0,0 +1,7 @@ +sched_xetaffinity -a28 +sched_xetparam -a23 +sched_rr_get_interval -a31 +sched_get_priority_mxx -a33 +sched_xetattr -a29 +sched_xetscheduler -a22 +sched_yield -a14 diff --git a/tests-mx32/sched_get_priority_mxx.c b/tests-mx32/sched_get_priority_mxx.c index fc14b27c..7715d286 100644 --- a/tests-mx32/sched_get_priority_mxx.c +++ b/tests-mx32/sched_get_priority_mxx.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -24,6 +31,6 @@ main(void) #else SKIP_MAIN_UNDEFINED("__NR_sched_get_priority_min" - " && defined __NR_sched_get_priority_max"); + " && defined __NR_sched_get_priority_max"); #endif diff --git a/tests-mx32/sched_get_priority_mxx.gen.test b/tests-mx32/sched_get_priority_mxx.gen.test new file mode 100755 index 00000000..a2359972 --- /dev/null +++ b/tests-mx32/sched_get_priority_mxx.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched_get_priority_mxx -a33 -e trace=sched_get_priority_min,sched_get_priority_max); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -e trace=sched_get_priority_min,sched_get_priority_max diff --git a/tests-mx32/sched_get_priority_mxx.test b/tests-mx32/sched_get_priority_mxx.test deleted file mode 100755 index 0d1a1a78..00000000 --- a/tests-mx32/sched_get_priority_mxx.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sched_get_priority_min and sched_get_priority_max syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a33 -e trace=sched_get_priority_min,sched_get_priority_max diff --git a/tests-mx32/sched_rr_get_interval.c b/tests-mx32/sched_rr_get_interval.c index 0aacd2b7..b1117f3b 100644 --- a/tests-mx32/sched_rr_get_interval.c +++ b/tests-mx32/sched_rr_get_interval.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -11,7 +18,7 @@ int main(void) { - struct timespec *const tp = tail_alloc(sizeof(struct timespec)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, tp); long rc; rc = syscall(__NR_sched_rr_get_interval, 0, NULL); @@ -25,8 +32,10 @@ main(void) rc = syscall(__NR_sched_rr_get_interval, 0, tp); if (rc == 0) - printf("sched_rr_get_interval(0, {tv_sec=%jd, tv_nsec=%jd}) = " - "0\n", (intmax_t)tp->tv_sec, (intmax_t)tp->tv_nsec); + printf("sched_rr_get_interval(0, {tv_sec=%lld, tv_nsec=%llu})" + " = 0\n", + (long long) tp->tv_sec, + zero_extend_signed_to_ull(tp->tv_nsec)); else printf("sched_rr_get_interval(-1, %p) = %s\n", tp, sprintrc(rc)); diff --git a/tests-mx32/sched_rr_get_interval.gen.test b/tests-mx32/sched_rr_get_interval.gen.test new file mode 100755 index 00000000..02aad002 --- /dev/null +++ b/tests-mx32/sched_rr_get_interval.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched_rr_get_interval -a31 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 diff --git a/tests-mx32/sched_rr_get_interval.test b/tests-mx32/sched_rr_get_interval.test deleted file mode 100755 index 828ba5d0..00000000 --- a/tests-mx32/sched_rr_get_interval.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sched_rr_get_interval syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a31 diff --git a/tests-mx32/sched_xetaffinity.c b/tests-mx32/sched_xetaffinity.c index 41a18202..4e6fbe20 100644 --- a/tests-mx32/sched_xetaffinity.c +++ b/tests-mx32/sched_xetaffinity.c @@ -1,30 +1,10 @@ /* * This file is part of sched_xetaffinity strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/sched_xetaffinity.gen.test b/tests-mx32/sched_xetaffinity.gen.test new file mode 100755 index 00000000..7a1c75be --- /dev/null +++ b/tests-mx32/sched_xetaffinity.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched_xetaffinity -a28 -e trace=sched_getaffinity,sched_setaffinity); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 -e trace=sched_getaffinity,sched_setaffinity diff --git a/tests-mx32/sched_xetaffinity.test b/tests-mx32/sched_xetaffinity.test deleted file mode 100755 index 246ea21a..00000000 --- a/tests-mx32/sched_xetaffinity.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sched_getaffinity and sched_setaffinity syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 -e trace=sched_getaffinity,sched_setaffinity diff --git a/tests-mx32/sched_xetattr.c b/tests-mx32/sched_xetattr.c index 1b484915..3440876b 100644 --- a/tests-mx32/sched_xetattr.c +++ b/tests-mx32/sched_xetattr.c @@ -1,28 +1,9 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,95 +13,254 @@ # include # include +# include # include +# include "sched_attr.h" +# include "xlat.h" +# include "xlat/schedulers.h" + +static const char *errstr; + +static long +sys_sched_getattr(kernel_ulong_t pid, kernel_ulong_t attr, + kernel_ulong_t size, kernel_ulong_t flags) +{ + long rc = syscall(__NR_sched_getattr, pid, attr, size, flags); + errstr = sprintrc(rc); + return rc; +} + +static long +sys_sched_setattr(kernel_ulong_t pid, kernel_ulong_t attr, kernel_ulong_t flags) +{ + long rc = syscall(__NR_sched_setattr, pid, attr, flags); + errstr = sprintrc(rc); + return rc; +} int main(void) { - struct { - uint32_t size; - uint32_t sched_policy; - uint64_t sched_flags; - int32_t sched_nice; - uint32_t sched_priority; - uint64_t sched_runtime; - uint64_t sched_deadline; - uint64_t sched_period; - } *sched_attr = tail_alloc(sizeof(*sched_attr)); - - long rc = syscall(__NR_sched_getattr, 0xdeadface, NULL, 0, 0); - printf("sched_getattr\\(%d, NULL, 0, 0\\) += %s\n", - 0xdeadface, sprintrc_grep(rc)); - - rc = syscall(__NR_sched_getattr, -1, - sched_attr, 0xbadfaced, 0xc0defeed); - printf("sched_getattr\\(-1, %p, %u, %u\\) += %s\n", - sched_attr, 0xbadfaced, 0xc0defeed, sprintrc_grep(rc)); - - rc = syscall(__NR_sched_getattr, 0, - sched_attr + 1, sizeof(*sched_attr), 0); - printf("sched_getattr\\(0, %p, %u, 0\\) += %s\n", - sched_attr + 1, (unsigned)sizeof(*sched_attr), - sprintrc_grep(rc)); - - if (syscall(__NR_sched_getattr, 0, sched_attr, sizeof(*sched_attr), 0)) - perror_msg_and_skip("sched_getattr"); + static const kernel_ulong_t bogus_pid = + (kernel_ulong_t) 0xdefacedfacefeedULL; + static const kernel_ulong_t bogus_size = + (kernel_ulong_t) 0xdefacedcafef00dULL; + static const kernel_ulong_t bogus_flags = + (kernel_ulong_t) 0xdefaceddeadc0deULL; + + TAIL_ALLOC_OBJECT_CONST_PTR(struct sched_attr, attr); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, psize); + void *const efault = attr + 1; + + sys_sched_getattr(0, 0, 0, 0); + printf("sched_getattr(0, NULL, 0, 0) = %s\n", errstr); - printf("sched_getattr\\(0, \\{size=%u, sched_policy=SCHED_[A-Z]+" - ", sched_flags=%s, sched_nice=%d, sched_priority=%u" + sys_sched_getattr(0, (unsigned long) attr, 0, 0); + printf("sched_getattr(0, %p, 0, 0) = %s\n", attr, errstr); + + sys_sched_getattr(bogus_pid, 0, 0, 0); + printf("sched_getattr(%d, NULL, 0, 0) = %s\n", (int) bogus_pid, errstr); + + sys_sched_getattr(-1U, (unsigned long) attr, bogus_size, bogus_flags); + printf("sched_getattr(-1, %p, %s%u, %u) = %s\n", + attr, +# if defined __arm64__ || defined __aarch64__ + "0xdefaced<<32|", +# else + "", +# endif + (unsigned) bogus_size, (unsigned) bogus_flags, errstr); + + sys_sched_getattr(0, (unsigned long) efault, sizeof(*attr), 0); + printf("sched_getattr(0, %p, %u, 0) = %s\n", + efault, (unsigned) sizeof(*attr), errstr); + + if (sys_sched_getattr(0, (unsigned long) attr, sizeof(*attr), 0)) + perror_msg_and_skip("sched_getattr"); + printf("sched_getattr(0, {size=%u, sched_policy=", attr->size); + printxval(schedulers, attr->sched_policy, NULL); + printf(", sched_flags=%s, sched_nice=%d, sched_priority=%u" ", sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 - ", sched_period=%" PRIu64 "\\}, %u, 0\\) += 0\n", - sched_attr->size, - sched_attr->sched_flags ? "SCHED_FLAG_RESET_ON_FORK" : "0", - sched_attr->sched_nice, - sched_attr->sched_priority, - sched_attr->sched_runtime, - sched_attr->sched_deadline, - sched_attr->sched_period, - (unsigned) sizeof(*sched_attr)); - - sched_attr->sched_flags |= 1; - if (syscall(__NR_sched_setattr, 0, sched_attr, 0)) + ", sched_period=%" PRIu64 "}, %u, 0) = 0\n", + attr->sched_flags ? "SCHED_FLAG_RESET_ON_FORK" : "0", + attr->sched_nice, + attr->sched_priority, + attr->sched_runtime, + attr->sched_deadline, + attr->sched_period, + (unsigned) sizeof(*attr)); + +# if defined __arm64__ || defined __aarch64__ + long rc = +# endif + sys_sched_getattr(F8ILL_KULONG_MASK, (unsigned long) attr, + F8ILL_KULONG_MASK | sizeof(*attr), F8ILL_KULONG_MASK); +# if defined __arm64__ || defined __aarch64__ + if (rc) { + printf("sched_getattr(0, %p, 0xffffffff<<32|%u, 0) = %s\n", + attr, (unsigned) sizeof(*attr), errstr); + } else +# endif + { + printf("sched_getattr(0, {size=%u, sched_policy=", attr->size); + printxval(schedulers, attr->sched_policy, NULL); + printf(", sched_flags=%s, sched_nice=%d, sched_priority=%u" + ", sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 + ", sched_period=%" PRIu64 "}, %u, 0) = 0\n", + attr->sched_flags ? "SCHED_FLAG_RESET_ON_FORK" : "0", + attr->sched_nice, + attr->sched_priority, + attr->sched_runtime, + attr->sched_deadline, + attr->sched_period, + (unsigned) sizeof(*attr)); + } + + sys_sched_setattr(bogus_pid, 0, 0); + printf("sched_setattr(%d, NULL, 0) = %s\n", (int) bogus_pid, errstr); + + attr->sched_flags |= 1; + + if (sys_sched_setattr(0, (unsigned long) attr, 0)) perror_msg_and_skip("sched_setattr"); + printf("sched_setattr(0, {size=%u, sched_policy=", attr->size); + printxval(schedulers, attr->sched_policy, NULL); + printf(", sched_flags=%s, sched_nice=%d, sched_priority=%u" + ", sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 + ", sched_period=%" PRIu64 "}, 0) = 0\n", + "SCHED_FLAG_RESET_ON_FORK", + attr->sched_nice, + attr->sched_priority, + attr->sched_runtime, + attr->sched_deadline, + attr->sched_period); - printf("sched_setattr\\(0, \\{size=%u, sched_policy=SCHED_[A-Z]+" - ", sched_flags=%s, sched_nice=%d, sched_priority=%u" + sys_sched_setattr(F8ILL_KULONG_MASK, (unsigned long) attr, + F8ILL_KULONG_MASK); + printf("sched_setattr(0, {size=%u, sched_policy=", attr->size); + printxval(schedulers, attr->sched_policy, NULL); + printf(", sched_flags=%s, sched_nice=%d, sched_priority=%u" ", sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 - ", sched_period=%" PRIu64 "\\}, 0\\) += 0\n", - sched_attr->size, + ", sched_period=%" PRIu64 "}, 0) = 0\n", "SCHED_FLAG_RESET_ON_FORK", - sched_attr->sched_nice, - sched_attr->sched_priority, - sched_attr->sched_runtime, - sched_attr->sched_deadline, - sched_attr->sched_period); - - sched_attr->size = 0x90807060; - sched_attr->sched_policy = 0xca7faced; - sched_attr->sched_flags = 0xbadc0ded1057da7aULL; - sched_attr->sched_nice = 0xafbfcfdf; - sched_attr->sched_priority = 0xb8c8d8e8; - sched_attr->sched_runtime = 0xbadcaffedeadf157ULL; - sched_attr->sched_deadline = 0xc0de70a57badac75ULL; - sched_attr->sched_period = 0xded1ca7edda7aca7ULL; - - rc = syscall(__NR_sched_setattr, 0xfacec0de, sched_attr, 0xbeeff00d); - - printf("sched_setattr\\(%d, \\{size=%u, " - "sched_policy=%#x /\\* SCHED_\\?\\?\\? \\*/, " - "sched_flags=%#" PRIx64 " /\\* SCHED_FLAG_\\?\\?\\? \\*/, " - "sched_nice=%d, sched_priority=%u, sched_runtime=%" PRIu64 ", " - "sched_deadline=%" PRIu64 ", sched_period=%" PRIu64 "\\}, " - "%u\\) += %s\n", - 0xfacec0de, sched_attr->size, - sched_attr->sched_policy, - sched_attr->sched_flags, - sched_attr->sched_nice, - sched_attr->sched_priority, - sched_attr->sched_runtime, - sched_attr->sched_deadline, - sched_attr->sched_period, 0xbeeff00d, sprintrc_grep(rc)); + attr->sched_nice, + attr->sched_priority, + attr->sched_runtime, + attr->sched_deadline, + attr->sched_period); + + *psize = attr->size; + + sys_sched_setattr(0, (unsigned long) psize, 0); + printf("sched_setattr(0, %p, 0) = %s\n", psize, errstr); + + attr->size = 0; + + sys_sched_setattr(0, (unsigned long) attr, 0); + printf("sched_setattr(0, {size=%u, sched_policy=", attr->size); + printxval(schedulers, attr->sched_policy, NULL); + printf(", sched_flags=%s, sched_nice=%d, sched_priority=%u" + ", sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 + ", sched_period=%" PRIu64 "}, 0) = 0\n", + "SCHED_FLAG_RESET_ON_FORK", + attr->sched_nice, + attr->sched_priority, + attr->sched_runtime, + attr->sched_deadline, + attr->sched_period); + + attr->size = 1; + + sys_sched_setattr(0, (unsigned long) attr, 0); + printf("sched_setattr(0, {size=%u} => {size=%u}, 0) = %s\n", + 1, attr->size, errstr); + + attr->size = SCHED_ATTR_MIN_SIZE - 1; + + sys_sched_setattr(0, (unsigned long) attr, 0); + printf("sched_setattr(0, {size=%u} => {size=%u}, 0) = %s\n", + SCHED_ATTR_MIN_SIZE - 1, attr->size, errstr); + + attr->size = 0x90807060; + attr->sched_policy = 0xca7faced; + attr->sched_flags = 0xbadc0ded1057da78ULL; + attr->sched_nice = 0xafbfcfdf; + attr->sched_priority = 0xb8c8d8e8; + attr->sched_runtime = 0xbadcaffedeadf157ULL; + attr->sched_deadline = 0xc0de70a57badac75ULL; + attr->sched_period = 0xded1ca7edda7aca7ULL; + + sys_sched_setattr(bogus_pid, (unsigned long) attr, bogus_flags); + printf("sched_setattr(%d, {size=%u, sched_policy=%#x /* SCHED_??? */, " + "sched_flags=%#" PRIx64 " /* SCHED_FLAG_??? */, " + "sched_nice=%d, sched_priority=%u, sched_runtime=%" PRIu64 ", " + "sched_deadline=%" PRIu64 ", sched_period=%" PRIu64 ", ...}, %u)" + " = %s\n", + (int) bogus_pid, + attr->size, + attr->sched_policy, + attr->sched_flags, + attr->sched_nice, + attr->sched_priority, + attr->sched_runtime, + attr->sched_deadline, + attr->sched_period, + (unsigned) bogus_flags, errstr); + + if (F8ILL_KULONG_SUPPORTED) { + const kernel_ulong_t ill = f8ill_ptr_to_kulong(attr); + + sys_sched_getattr(0, ill, sizeof(*attr), 0); + printf("sched_getattr(0, %#llx, %u, 0) = %s\n", + (unsigned long long) ill, (unsigned) sizeof(*attr), + errstr); + + sys_sched_setattr(0, ill, 0); + printf("sched_setattr(0, %#llx, 0) = %s\n", + (unsigned long long) ill, errstr); + } + + + attr->size = 0x90807060; + attr->sched_policy = 0xca7faced; + attr->sched_flags = 0xfULL; + attr->sched_nice = 0xafbfcfdf; + attr->sched_priority = 0xb8c8d8e8; + attr->sched_runtime = 0xbadcaffedeadf157ULL; + attr->sched_deadline = 0xc0de70a57badac75ULL; + attr->sched_period = 0xded1ca7edda7aca7ULL; + + sys_sched_setattr(bogus_pid, (unsigned long) attr, bogus_flags); + printf("sched_setattr(%d, {size=%u, sched_policy=%#x /* SCHED_??? */, " + "sched_flags=SCHED_FLAG_RESET_ON_FORK|SCHED_FLAG_RECLAIM|" + "SCHED_FLAG_DL_OVERRUN|0x8, " + "sched_nice=%d, sched_priority=%u, sched_runtime=%" PRIu64 ", " + "sched_deadline=%" PRIu64 ", sched_period=%" PRIu64 ", ...}, %u)" + " = %s\n", + (int) bogus_pid, + attr->size, + attr->sched_policy, + attr->sched_nice, + attr->sched_priority, + attr->sched_runtime, + attr->sched_deadline, + attr->sched_period, + (unsigned) bogus_flags, errstr); + + if (F8ILL_KULONG_SUPPORTED) { + const kernel_ulong_t ill = f8ill_ptr_to_kulong(attr); + + sys_sched_getattr(0, ill, sizeof(*attr), 0); + printf("sched_getattr(0, %#llx, %u, 0) = %s\n", + (unsigned long long) ill, (unsigned) sizeof(*attr), + errstr); + + sys_sched_setattr(0, ill, 0); + printf("sched_setattr(0, %#llx, 0) = %s\n", + (unsigned long long) ill, errstr); + } + puts("+++ exited with 0 +++"); return 0; } diff --git a/tests-mx32/sched_xetattr.gen.test b/tests-mx32/sched_xetattr.gen.test new file mode 100755 index 00000000..e4f31c52 --- /dev/null +++ b/tests-mx32/sched_xetattr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched_xetattr -a29 -e trace=sched_getattr,sched_setattr); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a29 -e trace=sched_getattr,sched_setattr diff --git a/tests-mx32/sched_xetattr.test b/tests-mx32/sched_xetattr.test deleted file mode 100755 index c2c7914c..00000000 --- a/tests-mx32/sched_xetattr.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check sched_getattr and sched_setattr syscalls decoding. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -e sched_getattr,sched_setattr $args > "$OUT" -match_grep "$LOG" "$OUT" -rm -f "$OUT" - -exit 0 diff --git a/tests-mx32/sched_xetparam.c b/tests-mx32/sched_xetparam.c index e761a9d0..e1325a6f 100644 --- a/tests-mx32/sched_xetparam.c +++ b/tests-mx32/sched_xetparam.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/sched_xetparam.gen.test b/tests-mx32/sched_xetparam.gen.test new file mode 100755 index 00000000..220ffb26 --- /dev/null +++ b/tests-mx32/sched_xetparam.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched_xetparam -a23 -e trace=sched_getparam,sched_setparam); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 -e trace=sched_getparam,sched_setparam diff --git a/tests-mx32/sched_xetparam.test b/tests-mx32/sched_xetparam.test deleted file mode 100755 index c9fede13..00000000 --- a/tests-mx32/sched_xetparam.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sched_getparam and sched_setparam syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a23 -e trace=sched_getparam,sched_setparam diff --git a/tests-mx32/sched_xetscheduler.c b/tests-mx32/sched_xetscheduler.c index 7faee8cd..bc48085a 100644 --- a/tests-mx32/sched_xetscheduler.c +++ b/tests-mx32/sched_xetscheduler.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -10,7 +17,7 @@ int main(void) { - struct sched_param *const param = tail_alloc(sizeof(struct sched_param)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sched_param, param); long rc = syscall(__NR_sched_getscheduler, 0); const char *scheduler; switch (rc) { diff --git a/tests-mx32/sched_xetscheduler.gen.test b/tests-mx32/sched_xetscheduler.gen.test new file mode 100755 index 00000000..0a800725 --- /dev/null +++ b/tests-mx32/sched_xetscheduler.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched_xetscheduler -a22 -e trace=sched_getscheduler,sched_setscheduler); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -e trace=sched_getscheduler,sched_setscheduler diff --git a/tests-mx32/sched_xetscheduler.test b/tests-mx32/sched_xetscheduler.test deleted file mode 100755 index 07c93f31..00000000 --- a/tests-mx32/sched_xetscheduler.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sched_getscheduler and sched_setscheduler syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a22 -e trace=sched_getscheduler,sched_setscheduler diff --git a/tests-mx32/sched_yield.c b/tests-mx32/sched_yield.c index 355e7e8d..40b55617 100644 --- a/tests-mx32/sched_yield.c +++ b/tests-mx32/sched_yield.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/sched_yield.gen.test b/tests-mx32/sched_yield.gen.test new file mode 100755 index 00000000..4b035fd8 --- /dev/null +++ b/tests-mx32/sched_yield.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched_yield -a14 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests-mx32/sched_yield.test b/tests-mx32/sched_yield.test deleted file mode 100755 index f0c2c303..00000000 --- a/tests-mx32/sched_yield.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sched_yield syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a14 diff --git a/tests-mx32/scm_rights-fd.test b/tests-mx32/scm_rights-fd.test index 8447375f..b053aa82 100755 --- a/tests-mx32/scm_rights-fd.test +++ b/tests-mx32/scm_rights-fd.test @@ -3,29 +3,10 @@ # Check how SCM_RIGHTS and SCM_CREDENTIALS control messages are decoded in -y mode. # # Copyright (c) 2014-2015 Dmitry V. Levin +# Copyright (c) 2014-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -34,22 +15,19 @@ framework_skip_ '/proc/self/fd/ is not available' check_prog mkdir -check_prog rm check_prog seq check_prog touch -dir="$LOG.dir" -rm -rf -- "$dir" -mkdir -- "$dir" || +mkdir dir || framework_skip_ 'failed to create a directory' -file="$dir/$(for i in $(seq 1 127); do echo A; done; echo Z)" +file="dir/$(for i in $(seq 1 127); do echo A; done; echo Z)" touch -- "$file" || framework_skip_ 'failed to create a file' -run_prog ./scm_rights /dev/zero -run_strace -y -x -enetwork $args "$file" +run_prog ../scm_rights /dev/zero +run_strace -y -x -e%network $args "$file" hex='[[:xdigit:]]' n='[1-9][0-9]*' @@ -66,15 +44,9 @@ msg_tail=', msg_controllen='"$n"', msg_flags=0' rights='\{cmsg_len='"$n"', cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, cmsg_data='"$rights_data"'\}' creds='\{cmsg_len='"$n"', cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS, cmsg_data='"$ids"'\}' -EXPECTED="$LOG.expected" - -cat > "$EXPECTED" << __EOF__ +cat > "$EXP" << __EOF__ sendmsg\\(3$socket, $msg_head\\[$rights\\]$msg_tail\\}, 0\\) = 15 recvmsg\\(0$socket, $msg_head\\[$creds, $rights\\]$msg_tail\\}, 0\\) = 15 __EOF__ -match_grep "$LOG" "$EXPECTED" -rm -f "$EXPECTED" -rm -rf -- "$dir" - -exit 0 +match_grep "$LOG" "$EXP" diff --git a/tests-mx32/scm_rights.c b/tests-mx32/scm_rights.c index 42caed7c..f1171064 100644 --- a/tests-mx32/scm_rights.c +++ b/tests-mx32/scm_rights.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -44,11 +25,11 @@ int main(int ac, const char **av) void *data = tail_alloc(data_size); memcpy(data, sample, data_size); - struct iovec *iov = tail_alloc(sizeof(struct iovec)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct iovec, iov); iov->iov_base = data; iov->iov_len = data_size; - struct msghdr *mh = tail_alloc(sizeof(struct msghdr)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct msghdr, mh); memset(mh, 0, sizeof(*mh)); mh->msg_iov = iov; mh->msg_iovlen = 1; diff --git a/tests-mx32/scno_tampering.sh b/tests-mx32/scno_tampering.sh index 6aa78432..8c921dfe 100755 --- a/tests-mx32/scno_tampering.sh +++ b/tests-mx32/scno_tampering.sh @@ -3,29 +3,10 @@ # Skip the test if arch+kernel combination is not supported. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -49,10 +30,17 @@ case "$STRACE_ARCH" in require_min_kernel_version_or_skip 4.5 ;; mips) # Only the native ABI is supported by the kernel properly, see - # https://sourceforge.net/p/strace/mailman/message/35587571/ + # https://lists.strace.io/pipermail/strace-devel/2017-January/005896.html + msg_prefix="mips $MIPS_ABI scno tampering does not work" uname_m="$(uname -m)" case "$MIPS_ABI:$uname_m" in - o32:mips|n64:mips64) ;; - *) skip_ "$MIPS_ABI scno tampering does not work on $uname_m yet" ;; + n64:mips64) ;; + o32:mips) + # is it really mips32? + if ../is_linux_mips_n64; then + skip_ "$msg_prefix on mips n64 yet" + fi + ;; + *) skip_ "$msg_prefix on $uname_m yet" ;; esac ;; esac diff --git a/tests-mx32/seccomp-filter-v.c b/tests-mx32/seccomp-filter-v.c index dbf686d1..98eaeee5 100644 --- a/tests-mx32/seccomp-filter-v.c +++ b/tests-mx32/seccomp-filter-v.c @@ -2,29 +2,10 @@ * Check verbose decoding of seccomp SECCOMP_SET_MODE_FILTER. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -41,9 +22,7 @@ #ifdef HAVE_LINUX_SECCOMP_H # include #endif -#ifdef HAVE_LINUX_FILTER_H -# include -#endif +#include #if defined __NR_seccomp \ && defined PR_SET_NO_NEW_PRIVS \ @@ -52,23 +31,23 @@ && defined BPF_JUMP \ && defined BPF_STMT -#define SOCK_FILTER_ALLOW_SYSCALL(nr) \ +# define SOCK_FILTER_ALLOW_SYSCALL(nr) \ BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW) -#define SOCK_FILTER_DENY_SYSCALL(nr, err) \ +# define SOCK_FILTER_DENY_SYSCALL(nr, err) \ BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|(SECCOMP_RET_DATA & (err))) -#define SOCK_FILTER_KILL_PROCESS \ +# define SOCK_FILTER_KILL_PROCESS \ BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL) -#define PRINT_ALLOW_SYSCALL(nr) \ +# define PRINT_ALLOW_SYSCALL(nr) \ tprintf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW), ", \ __NR_ ## nr) -#define PRINT_DENY_SYSCALL(nr, err) \ +# define PRINT_DENY_SYSCALL(nr, err) \ tprintf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|%#x), ", \ __NR_ ## nr, err) @@ -90,22 +69,18 @@ static const struct sock_filter filter_c[] = { SOCK_FILTER_KILL_PROCESS }; -#ifndef BPF_MAXINSNS -# define BPF_MAXINSNS 4096 -#endif - int main(void) { tprintf("%s", ""); static const char kill_stmt_txt[] = - "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL)"; + "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL_THREAD)"; struct sock_filter *const filter = tail_memdup(filter_c, sizeof(filter_c)); struct sock_filter *const big_filter = tail_alloc(sizeof(*big_filter) * (BPF_MAXINSNS + 1)); - struct sock_fprog *const prog = tail_alloc(sizeof(*prog)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sock_fprog, prog); int fds[2]; if (pipe(fds)) @@ -123,7 +98,7 @@ main(void) prog->len = 3; syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, 0, prog); tprintf("seccomp(SECCOMP_SET_MODE_FILTER, 0, {len=%u" - ", filter=[%s, %p]}) = -1 EFAULT (%m)\n", + ", filter=[%s, ... /* %p */]}) = -1 EFAULT (%m)\n", prog->len, kill_stmt_txt, filter + ARRAY_SIZE(filter_c)); prog->len = 0; @@ -141,11 +116,14 @@ main(void) prog->filter = big_filter; prog->len = BPF_MAXINSNS + 1; tprintf("seccomp(SECCOMP_SET_MODE_FILTER, %s, {len=%u, filter=[", - "SECCOMP_FILTER_FLAG_TSYNC|0xfffffffe", prog->len); + "SECCOMP_FILTER_FLAG_TSYNC|SECCOMP_FILTER_FLAG_LOG|" + "SECCOMP_FILTER_FLAG_SPEC_ALLOW|" + "SECCOMP_FILTER_FLAG_NEW_LISTENER|0xfffffff0", + prog->len); for (i = 0; i < BPF_MAXINSNS; ++i) { if (i) tprintf(", "); - switch(BPF_CLASS(i)) { + switch (BPF_CLASS(i)) { case BPF_LD: tprintf("BPF_STMT(BPF_LD|BPF_W|BPF_IMM, %#x)", i << 16); break; diff --git a/tests-mx32/seccomp-filter-v.gen.test b/tests-mx32/seccomp-filter-v.gen.test new file mode 100755 index 00000000..efce6372 --- /dev/null +++ b/tests-mx32/seccomp-filter-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (seccomp-filter-v -v -e trace=seccomp); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=seccomp diff --git a/tests-mx32/seccomp-filter-v.test b/tests-mx32/seccomp-filter-v.test deleted file mode 100755 index f873eb6f..00000000 --- a/tests-mx32/seccomp-filter-v.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check verbose decoding of seccomp SECCOMP_SET_MODE_FILTER. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -e trace=seccomp diff --git a/tests-mx32/seccomp-filter.c b/tests-mx32/seccomp-filter.c index d4d76dd3..5e28ffca 100644 --- a/tests-mx32/seccomp-filter.c +++ b/tests-mx32/seccomp-filter.c @@ -2,29 +2,10 @@ * Check decoding of seccomp SECCOMP_SET_MODE_FILTER. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,9 +17,7 @@ #ifdef HAVE_LINUX_SECCOMP_H # include #endif -#ifdef HAVE_LINUX_FILTER_H -# include -#endif +#include #if defined __NR_seccomp && defined SECCOMP_SET_MODE_FILTER @@ -49,19 +28,22 @@ main(void) { struct sock_filter *const filter = tail_alloc(sizeof(*filter) * N); const void *const efault = tail_alloc(1); - struct sock_fprog *const prog = tail_alloc(sizeof(*prog)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sock_fprog, prog); long rc; prog->filter = filter; prog->len = N; rc = syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, -1, prog); printf("seccomp(SECCOMP_SET_MODE_FILTER, %s, {len=%u, filter=%p})" - " = %ld %s (%m)\n", "SECCOMP_FILTER_FLAG_TSYNC|0xfffffffe", + " = %ld %s (%m)\n", + "SECCOMP_FILTER_FLAG_TSYNC|SECCOMP_FILTER_FLAG_LOG|" + "SECCOMP_FILTER_FLAG_SPEC_ALLOW|" + "SECCOMP_FILTER_FLAG_NEW_LISTENER|0xfffffff0", prog->len, prog->filter, rc, errno2name()); - rc = syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, -2L, efault); + rc = syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, -16L, efault); printf("seccomp(SECCOMP_SET_MODE_FILTER, %s, %p) = %ld %s (%m)\n", - "0xfffffffe /* SECCOMP_FILTER_FLAG_??? */", + "0xfffffff0 /* SECCOMP_FILTER_FLAG_??? */", efault, rc, errno2name()); puts("+++ exited with 0 +++"); diff --git a/tests-mx32/seccomp-filter.gen.test b/tests-mx32/seccomp-filter.gen.test new file mode 100755 index 00000000..52af0d54 --- /dev/null +++ b/tests-mx32/seccomp-filter.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (seccomp-filter -e trace=seccomp); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=seccomp diff --git a/tests-mx32/seccomp-filter.test b/tests-mx32/seccomp-filter.test deleted file mode 100755 index 65c6d495..00000000 --- a/tests-mx32/seccomp-filter.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of seccomp SECCOMP_SET_MODE_FILTER. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=seccomp diff --git a/tests-mx32/seccomp-strict.c b/tests-mx32/seccomp-strict.c index 237b0eca..1d088109 100644 --- a/tests-mx32/seccomp-strict.c +++ b/tests-mx32/seccomp-strict.c @@ -1,30 +1,10 @@ /* * Check how seccomp SECCOMP_SET_MODE_STRICT is decoded. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/seccomp-strict.test b/tests-mx32/seccomp-strict.test index b354c6a2..3525e20c 100755 --- a/tests-mx32/seccomp-strict.test +++ b/tests-mx32/seccomp-strict.test @@ -1,10 +1,15 @@ #!/bin/sh - +# # Check how seccomp SECCOMP_SET_MODE_STRICT is decoded. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -set -- "./$NAME" +set -- "../$NAME" "$@" > /dev/null || { case $? in 77) skip_ "$* exited with code 77" ;; @@ -14,4 +19,3 @@ set -- "./$NAME" } run_strace -eseccomp "$@" > "$EXP" match_diff "$LOG" "$EXP" -rm -f "$EXP" diff --git a/tests-mx32/seccomp_get_action_avail.c b/tests-mx32/seccomp_get_action_avail.c new file mode 100644 index 00000000..e61678f4 --- /dev/null +++ b/tests-mx32/seccomp_get_action_avail.c @@ -0,0 +1,108 @@ +/* + * Check decoding of seccomp SECCOMP_GET_ACTION_AVAIL. + * + * Copyright (c) 2017-2019 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_seccomp + +# include +# include +# include + +# ifdef HAVE_LINUX_SECCOMP_H +# include +# endif + +# ifndef SECCOMP_GET_ACTION_AVAIL +# define SECCOMP_GET_ACTION_AVAIL 2 +# endif + +static const char *errstr; + +static long +k_seccomp(const kernel_ulong_t op, const kernel_ulong_t flags, + const kernel_ulong_t args) +{ + const long rc = syscall(__NR_seccomp, op, flags, args); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(uint32_t, act); + kernel_ulong_t op = (kernel_ulong_t) 0xfacefeed00000000ULL + | SECCOMP_GET_ACTION_AVAIL; + kernel_ulong_t flags = (kernel_ulong_t) 0xdeadbeef00000000ULL; + unsigned int i; + + struct { + uint32_t val; + const char *str; + } actions [] = { + { 0, "SECCOMP_RET_KILL_THREAD" }, +# ifdef SECCOMP_RET_KILL_PROCESS + { ARG_STR(SECCOMP_RET_KILL_PROCESS) }, +# endif +# ifdef SECCOMP_RET_TRAP + { ARG_STR(SECCOMP_RET_TRAP) }, +# endif +# ifdef SECCOMP_RET_ERRNO + { ARG_STR(SECCOMP_RET_ERRNO) }, +# endif +# ifdef SECCOMP_RET_USER_NOTIF + { ARG_STR(SECCOMP_RET_USER_NOTIF) }, +# endif +# ifdef SECCOMP_RET_TRACE + { ARG_STR(SECCOMP_RET_TRACE) }, +# endif +# ifdef SECCOMP_RET_LOG + { ARG_STR(SECCOMP_RET_LOG) }, +# endif +# ifdef SECCOMP_RET_ALLOW + { ARG_STR(SECCOMP_RET_ALLOW) }, +# endif + { 0xffffffff, "0xffffffff /* SECCOMP_RET_??? */" } + }; + + for (i = 0; i < ARRAY_SIZE(actions); ++i) { + *act = actions[i].val; + k_seccomp(op, flags, (uintptr_t) act); + printf("seccomp(SECCOMP_GET_ACTION_AVAIL, 0, [%s]) = %s\n", + actions[i].str, errstr); + } + + *act = actions[0].val; + + k_seccomp(op, flags, (uintptr_t) (act + 1)); + printf("seccomp(SECCOMP_GET_ACTION_AVAIL, 0, %p) = %s\n", + act + 1, errstr); + + if (F8ILL_KULONG_SUPPORTED) { + k_seccomp(op, flags, f8ill_ptr_to_kulong(act)); + printf("seccomp(SECCOMP_GET_ACTION_AVAIL, 0, %#jx) = %s\n", + (uintmax_t) f8ill_ptr_to_kulong(act), errstr); + } + + flags |= 0xcafef00d; + k_seccomp(op, flags, 0); + printf("seccomp(SECCOMP_GET_ACTION_AVAIL, %u, NULL) = %s\n", + (unsigned int) flags, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_seccomp") + +#endif diff --git a/tests-mx32/seccomp_get_action_avail.gen.test b/tests-mx32/seccomp_get_action_avail.gen.test new file mode 100755 index 00000000..49974510 --- /dev/null +++ b/tests-mx32/seccomp_get_action_avail.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (seccomp_get_action_avail -e trace=seccomp); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=seccomp diff --git a/tests-mx32/select-P.c b/tests-mx32/select-P.c new file mode 100644 index 00000000..868deed6 --- /dev/null +++ b/tests-mx32/select-P.c @@ -0,0 +1,2 @@ +#define PATH_TRACING_FD 9 +#include "select.c" diff --git a/tests-mx32/select-P.gen.test b/tests-mx32/select-P.gen.test new file mode 100755 index 00000000..2f6fc7bc --- /dev/null +++ b/tests-mx32/select-P.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (select-P -a36 -e trace=select -P /dev/full 9>>/dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 -e trace=select -P /dev/full 9>>/dev/full diff --git a/tests-mx32/select.c b/tests-mx32/select.c index b5ff259d..7935032b 100644 --- a/tests-mx32/select.c +++ b/tests-mx32/select.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/select.gen.test b/tests-mx32/select.gen.test new file mode 100755 index 00000000..23836149 --- /dev/null +++ b/tests-mx32/select.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (select -a36 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests-mx32/select.test b/tests-mx32/select.test deleted file mode 100755 index 60b88caf..00000000 --- a/tests-mx32/select.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check select syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a36 diff --git a/tests-mx32/semop.c b/tests-mx32/semop.c index a2ff2635..f7f04701 100644 --- a/tests-mx32/semop.c +++ b/tests-mx32/semop.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include @@ -9,8 +16,7 @@ #include "xlat.h" #include "xlat/semop_flags.h" -union semun -{ +union semun { int val; struct semid_ds *buf; unsigned short *array; @@ -33,9 +39,7 @@ main(void) static void * const bogus_sops = (void *) -1L; static const size_t bogus_nsops = (size_t) 0xdefaceddeadbeefULL; - static const struct timespec ts_data = { 1, 123456789 }; - - struct timespec *ts = tail_memdup(&ts_data, sizeof(*ts)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, ts); int rc; id = semget(IPC_PRIVATE, 1, 0600); @@ -47,8 +51,8 @@ main(void) if (semctl(id, 0, SETVAL, sem_union) == -1) perror_msg_and_skip("semctl"); - struct sembuf *const sem_b = tail_alloc(sizeof(*sem_b)); - struct sembuf *const sem_b2 = tail_alloc(sizeof(*sem_b2)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sembuf, sem_b); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sembuf, sem_b2); rc = semop(bogus_semid, NULL, bogus_nsops); printf("semop(%d, NULL, %u) = %s\n", @@ -67,11 +71,11 @@ main(void) sem_b2->sem_flg = 0xbeef; rc = semop(bogus_semid, sem_b2, 2); - printf("semop(%d, [{%hu, %hd, %s%s%#hx}, %p], %u) = %s\n", + printf("semop(%d, [{%hu, %hd, %s%s%#hx}, ... /* %p */], %u) = %s\n", bogus_semid, sem_b2->sem_num, sem_b2->sem_op, sem_b2->sem_flg & SEM_UNDO ? "SEM_UNDO|" : "", sem_b2->sem_flg & IPC_NOWAIT ? "IPC_NOWAIT|" : "", - sem_b2->sem_flg & ~(SEM_UNDO | IPC_NOWAIT), + (short) (sem_b2->sem_flg & ~(SEM_UNDO | IPC_NOWAIT)), sem_b2 + 1, 2, sprintrc(rc)); if (semop(id, sem_b, 1)) @@ -91,15 +95,17 @@ main(void) printf("semtimedop(%d, %p, 1, %p) = %s\n", id, sem_b + 1, ts + 1, sprintrc(rc)); + ts->tv_sec = 1; + ts->tv_nsec = 123456789; rc = semtimedop(bogus_semid, sem_b2, 2, ts); - printf("semtimedop(%d, [{%hu, %hd, %s%s%#hx}, %p], %u, " - "{tv_sec=%jd, tv_nsec=%jd}) = %s\n", + printf("semtimedop(%d, [{%hu, %hd, %s%s%#hx}, ... /* %p */], %u" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", bogus_semid, sem_b2->sem_num, sem_b2->sem_op, sem_b2->sem_flg & SEM_UNDO ? "SEM_UNDO|" : "", sem_b2->sem_flg & IPC_NOWAIT ? "IPC_NOWAIT|" : "", - sem_b2->sem_flg & ~(SEM_UNDO | IPC_NOWAIT), + (short) (sem_b2->sem_flg & ~(SEM_UNDO | IPC_NOWAIT)), sem_b2 + 1, 2, - (intmax_t) ts->tv_sec, (intmax_t) ts->tv_nsec, + (long long) ts->tv_sec, zero_extend_signed_to_ull(ts->tv_nsec), sprintrc(rc)); sem_b->sem_op = 1; @@ -110,9 +116,27 @@ main(void) sem_b->sem_op = -1; if (semtimedop(id, sem_b, 1, ts)) perror_msg_and_skip("semtimedop, -1"); - printf("semtimedop(%d, [{0, -1, SEM_UNDO}], 1, " - "{tv_sec=%jd, tv_nsec=%jd}) = 0\n", id, - (intmax_t) ts->tv_sec, (intmax_t) ts->tv_nsec); + printf("semtimedop(%d, [{0, -1, SEM_UNDO}], 1" + ", {tv_sec=%lld, tv_nsec=%llu}) = 0\n", id, + (long long) ts->tv_sec, zero_extend_signed_to_ull(ts->tv_nsec)); + + sem_b->sem_op = 1; + ts->tv_sec = 0xdeadbeefU; + ts->tv_nsec = 0xfacefeedU; + rc = semtimedop(id, sem_b, 1, ts); + printf("semtimedop(%d, [{0, 1, SEM_UNDO}], 1" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + id, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), sprintrc(rc)); + + sem_b->sem_op = -1; + ts->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + ts->tv_nsec = (long) 0xbadc0dedfacefeedLL; + rc = semtimedop(id, sem_b, 1, ts); + printf("semtimedop(%d, [{0, -1, SEM_UNDO}], 1" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + id, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), sprintrc(rc)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/semop.gen.test b/tests-mx32/semop.gen.test new file mode 100755 index 00000000..21b67ead --- /dev/null +++ b/tests-mx32/semop.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (semop -a32 -e trace=semop,semtimedop); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -e trace=semop,semtimedop diff --git a/tests-mx32/semop.test b/tests-mx32/semop.test deleted file mode 100755 index 3e77d2f9..00000000 --- a/tests-mx32/semop.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check semop syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a32 -e trace=semop,semtimedop diff --git a/tests-mx32/sendfile.c b/tests-mx32/sendfile.c index 23f096b6..6ef3232e 100644 --- a/tests-mx32/sendfile.c +++ b/tests-mx32/sendfile.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -35,15 +16,13 @@ # include # include # include +# include # include # include -# include int -main(int ac, const char **av) +main(void) { - assert(ac == 1); - (void) close(0); if (open("/dev/zero", O_RDONLY) != 0) perror_msg_and_skip("open: %s", "/dev/zero"); @@ -52,58 +31,62 @@ main(int ac, const char **av) if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) perror_msg_and_skip("socketpair"); - int reg_in = open(av[0], O_RDONLY); - if (reg_in < 0) - perror_msg_and_fail("open: %s", av[0]); - - struct stat stb; - assert(fstat(reg_in, &stb) == 0); - const size_t blen = stb.st_size / 3; - const size_t alen = stb.st_size - blen; - assert(S_ISREG(stb.st_mode) && blen > 0); - - const size_t page_len = get_page_size(); - assert(syscall(__NR_sendfile, 0, 1, NULL, page_len) == -1); + const unsigned int page_size = get_page_size(); + assert(syscall(__NR_sendfile, 0, 1, NULL, page_size) == -1); if (EBADF != errno) perror_msg_and_skip("sendfile"); - printf("sendfile(0, 1, NULL, %lu) = -1 EBADF (%m)\n", - (unsigned long) page_len); + printf("sendfile(0, 1, NULL, %u) = -1 EBADF (%m)\n", page_size); + + unsigned int file_size = 0; + socklen_t optlen = sizeof(file_size); + if (getsockopt(sv[1], SOL_SOCKET, SO_SNDBUF, &file_size, &optlen)) + perror_msg_and_fail("getsockopt"); + if (file_size < 1024) + error_msg_and_skip("SO_SNDBUF too small: %u", file_size); + + file_size /= 4; + if (file_size / 16 > page_size) + file_size = page_size * 16; + const unsigned int blen = file_size / 3; + const unsigned int alen = file_size - blen; + + static const char fname[] = "sendfile-tmpfile"; + int reg_in = open(fname, O_RDWR | O_CREAT | O_TRUNC, 0600); + if (reg_in < 0) + perror_msg_and_fail("open: %s", fname); + if (unlink(fname)) + perror_msg_and_fail("unlink: %s", fname); + if (ftruncate(reg_in, file_size)) + perror_msg_and_fail("ftruncate: %s", fname); - uint32_t *p_off = tail_alloc(sizeof(uint32_t)); + TAIL_ALLOC_OBJECT_VAR_PTR(uint32_t, p_off); void *p = p_off + 1; *p_off = 0; - assert(syscall(__NR_sendfile, 0, 1, p, page_len) == -1); - printf("sendfile(0, 1, %#lx, %lu) = -1 EFAULT (%m)\n", - (unsigned long) p, (unsigned long) page_len); + assert(syscall(__NR_sendfile, 0, 1, p, page_size) == -1); + printf("sendfile(0, 1, %p, %u) = -1 EFAULT (%m)\n", p, page_size); assert(syscall(__NR_sendfile, sv[1], reg_in, NULL, alen) == (long) alen); - printf("sendfile(%d, %d, NULL, %lu) = %lu\n", - sv[1], reg_in, (unsigned long) alen, - (unsigned long) alen); + printf("sendfile(%d, %d, NULL, %u) = %u\n", + sv[1], reg_in, alen, alen); p = p_off; if (syscall(__NR_sendfile, sv[1], reg_in, p_off, alen) != (long) alen) { - printf("sendfile(%d, %d, %#lx, %lu) = -1 EFAULT (%m)\n", - sv[1], reg_in, (unsigned long) p_off, - (unsigned long) alen); + printf("sendfile(%d, %d, %#lx, %u) = -1 EFAULT (%m)\n", + sv[1], reg_in, (unsigned long) p_off, alen); --p_off; *p_off = 0; assert(syscall(__NR_sendfile, sv[1], reg_in, p_off, alen) == (long) alen); } - printf("sendfile(%d, %d, [0] => [%lu], %lu) = %lu\n", - sv[1], reg_in, (unsigned long) alen, - (unsigned long) alen, (unsigned long) alen); + printf("sendfile(%d, %d, [0] => [%u], %u) = %u\n", + sv[1], reg_in, alen, alen, alen); - assert(syscall(__NR_sendfile, sv[1], reg_in, p_off, stb.st_size + 1) + assert(syscall(__NR_sendfile, sv[1], reg_in, p_off, file_size + 1) == (long) blen); - printf("sendfile(%d, %d, [%lu] => [%lu], %lu) = %lu\n", - sv[1], reg_in, (unsigned long) alen, - (unsigned long) stb.st_size, - (unsigned long) stb.st_size + 1, - (unsigned long) blen); + printf("sendfile(%d, %d, [%u] => [%u], %u) = %u\n", + sv[1], reg_in, alen, file_size, file_size + 1, blen); if (p_off != p) { uint64_t *p_off64 = (uint64_t *) p_off; diff --git a/tests-mx32/sendfile.gen.test b/tests-mx32/sendfile.gen.test new file mode 100755 index 00000000..d32ef3ad --- /dev/null +++ b/tests-mx32/sendfile.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sendfile -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-mx32/sendfile.test b/tests-mx32/sendfile.test deleted file mode 100755 index 48dba585..00000000 --- a/tests-mx32/sendfile.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sendfile syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests-mx32/sendfile64.c b/tests-mx32/sendfile64.c index 7208c300..c318ace8 100644 --- a/tests-mx32/sendfile64.c +++ b/tests-mx32/sendfile64.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -35,15 +16,13 @@ # include # include # include +# include # include # include -# include int -main(int ac, const char **av) +main(void) { - assert(ac == 1); - (void) close(0); if (open("/dev/zero", O_RDONLY) != 0) perror_msg_and_skip("open: %s", "/dev/zero"); @@ -52,50 +31,55 @@ main(int ac, const char **av) if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) perror_msg_and_skip("socketpair"); - int reg_in = open(av[0], O_RDONLY); - if (reg_in < 0) - perror_msg_and_fail("open: %s", av[0]); - - struct stat stb; - assert(fstat(reg_in, &stb) == 0); - const size_t blen = stb.st_size / 3; - const size_t alen = stb.st_size - blen; - assert(S_ISREG(stb.st_mode) && blen > 0); - - const size_t page_len = get_page_size(); - assert(syscall(__NR_sendfile64, 0, 1, NULL, page_len) == -1); + const unsigned int page_size = get_page_size(); + assert(syscall(__NR_sendfile64, 0, 1, NULL, page_size) == -1); if (EBADF != errno) perror_msg_and_skip("sendfile64"); - printf("sendfile64(0, 1, NULL, %lu) = -1 EBADF (%m)\n", - (unsigned long) page_len); + printf("sendfile64(0, 1, NULL, %u) = -1 EBADF (%m)\n", page_size); + + unsigned int file_size = 0; + socklen_t optlen = sizeof(file_size); + if (getsockopt(sv[1], SOL_SOCKET, SO_SNDBUF, &file_size, &optlen)) + perror_msg_and_fail("getsockopt"); + if (file_size < 1024) + error_msg_and_skip("SO_SNDBUF too small: %u", file_size); + + file_size /= 4; + if (file_size / 16 > page_size) + file_size = page_size * 16; + const unsigned int blen = file_size / 3; + const unsigned int alen = file_size - blen; + + static const char fname[] = "sendfile64-tmpfile"; + int reg_in = open(fname, O_RDWR | O_CREAT | O_TRUNC, 0600); + if (reg_in < 0) + perror_msg_and_fail("open: %s", fname); + if (unlink(fname)) + perror_msg_and_fail("unlink: %s", fname); + if (ftruncate(reg_in, file_size)) + perror_msg_and_fail("ftruncate: %s", fname); - uint64_t *p_off = tail_alloc(sizeof(uint64_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(uint64_t, p_off); void *p = p_off + 1; *p_off = 0; - assert(syscall(__NR_sendfile64, 0, 1, p, page_len) == -1); - printf("sendfile64(0, 1, %#lx, %lu) = -1 EFAULT (%m)\n", - (unsigned long) p, (unsigned long) page_len); + assert(syscall(__NR_sendfile64, 0, 1, p, page_size) == -1); + printf("sendfile64(0, 1, %p, %u) = -1 EFAULT (%m)\n", p, page_size); assert(syscall(__NR_sendfile64, sv[1], reg_in, NULL, alen) == (long) alen); - printf("sendfile64(%d, %d, NULL, %lu) = %lu\n", - sv[1], reg_in, (unsigned long) alen, - (unsigned long) alen); + printf("sendfile64(%d, %d, NULL, %u) = %u\n", + sv[1], reg_in, alen, alen); assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, alen) == (long) alen); - printf("sendfile64(%d, %d, [0] => [%lu], %lu) = %lu\n", - sv[1], reg_in, (unsigned long) alen, - (unsigned long) alen, (unsigned long) alen); + printf("sendfile64(%d, %d, [0] => [%u], %u) = %u\n", + sv[1], reg_in, alen, alen, alen); - assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, stb.st_size + 1) + assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, file_size + 1) == (long) blen); - printf("sendfile64(%d, %d, [%lu] => [%lu], %lu) = %lu\n", - sv[1], reg_in, (unsigned long) alen, - (unsigned long) stb.st_size, - (unsigned long) stb.st_size + 1, - (unsigned long) blen); + printf("sendfile64(%d, %d, [%u] => [%u], %u) = %u\n", + sv[1], reg_in, alen, file_size, file_size + 1, blen); *p_off = 0xcafef00dfacefeedULL; assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, 1) == -1); diff --git a/tests-mx32/sendfile64.gen.test b/tests-mx32/sendfile64.gen.test new file mode 100755 index 00000000..24f0746f --- /dev/null +++ b/tests-mx32/sendfile64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sendfile64 -a29 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a29 diff --git a/tests-mx32/sendfile64.test b/tests-mx32/sendfile64.test deleted file mode 100755 index faa05254..00000000 --- a/tests-mx32/sendfile64.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sendfile64 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a29 diff --git a/tests-mx32/set_mempolicy.c b/tests-mx32/set_mempolicy.c index f3261a09..46703713 100644 --- a/tests-mx32/set_mempolicy.c +++ b/tests-mx32/set_mempolicy.c @@ -2,29 +2,10 @@ * Check decoding of set_mempolicy syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -76,7 +57,7 @@ print_nodes(const unsigned long maxnode, unsigned int offset) printf("%#0*lx", (int) sizeof(long) * 2 + 2, nodemask[i]); } else { - printf("%p", nodemask + i); + printf("... /* %p */", nodemask + i); break; } } diff --git a/tests-mx32/set_mempolicy.gen.test b/tests-mx32/set_mempolicy.gen.test new file mode 100755 index 00000000..f8c81c75 --- /dev/null +++ b/tests-mx32/set_mempolicy.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (set_mempolicy -s3 -a35); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 -a35 diff --git a/tests-mx32/set_mempolicy.test b/tests-mx32/set_mempolicy.test deleted file mode 100755 index 0ed6666c..00000000 --- a/tests-mx32/set_mempolicy.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check set_mempolicy syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s3 -a35 diff --git a/tests-mx32/set_ptracer_any.c b/tests-mx32/set_ptracer_any.c index bc2f90ca..747359c2 100644 --- a/tests-mx32/set_ptracer_any.c +++ b/tests-mx32/set_ptracer_any.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2013-2015 Dmitry V. Levin + * Copyright (c) 2013-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,10 +17,16 @@ int main(int argc, char **argv) { if (argc < 2) return 99; -#if defined HAVE_PRCTL && defined PR_SET_PTRACER && defined PR_SET_PTRACER_ANY - /* Turn off restrictions on tracing if applicable. If the options +#ifdef HAVE_PRCTL + /* Turn off restrictions on tracing if applicable. If the command * aren't available on this system, that's OK too. */ - (void) prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY); +# ifndef PR_SET_PTRACER +# define PR_SET_PTRACER 0x59616d61 +# endif +# ifndef PR_SET_PTRACER_ANY +# define PR_SET_PTRACER_ANY -1UL +# endif + (void) prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0); #endif if (write(1, "\n", 1) != 1) { perror("write"); diff --git a/tests-mx32/set_sigblock.c b/tests-mx32/set_sigblock.c new file mode 100644 index 00000000..6ac1bedd --- /dev/null +++ b/tests-mx32/set_sigblock.c @@ -0,0 +1,33 @@ +/* + * Execute a command with the specified signal blocked/unblocked. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +int +main(int ac, char **av) +{ + if (ac < 4) + error_msg_and_fail("usage: set_sigblock 0|1 signum path..."); + + const int block = atoi(av[1]); + const int signum = atoi(av[2]); + sigset_t mask; + + sigemptyset(&mask); + if (sigaddset(&mask, signum)) + perror_msg_and_fail("sigaddset: %s", av[2]); + if (sigprocmask(block ? SIG_BLOCK : SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + execvp(av[3], av + 3); + perror_msg_and_fail("execvp: %s", av[3]); +} diff --git a/tests-mx32/set_sigign.c b/tests-mx32/set_sigign.c new file mode 100644 index 00000000..faf5a741 --- /dev/null +++ b/tests-mx32/set_sigign.c @@ -0,0 +1,29 @@ +/* + * Execute a command with a signal handler set to SIG_IGN/SIG_DFL. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +int +main(int ac, char **av) +{ + if (ac < 4) + error_msg_and_fail("usage: set_sigign 0|1 signum path..."); + + const int ign = atoi(av[1]); + const int signum = atoi(av[2]); + + if (signal(signum, ign ? SIG_IGN : SIG_DFL) == SIG_ERR) + perror_msg_and_fail("signal: %s", av[2]); + + execvp(av[3], av + 3); + perror_msg_and_fail("execvp: %s", av[3]); +} diff --git a/tests-mx32/setdomainname.c b/tests-mx32/setdomainname.c index f3e24840..177c0fd7 100644 --- a/tests-mx32/setdomainname.c +++ b/tests-mx32/setdomainname.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/setdomainname.gen.test b/tests-mx32/setdomainname.gen.test new file mode 100755 index 00000000..1f29563f --- /dev/null +++ b/tests-mx32/setdomainname.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setdomainname -a24 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-mx32/setdomainname.test b/tests-mx32/setdomainname.test deleted file mode 100755 index 2159e7c4..00000000 --- a/tests-mx32/setdomainname.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setdomainname syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 diff --git a/tests-mx32/setfsgid.c b/tests-mx32/setfsgid.c index 871f4b35..496b2679 100644 --- a/tests-mx32/setfsgid.c +++ b/tests-mx32/setfsgid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/setfsgid.gen.test b/tests-mx32/setfsgid.gen.test new file mode 100755 index 00000000..bbb30cc1 --- /dev/null +++ b/tests-mx32/setfsgid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setfsgid -a12 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests-mx32/setfsgid.test b/tests-mx32/setfsgid.test deleted file mode 100755 index 0ae2b0a2..00000000 --- a/tests-mx32/setfsgid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setfsgid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a12 diff --git a/tests-mx32/setfsgid32.c b/tests-mx32/setfsgid32.c index 6279abd3..a931602c 100644 --- a/tests-mx32/setfsgid32.c +++ b/tests-mx32/setfsgid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/setfsgid32.gen.test b/tests-mx32/setfsgid32.gen.test new file mode 100755 index 00000000..63b3eca0 --- /dev/null +++ b/tests-mx32/setfsgid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setfsgid32 -a14 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests-mx32/setfsgid32.test b/tests-mx32/setfsgid32.test deleted file mode 100755 index 9b7a2bf8..00000000 --- a/tests-mx32/setfsgid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setfsgid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a14 diff --git a/tests-mx32/setfsugid.c b/tests-mx32/setfsugid.c index 79ba34d8..0447544a 100644 --- a/tests-mx32/setfsugid.c +++ b/tests-mx32/setfsugid.c @@ -2,29 +2,10 @@ * Check decoding of setfsuid/setfsgid/setfsuid32/setfsgid32 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -47,7 +28,7 @@ main(void) const kernel_ulong_t tests[] = { ugid, 0xffff0000U | ugid, - (kernel_ulong_t) 0xffffffff00000000ULL | ugid, + F8ILL_KULONG_MASK | ugid, 0xffffU, -1U, -1L, diff --git a/tests-mx32/setfsuid.c b/tests-mx32/setfsuid.c index d6faf971..269d38f2 100644 --- a/tests-mx32/setfsuid.c +++ b/tests-mx32/setfsuid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/setfsuid.gen.test b/tests-mx32/setfsuid.gen.test new file mode 100755 index 00000000..5896b303 --- /dev/null +++ b/tests-mx32/setfsuid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setfsuid -a12 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests-mx32/setfsuid.test b/tests-mx32/setfsuid.test deleted file mode 100755 index 18a10219..00000000 --- a/tests-mx32/setfsuid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setfsuid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a12 diff --git a/tests-mx32/setfsuid32.c b/tests-mx32/setfsuid32.c index b71cf235..cfcc0f83 100644 --- a/tests-mx32/setfsuid32.c +++ b/tests-mx32/setfsuid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/setfsuid32.gen.test b/tests-mx32/setfsuid32.gen.test new file mode 100755 index 00000000..52d0820f --- /dev/null +++ b/tests-mx32/setfsuid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setfsuid32 -a14 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests-mx32/setfsuid32.test b/tests-mx32/setfsuid32.test deleted file mode 100755 index 2dce3cc9..00000000 --- a/tests-mx32/setfsuid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setfsuid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a14 diff --git a/tests-mx32/setgid.c b/tests-mx32/setgid.c index 8794a0a4..3374924a 100644 --- a/tests-mx32/setgid.c +++ b/tests-mx32/setgid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/setgid.gen.test b/tests-mx32/setgid.gen.test new file mode 100755 index 00000000..be188d1f --- /dev/null +++ b/tests-mx32/setgid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setgid -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-mx32/setgid.test b/tests-mx32/setgid.test deleted file mode 100755 index a3a90041..00000000 --- a/tests-mx32/setgid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setgid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 diff --git a/tests-mx32/setgid32.c b/tests-mx32/setgid32.c index 17f43c58..427c77b0 100644 --- a/tests-mx32/setgid32.c +++ b/tests-mx32/setgid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/setgid32.gen.test b/tests-mx32/setgid32.gen.test new file mode 100755 index 00000000..9020b809 --- /dev/null +++ b/tests-mx32/setgid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setgid32 -a12 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests-mx32/setgid32.test b/tests-mx32/setgid32.test deleted file mode 100755 index 11a87e12..00000000 --- a/tests-mx32/setgid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setgid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a12 diff --git a/tests-mx32/setgroups.c b/tests-mx32/setgroups.c index 1ec8333f..a47f1024 100644 --- a/tests-mx32/setgroups.c +++ b/tests-mx32/setgroups.c @@ -2,29 +2,10 @@ * Check decoding of setgroups/setgroups32 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifdef __NR_setgroups32 @@ -75,7 +56,7 @@ main(void) long rc = syscall(SYSCALL_NR, 0, 0); printf("%s(0, NULL) = %s\n", SYSCALL_NAME, sprintrc(rc)); - rc = syscall(SYSCALL_NR, (long) 0xffffffff00000000ULL, 0); + rc = syscall(SYSCALL_NR, F8ILL_KULONG_MASK, 0); printf("%s(0, NULL) = %s\n", SYSCALL_NAME, sprintrc(rc)); rc = syscall(SYSCALL_NR, 1, 0); @@ -91,7 +72,7 @@ main(void) printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, -1, sprintrc(rc)); /* check how the second argument is decoded */ - const GID_TYPE *const g1 = tail_alloc(sizeof(*g1)); + TAIL_ALLOC_OBJECT_CONST_PTR(const GID_TYPE, g1); GID_TYPE *const g2 = tail_alloc(sizeof(*g2) * 2); GID_TYPE *const g3 = tail_alloc(sizeof(*g3) * 3); @@ -114,7 +95,7 @@ main(void) errstr = sprintrc(rc); printf("%s(2, [", SYSCALL_NAME); printuid(*g1); - printf(", %p]) = %s\n", g1 + 1, errstr); + printf(", ... /* %p */]) = %s\n", g1 + 1, errstr); g2[0] = -2; g2[1] = -3; @@ -132,7 +113,7 @@ main(void) printuid(g2[0]); printf(", "); printuid(g2[1]); - printf(", %p]) = %s\n", g2 + 2, errstr); + printf(", ... /* %p */]) = %s\n", g2 + 2, errstr); g3[0] = 0; g3[1] = 1; @@ -164,9 +145,7 @@ main(void) printuid(g3[1]); printf(", ...]) = %s\n", errstr); - const unsigned long size = - (unsigned long) 0xffffffff00000000ULL | ngroups_max; - rc = syscall(SYSCALL_NR, size, g3); + rc = syscall(SYSCALL_NR, F8ILL_KULONG_MASK | ngroups_max, g3); errstr = sprintrc(rc); printf("%s(%d, [", SYSCALL_NAME, ngroups_max); printuid(g3[0]); diff --git a/tests-mx32/setgroups.gen.test b/tests-mx32/setgroups.gen.test new file mode 100755 index 00000000..01ec2e71 --- /dev/null +++ b/tests-mx32/setgroups.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setgroups -s2 -a17); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s2 -a17 diff --git a/tests-mx32/setgroups.test b/tests-mx32/setgroups.test deleted file mode 100755 index 0dcc8f75..00000000 --- a/tests-mx32/setgroups.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setgroups syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s2 -a17 diff --git a/tests-mx32/setgroups32.c b/tests-mx32/setgroups32.c index ecf00bbd..935b73a9 100644 --- a/tests-mx32/setgroups32.c +++ b/tests-mx32/setgroups32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/setgroups32.gen.test b/tests-mx32/setgroups32.gen.test new file mode 100755 index 00000000..e9e70ad3 --- /dev/null +++ b/tests-mx32/setgroups32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setgroups32 -s2 -a19); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s2 -a19 diff --git a/tests-mx32/setgroups32.test b/tests-mx32/setgroups32.test deleted file mode 100755 index ee4750d1..00000000 --- a/tests-mx32/setgroups32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setgroups32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s2 -a19 diff --git a/tests-mx32/sethostname.c b/tests-mx32/sethostname.c index e1b2f069..c9b89c12 100644 --- a/tests-mx32/sethostname.c +++ b/tests-mx32/sethostname.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Fei Jie * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,13 +17,13 @@ # include # include -#ifdef HAVE_LINUX_UTSNAME_H -# include -#endif +# ifdef HAVE_LINUX_UTSNAME_H +# include +# endif -#ifndef __NEW_UTS_LEN -# define __NEW_UTS_LEN 64 -#endif +# ifndef __NEW_UTS_LEN +# define __NEW_UTS_LEN 64 +# endif int main(void) diff --git a/tests-mx32/sethostname.gen.test b/tests-mx32/sethostname.gen.test new file mode 100755 index 00000000..d68ed189 --- /dev/null +++ b/tests-mx32/sethostname.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sethostname -a22 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests-mx32/sethostname.test b/tests-mx32/sethostname.test deleted file mode 100755 index 78f8c58e..00000000 --- a/tests-mx32/sethostname.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sethostname syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a22 diff --git a/tests-mx32/setns.c b/tests-mx32/setns.c index 54a15317..8ef7a19b 100644 --- a/tests-mx32/setns.c +++ b/tests-mx32/setns.c @@ -2,29 +2,10 @@ * Check decoding of setns syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/setns.gen.test b/tests-mx32/setns.gen.test new file mode 100755 index 00000000..e25738bf --- /dev/null +++ b/tests-mx32/setns.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setns -a21 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests-mx32/setns.test b/tests-mx32/setns.test deleted file mode 100755 index e9a905ab..00000000 --- a/tests-mx32/setns.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of setns syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a21 diff --git a/tests-mx32/setregid.c b/tests-mx32/setregid.c index e1da7862..68639e6a 100644 --- a/tests-mx32/setregid.c +++ b/tests-mx32/setregid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/setregid.gen.test b/tests-mx32/setregid.gen.test new file mode 100755 index 00000000..f84b1acb --- /dev/null +++ b/tests-mx32/setregid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setregid -a15 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests-mx32/setregid.test b/tests-mx32/setregid.test deleted file mode 100755 index 101c7bdf..00000000 --- a/tests-mx32/setregid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setregid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a15 diff --git a/tests-mx32/setregid32.c b/tests-mx32/setregid32.c index 3cf0daf6..6291bc58 100644 --- a/tests-mx32/setregid32.c +++ b/tests-mx32/setregid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/setregid32.gen.test b/tests-mx32/setregid32.gen.test new file mode 100755 index 00000000..7320c8cf --- /dev/null +++ b/tests-mx32/setregid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setregid32 -a17 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-mx32/setregid32.test b/tests-mx32/setregid32.test deleted file mode 100755 index e57e66c4..00000000 --- a/tests-mx32/setregid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setregid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a17 diff --git a/tests-mx32/setresgid.c b/tests-mx32/setresgid.c index 8701df8e..f3a160e3 100644 --- a/tests-mx32/setresgid.c +++ b/tests-mx32/setresgid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/setresgid.gen.test b/tests-mx32/setresgid.gen.test new file mode 100755 index 00000000..792313c2 --- /dev/null +++ b/tests-mx32/setresgid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setresgid -a19 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests-mx32/setresgid.test b/tests-mx32/setresgid.test deleted file mode 100755 index 5a695742..00000000 --- a/tests-mx32/setresgid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setresgid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a19 diff --git a/tests-mx32/setresgid32.c b/tests-mx32/setresgid32.c index dfce4572..e05ae8f8 100644 --- a/tests-mx32/setresgid32.c +++ b/tests-mx32/setresgid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/setresgid32.gen.test b/tests-mx32/setresgid32.gen.test new file mode 100755 index 00000000..6ecf936b --- /dev/null +++ b/tests-mx32/setresgid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setresgid32 -a21 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests-mx32/setresgid32.test b/tests-mx32/setresgid32.test deleted file mode 100755 index 528b2c9e..00000000 --- a/tests-mx32/setresgid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setresgid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a21 diff --git a/tests-mx32/setresugid.c b/tests-mx32/setresugid.c index 711bd317..07322cd7 100644 --- a/tests-mx32/setresugid.c +++ b/tests-mx32/setresugid.c @@ -1,30 +1,10 @@ /* * Check decoding of setresuid/setresgid/setresuid32/setresgid32 syscalls. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include diff --git a/tests-mx32/setresuid.c b/tests-mx32/setresuid.c index 3a9dbd1f..855a9bf7 100644 --- a/tests-mx32/setresuid.c +++ b/tests-mx32/setresuid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/setresuid.gen.test b/tests-mx32/setresuid.gen.test new file mode 100755 index 00000000..a0dcb4ba --- /dev/null +++ b/tests-mx32/setresuid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setresuid -a19 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests-mx32/setresuid.test b/tests-mx32/setresuid.test deleted file mode 100755 index f1219e06..00000000 --- a/tests-mx32/setresuid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setresuid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a19 diff --git a/tests-mx32/setresuid32.c b/tests-mx32/setresuid32.c index 387268a7..ccfc2a51 100644 --- a/tests-mx32/setresuid32.c +++ b/tests-mx32/setresuid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/setresuid32.gen.test b/tests-mx32/setresuid32.gen.test new file mode 100755 index 00000000..a9f43969 --- /dev/null +++ b/tests-mx32/setresuid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setresuid32 -a21 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests-mx32/setresuid32.test b/tests-mx32/setresuid32.test deleted file mode 100755 index 942a3a65..00000000 --- a/tests-mx32/setresuid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setresuid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a21 diff --git a/tests-mx32/setreugid.c b/tests-mx32/setreugid.c index 38c80d57..f195fd51 100644 --- a/tests-mx32/setreugid.c +++ b/tests-mx32/setreugid.c @@ -1,30 +1,10 @@ /* * Check decoding of setreuid/setregid/setreuid32/setregid32 syscalls. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include diff --git a/tests-mx32/setreuid.c b/tests-mx32/setreuid.c index 68e75192..1e34dd18 100644 --- a/tests-mx32/setreuid.c +++ b/tests-mx32/setreuid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/setreuid.gen.test b/tests-mx32/setreuid.gen.test new file mode 100755 index 00000000..0ecaef0b --- /dev/null +++ b/tests-mx32/setreuid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setreuid -a15 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests-mx32/setreuid.test b/tests-mx32/setreuid.test deleted file mode 100755 index b6db3c1d..00000000 --- a/tests-mx32/setreuid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setreuid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a15 diff --git a/tests-mx32/setreuid32.c b/tests-mx32/setreuid32.c index ba017621..c0345db7 100644 --- a/tests-mx32/setreuid32.c +++ b/tests-mx32/setreuid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/setreuid32.gen.test b/tests-mx32/setreuid32.gen.test new file mode 100755 index 00000000..3eb0e95a --- /dev/null +++ b/tests-mx32/setreuid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setreuid32 -a17 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-mx32/setreuid32.test b/tests-mx32/setreuid32.test deleted file mode 100755 index 23323d47..00000000 --- a/tests-mx32/setreuid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setreuid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a17 diff --git a/tests-mx32/setrlimit-Xabbrev.c b/tests-mx32/setrlimit-Xabbrev.c new file mode 100644 index 00000000..d5cf2ad3 --- /dev/null +++ b/tests-mx32/setrlimit-Xabbrev.c @@ -0,0 +1 @@ +#include "setrlimit.c" diff --git a/tests-mx32/setrlimit-Xabbrev.gen.test b/tests-mx32/setrlimit-Xabbrev.gen.test new file mode 100755 index 00000000..82d97839 --- /dev/null +++ b/tests-mx32/setrlimit-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setrlimit-Xabbrev -a27 -e trace=setrlimit -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 -e trace=setrlimit -Xabbrev diff --git a/tests-mx32/setrlimit-Xraw.c b/tests-mx32/setrlimit-Xraw.c new file mode 100644 index 00000000..1a5ead0b --- /dev/null +++ b/tests-mx32/setrlimit-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "setrlimit.c" diff --git a/tests-mx32/setrlimit-Xraw.gen.test b/tests-mx32/setrlimit-Xraw.gen.test new file mode 100755 index 00000000..b079d510 --- /dev/null +++ b/tests-mx32/setrlimit-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setrlimit-Xraw -a19 -e trace=setrlimit -Xraw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 -e trace=setrlimit -Xraw diff --git a/tests-mx32/setrlimit-Xverbose.c b/tests-mx32/setrlimit-Xverbose.c new file mode 100644 index 00000000..20cd135f --- /dev/null +++ b/tests-mx32/setrlimit-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "setrlimit.c" diff --git a/tests-mx32/setrlimit-Xverbose.gen.test b/tests-mx32/setrlimit-Xverbose.gen.test new file mode 100755 index 00000000..03dd8b04 --- /dev/null +++ b/tests-mx32/setrlimit-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setrlimit-Xverbose -a36 -e trace=setrlimit -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 -e trace=setrlimit -Xverbose diff --git a/tests-mx32/setrlimit.c b/tests-mx32/setrlimit.c index e93c8e37..099e2402 100644 --- a/tests-mx32/setrlimit.c +++ b/tests-mx32/setrlimit.c @@ -1,30 +1,11 @@ /* * Check decoding of setrlimit syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -43,7 +24,16 @@ main(void) for (xlat = resources; xlat->str; ++xlat) { unsigned long res = 0xfacefeed00000000ULL | xlat->val; long rc = syscall(__NR_setrlimit, res, 0); +# if XLAT_RAW + printf("setrlimit(%#x, NULL) = %s\n", + (unsigned int) xlat->val, sprintrc(rc)); +# elif XLAT_VERBOSE + printf("setrlimit(%#x /* %s */, NULL) = %s\n", + (unsigned int) xlat->val, + xlat->str, sprintrc(rc)); +# else printf("setrlimit(%s, NULL) = %s\n", xlat->str, sprintrc(rc)); +# endif struct rlimit libc_rlim = {}; if (getrlimit((int) res, &libc_rlim)) @@ -53,10 +43,23 @@ main(void) rc = syscall(__NR_setrlimit, res, rlimit); const char *errstr = sprintrc(rc); +# if XLAT_RAW + printf("setrlimit(%#x, {rlim_cur=%s, rlim_max=%s}) = %s\n", + (unsigned int) xlat->val, + sprint_rlim(rlimit[0]), sprint_rlim(rlimit[1]), + errstr); +# elif XLAT_VERBOSE + printf("setrlimit(%#x /* %s */," + " {rlim_cur=%s, rlim_max=%s}) = %s\n", + (unsigned int) xlat->val, xlat->str, + sprint_rlim(rlimit[0]), sprint_rlim(rlimit[1]), + errstr); +# else printf("setrlimit(%s, {rlim_cur=%s, rlim_max=%s}) = %s\n", xlat->str, sprint_rlim(rlimit[0]), sprint_rlim(rlimit[1]), errstr); +# endif } puts("+++ exited with 0 +++"); diff --git a/tests-mx32/setrlimit.gen.test b/tests-mx32/setrlimit.gen.test new file mode 100755 index 00000000..0d1508d3 --- /dev/null +++ b/tests-mx32/setrlimit.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setrlimit -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests-mx32/setrlimit.test b/tests-mx32/setrlimit.test deleted file mode 100755 index 79206089..00000000 --- a/tests-mx32/setrlimit.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of getrlimit/ugetrlimit/setrlimit syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests-mx32/setugid.c b/tests-mx32/setugid.c index aba277c5..b09cacb4 100644 --- a/tests-mx32/setugid.c +++ b/tests-mx32/setugid.c @@ -2,29 +2,10 @@ * Check decoding of setuid/setgid/setuid32/setgid32 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -61,6 +42,8 @@ main(void) const unsigned int num = (unsigned UGID_TYPE) tests[i]; long expected; + errno = 0; + if (num == ugid) expected = 0; else if ((UGID_TYPE) num == (UGID_TYPE) -1U) @@ -77,8 +60,9 @@ main(void) SYSCALL_NAME, ugid, errstr); break; } - perror_msg_and_fail("%s(%#lx) != %ld", - SYSCALL_NAME, tests[i], expected); + perror_msg_and_fail("%s(%#lx) = %ld != %ld", + SYSCALL_NAME, tests[i], + rc, expected); } printf("%s(", SYSCALL_NAME); diff --git a/tests-mx32/setuid.c b/tests-mx32/setuid.c index df2e46b1..4a8243e8 100644 --- a/tests-mx32/setuid.c +++ b/tests-mx32/setuid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/setuid.gen.test b/tests-mx32/setuid.gen.test new file mode 100755 index 00000000..00aeb7a2 --- /dev/null +++ b/tests-mx32/setuid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setuid -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-mx32/setuid.test b/tests-mx32/setuid.test deleted file mode 100755 index 9279233a..00000000 --- a/tests-mx32/setuid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setuid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 diff --git a/tests-mx32/setuid32.c b/tests-mx32/setuid32.c index c837d547..ba1b2e2d 100644 --- a/tests-mx32/setuid32.c +++ b/tests-mx32/setuid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/setuid32.gen.test b/tests-mx32/setuid32.gen.test new file mode 100755 index 00000000..ac8df8f2 --- /dev/null +++ b/tests-mx32/setuid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setuid32 -a12 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests-mx32/setuid32.test b/tests-mx32/setuid32.test deleted file mode 100755 index 7998392a..00000000 --- a/tests-mx32/setuid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setuid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a12 diff --git a/tests-mx32/shmxt.c b/tests-mx32/shmxt.c index 23cc7ccf..3742a484 100644 --- a/tests-mx32/shmxt.c +++ b/tests-mx32/shmxt.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include @@ -18,6 +25,10 @@ cleanup(void) # define SHMAT "shmat" #endif +#ifndef SHM_EXEC +# define SHM_EXEC 0100000 +#endif + int main(void) { @@ -34,8 +45,8 @@ main(void) atexit(cleanup); rc = (long) shmat(bogus_shmid, bogus_shmaddr, bogus_shmflg); - printf("%s(%d, %p, SHM_REMAP|SHM_RDONLY|SHM_RND|%#x) = %s\n", - SHMAT, bogus_shmid, bogus_shmaddr, bogus_shmflg & ~0x7000, + printf("%s(%d, %p, SHM_RDONLY|SHM_RND|SHM_REMAP|SHM_EXEC|%#x) = %s\n", + SHMAT, bogus_shmid, bogus_shmaddr, bogus_shmflg & ~0xf000, sprintrc(rc)); shmat(id, NULL, SHM_REMAP); @@ -50,18 +61,31 @@ main(void) rc = shmdt(NULL); printf("shmdt(NULL) = %s\n", sprintrc(rc)); - if (shmdt(shmaddr)) - perror_msg_and_skip("shmdt"); - printf("shmdt(%p) = 0\n", shmaddr); + rc = shmdt(shmaddr); + printf("shmdt(%p) = %s\n", shmaddr, sprintrc(rc)); ++shmaddr; void *shmaddr2 = shmat(id, shmaddr, SHM_RND); if (shmaddr2 == (void *)(-1)) printf("%s(%d, %p, SHM_RND) = -1 %s (%m)\n", SHMAT, id, shmaddr, errno2name()); - else + else { printf("%s(%d, %p, SHM_RND) = %p\n", SHMAT, id, shmaddr, shmaddr2); + rc = shmdt(shmaddr2); + printf("shmdt(%p) = %s\n", shmaddr2, sprintrc(rc)); + } + + shmaddr = shmat(id, NULL, SHM_RDONLY|SHM_EXEC); + if (shmaddr == (void *)(-1)) + printf("%s(%d, NULL, SHM_RDONLY|SHM_EXEC) = %s\n", + SHMAT, id, sprintrc(-1)); + else { + printf("%s(%d, NULL, SHM_RDONLY|SHM_EXEC) = %p\n", + SHMAT, id, shmaddr); + rc = shmdt(shmaddr); + printf("shmdt(%p) = %s\n", shmaddr, sprintrc(rc)); + } puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/shmxt.gen.test b/tests-mx32/shmxt.gen.test new file mode 100755 index 00000000..dd9d35f0 --- /dev/null +++ b/tests-mx32/shmxt.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (shmxt -a11 -e trace='/(osf_)?shmat,shmdt'); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace='/(osf_)?shmat,shmdt' diff --git a/tests-mx32/shmxt.test b/tests-mx32/shmxt.test deleted file mode 100755 index 3757cfa4..00000000 --- a/tests-mx32/shmxt.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check shmat and shmdt syscalls decoding. - -. "${srcdir=.}/init.sh" - -case "$STRACE_ARCH" in - alpha) shmat=osf_shmat ;; - *) shmat=shmat ;; -esac - -run_strace_match_diff -e trace=$shmat,shmdt -a11 diff --git a/tests-mx32/shutdown.c b/tests-mx32/shutdown.c index d770c43a..5297a0eb 100644 --- a/tests-mx32/shutdown.c +++ b/tests-mx32/shutdown.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + /* Check decoding of shutdown syscall. */ #include "tests.h" diff --git a/tests-mx32/shutdown.gen.test b/tests-mx32/shutdown.gen.test new file mode 100755 index 00000000..7fde46ee --- /dev/null +++ b/tests-mx32/shutdown.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (shutdown -a24 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-mx32/shutdown.test b/tests-mx32/shutdown.test deleted file mode 100755 index 22f0d5ab..00000000 --- a/tests-mx32/shutdown.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of shutdown syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 diff --git a/tests-mx32/sigaction.awk b/tests-mx32/sigaction.awk deleted file mode 100644 index 9c3a9ed3..00000000 --- a/tests-mx32/sigaction.awk +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/gawk -# -# Copyright (c) 2014-2015 Dmitry V. Levin -# Copyright (c) 2016 Elvira Khabirova -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (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][1] = n2[1][1] = "SIG_IGN" - n1[1][2] = n2[1][2] = "\\[HUP INT\\]" - n1[1][3] = "SA_RESTORER\\|SA_RESTART" - n2[1][3] = "SA_RESTART" - n1[1][4] = ", sa_restorer=0x[0-9a-f]+" - n2[1][4] = "" - - n1[2][1] = n2[2][1] = "0x[0-9a-f]+" - n1[2][2] = n2[2][2] = "\\[QUIT TERM\\]" - n1[2][3] = "SA_RESTORER\\|SA_SIGINFO" - n2[2][3] = "SA_SIGINFO" - n1[2][4] = ", sa_restorer=0x[0-9a-f]+" - n2[2][4] = "" - - n1[3][1] = n2[3][1] = "SIG_DFL" - n1[3][2] = n2[3][2] = "\\[\\]" - n1[3][3] = "SA_RESTORER" - n2[3][3] = "0" - n1[3][4] = ", sa_restorer=0x[0-9a-f]+" - n2[3][4] = "" - - n1[4][1] = n2[4][1] = "SIG_DFL" - n1[4][2] = n2[4][2] = "~\\[HUP( ((RT|SIGRT)[^] ]+|[3-9][0-9]|1[0-9][0-9]))*\\]" - n1[4][3] = "SA_RESTORER" - n2[4][3] = "0" - n1[4][4] = ", sa_restorer=0x[0-9a-f]+" - n2[4][4] = "" - - o1[1][1] = o2[1][1] = "SIG_DFL" - o1[1][2] = o2[1][2] = "\\[\\]" - o1[1][3] = o2[1][3] = "0" - o1[1][4] = o2[1][4] = "" - - for (i = 2; i < 5; i++) { - for (j = 1; j < 5; j++) { - o1[i][j] = n1[i - 1][j] - o2[i][j] = n2[i - 1][j] - } - } - - a1 = "(0x[0-9a-f]+, )?(4|8|16)" - a2 = "(4|8|16)(, 0x[0-9a-f]+)?" - a3 = "0x[0-9a-f]+, (4|8|16)" - - for (i = 1; i < 5; i++) { - r[i] = "^rt_sigaction\\(SIGUSR2, (" \ - "\\{sa_handler=" n1[i][1] ", sa_mask=" n1[i][2] \ - ", sa_flags=" n1[i][3] n1[i][4] "\\}, \\{sa_handler=" \ - o1[i][1] ", sa_mask=" o1[i][2] ", sa_flags=" o1[i][3] \ - o1[i][4] "\\}, " a1 "|" \ - "\\{sa_handler=" n2[i][1] ", sa_mask=" n2[i][2] \ - ", sa_flags=" n2[i][3] n2[i][4] "\\}, \\{sa_handler=" \ - o2[i][1] ", sa_mask=" o2[i][2] ", sa_flags=" o2[i][3] \ - o2[i][4] "\\}, " a2 "|" \ - "\\{sa_handler=" n2[i][1] ", sa_mask=" n2[i][2] \ - ", sa_flags=" n2[i][3] n2[i][4] "\\}, \\{sa_handler=" \ - o2[i][1] ", sa_mask=" o2[i][2] ", sa_flags=" o2[i][3] \ - o2[i][4] "\\}, " a3 ")\\) = 0$" - } - s[5] = "+++ exited with 0 +++" - - lines = 5 - fail = 0 -} - -@include "match.awk" diff --git a/tests-mx32/sigaction.c b/tests-mx32/sigaction.c index 1c034ff3..fe6280ce 100644 --- a/tests-mx32/sigaction.c +++ b/tests-mx32/sigaction.c @@ -1,67 +1,185 @@ /* - * Copyright (c) 2014-2015 Dmitry V. Levin - * All rights reserved. + * Check decoding of sigaction syscall. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Copyright (c) 2014-2018 Dmitry V. Levin + * All rights reserved. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ -#include -#include -#include -#include +#include "tests.h" +#include + +#ifdef __NR_sigaction + +# include +# include +# include +# include +# include + +struct set_sa { +# if defined MIPS + unsigned int flags; + unsigned long handler; + unsigned long mask[1]; +# elif defined ALPHA + unsigned long handler; + unsigned long mask[1]; + unsigned int flags; +# else + unsigned long handler; + unsigned long mask[1]; + unsigned long flags; + unsigned long restorer; +# endif +} +# ifdef ALPHA + ATTRIBUTE_PACKED +# endif +; + +typedef struct set_sa struct_set_sa; + +# ifdef MIPS + +struct get_sa { + unsigned int flags; + unsigned long handler; + unsigned long mask[4]; +}; + +typedef struct get_sa struct_get_sa; -static void handle_signal(int no) +# else + +typedef struct set_sa struct_get_sa; + +# endif + +static long +k_sigaction(const kernel_ulong_t signum, const kernel_ulong_t new_act, + const kernel_ulong_t old_act) { - _exit(128 + no); + return syscall(__NR_sigaction, signum, new_act, old_act); } +# if defined SPARC || defined SPARC64 +/* + * See arch/sparc/kernel/sys_sparc_32.c:sys_sparc_sigaction + * and arch/sparc/kernel/sys_sparc32.c:compat_sys_sparc_sigaction + */ +# define ADDR_INT ((unsigned int) -0xdefaced) +# define SIGNO_INT ((unsigned int) -SIGUSR1) +# define SIG_STR "-SIGUSR1" +# else +# define ADDR_INT ((unsigned int) 0xdefaced) +# define SIGNO_INT ((unsigned int) SIGUSR1) +# define SIG_STR "SIGUSR1" +# endif +static const kernel_ulong_t signo = + (kernel_ulong_t) 0xbadc0ded00000000ULL | SIGNO_INT; +static const kernel_ulong_t addr = + (kernel_ulong_t) 0xfacefeed00000000ULL | ADDR_INT; + int main(void) { - struct sigaction sa, sa0; - - sa.sa_handler = SIG_IGN; - sigemptyset(&sa.sa_mask); - sigaddset(&sa.sa_mask, SIGHUP); - sigaddset(&sa.sa_mask, SIGINT); - sa.sa_flags = SA_RESTART; - assert(!sigaction(SIGUSR2, &sa, &sa0)); - - sa.sa_handler = handle_signal; - sigemptyset(&sa.sa_mask); - sigaddset(&sa.sa_mask, SIGQUIT); - sigaddset(&sa.sa_mask, SIGTERM); - sa.sa_flags = SA_SIGINFO; - assert(!sigaction(SIGUSR2, &sa, &sa0)); - - sa.sa_handler = SIG_DFL; - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - assert(!sigaction(SIGUSR2, &sa, &sa0)); - - sigfillset(&sa.sa_mask); - sigdelset(&sa.sa_mask, SIGHUP); - assert(!sigaction(SIGUSR2, &sa, &sa0)); + union { + sigset_t libc[1]; + unsigned long old[1]; + } mask; + + TAIL_ALLOC_OBJECT_CONST_PTR(struct_set_sa, new_act); + TAIL_ALLOC_OBJECT_CONST_PTR(struct_get_sa, old_act); + + if (k_sigaction(signo, 0, 0)) + perror_msg_and_skip("sigaction"); + puts("sigaction(" SIG_STR ", NULL, NULL) = 0"); + + k_sigaction(signo, 0, 0); + puts("sigaction(" SIG_STR ", NULL, NULL) = 0"); + k_sigaction(signo, (uintptr_t) (new_act + 1), 0); + printf("sigaction(" SIG_STR ", %p, NULL) = -1 EFAULT (%m)\n", + new_act + 1); + + k_sigaction(signo, (uintptr_t) new_act + 2, 0); + printf("sigaction(" SIG_STR ", %#lx, NULL) = -1 EFAULT (%m)\n", + (unsigned long) new_act + 2); + + k_sigaction(signo, 0, (uintptr_t) (old_act + 1)); + printf("sigaction(" SIG_STR ", NULL, %p) = -1 EFAULT (%m)\n", + old_act + 1); + + k_sigaction(signo, 0, (uintptr_t) old_act + 2); + printf("sigaction(" SIG_STR ", NULL, %#lx) = -1 EFAULT (%m)\n", + (unsigned long) old_act + 2); + + k_sigaction(addr, 0, 0); + printf("sigaction(%d, NULL, NULL) = -1 EINVAL (%m)\n", ADDR_INT); + + memset(new_act, 0, sizeof(*new_act)); + + k_sigaction(signo, (uintptr_t) new_act, 0); + puts("sigaction(" SIG_STR ", {sa_handler=SIG_DFL, sa_mask=[]" + ", sa_flags=0}, NULL) = 0"); + + sigemptyset(mask.libc); + sigaddset(mask.libc, SIGHUP); + sigaddset(mask.libc, SIGINT); + + new_act->handler = (uintptr_t) SIG_IGN; + memcpy(new_act->mask, mask.old, sizeof(mask.old)); + new_act->flags = SA_SIGINFO; + + k_sigaction(signo, (uintptr_t) new_act, (uintptr_t) old_act); + puts("sigaction(" SIG_STR ", {sa_handler=SIG_IGN, sa_mask=[HUP INT]" + ", sa_flags=SA_SIGINFO}, {sa_handler=SIG_DFL, sa_mask=[]" + ", sa_flags=0}) = 0"); + + sigemptyset(mask.libc); + sigaddset(mask.libc, SIGQUIT); + sigaddset(mask.libc, SIGTERM); + + new_act->handler = (unsigned long) addr; + memcpy(new_act->mask, mask.old, sizeof(mask.old)); + new_act->flags = SA_ONSTACK | SA_RESTART; + + k_sigaction(signo, (uintptr_t) new_act, (uintptr_t) old_act); + printf("sigaction(" SIG_STR ", {sa_handler=%#lx, sa_mask=[QUIT TERM]" + ", sa_flags=SA_ONSTACK|SA_RESTART}, {sa_handler=SIG_IGN" + ", sa_mask=[HUP INT], sa_flags=SA_SIGINFO}) = 0\n", + new_act->handler); + + memset(mask.old, -1, sizeof(mask.old)); + sigdelset(mask.libc, SIGHUP); + + memcpy(new_act->mask, mask.old, sizeof(mask.old)); +# ifdef SA_RESTORER + new_act->flags = SA_RESTORER; + new_act->restorer = (unsigned long) 0xdeadfacecafef00dULL; +# define SA_RESTORER_FMT ", sa_flags=SA_RESTORER, sa_restorer=%#lx" +# define SA_RESTORER_ARGS , new_act->restorer +# else + new_act->flags = SA_NODEFER; +# define SA_RESTORER_FMT ", sa_flags=SA_NODEFER" +# define SA_RESTORER_ARGS +# endif + + k_sigaction(signo, (uintptr_t) new_act, (uintptr_t) old_act); + printf("sigaction(" SIG_STR ", {sa_handler=%#lx, sa_mask=~[HUP]" + SA_RESTORER_FMT "}, {sa_handler=%#lx, sa_mask=[QUIT TERM]" + ", sa_flags=SA_ONSTACK|SA_RESTART}) = 0\n", + new_act->handler SA_RESTORER_ARGS, + new_act->handler); + + puts("+++ exited with 0 +++"); return 0; } + +#else + +SKIP_MAIN_UNDEFINED("__NR_sigaction") + +#endif diff --git a/tests-mx32/sigaction.gen.test b/tests-mx32/sigaction.gen.test new file mode 100755 index 00000000..1db6b3aa --- /dev/null +++ b/tests-mx32/sigaction.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sigaction -a31 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 diff --git a/tests-mx32/sigaction.test b/tests-mx32/sigaction.test deleted file mode 100755 index fcde3baf..00000000 --- a/tests-mx32/sigaction.test +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# Check rt_sigaction decoding. - -. "${srcdir=.}/init.sh" - -run_prog -run_strace -ert_sigaction $args -match_awk - -exit 0 diff --git a/tests-mx32/sigaltstack.c b/tests-mx32/sigaltstack.c index 884e3c55..905f71c7 100644 --- a/tests-mx32/sigaltstack.c +++ b/tests-mx32/sigaltstack.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/sigaltstack.test b/tests-mx32/sigaltstack.test index ff83c2ea..a2ff4414 100755 --- a/tests-mx32/sigaltstack.test +++ b/tests-mx32/sigaltstack.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check sigaltstack syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests-mx32/sigblock.test b/tests-mx32/sigblock.test new file mode 100755 index 00000000..ab1eaeb7 --- /dev/null +++ b/tests-mx32/sigblock.test @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Check signal mask transparency. +# Starting with commit v4.17-5-gf83b49b strace is expected +# to forward the signal mask to tracees unchanged. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog ../list_sigaction_signum > /dev/null +saved_STRACE="$STRACE" + +for sig in $(../list_sigaction_signum); do + for block in 0 1; do + set_cmd="../set_sigblock $block $sig" + check_cmd="../check_sigblock $block $sig" + run_prog $set_cmd $check_cmd + STRACE="$set_cmd $saved_STRACE" + for i in '' -I1 -I2 -I3 -I4; do + run_strace $i -enone $check_cmd + done + done +done diff --git a/tests-mx32/sigign.test b/tests-mx32/sigign.test new file mode 100755 index 00000000..07a8180c --- /dev/null +++ b/tests-mx32/sigign.test @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Check signal disposition transparency. +# Starting with commit v4.17-8-ge97a66f strace is expected +# to forward the signal disposition to tracees unchanged. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog ../list_sigaction_signum > /dev/null +saved_STRACE="$STRACE" + +for sig in $(../list_sigaction_signum); do + for ign in 0 1; do + set_cmd="../set_sigign $ign $sig" + check_cmd="../check_sigign $ign $sig" + run_prog $set_cmd $check_cmd + STRACE="$set_cmd $saved_STRACE" + for i in '' -I1 -I2 -I3 -I4; do + run_strace $i -enone $check_cmd + done + done +done diff --git a/tests-mx32/siginfo.c b/tests-mx32/siginfo.c index 2ecb13fd..7789ff27 100644 --- a/tests-mx32/siginfo.c +++ b/tests-mx32/siginfo.c @@ -1,30 +1,10 @@ /* * Check SIGCHLD siginfo_t decoding. * - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/siginfo.gen.test b/tests-mx32/siginfo.gen.test new file mode 100755 index 00000000..33792b94 --- /dev/null +++ b/tests-mx32/siginfo.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (siginfo -e trace=none); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=none diff --git a/tests-mx32/siginfo.test b/tests-mx32/siginfo.test deleted file mode 100755 index 725f714f..00000000 --- a/tests-mx32/siginfo.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check SIGCHLD siginfo_t decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=none diff --git a/tests-mx32/signal.c b/tests-mx32/signal.c new file mode 100644 index 00000000..40cd77f5 --- /dev/null +++ b/tests-mx32/signal.c @@ -0,0 +1,112 @@ +/* + * Check decoding of signal syscall. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_signal + +# include +# include +# include +# include +# include +# include + +static long +k_signal(const kernel_ulong_t signum, const kernel_ulong_t handler) +{ + return syscall(__NR_signal, signum, handler); +} + +int +main(void) +{ + static const uintptr_t sig_ign = (uintptr_t) SIG_IGN; + static const uintptr_t sig_dfl = (uintptr_t) SIG_DFL; + static const kernel_ulong_t sigusr1 = + (kernel_ulong_t) 0xfacefeed00000000ULL | SIGUSR1; + static const struct sigaction act = { .sa_handler = SIG_DFL }; + long rc; + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + if (sigprocmask(SIG_BLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask SIG_BLOCK"); + + if (sigaction(SIGUSR1, &act, NULL)) + perror_msg_and_fail("sigaction"); + + rc = k_signal(sigusr1, sig_ign); + + if (rc == -1L) { + printf("signal(SIGUSR1, SIG_IGN) = %s\n", sprintrc(rc)); + } else if (rc != (long) sig_dfl) { + error_msg_and_fail("signal(SIGUSR1, SIG_IGN) = %#lx\n", rc); + } else { + printf("signal(SIGUSR1, SIG_IGN) = %#lx (SIG_DFL)\n", rc); + + /* + * Raise and unblock SIGUSR1. + * If signal syscall failed to set SIGUSR1 handler to SIG_IGN, + * the process will be terminated by SIGUSR1. + */ + raise(SIGUSR1); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask SIG_UNBLOCK"); + + if (sigprocmask(SIG_BLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask SIG_BLOCK"); + } + + rc = k_signal(SIGUSR1, sig_dfl); + + if (rc == -1L) { + printf("signal(SIGUSR1, SIG_DFL) = %s\n", sprintrc(rc)); + } else if (rc != (long) sig_ign) { + error_msg_and_fail("signal(SIGUSR1, SIG_DFL) = %#lx\n", rc); + } else { + printf("signal(SIGUSR1, SIG_DFL) = %#lx (SIG_IGN)\n", rc); + } + + const kernel_ulong_t addr = (kernel_ulong_t) 0xfacefeeddeadbeefULL; + rc = k_signal(SIGUSR1, addr); + + if (rc == -1L) { + printf("signal(SIGUSR1, %#llx) = %s\n", + (unsigned long long) addr, sprintrc(rc)); + } else if (rc != (long) sig_dfl) { + error_msg_and_fail("signal(SIGUSR1, %#llx) = %#lx\n", + (unsigned long long) addr, rc); + } else { + printf("signal(SIGUSR1, %#llx) = %#lx (SIG_DFL)\n", + (unsigned long long) addr, rc); + } + + rc = k_signal(SIGUSR1, sig_ign); + + if (rc == -1L) { + printf("signal(SIGUSR1, SIG_IGN) = %s\n", sprintrc(rc)); + } else { + printf("signal(SIGUSR1, SIG_IGN) = %#lx\n", rc); + } + + rc = k_signal(addr, sig_ign); + printf("signal(%d, SIG_IGN) = %s\n", (int) addr, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_signal") + +#endif diff --git a/tests-mx32/signal.gen.test b/tests-mx32/signal.gen.test new file mode 100755 index 00000000..81359ca5 --- /dev/null +++ b/tests-mx32/signal.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (signal -a25 -e signal=none -e trace='/^signal$'); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 -e signal=none -e trace='/^signal$' diff --git a/tests-mx32/signal2name.c b/tests-mx32/signal2name.c index e301f4ee..1d8e7c59 100644 --- a/tests-mx32/signal2name.c +++ b/tests-mx32/signal2name.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -50,6 +57,7 @@ signal2name(int sig) CASE(SIGPWR); CASE(SIGSTKFLT); #endif - default: perror_msg_and_fail("unknown signal number %d", sig); + default: + perror_msg_and_fail("unknown signal number %d", sig); } } diff --git a/tests-mx32/signal_receive.c b/tests-mx32/signal_receive.c index 1c4293e5..ad3b4ebd 100644 --- a/tests-mx32/signal_receive.c +++ b/tests-mx32/signal_receive.c @@ -1,43 +1,107 @@ +/* + * Check decoding of signal delivery. + * + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include #include -void sig_print(const char *signame, const int pid, const int uid) -{ - printf("kill(%d, %s) = 0\n" - "--- %s {si_signo=%s, si_code=SI_USER, si_pid=%d" - ", si_uid=%d} ---\n", - pid, signame, signame, signame, pid, uid); -} +static volatile int s_sig, s_code, s_pid, s_uid; static void -handler(int sig) +handler(int sig, siginfo_t *info, void *ucontext) { + s_sig = info->si_signo; + s_code = info->si_code; + s_pid = info->si_pid; + s_uid = info->si_uid; } int main(void) { - int sig, pid = getpid(), uid = getuid(); - const struct sigaction act = { .sa_handler = handler }; - sigset_t mask; - sigemptyset(&mask); - - for (sig = 1; sig <= 31; sig++) { - if( sig != SIGKILL && sig != SIGSTOP) { - sigaction(sig, &act, NULL); - sigaddset(&mask, sig); + static const char prefix[] = "KERNEL BUG"; + int printed = 0; + + const int pid = getpid(); + const int uid = geteuid(); + + for (int sig = 1; sig <= 31; ++sig) { + if (sig == SIGKILL || sig == SIGSTOP) + continue; + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, sig); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + static const struct sigaction act = { + .sa_sigaction = handler, + .sa_flags = SA_SIGINFO + }; + if (sigaction(sig, &act, NULL)) + perror_msg_and_fail("sigaction: %d", sig); + + if (kill(pid, sig) != 0) + perror_msg_and_fail("kill: %d", sig); + +#ifdef MPERS_IS_m32 + /* + * The tracee has received a compat siginfo_t but + * the tracer has received a native siginfo_t. + */ + const int e_sig = sig; + const int e_pid = pid; + const int e_uid = uid; +#else + /* + * If the tracee is a native process, + * then the tracer is also native. + * If the tracee is a compat process, + * then the tracer is also compat. + * Anyway, both the tracee and the tracer + * have received the same siginfo_t. + */ + const int e_sig = s_sig; + const int e_pid = s_pid; + const int e_uid = s_uid; +#endif + printf("kill(%d, %s) = 0\n", pid, signal2name(sig)); + printf("--- %s {si_signo=%s, si_code=SI_USER, si_pid=%d" + ", si_uid=%d} ---\n", + signal2name(sig), signal2name(e_sig), e_pid, e_uid); + + if (s_code || sig != s_sig || pid != s_pid || uid != s_uid) { + /* + * The kernel has failed to initialize siginfo_t + * properly. There is nothing that could be done + * on the strace side to workaround the kernel bug, + * so just print some useful diagnostics. + */ + if (!printed) { + printed = 1; + fprintf(stderr, "%s: siginfo_t\n", prefix); + } + fprintf(stderr, + "%s: expected: si_signo=%d, si_code=%d" + ", si_pid=%d, si_uid=%d\n" + "%s: received: si_signo=%d, si_code=%d" + ", si_pid=%d, si_uid=%d\n", + prefix, sig, SI_USER, pid, uid, + prefix, sig, s_code, s_pid, s_uid); } } - sigprocmask(SIG_UNBLOCK, &mask, NULL); - for (sig = 1; sig <= 31; sig++) { - if(sig != SIGKILL && sig != SIGSTOP) { - if (kill(pid, sig) != 0) - perror_msg_and_fail("kill: %d", sig); - sig_print(signal2name(sig), pid, uid); - } + if (printed) { + fprintf(stderr, "%s: end of diagnostics\n" + "*** PLEASE FIX THE KERNEL ***\n", prefix); } puts("+++ exited with 0 +++"); diff --git a/tests-mx32/signal_receive.gen.test b/tests-mx32/signal_receive.gen.test new file mode 100755 index 00000000..79e8fb84 --- /dev/null +++ b/tests-mx32/signal_receive.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (signal_receive -a16 -e trace=kill); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 -e trace=kill diff --git a/tests-mx32/signal_receive.test b/tests-mx32/signal_receive.test deleted file mode 100755 index 9685b666..00000000 --- a/tests-mx32/signal_receive.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check whether strace traces signals properly. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a16 -e trace=kill diff --git a/tests-mx32/signalfd4.c b/tests-mx32/signalfd4.c index 47e49b50..71df2dcc 100644 --- a/tests-mx32/signalfd4.c +++ b/tests-mx32/signalfd4.c @@ -2,37 +2,17 @@ * Check decoding of signalfd4 syscall. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include #include -#if defined __NR_rt_sigprocmask \ - && defined HAVE_SYS_SIGNALFD_H \ +#if defined HAVE_SYS_SIGNALFD_H \ && defined HAVE_SIGNALFD \ && defined O_CLOEXEC @@ -41,24 +21,6 @@ # include # include -static unsigned int -get_sigset_size(void) -{ - const unsigned int big_size = 1024 / 8; - unsigned int set_size; - - for (set_size = big_size; set_size; set_size >>= 1) { - if (!syscall(__NR_rt_sigprocmask, SIG_SETMASK, - NULL, NULL, set_size)) - break; - } - - if (!set_size) - perror_msg_and_fail("rt_sigprocmask"); - - return set_size; -} - int main(void) { @@ -80,7 +42,6 @@ main(void) #else -SKIP_MAIN_UNDEFINED("__NR_rt_sigprocmask && HAVE_SYS_SIGNALFD_H" - " && HAVE_SIGNALFD && O_CLOEXEC") +SKIP_MAIN_UNDEFINED("HAVE_SYS_SIGNALFD_H && HAVE_SIGNALFD && O_CLOEXEC") #endif diff --git a/tests-mx32/signalfd4.gen.test b/tests-mx32/signalfd4.gen.test new file mode 100755 index 00000000..dee4274c --- /dev/null +++ b/tests-mx32/signalfd4.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (signalfd4 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/signalfd4.test b/tests-mx32/signalfd4.test deleted file mode 100755 index a615a5bf..00000000 --- a/tests-mx32/signalfd4.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of signalfd4 syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/sigpending.c b/tests-mx32/sigpending.c new file mode 100644 index 00000000..f065c873 --- /dev/null +++ b/tests-mx32/sigpending.c @@ -0,0 +1,86 @@ +/* + * Check decoding of sigpending syscall. + * + * Copyright (c) 2016-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_sigpending + +# include +# include +# include +# include +# include + +static const char *errstr; + +static long +k_sigpending(const kernel_ulong_t set) +{ + const long rc = syscall(__NR_sigpending, set); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(kernel_ulong_t, k_set); + TAIL_ALLOC_OBJECT_CONST_PTR(sigset_t, libc_set); + + sigemptyset(libc_set); + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + + if (k_sigpending((uintptr_t) libc_set)) + perror_msg_and_skip("sigpending"); + else + puts("sigpending([]) = 0"); + + k_sigpending((uintptr_t) k_set); + puts("sigpending([]) = 0"); + + k_sigpending((uintptr_t) (k_set + 1)); + printf("sigpending(%p) = -1 EFAULT (%m)\n", k_set + 1); + + uintptr_t efault = sizeof(*k_set) / 2 + (uintptr_t) k_set; + k_sigpending(efault); + printf("sigpending(%#jx) = -1 EFAULT (%m)\n", (uintmax_t) efault); + + sigaddset(libc_set, SIGHUP); + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + raise(SIGHUP); + + k_sigpending((uintptr_t) k_set); + puts("sigpending([HUP]) = 0"); + + sigaddset(libc_set, SIGINT); + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + raise(SIGINT); + + k_sigpending((uintptr_t) k_set); + puts("sigpending([HUP INT]) = 0"); + + if (F8ILL_KULONG_SUPPORTED) { + k_sigpending(f8ill_ptr_to_kulong(k_set)); + printf("sigpending(%#jx) = %s\n", + (uintmax_t) f8ill_ptr_to_kulong(k_set), errstr); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sigpending") + +#endif diff --git a/tests-mx32/sigpending.gen.test b/tests-mx32/sigpending.gen.test new file mode 100755 index 00000000..c061868c --- /dev/null +++ b/tests-mx32/sigpending.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sigpending -a15 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests-mx32/sigprocmask.c b/tests-mx32/sigprocmask.c new file mode 100644 index 00000000..566b8346 --- /dev/null +++ b/tests-mx32/sigprocmask.c @@ -0,0 +1,131 @@ +/* + * Check decoding of sigprocmask syscall. + * + * Copyright (c) 2016-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_sigprocmask + +# include +# include +# include +# include +# include + +static const char *errstr; + +static long +k_sigprocmask(const kernel_ulong_t how, const kernel_ulong_t new_set, + const kernel_ulong_t old_set) +{ + const long rc = syscall(__NR_sigprocmask, how, new_set, old_set); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const kernel_ulong_t sig_block = + (kernel_ulong_t) 0xfacefeed00000000ULL | SIG_BLOCK; + static const kernel_ulong_t sig_unblock = + (kernel_ulong_t) 0xfacefeed00000000ULL | SIG_UNBLOCK; + static const kernel_ulong_t sig_setmask = + (kernel_ulong_t) 0xfacefeed00000000ULL | SIG_SETMASK; + + if (k_sigprocmask(sig_setmask, 0, 0)) + perror_msg_and_skip("sigprocmask"); + puts("sigprocmask(SIG_SETMASK, NULL, NULL) = 0"); + + TAIL_ALLOC_OBJECT_CONST_PTR(kernel_ulong_t, new_set); + TAIL_ALLOC_OBJECT_CONST_PTR(kernel_ulong_t, old_set); + TAIL_ALLOC_OBJECT_CONST_PTR(sigset_t, libc_set); + + memset(new_set, 0, sizeof(*new_set)); + k_sigprocmask(sig_setmask, (uintptr_t) new_set, 0); + printf("sigprocmask(SIG_SETMASK, [], NULL) = %s\n", errstr); + + k_sigprocmask(sig_unblock, + (uintptr_t) (new_set - 1), (uintptr_t) old_set); + puts("sigprocmask(SIG_UNBLOCK, ~[], []) = 0"); + + if (F8ILL_KULONG_SUPPORTED) { + k_sigprocmask(sig_unblock, f8ill_ptr_to_kulong(new_set), 0); + printf("sigprocmask(SIG_UNBLOCK, %#jx, NULL) = %s\n", + (uintmax_t) f8ill_ptr_to_kulong(new_set), errstr); + + k_sigprocmask(sig_unblock, 0, f8ill_ptr_to_kulong(old_set)); + printf("sigprocmask(SIG_UNBLOCK, NULL, %#jx) = %s\n", + (uintmax_t) f8ill_ptr_to_kulong(old_set), errstr); + } + + sigemptyset(libc_set); + sigaddset(libc_set, SIGHUP); + memcpy(new_set, libc_set, sizeof(*new_set)); + + k_sigprocmask(sig_block, (uintptr_t) new_set, (uintptr_t) old_set); + puts("sigprocmask(SIG_BLOCK, [HUP], []) = 0"); + + memset(libc_set, -1, sizeof(*libc_set)); + sigdelset(libc_set, SIGHUP); + memcpy(new_set, libc_set, sizeof(*new_set)); + + k_sigprocmask(sig_unblock, (uintptr_t) new_set, (uintptr_t) old_set); + puts("sigprocmask(SIG_UNBLOCK, ~[HUP], [HUP]) = 0"); + + sigdelset(libc_set, SIGKILL); + memcpy(new_set, libc_set, sizeof(*new_set)); + + k_sigprocmask(sig_unblock, (uintptr_t) new_set, (uintptr_t) old_set); + puts("sigprocmask(SIG_UNBLOCK, ~[HUP KILL], [HUP]) = 0"); + + sigemptyset(libc_set); + sigaddset(libc_set, SIGHUP); + sigaddset(libc_set, SIGINT); + sigaddset(libc_set, SIGQUIT); + sigaddset(libc_set, SIGALRM); + sigaddset(libc_set, SIGTERM); + memcpy(new_set, libc_set, sizeof(*new_set)); + + k_sigprocmask(sig_block, (uintptr_t) new_set, (uintptr_t) old_set); + printf("sigprocmask(SIG_BLOCK, %s, [HUP]) = 0\n", + "[HUP INT QUIT ALRM TERM]"); + + k_sigprocmask(sig_setmask, 0, (uintptr_t) old_set); + printf("sigprocmask(SIG_SETMASK, NULL, %s) = 0\n", + "[HUP INT QUIT ALRM TERM]"); + + k_sigprocmask(sig_setmask, (uintptr_t) (new_set + 1), 0); + printf("sigprocmask(SIG_SETMASK, %p, NULL) = %s\n", + new_set + 1, errstr); + + k_sigprocmask(sig_setmask, + (uintptr_t) new_set, (uintptr_t) (old_set + 1)); + printf("sigprocmask(SIG_SETMASK, %s, %p) = %s\n", + "[HUP INT QUIT ALRM TERM]", old_set + 1, errstr); + + uintptr_t efault = sizeof(*new_set) / 2 + (uintptr_t) new_set; + + k_sigprocmask(sig_setmask, efault, 0); + printf("sigprocmask(SIG_SETMASK, %#jx, NULL) = %s\n", + (uintmax_t) efault, errstr); + + k_sigprocmask(sig_setmask, 0, efault); + printf("sigprocmask(SIG_SETMASK, NULL, %#jx) = %s\n", + (uintmax_t) efault, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sigprocmask") + +#endif diff --git a/tests-mx32/sigprocmask.gen.test b/tests-mx32/sigprocmask.gen.test new file mode 100755 index 00000000..065b74d7 --- /dev/null +++ b/tests-mx32/sigprocmask.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sigprocmask -a34 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a34 diff --git a/tests-mx32/sigreturn.c b/tests-mx32/sigreturn.c index dace040a..5dece0a4 100644 --- a/tests-mx32/sigreturn.c +++ b/tests-mx32/sigreturn.c @@ -1,48 +1,43 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" -#include -#include +#include -#ifdef ASM_SIGRTMIN -# define RT_0 ASM_SIGRTMIN -#else -/* Linux kernel >= 3.18 defines SIGRTMIN to 32 on all architectures. */ -# define RT_0 32 +#if defined __powerpc64__ \ + || (defined __sparc__ && defined __arch64__) +/* Old sigreturn is defined but not implemented in the kernel. */ +# undef __NR_sigreturn #endif -static void handler(int sig) +#ifdef __NR_sigreturn + +# include +# include +# include + +# ifdef ASM_SIGRTMIN +# define RT_0 ASM_SIGRTMIN +# else +/* Linux kernel >= 3.18 defines SIGRTMIN to 32 on all architectures. */ +# define RT_0 32 +# endif + +static void +handler(int sig) { } -int main(void) { - sigset_t set; +int +main(void) +{ + static sigset_t set; sigemptyset(&set); + sigaddset(&set, SIGINT); sigaddset(&set, SIGUSR2); sigaddset(&set, SIGCHLD); sigaddset(&set, RT_0 + 3); @@ -50,8 +45,28 @@ int main(void) { sigaddset(&set, RT_0 + 5); sigaddset(&set, RT_0 + 26); sigaddset(&set, RT_0 + 27); - sigprocmask(SIG_SETMASK, &set, NULL); - signal(SIGUSR1, handler); - raise(SIGUSR1); + if (sigprocmask(SIG_SETMASK, &set, NULL)) + perror_msg_and_fail("sigprocmask"); + sigemptyset(&set); + + /* This should result to old sigreturn. */ + if (signal(SIGUSR1, handler) == SIG_ERR) + perror_msg_and_fail("sigaction"); + + if (raise(SIGUSR1)) + perror_msg_and_fail("raise"); + + static const char *const sigs = + (SIGUSR2 < SIGCHLD) ? "INT USR2 CHLD" : "INT CHLD USR2"; + static const char *const rt_sigs = "RT_3 RT_4 RT_5 RT_26 RT_27"; + printf("sigreturn({mask=[%s %s]}) = 0\n", sigs, rt_sigs); + + puts("+++ exited with 0 +++"); return 0; } + +#else + +SKIP_MAIN_UNDEFINED("__NR_sigreturn") + +#endif diff --git a/tests-mx32/sigreturn.gen.test b/tests-mx32/sigreturn.gen.test new file mode 100755 index 00000000..3b67c9d0 --- /dev/null +++ b/tests-mx32/sigreturn.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sigreturn -esignal='!USR1' ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal='!USR1' diff --git a/tests-mx32/sigreturn.test b/tests-mx32/sigreturn.test deleted file mode 100755 index f9a612bf..00000000 --- a/tests-mx32/sigreturn.test +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# -# Check rt_sigprocmask and sigreturn/rt_sigreturn decoding. -# -# Copyright (c) 2015-2016 Dmitry V. Levin -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (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" - -run_prog -run_strace -esignal $args - -mask='\[(USR2 CHLD|CHLD USR2) RT_3 RT_4 RT_5 RT_26 RT_27\]' -rt_sigprocmask='rt_sigprocmask\(SIG_SETMASK, '"$mask"', NULL, [[:digit:]]+\) += 0' -osf_sigprocmask='osf_sigprocmask\(SIG_SETMASK, '"$mask"'\) += 0 +\(old mask \[[^]]*\]\)' -EXPECTED="$LOG.expected" - -cat > "$EXPECTED" << __EOF__ -$rt_sigprocmask|$osf_sigprocmask -(rt_)?sigreturn\\((\\{mask=$mask\\})?\\) += 0 -__EOF__ - -match_grep "$LOG" "$EXPECTED" -rm -f "$EXPECTED" - -exit 0 diff --git a/tests-mx32/sigsuspend.c b/tests-mx32/sigsuspend.c new file mode 100644 index 00000000..11ffae83 --- /dev/null +++ b/tests-mx32/sigsuspend.c @@ -0,0 +1,97 @@ +/* + * Check decoding of sigsuspend syscall. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_sigsuspend + +# include +# include +# include +# include +# include +# include +# include + +# ifdef MIPS +# define SIGNAL_MASK_BY_REF 1 +# else +# define SIGNAL_MASK_BY_REF 0 +# endif + +static long +k_sigsuspend(const kernel_ulong_t arg1, + const kernel_ulong_t arg2, + const kernel_ulong_t arg3) +{ + return syscall(__NR_sigsuspend, arg1, arg2, arg3); +} + +static int signo; +static const char *sigtxt[] = { + [SIGUSR1] = "USR1", + [SIGUSR2] = "USR2" +}; + +static void +handler(int i) +{ + signo = i; +} + +int +main(void) +{ + union { + sigset_t libc_mask; + unsigned long old_mask; + } u; + + sigemptyset(&u.libc_mask); + sigaddset(&u.libc_mask, SIGUSR1); + sigaddset(&u.libc_mask, SIGUSR2); + if (sigprocmask(SIG_SETMASK, &u.libc_mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + const struct sigaction sa = { .sa_handler = handler }; + if (sigaction(SIGUSR1, &sa, NULL) || sigaction(SIGUSR2, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + raise(SIGUSR1); + raise(SIGUSR2); + + u.old_mask = -1UL; + sigdelset(&u.libc_mask, SIGUSR1); + const unsigned long mask1 = u.old_mask; + + u.old_mask = -1UL; + sigdelset(&u.libc_mask, SIGUSR2); + const unsigned long mask2 = u.old_mask; + +# if SIGNAL_MASK_BY_REF + k_sigsuspend((uintptr_t) &mask1, 0xdeadbeef, (uintptr_t) &mask2); +# else + k_sigsuspend(mask1, 0xdeadbeef, mask2); +# endif + if (EINTR != errno) + perror_msg_and_skip("sigsuspend"); + + printf("sigsuspend(~[%s]) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", sigtxt[signo]); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sigsuspend") + +#endif diff --git a/tests-mx32/sigsuspend.gen.test b/tests-mx32/sigsuspend.gen.test new file mode 100755 index 00000000..afd0207e --- /dev/null +++ b/tests-mx32/sigsuspend.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sigsuspend -a19 -esignal=none); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 -esignal=none diff --git a/tests-mx32/skip_unavailable.c b/tests-mx32/skip_unavailable.c new file mode 100644 index 00000000..761a10c3 --- /dev/null +++ b/tests-mx32/skip_unavailable.c @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include + +void +skip_if_unavailable(const char *const path) +{ + struct stat st; + + if (stat(path, &st)) + perror_msg_and_skip("stat: %s", path); +} diff --git a/tests-mx32/sleep.c b/tests-mx32/sleep.c index f4bce3cd..0cdfcebc 100644 --- a/tests-mx32/sleep.c +++ b/tests-mx32/sleep.c @@ -1,30 +1,10 @@ /* * A simple nanosleep based sleep(1) replacement. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/so_error.c b/tests-mx32/so_error.c new file mode 100644 index 00000000..2592a3c1 --- /dev/null +++ b/tests-mx32/so_error.c @@ -0,0 +1,103 @@ +/* + * Check decoding of SO_ERROR socket option. + * + * Copyright (c) 2018 Masatake YAMATO + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +static in_port_t +reserve_ephemeral_port(void) +{ + int sd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + if (sd < 0) + perror_msg_and_skip("server socket AF_UNIX SOCK_STREAM"); + + struct sockaddr_in addr = { + .sin_family = AF_INET, + .sin_addr.s_addr = htonl(INADDR_LOOPBACK), + }; + + /* + * The range is defined in /proc/sys/net/ipv4/ip_local_port_range. + * We use the default range here. + */ + for (in_port_t port = 49152; port < 61000; port++) { + /* Just bind here. No listen. */ + addr.sin_port = htons(port); + if (bind(sd, &addr, sizeof(addr)) == 0) + return port; + } + error_msg_and_skip("no ephemeral port available for test purposes"); +} + +int +main(void) +{ + in_port_t port = reserve_ephemeral_port (); + + /* + * Connect to the reserved port in NONBLOCK mode. + * The port is reserved but not listened. So + * the client doing "connect" gets error asynchronously. + */ + int fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + if (fd < 0) + perror_msg_and_skip("socket AF_UNIX SOCK_STREAM"); + + int flag = fcntl(fd, F_GETFL); + if (flag < 0) + perror_msg_and_skip("fcntl F_GETFL"); + flag |= O_NONBLOCK; + if (fcntl(fd, F_SETFL, flag) < 0) + perror_msg_and_skip("fcntl F_SETFL"); + + struct sockaddr_in addr = { + .sin_family = AF_INET, + .sin_addr.s_addr = htonl(INADDR_LOOPBACK), + .sin_port = htons(port), + }; + if (connect(fd, &addr, sizeof(addr)) == 0) + error_msg_and_skip("connect unexpectedly succeeded"); + if (errno != EINPROGRESS) + perror_msg_and_skip("connect failed for unexpected reason"); + + struct timeval to = { + .tv_sec = 1, + .tv_usec = 0, + }; + fd_set wfds; + FD_ZERO(&wfds); + FD_SET(fd, &wfds); + if (select(fd + 1, NULL, &wfds, NULL, &to) < 0) + perror_msg_and_skip("select"); + + int sock_errno; + socklen_t optlen = sizeof(sock_errno); + if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &sock_errno, &optlen) < 0) + perror_msg_and_skip("getsockopt"); + if (sock_errno != ECONNREFUSED) { + errno = sock_errno; + perror_msg_and_skip("unexpected socket error"); + } + if (optlen != sizeof(sock_errno)) + error_msg_and_skip("unexpected data size for error option: %d", + optlen); + + printf("getsockopt(%d, SOL_SOCKET, SO_ERROR, [ECONNREFUSED], [%u]) = 0\n", + fd, optlen); + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/so_error.gen.test b/tests-mx32/so_error.gen.test new file mode 100755 index 00000000..9083e4d4 --- /dev/null +++ b/tests-mx32/so_error.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (so_error -e trace=getsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt diff --git a/tests-mx32/so_linger.c b/tests-mx32/so_linger.c new file mode 100644 index 00000000..b10fa067 --- /dev/null +++ b/tests-mx32/so_linger.c @@ -0,0 +1,161 @@ +/* + * Check decoding of SO_LINGER socket option. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +static const char *errstr; + +static int +get_linger(int fd, void *val, socklen_t *len) +{ + int rc = getsockopt(fd, SOL_SOCKET, SO_LINGER, val, len); + errstr = sprintrc(rc); + return rc; +} + +static int +set_linger(int fd, void *val, socklen_t len) +{ + int rc = setsockopt(fd, SOL_SOCKET, SO_LINGER, val, len); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct linger, linger); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); + + const unsigned int sizeof_l_onoff = sizeof(linger->l_onoff); + struct linger *const l_onoff = tail_alloc(sizeof_l_onoff); + + const unsigned int sizeof_l_onoff_truncated = sizeof_l_onoff - 1; + struct linger *const l_onoff_truncated = + tail_alloc(sizeof_l_onoff_truncated); + + const unsigned int sizeof_l_linger_truncated = + offsetofend(struct linger, l_linger) - 1; + struct linger *const l_linger_truncated = + tail_alloc(sizeof_l_linger_truncated); + + int fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (fd < 0) + perror_msg_and_skip("socket AF_UNIX SOCK_STREAM"); + + /* classic getsockopt */ + *len = sizeof(*linger); + get_linger(fd, linger, len); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, {l_onoff=%d, l_linger=%d}" + ", [%d]) = %s\n", + fd, linger->l_onoff, linger->l_linger, *len, errstr); + + /* classic setsockopt */ + linger->l_onoff = -15; + linger->l_linger = -42; + set_linger(fd, linger, sizeof(*linger)); + printf("setsockopt(%d, SOL_SOCKET, SO_LINGER, {l_onoff=%d, l_linger=%d}" + ", %d) = %s\n", + fd, linger->l_onoff, linger->l_linger, + (unsigned int) sizeof(*linger), errstr); + + /* setsockopt with optlen larger than necessary */ + set_linger(fd, linger, sizeof(*linger) + 1); + printf("setsockopt(%d, SOL_SOCKET, SO_LINGER, {l_onoff=%d, l_linger=%d}" + ", %d) = %s\n", + fd, linger->l_onoff, linger->l_linger, + (unsigned int) sizeof(*linger) + 1, errstr); + + /* setsockopt with optlen < 0 - EINVAL */ + set_linger(fd, linger, -1U); + printf("setsockopt(%d, SOL_SOCKET, SO_LINGER, %p, -1) = %s\n", + fd, linger, errstr); + + /* setsockopt with optlen smaller than necessary - EINVAL */ + set_linger(fd, linger, sizeof(linger->l_onoff)); + printf("setsockopt(%d, SOL_SOCKET, SO_LINGER, %p, %d) = %s\n", + fd, linger, (unsigned int) sizeof(linger->l_onoff), errstr); + + /* setsockopt optval EFAULT */ + set_linger(fd, &linger->l_linger, sizeof(*linger)); + printf("setsockopt(%d, SOL_SOCKET, SO_LINGER, %p, %d) = %s\n", + fd, &linger->l_linger, (unsigned int) sizeof(*linger), errstr); + + /* getsockopt with zero optlen */ + *len = 0; + get_linger(fd, linger, len); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, %p, [0]) = %s\n", + fd, linger, errstr); + + /* getsockopt with optlen larger than necessary - shortened */ + *len = sizeof(*linger) + 1; + get_linger(fd, linger, len); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, {l_onoff=%d, l_linger=%d}" + ", [%u->%d]) = %s\n", + fd, linger->l_onoff, linger->l_linger, + (unsigned int) sizeof(*linger) + 1, *len, errstr); + + /* + * getsockopt with optlen less than sizeof(linger->l_onoff): + * the part of struct linger.l_onoff is printed in hex. + */ + *len = sizeof_l_onoff_truncated; + get_linger(fd, l_onoff_truncated, len); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, {l_onoff=", fd); + print_quoted_hex(l_onoff_truncated, *len); + printf("}, [%d]) = %s\n", *len, errstr); + + /* + * getsockopt with optlen equals to sizeof(struct linger.l_onoff): + * struct linger.l_linger is not printed. + */ + *len = sizeof_l_onoff; + get_linger(fd, l_onoff, len); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, {l_onoff=%d}" + ", [%d]) = %s\n", + fd, l_onoff->l_onoff, *len, errstr); + + /* + * getsockopt with optlen greater than sizeof(struct linger.l_onoff) + * but smaller than sizeof(struct linger): + * the part of struct linger.l_linger is printed in hex. + */ + *len = sizeof_l_linger_truncated; + get_linger(fd, l_linger_truncated, len); + /* + * Copy to a properly aligned structure to avoid unaligned access + * to struct linger.l_onoff field. + */ + memcpy(linger, l_linger_truncated, sizeof_l_linger_truncated); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, {l_onoff=%d, l_linger=", + fd, linger->l_onoff); + print_quoted_hex(&linger->l_linger, sizeof_l_linger_truncated - + offsetof(struct linger, l_linger)); + printf("}, [%d]) = %s\n", *len, errstr); + + /* getsockopt optval EFAULT */ + *len = sizeof(*linger); + get_linger(fd, &linger->l_linger, len); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, %p, [%d]) = %s\n", + fd, &linger->l_linger, *len, errstr); + + /* getsockopt optlen EFAULT */ + get_linger(fd, linger, len + 1); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, %p, %p) = %s\n", + fd, linger, len + 1, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/so_linger.gen.test b/tests-mx32/so_linger.gen.test new file mode 100755 index 00000000..8362163a --- /dev/null +++ b/tests-mx32/so_linger.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (so_linger -e trace=getsockopt,setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt,setsockopt diff --git a/tests-mx32/so_peercred-Xabbrev.c b/tests-mx32/so_peercred-Xabbrev.c new file mode 100644 index 00000000..a7056a66 --- /dev/null +++ b/tests-mx32/so_peercred-Xabbrev.c @@ -0,0 +1 @@ +#include "so_peercred.c" diff --git a/tests-mx32/so_peercred-Xabbrev.gen.test b/tests-mx32/so_peercred-Xabbrev.gen.test new file mode 100755 index 00000000..64a5538b --- /dev/null +++ b/tests-mx32/so_peercred-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (so_peercred-Xabbrev -e trace=getsockopt -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt -Xabbrev diff --git a/tests-mx32/so_peercred-Xraw.c b/tests-mx32/so_peercred-Xraw.c new file mode 100644 index 00000000..e45f2df4 --- /dev/null +++ b/tests-mx32/so_peercred-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "so_peercred.c" diff --git a/tests-mx32/so_peercred-Xraw.gen.test b/tests-mx32/so_peercred-Xraw.gen.test new file mode 100755 index 00000000..471ae599 --- /dev/null +++ b/tests-mx32/so_peercred-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (so_peercred-Xraw -e trace=getsockopt -Xraw -a39); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt -Xraw -a39 diff --git a/tests-mx32/so_peercred-Xverbose.c b/tests-mx32/so_peercred-Xverbose.c new file mode 100644 index 00000000..1bb47e98 --- /dev/null +++ b/tests-mx32/so_peercred-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "so_peercred.c" diff --git a/tests-mx32/so_peercred-Xverbose.gen.test b/tests-mx32/so_peercred-Xverbose.gen.test new file mode 100755 index 00000000..2926517b --- /dev/null +++ b/tests-mx32/so_peercred-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (so_peercred-Xverbose -e trace=getsockopt -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt -Xverbose diff --git a/tests-mx32/so_peercred.c b/tests-mx32/so_peercred.c new file mode 100644 index 00000000..151bb175 --- /dev/null +++ b/tests-mx32/so_peercred.c @@ -0,0 +1,190 @@ +/* + * Check decoding of SO_PEERCRED socket option. + * + * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +#include "print_fields.h" + +static const char *errstr; + +static int +get_peercred(int fd, void *val, socklen_t *len) +{ + int rc = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, val, len); + errstr = sprintrc(rc); + return rc; +} + +static const char * +so_str(void) +{ + static char buf[256]; + + if (!buf[0]) { +#if XLAT_RAW + snprintf(buf, sizeof(buf), + "%#x, %#x", SOL_SOCKET, SO_PEERCRED); +#elif XLAT_VERBOSE + snprintf(buf, sizeof(buf), + "%#x /* SOL_SOCKET */, %#x /* SO_PEERCRED */", + SOL_SOCKET, SO_PEERCRED); +#else + snprintf(buf, sizeof(buf), + "SOL_SOCKET, SO_PEERCRED"); +#endif + } + + return buf; +} + +int +main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct ucred, peercred); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); + + const unsigned int sizeof_pid = sizeof(peercred->pid); + struct ucred *const pid = tail_alloc(sizeof_pid); + + const unsigned int sizeof_pid_truncated = sizeof_pid - 1; + struct ucred *const pid_truncated = + tail_alloc(sizeof_pid_truncated); + + const unsigned int sizeof_uid = offsetofend(struct ucred, uid); + struct ucred *const uid = tail_alloc(sizeof_uid); + + const unsigned int sizeof_uid_truncated = sizeof_uid - 1; + struct ucred *const uid_truncated = + tail_alloc(sizeof_uid_truncated); + + const unsigned int sizeof_gid_truncated = + offsetofend(struct ucred, gid) - 1; + struct ucred *const gid_truncated = + tail_alloc(sizeof_gid_truncated); + + int sv[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) + perror_msg_and_skip("socketpair AF_UNIX SOCK_STREAM"); + + /* classic getsockopt */ + *len = sizeof(*peercred); + get_peercred(sv[0], peercred, len); + printf("getsockopt(%d, %s", sv[0], so_str()); + PRINT_FIELD_D(", {", *peercred, pid); + PRINT_FIELD_UID(", ", *peercred, uid); + PRINT_FIELD_UID(", ", *peercred, gid); + printf("}, [%d]) = %s\n", *len, errstr); + + /* getsockopt with zero optlen */ + *len = 0; + get_peercred(sv[0], peercred, len); + printf("getsockopt(%d, %s, %p, [0]) = %s\n", + sv[0], so_str(), peercred, errstr); + + /* getsockopt with optlen larger than necessary - shortened */ + *len = sizeof(*peercred) + 1; + get_peercred(sv[0], peercred, len); + printf("getsockopt(%d, %s", sv[0], so_str()); + PRINT_FIELD_D(", {", *peercred, pid); + PRINT_FIELD_UID(", ", *peercred, uid); + PRINT_FIELD_UID(", ", *peercred, gid); + printf("}, [%u->%d]) = %s\n", + (unsigned int) sizeof(*peercred) + 1, *len, errstr); + + /* + * getsockopt with optlen less than offsetofend(struct ucred, pid): + * the part of struct ucred.pid is printed in hex. + */ + *len = sizeof_pid_truncated; + get_peercred(sv[0], pid_truncated, len); + printf("getsockopt(%d, %s, {pid=", sv[0], so_str()); + print_quoted_hex(pid_truncated, *len); + printf("}, [%d]) = %s\n", *len, errstr); + + /* + * getsockopt with optlen equals to sizeof(struct ucred.pid): + * struct ucred.uid and struct ucred.gid are not printed. + */ + *len = sizeof_pid; + get_peercred(sv[0], pid, len); + printf("getsockopt(%d, %s", sv[0], so_str()); + PRINT_FIELD_D(", {", *pid, pid); + printf("}, [%d]) = %s\n", *len, errstr); + + /* + * getsockopt with optlen greater than sizeof(struct ucred.pid) + * but smaller than offsetofend(struct ucred, uid): + * the part of struct ucred.uid is printed in hex. + */ + *len = sizeof_uid_truncated; + get_peercred(sv[0], uid_truncated, len); + /* + * Copy to a properly aligned structure to avoid unaligned access + * to struct ucred.pid field. + */ + memcpy(uid, uid_truncated, sizeof_uid_truncated); + printf("getsockopt(%d, %s", sv[0], so_str()); + PRINT_FIELD_D(", {", *uid, pid); + printf(", uid="); + print_quoted_hex(&uid->uid, sizeof_uid_truncated - + offsetof(struct ucred, uid)); + printf("}, [%d]) = %s\n", *len, errstr); + + /* + * getsockopt with optlen equals to offsetofend(struct ucred, uid): + * struct ucred.gid is not printed. + */ + *len = sizeof_uid; + get_peercred(sv[0], uid, len); + printf("getsockopt(%d, %s", sv[0], so_str()); + PRINT_FIELD_D(", {", *uid, pid); + PRINT_FIELD_UID(", ", *uid, uid); + printf("}, [%d]) = %s\n", *len, errstr); + + /* + * getsockopt with optlen greater than sizeof(struct ucred.uid) + * but smaller than offsetofend(struct ucred, gid): + * the part of struct ucred.gid is printed in hex. + */ + *len = sizeof_gid_truncated; + get_peercred(sv[0], gid_truncated, len); + /* + * Copy to a properly aligned structure to avoid unaligned access + * to struct ucred.pid and struct ucred.uid fields. + */ + memcpy(peercred, gid_truncated, sizeof_gid_truncated); + printf("getsockopt(%d, %s", sv[0], so_str()); + PRINT_FIELD_D(", {", *peercred, pid); + PRINT_FIELD_UID(", ", *peercred, uid); + printf(", gid="); + print_quoted_hex(&peercred->gid, sizeof_gid_truncated - + offsetof(struct ucred, gid)); + printf("}, [%d]) = %s\n", *len, errstr); + + /* getsockopt optval EFAULT */ + *len = sizeof(*peercred); + get_peercred(sv[0], &peercred->uid, len); + printf("getsockopt(%d, %s, %p, [%d]) = %s\n", + sv[0], so_str(), &peercred->uid, *len, errstr); + + /* getsockopt optlen EFAULT */ + get_peercred(sv[0], peercred, len + 1); + printf("getsockopt(%d, %s, %p, %p) = %s\n", + sv[0], so_str(), peercred, len + 1, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/so_peercred.gen.test b/tests-mx32/so_peercred.gen.test new file mode 100755 index 00000000..02eb4793 --- /dev/null +++ b/tests-mx32/so_peercred.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (so_peercred -e trace=getsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt diff --git a/tests-mx32/sock_filter-v-Xabbrev.c b/tests-mx32/sock_filter-v-Xabbrev.c new file mode 100644 index 00000000..ac680e2c --- /dev/null +++ b/tests-mx32/sock_filter-v-Xabbrev.c @@ -0,0 +1 @@ +#include "sock_filter-v.c" diff --git a/tests-mx32/sock_filter-v-Xabbrev.gen.test b/tests-mx32/sock_filter-v-Xabbrev.gen.test new file mode 100755 index 00000000..e52763fa --- /dev/null +++ b/tests-mx32/sock_filter-v-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sock_filter-v-Xabbrev -v -e trace=getsockopt,setsockopt -X abbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=getsockopt,setsockopt -X abbrev diff --git a/tests-mx32/sock_filter-v-Xraw.c b/tests-mx32/sock_filter-v-Xraw.c new file mode 100644 index 00000000..e85309c1 --- /dev/null +++ b/tests-mx32/sock_filter-v-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "sock_filter-v.c" diff --git a/tests-mx32/sock_filter-v-Xraw.gen.test b/tests-mx32/sock_filter-v-Xraw.gen.test new file mode 100755 index 00000000..3c7df814 --- /dev/null +++ b/tests-mx32/sock_filter-v-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sock_filter-v-Xraw -a 37 -v -e trace=getsockopt,setsockopt -X raw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a 37 -v -e trace=getsockopt,setsockopt -X raw diff --git a/tests-mx32/sock_filter-v-Xverbose.c b/tests-mx32/sock_filter-v-Xverbose.c new file mode 100644 index 00000000..59d76bdf --- /dev/null +++ b/tests-mx32/sock_filter-v-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "sock_filter-v.c" diff --git a/tests-mx32/sock_filter-v-Xverbose.gen.test b/tests-mx32/sock_filter-v-Xverbose.gen.test new file mode 100755 index 00000000..b58c5b51 --- /dev/null +++ b/tests-mx32/sock_filter-v-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sock_filter-v-Xverbose -v -e trace=getsockopt,setsockopt -X verbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=getsockopt,setsockopt -X verbose diff --git a/tests-mx32/sock_filter-v.c b/tests-mx32/sock_filter-v.c new file mode 100644 index 00000000..ac483646 --- /dev/null +++ b/tests-mx32/sock_filter-v.c @@ -0,0 +1,211 @@ +/* + * Check decoding of socket filters. + * + * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +/* SO_GET_FILTER was introduced by Linux commit v3.8-rc1~139^2~518 */ +#ifndef SO_GET_FILTER +# define SO_GET_FILTER SO_ATTACH_FILTER +#endif + +#define HEX_FMT "%#x" + +#if XLAT_RAW +# define XLAT_FMT HEX_FMT +# define XLAT_ARGS(a_) (a_) +#elif XLAT_VERBOSE +# define XLAT_FMT HEX_FMT " /* %s */" +# define XLAT_ARGS(a_) (a_), #a_ +#else +# define XLAT_FMT "%s" +# define XLAT_ARGS(a_) #a_ +#endif + +#define PRINT_STMT(pfx, code_fmt, k_fmt, ...) \ + printf("%sBPF_STMT(" code_fmt ", " k_fmt ")", pfx, __VA_ARGS__) + +#define PRINT_JUMP(pfx, code_fmt, k, jt, jf, ...) \ + printf("%sBPF_JUMP(" code_fmt ", %#x, %#x, %#x)", \ + pfx, __VA_ARGS__, k, jt, jf) + +static const struct sock_filter bpf_filter[] = { + BPF_STMT(BPF_LD|BPF_B|BPF_ABS, SKF_LL_OFF+4), + BPF_STMT(BPF_LD|BPF_B|BPF_ABS, SKF_NET_OFF+8), + BPF_STMT(BPF_LD|BPF_B|BPF_ABS, SKF_AD_OFF+SKF_AD_PROTOCOL), + BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, IPPROTO_UDP, 0, 5), + BPF_STMT(BPF_LD|BPF_W|BPF_LEN, 0), + BPF_JUMP(BPF_JMP|BPF_K|BPF_JGE, 100, 0, 3), + BPF_STMT(BPF_LD|BPF_B|BPF_ABS, 42), + BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, 'a', 0, 1), + BPF_STMT(BPF_RET|BPF_K, -1U), + BPF_STMT(BPF_RET|BPF_K, 0) +}; + +static void +print_filter(void) +{ + PRINT_STMT("[", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + XLAT_FMT "+4", + XLAT_ARGS(BPF_LD), XLAT_ARGS(BPF_B), XLAT_ARGS(BPF_ABS), + XLAT_ARGS(SKF_LL_OFF)); + PRINT_STMT(", ", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + XLAT_FMT "+8", + XLAT_ARGS(BPF_LD), XLAT_ARGS(BPF_B), XLAT_ARGS(BPF_ABS), + XLAT_ARGS(SKF_NET_OFF)); + PRINT_STMT(", ", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + XLAT_FMT "+" XLAT_FMT, + XLAT_ARGS(BPF_LD), XLAT_ARGS(BPF_B), XLAT_ARGS(BPF_ABS), + XLAT_ARGS(SKF_AD_OFF), XLAT_ARGS(SKF_AD_PROTOCOL)); + PRINT_JUMP(", ", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + IPPROTO_UDP, 0, 5, + XLAT_ARGS(BPF_JMP), XLAT_ARGS(BPF_K), XLAT_ARGS(BPF_JEQ)); + PRINT_STMT(", ", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + HEX_FMT, + XLAT_ARGS(BPF_LD), XLAT_ARGS(BPF_W), XLAT_ARGS(BPF_LEN), + 0); + PRINT_JUMP(", ", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + 100, 0, 3, + XLAT_ARGS(BPF_JMP), XLAT_ARGS(BPF_K), XLAT_ARGS(BPF_JGE)); + PRINT_STMT(", ", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + HEX_FMT, + XLAT_ARGS(BPF_LD), XLAT_ARGS(BPF_B), XLAT_ARGS(BPF_ABS), + 42); + PRINT_JUMP(", ", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + 'a', 0, 1, + XLAT_ARGS(BPF_JMP), XLAT_ARGS(BPF_K), XLAT_ARGS(BPF_JEQ)); + PRINT_STMT(", ", XLAT_FMT "|" XLAT_FMT, + HEX_FMT, + XLAT_ARGS(BPF_RET), XLAT_ARGS(BPF_K), + -1U); + PRINT_STMT(", ", XLAT_FMT "|" XLAT_FMT, + HEX_FMT, + XLAT_ARGS(BPF_RET), XLAT_ARGS(BPF_K), + 0); + putchar(']'); +} + +static const char *errstr; + +static int +get_filter(int fd, void *val, socklen_t *len) +{ + int rc = getsockopt(fd, SOL_SOCKET, SO_GET_FILTER, val, len); + errstr = sprintrc(rc); + return rc; +} + +static int +set_filter(int fd, void *val, socklen_t len) +{ + int rc = setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER, val, len); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + int rc; + struct sock_filter *const filter = + tail_memdup(bpf_filter, sizeof(bpf_filter)); + void *const efault = filter + ARRAY_SIZE(bpf_filter); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sock_fprog, prog); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); + + prog->len = ARRAY_SIZE(bpf_filter); + prog->filter = filter; + + int fd = socket(AF_INET, SOCK_DGRAM, 0); + if (fd < 0) + perror_msg_and_skip("socket AF_INET SOCK_DGRAM"); + + /* query sock_filter program length -> 0 */ + *len = BPF_MAXINSNS; + rc = get_filter(fd, NULL, len); + if (rc) + perror_msg_and_skip("getsockopt SOL_SOCKET SO_GET_FILTER"); + printf("getsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", NULL, [%u->0]) " + "= 0\n", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_GET_FILTER), + BPF_MAXINSNS); + + /* getsockopt NULL optlen - EFAULT */ + rc = get_filter(fd, NULL, NULL); + printf("getsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", NULL, NULL) " + "= %s\n", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_GET_FILTER), errstr); + + /* attach a filter */ + rc = set_filter(fd, prog, sizeof(*prog)); + if (rc) + perror_msg_and_skip("setsockopt SOL_SOCKET SO_ATTACH_FILTER"); + printf("setsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", {len=%u, filter=", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_ATTACH_FILTER), + prog->len); + print_filter(); + printf("}, %u) = 0\n", (unsigned int) sizeof(*prog)); + + /* setsockopt optlen is too small - EINVAL */ + rc = set_filter(fd, prog, sizeof(*prog) - 4); + printf("setsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", %p, %u) = %s\n", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_ATTACH_FILTER), prog, + (unsigned int) sizeof(*prog) - 4, errstr); + +#ifdef SO_ATTACH_REUSEPORT_CBPF + rc = setsockopt(fd, SOL_SOCKET, SO_ATTACH_REUSEPORT_CBPF, + prog, sizeof(*prog)); + errstr = sprintrc(rc); + printf("setsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", {len=%u, filter=", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_ATTACH_REUSEPORT_CBPF), + prog->len); + print_filter(); + printf("}, %u) = %s\n", (unsigned int) sizeof(*prog), errstr); +#endif + + /* query sock_filter program length -> ARRAY_SIZE(bpf_filter) */ + *len = 0; + rc = get_filter(fd, efault, len); + printf("getsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", %p, [0->%u]) " + "= %s\n", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_GET_FILTER), efault, + (unsigned int) ARRAY_SIZE(bpf_filter), errstr); + + /* getsockopt optlen is too small - EINVAL */ + *len = ARRAY_SIZE(bpf_filter) - 1; + rc = get_filter(fd, efault, len); + printf("getsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", %p, [%u]) = %s\n", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_GET_FILTER), efault, + (unsigned int) ARRAY_SIZE(bpf_filter) - 1, errstr); + + /* getsockopt optval EFAULT */ + *len = ARRAY_SIZE(bpf_filter); + rc = get_filter(fd, filter + 1, len); + printf("getsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", %p, [%u]) = %s\n", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_GET_FILTER), + filter + 1, (unsigned int) ARRAY_SIZE(bpf_filter), errstr); + + /* getsockopt optlen is too large - truncated */ + *len = ARRAY_SIZE(bpf_filter) + 1; + rc = get_filter(fd, filter, len); + printf("getsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", ", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_GET_FILTER)); + print_filter(); + printf(", [%u->%d]) = %s\n", + (unsigned int) ARRAY_SIZE(bpf_filter) + 1, *len, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/sock_filter-v.gen.test b/tests-mx32/sock_filter-v.gen.test new file mode 100755 index 00000000..611c2de9 --- /dev/null +++ b/tests-mx32/sock_filter-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sock_filter-v -v -e trace=getsockopt,setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=getsockopt,setsockopt diff --git a/tests-mx32/sockaddr_xlat-Xabbrev.c b/tests-mx32/sockaddr_xlat-Xabbrev.c new file mode 100644 index 00000000..e994e5ea --- /dev/null +++ b/tests-mx32/sockaddr_xlat-Xabbrev.c @@ -0,0 +1 @@ +#include "sockaddr_xlat.c" diff --git a/tests-mx32/sockaddr_xlat-Xabbrev.gen.test b/tests-mx32/sockaddr_xlat-Xabbrev.gen.test new file mode 100755 index 00000000..efdf0ac7 --- /dev/null +++ b/tests-mx32/sockaddr_xlat-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sockaddr_xlat-Xabbrev -Xabbrev -e trace=connect); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xabbrev -e trace=connect diff --git a/tests-mx32/sockaddr_xlat-Xraw.c b/tests-mx32/sockaddr_xlat-Xraw.c new file mode 100644 index 00000000..fb2d73df --- /dev/null +++ b/tests-mx32/sockaddr_xlat-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "sockaddr_xlat.c" diff --git a/tests-mx32/sockaddr_xlat-Xraw.gen.test b/tests-mx32/sockaddr_xlat-Xraw.gen.test new file mode 100755 index 00000000..d5339a7b --- /dev/null +++ b/tests-mx32/sockaddr_xlat-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sockaddr_xlat-Xraw -Xraw -e trace=connect); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xraw -e trace=connect diff --git a/tests-mx32/sockaddr_xlat-Xverbose.c b/tests-mx32/sockaddr_xlat-Xverbose.c new file mode 100644 index 00000000..d628975b --- /dev/null +++ b/tests-mx32/sockaddr_xlat-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "sockaddr_xlat.c" diff --git a/tests-mx32/sockaddr_xlat-Xverbose.gen.test b/tests-mx32/sockaddr_xlat-Xverbose.gen.test new file mode 100755 index 00000000..bde087b1 --- /dev/null +++ b/tests-mx32/sockaddr_xlat-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sockaddr_xlat-Xverbose -Xverbose -e trace=connect); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xverbose -e trace=connect diff --git a/tests-mx32/sockaddr_xlat.c b/tests-mx32/sockaddr_xlat.c new file mode 100644 index 00000000..b467c934 --- /dev/null +++ b/tests-mx32/sockaddr_xlat.c @@ -0,0 +1,271 @@ +/* + * Check decoding of sockaddr fields under xlat styles. + * + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_BLUETOOTH_BLUETOOTH_H +# include +# include +# include +# include +# include +#endif + +static void +check_ll(void) +{ + struct sockaddr_ll c_ll = { + .sll_family = AF_PACKET, + .sll_protocol = htons(ETH_P_ALL), + .sll_ifindex = 0xfacefeed, + .sll_hatype = ARPHRD_ETHER, + .sll_pkttype = PACKET_HOST, + .sll_halen = sizeof(c_ll.sll_addr), + .sll_addr = "abcdefgh" + }; + unsigned int len = sizeof(c_ll); + int rc = connect(-1, (void *) &c_ll, len); + const char *errstr = sprintrc(rc); + +#if XLAT_RAW + printf("connect(-1, {sa_family=%#x, sll_protocol=", AF_PACKET); + print_quoted_hex(&c_ll.sll_protocol, sizeof(c_ll.sll_protocol)); + printf(", sll_ifindex=%u, sll_hatype=%#x" + ", sll_pkttype=%u, sll_halen=%u, sll_addr=" + "[%#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x]" + "}, %u) = %s\n", + c_ll.sll_ifindex, ARPHRD_ETHER, + PACKET_HOST, c_ll.sll_halen, + c_ll.sll_addr[0], c_ll.sll_addr[1], + c_ll.sll_addr[2], c_ll.sll_addr[3], + c_ll.sll_addr[4], c_ll.sll_addr[5], + c_ll.sll_addr[6], c_ll.sll_addr[7], + len, errstr); +#elif XLAT_VERBOSE + printf("connect(-1, {sa_family=%#x /* AF_PACKET */" + ", sll_protocol=", AF_PACKET); + print_quoted_hex(&c_ll.sll_protocol, sizeof(c_ll.sll_protocol)); + printf(" /* htons(ETH_P_ALL) */" + ", sll_ifindex=%u, sll_hatype=%#x /* ARPHRD_ETHER */" + ", sll_pkttype=%u /* PACKET_HOST */, sll_halen=%u, sll_addr=" + "[%#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x]" + "}, %u) = %s\n", + c_ll.sll_ifindex, ARPHRD_ETHER, + PACKET_HOST, c_ll.sll_halen, + c_ll.sll_addr[0], c_ll.sll_addr[1], + c_ll.sll_addr[2], c_ll.sll_addr[3], + c_ll.sll_addr[4], c_ll.sll_addr[5], + c_ll.sll_addr[6], c_ll.sll_addr[7], + len, errstr); + +#else /* XLAT_ABBREV */ + printf("connect(-1, {sa_family=AF_PACKET" + ", sll_protocol=htons(ETH_P_ALL)" + ", sll_ifindex=%u, sll_hatype=ARPHRD_ETHER" + ", sll_pkttype=PACKET_HOST, sll_halen=%u, sll_addr=" + "[%#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x]" + "}, %u) = %s\n", + c_ll.sll_ifindex, c_ll.sll_halen, + c_ll.sll_addr[0], c_ll.sll_addr[1], + c_ll.sll_addr[2], c_ll.sll_addr[3], + c_ll.sll_addr[4], c_ll.sll_addr[5], + c_ll.sll_addr[6], c_ll.sll_addr[7], + len, errstr); +#endif +} + +static void +check_in(void) +{ + const unsigned short h_port = 12345; + static const char h_addr[] = "127.0.0.1"; + struct sockaddr_in in = { + .sin_family = AF_INET, + .sin_port = htons(h_port), + .sin_addr.s_addr = inet_addr(h_addr) + }; + unsigned int len = sizeof(in); + int rc = connect(-1, (void *) &in, len); + const char * errstr = sprintrc(rc); +#if XLAT_RAW + printf("connect(-1, {sa_family=%#x, sin_port=", AF_INET); + print_quoted_hex((const void *) &in.sin_port, sizeof(in.sin_port)); + printf(", sin_addr="); + print_quoted_hex((const void *) &in.sin_addr.s_addr, + sizeof(in.sin_addr.s_addr)); + printf("}, %u) = %s\n", len, errstr); +#elif XLAT_VERBOSE + printf("connect(-1, {sa_family=%#x /* AF_INET */, sin_port=", AF_INET); + print_quoted_hex((const void *) &in.sin_port, sizeof(in.sin_port)); + printf(" /* htons(%hu) */, sin_addr=", h_port); + print_quoted_hex((const void *) &in.sin_addr.s_addr, + sizeof(in.sin_addr.s_addr)); + printf(" /* inet_addr(\"%s\") */}, %u) = %s\n", + h_addr, len, errstr); +#else /* XLAT_ABBREV */ + printf("connect(-1, {sa_family=AF_INET, sin_port=htons(%hu)" + ", sin_addr=inet_addr(\"%s\")}, %u) = %s\n", + h_port, h_addr, len, errstr); +#endif +} + +static void +validate_in6(struct sockaddr_in6 *const in6, const char *const h_addr) +{ + inet_pton(AF_INET6, h_addr, &in6->sin6_addr); + + unsigned int len = sizeof(*in6); + int rc = connect(-1, (void *) in6, len); + const char *errstr = sprintrc(rc); +#if XLAT_RAW + printf("connect(-1, {sa_family=%#x, sin6_port=", AF_INET6); + print_quoted_hex(&in6->sin6_port, sizeof(in6->sin6_port)); + printf(", sin6_flowinfo="); + print_quoted_hex(&in6->sin6_flowinfo, sizeof(in6->sin6_flowinfo)); + printf(", sin6_addr="); + print_quoted_hex(&in6->sin6_addr, sizeof(struct in6_addr)); + printf(", sin6_scope_id=%u}, %u) = %s\n", + in6->sin6_scope_id, len, errstr); +#elif XLAT_VERBOSE + printf("connect(-1, {sa_family=%#x /* AF_INET6 */", AF_INET6); + printf(", sin6_port="); + print_quoted_hex(&in6->sin6_port, sizeof(in6->sin6_port)); + printf(" /* htons(%hu) */", ntohs(in6->sin6_port)); + printf(", sin6_flowinfo="); + print_quoted_hex(&in6->sin6_flowinfo, sizeof(in6->sin6_flowinfo)); + printf(" /* htonl(%u) */", ntohl(in6->sin6_flowinfo)); + printf(", sin6_addr="); + print_quoted_hex(&in6->sin6_addr, sizeof(struct in6_addr)); + printf(" /* inet_pton(AF_INET6, \"%s\") */", h_addr); + printf(", sin6_scope_id=%u}, %u) = %s\n", + in6->sin6_scope_id, len, errstr); +#else + printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", sin6_flowinfo=htonl(%u)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" + ", sin6_scope_id=%u}, %u)" + " = %s\n", + ntohs(in6->sin6_port), ntohl(in6->sin6_flowinfo), + h_addr, in6->sin6_scope_id, len, errstr); +#endif +} + +static void +check_in6(void) +{ + struct sockaddr_in6 in6 = { + .sin6_family = AF_INET6, + .sin6_port = htons(12345), + .sin6_flowinfo = htonl(123456890), + .sin6_scope_id = 0xfacefeed + }; + + validate_in6(&in6, "12:34:56:78:90:ab:cd:ef"); + validate_in6(&in6, "::"); + validate_in6(&in6, "::1"); +} + +#ifdef HAVE_BLUETOOTH_BLUETOOTH_H +static void +check_sco(void) +{ + const struct sockaddr_sco c_sco = { + .sco_family = AF_BLUETOOTH, + .sco_bdaddr.b = "abcdef" + }; + void *sco = tail_memdup(&c_sco, sizeof(c_sco)); + unsigned int len = sizeof(c_sco); + int ret = connect(-1, sco, len); + const char *errstr = sprintrc(ret); +# if XLAT_RAW + printf("connect(-1, {sa_family=%#x, sco_bdaddr=", AF_BLUETOOTH); + print_quoted_hex((const void *) &c_sco.sco_bdaddr, + sizeof(c_sco.sco_bdaddr)); + printf("}, %u) = %s\n", len, errstr); +# elif XLAT_VERBOSE + printf("connect(-1, {sa_family=%#x /* AF_BLUETOOTH */" + ", sco_bdaddr=", AF_BLUETOOTH); + print_quoted_hex((const void *) &c_sco.sco_bdaddr, + sizeof(c_sco.sco_bdaddr)); + printf(" /* %02x:%02x:%02x:%02x:%02x:%02x */" + "}, %u) = %s\n", + c_sco.sco_bdaddr.b[0], c_sco.sco_bdaddr.b[1], + c_sco.sco_bdaddr.b[2], c_sco.sco_bdaddr.b[3], + c_sco.sco_bdaddr.b[4], c_sco.sco_bdaddr.b[5], + len, errstr); +# else + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", sco_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + "}, %u) = %s\n", + c_sco.sco_bdaddr.b[0], c_sco.sco_bdaddr.b[1], + c_sco.sco_bdaddr.b[2], c_sco.sco_bdaddr.b[3], + c_sco.sco_bdaddr.b[4], c_sco.sco_bdaddr.b[5], + len, errstr); +# endif +} + +static void +check_rc(void) +{ + const struct sockaddr_rc c_rc = { + .rc_family = AF_BLUETOOTH, + .rc_bdaddr.b = "abcdef", + .rc_channel = 42 + }; + void *rc = tail_memdup(&c_rc, sizeof(c_rc)); + unsigned int len = sizeof(c_rc); + int ret = connect(-1, rc, len); + const char *errstr = sprintrc(ret); +# if XLAT_RAW + printf("connect(-1, {sa_family=%#x, rc_bdaddr=", AF_BLUETOOTH); + print_quoted_hex((const void *) &c_rc.rc_bdaddr, + sizeof(c_rc.rc_bdaddr)); + printf(", rc_channel=%u}, %u) = %s\n", c_rc.rc_channel, len, errstr); +# elif XLAT_VERBOSE + printf("connect(-1, {sa_family=%#x /* AF_BLUETOOTH */" + ", rc_bdaddr=", AF_BLUETOOTH); + print_quoted_hex((const void *) &c_rc.rc_bdaddr, + sizeof(c_rc.rc_bdaddr)); + printf(" /* %02x:%02x:%02x:%02x:%02x:%02x */" + ", rc_channel=%u}, %u) = %s\n", + c_rc.rc_bdaddr.b[0], c_rc.rc_bdaddr.b[1], + c_rc.rc_bdaddr.b[2], c_rc.rc_bdaddr.b[3], + c_rc.rc_bdaddr.b[4], c_rc.rc_bdaddr.b[5], + c_rc.rc_channel, len, errstr); +# else + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", rc_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + ", rc_channel=%u}, %u) = %s\n", + c_rc.rc_bdaddr.b[0], c_rc.rc_bdaddr.b[1], + c_rc.rc_bdaddr.b[2], c_rc.rc_bdaddr.b[3], + c_rc.rc_bdaddr.b[4], c_rc.rc_bdaddr.b[5], + c_rc.rc_channel, len, errstr); +# endif +} +#endif /* HAVE_BLUETOOTH_BLUETOOTH_H */ + +int +main(void) +{ + check_ll(); + check_in(); + check_in6(); +#ifdef HAVE_BLUETOOTH_BLUETOOTH_H + check_sco(); + check_rc(); +#endif + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/socketcall.c b/tests-mx32/socketcall.c index 4fe1ea3a..aa68a7eb 100644 --- a/tests-mx32/socketcall.c +++ b/tests-mx32/socketcall.c @@ -1,30 +1,10 @@ /* * Check decoding of socketcall syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/socketcall.gen.test b/tests-mx32/socketcall.gen.test new file mode 100755 index 00000000..d18b0364 --- /dev/null +++ b/tests-mx32/socketcall.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (socketcall -a20 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests-mx32/socketcall.test b/tests-mx32/socketcall.test deleted file mode 100755 index 959bc83d..00000000 --- a/tests-mx32/socketcall.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of socketcall syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 diff --git a/tests-mx32/sockname.c b/tests-mx32/sockname.c index c5072cac..cac4f4e2 100644 --- a/tests-mx32/sockname.c +++ b/tests-mx32/sockname.c @@ -2,29 +2,10 @@ * Check decoding of sockname family syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -41,9 +22,9 @@ # error TEST_SYSCALL_NAME must be defined #endif -#define TEST_SYSCALL_STR__(a) #a -#define TEST_SYSCALL_STR_(a) TEST_SYSCALL_STR__(a) -#define TEST_SYSCALL_STR TEST_SYSCALL_STR_(TEST_SYSCALL_NAME) +#ifndef TEST_SYSCALL_STR +# define TEST_SYSCALL_STR STRINGIFY_VAL(TEST_SYSCALL_NAME) +#endif #define TEST_SOCKET TEST_SYSCALL_STR ".socket" #ifdef TEST_SYSCALL_PREPARE @@ -74,7 +55,7 @@ static void test_sockname_syscall(const int fd) { - socklen_t *const plen = tail_alloc(sizeof(*plen)); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, plen); *plen = sizeof(struct sockaddr_un); struct sockaddr_un *addr = tail_alloc(*plen); diff --git a/tests-mx32/sockopt-sol_netlink.c b/tests-mx32/sockopt-sol_netlink.c new file mode 100644 index 00000000..a797a6f1 --- /dev/null +++ b/tests-mx32/sockopt-sol_netlink.c @@ -0,0 +1,193 @@ +/* + * Check decoding of getsockopt and setsockopt for SOL_NETLINK level. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include "netlink.h" +#include + +#ifndef SOL_NETLINK +# define SOL_NETLINK 270 +#endif + +static int rc; +static const char *errstr; + +static int +get_sockopt(int fd, int name, void *val, socklen_t *len) +{ + rc = getsockopt(fd, SOL_NETLINK, name, val, len); + errstr = sprintrc(rc); + return rc; +} + +static int +set_sockopt(int fd, int name, void *val, socklen_t len) +{ + rc = setsockopt(fd, SOL_NETLINK, name, val, len); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const struct { + int val; + const char *str; + } names[] = { +#ifdef NETLINK_ADD_MEMBERSHIP + { ARG_STR(NETLINK_ADD_MEMBERSHIP) }, +#endif +#ifdef NETLINK_DROP_MEMBERSHIP + { ARG_STR(NETLINK_DROP_MEMBERSHIP) }, +#endif +#ifdef NETLINK_PKTINFO + { ARG_STR(NETLINK_PKTINFO) }, +#endif +#ifdef NETLINK_BROADCAST_ERROR + { ARG_STR(NETLINK_BROADCAST_ERROR) }, +#endif +#ifdef NETLINK_NO_ENOBUFS + { ARG_STR(NETLINK_NO_ENOBUFS) }, +#endif +#ifdef NETLINK_RX_RING + { ARG_STR(NETLINK_RX_RING) }, +#endif +#ifdef NETLINK_TX_RING + { ARG_STR(NETLINK_TX_RING) }, +#endif +#ifdef NETLINK_LISTEN_ALL_NSID + { ARG_STR(NETLINK_LISTEN_ALL_NSID) }, +#endif +#ifdef NETLINK_LIST_MEMBERSHIPS + { ARG_STR(NETLINK_LIST_MEMBERSHIPS) }, +#endif +#ifdef NETLINK_CAP_ACK + { ARG_STR(NETLINK_CAP_ACK) }, +#endif +#ifdef NETLINK_EXT_ACK + { ARG_STR(NETLINK_EXT_ACK) }, +#endif + }; + + TAIL_ALLOC_OBJECT_CONST_PTR(int, val); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); + void *const efault = val + 1; + int fd = socket(AF_NETLINK, SOCK_RAW, 0); + if (fd < 0) + perror_msg_and_skip("socket AF_NETLINK SOCK_RAW"); + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(names); ++i) { + /* getsockopt */ + + /* classic */ + *len = sizeof(*val); + get_sockopt(fd, names[i].val, val, len); + printf("getsockopt(%d, SOL_NETLINK, %s, ", fd, names[i].str); + if (rc) + printf("%p", val); + else + printf("[%d]", *val); + printf(", [%d]) = %s\n", *len, errstr); + + /* optlen larger than necessary - shortened */ + *len = sizeof(*val) + 1; + get_sockopt(fd, names[i].val, val, len); + printf("getsockopt(%d, SOL_NETLINK, %s, ", fd, names[i].str); + if (rc) + printf("%p", val); + else + printf("[%d]", *val); + printf(", [%d", (int) sizeof(*val) + 1); + if ((int) sizeof(*val) + 1 != *len) + printf("->%d", *len); + printf("]) = %s\n", errstr); + + /* zero optlen - print returned optlen */ + *len = 0; + get_sockopt(fd, names[i].val, NULL, len); + printf("getsockopt(%d, SOL_NETLINK, %s, NULL, [0", + fd, names[i].str); + if (*len) + printf("->%d", *len); + printf("]) = %s\n", errstr); + +#ifdef NETLINK_LIST_MEMBERSHIPS + if (names[i].val != NETLINK_LIST_MEMBERSHIPS) { +#endif + /* optlen shorter than necessary - print address */ + *len = sizeof(*val) - 1; + get_sockopt(fd, names[i].val, val, len); + printf("getsockopt(%d, SOL_NETLINK, %s, %p, [%d", + fd, names[i].str, val, (int) sizeof(*val) - 1); + if ((int) sizeof(*val) - 1 != *len) + printf("->%d", *len); + printf("]) = %s\n", errstr); +#ifdef NETLINK_LIST_MEMBERSHIPS + } else { + /* optlen shorter than required for the first element */ + *len = sizeof(*val) - 1; + get_sockopt(fd, names[i].val, efault, len); + printf("getsockopt(%d, SOL_NETLINK, %s, ", + fd, names[i].str); + if (rc) + printf("%p", efault); + else + printf("[]"); + printf(", [%d", (int) sizeof(*val) - 1); + if ((int) sizeof(*val) - 1 != *len) + printf("->%d", *len); + printf("]) = %s\n", errstr); + } +#endif + + /* optval EFAULT - print address */ + *len = sizeof(*val); + get_sockopt(fd, names[i].val, efault, len); + printf("getsockopt(%d, SOL_NETLINK, %s, %p, [%d]) = %s\n", + fd, names[i].str, efault, *len, errstr); + + /* optlen EFAULT - print address */ + get_sockopt(fd, names[i].val, val, len + 1); + printf("getsockopt(%d, SOL_NETLINK, %s, %p, %p) = %s\n", + fd, names[i].str, val, len + 1, errstr); + + /* setsockopt */ + + /* classic */ + *val = 0xdefaced; + set_sockopt(fd, names[i].val, val, sizeof(*val)); + printf("setsockopt(%d, SOL_NETLINK, %s, [%d], %d) = %s\n", + fd, names[i].str, *val, (int) sizeof(*val), errstr); + + /* optlen larger than necessary - shortened */ + set_sockopt(fd, names[i].val, val, sizeof(*val) + 1); + printf("setsockopt(%d, SOL_NETLINK, %s, [%d], %d) = %s\n", + fd, names[i].str, *val, (int) sizeof(*val) + 1, errstr); + + /* optlen < 0 - print address */ + set_sockopt(fd, names[i].val, val, -1U); + printf("setsockopt(%d, SOL_NETLINK, %s, %p, -1) = %s\n", + fd, names[i].str, val, errstr); + + /* optlen smaller than necessary - print address */ + set_sockopt(fd, names[i].val, val, sizeof(*val) - 1); + printf("setsockopt(%d, SOL_NETLINK, %s, %p, %d) = %s\n", + fd, names[i].str, val, (int) sizeof(*val) - 1, errstr); + + /* optval EFAULT - print address */ + set_sockopt(fd, names[i].val, efault, sizeof(*val)); + printf("setsockopt(%d, SOL_NETLINK, %s, %p, %d) = %s\n", + fd, names[i].str, efault, (int) sizeof(*val), errstr); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/sockopt-sol_netlink.gen.test b/tests-mx32/sockopt-sol_netlink.gen.test new file mode 100755 index 00000000..a2ba06dd --- /dev/null +++ b/tests-mx32/sockopt-sol_netlink.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sockopt-sol_netlink -e trace=getsockopt,setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt,setsockopt diff --git a/tests-mx32/sockopt-timestamp.c b/tests-mx32/sockopt-timestamp.c new file mode 100644 index 00000000..c2659925 --- /dev/null +++ b/tests-mx32/sockopt-timestamp.c @@ -0,0 +1,197 @@ +/* + * Check decoding of timestamp control messages. + * + * Copyright (c) 2019 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +#if defined HAVE_STRUCT___KERNEL_SOCK_TIMEVAL \ + || defined HAVE_STRUCT___KERNEL_TIMESPEC +# include +#endif + +#define XLAT_MACROS_ONLY +#include "xlat/sock_options.h" +#undef XLAT_MACROS_ONLY + +static void +print_timestamp_old(const struct cmsghdr *c) +{ + const void *cmsg_header = c; + const void *cmsg_data = CMSG_DATA(c); + const struct timeval *tv = cmsg_data; + const unsigned int expected_len = sizeof(*tv); + const unsigned int data_len = c->cmsg_len - (cmsg_data - cmsg_header); + + if (expected_len != data_len) + perror_msg_and_fail("sizeof(struct timeval) = %u" + ", data_len = %u\n", + expected_len, data_len); + printf("{tv_sec=%lld, tv_usec=%lld}", + (long long) tv->tv_sec, (long long) tv->tv_usec); +} + +static void +print_timestampns_old(const struct cmsghdr *c) +{ + const void *cmsg_header = c; + const void *cmsg_data = CMSG_DATA(c); + const struct timespec *ts = cmsg_data; + const unsigned int expected_len = sizeof(*ts); + const unsigned int data_len = c->cmsg_len - (cmsg_data - cmsg_header); + + if (expected_len != data_len) + perror_msg_and_fail("sizeof(struct timespec) = %u" + ", data_len = %u\n", + expected_len, data_len); + printf("{tv_sec=%lld, tv_nsec=%lld}", + (long long) ts->tv_sec, (long long) ts->tv_nsec); +} + +#ifdef HAVE_STRUCT___KERNEL_SOCK_TIMEVAL +static void +print_timestamp_new(const struct cmsghdr *c) +{ + const void *cmsg_header = c; + const void *cmsg_data = CMSG_DATA(c); + const struct __kernel_sock_timeval *tv = cmsg_data; + const unsigned int expected_len = sizeof(*tv); + const unsigned int data_len = c->cmsg_len - (cmsg_data - cmsg_header); + + if (expected_len != data_len) + perror_msg_and_fail("sizeof(struct __kernel_sock_timeval) = %u" + ", data_len = %u\n", + expected_len, data_len); + printf("{tv_sec=%lld, tv_usec=%lld}", + (long long) tv->tv_sec, (long long) tv->tv_usec); +} +#endif /* HAVE_STRUCT___KERNEL_SOCK_TIMEVAL */ + +#ifdef HAVE_STRUCT___KERNEL_TIMESPEC +static void +print_timestampns_new(const struct cmsghdr *c) +{ + const void *cmsg_header = c; + const void *cmsg_data = CMSG_DATA(c); + const struct __kernel_timespec *ts = cmsg_data; + const unsigned int expected_len = sizeof(*ts); + const unsigned int data_len = c->cmsg_len - (cmsg_data - cmsg_header); + + if (expected_len != data_len) + perror_msg_and_fail("sizeof(struct __kernel_timespec) = %u" + ", data_len = %u\n", + expected_len, data_len); + printf("{tv_sec=%lld, tv_nsec=%lld}", + (long long) ts->tv_sec, (long long) ts->tv_nsec); +} +#endif /* HAVE_STRUCT___KERNEL_TIMESPEC */ + +static unsigned int +test_sockopt(int so_val, const char *str, void (*fun)(const struct cmsghdr *)) +{ + static const char data[] = "socketpair"; + const size_t size = sizeof(data) - 1; + + int sv[2]; + if (socketpair(AF_UNIX, SOCK_DGRAM, 0, sv)) + perror_msg_and_skip(data); + + const int opt_1 = 1; + if (setsockopt(sv[0], SOL_SOCKET, so_val, &opt_1, sizeof(opt_1))) { + perror(str); + return 0; + } + + if (send(sv[1], data, size, 0) != (int) size) + perror_msg_and_fail("send"); + if (close(sv[1])) + perror_msg_and_fail("close send"); + + char buf[size]; + struct iovec iov = { + .iov_base = buf, + .iov_len = sizeof(buf) + }; + struct cmsghdr control[16]; + struct msghdr mh = { + .msg_iov = &iov, + .msg_iovlen = 1, + .msg_control = control, + .msg_controllen = sizeof(control) + }; + + if (recvmsg(sv[0], &mh, 0) != (int) size) + perror_msg_and_fail("recvmsg"); + if (close(sv[0])) + perror_msg_and_fail("close recv"); + + printf("recvmsg(%d, {msg_name=NULL, msg_namelen=0" + ", msg_iov=[{iov_base=\"%s\", iov_len=%u}], msg_iovlen=1", + sv[0], data, (unsigned int) size); + + unsigned int tested = 0; + if (mh.msg_controllen) { + printf(", msg_control=["); + for (struct cmsghdr *c = CMSG_FIRSTHDR(&mh); c; + c = CMSG_NXTHDR(&mh, c)) { + printf("%s{cmsg_len=%lu, cmsg_level=", + (c == control ? "" : ", "), + (unsigned long) c->cmsg_len); + if (c->cmsg_level == SOL_SOCKET) { + printf("SOL_SOCKET"); + } else { + printf("%d", c->cmsg_level); + } + printf(", cmsg_type="); + if (c->cmsg_type == so_val) { + printf("%s, cmsg_data=", str); + fun(c); + tested = 1; + } else { + printf("%d", c->cmsg_type); + } + printf("}"); + } + printf("]"); + } + printf(", msg_controllen=%lu, msg_flags=0}, 0) = %u\n", + (unsigned long) mh.msg_controllen, (unsigned int) size); + + return tested; +} + +int +main(void) +{ + static const struct { + int val; + const char *str; + void (*fun)(const struct cmsghdr *); + } tests[] = { + { SO_TIMESTAMP_OLD, "SO_TIMESTAMP_OLD", print_timestamp_old }, + { SO_TIMESTAMPNS_OLD, "SO_TIMESTAMPNS_OLD", print_timestampns_old }, +#ifdef HAVE_STRUCT___KERNEL_SOCK_TIMEVAL + { SO_TIMESTAMP_NEW, "SO_TIMESTAMP_NEW", print_timestamp_new }, +#endif +#ifdef HAVE_STRUCT___KERNEL_TIMESPEC + { SO_TIMESTAMPNS_NEW, "SO_TIMESTAMPNS_NEW", print_timestampns_new }, +#endif + }; + unsigned int tested = 0; + for (unsigned int i = 0; i < ARRAY_SIZE(tests); ++i) + tested |= test_sockopt(tests[i].val, + tests[i].str, + tests[i].fun); + if (!tested) + return 77; + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/sockopt-timestamp.gen.test b/tests-mx32/sockopt-timestamp.gen.test new file mode 100755 index 00000000..a71ca4c4 --- /dev/null +++ b/tests-mx32/sockopt-timestamp.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sockopt-timestamp -e trace=recvmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=recvmsg diff --git a/tests-mx32/splice.c b/tests-mx32/splice.c index b6f25256..2acdde7f 100644 --- a/tests-mx32/splice.c +++ b/tests-mx32/splice.c @@ -2,29 +2,10 @@ * This file is part of splice strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,8 +21,8 @@ main(void) { const long int fd_in = (long int) 0xdeadbeefffffffffULL; const long int fd_out = (long int) 0xdeadbeeffffffffeULL; - long long int *const off_in = tail_alloc(sizeof(*off_in)); - long long int *const off_out = tail_alloc(sizeof(*off_out)); + TAIL_ALLOC_OBJECT_CONST_PTR(long long int, off_in); + TAIL_ALLOC_OBJECT_CONST_PTR(long long int, off_out); *off_in = 0xdeadbef1facefed1ULL; *off_out = 0xdeadbef2facefed2ULL; const size_t len = (size_t) 0xdeadbef3facefed3ULL; diff --git a/tests-mx32/splice.gen.test b/tests-mx32/splice.gen.test new file mode 100755 index 00000000..75660806 --- /dev/null +++ b/tests-mx32/splice.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (splice ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/splice.test b/tests-mx32/splice.test deleted file mode 100755 index cc5c327e..00000000 --- a/tests-mx32/splice.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check splice syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/sprintrc.c b/tests-mx32/sprintrc.c index 7423afb6..5266ef18 100644 --- a/tests-mx32/sprintrc.c +++ b/tests-mx32/sprintrc.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -54,9 +35,6 @@ sprintrc_ex(long rc, enum sprintrc_fmt fmt) }; static char buf[4096]; - if (fmt >= ARRAY_SIZE(formats)) - perror_msg_and_fail("sprintrc_ex: incorrect format provided"); - if (rc == 0) return "0"; diff --git a/tests-mx32/stack-fcall-0.c b/tests-mx32/stack-fcall-0.c index 12a260de..8a26a79c 100644 --- a/tests-mx32/stack-fcall-0.c +++ b/tests-mx32/stack-fcall-0.c @@ -1,4 +1,11 @@ -int f1(int i); +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "stack-fcall.h" int f0(int i) { diff --git a/tests-mx32/stack-fcall-1.c b/tests-mx32/stack-fcall-1.c index 8716702d..b5cd89b3 100644 --- a/tests-mx32/stack-fcall-1.c +++ b/tests-mx32/stack-fcall-1.c @@ -1,4 +1,11 @@ -int f2(int i); +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "stack-fcall.h" int f1(int i) { diff --git a/tests-mx32/stack-fcall-2.c b/tests-mx32/stack-fcall-2.c index 19f8cf83..16beee58 100644 --- a/tests-mx32/stack-fcall-2.c +++ b/tests-mx32/stack-fcall-2.c @@ -1,4 +1,11 @@ -int f3(int i); +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "stack-fcall.h" int f2(int i) { diff --git a/tests-mx32/stack-fcall-3.c b/tests-mx32/stack-fcall-3.c index 3af1667f..538b6565 100644 --- a/tests-mx32/stack-fcall-3.c +++ b/tests-mx32/stack-fcall-3.c @@ -1,6 +1,23 @@ +/* + * Copyright (c) 2014-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include #include +#include "stack-fcall.h" + int f3(int i) { - return getpid() + i; + switch (i) { + case 1: + return kill(getpid(), SIGURG); + + default: + return chdir("") + i; + } + } diff --git a/tests-mx32/stack-fcall-mangled-0.c b/tests-mx32/stack-fcall-mangled-0.c new file mode 100644 index 00000000..47549401 --- /dev/null +++ b/tests-mx32/stack-fcall-mangled-0.c @@ -0,0 +1,2 @@ +#define MANGLE +#include "stack-fcall-0.c" diff --git a/tests-mx32/stack-fcall-mangled-1.c b/tests-mx32/stack-fcall-mangled-1.c new file mode 100644 index 00000000..492c562b --- /dev/null +++ b/tests-mx32/stack-fcall-mangled-1.c @@ -0,0 +1,2 @@ +#define MANGLE +#include "stack-fcall-1.c" diff --git a/tests-mx32/stack-fcall-mangled-2.c b/tests-mx32/stack-fcall-mangled-2.c new file mode 100644 index 00000000..eb7c3624 --- /dev/null +++ b/tests-mx32/stack-fcall-mangled-2.c @@ -0,0 +1,2 @@ +#define MANGLE +#include "stack-fcall-2.c" diff --git a/tests-mx32/stack-fcall-mangled-3.c b/tests-mx32/stack-fcall-mangled-3.c new file mode 100644 index 00000000..98f738b4 --- /dev/null +++ b/tests-mx32/stack-fcall-mangled-3.c @@ -0,0 +1,2 @@ +#define MANGLE +#include "stack-fcall-3.c" diff --git a/tests-mx32/stack-fcall-mangled.c b/tests-mx32/stack-fcall-mangled.c new file mode 100644 index 00000000..67862059 --- /dev/null +++ b/tests-mx32/stack-fcall-mangled.c @@ -0,0 +1,2 @@ +#define MANGLE +#include "stack-fcall.c" diff --git a/tests-mx32/stack-fcall.c b/tests-mx32/stack-fcall.c index 134d54f6..cf4000e5 100644 --- a/tests-mx32/stack-fcall.c +++ b/tests-mx32/stack-fcall.c @@ -1,7 +1,15 @@ -int f0(int i); +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ -int main(int argc, char** argv) +#include "stack-fcall.h" + +int main(void) { - f0(argc); + f0(0); + f0(1); return 0; } diff --git a/tests-mx32/stack-fcall.h b/tests-mx32/stack-fcall.h new file mode 100644 index 00000000..cca0f94f --- /dev/null +++ b/tests-mx32/stack-fcall.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifdef MANGLE + +# define f0 _ZN2ns2f0Ei +# define f1 _ZN2ns2f1Ei +# define f2 _ZN2ns2f2Ei +# define f3 _ZN2ns2f3Ei + +#endif + +int f0(int i); +int f1(int i); +int f2(int i); +int f3(int i); diff --git a/tests-mx32/stat.c b/tests-mx32/stat.c index d4ca7b0b..8c8daad1 100644 --- a/tests-mx32/stat.c +++ b/tests-mx32/stat.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/stat.gen.test b/tests-mx32/stat.gen.test new file mode 100755 index 00000000..13ccd0b8 --- /dev/null +++ b/tests-mx32/stat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (stat -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests-mx32/stat.test b/tests-mx32/stat.test deleted file mode 100755 index ba8938c0..00000000 --- a/tests-mx32/stat.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check stat syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests-mx32/stat64.c b/tests-mx32/stat64.c index 782de33d..12ded432 100644 --- a/tests-mx32/stat64.c +++ b/tests-mx32/stat64.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/stat64.gen.test b/tests-mx32/stat64.gen.test new file mode 100755 index 00000000..f49df37a --- /dev/null +++ b/tests-mx32/stat64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (stat64 -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests-mx32/stat64.test b/tests-mx32/stat64.test deleted file mode 100755 index abcfb9ec..00000000 --- a/tests-mx32/stat64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check stat64 syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests-mx32/statfs.c b/tests-mx32/statfs.c index 6032a668..5672a7fc 100644 --- a/tests-mx32/statfs.c +++ b/tests-mx32/statfs.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2014-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/statfs.expected b/tests-mx32/statfs.expected deleted file mode 100644 index 11e9f0b1..00000000 --- a/tests-mx32/statfs.expected +++ /dev/null @@ -1 +0,0 @@ -statfs(64)?\("/proc/self/status"(, [1-9][0-9]*)?, \{f_type=PROC_SUPER_MAGIC, f_bsize=[1-9][0-9]*, f_blocks=[0-9]+, f_bfree=[0-9]+, f_bavail=[0-9]+, f_files=[0-9]+, f_ffree=[0-9]+, f_fsid=\{val=\[[0-9]+, [0-9]+\]\}, f_namelen=[1-9][0-9]*(, f_frsize=[0-9]+)?(, f_flags=ST_VALID(\|ST_[A-Z]+)*)?\}\) += 0 diff --git a/tests-mx32/statfs.gen.test b/tests-mx32/statfs.gen.test new file mode 100755 index 00000000..32204a14 --- /dev/null +++ b/tests-mx32/statfs.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (statfs -a17 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-mx32/statfs.test b/tests-mx32/statfs.test deleted file mode 100755 index 6075576f..00000000 --- a/tests-mx32/statfs.test +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# Check statfs syscall decoding. - -. "${srcdir=.}/init.sh" - -# this test probes /proc/self/status -[ -f /proc/self/status ] || - framework_skip_ '/proc/self/status is not available' - -run_strace_match_diff -a17 diff --git a/tests-mx32/statfs64.c b/tests-mx32/statfs64.c index f46e7670..1e0a4b24 100644 --- a/tests-mx32/statfs64.c +++ b/tests-mx32/statfs64.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/statfs64.gen.test b/tests-mx32/statfs64.gen.test new file mode 100755 index 00000000..8f6f06f7 --- /dev/null +++ b/tests-mx32/statfs64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (statfs64 -a23 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 diff --git a/tests-mx32/statfs64.test b/tests-mx32/statfs64.test deleted file mode 100755 index 9c0aa278..00000000 --- a/tests-mx32/statfs64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check statfs64 syscall decoding. - -. "${srcdir=.}/statfs.test" diff --git a/tests-mx32/statx.c b/tests-mx32/statx.c new file mode 100644 index 00000000..c5e86ad2 --- /dev/null +++ b/tests-mx32/statx.c @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_statx + +# include +# include "xlat.h" +# include "xlat/statx_masks.h" +# include "xlat/statx_attrs.h" +# include "xlat/at_statx_sync_types.h" + +# define IS_STATX 1 +# define TEST_SYSCALL_STR "statx" +# define STRUCT_STAT struct statx +# define STRUCT_STAT_STR "struct statx" +# define STRUCT_STAT_IS_STAT64 0 + +static unsigned TEST_SYSCALL_STATX_FLAGS = AT_STATX_SYNC_AS_STAT; +static const char *TEST_SYSCALL_STATX_FLAGS_STR = "AT_STATX_SYNC_AS_STAT"; +static unsigned TEST_SYSCALL_STATX_MASK = STATX_ALL; +static const char *TEST_SYSCALL_STATX_MASK_STR = "STATX_ALL"; + +# define TEST_SYSCALL_INVOKE(sample, pst) \ + syscall(__NR_statx, AT_FDCWD, sample, TEST_SYSCALL_STATX_FLAGS, \ + TEST_SYSCALL_STATX_MASK, pst) +# define PRINT_SYSCALL_HEADER(sample) \ + do { \ + int saved_errno = errno; \ + printf("%s(AT_FDCWD, \"%s\", %s, %s, ", \ + TEST_SYSCALL_STR, sample, TEST_SYSCALL_STATX_FLAGS_STR, \ + TEST_SYSCALL_STATX_MASK_STR) +# define PRINT_SYSCALL_FOOTER(rc) \ + errno = saved_errno; \ + printf(") = %s\n", sprintrc(rc)); \ + } while (0) + +# include "xstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_statx") + +#endif diff --git a/tests-mx32/statx.gen.test b/tests-mx32/statx.gen.test new file mode 100755 index 00000000..bff3e3f2 --- /dev/null +++ b/tests-mx32/statx.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (statx -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests-mx32/statx.sh b/tests-mx32/statx.sh deleted file mode 100755 index a630193d..00000000 --- a/tests-mx32/statx.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of stat family syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -P $NAME.sample -P /dev/full -a32 diff --git a/tests-mx32/strace-C.test b/tests-mx32/strace-C.test index ccca9a09..5d3e37dc 100755 --- a/tests-mx32/strace-C.test +++ b/tests-mx32/strace-C.test @@ -1,9 +1,14 @@ #!/bin/sh - +# # Check -C option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./sleep 0 -run_strace -a24 -C -enanosleep ./sleep 1 +run_prog ../sleep 0 +run_strace -a24 -C -enanosleep ../sleep 1 match_grep diff --git a/tests-mx32/strace-E.expected b/tests-mx32/strace-E.expected index d7823b7a..3ae2c28e 100644 --- a/tests-mx32/strace-E.expected +++ b/tests-mx32/strace-E.expected @@ -1 +1 @@ -execve\("\./sleep", \["\./sleep", "0"\], \[.*"option_E_var=OPTION_E_VAL".*\]\) = 0 +execve\("\.\./sleep", \["\.\./sleep", "0"\], \[.*"option_E_var=OPTION_E_VAL".*\]\) = 0 diff --git a/tests-mx32/strace-E.test b/tests-mx32/strace-E.test index d76ec3f5..82b95df5 100755 --- a/tests-mx32/strace-E.test +++ b/tests-mx32/strace-E.test @@ -1,9 +1,14 @@ #!/bin/sh - +# # Check -E option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./sleep 0 > /dev/null +run_prog ../sleep 0 > /dev/null run_strace -E option_E_var=OPTION_E_VAL -v $args match_grep diff --git a/tests-mx32/strace-S.test b/tests-mx32/strace-S.test index 3ea315ce..4b5be6d9 100755 --- a/tests-mx32/strace-S.test +++ b/tests-mx32/strace-S.test @@ -1,10 +1,15 @@ #!/bin/sh - +# # Check -S option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./readv > /dev/null +run_prog ../readv > /dev/null test_c() { @@ -13,7 +18,7 @@ test_c() sortopts="$1"; shift sedexpr="$1"; shift - run_strace -c -w -S "$sortby" ./readv > /dev/null + run_strace -c -w -S "$sortby" ../readv > /dev/null sed -r -n -e "$sedexpr" < "$LOG" > "$OUT" [ -s "$OUT" ] || @@ -28,5 +33,3 @@ test_c() c='[[:space:]]+([^[:space:]]+)' test_c calls '-n -r' '/^[[:space:]]+[0-9]/ s/^'"$c$c$c$c"'[[:space:]].*/\4/p' test_c name '' '/^[[:space:]]+[0-9]/ s/^'"$c$c$c$c"'([[:space:]]+[0-9]+)?'"$c"'$/\6/p' - -rm -f "$OUT" diff --git a/tests-mx32/strace-T.test b/tests-mx32/strace-T.test index 7ab84a74..7c3136b7 100755 --- a/tests-mx32/strace-T.test +++ b/tests-mx32/strace-T.test @@ -1,9 +1,14 @@ #!/bin/sh - +# # Check -T option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./sleep 0 -run_strace -a24 -T -enanosleep ./sleep 1 +run_prog ../sleep 0 +run_strace -a24 -T -enanosleep ../sleep 1 match_grep diff --git a/tests-mx32/strace-V.test b/tests-mx32/strace-V.test index 9a051e00..a0274c28 100755 --- a/tests-mx32/strace-V.test +++ b/tests-mx32/strace-V.test @@ -8,17 +8,62 @@ year="$(date +%Y)" run_strace -V > "$LOG" -getval() +getstr() { - sed -r -n 's/#define[[:space:]]*'"$1"'[[:space:]]*"([^"]*)".*/\1/p' ../config.h + sed -r -n 's/#define[[:space:]]*'"$1"'[[:space:]]*"([^"]*)".*/\1/p' \ + ../../config.h } +# getoption OPTION YES_STRING [NO_STRING] +# +# Returns YES_STRING in case OPTION is enabled (present in config.h and has +# a non-zero numeric value). Otherwise, NO_STRING (or empty string, if not +# specified) is returned. +getoption() +{ + local opt + opt=$(sed -r -n 's/#define[[:space:]]*'"$1"'[[:space:]]*([0-9]+)$/\1/p' \ + ../../config.h) + if [ -n "$opt" -a "$opt" -ne 0 ]; then + printf "%s" "$2" + else + printf "%s" "${3-}" + fi +} + +config_year=$(getstr COPYRIGHT_YEAR) + +[ "$year" -ge "$config_year" ] && [ "$config_year" -ge 2017 ] || { + echo >&2 "The year derived from config.h (${config_year}) does not pass sanity checks." + exit 1 +} + +option_unwind=$(getoption ENABLE_STACKTRACE \ + " stack-trace=$(getstr USE_UNWINDER)") +option_demangle=$(getoption USE_DEMANGLE " stack-demangle") + +option_m32= +option_mx32= +case "$STRACE_NATIVE_ARCH" in +x86_64) + option_m32=$(getoption HAVE_M32_MPERS ' m32-mpers' ' no-m32-mpers') + option_mx32=$(getoption HAVE_MX32_MPERS ' mx32-mpers' ' no-mx32-mpers') + ;; +aarch64|powerpc64|riscv|s390x|sparc64|tile|x32) + option_m32=$(getoption HAVE_M32_MPERS ' m32-mpers' ' no-m32-mpers') + ;; +esac + +features="${option_unwind}${option_demangle}${option_m32}${option_mx32}" +[ -n "$features" ] || features=" (none)" + cat > "$EXP" << __EOF__ -$(getval PACKAGE_NAME) -- version $(getval PACKAGE_VERSION) -Copyright (C) 1991-$year The strace developers <$(getval PACKAGE_URL)>. +$(getstr PACKAGE_NAME) -- version $(getstr PACKAGE_VERSION) +Copyright (c) 1991-${config_year} The strace developers <$(getstr PACKAGE_URL)>. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +Optional features enabled:${features} __EOF__ -match_diff "$EXP" "$LOG" -rm -f "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests-mx32/strace-ff.test b/tests-mx32/strace-ff.test index 2ce06f19..429549f2 100755 --- a/tests-mx32/strace-ff.test +++ b/tests-mx32/strace-ff.test @@ -1,13 +1,18 @@ #!/bin/sh - +# # Check -ff option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog_skip_if_failed \ kill -0 $$ -./set_ptracer_any ./sleep 1 > "$OUT" & +../set_ptracer_any ../sleep 3 > "$OUT" & tracee_pid=$! while ! [ -s "$OUT" ]; do @@ -15,7 +20,6 @@ while ! [ -s "$OUT" ]; do fail_ 'set_ptracer_any sleep failed' done -rm -f "$LOG".* run_strace -a14 -eexit_group -ff -p $tracee_pid # check that output matches @@ -25,5 +29,3 @@ match_diff "$LOG.$tracee_pid" set -- "$LOG".* [ "$LOG.$tracee_pid" = "$*" ] || fail_ "too many output files: $*" - -rm -f "$OUT" "$LOG.$tracee_pid" diff --git a/tests-mx32/strace-k-demangle.expected b/tests-mx32/strace-k-demangle.expected new file mode 100644 index 00000000..c1b48037 --- /dev/null +++ b/tests-mx32/strace-k-demangle.expected @@ -0,0 +1,2 @@ +^chdir .*(__kernel_vsyscall )?(__)?chdir ns::f3\(int\) ns::f2\(int\) ns::f1\(int\) ns::f0\(int\) main +^SIGURG .*(__kernel_vsyscall )?(__)?kill ns::f3\(int\) ns::f2\(int\) ns::f1\(int\) ns::f0\(int\) main diff --git a/tests-mx32/strace-k-demangle.test b/tests-mx32/strace-k-demangle.test new file mode 100755 index 00000000..3789d0ea --- /dev/null +++ b/tests-mx32/strace-k-demangle.test @@ -0,0 +1,12 @@ +#!/bin/sh +# +# Check strace -k symbol names demangling. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +test_prog=../stack-fcall-mangled + +. "${srcdir=.}"/strace-k.test diff --git a/tests-mx32/strace-k.expected b/tests-mx32/strace-k.expected new file mode 100644 index 00000000..e40c339e --- /dev/null +++ b/tests-mx32/strace-k.expected @@ -0,0 +1,2 @@ +^chdir .*(__kernel_vsyscaln )?(__)?chdir f3 f2 f1 f0 main +^SIGURG .*(__kernel_vsyscaln )?(__)?kill f3 f2 f1 f0 main diff --git a/tests-mx32/strace-k.test b/tests-mx32/strace-k.test index d5e8ed2b..7a323431 100755 --- a/tests-mx32/strace-k.test +++ b/tests-mx32/strace-k.test @@ -4,29 +4,10 @@ # # Copyright (c) 2014 Masatake YAMATO # Copyright (c) 2014-2016 Dmitry V. Levin +# Copyright (c) 2014-2019 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -34,20 +15,66 @@ [ -f /proc/self/maps ] || framework_skip_ '/proc/self/maps is not available' +check_prog grep check_prog sed check_prog tr -run_prog ./stack-fcall -run_strace -e getpid -k $args +run_prog "${test_prog=../stack-fcall}" +run_strace -e chdir -k $args -expected='getpid f3 f2 f1 f0 main ' -result=$(sed -r -n '1,/\(main\+0x[a-f0-9]+\) .*/ s/^.*\(([^+]+)\+0x[a-f0-9]+\) .*/\1/p' "$LOG" | - tr '\n' ' ') +expected="$srcdir/$NAME.expected" +awk ' +/^[^ ]/ { + if (out != "") + print out -test "$result" = "$expected" || { - echo "expected: \"$expected\"" - echo "result: \"$result\"" - dump_log_and_fail_with "$STRACE $args output mismatch" + syscall = gensub(/^([[:alnum:]_]+)\(.*/, "\\1", 1) + signal = gensub(/^--- ([A-Z]+) .*/, "\\1", 1) + + if (syscall != $0) { + out = syscall + stop = 0 + } else if (signal != $0) { + out = signal + stop = 0 + } else { + out = "" + } } -exit 0 +/^ >[^(]+\(([^+]+)\+0x[a-f0-9]+\) / && !stop { + sym = gensub(/^ >[^(]+\(([^+]+)\+0x[a-f0-9]+\) .*$/, "\\1", 1) + out = out " " sym + if (sym == "main") + stop = 1 +}' "$LOG" > "$OUT" + +LC_ALL=C grep -E -x -f "$expected" < "$OUT" > /dev/null || { + cat >&2 <<__EOF__ +Failed pattern of expected output: +$(cat "$expected") +Actual output: +$(cat "$OUT") +__EOF__ + + pattern= + case "$STRACE_ARCH" in + aarch64|i386|ppc*|s390*|sparc*|x32|x86*) + # These architectures are supported by elfutils libdw, + # see grep '\.*\' elfutils/backends + ;; + arm) pattern='No DWARF information found' + # This is also supported by elfutils libdw + # but the latter needs debuginfo for unwinding. + ;; + *) pattern='Unwinding not supported for this architecture' + ;; + esac + if [ -n "$pattern" ] && + LC_ALL=C grep -x " > $pattern" < "$LOG" > /dev/null; then + cat < "$LOG" >&2 + skip_ "stack tracing is not fully supported on $STRACE_ARCH yet" + fi + + dump_log_and_fail_with "$STRACE $args output mismatch" +} diff --git a/tests-mx32/strace-log-merge-error.test b/tests-mx32/strace-log-merge-error.test new file mode 100755 index 00000000..35a2de82 --- /dev/null +++ b/tests-mx32/strace-log-merge-error.test @@ -0,0 +1,37 @@ +#!/bin/sh +# +# Check strace-log-merge error diagnostics. +# +# Copyright (c) 2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +rm -f -- "$LOG".[0-9]* +echo "strace-log-merge: $LOG: strace output not found" > "$EXP" + +check_strace_log_merge() +{ + "$srcdir"/../strace-log-merge "$LOG" > "$OUT" 2> "$LOG" + rc=$? + + [ $rc -gt 0 ] || + dump_log_and_fail_with 'strace-log-merge unexpectedly succeeded' + + [ ! -s "$OUT" ] || + dump_log_and_fail_with 'strace-log-merge unexpectedly produced output' + + match_diff "$LOG" "$EXP" 'strace-log-merge error diagnostics mismatch' +} + +check_strace_log_merge + +echo '1234567890.123456 +++ exited with 0 +++' > "$LOG".0 +check_strace_log_merge + +echo > "$LOG".1 +check_strace_log_merge + +rm -f -- "$LOG".[0-9]* diff --git a/tests-mx32/strace-log-merge-suffix.test b/tests-mx32/strace-log-merge-suffix.test new file mode 100755 index 00000000..51a2e5fb --- /dev/null +++ b/tests-mx32/strace-log-merge-suffix.test @@ -0,0 +1,29 @@ +#!/bin/sh +# +# Check strace-log-merge pid formatting. +# +# Copyright (c) 2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +rm -f -- "$LOG".[0-9]* + +echo '3456789012.345678 +++ exited with 3 +++' > "$LOG".4294967295 +echo '1234567890.123456 +++ exited with 2 +++' > "$LOG".65535 +echo '2345678901.234567 +++ exited with 1 +++' > "$LOG".1 + +cat > "$EXP" <<'EOF' +65535 1234567890.123456 +++ exited with 2 +++ +1 2345678901.234567 +++ exited with 1 +++ +4294967295 3456789012.345678 +++ exited with 3 +++ +EOF + +"$srcdir"/../strace-log-merge "$LOG" > "$OUT" 2> "$LOG" || + dump_log_and_fail_with 'strace-log-merge failed' + +match_diff "$OUT" "$EXP" 'strace-log-merge output mismatch' + +rm -f -- "$LOG".[0-9]* diff --git a/tests-mx32/strace-r.expected b/tests-mx32/strace-r.expected index 8009c353..2a5b9773 100644 --- a/tests-mx32/strace-r.expected +++ b/tests-mx32/strace-r.expected @@ -1,2 +1,2 @@ -[ ]{5}0\.0{6} execve\("\./sleep", \["\./sleep", "1"\], \[/\* [[:digit:]]+ vars \*/\]\) = 0 +[ ]{5}0\.0{6} execve\("\.\./sleep", \["\.\./sleep", "1"\], 0x[[:xdigit:]]* /\* [[:digit:]]* vars \*/\) = 0 [ ]{5}(1\.[01]|0\.9)[[:digit:]]{5} \+\+\+ exited with 0 \+\+\+ diff --git a/tests-mx32/strace-r.test b/tests-mx32/strace-r.test index 4ba01f12..936f4a15 100755 --- a/tests-mx32/strace-r.test +++ b/tests-mx32/strace-r.test @@ -1,9 +1,14 @@ #!/bin/sh - +# # Check -r option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./sleep 0 -run_strace -r -eexecve ./sleep 1 +run_prog ../sleep 0 +run_strace -r -eexecve ../sleep 1 match_grep diff --git a/tests-mx32/strace-t.test b/tests-mx32/strace-t.test index 1d213e63..a06408db 100755 --- a/tests-mx32/strace-t.test +++ b/tests-mx32/strace-t.test @@ -1,20 +1,34 @@ #!/bin/sh - +# # Check -t option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog_skip_if_failed date +%T > /dev/null -run_prog ./sleep 0 +run_prog_skip_if_failed date +%s > "$LOG" +run_prog_skip_if_failed date +%T --date "@$(cat "$LOG")" > /dev/null +run_prog ../sleep 0 -t0="$(date +%T)" +s0="$(date +%s)" run_strace -t -eexecve $args -t1="$(date +%T)" +s1="$(date +%s)" + +s="$s0" +t_reg= +while [ "$s" -le "$s1" ]; do + t="$(date +%T --date "@$s")" + [ -z "$t_reg" ] && t_reg="$t" || t_reg="$t_reg|$t" + s=$(($s + 1)) +done +t_reg="($t_reg)" -EXPECTED="$LOG.expected" -cat > "$EXPECTED" << __EOF__ -($t0|$t1) execve\\("\\./sleep", \\["\\./sleep", "0"\\], \\[/\\* [[:digit:]]+ vars \\*/\\]\\) = 0 +cat > "$EXP" << __EOF__ +$t_reg execve\\("\\.\\./sleep", \\["\\.\\./sleep", "0"\\], 0x[[:xdigit:]]* /\\* [[:digit:]]* vars \\*/\\) = 0 +$t_reg \\+\\+\\+ exited with 0 \\+\\+\\+ __EOF__ -match_grep "$LOG" "$EXPECTED" -rm -f "$EXPECTED" +match_grep "$LOG" "$EXP" diff --git a/tests-mx32/strace-tt.test b/tests-mx32/strace-tt.test index 3f80001e..4d1331b1 100755 --- a/tests-mx32/strace-tt.test +++ b/tests-mx32/strace-tt.test @@ -1,12 +1,17 @@ #!/bin/sh - +# # Check -tt option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog_skip_if_failed date +%s > "$LOG" run_prog_skip_if_failed date +%T --date "@$(cat "$LOG")" > /dev/null -run_prog ./sleep 0 +run_prog ../sleep 0 s0="$(date +%s)" run_strace -tt -eexecve $args @@ -21,8 +26,7 @@ while [ "$s" -le "$s1" ]; do done cat > "$EXP" << __EOF__ -($t_reg)\\.[[:digit:]]{6} execve\\("\\./sleep", \\["\\./sleep", "0"\\], \\[/\\* [[:digit:]]+ vars \\*/\\]\\) = 0 +($t_reg)\\.[[:digit:]]{6} execve\\("\\.\\./sleep", \\["\\.\\./sleep", "0"\\], 0x[[:xdigit:]]* /\\* [[:digit:]]* vars \\*/\\) = 0 __EOF__ match_grep "$LOG" "$EXP" -rm -f "$EXP" diff --git a/tests-mx32/strace-ttt.test b/tests-mx32/strace-ttt.test index 4439715b..089ff064 100755 --- a/tests-mx32/strace-ttt.test +++ b/tests-mx32/strace-ttt.test @@ -1,11 +1,16 @@ #!/bin/sh - +# # Check -ttt option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog_skip_if_failed date +%s > /dev/null -run_prog ./sleep 0 +run_prog ../sleep 0 s0="$(date +%s)" run_strace -ttt -eexecve $args @@ -19,8 +24,7 @@ while [ "$s" -le "$s1" ]; do done cat > "$EXP" << __EOF__ -($t_reg)\\.[[:digit:]]{6} execve\\("\\./sleep", \\["\\./sleep", "0"\\], \\[/\\* [[:digit:]]+ vars \\*/\\]\\) = 0 +($t_reg)\\.[[:digit:]]{6} execve\\("\\.\\./sleep", \\["\\.\\./sleep", "0"\\], 0x[[:xdigit:]]* /\\* [[:digit:]]+ vars \\*/\\) = 0 __EOF__ match_grep "$LOG" "$EXP" -rm -f "$EXP" diff --git a/tests-mx32/strace.supp b/tests-mx32/strace.supp index 578b0a25..248a4716 100644 --- a/tests-mx32/strace.supp +++ b/tests-mx32/strace.supp @@ -5,3 +5,13 @@ fun:sched_getaffinity* fun:get_cpuset_size } + +{ + qualify_tokens: memleak before error_msg_and_die + Memcheck:Leak + match-leak-kinds: possible + fun:malloc + fun:strdup + fun:xstrdup + fun:qualify_tokens +} diff --git a/tests-mx32/struct_flock.c b/tests-mx32/struct_flock.c deleted file mode 100644 index 34cf58e6..00000000 --- a/tests-mx32/struct_flock.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2015-2016 Dmitry V. Levin - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (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 -#include -#include -#include -#include "flock.h" - -#define FILE_LEN 4096 -#define EINVAL_STR "-1 EINVAL (Invalid argument)" - -#define TEST_FLOCK_EINVAL(cmd) test_flock_einval(cmd, #cmd) - -#ifdef HAVE_TYPEOF -# define TYPEOF_FLOCK_OFF_T typeof(((struct_kernel_flock *) NULL)->l_len) -#else -# define TYPEOF_FLOCK_OFF_T off_t -#endif - -static long -invoke_test_syscall(const unsigned int cmd, void *const p) -{ - const unsigned long op = (unsigned long) 0xffffffff00000000ULL | cmd; - - return syscall(TEST_SYSCALL_NR, 0, op, (unsigned long) p); -} - -static void -test_flock_einval(const int cmd, const char *name) -{ - struct_kernel_flock fl = { - .l_type = F_RDLCK, - .l_start = (TYPEOF_FLOCK_OFF_T) 0xdefaced1facefeedULL, - .l_len = (TYPEOF_FLOCK_OFF_T) 0xdefaced2cafef00dULL - }; - invoke_test_syscall(cmd, &fl); - printf("%s(0, %s, {l_type=F_RDLCK, l_whence=SEEK_SET" - ", l_start=%jd, l_len=%jd}) = %s\n", TEST_SYSCALL_STR, name, - (intmax_t) fl.l_start, (intmax_t) fl.l_len, EINVAL_STR); -} - -static void -test_flock(void) -{ - TEST_FLOCK_EINVAL(F_SETLK); - TEST_FLOCK_EINVAL(F_SETLKW); - - struct_kernel_flock fl = { - .l_type = F_RDLCK, - .l_len = FILE_LEN - }; - long rc = invoke_test_syscall(F_SETLK, &fl); - printf("%s(0, F_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET" - ", l_start=0, l_len=%d}) = %s\n", - TEST_SYSCALL_STR, FILE_LEN, rc ? EINVAL_STR : "0"); - if (rc) - return; - - invoke_test_syscall(F_GETLK, &fl); - printf("%s(0, F_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET" - ", l_start=0, l_len=%d, l_pid=0}) = 0\n", - TEST_SYSCALL_STR, FILE_LEN); - - invoke_test_syscall(F_SETLK, &fl); - printf("%s(0, F_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET" - ", l_start=0, l_len=%d}) = 0\n", - TEST_SYSCALL_STR, FILE_LEN); -} - -static void -create_sample(void) -{ - char fname[] = TEST_SYSCALL_STR "_XXXXXX"; - - (void) close(0); - if (mkstemp(fname)) - perror_msg_and_fail("mkstemp: %s", fname); - if (unlink(fname)) - perror_msg_and_fail("unlink: %s", fname); - if (ftruncate(0, FILE_LEN)) - perror_msg_and_fail("ftruncate"); -} diff --git a/tests-mx32/sun_path.test b/tests-mx32/sun_path.test index 728328a8..a2aab664 100755 --- a/tests-mx32/sun_path.test +++ b/tests-mx32/sun_path.test @@ -1,10 +1,15 @@ #!/bin/sh - +# # Check how long sun_path addresses are traced. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./net-accept-connect 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678 +run_prog ../net-accept-connect 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678 run_strace_merge -ebind,connect,getsockname $args match_grep diff --git a/tests-mx32/swap.c b/tests-mx32/swap.c index 77b25050..a854182e 100644 --- a/tests-mx32/swap.c +++ b/tests-mx32/swap.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/swap.gen.test b/tests-mx32/swap.gen.test new file mode 100755 index 00000000..4ca78914 --- /dev/null +++ b/tests-mx32/swap.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (swap -a23 -e trace=swapon,swapoff); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 -e trace=swapon,swapoff diff --git a/tests-mx32/swap.test b/tests-mx32/swap.test deleted file mode 100755 index a30e1fd8..00000000 --- a/tests-mx32/swap.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check swapon and swapoff syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a23 -e trace=swapon,swapoff diff --git a/tests-mx32/sxetmask.c b/tests-mx32/sxetmask.c new file mode 100644 index 00000000..3ad2368e --- /dev/null +++ b/tests-mx32/sxetmask.c @@ -0,0 +1,104 @@ +/* + * Check decoding of sgetmask and ssetmask syscalls. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#if defined __NR_sgetmask && defined __NR_ssetmask + +# include +# include +# include +# include +# include +# include + +static long +k_sgetmask(void) +{ + return syscall(__NR_sgetmask); +} + +static long +k_ssetmask(const kernel_ulong_t arg) +{ + return syscall(__NR_ssetmask, arg); +} + +int +main(void) +{ + union { + sigset_t libc_mask; + unsigned long old_mask; + } uset, uget; + long rc; + + /* + * Block, reset, and raise SIGUSR1. + * If a subsequent ssetmask call fails to set the proper mask, + * the process will be terminated by SIGUSR1. + */ + sigemptyset(&uset.libc_mask); + sigaddset(&uset.libc_mask, SIGUSR1); + if (sigprocmask(SIG_SETMASK, &uset.libc_mask, NULL)) + perror_msg_and_fail("sigprocmask"); + if (signal(SIGUSR1, SIG_DFL) == SIG_ERR) + perror_msg_and_fail("signal"); + raise(SIGUSR1); + + sigaddset(&uset.libc_mask, SIGUSR2); + rc = k_ssetmask((kernel_ulong_t) 0xfacefeed00000000ULL | uset.old_mask); + if (rc == -1L) { + printf("ssetmask([USR1 USR2]) = %s\n", sprintrc(rc)); + } else { + printf("ssetmask([USR1 USR2]) = %#lx (old mask [USR1])\n", rc); + /* + * Use a regular sigprocmask call to check the value + * returned by the ssetmask call being tested. + */ + if (sigprocmask(SIG_SETMASK, NULL, &uget.libc_mask)) + perror_msg_and_fail("sigprocmask"); + if (uset.old_mask != uget.old_mask) + error_msg_and_fail("sigprocmask returned %#lx" + " instead of %#lx", + uget.old_mask, uset.old_mask); + } + + rc = k_sgetmask(); + if (rc == -1L) { + printf("sgetmask() = %s\n", sprintrc(rc)); + } else { + printf("sgetmask() = %#lx (mask [USR1 USR2])\n", rc); + if (uget.old_mask != (unsigned long) rc) + error_msg_and_fail("sigprocmask returned %#lx", + uget.old_mask); + + if (sizeof(long) > 4) { + sigaddset(&uset.libc_mask, 32 + 27); + if (sigprocmask(SIG_SETMASK, &uset.libc_mask, NULL)) + perror_msg_and_fail("sigprocmask"); + rc = k_sgetmask(); + printf("sgetmask() = %#lx" + " (mask [USR1 USR2 RT_27])\n", rc); + if (uset.old_mask != (unsigned long) rc) + error_msg_and_fail("sigprocmask set %#lx", + uset.old_mask); + } + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sgetmask && __NR_ssetmask") + +#endif diff --git a/tests-mx32/sxetmask.gen.test b/tests-mx32/sxetmask.gen.test new file mode 100755 index 00000000..fea9e4a0 --- /dev/null +++ b/tests-mx32/sxetmask.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sxetmask -a11 -e trace=sgetmask,ssetmask); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=sgetmask,ssetmask diff --git a/tests-mx32/symlink.c b/tests-mx32/symlink.c index 72cb4908..8283a8e2 100644 --- a/tests-mx32/symlink.c +++ b/tests-mx32/symlink.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -7,14 +14,12 @@ # include int -main(void) +main(int ac, char **av) { - static const char sample_1[] = "symlink_new"; - static const char sample_2[] = "symlink"; + static const char sample[] = "symlink.sample"; - long rc = syscall(__NR_symlink, sample_1, sample_2); - printf("symlink(\"%s\", \"%s\") = %ld %s (%m)\n", - sample_1, sample_2, rc, errno2name()); + long rc = syscall(__NR_symlink, sample, av[0]); + printf("symlink(\"%s\", \"%s\") = %s\n", sample, av[0], sprintrc(rc)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/symlink.gen.test b/tests-mx32/symlink.gen.test new file mode 100755 index 00000000..8cedfbf4 --- /dev/null +++ b/tests-mx32/symlink.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (symlink -a34 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a34 diff --git a/tests-mx32/symlink.test b/tests-mx32/symlink.test deleted file mode 100755 index 79b93baa..00000000 --- a/tests-mx32/symlink.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check symlink syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a34 diff --git a/tests-mx32/symlinkat.c b/tests-mx32/symlinkat.c index 6e5d617d..be36b941 100644 --- a/tests-mx32/symlinkat.c +++ b/tests-mx32/symlinkat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/symlinkat.gen.test b/tests-mx32/symlinkat.gen.test new file mode 100755 index 00000000..12455dd9 --- /dev/null +++ b/tests-mx32/symlinkat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (symlinkat ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/symlinkat.test b/tests-mx32/symlinkat.test deleted file mode 100755 index d8501ffd..00000000 --- a/tests-mx32/symlinkat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check symlinkat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/sync.c b/tests-mx32/sync.c index e6e7ce37..e0b654d0 100644 --- a/tests-mx32/sync.c +++ b/tests-mx32/sync.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/sync.gen.test b/tests-mx32/sync.gen.test new file mode 100755 index 00000000..8436a1fa --- /dev/null +++ b/tests-mx32/sync.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sync -a7 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a7 diff --git a/tests-mx32/sync.test b/tests-mx32/sync.test deleted file mode 100755 index f6bf6c8f..00000000 --- a/tests-mx32/sync.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sync syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a7 diff --git a/tests-mx32/sync_file_range.c b/tests-mx32/sync_file_range.c index 67d31a89..9eba7815 100644 --- a/tests-mx32/sync_file_range.c +++ b/tests-mx32/sync_file_range.c @@ -1,30 +1,10 @@ /* * Check decoding of sync_file_range syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/sync_file_range.gen.test b/tests-mx32/sync_file_range.gen.test new file mode 100755 index 00000000..2f41c7db --- /dev/null +++ b/tests-mx32/sync_file_range.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sync_file_range ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/sync_file_range.test b/tests-mx32/sync_file_range.test deleted file mode 100755 index 6aa86d6c..00000000 --- a/tests-mx32/sync_file_range.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sync_file_range syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/sync_file_range2.c b/tests-mx32/sync_file_range2.c index 6ce7db26..03af1005 100644 --- a/tests-mx32/sync_file_range2.c +++ b/tests-mx32/sync_file_range2.c @@ -1,30 +1,10 @@ /* * Check decoding of sync_file_range2 syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/sync_file_range2.gen.test b/tests-mx32/sync_file_range2.gen.test new file mode 100755 index 00000000..d432647a --- /dev/null +++ b/tests-mx32/sync_file_range2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sync_file_range2 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/sync_file_range2.test b/tests-mx32/sync_file_range2.test deleted file mode 100755 index 0d9945ed..00000000 --- a/tests-mx32/sync_file_range2.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sync_file_range2 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/syntax.sh b/tests-mx32/syntax.sh new file mode 100644 index 00000000..2e30e6a1 --- /dev/null +++ b/tests-mx32/syntax.sh @@ -0,0 +1,59 @@ +#!/bin/sh +# +# Define syntax testing primitives. +# +# Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +check_exit_status_and_stderr() +{ + $STRACE "$@" 2> "$LOG" && + dump_log_and_fail_with \ + "strace $* failed to handle the error properly" + match_diff "$LOG" "$EXP" || + dump_log_and_fail_with \ + "strace $* failed to print expected diagnostics" +} + +check_exit_status_and_stderr_using_grep() +{ + $STRACE "$@" 2> "$LOG" && + dump_log_and_fail_with \ + "strace $* failed to handle the error properly" + match_grep "$LOG" "$EXP" || + dump_log_and_fail_with \ + "strace $* failed to print expected diagnostics" +} + +check_e() +{ + local pattern="$1"; shift + cat > "$EXP" << __EOF__ +$STRACE_EXE: $pattern +__EOF__ + check_exit_status_and_stderr "$@" +} + +check_e_using_grep() +{ + local pattern="$1"; shift + cat > "$EXP" << __EOF__ +$STRACE_EXE: $pattern +__EOF__ + check_exit_status_and_stderr_using_grep "$@" +} + +check_h() +{ + local pattern="$1"; shift + cat > "$EXP" << __EOF__ +$STRACE_EXE: $pattern +Try '$STRACE_EXE -h' for more information. +__EOF__ + check_exit_status_and_stderr "$@" +} diff --git a/tests-mx32/sysinfo.c b/tests-mx32/sysinfo.c index 377bdc9c..bf07661a 100644 --- a/tests-mx32/sysinfo.c +++ b/tests-mx32/sysinfo.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015 Elvira Khabirova * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -38,7 +19,7 @@ main(void) sysinfo(NULL); printf("sysinfo(NULL) = -1 EFAULT (%m)\n"); - struct sysinfo * const si = tail_alloc(sizeof(*si)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sysinfo, si); if (sysinfo(si)) perror_msg_and_skip("sysinfo"); diff --git a/tests-mx32/sysinfo.gen.test b/tests-mx32/sysinfo.gen.test new file mode 100755 index 00000000..fa462376 --- /dev/null +++ b/tests-mx32/sysinfo.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sysinfo -a14 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests-mx32/sysinfo.test b/tests-mx32/sysinfo.test deleted file mode 100755 index 806d8b61..00000000 --- a/tests-mx32/sysinfo.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of sysinfo syscall - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a14 diff --git a/tests-mx32/syslog.c b/tests-mx32/syslog.c index 5df96cb8..363fdf96 100644 --- a/tests-mx32/syslog.c +++ b/tests-mx32/syslog.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/syslog.gen.test b/tests-mx32/syslog.gen.test new file mode 100755 index 00000000..5707a3e2 --- /dev/null +++ b/tests-mx32/syslog.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (syslog -a36 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests-mx32/syslog.test b/tests-mx32/syslog.test deleted file mode 100755 index 1c2158e4..00000000 --- a/tests-mx32/syslog.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check syslog syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a36 diff --git a/tests-mx32/tail_alloc.c b/tests-mx32/tail_alloc.c index 08081d4f..693196ef 100644 --- a/tests-mx32/tail_alloc.c +++ b/tests-mx32/tail_alloc.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/tee.c b/tests-mx32/tee.c index 66d1c94f..2137c351 100644 --- a/tests-mx32/tee.c +++ b/tests-mx32/tee.c @@ -1,30 +1,10 @@ /* * This file is part of tee strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/tee.gen.test b/tests-mx32/tee.gen.test new file mode 100755 index 00000000..b5fbfc05 --- /dev/null +++ b/tests-mx32/tee.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (tee ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/tee.test b/tests-mx32/tee.test deleted file mode 100755 index 76b60003..00000000 --- a/tests-mx32/tee.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check tee syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/termsig.test b/tests-mx32/termsig.test new file mode 100755 index 00000000..d41ddf0a --- /dev/null +++ b/tests-mx32/termsig.test @@ -0,0 +1,20 @@ +#!/bin/sh +# +# Check termination signal forwarding. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_expect_termsig="../run_expect_termsig 15" +unblock_reset_raise="../unblock_reset_raise 15" + +run_prog $run_expect_termsig $unblock_reset_raise +STRACE="$run_expect_termsig $STRACE" + +for i in 1 2 3 4; do + run_strace -I$i -enone -esignal=none $unblock_reset_raise +done diff --git a/tests-mx32/test_netlink.h b/tests-mx32/test_netlink.h new file mode 100644 index 00000000..2ce476d5 --- /dev/null +++ b/tests-mx32/test_netlink.h @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include "print_fields.h" + +#include +#include +#include +#include +#include "netlink.h" + +#define TEST_NETLINK_(fd_, nlh0_, \ + type_, type_str_, \ + flags_, flags_str_, \ + data_len_, src_, slen_, ...) \ + do { \ + struct nlmsghdr *const TEST_NETLINK_nlh = \ + (nlh0_) - (slen_); \ + const unsigned int msg_len = \ + NLMSG_HDRLEN + (data_len_); \ + \ + SET_STRUCT(struct nlmsghdr, TEST_NETLINK_nlh, \ + .nlmsg_len = msg_len, \ + .nlmsg_type = (type_), \ + .nlmsg_flags = (flags_) \ + ); \ + memcpy(NLMSG_DATA(TEST_NETLINK_nlh), (src_), (slen_)); \ + \ + const char *const errstr = \ + sprintrc(sendto((fd_), TEST_NETLINK_nlh, \ + msg_len, MSG_DONTWAIT, \ + NULL, 0)); \ + \ + printf("sendto(%d, {{len=%u, type=%s" \ + ", flags=%s, seq=0, pid=0}, ", \ + (fd_), msg_len, (type_str_), (flags_str_)); \ + \ + { __VA_ARGS__; } \ + \ + printf("}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", \ + msg_len, errstr); \ + } while (0) + +#define TEST_NETLINK(fd_, nlh0_, type_, flags_, \ + data_len_, src_, slen_, ...) \ + TEST_NETLINK_((fd_), (nlh0_), \ + (type_), #type_, \ + (flags_), #flags_, \ + (data_len_), (src_), (slen_), __VA_ARGS__) + +#define TEST_NETLINK_OBJECT_EX_(fd_, nlh0_, \ + type_, type_str_, \ + flags_, flags_str_, \ + obj_, fallback_func, ...) \ + do { \ + char pattern[DEFAULT_STRLEN]; \ + fill_memory_ex(pattern, sizeof(pattern), \ + 'a', 'z' - 'a' + 1); \ + const unsigned int plen = \ + sizeof(obj_) - 1 > DEFAULT_STRLEN \ + ? DEFAULT_STRLEN : (int) sizeof(obj_) - 1; \ + /* len < sizeof(obj_) */ \ + TEST_NETLINK_((fd_), (nlh0_), \ + (type_), (type_str_), \ + (flags_), (flags_str_), \ + plen, pattern, plen, \ + (fallback_func)(pattern, plen)); \ + /* short read of sizeof(obj_) */ \ + TEST_NETLINK_((fd_), (nlh0_), \ + (type_), (type_str_), \ + (flags_), (flags_str_), \ + sizeof(obj_), \ + pattern, plen, \ + printf("%p", \ + NLMSG_DATA(TEST_NETLINK_nlh))); \ + /* sizeof(obj_) */ \ + TEST_NETLINK_((fd_), (nlh0_), \ + (type_), (type_str_), \ + (flags_), (flags_str_), \ + sizeof(obj_), \ + &(obj_), sizeof(obj_), \ + __VA_ARGS__); \ + } while (0) + +#define TEST_NETLINK_OBJECT_EX(fd_, nlh0_, \ + type_, flags_, \ + obj_, fallback_func, ...) \ + TEST_NETLINK_OBJECT_EX_((fd_), (nlh0), \ + (type_), #type_, \ + (flags_), #flags_, \ + (obj_), (fallback_func), __VA_ARGS__) + +#define TEST_NETLINK_OBJECT(fd_, nlh0_, \ + type_, flags_, \ + obj_, ...) \ + TEST_NETLINK_OBJECT_EX_((fd_), (nlh0), \ + (type_), #type_, \ + (flags_), #flags_, \ + (obj_), print_quoted_hex, __VA_ARGS__) diff --git a/tests-mx32/test_nlattr.h b/tests-mx32/test_nlattr.h new file mode 100644 index 00000000..8b8c66b8 --- /dev/null +++ b/tests-mx32/test_nlattr.h @@ -0,0 +1,343 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include "print_fields.h" + +#include +#include +#include +#include +#include "netlink.h" +#include + +static void +init_nlattr(struct nlattr *const nla, + const uint16_t nla_len, + const uint16_t nla_type, + const void *const src, + const size_t n) +{ + SET_STRUCT(struct nlattr, nla, + .nla_len = nla_len, + .nla_type = nla_type, + ); + + memcpy(RTA_DATA(nla), src, n); +} + +static void +print_nlattr(const unsigned int nla_len, const char *const nla_type, bool add_data) +{ + printf(", %s{{nla_len=%u, nla_type=%s}, ", + add_data ? "[" : "", nla_len, nla_type); +} + +#define TEST_NLATTR_EX_(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, nla_type_str_, \ + nla_data_len_, nla_total_len_, \ + src_, slen_, ...) \ + do { \ + struct nlmsghdr *const nlh = \ + (nlh0_) - (NLA_HDRLEN + (slen_)); \ + struct nlattr *const TEST_NLATTR_nla = \ + NLMSG_ATTR(nlh, (hdrlen_)); \ + const unsigned int nla_len = \ + NLA_HDRLEN + (nla_data_len_); \ + const unsigned int msg_len = \ + NLMSG_SPACE(hdrlen_) + NLA_HDRLEN + (nla_total_len_); \ + \ + (init_msg_)(nlh, msg_len); \ + init_nlattr(TEST_NLATTR_nla, nla_len, (nla_type_), \ + (src_), (slen_)); \ + \ + const char *const errstr = \ + sprintrc(sendto((fd_), nlh, msg_len, \ + MSG_DONTWAIT, NULL, 0)); \ + \ + printf("sendto(%d, {", (fd_)); \ + (print_msg_)(msg_len); \ + print_nlattr(nla_len, (nla_type_str_), \ + (nla_total_len_) > (nla_data_len_)); \ + \ + { __VA_ARGS__; } \ + \ + if ((nla_total_len_) > (nla_data_len_)) \ + printf("]"); \ + \ + printf("}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", \ + msg_len, errstr); \ + } while (0) + +#define TEST_NLATTR_(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, nla_type_str_, \ + nla_data_len_, src_, slen_, ...) \ + TEST_NLATTR_EX_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), (nla_type_str_), \ + (nla_data_len_), (nla_data_len_), \ + (src_), (slen_), __VA_ARGS__) + +#define TEST_NLATTR(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, \ + nla_data_len_, src_, slen_, ...) \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + (nla_data_len_), (src_), (slen_), __VA_ARGS__) + +#define TEST_NLATTR_OBJECT_EX_(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, nla_type_str_, \ + pattern_, obj_, fallback_func, ...) \ + do { \ + const unsigned int plen = \ + sizeof(obj_) - 1 > DEFAULT_STRLEN \ + ? DEFAULT_STRLEN : (int) sizeof(obj_) - 1; \ + /* len < sizeof(obj_) */ \ + if (plen > 0) \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), (nla_type_str_), \ + plen, (pattern_), plen, \ + (fallback_func)((pattern_), plen)); \ + /* short read of sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), (nla_type_str_), \ + sizeof(obj_), \ + (pattern_), sizeof(obj_) - 1, \ + printf("%p", \ + RTA_DATA(NLMSG_ATTR(nlh, (hdrlen_))))); \ + /* sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), (nla_type_str_), \ + sizeof(obj_), \ + &(obj_), sizeof(obj_), \ + __VA_ARGS__); \ + } while (0) + +#define TEST_NLATTR_OBJECT_EX(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, \ + pattern_, obj_, fallback_func, ...) \ + TEST_NLATTR_OBJECT_EX_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + (pattern_), (obj_), (fallback_func), \ + __VA_ARGS__) + +#define TEST_NLATTR_OBJECT(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, pattern_, obj_, ...) \ + TEST_NLATTR_OBJECT_EX_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + (pattern_), (obj_), print_quoted_hex, \ + __VA_ARGS__) + +#define TEST_NLATTR_ARRAY(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, pattern_, obj_, print_elem_) \ + do { \ + const unsigned int plen = \ + sizeof((obj_)[0]) - 1 > DEFAULT_STRLEN \ + ? DEFAULT_STRLEN : (int) sizeof((obj_)[0]) - 1; \ + /* len < sizeof((obj_)[0]) */ \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + plen, (pattern_), plen, \ + print_quoted_hex((pattern_), plen)); \ + /* sizeof((obj_)[0]) < len < sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + sizeof(obj_) - 1, \ + &(obj_), sizeof(obj_) - 1, \ + printf("["); \ + size_t i; \ + for (i = 0; i < ARRAY_SIZE(obj_) - 1; ++i) { \ + if (i) printf(", "); \ + (print_elem_)(&(obj_)[i], i); \ + } \ + printf("]")); \ + /* short read of sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + sizeof(obj_), \ + &(obj_), sizeof(obj_) - 1, \ + printf("["); \ + size_t i; \ + for (i = 0; i < ARRAY_SIZE(obj_) - 1; ++i) { \ + if (i) printf(", "); \ + (print_elem_)(&(obj_)[i], i); \ + } \ + printf(", ... /* %p */]", \ + RTA_DATA(NLMSG_ATTR(nlh, (hdrlen_))) \ + + sizeof(obj_) - sizeof((obj_)[0]))); \ + /* sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + sizeof(obj_), \ + &(obj_), sizeof(obj_), \ + printf("["); \ + size_t i; \ + for (i = 0; i < ARRAY_SIZE(obj_); ++i) { \ + if (i) printf(", "); \ + (print_elem_)(&(obj_)[i], i); \ + } \ + printf("]")); \ + } while (0) + +#define TEST_NESTED_NLATTR_OBJECT_EX_(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, nla_type_str_, \ + pattern_, obj_, fallback_func, \ + depth_, ...) \ + do { \ + const unsigned int plen = \ + sizeof(obj_) - 1 > DEFAULT_STRLEN \ + ? DEFAULT_STRLEN : (int) sizeof(obj_) - 1; \ + /* len < sizeof(obj_) */ \ + if (plen > 0) \ + TEST_NLATTR_((fd_), (nlh0_) - NLA_HDRLEN * depth_, \ + (hdrlen_) + NLA_HDRLEN * depth_, \ + (init_msg_), (print_msg_), \ + (nla_type_), (nla_type_str_), \ + plen, (pattern_), plen, \ + (fallback_func)((pattern_), plen); \ + size_t i; \ + for (i = 0; i < depth_; ++i) \ + printf("}")); \ + /* short read of sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_) - NLA_HDRLEN * depth_, \ + (hdrlen_) + NLA_HDRLEN * depth_, \ + (init_msg_), (print_msg_), \ + (nla_type_), (nla_type_str_), \ + sizeof(obj_), \ + (pattern_), sizeof(obj_) - 1, \ + printf("%p", RTA_DATA(TEST_NLATTR_nla)); \ + size_t i; \ + for (i = 0; i < depth_; ++i) \ + printf("}")); \ + /* sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_) - NLA_HDRLEN * depth_, \ + (hdrlen_) + NLA_HDRLEN * depth_, \ + (init_msg_), (print_msg_), \ + (nla_type_), (nla_type_str_), \ + sizeof(obj_), \ + &(obj_), sizeof(obj_), \ + __VA_ARGS__; \ + size_t i; \ + for (i = 0; i < depth_; ++i) \ + printf("}")); \ + } while (0) + +#define TEST_NESTED_NLATTR_OBJECT_EX(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, pattern_, obj_, \ + depth_, ...) \ + TEST_NESTED_NLATTR_OBJECT_EX_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + (pattern_), (obj_), \ + print_quoted_hex, (depth_), \ + __VA_ARGS__) + +#define TEST_NESTED_NLATTR_OBJECT(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, pattern_, obj_, ...) \ + TEST_NESTED_NLATTR_OBJECT_EX_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + (pattern_), (obj_), \ + print_quoted_hex, 1, \ + __VA_ARGS__) + +#define TEST_NESTED_NLATTR_ARRAY_EX(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, pattern_, obj_, depth_, \ + print_elem_) \ + do { \ + const unsigned int plen = \ + sizeof((obj_)[0]) - 1 > DEFAULT_STRLEN \ + ? DEFAULT_STRLEN : (int) sizeof((obj_)[0]) - 1; \ + /* len < sizeof((obj_)[0]) */ \ + TEST_NLATTR_((fd_), (nlh0_) - NLA_HDRLEN * depth_, \ + (hdrlen_) + NLA_HDRLEN * depth_, \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + plen, (pattern_), plen, \ + print_quoted_hex((pattern_), plen); \ + for (size_t i = 0; i < depth_; ++i) \ + printf("}")); \ + /* sizeof((obj_)[0]) < len < sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_) - NLA_HDRLEN * depth_, \ + (hdrlen_) + NLA_HDRLEN * depth_, \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + sizeof(obj_) - 1, \ + &(obj_), sizeof(obj_) - 1, \ + printf("["); \ + size_t i; \ + for (i = 0; i < ARRAY_SIZE(obj_) - 1; ++i) { \ + if (i) printf(", "); \ + (print_elem_)(&(obj_)[i], i); \ + } \ + printf("]"); \ + for (i = 0; i < depth_; ++i) \ + printf("}")); \ + /* short read of sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_) - NLA_HDRLEN * depth_, \ + (hdrlen_) + NLA_HDRLEN * depth_, \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + sizeof(obj_), \ + &(obj_), sizeof(obj_) - 1, \ + printf("["); \ + size_t i; \ + for (i = 0; i < ARRAY_SIZE(obj_) - 1; ++i) { \ + if (i) printf(", "); \ + (print_elem_)(&(obj_)[i], i); \ + } \ + printf(", ... /* %p */]", \ + RTA_DATA(TEST_NLATTR_nla) \ + + sizeof(obj_) - sizeof((obj_)[0])); \ + for (i = 0; i < depth_; ++i) \ + printf("}")); \ + /* sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_) - NLA_HDRLEN * depth_, \ + (hdrlen_) + NLA_HDRLEN * depth_, \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + sizeof(obj_), \ + &(obj_), sizeof(obj_), \ + printf("["); \ + size_t i; \ + for (i = 0; i < ARRAY_SIZE(obj_); ++i) { \ + if (i) printf(", "); \ + (print_elem_)(&(obj_)[i], i); \ + } \ + printf("]"); \ + for (i = 0; i < depth_; ++i) \ + printf("}")); \ + } while (0) + +#define TEST_NESTED_NLATTR_ARRAY(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, pattern_, obj_, print_elem_)\ + TEST_NESTED_NLATTR_ARRAY_EX((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + nla_type_, (pattern_), (obj_), 1, \ + (print_elem_)) diff --git a/tests-mx32/test_printpath.c b/tests-mx32/test_printpath.c new file mode 100644 index 00000000..e341e389 --- /dev/null +++ b/tests-mx32/test_printpath.c @@ -0,0 +1,91 @@ +/* + * Test printpath/umovestr. + * + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include + +#include "test_ucopy.h" + +static void +test_printpath_at(char *const p, const unsigned int test_max) +{ + /* + * / + * /. + * /.. + * /... + * /../. + * /../.. + * /../../ + */ + + char *const eop = p + (test_max - 1); + *eop = '\0'; + unsigned int i; + for (i = 1; i < test_max; ++i) { + const unsigned int i_1 = i - 1; + memmove(eop - i, eop - i_1, i_1); + eop[-1] = "/.."[i_1 % 3]; + if (chdir(eop - i)) + perror_msg_and_fail("chdir"); + printf("chdir(\"%s\") = 0\n", eop - i); + } +} + +static void +test_efault(const unsigned int test_max) +{ + char *p = tail_alloc(test_max); + const char *const efault = p + test_max; + memset(p, '/', test_max); + + for (; p <= efault; ++p) { + if (p <= efault - PATH_MAX) + continue; + printf("chdir(%p) = %s\n", p, sprintrc(chdir(p))); + } +} + +static void +test_enametoolong(void) +{ + char *p = tail_alloc(PATH_MAX); + memset(p, '/', PATH_MAX); + + printf("chdir(\"%.*s\"...) = %s\n", + PATH_MAX - 1, p, sprintrc(chdir(p))); +} + +void +test_printpath(const unsigned int test_max) +{ + /* + * /../..| + * /../.|. + * /../|.. + * /..|/.. + * /.|./.. + * /|../.. + * |/../.. + */ + const unsigned int page_size = get_page_size(); + char *p = tail_alloc(test_max + page_size); + unsigned int i; + for (i = 1; i < sizeof(long); ++i) + test_printpath_at(p + i, test_max); + for (i = 0; i < sizeof(long); ++i) + test_printpath_at(p + page_size - i, test_max); + test_efault(test_max); + test_enametoolong(); +} diff --git a/tests-mx32/test_printstrn.c b/tests-mx32/test_printstrn.c new file mode 100644 index 00000000..09c438d1 --- /dev/null +++ b/tests-mx32/test_printstrn.c @@ -0,0 +1,99 @@ +/* + * Test printstrn/umoven. + * + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include + +#include "scno.h" +#include "test_ucopy.h" + +static const char *errstr; + +static void add_key(const char *addr, const unsigned int len) +{ + errstr = sprintrc(syscall(__NR_add_key, 0, 0, addr, len, -1)); +} + +static void +test_printstrn_at(char *const p, const unsigned int test_max) +{ + unsigned int i; + + for (i = 0; i <= test_max; ++i) { + add_key(p + (test_max - i), i); + printf("add_key(NULL, NULL, \"%.*s\", %u" + ", KEY_SPEC_THREAD_KEYRING) = %s\n", + (int) i, p + (test_max - i), i, errstr); + } +} + +static void +test_efault(const unsigned int test_max) +{ + char *p = tail_alloc(test_max); + memset(p, '/', test_max); + unsigned int i; + + for (i = 0; i <= test_max; ++i) { + unsigned int j; + for (j = 1; j <= sizeof(long); ++j) { + add_key(p + (test_max - i), i + j); + printf("add_key(NULL, NULL, %p, %u" + ", KEY_SPEC_THREAD_KEYRING) = %s\n", + p + (test_max - i), i + j, errstr); + } + } +} + +static void +test_print_memory(char *const p, const unsigned int test_max) +{ + add_key(p, test_max); + printf("add_key(NULL, NULL, "); + print_quoted_memory(p, test_max); + printf(", %u, KEY_SPEC_THREAD_KEYRING) = %s\n", test_max, errstr); +} + +void +test_printstrn(const unsigned int test_max) +{ + /* + * abcdefgh| + * abcdefg|h + * abcdef|gh + * abcde|fgh + * abcd|efgh + * abc|defgh + * ab|cdefgh + * a|bcdefgh + * |abcdefgh + */ + const unsigned int page_size = get_page_size(); + char *p = tail_alloc(test_max + page_size); + fill_memory_ex(p, test_max + page_size, 'a', 'z' - 'a' + 1); + + unsigned int i; + for (i = 1; i <= sizeof(long); ++i) + test_printstrn_at(p + i, test_max); + for (i = 0; i < sizeof(long); ++i) + test_printstrn_at(p + page_size - i, test_max); + test_efault(test_max); + + fill_memory_ex(p, test_max + page_size, 0x00, 0xFF); + /* Test corner cases when octal quoting goes before digit */ + for (i = 0; i < 11; i++) + p[2 + 3 * i] = '0' + i - 1; + + test_print_memory(p, test_max); +} diff --git a/tests-mx32/test_ucopy.c b/tests-mx32/test_ucopy.c new file mode 100644 index 00000000..78d393b2 --- /dev/null +++ b/tests-mx32/test_ucopy.c @@ -0,0 +1,143 @@ +/* + * Test whether process_vm_readv and PTRACE_PEEKDATA work. + * + * Copyright (c) 2016-2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "test_ucopy.h" + +#ifndef HAVE_PROCESS_VM_READV + +# include +# include "scno.h" +static ssize_t +strace_process_vm_readv(pid_t pid, + const struct iovec *lvec, + unsigned long liovcnt, + const struct iovec *rvec, + unsigned long riovcnt, + unsigned long flags) +{ + return syscall(__NR_process_vm_readv, + (long) pid, lvec, liovcnt, rvec, riovcnt, flags); +} +# define process_vm_readv strace_process_vm_readv + +#endif /* !HAVE_PROCESS_VM_READV */ + +static bool +call_process_vm_readv(const int pid, long *const addr) +{ + long data = 0; + + const struct iovec local = { + .iov_base = &data, + .iov_len = sizeof(data) + }; + const struct iovec remote = { + .iov_base = addr, + .iov_len = sizeof(*addr) + }; + + return process_vm_readv(pid, &local, 1, &remote, 1, 0) == sizeof(data) + && data == 1; +} + +static bool +call_ptrace_peekdata(const int pid, long *const addr) +{ + return ptrace(PTRACE_PEEKDATA, pid, addr, 0) == 1; +} + +static bool +test_ucopy(bool (*fn)(int pid, long *addr)) +{ + static long data; + + data = 0; + bool rc = false; + int saved = 0; + + pid_t pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + data = 1; + if (ptrace(PTRACE_TRACEME, 0, 0, 0)) + perror_msg_and_fail("PTRACE_TRACEME"); + raise(SIGSTOP); + _exit(0); + } + + for (;;) { + int status, tracee; + + errno = 0; + tracee = wait(&status); + if (tracee != pid) { + if (errno == EINTR) + continue; + saved = errno; + kill(pid, SIGKILL); + errno = saved; + perror_msg_and_fail("wait"); + } + if (WIFEXITED(status)) { + if (WEXITSTATUS(status) == 0) + break; + error_msg_and_fail("unexpected exit status %u", + WEXITSTATUS(status)); + } + if (WIFSIGNALED(status)) + error_msg_and_fail("unexpected signal %u", + WTERMSIG(status)); + if (!WIFSTOPPED(status) || WSTOPSIG(status) != SIGSTOP) { + kill(pid, SIGKILL); + error_msg_and_fail("unexpected wait status %x", + status); + } + + errno = 0; + rc = fn(pid, &data); + if (!rc) + saved = errno; + + if (ptrace(PTRACE_CONT, pid, 0, 0)) { + saved = errno; + kill(pid, SIGKILL); + errno = saved; + perror_msg_and_fail("PTRACE_CONT"); + } + } + + if (!rc) + errno = saved; + return rc; +} + +bool +test_process_vm_readv(void) +{ + return test_ucopy(call_process_vm_readv); +} + +bool +test_ptrace_peekdata(void) +{ + return test_ucopy(call_ptrace_peekdata); +} diff --git a/tests-mx32/test_ucopy.h b/tests-mx32/test_ucopy.h new file mode 100644 index 00000000..1a3b2819 --- /dev/null +++ b/tests-mx32/test_ucopy.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include + +extern bool +test_process_vm_readv(void); + +extern bool +test_ptrace_peekdata(void); + +extern void +test_printpath(unsigned int test_max_size); + +extern void +test_printstrn(unsigned int test_max_size); diff --git a/tests-mx32/tests.h b/tests-mx32/tests.h index d4294de9..1a1b02c3 100644 --- a/tests-mx32/tests.h +++ b/tests-mx32/tests.h @@ -1,49 +1,66 @@ /* * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef STRACE_TESTS_H -#define STRACE_TESTS_H +# define STRACE_TESTS_H # ifdef HAVE_CONFIG_H # include "config.h" # endif +# ifdef TESTS_SIZEOF_KERNEL_LONG_T +# undef SIZEOF_KERNEL_LONG_T +# define SIZEOF_KERNEL_LONG_T TESTS_SIZEOF_KERNEL_LONG_T +# endif + +# ifdef TESTS_SIZEOF_LONG +# undef SIZEOF_LONG +# define SIZEOF_LONG TESTS_SIZEOF_LONG +# endif + +# include # include # include "kernel_types.h" # include "gcc_compat.h" +# include "macros.h" + +/* + * The printf-like function to use in header files + * shared between strace and its tests. + */ +# ifndef STRACE_PRINTF +# define STRACE_PRINTF printf +# endif /* Tests of "strace -v" are expected to define VERBOSE to 1. */ -#ifndef VERBOSE -# define VERBOSE 0 -#endif +# ifndef VERBOSE +# define VERBOSE 0 +# endif + +/* xlat verbosity defaults */ +# ifndef XLAT_RAW +# define XLAT_RAW 0 +# endif +# ifndef XLAT_VERBOSE +# define XLAT_VERBOSE 0 +# endif + +# ifndef DEFAULT_STRLEN +/* Default maximum # of bytes printed in printstr et al. */ +# define DEFAULT_STRLEN 32 +# endif /* Cached sysconf(_SC_PAGESIZE). */ size_t get_page_size(void); +/* The size of kernel's sigset_t. */ +unsigned int get_sigset_size(void); + /* Print message and strerror(errno) to stderr, then exit(1). */ void perror_msg_and_fail(const char *, ...) ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; @@ -57,9 +74,21 @@ void error_msg_and_skip(const char *, ...) void perror_msg_and_skip(const char *, ...) ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; +# ifndef perror_msg_and_fail +# define perror_msg_and_fail(fmt_, ...) \ + perror_msg_and_fail("%s:%d: " fmt_, __FILE__, __LINE__, ##__VA_ARGS__) +# endif +# ifndef perror_msg_and_fail +# define error_msg_and_fail(fmt_, ...) \ + error_msg_and_fail("%s:%d: " fmt_, __FILE__, __LINE__, ##__VA_ARGS__) +# endif + +/* Stat the specified file and skip the test if the stat call failed. */ +void skip_if_unavailable(const char *); + /* * Allocate memory that ends on the page boundary. - * Pages allocated by this call are preceeded by an unmapped page + * Pages allocated by this call are preceded by an unmapped page * and followed also by an unmapped page. */ void *tail_alloc(const size_t) @@ -68,13 +97,32 @@ void *tail_alloc(const size_t) void *tail_memdup(const void *, const size_t) ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((2)); +# define midtail_alloc(after_, before_) \ + ((void *) ((char *) tail_alloc(((before_) + (after_))) + (before_))) + +/* + * Allocate an object of the specified type at the end + * of a mapped memory region. + * Assign its address to the specified constant pointer. + */ +# define TAIL_ALLOC_OBJECT_CONST_PTR(type_name, type_ptr) \ + type_name *const type_ptr = tail_alloc(sizeof(*type_ptr)) + +/* + * Allocate an object of the specified type at the end + * of a mapped memory region. + * Assign its address to the specified variable pointer. + */ +# define TAIL_ALLOC_OBJECT_VAR_PTR(type_name, type_ptr) \ + type_name *type_ptr = tail_alloc(sizeof(*type_ptr)) + /* * Fill memory (pointed by ptr, having size bytes) with different bytes (with * values starting with start and resetting every period) in order to catch * sign, byte order and/or alignment errors. */ void fill_memory_ex(void *ptr, size_t size, unsigned char start, - unsigned char period); + unsigned int period); /* Shortcut for fill_memory_ex(ptr, size, 0x80, 0x80) */ void fill_memory(void *ptr, size_t size); @@ -94,11 +142,39 @@ const char *hexquote_strndup(const char *, size_t); /* Return inode number of socket descriptor. */ unsigned long inode_of_sockfd(int); +/* Print string in a quoted form with optional escape characters. */ +void print_quoted_string_ex(const char *, bool quote, const char *escape_str); + /* Print string in a quoted form. */ void print_quoted_string(const char *); +/* + * Print a NUL-terminated string `str' of length up to `size' - 1 + * in a quoted form. + */ +void print_quoted_cstring(const char *str, size_t size); + +/* + * Print a NUL-terminated string `str' of length up to `size' + * in a quoted form. + */ +void print_quoted_stringn(const char *str, size_t size); + +/* Print memory in a quoted form with optional escape characters. */ +void print_quoted_memory_ex(const void *, size_t, bool quote, + const char *escape_chars); + /* Print memory in a quoted form. */ -void print_quoted_memory(const char *, size_t); +void print_quoted_memory(const void *, size_t); + +/* Print memory in a hexquoted form. */ +void print_quoted_hex(const void *, size_t); + +/* Print time_t and nanoseconds in symbolic format. */ +void print_time_t_nsec(time_t, unsigned long long, int); + +/* Print time_t and microseconds in symbolic format. */ +void print_time_t_usec(time_t, unsigned long long, int); /* Read an int from the file. */ int read_int_from_file(const char *, int *); @@ -138,11 +214,24 @@ struct timespec; int recv_mmsg(int, struct mmsghdr *, unsigned int, unsigned int, struct timespec *); int send_mmsg(int, struct mmsghdr *, unsigned int, unsigned int); +/* Create a netlink socket. */ +int create_nl_socket_ext(int proto, const char *name); +# define create_nl_socket(proto) create_nl_socket_ext((proto), #proto) + /* Create a pipe with maximized descriptor numbers. */ void pipe_maxfd(int pipefd[2]); -#define F8ILL_KULONG_SUPPORTED (sizeof(void *) < sizeof(kernel_ulong_t)) -#define F8ILL_KULONG_MASK ((kernel_ulong_t) 0xffffffff00000000ULL) +/* if_nametoindex("lo") */ +unsigned int ifindex_lo(void); + +# ifdef HAVE_IF_INDEXTONAME +# define IFINDEX_LO_STR "if_nametoindex(\"lo\")" +# else +# define IFINDEX_LO_STR "1" +# endif + +# define F8ILL_KULONG_SUPPORTED (sizeof(void *) < sizeof(kernel_ulong_t)) +# define F8ILL_KULONG_MASK ((kernel_ulong_t) 0xffffffff00000000ULL) /* * For 64-bit kernel_ulong_t and 32-bit pointer, @@ -157,11 +246,10 @@ f8ill_ptr_to_kulong(const void *const ptr) ? F8ILL_KULONG_MASK | uptr : (kernel_ulong_t) uptr; } -# define ARRAY_SIZE(arg) ((unsigned int) (sizeof(arg) / sizeof((arg)[0]))) # define LENGTH_OF(arg) ((unsigned int) sizeof(arg) - 1) /* Zero-extend a signed integer type to unsigned long long. */ -#define zero_extend_signed_to_ull(v) \ +# define zero_extend_signed_to_ull(v) \ (sizeof(v) == sizeof(char) ? (unsigned long long) (unsigned char) (v) : \ sizeof(v) == sizeof(short) ? (unsigned long long) (unsigned short) (v) : \ sizeof(v) == sizeof(int) ? (unsigned long long) (unsigned int) (v) : \ @@ -169,7 +257,7 @@ f8ill_ptr_to_kulong(const void *const ptr) (unsigned long long) (v)) /* Sign-extend an unsigned integer type to long long. */ -#define sign_extend_unsigned_to_ll(v) \ +# define sign_extend_unsigned_to_ll(v) \ (sizeof(v) == sizeof(char) ? (long long) (char) (v) : \ sizeof(v) == sizeof(short) ? (long long) (short) (v) : \ sizeof(v) == sizeof(int) ? (long long) (int) (v) : \ @@ -179,26 +267,6 @@ f8ill_ptr_to_kulong(const void *const ptr) # define SKIP_MAIN_UNDEFINED(arg) \ int main(void) { error_msg_and_skip("undefined: %s", arg); } -/* - * The kernel used to define 64-bit types on 64-bit systems on a per-arch - * basis. Some architectures would use unsigned long and others would use - * unsigned long long. These types were exported as part of the - * kernel-userspace ABI and now must be maintained forever. This matches - * what the kernel exports for each architecture so we don't need to cast - * every printing of __u64 or __s64 to stdint types. - */ -# if SIZEOF_LONG == 4 -# define PRI__64 "ll" -# elif defined ALPHA || defined IA64 || defined MIPS || defined POWERPC -# define PRI__64 "l" -# else -# define PRI__64 "ll" -# endif - -# define PRI__d64 PRI__64"d" -# define PRI__u64 PRI__64"u" -# define PRI__x64 PRI__64"x" - # if WORDS_BIGENDIAN # define LL_PAIR(HI, LO) (HI), (LO) # else @@ -206,8 +274,19 @@ f8ill_ptr_to_kulong(const void *const ptr) # endif # define LL_VAL_TO_PAIR(llval) LL_PAIR((long) ((llval) >> 32), (long) (llval)) -# define _STR(_arg) #_arg # define ARG_STR(_arg) (_arg), #_arg # define ARG_ULL_STR(_arg) _arg##ULL, #_arg +/* + * Assign an object of type DEST_TYPE at address DEST_ADDR + * using memcpy to avoid potential unaligned access. + */ +# define SET_STRUCT(DEST_TYPE, DEST_ADDR, ...) \ + do { \ + DEST_TYPE dest_type_tmp_var = { __VA_ARGS__ }; \ + memcpy(DEST_ADDR, &dest_type_tmp_var, sizeof(dest_type_tmp_var)); \ + } while (0) + +# define NLMSG_ATTR(nlh, hdrlen) ((void *)(nlh) + NLMSG_SPACE(hdrlen)) + #endif /* !STRACE_TESTS_H */ diff --git a/tests-mx32/threads-execve.c b/tests-mx32/threads-execve.c index 853645ff..56fab529 100644 --- a/tests-mx32/threads-execve.c +++ b/tests-mx32/threads-execve.c @@ -2,29 +2,10 @@ * Check decoding of threads when a non-leader thread invokes execve. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -136,31 +117,31 @@ thread(void *arg) switch (action % NUMBER_OF_ACTIONS) { case ACTION_exit: printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" - ", [/* %u vars */] \n", + ", %p /* %u vars */ \n", tid, argv[0], argv[0], argv[1], argv[2], - arglen(environ), leader); + environ, arglen(environ), leader); break; case ACTION_rt_sigsuspend: printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" - ", [/* %u vars */] \n" + ", %p /* %u vars */ \n" "%-5d <... rt_sigsuspend resumed>) = ?\n", tid, argv[0], argv[0], argv[1], argv[2], - arglen(environ), + environ, arglen(environ), leader); break; case ACTION_nanosleep: printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" - ", [/* %u vars */] \n" + ", %p /* %u vars */ \n" "%-5d <... nanosleep resumed> )" " = ?\n", tid, argv[0], argv[0], argv[1], argv[2], - arglen(environ), + environ, arglen(environ), leader); break; } printf("%-5d +++ superseded by execve in pid %u +++\n" - "%-5d <... execve resumed> ) = 0\n", + "%-5d <... execve resumed>) = 0\n", leader, tid, leader); @@ -180,18 +161,15 @@ main(int ac, char **av) if (clock_nanosleep(CLOCK_REALTIME, 0, &ts, NULL)) perror_msg_and_skip("clock_nanosleep CLOCK_REALTIME"); - printf("%-5d execve(\"%s\", [\"%s\"], [/* %u vars */]) = 0\n", - leader, av[0], av[0], arglen(environ)); - get_sigsetsize(); static char buf[sizeof(sigsetsize) * 3]; sprintf(buf, "%u", sigsetsize); char *argv[] = { av[0], buf, (char *) "0", NULL }; printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" - ", [/* %u vars */]) = 0\n", + ", %p /* %u vars */) = 0\n", leader, argv[0], argv[0], argv[1], argv[2], - arglen(environ)); + environ, arglen(environ)); execve(argv[0], argv, environ); perror_msg_and_fail("execve"); } diff --git a/tests-mx32/threads-execve.test b/tests-mx32/threads-execve.test index 4a771467..04ce15df 100755 --- a/tests-mx32/threads-execve.test +++ b/tests-mx32/threads-execve.test @@ -3,29 +3,10 @@ # Check decoding of threads when a non-leader thread invokes execve. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2019 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -34,17 +15,20 @@ require_min_kernel_version_or_skip 3.1 check_prog diff +run_prog_skip_if_failed date +%s > /dev/null +s0="$(date +%s)" + run_prog > /dev/null set -- -a21 -f -esignal=none -e trace=execve,exit,nanosleep,rt_sigsuspend $args # Due to probabilistic nature of the test, try it several times. -i=0 -while [ $i -le 9 ]; do +while :; do run_strace "$@" > "$EXP" - diff -- "$EXP" "$LOG" || continue - rm -f "$EXP" - exit 0 + sed 1d < "$LOG" > "$OUT" + diff -- "$EXP" "$OUT" && exit 0 + s1="$(date +%s)" + if [ "$(($s1-$s0))" -gt "$(($TIMEOUT_DURATION/2))" ]; then + fail_ "$STRACE $* output mismatch" + fi done - -fail_ "$STRACE $* output mismatch" diff --git a/tests-mx32/time.c b/tests-mx32/time.c index 4a5cde9c..330c8846 100644 --- a/tests-mx32/time.c +++ b/tests-mx32/time.c @@ -2,29 +2,10 @@ * This file is part of time strace test. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,15 +21,24 @@ int main(void) { - time_t *p = tail_alloc(sizeof(time_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(time_t, p); time_t t = syscall(__NR_time, NULL); if ((time_t) -1 == t) perror_msg_and_skip("time"); - printf("time(NULL) = %jd\n", (intmax_t) t); + printf("time(NULL) = %lld (", (long long) t); + print_time_t_nsec(t, 0, 0); + puts(")"); + + t = syscall(__NR_time, p + 1); + printf("time(%p) = %s\n", p + 1, sprintrc(t)); t = syscall(__NR_time, p); - printf("time([%jd]) = %jd\n", (intmax_t) *p, (intmax_t) t); + printf("time([%lld", (long long) *p); + print_time_t_nsec((time_t) *p, 0, 1), + printf("]) = %lld (", (long long) t); + print_time_t_nsec(t, 0, 0); + puts(")"); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/time.gen.test b/tests-mx32/time.gen.test new file mode 100755 index 00000000..3269b164 --- /dev/null +++ b/tests-mx32/time.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (time -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-mx32/time.test b/tests-mx32/time.test deleted file mode 100755 index 6ab193a4..00000000 --- a/tests-mx32/time.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check time syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 diff --git a/tests-mx32/timer_create.c b/tests-mx32/timer_create.c index 1a259627..c9c64813 100644 --- a/tests-mx32/timer_create.c +++ b/tests-mx32/timer_create.c @@ -1,30 +1,10 @@ /* * This file is part of timer_create strace test. * - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -98,9 +78,9 @@ main(void) sev.sigev_un.sigev_thread.attribute, tid[2]); -#ifndef SIGEV_THREAD_ID -# define SIGEV_THREAD_ID 4 -#endif +# ifndef SIGEV_THREAD_ID +# define SIGEV_THREAD_ID 4 +# endif sev.sigev_notify = SIGEV_THREAD_ID; sev.sigev_un.tid = getpid(); if (syscall(__NR_timer_create, CLOCK_MONOTONIC, &sev, &tid[3])) diff --git a/tests-mx32/timer_create.gen.test b/tests-mx32/timer_create.gen.test new file mode 100755 index 00000000..bf652612 --- /dev/null +++ b/tests-mx32/timer_create.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (timer_create ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/timer_create.test b/tests-mx32/timer_create.test deleted file mode 100755 index 870a1795..00000000 --- a/tests-mx32/timer_create.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check timer_create syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/timer_xettime.c b/tests-mx32/timer_xettime.c index 9eabbf08..17390c2d 100644 --- a/tests-mx32/timer_xettime.c +++ b/tests-mx32/timer_xettime.c @@ -2,29 +2,10 @@ * This file is part of timer_xettime strace test. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -47,6 +28,7 @@ main(void) printf("timer_settime(%d, TIMER_ABSTIME, NULL, NULL)" " = -1 EINVAL (%m)\n", 0xdefaced); + long rc; int tid; struct sigevent sev = { .sigev_notify = SIGEV_NONE }; @@ -55,51 +37,61 @@ main(void) printf("timer_create(CLOCK_MONOTONIC, {sigev_signo=0" ", sigev_notify=SIGEV_NONE}, [%d]) = 0\n", tid); - struct { - struct itimerspec its; - uint32_t pad[4]; - } old = { - .its = { - .it_interval = { 0xdeface5, 0xdeface6 }, - .it_value = { 0xdeface7, 0xdeface8 } - }, - .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } - }, new = { - .its = { - .it_interval = { 0xdeface1, 0xdeface2 }, - .it_value = { 0xdeface3, 0xdeface4 } - }, - .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } - }; - - if (syscall(__NR_timer_settime, tid, 0, &new.its, &old.its)) + TAIL_ALLOC_OBJECT_CONST_PTR(struct itimerspec, its_new); + TAIL_ALLOC_OBJECT_CONST_PTR(struct itimerspec, its_old); + + its_new->it_interval.tv_sec = 0xdeadbeefU; + its_new->it_interval.tv_nsec = 0xfacefeedU; + its_new->it_value.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + its_new->it_value.tv_nsec = (long) 0xbadc0dedfacefeedLL; + + rc = syscall(__NR_timer_settime, tid, 0, its_new, its_old); + printf("timer_settime(%d, 0" + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}, %p) = %s\n", + tid, (long long) its_new->it_interval.tv_sec, + zero_extend_signed_to_ull(its_new->it_interval.tv_nsec), + (long long) its_new->it_value.tv_sec, + zero_extend_signed_to_ull(its_new->it_value.tv_nsec), + its_old, sprintrc(rc)); + + its_new->it_interval.tv_sec = 0xdeface1; + its_new->it_interval.tv_nsec = 0xdeface2; + its_new->it_value.tv_sec = 0xdeface3; + its_new->it_value.tv_nsec = 0xdeface4; + its_old->it_interval.tv_sec = 0xdeface5; + its_old->it_interval.tv_nsec = 0xdeface6; + its_old->it_value.tv_sec = 0xdeface7; + its_old->it_value.tv_nsec = 0xdeface8; + + if (syscall(__NR_timer_settime, tid, 0, its_new, its_old)) perror_msg_and_skip("timer_settime"); printf("timer_settime(%d, 0" - ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" - ", it_value={tv_sec=%jd, tv_nsec=%jd}}" - ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" - ", it_value={tv_sec=%jd, tv_nsec=%jd}}" + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}" + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}" ") = 0\n", tid, - (intmax_t) new.its.it_interval.tv_sec, - (intmax_t) new.its.it_interval.tv_nsec, - (intmax_t) new.its.it_value.tv_sec, - (intmax_t) new.its.it_value.tv_nsec, - (intmax_t) old.its.it_interval.tv_sec, - (intmax_t) old.its.it_interval.tv_nsec, - (intmax_t) old.its.it_value.tv_sec, - (intmax_t) old.its.it_value.tv_nsec); - - if (syscall(__NR_timer_gettime, tid, &old.its)) + (long long) its_new->it_interval.tv_sec, + zero_extend_signed_to_ull(its_new->it_interval.tv_nsec), + (long long) its_new->it_value.tv_sec, + zero_extend_signed_to_ull(its_new->it_value.tv_nsec), + (long long) its_old->it_interval.tv_sec, + zero_extend_signed_to_ull(its_old->it_interval.tv_nsec), + (long long) its_old->it_value.tv_sec, + zero_extend_signed_to_ull(its_old->it_value.tv_nsec)); + + if (syscall(__NR_timer_gettime, tid, its_old)) perror_msg_and_skip("timer_gettime"); printf("timer_gettime(%d" - ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" - ", it_value={tv_sec=%jd, tv_nsec=%jd}}) = 0\n", + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}) = 0\n", tid, - (intmax_t) old.its.it_interval.tv_sec, - (intmax_t) old.its.it_interval.tv_nsec, - (intmax_t) old.its.it_value.tv_sec, - (intmax_t) old.its.it_value.tv_nsec); + (long long) its_old->it_interval.tv_sec, + zero_extend_signed_to_ull(its_old->it_interval.tv_nsec), + (long long) its_old->it_value.tv_sec, + zero_extend_signed_to_ull(its_old->it_value.tv_nsec)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/timer_xettime.gen.test b/tests-mx32/timer_xettime.gen.test new file mode 100755 index 00000000..6e2dffaa --- /dev/null +++ b/tests-mx32/timer_xettime.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (timer_xettime -e trace=timer_create,timer_settime,timer_gettime); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=timer_create,timer_settime,timer_gettime diff --git a/tests-mx32/timer_xettime.test b/tests-mx32/timer_xettime.test deleted file mode 100755 index 08bcdd68..00000000 --- a/tests-mx32/timer_xettime.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check timer_create, timer_settime, and timer_gettime syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=timer_create,timer_settime,timer_gettime diff --git a/tests-mx32/timerfd_xettime.c b/tests-mx32/timerfd_xettime.c index ca7124ec..73616677 100644 --- a/tests-mx32/timerfd_xettime.c +++ b/tests-mx32/timerfd_xettime.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -47,49 +28,59 @@ main(void) perror_msg_and_skip("timerfd_create"); puts("timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC|TFD_NONBLOCK) = 0"); - struct { - struct itimerspec its; - uint32_t pad[4]; - } old = { - .its = { - .it_interval = { 0xdeface5, 0xdeface6 }, - .it_value = { 0xdeface7, 0xdeface8 } - }, - .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } - }, new = { - .its = { - .it_interval = { 0xdeface1, 0xdeface2 }, - .it_value = { 0xdeface3, 0xdeface4 } - }, - .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } - }; + TAIL_ALLOC_OBJECT_CONST_PTR(struct itimerspec, its_new); + TAIL_ALLOC_OBJECT_CONST_PTR(struct itimerspec, its_old); + + its_new->it_interval.tv_sec = 0xdeadbeefU; + its_new->it_interval.tv_nsec = 0xfacefeedU; + its_new->it_value.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + its_new->it_value.tv_nsec = (long) 0xbadc0dedfacefeedLL; + + long rc = syscall(__NR_timerfd_settime, 0, 0, its_new, its_old); + printf("timerfd_settime(0, 0" + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}, %p) = %s\n", + (long long) its_new->it_interval.tv_sec, + zero_extend_signed_to_ull(its_new->it_interval.tv_nsec), + (long long) its_new->it_value.tv_sec, + zero_extend_signed_to_ull(its_new->it_value.tv_nsec), + its_old, sprintrc(rc)); + + its_new->it_interval.tv_sec = 0xdeface1; + its_new->it_interval.tv_nsec = 0xdeface2; + its_new->it_value.tv_sec = 0xdeface3; + its_new->it_value.tv_nsec = 0xdeface4; + its_old->it_interval.tv_sec = 0xdeface5; + its_old->it_interval.tv_nsec = 0xdeface6; + its_old->it_value.tv_sec = 0xdeface7; + its_old->it_value.tv_nsec = 0xdeface8; - if (syscall(__NR_timerfd_settime, 0, 0, &new.its, &old.its)) + if (syscall(__NR_timerfd_settime, 0, 0, its_new, its_old)) perror_msg_and_skip("timerfd_settime"); printf("timerfd_settime(0, 0" - ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" - ", it_value={tv_sec=%jd, tv_nsec=%jd}}" - ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" - ", it_value={tv_sec=%jd, tv_nsec=%jd}}" + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}" + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}" ") = 0\n", - (intmax_t) new.its.it_interval.tv_sec, - (intmax_t) new.its.it_interval.tv_nsec, - (intmax_t) new.its.it_value.tv_sec, - (intmax_t) new.its.it_value.tv_nsec, - (intmax_t) old.its.it_interval.tv_sec, - (intmax_t) old.its.it_interval.tv_nsec, - (intmax_t) old.its.it_value.tv_sec, - (intmax_t) old.its.it_value.tv_nsec); + (long long) its_new->it_interval.tv_sec, + zero_extend_signed_to_ull(its_new->it_interval.tv_nsec), + (long long) its_new->it_value.tv_sec, + zero_extend_signed_to_ull(its_new->it_value.tv_nsec), + (long long) its_old->it_interval.tv_sec, + zero_extend_signed_to_ull(its_old->it_interval.tv_nsec), + (long long) its_old->it_value.tv_sec, + zero_extend_signed_to_ull(its_old->it_value.tv_nsec)); - if (syscall(__NR_timerfd_gettime, 0, &old.its)) + if (syscall(__NR_timerfd_gettime, 0, its_old)) perror_msg_and_skip("timerfd_gettime"); printf("timerfd_gettime(0" - ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" - ", it_value={tv_sec=%jd, tv_nsec=%jd}}) = 0\n", - (intmax_t) old.its.it_interval.tv_sec, - (intmax_t) old.its.it_interval.tv_nsec, - (intmax_t) old.its.it_value.tv_sec, - (intmax_t) old.its.it_value.tv_nsec); + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}) = 0\n", + (long long) its_old->it_interval.tv_sec, + zero_extend_signed_to_ull(its_old->it_interval.tv_nsec), + (long long) its_old->it_value.tv_sec, + zero_extend_signed_to_ull(its_old->it_value.tv_nsec)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/timerfd_xettime.gen.test b/tests-mx32/timerfd_xettime.gen.test new file mode 100755 index 00000000..97e560bd --- /dev/null +++ b/tests-mx32/timerfd_xettime.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (timerfd_xettime -e trace=timerfd_create,timerfd_settime,timerfd_gettime); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=timerfd_create,timerfd_settime,timerfd_gettime diff --git a/tests-mx32/timerfd_xettime.test b/tests-mx32/timerfd_xettime.test deleted file mode 100755 index 75aa21c2..00000000 --- a/tests-mx32/timerfd_xettime.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check timerfd_create, timerfd_settime, and timerfd_gettime syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=timerfd_create,timerfd_settime,timerfd_gettime diff --git a/tests-mx32/times-fail.c b/tests-mx32/times-fail.c index cb69bd43..551803df 100644 --- a/tests-mx32/times-fail.c +++ b/tests-mx32/times-fail.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include @@ -5,7 +12,7 @@ #include int -main (void) +main(void) { assert(syscall(__NR_times, 0x42) == -1); printf("times(0x42) = -1 EFAULT (%m)\n"); diff --git a/tests-mx32/times-fail.gen.test b/tests-mx32/times-fail.gen.test new file mode 100755 index 00000000..9934d193 --- /dev/null +++ b/tests-mx32/times-fail.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (times-fail -a12 -e trace=times); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 -e trace=times diff --git a/tests-mx32/times-fail.test b/tests-mx32/times-fail.test deleted file mode 100755 index ee28a060..00000000 --- a/tests-mx32/times-fail.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of failing times syscall - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a12 -e trace=times diff --git a/tests-mx32/times.c b/tests-mx32/times.c index 2c7b95e5..a390dde4 100644 --- a/tests-mx32/times.c +++ b/tests-mx32/times.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2015 Eugene Syromyatnikov * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ /** @@ -49,7 +30,7 @@ enum { }; int -main (void) +main(void) { struct timespec ts; volatile int dummy = 0; diff --git a/tests-mx32/times.gen.test b/tests-mx32/times.gen.test new file mode 100755 index 00000000..06b036fc --- /dev/null +++ b/tests-mx32/times.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (times -esignal=none ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests-mx32/times.test b/tests-mx32/times.test deleted file mode 100755 index b97e0d33..00000000 --- a/tests-mx32/times.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of times syscall - -. "${srcdir=.}/init.sh" -run_strace_match_diff -esignal=none diff --git a/tests-mx32/tprintf.c b/tests-mx32/tprintf.c index a759d8af..060af760 100644 --- a/tests-mx32/tprintf.c +++ b/tests-mx32/tprintf.c @@ -1,30 +1,10 @@ /* * Close stdin, move stdout to a non-standard descriptor, and print. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/trace_fstat.gen.test b/tests-mx32/trace_fstat.gen.test new file mode 100755 index 00000000..c3aede16 --- /dev/null +++ b/tests-mx32/trace_fstat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_fstat test_trace_expr '' -e%fstat -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e%fstat -v -P stat.sample -P /dev/full diff --git a/tests-mx32/trace_fstat.in b/tests-mx32/trace_fstat.in new file mode 100644 index 00000000..3fde131d --- /dev/null +++ b/tests-mx32/trace_fstat.in @@ -0,0 +1,11 @@ +fstat -a15 +fstat-Xabbrev -a15 -Xabbrev +fstat-Xraw -a15 -Xraw +fstat-Xverbose -a15 -Xverbose +fstat64 -a17 +fstat64-Xabbrev -a17 -Xabbrev +fstat64-Xraw -a17 -Xraw +fstat64-Xverbose -a17 -Xverbose +fstatat64 -a32 +newfstatat -a32 +oldfstat -a21 diff --git a/tests-mx32/trace_fstatfs.gen.test b/tests-mx32/trace_fstatfs.gen.test new file mode 100755 index 00000000..063f624c --- /dev/null +++ b/tests-mx32/trace_fstatfs.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_fstatfs test_trace_expr '' -e%fstatfs); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e%fstatfs diff --git a/tests-mx32/trace_fstatfs.in b/tests-mx32/trace_fstatfs.in new file mode 100644 index 00000000..6441a079 --- /dev/null +++ b/tests-mx32/trace_fstatfs.in @@ -0,0 +1,2 @@ +fstatfs -a18 +fstatfs64 -a24 diff --git a/tests-mx32/trace_lstat.gen.test b/tests-mx32/trace_lstat.gen.test new file mode 100755 index 00000000..a05b7a15 --- /dev/null +++ b/tests-mx32/trace_lstat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_lstat test_trace_expr '' -e%lstat -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e%lstat -v -P stat.sample -P /dev/full diff --git a/tests-mx32/trace_lstat.in b/tests-mx32/trace_lstat.in new file mode 100644 index 00000000..abbabc49 --- /dev/null +++ b/tests-mx32/trace_lstat.in @@ -0,0 +1,3 @@ +lstat -a32 +lstat64 -a32 +oldlstat -a32 diff --git a/tests-mx32/trace_personality_32.gen.test b/tests-mx32/trace_personality_32.gen.test new file mode 100755 index 00000000..a5f5c7d1 --- /dev/null +++ b/tests-mx32/trace_personality_32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_personality_32 +qualify_personality.sh 32 'getcwd' 'fsync-y'); do not edit. +set -- 32 'getcwd' 'fsync-y' +. "${srcdir=.}/qualify_personality.sh" diff --git a/tests-mx32/trace_personality_32.in b/tests-mx32/trace_personality_32.in new file mode 100644 index 00000000..9da47c1a --- /dev/null +++ b/tests-mx32/trace_personality_32.in @@ -0,0 +1 @@ +getcwd -a18 diff --git a/tests-mx32/trace_personality_64.gen.test b/tests-mx32/trace_personality_64.gen.test new file mode 100755 index 00000000..5b961efa --- /dev/null +++ b/tests-mx32/trace_personality_64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_personality_64 +qualify_personality.sh 64 'getcwd' 'fsync-y'); do not edit. +set -- 64 'getcwd' 'fsync-y' +. "${srcdir=.}/qualify_personality.sh" diff --git a/tests-mx32/trace_personality_64.in b/tests-mx32/trace_personality_64.in new file mode 100644 index 00000000..9da47c1a --- /dev/null +++ b/tests-mx32/trace_personality_64.in @@ -0,0 +1 @@ +getcwd -a18 diff --git a/tests-mx32/trace_personality_regex_32.gen.test b/tests-mx32/trace_personality_regex_32.gen.test new file mode 100755 index 00000000..f2800d2a --- /dev/null +++ b/tests-mx32/trace_personality_regex_32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_personality_regex_32 +qualify_personality.sh 32 '/clock.*' 'times|fcntl.*'); do not edit. +set -- 32 '/clock.*' 'times|fcntl.*' +. "${srcdir=.}/qualify_personality.sh" diff --git a/tests-mx32/trace_personality_regex_32.in b/tests-mx32/trace_personality_regex_32.in new file mode 100755 index 00000000..864de290 --- /dev/null +++ b/tests-mx32/trace_personality_regex_32.in @@ -0,0 +1,3 @@ +clock_adjtime -a37 +clock_nanosleep +clock_xettime -a36 diff --git a/tests-mx32/trace_personality_regex_64.gen.test b/tests-mx32/trace_personality_regex_64.gen.test new file mode 100755 index 00000000..4b19f1b0 --- /dev/null +++ b/tests-mx32/trace_personality_regex_64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_personality_regex_64 +qualify_personality.sh 64 '/clock.*' 'times|fcntl.*'); do not edit. +set -- 64 '/clock.*' 'times|fcntl.*' +. "${srcdir=.}/qualify_personality.sh" diff --git a/tests-mx32/trace_personality_regex_64.in b/tests-mx32/trace_personality_regex_64.in new file mode 100755 index 00000000..864de290 --- /dev/null +++ b/tests-mx32/trace_personality_regex_64.in @@ -0,0 +1,3 @@ +clock_adjtime -a37 +clock_nanosleep +clock_xettime -a36 diff --git a/tests-mx32/trace_personality_regex_x32.gen.test b/tests-mx32/trace_personality_regex_x32.gen.test new file mode 100755 index 00000000..7f416712 --- /dev/null +++ b/tests-mx32/trace_personality_regex_x32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_personality_regex_x32 +qualify_personality.sh x32 '/clock.*' 'times|fcntl.*'); do not edit. +set -- x32 '/clock.*' 'times|fcntl.*' +. "${srcdir=.}/qualify_personality.sh" diff --git a/tests-mx32/trace_personality_regex_x32.in b/tests-mx32/trace_personality_regex_x32.in new file mode 100755 index 00000000..864de290 --- /dev/null +++ b/tests-mx32/trace_personality_regex_x32.in @@ -0,0 +1,3 @@ +clock_adjtime -a37 +clock_nanosleep +clock_xettime -a36 diff --git a/tests-mx32/trace_personality_x32.gen.test b/tests-mx32/trace_personality_x32.gen.test new file mode 100755 index 00000000..724499ae --- /dev/null +++ b/tests-mx32/trace_personality_x32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_personality_x32 +qualify_personality.sh x32 'getcwd' 'fsync-y'); do not edit. +set -- x32 'getcwd' 'fsync-y' +. "${srcdir=.}/qualify_personality.sh" diff --git a/tests-mx32/trace_personality_x32.in b/tests-mx32/trace_personality_x32.in new file mode 100644 index 00000000..9da47c1a --- /dev/null +++ b/tests-mx32/trace_personality_x32.in @@ -0,0 +1 @@ +getcwd -a18 diff --git a/tests-mx32/trace_question.gen.test b/tests-mx32/trace_question.gen.test new file mode 100755 index 00000000..76b3578c --- /dev/null +++ b/tests-mx32/trace_question.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_question test_trace_expr '' -e?osf_utimes,?/^pkey_.*); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e?osf_utimes,?/^pkey_.* diff --git a/tests-mx32/trace_question.in b/tests-mx32/trace_question.in new file mode 100644 index 00000000..74d662c5 --- /dev/null +++ b/tests-mx32/trace_question.in @@ -0,0 +1,4 @@ +osf_utimes -a21 +pkey_alloc -a17 +pkey_free -a13 +pkey_mprotect -a37 diff --git a/tests-mx32/trace_stat.gen.test b/tests-mx32/trace_stat.gen.test new file mode 100755 index 00000000..ae95ab86 --- /dev/null +++ b/tests-mx32/trace_stat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_stat test_trace_expr '' -e%stat -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e%stat -v -P stat.sample -P /dev/full diff --git a/tests-mx32/trace_stat.in b/tests-mx32/trace_stat.in new file mode 100644 index 00000000..f105d784 --- /dev/null +++ b/tests-mx32/trace_stat.in @@ -0,0 +1,3 @@ +oldstat -a32 +stat -a32 +stat64 -a32 diff --git a/tests-mx32/trace_stat_like.gen.test b/tests-mx32/trace_stat_like.gen.test new file mode 100755 index 00000000..5681a8a3 --- /dev/null +++ b/tests-mx32/trace_stat_like.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_stat_like test_trace_expr '' -e%%stat -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e%%stat -v -P stat.sample -P /dev/full diff --git a/tests-mx32/trace_stat_like.in b/tests-mx32/trace_stat_like.in new file mode 100644 index 00000000..c48addbf --- /dev/null +++ b/tests-mx32/trace_stat_like.in @@ -0,0 +1,18 @@ +fstat -a15 +fstat-Xabbrev -a15 -Xabbrev +fstat-Xraw -a15 -Xraw +fstat-Xverbose -a15 -Xverbose +fstat64 -a17 +fstat64-Xabbrev -a17 -Xabbrev +fstat64-Xraw -a17 -Xraw +fstat64-Xverbose -a17 -Xverbose +fstatat64 -a32 +lstat -a32 +lstat64 -a32 +newfstatat -a32 +oldfstat -a21 +oldlstat -a32 +oldstat -a32 +stat -a32 +stat64 -a32 +statx -a32 diff --git a/tests-mx32/trace_statfs.gen.test b/tests-mx32/trace_statfs.gen.test new file mode 100755 index 00000000..957412b9 --- /dev/null +++ b/tests-mx32/trace_statfs.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_statfs test_trace_expr '' -e%statfs); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e%statfs diff --git a/tests-mx32/trace_statfs.in b/tests-mx32/trace_statfs.in new file mode 100644 index 00000000..7c4adfe1 --- /dev/null +++ b/tests-mx32/trace_statfs.in @@ -0,0 +1,2 @@ +statfs -a17 +statfs64 -a23 diff --git a/tests-mx32/trace_statfs_like.gen.test b/tests-mx32/trace_statfs_like.gen.test new file mode 100755 index 00000000..be1a9c03 --- /dev/null +++ b/tests-mx32/trace_statfs_like.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_statfs_like test_trace_expr '' -e%%statfs); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e%%statfs diff --git a/tests-mx32/trace_statfs_like.in b/tests-mx32/trace_statfs_like.in new file mode 100644 index 00000000..285aec6c --- /dev/null +++ b/tests-mx32/trace_statfs_like.in @@ -0,0 +1,5 @@ +statfs -a17 +statfs64 -a23 +fstatfs -a18 +fstatfs64 -a24 +ustat -a33 diff --git a/tests-mx32/truncate.c b/tests-mx32/truncate.c index d9529334..bfb6299b 100644 --- a/tests-mx32/truncate.c +++ b/tests-mx32/truncate.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/truncate.gen.test b/tests-mx32/truncate.gen.test new file mode 100755 index 00000000..7a631ef0 --- /dev/null +++ b/tests-mx32/truncate.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (truncate ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/truncate.test b/tests-mx32/truncate.test deleted file mode 100755 index 6bf1e702..00000000 --- a/tests-mx32/truncate.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check truncate syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/truncate64.c b/tests-mx32/truncate64.c index 8c29ea81..1dceb414 100644 --- a/tests-mx32/truncate64.c +++ b/tests-mx32/truncate64.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/truncate64.gen.test b/tests-mx32/truncate64.gen.test new file mode 100755 index 00000000..2b368f44 --- /dev/null +++ b/tests-mx32/truncate64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (truncate64 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests-mx32/truncate64.test b/tests-mx32/truncate64.test deleted file mode 100755 index c4668062..00000000 --- a/tests-mx32/truncate64.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check truncate64 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests-mx32/ugetrlimit.c b/tests-mx32/ugetrlimit.c index a99e496d..49627c1f 100644 --- a/tests-mx32/ugetrlimit.c +++ b/tests-mx32/ugetrlimit.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/ugetrlimit.gen.test b/tests-mx32/ugetrlimit.gen.test new file mode 100755 index 00000000..a412fe6a --- /dev/null +++ b/tests-mx32/ugetrlimit.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ugetrlimit -a28 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-mx32/ugetrlimit.test b/tests-mx32/ugetrlimit.test deleted file mode 100755 index f4648ff1..00000000 --- a/tests-mx32/ugetrlimit.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of ugetrlimit syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 diff --git a/tests-mx32/uio.c b/tests-mx32/uio.c index 6291f972..d1a1cc51 100644 --- a/tests-mx32/uio.c +++ b/tests-mx32/uio.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -39,16 +20,16 @@ main(void) { const off_t offset = 0xdefaceddeadbeefLL; char buf[4]; - struct iovec iov = { buf, sizeof buf }; + struct iovec iov = { buf, sizeof(buf) }; (void) close(0); assert(open("/dev/zero", O_RDONLY) == 0); - assert(pread(0, buf, sizeof buf, offset) == 4); + assert(pread(0, buf, sizeof(buf), offset) == 4); assert(preadv(0, &iov, 1, offset) == 4); assert(!close(0)); assert(open("/dev/null", O_WRONLY) == 0); - assert(pwrite(0, buf, sizeof buf, offset) == 4); + assert(pwrite(0, buf, sizeof(buf), offset) == 4); assert(pwritev(0, &iov, 1, offset) == 4); assert(!close(0)); diff --git a/tests-mx32/uio.test b/tests-mx32/uio.test index 020b97e9..75eb5de2 100755 --- a/tests-mx32/uio.test +++ b/tests-mx32/uio.test @@ -1,11 +1,16 @@ #!/bin/sh - +# # Check how pread/pwrite and preadv/pwritev syscalls are traced. +# +# Copyright (c) 2014-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog -run_strace -edesc $args +run_strace -e%desc $args match_grep exit 0 diff --git a/tests-mx32/umask.c b/tests-mx32/umask.c index 86903a95..1a196f43 100644 --- a/tests-mx32/umask.c +++ b/tests-mx32/umask.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include #include diff --git a/tests-mx32/umask.gen.test b/tests-mx32/umask.gen.test new file mode 100755 index 00000000..5d6c3187 --- /dev/null +++ b/tests-mx32/umask.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (umask -a11 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 diff --git a/tests-mx32/umask.test b/tests-mx32/umask.test deleted file mode 100755 index 1351721f..00000000 --- a/tests-mx32/umask.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check umask syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a11 diff --git a/tests-mx32/umode_t.c b/tests-mx32/umode_t.c index 5041638e..9c4e304f 100644 --- a/tests-mx32/umode_t.c +++ b/tests-mx32/umode_t.c @@ -2,29 +2,10 @@ * Check decoding of umode_t type syscall arguments. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -38,7 +19,7 @@ # define TEST_SYSCALL_PREFIX_STR "" #endif -static const char sample[] = TEST_SYSCALL_STR; +static const char *sample; static void test_syscall(unsigned short mode) @@ -49,17 +30,18 @@ test_syscall(unsigned short mode) if (mode <= 07) printf("%s(%s\"%s\", 00%d) = %ld %s (%m)\n", - sample, TEST_SYSCALL_PREFIX_STR, + TEST_SYSCALL_STR, TEST_SYSCALL_PREFIX_STR, sample, (int) mode, rc, errno2name()); else printf("%s(%s\"%s\", %#03ho) = %ld %s (%m)\n", - sample, TEST_SYSCALL_PREFIX_STR, + TEST_SYSCALL_STR, TEST_SYSCALL_PREFIX_STR, sample, mode, rc, errno2name()); } int -main(void) +main(int ac, char **av) { + sample = av[0]; test_syscall(0); test_syscall(0xffff); test_syscall(06); diff --git a/tests-mx32/umount.c b/tests-mx32/umount.c index eda7ae5c..cd89aa0b 100644 --- a/tests-mx32/umount.c +++ b/tests-mx32/umount.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2019 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -35,7 +15,7 @@ #ifdef __NR_oldumount # define TEST_SYSCALL_STR "oldumount" #else -# if defined __NR_umount && defined __NR_umount2 +# if defined __NR_umount && defined __NR_umount2 && __NR_umount != __NR_umount2 # define __NR_oldumount __NR_umount # define TEST_SYSCALL_STR "umount" # endif diff --git a/tests-mx32/umount.test b/tests-mx32/umount.test index a5840d54..e98ad9f3 100755 --- a/tests-mx32/umount.test +++ b/tests-mx32/umount.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check umount syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests-mx32/umount2.c b/tests-mx32/umount2.c index 1a6d8451..d313d597 100644 --- a/tests-mx32/umount2.c +++ b/tests-mx32/umount2.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2019 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,7 +12,7 @@ #include #include -#ifdef __NR_umount2 +#if defined __NR_umount2 && (!defined __NR_umount || __NR_umount2 != __NR_umount) # define TEST_SYSCALL_STR "umount2" #else # define __NR_umount2 __NR_umount diff --git a/tests-mx32/umount2.test b/tests-mx32/umount2.test index c43b38db..33b466d5 100755 --- a/tests-mx32/umount2.test +++ b/tests-mx32/umount2.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check umount2 syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests-mx32/umoven-illptr.c b/tests-mx32/umoven-illptr.c index 4deee163..25839f77 100644 --- a/tests-mx32/umoven-illptr.c +++ b/tests-mx32/umoven-illptr.c @@ -1,30 +1,10 @@ /* * Check decoding of invalid pointer by umoven. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/umoven-illptr.gen.test b/tests-mx32/umoven-illptr.gen.test new file mode 100755 index 00000000..eea7b1c2 --- /dev/null +++ b/tests-mx32/umoven-illptr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (umoven-illptr -a36 -e trace=nanosleep); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 -e trace=nanosleep diff --git a/tests-mx32/umoven-illptr.test b/tests-mx32/umoven-illptr.test deleted file mode 100755 index 7b8cb314..00000000 --- a/tests-mx32/umoven-illptr.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of invalid pointer by umoven. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a36 -e trace=nanosleep diff --git a/tests-mx32/umovestr-illptr.c b/tests-mx32/umovestr-illptr.c index dea6885d..5a24357a 100644 --- a/tests-mx32/umovestr-illptr.c +++ b/tests-mx32/umovestr-illptr.c @@ -1,30 +1,10 @@ /* * Check decoding of invalid pointer by umovestr. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/umovestr-illptr.gen.test b/tests-mx32/umovestr-illptr.gen.test new file mode 100755 index 00000000..7685d442 --- /dev/null +++ b/tests-mx32/umovestr-illptr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (umovestr-illptr -a11 -e trace=chdir); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=chdir diff --git a/tests-mx32/umovestr-illptr.test b/tests-mx32/umovestr-illptr.test deleted file mode 100755 index 6f1cc862..00000000 --- a/tests-mx32/umovestr-illptr.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of invalid pointer by umovestr. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a11 -e trace=chdir diff --git a/tests-mx32/umovestr.c b/tests-mx32/umovestr.c index 95fccb67..6cb5f78d 100644 --- a/tests-mx32/umovestr.c +++ b/tests-mx32/umovestr.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/umovestr.test b/tests-mx32/umovestr.test index 5ae8ffa9..3bfe1900 100755 --- a/tests-mx32/umovestr.test +++ b/tests-mx32/umovestr.test @@ -1,4 +1,9 @@ #!/bin/sh +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later # umovestr short read regression test diff --git a/tests-mx32/umovestr2.c b/tests-mx32/umovestr2.c index b2c63d80..a8bbf5ca 100644 --- a/tests-mx32/umovestr2.c +++ b/tests-mx32/umovestr2.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/umovestr2.test b/tests-mx32/umovestr2.test index 5c5d561f..278a9675 100755 --- a/tests-mx32/umovestr2.test +++ b/tests-mx32/umovestr2.test @@ -1,4 +1,9 @@ #!/bin/sh +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later # umovestr short read regression test @@ -9,7 +14,3 @@ run_strace -veexecve -s262144 $args > "$EXP" check_prog sed sed 1d < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" - -exit 0 diff --git a/tests-mx32/umovestr3.c b/tests-mx32/umovestr3.c index cf2fa7d4..524ee33f 100644 --- a/tests-mx32/umovestr3.c +++ b/tests-mx32/umovestr3.c @@ -1,34 +1,15 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" +#include #include #include -#include int main(void) diff --git a/tests-mx32/umovestr3.gen.test b/tests-mx32/umovestr3.gen.test new file mode 100755 index 00000000..b16e1edd --- /dev/null +++ b/tests-mx32/umovestr3.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (umovestr3 -a14 -e trace=chdir); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 -e trace=chdir diff --git a/tests-mx32/umovestr3.test b/tests-mx32/umovestr3.test deleted file mode 100755 index d5be2832..00000000 --- a/tests-mx32/umovestr3.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# yet another umovestr short read test - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a14 -e trace=chdir diff --git a/tests-mx32/uname.c b/tests-mx32/uname.c index cd6f51cd..386fd99b 100644 --- a/tests-mx32/uname.c +++ b/tests-mx32/uname.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -10,26 +17,25 @@ int main(int ac, char **av) { int abbrev = ac > 1; - struct utsname *const uname = tail_alloc(sizeof(struct utsname)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct utsname, uname); int rc = syscall(__NR_uname, uname); - printf("uname({sysname=\""); + printf("uname({sysname="); print_quoted_string(uname->sysname); - printf("\", nodename=\""); + printf(", nodename="); print_quoted_string(uname->nodename); if (abbrev) { - printf("\", ..."); + printf(", ..."); } else { - printf("\", release=\""); + printf(", release="); print_quoted_string(uname->release); - printf("\", version=\""); + printf(", version="); print_quoted_string(uname->version); - printf("\", machine=\""); + printf(", machine="); print_quoted_string(uname->machine); # ifdef HAVE_STRUCT_UTSNAME_DOMAINNAME - printf("\", domainname=\""); + printf(", domainname="); print_quoted_string(uname->domainname); # endif - printf("\""); } printf("}) = %d\n", rc); diff --git a/tests-mx32/uname.test b/tests-mx32/uname.test index 03fe30cd..2272c4f0 100755 --- a/tests-mx32/uname.test +++ b/tests-mx32/uname.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check uname syscall decoding. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -10,9 +15,8 @@ run_prog > /dev/null run_strace -v -euname $args > "$EXP" uniq < "$LOG" > "$OUT" -run_prog "./$NAME" abbrev > /dev/null +run_prog "../$NAME" abbrev > /dev/null run_strace -euname $args >> "$EXP" uniq < "$LOG" >> "$OUT" match_diff "$OUT" "$EXP" -rm -f "$OUT" "$EXP" diff --git a/tests-mx32/unblock_reset_raise.c b/tests-mx32/unblock_reset_raise.c new file mode 100644 index 00000000..68479b76 --- /dev/null +++ b/tests-mx32/unblock_reset_raise.c @@ -0,0 +1,34 @@ +/* + * Unblock, reset, and raise a signal. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +int +main(int ac, char **av) +{ + if (ac != 2) + error_msg_and_fail("usage: unblock_raise signo"); + + sigset_t mask; + sigemptyset(&mask); + const int signo = atoi(av[1]); + if (sigaddset(&mask, signo)) + perror_msg_and_fail("sigaddset: %s", av[1]); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + if (signal(signo, SIG_DFL) == SIG_ERR) + perror_msg_and_fail("signal: %s", av[1]); + if (raise(signo)) + perror_msg_and_fail("raise: %s", av[1]); + + return 0; +} diff --git a/tests-mx32/unix-pair-send-recv.c b/tests-mx32/unix-pair-send-recv.c index d4ac0d23..73ddd1e0 100644 --- a/tests-mx32/unix-pair-send-recv.c +++ b/tests-mx32/unix-pair-send-recv.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/unix-pair-send-recv.test b/tests-mx32/unix-pair-send-recv.test index 4defdebb..60def6ab 100755 --- a/tests-mx32/unix-pair-send-recv.test +++ b/tests-mx32/unix-pair-send-recv.test @@ -1,10 +1,15 @@ #!/bin/sh - +# # Check decoding and dumping of send and recv syscalls. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./unix-pair-send-recv abcdefghijklmnopqrstuvwxyz +run_prog ../unix-pair-send-recv abcdefghijklmnopqrstuvwxyz run_strace -a32 -esignal=none -esend,recv -eread=0 -ewrite=0 $args match_diff diff --git a/tests-mx32/unix-pair-sendto-recvfrom.c b/tests-mx32/unix-pair-sendto-recvfrom.c index cea382c9..98508e2d 100644 --- a/tests-mx32/unix-pair-sendto-recvfrom.c +++ b/tests-mx32/unix-pair-sendto-recvfrom.c @@ -2,29 +2,10 @@ * Check decoding and dumping of sendto and recvfrom syscalls. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -71,7 +52,7 @@ main(int ac, char **av) assert(recvfrom(0, av[1], len, MSG_WAITALL, NULL, NULL) == len); assert(close(0) == 0); - int status; + int status; assert(waitpid(pid, &status, 0) == pid); assert(status == 0); } else { diff --git a/tests-mx32/unix-pair-sendto-recvfrom.test b/tests-mx32/unix-pair-sendto-recvfrom.test index 21afe236..bd59ab7d 100755 --- a/tests-mx32/unix-pair-sendto-recvfrom.test +++ b/tests-mx32/unix-pair-sendto-recvfrom.test @@ -1,10 +1,15 @@ #!/bin/sh - +# # Check decoding and dumping of sendto and recvfrom syscalls. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./unix-pair-sendto-recvfrom abcdefghijklmnopqrstuvwxyz +run_prog ../unix-pair-sendto-recvfrom abcdefghijklmnopqrstuvwxyz run_strace -esignal=none -esendto,recvfrom -eread=0 -ewrite=0 $args match_diff diff --git a/tests-mx32/unlink.c b/tests-mx32/unlink.c index bbb1de15..9c33b624 100644 --- a/tests-mx32/unlink.c +++ b/tests-mx32/unlink.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/unlink.gen.test b/tests-mx32/unlink.gen.test new file mode 100755 index 00000000..63bc0c42 --- /dev/null +++ b/tests-mx32/unlink.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (unlink -a24 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests-mx32/unlink.test b/tests-mx32/unlink.test deleted file mode 100755 index 09bf79a7..00000000 --- a/tests-mx32/unlink.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check unlink syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 diff --git a/tests-mx32/unlinkat.c b/tests-mx32/unlinkat.c index 22c3de39..0ae67964 100644 --- a/tests-mx32/unlinkat.c +++ b/tests-mx32/unlinkat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/unlinkat.gen.test b/tests-mx32/unlinkat.gen.test new file mode 100755 index 00000000..5de79084 --- /dev/null +++ b/tests-mx32/unlinkat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (unlinkat -a35 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests-mx32/unlinkat.test b/tests-mx32/unlinkat.test deleted file mode 100755 index 864261f7..00000000 --- a/tests-mx32/unlinkat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check unlinkat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a35 diff --git a/tests-mx32/unshare.c b/tests-mx32/unshare.c index 5aedde47..a49f9ef9 100644 --- a/tests-mx32/unshare.c +++ b/tests-mx32/unshare.c @@ -2,29 +2,10 @@ * Check decoding of unshare syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/unshare.gen.test b/tests-mx32/unshare.gen.test new file mode 100755 index 00000000..782ce47a --- /dev/null +++ b/tests-mx32/unshare.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (unshare -a11 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 diff --git a/tests-mx32/unshare.test b/tests-mx32/unshare.test deleted file mode 100755 index ccb9575e..00000000 --- a/tests-mx32/unshare.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of setns syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a11 diff --git a/tests-mx32/userfaultfd.c b/tests-mx32/userfaultfd.c index 60432fa3..9e59c0fe 100644 --- a/tests-mx32/userfaultfd.c +++ b/tests-mx32/userfaultfd.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/userfaultfd.gen.test b/tests-mx32/userfaultfd.gen.test new file mode 100755 index 00000000..61b6988e --- /dev/null +++ b/tests-mx32/userfaultfd.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (userfaultfd -a38 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a38 diff --git a/tests-mx32/userfaultfd.test b/tests-mx32/userfaultfd.test deleted file mode 100755 index af8b6fbe..00000000 --- a/tests-mx32/userfaultfd.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check userfaultfd syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a38 diff --git a/tests-mx32/ustat.c b/tests-mx32/ustat.c index 57bb29c2..0945a70d 100644 --- a/tests-mx32/ustat.c +++ b/tests-mx32/ustat.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -47,7 +28,7 @@ main(void) long rc; # ifdef HAVE_USTAT_H - struct ustat *const ust = tail_alloc(sizeof(*ust)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct ustat, ust); struct stat st; if (stat(".", &st)) perror_msg_and_fail("stat"); @@ -55,10 +36,10 @@ main(void) dev = (unsigned int) st.st_dev; rc = syscall(__NR_ustat, dev, ust); if (rc) - printf("ustat(makedev(%u, %u), %p) = %s\n", + printf("ustat(makedev(%#x, %#x), %p) = %s\n", major(dev), minor(dev), ust, sprintrc(rc)); else - printf("ustat(makedev(%u, %u)" + printf("ustat(makedev(%#x, %#x)" ", {f_tfree=%llu, f_tinode=%llu}) = 0\n", major(dev), minor(dev), zero_extend_signed_to_ull(ust->f_tfree), @@ -67,11 +48,11 @@ main(void) dev = (unsigned int) magic; rc = syscall(__NR_ustat, magic, 0); - printf("ustat(makedev(%u, %u), NULL) = %s\n", + printf("ustat(makedev(%#x, %#x), NULL) = %s\n", major(dev), minor(dev), sprintrc(rc)); rc = syscall(__NR_ustat, magic, buf); - printf("ustat(makedev(%u, %u), %p) = %s\n", + printf("ustat(makedev(%#x, %#x), %p) = %s\n", major(dev), minor(dev), buf, sprintrc(rc)); puts("+++ exited with 0 +++"); diff --git a/tests-mx32/ustat.gen.test b/tests-mx32/ustat.gen.test new file mode 100755 index 00000000..2b09f7e9 --- /dev/null +++ b/tests-mx32/ustat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ustat -a33 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 diff --git a/tests-mx32/ustat.test b/tests-mx32/ustat.test deleted file mode 100755 index 60a88e0a..00000000 --- a/tests-mx32/ustat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check ustat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a33 diff --git a/tests-mx32/utime.c b/tests-mx32/utime.c index 8fd594f0..151b31a9 100644 --- a/tests-mx32/utime.c +++ b/tests-mx32/utime.c @@ -2,29 +2,10 @@ * Check decoding of utime syscall. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -38,17 +19,6 @@ # include # include - -static void -print_tm(const struct tm * const p) -{ - char buf[256]; - - strftime(buf, sizeof(buf), "%FT%T%z", p); - - printf("%s", buf); -} - static long k_utime(const void *const filename, const void *const times) { @@ -60,8 +30,7 @@ main(void) { static const char *const dummy_str = "dummy filename"; - const time_t t = time(NULL); - const struct tm * const p = localtime(&t); + const time_t t = 1492350678; const struct utimbuf u = { .actime = t, .modtime = t }; const struct utimbuf *const tail_u = tail_memdup(&u, sizeof(u)); const char *const dummy_filename = @@ -80,10 +49,10 @@ main(void) rc = k_utime("utime\nfilename", tail_u); const char *errstr = sprintrc(rc); - printf("utime(\"utime\\nfilename\", {actime="); - print_tm(p); - printf(", modtime="); - print_tm(p); + printf("utime(\"utime\\nfilename\", {actime=%lld", (long long) t); + print_time_t_nsec(t, 0, 1); + printf(", modtime=%lld", (long long) t); + print_time_t_nsec(t, 0, 1); printf("}) = %s\n", errstr); puts("+++ exited with 0 +++"); diff --git a/tests-mx32/utime.gen.test b/tests-mx32/utime.gen.test new file mode 100755 index 00000000..58ebc5ac --- /dev/null +++ b/tests-mx32/utime.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (utime -a16 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 diff --git a/tests-mx32/utime.test b/tests-mx32/utime.test deleted file mode 100755 index bd64c532..00000000 --- a/tests-mx32/utime.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of utime syscall. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a 16 -e trace=utime diff --git a/tests-mx32/utimensat-Xabbrev.c b/tests-mx32/utimensat-Xabbrev.c new file mode 100644 index 00000000..77a4ca03 --- /dev/null +++ b/tests-mx32/utimensat-Xabbrev.c @@ -0,0 +1 @@ +#include "utimensat.c" diff --git a/tests-mx32/utimensat-Xabbrev.gen.test b/tests-mx32/utimensat-Xabbrev.gen.test new file mode 100755 index 00000000..2bd1c40f --- /dev/null +++ b/tests-mx32/utimensat-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (utimensat-Xabbrev -a33 -Xabbrev -e trace=utimensat); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -Xabbrev -e trace=utimensat diff --git a/tests-mx32/utimensat-Xraw.c b/tests-mx32/utimensat-Xraw.c new file mode 100644 index 00000000..5cd1f01c --- /dev/null +++ b/tests-mx32/utimensat-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "utimensat.c" diff --git a/tests-mx32/utimensat-Xraw.gen.test b/tests-mx32/utimensat-Xraw.gen.test new file mode 100755 index 00000000..7cf0d58c --- /dev/null +++ b/tests-mx32/utimensat-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (utimensat-Xraw -a29 -Xraw -e trace=utimensat); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a29 -Xraw -e trace=utimensat diff --git a/tests-mx32/utimensat-Xverbose.c b/tests-mx32/utimensat-Xverbose.c new file mode 100644 index 00000000..cbcceae1 --- /dev/null +++ b/tests-mx32/utimensat-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "utimensat.c" diff --git a/tests-mx32/utimensat-Xverbose.gen.test b/tests-mx32/utimensat-Xverbose.gen.test new file mode 100755 index 00000000..c49f2668 --- /dev/null +++ b/tests-mx32/utimensat-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (utimensat-Xverbose -a44 -Xverbose -e trace=utimensat); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a44 -Xverbose -e trace=utimensat diff --git a/tests-mx32/utimensat.c b/tests-mx32/utimensat.c index 6d9faac2..170b2c89 100644 --- a/tests-mx32/utimensat.c +++ b/tests-mx32/utimensat.c @@ -1,93 +1,220 @@ /* - * This file is part of utimensat strace test. + * Check decoding of utimensat syscall. * - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" -#include -#include #include #include #include #include #include - -#if defined HAVE_UTIMENSAT \ - && defined AT_FDCWD && defined AT_SYMLINK_NOFOLLOW \ - && defined UTIME_NOW && defined UTIME_OMIT +#include +#include + +#if defined __NR_utimensat && defined UTIME_NOW && defined UTIME_OMIT + +# if SIZEOF_KERNEL_LONG_T == 4 +# define big_tv_sec "-559038737" +# define huge_tv_sec "-559038737" +# else +# define big_tv_sec "3735928559" +# define huge_tv_sec "-3819351491602432273" +# endif + +# if XLAT_RAW +# define str_at_fdcwd "-100" +# define str_at_symlink_nofollow "0x100" +# define str_at_removedir "0x200" +# define str_flags1 "0x600" +# define str_flags2 "0xffffffff" +# define str_utime_now_omit \ + "[{tv_sec=" big_tv_sec ", tv_nsec=1073741823}, " \ + "{tv_sec=" huge_tv_sec ", tv_nsec=1073741822}]" +# elif XLAT_VERBOSE +# define str_at_fdcwd "-100 /* AT_FDCWD */" +# define str_at_symlink_nofollow "0x100 /* AT_SYMLINK_NOFOLLOW */" +# define str_at_removedir "0x200 /* AT_REMOVEDIR */" +# define str_flags1 \ + "0x600 /* AT_REMOVEDIR|AT_SYMLINK_FOLLOW */" +# define str_flags2 \ + "0xffffffff /* AT_SYMLINK_NOFOLLOW|AT_REMOVEDIR|AT_SYMLINK_FOLLOW" \ + "|AT_NO_AUTOMOUNT|AT_EMPTY_PATH|0xffffe0ff */" +# define str_utime_now_omit \ + "[{tv_sec=" big_tv_sec ", tv_nsec=1073741823} /* UTIME_NOW */, " \ + "{tv_sec=" huge_tv_sec ", tv_nsec=1073741822} /* UTIME_OMIT */]" +# else +# define str_at_fdcwd "AT_FDCWD" +# define str_at_symlink_nofollow "AT_SYMLINK_NOFOLLOW" +# define str_at_removedir "AT_REMOVEDIR" +# define str_flags1 "AT_REMOVEDIR|AT_SYMLINK_FOLLOW" +# define str_flags2 \ + "AT_SYMLINK_NOFOLLOW|AT_REMOVEDIR|AT_SYMLINK_FOLLOW" \ + "|AT_NO_AUTOMOUNT|AT_EMPTY_PATH|0xffffe0ff" +# define str_utime_now_omit "[UTIME_NOW, UTIME_OMIT]" +# endif static void print_ts(const struct timespec *ts) { - printf("{tv_sec=%ju, tv_nsec=%ju}", (uintmax_t) ts->tv_sec, - (uintmax_t) ts->tv_nsec); + printf("{tv_sec=%lld, tv_nsec=%llu}", (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec)); + print_time_t_nsec(ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), 1); +} + +static const char *errstr; + +static long +k_utimensat(const kernel_ulong_t dirfd, + const kernel_ulong_t pathname, + const kernel_ulong_t times, + const kernel_ulong_t flags) +{ + long rc = syscall(__NR_utimensat, dirfd, pathname, times, flags); + errstr = sprintrc(rc); + return rc; } int main(void) { - static const char fname[] = "utimensat\nfilename"; + static const kernel_ulong_t bogus_fd = + (kernel_ulong_t) 0xbadc0deddeadbeef; + static const kernel_ulong_t kfdcwd = + (kernel_ulong_t) 0xdefaced00000000 | -100U; + static const char proto_fname[] = "utimensat\nfilename"; + static const char qname[] = "\"utimensat\\nfilename\""; + + char *const fname = tail_memdup(proto_fname, sizeof(proto_fname)); + const kernel_ulong_t kfname = (uintptr_t) fname; + struct timespec *const ts = tail_alloc(sizeof(*ts) * 2); + + (void) close(0); + + /* dirfd */ + k_utimensat(0, kfname, 0, 0); + printf("utimensat(0, %s, NULL, 0) = %s\n", qname, errstr); + + k_utimensat(bogus_fd, kfname, 0, 0); + printf("utimensat(%d, %s, NULL, 0) = %s\n", + (int) bogus_fd, qname, errstr); + + k_utimensat(-100U, kfname, 0, 0); + printf("utimensat(" str_at_fdcwd ", %s, NULL, 0) = %s\n", qname, errstr); + + k_utimensat(kfdcwd, kfname, 0, 0); + printf("utimensat(" str_at_fdcwd ", %s, NULL, 0) = %s\n", qname, errstr); + + /* pathname */ + k_utimensat(kfdcwd, 0, 0, 0); + printf("utimensat(" str_at_fdcwd ", NULL, NULL, 0) = %s\n", errstr); + + k_utimensat(kfdcwd, kfname + sizeof(proto_fname) - 1, 0, 0); + printf("utimensat(" str_at_fdcwd ", \"\", NULL, 0) = %s\n", errstr); + + fname[sizeof(proto_fname) - 1] = '+'; + k_utimensat(kfdcwd, kfname, 0, 0); + fname[sizeof(proto_fname) - 1] = '\0'; + printf("utimensat(" str_at_fdcwd ", %p, NULL, 0) = %s\n", fname, errstr); + + if (F8ILL_KULONG_SUPPORTED) { + k_utimensat(kfdcwd, f8ill_ptr_to_kulong(fname), 0, 0); + printf("utimensat(" str_at_fdcwd ", %#jx, NULL, 0) = %s\n", + (uintmax_t) f8ill_ptr_to_kulong(fname), errstr); + } + + /* times */ + k_utimensat(kfdcwd, kfname, (uintptr_t) (ts + 1), 0); + printf("utimensat(" str_at_fdcwd ", %s, %p, 0) = %s\n", + qname, ts + 1, errstr); + + k_utimensat(kfdcwd, kfname, (uintptr_t) (ts + 2), 0); + printf("utimensat(" str_at_fdcwd ", %s, %p, 0)" + " = %s\n", qname, ts + 2, errstr); + + ts[0].tv_sec = 1492358706; + ts[0].tv_nsec = 123456789; + ts[1].tv_sec = 1492357068; + ts[1].tv_nsec = 234567890; + + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, 0x100); + printf("utimensat(" str_at_fdcwd ", %s, [", qname); + print_ts(&ts[0]); + printf(", "); + print_ts(&ts[1]); + printf("], " str_at_symlink_nofollow ") = %s\n", errstr); - assert(utimensat(AT_FDCWD, fname, NULL, 0) == -1); - if (ENOENT != errno) - error_msg_and_skip("utimensat"); + ts[0].tv_sec = -1; + ts[0].tv_nsec = 2000000000; + ts[1].tv_sec = (time_t) -0x100000001LL; + ts[1].tv_nsec = 2345678900U; - #define PREFIX "utimensat(AT_FDCWD, \"utimensat\\nfilename\", " - printf(PREFIX "NULL, 0) = -1 ENOENT (%m)\n"); + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, 0x100); + printf("utimensat(" str_at_fdcwd ", %s, [", qname); + print_ts(&ts[0]); + printf(", "); + print_ts(&ts[1]); + printf("], " str_at_symlink_nofollow ") = %s\n", errstr); - struct timeval tv; - struct timespec ts[2]; + ts[0].tv_sec = 0; + ts[0].tv_nsec = 0; + ts[1].tv_sec = (time_t) 0xcafef00ddeadbeefLL; + ts[1].tv_nsec = 0; - if (gettimeofday(&tv, NULL)) - perror_msg_and_skip("gettimeofday"); + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, 0x100); + printf("utimensat(" str_at_fdcwd ", %s, [", qname); + print_ts(&ts[0]); + printf(", "); + print_ts(&ts[1]); + printf("], " str_at_symlink_nofollow ") = %s\n", errstr); - ts[0].tv_sec = tv.tv_sec; - ts[0].tv_nsec = tv.tv_usec; - ts[1].tv_sec = tv.tv_sec - 1; - ts[1].tv_nsec = tv.tv_usec + 1; + ts[0].tv_sec = 0xdeadbeefU; + ts[0].tv_nsec = 0xfacefeedU; + ts[1].tv_sec = (time_t) 0xcafef00ddeadbeefLL; + ts[1].tv_nsec = (long) 0xbadc0dedfacefeedLL; - printf(PREFIX "["); + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, 0x100); + printf("utimensat(" str_at_fdcwd ", %s, [", qname); print_ts(&ts[0]); printf(", "); print_ts(&ts[1]); - printf("], AT_SYMLINK_NOFOLLOW) = -1 ENOENT "); - - assert(utimensat(AT_FDCWD, fname, ts, AT_SYMLINK_NOFOLLOW) == -1); - if (ENOENT != errno) - error_msg_and_skip("utimensat"); - printf("(%m)\n"); + printf("], " str_at_symlink_nofollow ") = %s\n", errstr); ts[0].tv_nsec = UTIME_NOW; ts[1].tv_nsec = UTIME_OMIT; - assert(utimensat(AT_FDCWD, fname, ts, AT_SYMLINK_NOFOLLOW) == -1); - if (ENOENT != errno) - error_msg_and_skip("utimensat"); - printf(PREFIX "[UTIME_NOW, UTIME_OMIT], AT_SYMLINK_NOFOLLOW)" - " = -1 ENOENT (%m)\n"); + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, 0x100); + printf("utimensat(" str_at_fdcwd ", %s, " str_utime_now_omit + ", " str_at_symlink_nofollow ") = %s\n", qname, errstr); + + if (F8ILL_KULONG_SUPPORTED) { + k_utimensat(kfdcwd, kfname, f8ill_ptr_to_kulong(ts), 0); + printf("utimensat(" str_at_fdcwd ", %s, %#jx, 0) = %s\n", + qname, (uintmax_t) f8ill_ptr_to_kulong(ts), errstr); + } + + /* flags */ + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, + (kernel_ulong_t) 0xdefaced00000200); + printf("utimensat(" str_at_fdcwd ", %s, " str_utime_now_omit + ", " str_at_removedir ") = %s\n", + qname, errstr); + + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, + (kernel_ulong_t) 0xdefaced00000600); + printf("utimensat(" str_at_fdcwd ", %s, " str_utime_now_omit + ", " str_flags1 ") = %s\n", + qname, errstr); + + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, (kernel_ulong_t) -1ULL); + printf("utimensat(" str_at_fdcwd ", %s, " str_utime_now_omit + ", " str_flags2 ") = %s\n", + qname, errstr); puts("+++ exited with 0 +++"); return 0; @@ -95,7 +222,6 @@ main(void) #else -SKIP_MAIN_UNDEFINED("HAVE_UTIMENSAT && AT_FDCWD && AT_SYMLINK_NOFOLLOW" - " && UTIME_NOW && UTIME_OMIT") +SKIP_MAIN_UNDEFINED("__NR_utimensat && UTIME_NOW && UTIME_OMIT") #endif diff --git a/tests-mx32/utimensat.gen.test b/tests-mx32/utimensat.gen.test new file mode 100755 index 00000000..07dffa37 --- /dev/null +++ b/tests-mx32/utimensat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (utimensat -a33 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 diff --git a/tests-mx32/utimensat.test b/tests-mx32/utimensat.test deleted file mode 100755 index 52e3f316..00000000 --- a/tests-mx32/utimensat.test +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -# Check decoding of utimensat syscall. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -e utimensat $args > "$OUT" - -check_prog grep -LC_ALL=C grep -x "utimensat(.*" "$LOG" > /dev/null || { - rm -f "$OUT" - skip_ 'test executable does not use utimensat syscall' -} - -match_diff "$LOG" "$OUT" - -rm -f "$OUT" - -exit 0 diff --git a/tests-mx32/utimes.c b/tests-mx32/utimes.c index bbfa0310..1aee6db3 100644 --- a/tests-mx32/utimes.c +++ b/tests-mx32/utimes.c @@ -1,30 +1,10 @@ /* * Check decoding of utimes syscall. * - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,50 +12,10 @@ #ifdef __NR_utimes -# include -# include -# include -# include - -int -main(void) -{ - struct timeval tv; - if (gettimeofday(&tv, NULL)) - perror_msg_and_fail("gettimeofday"); - - static const char sample[] = "utimes_sample"; - - long rc = syscall(__NR_utimes, sample, 0); - printf("utimes(\"%s\", NULL) = %ld %s (%m)\n", - sample, rc, errno2name()); - - struct timeval *const ts = tail_alloc(sizeof(*ts) * 2); - - ts[0].tv_sec = tv.tv_sec; - ts[0].tv_usec = tv.tv_usec; - ts[1].tv_sec = tv.tv_sec - 1; - ts[1].tv_usec = tv.tv_usec + 1; - - rc = syscall(__NR_utimes, 0, ts + 2); - printf("utimes(NULL, %p) = %ld %s (%m)\n", ts + 2, rc, errno2name()); - - rc = syscall(__NR_utimes, 0, ts + 1); - printf("utimes(NULL, [{tv_sec=%jd, tv_usec=%jd}, %p]) = " - "%ld %s (%m)\n", - (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, - ts + 2, rc, errno2name()); - - rc = syscall(__NR_utimes, "", ts); - printf("utimes(\"\", [{tv_sec=%jd, tv_usec=%jd}, " - "{tv_sec=%jd, tv_usec=%jd}]) = %ld %s (%m)\n", - (intmax_t) ts[0].tv_sec, (intmax_t) ts[0].tv_usec, - (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, - rc, errno2name()); - - puts("+++ exited with 0 +++"); - return 0; -} +# define TEST_SYSCALL_NR __NR_utimes +# define TEST_SYSCALL_STR "utimes" +# define TEST_STRUCT struct timeval +# include "xutimes.c" #else diff --git a/tests-mx32/utimes.gen.test b/tests-mx32/utimes.gen.test new file mode 100755 index 00000000..559243e9 --- /dev/null +++ b/tests-mx32/utimes.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (utimes -a17 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests-mx32/utimes.test b/tests-mx32/utimes.test deleted file mode 100755 index 99143a0b..00000000 --- a/tests-mx32/utimes.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check utimes syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a21 diff --git a/tests-mx32/vfork-f.c b/tests-mx32/vfork-f.c index b14e4b49..ec31da96 100644 --- a/tests-mx32/vfork-f.c +++ b/tests-mx32/vfork-f.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/vfork-f.gen.test b/tests-mx32/vfork-f.gen.test new file mode 100755 index 00000000..b3c1c6b0 --- /dev/null +++ b/tests-mx32/vfork-f.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (vfork-f -a26 -qq -f -e signal=none -e trace=chdir); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a26 -qq -f -e signal=none -e trace=chdir diff --git a/tests-mx32/vfork-f.test b/tests-mx32/vfork-f.test deleted file mode 100755 index ff4422b2..00000000 --- a/tests-mx32/vfork-f.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check how strace -f follows vfork syscall. - -. "${srcdir=.}/fork-f.test" diff --git a/tests-mx32/vhangup.c b/tests-mx32/vhangup.c index e7ddabba..1a786cc3 100644 --- a/tests-mx32/vhangup.c +++ b/tests-mx32/vhangup.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests-mx32/vhangup.gen.test b/tests-mx32/vhangup.gen.test new file mode 100755 index 00000000..da192169 --- /dev/null +++ b/tests-mx32/vhangup.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (vhangup -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests-mx32/vhangup.test b/tests-mx32/vhangup.test deleted file mode 100755 index 8fe1cacb..00000000 --- a/tests-mx32/vhangup.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# Check vhangup syscall decoding. - -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a10 diff --git a/tests-mx32/vmsplice.c b/tests-mx32/vmsplice.c index f29962e3..b986dafa 100644 --- a/tests-mx32/vmsplice.c +++ b/tests-mx32/vmsplice.c @@ -2,29 +2,10 @@ * This file is part of vmsplice strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -86,7 +67,7 @@ main(void) " * %u bytes in buffer 2\n" " | 00000 %-49s %-16s |\n", w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), - w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(iov_), + w2_c, LENGTH_OF(w2_c), (unsigned int) ARRAY_SIZE(iov_), "SPLICE_F_NONBLOCK", len, LENGTH_OF(w0_c), w0_d, w0_c, LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); diff --git a/tests-mx32/vmsplice.gen.test b/tests-mx32/vmsplice.gen.test new file mode 100755 index 00000000..0dc18b63 --- /dev/null +++ b/tests-mx32/vmsplice.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (vmsplice -ewrite=1 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -ewrite=1 diff --git a/tests-mx32/vmsplice.test b/tests-mx32/vmsplice.test deleted file mode 100755 index 8a80650e..00000000 --- a/tests-mx32/vmsplice.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of vmsplice syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -ewrite=1 diff --git a/tests-mx32/wait4-v.gen.test b/tests-mx32/wait4-v.gen.test new file mode 100755 index 00000000..5b23f422 --- /dev/null +++ b/tests-mx32/wait4-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (wait4-v -v -e signal=none -e trace=wait4); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e signal=none -e trace=wait4 diff --git a/tests-mx32/wait4-v.test b/tests-mx32/wait4-v.test deleted file mode 100755 index 58e55f25..00000000 --- a/tests-mx32/wait4-v.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check verbose decoding of wait4 syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -e signal=none -e trace=wait4 diff --git a/tests-mx32/wait4.c b/tests-mx32/wait4.c index ccb3ebb9..29b0cadd 100644 --- a/tests-mx32/wait4.c +++ b/tests-mx32/wait4.c @@ -2,29 +2,10 @@ * Check decoding of wait4 syscall. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,8 +21,8 @@ sprint_rusage(const struct rusage *const ru) { static char buf[1024]; snprintf(buf, sizeof(buf), - "{ru_utime={tv_sec=%lu, tv_usec=%lu}" - ", ru_stime={tv_sec=%lu, tv_usec=%lu}" + "{ru_utime={tv_sec=%lld, tv_usec=%llu}" + ", ru_stime={tv_sec=%lld, tv_usec=%llu}" #if VERBOSE ", ru_maxrss=%lu" ", ru_ixrss=%lu" @@ -60,10 +41,10 @@ sprint_rusage(const struct rusage *const ru) #else ", ...}" #endif - , (long) ru->ru_utime.tv_sec - , (long) ru->ru_utime.tv_usec - , (long) ru->ru_stime.tv_sec - , (long) ru->ru_stime.tv_usec + , (long long) ru->ru_utime.tv_sec + , zero_extend_signed_to_ull(ru->ru_utime.tv_usec) + , (long long) ru->ru_stime.tv_sec + , zero_extend_signed_to_ull(ru->ru_stime.tv_usec) #if VERBOSE , (long) ru->ru_maxrss , (long) ru->ru_ixrss @@ -119,12 +100,12 @@ main(void) (void) close(0); - int *const s = tail_alloc(sizeof(*s)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, s); if (wait4(pid, s, WNOHANG|__WALL, NULL)) perror_msg_and_fail("wait4 #1"); tprintf("wait4(%d, %p, WNOHANG|__WALL, NULL) = 0\n", pid, s); - struct rusage *const rusage = tail_alloc(sizeof(*rusage)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct rusage, rusage); if (wait4(pid, s, WNOHANG|__WALL, rusage)) perror_msg_and_fail("wait4 #2"); tprintf("wait4(%d, %p, WNOHANG|__WALL, %p) = 0\n", pid, s, rusage); diff --git a/tests-mx32/wait4.gen.test b/tests-mx32/wait4.gen.test new file mode 100755 index 00000000..22a982fd --- /dev/null +++ b/tests-mx32/wait4.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (wait4 -esignal=none ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests-mx32/wait4.test b/tests-mx32/wait4.test deleted file mode 100755 index 6338d1f6..00000000 --- a/tests-mx32/wait4.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of wait4 syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -esignal=none diff --git a/tests-mx32/waitid-v.gen.test b/tests-mx32/waitid-v.gen.test new file mode 100755 index 00000000..45744cd5 --- /dev/null +++ b/tests-mx32/waitid-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (waitid-v -v -e signal=none -e trace=waitid); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e signal=none -e trace=waitid diff --git a/tests-mx32/waitid-v.test b/tests-mx32/waitid-v.test deleted file mode 100755 index eb498cb0..00000000 --- a/tests-mx32/waitid-v.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check verbose decoding of waitid syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -e signal=none -e trace=waitid diff --git a/tests-mx32/waitid.c b/tests-mx32/waitid.c index 6a102990..f4e4a0a8 100644 --- a/tests-mx32/waitid.c +++ b/tests-mx32/waitid.c @@ -2,29 +2,10 @@ * Check decoding of waitid syscall. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -42,8 +23,8 @@ sprint_rusage(const struct rusage *const ru) { static char buf[1024]; snprintf(buf, sizeof(buf), - "{ru_utime={tv_sec=%lld, tv_usec=%lld}" - ", ru_stime={tv_sec=%lld, tv_usec=%lld}" + "{ru_utime={tv_sec=%lld, tv_usec=%llu}" + ", ru_stime={tv_sec=%lld, tv_usec=%llu}" #if VERBOSE ", ru_maxrss=%llu" ", ru_ixrss=%llu" @@ -63,9 +44,9 @@ sprint_rusage(const struct rusage *const ru) ", ...}" #endif , (long long) ru->ru_utime.tv_sec - , (long long) ru->ru_utime.tv_usec + , zero_extend_signed_to_ull(ru->ru_utime.tv_usec) , (long long) ru->ru_stime.tv_sec - , (long long) ru->ru_stime.tv_usec + , zero_extend_signed_to_ull(ru->ru_stime.tv_usec) #if VERBOSE , zero_extend_signed_to_ull(ru->ru_maxrss) , zero_extend_signed_to_ull(ru->ru_ixrss) @@ -110,7 +91,8 @@ si_code_2_name(const int code) #ifdef CLD_CONTINUED CASE(CLD_CONTINUED); #endif - default: perror_msg_and_fail("unknown si_code %d", code); + default: + perror_msg_and_fail("unknown si_code %d", code); } } @@ -185,9 +167,9 @@ main(void) perror_msg_and_fail("waitid #1"); tprintf("waitid(P_PID, %d, NULL, WNOHANG|WEXITED, NULL) = 0\n", pid); - siginfo_t *const sinfo = tail_alloc(sizeof(*sinfo)); + TAIL_ALLOC_OBJECT_CONST_PTR(siginfo_t, sinfo); memset(sinfo, 0, sizeof(*sinfo)); - struct rusage *const rusage = tail_alloc(sizeof(*rusage)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct rusage, rusage); if (do_waitid(P_PID, pid, sinfo, WNOHANG|WEXITED|WSTOPPED, rusage)) perror_msg_and_fail("waitid #2"); tprintf("waitid(P_PID, %d, {}, WNOHANG|WEXITED|WSTOPPED, %s) = 0\n", diff --git a/tests-mx32/waitid.gen.test b/tests-mx32/waitid.gen.test new file mode 100755 index 00000000..22edd673 --- /dev/null +++ b/tests-mx32/waitid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (waitid -esignal=none ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests-mx32/waitid.test b/tests-mx32/waitid.test deleted file mode 100755 index 3bcba3ab..00000000 --- a/tests-mx32/waitid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of waitid syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -esignal=none diff --git a/tests-mx32/waitpid.c b/tests-mx32/waitpid.c index 2e22e245..7069bec8 100644 --- a/tests-mx32/waitpid.c +++ b/tests-mx32/waitpid.c @@ -1,30 +1,10 @@ /* * Check decoding of waitpid syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests-mx32/waitpid.gen.test b/tests-mx32/waitpid.gen.test new file mode 100755 index 00000000..a5678a1a --- /dev/null +++ b/tests-mx32/waitpid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (waitpid -a28 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests-mx32/waitpid.test b/tests-mx32/waitpid.test deleted file mode 100755 index 93807d1f..00000000 --- a/tests-mx32/waitpid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of waitpid syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 diff --git a/tests-mx32/xattr-strings.c b/tests-mx32/xattr-strings.c index 310929a9..a3fdabbd 100644 --- a/tests-mx32/xattr-strings.c +++ b/tests-mx32/xattr-strings.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #ifdef HAVE_SYS_XATTR_H diff --git a/tests-mx32/xattr-strings.gen.test b/tests-mx32/xattr-strings.gen.test new file mode 100755 index 00000000..33178926 --- /dev/null +++ b/tests-mx32/xattr-strings.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (xattr-strings -a22 -s 4 -e trace=fsetxattr); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -s 4 -e trace=fsetxattr diff --git a/tests-mx32/xattr-strings.test b/tests-mx32/xattr-strings.test deleted file mode 100755 index 25ef360b..00000000 --- a/tests-mx32/xattr-strings.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# Check *xattr syscalls decoding when limiting string size. - -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a22 -s 4 -e trace=fsetxattr diff --git a/tests-mx32/xattr.c b/tests-mx32/xattr.c index a772eced..56783694 100644 --- a/tests-mx32/xattr.c +++ b/tests-mx32/xattr.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,8 +17,6 @@ # define XATTR_SIZE_MAX 65536 # endif -#define DEFAULT_STRLEN 32 - int main(void) { @@ -114,9 +93,7 @@ main(void) else { const int ellipsis = rc > DEFAULT_STRLEN; - putchar('"'); print_quoted_memory(big, ellipsis ? DEFAULT_STRLEN : rc); - putchar('"'); if (ellipsis) fputs("...", stdout); } diff --git a/tests-mx32/xattr.gen.test b/tests-mx32/xattr.gen.test new file mode 100755 index 00000000..030f2ce0 --- /dev/null +++ b/tests-mx32/xattr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (xattr -a22 -e trace=getxattr,fgetxattr,lgetxattr,setxattr,fsetxattr,lsetxattr,listxattr,flistxattr,llistxattr,removexattr,fremovexattr,lremovexattr); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -e trace=getxattr,fgetxattr,lgetxattr,setxattr,fsetxattr,lsetxattr,listxattr,flistxattr,llistxattr,removexattr,fremovexattr,lremovexattr diff --git a/tests-mx32/xattr.test b/tests-mx32/xattr.test deleted file mode 100755 index 8c7a87b9..00000000 --- a/tests-mx32/xattr.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check *xattr syscalls decoding. - -. "${srcdir=.}/init.sh" - -syscalls= -for n in getxattr setxattr listxattr removexattr; do - syscalls="$syscalls,${n},f${n},l${n}" -done - -run_strace_match_diff -a22 -e trace=$syscalls diff --git a/tests-mx32/xchownx.c b/tests-mx32/xchownx.c index fe582835..8820e00d 100644 --- a/tests-mx32/xchownx.c +++ b/tests-mx32/xchownx.c @@ -2,29 +2,10 @@ * Check decoding of chown/chown32/lchown/lchown32/fchown/fchown32 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -45,10 +26,17 @@ # define CHECK_OVERFLOWGID(arg) #endif -#define UNLINK_SAMPLE \ - if (unlink(sample)) perror_msg_and_fail("unlink") -#define CLOSE_SAMPLE \ - if (close(fd)) perror_msg_and_fail("close") +#define UNLINK_SAMPLE \ + do { \ + if (unlink(sample)) \ + perror_msg_and_fail("unlink"); \ + } while (0) + +#define CLOSE_SAMPLE \ + do { \ + if (close(fd)) \ + perror_msg_and_fail("close"); \ + } while (0) #ifdef ACCESS_BY_DESCRIPTOR # define SYSCALL_ARG1 fd diff --git a/tests-mx32/xet_robust_list.c b/tests-mx32/xet_robust_list.c index 211dec45..cf4f2234 100644 --- a/tests-mx32/xet_robust_list.c +++ b/tests-mx32/xet_robust_list.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -51,8 +32,8 @@ main(void) { const pid_t pid = getpid(); const long long_pid = (unsigned long) (0xdeadbeef00000000LL | pid); - void **p_head = tail_alloc(sizeof(void *)); - size_t *p_len = tail_alloc(sizeof(size_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(void *, p_head); + TAIL_ALLOC_OBJECT_CONST_PTR(size_t, p_len); if (syscall(__NR_get_robust_list, long_pid, p_head, p_len)) perror_msg_and_skip("get_robust_list"); diff --git a/tests-mx32/xet_robust_list.gen.test b/tests-mx32/xet_robust_list.gen.test new file mode 100755 index 00000000..798cdff5 --- /dev/null +++ b/tests-mx32/xet_robust_list.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (xet_robust_list -a24 -e trace=get_robust_list,set_robust_list); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 -e trace=get_robust_list,set_robust_list diff --git a/tests-mx32/xet_robust_list.test b/tests-mx32/xet_robust_list.test deleted file mode 100755 index 8a3a3820..00000000 --- a/tests-mx32/xet_robust_list.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check get_robust_list and set_robust_list syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 -e trace=get_robust_list,set_robust_list diff --git a/tests-mx32/xet_thread_area_x86.c b/tests-mx32/xet_thread_area_x86.c new file mode 100644 index 00000000..a1efd319 --- /dev/null +++ b/tests-mx32/xet_thread_area_x86.c @@ -0,0 +1,206 @@ +/* + * Check decoding of set_thread_area and get_thread_area syscalls on x86 + * architecture. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include + +#if defined __NR_get_thread_area && defined __NR_set_thread_area \ + && defined HAVE_STRUCT_USER_DESC + +# include +# include +# include +# include +# include +# include + +# include "print_user_desc.c" + +long errnum; + +static void +printptr(kernel_ulong_t ptr, const char *ptr_str) +{ + if (ptr_str) + printf("%s", ptr_str); + else + printf("%#llx", zero_extend_signed_to_ull(ptr)); +} + +/** + * Perform set_thread_area call along with printing the expected output. + * + * @param ptr_val Pointer to thread area argument. + * @param ptr_str Explicit string representation of the argument. + * @param valid Whether argument points to the valid memory and its contents + * should be decoded. + * @param entry_number_str explicit decoding of the entry_number field. + */ +static long +set_thread_area(kernel_ulong_t ptr_val, const char *ptr_str, bool valid, + const char *entry_number_str) +{ + struct user_desc *ptr = (struct user_desc *) (uintptr_t) ptr_val; + long rc = -1; + int saved_errno; + + rc = syscall(__NR_set_thread_area, ptr_val); + saved_errno = errno; + printf("set_thread_area("); + + if (valid) + print_user_desc(ptr, entry_number_str); + else + printptr(ptr_val, ptr_str); + + errno = saved_errno; + printf(") = %s", sprintrc(rc)); + if (!rc) + printf(" (entry_number=%u)", ptr->entry_number); + + puts(""); + + return rc; +} + +/** + * Perform get_thread_are call along with printing the expected output and + * checking the result against the argument of the previous set_thread_area + * call, if it had place. + * + * @param ptr_val Pointer to thread area argument. + * @param ptr_str Explicit string representation of the argument. + * @param valid Whether argument points to the valid memory and its contents + * should be decoded. + * @param set_rc Return code of the previous set_thread_area call. + * @param expected The value of the argument passed to the previous + * set_thread_area call. + */ +static void +get_thread_area(kernel_ulong_t ptr_val, const char *ptr_str, bool valid, + long set_rc, kernel_ulong_t expected) +{ + struct user_desc *ptr = (struct user_desc *) (uintptr_t) ptr_val; + struct user_desc *expected_ptr = + (struct user_desc *) (uintptr_t) expected; + int saved_errno; + long rc; + + rc = syscall(__NR_get_thread_area, ptr_val); + saved_errno = errno; + + printf("get_thread_area("); + + if (valid && !rc) { + if (!set_rc) { + assert(ptr->entry_number == expected_ptr->entry_number); + assert(ptr->base_addr == expected_ptr->base_addr); + assert(ptr->limit == expected_ptr->limit); + assert(ptr->seg_32bit == expected_ptr->seg_32bit); + assert(ptr->contents == expected_ptr->contents); + assert(ptr->read_exec_only == + expected_ptr->read_exec_only); + assert(ptr->limit_in_pages == + expected_ptr->limit_in_pages); + assert(ptr->seg_not_present == + expected_ptr->seg_not_present); + assert(ptr->useable == expected_ptr->useable); + /* + * We do not check lm as 32-bit processes ignore it, and + * only 32-bit processes can successfully execute + * get_thread_area. + */ + } + + print_user_desc(ptr, + (int) ptr->entry_number == -1 ? "-1" : NULL); + } else { + printptr(ptr_val, ptr_str); + } + + errno = saved_errno; + printf(") = %s\n", sprintrc(rc)); +} + +int main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct user_desc, ta1); + TAIL_ALLOC_OBJECT_CONST_PTR(struct user_desc, ta2); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, bogus_entry_number); + + long set_rc = -1; + + /* + * Let's do some weird syscall, it will mark the beginning of our + * expected output. + */ + syscall(__NR_reboot, 0, 0, 0, 0); + + set_rc = set_thread_area((uintptr_t) ARG_STR(NULL), false, NULL); + get_thread_area((uintptr_t) ARG_STR(NULL), false, set_rc, + (uintptr_t) NULL); + + set_rc = set_thread_area(-1, NULL, false, NULL); + get_thread_area(-1, NULL, false, set_rc, -1); + + fill_memory(ta1, sizeof(*ta1)); + fill_memory_ex(ta2, sizeof(*ta2), 0xA5, 0x5A); + + set_thread_area((uintptr_t) (ta1 + 1), NULL, false, NULL); + + set_thread_area((uintptr_t) bogus_entry_number, NULL, false, NULL); + + set_thread_area((uintptr_t) ta1, NULL, true, NULL); + + ta1->entry_number = -1; + ta1->base_addr = 0; + ta1->limit = 0; + ta1->contents = 1; + ta1->seg_32bit = 1; + ta1->seg_not_present = 0; + + set_rc = set_thread_area((uintptr_t) ta1, NULL, true, "-1"); + + *bogus_entry_number = 2718281828U; + get_thread_area((uintptr_t) bogus_entry_number, + "{entry_number=2718281828, ...}", + false, set_rc, (uintptr_t) ta1); + + /* That one should return -EFAULT on i386 */ + *bogus_entry_number = 12; + get_thread_area((uintptr_t) bogus_entry_number, + "{entry_number=12, ...}", + false, set_rc, (uintptr_t) ta1); + + ta2->entry_number = 3141592653U; + get_thread_area((uintptr_t) ta2, "{entry_number=3141592653, ...}", + false, set_rc, (uintptr_t) ta1); + + ta2->entry_number = -1; + get_thread_area((uintptr_t) ta2, "{entry_number=-1, ...}", + false, set_rc, (uintptr_t) ta1); + + ta2->entry_number = ta1->entry_number; + assert(set_rc == 0 || (int) ta2->entry_number == -1); + get_thread_area((uintptr_t) ta2, "{entry_number=-1, ...}", + true, set_rc, (uintptr_t) ta1); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_get_thread_area && __NR_set_thread_area" + " && HAVE_STRUCT_USER_DESC"); + +#endif diff --git a/tests-mx32/xet_thread_area_x86.test b/tests-mx32/xet_thread_area_x86.test new file mode 100755 index 00000000..2f7fe27a --- /dev/null +++ b/tests-mx32/xet_thread_area_x86.test @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Check decoding of set_thread_area and get_thread_area syscalls on x86. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +check_prog sed +run_prog > /dev/null +run_strace -a22 -e trace=reboot,/[gs]et_thread_area $args > "$EXP" +sed '0,/^reboot/d' "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests-mx32/xetitimer.c b/tests-mx32/xetitimer.c index 4b17edd3..8d758974 100644 --- a/tests-mx32/xetitimer.c +++ b/tests-mx32/xetitimer.c @@ -1,76 +1,163 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin - * All rights reserved. + * Check decoding of setitimer and getitimer syscalls. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include #include #include +#include +#include int main(void) { - struct { - struct itimerval itv; - uint32_t pad[4]; - } old = { - .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } - }, new = { - .itv = { - .it_interval = { 0xc0de1, 0xc0de2 }, - .it_value = { 0xc0de3, 0xc0de4 } - }, - .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } + static const struct itimerval new = { + .it_interval = { 0xc0de1, 0xc0de2 }, + .it_value = { 0xc0de3, 0xc0de4 } }; + static const kernel_ulong_t long_timer = + F8ILL_KULONG_MASK | ITIMER_REAL; + static const kernel_ulong_t bogus_timer = + (kernel_ulong_t) 0xfacefeeddeadbeefULL; + + TAIL_ALLOC_OBJECT_CONST_PTR(struct itimerval, p_old); + struct itimerval *const p_new = tail_memdup(&new, sizeof(new)); + void *const efault = tail_alloc(sizeof(new) - 8); + long rc; - if (setitimer(ITIMER_REAL, &new.itv, &old.itv)) + if (setitimer(ITIMER_REAL, p_new, NULL)) perror_msg_and_skip("setitimer"); printf("setitimer(ITIMER_REAL" - ", {it_interval={tv_sec=%jd, tv_usec=%jd}, " - "it_value={tv_sec=%jd, tv_usec=%jd}}" - ", {it_interval={tv_sec=%jd, tv_usec=%jd}, " - "it_value={tv_sec=%jd, tv_usec=%jd}}) = 0\n", - (intmax_t) new.itv.it_interval.tv_sec, - (intmax_t) new.itv.it_interval.tv_usec, - (intmax_t) new.itv.it_value.tv_sec, - (intmax_t) new.itv.it_value.tv_usec, - (intmax_t) old.itv.it_interval.tv_sec, - (intmax_t) old.itv.it_interval.tv_usec, - (intmax_t) old.itv.it_value.tv_sec, - (intmax_t) old.itv.it_value.tv_usec); - - if (getitimer(ITIMER_REAL, &old.itv)) + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}" + ", NULL) = 0\n", + (long long) new.it_interval.tv_sec, + zero_extend_signed_to_ull(new.it_interval.tv_usec), + (long long) new.it_value.tv_sec, + zero_extend_signed_to_ull(new.it_value.tv_usec)); + + fill_memory(p_old, sizeof(*p_old)); + if (getitimer(ITIMER_REAL, p_old)) perror_msg_and_skip("getitimer"); printf("getitimer(ITIMER_REAL" - ", {it_interval={tv_sec=%jd, tv_usec=%jd}, " - "it_value={tv_sec=%jd, tv_usec=%jd}}) = 0\n", - (intmax_t) old.itv.it_interval.tv_sec, - (intmax_t) old.itv.it_interval.tv_usec, - (intmax_t) old.itv.it_value.tv_sec, - (intmax_t) old.itv.it_value.tv_usec); + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}) = 0\n", + (long long) p_old->it_interval.tv_sec, + zero_extend_signed_to_ull(p_old->it_interval.tv_usec), + (long long) p_old->it_value.tv_sec, + zero_extend_signed_to_ull(p_old->it_value.tv_usec)); + + fill_memory(p_old, sizeof(*p_old)); + setitimer(ITIMER_REAL, p_new, p_old); + printf("setitimer(ITIMER_REAL" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}) = 0\n", + (long long) new.it_interval.tv_sec, + zero_extend_signed_to_ull(new.it_interval.tv_usec), + (long long) new.it_value.tv_sec, + zero_extend_signed_to_ull(new.it_value.tv_usec), + (long long) p_old->it_interval.tv_sec, + zero_extend_signed_to_ull(p_old->it_interval.tv_usec), + (long long) p_old->it_value.tv_sec, + zero_extend_signed_to_ull(p_old->it_value.tv_usec)); + + rc = getitimer(ITIMER_REAL, efault); + printf("getitimer(ITIMER_REAL, %p) = %s\n", efault, sprintrc(rc)); + + rc = setitimer(ITIMER_REAL, p_new, efault); + printf("setitimer(ITIMER_REAL" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}, %p) = %s\n", + (long long) new.it_interval.tv_sec, + zero_extend_signed_to_ull(new.it_interval.tv_usec), + (long long) new.it_value.tv_sec, + zero_extend_signed_to_ull(new.it_value.tv_usec), + efault, sprintrc(rc)); + + rc = setitimer(ITIMER_REAL, efault, p_old); + printf("setitimer(ITIMER_REAL, %p, %p) = %s\n", + efault, p_old, sprintrc(rc)); + + fill_memory(p_old, sizeof(*p_old)); + rc = syscall(__NR_setitimer, long_timer, p_new, p_old); + printf("setitimer(ITIMER_REAL" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}) = %s\n", + (long long) new.it_interval.tv_sec, + zero_extend_signed_to_ull(new.it_interval.tv_usec), + (long long) new.it_value.tv_sec, + zero_extend_signed_to_ull(new.it_value.tv_usec), + (long long) p_old->it_interval.tv_sec, + zero_extend_signed_to_ull(p_old->it_interval.tv_usec), + (long long) p_old->it_value.tv_sec, + zero_extend_signed_to_ull(p_old->it_value.tv_usec), + sprintrc(rc)); + + fill_memory(p_old, sizeof(*p_old)); + rc = syscall(__NR_getitimer, long_timer, p_old); + printf("getitimer(ITIMER_REAL" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}) = %s\n", + (long long) p_old->it_interval.tv_sec, + zero_extend_signed_to_ull(p_old->it_interval.tv_usec), + (long long) p_old->it_value.tv_sec, + zero_extend_signed_to_ull(p_old->it_value.tv_usec), + sprintrc(rc)); + + rc = syscall(__NR_setitimer, bogus_timer, p_new, p_old); + printf("setitimer(%#x /* ITIMER_??? */" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}, %p) = %s\n", + (int) bogus_timer, + (long long) new.it_interval.tv_sec, + zero_extend_signed_to_ull(new.it_interval.tv_usec), + (long long) new.it_value.tv_sec, + zero_extend_signed_to_ull(new.it_value.tv_usec), + p_old, sprintrc(rc)); + + rc = syscall(__NR_getitimer, bogus_timer, p_old); + printf("getitimer(%#x /* ITIMER_??? */, %p) = %s\n", + (int) bogus_timer, p_old, sprintrc(rc)); + + if (F8ILL_KULONG_SUPPORTED) { + const kernel_ulong_t ill_new = f8ill_ptr_to_kulong(p_new); + const kernel_ulong_t ill_old = f8ill_ptr_to_kulong(p_old); + + rc = syscall(__NR_setitimer, long_timer, ill_new, ill_old); + printf("setitimer(ITIMER_REAL, %#llx, %#llx) = %s\n", + (unsigned long long) ill_new, + (unsigned long long) ill_old, + sprintrc(rc)); + + rc = syscall(__NR_getitimer, long_timer, ill_old); + printf("getitimer(ITIMER_REAL, %#llx) = %s\n", + (unsigned long long) ill_old, sprintrc(rc)); + } + + p_new->it_interval.tv_sec = 0xdeadbeefU; + p_new->it_interval.tv_usec = 0xfacefeedU; + p_new->it_value.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + p_new->it_value.tv_usec = (suseconds_t) 0xbadc0dedfacefeedLL; + + rc = setitimer(ITIMER_REAL, p_new, p_old); + printf("setitimer(ITIMER_REAL" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}, %p) = %s\n", + (long long) p_new->it_interval.tv_sec, + zero_extend_signed_to_ull(p_new->it_interval.tv_usec), + (long long) p_new->it_value.tv_sec, + zero_extend_signed_to_ull(p_new->it_value.tv_usec), + p_old, sprintrc(rc)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/xetitimer.gen.test b/tests-mx32/xetitimer.gen.test new file mode 100755 index 00000000..0cdb9267 --- /dev/null +++ b/tests-mx32/xetitimer.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (xetitimer -a29 -e trace=setitimer,getitimer); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a29 -e trace=setitimer,getitimer diff --git a/tests-mx32/xetitimer.test b/tests-mx32/xetitimer.test deleted file mode 100755 index 4aa00cce..00000000 --- a/tests-mx32/xetitimer.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setitimer and getitimer syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=setitimer,getitimer diff --git a/tests-mx32/xetpgid.c b/tests-mx32/xetpgid.c index 24e0d7f0..46dd332d 100644 --- a/tests-mx32/xetpgid.c +++ b/tests-mx32/xetpgid.c @@ -2,29 +2,10 @@ * This file is part of xetpgid strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -39,13 +20,10 @@ int main(void) { const int pid = getpid(); - long rc = syscall(__NR_getpgid, - (unsigned long) 0xffffffff00000000ULL | pid); + long rc = syscall(__NR_getpgid, F8ILL_KULONG_MASK | pid); printf("getpgid(%d) = %ld\n", pid, rc); - rc = syscall(__NR_setpgid, - (unsigned long) 0xffffffff00000000ULL, - (unsigned long) 0xffffffff00000000ULL | pid); + rc = syscall(__NR_setpgid, F8ILL_KULONG_MASK, F8ILL_KULONG_MASK | pid); printf("setpgid(0, %d) = %ld\n", pid, rc); puts("+++ exited with 0 +++"); diff --git a/tests-mx32/xetpgid.gen.test b/tests-mx32/xetpgid.gen.test new file mode 100755 index 00000000..fc57fc41 --- /dev/null +++ b/tests-mx32/xetpgid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (xetpgid -a11 -e trace=getpgid,setpgid); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=getpgid,setpgid diff --git a/tests-mx32/xetpgid.test b/tests-mx32/xetpgid.test deleted file mode 100755 index 07f4f9e8..00000000 --- a/tests-mx32/xetpgid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getpgid and setpgid syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a11 -e trace=getpgid,setpgid diff --git a/tests-mx32/xetpriority.c b/tests-mx32/xetpriority.c index ed552598..5cd97ea9 100644 --- a/tests-mx32/xetpriority.c +++ b/tests-mx32/xetpriority.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -12,12 +19,11 @@ main(void) { const int pid = getpid(); long rc = syscall(__NR_getpriority, PRIO_PROCESS, - (unsigned long) 0xffffffff00000000ULL | pid); + F8ILL_KULONG_MASK | pid); printf("getpriority(PRIO_PROCESS, %d) = %ld\n", pid, rc); rc = syscall(__NR_setpriority, PRIO_PROCESS, - (unsigned long) 0xffffffff00000000ULL | pid, - (unsigned long) 0xffffffff00000000ULL); + F8ILL_KULONG_MASK | pid, F8ILL_KULONG_MASK); printf("setpriority(PRIO_PROCESS, %d, 0) = %s\n", pid, sprintrc(rc)); puts("+++ exited with 0 +++"); diff --git a/tests-mx32/xetpriority.gen.test b/tests-mx32/xetpriority.gen.test new file mode 100755 index 00000000..4b955247 --- /dev/null +++ b/tests-mx32/xetpriority.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (xetpriority -a29 -e trace=getpriority,setpriority); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a29 -e trace=getpriority,setpriority diff --git a/tests-mx32/xetpriority.test b/tests-mx32/xetpriority.test deleted file mode 100755 index 2c84ba41..00000000 --- a/tests-mx32/xetpriority.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getpriority and setpriority syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a29 -e trace=getpriority,setpriority diff --git a/tests-mx32/xettimeofday.c b/tests-mx32/xettimeofday.c index d36c57b4..9c811262 100644 --- a/tests-mx32/xettimeofday.c +++ b/tests-mx32/xettimeofday.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,36 +17,49 @@ int main(void) { - struct { - struct timeval tv; - uint32_t pad0[2]; - struct timezone tz; - uint32_t pad1[2]; - } t = { - .pad0 = { 0xdeadbeef, 0xbadc0ded }, - .pad1 = { 0xdeadbeef, 0xbadc0ded } - }; + TAIL_ALLOC_OBJECT_CONST_PTR(struct timeval, tv); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timezone, tz); - if (syscall(__NR_gettimeofday, &t.tv, NULL)) + if (syscall(__NR_gettimeofday, tv, NULL)) perror_msg_and_skip("gettimeofday"); - printf("gettimeofday({tv_sec=%jd, tv_usec=%jd}, NULL) = 0\n", - (intmax_t) t.tv.tv_sec, (intmax_t) t.tv.tv_usec); + printf("gettimeofday({tv_sec=%lld, tv_usec=%llu}, NULL) = 0\n", + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); - if (syscall(__NR_gettimeofday, &t.tv, &t.tz)) + if (syscall(__NR_gettimeofday, tv, tz)) perror_msg_and_skip("gettimeofday"); - printf("gettimeofday({tv_sec=%jd, tv_usec=%jd}" + printf("gettimeofday({tv_sec=%lld, tv_usec=%llu}" ", {tz_minuteswest=%d, tz_dsttime=%d}) = 0\n", - (intmax_t) t.tv.tv_sec, (intmax_t) t.tv.tv_usec, - t.tz.tz_minuteswest, t.tz.tz_dsttime); + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec), + tz->tz_minuteswest, tz->tz_dsttime); + + tv->tv_sec = -1; + tv->tv_usec = 1000000; + assert(syscall(__NR_settimeofday, tv, tz) == -1); + printf("settimeofday({tv_sec=%lld, tv_usec=%llu}" + ", {tz_minuteswest=%d, tz_dsttime=%d}) = %s\n", + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec), + tz->tz_minuteswest, tz->tz_dsttime, sprintrc(-1)); + + tv->tv_sec = 0xdeadbeefU; + tv->tv_usec = 0xfacefeedU; + assert(syscall(__NR_settimeofday, tv, tz) == -1); + printf("settimeofday({tv_sec=%lld, tv_usec=%llu}" + ", {tz_minuteswest=%d, tz_dsttime=%d}) = %s\n", + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec), + tz->tz_minuteswest, tz->tz_dsttime, sprintrc(-1)); - t.tv.tv_sec = -1; - t.tv.tv_usec = 1000000000; - assert(syscall(__NR_settimeofday, &t.tv, &t.tz) == -1); - printf("settimeofday({tv_sec=%jd, tv_usec=%jd}" - ", {tz_minuteswest=%d, tz_dsttime=%d})" - " = -1 EINVAL (%m)\n", - (intmax_t) t.tv.tv_sec, (intmax_t) t.tv.tv_usec, - t.tz.tz_minuteswest, t.tz.tz_dsttime); + tv->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + tv->tv_usec = (suseconds_t) 0xbadc0dedfacefeedLL; + assert(syscall(__NR_settimeofday, tv, tz) == -1); + printf("settimeofday({tv_sec=%lld, tv_usec=%llu}" + ", {tz_minuteswest=%d, tz_dsttime=%d}) = %s\n", + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec), + tz->tz_minuteswest, tz->tz_dsttime, sprintrc(-1)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/xettimeofday.gen.test b/tests-mx32/xettimeofday.gen.test new file mode 100755 index 00000000..1a021e49 --- /dev/null +++ b/tests-mx32/xettimeofday.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (xettimeofday -a20 -e trace=gettimeofday,settimeofday); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -e trace=gettimeofday,settimeofday diff --git a/tests-mx32/xettimeofday.test b/tests-mx32/xettimeofday.test deleted file mode 100755 index 68764e46..00000000 --- a/tests-mx32/xettimeofday.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check gettimeofday and settimeofday syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 -e trace=gettimeofday,settimeofday diff --git a/tests-mx32/xgetrlimit.c b/tests-mx32/xgetrlimit.c index 78d9cb99..a1c89e9b 100644 --- a/tests-mx32/xgetrlimit.c +++ b/tests-mx32/xgetrlimit.c @@ -1,30 +1,11 @@ /* * Check decoding of getrlimit/ugetrlimit syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -39,23 +20,55 @@ const char * sprint_rlim(kernel_ulong_t lim) { + static char buf[2][ /* space for 2 llu strings */ + 2*sizeof(lim)*3 + + /* space for XLAT_STYLE_ABBREV decoding */ + sizeof("*1024") + sizeof("RLIM64_INFINITY") + + /* space for C style comments */ + 6]; + static unsigned int i; + + i &= 1; + +#if XLAT_RAW + sprintf(buf[i], "%llu", (unsigned long long) lim); + return buf[i++]; +#else if (sizeof(lim) == sizeof(uint64_t)) { - if (lim == (kernel_ulong_t) -1ULL) + if (lim == (kernel_ulong_t) -1ULL) { +# if XLAT_VERBOSE + sprintf(buf[i], "%llu /* RLIM64_INFINITY */", + (unsigned long long) lim); + return buf[i++]; +# else /* XLAT_ABBREV */ return "RLIM64_INFINITY"; +# endif + } } else { - if (lim == (kernel_ulong_t) -1U) + if (lim == (kernel_ulong_t) -1U) { +# if XLAT_VERBOSE + sprintf(buf[i], "%llu /* RLIM_INFINITY */", + (unsigned long long) lim); + return buf[i++]; +# else /* XLAT_ABBREV */ return "RLIM_INFINITY"; +# endif + } } - static char buf[2][sizeof(lim)*3 + sizeof("*1024")]; - static int i; - i &= 1; if (lim > 1024 && lim % 1024 == 0) +# if XLAT_VERBOSE + sprintf(buf[i], "%llu /* %llu*1024 */", + (unsigned long long) lim, + (unsigned long long) lim / 1024); +# else /* XLAT_ABBREV */ sprintf(buf[i], "%llu*1024", (unsigned long long) lim / 1024); +# endif else sprintf(buf[i], "%llu", (unsigned long long) lim); return buf[i++]; +#endif /* !XLAT_RAW */ } #ifdef NR_GETRLIMIT @@ -71,13 +84,13 @@ main(void) long rc = syscall(NR_GETRLIMIT, res, 0); if (rc && ENOSYS == errno) perror_msg_and_skip(STR_GETRLIMIT); - printf("%s(%s, NULL) = %ld %s (%m)\n", - STR_GETRLIMIT, xlat->str, rc, errno2name()); + printf("%s(%s, NULL) = %s\n", + STR_GETRLIMIT, xlat->str, sprintrc(rc)); rc = syscall(NR_GETRLIMIT, res, rlimit); if (rc) - printf("%s(%s, NULL) = %ld %s (%m)\n", - STR_GETRLIMIT, xlat->str, rc, errno2name()); + printf("%s(%s, %p) = %s\n", + STR_GETRLIMIT, xlat->str, rlimit, sprintrc(rc)); else printf("%s(%s, {rlim_cur=%s, rlim_max=%s})" " = 0\n", STR_GETRLIMIT, xlat->str, diff --git a/tests-mx32/xselect.c b/tests-mx32/xselect.c index 39e87ac7..f6048f25 100644 --- a/tests-mx32/xselect.c +++ b/tests-mx32/xselect.c @@ -1,104 +1,453 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin - * All rights reserved. + * Check decoding of select/_newselect syscalls. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Copyright (c) 2015-2018 Dmitry V. Levin + * Copyright (c) 2015-2017 The strace developers. + * All rights reserved. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ /* * Based on test by Dr. David Alan Gilbert */ -#include +#include +#include +#include #include +#include #include #include -static fd_set set[0x1000000 / sizeof(fd_set)]; +static const char *errstr; -int main(void) +static long +xselect(const kernel_ulong_t nfds, + const kernel_ulong_t rs, + const kernel_ulong_t ws, + const kernel_ulong_t es, + const kernel_ulong_t tv) +#ifndef xselect { - int fds[2]; - struct { - struct timeval tv; - int pad[2]; - } tm_in = { - .tv = { .tv_sec = 0xc0de1, .tv_usec = 0xc0de2 }, - .pad = { 0xdeadbeef, 0xbadc0ded } - }, tm = tm_in; + long rc = syscall(TEST_SYSCALL_NR, + F8ILL_KULONG_MASK | nfds, rs, ws, es, tv); + errstr = sprintrc(rc); + return rc; +} +#else + ; +#endif + +#define XSELECT(expected_, ...) \ + do { \ + long rc = xselect(__VA_ARGS__); \ + if (rc != (expected_)) \ + perror_msg_and_fail(TEST_SYSCALL_STR \ + ": expected %d" \ + ", returned %ld", \ + (expected_), rc); \ + } while (0) \ +/* End of XSELECT definition. */ + +int +main(void) +{ +#ifdef PATH_TRACING_FD + skip_if_unavailable("/proc/self/fd/"); +#endif + for (int i = 3; i < FD_SETSIZE; ++i) { +#ifdef PATH_TRACING_FD + if (i == PATH_TRACING_FD) + continue; +#endif + (void) close(i); + } + + int fds[2]; if (pipe(fds)) perror_msg_and_fail("pipe"); + static const int smallset_size = sizeof(kernel_ulong_t) * 8; + const int nfds = fds[1] + 1; + if (nfds > smallset_size) + error_msg_and_fail("nfds[%d] > smallset_size[%d]\n", + nfds, smallset_size); + + struct timeval tv_in = { 0, 123 }; + struct timeval *const tv = tail_memdup(&tv_in, sizeof(tv_in)); + const uintptr_t a_tv = (uintptr_t) tv; + + TAIL_ALLOC_OBJECT_VAR_PTR(kernel_ulong_t, l_rs); + fd_set *const rs = (void *) l_rs; + const uintptr_t a_rs = (uintptr_t) rs; + + TAIL_ALLOC_OBJECT_VAR_PTR(kernel_ulong_t, l_ws); + fd_set *const ws = (void *) l_ws; + const uintptr_t a_ws = (uintptr_t) ws; + + TAIL_ALLOC_OBJECT_VAR_PTR(kernel_ulong_t, l_es); + fd_set *const es = (void *) l_es; + const uintptr_t a_es = (uintptr_t) es; + + long rc; + /* - * Start with a nice simple select. + * An equivalent of nanosleep. */ - FD_ZERO(set); - FD_SET(fds[0], set); - FD_SET(fds[1], set); - int rc = syscall(TEST_SYSCALL_NR, fds[1] + 1, set, set, set, NULL); - if (rc < 0) - perror_msg_and_skip(TEST_SYSCALL_STR); - assert(rc == 1); - printf("%s(%d, [%d %d], [%d %d], [%d %d], NULL) = 1 ()\n", - TEST_SYSCALL_STR, fds[1] + 1, fds[0], fds[1], - fds[0], fds[1], fds[0], fds[1]); + if (xselect(0, 0, 0, 0, a_tv)) { + if (errno == ENOSYS) + perror_msg_and_skip(TEST_SYSCALL_STR); + else + perror_msg_and_fail(TEST_SYSCALL_STR); + } +#ifndef PATH_TRACING_FD + printf("%s(0, NULL, NULL, NULL, {tv_sec=%lld, tv_usec=%llu})" + " = 0 (Timeout)\n", + TEST_SYSCALL_STR, (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec)); +#endif + + /* EFAULT on tv argument */ + XSELECT(-1, 0, 0, 0, 0, a_tv + 1); +#ifndef PATH_TRACING_FD + printf("%s(0, NULL, NULL, NULL, %#lx) = %s\n", + TEST_SYSCALL_STR, (unsigned long) a_tv + 1, errstr); +#endif + + /* + * Start with a nice simple select with the same set. + */ + for (int i = nfds; i <= smallset_size; ++i) { + *l_rs = (1UL << fds[0]) | (1UL << fds[1]); + XSELECT(1, i, a_rs, a_rs, a_rs, 0); +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [%d %d], [%d %d], NULL) = 1 ()\n", + TEST_SYSCALL_STR, i, fds[0], fds[1], + fds[0], fds[1], fds[0], fds[1]); +#else + *l_rs = (1UL << fds[0]) | (1UL << fds[1]) | + (1UL << PATH_TRACING_FD); + XSELECT(i > PATH_TRACING_FD ? 3 : 1, i, a_rs, a_rs, a_rs, 0); + if (i > PATH_TRACING_FD) { + printf("%s(%d, [%d %d %d], [%d %d %d], [%d %d %d]" + ", NULL) = 3 ()\n", + TEST_SYSCALL_STR, i, + fds[0], fds[1], PATH_TRACING_FD, + fds[0], fds[1], PATH_TRACING_FD, + fds[0], fds[1], PATH_TRACING_FD); + } +#endif + } + + /* + * Odd timeout. + */ + *l_rs = (1UL << fds[0]) | (1UL << fds[1]); + tv_in.tv_sec = 0xdeadbeefU; + tv_in.tv_usec = 0xfacefeedU; + memcpy(tv, &tv_in, sizeof(tv_in)); + rc = xselect(nfds, a_rs, a_rs, a_rs, a_tv); + if (rc < 0) { +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [%d %d], [%d %d]" + ", {tv_sec=%lld, tv_usec=%llu}) = %s\n", + TEST_SYSCALL_STR, nfds, fds[0], fds[1], + fds[0], fds[1], fds[0], fds[1], + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + errstr); +#endif /* !PATH_TRACING_FD */ + } else { +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [%d %d], [%d %d]" + ", {tv_sec=%lld, tv_usec=%llu}) = %ld" + " (left {tv_sec=%lld, tv_usec=%llu})\n", + TEST_SYSCALL_STR, nfds, fds[0], fds[1], + fds[0], fds[1], fds[0], fds[1], + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + rc, (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); +#endif /* !PATH_TRACING_FD */ + } + + /* + * Very odd timeout. + */ + *l_rs = (1UL << fds[0]) | (1UL << fds[1]); + tv_in.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + tv_in.tv_usec = (suseconds_t) 0xbadc0dedfacefeedLL; + memcpy(tv, &tv_in, sizeof(tv_in)); + rc = xselect(nfds, a_rs, a_rs, a_rs, a_tv); + if (rc < 0) { +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [%d %d], [%d %d]" + ", {tv_sec=%lld, tv_usec=%llu}) = %s\n", + TEST_SYSCALL_STR, nfds, fds[0], fds[1], + fds[0], fds[1], fds[0], fds[1], + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + errstr); +#endif /* PATH_TRACING_FD */ + } else { +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [%d %d], [%d %d]" + ", {tv_sec=%lld, tv_usec=%llu}) = %ld" + " (left {tv_sec=%lld, tv_usec=%llu})\n", + TEST_SYSCALL_STR, nfds, fds[0], fds[1], + fds[0], fds[1], fds[0], fds[1], + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + rc, (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); +#endif /* PATH_TRACING_FD */ + } /* * Another simple one, with a timeout. */ - FD_SET(1, set); - FD_SET(2, set); - FD_SET(fds[0], set); - FD_SET(fds[1], set); - assert(syscall(TEST_SYSCALL_NR, fds[1] + 1, NULL, set, NULL, &tm.tv) == 3); - printf("%s(%d, NULL, [1 2 %d %d], NULL, {tv_sec=%lld, tv_usec=%lld})" - " = 3 (out [1 2 %d], left {tv_sec=%lld, tv_usec=%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], - (long long) tm.tv.tv_sec, (long long) tm.tv.tv_usec); + for (int i = nfds; i <= smallset_size; ++i) { + *l_rs = (1UL << fds[0]) | (1UL << fds[1]); + *l_ws = (1UL << 1) | (1UL << 2) | + (1UL << fds[0]) | (1UL << fds[1]); + *l_es = 0; + tv_in.tv_sec = 0xc0de1; + tv_in.tv_usec = 0xc0de2; + memcpy(tv, &tv_in, sizeof(tv_in)); + XSELECT(3, i, a_rs, a_ws, a_es, a_tv); +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [%d %d %d %d], []" + ", {tv_sec=%lld, tv_usec=%llu}) = 3 (out [1 2 %d]" + ", left {tv_sec=%lld, tv_usec=%llu})\n", + TEST_SYSCALL_STR, i, fds[0], fds[1], + 1, 2, fds[0], fds[1], + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + fds[1], + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); +#else + *l_rs = (1UL << fds[0]) | (1UL << fds[1]) | + (1UL << PATH_TRACING_FD); + *l_ws = (1UL << 1) | (1UL << 2) | + (1UL << fds[0]) | (1UL << fds[1]); + tv_in.tv_sec = 0xc0de1; + tv_in.tv_usec = 0xc0de2; + memcpy(tv, &tv_in, sizeof(tv_in)); + XSELECT(3 + (i > PATH_TRACING_FD), i, a_rs, a_ws, a_es, a_tv); + if (i > PATH_TRACING_FD) { + printf("%s(%d, [%d %d %d], [%d %d %d %d], []" + ", {tv_sec=%lld, tv_usec=%llu})" + " = 4 (in [%d], out [1 2 %d]" + ", left {tv_sec=%lld, tv_usec=%llu})\n", + TEST_SYSCALL_STR, i, + fds[0], fds[1], PATH_TRACING_FD, + 1, 2, fds[0], fds[1], + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + PATH_TRACING_FD, fds[1], + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); + } + + *l_rs = (1UL << fds[0]) | (1UL << fds[1]); + *l_ws = (1UL << 1) | (1UL << 2) | + (1UL << fds[0]) | (1UL << fds[1]) | + (1UL << PATH_TRACING_FD); + tv_in.tv_sec = 0xc0de1; + tv_in.tv_usec = 0xc0de2; + memcpy(tv, &tv_in, sizeof(tv_in)); + XSELECT(3 + (i > PATH_TRACING_FD), i, a_rs, a_ws, a_es, a_tv); + if (i > PATH_TRACING_FD) { + printf("%s(%d, [%d %d], [%d %d %d %d %d], []" + ", {tv_sec=%lld, tv_usec=%llu})" + " = 4 (out [1 2 %d %d]" + ", left {tv_sec=%lld, tv_usec=%llu})\n", + TEST_SYSCALL_STR, i, + fds[0], fds[1], + 1, 2, fds[0], fds[1], PATH_TRACING_FD, + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + fds[1], PATH_TRACING_FD, + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); + } + + *l_rs = (1UL << fds[0]) | (1UL << fds[1]); + *l_ws = (1UL << 1) | (1UL << 2) | + (1UL << fds[0]) | (1UL << fds[1]); + *l_es = (1UL << PATH_TRACING_FD); + tv_in.tv_sec = 0xc0de1; + tv_in.tv_usec = 0xc0de2; + memcpy(tv, &tv_in, sizeof(tv_in)); + XSELECT(3, i, a_rs, a_ws, a_es, a_tv); + if (i > PATH_TRACING_FD) { + printf("%s(%d, [%d %d], [%d %d %d %d], [%d]" + ", {tv_sec=%lld, tv_usec=%llu}) = 3 (out [1 2 %d]" + ", left {tv_sec=%lld, tv_usec=%llu})\n", + TEST_SYSCALL_STR, i, + fds[0], fds[1], + 1, 2, fds[0], fds[1], PATH_TRACING_FD, + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + fds[1], + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); + } + +#endif /* PATH_TRACING_FD */ + } /* * Now the crash case that trinity found, negative nfds * but with a pointer to a large chunk of valid memory. */ - FD_ZERO(set); - FD_SET(fds[1],set); - assert(syscall(TEST_SYSCALL_NR, -1, NULL, set, NULL, NULL) == -1); - printf("%s(-1, NULL, %p, NULL, NULL) = -1 EINVAL (%m)\n", - TEST_SYSCALL_STR, set); + static fd_set set[0x1000000 / sizeof(fd_set)]; + FD_SET(fds[1], set); + XSELECT(-1, -1U, 0, (uintptr_t) set, 0, 0); +#ifndef PATH_TRACING_FD + printf("%s(-1, NULL, %p, NULL, NULL) = %s\n", + TEST_SYSCALL_STR, set, errstr); +#endif + + /* + * Big sets, nfds exceeds FD_SETSIZE limit. + */ + const size_t big_size = sizeof(fd_set) + sizeof(long); + fd_set *const big_rs = tail_alloc(big_size); + const uintptr_t a_big_rs = (uintptr_t) big_rs; + + fd_set *const big_ws = tail_alloc(big_size); + const uintptr_t a_big_ws = (uintptr_t) big_ws; + + for (unsigned int i = FD_SETSIZE; i <= big_size * 8; ++i) { + memset(big_rs, 0, big_size); + memset(big_ws, 0, big_size); + FD_SET(fds[0], big_rs); + tv->tv_sec = 0; + tv->tv_usec = 10 + (i - FD_SETSIZE); + XSELECT(0, i, a_big_rs, a_big_ws, 0, a_tv); +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d], [], NULL, {tv_sec=0, tv_usec=%d})" + " = 0 (Timeout)\n", + TEST_SYSCALL_STR, i, fds[0], 10 + (i - FD_SETSIZE)); +#else + FD_SET(fds[0], big_rs); + FD_SET(PATH_TRACING_FD, big_rs); + tv->tv_sec = 0; + tv->tv_usec = 10 + (i - FD_SETSIZE); + XSELECT(1, i, a_big_rs, a_big_ws, 0, a_tv); + printf("%s(%d, [%d %d], [], NULL, {tv_sec=0, tv_usec=%d})" + " = 1 (in [%d], left {tv_sec=0, tv_usec=%llu})\n", + TEST_SYSCALL_STR, i, fds[0], PATH_TRACING_FD, + 10 + (i - FD_SETSIZE), PATH_TRACING_FD, + zero_extend_signed_to_ull(tv->tv_usec)); +#endif /* PATH_TRACING_FD */ + } + + /* + * Huge sets, nfds equals to INT_MAX. + */ + FD_SET(fds[0], set); + FD_SET(fds[1], set); + tv->tv_sec = 0; + tv->tv_usec = 123; + XSELECT(0, INT_MAX, (uintptr_t) set, (uintptr_t) &set[1], + (uintptr_t) &set[2], a_tv); +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [], [], {tv_sec=0, tv_usec=123})" + " = 0 (Timeout)\n", + TEST_SYSCALL_STR, INT_MAX, fds[0], fds[1]); +#else + FD_SET(fds[0], set); + FD_SET(fds[1], set); + FD_SET(PATH_TRACING_FD, set); + tv->tv_sec = 0; + tv->tv_usec = 123; + XSELECT(1, INT_MAX, (uintptr_t) set, (uintptr_t) &set[1], + (uintptr_t) &set[2], a_tv); + printf("%s(%d, [%d %d %d], [], [], {tv_sec=0, tv_usec=123})" + " = 1 (in [%d], left {tv_sec=0, tv_usec=%llu})\n", + TEST_SYSCALL_STR, INT_MAX, fds[0], fds[1], PATH_TRACING_FD, + PATH_TRACING_FD, zero_extend_signed_to_ull(tv->tv_usec)); +#endif /* PATH_TRACING_FD */ + + /* + * Small sets, nfds exceeds FD_SETSIZE limit. + * The kernel seems to be fine with it but strace cannot follow. + */ + *l_rs = (1UL << fds[0]) | (1UL << fds[1]) +#ifdef PATH_TRACING_FD + | (1UL << PATH_TRACING_FD) +#endif + ; + *l_ws = (1UL << fds[0]); + *l_es = (1UL << fds[0]) | (1UL << fds[1]) +#ifdef PATH_TRACING_FD + | (1UL << PATH_TRACING_FD) +#endif + ; + tv->tv_sec = 0; + tv->tv_usec = 123; + rc = xselect(FD_SETSIZE + 1, a_rs, a_ws, a_es, a_tv); + if (rc < 0) { +#ifndef PATH_TRACING_FD + printf("%s(%d, %p, %p, %p, {tv_sec=0, tv_usec=123}) = %s\n", + TEST_SYSCALL_STR, FD_SETSIZE + 1, rs, ws, es, errstr); +#endif + } else { +#ifndef PATH_TRACING_FD + printf("%s(%d, %p, %p, %p, {tv_sec=0, tv_usec=123})" + " = 0 (Timeout)\n", + TEST_SYSCALL_STR, FD_SETSIZE + 1, rs, ws, es); +#endif + } + + /* + * Small sets, one of allocated descriptors exceeds smallset_size. + */ + if (dup2(fds[1], smallset_size) != smallset_size) + perror_msg_and_fail("dup2"); +#ifdef PATH_TRACING_FD + FD_SET(PATH_TRACING_FD, rs); + FD_SET(PATH_TRACING_FD, ws); + FD_SET(PATH_TRACING_FD, es); +#endif + XSELECT(-1, smallset_size + 1, a_rs, a_ws, a_es, 0); +#ifndef PATH_TRACING_FD + printf("%s(%d, %p, %p, %p, NULL) = %s\n", + TEST_SYSCALL_STR, smallset_size + 1, rs, ws, es, errstr); +#endif /* - * Another variant, with nfds exceeding FD_SETSIZE limit. + * Small and big sets, + * one of allocated descriptors exceeds smallset_size. */ - FD_ZERO(set); - FD_SET(fds[0],set); - tm.tv.tv_sec = 0; - tm.tv.tv_usec = 123; - assert(syscall(TEST_SYSCALL_NR, FD_SETSIZE + 1, set, set + 1, NULL, &tm.tv) == 0); - printf("%s(%d, [%d], [], NULL, {tv_sec=0, tv_usec=123}) = 0 (Timeout)\n", - TEST_SYSCALL_STR, FD_SETSIZE + 1, fds[0]); + memset(big_rs, 0, big_size); + FD_SET(fds[0], big_rs); + FD_SET(smallset_size, big_rs); + memset(big_ws, 0, big_size); + FD_SET(fds[1], big_ws); + FD_SET(smallset_size, big_ws); + XSELECT(-1, smallset_size + 1, a_big_rs, a_big_ws, a_es, 0); +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [%d %d], %p, NULL) = %s\n", + TEST_SYSCALL_STR, smallset_size + 1, + fds[0], smallset_size, + fds[1], smallset_size, + es, errstr); +#endif /* !PATH_TRACING_FD */ + XSELECT(-1, smallset_size + 1, a_es, a_big_ws, a_big_rs, 0); +#ifndef PATH_TRACING_FD + printf("%s(%d, %p, [%d %d], [%d %d], NULL) = %s\n", + TEST_SYSCALL_STR, smallset_size + 1, + es, + fds[1], smallset_size, + fds[0], smallset_size, + errstr); +#endif /* !PATH_TRACING_FD */ puts("+++ exited with 0 +++"); return 0; diff --git a/tests-mx32/xstatfs.c b/tests-mx32/xstatfs.c index 26c43dee..a7f7dd2d 100644 --- a/tests-mx32/xstatfs.c +++ b/tests-mx32/xstatfs.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #define SYSCALL_INVOKE(file, desc, ptr, size) \ diff --git a/tests-mx32/xstatfs64.c b/tests-mx32/xstatfs64.c index 8f50de29..5a3dcb47 100644 --- a/tests-mx32/xstatfs64.c +++ b/tests-mx32/xstatfs64.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #define SYSCALL_INVOKE(file, desc, ptr, size) \ diff --git a/tests-mx32/xstatfsx.c b/tests-mx32/xstatfsx.c index d8288f1f..1b91e844 100644 --- a/tests-mx32/xstatfsx.c +++ b/tests-mx32/xstatfsx.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -37,12 +18,17 @@ #include "xlat/statfs_flags.h" #define PRINT_NUM(arg) \ - if (sizeof(b->arg) == sizeof(int)) \ - printf(", %s=%u", #arg, (unsigned int) b->arg); \ - else if (sizeof(b->arg) == sizeof(long)) \ - printf(", %s=%lu", #arg, (unsigned long) b->arg); \ - else \ - printf(", %s=%llu", #arg, (unsigned long long) b->arg) + do { \ + if (sizeof(b->arg) == sizeof(int)) \ + printf(", %s=%u", #arg, \ + (unsigned int) b->arg); \ + else if (sizeof(b->arg) == sizeof(long)) \ + printf(", %s=%lu", #arg, \ + (unsigned long) b->arg); \ + else \ + printf(", %s=%llu", #arg, \ + (unsigned long long) b->arg); \ + } while (0) static void print_statfs_type(const char *const prefix, const unsigned int magic) @@ -62,9 +48,9 @@ print_statfs(const char *const sample, const char *magic_str) { int fd = open(sample, O_RDONLY); if (fd < 0) - perror_msg_and_fail("open: %s", sample); + perror_msg_and_skip("open: %s", sample); - STRUCT_STATFS *const b = tail_alloc(sizeof(*b)); + TAIL_ALLOC_OBJECT_CONST_PTR(STRUCT_STATFS, b); long rc = SYSCALL_INVOKE(sample, fd, b, sizeof(*b)); if (rc) perror_msg_and_skip(SYSCALL_NAME); diff --git a/tests-mx32/xstatx.c b/tests-mx32/xstatx.c index 0d5fca87..0d223bdc 100644 --- a/tests-mx32/xstatx.c +++ b/tests-mx32/xstatx.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #if defined HAVE_FTRUNCATE && defined HAVE_FUTIMENS @@ -47,26 +28,8 @@ # include # include -static void -print_time(const time_t t) -{ - if (!t) { - printf("0"); - return; - } - - struct tm *p = localtime(&t); - - if (p) { - char buf[256]; - - strftime(buf, sizeof(buf), "%FT%T%z", p); - - printf("%s", buf); - } else { - printf("%llu", zero_extend_signed_to_ull(t)); - } -} +# include "print_fields.h" +# include "statx.h" # ifndef STRUCT_STAT # define STRUCT_STAT struct stat @@ -81,10 +44,14 @@ typedef off_t libc_off_t; # define stat libc_stat # define stat64 libc_stat64 +# define statx libc_statx +# define statx_timestamp libc_statx_timestamp # include # include -# undef stat +# undef statx_timestamp +# undef statx # undef stat64 +# undef stat # undef st_atime # undef st_mtime @@ -130,6 +97,11 @@ typedef off_t libc_off_t; # define OLD_STAT 0 # endif +# ifndef IS_STATX +# define IS_STATX 0 +# endif + +# if !XLAT_RAW /* Fixes -Wunused warning */ static void print_ftype(const unsigned int mode) { @@ -150,59 +122,168 @@ print_perms(const unsigned int mode) { printf("%#o", mode & ~S_IFMT); } +# endif + +static void +print_st_mode(const unsigned int mode) +{ +# if XLAT_RAW + printf("%#o", mode); +# elif XLAT_VERBOSE + printf("%#o /* ", mode); + print_ftype(mode); + printf("|"); + print_perms(mode); + printf(" */"); +# else + print_ftype(mode); + printf("|"); + print_perms(mode); +# endif +} + +# if !IS_STATX + +static const char * +sprint_makedev(const unsigned long long val) +{ + static char devid[256]; + int ret; + +# if XLAT_RAW + ret = snprintf(devid, sizeof(devid), + "%#llx", val); +# elif XLAT_VERBOSE + ret = snprintf(devid, sizeof(devid), + "%#llx /* makedev(%#x, %#x) */", + val, major(val), minor(val)); +# else /* XLAT_ABBREV */ + ret = snprintf(devid, sizeof(devid), + "makedev(%#x, %#x)", + major(val), minor(val)); +# endif + if (ret < 0) + perror_msg_and_fail("sprint_makedev(%llx)", val); + if ((unsigned) ret >= sizeof(devid)) + error_msg_and_fail("sprint_makedev(%llx): buffer " + "overflow", val); + return devid; +} + static void print_stat(const STRUCT_STAT *st) { - printf("{st_dev=makedev(%u, %u)", - (unsigned int) major(zero_extend_signed_to_ull(st->st_dev)), - (unsigned int) minor(zero_extend_signed_to_ull(st->st_dev))); + unsigned long long dev, rdev; + + dev = zero_extend_signed_to_ull(st->st_dev); + rdev = zero_extend_signed_to_ull(st->st_rdev); + printf("{st_dev=%s", sprint_makedev(dev)); printf(", st_ino=%llu", zero_extend_signed_to_ull(st->st_ino)); printf(", st_mode="); - print_ftype(st->st_mode); - printf("|"); - print_perms(st->st_mode); + print_st_mode(st->st_mode); printf(", st_nlink=%llu", zero_extend_signed_to_ull(st->st_nlink)); printf(", st_uid=%llu", zero_extend_signed_to_ull(st->st_uid)); printf(", st_gid=%llu", zero_extend_signed_to_ull(st->st_gid)); -# if OLD_STAT +# if OLD_STAT printf(", st_blksize=0, st_blocks=0"); -# else /* !OLD_STAT */ +# else /* !OLD_STAT */ printf(", st_blksize=%llu", zero_extend_signed_to_ull(st->st_blksize)); printf(", st_blocks=%llu", zero_extend_signed_to_ull(st->st_blocks)); -# endif /* OLD_STAT */ +# endif /* OLD_STAT */ switch (st->st_mode & S_IFMT) { case S_IFCHR: case S_IFBLK: - printf(", st_rdev=makedev(%u, %u)", - (unsigned int) major(zero_extend_signed_to_ull(st->st_rdev)), - (unsigned int) minor(zero_extend_signed_to_ull(st->st_rdev))); + printf(", st_rdev=%s", sprint_makedev(rdev)); break; default: printf(", st_size=%llu", zero_extend_signed_to_ull(st->st_size)); } - printf(", st_atime="); - print_time(sign_extend_unsigned_to_ll(st->st_atime)); -# if defined(HAVE_STRUCT_STAT_ST_MTIME_NSEC) && !OLD_STAT - if (st->st_atime_nsec) - printf(".%09llu", zero_extend_signed_to_ull(st->st_atime_nsec)); -# endif - printf(", st_mtime="); - print_time(sign_extend_unsigned_to_ll(st->st_mtime)); -# if defined(HAVE_STRUCT_STAT_ST_MTIME_NSEC) && !OLD_STAT - if (st->st_mtime_nsec) - printf(".%09llu", zero_extend_signed_to_ull(st->st_mtime_nsec)); -# endif - printf(", st_ctime="); - print_time(sign_extend_unsigned_to_ll(st->st_ctime)); -# if defined(HAVE_STRUCT_STAT_ST_MTIME_NSEC) && !OLD_STAT - if (st->st_ctime_nsec) - printf(".%09llu", zero_extend_signed_to_ull(st->st_ctime_nsec)); -# endif +# if defined(HAVE_STRUCT_STAT_ST_MTIME_NSEC) && !OLD_STAT +# define TIME_NSEC(val) zero_extend_signed_to_ull(val) +# define HAVE_NSEC 1 +# else +# define TIME_NSEC(val) 0ULL +# define HAVE_NSEC 0 +# endif + +# define PRINT_ST_TIME(field) \ + do { \ + printf(", st_" #field "=%lld", \ + sign_extend_unsigned_to_ll(st->st_ ## field)); \ + print_time_t_nsec(sign_extend_unsigned_to_ll(st->st_ ## field), \ + TIME_NSEC(st->st_ ## field ## _nsec), 1); \ + if (HAVE_NSEC) \ + printf(", st_" #field "_nsec=%llu", \ + TIME_NSEC(st->st_ ## field ## _nsec)); \ + } while (0) + + PRINT_ST_TIME(atime); + PRINT_ST_TIME(mtime); + PRINT_ST_TIME(ctime); printf("}"); } +# else /* !IS_STATX */ + +static void +print_stat(const STRUCT_STAT *st) +{ +# define PRINT_FIELD_U32_UID(field) \ + do { \ + if (st->field == (uint32_t) -1) \ + printf(", %s=-1", #field); \ + else \ + printf(", %s=%llu", #field, \ + (unsigned long long) st->field); \ + } while (0) + +# define PRINT_FIELD_TIME(field) \ + do { \ + printf(", %s={tv_sec=%lld, tv_nsec=%u}", \ + #field, (long long) st->field.tv_sec, \ + (unsigned) st->field.tv_nsec); \ + print_time_t_nsec(st->field.tv_sec, \ + zero_extend_signed_to_ull(st->field.tv_nsec), \ + 1); \ + } while (0) + + printf("{stx_mask="); + printflags(statx_masks, st->stx_mask, "STATX_???"); + + PRINT_FIELD_U(", ", *st, stx_blksize); + + printf(", stx_attributes="); + printflags(statx_attrs, st->stx_attributes, "STATX_ATTR_???"); + + PRINT_FIELD_U(", ", *st, stx_nlink); + PRINT_FIELD_U32_UID(stx_uid); + PRINT_FIELD_U32_UID(stx_gid); + + printf(", stx_mode="); + print_st_mode(st->stx_mode); + + PRINT_FIELD_U(", ", *st, stx_ino); + PRINT_FIELD_U(", ", *st, stx_size); + PRINT_FIELD_U(", ", *st, stx_blocks); + + printf(", stx_attributes_mask="); + printflags(statx_attrs, st->stx_attributes_mask, "STATX_ATTR_???"); + + PRINT_FIELD_TIME(stx_atime); + PRINT_FIELD_TIME(stx_btime); + PRINT_FIELD_TIME(stx_ctime); + PRINT_FIELD_TIME(stx_mtime); + PRINT_FIELD_U(", ", *st, stx_rdev_major); + PRINT_FIELD_U(", ", *st, stx_rdev_minor); + PRINT_FIELD_U(", ", *st, stx_dev_major); + PRINT_FIELD_U(", ", *st, stx_dev_minor); + printf("}"); +} + +# endif /* !IS_STATX */ + static int create_sample(const char *fname, const libc_off_t size) { @@ -229,19 +310,19 @@ create_sample(const char *fname, const libc_off_t size) int main(void) { -# if !IS_FSTAT +# if IS_FSTAT + skip_if_unavailable("/proc/self/fd/"); +# else static const char full[] = "/dev/full"; # endif - static const char sample[] = TEST_SYSCALL_STR ".sample"; - STRUCT_STAT st[2]; + static const char sample[] = "stat.sample"; + TAIL_ALLOC_OBJECT_CONST_PTR(STRUCT_STAT, st); int rc; rc = create_sample(sample, SAMPLE_SIZE); - if (rc) { - (void) unlink(sample); + if (rc) return rc; - } # if TEST_BOGUS_STRUCT_STAT STRUCT_STAT *st_cut = tail_alloc(sizeof(long) * 4); @@ -262,46 +343,71 @@ main(void) # endif if ((rc = TEST_SYSCALL_INVOKE(sample, st))) { -# if OLD_STAT - if (errno != EOVERFLOW) -# endif - { + if (errno != EOVERFLOW) { + rc = (errno == ENOSYS) ? 77 : 1; perror(TEST_SYSCALL_STR); - (void) unlink(sample); - return 77; + return rc; } } - (void) unlink(sample); + +# if IS_STATX +# define ST_SIZE_FIELD stx_size +# else +# define ST_SIZE_FIELD st_size +# endif if (!rc && zero_extend_signed_to_ull(SAMPLE_SIZE) != - zero_extend_signed_to_ull(st[0].st_size)) { + zero_extend_signed_to_ull(st->ST_SIZE_FIELD)) { fprintf(stderr, "Size mismatch: " "requested size(%llu) != st_size(%llu)\n", zero_extend_signed_to_ull(SAMPLE_SIZE), - zero_extend_signed_to_ull(st[0].st_size)); + zero_extend_signed_to_ull(st->ST_SIZE_FIELD)); fprintf(stderr, "The most likely reason for this is incorrect" " definition of %s.\n" "Here is some diagnostics that might help:\n", STRUCT_STAT_STR); -#define LOG_STAT_OFFSETOF_SIZEOF(object, member) \ +# define LOG_STAT_OFFSETOF_SIZEOF(object, member) \ fprintf(stderr, "offsetof(%s, %s) = %zu" \ ", sizeof(%s) = %zu\n", \ STRUCT_STAT_STR, #member, \ offsetof(STRUCT_STAT, member), \ #member, sizeof((object).member)) - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_dev); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_ino); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_mode); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_nlink); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_uid); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_gid); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_rdev); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_size); -# if !OLD_STAT - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_blksize); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_blocks); -# endif /* !OLD_STAT */ +# if IS_STATX + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_mask); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_blksize); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_attributes); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_nlink); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_uid); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_gid); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_mode); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_ino); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_size); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_blocks); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_attributes_mask); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_atime); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_btime); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_ctime); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_mtime); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_rdev_major); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_rdev_minor); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_dev_major); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_dev_minor); +# else + LOG_STAT_OFFSETOF_SIZEOF(*st, st_dev); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_ino); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_mode); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_nlink); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_uid); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_gid); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_rdev); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_size); +# if !OLD_STAT + LOG_STAT_OFFSETOF_SIZEOF(*st, st_blksize); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_blocks); +# endif /* !OLD_STAT */ + +# endif /* IS_STATX */ return 1; } @@ -313,6 +419,69 @@ main(void) print_stat(st); PRINT_SYSCALL_FOOTER(rc); +# if IS_STATX + +# define INVOKE() \ + do { \ + rc = TEST_SYSCALL_INVOKE(sample, st); \ + PRINT_SYSCALL_HEADER(sample); \ + if (rc) \ + printf("%p", st); \ + else \ + print_stat(st); \ + PRINT_SYSCALL_FOOTER(rc); \ + } while (0) + +# define SET_FLAGS_INVOKE(flags, flags_str) \ + do { \ + TEST_SYSCALL_STATX_FLAGS = flags; \ + TEST_SYSCALL_STATX_FLAGS_STR = flags_str; \ + INVOKE(); \ + } while (0) + +# define SET_MASK_INVOKE(mask, mask_str) \ + do { \ + TEST_SYSCALL_STATX_MASK = mask; \ + TEST_SYSCALL_STATX_MASK_STR = mask_str; \ + INVOKE(); \ + } while (0) + + unsigned old_flags = TEST_SYSCALL_STATX_FLAGS; + const char *old_flags_str = TEST_SYSCALL_STATX_FLAGS_STR; + unsigned old_mask = TEST_SYSCALL_STATX_MASK; + const char *old_mask_str = TEST_SYSCALL_STATX_MASK_STR; + + SET_FLAGS_INVOKE(AT_SYMLINK_FOLLOW | 0xffff0000U, + "AT_STATX_SYNC_AS_STAT|AT_SYMLINK_FOLLOW|0xffff0000"); + + SET_FLAGS_INVOKE(AT_STATX_SYNC_TYPE, + "AT_STATX_FORCE_SYNC|AT_STATX_DONT_SYNC"); + + SET_FLAGS_INVOKE(0xffffff, + "AT_STATX_FORCE_SYNC|AT_STATX_DONT_SYNC|AT_SYMLINK_NOFOLLOW|" + "AT_REMOVEDIR|AT_SYMLINK_FOLLOW|AT_NO_AUTOMOUNT|AT_EMPTY_PATH|" + "0xff80ff"); + + /* We're done playing with flags. */ + TEST_SYSCALL_STATX_FLAGS = old_flags; + TEST_SYSCALL_STATX_FLAGS_STR = old_flags_str; + + SET_MASK_INVOKE(0, "0"); + SET_MASK_INVOKE(0xfffff000U, "0xfffff000 /* STATX_??? */"); + + SET_MASK_INVOKE(0xfffffffbU, + "STATX_TYPE|STATX_MODE|STATX_UID|STATX_GID|STATX_ATIME|" + "STATX_MTIME|STATX_CTIME|STATX_INO|STATX_SIZE|STATX_BLOCKS|" + "STATX_BTIME|0xfffff000"); + + SET_MASK_INVOKE(STATX_UID, "STATX_UID"); + + /* ...and with mask. */ + TEST_SYSCALL_STATX_MASK = old_mask; + TEST_SYSCALL_STATX_MASK_STR = old_mask_str; + +# endif /* IS_STATX */ + puts("+++ exited with 0 +++"); return 0; } diff --git a/tests-mx32/xutimes.c b/tests-mx32/xutimes.c new file mode 100644 index 00000000..7ad123cc --- /dev/null +++ b/tests-mx32/xutimes.c @@ -0,0 +1,129 @@ +/* + * Check decoding of utimes/osf_utimes syscall. + * + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef TEST_SYSCALL_NR +# error TEST_SYSCALL_NR must be defined +#endif + +#ifndef TEST_SYSCALL_STR +# error TEST_SYSCALL_STR must be defined +#endif + +#ifndef TEST_STRUCT +# error TEST_STRUCT must be defined +#endif + +#include +#include +#include +#include + +static void +print_tv(const TEST_STRUCT *const tv) +{ + printf("{tv_sec=%lld, tv_usec=%llu}", + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); + print_time_t_usec(tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec), 1); +} + +static const char *errstr; + +static long +k_utimes(const kernel_ulong_t pathname, const kernel_ulong_t times) +{ + long rc = syscall(TEST_SYSCALL_NR, pathname, times); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const char proto_fname[] = TEST_SYSCALL_STR "_sample"; + static const char qname[] = "\"" TEST_SYSCALL_STR "_sample\""; + + char *const fname = tail_memdup(proto_fname, sizeof(proto_fname)); + const kernel_ulong_t kfname = (uintptr_t) fname; + TEST_STRUCT *const tv = tail_alloc(sizeof(*tv) * 2); + + /* pathname */ + k_utimes(0, 0); + printf("%s(NULL, NULL) = %s\n", TEST_SYSCALL_STR, errstr); + + k_utimes(kfname + sizeof(proto_fname) - 1, 0); + printf("%s(\"\", NULL) = %s\n", TEST_SYSCALL_STR, errstr); + + k_utimes(kfname, 0); + printf("%s(%s, NULL) = %s\n", TEST_SYSCALL_STR, qname, errstr); + + fname[sizeof(proto_fname) - 1] = '+'; + k_utimes(kfname, 0); + fname[sizeof(proto_fname) - 1] = '\0'; + printf("%s(%p, NULL) = %s\n", TEST_SYSCALL_STR, fname, errstr); + + if (F8ILL_KULONG_SUPPORTED) { + k_utimes(f8ill_ptr_to_kulong(fname), 0); + printf("%s(%#jx, NULL) = %s\n", TEST_SYSCALL_STR, + (uintmax_t) f8ill_ptr_to_kulong(fname), errstr); + } + + /* times */ + k_utimes(kfname, (uintptr_t) (tv + 1)); + printf("%s(%s, %p) = %s\n", TEST_SYSCALL_STR, + qname, tv + 1, errstr); + + k_utimes(kfname, (uintptr_t) (tv + 2)); + printf("%s(%s, %p) = %s\n", TEST_SYSCALL_STR, + qname, tv + 2, errstr); + + tv[0].tv_sec = 0xdeadbeefU; + tv[0].tv_usec = 0xfacefeedU; + tv[1].tv_sec = (time_t) 0xcafef00ddeadbeefLL; + tv[1].tv_usec = (suseconds_t) 0xbadc0dedfacefeedLL; + + k_utimes(kfname, (uintptr_t) tv); + printf("%s(%s, [", TEST_SYSCALL_STR, qname); + print_tv(&tv[0]); + printf(", "); + print_tv(&tv[1]); + printf("]) = %s\n", errstr); + + tv[0].tv_sec = 1492358607; + tv[0].tv_usec = 1000000; + tv[1].tv_sec = 1492356078; + tv[1].tv_usec = 1000001; + + k_utimes(kfname, (uintptr_t) tv); + printf("%s(%s, [", TEST_SYSCALL_STR, qname); + print_tv(&tv[0]); + printf(", "); + print_tv(&tv[1]); + printf("]) = %s\n", errstr); + + tv[0].tv_usec = 345678; + tv[1].tv_usec = 456789; + + k_utimes(kfname, (uintptr_t) tv); + printf("%s(%s, [", TEST_SYSCALL_STR, qname); + print_tv(&tv[0]); + printf(", "); + print_tv(&tv[1]); + printf("]) = %s\n", errstr); + + if (F8ILL_KULONG_SUPPORTED) { + k_utimes(kfname, f8ill_ptr_to_kulong(tv)); + printf("%s(%s, %#jx) = %s\n", TEST_SYSCALL_STR, + qname, (uintmax_t) f8ill_ptr_to_kulong(tv), errstr); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests-mx32/zeroargc.c b/tests-mx32/zeroargc.c new file mode 100644 index 00000000..672959c4 --- /dev/null +++ b/tests-mx32/zeroargc.c @@ -0,0 +1,23 @@ +/* + * Execute an executable with zero argc and specified anvironment. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include + +int +main(const int ac, char **const av) +{ + if (ac < 2) + error_msg_and_fail("missing operand"); + const char *const path = av[1]; + av[1] = 0; + execve(path, av + 1, av + 2); + perror_msg_and_fail("execve: %s", path); +} diff --git a/tests/COPYING b/tests/COPYING new file mode 100644 index 00000000..6aba5919 --- /dev/null +++ b/tests/COPYING @@ -0,0 +1,11 @@ +Copyright (c) 2011-2019 The strace developers. +All rights reserved. + +strace test suite is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +strace test suite is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See GPL-2.0-or-later for more details. diff --git a/tests/GPL-2.0-or-later b/tests/GPL-2.0-or-later new file mode 100644 index 00000000..2a166946 --- /dev/null +++ b/tests/GPL-2.0-or-later @@ -0,0 +1,339 @@ +GNU GENERAL PUBLIC LICENSE + +Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. + +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 , USA + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away your freedom +to share and change it. By contrast, the GNU General Public License is +intended to guarantee your freedom to share and change free software--to +make sure the software is free for all its users. This General Public +License applies to most of the Free Software Foundation's software and +to any other program whose authors commit to using it. (Some other Free +Software Foundation software is covered by the GNU Lesser General Public +License instead.) You can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it in +new free programs; and that you know you can do these things. + +To protect your rights, we need to make restrictions that forbid anyone +to deny you these rights or to ask you to surrender the rights. These +restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or +for a fee, you must give the recipients all the rights that you have. You +must make sure that they, too, receive or can get the source code. And +you must show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + +Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, +we want its recipients to know that what they have is not the original, +so that any problems introduced by others will not reflect on the original +authors' reputations. + +Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and +modification follow. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains + a notice placed by the copyright holder saying it may be distributed + under the terms of this General Public License. The "Program", below, + refers to any such program or work, and a "work based on the Program" + means either the Program or any derivative work under copyright law: + that is to say, a work containing the Program or a portion of it, + either verbatim or with modifications and/or translated into another + language. (Hereinafter, translation is included without limitation + in the term "modification".) Each licensee is addressed as "you". + + Activities other than copying, distribution and modification are not + covered by this License; they are outside its scope. The act of running + the Program is not restricted, and the output from the Program is + covered only if its contents constitute a work based on the Program + (independent of having been made by running the Program). Whether + that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's source + code as you receive it, in any medium, provided that you conspicuously + and appropriately publish on each copy an appropriate copyright notice + and disclaimer of warranty; keep intact all the notices that refer + to this License and to the absence of any warranty; and give any + other recipients of the Program a copy of this License along with + the Program. + + You may charge a fee for the physical act of transferring a copy, and + you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion of + it, thus forming a work based on the Program, and copy and distribute + such modifications or work under the terms of Section 1 above, + provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that + in whole or in part contains or is derived from the Program or + any part thereof, to be licensed as a whole at no charge to all + third parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display + an announcement including an appropriate copyright notice and + a notice that there is no warranty (or else, saying that you + provide a warranty) and that users may redistribute the program + under these conditions, and telling the user how to view a copy + of this License. (Exception: if the Program itself is interactive + but does not normally print such an announcement, your work based + on the Program is not required to print an announcement.) + + These requirements apply to the modified work as a whole. If + identifiable sections of that work are not derived from the Program, + and can be reasonably considered independent and separate works in + themselves, then this License, and its terms, do not apply to those + sections when you distribute them as separate works. But when you + distribute the same sections as part of a whole which is a work + based on the Program, the distribution of the whole must be on the + terms of this License, whose permissions for other licensees extend + to the entire whole, and thus to each and every part regardless of + who wrote it. + + Thus, it is not the intent of this section to claim rights or contest + your rights to work written entirely by you; rather, the intent is + to exercise the right to control the distribution of derivative or + collective works based on the Program. + + In addition, mere aggregation of another work not based on the Program + with the Program (or with a work based on the Program) on a volume + of a storage or distribution medium does not bring the other work + under the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, + under Section 2) in object code or executable form under the terms of + Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; + or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer to + distribute corresponding source code. (This alternative is allowed + only for noncommercial distribution and only if you received the + program in object code or executable form with such an offer, + in accord with Subsection b above.) + + The source code for a work means the preferred form of the work + for making modifications to it. For an executable work, complete + source code means all the source code for all modules it contains, + plus any associated interface definition files, plus the scripts used + to control compilation and installation of the executable. However, + as a special exception, the source code distributed need not include + anything that is normally distributed (in either source or binary + form) with the major components (compiler, kernel, and so on) of the + operating system on which the executable runs, unless that component + itself accompanies the executable. + + If distribution of executable or object code is made by offering access + to copy from a designated place, then offering equivalent access to + copy the source code from the same place counts as distribution of + the source code, even though third parties are not compelled to copy + the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program + except as expressly provided under this License. Any attempt otherwise + to copy, modify, sublicense or distribute the Program is void, and + will automatically terminate your rights under this License. However, + parties who have received copies, or rights, from you under this + License will not have their licenses terminated so long as such + parties remain in full compliance. + + 5. You are not required to accept this License, since you have not + signed it. However, nothing else grants you permission to modify + or distribute the Program or its derivative works. These actions + are prohibited by law if you do not accept this License. Therefore, + by modifying or distributing the Program (or any work based on the + Program), you indicate your acceptance of this License to do so, and + all its terms and conditions for copying, distributing or modifying + the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the + Program), the recipient automatically receives a license from the + original licensor to copy, distribute or modify the Program subject to + these terms and conditions. You may not impose any further restrictions + on the recipients' exercise of the rights granted herein. You are not + responsible for enforcing compliance by third parties to this License. + + 7. If, as a consequence of a court judgment or allegation of patent + infringement or for any other reason (not limited to patent issues), + conditions are imposed on you (whether by court order, agreement + or otherwise) that contradict the conditions of this License, they + do not excuse you from the conditions of this License. If you cannot + distribute so as to satisfy simultaneously your obligations under this + License and any other pertinent obligations, then as a consequence + you may not distribute the Program at all. For example, if a patent + license would not permit royalty-free redistribution of the Program + by all those who receive copies directly or indirectly through you, + then the only way you could satisfy both it and this License would + be to refrain entirely from distribution of the Program. + + If any portion of this section is held invalid or unenforceable under + any particular circumstance, the balance of the section is intended + to apply and the section as a whole is intended to apply in other + circumstances. + + It is not the purpose of this section to induce you to infringe any + patents or other property right claims or to contest validity of + any such claims; this section has the sole purpose of protecting + the integrity of the free software distribution system, which + is implemented by public license practices. Many people have made + generous contributions to the wide range of software distributed + through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is willing + to distribute software through any other system and a licensee cannot + impose that choice. + + This section is intended to make thoroughly clear what is believed + to be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in + certain countries either by patents or by copyrighted interfaces, the + original copyright holder who places the Program under this License + may add an explicit geographical distribution limitation excluding + those countries, so that distribution is permitted only in or among + countries not thus excluded. In such case, this License incorporates + the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions + of the General Public License from time to time. Such new versions + will be similar in spirit to the present version, but may differ in + detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the Program + specifies a version number of this License which applies to it and + "any later version", you have the option of following the terms and + conditions either of that version or of any later version published + by the Free Software Foundation. If the Program does not specify + a version number of this License, you may choose any version ever + published by the Free Software Foundation. + + 10. If you wish to incorporate parts of the Program into other free + programs whose distribution conditions are different, write to the + author to ask for permission. For software which is copyrighted by the + Free Software Foundation, write to the Free Software Foundation; we + sometimes make exceptions for this. Our decision will be guided by the + two goals of preserving the free status of all derivatives of our free + software and of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO + WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE + LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS + AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF + ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, + THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE + PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME + THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO + IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY + MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE + TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR + CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE + THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING + RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR + A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN + IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF + SUCH DAMAGES. END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + +Copyright (C) + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2 of the License, or (at your +option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License along +with this program; if not, write to the Free Software Foundation, Inc., +51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 , USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + +Gnomovision version 69, Copyright (C) year name of author Gnomovision +comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is +free software, and you are welcome to redistribute it under certain +conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the +appropriate parts of the General Public License. Of course, the commands +you use may be called something other than `show w' and `show c'; they +could even be mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or +your school, if any, to sign a "copyright disclaimer" for the program, +if necessary. Here is a sample; alter the names: + +Yoyodyne, Inc., hereby disclaims all copyright interest in the program +`Gnomovision' (which makes passes at compilers) written by James Hacker. + +< signature of Ty Coon > , 1 April 1989 Ty Coon, President of Vice This +General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/tests/Makefile.am b/tests/Makefile.am index 311d3bb3..9e99aff2 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,33 +1,18 @@ # Automake input for strace tests. # # Copyright (c) 2011-2016 Dmitry V. Levin +# Copyright (c) 2011-2019 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later OS = linux ARCH = @arch@ +NATIVE_ARCH = @arch_native@ +SIZEOF_KERNEL_LONG_T = @SIZEOF_KERNEL_LONG_T@ +SIZEOF_LONG = @SIZEOF_LONG@ MPERS_NAME = +MPERS_CC_FLAGS = ARCH_MFLAGS = AM_CFLAGS = $(WARN_CFLAGS) AM_CPPFLAGS = $(ARCH_MFLAGS) \ @@ -37,27 +22,40 @@ AM_CPPFLAGS = $(ARCH_MFLAGS) \ -I$(top_builddir)/$(OS) \ -I$(top_srcdir)/$(OS) \ -I$(top_builddir) \ - -I$(top_srcdir) + -I$(top_srcdir) \ + -DTESTS_SIZEOF_KERNEL_LONG_T=$(SIZEOF_KERNEL_LONG_T) \ + -DTESTS_SIZEOF_LONG=$(SIZEOF_LONG) AM_LDFLAGS = $(ARCH_MFLAGS) libtests_a_SOURCES = \ + create_nl_socket.c \ errno2name.c \ error_msg.c \ fill_memory.c \ get_page_size.c \ + get_sigset_size.c \ hexdump_strdup.c \ hexquote_strndup.c \ + ifindex.c \ inode_of_sockfd.c \ libmmsg.c \ libsocketcall.c \ overflowuid.c \ pipe_maxfd.c \ print_quoted_string.c \ + print_time.c \ printflags.c \ printxval.c \ signal2name.c \ + skip_unavailable.c \ sprintrc.c \ tail_alloc.c \ + test_netlink.h \ + test_nlattr.h \ + test_printpath.c \ + test_printstrn.c \ + test_ucopy.c \ + test_ucopy.h \ tests.h \ tprintf.c \ # end of libtests_a_SOURCES @@ -65,396 +63,125 @@ libtests_a_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 check_LIBRARIES = libtests.a LDADD = libtests.a -check_PROGRAMS = \ - _newselect \ - accept \ - accept4 \ - access \ - acct \ - add_key \ - adjtimex \ - aio \ - alarm \ +include pure_executables.am + +check_PROGRAMS = $(PURE_EXECUTABLES) \ + _newselect-P \ answer \ attach-f-p \ attach-f-p-cmd \ attach-p-cmd-cmd \ attach-p-cmd-p \ - bpf \ - brk \ - btrfs \ - caps \ + block_reset_raise_run \ + bpf-obj_get_info_by_fd \ + bpf-obj_get_info_by_fd-prog \ + bpf-obj_get_info_by_fd-prog-v \ + bpf-obj_get_info_by_fd-v \ + bpf-success \ + bpf-success-v \ caps-abbrev \ - chmod \ - chown \ - chown32 \ - chroot \ - clock_adjtime \ - clock_nanosleep \ - clock_xettime \ - copy_file_range \ + check_sigblock \ + check_sigign \ + clone_parent \ + clone_ptrace \ count-f \ - creat \ - delete_module \ - dup \ - dup2 \ - dup3 \ - epoll_create \ - epoll_create1 \ - epoll_ctl \ - epoll_pwait \ - epoll_wait \ - erestartsys \ - eventfd \ - execve \ + delay \ execve-v \ - execveat \ execveat-v \ - faccessat \ - fadvise64 \ - fadvise64_64 \ - fallocate \ - fanotify_init \ - fanotify_mark \ - fchdir \ - fchmod \ - fchmodat \ - fchown \ - fchown32 \ - fchownat \ - fcntl \ - fcntl64 \ - fdatasync \ - file_handle \ - file_ioctl \ filter-unavailable \ - finit_module \ - flock \ fork-f \ - fstat \ - fstat64 \ - fstatat64 \ - fstatfs \ - fstatfs64 \ - fsync \ - ftruncate \ - ftruncate64 \ - futex \ - futimesat \ - get_mempolicy \ - getcpu \ - getcwd \ - getdents \ - getdents64 \ - getegid \ - getegid32 \ - geteuid \ - geteuid32 \ - getgid \ - getgid32 \ - getgroups \ - getgroups32 \ - getpeername \ - getpgrp \ - getrandom \ - getresgid \ - getresgid32 \ - getresuid \ - getresuid32 \ - getrlimit \ - getrusage \ - getsid \ - getsockname \ - getuid \ - getuid32 \ - getxxid \ - inet-cmsg \ - init_module \ - inotify \ - inotify_init1 \ - ioctl \ - ioctl_block \ - ioctl_dm \ + fsync-y \ + getpid \ + getppid \ + gettid \ + inject-nf \ + int_0x80 \ ioctl_dm-v \ - ioctl_evdev \ + ioctl_evdev-success \ + ioctl_evdev-success-v \ ioctl_evdev-v \ - ioctl_loop \ ioctl_loop-nv \ ioctl_loop-v \ - ioctl_mtd \ - ioctl_rtc \ + ioctl_nsfs \ + ioctl_perf-success \ ioctl_rtc-v \ - ioctl_scsi \ - ioctl_sg_io_v3 \ - ioctl_sg_io_v4 \ - ioctl_sock_gifconf \ - ioctl_uffdio \ - ioctl_v4l2 \ - ioperm \ - iopl \ - ioprio \ - ip_mreq \ - ipc \ - ipc_msg \ - ipc_msgbuf \ - ipc_sem \ - ipc_shm \ - kcmp \ - kexec_file_load \ - kexec_load \ - keyctl \ - kill \ + is_linux_mips_n64 \ + kill_child \ ksysent \ - lchown \ - lchown32 \ - link \ - linkat \ - llseek \ - lookup_dcookie \ - lseek \ - lstat \ - lstat64 \ - mbind \ - membarrier \ - memfd_create \ - migrate_pages \ - mincore \ - mkdir \ - mkdirat \ - mknod \ - mknodat \ - mlock \ - mlock2 \ - mlockall \ - mmap \ - mmap64 \ - mmsg \ + list_sigaction_signum \ + localtime \ + looping_threads \ mmsg-silent \ - mmsg_name \ mmsg_name-v \ - mount \ - move_pages \ - mq \ - mq_sendrecv \ - mq_sendrecv-read \ - mq_sendrecv-write \ - msg_control \ msg_control-v \ - msg_name \ - munlockall \ - nanosleep \ net-accept-connect \ - net-icmp_filter \ - net-sockaddr \ - net-y-unix \ - net-yy-inet \ - net-yy-netlink \ - net-yy-unix \ + net-tpacket_stats-success \ netlink_inet_diag \ netlink_netlink_diag \ - netlink_protocol \ netlink_unix_diag \ - newfstatat \ nsyscalls \ - old_mmap \ - oldfstat \ - oldlstat \ - oldselect \ - oldstat \ - open \ - openat \ - pause \ + nsyscalls-d \ + oldselect-P \ + oldselect-efault-P \ + orphaned_process_group \ pc \ - perf_event_open \ perf_event_open_nonverbose \ perf_event_open_unabbrev \ - personality \ - pipe \ - pipe2 \ - pkey_alloc \ - pkey_free \ - pkey_mprotect \ - poll \ - ppoll \ - prctl-arg2-intptr \ - prctl-dumpable \ - prctl-name \ - prctl-no-args \ - prctl-pdeathsig \ + ppoll-v \ prctl-seccomp-filter-v \ prctl-seccomp-strict \ - prctl-securebits \ - prctl-tid_address \ - prctl-tsc \ - pread64-pwrite64 \ - preadv \ - preadv-pwritev \ - preadv2-pwritev2 \ + prctl-spec-inject \ print_maxfd \ - printstr \ - prlimit64 \ - process_vm_readv \ - process_vm_writev \ - pselect6 \ - ptrace \ - pwritev \ qual_fault \ qual_inject-error-signal \ qual_inject-retval \ qual_inject-signal \ qual_signal \ - quotactl \ + quotactl-success \ + quotactl-success-v \ quotactl-v \ - quotactl-xfs \ + quotactl-xfs-success \ + quotactl-xfs-success-v \ quotactl-xfs-v \ - read-write \ - readahead \ - readdir \ - readlink \ - readlinkat \ - readv \ - reboot \ - recvfrom \ - recvmmsg-timeout \ - recvmsg \ redirect-fds \ - remap_file_pages \ - rename \ - renameat \ - renameat2 \ - request_key \ restart_syscall \ - rmdir \ - rt_sigpending \ - rt_sigprocmask \ - rt_sigqueueinfo \ - rt_sigsuspend \ - rt_sigtimedwait \ - rt_tgsigqueueinfo \ - sched_get_priority_mxx \ - sched_rr_get_interval \ - sched_xetaffinity \ - sched_xetattr \ - sched_xetparam \ - sched_xetscheduler \ - sched_yield \ + run_expect_termsig \ scm_rights \ - seccomp-filter \ seccomp-filter-v \ seccomp-strict \ - select \ - semop \ - sendfile \ - sendfile64 \ - set_mempolicy \ + select-P \ set_ptracer_any \ - setdomainname \ - setfsgid \ - setfsgid32 \ - setfsuid \ - setfsuid32 \ - setgid \ - setgid32 \ - setgroups \ - setgroups32 \ - sethostname \ - setns \ - setregid \ - setregid32 \ - setresgid \ - setresgid32 \ - setresuid \ - setresuid32 \ - setreuid \ - setreuid32 \ - setrlimit \ - setuid \ - setuid32 \ - shmxt \ - shutdown \ - sigaction \ - sigaltstack \ - siginfo \ + set_sigblock \ + set_sigign \ signal_receive \ - signalfd4 \ - sigreturn \ sleep \ - socketcall \ - splice \ stack-fcall \ - stat \ - stat64 \ - statfs \ - statfs64 \ - swap \ - symlink \ - symlinkat \ - sync \ - sync_file_range \ - sync_file_range2 \ - sysinfo \ - syslog \ - tee \ + stack-fcall-mangled \ threads-execve \ - time \ - timer_create \ - timer_xettime \ - timerfd_xettime \ - times \ - times-fail \ - truncate \ - truncate64 \ - ugetrlimit \ - uio \ - umask \ - umount \ - umount2 \ - umoven-illptr \ - umovestr \ - umovestr-illptr \ - umovestr2 \ - umovestr3 \ - uname \ + unblock_reset_raise \ unix-pair-send-recv \ unix-pair-sendto-recvfrom \ - unlink \ - unlinkat \ - unshare \ - userfaultfd \ - ustat \ - utime \ - utimensat \ - utimes \ vfork-f \ - vhangup \ - vmsplice \ - wait4 \ wait4-v \ - waitid \ waitid-v \ - waitpid \ - xattr \ - xattr-strings \ - xet_robust_list \ - xetitimer \ - xetpgid \ - xetpriority \ - xettimeofday \ + zeroargc \ # end of check_PROGRAMS -attach_f_p_LDADD = -lrt -lpthread $(LDADD) -clock_xettime_LDADD = -lrt $(LDADD) +attach_f_p_LDADD = -lpthread $(LDADD) count_f_LDADD = -lpthread $(LDADD) +delay_LDADD = $(clock_LIBS) $(LDADD) filter_unavailable_LDADD = -lpthread $(LDADD) fstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 fstatat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 ftruncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +localtime_LDADD = $(clock_LIBS) $(LDADD) +looping_threads_LDADD = -lpthread $(LDADD) lstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 mmap64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 -mq_LDADD = -lrt $(LDADD) -mq_sendrecv_LDADD = -lrt $(LDADD) -mq_sendrecv_read_LDADD = -lrt $(LDADD) -mq_sendrecv_write_LDADD = -lrt $(LDADD) +mmap64_Xabbrev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mmap64_Xraw_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mmap64_Xverbose_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mq_LDADD = $(mq_LIBS) $(LDADD) newfstatat_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 pc_LDADD = $(dl_LIBS) $(LDADD) pread64_pwrite64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 @@ -463,221 +190,72 @@ preadv_pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 stat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 statfs_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 -threads_execve_LDADD = -lrt -lpthread $(LDADD) -times_LDADD = -lrt $(LDADD) +threads_execve_LDADD = -lpthread $(clock_LIBS) $(LDADD) +times_LDADD = $(clock_LIBS) $(LDADD) truncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 uio_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 stack_fcall_SOURCES = stack-fcall.c \ stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c -if USE_LIBUNWIND -LIBUNWIND_TESTS = strace-k.test +stack_fcall_mangled_SOURCES = stack-fcall-mangled.c \ + stack-fcall-mangled-0.c stack-fcall-mangled-1.c \ + stack-fcall-mangled-2.c stack-fcall-mangled-3.c + +include gen_tests.am + +if ENABLE_STACKTRACE +STACKTRACE_TESTS = strace-k.test +if USE_DEMANGLE +STACKTRACE_TESTS += strace-k-demangle.test +endif else -LIBUNWIND_TESTS = +STACKTRACE_TESTS = endif DECODER_TESTS = \ - _newselect.test \ - accept.test \ - accept4.test \ - access.test \ - acct.test \ - add_key.test \ - adjtimex.test \ - aio.test \ - alarm.test \ - bpf.test \ + bpf-success-v.test \ + bpf-success.test \ brk.test \ + btrfs-X.test \ btrfs-v.test \ + btrfs-vX.test \ btrfs-vw.test \ + btrfs-vwX.test \ btrfs-w.test \ - btrfs.test \ + btrfs-wX.test \ caps-abbrev.test \ caps.test \ - chmod.test \ - chown.test \ - chown32.test \ - chroot.test \ - clock_adjtime.test \ - clock_nanosleep.test \ - clock_xettime.test \ - copy_file_range.test \ - creat.test \ - delete_module.test \ - dup.test \ - dup2.test \ - dup3.test \ - epoll_create.test \ - epoll_create1.test \ - epoll_ctl.test \ - epoll_pwait.test \ - epoll_wait.test \ - erestartsys.test \ eventfd.test \ execve-v.test \ execve.test \ - execveat-v.test \ - execveat.test \ - faccessat.test \ fadvise64.test \ - fadvise64_64.test \ - fallocate.test \ - fanotify_init.test \ - fanotify_mark.test \ - fchdir.test \ - fchmod.test \ - fchmodat.test \ - fchown.test \ - fchown32.test \ - fchownat.test \ - fcntl.test \ - fcntl64.test \ - fdatasync.test \ - file_handle.test \ - file_ioctl.test \ - finit_module.test \ - flock.test \ - fstat.test \ - fstat64.test \ - fstatat64.test \ - fstatfs.test \ - fstatfs64.test \ - fsync.test \ - ftruncate.test \ - ftruncate64.test \ futex.test \ - futimesat.test \ - get_mempolicy.test \ - getcpu.test \ - getcwd.test \ - getdents.test \ - getdents64.test \ - getegid.test \ - getegid32.test \ - geteuid.test \ - geteuid32.test \ - getgid.test \ - getgid32.test \ - getgroups.test \ - getgroups32.test \ - getpeername.test \ - getpgrp.test \ - getrandom.test \ - getresgid.test \ - getresgid32.test \ - getresuid.test \ - getresuid32.test \ - getrlimit.test \ - getrusage.test \ - getsid.test \ - getsockname.test \ getuid.test \ - getuid32.test \ - getxxid.test \ - inet-cmsg.test \ - init_module.test \ - inotify.test \ - inotify_init1.test \ + int_0x80.test \ ioctl.test \ - ioctl_block.test \ - ioctl_dm-v.test \ - ioctl_dm.test \ - ioctl_evdev-v.test \ - ioctl_evdev.test \ - ioctl_loop-nv.test \ - ioctl_loop-v.test \ - ioctl_loop.test \ - ioctl_mtd.test \ - ioctl_rtc-v.test \ - ioctl_rtc.test \ - ioctl_scsi.test \ - ioctl_sg_io_v3.test \ - ioctl_sg_io_v4.test \ - ioctl_sock_gifconf.test \ - ioctl_uffdio.test \ - ioctl_v4l2.test \ - ioperm.test \ - iopl.test \ - ioprio.test \ - ip_mreq.test \ - ipc.test \ - ipc_msg.test \ + ioctl_evdev-success-v.test \ + ioctl_evdev-success.test \ + ioctl_perf-success.test \ ipc_msgbuf.test \ - ipc_sem.test \ - ipc_shm.test \ - kcmp.test \ - kexec_file_load.test \ - kexec_load.test \ - keyctl.test \ - kill.test \ - lchown.test \ - lchown32.test \ - link.test \ - linkat.test \ + kern_features-fault.test \ llseek.test \ - lookup_dcookie.test \ lseek.test \ - lstat.test \ - lstat64.test \ - mbind.test \ - membarrier.test \ - memfd_create.test \ - migrate_pages.test \ - mincore.test \ - mkdir.test \ - mkdirat.test \ - mknod.test \ - mknodat.test \ - mlock.test \ - mlock2.test \ - mlockall.test \ mmap.test \ - mmap64.test \ - mmsg-silent.test \ - mmsg.test \ - mmsg_name-v.test \ - mmsg_name.test \ - mount.test \ - move_pages.test \ - mq.test \ - mq_sendrecv-read.test \ - mq_sendrecv-write.test \ - mq_sendrecv.test \ - msg_control-v.test \ - msg_control.test \ - msg_name.test \ - munlockall.test \ - nanosleep.test \ - net-icmp_filter.test \ - net-sockaddr.test \ + net-tpacket_stats-success.test \ net-y-unix.test \ net-yy-inet.test \ net-yy-netlink.test \ net-yy-unix.test \ net.test \ - netlink_protocol.test \ - newfstatat.test \ + netlink_sock_diag.test \ + nsyscalls-d.test \ + nsyscalls-nd.test \ nsyscalls.test \ - old_mmap.test \ - oldfstat.test \ - oldlstat.test \ - oldselect.test \ - oldstat.test \ - open.test \ - openat.test \ - pause.test \ - perf_event_open.test \ - perf_event_open_nonverbose.test \ - perf_event_open_unabbrev.test \ personality.test \ pipe.test \ - pipe2.test \ - pkey_alloc.test \ - pkey_free.test \ - pkey_mprotect.test \ + poll-P.test \ poll.test \ - ppoll.test \ prctl-arg2-intptr.test \ prctl-dumpable.test \ prctl-name.test \ @@ -686,171 +264,68 @@ DECODER_TESTS = \ prctl-seccomp-filter-v.test \ prctl-seccomp-strict.test \ prctl-securebits.test \ + prctl-spec-inject.test \ prctl-tid_address.test \ prctl-tsc.test \ - pread64-pwrite64.test \ - preadv-pwritev.test \ - preadv.test \ - preadv2-pwritev2.test \ - printstr.test \ - prlimit64.test \ - process_vm_readv.test \ - process_vm_writev.test \ - pselect6.test \ - ptrace.test \ - pwritev.test \ qual_fault-exit_group.test \ - quotactl-v.test \ - quotactl-xfs-v.test \ - quotactl-xfs.test \ - quotactl.test \ - read-write.test \ - readahead.test \ - readdir.test \ - readlink.test \ - readlinkat.test \ + quotactl-success-v.test \ + quotactl-success.test \ + quotactl-xfs-success-v.test \ + quotactl-xfs-success.test \ readv.test \ - reboot.test \ - recvfrom.test \ - recvmmsg-timeout.test \ - recvmsg.test \ - remap_file_pages.test \ - rename.test \ - renameat.test \ - renameat2.test \ - request_key.test \ - rmdir.test \ - rt_sigpending.test \ - rt_sigprocmask.test \ - rt_sigqueueinfo.test \ - rt_sigsuspend.test \ - rt_sigtimedwait.test \ - rt_tgsigqueueinfo.test \ - sched_get_priority_mxx.test \ - sched_rr_get_interval.test \ - sched_xetaffinity.test \ - sched_xetattr.test \ - sched_xetparam.test \ - sched_xetscheduler.test \ - sched_yield.test \ + rt_sigaction.test \ scm_rights-fd.test \ - seccomp-filter-v.test \ - seccomp-filter.test \ seccomp-strict.test \ - select.test \ - semop.test \ - sendfile.test \ - sendfile64.test \ - set_mempolicy.test \ - setdomainname.test \ - setfsgid.test \ - setfsgid32.test \ - setfsuid.test \ - setfsuid32.test \ - setgid.test \ - setgid32.test \ - setgroups.test \ - setgroups32.test \ - sethostname.test \ - setns.test \ - setregid.test \ - setregid32.test \ - setresgid.test \ - setresgid32.test \ - setresuid.test \ - setresuid32.test \ - setreuid.test \ - setreuid32.test \ - setrlimit.test \ - setuid.test \ - setuid32.test \ - shmxt.test \ - shutdown.test \ - sigaction.test \ sigaltstack.test \ - siginfo.test \ - signalfd4.test \ - sigreturn.test \ - socketcall.test \ - splice.test \ - stat.test \ - stat64.test \ - statfs.test \ - statfs64.test \ sun_path.test \ - swap.test \ - symlink.test \ - symlinkat.test \ - sync.test \ - sync_file_range.test \ - sync_file_range2.test \ - sysinfo.test \ - syslog.test \ - tee.test \ - time.test \ - timer_create.test \ - timer_xettime.test \ - timerfd_xettime.test \ - times-fail.test \ - times.test \ - truncate.test \ - truncate64.test \ - ugetrlimit.test \ uio.test \ - umask.test \ umount.test \ umount2.test \ - umoven-illptr.test \ - umovestr-illptr.test \ umovestr.test \ umovestr2.test \ - umovestr3.test \ uname.test \ unix-pair-send-recv.test \ unix-pair-sendto-recvfrom.test \ - unlink.test \ - unlinkat.test \ - unshare.test \ - userfaultfd.test \ - ustat.test \ - utime.test \ - utimensat.test \ - utimes.test \ - vhangup.test \ - vmsplice.test \ - wait4-v.test \ - wait4.test \ - waitid-v.test \ - waitid.test \ - waitpid.test \ - xattr-strings.test \ - xattr.test \ - xet_robust_list.test \ - xetitimer.test \ - xetpgid.test \ - xetpriority.test \ - xettimeofday.test \ + xet_thread_area_x86.test \ # end of DECODER_TESTS MISC_TESTS = \ attach-f-p.test \ attach-p-cmd.test \ bexecve.test \ + clone_parent.test \ + clone_ptrace.test \ count-f.test \ count.test \ + delay.test \ detach-running.test \ detach-sleeping.test \ detach-stopped.test \ + fflush.test \ filter-unavailable.test \ - fork-f.test \ + filtering_fd-syntax.test \ + filtering_syscall-syntax.test \ + first_exec_failure.test \ + get_regs.test \ + inject-nf.test \ + interactive_block.test \ + kill_child.test \ ksysent.test \ + localtime.test \ + looping_threads.test \ opipe.test \ options-syntax.test \ pc.test \ + printpath-umovestr-legacy.test \ + printstrn-umoven-legacy.test \ qual_fault-syntax.test \ + qual_fault-syscall.test \ qual_fault.test \ + qual_inject-error-signal-syscall.test \ qual_inject-error-signal.test \ + qual_inject-retval-syscall.test \ qual_inject-retval.test \ + qual_inject-signal-syscall.test \ qual_inject-signal.test \ qual_inject-syntax.test \ qual_signal.test \ @@ -858,92 +333,135 @@ MISC_TESTS = \ redirect-fds.test \ redirect.test \ restart_syscall.test \ - signal_receive.test \ + sigblock.test \ + sigign.test \ strace-C.test \ strace-E.test \ strace-S.test \ strace-T.test \ strace-V.test \ strace-ff.test \ + strace-log-merge-error.test \ + strace-log-merge-suffix.test \ strace-r.test \ strace-t.test \ strace-tt.test \ strace-ttt.test \ + termsig.test \ threads-execve.test \ - vfork-f.test \ # end of MISC_TESTS -TESTS = $(DECODER_TESTS) $(MISC_TESTS) $(LIBUNWIND_TESTS) +TESTS = $(GEN_TESTS) $(DECODER_TESTS) $(MISC_TESTS) $(STACKTRACE_TESTS) XFAIL_TESTS_ = -XFAIL_TESTS_m32 = $(LIBUNWIND_TESTS) -XFAIL_TESTS_mx32 = $(LIBUNWIND_TESTS) -XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) +XFAIL_TESTS_m32 = $(STACKTRACE_TESTS) +XFAIL_TESTS_mx32 = $(STACKTRACE_TESTS) +XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) $(XFAIL_TESTS_$(ARCH)) TEST_LOG_COMPILER = env -AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) MIPS_ABI=$(MIPS_ABI) $(srcdir)/run.sh +AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) STRACE_NATIVE_ARCH=$(NATIVE_ARCH) \ + SIZEOF_KERNEL_LONG_T=$(SIZEOF_KERNEL_LONG_T) \ + SIZEOF_LONG=$(SIZEOF_LONG) \ + MIPS_ABI=$(MIPS_ABI) $(srcdir)/run.sh @VALGRIND_CHECK_RULES@ VALGRIND_FLAGS = --quiet -VALGRIND_SUPPRESSIONS_FILES = $(srcdir)/strace.supp +VALGRIND_SUPPRESSIONS_FILES = $(abs_srcdir)/strace.supp -EXTRA_DIST = init.sh run.sh match.awk \ - caps-abbrev.awk \ - caps.awk \ - count-f.expected \ - eventfd.expected \ - fadvise.h \ - filter-unavailable.expected \ - fstatat.c \ - fstatx.c \ - getresugid.c \ - init_delete_module.h \ - ipc.sh \ - ipc_msgbuf.expected \ - ksysent.sed \ - lstatx.c \ - net.expected \ - oldselect.expected \ - pipe.expected \ - ppoll-v.expected \ - ppoll.expected \ - process_vm_readv_writev.c \ - qual_fault-exit_group.expected \ - qual_inject-error-signal.expected \ - qual_inject-signal.expected \ - quotactl.h \ - scno_tampering.sh \ - setfsugid.c \ - setresugid.c \ - setreugid.c \ - setugid.c \ - sigaction.awk \ - sigaltstack.expected \ - sockname.c \ - statfs.expected \ - statx.sh \ - strace-C.expected \ - strace-E.expected \ - strace-T.expected \ - strace-ff.expected \ - strace-k.test \ - strace-r.expected \ - strace.supp \ - struct_flock.c \ - sun_path.expected \ - uio.expected \ - umode_t.c \ - umovestr.expected \ - unix-pair-send-recv.expected \ - unix-pair-sendto-recvfrom.expected \ - xchownx.c \ - xgetrlimit.c \ - xselect.c \ - xstatfs.c \ - xstatfs64.c \ - xstatfsx.c \ - xstatx.c \ - $(TESTS) +EXTRA_DIST = \ + COPYING \ + GPL-2.0-or-later \ + PTRACE_SEIZE.sh \ + accept_compat.h \ + attach-p-cmd.h \ + caps-abbrev.awk \ + caps.awk \ + clock.in \ + count-f.expected \ + eventfd.expected \ + fadvise.h \ + fcntl-common.c \ + filter-unavailable.expected \ + fstatat.c \ + fstatx.c \ + gen_pure_executables.sh \ + gen_tests.in \ + gen_tests.sh \ + getresugid.c \ + init.sh \ + init_delete_module.h \ + ioctl_kvm_run_common.c \ + ipc.sh \ + ksysent.sed \ + lstatx.c \ + match.awk \ + net.expected \ + netlink_sock_diag-v.sh \ + nlattr_ifla.h \ + pipe.expected \ + print_user_desc.c \ + printsignal.c \ + process_vm_readv_writev.c \ + pure_executables.list \ + qual_fault-exit_group.expected \ + qual_inject-error-signal.expected \ + qual_inject-signal.expected \ + qualify_personality.sh \ + qualify_personality_empty.in \ + quotactl.h \ + regex.in \ + rt_sigaction.awk \ + run.sh \ + sched.in \ + scno_tampering.sh \ + setfsugid.c \ + setresugid.c \ + setreugid.c \ + setugid.c \ + sigaltstack.expected \ + sockaddr_xlat.c \ + sockname.c \ + stack-fcall.h \ + strace-C.expected \ + strace-E.expected \ + strace-T.expected \ + strace-ff.expected \ + strace-k-demangle.expected \ + strace-k-demangle.test \ + strace-k.expected \ + strace-k.test \ + strace-r.expected \ + strace.supp \ + sun_path.expected \ + syntax.sh \ + trace_fstat.in \ + trace_fstatfs.in \ + trace_lstat.in \ + trace_personality_32.in \ + trace_personality_64.in \ + trace_personality_regex_32.in \ + trace_personality_regex_64.in \ + trace_personality_regex_x32.in \ + trace_personality_x32.in \ + trace_question.in \ + trace_stat.in \ + trace_stat_like.in \ + trace_statfs.in \ + trace_statfs_like.in \ + uio.expected \ + umode_t.c \ + umovestr.expected \ + unix-pair-send-recv.expected \ + unix-pair-sendto-recvfrom.expected \ + xchownx.c \ + xgetrlimit.c \ + xselect.c \ + xstatfs.c \ + xstatfs64.c \ + xstatfsx.c \ + xstatx.c \ + xutimes.c \ + $(TESTS) ksysent.h: $(srcdir)/ksysent.sed echo '#include ' | \ @@ -957,6 +475,15 @@ ksysent.$(OBJEXT): ksysent.h objects = $(filter %.$(OBJEXT),$(SOURCES:.c=.$(OBJEXT))) $(objects): scno.h -CLEANFILES = ksysent.h $(TESTS:=.tmp) +clean-local: clean-local-check +.PHONY: clean-local-check +clean-local-check: + -rm -rf -- $(TESTS:.test=.dir) $(GEN_TESTS:.gen.test=.dir) + +.PHONY: check-valgrind-local +check-valgrind-local: $(check_LIBRARIES) $(check_PROGRAMS) + +BUILT_SOURCES = ksysent.h +CLEANFILES = ksysent.h include ../scno.am diff --git a/tests/Makefile.in b/tests/Makefile.in index 3a4d792a..33859f47 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -1,7 +1,7 @@ -# Makefile.in generated by automake 1.14.1 from Makefile.am. +# Makefile.in generated by automake 1.16.1 from Makefile.am. # @configure_input@ -# Copyright (C) 1994-2013 Free Software Foundation, Inc. +# Copyright (C) 1994-2018 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -17,58 +17,29 @@ # Automake input for strace tests. # # Copyright (c) 2011-2016 Dmitry V. Levin +# Copyright (c) 2011-2019 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later # scno.h make rules for strace. # -# Copyright (c) 2017 Dmitry V. Levin +# Copyright (c) 2017-2019 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: LGPL-2.1-or-later VPATH = @srcdir@ -am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__is_gnu_make = { \ + if test -z '$(MAKELEVEL)'; then \ + false; \ + elif test -n '$(MAKE_HOST)'; then \ + true; \ + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ + true; \ + else \ + false; \ + fi; \ +} am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ @@ -131,163 +102,288 @@ PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ -check_PROGRAMS = _newselect$(EXEEXT) accept$(EXEEXT) accept4$(EXEEXT) \ - access$(EXEEXT) acct$(EXEEXT) add_key$(EXEEXT) \ - adjtimex$(EXEEXT) aio$(EXEEXT) alarm$(EXEEXT) answer$(EXEEXT) \ +check_PROGRAMS = $(am__EXEEXT_1) _newselect-P$(EXEEXT) answer$(EXEEXT) \ attach-f-p$(EXEEXT) attach-f-p-cmd$(EXEEXT) \ - attach-p-cmd-cmd$(EXEEXT) attach-p-cmd-p$(EXEEXT) bpf$(EXEEXT) \ - brk$(EXEEXT) btrfs$(EXEEXT) caps$(EXEEXT) caps-abbrev$(EXEEXT) \ - chmod$(EXEEXT) chown$(EXEEXT) chown32$(EXEEXT) chroot$(EXEEXT) \ - clock_adjtime$(EXEEXT) clock_nanosleep$(EXEEXT) \ - clock_xettime$(EXEEXT) copy_file_range$(EXEEXT) \ - count-f$(EXEEXT) creat$(EXEEXT) delete_module$(EXEEXT) \ - dup$(EXEEXT) dup2$(EXEEXT) dup3$(EXEEXT) epoll_create$(EXEEXT) \ - epoll_create1$(EXEEXT) epoll_ctl$(EXEEXT) epoll_pwait$(EXEEXT) \ - epoll_wait$(EXEEXT) erestartsys$(EXEEXT) eventfd$(EXEEXT) \ - execve$(EXEEXT) execve-v$(EXEEXT) execveat$(EXEEXT) \ - execveat-v$(EXEEXT) faccessat$(EXEEXT) fadvise64$(EXEEXT) \ + attach-p-cmd-cmd$(EXEEXT) attach-p-cmd-p$(EXEEXT) \ + block_reset_raise_run$(EXEEXT) bpf-obj_get_info_by_fd$(EXEEXT) \ + bpf-obj_get_info_by_fd-prog$(EXEEXT) \ + bpf-obj_get_info_by_fd-prog-v$(EXEEXT) \ + bpf-obj_get_info_by_fd-v$(EXEEXT) bpf-success$(EXEEXT) \ + bpf-success-v$(EXEEXT) caps-abbrev$(EXEEXT) \ + check_sigblock$(EXEEXT) check_sigign$(EXEEXT) \ + clone_parent$(EXEEXT) clone_ptrace$(EXEEXT) count-f$(EXEEXT) \ + delay$(EXEEXT) execve-v$(EXEEXT) execveat-v$(EXEEXT) \ + filter-unavailable$(EXEEXT) fork-f$(EXEEXT) fsync-y$(EXEEXT) \ + getpid$(EXEEXT) getppid$(EXEEXT) gettid$(EXEEXT) \ + inject-nf$(EXEEXT) int_0x80$(EXEEXT) ioctl_dm-v$(EXEEXT) \ + ioctl_evdev-success$(EXEEXT) ioctl_evdev-success-v$(EXEEXT) \ + ioctl_evdev-v$(EXEEXT) ioctl_loop-nv$(EXEEXT) \ + ioctl_loop-v$(EXEEXT) ioctl_nsfs$(EXEEXT) \ + ioctl_perf-success$(EXEEXT) ioctl_rtc-v$(EXEEXT) \ + is_linux_mips_n64$(EXEEXT) kill_child$(EXEEXT) \ + ksysent$(EXEEXT) list_sigaction_signum$(EXEEXT) \ + localtime$(EXEEXT) looping_threads$(EXEEXT) \ + mmsg-silent$(EXEEXT) mmsg_name-v$(EXEEXT) \ + msg_control-v$(EXEEXT) net-accept-connect$(EXEEXT) \ + net-tpacket_stats-success$(EXEEXT) netlink_inet_diag$(EXEEXT) \ + netlink_netlink_diag$(EXEEXT) netlink_unix_diag$(EXEEXT) \ + nsyscalls$(EXEEXT) nsyscalls-d$(EXEEXT) oldselect-P$(EXEEXT) \ + oldselect-efault-P$(EXEEXT) orphaned_process_group$(EXEEXT) \ + pc$(EXEEXT) perf_event_open_nonverbose$(EXEEXT) \ + perf_event_open_unabbrev$(EXEEXT) ppoll-v$(EXEEXT) \ + prctl-seccomp-filter-v$(EXEEXT) prctl-seccomp-strict$(EXEEXT) \ + prctl-spec-inject$(EXEEXT) print_maxfd$(EXEEXT) \ + qual_fault$(EXEEXT) qual_inject-error-signal$(EXEEXT) \ + qual_inject-retval$(EXEEXT) qual_inject-signal$(EXEEXT) \ + qual_signal$(EXEEXT) quotactl-success$(EXEEXT) \ + quotactl-success-v$(EXEEXT) quotactl-v$(EXEEXT) \ + quotactl-xfs-success$(EXEEXT) quotactl-xfs-success-v$(EXEEXT) \ + quotactl-xfs-v$(EXEEXT) redirect-fds$(EXEEXT) \ + restart_syscall$(EXEEXT) run_expect_termsig$(EXEEXT) \ + scm_rights$(EXEEXT) seccomp-filter-v$(EXEEXT) \ + seccomp-strict$(EXEEXT) select-P$(EXEEXT) \ + set_ptracer_any$(EXEEXT) set_sigblock$(EXEEXT) \ + set_sigign$(EXEEXT) signal_receive$(EXEEXT) sleep$(EXEEXT) \ + stack-fcall$(EXEEXT) stack-fcall-mangled$(EXEEXT) \ + threads-execve$(EXEEXT) unblock_reset_raise$(EXEEXT) \ + unix-pair-send-recv$(EXEEXT) \ + unix-pair-sendto-recvfrom$(EXEEXT) vfork-f$(EXEEXT) \ + wait4-v$(EXEEXT) waitid-v$(EXEEXT) zeroargc$(EXEEXT) +@ENABLE_STACKTRACE_TRUE@@USE_DEMANGLE_TRUE@am__append_1 = strace-k-demangle.test +TESTS = $(GEN_TESTS) $(DECODER_TESTS) $(MISC_TESTS) $(am__EXEEXT_2) +subdir = tests +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ + $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ + $(top_srcdir)/m4/ax_valgrind_check.m4 \ + $(top_srcdir)/m4/bpf_attr.m4 $(top_srcdir)/m4/mpers.m4 \ + $(top_srcdir)/m4/st_demangle.m4 $(top_srcdir)/m4/st_libdw.m4 \ + $(top_srcdir)/m4/st_libunwind.m4 \ + $(top_srcdir)/m4/st_save_restore_var.m4 \ + $(top_srcdir)/m4/st_stacktrace.m4 \ + $(top_srcdir)/m4/st_warn_cflags.m4 \ + $(top_srcdir)/m4/warnings.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) +mkinstalldirs = $(install_sh) -d +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__EXEEXT_1 = _newselect$(EXEEXT) accept$(EXEEXT) accept4$(EXEEXT) \ + access$(EXEEXT) acct$(EXEEXT) add_key$(EXEEXT) \ + adjtimex$(EXEEXT) aio$(EXEEXT) aio_pgetevents$(EXEEXT) \ + alarm$(EXEEXT) bpf$(EXEEXT) bpf-obj_get_info_by_fd$(EXEEXT) \ + bpf-obj_get_info_by_fd-prog$(EXEEXT) \ + bpf-obj_get_info_by_fd-prog-v$(EXEEXT) \ + bpf-obj_get_info_by_fd-v$(EXEEXT) bpf-v$(EXEEXT) brk$(EXEEXT) \ + btrfs$(EXEEXT) caps$(EXEEXT) chmod$(EXEEXT) chown$(EXEEXT) \ + chown32$(EXEEXT) chroot$(EXEEXT) clock_adjtime$(EXEEXT) \ + clock_nanosleep$(EXEEXT) clock_xettime$(EXEEXT) \ + copy_file_range$(EXEEXT) creat$(EXEEXT) delete_module$(EXEEXT) \ + dev-yy$(EXEEXT) dup$(EXEEXT) dup2$(EXEEXT) dup3$(EXEEXT) \ + epoll_create$(EXEEXT) epoll_create1$(EXEEXT) \ + epoll_ctl$(EXEEXT) epoll_pwait$(EXEEXT) epoll_wait$(EXEEXT) \ + erestartsys$(EXEEXT) eventfd$(EXEEXT) execve$(EXEEXT) \ + execveat$(EXEEXT) faccessat$(EXEEXT) fadvise64$(EXEEXT) \ fadvise64_64$(EXEEXT) fallocate$(EXEEXT) \ - fanotify_init$(EXEEXT) fanotify_mark$(EXEEXT) fchdir$(EXEEXT) \ + fanotify_init$(EXEEXT) fanotify_mark$(EXEEXT) \ + fanotify_mark-Xabbrev$(EXEEXT) fanotify_mark-Xraw$(EXEEXT) \ + fanotify_mark-Xverbose$(EXEEXT) fchdir$(EXEEXT) \ fchmod$(EXEEXT) fchmodat$(EXEEXT) fchown$(EXEEXT) \ fchown32$(EXEEXT) fchownat$(EXEEXT) fcntl$(EXEEXT) \ - fcntl64$(EXEEXT) fdatasync$(EXEEXT) file_handle$(EXEEXT) \ - file_ioctl$(EXEEXT) filter-unavailable$(EXEEXT) \ - finit_module$(EXEEXT) flock$(EXEEXT) fork-f$(EXEEXT) \ - fstat$(EXEEXT) fstat64$(EXEEXT) fstatat64$(EXEEXT) \ - fstatfs$(EXEEXT) fstatfs64$(EXEEXT) fsync$(EXEEXT) \ - ftruncate$(EXEEXT) ftruncate64$(EXEEXT) futex$(EXEEXT) \ - futimesat$(EXEEXT) get_mempolicy$(EXEEXT) getcpu$(EXEEXT) \ - getcwd$(EXEEXT) getdents$(EXEEXT) getdents64$(EXEEXT) \ - getegid$(EXEEXT) getegid32$(EXEEXT) geteuid$(EXEEXT) \ - geteuid32$(EXEEXT) getgid$(EXEEXT) getgid32$(EXEEXT) \ - getgroups$(EXEEXT) getgroups32$(EXEEXT) getpeername$(EXEEXT) \ - getpgrp$(EXEEXT) getrandom$(EXEEXT) getresgid$(EXEEXT) \ - getresgid32$(EXEEXT) getresuid$(EXEEXT) getresuid32$(EXEEXT) \ - getrlimit$(EXEEXT) getrusage$(EXEEXT) getsid$(EXEEXT) \ - getsockname$(EXEEXT) getuid$(EXEEXT) getuid32$(EXEEXT) \ - getxxid$(EXEEXT) inet-cmsg$(EXEEXT) init_module$(EXEEXT) \ - inotify$(EXEEXT) inotify_init1$(EXEEXT) ioctl$(EXEEXT) \ - ioctl_block$(EXEEXT) ioctl_dm$(EXEEXT) ioctl_dm-v$(EXEEXT) \ - ioctl_evdev$(EXEEXT) ioctl_evdev-v$(EXEEXT) \ - ioctl_loop$(EXEEXT) ioctl_loop-nv$(EXEEXT) \ - ioctl_loop-v$(EXEEXT) ioctl_mtd$(EXEEXT) ioctl_rtc$(EXEEXT) \ - ioctl_rtc-v$(EXEEXT) ioctl_scsi$(EXEEXT) \ - ioctl_sg_io_v3$(EXEEXT) ioctl_sg_io_v4$(EXEEXT) \ - ioctl_sock_gifconf$(EXEEXT) ioctl_uffdio$(EXEEXT) \ - ioctl_v4l2$(EXEEXT) ioperm$(EXEEXT) iopl$(EXEEXT) \ - ioprio$(EXEEXT) ip_mreq$(EXEEXT) ipc$(EXEEXT) ipc_msg$(EXEEXT) \ - ipc_msgbuf$(EXEEXT) ipc_sem$(EXEEXT) ipc_shm$(EXEEXT) \ - kcmp$(EXEEXT) kexec_file_load$(EXEEXT) kexec_load$(EXEEXT) \ - keyctl$(EXEEXT) kill$(EXEEXT) ksysent$(EXEEXT) lchown$(EXEEXT) \ - lchown32$(EXEEXT) link$(EXEEXT) linkat$(EXEEXT) \ - llseek$(EXEEXT) lookup_dcookie$(EXEEXT) lseek$(EXEEXT) \ - lstat$(EXEEXT) lstat64$(EXEEXT) mbind$(EXEEXT) \ - membarrier$(EXEEXT) memfd_create$(EXEEXT) \ + fcntl64$(EXEEXT) fdatasync$(EXEEXT) fflush$(EXEEXT) \ + file_handle$(EXEEXT) file_ioctl$(EXEEXT) finit_module$(EXEEXT) \ + flock$(EXEEXT) fstat$(EXEEXT) fstat-Xabbrev$(EXEEXT) \ + fstat-Xraw$(EXEEXT) fstat-Xverbose$(EXEEXT) fstat64$(EXEEXT) \ + fstat64-Xabbrev$(EXEEXT) fstat64-Xraw$(EXEEXT) \ + fstat64-Xverbose$(EXEEXT) fstatat64$(EXEEXT) fstatfs$(EXEEXT) \ + fstatfs64$(EXEEXT) fsync$(EXEEXT) ftruncate$(EXEEXT) \ + ftruncate64$(EXEEXT) futex$(EXEEXT) futimesat$(EXEEXT) \ + get_mempolicy$(EXEEXT) getcpu$(EXEEXT) getcwd$(EXEEXT) \ + getdents$(EXEEXT) getdents64$(EXEEXT) getegid$(EXEEXT) \ + getegid32$(EXEEXT) geteuid$(EXEEXT) geteuid32$(EXEEXT) \ + getgid$(EXEEXT) getgid32$(EXEEXT) getgroups$(EXEEXT) \ + getgroups32$(EXEEXT) getpeername$(EXEEXT) getpgrp$(EXEEXT) \ + getpid$(EXEEXT) getppid$(EXEEXT) getrandom$(EXEEXT) \ + getresgid$(EXEEXT) getresgid32$(EXEEXT) getresuid$(EXEEXT) \ + getresuid32$(EXEEXT) getrlimit$(EXEEXT) getrusage$(EXEEXT) \ + getsid$(EXEEXT) getsockname$(EXEEXT) getuid$(EXEEXT) \ + getuid32$(EXEEXT) getxxid$(EXEEXT) group_req$(EXEEXT) \ + inet-cmsg$(EXEEXT) init_module$(EXEEXT) inotify$(EXEEXT) \ + inotify_init1$(EXEEXT) io_uring_enter$(EXEEXT) \ + io_uring_register$(EXEEXT) io_uring_setup$(EXEEXT) \ + ioctl$(EXEEXT) ioctl_block$(EXEEXT) ioctl_dm$(EXEEXT) \ + ioctl_evdev$(EXEEXT) ioctl_inotify$(EXEEXT) \ + ioctl_kvm_run$(EXEEXT) ioctl_kvm_run-v$(EXEEXT) \ + ioctl_kvm_run_auxstr_vcpu$(EXEEXT) ioctl_loop$(EXEEXT) \ + ioctl_mtd$(EXEEXT) ioctl_nbd$(EXEEXT) ioctl_perf$(EXEEXT) \ + ioctl_ptp$(EXEEXT) ioctl_random$(EXEEXT) ioctl_rtc$(EXEEXT) \ + ioctl_scsi$(EXEEXT) ioctl_sg_io_v3$(EXEEXT) \ + ioctl_sg_io_v4$(EXEEXT) ioctl_sock_gifconf$(EXEEXT) \ + ioctl_uffdio$(EXEEXT) ioctl_v4l2$(EXEEXT) ioperm$(EXEEXT) \ + iopl$(EXEEXT) ioprio$(EXEEXT) ioprio-Xabbrev$(EXEEXT) \ + ioprio-Xraw$(EXEEXT) ioprio-Xverbose$(EXEEXT) ip_mreq$(EXEEXT) \ + ipc$(EXEEXT) ipc_msg$(EXEEXT) ipc_msg-Xabbrev$(EXEEXT) \ + ipc_msg-Xraw$(EXEEXT) ipc_msg-Xverbose$(EXEEXT) \ + ipc_msgbuf$(EXEEXT) ipc_msgbuf-Xabbrev$(EXEEXT) \ + ipc_msgbuf-Xraw$(EXEEXT) ipc_msgbuf-Xverbose$(EXEEXT) \ + ipc_sem$(EXEEXT) ipc_sem-Xabbrev$(EXEEXT) \ + ipc_sem-Xraw$(EXEEXT) ipc_sem-Xverbose$(EXEEXT) \ + ipc_shm$(EXEEXT) ipc_shm-Xabbrev$(EXEEXT) \ + ipc_shm-Xraw$(EXEEXT) ipc_shm-Xverbose$(EXEEXT) kcmp$(EXEEXT) \ + kcmp-y$(EXEEXT) kern_features$(EXEEXT) kernel_version$(EXEEXT) \ + kernel_version-Xabbrev$(EXEEXT) kernel_version-Xraw$(EXEEXT) \ + kernel_version-Xverbose$(EXEEXT) kexec_file_load$(EXEEXT) \ + kexec_load$(EXEEXT) keyctl$(EXEEXT) keyctl-Xabbrev$(EXEEXT) \ + keyctl-Xraw$(EXEEXT) keyctl-Xverbose$(EXEEXT) kill$(EXEEXT) \ + lchown$(EXEEXT) lchown32$(EXEEXT) link$(EXEEXT) \ + linkat$(EXEEXT) llseek$(EXEEXT) lookup_dcookie$(EXEEXT) \ + lseek$(EXEEXT) lstat$(EXEEXT) lstat64$(EXEEXT) \ + madvise$(EXEEXT) mbind$(EXEEXT) membarrier$(EXEEXT) \ + memfd_create$(EXEEXT) memfd_create-Xabbrev$(EXEEXT) \ + memfd_create-Xraw$(EXEEXT) memfd_create-Xverbose$(EXEEXT) \ migrate_pages$(EXEEXT) mincore$(EXEEXT) mkdir$(EXEEXT) \ mkdirat$(EXEEXT) mknod$(EXEEXT) mknodat$(EXEEXT) \ mlock$(EXEEXT) mlock2$(EXEEXT) mlockall$(EXEEXT) mmap$(EXEEXT) \ - mmap64$(EXEEXT) mmsg$(EXEEXT) mmsg-silent$(EXEEXT) \ - mmsg_name$(EXEEXT) mmsg_name-v$(EXEEXT) mount$(EXEEXT) \ - move_pages$(EXEEXT) mq$(EXEEXT) mq_sendrecv$(EXEEXT) \ + mmap-Xabbrev$(EXEEXT) mmap-Xraw$(EXEEXT) \ + mmap-Xverbose$(EXEEXT) mmap64$(EXEEXT) mmap64-Xabbrev$(EXEEXT) \ + mmap64-Xraw$(EXEEXT) mmap64-Xverbose$(EXEEXT) mmsg$(EXEEXT) \ + mmsg_name$(EXEEXT) modify_ldt$(EXEEXT) mount$(EXEEXT) \ + mount-Xabbrev$(EXEEXT) mount-Xraw$(EXEEXT) \ + mount-Xverbose$(EXEEXT) move_pages$(EXEEXT) \ + move_pages-Xabbrev$(EXEEXT) move_pages-Xraw$(EXEEXT) \ + move_pages-Xverbose$(EXEEXT) mq$(EXEEXT) mq_sendrecv$(EXEEXT) \ mq_sendrecv-read$(EXEEXT) mq_sendrecv-write$(EXEEXT) \ - msg_control$(EXEEXT) msg_control-v$(EXEEXT) msg_name$(EXEEXT) \ - munlockall$(EXEEXT) nanosleep$(EXEEXT) \ - net-accept-connect$(EXEEXT) net-icmp_filter$(EXEEXT) \ - net-sockaddr$(EXEEXT) net-y-unix$(EXEEXT) net-yy-inet$(EXEEXT) \ + msg_control$(EXEEXT) msg_name$(EXEEXT) munlockall$(EXEEXT) \ + nanosleep$(EXEEXT) net-icmp_filter$(EXEEXT) \ + net-packet_mreq$(EXEEXT) net-packet_mreq-Xabbrev$(EXEEXT) \ + net-packet_mreq-Xraw$(EXEEXT) \ + net-packet_mreq-Xverbose$(EXEEXT) net-sockaddr$(EXEEXT) \ + net-tpacket_req$(EXEEXT) net-tpacket_stats$(EXEEXT) \ + net-y-unix$(EXEEXT) net-yy-inet$(EXEEXT) net-yy-inet6$(EXEEXT) \ net-yy-netlink$(EXEEXT) net-yy-unix$(EXEEXT) \ - netlink_inet_diag$(EXEEXT) netlink_netlink_diag$(EXEEXT) \ - netlink_protocol$(EXEEXT) netlink_unix_diag$(EXEEXT) \ - newfstatat$(EXEEXT) nsyscalls$(EXEEXT) old_mmap$(EXEEXT) \ - oldfstat$(EXEEXT) oldlstat$(EXEEXT) oldselect$(EXEEXT) \ - oldstat$(EXEEXT) open$(EXEEXT) openat$(EXEEXT) pause$(EXEEXT) \ - pc$(EXEEXT) perf_event_open$(EXEEXT) \ - perf_event_open_nonverbose$(EXEEXT) \ - perf_event_open_unabbrev$(EXEEXT) personality$(EXEEXT) \ + netlink_audit$(EXEEXT) netlink_crypto$(EXEEXT) \ + netlink_generic$(EXEEXT) netlink_kobject_uevent$(EXEEXT) \ + netlink_netfilter$(EXEEXT) netlink_protocol$(EXEEXT) \ + netlink_route$(EXEEXT) netlink_selinux$(EXEEXT) \ + netlink_sock_diag$(EXEEXT) netlink_xfrm$(EXEEXT) \ + newfstatat$(EXEEXT) nfnetlink_acct$(EXEEXT) \ + nfnetlink_cthelper$(EXEEXT) nfnetlink_ctnetlink$(EXEEXT) \ + nfnetlink_ctnetlink_exp$(EXEEXT) nfnetlink_cttimeout$(EXEEXT) \ + nfnetlink_ipset$(EXEEXT) nfnetlink_nft_compat$(EXEEXT) \ + nfnetlink_nftables$(EXEEXT) nfnetlink_osf$(EXEEXT) \ + nfnetlink_queue$(EXEEXT) nfnetlink_ulog$(EXEEXT) \ + nlattr$(EXEEXT) nlattr_br_port_msg$(EXEEXT) \ + nlattr_crypto_user_alg$(EXEEXT) nlattr_dcbmsg$(EXEEXT) \ + nlattr_fib_rule_hdr$(EXEEXT) nlattr_ifaddrlblmsg$(EXEEXT) \ + nlattr_ifaddrmsg$(EXEEXT) nlattr_ifinfomsg$(EXEEXT) \ + nlattr_ifla_af_spec$(EXEEXT) nlattr_ifla_brport$(EXEEXT) \ + nlattr_ifla_linkinfo$(EXEEXT) nlattr_ifla_port$(EXEEXT) \ + nlattr_ifla_xdp$(EXEEXT) nlattr_inet_diag_msg$(EXEEXT) \ + nlattr_inet_diag_req_compat$(EXEEXT) \ + nlattr_inet_diag_req_v2$(EXEEXT) \ + nlattr_mdba_mdb_entry$(EXEEXT) \ + nlattr_mdba_router_port$(EXEEXT) nlattr_ndmsg$(EXEEXT) \ + nlattr_ndtmsg$(EXEEXT) nlattr_netconfmsg$(EXEEXT) \ + nlattr_netlink_diag_msg$(EXEEXT) nlattr_nlmsgerr$(EXEEXT) \ + nlattr_packet_diag_msg$(EXEEXT) nlattr_rtgenmsg$(EXEEXT) \ + nlattr_rtmsg$(EXEEXT) nlattr_smc_diag_msg$(EXEEXT) \ + nlattr_tc_stats$(EXEEXT) nlattr_tca_stab$(EXEEXT) \ + nlattr_tcamsg$(EXEEXT) nlattr_tcmsg$(EXEEXT) \ + nlattr_unix_diag_msg$(EXEEXT) old_mmap$(EXEEXT) \ + old_mmap-P$(EXEEXT) old_mmap-Xabbrev$(EXEEXT) \ + old_mmap-Xraw$(EXEEXT) old_mmap-Xverbose$(EXEEXT) \ + old_mmap-v-none$(EXEEXT) oldfstat$(EXEEXT) oldlstat$(EXEEXT) \ + oldselect$(EXEEXT) oldselect-efault$(EXEEXT) oldstat$(EXEEXT) \ + open$(EXEEXT) openat$(EXEEXT) osf_utimes$(EXEEXT) \ + pause$(EXEEXT) perf_event_open$(EXEEXT) personality$(EXEEXT) \ + personality-Xabbrev$(EXEEXT) personality-Xraw$(EXEEXT) \ + personality-Xverbose$(EXEEXT) pidfd_send_signal$(EXEEXT) \ pipe$(EXEEXT) pipe2$(EXEEXT) pkey_alloc$(EXEEXT) \ pkey_free$(EXEEXT) pkey_mprotect$(EXEEXT) poll$(EXEEXT) \ - ppoll$(EXEEXT) prctl-arg2-intptr$(EXEEXT) \ - prctl-dumpable$(EXEEXT) prctl-name$(EXEEXT) \ - prctl-no-args$(EXEEXT) prctl-pdeathsig$(EXEEXT) \ - prctl-seccomp-filter-v$(EXEEXT) prctl-seccomp-strict$(EXEEXT) \ - prctl-securebits$(EXEEXT) prctl-tid_address$(EXEEXT) \ - prctl-tsc$(EXEEXT) pread64-pwrite64$(EXEEXT) preadv$(EXEEXT) \ + poll-P$(EXEEXT) ppoll$(EXEEXT) ppoll-P$(EXEEXT) \ + prctl-arg2-intptr$(EXEEXT) prctl-dumpable$(EXEEXT) \ + prctl-name$(EXEEXT) prctl-no-args$(EXEEXT) \ + prctl-pdeathsig$(EXEEXT) prctl-securebits$(EXEEXT) \ + prctl-tid_address$(EXEEXT) prctl-tsc$(EXEEXT) \ + pread64-pwrite64$(EXEEXT) preadv$(EXEEXT) \ preadv-pwritev$(EXEEXT) preadv2-pwritev2$(EXEEXT) \ - print_maxfd$(EXEEXT) printstr$(EXEEXT) prlimit64$(EXEEXT) \ + printpath-umovestr$(EXEEXT) \ + printpath-umovestr-peekdata$(EXEEXT) \ + printpath-umovestr-undumpable$(EXEEXT) \ + printsignal-Xabbrev$(EXEEXT) printsignal-Xraw$(EXEEXT) \ + printsignal-Xverbose$(EXEEXT) printstr$(EXEEXT) \ + printstrn-umoven$(EXEEXT) printstrn-umoven-peekdata$(EXEEXT) \ + printstrn-umoven-undumpable$(EXEEXT) prlimit64$(EXEEXT) \ process_vm_readv$(EXEEXT) process_vm_writev$(EXEEXT) \ - pselect6$(EXEEXT) ptrace$(EXEEXT) pwritev$(EXEEXT) \ - qual_fault$(EXEEXT) qual_inject-error-signal$(EXEEXT) \ - qual_inject-retval$(EXEEXT) qual_inject-signal$(EXEEXT) \ - qual_signal$(EXEEXT) quotactl$(EXEEXT) quotactl-v$(EXEEXT) \ - quotactl-xfs$(EXEEXT) quotactl-xfs-v$(EXEEXT) \ - read-write$(EXEEXT) readahead$(EXEEXT) readdir$(EXEEXT) \ - readlink$(EXEEXT) readlinkat$(EXEEXT) readv$(EXEEXT) \ - reboot$(EXEEXT) recvfrom$(EXEEXT) recvmmsg-timeout$(EXEEXT) \ - recvmsg$(EXEEXT) redirect-fds$(EXEEXT) \ - remap_file_pages$(EXEEXT) rename$(EXEEXT) renameat$(EXEEXT) \ - renameat2$(EXEEXT) request_key$(EXEEXT) \ - restart_syscall$(EXEEXT) rmdir$(EXEEXT) rt_sigpending$(EXEEXT) \ + pselect6$(EXEEXT) ptrace$(EXEEXT) ptrace_syscall_info$(EXEEXT) \ + pwritev$(EXEEXT) quotactl$(EXEEXT) quotactl-Xabbrev$(EXEEXT) \ + quotactl-Xraw$(EXEEXT) quotactl-Xverbose$(EXEEXT) \ + quotactl-xfs$(EXEEXT) read-write$(EXEEXT) readahead$(EXEEXT) \ + readdir$(EXEEXT) readlink$(EXEEXT) readlinkat$(EXEEXT) \ + readv$(EXEEXT) reboot$(EXEEXT) recvfrom$(EXEEXT) \ + recvmmsg-timeout$(EXEEXT) recvmsg$(EXEEXT) \ + remap_file_pages$(EXEEXT) remap_file_pages-Xabbrev$(EXEEXT) \ + remap_file_pages-Xraw$(EXEEXT) \ + remap_file_pages-Xverbose$(EXEEXT) rename$(EXEEXT) \ + renameat$(EXEEXT) renameat2$(EXEEXT) request_key$(EXEEXT) \ + riscv_flush_icache$(EXEEXT) rmdir$(EXEEXT) \ + rt_sigaction$(EXEEXT) rt_sigpending$(EXEEXT) \ rt_sigprocmask$(EXEEXT) rt_sigqueueinfo$(EXEEXT) \ - rt_sigsuspend$(EXEEXT) rt_sigtimedwait$(EXEEXT) \ - rt_tgsigqueueinfo$(EXEEXT) sched_get_priority_mxx$(EXEEXT) \ - sched_rr_get_interval$(EXEEXT) sched_xetaffinity$(EXEEXT) \ - sched_xetattr$(EXEEXT) sched_xetparam$(EXEEXT) \ - sched_xetscheduler$(EXEEXT) sched_yield$(EXEEXT) \ - scm_rights$(EXEEXT) seccomp-filter$(EXEEXT) \ - seccomp-filter-v$(EXEEXT) seccomp-strict$(EXEEXT) \ - select$(EXEEXT) semop$(EXEEXT) sendfile$(EXEEXT) \ - sendfile64$(EXEEXT) set_mempolicy$(EXEEXT) \ - set_ptracer_any$(EXEEXT) setdomainname$(EXEEXT) \ + rt_sigreturn$(EXEEXT) rt_sigsuspend$(EXEEXT) \ + rt_sigtimedwait$(EXEEXT) rt_tgsigqueueinfo$(EXEEXT) \ + s390_guarded_storage$(EXEEXT) s390_guarded_storage-v$(EXEEXT) \ + s390_pci_mmio_read_write$(EXEEXT) s390_runtime_instr$(EXEEXT) \ + s390_sthyi$(EXEEXT) s390_sthyi-v$(EXEEXT) \ + sched_get_priority_mxx$(EXEEXT) sched_rr_get_interval$(EXEEXT) \ + sched_xetaffinity$(EXEEXT) sched_xetattr$(EXEEXT) \ + sched_xetparam$(EXEEXT) sched_xetscheduler$(EXEEXT) \ + sched_yield$(EXEEXT) seccomp-filter$(EXEEXT) \ + seccomp_get_action_avail$(EXEEXT) select$(EXEEXT) \ + semop$(EXEEXT) sendfile$(EXEEXT) sendfile64$(EXEEXT) \ + set_mempolicy$(EXEEXT) setdomainname$(EXEEXT) \ setfsgid$(EXEEXT) setfsgid32$(EXEEXT) setfsuid$(EXEEXT) \ setfsuid32$(EXEEXT) setgid$(EXEEXT) setgid32$(EXEEXT) \ setgroups$(EXEEXT) setgroups32$(EXEEXT) sethostname$(EXEEXT) \ setns$(EXEEXT) setregid$(EXEEXT) setregid32$(EXEEXT) \ setresgid$(EXEEXT) setresgid32$(EXEEXT) setresuid$(EXEEXT) \ setresuid32$(EXEEXT) setreuid$(EXEEXT) setreuid32$(EXEEXT) \ - setrlimit$(EXEEXT) setuid$(EXEEXT) setuid32$(EXEEXT) \ - shmxt$(EXEEXT) shutdown$(EXEEXT) sigaction$(EXEEXT) \ - sigaltstack$(EXEEXT) siginfo$(EXEEXT) signal_receive$(EXEEXT) \ - signalfd4$(EXEEXT) sigreturn$(EXEEXT) sleep$(EXEEXT) \ - socketcall$(EXEEXT) splice$(EXEEXT) stack-fcall$(EXEEXT) \ - stat$(EXEEXT) stat64$(EXEEXT) statfs$(EXEEXT) \ - statfs64$(EXEEXT) swap$(EXEEXT) symlink$(EXEEXT) \ - symlinkat$(EXEEXT) sync$(EXEEXT) sync_file_range$(EXEEXT) \ + setrlimit$(EXEEXT) setrlimit-Xabbrev$(EXEEXT) \ + setrlimit-Xraw$(EXEEXT) setrlimit-Xverbose$(EXEEXT) \ + setuid$(EXEEXT) setuid32$(EXEEXT) shmxt$(EXEEXT) \ + shutdown$(EXEEXT) sigaction$(EXEEXT) sigaltstack$(EXEEXT) \ + siginfo$(EXEEXT) signal$(EXEEXT) signalfd4$(EXEEXT) \ + sigpending$(EXEEXT) sigprocmask$(EXEEXT) sigreturn$(EXEEXT) \ + sigsuspend$(EXEEXT) so_error$(EXEEXT) so_linger$(EXEEXT) \ + so_peercred$(EXEEXT) so_peercred-Xabbrev$(EXEEXT) \ + so_peercred-Xraw$(EXEEXT) so_peercred-Xverbose$(EXEEXT) \ + sock_filter-v$(EXEEXT) sock_filter-v-Xabbrev$(EXEEXT) \ + sock_filter-v-Xraw$(EXEEXT) sock_filter-v-Xverbose$(EXEEXT) \ + sockaddr_xlat-Xabbrev$(EXEEXT) sockaddr_xlat-Xraw$(EXEEXT) \ + sockaddr_xlat-Xverbose$(EXEEXT) socketcall$(EXEEXT) \ + sockopt-sol_netlink$(EXEEXT) sockopt-timestamp$(EXEEXT) \ + splice$(EXEEXT) stat$(EXEEXT) stat64$(EXEEXT) statfs$(EXEEXT) \ + statfs64$(EXEEXT) statx$(EXEEXT) swap$(EXEEXT) \ + sxetmask$(EXEEXT) symlink$(EXEEXT) symlinkat$(EXEEXT) \ + sync$(EXEEXT) sync_file_range$(EXEEXT) \ sync_file_range2$(EXEEXT) sysinfo$(EXEEXT) syslog$(EXEEXT) \ - tee$(EXEEXT) threads-execve$(EXEEXT) time$(EXEEXT) \ - timer_create$(EXEEXT) timer_xettime$(EXEEXT) \ - timerfd_xettime$(EXEEXT) times$(EXEEXT) times-fail$(EXEEXT) \ - truncate$(EXEEXT) truncate64$(EXEEXT) ugetrlimit$(EXEEXT) \ - uio$(EXEEXT) umask$(EXEEXT) umount$(EXEEXT) umount2$(EXEEXT) \ - umoven-illptr$(EXEEXT) umovestr$(EXEEXT) \ - umovestr-illptr$(EXEEXT) umovestr2$(EXEEXT) umovestr3$(EXEEXT) \ - uname$(EXEEXT) unix-pair-send-recv$(EXEEXT) \ - unix-pair-sendto-recvfrom$(EXEEXT) unlink$(EXEEXT) \ + tee$(EXEEXT) time$(EXEEXT) timer_create$(EXEEXT) \ + timer_xettime$(EXEEXT) timerfd_xettime$(EXEEXT) times$(EXEEXT) \ + times-fail$(EXEEXT) truncate$(EXEEXT) truncate64$(EXEEXT) \ + ugetrlimit$(EXEEXT) uio$(EXEEXT) umask$(EXEEXT) \ + umount$(EXEEXT) umount2$(EXEEXT) umoven-illptr$(EXEEXT) \ + umovestr$(EXEEXT) umovestr-illptr$(EXEEXT) umovestr2$(EXEEXT) \ + umovestr3$(EXEEXT) uname$(EXEEXT) unlink$(EXEEXT) \ unlinkat$(EXEEXT) unshare$(EXEEXT) userfaultfd$(EXEEXT) \ ustat$(EXEEXT) utime$(EXEEXT) utimensat$(EXEEXT) \ - utimes$(EXEEXT) vfork-f$(EXEEXT) vhangup$(EXEEXT) \ - vmsplice$(EXEEXT) wait4$(EXEEXT) wait4-v$(EXEEXT) \ - waitid$(EXEEXT) waitid-v$(EXEEXT) waitpid$(EXEEXT) \ - xattr$(EXEEXT) xattr-strings$(EXEEXT) xet_robust_list$(EXEEXT) \ + utimensat-Xabbrev$(EXEEXT) utimensat-Xraw$(EXEEXT) \ + utimensat-Xverbose$(EXEEXT) utimes$(EXEEXT) vhangup$(EXEEXT) \ + vmsplice$(EXEEXT) wait4$(EXEEXT) waitid$(EXEEXT) \ + waitpid$(EXEEXT) xattr$(EXEEXT) xattr-strings$(EXEEXT) \ + xet_robust_list$(EXEEXT) xet_thread_area_x86$(EXEEXT) \ xetitimer$(EXEEXT) xetpgid$(EXEEXT) xetpriority$(EXEEXT) \ xettimeofday$(EXEEXT) -TESTS = $(DECODER_TESTS) $(MISC_TESTS) $(am__EXEEXT_1) -DIST_COMMON = $(srcdir)/../scno.am $(srcdir)/Makefile.in \ - $(srcdir)/Makefile.am $(top_srcdir)/depcomp \ - $(top_srcdir)/test-driver -subdir = tests -ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 -am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \ - $(top_srcdir)/m4/ax_prog_cc_for_build.m4 \ - $(top_srcdir)/m4/ax_valgrind_check.m4 \ - $(top_srcdir)/m4/mpers.m4 \ - $(top_srcdir)/m4/st_save_restore_var.m4 \ - $(top_srcdir)/m4/st_warn_cflags.m4 \ - $(top_srcdir)/m4/warnings.m4 $(top_srcdir)/configure.ac -am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ - $(ACLOCAL_M4) -mkinstalldirs = $(install_sh) -d -CONFIG_HEADER = $(top_builddir)/config.h -CONFIG_CLEAN_FILES = -CONFIG_CLEAN_VPATH_FILES = AR = ar ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) @@ -296,26 +392,37 @@ am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libtests_a_AR = $(AR) $(ARFLAGS) libtests_a_LIBADD = -am_libtests_a_OBJECTS = libtests_a-errno2name.$(OBJEXT) \ - libtests_a-error_msg.$(OBJEXT) \ +am_libtests_a_OBJECTS = libtests_a-create_nl_socket.$(OBJEXT) \ + libtests_a-errno2name.$(OBJEXT) libtests_a-error_msg.$(OBJEXT) \ libtests_a-fill_memory.$(OBJEXT) \ libtests_a-get_page_size.$(OBJEXT) \ + libtests_a-get_sigset_size.$(OBJEXT) \ libtests_a-hexdump_strdup.$(OBJEXT) \ libtests_a-hexquote_strndup.$(OBJEXT) \ + libtests_a-ifindex.$(OBJEXT) \ libtests_a-inode_of_sockfd.$(OBJEXT) \ libtests_a-libmmsg.$(OBJEXT) \ libtests_a-libsocketcall.$(OBJEXT) \ libtests_a-overflowuid.$(OBJEXT) \ libtests_a-pipe_maxfd.$(OBJEXT) \ libtests_a-print_quoted_string.$(OBJEXT) \ + libtests_a-print_time.$(OBJEXT) \ libtests_a-printflags.$(OBJEXT) libtests_a-printxval.$(OBJEXT) \ - libtests_a-signal2name.$(OBJEXT) libtests_a-sprintrc.$(OBJEXT) \ - libtests_a-tail_alloc.$(OBJEXT) libtests_a-tprintf.$(OBJEXT) + libtests_a-signal2name.$(OBJEXT) \ + libtests_a-skip_unavailable.$(OBJEXT) \ + libtests_a-sprintrc.$(OBJEXT) libtests_a-tail_alloc.$(OBJEXT) \ + libtests_a-test_printpath.$(OBJEXT) \ + libtests_a-test_printstrn.$(OBJEXT) \ + libtests_a-test_ucopy.$(OBJEXT) libtests_a-tprintf.$(OBJEXT) libtests_a_OBJECTS = $(am_libtests_a_OBJECTS) _newselect_SOURCES = _newselect.c _newselect_OBJECTS = _newselect.$(OBJEXT) _newselect_LDADD = $(LDADD) _newselect_DEPENDENCIES = libtests.a +_newselect_P_SOURCES = _newselect-P.c +_newselect_P_OBJECTS = _newselect-P.$(OBJEXT) +_newselect_P_LDADD = $(LDADD) +_newselect_P_DEPENDENCIES = libtests.a accept_SOURCES = accept.c accept_OBJECTS = accept.$(OBJEXT) accept_LDADD = $(LDADD) @@ -344,6 +451,10 @@ aio_SOURCES = aio.c aio_OBJECTS = aio.$(OBJEXT) aio_LDADD = $(LDADD) aio_DEPENDENCIES = libtests.a +aio_pgetevents_SOURCES = aio_pgetevents.c +aio_pgetevents_OBJECTS = aio_pgetevents.$(OBJEXT) +aio_pgetevents_LDADD = $(LDADD) +aio_pgetevents_DEPENDENCIES = libtests.a alarm_SOURCES = alarm.c alarm_OBJECTS = alarm.$(OBJEXT) alarm_LDADD = $(LDADD) @@ -367,10 +478,45 @@ attach_p_cmd_p_SOURCES = attach-p-cmd-p.c attach_p_cmd_p_OBJECTS = attach-p-cmd-p.$(OBJEXT) attach_p_cmd_p_LDADD = $(LDADD) attach_p_cmd_p_DEPENDENCIES = libtests.a +block_reset_raise_run_SOURCES = block_reset_raise_run.c +block_reset_raise_run_OBJECTS = block_reset_raise_run.$(OBJEXT) +block_reset_raise_run_LDADD = $(LDADD) +block_reset_raise_run_DEPENDENCIES = libtests.a bpf_SOURCES = bpf.c bpf_OBJECTS = bpf.$(OBJEXT) bpf_LDADD = $(LDADD) bpf_DEPENDENCIES = libtests.a +bpf_obj_get_info_by_fd_SOURCES = bpf-obj_get_info_by_fd.c +bpf_obj_get_info_by_fd_OBJECTS = bpf-obj_get_info_by_fd.$(OBJEXT) +bpf_obj_get_info_by_fd_LDADD = $(LDADD) +bpf_obj_get_info_by_fd_DEPENDENCIES = libtests.a +bpf_obj_get_info_by_fd_prog_SOURCES = bpf-obj_get_info_by_fd-prog.c +bpf_obj_get_info_by_fd_prog_OBJECTS = \ + bpf-obj_get_info_by_fd-prog.$(OBJEXT) +bpf_obj_get_info_by_fd_prog_LDADD = $(LDADD) +bpf_obj_get_info_by_fd_prog_DEPENDENCIES = libtests.a +bpf_obj_get_info_by_fd_prog_v_SOURCES = \ + bpf-obj_get_info_by_fd-prog-v.c +bpf_obj_get_info_by_fd_prog_v_OBJECTS = \ + bpf-obj_get_info_by_fd-prog-v.$(OBJEXT) +bpf_obj_get_info_by_fd_prog_v_LDADD = $(LDADD) +bpf_obj_get_info_by_fd_prog_v_DEPENDENCIES = libtests.a +bpf_obj_get_info_by_fd_v_SOURCES = bpf-obj_get_info_by_fd-v.c +bpf_obj_get_info_by_fd_v_OBJECTS = bpf-obj_get_info_by_fd-v.$(OBJEXT) +bpf_obj_get_info_by_fd_v_LDADD = $(LDADD) +bpf_obj_get_info_by_fd_v_DEPENDENCIES = libtests.a +bpf_success_SOURCES = bpf-success.c +bpf_success_OBJECTS = bpf-success.$(OBJEXT) +bpf_success_LDADD = $(LDADD) +bpf_success_DEPENDENCIES = libtests.a +bpf_success_v_SOURCES = bpf-success-v.c +bpf_success_v_OBJECTS = bpf-success-v.$(OBJEXT) +bpf_success_v_LDADD = $(LDADD) +bpf_success_v_DEPENDENCIES = libtests.a +bpf_v_SOURCES = bpf-v.c +bpf_v_OBJECTS = bpf-v.$(OBJEXT) +bpf_v_LDADD = $(LDADD) +bpf_v_DEPENDENCIES = libtests.a brk_SOURCES = brk.c brk_OBJECTS = brk.$(OBJEXT) brk_LDADD = $(LDADD) @@ -387,6 +533,14 @@ caps_abbrev_SOURCES = caps-abbrev.c caps_abbrev_OBJECTS = caps-abbrev.$(OBJEXT) caps_abbrev_LDADD = $(LDADD) caps_abbrev_DEPENDENCIES = libtests.a +check_sigblock_SOURCES = check_sigblock.c +check_sigblock_OBJECTS = check_sigblock.$(OBJEXT) +check_sigblock_LDADD = $(LDADD) +check_sigblock_DEPENDENCIES = libtests.a +check_sigign_SOURCES = check_sigign.c +check_sigign_OBJECTS = check_sigign.$(OBJEXT) +check_sigign_LDADD = $(LDADD) +check_sigign_DEPENDENCIES = libtests.a chmod_SOURCES = chmod.c chmod_OBJECTS = chmod.$(OBJEXT) chmod_LDADD = $(LDADD) @@ -413,7 +567,16 @@ clock_nanosleep_LDADD = $(LDADD) clock_nanosleep_DEPENDENCIES = libtests.a clock_xettime_SOURCES = clock_xettime.c clock_xettime_OBJECTS = clock_xettime.$(OBJEXT) -clock_xettime_DEPENDENCIES = $(LDADD) +clock_xettime_LDADD = $(LDADD) +clock_xettime_DEPENDENCIES = libtests.a +clone_parent_SOURCES = clone_parent.c +clone_parent_OBJECTS = clone_parent.$(OBJEXT) +clone_parent_LDADD = $(LDADD) +clone_parent_DEPENDENCIES = libtests.a +clone_ptrace_SOURCES = clone_ptrace.c +clone_ptrace_OBJECTS = clone_ptrace.$(OBJEXT) +clone_ptrace_LDADD = $(LDADD) +clone_ptrace_DEPENDENCIES = libtests.a copy_file_range_SOURCES = copy_file_range.c copy_file_range_OBJECTS = copy_file_range.$(OBJEXT) copy_file_range_LDADD = $(LDADD) @@ -425,10 +588,18 @@ creat_SOURCES = creat.c creat_OBJECTS = creat.$(OBJEXT) creat_LDADD = $(LDADD) creat_DEPENDENCIES = libtests.a +delay_SOURCES = delay.c +delay_OBJECTS = delay.$(OBJEXT) +am__DEPENDENCIES_1 = +delay_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LDADD) delete_module_SOURCES = delete_module.c delete_module_OBJECTS = delete_module.$(OBJEXT) delete_module_LDADD = $(LDADD) delete_module_DEPENDENCIES = libtests.a +dev_yy_SOURCES = dev-yy.c +dev_yy_OBJECTS = dev-yy.$(OBJEXT) +dev_yy_LDADD = $(LDADD) +dev_yy_DEPENDENCIES = libtests.a dup_SOURCES = dup.c dup_OBJECTS = dup.$(OBJEXT) dup_LDADD = $(LDADD) @@ -509,6 +680,18 @@ fanotify_mark_SOURCES = fanotify_mark.c fanotify_mark_OBJECTS = fanotify_mark.$(OBJEXT) fanotify_mark_LDADD = $(LDADD) fanotify_mark_DEPENDENCIES = libtests.a +fanotify_mark_Xabbrev_SOURCES = fanotify_mark-Xabbrev.c +fanotify_mark_Xabbrev_OBJECTS = fanotify_mark-Xabbrev.$(OBJEXT) +fanotify_mark_Xabbrev_LDADD = $(LDADD) +fanotify_mark_Xabbrev_DEPENDENCIES = libtests.a +fanotify_mark_Xraw_SOURCES = fanotify_mark-Xraw.c +fanotify_mark_Xraw_OBJECTS = fanotify_mark-Xraw.$(OBJEXT) +fanotify_mark_Xraw_LDADD = $(LDADD) +fanotify_mark_Xraw_DEPENDENCIES = libtests.a +fanotify_mark_Xverbose_SOURCES = fanotify_mark-Xverbose.c +fanotify_mark_Xverbose_OBJECTS = fanotify_mark-Xverbose.$(OBJEXT) +fanotify_mark_Xverbose_LDADD = $(LDADD) +fanotify_mark_Xverbose_DEPENDENCIES = libtests.a fchdir_SOURCES = fchdir.c fchdir_OBJECTS = fchdir.$(OBJEXT) fchdir_LDADD = $(LDADD) @@ -545,6 +728,10 @@ fdatasync_SOURCES = fdatasync.c fdatasync_OBJECTS = fdatasync.$(OBJEXT) fdatasync_LDADD = $(LDADD) fdatasync_DEPENDENCIES = libtests.a +fflush_SOURCES = fflush.c +fflush_OBJECTS = fflush.$(OBJEXT) +fflush_LDADD = $(LDADD) +fflush_DEPENDENCIES = libtests.a file_handle_SOURCES = file_handle.c file_handle_OBJECTS = file_handle.$(OBJEXT) file_handle_LDADD = $(LDADD) @@ -572,10 +759,34 @@ fstat_SOURCES = fstat.c fstat_OBJECTS = fstat.$(OBJEXT) fstat_LDADD = $(LDADD) fstat_DEPENDENCIES = libtests.a +fstat_Xabbrev_SOURCES = fstat-Xabbrev.c +fstat_Xabbrev_OBJECTS = fstat-Xabbrev.$(OBJEXT) +fstat_Xabbrev_LDADD = $(LDADD) +fstat_Xabbrev_DEPENDENCIES = libtests.a +fstat_Xraw_SOURCES = fstat-Xraw.c +fstat_Xraw_OBJECTS = fstat-Xraw.$(OBJEXT) +fstat_Xraw_LDADD = $(LDADD) +fstat_Xraw_DEPENDENCIES = libtests.a +fstat_Xverbose_SOURCES = fstat-Xverbose.c +fstat_Xverbose_OBJECTS = fstat-Xverbose.$(OBJEXT) +fstat_Xverbose_LDADD = $(LDADD) +fstat_Xverbose_DEPENDENCIES = libtests.a fstat64_SOURCES = fstat64.c fstat64_OBJECTS = fstat64-fstat64.$(OBJEXT) fstat64_LDADD = $(LDADD) fstat64_DEPENDENCIES = libtests.a +fstat64_Xabbrev_SOURCES = fstat64-Xabbrev.c +fstat64_Xabbrev_OBJECTS = fstat64-Xabbrev.$(OBJEXT) +fstat64_Xabbrev_LDADD = $(LDADD) +fstat64_Xabbrev_DEPENDENCIES = libtests.a +fstat64_Xraw_SOURCES = fstat64-Xraw.c +fstat64_Xraw_OBJECTS = fstat64-Xraw.$(OBJEXT) +fstat64_Xraw_LDADD = $(LDADD) +fstat64_Xraw_DEPENDENCIES = libtests.a +fstat64_Xverbose_SOURCES = fstat64-Xverbose.c +fstat64_Xverbose_OBJECTS = fstat64-Xverbose.$(OBJEXT) +fstat64_Xverbose_LDADD = $(LDADD) +fstat64_Xverbose_DEPENDENCIES = libtests.a fstatat64_SOURCES = fstatat64.c fstatat64_OBJECTS = fstatat64-fstatat64.$(OBJEXT) fstatat64_LDADD = $(LDADD) @@ -592,6 +803,10 @@ fsync_SOURCES = fsync.c fsync_OBJECTS = fsync.$(OBJEXT) fsync_LDADD = $(LDADD) fsync_DEPENDENCIES = libtests.a +fsync_y_SOURCES = fsync-y.c +fsync_y_OBJECTS = fsync-y.$(OBJEXT) +fsync_y_LDADD = $(LDADD) +fsync_y_DEPENDENCIES = libtests.a ftruncate_SOURCES = ftruncate.c ftruncate_OBJECTS = ftruncate.$(OBJEXT) ftruncate_LDADD = $(LDADD) @@ -668,6 +883,14 @@ getpgrp_SOURCES = getpgrp.c getpgrp_OBJECTS = getpgrp.$(OBJEXT) getpgrp_LDADD = $(LDADD) getpgrp_DEPENDENCIES = libtests.a +getpid_SOURCES = getpid.c +getpid_OBJECTS = getpid.$(OBJEXT) +getpid_LDADD = $(LDADD) +getpid_DEPENDENCIES = libtests.a +getppid_SOURCES = getppid.c +getppid_OBJECTS = getppid.$(OBJEXT) +getppid_LDADD = $(LDADD) +getppid_DEPENDENCIES = libtests.a getrandom_SOURCES = getrandom.c getrandom_OBJECTS = getrandom.$(OBJEXT) getrandom_LDADD = $(LDADD) @@ -704,6 +927,10 @@ getsockname_SOURCES = getsockname.c getsockname_OBJECTS = getsockname.$(OBJEXT) getsockname_LDADD = $(LDADD) getsockname_DEPENDENCIES = libtests.a +gettid_SOURCES = gettid.c +gettid_OBJECTS = gettid.$(OBJEXT) +gettid_LDADD = $(LDADD) +gettid_DEPENDENCIES = libtests.a getuid_SOURCES = getuid.c getuid_OBJECTS = getuid.$(OBJEXT) getuid_LDADD = $(LDADD) @@ -716,6 +943,10 @@ getxxid_SOURCES = getxxid.c getxxid_OBJECTS = getxxid.$(OBJEXT) getxxid_LDADD = $(LDADD) getxxid_DEPENDENCIES = libtests.a +group_req_SOURCES = group_req.c +group_req_OBJECTS = group_req.$(OBJEXT) +group_req_LDADD = $(LDADD) +group_req_DEPENDENCIES = libtests.a inet_cmsg_SOURCES = inet-cmsg.c inet_cmsg_OBJECTS = inet-cmsg.$(OBJEXT) inet_cmsg_LDADD = $(LDADD) @@ -724,6 +955,10 @@ init_module_SOURCES = init_module.c init_module_OBJECTS = init_module.$(OBJEXT) init_module_LDADD = $(LDADD) init_module_DEPENDENCIES = libtests.a +inject_nf_SOURCES = inject-nf.c +inject_nf_OBJECTS = inject-nf.$(OBJEXT) +inject_nf_LDADD = $(LDADD) +inject_nf_DEPENDENCIES = libtests.a inotify_SOURCES = inotify.c inotify_OBJECTS = inotify.$(OBJEXT) inotify_LDADD = $(LDADD) @@ -732,6 +967,22 @@ inotify_init1_SOURCES = inotify_init1.c inotify_init1_OBJECTS = inotify_init1.$(OBJEXT) inotify_init1_LDADD = $(LDADD) inotify_init1_DEPENDENCIES = libtests.a +int_0x80_SOURCES = int_0x80.c +int_0x80_OBJECTS = int_0x80.$(OBJEXT) +int_0x80_LDADD = $(LDADD) +int_0x80_DEPENDENCIES = libtests.a +io_uring_enter_SOURCES = io_uring_enter.c +io_uring_enter_OBJECTS = io_uring_enter.$(OBJEXT) +io_uring_enter_LDADD = $(LDADD) +io_uring_enter_DEPENDENCIES = libtests.a +io_uring_register_SOURCES = io_uring_register.c +io_uring_register_OBJECTS = io_uring_register.$(OBJEXT) +io_uring_register_LDADD = $(LDADD) +io_uring_register_DEPENDENCIES = libtests.a +io_uring_setup_SOURCES = io_uring_setup.c +io_uring_setup_OBJECTS = io_uring_setup.$(OBJEXT) +io_uring_setup_LDADD = $(LDADD) +io_uring_setup_DEPENDENCIES = libtests.a ioctl_SOURCES = ioctl.c ioctl_OBJECTS = ioctl.$(OBJEXT) ioctl_LDADD = $(LDADD) @@ -752,10 +1003,35 @@ ioctl_evdev_SOURCES = ioctl_evdev.c ioctl_evdev_OBJECTS = ioctl_evdev.$(OBJEXT) ioctl_evdev_LDADD = $(LDADD) ioctl_evdev_DEPENDENCIES = libtests.a +ioctl_evdev_success_SOURCES = ioctl_evdev-success.c +ioctl_evdev_success_OBJECTS = ioctl_evdev-success.$(OBJEXT) +ioctl_evdev_success_LDADD = $(LDADD) +ioctl_evdev_success_DEPENDENCIES = libtests.a +ioctl_evdev_success_v_SOURCES = ioctl_evdev-success-v.c +ioctl_evdev_success_v_OBJECTS = ioctl_evdev-success-v.$(OBJEXT) +ioctl_evdev_success_v_LDADD = $(LDADD) +ioctl_evdev_success_v_DEPENDENCIES = libtests.a ioctl_evdev_v_SOURCES = ioctl_evdev-v.c ioctl_evdev_v_OBJECTS = ioctl_evdev-v.$(OBJEXT) ioctl_evdev_v_LDADD = $(LDADD) ioctl_evdev_v_DEPENDENCIES = libtests.a +ioctl_inotify_SOURCES = ioctl_inotify.c +ioctl_inotify_OBJECTS = ioctl_inotify.$(OBJEXT) +ioctl_inotify_LDADD = $(LDADD) +ioctl_inotify_DEPENDENCIES = libtests.a +ioctl_kvm_run_SOURCES = ioctl_kvm_run.c +ioctl_kvm_run_OBJECTS = ioctl_kvm_run.$(OBJEXT) +ioctl_kvm_run_LDADD = $(LDADD) +ioctl_kvm_run_DEPENDENCIES = libtests.a +ioctl_kvm_run_v_SOURCES = ioctl_kvm_run-v.c +ioctl_kvm_run_v_OBJECTS = ioctl_kvm_run-v.$(OBJEXT) +ioctl_kvm_run_v_LDADD = $(LDADD) +ioctl_kvm_run_v_DEPENDENCIES = libtests.a +ioctl_kvm_run_auxstr_vcpu_SOURCES = ioctl_kvm_run_auxstr_vcpu.c +ioctl_kvm_run_auxstr_vcpu_OBJECTS = \ + ioctl_kvm_run_auxstr_vcpu.$(OBJEXT) +ioctl_kvm_run_auxstr_vcpu_LDADD = $(LDADD) +ioctl_kvm_run_auxstr_vcpu_DEPENDENCIES = libtests.a ioctl_loop_SOURCES = ioctl_loop.c ioctl_loop_OBJECTS = ioctl_loop.$(OBJEXT) ioctl_loop_LDADD = $(LDADD) @@ -772,6 +1048,30 @@ ioctl_mtd_SOURCES = ioctl_mtd.c ioctl_mtd_OBJECTS = ioctl_mtd.$(OBJEXT) ioctl_mtd_LDADD = $(LDADD) ioctl_mtd_DEPENDENCIES = libtests.a +ioctl_nbd_SOURCES = ioctl_nbd.c +ioctl_nbd_OBJECTS = ioctl_nbd.$(OBJEXT) +ioctl_nbd_LDADD = $(LDADD) +ioctl_nbd_DEPENDENCIES = libtests.a +ioctl_nsfs_SOURCES = ioctl_nsfs.c +ioctl_nsfs_OBJECTS = ioctl_nsfs.$(OBJEXT) +ioctl_nsfs_LDADD = $(LDADD) +ioctl_nsfs_DEPENDENCIES = libtests.a +ioctl_perf_SOURCES = ioctl_perf.c +ioctl_perf_OBJECTS = ioctl_perf.$(OBJEXT) +ioctl_perf_LDADD = $(LDADD) +ioctl_perf_DEPENDENCIES = libtests.a +ioctl_perf_success_SOURCES = ioctl_perf-success.c +ioctl_perf_success_OBJECTS = ioctl_perf-success.$(OBJEXT) +ioctl_perf_success_LDADD = $(LDADD) +ioctl_perf_success_DEPENDENCIES = libtests.a +ioctl_ptp_SOURCES = ioctl_ptp.c +ioctl_ptp_OBJECTS = ioctl_ptp.$(OBJEXT) +ioctl_ptp_LDADD = $(LDADD) +ioctl_ptp_DEPENDENCIES = libtests.a +ioctl_random_SOURCES = ioctl_random.c +ioctl_random_OBJECTS = ioctl_random.$(OBJEXT) +ioctl_random_LDADD = $(LDADD) +ioctl_random_DEPENDENCIES = libtests.a ioctl_rtc_SOURCES = ioctl_rtc.c ioctl_rtc_OBJECTS = ioctl_rtc.$(OBJEXT) ioctl_rtc_LDADD = $(LDADD) @@ -816,6 +1116,18 @@ ioprio_SOURCES = ioprio.c ioprio_OBJECTS = ioprio.$(OBJEXT) ioprio_LDADD = $(LDADD) ioprio_DEPENDENCIES = libtests.a +ioprio_Xabbrev_SOURCES = ioprio-Xabbrev.c +ioprio_Xabbrev_OBJECTS = ioprio-Xabbrev.$(OBJEXT) +ioprio_Xabbrev_LDADD = $(LDADD) +ioprio_Xabbrev_DEPENDENCIES = libtests.a +ioprio_Xraw_SOURCES = ioprio-Xraw.c +ioprio_Xraw_OBJECTS = ioprio-Xraw.$(OBJEXT) +ioprio_Xraw_LDADD = $(LDADD) +ioprio_Xraw_DEPENDENCIES = libtests.a +ioprio_Xverbose_SOURCES = ioprio-Xverbose.c +ioprio_Xverbose_OBJECTS = ioprio-Xverbose.$(OBJEXT) +ioprio_Xverbose_LDADD = $(LDADD) +ioprio_Xverbose_DEPENDENCIES = libtests.a ip_mreq_SOURCES = ip_mreq.c ip_mreq_OBJECTS = ip_mreq.$(OBJEXT) ip_mreq_LDADD = $(LDADD) @@ -828,22 +1140,98 @@ ipc_msg_SOURCES = ipc_msg.c ipc_msg_OBJECTS = ipc_msg.$(OBJEXT) ipc_msg_LDADD = $(LDADD) ipc_msg_DEPENDENCIES = libtests.a +ipc_msg_Xabbrev_SOURCES = ipc_msg-Xabbrev.c +ipc_msg_Xabbrev_OBJECTS = ipc_msg-Xabbrev.$(OBJEXT) +ipc_msg_Xabbrev_LDADD = $(LDADD) +ipc_msg_Xabbrev_DEPENDENCIES = libtests.a +ipc_msg_Xraw_SOURCES = ipc_msg-Xraw.c +ipc_msg_Xraw_OBJECTS = ipc_msg-Xraw.$(OBJEXT) +ipc_msg_Xraw_LDADD = $(LDADD) +ipc_msg_Xraw_DEPENDENCIES = libtests.a +ipc_msg_Xverbose_SOURCES = ipc_msg-Xverbose.c +ipc_msg_Xverbose_OBJECTS = ipc_msg-Xverbose.$(OBJEXT) +ipc_msg_Xverbose_LDADD = $(LDADD) +ipc_msg_Xverbose_DEPENDENCIES = libtests.a ipc_msgbuf_SOURCES = ipc_msgbuf.c ipc_msgbuf_OBJECTS = ipc_msgbuf.$(OBJEXT) ipc_msgbuf_LDADD = $(LDADD) ipc_msgbuf_DEPENDENCIES = libtests.a +ipc_msgbuf_Xabbrev_SOURCES = ipc_msgbuf-Xabbrev.c +ipc_msgbuf_Xabbrev_OBJECTS = ipc_msgbuf-Xabbrev.$(OBJEXT) +ipc_msgbuf_Xabbrev_LDADD = $(LDADD) +ipc_msgbuf_Xabbrev_DEPENDENCIES = libtests.a +ipc_msgbuf_Xraw_SOURCES = ipc_msgbuf-Xraw.c +ipc_msgbuf_Xraw_OBJECTS = ipc_msgbuf-Xraw.$(OBJEXT) +ipc_msgbuf_Xraw_LDADD = $(LDADD) +ipc_msgbuf_Xraw_DEPENDENCIES = libtests.a +ipc_msgbuf_Xverbose_SOURCES = ipc_msgbuf-Xverbose.c +ipc_msgbuf_Xverbose_OBJECTS = ipc_msgbuf-Xverbose.$(OBJEXT) +ipc_msgbuf_Xverbose_LDADD = $(LDADD) +ipc_msgbuf_Xverbose_DEPENDENCIES = libtests.a ipc_sem_SOURCES = ipc_sem.c ipc_sem_OBJECTS = ipc_sem.$(OBJEXT) ipc_sem_LDADD = $(LDADD) ipc_sem_DEPENDENCIES = libtests.a +ipc_sem_Xabbrev_SOURCES = ipc_sem-Xabbrev.c +ipc_sem_Xabbrev_OBJECTS = ipc_sem-Xabbrev.$(OBJEXT) +ipc_sem_Xabbrev_LDADD = $(LDADD) +ipc_sem_Xabbrev_DEPENDENCIES = libtests.a +ipc_sem_Xraw_SOURCES = ipc_sem-Xraw.c +ipc_sem_Xraw_OBJECTS = ipc_sem-Xraw.$(OBJEXT) +ipc_sem_Xraw_LDADD = $(LDADD) +ipc_sem_Xraw_DEPENDENCIES = libtests.a +ipc_sem_Xverbose_SOURCES = ipc_sem-Xverbose.c +ipc_sem_Xverbose_OBJECTS = ipc_sem-Xverbose.$(OBJEXT) +ipc_sem_Xverbose_LDADD = $(LDADD) +ipc_sem_Xverbose_DEPENDENCIES = libtests.a ipc_shm_SOURCES = ipc_shm.c ipc_shm_OBJECTS = ipc_shm.$(OBJEXT) ipc_shm_LDADD = $(LDADD) ipc_shm_DEPENDENCIES = libtests.a +ipc_shm_Xabbrev_SOURCES = ipc_shm-Xabbrev.c +ipc_shm_Xabbrev_OBJECTS = ipc_shm-Xabbrev.$(OBJEXT) +ipc_shm_Xabbrev_LDADD = $(LDADD) +ipc_shm_Xabbrev_DEPENDENCIES = libtests.a +ipc_shm_Xraw_SOURCES = ipc_shm-Xraw.c +ipc_shm_Xraw_OBJECTS = ipc_shm-Xraw.$(OBJEXT) +ipc_shm_Xraw_LDADD = $(LDADD) +ipc_shm_Xraw_DEPENDENCIES = libtests.a +ipc_shm_Xverbose_SOURCES = ipc_shm-Xverbose.c +ipc_shm_Xverbose_OBJECTS = ipc_shm-Xverbose.$(OBJEXT) +ipc_shm_Xverbose_LDADD = $(LDADD) +ipc_shm_Xverbose_DEPENDENCIES = libtests.a +is_linux_mips_n64_SOURCES = is_linux_mips_n64.c +is_linux_mips_n64_OBJECTS = is_linux_mips_n64.$(OBJEXT) +is_linux_mips_n64_LDADD = $(LDADD) +is_linux_mips_n64_DEPENDENCIES = libtests.a kcmp_SOURCES = kcmp.c kcmp_OBJECTS = kcmp.$(OBJEXT) kcmp_LDADD = $(LDADD) kcmp_DEPENDENCIES = libtests.a +kcmp_y_SOURCES = kcmp-y.c +kcmp_y_OBJECTS = kcmp-y.$(OBJEXT) +kcmp_y_LDADD = $(LDADD) +kcmp_y_DEPENDENCIES = libtests.a +kern_features_SOURCES = kern_features.c +kern_features_OBJECTS = kern_features.$(OBJEXT) +kern_features_LDADD = $(LDADD) +kern_features_DEPENDENCIES = libtests.a +kernel_version_SOURCES = kernel_version.c +kernel_version_OBJECTS = kernel_version.$(OBJEXT) +kernel_version_LDADD = $(LDADD) +kernel_version_DEPENDENCIES = libtests.a +kernel_version_Xabbrev_SOURCES = kernel_version-Xabbrev.c +kernel_version_Xabbrev_OBJECTS = kernel_version-Xabbrev.$(OBJEXT) +kernel_version_Xabbrev_LDADD = $(LDADD) +kernel_version_Xabbrev_DEPENDENCIES = libtests.a +kernel_version_Xraw_SOURCES = kernel_version-Xraw.c +kernel_version_Xraw_OBJECTS = kernel_version-Xraw.$(OBJEXT) +kernel_version_Xraw_LDADD = $(LDADD) +kernel_version_Xraw_DEPENDENCIES = libtests.a +kernel_version_Xverbose_SOURCES = kernel_version-Xverbose.c +kernel_version_Xverbose_OBJECTS = kernel_version-Xverbose.$(OBJEXT) +kernel_version_Xverbose_LDADD = $(LDADD) +kernel_version_Xverbose_DEPENDENCIES = libtests.a kexec_file_load_SOURCES = kexec_file_load.c kexec_file_load_OBJECTS = kexec_file_load.$(OBJEXT) kexec_file_load_LDADD = $(LDADD) @@ -856,10 +1244,26 @@ keyctl_SOURCES = keyctl.c keyctl_OBJECTS = keyctl.$(OBJEXT) keyctl_LDADD = $(LDADD) keyctl_DEPENDENCIES = libtests.a +keyctl_Xabbrev_SOURCES = keyctl-Xabbrev.c +keyctl_Xabbrev_OBJECTS = keyctl-Xabbrev.$(OBJEXT) +keyctl_Xabbrev_LDADD = $(LDADD) +keyctl_Xabbrev_DEPENDENCIES = libtests.a +keyctl_Xraw_SOURCES = keyctl-Xraw.c +keyctl_Xraw_OBJECTS = keyctl-Xraw.$(OBJEXT) +keyctl_Xraw_LDADD = $(LDADD) +keyctl_Xraw_DEPENDENCIES = libtests.a +keyctl_Xverbose_SOURCES = keyctl-Xverbose.c +keyctl_Xverbose_OBJECTS = keyctl-Xverbose.$(OBJEXT) +keyctl_Xverbose_LDADD = $(LDADD) +keyctl_Xverbose_DEPENDENCIES = libtests.a kill_SOURCES = kill.c kill_OBJECTS = kill.$(OBJEXT) kill_LDADD = $(LDADD) kill_DEPENDENCIES = libtests.a +kill_child_SOURCES = kill_child.c +kill_child_OBJECTS = kill_child.$(OBJEXT) +kill_child_LDADD = $(LDADD) +kill_child_DEPENDENCIES = libtests.a ksysent_SOURCES = ksysent.c ksysent_OBJECTS = ksysent.$(OBJEXT) ksysent_LDADD = $(LDADD) @@ -880,14 +1284,24 @@ linkat_SOURCES = linkat.c linkat_OBJECTS = linkat.$(OBJEXT) linkat_LDADD = $(LDADD) linkat_DEPENDENCIES = libtests.a +list_sigaction_signum_SOURCES = list_sigaction_signum.c +list_sigaction_signum_OBJECTS = list_sigaction_signum.$(OBJEXT) +list_sigaction_signum_LDADD = $(LDADD) +list_sigaction_signum_DEPENDENCIES = libtests.a llseek_SOURCES = llseek.c llseek_OBJECTS = llseek.$(OBJEXT) llseek_LDADD = $(LDADD) llseek_DEPENDENCIES = libtests.a +localtime_SOURCES = localtime.c +localtime_OBJECTS = localtime.$(OBJEXT) +localtime_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LDADD) lookup_dcookie_SOURCES = lookup_dcookie.c lookup_dcookie_OBJECTS = lookup_dcookie.$(OBJEXT) lookup_dcookie_LDADD = $(LDADD) lookup_dcookie_DEPENDENCIES = libtests.a +looping_threads_SOURCES = looping_threads.c +looping_threads_OBJECTS = looping_threads.$(OBJEXT) +looping_threads_DEPENDENCIES = $(LDADD) lseek_SOURCES = lseek.c lseek_OBJECTS = lseek.$(OBJEXT) lseek_LDADD = $(LDADD) @@ -900,6 +1314,10 @@ lstat64_SOURCES = lstat64.c lstat64_OBJECTS = lstat64-lstat64.$(OBJEXT) lstat64_LDADD = $(LDADD) lstat64_DEPENDENCIES = libtests.a +madvise_SOURCES = madvise.c +madvise_OBJECTS = madvise.$(OBJEXT) +madvise_LDADD = $(LDADD) +madvise_DEPENDENCIES = libtests.a mbind_SOURCES = mbind.c mbind_OBJECTS = mbind.$(OBJEXT) mbind_LDADD = $(LDADD) @@ -912,6 +1330,18 @@ memfd_create_SOURCES = memfd_create.c memfd_create_OBJECTS = memfd_create.$(OBJEXT) memfd_create_LDADD = $(LDADD) memfd_create_DEPENDENCIES = libtests.a +memfd_create_Xabbrev_SOURCES = memfd_create-Xabbrev.c +memfd_create_Xabbrev_OBJECTS = memfd_create-Xabbrev.$(OBJEXT) +memfd_create_Xabbrev_LDADD = $(LDADD) +memfd_create_Xabbrev_DEPENDENCIES = libtests.a +memfd_create_Xraw_SOURCES = memfd_create-Xraw.c +memfd_create_Xraw_OBJECTS = memfd_create-Xraw.$(OBJEXT) +memfd_create_Xraw_LDADD = $(LDADD) +memfd_create_Xraw_DEPENDENCIES = libtests.a +memfd_create_Xverbose_SOURCES = memfd_create-Xverbose.c +memfd_create_Xverbose_OBJECTS = memfd_create-Xverbose.$(OBJEXT) +memfd_create_Xverbose_LDADD = $(LDADD) +memfd_create_Xverbose_DEPENDENCIES = libtests.a migrate_pages_SOURCES = migrate_pages.c migrate_pages_OBJECTS = migrate_pages.$(OBJEXT) migrate_pages_LDADD = $(LDADD) @@ -952,10 +1382,34 @@ mmap_SOURCES = mmap.c mmap_OBJECTS = mmap.$(OBJEXT) mmap_LDADD = $(LDADD) mmap_DEPENDENCIES = libtests.a +mmap_Xabbrev_SOURCES = mmap-Xabbrev.c +mmap_Xabbrev_OBJECTS = mmap-Xabbrev.$(OBJEXT) +mmap_Xabbrev_LDADD = $(LDADD) +mmap_Xabbrev_DEPENDENCIES = libtests.a +mmap_Xraw_SOURCES = mmap-Xraw.c +mmap_Xraw_OBJECTS = mmap-Xraw.$(OBJEXT) +mmap_Xraw_LDADD = $(LDADD) +mmap_Xraw_DEPENDENCIES = libtests.a +mmap_Xverbose_SOURCES = mmap-Xverbose.c +mmap_Xverbose_OBJECTS = mmap-Xverbose.$(OBJEXT) +mmap_Xverbose_LDADD = $(LDADD) +mmap_Xverbose_DEPENDENCIES = libtests.a mmap64_SOURCES = mmap64.c mmap64_OBJECTS = mmap64-mmap64.$(OBJEXT) mmap64_LDADD = $(LDADD) mmap64_DEPENDENCIES = libtests.a +mmap64_Xabbrev_SOURCES = mmap64-Xabbrev.c +mmap64_Xabbrev_OBJECTS = mmap64_Xabbrev-mmap64-Xabbrev.$(OBJEXT) +mmap64_Xabbrev_LDADD = $(LDADD) +mmap64_Xabbrev_DEPENDENCIES = libtests.a +mmap64_Xraw_SOURCES = mmap64-Xraw.c +mmap64_Xraw_OBJECTS = mmap64_Xraw-mmap64-Xraw.$(OBJEXT) +mmap64_Xraw_LDADD = $(LDADD) +mmap64_Xraw_DEPENDENCIES = libtests.a +mmap64_Xverbose_SOURCES = mmap64-Xverbose.c +mmap64_Xverbose_OBJECTS = mmap64_Xverbose-mmap64-Xverbose.$(OBJEXT) +mmap64_Xverbose_LDADD = $(LDADD) +mmap64_Xverbose_DEPENDENCIES = libtests.a mmsg_SOURCES = mmsg.c mmsg_OBJECTS = mmsg.$(OBJEXT) mmsg_LDADD = $(LDADD) @@ -972,26 +1426,57 @@ mmsg_name_v_SOURCES = mmsg_name-v.c mmsg_name_v_OBJECTS = mmsg_name-v.$(OBJEXT) mmsg_name_v_LDADD = $(LDADD) mmsg_name_v_DEPENDENCIES = libtests.a +modify_ldt_SOURCES = modify_ldt.c +modify_ldt_OBJECTS = modify_ldt.$(OBJEXT) +modify_ldt_LDADD = $(LDADD) +modify_ldt_DEPENDENCIES = libtests.a mount_SOURCES = mount.c mount_OBJECTS = mount.$(OBJEXT) mount_LDADD = $(LDADD) mount_DEPENDENCIES = libtests.a +mount_Xabbrev_SOURCES = mount-Xabbrev.c +mount_Xabbrev_OBJECTS = mount-Xabbrev.$(OBJEXT) +mount_Xabbrev_LDADD = $(LDADD) +mount_Xabbrev_DEPENDENCIES = libtests.a +mount_Xraw_SOURCES = mount-Xraw.c +mount_Xraw_OBJECTS = mount-Xraw.$(OBJEXT) +mount_Xraw_LDADD = $(LDADD) +mount_Xraw_DEPENDENCIES = libtests.a +mount_Xverbose_SOURCES = mount-Xverbose.c +mount_Xverbose_OBJECTS = mount-Xverbose.$(OBJEXT) +mount_Xverbose_LDADD = $(LDADD) +mount_Xverbose_DEPENDENCIES = libtests.a move_pages_SOURCES = move_pages.c move_pages_OBJECTS = move_pages.$(OBJEXT) move_pages_LDADD = $(LDADD) move_pages_DEPENDENCIES = libtests.a +move_pages_Xabbrev_SOURCES = move_pages-Xabbrev.c +move_pages_Xabbrev_OBJECTS = move_pages-Xabbrev.$(OBJEXT) +move_pages_Xabbrev_LDADD = $(LDADD) +move_pages_Xabbrev_DEPENDENCIES = libtests.a +move_pages_Xraw_SOURCES = move_pages-Xraw.c +move_pages_Xraw_OBJECTS = move_pages-Xraw.$(OBJEXT) +move_pages_Xraw_LDADD = $(LDADD) +move_pages_Xraw_DEPENDENCIES = libtests.a +move_pages_Xverbose_SOURCES = move_pages-Xverbose.c +move_pages_Xverbose_OBJECTS = move_pages-Xverbose.$(OBJEXT) +move_pages_Xverbose_LDADD = $(LDADD) +move_pages_Xverbose_DEPENDENCIES = libtests.a mq_SOURCES = mq.c mq_OBJECTS = mq.$(OBJEXT) -mq_DEPENDENCIES = $(LDADD) +mq_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LDADD) mq_sendrecv_SOURCES = mq_sendrecv.c mq_sendrecv_OBJECTS = mq_sendrecv.$(OBJEXT) -mq_sendrecv_DEPENDENCIES = $(LDADD) +mq_sendrecv_LDADD = $(LDADD) +mq_sendrecv_DEPENDENCIES = libtests.a mq_sendrecv_read_SOURCES = mq_sendrecv-read.c mq_sendrecv_read_OBJECTS = mq_sendrecv-read.$(OBJEXT) -mq_sendrecv_read_DEPENDENCIES = $(LDADD) +mq_sendrecv_read_LDADD = $(LDADD) +mq_sendrecv_read_DEPENDENCIES = libtests.a mq_sendrecv_write_SOURCES = mq_sendrecv-write.c mq_sendrecv_write_OBJECTS = mq_sendrecv-write.$(OBJEXT) -mq_sendrecv_write_DEPENDENCIES = $(LDADD) +mq_sendrecv_write_LDADD = $(LDADD) +mq_sendrecv_write_DEPENDENCIES = libtests.a msg_control_SOURCES = msg_control.c msg_control_OBJECTS = msg_control.$(OBJEXT) msg_control_LDADD = $(LDADD) @@ -1020,10 +1505,39 @@ net_icmp_filter_SOURCES = net-icmp_filter.c net_icmp_filter_OBJECTS = net-icmp_filter.$(OBJEXT) net_icmp_filter_LDADD = $(LDADD) net_icmp_filter_DEPENDENCIES = libtests.a +net_packet_mreq_SOURCES = net-packet_mreq.c +net_packet_mreq_OBJECTS = net-packet_mreq.$(OBJEXT) +net_packet_mreq_LDADD = $(LDADD) +net_packet_mreq_DEPENDENCIES = libtests.a +net_packet_mreq_Xabbrev_SOURCES = net-packet_mreq-Xabbrev.c +net_packet_mreq_Xabbrev_OBJECTS = net-packet_mreq-Xabbrev.$(OBJEXT) +net_packet_mreq_Xabbrev_LDADD = $(LDADD) +net_packet_mreq_Xabbrev_DEPENDENCIES = libtests.a +net_packet_mreq_Xraw_SOURCES = net-packet_mreq-Xraw.c +net_packet_mreq_Xraw_OBJECTS = net-packet_mreq-Xraw.$(OBJEXT) +net_packet_mreq_Xraw_LDADD = $(LDADD) +net_packet_mreq_Xraw_DEPENDENCIES = libtests.a +net_packet_mreq_Xverbose_SOURCES = net-packet_mreq-Xverbose.c +net_packet_mreq_Xverbose_OBJECTS = net-packet_mreq-Xverbose.$(OBJEXT) +net_packet_mreq_Xverbose_LDADD = $(LDADD) +net_packet_mreq_Xverbose_DEPENDENCIES = libtests.a net_sockaddr_SOURCES = net-sockaddr.c net_sockaddr_OBJECTS = net-sockaddr.$(OBJEXT) net_sockaddr_LDADD = $(LDADD) net_sockaddr_DEPENDENCIES = libtests.a +net_tpacket_req_SOURCES = net-tpacket_req.c +net_tpacket_req_OBJECTS = net-tpacket_req.$(OBJEXT) +net_tpacket_req_LDADD = $(LDADD) +net_tpacket_req_DEPENDENCIES = libtests.a +net_tpacket_stats_SOURCES = net-tpacket_stats.c +net_tpacket_stats_OBJECTS = net-tpacket_stats.$(OBJEXT) +net_tpacket_stats_LDADD = $(LDADD) +net_tpacket_stats_DEPENDENCIES = libtests.a +net_tpacket_stats_success_SOURCES = net-tpacket_stats-success.c +net_tpacket_stats_success_OBJECTS = \ + net-tpacket_stats-success.$(OBJEXT) +net_tpacket_stats_success_LDADD = $(LDADD) +net_tpacket_stats_success_DEPENDENCIES = libtests.a net_y_unix_SOURCES = net-y-unix.c net_y_unix_OBJECTS = net-y-unix.$(OBJEXT) net_y_unix_LDADD = $(LDADD) @@ -1032,6 +1546,10 @@ net_yy_inet_SOURCES = net-yy-inet.c net_yy_inet_OBJECTS = net-yy-inet.$(OBJEXT) net_yy_inet_LDADD = $(LDADD) net_yy_inet_DEPENDENCIES = libtests.a +net_yy_inet6_SOURCES = net-yy-inet6.c +net_yy_inet6_OBJECTS = net-yy-inet6.$(OBJEXT) +net_yy_inet6_LDADD = $(LDADD) +net_yy_inet6_DEPENDENCIES = libtests.a net_yy_netlink_SOURCES = net-yy-netlink.c net_yy_netlink_OBJECTS = net-yy-netlink.$(OBJEXT) net_yy_netlink_LDADD = $(LDADD) @@ -1040,10 +1558,30 @@ net_yy_unix_SOURCES = net-yy-unix.c net_yy_unix_OBJECTS = net-yy-unix.$(OBJEXT) net_yy_unix_LDADD = $(LDADD) net_yy_unix_DEPENDENCIES = libtests.a +netlink_audit_SOURCES = netlink_audit.c +netlink_audit_OBJECTS = netlink_audit.$(OBJEXT) +netlink_audit_LDADD = $(LDADD) +netlink_audit_DEPENDENCIES = libtests.a +netlink_crypto_SOURCES = netlink_crypto.c +netlink_crypto_OBJECTS = netlink_crypto.$(OBJEXT) +netlink_crypto_LDADD = $(LDADD) +netlink_crypto_DEPENDENCIES = libtests.a +netlink_generic_SOURCES = netlink_generic.c +netlink_generic_OBJECTS = netlink_generic.$(OBJEXT) +netlink_generic_LDADD = $(LDADD) +netlink_generic_DEPENDENCIES = libtests.a netlink_inet_diag_SOURCES = netlink_inet_diag.c netlink_inet_diag_OBJECTS = netlink_inet_diag.$(OBJEXT) netlink_inet_diag_LDADD = $(LDADD) netlink_inet_diag_DEPENDENCIES = libtests.a +netlink_kobject_uevent_SOURCES = netlink_kobject_uevent.c +netlink_kobject_uevent_OBJECTS = netlink_kobject_uevent.$(OBJEXT) +netlink_kobject_uevent_LDADD = $(LDADD) +netlink_kobject_uevent_DEPENDENCIES = libtests.a +netlink_netfilter_SOURCES = netlink_netfilter.c +netlink_netfilter_OBJECTS = netlink_netfilter.$(OBJEXT) +netlink_netfilter_LDADD = $(LDADD) +netlink_netfilter_DEPENDENCIES = libtests.a netlink_netlink_diag_SOURCES = netlink_netlink_diag.c netlink_netlink_diag_OBJECTS = netlink_netlink_diag.$(OBJEXT) netlink_netlink_diag_LDADD = $(LDADD) @@ -1052,22 +1590,235 @@ netlink_protocol_SOURCES = netlink_protocol.c netlink_protocol_OBJECTS = netlink_protocol.$(OBJEXT) netlink_protocol_LDADD = $(LDADD) netlink_protocol_DEPENDENCIES = libtests.a +netlink_route_SOURCES = netlink_route.c +netlink_route_OBJECTS = netlink_route.$(OBJEXT) +netlink_route_LDADD = $(LDADD) +netlink_route_DEPENDENCIES = libtests.a +netlink_selinux_SOURCES = netlink_selinux.c +netlink_selinux_OBJECTS = netlink_selinux.$(OBJEXT) +netlink_selinux_LDADD = $(LDADD) +netlink_selinux_DEPENDENCIES = libtests.a +netlink_sock_diag_SOURCES = netlink_sock_diag.c +netlink_sock_diag_OBJECTS = netlink_sock_diag.$(OBJEXT) +netlink_sock_diag_LDADD = $(LDADD) +netlink_sock_diag_DEPENDENCIES = libtests.a netlink_unix_diag_SOURCES = netlink_unix_diag.c netlink_unix_diag_OBJECTS = netlink_unix_diag.$(OBJEXT) netlink_unix_diag_LDADD = $(LDADD) netlink_unix_diag_DEPENDENCIES = libtests.a +netlink_xfrm_SOURCES = netlink_xfrm.c +netlink_xfrm_OBJECTS = netlink_xfrm.$(OBJEXT) +netlink_xfrm_LDADD = $(LDADD) +netlink_xfrm_DEPENDENCIES = libtests.a newfstatat_SOURCES = newfstatat.c newfstatat_OBJECTS = newfstatat-newfstatat.$(OBJEXT) newfstatat_LDADD = $(LDADD) newfstatat_DEPENDENCIES = libtests.a +nfnetlink_acct_SOURCES = nfnetlink_acct.c +nfnetlink_acct_OBJECTS = nfnetlink_acct.$(OBJEXT) +nfnetlink_acct_LDADD = $(LDADD) +nfnetlink_acct_DEPENDENCIES = libtests.a +nfnetlink_cthelper_SOURCES = nfnetlink_cthelper.c +nfnetlink_cthelper_OBJECTS = nfnetlink_cthelper.$(OBJEXT) +nfnetlink_cthelper_LDADD = $(LDADD) +nfnetlink_cthelper_DEPENDENCIES = libtests.a +nfnetlink_ctnetlink_SOURCES = nfnetlink_ctnetlink.c +nfnetlink_ctnetlink_OBJECTS = nfnetlink_ctnetlink.$(OBJEXT) +nfnetlink_ctnetlink_LDADD = $(LDADD) +nfnetlink_ctnetlink_DEPENDENCIES = libtests.a +nfnetlink_ctnetlink_exp_SOURCES = nfnetlink_ctnetlink_exp.c +nfnetlink_ctnetlink_exp_OBJECTS = nfnetlink_ctnetlink_exp.$(OBJEXT) +nfnetlink_ctnetlink_exp_LDADD = $(LDADD) +nfnetlink_ctnetlink_exp_DEPENDENCIES = libtests.a +nfnetlink_cttimeout_SOURCES = nfnetlink_cttimeout.c +nfnetlink_cttimeout_OBJECTS = nfnetlink_cttimeout.$(OBJEXT) +nfnetlink_cttimeout_LDADD = $(LDADD) +nfnetlink_cttimeout_DEPENDENCIES = libtests.a +nfnetlink_ipset_SOURCES = nfnetlink_ipset.c +nfnetlink_ipset_OBJECTS = nfnetlink_ipset.$(OBJEXT) +nfnetlink_ipset_LDADD = $(LDADD) +nfnetlink_ipset_DEPENDENCIES = libtests.a +nfnetlink_nft_compat_SOURCES = nfnetlink_nft_compat.c +nfnetlink_nft_compat_OBJECTS = nfnetlink_nft_compat.$(OBJEXT) +nfnetlink_nft_compat_LDADD = $(LDADD) +nfnetlink_nft_compat_DEPENDENCIES = libtests.a +nfnetlink_nftables_SOURCES = nfnetlink_nftables.c +nfnetlink_nftables_OBJECTS = nfnetlink_nftables.$(OBJEXT) +nfnetlink_nftables_LDADD = $(LDADD) +nfnetlink_nftables_DEPENDENCIES = libtests.a +nfnetlink_osf_SOURCES = nfnetlink_osf.c +nfnetlink_osf_OBJECTS = nfnetlink_osf.$(OBJEXT) +nfnetlink_osf_LDADD = $(LDADD) +nfnetlink_osf_DEPENDENCIES = libtests.a +nfnetlink_queue_SOURCES = nfnetlink_queue.c +nfnetlink_queue_OBJECTS = nfnetlink_queue.$(OBJEXT) +nfnetlink_queue_LDADD = $(LDADD) +nfnetlink_queue_DEPENDENCIES = libtests.a +nfnetlink_ulog_SOURCES = nfnetlink_ulog.c +nfnetlink_ulog_OBJECTS = nfnetlink_ulog.$(OBJEXT) +nfnetlink_ulog_LDADD = $(LDADD) +nfnetlink_ulog_DEPENDENCIES = libtests.a +nlattr_SOURCES = nlattr.c +nlattr_OBJECTS = nlattr.$(OBJEXT) +nlattr_LDADD = $(LDADD) +nlattr_DEPENDENCIES = libtests.a +nlattr_br_port_msg_SOURCES = nlattr_br_port_msg.c +nlattr_br_port_msg_OBJECTS = nlattr_br_port_msg.$(OBJEXT) +nlattr_br_port_msg_LDADD = $(LDADD) +nlattr_br_port_msg_DEPENDENCIES = libtests.a +nlattr_crypto_user_alg_SOURCES = nlattr_crypto_user_alg.c +nlattr_crypto_user_alg_OBJECTS = nlattr_crypto_user_alg.$(OBJEXT) +nlattr_crypto_user_alg_LDADD = $(LDADD) +nlattr_crypto_user_alg_DEPENDENCIES = libtests.a +nlattr_dcbmsg_SOURCES = nlattr_dcbmsg.c +nlattr_dcbmsg_OBJECTS = nlattr_dcbmsg.$(OBJEXT) +nlattr_dcbmsg_LDADD = $(LDADD) +nlattr_dcbmsg_DEPENDENCIES = libtests.a +nlattr_fib_rule_hdr_SOURCES = nlattr_fib_rule_hdr.c +nlattr_fib_rule_hdr_OBJECTS = nlattr_fib_rule_hdr.$(OBJEXT) +nlattr_fib_rule_hdr_LDADD = $(LDADD) +nlattr_fib_rule_hdr_DEPENDENCIES = libtests.a +nlattr_ifaddrlblmsg_SOURCES = nlattr_ifaddrlblmsg.c +nlattr_ifaddrlblmsg_OBJECTS = nlattr_ifaddrlblmsg.$(OBJEXT) +nlattr_ifaddrlblmsg_LDADD = $(LDADD) +nlattr_ifaddrlblmsg_DEPENDENCIES = libtests.a +nlattr_ifaddrmsg_SOURCES = nlattr_ifaddrmsg.c +nlattr_ifaddrmsg_OBJECTS = nlattr_ifaddrmsg.$(OBJEXT) +nlattr_ifaddrmsg_LDADD = $(LDADD) +nlattr_ifaddrmsg_DEPENDENCIES = libtests.a +nlattr_ifinfomsg_SOURCES = nlattr_ifinfomsg.c +nlattr_ifinfomsg_OBJECTS = nlattr_ifinfomsg.$(OBJEXT) +nlattr_ifinfomsg_LDADD = $(LDADD) +nlattr_ifinfomsg_DEPENDENCIES = libtests.a +nlattr_ifla_af_spec_SOURCES = nlattr_ifla_af_spec.c +nlattr_ifla_af_spec_OBJECTS = nlattr_ifla_af_spec.$(OBJEXT) +nlattr_ifla_af_spec_LDADD = $(LDADD) +nlattr_ifla_af_spec_DEPENDENCIES = libtests.a +nlattr_ifla_brport_SOURCES = nlattr_ifla_brport.c +nlattr_ifla_brport_OBJECTS = nlattr_ifla_brport.$(OBJEXT) +nlattr_ifla_brport_LDADD = $(LDADD) +nlattr_ifla_brport_DEPENDENCIES = libtests.a +nlattr_ifla_linkinfo_SOURCES = nlattr_ifla_linkinfo.c +nlattr_ifla_linkinfo_OBJECTS = nlattr_ifla_linkinfo.$(OBJEXT) +nlattr_ifla_linkinfo_LDADD = $(LDADD) +nlattr_ifla_linkinfo_DEPENDENCIES = libtests.a +nlattr_ifla_port_SOURCES = nlattr_ifla_port.c +nlattr_ifla_port_OBJECTS = nlattr_ifla_port.$(OBJEXT) +nlattr_ifla_port_LDADD = $(LDADD) +nlattr_ifla_port_DEPENDENCIES = libtests.a +nlattr_ifla_xdp_SOURCES = nlattr_ifla_xdp.c +nlattr_ifla_xdp_OBJECTS = nlattr_ifla_xdp.$(OBJEXT) +nlattr_ifla_xdp_LDADD = $(LDADD) +nlattr_ifla_xdp_DEPENDENCIES = libtests.a +nlattr_inet_diag_msg_SOURCES = nlattr_inet_diag_msg.c +nlattr_inet_diag_msg_OBJECTS = nlattr_inet_diag_msg.$(OBJEXT) +nlattr_inet_diag_msg_LDADD = $(LDADD) +nlattr_inet_diag_msg_DEPENDENCIES = libtests.a +nlattr_inet_diag_req_compat_SOURCES = nlattr_inet_diag_req_compat.c +nlattr_inet_diag_req_compat_OBJECTS = \ + nlattr_inet_diag_req_compat.$(OBJEXT) +nlattr_inet_diag_req_compat_LDADD = $(LDADD) +nlattr_inet_diag_req_compat_DEPENDENCIES = libtests.a +nlattr_inet_diag_req_v2_SOURCES = nlattr_inet_diag_req_v2.c +nlattr_inet_diag_req_v2_OBJECTS = nlattr_inet_diag_req_v2.$(OBJEXT) +nlattr_inet_diag_req_v2_LDADD = $(LDADD) +nlattr_inet_diag_req_v2_DEPENDENCIES = libtests.a +nlattr_mdba_mdb_entry_SOURCES = nlattr_mdba_mdb_entry.c +nlattr_mdba_mdb_entry_OBJECTS = nlattr_mdba_mdb_entry.$(OBJEXT) +nlattr_mdba_mdb_entry_LDADD = $(LDADD) +nlattr_mdba_mdb_entry_DEPENDENCIES = libtests.a +nlattr_mdba_router_port_SOURCES = nlattr_mdba_router_port.c +nlattr_mdba_router_port_OBJECTS = nlattr_mdba_router_port.$(OBJEXT) +nlattr_mdba_router_port_LDADD = $(LDADD) +nlattr_mdba_router_port_DEPENDENCIES = libtests.a +nlattr_ndmsg_SOURCES = nlattr_ndmsg.c +nlattr_ndmsg_OBJECTS = nlattr_ndmsg.$(OBJEXT) +nlattr_ndmsg_LDADD = $(LDADD) +nlattr_ndmsg_DEPENDENCIES = libtests.a +nlattr_ndtmsg_SOURCES = nlattr_ndtmsg.c +nlattr_ndtmsg_OBJECTS = nlattr_ndtmsg.$(OBJEXT) +nlattr_ndtmsg_LDADD = $(LDADD) +nlattr_ndtmsg_DEPENDENCIES = libtests.a +nlattr_netconfmsg_SOURCES = nlattr_netconfmsg.c +nlattr_netconfmsg_OBJECTS = nlattr_netconfmsg.$(OBJEXT) +nlattr_netconfmsg_LDADD = $(LDADD) +nlattr_netconfmsg_DEPENDENCIES = libtests.a +nlattr_netlink_diag_msg_SOURCES = nlattr_netlink_diag_msg.c +nlattr_netlink_diag_msg_OBJECTS = nlattr_netlink_diag_msg.$(OBJEXT) +nlattr_netlink_diag_msg_LDADD = $(LDADD) +nlattr_netlink_diag_msg_DEPENDENCIES = libtests.a +nlattr_nlmsgerr_SOURCES = nlattr_nlmsgerr.c +nlattr_nlmsgerr_OBJECTS = nlattr_nlmsgerr.$(OBJEXT) +nlattr_nlmsgerr_LDADD = $(LDADD) +nlattr_nlmsgerr_DEPENDENCIES = libtests.a +nlattr_packet_diag_msg_SOURCES = nlattr_packet_diag_msg.c +nlattr_packet_diag_msg_OBJECTS = nlattr_packet_diag_msg.$(OBJEXT) +nlattr_packet_diag_msg_LDADD = $(LDADD) +nlattr_packet_diag_msg_DEPENDENCIES = libtests.a +nlattr_rtgenmsg_SOURCES = nlattr_rtgenmsg.c +nlattr_rtgenmsg_OBJECTS = nlattr_rtgenmsg.$(OBJEXT) +nlattr_rtgenmsg_LDADD = $(LDADD) +nlattr_rtgenmsg_DEPENDENCIES = libtests.a +nlattr_rtmsg_SOURCES = nlattr_rtmsg.c +nlattr_rtmsg_OBJECTS = nlattr_rtmsg.$(OBJEXT) +nlattr_rtmsg_LDADD = $(LDADD) +nlattr_rtmsg_DEPENDENCIES = libtests.a +nlattr_smc_diag_msg_SOURCES = nlattr_smc_diag_msg.c +nlattr_smc_diag_msg_OBJECTS = nlattr_smc_diag_msg.$(OBJEXT) +nlattr_smc_diag_msg_LDADD = $(LDADD) +nlattr_smc_diag_msg_DEPENDENCIES = libtests.a +nlattr_tc_stats_SOURCES = nlattr_tc_stats.c +nlattr_tc_stats_OBJECTS = nlattr_tc_stats.$(OBJEXT) +nlattr_tc_stats_LDADD = $(LDADD) +nlattr_tc_stats_DEPENDENCIES = libtests.a +nlattr_tca_stab_SOURCES = nlattr_tca_stab.c +nlattr_tca_stab_OBJECTS = nlattr_tca_stab.$(OBJEXT) +nlattr_tca_stab_LDADD = $(LDADD) +nlattr_tca_stab_DEPENDENCIES = libtests.a +nlattr_tcamsg_SOURCES = nlattr_tcamsg.c +nlattr_tcamsg_OBJECTS = nlattr_tcamsg.$(OBJEXT) +nlattr_tcamsg_LDADD = $(LDADD) +nlattr_tcamsg_DEPENDENCIES = libtests.a +nlattr_tcmsg_SOURCES = nlattr_tcmsg.c +nlattr_tcmsg_OBJECTS = nlattr_tcmsg.$(OBJEXT) +nlattr_tcmsg_LDADD = $(LDADD) +nlattr_tcmsg_DEPENDENCIES = libtests.a +nlattr_unix_diag_msg_SOURCES = nlattr_unix_diag_msg.c +nlattr_unix_diag_msg_OBJECTS = nlattr_unix_diag_msg.$(OBJEXT) +nlattr_unix_diag_msg_LDADD = $(LDADD) +nlattr_unix_diag_msg_DEPENDENCIES = libtests.a nsyscalls_SOURCES = nsyscalls.c nsyscalls_OBJECTS = nsyscalls.$(OBJEXT) nsyscalls_LDADD = $(LDADD) nsyscalls_DEPENDENCIES = libtests.a +nsyscalls_d_SOURCES = nsyscalls-d.c +nsyscalls_d_OBJECTS = nsyscalls-d.$(OBJEXT) +nsyscalls_d_LDADD = $(LDADD) +nsyscalls_d_DEPENDENCIES = libtests.a old_mmap_SOURCES = old_mmap.c old_mmap_OBJECTS = old_mmap.$(OBJEXT) old_mmap_LDADD = $(LDADD) old_mmap_DEPENDENCIES = libtests.a +old_mmap_P_SOURCES = old_mmap-P.c +old_mmap_P_OBJECTS = old_mmap-P.$(OBJEXT) +old_mmap_P_LDADD = $(LDADD) +old_mmap_P_DEPENDENCIES = libtests.a +old_mmap_Xabbrev_SOURCES = old_mmap-Xabbrev.c +old_mmap_Xabbrev_OBJECTS = old_mmap-Xabbrev.$(OBJEXT) +old_mmap_Xabbrev_LDADD = $(LDADD) +old_mmap_Xabbrev_DEPENDENCIES = libtests.a +old_mmap_Xraw_SOURCES = old_mmap-Xraw.c +old_mmap_Xraw_OBJECTS = old_mmap-Xraw.$(OBJEXT) +old_mmap_Xraw_LDADD = $(LDADD) +old_mmap_Xraw_DEPENDENCIES = libtests.a +old_mmap_Xverbose_SOURCES = old_mmap-Xverbose.c +old_mmap_Xverbose_OBJECTS = old_mmap-Xverbose.$(OBJEXT) +old_mmap_Xverbose_LDADD = $(LDADD) +old_mmap_Xverbose_DEPENDENCIES = libtests.a +old_mmap_v_none_SOURCES = old_mmap-v-none.c +old_mmap_v_none_OBJECTS = old_mmap-v-none.$(OBJEXT) +old_mmap_v_none_LDADD = $(LDADD) +old_mmap_v_none_DEPENDENCIES = libtests.a oldfstat_SOURCES = oldfstat.c oldfstat_OBJECTS = oldfstat.$(OBJEXT) oldfstat_LDADD = $(LDADD) @@ -1080,6 +1831,18 @@ oldselect_SOURCES = oldselect.c oldselect_OBJECTS = oldselect.$(OBJEXT) oldselect_LDADD = $(LDADD) oldselect_DEPENDENCIES = libtests.a +oldselect_P_SOURCES = oldselect-P.c +oldselect_P_OBJECTS = oldselect-P.$(OBJEXT) +oldselect_P_LDADD = $(LDADD) +oldselect_P_DEPENDENCIES = libtests.a +oldselect_efault_SOURCES = oldselect-efault.c +oldselect_efault_OBJECTS = oldselect-efault.$(OBJEXT) +oldselect_efault_LDADD = $(LDADD) +oldselect_efault_DEPENDENCIES = libtests.a +oldselect_efault_P_SOURCES = oldselect-efault-P.c +oldselect_efault_P_OBJECTS = oldselect-efault-P.$(OBJEXT) +oldselect_efault_P_LDADD = $(LDADD) +oldselect_efault_P_DEPENDENCIES = libtests.a oldstat_SOURCES = oldstat.c oldstat_OBJECTS = oldstat.$(OBJEXT) oldstat_LDADD = $(LDADD) @@ -1092,13 +1855,20 @@ openat_SOURCES = openat.c openat_OBJECTS = openat.$(OBJEXT) openat_LDADD = $(LDADD) openat_DEPENDENCIES = libtests.a +orphaned_process_group_SOURCES = orphaned_process_group.c +orphaned_process_group_OBJECTS = orphaned_process_group.$(OBJEXT) +orphaned_process_group_LDADD = $(LDADD) +orphaned_process_group_DEPENDENCIES = libtests.a +osf_utimes_SOURCES = osf_utimes.c +osf_utimes_OBJECTS = osf_utimes.$(OBJEXT) +osf_utimes_LDADD = $(LDADD) +osf_utimes_DEPENDENCIES = libtests.a pause_SOURCES = pause.c pause_OBJECTS = pause.$(OBJEXT) pause_LDADD = $(LDADD) pause_DEPENDENCIES = libtests.a pc_SOURCES = pc.c pc_OBJECTS = pc.$(OBJEXT) -am__DEPENDENCIES_1 = pc_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LDADD) perf_event_open_SOURCES = perf_event_open.c perf_event_open_OBJECTS = perf_event_open.$(OBJEXT) @@ -1117,6 +1887,22 @@ personality_SOURCES = personality.c personality_OBJECTS = personality.$(OBJEXT) personality_LDADD = $(LDADD) personality_DEPENDENCIES = libtests.a +personality_Xabbrev_SOURCES = personality-Xabbrev.c +personality_Xabbrev_OBJECTS = personality-Xabbrev.$(OBJEXT) +personality_Xabbrev_LDADD = $(LDADD) +personality_Xabbrev_DEPENDENCIES = libtests.a +personality_Xraw_SOURCES = personality-Xraw.c +personality_Xraw_OBJECTS = personality-Xraw.$(OBJEXT) +personality_Xraw_LDADD = $(LDADD) +personality_Xraw_DEPENDENCIES = libtests.a +personality_Xverbose_SOURCES = personality-Xverbose.c +personality_Xverbose_OBJECTS = personality-Xverbose.$(OBJEXT) +personality_Xverbose_LDADD = $(LDADD) +personality_Xverbose_DEPENDENCIES = libtests.a +pidfd_send_signal_SOURCES = pidfd_send_signal.c +pidfd_send_signal_OBJECTS = pidfd_send_signal.$(OBJEXT) +pidfd_send_signal_LDADD = $(LDADD) +pidfd_send_signal_DEPENDENCIES = libtests.a pipe_SOURCES = pipe.c pipe_OBJECTS = pipe.$(OBJEXT) pipe_LDADD = $(LDADD) @@ -1141,10 +1927,22 @@ poll_SOURCES = poll.c poll_OBJECTS = poll.$(OBJEXT) poll_LDADD = $(LDADD) poll_DEPENDENCIES = libtests.a +poll_P_SOURCES = poll-P.c +poll_P_OBJECTS = poll-P.$(OBJEXT) +poll_P_LDADD = $(LDADD) +poll_P_DEPENDENCIES = libtests.a ppoll_SOURCES = ppoll.c ppoll_OBJECTS = ppoll.$(OBJEXT) ppoll_LDADD = $(LDADD) ppoll_DEPENDENCIES = libtests.a +ppoll_P_SOURCES = ppoll-P.c +ppoll_P_OBJECTS = ppoll-P.$(OBJEXT) +ppoll_P_LDADD = $(LDADD) +ppoll_P_DEPENDENCIES = libtests.a +ppoll_v_SOURCES = ppoll-v.c +ppoll_v_OBJECTS = ppoll-v.$(OBJEXT) +ppoll_v_LDADD = $(LDADD) +ppoll_v_DEPENDENCIES = libtests.a prctl_arg2_intptr_SOURCES = prctl-arg2-intptr.c prctl_arg2_intptr_OBJECTS = prctl-arg2-intptr.$(OBJEXT) prctl_arg2_intptr_LDADD = $(LDADD) @@ -1177,6 +1975,10 @@ prctl_securebits_SOURCES = prctl-securebits.c prctl_securebits_OBJECTS = prctl-securebits.$(OBJEXT) prctl_securebits_LDADD = $(LDADD) prctl_securebits_DEPENDENCIES = libtests.a +prctl_spec_inject_SOURCES = prctl-spec-inject.c +prctl_spec_inject_OBJECTS = prctl-spec-inject.$(OBJEXT) +prctl_spec_inject_LDADD = $(LDADD) +prctl_spec_inject_DEPENDENCIES = libtests.a prctl_tid_address_SOURCES = prctl-tid_address.c prctl_tid_address_OBJECTS = prctl-tid_address.$(OBJEXT) prctl_tid_address_LDADD = $(LDADD) @@ -1206,10 +2008,51 @@ print_maxfd_SOURCES = print_maxfd.c print_maxfd_OBJECTS = print_maxfd.$(OBJEXT) print_maxfd_LDADD = $(LDADD) print_maxfd_DEPENDENCIES = libtests.a +printpath_umovestr_SOURCES = printpath-umovestr.c +printpath_umovestr_OBJECTS = printpath-umovestr.$(OBJEXT) +printpath_umovestr_LDADD = $(LDADD) +printpath_umovestr_DEPENDENCIES = libtests.a +printpath_umovestr_peekdata_SOURCES = printpath-umovestr-peekdata.c +printpath_umovestr_peekdata_OBJECTS = \ + printpath-umovestr-peekdata.$(OBJEXT) +printpath_umovestr_peekdata_LDADD = $(LDADD) +printpath_umovestr_peekdata_DEPENDENCIES = libtests.a +printpath_umovestr_undumpable_SOURCES = \ + printpath-umovestr-undumpable.c +printpath_umovestr_undumpable_OBJECTS = \ + printpath-umovestr-undumpable.$(OBJEXT) +printpath_umovestr_undumpable_LDADD = $(LDADD) +printpath_umovestr_undumpable_DEPENDENCIES = libtests.a +printsignal_Xabbrev_SOURCES = printsignal-Xabbrev.c +printsignal_Xabbrev_OBJECTS = printsignal-Xabbrev.$(OBJEXT) +printsignal_Xabbrev_LDADD = $(LDADD) +printsignal_Xabbrev_DEPENDENCIES = libtests.a +printsignal_Xraw_SOURCES = printsignal-Xraw.c +printsignal_Xraw_OBJECTS = printsignal-Xraw.$(OBJEXT) +printsignal_Xraw_LDADD = $(LDADD) +printsignal_Xraw_DEPENDENCIES = libtests.a +printsignal_Xverbose_SOURCES = printsignal-Xverbose.c +printsignal_Xverbose_OBJECTS = printsignal-Xverbose.$(OBJEXT) +printsignal_Xverbose_LDADD = $(LDADD) +printsignal_Xverbose_DEPENDENCIES = libtests.a printstr_SOURCES = printstr.c printstr_OBJECTS = printstr.$(OBJEXT) printstr_LDADD = $(LDADD) printstr_DEPENDENCIES = libtests.a +printstrn_umoven_SOURCES = printstrn-umoven.c +printstrn_umoven_OBJECTS = printstrn-umoven.$(OBJEXT) +printstrn_umoven_LDADD = $(LDADD) +printstrn_umoven_DEPENDENCIES = libtests.a +printstrn_umoven_peekdata_SOURCES = printstrn-umoven-peekdata.c +printstrn_umoven_peekdata_OBJECTS = \ + printstrn-umoven-peekdata.$(OBJEXT) +printstrn_umoven_peekdata_LDADD = $(LDADD) +printstrn_umoven_peekdata_DEPENDENCIES = libtests.a +printstrn_umoven_undumpable_SOURCES = printstrn-umoven-undumpable.c +printstrn_umoven_undumpable_OBJECTS = \ + printstrn-umoven-undumpable.$(OBJEXT) +printstrn_umoven_undumpable_LDADD = $(LDADD) +printstrn_umoven_undumpable_DEPENDENCIES = libtests.a prlimit64_SOURCES = prlimit64.c prlimit64_OBJECTS = prlimit64.$(OBJEXT) prlimit64_LDADD = $(LDADD) @@ -1230,6 +2073,10 @@ ptrace_SOURCES = ptrace.c ptrace_OBJECTS = ptrace.$(OBJEXT) ptrace_LDADD = $(LDADD) ptrace_DEPENDENCIES = libtests.a +ptrace_syscall_info_SOURCES = ptrace_syscall_info.c +ptrace_syscall_info_OBJECTS = ptrace_syscall_info.$(OBJEXT) +ptrace_syscall_info_LDADD = $(LDADD) +ptrace_syscall_info_DEPENDENCIES = libtests.a pwritev_SOURCES = pwritev.c pwritev_OBJECTS = pwritev-pwritev.$(OBJEXT) pwritev_LDADD = $(LDADD) @@ -1258,6 +2105,26 @@ quotactl_SOURCES = quotactl.c quotactl_OBJECTS = quotactl.$(OBJEXT) quotactl_LDADD = $(LDADD) quotactl_DEPENDENCIES = libtests.a +quotactl_Xabbrev_SOURCES = quotactl-Xabbrev.c +quotactl_Xabbrev_OBJECTS = quotactl-Xabbrev.$(OBJEXT) +quotactl_Xabbrev_LDADD = $(LDADD) +quotactl_Xabbrev_DEPENDENCIES = libtests.a +quotactl_Xraw_SOURCES = quotactl-Xraw.c +quotactl_Xraw_OBJECTS = quotactl-Xraw.$(OBJEXT) +quotactl_Xraw_LDADD = $(LDADD) +quotactl_Xraw_DEPENDENCIES = libtests.a +quotactl_Xverbose_SOURCES = quotactl-Xverbose.c +quotactl_Xverbose_OBJECTS = quotactl-Xverbose.$(OBJEXT) +quotactl_Xverbose_LDADD = $(LDADD) +quotactl_Xverbose_DEPENDENCIES = libtests.a +quotactl_success_SOURCES = quotactl-success.c +quotactl_success_OBJECTS = quotactl-success.$(OBJEXT) +quotactl_success_LDADD = $(LDADD) +quotactl_success_DEPENDENCIES = libtests.a +quotactl_success_v_SOURCES = quotactl-success-v.c +quotactl_success_v_OBJECTS = quotactl-success-v.$(OBJEXT) +quotactl_success_v_LDADD = $(LDADD) +quotactl_success_v_DEPENDENCIES = libtests.a quotactl_v_SOURCES = quotactl-v.c quotactl_v_OBJECTS = quotactl-v.$(OBJEXT) quotactl_v_LDADD = $(LDADD) @@ -1266,6 +2133,14 @@ quotactl_xfs_SOURCES = quotactl-xfs.c quotactl_xfs_OBJECTS = quotactl-xfs.$(OBJEXT) quotactl_xfs_LDADD = $(LDADD) quotactl_xfs_DEPENDENCIES = libtests.a +quotactl_xfs_success_SOURCES = quotactl-xfs-success.c +quotactl_xfs_success_OBJECTS = quotactl-xfs-success.$(OBJEXT) +quotactl_xfs_success_LDADD = $(LDADD) +quotactl_xfs_success_DEPENDENCIES = libtests.a +quotactl_xfs_success_v_SOURCES = quotactl-xfs-success-v.c +quotactl_xfs_success_v_OBJECTS = quotactl-xfs-success-v.$(OBJEXT) +quotactl_xfs_success_v_LDADD = $(LDADD) +quotactl_xfs_success_v_DEPENDENCIES = libtests.a quotactl_xfs_v_SOURCES = quotactl-xfs-v.c quotactl_xfs_v_OBJECTS = quotactl-xfs-v.$(OBJEXT) quotactl_xfs_v_LDADD = $(LDADD) @@ -1318,6 +2193,19 @@ remap_file_pages_SOURCES = remap_file_pages.c remap_file_pages_OBJECTS = remap_file_pages.$(OBJEXT) remap_file_pages_LDADD = $(LDADD) remap_file_pages_DEPENDENCIES = libtests.a +remap_file_pages_Xabbrev_SOURCES = remap_file_pages-Xabbrev.c +remap_file_pages_Xabbrev_OBJECTS = remap_file_pages-Xabbrev.$(OBJEXT) +remap_file_pages_Xabbrev_LDADD = $(LDADD) +remap_file_pages_Xabbrev_DEPENDENCIES = libtests.a +remap_file_pages_Xraw_SOURCES = remap_file_pages-Xraw.c +remap_file_pages_Xraw_OBJECTS = remap_file_pages-Xraw.$(OBJEXT) +remap_file_pages_Xraw_LDADD = $(LDADD) +remap_file_pages_Xraw_DEPENDENCIES = libtests.a +remap_file_pages_Xverbose_SOURCES = remap_file_pages-Xverbose.c +remap_file_pages_Xverbose_OBJECTS = \ + remap_file_pages-Xverbose.$(OBJEXT) +remap_file_pages_Xverbose_LDADD = $(LDADD) +remap_file_pages_Xverbose_DEPENDENCIES = libtests.a rename_SOURCES = rename.c rename_OBJECTS = rename.$(OBJEXT) rename_LDADD = $(LDADD) @@ -1338,10 +2226,18 @@ restart_syscall_SOURCES = restart_syscall.c restart_syscall_OBJECTS = restart_syscall.$(OBJEXT) restart_syscall_LDADD = $(LDADD) restart_syscall_DEPENDENCIES = libtests.a +riscv_flush_icache_SOURCES = riscv_flush_icache.c +riscv_flush_icache_OBJECTS = riscv_flush_icache.$(OBJEXT) +riscv_flush_icache_LDADD = $(LDADD) +riscv_flush_icache_DEPENDENCIES = libtests.a rmdir_SOURCES = rmdir.c rmdir_OBJECTS = rmdir.$(OBJEXT) rmdir_LDADD = $(LDADD) rmdir_DEPENDENCIES = libtests.a +rt_sigaction_SOURCES = rt_sigaction.c +rt_sigaction_OBJECTS = rt_sigaction.$(OBJEXT) +rt_sigaction_LDADD = $(LDADD) +rt_sigaction_DEPENDENCIES = libtests.a rt_sigpending_SOURCES = rt_sigpending.c rt_sigpending_OBJECTS = rt_sigpending.$(OBJEXT) rt_sigpending_LDADD = $(LDADD) @@ -1354,6 +2250,10 @@ rt_sigqueueinfo_SOURCES = rt_sigqueueinfo.c rt_sigqueueinfo_OBJECTS = rt_sigqueueinfo.$(OBJEXT) rt_sigqueueinfo_LDADD = $(LDADD) rt_sigqueueinfo_DEPENDENCIES = libtests.a +rt_sigreturn_SOURCES = rt_sigreturn.c +rt_sigreturn_OBJECTS = rt_sigreturn.$(OBJEXT) +rt_sigreturn_LDADD = $(LDADD) +rt_sigreturn_DEPENDENCIES = libtests.a rt_sigsuspend_SOURCES = rt_sigsuspend.c rt_sigsuspend_OBJECTS = rt_sigsuspend.$(OBJEXT) rt_sigsuspend_LDADD = $(LDADD) @@ -1366,6 +2266,34 @@ rt_tgsigqueueinfo_SOURCES = rt_tgsigqueueinfo.c rt_tgsigqueueinfo_OBJECTS = rt_tgsigqueueinfo.$(OBJEXT) rt_tgsigqueueinfo_LDADD = $(LDADD) rt_tgsigqueueinfo_DEPENDENCIES = libtests.a +run_expect_termsig_SOURCES = run_expect_termsig.c +run_expect_termsig_OBJECTS = run_expect_termsig.$(OBJEXT) +run_expect_termsig_LDADD = $(LDADD) +run_expect_termsig_DEPENDENCIES = libtests.a +s390_guarded_storage_SOURCES = s390_guarded_storage.c +s390_guarded_storage_OBJECTS = s390_guarded_storage.$(OBJEXT) +s390_guarded_storage_LDADD = $(LDADD) +s390_guarded_storage_DEPENDENCIES = libtests.a +s390_guarded_storage_v_SOURCES = s390_guarded_storage-v.c +s390_guarded_storage_v_OBJECTS = s390_guarded_storage-v.$(OBJEXT) +s390_guarded_storage_v_LDADD = $(LDADD) +s390_guarded_storage_v_DEPENDENCIES = libtests.a +s390_pci_mmio_read_write_SOURCES = s390_pci_mmio_read_write.c +s390_pci_mmio_read_write_OBJECTS = s390_pci_mmio_read_write.$(OBJEXT) +s390_pci_mmio_read_write_LDADD = $(LDADD) +s390_pci_mmio_read_write_DEPENDENCIES = libtests.a +s390_runtime_instr_SOURCES = s390_runtime_instr.c +s390_runtime_instr_OBJECTS = s390_runtime_instr.$(OBJEXT) +s390_runtime_instr_LDADD = $(LDADD) +s390_runtime_instr_DEPENDENCIES = libtests.a +s390_sthyi_SOURCES = s390_sthyi.c +s390_sthyi_OBJECTS = s390_sthyi.$(OBJEXT) +s390_sthyi_LDADD = $(LDADD) +s390_sthyi_DEPENDENCIES = libtests.a +s390_sthyi_v_SOURCES = s390_sthyi-v.c +s390_sthyi_v_OBJECTS = s390_sthyi-v.$(OBJEXT) +s390_sthyi_v_LDADD = $(LDADD) +s390_sthyi_v_DEPENDENCIES = libtests.a sched_get_priority_mxx_SOURCES = sched_get_priority_mxx.c sched_get_priority_mxx_OBJECTS = sched_get_priority_mxx.$(OBJEXT) sched_get_priority_mxx_LDADD = $(LDADD) @@ -1410,10 +2338,18 @@ seccomp_strict_SOURCES = seccomp-strict.c seccomp_strict_OBJECTS = seccomp-strict.$(OBJEXT) seccomp_strict_LDADD = $(LDADD) seccomp_strict_DEPENDENCIES = libtests.a +seccomp_get_action_avail_SOURCES = seccomp_get_action_avail.c +seccomp_get_action_avail_OBJECTS = seccomp_get_action_avail.$(OBJEXT) +seccomp_get_action_avail_LDADD = $(LDADD) +seccomp_get_action_avail_DEPENDENCIES = libtests.a select_SOURCES = select.c select_OBJECTS = select.$(OBJEXT) select_LDADD = $(LDADD) select_DEPENDENCIES = libtests.a +select_P_SOURCES = select-P.c +select_P_OBJECTS = select-P.$(OBJEXT) +select_P_LDADD = $(LDADD) +select_P_DEPENDENCIES = libtests.a semop_SOURCES = semop.c semop_OBJECTS = semop.$(OBJEXT) semop_LDADD = $(LDADD) @@ -1434,6 +2370,14 @@ set_ptracer_any_SOURCES = set_ptracer_any.c set_ptracer_any_OBJECTS = set_ptracer_any.$(OBJEXT) set_ptracer_any_LDADD = $(LDADD) set_ptracer_any_DEPENDENCIES = libtests.a +set_sigblock_SOURCES = set_sigblock.c +set_sigblock_OBJECTS = set_sigblock.$(OBJEXT) +set_sigblock_LDADD = $(LDADD) +set_sigblock_DEPENDENCIES = libtests.a +set_sigign_SOURCES = set_sigign.c +set_sigign_OBJECTS = set_sigign.$(OBJEXT) +set_sigign_LDADD = $(LDADD) +set_sigign_DEPENDENCIES = libtests.a setdomainname_SOURCES = setdomainname.c setdomainname_OBJECTS = setdomainname.$(OBJEXT) setdomainname_LDADD = $(LDADD) @@ -1514,6 +2458,18 @@ setrlimit_SOURCES = setrlimit.c setrlimit_OBJECTS = setrlimit.$(OBJEXT) setrlimit_LDADD = $(LDADD) setrlimit_DEPENDENCIES = libtests.a +setrlimit_Xabbrev_SOURCES = setrlimit-Xabbrev.c +setrlimit_Xabbrev_OBJECTS = setrlimit-Xabbrev.$(OBJEXT) +setrlimit_Xabbrev_LDADD = $(LDADD) +setrlimit_Xabbrev_DEPENDENCIES = libtests.a +setrlimit_Xraw_SOURCES = setrlimit-Xraw.c +setrlimit_Xraw_OBJECTS = setrlimit-Xraw.$(OBJEXT) +setrlimit_Xraw_LDADD = $(LDADD) +setrlimit_Xraw_DEPENDENCIES = libtests.a +setrlimit_Xverbose_SOURCES = setrlimit-Xverbose.c +setrlimit_Xverbose_OBJECTS = setrlimit-Xverbose.$(OBJEXT) +setrlimit_Xverbose_LDADD = $(LDADD) +setrlimit_Xverbose_DEPENDENCIES = libtests.a setuid_SOURCES = setuid.c setuid_OBJECTS = setuid.$(OBJEXT) setuid_LDADD = $(LDADD) @@ -1542,6 +2498,10 @@ siginfo_SOURCES = siginfo.c siginfo_OBJECTS = siginfo.$(OBJEXT) siginfo_LDADD = $(LDADD) siginfo_DEPENDENCIES = libtests.a +signal_SOURCES = signal.c +signal_OBJECTS = signal.$(OBJEXT) +signal_LDADD = $(LDADD) +signal_DEPENDENCIES = libtests.a signal_receive_SOURCES = signal_receive.c signal_receive_OBJECTS = signal_receive.$(OBJEXT) signal_receive_LDADD = $(LDADD) @@ -1550,18 +2510,90 @@ signalfd4_SOURCES = signalfd4.c signalfd4_OBJECTS = signalfd4.$(OBJEXT) signalfd4_LDADD = $(LDADD) signalfd4_DEPENDENCIES = libtests.a +sigpending_SOURCES = sigpending.c +sigpending_OBJECTS = sigpending.$(OBJEXT) +sigpending_LDADD = $(LDADD) +sigpending_DEPENDENCIES = libtests.a +sigprocmask_SOURCES = sigprocmask.c +sigprocmask_OBJECTS = sigprocmask.$(OBJEXT) +sigprocmask_LDADD = $(LDADD) +sigprocmask_DEPENDENCIES = libtests.a sigreturn_SOURCES = sigreturn.c sigreturn_OBJECTS = sigreturn.$(OBJEXT) sigreturn_LDADD = $(LDADD) sigreturn_DEPENDENCIES = libtests.a +sigsuspend_SOURCES = sigsuspend.c +sigsuspend_OBJECTS = sigsuspend.$(OBJEXT) +sigsuspend_LDADD = $(LDADD) +sigsuspend_DEPENDENCIES = libtests.a sleep_SOURCES = sleep.c sleep_OBJECTS = sleep.$(OBJEXT) sleep_LDADD = $(LDADD) sleep_DEPENDENCIES = libtests.a +so_error_SOURCES = so_error.c +so_error_OBJECTS = so_error.$(OBJEXT) +so_error_LDADD = $(LDADD) +so_error_DEPENDENCIES = libtests.a +so_linger_SOURCES = so_linger.c +so_linger_OBJECTS = so_linger.$(OBJEXT) +so_linger_LDADD = $(LDADD) +so_linger_DEPENDENCIES = libtests.a +so_peercred_SOURCES = so_peercred.c +so_peercred_OBJECTS = so_peercred.$(OBJEXT) +so_peercred_LDADD = $(LDADD) +so_peercred_DEPENDENCIES = libtests.a +so_peercred_Xabbrev_SOURCES = so_peercred-Xabbrev.c +so_peercred_Xabbrev_OBJECTS = so_peercred-Xabbrev.$(OBJEXT) +so_peercred_Xabbrev_LDADD = $(LDADD) +so_peercred_Xabbrev_DEPENDENCIES = libtests.a +so_peercred_Xraw_SOURCES = so_peercred-Xraw.c +so_peercred_Xraw_OBJECTS = so_peercred-Xraw.$(OBJEXT) +so_peercred_Xraw_LDADD = $(LDADD) +so_peercred_Xraw_DEPENDENCIES = libtests.a +so_peercred_Xverbose_SOURCES = so_peercred-Xverbose.c +so_peercred_Xverbose_OBJECTS = so_peercred-Xverbose.$(OBJEXT) +so_peercred_Xverbose_LDADD = $(LDADD) +so_peercred_Xverbose_DEPENDENCIES = libtests.a +sock_filter_v_SOURCES = sock_filter-v.c +sock_filter_v_OBJECTS = sock_filter-v.$(OBJEXT) +sock_filter_v_LDADD = $(LDADD) +sock_filter_v_DEPENDENCIES = libtests.a +sock_filter_v_Xabbrev_SOURCES = sock_filter-v-Xabbrev.c +sock_filter_v_Xabbrev_OBJECTS = sock_filter-v-Xabbrev.$(OBJEXT) +sock_filter_v_Xabbrev_LDADD = $(LDADD) +sock_filter_v_Xabbrev_DEPENDENCIES = libtests.a +sock_filter_v_Xraw_SOURCES = sock_filter-v-Xraw.c +sock_filter_v_Xraw_OBJECTS = sock_filter-v-Xraw.$(OBJEXT) +sock_filter_v_Xraw_LDADD = $(LDADD) +sock_filter_v_Xraw_DEPENDENCIES = libtests.a +sock_filter_v_Xverbose_SOURCES = sock_filter-v-Xverbose.c +sock_filter_v_Xverbose_OBJECTS = sock_filter-v-Xverbose.$(OBJEXT) +sock_filter_v_Xverbose_LDADD = $(LDADD) +sock_filter_v_Xverbose_DEPENDENCIES = libtests.a +sockaddr_xlat_Xabbrev_SOURCES = sockaddr_xlat-Xabbrev.c +sockaddr_xlat_Xabbrev_OBJECTS = sockaddr_xlat-Xabbrev.$(OBJEXT) +sockaddr_xlat_Xabbrev_LDADD = $(LDADD) +sockaddr_xlat_Xabbrev_DEPENDENCIES = libtests.a +sockaddr_xlat_Xraw_SOURCES = sockaddr_xlat-Xraw.c +sockaddr_xlat_Xraw_OBJECTS = sockaddr_xlat-Xraw.$(OBJEXT) +sockaddr_xlat_Xraw_LDADD = $(LDADD) +sockaddr_xlat_Xraw_DEPENDENCIES = libtests.a +sockaddr_xlat_Xverbose_SOURCES = sockaddr_xlat-Xverbose.c +sockaddr_xlat_Xverbose_OBJECTS = sockaddr_xlat-Xverbose.$(OBJEXT) +sockaddr_xlat_Xverbose_LDADD = $(LDADD) +sockaddr_xlat_Xverbose_DEPENDENCIES = libtests.a socketcall_SOURCES = socketcall.c socketcall_OBJECTS = socketcall.$(OBJEXT) socketcall_LDADD = $(LDADD) socketcall_DEPENDENCIES = libtests.a +sockopt_sol_netlink_SOURCES = sockopt-sol_netlink.c +sockopt_sol_netlink_OBJECTS = sockopt-sol_netlink.$(OBJEXT) +sockopt_sol_netlink_LDADD = $(LDADD) +sockopt_sol_netlink_DEPENDENCIES = libtests.a +sockopt_timestamp_SOURCES = sockopt-timestamp.c +sockopt_timestamp_OBJECTS = sockopt-timestamp.$(OBJEXT) +sockopt_timestamp_LDADD = $(LDADD) +sockopt_timestamp_DEPENDENCIES = libtests.a splice_SOURCES = splice.c splice_OBJECTS = splice.$(OBJEXT) splice_LDADD = $(LDADD) @@ -1572,6 +2604,14 @@ am_stack_fcall_OBJECTS = stack-fcall.$(OBJEXT) stack-fcall-0.$(OBJEXT) \ stack_fcall_OBJECTS = $(am_stack_fcall_OBJECTS) stack_fcall_LDADD = $(LDADD) stack_fcall_DEPENDENCIES = libtests.a +am_stack_fcall_mangled_OBJECTS = stack-fcall-mangled.$(OBJEXT) \ + stack-fcall-mangled-0.$(OBJEXT) \ + stack-fcall-mangled-1.$(OBJEXT) \ + stack-fcall-mangled-2.$(OBJEXT) \ + stack-fcall-mangled-3.$(OBJEXT) +stack_fcall_mangled_OBJECTS = $(am_stack_fcall_mangled_OBJECTS) +stack_fcall_mangled_LDADD = $(LDADD) +stack_fcall_mangled_DEPENDENCIES = libtests.a stat_SOURCES = stat.c stat_OBJECTS = stat.$(OBJEXT) stat_LDADD = $(LDADD) @@ -1588,10 +2628,18 @@ statfs64_SOURCES = statfs64.c statfs64_OBJECTS = statfs64.$(OBJEXT) statfs64_LDADD = $(LDADD) statfs64_DEPENDENCIES = libtests.a +statx_SOURCES = statx.c +statx_OBJECTS = statx.$(OBJEXT) +statx_LDADD = $(LDADD) +statx_DEPENDENCIES = libtests.a swap_SOURCES = swap.c swap_OBJECTS = swap.$(OBJEXT) swap_LDADD = $(LDADD) swap_DEPENDENCIES = libtests.a +sxetmask_SOURCES = sxetmask.c +sxetmask_OBJECTS = sxetmask.$(OBJEXT) +sxetmask_LDADD = $(LDADD) +sxetmask_DEPENDENCIES = libtests.a symlink_SOURCES = symlink.c symlink_OBJECTS = symlink.$(OBJEXT) symlink_LDADD = $(LDADD) @@ -1626,7 +2674,7 @@ tee_LDADD = $(LDADD) tee_DEPENDENCIES = libtests.a threads_execve_SOURCES = threads-execve.c threads_execve_OBJECTS = threads-execve.$(OBJEXT) -threads_execve_DEPENDENCIES = $(LDADD) +threads_execve_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LDADD) time_SOURCES = time.c time_OBJECTS = time.$(OBJEXT) time_LDADD = $(LDADD) @@ -1645,7 +2693,7 @@ timerfd_xettime_LDADD = $(LDADD) timerfd_xettime_DEPENDENCIES = libtests.a times_SOURCES = times.c times_OBJECTS = times.$(OBJEXT) -times_DEPENDENCIES = $(LDADD) +times_DEPENDENCIES = $(am__DEPENDENCIES_1) $(LDADD) times_fail_SOURCES = times-fail.c times_fail_OBJECTS = times-fail.$(OBJEXT) times_fail_LDADD = $(LDADD) @@ -1702,6 +2750,10 @@ uname_SOURCES = uname.c uname_OBJECTS = uname.$(OBJEXT) uname_LDADD = $(LDADD) uname_DEPENDENCIES = libtests.a +unblock_reset_raise_SOURCES = unblock_reset_raise.c +unblock_reset_raise_OBJECTS = unblock_reset_raise.$(OBJEXT) +unblock_reset_raise_LDADD = $(LDADD) +unblock_reset_raise_DEPENDENCIES = libtests.a unix_pair_send_recv_SOURCES = unix-pair-send-recv.c unix_pair_send_recv_OBJECTS = unix-pair-send-recv.$(OBJEXT) unix_pair_send_recv_LDADD = $(LDADD) @@ -1739,6 +2791,18 @@ utimensat_SOURCES = utimensat.c utimensat_OBJECTS = utimensat.$(OBJEXT) utimensat_LDADD = $(LDADD) utimensat_DEPENDENCIES = libtests.a +utimensat_Xabbrev_SOURCES = utimensat-Xabbrev.c +utimensat_Xabbrev_OBJECTS = utimensat-Xabbrev.$(OBJEXT) +utimensat_Xabbrev_LDADD = $(LDADD) +utimensat_Xabbrev_DEPENDENCIES = libtests.a +utimensat_Xraw_SOURCES = utimensat-Xraw.c +utimensat_Xraw_OBJECTS = utimensat-Xraw.$(OBJEXT) +utimensat_Xraw_LDADD = $(LDADD) +utimensat_Xraw_DEPENDENCIES = libtests.a +utimensat_Xverbose_SOURCES = utimensat-Xverbose.c +utimensat_Xverbose_OBJECTS = utimensat-Xverbose.$(OBJEXT) +utimensat_Xverbose_LDADD = $(LDADD) +utimensat_Xverbose_DEPENDENCIES = libtests.a utimes_SOURCES = utimes.c utimes_OBJECTS = utimes.$(OBJEXT) utimes_LDADD = $(LDADD) @@ -1787,6 +2851,10 @@ xet_robust_list_SOURCES = xet_robust_list.c xet_robust_list_OBJECTS = xet_robust_list.$(OBJEXT) xet_robust_list_LDADD = $(LDADD) xet_robust_list_DEPENDENCIES = libtests.a +xet_thread_area_x86_SOURCES = xet_thread_area_x86.c +xet_thread_area_x86_OBJECTS = xet_thread_area_x86.$(OBJEXT) +xet_thread_area_x86_LDADD = $(LDADD) +xet_thread_area_x86_DEPENDENCIES = libtests.a xetitimer_SOURCES = xetitimer.c xetitimer_OBJECTS = xetitimer.$(OBJEXT) xetitimer_LDADD = $(LDADD) @@ -1803,6 +2871,10 @@ xettimeofday_SOURCES = xettimeofday.c xettimeofday_OBJECTS = xettimeofday.$(OBJEXT) xettimeofday_LDADD = $(LDADD) xettimeofday_DEPENDENCIES = libtests.a +zeroargc_SOURCES = zeroargc.c +zeroargc_OBJECTS = zeroargc.$(OBJEXT) +zeroargc_LDADD = $(LDADD) +zeroargc_DEPENDENCIES = libtests.a AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -1817,7 +2889,402 @@ am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = depcomp = $(SHELL) $(top_srcdir)/depcomp -am__depfiles_maybe = depfiles +am__maybe_remake_depfiles = depfiles +am__depfiles_remade = ./$(DEPDIR)/_newselect-P.Po \ + ./$(DEPDIR)/_newselect.Po ./$(DEPDIR)/accept.Po \ + ./$(DEPDIR)/accept4.Po ./$(DEPDIR)/access.Po \ + ./$(DEPDIR)/acct.Po ./$(DEPDIR)/add_key.Po \ + ./$(DEPDIR)/adjtimex.Po ./$(DEPDIR)/aio.Po \ + ./$(DEPDIR)/aio_pgetevents.Po ./$(DEPDIR)/alarm.Po \ + ./$(DEPDIR)/answer.Po ./$(DEPDIR)/attach-f-p-cmd.Po \ + ./$(DEPDIR)/attach-f-p.Po ./$(DEPDIR)/attach-p-cmd-cmd.Po \ + ./$(DEPDIR)/attach-p-cmd-p.Po \ + ./$(DEPDIR)/block_reset_raise_run.Po \ + ./$(DEPDIR)/bpf-obj_get_info_by_fd-prog-v.Po \ + ./$(DEPDIR)/bpf-obj_get_info_by_fd-prog.Po \ + ./$(DEPDIR)/bpf-obj_get_info_by_fd-v.Po \ + ./$(DEPDIR)/bpf-obj_get_info_by_fd.Po \ + ./$(DEPDIR)/bpf-success-v.Po ./$(DEPDIR)/bpf-success.Po \ + ./$(DEPDIR)/bpf-v.Po ./$(DEPDIR)/bpf.Po ./$(DEPDIR)/brk.Po \ + ./$(DEPDIR)/btrfs.Po ./$(DEPDIR)/caps-abbrev.Po \ + ./$(DEPDIR)/caps.Po ./$(DEPDIR)/check_sigblock.Po \ + ./$(DEPDIR)/check_sigign.Po ./$(DEPDIR)/chmod.Po \ + ./$(DEPDIR)/chown.Po ./$(DEPDIR)/chown32.Po \ + ./$(DEPDIR)/chroot.Po ./$(DEPDIR)/clock_adjtime.Po \ + ./$(DEPDIR)/clock_nanosleep.Po ./$(DEPDIR)/clock_xettime.Po \ + ./$(DEPDIR)/clone_parent.Po ./$(DEPDIR)/clone_ptrace.Po \ + ./$(DEPDIR)/copy_file_range.Po ./$(DEPDIR)/count-f.Po \ + ./$(DEPDIR)/creat.Po ./$(DEPDIR)/delay.Po \ + ./$(DEPDIR)/delete_module.Po ./$(DEPDIR)/dev-yy.Po \ + ./$(DEPDIR)/dup.Po ./$(DEPDIR)/dup2.Po ./$(DEPDIR)/dup3.Po \ + ./$(DEPDIR)/epoll_create.Po ./$(DEPDIR)/epoll_create1.Po \ + ./$(DEPDIR)/epoll_ctl.Po ./$(DEPDIR)/epoll_pwait.Po \ + ./$(DEPDIR)/epoll_wait.Po ./$(DEPDIR)/erestartsys.Po \ + ./$(DEPDIR)/eventfd.Po ./$(DEPDIR)/execve-v.Po \ + ./$(DEPDIR)/execve.Po ./$(DEPDIR)/execveat-v.Po \ + ./$(DEPDIR)/execveat.Po ./$(DEPDIR)/faccessat.Po \ + ./$(DEPDIR)/fadvise64.Po ./$(DEPDIR)/fadvise64_64.Po \ + ./$(DEPDIR)/fallocate.Po ./$(DEPDIR)/fanotify_init.Po \ + ./$(DEPDIR)/fanotify_mark-Xabbrev.Po \ + ./$(DEPDIR)/fanotify_mark-Xraw.Po \ + ./$(DEPDIR)/fanotify_mark-Xverbose.Po \ + ./$(DEPDIR)/fanotify_mark.Po ./$(DEPDIR)/fchdir.Po \ + ./$(DEPDIR)/fchmod.Po ./$(DEPDIR)/fchmodat.Po \ + ./$(DEPDIR)/fchown.Po ./$(DEPDIR)/fchown32.Po \ + ./$(DEPDIR)/fchownat.Po ./$(DEPDIR)/fcntl.Po \ + ./$(DEPDIR)/fcntl64.Po ./$(DEPDIR)/fdatasync.Po \ + ./$(DEPDIR)/fflush.Po ./$(DEPDIR)/file_handle.Po \ + ./$(DEPDIR)/file_ioctl.Po ./$(DEPDIR)/filter-unavailable.Po \ + ./$(DEPDIR)/finit_module.Po ./$(DEPDIR)/flock.Po \ + ./$(DEPDIR)/fork-f.Po ./$(DEPDIR)/fstat-Xabbrev.Po \ + ./$(DEPDIR)/fstat-Xraw.Po ./$(DEPDIR)/fstat-Xverbose.Po \ + ./$(DEPDIR)/fstat.Po ./$(DEPDIR)/fstat64-Xabbrev.Po \ + ./$(DEPDIR)/fstat64-Xraw.Po ./$(DEPDIR)/fstat64-Xverbose.Po \ + ./$(DEPDIR)/fstat64-fstat64.Po \ + ./$(DEPDIR)/fstatat64-fstatat64.Po ./$(DEPDIR)/fstatfs.Po \ + ./$(DEPDIR)/fstatfs64.Po ./$(DEPDIR)/fsync-y.Po \ + ./$(DEPDIR)/fsync.Po ./$(DEPDIR)/ftruncate.Po \ + ./$(DEPDIR)/ftruncate64-ftruncate64.Po ./$(DEPDIR)/futex.Po \ + ./$(DEPDIR)/futimesat.Po ./$(DEPDIR)/get_mempolicy.Po \ + ./$(DEPDIR)/getcpu.Po ./$(DEPDIR)/getcwd.Po \ + ./$(DEPDIR)/getdents.Po ./$(DEPDIR)/getdents64.Po \ + ./$(DEPDIR)/getegid.Po ./$(DEPDIR)/getegid32.Po \ + ./$(DEPDIR)/geteuid.Po ./$(DEPDIR)/geteuid32.Po \ + ./$(DEPDIR)/getgid.Po ./$(DEPDIR)/getgid32.Po \ + ./$(DEPDIR)/getgroups.Po ./$(DEPDIR)/getgroups32.Po \ + ./$(DEPDIR)/getpeername.Po ./$(DEPDIR)/getpgrp.Po \ + ./$(DEPDIR)/getpid.Po ./$(DEPDIR)/getppid.Po \ + ./$(DEPDIR)/getrandom.Po ./$(DEPDIR)/getresgid.Po \ + ./$(DEPDIR)/getresgid32.Po ./$(DEPDIR)/getresuid.Po \ + ./$(DEPDIR)/getresuid32.Po ./$(DEPDIR)/getrlimit.Po \ + ./$(DEPDIR)/getrusage.Po ./$(DEPDIR)/getsid.Po \ + ./$(DEPDIR)/getsockname.Po ./$(DEPDIR)/gettid.Po \ + ./$(DEPDIR)/getuid.Po ./$(DEPDIR)/getuid32.Po \ + ./$(DEPDIR)/getxxid.Po ./$(DEPDIR)/group_req.Po \ + ./$(DEPDIR)/inet-cmsg.Po ./$(DEPDIR)/init_module.Po \ + ./$(DEPDIR)/inject-nf.Po ./$(DEPDIR)/inotify.Po \ + ./$(DEPDIR)/inotify_init1.Po ./$(DEPDIR)/int_0x80.Po \ + ./$(DEPDIR)/io_uring_enter.Po ./$(DEPDIR)/io_uring_register.Po \ + ./$(DEPDIR)/io_uring_setup.Po ./$(DEPDIR)/ioctl.Po \ + ./$(DEPDIR)/ioctl_block.Po ./$(DEPDIR)/ioctl_dm-v.Po \ + ./$(DEPDIR)/ioctl_dm.Po ./$(DEPDIR)/ioctl_evdev-success-v.Po \ + ./$(DEPDIR)/ioctl_evdev-success.Po \ + ./$(DEPDIR)/ioctl_evdev-v.Po ./$(DEPDIR)/ioctl_evdev.Po \ + ./$(DEPDIR)/ioctl_inotify.Po ./$(DEPDIR)/ioctl_kvm_run-v.Po \ + ./$(DEPDIR)/ioctl_kvm_run.Po \ + ./$(DEPDIR)/ioctl_kvm_run_auxstr_vcpu.Po \ + ./$(DEPDIR)/ioctl_loop-nv.Po ./$(DEPDIR)/ioctl_loop-v.Po \ + ./$(DEPDIR)/ioctl_loop.Po ./$(DEPDIR)/ioctl_mtd.Po \ + ./$(DEPDIR)/ioctl_nbd.Po ./$(DEPDIR)/ioctl_nsfs.Po \ + ./$(DEPDIR)/ioctl_perf-success.Po ./$(DEPDIR)/ioctl_perf.Po \ + ./$(DEPDIR)/ioctl_ptp.Po ./$(DEPDIR)/ioctl_random.Po \ + ./$(DEPDIR)/ioctl_rtc-v.Po ./$(DEPDIR)/ioctl_rtc.Po \ + ./$(DEPDIR)/ioctl_scsi.Po ./$(DEPDIR)/ioctl_sg_io_v3.Po \ + ./$(DEPDIR)/ioctl_sg_io_v4.Po \ + ./$(DEPDIR)/ioctl_sock_gifconf.Po ./$(DEPDIR)/ioctl_uffdio.Po \ + ./$(DEPDIR)/ioctl_v4l2.Po ./$(DEPDIR)/ioperm.Po \ + ./$(DEPDIR)/iopl.Po ./$(DEPDIR)/ioprio-Xabbrev.Po \ + ./$(DEPDIR)/ioprio-Xraw.Po ./$(DEPDIR)/ioprio-Xverbose.Po \ + ./$(DEPDIR)/ioprio.Po ./$(DEPDIR)/ip_mreq.Po \ + ./$(DEPDIR)/ipc.Po ./$(DEPDIR)/ipc_msg-Xabbrev.Po \ + ./$(DEPDIR)/ipc_msg-Xraw.Po ./$(DEPDIR)/ipc_msg-Xverbose.Po \ + ./$(DEPDIR)/ipc_msg.Po ./$(DEPDIR)/ipc_msgbuf-Xabbrev.Po \ + ./$(DEPDIR)/ipc_msgbuf-Xraw.Po \ + ./$(DEPDIR)/ipc_msgbuf-Xverbose.Po ./$(DEPDIR)/ipc_msgbuf.Po \ + ./$(DEPDIR)/ipc_sem-Xabbrev.Po ./$(DEPDIR)/ipc_sem-Xraw.Po \ + ./$(DEPDIR)/ipc_sem-Xverbose.Po ./$(DEPDIR)/ipc_sem.Po \ + ./$(DEPDIR)/ipc_shm-Xabbrev.Po ./$(DEPDIR)/ipc_shm-Xraw.Po \ + ./$(DEPDIR)/ipc_shm-Xverbose.Po ./$(DEPDIR)/ipc_shm.Po \ + ./$(DEPDIR)/is_linux_mips_n64.Po ./$(DEPDIR)/kcmp-y.Po \ + ./$(DEPDIR)/kcmp.Po ./$(DEPDIR)/kern_features.Po \ + ./$(DEPDIR)/kernel_version-Xabbrev.Po \ + ./$(DEPDIR)/kernel_version-Xraw.Po \ + ./$(DEPDIR)/kernel_version-Xverbose.Po \ + ./$(DEPDIR)/kernel_version.Po ./$(DEPDIR)/kexec_file_load.Po \ + ./$(DEPDIR)/kexec_load.Po ./$(DEPDIR)/keyctl-Xabbrev.Po \ + ./$(DEPDIR)/keyctl-Xraw.Po ./$(DEPDIR)/keyctl-Xverbose.Po \ + ./$(DEPDIR)/keyctl.Po ./$(DEPDIR)/kill.Po \ + ./$(DEPDIR)/kill_child.Po ./$(DEPDIR)/ksysent.Po \ + ./$(DEPDIR)/lchown.Po ./$(DEPDIR)/lchown32.Po \ + ./$(DEPDIR)/libtests_a-create_nl_socket.Po \ + ./$(DEPDIR)/libtests_a-errno2name.Po \ + ./$(DEPDIR)/libtests_a-error_msg.Po \ + ./$(DEPDIR)/libtests_a-fill_memory.Po \ + ./$(DEPDIR)/libtests_a-get_page_size.Po \ + ./$(DEPDIR)/libtests_a-get_sigset_size.Po \ + ./$(DEPDIR)/libtests_a-hexdump_strdup.Po \ + ./$(DEPDIR)/libtests_a-hexquote_strndup.Po \ + ./$(DEPDIR)/libtests_a-ifindex.Po \ + ./$(DEPDIR)/libtests_a-inode_of_sockfd.Po \ + ./$(DEPDIR)/libtests_a-libmmsg.Po \ + ./$(DEPDIR)/libtests_a-libsocketcall.Po \ + ./$(DEPDIR)/libtests_a-overflowuid.Po \ + ./$(DEPDIR)/libtests_a-pipe_maxfd.Po \ + ./$(DEPDIR)/libtests_a-print_quoted_string.Po \ + ./$(DEPDIR)/libtests_a-print_time.Po \ + ./$(DEPDIR)/libtests_a-printflags.Po \ + ./$(DEPDIR)/libtests_a-printxval.Po \ + ./$(DEPDIR)/libtests_a-signal2name.Po \ + ./$(DEPDIR)/libtests_a-skip_unavailable.Po \ + ./$(DEPDIR)/libtests_a-sprintrc.Po \ + ./$(DEPDIR)/libtests_a-tail_alloc.Po \ + ./$(DEPDIR)/libtests_a-test_printpath.Po \ + ./$(DEPDIR)/libtests_a-test_printstrn.Po \ + ./$(DEPDIR)/libtests_a-test_ucopy.Po \ + ./$(DEPDIR)/libtests_a-tprintf.Po ./$(DEPDIR)/link.Po \ + ./$(DEPDIR)/linkat.Po ./$(DEPDIR)/list_sigaction_signum.Po \ + ./$(DEPDIR)/llseek.Po ./$(DEPDIR)/localtime.Po \ + ./$(DEPDIR)/lookup_dcookie.Po ./$(DEPDIR)/looping_threads.Po \ + ./$(DEPDIR)/lseek.Po ./$(DEPDIR)/lstat.Po \ + ./$(DEPDIR)/lstat64-lstat64.Po ./$(DEPDIR)/madvise.Po \ + ./$(DEPDIR)/mbind.Po ./$(DEPDIR)/membarrier.Po \ + ./$(DEPDIR)/memfd_create-Xabbrev.Po \ + ./$(DEPDIR)/memfd_create-Xraw.Po \ + ./$(DEPDIR)/memfd_create-Xverbose.Po \ + ./$(DEPDIR)/memfd_create.Po ./$(DEPDIR)/migrate_pages.Po \ + ./$(DEPDIR)/mincore.Po ./$(DEPDIR)/mkdir.Po \ + ./$(DEPDIR)/mkdirat.Po ./$(DEPDIR)/mknod.Po \ + ./$(DEPDIR)/mknodat.Po ./$(DEPDIR)/mlock.Po \ + ./$(DEPDIR)/mlock2.Po ./$(DEPDIR)/mlockall.Po \ + ./$(DEPDIR)/mmap-Xabbrev.Po ./$(DEPDIR)/mmap-Xraw.Po \ + ./$(DEPDIR)/mmap-Xverbose.Po ./$(DEPDIR)/mmap.Po \ + ./$(DEPDIR)/mmap64-mmap64.Po \ + ./$(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Po \ + ./$(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Po \ + ./$(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Po \ + ./$(DEPDIR)/mmsg-silent.Po ./$(DEPDIR)/mmsg.Po \ + ./$(DEPDIR)/mmsg_name-v.Po ./$(DEPDIR)/mmsg_name.Po \ + ./$(DEPDIR)/modify_ldt.Po ./$(DEPDIR)/mount-Xabbrev.Po \ + ./$(DEPDIR)/mount-Xraw.Po ./$(DEPDIR)/mount-Xverbose.Po \ + ./$(DEPDIR)/mount.Po ./$(DEPDIR)/move_pages-Xabbrev.Po \ + ./$(DEPDIR)/move_pages-Xraw.Po \ + ./$(DEPDIR)/move_pages-Xverbose.Po ./$(DEPDIR)/move_pages.Po \ + ./$(DEPDIR)/mq.Po ./$(DEPDIR)/mq_sendrecv-read.Po \ + ./$(DEPDIR)/mq_sendrecv-write.Po ./$(DEPDIR)/mq_sendrecv.Po \ + ./$(DEPDIR)/msg_control-v.Po ./$(DEPDIR)/msg_control.Po \ + ./$(DEPDIR)/msg_name.Po ./$(DEPDIR)/munlockall.Po \ + ./$(DEPDIR)/nanosleep.Po ./$(DEPDIR)/net-accept-connect.Po \ + ./$(DEPDIR)/net-icmp_filter.Po \ + ./$(DEPDIR)/net-packet_mreq-Xabbrev.Po \ + ./$(DEPDIR)/net-packet_mreq-Xraw.Po \ + ./$(DEPDIR)/net-packet_mreq-Xverbose.Po \ + ./$(DEPDIR)/net-packet_mreq.Po ./$(DEPDIR)/net-sockaddr.Po \ + ./$(DEPDIR)/net-tpacket_req.Po \ + ./$(DEPDIR)/net-tpacket_stats-success.Po \ + ./$(DEPDIR)/net-tpacket_stats.Po ./$(DEPDIR)/net-y-unix.Po \ + ./$(DEPDIR)/net-yy-inet.Po ./$(DEPDIR)/net-yy-inet6.Po \ + ./$(DEPDIR)/net-yy-netlink.Po ./$(DEPDIR)/net-yy-unix.Po \ + ./$(DEPDIR)/netlink_audit.Po ./$(DEPDIR)/netlink_crypto.Po \ + ./$(DEPDIR)/netlink_generic.Po \ + ./$(DEPDIR)/netlink_inet_diag.Po \ + ./$(DEPDIR)/netlink_kobject_uevent.Po \ + ./$(DEPDIR)/netlink_netfilter.Po \ + ./$(DEPDIR)/netlink_netlink_diag.Po \ + ./$(DEPDIR)/netlink_protocol.Po ./$(DEPDIR)/netlink_route.Po \ + ./$(DEPDIR)/netlink_selinux.Po \ + ./$(DEPDIR)/netlink_sock_diag.Po \ + ./$(DEPDIR)/netlink_unix_diag.Po ./$(DEPDIR)/netlink_xfrm.Po \ + ./$(DEPDIR)/newfstatat-newfstatat.Po \ + ./$(DEPDIR)/nfnetlink_acct.Po \ + ./$(DEPDIR)/nfnetlink_cthelper.Po \ + ./$(DEPDIR)/nfnetlink_ctnetlink.Po \ + ./$(DEPDIR)/nfnetlink_ctnetlink_exp.Po \ + ./$(DEPDIR)/nfnetlink_cttimeout.Po \ + ./$(DEPDIR)/nfnetlink_ipset.Po \ + ./$(DEPDIR)/nfnetlink_nft_compat.Po \ + ./$(DEPDIR)/nfnetlink_nftables.Po ./$(DEPDIR)/nfnetlink_osf.Po \ + ./$(DEPDIR)/nfnetlink_queue.Po ./$(DEPDIR)/nfnetlink_ulog.Po \ + ./$(DEPDIR)/nlattr.Po ./$(DEPDIR)/nlattr_br_port_msg.Po \ + ./$(DEPDIR)/nlattr_crypto_user_alg.Po \ + ./$(DEPDIR)/nlattr_dcbmsg.Po \ + ./$(DEPDIR)/nlattr_fib_rule_hdr.Po \ + ./$(DEPDIR)/nlattr_ifaddrlblmsg.Po \ + ./$(DEPDIR)/nlattr_ifaddrmsg.Po \ + ./$(DEPDIR)/nlattr_ifinfomsg.Po \ + ./$(DEPDIR)/nlattr_ifla_af_spec.Po \ + ./$(DEPDIR)/nlattr_ifla_brport.Po \ + ./$(DEPDIR)/nlattr_ifla_linkinfo.Po \ + ./$(DEPDIR)/nlattr_ifla_port.Po ./$(DEPDIR)/nlattr_ifla_xdp.Po \ + ./$(DEPDIR)/nlattr_inet_diag_msg.Po \ + ./$(DEPDIR)/nlattr_inet_diag_req_compat.Po \ + ./$(DEPDIR)/nlattr_inet_diag_req_v2.Po \ + ./$(DEPDIR)/nlattr_mdba_mdb_entry.Po \ + ./$(DEPDIR)/nlattr_mdba_router_port.Po \ + ./$(DEPDIR)/nlattr_ndmsg.Po ./$(DEPDIR)/nlattr_ndtmsg.Po \ + ./$(DEPDIR)/nlattr_netconfmsg.Po \ + ./$(DEPDIR)/nlattr_netlink_diag_msg.Po \ + ./$(DEPDIR)/nlattr_nlmsgerr.Po \ + ./$(DEPDIR)/nlattr_packet_diag_msg.Po \ + ./$(DEPDIR)/nlattr_rtgenmsg.Po ./$(DEPDIR)/nlattr_rtmsg.Po \ + ./$(DEPDIR)/nlattr_smc_diag_msg.Po \ + ./$(DEPDIR)/nlattr_tc_stats.Po ./$(DEPDIR)/nlattr_tca_stab.Po \ + ./$(DEPDIR)/nlattr_tcamsg.Po ./$(DEPDIR)/nlattr_tcmsg.Po \ + ./$(DEPDIR)/nlattr_unix_diag_msg.Po ./$(DEPDIR)/nsyscalls-d.Po \ + ./$(DEPDIR)/nsyscalls.Po ./$(DEPDIR)/old_mmap-P.Po \ + ./$(DEPDIR)/old_mmap-Xabbrev.Po ./$(DEPDIR)/old_mmap-Xraw.Po \ + ./$(DEPDIR)/old_mmap-Xverbose.Po \ + ./$(DEPDIR)/old_mmap-v-none.Po ./$(DEPDIR)/old_mmap.Po \ + ./$(DEPDIR)/oldfstat.Po ./$(DEPDIR)/oldlstat.Po \ + ./$(DEPDIR)/oldselect-P.Po ./$(DEPDIR)/oldselect-efault-P.Po \ + ./$(DEPDIR)/oldselect-efault.Po ./$(DEPDIR)/oldselect.Po \ + ./$(DEPDIR)/oldstat.Po ./$(DEPDIR)/open.Po \ + ./$(DEPDIR)/openat.Po ./$(DEPDIR)/orphaned_process_group.Po \ + ./$(DEPDIR)/osf_utimes.Po ./$(DEPDIR)/pause.Po \ + ./$(DEPDIR)/pc.Po ./$(DEPDIR)/perf_event_open.Po \ + ./$(DEPDIR)/perf_event_open_nonverbose.Po \ + ./$(DEPDIR)/perf_event_open_unabbrev.Po \ + ./$(DEPDIR)/personality-Xabbrev.Po \ + ./$(DEPDIR)/personality-Xraw.Po \ + ./$(DEPDIR)/personality-Xverbose.Po ./$(DEPDIR)/personality.Po \ + ./$(DEPDIR)/pidfd_send_signal.Po ./$(DEPDIR)/pipe.Po \ + ./$(DEPDIR)/pipe2.Po ./$(DEPDIR)/pkey_alloc.Po \ + ./$(DEPDIR)/pkey_free.Po ./$(DEPDIR)/pkey_mprotect.Po \ + ./$(DEPDIR)/poll-P.Po ./$(DEPDIR)/poll.Po \ + ./$(DEPDIR)/ppoll-P.Po ./$(DEPDIR)/ppoll-v.Po \ + ./$(DEPDIR)/ppoll.Po ./$(DEPDIR)/prctl-arg2-intptr.Po \ + ./$(DEPDIR)/prctl-dumpable.Po ./$(DEPDIR)/prctl-name.Po \ + ./$(DEPDIR)/prctl-no-args.Po ./$(DEPDIR)/prctl-pdeathsig.Po \ + ./$(DEPDIR)/prctl-seccomp-filter-v.Po \ + ./$(DEPDIR)/prctl-seccomp-strict.Po \ + ./$(DEPDIR)/prctl-securebits.Po \ + ./$(DEPDIR)/prctl-spec-inject.Po \ + ./$(DEPDIR)/prctl-tid_address.Po ./$(DEPDIR)/prctl-tsc.Po \ + ./$(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po \ + ./$(DEPDIR)/preadv-preadv.Po ./$(DEPDIR)/preadv2-pwritev2.Po \ + ./$(DEPDIR)/preadv_pwritev-preadv-pwritev.Po \ + ./$(DEPDIR)/print_maxfd.Po \ + ./$(DEPDIR)/printpath-umovestr-peekdata.Po \ + ./$(DEPDIR)/printpath-umovestr-undumpable.Po \ + ./$(DEPDIR)/printpath-umovestr.Po \ + ./$(DEPDIR)/printsignal-Xabbrev.Po \ + ./$(DEPDIR)/printsignal-Xraw.Po \ + ./$(DEPDIR)/printsignal-Xverbose.Po ./$(DEPDIR)/printstr.Po \ + ./$(DEPDIR)/printstrn-umoven-peekdata.Po \ + ./$(DEPDIR)/printstrn-umoven-undumpable.Po \ + ./$(DEPDIR)/printstrn-umoven.Po ./$(DEPDIR)/prlimit64.Po \ + ./$(DEPDIR)/process_vm_readv.Po \ + ./$(DEPDIR)/process_vm_writev.Po ./$(DEPDIR)/pselect6.Po \ + ./$(DEPDIR)/ptrace.Po ./$(DEPDIR)/ptrace_syscall_info.Po \ + ./$(DEPDIR)/pwritev-pwritev.Po ./$(DEPDIR)/qual_fault.Po \ + ./$(DEPDIR)/qual_inject-error-signal.Po \ + ./$(DEPDIR)/qual_inject-retval.Po \ + ./$(DEPDIR)/qual_inject-signal.Po ./$(DEPDIR)/qual_signal.Po \ + ./$(DEPDIR)/quotactl-Xabbrev.Po ./$(DEPDIR)/quotactl-Xraw.Po \ + ./$(DEPDIR)/quotactl-Xverbose.Po \ + ./$(DEPDIR)/quotactl-success-v.Po \ + ./$(DEPDIR)/quotactl-success.Po ./$(DEPDIR)/quotactl-v.Po \ + ./$(DEPDIR)/quotactl-xfs-success-v.Po \ + ./$(DEPDIR)/quotactl-xfs-success.Po \ + ./$(DEPDIR)/quotactl-xfs-v.Po ./$(DEPDIR)/quotactl-xfs.Po \ + ./$(DEPDIR)/quotactl.Po ./$(DEPDIR)/read-write.Po \ + ./$(DEPDIR)/readahead.Po ./$(DEPDIR)/readdir.Po \ + ./$(DEPDIR)/readlink.Po ./$(DEPDIR)/readlinkat.Po \ + ./$(DEPDIR)/readv.Po ./$(DEPDIR)/reboot.Po \ + ./$(DEPDIR)/recvfrom.Po ./$(DEPDIR)/recvmmsg-timeout.Po \ + ./$(DEPDIR)/recvmsg.Po ./$(DEPDIR)/redirect-fds.Po \ + ./$(DEPDIR)/remap_file_pages-Xabbrev.Po \ + ./$(DEPDIR)/remap_file_pages-Xraw.Po \ + ./$(DEPDIR)/remap_file_pages-Xverbose.Po \ + ./$(DEPDIR)/remap_file_pages.Po ./$(DEPDIR)/rename.Po \ + ./$(DEPDIR)/renameat.Po ./$(DEPDIR)/renameat2.Po \ + ./$(DEPDIR)/request_key.Po ./$(DEPDIR)/restart_syscall.Po \ + ./$(DEPDIR)/riscv_flush_icache.Po ./$(DEPDIR)/rmdir.Po \ + ./$(DEPDIR)/rt_sigaction.Po ./$(DEPDIR)/rt_sigpending.Po \ + ./$(DEPDIR)/rt_sigprocmask.Po ./$(DEPDIR)/rt_sigqueueinfo.Po \ + ./$(DEPDIR)/rt_sigreturn.Po ./$(DEPDIR)/rt_sigsuspend.Po \ + ./$(DEPDIR)/rt_sigtimedwait.Po \ + ./$(DEPDIR)/rt_tgsigqueueinfo.Po \ + ./$(DEPDIR)/run_expect_termsig.Po \ + ./$(DEPDIR)/s390_guarded_storage-v.Po \ + ./$(DEPDIR)/s390_guarded_storage.Po \ + ./$(DEPDIR)/s390_pci_mmio_read_write.Po \ + ./$(DEPDIR)/s390_runtime_instr.Po ./$(DEPDIR)/s390_sthyi-v.Po \ + ./$(DEPDIR)/s390_sthyi.Po \ + ./$(DEPDIR)/sched_get_priority_mxx.Po \ + ./$(DEPDIR)/sched_rr_get_interval.Po \ + ./$(DEPDIR)/sched_xetaffinity.Po ./$(DEPDIR)/sched_xetattr.Po \ + ./$(DEPDIR)/sched_xetparam.Po \ + ./$(DEPDIR)/sched_xetscheduler.Po ./$(DEPDIR)/sched_yield.Po \ + ./$(DEPDIR)/scm_rights.Po ./$(DEPDIR)/seccomp-filter-v.Po \ + ./$(DEPDIR)/seccomp-filter.Po ./$(DEPDIR)/seccomp-strict.Po \ + ./$(DEPDIR)/seccomp_get_action_avail.Po \ + ./$(DEPDIR)/select-P.Po ./$(DEPDIR)/select.Po \ + ./$(DEPDIR)/semop.Po ./$(DEPDIR)/sendfile.Po \ + ./$(DEPDIR)/sendfile64.Po ./$(DEPDIR)/set_mempolicy.Po \ + ./$(DEPDIR)/set_ptracer_any.Po ./$(DEPDIR)/set_sigblock.Po \ + ./$(DEPDIR)/set_sigign.Po ./$(DEPDIR)/setdomainname.Po \ + ./$(DEPDIR)/setfsgid.Po ./$(DEPDIR)/setfsgid32.Po \ + ./$(DEPDIR)/setfsuid.Po ./$(DEPDIR)/setfsuid32.Po \ + ./$(DEPDIR)/setgid.Po ./$(DEPDIR)/setgid32.Po \ + ./$(DEPDIR)/setgroups.Po ./$(DEPDIR)/setgroups32.Po \ + ./$(DEPDIR)/sethostname.Po ./$(DEPDIR)/setns.Po \ + ./$(DEPDIR)/setregid.Po ./$(DEPDIR)/setregid32.Po \ + ./$(DEPDIR)/setresgid.Po ./$(DEPDIR)/setresgid32.Po \ + ./$(DEPDIR)/setresuid.Po ./$(DEPDIR)/setresuid32.Po \ + ./$(DEPDIR)/setreuid.Po ./$(DEPDIR)/setreuid32.Po \ + ./$(DEPDIR)/setrlimit-Xabbrev.Po ./$(DEPDIR)/setrlimit-Xraw.Po \ + ./$(DEPDIR)/setrlimit-Xverbose.Po ./$(DEPDIR)/setrlimit.Po \ + ./$(DEPDIR)/setuid.Po ./$(DEPDIR)/setuid32.Po \ + ./$(DEPDIR)/shmxt.Po ./$(DEPDIR)/shutdown.Po \ + ./$(DEPDIR)/sigaction.Po ./$(DEPDIR)/sigaltstack.Po \ + ./$(DEPDIR)/siginfo.Po ./$(DEPDIR)/signal.Po \ + ./$(DEPDIR)/signal_receive.Po ./$(DEPDIR)/signalfd4.Po \ + ./$(DEPDIR)/sigpending.Po ./$(DEPDIR)/sigprocmask.Po \ + ./$(DEPDIR)/sigreturn.Po ./$(DEPDIR)/sigsuspend.Po \ + ./$(DEPDIR)/sleep.Po ./$(DEPDIR)/so_error.Po \ + ./$(DEPDIR)/so_linger.Po ./$(DEPDIR)/so_peercred-Xabbrev.Po \ + ./$(DEPDIR)/so_peercred-Xraw.Po \ + ./$(DEPDIR)/so_peercred-Xverbose.Po ./$(DEPDIR)/so_peercred.Po \ + ./$(DEPDIR)/sock_filter-v-Xabbrev.Po \ + ./$(DEPDIR)/sock_filter-v-Xraw.Po \ + ./$(DEPDIR)/sock_filter-v-Xverbose.Po \ + ./$(DEPDIR)/sock_filter-v.Po \ + ./$(DEPDIR)/sockaddr_xlat-Xabbrev.Po \ + ./$(DEPDIR)/sockaddr_xlat-Xraw.Po \ + ./$(DEPDIR)/sockaddr_xlat-Xverbose.Po \ + ./$(DEPDIR)/socketcall.Po ./$(DEPDIR)/sockopt-sol_netlink.Po \ + ./$(DEPDIR)/sockopt-timestamp.Po ./$(DEPDIR)/splice.Po \ + ./$(DEPDIR)/stack-fcall-0.Po ./$(DEPDIR)/stack-fcall-1.Po \ + ./$(DEPDIR)/stack-fcall-2.Po ./$(DEPDIR)/stack-fcall-3.Po \ + ./$(DEPDIR)/stack-fcall-mangled-0.Po \ + ./$(DEPDIR)/stack-fcall-mangled-1.Po \ + ./$(DEPDIR)/stack-fcall-mangled-2.Po \ + ./$(DEPDIR)/stack-fcall-mangled-3.Po \ + ./$(DEPDIR)/stack-fcall-mangled.Po ./$(DEPDIR)/stack-fcall.Po \ + ./$(DEPDIR)/stat.Po ./$(DEPDIR)/stat64-stat64.Po \ + ./$(DEPDIR)/statfs-statfs.Po ./$(DEPDIR)/statfs64.Po \ + ./$(DEPDIR)/statx.Po ./$(DEPDIR)/swap.Po \ + ./$(DEPDIR)/sxetmask.Po ./$(DEPDIR)/symlink.Po \ + ./$(DEPDIR)/symlinkat.Po ./$(DEPDIR)/sync.Po \ + ./$(DEPDIR)/sync_file_range.Po ./$(DEPDIR)/sync_file_range2.Po \ + ./$(DEPDIR)/sysinfo.Po ./$(DEPDIR)/syslog.Po \ + ./$(DEPDIR)/tee.Po ./$(DEPDIR)/threads-execve.Po \ + ./$(DEPDIR)/time.Po ./$(DEPDIR)/timer_create.Po \ + ./$(DEPDIR)/timer_xettime.Po ./$(DEPDIR)/timerfd_xettime.Po \ + ./$(DEPDIR)/times-fail.Po ./$(DEPDIR)/times.Po \ + ./$(DEPDIR)/truncate.Po ./$(DEPDIR)/truncate64-truncate64.Po \ + ./$(DEPDIR)/ugetrlimit.Po ./$(DEPDIR)/uio-uio.Po \ + ./$(DEPDIR)/umask.Po ./$(DEPDIR)/umount.Po \ + ./$(DEPDIR)/umount2.Po ./$(DEPDIR)/umoven-illptr.Po \ + ./$(DEPDIR)/umovestr-illptr.Po ./$(DEPDIR)/umovestr.Po \ + ./$(DEPDIR)/umovestr2.Po ./$(DEPDIR)/umovestr3.Po \ + ./$(DEPDIR)/uname.Po ./$(DEPDIR)/unblock_reset_raise.Po \ + ./$(DEPDIR)/unix-pair-send-recv.Po \ + ./$(DEPDIR)/unix-pair-sendto-recvfrom.Po ./$(DEPDIR)/unlink.Po \ + ./$(DEPDIR)/unlinkat.Po ./$(DEPDIR)/unshare.Po \ + ./$(DEPDIR)/userfaultfd.Po ./$(DEPDIR)/ustat.Po \ + ./$(DEPDIR)/utime.Po ./$(DEPDIR)/utimensat-Xabbrev.Po \ + ./$(DEPDIR)/utimensat-Xraw.Po \ + ./$(DEPDIR)/utimensat-Xverbose.Po ./$(DEPDIR)/utimensat.Po \ + ./$(DEPDIR)/utimes.Po ./$(DEPDIR)/vfork-f.Po \ + ./$(DEPDIR)/vhangup.Po ./$(DEPDIR)/vmsplice.Po \ + ./$(DEPDIR)/wait4-v.Po ./$(DEPDIR)/wait4.Po \ + ./$(DEPDIR)/waitid-v.Po ./$(DEPDIR)/waitid.Po \ + ./$(DEPDIR)/waitpid.Po ./$(DEPDIR)/xattr-strings.Po \ + ./$(DEPDIR)/xattr.Po ./$(DEPDIR)/xet_robust_list.Po \ + ./$(DEPDIR)/xet_thread_area_x86.Po ./$(DEPDIR)/xetitimer.Po \ + ./$(DEPDIR)/xetpgid.Po ./$(DEPDIR)/xetpriority.Po \ + ./$(DEPDIR)/xettimeofday.Po ./$(DEPDIR)/zeroargc.Po am__mv = mv -f AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) @@ -1835,182 +3302,349 @@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(libtests_a_SOURCES) _newselect.c accept.c accept4.c \ - access.c acct.c add_key.c adjtimex.c aio.c alarm.c answer.c \ - attach-f-p.c attach-f-p-cmd.c attach-p-cmd-cmd.c \ - attach-p-cmd-p.c bpf.c brk.c btrfs.c caps.c caps-abbrev.c \ - chmod.c chown.c chown32.c chroot.c clock_adjtime.c \ - clock_nanosleep.c clock_xettime.c copy_file_range.c count-f.c \ - creat.c delete_module.c dup.c dup2.c dup3.c epoll_create.c \ - epoll_create1.c epoll_ctl.c epoll_pwait.c epoll_wait.c \ - erestartsys.c eventfd.c execve.c execve-v.c execveat.c \ - execveat-v.c faccessat.c fadvise64.c fadvise64_64.c \ - fallocate.c fanotify_init.c fanotify_mark.c fchdir.c fchmod.c \ - fchmodat.c fchown.c fchown32.c fchownat.c fcntl.c fcntl64.c \ - fdatasync.c file_handle.c file_ioctl.c filter-unavailable.c \ - finit_module.c flock.c fork-f.c fstat.c fstat64.c fstatat64.c \ - fstatfs.c fstatfs64.c fsync.c ftruncate.c ftruncate64.c \ - futex.c futimesat.c get_mempolicy.c getcpu.c getcwd.c \ - getdents.c getdents64.c getegid.c getegid32.c geteuid.c \ - geteuid32.c getgid.c getgid32.c getgroups.c getgroups32.c \ - getpeername.c getpgrp.c getrandom.c getresgid.c getresgid32.c \ +SOURCES = $(libtests_a_SOURCES) _newselect.c _newselect-P.c accept.c \ + accept4.c access.c acct.c add_key.c adjtimex.c aio.c \ + aio_pgetevents.c alarm.c answer.c attach-f-p.c \ + attach-f-p-cmd.c attach-p-cmd-cmd.c attach-p-cmd-p.c \ + block_reset_raise_run.c bpf.c bpf-obj_get_info_by_fd.c \ + bpf-obj_get_info_by_fd-prog.c bpf-obj_get_info_by_fd-prog-v.c \ + bpf-obj_get_info_by_fd-v.c bpf-success.c bpf-success-v.c \ + bpf-v.c brk.c btrfs.c caps.c caps-abbrev.c check_sigblock.c \ + check_sigign.c chmod.c chown.c chown32.c chroot.c \ + clock_adjtime.c clock_nanosleep.c clock_xettime.c \ + clone_parent.c clone_ptrace.c copy_file_range.c count-f.c \ + creat.c delay.c delete_module.c dev-yy.c dup.c dup2.c dup3.c \ + epoll_create.c epoll_create1.c epoll_ctl.c epoll_pwait.c \ + epoll_wait.c erestartsys.c eventfd.c execve.c execve-v.c \ + execveat.c execveat-v.c faccessat.c fadvise64.c fadvise64_64.c \ + fallocate.c fanotify_init.c fanotify_mark.c \ + fanotify_mark-Xabbrev.c fanotify_mark-Xraw.c \ + fanotify_mark-Xverbose.c fchdir.c fchmod.c fchmodat.c fchown.c \ + fchown32.c fchownat.c fcntl.c fcntl64.c fdatasync.c fflush.c \ + file_handle.c file_ioctl.c filter-unavailable.c finit_module.c \ + flock.c fork-f.c fstat.c fstat-Xabbrev.c fstat-Xraw.c \ + fstat-Xverbose.c fstat64.c fstat64-Xabbrev.c fstat64-Xraw.c \ + fstat64-Xverbose.c fstatat64.c fstatfs.c fstatfs64.c fsync.c \ + fsync-y.c ftruncate.c ftruncate64.c futex.c futimesat.c \ + get_mempolicy.c getcpu.c getcwd.c getdents.c getdents64.c \ + getegid.c getegid32.c geteuid.c geteuid32.c getgid.c \ + getgid32.c getgroups.c getgroups32.c getpeername.c getpgrp.c \ + getpid.c getppid.c getrandom.c getresgid.c getresgid32.c \ getresuid.c getresuid32.c getrlimit.c getrusage.c getsid.c \ - getsockname.c getuid.c getuid32.c getxxid.c inet-cmsg.c \ - init_module.c inotify.c inotify_init1.c ioctl.c ioctl_block.c \ - ioctl_dm.c ioctl_dm-v.c ioctl_evdev.c ioctl_evdev-v.c \ + getsockname.c gettid.c getuid.c getuid32.c getxxid.c \ + group_req.c inet-cmsg.c init_module.c inject-nf.c inotify.c \ + inotify_init1.c int_0x80.c io_uring_enter.c \ + io_uring_register.c io_uring_setup.c ioctl.c ioctl_block.c \ + ioctl_dm.c ioctl_dm-v.c ioctl_evdev.c ioctl_evdev-success.c \ + ioctl_evdev-success-v.c ioctl_evdev-v.c ioctl_inotify.c \ + ioctl_kvm_run.c ioctl_kvm_run-v.c ioctl_kvm_run_auxstr_vcpu.c \ ioctl_loop.c ioctl_loop-nv.c ioctl_loop-v.c ioctl_mtd.c \ - ioctl_rtc.c ioctl_rtc-v.c ioctl_scsi.c ioctl_sg_io_v3.c \ - ioctl_sg_io_v4.c ioctl_sock_gifconf.c ioctl_uffdio.c \ - ioctl_v4l2.c ioperm.c iopl.c ioprio.c ip_mreq.c ipc.c \ - ipc_msg.c ipc_msgbuf.c ipc_sem.c ipc_shm.c kcmp.c \ - kexec_file_load.c kexec_load.c keyctl.c kill.c ksysent.c \ - lchown.c lchown32.c link.c linkat.c llseek.c lookup_dcookie.c \ - lseek.c lstat.c lstat64.c mbind.c membarrier.c memfd_create.c \ - migrate_pages.c mincore.c mkdir.c mkdirat.c mknod.c mknodat.c \ - mlock.c mlock2.c mlockall.c mmap.c mmap64.c mmsg.c \ - mmsg-silent.c mmsg_name.c mmsg_name-v.c mount.c move_pages.c \ + ioctl_nbd.c ioctl_nsfs.c ioctl_perf.c ioctl_perf-success.c \ + ioctl_ptp.c ioctl_random.c ioctl_rtc.c ioctl_rtc-v.c \ + ioctl_scsi.c ioctl_sg_io_v3.c ioctl_sg_io_v4.c \ + ioctl_sock_gifconf.c ioctl_uffdio.c ioctl_v4l2.c ioperm.c \ + iopl.c ioprio.c ioprio-Xabbrev.c ioprio-Xraw.c \ + ioprio-Xverbose.c ip_mreq.c ipc.c ipc_msg.c ipc_msg-Xabbrev.c \ + ipc_msg-Xraw.c ipc_msg-Xverbose.c ipc_msgbuf.c \ + ipc_msgbuf-Xabbrev.c ipc_msgbuf-Xraw.c ipc_msgbuf-Xverbose.c \ + ipc_sem.c ipc_sem-Xabbrev.c ipc_sem-Xraw.c ipc_sem-Xverbose.c \ + ipc_shm.c ipc_shm-Xabbrev.c ipc_shm-Xraw.c ipc_shm-Xverbose.c \ + is_linux_mips_n64.c kcmp.c kcmp-y.c kern_features.c \ + kernel_version.c kernel_version-Xabbrev.c \ + kernel_version-Xraw.c kernel_version-Xverbose.c \ + kexec_file_load.c kexec_load.c keyctl.c keyctl-Xabbrev.c \ + keyctl-Xraw.c keyctl-Xverbose.c kill.c kill_child.c ksysent.c \ + lchown.c lchown32.c link.c linkat.c list_sigaction_signum.c \ + llseek.c localtime.c lookup_dcookie.c looping_threads.c \ + lseek.c lstat.c lstat64.c madvise.c mbind.c membarrier.c \ + memfd_create.c memfd_create-Xabbrev.c memfd_create-Xraw.c \ + memfd_create-Xverbose.c migrate_pages.c mincore.c mkdir.c \ + mkdirat.c mknod.c mknodat.c mlock.c mlock2.c mlockall.c mmap.c \ + mmap-Xabbrev.c mmap-Xraw.c mmap-Xverbose.c mmap64.c \ + mmap64-Xabbrev.c mmap64-Xraw.c mmap64-Xverbose.c mmsg.c \ + mmsg-silent.c mmsg_name.c mmsg_name-v.c modify_ldt.c mount.c \ + mount-Xabbrev.c mount-Xraw.c mount-Xverbose.c move_pages.c \ + move_pages-Xabbrev.c move_pages-Xraw.c move_pages-Xverbose.c \ mq.c mq_sendrecv.c mq_sendrecv-read.c mq_sendrecv-write.c \ msg_control.c msg_control-v.c msg_name.c munlockall.c \ nanosleep.c net-accept-connect.c net-icmp_filter.c \ - net-sockaddr.c net-y-unix.c net-yy-inet.c net-yy-netlink.c \ - net-yy-unix.c netlink_inet_diag.c netlink_netlink_diag.c \ - netlink_protocol.c netlink_unix_diag.c newfstatat.c \ - nsyscalls.c old_mmap.c oldfstat.c oldlstat.c oldselect.c \ - oldstat.c open.c openat.c pause.c pc.c perf_event_open.c \ - perf_event_open_nonverbose.c perf_event_open_unabbrev.c \ - personality.c pipe.c pipe2.c pkey_alloc.c pkey_free.c \ - pkey_mprotect.c poll.c ppoll.c prctl-arg2-intptr.c \ + net-packet_mreq.c net-packet_mreq-Xabbrev.c \ + net-packet_mreq-Xraw.c net-packet_mreq-Xverbose.c \ + net-sockaddr.c net-tpacket_req.c net-tpacket_stats.c \ + net-tpacket_stats-success.c net-y-unix.c net-yy-inet.c \ + net-yy-inet6.c net-yy-netlink.c net-yy-unix.c netlink_audit.c \ + netlink_crypto.c netlink_generic.c netlink_inet_diag.c \ + netlink_kobject_uevent.c netlink_netfilter.c \ + netlink_netlink_diag.c netlink_protocol.c netlink_route.c \ + netlink_selinux.c netlink_sock_diag.c netlink_unix_diag.c \ + netlink_xfrm.c newfstatat.c nfnetlink_acct.c \ + nfnetlink_cthelper.c nfnetlink_ctnetlink.c \ + nfnetlink_ctnetlink_exp.c nfnetlink_cttimeout.c \ + nfnetlink_ipset.c nfnetlink_nft_compat.c nfnetlink_nftables.c \ + nfnetlink_osf.c nfnetlink_queue.c nfnetlink_ulog.c nlattr.c \ + nlattr_br_port_msg.c nlattr_crypto_user_alg.c nlattr_dcbmsg.c \ + nlattr_fib_rule_hdr.c nlattr_ifaddrlblmsg.c nlattr_ifaddrmsg.c \ + nlattr_ifinfomsg.c nlattr_ifla_af_spec.c nlattr_ifla_brport.c \ + nlattr_ifla_linkinfo.c nlattr_ifla_port.c nlattr_ifla_xdp.c \ + nlattr_inet_diag_msg.c nlattr_inet_diag_req_compat.c \ + nlattr_inet_diag_req_v2.c nlattr_mdba_mdb_entry.c \ + nlattr_mdba_router_port.c nlattr_ndmsg.c nlattr_ndtmsg.c \ + nlattr_netconfmsg.c nlattr_netlink_diag_msg.c \ + nlattr_nlmsgerr.c nlattr_packet_diag_msg.c nlattr_rtgenmsg.c \ + nlattr_rtmsg.c nlattr_smc_diag_msg.c nlattr_tc_stats.c \ + nlattr_tca_stab.c nlattr_tcamsg.c nlattr_tcmsg.c \ + nlattr_unix_diag_msg.c nsyscalls.c nsyscalls-d.c old_mmap.c \ + old_mmap-P.c old_mmap-Xabbrev.c old_mmap-Xraw.c \ + old_mmap-Xverbose.c old_mmap-v-none.c oldfstat.c oldlstat.c \ + oldselect.c oldselect-P.c oldselect-efault.c \ + oldselect-efault-P.c oldstat.c open.c openat.c \ + orphaned_process_group.c osf_utimes.c pause.c pc.c \ + perf_event_open.c perf_event_open_nonverbose.c \ + perf_event_open_unabbrev.c personality.c personality-Xabbrev.c \ + personality-Xraw.c personality-Xverbose.c pidfd_send_signal.c \ + pipe.c pipe2.c pkey_alloc.c pkey_free.c pkey_mprotect.c poll.c \ + poll-P.c ppoll.c ppoll-P.c ppoll-v.c prctl-arg2-intptr.c \ prctl-dumpable.c prctl-name.c prctl-no-args.c \ prctl-pdeathsig.c prctl-seccomp-filter-v.c \ - prctl-seccomp-strict.c prctl-securebits.c prctl-tid_address.c \ - prctl-tsc.c pread64-pwrite64.c preadv.c preadv-pwritev.c \ - preadv2-pwritev2.c print_maxfd.c printstr.c prlimit64.c \ - process_vm_readv.c process_vm_writev.c pselect6.c ptrace.c \ + prctl-seccomp-strict.c prctl-securebits.c prctl-spec-inject.c \ + prctl-tid_address.c prctl-tsc.c pread64-pwrite64.c preadv.c \ + preadv-pwritev.c preadv2-pwritev2.c print_maxfd.c \ + printpath-umovestr.c printpath-umovestr-peekdata.c \ + printpath-umovestr-undumpable.c printsignal-Xabbrev.c \ + printsignal-Xraw.c printsignal-Xverbose.c printstr.c \ + printstrn-umoven.c printstrn-umoven-peekdata.c \ + printstrn-umoven-undumpable.c prlimit64.c process_vm_readv.c \ + process_vm_writev.c pselect6.c ptrace.c ptrace_syscall_info.c \ pwritev.c qual_fault.c qual_inject-error-signal.c \ qual_inject-retval.c qual_inject-signal.c qual_signal.c \ - quotactl.c quotactl-v.c quotactl-xfs.c quotactl-xfs-v.c \ - read-write.c readahead.c readdir.c readlink.c readlinkat.c \ - readv.c reboot.c recvfrom.c recvmmsg-timeout.c recvmsg.c \ - redirect-fds.c remap_file_pages.c rename.c renameat.c \ - renameat2.c request_key.c restart_syscall.c rmdir.c \ - rt_sigpending.c rt_sigprocmask.c rt_sigqueueinfo.c \ + quotactl.c quotactl-Xabbrev.c quotactl-Xraw.c \ + quotactl-Xverbose.c quotactl-success.c quotactl-success-v.c \ + quotactl-v.c quotactl-xfs.c quotactl-xfs-success.c \ + quotactl-xfs-success-v.c quotactl-xfs-v.c read-write.c \ + readahead.c readdir.c readlink.c readlinkat.c readv.c reboot.c \ + recvfrom.c recvmmsg-timeout.c recvmsg.c redirect-fds.c \ + remap_file_pages.c remap_file_pages-Xabbrev.c \ + remap_file_pages-Xraw.c remap_file_pages-Xverbose.c rename.c \ + renameat.c renameat2.c request_key.c restart_syscall.c \ + riscv_flush_icache.c rmdir.c rt_sigaction.c rt_sigpending.c \ + rt_sigprocmask.c rt_sigqueueinfo.c rt_sigreturn.c \ rt_sigsuspend.c rt_sigtimedwait.c rt_tgsigqueueinfo.c \ + run_expect_termsig.c s390_guarded_storage.c \ + s390_guarded_storage-v.c s390_pci_mmio_read_write.c \ + s390_runtime_instr.c s390_sthyi.c s390_sthyi-v.c \ sched_get_priority_mxx.c sched_rr_get_interval.c \ sched_xetaffinity.c sched_xetattr.c sched_xetparam.c \ sched_xetscheduler.c sched_yield.c scm_rights.c \ - seccomp-filter.c seccomp-filter-v.c seccomp-strict.c select.c \ - semop.c sendfile.c sendfile64.c set_mempolicy.c \ - set_ptracer_any.c setdomainname.c setfsgid.c setfsgid32.c \ - setfsuid.c setfsuid32.c setgid.c setgid32.c setgroups.c \ - setgroups32.c sethostname.c setns.c setregid.c setregid32.c \ - setresgid.c setresgid32.c setresuid.c setresuid32.c setreuid.c \ - setreuid32.c setrlimit.c setuid.c setuid32.c shmxt.c \ - shutdown.c sigaction.c sigaltstack.c siginfo.c \ - signal_receive.c signalfd4.c sigreturn.c sleep.c socketcall.c \ - splice.c $(stack_fcall_SOURCES) stat.c stat64.c statfs.c \ - statfs64.c swap.c symlink.c symlinkat.c sync.c \ - sync_file_range.c sync_file_range2.c sysinfo.c syslog.c tee.c \ - threads-execve.c time.c timer_create.c timer_xettime.c \ - timerfd_xettime.c times.c times-fail.c truncate.c truncate64.c \ - ugetrlimit.c uio.c umask.c umount.c umount2.c umoven-illptr.c \ - umovestr.c umovestr-illptr.c umovestr2.c umovestr3.c uname.c \ - unix-pair-send-recv.c unix-pair-sendto-recvfrom.c unlink.c \ - unlinkat.c unshare.c userfaultfd.c ustat.c utime.c utimensat.c \ - utimes.c vfork-f.c vhangup.c vmsplice.c wait4.c wait4-v.c \ - waitid.c waitid-v.c waitpid.c xattr.c xattr-strings.c \ - xet_robust_list.c xetitimer.c xetpgid.c xetpriority.c \ - xettimeofday.c -DIST_SOURCES = $(libtests_a_SOURCES) _newselect.c accept.c accept4.c \ - access.c acct.c add_key.c adjtimex.c aio.c alarm.c answer.c \ - attach-f-p.c attach-f-p-cmd.c attach-p-cmd-cmd.c \ - attach-p-cmd-p.c bpf.c brk.c btrfs.c caps.c caps-abbrev.c \ - chmod.c chown.c chown32.c chroot.c clock_adjtime.c \ - clock_nanosleep.c clock_xettime.c copy_file_range.c count-f.c \ - creat.c delete_module.c dup.c dup2.c dup3.c epoll_create.c \ - epoll_create1.c epoll_ctl.c epoll_pwait.c epoll_wait.c \ - erestartsys.c eventfd.c execve.c execve-v.c execveat.c \ - execveat-v.c faccessat.c fadvise64.c fadvise64_64.c \ - fallocate.c fanotify_init.c fanotify_mark.c fchdir.c fchmod.c \ - fchmodat.c fchown.c fchown32.c fchownat.c fcntl.c fcntl64.c \ - fdatasync.c file_handle.c file_ioctl.c filter-unavailable.c \ - finit_module.c flock.c fork-f.c fstat.c fstat64.c fstatat64.c \ - fstatfs.c fstatfs64.c fsync.c ftruncate.c ftruncate64.c \ - futex.c futimesat.c get_mempolicy.c getcpu.c getcwd.c \ - getdents.c getdents64.c getegid.c getegid32.c geteuid.c \ - geteuid32.c getgid.c getgid32.c getgroups.c getgroups32.c \ - getpeername.c getpgrp.c getrandom.c getresgid.c getresgid32.c \ + seccomp-filter.c seccomp-filter-v.c seccomp-strict.c \ + seccomp_get_action_avail.c select.c select-P.c semop.c \ + sendfile.c sendfile64.c set_mempolicy.c set_ptracer_any.c \ + set_sigblock.c set_sigign.c setdomainname.c setfsgid.c \ + setfsgid32.c setfsuid.c setfsuid32.c setgid.c setgid32.c \ + setgroups.c setgroups32.c sethostname.c setns.c setregid.c \ + setregid32.c setresgid.c setresgid32.c setresuid.c \ + setresuid32.c setreuid.c setreuid32.c setrlimit.c \ + setrlimit-Xabbrev.c setrlimit-Xraw.c setrlimit-Xverbose.c \ + setuid.c setuid32.c shmxt.c shutdown.c sigaction.c \ + sigaltstack.c siginfo.c signal.c signal_receive.c signalfd4.c \ + sigpending.c sigprocmask.c sigreturn.c sigsuspend.c sleep.c \ + so_error.c so_linger.c so_peercred.c so_peercred-Xabbrev.c \ + so_peercred-Xraw.c so_peercred-Xverbose.c sock_filter-v.c \ + sock_filter-v-Xabbrev.c sock_filter-v-Xraw.c \ + sock_filter-v-Xverbose.c sockaddr_xlat-Xabbrev.c \ + sockaddr_xlat-Xraw.c sockaddr_xlat-Xverbose.c socketcall.c \ + sockopt-sol_netlink.c sockopt-timestamp.c splice.c \ + $(stack_fcall_SOURCES) $(stack_fcall_mangled_SOURCES) stat.c \ + stat64.c statfs.c statfs64.c statx.c swap.c sxetmask.c \ + symlink.c symlinkat.c sync.c sync_file_range.c \ + sync_file_range2.c sysinfo.c syslog.c tee.c threads-execve.c \ + time.c timer_create.c timer_xettime.c timerfd_xettime.c \ + times.c times-fail.c truncate.c truncate64.c ugetrlimit.c \ + uio.c umask.c umount.c umount2.c umoven-illptr.c umovestr.c \ + umovestr-illptr.c umovestr2.c umovestr3.c uname.c \ + unblock_reset_raise.c unix-pair-send-recv.c \ + unix-pair-sendto-recvfrom.c unlink.c unlinkat.c unshare.c \ + userfaultfd.c ustat.c utime.c utimensat.c utimensat-Xabbrev.c \ + utimensat-Xraw.c utimensat-Xverbose.c utimes.c vfork-f.c \ + vhangup.c vmsplice.c wait4.c wait4-v.c waitid.c waitid-v.c \ + waitpid.c xattr.c xattr-strings.c xet_robust_list.c \ + xet_thread_area_x86.c xetitimer.c xetpgid.c xetpriority.c \ + xettimeofday.c zeroargc.c +DIST_SOURCES = $(libtests_a_SOURCES) _newselect.c _newselect-P.c \ + accept.c accept4.c access.c acct.c add_key.c adjtimex.c aio.c \ + aio_pgetevents.c alarm.c answer.c attach-f-p.c \ + attach-f-p-cmd.c attach-p-cmd-cmd.c attach-p-cmd-p.c \ + block_reset_raise_run.c bpf.c bpf-obj_get_info_by_fd.c \ + bpf-obj_get_info_by_fd-prog.c bpf-obj_get_info_by_fd-prog-v.c \ + bpf-obj_get_info_by_fd-v.c bpf-success.c bpf-success-v.c \ + bpf-v.c brk.c btrfs.c caps.c caps-abbrev.c check_sigblock.c \ + check_sigign.c chmod.c chown.c chown32.c chroot.c \ + clock_adjtime.c clock_nanosleep.c clock_xettime.c \ + clone_parent.c clone_ptrace.c copy_file_range.c count-f.c \ + creat.c delay.c delete_module.c dev-yy.c dup.c dup2.c dup3.c \ + epoll_create.c epoll_create1.c epoll_ctl.c epoll_pwait.c \ + epoll_wait.c erestartsys.c eventfd.c execve.c execve-v.c \ + execveat.c execveat-v.c faccessat.c fadvise64.c fadvise64_64.c \ + fallocate.c fanotify_init.c fanotify_mark.c \ + fanotify_mark-Xabbrev.c fanotify_mark-Xraw.c \ + fanotify_mark-Xverbose.c fchdir.c fchmod.c fchmodat.c fchown.c \ + fchown32.c fchownat.c fcntl.c fcntl64.c fdatasync.c fflush.c \ + file_handle.c file_ioctl.c filter-unavailable.c finit_module.c \ + flock.c fork-f.c fstat.c fstat-Xabbrev.c fstat-Xraw.c \ + fstat-Xverbose.c fstat64.c fstat64-Xabbrev.c fstat64-Xraw.c \ + fstat64-Xverbose.c fstatat64.c fstatfs.c fstatfs64.c fsync.c \ + fsync-y.c ftruncate.c ftruncate64.c futex.c futimesat.c \ + get_mempolicy.c getcpu.c getcwd.c getdents.c getdents64.c \ + getegid.c getegid32.c geteuid.c geteuid32.c getgid.c \ + getgid32.c getgroups.c getgroups32.c getpeername.c getpgrp.c \ + getpid.c getppid.c getrandom.c getresgid.c getresgid32.c \ getresuid.c getresuid32.c getrlimit.c getrusage.c getsid.c \ - getsockname.c getuid.c getuid32.c getxxid.c inet-cmsg.c \ - init_module.c inotify.c inotify_init1.c ioctl.c ioctl_block.c \ - ioctl_dm.c ioctl_dm-v.c ioctl_evdev.c ioctl_evdev-v.c \ + getsockname.c gettid.c getuid.c getuid32.c getxxid.c \ + group_req.c inet-cmsg.c init_module.c inject-nf.c inotify.c \ + inotify_init1.c int_0x80.c io_uring_enter.c \ + io_uring_register.c io_uring_setup.c ioctl.c ioctl_block.c \ + ioctl_dm.c ioctl_dm-v.c ioctl_evdev.c ioctl_evdev-success.c \ + ioctl_evdev-success-v.c ioctl_evdev-v.c ioctl_inotify.c \ + ioctl_kvm_run.c ioctl_kvm_run-v.c ioctl_kvm_run_auxstr_vcpu.c \ ioctl_loop.c ioctl_loop-nv.c ioctl_loop-v.c ioctl_mtd.c \ - ioctl_rtc.c ioctl_rtc-v.c ioctl_scsi.c ioctl_sg_io_v3.c \ - ioctl_sg_io_v4.c ioctl_sock_gifconf.c ioctl_uffdio.c \ - ioctl_v4l2.c ioperm.c iopl.c ioprio.c ip_mreq.c ipc.c \ - ipc_msg.c ipc_msgbuf.c ipc_sem.c ipc_shm.c kcmp.c \ - kexec_file_load.c kexec_load.c keyctl.c kill.c ksysent.c \ - lchown.c lchown32.c link.c linkat.c llseek.c lookup_dcookie.c \ - lseek.c lstat.c lstat64.c mbind.c membarrier.c memfd_create.c \ - migrate_pages.c mincore.c mkdir.c mkdirat.c mknod.c mknodat.c \ - mlock.c mlock2.c mlockall.c mmap.c mmap64.c mmsg.c \ - mmsg-silent.c mmsg_name.c mmsg_name-v.c mount.c move_pages.c \ + ioctl_nbd.c ioctl_nsfs.c ioctl_perf.c ioctl_perf-success.c \ + ioctl_ptp.c ioctl_random.c ioctl_rtc.c ioctl_rtc-v.c \ + ioctl_scsi.c ioctl_sg_io_v3.c ioctl_sg_io_v4.c \ + ioctl_sock_gifconf.c ioctl_uffdio.c ioctl_v4l2.c ioperm.c \ + iopl.c ioprio.c ioprio-Xabbrev.c ioprio-Xraw.c \ + ioprio-Xverbose.c ip_mreq.c ipc.c ipc_msg.c ipc_msg-Xabbrev.c \ + ipc_msg-Xraw.c ipc_msg-Xverbose.c ipc_msgbuf.c \ + ipc_msgbuf-Xabbrev.c ipc_msgbuf-Xraw.c ipc_msgbuf-Xverbose.c \ + ipc_sem.c ipc_sem-Xabbrev.c ipc_sem-Xraw.c ipc_sem-Xverbose.c \ + ipc_shm.c ipc_shm-Xabbrev.c ipc_shm-Xraw.c ipc_shm-Xverbose.c \ + is_linux_mips_n64.c kcmp.c kcmp-y.c kern_features.c \ + kernel_version.c kernel_version-Xabbrev.c \ + kernel_version-Xraw.c kernel_version-Xverbose.c \ + kexec_file_load.c kexec_load.c keyctl.c keyctl-Xabbrev.c \ + keyctl-Xraw.c keyctl-Xverbose.c kill.c kill_child.c ksysent.c \ + lchown.c lchown32.c link.c linkat.c list_sigaction_signum.c \ + llseek.c localtime.c lookup_dcookie.c looping_threads.c \ + lseek.c lstat.c lstat64.c madvise.c mbind.c membarrier.c \ + memfd_create.c memfd_create-Xabbrev.c memfd_create-Xraw.c \ + memfd_create-Xverbose.c migrate_pages.c mincore.c mkdir.c \ + mkdirat.c mknod.c mknodat.c mlock.c mlock2.c mlockall.c mmap.c \ + mmap-Xabbrev.c mmap-Xraw.c mmap-Xverbose.c mmap64.c \ + mmap64-Xabbrev.c mmap64-Xraw.c mmap64-Xverbose.c mmsg.c \ + mmsg-silent.c mmsg_name.c mmsg_name-v.c modify_ldt.c mount.c \ + mount-Xabbrev.c mount-Xraw.c mount-Xverbose.c move_pages.c \ + move_pages-Xabbrev.c move_pages-Xraw.c move_pages-Xverbose.c \ mq.c mq_sendrecv.c mq_sendrecv-read.c mq_sendrecv-write.c \ msg_control.c msg_control-v.c msg_name.c munlockall.c \ nanosleep.c net-accept-connect.c net-icmp_filter.c \ - net-sockaddr.c net-y-unix.c net-yy-inet.c net-yy-netlink.c \ - net-yy-unix.c netlink_inet_diag.c netlink_netlink_diag.c \ - netlink_protocol.c netlink_unix_diag.c newfstatat.c \ - nsyscalls.c old_mmap.c oldfstat.c oldlstat.c oldselect.c \ - oldstat.c open.c openat.c pause.c pc.c perf_event_open.c \ - perf_event_open_nonverbose.c perf_event_open_unabbrev.c \ - personality.c pipe.c pipe2.c pkey_alloc.c pkey_free.c \ - pkey_mprotect.c poll.c ppoll.c prctl-arg2-intptr.c \ + net-packet_mreq.c net-packet_mreq-Xabbrev.c \ + net-packet_mreq-Xraw.c net-packet_mreq-Xverbose.c \ + net-sockaddr.c net-tpacket_req.c net-tpacket_stats.c \ + net-tpacket_stats-success.c net-y-unix.c net-yy-inet.c \ + net-yy-inet6.c net-yy-netlink.c net-yy-unix.c netlink_audit.c \ + netlink_crypto.c netlink_generic.c netlink_inet_diag.c \ + netlink_kobject_uevent.c netlink_netfilter.c \ + netlink_netlink_diag.c netlink_protocol.c netlink_route.c \ + netlink_selinux.c netlink_sock_diag.c netlink_unix_diag.c \ + netlink_xfrm.c newfstatat.c nfnetlink_acct.c \ + nfnetlink_cthelper.c nfnetlink_ctnetlink.c \ + nfnetlink_ctnetlink_exp.c nfnetlink_cttimeout.c \ + nfnetlink_ipset.c nfnetlink_nft_compat.c nfnetlink_nftables.c \ + nfnetlink_osf.c nfnetlink_queue.c nfnetlink_ulog.c nlattr.c \ + nlattr_br_port_msg.c nlattr_crypto_user_alg.c nlattr_dcbmsg.c \ + nlattr_fib_rule_hdr.c nlattr_ifaddrlblmsg.c nlattr_ifaddrmsg.c \ + nlattr_ifinfomsg.c nlattr_ifla_af_spec.c nlattr_ifla_brport.c \ + nlattr_ifla_linkinfo.c nlattr_ifla_port.c nlattr_ifla_xdp.c \ + nlattr_inet_diag_msg.c nlattr_inet_diag_req_compat.c \ + nlattr_inet_diag_req_v2.c nlattr_mdba_mdb_entry.c \ + nlattr_mdba_router_port.c nlattr_ndmsg.c nlattr_ndtmsg.c \ + nlattr_netconfmsg.c nlattr_netlink_diag_msg.c \ + nlattr_nlmsgerr.c nlattr_packet_diag_msg.c nlattr_rtgenmsg.c \ + nlattr_rtmsg.c nlattr_smc_diag_msg.c nlattr_tc_stats.c \ + nlattr_tca_stab.c nlattr_tcamsg.c nlattr_tcmsg.c \ + nlattr_unix_diag_msg.c nsyscalls.c nsyscalls-d.c old_mmap.c \ + old_mmap-P.c old_mmap-Xabbrev.c old_mmap-Xraw.c \ + old_mmap-Xverbose.c old_mmap-v-none.c oldfstat.c oldlstat.c \ + oldselect.c oldselect-P.c oldselect-efault.c \ + oldselect-efault-P.c oldstat.c open.c openat.c \ + orphaned_process_group.c osf_utimes.c pause.c pc.c \ + perf_event_open.c perf_event_open_nonverbose.c \ + perf_event_open_unabbrev.c personality.c personality-Xabbrev.c \ + personality-Xraw.c personality-Xverbose.c pidfd_send_signal.c \ + pipe.c pipe2.c pkey_alloc.c pkey_free.c pkey_mprotect.c poll.c \ + poll-P.c ppoll.c ppoll-P.c ppoll-v.c prctl-arg2-intptr.c \ prctl-dumpable.c prctl-name.c prctl-no-args.c \ prctl-pdeathsig.c prctl-seccomp-filter-v.c \ - prctl-seccomp-strict.c prctl-securebits.c prctl-tid_address.c \ - prctl-tsc.c pread64-pwrite64.c preadv.c preadv-pwritev.c \ - preadv2-pwritev2.c print_maxfd.c printstr.c prlimit64.c \ - process_vm_readv.c process_vm_writev.c pselect6.c ptrace.c \ + prctl-seccomp-strict.c prctl-securebits.c prctl-spec-inject.c \ + prctl-tid_address.c prctl-tsc.c pread64-pwrite64.c preadv.c \ + preadv-pwritev.c preadv2-pwritev2.c print_maxfd.c \ + printpath-umovestr.c printpath-umovestr-peekdata.c \ + printpath-umovestr-undumpable.c printsignal-Xabbrev.c \ + printsignal-Xraw.c printsignal-Xverbose.c printstr.c \ + printstrn-umoven.c printstrn-umoven-peekdata.c \ + printstrn-umoven-undumpable.c prlimit64.c process_vm_readv.c \ + process_vm_writev.c pselect6.c ptrace.c ptrace_syscall_info.c \ pwritev.c qual_fault.c qual_inject-error-signal.c \ qual_inject-retval.c qual_inject-signal.c qual_signal.c \ - quotactl.c quotactl-v.c quotactl-xfs.c quotactl-xfs-v.c \ - read-write.c readahead.c readdir.c readlink.c readlinkat.c \ - readv.c reboot.c recvfrom.c recvmmsg-timeout.c recvmsg.c \ - redirect-fds.c remap_file_pages.c rename.c renameat.c \ - renameat2.c request_key.c restart_syscall.c rmdir.c \ - rt_sigpending.c rt_sigprocmask.c rt_sigqueueinfo.c \ + quotactl.c quotactl-Xabbrev.c quotactl-Xraw.c \ + quotactl-Xverbose.c quotactl-success.c quotactl-success-v.c \ + quotactl-v.c quotactl-xfs.c quotactl-xfs-success.c \ + quotactl-xfs-success-v.c quotactl-xfs-v.c read-write.c \ + readahead.c readdir.c readlink.c readlinkat.c readv.c reboot.c \ + recvfrom.c recvmmsg-timeout.c recvmsg.c redirect-fds.c \ + remap_file_pages.c remap_file_pages-Xabbrev.c \ + remap_file_pages-Xraw.c remap_file_pages-Xverbose.c rename.c \ + renameat.c renameat2.c request_key.c restart_syscall.c \ + riscv_flush_icache.c rmdir.c rt_sigaction.c rt_sigpending.c \ + rt_sigprocmask.c rt_sigqueueinfo.c rt_sigreturn.c \ rt_sigsuspend.c rt_sigtimedwait.c rt_tgsigqueueinfo.c \ + run_expect_termsig.c s390_guarded_storage.c \ + s390_guarded_storage-v.c s390_pci_mmio_read_write.c \ + s390_runtime_instr.c s390_sthyi.c s390_sthyi-v.c \ sched_get_priority_mxx.c sched_rr_get_interval.c \ sched_xetaffinity.c sched_xetattr.c sched_xetparam.c \ sched_xetscheduler.c sched_yield.c scm_rights.c \ - seccomp-filter.c seccomp-filter-v.c seccomp-strict.c select.c \ - semop.c sendfile.c sendfile64.c set_mempolicy.c \ - set_ptracer_any.c setdomainname.c setfsgid.c setfsgid32.c \ - setfsuid.c setfsuid32.c setgid.c setgid32.c setgroups.c \ - setgroups32.c sethostname.c setns.c setregid.c setregid32.c \ - setresgid.c setresgid32.c setresuid.c setresuid32.c setreuid.c \ - setreuid32.c setrlimit.c setuid.c setuid32.c shmxt.c \ - shutdown.c sigaction.c sigaltstack.c siginfo.c \ - signal_receive.c signalfd4.c sigreturn.c sleep.c socketcall.c \ - splice.c $(stack_fcall_SOURCES) stat.c stat64.c statfs.c \ - statfs64.c swap.c symlink.c symlinkat.c sync.c \ - sync_file_range.c sync_file_range2.c sysinfo.c syslog.c tee.c \ - threads-execve.c time.c timer_create.c timer_xettime.c \ - timerfd_xettime.c times.c times-fail.c truncate.c truncate64.c \ - ugetrlimit.c uio.c umask.c umount.c umount2.c umoven-illptr.c \ - umovestr.c umovestr-illptr.c umovestr2.c umovestr3.c uname.c \ - unix-pair-send-recv.c unix-pair-sendto-recvfrom.c unlink.c \ - unlinkat.c unshare.c userfaultfd.c ustat.c utime.c utimensat.c \ - utimes.c vfork-f.c vhangup.c vmsplice.c wait4.c wait4-v.c \ - waitid.c waitid-v.c waitpid.c xattr.c xattr-strings.c \ - xet_robust_list.c xetitimer.c xetpgid.c xetpriority.c \ - xettimeofday.c + seccomp-filter.c seccomp-filter-v.c seccomp-strict.c \ + seccomp_get_action_avail.c select.c select-P.c semop.c \ + sendfile.c sendfile64.c set_mempolicy.c set_ptracer_any.c \ + set_sigblock.c set_sigign.c setdomainname.c setfsgid.c \ + setfsgid32.c setfsuid.c setfsuid32.c setgid.c setgid32.c \ + setgroups.c setgroups32.c sethostname.c setns.c setregid.c \ + setregid32.c setresgid.c setresgid32.c setresuid.c \ + setresuid32.c setreuid.c setreuid32.c setrlimit.c \ + setrlimit-Xabbrev.c setrlimit-Xraw.c setrlimit-Xverbose.c \ + setuid.c setuid32.c shmxt.c shutdown.c sigaction.c \ + sigaltstack.c siginfo.c signal.c signal_receive.c signalfd4.c \ + sigpending.c sigprocmask.c sigreturn.c sigsuspend.c sleep.c \ + so_error.c so_linger.c so_peercred.c so_peercred-Xabbrev.c \ + so_peercred-Xraw.c so_peercred-Xverbose.c sock_filter-v.c \ + sock_filter-v-Xabbrev.c sock_filter-v-Xraw.c \ + sock_filter-v-Xverbose.c sockaddr_xlat-Xabbrev.c \ + sockaddr_xlat-Xraw.c sockaddr_xlat-Xverbose.c socketcall.c \ + sockopt-sol_netlink.c sockopt-timestamp.c splice.c \ + $(stack_fcall_SOURCES) $(stack_fcall_mangled_SOURCES) stat.c \ + stat64.c statfs.c statfs64.c statx.c swap.c sxetmask.c \ + symlink.c symlinkat.c sync.c sync_file_range.c \ + sync_file_range2.c sysinfo.c syslog.c tee.c threads-execve.c \ + time.c timer_create.c timer_xettime.c timerfd_xettime.c \ + times.c times-fail.c truncate.c truncate64.c ugetrlimit.c \ + uio.c umask.c umount.c umount2.c umoven-illptr.c umovestr.c \ + umovestr-illptr.c umovestr2.c umovestr3.c uname.c \ + unblock_reset_raise.c unix-pair-send-recv.c \ + unix-pair-sendto-recvfrom.c unlink.c unlinkat.c unshare.c \ + userfaultfd.c ustat.c utime.c utimensat.c utimensat-Xabbrev.c \ + utimensat-Xraw.c utimensat-Xverbose.c utimes.c vfork-f.c \ + vhangup.c vmsplice.c wait4.c wait4-v.c waitid.c waitid-v.c \ + waitpid.c xattr.c xattr-strings.c xet_robust_list.c \ + xet_thread_area_x86.c xetitimer.c xetpgid.c xetpriority.c \ + xettimeofday.c zeroargc.c am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac -am__extra_recursive_targets = check-valgrind-recursive +am__extra_recursive_targets = check-valgrind-recursive \ + check-valgrind-memcheck-recursive \ + check-valgrind-helgrind-recursive check-valgrind-drd-recursive \ + check-valgrind-sgcheck-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is @@ -2214,7 +3848,7 @@ am__set_TESTS_bases = \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck -@USE_LIBUNWIND_TRUE@am__EXEEXT_1 = strace-k.test +@ENABLE_STACKTRACE_TRUE@am__EXEEXT_2 = strace-k.test $(am__append_1) TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test am__test_logs1 = $(TESTS:=.log) @@ -2233,6 +3867,9 @@ am__set_b = \ *) \ b='$*';; \ esac +am__DIST_COMMON = $(srcdir)/../scno.am $(srcdir)/Makefile.in \ + $(srcdir)/gen_tests.am $(srcdir)/pure_executables.am \ + $(top_srcdir)/depcomp $(top_srcdir)/test-driver COPYING DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ @@ -2253,6 +3890,8 @@ CODE_COVERAGE_CPPFLAGS = @CODE_COVERAGE_CPPFLAGS@ CODE_COVERAGE_CXXFLAGS = @CODE_COVERAGE_CXXFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ +CODE_COVERAGE_LIBS = @CODE_COVERAGE_LIBS@ +COPYRIGHT_YEAR = @COPYRIGHT_YEAR@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CPPFLAGS_FOR_BUILD = @CPPFLAGS_FOR_BUILD@ @@ -2286,6 +3925,7 @@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ +MANPAGE_DATE = @MANPAGE_DATE@ MIPS_ABI = @MIPS_ABI@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ @@ -2299,10 +3939,13 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ RANLIB = @RANLIB@ +READELF = @READELF@ RPM_CHANGELOGTIME = @RPM_CHANGELOGTIME@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ +SIZEOF_KERNEL_LONG_T = @SIZEOF_KERNEL_LONG_T@ +SIZEOF_LONG = @SIZEOF_LONG@ STRIP = @STRIP@ VALGRIND = @VALGRIND@ VALGRIND_ENABLED = @VALGRIND_ENABLED@ @@ -2323,6 +3966,7 @@ am__untar = @am__untar@ arch = @arch@ arch_m32 = @arch_m32@ arch_mx32 = @arch_mx32@ +arch_native = @arch_native@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ @@ -2330,6 +3974,9 @@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ +cc_flags_m32 = @cc_flags_m32@ +cc_flags_mx32 = @cc_flags_mx32@ +clock_LIBS = @clock_LIBS@ datadir = @datadir@ datarootdir = @datarootdir@ dl_LIBS = @dl_LIBS@ @@ -2346,7 +3993,14 @@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ +libdw_CFLAGS = @libdw_CFLAGS@ +libdw_CPPFLAGS = @libdw_CPPFLAGS@ +libdw_LDFLAGS = @libdw_LDFLAGS@ +libdw_LIBS = @libdw_LIBS@ libexecdir = @libexecdir@ +libiberty_CPPFLAGS = @libiberty_CPPFLAGS@ +libiberty_LDFLAGS = @libiberty_LDFLAGS@ +libiberty_LIBS = @libiberty_LIBS@ libunwind_CPPFLAGS = @libunwind_CPPFLAGS@ libunwind_LDFLAGS = @libunwind_LDFLAGS@ libunwind_LIBS = @libunwind_LIBS@ @@ -2354,6 +4008,7 @@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ +mq_LIBS = @mq_LIBS@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ @@ -2364,6 +4019,7 @@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ +timer_LIBS = @timer_LIBS@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ @@ -2371,7 +4027,9 @@ valgrind_enabled_tools = @valgrind_enabled_tools@ valgrind_tools = @valgrind_tools@ OS = linux ARCH = @arch@ +NATIVE_ARCH = @arch_native@ MPERS_NAME = +MPERS_CC_FLAGS = ARCH_MFLAGS = AM_CFLAGS = $(WARN_CFLAGS) AM_CPPFLAGS = $(ARCH_MFLAGS) \ @@ -2381,27 +4039,40 @@ AM_CPPFLAGS = $(ARCH_MFLAGS) \ -I$(top_builddir)/$(OS) \ -I$(top_srcdir)/$(OS) \ -I$(top_builddir) \ - -I$(top_srcdir) + -I$(top_srcdir) \ + -DTESTS_SIZEOF_KERNEL_LONG_T=$(SIZEOF_KERNEL_LONG_T) \ + -DTESTS_SIZEOF_LONG=$(SIZEOF_LONG) AM_LDFLAGS = $(ARCH_MFLAGS) libtests_a_SOURCES = \ + create_nl_socket.c \ errno2name.c \ error_msg.c \ fill_memory.c \ get_page_size.c \ + get_sigset_size.c \ hexdump_strdup.c \ hexquote_strndup.c \ + ifindex.c \ inode_of_sockfd.c \ libmmsg.c \ libsocketcall.c \ overflowuid.c \ pipe_maxfd.c \ print_quoted_string.c \ + print_time.c \ printflags.c \ printxval.c \ signal2name.c \ + skip_unavailable.c \ sprintrc.c \ tail_alloc.c \ + test_netlink.h \ + test_nlattr.h \ + test_printpath.c \ + test_printstrn.c \ + test_ucopy.c \ + test_ucopy.h \ tests.h \ tprintf.c \ # end of libtests_a_SOURCES @@ -2409,19 +4080,545 @@ libtests_a_SOURCES = \ libtests_a_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 check_LIBRARIES = libtests.a LDADD = libtests.a -attach_f_p_LDADD = -lrt -lpthread $(LDADD) -clock_xettime_LDADD = -lrt $(LDADD) + +# Generated by ./tests/gen_pure_executables.sh from ./tests/pure_executables.list; do not edit. +PURE_EXECUTABLES = \ + _newselect \ + accept \ + accept4 \ + access \ + acct \ + add_key \ + adjtimex \ + aio \ + aio_pgetevents \ + alarm \ + bpf \ + bpf-obj_get_info_by_fd \ + bpf-obj_get_info_by_fd-prog \ + bpf-obj_get_info_by_fd-prog-v \ + bpf-obj_get_info_by_fd-v \ + bpf-v \ + brk \ + btrfs \ + caps \ + chmod \ + chown \ + chown32 \ + chroot \ + clock_adjtime \ + clock_nanosleep \ + clock_xettime \ + copy_file_range \ + creat \ + delete_module \ + dev-yy \ + dup \ + dup2 \ + dup3 \ + epoll_create \ + epoll_create1 \ + epoll_ctl \ + epoll_pwait \ + epoll_wait \ + erestartsys \ + eventfd \ + execve \ + execveat \ + faccessat \ + fadvise64 \ + fadvise64_64 \ + fallocate \ + fanotify_init \ + fanotify_mark \ + fanotify_mark-Xabbrev \ + fanotify_mark-Xraw \ + fanotify_mark-Xverbose \ + fchdir \ + fchmod \ + fchmodat \ + fchown \ + fchown32 \ + fchownat \ + fcntl \ + fcntl64 \ + fdatasync \ + fflush \ + file_handle \ + file_ioctl \ + finit_module \ + flock \ + fstat \ + fstat-Xabbrev \ + fstat-Xraw \ + fstat-Xverbose \ + fstat64 \ + fstat64-Xabbrev \ + fstat64-Xraw \ + fstat64-Xverbose \ + fstatat64 \ + fstatfs \ + fstatfs64 \ + fsync \ + ftruncate \ + ftruncate64 \ + futex \ + futimesat \ + get_mempolicy \ + getcpu \ + getcwd \ + getdents \ + getdents64 \ + getegid \ + getegid32 \ + geteuid \ + geteuid32 \ + getgid \ + getgid32 \ + getgroups \ + getgroups32 \ + getpeername \ + getpgrp \ + getpid \ + getppid \ + getrandom \ + getresgid \ + getresgid32 \ + getresuid \ + getresuid32 \ + getrlimit \ + getrusage \ + getsid \ + getsockname \ + getuid \ + getuid32 \ + getxxid \ + group_req \ + inet-cmsg \ + init_module \ + inotify \ + inotify_init1 \ + io_uring_enter \ + io_uring_register \ + io_uring_setup \ + ioctl \ + ioctl_block \ + ioctl_dm \ + ioctl_evdev \ + ioctl_inotify \ + ioctl_kvm_run \ + ioctl_kvm_run-v \ + ioctl_kvm_run_auxstr_vcpu \ + ioctl_loop \ + ioctl_mtd \ + ioctl_nbd \ + ioctl_perf \ + ioctl_ptp \ + ioctl_random \ + ioctl_rtc \ + ioctl_scsi \ + ioctl_sg_io_v3 \ + ioctl_sg_io_v4 \ + ioctl_sock_gifconf \ + ioctl_uffdio \ + ioctl_v4l2 \ + ioperm \ + iopl \ + ioprio \ + ioprio-Xabbrev \ + ioprio-Xraw \ + ioprio-Xverbose \ + ip_mreq \ + ipc \ + ipc_msg \ + ipc_msg-Xabbrev \ + ipc_msg-Xraw \ + ipc_msg-Xverbose \ + ipc_msgbuf \ + ipc_msgbuf-Xabbrev \ + ipc_msgbuf-Xraw \ + ipc_msgbuf-Xverbose \ + ipc_sem \ + ipc_sem-Xabbrev \ + ipc_sem-Xraw \ + ipc_sem-Xverbose \ + ipc_shm \ + ipc_shm-Xabbrev \ + ipc_shm-Xraw \ + ipc_shm-Xverbose \ + kcmp \ + kcmp-y \ + kern_features \ + kernel_version \ + kernel_version-Xabbrev \ + kernel_version-Xraw \ + kernel_version-Xverbose \ + kexec_file_load \ + kexec_load \ + keyctl \ + keyctl-Xabbrev \ + keyctl-Xraw \ + keyctl-Xverbose \ + kill \ + lchown \ + lchown32 \ + link \ + linkat \ + llseek \ + lookup_dcookie \ + lseek \ + lstat \ + lstat64 \ + madvise \ + mbind \ + membarrier \ + memfd_create \ + memfd_create-Xabbrev \ + memfd_create-Xraw \ + memfd_create-Xverbose \ + migrate_pages \ + mincore \ + mkdir \ + mkdirat \ + mknod \ + mknodat \ + mlock \ + mlock2 \ + mlockall \ + mmap \ + mmap-Xabbrev \ + mmap-Xraw \ + mmap-Xverbose \ + mmap64 \ + mmap64-Xabbrev \ + mmap64-Xraw \ + mmap64-Xverbose \ + mmsg \ + mmsg_name \ + modify_ldt \ + mount \ + mount-Xabbrev \ + mount-Xraw \ + mount-Xverbose \ + move_pages \ + move_pages-Xabbrev \ + move_pages-Xraw \ + move_pages-Xverbose \ + mq \ + mq_sendrecv \ + mq_sendrecv-read \ + mq_sendrecv-write \ + msg_control \ + msg_name \ + munlockall \ + nanosleep \ + net-icmp_filter \ + net-packet_mreq \ + net-packet_mreq-Xabbrev \ + net-packet_mreq-Xraw \ + net-packet_mreq-Xverbose \ + net-sockaddr \ + net-tpacket_req \ + net-tpacket_stats \ + net-y-unix \ + net-yy-inet \ + net-yy-inet6 \ + net-yy-netlink \ + net-yy-unix \ + netlink_audit \ + netlink_crypto \ + netlink_generic \ + netlink_kobject_uevent \ + netlink_netfilter \ + netlink_protocol \ + netlink_route \ + netlink_selinux \ + netlink_sock_diag \ + netlink_xfrm \ + newfstatat \ + nfnetlink_acct \ + nfnetlink_cthelper \ + nfnetlink_ctnetlink \ + nfnetlink_ctnetlink_exp \ + nfnetlink_cttimeout \ + nfnetlink_ipset \ + nfnetlink_nft_compat \ + nfnetlink_nftables \ + nfnetlink_osf \ + nfnetlink_queue \ + nfnetlink_ulog \ + nlattr \ + nlattr_br_port_msg \ + nlattr_crypto_user_alg \ + nlattr_dcbmsg \ + nlattr_fib_rule_hdr \ + nlattr_ifaddrlblmsg \ + nlattr_ifaddrmsg \ + nlattr_ifinfomsg \ + nlattr_ifla_af_spec \ + nlattr_ifla_brport \ + nlattr_ifla_linkinfo \ + nlattr_ifla_port \ + nlattr_ifla_xdp \ + nlattr_inet_diag_msg \ + nlattr_inet_diag_req_compat \ + nlattr_inet_diag_req_v2 \ + nlattr_mdba_mdb_entry \ + nlattr_mdba_router_port \ + nlattr_ndmsg \ + nlattr_ndtmsg \ + nlattr_netconfmsg \ + nlattr_netlink_diag_msg \ + nlattr_nlmsgerr \ + nlattr_packet_diag_msg \ + nlattr_rtgenmsg \ + nlattr_rtmsg \ + nlattr_smc_diag_msg \ + nlattr_tc_stats \ + nlattr_tca_stab \ + nlattr_tcamsg \ + nlattr_tcmsg \ + nlattr_unix_diag_msg \ + old_mmap \ + old_mmap-P \ + old_mmap-Xabbrev \ + old_mmap-Xraw \ + old_mmap-Xverbose \ + old_mmap-v-none \ + oldfstat \ + oldlstat \ + oldselect \ + oldselect-efault \ + oldstat \ + open \ + openat \ + osf_utimes \ + pause \ + perf_event_open \ + personality \ + personality-Xabbrev \ + personality-Xraw \ + personality-Xverbose \ + pidfd_send_signal \ + pipe \ + pipe2 \ + pkey_alloc \ + pkey_free \ + pkey_mprotect \ + poll \ + poll-P \ + ppoll \ + ppoll-P \ + prctl-arg2-intptr \ + prctl-dumpable \ + prctl-name \ + prctl-no-args \ + prctl-pdeathsig \ + prctl-securebits \ + prctl-tid_address \ + prctl-tsc \ + pread64-pwrite64 \ + preadv \ + preadv-pwritev \ + preadv2-pwritev2 \ + printpath-umovestr \ + printpath-umovestr-peekdata \ + printpath-umovestr-undumpable \ + printsignal-Xabbrev \ + printsignal-Xraw \ + printsignal-Xverbose \ + printstr \ + printstrn-umoven \ + printstrn-umoven-peekdata \ + printstrn-umoven-undumpable \ + prlimit64 \ + process_vm_readv \ + process_vm_writev \ + pselect6 \ + ptrace \ + ptrace_syscall_info \ + pwritev \ + quotactl \ + quotactl-Xabbrev \ + quotactl-Xraw \ + quotactl-Xverbose \ + quotactl-xfs \ + read-write \ + readahead \ + readdir \ + readlink \ + readlinkat \ + readv \ + reboot \ + recvfrom \ + recvmmsg-timeout \ + recvmsg \ + remap_file_pages \ + remap_file_pages-Xabbrev \ + remap_file_pages-Xraw \ + remap_file_pages-Xverbose \ + rename \ + renameat \ + renameat2 \ + request_key \ + riscv_flush_icache \ + rmdir \ + rt_sigaction \ + rt_sigpending \ + rt_sigprocmask \ + rt_sigqueueinfo \ + rt_sigreturn \ + rt_sigsuspend \ + rt_sigtimedwait \ + rt_tgsigqueueinfo \ + s390_guarded_storage \ + s390_guarded_storage-v \ + s390_pci_mmio_read_write \ + s390_runtime_instr \ + s390_sthyi \ + s390_sthyi-v \ + sched_get_priority_mxx \ + sched_rr_get_interval \ + sched_xetaffinity \ + sched_xetattr \ + sched_xetparam \ + sched_xetscheduler \ + sched_yield \ + seccomp-filter \ + seccomp_get_action_avail \ + select \ + semop \ + sendfile \ + sendfile64 \ + set_mempolicy \ + setdomainname \ + setfsgid \ + setfsgid32 \ + setfsuid \ + setfsuid32 \ + setgid \ + setgid32 \ + setgroups \ + setgroups32 \ + sethostname \ + setns \ + setregid \ + setregid32 \ + setresgid \ + setresgid32 \ + setresuid \ + setresuid32 \ + setreuid \ + setreuid32 \ + setrlimit \ + setrlimit-Xabbrev \ + setrlimit-Xraw \ + setrlimit-Xverbose \ + setuid \ + setuid32 \ + shmxt \ + shutdown \ + sigaction \ + sigaltstack \ + siginfo \ + signal \ + signalfd4 \ + sigpending \ + sigprocmask \ + sigreturn \ + sigsuspend \ + so_error \ + so_linger \ + so_peercred \ + so_peercred-Xabbrev \ + so_peercred-Xraw \ + so_peercred-Xverbose \ + sock_filter-v \ + sock_filter-v-Xabbrev \ + sock_filter-v-Xraw \ + sock_filter-v-Xverbose \ + sockaddr_xlat-Xabbrev \ + sockaddr_xlat-Xraw \ + sockaddr_xlat-Xverbose \ + socketcall \ + sockopt-sol_netlink \ + sockopt-timestamp \ + splice \ + stat \ + stat64 \ + statfs \ + statfs64 \ + statx \ + swap \ + sxetmask \ + symlink \ + symlinkat \ + sync \ + sync_file_range \ + sync_file_range2 \ + sysinfo \ + syslog \ + tee \ + time \ + timer_create \ + timer_xettime \ + timerfd_xettime \ + times \ + times-fail \ + truncate \ + truncate64 \ + ugetrlimit \ + uio \ + umask \ + umount \ + umount2 \ + umoven-illptr \ + umovestr \ + umovestr-illptr \ + umovestr2 \ + umovestr3 \ + uname \ + unlink \ + unlinkat \ + unshare \ + userfaultfd \ + ustat \ + utime \ + utimensat \ + utimensat-Xabbrev \ + utimensat-Xraw \ + utimensat-Xverbose \ + utimes \ + vhangup \ + vmsplice \ + wait4 \ + waitid \ + waitpid \ + xattr \ + xattr-strings \ + xet_robust_list \ + xet_thread_area_x86 \ + xetitimer \ + xetpgid \ + xetpriority \ + xettimeofday \ + # + +attach_f_p_LDADD = -lpthread $(LDADD) count_f_LDADD = -lpthread $(LDADD) +delay_LDADD = $(clock_LIBS) $(LDADD) filter_unavailable_LDADD = -lpthread $(LDADD) fstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 fstatat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 ftruncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +localtime_LDADD = $(clock_LIBS) $(LDADD) +looping_threads_LDADD = -lpthread $(LDADD) lstat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 mmap64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 -mq_LDADD = -lrt $(LDADD) -mq_sendrecv_LDADD = -lrt $(LDADD) -mq_sendrecv_read_LDADD = -lrt $(LDADD) -mq_sendrecv_write_LDADD = -lrt $(LDADD) +mmap64_Xabbrev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mmap64_Xraw_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mmap64_Xverbose_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 +mq_LDADD = $(mq_LIBS) $(LDADD) newfstatat_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 pc_LDADD = $(dl_LIBS) $(LDADD) pread64_pwrite64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 @@ -2430,216 +4627,286 @@ preadv_pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 pwritev_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 stat64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 statfs_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 -threads_execve_LDADD = -lrt -lpthread $(LDADD) -times_LDADD = -lrt $(LDADD) +threads_execve_LDADD = -lpthread $(clock_LIBS) $(LDADD) +times_LDADD = $(clock_LIBS) $(LDADD) truncate64_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 uio_CPPFLAGS = $(AM_CPPFLAGS) -D_FILE_OFFSET_BITS=64 stack_fcall_SOURCES = stack-fcall.c \ stack-fcall-0.c stack-fcall-1.c stack-fcall-2.c stack-fcall-3.c -@USE_LIBUNWIND_FALSE@LIBUNWIND_TESTS = -@USE_LIBUNWIND_TRUE@LIBUNWIND_TESTS = strace-k.test +stack_fcall_mangled_SOURCES = stack-fcall-mangled.c \ + stack-fcall-mangled-0.c stack-fcall-mangled-1.c \ + stack-fcall-mangled-2.c stack-fcall-mangled-3.c + + +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in; do not edit. +GEN_TESTS = _newselect.gen.test _newselect-P.gen.test accept.gen.test \ + accept4.gen.test access.gen.test acct.gen.test \ + add_key.gen.test adjtimex.gen.test aio.gen.test \ + aio_pgetevents.gen.test alarm.gen.test bpf.gen.test \ + bpf-obj_get_info_by_fd.gen.test \ + bpf-obj_get_info_by_fd-prog.gen.test \ + bpf-obj_get_info_by_fd-prog-v.gen.test \ + bpf-obj_get_info_by_fd-v.gen.test bpf-v.gen.test \ + btrfs.gen.test chmod.gen.test chown.gen.test chown32.gen.test \ + chroot.gen.test clock.gen.test clock_adjtime.gen.test \ + clock_nanosleep.gen.test clock_xettime.gen.test \ + copy_file_range.gen.test creat.gen.test delete_module.gen.test \ + dev-yy.gen.test dup.gen.test dup2.gen.test dup3.gen.test \ + epoll_create.gen.test epoll_create1.gen.test \ + epoll_ctl.gen.test epoll_pwait.gen.test epoll_wait.gen.test \ + erestartsys.gen.test execveat.gen.test execveat-v.gen.test \ + faccessat.gen.test fadvise64_64.gen.test fallocate.gen.test \ + fanotify_init.gen.test fanotify_mark.gen.test \ + fanotify_mark-Xabbrev.gen.test fanotify_mark-Xraw.gen.test \ + fanotify_mark-Xverbose.gen.test fchdir.gen.test \ + fchmod.gen.test fchmodat.gen.test fchown.gen.test \ + fchown32.gen.test fchownat.gen.test fcntl.gen.test \ + fcntl64.gen.test fdatasync.gen.test file_handle.gen.test \ + file_ioctl.gen.test finit_module.gen.test flock.gen.test \ + fork-f.gen.test fstat.gen.test fstat-Xabbrev.gen.test \ + fstat-Xraw.gen.test fstat-Xverbose.gen.test fstat64.gen.test \ + fstat64-Xabbrev.gen.test fstat64-Xraw.gen.test \ + fstat64-Xverbose.gen.test fstatat64.gen.test fstatfs.gen.test \ + fstatfs64.gen.test fsync.gen.test fsync-y.gen.test \ + ftruncate.gen.test ftruncate64.gen.test futimesat.gen.test \ + get_mempolicy.gen.test getcpu.gen.test getcwd.gen.test \ + getdents.gen.test getdents64.gen.test getegid.gen.test \ + getegid32.gen.test geteuid.gen.test geteuid32.gen.test \ + getgid.gen.test getgid32.gen.test getgroups.gen.test \ + getgroups32.gen.test getpeername.gen.test getpgrp.gen.test \ + getpid.gen.test getppid.gen.test getrandom.gen.test \ + getresgid.gen.test getresgid32.gen.test getresuid.gen.test \ + getresuid32.gen.test getrlimit.gen.test getrusage.gen.test \ + getsid.gen.test getsockname.gen.test gettid.gen.test \ + getuid32.gen.test getxxid.gen.test group_req.gen.test \ + inet-cmsg.gen.test init_module.gen.test inotify.gen.test \ + inotify_init1.gen.test io_uring_enter.gen.test \ + io_uring_register.gen.test io_uring_setup.gen.test \ + ioctl_block.gen.test ioctl_dm.gen.test ioctl_dm-v.gen.test \ + ioctl_evdev.gen.test ioctl_evdev-v.gen.test \ + ioctl_inotify.gen.test ioctl_kvm_run.gen.test \ + ioctl_kvm_run-v.gen.test ioctl_kvm_run_auxstr_vcpu.gen.test \ + ioctl_loop.gen.test ioctl_loop-nv.gen.test \ + ioctl_loop-v.gen.test ioctl_mtd.gen.test ioctl_nbd.gen.test \ + ioctl_nsfs.gen.test ioctl_perf.gen.test ioctl_ptp.gen.test \ + ioctl_random.gen.test ioctl_rtc.gen.test ioctl_rtc-v.gen.test \ + ioctl_scsi.gen.test ioctl_sg_io_v3.gen.test \ + ioctl_sg_io_v4.gen.test ioctl_sock_gifconf.gen.test \ + ioctl_uffdio.gen.test ioctl_v4l2.gen.test ioperm.gen.test \ + iopl.gen.test ioprio.gen.test ioprio-Xabbrev.gen.test \ + ioprio-Xraw.gen.test ioprio-Xverbose.gen.test ip_mreq.gen.test \ + ipc.gen.test ipc_msg.gen.test ipc_msg-Xabbrev.gen.test \ + ipc_msg-Xraw.gen.test ipc_msg-Xverbose.gen.test \ + ipc_msgbuf-Xabbrev.gen.test ipc_msgbuf-Xraw.gen.test \ + ipc_msgbuf-Xverbose.gen.test ipc_sem.gen.test \ + ipc_sem-Xabbrev.gen.test ipc_sem-Xraw.gen.test \ + ipc_sem-Xverbose.gen.test ipc_shm.gen.test \ + ipc_shm-Xabbrev.gen.test ipc_shm-Xraw.gen.test \ + ipc_shm-Xverbose.gen.test kcmp.gen.test kcmp-y.gen.test \ + kern_features.gen.test kernel_version.gen.test \ + kernel_version-Xabbrev.gen.test kernel_version-Xraw.gen.test \ + kernel_version-Xverbose.gen.test kexec_file_load.gen.test \ + kexec_load.gen.test keyctl.gen.test keyctl-Xabbrev.gen.test \ + keyctl-Xraw.gen.test keyctl-Xverbose.gen.test kill.gen.test \ + lchown.gen.test lchown32.gen.test link.gen.test \ + linkat.gen.test lookup_dcookie.gen.test lstat.gen.test \ + lstat64.gen.test madvise.gen.test mbind.gen.test \ + membarrier.gen.test memfd_create.gen.test \ + memfd_create-Xabbrev.gen.test memfd_create-Xraw.gen.test \ + memfd_create-Xverbose.gen.test migrate_pages.gen.test \ + mincore.gen.test mkdir.gen.test mkdirat.gen.test \ + mknod.gen.test mknodat.gen.test mlock.gen.test mlock2.gen.test \ + mlockall.gen.test mmap-Xabbrev.gen.test mmap-Xraw.gen.test \ + mmap-Xverbose.gen.test mmap64.gen.test mmap64-Xabbrev.gen.test \ + mmap64-Xraw.gen.test mmap64-Xverbose.gen.test mmsg.gen.test \ + mmsg-silent.gen.test mmsg_name.gen.test mmsg_name-v.gen.test \ + modify_ldt.gen.test mount.gen.test mount-Xabbrev.gen.test \ + mount-Xraw.gen.test mount-Xverbose.gen.test \ + move_pages.gen.test move_pages-Xabbrev.gen.test \ + move_pages-Xraw.gen.test move_pages-Xverbose.gen.test \ + mq.gen.test mq_sendrecv.gen.test mq_sendrecv-read.gen.test \ + mq_sendrecv-write.gen.test msg_control.gen.test \ + msg_control-v.gen.test msg_name.gen.test munlockall.gen.test \ + nanosleep.gen.test net-icmp_filter.gen.test \ + net-packet_mreq.gen.test net-packet_mreq-Xabbrev.gen.test \ + net-packet_mreq-Xraw.gen.test \ + net-packet_mreq-Xverbose.gen.test net-sockaddr.gen.test \ + net-tpacket_req.gen.test net-tpacket_stats.gen.test \ + net-yy-inet6.gen.test netlink_audit.gen.test \ + netlink_crypto.gen.test netlink_generic.gen.test \ + netlink_kobject_uevent.gen.test netlink_netfilter.gen.test \ + netlink_protocol.gen.test netlink_route.gen.test \ + netlink_selinux.gen.test netlink_xfrm.gen.test \ + newfstatat.gen.test nfnetlink_acct.gen.test \ + nfnetlink_cthelper.gen.test nfnetlink_ctnetlink.gen.test \ + nfnetlink_ctnetlink_exp.gen.test nfnetlink_cttimeout.gen.test \ + nfnetlink_ipset.gen.test nfnetlink_nft_compat.gen.test \ + nfnetlink_nftables.gen.test nfnetlink_osf.gen.test \ + nfnetlink_queue.gen.test nfnetlink_ulog.gen.test \ + nlattr.gen.test nlattr_br_port_msg.gen.test \ + nlattr_crypto_user_alg.gen.test nlattr_dcbmsg.gen.test \ + nlattr_fib_rule_hdr.gen.test nlattr_ifaddrlblmsg.gen.test \ + nlattr_ifaddrmsg.gen.test nlattr_ifinfomsg.gen.test \ + nlattr_ifla_af_spec.gen.test nlattr_ifla_brport.gen.test \ + nlattr_ifla_linkinfo.gen.test nlattr_ifla_port.gen.test \ + nlattr_ifla_xdp.gen.test nlattr_inet_diag_msg.gen.test \ + nlattr_inet_diag_req_compat.gen.test \ + nlattr_inet_diag_req_v2.gen.test \ + nlattr_mdba_mdb_entry.gen.test \ + nlattr_mdba_router_port.gen.test nlattr_ndmsg.gen.test \ + nlattr_ndtmsg.gen.test nlattr_netconfmsg.gen.test \ + nlattr_netlink_diag_msg.gen.test nlattr_nlmsgerr.gen.test \ + nlattr_packet_diag_msg.gen.test nlattr_rtgenmsg.gen.test \ + nlattr_rtmsg.gen.test nlattr_smc_diag_msg.gen.test \ + nlattr_tc_stats.gen.test nlattr_tca_stab.gen.test \ + nlattr_tcamsg.gen.test nlattr_tcmsg.gen.test \ + nlattr_unix_diag_msg.gen.test old_mmap.gen.test \ + old_mmap-P.gen.test old_mmap-Xabbrev.gen.test \ + old_mmap-Xraw.gen.test old_mmap-Xverbose.gen.test \ + old_mmap-v-none.gen.test oldfstat.gen.test oldlstat.gen.test \ + oldselect.gen.test oldselect-P.gen.test \ + oldselect-efault.gen.test oldselect-efault-P.gen.test \ + oldstat.gen.test open.gen.test openat.gen.test \ + orphaned_process_group.gen.test osf_utimes.gen.test \ + pause.gen.test perf_event_open.gen.test \ + perf_event_open_nonverbose.gen.test \ + perf_event_open_unabbrev.gen.test personality-Xabbrev.gen.test \ + personality-Xraw.gen.test personality-Xverbose.gen.test \ + pidfd_send_signal.gen.test pipe2.gen.test pkey_alloc.gen.test \ + pkey_free.gen.test pkey_mprotect.gen.test ppoll.gen.test \ + ppoll-P.gen.test ppoll-v.gen.test pread64-pwrite64.gen.test \ + preadv.gen.test preadv-pwritev.gen.test \ + preadv2-pwritev2.gen.test printpath-umovestr.gen.test \ + printpath-umovestr-peekdata.gen.test \ + printpath-umovestr-undumpable.gen.test \ + printsignal-Xabbrev.gen.test printsignal-Xraw.gen.test \ + printsignal-Xverbose.gen.test printstr.gen.test \ + printstrn-umoven.gen.test printstrn-umoven-peekdata.gen.test \ + printstrn-umoven-undumpable.gen.test prlimit64.gen.test \ + process_vm_readv.gen.test process_vm_writev.gen.test \ + pselect6.gen.test ptrace.gen.test ptrace_syscall_info.gen.test \ + pwritev.gen.test quotactl.gen.test quotactl-Xabbrev.gen.test \ + quotactl-Xraw.gen.test quotactl-Xverbose.gen.test \ + quotactl-v.gen.test quotactl-xfs.gen.test \ + quotactl-xfs-v.gen.test read-write.gen.test readahead.gen.test \ + readdir.gen.test readlink.gen.test readlinkat.gen.test \ + reboot.gen.test recvfrom.gen.test recvmmsg-timeout.gen.test \ + recvmsg.gen.test regex.gen.test remap_file_pages.gen.test \ + remap_file_pages-Xabbrev.gen.test \ + remap_file_pages-Xraw.gen.test \ + remap_file_pages-Xverbose.gen.test rename.gen.test \ + renameat.gen.test renameat2.gen.test request_key.gen.test \ + riscv_flush_icache.gen.test rmdir.gen.test \ + rt_sigpending.gen.test rt_sigprocmask.gen.test \ + rt_sigqueueinfo.gen.test rt_sigreturn.gen.test \ + rt_sigsuspend.gen.test rt_sigtimedwait.gen.test \ + rt_tgsigqueueinfo.gen.test s390_guarded_storage.gen.test \ + s390_guarded_storage-v.gen.test \ + s390_pci_mmio_read_write.gen.test s390_runtime_instr.gen.test \ + s390_sthyi.gen.test s390_sthyi-v.gen.test sched.gen.test \ + sched_get_priority_mxx.gen.test sched_rr_get_interval.gen.test \ + sched_xetaffinity.gen.test sched_xetattr.gen.test \ + sched_xetparam.gen.test sched_xetscheduler.gen.test \ + sched_yield.gen.test seccomp-filter.gen.test \ + seccomp-filter-v.gen.test seccomp_get_action_avail.gen.test \ + select.gen.test select-P.gen.test semop.gen.test \ + sendfile.gen.test sendfile64.gen.test set_mempolicy.gen.test \ + setdomainname.gen.test setfsgid.gen.test setfsgid32.gen.test \ + setfsuid.gen.test setfsuid32.gen.test setgid.gen.test \ + setgid32.gen.test setgroups.gen.test setgroups32.gen.test \ + sethostname.gen.test setns.gen.test setregid.gen.test \ + setregid32.gen.test setresgid.gen.test setresgid32.gen.test \ + setresuid.gen.test setresuid32.gen.test setreuid.gen.test \ + setreuid32.gen.test setrlimit.gen.test \ + setrlimit-Xabbrev.gen.test setrlimit-Xraw.gen.test \ + setrlimit-Xverbose.gen.test setuid.gen.test setuid32.gen.test \ + shmxt.gen.test shutdown.gen.test sigaction.gen.test \ + siginfo.gen.test signal.gen.test signal_receive.gen.test \ + signalfd4.gen.test sigpending.gen.test sigprocmask.gen.test \ + sigreturn.gen.test sigsuspend.gen.test so_error.gen.test \ + so_linger.gen.test so_peercred.gen.test \ + so_peercred-Xabbrev.gen.test so_peercred-Xraw.gen.test \ + so_peercred-Xverbose.gen.test sock_filter-v.gen.test \ + sock_filter-v-Xabbrev.gen.test sock_filter-v-Xraw.gen.test \ + sock_filter-v-Xverbose.gen.test sockaddr_xlat-Xabbrev.gen.test \ + sockaddr_xlat-Xraw.gen.test sockaddr_xlat-Xverbose.gen.test \ + socketcall.gen.test sockopt-sol_netlink.gen.test \ + sockopt-timestamp.gen.test splice.gen.test stat.gen.test \ + stat64.gen.test statfs.gen.test statfs64.gen.test \ + statx.gen.test swap.gen.test sxetmask.gen.test \ + symlink.gen.test symlinkat.gen.test sync.gen.test \ + sync_file_range.gen.test sync_file_range2.gen.test \ + sysinfo.gen.test syslog.gen.test tee.gen.test time.gen.test \ + timer_create.gen.test timer_xettime.gen.test \ + timerfd_xettime.gen.test times.gen.test times-fail.gen.test \ + trace_fstat.gen.test trace_fstatfs.gen.test \ + trace_lstat.gen.test trace_personality_32.gen.test \ + trace_personality_64.gen.test \ + trace_personality_regex_32.gen.test \ + trace_personality_regex_64.gen.test \ + trace_personality_regex_x32.gen.test \ + trace_personality_x32.gen.test trace_question.gen.test \ + trace_stat.gen.test trace_stat_like.gen.test \ + trace_statfs.gen.test trace_statfs_like.gen.test \ + truncate.gen.test truncate64.gen.test ugetrlimit.gen.test \ + umask.gen.test umoven-illptr.gen.test umovestr-illptr.gen.test \ + umovestr3.gen.test unlink.gen.test unlinkat.gen.test \ + unshare.gen.test userfaultfd.gen.test ustat.gen.test \ + utime.gen.test utimensat.gen.test utimensat-Xabbrev.gen.test \ + utimensat-Xraw.gen.test utimensat-Xverbose.gen.test \ + utimes.gen.test vfork-f.gen.test vhangup.gen.test \ + vmsplice.gen.test wait4.gen.test wait4-v.gen.test \ + waitid.gen.test waitid-v.gen.test waitpid.gen.test \ + xattr.gen.test xattr-strings.gen.test xet_robust_list.gen.test \ + xetitimer.gen.test xetpgid.gen.test xetpriority.gen.test \ + xettimeofday.gen.test +@ENABLE_STACKTRACE_FALSE@STACKTRACE_TESTS = +@ENABLE_STACKTRACE_TRUE@STACKTRACE_TESTS = strace-k.test \ +@ENABLE_STACKTRACE_TRUE@ $(am__append_1) DECODER_TESTS = \ - _newselect.test \ - accept.test \ - accept4.test \ - access.test \ - acct.test \ - add_key.test \ - adjtimex.test \ - aio.test \ - alarm.test \ - bpf.test \ + bpf-success-v.test \ + bpf-success.test \ brk.test \ + btrfs-X.test \ btrfs-v.test \ + btrfs-vX.test \ btrfs-vw.test \ + btrfs-vwX.test \ btrfs-w.test \ - btrfs.test \ + btrfs-wX.test \ caps-abbrev.test \ caps.test \ - chmod.test \ - chown.test \ - chown32.test \ - chroot.test \ - clock_adjtime.test \ - clock_nanosleep.test \ - clock_xettime.test \ - copy_file_range.test \ - creat.test \ - delete_module.test \ - dup.test \ - dup2.test \ - dup3.test \ - epoll_create.test \ - epoll_create1.test \ - epoll_ctl.test \ - epoll_pwait.test \ - epoll_wait.test \ - erestartsys.test \ eventfd.test \ execve-v.test \ execve.test \ - execveat-v.test \ - execveat.test \ - faccessat.test \ fadvise64.test \ - fadvise64_64.test \ - fallocate.test \ - fanotify_init.test \ - fanotify_mark.test \ - fchdir.test \ - fchmod.test \ - fchmodat.test \ - fchown.test \ - fchown32.test \ - fchownat.test \ - fcntl.test \ - fcntl64.test \ - fdatasync.test \ - file_handle.test \ - file_ioctl.test \ - finit_module.test \ - flock.test \ - fstat.test \ - fstat64.test \ - fstatat64.test \ - fstatfs.test \ - fstatfs64.test \ - fsync.test \ - ftruncate.test \ - ftruncate64.test \ futex.test \ - futimesat.test \ - get_mempolicy.test \ - getcpu.test \ - getcwd.test \ - getdents.test \ - getdents64.test \ - getegid.test \ - getegid32.test \ - geteuid.test \ - geteuid32.test \ - getgid.test \ - getgid32.test \ - getgroups.test \ - getgroups32.test \ - getpeername.test \ - getpgrp.test \ - getrandom.test \ - getresgid.test \ - getresgid32.test \ - getresuid.test \ - getresuid32.test \ - getrlimit.test \ - getrusage.test \ - getsid.test \ - getsockname.test \ getuid.test \ - getuid32.test \ - getxxid.test \ - inet-cmsg.test \ - init_module.test \ - inotify.test \ - inotify_init1.test \ + int_0x80.test \ ioctl.test \ - ioctl_block.test \ - ioctl_dm-v.test \ - ioctl_dm.test \ - ioctl_evdev-v.test \ - ioctl_evdev.test \ - ioctl_loop-nv.test \ - ioctl_loop-v.test \ - ioctl_loop.test \ - ioctl_mtd.test \ - ioctl_rtc-v.test \ - ioctl_rtc.test \ - ioctl_scsi.test \ - ioctl_sg_io_v3.test \ - ioctl_sg_io_v4.test \ - ioctl_sock_gifconf.test \ - ioctl_uffdio.test \ - ioctl_v4l2.test \ - ioperm.test \ - iopl.test \ - ioprio.test \ - ip_mreq.test \ - ipc.test \ - ipc_msg.test \ + ioctl_evdev-success-v.test \ + ioctl_evdev-success.test \ + ioctl_perf-success.test \ ipc_msgbuf.test \ - ipc_sem.test \ - ipc_shm.test \ - kcmp.test \ - kexec_file_load.test \ - kexec_load.test \ - keyctl.test \ - kill.test \ - lchown.test \ - lchown32.test \ - link.test \ - linkat.test \ + kern_features-fault.test \ llseek.test \ - lookup_dcookie.test \ lseek.test \ - lstat.test \ - lstat64.test \ - mbind.test \ - membarrier.test \ - memfd_create.test \ - migrate_pages.test \ - mincore.test \ - mkdir.test \ - mkdirat.test \ - mknod.test \ - mknodat.test \ - mlock.test \ - mlock2.test \ - mlockall.test \ mmap.test \ - mmap64.test \ - mmsg-silent.test \ - mmsg.test \ - mmsg_name-v.test \ - mmsg_name.test \ - mount.test \ - move_pages.test \ - mq.test \ - mq_sendrecv-read.test \ - mq_sendrecv-write.test \ - mq_sendrecv.test \ - msg_control-v.test \ - msg_control.test \ - msg_name.test \ - munlockall.test \ - nanosleep.test \ - net-icmp_filter.test \ - net-sockaddr.test \ + net-tpacket_stats-success.test \ net-y-unix.test \ net-yy-inet.test \ net-yy-netlink.test \ net-yy-unix.test \ net.test \ - netlink_protocol.test \ - newfstatat.test \ + netlink_sock_diag.test \ + nsyscalls-d.test \ + nsyscalls-nd.test \ nsyscalls.test \ - old_mmap.test \ - oldfstat.test \ - oldlstat.test \ - oldselect.test \ - oldstat.test \ - open.test \ - openat.test \ - pause.test \ - perf_event_open.test \ - perf_event_open_nonverbose.test \ - perf_event_open_unabbrev.test \ personality.test \ pipe.test \ - pipe2.test \ - pkey_alloc.test \ - pkey_free.test \ - pkey_mprotect.test \ + poll-P.test \ poll.test \ - ppoll.test \ prctl-arg2-intptr.test \ prctl-dumpable.test \ prctl-name.test \ @@ -2648,171 +4915,68 @@ DECODER_TESTS = \ prctl-seccomp-filter-v.test \ prctl-seccomp-strict.test \ prctl-securebits.test \ + prctl-spec-inject.test \ prctl-tid_address.test \ prctl-tsc.test \ - pread64-pwrite64.test \ - preadv-pwritev.test \ - preadv.test \ - preadv2-pwritev2.test \ - printstr.test \ - prlimit64.test \ - process_vm_readv.test \ - process_vm_writev.test \ - pselect6.test \ - ptrace.test \ - pwritev.test \ qual_fault-exit_group.test \ - quotactl-v.test \ - quotactl-xfs-v.test \ - quotactl-xfs.test \ - quotactl.test \ - read-write.test \ - readahead.test \ - readdir.test \ - readlink.test \ - readlinkat.test \ + quotactl-success-v.test \ + quotactl-success.test \ + quotactl-xfs-success-v.test \ + quotactl-xfs-success.test \ readv.test \ - reboot.test \ - recvfrom.test \ - recvmmsg-timeout.test \ - recvmsg.test \ - remap_file_pages.test \ - rename.test \ - renameat.test \ - renameat2.test \ - request_key.test \ - rmdir.test \ - rt_sigpending.test \ - rt_sigprocmask.test \ - rt_sigqueueinfo.test \ - rt_sigsuspend.test \ - rt_sigtimedwait.test \ - rt_tgsigqueueinfo.test \ - sched_get_priority_mxx.test \ - sched_rr_get_interval.test \ - sched_xetaffinity.test \ - sched_xetattr.test \ - sched_xetparam.test \ - sched_xetscheduler.test \ - sched_yield.test \ + rt_sigaction.test \ scm_rights-fd.test \ - seccomp-filter-v.test \ - seccomp-filter.test \ seccomp-strict.test \ - select.test \ - semop.test \ - sendfile.test \ - sendfile64.test \ - set_mempolicy.test \ - setdomainname.test \ - setfsgid.test \ - setfsgid32.test \ - setfsuid.test \ - setfsuid32.test \ - setgid.test \ - setgid32.test \ - setgroups.test \ - setgroups32.test \ - sethostname.test \ - setns.test \ - setregid.test \ - setregid32.test \ - setresgid.test \ - setresgid32.test \ - setresuid.test \ - setresuid32.test \ - setreuid.test \ - setreuid32.test \ - setrlimit.test \ - setuid.test \ - setuid32.test \ - shmxt.test \ - shutdown.test \ - sigaction.test \ sigaltstack.test \ - siginfo.test \ - signalfd4.test \ - sigreturn.test \ - socketcall.test \ - splice.test \ - stat.test \ - stat64.test \ - statfs.test \ - statfs64.test \ sun_path.test \ - swap.test \ - symlink.test \ - symlinkat.test \ - sync.test \ - sync_file_range.test \ - sync_file_range2.test \ - sysinfo.test \ - syslog.test \ - tee.test \ - time.test \ - timer_create.test \ - timer_xettime.test \ - timerfd_xettime.test \ - times-fail.test \ - times.test \ - truncate.test \ - truncate64.test \ - ugetrlimit.test \ uio.test \ - umask.test \ umount.test \ umount2.test \ - umoven-illptr.test \ - umovestr-illptr.test \ umovestr.test \ umovestr2.test \ - umovestr3.test \ uname.test \ unix-pair-send-recv.test \ unix-pair-sendto-recvfrom.test \ - unlink.test \ - unlinkat.test \ - unshare.test \ - userfaultfd.test \ - ustat.test \ - utime.test \ - utimensat.test \ - utimes.test \ - vhangup.test \ - vmsplice.test \ - wait4-v.test \ - wait4.test \ - waitid-v.test \ - waitid.test \ - waitpid.test \ - xattr-strings.test \ - xattr.test \ - xet_robust_list.test \ - xetitimer.test \ - xetpgid.test \ - xetpriority.test \ - xettimeofday.test \ + xet_thread_area_x86.test \ # end of DECODER_TESTS MISC_TESTS = \ attach-f-p.test \ attach-p-cmd.test \ bexecve.test \ + clone_parent.test \ + clone_ptrace.test \ count-f.test \ count.test \ + delay.test \ detach-running.test \ detach-sleeping.test \ detach-stopped.test \ + fflush.test \ filter-unavailable.test \ - fork-f.test \ + filtering_fd-syntax.test \ + filtering_syscall-syntax.test \ + first_exec_failure.test \ + get_regs.test \ + inject-nf.test \ + interactive_block.test \ + kill_child.test \ ksysent.test \ + localtime.test \ + looping_threads.test \ opipe.test \ options-syntax.test \ pc.test \ + printpath-umovestr-legacy.test \ + printstrn-umoven-legacy.test \ qual_fault-syntax.test \ + qual_fault-syscall.test \ qual_fault.test \ + qual_inject-error-signal-syscall.test \ qual_inject-error-signal.test \ + qual_inject-retval-syscall.test \ qual_inject-retval.test \ + qual_inject-signal-syscall.test \ qual_inject-signal.test \ qual_inject-syntax.test \ qual_signal.test \ @@ -2820,100 +4984,146 @@ MISC_TESTS = \ redirect-fds.test \ redirect.test \ restart_syscall.test \ - signal_receive.test \ + sigblock.test \ + sigign.test \ strace-C.test \ strace-E.test \ strace-S.test \ strace-T.test \ strace-V.test \ strace-ff.test \ + strace-log-merge-error.test \ + strace-log-merge-suffix.test \ strace-r.test \ strace-t.test \ strace-tt.test \ strace-ttt.test \ + termsig.test \ threads-execve.test \ - vfork-f.test \ # end of MISC_TESTS XFAIL_TESTS_ = -XFAIL_TESTS_m32 = $(LIBUNWIND_TESTS) -XFAIL_TESTS_mx32 = $(LIBUNWIND_TESTS) -XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) +XFAIL_TESTS_m32 = $(STACKTRACE_TESTS) +XFAIL_TESTS_mx32 = $(STACKTRACE_TESTS) +XFAIL_TESTS = $(XFAIL_TESTS_$(MPERS_NAME)) $(XFAIL_TESTS_$(ARCH)) TEST_LOG_COMPILER = env -AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) MIPS_ABI=$(MIPS_ABI) $(srcdir)/run.sh +AM_TEST_LOG_FLAGS = STRACE_ARCH=$(ARCH) STRACE_NATIVE_ARCH=$(NATIVE_ARCH) \ + SIZEOF_KERNEL_LONG_T=$(SIZEOF_KERNEL_LONG_T) \ + SIZEOF_LONG=$(SIZEOF_LONG) \ + MIPS_ABI=$(MIPS_ABI) $(srcdir)/run.sh + VALGRIND_FLAGS = --quiet -VALGRIND_SUPPRESSIONS_FILES = $(srcdir)/strace.supp -EXTRA_DIST = init.sh run.sh match.awk \ - caps-abbrev.awk \ - caps.awk \ - count-f.expected \ - eventfd.expected \ - fadvise.h \ - filter-unavailable.expected \ - fstatat.c \ - fstatx.c \ - getresugid.c \ - init_delete_module.h \ - ipc.sh \ - ipc_msgbuf.expected \ - ksysent.sed \ - lstatx.c \ - net.expected \ - oldselect.expected \ - pipe.expected \ - ppoll-v.expected \ - ppoll.expected \ - process_vm_readv_writev.c \ - qual_fault-exit_group.expected \ - qual_inject-error-signal.expected \ - qual_inject-signal.expected \ - quotactl.h \ - scno_tampering.sh \ - setfsugid.c \ - setresugid.c \ - setreugid.c \ - setugid.c \ - sigaction.awk \ - sigaltstack.expected \ - sockname.c \ - statfs.expected \ - statx.sh \ - strace-C.expected \ - strace-E.expected \ - strace-T.expected \ - strace-ff.expected \ - strace-k.test \ - strace-r.expected \ - strace.supp \ - struct_flock.c \ - sun_path.expected \ - uio.expected \ - umode_t.c \ - umovestr.expected \ - unix-pair-send-recv.expected \ - unix-pair-sendto-recvfrom.expected \ - xchownx.c \ - xgetrlimit.c \ - xselect.c \ - xstatfs.c \ - xstatfs64.c \ - xstatfsx.c \ - xstatx.c \ - $(TESTS) +VALGRIND_SUPPRESSIONS_FILES = $(abs_srcdir)/strace.supp +EXTRA_DIST = \ + COPYING \ + GPL-2.0-or-later \ + PTRACE_SEIZE.sh \ + accept_compat.h \ + attach-p-cmd.h \ + caps-abbrev.awk \ + caps.awk \ + clock.in \ + count-f.expected \ + eventfd.expected \ + fadvise.h \ + fcntl-common.c \ + filter-unavailable.expected \ + fstatat.c \ + fstatx.c \ + gen_pure_executables.sh \ + gen_tests.in \ + gen_tests.sh \ + getresugid.c \ + init.sh \ + init_delete_module.h \ + ioctl_kvm_run_common.c \ + ipc.sh \ + ksysent.sed \ + lstatx.c \ + match.awk \ + net.expected \ + netlink_sock_diag-v.sh \ + nlattr_ifla.h \ + pipe.expected \ + print_user_desc.c \ + printsignal.c \ + process_vm_readv_writev.c \ + pure_executables.list \ + qual_fault-exit_group.expected \ + qual_inject-error-signal.expected \ + qual_inject-signal.expected \ + qualify_personality.sh \ + qualify_personality_empty.in \ + quotactl.h \ + regex.in \ + rt_sigaction.awk \ + run.sh \ + sched.in \ + scno_tampering.sh \ + setfsugid.c \ + setresugid.c \ + setreugid.c \ + setugid.c \ + sigaltstack.expected \ + sockaddr_xlat.c \ + sockname.c \ + stack-fcall.h \ + strace-C.expected \ + strace-E.expected \ + strace-T.expected \ + strace-ff.expected \ + strace-k-demangle.expected \ + strace-k-demangle.test \ + strace-k.expected \ + strace-k.test \ + strace-r.expected \ + strace.supp \ + sun_path.expected \ + syntax.sh \ + trace_fstat.in \ + trace_fstatfs.in \ + trace_lstat.in \ + trace_personality_32.in \ + trace_personality_64.in \ + trace_personality_regex_32.in \ + trace_personality_regex_64.in \ + trace_personality_regex_x32.in \ + trace_personality_x32.in \ + trace_question.in \ + trace_stat.in \ + trace_stat_like.in \ + trace_statfs.in \ + trace_statfs_like.in \ + uio.expected \ + umode_t.c \ + umovestr.expected \ + unix-pair-send-recv.expected \ + unix-pair-sendto-recvfrom.expected \ + xchownx.c \ + xgetrlimit.c \ + xselect.c \ + xstatfs.c \ + xstatfs64.c \ + xstatfsx.c \ + xstatx.c \ + xutimes.c \ + $(TESTS) objects = $(filter %.$(OBJEXT),$(SOURCES:.c=.$(OBJEXT))) -CLEANFILES = ksysent.h $(TESTS:=.tmp) syscallent.i scno.h +BUILT_SOURCES = ksysent.h scno.h +CLEANFILES = ksysent.h syscallent.i scno.h SCNO_CPPFLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(ARCH_MFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) digits = [[:digit:]][[:digit:]]* al_nums = [[:alnum:]_][[:alnum:]_]* -SCNO_SED = /TRACE_INDIRECT_SUBCALL/d; s/^\[[[:space:]]*\($(digits)\)\][[:space:]]*=[[:space:]]*{[^,]*,[^,]*,[^,]*,[[:space:]]*"\($(al_nums)\)"[[:space:]]*},.*/\#ifndef __NR_\2\n\# define __NR_\2 (SYSCALL_BIT | \1)\n\#endif/p -all: all-am +SCNO_SED = /TRACE_INDIRECT_SUBCALL/d; s/^\[[[:space:]]*\($(digits)\([[:space:]]*+[[:space:]]*$(digits)\)\?\)\][[:space:]]*=[[:space:]]*{[^,]*,[^,]*,[^,]*,[[:space:]]*"\($(al_nums)\)"[[:space:]]*},.*/\#ifndef __NR_\3\n\# define __NR_\3 (SYSCALL_BIT | (\1))\n\#endif/p +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .log .o .obj .test .test$(EXEEXT) .trs -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/../scno.am $(am__configure_deps) +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/pure_executables.am $(srcdir)/gen_tests.am $(srcdir)/../scno.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -2925,16 +5135,15 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/.. echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign tests/Makefile -.PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ - echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ - cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__maybe_remake_depfiles);; \ esac; -$(srcdir)/../scno.am: +$(srcdir)/pure_executables.am $(srcdir)/gen_tests.am $(srcdir)/../scno.am $(am__empty): $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh @@ -2945,6 +5154,9 @@ $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) + clean-checkLIBRARIES: -test -z "$(check_LIBRARIES)" || rm -f $(check_LIBRARIES) @@ -2953,13 +5165,14 @@ libtests.a: $(libtests_a_OBJECTS) $(libtests_a_DEPENDENCIES) $(EXTRA_libtests_a_ $(AM_V_AR)$(libtests_a_AR) libtests.a $(libtests_a_OBJECTS) $(libtests_a_LIBADD) $(AM_V_at)$(RANLIB) libtests.a -clean-checkPROGRAMS: - -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) - _newselect$(EXEEXT): $(_newselect_OBJECTS) $(_newselect_DEPENDENCIES) $(EXTRA__newselect_DEPENDENCIES) @rm -f _newselect$(EXEEXT) $(AM_V_CCLD)$(LINK) $(_newselect_OBJECTS) $(_newselect_LDADD) $(LIBS) +_newselect-P$(EXEEXT): $(_newselect_P_OBJECTS) $(_newselect_P_DEPENDENCIES) $(EXTRA__newselect_P_DEPENDENCIES) + @rm -f _newselect-P$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(_newselect_P_OBJECTS) $(_newselect_P_LDADD) $(LIBS) + accept$(EXEEXT): $(accept_OBJECTS) $(accept_DEPENDENCIES) $(EXTRA_accept_DEPENDENCIES) @rm -f accept$(EXEEXT) $(AM_V_CCLD)$(LINK) $(accept_OBJECTS) $(accept_LDADD) $(LIBS) @@ -2988,6 +5201,10 @@ aio$(EXEEXT): $(aio_OBJECTS) $(aio_DEPENDENCIES) $(EXTRA_aio_DEPENDENCIES) @rm -f aio$(EXEEXT) $(AM_V_CCLD)$(LINK) $(aio_OBJECTS) $(aio_LDADD) $(LIBS) +aio_pgetevents$(EXEEXT): $(aio_pgetevents_OBJECTS) $(aio_pgetevents_DEPENDENCIES) $(EXTRA_aio_pgetevents_DEPENDENCIES) + @rm -f aio_pgetevents$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(aio_pgetevents_OBJECTS) $(aio_pgetevents_LDADD) $(LIBS) + alarm$(EXEEXT): $(alarm_OBJECTS) $(alarm_DEPENDENCIES) $(EXTRA_alarm_DEPENDENCIES) @rm -f alarm$(EXEEXT) $(AM_V_CCLD)$(LINK) $(alarm_OBJECTS) $(alarm_LDADD) $(LIBS) @@ -3012,10 +5229,42 @@ attach-p-cmd-p$(EXEEXT): $(attach_p_cmd_p_OBJECTS) $(attach_p_cmd_p_DEPENDENCIES @rm -f attach-p-cmd-p$(EXEEXT) $(AM_V_CCLD)$(LINK) $(attach_p_cmd_p_OBJECTS) $(attach_p_cmd_p_LDADD) $(LIBS) +block_reset_raise_run$(EXEEXT): $(block_reset_raise_run_OBJECTS) $(block_reset_raise_run_DEPENDENCIES) $(EXTRA_block_reset_raise_run_DEPENDENCIES) + @rm -f block_reset_raise_run$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(block_reset_raise_run_OBJECTS) $(block_reset_raise_run_LDADD) $(LIBS) + bpf$(EXEEXT): $(bpf_OBJECTS) $(bpf_DEPENDENCIES) $(EXTRA_bpf_DEPENDENCIES) @rm -f bpf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(bpf_OBJECTS) $(bpf_LDADD) $(LIBS) +bpf-obj_get_info_by_fd$(EXEEXT): $(bpf_obj_get_info_by_fd_OBJECTS) $(bpf_obj_get_info_by_fd_DEPENDENCIES) $(EXTRA_bpf_obj_get_info_by_fd_DEPENDENCIES) + @rm -f bpf-obj_get_info_by_fd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_obj_get_info_by_fd_OBJECTS) $(bpf_obj_get_info_by_fd_LDADD) $(LIBS) + +bpf-obj_get_info_by_fd-prog$(EXEEXT): $(bpf_obj_get_info_by_fd_prog_OBJECTS) $(bpf_obj_get_info_by_fd_prog_DEPENDENCIES) $(EXTRA_bpf_obj_get_info_by_fd_prog_DEPENDENCIES) + @rm -f bpf-obj_get_info_by_fd-prog$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_obj_get_info_by_fd_prog_OBJECTS) $(bpf_obj_get_info_by_fd_prog_LDADD) $(LIBS) + +bpf-obj_get_info_by_fd-prog-v$(EXEEXT): $(bpf_obj_get_info_by_fd_prog_v_OBJECTS) $(bpf_obj_get_info_by_fd_prog_v_DEPENDENCIES) $(EXTRA_bpf_obj_get_info_by_fd_prog_v_DEPENDENCIES) + @rm -f bpf-obj_get_info_by_fd-prog-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_obj_get_info_by_fd_prog_v_OBJECTS) $(bpf_obj_get_info_by_fd_prog_v_LDADD) $(LIBS) + +bpf-obj_get_info_by_fd-v$(EXEEXT): $(bpf_obj_get_info_by_fd_v_OBJECTS) $(bpf_obj_get_info_by_fd_v_DEPENDENCIES) $(EXTRA_bpf_obj_get_info_by_fd_v_DEPENDENCIES) + @rm -f bpf-obj_get_info_by_fd-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_obj_get_info_by_fd_v_OBJECTS) $(bpf_obj_get_info_by_fd_v_LDADD) $(LIBS) + +bpf-success$(EXEEXT): $(bpf_success_OBJECTS) $(bpf_success_DEPENDENCIES) $(EXTRA_bpf_success_DEPENDENCIES) + @rm -f bpf-success$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_success_OBJECTS) $(bpf_success_LDADD) $(LIBS) + +bpf-success-v$(EXEEXT): $(bpf_success_v_OBJECTS) $(bpf_success_v_DEPENDENCIES) $(EXTRA_bpf_success_v_DEPENDENCIES) + @rm -f bpf-success-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_success_v_OBJECTS) $(bpf_success_v_LDADD) $(LIBS) + +bpf-v$(EXEEXT): $(bpf_v_OBJECTS) $(bpf_v_DEPENDENCIES) $(EXTRA_bpf_v_DEPENDENCIES) + @rm -f bpf-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(bpf_v_OBJECTS) $(bpf_v_LDADD) $(LIBS) + brk$(EXEEXT): $(brk_OBJECTS) $(brk_DEPENDENCIES) $(EXTRA_brk_DEPENDENCIES) @rm -f brk$(EXEEXT) $(AM_V_CCLD)$(LINK) $(brk_OBJECTS) $(brk_LDADD) $(LIBS) @@ -3032,6 +5281,14 @@ caps-abbrev$(EXEEXT): $(caps_abbrev_OBJECTS) $(caps_abbrev_DEPENDENCIES) $(EXTRA @rm -f caps-abbrev$(EXEEXT) $(AM_V_CCLD)$(LINK) $(caps_abbrev_OBJECTS) $(caps_abbrev_LDADD) $(LIBS) +check_sigblock$(EXEEXT): $(check_sigblock_OBJECTS) $(check_sigblock_DEPENDENCIES) $(EXTRA_check_sigblock_DEPENDENCIES) + @rm -f check_sigblock$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(check_sigblock_OBJECTS) $(check_sigblock_LDADD) $(LIBS) + +check_sigign$(EXEEXT): $(check_sigign_OBJECTS) $(check_sigign_DEPENDENCIES) $(EXTRA_check_sigign_DEPENDENCIES) + @rm -f check_sigign$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(check_sigign_OBJECTS) $(check_sigign_LDADD) $(LIBS) + chmod$(EXEEXT): $(chmod_OBJECTS) $(chmod_DEPENDENCIES) $(EXTRA_chmod_DEPENDENCIES) @rm -f chmod$(EXEEXT) $(AM_V_CCLD)$(LINK) $(chmod_OBJECTS) $(chmod_LDADD) $(LIBS) @@ -3060,6 +5317,14 @@ clock_xettime$(EXEEXT): $(clock_xettime_OBJECTS) $(clock_xettime_DEPENDENCIES) $ @rm -f clock_xettime$(EXEEXT) $(AM_V_CCLD)$(LINK) $(clock_xettime_OBJECTS) $(clock_xettime_LDADD) $(LIBS) +clone_parent$(EXEEXT): $(clone_parent_OBJECTS) $(clone_parent_DEPENDENCIES) $(EXTRA_clone_parent_DEPENDENCIES) + @rm -f clone_parent$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(clone_parent_OBJECTS) $(clone_parent_LDADD) $(LIBS) + +clone_ptrace$(EXEEXT): $(clone_ptrace_OBJECTS) $(clone_ptrace_DEPENDENCIES) $(EXTRA_clone_ptrace_DEPENDENCIES) + @rm -f clone_ptrace$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(clone_ptrace_OBJECTS) $(clone_ptrace_LDADD) $(LIBS) + copy_file_range$(EXEEXT): $(copy_file_range_OBJECTS) $(copy_file_range_DEPENDENCIES) $(EXTRA_copy_file_range_DEPENDENCIES) @rm -f copy_file_range$(EXEEXT) $(AM_V_CCLD)$(LINK) $(copy_file_range_OBJECTS) $(copy_file_range_LDADD) $(LIBS) @@ -3072,10 +5337,18 @@ creat$(EXEEXT): $(creat_OBJECTS) $(creat_DEPENDENCIES) $(EXTRA_creat_DEPENDENCIE @rm -f creat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(creat_OBJECTS) $(creat_LDADD) $(LIBS) +delay$(EXEEXT): $(delay_OBJECTS) $(delay_DEPENDENCIES) $(EXTRA_delay_DEPENDENCIES) + @rm -f delay$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(delay_OBJECTS) $(delay_LDADD) $(LIBS) + delete_module$(EXEEXT): $(delete_module_OBJECTS) $(delete_module_DEPENDENCIES) $(EXTRA_delete_module_DEPENDENCIES) @rm -f delete_module$(EXEEXT) $(AM_V_CCLD)$(LINK) $(delete_module_OBJECTS) $(delete_module_LDADD) $(LIBS) +dev-yy$(EXEEXT): $(dev_yy_OBJECTS) $(dev_yy_DEPENDENCIES) $(EXTRA_dev_yy_DEPENDENCIES) + @rm -f dev-yy$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(dev_yy_OBJECTS) $(dev_yy_LDADD) $(LIBS) + dup$(EXEEXT): $(dup_OBJECTS) $(dup_DEPENDENCIES) $(EXTRA_dup_DEPENDENCIES) @rm -f dup$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dup_OBJECTS) $(dup_LDADD) $(LIBS) @@ -3156,6 +5429,18 @@ fanotify_mark$(EXEEXT): $(fanotify_mark_OBJECTS) $(fanotify_mark_DEPENDENCIES) $ @rm -f fanotify_mark$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fanotify_mark_OBJECTS) $(fanotify_mark_LDADD) $(LIBS) +fanotify_mark-Xabbrev$(EXEEXT): $(fanotify_mark_Xabbrev_OBJECTS) $(fanotify_mark_Xabbrev_DEPENDENCIES) $(EXTRA_fanotify_mark_Xabbrev_DEPENDENCIES) + @rm -f fanotify_mark-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fanotify_mark_Xabbrev_OBJECTS) $(fanotify_mark_Xabbrev_LDADD) $(LIBS) + +fanotify_mark-Xraw$(EXEEXT): $(fanotify_mark_Xraw_OBJECTS) $(fanotify_mark_Xraw_DEPENDENCIES) $(EXTRA_fanotify_mark_Xraw_DEPENDENCIES) + @rm -f fanotify_mark-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fanotify_mark_Xraw_OBJECTS) $(fanotify_mark_Xraw_LDADD) $(LIBS) + +fanotify_mark-Xverbose$(EXEEXT): $(fanotify_mark_Xverbose_OBJECTS) $(fanotify_mark_Xverbose_DEPENDENCIES) $(EXTRA_fanotify_mark_Xverbose_DEPENDENCIES) + @rm -f fanotify_mark-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fanotify_mark_Xverbose_OBJECTS) $(fanotify_mark_Xverbose_LDADD) $(LIBS) + fchdir$(EXEEXT): $(fchdir_OBJECTS) $(fchdir_DEPENDENCIES) $(EXTRA_fchdir_DEPENDENCIES) @rm -f fchdir$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fchdir_OBJECTS) $(fchdir_LDADD) $(LIBS) @@ -3192,6 +5477,10 @@ fdatasync$(EXEEXT): $(fdatasync_OBJECTS) $(fdatasync_DEPENDENCIES) $(EXTRA_fdata @rm -f fdatasync$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fdatasync_OBJECTS) $(fdatasync_LDADD) $(LIBS) +fflush$(EXEEXT): $(fflush_OBJECTS) $(fflush_DEPENDENCIES) $(EXTRA_fflush_DEPENDENCIES) + @rm -f fflush$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fflush_OBJECTS) $(fflush_LDADD) $(LIBS) + file_handle$(EXEEXT): $(file_handle_OBJECTS) $(file_handle_DEPENDENCIES) $(EXTRA_file_handle_DEPENDENCIES) @rm -f file_handle$(EXEEXT) $(AM_V_CCLD)$(LINK) $(file_handle_OBJECTS) $(file_handle_LDADD) $(LIBS) @@ -3220,10 +5509,34 @@ fstat$(EXEEXT): $(fstat_OBJECTS) $(fstat_DEPENDENCIES) $(EXTRA_fstat_DEPENDENCIE @rm -f fstat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fstat_OBJECTS) $(fstat_LDADD) $(LIBS) +fstat-Xabbrev$(EXEEXT): $(fstat_Xabbrev_OBJECTS) $(fstat_Xabbrev_DEPENDENCIES) $(EXTRA_fstat_Xabbrev_DEPENDENCIES) + @rm -f fstat-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat_Xabbrev_OBJECTS) $(fstat_Xabbrev_LDADD) $(LIBS) + +fstat-Xraw$(EXEEXT): $(fstat_Xraw_OBJECTS) $(fstat_Xraw_DEPENDENCIES) $(EXTRA_fstat_Xraw_DEPENDENCIES) + @rm -f fstat-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat_Xraw_OBJECTS) $(fstat_Xraw_LDADD) $(LIBS) + +fstat-Xverbose$(EXEEXT): $(fstat_Xverbose_OBJECTS) $(fstat_Xverbose_DEPENDENCIES) $(EXTRA_fstat_Xverbose_DEPENDENCIES) + @rm -f fstat-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat_Xverbose_OBJECTS) $(fstat_Xverbose_LDADD) $(LIBS) + fstat64$(EXEEXT): $(fstat64_OBJECTS) $(fstat64_DEPENDENCIES) $(EXTRA_fstat64_DEPENDENCIES) @rm -f fstat64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fstat64_OBJECTS) $(fstat64_LDADD) $(LIBS) +fstat64-Xabbrev$(EXEEXT): $(fstat64_Xabbrev_OBJECTS) $(fstat64_Xabbrev_DEPENDENCIES) $(EXTRA_fstat64_Xabbrev_DEPENDENCIES) + @rm -f fstat64-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat64_Xabbrev_OBJECTS) $(fstat64_Xabbrev_LDADD) $(LIBS) + +fstat64-Xraw$(EXEEXT): $(fstat64_Xraw_OBJECTS) $(fstat64_Xraw_DEPENDENCIES) $(EXTRA_fstat64_Xraw_DEPENDENCIES) + @rm -f fstat64-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat64_Xraw_OBJECTS) $(fstat64_Xraw_LDADD) $(LIBS) + +fstat64-Xverbose$(EXEEXT): $(fstat64_Xverbose_OBJECTS) $(fstat64_Xverbose_DEPENDENCIES) $(EXTRA_fstat64_Xverbose_DEPENDENCIES) + @rm -f fstat64-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fstat64_Xverbose_OBJECTS) $(fstat64_Xverbose_LDADD) $(LIBS) + fstatat64$(EXEEXT): $(fstatat64_OBJECTS) $(fstatat64_DEPENDENCIES) $(EXTRA_fstatat64_DEPENDENCIES) @rm -f fstatat64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fstatat64_OBJECTS) $(fstatat64_LDADD) $(LIBS) @@ -3240,6 +5553,10 @@ fsync$(EXEEXT): $(fsync_OBJECTS) $(fsync_DEPENDENCIES) $(EXTRA_fsync_DEPENDENCIE @rm -f fsync$(EXEEXT) $(AM_V_CCLD)$(LINK) $(fsync_OBJECTS) $(fsync_LDADD) $(LIBS) +fsync-y$(EXEEXT): $(fsync_y_OBJECTS) $(fsync_y_DEPENDENCIES) $(EXTRA_fsync_y_DEPENDENCIES) + @rm -f fsync-y$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(fsync_y_OBJECTS) $(fsync_y_LDADD) $(LIBS) + ftruncate$(EXEEXT): $(ftruncate_OBJECTS) $(ftruncate_DEPENDENCIES) $(EXTRA_ftruncate_DEPENDENCIES) @rm -f ftruncate$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ftruncate_OBJECTS) $(ftruncate_LDADD) $(LIBS) @@ -3316,6 +5633,14 @@ getpgrp$(EXEEXT): $(getpgrp_OBJECTS) $(getpgrp_DEPENDENCIES) $(EXTRA_getpgrp_DEP @rm -f getpgrp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getpgrp_OBJECTS) $(getpgrp_LDADD) $(LIBS) +getpid$(EXEEXT): $(getpid_OBJECTS) $(getpid_DEPENDENCIES) $(EXTRA_getpid_DEPENDENCIES) + @rm -f getpid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getpid_OBJECTS) $(getpid_LDADD) $(LIBS) + +getppid$(EXEEXT): $(getppid_OBJECTS) $(getppid_DEPENDENCIES) $(EXTRA_getppid_DEPENDENCIES) + @rm -f getppid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(getppid_OBJECTS) $(getppid_LDADD) $(LIBS) + getrandom$(EXEEXT): $(getrandom_OBJECTS) $(getrandom_DEPENDENCIES) $(EXTRA_getrandom_DEPENDENCIES) @rm -f getrandom$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getrandom_OBJECTS) $(getrandom_LDADD) $(LIBS) @@ -3352,6 +5677,10 @@ getsockname$(EXEEXT): $(getsockname_OBJECTS) $(getsockname_DEPENDENCIES) $(EXTRA @rm -f getsockname$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getsockname_OBJECTS) $(getsockname_LDADD) $(LIBS) +gettid$(EXEEXT): $(gettid_OBJECTS) $(gettid_DEPENDENCIES) $(EXTRA_gettid_DEPENDENCIES) + @rm -f gettid$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(gettid_OBJECTS) $(gettid_LDADD) $(LIBS) + getuid$(EXEEXT): $(getuid_OBJECTS) $(getuid_DEPENDENCIES) $(EXTRA_getuid_DEPENDENCIES) @rm -f getuid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getuid_OBJECTS) $(getuid_LDADD) $(LIBS) @@ -3364,6 +5693,10 @@ getxxid$(EXEEXT): $(getxxid_OBJECTS) $(getxxid_DEPENDENCIES) $(EXTRA_getxxid_DEP @rm -f getxxid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(getxxid_OBJECTS) $(getxxid_LDADD) $(LIBS) +group_req$(EXEEXT): $(group_req_OBJECTS) $(group_req_DEPENDENCIES) $(EXTRA_group_req_DEPENDENCIES) + @rm -f group_req$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(group_req_OBJECTS) $(group_req_LDADD) $(LIBS) + inet-cmsg$(EXEEXT): $(inet_cmsg_OBJECTS) $(inet_cmsg_DEPENDENCIES) $(EXTRA_inet_cmsg_DEPENDENCIES) @rm -f inet-cmsg$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inet_cmsg_OBJECTS) $(inet_cmsg_LDADD) $(LIBS) @@ -3372,6 +5705,10 @@ init_module$(EXEEXT): $(init_module_OBJECTS) $(init_module_DEPENDENCIES) $(EXTRA @rm -f init_module$(EXEEXT) $(AM_V_CCLD)$(LINK) $(init_module_OBJECTS) $(init_module_LDADD) $(LIBS) +inject-nf$(EXEEXT): $(inject_nf_OBJECTS) $(inject_nf_DEPENDENCIES) $(EXTRA_inject_nf_DEPENDENCIES) + @rm -f inject-nf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(inject_nf_OBJECTS) $(inject_nf_LDADD) $(LIBS) + inotify$(EXEEXT): $(inotify_OBJECTS) $(inotify_DEPENDENCIES) $(EXTRA_inotify_DEPENDENCIES) @rm -f inotify$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inotify_OBJECTS) $(inotify_LDADD) $(LIBS) @@ -3380,6 +5717,22 @@ inotify_init1$(EXEEXT): $(inotify_init1_OBJECTS) $(inotify_init1_DEPENDENCIES) $ @rm -f inotify_init1$(EXEEXT) $(AM_V_CCLD)$(LINK) $(inotify_init1_OBJECTS) $(inotify_init1_LDADD) $(LIBS) +int_0x80$(EXEEXT): $(int_0x80_OBJECTS) $(int_0x80_DEPENDENCIES) $(EXTRA_int_0x80_DEPENDENCIES) + @rm -f int_0x80$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(int_0x80_OBJECTS) $(int_0x80_LDADD) $(LIBS) + +io_uring_enter$(EXEEXT): $(io_uring_enter_OBJECTS) $(io_uring_enter_DEPENDENCIES) $(EXTRA_io_uring_enter_DEPENDENCIES) + @rm -f io_uring_enter$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(io_uring_enter_OBJECTS) $(io_uring_enter_LDADD) $(LIBS) + +io_uring_register$(EXEEXT): $(io_uring_register_OBJECTS) $(io_uring_register_DEPENDENCIES) $(EXTRA_io_uring_register_DEPENDENCIES) + @rm -f io_uring_register$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(io_uring_register_OBJECTS) $(io_uring_register_LDADD) $(LIBS) + +io_uring_setup$(EXEEXT): $(io_uring_setup_OBJECTS) $(io_uring_setup_DEPENDENCIES) $(EXTRA_io_uring_setup_DEPENDENCIES) + @rm -f io_uring_setup$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(io_uring_setup_OBJECTS) $(io_uring_setup_LDADD) $(LIBS) + ioctl$(EXEEXT): $(ioctl_OBJECTS) $(ioctl_DEPENDENCIES) $(EXTRA_ioctl_DEPENDENCIES) @rm -f ioctl$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ioctl_OBJECTS) $(ioctl_LDADD) $(LIBS) @@ -3400,10 +5753,34 @@ ioctl_evdev$(EXEEXT): $(ioctl_evdev_OBJECTS) $(ioctl_evdev_DEPENDENCIES) $(EXTRA @rm -f ioctl_evdev$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ioctl_evdev_OBJECTS) $(ioctl_evdev_LDADD) $(LIBS) +ioctl_evdev-success$(EXEEXT): $(ioctl_evdev_success_OBJECTS) $(ioctl_evdev_success_DEPENDENCIES) $(EXTRA_ioctl_evdev_success_DEPENDENCIES) + @rm -f ioctl_evdev-success$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_evdev_success_OBJECTS) $(ioctl_evdev_success_LDADD) $(LIBS) + +ioctl_evdev-success-v$(EXEEXT): $(ioctl_evdev_success_v_OBJECTS) $(ioctl_evdev_success_v_DEPENDENCIES) $(EXTRA_ioctl_evdev_success_v_DEPENDENCIES) + @rm -f ioctl_evdev-success-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_evdev_success_v_OBJECTS) $(ioctl_evdev_success_v_LDADD) $(LIBS) + ioctl_evdev-v$(EXEEXT): $(ioctl_evdev_v_OBJECTS) $(ioctl_evdev_v_DEPENDENCIES) $(EXTRA_ioctl_evdev_v_DEPENDENCIES) @rm -f ioctl_evdev-v$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ioctl_evdev_v_OBJECTS) $(ioctl_evdev_v_LDADD) $(LIBS) +ioctl_inotify$(EXEEXT): $(ioctl_inotify_OBJECTS) $(ioctl_inotify_DEPENDENCIES) $(EXTRA_ioctl_inotify_DEPENDENCIES) + @rm -f ioctl_inotify$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_inotify_OBJECTS) $(ioctl_inotify_LDADD) $(LIBS) + +ioctl_kvm_run$(EXEEXT): $(ioctl_kvm_run_OBJECTS) $(ioctl_kvm_run_DEPENDENCIES) $(EXTRA_ioctl_kvm_run_DEPENDENCIES) + @rm -f ioctl_kvm_run$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_kvm_run_OBJECTS) $(ioctl_kvm_run_LDADD) $(LIBS) + +ioctl_kvm_run-v$(EXEEXT): $(ioctl_kvm_run_v_OBJECTS) $(ioctl_kvm_run_v_DEPENDENCIES) $(EXTRA_ioctl_kvm_run_v_DEPENDENCIES) + @rm -f ioctl_kvm_run-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_kvm_run_v_OBJECTS) $(ioctl_kvm_run_v_LDADD) $(LIBS) + +ioctl_kvm_run_auxstr_vcpu$(EXEEXT): $(ioctl_kvm_run_auxstr_vcpu_OBJECTS) $(ioctl_kvm_run_auxstr_vcpu_DEPENDENCIES) $(EXTRA_ioctl_kvm_run_auxstr_vcpu_DEPENDENCIES) + @rm -f ioctl_kvm_run_auxstr_vcpu$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_kvm_run_auxstr_vcpu_OBJECTS) $(ioctl_kvm_run_auxstr_vcpu_LDADD) $(LIBS) + ioctl_loop$(EXEEXT): $(ioctl_loop_OBJECTS) $(ioctl_loop_DEPENDENCIES) $(EXTRA_ioctl_loop_DEPENDENCIES) @rm -f ioctl_loop$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ioctl_loop_OBJECTS) $(ioctl_loop_LDADD) $(LIBS) @@ -3420,6 +5797,30 @@ ioctl_mtd$(EXEEXT): $(ioctl_mtd_OBJECTS) $(ioctl_mtd_DEPENDENCIES) $(EXTRA_ioctl @rm -f ioctl_mtd$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ioctl_mtd_OBJECTS) $(ioctl_mtd_LDADD) $(LIBS) +ioctl_nbd$(EXEEXT): $(ioctl_nbd_OBJECTS) $(ioctl_nbd_DEPENDENCIES) $(EXTRA_ioctl_nbd_DEPENDENCIES) + @rm -f ioctl_nbd$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_nbd_OBJECTS) $(ioctl_nbd_LDADD) $(LIBS) + +ioctl_nsfs$(EXEEXT): $(ioctl_nsfs_OBJECTS) $(ioctl_nsfs_DEPENDENCIES) $(EXTRA_ioctl_nsfs_DEPENDENCIES) + @rm -f ioctl_nsfs$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_nsfs_OBJECTS) $(ioctl_nsfs_LDADD) $(LIBS) + +ioctl_perf$(EXEEXT): $(ioctl_perf_OBJECTS) $(ioctl_perf_DEPENDENCIES) $(EXTRA_ioctl_perf_DEPENDENCIES) + @rm -f ioctl_perf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_perf_OBJECTS) $(ioctl_perf_LDADD) $(LIBS) + +ioctl_perf-success$(EXEEXT): $(ioctl_perf_success_OBJECTS) $(ioctl_perf_success_DEPENDENCIES) $(EXTRA_ioctl_perf_success_DEPENDENCIES) + @rm -f ioctl_perf-success$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_perf_success_OBJECTS) $(ioctl_perf_success_LDADD) $(LIBS) + +ioctl_ptp$(EXEEXT): $(ioctl_ptp_OBJECTS) $(ioctl_ptp_DEPENDENCIES) $(EXTRA_ioctl_ptp_DEPENDENCIES) + @rm -f ioctl_ptp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_ptp_OBJECTS) $(ioctl_ptp_LDADD) $(LIBS) + +ioctl_random$(EXEEXT): $(ioctl_random_OBJECTS) $(ioctl_random_DEPENDENCIES) $(EXTRA_ioctl_random_DEPENDENCIES) + @rm -f ioctl_random$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioctl_random_OBJECTS) $(ioctl_random_LDADD) $(LIBS) + ioctl_rtc$(EXEEXT): $(ioctl_rtc_OBJECTS) $(ioctl_rtc_DEPENDENCIES) $(EXTRA_ioctl_rtc_DEPENDENCIES) @rm -f ioctl_rtc$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ioctl_rtc_OBJECTS) $(ioctl_rtc_LDADD) $(LIBS) @@ -3464,6 +5865,18 @@ ioprio$(EXEEXT): $(ioprio_OBJECTS) $(ioprio_DEPENDENCIES) $(EXTRA_ioprio_DEPENDE @rm -f ioprio$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ioprio_OBJECTS) $(ioprio_LDADD) $(LIBS) +ioprio-Xabbrev$(EXEEXT): $(ioprio_Xabbrev_OBJECTS) $(ioprio_Xabbrev_DEPENDENCIES) $(EXTRA_ioprio_Xabbrev_DEPENDENCIES) + @rm -f ioprio-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioprio_Xabbrev_OBJECTS) $(ioprio_Xabbrev_LDADD) $(LIBS) + +ioprio-Xraw$(EXEEXT): $(ioprio_Xraw_OBJECTS) $(ioprio_Xraw_DEPENDENCIES) $(EXTRA_ioprio_Xraw_DEPENDENCIES) + @rm -f ioprio-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioprio_Xraw_OBJECTS) $(ioprio_Xraw_LDADD) $(LIBS) + +ioprio-Xverbose$(EXEEXT): $(ioprio_Xverbose_OBJECTS) $(ioprio_Xverbose_DEPENDENCIES) $(EXTRA_ioprio_Xverbose_DEPENDENCIES) + @rm -f ioprio-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ioprio_Xverbose_OBJECTS) $(ioprio_Xverbose_LDADD) $(LIBS) + ip_mreq$(EXEEXT): $(ip_mreq_OBJECTS) $(ip_mreq_DEPENDENCIES) $(EXTRA_ip_mreq_DEPENDENCIES) @rm -f ip_mreq$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ip_mreq_OBJECTS) $(ip_mreq_LDADD) $(LIBS) @@ -3476,22 +5889,98 @@ ipc_msg$(EXEEXT): $(ipc_msg_OBJECTS) $(ipc_msg_DEPENDENCIES) $(EXTRA_ipc_msg_DEP @rm -f ipc_msg$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ipc_msg_OBJECTS) $(ipc_msg_LDADD) $(LIBS) +ipc_msg-Xabbrev$(EXEEXT): $(ipc_msg_Xabbrev_OBJECTS) $(ipc_msg_Xabbrev_DEPENDENCIES) $(EXTRA_ipc_msg_Xabbrev_DEPENDENCIES) + @rm -f ipc_msg-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msg_Xabbrev_OBJECTS) $(ipc_msg_Xabbrev_LDADD) $(LIBS) + +ipc_msg-Xraw$(EXEEXT): $(ipc_msg_Xraw_OBJECTS) $(ipc_msg_Xraw_DEPENDENCIES) $(EXTRA_ipc_msg_Xraw_DEPENDENCIES) + @rm -f ipc_msg-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msg_Xraw_OBJECTS) $(ipc_msg_Xraw_LDADD) $(LIBS) + +ipc_msg-Xverbose$(EXEEXT): $(ipc_msg_Xverbose_OBJECTS) $(ipc_msg_Xverbose_DEPENDENCIES) $(EXTRA_ipc_msg_Xverbose_DEPENDENCIES) + @rm -f ipc_msg-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msg_Xverbose_OBJECTS) $(ipc_msg_Xverbose_LDADD) $(LIBS) + ipc_msgbuf$(EXEEXT): $(ipc_msgbuf_OBJECTS) $(ipc_msgbuf_DEPENDENCIES) $(EXTRA_ipc_msgbuf_DEPENDENCIES) @rm -f ipc_msgbuf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ipc_msgbuf_OBJECTS) $(ipc_msgbuf_LDADD) $(LIBS) +ipc_msgbuf-Xabbrev$(EXEEXT): $(ipc_msgbuf_Xabbrev_OBJECTS) $(ipc_msgbuf_Xabbrev_DEPENDENCIES) $(EXTRA_ipc_msgbuf_Xabbrev_DEPENDENCIES) + @rm -f ipc_msgbuf-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msgbuf_Xabbrev_OBJECTS) $(ipc_msgbuf_Xabbrev_LDADD) $(LIBS) + +ipc_msgbuf-Xraw$(EXEEXT): $(ipc_msgbuf_Xraw_OBJECTS) $(ipc_msgbuf_Xraw_DEPENDENCIES) $(EXTRA_ipc_msgbuf_Xraw_DEPENDENCIES) + @rm -f ipc_msgbuf-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msgbuf_Xraw_OBJECTS) $(ipc_msgbuf_Xraw_LDADD) $(LIBS) + +ipc_msgbuf-Xverbose$(EXEEXT): $(ipc_msgbuf_Xverbose_OBJECTS) $(ipc_msgbuf_Xverbose_DEPENDENCIES) $(EXTRA_ipc_msgbuf_Xverbose_DEPENDENCIES) + @rm -f ipc_msgbuf-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_msgbuf_Xverbose_OBJECTS) $(ipc_msgbuf_Xverbose_LDADD) $(LIBS) + ipc_sem$(EXEEXT): $(ipc_sem_OBJECTS) $(ipc_sem_DEPENDENCIES) $(EXTRA_ipc_sem_DEPENDENCIES) @rm -f ipc_sem$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ipc_sem_OBJECTS) $(ipc_sem_LDADD) $(LIBS) +ipc_sem-Xabbrev$(EXEEXT): $(ipc_sem_Xabbrev_OBJECTS) $(ipc_sem_Xabbrev_DEPENDENCIES) $(EXTRA_ipc_sem_Xabbrev_DEPENDENCIES) + @rm -f ipc_sem-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_sem_Xabbrev_OBJECTS) $(ipc_sem_Xabbrev_LDADD) $(LIBS) + +ipc_sem-Xraw$(EXEEXT): $(ipc_sem_Xraw_OBJECTS) $(ipc_sem_Xraw_DEPENDENCIES) $(EXTRA_ipc_sem_Xraw_DEPENDENCIES) + @rm -f ipc_sem-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_sem_Xraw_OBJECTS) $(ipc_sem_Xraw_LDADD) $(LIBS) + +ipc_sem-Xverbose$(EXEEXT): $(ipc_sem_Xverbose_OBJECTS) $(ipc_sem_Xverbose_DEPENDENCIES) $(EXTRA_ipc_sem_Xverbose_DEPENDENCIES) + @rm -f ipc_sem-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_sem_Xverbose_OBJECTS) $(ipc_sem_Xverbose_LDADD) $(LIBS) + ipc_shm$(EXEEXT): $(ipc_shm_OBJECTS) $(ipc_shm_DEPENDENCIES) $(EXTRA_ipc_shm_DEPENDENCIES) @rm -f ipc_shm$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ipc_shm_OBJECTS) $(ipc_shm_LDADD) $(LIBS) +ipc_shm-Xabbrev$(EXEEXT): $(ipc_shm_Xabbrev_OBJECTS) $(ipc_shm_Xabbrev_DEPENDENCIES) $(EXTRA_ipc_shm_Xabbrev_DEPENDENCIES) + @rm -f ipc_shm-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_shm_Xabbrev_OBJECTS) $(ipc_shm_Xabbrev_LDADD) $(LIBS) + +ipc_shm-Xraw$(EXEEXT): $(ipc_shm_Xraw_OBJECTS) $(ipc_shm_Xraw_DEPENDENCIES) $(EXTRA_ipc_shm_Xraw_DEPENDENCIES) + @rm -f ipc_shm-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_shm_Xraw_OBJECTS) $(ipc_shm_Xraw_LDADD) $(LIBS) + +ipc_shm-Xverbose$(EXEEXT): $(ipc_shm_Xverbose_OBJECTS) $(ipc_shm_Xverbose_DEPENDENCIES) $(EXTRA_ipc_shm_Xverbose_DEPENDENCIES) + @rm -f ipc_shm-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ipc_shm_Xverbose_OBJECTS) $(ipc_shm_Xverbose_LDADD) $(LIBS) + +is_linux_mips_n64$(EXEEXT): $(is_linux_mips_n64_OBJECTS) $(is_linux_mips_n64_DEPENDENCIES) $(EXTRA_is_linux_mips_n64_DEPENDENCIES) + @rm -f is_linux_mips_n64$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(is_linux_mips_n64_OBJECTS) $(is_linux_mips_n64_LDADD) $(LIBS) + kcmp$(EXEEXT): $(kcmp_OBJECTS) $(kcmp_DEPENDENCIES) $(EXTRA_kcmp_DEPENDENCIES) @rm -f kcmp$(EXEEXT) $(AM_V_CCLD)$(LINK) $(kcmp_OBJECTS) $(kcmp_LDADD) $(LIBS) +kcmp-y$(EXEEXT): $(kcmp_y_OBJECTS) $(kcmp_y_DEPENDENCIES) $(EXTRA_kcmp_y_DEPENDENCIES) + @rm -f kcmp-y$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kcmp_y_OBJECTS) $(kcmp_y_LDADD) $(LIBS) + +kern_features$(EXEEXT): $(kern_features_OBJECTS) $(kern_features_DEPENDENCIES) $(EXTRA_kern_features_DEPENDENCIES) + @rm -f kern_features$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kern_features_OBJECTS) $(kern_features_LDADD) $(LIBS) + +kernel_version$(EXEEXT): $(kernel_version_OBJECTS) $(kernel_version_DEPENDENCIES) $(EXTRA_kernel_version_DEPENDENCIES) + @rm -f kernel_version$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kernel_version_OBJECTS) $(kernel_version_LDADD) $(LIBS) + +kernel_version-Xabbrev$(EXEEXT): $(kernel_version_Xabbrev_OBJECTS) $(kernel_version_Xabbrev_DEPENDENCIES) $(EXTRA_kernel_version_Xabbrev_DEPENDENCIES) + @rm -f kernel_version-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kernel_version_Xabbrev_OBJECTS) $(kernel_version_Xabbrev_LDADD) $(LIBS) + +kernel_version-Xraw$(EXEEXT): $(kernel_version_Xraw_OBJECTS) $(kernel_version_Xraw_DEPENDENCIES) $(EXTRA_kernel_version_Xraw_DEPENDENCIES) + @rm -f kernel_version-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kernel_version_Xraw_OBJECTS) $(kernel_version_Xraw_LDADD) $(LIBS) + +kernel_version-Xverbose$(EXEEXT): $(kernel_version_Xverbose_OBJECTS) $(kernel_version_Xverbose_DEPENDENCIES) $(EXTRA_kernel_version_Xverbose_DEPENDENCIES) + @rm -f kernel_version-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kernel_version_Xverbose_OBJECTS) $(kernel_version_Xverbose_LDADD) $(LIBS) + kexec_file_load$(EXEEXT): $(kexec_file_load_OBJECTS) $(kexec_file_load_DEPENDENCIES) $(EXTRA_kexec_file_load_DEPENDENCIES) @rm -f kexec_file_load$(EXEEXT) $(AM_V_CCLD)$(LINK) $(kexec_file_load_OBJECTS) $(kexec_file_load_LDADD) $(LIBS) @@ -3504,10 +5993,26 @@ keyctl$(EXEEXT): $(keyctl_OBJECTS) $(keyctl_DEPENDENCIES) $(EXTRA_keyctl_DEPENDE @rm -f keyctl$(EXEEXT) $(AM_V_CCLD)$(LINK) $(keyctl_OBJECTS) $(keyctl_LDADD) $(LIBS) +keyctl-Xabbrev$(EXEEXT): $(keyctl_Xabbrev_OBJECTS) $(keyctl_Xabbrev_DEPENDENCIES) $(EXTRA_keyctl_Xabbrev_DEPENDENCIES) + @rm -f keyctl-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(keyctl_Xabbrev_OBJECTS) $(keyctl_Xabbrev_LDADD) $(LIBS) + +keyctl-Xraw$(EXEEXT): $(keyctl_Xraw_OBJECTS) $(keyctl_Xraw_DEPENDENCIES) $(EXTRA_keyctl_Xraw_DEPENDENCIES) + @rm -f keyctl-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(keyctl_Xraw_OBJECTS) $(keyctl_Xraw_LDADD) $(LIBS) + +keyctl-Xverbose$(EXEEXT): $(keyctl_Xverbose_OBJECTS) $(keyctl_Xverbose_DEPENDENCIES) $(EXTRA_keyctl_Xverbose_DEPENDENCIES) + @rm -f keyctl-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(keyctl_Xverbose_OBJECTS) $(keyctl_Xverbose_LDADD) $(LIBS) + kill$(EXEEXT): $(kill_OBJECTS) $(kill_DEPENDENCIES) $(EXTRA_kill_DEPENDENCIES) @rm -f kill$(EXEEXT) $(AM_V_CCLD)$(LINK) $(kill_OBJECTS) $(kill_LDADD) $(LIBS) +kill_child$(EXEEXT): $(kill_child_OBJECTS) $(kill_child_DEPENDENCIES) $(EXTRA_kill_child_DEPENDENCIES) + @rm -f kill_child$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(kill_child_OBJECTS) $(kill_child_LDADD) $(LIBS) + ksysent$(EXEEXT): $(ksysent_OBJECTS) $(ksysent_DEPENDENCIES) $(EXTRA_ksysent_DEPENDENCIES) @rm -f ksysent$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ksysent_OBJECTS) $(ksysent_LDADD) $(LIBS) @@ -3528,14 +6033,26 @@ linkat$(EXEEXT): $(linkat_OBJECTS) $(linkat_DEPENDENCIES) $(EXTRA_linkat_DEPENDE @rm -f linkat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(linkat_OBJECTS) $(linkat_LDADD) $(LIBS) +list_sigaction_signum$(EXEEXT): $(list_sigaction_signum_OBJECTS) $(list_sigaction_signum_DEPENDENCIES) $(EXTRA_list_sigaction_signum_DEPENDENCIES) + @rm -f list_sigaction_signum$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(list_sigaction_signum_OBJECTS) $(list_sigaction_signum_LDADD) $(LIBS) + llseek$(EXEEXT): $(llseek_OBJECTS) $(llseek_DEPENDENCIES) $(EXTRA_llseek_DEPENDENCIES) @rm -f llseek$(EXEEXT) $(AM_V_CCLD)$(LINK) $(llseek_OBJECTS) $(llseek_LDADD) $(LIBS) +localtime$(EXEEXT): $(localtime_OBJECTS) $(localtime_DEPENDENCIES) $(EXTRA_localtime_DEPENDENCIES) + @rm -f localtime$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(localtime_OBJECTS) $(localtime_LDADD) $(LIBS) + lookup_dcookie$(EXEEXT): $(lookup_dcookie_OBJECTS) $(lookup_dcookie_DEPENDENCIES) $(EXTRA_lookup_dcookie_DEPENDENCIES) @rm -f lookup_dcookie$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lookup_dcookie_OBJECTS) $(lookup_dcookie_LDADD) $(LIBS) +looping_threads$(EXEEXT): $(looping_threads_OBJECTS) $(looping_threads_DEPENDENCIES) $(EXTRA_looping_threads_DEPENDENCIES) + @rm -f looping_threads$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(looping_threads_OBJECTS) $(looping_threads_LDADD) $(LIBS) + lseek$(EXEEXT): $(lseek_OBJECTS) $(lseek_DEPENDENCIES) $(EXTRA_lseek_DEPENDENCIES) @rm -f lseek$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lseek_OBJECTS) $(lseek_LDADD) $(LIBS) @@ -3548,6 +6065,10 @@ lstat64$(EXEEXT): $(lstat64_OBJECTS) $(lstat64_DEPENDENCIES) $(EXTRA_lstat64_DEP @rm -f lstat64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(lstat64_OBJECTS) $(lstat64_LDADD) $(LIBS) +madvise$(EXEEXT): $(madvise_OBJECTS) $(madvise_DEPENDENCIES) $(EXTRA_madvise_DEPENDENCIES) + @rm -f madvise$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(madvise_OBJECTS) $(madvise_LDADD) $(LIBS) + mbind$(EXEEXT): $(mbind_OBJECTS) $(mbind_DEPENDENCIES) $(EXTRA_mbind_DEPENDENCIES) @rm -f mbind$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mbind_OBJECTS) $(mbind_LDADD) $(LIBS) @@ -3560,6 +6081,18 @@ memfd_create$(EXEEXT): $(memfd_create_OBJECTS) $(memfd_create_DEPENDENCIES) $(EX @rm -f memfd_create$(EXEEXT) $(AM_V_CCLD)$(LINK) $(memfd_create_OBJECTS) $(memfd_create_LDADD) $(LIBS) +memfd_create-Xabbrev$(EXEEXT): $(memfd_create_Xabbrev_OBJECTS) $(memfd_create_Xabbrev_DEPENDENCIES) $(EXTRA_memfd_create_Xabbrev_DEPENDENCIES) + @rm -f memfd_create-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(memfd_create_Xabbrev_OBJECTS) $(memfd_create_Xabbrev_LDADD) $(LIBS) + +memfd_create-Xraw$(EXEEXT): $(memfd_create_Xraw_OBJECTS) $(memfd_create_Xraw_DEPENDENCIES) $(EXTRA_memfd_create_Xraw_DEPENDENCIES) + @rm -f memfd_create-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(memfd_create_Xraw_OBJECTS) $(memfd_create_Xraw_LDADD) $(LIBS) + +memfd_create-Xverbose$(EXEEXT): $(memfd_create_Xverbose_OBJECTS) $(memfd_create_Xverbose_DEPENDENCIES) $(EXTRA_memfd_create_Xverbose_DEPENDENCIES) + @rm -f memfd_create-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(memfd_create_Xverbose_OBJECTS) $(memfd_create_Xverbose_LDADD) $(LIBS) + migrate_pages$(EXEEXT): $(migrate_pages_OBJECTS) $(migrate_pages_DEPENDENCIES) $(EXTRA_migrate_pages_DEPENDENCIES) @rm -f migrate_pages$(EXEEXT) $(AM_V_CCLD)$(LINK) $(migrate_pages_OBJECTS) $(migrate_pages_LDADD) $(LIBS) @@ -3600,10 +6133,34 @@ mmap$(EXEEXT): $(mmap_OBJECTS) $(mmap_DEPENDENCIES) $(EXTRA_mmap_DEPENDENCIES) @rm -f mmap$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mmap_OBJECTS) $(mmap_LDADD) $(LIBS) +mmap-Xabbrev$(EXEEXT): $(mmap_Xabbrev_OBJECTS) $(mmap_Xabbrev_DEPENDENCIES) $(EXTRA_mmap_Xabbrev_DEPENDENCIES) + @rm -f mmap-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap_Xabbrev_OBJECTS) $(mmap_Xabbrev_LDADD) $(LIBS) + +mmap-Xraw$(EXEEXT): $(mmap_Xraw_OBJECTS) $(mmap_Xraw_DEPENDENCIES) $(EXTRA_mmap_Xraw_DEPENDENCIES) + @rm -f mmap-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap_Xraw_OBJECTS) $(mmap_Xraw_LDADD) $(LIBS) + +mmap-Xverbose$(EXEEXT): $(mmap_Xverbose_OBJECTS) $(mmap_Xverbose_DEPENDENCIES) $(EXTRA_mmap_Xverbose_DEPENDENCIES) + @rm -f mmap-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap_Xverbose_OBJECTS) $(mmap_Xverbose_LDADD) $(LIBS) + mmap64$(EXEEXT): $(mmap64_OBJECTS) $(mmap64_DEPENDENCIES) $(EXTRA_mmap64_DEPENDENCIES) @rm -f mmap64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mmap64_OBJECTS) $(mmap64_LDADD) $(LIBS) +mmap64-Xabbrev$(EXEEXT): $(mmap64_Xabbrev_OBJECTS) $(mmap64_Xabbrev_DEPENDENCIES) $(EXTRA_mmap64_Xabbrev_DEPENDENCIES) + @rm -f mmap64-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap64_Xabbrev_OBJECTS) $(mmap64_Xabbrev_LDADD) $(LIBS) + +mmap64-Xraw$(EXEEXT): $(mmap64_Xraw_OBJECTS) $(mmap64_Xraw_DEPENDENCIES) $(EXTRA_mmap64_Xraw_DEPENDENCIES) + @rm -f mmap64-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap64_Xraw_OBJECTS) $(mmap64_Xraw_LDADD) $(LIBS) + +mmap64-Xverbose$(EXEEXT): $(mmap64_Xverbose_OBJECTS) $(mmap64_Xverbose_DEPENDENCIES) $(EXTRA_mmap64_Xverbose_DEPENDENCIES) + @rm -f mmap64-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mmap64_Xverbose_OBJECTS) $(mmap64_Xverbose_LDADD) $(LIBS) + mmsg$(EXEEXT): $(mmsg_OBJECTS) $(mmsg_DEPENDENCIES) $(EXTRA_mmsg_DEPENDENCIES) @rm -f mmsg$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mmsg_OBJECTS) $(mmsg_LDADD) $(LIBS) @@ -3620,14 +6177,42 @@ mmsg_name-v$(EXEEXT): $(mmsg_name_v_OBJECTS) $(mmsg_name_v_DEPENDENCIES) $(EXTRA @rm -f mmsg_name-v$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mmsg_name_v_OBJECTS) $(mmsg_name_v_LDADD) $(LIBS) +modify_ldt$(EXEEXT): $(modify_ldt_OBJECTS) $(modify_ldt_DEPENDENCIES) $(EXTRA_modify_ldt_DEPENDENCIES) + @rm -f modify_ldt$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(modify_ldt_OBJECTS) $(modify_ldt_LDADD) $(LIBS) + mount$(EXEEXT): $(mount_OBJECTS) $(mount_DEPENDENCIES) $(EXTRA_mount_DEPENDENCIES) @rm -f mount$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mount_OBJECTS) $(mount_LDADD) $(LIBS) +mount-Xabbrev$(EXEEXT): $(mount_Xabbrev_OBJECTS) $(mount_Xabbrev_DEPENDENCIES) $(EXTRA_mount_Xabbrev_DEPENDENCIES) + @rm -f mount-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mount_Xabbrev_OBJECTS) $(mount_Xabbrev_LDADD) $(LIBS) + +mount-Xraw$(EXEEXT): $(mount_Xraw_OBJECTS) $(mount_Xraw_DEPENDENCIES) $(EXTRA_mount_Xraw_DEPENDENCIES) + @rm -f mount-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mount_Xraw_OBJECTS) $(mount_Xraw_LDADD) $(LIBS) + +mount-Xverbose$(EXEEXT): $(mount_Xverbose_OBJECTS) $(mount_Xverbose_DEPENDENCIES) $(EXTRA_mount_Xverbose_DEPENDENCIES) + @rm -f mount-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(mount_Xverbose_OBJECTS) $(mount_Xverbose_LDADD) $(LIBS) + move_pages$(EXEEXT): $(move_pages_OBJECTS) $(move_pages_DEPENDENCIES) $(EXTRA_move_pages_DEPENDENCIES) @rm -f move_pages$(EXEEXT) $(AM_V_CCLD)$(LINK) $(move_pages_OBJECTS) $(move_pages_LDADD) $(LIBS) +move_pages-Xabbrev$(EXEEXT): $(move_pages_Xabbrev_OBJECTS) $(move_pages_Xabbrev_DEPENDENCIES) $(EXTRA_move_pages_Xabbrev_DEPENDENCIES) + @rm -f move_pages-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(move_pages_Xabbrev_OBJECTS) $(move_pages_Xabbrev_LDADD) $(LIBS) + +move_pages-Xraw$(EXEEXT): $(move_pages_Xraw_OBJECTS) $(move_pages_Xraw_DEPENDENCIES) $(EXTRA_move_pages_Xraw_DEPENDENCIES) + @rm -f move_pages-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(move_pages_Xraw_OBJECTS) $(move_pages_Xraw_LDADD) $(LIBS) + +move_pages-Xverbose$(EXEEXT): $(move_pages_Xverbose_OBJECTS) $(move_pages_Xverbose_DEPENDENCIES) $(EXTRA_move_pages_Xverbose_DEPENDENCIES) + @rm -f move_pages-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(move_pages_Xverbose_OBJECTS) $(move_pages_Xverbose_LDADD) $(LIBS) + mq$(EXEEXT): $(mq_OBJECTS) $(mq_DEPENDENCIES) $(EXTRA_mq_DEPENDENCIES) @rm -f mq$(EXEEXT) $(AM_V_CCLD)$(LINK) $(mq_OBJECTS) $(mq_LDADD) $(LIBS) @@ -3672,10 +6257,38 @@ net-icmp_filter$(EXEEXT): $(net_icmp_filter_OBJECTS) $(net_icmp_filter_DEPENDENC @rm -f net-icmp_filter$(EXEEXT) $(AM_V_CCLD)$(LINK) $(net_icmp_filter_OBJECTS) $(net_icmp_filter_LDADD) $(LIBS) +net-packet_mreq$(EXEEXT): $(net_packet_mreq_OBJECTS) $(net_packet_mreq_DEPENDENCIES) $(EXTRA_net_packet_mreq_DEPENDENCIES) + @rm -f net-packet_mreq$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_packet_mreq_OBJECTS) $(net_packet_mreq_LDADD) $(LIBS) + +net-packet_mreq-Xabbrev$(EXEEXT): $(net_packet_mreq_Xabbrev_OBJECTS) $(net_packet_mreq_Xabbrev_DEPENDENCIES) $(EXTRA_net_packet_mreq_Xabbrev_DEPENDENCIES) + @rm -f net-packet_mreq-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_packet_mreq_Xabbrev_OBJECTS) $(net_packet_mreq_Xabbrev_LDADD) $(LIBS) + +net-packet_mreq-Xraw$(EXEEXT): $(net_packet_mreq_Xraw_OBJECTS) $(net_packet_mreq_Xraw_DEPENDENCIES) $(EXTRA_net_packet_mreq_Xraw_DEPENDENCIES) + @rm -f net-packet_mreq-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_packet_mreq_Xraw_OBJECTS) $(net_packet_mreq_Xraw_LDADD) $(LIBS) + +net-packet_mreq-Xverbose$(EXEEXT): $(net_packet_mreq_Xverbose_OBJECTS) $(net_packet_mreq_Xverbose_DEPENDENCIES) $(EXTRA_net_packet_mreq_Xverbose_DEPENDENCIES) + @rm -f net-packet_mreq-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_packet_mreq_Xverbose_OBJECTS) $(net_packet_mreq_Xverbose_LDADD) $(LIBS) + net-sockaddr$(EXEEXT): $(net_sockaddr_OBJECTS) $(net_sockaddr_DEPENDENCIES) $(EXTRA_net_sockaddr_DEPENDENCIES) @rm -f net-sockaddr$(EXEEXT) $(AM_V_CCLD)$(LINK) $(net_sockaddr_OBJECTS) $(net_sockaddr_LDADD) $(LIBS) +net-tpacket_req$(EXEEXT): $(net_tpacket_req_OBJECTS) $(net_tpacket_req_DEPENDENCIES) $(EXTRA_net_tpacket_req_DEPENDENCIES) + @rm -f net-tpacket_req$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_tpacket_req_OBJECTS) $(net_tpacket_req_LDADD) $(LIBS) + +net-tpacket_stats$(EXEEXT): $(net_tpacket_stats_OBJECTS) $(net_tpacket_stats_DEPENDENCIES) $(EXTRA_net_tpacket_stats_DEPENDENCIES) + @rm -f net-tpacket_stats$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_tpacket_stats_OBJECTS) $(net_tpacket_stats_LDADD) $(LIBS) + +net-tpacket_stats-success$(EXEEXT): $(net_tpacket_stats_success_OBJECTS) $(net_tpacket_stats_success_DEPENDENCIES) $(EXTRA_net_tpacket_stats_success_DEPENDENCIES) + @rm -f net-tpacket_stats-success$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_tpacket_stats_success_OBJECTS) $(net_tpacket_stats_success_LDADD) $(LIBS) + net-y-unix$(EXEEXT): $(net_y_unix_OBJECTS) $(net_y_unix_DEPENDENCIES) $(EXTRA_net_y_unix_DEPENDENCIES) @rm -f net-y-unix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(net_y_unix_OBJECTS) $(net_y_unix_LDADD) $(LIBS) @@ -3684,6 +6297,10 @@ net-yy-inet$(EXEEXT): $(net_yy_inet_OBJECTS) $(net_yy_inet_DEPENDENCIES) $(EXTRA @rm -f net-yy-inet$(EXEEXT) $(AM_V_CCLD)$(LINK) $(net_yy_inet_OBJECTS) $(net_yy_inet_LDADD) $(LIBS) +net-yy-inet6$(EXEEXT): $(net_yy_inet6_OBJECTS) $(net_yy_inet6_DEPENDENCIES) $(EXTRA_net_yy_inet6_DEPENDENCIES) + @rm -f net-yy-inet6$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(net_yy_inet6_OBJECTS) $(net_yy_inet6_LDADD) $(LIBS) + net-yy-netlink$(EXEEXT): $(net_yy_netlink_OBJECTS) $(net_yy_netlink_DEPENDENCIES) $(EXTRA_net_yy_netlink_DEPENDENCIES) @rm -f net-yy-netlink$(EXEEXT) $(AM_V_CCLD)$(LINK) $(net_yy_netlink_OBJECTS) $(net_yy_netlink_LDADD) $(LIBS) @@ -3692,10 +6309,30 @@ net-yy-unix$(EXEEXT): $(net_yy_unix_OBJECTS) $(net_yy_unix_DEPENDENCIES) $(EXTRA @rm -f net-yy-unix$(EXEEXT) $(AM_V_CCLD)$(LINK) $(net_yy_unix_OBJECTS) $(net_yy_unix_LDADD) $(LIBS) +netlink_audit$(EXEEXT): $(netlink_audit_OBJECTS) $(netlink_audit_DEPENDENCIES) $(EXTRA_netlink_audit_DEPENDENCIES) + @rm -f netlink_audit$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_audit_OBJECTS) $(netlink_audit_LDADD) $(LIBS) + +netlink_crypto$(EXEEXT): $(netlink_crypto_OBJECTS) $(netlink_crypto_DEPENDENCIES) $(EXTRA_netlink_crypto_DEPENDENCIES) + @rm -f netlink_crypto$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_crypto_OBJECTS) $(netlink_crypto_LDADD) $(LIBS) + +netlink_generic$(EXEEXT): $(netlink_generic_OBJECTS) $(netlink_generic_DEPENDENCIES) $(EXTRA_netlink_generic_DEPENDENCIES) + @rm -f netlink_generic$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_generic_OBJECTS) $(netlink_generic_LDADD) $(LIBS) + netlink_inet_diag$(EXEEXT): $(netlink_inet_diag_OBJECTS) $(netlink_inet_diag_DEPENDENCIES) $(EXTRA_netlink_inet_diag_DEPENDENCIES) @rm -f netlink_inet_diag$(EXEEXT) $(AM_V_CCLD)$(LINK) $(netlink_inet_diag_OBJECTS) $(netlink_inet_diag_LDADD) $(LIBS) +netlink_kobject_uevent$(EXEEXT): $(netlink_kobject_uevent_OBJECTS) $(netlink_kobject_uevent_DEPENDENCIES) $(EXTRA_netlink_kobject_uevent_DEPENDENCIES) + @rm -f netlink_kobject_uevent$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_kobject_uevent_OBJECTS) $(netlink_kobject_uevent_LDADD) $(LIBS) + +netlink_netfilter$(EXEEXT): $(netlink_netfilter_OBJECTS) $(netlink_netfilter_DEPENDENCIES) $(EXTRA_netlink_netfilter_DEPENDENCIES) + @rm -f netlink_netfilter$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_netfilter_OBJECTS) $(netlink_netfilter_LDADD) $(LIBS) + netlink_netlink_diag$(EXEEXT): $(netlink_netlink_diag_OBJECTS) $(netlink_netlink_diag_DEPENDENCIES) $(EXTRA_netlink_netlink_diag_DEPENDENCIES) @rm -f netlink_netlink_diag$(EXEEXT) $(AM_V_CCLD)$(LINK) $(netlink_netlink_diag_OBJECTS) $(netlink_netlink_diag_LDADD) $(LIBS) @@ -3704,22 +6341,234 @@ netlink_protocol$(EXEEXT): $(netlink_protocol_OBJECTS) $(netlink_protocol_DEPEND @rm -f netlink_protocol$(EXEEXT) $(AM_V_CCLD)$(LINK) $(netlink_protocol_OBJECTS) $(netlink_protocol_LDADD) $(LIBS) +netlink_route$(EXEEXT): $(netlink_route_OBJECTS) $(netlink_route_DEPENDENCIES) $(EXTRA_netlink_route_DEPENDENCIES) + @rm -f netlink_route$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_route_OBJECTS) $(netlink_route_LDADD) $(LIBS) + +netlink_selinux$(EXEEXT): $(netlink_selinux_OBJECTS) $(netlink_selinux_DEPENDENCIES) $(EXTRA_netlink_selinux_DEPENDENCIES) + @rm -f netlink_selinux$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_selinux_OBJECTS) $(netlink_selinux_LDADD) $(LIBS) + +netlink_sock_diag$(EXEEXT): $(netlink_sock_diag_OBJECTS) $(netlink_sock_diag_DEPENDENCIES) $(EXTRA_netlink_sock_diag_DEPENDENCIES) + @rm -f netlink_sock_diag$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_sock_diag_OBJECTS) $(netlink_sock_diag_LDADD) $(LIBS) + netlink_unix_diag$(EXEEXT): $(netlink_unix_diag_OBJECTS) $(netlink_unix_diag_DEPENDENCIES) $(EXTRA_netlink_unix_diag_DEPENDENCIES) @rm -f netlink_unix_diag$(EXEEXT) $(AM_V_CCLD)$(LINK) $(netlink_unix_diag_OBJECTS) $(netlink_unix_diag_LDADD) $(LIBS) +netlink_xfrm$(EXEEXT): $(netlink_xfrm_OBJECTS) $(netlink_xfrm_DEPENDENCIES) $(EXTRA_netlink_xfrm_DEPENDENCIES) + @rm -f netlink_xfrm$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(netlink_xfrm_OBJECTS) $(netlink_xfrm_LDADD) $(LIBS) + newfstatat$(EXEEXT): $(newfstatat_OBJECTS) $(newfstatat_DEPENDENCIES) $(EXTRA_newfstatat_DEPENDENCIES) @rm -f newfstatat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(newfstatat_OBJECTS) $(newfstatat_LDADD) $(LIBS) +nfnetlink_acct$(EXEEXT): $(nfnetlink_acct_OBJECTS) $(nfnetlink_acct_DEPENDENCIES) $(EXTRA_nfnetlink_acct_DEPENDENCIES) + @rm -f nfnetlink_acct$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_acct_OBJECTS) $(nfnetlink_acct_LDADD) $(LIBS) + +nfnetlink_cthelper$(EXEEXT): $(nfnetlink_cthelper_OBJECTS) $(nfnetlink_cthelper_DEPENDENCIES) $(EXTRA_nfnetlink_cthelper_DEPENDENCIES) + @rm -f nfnetlink_cthelper$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_cthelper_OBJECTS) $(nfnetlink_cthelper_LDADD) $(LIBS) + +nfnetlink_ctnetlink$(EXEEXT): $(nfnetlink_ctnetlink_OBJECTS) $(nfnetlink_ctnetlink_DEPENDENCIES) $(EXTRA_nfnetlink_ctnetlink_DEPENDENCIES) + @rm -f nfnetlink_ctnetlink$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_ctnetlink_OBJECTS) $(nfnetlink_ctnetlink_LDADD) $(LIBS) + +nfnetlink_ctnetlink_exp$(EXEEXT): $(nfnetlink_ctnetlink_exp_OBJECTS) $(nfnetlink_ctnetlink_exp_DEPENDENCIES) $(EXTRA_nfnetlink_ctnetlink_exp_DEPENDENCIES) + @rm -f nfnetlink_ctnetlink_exp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_ctnetlink_exp_OBJECTS) $(nfnetlink_ctnetlink_exp_LDADD) $(LIBS) + +nfnetlink_cttimeout$(EXEEXT): $(nfnetlink_cttimeout_OBJECTS) $(nfnetlink_cttimeout_DEPENDENCIES) $(EXTRA_nfnetlink_cttimeout_DEPENDENCIES) + @rm -f nfnetlink_cttimeout$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_cttimeout_OBJECTS) $(nfnetlink_cttimeout_LDADD) $(LIBS) + +nfnetlink_ipset$(EXEEXT): $(nfnetlink_ipset_OBJECTS) $(nfnetlink_ipset_DEPENDENCIES) $(EXTRA_nfnetlink_ipset_DEPENDENCIES) + @rm -f nfnetlink_ipset$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_ipset_OBJECTS) $(nfnetlink_ipset_LDADD) $(LIBS) + +nfnetlink_nft_compat$(EXEEXT): $(nfnetlink_nft_compat_OBJECTS) $(nfnetlink_nft_compat_DEPENDENCIES) $(EXTRA_nfnetlink_nft_compat_DEPENDENCIES) + @rm -f nfnetlink_nft_compat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_nft_compat_OBJECTS) $(nfnetlink_nft_compat_LDADD) $(LIBS) + +nfnetlink_nftables$(EXEEXT): $(nfnetlink_nftables_OBJECTS) $(nfnetlink_nftables_DEPENDENCIES) $(EXTRA_nfnetlink_nftables_DEPENDENCIES) + @rm -f nfnetlink_nftables$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_nftables_OBJECTS) $(nfnetlink_nftables_LDADD) $(LIBS) + +nfnetlink_osf$(EXEEXT): $(nfnetlink_osf_OBJECTS) $(nfnetlink_osf_DEPENDENCIES) $(EXTRA_nfnetlink_osf_DEPENDENCIES) + @rm -f nfnetlink_osf$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_osf_OBJECTS) $(nfnetlink_osf_LDADD) $(LIBS) + +nfnetlink_queue$(EXEEXT): $(nfnetlink_queue_OBJECTS) $(nfnetlink_queue_DEPENDENCIES) $(EXTRA_nfnetlink_queue_DEPENDENCIES) + @rm -f nfnetlink_queue$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_queue_OBJECTS) $(nfnetlink_queue_LDADD) $(LIBS) + +nfnetlink_ulog$(EXEEXT): $(nfnetlink_ulog_OBJECTS) $(nfnetlink_ulog_DEPENDENCIES) $(EXTRA_nfnetlink_ulog_DEPENDENCIES) + @rm -f nfnetlink_ulog$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nfnetlink_ulog_OBJECTS) $(nfnetlink_ulog_LDADD) $(LIBS) + +nlattr$(EXEEXT): $(nlattr_OBJECTS) $(nlattr_DEPENDENCIES) $(EXTRA_nlattr_DEPENDENCIES) + @rm -f nlattr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_OBJECTS) $(nlattr_LDADD) $(LIBS) + +nlattr_br_port_msg$(EXEEXT): $(nlattr_br_port_msg_OBJECTS) $(nlattr_br_port_msg_DEPENDENCIES) $(EXTRA_nlattr_br_port_msg_DEPENDENCIES) + @rm -f nlattr_br_port_msg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_br_port_msg_OBJECTS) $(nlattr_br_port_msg_LDADD) $(LIBS) + +nlattr_crypto_user_alg$(EXEEXT): $(nlattr_crypto_user_alg_OBJECTS) $(nlattr_crypto_user_alg_DEPENDENCIES) $(EXTRA_nlattr_crypto_user_alg_DEPENDENCIES) + @rm -f nlattr_crypto_user_alg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_crypto_user_alg_OBJECTS) $(nlattr_crypto_user_alg_LDADD) $(LIBS) + +nlattr_dcbmsg$(EXEEXT): $(nlattr_dcbmsg_OBJECTS) $(nlattr_dcbmsg_DEPENDENCIES) $(EXTRA_nlattr_dcbmsg_DEPENDENCIES) + @rm -f nlattr_dcbmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_dcbmsg_OBJECTS) $(nlattr_dcbmsg_LDADD) $(LIBS) + +nlattr_fib_rule_hdr$(EXEEXT): $(nlattr_fib_rule_hdr_OBJECTS) $(nlattr_fib_rule_hdr_DEPENDENCIES) $(EXTRA_nlattr_fib_rule_hdr_DEPENDENCIES) + @rm -f nlattr_fib_rule_hdr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_fib_rule_hdr_OBJECTS) $(nlattr_fib_rule_hdr_LDADD) $(LIBS) + +nlattr_ifaddrlblmsg$(EXEEXT): $(nlattr_ifaddrlblmsg_OBJECTS) $(nlattr_ifaddrlblmsg_DEPENDENCIES) $(EXTRA_nlattr_ifaddrlblmsg_DEPENDENCIES) + @rm -f nlattr_ifaddrlblmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifaddrlblmsg_OBJECTS) $(nlattr_ifaddrlblmsg_LDADD) $(LIBS) + +nlattr_ifaddrmsg$(EXEEXT): $(nlattr_ifaddrmsg_OBJECTS) $(nlattr_ifaddrmsg_DEPENDENCIES) $(EXTRA_nlattr_ifaddrmsg_DEPENDENCIES) + @rm -f nlattr_ifaddrmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifaddrmsg_OBJECTS) $(nlattr_ifaddrmsg_LDADD) $(LIBS) + +nlattr_ifinfomsg$(EXEEXT): $(nlattr_ifinfomsg_OBJECTS) $(nlattr_ifinfomsg_DEPENDENCIES) $(EXTRA_nlattr_ifinfomsg_DEPENDENCIES) + @rm -f nlattr_ifinfomsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifinfomsg_OBJECTS) $(nlattr_ifinfomsg_LDADD) $(LIBS) + +nlattr_ifla_af_spec$(EXEEXT): $(nlattr_ifla_af_spec_OBJECTS) $(nlattr_ifla_af_spec_DEPENDENCIES) $(EXTRA_nlattr_ifla_af_spec_DEPENDENCIES) + @rm -f nlattr_ifla_af_spec$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifla_af_spec_OBJECTS) $(nlattr_ifla_af_spec_LDADD) $(LIBS) + +nlattr_ifla_brport$(EXEEXT): $(nlattr_ifla_brport_OBJECTS) $(nlattr_ifla_brport_DEPENDENCIES) $(EXTRA_nlattr_ifla_brport_DEPENDENCIES) + @rm -f nlattr_ifla_brport$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifla_brport_OBJECTS) $(nlattr_ifla_brport_LDADD) $(LIBS) + +nlattr_ifla_linkinfo$(EXEEXT): $(nlattr_ifla_linkinfo_OBJECTS) $(nlattr_ifla_linkinfo_DEPENDENCIES) $(EXTRA_nlattr_ifla_linkinfo_DEPENDENCIES) + @rm -f nlattr_ifla_linkinfo$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifla_linkinfo_OBJECTS) $(nlattr_ifla_linkinfo_LDADD) $(LIBS) + +nlattr_ifla_port$(EXEEXT): $(nlattr_ifla_port_OBJECTS) $(nlattr_ifla_port_DEPENDENCIES) $(EXTRA_nlattr_ifla_port_DEPENDENCIES) + @rm -f nlattr_ifla_port$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifla_port_OBJECTS) $(nlattr_ifla_port_LDADD) $(LIBS) + +nlattr_ifla_xdp$(EXEEXT): $(nlattr_ifla_xdp_OBJECTS) $(nlattr_ifla_xdp_DEPENDENCIES) $(EXTRA_nlattr_ifla_xdp_DEPENDENCIES) + @rm -f nlattr_ifla_xdp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ifla_xdp_OBJECTS) $(nlattr_ifla_xdp_LDADD) $(LIBS) + +nlattr_inet_diag_msg$(EXEEXT): $(nlattr_inet_diag_msg_OBJECTS) $(nlattr_inet_diag_msg_DEPENDENCIES) $(EXTRA_nlattr_inet_diag_msg_DEPENDENCIES) + @rm -f nlattr_inet_diag_msg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_inet_diag_msg_OBJECTS) $(nlattr_inet_diag_msg_LDADD) $(LIBS) + +nlattr_inet_diag_req_compat$(EXEEXT): $(nlattr_inet_diag_req_compat_OBJECTS) $(nlattr_inet_diag_req_compat_DEPENDENCIES) $(EXTRA_nlattr_inet_diag_req_compat_DEPENDENCIES) + @rm -f nlattr_inet_diag_req_compat$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_inet_diag_req_compat_OBJECTS) $(nlattr_inet_diag_req_compat_LDADD) $(LIBS) + +nlattr_inet_diag_req_v2$(EXEEXT): $(nlattr_inet_diag_req_v2_OBJECTS) $(nlattr_inet_diag_req_v2_DEPENDENCIES) $(EXTRA_nlattr_inet_diag_req_v2_DEPENDENCIES) + @rm -f nlattr_inet_diag_req_v2$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_inet_diag_req_v2_OBJECTS) $(nlattr_inet_diag_req_v2_LDADD) $(LIBS) + +nlattr_mdba_mdb_entry$(EXEEXT): $(nlattr_mdba_mdb_entry_OBJECTS) $(nlattr_mdba_mdb_entry_DEPENDENCIES) $(EXTRA_nlattr_mdba_mdb_entry_DEPENDENCIES) + @rm -f nlattr_mdba_mdb_entry$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_mdba_mdb_entry_OBJECTS) $(nlattr_mdba_mdb_entry_LDADD) $(LIBS) + +nlattr_mdba_router_port$(EXEEXT): $(nlattr_mdba_router_port_OBJECTS) $(nlattr_mdba_router_port_DEPENDENCIES) $(EXTRA_nlattr_mdba_router_port_DEPENDENCIES) + @rm -f nlattr_mdba_router_port$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_mdba_router_port_OBJECTS) $(nlattr_mdba_router_port_LDADD) $(LIBS) + +nlattr_ndmsg$(EXEEXT): $(nlattr_ndmsg_OBJECTS) $(nlattr_ndmsg_DEPENDENCIES) $(EXTRA_nlattr_ndmsg_DEPENDENCIES) + @rm -f nlattr_ndmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ndmsg_OBJECTS) $(nlattr_ndmsg_LDADD) $(LIBS) + +nlattr_ndtmsg$(EXEEXT): $(nlattr_ndtmsg_OBJECTS) $(nlattr_ndtmsg_DEPENDENCIES) $(EXTRA_nlattr_ndtmsg_DEPENDENCIES) + @rm -f nlattr_ndtmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_ndtmsg_OBJECTS) $(nlattr_ndtmsg_LDADD) $(LIBS) + +nlattr_netconfmsg$(EXEEXT): $(nlattr_netconfmsg_OBJECTS) $(nlattr_netconfmsg_DEPENDENCIES) $(EXTRA_nlattr_netconfmsg_DEPENDENCIES) + @rm -f nlattr_netconfmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_netconfmsg_OBJECTS) $(nlattr_netconfmsg_LDADD) $(LIBS) + +nlattr_netlink_diag_msg$(EXEEXT): $(nlattr_netlink_diag_msg_OBJECTS) $(nlattr_netlink_diag_msg_DEPENDENCIES) $(EXTRA_nlattr_netlink_diag_msg_DEPENDENCIES) + @rm -f nlattr_netlink_diag_msg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_netlink_diag_msg_OBJECTS) $(nlattr_netlink_diag_msg_LDADD) $(LIBS) + +nlattr_nlmsgerr$(EXEEXT): $(nlattr_nlmsgerr_OBJECTS) $(nlattr_nlmsgerr_DEPENDENCIES) $(EXTRA_nlattr_nlmsgerr_DEPENDENCIES) + @rm -f nlattr_nlmsgerr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_nlmsgerr_OBJECTS) $(nlattr_nlmsgerr_LDADD) $(LIBS) + +nlattr_packet_diag_msg$(EXEEXT): $(nlattr_packet_diag_msg_OBJECTS) $(nlattr_packet_diag_msg_DEPENDENCIES) $(EXTRA_nlattr_packet_diag_msg_DEPENDENCIES) + @rm -f nlattr_packet_diag_msg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_packet_diag_msg_OBJECTS) $(nlattr_packet_diag_msg_LDADD) $(LIBS) + +nlattr_rtgenmsg$(EXEEXT): $(nlattr_rtgenmsg_OBJECTS) $(nlattr_rtgenmsg_DEPENDENCIES) $(EXTRA_nlattr_rtgenmsg_DEPENDENCIES) + @rm -f nlattr_rtgenmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_rtgenmsg_OBJECTS) $(nlattr_rtgenmsg_LDADD) $(LIBS) + +nlattr_rtmsg$(EXEEXT): $(nlattr_rtmsg_OBJECTS) $(nlattr_rtmsg_DEPENDENCIES) $(EXTRA_nlattr_rtmsg_DEPENDENCIES) + @rm -f nlattr_rtmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_rtmsg_OBJECTS) $(nlattr_rtmsg_LDADD) $(LIBS) + +nlattr_smc_diag_msg$(EXEEXT): $(nlattr_smc_diag_msg_OBJECTS) $(nlattr_smc_diag_msg_DEPENDENCIES) $(EXTRA_nlattr_smc_diag_msg_DEPENDENCIES) + @rm -f nlattr_smc_diag_msg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_smc_diag_msg_OBJECTS) $(nlattr_smc_diag_msg_LDADD) $(LIBS) + +nlattr_tc_stats$(EXEEXT): $(nlattr_tc_stats_OBJECTS) $(nlattr_tc_stats_DEPENDENCIES) $(EXTRA_nlattr_tc_stats_DEPENDENCIES) + @rm -f nlattr_tc_stats$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_tc_stats_OBJECTS) $(nlattr_tc_stats_LDADD) $(LIBS) + +nlattr_tca_stab$(EXEEXT): $(nlattr_tca_stab_OBJECTS) $(nlattr_tca_stab_DEPENDENCIES) $(EXTRA_nlattr_tca_stab_DEPENDENCIES) + @rm -f nlattr_tca_stab$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_tca_stab_OBJECTS) $(nlattr_tca_stab_LDADD) $(LIBS) + +nlattr_tcamsg$(EXEEXT): $(nlattr_tcamsg_OBJECTS) $(nlattr_tcamsg_DEPENDENCIES) $(EXTRA_nlattr_tcamsg_DEPENDENCIES) + @rm -f nlattr_tcamsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_tcamsg_OBJECTS) $(nlattr_tcamsg_LDADD) $(LIBS) + +nlattr_tcmsg$(EXEEXT): $(nlattr_tcmsg_OBJECTS) $(nlattr_tcmsg_DEPENDENCIES) $(EXTRA_nlattr_tcmsg_DEPENDENCIES) + @rm -f nlattr_tcmsg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_tcmsg_OBJECTS) $(nlattr_tcmsg_LDADD) $(LIBS) + +nlattr_unix_diag_msg$(EXEEXT): $(nlattr_unix_diag_msg_OBJECTS) $(nlattr_unix_diag_msg_DEPENDENCIES) $(EXTRA_nlattr_unix_diag_msg_DEPENDENCIES) + @rm -f nlattr_unix_diag_msg$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nlattr_unix_diag_msg_OBJECTS) $(nlattr_unix_diag_msg_LDADD) $(LIBS) + nsyscalls$(EXEEXT): $(nsyscalls_OBJECTS) $(nsyscalls_DEPENDENCIES) $(EXTRA_nsyscalls_DEPENDENCIES) @rm -f nsyscalls$(EXEEXT) $(AM_V_CCLD)$(LINK) $(nsyscalls_OBJECTS) $(nsyscalls_LDADD) $(LIBS) +nsyscalls-d$(EXEEXT): $(nsyscalls_d_OBJECTS) $(nsyscalls_d_DEPENDENCIES) $(EXTRA_nsyscalls_d_DEPENDENCIES) + @rm -f nsyscalls-d$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(nsyscalls_d_OBJECTS) $(nsyscalls_d_LDADD) $(LIBS) + old_mmap$(EXEEXT): $(old_mmap_OBJECTS) $(old_mmap_DEPENDENCIES) $(EXTRA_old_mmap_DEPENDENCIES) @rm -f old_mmap$(EXEEXT) $(AM_V_CCLD)$(LINK) $(old_mmap_OBJECTS) $(old_mmap_LDADD) $(LIBS) +old_mmap-P$(EXEEXT): $(old_mmap_P_OBJECTS) $(old_mmap_P_DEPENDENCIES) $(EXTRA_old_mmap_P_DEPENDENCIES) + @rm -f old_mmap-P$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(old_mmap_P_OBJECTS) $(old_mmap_P_LDADD) $(LIBS) + +old_mmap-Xabbrev$(EXEEXT): $(old_mmap_Xabbrev_OBJECTS) $(old_mmap_Xabbrev_DEPENDENCIES) $(EXTRA_old_mmap_Xabbrev_DEPENDENCIES) + @rm -f old_mmap-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(old_mmap_Xabbrev_OBJECTS) $(old_mmap_Xabbrev_LDADD) $(LIBS) + +old_mmap-Xraw$(EXEEXT): $(old_mmap_Xraw_OBJECTS) $(old_mmap_Xraw_DEPENDENCIES) $(EXTRA_old_mmap_Xraw_DEPENDENCIES) + @rm -f old_mmap-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(old_mmap_Xraw_OBJECTS) $(old_mmap_Xraw_LDADD) $(LIBS) + +old_mmap-Xverbose$(EXEEXT): $(old_mmap_Xverbose_OBJECTS) $(old_mmap_Xverbose_DEPENDENCIES) $(EXTRA_old_mmap_Xverbose_DEPENDENCIES) + @rm -f old_mmap-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(old_mmap_Xverbose_OBJECTS) $(old_mmap_Xverbose_LDADD) $(LIBS) + +old_mmap-v-none$(EXEEXT): $(old_mmap_v_none_OBJECTS) $(old_mmap_v_none_DEPENDENCIES) $(EXTRA_old_mmap_v_none_DEPENDENCIES) + @rm -f old_mmap-v-none$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(old_mmap_v_none_OBJECTS) $(old_mmap_v_none_LDADD) $(LIBS) + oldfstat$(EXEEXT): $(oldfstat_OBJECTS) $(oldfstat_DEPENDENCIES) $(EXTRA_oldfstat_DEPENDENCIES) @rm -f oldfstat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(oldfstat_OBJECTS) $(oldfstat_LDADD) $(LIBS) @@ -3732,6 +6581,18 @@ oldselect$(EXEEXT): $(oldselect_OBJECTS) $(oldselect_DEPENDENCIES) $(EXTRA_oldse @rm -f oldselect$(EXEEXT) $(AM_V_CCLD)$(LINK) $(oldselect_OBJECTS) $(oldselect_LDADD) $(LIBS) +oldselect-P$(EXEEXT): $(oldselect_P_OBJECTS) $(oldselect_P_DEPENDENCIES) $(EXTRA_oldselect_P_DEPENDENCIES) + @rm -f oldselect-P$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(oldselect_P_OBJECTS) $(oldselect_P_LDADD) $(LIBS) + +oldselect-efault$(EXEEXT): $(oldselect_efault_OBJECTS) $(oldselect_efault_DEPENDENCIES) $(EXTRA_oldselect_efault_DEPENDENCIES) + @rm -f oldselect-efault$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(oldselect_efault_OBJECTS) $(oldselect_efault_LDADD) $(LIBS) + +oldselect-efault-P$(EXEEXT): $(oldselect_efault_P_OBJECTS) $(oldselect_efault_P_DEPENDENCIES) $(EXTRA_oldselect_efault_P_DEPENDENCIES) + @rm -f oldselect-efault-P$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(oldselect_efault_P_OBJECTS) $(oldselect_efault_P_LDADD) $(LIBS) + oldstat$(EXEEXT): $(oldstat_OBJECTS) $(oldstat_DEPENDENCIES) $(EXTRA_oldstat_DEPENDENCIES) @rm -f oldstat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(oldstat_OBJECTS) $(oldstat_LDADD) $(LIBS) @@ -3744,6 +6605,14 @@ openat$(EXEEXT): $(openat_OBJECTS) $(openat_DEPENDENCIES) $(EXTRA_openat_DEPENDE @rm -f openat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(openat_OBJECTS) $(openat_LDADD) $(LIBS) +orphaned_process_group$(EXEEXT): $(orphaned_process_group_OBJECTS) $(orphaned_process_group_DEPENDENCIES) $(EXTRA_orphaned_process_group_DEPENDENCIES) + @rm -f orphaned_process_group$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(orphaned_process_group_OBJECTS) $(orphaned_process_group_LDADD) $(LIBS) + +osf_utimes$(EXEEXT): $(osf_utimes_OBJECTS) $(osf_utimes_DEPENDENCIES) $(EXTRA_osf_utimes_DEPENDENCIES) + @rm -f osf_utimes$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(osf_utimes_OBJECTS) $(osf_utimes_LDADD) $(LIBS) + pause$(EXEEXT): $(pause_OBJECTS) $(pause_DEPENDENCIES) $(EXTRA_pause_DEPENDENCIES) @rm -f pause$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pause_OBJECTS) $(pause_LDADD) $(LIBS) @@ -3768,6 +6637,22 @@ personality$(EXEEXT): $(personality_OBJECTS) $(personality_DEPENDENCIES) $(EXTRA @rm -f personality$(EXEEXT) $(AM_V_CCLD)$(LINK) $(personality_OBJECTS) $(personality_LDADD) $(LIBS) +personality-Xabbrev$(EXEEXT): $(personality_Xabbrev_OBJECTS) $(personality_Xabbrev_DEPENDENCIES) $(EXTRA_personality_Xabbrev_DEPENDENCIES) + @rm -f personality-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(personality_Xabbrev_OBJECTS) $(personality_Xabbrev_LDADD) $(LIBS) + +personality-Xraw$(EXEEXT): $(personality_Xraw_OBJECTS) $(personality_Xraw_DEPENDENCIES) $(EXTRA_personality_Xraw_DEPENDENCIES) + @rm -f personality-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(personality_Xraw_OBJECTS) $(personality_Xraw_LDADD) $(LIBS) + +personality-Xverbose$(EXEEXT): $(personality_Xverbose_OBJECTS) $(personality_Xverbose_DEPENDENCIES) $(EXTRA_personality_Xverbose_DEPENDENCIES) + @rm -f personality-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(personality_Xverbose_OBJECTS) $(personality_Xverbose_LDADD) $(LIBS) + +pidfd_send_signal$(EXEEXT): $(pidfd_send_signal_OBJECTS) $(pidfd_send_signal_DEPENDENCIES) $(EXTRA_pidfd_send_signal_DEPENDENCIES) + @rm -f pidfd_send_signal$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(pidfd_send_signal_OBJECTS) $(pidfd_send_signal_LDADD) $(LIBS) + pipe$(EXEEXT): $(pipe_OBJECTS) $(pipe_DEPENDENCIES) $(EXTRA_pipe_DEPENDENCIES) @rm -f pipe$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pipe_OBJECTS) $(pipe_LDADD) $(LIBS) @@ -3792,10 +6677,22 @@ poll$(EXEEXT): $(poll_OBJECTS) $(poll_DEPENDENCIES) $(EXTRA_poll_DEPENDENCIES) @rm -f poll$(EXEEXT) $(AM_V_CCLD)$(LINK) $(poll_OBJECTS) $(poll_LDADD) $(LIBS) +poll-P$(EXEEXT): $(poll_P_OBJECTS) $(poll_P_DEPENDENCIES) $(EXTRA_poll_P_DEPENDENCIES) + @rm -f poll-P$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(poll_P_OBJECTS) $(poll_P_LDADD) $(LIBS) + ppoll$(EXEEXT): $(ppoll_OBJECTS) $(ppoll_DEPENDENCIES) $(EXTRA_ppoll_DEPENDENCIES) @rm -f ppoll$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ppoll_OBJECTS) $(ppoll_LDADD) $(LIBS) +ppoll-P$(EXEEXT): $(ppoll_P_OBJECTS) $(ppoll_P_DEPENDENCIES) $(EXTRA_ppoll_P_DEPENDENCIES) + @rm -f ppoll-P$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ppoll_P_OBJECTS) $(ppoll_P_LDADD) $(LIBS) + +ppoll-v$(EXEEXT): $(ppoll_v_OBJECTS) $(ppoll_v_DEPENDENCIES) $(EXTRA_ppoll_v_DEPENDENCIES) + @rm -f ppoll-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ppoll_v_OBJECTS) $(ppoll_v_LDADD) $(LIBS) + prctl-arg2-intptr$(EXEEXT): $(prctl_arg2_intptr_OBJECTS) $(prctl_arg2_intptr_DEPENDENCIES) $(EXTRA_prctl_arg2_intptr_DEPENDENCIES) @rm -f prctl-arg2-intptr$(EXEEXT) $(AM_V_CCLD)$(LINK) $(prctl_arg2_intptr_OBJECTS) $(prctl_arg2_intptr_LDADD) $(LIBS) @@ -3828,6 +6725,10 @@ prctl-securebits$(EXEEXT): $(prctl_securebits_OBJECTS) $(prctl_securebits_DEPEND @rm -f prctl-securebits$(EXEEXT) $(AM_V_CCLD)$(LINK) $(prctl_securebits_OBJECTS) $(prctl_securebits_LDADD) $(LIBS) +prctl-spec-inject$(EXEEXT): $(prctl_spec_inject_OBJECTS) $(prctl_spec_inject_DEPENDENCIES) $(EXTRA_prctl_spec_inject_DEPENDENCIES) + @rm -f prctl-spec-inject$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(prctl_spec_inject_OBJECTS) $(prctl_spec_inject_LDADD) $(LIBS) + prctl-tid_address$(EXEEXT): $(prctl_tid_address_OBJECTS) $(prctl_tid_address_DEPENDENCIES) $(EXTRA_prctl_tid_address_DEPENDENCIES) @rm -f prctl-tid_address$(EXEEXT) $(AM_V_CCLD)$(LINK) $(prctl_tid_address_OBJECTS) $(prctl_tid_address_LDADD) $(LIBS) @@ -3856,10 +6757,46 @@ print_maxfd$(EXEEXT): $(print_maxfd_OBJECTS) $(print_maxfd_DEPENDENCIES) $(EXTRA @rm -f print_maxfd$(EXEEXT) $(AM_V_CCLD)$(LINK) $(print_maxfd_OBJECTS) $(print_maxfd_LDADD) $(LIBS) +printpath-umovestr$(EXEEXT): $(printpath_umovestr_OBJECTS) $(printpath_umovestr_DEPENDENCIES) $(EXTRA_printpath_umovestr_DEPENDENCIES) + @rm -f printpath-umovestr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printpath_umovestr_OBJECTS) $(printpath_umovestr_LDADD) $(LIBS) + +printpath-umovestr-peekdata$(EXEEXT): $(printpath_umovestr_peekdata_OBJECTS) $(printpath_umovestr_peekdata_DEPENDENCIES) $(EXTRA_printpath_umovestr_peekdata_DEPENDENCIES) + @rm -f printpath-umovestr-peekdata$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printpath_umovestr_peekdata_OBJECTS) $(printpath_umovestr_peekdata_LDADD) $(LIBS) + +printpath-umovestr-undumpable$(EXEEXT): $(printpath_umovestr_undumpable_OBJECTS) $(printpath_umovestr_undumpable_DEPENDENCIES) $(EXTRA_printpath_umovestr_undumpable_DEPENDENCIES) + @rm -f printpath-umovestr-undumpable$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printpath_umovestr_undumpable_OBJECTS) $(printpath_umovestr_undumpable_LDADD) $(LIBS) + +printsignal-Xabbrev$(EXEEXT): $(printsignal_Xabbrev_OBJECTS) $(printsignal_Xabbrev_DEPENDENCIES) $(EXTRA_printsignal_Xabbrev_DEPENDENCIES) + @rm -f printsignal-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printsignal_Xabbrev_OBJECTS) $(printsignal_Xabbrev_LDADD) $(LIBS) + +printsignal-Xraw$(EXEEXT): $(printsignal_Xraw_OBJECTS) $(printsignal_Xraw_DEPENDENCIES) $(EXTRA_printsignal_Xraw_DEPENDENCIES) + @rm -f printsignal-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printsignal_Xraw_OBJECTS) $(printsignal_Xraw_LDADD) $(LIBS) + +printsignal-Xverbose$(EXEEXT): $(printsignal_Xverbose_OBJECTS) $(printsignal_Xverbose_DEPENDENCIES) $(EXTRA_printsignal_Xverbose_DEPENDENCIES) + @rm -f printsignal-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printsignal_Xverbose_OBJECTS) $(printsignal_Xverbose_LDADD) $(LIBS) + printstr$(EXEEXT): $(printstr_OBJECTS) $(printstr_DEPENDENCIES) $(EXTRA_printstr_DEPENDENCIES) @rm -f printstr$(EXEEXT) $(AM_V_CCLD)$(LINK) $(printstr_OBJECTS) $(printstr_LDADD) $(LIBS) +printstrn-umoven$(EXEEXT): $(printstrn_umoven_OBJECTS) $(printstrn_umoven_DEPENDENCIES) $(EXTRA_printstrn_umoven_DEPENDENCIES) + @rm -f printstrn-umoven$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printstrn_umoven_OBJECTS) $(printstrn_umoven_LDADD) $(LIBS) + +printstrn-umoven-peekdata$(EXEEXT): $(printstrn_umoven_peekdata_OBJECTS) $(printstrn_umoven_peekdata_DEPENDENCIES) $(EXTRA_printstrn_umoven_peekdata_DEPENDENCIES) + @rm -f printstrn-umoven-peekdata$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printstrn_umoven_peekdata_OBJECTS) $(printstrn_umoven_peekdata_LDADD) $(LIBS) + +printstrn-umoven-undumpable$(EXEEXT): $(printstrn_umoven_undumpable_OBJECTS) $(printstrn_umoven_undumpable_DEPENDENCIES) $(EXTRA_printstrn_umoven_undumpable_DEPENDENCIES) + @rm -f printstrn-umoven-undumpable$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(printstrn_umoven_undumpable_OBJECTS) $(printstrn_umoven_undumpable_LDADD) $(LIBS) + prlimit64$(EXEEXT): $(prlimit64_OBJECTS) $(prlimit64_DEPENDENCIES) $(EXTRA_prlimit64_DEPENDENCIES) @rm -f prlimit64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(prlimit64_OBJECTS) $(prlimit64_LDADD) $(LIBS) @@ -3880,6 +6817,10 @@ ptrace$(EXEEXT): $(ptrace_OBJECTS) $(ptrace_DEPENDENCIES) $(EXTRA_ptrace_DEPENDE @rm -f ptrace$(EXEEXT) $(AM_V_CCLD)$(LINK) $(ptrace_OBJECTS) $(ptrace_LDADD) $(LIBS) +ptrace_syscall_info$(EXEEXT): $(ptrace_syscall_info_OBJECTS) $(ptrace_syscall_info_DEPENDENCIES) $(EXTRA_ptrace_syscall_info_DEPENDENCIES) + @rm -f ptrace_syscall_info$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(ptrace_syscall_info_OBJECTS) $(ptrace_syscall_info_LDADD) $(LIBS) + pwritev$(EXEEXT): $(pwritev_OBJECTS) $(pwritev_DEPENDENCIES) $(EXTRA_pwritev_DEPENDENCIES) @rm -f pwritev$(EXEEXT) $(AM_V_CCLD)$(LINK) $(pwritev_OBJECTS) $(pwritev_LDADD) $(LIBS) @@ -3908,6 +6849,26 @@ quotactl$(EXEEXT): $(quotactl_OBJECTS) $(quotactl_DEPENDENCIES) $(EXTRA_quotactl @rm -f quotactl$(EXEEXT) $(AM_V_CCLD)$(LINK) $(quotactl_OBJECTS) $(quotactl_LDADD) $(LIBS) +quotactl-Xabbrev$(EXEEXT): $(quotactl_Xabbrev_OBJECTS) $(quotactl_Xabbrev_DEPENDENCIES) $(EXTRA_quotactl_Xabbrev_DEPENDENCIES) + @rm -f quotactl-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_Xabbrev_OBJECTS) $(quotactl_Xabbrev_LDADD) $(LIBS) + +quotactl-Xraw$(EXEEXT): $(quotactl_Xraw_OBJECTS) $(quotactl_Xraw_DEPENDENCIES) $(EXTRA_quotactl_Xraw_DEPENDENCIES) + @rm -f quotactl-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_Xraw_OBJECTS) $(quotactl_Xraw_LDADD) $(LIBS) + +quotactl-Xverbose$(EXEEXT): $(quotactl_Xverbose_OBJECTS) $(quotactl_Xverbose_DEPENDENCIES) $(EXTRA_quotactl_Xverbose_DEPENDENCIES) + @rm -f quotactl-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_Xverbose_OBJECTS) $(quotactl_Xverbose_LDADD) $(LIBS) + +quotactl-success$(EXEEXT): $(quotactl_success_OBJECTS) $(quotactl_success_DEPENDENCIES) $(EXTRA_quotactl_success_DEPENDENCIES) + @rm -f quotactl-success$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_success_OBJECTS) $(quotactl_success_LDADD) $(LIBS) + +quotactl-success-v$(EXEEXT): $(quotactl_success_v_OBJECTS) $(quotactl_success_v_DEPENDENCIES) $(EXTRA_quotactl_success_v_DEPENDENCIES) + @rm -f quotactl-success-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_success_v_OBJECTS) $(quotactl_success_v_LDADD) $(LIBS) + quotactl-v$(EXEEXT): $(quotactl_v_OBJECTS) $(quotactl_v_DEPENDENCIES) $(EXTRA_quotactl_v_DEPENDENCIES) @rm -f quotactl-v$(EXEEXT) $(AM_V_CCLD)$(LINK) $(quotactl_v_OBJECTS) $(quotactl_v_LDADD) $(LIBS) @@ -3916,6 +6877,14 @@ quotactl-xfs$(EXEEXT): $(quotactl_xfs_OBJECTS) $(quotactl_xfs_DEPENDENCIES) $(EX @rm -f quotactl-xfs$(EXEEXT) $(AM_V_CCLD)$(LINK) $(quotactl_xfs_OBJECTS) $(quotactl_xfs_LDADD) $(LIBS) +quotactl-xfs-success$(EXEEXT): $(quotactl_xfs_success_OBJECTS) $(quotactl_xfs_success_DEPENDENCIES) $(EXTRA_quotactl_xfs_success_DEPENDENCIES) + @rm -f quotactl-xfs-success$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_xfs_success_OBJECTS) $(quotactl_xfs_success_LDADD) $(LIBS) + +quotactl-xfs-success-v$(EXEEXT): $(quotactl_xfs_success_v_OBJECTS) $(quotactl_xfs_success_v_DEPENDENCIES) $(EXTRA_quotactl_xfs_success_v_DEPENDENCIES) + @rm -f quotactl-xfs-success-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(quotactl_xfs_success_v_OBJECTS) $(quotactl_xfs_success_v_LDADD) $(LIBS) + quotactl-xfs-v$(EXEEXT): $(quotactl_xfs_v_OBJECTS) $(quotactl_xfs_v_DEPENDENCIES) $(EXTRA_quotactl_xfs_v_DEPENDENCIES) @rm -f quotactl-xfs-v$(EXEEXT) $(AM_V_CCLD)$(LINK) $(quotactl_xfs_v_OBJECTS) $(quotactl_xfs_v_LDADD) $(LIBS) @@ -3968,6 +6937,18 @@ remap_file_pages$(EXEEXT): $(remap_file_pages_OBJECTS) $(remap_file_pages_DEPEND @rm -f remap_file_pages$(EXEEXT) $(AM_V_CCLD)$(LINK) $(remap_file_pages_OBJECTS) $(remap_file_pages_LDADD) $(LIBS) +remap_file_pages-Xabbrev$(EXEEXT): $(remap_file_pages_Xabbrev_OBJECTS) $(remap_file_pages_Xabbrev_DEPENDENCIES) $(EXTRA_remap_file_pages_Xabbrev_DEPENDENCIES) + @rm -f remap_file_pages-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(remap_file_pages_Xabbrev_OBJECTS) $(remap_file_pages_Xabbrev_LDADD) $(LIBS) + +remap_file_pages-Xraw$(EXEEXT): $(remap_file_pages_Xraw_OBJECTS) $(remap_file_pages_Xraw_DEPENDENCIES) $(EXTRA_remap_file_pages_Xraw_DEPENDENCIES) + @rm -f remap_file_pages-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(remap_file_pages_Xraw_OBJECTS) $(remap_file_pages_Xraw_LDADD) $(LIBS) + +remap_file_pages-Xverbose$(EXEEXT): $(remap_file_pages_Xverbose_OBJECTS) $(remap_file_pages_Xverbose_DEPENDENCIES) $(EXTRA_remap_file_pages_Xverbose_DEPENDENCIES) + @rm -f remap_file_pages-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(remap_file_pages_Xverbose_OBJECTS) $(remap_file_pages_Xverbose_LDADD) $(LIBS) + rename$(EXEEXT): $(rename_OBJECTS) $(rename_DEPENDENCIES) $(EXTRA_rename_DEPENDENCIES) @rm -f rename$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rename_OBJECTS) $(rename_LDADD) $(LIBS) @@ -3988,10 +6969,18 @@ restart_syscall$(EXEEXT): $(restart_syscall_OBJECTS) $(restart_syscall_DEPENDENC @rm -f restart_syscall$(EXEEXT) $(AM_V_CCLD)$(LINK) $(restart_syscall_OBJECTS) $(restart_syscall_LDADD) $(LIBS) +riscv_flush_icache$(EXEEXT): $(riscv_flush_icache_OBJECTS) $(riscv_flush_icache_DEPENDENCIES) $(EXTRA_riscv_flush_icache_DEPENDENCIES) + @rm -f riscv_flush_icache$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(riscv_flush_icache_OBJECTS) $(riscv_flush_icache_LDADD) $(LIBS) + rmdir$(EXEEXT): $(rmdir_OBJECTS) $(rmdir_DEPENDENCIES) $(EXTRA_rmdir_DEPENDENCIES) @rm -f rmdir$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rmdir_OBJECTS) $(rmdir_LDADD) $(LIBS) +rt_sigaction$(EXEEXT): $(rt_sigaction_OBJECTS) $(rt_sigaction_DEPENDENCIES) $(EXTRA_rt_sigaction_DEPENDENCIES) + @rm -f rt_sigaction$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_sigaction_OBJECTS) $(rt_sigaction_LDADD) $(LIBS) + rt_sigpending$(EXEEXT): $(rt_sigpending_OBJECTS) $(rt_sigpending_DEPENDENCIES) $(EXTRA_rt_sigpending_DEPENDENCIES) @rm -f rt_sigpending$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rt_sigpending_OBJECTS) $(rt_sigpending_LDADD) $(LIBS) @@ -4004,6 +6993,10 @@ rt_sigqueueinfo$(EXEEXT): $(rt_sigqueueinfo_OBJECTS) $(rt_sigqueueinfo_DEPENDENC @rm -f rt_sigqueueinfo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rt_sigqueueinfo_OBJECTS) $(rt_sigqueueinfo_LDADD) $(LIBS) +rt_sigreturn$(EXEEXT): $(rt_sigreturn_OBJECTS) $(rt_sigreturn_DEPENDENCIES) $(EXTRA_rt_sigreturn_DEPENDENCIES) + @rm -f rt_sigreturn$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(rt_sigreturn_OBJECTS) $(rt_sigreturn_LDADD) $(LIBS) + rt_sigsuspend$(EXEEXT): $(rt_sigsuspend_OBJECTS) $(rt_sigsuspend_DEPENDENCIES) $(EXTRA_rt_sigsuspend_DEPENDENCIES) @rm -f rt_sigsuspend$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rt_sigsuspend_OBJECTS) $(rt_sigsuspend_LDADD) $(LIBS) @@ -4016,6 +7009,34 @@ rt_tgsigqueueinfo$(EXEEXT): $(rt_tgsigqueueinfo_OBJECTS) $(rt_tgsigqueueinfo_DEP @rm -f rt_tgsigqueueinfo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(rt_tgsigqueueinfo_OBJECTS) $(rt_tgsigqueueinfo_LDADD) $(LIBS) +run_expect_termsig$(EXEEXT): $(run_expect_termsig_OBJECTS) $(run_expect_termsig_DEPENDENCIES) $(EXTRA_run_expect_termsig_DEPENDENCIES) + @rm -f run_expect_termsig$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(run_expect_termsig_OBJECTS) $(run_expect_termsig_LDADD) $(LIBS) + +s390_guarded_storage$(EXEEXT): $(s390_guarded_storage_OBJECTS) $(s390_guarded_storage_DEPENDENCIES) $(EXTRA_s390_guarded_storage_DEPENDENCIES) + @rm -f s390_guarded_storage$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(s390_guarded_storage_OBJECTS) $(s390_guarded_storage_LDADD) $(LIBS) + +s390_guarded_storage-v$(EXEEXT): $(s390_guarded_storage_v_OBJECTS) $(s390_guarded_storage_v_DEPENDENCIES) $(EXTRA_s390_guarded_storage_v_DEPENDENCIES) + @rm -f s390_guarded_storage-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(s390_guarded_storage_v_OBJECTS) $(s390_guarded_storage_v_LDADD) $(LIBS) + +s390_pci_mmio_read_write$(EXEEXT): $(s390_pci_mmio_read_write_OBJECTS) $(s390_pci_mmio_read_write_DEPENDENCIES) $(EXTRA_s390_pci_mmio_read_write_DEPENDENCIES) + @rm -f s390_pci_mmio_read_write$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(s390_pci_mmio_read_write_OBJECTS) $(s390_pci_mmio_read_write_LDADD) $(LIBS) + +s390_runtime_instr$(EXEEXT): $(s390_runtime_instr_OBJECTS) $(s390_runtime_instr_DEPENDENCIES) $(EXTRA_s390_runtime_instr_DEPENDENCIES) + @rm -f s390_runtime_instr$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(s390_runtime_instr_OBJECTS) $(s390_runtime_instr_LDADD) $(LIBS) + +s390_sthyi$(EXEEXT): $(s390_sthyi_OBJECTS) $(s390_sthyi_DEPENDENCIES) $(EXTRA_s390_sthyi_DEPENDENCIES) + @rm -f s390_sthyi$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(s390_sthyi_OBJECTS) $(s390_sthyi_LDADD) $(LIBS) + +s390_sthyi-v$(EXEEXT): $(s390_sthyi_v_OBJECTS) $(s390_sthyi_v_DEPENDENCIES) $(EXTRA_s390_sthyi_v_DEPENDENCIES) + @rm -f s390_sthyi-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(s390_sthyi_v_OBJECTS) $(s390_sthyi_v_LDADD) $(LIBS) + sched_get_priority_mxx$(EXEEXT): $(sched_get_priority_mxx_OBJECTS) $(sched_get_priority_mxx_DEPENDENCIES) $(EXTRA_sched_get_priority_mxx_DEPENDENCIES) @rm -f sched_get_priority_mxx$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sched_get_priority_mxx_OBJECTS) $(sched_get_priority_mxx_LDADD) $(LIBS) @@ -4060,10 +7081,18 @@ seccomp-strict$(EXEEXT): $(seccomp_strict_OBJECTS) $(seccomp_strict_DEPENDENCIES @rm -f seccomp-strict$(EXEEXT) $(AM_V_CCLD)$(LINK) $(seccomp_strict_OBJECTS) $(seccomp_strict_LDADD) $(LIBS) +seccomp_get_action_avail$(EXEEXT): $(seccomp_get_action_avail_OBJECTS) $(seccomp_get_action_avail_DEPENDENCIES) $(EXTRA_seccomp_get_action_avail_DEPENDENCIES) + @rm -f seccomp_get_action_avail$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(seccomp_get_action_avail_OBJECTS) $(seccomp_get_action_avail_LDADD) $(LIBS) + select$(EXEEXT): $(select_OBJECTS) $(select_DEPENDENCIES) $(EXTRA_select_DEPENDENCIES) @rm -f select$(EXEEXT) $(AM_V_CCLD)$(LINK) $(select_OBJECTS) $(select_LDADD) $(LIBS) +select-P$(EXEEXT): $(select_P_OBJECTS) $(select_P_DEPENDENCIES) $(EXTRA_select_P_DEPENDENCIES) + @rm -f select-P$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(select_P_OBJECTS) $(select_P_LDADD) $(LIBS) + semop$(EXEEXT): $(semop_OBJECTS) $(semop_DEPENDENCIES) $(EXTRA_semop_DEPENDENCIES) @rm -f semop$(EXEEXT) $(AM_V_CCLD)$(LINK) $(semop_OBJECTS) $(semop_LDADD) $(LIBS) @@ -4084,6 +7113,14 @@ set_ptracer_any$(EXEEXT): $(set_ptracer_any_OBJECTS) $(set_ptracer_any_DEPENDENC @rm -f set_ptracer_any$(EXEEXT) $(AM_V_CCLD)$(LINK) $(set_ptracer_any_OBJECTS) $(set_ptracer_any_LDADD) $(LIBS) +set_sigblock$(EXEEXT): $(set_sigblock_OBJECTS) $(set_sigblock_DEPENDENCIES) $(EXTRA_set_sigblock_DEPENDENCIES) + @rm -f set_sigblock$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(set_sigblock_OBJECTS) $(set_sigblock_LDADD) $(LIBS) + +set_sigign$(EXEEXT): $(set_sigign_OBJECTS) $(set_sigign_DEPENDENCIES) $(EXTRA_set_sigign_DEPENDENCIES) + @rm -f set_sigign$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(set_sigign_OBJECTS) $(set_sigign_LDADD) $(LIBS) + setdomainname$(EXEEXT): $(setdomainname_OBJECTS) $(setdomainname_DEPENDENCIES) $(EXTRA_setdomainname_DEPENDENCIES) @rm -f setdomainname$(EXEEXT) $(AM_V_CCLD)$(LINK) $(setdomainname_OBJECTS) $(setdomainname_LDADD) $(LIBS) @@ -4164,6 +7201,18 @@ setrlimit$(EXEEXT): $(setrlimit_OBJECTS) $(setrlimit_DEPENDENCIES) $(EXTRA_setrl @rm -f setrlimit$(EXEEXT) $(AM_V_CCLD)$(LINK) $(setrlimit_OBJECTS) $(setrlimit_LDADD) $(LIBS) +setrlimit-Xabbrev$(EXEEXT): $(setrlimit_Xabbrev_OBJECTS) $(setrlimit_Xabbrev_DEPENDENCIES) $(EXTRA_setrlimit_Xabbrev_DEPENDENCIES) + @rm -f setrlimit-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setrlimit_Xabbrev_OBJECTS) $(setrlimit_Xabbrev_LDADD) $(LIBS) + +setrlimit-Xraw$(EXEEXT): $(setrlimit_Xraw_OBJECTS) $(setrlimit_Xraw_DEPENDENCIES) $(EXTRA_setrlimit_Xraw_DEPENDENCIES) + @rm -f setrlimit-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setrlimit_Xraw_OBJECTS) $(setrlimit_Xraw_LDADD) $(LIBS) + +setrlimit-Xverbose$(EXEEXT): $(setrlimit_Xverbose_OBJECTS) $(setrlimit_Xverbose_DEPENDENCIES) $(EXTRA_setrlimit_Xverbose_DEPENDENCIES) + @rm -f setrlimit-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(setrlimit_Xverbose_OBJECTS) $(setrlimit_Xverbose_LDADD) $(LIBS) + setuid$(EXEEXT): $(setuid_OBJECTS) $(setuid_DEPENDENCIES) $(EXTRA_setuid_DEPENDENCIES) @rm -f setuid$(EXEEXT) $(AM_V_CCLD)$(LINK) $(setuid_OBJECTS) $(setuid_LDADD) $(LIBS) @@ -4192,6 +7241,10 @@ siginfo$(EXEEXT): $(siginfo_OBJECTS) $(siginfo_DEPENDENCIES) $(EXTRA_siginfo_DEP @rm -f siginfo$(EXEEXT) $(AM_V_CCLD)$(LINK) $(siginfo_OBJECTS) $(siginfo_LDADD) $(LIBS) +signal$(EXEEXT): $(signal_OBJECTS) $(signal_DEPENDENCIES) $(EXTRA_signal_DEPENDENCIES) + @rm -f signal$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(signal_OBJECTS) $(signal_LDADD) $(LIBS) + signal_receive$(EXEEXT): $(signal_receive_OBJECTS) $(signal_receive_DEPENDENCIES) $(EXTRA_signal_receive_DEPENDENCIES) @rm -f signal_receive$(EXEEXT) $(AM_V_CCLD)$(LINK) $(signal_receive_OBJECTS) $(signal_receive_LDADD) $(LIBS) @@ -4200,18 +7253,90 @@ signalfd4$(EXEEXT): $(signalfd4_OBJECTS) $(signalfd4_DEPENDENCIES) $(EXTRA_signa @rm -f signalfd4$(EXEEXT) $(AM_V_CCLD)$(LINK) $(signalfd4_OBJECTS) $(signalfd4_LDADD) $(LIBS) +sigpending$(EXEEXT): $(sigpending_OBJECTS) $(sigpending_DEPENDENCIES) $(EXTRA_sigpending_DEPENDENCIES) + @rm -f sigpending$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sigpending_OBJECTS) $(sigpending_LDADD) $(LIBS) + +sigprocmask$(EXEEXT): $(sigprocmask_OBJECTS) $(sigprocmask_DEPENDENCIES) $(EXTRA_sigprocmask_DEPENDENCIES) + @rm -f sigprocmask$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sigprocmask_OBJECTS) $(sigprocmask_LDADD) $(LIBS) + sigreturn$(EXEEXT): $(sigreturn_OBJECTS) $(sigreturn_DEPENDENCIES) $(EXTRA_sigreturn_DEPENDENCIES) @rm -f sigreturn$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sigreturn_OBJECTS) $(sigreturn_LDADD) $(LIBS) +sigsuspend$(EXEEXT): $(sigsuspend_OBJECTS) $(sigsuspend_DEPENDENCIES) $(EXTRA_sigsuspend_DEPENDENCIES) + @rm -f sigsuspend$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sigsuspend_OBJECTS) $(sigsuspend_LDADD) $(LIBS) + sleep$(EXEEXT): $(sleep_OBJECTS) $(sleep_DEPENDENCIES) $(EXTRA_sleep_DEPENDENCIES) @rm -f sleep$(EXEEXT) $(AM_V_CCLD)$(LINK) $(sleep_OBJECTS) $(sleep_LDADD) $(LIBS) +so_error$(EXEEXT): $(so_error_OBJECTS) $(so_error_DEPENDENCIES) $(EXTRA_so_error_DEPENDENCIES) + @rm -f so_error$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(so_error_OBJECTS) $(so_error_LDADD) $(LIBS) + +so_linger$(EXEEXT): $(so_linger_OBJECTS) $(so_linger_DEPENDENCIES) $(EXTRA_so_linger_DEPENDENCIES) + @rm -f so_linger$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(so_linger_OBJECTS) $(so_linger_LDADD) $(LIBS) + +so_peercred$(EXEEXT): $(so_peercred_OBJECTS) $(so_peercred_DEPENDENCIES) $(EXTRA_so_peercred_DEPENDENCIES) + @rm -f so_peercred$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(so_peercred_OBJECTS) $(so_peercred_LDADD) $(LIBS) + +so_peercred-Xabbrev$(EXEEXT): $(so_peercred_Xabbrev_OBJECTS) $(so_peercred_Xabbrev_DEPENDENCIES) $(EXTRA_so_peercred_Xabbrev_DEPENDENCIES) + @rm -f so_peercred-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(so_peercred_Xabbrev_OBJECTS) $(so_peercred_Xabbrev_LDADD) $(LIBS) + +so_peercred-Xraw$(EXEEXT): $(so_peercred_Xraw_OBJECTS) $(so_peercred_Xraw_DEPENDENCIES) $(EXTRA_so_peercred_Xraw_DEPENDENCIES) + @rm -f so_peercred-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(so_peercred_Xraw_OBJECTS) $(so_peercred_Xraw_LDADD) $(LIBS) + +so_peercred-Xverbose$(EXEEXT): $(so_peercred_Xverbose_OBJECTS) $(so_peercred_Xverbose_DEPENDENCIES) $(EXTRA_so_peercred_Xverbose_DEPENDENCIES) + @rm -f so_peercred-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(so_peercred_Xverbose_OBJECTS) $(so_peercred_Xverbose_LDADD) $(LIBS) + +sock_filter-v$(EXEEXT): $(sock_filter_v_OBJECTS) $(sock_filter_v_DEPENDENCIES) $(EXTRA_sock_filter_v_DEPENDENCIES) + @rm -f sock_filter-v$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sock_filter_v_OBJECTS) $(sock_filter_v_LDADD) $(LIBS) + +sock_filter-v-Xabbrev$(EXEEXT): $(sock_filter_v_Xabbrev_OBJECTS) $(sock_filter_v_Xabbrev_DEPENDENCIES) $(EXTRA_sock_filter_v_Xabbrev_DEPENDENCIES) + @rm -f sock_filter-v-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sock_filter_v_Xabbrev_OBJECTS) $(sock_filter_v_Xabbrev_LDADD) $(LIBS) + +sock_filter-v-Xraw$(EXEEXT): $(sock_filter_v_Xraw_OBJECTS) $(sock_filter_v_Xraw_DEPENDENCIES) $(EXTRA_sock_filter_v_Xraw_DEPENDENCIES) + @rm -f sock_filter-v-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sock_filter_v_Xraw_OBJECTS) $(sock_filter_v_Xraw_LDADD) $(LIBS) + +sock_filter-v-Xverbose$(EXEEXT): $(sock_filter_v_Xverbose_OBJECTS) $(sock_filter_v_Xverbose_DEPENDENCIES) $(EXTRA_sock_filter_v_Xverbose_DEPENDENCIES) + @rm -f sock_filter-v-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sock_filter_v_Xverbose_OBJECTS) $(sock_filter_v_Xverbose_LDADD) $(LIBS) + +sockaddr_xlat-Xabbrev$(EXEEXT): $(sockaddr_xlat_Xabbrev_OBJECTS) $(sockaddr_xlat_Xabbrev_DEPENDENCIES) $(EXTRA_sockaddr_xlat_Xabbrev_DEPENDENCIES) + @rm -f sockaddr_xlat-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sockaddr_xlat_Xabbrev_OBJECTS) $(sockaddr_xlat_Xabbrev_LDADD) $(LIBS) + +sockaddr_xlat-Xraw$(EXEEXT): $(sockaddr_xlat_Xraw_OBJECTS) $(sockaddr_xlat_Xraw_DEPENDENCIES) $(EXTRA_sockaddr_xlat_Xraw_DEPENDENCIES) + @rm -f sockaddr_xlat-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sockaddr_xlat_Xraw_OBJECTS) $(sockaddr_xlat_Xraw_LDADD) $(LIBS) + +sockaddr_xlat-Xverbose$(EXEEXT): $(sockaddr_xlat_Xverbose_OBJECTS) $(sockaddr_xlat_Xverbose_DEPENDENCIES) $(EXTRA_sockaddr_xlat_Xverbose_DEPENDENCIES) + @rm -f sockaddr_xlat-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sockaddr_xlat_Xverbose_OBJECTS) $(sockaddr_xlat_Xverbose_LDADD) $(LIBS) + socketcall$(EXEEXT): $(socketcall_OBJECTS) $(socketcall_DEPENDENCIES) $(EXTRA_socketcall_DEPENDENCIES) @rm -f socketcall$(EXEEXT) $(AM_V_CCLD)$(LINK) $(socketcall_OBJECTS) $(socketcall_LDADD) $(LIBS) +sockopt-sol_netlink$(EXEEXT): $(sockopt_sol_netlink_OBJECTS) $(sockopt_sol_netlink_DEPENDENCIES) $(EXTRA_sockopt_sol_netlink_DEPENDENCIES) + @rm -f sockopt-sol_netlink$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sockopt_sol_netlink_OBJECTS) $(sockopt_sol_netlink_LDADD) $(LIBS) + +sockopt-timestamp$(EXEEXT): $(sockopt_timestamp_OBJECTS) $(sockopt_timestamp_DEPENDENCIES) $(EXTRA_sockopt_timestamp_DEPENDENCIES) + @rm -f sockopt-timestamp$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sockopt_timestamp_OBJECTS) $(sockopt_timestamp_LDADD) $(LIBS) + splice$(EXEEXT): $(splice_OBJECTS) $(splice_DEPENDENCIES) $(EXTRA_splice_DEPENDENCIES) @rm -f splice$(EXEEXT) $(AM_V_CCLD)$(LINK) $(splice_OBJECTS) $(splice_LDADD) $(LIBS) @@ -4220,6 +7345,10 @@ stack-fcall$(EXEEXT): $(stack_fcall_OBJECTS) $(stack_fcall_DEPENDENCIES) $(EXTRA @rm -f stack-fcall$(EXEEXT) $(AM_V_CCLD)$(LINK) $(stack_fcall_OBJECTS) $(stack_fcall_LDADD) $(LIBS) +stack-fcall-mangled$(EXEEXT): $(stack_fcall_mangled_OBJECTS) $(stack_fcall_mangled_DEPENDENCIES) $(EXTRA_stack_fcall_mangled_DEPENDENCIES) + @rm -f stack-fcall-mangled$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(stack_fcall_mangled_OBJECTS) $(stack_fcall_mangled_LDADD) $(LIBS) + stat$(EXEEXT): $(stat_OBJECTS) $(stat_DEPENDENCIES) $(EXTRA_stat_DEPENDENCIES) @rm -f stat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(stat_OBJECTS) $(stat_LDADD) $(LIBS) @@ -4236,10 +7365,18 @@ statfs64$(EXEEXT): $(statfs64_OBJECTS) $(statfs64_DEPENDENCIES) $(EXTRA_statfs64 @rm -f statfs64$(EXEEXT) $(AM_V_CCLD)$(LINK) $(statfs64_OBJECTS) $(statfs64_LDADD) $(LIBS) +statx$(EXEEXT): $(statx_OBJECTS) $(statx_DEPENDENCIES) $(EXTRA_statx_DEPENDENCIES) + @rm -f statx$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(statx_OBJECTS) $(statx_LDADD) $(LIBS) + swap$(EXEEXT): $(swap_OBJECTS) $(swap_DEPENDENCIES) $(EXTRA_swap_DEPENDENCIES) @rm -f swap$(EXEEXT) $(AM_V_CCLD)$(LINK) $(swap_OBJECTS) $(swap_LDADD) $(LIBS) +sxetmask$(EXEEXT): $(sxetmask_OBJECTS) $(sxetmask_DEPENDENCIES) $(EXTRA_sxetmask_DEPENDENCIES) + @rm -f sxetmask$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(sxetmask_OBJECTS) $(sxetmask_LDADD) $(LIBS) + symlink$(EXEEXT): $(symlink_OBJECTS) $(symlink_DEPENDENCIES) $(EXTRA_symlink_DEPENDENCIES) @rm -f symlink$(EXEEXT) $(AM_V_CCLD)$(LINK) $(symlink_OBJECTS) $(symlink_LDADD) $(LIBS) @@ -4352,6 +7489,10 @@ uname$(EXEEXT): $(uname_OBJECTS) $(uname_DEPENDENCIES) $(EXTRA_uname_DEPENDENCIE @rm -f uname$(EXEEXT) $(AM_V_CCLD)$(LINK) $(uname_OBJECTS) $(uname_LDADD) $(LIBS) +unblock_reset_raise$(EXEEXT): $(unblock_reset_raise_OBJECTS) $(unblock_reset_raise_DEPENDENCIES) $(EXTRA_unblock_reset_raise_DEPENDENCIES) + @rm -f unblock_reset_raise$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(unblock_reset_raise_OBJECTS) $(unblock_reset_raise_LDADD) $(LIBS) + unix-pair-send-recv$(EXEEXT): $(unix_pair_send_recv_OBJECTS) $(unix_pair_send_recv_DEPENDENCIES) $(EXTRA_unix_pair_send_recv_DEPENDENCIES) @rm -f unix-pair-send-recv$(EXEEXT) $(AM_V_CCLD)$(LINK) $(unix_pair_send_recv_OBJECTS) $(unix_pair_send_recv_LDADD) $(LIBS) @@ -4388,6 +7529,18 @@ utimensat$(EXEEXT): $(utimensat_OBJECTS) $(utimensat_DEPENDENCIES) $(EXTRA_utime @rm -f utimensat$(EXEEXT) $(AM_V_CCLD)$(LINK) $(utimensat_OBJECTS) $(utimensat_LDADD) $(LIBS) +utimensat-Xabbrev$(EXEEXT): $(utimensat_Xabbrev_OBJECTS) $(utimensat_Xabbrev_DEPENDENCIES) $(EXTRA_utimensat_Xabbrev_DEPENDENCIES) + @rm -f utimensat-Xabbrev$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(utimensat_Xabbrev_OBJECTS) $(utimensat_Xabbrev_LDADD) $(LIBS) + +utimensat-Xraw$(EXEEXT): $(utimensat_Xraw_OBJECTS) $(utimensat_Xraw_DEPENDENCIES) $(EXTRA_utimensat_Xraw_DEPENDENCIES) + @rm -f utimensat-Xraw$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(utimensat_Xraw_OBJECTS) $(utimensat_Xraw_LDADD) $(LIBS) + +utimensat-Xverbose$(EXEEXT): $(utimensat_Xverbose_OBJECTS) $(utimensat_Xverbose_DEPENDENCIES) $(EXTRA_utimensat_Xverbose_DEPENDENCIES) + @rm -f utimensat-Xverbose$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(utimensat_Xverbose_OBJECTS) $(utimensat_Xverbose_LDADD) $(LIBS) + utimes$(EXEEXT): $(utimes_OBJECTS) $(utimes_DEPENDENCIES) $(EXTRA_utimes_DEPENDENCIES) @rm -f utimes$(EXEEXT) $(AM_V_CCLD)$(LINK) $(utimes_OBJECTS) $(utimes_LDADD) $(LIBS) @@ -4436,6 +7589,10 @@ xet_robust_list$(EXEEXT): $(xet_robust_list_OBJECTS) $(xet_robust_list_DEPENDENC @rm -f xet_robust_list$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xet_robust_list_OBJECTS) $(xet_robust_list_LDADD) $(LIBS) +xet_thread_area_x86$(EXEEXT): $(xet_thread_area_x86_OBJECTS) $(xet_thread_area_x86_DEPENDENCIES) $(EXTRA_xet_thread_area_x86_DEPENDENCIES) + @rm -f xet_thread_area_x86$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(xet_thread_area_x86_OBJECTS) $(xet_thread_area_x86_LDADD) $(LIBS) + xetitimer$(EXEEXT): $(xetitimer_OBJECTS) $(xetitimer_DEPENDENCIES) $(EXTRA_xetitimer_DEPENDENCIES) @rm -f xetitimer$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xetitimer_OBJECTS) $(xetitimer_LDADD) $(LIBS) @@ -4452,408 +7609,668 @@ xettimeofday$(EXEEXT): $(xettimeofday_OBJECTS) $(xettimeofday_DEPENDENCIES) $(EX @rm -f xettimeofday$(EXEEXT) $(AM_V_CCLD)$(LINK) $(xettimeofday_OBJECTS) $(xettimeofday_LDADD) $(LIBS) +zeroargc$(EXEEXT): $(zeroargc_OBJECTS) $(zeroargc_DEPENDENCIES) $(EXTRA_zeroargc_DEPENDENCIES) + @rm -f zeroargc$(EXEEXT) + $(AM_V_CCLD)$(LINK) $(zeroargc_OBJECTS) $(zeroargc_LDADD) $(LIBS) + mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_newselect.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept4.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/access.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acct.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_key.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adjtimex.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aio.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alarm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/answer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-f-p-cmd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-f-p.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-p-cmd-cmd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-p-cmd-p.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/brk.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/btrfs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caps-abbrev.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caps.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chmod.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chown.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chown32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chroot.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_adjtime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_nanosleep.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_xettime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/copy_file_range.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/count-f.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/delete_module.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup3.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_create.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_create1.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_ctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_pwait.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_wait.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/erestartsys.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eventfd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execve-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execve.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execveat-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execveat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/faccessat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fadvise64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fadvise64_64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fallocate.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_init.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchdir.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmod.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmodat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchown.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchown32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchownat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdatasync.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_handle.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_ioctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter-unavailable.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit_module.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fork-f.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat64-fstat64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatat64-fstatat64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatfs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatfs64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsync.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftruncate.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftruncate64-ftruncate64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/futex.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/futimesat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_mempolicy.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcpu.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcwd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdents.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdents64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getegid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getegid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geteuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geteuid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgroups.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgroups32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpeername.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpgrp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrandom.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresgid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresgid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresuid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrlimit.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrusage.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getsid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getsockname.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getuid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getxxid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet-cmsg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init_module.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inotify.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inotify_init1.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_block.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_dm-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_dm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop-nv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_mtd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_rtc-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_rtc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_scsi.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sg_io_v3.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sg_io_v4.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sock_gifconf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_uffdio.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_v4l2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioperm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iopl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioprio.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ip_mreq.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msgbuf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_sem.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_shm.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kcmp.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kexec_file_load.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kexec_load.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyctl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kill.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ksysent.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-errno2name.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-error_msg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-fill_memory.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-get_page_size.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-hexdump_strdup.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-hexquote_strndup.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-inode_of_sockfd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-libmmsg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-libsocketcall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-overflowuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-pipe_maxfd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-print_quoted_string.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-printflags.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-printxval.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-signal2name.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-sprintrc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-tail_alloc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-tprintf.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/link.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linkat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/llseek.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lookup_dcookie.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lseek.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat64-lstat64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbind.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/membarrier.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memfd_create.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/migrate_pages.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mincore.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdir.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdirat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mknod.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mknodat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlock.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlock2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlockall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap64-mmap64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg-silent.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg_name-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg_name.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_pages.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv-read.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv-write.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_control-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_control.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_name.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/munlockall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nanosleep.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-accept-connect.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-icmp_filter.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-sockaddr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-y-unix.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-inet.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-netlink.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-unix.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_inet_diag.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_netlink_diag.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_protocol.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_unix_diag.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/newfstatat-newfstatat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nsyscalls.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldfstat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldlstat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldselect.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldstat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pause.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open_nonverbose.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open_unabbrev.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/personality.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_alloc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_free.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_mprotect.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poll.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppoll.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-arg2-intptr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-dumpable.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-name.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-no-args.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-pdeathsig.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-seccomp-filter-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-seccomp-strict.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-securebits.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-tid_address.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-tsc.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv-preadv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv2-pwritev2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv_pwritev-preadv-pwritev.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print_maxfd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printstr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prlimit64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process_vm_readv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process_vm_writev.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pselect6.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptrace.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pwritev-pwritev.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_fault.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-error-signal.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-retval.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-signal.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_signal.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read-write.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readahead.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readdir.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlinkat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reboot.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvfrom.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvmmsg-timeout.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvmsg.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/redirect-fds.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remap_file_pages.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rename.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renameat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renameat2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/request_key.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/restart_syscall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rmdir.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigpending.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigprocmask.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigqueueinfo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigsuspend.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigtimedwait.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_tgsigqueueinfo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_get_priority_mxx.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_rr_get_interval.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetaffinity.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetattr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetparam.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetscheduler.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_yield.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scm_rights.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-filter-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-filter.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-strict.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/semop.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendfile.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendfile64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_mempolicy.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_ptracer_any.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setdomainname.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsgid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsgid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsuid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgroups.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgroups32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sethostname.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setns.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setregid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setregid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresgid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresgid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresuid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setreuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setreuid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setrlimit.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setuid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setuid32.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shmxt.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shutdown.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaction.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaltstack.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siginfo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal_receive.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signalfd4.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigreturn.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sleep.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socketcall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/splice.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-0.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-1.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-3.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat64-stat64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statfs-statfs.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statfs64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlink.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlinkat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync_file_range.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync_file_range2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysinfo.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syslog.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tee.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threads-execve.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer_create.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer_xettime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timerfd_xettime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/times-fail.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/times.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/truncate.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/truncate64-truncate64.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ugetrlimit.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uio-uio.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umask.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umount.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umount2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umoven-illptr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr-illptr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr2.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr3.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uname.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix-pair-send-recv.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix-pair-sendto-recvfrom.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlink.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlinkat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unshare.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/userfaultfd.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ustat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utime.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimensat.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimes.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfork-f.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vhangup.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmsplice.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait4-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait4.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitid-v.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitpid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xattr-strings.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xattr.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xet_robust_list.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetitimer.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetpgid.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetpriority.Po@am__quote@ -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xettimeofday.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_newselect-P.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/_newselect.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/accept4.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/access.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/acct.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_key.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/adjtimex.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aio_pgetevents.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/alarm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/answer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-f-p-cmd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-f-p.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-p-cmd-cmd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/attach-p-cmd-p.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/block_reset_raise_run.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf-obj_get_info_by_fd-prog-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf-obj_get_info_by_fd-prog.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf-obj_get_info_by_fd-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf-obj_get_info_by_fd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf-success-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf-success.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bpf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/brk.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/btrfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caps-abbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/caps.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_sigblock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_sigign.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chmod.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chown.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chown32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/chroot.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_adjtime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_nanosleep.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clock_xettime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clone_parent.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clone_ptrace.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/copy_file_range.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/count-f.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/creat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/delay.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/delete_module.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dev-yy.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dup3.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_create.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_create1.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_ctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_pwait.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epoll_wait.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/erestartsys.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/eventfd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execve-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execve.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execveat-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/execveat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/faccessat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fadvise64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fadvise64_64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fallocate.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_init.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fanotify_mark.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchdir.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmod.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchmodat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchown.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchown32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fchownat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fcntl64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fdatasync.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fflush.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_handle.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/file_ioctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filter-unavailable.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/finit_module.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/flock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fork-f.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat64-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat64-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat64-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstat64-fstat64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatat64-fstatat64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fstatfs64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsync-y.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fsync.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftruncate.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ftruncate64-ftruncate64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/futex.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/futimesat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/get_mempolicy.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcpu.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getcwd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdents.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getdents64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getegid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getegid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geteuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/geteuid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgroups.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getgroups32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpeername.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpgrp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getppid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrandom.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresgid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresgid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getresuid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrlimit.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getrusage.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getsid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getsockname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gettid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getuid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getxxid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/group_req.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inet-cmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/init_module.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inject-nf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inotify.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/inotify_init1.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/int_0x80.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io_uring_enter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io_uring_register.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/io_uring_setup.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_block.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_dm-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_dm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev-success-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev-success.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_evdev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_inotify.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_kvm_run-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_kvm_run.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_kvm_run_auxstr_vcpu.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop-nv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_loop.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_mtd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_nbd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_nsfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_perf-success.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_perf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_ptp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_random.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_rtc-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_rtc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_scsi.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sg_io_v3.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sg_io_v4.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_sock_gifconf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_uffdio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioctl_v4l2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioperm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/iopl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioprio-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioprio-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioprio-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ioprio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ip_mreq.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msg-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msg-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msg-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msgbuf-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msgbuf-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msgbuf-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_msgbuf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_sem-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_sem-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_sem-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_sem.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_shm-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_shm-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_shm-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ipc_shm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/is_linux_mips_n64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kcmp-y.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kcmp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kern_features.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kernel_version-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kernel_version-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kernel_version-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kernel_version.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kexec_file_load.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kexec_load.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyctl-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyctl-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyctl-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyctl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kill.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/kill_child.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ksysent.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lchown32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-create_nl_socket.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-errno2name.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-error_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-fill_memory.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-get_page_size.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-get_sigset_size.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-hexdump_strdup.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-hexquote_strndup.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-ifindex.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-inode_of_sockfd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-libmmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-libsocketcall.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-overflowuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-pipe_maxfd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-print_quoted_string.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-print_time.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-printflags.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-printxval.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-signal2name.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-skip_unavailable.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-sprintrc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-tail_alloc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-test_printpath.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-test_printstrn.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-test_ucopy.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libtests_a-tprintf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/link.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linkat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list_sigaction_signum.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/llseek.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localtime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lookup_dcookie.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/looping_threads.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lseek.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/lstat64-lstat64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/madvise.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mbind.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/membarrier.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memfd_create-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memfd_create-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memfd_create-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memfd_create.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/migrate_pages.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mincore.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdir.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mkdirat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mknod.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mknodat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlock2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mlockall.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap64-mmap64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg-silent.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg_name-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mmsg_name.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/modify_ldt.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mount.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_pages-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_pages-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_pages-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/move_pages.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv-read.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv-write.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mq_sendrecv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_control-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_control.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/msg_name.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/munlockall.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nanosleep.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-accept-connect.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-icmp_filter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-packet_mreq-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-packet_mreq-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-packet_mreq-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-packet_mreq.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-sockaddr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-tpacket_req.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-tpacket_stats-success.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-tpacket_stats.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-y-unix.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-inet.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-inet6.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-netlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/net-yy-unix.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_audit.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_crypto.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_generic.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_inet_diag.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_kobject_uevent.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_netfilter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_netlink_diag.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_protocol.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_route.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_selinux.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_sock_diag.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_unix_diag.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netlink_xfrm.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/newfstatat-newfstatat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_acct.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_cthelper.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_ctnetlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_ctnetlink_exp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_cttimeout.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_ipset.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_nft_compat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_nftables.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_osf.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_queue.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nfnetlink_ulog.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_br_port_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_crypto_user_alg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_dcbmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_fib_rule_hdr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifaddrlblmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifaddrmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifinfomsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifla_af_spec.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifla_brport.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifla_linkinfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifla_port.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ifla_xdp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_inet_diag_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_inet_diag_req_compat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_inet_diag_req_v2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_mdba_mdb_entry.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_mdba_router_port.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ndmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_ndtmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_netconfmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_netlink_diag_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_nlmsgerr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_packet_diag_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_rtgenmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_rtmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_smc_diag_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_tc_stats.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_tca_stab.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_tcamsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_tcmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nlattr_unix_diag_msg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nsyscalls-d.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/nsyscalls.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap-P.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap-v-none.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/old_mmap.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldfstat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldlstat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldselect-P.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldselect-efault-P.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldselect-efault.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldselect.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oldstat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/open.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/orphaned_process_group.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/osf_utimes.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pause.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open_nonverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/perf_event_open_unabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/personality-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/personality-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/personality-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/personality.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pidfd_send_signal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pipe2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_alloc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_free.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pkey_mprotect.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poll-P.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/poll.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppoll-P.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppoll-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppoll.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-arg2-intptr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-dumpable.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-name.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-no-args.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-pdeathsig.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-seccomp-filter-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-seccomp-strict.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-securebits.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-spec-inject.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-tid_address.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prctl-tsc.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv-preadv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv2-pwritev2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/preadv_pwritev-preadv-pwritev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print_maxfd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printpath-umovestr-peekdata.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printpath-umovestr-undumpable.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printpath-umovestr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printsignal-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printsignal-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printsignal-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printstr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printstrn-umoven-peekdata.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printstrn-umoven-undumpable.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printstrn-umoven.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/prlimit64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process_vm_readv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/process_vm_writev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pselect6.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptrace.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptrace_syscall_info.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pwritev-pwritev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_fault.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-error-signal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-retval.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_inject-signal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qual_signal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-success-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-success.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs-success-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs-success.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl-xfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/quotactl.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read-write.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readahead.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readdir.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readlinkat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/readv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/reboot.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvfrom.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvmmsg-timeout.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/recvmsg.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/redirect-fds.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remap_file_pages-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remap_file_pages-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remap_file_pages-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/remap_file_pages.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rename.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renameat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/renameat2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/request_key.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/restart_syscall.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/riscv_flush_icache.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rmdir.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigaction.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigpending.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigprocmask.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigqueueinfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigreturn.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigsuspend.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_sigtimedwait.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rt_tgsigqueueinfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run_expect_termsig.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s390_guarded_storage-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s390_guarded_storage.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s390_pci_mmio_read_write.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s390_runtime_instr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s390_sthyi-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s390_sthyi.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_get_priority_mxx.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_rr_get_interval.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetaffinity.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetattr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetparam.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_xetscheduler.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sched_yield.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scm_rights.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-filter-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-filter.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp-strict.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/seccomp_get_action_avail.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select-P.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/select.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/semop.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendfile.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sendfile64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_mempolicy.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_ptracer_any.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_sigblock.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set_sigign.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setdomainname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsgid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsgid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setfsuid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgroups.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setgroups32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sethostname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setns.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setregid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setregid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresgid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresgid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setresuid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setreuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setreuid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setrlimit-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setrlimit-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setrlimit-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setrlimit.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setuid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/setuid32.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shmxt.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shutdown.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaction.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigaltstack.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/siginfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signal_receive.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signalfd4.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigpending.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigprocmask.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigreturn.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sigsuspend.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sleep.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/so_error.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/so_linger.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/so_peercred-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/so_peercred-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/so_peercred-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/so_peercred.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sock_filter-v-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sock_filter-v-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sock_filter-v-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sock_filter-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockaddr_xlat-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockaddr_xlat-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockaddr_xlat-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/socketcall.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockopt-sol_netlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sockopt-timestamp.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/splice.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-0.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-1.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-3.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled-0.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled-1.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled-2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled-3.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall-mangled.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stack-fcall.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/stat64-stat64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statfs-statfs.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statfs64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/statx.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swap.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sxetmask.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/symlinkat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync_file_range.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sync_file_range2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sysinfo.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syslog.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tee.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threads-execve.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/time.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer_create.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timer_xettime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timerfd_xettime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/times-fail.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/times.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/truncate.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/truncate64-truncate64.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ugetrlimit.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uio-uio.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umask.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umount.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umount2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umoven-illptr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr-illptr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr2.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/umovestr3.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/uname.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unblock_reset_raise.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix-pair-send-recv.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unix-pair-sendto-recvfrom.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlink.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unlinkat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/unshare.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/userfaultfd.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ustat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utime.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimensat-Xabbrev.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimensat-Xraw.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimensat-Xverbose.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimensat.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/utimes.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vfork-f.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vhangup.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vmsplice.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait4-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wait4.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitid-v.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/waitpid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xattr-strings.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xattr.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xet_robust_list.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xet_thread_area_x86.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetitimer.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetpgid.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xetpriority.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xettimeofday.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/zeroargc.Po@am__quote@ # am--include-marker + +$(am__depfiles_remade): + @$(MKDIR_P) $(@D) + @echo '# dummy' >$@-t && $(am__mv) $@-t $@ + +am--depfiles: $(am__depfiles_remade) .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @@ -4869,6 +8286,20 @@ distclean-compile: @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` +libtests_a-create_nl_socket.o: create_nl_socket.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-create_nl_socket.o -MD -MP -MF $(DEPDIR)/libtests_a-create_nl_socket.Tpo -c -o libtests_a-create_nl_socket.o `test -f 'create_nl_socket.c' || echo '$(srcdir)/'`create_nl_socket.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-create_nl_socket.Tpo $(DEPDIR)/libtests_a-create_nl_socket.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='create_nl_socket.c' object='libtests_a-create_nl_socket.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-create_nl_socket.o `test -f 'create_nl_socket.c' || echo '$(srcdir)/'`create_nl_socket.c + +libtests_a-create_nl_socket.obj: create_nl_socket.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-create_nl_socket.obj -MD -MP -MF $(DEPDIR)/libtests_a-create_nl_socket.Tpo -c -o libtests_a-create_nl_socket.obj `if test -f 'create_nl_socket.c'; then $(CYGPATH_W) 'create_nl_socket.c'; else $(CYGPATH_W) '$(srcdir)/create_nl_socket.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-create_nl_socket.Tpo $(DEPDIR)/libtests_a-create_nl_socket.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='create_nl_socket.c' object='libtests_a-create_nl_socket.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-create_nl_socket.obj `if test -f 'create_nl_socket.c'; then $(CYGPATH_W) 'create_nl_socket.c'; else $(CYGPATH_W) '$(srcdir)/create_nl_socket.c'; fi` + libtests_a-errno2name.o: errno2name.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-errno2name.o -MD -MP -MF $(DEPDIR)/libtests_a-errno2name.Tpo -c -o libtests_a-errno2name.o `test -f 'errno2name.c' || echo '$(srcdir)/'`errno2name.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-errno2name.Tpo $(DEPDIR)/libtests_a-errno2name.Po @@ -4925,6 +8356,20 @@ libtests_a-get_page_size.obj: get_page_size.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-get_page_size.obj `if test -f 'get_page_size.c'; then $(CYGPATH_W) 'get_page_size.c'; else $(CYGPATH_W) '$(srcdir)/get_page_size.c'; fi` +libtests_a-get_sigset_size.o: get_sigset_size.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-get_sigset_size.o -MD -MP -MF $(DEPDIR)/libtests_a-get_sigset_size.Tpo -c -o libtests_a-get_sigset_size.o `test -f 'get_sigset_size.c' || echo '$(srcdir)/'`get_sigset_size.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-get_sigset_size.Tpo $(DEPDIR)/libtests_a-get_sigset_size.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='get_sigset_size.c' object='libtests_a-get_sigset_size.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-get_sigset_size.o `test -f 'get_sigset_size.c' || echo '$(srcdir)/'`get_sigset_size.c + +libtests_a-get_sigset_size.obj: get_sigset_size.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-get_sigset_size.obj -MD -MP -MF $(DEPDIR)/libtests_a-get_sigset_size.Tpo -c -o libtests_a-get_sigset_size.obj `if test -f 'get_sigset_size.c'; then $(CYGPATH_W) 'get_sigset_size.c'; else $(CYGPATH_W) '$(srcdir)/get_sigset_size.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-get_sigset_size.Tpo $(DEPDIR)/libtests_a-get_sigset_size.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='get_sigset_size.c' object='libtests_a-get_sigset_size.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-get_sigset_size.obj `if test -f 'get_sigset_size.c'; then $(CYGPATH_W) 'get_sigset_size.c'; else $(CYGPATH_W) '$(srcdir)/get_sigset_size.c'; fi` + libtests_a-hexdump_strdup.o: hexdump_strdup.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-hexdump_strdup.o -MD -MP -MF $(DEPDIR)/libtests_a-hexdump_strdup.Tpo -c -o libtests_a-hexdump_strdup.o `test -f 'hexdump_strdup.c' || echo '$(srcdir)/'`hexdump_strdup.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-hexdump_strdup.Tpo $(DEPDIR)/libtests_a-hexdump_strdup.Po @@ -4953,6 +8398,20 @@ libtests_a-hexquote_strndup.obj: hexquote_strndup.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-hexquote_strndup.obj `if test -f 'hexquote_strndup.c'; then $(CYGPATH_W) 'hexquote_strndup.c'; else $(CYGPATH_W) '$(srcdir)/hexquote_strndup.c'; fi` +libtests_a-ifindex.o: ifindex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-ifindex.o -MD -MP -MF $(DEPDIR)/libtests_a-ifindex.Tpo -c -o libtests_a-ifindex.o `test -f 'ifindex.c' || echo '$(srcdir)/'`ifindex.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-ifindex.Tpo $(DEPDIR)/libtests_a-ifindex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ifindex.c' object='libtests_a-ifindex.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-ifindex.o `test -f 'ifindex.c' || echo '$(srcdir)/'`ifindex.c + +libtests_a-ifindex.obj: ifindex.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-ifindex.obj -MD -MP -MF $(DEPDIR)/libtests_a-ifindex.Tpo -c -o libtests_a-ifindex.obj `if test -f 'ifindex.c'; then $(CYGPATH_W) 'ifindex.c'; else $(CYGPATH_W) '$(srcdir)/ifindex.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-ifindex.Tpo $(DEPDIR)/libtests_a-ifindex.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ifindex.c' object='libtests_a-ifindex.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-ifindex.obj `if test -f 'ifindex.c'; then $(CYGPATH_W) 'ifindex.c'; else $(CYGPATH_W) '$(srcdir)/ifindex.c'; fi` + libtests_a-inode_of_sockfd.o: inode_of_sockfd.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-inode_of_sockfd.o -MD -MP -MF $(DEPDIR)/libtests_a-inode_of_sockfd.Tpo -c -o libtests_a-inode_of_sockfd.o `test -f 'inode_of_sockfd.c' || echo '$(srcdir)/'`inode_of_sockfd.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-inode_of_sockfd.Tpo $(DEPDIR)/libtests_a-inode_of_sockfd.Po @@ -5037,6 +8496,20 @@ libtests_a-print_quoted_string.obj: print_quoted_string.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-print_quoted_string.obj `if test -f 'print_quoted_string.c'; then $(CYGPATH_W) 'print_quoted_string.c'; else $(CYGPATH_W) '$(srcdir)/print_quoted_string.c'; fi` +libtests_a-print_time.o: print_time.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-print_time.o -MD -MP -MF $(DEPDIR)/libtests_a-print_time.Tpo -c -o libtests_a-print_time.o `test -f 'print_time.c' || echo '$(srcdir)/'`print_time.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-print_time.Tpo $(DEPDIR)/libtests_a-print_time.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_time.c' object='libtests_a-print_time.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-print_time.o `test -f 'print_time.c' || echo '$(srcdir)/'`print_time.c + +libtests_a-print_time.obj: print_time.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-print_time.obj -MD -MP -MF $(DEPDIR)/libtests_a-print_time.Tpo -c -o libtests_a-print_time.obj `if test -f 'print_time.c'; then $(CYGPATH_W) 'print_time.c'; else $(CYGPATH_W) '$(srcdir)/print_time.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-print_time.Tpo $(DEPDIR)/libtests_a-print_time.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='print_time.c' object='libtests_a-print_time.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-print_time.obj `if test -f 'print_time.c'; then $(CYGPATH_W) 'print_time.c'; else $(CYGPATH_W) '$(srcdir)/print_time.c'; fi` + libtests_a-printflags.o: printflags.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-printflags.o -MD -MP -MF $(DEPDIR)/libtests_a-printflags.Tpo -c -o libtests_a-printflags.o `test -f 'printflags.c' || echo '$(srcdir)/'`printflags.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-printflags.Tpo $(DEPDIR)/libtests_a-printflags.Po @@ -5079,6 +8552,20 @@ libtests_a-signal2name.obj: signal2name.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-signal2name.obj `if test -f 'signal2name.c'; then $(CYGPATH_W) 'signal2name.c'; else $(CYGPATH_W) '$(srcdir)/signal2name.c'; fi` +libtests_a-skip_unavailable.o: skip_unavailable.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-skip_unavailable.o -MD -MP -MF $(DEPDIR)/libtests_a-skip_unavailable.Tpo -c -o libtests_a-skip_unavailable.o `test -f 'skip_unavailable.c' || echo '$(srcdir)/'`skip_unavailable.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-skip_unavailable.Tpo $(DEPDIR)/libtests_a-skip_unavailable.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='skip_unavailable.c' object='libtests_a-skip_unavailable.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-skip_unavailable.o `test -f 'skip_unavailable.c' || echo '$(srcdir)/'`skip_unavailable.c + +libtests_a-skip_unavailable.obj: skip_unavailable.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-skip_unavailable.obj -MD -MP -MF $(DEPDIR)/libtests_a-skip_unavailable.Tpo -c -o libtests_a-skip_unavailable.obj `if test -f 'skip_unavailable.c'; then $(CYGPATH_W) 'skip_unavailable.c'; else $(CYGPATH_W) '$(srcdir)/skip_unavailable.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-skip_unavailable.Tpo $(DEPDIR)/libtests_a-skip_unavailable.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='skip_unavailable.c' object='libtests_a-skip_unavailable.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-skip_unavailable.obj `if test -f 'skip_unavailable.c'; then $(CYGPATH_W) 'skip_unavailable.c'; else $(CYGPATH_W) '$(srcdir)/skip_unavailable.c'; fi` + libtests_a-sprintrc.o: sprintrc.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-sprintrc.o -MD -MP -MF $(DEPDIR)/libtests_a-sprintrc.Tpo -c -o libtests_a-sprintrc.o `test -f 'sprintrc.c' || echo '$(srcdir)/'`sprintrc.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-sprintrc.Tpo $(DEPDIR)/libtests_a-sprintrc.Po @@ -5107,6 +8594,48 @@ libtests_a-tail_alloc.obj: tail_alloc.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-tail_alloc.obj `if test -f 'tail_alloc.c'; then $(CYGPATH_W) 'tail_alloc.c'; else $(CYGPATH_W) '$(srcdir)/tail_alloc.c'; fi` +libtests_a-test_printpath.o: test_printpath.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-test_printpath.o -MD -MP -MF $(DEPDIR)/libtests_a-test_printpath.Tpo -c -o libtests_a-test_printpath.o `test -f 'test_printpath.c' || echo '$(srcdir)/'`test_printpath.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-test_printpath.Tpo $(DEPDIR)/libtests_a-test_printpath.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_printpath.c' object='libtests_a-test_printpath.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-test_printpath.o `test -f 'test_printpath.c' || echo '$(srcdir)/'`test_printpath.c + +libtests_a-test_printpath.obj: test_printpath.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-test_printpath.obj -MD -MP -MF $(DEPDIR)/libtests_a-test_printpath.Tpo -c -o libtests_a-test_printpath.obj `if test -f 'test_printpath.c'; then $(CYGPATH_W) 'test_printpath.c'; else $(CYGPATH_W) '$(srcdir)/test_printpath.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-test_printpath.Tpo $(DEPDIR)/libtests_a-test_printpath.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_printpath.c' object='libtests_a-test_printpath.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-test_printpath.obj `if test -f 'test_printpath.c'; then $(CYGPATH_W) 'test_printpath.c'; else $(CYGPATH_W) '$(srcdir)/test_printpath.c'; fi` + +libtests_a-test_printstrn.o: test_printstrn.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-test_printstrn.o -MD -MP -MF $(DEPDIR)/libtests_a-test_printstrn.Tpo -c -o libtests_a-test_printstrn.o `test -f 'test_printstrn.c' || echo '$(srcdir)/'`test_printstrn.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-test_printstrn.Tpo $(DEPDIR)/libtests_a-test_printstrn.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_printstrn.c' object='libtests_a-test_printstrn.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-test_printstrn.o `test -f 'test_printstrn.c' || echo '$(srcdir)/'`test_printstrn.c + +libtests_a-test_printstrn.obj: test_printstrn.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-test_printstrn.obj -MD -MP -MF $(DEPDIR)/libtests_a-test_printstrn.Tpo -c -o libtests_a-test_printstrn.obj `if test -f 'test_printstrn.c'; then $(CYGPATH_W) 'test_printstrn.c'; else $(CYGPATH_W) '$(srcdir)/test_printstrn.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-test_printstrn.Tpo $(DEPDIR)/libtests_a-test_printstrn.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_printstrn.c' object='libtests_a-test_printstrn.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-test_printstrn.obj `if test -f 'test_printstrn.c'; then $(CYGPATH_W) 'test_printstrn.c'; else $(CYGPATH_W) '$(srcdir)/test_printstrn.c'; fi` + +libtests_a-test_ucopy.o: test_ucopy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-test_ucopy.o -MD -MP -MF $(DEPDIR)/libtests_a-test_ucopy.Tpo -c -o libtests_a-test_ucopy.o `test -f 'test_ucopy.c' || echo '$(srcdir)/'`test_ucopy.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-test_ucopy.Tpo $(DEPDIR)/libtests_a-test_ucopy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_ucopy.c' object='libtests_a-test_ucopy.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-test_ucopy.o `test -f 'test_ucopy.c' || echo '$(srcdir)/'`test_ucopy.c + +libtests_a-test_ucopy.obj: test_ucopy.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-test_ucopy.obj -MD -MP -MF $(DEPDIR)/libtests_a-test_ucopy.Tpo -c -o libtests_a-test_ucopy.obj `if test -f 'test_ucopy.c'; then $(CYGPATH_W) 'test_ucopy.c'; else $(CYGPATH_W) '$(srcdir)/test_ucopy.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-test_ucopy.Tpo $(DEPDIR)/libtests_a-test_ucopy.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_ucopy.c' object='libtests_a-test_ucopy.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libtests_a-test_ucopy.obj `if test -f 'test_ucopy.c'; then $(CYGPATH_W) 'test_ucopy.c'; else $(CYGPATH_W) '$(srcdir)/test_ucopy.c'; fi` + libtests_a-tprintf.o: tprintf.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libtests_a_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libtests_a-tprintf.o -MD -MP -MF $(DEPDIR)/libtests_a-tprintf.Tpo -c -o libtests_a-tprintf.o `test -f 'tprintf.c' || echo '$(srcdir)/'`tprintf.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/libtests_a-tprintf.Tpo $(DEPDIR)/libtests_a-tprintf.Po @@ -5191,6 +8720,48 @@ mmap64-mmap64.obj: mmap64.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64-mmap64.obj `if test -f 'mmap64.c'; then $(CYGPATH_W) 'mmap64.c'; else $(CYGPATH_W) '$(srcdir)/mmap64.c'; fi` +mmap64_Xabbrev-mmap64-Xabbrev.o: mmap64-Xabbrev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xabbrev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64_Xabbrev-mmap64-Xabbrev.o -MD -MP -MF $(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Tpo -c -o mmap64_Xabbrev-mmap64-Xabbrev.o `test -f 'mmap64-Xabbrev.c' || echo '$(srcdir)/'`mmap64-Xabbrev.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Tpo $(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64-Xabbrev.c' object='mmap64_Xabbrev-mmap64-Xabbrev.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xabbrev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64_Xabbrev-mmap64-Xabbrev.o `test -f 'mmap64-Xabbrev.c' || echo '$(srcdir)/'`mmap64-Xabbrev.c + +mmap64_Xabbrev-mmap64-Xabbrev.obj: mmap64-Xabbrev.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xabbrev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64_Xabbrev-mmap64-Xabbrev.obj -MD -MP -MF $(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Tpo -c -o mmap64_Xabbrev-mmap64-Xabbrev.obj `if test -f 'mmap64-Xabbrev.c'; then $(CYGPATH_W) 'mmap64-Xabbrev.c'; else $(CYGPATH_W) '$(srcdir)/mmap64-Xabbrev.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Tpo $(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64-Xabbrev.c' object='mmap64_Xabbrev-mmap64-Xabbrev.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xabbrev_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64_Xabbrev-mmap64-Xabbrev.obj `if test -f 'mmap64-Xabbrev.c'; then $(CYGPATH_W) 'mmap64-Xabbrev.c'; else $(CYGPATH_W) '$(srcdir)/mmap64-Xabbrev.c'; fi` + +mmap64_Xraw-mmap64-Xraw.o: mmap64-Xraw.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xraw_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64_Xraw-mmap64-Xraw.o -MD -MP -MF $(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Tpo -c -o mmap64_Xraw-mmap64-Xraw.o `test -f 'mmap64-Xraw.c' || echo '$(srcdir)/'`mmap64-Xraw.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Tpo $(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64-Xraw.c' object='mmap64_Xraw-mmap64-Xraw.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xraw_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64_Xraw-mmap64-Xraw.o `test -f 'mmap64-Xraw.c' || echo '$(srcdir)/'`mmap64-Xraw.c + +mmap64_Xraw-mmap64-Xraw.obj: mmap64-Xraw.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xraw_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64_Xraw-mmap64-Xraw.obj -MD -MP -MF $(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Tpo -c -o mmap64_Xraw-mmap64-Xraw.obj `if test -f 'mmap64-Xraw.c'; then $(CYGPATH_W) 'mmap64-Xraw.c'; else $(CYGPATH_W) '$(srcdir)/mmap64-Xraw.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Tpo $(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64-Xraw.c' object='mmap64_Xraw-mmap64-Xraw.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xraw_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64_Xraw-mmap64-Xraw.obj `if test -f 'mmap64-Xraw.c'; then $(CYGPATH_W) 'mmap64-Xraw.c'; else $(CYGPATH_W) '$(srcdir)/mmap64-Xraw.c'; fi` + +mmap64_Xverbose-mmap64-Xverbose.o: mmap64-Xverbose.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xverbose_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64_Xverbose-mmap64-Xverbose.o -MD -MP -MF $(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Tpo -c -o mmap64_Xverbose-mmap64-Xverbose.o `test -f 'mmap64-Xverbose.c' || echo '$(srcdir)/'`mmap64-Xverbose.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Tpo $(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64-Xverbose.c' object='mmap64_Xverbose-mmap64-Xverbose.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xverbose_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64_Xverbose-mmap64-Xverbose.o `test -f 'mmap64-Xverbose.c' || echo '$(srcdir)/'`mmap64-Xverbose.c + +mmap64_Xverbose-mmap64-Xverbose.obj: mmap64-Xverbose.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xverbose_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT mmap64_Xverbose-mmap64-Xverbose.obj -MD -MP -MF $(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Tpo -c -o mmap64_Xverbose-mmap64-Xverbose.obj `if test -f 'mmap64-Xverbose.c'; then $(CYGPATH_W) 'mmap64-Xverbose.c'; else $(CYGPATH_W) '$(srcdir)/mmap64-Xverbose.c'; fi` +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Tpo $(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='mmap64-Xverbose.c' object='mmap64_Xverbose-mmap64-Xverbose.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(mmap64_Xverbose_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o mmap64_Xverbose-mmap64-Xverbose.obj `if test -f 'mmap64-Xverbose.c'; then $(CYGPATH_W) 'mmap64-Xverbose.c'; else $(CYGPATH_W) '$(srcdir)/mmap64-Xverbose.c'; fi` + newfstatat-newfstatat.o: newfstatat.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(newfstatat_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT newfstatat-newfstatat.o -MD -MP -MF $(DEPDIR)/newfstatat-newfstatat.Tpo -c -o newfstatat-newfstatat.o `test -f 'newfstatat.c' || echo '$(srcdir)/'`newfstatat.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/newfstatat-newfstatat.Tpo $(DEPDIR)/newfstatat-newfstatat.Po @@ -5317,6 +8888,10 @@ uio-uio.obj: uio.c @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(uio_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o uio-uio.obj `if test -f 'uio.c'; then $(CYGPATH_W) 'uio.c'; else $(CYGPATH_W) '$(srcdir)/uio.c'; fi` check-valgrind-local: +check-valgrind-memcheck-local: +check-valgrind-helgrind-local: +check-valgrind-drd-local: +check-valgrind-sgcheck-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique @@ -5400,7 +8975,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ - else \ + elif test -n "$$redo_logs"; then \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ @@ -5490,7 +9065,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS) fi; \ $$success || exit 1 -check-TESTS: +check-TESTS: $(check_PROGRAMS) $(check_LIBRARIES) @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @@ -5500,7 +9075,7 @@ check-TESTS: log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; -recheck: all $(check_LIBRARIES) $(check_PROGRAMS) +recheck: all $(check_PROGRAMS) $(check_LIBRARIES) @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ @@ -5526,7 +9101,10 @@ recheck: all $(check_LIBRARIES) $(check_PROGRAMS) @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) -distdir: $(DISTFILES) +distdir: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) distdir-am + +distdir-am: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ @@ -5557,12 +9135,14 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am - $(MAKE) $(AM_MAKEFLAGS) $(check_LIBRARIES) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(check_LIBRARIES) $(MAKE) $(AM_MAKEFLAGS) check-TESTS -check: check-am +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile installdirs: -install: install-am +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am @@ -5596,17 +9176,679 @@ distclean-generic: maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) check-valgrind: check-valgrind-am check-valgrind-am: check-valgrind-local +check-valgrind-drd: check-valgrind-drd-am + +check-valgrind-drd-am: check-valgrind-drd-local + +check-valgrind-helgrind: check-valgrind-helgrind-am + +check-valgrind-helgrind-am: check-valgrind-helgrind-local + +check-valgrind-memcheck: check-valgrind-memcheck-am + +check-valgrind-memcheck-am: check-valgrind-memcheck-local + +check-valgrind-sgcheck: check-valgrind-sgcheck-am + +check-valgrind-sgcheck-am: check-valgrind-sgcheck-local + clean: clean-am clean-am: clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \ - mostlyclean-am + clean-local mostlyclean-am distclean: distclean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/_newselect-P.Po + -rm -f ./$(DEPDIR)/_newselect.Po + -rm -f ./$(DEPDIR)/accept.Po + -rm -f ./$(DEPDIR)/accept4.Po + -rm -f ./$(DEPDIR)/access.Po + -rm -f ./$(DEPDIR)/acct.Po + -rm -f ./$(DEPDIR)/add_key.Po + -rm -f ./$(DEPDIR)/adjtimex.Po + -rm -f ./$(DEPDIR)/aio.Po + -rm -f ./$(DEPDIR)/aio_pgetevents.Po + -rm -f ./$(DEPDIR)/alarm.Po + -rm -f ./$(DEPDIR)/answer.Po + -rm -f ./$(DEPDIR)/attach-f-p-cmd.Po + -rm -f ./$(DEPDIR)/attach-f-p.Po + -rm -f ./$(DEPDIR)/attach-p-cmd-cmd.Po + -rm -f ./$(DEPDIR)/attach-p-cmd-p.Po + -rm -f ./$(DEPDIR)/block_reset_raise_run.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd-prog-v.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd-prog.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd-v.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd.Po + -rm -f ./$(DEPDIR)/bpf-success-v.Po + -rm -f ./$(DEPDIR)/bpf-success.Po + -rm -f ./$(DEPDIR)/bpf-v.Po + -rm -f ./$(DEPDIR)/bpf.Po + -rm -f ./$(DEPDIR)/brk.Po + -rm -f ./$(DEPDIR)/btrfs.Po + -rm -f ./$(DEPDIR)/caps-abbrev.Po + -rm -f ./$(DEPDIR)/caps.Po + -rm -f ./$(DEPDIR)/check_sigblock.Po + -rm -f ./$(DEPDIR)/check_sigign.Po + -rm -f ./$(DEPDIR)/chmod.Po + -rm -f ./$(DEPDIR)/chown.Po + -rm -f ./$(DEPDIR)/chown32.Po + -rm -f ./$(DEPDIR)/chroot.Po + -rm -f ./$(DEPDIR)/clock_adjtime.Po + -rm -f ./$(DEPDIR)/clock_nanosleep.Po + -rm -f ./$(DEPDIR)/clock_xettime.Po + -rm -f ./$(DEPDIR)/clone_parent.Po + -rm -f ./$(DEPDIR)/clone_ptrace.Po + -rm -f ./$(DEPDIR)/copy_file_range.Po + -rm -f ./$(DEPDIR)/count-f.Po + -rm -f ./$(DEPDIR)/creat.Po + -rm -f ./$(DEPDIR)/delay.Po + -rm -f ./$(DEPDIR)/delete_module.Po + -rm -f ./$(DEPDIR)/dev-yy.Po + -rm -f ./$(DEPDIR)/dup.Po + -rm -f ./$(DEPDIR)/dup2.Po + -rm -f ./$(DEPDIR)/dup3.Po + -rm -f ./$(DEPDIR)/epoll_create.Po + -rm -f ./$(DEPDIR)/epoll_create1.Po + -rm -f ./$(DEPDIR)/epoll_ctl.Po + -rm -f ./$(DEPDIR)/epoll_pwait.Po + -rm -f ./$(DEPDIR)/epoll_wait.Po + -rm -f ./$(DEPDIR)/erestartsys.Po + -rm -f ./$(DEPDIR)/eventfd.Po + -rm -f ./$(DEPDIR)/execve-v.Po + -rm -f ./$(DEPDIR)/execve.Po + -rm -f ./$(DEPDIR)/execveat-v.Po + -rm -f ./$(DEPDIR)/execveat.Po + -rm -f ./$(DEPDIR)/faccessat.Po + -rm -f ./$(DEPDIR)/fadvise64.Po + -rm -f ./$(DEPDIR)/fadvise64_64.Po + -rm -f ./$(DEPDIR)/fallocate.Po + -rm -f ./$(DEPDIR)/fanotify_init.Po + -rm -f ./$(DEPDIR)/fanotify_mark-Xabbrev.Po + -rm -f ./$(DEPDIR)/fanotify_mark-Xraw.Po + -rm -f ./$(DEPDIR)/fanotify_mark-Xverbose.Po + -rm -f ./$(DEPDIR)/fanotify_mark.Po + -rm -f ./$(DEPDIR)/fchdir.Po + -rm -f ./$(DEPDIR)/fchmod.Po + -rm -f ./$(DEPDIR)/fchmodat.Po + -rm -f ./$(DEPDIR)/fchown.Po + -rm -f ./$(DEPDIR)/fchown32.Po + -rm -f ./$(DEPDIR)/fchownat.Po + -rm -f ./$(DEPDIR)/fcntl.Po + -rm -f ./$(DEPDIR)/fcntl64.Po + -rm -f ./$(DEPDIR)/fdatasync.Po + -rm -f ./$(DEPDIR)/fflush.Po + -rm -f ./$(DEPDIR)/file_handle.Po + -rm -f ./$(DEPDIR)/file_ioctl.Po + -rm -f ./$(DEPDIR)/filter-unavailable.Po + -rm -f ./$(DEPDIR)/finit_module.Po + -rm -f ./$(DEPDIR)/flock.Po + -rm -f ./$(DEPDIR)/fork-f.Po + -rm -f ./$(DEPDIR)/fstat-Xabbrev.Po + -rm -f ./$(DEPDIR)/fstat-Xraw.Po + -rm -f ./$(DEPDIR)/fstat-Xverbose.Po + -rm -f ./$(DEPDIR)/fstat.Po + -rm -f ./$(DEPDIR)/fstat64-Xabbrev.Po + -rm -f ./$(DEPDIR)/fstat64-Xraw.Po + -rm -f ./$(DEPDIR)/fstat64-Xverbose.Po + -rm -f ./$(DEPDIR)/fstat64-fstat64.Po + -rm -f ./$(DEPDIR)/fstatat64-fstatat64.Po + -rm -f ./$(DEPDIR)/fstatfs.Po + -rm -f ./$(DEPDIR)/fstatfs64.Po + -rm -f ./$(DEPDIR)/fsync-y.Po + -rm -f ./$(DEPDIR)/fsync.Po + -rm -f ./$(DEPDIR)/ftruncate.Po + -rm -f ./$(DEPDIR)/ftruncate64-ftruncate64.Po + -rm -f ./$(DEPDIR)/futex.Po + -rm -f ./$(DEPDIR)/futimesat.Po + -rm -f ./$(DEPDIR)/get_mempolicy.Po + -rm -f ./$(DEPDIR)/getcpu.Po + -rm -f ./$(DEPDIR)/getcwd.Po + -rm -f ./$(DEPDIR)/getdents.Po + -rm -f ./$(DEPDIR)/getdents64.Po + -rm -f ./$(DEPDIR)/getegid.Po + -rm -f ./$(DEPDIR)/getegid32.Po + -rm -f ./$(DEPDIR)/geteuid.Po + -rm -f ./$(DEPDIR)/geteuid32.Po + -rm -f ./$(DEPDIR)/getgid.Po + -rm -f ./$(DEPDIR)/getgid32.Po + -rm -f ./$(DEPDIR)/getgroups.Po + -rm -f ./$(DEPDIR)/getgroups32.Po + -rm -f ./$(DEPDIR)/getpeername.Po + -rm -f ./$(DEPDIR)/getpgrp.Po + -rm -f ./$(DEPDIR)/getpid.Po + -rm -f ./$(DEPDIR)/getppid.Po + -rm -f ./$(DEPDIR)/getrandom.Po + -rm -f ./$(DEPDIR)/getresgid.Po + -rm -f ./$(DEPDIR)/getresgid32.Po + -rm -f ./$(DEPDIR)/getresuid.Po + -rm -f ./$(DEPDIR)/getresuid32.Po + -rm -f ./$(DEPDIR)/getrlimit.Po + -rm -f ./$(DEPDIR)/getrusage.Po + -rm -f ./$(DEPDIR)/getsid.Po + -rm -f ./$(DEPDIR)/getsockname.Po + -rm -f ./$(DEPDIR)/gettid.Po + -rm -f ./$(DEPDIR)/getuid.Po + -rm -f ./$(DEPDIR)/getuid32.Po + -rm -f ./$(DEPDIR)/getxxid.Po + -rm -f ./$(DEPDIR)/group_req.Po + -rm -f ./$(DEPDIR)/inet-cmsg.Po + -rm -f ./$(DEPDIR)/init_module.Po + -rm -f ./$(DEPDIR)/inject-nf.Po + -rm -f ./$(DEPDIR)/inotify.Po + -rm -f ./$(DEPDIR)/inotify_init1.Po + -rm -f ./$(DEPDIR)/int_0x80.Po + -rm -f ./$(DEPDIR)/io_uring_enter.Po + -rm -f ./$(DEPDIR)/io_uring_register.Po + -rm -f ./$(DEPDIR)/io_uring_setup.Po + -rm -f ./$(DEPDIR)/ioctl.Po + -rm -f ./$(DEPDIR)/ioctl_block.Po + -rm -f ./$(DEPDIR)/ioctl_dm-v.Po + -rm -f ./$(DEPDIR)/ioctl_dm.Po + -rm -f ./$(DEPDIR)/ioctl_evdev-success-v.Po + -rm -f ./$(DEPDIR)/ioctl_evdev-success.Po + -rm -f ./$(DEPDIR)/ioctl_evdev-v.Po + -rm -f ./$(DEPDIR)/ioctl_evdev.Po + -rm -f ./$(DEPDIR)/ioctl_inotify.Po + -rm -f ./$(DEPDIR)/ioctl_kvm_run-v.Po + -rm -f ./$(DEPDIR)/ioctl_kvm_run.Po + -rm -f ./$(DEPDIR)/ioctl_kvm_run_auxstr_vcpu.Po + -rm -f ./$(DEPDIR)/ioctl_loop-nv.Po + -rm -f ./$(DEPDIR)/ioctl_loop-v.Po + -rm -f ./$(DEPDIR)/ioctl_loop.Po + -rm -f ./$(DEPDIR)/ioctl_mtd.Po + -rm -f ./$(DEPDIR)/ioctl_nbd.Po + -rm -f ./$(DEPDIR)/ioctl_nsfs.Po + -rm -f ./$(DEPDIR)/ioctl_perf-success.Po + -rm -f ./$(DEPDIR)/ioctl_perf.Po + -rm -f ./$(DEPDIR)/ioctl_ptp.Po + -rm -f ./$(DEPDIR)/ioctl_random.Po + -rm -f ./$(DEPDIR)/ioctl_rtc-v.Po + -rm -f ./$(DEPDIR)/ioctl_rtc.Po + -rm -f ./$(DEPDIR)/ioctl_scsi.Po + -rm -f ./$(DEPDIR)/ioctl_sg_io_v3.Po + -rm -f ./$(DEPDIR)/ioctl_sg_io_v4.Po + -rm -f ./$(DEPDIR)/ioctl_sock_gifconf.Po + -rm -f ./$(DEPDIR)/ioctl_uffdio.Po + -rm -f ./$(DEPDIR)/ioctl_v4l2.Po + -rm -f ./$(DEPDIR)/ioperm.Po + -rm -f ./$(DEPDIR)/iopl.Po + -rm -f ./$(DEPDIR)/ioprio-Xabbrev.Po + -rm -f ./$(DEPDIR)/ioprio-Xraw.Po + -rm -f ./$(DEPDIR)/ioprio-Xverbose.Po + -rm -f ./$(DEPDIR)/ioprio.Po + -rm -f ./$(DEPDIR)/ip_mreq.Po + -rm -f ./$(DEPDIR)/ipc.Po + -rm -f ./$(DEPDIR)/ipc_msg-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_msg-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_msg-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_msg.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf.Po + -rm -f ./$(DEPDIR)/ipc_sem-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_sem-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_sem-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_sem.Po + -rm -f ./$(DEPDIR)/ipc_shm-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_shm-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_shm-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_shm.Po + -rm -f ./$(DEPDIR)/is_linux_mips_n64.Po + -rm -f ./$(DEPDIR)/kcmp-y.Po + -rm -f ./$(DEPDIR)/kcmp.Po + -rm -f ./$(DEPDIR)/kern_features.Po + -rm -f ./$(DEPDIR)/kernel_version-Xabbrev.Po + -rm -f ./$(DEPDIR)/kernel_version-Xraw.Po + -rm -f ./$(DEPDIR)/kernel_version-Xverbose.Po + -rm -f ./$(DEPDIR)/kernel_version.Po + -rm -f ./$(DEPDIR)/kexec_file_load.Po + -rm -f ./$(DEPDIR)/kexec_load.Po + -rm -f ./$(DEPDIR)/keyctl-Xabbrev.Po + -rm -f ./$(DEPDIR)/keyctl-Xraw.Po + -rm -f ./$(DEPDIR)/keyctl-Xverbose.Po + -rm -f ./$(DEPDIR)/keyctl.Po + -rm -f ./$(DEPDIR)/kill.Po + -rm -f ./$(DEPDIR)/kill_child.Po + -rm -f ./$(DEPDIR)/ksysent.Po + -rm -f ./$(DEPDIR)/lchown.Po + -rm -f ./$(DEPDIR)/lchown32.Po + -rm -f ./$(DEPDIR)/libtests_a-create_nl_socket.Po + -rm -f ./$(DEPDIR)/libtests_a-errno2name.Po + -rm -f ./$(DEPDIR)/libtests_a-error_msg.Po + -rm -f ./$(DEPDIR)/libtests_a-fill_memory.Po + -rm -f ./$(DEPDIR)/libtests_a-get_page_size.Po + -rm -f ./$(DEPDIR)/libtests_a-get_sigset_size.Po + -rm -f ./$(DEPDIR)/libtests_a-hexdump_strdup.Po + -rm -f ./$(DEPDIR)/libtests_a-hexquote_strndup.Po + -rm -f ./$(DEPDIR)/libtests_a-ifindex.Po + -rm -f ./$(DEPDIR)/libtests_a-inode_of_sockfd.Po + -rm -f ./$(DEPDIR)/libtests_a-libmmsg.Po + -rm -f ./$(DEPDIR)/libtests_a-libsocketcall.Po + -rm -f ./$(DEPDIR)/libtests_a-overflowuid.Po + -rm -f ./$(DEPDIR)/libtests_a-pipe_maxfd.Po + -rm -f ./$(DEPDIR)/libtests_a-print_quoted_string.Po + -rm -f ./$(DEPDIR)/libtests_a-print_time.Po + -rm -f ./$(DEPDIR)/libtests_a-printflags.Po + -rm -f ./$(DEPDIR)/libtests_a-printxval.Po + -rm -f ./$(DEPDIR)/libtests_a-signal2name.Po + -rm -f ./$(DEPDIR)/libtests_a-skip_unavailable.Po + -rm -f ./$(DEPDIR)/libtests_a-sprintrc.Po + -rm -f ./$(DEPDIR)/libtests_a-tail_alloc.Po + -rm -f ./$(DEPDIR)/libtests_a-test_printpath.Po + -rm -f ./$(DEPDIR)/libtests_a-test_printstrn.Po + -rm -f ./$(DEPDIR)/libtests_a-test_ucopy.Po + -rm -f ./$(DEPDIR)/libtests_a-tprintf.Po + -rm -f ./$(DEPDIR)/link.Po + -rm -f ./$(DEPDIR)/linkat.Po + -rm -f ./$(DEPDIR)/list_sigaction_signum.Po + -rm -f ./$(DEPDIR)/llseek.Po + -rm -f ./$(DEPDIR)/localtime.Po + -rm -f ./$(DEPDIR)/lookup_dcookie.Po + -rm -f ./$(DEPDIR)/looping_threads.Po + -rm -f ./$(DEPDIR)/lseek.Po + -rm -f ./$(DEPDIR)/lstat.Po + -rm -f ./$(DEPDIR)/lstat64-lstat64.Po + -rm -f ./$(DEPDIR)/madvise.Po + -rm -f ./$(DEPDIR)/mbind.Po + -rm -f ./$(DEPDIR)/membarrier.Po + -rm -f ./$(DEPDIR)/memfd_create-Xabbrev.Po + -rm -f ./$(DEPDIR)/memfd_create-Xraw.Po + -rm -f ./$(DEPDIR)/memfd_create-Xverbose.Po + -rm -f ./$(DEPDIR)/memfd_create.Po + -rm -f ./$(DEPDIR)/migrate_pages.Po + -rm -f ./$(DEPDIR)/mincore.Po + -rm -f ./$(DEPDIR)/mkdir.Po + -rm -f ./$(DEPDIR)/mkdirat.Po + -rm -f ./$(DEPDIR)/mknod.Po + -rm -f ./$(DEPDIR)/mknodat.Po + -rm -f ./$(DEPDIR)/mlock.Po + -rm -f ./$(DEPDIR)/mlock2.Po + -rm -f ./$(DEPDIR)/mlockall.Po + -rm -f ./$(DEPDIR)/mmap-Xabbrev.Po + -rm -f ./$(DEPDIR)/mmap-Xraw.Po + -rm -f ./$(DEPDIR)/mmap-Xverbose.Po + -rm -f ./$(DEPDIR)/mmap.Po + -rm -f ./$(DEPDIR)/mmap64-mmap64.Po + -rm -f ./$(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Po + -rm -f ./$(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Po + -rm -f ./$(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Po + -rm -f ./$(DEPDIR)/mmsg-silent.Po + -rm -f ./$(DEPDIR)/mmsg.Po + -rm -f ./$(DEPDIR)/mmsg_name-v.Po + -rm -f ./$(DEPDIR)/mmsg_name.Po + -rm -f ./$(DEPDIR)/modify_ldt.Po + -rm -f ./$(DEPDIR)/mount-Xabbrev.Po + -rm -f ./$(DEPDIR)/mount-Xraw.Po + -rm -f ./$(DEPDIR)/mount-Xverbose.Po + -rm -f ./$(DEPDIR)/mount.Po + -rm -f ./$(DEPDIR)/move_pages-Xabbrev.Po + -rm -f ./$(DEPDIR)/move_pages-Xraw.Po + -rm -f ./$(DEPDIR)/move_pages-Xverbose.Po + -rm -f ./$(DEPDIR)/move_pages.Po + -rm -f ./$(DEPDIR)/mq.Po + -rm -f ./$(DEPDIR)/mq_sendrecv-read.Po + -rm -f ./$(DEPDIR)/mq_sendrecv-write.Po + -rm -f ./$(DEPDIR)/mq_sendrecv.Po + -rm -f ./$(DEPDIR)/msg_control-v.Po + -rm -f ./$(DEPDIR)/msg_control.Po + -rm -f ./$(DEPDIR)/msg_name.Po + -rm -f ./$(DEPDIR)/munlockall.Po + -rm -f ./$(DEPDIR)/nanosleep.Po + -rm -f ./$(DEPDIR)/net-accept-connect.Po + -rm -f ./$(DEPDIR)/net-icmp_filter.Po + -rm -f ./$(DEPDIR)/net-packet_mreq-Xabbrev.Po + -rm -f ./$(DEPDIR)/net-packet_mreq-Xraw.Po + -rm -f ./$(DEPDIR)/net-packet_mreq-Xverbose.Po + -rm -f ./$(DEPDIR)/net-packet_mreq.Po + -rm -f ./$(DEPDIR)/net-sockaddr.Po + -rm -f ./$(DEPDIR)/net-tpacket_req.Po + -rm -f ./$(DEPDIR)/net-tpacket_stats-success.Po + -rm -f ./$(DEPDIR)/net-tpacket_stats.Po + -rm -f ./$(DEPDIR)/net-y-unix.Po + -rm -f ./$(DEPDIR)/net-yy-inet.Po + -rm -f ./$(DEPDIR)/net-yy-inet6.Po + -rm -f ./$(DEPDIR)/net-yy-netlink.Po + -rm -f ./$(DEPDIR)/net-yy-unix.Po + -rm -f ./$(DEPDIR)/netlink_audit.Po + -rm -f ./$(DEPDIR)/netlink_crypto.Po + -rm -f ./$(DEPDIR)/netlink_generic.Po + -rm -f ./$(DEPDIR)/netlink_inet_diag.Po + -rm -f ./$(DEPDIR)/netlink_kobject_uevent.Po + -rm -f ./$(DEPDIR)/netlink_netfilter.Po + -rm -f ./$(DEPDIR)/netlink_netlink_diag.Po + -rm -f ./$(DEPDIR)/netlink_protocol.Po + -rm -f ./$(DEPDIR)/netlink_route.Po + -rm -f ./$(DEPDIR)/netlink_selinux.Po + -rm -f ./$(DEPDIR)/netlink_sock_diag.Po + -rm -f ./$(DEPDIR)/netlink_unix_diag.Po + -rm -f ./$(DEPDIR)/netlink_xfrm.Po + -rm -f ./$(DEPDIR)/newfstatat-newfstatat.Po + -rm -f ./$(DEPDIR)/nfnetlink_acct.Po + -rm -f ./$(DEPDIR)/nfnetlink_cthelper.Po + -rm -f ./$(DEPDIR)/nfnetlink_ctnetlink.Po + -rm -f ./$(DEPDIR)/nfnetlink_ctnetlink_exp.Po + -rm -f ./$(DEPDIR)/nfnetlink_cttimeout.Po + -rm -f ./$(DEPDIR)/nfnetlink_ipset.Po + -rm -f ./$(DEPDIR)/nfnetlink_nft_compat.Po + -rm -f ./$(DEPDIR)/nfnetlink_nftables.Po + -rm -f ./$(DEPDIR)/nfnetlink_osf.Po + -rm -f ./$(DEPDIR)/nfnetlink_queue.Po + -rm -f ./$(DEPDIR)/nfnetlink_ulog.Po + -rm -f ./$(DEPDIR)/nlattr.Po + -rm -f ./$(DEPDIR)/nlattr_br_port_msg.Po + -rm -f ./$(DEPDIR)/nlattr_crypto_user_alg.Po + -rm -f ./$(DEPDIR)/nlattr_dcbmsg.Po + -rm -f ./$(DEPDIR)/nlattr_fib_rule_hdr.Po + -rm -f ./$(DEPDIR)/nlattr_ifaddrlblmsg.Po + -rm -f ./$(DEPDIR)/nlattr_ifaddrmsg.Po + -rm -f ./$(DEPDIR)/nlattr_ifinfomsg.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_af_spec.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_brport.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_linkinfo.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_port.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_xdp.Po + -rm -f ./$(DEPDIR)/nlattr_inet_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_inet_diag_req_compat.Po + -rm -f ./$(DEPDIR)/nlattr_inet_diag_req_v2.Po + -rm -f ./$(DEPDIR)/nlattr_mdba_mdb_entry.Po + -rm -f ./$(DEPDIR)/nlattr_mdba_router_port.Po + -rm -f ./$(DEPDIR)/nlattr_ndmsg.Po + -rm -f ./$(DEPDIR)/nlattr_ndtmsg.Po + -rm -f ./$(DEPDIR)/nlattr_netconfmsg.Po + -rm -f ./$(DEPDIR)/nlattr_netlink_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_nlmsgerr.Po + -rm -f ./$(DEPDIR)/nlattr_packet_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_rtgenmsg.Po + -rm -f ./$(DEPDIR)/nlattr_rtmsg.Po + -rm -f ./$(DEPDIR)/nlattr_smc_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_tc_stats.Po + -rm -f ./$(DEPDIR)/nlattr_tca_stab.Po + -rm -f ./$(DEPDIR)/nlattr_tcamsg.Po + -rm -f ./$(DEPDIR)/nlattr_tcmsg.Po + -rm -f ./$(DEPDIR)/nlattr_unix_diag_msg.Po + -rm -f ./$(DEPDIR)/nsyscalls-d.Po + -rm -f ./$(DEPDIR)/nsyscalls.Po + -rm -f ./$(DEPDIR)/old_mmap-P.Po + -rm -f ./$(DEPDIR)/old_mmap-Xabbrev.Po + -rm -f ./$(DEPDIR)/old_mmap-Xraw.Po + -rm -f ./$(DEPDIR)/old_mmap-Xverbose.Po + -rm -f ./$(DEPDIR)/old_mmap-v-none.Po + -rm -f ./$(DEPDIR)/old_mmap.Po + -rm -f ./$(DEPDIR)/oldfstat.Po + -rm -f ./$(DEPDIR)/oldlstat.Po + -rm -f ./$(DEPDIR)/oldselect-P.Po + -rm -f ./$(DEPDIR)/oldselect-efault-P.Po + -rm -f ./$(DEPDIR)/oldselect-efault.Po + -rm -f ./$(DEPDIR)/oldselect.Po + -rm -f ./$(DEPDIR)/oldstat.Po + -rm -f ./$(DEPDIR)/open.Po + -rm -f ./$(DEPDIR)/openat.Po + -rm -f ./$(DEPDIR)/orphaned_process_group.Po + -rm -f ./$(DEPDIR)/osf_utimes.Po + -rm -f ./$(DEPDIR)/pause.Po + -rm -f ./$(DEPDIR)/pc.Po + -rm -f ./$(DEPDIR)/perf_event_open.Po + -rm -f ./$(DEPDIR)/perf_event_open_nonverbose.Po + -rm -f ./$(DEPDIR)/perf_event_open_unabbrev.Po + -rm -f ./$(DEPDIR)/personality-Xabbrev.Po + -rm -f ./$(DEPDIR)/personality-Xraw.Po + -rm -f ./$(DEPDIR)/personality-Xverbose.Po + -rm -f ./$(DEPDIR)/personality.Po + -rm -f ./$(DEPDIR)/pidfd_send_signal.Po + -rm -f ./$(DEPDIR)/pipe.Po + -rm -f ./$(DEPDIR)/pipe2.Po + -rm -f ./$(DEPDIR)/pkey_alloc.Po + -rm -f ./$(DEPDIR)/pkey_free.Po + -rm -f ./$(DEPDIR)/pkey_mprotect.Po + -rm -f ./$(DEPDIR)/poll-P.Po + -rm -f ./$(DEPDIR)/poll.Po + -rm -f ./$(DEPDIR)/ppoll-P.Po + -rm -f ./$(DEPDIR)/ppoll-v.Po + -rm -f ./$(DEPDIR)/ppoll.Po + -rm -f ./$(DEPDIR)/prctl-arg2-intptr.Po + -rm -f ./$(DEPDIR)/prctl-dumpable.Po + -rm -f ./$(DEPDIR)/prctl-name.Po + -rm -f ./$(DEPDIR)/prctl-no-args.Po + -rm -f ./$(DEPDIR)/prctl-pdeathsig.Po + -rm -f ./$(DEPDIR)/prctl-seccomp-filter-v.Po + -rm -f ./$(DEPDIR)/prctl-seccomp-strict.Po + -rm -f ./$(DEPDIR)/prctl-securebits.Po + -rm -f ./$(DEPDIR)/prctl-spec-inject.Po + -rm -f ./$(DEPDIR)/prctl-tid_address.Po + -rm -f ./$(DEPDIR)/prctl-tsc.Po + -rm -f ./$(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po + -rm -f ./$(DEPDIR)/preadv-preadv.Po + -rm -f ./$(DEPDIR)/preadv2-pwritev2.Po + -rm -f ./$(DEPDIR)/preadv_pwritev-preadv-pwritev.Po + -rm -f ./$(DEPDIR)/print_maxfd.Po + -rm -f ./$(DEPDIR)/printpath-umovestr-peekdata.Po + -rm -f ./$(DEPDIR)/printpath-umovestr-undumpable.Po + -rm -f ./$(DEPDIR)/printpath-umovestr.Po + -rm -f ./$(DEPDIR)/printsignal-Xabbrev.Po + -rm -f ./$(DEPDIR)/printsignal-Xraw.Po + -rm -f ./$(DEPDIR)/printsignal-Xverbose.Po + -rm -f ./$(DEPDIR)/printstr.Po + -rm -f ./$(DEPDIR)/printstrn-umoven-peekdata.Po + -rm -f ./$(DEPDIR)/printstrn-umoven-undumpable.Po + -rm -f ./$(DEPDIR)/printstrn-umoven.Po + -rm -f ./$(DEPDIR)/prlimit64.Po + -rm -f ./$(DEPDIR)/process_vm_readv.Po + -rm -f ./$(DEPDIR)/process_vm_writev.Po + -rm -f ./$(DEPDIR)/pselect6.Po + -rm -f ./$(DEPDIR)/ptrace.Po + -rm -f ./$(DEPDIR)/ptrace_syscall_info.Po + -rm -f ./$(DEPDIR)/pwritev-pwritev.Po + -rm -f ./$(DEPDIR)/qual_fault.Po + -rm -f ./$(DEPDIR)/qual_inject-error-signal.Po + -rm -f ./$(DEPDIR)/qual_inject-retval.Po + -rm -f ./$(DEPDIR)/qual_inject-signal.Po + -rm -f ./$(DEPDIR)/qual_signal.Po + -rm -f ./$(DEPDIR)/quotactl-Xabbrev.Po + -rm -f ./$(DEPDIR)/quotactl-Xraw.Po + -rm -f ./$(DEPDIR)/quotactl-Xverbose.Po + -rm -f ./$(DEPDIR)/quotactl-success-v.Po + -rm -f ./$(DEPDIR)/quotactl-success.Po + -rm -f ./$(DEPDIR)/quotactl-v.Po + -rm -f ./$(DEPDIR)/quotactl-xfs-success-v.Po + -rm -f ./$(DEPDIR)/quotactl-xfs-success.Po + -rm -f ./$(DEPDIR)/quotactl-xfs-v.Po + -rm -f ./$(DEPDIR)/quotactl-xfs.Po + -rm -f ./$(DEPDIR)/quotactl.Po + -rm -f ./$(DEPDIR)/read-write.Po + -rm -f ./$(DEPDIR)/readahead.Po + -rm -f ./$(DEPDIR)/readdir.Po + -rm -f ./$(DEPDIR)/readlink.Po + -rm -f ./$(DEPDIR)/readlinkat.Po + -rm -f ./$(DEPDIR)/readv.Po + -rm -f ./$(DEPDIR)/reboot.Po + -rm -f ./$(DEPDIR)/recvfrom.Po + -rm -f ./$(DEPDIR)/recvmmsg-timeout.Po + -rm -f ./$(DEPDIR)/recvmsg.Po + -rm -f ./$(DEPDIR)/redirect-fds.Po + -rm -f ./$(DEPDIR)/remap_file_pages-Xabbrev.Po + -rm -f ./$(DEPDIR)/remap_file_pages-Xraw.Po + -rm -f ./$(DEPDIR)/remap_file_pages-Xverbose.Po + -rm -f ./$(DEPDIR)/remap_file_pages.Po + -rm -f ./$(DEPDIR)/rename.Po + -rm -f ./$(DEPDIR)/renameat.Po + -rm -f ./$(DEPDIR)/renameat2.Po + -rm -f ./$(DEPDIR)/request_key.Po + -rm -f ./$(DEPDIR)/restart_syscall.Po + -rm -f ./$(DEPDIR)/riscv_flush_icache.Po + -rm -f ./$(DEPDIR)/rmdir.Po + -rm -f ./$(DEPDIR)/rt_sigaction.Po + -rm -f ./$(DEPDIR)/rt_sigpending.Po + -rm -f ./$(DEPDIR)/rt_sigprocmask.Po + -rm -f ./$(DEPDIR)/rt_sigqueueinfo.Po + -rm -f ./$(DEPDIR)/rt_sigreturn.Po + -rm -f ./$(DEPDIR)/rt_sigsuspend.Po + -rm -f ./$(DEPDIR)/rt_sigtimedwait.Po + -rm -f ./$(DEPDIR)/rt_tgsigqueueinfo.Po + -rm -f ./$(DEPDIR)/run_expect_termsig.Po + -rm -f ./$(DEPDIR)/s390_guarded_storage-v.Po + -rm -f ./$(DEPDIR)/s390_guarded_storage.Po + -rm -f ./$(DEPDIR)/s390_pci_mmio_read_write.Po + -rm -f ./$(DEPDIR)/s390_runtime_instr.Po + -rm -f ./$(DEPDIR)/s390_sthyi-v.Po + -rm -f ./$(DEPDIR)/s390_sthyi.Po + -rm -f ./$(DEPDIR)/sched_get_priority_mxx.Po + -rm -f ./$(DEPDIR)/sched_rr_get_interval.Po + -rm -f ./$(DEPDIR)/sched_xetaffinity.Po + -rm -f ./$(DEPDIR)/sched_xetattr.Po + -rm -f ./$(DEPDIR)/sched_xetparam.Po + -rm -f ./$(DEPDIR)/sched_xetscheduler.Po + -rm -f ./$(DEPDIR)/sched_yield.Po + -rm -f ./$(DEPDIR)/scm_rights.Po + -rm -f ./$(DEPDIR)/seccomp-filter-v.Po + -rm -f ./$(DEPDIR)/seccomp-filter.Po + -rm -f ./$(DEPDIR)/seccomp-strict.Po + -rm -f ./$(DEPDIR)/seccomp_get_action_avail.Po + -rm -f ./$(DEPDIR)/select-P.Po + -rm -f ./$(DEPDIR)/select.Po + -rm -f ./$(DEPDIR)/semop.Po + -rm -f ./$(DEPDIR)/sendfile.Po + -rm -f ./$(DEPDIR)/sendfile64.Po + -rm -f ./$(DEPDIR)/set_mempolicy.Po + -rm -f ./$(DEPDIR)/set_ptracer_any.Po + -rm -f ./$(DEPDIR)/set_sigblock.Po + -rm -f ./$(DEPDIR)/set_sigign.Po + -rm -f ./$(DEPDIR)/setdomainname.Po + -rm -f ./$(DEPDIR)/setfsgid.Po + -rm -f ./$(DEPDIR)/setfsgid32.Po + -rm -f ./$(DEPDIR)/setfsuid.Po + -rm -f ./$(DEPDIR)/setfsuid32.Po + -rm -f ./$(DEPDIR)/setgid.Po + -rm -f ./$(DEPDIR)/setgid32.Po + -rm -f ./$(DEPDIR)/setgroups.Po + -rm -f ./$(DEPDIR)/setgroups32.Po + -rm -f ./$(DEPDIR)/sethostname.Po + -rm -f ./$(DEPDIR)/setns.Po + -rm -f ./$(DEPDIR)/setregid.Po + -rm -f ./$(DEPDIR)/setregid32.Po + -rm -f ./$(DEPDIR)/setresgid.Po + -rm -f ./$(DEPDIR)/setresgid32.Po + -rm -f ./$(DEPDIR)/setresuid.Po + -rm -f ./$(DEPDIR)/setresuid32.Po + -rm -f ./$(DEPDIR)/setreuid.Po + -rm -f ./$(DEPDIR)/setreuid32.Po + -rm -f ./$(DEPDIR)/setrlimit-Xabbrev.Po + -rm -f ./$(DEPDIR)/setrlimit-Xraw.Po + -rm -f ./$(DEPDIR)/setrlimit-Xverbose.Po + -rm -f ./$(DEPDIR)/setrlimit.Po + -rm -f ./$(DEPDIR)/setuid.Po + -rm -f ./$(DEPDIR)/setuid32.Po + -rm -f ./$(DEPDIR)/shmxt.Po + -rm -f ./$(DEPDIR)/shutdown.Po + -rm -f ./$(DEPDIR)/sigaction.Po + -rm -f ./$(DEPDIR)/sigaltstack.Po + -rm -f ./$(DEPDIR)/siginfo.Po + -rm -f ./$(DEPDIR)/signal.Po + -rm -f ./$(DEPDIR)/signal_receive.Po + -rm -f ./$(DEPDIR)/signalfd4.Po + -rm -f ./$(DEPDIR)/sigpending.Po + -rm -f ./$(DEPDIR)/sigprocmask.Po + -rm -f ./$(DEPDIR)/sigreturn.Po + -rm -f ./$(DEPDIR)/sigsuspend.Po + -rm -f ./$(DEPDIR)/sleep.Po + -rm -f ./$(DEPDIR)/so_error.Po + -rm -f ./$(DEPDIR)/so_linger.Po + -rm -f ./$(DEPDIR)/so_peercred-Xabbrev.Po + -rm -f ./$(DEPDIR)/so_peercred-Xraw.Po + -rm -f ./$(DEPDIR)/so_peercred-Xverbose.Po + -rm -f ./$(DEPDIR)/so_peercred.Po + -rm -f ./$(DEPDIR)/sock_filter-v-Xabbrev.Po + -rm -f ./$(DEPDIR)/sock_filter-v-Xraw.Po + -rm -f ./$(DEPDIR)/sock_filter-v-Xverbose.Po + -rm -f ./$(DEPDIR)/sock_filter-v.Po + -rm -f ./$(DEPDIR)/sockaddr_xlat-Xabbrev.Po + -rm -f ./$(DEPDIR)/sockaddr_xlat-Xraw.Po + -rm -f ./$(DEPDIR)/sockaddr_xlat-Xverbose.Po + -rm -f ./$(DEPDIR)/socketcall.Po + -rm -f ./$(DEPDIR)/sockopt-sol_netlink.Po + -rm -f ./$(DEPDIR)/sockopt-timestamp.Po + -rm -f ./$(DEPDIR)/splice.Po + -rm -f ./$(DEPDIR)/stack-fcall-0.Po + -rm -f ./$(DEPDIR)/stack-fcall-1.Po + -rm -f ./$(DEPDIR)/stack-fcall-2.Po + -rm -f ./$(DEPDIR)/stack-fcall-3.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-0.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-1.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-2.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-3.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled.Po + -rm -f ./$(DEPDIR)/stack-fcall.Po + -rm -f ./$(DEPDIR)/stat.Po + -rm -f ./$(DEPDIR)/stat64-stat64.Po + -rm -f ./$(DEPDIR)/statfs-statfs.Po + -rm -f ./$(DEPDIR)/statfs64.Po + -rm -f ./$(DEPDIR)/statx.Po + -rm -f ./$(DEPDIR)/swap.Po + -rm -f ./$(DEPDIR)/sxetmask.Po + -rm -f ./$(DEPDIR)/symlink.Po + -rm -f ./$(DEPDIR)/symlinkat.Po + -rm -f ./$(DEPDIR)/sync.Po + -rm -f ./$(DEPDIR)/sync_file_range.Po + -rm -f ./$(DEPDIR)/sync_file_range2.Po + -rm -f ./$(DEPDIR)/sysinfo.Po + -rm -f ./$(DEPDIR)/syslog.Po + -rm -f ./$(DEPDIR)/tee.Po + -rm -f ./$(DEPDIR)/threads-execve.Po + -rm -f ./$(DEPDIR)/time.Po + -rm -f ./$(DEPDIR)/timer_create.Po + -rm -f ./$(DEPDIR)/timer_xettime.Po + -rm -f ./$(DEPDIR)/timerfd_xettime.Po + -rm -f ./$(DEPDIR)/times-fail.Po + -rm -f ./$(DEPDIR)/times.Po + -rm -f ./$(DEPDIR)/truncate.Po + -rm -f ./$(DEPDIR)/truncate64-truncate64.Po + -rm -f ./$(DEPDIR)/ugetrlimit.Po + -rm -f ./$(DEPDIR)/uio-uio.Po + -rm -f ./$(DEPDIR)/umask.Po + -rm -f ./$(DEPDIR)/umount.Po + -rm -f ./$(DEPDIR)/umount2.Po + -rm -f ./$(DEPDIR)/umoven-illptr.Po + -rm -f ./$(DEPDIR)/umovestr-illptr.Po + -rm -f ./$(DEPDIR)/umovestr.Po + -rm -f ./$(DEPDIR)/umovestr2.Po + -rm -f ./$(DEPDIR)/umovestr3.Po + -rm -f ./$(DEPDIR)/uname.Po + -rm -f ./$(DEPDIR)/unblock_reset_raise.Po + -rm -f ./$(DEPDIR)/unix-pair-send-recv.Po + -rm -f ./$(DEPDIR)/unix-pair-sendto-recvfrom.Po + -rm -f ./$(DEPDIR)/unlink.Po + -rm -f ./$(DEPDIR)/unlinkat.Po + -rm -f ./$(DEPDIR)/unshare.Po + -rm -f ./$(DEPDIR)/userfaultfd.Po + -rm -f ./$(DEPDIR)/ustat.Po + -rm -f ./$(DEPDIR)/utime.Po + -rm -f ./$(DEPDIR)/utimensat-Xabbrev.Po + -rm -f ./$(DEPDIR)/utimensat-Xraw.Po + -rm -f ./$(DEPDIR)/utimensat-Xverbose.Po + -rm -f ./$(DEPDIR)/utimensat.Po + -rm -f ./$(DEPDIR)/utimes.Po + -rm -f ./$(DEPDIR)/vfork-f.Po + -rm -f ./$(DEPDIR)/vhangup.Po + -rm -f ./$(DEPDIR)/vmsplice.Po + -rm -f ./$(DEPDIR)/wait4-v.Po + -rm -f ./$(DEPDIR)/wait4.Po + -rm -f ./$(DEPDIR)/waitid-v.Po + -rm -f ./$(DEPDIR)/waitid.Po + -rm -f ./$(DEPDIR)/waitpid.Po + -rm -f ./$(DEPDIR)/xattr-strings.Po + -rm -f ./$(DEPDIR)/xattr.Po + -rm -f ./$(DEPDIR)/xet_robust_list.Po + -rm -f ./$(DEPDIR)/xet_thread_area_x86.Po + -rm -f ./$(DEPDIR)/xetitimer.Po + -rm -f ./$(DEPDIR)/xetpgid.Po + -rm -f ./$(DEPDIR)/xetpriority.Po + -rm -f ./$(DEPDIR)/xettimeofday.Po + -rm -f ./$(DEPDIR)/zeroargc.Po -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags @@ -5652,7 +9894,652 @@ install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am - -rm -rf ./$(DEPDIR) + -rm -f ./$(DEPDIR)/_newselect-P.Po + -rm -f ./$(DEPDIR)/_newselect.Po + -rm -f ./$(DEPDIR)/accept.Po + -rm -f ./$(DEPDIR)/accept4.Po + -rm -f ./$(DEPDIR)/access.Po + -rm -f ./$(DEPDIR)/acct.Po + -rm -f ./$(DEPDIR)/add_key.Po + -rm -f ./$(DEPDIR)/adjtimex.Po + -rm -f ./$(DEPDIR)/aio.Po + -rm -f ./$(DEPDIR)/aio_pgetevents.Po + -rm -f ./$(DEPDIR)/alarm.Po + -rm -f ./$(DEPDIR)/answer.Po + -rm -f ./$(DEPDIR)/attach-f-p-cmd.Po + -rm -f ./$(DEPDIR)/attach-f-p.Po + -rm -f ./$(DEPDIR)/attach-p-cmd-cmd.Po + -rm -f ./$(DEPDIR)/attach-p-cmd-p.Po + -rm -f ./$(DEPDIR)/block_reset_raise_run.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd-prog-v.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd-prog.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd-v.Po + -rm -f ./$(DEPDIR)/bpf-obj_get_info_by_fd.Po + -rm -f ./$(DEPDIR)/bpf-success-v.Po + -rm -f ./$(DEPDIR)/bpf-success.Po + -rm -f ./$(DEPDIR)/bpf-v.Po + -rm -f ./$(DEPDIR)/bpf.Po + -rm -f ./$(DEPDIR)/brk.Po + -rm -f ./$(DEPDIR)/btrfs.Po + -rm -f ./$(DEPDIR)/caps-abbrev.Po + -rm -f ./$(DEPDIR)/caps.Po + -rm -f ./$(DEPDIR)/check_sigblock.Po + -rm -f ./$(DEPDIR)/check_sigign.Po + -rm -f ./$(DEPDIR)/chmod.Po + -rm -f ./$(DEPDIR)/chown.Po + -rm -f ./$(DEPDIR)/chown32.Po + -rm -f ./$(DEPDIR)/chroot.Po + -rm -f ./$(DEPDIR)/clock_adjtime.Po + -rm -f ./$(DEPDIR)/clock_nanosleep.Po + -rm -f ./$(DEPDIR)/clock_xettime.Po + -rm -f ./$(DEPDIR)/clone_parent.Po + -rm -f ./$(DEPDIR)/clone_ptrace.Po + -rm -f ./$(DEPDIR)/copy_file_range.Po + -rm -f ./$(DEPDIR)/count-f.Po + -rm -f ./$(DEPDIR)/creat.Po + -rm -f ./$(DEPDIR)/delay.Po + -rm -f ./$(DEPDIR)/delete_module.Po + -rm -f ./$(DEPDIR)/dev-yy.Po + -rm -f ./$(DEPDIR)/dup.Po + -rm -f ./$(DEPDIR)/dup2.Po + -rm -f ./$(DEPDIR)/dup3.Po + -rm -f ./$(DEPDIR)/epoll_create.Po + -rm -f ./$(DEPDIR)/epoll_create1.Po + -rm -f ./$(DEPDIR)/epoll_ctl.Po + -rm -f ./$(DEPDIR)/epoll_pwait.Po + -rm -f ./$(DEPDIR)/epoll_wait.Po + -rm -f ./$(DEPDIR)/erestartsys.Po + -rm -f ./$(DEPDIR)/eventfd.Po + -rm -f ./$(DEPDIR)/execve-v.Po + -rm -f ./$(DEPDIR)/execve.Po + -rm -f ./$(DEPDIR)/execveat-v.Po + -rm -f ./$(DEPDIR)/execveat.Po + -rm -f ./$(DEPDIR)/faccessat.Po + -rm -f ./$(DEPDIR)/fadvise64.Po + -rm -f ./$(DEPDIR)/fadvise64_64.Po + -rm -f ./$(DEPDIR)/fallocate.Po + -rm -f ./$(DEPDIR)/fanotify_init.Po + -rm -f ./$(DEPDIR)/fanotify_mark-Xabbrev.Po + -rm -f ./$(DEPDIR)/fanotify_mark-Xraw.Po + -rm -f ./$(DEPDIR)/fanotify_mark-Xverbose.Po + -rm -f ./$(DEPDIR)/fanotify_mark.Po + -rm -f ./$(DEPDIR)/fchdir.Po + -rm -f ./$(DEPDIR)/fchmod.Po + -rm -f ./$(DEPDIR)/fchmodat.Po + -rm -f ./$(DEPDIR)/fchown.Po + -rm -f ./$(DEPDIR)/fchown32.Po + -rm -f ./$(DEPDIR)/fchownat.Po + -rm -f ./$(DEPDIR)/fcntl.Po + -rm -f ./$(DEPDIR)/fcntl64.Po + -rm -f ./$(DEPDIR)/fdatasync.Po + -rm -f ./$(DEPDIR)/fflush.Po + -rm -f ./$(DEPDIR)/file_handle.Po + -rm -f ./$(DEPDIR)/file_ioctl.Po + -rm -f ./$(DEPDIR)/filter-unavailable.Po + -rm -f ./$(DEPDIR)/finit_module.Po + -rm -f ./$(DEPDIR)/flock.Po + -rm -f ./$(DEPDIR)/fork-f.Po + -rm -f ./$(DEPDIR)/fstat-Xabbrev.Po + -rm -f ./$(DEPDIR)/fstat-Xraw.Po + -rm -f ./$(DEPDIR)/fstat-Xverbose.Po + -rm -f ./$(DEPDIR)/fstat.Po + -rm -f ./$(DEPDIR)/fstat64-Xabbrev.Po + -rm -f ./$(DEPDIR)/fstat64-Xraw.Po + -rm -f ./$(DEPDIR)/fstat64-Xverbose.Po + -rm -f ./$(DEPDIR)/fstat64-fstat64.Po + -rm -f ./$(DEPDIR)/fstatat64-fstatat64.Po + -rm -f ./$(DEPDIR)/fstatfs.Po + -rm -f ./$(DEPDIR)/fstatfs64.Po + -rm -f ./$(DEPDIR)/fsync-y.Po + -rm -f ./$(DEPDIR)/fsync.Po + -rm -f ./$(DEPDIR)/ftruncate.Po + -rm -f ./$(DEPDIR)/ftruncate64-ftruncate64.Po + -rm -f ./$(DEPDIR)/futex.Po + -rm -f ./$(DEPDIR)/futimesat.Po + -rm -f ./$(DEPDIR)/get_mempolicy.Po + -rm -f ./$(DEPDIR)/getcpu.Po + -rm -f ./$(DEPDIR)/getcwd.Po + -rm -f ./$(DEPDIR)/getdents.Po + -rm -f ./$(DEPDIR)/getdents64.Po + -rm -f ./$(DEPDIR)/getegid.Po + -rm -f ./$(DEPDIR)/getegid32.Po + -rm -f ./$(DEPDIR)/geteuid.Po + -rm -f ./$(DEPDIR)/geteuid32.Po + -rm -f ./$(DEPDIR)/getgid.Po + -rm -f ./$(DEPDIR)/getgid32.Po + -rm -f ./$(DEPDIR)/getgroups.Po + -rm -f ./$(DEPDIR)/getgroups32.Po + -rm -f ./$(DEPDIR)/getpeername.Po + -rm -f ./$(DEPDIR)/getpgrp.Po + -rm -f ./$(DEPDIR)/getpid.Po + -rm -f ./$(DEPDIR)/getppid.Po + -rm -f ./$(DEPDIR)/getrandom.Po + -rm -f ./$(DEPDIR)/getresgid.Po + -rm -f ./$(DEPDIR)/getresgid32.Po + -rm -f ./$(DEPDIR)/getresuid.Po + -rm -f ./$(DEPDIR)/getresuid32.Po + -rm -f ./$(DEPDIR)/getrlimit.Po + -rm -f ./$(DEPDIR)/getrusage.Po + -rm -f ./$(DEPDIR)/getsid.Po + -rm -f ./$(DEPDIR)/getsockname.Po + -rm -f ./$(DEPDIR)/gettid.Po + -rm -f ./$(DEPDIR)/getuid.Po + -rm -f ./$(DEPDIR)/getuid32.Po + -rm -f ./$(DEPDIR)/getxxid.Po + -rm -f ./$(DEPDIR)/group_req.Po + -rm -f ./$(DEPDIR)/inet-cmsg.Po + -rm -f ./$(DEPDIR)/init_module.Po + -rm -f ./$(DEPDIR)/inject-nf.Po + -rm -f ./$(DEPDIR)/inotify.Po + -rm -f ./$(DEPDIR)/inotify_init1.Po + -rm -f ./$(DEPDIR)/int_0x80.Po + -rm -f ./$(DEPDIR)/io_uring_enter.Po + -rm -f ./$(DEPDIR)/io_uring_register.Po + -rm -f ./$(DEPDIR)/io_uring_setup.Po + -rm -f ./$(DEPDIR)/ioctl.Po + -rm -f ./$(DEPDIR)/ioctl_block.Po + -rm -f ./$(DEPDIR)/ioctl_dm-v.Po + -rm -f ./$(DEPDIR)/ioctl_dm.Po + -rm -f ./$(DEPDIR)/ioctl_evdev-success-v.Po + -rm -f ./$(DEPDIR)/ioctl_evdev-success.Po + -rm -f ./$(DEPDIR)/ioctl_evdev-v.Po + -rm -f ./$(DEPDIR)/ioctl_evdev.Po + -rm -f ./$(DEPDIR)/ioctl_inotify.Po + -rm -f ./$(DEPDIR)/ioctl_kvm_run-v.Po + -rm -f ./$(DEPDIR)/ioctl_kvm_run.Po + -rm -f ./$(DEPDIR)/ioctl_kvm_run_auxstr_vcpu.Po + -rm -f ./$(DEPDIR)/ioctl_loop-nv.Po + -rm -f ./$(DEPDIR)/ioctl_loop-v.Po + -rm -f ./$(DEPDIR)/ioctl_loop.Po + -rm -f ./$(DEPDIR)/ioctl_mtd.Po + -rm -f ./$(DEPDIR)/ioctl_nbd.Po + -rm -f ./$(DEPDIR)/ioctl_nsfs.Po + -rm -f ./$(DEPDIR)/ioctl_perf-success.Po + -rm -f ./$(DEPDIR)/ioctl_perf.Po + -rm -f ./$(DEPDIR)/ioctl_ptp.Po + -rm -f ./$(DEPDIR)/ioctl_random.Po + -rm -f ./$(DEPDIR)/ioctl_rtc-v.Po + -rm -f ./$(DEPDIR)/ioctl_rtc.Po + -rm -f ./$(DEPDIR)/ioctl_scsi.Po + -rm -f ./$(DEPDIR)/ioctl_sg_io_v3.Po + -rm -f ./$(DEPDIR)/ioctl_sg_io_v4.Po + -rm -f ./$(DEPDIR)/ioctl_sock_gifconf.Po + -rm -f ./$(DEPDIR)/ioctl_uffdio.Po + -rm -f ./$(DEPDIR)/ioctl_v4l2.Po + -rm -f ./$(DEPDIR)/ioperm.Po + -rm -f ./$(DEPDIR)/iopl.Po + -rm -f ./$(DEPDIR)/ioprio-Xabbrev.Po + -rm -f ./$(DEPDIR)/ioprio-Xraw.Po + -rm -f ./$(DEPDIR)/ioprio-Xverbose.Po + -rm -f ./$(DEPDIR)/ioprio.Po + -rm -f ./$(DEPDIR)/ip_mreq.Po + -rm -f ./$(DEPDIR)/ipc.Po + -rm -f ./$(DEPDIR)/ipc_msg-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_msg-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_msg-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_msg.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_msgbuf.Po + -rm -f ./$(DEPDIR)/ipc_sem-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_sem-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_sem-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_sem.Po + -rm -f ./$(DEPDIR)/ipc_shm-Xabbrev.Po + -rm -f ./$(DEPDIR)/ipc_shm-Xraw.Po + -rm -f ./$(DEPDIR)/ipc_shm-Xverbose.Po + -rm -f ./$(DEPDIR)/ipc_shm.Po + -rm -f ./$(DEPDIR)/is_linux_mips_n64.Po + -rm -f ./$(DEPDIR)/kcmp-y.Po + -rm -f ./$(DEPDIR)/kcmp.Po + -rm -f ./$(DEPDIR)/kern_features.Po + -rm -f ./$(DEPDIR)/kernel_version-Xabbrev.Po + -rm -f ./$(DEPDIR)/kernel_version-Xraw.Po + -rm -f ./$(DEPDIR)/kernel_version-Xverbose.Po + -rm -f ./$(DEPDIR)/kernel_version.Po + -rm -f ./$(DEPDIR)/kexec_file_load.Po + -rm -f ./$(DEPDIR)/kexec_load.Po + -rm -f ./$(DEPDIR)/keyctl-Xabbrev.Po + -rm -f ./$(DEPDIR)/keyctl-Xraw.Po + -rm -f ./$(DEPDIR)/keyctl-Xverbose.Po + -rm -f ./$(DEPDIR)/keyctl.Po + -rm -f ./$(DEPDIR)/kill.Po + -rm -f ./$(DEPDIR)/kill_child.Po + -rm -f ./$(DEPDIR)/ksysent.Po + -rm -f ./$(DEPDIR)/lchown.Po + -rm -f ./$(DEPDIR)/lchown32.Po + -rm -f ./$(DEPDIR)/libtests_a-create_nl_socket.Po + -rm -f ./$(DEPDIR)/libtests_a-errno2name.Po + -rm -f ./$(DEPDIR)/libtests_a-error_msg.Po + -rm -f ./$(DEPDIR)/libtests_a-fill_memory.Po + -rm -f ./$(DEPDIR)/libtests_a-get_page_size.Po + -rm -f ./$(DEPDIR)/libtests_a-get_sigset_size.Po + -rm -f ./$(DEPDIR)/libtests_a-hexdump_strdup.Po + -rm -f ./$(DEPDIR)/libtests_a-hexquote_strndup.Po + -rm -f ./$(DEPDIR)/libtests_a-ifindex.Po + -rm -f ./$(DEPDIR)/libtests_a-inode_of_sockfd.Po + -rm -f ./$(DEPDIR)/libtests_a-libmmsg.Po + -rm -f ./$(DEPDIR)/libtests_a-libsocketcall.Po + -rm -f ./$(DEPDIR)/libtests_a-overflowuid.Po + -rm -f ./$(DEPDIR)/libtests_a-pipe_maxfd.Po + -rm -f ./$(DEPDIR)/libtests_a-print_quoted_string.Po + -rm -f ./$(DEPDIR)/libtests_a-print_time.Po + -rm -f ./$(DEPDIR)/libtests_a-printflags.Po + -rm -f ./$(DEPDIR)/libtests_a-printxval.Po + -rm -f ./$(DEPDIR)/libtests_a-signal2name.Po + -rm -f ./$(DEPDIR)/libtests_a-skip_unavailable.Po + -rm -f ./$(DEPDIR)/libtests_a-sprintrc.Po + -rm -f ./$(DEPDIR)/libtests_a-tail_alloc.Po + -rm -f ./$(DEPDIR)/libtests_a-test_printpath.Po + -rm -f ./$(DEPDIR)/libtests_a-test_printstrn.Po + -rm -f ./$(DEPDIR)/libtests_a-test_ucopy.Po + -rm -f ./$(DEPDIR)/libtests_a-tprintf.Po + -rm -f ./$(DEPDIR)/link.Po + -rm -f ./$(DEPDIR)/linkat.Po + -rm -f ./$(DEPDIR)/list_sigaction_signum.Po + -rm -f ./$(DEPDIR)/llseek.Po + -rm -f ./$(DEPDIR)/localtime.Po + -rm -f ./$(DEPDIR)/lookup_dcookie.Po + -rm -f ./$(DEPDIR)/looping_threads.Po + -rm -f ./$(DEPDIR)/lseek.Po + -rm -f ./$(DEPDIR)/lstat.Po + -rm -f ./$(DEPDIR)/lstat64-lstat64.Po + -rm -f ./$(DEPDIR)/madvise.Po + -rm -f ./$(DEPDIR)/mbind.Po + -rm -f ./$(DEPDIR)/membarrier.Po + -rm -f ./$(DEPDIR)/memfd_create-Xabbrev.Po + -rm -f ./$(DEPDIR)/memfd_create-Xraw.Po + -rm -f ./$(DEPDIR)/memfd_create-Xverbose.Po + -rm -f ./$(DEPDIR)/memfd_create.Po + -rm -f ./$(DEPDIR)/migrate_pages.Po + -rm -f ./$(DEPDIR)/mincore.Po + -rm -f ./$(DEPDIR)/mkdir.Po + -rm -f ./$(DEPDIR)/mkdirat.Po + -rm -f ./$(DEPDIR)/mknod.Po + -rm -f ./$(DEPDIR)/mknodat.Po + -rm -f ./$(DEPDIR)/mlock.Po + -rm -f ./$(DEPDIR)/mlock2.Po + -rm -f ./$(DEPDIR)/mlockall.Po + -rm -f ./$(DEPDIR)/mmap-Xabbrev.Po + -rm -f ./$(DEPDIR)/mmap-Xraw.Po + -rm -f ./$(DEPDIR)/mmap-Xverbose.Po + -rm -f ./$(DEPDIR)/mmap.Po + -rm -f ./$(DEPDIR)/mmap64-mmap64.Po + -rm -f ./$(DEPDIR)/mmap64_Xabbrev-mmap64-Xabbrev.Po + -rm -f ./$(DEPDIR)/mmap64_Xraw-mmap64-Xraw.Po + -rm -f ./$(DEPDIR)/mmap64_Xverbose-mmap64-Xverbose.Po + -rm -f ./$(DEPDIR)/mmsg-silent.Po + -rm -f ./$(DEPDIR)/mmsg.Po + -rm -f ./$(DEPDIR)/mmsg_name-v.Po + -rm -f ./$(DEPDIR)/mmsg_name.Po + -rm -f ./$(DEPDIR)/modify_ldt.Po + -rm -f ./$(DEPDIR)/mount-Xabbrev.Po + -rm -f ./$(DEPDIR)/mount-Xraw.Po + -rm -f ./$(DEPDIR)/mount-Xverbose.Po + -rm -f ./$(DEPDIR)/mount.Po + -rm -f ./$(DEPDIR)/move_pages-Xabbrev.Po + -rm -f ./$(DEPDIR)/move_pages-Xraw.Po + -rm -f ./$(DEPDIR)/move_pages-Xverbose.Po + -rm -f ./$(DEPDIR)/move_pages.Po + -rm -f ./$(DEPDIR)/mq.Po + -rm -f ./$(DEPDIR)/mq_sendrecv-read.Po + -rm -f ./$(DEPDIR)/mq_sendrecv-write.Po + -rm -f ./$(DEPDIR)/mq_sendrecv.Po + -rm -f ./$(DEPDIR)/msg_control-v.Po + -rm -f ./$(DEPDIR)/msg_control.Po + -rm -f ./$(DEPDIR)/msg_name.Po + -rm -f ./$(DEPDIR)/munlockall.Po + -rm -f ./$(DEPDIR)/nanosleep.Po + -rm -f ./$(DEPDIR)/net-accept-connect.Po + -rm -f ./$(DEPDIR)/net-icmp_filter.Po + -rm -f ./$(DEPDIR)/net-packet_mreq-Xabbrev.Po + -rm -f ./$(DEPDIR)/net-packet_mreq-Xraw.Po + -rm -f ./$(DEPDIR)/net-packet_mreq-Xverbose.Po + -rm -f ./$(DEPDIR)/net-packet_mreq.Po + -rm -f ./$(DEPDIR)/net-sockaddr.Po + -rm -f ./$(DEPDIR)/net-tpacket_req.Po + -rm -f ./$(DEPDIR)/net-tpacket_stats-success.Po + -rm -f ./$(DEPDIR)/net-tpacket_stats.Po + -rm -f ./$(DEPDIR)/net-y-unix.Po + -rm -f ./$(DEPDIR)/net-yy-inet.Po + -rm -f ./$(DEPDIR)/net-yy-inet6.Po + -rm -f ./$(DEPDIR)/net-yy-netlink.Po + -rm -f ./$(DEPDIR)/net-yy-unix.Po + -rm -f ./$(DEPDIR)/netlink_audit.Po + -rm -f ./$(DEPDIR)/netlink_crypto.Po + -rm -f ./$(DEPDIR)/netlink_generic.Po + -rm -f ./$(DEPDIR)/netlink_inet_diag.Po + -rm -f ./$(DEPDIR)/netlink_kobject_uevent.Po + -rm -f ./$(DEPDIR)/netlink_netfilter.Po + -rm -f ./$(DEPDIR)/netlink_netlink_diag.Po + -rm -f ./$(DEPDIR)/netlink_protocol.Po + -rm -f ./$(DEPDIR)/netlink_route.Po + -rm -f ./$(DEPDIR)/netlink_selinux.Po + -rm -f ./$(DEPDIR)/netlink_sock_diag.Po + -rm -f ./$(DEPDIR)/netlink_unix_diag.Po + -rm -f ./$(DEPDIR)/netlink_xfrm.Po + -rm -f ./$(DEPDIR)/newfstatat-newfstatat.Po + -rm -f ./$(DEPDIR)/nfnetlink_acct.Po + -rm -f ./$(DEPDIR)/nfnetlink_cthelper.Po + -rm -f ./$(DEPDIR)/nfnetlink_ctnetlink.Po + -rm -f ./$(DEPDIR)/nfnetlink_ctnetlink_exp.Po + -rm -f ./$(DEPDIR)/nfnetlink_cttimeout.Po + -rm -f ./$(DEPDIR)/nfnetlink_ipset.Po + -rm -f ./$(DEPDIR)/nfnetlink_nft_compat.Po + -rm -f ./$(DEPDIR)/nfnetlink_nftables.Po + -rm -f ./$(DEPDIR)/nfnetlink_osf.Po + -rm -f ./$(DEPDIR)/nfnetlink_queue.Po + -rm -f ./$(DEPDIR)/nfnetlink_ulog.Po + -rm -f ./$(DEPDIR)/nlattr.Po + -rm -f ./$(DEPDIR)/nlattr_br_port_msg.Po + -rm -f ./$(DEPDIR)/nlattr_crypto_user_alg.Po + -rm -f ./$(DEPDIR)/nlattr_dcbmsg.Po + -rm -f ./$(DEPDIR)/nlattr_fib_rule_hdr.Po + -rm -f ./$(DEPDIR)/nlattr_ifaddrlblmsg.Po + -rm -f ./$(DEPDIR)/nlattr_ifaddrmsg.Po + -rm -f ./$(DEPDIR)/nlattr_ifinfomsg.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_af_spec.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_brport.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_linkinfo.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_port.Po + -rm -f ./$(DEPDIR)/nlattr_ifla_xdp.Po + -rm -f ./$(DEPDIR)/nlattr_inet_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_inet_diag_req_compat.Po + -rm -f ./$(DEPDIR)/nlattr_inet_diag_req_v2.Po + -rm -f ./$(DEPDIR)/nlattr_mdba_mdb_entry.Po + -rm -f ./$(DEPDIR)/nlattr_mdba_router_port.Po + -rm -f ./$(DEPDIR)/nlattr_ndmsg.Po + -rm -f ./$(DEPDIR)/nlattr_ndtmsg.Po + -rm -f ./$(DEPDIR)/nlattr_netconfmsg.Po + -rm -f ./$(DEPDIR)/nlattr_netlink_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_nlmsgerr.Po + -rm -f ./$(DEPDIR)/nlattr_packet_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_rtgenmsg.Po + -rm -f ./$(DEPDIR)/nlattr_rtmsg.Po + -rm -f ./$(DEPDIR)/nlattr_smc_diag_msg.Po + -rm -f ./$(DEPDIR)/nlattr_tc_stats.Po + -rm -f ./$(DEPDIR)/nlattr_tca_stab.Po + -rm -f ./$(DEPDIR)/nlattr_tcamsg.Po + -rm -f ./$(DEPDIR)/nlattr_tcmsg.Po + -rm -f ./$(DEPDIR)/nlattr_unix_diag_msg.Po + -rm -f ./$(DEPDIR)/nsyscalls-d.Po + -rm -f ./$(DEPDIR)/nsyscalls.Po + -rm -f ./$(DEPDIR)/old_mmap-P.Po + -rm -f ./$(DEPDIR)/old_mmap-Xabbrev.Po + -rm -f ./$(DEPDIR)/old_mmap-Xraw.Po + -rm -f ./$(DEPDIR)/old_mmap-Xverbose.Po + -rm -f ./$(DEPDIR)/old_mmap-v-none.Po + -rm -f ./$(DEPDIR)/old_mmap.Po + -rm -f ./$(DEPDIR)/oldfstat.Po + -rm -f ./$(DEPDIR)/oldlstat.Po + -rm -f ./$(DEPDIR)/oldselect-P.Po + -rm -f ./$(DEPDIR)/oldselect-efault-P.Po + -rm -f ./$(DEPDIR)/oldselect-efault.Po + -rm -f ./$(DEPDIR)/oldselect.Po + -rm -f ./$(DEPDIR)/oldstat.Po + -rm -f ./$(DEPDIR)/open.Po + -rm -f ./$(DEPDIR)/openat.Po + -rm -f ./$(DEPDIR)/orphaned_process_group.Po + -rm -f ./$(DEPDIR)/osf_utimes.Po + -rm -f ./$(DEPDIR)/pause.Po + -rm -f ./$(DEPDIR)/pc.Po + -rm -f ./$(DEPDIR)/perf_event_open.Po + -rm -f ./$(DEPDIR)/perf_event_open_nonverbose.Po + -rm -f ./$(DEPDIR)/perf_event_open_unabbrev.Po + -rm -f ./$(DEPDIR)/personality-Xabbrev.Po + -rm -f ./$(DEPDIR)/personality-Xraw.Po + -rm -f ./$(DEPDIR)/personality-Xverbose.Po + -rm -f ./$(DEPDIR)/personality.Po + -rm -f ./$(DEPDIR)/pidfd_send_signal.Po + -rm -f ./$(DEPDIR)/pipe.Po + -rm -f ./$(DEPDIR)/pipe2.Po + -rm -f ./$(DEPDIR)/pkey_alloc.Po + -rm -f ./$(DEPDIR)/pkey_free.Po + -rm -f ./$(DEPDIR)/pkey_mprotect.Po + -rm -f ./$(DEPDIR)/poll-P.Po + -rm -f ./$(DEPDIR)/poll.Po + -rm -f ./$(DEPDIR)/ppoll-P.Po + -rm -f ./$(DEPDIR)/ppoll-v.Po + -rm -f ./$(DEPDIR)/ppoll.Po + -rm -f ./$(DEPDIR)/prctl-arg2-intptr.Po + -rm -f ./$(DEPDIR)/prctl-dumpable.Po + -rm -f ./$(DEPDIR)/prctl-name.Po + -rm -f ./$(DEPDIR)/prctl-no-args.Po + -rm -f ./$(DEPDIR)/prctl-pdeathsig.Po + -rm -f ./$(DEPDIR)/prctl-seccomp-filter-v.Po + -rm -f ./$(DEPDIR)/prctl-seccomp-strict.Po + -rm -f ./$(DEPDIR)/prctl-securebits.Po + -rm -f ./$(DEPDIR)/prctl-spec-inject.Po + -rm -f ./$(DEPDIR)/prctl-tid_address.Po + -rm -f ./$(DEPDIR)/prctl-tsc.Po + -rm -f ./$(DEPDIR)/pread64_pwrite64-pread64-pwrite64.Po + -rm -f ./$(DEPDIR)/preadv-preadv.Po + -rm -f ./$(DEPDIR)/preadv2-pwritev2.Po + -rm -f ./$(DEPDIR)/preadv_pwritev-preadv-pwritev.Po + -rm -f ./$(DEPDIR)/print_maxfd.Po + -rm -f ./$(DEPDIR)/printpath-umovestr-peekdata.Po + -rm -f ./$(DEPDIR)/printpath-umovestr-undumpable.Po + -rm -f ./$(DEPDIR)/printpath-umovestr.Po + -rm -f ./$(DEPDIR)/printsignal-Xabbrev.Po + -rm -f ./$(DEPDIR)/printsignal-Xraw.Po + -rm -f ./$(DEPDIR)/printsignal-Xverbose.Po + -rm -f ./$(DEPDIR)/printstr.Po + -rm -f ./$(DEPDIR)/printstrn-umoven-peekdata.Po + -rm -f ./$(DEPDIR)/printstrn-umoven-undumpable.Po + -rm -f ./$(DEPDIR)/printstrn-umoven.Po + -rm -f ./$(DEPDIR)/prlimit64.Po + -rm -f ./$(DEPDIR)/process_vm_readv.Po + -rm -f ./$(DEPDIR)/process_vm_writev.Po + -rm -f ./$(DEPDIR)/pselect6.Po + -rm -f ./$(DEPDIR)/ptrace.Po + -rm -f ./$(DEPDIR)/ptrace_syscall_info.Po + -rm -f ./$(DEPDIR)/pwritev-pwritev.Po + -rm -f ./$(DEPDIR)/qual_fault.Po + -rm -f ./$(DEPDIR)/qual_inject-error-signal.Po + -rm -f ./$(DEPDIR)/qual_inject-retval.Po + -rm -f ./$(DEPDIR)/qual_inject-signal.Po + -rm -f ./$(DEPDIR)/qual_signal.Po + -rm -f ./$(DEPDIR)/quotactl-Xabbrev.Po + -rm -f ./$(DEPDIR)/quotactl-Xraw.Po + -rm -f ./$(DEPDIR)/quotactl-Xverbose.Po + -rm -f ./$(DEPDIR)/quotactl-success-v.Po + -rm -f ./$(DEPDIR)/quotactl-success.Po + -rm -f ./$(DEPDIR)/quotactl-v.Po + -rm -f ./$(DEPDIR)/quotactl-xfs-success-v.Po + -rm -f ./$(DEPDIR)/quotactl-xfs-success.Po + -rm -f ./$(DEPDIR)/quotactl-xfs-v.Po + -rm -f ./$(DEPDIR)/quotactl-xfs.Po + -rm -f ./$(DEPDIR)/quotactl.Po + -rm -f ./$(DEPDIR)/read-write.Po + -rm -f ./$(DEPDIR)/readahead.Po + -rm -f ./$(DEPDIR)/readdir.Po + -rm -f ./$(DEPDIR)/readlink.Po + -rm -f ./$(DEPDIR)/readlinkat.Po + -rm -f ./$(DEPDIR)/readv.Po + -rm -f ./$(DEPDIR)/reboot.Po + -rm -f ./$(DEPDIR)/recvfrom.Po + -rm -f ./$(DEPDIR)/recvmmsg-timeout.Po + -rm -f ./$(DEPDIR)/recvmsg.Po + -rm -f ./$(DEPDIR)/redirect-fds.Po + -rm -f ./$(DEPDIR)/remap_file_pages-Xabbrev.Po + -rm -f ./$(DEPDIR)/remap_file_pages-Xraw.Po + -rm -f ./$(DEPDIR)/remap_file_pages-Xverbose.Po + -rm -f ./$(DEPDIR)/remap_file_pages.Po + -rm -f ./$(DEPDIR)/rename.Po + -rm -f ./$(DEPDIR)/renameat.Po + -rm -f ./$(DEPDIR)/renameat2.Po + -rm -f ./$(DEPDIR)/request_key.Po + -rm -f ./$(DEPDIR)/restart_syscall.Po + -rm -f ./$(DEPDIR)/riscv_flush_icache.Po + -rm -f ./$(DEPDIR)/rmdir.Po + -rm -f ./$(DEPDIR)/rt_sigaction.Po + -rm -f ./$(DEPDIR)/rt_sigpending.Po + -rm -f ./$(DEPDIR)/rt_sigprocmask.Po + -rm -f ./$(DEPDIR)/rt_sigqueueinfo.Po + -rm -f ./$(DEPDIR)/rt_sigreturn.Po + -rm -f ./$(DEPDIR)/rt_sigsuspend.Po + -rm -f ./$(DEPDIR)/rt_sigtimedwait.Po + -rm -f ./$(DEPDIR)/rt_tgsigqueueinfo.Po + -rm -f ./$(DEPDIR)/run_expect_termsig.Po + -rm -f ./$(DEPDIR)/s390_guarded_storage-v.Po + -rm -f ./$(DEPDIR)/s390_guarded_storage.Po + -rm -f ./$(DEPDIR)/s390_pci_mmio_read_write.Po + -rm -f ./$(DEPDIR)/s390_runtime_instr.Po + -rm -f ./$(DEPDIR)/s390_sthyi-v.Po + -rm -f ./$(DEPDIR)/s390_sthyi.Po + -rm -f ./$(DEPDIR)/sched_get_priority_mxx.Po + -rm -f ./$(DEPDIR)/sched_rr_get_interval.Po + -rm -f ./$(DEPDIR)/sched_xetaffinity.Po + -rm -f ./$(DEPDIR)/sched_xetattr.Po + -rm -f ./$(DEPDIR)/sched_xetparam.Po + -rm -f ./$(DEPDIR)/sched_xetscheduler.Po + -rm -f ./$(DEPDIR)/sched_yield.Po + -rm -f ./$(DEPDIR)/scm_rights.Po + -rm -f ./$(DEPDIR)/seccomp-filter-v.Po + -rm -f ./$(DEPDIR)/seccomp-filter.Po + -rm -f ./$(DEPDIR)/seccomp-strict.Po + -rm -f ./$(DEPDIR)/seccomp_get_action_avail.Po + -rm -f ./$(DEPDIR)/select-P.Po + -rm -f ./$(DEPDIR)/select.Po + -rm -f ./$(DEPDIR)/semop.Po + -rm -f ./$(DEPDIR)/sendfile.Po + -rm -f ./$(DEPDIR)/sendfile64.Po + -rm -f ./$(DEPDIR)/set_mempolicy.Po + -rm -f ./$(DEPDIR)/set_ptracer_any.Po + -rm -f ./$(DEPDIR)/set_sigblock.Po + -rm -f ./$(DEPDIR)/set_sigign.Po + -rm -f ./$(DEPDIR)/setdomainname.Po + -rm -f ./$(DEPDIR)/setfsgid.Po + -rm -f ./$(DEPDIR)/setfsgid32.Po + -rm -f ./$(DEPDIR)/setfsuid.Po + -rm -f ./$(DEPDIR)/setfsuid32.Po + -rm -f ./$(DEPDIR)/setgid.Po + -rm -f ./$(DEPDIR)/setgid32.Po + -rm -f ./$(DEPDIR)/setgroups.Po + -rm -f ./$(DEPDIR)/setgroups32.Po + -rm -f ./$(DEPDIR)/sethostname.Po + -rm -f ./$(DEPDIR)/setns.Po + -rm -f ./$(DEPDIR)/setregid.Po + -rm -f ./$(DEPDIR)/setregid32.Po + -rm -f ./$(DEPDIR)/setresgid.Po + -rm -f ./$(DEPDIR)/setresgid32.Po + -rm -f ./$(DEPDIR)/setresuid.Po + -rm -f ./$(DEPDIR)/setresuid32.Po + -rm -f ./$(DEPDIR)/setreuid.Po + -rm -f ./$(DEPDIR)/setreuid32.Po + -rm -f ./$(DEPDIR)/setrlimit-Xabbrev.Po + -rm -f ./$(DEPDIR)/setrlimit-Xraw.Po + -rm -f ./$(DEPDIR)/setrlimit-Xverbose.Po + -rm -f ./$(DEPDIR)/setrlimit.Po + -rm -f ./$(DEPDIR)/setuid.Po + -rm -f ./$(DEPDIR)/setuid32.Po + -rm -f ./$(DEPDIR)/shmxt.Po + -rm -f ./$(DEPDIR)/shutdown.Po + -rm -f ./$(DEPDIR)/sigaction.Po + -rm -f ./$(DEPDIR)/sigaltstack.Po + -rm -f ./$(DEPDIR)/siginfo.Po + -rm -f ./$(DEPDIR)/signal.Po + -rm -f ./$(DEPDIR)/signal_receive.Po + -rm -f ./$(DEPDIR)/signalfd4.Po + -rm -f ./$(DEPDIR)/sigpending.Po + -rm -f ./$(DEPDIR)/sigprocmask.Po + -rm -f ./$(DEPDIR)/sigreturn.Po + -rm -f ./$(DEPDIR)/sigsuspend.Po + -rm -f ./$(DEPDIR)/sleep.Po + -rm -f ./$(DEPDIR)/so_error.Po + -rm -f ./$(DEPDIR)/so_linger.Po + -rm -f ./$(DEPDIR)/so_peercred-Xabbrev.Po + -rm -f ./$(DEPDIR)/so_peercred-Xraw.Po + -rm -f ./$(DEPDIR)/so_peercred-Xverbose.Po + -rm -f ./$(DEPDIR)/so_peercred.Po + -rm -f ./$(DEPDIR)/sock_filter-v-Xabbrev.Po + -rm -f ./$(DEPDIR)/sock_filter-v-Xraw.Po + -rm -f ./$(DEPDIR)/sock_filter-v-Xverbose.Po + -rm -f ./$(DEPDIR)/sock_filter-v.Po + -rm -f ./$(DEPDIR)/sockaddr_xlat-Xabbrev.Po + -rm -f ./$(DEPDIR)/sockaddr_xlat-Xraw.Po + -rm -f ./$(DEPDIR)/sockaddr_xlat-Xverbose.Po + -rm -f ./$(DEPDIR)/socketcall.Po + -rm -f ./$(DEPDIR)/sockopt-sol_netlink.Po + -rm -f ./$(DEPDIR)/sockopt-timestamp.Po + -rm -f ./$(DEPDIR)/splice.Po + -rm -f ./$(DEPDIR)/stack-fcall-0.Po + -rm -f ./$(DEPDIR)/stack-fcall-1.Po + -rm -f ./$(DEPDIR)/stack-fcall-2.Po + -rm -f ./$(DEPDIR)/stack-fcall-3.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-0.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-1.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-2.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled-3.Po + -rm -f ./$(DEPDIR)/stack-fcall-mangled.Po + -rm -f ./$(DEPDIR)/stack-fcall.Po + -rm -f ./$(DEPDIR)/stat.Po + -rm -f ./$(DEPDIR)/stat64-stat64.Po + -rm -f ./$(DEPDIR)/statfs-statfs.Po + -rm -f ./$(DEPDIR)/statfs64.Po + -rm -f ./$(DEPDIR)/statx.Po + -rm -f ./$(DEPDIR)/swap.Po + -rm -f ./$(DEPDIR)/sxetmask.Po + -rm -f ./$(DEPDIR)/symlink.Po + -rm -f ./$(DEPDIR)/symlinkat.Po + -rm -f ./$(DEPDIR)/sync.Po + -rm -f ./$(DEPDIR)/sync_file_range.Po + -rm -f ./$(DEPDIR)/sync_file_range2.Po + -rm -f ./$(DEPDIR)/sysinfo.Po + -rm -f ./$(DEPDIR)/syslog.Po + -rm -f ./$(DEPDIR)/tee.Po + -rm -f ./$(DEPDIR)/threads-execve.Po + -rm -f ./$(DEPDIR)/time.Po + -rm -f ./$(DEPDIR)/timer_create.Po + -rm -f ./$(DEPDIR)/timer_xettime.Po + -rm -f ./$(DEPDIR)/timerfd_xettime.Po + -rm -f ./$(DEPDIR)/times-fail.Po + -rm -f ./$(DEPDIR)/times.Po + -rm -f ./$(DEPDIR)/truncate.Po + -rm -f ./$(DEPDIR)/truncate64-truncate64.Po + -rm -f ./$(DEPDIR)/ugetrlimit.Po + -rm -f ./$(DEPDIR)/uio-uio.Po + -rm -f ./$(DEPDIR)/umask.Po + -rm -f ./$(DEPDIR)/umount.Po + -rm -f ./$(DEPDIR)/umount2.Po + -rm -f ./$(DEPDIR)/umoven-illptr.Po + -rm -f ./$(DEPDIR)/umovestr-illptr.Po + -rm -f ./$(DEPDIR)/umovestr.Po + -rm -f ./$(DEPDIR)/umovestr2.Po + -rm -f ./$(DEPDIR)/umovestr3.Po + -rm -f ./$(DEPDIR)/uname.Po + -rm -f ./$(DEPDIR)/unblock_reset_raise.Po + -rm -f ./$(DEPDIR)/unix-pair-send-recv.Po + -rm -f ./$(DEPDIR)/unix-pair-sendto-recvfrom.Po + -rm -f ./$(DEPDIR)/unlink.Po + -rm -f ./$(DEPDIR)/unlinkat.Po + -rm -f ./$(DEPDIR)/unshare.Po + -rm -f ./$(DEPDIR)/userfaultfd.Po + -rm -f ./$(DEPDIR)/ustat.Po + -rm -f ./$(DEPDIR)/utime.Po + -rm -f ./$(DEPDIR)/utimensat-Xabbrev.Po + -rm -f ./$(DEPDIR)/utimensat-Xraw.Po + -rm -f ./$(DEPDIR)/utimensat-Xverbose.Po + -rm -f ./$(DEPDIR)/utimensat.Po + -rm -f ./$(DEPDIR)/utimes.Po + -rm -f ./$(DEPDIR)/vfork-f.Po + -rm -f ./$(DEPDIR)/vhangup.Po + -rm -f ./$(DEPDIR)/vmsplice.Po + -rm -f ./$(DEPDIR)/wait4-v.Po + -rm -f ./$(DEPDIR)/wait4.Po + -rm -f ./$(DEPDIR)/waitid-v.Po + -rm -f ./$(DEPDIR)/waitid.Po + -rm -f ./$(DEPDIR)/waitpid.Po + -rm -f ./$(DEPDIR)/xattr-strings.Po + -rm -f ./$(DEPDIR)/xattr.Po + -rm -f ./$(DEPDIR)/xet_robust_list.Po + -rm -f ./$(DEPDIR)/xet_thread_area_x86.Po + -rm -f ./$(DEPDIR)/xetitimer.Po + -rm -f ./$(DEPDIR)/xetpgid.Po + -rm -f ./$(DEPDIR)/xetpriority.Po + -rm -f ./$(DEPDIR)/xettimeofday.Po + -rm -f ./$(DEPDIR)/zeroargc.Po -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -5670,38 +10557,1624 @@ ps-am: uninstall-am: -.MAKE: check-am install-am install-strip +.MAKE: all check check-am install install-am install-strip -.PHONY: CTAGS GTAGS TAGS all all-am check check-TESTS check-am \ - check-valgrind-am check-valgrind-local clean \ +.PHONY: CTAGS GTAGS TAGS all all-am am--depfiles check check-TESTS \ + check-am check-valgrind-am check-valgrind-drd-am \ + check-valgrind-drd-local check-valgrind-helgrind-am \ + check-valgrind-helgrind-local check-valgrind-local \ + check-valgrind-memcheck-am check-valgrind-memcheck-local \ + check-valgrind-sgcheck-am check-valgrind-sgcheck-local clean \ clean-checkLIBRARIES clean-checkPROGRAMS clean-generic \ - cscopelist-am ctags ctags-am distclean distclean-compile \ - distclean-generic distclean-tags distdir dvi dvi-am html \ - html-am info info-am install install-am install-data \ - install-data-am install-dvi install-dvi-am install-exec \ - install-exec-am install-html install-html-am install-info \ - install-info-am install-man install-pdf install-pdf-am \ - install-ps install-ps-am install-strip installcheck \ - installcheck-am installdirs maintainer-clean \ + clean-local cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am recheck tags tags-am \ uninstall uninstall-am +.PRECIOUS: Makefile -@VALGRIND_CHECK_RULES@ -ksysent.h: $(srcdir)/ksysent.sed - echo '#include ' | \ - $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -dM - > $@.t1 - LC_COLLATE=C sed -r -n -f $(srcdir)/ksysent.sed < $@.t1 > $@.t2 - mv -f $@.t2 $@ - rm -f $@.t1 +$(srcdir)/_newselect.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ -ksysent.$(OBJEXT): ksysent.h -$(objects): scno.h +$(srcdir)/_newselect-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/accept.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/accept4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/access.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/acct.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/add_key.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/adjtimex.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/aio.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/aio_pgetevents.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/alarm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd-prog.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd-prog-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/btrfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chmod.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chown32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chroot.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock_adjtime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock_nanosleep.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock_xettime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/copy_file_range.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/creat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/delete_module.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dev-yy.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dup.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dup2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dup3.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_create.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_create1.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_ctl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_pwait.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_wait.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/erestartsys.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/execveat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/execveat-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/faccessat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fadvise64_64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fallocate.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_init.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchmod.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchmodat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchown32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchownat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fcntl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fcntl64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fdatasync.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/file_handle.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/file_ioctl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/finit_module.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/flock.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fork-f.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstatat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstatfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstatfs64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fsync.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fsync-y.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ftruncate.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ftruncate64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/futimesat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/get_mempolicy.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getcpu.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getcwd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getdents.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getdents64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getegid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getegid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/geteuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/geteuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgroups.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgroups32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getpeername.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getpgrp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getpid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getppid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getrandom.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getrlimit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getrusage.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getsid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getsockname.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/gettid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getxxid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/group_req.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/inet-cmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/init_module.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/inotify.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/inotify_init1.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/io_uring_enter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/io_uring_register.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/io_uring_setup.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_block.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_dm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_dm-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_evdev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_evdev-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_inotify.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_kvm_run.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_kvm_run-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_kvm_run_auxstr_vcpu.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_loop.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_loop-nv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_loop-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_mtd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_nbd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_nsfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_perf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_ptp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_random.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_rtc.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_rtc-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_scsi.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_sg_io_v3.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_sg_io_v4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_sock_gifconf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_uffdio.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_v4l2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioperm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/iopl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ip_mreq.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msgbuf-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msgbuf-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msgbuf-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kcmp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kcmp-y.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kern_features.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kexec_file_load.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kexec_load.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kill.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lchown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lchown32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/link.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/linkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lookup_dcookie.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lstat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/madvise.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mbind.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/membarrier.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/migrate_pages.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mincore.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mkdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mkdirat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mknod.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mknodat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mlock.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mlock2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mlockall.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg-silent.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg_name.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg_name-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/modify_ldt.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq_sendrecv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq_sendrecv-read.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq_sendrecv-write.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/msg_control.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/msg_control-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/msg_name.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/munlockall.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nanosleep.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-icmp_filter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-sockaddr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-tpacket_req.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-tpacket_stats.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-yy-inet6.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_audit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_crypto.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_generic.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_kobject_uevent.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_netfilter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_protocol.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_route.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_selinux.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_xfrm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/newfstatat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_acct.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_cthelper.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ctnetlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ctnetlink_exp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_cttimeout.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ipset.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_nft_compat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_nftables.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_osf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_queue.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ulog.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_br_port_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_crypto_user_alg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_dcbmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_fib_rule_hdr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifaddrlblmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifaddrmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifinfomsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_af_spec.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_brport.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_linkinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_port.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_xdp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_inet_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_inet_diag_req_compat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_inet_diag_req_v2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_mdba_mdb_entry.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_mdba_router_port.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ndmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ndtmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_netconfmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_netlink_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_nlmsgerr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_packet_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_rtgenmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_rtmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_smc_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tc_stats.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tca_stab.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tcamsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tcmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_unix_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-v-none.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldfstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldlstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect-efault.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect-efault-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/open.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/openat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/orphaned_process_group.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/osf_utimes.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pause.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/perf_event_open.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/perf_event_open_nonverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/perf_event_open_unabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/personality-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/personality-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/personality-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pidfd_send_signal.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pipe2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pkey_alloc.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pkey_free.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pkey_mprotect.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ppoll.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ppoll-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ppoll-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pread64-pwrite64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/preadv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/preadv-pwritev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/preadv2-pwritev2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printpath-umovestr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printpath-umovestr-peekdata.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printpath-umovestr-undumpable.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printsignal-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printsignal-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printsignal-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstrn-umoven.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstrn-umoven-peekdata.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstrn-umoven-undumpable.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/prlimit64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/process_vm_readv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/process_vm_writev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pselect6.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ptrace.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ptrace_syscall_info.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pwritev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-xfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-xfs-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/read-write.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readahead.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readlinkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/reboot.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/recvfrom.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/recvmmsg-timeout.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/recvmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/regex.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rename.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/renameat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/renameat2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/request_key.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/riscv_flush_icache.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rmdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigpending.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigprocmask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigqueueinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigreturn.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigsuspend.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigtimedwait.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_tgsigqueueinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_guarded_storage.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_guarded_storage-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_pci_mmio_read_write.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_runtime_instr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_sthyi.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_sthyi-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_get_priority_mxx.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_rr_get_interval.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetaffinity.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetattr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetparam.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetscheduler.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_yield.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/seccomp-filter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/seccomp-filter-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/seccomp_get_action_avail.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/select.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/select-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/semop.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sendfile.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sendfile64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/set_mempolicy.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setdomainname.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgroups.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgroups32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sethostname.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setns.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setregid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setregid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setreuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setreuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/shmxt.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/shutdown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigaction.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/siginfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/signal.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/signal_receive.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/signalfd4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigpending.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigprocmask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigreturn.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigsuspend.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_error.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_linger.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockaddr_xlat-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockaddr_xlat-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockaddr_xlat-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/socketcall.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockopt-sol_netlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockopt-timestamp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/splice.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/stat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/stat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/statfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/statfs64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/statx.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/swap.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sxetmask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/symlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/symlinkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sync.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sync_file_range.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sync_file_range2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sysinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/syslog.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/tee.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/time.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/timer_create.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/timer_xettime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/timerfd_xettime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/times.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/times-fail.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_fstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_fstatfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_lstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_regex_32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_regex_64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_regex_x32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_x32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_question.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_stat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_stat_like.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_statfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_statfs_like.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/truncate.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/truncate64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ugetrlimit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umoven-illptr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umovestr-illptr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umovestr3.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/unlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/unlinkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/unshare.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/userfaultfd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ustat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimes.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/vfork-f.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/vhangup.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/vmsplice.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/wait4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/wait4-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/waitid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/waitid-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/waitpid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xattr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xattr-strings.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xet_robust_list.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xetitimer.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xetpgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xetpriority.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xettimeofday.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +@VALGRIND_CHECK_RULES@ + +ksysent.h: $(srcdir)/ksysent.sed + echo '#include ' | \ + $(CPP) $(AM_CPPFLAGS) $(CPPFLAGS) -dM - > $@.t1 + LC_COLLATE=C sed -r -n -f $(srcdir)/ksysent.sed < $@.t1 > $@.t2 + mv -f $@.t2 $@ + rm -f $@.t1 + +ksysent.$(OBJEXT): ksysent.h +$(objects): scno.h + +clean-local: clean-local-check +.PHONY: clean-local-check +clean-local-check: + -rm -rf -- $(TESTS:.test=.dir) $(GEN_TESTS:.gen.test=.dir) + +.PHONY: check-valgrind-local +check-valgrind-local: $(check_LIBRARIES) $(check_PROGRAMS) -syscallent.i: $(top_srcdir)/$(OS)/$(ARCH)/syscallent.h - $(CPP) -P $(SCNO_CPPFLAGS) $^ -o $@ +syscallent.i: $(top_builddir)/config.h $(top_srcdir)/$(OS)/$(ARCH)/syscallent.h + $(CPP) -P $(SCNO_CPPFLAGS) -include $^ -o $@ scno.h: $(top_srcdir)/scno.head syscallent.i echo '/* Generated by Makefile from $^; do not edit. */' > $@-t diff --git a/tests/PTRACE_SEIZE.sh b/tests/PTRACE_SEIZE.sh new file mode 100755 index 00000000..9ffe4c78 --- /dev/null +++ b/tests/PTRACE_SEIZE.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# +# Skip the test if PTRACE_SEIZE is not supported. +# +# Copyright (c) 2014-2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +$STRACE -d -enone / > /dev/null 2> "$LOG" ||: +if grep -x "[^:]*strace: PTRACE_SEIZE doesn't work" "$LOG" > /dev/null; then + skip_ "PTRACE_SEIZE doesn't work" +fi diff --git a/tests/_newselect-P.c b/tests/_newselect-P.c new file mode 100644 index 00000000..561fbfe2 --- /dev/null +++ b/tests/_newselect-P.c @@ -0,0 +1,2 @@ +#define PATH_TRACING_FD 9 +#include "_newselect.c" diff --git a/tests/_newselect-P.gen.test b/tests/_newselect-P.gen.test new file mode 100755 index 00000000..9c4247a1 --- /dev/null +++ b/tests/_newselect-P.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (_newselect-P -e trace=_newselect -P /dev/full 9>>/dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=_newselect -P /dev/full 9>>/dev/full diff --git a/tests/_newselect.c b/tests/_newselect.c index ae2bc51a..bfba2edb 100644 --- a/tests/_newselect.c +++ b/tests/_newselect.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/_newselect.gen.test b/tests/_newselect.gen.test new file mode 100755 index 00000000..8e4d5f24 --- /dev/null +++ b/tests/_newselect.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (_newselect ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/_newselect.test b/tests/_newselect.test deleted file mode 100755 index 3371d4db..00000000 --- a/tests/_newselect.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check _newselect syscall decoding. - -. "${srcdir=.}/select.test" diff --git a/tests/accept.c b/tests/accept.c index 8d42ba15..df5dee80 100644 --- a/tests/accept.c +++ b/tests/accept.c @@ -2,34 +2,40 @@ * Check decoding of accept syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ -#ifndef TEST_SYSCALL_NAME -# define TEST_SYSCALL_NAME accept -#endif +#include "tests.h" + +#include + +#include + +#if defined __NR_accept + +# ifndef TEST_SYSCALL_NAME +# define TEST_SYSCALL_NAME do_accept + +# ifndef TEST_SYSCALL_STR +# define TEST_SYSCALL_STR "accept" +# endif + +int do_accept(int sockfd, void *addr, void *addrlen) +{ + return syscall(__NR_accept, sockfd, addr, addrlen); +} +# endif /* !TEST_SYSCALL_NAME */ + +#else /* !__NR_accept */ + +# ifndef TEST_SYSCALL_NAME +# define TEST_SYSCALL_NAME accept +# endif + +#endif /* __NR_accept */ #define TEST_SYSCALL_PREPARE connect_un() static void connect_un(void); diff --git a/tests/accept.gen.test b/tests/accept.gen.test new file mode 100755 index 00000000..45d9239e --- /dev/null +++ b/tests/accept.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (accept -a22 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests/accept.test b/tests/accept.test deleted file mode 100755 index b5e07904..00000000 --- a/tests/accept.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of accept syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a22 diff --git a/tests/accept4.c b/tests/accept4.c index d26e15c5..692b7661 100644 --- a/tests/accept4.c +++ b/tests/accept4.c @@ -1,30 +1,10 @@ /* * Check decoding of accept4 syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/accept4.gen.test b/tests/accept4.gen.test new file mode 100755 index 00000000..71199703 --- /dev/null +++ b/tests/accept4.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (accept4 -a37 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a37 diff --git a/tests/accept4.test b/tests/accept4.test deleted file mode 100755 index 722f25a5..00000000 --- a/tests/accept4.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of accept4 syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a37 diff --git a/tests/accept_compat.h b/tests/accept_compat.h new file mode 100644 index 00000000..0fbdc690 --- /dev/null +++ b/tests/accept_compat.h @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef _STRACE_TESTS_ACCEPT_COMPAT_H_ +# define _STRACE_TESTS_ACCEPT_COMPAT_H_ + +# include +# include +# include + +# if defined __NR_socketcall && defined __sparc__ +/* + * Work around the fact that + * - glibc >= 2.26 uses accept4 syscall to implement accept() call on sparc; + * - accept syscall had not been wired up on sparc until v4.4-rc8~4^2~1. + */ +static inline int +do_accept(int sockfd, struct sockaddr *addr, socklen_t *addrlen) +{ + const long args[] = { sockfd, (long) addr, (long) addrlen }; + + return syscall(__NR_socketcall, 5, args); +} +# else +# define do_accept accept +# endif + +#endif /* !_STRACE_TESTS_ACCEPT_COMPAT_H_ */ diff --git a/tests/access.c b/tests/access.c index e6f169b2..cbdde6a2 100644 --- a/tests/access.c +++ b/tests/access.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -19,6 +26,7 @@ main(void) printf("access(\"%s\", R_OK|W_OK|X_OK) = %ld %s (%m)\n", sample, rc, errno2name()); + puts("+++ exited with 0 +++"); return 0; } diff --git a/tests/access.gen.test b/tests/access.gen.test new file mode 100755 index 00000000..7d80e6f8 --- /dev/null +++ b/tests/access.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (access -a30 -P access_sample); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 -P access_sample diff --git a/tests/access.test b/tests/access.test deleted file mode 100755 index 3ab2eb4b..00000000 --- a/tests/access.test +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh - -# Check access syscall decoding. - -. "${srcdir=.}/init.sh" - -check_prog grep -run_prog > /dev/null -run_strace -eaccess -a30 $args > "$EXP" - -# Filter out access() calls made by libc. -grep -F access_sample < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests/acct.c b/tests/acct.c index 1cc3fa56..2127df60 100644 --- a/tests/acct.c +++ b/tests/acct.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/acct.gen.test b/tests/acct.gen.test new file mode 100755 index 00000000..4a98dd46 --- /dev/null +++ b/tests/acct.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (acct -a20 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests/acct.test b/tests/acct.test deleted file mode 100755 index b9bca754..00000000 --- a/tests/acct.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check acct syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 diff --git a/tests/add_key.c b/tests/add_key.c index d2696f9b..c1014927 100644 --- a/tests/add_key.c +++ b/tests/add_key.c @@ -2,29 +2,10 @@ * Check decoding of add_key syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -70,8 +51,7 @@ main(void) { static const char unterminated1[] = { '\1', '\2', '\3', '\4', '\5' }; static const char unterminated2[] = { '\6', '\7', '\10', '\11', '\12' }; - static const char unterminated3[] = - { '\16', '\17', '\20', '\21', '\22' }; + static const char unterminated3[] = { '\16', '\17', '\20', '\21', '\22' }; char *bogus_type = tail_memdup(unterminated1, sizeof(unterminated1)); char *bogus_desc = tail_memdup(unterminated2, sizeof(unterminated2)); @@ -102,7 +82,7 @@ main(void) { bogus_desc, NULL }, { ARG_STR("\25\26\27\30\31") }, { ARG_STR("desc") }, - { "overly long description", _STR("overly long ") "..." }, + { "overly long description", STRINGIFY("overly long ") "..." }, }; struct { @@ -113,10 +93,10 @@ main(void) { ARG_STR(NULL), 0 }, { bogus_payload + sizeof(unterminated3), NULL, (size_t) 0xdeadbeefbadc0dedULL }, - { bogus_payload, _STR(""), 0 }, - { bogus_payload, _STR("\16\17\20\21\22"), 5 }, + { bogus_payload, STRINGIFY(""), 0 }, + { bogus_payload, STRINGIFY("\16\17\20\21\22"), 5 }, { bogus_payload, NULL, 10 }, - { "overly long payload", _STR("overly long ") "...", 15 }, + { "overly long payload", STRINGIFY("overly long ") "...", 15 }, }; struct { diff --git a/tests/add_key.gen.test b/tests/add_key.gen.test new file mode 100755 index 00000000..d6ffbc86 --- /dev/null +++ b/tests/add_key.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (add_key -a30 -s12); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 -s12 diff --git a/tests/add_key.test b/tests/add_key.test deleted file mode 100755 index eadd8c2b..00000000 --- a/tests/add_key.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of add_key syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a30 -s12 diff --git a/tests/adjtimex.c b/tests/adjtimex.c index 1638b535..87d3acdc 100644 --- a/tests/adjtimex.c +++ b/tests/adjtimex.c @@ -1,70 +1,56 @@ /* * This file is part of adjtimex strace test. * - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2019 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" +#include #include #include #include #include +#include "xlat.h" +#include "xlat/adjtimex_state.h" +#include "xlat/adjtimex_status.h" + int main(void) { - adjtimex(NULL); - printf("adjtimex\\(NULL\\) = -1 EFAULT \\(%m\\)\n"); + int state = adjtimex(NULL); + printf("adjtimex(NULL) = %s\n", sprintrc(state)); - struct timex * const tx = tail_alloc(sizeof(*tx)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timex, tx); memset(tx, 0, sizeof(*tx)); - int state = adjtimex(tx); + state = adjtimex(tx); if (state < 0) perror_msg_and_skip("adjtimex"); - printf("adjtimex\\(\\{modes=0, offset=%jd, freq=%jd, maxerror=%jd" - ", esterror=%jd, status=%s, constant=%jd, precision=%jd" - ", tolerance=%jd, time=\\{tv_sec=%jd, tv_usec=%jd\\}, tick=%jd, " - "ppsfreq=%jd, jitter=%jd, shift=%d, stabil=%jd, jitcnt=%jd, " - "calcnt=%jd, errcnt=%jd, stbcnt=%jd" -#ifdef HAVE_STRUCT_TIMEX_TAI - ", tai=%d" -#endif - "\\}\\) = %d \\(TIME_[A-Z]+\\)\n", + printf("adjtimex({modes=0, offset=%jd, freq=%jd, maxerror=%jd" + ", esterror=%jd, status=", (intmax_t) tx->offset, (intmax_t) tx->freq, (intmax_t) tx->maxerror, - (intmax_t) tx->esterror, - tx->status ? "STA_[A-Z]+(\\|STA_[A-Z]+)*" : "0", + (intmax_t) tx->esterror); + if (tx->status) + printflags(adjtimex_status, (unsigned int) tx->status, NULL); + else + putchar('0'); + printf(", constant=%jd, precision=%jd" + ", tolerance=%jd, time={tv_sec=%lld, tv_usec=%llu}, tick=%jd" + ", ppsfreq=%jd, jitter=%jd, shift=%d, stabil=%jd, jitcnt=%jd" + ", calcnt=%jd, errcnt=%jd, stbcnt=%jd, tai=%d" + "}) = %d (", (intmax_t) tx->constant, (intmax_t) tx->precision, (intmax_t) tx->tolerance, - (intmax_t) tx->time.tv_sec, - (intmax_t) tx->time.tv_usec, + (long long) tx->time.tv_sec, + zero_extend_signed_to_ull(tx->time.tv_usec), (intmax_t) tx->tick, (intmax_t) tx->ppsfreq, (intmax_t) tx->jitter, @@ -76,8 +62,13 @@ main(void) (intmax_t) tx->stbcnt, #ifdef HAVE_STRUCT_TIMEX_TAI tx->tai, +#else + *(const int *)((const void *) tx + offsetofend(struct timex, stbcnt)), #endif state); + printxval(adjtimex_state, (unsigned int) state, NULL); + puts(")"); + puts("+++ exited with 0 +++"); return 0; } diff --git a/tests/adjtimex.gen.test b/tests/adjtimex.gen.test new file mode 100755 index 00000000..e6024431 --- /dev/null +++ b/tests/adjtimex.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (adjtimex -a15 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests/adjtimex.test b/tests/adjtimex.test deleted file mode 100755 index 01405501..00000000 --- a/tests/adjtimex.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check adjtimex syscall decoding. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a 15 -e adjtimex $args > "$OUT" -match_grep "$LOG" "$OUT" -rm -f "$OUT" - -exit 0 diff --git a/tests/aio.c b/tests/aio.c index 0766d23a..13821998 100644 --- a/tests/aio.c +++ b/tests/aio.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -198,15 +179,14 @@ main(void) }; const long *cbvs2 = tail_memdup(proto_cbvs2, sizeof(proto_cbvs2)); - unsigned long *ctx = tail_alloc(sizeof(unsigned long)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned long, ctx); *ctx = 0; const unsigned int nr = ARRAY_SIZE(proto_cb); const unsigned long lnr = (unsigned long) (0xdeadbeef00000000ULL | nr); const struct io_event *ev = tail_alloc(nr * sizeof(struct io_event)); - const struct timespec proto_ts = { .tv_nsec = 123456789 }; - const struct timespec *ts = tail_memdup(&proto_ts, sizeof(proto_ts)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, ts); (void) close(0); if (open("/dev/zero", O_RDONLY)) @@ -239,11 +219,12 @@ main(void) if (rc != (long) nr) perror_msg_and_skip("io_submit"); printf("io_submit(%#lx, %u, [" - "{data=%#" PRI__x64 ", pread, reqprio=11, fildes=0, " - "buf=%p, nbytes=%u, offset=%" PRI__d64 "}, " - "{data=%#" PRI__x64 ", pread, reqprio=22, fildes=0, " - "buf=%p, nbytes=%u, offset=%" PRI__d64 "}" - "]) = %s\n", + "{aio_data=%#" PRI__x64 ", aio_lio_opcode=IOCB_CMD_PREAD" + ", aio_reqprio=11, aio_fildes=0, aio_buf=%p, aio_nbytes=%u" + ", aio_offset=%" PRI__d64 + "}, {aio_data=%#" PRI__x64 ", aio_lio_opcode=IOCB_CMD_PREAD" + ", aio_reqprio=22, aio_fildes=0, aio_buf=%p, aio_nbytes=%u" + ", aio_offset=%" PRI__d64 "}]) = %s\n", *ctx, nr, cb[0].aio_data, data0, sizeof_data0, cb[0].aio_offset, cb[1].aio_data, data1, sizeof_data1, cb[1].aio_offset, @@ -263,6 +244,24 @@ main(void) bogus_ctx, (long) 0xca7faceddeadf00dLL, (long) 0xba5e1e505ca571e0LL, ts + 1, sprintrc(rc)); + ts->tv_sec = 0xdeadbeefU; + ts->tv_nsec = 0xfacefeedU; + rc = syscall(__NR_io_getevents, bogus_ctx, 0, 0, 0, ts); + printf("io_getevents(%#lx, 0, 0, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + bogus_ctx, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), sprintrc(rc)); + + ts->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + ts->tv_nsec = (long) 0xbadc0dedfacefeedLL; + rc = syscall(__NR_io_getevents, bogus_ctx, 0, 0, 0, ts); + printf("io_getevents(%#lx, 0, 0, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + bogus_ctx, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), sprintrc(rc)); + + ts->tv_sec = 0; + ts->tv_nsec = 123456789; rc = syscall(__NR_io_getevents, *ctx, nr, nr + 1, ev, ts); printf("io_getevents(%#lx, %ld, %ld, [" "{data=%#" PRI__x64 ", obj=%p, res=%u, res2=0}, " @@ -281,8 +280,9 @@ main(void) sprintrc(rc)); rc = syscall(__NR_io_cancel, *ctx, cbc, ev); - printf("io_cancel(%#lx, {data=%#" PRI__x64 - ", pread, reqprio=99, fildes=-42}, %p) = %s\n", + printf("io_cancel(%#lx, {aio_data=%#" PRI__x64 + ", aio_lio_opcode=IOCB_CMD_PREAD, aio_reqprio=99" + ", aio_fildes=-42}, %p) = %s\n", *ctx, cbc->aio_data, ev, sprintrc(rc)); rc = syscall(__NR_io_submit, (unsigned long) 0xfacef157beeff00dULL, @@ -295,23 +295,26 @@ main(void) printf("io_submit(%#lx, %ld, %p) = %s\n", *ctx, -1L, cbvs + nr, sprintrc(rc)); - rc = syscall(__NR_io_submit, *ctx, 1057L, cbvs2); printf("io_submit(%#lx, %ld, [" - "{data=%#" PRI__x64 ", key=%u, %hu /* SUB_??? */, fildes=%d}, " - "{key=%u, pwrite, reqprio=%hd, fildes=%d, str=NULL" - ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 + "{aio_data=%#" PRI__x64 ", aio_key=%u" + ", aio_lio_opcode=%hu /* IOCB_CMD_??? */, aio_fildes=%d}" + ", {aio_key=%u, aio_lio_opcode=IOCB_CMD_PWRITE, aio_reqprio=%hd" + ", aio_fildes=%d, aio_buf=NULL" + ", aio_nbytes=%" PRI__u64 ", aio_offset=%" PRI__d64 # ifdef IOCB_FLAG_RESFD - ", resfd=%d, flags=%#x" + ", aio_resfd=%d, aio_flags=%#x" # endif - "}, " - "{key=%u, pwrite, reqprio=%hd, fildes=%d, buf=%#" PRI__x64 - ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}, " - "{key=%u, pwrite, reqprio=%hd, fildes=%d" - ", str=\"\\0\\1\\2\\3%.28s\"..." - ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}, " - "{key=%u, pwritev, reqprio=%hd, fildes=%d, buf=%#" PRI__x64 - ", nbytes=%" PRI__u64 ", offset=%" PRI__d64 "}" - ", {NULL}, {%#lx}, %p]) = %s\n", + "}, {aio_key=%u, aio_lio_opcode=IOCB_CMD_PWRITE" + ", aio_reqprio=%hd, aio_fildes=%d, aio_buf=%#" PRI__x64 + ", aio_nbytes=%" PRI__u64 ", aio_offset=%" PRI__d64 + "}, {aio_key=%u, aio_lio_opcode=IOCB_CMD_PWRITE" + ", aio_reqprio=%hd, aio_fildes=%d" + ", aio_buf=\"\\0\\1\\2\\3%.28s\"..." + ", aio_nbytes=%" PRI__u64 ", aio_offset=%" PRI__d64 + "}, {aio_key=%u, aio_lio_opcode=IOCB_CMD_PWRITEV" + ", aio_reqprio=%hd, aio_fildes=%d, aio_buf=%#" PRI__x64 + ", aio_nbytes=%" PRI__u64 ", aio_offset=%" PRI__d64 + "}, NULL, %#lx, ... /* %p */]) = ", *ctx, 1057L, cbv2[0].aio_data, cbv2[0].aio_key, cbv2[0].aio_lio_opcode, cbv2[0].aio_fildes, @@ -326,18 +329,22 @@ main(void) data2 + 4, cbv2[3].aio_nbytes, cbv2[3].aio_offset, cbv2[4].aio_key, cbv2[4].aio_reqprio, cbv2[4].aio_fildes, cbv2[4].aio_buf, cbv2[4].aio_nbytes, cbv2[4].aio_offset, - cbvs2[6], cbvs2 + 7, sprintrc(rc)); + cbvs2[6], cbvs2 + 7); + rc = syscall(__NR_io_submit, *ctx, 1057L, cbvs2); + puts(sprintrc(rc)); rc = syscall(__NR_io_submit, *ctx, nr, cbvs); if (rc != (long) nr) perror_msg_and_skip("io_submit"); printf("io_submit(%#lx, %u, [" - "{data=%#" PRI__x64 ", preadv, reqprio=%hd, fildes=0, " - "iovec=[{iov_base=%p, iov_len=%u}" - ", {iov_base=%p, iov_len=%u}], offset=%" PRI__d64 "}, " - "{data=%#" PRI__x64 ", preadv, reqprio=%hd, fildes=0, " - "iovec=[{iov_base=%p, iov_len=%u}" - ", {iov_base=%p, iov_len=%u}], offset=%" PRI__d64 "}" + "{aio_data=%#" PRI__x64 ", aio_lio_opcode=IOCB_CMD_PREADV" + ", aio_reqprio=%hd, aio_fildes=0, " + "aio_buf=[{iov_base=%p, iov_len=%u}" + ", {iov_base=%p, iov_len=%u}], aio_offset=%" PRI__d64 "}, " + "{aio_data=%#" PRI__x64 ", aio_lio_opcode=IOCB_CMD_PREADV" + ", aio_reqprio=%hd, aio_fildes=0" + ", aio_buf=[{iov_base=%p, iov_len=%u}" + ", {iov_base=%p, iov_len=%u}], aio_offset=%" PRI__d64 "}" "]) = %s\n", *ctx, nr, cbv[0].aio_data, cbv[0].aio_reqprio, diff --git a/tests/aio.gen.test b/tests/aio.gen.test new file mode 100755 index 00000000..8c8cbd5c --- /dev/null +++ b/tests/aio.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (aio -a14 -e trace=io_setup,io_submit,io_getevents,io_cancel,io_destroy); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 -e trace=io_setup,io_submit,io_getevents,io_cancel,io_destroy diff --git a/tests/aio.test b/tests/aio.test deleted file mode 100755 index 2ba90da8..00000000 --- a/tests/aio.test +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -# Check io_* syscalls decoding. - -. "${srcdir=.}/init.sh" - -syscalls=io_setup,io_submit,io_getevents,io_cancel,io_destroy -run_strace_match_diff -a14 -e trace=$syscalls diff --git a/tests/aio_pgetevents.c b/tests/aio_pgetevents.c new file mode 100644 index 00000000..8bea0b7b --- /dev/null +++ b/tests/aio_pgetevents.c @@ -0,0 +1,170 @@ +/* + * Check decoding of io_pgetevents syscall. + * + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include "scno.h" + +#if defined __NR_io_setup && defined __NR_io_pgetevents + +# include +# include +# include +# include + +# include "nsig.h" + +# include + +# if !HAVE_STRUCT___AIO_SIGSET +struct __aio_sigset { + sigset_t *sigmask; + size_t sigsetsize; +}; +# endif + +static const char *errstr; + +static long +sys_io_pgetevents(const kernel_ulong_t ctx_id, + const kernel_long_t min_nr, + const kernel_long_t nr, + const kernel_ulong_t events, + const kernel_ulong_t timeout, + const kernel_ulong_t usig) +{ + long rc = syscall(__NR_io_pgetevents, ctx_id, min_nr, nr, + events, timeout, usig); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const kernel_ulong_t bogus_ctx = + (kernel_ulong_t) 0xface1e55deadbeefLL; + static const kernel_long_t bogus_min_nr = + (kernel_long_t) 0xca7faceddeadf00dLL; + static const kernel_long_t bogus_nr = + (kernel_long_t) 0xba5e1e505ca571e0LL; + static const size_t bogus_sigsetsize = + (size_t) 0xdeadbeefbadcaffeULL; + + const unsigned int sizeof_data0 = 4096; + const unsigned int sizeof_data1 = 8192; + void *data0 = tail_alloc(sizeof_data0); + void *data1 = tail_alloc(sizeof_data1); + + const struct iocb proto_cb[] = { + { + .aio_data = (unsigned long) 0xfeedface11111111ULL, + .aio_reqprio = 11, + .aio_buf = (unsigned long) data0, + .aio_offset = (unsigned long) 0xdeface1facefeedULL, + .aio_nbytes = sizeof_data0 + }, + { + .aio_data = (unsigned long) 0xfeedface22222222ULL, + .aio_reqprio = 22, + .aio_buf = (unsigned long) data1, + .aio_offset = (unsigned long) 0xdeface2cafef00dULL, + .aio_nbytes = sizeof_data1 + } + }; + const struct iocb *cb = tail_memdup(proto_cb, sizeof(proto_cb)); + + const long proto_cbs[] = { + (long) &cb[0], (long) &cb[1] + }; + const long *cbs = tail_memdup(proto_cbs, sizeof(proto_cbs)); + + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned long, ctx); + *ctx = 0; + + const unsigned int nr = ARRAY_SIZE(proto_cb); + + const struct io_event *ev = tail_alloc(nr * sizeof(struct io_event)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, ts); + TAIL_ALLOC_OBJECT_CONST_PTR(struct __aio_sigset, ss); + TAIL_ALLOC_OBJECT_CONST_PTR(sigset_t, sigs); + + (void) close(0); + if (open("/dev/zero", O_RDONLY)) + perror_msg_and_skip("open: %s", "/dev/zero"); + + if (syscall(__NR_io_setup, nr, ctx)) + perror_msg_and_skip("io_setup"); + + if (syscall(__NR_io_submit, *ctx, nr, cbs) != (long) nr) + perror_msg_and_skip("io_submit"); + + sys_io_pgetevents(bogus_ctx, bogus_min_nr, bogus_nr, + (uintptr_t) (ev + 1), 0, 0); + printf("io_pgetevents(%#jx, %ld, %ld, %p, NULL, NULL) = %s\n", + (uintmax_t) bogus_ctx, (long) bogus_min_nr, + (long) bogus_nr, ev + 1, errstr); + + sys_io_pgetevents(bogus_ctx, bogus_min_nr, bogus_nr, + 0, (uintptr_t) (ts + 1), 0); + printf("io_pgetevents(%#jx, %ld, %ld, NULL, %p, NULL) = %s\n", + (uintmax_t) bogus_ctx, (long) bogus_min_nr, + (long) bogus_nr, ts + 1, errstr); + + sys_io_pgetevents(bogus_ctx, bogus_min_nr, bogus_nr, + 0, 0, (uintptr_t) (ss + 1)); + printf("io_pgetevents(%#jx, %ld, %ld, NULL, NULL, %p) = %s\n", + (uintmax_t) bogus_ctx, (long) bogus_min_nr, + (long) bogus_nr, ss + 1, errstr); + + ss->sigmask = sigs + 1; + ss->sigsetsize = bogus_sigsetsize; + sys_io_pgetevents(bogus_ctx, bogus_min_nr, bogus_nr, + 0, 0, (uintptr_t) ss); + printf("io_pgetevents(%#jx, %ld, %ld, NULL, NULL" + ", {sigmask=%p, sigsetsize=%zu}) = %s\n", + (uintmax_t) bogus_ctx, (long) bogus_min_nr, + (long) bogus_nr, sigs + 1, bogus_sigsetsize, errstr); + + ts->tv_sec = 0xdeadbeefU; + ts->tv_nsec = 0xfacefeedU; + ss->sigmask = sigs; + ss->sigsetsize = NSIG_BYTES; + sys_io_pgetevents(bogus_ctx, 0, 0, 0, (uintptr_t) ts, (uintptr_t) ss); + printf("io_pgetevents(%#jx, 0, 0, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}" + ", {sigmask=~[], sigsetsize=%u}) = %s\n", + (uintmax_t) bogus_ctx, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), NSIG_BYTES, + errstr); + + sigemptyset(sigs); + sigaddset(sigs, SIGSYS); + + ts->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + ts->tv_nsec = (long) 0xbadc0dedfacefeedLL; + sys_io_pgetevents(bogus_ctx, 0, 0, 0, (uintptr_t) ts, (uintptr_t) ss); + printf("io_pgetevents(%#jx, 0, 0, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}" + ", {sigmask=[SYS], sigsetsize=%u}) = %s\n", + (uintmax_t) bogus_ctx, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), NSIG_BYTES, + errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_io_setup && __NR_io_pgetevents") + +#endif diff --git a/tests/aio_pgetevents.gen.test b/tests/aio_pgetevents.gen.test new file mode 100755 index 00000000..7ea3874d --- /dev/null +++ b/tests/aio_pgetevents.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (aio_pgetevents -e trace=io_pgetevents); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=io_pgetevents diff --git a/tests/alarm.c b/tests/alarm.c index 291b26ad..35404535 100644 --- a/tests/alarm.c +++ b/tests/alarm.c @@ -1,30 +1,10 @@ /* * This file is part of alarm strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/alarm.gen.test b/tests/alarm.gen.test new file mode 100755 index 00000000..25982e14 --- /dev/null +++ b/tests/alarm.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (alarm -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests/alarm.test b/tests/alarm.test deleted file mode 100755 index 267b2239..00000000 --- a/tests/alarm.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check alarm syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 diff --git a/tests/answer.c b/tests/answer.c index ae3059a4..a69adc39 100644 --- a/tests/answer.c +++ b/tests/answer.c @@ -1,30 +1,10 @@ /* * Check decoding of fault injected exit_group syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/attach-f-p-cmd.c b/tests/attach-f-p-cmd.c index 77594beb..ab293839 100644 --- a/tests/attach-f-p-cmd.c +++ b/tests/attach-f-p-cmd.c @@ -2,29 +2,10 @@ * This file is part of attach-f-p strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -34,6 +15,8 @@ int main(void) { + skip_if_unavailable("/proc/self/task/"); + static const char dir[] = "attach-f-p.test cmd"; pid_t pid = getpid(); int rc = chdir(dir); diff --git a/tests/attach-f-p.c b/tests/attach-f-p.c index 3f9a7e3e..3b7aed85 100644 --- a/tests/attach-f-p.c +++ b/tests/attach-f-p.c @@ -1,30 +1,10 @@ /* * This file is part of attach-f-p strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/attach-f-p.test b/tests/attach-f-p.test index f4170740..b7a4a0d1 100755 --- a/tests/attach-f-p.test +++ b/tests/attach-f-p.test @@ -3,48 +3,24 @@ # Check that -f -p attaches to threads properly. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -# strace -f -p is implemented using /proc/$pid/task/ -[ -d /proc/self/task/ ] || - framework_skip_ '/proc/self/task/ is not available' run_prog_skip_if_failed \ kill -0 $$ -run_prog ./attach-f-p-cmd > /dev/null +run_prog ../attach-f-p-cmd > /dev/null -rm -f "$OUT" -./set_ptracer_any sh -c "exec ./attach-f-p >> $OUT" > /dev/null & +../set_ptracer_any sh -c "exec ../attach-f-p >> $EXP" > /dev/null & tracee_pid=$! -while ! [ -s "$OUT" ]; do +while ! [ -s "$EXP" ]; do kill -0 $tracee_pid 2> /dev/null || fail_ 'set_ptracer_any sh failed' done -run_strace -a32 -f -echdir -p $tracee_pid ./attach-f-p-cmd > "$OUT" -match_diff "$LOG" "$OUT" -rm -f "$OUT" +run_strace -a32 -f -echdir -p $tracee_pid ../attach-f-p-cmd > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests/attach-p-cmd-cmd.c b/tests/attach-p-cmd-cmd.c index d0f824e9..aa0f3f58 100644 --- a/tests/attach-p-cmd-cmd.c +++ b/tests/attach-p-cmd-cmd.c @@ -1,30 +1,10 @@ /* * This file is part of attach-p-cmd strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,19 +12,41 @@ #include #include #include +#include "attach-p-cmd.h" -int -main(void) +static void +write_pidfile(const pid_t pid) +{ + FILE *fp = fopen(pidfile, "w"); + if (!fp) + perror_msg_and_fail("fopen: %s", pidfile); + + if (fprintf(fp, "%d", pid) < 0) + perror_msg_and_fail("fprintf: %s", pidfile); + + if (fclose(fp)) + perror_msg_and_fail("fclose: %s", pidfile); +} + +static void +wait_for_peer_invocation(void) { - static const char lockdir[] = "attach-p-cmd.test-lock"; /* wait for the lock directory to be created by peer */ while (rmdir(lockdir)) { if (ENOENT != errno) perror_msg_and_fail("rmdir: %s", lockdir); } +} + +int +main(void) +{ + const pid_t pid = getpid(); + write_pidfile(pid); + + wait_for_peer_invocation(); static const char dir[] = "attach-p-cmd.test cmd"; - pid_t pid = getpid(); int rc = chdir(dir); printf("%-5d chdir(\"%s\") = %s\n" diff --git a/tests/attach-p-cmd-p.c b/tests/attach-p-cmd-p.c index 254d19ae..5fde01e2 100644 --- a/tests/attach-p-cmd-p.c +++ b/tests/attach-p-cmd-p.c @@ -1,30 +1,10 @@ /* * This file is part of attach-p-cmd strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -33,27 +13,14 @@ #include #include #include +#include #include +#include "attach-p-cmd.h" static void -handler(int signo) -{ -} - -int -main(void) +wait_for_peer_invocation(void) { - const struct sigaction act = { .sa_handler = handler }; - if (sigaction(SIGALRM, &act, NULL)) - perror_msg_and_fail("sigaction"); - - sigset_t mask = {}; - sigaddset(&mask, SIGALRM); - if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) - perror_msg_and_fail("sigprocmask"); - - static const char lockdir[] = "attach-p-cmd.test-lock"; - /* create a lock directory */ + /* create the lock directory */ if (mkdir(lockdir, 0700)) perror_msg_and_fail("mkdir: %s", lockdir); @@ -63,21 +30,51 @@ main(void) perror_msg_and_fail("mkdir: %s", lockdir); } - /* remove the lock directory */ + /* cleanup the lock directory */ if (rmdir(lockdir)) perror_msg_and_fail("rmdir: %s", lockdir); +} + +static void +wait_for_peer_termination(void) +{ + FILE *fp = fopen(pidfile, "r"); + if (!fp) + perror_msg_and_fail("fopen: %s", pidfile); + + pid_t pid; + if (fscanf(fp, "%d", &pid) < 0) + perror_msg_and_fail("fscanf: %s", pidfile); + if (pid < 0) + error_msg_and_fail("pid = %d", pid); + + if (fclose(fp)) + perror_msg_and_fail("fclose: %s", pidfile); + + if (unlink(pidfile)) + perror_msg_and_fail("unlink: %s", pidfile); + + while (kill(pid, 0) == 0) + ; +} + +int +main(void) +{ + wait_for_peer_invocation(); + wait_for_peer_termination(); - alarm(1); - pause(); + static const struct timespec ts = { .tv_nsec = 123456789 }; + if (nanosleep(&ts, NULL)) + perror_msg_and_fail("nanosleep"); static const char dir[] = "attach-p-cmd.test -p"; pid_t pid = getpid(); int rc = chdir(dir); - printf("%-5d --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---\n" - "%-5d chdir(\"%s\") = %d %s (%m)\n" + printf("%-5d chdir(\"%s\") = %s\n" "%-5d +++ exited with 0 +++\n", - pid, pid, dir, rc, errno2name(), pid); + pid, dir, sprintrc(rc), pid); return 0; } diff --git a/tests/attach-p-cmd.h b/tests/attach-p-cmd.h new file mode 100644 index 00000000..5f27cd10 --- /dev/null +++ b/tests/attach-p-cmd.h @@ -0,0 +1,9 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +static const char lockdir[] = "attach-p-cmd.test-lock"; +static const char pidfile[] = "attach-p-cmd.test-pid"; diff --git a/tests/attach-p-cmd.test b/tests/attach-p-cmd.test index 2068cf1d..6240ca94 100755 --- a/tests/attach-p-cmd.test +++ b/tests/attach-p-cmd.test @@ -3,45 +3,23 @@ # Check that simultaneous use of -p option and tracing of a command works. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog_skip_if_failed \ kill -0 $$ -rm -rf attach-p-cmd.test-lock -rm -f "$OUT" -./set_ptracer_any ./attach-p-cmd-p >> "$OUT" & +../set_ptracer_any ../attach-p-cmd-p >> "$EXP" & tracee_pid=$! -while ! [ -s "$OUT" ]; do +while ! [ -s "$EXP" ]; do kill -0 $tracee_pid 2> /dev/null || - fail_ 'set_ptracer_any ./attach-p-cmd-p failed' + fail_ 'set_ptracer_any ../attach-p-cmd-p failed' done -run_strace -a30 -echdir -p $tracee_pid ./attach-p-cmd-cmd > "$OUT" -match_diff "$LOG" "$OUT" -rm -f "$OUT" +run_strace -a30 -echdir -p $tracee_pid ../attach-p-cmd-cmd > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests/bexecve.test b/tests/bexecve.test index f1ab04f1..7a135871 100755 --- a/tests/bexecve.test +++ b/tests/bexecve.test @@ -3,29 +3,10 @@ # Check -bexecve behavior. # # Copyright (c) 2015 Dmitry V. Levin +# Copyright (c) 2015-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -35,14 +16,14 @@ run_strace_redir() $STRACE "$@" 2> "$LOG" } -run_strace_redir -enone ./set_ptracer_any true || +run_strace_redir -enone ../set_ptracer_any true || dump_log_and_fail_with "$STRACE $args: unexpected exit status" -run_strace_redir -enone ./set_ptracer_any false +run_strace_redir -enone ../set_ptracer_any false [ $? -eq 1 ] || dump_log_and_fail_with "$STRACE $args: unexpected exit status" -run_strace_redir -bexecve -enone ./set_ptracer_any false || +run_strace_redir -bexecve -enone ../set_ptracer_any false || dump_log_and_fail_with "$STRACE $args: unexpected exit status" pattern_detached='[^:]*strace: Process [1-9][0-9]* detached' diff --git a/tests/block_reset_raise_run.c b/tests/block_reset_raise_run.c new file mode 100644 index 00000000..45387b9e --- /dev/null +++ b/tests/block_reset_raise_run.c @@ -0,0 +1,35 @@ +/* + * Execute a command with blocked, reset, and raised signal. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +int +main(int ac, char **av) +{ + if (ac < 3) + error_msg_and_fail("usage: block_reset_raise_run signo path..."); + + sigset_t mask; + sigemptyset(&mask); + const int signo = atoi(av[1]); + if (sigaddset(&mask, signo)) + perror_msg_and_fail("sigaddset: %s", av[1]); + if (sigprocmask(SIG_BLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + if (signal(signo, SIG_DFL) == SIG_ERR) + perror_msg_and_fail("signal: %s", av[1]); + if (raise(signo)) + perror_msg_and_fail("raise: %s", av[1]); + + execvp(av[2], av + 2); + perror_msg_and_fail("execvp: %s", av[2]); +} diff --git a/tests/bpf-obj_get_info_by_fd-prog-v.c b/tests/bpf-obj_get_info_by_fd-prog-v.c new file mode 100644 index 00000000..d7e10b43 --- /dev/null +++ b/tests/bpf-obj_get_info_by_fd-prog-v.c @@ -0,0 +1,3 @@ +#define CHECK_OBJ_PROG 1 +#define VERBOSE 1 +#include "bpf-obj_get_info_by_fd.c" diff --git a/tests/bpf-obj_get_info_by_fd-prog-v.gen.test b/tests/bpf-obj_get_info_by_fd-prog-v.gen.test new file mode 100755 index 00000000..fcaa1d8b --- /dev/null +++ b/tests/bpf-obj_get_info_by_fd-prog-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (bpf-obj_get_info_by_fd-prog-v -a20 -y -v -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -y -v -e trace=bpf diff --git a/tests/bpf-obj_get_info_by_fd-prog.c b/tests/bpf-obj_get_info_by_fd-prog.c new file mode 100644 index 00000000..19a5f75a --- /dev/null +++ b/tests/bpf-obj_get_info_by_fd-prog.c @@ -0,0 +1,2 @@ +#define CHECK_OBJ_PROG 1 +#include "bpf-obj_get_info_by_fd.c" diff --git a/tests/bpf-obj_get_info_by_fd-prog.gen.test b/tests/bpf-obj_get_info_by_fd-prog.gen.test new file mode 100755 index 00000000..8cbd7c04 --- /dev/null +++ b/tests/bpf-obj_get_info_by_fd-prog.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (bpf-obj_get_info_by_fd-prog -a20 -y -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -y -e trace=bpf diff --git a/tests/bpf-obj_get_info_by_fd-v.c b/tests/bpf-obj_get_info_by_fd-v.c new file mode 100644 index 00000000..2debc5f1 --- /dev/null +++ b/tests/bpf-obj_get_info_by_fd-v.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "bpf-obj_get_info_by_fd.c" diff --git a/tests/bpf-obj_get_info_by_fd-v.gen.test b/tests/bpf-obj_get_info_by_fd-v.gen.test new file mode 100755 index 00000000..255d91e9 --- /dev/null +++ b/tests/bpf-obj_get_info_by_fd-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (bpf-obj_get_info_by_fd-v -a20 -y -v -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -y -v -e trace=bpf diff --git a/tests/bpf-obj_get_info_by_fd.c b/tests/bpf-obj_get_info_by_fd.c new file mode 100644 index 00000000..3e18591d --- /dev/null +++ b/tests/bpf-obj_get_info_by_fd.c @@ -0,0 +1,608 @@ +/* + * Check bpf(BPF_OBJ_GET_INFO_BY_FD) decoding. + * + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifndef CHECK_OBJ_PROG +# define CHECK_OBJ_PROG 0 +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "print_fields.h" +#include "scno.h" + +#ifdef HAVE_LINUX_BPF_H +# include +#endif + +#include "bpf_attr.h" + +#include "xlat.h" +#include "xlat/bpf_map_flags.h" +#include "xlat/bpf_map_types.h" +#include "xlat/bpf_prog_types.h" + +#define XLAT_MACROS_ONLY +#include "xlat/bpf_commands.h" +#include "xlat/bpf_op_alu.h" +#include "xlat/bpf_op_jmp.h" +#include "xlat/bpf_size.h" +#include "xlat/bpf_src.h" +#include "xlat/ebpf_class.h" +#include "xlat/ebpf_mode.h" +#include "xlat/ebpf_op_alu.h" +#include "xlat/ebpf_regs.h" +#include "xlat/ebpf_size.h" + +#ifndef HAVE_STRUCT_BPF_INSN +struct bpf_insn { + uint8_t code; + uint8_t dst_reg:4; + uint8_t src_reg:4; + int16_t off; + int32_t imm; +}; +#endif + +static const char *errstr; + +static long +sys_bpf(kernel_ulong_t cmd, void *attr, kernel_ulong_t size) +{ + long rc = syscall(__NR_bpf, cmd, attr, size); + errstr = sprintrc(rc); + return rc; +} + +static void +print_map_create(void *attr_void, size_t size, long rc) +{ + /* struct BPF_MAP_CREATE_struct *attr = attr_void; */ + + printf("bpf(BPF_MAP_CREATE, {map_type=BPF_MAP_TYPE_ARRAY, key_size=4" + ", value_size=8, max_entries=1"); + if (size > offsetof(struct BPF_MAP_CREATE_struct, map_flags)) + printf(", map_flags=0"); + if (size > offsetof(struct BPF_MAP_CREATE_struct, inner_map_fd)) + printf(", inner_map_fd=0"); + if (size > offsetof(struct BPF_MAP_CREATE_struct, map_name)) + printf(", map_name=\"test_map\""); + if (size > offsetof(struct BPF_MAP_CREATE_struct, map_ifindex)) + printf(", map_ifindex=0"); + if (size > offsetof(struct BPF_MAP_CREATE_struct, btf_fd)) { + printf(", btf_fd=0" + ", btf_key_type_id=0, btf_value_type_id=0"); + } + printf("}, %zu) = ", size); + if (rc >= 0) + printf("%ld\n", rc); + else + puts(errstr); +} + +#if CHECK_OBJ_PROG +static struct bpf_insn socket_prog[] = { + { /* 0 */ + .code = BPF_ALU64 | BPF_K | BPF_MOV, + .dst_reg = BPF_REG_1, + .imm = 0, + }, + { /* 1 */ + .code = BPF_STX | BPF_W | BPF_MEM, + .dst_reg = BPF_REG_10, + .src_reg = BPF_REG_1, + .off = -4, + }, + { /* 2 */ + .code = BPF_ALU64 | BPF_X | BPF_MOV, + .dst_reg = BPF_REG_2, + .src_reg = BPF_REG_10, + }, + { /* 3 */ + .code = BPF_ALU64 | BPF_K | BPF_ADD, + .dst_reg = BPF_REG_2, + .imm = -4, + }, + { /* 4 */ + .code = BPF_LD | BPF_DW | BPF_IMM, + .dst_reg = BPF_REG_1, + .src_reg = 1 /* BPF_PSEUDO_MAP_FD */, + .imm = 0, /* to be set to map fd */ + }, + { /* 5 */ + .imm = 0, + }, + { /* 6 */ + .code = BPF_JMP | BPF_K | BPF_CALL, + .imm = 0x1, /* BPF_FUNC_map_lookup_elem */ + }, + { /* 7 */ + .code = BPF_ALU64 | BPF_K | BPF_MOV, + .dst_reg = BPF_REG_0, + .imm = 0, + }, + { /* 8 */ + .code = BPF_JMP | BPF_K | BPF_EXIT, + }, +}; + +# if VERBOSE +static const char *socket_prog_fmt = + "[{code=BPF_ALU64|BPF_K|BPF_MOV" + ", dst_reg=BPF_REG_1, src_reg=BPF_REG_0, off=0, imm=0}" + ", {code=BPF_STX|BPF_W|BPF_MEM" + ", dst_reg=BPF_REG_10, src_reg=BPF_REG_1, off=-4, imm=0}" + ", {code=BPF_ALU64|BPF_X|BPF_MOV" + ", dst_reg=BPF_REG_2, src_reg=BPF_REG_10, off=0, imm=0}" + ", {code=BPF_ALU64|BPF_K|BPF_ADD" + ", dst_reg=BPF_REG_2, src_reg=BPF_REG_0, off=0, imm=0xfffffffc}" + ", {code=BPF_LD|BPF_DW|BPF_IMM" + ", dst_reg=BPF_REG_1, src_reg=BPF_REG_1, off=0, imm=%#x}" + ", {code=BPF_LD|BPF_W|BPF_IMM" + ", dst_reg=BPF_REG_0, src_reg=BPF_REG_0, off=0, imm=0}" + ", {code=BPF_JMP|BPF_K|BPF_CALL" + ", dst_reg=BPF_REG_0, src_reg=BPF_REG_0, off=0, imm=0x1}" + ", {code=BPF_ALU64|BPF_K|BPF_MOV" + ", dst_reg=BPF_REG_0, src_reg=BPF_REG_0, off=0, imm=0}" + ", {code=BPF_JMP|BPF_K|BPF_EXIT" + ", dst_reg=BPF_REG_0, src_reg=BPF_REG_0, off=0, imm=0}" + "]"; +# endif /* VERBOSE */ + +static const char *license = "BSD"; +static char log_buf[4096]; + +static void +print_prog_load(void *attr_void, size_t size, long rc) +{ + printf("bpf(BPF_PROG_LOAD, {prog_type=BPF_PROG_TYPE_SOCKET_FILTER" + ", insn_cnt=%zu, insns=", ARRAY_SIZE(socket_prog)); +# if VERBOSE + printf(socket_prog_fmt, socket_prog[4].imm); +# else + printf("%p", socket_prog); +# endif + if (size > offsetof(struct BPF_PROG_LOAD_struct, license)) + printf(", license=\"BSD\""); + if (size > offsetof(struct BPF_PROG_LOAD_struct, log_buf)) + printf(", log_level=7, log_size=%zu, log_buf=\"\"", + sizeof(log_buf)); + if (size > offsetof(struct BPF_PROG_LOAD_struct, kern_version)) + printf(", kern_version=KERNEL_VERSION(57005, 192, 222)"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, prog_flags)) + printf(", prog_flags=0"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, prog_name)) + printf(", prog_name=\"test_prog\""); + if (size > offsetof(struct BPF_PROG_LOAD_struct, prog_ifindex)) + printf(", prog_ifindex=0"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, expected_attach_type)) + printf(", expected_attach_type=BPF_CGROUP_INET_INGRESS"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, prog_btf_fd)) + printf(", prog_btf_fd=0"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, func_info_rec_size)) + printf(", func_info_rec_size=0"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, func_info)) + printf(", func_info=NULL"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, func_info_cnt)) + printf(", func_info_cnt=0"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, line_info_rec_size)) + printf(", line_info_rec_size=0"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, line_info)) + printf(", line_info=NULL"); + if (size > offsetof(struct BPF_PROG_LOAD_struct, line_info_cnt)) + printf(", line_info_cnt=0"); + printf("}, %zu) = ", size); + if (rc >= 0) + printf("%ld\n", rc); + else + puts(errstr); +} +#endif /* CHECK_OBJ_PROG */ + +static long +try_bpf(kernel_ulong_t cmd, void (*printer)(void *attr, size_t size, long rc), + void *attr, size_t **sizes) +{ + long rc; + + for (rc = -1; **sizes; (*sizes)++) { + rc = sys_bpf(cmd, attr, **sizes); + printer(attr, **sizes, rc); + + if (rc >= 0) + break; + } + + return rc; +} + +int +main(void) +{ + struct BPF_MAP_CREATE_struct bpf_map_create_attr = { + .map_type = BPF_MAP_TYPE_ARRAY, + .key_size = 4, + .value_size = 8, + .max_entries = 1, + .map_name = "test_map", + }; + size_t bpf_map_create_attr_sizes[] = { + sizeof(bpf_map_create_attr), + offsetofend(struct BPF_MAP_CREATE_struct, max_entries), + 0, + }; + +#if CHECK_OBJ_PROG + struct BPF_PROG_LOAD_struct bpf_prog_load_attr = { + .prog_type = BPF_PROG_TYPE_SOCKET_FILTER, + .insn_cnt = ARRAY_SIZE(socket_prog), + .insns = (uintptr_t) socket_prog, + .license = (uintptr_t) license, + .log_level = 7, + .log_size = sizeof(log_buf), + .log_buf = (uintptr_t) log_buf, + .kern_version = 0xdeadc0de, + .prog_name = "test_prog", + }; + size_t bpf_prog_load_attr_sizes[] = { + sizeof(bpf_prog_load_attr), + offsetofend(struct BPF_PROG_LOAD_struct, prog_name), + offsetofend(struct BPF_PROG_LOAD_struct, prog_flags), + offsetofend(struct BPF_PROG_LOAD_struct, kern_version), + offsetofend(struct BPF_PROG_LOAD_struct, log_buf), + offsetofend(struct BPF_PROG_LOAD_struct, license), + offsetofend(struct BPF_PROG_LOAD_struct, insns), + 0, + }; +#endif /* CHECK_OBJ_PROG */ + + size_t *bpf_map_create_attr_size = bpf_map_create_attr_sizes; + int map_fd = try_bpf(BPF_MAP_CREATE, print_map_create, + &bpf_map_create_attr, &bpf_map_create_attr_size); + if (map_fd < 0) + perror_msg_and_skip("BPF_MAP_CREATE failed"); + +#if CHECK_OBJ_PROG + socket_prog[4].imm = map_fd; + + size_t *bpf_prog_load_attr_size = bpf_prog_load_attr_sizes; + int prog_fd = try_bpf(BPF_PROG_LOAD, print_prog_load, + &bpf_prog_load_attr, &bpf_prog_load_attr_size); + if (prog_fd < 0) + perror_msg_and_skip("BPF_PROG_LOAD failed (log: \"%s\")", + log_buf); +#endif /* CHECK_OBJ_PROG */ + + /* + * This has to be a macro, otherwise the compiler complains that + * initializer element is not constant. + */ +#define MAP_INFO_SZ (sizeof(*map_info) + 64) + struct bpf_map_info_struct *map_info = tail_alloc(MAP_INFO_SZ); + struct BPF_OBJ_GET_INFO_BY_FD_struct bpf_map_get_info_attr = { + .bpf_fd = map_fd, + .info_len = MAP_INFO_SZ, + .info = (uintptr_t) map_info, + }; + + memset(map_info, 0, MAP_INFO_SZ); + int ret = sys_bpf(BPF_OBJ_GET_INFO_BY_FD, &bpf_map_get_info_attr, + sizeof(bpf_map_get_info_attr)); + if (ret < 0) + perror_msg_and_skip("BPF_OBJ_GET_INFO_BY_FD map failed"); + + printf("bpf(BPF_OBJ_GET_INFO_BY_FD" + ", {info={bpf_fd=%d, info_len=%zu", + map_fd, MAP_INFO_SZ); + if (bpf_map_get_info_attr.info_len != MAP_INFO_SZ) + printf(" => %u", bpf_map_get_info_attr.info_len); + + printf(", info="); +#if VERBOSE + printf("{type="); + printxval(bpf_map_types, map_info->type, "BPF_MAP_TYPE_???"); + PRINT_FIELD_U(", ", *map_info, id); + PRINT_FIELD_U(", ", *map_info, key_size); + PRINT_FIELD_U(", ", *map_info, value_size); + PRINT_FIELD_U(", ", *map_info, max_entries); + printf(", map_flags="); + printflags(bpf_map_flags, map_info->map_flags, "BPF_F_???"); + + if (bpf_map_get_info_attr.info_len > + offsetof(struct bpf_map_info_struct, name)) { + printf(", name="); + print_quoted_cstring(map_info->name, sizeof(map_info->name)); + } + if (bpf_map_get_info_attr.info_len > + offsetof(struct bpf_map_info_struct, ifindex)) + printf(", ifindex=%u", map_info->ifindex); + if (bpf_map_get_info_attr.info_len > + offsetof(struct bpf_map_info_struct, netns_dev)) + printf(", netns_dev=makedev(%#x, %#x)", + major(map_info->netns_dev), minor(map_info->netns_dev)); + if (bpf_map_get_info_attr.info_len > + offsetof(struct bpf_map_info_struct, netns_ino)) + printf(", netns_ino=%" PRIu64, map_info->netns_ino); + if (bpf_map_get_info_attr.info_len > + offsetof(struct bpf_map_info_struct, btf_id)) + PRINT_FIELD_U(", ", *map_info, btf_id); + if (bpf_map_get_info_attr.info_len > + offsetof(struct bpf_map_info_struct, btf_key_type_id)) + PRINT_FIELD_U(", ", *map_info, btf_key_type_id); + if (bpf_map_get_info_attr.info_len > + offsetof(struct bpf_map_info_struct, btf_value_type_id)) + PRINT_FIELD_U(", ", *map_info, btf_value_type_id); + printf("}"); +#else /* !VERBOSE */ + printf("%p", map_info); +#endif /* VERBOSE */ + printf("}}, %zu) = %s\n", sizeof(bpf_map_get_info_attr), errstr); + +#if CHECK_OBJ_PROG + /* + * This has to be a macro, otherwise the compiler complains that + * initializer element is not constant. + */ +# define PROG_INFO_SZ (sizeof(*prog_info) + 64) + struct bpf_prog_info_struct *prog_info = tail_alloc(PROG_INFO_SZ); + struct bpf_insn *xlated_prog = tail_alloc(sizeof(*xlated_prog) * 42); + uint32_t *map_ids = tail_alloc(sizeof(*map_ids) * 2); + struct BPF_OBJ_GET_INFO_BY_FD_struct bpf_prog_get_info_attr = { + .bpf_fd = prog_fd, + .info_len = PROG_INFO_SZ, + .info = (uintptr_t) prog_info, + }; + size_t old_prog_info_len = PROG_INFO_SZ; + + memset(prog_info, 0, PROG_INFO_SZ); + for (unsigned int i = 0; i < 4; i++) { + prog_info->jited_prog_len = 0; + prog_info->nr_jited_ksyms = 0; + prog_info->nr_jited_func_lens = 0; + prog_info->func_info_rec_size = 0; + prog_info->nr_func_info = 0; + prog_info->nr_line_info = 0; + prog_info->nr_jited_line_info = 0; + prog_info->jited_line_info = 0; + prog_info->line_info_rec_size = 0; + prog_info->jited_line_info_rec_size = 0; + prog_info->nr_prog_tags = 0; + memset(prog_info + 1, 0, PROG_INFO_SZ - sizeof(*prog_info)); + switch (i) { + case 1: + prog_info->xlated_prog_insns = + (uintptr_t) (xlated_prog + 42); + prog_info->xlated_prog_len = 336; + prog_info->map_ids = (uintptr_t) (map_ids + 2); + prog_info->nr_map_ids = 2; + break; + case 2: + prog_info->xlated_prog_insns = (uintptr_t) xlated_prog; + /* TODO: check xlated_prog output */ + prog_info->xlated_prog_len = 0; + prog_info->map_ids = (uintptr_t) map_ids; + prog_info->nr_map_ids = 0; + break; + case 3: + prog_info->xlated_prog_insns = (uintptr_t) xlated_prog; + prog_info->xlated_prog_len = 0; + prog_info->map_ids = (uintptr_t) map_ids; + prog_info->nr_map_ids = 2; + break; + } + + ret = sys_bpf(BPF_OBJ_GET_INFO_BY_FD, &bpf_prog_get_info_attr, + sizeof(bpf_prog_get_info_attr)); + if (i != 1 && ret < 0) + perror_msg_and_skip("BPF_OBJ_GET_INFO_BY_FD" + " prog %u failed", i); + + printf("bpf(BPF_OBJ_GET_INFO_BY_FD" + ", {info={bpf_fd=%d, info_len=%zu", + prog_fd, old_prog_info_len); + if (!i && bpf_prog_get_info_attr.info_len != PROG_INFO_SZ) + printf(" => %u", bpf_prog_get_info_attr.info_len); + old_prog_info_len = bpf_prog_get_info_attr.info_len; + + printf(", info="); +# if VERBOSE + printf("{type="); + printxval(bpf_prog_types, prog_info->type, "BPF_PROG_TYPE_???"); + PRINT_FIELD_U(", ", *prog_info, id); + printf(", tag="); + print_quoted_hex(prog_info->tag, sizeof(prog_info->tag)); + printf(", jited_prog_len=0"); + if (prog_info->jited_prog_len) + printf(" => %u", prog_info->jited_prog_len); + printf(", jited_prog_insns=NULL"); + switch (i) { + case 0: + printf(", xlated_prog_len=0"); + if (prog_info->xlated_prog_len) + printf(" => %u", prog_info->xlated_prog_len); + printf(", xlated_prog_insns=NULL"); + break; + case 1: + printf(", xlated_prog_len=336"); + if (prog_info->xlated_prog_len != 336) + printf(" => %u", prog_info->xlated_prog_len); + if (prog_info->xlated_prog_len) + printf(", xlated_prog_insns=%p", xlated_prog + 42); + else + printf(", xlated_prog_insns=[]"); + break; + case 2: + case 3: + printf(", xlated_prog_len=0"); + if (prog_info->xlated_prog_len) + printf(" => %u", prog_info->xlated_prog_len); + printf(", xlated_prog_insns=[]"); + break; + } + + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, load_time)) + printf(", load_time=%" PRIu64, prog_info->load_time); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, created_by_uid)) + printf(", created_by_uid=%u", + prog_info->created_by_uid); + + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, map_ids)) { + switch (i) { + case 0: + printf(", nr_map_ids=0"); + if (prog_info->nr_map_ids) + printf(" => 1"); + printf(", map_ids=NULL"); + break; + case 1: + printf(", nr_map_ids=2, map_ids=%p", + map_ids + 2); + break; + case 2: + printf(", nr_map_ids=0"); + if (prog_info->nr_map_ids) + printf(" => 1"); + printf(", map_ids=[]"); + break; + case 3: + printf(", nr_map_ids=2"); + if (prog_info->nr_map_ids != 2) + printf(" => 1"); + printf(", map_ids=[%u]", map_info->id); + break; + } + } + + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, name)) + printf(", name=\"test_prog\""); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, ifindex)) + printf(", ifindex=%u", prog_info->ifindex); + if (bpf_prog_get_info_attr.info_len > + offsetofend(struct bpf_prog_info_struct, ifindex)) + printf(", gpl_compatible=%u", prog_info->gpl_compatible); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, netns_dev)) + printf(", netns_dev=makedev(%#x, %#x)", + major(prog_info->netns_dev), + minor(prog_info->netns_dev)); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, netns_ino)) + printf(", netns_ino=%" PRIu64, prog_info->netns_ino); + + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, nr_jited_ksyms)) { + printf(", nr_jited_ksyms=0"); + if (prog_info->nr_jited_ksyms) + printf(" => %u", prog_info->nr_jited_ksyms); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, nr_jited_func_lens)) { + printf(", nr_jited_func_lens=0"); + if (prog_info->nr_jited_func_lens) + printf(" => %u", prog_info->nr_jited_func_lens); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, jited_ksyms)) + printf(", jited_ksyms=NULL"); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, jited_func_lens)) + printf(", jited_func_lens=NULL"); + + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, btf_id)) + PRINT_FIELD_U(", ", *prog_info, btf_id); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, func_info_rec_size)) { + printf(", func_info_rec_size=0"); + if (prog_info->func_info_rec_size) + printf(" => %u", prog_info->func_info_rec_size); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, func_info)) + printf(", func_info=NULL"); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, nr_func_info)) { + printf(", nr_func_info=0"); + if (prog_info->nr_func_info) + printf(" => %u", prog_info->nr_func_info); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, nr_line_info)) { + printf(", nr_line_info=0"); + if (prog_info->nr_line_info) + printf(" => %u", prog_info->nr_line_info); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, line_info)) + printf(", line_info=NULL"); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, jited_line_info)) + printf(", jited_line_info=NULL"); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, nr_jited_line_info)) { + printf(", nr_jited_line_info=0"); + if (prog_info->nr_jited_line_info) + printf(" => %u", prog_info->nr_jited_line_info); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, line_info_rec_size)) { + printf(", line_info_rec_size=0"); + if (prog_info->line_info_rec_size) + printf(" => %u", prog_info->line_info_rec_size); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, jited_line_info_rec_size)) { + printf(", jited_line_info_rec_size=0"); + if (prog_info->jited_line_info_rec_size) + printf(" => %u", prog_info->jited_line_info_rec_size); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, nr_prog_tags)) { + printf(", nr_prog_tags=0"); + if (prog_info->nr_prog_tags) + printf(" => %u", prog_info->nr_prog_tags); + } + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, prog_tags)) + printf(", prog_tags=NULL"); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, run_time_ns)) + printf(", run_time_ns=%llu", + (unsigned long long) prog_info->run_time_ns); + if (bpf_prog_get_info_attr.info_len > + offsetof(struct bpf_prog_info_struct, run_cnt)) + printf(", run_cnt=%llu", + (unsigned long long) prog_info->run_cnt); + + printf("}"); +# else /* !VERBOSE */ + printf("%p", prog_info); +# endif /* VERBOSE */ + printf("}}, %zu) = %s\n", + sizeof(bpf_prog_get_info_attr), errstr); + } +#endif /* CHECK_OBJ_PROG */ + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/bpf-obj_get_info_by_fd.gen.test b/tests/bpf-obj_get_info_by_fd.gen.test new file mode 100755 index 00000000..0efa59a4 --- /dev/null +++ b/tests/bpf-obj_get_info_by_fd.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (bpf-obj_get_info_by_fd -a20 -y -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -y -e trace=bpf diff --git a/tests/bpf-success-v.c b/tests/bpf-success-v.c new file mode 100644 index 00000000..48c2a16d --- /dev/null +++ b/tests/bpf-success-v.c @@ -0,0 +1,2 @@ +#define INJECT_RETVAL 42 +#include "bpf-v.c" diff --git a/tests/bpf-success-v.test b/tests/bpf-success-v.test new file mode 100755 index 00000000..9afcb148 --- /dev/null +++ b/tests/bpf-success-v.test @@ -0,0 +1,11 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +run_strace -a20 -v -e trace=bpf -e inject=bpf:retval=42 ../bpf-success-v > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests/bpf-success.c b/tests/bpf-success.c new file mode 100644 index 00000000..06f46956 --- /dev/null +++ b/tests/bpf-success.c @@ -0,0 +1,2 @@ +#define INJECT_RETVAL 42 +#include "bpf.c" diff --git a/tests/bpf-success.test b/tests/bpf-success.test new file mode 100755 index 00000000..4321e532 --- /dev/null +++ b/tests/bpf-success.test @@ -0,0 +1,11 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +run_strace -a20 -e trace=bpf -e inject=bpf:retval=42 ../bpf-success > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests/bpf-v.c b/tests/bpf-v.c new file mode 100644 index 00000000..3f44f249 --- /dev/null +++ b/tests/bpf-v.c @@ -0,0 +1,3 @@ +/* This file is part of bpf-v strace test. */ +#define VERBOSE 1 +#include "bpf.c" diff --git a/tests/bpf-v.gen.test b/tests/bpf-v.gen.test new file mode 100755 index 00000000..e57154e3 --- /dev/null +++ b/tests/bpf-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (bpf-v -a20 -v -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -v -e trace=bpf diff --git a/tests/bpf.c b/tests/bpf.c index 7ef16c9f..fd29ab44 100644 --- a/tests/bpf.c +++ b/tests/bpf.c @@ -1,234 +1,1252 @@ /* + * Check bpf syscall decoding. + * * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2015-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" + +#include +#include +#include +#include +#include + #include +#include "scno.h" -#if defined HAVE_UNION_BPF_ATTR_LOG_BUF && defined __NR_bpf -# include -# include -# include +#ifdef HAVE_LINUX_BPF_H # include +#endif -static const struct bpf_insn insns[] = { - { .code = BPF_JMP | BPF_EXIT } +#include "bpf_attr.h" +#include "print_fields.h" + +#include "xlat.h" +#include "xlat/bpf_commands.h" + +#if defined MPERS_IS_m32 || SIZEOF_KERNEL_LONG_T > 4 +# define BIG_ADDR(addr64_, addr32_) addr64_ +# define BIG_ADDR_MAYBE(addr_) +#elif defined __arm__ || defined __i386__ || defined __mips__ \ + || defined __powerpc__ || defined __riscv__ || defined __s390__ \ + || defined __sparc__ || defined __tile__ +# define BIG_ADDR(addr64_, addr32_) addr64_ " or " addr32_ +# define BIG_ADDR_MAYBE(addr_) addr_ " or " +#else +# define BIG_ADDR(addr64_, addr32_) addr32_ +# define BIG_ADDR_MAYBE(addr_) +#endif + +#ifndef HAVE_STRUCT_BPF_INSN +struct bpf_insn { + uint8_t code; + uint8_t dst_reg:4; + uint8_t src_reg:4; + int16_t off; + int32_t imm; +}; +#endif + +#define BPF_ATTR_DATA_FIELD(cmd_) struct cmd_ ## _struct cmd_ ## _data + +union bpf_attr_data { + BPF_ATTR_DATA_FIELD(BPF_MAP_CREATE); + BPF_ATTR_DATA_FIELD(BPF_MAP_LOOKUP_ELEM); + BPF_ATTR_DATA_FIELD(BPF_MAP_UPDATE_ELEM); + BPF_ATTR_DATA_FIELD(BPF_MAP_DELETE_ELEM); + BPF_ATTR_DATA_FIELD(BPF_MAP_GET_NEXT_KEY); + BPF_ATTR_DATA_FIELD(BPF_PROG_LOAD); + BPF_ATTR_DATA_FIELD(BPF_OBJ_PIN); + BPF_ATTR_DATA_FIELD(BPF_PROG_ATTACH); + BPF_ATTR_DATA_FIELD(BPF_PROG_DETACH); + BPF_ATTR_DATA_FIELD(BPF_PROG_TEST_RUN); + BPF_ATTR_DATA_FIELD(BPF_PROG_GET_NEXT_ID); + BPF_ATTR_DATA_FIELD(BPF_PROG_GET_FD_BY_ID); + BPF_ATTR_DATA_FIELD(BPF_MAP_GET_FD_BY_ID); + BPF_ATTR_DATA_FIELD(BPF_OBJ_GET_INFO_BY_FD); + BPF_ATTR_DATA_FIELD(BPF_PROG_QUERY); + BPF_ATTR_DATA_FIELD(BPF_RAW_TRACEPOINT_OPEN); + BPF_ATTR_DATA_FIELD(BPF_BTF_LOAD); + BPF_ATTR_DATA_FIELD(BPF_BTF_GET_FD_BY_ID); + BPF_ATTR_DATA_FIELD(BPF_TASK_FD_QUERY); + char char_data[256]; +}; + +struct bpf_attr_check { + union bpf_attr_data data; + size_t size; + const char *str; + void (*init_fn)(struct bpf_attr_check *check); + void (*print_fn)(const struct bpf_attr_check *check, + unsigned long addr); +}; + +struct bpf_check { + kernel_ulong_t cmd; + const char *cmd_str; + const struct bpf_attr_check *checks; + size_t count; }; +static const kernel_ulong_t long_bits = (kernel_ulong_t) 0xfacefeed00000000ULL; static const char *errstr; -static char log_buf[4096]; +static unsigned int sizeof_attr = sizeof(union bpf_attr_data); +static unsigned int page_size; +static unsigned long end_of_page; static long sys_bpf(kernel_ulong_t cmd, kernel_ulong_t attr, kernel_ulong_t size) { long rc = syscall(__NR_bpf, cmd, attr, size); + errstr = sprintrc(rc); + +#ifdef INJECT_RETVAL + if (rc != INJECT_RETVAL) + error_msg_and_fail("Got a return value of %ld != %d", + rc, INJECT_RETVAL); + + static char inj_errstr[4096]; + + snprintf(inj_errstr, sizeof(inj_errstr), "%s (INJECTED)", errstr); + errstr = inj_errstr; +#endif + return rc; } -static int -map_create(void) +#if VERBOSE +# define print_extra_data(addr_, offs_, size_) \ + do { \ + printf("/* bytes %u..%u */ ", (offs_), (size_) + (offs_) - 1); \ + print_quoted_hex((addr_) + (offs_), (size_)); \ + } while (0) +#else +# define print_extra_data(addr_, offs_, size_) printf("...") +#endif + +static void +print_bpf_attr(const struct bpf_attr_check *check, unsigned long addr) { - union bpf_attr attr = { - .key_size = 4, - .value_size = 8, - .max_entries = 256 - }; - void *const t_attr = tail_memdup(&attr, sizeof(attr)); - return sys_bpf(BPF_MAP_CREATE, (unsigned long) t_attr, sizeof(attr)); + if (check->print_fn) + check->print_fn(check, addr); + else + printf("%s", check->str); } -static int -map_any(int cmd) +static void +test_bpf(const struct bpf_check *cmd_check) { - union bpf_attr attr = { - .map_fd = -1, - .key = 0xdeadbeef, - .value = 0xbadc0ded - }; - void *const t_attr = tail_memdup(&attr, sizeof(attr)); - return sys_bpf(cmd, (unsigned long) t_attr, sizeof(attr)); + const struct bpf_attr_check *check = 0; + const union bpf_attr_data *data = 0; + unsigned int offset = 0; + + /* zero addr */ + sys_bpf(cmd_check->cmd, 0, long_bits | sizeof(union bpf_attr_data)); + printf("bpf(%s, NULL, %u) = %s\n", + cmd_check->cmd_str, sizeof_attr, errstr); + + /* zero size */ + unsigned long addr = end_of_page - sizeof_attr; + sys_bpf(cmd_check->cmd, addr, long_bits); + printf("bpf(%s, %#lx, 0) = %s\n", + cmd_check->cmd_str, addr, errstr); + + for (size_t i = 0; i < cmd_check->count; i++) { + check = &cmd_check->checks[i]; + if (check->init_fn) + check->init_fn((struct bpf_attr_check *) check); + data = &check->data; + offset = check->size; + + addr = end_of_page - offset; + memcpy((void *) addr, data, offset); + + /* starting piece of bpf_attr_data */ + sys_bpf(cmd_check->cmd, addr, offset); + printf("bpf(%s, {", cmd_check->cmd_str); + print_bpf_attr(check, addr); + printf("}, %u) = %s\n", offset, errstr); + + /* short read of the starting piece */ + sys_bpf(cmd_check->cmd, addr + 1, offset); + printf("bpf(%s, %#lx, %u) = %s\n", + cmd_check->cmd_str, addr + 1, offset, errstr); + } + + if (offset < sizeof_attr) { + /* short read of the whole bpf_attr_data */ + memcpy((void *) end_of_page - sizeof_attr + 1, data, offset); + addr = end_of_page - sizeof_attr + 1; + memset((void *) addr + offset, 0, sizeof_attr - offset - 1); + sys_bpf(cmd_check->cmd, addr, sizeof_attr); + printf("bpf(%s, %#lx, %u) = %s\n", + cmd_check->cmd_str, addr, sizeof_attr, errstr); + + /* the whole bpf_attr_data */ + memcpy((void *) end_of_page - sizeof_attr, data, offset); + addr = end_of_page - sizeof_attr; + memset((void *) addr + offset, 0, sizeof_attr - offset); + sys_bpf(cmd_check->cmd, addr, sizeof_attr); + printf("bpf(%s, {", cmd_check->cmd_str); + print_bpf_attr(check, addr); + printf("}, %u) = %s\n", sizeof_attr, errstr); + + /* non-zero bytes after the relevant part */ + fill_memory_ex((void *) addr + offset, + sizeof_attr - offset, '0', 10); + sys_bpf(cmd_check->cmd, addr, sizeof_attr); + printf("bpf(%s, {", cmd_check->cmd_str); + print_bpf_attr(check, addr); + printf(", "); + print_extra_data((char *) addr, offset, + sizeof_attr - offset); + printf("}, %u) = %s\n", sizeof_attr, errstr); + } + + /* short read of the whole page */ + memcpy((void *) end_of_page - page_size + 1, data, offset); + addr = end_of_page - page_size + 1; + memset((void *) addr + offset, 0, page_size - offset - 1); + sys_bpf(cmd_check->cmd, addr, page_size); + printf("bpf(%s, %#lx, %u) = %s\n", + cmd_check->cmd_str, addr, page_size, errstr); + + /* the whole page */ + memcpy((void *) end_of_page - page_size, data, offset); + addr = end_of_page - page_size; + memset((void *) addr + offset, 0, page_size - offset); + sys_bpf(cmd_check->cmd, addr, page_size); + printf("bpf(%s, {", cmd_check->cmd_str); + print_bpf_attr(check, addr); + printf("}, %u) = %s\n", page_size, errstr); + + /* non-zero bytes after the whole bpf_attr_data */ + fill_memory_ex((void *) addr + offset, + page_size - offset, '0', 10); + sys_bpf(cmd_check->cmd, addr, page_size); + printf("bpf(%s, {", cmd_check->cmd_str); + print_bpf_attr(check, addr); + printf(", "); + print_extra_data((char *) addr, offset, + page_size - offset); + printf("}, %u) = %s\n", page_size, errstr); + + /* more than a page */ + sys_bpf(cmd_check->cmd, addr, page_size + 1); + printf("bpf(%s, %#lx, %u) = %s\n", + cmd_check->cmd_str, addr, page_size + 1, errstr); } -static int -prog_load(void) +static void +init_BPF_MAP_CREATE_attr7(struct bpf_attr_check *check) { - union bpf_attr attr = { - .insn_cnt = sizeof(insns) / sizeof(insns[0]), - .insns = (unsigned long) insns, - .license = (unsigned long) "GPL", - .log_level = 42, - .log_size = sizeof(log_buf), - .log_buf = (unsigned long) log_buf - }; - void *const t_attr = tail_memdup(&attr, sizeof(attr)); - return sys_bpf(BPF_PROG_LOAD, (unsigned long) t_attr, sizeof(attr)); + struct BPF_MAP_CREATE_struct *attr = &check->data.BPF_MAP_CREATE_data; + attr->map_ifindex = ifindex_lo(); } +static struct bpf_attr_check BPF_MAP_CREATE_checks[] = { + { + .data = { .BPF_MAP_CREATE_data = { .map_type = 2 } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, map_type), + .str = "map_type=BPF_MAP_TYPE_ARRAY, key_size=0, value_size=0" + ", max_entries=0" + }, + { /* 1 */ + .data = { .BPF_MAP_CREATE_data = { + .map_type = 20, + .key_size = 4, + .value_size = 8, + .max_entries = 256, + .map_flags = 63, + .inner_map_fd = -1, + .numa_node = 3141592653, + .map_name = "0123456789abcde", + } }, + .size = offsetof(struct BPF_MAP_CREATE_struct, map_name) + 8, + .str = "map_type=BPF_MAP_TYPE_REUSEPORT_SOCKARRAY, key_size=4" + ", value_size=8, max_entries=256" + ", map_flags=BPF_F_NO_PREALLOC|BPF_F_NO_COMMON_LRU" + "|BPF_F_NUMA_NODE|BPF_F_RDONLY|BPF_F_WRONLY" + "|BPF_F_STACK_BUILD_ID" + ", inner_map_fd=-1" + ", numa_node=3141592653" + ", map_name=\"0123456\"...", + + }, + { /* 2 */ + .data = { .BPF_MAP_CREATE_data = { + .map_type = 24, + .key_size = 0xface1e55, + .value_size = 0xbadc0ded, + .max_entries = 0xbeefcafe, + .map_flags = 0xffffff80, + .inner_map_fd = 2718281828, + .numa_node = -1, + .map_name = "", + .map_ifindex = 3141592653, + } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, map_ifindex), + .str = "map_type=0x18 /* BPF_MAP_TYPE_??? */" + ", key_size=4207812181, value_size=3134983661" + ", max_entries=3203386110" + ", map_flags=0xffffff80 /* BPF_F_??? */" + ", inner_map_fd=-1576685468" + ", map_name=\"\", map_ifindex=3141592653", + + }, + { /* 3 */ + .data = { .BPF_MAP_CREATE_data = { + .map_type = 0xdeadf00d, + .key_size = 0xface1e55, + .value_size = 0xbadc0ded, + .max_entries = 0xbeefcafe, + .map_flags = 0xc0dedead, + .inner_map_fd = 2718281828, + .numa_node = -1, + } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, map_flags), + .str = "map_type=0xdeadf00d /* BPF_MAP_TYPE_??? */" + ", key_size=4207812181, value_size=3134983661" + ", max_entries=3203386110" + ", map_flags=BPF_F_NO_PREALLOC|BPF_F_NUMA_NODE" + "|BPF_F_RDONLY|BPF_F_STACK_BUILD_ID" + "|0xc0dede80", + }, + { /* 4 */ + .data = { .BPF_MAP_CREATE_data = { + .map_type = 0xdeadf00d, + .key_size = 0xface1e55, + .value_size = 0xbadc0ded, + .max_entries = 0xbeefcafe, + .map_flags = 0xc0dedead, + .inner_map_fd = 2718281828, + .numa_node = -1, + } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, inner_map_fd), + .str = "map_type=0xdeadf00d /* BPF_MAP_TYPE_??? */" + ", key_size=4207812181, value_size=3134983661" + ", max_entries=3203386110" + ", map_flags=BPF_F_NO_PREALLOC|BPF_F_NUMA_NODE" + "|BPF_F_RDONLY|BPF_F_STACK_BUILD_ID" + "|0xc0dede80" + ", inner_map_fd=-1576685468", + }, + { /* 5 */ + .data = { .BPF_MAP_CREATE_data = { + .map_type = 0xdeadf00d, + .key_size = 0xface1e55, + .value_size = 0xbadc0ded, + .max_entries = 0xbeefcafe, + .map_flags = 0xc0dedead, + .inner_map_fd = 2718281828, + .numa_node = -1, + } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, numa_node), + .str = "map_type=0xdeadf00d /* BPF_MAP_TYPE_??? */" + ", key_size=4207812181, value_size=3134983661" + ", max_entries=3203386110" + ", map_flags=BPF_F_NO_PREALLOC|BPF_F_NUMA_NODE" + "|BPF_F_RDONLY|BPF_F_STACK_BUILD_ID" + "|0xc0dede80" + ", inner_map_fd=-1576685468" + ", numa_node=4294967295 /* NUMA_NO_NODE */", + }, + { /* 6 */ + .data = { .BPF_MAP_CREATE_data = { + .map_type = 0xdeadf00d, + .key_size = 0xface1e55, + .value_size = 0xbadc0ded, + .max_entries = 0xbeefcafe, + .map_flags = 0xc0dedead, + .inner_map_fd = 2718281828, + .numa_node = -1, + .map_name = "fedcba9876543210", + } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, map_name), + .str = "map_type=0xdeadf00d /* BPF_MAP_TYPE_??? */" + ", key_size=4207812181, value_size=3134983661" + ", max_entries=3203386110" + ", map_flags=BPF_F_NO_PREALLOC|BPF_F_NUMA_NODE" + "|BPF_F_RDONLY|BPF_F_STACK_BUILD_ID" + "|0xc0dede80" + ", inner_map_fd=-1576685468" + ", numa_node=4294967295 /* NUMA_NO_NODE */" + ", map_name=\"fedcba987654321\"...", + }, + { /* 7 */ + .data = { .BPF_MAP_CREATE_data = { + .map_type = 0xdeadf00d, + .key_size = 0xface1e55, + .value_size = 0xbadc0ded, + .max_entries = 0xbeefcafe, + .map_flags = 0xc0dedead, + .inner_map_fd = 2718281828, + .numa_node = -1, + .map_name = "0123456789abcde", + } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, map_ifindex), + .str = "map_type=0xdeadf00d /* BPF_MAP_TYPE_??? */" + ", key_size=4207812181, value_size=3134983661" + ", max_entries=3203386110" + ", map_flags=BPF_F_NO_PREALLOC|BPF_F_NUMA_NODE" + "|BPF_F_RDONLY|BPF_F_STACK_BUILD_ID" + "|0xc0dede80" + ", inner_map_fd=-1576685468" + ", numa_node=4294967295 /* NUMA_NO_NODE */" + ", map_name=\"0123456789abcde\"" + ", map_ifindex=" IFINDEX_LO_STR, + .init_fn = init_BPF_MAP_CREATE_attr7, + }, + { /* 8 */ + .data = { .BPF_MAP_CREATE_data = { + .btf_fd = 0xbadc0ded, + .btf_key_type_id = 0xfacefeed, + .btf_value_type_id = 0xcafef00d + } }, + .size = offsetofend(struct BPF_MAP_CREATE_struct, + btf_value_type_id), + .str = "map_type=BPF_MAP_TYPE_UNSPEC" + ", key_size=0" + ", value_size=0" + ", max_entries=0" + ", map_flags=0" + ", inner_map_fd=0" + ", map_name=\"\"" + ", map_ifindex=0" + ", btf_fd=-1159983635" + ", btf_key_type_id=4207869677" + ", btf_value_type_id=3405705229" + }, +}; + +static const struct bpf_attr_check BPF_MAP_LOOKUP_ELEM_checks[] = { + { + .data = { .BPF_MAP_LOOKUP_ELEM_data = { .map_fd = -1 } }, + .size = offsetofend(struct BPF_MAP_LOOKUP_ELEM_struct, map_fd), + .str = "map_fd=-1, key=NULL, value=NULL" + }, + { + .data = { .BPF_MAP_LOOKUP_ELEM_data = { + .map_fd = -1, + .key = 0xdeadbeef, + .value = 0xbadc0ded + } }, + .size = offsetofend(struct BPF_MAP_LOOKUP_ELEM_struct, value), + .str = "map_fd=-1, key=0xdeadbeef, value=0xbadc0ded" + } +}; + +#define BPF_MAP_LOOKUP_AND_DELETE_ELEM_checks BPF_MAP_LOOKUP_ELEM_checks + +static const struct bpf_attr_check BPF_MAP_UPDATE_ELEM_checks[] = { + { + .data = { .BPF_MAP_UPDATE_ELEM_data = { .map_fd = -1 } }, + .size = offsetofend(struct BPF_MAP_UPDATE_ELEM_struct, map_fd), + .str = "map_fd=-1, key=NULL, value=NULL, flags=BPF_ANY" + }, + { + .data = { .BPF_MAP_UPDATE_ELEM_data = { + .map_fd = -1, + .key = 0xdeadbeef, + .value = 0xbadc0ded, + .flags = 2 + } }, + .size = offsetofend(struct BPF_MAP_UPDATE_ELEM_struct, flags), + .str = "map_fd=-1, key=0xdeadbeef, value=0xbadc0ded" + ", flags=BPF_EXIST" + } +}; + +static const struct bpf_attr_check BPF_MAP_DELETE_ELEM_checks[] = { + { + .data = { .BPF_MAP_DELETE_ELEM_data = { .map_fd = -1 } }, + .size = offsetofend(struct BPF_MAP_DELETE_ELEM_struct, map_fd), + .str = "map_fd=-1, key=NULL" + }, + { + .data = { .BPF_MAP_DELETE_ELEM_data = { + .map_fd = -1, + .key = 0xdeadbeef + } }, + .size = offsetofend(struct BPF_MAP_DELETE_ELEM_struct, key), + .str = "map_fd=-1, key=0xdeadbeef" + } +}; + +static const struct bpf_attr_check BPF_MAP_GET_NEXT_KEY_checks[] = { + { + .data = { .BPF_MAP_GET_NEXT_KEY_data = { .map_fd = -1 } }, + .size = offsetofend(struct BPF_MAP_GET_NEXT_KEY_struct, map_fd), + .str = "map_fd=-1, key=NULL, next_key=NULL" + }, + { + .data = { .BPF_MAP_GET_NEXT_KEY_data = { + .map_fd = -1, + .key = 0xdeadbeef, + .next_key = 0xbadc0ded + } }, + .size = offsetofend(struct BPF_MAP_GET_NEXT_KEY_struct, next_key), + .str = "map_fd=-1, key=0xdeadbeef, next_key=0xbadc0ded" + } +}; + +static const struct bpf_insn insns[] = { + { + .code = 0x95, + .dst_reg = 10, + .src_reg = 11, + .off = 0xdead, + .imm = 0xbadc0ded, + }, +}; +static const char license[] = "GPL"; +static const char pathname[] = "/sys/fs/bpf/foo/bar"; + +static char *log_buf; /* - * bpf() syscall and its first six commands were introduced in Linux kernel - * 3.18. Some additional commands were added afterwards, so we need to take - * precautions to make sure the tests compile. - * - * BPF_OBJ_PIN and BPF_OBJ_GET commands appear in kernel 4.4. + * This has to be a macro, otherwise the compiler complains that + * initializer element is not constant. */ -# ifdef HAVE_UNION_BPF_ATTR_BPF_FD -static int -obj_manage(int cmd) +#define log_buf_size 4096U + +static inline char * +get_log_buf(void) { - union bpf_attr attr = { - .pathname = (unsigned long) "/sys/fs/bpf/foo/bar", - .bpf_fd = -1 - }; - void *const t_attr = tail_memdup(&attr, sizeof(attr)); - return sys_bpf(cmd, (unsigned long) t_attr, sizeof(attr)); + if (!log_buf) + log_buf = tail_alloc(log_buf_size); + return log_buf; } -# endif -/* BPF_PROG_ATTACH and BPF_PROG_DETACH commands appear in kernel 4.10. */ -# ifdef HAVE_UNION_BPF_ATTR_ATTACH_TYPE -static int -prog_cgroup(int cmd) +static inline char * +get_log_buf_tail(void) { - union bpf_attr attr = { - .target_fd = -1, - .attach_bpf_fd = -1, - .attach_type = 0 - }; - void *const t_attr = tail_memdup(&attr, sizeof(attr)); - return sys_bpf(cmd, (unsigned long) t_attr, sizeof(attr)); + return get_log_buf() + log_buf_size; } -# endif -static unsigned long efault; +#if VERBOSE +# define INSNS_FMT \ + "[{code=BPF_JMP|BPF_K|BPF_EXIT, dst_reg=BPF_REG_10" \ + ", src_reg=0xb /* BPF_REG_??? */, off=%d, imm=%#x}]" +# define INSNS_ARG insns[0].off, insns[0].imm +#else +# define INSNS_FMT "%p" +# define INSNS_ARG insns +#endif + +static void +init_BPF_PROG_LOAD_attr3(struct bpf_attr_check *check) +{ + struct BPF_PROG_LOAD_struct *attr = &check->data.BPF_PROG_LOAD_data; + + attr->insns = (uintptr_t) insns; + attr->license = (uintptr_t) license; + attr->log_buf = (uintptr_t) get_log_buf_tail(); +} static void -bogus_bpf(int cmd, const char *name) +print_BPF_PROG_LOAD_attr3(const struct bpf_attr_check *check, unsigned long addr) { - const unsigned long bogus_size = 1024; - const unsigned long bogus_addr = efault - bogus_size; + printf("prog_type=BPF_PROG_TYPE_SOCKET_FILTER, insn_cnt=%u" + ", insns=" INSNS_FMT ", license=\"%s\", log_level=2718281828" + ", log_size=%u, log_buf=%p" + ", kern_version=KERNEL_VERSION(51966, 240, 13)" + ", prog_flags=0x4 /* BPF_F_??? */" + ", prog_name=\"0123456789abcde\"..., prog_ifindex=3203399405", + (unsigned int) ARRAY_SIZE(insns), INSNS_ARG, license, + log_buf_size, get_log_buf_tail()); +} - sys_bpf(cmd, efault, 4); - printf("bpf(%s, %#lx, %lu) = %s\n", - name, efault, 4UL, errstr); +static void +init_BPF_PROG_LOAD_attr4(struct bpf_attr_check *check) +{ + struct BPF_PROG_LOAD_struct *attr = &check->data.BPF_PROG_LOAD_data; - sys_bpf(cmd, efault, bogus_size); - printf("bpf(%s, %#lx, %lu) = %s\n", - name, efault, bogus_size, errstr); + attr->insns = (uintptr_t) insns; + attr->license = (uintptr_t) license; + attr->log_buf = (uintptr_t) get_log_buf(); + attr->prog_ifindex = ifindex_lo(); - sys_bpf(cmd, bogus_addr, 0); - printf("bpf(%s, %#lx, %lu) = %s\n", - name, bogus_addr, 0UL, errstr); + strncpy(log_buf, "log test", 9); } -#define BOGUS_BPF(cmd) bogus_bpf(cmd, #cmd) +static void +print_BPF_PROG_LOAD_attr4(const struct bpf_attr_check *check, unsigned long addr) +{ + printf("prog_type=BPF_PROG_TYPE_UNSPEC, insn_cnt=%u, insns=" INSNS_FMT + ", license=\"%s\", log_level=2718281828, log_size=4" + ", log_buf=\"log \"..." + ", kern_version=KERNEL_VERSION(51966, 240, 13)" + ", prog_flags=BPF_F_STRICT_ALIGNMENT|BPF_F_ANY_ALIGNMENT|0x4" + ", prog_name=\"0123456789abcde\"..., prog_ifindex=%s" + ", expected_attach_type=BPF_CGROUP_INET6_BIND", + (unsigned int) ARRAY_SIZE(insns), INSNS_ARG, + license, IFINDEX_LO_STR); +} -int -main(void) +static struct bpf_attr_check BPF_PROG_LOAD_checks[] = { + { + .data = { .BPF_PROG_LOAD_data = { .prog_type = 1 } }, + .size = offsetofend(struct BPF_PROG_LOAD_struct, prog_type), + .str = "prog_type=BPF_PROG_TYPE_SOCKET_FILTER" + ", insn_cnt=0, insns=NULL, license=NULL" + }, + { /* 1 */ + .data = { .BPF_PROG_LOAD_data = { + .prog_type = 22, + .insn_cnt = 0xbadc0ded, + .insns = 0, + .license = 0, + .log_level = 42, + .log_size = 3141592653U, + .log_buf = 0, + .kern_version = 0xcafef00d, + .prog_flags = 0, + } }, + .size = offsetofend(struct BPF_PROG_LOAD_struct, prog_flags), + .str = "prog_type=0x16 /* BPF_PROG_TYPE_??? */" + ", insn_cnt=3134983661, insns=NULL, license=NULL" + ", log_level=42, log_size=3141592653, log_buf=NULL" + ", kern_version=KERNEL_VERSION(51966, 240, 13)" + ", prog_flags=0", + }, + { /* 2 */ + .data = { .BPF_PROG_LOAD_data = { + .prog_type = 20, + .insn_cnt = 0xbadc0ded, + .insns = 0xffffffff00000000, + .license = 0xffffffff00000000, + .log_level = 2718281828U, + .log_size = log_buf_size, + .log_buf = 0xffffffff00000000, + .kern_version = 0xcafef00d, + .prog_flags = 1, + .prog_name = "fedcba987654321", + } }, + .size = offsetofend(struct BPF_PROG_LOAD_struct, prog_name), + .str = "prog_type=BPF_PROG_TYPE_SK_REUSEPORT" + ", insn_cnt=3134983661" + ", insns=" BIG_ADDR("0xffffffff00000000", "NULL") + ", license=" BIG_ADDR("0xffffffff00000000", "NULL") + ", log_level=2718281828, log_size=4096" + ", log_buf=" BIG_ADDR("0xffffffff00000000", "NULL") + ", kern_version=KERNEL_VERSION(51966, 240, 13)" + ", prog_flags=BPF_F_STRICT_ALIGNMENT" + ", prog_name=\"fedcba987654321\"", + }, + { /* 3 */ + .data = { .BPF_PROG_LOAD_data = { + .prog_type = 1, + .insn_cnt = ARRAY_SIZE(insns), + .log_level = 2718281828U, + .log_size = log_buf_size, + .kern_version = 0xcafef00d, + .prog_flags = 4, + .prog_name = "0123456789abcdef", + .prog_ifindex = 0xbeeffeed, + } }, + .size = offsetofend(struct BPF_PROG_LOAD_struct, prog_ifindex), + .init_fn = init_BPF_PROG_LOAD_attr3, + .print_fn = print_BPF_PROG_LOAD_attr3 + }, + { /* 4 */ + .data = { .BPF_PROG_LOAD_data = { + .prog_type = 0, + .insn_cnt = ARRAY_SIZE(insns), + .log_level = 2718281828U, + .log_size = 4, + .kern_version = 0xcafef00d, + .prog_flags = 7, + .prog_name = "0123456789abcdef", + .expected_attach_type = 9, + } }, + .size = offsetofend(struct BPF_PROG_LOAD_struct, + expected_attach_type), + .init_fn = init_BPF_PROG_LOAD_attr4, + .print_fn = print_BPF_PROG_LOAD_attr4 + }, + { /* 5 */ + .data = { .BPF_PROG_LOAD_data = { + .prog_flags = 2, + .expected_attach_type = 17, + .prog_btf_fd = 0xbadc0ded, + .func_info_rec_size = 0xdad1bef2, + .func_info = 0xfac1fed2fac3fed4, + .func_info_cnt = 0xdad3bef4, + .line_info_rec_size = 0xdad5bef6, + .line_info = 0xfac5fed5fac7fed8, + .line_info_cnt = 0xdad7bef8 + } }, + .size = offsetofend(struct BPF_PROG_LOAD_struct, + line_info_cnt), + .str = "prog_type=BPF_PROG_TYPE_UNSPEC" + ", insn_cnt=0" + ", insns=NULL" + ", license=NULL" + ", log_level=0" + ", log_size=0" + ", log_buf=NULL" + ", kern_version=KERNEL_VERSION(0, 0, 0)" + ", prog_flags=BPF_F_ANY_ALIGNMENT" + ", prog_name=\"\"" + ", prog_ifindex=0" + ", expected_attach_type=BPF_FLOW_DISSECTOR" + ", prog_btf_fd=-1159983635" + ", func_info_rec_size=3671178994" + ", func_info=0xfac1fed2fac3fed4" + ", func_info_cnt=3671310068" + ", line_info_rec_size=3671441142" + ", line_info=0xfac5fed5fac7fed8" + ", line_info_cnt=3671572216" + }, +}; + +static void +init_BPF_OBJ_PIN_attr(struct bpf_attr_check *check) { - efault = (unsigned long) tail_alloc(1) + 1; - - map_create(); - printf("bpf(BPF_MAP_CREATE" - ", {map_type=BPF_MAP_TYPE_UNSPEC, key_size=4" - ", value_size=8, max_entries=256}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_MAP_CREATE); - - map_any(BPF_MAP_LOOKUP_ELEM); - printf("bpf(BPF_MAP_LOOKUP_ELEM" - ", {map_fd=-1, key=0xdeadbeef}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_MAP_LOOKUP_ELEM); - - map_any(BPF_MAP_UPDATE_ELEM); - printf("bpf(BPF_MAP_UPDATE_ELEM" - ", {map_fd=-1, key=0xdeadbeef" - ", value=0xbadc0ded, flags=BPF_ANY}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_MAP_UPDATE_ELEM); - - map_any(BPF_MAP_DELETE_ELEM); - printf("bpf(BPF_MAP_DELETE_ELEM" - ", {map_fd=-1, key=0xdeadbeef}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_MAP_DELETE_ELEM); - - map_any(BPF_MAP_GET_NEXT_KEY); - printf("bpf(BPF_MAP_GET_NEXT_KEY" - ", {map_fd=-1, key=0xdeadbeef}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_MAP_GET_NEXT_KEY); - - prog_load(); - printf("bpf(BPF_PROG_LOAD" - ", {prog_type=BPF_PROG_TYPE_UNSPEC, insn_cnt=1, insns=%p" - ", license=\"GPL\", log_level=42, log_size=4096, log_buf=%p" - ", kern_version=0}, %u) = %s\n", - insns, log_buf, (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_PROG_LOAD); - -# ifdef HAVE_UNION_BPF_ATTR_BPF_FD - obj_manage(BPF_OBJ_PIN); - printf("bpf(BPF_OBJ_PIN" - ", {pathname=\"/sys/fs/bpf/foo/bar\", bpf_fd=-1}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_OBJ_PIN); - - obj_manage(BPF_OBJ_GET); - printf("bpf(BPF_OBJ_GET" - ", {pathname=\"/sys/fs/bpf/foo/bar\", bpf_fd=-1}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_OBJ_GET); -# endif - -# ifdef HAVE_UNION_BPF_ATTR_ATTACH_TYPE - prog_cgroup(BPF_PROG_ATTACH); - printf("bpf(BPF_PROG_ATTACH" - ", {target_fd=-1, attach_bpf_fd=-1" - ", attach_type=BPF_CGROUP_INET_INGRESS}, %u) = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_PROG_ATTACH); - - prog_cgroup(BPF_PROG_DETACH); - printf("bpf(BPF_PROG_DETACH" - ", {target_fd=-1, attach_type=BPF_CGROUP_INET_INGRESS}, %u)" - " = %s\n", - (unsigned) sizeof(union bpf_attr), errstr); - BOGUS_BPF(BPF_PROG_DETACH); -# endif - - bogus_bpf(0xfacefeed, "0xfacefeed /* BPF_??? */"); + struct BPF_OBJ_PIN_struct *attr = &check->data.BPF_OBJ_PIN_data; + attr->pathname = (uintptr_t) pathname; +} - puts("+++ exited with 0 +++"); - return 0; +static struct bpf_attr_check BPF_OBJ_PIN_checks[] = { + { + .data = { .BPF_OBJ_PIN_data = { .pathname = 0 } }, + .size = offsetofend(struct BPF_OBJ_PIN_struct, pathname), + .str = "pathname=NULL, bpf_fd=0" + }, + { + .data = { .BPF_OBJ_PIN_data = { + .pathname = 0xFFFFFFFFFFFFFFFFULL + } }, + .size = offsetofend(struct BPF_OBJ_PIN_struct, pathname), + .str = "pathname=" BIG_ADDR("0xffffffffffffffff", "0xffffffff") + ", bpf_fd=0", + }, + { + .data = { .BPF_OBJ_PIN_data = { .bpf_fd = -1 } }, + .size = offsetofend(struct BPF_OBJ_PIN_struct, bpf_fd), + .init_fn = init_BPF_OBJ_PIN_attr, + .str = "pathname=\"/sys/fs/bpf/foo/bar\", bpf_fd=-1" + }, + { + .data = { .BPF_OBJ_PIN_data = { + .bpf_fd = -1, + .file_flags = 0x18 + } }, + .size = offsetofend(struct BPF_OBJ_PIN_struct, file_flags), + .init_fn = init_BPF_OBJ_PIN_attr, + .str = "pathname=\"/sys/fs/bpf/foo/bar\", bpf_fd=-1" + ", file_flags=BPF_F_RDONLY|BPF_F_WRONLY" + } +}; + +#define BPF_OBJ_GET_checks BPF_OBJ_PIN_checks + +static const struct bpf_attr_check BPF_PROG_ATTACH_checks[] = { + { + .data = { .BPF_PROG_ATTACH_data = { .target_fd = -1 } }, + .size = offsetofend(struct BPF_PROG_ATTACH_struct, target_fd), + .str = "target_fd=-1, attach_bpf_fd=0" + ", attach_type=BPF_CGROUP_INET_INGRESS, attach_flags=0" + }, + { + .data = { .BPF_PROG_ATTACH_data = { + .target_fd = -1, + .attach_bpf_fd = -2, + .attach_type = 2, + .attach_flags = 1 + } }, + .size = offsetofend(struct BPF_PROG_ATTACH_struct, attach_flags), + .str = "target_fd=-1, attach_bpf_fd=-2" + ", attach_type=BPF_CGROUP_INET_SOCK_CREATE" + ", attach_flags=BPF_F_ALLOW_OVERRIDE" + } +}; + + +static const struct bpf_attr_check BPF_PROG_DETACH_checks[] = { + { + .data = { .BPF_PROG_DETACH_data = { .target_fd = -1 } }, + .size = offsetofend(struct BPF_PROG_DETACH_struct, target_fd), + .str = "target_fd=-1, attach_type=BPF_CGROUP_INET_INGRESS" + }, + { + .data = { .BPF_PROG_DETACH_data = { + .target_fd = -1, + .attach_type = 2 + } }, + .size = offsetofend(struct BPF_PROG_DETACH_struct, attach_type), + .str = "target_fd=-1, attach_type=BPF_CGROUP_INET_SOCK_CREATE" + } +}; + +static const struct bpf_attr_check BPF_PROG_TEST_RUN_checks[] = { + { + .data = { .BPF_PROG_TEST_RUN_data = { .prog_fd = -1 } }, + .size = offsetofend(struct BPF_PROG_TEST_RUN_struct, prog_fd), + .str = "test={prog_fd=-1, retval=0, data_size_in=0" + ", data_size_out=0, data_in=NULL, data_out=NULL" + ", repeat=0, duration=0}" + }, + { + .data = { .BPF_PROG_TEST_RUN_data = { + .prog_fd = -1, + .retval = 0xfac1fed2, + .data_size_in = 0xfac3fed4, + .data_size_out = 0xfac5fed6, + .data_in = (uint64_t) 0xfacef11dbadc2dedULL, + .data_out = (uint64_t) 0xfacef33dbadc4dedULL, + .repeat = 0xfac7fed8, + .duration = 0xfac9feda + } }, + .size = offsetofend(struct BPF_PROG_TEST_RUN_struct, duration), + .str = "test={prog_fd=-1, retval=4207017682" + ", data_size_in=4207148756, data_size_out=4207279830" + ", data_in=0xfacef11dbadc2ded" + ", data_out=0xfacef33dbadc4ded" + ", repeat=4207410904, duration=4207541978}" + } +}; + +static const struct bpf_attr_check BPF_PROG_GET_NEXT_ID_checks[] = { + { + .data = { .BPF_PROG_GET_NEXT_ID_data = { + .start_id = 0xdeadbeef + } }, + .size = offsetofend(struct BPF_PROG_GET_NEXT_ID_struct, start_id), + .str = "start_id=3735928559, next_id=0" + }, + { + .data = { .BPF_PROG_GET_NEXT_ID_data = { + .start_id = 0xdeadbeef + } }, + .size = 1, + .str = "start_id=" +#if WORDS_BIGENDIAN + "3724541952" /* 0xde000000 */ +#else + "239" /* 0x000000ef */ +#endif + ", next_id=0" + }, + { + .data = { .BPF_PROG_GET_NEXT_ID_data = { + .start_id = 0xbadc0ded, + .next_id = 0xcafef00d + } }, + .size = offsetofend(struct BPF_PROG_GET_NEXT_ID_struct, next_id), + .str = "start_id=3134983661, next_id=3405705229" + }, + { + .data = { .BPF_PROG_GET_NEXT_ID_data = { + .start_id = 0xbadc0ded, + .next_id = 0xcafef00d, + .open_flags = 0xffffff27 + } }, + .size = offsetofend(struct BPF_PROG_GET_NEXT_ID_struct, open_flags), + .str = "start_id=3134983661, next_id=3405705229" + ", open_flags=0xffffff27 /* BPF_F_??? */" + } +}; + +#define BPF_MAP_GET_NEXT_ID_checks BPF_PROG_GET_NEXT_ID_checks + +static const struct bpf_attr_check BPF_PROG_GET_FD_BY_ID_checks[] = { + { + .data = { .BPF_PROG_GET_FD_BY_ID_data = { + .prog_id = 0xdeadbeef + } }, + .size = offsetofend(struct BPF_PROG_GET_FD_BY_ID_struct, prog_id), + .str = "prog_id=3735928559, next_id=0" + }, + { + .data = { .BPF_PROG_GET_FD_BY_ID_data = { + .prog_id = 0xbadc0ded, + .next_id = 0xcafef00d + } }, + .size = offsetofend(struct BPF_PROG_GET_FD_BY_ID_struct, next_id), + .str = "prog_id=3134983661, next_id=3405705229" + }, + { + .data = { .BPF_PROG_GET_FD_BY_ID_data = { + .prog_id = 0xbadc0ded, + .next_id = 0xcafef00d, + .open_flags = 0xffffff27 + } }, + .size = offsetofend(struct BPF_PROG_GET_FD_BY_ID_struct, open_flags), + .str = "prog_id=3134983661, next_id=3405705229" + ", open_flags=0xffffff27 /* BPF_F_??? */" + } +}; + +static const struct bpf_attr_check BPF_MAP_GET_FD_BY_ID_checks[] = { + { + .data = { .BPF_MAP_GET_FD_BY_ID_data = { + .map_id = 0xdeadbeef + } }, + .size = offsetofend(struct BPF_MAP_GET_FD_BY_ID_struct, map_id), + .str = "map_id=3735928559, next_id=0" + }, + { + .data = { .BPF_MAP_GET_FD_BY_ID_data = { + .map_id = 0xbadc0ded, + .next_id = 0xcafef00d + } }, + .size = offsetofend(struct BPF_MAP_GET_FD_BY_ID_struct, next_id), + .str = "map_id=3134983661, next_id=3405705229" + }, + { + .data = { .BPF_MAP_GET_FD_BY_ID_data = { + .map_id = 0xbadc0ded, + .next_id = 0xcafef00d, + .open_flags = 0xffffff27 + } }, + .size = offsetofend(struct BPF_MAP_GET_FD_BY_ID_struct, open_flags), + .str = "map_id=3134983661, next_id=3405705229" + ", open_flags=0xffffff27 /* BPF_F_??? */" + } +}; + +static const struct bpf_attr_check BPF_OBJ_GET_INFO_BY_FD_checks[] = { + { + .data = { .BPF_OBJ_GET_INFO_BY_FD_data = { .bpf_fd = -1 } }, + .size = offsetofend(struct BPF_OBJ_GET_INFO_BY_FD_struct, bpf_fd), + .str = "info={bpf_fd=-1, info_len=0, info=NULL}" + }, + { + .data = { .BPF_OBJ_GET_INFO_BY_FD_data = { + .bpf_fd = -1, + .info_len = 0xdeadbeef, + .info = (uint64_t) 0xfacefeedbadc0dedULL + } }, + .size = offsetofend(struct BPF_OBJ_GET_INFO_BY_FD_struct, info), + .str = "info={bpf_fd=-1, info_len=3735928559" + ", info=0xfacefeedbadc0ded}" + } +}; + + +static uint32_t prog_load_ids[] = { 0, 1, 0xffffffff, 2718281828, }; +uint32_t *prog_load_ids_ptr; + +static void +init_BPF_PROG_QUERY_attr4(struct bpf_attr_check *check) +{ + struct BPF_PROG_QUERY_struct *attr = &check->data.BPF_PROG_QUERY_data; + + if (!prog_load_ids_ptr) + prog_load_ids_ptr = tail_memdup(prog_load_ids, + sizeof(prog_load_ids)); + + attr->prog_ids = (uintptr_t) prog_load_ids_ptr; + attr->prog_cnt = ARRAY_SIZE(prog_load_ids); } +static void +print_BPF_PROG_QUERY_attr4(const struct bpf_attr_check *check, unsigned long addr) +{ + printf("query={target_fd=-1153374643" + ", attach_type=0xfeedface /* BPF_??? */" + ", query_flags=BPF_F_QUERY_EFFECTIVE|0xdeadf00c" + ", attach_flags=BPF_F_ALLOW_MULTI|0xbeefcafc" +#if defined(INJECT_RETVAL) && INJECT_RETVAL > 0 + ", prog_ids=[0, 1, 4294967295, 2718281828], prog_cnt=4}" #else + ", prog_ids=%p, prog_cnt=4}", prog_load_ids_ptr +#endif + ); +} + +static void +init_BPF_PROG_QUERY_attr5(struct bpf_attr_check *check) +{ + struct BPF_PROG_QUERY_struct *attr = &check->data.BPF_PROG_QUERY_data; -SKIP_MAIN_UNDEFINED("__NR_bpf") + if (!prog_load_ids_ptr) + prog_load_ids_ptr = tail_memdup(prog_load_ids, + sizeof(prog_load_ids)); + attr->prog_ids = (uintptr_t) prog_load_ids_ptr; + attr->prog_cnt = ARRAY_SIZE(prog_load_ids) + 1; +} + +static void +print_BPF_PROG_QUERY_attr5(const struct bpf_attr_check *check, unsigned long addr) +{ + printf("query={target_fd=-1153374643" + ", attach_type=0xfeedface /* BPF_??? */" + ", query_flags=BPF_F_QUERY_EFFECTIVE|0xdeadf00c" + ", attach_flags=BPF_F_ALLOW_MULTI|0xbeefcafc" +#if defined(INJECT_RETVAL) && INJECT_RETVAL > 0 + ", prog_ids=[0, 1, 4294967295, 2718281828, ... /* %p */]" + ", prog_cnt=5}", + prog_load_ids_ptr + ARRAY_SIZE(prog_load_ids) +#else + ", prog_ids=%p, prog_cnt=5}", prog_load_ids_ptr #endif + ); +} + +static struct bpf_attr_check BPF_PROG_QUERY_checks[] = { + { + .data = { .BPF_PROG_QUERY_data = { .target_fd = -1 } }, + .size = offsetofend(struct BPF_PROG_QUERY_struct, target_fd), + .str = "query={target_fd=-1" + ", attach_type=BPF_CGROUP_INET_INGRESS, query_flags=0" + ", attach_flags=0, prog_ids=NULL, prog_cnt=0}", + }, + { /* 1 */ + .data = { .BPF_PROG_QUERY_data = { + .target_fd = 3141592653U, + .attach_type = 16, + .query_flags = 1, + .attach_flags = 3, + } }, + .size = offsetofend(struct BPF_PROG_QUERY_struct, attach_flags), + .str = "query={target_fd=-1153374643" + ", attach_type=BPF_LIRC_MODE2" + ", query_flags=BPF_F_QUERY_EFFECTIVE" + ", attach_flags=BPF_F_ALLOW_OVERRIDE|BPF_F_ALLOW_MULTI" + ", prog_ids=NULL, prog_cnt=0}", + }, + { /* 2 */ + .data = { .BPF_PROG_QUERY_data = { + .target_fd = 3141592653U, + .attach_type = 18, + .query_flags = 0xfffffffe, + .attach_flags = 0xfffffffc, + .prog_ids = 0xffffffffffffffffULL, + .prog_cnt = 2718281828, + } }, + .size = offsetofend(struct BPF_PROG_QUERY_struct, prog_cnt), + .str = "query={target_fd=-1153374643" + ", attach_type=0x12 /* BPF_??? */" + ", query_flags=0xfffffffe /* BPF_F_QUERY_??? */" + ", attach_flags=0xfffffffc /* BPF_F_??? */" + ", prog_ids=" + BIG_ADDR("0xffffffffffffffff", "0xffffffff") + ", prog_cnt=2718281828}", + }, + { /* 3 */ + .data = { .BPF_PROG_QUERY_data = { + .target_fd = 3141592653U, + .attach_type = 0xfeedface, + .query_flags = 0xdeadf00d, + .attach_flags = 0xbeefcafe, + .prog_ids = 0xffffffffffffffffULL, + .prog_cnt = 0, + } }, + .size = offsetofend(struct BPF_PROG_QUERY_struct, prog_cnt), + .str = "query={target_fd=-1153374643" + ", attach_type=0xfeedface /* BPF_??? */" + ", query_flags=BPF_F_QUERY_EFFECTIVE|0xdeadf00c" + ", attach_flags=BPF_F_ALLOW_MULTI|0xbeefcafc" + ", prog_ids=" BIG_ADDR_MAYBE("0xffffffffffffffff") "[]" + ", prog_cnt=0}", + }, + { /* 4 */ + .data = { .BPF_PROG_QUERY_data = { + .target_fd = 3141592653U, + .attach_type = 0xfeedface, + .query_flags = 0xdeadf00d, + .attach_flags = 0xbeefcafe, + } }, + .size = offsetofend(struct BPF_PROG_QUERY_struct, prog_cnt), + .init_fn = init_BPF_PROG_QUERY_attr4, + .print_fn = print_BPF_PROG_QUERY_attr4, + }, + { /* 5 */ + .data = { .BPF_PROG_QUERY_data = { + .target_fd = 3141592653U, + .attach_type = 0xfeedface, + .query_flags = 0xdeadf00d, + .attach_flags = 0xbeefcafe, + } }, + .size = offsetofend(struct BPF_PROG_QUERY_struct, prog_cnt), + .init_fn = init_BPF_PROG_QUERY_attr5, + .print_fn = print_BPF_PROG_QUERY_attr5, + }, +}; + + +static void +init_BPF_RAW_TRACEPOINT_attr2(struct bpf_attr_check *check) +{ + /* TODO: test the 128 byte limit */ + static const char tp_name[] = "0123456789qwertyuiop0123456789qwe"; + + struct BPF_RAW_TRACEPOINT_OPEN_struct *attr = + &check->data.BPF_RAW_TRACEPOINT_OPEN_data; + + attr->name = (uintptr_t) tp_name; +} + +static struct bpf_attr_check BPF_RAW_TRACEPOINT_OPEN_checks[] = { + { + .data = { .BPF_RAW_TRACEPOINT_OPEN_data = { .name = 0 } }, + .size = offsetofend(struct BPF_RAW_TRACEPOINT_OPEN_struct, + name), + .str = "raw_tracepoint={name=NULL, prog_fd=0}", + }, + { /* 1 */ + .data = { .BPF_RAW_TRACEPOINT_OPEN_data = { + .name = 0xffffffff00000000ULL, + .prog_fd = 0xdeadbeef, + } }, + .size = offsetofend(struct BPF_RAW_TRACEPOINT_OPEN_struct, + prog_fd), + .str = "raw_tracepoint=" + "{name=" BIG_ADDR("0xffffffff00000000", "NULL") + ", prog_fd=-559038737}", + }, + { + .data = { .BPF_RAW_TRACEPOINT_OPEN_data = { + .prog_fd = 0xdeadbeef, + } }, + .size = offsetofend(struct BPF_RAW_TRACEPOINT_OPEN_struct, + prog_fd), + .init_fn = init_BPF_RAW_TRACEPOINT_attr2, + .str = "raw_tracepoint=" + "{name=\"0123456789qwertyuiop0123456789qw\"..." + ", prog_fd=-559038737}", + } +}; + +static void +init_BPF_BTF_LOAD_attr(struct bpf_attr_check *check) +{ + static const char sample_btf_data[] = "bPf\0daTum"; + + static char *btf_data; + if (!btf_data) + btf_data = tail_memdup(sample_btf_data, + sizeof(sample_btf_data) - 1); + + struct BPF_BTF_LOAD_struct *attr = &check->data.BPF_BTF_LOAD_data; + attr->btf = (uintptr_t) btf_data; +} + +static struct bpf_attr_check BPF_BTF_LOAD_checks[] = { + { + .data = { .BPF_BTF_LOAD_data = { .btf = 0 } }, + .size = offsetofend(struct BPF_BTF_LOAD_struct, btf), + .str = "btf=NULL, btf_log_buf=NULL, btf_size=0" + ", btf_log_size=0, btf_log_level=0" + }, + { /* 1 */ + .data = { .BPF_BTF_LOAD_data = { + .btf_log_buf = 0xfacefeeddeadbeefULL, + .btf_size = 9, + .btf_log_size = -1U, + .btf_log_level = 42 + } }, + .size = offsetofend(struct BPF_BTF_LOAD_struct, btf_log_level), + .init_fn = init_BPF_BTF_LOAD_attr, + .str = "btf=\"bPf\\0daTum\"" + ", btf_log_buf=0xfacefeeddeadbeef" + ", btf_size=9" + ", btf_log_size=4294967295" + ", btf_log_level=42" + } +}; + +static const struct bpf_attr_check BPF_BTF_GET_FD_BY_ID_checks[] = { + { + .data = { .BPF_BTF_GET_FD_BY_ID_data = { .btf_id = 0xdeadbeef } }, + .size = offsetofend(struct BPF_BTF_GET_FD_BY_ID_struct, btf_id), + .str = "btf_id=3735928559" + } +}; + +static const struct bpf_attr_check BPF_TASK_FD_QUERY_checks[] = { + { + .data = { .BPF_TASK_FD_QUERY_data = { .pid = 0xdeadbeef } }, + .size = offsetofend(struct BPF_TASK_FD_QUERY_struct, pid), + .str = "task_fd_query={pid=3735928559, fd=0, flags=0" + ", buf_len=0, buf=NULL, prog_id=0" + ", fd_type=BPF_FD_TYPE_RAW_TRACEPOINT" + ", probe_offset=0, probe_addr=0}" + }, + { /* 1 */ + .data = { .BPF_TASK_FD_QUERY_data = { + .pid = 0xcafef00d, + .fd = 0xdeadbeef, + .flags = 0xfacefeed, + .buf_len = 0xdefaced, + .buf = 0xfffffffffffffffe, + .prog_id = 0xbadc0ded, + .fd_type = 5, + .probe_offset = 0xfac1fed2fac3fed4, + .probe_addr = 0xfac5fed5fac7fed8 + } }, + .size = offsetofend(struct BPF_TASK_FD_QUERY_struct, probe_addr), + .str = "task_fd_query={pid=3405705229" + ", fd=-559038737" + ", flags=4207869677" + ", buf_len=233811181" + ", buf=" BIG_ADDR("0xfffffffffffffffe", "0xfffffffe") + ", prog_id=3134983661" + ", fd_type=BPF_FD_TYPE_URETPROBE" + ", probe_offset=0xfac1fed2fac3fed4" + ", probe_addr=0xfac5fed5fac7fed8}" + } +}; + + +#define CHK(cmd_) \ + { \ + cmd_, #cmd_, \ + cmd_##_checks, ARRAY_SIZE(cmd_##_checks), \ + } \ + /* End of CHK definition */ + +int +main(void) +{ + static const struct bpf_check checks[] = { + CHK(BPF_MAP_CREATE), + CHK(BPF_MAP_LOOKUP_ELEM), + CHK(BPF_MAP_UPDATE_ELEM), + CHK(BPF_MAP_DELETE_ELEM), + CHK(BPF_MAP_GET_NEXT_KEY), + CHK(BPF_PROG_LOAD), + CHK(BPF_OBJ_PIN), + CHK(BPF_OBJ_GET), + CHK(BPF_PROG_ATTACH), + CHK(BPF_PROG_DETACH), + CHK(BPF_PROG_TEST_RUN), + CHK(BPF_PROG_GET_NEXT_ID), + CHK(BPF_MAP_GET_NEXT_ID), + CHK(BPF_PROG_GET_FD_BY_ID), + CHK(BPF_MAP_GET_FD_BY_ID), + CHK(BPF_OBJ_GET_INFO_BY_FD), + CHK(BPF_PROG_QUERY), + CHK(BPF_RAW_TRACEPOINT_OPEN), + CHK(BPF_BTF_LOAD), + CHK(BPF_BTF_GET_FD_BY_ID), + CHK(BPF_TASK_FD_QUERY), + CHK(BPF_MAP_LOOKUP_AND_DELETE_ELEM), + }; + + page_size = get_page_size(); + end_of_page = (unsigned long) tail_alloc(1) + 1; + + for (size_t i = 0; i < ARRAY_SIZE(checks); i++) + test_bpf(checks + i); + + sys_bpf(0xfacefeed, 0, (kernel_ulong_t) 0xfacefeedbadc0dedULL); + printf("bpf(0xfacefeed /* BPF_??? */, NULL, %u) = %s\n", + 0xbadc0dedu, errstr); + + sys_bpf(0xfacefeed, end_of_page, 40); + printf("bpf(0xfacefeed /* BPF_??? */, %#lx, 40) = %s\n", + end_of_page, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/bpf.gen.test b/tests/bpf.gen.test new file mode 100755 index 00000000..1391d6b8 --- /dev/null +++ b/tests/bpf.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (bpf -a20 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests/bpf.test b/tests/bpf.test deleted file mode 100755 index adf0d576..00000000 --- a/tests/bpf.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check bpf syscall decoding. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a20 diff --git a/tests/brk.c b/tests/brk.c index 572ebd61..caf40e13 100644 --- a/tests/brk.c +++ b/tests/brk.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/brk.test b/tests/brk.test index 8c0e2e49..e90cf8ab 100755 --- a/tests/brk.test +++ b/tests/brk.test @@ -1,10 +1,14 @@ #!/bin/sh - +# # Check brk syscall decoding. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog > /dev/null run_strace -a10 -ebrk $args > "$EXP" match_grep "$LOG" "$EXP" -rm -f "$EXP" diff --git a/tests/btrfs-X.test b/tests/btrfs-X.test new file mode 100755 index 00000000..58770ae0 --- /dev/null +++ b/tests/btrfs-X.test @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Check verbose xlat decoding of btrfs ioctl. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog ../btrfs -X > /dev/null +run_strace -a16 -Xverbose -eioctl $args > "$EXP" +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests/btrfs-v.test b/tests/btrfs-v.test index 1ee17b4b..f67d4126 100755 --- a/tests/btrfs-v.test +++ b/tests/btrfs-v.test @@ -1,15 +1,16 @@ #!/bin/sh - -# Check verbose decoding of btrfs ioctl +# +# Check verbose decoding of btrfs ioctl. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./btrfs -v > /dev/null -run_strace -a16 -veioctl $args > "$EXP" check_prog grep +run_prog ../btrfs -v > /dev/null +run_strace -a16 -veioctl $args > "$EXP" grep -v '^ioctl([012],' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" - -exit 0 diff --git a/tests/btrfs-vX.test b/tests/btrfs-vX.test new file mode 100755 index 00000000..db15a50c --- /dev/null +++ b/tests/btrfs-vX.test @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Check verbose, verbose xlat decoding of btrfs ioctl. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +check_prog grep +run_prog ../btrfs -v -X > /dev/null +run_strace -a16 -Xverbose -veioctl $args > "$EXP" +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests/btrfs-vw.test b/tests/btrfs-vw.test index c7e40ad7..eba59d7a 100755 --- a/tests/btrfs-vw.test +++ b/tests/btrfs-vw.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check verbose decoding of btrfs ioctl w/ live ioctls. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later # WARNING: USE OF THIS TEST WILL MODIFY AN EXISTING BTRFS FILE SYSTEM @@ -18,12 +23,8 @@ elif [ ! -d "${BTRFS_MOUNTPOINT}" ]; then skip_ "\$BTRFS_MOUNTPOINT does not point to a directory" fi -run_prog ./btrfs -v -w "${BTRFS_MOUNTPOINT}" > /dev/null -run_strace -a16 -veioctl $args > "$EXP" check_prog grep +run_prog ../btrfs -v -w "${BTRFS_MOUNTPOINT}" > /dev/null +run_strace -a16 -veioctl $args > "$EXP" grep -v '^ioctl([012],' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" - -exit 0 diff --git a/tests/btrfs-vwX.test b/tests/btrfs-vwX.test new file mode 100755 index 00000000..20f60abe --- /dev/null +++ b/tests/btrfs-vwX.test @@ -0,0 +1,30 @@ +#!/bin/sh +# +# Check verbose, verbose xlat decoding of btrfs ioctl w/ live ioctls. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +# WARNING: USE OF THIS TEST WILL MODIFY AN EXISTING BTRFS FILE SYSTEM + +# Typical usage: +# mkfs.btrfs +# mount /mnt +# BTRFS_MOUNTPOINT=/mnt make check TESTS="btrfs-vwX" +# umount /mnt + +. "${srcdir=.}/init.sh" + +if [ -z "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT not set" +elif [ ! -d "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT does not point to a directory" +fi + +check_prog grep +run_prog ../btrfs -v -w -X "${BTRFS_MOUNTPOINT}" > /dev/null +run_strace -a16 -Xverbose -veioctl $args > "$EXP" +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests/btrfs-w.test b/tests/btrfs-w.test index 6238dca8..ba9b220d 100755 --- a/tests/btrfs-w.test +++ b/tests/btrfs-w.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check decoding of btrfs ioctl w/ live ioctls. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later # WARNING: USE OF THIS TEST WILL MODIFY AN EXISTING BTRFS FILE SYSTEM @@ -18,12 +23,8 @@ elif [ ! -d "${BTRFS_MOUNTPOINT}" ]; then skip_ "\$BTRFS_MOUNTPOINT does not point to a directory" fi -run_prog ./btrfs -w "${BTRFS_MOUNTPOINT}" > /dev/null -run_strace -a16 -eioctl $args > "$EXP" check_prog grep +run_prog ../btrfs -w "${BTRFS_MOUNTPOINT}" > /dev/null +run_strace -a16 -eioctl $args > "$EXP" grep -v '^ioctl([012],' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" - -exit 0 diff --git a/tests/btrfs-wX.test b/tests/btrfs-wX.test new file mode 100755 index 00000000..1a7dea2e --- /dev/null +++ b/tests/btrfs-wX.test @@ -0,0 +1,30 @@ +#!/bin/sh +# +# Check verbose xlat decoding of btrfs ioctl w/ live ioctls. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +# WARNING: USE OF THIS TEST WILL MODIFY AN EXISTING BTRFS FILE SYSTEM + +# Typical usage: +# mkfs.btrfs +# mount /mnt +# BTRFS_MOUNTPOINT=/mnt make check TESTS="btrfs-wX" +# umount /mnt + +. "${srcdir=.}/init.sh" + +if [ -z "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT not set" +elif [ ! -d "${BTRFS_MOUNTPOINT}" ]; then + skip_ "\$BTRFS_MOUNTPOINT does not point to a directory" +fi + +check_prog grep +run_prog ../btrfs -w -X "${BTRFS_MOUNTPOINT}" > /dev/null +run_strace -a16 -Xverbose -eioctl $args > "$EXP" +grep -v '^ioctl([012],' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests/btrfs.c b/tests/btrfs.c index b3e23f80..f1a26bf3 100644 --- a/tests/btrfs.c +++ b/tests/btrfs.c @@ -1,57 +1,73 @@ +/* + * Copyright (c) 2016-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #ifdef HAVE_LINUX_BTRFS_H -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "xlat.h" - -#include "xlat/btrfs_balance_args.h" -#include "xlat/btrfs_balance_flags.h" -#include "xlat/btrfs_balance_state.h" -#include "xlat/btrfs_compress_types.h" -#include "xlat/btrfs_defrag_flags.h" -#include "xlat/btrfs_dev_stats_values.h" -#include "xlat/btrfs_dev_stats_flags.h" -#include "xlat/btrfs_qgroup_inherit_flags.h" -#include "xlat/btrfs_qgroup_limit_flags.h" -#include "xlat/btrfs_scrub_flags.h" -#include "xlat/btrfs_send_flags.h" -#include "xlat/btrfs_space_info_flags.h" -#include "xlat/btrfs_snap_flags_v2.h" -#include "xlat/btrfs_tree_objectids.h" -#include "xlat/btrfs_features_compat.h" -#include "xlat/btrfs_features_compat_ro.h" -#include "xlat/btrfs_features_incompat.h" -#include "xlat/btrfs_key_types.h" - -#ifdef HAVE_LINUX_FIEMAP_H -# include -# include "xlat/fiemap_flags.h" -# include "xlat/fiemap_extent_flags.h" -#endif - -#ifndef BTRFS_LABEL_SIZE -# define BTRFS_LABEL_SIZE 256 -#endif - -#ifndef BTRFS_NAME_LEN -# define BTRFS_NAME_LEN 255 -#endif +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include "xlat.h" + +# include "xlat/btrfs_balance_args.h" +# include "xlat/btrfs_balance_flags.h" +# include "xlat/btrfs_balance_state.h" +# include "xlat/btrfs_compress_types.h" +# include "xlat/btrfs_cont_reading_from_srcdev_mode.h" +# include "xlat/btrfs_defrag_flags.h" +# include "xlat/btrfs_dev_stats_values.h" +# include "xlat/btrfs_dev_stats_flags.h" +# include "xlat/btrfs_qgroup_inherit_flags.h" +# include "xlat/btrfs_qgroup_limit_flags.h" +# include "xlat/btrfs_scrub_flags.h" +# include "xlat/btrfs_send_flags.h" +# include "xlat/btrfs_space_info_flags.h" +# include "xlat/btrfs_snap_flags_v2.h" +# include "xlat/btrfs_tree_objectids.h" +# include "xlat/btrfs_features_compat.h" +# include "xlat/btrfs_features_compat_ro.h" +# include "xlat/btrfs_features_incompat.h" +# include "xlat/btrfs_key_types.h" + +# ifdef HAVE_LINUX_FIEMAP_H +# include +# include "xlat/fiemap_flags.h" +# include "xlat/fiemap_extent_flags.h" +# endif + +# ifndef BTRFS_LABEL_SIZE +# define BTRFS_LABEL_SIZE 256 +# endif + +# ifndef BTRFS_NAME_LEN +# define BTRFS_NAME_LEN 255 +# endif + +# ifndef FS_IOC_GETFSLABEL +# define FS_IOC_GETFSLABEL BTRFS_IOC_GET_FSLABEL +# endif + +# ifndef FS_IOC_SETFSLABEL +# define FS_IOC_SETFSLABEL BTRFS_IOC_SET_FSLABEL +# endif /* * Prior to Linux 3.12, the BTRFS_IOC_DEFAULT_SUBVOL used u64 in @@ -61,8 +77,13 @@ typedef __u64 u64; static const char *btrfs_test_root; static int btrfs_test_dir_fd; -static bool verbose = false; -static bool write_ok = false; +static bool verbose; +static bool write_ok; +static bool verbose_xlat; + +static const char *path; +static const char dir_name_fmt[] = "strace-test-%d"; +static char dir_name[sizeof(dir_name_fmt) + sizeof(int) * 3]; const unsigned char uuid_reference[BTRFS_UUID_SIZE] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, @@ -71,50 +92,50 @@ const unsigned char uuid_reference[BTRFS_UUID_SIZE] = { const char uuid_reference_string[] = "01234567-89ab-cdef-fedc-ba9876543210"; -#ifndef BTRFS_IOC_QUOTA_RESCAN +# ifndef BTRFS_IOC_QUOTA_RESCAN struct btrfs_ioctl_quota_rescan_args { uint64_t flags, progress, reserved[6]; }; -# define BTRFS_IOC_QUOTA_RESCAN _IOW(BTRFS_IOCTL_MAGIC, 44, \ - struct btrfs_ioctl_quota_rescan_args) -# define BTRFS_IOC_QUOTA_RESCAN_STATUS _IOR(BTRFS_IOCTL_MAGIC, 45, \ - struct btrfs_ioctl_quota_rescan_args) -#endif - -#ifndef BTRFS_IOC_QUOTA_RESCAN_WAIT -# define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46) -#endif - -#ifndef BTRFS_IOC_GET_FEATURES -# define BTRFS_IOC_GET_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \ - struct btrfs_ioctl_feature_flags) -# define BTRFS_IOC_SET_FEATURES _IOW(BTRFS_IOCTL_MAGIC, 57, \ - struct btrfs_ioctl_feature_flags[2]) -# define BTRFS_IOC_GET_SUPPORTED_FEATURES _IOR(BTRFS_IOCTL_MAGIC, 57, \ - struct btrfs_ioctl_feature_flags[3]) -#endif - -#ifndef HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS +# define BTRFS_IOC_QUOTA_RESCAN \ + _IOW(BTRFS_IOCTL_MAGIC, 44, struct btrfs_ioctl_quota_rescan_args) +# define BTRFS_IOC_QUOTA_RESCAN_STATUS \ + _IOR(BTRFS_IOCTL_MAGIC, 45, struct btrfs_ioctl_quota_rescan_args) +# endif + +# ifndef BTRFS_IOC_QUOTA_RESCAN_WAIT +# define BTRFS_IOC_QUOTA_RESCAN_WAIT _IO(BTRFS_IOCTL_MAGIC, 46) +# endif + +# ifndef BTRFS_IOC_GET_FEATURES +# define BTRFS_IOC_GET_FEATURES \ + _IOR(BTRFS_IOCTL_MAGIC, 57, struct btrfs_ioctl_feature_flags) +# define BTRFS_IOC_SET_FEATURES \ + _IOW(BTRFS_IOCTL_MAGIC, 57, struct btrfs_ioctl_feature_flags[2]) +# define BTRFS_IOC_GET_SUPPORTED_FEATURES \ + _IOR(BTRFS_IOCTL_MAGIC, 57, struct btrfs_ioctl_feature_flags[3]) +# endif + +# ifndef HAVE_STRUCT_BTRFS_IOCTL_FEATURE_FLAGS_COMPAT_FLAGS struct btrfs_ioctl_feature_flags { - uint64_t compat_flags; - uint64_t compat_ro_flags; - uint64_t incompat_flags; + uint64_t compat_flags; + uint64_t compat_ro_flags; + uint64_t incompat_flags; }; -#endif +# endif -#ifndef HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START +# ifndef HAVE_STRUCT_BTRFS_IOCTL_DEFRAG_RANGE_ARGS_START struct btrfs_ioctl_defrag_range_args { - uint64_t start; - uint64_t len; - uint64_t flags; - uint32_t extent_thresh; - uint32_t compress_type; - uint32_t unused[4]; + uint64_t start; + uint64_t len; + uint64_t flags; + uint32_t extent_thresh; + uint32_t compress_type; + uint32_t unused[4]; }; -#endif +# endif -#ifndef FIDEDUPERANGE -# define FIDEDUPERANGE _IOWR(0x94, 54, struct file_dedupe_range) +# ifndef FIDEDUPERANGE +# define FIDEDUPERANGE _IOWR(0x94, 54, struct file_dedupe_range) struct file_dedupe_range_info { int64_t dest_fd; /* in - destination file */ uint64_t dest_offset; /* in - start of extent in destination */ @@ -137,27 +158,99 @@ struct file_dedupe_range { uint32_t reserved2; /* must be zero */ struct file_dedupe_range_info info[0]; }; -#endif +# endif -#ifndef BTRFS_IOC_TREE_SEARCH_V2 -# define BTRFS_IOC_TREE_SEARCH_V2 _IOWR(BTRFS_IOCTL_MAGIC, 17, \ - struct btrfs_ioctl_search_args_v2) +# ifndef BTRFS_IOC_TREE_SEARCH_V2 +# define BTRFS_IOC_TREE_SEARCH_V2 \ + _IOWR(BTRFS_IOCTL_MAGIC, 17, struct btrfs_ioctl_search_args_v2) struct btrfs_ioctl_search_args_v2 { struct btrfs_ioctl_search_key key; /* in/out - search parameters */ uint64_t buf_size; /* in - size of buffer * out - on EOVERFLOW: needed size * to store item */ - uint64_t buf[0]; /* out - found items */ + uint64_t buf[0]; /* out - found items */ }; -#endif +# endif + + +static const char * +sprint_xlat_(uint32_t val, const char *xlat) +{ + static char str[256]; + int ret; + + if (verbose_xlat) { + ret = snprintf(str, sizeof(str), "%#x /* %s */", val, xlat); + if (ret < 0) + perror_msg_and_fail("sprint_ioc(%#x, %s)", val, xlat); + if ((unsigned) ret >= sizeof(str)) + error_msg_and_fail("sprint_ioc(%#x, %s): buffer " + "overflow", val, xlat); + + return str; + } + + return xlat; +} static const char * -maybe_print_uint64max(uint64_t val) +sprint_makedev(unsigned long long val) +{ + static char devid[256]; + int ret; + + if (verbose_xlat) + ret = snprintf(devid, sizeof(devid), + "%#llx /* makedev(%#x, %#x) */", + val, major(val), minor(val)); + else + ret = snprintf(devid, sizeof(devid), + "makedev(%#x, %#x)", major(val), minor(val)); + + if (ret < 0) + perror_msg_and_fail("sprint_makedev(%llx)", val); + if ((unsigned) ret >= sizeof(devid)) + error_msg_and_fail("sprint_makedev(%llx): buffer " + "overflow", val); + return devid; +} + +# define ioc(x_) sprint_xlat_(x_, #x_) + +void +prfl_btrfs(const struct xlat *xlat, const unsigned long long val, + const char *str) +{ + if (verbose_xlat && val) + printf("%#llx /* ", val); + printflags(xlat, val, str); + if (verbose_xlat && val) + printf(" */"); +} + +void +prxval_btrfs(const struct xlat *xlat, const unsigned long long val, + const char *str, bool known) { - if (val == UINT64_MAX) - return " /* UINT64_MAX */"; - return ""; + if (verbose_xlat && known) + printf("%#llx /* ", val); + printxval(xlat, val, str); + if (verbose_xlat && known) + printf(" */"); +} + +static void +print_uint64(const char *prefix, uint64_t val) +{ + if (val == UINT64_MAX) { + if (verbose_xlat) + printf("%s%" PRIu64 " /* UINT64_MAX */", prefix, val); + else + printf("%sUINT64_MAX", prefix); + } else { + printf("%s%" PRIu64, prefix, val); + } } /* takes highest valid flag bit */ @@ -183,10 +276,10 @@ static void btrfs_test_trans_ioctls(void) { ioctl(-1, BTRFS_IOC_TRANS_START, NULL); - printf("ioctl(-1, BTRFS_IOC_TRANS_START) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_TRANS_START)); ioctl(-1, BTRFS_IOC_TRANS_END, NULL); - printf("ioctl(-1, BTRFS_IOC_TRANS_END) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_TRANS_END)); } /* @@ -202,14 +295,15 @@ btrfs_test_sync_ioctls(void) uint64_t u64val = 0xdeadbeefbadc0dedULL; ioctl(-1, BTRFS_IOC_SYNC, NULL); - printf("ioctl(-1, BTRFS_IOC_SYNC) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_SYNC)); ioctl(-1, BTRFS_IOC_WAIT_SYNC, NULL); - printf("ioctl(-1, BTRFS_IOC_WAIT_SYNC, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_WAIT_SYNC)); ioctl(-1, BTRFS_IOC_WAIT_SYNC, &u64val); - printf("ioctl(-1, BTRFS_IOC_WAIT_SYNC, [%" PRIu64 - "]) = -1 EBADF (%m)\n", u64val); + printf("ioctl(-1, %s, [%" PRIu64 "]) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_WAIT_SYNC), u64val); /* * The live test of BTRFS_IOC_SYNC happens as a part of the test @@ -221,24 +315,24 @@ static void btrfs_print_qgroup_inherit(struct btrfs_qgroup_inherit *inherit) { printf("{flags="); - printflags(btrfs_qgroup_inherit_flags, inherit->flags, + prfl_btrfs(btrfs_qgroup_inherit_flags, inherit->flags, "BTRFS_QGROUP_INHERIT_???"); printf(", num_qgroups=%" PRI__u64 ", num_ref_copies=%" PRI__u64 - ", num_excl_copies=%" PRI__u64", lim={flags=", + ", num_excl_copies=%" PRI__u64 ", lim={flags=", inherit->num_qgroups, inherit->num_ref_copies, inherit->num_excl_copies); - printflags(btrfs_qgroup_limit_flags, + prfl_btrfs(btrfs_qgroup_limit_flags, inherit->lim.flags, "BTRFS_QGROUP_LIMIT_???"); printf(", max_rfer=%" PRI__u64 ", max_excl=%" PRI__u64 ", rsv_rfer=%" PRI__u64 ", rsv_excl=%" PRI__u64 - "}, qgroups=", + "}, ", inherit->lim.max_rfer, inherit->lim.max_excl, inherit->lim.rsv_rfer, inherit->lim.rsv_excl); if (verbose) { unsigned int i; - printf("["); + printf("qgroups=["); for (i = 0; i < inherit->num_qgroups; i++) { if (i > 0) printf(", "); @@ -255,7 +349,7 @@ static void btrfs_print_vol_args_v2(struct btrfs_ioctl_vol_args_v2 *args, int print_qgroups) { printf("{fd=%d, flags=", (int) args->fd); - printflags(btrfs_snap_flags_v2, args->flags, "BTRFS_SUBVOL_???"); + prfl_btrfs(btrfs_snap_flags_v2, args->flags, "BTRFS_SUBVOL_???"); if (args->flags & BTRFS_SUBVOL_QGROUP_INHERIT) { printf(", size=%" PRI__u64 ", qgroup_inherit=", args->size); @@ -303,61 +397,64 @@ btrfs_test_subvol_ioctls(void) strcpy(vol_args.name, subvol_name); ioctl(-1, BTRFS_IOC_SNAP_CREATE, NULL); - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SNAP_CREATE)); ioctl(-1, BTRFS_IOC_SNAP_CREATE, &vol_args); - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE, " - "{fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + printf("ioctl(-1, %s, {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SNAP_CREATE), vol_args.name); ioctl(-1, BTRFS_IOC_SUBVOL_CREATE, &vol_args); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE, " - "{fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + printf("ioctl(-1, %s, {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SUBVOL_CREATE), vol_args.name); ioctl(-1, BTRFS_IOC_SNAP_DESTROY, &vol_args); - printf("ioctl(-1, BTRFS_IOC_SNAP_DESTROY," - " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + printf("ioctl(-1, %s, {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SNAP_DESTROY), vol_args.name); strncpy(vol_args.name, long_subvol_name, BTRFS_PATH_NAME_MAX); ioctl(-1, BTRFS_IOC_SNAP_CREATE, &vol_args); - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE," - " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + printf("ioctl(-1, %s, {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SNAP_CREATE), vol_args.name); ioctl(-1, BTRFS_IOC_SUBVOL_CREATE, &vol_args); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE," - " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + printf("ioctl(-1, %s, {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SUBVOL_CREATE), vol_args.name); ioctl(-1, BTRFS_IOC_SNAP_DESTROY, &vol_args); - printf("ioctl(-1, BTRFS_IOC_SNAP_DESTROY," - " {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", vol_args.name); + printf("ioctl(-1, %s, {fd=0, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SNAP_DESTROY), vol_args.name); long_subvol_name = realloc(long_subvol_name, BTRFS_SUBVOL_NAME_MAX); if (!long_subvol_name) perror_msg_and_fail("realloc failed"); ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, NULL); - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SNAP_CREATE_V2)); ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, NULL); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SUBVOL_CREATE_V2)); strcpy(vol_args_v2.name, subvol_name); - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SNAP_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 1); ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SUBVOL_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 1); ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); strncpy(vol_args_v2.name, long_subvol_name, BTRFS_SUBVOL_NAME_MAX); - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SNAP_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 1); ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SUBVOL_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 1); ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); @@ -365,12 +462,12 @@ btrfs_test_subvol_ioctls(void) strcpy(vol_args_v2.name, subvol_name); vol_args_v2.qgroup_inherit = bad_pointer; - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SNAP_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 0); ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SUBVOL_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 0); ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); @@ -395,31 +492,33 @@ btrfs_test_subvol_ioctls(void) inherit->lim.rsv_excl = u64val; vol_args_v2.qgroup_inherit = inherit; - printf("ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SNAP_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 1); ioctl(-1, BTRFS_IOC_SNAP_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, "); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SUBVOL_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 1); ioctl(-1, BTRFS_IOC_SUBVOL_CREATE_V2, &vol_args_v2); printf(") = -1 EBADF (%m)\n"); ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, NULL); - printf("ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_DEFAULT_SUBVOL)); ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, &u64val); - printf("ioctl(-1, BTRFS_IOC_DEFAULT_SUBVOL, [%" - PRIu64 "]) = -1 EBADF (%m)\n", u64val); + printf("ioctl(-1, %s, [%" PRIu64 "]) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_DEFAULT_SUBVOL), u64val); - printf("ioctl(-1, BTRFS_IOC_SUBVOL_SETFLAGS, "); - printflags(btrfs_snap_flags_v2, vol_args_v2.flags, + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_SUBVOL_SETFLAGS)); + prfl_btrfs(btrfs_snap_flags_v2, vol_args_v2.flags, "BTRFS_SUBVOL_???"); ioctl(-1, BTRFS_IOC_SUBVOL_SETFLAGS, &vol_args_v2.flags); printf(") = -1 EBADF (%m)\n"); if (write_ok) { struct btrfs_ioctl_vol_args_v2 args_passed; + long ret; /* * Returns transid if flags & BTRFS_SUBVOL_CREATE_ASYNC * - BTRFS_IOC_SNAP_CREATE_V2 @@ -433,12 +532,15 @@ btrfs_test_subvol_ioctls(void) vol_args_v2.size = 0; vol_args_v2.qgroup_inherit = NULL; args_passed = vol_args_v2; - printf("ioctl(%d, BTRFS_IOC_SUBVOL_CREATE_V2, ", - btrfs_test_dir_fd); + printf("ioctl(%d, %s, ", + btrfs_test_dir_fd, ioc(BTRFS_IOC_SUBVOL_CREATE_V2)); btrfs_print_vol_args_v2(&vol_args_v2, 1); - ioctl(btrfs_test_dir_fd, BTRFS_IOC_SUBVOL_CREATE_V2, + ret = ioctl(btrfs_test_dir_fd, BTRFS_IOC_SUBVOL_CREATE_V2, &args_passed); - printf(" => {transid=%" PRI__u64"}) = 0\n", + if (ret < 0) + perror_msg_and_fail("ioctl(BTRFS_IOC_SUBVOL_CREATE_V2) " + "failed"); + printf(" => {transid=%" PRI__u64 "}) = 0\n", args_passed.transid); subvolfd = openat(btrfs_test_dir_fd, subvol_name, @@ -449,27 +551,27 @@ btrfs_test_subvol_ioctls(void) strncpy(vol_args_v2.name, long_subvol_name, BTRFS_NAME_LEN); vol_args_v2.fd = subvolfd; args_passed = vol_args_v2; - printf("ioctl(%d, BTRFS_IOC_SNAP_CREATE_V2, ", - btrfs_test_dir_fd); + printf("ioctl(%d, %s, ", + btrfs_test_dir_fd, ioc(BTRFS_IOC_SNAP_CREATE_V2)); btrfs_print_vol_args_v2(&args_passed, 1); ioctl(btrfs_test_dir_fd, BTRFS_IOC_SNAP_CREATE_V2, &args_passed); - printf(" => {transid=%" PRI__u64"}) = 0\n", + printf(" => {transid=%" PRI__u64 "}) = 0\n", args_passed.transid); /* This only works when mounted w/ -ouser_subvol_rm_allowed */ strncpy(vol_args.name, long_subvol_name, 255); vol_args.name[255] = 0; ioctl(btrfs_test_dir_fd, BTRFS_IOC_SNAP_DESTROY, &vol_args); - printf("ioctl(%d, BTRFS_IOC_SNAP_DESTROY, " - "{fd=%d, name=\"%.*s\"}) = 0\n", - btrfs_test_dir_fd, (int) vol_args.fd, 255, long_subvol_name); + printf("ioctl(%d, %s, {fd=%d, name=\"%.*s\"}) = 0\n", + btrfs_test_dir_fd, ioc(BTRFS_IOC_SNAP_DESTROY), + (int) vol_args.fd, 255, long_subvol_name); strcpy(vol_args.name, subvol_name); ioctl(btrfs_test_dir_fd, BTRFS_IOC_SNAP_DESTROY, &vol_args); - printf("ioctl(%d, BTRFS_IOC_SNAP_DESTROY, " - "{fd=%d, name=\"%s\"}) = 0\n", - btrfs_test_dir_fd, (int) vol_args.fd, subvol_name); + printf("ioctl(%d, %s, {fd=%d, name=\"%s\"}) = 0\n", + btrfs_test_dir_fd, ioc(BTRFS_IOC_SNAP_DESTROY), + (int) vol_args.fd, subvol_name); close(subvolfd); } @@ -480,19 +582,17 @@ static void btrfs_print_balance_args(struct btrfs_balance_args *args) { printf("{profiles="); - printflags(btrfs_space_info_flags, args->profiles, + prfl_btrfs(btrfs_space_info_flags, args->profiles, "BTRFS_BLOCK_GROUP_???"); - printf(", usage=%"PRI__u64 "%s, devid=%"PRI__u64 "%s, pstart=%"PRI__u64 - "%s, pend=%"PRI__u64 "%s, vstart=%"PRI__u64 "%s, vend=%"PRI__u64 - "%s, target=%"PRI__u64 "%s, flags=", - args->usage, maybe_print_uint64max(args->usage), - args->devid, maybe_print_uint64max(args->devid), - args->pstart, maybe_print_uint64max(args->pstart), - args->pend, maybe_print_uint64max(args->pend), - args->vstart, maybe_print_uint64max(args->vstart), - args->vend, maybe_print_uint64max(args->vend), - args->target, maybe_print_uint64max(args->target)); - printflags(btrfs_balance_args, args->flags, "BTRFS_BALANCE_ARGS_???"); + print_uint64(", usage=", args->usage); + printf(", devid=%s", sprint_makedev(args->devid)); + print_uint64(", pstart=", args->pstart); + print_uint64(", pend=", args->pend); + print_uint64(", vstart=", args->vstart); + print_uint64(", vend=", args->vend); + print_uint64(", target=", args->target); + printf(", flags="); + prfl_btrfs(btrfs_balance_args, args->flags, "BTRFS_BALANCE_ARGS_???"); printf("}"); } @@ -532,25 +632,31 @@ btrfs_test_balance_ioctls(void) struct btrfs_ioctl_vol_args vol_args = {}; ioctl(-1, BTRFS_IOC_BALANCE_CTL, 1); - printf("ioctl(-1, BTRFS_IOC_BALANCE_CTL, " - "BTRFS_BALANCE_CTL_PAUSE) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, %sBTRFS_BALANCE_CTL_PAUSE%s) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_BALANCE_CTL), + verbose_xlat ? "0x1 /* " : "", + verbose_xlat ? " */" : ""); ioctl(-1, BTRFS_IOC_BALANCE_CTL, 2); - printf("ioctl(-1, BTRFS_IOC_BALANCE_CTL, " - "BTRFS_BALANCE_CTL_CANCEL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, " + "%sBTRFS_BALANCE_CTL_CANCEL%s) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_BALANCE_CTL), + verbose_xlat ? "0x2 /* " : "", + verbose_xlat ? " */" : ""); ioctl(-1, BTRFS_IOC_BALANCE, NULL); - printf("ioctl(-1, BTRFS_IOC_BALANCE) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_BALANCE)); ioctl(-1, BTRFS_IOC_BALANCE, &vol_args); - printf("ioctl(-1, BTRFS_IOC_BALANCE) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_BALANCE)); /* struct btrfs_ioctl_balance_args */ ioctl(-1, BTRFS_IOC_BALANCE_V2, NULL); - printf("ioctl(-1, BTRFS_IOC_BALANCE_V2, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_BALANCE_V2)); - printf("ioctl(-1, BTRFS_IOC_BALANCE_V2, {flags="); - printflags(btrfs_balance_flags, args.flags, "BTRFS_BALANCE_???"); + printf("ioctl(-1, %s, {flags=", ioc(BTRFS_IOC_BALANCE_V2)); + prfl_btrfs(btrfs_balance_flags, args.flags, "BTRFS_BALANCE_???"); printf(", data="); btrfs_print_balance_args(&args.data); printf(", meta="); @@ -561,6 +667,8 @@ btrfs_test_balance_ioctls(void) printf("}) = -1 EBADF (%m)\n"); if (write_ok) { + long ret; + args.flags = BTRFS_BALANCE_DATA | BTRFS_BALANCE_METADATA | BTRFS_BALANCE_SYSTEM; args.data.flags = 0; @@ -569,31 +677,43 @@ btrfs_test_balance_ioctls(void) args.meta.profiles = 0; args.sys.flags = 0; args.sys.profiles = 0; - printf("ioctl(%d, BTRFS_IOC_BALANCE_V2, {flags=", - btrfs_test_dir_fd); - printflags(btrfs_balance_flags, args.flags, - "BTRFS_BALANCE_???"); - printf(", data="); - btrfs_print_balance_args(&args.data); - printf(", meta="); - btrfs_print_balance_args(&args.meta); - printf(", sys="); - btrfs_print_balance_args(&args.sys); - ioctl(btrfs_test_dir_fd, BTRFS_IOC_BALANCE_V2, &args); - printf("} => {flags="); - printflags(btrfs_balance_flags, args.flags, + /* + * We should keep args the same for data in meta in case + * volume-under-tests uses mixed groups data and metadata. + */ + args.meta.pend = -1ULL; + args.meta.vend = -1ULL; + + printf("ioctl(%d, %s, {flags=", + btrfs_test_dir_fd, ioc(BTRFS_IOC_BALANCE_V2)); + + prfl_btrfs(btrfs_balance_flags, args.flags, "BTRFS_BALANCE_???"); - printf(", state="); - printflags(btrfs_balance_state, args.state, - "BTRFS_BALANCE_STATE_???"); printf(", data="); btrfs_print_balance_args(&args.data); printf(", meta="); btrfs_print_balance_args(&args.meta); printf(", sys="); btrfs_print_balance_args(&args.sys); - printf("}) = 0\n"); + ret = ioctl(btrfs_test_dir_fd, BTRFS_IOC_BALANCE_V2, &args); + if (ret < 0) { + printf("}) = %s\n", sprintrc(ret)); + } else { + printf("} => {flags="); + prfl_btrfs(btrfs_balance_flags, args.flags, + "BTRFS_BALANCE_???"); + printf(", state="); + prfl_btrfs(btrfs_balance_state, args.state, + "BTRFS_BALANCE_STATE_???"); + printf(", data="); + btrfs_print_balance_args(&args.data); + printf(", meta="); + btrfs_print_balance_args(&args.meta); + printf(", sys="); + btrfs_print_balance_args(&args.sys); + printf("}) = %ld\n", ret); + } } } @@ -616,38 +736,46 @@ btrfs_test_device_ioctls(void) }; ioctl(-1, BTRFS_IOC_RESIZE, NULL); - printf("ioctl(-1, BTRFS_IOC_RESIZE, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_RESIZE)); strcpy(args.name, devid); ioctl(-1, BTRFS_IOC_RESIZE, &args); - printf("ioctl(-1, BTRFS_IOC_RESIZE, " - "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", - (int) args.fd, args.name); + printf("ioctl(-1, %s, {fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_RESIZE), (int) args.fd, args.name); ioctl(-1, BTRFS_IOC_SCAN_DEV, NULL); - printf("ioctl(-1, BTRFS_IOC_SCAN_DEV, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SCAN_DEV)); strcpy(args.name, devname); ioctl(-1, BTRFS_IOC_SCAN_DEV, &args); - printf("ioctl(-1, BTRFS_IOC_SCAN_DEV, " - "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", - (int) args.fd, args.name); + printf("ioctl(-1, %s, {fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SCAN_DEV), (int) args.fd, args.name); + +# ifdef BTRFS_IOC_FORGET_DEV + ioctl(-1, BTRFS_IOC_FORGET_DEV, NULL); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_FORGET_DEV)); + + strcpy(args.name, devname); + ioctl(-1, BTRFS_IOC_FORGET_DEV, &args); + printf("ioctl(-1, %s, {fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_FORGET_DEV), (int) args.fd, args.name); +# endif ioctl(-1, BTRFS_IOC_ADD_DEV, NULL); - printf("ioctl(-1, BTRFS_IOC_ADD_DEV, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_ADD_DEV)); ioctl(-1, BTRFS_IOC_ADD_DEV, &args); - printf("ioctl(-1, BTRFS_IOC_ADD_DEV, " - "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", - (int) args.fd, args.name); + printf("ioctl(-1, %s, {fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_ADD_DEV), (int) args.fd, args.name); ioctl(-1, BTRFS_IOC_RM_DEV, NULL); - printf("ioctl(-1, BTRFS_IOC_RM_DEV, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_RM_DEV)); ioctl(-1, BTRFS_IOC_RM_DEV, &args); - printf("ioctl(-1, BTRFS_IOC_RM_DEV, " - "{fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", - (int) args.fd, args.name); + printf("ioctl(-1, %s, {fd=%d, name=\"%s\"}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_RM_DEV), (int) args.fd, args.name); } @@ -668,35 +796,40 @@ btrfs_test_clone_ioctls(void) }; ioctl(-1, BTRFS_IOC_CLONE, clone_fd); - printf("ioctl(-1, BTRFS_IOC_CLONE or FICLONE, %x) = -1 EBADF (%m)\n", - clone_fd); + printf("ioctl(-1, %s, %x) = -1 EBADF (%m)\n", + sprint_xlat_(BTRFS_IOC_CLONE, "BTRFS_IOC_CLONE or FICLONE"), + clone_fd); ioctl(-1, BTRFS_IOC_CLONE_RANGE, NULL); - printf("ioctl(-1, BTRFS_IOC_CLONE_RANGE or FICLONERANGE, " - "NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + sprint_xlat_(BTRFS_IOC_CLONE_RANGE, + "BTRFS_IOC_CLONE_RANGE or FICLONERANGE")); ioctl(-1, BTRFS_IOC_CLONE_RANGE, &args); - printf("ioctl(-1, BTRFS_IOC_CLONE_RANGE or FICLONERANGE, " + printf("ioctl(-1, %s, " "{src_fd=%d, src_offset=%" PRI__u64 ", src_length=%" PRI__u64 ", dest_offset=%" PRI__u64 "}) = -1 EBADF (%m)\n", + sprint_xlat_(BTRFS_IOC_CLONE_RANGE, + "BTRFS_IOC_CLONE_RANGE or FICLONERANGE"), (int) args.src_fd, args.src_offset, args.src_length, args.dest_offset); } -#define BTRFS_COMPRESS_TYPES 2 -#define BTRFS_INVALID_COMPRESS (BTRFS_COMPRESS_TYPES + 1) +# define BTRFS_COMPRESS_TYPES 2 +# define BTRFS_INVALID_COMPRESS (BTRFS_COMPRESS_TYPES + 1) static void -btrfs_print_defrag_range_args(struct btrfs_ioctl_defrag_range_args *args) +btrfs_print_defrag_range_args(struct btrfs_ioctl_defrag_range_args *args, + bool compress_type_known) { - printf("{start=%" PRIu64", len=%" PRIu64 "%s, flags=", - (uint64_t) args->start, (uint64_t) args->len, - maybe_print_uint64max(args->len)); + printf("{start=%" PRIu64, (uint64_t) args->start); + print_uint64(", len=", args->len); - printflags(btrfs_defrag_flags, args->flags, "BTRFS_DEFRAG_RANGE_???"); + printf(", flags="); + prfl_btrfs(btrfs_defrag_flags, args->flags, "BTRFS_DEFRAG_RANGE_???"); printf(", extent_thresh=%u, compress_type=", args->extent_thresh); - printxval(btrfs_compress_types, args->compress_type, - "BTRFS_COMPRESS_???"); + prxval_btrfs(btrfs_compress_types, args->compress_type, + "BTRFS_COMPRESS_???", compress_type_known); printf("}"); } @@ -722,29 +855,30 @@ btrfs_test_defrag_ioctls(void) * actually consume it. */ ioctl(-1, BTRFS_IOC_DEFRAG, NULL); - printf("ioctl(-1, BTRFS_IOC_DEFRAG) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_DEFRAG)); ioctl(-1, BTRFS_IOC_DEFRAG, &vol_args); - printf("ioctl(-1, BTRFS_IOC_DEFRAG) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_DEFRAG)); /* struct btrfs_ioctl_defrag_range_args */ ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, NULL); - printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_DEFRAG_RANGE)); - printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, "); - btrfs_print_defrag_range_args(&args); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_DEFRAG_RANGE)); + btrfs_print_defrag_range_args(&args, true); ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, &args); printf(") = -1 EBADF (%m)\n"); args.compress_type = BTRFS_INVALID_COMPRESS; - printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, "); - btrfs_print_defrag_range_args(&args); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_DEFRAG_RANGE)); + btrfs_print_defrag_range_args(&args, false); ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, &args); printf(") = -1 EBADF (%m)\n"); args.len--; - printf("ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, "); - btrfs_print_defrag_range_args(&args); + printf("ioctl(-1, %s, ", ioc(BTRFS_IOC_DEFRAG_RANGE)); + btrfs_print_defrag_range_args(&args, false); ioctl(-1, BTRFS_IOC_DEFRAG_RANGE, &args); printf(") = -1 EBADF (%m)\n"); } @@ -762,18 +896,28 @@ static void btrfs_print_objectid(uint64_t objectid) { const char *str = xlookup(btrfs_tree_objectids, objectid); - printf("%" PRIu64, objectid); - if (str) - printf(" /* %s */", str); + if (str) { + if (verbose_xlat) + printf("%" PRIu64 " /* %s */", objectid, str); + else + printf("%s", str); + } else { + printf("%" PRIu64, objectid); + } } static void btrfs_print_key_type(uint32_t type) { const char *str = xlookup(btrfs_key_types, type); - printf("%u", type); - if (str) - printf(" /* %s */", str); + if (str) { + if (verbose_xlat) + printf("%u /* %s */", type, str); + else + printf("%s", str); + } else { + printf("%u", type); + } } static void @@ -789,18 +933,10 @@ btrfs_print_search_key(struct btrfs_ioctl_search_key *key) printf(", max_objectid="); btrfs_print_objectid(key->max_objectid); } - if (key->min_offset) - printf(", min_offset=%" PRI__u64 "%s", - key->min_offset, maybe_print_uint64max(key->min_offset)); - if (key->max_offset) - printf(", max_offset=%" PRI__u64 "%s", - key->max_offset, maybe_print_uint64max(key->max_offset)); - if (key->min_transid) - printf(", min_transid=%" PRI__u64"%s", key->min_transid, - maybe_print_uint64max(key->min_transid)); - if (key->max_transid) - printf(", max_transid=%" PRI__u64"%s", key->max_transid, - maybe_print_uint64max(key->max_transid)); + print_uint64(", min_offset=", key->min_offset); + print_uint64(", max_offset=", key->max_offset); + print_uint64(", min_transid=", key->min_transid); + print_uint64(", max_transid=", key->max_transid); printf(", min_type="); btrfs_print_key_type(key->min_type); printf(", max_type="); @@ -815,7 +951,7 @@ btrfs_print_tree_search_buf(struct btrfs_ioctl_search_key *key, if (verbose) { uint64_t i; uint64_t off = 0; - printf("["); + printf("buf=["); for (i = 0; i < key->nr_items; i++) { struct btrfs_ioctl_search_header *sh; sh = (typeof(sh))(buf + off); @@ -860,19 +996,21 @@ btrfs_test_search_ioctls(void) }; ioctl(-1, BTRFS_IOC_TREE_SEARCH, NULL); - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_TREE_SEARCH)); ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, NULL); - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_TREE_SEARCH_V2)); search_args.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH)); btrfs_print_search_key(&search_args.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); printf("}) = -1 EBADF (%m)\n"); search_args_v2.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH_V2)); btrfs_print_search_key(&search_args_v2.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", @@ -881,13 +1019,13 @@ btrfs_test_search_ioctls(void) key_reference.min_objectid = 6; key_reference.max_objectid = 7; search_args.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH)); btrfs_print_search_key(&search_args.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); printf("}) = -1 EBADF (%m)\n"); search_args_v2.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH_V2)); btrfs_print_search_key(&search_args_v2.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", @@ -896,13 +1034,13 @@ btrfs_test_search_ioctls(void) key_reference.min_offset++; key_reference.max_offset--; search_args.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH)); btrfs_print_search_key(&search_args.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); printf("}) = -1 EBADF (%m)\n"); search_args_v2.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH_V2)); btrfs_print_search_key(&search_args_v2.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", @@ -911,13 +1049,13 @@ btrfs_test_search_ioctls(void) key_reference.min_transid++; key_reference.max_transid--; search_args.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH)); btrfs_print_search_key(&search_args.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); printf("}) = -1 EBADF (%m)\n"); search_args_v2.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH_V2)); btrfs_print_search_key(&search_args_v2.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", @@ -926,13 +1064,13 @@ btrfs_test_search_ioctls(void) key_reference.min_type = 1; key_reference.max_type = 12; search_args.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH)); btrfs_print_search_key(&search_args.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH, &search_args); printf("}) = -1 EBADF (%m)\n"); search_args_v2.key = key_reference; - printf("ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, {"); + printf("ioctl(-1, %s, {", ioc(BTRFS_IOC_TREE_SEARCH_V2)); btrfs_print_search_key(&search_args_v2.key); ioctl(-1, BTRFS_IOC_TREE_SEARCH_V2, &search_args_v2); printf(", buf_size=%" PRIu64 "}) = -1 EBADF (%m)\n", @@ -951,11 +1089,11 @@ btrfs_test_search_ioctls(void) key_reference.max_offset = -1ULL; search_args.key = key_reference; - printf("ioctl(%d, BTRFS_IOC_TREE_SEARCH, {", - btrfs_test_dir_fd); + printf("ioctl(%d, %s, {", + btrfs_test_dir_fd, ioc(BTRFS_IOC_TREE_SEARCH)); btrfs_print_search_key(&search_args.key); ioctl(btrfs_test_dir_fd, BTRFS_IOC_TREE_SEARCH, &search_args); - printf("} => {key={nr_items=%u}, buf=", + printf("} => {key={nr_items=%u}, ", search_args.key.nr_items); btrfs_print_tree_search_buf(&search_args.key, search_args.buf, sizeof(search_args.buf)); @@ -967,12 +1105,12 @@ btrfs_test_search_ioctls(void) args->key = key_reference; args->buf_size = bufsize; - printf("ioctl(%d, BTRFS_IOC_TREE_SEARCH_V2, {", - btrfs_test_dir_fd); + printf("ioctl(%d, %s, {", + btrfs_test_dir_fd, ioc(BTRFS_IOC_TREE_SEARCH_V2)); btrfs_print_search_key(&key_reference); printf(", buf_size=%" PRIu64 "}", (uint64_t) args->buf_size); ioctl(btrfs_test_dir_fd, BTRFS_IOC_TREE_SEARCH_V2, args); - printf(" => {key={nr_items=%u}, buf_size=%" PRIu64 ", buf=", + printf(" => {key={nr_items=%u}, buf_size=%" PRIu64 ", ", args->key.nr_items, (uint64_t)args->buf_size); btrfs_print_tree_search_buf(&args->key, args->buf, args->buf_size); @@ -980,8 +1118,8 @@ btrfs_test_search_ioctls(void) args->key = key_reference; args->buf_size = sizeof(struct btrfs_ioctl_search_header); - printf("ioctl(%d, BTRFS_IOC_TREE_SEARCH_V2, {", - btrfs_test_dir_fd); + printf("ioctl(%d, %s, {", + btrfs_test_dir_fd, ioc(BTRFS_IOC_TREE_SEARCH_V2)); btrfs_print_search_key(&args->key); printf(", buf_size=%" PRIu64 "}", (uint64_t)args->buf_size); ioctl(btrfs_test_dir_fd, BTRFS_IOC_TREE_SEARCH_V2, args); @@ -1004,9 +1142,10 @@ btrfs_test_ino_lookup_ioctl(void) }; ioctl(-1, BTRFS_IOC_INO_LOOKUP, NULL); - printf("ioctl(-1, BTRFS_IOC_INO_LOOKUP, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_INO_LOOKUP)); - printf("ioctl(-1, BTRFS_IOC_INO_LOOKUP, {treeid="); + printf("ioctl(-1, %s, {treeid=", ioc(BTRFS_IOC_INO_LOOKUP)); btrfs_print_objectid(args.treeid); printf(", objectid="); btrfs_print_objectid(args.objectid); @@ -1014,8 +1153,8 @@ btrfs_test_ino_lookup_ioctl(void) printf("}) = -1 EBADF (%m)\n"); if (btrfs_test_root) { - printf("ioctl(%d, BTRFS_IOC_INO_LOOKUP, {treeid=", - btrfs_test_dir_fd); + printf("ioctl(%d, %s, {treeid=", + btrfs_test_dir_fd, ioc(BTRFS_IOC_INO_LOOKUP)); btrfs_print_objectid(args.treeid); printf(", objectid="); btrfs_print_objectid(args.objectid); @@ -1034,20 +1173,20 @@ btrfs_test_space_info_ioctl(void) struct btrfs_ioctl_space_args args = {}; ioctl(-1, BTRFS_IOC_SPACE_INFO, NULL); - printf("ioctl(-1, BTRFS_IOC_SPACE_INFO, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SPACE_INFO)); ioctl(-1, BTRFS_IOC_SPACE_INFO, &args); - printf("ioctl(-1, BTRFS_IOC_SPACE_INFO, " - "{space_slots=%" PRI__u64 "}) = -1 EBADF (%m)\n", - args.space_slots); + printf("ioctl(-1, %s, {space_slots=%" PRI__u64 "}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SPACE_INFO), args.space_slots); if (btrfs_test_root) { struct btrfs_ioctl_space_args args_passed; struct btrfs_ioctl_space_args *argsp; args_passed = args; - printf("ioctl(%d, BTRFS_IOC_SPACE_INFO, " - "{space_slots=%" PRI__u64 "}", - btrfs_test_dir_fd, args_passed.space_slots); + printf("ioctl(%d, %s, {space_slots=%" PRI__u64 "}", + btrfs_test_dir_fd, ioc(BTRFS_IOC_SPACE_INFO), + args_passed.space_slots); ioctl(btrfs_test_dir_fd, BTRFS_IOC_SPACE_INFO, &args_passed); printf(" => {total_spaces=%" PRI__u64 "}) = 0\n", args_passed.total_spaces); @@ -1059,22 +1198,22 @@ btrfs_test_space_info_ioctl(void) *argsp = args; argsp->space_slots = args_passed.total_spaces; - printf("ioctl(%d, BTRFS_IOC_SPACE_INFO, " - "{space_slots=%" PRI__u64 "}", - btrfs_test_dir_fd, argsp->space_slots); + printf("ioctl(%d, %s, {space_slots=%" PRI__u64 "}", + btrfs_test_dir_fd, ioc(BTRFS_IOC_SPACE_INFO), + argsp->space_slots); ioctl(btrfs_test_dir_fd, BTRFS_IOC_SPACE_INFO, argsp); - printf(" => {total_spaces=%" PRI__u64 ", spaces=", + printf(" => {total_spaces=%" PRI__u64 ", ", argsp->total_spaces); if (verbose) { unsigned int i; - printf("["); + printf("spaces=["); for (i = 0; i < argsp->total_spaces; i++) { struct btrfs_ioctl_space_info *info; info = &argsp->spaces[i]; if (i) printf(", "); printf("{flags="); - printflags(btrfs_space_info_flags, info->flags, + prfl_btrfs(btrfs_space_info_flags, info->flags, "BTRFS_SPACE_INFO_???"); printf(", total_bytes=%" PRI__u64 ", used_bytes=%" PRI__u64 "}", @@ -1107,25 +1246,28 @@ btrfs_test_scrub_ioctls(void) }; ioctl(-1, BTRFS_IOC_SCRUB, NULL); - printf("ioctl(-1, BTRFS_IOC_SCRUB, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_SCRUB)); ioctl(-1, BTRFS_IOC_SCRUB_CANCEL, NULL); - printf("ioctl(-1, BTRFS_IOC_SCRUB_CANCEL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_SCRUB_CANCEL)); - printf("ioctl(-1, BTRFS_IOC_SCRUB, {devid=%" PRI__u64 ", start=%" - PRI__u64 "%s, end=%" PRI__u64"%s, flags=", - args.devid, args.start, maybe_print_uint64max(args.start), - args.end, maybe_print_uint64max(args.end)); - printflags(btrfs_scrub_flags, args.flags, "BTRFS_SCRUB_???"); + printf("ioctl(-1, %s, {devid=%s", + ioc(BTRFS_IOC_SCRUB), sprint_makedev(args.devid)); + print_uint64(", start=", args.start); + print_uint64(", end=", args.end); + printf(", flags="); + prfl_btrfs(btrfs_scrub_flags, args.flags, "BTRFS_SCRUB_???"); ioctl(-1, BTRFS_IOC_SCRUB, &args); printf("}) = -1 EBADF (%m)\n"); ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, NULL); - printf("ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SCRUB_PROGRESS)); ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, &args); - printf("ioctl(-1, BTRFS_IOC_SCRUB_PROGRESS, " - "{devid=%" PRI__u64 "}) = -1 EBADF (%m)\n", args.devid); + printf("ioctl(-1, %s, {devid=%s}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SCRUB_PROGRESS), + sprint_makedev(args.devid)); } /* @@ -1141,12 +1283,14 @@ btrfs_test_dev_info_ioctl(void) memcpy(&args.uuid, uuid_reference, BTRFS_UUID_SIZE); ioctl(-1, BTRFS_IOC_DEV_INFO, NULL); - printf("ioctl(-1, BTRFS_IOC_DEV_INFO, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_DEV_INFO)); ioctl(-1, BTRFS_IOC_DEV_INFO, &args); - printf("ioctl(-1, BTRFS_IOC_DEV_INFO, " - "{devid=%" PRI__u64", uuid=%s}) = -1 EBADF (%m)\n", - args.devid, uuid_reference_string); + printf("ioctl(-1, %s, " + "{devid=%s, uuid=%s}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_DEV_INFO), sprint_makedev(args.devid), + uuid_reference_string); } /* @@ -1161,27 +1305,84 @@ btrfs_test_ino_path_ioctls(void) struct btrfs_ioctl_ino_path_args args = { .inum = 256, .size = sizeof(buf), - .fspath = (unsigned long)buf, + .reserved = { + 0xdeadc0defacefeebULL, + 0xdeadc0defacefeecULL, + 0xdeadc0defacefeedULL, + }, + .fspath = 0, }; +# ifdef HAVE_BTRFS_IOCTL_LOGICAL_INO_ARGS + args.flags = +# else + args.reserved[3] = +# endif + 0xdeadc0defacefeeeULL; + + ioctl(-1, BTRFS_IOC_INO_PATHS, NULL); - printf("ioctl(-1, BTRFS_IOC_INO_PATHS, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_INO_PATHS)); ioctl(-1, BTRFS_IOC_LOGICAL_INO, NULL); - printf("ioctl(-1, BTRFS_IOC_LOGICAL_INO, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_LOGICAL_INO)); ioctl(-1, BTRFS_IOC_INO_PATHS, &args); - printf("ioctl(-1, BTRFS_IOC_INO_PATHS, " - "{inum=%" PRI__u64", size=%" PRI__u64 + printf("ioctl(-1, %s, {inum=%" PRI__u64 ", size=%" PRI__u64 + ", fspath=NULL}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_INO_PATHS), args.inum, args.size); + + args.fspath = (uintptr_t) buf; + ioctl(-1, BTRFS_IOC_INO_PATHS, &args); + printf("ioctl(-1, %s, {inum=%" PRI__u64 ", size=%" PRI__u64 ", fspath=0x%" PRI__x64 "}) = -1 EBADF (%m)\n", - args.inum, args.size, args.fspath); + ioc(BTRFS_IOC_INO_PATHS), args.inum, args.size, args.fspath); + args.fspath = 0; ioctl(-1, BTRFS_IOC_LOGICAL_INO, &args); - printf("ioctl(-1, BTRFS_IOC_LOGICAL_INO, {logical=%" PRI__u64 - ", size=%" PRI__u64", inodes=0x%" PRI__x64 - "}) = -1 EBADF (%m)\n", args.inum, args.size, args.fspath); + printf("ioctl(-1, %s, {logical=%" PRI__u64 + ", size=%" PRI__u64 ", reserved=[0xdeadc0defacefeeb" + ", 0xdeadc0defacefeec, 0xdeadc0defacefeed]" + ", flags=0xdeadc0defacefeee /* BTRFS_LOGICAL_INO_ARGS_??? */" + ", inodes=NULL}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_LOGICAL_INO), args.inum, args.size); + + args.fspath = (uintptr_t) buf; + args.reserved[0] = 0; + args.reserved[2] = 0; +# ifdef HAVE_BTRFS_IOCTL_LOGICAL_INO_ARGS + args.flags = +# else + args.reserved[3] = +# endif + 1; -#ifdef HAVE_LINUX_FIEMAP_H + ioctl(-1, BTRFS_IOC_LOGICAL_INO, &args); + printf("ioctl(-1, %s, {logical=%" PRI__u64 + ", size=%" PRI__u64 ", reserved=[0, 0xdeadc0defacefeec, 0]" + ", flags=%sBTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET%s" + ", inodes=0x%" PRI__x64 "}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_LOGICAL_INO), args.inum, args.size, + verbose_xlat ? "0x1 /* " : "", verbose_xlat ? " */" : "", + args.fspath); + + args.reserved[1] = 0; +# ifdef HAVE_BTRFS_IOCTL_LOGICAL_INO_ARGS + args.flags = +# else + args.reserved[3] = +# endif + 0; + + ioctl(-1, BTRFS_IOC_LOGICAL_INO, &args); + printf("ioctl(-1, %s, {logical=%" PRI__u64 + ", size=%" PRI__u64 ", flags=0, inodes=0x%" PRI__x64 + "}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_LOGICAL_INO), args.inum, args.size, args.fspath); + +# ifdef HAVE_LINUX_FIEMAP_H if (btrfs_test_root) { int size; struct stat si; @@ -1195,17 +1396,16 @@ btrfs_test_ino_path_ioctls(void) perror_msg_and_fail("fstat failed"); args.inum = si.st_ino; - printf("ioctl(%d, BTRFS_IOC_INO_PATHS, " - "{inum=%" PRI__u64", size=%" PRI__u64 - ", fspath=0x%" PRI__x64"}", - btrfs_test_dir_fd, args.inum, args.size, - args.fspath); + printf("ioctl(%d, %s, {inum=%" PRI__u64 ", size=%" PRI__u64 + ", fspath=0x%" PRI__x64 "}", + btrfs_test_dir_fd, ioc(BTRFS_IOC_INO_PATHS), + args.inum, args.size, args.fspath); ioctl(btrfs_test_dir_fd, BTRFS_IOC_INO_PATHS, &args); - printf(" => {fspath={bytes_left=%u, bytes_missing=%u, elem_cnt=%u, elem_missed=%u, val=", + printf(" => {fspath={bytes_left=%u, bytes_missing=%u, elem_cnt=%u, elem_missed=%u, ", data->bytes_left, data->bytes_missing, data->elem_cnt, data->elem_missed); if (verbose) { - printf("[\"strace-test\"]"); + printf("val=[\"%s\"]", dir_name); } else printf("..."); printf("}}) = 0\n"); @@ -1227,7 +1427,7 @@ btrfs_test_ino_path_ioctls(void) */ fsync(fd); ioctl(fd, BTRFS_IOC_SYNC, NULL); - printf("ioctl(%d, BTRFS_IOC_SYNC) = 0\n", fd); + printf("ioctl(%d, %s) = 0\n", fd, ioc(BTRFS_IOC_SYNC)); size = sizeof(*fiemap) + 2 * sizeof(fiemap->fm_extents[0]); fiemap = malloc(size); @@ -1239,18 +1439,19 @@ btrfs_test_ino_path_ioctls(void) fiemap->fm_extent_count = 2; /* This is also a live test for FIEMAP */ - printf("ioctl(%d, FS_IOC_FIEMAP, {fm_start=%" PRI__u64 - ", fm_length=%" PRI__u64", fm_flags=", - fd, fiemap->fm_start, fiemap->fm_length); - printflags(fiemap_flags, fiemap->fm_flags, "FIEMAP_FLAG_???"); + printf("ioctl(%d, %s, {fm_start=%" PRI__u64 + ", fm_length=%" PRI__u64 ", fm_flags=", + fd, ioc(FS_IOC_FIEMAP), + fiemap->fm_start, fiemap->fm_length); + prfl_btrfs(fiemap_flags, fiemap->fm_flags, "FIEMAP_FLAG_???"); printf(", fm_extent_count=%u}", fiemap->fm_extent_count); ioctl(fd, FS_IOC_FIEMAP, fiemap); printf(" => {fm_flags="); - printflags(fiemap_flags, fiemap->fm_flags, "FIEMAP_FLAG_???"); - printf(", fm_mapped_extents=%u, fm_extents=", + prfl_btrfs(fiemap_flags, fiemap->fm_flags, "FIEMAP_FLAG_???"); + printf(", fm_mapped_extents=%u, ", fiemap->fm_mapped_extents); if (verbose) { - printf("["); + printf("fm_extents=["); unsigned int i; for (i = 0; i < fiemap->fm_mapped_extents; i++) { struct fiemap_extent *fe; @@ -1263,7 +1464,7 @@ btrfs_test_ino_path_ioctls(void) ", ", fe->fe_logical, fe->fe_physical, fe->fe_length); - printflags(fiemap_extent_flags, fe->fe_flags, + prfl_btrfs(fiemap_extent_flags, fe->fe_flags, "FIEMAP_EXTENT_???"); printf("}"); } @@ -1273,15 +1474,16 @@ btrfs_test_ino_path_ioctls(void) printf("}) = 0\n"); args.inum = fiemap->fm_extents[0].fe_physical; - printf("ioctl(%d, BTRFS_IOC_LOGICAL_INO, {logical=%" PRI__u64 - ", size=%" PRI__u64", inodes=0x%" PRI__x64"}", - fd, args.inum, args.size, args.fspath); + printf("ioctl(%d, %s, {logical=%" PRI__u64 + ", size=%" PRI__u64 ", flags=0, inodes=0x%" PRI__x64 "}", + fd, ioc(BTRFS_IOC_LOGICAL_INO), + args.inum, args.size, args.fspath); ioctl(fd, BTRFS_IOC_LOGICAL_INO, &args); - printf(" => {inodes={bytes_left=%u, bytes_missing=%u, elem_cnt=%u, elem_missed=%u, val=", + printf(" => {inodes={bytes_left=%u, bytes_missing=%u, elem_cnt=%u, elem_missed=%u, ", data->bytes_left, data->bytes_missing, data->elem_cnt, data->elem_missed); if (verbose) { - printf("[{inum=%llu, offset=0, root=5}]", + printf("val=[{inum=%llu, offset=0, root=5}]", (unsigned long long) si.st_ino); } else printf("..."); @@ -1289,7 +1491,7 @@ btrfs_test_ino_path_ioctls(void) close(fd); free(fiemap); } -#endif /* HAVE_LINUX_FIEMAP_H */ +# endif /* HAVE_LINUX_FIEMAP_H */ } /* @@ -1306,18 +1508,23 @@ btrfs_test_set_received_subvol_ioctl(void) .nsec = 12345, }, }; + int saved_errno; + memcpy(&args.uuid, uuid_reference, BTRFS_UUID_SIZE); ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, NULL); - printf("ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, " - "NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SET_RECEIVED_SUBVOL)); ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, &args); - printf("ioctl(-1, BTRFS_IOC_SET_RECEIVED_SUBVOL, " - "{uuid=%s, stransid=%" PRI__u64", stime=%" PRI__u64 - ".%u, flags=0}) = -1 EBADF (%m)\n", - uuid_reference_string, args.stransid, args.stime.sec, - args.stime.nsec); + saved_errno = errno; + printf("ioctl(-1, %s, {uuid=%s, stransid=%" PRI__u64 + ", stime={sec=%" PRI__u64 ", nsec=%u}", + ioc(BTRFS_IOC_SET_RECEIVED_SUBVOL), uuid_reference_string, + args.stransid, args.stime.sec, args.stime.nsec); + print_time_t_nsec(args.stime.sec, args.stime.nsec, true); + errno = saved_errno; + printf(", flags=0}) = -1 EBADF (%m)\n"); } /* @@ -1335,29 +1542,25 @@ btrfs_test_send_ioctl(void) }; ioctl(-1, BTRFS_IOC_SEND, NULL); - printf("ioctl(-1, BTRFS_IOC_SEND, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_SEND)); - printf("ioctl(-1, BTRFS_IOC_SEND, " - "{send_fd=%d, clone_sources_count=%" PRI__u64 - ", clone_sources=", + printf("ioctl(-1, %s, {send_fd=%d, clone_sources_count=%" PRI__u64 + ", clone_sources=NULL", + ioc(BTRFS_IOC_SEND), (int) args.send_fd, args.clone_sources_count); - if (verbose) - printf("NULL"); - else - printf("..."); printf(", parent_root="); btrfs_print_objectid(args.parent_root); printf(", flags="); - printflags(btrfs_send_flags, args.flags, "BTRFS_SEND_FLAGS_???"); + prfl_btrfs(btrfs_send_flags, args.flags, "BTRFS_SEND_FLAGS_???"); ioctl(-1, BTRFS_IOC_SEND, &args); printf("}) = -1 EBADF (%m)\n"); args.clone_sources_count = 2; args.clone_sources = (__u64 *) (void *) u64_array; - printf("ioctl(-1, BTRFS_IOC_SEND, " - "{send_fd=%d, clone_sources_count=%" PRI__u64 + printf("ioctl(-1, %s, {send_fd=%d, clone_sources_count=%" PRI__u64 ", clone_sources=", + ioc(BTRFS_IOC_SEND), (int) args.send_fd, args.clone_sources_count); if (verbose) { printf("["); @@ -1366,11 +1569,11 @@ btrfs_test_send_ioctl(void) btrfs_print_objectid(u64_array[1]); printf("]"); } else - printf("..."); + printf("%p", args.clone_sources); printf(", parent_root="); btrfs_print_objectid(args.parent_root); printf(", flags="); - printflags(btrfs_send_flags, args.flags, "BTRFS_SEND_FLAGS_???"); + prfl_btrfs(btrfs_send_flags, args.flags, "BTRFS_SEND_FLAGS_???"); ioctl(-1, BTRFS_IOC_SEND, &args); printf("}) = -1 EBADF (%m)\n"); } @@ -1387,26 +1590,37 @@ btrfs_test_quota_ctl_ioctl(void) }; ioctl(-1, BTRFS_IOC_QUOTA_CTL, NULL); - printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_CTL)); ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); - printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " - "BTRFS_QUOTA_CTL_ENABLE}) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, {cmd=%sBTRFS_QUOTA_CTL_ENABLE%s}) " + "= -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_CTL), + verbose_xlat ? "0x1 /* " : "", + verbose_xlat ? " */" : ""); args.cmd = 2; ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); - printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " - "BTRFS_QUOTA_CTL_DISABLE}) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, {cmd=%sBTRFS_QUOTA_CTL_DISABLE%s}) " + "= -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_CTL), + verbose_xlat ? "0x2 /* " : "", + verbose_xlat ? " */" : ""); args.cmd = 3; ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); - printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " - "BTRFS_QUOTA_CTL_RESCAN__NOTUSED}) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, " + "{cmd=%sBTRFS_QUOTA_CTL_RESCAN__NOTUSED%s}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_CTL), + verbose_xlat ? "0x3 /* " : "", + verbose_xlat ? " */" : ""); args.cmd = 4; ioctl(-1, BTRFS_IOC_QUOTA_CTL, &args); - printf("ioctl(-1, BTRFS_IOC_QUOTA_CTL, " - "0x4 /* BTRFS_QUOTA_CTL_??? */}) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, " + "{cmd=0x4 /* BTRFS_QUOTA_CTL_??? */}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_CTL)); } /* @@ -1423,12 +1637,14 @@ btrfs_test_qgroup_assign_ioctl(void) }; ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, NULL); - printf("ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QGROUP_ASSIGN)); ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, &args); - printf("ioctl(-1, BTRFS_IOC_QGROUP_ASSIGN, " - "{assign=%" PRI__u64", src=%" PRI__u64", dst=%" PRI__u64 - "}) = -1 EBADF (%m)\n", args.assign, args.src, args.dst); + printf("ioctl(-1, %s, " + "{assign=%" PRI__u64 ", src=%" PRI__u64 ", dst=%" PRI__u64 + "}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QGROUP_ASSIGN), args.assign, args.src, args.dst); } /* @@ -1444,12 +1660,13 @@ btrfs_test_qgroup_create_ioctl(void) }; ioctl(-1, BTRFS_IOC_QGROUP_CREATE, NULL); - printf("ioctl(-1, BTRFS_IOC_QGROUP_CREATE, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_QGROUP_CREATE)); ioctl(-1, BTRFS_IOC_QGROUP_CREATE, &args); - printf("ioctl(-1, BTRFS_IOC_QGROUP_CREATE, " - "{create=%" PRI__u64", qgroupid=%" PRI__u64 - "}) = -1 EBADF (%m)\n", args.create, args.qgroupid); + printf("ioctl(-1, %s, " + "{create=%" PRI__u64 ", qgroupid=%" PRI__u64 + "}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QGROUP_CREATE), args.create, args.qgroupid); } /* @@ -1466,43 +1683,46 @@ btrfs_test_quota_rescan_ioctl(void) }; ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, NULL); - printf("ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_RESCAN)); ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, &args); - printf("ioctl(-1, BTRFS_IOC_QUOTA_RESCAN, " - "{flags=0}) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, {flags=0}) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_RESCAN)); ioctl(-1, BTRFS_IOC_QUOTA_RESCAN_WAIT, NULL); - printf("ioctl(-1, BTRFS_IOC_QUOTA_RESCAN_WAIT) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_QUOTA_RESCAN_WAIT)); } /* * Consumes argument, returns nothing: - * - BTRFS_IOC_SET_FSLABEL + * - FS_IOC_SETFSLABEL * * Consumes no argument, returns argument: - * - BTRFS_IOC_GET_FS_LABEL + * - FS_IOC_GETFSLABEL */ static void btrfs_test_label_ioctls(void) { char label[BTRFS_LABEL_SIZE] = "btrfs-label"; - ioctl(-1, BTRFS_IOC_SET_FSLABEL, NULL); - printf("ioctl(-1, BTRFS_IOC_SET_FSLABEL, NULL) = -1 EBADF (%m)\n"); + ioctl(-1, FS_IOC_SETFSLABEL, NULL); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(FS_IOC_SETFSLABEL)); - ioctl(-1, BTRFS_IOC_SET_FSLABEL, label); - printf("ioctl(-1, BTRFS_IOC_SET_FSLABEL, \"%s\") = -1 EBADF (%m)\n", - label); + ioctl(-1, FS_IOC_SETFSLABEL, label); + printf("ioctl(-1, %s, \"%s\") = -1 EBADF (%m)\n", + ioc(FS_IOC_SETFSLABEL), label); if (write_ok) { - ioctl(btrfs_test_dir_fd, BTRFS_IOC_SET_FSLABEL, label); - printf("ioctl(%d, BTRFS_IOC_SET_FSLABEL, \"%s\") = 0\n", - btrfs_test_dir_fd, label); + ioctl(btrfs_test_dir_fd, FS_IOC_SETFSLABEL, label); + printf("ioctl(%d, %s, \"%s\") = 0\n", + btrfs_test_dir_fd, ioc(FS_IOC_SETFSLABEL), label); - ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_FSLABEL, label); - printf("ioctl(%d, BTRFS_IOC_GET_FSLABEL, \"%s\") = 0\n", - btrfs_test_dir_fd, label); + ioctl(btrfs_test_dir_fd, FS_IOC_GETFSLABEL, label); + printf("ioctl(%d, %s, \"%s\") = 0\n", + btrfs_test_dir_fd, ioc(FS_IOC_GETFSLABEL), label); } } @@ -1518,14 +1738,14 @@ btrfs_test_get_dev_stats_ioctl(void) .nr_items = 5, .flags = max_flags_plus_one(0), }; - ioctl(-1, BTRFS_IOC_GET_DEV_STATS, NULL); - printf("ioctl(-1, BTRFS_IOC_GET_DEV_STATS, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_GET_DEV_STATS)); - printf("ioctl(-1, BTRFS_IOC_GET_DEV_STATS, {devid=%" PRI__u64 - ", nr_items=%" PRI__u64", flags=", - args.devid, args.nr_items); - printflags(btrfs_dev_stats_flags, args.flags, + printf("ioctl(-1, %s, {devid=%s" + ", nr_items=%" PRI__u64 ", flags=", + ioc(BTRFS_IOC_GET_DEV_STATS), + sprint_makedev(args.devid), args.nr_items); + prfl_btrfs(btrfs_dev_stats_flags, args.flags, "BTRFS_DEV_STATS_???"); ioctl(-1, BTRFS_IOC_GET_DEV_STATS, &args); printf("}) = -1 EBADF (%m)\n"); @@ -1533,23 +1753,32 @@ btrfs_test_get_dev_stats_ioctl(void) if (write_ok) { unsigned int i; args.flags = BTRFS_DEV_STATS_RESET; - printf("ioctl(%d, BTRFS_IOC_GET_DEV_STATS, {devid=%" PRI__u64 - ", nr_items=%" PRI__u64", flags=", - btrfs_test_dir_fd, args.devid, args.nr_items); - printflags(btrfs_dev_stats_flags, args.flags, + printf("ioctl(%d, %s, {devid=%s" + ", nr_items=%" PRI__u64 ", flags=", + btrfs_test_dir_fd, ioc(BTRFS_IOC_GET_DEV_STATS), + sprint_makedev(args.devid), args.nr_items); + prfl_btrfs(btrfs_dev_stats_flags, args.flags, "BTRFS_DEV_STATS_???"); ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_DEV_STATS, &args); printf("} => {nr_items=%" PRI__u64 ", flags=", args.nr_items); - printflags(btrfs_dev_stats_flags, args.flags, + prfl_btrfs(btrfs_dev_stats_flags, args.flags, "BTRFS_DEV_STATS_???"); printf(", ["); for (i = 0; i < args.nr_items; i++) { const char *name = xlookup(btrfs_dev_stats_values, i); if (i) printf(", "); - if (name) - printf("/* %s */ ", name); + + if (name) { + if (verbose_xlat) + printf("[%u /* %s */] = ", i, name); + else + printf("[%s] = ", name); + } else { + printf("[%u] = ", i); + } + printf("%" PRI__u64, args.values[i]); } printf("]}) = 0\n"); @@ -1574,28 +1803,45 @@ btrfs_test_dev_replace_ioctl(void) /* struct btrfs_ioctl_dev_replace_args */ ioctl(-1, BTRFS_IOC_DEV_REPLACE, NULL); - printf("ioctl(-1, BTRFS_IOC_DEV_REPLACE, NULL) = -1 EBADF (%m)\n"); - - ioctl(-1, BTRFS_IOC_DEV_REPLACE, &args); - printf("ioctl(-1, BTRFS_IOC_DEV_REPLACE, " - "{cmd=BTRFS_IOCTL_DEV_REPLACE_CMD_START, start={srcdevid=%" - PRI__u64", cont_reading_from_srcdev_mode=%" PRI__u64 - ", srcdev_name=\"%s\", tgtdev_name=\"%s\"}}) = -1 EBADF (%m)\n", - args.start.srcdevid, - args.start.cont_reading_from_srcdev_mode, - (char *)args.start.srcdev_name, - (char *)args.start.tgtdev_name); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", ioc(BTRFS_IOC_DEV_REPLACE)); + + for (unsigned long i = 0; i < 3; i++) { + int saved_errno; + + args.start.cont_reading_from_srcdev_mode = i; + ioctl(-1, BTRFS_IOC_DEV_REPLACE, &args); + saved_errno = errno; + printf("ioctl(-1, %s, " + "{cmd=%sBTRFS_IOCTL_DEV_REPLACE_CMD_START%s" + ", start={srcdevid=%s" + ", cont_reading_from_srcdev_mode=", + ioc(BTRFS_IOC_DEV_REPLACE), + verbose_xlat ? "0 /* " : "", verbose_xlat ? " */" : "", + sprint_makedev(args.start.srcdevid) + ); + prxval_btrfs(btrfs_cont_reading_from_srcdev_mode, + args.start.cont_reading_from_srcdev_mode, + "BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV" + "_MODE_???", i < 2); + errno = saved_errno; + printf(", srcdev_name=\"%s\", tgtdev_name=\"%s\"}}) " + "= -1 EBADF (%m)\n", + (char *)args.start.srcdev_name, + (char *)args.start.tgtdev_name); + } args.cmd = 1; ioctl(-1, BTRFS_IOC_DEV_REPLACE, &args); - printf("ioctl(-1, BTRFS_IOC_DEV_REPLACE, " - "{cmd=BTRFS_IOCTL_DEV_REPLACE_CMD_STATUS}) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, {cmd=%sBTRFS_IOCTL_DEV_REPLACE_CMD_STATUS%s}) " + "= -1 EBADF (%m)\n", + ioc(BTRFS_IOC_DEV_REPLACE), + verbose_xlat ? "0x1 /* " : "", verbose_xlat ? " */" : ""); } static void btrfs_test_extent_same_ioctl(void) { -#ifdef BTRFS_IOC_FILE_EXTENT_SAME +# ifdef BTRFS_IOC_FILE_EXTENT_SAME struct file_dedupe_range args = { .src_offset = 1024, .src_length = 10240, @@ -1603,13 +1849,16 @@ btrfs_test_extent_same_ioctl(void) struct file_dedupe_range *argsp; ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME, NULL); - printf("ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " - "NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + sprint_xlat_(BTRFS_IOC_FILE_EXTENT_SAME, + "BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE")); - printf("ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " + printf("ioctl(-1, %s, " "{src_offset=%" PRIu64 ", src_length=%" PRIu64 ", dest_count=%hu, info=[]", + sprint_xlat_(BTRFS_IOC_FILE_EXTENT_SAME, + "BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE"), (uint64_t)args.src_offset, (uint64_t)args.src_length, args.dest_count); ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME, &args); @@ -1629,10 +1878,12 @@ btrfs_test_extent_same_ioctl(void) argsp->info[2].dest_fd = 2; argsp->info[2].dest_offset = 20480; - printf("ioctl(-1, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " + printf("ioctl(-1, %s, " "{src_offset=%" PRIu64 ", src_length=%" PRIu64 ", dest_count=%hu, info=", + sprint_xlat_(BTRFS_IOC_FILE_EXTENT_SAME, + "BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE"), (int64_t)argsp->src_offset, (uint64_t)argsp->src_length, argsp->dest_count); printf("[{dest_fd=%" PRId64 ", dest_offset=%" PRIu64 @@ -1691,9 +1942,12 @@ btrfs_test_extent_same_ioctl(void) argsp->info[2].dest_fd = fd2; argsp->info[2].dest_offset = 20480; - printf("ioctl(%d, BTRFS_IOC_FILE_EXTENT_SAME or FIDEDUPERANGE, " + printf("ioctl(%d, %s, " "{src_offset=%" PRIu64 ", src_length=%" PRIu64 ", dest_count=%hu, info=", fd1, + sprint_xlat_(BTRFS_IOC_FILE_EXTENT_SAME, + "BTRFS_IOC_FILE_EXTENT_SAME" + " or FIDEDUPERANGE"), (uint64_t)argsp->src_offset, (uint64_t)argsp->src_length, argsp->dest_count); printf("[{dest_fd=%" PRId64 ", dest_offset=%" PRIu64 @@ -1733,7 +1987,7 @@ btrfs_test_extent_same_ioctl(void) close(fd2); } free(argsp); -#endif /* BTRFS_IOC_FILE_EXTENT_SAME */ +# endif /* BTRFS_IOC_FILE_EXTENT_SAME */ } static void @@ -1744,11 +1998,11 @@ btrfs_print_features(struct btrfs_ioctl_feature_flags *flags) "BTRFS_FEATURE_COMPAT_???"); printf(", compat_ro_flags="); - printflags(btrfs_features_compat_ro, flags->compat_ro_flags, + prfl_btrfs(btrfs_features_compat_ro, flags->compat_ro_flags, "BTRFS_FEATURE_COMPAT_RO_???"); printf(", incompat_flags="); - printflags(btrfs_features_incompat, flags->incompat_flags, + prfl_btrfs(btrfs_features_incompat, flags->incompat_flags, "BTRFS_FEATURE_INCOMPAT_???"); printf("}"); } @@ -1778,9 +2032,10 @@ btrfs_test_features_ioctls(void) struct btrfs_ioctl_feature_flags supported_features[3]; ioctl(-1, BTRFS_IOC_SET_FEATURES, NULL); - printf("ioctl(-1, BTRFS_IOC_SET_FEATURES, NULL) = -1 EBADF (%m)\n"); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + ioc(BTRFS_IOC_SET_FEATURES)); - printf("ioctl(-1, BTRFS_IOC_SET_FEATURES, ["); + printf("ioctl(-1, %s, [", ioc(BTRFS_IOC_SET_FEATURES)); btrfs_print_features(&args[0]); printf(", "); btrfs_print_features(&args[1]); @@ -1788,8 +2043,8 @@ btrfs_test_features_ioctls(void) printf("]) = -1 EBADF (%m)\n"); if (btrfs_test_root) { - printf("ioctl(%d, BTRFS_IOC_GET_FEATURES, ", - btrfs_test_dir_fd); + printf("ioctl(%d, %s, ", + btrfs_test_dir_fd, ioc(BTRFS_IOC_GET_FEATURES)); ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_FEATURES, &supported_features); btrfs_print_features(&supported_features[0]); @@ -1797,15 +2052,16 @@ btrfs_test_features_ioctls(void) ioctl(btrfs_test_dir_fd, BTRFS_IOC_GET_SUPPORTED_FEATURES, &supported_features); - printf("ioctl(%d, BTRFS_IOC_GET_SUPPORTED_FEATURES, ", - btrfs_test_dir_fd); - printf("[ /* supported */ "); + printf("ioctl(%d, %s, ", + btrfs_test_dir_fd, + ioc(BTRFS_IOC_GET_SUPPORTED_FEATURES)); + printf("["); btrfs_print_features(&supported_features[0]); - printf(", /* safe to set */ "); + printf(" /* supported */, "); btrfs_print_features(&supported_features[1]); - printf(", /* safe to clear */ "); + printf(" /* safe to set */, "); btrfs_print_features(&supported_features[2]); - printf("]) = 0\n"); + printf(" /* safe to clear */]) = 0\n"); } } @@ -1816,7 +2072,7 @@ btrfs_test_read_ioctls(void) XLAT(BTRFS_IOC_BALANCE_PROGRESS), XLAT(BTRFS_IOC_FS_INFO), XLAT(BTRFS_IOC_GET_FEATURES), - XLAT(BTRFS_IOC_GET_FSLABEL), + XLAT(FS_IOC_GETFSLABEL), XLAT(BTRFS_IOC_GET_SUPPORTED_FEATURES), XLAT(BTRFS_IOC_QGROUP_LIMIT), XLAT(BTRFS_IOC_QUOTA_RESCAN_STATUS), @@ -1827,19 +2083,28 @@ btrfs_test_read_ioctls(void) unsigned int i; for (i = 0; i < ARRAY_SIZE(btrfs_read_cmd); ++i) { ioctl(-1, (unsigned long) btrfs_read_cmd[i].val, 0); - printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", btrfs_read_cmd[i].str); + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", + sprint_xlat_(btrfs_read_cmd[i].val, + btrfs_read_cmd[i].str)); } } +static void +rm_test_dir(void) +{ + int rootfd = open(path, O_RDONLY|O_DIRECTORY); + + unlinkat(rootfd, dir_name, AT_REMOVEDIR); +} + int main(int argc, char *argv[]) { int opt; int ret; - const char *path; - while ((opt = getopt(argc, argv, "wv")) != -1) { + while ((opt = getopt(argc, argv, "wvX")) != -1) { switch (opt) { case 'v': /* @@ -1851,11 +2116,18 @@ main(int argc, char *argv[]) case 'w': write_ok = true; break; + case 'X': + verbose_xlat = true; + break; default: - error_msg_and_fail("usage: btrfs [-v] [-w] [path]"); + error_msg_and_fail("usage: btrfs [-vwX] [path]"); } } + ret = snprintf(dir_name, sizeof(dir_name), dir_name_fmt, getpid()); + if (ret < 0) + perror_msg_and_fail("snprintf(dir_name)"); + /* * This will enable optional tests that require a valid file descriptor */ @@ -1877,14 +2149,18 @@ main(int argc, char *argv[]) if (rootfd < 0) perror_msg_and_fail("open(%s) failed", path); - ret = mkdirat(rootfd, "strace-test", 0755); + ret = mkdirat(rootfd, dir_name, 0755); if (ret < 0 && errno != EEXIST) - perror_msg_and_fail("mkdirat(strace-test) failed"); + perror_msg_and_fail("mkdirat(%s) failed", dir_name); + + /* Register removal of the created directory. */ + if (ret == 0) + atexit(rm_test_dir); - btrfs_test_dir_fd = openat(rootfd, "strace-test", + btrfs_test_dir_fd = openat(rootfd, dir_name, O_RDONLY|O_DIRECTORY); if (btrfs_test_dir_fd < 0) - perror_msg_and_fail("openat(strace-test) failed"); + perror_msg_and_fail("openat(%s) failed", dir_name); close(rootfd); } else write_ok = false; diff --git a/tests/btrfs.gen.test b/tests/btrfs.gen.test new file mode 100755 index 00000000..3976cf5d --- /dev/null +++ b/tests/btrfs.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (btrfs +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests/btrfs.test b/tests/btrfs.test deleted file mode 100755 index 2121b5b8..00000000 --- a/tests/btrfs.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check basic btrfs ioctl decoding. - -. "${srcdir=.}/ioctl.test" diff --git a/tests/caps-abbrev.awk b/tests/caps-abbrev.awk index 86de7f23..c00023b4 100644 --- a/tests/caps-abbrev.awk +++ b/tests/caps-abbrev.awk @@ -2,30 +2,10 @@ # # This file is part of caps strace test. # -# Copyright (c) 2014-2016 Dmitry V. Levin +# Copyright (c) 2014-2018 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later BEGIN { cap = "(0|1< +# Copyright (c) 2014-2018 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later BEGIN { cap = "(0|1< + * Copyright (c) 2014-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/caps.test b/tests/caps.test index 607a75bb..ac68364e 100755 --- a/tests/caps.test +++ b/tests/caps.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check capget/capset syscalls decoding. +# +# Copyright (c) 2014-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests/check_sigblock.c b/tests/check_sigblock.c new file mode 100644 index 00000000..cd781f19 --- /dev/null +++ b/tests/check_sigblock.c @@ -0,0 +1,29 @@ +/* + * Check that the specified signal number is blocked/unblocked. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include + +int +main(int ac, char **av) +{ + if (ac != 3) + error_msg_and_fail("usage: check_sigblock 0|1 signum"); + + const int block = !!atoi(av[1]); + const int signum = atoi(av[2]); + sigset_t mask; + + sigemptyset(&mask); + if (sigprocmask(SIG_SETMASK, NULL, &mask)) + perror_msg_and_fail("sigprocmask"); + + return block ^ sigismember(&mask, signum); +} diff --git a/tests/check_sigign.c b/tests/check_sigign.c new file mode 100644 index 00000000..a04f5d6b --- /dev/null +++ b/tests/check_sigign.c @@ -0,0 +1,29 @@ +/* + * Check that the signal handler for the specified signal number is set + * to SIG_IGN/SIG_DFL. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include + +int +main(int ac, char **av) +{ + if (ac != 3) + error_msg_and_fail("usage: check_sigign 0|1 signum"); + + const int ign = !!atoi(av[1]); + const int signum = atoi(av[2]); + struct sigaction act; + + if (sigaction(signum, NULL, &act)) + perror_msg_and_fail("sigaction: %s", av[2]); + + return ign ^ (act.sa_handler == SIG_IGN); +} diff --git a/tests/chmod.c b/tests/chmod.c index f6f98ece..d7c9fbab 100644 --- a/tests/chmod.c +++ b/tests/chmod.c @@ -1,29 +1,9 @@ /* * Copyright (c) 2016 Anchit Jain - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -31,10 +11,10 @@ #if defined __NR_chmod -#include -#include -#include -#include +# include +# include +# include +# include int main(void) diff --git a/tests/chmod.gen.test b/tests/chmod.gen.test new file mode 100755 index 00000000..40330885 --- /dev/null +++ b/tests/chmod.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (chmod -a28 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests/chmod.test b/tests/chmod.test deleted file mode 100755 index 70e561a1..00000000 --- a/tests/chmod.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check chmod syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 diff --git a/tests/chown.c b/tests/chown.c index 12aa8b71..05fe9af1 100644 --- a/tests/chown.c +++ b/tests/chown.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/chown.gen.test b/tests/chown.gen.test new file mode 100755 index 00000000..87cc0f02 --- /dev/null +++ b/tests/chown.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (chown -a28 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests/chown.test b/tests/chown.test deleted file mode 100755 index eb356ce4..00000000 --- a/tests/chown.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check chown syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 diff --git a/tests/chown32.c b/tests/chown32.c index 4fffd769..f2726203 100644 --- a/tests/chown32.c +++ b/tests/chown32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/chown32.gen.test b/tests/chown32.gen.test new file mode 100755 index 00000000..8d9d8916 --- /dev/null +++ b/tests/chown32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (chown32 -a31 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 diff --git a/tests/chown32.test b/tests/chown32.test deleted file mode 100755 index 0fa04c20..00000000 --- a/tests/chown32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check chown32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a31 diff --git a/tests/chroot.c b/tests/chroot.c index a084cf33..3fc441e3 100644 --- a/tests/chroot.c +++ b/tests/chroot.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/chroot.gen.test b/tests/chroot.gen.test new file mode 100755 index 00000000..40eb55ba --- /dev/null +++ b/tests/chroot.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (chroot -a24 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests/chroot.test b/tests/chroot.test deleted file mode 100755 index 3b384f5e..00000000 --- a/tests/chroot.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check chroot syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 diff --git a/tests/clock.gen.test b/tests/clock.gen.test new file mode 100755 index 00000000..b76eaf53 --- /dev/null +++ b/tests/clock.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (clock test_trace_expr 'times|fcntl.*' -e/clock); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr 'times|fcntl.*' -e/clock diff --git a/tests/clock.in b/tests/clock.in new file mode 100755 index 00000000..864de290 --- /dev/null +++ b/tests/clock.in @@ -0,0 +1,3 @@ +clock_adjtime -a37 +clock_nanosleep +clock_xettime -a36 diff --git a/tests/clock_adjtime.c b/tests/clock_adjtime.c index 01089b54..8e5a12fb 100644 --- a/tests/clock_adjtime.c +++ b/tests/clock_adjtime.c @@ -1,30 +1,10 @@ /* * This file is part of clock_adjtime strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/clock_adjtime.gen.test b/tests/clock_adjtime.gen.test new file mode 100755 index 00000000..22d5dbcd --- /dev/null +++ b/tests/clock_adjtime.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (clock_adjtime -a37 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a37 diff --git a/tests/clock_adjtime.test b/tests/clock_adjtime.test deleted file mode 100755 index df2c0601..00000000 --- a/tests/clock_adjtime.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check clock_adjtime syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a37 diff --git a/tests/clock_nanosleep.c b/tests/clock_nanosleep.c index 98407d7e..258c3ac1 100644 --- a/tests/clock_nanosleep.c +++ b/tests/clock_nanosleep.c @@ -1,28 +1,11 @@ /* + * Check decoding of clock_nanosleep and clock_gettime syscalls. + * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -62,9 +45,10 @@ main(void) if (syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, &req.ts, NULL)) perror_msg_and_skip("clock_nanosleep CLOCK_REALTIME"); - printf("clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=%jd, tv_nsec=%jd}, " - "NULL) = 0\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec); + printf("clock_nanosleep(CLOCK_REALTIME, 0" + ", {tv_sec=%lld, tv_nsec=%llu}, NULL) = 0\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec)); assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, NULL, &rem.ts) == -1); @@ -73,52 +57,71 @@ main(void) assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, &req.ts, &rem.ts) == 0); - printf("clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=%jd, tv_nsec=%jd}, " - "%p) = 0\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + printf("clock_nanosleep(CLOCK_REALTIME, 0" + ", {tv_sec=%lld, tv_nsec=%llu}, %p) = 0\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); req.ts.tv_nsec = 999999999 + 1; assert(syscall(__NR_clock_nanosleep, CLOCK_MONOTONIC, 0, &req.ts, &rem.ts) == -1); printf("clock_nanosleep(CLOCK_MONOTONIC, 0" - ", {tv_sec=%jd, tv_nsec=%jd}, %p) = -1 EINVAL (%m)\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + ", {tv_sec=%lld, tv_nsec=%llu}, %p) = -1 EINVAL (%m)\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); + + req.ts.tv_sec = 0xdeadbeefU; + req.ts.tv_nsec = 0xfacefeedU; + assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, + &req.ts, &rem.ts) == -1); + printf("clock_nanosleep(CLOCK_REALTIME, 0" + ", {tv_sec=%lld, tv_nsec=%llu}, %p) = -1 EINVAL (%m)\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); + + req.ts.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + req.ts.tv_nsec = (long) 0xbadc0dedfacefeedLL; + assert(syscall(__NR_clock_nanosleep, CLOCK_MONOTONIC, 0, + &req.ts, &rem.ts) == -1); + printf("clock_nanosleep(CLOCK_MONOTONIC, 0" + ", {tv_sec=%lld, tv_nsec=%llu}, %p) = -1 EINVAL (%m)\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); assert(sigaction(SIGALRM, &act, NULL) == 0); assert(sigprocmask(SIG_SETMASK, &set, NULL) == 0); if (setitimer(ITIMER_REAL, &itv, NULL)) perror_msg_and_skip("setitimer"); - printf("setitimer(ITIMER_REAL, {it_interval={tv_sec=%jd, tv_usec=%jd}" - ", it_value={tv_sec=%jd, tv_usec=%jd}}, NULL) = 0\n", - (intmax_t) itv.it_interval.tv_sec, - (intmax_t) itv.it_interval.tv_usec, - (intmax_t) itv.it_value.tv_sec, - (intmax_t) itv.it_value.tv_usec); - --req.ts.tv_nsec; + req.ts.tv_sec = 0; + req.ts.tv_nsec = 999999999; assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, 0, &req.ts, &rem.ts) == -1); - printf("clock_nanosleep(CLOCK_REALTIME, 0, {tv_sec=%jd, tv_nsec=%jd}, " - "{tv_sec=%jd, tv_nsec=%jd})" + printf("clock_nanosleep(CLOCK_REALTIME, 0" + ", {tv_sec=%lld, tv_nsec=%llu}, {tv_sec=%lld, tv_nsec=%llu})" " = ? ERESTART_RESTARTBLOCK (Interrupted by signal)\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, - (intmax_t) rem.ts.tv_sec, (intmax_t) rem.ts.tv_nsec); + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), + (long long) rem.ts.tv_sec, + zero_extend_signed_to_ull(rem.ts.tv_nsec)); puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); assert(syscall(__NR_clock_gettime, CLOCK_REALTIME, &req.ts) == 0); - printf("clock_gettime(CLOCK_REALTIME, {tv_sec=%jd, tv_nsec=%jd}) = 0\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec); + printf("clock_gettime(CLOCK_REALTIME, {tv_sec=%lld, tv_nsec=%llu}) = 0\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec)); ++req.ts.tv_sec; rem.ts.tv_sec = 0xc0de4; rem.ts.tv_nsec = 0xc0de5; assert(syscall(__NR_clock_nanosleep, CLOCK_REALTIME, TIMER_ABSTIME, &req.ts, &rem.ts) == -1); - printf("clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME, {tv_sec=%jd, " - "tv_nsec=%jd}, %p)" + printf("clock_nanosleep(CLOCK_REALTIME, TIMER_ABSTIME" + ", {tv_sec=%lld, tv_nsec=%llu}, %p)" " = ? ERESTARTNOHAND (To be restarted if no handler)\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); puts("+++ exited with 0 +++"); diff --git a/tests/clock_nanosleep.gen.test b/tests/clock_nanosleep.gen.test new file mode 100755 index 00000000..7a6025bb --- /dev/null +++ b/tests/clock_nanosleep.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (clock_nanosleep -e trace=clock_nanosleep,clock_gettime); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=clock_nanosleep,clock_gettime diff --git a/tests/clock_nanosleep.test b/tests/clock_nanosleep.test deleted file mode 100755 index ec434a60..00000000 --- a/tests/clock_nanosleep.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check clock_nanosleep, clock_gettime, and setitimer syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=clock_nanosleep,clock_gettime,setitimer diff --git a/tests/clock_xettime.c b/tests/clock_xettime.c index 3ef5695f..c25240da 100644 --- a/tests/clock_xettime.c +++ b/tests/clock_xettime.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -45,29 +26,45 @@ main(void) } t = { .pad = { 0xdeadbeef, 0xbadc0ded } }; + long rc; if (syscall(__NR_clock_getres, CLOCK_REALTIME, &t.ts)) perror_msg_and_skip("clock_getres CLOCK_REALTIME"); - printf("clock_getres(CLOCK_REALTIME, {tv_sec=%jd, tv_nsec=%jd}) = 0\n", - (intmax_t) t.ts.tv_sec, - (intmax_t) t.ts.tv_nsec); + printf("clock_getres(CLOCK_REALTIME, {tv_sec=%lld, tv_nsec=%llu})" + " = 0\n", + (long long) t.ts.tv_sec, + zero_extend_signed_to_ull(t.ts.tv_nsec)); if (syscall(__NR_clock_gettime, CLOCK_PROCESS_CPUTIME_ID, &t.ts)) perror_msg_and_skip("clock_gettime CLOCK_PROCESS_CPUTIME_ID"); - printf("clock_gettime(CLOCK_PROCESS_CPUTIME_ID, " - "{tv_sec=%jd, tv_nsec=%jd}) = 0\n", - (intmax_t) t.ts.tv_sec, - (intmax_t) t.ts.tv_nsec); + printf("clock_gettime(CLOCK_PROCESS_CPUTIME_ID" + ", {tv_sec=%lld, tv_nsec=%llu}) = 0\n", + (long long) t.ts.tv_sec, + zero_extend_signed_to_ull(t.ts.tv_nsec)); t.ts.tv_sec = 0xdeface1; t.ts.tv_nsec = 0xdeface2; - if (!syscall(__NR_clock_settime, CLOCK_THREAD_CPUTIME_ID, &t.ts)) - error_msg_and_skip("clock_settime CLOCK_THREAD_CPUTIME_ID:" - " EINVAL expected"); - printf("clock_settime(CLOCK_THREAD_CPUTIME_ID, {tv_sec=%jd, " - "tv_nsec=%jd}) = -1 EINVAL (%m)\n", - (intmax_t) t.ts.tv_sec, - (intmax_t) t.ts.tv_nsec); + rc = syscall(__NR_clock_settime, CLOCK_THREAD_CPUTIME_ID, &t.ts); + printf("clock_settime(CLOCK_THREAD_CPUTIME_ID" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + (long long) t.ts.tv_sec, + zero_extend_signed_to_ull(t.ts.tv_nsec), sprintrc(rc)); + + t.ts.tv_sec = 0xdeadbeefU; + t.ts.tv_nsec = 0xfacefeedU; + rc = syscall(__NR_clock_settime, CLOCK_THREAD_CPUTIME_ID, &t.ts); + printf("clock_settime(CLOCK_THREAD_CPUTIME_ID" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + (long long) t.ts.tv_sec, + zero_extend_signed_to_ull(t.ts.tv_nsec), sprintrc(rc)); + + t.ts.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + t.ts.tv_nsec = (long) 0xbadc0dedfacefeedLL; + rc = syscall(__NR_clock_settime, CLOCK_THREAD_CPUTIME_ID, &t.ts); + printf("clock_settime(CLOCK_THREAD_CPUTIME_ID" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + (long long) t.ts.tv_sec, + zero_extend_signed_to_ull(t.ts.tv_nsec), sprintrc(rc)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests/clock_xettime.gen.test b/tests/clock_xettime.gen.test new file mode 100755 index 00000000..590f058e --- /dev/null +++ b/tests/clock_xettime.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (clock_xettime -a36 -e trace=clock_getres,clock_gettime,clock_settime); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 -e trace=clock_getres,clock_gettime,clock_settime diff --git a/tests/clock_xettime.test b/tests/clock_xettime.test deleted file mode 100755 index f045a66e..00000000 --- a/tests/clock_xettime.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check clock_getres, clock_gettime, and clock_settime syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a36 -e trace=clock_getres,clock_gettime,clock_settime diff --git a/tests/clone_parent.c b/tests/clone_parent.c new file mode 100644 index 00000000..111f98d1 --- /dev/null +++ b/tests/clone_parent.c @@ -0,0 +1,60 @@ +/* + * Check handling of CLONE_PARENT'ed processes. + * + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include + +static int +child(void *const arg) +{ + return 42; +} + +#define child_stack_size (get_page_size() / 2) + +#ifdef IA64 +extern int __clone2(int (*)(void *), void *, size_t, int, void *, ...); +# define clone(fn, child_stack, flags, arg) \ + __clone2(fn, child_stack, child_stack_size, flags, arg) +#endif + +int +main(void) +{ + const pid_t pid = clone(child, tail_alloc(child_stack_size), + CLONE_PARENT | SIGCHLD, 0); + if (pid < 0) + perror_msg_and_fail("clone"); + + int status; + if (wait(&status) >= 0) + error_msg_and_fail("unexpected return code from wait"); + + while (!kill(pid, 0)) + ; + if (errno != ESRCH) + perror_msg_and_fail("kill"); + + FILE *const fp = fdopen(3, "a"); + if (!fp) + perror_msg_and_fail("fdopen"); + if (fprintf(fp, "%s: Exit of unknown pid %d ignored\n", + getenv("STRACE_EXE") ?: "strace", pid) < 0) + perror_msg_and_fail("fprintf"); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/clone_parent.test b/tests/clone_parent.test new file mode 100755 index 00000000..a5b077f3 --- /dev/null +++ b/tests/clone_parent.test @@ -0,0 +1,10 @@ +#!/bin/sh -efu +# +# Check handling of CLONE_PARENT'ed processes. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/clone_ptrace.test" diff --git a/tests/clone_ptrace.c b/tests/clone_ptrace.c new file mode 100644 index 00000000..ee366ab9 --- /dev/null +++ b/tests/clone_ptrace.c @@ -0,0 +1,90 @@ +/* + * Check handling of CLONE_PTRACE'ed processes. + * + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +static siginfo_t sinfo; + +static void +handler(const int no, siginfo_t *const si, void *const uc) +{ + memcpy(&sinfo, si, sizeof(sinfo)); +} + +static int +child(void *const arg) +{ + for(;;) + pause(); + return 0; +} + +#define child_stack_size (get_page_size() / 2) + +#ifdef IA64 +extern int __clone2(int (*)(void *), void *, size_t, int, void *, ...); +# define clone(fn, child_stack, flags, arg) \ + __clone2(fn, child_stack, child_stack_size, flags, arg) +#endif + +int +main(void) +{ + const int sig = SIGUSR1; + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, sig); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + const pid_t pid = clone(child, tail_alloc(child_stack_size), + CLONE_PTRACE | SIGCHLD, 0); + if (pid < 0) + perror_msg_and_fail("clone"); + + static const struct sigaction sa = { + .sa_sigaction = handler, + .sa_flags = SA_SIGINFO + }; + if (sigaction(SIGCHLD, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + kill(pid, sig); + + FILE *const fp = fdopen(3, "a"); + if (!fp) + perror_msg_and_fail("fdopen"); + if (fprintf(fp, "%s: Detached unknown pid %d\n", + getenv("STRACE_EXE") ?: "strace", pid) < 0) + perror_msg_and_fail("fprintf"); + + int status; + while (wait(&status) != pid) { + if (errno != EINTR) + perror_msg_and_fail("wait"); + } + if (!WIFSIGNALED(status) || WTERMSIG(status) != sig) + error_msg_and_fail("unexpected child exit status %d", status); + + printf("--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=%d" + ", si_uid=%u, si_status=%s, si_utime=%u, si_stime=%u} ---\n" + "+++ exited with 0 +++\n", pid, geteuid(), "SIGUSR1", + (unsigned int) sinfo.si_utime, (unsigned int) sinfo.si_stime); + + return 0; +} diff --git a/tests/clone_ptrace.test b/tests/clone_ptrace.test new file mode 100755 index 00000000..24c4298a --- /dev/null +++ b/tests/clone_ptrace.test @@ -0,0 +1,24 @@ +#!/bin/sh -efu +# +# Check handling of CLONE_PTRACE'ed processes. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null 3>&1 +args="-e trace=none $args" +> "$LOG" || fail_ "failed to write $LOG" + +$STRACE -o "$LOG" $args > "$EXP" 2> "$OUT"-err 3> "$EXP"-err || { + msg="$STRACE $args failed with code $?" + cat "$OUT"-err "$LOG" >&2 + fail_ "$msg" +} + +cat "$OUT"-err >&2 +match_diff "$LOG" "$EXP" +match_diff "$OUT"-err "$EXP"-err diff --git a/tests/copy_file_range.c b/tests/copy_file_range.c index 085010af..c1f142c6 100644 --- a/tests/copy_file_range.c +++ b/tests/copy_file_range.c @@ -2,29 +2,10 @@ * This file is part of copy_file_range strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -41,8 +22,8 @@ main(void) { const long int fd_in = (long int) 0xdeadbeefffffffff; const long int fd_out = (long int) 0xdeadbeeffffffffe; - long long int *const off_in = tail_alloc(sizeof(*off_in)); - long long int *const off_out = tail_alloc(sizeof(*off_out)); + TAIL_ALLOC_OBJECT_CONST_PTR(long long int, off_in); + TAIL_ALLOC_OBJECT_CONST_PTR(long long int, off_out); *off_in = 0xdeadbef1facefed1; *off_out = 0xdeadbef2facefed2; const size_t len = (size_t) 0xdeadbef3facefed3ULL; diff --git a/tests/copy_file_range.gen.test b/tests/copy_file_range.gen.test new file mode 100755 index 00000000..e90c6c18 --- /dev/null +++ b/tests/copy_file_range.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (copy_file_range ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/copy_file_range.test b/tests/copy_file_range.test deleted file mode 100755 index c39f6acd..00000000 --- a/tests/copy_file_range.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check copy_file_range syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/count-f.c b/tests/count-f.c index 6992b16b..505b6900 100644 --- a/tests/count-f.c +++ b/tests/count-f.c @@ -1,30 +1,10 @@ /* * This file is part of count-f strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/count-f.test b/tests/count-f.test index 67515efa..4f3d45f8 100755 --- a/tests/count-f.test +++ b/tests/count-f.test @@ -1,6 +1,11 @@ #!/bin/sh - -# Check whether -c counts through forks and clones properly +# +# Check whether -c counts through forks and clones properly. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests/count.test b/tests/count.test index e75dc6b0..6abb1772 100755 --- a/tests/count.test +++ b/tests/count.test @@ -3,40 +3,21 @@ # Check whether -c and -w options work. # # Copyright (c) 2014-2016 Dmitry V. Levin +# Copyright (c) 2014-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./sleep 0 +run_prog ../sleep 0 check_prog grep grep_log() { local pattern="$1"; shift - run_strace "$@" ./sleep 1 + run_strace "$@" ../sleep 1 grep nanosleep "$LOG" > /dev/null || framework_skip_ 'sleep does not use nanosleep' @@ -49,8 +30,12 @@ grep_log() } grep_log ' *[^ ]+ +0\.0[^n]*nanosleep' -c +grep_log ' *[^ ]+ +0\.0[^n]*nanosleep' -c -O1 grep_log ' *[^ ]+ +0\.0[^n]*nanosleep' -c -enanosleep +grep_log ' *[^ ]+ +0\.0[^n]*nanosleep' -c -O1 -enanosleep grep_log ' *[^ ]+ +(1\.[01]|0\.99)[^n]*nanosleep' -cw +grep_log ' *[^ ]+ +(1\.[01]|0\.99)[^n]*nanosleep' -cw -O1 grep_log '100\.00 +(1\.[01]|0\.99)[^n]*nanosleep' -cw -enanosleep +grep_log '100\.00 +(1\.[01]|0\.99)[^n]*nanosleep' -cw -O1 -enanosleep exit 0 diff --git a/tests/creat.c b/tests/creat.c index f22fdaaa..71819d5b 100644 --- a/tests/creat.c +++ b/tests/creat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/creat.gen.test b/tests/creat.gen.test new file mode 100755 index 00000000..baff9169 --- /dev/null +++ b/tests/creat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (creat -a20 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests/creat.test b/tests/creat.test deleted file mode 100755 index 069648f7..00000000 --- a/tests/creat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check creat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 diff --git a/tests/create_nl_socket.c b/tests/create_nl_socket.c new file mode 100644 index 00000000..ee187201 --- /dev/null +++ b/tests/create_nl_socket.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include "netlink.h" + +int +create_nl_socket_ext(const int proto, const char *const name) +{ + const int fd = socket(AF_NETLINK, SOCK_RAW, proto); + if (fd < 0) + perror_msg_and_skip("socket AF_NETLINK %s", name); + + const struct sockaddr_nl addr = { .nl_family = AF_NETLINK }; + socklen_t len = sizeof(addr); + + if (bind(fd, (const struct sockaddr *) &addr, len)) + perror_msg_and_skip("bind AF_NETLINK %s", name); + + /* one more operation on this socket to win the race */ + int listening; + len = sizeof(listening); + if (getsockopt(fd, SOL_SOCKET, SO_ACCEPTCONN, &listening, &len)) + perror_msg_and_fail("getsockopt"); + + return fd; +} diff --git a/tests/delay.c b/tests/delay.c new file mode 100644 index 00000000..fb19b157 --- /dev/null +++ b/tests/delay.c @@ -0,0 +1,115 @@ +/* + * Check delay injection. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int64_t +usecs_from_tv(const struct timeval *const tv) +{ + return (int64_t) tv->tv_sec * 1000000 + tv->tv_usec; +} + +static int64_t +usecs_from_ts(const struct timespec *const ts) +{ + return (int64_t) ts->tv_sec * 1000000 + ts->tv_nsec / 1000; +} + +static void +check_delay(const struct timeval *const tv0, + const struct timespec *const ts, + const struct timeval *const tv1, + const int nproc, + const int64_t delay_enter, + const int64_t delay_exit) +{ + const int64_t us0 = usecs_from_tv(tv0); + const int64_t us = usecs_from_ts(ts); + const int64_t us1 = usecs_from_tv(tv1); + + if (us - us0 < delay_exit * (nproc - 1) / nproc) + _exit(1); + + if (us - us0 > delay_exit * (nproc + 1) / nproc) + _exit(2); + + if (us1 - us < delay_enter * (nproc - 1) / nproc) + _exit(3); + + if (us1 - us > delay_enter * (nproc + 1) / nproc) + _exit(4); +} + +static void +run(const int nproc, const int delay_enter, const int delay_exit) +{ + struct timeval prev = { 0, 0 }, now; + + for (int i = 0; i < nproc; ++i, prev = now) { + struct timespec ts; + + if (i && clock_gettime(CLOCK_REALTIME, &ts)) + perror_msg_and_fail("clock_gettime"); + + if (syscall(__NR_gettimeofday, &now, NULL)) + perror_msg_and_fail("gettimeofday"); + + if (!i) + continue; + + check_delay(&prev, &ts, &now, nproc, delay_enter, delay_exit); + } + + _exit(0); +} + +int +main(int ac, char *av[]) +{ + if (ac != 4) + error_msg_and_fail("usage: delay "); + + const int nproc = atoi(av[1]); + if (nproc <= 1) + perror_msg_and_fail("invalid nproc: %s", av[1]); + + const int delay_enter = atoi(av[2]); + if (delay_enter <= 0) + perror_msg_and_fail("invalid delay_enter: %s", av[2]); + + const int delay_exit = atoi(av[3]); + if (delay_exit <= 0) + perror_msg_and_fail("invalid delay_exit: %s", av[3]); + + for (int i = 0; i < nproc; ++i) { + pid_t pid = fork(); + + if (pid) + usleep(MAX(delay_enter, delay_exit) / nproc); + else + run(nproc, delay_enter, delay_exit); + } + + int status; + while (wait(&status) > 0) { + if (status) + perror_msg_and_fail("wait status %d", status); + } + + return 0; +} diff --git a/tests/delay.test b/tests/delay.test new file mode 100755 index 00000000..df8552c7 --- /dev/null +++ b/tests/delay.test @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Check delay injection. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +delay_enter=800000 +delay_exit=1600000 +run_strace -f -r -egettimeofday \ + -einject=gettimeofday:delay_enter=$delay_enter:delay_exit=$delay_exit \ + ../delay 4 $delay_enter $delay_exit diff --git a/tests/delete_module.c b/tests/delete_module.c index 5a317603..3b2614c1 100644 --- a/tests/delete_module.c +++ b/tests/delete_module.c @@ -2,29 +2,10 @@ * Check decoding of delete_module syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -48,8 +29,7 @@ main(void) unsigned int val_prefix, val_suffix; } flags[] = { { ARG_STR(0), 0, 0 }, - { (kernel_ulong_t) 0xffffffff00000000ULL | O_NONBLOCK, - "O_NONBLOCK", 0, 0 }, + { F8ILL_KULONG_MASK | O_NONBLOCK, "O_NONBLOCK", 0, 0 }, { (kernel_ulong_t) 0xbadc0dedfacef157ULL & ~(O_NONBLOCK | O_TRUNC), " /* O_??? */", 0xfacef157U & ~(O_NONBLOCK | O_TRUNC), 0}, { (kernel_ulong_t) (0xfacef157deade71cULL & ~O_NONBLOCK) | O_TRUNC, @@ -65,7 +45,7 @@ main(void) fill_memory_ex(bogus_param1, PARAM1_LEN, PARAM1_BASE, PARAM1_LEN); fill_memory_ex(bogus_param2, PARAM2_LEN, PARAM2_BASE, PARAM2_LEN); - rc = syscall(__NR_delete_module, NULL, bogus_zero); + rc = syscall(__NR_delete_module, NULL, F8ILL_KULONG_MASK); printf("delete_module(NULL, 0) = %s\n", sprintrc(rc)); rc = syscall(__NR_delete_module, bogus_param1, flags[0].val); diff --git a/tests/delete_module.gen.test b/tests/delete_module.gen.test new file mode 100755 index 00000000..028515ff --- /dev/null +++ b/tests/delete_module.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (delete_module -a23 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 diff --git a/tests/delete_module.test b/tests/delete_module.test deleted file mode 100755 index fb86ec9a..00000000 --- a/tests/delete_module.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of delete_module syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a23 diff --git a/tests/detach-running.test b/tests/detach-running.test index 006efb85..5eaf3754 100755 --- a/tests/detach-running.test +++ b/tests/detach-running.test @@ -3,29 +3,10 @@ # Ensure that strace can detach from running processes. # # Copyright (c) 2013-2015 Dmitry V. Levin +# Copyright (c) 2014-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -34,9 +15,15 @@ run_prog_skip_if_failed \ check_prog sleep +trap - TERM +sleep $TIMEOUT_DURATION & +kill -TERM $! +wait $! +expected_rc=$? + set -e -./set_ptracer_any sh -c "echo > $LOG; while :; do :; done" > /dev/null & +../set_ptracer_any sh -c "echo > $LOG; while :; do :; done" > /dev/null & while ! [ -s "$LOG" ]; do kill -0 $! 2> /dev/null || @@ -54,7 +41,6 @@ cleanup() return 0 } -rm -f "$LOG" $STRACE -p $tracee_pid 2> "$LOG" & while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do @@ -65,13 +51,18 @@ while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do $SLEEP_A_BIT done -kill -INT $! -wait $! +kill -TERM $! +wait $! && rc=0 || rc=$? grep -F "Process $tracee_pid detached" "$LOG" > /dev/null || { - cleanup - dump_log_and_fail_with "$STRACE -p failed to detach" - } + cleanup + dump_log_and_fail_with "$STRACE -p failed to detach" +} + +[ "$rc" = "$expected_rc" ] || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to terminate itself" +} if [ -f /proc/self/status ]; then $SLEEP_A_BIT diff --git a/tests/detach-sleeping.test b/tests/detach-sleeping.test index 54304f31..857cc2f7 100755 --- a/tests/detach-sleeping.test +++ b/tests/detach-sleeping.test @@ -3,29 +3,10 @@ # Ensure that strace can detach from sleeping processes. # # Copyright (c) 2013-2015 Dmitry V. Levin +# Copyright (c) 2014-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -34,10 +15,15 @@ run_prog_skip_if_failed \ check_prog sleep +trap - TERM +sleep $TIMEOUT_DURATION & +kill -TERM $! +wait $! +expected_rc=$? + set -e -rm -f "$LOG" -./set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > "$LOG" & +../set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > "$LOG" & while ! [ -s "$LOG" ]; do kill -0 $! 2> /dev/null || @@ -55,7 +41,6 @@ cleanup() return 0 } -rm -f "$LOG" $STRACE -p $tracee_pid 2> "$LOG" & while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do @@ -66,14 +51,19 @@ while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do $SLEEP_A_BIT done -kill -INT $! -wait $! +kill -TERM $! +wait $! && rc=0 || rc=$? grep -F "Process $tracee_pid detached" "$LOG" > /dev/null || { cleanup dump_log_and_fail_with "$STRACE -p failed to detach" } +[ "$rc" = "$expected_rc" ] || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to terminate itself" +} + if [ -f /proc/self/status ]; then $SLEEP_A_BIT test -d /proc/$tracee_pid || { diff --git a/tests/detach-stopped.test b/tests/detach-stopped.test index 8f480e7f..5dcde9b9 100755 --- a/tests/detach-stopped.test +++ b/tests/detach-stopped.test @@ -3,46 +3,29 @@ # Ensure that strace can detach from stopped processes. # # Copyright (c) 2013-2015 Dmitry V. Levin +# Copyright (c) 2014-2019 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" +. "${srcdir=.}/PTRACE_SEIZE.sh" run_prog_skip_if_failed \ kill -0 $$ check_prog sleep -$STRACE -d -enone / > /dev/null 2> "$LOG" -if grep -x "[^:]*strace: PTRACE_SEIZE doesn't work" "$LOG" > /dev/null; then - skip_ "PTRACE_SEIZE doesn't work" -fi +trap - TERM +sleep $TIMEOUT_DURATION & +kill -TERM $! +wait $! +expected_rc=$? set -e -rm -f "$LOG" -./set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > "$LOG" & +> "$LOG" +../set_ptracer_any sleep $((2*$TIMEOUT_DURATION)) > "$LOG" & while ! [ -s "$LOG" ]; do kill -0 $! 2> /dev/null || @@ -62,7 +45,7 @@ cleanup() return 0 } -rm -f "$LOG" +> "$LOG" $STRACE -p $tracee_pid 2> "$LOG" & while ! grep -F "Process $tracee_pid attached" "$LOG" > /dev/null; do @@ -81,14 +64,19 @@ while ! grep -F -e '--- stopped by ' "$LOG" > /dev/null; do $SLEEP_A_BIT done -kill -INT $! -wait $! +kill -TERM $! +wait $! && rc=0 || rc=$? grep -F "Process $tracee_pid detached" "$LOG" > /dev/null || { cleanup dump_log_and_fail_with "$STRACE -p failed to detach" } +[ "$rc" = "$expected_rc" ] || { + cleanup + dump_log_and_fail_with "$STRACE -p failed to terminate itself" +} + if [ -f /proc/self/status ]; then $SLEEP_A_BIT test -d /proc/$tracee_pid || { diff --git a/tests/dev-yy.c b/tests/dev-yy.c new file mode 100644 index 00000000..b9f55fa4 --- /dev/null +++ b/tests/dev-yy.c @@ -0,0 +1,81 @@ +/* + * Check printing of character/block device numbers in -yy mode. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include + +#include + +#include + +#include + +#if defined __NR_openat && defined O_PATH + +int +main(void) +{ + static const struct { + const char *path; + unsigned int major; + unsigned int minor; + bool blk; + bool optional; + } checks[] = { + { "/dev/zero", 1, 5, false, false }, + { "/dev/full", 1, 7, false, false }, + { "/dev/sda", 8, 0, true, true }, + }; + + for (unsigned int i = 0; i < ARRAY_SIZE(checks); i++) { + /* + * We can't have nice things here and call openat() directly as + * some libcs (yes, musl, I'm looking at you now) are too + * frivolous in passing flags to the kernel. + */ + long fd = syscall(__NR_openat, AT_FDCWD, checks[i].path, + O_RDONLY|O_PATH); + + printf("openat(AT_FDCWD, \"%s\", O_RDONLY|O_PATH) = %s", + checks[i].path, sprintrc(fd)); + if (fd >= 0) + printf("<%s<%s %u:%u>>", + checks[i].path, + checks[i].blk ? "block" : "char", + checks[i].major, checks[i].minor); + puts(""); + + if (fd < 0) { + if (checks[i].optional) + continue; + else + perror_msg_and_fail("openat(\"%s\")", + checks[i].path); + } + + int rc = fsync(fd); + + printf("fsync(%ld<%s<%s %u:%u>>) = %s\n", + fd, checks[i].path, checks[i].blk ? "block" : "char", + checks[i].major, checks[i].minor, sprintrc(rc)); + + close(fd); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_openat && O_PATH") + +#endif diff --git a/tests/dev-yy.gen.test b/tests/dev-yy.gen.test new file mode 100755 index 00000000..d83d2e10 --- /dev/null +++ b/tests/dev-yy.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (dev-yy -a30 -e trace=openat,fsync -P "/dev/full" -P "/dev/zero" -P "/dev/sda" -yy); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 -e trace=openat,fsync -P "/dev/full" -P "/dev/zero" -P "/dev/sda" -yy diff --git a/tests/dup.c b/tests/dup.c index 62157e2f..5cf5df7c 100644 --- a/tests/dup.c +++ b/tests/dup.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include diff --git a/tests/dup.gen.test b/tests/dup.gen.test new file mode 100755 index 00000000..e559cdbc --- /dev/null +++ b/tests/dup.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (dup -a8 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 diff --git a/tests/dup.test b/tests/dup.test deleted file mode 100755 index 1dc19198..00000000 --- a/tests/dup.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check dup syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a8 diff --git a/tests/dup2.c b/tests/dup2.c index 9f3addfa..fba8fca5 100644 --- a/tests/dup2.c +++ b/tests/dup2.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/dup2.gen.test b/tests/dup2.gen.test new file mode 100755 index 00000000..6a6d2f58 --- /dev/null +++ b/tests/dup2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (dup2 -a13 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 diff --git a/tests/dup2.test b/tests/dup2.test deleted file mode 100755 index 509c5db1..00000000 --- a/tests/dup2.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check dup2 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a13 diff --git a/tests/dup3.c b/tests/dup3.c index 252e8469..741e06f8 100644 --- a/tests/dup3.c +++ b/tests/dup3.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include @@ -23,6 +30,6 @@ main(void) #else -SKIP_MAIN_UNDEFINED("__NR_dup3 && && O_CLOEXEC") +SKIP_MAIN_UNDEFINED("__NR_dup3 && O_CLOEXEC") #endif diff --git a/tests/dup3.gen.test b/tests/dup3.gen.test new file mode 100755 index 00000000..776b9a79 --- /dev/null +++ b/tests/dup3.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (dup3 -a24 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests/dup3.test b/tests/dup3.test deleted file mode 100755 index 293f78f9..00000000 --- a/tests/dup3.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check dup3 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 diff --git a/tests/epoll_create.c b/tests/epoll_create.c index 44262c7d..42cc8d04 100644 --- a/tests/epoll_create.c +++ b/tests/epoll_create.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/epoll_create.gen.test b/tests/epoll_create.gen.test new file mode 100755 index 00000000..277a5aab --- /dev/null +++ b/tests/epoll_create.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (epoll_create -a17 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests/epoll_create.test b/tests/epoll_create.test deleted file mode 100755 index 472a9bdb..00000000 --- a/tests/epoll_create.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check epoll_create syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a17 diff --git a/tests/epoll_create1.c b/tests/epoll_create1.c index cd905ecb..81b33825 100644 --- a/tests/epoll_create1.c +++ b/tests/epoll_create1.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/epoll_create1.gen.test b/tests/epoll_create1.gen.test new file mode 100755 index 00000000..c510c322 --- /dev/null +++ b/tests/epoll_create1.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (epoll_create1 -a28 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests/epoll_create1.test b/tests/epoll_create1.test deleted file mode 100755 index 7a926a97..00000000 --- a/tests/epoll_create1.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check epoll_create1 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 diff --git a/tests/epoll_ctl.c b/tests/epoll_ctl.c index e6660555..85a288cd 100644 --- a/tests/epoll_ctl.c +++ b/tests/epoll_ctl.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -11,14 +18,14 @@ static long invoke_syscall(unsigned long epfd, unsigned long op, unsigned long fd, void *ev) { - op |= (unsigned long) 0xffffffff00000000ULL; - return syscall(__NR_epoll_ctl, epfd, op, fd, (unsigned long) ev); + return syscall(__NR_epoll_ctl, epfd, F8ILL_KULONG_MASK | op, + fd, (unsigned long) ev); } int main(void) { - struct epoll_event *const ev = tail_alloc(sizeof(*ev)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct epoll_event, ev); ev->events = EPOLLIN; long rc = invoke_syscall(-1U, EPOLL_CTL_ADD, -2U, ev); diff --git a/tests/epoll_ctl.gen.test b/tests/epoll_ctl.gen.test new file mode 100755 index 00000000..dba65f7d --- /dev/null +++ b/tests/epoll_ctl.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (epoll_ctl ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/epoll_ctl.test b/tests/epoll_ctl.test deleted file mode 100755 index 1aded543..00000000 --- a/tests/epoll_ctl.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check epoll_ctl syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/epoll_pwait.c b/tests/epoll_pwait.c index eaaa34d6..ce95e6dc 100644 --- a/tests/epoll_pwait.c +++ b/tests/epoll_pwait.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -12,7 +19,7 @@ int main(void) { sigset_t set[2]; - struct epoll_event *const ev = tail_alloc(sizeof(*ev)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct epoll_event, ev); long rc = syscall(__NR_epoll_pwait, -1, ev, 1, -2, set, (kernel_ulong_t) sizeof(set)); diff --git a/tests/epoll_pwait.gen.test b/tests/epoll_pwait.gen.test new file mode 100755 index 00000000..f98e2b55 --- /dev/null +++ b/tests/epoll_pwait.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (epoll_pwait ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/epoll_pwait.test b/tests/epoll_pwait.test deleted file mode 100755 index c7aeeace..00000000 --- a/tests/epoll_pwait.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of epoll_pwait syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/epoll_wait.c b/tests/epoll_wait.c index 038bf1f7..3981905d 100644 --- a/tests/epoll_wait.c +++ b/tests/epoll_wait.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -10,7 +17,7 @@ int main(void) { - struct epoll_event *const ev = tail_alloc(sizeof(*ev)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct epoll_event, ev); long rc = syscall(__NR_epoll_wait, -1, ev, 1, -2); printf("epoll_wait(-1, %p, 1, -2) = %ld %s (%m)\n", diff --git a/tests/epoll_wait.gen.test b/tests/epoll_wait.gen.test new file mode 100755 index 00000000..d90fbeb9 --- /dev/null +++ b/tests/epoll_wait.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (epoll_wait -a26 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a26 diff --git a/tests/epoll_wait.test b/tests/epoll_wait.test deleted file mode 100755 index 83ae161f..00000000 --- a/tests/epoll_wait.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check epoll_wait syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a26 diff --git a/tests/erestartsys.c b/tests/erestartsys.c index 97c9699c..c6767b52 100644 --- a/tests/erestartsys.c +++ b/tests/erestartsys.c @@ -1,30 +1,10 @@ /* * Check decoding of ERESTARTSYS error code. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/erestartsys.gen.test b/tests/erestartsys.gen.test new file mode 100755 index 00000000..0fc3215f --- /dev/null +++ b/tests/erestartsys.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (erestartsys -a34 -e signal=none -e trace=recvfrom); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a34 -e signal=none -e trace=recvfrom diff --git a/tests/erestartsys.test b/tests/erestartsys.test deleted file mode 100755 index 91f711f3..00000000 --- a/tests/erestartsys.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of ERESTARTSYS error code. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a34 -e signal=none -e trace=recvfrom diff --git a/tests/errno2name.c b/tests/errno2name.c index 4a176993..56340d75 100644 --- a/tests/errno2name.c +++ b/tests/errno2name.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -476,6 +457,7 @@ errno2name(void) #ifdef EXFULL CASE(EXFULL); #endif - default: perror_msg_and_fail("unknown errno %d", errno); + default: + perror_msg_and_fail("unknown errno %d", errno); } } diff --git a/tests/error_msg.c b/tests/error_msg.c index 498a8821..caefa947 100644 --- a/tests/error_msg.c +++ b/tests/error_msg.c @@ -1,30 +1,14 @@ /* * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ +#define perror_msg_and_fail perror_msg_and_fail +#define error_msg_and_fail error_msg_and_fail + #include "tests.h" #include #include diff --git a/tests/eventfd.c b/tests/eventfd.c index d6ad6492..75d33dd7 100644 --- a/tests/eventfd.c +++ b/tests/eventfd.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/eventfd.test b/tests/eventfd.test index e181ed6e..b6d24454 100755 --- a/tests/eventfd.test +++ b/tests/eventfd.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check eventfd2 syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests/execve-v.test b/tests/execve-v.test index cce58601..f8bafb91 100755 --- a/tests/execve-v.test +++ b/tests/execve-v.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check verbose decoding of execve syscall. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -11,5 +16,3 @@ run_strace -veexecve $args > "$EXP" # Filter out execve() call made by strace. grep -F test.execve < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests/execve.c b/tests/execve.c index 74749e73..db7206d8 100644 --- a/tests/execve.c +++ b/tests/execve.c @@ -2,29 +2,10 @@ * This file is part of execve strace test. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -58,34 +39,40 @@ main(void) execve(FILENAME, tail_argv, tail_envp); printf("execve(\"%s\"" - ", [\"%s\", \"%s\", \"%s\", %p, %p, %p, ???]" + ", [\"%s\", \"%s\", \"%s\", %p, %p, %p, ... /* %p */]" #if VERBOSE - ", [\"%s\", \"%s\", %p, %p, %p, ???]" + ", [\"%s\", \"%s\", %p, %p, %p, ... /* %p */]" #else - ", [/* 5 vars, unterminated */]" + ", %p /* 5 vars, unterminated */" #endif ") = -1 ENOENT (%m)\n", Q_FILENAME, q_argv[0], q_argv[1], q_argv[2], - argv[3], argv[4], argv[5] + argv[3], argv[4], argv[5], (char *) tail_argv + sizeof(argv) #if VERBOSE - , q_envp[0], q_envp[1], envp[2], envp[3], envp[4] + , q_envp[0], q_envp[1], envp[2], envp[3], envp[4], + (char *) tail_envp + sizeof(envp) +#else + , tail_envp #endif ); tail_argv[ARRAY_SIZE(q_argv)] = NULL; tail_envp[ARRAY_SIZE(q_envp)] = NULL; + (void) q_envp; /* workaround for clang bug #33068 */ execve(FILENAME, tail_argv, tail_envp); printf("execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" #if VERBOSE ", [\"%s\", \"%s\"]" #else - ", [/* 2 vars */]" + ", %p /* 2 vars */" #endif ") = -1 ENOENT (%m)\n", Q_FILENAME, q_argv[0], q_argv[1], q_argv[2] #if VERBOSE , q_envp[0], q_envp[1] +#else + , tail_envp #endif ); @@ -94,16 +81,18 @@ main(void) #if VERBOSE ", [\"%s\"]" #else - ", [/* 1 var */]" + ", %p /* 1 var */" #endif ") = -1 ENOENT (%m)\n", Q_FILENAME, q_argv[2] #if VERBOSE , q_envp[1] +#else + , tail_envp + 1 #endif ); - char **const empty = tail_alloc(sizeof(*empty)); + TAIL_ALLOC_OBJECT_CONST_PTR(char *, empty); char **const efault = empty + 1; *empty = NULL; @@ -112,13 +101,22 @@ main(void) #if VERBOSE ", []" #else - ", [/* 0 vars */]" + ", %p /* 0 vars */" #endif - ") = -1 ENOENT (%m)\n", Q_FILENAME); + ") = -1 ENOENT (%m)\n", Q_FILENAME +#if !VERBOSE + , empty +#endif + ); + + char *const str_a = tail_alloc(DEFAULT_STRLEN + 2); + fill_memory_ex(str_a, DEFAULT_STRLEN + 1, '0', 10); + str_a[DEFAULT_STRLEN + 1] = '\0'; + + char *const str_b = tail_alloc(DEFAULT_STRLEN + 2); + fill_memory_ex(str_b, DEFAULT_STRLEN + 1, '_', 32); + str_b[DEFAULT_STRLEN + 1] = '\0'; - char str_a[] = "012345678901234567890123456789012"; - char str_b[] = "_abcdefghijklmnopqrstuvwxyz()[]{}"; -#define DEFAULT_STRLEN ((unsigned int) sizeof(str_a) - 2) char **const a = tail_alloc(sizeof(*a) * (DEFAULT_STRLEN + 2)); char **const b = tail_alloc(sizeof(*b) * (DEFAULT_STRLEN + 2)); unsigned int i; @@ -141,10 +139,11 @@ main(void) printf("], [\"%.*s\"...", DEFAULT_STRLEN, b[0]); for (i = 1; i <= DEFAULT_STRLEN; ++i) printf(", \"%s\"", b[i]); + printf("]"); #else - printf("], [/* %u vars */", DEFAULT_STRLEN + 1); + printf("], %p /* %u vars */", b, DEFAULT_STRLEN + 1); #endif - printf("]) = -1 ENOENT (%m)\n"); + printf(") = -1 ENOENT (%m)\n"); execve(FILENAME, a + 1, b + 1); printf("execve(\"%s\", [\"%s\"", Q_FILENAME, a[1]); @@ -154,10 +153,11 @@ main(void) printf("], [\"%s\"", b[1]); for (i = 2; i <= DEFAULT_STRLEN; ++i) printf(", \"%s\"", b[i]); + printf("]"); #else - printf("], [/* %d vars */", DEFAULT_STRLEN); + printf("], %p /* %d vars */", b + 1, DEFAULT_STRLEN); #endif - printf("]) = -1 ENOENT (%m)\n"); + printf(") = -1 ENOENT (%m)\n"); execve(FILENAME, (char **) tail_argv[ARRAY_SIZE(q_argv)], efault); printf("execve(\"%s\", NULL, %p) = -1 ENOENT (%m)\n", diff --git a/tests/execve.test b/tests/execve.test index 263b6fc5..0824bab4 100755 --- a/tests/execve.test +++ b/tests/execve.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check execve syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -11,5 +16,3 @@ run_strace -eexecve $args > "$EXP" # Filter out execve() call made by strace. grep -F test.execve < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests/execveat-v.gen.test b/tests/execveat-v.gen.test new file mode 100755 index 00000000..f7d572f3 --- /dev/null +++ b/tests/execveat-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (execveat-v -v -e trace=execveat); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=execveat diff --git a/tests/execveat-v.test b/tests/execveat-v.test deleted file mode 100755 index a9052248..00000000 --- a/tests/execveat-v.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check verbose decoding of execveat syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -e trace=execveat diff --git a/tests/execveat.c b/tests/execveat.c index 9083830e..629a69ab 100644 --- a/tests/execveat.c +++ b/tests/execveat.c @@ -2,29 +2,10 @@ * This file is part of execveat strace test. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -63,68 +44,85 @@ main(void) syscall(__NR_execveat, -100, FILENAME, tail_argv, tail_envp, 0x1100); printf("execveat(AT_FDCWD, \"%s\"" - ", [\"%s\", \"%s\", \"%s\", %p, %p, %p, ???]" -#if VERBOSE - ", [\"%s\", \"%s\", %p, %p, %p, ???]" -#else - ", [/* 5 vars, unterminated */]" -#endif + ", [\"%s\", \"%s\", \"%s\", %p, %p, %p, ... /* %p */]" +# if VERBOSE + ", [\"%s\", \"%s\", %p, %p, %p, ... /* %p */]" +# else + ", %p /* 5 vars, unterminated */" +# endif ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", Q_FILENAME, q_argv[0], q_argv[1], q_argv[2], - argv[3], argv[4], argv[5], -#if VERBOSE + argv[3], argv[4], argv[5], (char *) tail_argv + sizeof(argv), +# if VERBOSE q_envp[0], q_envp[1], envp[2], envp[3], envp[4], -#endif + (char *) tail_envp + sizeof(envp), +# else + tail_envp, +# endif errno2name()); tail_argv[ARRAY_SIZE(q_argv)] = NULL; tail_envp[ARRAY_SIZE(q_envp)] = NULL; + (void) q_envp; /* workaround for clang bug #33068 */ syscall(__NR_execveat, -100, FILENAME, tail_argv, tail_envp, 0x1100); printf("execveat(AT_FDCWD, \"%s\", [\"%s\", \"%s\", \"%s\"]" -#if VERBOSE +# if VERBOSE ", [\"%s\", \"%s\"]" -#else - ", [/* 2 vars */]" -#endif +# else + ", %p /* 2 vars */" +# endif ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", Q_FILENAME, q_argv[0], q_argv[1], q_argv[2], -#if VERBOSE +# if VERBOSE q_envp[0], q_envp[1], -#endif +# else + tail_envp, +# endif errno2name()); syscall(__NR_execveat, -100, FILENAME, tail_argv + 2, tail_envp + 1, 0x1100); printf("execveat(AT_FDCWD, \"%s\", [\"%s\"]" -#if VERBOSE +# if VERBOSE ", [\"%s\"]" -#else - ", [/* 1 var */]" -#endif +# else + ", %p /* 1 var */" +# endif ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", Q_FILENAME, q_argv[2], -#if VERBOSE +# if VERBOSE q_envp[1], -#endif +# else + tail_envp + 1, +# endif errno2name()); - char **const empty = tail_alloc(sizeof(*empty)); + TAIL_ALLOC_OBJECT_CONST_PTR(char *, empty); char **const efault = empty + 1; *empty = NULL; syscall(__NR_execveat, -100, FILENAME, empty, empty, 0x1100); printf("execveat(AT_FDCWD, \"%s\", []" -#if VERBOSE +# if VERBOSE ", []" -#else - ", [/* 0 vars */]" -#endif +# else + ", %p /* 0 vars */" +# endif ", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", - Q_FILENAME, errno2name()); + Q_FILENAME, +# if !VERBOSE + empty, +# endif + errno2name()); + + char *const str_a = tail_alloc(DEFAULT_STRLEN + 2); + fill_memory_ex(str_a, DEFAULT_STRLEN + 1, '0', 10); + str_a[DEFAULT_STRLEN + 1] = '\0'; + + char *const str_b = tail_alloc(DEFAULT_STRLEN + 2); + fill_memory_ex(str_b, DEFAULT_STRLEN + 1, '_', 32); + str_b[DEFAULT_STRLEN + 1] = '\0'; - char str_a[] = "012345678901234567890123456789012"; - char str_b[] = "_abcdefghijklmnopqrstuvwxyz()[]{}"; -#define DEFAULT_STRLEN ((unsigned int) sizeof(str_a) - 2) char **const a = tail_alloc(sizeof(*a) * (DEFAULT_STRLEN + 2)); char **const b = tail_alloc(sizeof(*b) * (DEFAULT_STRLEN + 2)); unsigned int i; @@ -138,33 +136,35 @@ main(void) printf("execveat(AT_FDCWD, \"%s\", [\"%.*s\"...", Q_FILENAME, DEFAULT_STRLEN, a[0]); for (i = 1; i < DEFAULT_STRLEN; ++i) printf(", \"%s\"", a[i]); -#if VERBOSE +# if VERBOSE printf(", \"%s\"", a[i]); -#else +# else printf(", ..."); -#endif -#if VERBOSE +# endif +# if VERBOSE printf("], [\"%.*s\"...", DEFAULT_STRLEN, b[0]); for (i = 1; i <= DEFAULT_STRLEN; ++i) printf(", \"%s\"", b[i]); -#else - printf("], [/* %u vars */", DEFAULT_STRLEN + 1); -#endif - printf("], AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + printf("]"); +# else + printf("], %p /* %u vars */", b, DEFAULT_STRLEN + 1); +# endif + printf(", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", errno2name()); syscall(__NR_execveat, -100, FILENAME, a + 1, b + 1, 0x1100); printf("execveat(AT_FDCWD, \"%s\", [\"%s\"", Q_FILENAME, a[1]); for (i = 2; i <= DEFAULT_STRLEN; ++i) printf(", \"%s\"", a[i]); -#if VERBOSE +# if VERBOSE printf("], [\"%s\"", b[1]); for (i = 2; i <= DEFAULT_STRLEN; ++i) printf(", \"%s\"", b[i]); -#else - printf("], [/* %d vars */", DEFAULT_STRLEN); -#endif - printf("], AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", + printf("]"); +# else + printf("], %p /* %d vars */", b + 1, DEFAULT_STRLEN); +# endif + printf(", AT_SYMLINK_NOFOLLOW|AT_EMPTY_PATH) = -1 %s (%m)\n", errno2name()); syscall(__NR_execveat, -100, FILENAME, NULL, efault, 0x1100); diff --git a/tests/execveat.gen.test b/tests/execveat.gen.test new file mode 100755 index 00000000..180b8299 --- /dev/null +++ b/tests/execveat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (execveat ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/execveat.test b/tests/execveat.test deleted file mode 100755 index 879e03e2..00000000 --- a/tests/execveat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check execveat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/faccessat.c b/tests/faccessat.c index ce81349d..6d95555a 100644 --- a/tests/faccessat.c +++ b/tests/faccessat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/faccessat.gen.test b/tests/faccessat.gen.test new file mode 100755 index 00000000..4ccec2aa --- /dev/null +++ b/tests/faccessat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (faccessat -P $NAME.sample); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -P $NAME.sample diff --git a/tests/faccessat.test b/tests/faccessat.test deleted file mode 100755 index 61e7e2fd..00000000 --- a/tests/faccessat.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check faccessat syscall decoding. - -. "${srcdir=.}/openat.test" diff --git a/tests/fadvise.h b/tests/fadvise.h index 7a75f73b..f8ef089b 100644 --- a/tests/fadvise.h +++ b/tests/fadvise.h @@ -3,33 +3,14 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef STRACE_TESTS_FADVISE_H -#define STRACE_TESTS_FADVISE_H +# define STRACE_TESTS_FADVISE_H # include # include diff --git a/tests/fadvise64.c b/tests/fadvise64.c index 930680be..1d7b6681 100644 --- a/tests/fadvise64.c +++ b/tests/fadvise64.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/fadvise64.test b/tests/fadvise64.test index 9f746720..c4e1415e 100755 --- a/tests/fadvise64.test +++ b/tests/fadvise64.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check decoding of fadvise64 syscall. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -9,4 +14,3 @@ run_strace -e $NAME $args > "$EXP" check_prog grep grep -v "^$NAME([0123]," < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests/fadvise64_64.c b/tests/fadvise64_64.c index c23df97f..1520b7e4 100644 --- a/tests/fadvise64_64.c +++ b/tests/fadvise64_64.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/fadvise64_64.gen.test b/tests/fadvise64_64.gen.test new file mode 100755 index 00000000..e46bf810 --- /dev/null +++ b/tests/fadvise64_64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fadvise64_64 +fadvise64.test ); do not edit. +set -- +. "${srcdir=.}/fadvise64.test" diff --git a/tests/fadvise64_64.test b/tests/fadvise64_64.test deleted file mode 100755 index a50fe2b9..00000000 --- a/tests/fadvise64_64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of fadvise64_64 syscall. - -. "${srcdir=.}/fadvise64.test" diff --git a/tests/fallocate.c b/tests/fallocate.c index a31711b3..0e2284de 100644 --- a/tests/fallocate.c +++ b/tests/fallocate.c @@ -2,29 +2,10 @@ * Check decoding of fallocate syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/fallocate.gen.test b/tests/fallocate.gen.test new file mode 100755 index 00000000..3bb5bbf0 --- /dev/null +++ b/tests/fallocate.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fallocate -a18 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests/fallocate.test b/tests/fallocate.test deleted file mode 100755 index 405187e5..00000000 --- a/tests/fallocate.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getcwd syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a18 diff --git a/tests/fanotify_init.c b/tests/fanotify_init.c index c14b4131..a3eeff53 100644 --- a/tests/fanotify_init.c +++ b/tests/fanotify_init.c @@ -2,29 +2,10 @@ * Check decoding of fanotify_init syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -60,17 +41,19 @@ int main(void) { static const struct strval flags[] = { - { (kernel_ulong_t) 0xffffffff00000000ULL, "FAN_CLASS_NOTIF" }, + { F8ILL_KULONG_MASK, "FAN_CLASS_NOTIF" }, { (kernel_ulong_t) 0xffffffff0000000cULL, "0xc /* FAN_CLASS_??? */" }, - { (kernel_ulong_t) 0xdec0deddefaced04ULL, - "FAN_CLASS_CONTENT|0xefaced00 /* FAN_??? */" }, + { (kernel_ulong_t) 0xdec0deddefacec04ULL, + "FAN_CLASS_CONTENT|0xefacec00 /* FAN_??? */" }, { (kernel_ulong_t) 0xffffffffffffffffULL, "0xc /* FAN_CLASS_??? */|FAN_CLOEXEC|FAN_NONBLOCK|" - "FAN_UNLIMITED_QUEUE|FAN_UNLIMITED_MARKS|0xffffffc0" }, + "FAN_UNLIMITED_QUEUE|FAN_UNLIMITED_MARKS|" + "FAN_ENABLE_AUDIT|FAN_REPORT_TID|FAN_REPORT_FID|" + "0xfffffc80" }, }; static const struct strval event_f_flags[] = { - { (kernel_ulong_t) 0xffffffff00000000ULL, "O_RDONLY" }, + { F8ILL_KULONG_MASK, "O_RDONLY" }, { (kernel_ulong_t) 0xdeadbeef80000001ULL, "O_WRONLY|0x80000000" } }; diff --git a/tests/fanotify_init.gen.test b/tests/fanotify_init.gen.test new file mode 100755 index 00000000..69807a7a --- /dev/null +++ b/tests/fanotify_init.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fanotify_init ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/fanotify_init.test b/tests/fanotify_init.test deleted file mode 100755 index 8d26af42..00000000 --- a/tests/fanotify_init.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of fanotify_init syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/fanotify_mark-Xabbrev.c b/tests/fanotify_mark-Xabbrev.c new file mode 100644 index 00000000..2dc9fa12 --- /dev/null +++ b/tests/fanotify_mark-Xabbrev.c @@ -0,0 +1 @@ +#include "fanotify_mark.c" diff --git a/tests/fanotify_mark-Xabbrev.gen.test b/tests/fanotify_mark-Xabbrev.gen.test new file mode 100755 index 00000000..86c40340 --- /dev/null +++ b/tests/fanotify_mark-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fanotify_mark-Xabbrev -a32 -Xabbrev -e trace=fanotify_mark); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -Xabbrev -e trace=fanotify_mark diff --git a/tests/fanotify_mark-Xraw.c b/tests/fanotify_mark-Xraw.c new file mode 100644 index 00000000..f02c886a --- /dev/null +++ b/tests/fanotify_mark-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "fanotify_mark.c" diff --git a/tests/fanotify_mark-Xraw.gen.test b/tests/fanotify_mark-Xraw.gen.test new file mode 100755 index 00000000..5be964d0 --- /dev/null +++ b/tests/fanotify_mark-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fanotify_mark-Xraw -a32 -Xraw -e trace=fanotify_mark); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -Xraw -e trace=fanotify_mark diff --git a/tests/fanotify_mark-Xverbose.c b/tests/fanotify_mark-Xverbose.c new file mode 100644 index 00000000..b76f46f3 --- /dev/null +++ b/tests/fanotify_mark-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "fanotify_mark.c" diff --git a/tests/fanotify_mark-Xverbose.gen.test b/tests/fanotify_mark-Xverbose.gen.test new file mode 100755 index 00000000..ef1a99d6 --- /dev/null +++ b/tests/fanotify_mark-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fanotify_mark-Xverbose -a32 -Xverbose -e trace=fanotify_mark); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -Xverbose -e trace=fanotify_mark diff --git a/tests/fanotify_mark.c b/tests/fanotify_mark.c index 43f285d3..33d18253 100644 --- a/tests/fanotify_mark.c +++ b/tests/fanotify_mark.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2015-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,6 +21,20 @@ # include # include +# if XLAT_RAW +# define str_fan_mark_add "0x1" +# define str_fan_modify_ondir "0x40000002" +# define str_at_fdcwd "-100" +# elif XLAT_VERBOSE +# define str_fan_mark_add "0x1 /* FAN_MARK_ADD */" +# define str_fan_modify_ondir "0x40000002 /* FAN_MODIFY|FAN_ONDIR */" +# define str_at_fdcwd "-100 /* AT_FDCWD */" +# else +# define str_fan_mark_add "FAN_MARK_ADD" +# define str_fan_modify_ondir "FAN_MODIFY|FAN_ONDIR" +# define str_at_fdcwd "AT_FDCWD" +# endif + /* Performs fanotify_mark call via the syscall interface. */ static void do_call(kernel_ulong_t fd, kernel_ulong_t flags, const char *flags_str, @@ -78,8 +73,8 @@ struct strval64 { const char *str; }; -#define STR16 "0123456789abcdef" -#define STR64 STR16 STR16 STR16 STR16 +# define STR16 "0123456789abcdef" +# define STR64 STR16 STR16 STR16 STR16 int main(void) @@ -90,32 +85,97 @@ main(void) static const kernel_ulong_t fds[] = { (kernel_ulong_t) 0xdeadfeed12345678ULL, - (kernel_ulong_t) 0xffffffff00000000ULL, + F8ILL_KULONG_MASK, (kernel_ulong_t) 0xdeb0d1edffffffffULL, }; static const struct strval flags[] = { - { (kernel_ulong_t) 0xffffffff00000000ULL, "0" }, - { (kernel_ulong_t) 0xdec0deddefaced00ULL, - "0xefaced00 /* FAN_MARK_??? */" }, + { F8ILL_KULONG_MASK, "0" }, + { (kernel_ulong_t) 0xdec0deddefacec00ULL, + "0xefacec00" +# if !XLAT_RAW + " /* FAN_MARK_??? */" +# endif + }, { (kernel_ulong_t) 0xda7a105700000040ULL, - "FAN_MARK_IGNORED_SURV_MODIFY" }, - { (kernel_ulong_t) 0xbadc0deddeadfeedULL, - "FAN_MARK_ADD|FAN_MARK_DONT_FOLLOW|FAN_MARK_ONLYDIR|" - "FAN_MARK_IGNORED_MASK|FAN_MARK_IGNORED_SURV_MODIFY|" - "FAN_MARK_FLUSH|0xdeadfe00" }, +# if XLAT_RAW + "0x40" +# elif XLAT_VERBOSE + "0x40 /* FAN_MARK_IGNORED_SURV_MODIFY */" +# else + "FAN_MARK_IGNORED_SURV_MODIFY" +# endif + }, + { (kernel_ulong_t) 0xbadc0deddeadffffULL, +# if XLAT_RAW || XLAT_VERBOSE + "0xdeadffff" +# endif +# if XLAT_VERBOSE + " /* " +# endif +# if !XLAT_RAW + "FAN_MARK_ADD|FAN_MARK_REMOVE|FAN_MARK_DONT_FOLLOW|" + "FAN_MARK_ONLYDIR|FAN_MARK_MOUNT|FAN_MARK_IGNORED_MASK|" + "FAN_MARK_IGNORED_SURV_MODIFY|FAN_MARK_FLUSH|" + "FAN_MARK_FILESYSTEM|0xdeadfe00" +# endif +# if XLAT_VERBOSE + " */" +# endif + }, }; static const struct strval64 masks[] = { { ARG_ULL_STR(0) }, - { 0xdeadfeedfacebeefULL, - "FAN_ACCESS|FAN_MODIFY|FAN_CLOSE_WRITE|FAN_OPEN|" - "FAN_ACCESS_PERM|FAN_ONDIR|FAN_EVENT_ON_CHILD|" - "0xdeadfeedb2ccbec4" }, - { ARG_ULL_STR(0xffffffffb7fcbfc4) " /* FAN_??? */" }, + { 0xdeadfeedffffffffULL, +# if XLAT_RAW || XLAT_VERBOSE + "0xdeadfeedffffffff" +# endif +# if XLAT_VERBOSE + " /* " +# endif +# if !XLAT_RAW + "FAN_ACCESS|" + "FAN_MODIFY|" + "FAN_ATTRIB|" + "FAN_CLOSE_WRITE|" + "FAN_CLOSE_NOWRITE|" + "FAN_OPEN|" + "FAN_MOVED_FROM|" + "FAN_MOVED_TO|" + "FAN_CREATE|" + "FAN_DELETE|" + "FAN_DELETE_SELF|" + "FAN_MOVE_SELF|" + "FAN_OPEN_EXEC|" + "FAN_Q_OVERFLOW|" + "FAN_OPEN_PERM|" + "FAN_ACCESS_PERM|" + "FAN_OPEN_EXEC_PERM|" + "FAN_ONDIR|" + "FAN_EVENT_ON_CHILD|" + "0xdeadfeedb7f8a000" +# endif +# if XLAT_VERBOSE + " */" +# endif + }, + { ARG_ULL_STR(0xffffffffb7f8a000) +# if !XLAT_RAW + " /* FAN_??? */" +# endif + }, }; static const struct strval dirfds[] = { { (kernel_ulong_t) 0xfacefeed00000001ULL, "1" }, - { (kernel_ulong_t) 0xdec0ded0ffffffffULL, "FAN_NOFD" }, - { (kernel_ulong_t) 0xbadfacedffffff9cULL, "AT_FDCWD" }, + { (kernel_ulong_t) 0xdec0ded0ffffffffULL, +# if XLAT_RAW + "-1" +# elif XLAT_VERBOSE + "-1 /* FAN_NOFD */" +# else + "FAN_NOFD" +# endif + }, + { (kernel_ulong_t) 0xbadfacedffffff9cULL, str_at_fdcwd }, { (kernel_ulong_t) 0xdefaced1beeff00dULL, "-1091571699" }, }; static const char str64[] = STR64; @@ -148,8 +208,9 @@ main(void) rc = fanotify_mark(-1, FAN_MARK_ADD, FAN_MODIFY | FAN_ONDIR, -100, "."); - printf("fanotify_mark(-1, FAN_MARK_ADD, FAN_MODIFY|FAN_ONDIR" - ", AT_FDCWD, \".\") = %s\n", sprintrc(rc)); + printf("fanotify_mark(-1, %s, %s, %s, \".\") = %s\n", + str_fan_mark_add, str_fan_modify_ondir, str_at_fdcwd, + sprintrc(rc)); for (i = 0; i < ARRAY_SIZE(fds); i++) { for (j = 0; j < ARRAY_SIZE(flags); j++) { diff --git a/tests/fanotify_mark.gen.test b/tests/fanotify_mark.gen.test new file mode 100755 index 00000000..46512608 --- /dev/null +++ b/tests/fanotify_mark.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fanotify_mark -a32 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 diff --git a/tests/fanotify_mark.test b/tests/fanotify_mark.test deleted file mode 100755 index fd671387..00000000 --- a/tests/fanotify_mark.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of fanotify_mark syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a32 diff --git a/tests/fchdir.c b/tests/fchdir.c index 3cde5e63..118e5fea 100644 --- a/tests/fchdir.c +++ b/tests/fchdir.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/fchdir.gen.test b/tests/fchdir.gen.test new file mode 100755 index 00000000..a352a21b --- /dev/null +++ b/tests/fchdir.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fchdir -a11 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 diff --git a/tests/fchdir.test b/tests/fchdir.test deleted file mode 100755 index 3a4296ed..00000000 --- a/tests/fchdir.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check fchdir syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a11 diff --git a/tests/fchmod.c b/tests/fchmod.c index 932d0830..4fa06727 100644 --- a/tests/fchmod.c +++ b/tests/fchmod.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Fabien Siron * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/fchmod.gen.test b/tests/fchmod.gen.test new file mode 100755 index 00000000..828c9b50 --- /dev/null +++ b/tests/fchmod.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fchmod -a15 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests/fchmod.test b/tests/fchmod.test deleted file mode 100755 index 4cb12632..00000000 --- a/tests/fchmod.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check fchmod syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a15 diff --git a/tests/fchmodat.c b/tests/fchmodat.c index c52a1cab..f2fa5dd0 100644 --- a/tests/fchmodat.c +++ b/tests/fchmodat.c @@ -1,30 +1,10 @@ /* * Check decoding of fchmodat syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/fchmodat.gen.test b/tests/fchmodat.gen.test new file mode 100755 index 00000000..36461858 --- /dev/null +++ b/tests/fchmodat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fchmodat ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/fchmodat.test b/tests/fchmodat.test deleted file mode 100755 index 13cbe806..00000000 --- a/tests/fchmodat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of fchmodat syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/fchown.c b/tests/fchown.c index d7119032..98bfd9de 100644 --- a/tests/fchown.c +++ b/tests/fchown.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/fchown.gen.test b/tests/fchown.gen.test new file mode 100755 index 00000000..ec7f7c54 --- /dev/null +++ b/tests/fchown.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fchown -a16 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 diff --git a/tests/fchown.test b/tests/fchown.test deleted file mode 100755 index 63a0f2e3..00000000 --- a/tests/fchown.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check fchown syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a16 diff --git a/tests/fchown32.c b/tests/fchown32.c index 2d9d60f8..9d52f9a8 100644 --- a/tests/fchown32.c +++ b/tests/fchown32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/fchown32.gen.test b/tests/fchown32.gen.test new file mode 100755 index 00000000..16705832 --- /dev/null +++ b/tests/fchown32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fchown32 -a18 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests/fchown32.test b/tests/fchown32.test deleted file mode 100755 index e837f54e..00000000 --- a/tests/fchown32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check fchown32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a18 diff --git a/tests/fchownat.c b/tests/fchownat.c index f2f37ae3..32167bc7 100644 --- a/tests/fchownat.c +++ b/tests/fchownat.c @@ -1,30 +1,10 @@ /* * Check decoding of fchownat syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/fchownat.gen.test b/tests/fchownat.gen.test new file mode 100755 index 00000000..54bd0430 --- /dev/null +++ b/tests/fchownat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fchownat ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/fchownat.test b/tests/fchownat.test deleted file mode 100755 index e5d0f285..00000000 --- a/tests/fchownat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of fchownat syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/fcntl-common.c b/tests/fcntl-common.c new file mode 100644 index 00000000..b2125171 --- /dev/null +++ b/tests/fcntl-common.c @@ -0,0 +1,379 @@ +/* + * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include +#include +#include +#include +#include +#include +#include "flock.h" + +#define FILE_LEN 4096 + +#define TEST_FLOCK_EINVAL(cmd) test_flock_einval(cmd, #cmd) +#define TEST_FLOCK64_EINVAL(cmd) test_flock64_einval(cmd, #cmd) + +#ifdef HAVE_TYPEOF +# define TYPEOF_FLOCK_OFF_T typeof(((struct_kernel_flock *) NULL)->l_len) +#else +# define TYPEOF_FLOCK_OFF_T off_t +#endif + +static const char *errstr; + +static long +invoke_test_syscall(const unsigned int fd, const unsigned int cmd, void *const p) +{ + const kernel_ulong_t kfd = F8ILL_KULONG_MASK | fd; + const kernel_ulong_t op = F8ILL_KULONG_MASK | cmd; + + long rc = syscall(TEST_SYSCALL_NR, kfd, op, (uintptr_t) p); + errstr = sprintrc(rc); + return rc; +} + +static void +test_flock_einval(const int cmd, const char *name) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct_kernel_flock, fl); + memset(fl, 0, sizeof(*fl)); + fl->l_type = F_RDLCK; + fl->l_start = (TYPEOF_FLOCK_OFF_T) 0xdefaced1facefeedULL; + fl->l_len = (TYPEOF_FLOCK_OFF_T) 0xdefaced2cafef00dULL; + + invoke_test_syscall(0, cmd, fl); + printf("%s(0, %s, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=%jd, l_len=%jd}) = %s\n", TEST_SYSCALL_STR, name, + (intmax_t) fl->l_start, (intmax_t) fl->l_len, errstr); + + void *const bad_addr = (void *) fl + 1; + invoke_test_syscall(0, cmd, bad_addr); + printf("%s(0, %s, %p) = %s\n", + TEST_SYSCALL_STR, name, bad_addr, errstr); +} + +/* + * This function is not declared static to avoid potential + * "defined but not used" warning when included by fcntl.c + */ +void +test_flock64_einval(const int cmd, const char *name) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct_kernel_flock64, fl); + memset(fl, 0, sizeof(*fl)); + fl->l_type = F_RDLCK; + fl->l_start = (TYPEOF_FLOCK_OFF_T) 0xdefaced1facefeedULL; + fl->l_len = (TYPEOF_FLOCK_OFF_T) 0xdefaced2cafef00dULL; + + invoke_test_syscall(0, cmd, fl); + printf("%s(0, %s, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=%jd, l_len=%jd}) = %s\n", TEST_SYSCALL_STR, name, + (intmax_t) fl->l_start, (intmax_t) fl->l_len, errstr); + + void *const bad_addr = (void *) fl + 1; + invoke_test_syscall(0, cmd, bad_addr); + printf("%s(0, %s, %p) = %s\n", + TEST_SYSCALL_STR, name, bad_addr, errstr); +} + +static void +test_flock(void) +{ + TEST_FLOCK_EINVAL(F_SETLK); + TEST_FLOCK_EINVAL(F_SETLKW); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct_kernel_flock, fl); + memset(fl, 0, sizeof(*fl)); + fl->l_type = F_RDLCK; + fl->l_len = FILE_LEN; + + long rc = invoke_test_syscall(0, F_SETLK, fl); + printf("%s(0, F_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = %s\n", + TEST_SYSCALL_STR, FILE_LEN, errstr); + if (rc) + return; + + invoke_test_syscall(0, F_GETLK, fl); + printf("%s(0, F_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d, l_pid=0}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); + + invoke_test_syscall(0, F_SETLKW, fl); + printf("%s(0, F_SETLKW, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); +} + +static void +test_flock64_ofd(void) +{ +#if defined F_OFD_GETLK && defined F_OFD_SETLK && defined F_OFD_SETLKW + TEST_FLOCK64_EINVAL(F_OFD_SETLK); + TEST_FLOCK64_EINVAL(F_OFD_SETLKW); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct_kernel_flock64, fl); + memset(fl, 0, sizeof(*fl)); + fl->l_type = F_RDLCK; + fl->l_len = FILE_LEN; + + long rc = invoke_test_syscall(0, F_OFD_SETLK, fl); + printf("%s(0, F_OFD_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = %s\n", + TEST_SYSCALL_STR, FILE_LEN, errstr); + if (rc) + return; + + invoke_test_syscall(0, F_OFD_GETLK, fl); + printf("%s(0, F_OFD_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d, l_pid=0}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); + + invoke_test_syscall(0, F_OFD_SETLKW, fl); + printf("%s(0, F_OFD_SETLKW, {l_type=F_UNLCK, l_whence=SEEK_SET" + ", l_start=0, l_len=%d}) = 0\n", + TEST_SYSCALL_STR, FILE_LEN); +#endif /* F_OFD_GETLK && F_OFD_SETLK && F_OFD_SETLKW */ +} + +static void test_flock64_lk64(void); + +static void +test_flock64(void) +{ + test_flock64_ofd(); + test_flock64_lk64(); +} + +/* + * F_[GS]ETOWN_EX had conflicting values with F_[SG]ETLK64 + * in kernel revisions v2.6.32-rc1~96..v2.6.32-rc7~23. + */ +#undef TEST_F_OWNER_EX +#if defined F_GETOWN_EX && defined F_SETOWN_EX \ + && (F_GETOWN_EX != F_SETLK64) && (F_SETOWN_EX != F_GETLK64) +# define TEST_F_OWNER_EX +#endif + +#ifdef TEST_F_OWNER_EX +# include "f_owner_ex.h" + +static long +test_f_owner_ex_type_pid(const int cmd, const char *const cmd_name, + const int type, const char *const type_name, + pid_t pid) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct_kernel_f_owner_ex, fo); + + fo->type = type; + fo->pid = pid; + long rc = invoke_test_syscall(0, cmd, fo); + printf("%s(0, %s, {type=%s, pid=%d}) = %s\n", + TEST_SYSCALL_STR, cmd_name, type_name, fo->pid, errstr); + + void *bad_addr = (void *) fo + 1; + invoke_test_syscall(0, cmd, bad_addr); + printf("%s(0, %s, %p) = %s\n", + TEST_SYSCALL_STR, cmd_name, bad_addr, errstr); + + return rc; +} + +static void +test_f_owner_ex_umove_or_printaddr(const int type, const char *const type_name, + pid_t pid) +{ + long rc = test_f_owner_ex_type_pid(ARG_STR(F_SETOWN_EX), + type, type_name, pid); + if (!rc) + test_f_owner_ex_type_pid(ARG_STR(F_GETOWN_EX), + type, type_name, pid); +} + +static void +test_f_owner_ex(void) +{ + static const struct { + int type; + const char *type_name; + pid_t pid[2]; + } a[] = { + { ARG_STR(F_OWNER_TID), { 1234567890, 20 } }, + { ARG_STR(F_OWNER_PID), { 1298126790, 30 } }, + { ARG_STR(F_OWNER_PGRP), { 1294567890, 40 } } + }; + + for (unsigned int i = 0; i < ARRAY_SIZE(a); i++) { + for (unsigned int j = 0; j < ARRAY_SIZE(a[0].pid); j++) { + test_f_owner_ex_umove_or_printaddr(a[i].type, + a[i].type_name, + a[i].pid[j]); + } + } +} +#endif /* TEST_F_OWNER_EX */ + +struct fcntl_cmd_check { + int fd; + int cmd; + const char *cmd_str; + long arg; + const char *arg_str; + void (*print_flags)(long rc); +}; + +static void +print_retval_flags(const struct fcntl_cmd_check *check, long rc) +{ + if (check->print_flags) { + check->print_flags(rc); + } else { + printf("%s", errstr); + } + printf("\n"); +} + +static void +test_other_set_cmd(const struct fcntl_cmd_check *check) +{ + invoke_test_syscall(check->fd, check->cmd, (void *) check->arg); + printf("%s(%d, %s, %s) = %s\n", + TEST_SYSCALL_STR, check->fd, + check->cmd_str, check->arg_str, errstr); + + /* bad file fd */ + invoke_test_syscall(-1, check->cmd, (void *) check->arg); + printf("%s(-1, %s, %s) = %s\n", + TEST_SYSCALL_STR, check->cmd_str, + check->arg_str, errstr); +} + +static void +test_other_get_cmd(const struct fcntl_cmd_check *check) +{ + long rc = invoke_test_syscall(check->fd, check->cmd, NULL); + printf("%s(%d, %s) = ", + TEST_SYSCALL_STR, check->fd, check->cmd_str); + print_retval_flags(check, rc); + + /* bad file fd */ + invoke_test_syscall(-1, check->cmd, NULL); + printf("%s(-1, %s) = %s\n", + TEST_SYSCALL_STR, check->cmd_str, errstr); +} + +static void +print_flags_getfd(long rc) +{ + assert(rc >= 0); + printf("%#lx%s", rc, rc & 1 ? " (flags FD_CLOEXEC)" : ""); +} + +static void +print_flags_getsig(long rc) +{ + assert(rc >= 0); + + if (!rc) { + printf("%ld", rc); + } else { + printf("%ld (%s)", rc, signal2name((int) rc)); + } +} + +static void +print_flags_getlease(long rc) +{ + assert(rc >= 0); + const char *text; + + switch (rc) { + case F_RDLCK: + text = "F_RDLCK"; + break; + case F_WRLCK: + text = "F_WRLCK"; + break; + case F_UNLCK: + text = "F_UNLCK"; + break; + default: + error_msg_and_fail("fcntl returned %#lx, does the" + " test have to be updated?", rc); + } + printf("%#lx (%s)", rc, text); +} + +static void +test_fcntl_others(void) +{ + static const struct fcntl_cmd_check set_checks[] = { + { 0, ARG_STR(F_SETFD), ARG_STR(FD_CLOEXEC) }, + { 0, ARG_STR(F_SETOWN), ARG_STR(20) }, +#ifdef F_SETPIPE_SZ + { 0, ARG_STR(F_SETPIPE_SZ), ARG_STR(4097) }, +#endif + { 0, ARG_STR(F_DUPFD), ARG_STR(0) }, +#ifdef F_DUPFD_CLOEXEC + { 0, ARG_STR(F_DUPFD_CLOEXEC), ARG_STR(0) }, +#endif + { 0, ARG_STR(F_SETFL), ARG_STR(O_RDWR|O_LARGEFILE) }, + { 0, ARG_STR(F_NOTIFY), ARG_STR(DN_ACCESS) }, + { 1, ARG_STR(F_SETLEASE), ARG_STR(F_RDLCK) }, + { 0, ARG_STR(F_SETSIG), 0, "0" }, + { 1, ARG_STR(F_SETSIG), 1, "SIGHUP" } + }; + for (unsigned int i = 0; i < ARRAY_SIZE(set_checks); i++) { + test_other_set_cmd(set_checks + i); + } + + static const struct fcntl_cmd_check get_checks[] = { + { 0, ARG_STR(F_GETFD), .print_flags = print_flags_getfd }, + { 1, ARG_STR(F_GETFD), .print_flags = print_flags_getfd }, + { 0, ARG_STR(F_GETOWN) }, +#ifdef F_GETPIPE_SZ + { 0, ARG_STR(F_GETPIPE_SZ) }, +#endif + { 1, ARG_STR(F_GETLEASE), .print_flags = print_flags_getlease }, + { 0, ARG_STR(F_GETSIG), .print_flags = print_flags_getsig }, + { 1, ARG_STR(F_GETSIG), .print_flags = print_flags_getsig } + }; + for (unsigned int j = 0; j < ARRAY_SIZE(get_checks); j++) { + test_other_get_cmd(get_checks + j); + } +} + +static void +create_sample(void) +{ + char fname[] = TEST_SYSCALL_STR "_XXXXXX"; + + (void) close(0); + if (mkstemp(fname)) + perror_msg_and_fail("mkstemp: %s", fname); + if (unlink(fname)) + perror_msg_and_fail("unlink: %s", fname); + if (ftruncate(0, FILE_LEN)) + perror_msg_and_fail("ftruncate"); +} + +int +main(void) +{ + create_sample(); + test_flock(); + test_flock64(); +#ifdef TEST_F_OWNER_EX + test_f_owner_ex(); +#endif + test_fcntl_others(); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/fcntl.c b/tests/fcntl.c index f060cdf8..bd9ffbdd 100644 --- a/tests/fcntl.c +++ b/tests/fcntl.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,51 +13,40 @@ # define TEST_SYSCALL_NR __NR_fcntl # define TEST_SYSCALL_STR "fcntl" -# include "struct_flock.c" - -# define TEST_FLOCK64_EINVAL(cmd) test_flock64_einval(cmd, #cmd) +# include "fcntl-common.c" static void -test_flock64_einval(const int cmd, const char *name) +test_flock64_undecoded(const int cmd, const char *name) { struct_kernel_flock64 fl = { .l_type = F_RDLCK, .l_start = 0xdefaced1facefeedULL, .l_len = 0xdefaced2cafef00dULL }; - invoke_test_syscall(cmd, &fl); + invoke_test_syscall(0, cmd, &fl); printf("%s(0, %s, %p) = %s\n", - TEST_SYSCALL_STR, name, &fl, EINVAL_STR); + TEST_SYSCALL_STR, name, &fl, errstr); } +# define TEST_FLOCK64_UNDECODED(cmd) test_flock64_undecoded(cmd, #cmd) + static void -test_flock64(void) +test_flock64_lk64(void) { /* * F_[GS]ETOWN_EX had conflicting values with F_[GS]ETLK64 * in kernel revisions v2.6.32-rc1~96..v2.6.32-rc7~23. */ -#if !defined(F_GETOWN_EX) || F_GETOWN_EX != F_SETLK64 - TEST_FLOCK64_EINVAL(F_SETLK64); -#endif +# if !defined(F_GETOWN_EX) || F_GETOWN_EX != F_SETLK64 + TEST_FLOCK64_UNDECODED(F_SETLK64); +# endif /* F_GETLK and F_SETLKW64 have conflicting values on mips64 */ -#if !defined(__mips64) || F_GETLK != F_SETLKW64 - TEST_FLOCK64_EINVAL(F_SETLKW64); -#endif -#if !defined(F_SETOWN_EX) || F_SETOWN_EX != F_GETLK64 - TEST_FLOCK64_EINVAL(F_GETLK64); -#endif -} - -int -main(void) -{ - create_sample(); - test_flock(); - test_flock64(); - - puts("+++ exited with 0 +++"); - return 0; +# if !defined(__mips64) || F_GETLK != F_SETLKW64 + TEST_FLOCK64_UNDECODED(F_SETLKW64); +# endif +# if !defined(F_SETOWN_EX) || F_SETOWN_EX != F_GETLK64 + TEST_FLOCK64_UNDECODED(F_GETLK64); +# endif } #else diff --git a/tests/fcntl.gen.test b/tests/fcntl.gen.test new file mode 100755 index 00000000..9de26c00 --- /dev/null +++ b/tests/fcntl.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fcntl -a8 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 diff --git a/tests/fcntl.test b/tests/fcntl.test deleted file mode 100755 index 9aea122d..00000000 --- a/tests/fcntl.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check fcntl decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a8 diff --git a/tests/fcntl64.c b/tests/fcntl64.c index 5ecd6eb9..97277b2f 100644 --- a/tests/fcntl64.c +++ b/tests/fcntl64.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,68 +13,38 @@ # define TEST_SYSCALL_NR __NR_fcntl64 # define TEST_SYSCALL_STR "fcntl64" -# include "struct_flock.c" - -# define TEST_FLOCK64_EINVAL(cmd) test_flock64_einval(cmd, #cmd) - -static void -test_flock64_einval(const int cmd, const char *name) -{ - struct_kernel_flock64 fl = { - .l_type = F_RDLCK, - .l_start = 0xdefaced1facefeedULL, - .l_len = 0xdefaced2cafef00dULL - }; - invoke_test_syscall(cmd, &fl); - printf("%s(0, %s, {l_type=F_RDLCK, l_whence=SEEK_SET" - ", l_start=%jd, l_len=%jd}) = %s\n", TEST_SYSCALL_STR, name, - (intmax_t) fl.l_start, (intmax_t) fl.l_len, EINVAL_STR); -} +# include "fcntl-common.c" static void -test_flock64(void) +test_flock64_lk64(void) { TEST_FLOCK64_EINVAL(F_SETLK64); TEST_FLOCK64_EINVAL(F_SETLKW64); -# ifdef F_OFD_SETLK - TEST_FLOCK64_EINVAL(F_OFD_SETLK); - TEST_FLOCK64_EINVAL(F_OFD_SETLKW); -# endif - struct_kernel_flock64 fl = { - .l_type = F_RDLCK, - .l_len = FILE_LEN - }; - long rc = invoke_test_syscall(F_SETLK64, &fl); + TAIL_ALLOC_OBJECT_CONST_PTR(struct_kernel_flock64, fl); + memset(fl, 0, sizeof(*fl)); + fl->l_type = F_RDLCK; + fl->l_len = FILE_LEN; + + long rc = invoke_test_syscall(0, F_SETLK64, fl); printf("%s(0, F_SETLK64, {l_type=F_RDLCK, l_whence=SEEK_SET" ", l_start=0, l_len=%d}) = %s\n", - TEST_SYSCALL_STR, FILE_LEN, rc ? EINVAL_STR : "0"); + TEST_SYSCALL_STR, FILE_LEN, errstr); if (rc) return; - invoke_test_syscall(F_GETLK64, &fl); + invoke_test_syscall(0, F_GETLK64, fl); printf("%s(0, F_GETLK64, {l_type=F_UNLCK, l_whence=SEEK_SET" ", l_start=0, l_len=%d, l_pid=0}) = 0\n", TEST_SYSCALL_STR, FILE_LEN); - invoke_test_syscall(F_SETLK64, &fl); - printf("%s(0, F_SETLK64, {l_type=F_UNLCK, l_whence=SEEK_SET" + invoke_test_syscall(0, F_SETLKW64, fl); + printf("%s(0, F_SETLKW64, {l_type=F_UNLCK, l_whence=SEEK_SET" ", l_start=0, l_len=%d}) = 0\n", TEST_SYSCALL_STR, FILE_LEN); } -int -main(void) -{ - create_sample(); - test_flock(); - test_flock64(); - - puts("+++ exited with 0 +++"); - return 0; -} - #else SKIP_MAIN_UNDEFINED("__NR_fcntl64") diff --git a/tests/fcntl64.gen.test b/tests/fcntl64.gen.test new file mode 100755 index 00000000..fee01b66 --- /dev/null +++ b/tests/fcntl64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fcntl64 -a8 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 diff --git a/tests/fcntl64.test b/tests/fcntl64.test deleted file mode 100755 index 00ba671a..00000000 --- a/tests/fcntl64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check fcntl64 syscall decoding. - -. "${srcdir=.}/fcntl.test" diff --git a/tests/fdatasync.c b/tests/fdatasync.c index fc82ade3..f4c8d55f 100644 --- a/tests/fdatasync.c +++ b/tests/fdatasync.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/fdatasync.gen.test b/tests/fdatasync.gen.test new file mode 100755 index 00000000..9aa5f2a6 --- /dev/null +++ b/tests/fdatasync.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fdatasync -a14 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests/fdatasync.test b/tests/fdatasync.test deleted file mode 100755 index ff59749f..00000000 --- a/tests/fdatasync.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check fdatasync syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a14 diff --git a/tests/fflush.c b/tests/fflush.c new file mode 100644 index 00000000..e14ee195 --- /dev/null +++ b/tests/fflush.c @@ -0,0 +1,22 @@ +/* + * Check fflush error diagnostics. + * + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include + +int +main(void) +{ + errno = ENOSPC; + printf("%s: /dev/full: %m\n", getenv("STRACE_EXE") ?: "strace"); + return 0; +} diff --git a/tests/fflush.test b/tests/fflush.test new file mode 100755 index 00000000..b0186497 --- /dev/null +++ b/tests/fflush.test @@ -0,0 +1,21 @@ +#!/bin/sh -efu +# +# Check fflush error diagnostics. +# +# Copyright (c) 2011-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +args="-o /dev/full -e trace=none $args" + +$STRACE $args > "$EXP" 2> "$LOG" || { + msg="$STRACE $args failed with code $?" + cat "$LOG" >&2 + fail_ "$msg" +} + +match_diff "$LOG" "$EXP" diff --git a/tests/file_handle.c b/tests/file_handle.c index a5ad6c73..38cd5af8 100644 --- a/tests/file_handle.c +++ b/tests/file_handle.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -38,7 +19,6 @@ # include # include # include -# include # include enum assert_rc { @@ -157,8 +137,8 @@ struct strval { const char *str; }; -#define STR16 "0123456789abcdef" -#define STR64 STR16 STR16 STR16 STR16 +# define STR16 "0123456789abcdef" +# define STR64 STR16 STR16 STR16 STR16 int main(void) @@ -187,7 +167,7 @@ main(void) (kernel_ulong_t) 0x12345678ffffff9cULL, }; static const struct strval open_flags[] = { - { (kernel_ulong_t) 0xffffffff00000000ULL, "O_RDONLY" }, + { F8ILL_KULONG_MASK, "O_RDONLY" }, { (kernel_ulong_t) 0xdeadbeef80000001ULL, "O_WRONLY|0x80000000" } }; @@ -208,7 +188,7 @@ main(void) tail_alloc(sizeof(struct file_handle) + 128); struct file_handle *handle_256 = tail_alloc(sizeof(struct file_handle) + 256); - int *bogus_mount_id = tail_alloc(sizeof(*bogus_mount_id)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, bogus_mount_id); char handle_0_addr[sizeof("0x") + sizeof(void *) * 2]; diff --git a/tests/file_handle.gen.test b/tests/file_handle.gen.test new file mode 100755 index 00000000..8280f9f4 --- /dev/null +++ b/tests/file_handle.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (file_handle -e trace=name_to_handle_at,open_by_handle_at); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=name_to_handle_at,open_by_handle_at diff --git a/tests/file_handle.test b/tests/file_handle.test deleted file mode 100755 index 1ccc9d45..00000000 --- a/tests/file_handle.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check name_to_handle_at and open_by_handle_at syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=name_to_handle_at,open_by_handle_at diff --git a/tests/file_ioctl.c b/tests/file_ioctl.c index 0fe17b15..7a2a905c 100644 --- a/tests/file_ioctl.c +++ b/tests/file_ioctl.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #ifdef HAVE_LINUX_FIEMAP_H @@ -13,7 +20,7 @@ static void test_fiemap(void) { (void) tail_alloc(1); - struct fiemap *const args = tail_alloc(sizeof(*args)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct fiemap, args); printf("ioctl(-1, FS_IOC_FIEMAP, {fm_start=%" PRI__u64 ", fm_length=%" PRI__u64", fm_flags=", diff --git a/tests/file_ioctl.gen.test b/tests/file_ioctl.gen.test new file mode 100755 index 00000000..0abab81a --- /dev/null +++ b/tests/file_ioctl.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (file_ioctl +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests/file_ioctl.test b/tests/file_ioctl.test deleted file mode 100755 index 7b8b8ce8..00000000 --- a/tests/file_ioctl.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check FS_IOC_FIEMAP ioctl decoding. - -. "${srcdir=.}/ioctl.test" diff --git a/tests/fill_memory.c b/tests/fill_memory.c index a0aeccba..3e09d597 100644 --- a/tests/fill_memory.c +++ b/tests/fill_memory.c @@ -1,8 +1,15 @@ +/* + * Copyright (c) 2016-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" void fill_memory_ex(void *ptr, size_t size, unsigned char start, - unsigned char period) + unsigned int period) { unsigned char *p = ptr; size_t i; diff --git a/tests/filter-unavailable.c b/tests/filter-unavailable.c index 6368b2cb..de920753 100644 --- a/tests/filter-unavailable.c +++ b/tests/filter-unavailable.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/filter-unavailable.test b/tests/filter-unavailable.test index 15a9ad1d..8e7e67ee 100755 --- a/tests/filter-unavailable.test +++ b/tests/filter-unavailable.test @@ -1,6 +1,11 @@ #!/bin/sh - -# check that syscalls are filtered properly +# +# Check that syscalls are filtered properly. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests/filtering_fd-syntax.test b/tests/filtering_fd-syntax.test new file mode 100755 index 00000000..53bf1b1c --- /dev/null +++ b/tests/filtering_fd-syntax.test @@ -0,0 +1,40 @@ +#!/bin/sh +# +# Check descriptor set parsing syntax. +# +# Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/syntax.sh" + +check_fd_qualify() +{ + check_e "invalid descriptor '$1'" -e"read=$2" + check_e "invalid descriptor '$1'" -e "read=$2" + check_e "invalid descriptor '$1'" -e"write=$2" + check_e "invalid descriptor '$1'" -e "write=$2" +} + +for arg in '' , ,, ,,, ; do + check_fd_qualify "$arg" "$arg" + check_fd_qualify "!$arg" "!$arg" +done + +for arg in -1 -42 \ + not_fd \ + 2147483648 \ + 4294967296 \ + ; do + check_fd_qualify "$arg" "$arg" + check_fd_qualify "$arg" "1,$arg" + check_fd_qualify "$arg" "$arg,1" + check_fd_qualify "$arg" "!$arg" +done + +for arg in ! all none; do + check_fd_qualify "$arg" "1,$arg" + check_fd_qualify "!$arg" "1,!$arg" +done diff --git a/tests/filtering_syscall-syntax.test b/tests/filtering_syscall-syntax.test new file mode 100755 index 00000000..fe42edbe --- /dev/null +++ b/tests/filtering_syscall-syntax.test @@ -0,0 +1,101 @@ +#!/bin/sh +# +# Check syscall set parsing syntax. +# +# Copyright (c) 2016-2018 Dmitry V. Levin +# Copyright (c) 2017 Nikolay Marchuk +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/syntax.sh" + +check_syscall() +{ + [ -z "$2" ] || check_e "invalid system call '$1'" -e"$2" + + check_e "invalid system call '$1'" -e "$2" + check_e "invalid system call '$1'" -etrace="$2" + check_e "invalid system call '$1'" -e trace="$2" + + check_e "invalid system call '$1'" -eabbrev="$2" + check_e "invalid system call '$1'" -e abbrev="$2" + + check_e "invalid system call '$1'" -everbose="$2" + check_e "invalid system call '$1'" -e verbose="$2" + + check_e "invalid system call '$1'" -eraw="$2" + check_e "invalid system call '$1'" -e raw="$2" + + check_e "invalid system call '$1'" -einject="$2" + check_e "invalid system call '$1'" -e inject="$2" + check_e "invalid system call '$1'" -einject="$2:" + check_e "invalid system call '$1'" -einject="$2::" + check_e "invalid system call '$1'" -einject="$2:::" + check_e "invalid system call '$1'" -e inject="$2:" + check_e "invalid system call '$1'" -e inject="$2::" + check_e "invalid system call '$1'" -e inject="$2:::" + check_e "invalid system call '$1'" -einject="$2:when=3" + check_e "invalid system call '$1'" -e inject="$2:when=3" + + check_e "invalid system call '$1'" -efault="$2" + check_e "invalid system call '$1'" -e fault="$2" + check_e "invalid system call '$1'" -efault="$2:" + check_e "invalid system call '$1'" -efault="$2::" + check_e "invalid system call '$1'" -efault="$2:::" + check_e "invalid system call '$1'" -e fault="$2:" + check_e "invalid system call '$1'" -e fault="$2::" + check_e "invalid system call '$1'" -e fault="$2:::" + check_e "invalid system call '$1'" -efault="$2:when=4" + check_e "invalid system call '$1'" -e fault="$2:when=4" +} + +for arg in '' , ,, ,,, ; do + check_syscall "$arg" "$arg" + check_syscall "!$arg" "!$arg" +done + +for arg in -1 -2 -3 -4 -5 \ + invalid_syscall_name \ + 0x 0y \ + 32767 \ + 2147483647 \ + 2147483648 \ + 4294967295 \ + 4294967296 \ + /non_syscall \ + % %not_a_class \ + ; do + check_syscall "$arg" "$arg" + check_syscall "$arg" "!$arg" + check_syscall "$arg" "1,$arg" +done + +for arg in '!chdir' none all; do + check_syscall "$arg" "1,$arg" +done + +# invalid syscall, multiple syscalls +for arg in %desc \ + %file \ + %memory \ + %process \ + %network \ + chdir \ + 1 \ + ?32767 \ + ?invalid \ + ?%not_a_class \ + ?/non_syscall \ + ; do + check_syscall nonsense "$arg,nonsense" + check_syscall nonsense "!$arg,nonsense" + check_syscall nonsense "nonsense,$arg" + check_syscall nonsense "!nonsense,$arg" +done + +check_e_using_grep 'regcomp: \+id: [[:alpha:]].+' -e trace='/+id' +check_e_using_grep 'regcomp: \*id: [[:alpha:]].+' -e trace='/*id' +check_e_using_grep 'regcomp: \{id: [[:alpha:]].+' -e trace='/{id' +check_e_using_grep 'regcomp: \(id: [[:alpha:]].+' -e trace='/(id' +check_e_using_grep 'regcomp: \[id: [[:alpha:]].+' -e trace='/[id' diff --git a/tests/finit_module.c b/tests/finit_module.c index 3f0178f7..64e6df02 100644 --- a/tests/finit_module.c +++ b/tests/finit_module.c @@ -2,29 +2,10 @@ * Check decoding of finit_module syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -68,7 +49,8 @@ main(void) fill_memory_ex(bogus_param1, PARAM1_LEN, PARAM1_BASE, PARAM1_LEN); fill_memory_ex(bogus_param2, PARAM2_LEN, PARAM2_BASE, PARAM2_LEN); - rc = syscall(__NR_finit_module, bogus_zero, NULL, bogus_zero); + rc = syscall(__NR_finit_module, F8ILL_KULONG_MASK, NULL, + F8ILL_KULONG_MASK); printf("finit_module(0, NULL, 0) = %s\n", sprintrc(rc)); rc = syscall(__NR_finit_module, bogus_fd, bogus_param1, flags[0].val); diff --git a/tests/finit_module.gen.test b/tests/finit_module.gen.test new file mode 100755 index 00000000..5ffafd32 --- /dev/null +++ b/tests/finit_module.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (finit_module -a25 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests/finit_module.test b/tests/finit_module.test deleted file mode 100755 index bd644f38..00000000 --- a/tests/finit_module.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of finit_module syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a25 diff --git a/tests/first_exec_failure.test b/tests/first_exec_failure.test new file mode 100755 index 00000000..175b084b --- /dev/null +++ b/tests/first_exec_failure.test @@ -0,0 +1,30 @@ +#!/bin/sh +# +# Check error diagnostics when the first exec fails. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +$STRACE / 2> "$LOG" && + dump_log_and_fail_with \ + "$STRACE / failed to handle the error properly" + +check_prog head +check_prog tail + +head -n1 < "$LOG" > "$OUT" +cat > "$EXP" <<__EOF__ +execve\("/", \["/"\], 0x[[:xdigit:]]+ /\* [[:digit:]]+ vars \*/\) += -1 EACCES \(Permission denied\) +__EOF__ +match_grep "$OUT" "$EXP" + +tail -n +2 < "$LOG" > "$OUT" +cat > "$EXP" <<__EOF__ +$STRACE_EXE: exec: Permission denied ++++ exited with 1 +++ +__EOF__ +match_diff "$OUT" "$EXP" diff --git a/tests/flock.c b/tests/flock.c index c154e437..4f044409 100644 --- a/tests/flock.c +++ b/tests/flock.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/flock.gen.test b/tests/flock.gen.test new file mode 100755 index 00000000..67a9d8c6 --- /dev/null +++ b/tests/flock.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (flock -a19 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests/flock.test b/tests/flock.test deleted file mode 100755 index 24fcd74c..00000000 --- a/tests/flock.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check flock syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a19 diff --git a/tests/fork-f.c b/tests/fork-f.c index 11ac3d97..0e71c500 100644 --- a/tests/fork-f.c +++ b/tests/fork-f.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/fork-f.gen.test b/tests/fork-f.gen.test new file mode 100755 index 00000000..b534e13a --- /dev/null +++ b/tests/fork-f.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fork-f -a26 -qq -f -e signal=none -e trace=chdir); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a26 -qq -f -e signal=none -e trace=chdir diff --git a/tests/fork-f.test b/tests/fork-f.test deleted file mode 100755 index d8ca1e3b..00000000 --- a/tests/fork-f.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check how strace -f follows fork syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a26 -qq -f -e trace=chdir -e signal=none diff --git a/tests/fstat-Xabbrev.c b/tests/fstat-Xabbrev.c new file mode 100644 index 00000000..3fb61e09 --- /dev/null +++ b/tests/fstat-Xabbrev.c @@ -0,0 +1 @@ +#include "fstat.c" diff --git a/tests/fstat-Xabbrev.gen.test b/tests/fstat-Xabbrev.gen.test new file mode 100755 index 00000000..827d5940 --- /dev/null +++ b/tests/fstat-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat-Xabbrev -a15 -v -Xabbrev -P stat.sample -e trace=fstat); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 -v -Xabbrev -P stat.sample -e trace=fstat diff --git a/tests/fstat-Xraw.c b/tests/fstat-Xraw.c new file mode 100644 index 00000000..04284612 --- /dev/null +++ b/tests/fstat-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "fstat.c" diff --git a/tests/fstat-Xraw.gen.test b/tests/fstat-Xraw.gen.test new file mode 100755 index 00000000..99fdc908 --- /dev/null +++ b/tests/fstat-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat-Xraw -a15 -v -Xraw -P stat.sample -e trace=fstat); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 -v -Xraw -P stat.sample -e trace=fstat diff --git a/tests/fstat-Xverbose.c b/tests/fstat-Xverbose.c new file mode 100644 index 00000000..e2b20427 --- /dev/null +++ b/tests/fstat-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "fstat.c" diff --git a/tests/fstat-Xverbose.gen.test b/tests/fstat-Xverbose.gen.test new file mode 100755 index 00000000..9a7ef89f --- /dev/null +++ b/tests/fstat-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat-Xverbose -a15 -v -Xverbose -P stat.sample -e trace=fstat); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 -v -Xverbose -P stat.sample -e trace=fstat diff --git a/tests/fstat.c b/tests/fstat.c index 12df3e19..7a52e0cc 100644 --- a/tests/fstat.c +++ b/tests/fstat.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/fstat.gen.test b/tests/fstat.gen.test new file mode 100755 index 00000000..8686ec80 --- /dev/null +++ b/tests/fstat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat -a15 -v -P stat.sample); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 -v -P stat.sample diff --git a/tests/fstat.test b/tests/fstat.test deleted file mode 100755 index 2ba0fbaa..00000000 --- a/tests/fstat.test +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -# Check fstat syscall decoding. - -. "${srcdir=.}/init.sh" - -# strace -P is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - -syscall=$NAME -run_prog > /dev/null -sample=$syscall.sample -> "$sample" -run_strace -ve$syscall -P$sample -a21 $args > "$OUT" -match_diff "$LOG" "$OUT" -rm -f "$OUT" - -exit 0 diff --git a/tests/fstat64-Xabbrev.c b/tests/fstat64-Xabbrev.c new file mode 100644 index 00000000..dc44b3d9 --- /dev/null +++ b/tests/fstat64-Xabbrev.c @@ -0,0 +1 @@ +#include "fstat64.c" diff --git a/tests/fstat64-Xabbrev.gen.test b/tests/fstat64-Xabbrev.gen.test new file mode 100755 index 00000000..21b601f8 --- /dev/null +++ b/tests/fstat64-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat64-Xabbrev -a17 -Xabbrev -v -P stat.sample -e trace=fstat64); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 -Xabbrev -v -P stat.sample -e trace=fstat64 diff --git a/tests/fstat64-Xraw.c b/tests/fstat64-Xraw.c new file mode 100644 index 00000000..f8930d72 --- /dev/null +++ b/tests/fstat64-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "fstat64.c" diff --git a/tests/fstat64-Xraw.gen.test b/tests/fstat64-Xraw.gen.test new file mode 100755 index 00000000..a31dd848 --- /dev/null +++ b/tests/fstat64-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat64-Xraw -a17 -Xraw -v -P stat.sample -e trace=fstat64); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 -Xraw -v -P stat.sample -e trace=fstat64 diff --git a/tests/fstat64-Xverbose.c b/tests/fstat64-Xverbose.c new file mode 100644 index 00000000..61e33aef --- /dev/null +++ b/tests/fstat64-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "fstat64.c" diff --git a/tests/fstat64-Xverbose.gen.test b/tests/fstat64-Xverbose.gen.test new file mode 100755 index 00000000..8b789e49 --- /dev/null +++ b/tests/fstat64-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat64-Xverbose -a17 -Xverbose -v -P stat.sample -e trace=fstat64); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 -Xverbose -v -P stat.sample -e trace=fstat64 diff --git a/tests/fstat64.c b/tests/fstat64.c index a9c2e072..5d30ca41 100644 --- a/tests/fstat64.c +++ b/tests/fstat64.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/fstat64.gen.test b/tests/fstat64.gen.test new file mode 100755 index 00000000..a452b845 --- /dev/null +++ b/tests/fstat64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstat64 -a17 -v -P stat.sample); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 -v -P stat.sample diff --git a/tests/fstat64.test b/tests/fstat64.test deleted file mode 100755 index 8b4f5ef1..00000000 --- a/tests/fstat64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check fstat64 syscall decoding. - -. "${srcdir=.}/fstat.test" diff --git a/tests/fstatat.c b/tests/fstatat.c index 66138c25..fde507c3 100644 --- a/tests/fstatat.c +++ b/tests/fstatat.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifdef HAVE_FSTATAT diff --git a/tests/fstatat64.c b/tests/fstatat64.c index 03082a8f..949463c9 100644 --- a/tests/fstatat64.c +++ b/tests/fstatat64.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/fstatat64.gen.test b/tests/fstatat64.gen.test new file mode 100755 index 00000000..8da5c7f2 --- /dev/null +++ b/tests/fstatat64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstatat64 -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests/fstatat64.test b/tests/fstatat64.test deleted file mode 100755 index 484008ac..00000000 --- a/tests/fstatat64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check fstatat64 syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests/fstatfs.c b/tests/fstatfs.c index 9e68c8d3..f1609405 100644 --- a/tests/fstatfs.c +++ b/tests/fstatfs.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/fstatfs.gen.test b/tests/fstatfs.gen.test new file mode 100755 index 00000000..27deaf34 --- /dev/null +++ b/tests/fstatfs.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstatfs -a18 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests/fstatfs.test b/tests/fstatfs.test deleted file mode 100755 index 646e66f2..00000000 --- a/tests/fstatfs.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check fstatfs syscall decoding. - -. "${srcdir=.}/statfs.test" diff --git a/tests/fstatfs64.c b/tests/fstatfs64.c index afc54aa9..14da042a 100644 --- a/tests/fstatfs64.c +++ b/tests/fstatfs64.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/fstatfs64.gen.test b/tests/fstatfs64.gen.test new file mode 100755 index 00000000..d6937269 --- /dev/null +++ b/tests/fstatfs64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fstatfs64 -a24 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests/fstatfs64.test b/tests/fstatfs64.test deleted file mode 100755 index 179ff1bf..00000000 --- a/tests/fstatfs64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check fstatfs64 syscall decoding. - -. "${srcdir=.}/statfs.test" diff --git a/tests/fstatx.c b/tests/fstatx.c index f88d9a9c..275fe65a 100644 --- a/tests/fstatx.c +++ b/tests/fstatx.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #define IS_FSTAT 1 diff --git a/tests/fsync-y.c b/tests/fsync-y.c new file mode 100644 index 00000000..f42f8345 --- /dev/null +++ b/tests/fsync-y.c @@ -0,0 +1,51 @@ +/* + * Check printing of file name in strace -y mode. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include + +int +main(void) +{ + char dir[PATH_MAX + 1]; + + const struct { + const char *path; + const char *cstr; + const char *fdstr; + } checks[] = { + { ARG_STR("\1\0020\v\0047\f\58\t\79\n\10\0171\r\0167\218\37 \\\'\"<<0::0>>1~\177\200\377"), + "\\1\\0020\\v\\0047\\f\\58\\t\\79\\n\\10\\0171\\r\\0167" + "\\218\\37 \\\\\'\\\"\\74\\0740::0\\76\\0761~\\177\\200\\377" }, + }; + + if (!getcwd(dir, sizeof(dir))) + perror_msg_and_fail("getcwd"); + + for (unsigned int i = 0; i < ARRAY_SIZE(checks); i++) { + long fd = open(checks[i].path, O_RDONLY|O_CREAT, 0600); + if (fd < 0) + perror_msg_and_fail("open(%s)", checks[i].cstr); + + int rc = fsync(fd); + + printf("fsync(%ld<", fd); + print_quoted_string_ex(dir, false, ">:"); + printf("/%s>) = %s\n", checks[i].fdstr, sprintrc(rc)); + + close(fd); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/fsync-y.gen.test b/tests/fsync-y.gen.test new file mode 100755 index 00000000..055a580f --- /dev/null +++ b/tests/fsync-y.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fsync-y -y -e trace=fsync); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -y -e trace=fsync diff --git a/tests/fsync.c b/tests/fsync.c index 2f504106..5624096b 100644 --- a/tests/fsync.c +++ b/tests/fsync.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/fsync.gen.test b/tests/fsync.gen.test new file mode 100755 index 00000000..5e72cc25 --- /dev/null +++ b/tests/fsync.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (fsync -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests/fsync.test b/tests/fsync.test deleted file mode 100755 index a58b67be..00000000 --- a/tests/fsync.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check fsync syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 diff --git a/tests/ftruncate.c b/tests/ftruncate.c index ee17455f..6c77d4b1 100644 --- a/tests/ftruncate.c +++ b/tests/ftruncate.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/ftruncate.gen.test b/tests/ftruncate.gen.test new file mode 100755 index 00000000..6e5926b2 --- /dev/null +++ b/tests/ftruncate.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ftruncate -a24 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests/ftruncate.test b/tests/ftruncate.test deleted file mode 100755 index ec8a1e05..00000000 --- a/tests/ftruncate.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check ftruncate syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 diff --git a/tests/ftruncate64.c b/tests/ftruncate64.c index 90d9938f..b7e350b4 100644 --- a/tests/ftruncate64.c +++ b/tests/ftruncate64.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/ftruncate64.gen.test b/tests/ftruncate64.gen.test new file mode 100755 index 00000000..d910f617 --- /dev/null +++ b/tests/ftruncate64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ftruncate64 -a36 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests/ftruncate64.test b/tests/ftruncate64.test deleted file mode 100755 index 90682102..00000000 --- a/tests/ftruncate64.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check ftruncate64 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a36 diff --git a/tests/futex.c b/tests/futex.c index 586b95d5..47191f27 100644 --- a/tests/futex.c +++ b/tests/futex.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -33,7 +14,6 @@ # include # include -# include # include # include # include @@ -55,18 +35,18 @@ # include "xlat/futexwakeops.h" # include "xlat/futexwakecmps.h" -static struct timespec *tmout; - void futex_error(int *uaddr, int op, unsigned long val, unsigned long timeout, - int *uaddr2, unsigned long val3, int rc) + int *uaddr2, unsigned long val3, int rc, const char *func, int line) { - perror_msg_and_fail("futex(%p, %#x, %#x, %#lx, %p, %#x) = %d", - uaddr, op, (unsigned) val, timeout, uaddr, (unsigned) val3, rc); + perror_msg_and_fail("%s:%d: futex(%p, %#x, %#x, %#lx, %p, %#x) = %d", + func, line, uaddr, op, (unsigned) val, timeout, uaddr, + (unsigned) val3, rc); } # define CHECK_FUTEX_GENERIC(uaddr, op, val, timeout, uaddr2, val3, check, \ enosys) \ do { \ + errno = 0; \ rc = syscall(__NR_futex, (uaddr), (op), (val), (timeout), \ (uaddr2), (val3)); \ /* It is here due to EPERM on WAKE_OP on AArch64 */ \ @@ -77,7 +57,7 @@ void futex_error(int *uaddr, int op, unsigned long val, unsigned long timeout, if (!(check)) \ futex_error((uaddr), (op), (val), \ (unsigned long) (timeout), (int *) (uaddr2), \ - (val3), rc); \ + (val3), rc, __func__, __LINE__); \ } while (0) # define CHECK_FUTEX_ENOSYS(uaddr, op, val, timeout, uaddr2, val3, check) \ @@ -151,20 +131,29 @@ void invalid_op(int *val, int op, uint32_t argmask, ...) } while (0) /* Value which differs from one stored in int *val */ -# define VAL ((unsigned long) 0xbadda7a0facefeedLLU) -# define VAL_PR ((unsigned) VAL) +# define VAL ((unsigned long) 0xbadda7a0facefeedLLU) +# define VAL_PR ((unsigned) VAL) + +# define VALP ((unsigned long) 0xbadda7a01acefeedLLU) +# define VALP_PR ((unsigned) VALP) -# define VAL2 ((unsigned long) 0xbadda7a0ca7b100dLLU) -# define VAL2_PR ((unsigned) VAL2) +# define VAL2 ((unsigned long) 0xbadda7a0ca7b100dLLU) +# define VAL2_PR ((unsigned) VAL2) -# define VAL3 ((unsigned long) 0xbadda7a09caffee1LLU) -# define VAL3_PR ((unsigned) VAL3) +# define VAL2P ((unsigned long) 0xbadda7a07a7b100dLLU) +# define VAL2P_PR ((unsigned) VAL2P) + +# define VAL3 ((unsigned long) 0xbadda7a09caffee1LLU) +# define VAL3_PR ((unsigned) VAL3) + +# define VAL3A ((unsigned long) 0xbadda7a0ffffffffLLU) +# define VAL3A_PR "FUTEX_BITSET_MATCH_ANY" int main(int argc, char *argv[]) { - int *uaddr = tail_alloc(sizeof(*uaddr)); - int *uaddr2 = tail_alloc(sizeof(*uaddr2)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, uaddr); + TAIL_ALLOC_OBJECT_CONST_PTR(int, uaddr2); int rc; unsigned i; unsigned j; @@ -172,7 +161,7 @@ main(int argc, char *argv[]) uaddr[0] = 0x1deadead; uaddr2[0] = 0xbadf00d; - tmout = tail_alloc(sizeof(*tmout)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, tmout); tmout->tv_sec = 123; tmout->tv_nsec = 0xbadc0de; @@ -189,37 +178,59 @@ main(int argc, char *argv[]) /* uaddr is NULL */ CHECK_FUTEX(NULL, FUTEX_WAIT, VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EFAULT)); - printf("futex(NULL, FUTEX_WAIT, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", - VAL_PR, (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, - sprintrc(rc)); + printf("futex(NULL, FUTEX_WAIT, %u, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); /* uaddr is faulty */ CHECK_FUTEX(uaddr + 1, FUTEX_WAIT, VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EFAULT)); - printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", - uaddr + 1, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + uaddr + 1, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); /* timeout is faulty */ CHECK_FUTEX(uaddr, FUTEX_WAIT, VAL, tmout + 1, uaddr2, VAL3, (rc == -1) && (errno == EFAULT)); printf("futex(%p, FUTEX_WAIT, %u, %p) = %s\n", - uaddr, 0xfacefeed, tmout + 1, sprintrc(rc)); + uaddr, 0xfacefeed, tmout + 1, sprintrc(rc)); + + /* timeout is invalid */ + tmout->tv_sec = 0xdeadbeefU; + tmout->tv_nsec = 0xfacefeedU; + + CHECK_FUTEX(uaddr, FUTEX_WAIT, VAL, tmout, uaddr2, VAL3, + (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); + + tmout->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + tmout->tv_nsec = (long) 0xbadc0dedfacefeedLL; + + CHECK_FUTEX(uaddr, FUTEX_WAIT, VAL, tmout, uaddr2, VAL3, + (rc == -1) && (errno == EINVAL)); + printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); + + tmout->tv_sec = 123; + tmout->tv_nsec = 0xbadc0de; /* uaddr is not as provided; uaddr2 is faulty but ignored */ CHECK_FUTEX(uaddr, FUTEX_WAIT, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", - uaddr, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT, %u, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); /* uaddr is not as provided; uaddr2 is faulty but ignored */ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAIT, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_PRIVATE, %u, {tv_sec=%jd, tv_nsec=%jd}) = " - "%s\n", - uaddr, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_PRIVATE, %u, {tv_sec=%lld, tv_nsec=%llu})" + " = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); /* Next 2 tests are with CLOCKRT bit set */ @@ -227,18 +238,18 @@ main(int argc, char *argv[]) CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_WAIT, VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT|FUTEX_CLOCK_REALTIME, %u, " - "{tv_sec=%jd, tv_nsec=%jd}) = %s\n", uaddr, VAL_PR, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, - sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT|FUTEX_CLOCK_REALTIME, %u" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); CHECK_FUTEX_ENOSYS(uaddr, - FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | FUTEX_WAIT , + FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | FUTEX_WAIT, VAL, tmout, uaddr2, 0, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_PRIVATE|FUTEX_CLOCK_REALTIME, %u, " - "{tv_sec=%jd, tv_nsec=%jd}) = %s\n", uaddr, VAL_PR, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, - sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_PRIVATE|FUTEX_CLOCK_REALTIME, %u" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); /* FUTEX_WAIT_BITSET - FUTEX_WAIT which provides additional bitmask * which should be matched at least in one bit with @@ -254,50 +265,62 @@ main(int argc, char *argv[]) CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_BITSET, %u, {tv_sec=%jd, tv_nsec=%jd}, " - "%#x) = %s\n", - uaddr, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, VAL3_PR, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_BITSET, %u, {tv_sec=%lld, tv_nsec=%llu}" + ", %#x) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), VAL3_PR, + sprintrc(rc)); + + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, + VAL3A, (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_WAIT_BITSET, %u, {tv_sec=%lld, tv_nsec=%llu}" + ", %s) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), VAL3A_PR, + sprintrc(rc)); /* val3 of 0 is invalid */ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, 0, (rc == -1) && (errno == EINVAL)); - printf("futex(%p, FUTEX_WAIT_BITSET, %u, {tv_sec=%jd, tv_nsec=%jd}, " - "%#x) = %s\n", - uaddr, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, 0, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_BITSET, %u, {tv_sec=%lld, tv_nsec=%llu}" + ", %#x) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), 0, sprintrc(rc)); CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_BITSET_PRIVATE, %u, " - "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", - uaddr, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, VAL3_PR, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_BITSET_PRIVATE, %u" + ", {tv_sec=%lld, tv_nsec=%llu}, %#x) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), VAL3_PR, + sprintrc(rc)); /* Next 3 tests are with CLOCKRT bit set */ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, %u, " - "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", uaddr, VAL_PR, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, VAL3_PR, - sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, %u" + ", {tv_sec=%lld, tv_nsec=%llu}, %#x) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), VAL3_PR, + sprintrc(rc)); /* val3 of 0 is invalid */ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, 0, (rc == -1) && (errno == EINVAL)); - printf("futex(%p, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, %u, " - "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", uaddr, VAL_PR, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, 0, - sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_BITSET|FUTEX_CLOCK_REALTIME, %u" + ", {tv_sec=%lld, tv_nsec=%llu}, %#x) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), 0, sprintrc(rc)); CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | FUTEX_WAIT_BITSET, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, %u, " - "{tv_sec=%jd, tv_nsec=%jd}, %#x) = %s\n", uaddr, VAL_PR, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, VAL3_PR, - sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, %u" + ", {tv_sec=%lld, tv_nsec=%llu}, %#x) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), VAL3_PR, + sprintrc(rc)); /* FUTEX_WAKE - wake val processes waiting for uaddr * Possible flags: PRIVATE @@ -343,6 +366,11 @@ main(int argc, char *argv[]) printf("futex(%p, FUTEX_WAKE_BITSET, %u, %#x) = %s\n", uaddr, 10, VAL3_PR, sprintrc(rc)); + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAKE_BITSET, 10, NULL, NULL, + VAL3A, (rc == 0)); + printf("futex(%p, FUTEX_WAKE_BITSET, %u, %s) = %s\n", uaddr, 10, + VAL3A_PR, sprintrc(rc)); + /* bitset 0 is invalid */ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAKE_BITSET, 10, NULL, NULL, 0, (rc == -1) && (errno == EINVAL)); @@ -392,16 +420,26 @@ main(int argc, char *argv[]) /* Trying to re-queue some processes but there's nothing to re-queue */ CHECK_FUTEX(uaddr, FUTEX_REQUEUE, VAL, VAL2, uaddr2, VAL3, - (rc == 0)); + (rc == 0) || ((rc == -1) && (errno == EINVAL))); printf("futex(%p, FUTEX_REQUEUE, %u, %u, %p) = %s\n", uaddr, VAL_PR, VAL2_PR, uaddr2, sprintrc(rc)); + CHECK_FUTEX(uaddr, FUTEX_REQUEUE, VALP, VAL2P, uaddr2, VAL3, + (rc == 0)); + printf("futex(%p, FUTEX_REQUEUE, %u, %u, %p) = %s\n", + uaddr, VALP_PR, VAL2P_PR, uaddr2, sprintrc(rc)); + /* Trying to re-queue some processes but there's nothing to re-queue */ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_REQUEUE, VAL, VAL2, - uaddr2, VAL3, (rc == 0)); + uaddr2, VAL3, (rc == 0) || ((rc == -1) && (errno == EINVAL))); printf("futex(%p, FUTEX_REQUEUE_PRIVATE, %u, %u, %p) = %s\n", uaddr, VAL_PR, VAL2_PR, uaddr2, sprintrc(rc)); + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_REQUEUE, VALP, + VAL2P, uaddr2, VAL3, (rc == 0)); + printf("futex(%p, FUTEX_REQUEUE_PRIVATE, %u, %u, %p) = %s\n", + uaddr, VALP_PR, VAL2P_PR, uaddr2, sprintrc(rc)); + CHECK_INVALID_CLOCKRT(FUTEX_REQUEUE, ARG3 | ARG4 | ARG5, "%u", "%u", "%#lx"); @@ -418,22 +456,38 @@ main(int argc, char *argv[]) /* Comparison re-queue with wrong val value */ CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VAL, VAL2, uaddr2, VAL3, - (rc == -1) && (errno == EAGAIN)); + (rc == -1) && (errno == EAGAIN || errno == EINVAL)); printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n", uaddr, VAL_PR, VAL2_PR, uaddr2, VAL3_PR, sprintrc(rc)); + CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VALP, VAL2P, uaddr2, VAL3, + (rc == -1) && (errno == EAGAIN)); + printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n", + uaddr, VALP_PR, VAL2P_PR, uaddr2, VAL3_PR, sprintrc(rc)); + /* Successful comparison re-queue */ CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VAL, VAL2, uaddr2, *uaddr, - (rc == 0)); + (rc == 0) || ((rc == -1) && (errno == EINVAL))); printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n", uaddr, VAL_PR, VAL2_PR, uaddr2, *uaddr, sprintrc(rc)); + CHECK_FUTEX(uaddr, FUTEX_CMP_REQUEUE, VALP, VAL2P, uaddr2, *uaddr, + (rc == 0)); + printf("futex(%p, FUTEX_CMP_REQUEUE, %u, %u, %p, %u) = %s\n", + uaddr, VALP_PR, VAL2P_PR, uaddr2, *uaddr, sprintrc(rc)); + /* Successful comparison re-queue */ CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_CMP_REQUEUE, VAL, - VAL2, uaddr2, *uaddr, (rc == 0)); + VAL2, uaddr2, *uaddr, + (rc == 0) || ((rc == -1) && (errno == EINVAL))); printf("futex(%p, FUTEX_CMP_REQUEUE_PRIVATE, %u, %u, %p, %u) = %s\n", uaddr, VAL_PR, VAL2_PR, uaddr2, *uaddr, sprintrc(rc)); + CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_CMP_REQUEUE, VALP, + VAL2P, uaddr2, *uaddr, (rc == 0)); + printf("futex(%p, FUTEX_CMP_REQUEUE_PRIVATE, %u, %u, %p, %u) = %s\n", + uaddr, VALP_PR, VAL2P_PR, uaddr2, *uaddr, sprintrc(rc)); + CHECK_INVALID_CLOCKRT(FUTEX_CMP_REQUEUE, ARG3 | ARG4 | ARG5 | ARG6, "%u", "%u", "%#lx", "%u"); @@ -471,8 +525,16 @@ main(int argc, char *argv[]) static const struct { uint32_t val; const char *str; + + /* + * Peculiar semantics: + * * err == 0 and err2 != 0 => expect both either the absence + * of error or presence of err2 + * * err != 0 and err2 == 0 => expect err only, no success + * expected. + */ int err; - const char *errstr; + int err2; } wake_ops[] = { { 0x00000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, { 0x00fff000, "FUTEX_OP_SET<<28|0xfff<<12|FUTEX_OP_CMP_EQ<<24|" @@ -486,13 +548,13 @@ main(int argc, char *argv[]) { 0x30000000, "FUTEX_OP_ANDN<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, { 0x40000000, "FUTEX_OP_XOR<<28|0<<12|FUTEX_OP_CMP_EQ<<24|0" }, { 0x50000000, "0x5<<28 /* FUTEX_OP_??? */|0<<12|" - "FUTEX_OP_CMP_EQ<<24|0", ENOSYS, "ENOSYS" }, + "FUTEX_OP_CMP_EQ<<24|0", ENOSYS }, { 0x70000000, "0x7<<28 /* FUTEX_OP_??? */|0<<12|" - "FUTEX_OP_CMP_EQ<<24|0", ENOSYS, "ENOSYS" }, + "FUTEX_OP_CMP_EQ<<24|0", ENOSYS }, { 0x80000000, "FUTEX_OP_OPARG_SHIFT<<28|FUTEX_OP_SET<<28|0<<12|" "FUTEX_OP_CMP_EQ<<24|0" }, { 0xa0caffee, "FUTEX_OP_OPARG_SHIFT<<28|FUTEX_OP_OR<<28|" - "0xcaf<<12|FUTEX_OP_CMP_EQ<<24|0xfee" }, + "0xcaf<<12|FUTEX_OP_CMP_EQ<<24|0xfee", 0, EINVAL }, { 0x01000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_NE<<24|0" }, { 0x01234567, "FUTEX_OP_SET<<28|0x234<<12|FUTEX_OP_CMP_NE<<24|" "0x567" }, @@ -501,30 +563,41 @@ main(int argc, char *argv[]) { 0x04000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_GT<<24|0" }, { 0x05000000, "FUTEX_OP_SET<<28|0<<12|FUTEX_OP_CMP_GE<<24|0" }, { 0x06000000, "FUTEX_OP_SET<<28|0<<12|" - "0x6<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + "0x6<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS }, { 0x07000000, "FUTEX_OP_SET<<28|0<<12|" - "0x7<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + "0x7<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS }, { 0x08000000, "FUTEX_OP_SET<<28|0<<12|" - "0x8<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + "0x8<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS }, { 0x0f000000, "FUTEX_OP_SET<<28|0<<12|" - "0xf<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS, "ENOSYS" }, + "0xf<<24 /* FUTEX_OP_CMP_??? */|0", ENOSYS }, { 0xbadfaced, "FUTEX_OP_OPARG_SHIFT<<28|FUTEX_OP_ANDN<<28|" "0xdfa<<12|0xa<<24 /* FUTEX_OP_CMP_??? */|0xced", - ENOSYS, "ENOSYS" }, + ENOSYS, EINVAL }, { 0xffffffff, "FUTEX_OP_OPARG_SHIFT<<28|" "0x7<<28 /* FUTEX_OP_??? */|0xfff<<12|" "0xf<<24 /* FUTEX_OP_CMP_??? */|0xfff", - ENOSYS, "ENOSYS" }, + ENOSYS, EINVAL }, }; for (i = 0; i < ARRAY_SIZE(wake_ops); i++) { for (j = 0; j < 2; j++) { CHECK_FUTEX_ENOSYS(uaddr, j ? FUTEX_WAKE_OP_PRIVATE : FUTEX_WAKE_OP, - VAL, i, uaddr2, wake_ops[i].val, (rc == 0)); - printf("futex(%p, FUTEX_WAKE_OP%s, %u, %u, %p, %s) = " - "%s\n", uaddr, j ? "_PRIVATE" : "", VAL_PR, i, - uaddr2, wake_ops[i].str, sprintrc(rc)); + VAL, i, uaddr2, wake_ops[i].val, + /* + * Either one of errs is 0 or rc == 0 is not + * allowed. + */ + ((!wake_ops[i].err || !wake_ops[i].err2 || + (rc != 0)) && + ((!wake_ops[i].err && (rc == 0)) || + (wake_ops[i].err && (rc == -1) && + (errno == wake_ops[i].err)) || + (wake_ops[i].err2 && (rc == -1) && + (errno == wake_ops[i].err2))))); + printf("futex(%p, FUTEX_WAKE_OP%s, %u, %u, %p, %s)" + " = %s\n", uaddr, j ? "_PRIVATE" : "", VAL_PR, + i, uaddr2, wake_ops[i].str, sprintrc(rc)); } } @@ -552,16 +625,16 @@ main(int argc, char *argv[]) CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_LOCK_PI, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EFAULT)); - printf("futex(%p, FUTEX_LOCK_PI, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", - uaddr + 1, (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, - sprintrc(rc)); + printf("futex(%p, FUTEX_LOCK_PI, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + uaddr + 1, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_PRIVATE_FLAG | FUTEX_LOCK_PI, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EFAULT)); - printf("futex(%p, FUTEX_LOCK_PI_PRIVATE, {tv_sec=%jd, tv_nsec=%jd}) = " - "%s\n", - uaddr + 1, (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, - sprintrc(rc)); + printf("futex(%p, FUTEX_LOCK_PI_PRIVATE, {tv_sec=%lld, tv_nsec=%llu})" + " = %s\n", + uaddr + 1, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); /* NULL is passed by invalid_op() in cases valid timeout address is * needed */ @@ -587,7 +660,7 @@ main(int argc, char *argv[]) CHECK_FUTEX_ENOSYS(uaddr + 1, FUTEX_PRIVATE_FLAG | FUTEX_UNLOCK_PI, VAL, tmout, uaddr2 + 1, VAL3, (rc == -1) && (errno == EFAULT)); - printf("futex(%p, FUTEX_UNLOCK_PI_PRIVATE) = %s\n", uaddr +1, + printf("futex(%p, FUTEX_UNLOCK_PI_PRIVATE) = %s\n", uaddr + 1, sprintrc(rc)); CHECK_INVALID_CLOCKRT(FUTEX_UNLOCK_PI, 0); @@ -633,32 +706,32 @@ main(int argc, char *argv[]) CHECK_FUTEX_ENOSYS(uaddr, FUTEX_WAIT_REQUEUE_PI, VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_REQUEUE_PI, %u, " - "{tv_sec=%jd, tv_nsec=%jd}, %p) = %s\n", - uaddr, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, uaddr2, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI, %u" + ", {tv_sec=%lld, tv_nsec=%llu}, %p) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), uaddr2, sprintrc(rc)); CHECK_FUTEX_ENOSYS(uaddr, FUTEX_PRIVATE_FLAG | FUTEX_WAIT_REQUEUE_PI, VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_REQUEUE_PI_PRIVATE, %u, " - "{tv_sec=%jd, tv_nsec=%jd}, %p) " - "= %s\n", uaddr, VAL_PR, (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, uaddr2, sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI_PRIVATE, %u" + ", {tv_sec=%lld, tv_nsec=%llu}, %p) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), uaddr2, sprintrc(rc)); CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_WAIT_REQUEUE_PI, VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_REQUEUE_PI|FUTEX_CLOCK_REALTIME, %u, " - "{tv_sec=%jd, tv_nsec=%jd}, %p) = %s\n", uaddr, VAL_PR, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, uaddr2, - sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI|FUTEX_CLOCK_REALTIME, %u" + ", {tv_sec=%lld, tv_nsec=%llu}, %p) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), uaddr2, sprintrc(rc)); CHECK_FUTEX_ENOSYS(uaddr, FUTEX_CLOCK_REALTIME | FUTEX_PRIVATE_FLAG | FUTEX_WAIT_REQUEUE_PI, VAL, tmout, uaddr2, VAL3, (rc == -1) && (errno == EAGAIN)); - printf("futex(%p, FUTEX_WAIT_REQUEUE_PI_PRIVATE|FUTEX_CLOCK_REALTIME, " - "%u, {tv_sec=%jd, tv_nsec=%jd}, %p) = %s\n", uaddr, VAL_PR, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, uaddr2, - sprintrc(rc)); + printf("futex(%p, FUTEX_WAIT_REQUEUE_PI_PRIVATE|FUTEX_CLOCK_REALTIME" + ", %u, {tv_sec=%lld, tv_nsec=%llu}, %p) = %s\n", + uaddr, VAL_PR, (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), uaddr2, sprintrc(rc)); /* FUTEX_CMP_REQUEUE_PI - version of FUTEX_CMP_REQUEUE which re-queues * on PI-aware futex. diff --git a/tests/futex.test b/tests/futex.test index fc98267a..889eec61 100755 --- a/tests/futex.test +++ b/tests/futex.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check futex syscall decoding. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests/futimesat.c b/tests/futimesat.c index c3566291..8024f87b 100644 --- a/tests/futimesat.c +++ b/tests/futimesat.c @@ -1,30 +1,10 @@ /* * Check decoding of futimesat syscall. * - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -37,46 +17,123 @@ # include # include - -int -main(void) +static void +print_tv(const struct timeval *tv) { - struct timeval tv; - if (gettimeofday(&tv, NULL)) - perror_msg_and_fail("gettimeofday"); - - static const char sample[] = "futimesat_sample"; - unsigned long dirfd = (unsigned long) 0xdeadbeef00000000ULL | -100U; - - long rc = syscall(__NR_futimesat, dirfd, sample, 0); - printf("futimesat(AT_FDCWD, \"%s\", NULL) = %ld %s (%m)\n", - sample, rc, errno2name()); + printf("{tv_sec=%lld, tv_usec=%llu}", + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); + print_time_t_usec(tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec), 1); +} - struct timeval *const ts = tail_alloc(sizeof(*ts) * 2); - dirfd = (unsigned long) 0xdeadbeefffffffffULL; +static const char *errstr; - ts[0].tv_sec = tv.tv_sec; - ts[0].tv_usec = tv.tv_usec; - ts[1].tv_sec = tv.tv_sec - 1; - ts[1].tv_usec = tv.tv_usec + 1; +static long +k_futimesat(const kernel_ulong_t dirfd, + const kernel_ulong_t pathname, + const kernel_ulong_t times) +{ + long rc = syscall(__NR_futimesat, dirfd, pathname, times); + errstr = sprintrc(rc); + return rc; +} - rc = syscall(__NR_futimesat, dirfd, 0, ts + 2); - printf("futimesat(%d, NULL, %p) = %ld %s (%m)\n", - (int) dirfd, ts + 2, rc, errno2name()); +int +main(void) +{ + static const kernel_ulong_t bogus_fd = + (kernel_ulong_t) 0xbadfaceddeadbeaf; + static const kernel_ulong_t kfdcwd = + (kernel_ulong_t) 0xdefaced00000000 | -100U; + static const char proto_fname[] = "futimesat_sample"; + static const char qname[] = "\"futimesat_sample\""; - rc = syscall(__NR_futimesat, dirfd, 0, ts + 1); - printf("futimesat(%d, NULL, [{tv_sec=%jd, tv_usec=%jd}, %p]) = " - "%ld %s (%m)\n", (int) dirfd, - (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, - ts + 2, rc, errno2name()); + char *const fname = tail_memdup(proto_fname, sizeof(proto_fname)); + const kernel_ulong_t kfname = (uintptr_t) fname; + struct timeval *const tv = tail_alloc(sizeof(*tv) * 2); (void) close(0); - rc = syscall(__NR_futimesat, 0, "", ts); - printf("futimesat(0, \"\", [{tv_sec=%jd, tv_usec=%jd}, " - "{tv_sec=%jd, tv_usec=%jd}]) = %ld %s (%m)\n", - (intmax_t) ts[0].tv_sec, (intmax_t) ts[0].tv_usec, - (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, - rc, errno2name()); + + /* dirfd */ + k_futimesat(0, kfname, 0); + printf("futimesat(0, %s, NULL) = %s\n", qname, errstr); + + k_futimesat(bogus_fd, kfname, 0); + printf("futimesat(%d, %s, NULL) = %s\n", (int) bogus_fd, qname, errstr); + + k_futimesat(-100U, kfname, 0); + printf("futimesat(AT_FDCWD, %s, NULL) = %s\n", qname, errstr); + + k_futimesat(kfdcwd, kfname, 0); + printf("futimesat(AT_FDCWD, %s, NULL) = %s\n", qname, errstr); + + /* pathname */ + k_futimesat(kfdcwd, 0, 0); + printf("futimesat(AT_FDCWD, NULL, NULL) = %s\n", errstr); + + k_futimesat(kfdcwd, kfname + sizeof(proto_fname) - 1, 0); + printf("futimesat(AT_FDCWD, \"\", NULL) = %s\n", errstr); + + fname[sizeof(proto_fname) - 1] = '+'; + k_futimesat(kfdcwd, kfname, 0); + fname[sizeof(proto_fname) - 1] = '\0'; + printf("futimesat(AT_FDCWD, %p, NULL) = %s\n", fname, errstr); + + if (F8ILL_KULONG_SUPPORTED) { + k_futimesat(kfdcwd, f8ill_ptr_to_kulong(fname), 0); + printf("futimesat(AT_FDCWD, %#jx, NULL) = %s\n", + (uintmax_t) f8ill_ptr_to_kulong(fname), errstr); + } + + /* times */ + k_futimesat(kfdcwd, kfname, (uintptr_t) (tv + 1)); + printf("futimesat(AT_FDCWD, %s, %p) = %s\n", + qname, tv + 1, errstr); + + k_futimesat(kfdcwd, kfname, (uintptr_t) (tv + 2)); + printf("futimesat(AT_FDCWD, %s, %p) = %s\n", + qname, tv + 2, errstr); + + tv[0].tv_sec = 0xdeadbeefU; + tv[0].tv_usec = 0xfacefeedU; + tv[1].tv_sec = (time_t) 0xcafef00ddeadbeefLL; + tv[1].tv_usec = (suseconds_t) 0xbadc0dedfacefeedLL; + + k_futimesat(kfdcwd, kfname, (uintptr_t) tv); + printf("futimesat(AT_FDCWD, %s, [", qname); + print_tv(&tv[0]); + printf(", "); + print_tv(&tv[1]); + printf("]) = %s\n", errstr); + + tv[0].tv_sec = 1492356708; + tv[0].tv_usec = 567891234; + tv[1].tv_sec = 1492357086; + tv[1].tv_usec = 678902345; + + k_futimesat(kfdcwd, kfname, (uintptr_t) tv); + printf("futimesat(AT_FDCWD, %s, [", qname); + print_tv(&tv[0]); + printf(", "); + print_tv(&tv[1]); + printf("]) = %s\n", errstr); + + tv[0].tv_usec = 567891; + tv[1].tv_usec = 678902; + + k_futimesat(kfdcwd, kfname, (uintptr_t) tv); + printf("futimesat(AT_FDCWD, %s, [", qname); + print_tv(&tv[0]); + printf(", "); + print_tv(&tv[1]); + printf("]) = %s\n", errstr); + + if (F8ILL_KULONG_SUPPORTED) { + k_futimesat(kfdcwd, kfname, f8ill_ptr_to_kulong(tv)); + printf("futimesat(AT_FDCWD, %s, %#jx) = %s\n", + qname, (uintmax_t) f8ill_ptr_to_kulong(tv), errstr); + } puts("+++ exited with 0 +++"); return 0; diff --git a/tests/futimesat.gen.test b/tests/futimesat.gen.test new file mode 100755 index 00000000..80d7a8bc --- /dev/null +++ b/tests/futimesat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (futimesat -a28 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests/futimesat.test b/tests/futimesat.test deleted file mode 100755 index 3a67c042..00000000 --- a/tests/futimesat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check futimesat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 diff --git a/tests/gen_pure_executables.sh b/tests/gen_pure_executables.sh new file mode 100755 index 00000000..735f53a6 --- /dev/null +++ b/tests/gen_pure_executables.sh @@ -0,0 +1,30 @@ +#!/bin/sh -efu +# +# Copyright (c) 2017-2018 Dmitry V. Levin +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +usage() +{ + cat >&2 < []] + +Generate pure_executables.am from list. +Deduce output file from unless an is specified. +EOF + exit 1 +} + +input="${0%/*}/pure_executables.list" +[ $# -eq 0 ] || { input="$1"; shift; } +output="$(dirname "$input")/pure_executables.am" +[ $# -eq 0 ] || { output="$1"; shift; } +[ $# -eq 0 ] || usage + +exec > "$output" + +echo "# Generated by $0 from $input; do not edit." +echo 'PURE_EXECUTABLES = \' +sed -n 's/^[^#].*/ & \\/p' < "$input" +echo ' #' diff --git a/tests/gen_tests.am b/tests/gen_tests.am new file mode 100644 index 00000000..e6d1fc7b --- /dev/null +++ b/tests/gen_tests.am @@ -0,0 +1,1574 @@ +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in; do not edit. +GEN_TESTS = _newselect.gen.test _newselect-P.gen.test accept.gen.test accept4.gen.test access.gen.test acct.gen.test add_key.gen.test adjtimex.gen.test aio.gen.test aio_pgetevents.gen.test alarm.gen.test bpf.gen.test bpf-obj_get_info_by_fd.gen.test bpf-obj_get_info_by_fd-prog.gen.test bpf-obj_get_info_by_fd-prog-v.gen.test bpf-obj_get_info_by_fd-v.gen.test bpf-v.gen.test btrfs.gen.test chmod.gen.test chown.gen.test chown32.gen.test chroot.gen.test clock.gen.test clock_adjtime.gen.test clock_nanosleep.gen.test clock_xettime.gen.test copy_file_range.gen.test creat.gen.test delete_module.gen.test dev-yy.gen.test dup.gen.test dup2.gen.test dup3.gen.test epoll_create.gen.test epoll_create1.gen.test epoll_ctl.gen.test epoll_pwait.gen.test epoll_wait.gen.test erestartsys.gen.test execveat.gen.test execveat-v.gen.test faccessat.gen.test fadvise64_64.gen.test fallocate.gen.test fanotify_init.gen.test fanotify_mark.gen.test fanotify_mark-Xabbrev.gen.test fanotify_mark-Xraw.gen.test fanotify_mark-Xverbose.gen.test fchdir.gen.test fchmod.gen.test fchmodat.gen.test fchown.gen.test fchown32.gen.test fchownat.gen.test fcntl.gen.test fcntl64.gen.test fdatasync.gen.test file_handle.gen.test file_ioctl.gen.test finit_module.gen.test flock.gen.test fork-f.gen.test fstat.gen.test fstat-Xabbrev.gen.test fstat-Xraw.gen.test fstat-Xverbose.gen.test fstat64.gen.test fstat64-Xabbrev.gen.test fstat64-Xraw.gen.test fstat64-Xverbose.gen.test fstatat64.gen.test fstatfs.gen.test fstatfs64.gen.test fsync.gen.test fsync-y.gen.test ftruncate.gen.test ftruncate64.gen.test futimesat.gen.test get_mempolicy.gen.test getcpu.gen.test getcwd.gen.test getdents.gen.test getdents64.gen.test getegid.gen.test getegid32.gen.test geteuid.gen.test geteuid32.gen.test getgid.gen.test getgid32.gen.test getgroups.gen.test getgroups32.gen.test getpeername.gen.test getpgrp.gen.test getpid.gen.test getppid.gen.test getrandom.gen.test getresgid.gen.test getresgid32.gen.test getresuid.gen.test getresuid32.gen.test getrlimit.gen.test getrusage.gen.test getsid.gen.test getsockname.gen.test gettid.gen.test getuid32.gen.test getxxid.gen.test group_req.gen.test inet-cmsg.gen.test init_module.gen.test inotify.gen.test inotify_init1.gen.test io_uring_enter.gen.test io_uring_register.gen.test io_uring_setup.gen.test ioctl_block.gen.test ioctl_dm.gen.test ioctl_dm-v.gen.test ioctl_evdev.gen.test ioctl_evdev-v.gen.test ioctl_inotify.gen.test ioctl_kvm_run.gen.test ioctl_kvm_run-v.gen.test ioctl_kvm_run_auxstr_vcpu.gen.test ioctl_loop.gen.test ioctl_loop-nv.gen.test ioctl_loop-v.gen.test ioctl_mtd.gen.test ioctl_nbd.gen.test ioctl_nsfs.gen.test ioctl_perf.gen.test ioctl_ptp.gen.test ioctl_random.gen.test ioctl_rtc.gen.test ioctl_rtc-v.gen.test ioctl_scsi.gen.test ioctl_sg_io_v3.gen.test ioctl_sg_io_v4.gen.test ioctl_sock_gifconf.gen.test ioctl_uffdio.gen.test ioctl_v4l2.gen.test ioperm.gen.test iopl.gen.test ioprio.gen.test ioprio-Xabbrev.gen.test ioprio-Xraw.gen.test ioprio-Xverbose.gen.test ip_mreq.gen.test ipc.gen.test ipc_msg.gen.test ipc_msg-Xabbrev.gen.test ipc_msg-Xraw.gen.test ipc_msg-Xverbose.gen.test ipc_msgbuf-Xabbrev.gen.test ipc_msgbuf-Xraw.gen.test ipc_msgbuf-Xverbose.gen.test ipc_sem.gen.test ipc_sem-Xabbrev.gen.test ipc_sem-Xraw.gen.test ipc_sem-Xverbose.gen.test ipc_shm.gen.test ipc_shm-Xabbrev.gen.test ipc_shm-Xraw.gen.test ipc_shm-Xverbose.gen.test kcmp.gen.test kcmp-y.gen.test kern_features.gen.test kernel_version.gen.test kernel_version-Xabbrev.gen.test kernel_version-Xraw.gen.test kernel_version-Xverbose.gen.test kexec_file_load.gen.test kexec_load.gen.test keyctl.gen.test keyctl-Xabbrev.gen.test keyctl-Xraw.gen.test keyctl-Xverbose.gen.test kill.gen.test lchown.gen.test lchown32.gen.test link.gen.test linkat.gen.test lookup_dcookie.gen.test lstat.gen.test lstat64.gen.test madvise.gen.test mbind.gen.test membarrier.gen.test memfd_create.gen.test memfd_create-Xabbrev.gen.test memfd_create-Xraw.gen.test memfd_create-Xverbose.gen.test migrate_pages.gen.test mincore.gen.test mkdir.gen.test mkdirat.gen.test mknod.gen.test mknodat.gen.test mlock.gen.test mlock2.gen.test mlockall.gen.test mmap-Xabbrev.gen.test mmap-Xraw.gen.test mmap-Xverbose.gen.test mmap64.gen.test mmap64-Xabbrev.gen.test mmap64-Xraw.gen.test mmap64-Xverbose.gen.test mmsg.gen.test mmsg-silent.gen.test mmsg_name.gen.test mmsg_name-v.gen.test modify_ldt.gen.test mount.gen.test mount-Xabbrev.gen.test mount-Xraw.gen.test mount-Xverbose.gen.test move_pages.gen.test move_pages-Xabbrev.gen.test move_pages-Xraw.gen.test move_pages-Xverbose.gen.test mq.gen.test mq_sendrecv.gen.test mq_sendrecv-read.gen.test mq_sendrecv-write.gen.test msg_control.gen.test msg_control-v.gen.test msg_name.gen.test munlockall.gen.test nanosleep.gen.test net-icmp_filter.gen.test net-packet_mreq.gen.test net-packet_mreq-Xabbrev.gen.test net-packet_mreq-Xraw.gen.test net-packet_mreq-Xverbose.gen.test net-sockaddr.gen.test net-tpacket_req.gen.test net-tpacket_stats.gen.test net-yy-inet6.gen.test netlink_audit.gen.test netlink_crypto.gen.test netlink_generic.gen.test netlink_kobject_uevent.gen.test netlink_netfilter.gen.test netlink_protocol.gen.test netlink_route.gen.test netlink_selinux.gen.test netlink_xfrm.gen.test newfstatat.gen.test nfnetlink_acct.gen.test nfnetlink_cthelper.gen.test nfnetlink_ctnetlink.gen.test nfnetlink_ctnetlink_exp.gen.test nfnetlink_cttimeout.gen.test nfnetlink_ipset.gen.test nfnetlink_nft_compat.gen.test nfnetlink_nftables.gen.test nfnetlink_osf.gen.test nfnetlink_queue.gen.test nfnetlink_ulog.gen.test nlattr.gen.test nlattr_br_port_msg.gen.test nlattr_crypto_user_alg.gen.test nlattr_dcbmsg.gen.test nlattr_fib_rule_hdr.gen.test nlattr_ifaddrlblmsg.gen.test nlattr_ifaddrmsg.gen.test nlattr_ifinfomsg.gen.test nlattr_ifla_af_spec.gen.test nlattr_ifla_brport.gen.test nlattr_ifla_linkinfo.gen.test nlattr_ifla_port.gen.test nlattr_ifla_xdp.gen.test nlattr_inet_diag_msg.gen.test nlattr_inet_diag_req_compat.gen.test nlattr_inet_diag_req_v2.gen.test nlattr_mdba_mdb_entry.gen.test nlattr_mdba_router_port.gen.test nlattr_ndmsg.gen.test nlattr_ndtmsg.gen.test nlattr_netconfmsg.gen.test nlattr_netlink_diag_msg.gen.test nlattr_nlmsgerr.gen.test nlattr_packet_diag_msg.gen.test nlattr_rtgenmsg.gen.test nlattr_rtmsg.gen.test nlattr_smc_diag_msg.gen.test nlattr_tc_stats.gen.test nlattr_tca_stab.gen.test nlattr_tcamsg.gen.test nlattr_tcmsg.gen.test nlattr_unix_diag_msg.gen.test old_mmap.gen.test old_mmap-P.gen.test old_mmap-Xabbrev.gen.test old_mmap-Xraw.gen.test old_mmap-Xverbose.gen.test old_mmap-v-none.gen.test oldfstat.gen.test oldlstat.gen.test oldselect.gen.test oldselect-P.gen.test oldselect-efault.gen.test oldselect-efault-P.gen.test oldstat.gen.test open.gen.test openat.gen.test orphaned_process_group.gen.test osf_utimes.gen.test pause.gen.test perf_event_open.gen.test perf_event_open_nonverbose.gen.test perf_event_open_unabbrev.gen.test personality-Xabbrev.gen.test personality-Xraw.gen.test personality-Xverbose.gen.test pidfd_send_signal.gen.test pipe2.gen.test pkey_alloc.gen.test pkey_free.gen.test pkey_mprotect.gen.test ppoll.gen.test ppoll-P.gen.test ppoll-v.gen.test pread64-pwrite64.gen.test preadv.gen.test preadv-pwritev.gen.test preadv2-pwritev2.gen.test printpath-umovestr.gen.test printpath-umovestr-peekdata.gen.test printpath-umovestr-undumpable.gen.test printsignal-Xabbrev.gen.test printsignal-Xraw.gen.test printsignal-Xverbose.gen.test printstr.gen.test printstrn-umoven.gen.test printstrn-umoven-peekdata.gen.test printstrn-umoven-undumpable.gen.test prlimit64.gen.test process_vm_readv.gen.test process_vm_writev.gen.test pselect6.gen.test ptrace.gen.test ptrace_syscall_info.gen.test pwritev.gen.test quotactl.gen.test quotactl-Xabbrev.gen.test quotactl-Xraw.gen.test quotactl-Xverbose.gen.test quotactl-v.gen.test quotactl-xfs.gen.test quotactl-xfs-v.gen.test read-write.gen.test readahead.gen.test readdir.gen.test readlink.gen.test readlinkat.gen.test reboot.gen.test recvfrom.gen.test recvmmsg-timeout.gen.test recvmsg.gen.test regex.gen.test remap_file_pages.gen.test remap_file_pages-Xabbrev.gen.test remap_file_pages-Xraw.gen.test remap_file_pages-Xverbose.gen.test rename.gen.test renameat.gen.test renameat2.gen.test request_key.gen.test riscv_flush_icache.gen.test rmdir.gen.test rt_sigpending.gen.test rt_sigprocmask.gen.test rt_sigqueueinfo.gen.test rt_sigreturn.gen.test rt_sigsuspend.gen.test rt_sigtimedwait.gen.test rt_tgsigqueueinfo.gen.test s390_guarded_storage.gen.test s390_guarded_storage-v.gen.test s390_pci_mmio_read_write.gen.test s390_runtime_instr.gen.test s390_sthyi.gen.test s390_sthyi-v.gen.test sched.gen.test sched_get_priority_mxx.gen.test sched_rr_get_interval.gen.test sched_xetaffinity.gen.test sched_xetattr.gen.test sched_xetparam.gen.test sched_xetscheduler.gen.test sched_yield.gen.test seccomp-filter.gen.test seccomp-filter-v.gen.test seccomp_get_action_avail.gen.test select.gen.test select-P.gen.test semop.gen.test sendfile.gen.test sendfile64.gen.test set_mempolicy.gen.test setdomainname.gen.test setfsgid.gen.test setfsgid32.gen.test setfsuid.gen.test setfsuid32.gen.test setgid.gen.test setgid32.gen.test setgroups.gen.test setgroups32.gen.test sethostname.gen.test setns.gen.test setregid.gen.test setregid32.gen.test setresgid.gen.test setresgid32.gen.test setresuid.gen.test setresuid32.gen.test setreuid.gen.test setreuid32.gen.test setrlimit.gen.test setrlimit-Xabbrev.gen.test setrlimit-Xraw.gen.test setrlimit-Xverbose.gen.test setuid.gen.test setuid32.gen.test shmxt.gen.test shutdown.gen.test sigaction.gen.test siginfo.gen.test signal.gen.test signal_receive.gen.test signalfd4.gen.test sigpending.gen.test sigprocmask.gen.test sigreturn.gen.test sigsuspend.gen.test so_error.gen.test so_linger.gen.test so_peercred.gen.test so_peercred-Xabbrev.gen.test so_peercred-Xraw.gen.test so_peercred-Xverbose.gen.test sock_filter-v.gen.test sock_filter-v-Xabbrev.gen.test sock_filter-v-Xraw.gen.test sock_filter-v-Xverbose.gen.test sockaddr_xlat-Xabbrev.gen.test sockaddr_xlat-Xraw.gen.test sockaddr_xlat-Xverbose.gen.test socketcall.gen.test sockopt-sol_netlink.gen.test sockopt-timestamp.gen.test splice.gen.test stat.gen.test stat64.gen.test statfs.gen.test statfs64.gen.test statx.gen.test swap.gen.test sxetmask.gen.test symlink.gen.test symlinkat.gen.test sync.gen.test sync_file_range.gen.test sync_file_range2.gen.test sysinfo.gen.test syslog.gen.test tee.gen.test time.gen.test timer_create.gen.test timer_xettime.gen.test timerfd_xettime.gen.test times.gen.test times-fail.gen.test trace_fstat.gen.test trace_fstatfs.gen.test trace_lstat.gen.test trace_personality_32.gen.test trace_personality_64.gen.test trace_personality_regex_32.gen.test trace_personality_regex_64.gen.test trace_personality_regex_x32.gen.test trace_personality_x32.gen.test trace_question.gen.test trace_stat.gen.test trace_stat_like.gen.test trace_statfs.gen.test trace_statfs_like.gen.test truncate.gen.test truncate64.gen.test ugetrlimit.gen.test umask.gen.test umoven-illptr.gen.test umovestr-illptr.gen.test umovestr3.gen.test unlink.gen.test unlinkat.gen.test unshare.gen.test userfaultfd.gen.test ustat.gen.test utime.gen.test utimensat.gen.test utimensat-Xabbrev.gen.test utimensat-Xraw.gen.test utimensat-Xverbose.gen.test utimes.gen.test vfork-f.gen.test vhangup.gen.test vmsplice.gen.test wait4.gen.test wait4-v.gen.test waitid.gen.test waitid-v.gen.test waitpid.gen.test xattr.gen.test xattr-strings.gen.test xet_robust_list.gen.test xetitimer.gen.test xetpgid.gen.test xetpriority.gen.test xettimeofday.gen.test + +$(srcdir)/_newselect.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/_newselect-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/accept.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/accept4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/access.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/acct.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/add_key.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/adjtimex.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/aio.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/aio_pgetevents.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/alarm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd-prog.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd-prog-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-obj_get_info_by_fd-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/bpf-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/btrfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chmod.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chown32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/chroot.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock_adjtime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock_nanosleep.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/clock_xettime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/copy_file_range.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/creat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/delete_module.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dev-yy.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dup.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dup2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/dup3.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_create.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_create1.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_ctl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_pwait.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/epoll_wait.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/erestartsys.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/execveat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/execveat-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/faccessat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fadvise64_64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fallocate.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_init.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fanotify_mark-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchmod.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchmodat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchown32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fchownat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fcntl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fcntl64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fdatasync.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/file_handle.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/file_ioctl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/finit_module.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/flock.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fork-f.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstat64-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstatat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstatfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fstatfs64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fsync.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/fsync-y.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ftruncate.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ftruncate64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/futimesat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/get_mempolicy.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getcpu.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getcwd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getdents.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getdents64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getegid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getegid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/geteuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/geteuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgroups.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getgroups32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getpeername.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getpgrp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getpid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getppid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getrandom.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getresuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getrlimit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getrusage.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getsid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getsockname.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/gettid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/getxxid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/group_req.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/inet-cmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/init_module.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/inotify.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/inotify_init1.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/io_uring_enter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/io_uring_register.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/io_uring_setup.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_block.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_dm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_dm-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_evdev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_evdev-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_inotify.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_kvm_run.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_kvm_run-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_kvm_run_auxstr_vcpu.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_loop.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_loop-nv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_loop-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_mtd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_nbd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_nsfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_perf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_ptp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_random.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_rtc.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_rtc-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_scsi.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_sg_io_v3.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_sg_io_v4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_sock_gifconf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_uffdio.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioctl_v4l2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioperm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/iopl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ioprio-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ip_mreq.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msg-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msgbuf-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msgbuf-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_msgbuf-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_sem-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ipc_shm-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kcmp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kcmp-y.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kern_features.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kernel_version-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kexec_file_load.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kexec_load.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/keyctl-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/kill.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lchown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lchown32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/link.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/linkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lookup_dcookie.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/lstat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/madvise.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mbind.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/membarrier.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/memfd_create-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/migrate_pages.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mincore.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mkdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mkdirat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mknod.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mknodat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mlock.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mlock2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mlockall.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmap64-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg-silent.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg_name.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mmsg_name-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/modify_ldt.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mount-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/move_pages-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq_sendrecv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq_sendrecv-read.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/mq_sendrecv-write.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/msg_control.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/msg_control-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/msg_name.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/munlockall.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nanosleep.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-icmp_filter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-packet_mreq-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-sockaddr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-tpacket_req.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-tpacket_stats.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/net-yy-inet6.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_audit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_crypto.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_generic.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_kobject_uevent.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_netfilter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_protocol.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_route.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_selinux.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/netlink_xfrm.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/newfstatat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_acct.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_cthelper.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ctnetlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ctnetlink_exp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_cttimeout.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ipset.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_nft_compat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_nftables.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_osf.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_queue.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nfnetlink_ulog.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_br_port_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_crypto_user_alg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_dcbmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_fib_rule_hdr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifaddrlblmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifaddrmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifinfomsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_af_spec.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_brport.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_linkinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_port.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ifla_xdp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_inet_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_inet_diag_req_compat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_inet_diag_req_v2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_mdba_mdb_entry.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_mdba_router_port.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ndmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_ndtmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_netconfmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_netlink_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_nlmsgerr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_packet_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_rtgenmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_rtmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_smc_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tc_stats.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tca_stab.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tcamsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_tcmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/nlattr_unix_diag_msg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/old_mmap-v-none.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldfstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldlstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect-efault.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldselect-efault-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/oldstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/open.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/openat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/orphaned_process_group.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/osf_utimes.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pause.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/perf_event_open.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/perf_event_open_nonverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/perf_event_open_unabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/personality-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/personality-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/personality-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pidfd_send_signal.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pipe2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pkey_alloc.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pkey_free.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pkey_mprotect.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ppoll.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ppoll-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ppoll-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pread64-pwrite64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/preadv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/preadv-pwritev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/preadv2-pwritev2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printpath-umovestr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printpath-umovestr-peekdata.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printpath-umovestr-undumpable.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printsignal-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printsignal-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printsignal-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstrn-umoven.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstrn-umoven-peekdata.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/printstrn-umoven-undumpable.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/prlimit64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/process_vm_readv.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/process_vm_writev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pselect6.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ptrace.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ptrace_syscall_info.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/pwritev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-xfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/quotactl-xfs-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/read-write.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readahead.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/readlinkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/reboot.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/recvfrom.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/recvmmsg-timeout.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/recvmsg.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/regex.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/remap_file_pages-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rename.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/renameat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/renameat2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/request_key.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/riscv_flush_icache.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rmdir.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigpending.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigprocmask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigqueueinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigreturn.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigsuspend.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_sigtimedwait.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/rt_tgsigqueueinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_guarded_storage.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_guarded_storage-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_pci_mmio_read_write.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_runtime_instr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_sthyi.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/s390_sthyi-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_get_priority_mxx.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_rr_get_interval.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetaffinity.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetattr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetparam.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_xetscheduler.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sched_yield.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/seccomp-filter.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/seccomp-filter-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/seccomp_get_action_avail.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/select.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/select-P.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/semop.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sendfile.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sendfile64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/set_mempolicy.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setdomainname.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setfsuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgroups.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setgroups32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sethostname.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setns.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setregid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setregid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresgid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setresuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setreuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setreuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setrlimit-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setuid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/setuid32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/shmxt.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/shutdown.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigaction.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/siginfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/signal.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/signal_receive.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/signalfd4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigpending.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigprocmask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigreturn.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sigsuspend.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_error.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_linger.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/so_peercred-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sock_filter-v-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockaddr_xlat-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockaddr_xlat-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockaddr_xlat-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/socketcall.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockopt-sol_netlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sockopt-timestamp.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/splice.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/stat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/stat64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/statfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/statfs64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/statx.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/swap.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sxetmask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/symlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/symlinkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sync.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sync_file_range.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sync_file_range2.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/sysinfo.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/syslog.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/tee.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/time.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/timer_create.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/timer_xettime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/timerfd_xettime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/times.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/times-fail.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_fstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_fstatfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_lstat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_regex_32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_regex_64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_regex_x32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_personality_x32.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_question.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_stat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_stat_like.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_statfs.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/trace_statfs_like.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/truncate.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/truncate64.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ugetrlimit.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umask.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umoven-illptr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umovestr-illptr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/umovestr3.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/unlink.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/unlinkat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/unshare.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/userfaultfd.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/ustat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utime.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat-Xabbrev.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat-Xraw.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimensat-Xverbose.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/utimes.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/vfork-f.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/vhangup.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/vmsplice.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/wait4.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/wait4-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/waitid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/waitid-v.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/waitpid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xattr.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xattr-strings.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xet_robust_list.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xetitimer.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xetpgid.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xetpriority.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ + +$(srcdir)/xettimeofday.gen.test: $(abs_srcdir)/gen_tests.sh $(srcdir)/gen_tests.in + $(AM_V_GEN) $^ $@ diff --git a/tests/gen_tests.in b/tests/gen_tests.in new file mode 100644 index 00000000..487b9608 --- /dev/null +++ b/tests/gen_tests.in @@ -0,0 +1,531 @@ +# Input for gen_tests.sh +# +# Copyright (c) 2017-2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +_newselect +_newselect-P -e trace=_newselect -P /dev/full 9>>/dev/full +accept -a22 +accept4 -a37 +access -a30 -P access_sample +acct -a20 +add_key -a30 -s12 +adjtimex -a15 +aio -a14 -e trace=io_setup,io_submit,io_getevents,io_cancel,io_destroy +aio_pgetevents -e trace=io_pgetevents +alarm -a10 +bpf -a20 +bpf-obj_get_info_by_fd -a20 -y -e trace=bpf +bpf-obj_get_info_by_fd-prog -a20 -y -e trace=bpf +bpf-obj_get_info_by_fd-prog-v -a20 -y -v -e trace=bpf +bpf-obj_get_info_by_fd-v -a20 -y -v -e trace=bpf +bpf-v -a20 -v -e trace=bpf +btrfs +ioctl.test +chmod -a28 +chown -a28 +chown32 -a31 +chroot -a24 +clock test_trace_expr 'times|fcntl.*' -e/clock +clock_adjtime -a37 +clock_nanosleep -e trace=clock_nanosleep,clock_gettime +clock_xettime -a36 -e trace=clock_getres,clock_gettime,clock_settime +copy_file_range +creat -a20 +delete_module -a23 +dev-yy -a30 -e trace=openat,fsync -P "/dev/full" -P "/dev/zero" -P "/dev/sda" -yy +dup -a8 +dup2 -a13 +dup3 -a24 +epoll_create -a17 +epoll_create1 -a28 +epoll_ctl +epoll_pwait +epoll_wait -a26 +erestartsys -a34 -e signal=none -e trace=recvfrom +execveat +execveat-v -v -e trace=execveat +faccessat -P $NAME.sample +fadvise64_64 +fadvise64.test +fallocate -a18 +fanotify_init +fanotify_mark -a32 +fanotify_mark-Xabbrev -a32 -Xabbrev -e trace=fanotify_mark +fanotify_mark-Xraw -a32 -Xraw -e trace=fanotify_mark +fanotify_mark-Xverbose -a32 -Xverbose -e trace=fanotify_mark +fchdir -a11 +fchmod -a15 +fchmodat +fchown -a16 +fchown32 -a18 +fchownat +fcntl -a8 +fcntl64 -a8 +fdatasync -a14 +file_handle -e trace=name_to_handle_at,open_by_handle_at +file_ioctl +ioctl.test +finit_module -a25 +flock -a19 +fork-f -a26 -qq -f -e signal=none -e trace=chdir +fstat -a15 -v -P stat.sample +fstat-Xabbrev -a15 -v -Xabbrev -P stat.sample -e trace=fstat +fstat-Xraw -a15 -v -Xraw -P stat.sample -e trace=fstat +fstat-Xverbose -a15 -v -Xverbose -P stat.sample -e trace=fstat +fstat64 -a17 -v -P stat.sample +fstat64-Xabbrev -a17 -Xabbrev -v -P stat.sample -e trace=fstat64 +fstat64-Xraw -a17 -Xraw -v -P stat.sample -e trace=fstat64 +fstat64-Xverbose -a17 -Xverbose -v -P stat.sample -e trace=fstat64 +fstatat64 -a32 -v -P stat.sample -P /dev/full +fstatfs -a18 +fstatfs64 -a24 +fsync -a10 +fsync-y -y -e trace=fsync +ftruncate -a24 +ftruncate64 -a36 +futimesat -a28 +get_mempolicy -s3 -a38 +getcpu -a25 +getcwd -a18 +getdents -a22 -v +getdents64 -a24 -v +getegid +getuid.test +getegid32 +getuid.test +geteuid +getuid.test +geteuid32 +getuid.test +getgid +getuid.test +getgid32 +getuid.test +getgroups -a17 +getgroups32 -a19 +getpeername -a27 +getpgrp -a10 +getpid -a9 +getppid -a10 +getrandom -a32 -s3 +getresgid -a25 +getresgid32 -a27 +getresuid -a25 +getresuid32 -a27 +getrlimit -a27 +getrusage -v +getsid -a10 +getsockname -a27 +gettid -a9 +getuid32 +getuid.test +getxxid -a10 -e trace=getxpid,getxuid,getxgid +group_req -e trace=setsockopt +inet-cmsg -e trace=recvmsg +init_module -a27 +inotify -a23 -e trace=inotify_add_watch,inotify_rm_watch +inotify_init1 -a27 +io_uring_enter -y +io_uring_register -y +io_uring_setup -a26 -y +ioctl_block +ioctl.test +ioctl_dm +ioctl.test -s9 +ioctl_dm-v +ioctl.test -v -s9 +ioctl_evdev +ioctl.test +ioctl_evdev-v +ioctl.test -v +ioctl_inotify +ioctl.test +ioctl_kvm_run +ioctl.test -a36 -y +ioctl_kvm_run-v +ioctl.test -v -a36 -y +ioctl_kvm_run_auxstr_vcpu +ioctl.test -a36 -y -e kvm=vcpu +ioctl_loop +ioctl.test +ioctl_loop-nv +ioctl.test -a22 -e verbose=none +ioctl_loop-v +ioctl.test -v +ioctl_mtd +ioctl.test +ioctl_nbd +ioctl.test -y +ioctl_nsfs +ioctl.test -esignal=none +ioctl_perf +ioctl.test +ioctl_ptp +ioctl.test +ioctl_random +ioctl.test +ioctl_rtc +ioctl.test +ioctl_rtc-v +ioctl.test -v +ioctl_scsi +ioctl.test +ioctl_sg_io_v3 +ioctl.test +ioctl_sg_io_v4 +ioctl.test +ioctl_sock_gifconf +ioctl.test -a28 -s1 +ioctl_uffdio +ioctl.test +ioctl_v4l2 +ioctl.test +ioperm -a27 +iopl -a8 +ioprio -a18 -e trace=ioprio_get,ioprio_set +ioprio-Xabbrev -a18 -e trace=ioprio_get,ioprio_set -Xabbrev +ioprio-Xraw -a18 -e trace=ioprio_get,ioprio_set -Xraw +ioprio-Xverbose -a18 -e trace=ioprio_get,ioprio_set -Xverbose +ip_mreq -e trace=setsockopt +ipc -a19 +ipc_msg +ipc.sh -a26 +ipc_msg-Xabbrev +ipc.sh -Xabbrev -a26 +ipc_msg-Xraw +ipc.sh -Xraw -a16 +ipc_msg-Xverbose +ipc.sh -Xverbose -a34 +ipc_msgbuf-Xabbrev +ipc_msgbuf.test -Xabbrev +ipc_msgbuf-Xraw +ipc_msgbuf.test -Xraw -a22 +ipc_msgbuf-Xverbose +ipc_msgbuf.test -Xverbose +ipc_sem +ipc.sh -a29 +ipc_sem-Xabbrev +ipc.sh -Xabbrev -a29 +ipc_sem-Xraw +ipc.sh -Xraw -a19 +ipc_sem-Xverbose +ipc.sh -Xverbose -a36 +ipc_shm +ipc.sh -a29 +ipc_shm-Xabbrev +ipc.sh -Xabbrev -a29 +ipc_shm-Xraw +ipc.sh -Xraw -a19 +ipc_shm-Xverbose +ipc.sh -Xverbose -a36 +kcmp -a22 +kcmp-y -a22 -y -e trace=kcmp +kern_features -a16 +kernel_version -a16 -v -e trace=bpf +kernel_version-Xabbrev -a16 -Xabbrev -v -e trace=bpf +kernel_version-Xraw -a16 -Xraw -v -e trace=bpf +kernel_version-Xverbose -a16 -Xverbose -v -e trace=bpf +kexec_file_load -s9 +kexec_load -s9 +keyctl -a31 -s10 +keyctl-Xabbrev -a31 -s10 -e trace=keyctl -Xabbrev +keyctl-Xraw -a13 -s10 -e trace=keyctl -Xraw +keyctl-Xverbose -a41 -s10 -e trace=keyctl -Xverbose +kill -a12 -esignal=none +lchown -a30 +lchown32 -a32 +link +linkat +lookup_dcookie -a27 +lstat -a32 -v -P stat.sample -P /dev/full +lstat64 -a32 -v -P stat.sample -P /dev/full +madvise -a33 +mbind +membarrier -a36 +memfd_create +memfd_create-Xabbrev -Xabbrev -e trace=memfd_create +memfd_create-Xraw -a30 -Xraw -e trace=memfd_create +memfd_create-Xverbose -Xverbose -e trace=memfd_create +migrate_pages -a33 +mincore -a22 +mkdir -a20 +mkdirat -a28 +mknod -a18 +mknodat -a35 +mlock -a20 -e trace=mlock,munlock +mlock2 +mlockall -a12 +mmap-Xabbrev +mmap.test abbrev +mmap-Xraw +mmap.test raw 14 +mmap-Xverbose +mmap.test verbose +mmap64 +mmap.test +mmap64-Xabbrev +mmap.test abbrev +mmap64-Xraw +mmap.test raw 14 +mmap64-Xverbose +mmap.test verbose +mmsg -e read=0 -e write=1 -e trace=recvmmsg,sendmmsg +mmsg-silent -a25 -e verbose=none -e trace=sendmmsg,recvmmsg +mmsg_name -a25 -e trace=sendmmsg,recvmmsg +mmsg_name-v -v -a25 -e trace=sendmmsg,recvmmsg +modify_ldt -a23 +mount -a33 +mount-Xabbrev -a33 -e trace=mount -Xabbrev +mount-Xraw -a33 -e trace=mount -Xraw +mount-Xverbose -a33 -e trace=mount -Xverbose +move_pages -s3 +move_pages-Xabbrev -s3 -e trace=move_pages -Xabbrev +move_pages-Xraw -s3 -a36 -e trace=move_pages -Xraw +move_pages-Xverbose -s3 -e trace=move_pages -Xverbose +mq -a32 -e trace=mq_getsetattr,mq_open,mq_unlink +mq_sendrecv -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink +mq_sendrecv-read -eread=0 -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink +mq_sendrecv-write -ewrite=0 -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink +msg_control -a21 -e trace=sendmsg +msg_control-v -v -a21 -e trace=sendmsg +msg_name -a20 -e trace=recvmsg +munlockall -a13 +nanosleep -a20 +net-icmp_filter -e trace=getsockopt,setsockopt +net-packet_mreq -e trace=setsockopt +net-packet_mreq-Xabbrev -e trace=setsockopt -Xabbrev +net-packet_mreq-Xraw -e trace=setsockopt -Xraw +net-packet_mreq-Xverbose -e trace=setsockopt -Xverbose +net-sockaddr -a24 -e trace=connect +net-tpacket_req -e trace=setsockopt +net-tpacket_stats -e trace=getsockopt +net-yy-inet6 +net-yy-inet.test +netlink_audit +netlink_sock_diag.test +netlink_crypto +netlink_sock_diag.test +netlink_generic +netlink_sock_diag.test +netlink_kobject_uevent +netlink_sock_diag.test +netlink_netfilter +netlink_sock_diag.test +netlink_protocol -e trace=sendto +netlink_route +netlink_sock_diag.test +netlink_selinux +netlink_sock_diag.test +netlink_xfrm +netlink_sock_diag.test +newfstatat -a32 -v -P stat.sample -P /dev/full +nfnetlink_acct +netlink_sock_diag.test +nfnetlink_cthelper +netlink_sock_diag.test +nfnetlink_ctnetlink +netlink_sock_diag.test +nfnetlink_ctnetlink_exp +netlink_sock_diag.test +nfnetlink_cttimeout +netlink_sock_diag.test +nfnetlink_ipset +netlink_sock_diag.test +nfnetlink_nft_compat +netlink_sock_diag.test +nfnetlink_nftables +netlink_sock_diag.test +nfnetlink_osf +netlink_sock_diag.test +nfnetlink_queue +netlink_sock_diag.test +nfnetlink_ulog +netlink_sock_diag.test +nlattr +netlink_sock_diag.test +nlattr_br_port_msg +netlink_sock_diag.test +nlattr_crypto_user_alg +netlink_sock_diag.test +nlattr_dcbmsg +netlink_sock_diag.test +nlattr_fib_rule_hdr +netlink_sock_diag.test +nlattr_ifaddrlblmsg +netlink_sock_diag.test +nlattr_ifaddrmsg +netlink_sock_diag.test +nlattr_ifinfomsg +netlink_sock_diag.test +nlattr_ifla_af_spec +netlink_sock_diag.test +nlattr_ifla_brport +netlink_sock_diag.test +nlattr_ifla_linkinfo +netlink_sock_diag.test +nlattr_ifla_port +netlink_sock_diag.test +nlattr_ifla_xdp +netlink_sock_diag.test +nlattr_inet_diag_msg +netlink_sock_diag.test +nlattr_inet_diag_req_compat +netlink_sock_diag.test +nlattr_inet_diag_req_v2 +netlink_sock_diag.test +nlattr_mdba_mdb_entry +netlink_sock_diag.test +nlattr_mdba_router_port +netlink_sock_diag.test +nlattr_ndmsg +netlink_sock_diag.test +nlattr_ndtmsg +netlink_sock_diag.test +nlattr_netconfmsg +netlink_sock_diag.test +nlattr_netlink_diag_msg +netlink_sock_diag.test +nlattr_nlmsgerr +netlink_sock_diag.test +nlattr_packet_diag_msg +netlink_sock_diag-v.sh +nlattr_rtgenmsg +netlink_sock_diag.test +nlattr_rtmsg +netlink_sock_diag.test +nlattr_smc_diag_msg +netlink_sock_diag.test +nlattr_tc_stats +netlink_sock_diag.test +nlattr_tca_stab +netlink_sock_diag.test +nlattr_tcamsg +netlink_sock_diag.test +nlattr_tcmsg +netlink_sock_diag.test +nlattr_unix_diag_msg +netlink_sock_diag.test +old_mmap -a11 -e trace=mmap +old_mmap-P -e trace=mmap -P "/dev/full" 9>>/dev/full +old_mmap-Xabbrev -a11 -e trace=mmap -Xabbrev +old_mmap-Xraw -a11 -e trace=mmap -Xraw +old_mmap-Xverbose -a11 -e trace=mmap -Xverbose +old_mmap-v-none -a11 -e trace=mmap -e verbose=none +oldfstat -a18 -v -P stat.sample +oldlstat -a32 -v -P stat.sample -P /dev/full +oldselect -a13 -e trace=select +oldselect-P -a13 -e trace=select -P /dev/full 9>>/dev/full +oldselect-efault -a13 -e trace=select +oldselect-efault-P -a13 -e trace=select -P /dev/full 9>>/dev/full +oldstat -a32 -v -P stat.sample -P /dev/full +open -a30 -P $NAME.sample +openat -a36 -P $NAME.sample +orphaned_process_group . "${srcdir=.}/PTRACE_SEIZE.sh"; run_strace_match_diff -f -e trace=none -e signal='!chld' +osf_utimes -a21 +pause -a8 -esignal=none +perf_event_open -a1 +perf_event_open_nonverbose -a34 -e verbose=none -e trace=perf_event_open +perf_event_open_unabbrev -a1 -v -e trace=perf_event_open +personality-Xabbrev +personality.test -Xabbrev +personality-Xraw +personality.test -a15 -Xraw +personality-Xverbose +personality.test -Xverbose +pidfd_send_signal +pipe2 -a15 +pkey_alloc -a17 +pkey_free -a13 +pkey_mprotect -a37 +ppoll -s2 +ppoll-P -s2 -e trace=ppoll -P /dev/full 9>>/dev/full +ppoll-v -v -s2 -e trace=ppoll +pread64-pwrite64 -a21 -eread=0 -ewrite=1 -e trace=pread64,pwrite64 -P pread64-pwrite64-tmpfile -P /dev/zero -P /dev/null +preadv -a21 +preadv-pwritev -a19 -eread=0 -ewrite=1 -e trace=preadv,pwritev +preadv2-pwritev2 -a22 -eread=0 -ewrite=1 -e trace=preadv2,pwritev2 +printpath-umovestr -a11 -e signal=none -e trace=chdir +printpath-umovestr-peekdata -a11 -e signal=none -e trace=chdir +printpath-umovestr-undumpable -a11 -e signal=none -e trace=chdir +printsignal-Xabbrev -a11 -Xabbrev -e signal=none -e trace=kill +printsignal-Xraw -a11 -Xraw -e signal=none -e trace=kill +printsignal-Xverbose -a11 -Xverbose -e signal=none -e trace=kill +printstr -e trace=writev +printstrn-umoven -s4096 -e signal=none -e trace=add_key +printstrn-umoven-peekdata -e signal=none -e trace=add_key +printstrn-umoven-undumpable -e signal=none -e trace=add_key +prlimit64 +process_vm_readv -s5 -a37 +process_vm_writev -s5 -a38 +pselect6 +ptrace -a23 -e signal=none +ptrace_syscall_info -a35 -e signal=none -e trace=ptrace +pwritev -a22 -s7 +quotactl +quotactl-Xabbrev -Xabbrev -e trace=quotactl +quotactl-Xraw -a27 -Xraw -e trace=quotactl +quotactl-Xverbose -Xverbose -e trace=quotactl +quotactl-v -v -e trace=quotactl +quotactl-xfs -e trace=quotactl +quotactl-xfs-v -v -e trace=quotactl +read-write -a15 -eread=0,5 -ewrite=1,4 -e trace=read,write -P read-write-tmpfile -P /dev/zero -P /dev/null +readahead -a1 +readdir -a16 +readlink -xx +readlinkat -xx +reboot -s 256 +recvfrom -a35 +recvmmsg-timeout -a25 -e trace=recvmmsg +recvmsg -eread=0 -ewrite=1 -e trace=recvmsg,sendmsg +regex test_trace_expr '' -etrace='/^(.*_)?statv?fs' +remap_file_pages +remap_file_pages-Xabbrev -Xabbrev -e trace=remap_file_pages +remap_file_pages-Xraw -Xraw -e trace=remap_file_pages +remap_file_pages-Xverbose -Xverbose -e trace=remap_file_pages +rename -a35 +renameat +renameat2 +request_key -a33 -s12 +riscv_flush_icache -a34 +rmdir -a22 +rt_sigpending -a20 +rt_sigprocmask +rt_sigqueueinfo -esignal=none +rt_sigreturn -esignal='!USR1' +rt_sigsuspend -a20 -esignal=none +rt_sigtimedwait -a38 +rt_tgsigqueueinfo -esignal=none +s390_guarded_storage -a32 +s390_guarded_storage-v -e trace=s390_guarded_storage -a32 -v +s390_pci_mmio_read_write -e trace=s390_pci_mmio_read,s390_pci_mmio_write -a30 +s390_runtime_instr -a44 +s390_sthyi -a47 +s390_sthyi-v -e trace=s390_sthyi -a47 -v +sched test_trace_expr times -e/sched +sched_get_priority_mxx -a33 -e trace=sched_get_priority_min,sched_get_priority_max +sched_rr_get_interval -a31 +sched_xetaffinity -a28 -e trace=sched_getaffinity,sched_setaffinity +sched_xetattr -a29 -e trace=sched_getattr,sched_setattr +sched_xetparam -a23 -e trace=sched_getparam,sched_setparam +sched_xetscheduler -a22 -e trace=sched_getscheduler,sched_setscheduler +sched_yield -a14 +seccomp-filter -e trace=seccomp +seccomp-filter-v -v -e trace=seccomp +seccomp_get_action_avail -e trace=seccomp +select -a36 +select-P -a36 -e trace=select -P /dev/full 9>>/dev/full +semop -a32 -e trace=semop,semtimedop +sendfile -a27 +sendfile64 -a29 +set_mempolicy -s3 -a35 +setdomainname -a24 +setfsgid -a12 +setfsgid32 -a14 +setfsuid -a12 +setfsuid32 -a14 +setgid -a10 +setgid32 -a12 +setgroups -s2 -a17 +setgroups32 -s2 -a19 +sethostname -a22 +setns -a21 +setregid -a15 +setregid32 -a17 +setresgid -a19 +setresgid32 -a21 +setresuid -a19 +setresuid32 -a21 +setreuid -a15 +setreuid32 -a17 +setrlimit -a27 +setrlimit-Xabbrev -a27 -e trace=setrlimit -Xabbrev +setrlimit-Xraw -a19 -e trace=setrlimit -Xraw +setrlimit-Xverbose -a36 -e trace=setrlimit -Xverbose +setuid -a10 +setuid32 -a12 +shmxt -a11 -e trace='/(osf_)?shmat,shmdt' +shutdown -a24 +sigaction -a31 +siginfo -e trace=none +signal -a25 -e signal=none -e trace='/^signal$' +signal_receive -a16 -e trace=kill +signalfd4 +sigpending -a15 +sigprocmask -a34 +sigreturn -esignal='!USR1' +sigsuspend -a19 -esignal=none +so_error -e trace=getsockopt +so_linger -e trace=getsockopt,setsockopt +so_peercred -e trace=getsockopt +so_peercred-Xabbrev -e trace=getsockopt -Xabbrev +so_peercred-Xraw -e trace=getsockopt -Xraw -a39 +so_peercred-Xverbose -e trace=getsockopt -Xverbose +sock_filter-v -v -e trace=getsockopt,setsockopt +sock_filter-v-Xabbrev -v -e trace=getsockopt,setsockopt -X abbrev +sock_filter-v-Xraw -a 37 -v -e trace=getsockopt,setsockopt -X raw +sock_filter-v-Xverbose -v -e trace=getsockopt,setsockopt -X verbose +sockaddr_xlat-Xabbrev -Xabbrev -e trace=connect +sockaddr_xlat-Xraw -Xraw -e trace=connect +sockaddr_xlat-Xverbose -Xverbose -e trace=connect +socketcall -a20 +sockopt-sol_netlink -e trace=getsockopt,setsockopt +sockopt-timestamp -e trace=recvmsg +splice +stat -a32 -v -P stat.sample -P /dev/full +stat64 -a32 -v -P stat.sample -P /dev/full +statfs -a17 +statfs64 -a23 +statx -a32 -v -P stat.sample -P /dev/full +swap -a23 -e trace=swapon,swapoff +sxetmask -a11 -e trace=sgetmask,ssetmask +symlink -a34 +symlinkat +sync -a7 +sync_file_range +sync_file_range2 +sysinfo -a14 +syslog -a36 +tee +time -a10 +timer_create +timer_xettime -e trace=timer_create,timer_settime,timer_gettime +timerfd_xettime -e trace=timerfd_create,timerfd_settime,timerfd_gettime +times -esignal=none +times-fail -a12 -e trace=times +trace_fstat test_trace_expr '' -e%fstat -v -P stat.sample -P /dev/full +trace_fstatfs test_trace_expr '' -e%fstatfs +trace_lstat test_trace_expr '' -e%lstat -v -P stat.sample -P /dev/full +trace_personality_32 +qualify_personality.sh 32 'getcwd' 'fsync-y' +trace_personality_64 +qualify_personality.sh 64 'getcwd' 'fsync-y' +trace_personality_regex_32 +qualify_personality.sh 32 '/clock.*' 'times|fcntl.*' +trace_personality_regex_64 +qualify_personality.sh 64 '/clock.*' 'times|fcntl.*' +trace_personality_regex_x32 +qualify_personality.sh x32 '/clock.*' 'times|fcntl.*' +trace_personality_x32 +qualify_personality.sh x32 'getcwd' 'fsync-y' +trace_question test_trace_expr '' -e?osf_utimes,?/^pkey_.* +trace_stat test_trace_expr '' -e%stat -v -P stat.sample -P /dev/full +trace_stat_like test_trace_expr '' -e%%stat -v -P stat.sample -P /dev/full +trace_statfs test_trace_expr '' -e%statfs +trace_statfs_like test_trace_expr '' -e%%statfs +truncate +truncate64 +ugetrlimit -a28 +umask -a11 +umoven-illptr -a36 -e trace=nanosleep +umovestr-illptr -a11 -e trace=chdir +umovestr3 -a14 -e trace=chdir +unlink -a24 +unlinkat -a35 +unshare -a11 +userfaultfd -a38 +ustat -a33 +utime -a16 +utimensat -a33 +utimensat-Xabbrev -a33 -Xabbrev -e trace=utimensat +utimensat-Xraw -a29 -Xraw -e trace=utimensat +utimensat-Xverbose -a44 -Xverbose -e trace=utimensat +utimes -a17 +vfork-f -a26 -qq -f -e signal=none -e trace=chdir +vhangup -a10 +vmsplice -ewrite=1 +wait4 -esignal=none +wait4-v -v -e signal=none -e trace=wait4 +waitid -esignal=none +waitid-v -v -e signal=none -e trace=waitid +waitpid -a28 +xattr -a22 -e trace=getxattr,fgetxattr,lgetxattr,setxattr,fsetxattr,lsetxattr,listxattr,flistxattr,llistxattr,removexattr,fremovexattr,lremovexattr +xattr-strings -a22 -s 4 -e trace=fsetxattr +xet_robust_list -a24 -e trace=get_robust_list,set_robust_list +xetitimer -a29 -e trace=setitimer,getitimer +xetpgid -a11 -e trace=getpgid,setpgid +xetpriority -a29 -e trace=getpriority,setpriority +xettimeofday -a20 -e trace=gettimeofday,settimeofday diff --git a/tests/gen_tests.sh b/tests/gen_tests.sh new file mode 100755 index 00000000..35402042 --- /dev/null +++ b/tests/gen_tests.sh @@ -0,0 +1,92 @@ +#!/bin/sh -efu +# +# Copyright (c) 2017 Dmitry V. Levin +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +usage() +{ + cat >&2 < []] + +Generate test script(s) from table. +If a is specified, generate the script for this test only, +otherwise generate scripts for all tests specified in table. +EOF + exit 1 +} + +input="${0%/*}/gen_tests.in" +[ $# -eq 0 ] || { input="$1"; shift; } +output= +[ $# -eq 0 ] || { output="$1"; shift; } +[ $# -eq 0 ] || usage + +if [ -n "$output" ]; then + match="${output##*/}" + match="${match%.gen.test}" + [ -n "$match" ] || usage +else + match= + dir="$(dirname "$input")" +fi + +names= + +while read -r name arg0 args; do { + [ -n "${name###*}" ] || continue + if [ -z "$match" ]; then + names="$names $name" + output="$dir/$name.gen.test" + else + [ "$match" = "$name" ] || continue + fi + + hdr="\ +#!/bin/sh -efu +# Generated by $0 from $input ($name $arg0 $args); do not edit." + + case "$arg0" in + +*) + cat <<-EOF + $hdr + set -- $args + . "\${srcdir=.}/${arg0#+}" + EOF + ;; + + ''|-*) + cat <<-EOF + $hdr + . "\${srcdir=.}/init.sh" + run_strace_match_diff $arg0 $args + EOF + ;; + + *) + cat <<-EOF + $hdr + . "\${srcdir=.}/init.sh" + $arg0 $args + EOF + ;; + esac > "$output" + + chmod a+x "$output" +} < /dev/null; done < "$input" + +if [ -n "$names" ]; then + { + printf '# Generated by %s from %s; do not edit.\n' "$0" "$input" + printf 'GEN_TESTS =' + printf ' %s.gen.test' $names + echo + target='$(srcdir)/%s.gen.test' + dep1='$(abs_srcdir)/gen_tests.sh' + dep2='$(srcdir)/gen_tests.in' + recipe='$(AM_V_GEN) $^ $@' + printf "\\n$target: $dep1 $dep2\\n\\t$recipe\\n" $names + } > "$dir/gen_tests.am" +fi diff --git a/tests/get_mempolicy.c b/tests/get_mempolicy.c index 03d1bffc..7667bdb0 100644 --- a/tests/get_mempolicy.c +++ b/tests/get_mempolicy.c @@ -1,30 +1,10 @@ /* * Check decoding of get_mempolicy syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/get_mempolicy.gen.test b/tests/get_mempolicy.gen.test new file mode 100755 index 00000000..ec6efb30 --- /dev/null +++ b/tests/get_mempolicy.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (get_mempolicy -s3 -a38); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 -a38 diff --git a/tests/get_mempolicy.test b/tests/get_mempolicy.test deleted file mode 100755 index 92270970..00000000 --- a/tests/get_mempolicy.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check get_mempolicy syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s3 -a38 diff --git a/tests/get_page_size.c b/tests/get_page_size.c index aeea861c..12ee929d 100644 --- a/tests/get_page_size.c +++ b/tests/get_page_size.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/get_regs.test b/tests/get_regs.test new file mode 100755 index 00000000..e7628d24 --- /dev/null +++ b/tests/get_regs.test @@ -0,0 +1,33 @@ +#!/bin/sh +# +# Check that get_regs is skipped for filtered syscalls. +# +# Copyright (c) 2017-2018 Dmitry V. Levin +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +check_prog env +check_prog grep +run_prog ../gettid > /dev/null + +run_strace -qq -esignal=none -eraw=all -etrace=none ../gettid > /dev/null + +run_strace -qq -esignal=none -eraw=all -eptrace -o '|grep -c ^ptrace > less' \ + -- "$STRACE_EXE" -o "$LOG" $args > /dev/null + +[ "$(cat less)" -gt 0 ] || + fail_ "$STRACE $args failed to catch any ptrace syscalls" + +run_strace -qq -esignal=none -eraw=all -etrace=all ../gettid > /dev/null + +run_strace -qq -esignal=none -eraw=all -eptrace -o '|grep -c ^ptrace > more' \ + -- "$STRACE_EXE" -o "$LOG" $args > /dev/null + +[ "$(cat more)" -gt 0 ] || + fail_ "$STRACE $args failed to catch any ptrace syscalls" + +[ "$(cat more)" -gt "$(cat less)" ] || + fail_ "$STRACE failed to skip get_regs for filtered syscalls" diff --git a/tests/get_sigset_size.c b/tests/get_sigset_size.c new file mode 100644 index 00000000..f58d1f51 --- /dev/null +++ b/tests/get_sigset_size.c @@ -0,0 +1,46 @@ +/* + * Find out the size of kernel's sigset_t. + * + * Copyright (c) 2016-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +/* + * If the sigset size specified to rt_sigprocmask is not equal to the size + * of kernel's sigset_t, the kernel does not look at anything else and fails + * with EINVAL. + * + * Otherwise, if both pointers specified to rt_sigprocmask are NULL, + * the kernel just returns 0. + * + * This vaguely documented kernel feature can be used to probe + * the kernel and find out the size of kernel's sigset_t. + */ + +unsigned int +get_sigset_size(void) +{ + static unsigned int set_size; + + if (!set_size) { + static const unsigned int big_size = 1024 / 8; + + for (set_size = big_size; set_size; set_size >>= 1) { + if (!syscall(__NR_rt_sigprocmask, SIG_SETMASK, + NULL, NULL, set_size)) + break; + } + + if (!set_size) + perror_msg_and_fail("rt_sigprocmask"); + } + + return set_size; +} diff --git a/tests/getcpu.c b/tests/getcpu.c index ec671f1e..ecbaf0dc 100644 --- a/tests/getcpu.c +++ b/tests/getcpu.c @@ -2,29 +2,10 @@ * Check decoding of getcpu syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,16 +21,16 @@ int main(void) { unsigned *bogus_cpu = - (unsigned *) tail_alloc(sizeof(* bogus_cpu)) + 1; + (unsigned *) tail_alloc(sizeof(*bogus_cpu)) + 1; unsigned *bogus_node = - (unsigned *) tail_alloc(sizeof(* bogus_node)) + 1; + (unsigned *) tail_alloc(sizeof(*bogus_node)) + 1; unsigned *bogus_tcache = - (unsigned *) tail_alloc(sizeof(* bogus_tcache)) + 1; + (unsigned *) tail_alloc(sizeof(*bogus_tcache)) + 1; long res; - unsigned *cpu = tail_alloc(sizeof(*cpu)); - unsigned *node = tail_alloc(sizeof(*node)); - long * tcache = tail_alloc(128); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned, cpu); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned, node); + long *tcache = tail_alloc(128); res = syscall(__NR_getcpu, NULL, NULL, NULL); printf("getcpu(NULL, NULL, NULL) = %s\n", sprintrc(res)); diff --git a/tests/getcpu.gen.test b/tests/getcpu.gen.test new file mode 100755 index 00000000..ae38aaa0 --- /dev/null +++ b/tests/getcpu.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getcpu -a25 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests/getcpu.test b/tests/getcpu.test deleted file mode 100755 index fe212658..00000000 --- a/tests/getcpu.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of getcpu syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a25 diff --git a/tests/getcwd.c b/tests/getcwd.c index 707c25c9..5f9a7293 100644 --- a/tests/getcwd.c +++ b/tests/getcwd.c @@ -1,12 +1,19 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #ifdef __NR_getcwd +# include # include # include -# include int main(void) @@ -20,9 +27,9 @@ main(void) if (res <= 0) perror_msg_and_fail("getcwd"); - printf("getcwd(\""); + printf("getcwd("); print_quoted_string(cur_dir); - printf("\", %zu) = %ld\n", sizeof(cur_dir), res); + printf(", %zu) = %ld\n", sizeof(cur_dir), res); res = syscall(__NR_getcwd, cur_dir, 0); printf("getcwd(%p, 0) = %s\n", cur_dir, sprintrc(res)); diff --git a/tests/getcwd.gen.test b/tests/getcwd.gen.test new file mode 100755 index 00000000..f783a5b1 --- /dev/null +++ b/tests/getcwd.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getcwd -a18 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests/getcwd.test b/tests/getcwd.test deleted file mode 100755 index 405187e5..00000000 --- a/tests/getcwd.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getcwd syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a18 diff --git a/tests/getdents.c b/tests/getdents.c index b787c837..998e667f 100644 --- a/tests/getdents.c +++ b/tests/getdents.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -92,12 +73,10 @@ print_dirent(const kernel_dirent *d) } int -main(int ac, const char **av) +main(void) { - char *dname; + static const char dname[] = "getdents.test.tmp.dir"; - assert(ac == 1); - assert(asprintf(&dname, "%s.test.tmp.dir", av[0]) > 0); assert(!mkdir(dname, 0700)); assert(!chdir(dname)); (void) close(0); diff --git a/tests/getdents.gen.test b/tests/getdents.gen.test new file mode 100755 index 00000000..0db5f20a --- /dev/null +++ b/tests/getdents.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getdents -a22 -v); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -v diff --git a/tests/getdents.test b/tests/getdents.test deleted file mode 100755 index 23c4ac3a..00000000 --- a/tests/getdents.test +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -# Check getdents syscall decoding. - -. "${srcdir=.}/init.sh" - -rm -rf -- "$LOG".dir -run_strace_match_diff -a22 -v diff --git a/tests/getdents64.c b/tests/getdents64.c index 9da2a23c..e0575cf4 100644 --- a/tests/getdents64.c +++ b/tests/getdents64.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -98,12 +79,10 @@ print_dirent(const kernel_dirent64 *d) } int -main(int ac, const char **av) +main(void) { - char *dname; + static const char dname[] = "getdents64.test.tmp.dir"; - assert(ac == 1); - assert(asprintf(&dname, "%s.test.tmp.dir", av[0]) > 0); assert(!mkdir(dname, 0700)); assert(!chdir(dname)); (void) close(0); diff --git a/tests/getdents64.gen.test b/tests/getdents64.gen.test new file mode 100755 index 00000000..6e24d400 --- /dev/null +++ b/tests/getdents64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getdents64 -a24 -v); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 -v diff --git a/tests/getdents64.test b/tests/getdents64.test deleted file mode 100755 index 401cfc7c..00000000 --- a/tests/getdents64.test +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -# Check getdents64 syscall decoding. - -. "${srcdir=.}/init.sh" - -rm -rf -- "$LOG".dir -run_strace_match_diff -a24 -v diff --git a/tests/getegid.c b/tests/getegid.c index 98f8b9cb..2e0754b7 100644 --- a/tests/getegid.c +++ b/tests/getegid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/getegid.gen.test b/tests/getegid.gen.test new file mode 100755 index 00000000..ddf8fa9a --- /dev/null +++ b/tests/getegid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getegid +getuid.test ); do not edit. +set -- +. "${srcdir=.}/getuid.test" diff --git a/tests/getegid.test b/tests/getegid.test deleted file mode 100755 index 4354158b..00000000 --- a/tests/getegid.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check getegid syscall decoding. - -. "${srcdir=.}/getuid.test" diff --git a/tests/getegid32.c b/tests/getegid32.c index d9951864..b7f5cb08 100644 --- a/tests/getegid32.c +++ b/tests/getegid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/getegid32.gen.test b/tests/getegid32.gen.test new file mode 100755 index 00000000..a773f56a --- /dev/null +++ b/tests/getegid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getegid32 +getuid.test ); do not edit. +set -- +. "${srcdir=.}/getuid.test" diff --git a/tests/getegid32.test b/tests/getegid32.test deleted file mode 100755 index a266620e..00000000 --- a/tests/getegid32.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check getegid32 syscall decoding. - -. "${srcdir=.}/getuid.test" diff --git a/tests/geteuid.c b/tests/geteuid.c index ef8269f9..430df1c6 100644 --- a/tests/geteuid.c +++ b/tests/geteuid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/geteuid.gen.test b/tests/geteuid.gen.test new file mode 100755 index 00000000..c7da2aa9 --- /dev/null +++ b/tests/geteuid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (geteuid +getuid.test ); do not edit. +set -- +. "${srcdir=.}/getuid.test" diff --git a/tests/geteuid.test b/tests/geteuid.test deleted file mode 100755 index 14ff6a69..00000000 --- a/tests/geteuid.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check geteuid syscall decoding. - -. "${srcdir=.}/getuid.test" diff --git a/tests/geteuid32.c b/tests/geteuid32.c index 4341e46f..94174f32 100644 --- a/tests/geteuid32.c +++ b/tests/geteuid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/geteuid32.gen.test b/tests/geteuid32.gen.test new file mode 100755 index 00000000..75c3f12e --- /dev/null +++ b/tests/geteuid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (geteuid32 +getuid.test ); do not edit. +set -- +. "${srcdir=.}/getuid.test" diff --git a/tests/geteuid32.test b/tests/geteuid32.test deleted file mode 100755 index 9dd173d9..00000000 --- a/tests/geteuid32.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check geteuid32 syscall decoding. - -. "${srcdir=.}/getuid.test" diff --git a/tests/getgid.c b/tests/getgid.c index 2e060390..1bd70502 100644 --- a/tests/getgid.c +++ b/tests/getgid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/getgid.gen.test b/tests/getgid.gen.test new file mode 100755 index 00000000..fc6ac3bc --- /dev/null +++ b/tests/getgid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getgid +getuid.test ); do not edit. +set -- +. "${srcdir=.}/getuid.test" diff --git a/tests/getgid.test b/tests/getgid.test deleted file mode 100755 index f4f0c2e6..00000000 --- a/tests/getgid.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check getgid syscall decoding. - -. "${srcdir=.}/getuid.test" diff --git a/tests/getgid32.c b/tests/getgid32.c index 52e4d76a..c6859cf4 100644 --- a/tests/getgid32.c +++ b/tests/getgid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/getgid32.gen.test b/tests/getgid32.gen.test new file mode 100755 index 00000000..b3a87561 --- /dev/null +++ b/tests/getgid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getgid32 +getuid.test ); do not edit. +set -- +. "${srcdir=.}/getuid.test" diff --git a/tests/getgid32.test b/tests/getgid32.test deleted file mode 100755 index 3bc98d1a..00000000 --- a/tests/getgid32.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check getgid32 syscall decoding. - -. "${srcdir=.}/getuid.test" diff --git a/tests/getgroups.c b/tests/getgroups.c index 2617303f..36c095df 100644 --- a/tests/getgroups.c +++ b/tests/getgroups.c @@ -2,29 +2,10 @@ * Check decoding of getgroups/getgroups32 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifdef __NR_getgroups32 @@ -57,7 +38,7 @@ # include # include -#define MAX_STRLEN 32 +# define MAX_STRLEN 32 static long ngroups; static void @@ -91,7 +72,7 @@ main(void) if (ngroups < 0) perror_msg_and_fail(SYSCALL_NAME); - rc = syscall(SYSCALL_NR, (long) 0xffffffff00000000ULL, 0); + rc = syscall(SYSCALL_NR, F8ILL_KULONG_MASK, 0); printf("%s(0, NULL) = %ld\n", SYSCALL_NAME, rc); rc = syscall(SYSCALL_NR, -1U, 0); @@ -105,7 +86,7 @@ main(void) rc = syscall(SYSCALL_NR, ngroups_max, 0); printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, ngroups_max, sprintrc(rc)); - rc = syscall(SYSCALL_NR, (long) 0xffffffff00000000ULL | ngroups_max, 0); + rc = syscall(SYSCALL_NR, F8ILL_KULONG_MASK | ngroups_max, 0); printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, ngroups_max, sprintrc(rc)); /* check how the second argument is decoded */ diff --git a/tests/getgroups.gen.test b/tests/getgroups.gen.test new file mode 100755 index 00000000..ae196d05 --- /dev/null +++ b/tests/getgroups.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getgroups -a17 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests/getgroups.test b/tests/getgroups.test deleted file mode 100755 index 2eb3056d..00000000 --- a/tests/getgroups.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getgroups syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a17 diff --git a/tests/getgroups32.c b/tests/getgroups32.c index d0a356de..d005792d 100644 --- a/tests/getgroups32.c +++ b/tests/getgroups32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/getgroups32.gen.test b/tests/getgroups32.gen.test new file mode 100755 index 00000000..54b71d5f --- /dev/null +++ b/tests/getgroups32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getgroups32 -a19 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests/getgroups32.test b/tests/getgroups32.test deleted file mode 100755 index 12a8bcc0..00000000 --- a/tests/getgroups32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getgroups32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a19 diff --git a/tests/getpeername.c b/tests/getpeername.c index c842acec..cdc9ef08 100644 --- a/tests/getpeername.c +++ b/tests/getpeername.c @@ -1,30 +1,10 @@ /* * Check decoding of getpeername syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #define TEST_SYSCALL_NAME getpeername diff --git a/tests/getpeername.gen.test b/tests/getpeername.gen.test new file mode 100755 index 00000000..020583ab --- /dev/null +++ b/tests/getpeername.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getpeername -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests/getpeername.test b/tests/getpeername.test deleted file mode 100755 index 81f01bb1..00000000 --- a/tests/getpeername.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of getpeername syscall. - -. "${srcdir=.}/getsockname.test" diff --git a/tests/getpgrp.c b/tests/getpgrp.c index 8b9d0882..3d45f718 100644 --- a/tests/getpgrp.c +++ b/tests/getpgrp.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/getpgrp.gen.test b/tests/getpgrp.gen.test new file mode 100755 index 00000000..26989cdb --- /dev/null +++ b/tests/getpgrp.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getpgrp -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests/getpgrp.test b/tests/getpgrp.test deleted file mode 100755 index e116bb51..00000000 --- a/tests/getpgrp.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getpgrp syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 diff --git a/tests/getpid.c b/tests/getpid.c new file mode 100644 index 00000000..5e88e052 --- /dev/null +++ b/tests/getpid.c @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_getpid + +# include +# include + +int +main(void) +{ + printf("getpid() = %ld\n", syscall(__NR_getpid)); + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getpid") + +#endif diff --git a/tests/getpid.gen.test b/tests/getpid.gen.test new file mode 100755 index 00000000..2a3eb1cf --- /dev/null +++ b/tests/getpid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getpid -a9 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a9 diff --git a/tests/getppid.c b/tests/getppid.c new file mode 100644 index 00000000..718d0691 --- /dev/null +++ b/tests/getppid.c @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_getppid + +# include +# include + +int +main(void) +{ + printf("getppid() = %ld\n", syscall(__NR_getppid)); + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_getppid") + +#endif diff --git a/tests/getppid.gen.test b/tests/getppid.gen.test new file mode 100755 index 00000000..655b0b7d --- /dev/null +++ b/tests/getppid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getppid -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests/getrandom.c b/tests/getrandom.c index de1a0874..eb6cdb1b 100644 --- a/tests/getrandom.c +++ b/tests/getrandom.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/getrandom.gen.test b/tests/getrandom.gen.test new file mode 100755 index 00000000..2f5b9891 --- /dev/null +++ b/tests/getrandom.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getrandom -a32 -s3); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -s3 diff --git a/tests/getrandom.test b/tests/getrandom.test deleted file mode 100755 index ad34048f..00000000 --- a/tests/getrandom.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getrandom syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a32 -s3 diff --git a/tests/getresgid.c b/tests/getresgid.c index b8c687b1..3ad2c190 100644 --- a/tests/getresgid.c +++ b/tests/getresgid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/getresgid.gen.test b/tests/getresgid.gen.test new file mode 100755 index 00000000..dc32c62c --- /dev/null +++ b/tests/getresgid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getresgid -a25 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests/getresgid.test b/tests/getresgid.test deleted file mode 100755 index 9f5186e8..00000000 --- a/tests/getresgid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getresgid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a25 diff --git a/tests/getresgid32.c b/tests/getresgid32.c index 71f11344..b78afaed 100644 --- a/tests/getresgid32.c +++ b/tests/getresgid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/getresgid32.gen.test b/tests/getresgid32.gen.test new file mode 100755 index 00000000..0ee28299 --- /dev/null +++ b/tests/getresgid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getresgid32 -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests/getresgid32.test b/tests/getresgid32.test deleted file mode 100755 index a9798911..00000000 --- a/tests/getresgid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getresgid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests/getresugid.c b/tests/getresugid.c index 0ee721cf..b369f8f7 100644 --- a/tests/getresugid.c +++ b/tests/getresugid.c @@ -2,29 +2,10 @@ * Check decoding of getresuid/getresgid/getresuid32/getresgid32 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -34,9 +15,9 @@ int main(void) { - unsigned UGID_TYPE *const r = tail_alloc(sizeof(*r)); - unsigned UGID_TYPE *const e = tail_alloc(sizeof(*e)); - unsigned UGID_TYPE *const s = tail_alloc(sizeof(*s)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned UGID_TYPE, r); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned UGID_TYPE, e); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned UGID_TYPE, s); if (syscall(SYSCALL_NR, r, e, s)) perror_msg_and_fail(SYSCALL_NAME); diff --git a/tests/getresuid.c b/tests/getresuid.c index b00f20ba..5bb2e301 100644 --- a/tests/getresuid.c +++ b/tests/getresuid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/getresuid.gen.test b/tests/getresuid.gen.test new file mode 100755 index 00000000..b0f478ce --- /dev/null +++ b/tests/getresuid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getresuid -a25 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 diff --git a/tests/getresuid.test b/tests/getresuid.test deleted file mode 100755 index eee1ac05..00000000 --- a/tests/getresuid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getresuid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a25 diff --git a/tests/getresuid32.c b/tests/getresuid32.c index 4c9a83df..13acc695 100644 --- a/tests/getresuid32.c +++ b/tests/getresuid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/getresuid32.gen.test b/tests/getresuid32.gen.test new file mode 100755 index 00000000..1b2f232c --- /dev/null +++ b/tests/getresuid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getresuid32 -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests/getresuid32.test b/tests/getresuid32.test deleted file mode 100755 index fdc76a31..00000000 --- a/tests/getresuid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getresuid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests/getrlimit.c b/tests/getrlimit.c index bd9d0b0f..6d3b4cd5 100644 --- a/tests/getrlimit.c +++ b/tests/getrlimit.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/getrlimit.gen.test b/tests/getrlimit.gen.test new file mode 100755 index 00000000..08daf2d0 --- /dev/null +++ b/tests/getrlimit.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getrlimit -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests/getrlimit.test b/tests/getrlimit.test deleted file mode 100755 index 6fd88aed..00000000 --- a/tests/getrlimit.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of getrlimit syscall. - -. "${srcdir=.}/setrlimit.test" diff --git a/tests/getrusage.c b/tests/getrusage.c index 8b76eff6..412d8a00 100644 --- a/tests/getrusage.c +++ b/tests/getrusage.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2016 Fei Jie * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -35,27 +16,46 @@ # include # include # include +# include + +# include "xlat.h" +# include "xlat/usagewho.h" int -main(void) +invoke_print(int who, const char *who_str, struct rusage *usage) { - struct rusage *const usage = tail_alloc(sizeof(struct rusage)); - int rc = syscall(__NR_getrusage, RUSAGE_SELF, usage); - printf("getrusage(RUSAGE_SELF, {ru_utime={tv_sec=%jd, tv_usec=%jd}" - ", ru_stime={tv_sec=%jd, tv_usec=%jd}, ru_maxrss=%lu" + int rc = syscall(__NR_getrusage, who, usage); + int saved_errno = errno; + printf("getrusage(%s, {ru_utime={tv_sec=%lld, tv_usec=%llu}" + ", ru_stime={tv_sec=%lld, tv_usec=%llu}, ru_maxrss=%lu" ", ru_ixrss=%lu, ru_idrss=%lu, ru_isrss=%lu, ru_minflt=%lu" ", ru_majflt=%lu, ru_nswap=%lu, ru_inblock=%lu" ", ru_oublock=%lu, ru_msgsnd=%lu, ru_msgrcv=%lu" - ", ru_nsignals=%lu, ru_nvcsw=%lu, ru_nivcsw=%lu}) = %d\n", - (intmax_t) usage->ru_utime.tv_sec, - (intmax_t) usage->ru_utime.tv_usec, - (intmax_t) usage->ru_stime.tv_sec, - (intmax_t) usage->ru_stime.tv_usec, + ", ru_nsignals=%lu, ru_nvcsw=%lu, ru_nivcsw=%lu}) = %s\n", + who_str, + (long long) usage->ru_utime.tv_sec, + zero_extend_signed_to_ull(usage->ru_utime.tv_usec), + (long long) usage->ru_stime.tv_sec, + zero_extend_signed_to_ull(usage->ru_stime.tv_usec), usage->ru_maxrss, usage->ru_ixrss, usage->ru_idrss, usage->ru_isrss, usage->ru_minflt, usage->ru_majflt, usage->ru_nswap, usage->ru_inblock, usage->ru_oublock, usage->ru_msgsnd, usage->ru_msgrcv, usage->ru_nsignals, - usage->ru_nvcsw, usage->ru_nivcsw, rc); + usage->ru_nvcsw, usage->ru_nivcsw, sprintrc(rc)); + errno = saved_errno; + return rc; +} + +int +main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct rusage, usage); + if (invoke_print(ARG_STR(RUSAGE_SELF), usage)) { + perror_msg_and_fail("RUSAGE_SELF"); + } + if (invoke_print(ARG_STR(RUSAGE_THREAD), usage) && errno != EINVAL) { + perror_msg_and_fail("RUSAGE_THREAD"); + } puts("+++ exited with 0 +++"); return 0; diff --git a/tests/getrusage.gen.test b/tests/getrusage.gen.test new file mode 100755 index 00000000..161818aa --- /dev/null +++ b/tests/getrusage.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getrusage -v ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v diff --git a/tests/getrusage.test b/tests/getrusage.test deleted file mode 100755 index 4a3e8ed0..00000000 --- a/tests/getrusage.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getrusage syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v diff --git a/tests/getsid.c b/tests/getsid.c index b563de9d..588ea4ab 100644 --- a/tests/getsid.c +++ b/tests/getsid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include diff --git a/tests/getsid.gen.test b/tests/getsid.gen.test new file mode 100755 index 00000000..2b9084a4 --- /dev/null +++ b/tests/getsid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getsid -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests/getsid.test b/tests/getsid.test deleted file mode 100755 index 3fcf9799..00000000 --- a/tests/getsid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getsid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 diff --git a/tests/getsockname.c b/tests/getsockname.c index 66ac4e63..8883015c 100644 --- a/tests/getsockname.c +++ b/tests/getsockname.c @@ -1,30 +1,10 @@ /* * Check decoding of getsockname syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #define TEST_SYSCALL_NAME getsockname diff --git a/tests/getsockname.gen.test b/tests/getsockname.gen.test new file mode 100755 index 00000000..64cdeea8 --- /dev/null +++ b/tests/getsockname.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getsockname -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests/getsockname.test b/tests/getsockname.test deleted file mode 100755 index 99b28506..00000000 --- a/tests/getsockname.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of getsockname syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests/gettid.c b/tests/gettid.c new file mode 100644 index 00000000..24947e89 --- /dev/null +++ b/tests/gettid.c @@ -0,0 +1,19 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +int +main(void) +{ + printf("gettid() = %ld\n", syscall(__NR_gettid)); + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/gettid.gen.test b/tests/gettid.gen.test new file mode 100755 index 00000000..f5ad317e --- /dev/null +++ b/tests/gettid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (gettid -a9 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a9 diff --git a/tests/getuid.c b/tests/getuid.c index 57311f72..56f6c902 100644 --- a/tests/getuid.c +++ b/tests/getuid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/getuid.test b/tests/getuid.test index 9aaf74ba..a0bbb3ed 100755 --- a/tests/getuid.test +++ b/tests/getuid.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check getuid syscall decoding. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -9,4 +14,3 @@ run_prog > /dev/null run_strace -qq -a9 -e$NAME $args > "$EXP" uniq < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" -rm -f "$OUT" "$EXP" diff --git a/tests/getuid32.c b/tests/getuid32.c index 397dd08f..1222dbcb 100644 --- a/tests/getuid32.c +++ b/tests/getuid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/getuid32.gen.test b/tests/getuid32.gen.test new file mode 100755 index 00000000..e81eb064 --- /dev/null +++ b/tests/getuid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getuid32 +getuid.test ); do not edit. +set -- +. "${srcdir=.}/getuid.test" diff --git a/tests/getuid32.test b/tests/getuid32.test deleted file mode 100755 index ae0c557b..00000000 --- a/tests/getuid32.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check getuid32 syscall decoding. - -. "${srcdir=.}/getuid.test" diff --git a/tests/getxxid.c b/tests/getxxid.c index 6eee52c5..864cea5b 100644 --- a/tests/getxxid.c +++ b/tests/getxxid.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/getxxid.gen.test b/tests/getxxid.gen.test new file mode 100755 index 00000000..5aa89f65 --- /dev/null +++ b/tests/getxxid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (getxxid -a10 -e trace=getxpid,getxuid,getxgid); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 -e trace=getxpid,getxuid,getxgid diff --git a/tests/getxxid.test b/tests/getxxid.test deleted file mode 100755 index 9b89d7cf..00000000 --- a/tests/getxxid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getxpid, getxuid, and getxgid syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 -e trace=getxpid,getxuid,getxgid diff --git a/tests/group_req.c b/tests/group_req.c new file mode 100644 index 00000000..6a804bd2 --- /dev/null +++ b/tests/group_req.c @@ -0,0 +1,141 @@ +/* + * Check decoding of MCAST_JOIN_GROUP/MCAST_LEAVE_GROUP. + * + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2017-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include + +#if defined MCAST_JOIN_GROUP && defined MCAST_LEAVE_GROUP + +# include +# include +# include +# include +# include + +# define multi4addr "224.0.0.3" +# define multi6addr "ff01::c" + +static const char *errstr; + +static int +set_opt(const int fd, const int level, const int opt, + const void *const val, const socklen_t len) +{ + int rc = setsockopt(fd, level, opt, val, len); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct group_req, greq4); + TAIL_ALLOC_OBJECT_CONST_PTR(struct group_req, greq6); + unsigned int i; + + greq6->gr_interface = greq4->gr_interface = ifindex_lo(); + if (!greq4->gr_interface) + perror_msg_and_skip("lo"); + + greq4->gr_group.ss_family = AF_INET; + inet_pton(AF_INET, multi4addr, &greq4->gr_group.ss_family + 2); + + greq6->gr_group.ss_family = AF_INET6; + inet_pton(AF_INET6, multi6addr, &greq6->gr_group.ss_family + 4); + + (void) close(0); + if (socket(AF_INET, SOCK_DGRAM, 0)) + perror_msg_and_skip("socket"); + + struct { + const int level; + const char *const str_level; + const int name; + const char *const str_name; + const struct group_req *const val; + const char *const addr; + } opts[] = { + { + ARG_STR(SOL_IP), ARG_STR(MCAST_JOIN_GROUP), greq4, + "gr_group={sa_family=AF_INET, sin_port=htons(65535)" + ", sin_addr=inet_addr(\"" multi4addr "\")}" + }, + { + ARG_STR(SOL_IP), ARG_STR(MCAST_LEAVE_GROUP), greq4, + "gr_group={sa_family=AF_INET, sin_port=htons(65535)" + ", sin_addr=inet_addr(\"" multi4addr "\")}" + }, + { + ARG_STR(SOL_IPV6), ARG_STR(MCAST_JOIN_GROUP), greq6, + "gr_group={sa_family=AF_INET6, sin6_port=htons(65535)" + ", sin6_flowinfo=htonl(4294967295)" + ", inet_pton(AF_INET6, \"" multi6addr "\", &sin6_addr)" + ", sin6_scope_id=4294967295}" + }, + { + ARG_STR(SOL_IPV6), ARG_STR(MCAST_LEAVE_GROUP), greq6, + "gr_group={sa_family=AF_INET6, sin6_port=htons(65535)" + ", sin6_flowinfo=htonl(4294967295)" + ", inet_pton(AF_INET6, \"" multi6addr "\", &sin6_addr)" + ", sin6_scope_id=4294967295}" + } + }; + + for (i = 0; i < ARRAY_SIZE(opts); ++i) { + /* optlen < 0, EINVAL */ + set_opt(0, opts[i].level, opts[i].name, opts[i].val, -1U); + printf("setsockopt(0, %s, %s, %p, -1) = %s\n", + opts[i].str_level, opts[i].str_name, + opts[i].val, errstr); + + /* optlen < sizeof(struct group_req), EINVAL */ + set_opt(0, opts[i].level, opts[i].name, opts[i].val, + sizeof(*opts[i].val) - 1); + printf("setsockopt(0, %s, %s, %p, %u) = %s\n", + opts[i].str_level, opts[i].str_name, + opts[i].val, (unsigned int) sizeof(*opts[i].val) - 1, + errstr); + + /* optval EFAULT */ + set_opt(0, opts[i].level, opts[i].name, + (const char *) opts[i].val + 1, sizeof(*opts[i].val)); + printf("setsockopt(0, %s, %s, %p, %u) = %s\n", + opts[i].str_level, opts[i].str_name, + (const char *) opts[i].val + 1, + (unsigned int) sizeof(*opts[i].val), errstr); + + /* classic */ + set_opt(0, opts[i].level, opts[i].name, + opts[i].val, sizeof(*opts[i].val)); + printf("setsockopt(0, %s, %s" + ", {gr_interface=%s, %s}, %u) = %s\n", + opts[i].str_level, opts[i].str_name, + IFINDEX_LO_STR, opts[i].addr, + (unsigned int) sizeof(*opts[i].val), errstr); + + /* optlen > sizeof(struct group_req), shortened */ + set_opt(0, opts[i].level, opts[i].name, opts[i].val, INT_MAX); + printf("setsockopt(0, %s, %s" + ", {gr_interface=%s, %s}, %u) = %s\n", + opts[i].str_level, opts[i].str_name, + IFINDEX_LO_STR, opts[i].addr, + INT_MAX, errstr); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("MCAST_JOIN_GROUP && MCAST_LEAVE_GROUP") + +#endif diff --git a/tests/group_req.gen.test b/tests/group_req.gen.test new file mode 100755 index 00000000..0e753b6e --- /dev/null +++ b/tests/group_req.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (group_req -e trace=setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt diff --git a/tests/hexdump_strdup.c b/tests/hexdump_strdup.c index 4d6b53f4..d2b83448 100644 --- a/tests/hexdump_strdup.c +++ b/tests/hexdump_strdup.c @@ -1,30 +1,10 @@ /* * Make a hexdump copy of C string * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/hexquote_strndup.c b/tests/hexquote_strndup.c index 3ad3970c..bb1e101e 100644 --- a/tests/hexquote_strndup.c +++ b/tests/hexquote_strndup.c @@ -1,30 +1,10 @@ /* * Make a hexquoted copy of a string * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/ifindex.c b/tests/ifindex.c new file mode 100644 index 00000000..ae0eaa1f --- /dev/null +++ b/tests/ifindex.c @@ -0,0 +1,35 @@ +/* + * Proxy wrappers for if_nametoindex. + * + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_IF_INDEXTONAME + +# include + +unsigned int +ifindex_lo(void) +{ + static unsigned int index; + + if (!index) + index = if_nametoindex("lo"); + + return index; +} + +#else /* !HAVE_IF_INDEXTONAME */ + +unsigned int +ifindex_lo(void) +{ + return 1; +} + +#endif diff --git a/tests/inet-cmsg.c b/tests/inet-cmsg.c index b530016d..44ae4c64 100644 --- a/tests/inet-cmsg.c +++ b/tests/inet-cmsg.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -38,9 +19,10 @@ static void print_pktinfo(const struct cmsghdr *c) { - printf("IP_PKTINFO, cmsg_data={ipi_ifindex=if_nametoindex(\"lo\")" - ", ipi_spec_dst=inet_addr(\"127.0.0.1\")" - ", ipi_addr=inet_addr(\"127.0.0.1\")}"); + printf("IP_PKTINFO, cmsg_data={ipi_ifindex=%s" + ", ipi_spec_dst=inet_addr(\"%s\")" + ", ipi_addr=inet_addr(\"%s\")}", + IFINDEX_LO_STR, "127.0.0.1", "127.0.0.1"); } static void diff --git a/tests/inet-cmsg.gen.test b/tests/inet-cmsg.gen.test new file mode 100755 index 00000000..8eeb7c90 --- /dev/null +++ b/tests/inet-cmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (inet-cmsg -e trace=recvmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=recvmsg diff --git a/tests/inet-cmsg.test b/tests/inet-cmsg.test deleted file mode 100755 index 52ff5f59..00000000 --- a/tests/inet-cmsg.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check IPPROTO_IP control messages decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=recvmsg diff --git a/tests/init.sh b/tests/init.sh index f368b98a..40e62188 100644 --- a/tests/init.sh +++ b/tests/init.sh @@ -1,35 +1,16 @@ #!/bin/sh # # Copyright (c) 2011-2016 Dmitry V. Levin +# Copyright (c) 2011-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later +export LC_ALL=C ME_="${0##*/}" -LOG="$ME_.tmp" -OUT="$LOG.out" -EXP="$LOG.exp" -NAME="${ME_%.test}" +LOG="log" +OUT="out" +EXP="exp" warn_() { printf >&2 '%s\n' "$*"; } fail_() { warn_ "$ME_: failed test: $*"; exit 1; } @@ -45,14 +26,14 @@ check_prog() dump_log_and_fail_with() { - cat < "$LOG" + cat < "$LOG" >&2 fail_ "$*" } run_prog() { if [ $# -eq 0 ]; then - set -- "./$NAME" + set -- "../$NAME" fi args="$*" "$@" || { @@ -72,6 +53,20 @@ run_prog_skip_if_failed() "$@" || framework_skip_ "$args failed with code $?" } +try_run_prog() +{ + local rc + + "$@" > /dev/null || { + rc=$? + if [ $rc -eq 77 ]; then + return 1 + else + fail_ "$* failed with code $rc" + fi + } +} + run_strace() { > "$LOG" || fail_ "failed to write $LOG" @@ -155,7 +150,7 @@ match_diff() check_prog diff - diff -- "$expected" "$output" || + diff -u -- "$expected" "$output" || fail_ "$error" } @@ -213,7 +208,17 @@ run_strace_match_diff() run_prog > /dev/null run_strace "$@" $args > "$EXP" match_diff "$LOG" "$EXP" - rm -f "$EXP" +} + +# Usage: run_strace_match_grep [args to run_strace] +run_strace_match_grep() +{ + args="$*" + [ -n "$args" -a -z "${args##*-e trace=*}" ] || + set -- -e trace="$NAME" "$@" + run_prog > /dev/null + run_strace "$@" $args > "$EXP" + match_grep "$LOG" "$EXP" } # Print kernel version code. @@ -223,7 +228,7 @@ kernel_version_code() ( set -f IFS=. - set -- $1 + set -- $1 0 0 v1="${1%%[!0-9]*}" && [ -n "$v1" ] || v1=0 v2="${2%%[!0-9]*}" && [ -n "$v2" ] || v2=0 v3="${3%%[!0-9]*}" && [ -n "$v3" ] || v3=0 @@ -250,22 +255,117 @@ grep_pid_status() cat < "/proc/$pid/status" | grep "$@" } +# Subtracts one program set from another. +# If an optional regular expression is specified, the lines in the minuend file +# that match this regular expression are elso excluded from the output. +# +# Usage: prog_set_subtract minuend_file subtrahend_file [subtrahend_regexp] +prog_set_subtract() +{ + local min sub re pat + min="$1"; shift + sub="$1"; shift + re="${1-}" + pat="$re|$(sed 's/[[:space:]].*//' < "$sub" | tr -s '\n' '|')" + grep -E -v -x -e "$pat" < "$min" +} + +# Usage: test_pure_prog_set [--expfile FILE] COMMON_ARGS < tests_file +# stdin should consist of lines in "test_name strace_args..." format. +test_pure_prog_set() +{ + local expfile + + expfile="$EXP" + + while [ -n "$1" ]; do + case "$1" in + --expfile) + shift + expfile="$1" + shift + ;; + *) + break + ;; + esac + done + + while read -r t prog_args; do { + # skip lines beginning with "#" symbol + [ "${t###}" = "$t" ] || continue + + try_run_prog "../$t" || continue + run_strace $prog_args "$@" "../$t" > "$expfile" + match_diff "$LOG" "$expfile" + } < /dev/null; done +} + +# Run strace against list of programs put in "$NAME.in" and then against the +# rest of pure_executables.list with the expectation of empty output in the +# latter case. +# +# Usage: source this file after init.sh and call: +# test_trace_expr subtrahend_regexp strace_args +# Environment: +# $NAME: test name, used for "$NAME.in" file containing list of tests +# for positive trace expression match; +# $srcdir: used to find pure_executables.list and "$NAME.in" files. +# Files created: +# negative.list: File containing list of tests for negative match. +test_trace_expr() +{ + local subtrahend_regexp + subtrahend_regexp="$1"; shift + test_pure_prog_set "$@" < "$srcdir/$NAME.in" + prog_set_subtract "$srcdir/pure_executables.list" "$srcdir/$NAME.in" \ + "$subtrahend_regexp" > negative.list + test_pure_prog_set --expfile /dev/null -qq -esignal=none "$@" \ + < negative.list +} + check_prog cat check_prog rm -rm -f "$LOG" +case "$ME_" in + *.gen.test) NAME="${ME_%.gen.test}" ;; + *.test) NAME="${ME_%.test}" ;; + *) NAME= +esac + +STRACE_EXE= +if [ -n "$NAME" ]; then + TESTDIR="$NAME.dir" + rm -rf -- "$TESTDIR" + mkdir -- "$TESTDIR" + cd "$TESTDIR" + + case "$srcdir" in + /*) ;; + *) srcdir="../$srcdir" ;; + esac -[ -n "${STRACE-}" ] || { - STRACE=../strace - case "${LOG_COMPILER-} ${LOG_FLAGS-}" in - *--suppressions=*--error-exitcode=*--tool=*) + [ -n "${STRACE-}" ] || { + STRACE=../../strace + case "${LOG_COMPILER-} ${LOG_FLAGS-}" in + *--suppressions=*--error-exitcode=*--tool=*) + STRACE_EXE="$STRACE" # add valgrind command prefix STRACE="${LOG_COMPILER-} ${LOG_FLAGS-} $STRACE" ;; - esac -} + esac + } + + trap 'dump_log_and_fail_with "time limit ($TIMEOUT_DURATION) exceeded"' XCPU +else + : "${STRACE:=../strace}" +fi + +# Export $STRACE_EXE to check_PROGRAMS. +: "${STRACE_EXE:=$STRACE}" +export STRACE_EXE -: "${TIMEOUT_DURATION:=60}" +: "${TIMEOUT_DURATION:=600}" : "${SLEEP_A_BIT:=sleep 1}" [ -z "${VERBOSE-}" ] || diff --git a/tests/init_delete_module.h b/tests/init_delete_module.h index db550c33..85a4a396 100644 --- a/tests/init_delete_module.h +++ b/tests/init_delete_module.h @@ -3,33 +3,14 @@ * and delete_module tests. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef STRACE_TESTS_INIT_DELETE_MODULE_H -#define STRACE_TESTS_INIT_DELETE_MODULE_H +# define STRACE_TESTS_INIT_DELETE_MODULE_H # include # include @@ -42,9 +23,6 @@ enum { MAX_STRLEN = 32, }; -static const kernel_ulong_t bogus_zero = - (kernel_ulong_t) 0xffffffff00000000ULL; - static void print_str(unsigned int base, unsigned int len, bool escape) { diff --git a/tests/init_module.c b/tests/init_module.c index 88ef9ec8..601f7f92 100644 --- a/tests/init_module.c +++ b/tests/init_module.c @@ -2,29 +2,10 @@ * Check decoding of init_module syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -55,9 +36,9 @@ main(void) fill_memory_ex(bogus_param1, PARAM1_LEN, PARAM1_BASE, PARAM1_LEN); fill_memory_ex(bogus_param2, PARAM2_LEN, PARAM2_BASE, PARAM2_LEN); - rc = syscall(__NR_init_module, NULL, bogus_zero, NULL); + rc = syscall(__NR_init_module, NULL, F8ILL_KULONG_MASK, NULL); printf("init_module(NULL, %llu, NULL) = %s\n", - (unsigned long long) bogus_zero, sprintrc(rc)); + (unsigned long long) F8ILL_KULONG_MASK, sprintrc(rc)); rc = syscall(__NR_init_module, bogus_addr, 0, bogus_param1); errstr = sprintrc(rc); diff --git a/tests/init_module.gen.test b/tests/init_module.gen.test new file mode 100755 index 00000000..b6961be6 --- /dev/null +++ b/tests/init_module.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (init_module -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests/init_module.test b/tests/init_module.test deleted file mode 100755 index ef7c7325..00000000 --- a/tests/init_module.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of init_module syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests/inject-nf.c b/tests/inject-nf.c new file mode 100644 index 00000000..b419984f --- /dev/null +++ b/tests/inject-nf.c @@ -0,0 +1,66 @@ +/* + * Check decoding of return values injected into a syscall that "never fails". + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include + +#include "raw_syscall.h" + +#ifdef __alpha__ +/* alpha has no getpid */ +# define SC_NR __NR_getpgrp +# define SC_NAME "getpgrp" +# define getpid getpgrp +#else +# define SC_NR __NR_getpid +# define SC_NAME "getpid" +#endif + +#ifdef raw_syscall_0 +# define INVOKE_SC(err) raw_syscall_0(SC_NR, &err) +#else +/* No raw_syscall_0, let's use getpid() and hope for the best. */ +# define INVOKE_SC(err) getpid() +#endif + +/* + * This prototype is intentionally different + * from the prototype provided by . + */ +extern kernel_ulong_t getpid(void); + +int +main(int ac, char **av) +{ + assert(ac == 1 || ac == 2); + + kernel_ulong_t expected = + (ac == 1) ? getpid() : strtoull(av[1], NULL, 0); + kernel_ulong_t err = 0; + kernel_ulong_t rc = INVOKE_SC(err); + + if (err || rc != expected) + error_msg_and_fail("expected %#llx, got rval=%#llx err=%#llx", + (unsigned long long) expected, + (unsigned long long) rc, + (unsigned long long) err); + + if (ac == 2) { + printf("%s() = %llu (INJECTED)\n", + SC_NAME, (unsigned long long) rc); + + puts("+++ exited with 0 +++"); + } + + return 0; +} diff --git a/tests/inject-nf.test b/tests/inject-nf.test new file mode 100755 index 00000000..cadb5adb --- /dev/null +++ b/tests/inject-nf.test @@ -0,0 +1,55 @@ +#!/bin/sh -efu +# +# Check decoding of return values injected into a syscall that "never fails". +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +case "$STRACE_ARCH" in +alpha) + SYSCALL=getpgrp + ;; +*) + SYSCALL=getpid + ;; +esac + +run_prog +prog="$args" +fault_args="-a9 -e trace=${SYSCALL} -e inject=${SYSCALL}:retval=" + +test_rval() +{ + local rval + rval="$1"; shift + + run_strace $fault_args$rval $prog $rval > "$EXP" + match_diff "$LOG" "$EXP" +} + +test_rval 0 +test_rval 1 +test_rval 0x7fffffff +test_rval 0x80000000 +test_rval 0xfffff000 +test_rval 0xfffffffe +test_rval 0xffffffff + +case "$SIZEOF_KERNEL_LONG_T" in +8) + test_rval 0x80000000 + test_rval 0xfffff000 + test_rval 0xfffffffe + test_rval 0xffffffff + test_rval 0x100000000 + test_rval 0x7fffffffffffffff + test_rval 0x8000000000000000 + test_rval 0xfffffffffffff000 + test_rval 0xfffffffffffffffe + test_rval 0xffffffffffffffff + ;; +esac diff --git a/tests/inode_of_sockfd.c b/tests/inode_of_sockfd.c index b227f306..b9ad78ee 100644 --- a/tests/inode_of_sockfd.c +++ b/tests/inode_of_sockfd.c @@ -2,38 +2,19 @@ * This file is part of strace test suite. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include +#include #include #include #include #include -#include unsigned long inode_of_sockfd(const int fd) diff --git a/tests/inotify.c b/tests/inotify.c index 925d69ff..db751d4e 100644 --- a/tests/inotify.c +++ b/tests/inotify.c @@ -2,29 +2,10 @@ * Check decoding of inotify_add_watch and inotify_rm_watch syscalls. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -52,8 +33,8 @@ main(void) static const char *bogus_mask_str = "IN_ACCESS|IN_ATTRIB|" "IN_CLOSE_WRITE|IN_OPEN|IN_MOVED_TO|IN_DELETE|IN_DELETE_SELF|" "IN_MOVE_SELF|IN_Q_OVERFLOW|IN_IGNORED|IN_ONLYDIR|" - "IN_DONT_FOLLOW|IN_EXCL_UNLINK|IN_MASK_ADD|IN_ISDIR|IN_ONESHOT|" - "0x18ff1000"; + "IN_DONT_FOLLOW|IN_EXCL_UNLINK|IN_MASK_CREATE|IN_MASK_ADD|" + "IN_ISDIR|IN_ONESHOT|0x8ff1000"; long rc; char *bogus_path = tail_memdup(bogus_path_str.path, diff --git a/tests/inotify.gen.test b/tests/inotify.gen.test new file mode 100755 index 00000000..70102065 --- /dev/null +++ b/tests/inotify.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (inotify -a23 -e trace=inotify_add_watch,inotify_rm_watch); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 -e trace=inotify_add_watch,inotify_rm_watch diff --git a/tests/inotify.test b/tests/inotify.test deleted file mode 100755 index 436f3bc8..00000000 --- a/tests/inotify.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of inotify_add_watch and inotify_rm_watch syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=inotify_add_watch,inotify_rm_watch -a23 diff --git a/tests/inotify_init1.c b/tests/inotify_init1.c index 0325150d..4f352b70 100644 --- a/tests/inotify_init1.c +++ b/tests/inotify_init1.c @@ -2,29 +2,10 @@ * Check decoding of inotify_init1 syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/inotify_init1.gen.test b/tests/inotify_init1.gen.test new file mode 100755 index 00000000..a1060c5d --- /dev/null +++ b/tests/inotify_init1.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (inotify_init1 -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests/inotify_init1.test b/tests/inotify_init1.test deleted file mode 100755 index 1a7c9261..00000000 --- a/tests/inotify_init1.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of inotify_init1 syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests/int_0x80.c b/tests/int_0x80.c new file mode 100644 index 00000000..abdc94a7 --- /dev/null +++ b/tests/int_0x80.c @@ -0,0 +1,32 @@ +/* + * Check decoding of int 0x80 on x86_64, x32, and x86. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#if defined __x86_64__ || defined __i386__ + +# include +# include + +int +main(void) +{ + /* 200 is __NR_getgid32 on x86 and __NR_tkill on x86_64. */ + __asm__("movl $200, %eax; int $0x80"); + printf("getgid32() = %d\n", getegid()); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__x86_64__ || __i386__") + +#endif diff --git a/tests/int_0x80.test b/tests/int_0x80.test new file mode 100755 index 00000000..6b3ca25f --- /dev/null +++ b/tests/int_0x80.test @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Check decoding of int 0x80 on x86_64, x32, and x86. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +$STRACE -d -enone / > /dev/null 2> "$LOG" +grep -x "[^:]*strace: PTRACE_GET_SYSCALL_INFO works" "$LOG" > /dev/null || + skip_ 'PTRACE_GET_SYSCALL_INFO does not work' + +run_strace_match_diff -a11 -e trace=getgid32 diff --git a/tests/interactive_block.test b/tests/interactive_block.test new file mode 100755 index 00000000..57df767a --- /dev/null +++ b/tests/interactive_block.test @@ -0,0 +1,20 @@ +#!/bin/sh +# +# Check that in interactive mode those signals that were blocked +# at strace startup will remain blocked. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +strace0="$STRACE" +for signo in 1 2 3 13 14 15; do + blocksig="../block_reset_raise_run $signo" + run_prog $blocksig ../umovestr + STRACE="$blocksig $strace0" + run_strace -I2 -echdir ../umovestr + match_diff "$LOG" "$srcdir/umovestr.expected" +done diff --git a/tests/io_uring_enter.c b/tests/io_uring_enter.c new file mode 100644 index 00000000..3284ebac --- /dev/null +++ b/tests/io_uring_enter.c @@ -0,0 +1,83 @@ +/* + * Check decoding of io_uring_enter syscall. + * + * Copyright (c) 2019 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include "scno.h" + +#ifdef __NR_io_uring_enter + +# include +# include +# include +# include + +static const char *errstr; + +static long +sys_io_uring_enter(unsigned int fd, unsigned int to_submit, + unsigned int min_complete, unsigned int flags, + const void *sigset_addr, kernel_ulong_t sigset_size) + +{ + kernel_ulong_t fill = (kernel_ulong_t) 0xdefaced00000000ULL; + kernel_ulong_t arg1 = fill | fd; + kernel_ulong_t arg2 = fill | to_submit; + kernel_ulong_t arg3 = fill | min_complete; + kernel_ulong_t arg4 = fill | flags; + kernel_ulong_t arg5 = (unsigned long) sigset_addr; + kernel_ulong_t arg6 = sigset_size; + + long rc = syscall(__NR_io_uring_enter, + arg1, arg2, arg3, arg4, arg5, arg6); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const char path[] = "/dev/null"; + + skip_if_unavailable("/proc/self/fd/"); + + int fd = open(path, O_RDONLY); + if (fd < 0) + perror_msg_and_fail("open: %s", path); + + const unsigned int size = get_sigset_size(); + void *const sigmask = tail_alloc(size); + sigset_t mask; + + memset(&mask, -1, sizeof(mask)); + sigdelset(&mask, SIGHUP); + sigdelset(&mask, SIGKILL); + sigdelset(&mask, SIGSTOP); + memcpy(sigmask, &mask, size); + + const unsigned int to_submit = 0xdeadbeef; + const unsigned int min_complete = 0xcafef00d; + + sys_io_uring_enter(fd, to_submit, min_complete, -1U, sigmask, size); + printf("io_uring_enter(%u<%s>, %u, %u" + ", IORING_ENTER_GETEVENTS|IORING_ENTER_SQ_WAKEUP|%#x" + ", %s, %u) = %s\n", + fd, path, to_submit, min_complete, -1U - 3, + "~[HUP KILL STOP]", size, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_io_uring_enter") + +#endif diff --git a/tests/io_uring_enter.gen.test b/tests/io_uring_enter.gen.test new file mode 100755 index 00000000..7e68909e --- /dev/null +++ b/tests/io_uring_enter.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (io_uring_enter -y ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -y diff --git a/tests/io_uring_register.c b/tests/io_uring_register.c new file mode 100644 index 00000000..a0327ed8 --- /dev/null +++ b/tests/io_uring_register.c @@ -0,0 +1,100 @@ +/* + * Check decoding of io_uring_register syscall. + * + * Copyright (c) 2019 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include "scno.h" + +#ifdef __NR_io_uring_register + +# include +# include +# include +# include + +static const char *errstr; + +static long +sys_io_uring_register(unsigned int fd, unsigned int opcode, + const void *arg, unsigned int nargs) + +{ + kernel_ulong_t fill = (kernel_ulong_t) 0xdefaced00000000ULL; + kernel_ulong_t bad = (kernel_ulong_t) 0xbadc0dedbadc0dedULL; + kernel_ulong_t arg1 = fill | fd; + kernel_ulong_t arg2 = fill | opcode; + kernel_ulong_t arg3 = (unsigned long) arg; + kernel_ulong_t arg4 = fill | nargs; + + long rc = syscall(__NR_io_uring_register, + arg1, arg2, arg3, arg4, bad, bad); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const char path_null[] = "/dev/null"; + static const char path_full[] = "/dev/full"; + const struct iovec iov[] = { + { + .iov_base = (void *) (unsigned long) 0xfacefeedcafef00d, + .iov_len = (unsigned long) 0xdeadfacebeefcafe + }, + { + .iov_base = (void *) path_null, + .iov_len = sizeof(path_null) + } + }; + const struct iovec *arg_iov = tail_memdup(iov, sizeof(iov)); + + skip_if_unavailable("/proc/self/fd/"); + + int fd_null = open(path_null, O_RDONLY); + if (fd_null < 0) + perror_msg_and_fail("open: %s", path_null); + + int fd_full = open(path_full, O_RDONLY); + if (fd_full < 0) + perror_msg_and_fail("open: %s", path_null); + + int fds[] = { fd_full, fd_null }; + const int *arg_fds = tail_memdup(fds, sizeof(fds)); + + sys_io_uring_register(fd_null, 0xbadc0ded, path_null, 0xdeadbeef); + printf("io_uring_register(%u<%s>, %#x /* IORING_REGISTER_??? */" + ", %p, %u) = %s\n", + fd_null, path_null, 0xbadc0ded, path_null, 0xdeadbeef, errstr); + + sys_io_uring_register(fd_null, 0, arg_iov, ARRAY_SIZE(iov)); + printf("io_uring_register(%u<%s>, IORING_REGISTER_BUFFERS" + ", [{iov_base=%p, iov_len=%lu}, {iov_base=%p, iov_len=%lu}]" + ", %u) = %s\n", + fd_null, path_null, iov[0].iov_base, + (unsigned long) iov[0].iov_len, + iov[1].iov_base, (unsigned long) iov[1].iov_len, + (unsigned int) ARRAY_SIZE(iov), errstr); + + sys_io_uring_register(fd_null, 2, arg_fds, ARRAY_SIZE(fds)); + printf("io_uring_register(%u<%s>, IORING_REGISTER_FILES" + ", [%u<%s>, %u<%s>], %u) = %s\n", + fd_null, path_null, fd_full, path_full, fd_null, path_null, + (unsigned int) ARRAY_SIZE(fds), errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_io_uring_register") + +#endif diff --git a/tests/io_uring_register.gen.test b/tests/io_uring_register.gen.test new file mode 100755 index 00000000..b3fda203 --- /dev/null +++ b/tests/io_uring_register.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (io_uring_register -y ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -y diff --git a/tests/io_uring_setup.c b/tests/io_uring_setup.c new file mode 100644 index 00000000..f48095bb --- /dev/null +++ b/tests/io_uring_setup.c @@ -0,0 +1,103 @@ +/* + * Check decoding of io_uring_setup syscall. + * + * Copyright (c) 2019 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include "scno.h" + +#if defined HAVE_LINUX_IO_URING_H && defined __NR_io_uring_setup + +# include +# include +# include +# include + +# include "print_fields.h" + +static const char *errstr; + +static long +sys_io_uring_setup(uint32_t nentries, const void *params) +{ + kernel_ulong_t fill = (kernel_ulong_t) 0xdefaced00000000ULL; + kernel_ulong_t bad = (kernel_ulong_t) 0xbadc0dedbadc0dedULL; + kernel_ulong_t arg1 = fill | nentries; + kernel_ulong_t arg2 = (unsigned long) params; + + long rc = syscall(__NR_io_uring_setup, arg1, arg2, bad, bad, bad, bad); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + long rc; + TAIL_ALLOC_OBJECT_CONST_PTR(struct io_uring_params, params); + const void *efault = (const void *) params + 1; + + skip_if_unavailable("/proc/self/fd/"); + + sys_io_uring_setup(-1U, NULL); + printf("io_uring_setup(%u, NULL) = %s\n", -1U, errstr); + + sys_io_uring_setup(0, efault); + printf("io_uring_setup(%u, %p) = %s\n", 0, efault, errstr); + + fill_memory(params, sizeof(*params)); + params->flags = -1; + sys_io_uring_setup(1, params); + printf("io_uring_setup(%u, {flags=IORING_SETUP_IOPOLL" + "|IORING_SETUP_SQPOLL|IORING_SETUP_SQ_AFF|%#x" + ", sq_thread_cpu=%#x, sq_thread_idle=%u, resv={", + 1, -1U - 7, params->sq_thread_cpu, params->sq_thread_idle); + for (unsigned int i = 0; i < ARRAY_SIZE(params->resv); ++i) + printf("%s%#x", i ? ", " : "", params->resv[i]); + printf("}}) = %s\n", errstr); + + memset(params, 0, sizeof(*params)); + rc = sys_io_uring_setup(2, params); + printf("io_uring_setup(%u, {flags=0, sq_thread_cpu=0" + ", sq_thread_idle=0", 2); + if (rc < 0) + printf("}) = %s\n", errstr); + else + printf(", sq_entries=%u, cq_entries=%u" + ", sq_off={head=%u, tail=%u, ring_mask=%u" + ", ring_entries=%u, flags=%u, dropped=%u, array=%u}" + ", cq_off={head=%u, tail=%u, ring_mask=%u" + ", ring_entries=%u, overflow=%u, cqes=%u}" + "}) = %ld\n", + params->sq_entries, + params->cq_entries, + params->sq_off.head, + params->sq_off.tail, + params->sq_off.ring_mask, + params->sq_off.ring_entries, + params->sq_off.flags, + params->sq_off.dropped, + params->sq_off.array, + params->cq_off.head, + params->cq_off.tail, + params->cq_off.ring_mask, + params->cq_off.ring_entries, + params->cq_off.overflow, + params->cq_off.cqes, + rc); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_IO_URING_H && __NR_io_uring_setup") + +#endif diff --git a/tests/io_uring_setup.gen.test b/tests/io_uring_setup.gen.test new file mode 100755 index 00000000..bec63a8a --- /dev/null +++ b/tests/io_uring_setup.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (io_uring_setup -a26 -y); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a26 -y diff --git a/tests/ioctl.c b/tests/ioctl.c index 92a3191d..ec4e3670 100644 --- a/tests/ioctl.c +++ b/tests/ioctl.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -53,16 +34,16 @@ && defined EV_KEY int -main(void ) +main(void) { uint64_t data = 0; -#ifndef POWERPC +# ifndef POWERPC struct termios tty; (void) ioctl(-1, TCGETS, &tty); printf("ioctl(-1, TCGETS, %p)" " = -1 EBADF (%m)\n", &tty); -#endif +# endif (void) ioctl(-1, MMTIMER_GETRES, &data); printf("ioctl(-1, MMTIMER_GETRES, %p)" @@ -85,8 +66,13 @@ main(void ) " = -1 EBADF (%m)\n", &data); (void) ioctl(-1, _IOR('M', 13, int), &data); +# ifdef HAVE_STRUCT_MTD_WRITE_REQ printf("ioctl(-1, MIXER_READ(13) or OTPSELECT, [MTD_OTP_OFF])" " = -1 EBADF (%m)\n"); +# else + printf("ioctl(-1, MIXER_READ(13) or OTPSELECT, %p)" + " = -1 EBADF (%m)\n", &data); +# endif (void) ioctl(-1, _IOC(_IOC_WRITE, 0xde, 0, 0), (kernel_ulong_t) -1ULL); printf("ioctl(-1, _IOC(_IOC_WRITE, 0xde, 0, 0), %#lx)" diff --git a/tests/ioctl.test b/tests/ioctl.test index 94bc5d42..5e11f589 100755 --- a/tests/ioctl.test +++ b/tests/ioctl.test @@ -1,15 +1,16 @@ #!/bin/sh - +# # Check ioctl syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog > /dev/null -run_strace -a16 -eioctl $args > "$EXP" check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" +run_prog > /dev/null +run_strace -a16 -eioctl "$@" $args > "$EXP" +grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" - -exit 0 diff --git a/tests/ioctl_block.c b/tests/ioctl_block.c index f62b0b36..65f434c8 100644 --- a/tests/ioctl_block.c +++ b/tests/ioctl_block.c @@ -2,29 +2,10 @@ * This file is part of ioctl_block strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -57,9 +38,11 @@ static struct xlat block_argless[] = { #endif }; -#define TEST_NULL_ARG(cmd) \ - ioctl(-1, cmd, 0); \ - printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd) +#define TEST_NULL_ARG(cmd) \ + do { \ + ioctl(-1, cmd, 0); \ + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd); \ + } while (0) int main(void) @@ -113,7 +96,7 @@ main(void) ioctl(-1, BLKFRASET, lmagic); printf("ioctl(-1, BLKFRASET, %lu) = -1 EBADF (%m)\n", lmagic); - int *const val_int = tail_alloc(sizeof(*val_int)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, val_int); *val_int = magic; ioctl(-1, BLKROSET, val_int); @@ -144,19 +127,19 @@ main(void) " = -1 EBADF (%m)\n", pair_int64[0], pair_int64[1]); #endif - struct blkpg_ioctl_arg *const blkpg = tail_alloc(sizeof(*blkpg)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct blkpg_ioctl_arg, blkpg); blkpg->op = 3; blkpg->flags = 0xdeadbeef; blkpg->datalen = 0xbadc0ded; blkpg->data = (void *) (unsigned long) 0xcafef00dfffffeedULL; ioctl(-1, BLKPG, blkpg); - printf("ioctl(-1, BLKPG, {%s, flags=%d, datalen=%d" + printf("ioctl(-1, BLKPG, {op=%s, flags=%d, datalen=%d" ", data=%#lx}) = -1 EBADF (%m)\n", "BLKPG_RESIZE_PARTITION", blkpg->flags, blkpg->datalen, (unsigned long) blkpg->data); - struct blkpg_partition *const bp = tail_alloc(sizeof(*bp)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct blkpg_partition, bp); bp->start = 0xfac1fed2dad3bef4ULL; bp->length = 0xfac5fed6dad7bef8ULL; bp->pno = magic; @@ -166,9 +149,9 @@ main(void) blkpg->data = bp; ioctl(-1, BLKPG, blkpg); - printf("ioctl(-1, BLKPG, {%s, flags=%d, datalen=%d" + printf("ioctl(-1, BLKPG, {op=%s, flags=%d, datalen=%d" ", data={start=%lld, length=%lld, pno=%d" - ", devname=\"%.*s\", volname=\"%.*s\"}})" + ", devname=\"%.*s\"..., volname=\"%.*s\"...}})" " = -1 EBADF (%m)\n", "BLKPG_ADD_PARTITION", blkpg->flags, blkpg->datalen, @@ -177,7 +160,7 @@ main(void) (int) sizeof(bp->volname) - 1, bp->volname); #if defined BLKTRACESETUP && defined HAVE_STRUCT_BLK_USER_TRACE_SETUP - struct blk_user_trace_setup *const buts = tail_alloc(sizeof(*buts)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct blk_user_trace_setup, buts); fill_memory(buts, sizeof(*buts)); ioctl(-1, BLKTRACESETUP, buts); diff --git a/tests/ioctl_block.gen.test b/tests/ioctl_block.gen.test new file mode 100755 index 00000000..8b2c3df6 --- /dev/null +++ b/tests/ioctl_block.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_block +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_block.test b/tests/ioctl_block.test deleted file mode 100755 index 0bf2500f..00000000 --- a/tests/ioctl_block.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of BLK* ioctls. - -. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_dm-v.gen.test b/tests/ioctl_dm-v.gen.test new file mode 100755 index 00000000..66fa5856 --- /dev/null +++ b/tests/ioctl_dm-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_dm-v +ioctl.test -v -s9); do not edit. +set -- -v -s9 +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_dm-v.test b/tests/ioctl_dm-v.test deleted file mode 100755 index ade3b9e8..00000000 --- a/tests/ioctl_dm-v.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check unabbreviated decoding of DM* ioctls. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a16 -s9 -veioctl $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests/ioctl_dm.c b/tests/ioctl_dm.c index 08f036c6..f05528f9 100644 --- a/tests/ioctl_dm.c +++ b/tests/ioctl_dm.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Mikulas Patocka * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -34,7 +15,6 @@ # include # include -# include # include # include # include @@ -53,6 +33,10 @@ # define ALIGNED_OFFSET(t_, m_) \ ALIGNED_SIZE(offsetof(t_, m_), t_) +# ifndef DM_DEV_ARM_POLL +# define DM_DEV_ARM_POLL _IOWR(DM_IOCTL, 0x10, struct dm_ioctl) +# endif + static const char str129[] = STR32 STR32 STR32 STR32 "6"; static const __u64 dts_sector_base = (__u64) 0xdeadca75facef157ULL; @@ -138,7 +122,7 @@ init_dm_target_spec(struct dm_target_spec *ptr, uint32_t id) ptr->length = dts_length_base + dts_length_step * id; ptr->status = dts_status_base + dts_status_step * id; - strncpy(ptr->target_type, str129 + + memcpy(ptr->target_type, str129 + id % (sizeof(str129) - sizeof(ptr->target_type)), id % (sizeof(ptr->target_type) + 1)); if (id % (sizeof(ptr->target_type) + 1) < sizeof(ptr->target_type)) @@ -181,6 +165,7 @@ main(void) { ARG_STR(DM_TABLE_CLEAR), false }, { ARG_STR(DM_TABLE_DEPS), true }, { ARG_STR(DM_TABLE_STATUS), true }, + { ARG_STR(DM_DEV_ARM_POLL), false }, }; struct dm_ioctl *unaligned_dm_arg = @@ -234,23 +219,23 @@ main(void) dm_arg->version[1] = 0xbadc0dee; dm_arg->version[2] = 0xbadc0def; ioctl(-1, DM_VERSION, dm_arg); - printf("ioctl(-1, DM_VERSION, {version=%u.%u.%u, " - "/* Unsupported device mapper ABI version */ ...}) = " + printf("ioctl(-1, DM_VERSION, {version=%u.%u.%u" + " /* unsupported device mapper ABI version */}) = " "-1 EBADF (%m)\n", 0xbadc0ded, 0xbadc0dee, 0xbadc0def); /* Incorrect data_size */ init_s(dm_arg, 14, 64); ioctl(-1, DM_VERSION, dm_arg); - printf("ioctl(-1, DM_VERSION, {version=4.1.2, data_size=14, " - "/* Incorrect data_size */ ...}) = -1 EBADF (%m)\n"); + printf("ioctl(-1, DM_VERSION, {version=4.1.2, data_size=14" + " /* data_size too small */}) = -1 EBADF (%m)\n"); /* Unterminated name/uuid */ init_s(dm_arg, min_sizeof_dm_ioctl, 0); - strncpy(dm_arg->name, str129, sizeof(dm_arg->name)); - strncpy(dm_arg->uuid, str129, sizeof(dm_arg->uuid)); + memcpy(dm_arg->name, str129, sizeof(dm_arg->name)); + memcpy(dm_arg->uuid, str129, sizeof(dm_arg->uuid)); ioctl(-1, DM_VERSION, dm_arg); printf("ioctl(-1, DM_VERSION, {version=4.1.2, data_size=%zu, " - "dev=makedev(18, 52), name=\"%.127s\", uuid=\"%.128s\", " + "dev=makedev(0x12, 0x34), name=\"%.127s\"..., uuid=\"%.128s\"..., " "flags=0}) = -1 EBADF (%m)\n", min_sizeof_dm_ioctl, str129, str129); @@ -259,7 +244,7 @@ main(void) ioctl(-1, DM_VERSION, dm_arg); printf("ioctl(-1, DM_VERSION, " "{version=4.1.2, data_size=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0}) = " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0}) = " "-1 EBADF (%m)\n", min_sizeof_dm_ioctl); /* Zero dev, name, uuid */ @@ -279,7 +264,7 @@ main(void) ioctl(-1, DM_VERSION, dm_arg); printf("ioctl(-1, DM_VERSION, " "{version=4.1.2, data_size=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=" + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=" "DM_READONLY_FLAG|DM_SUSPEND_FLAG|DM_EXISTS_FLAG|" "DM_PERSISTENT_DEV_FLAG|DM_STATUS_TABLE_FLAG|" "DM_ACTIVE_PRESENT_FLAG|DM_INACTIVE_PRESENT_FLAG|" @@ -295,7 +280,7 @@ main(void) ioctl(-1, DM_VERSION, &s); printf("ioctl(-1, DM_VERSION, " "{version=4.1.2, data_size=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0}) = " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0}) = " "-1 EBADF (%m)\n", sizeof(s.ioc)); @@ -325,7 +310,7 @@ main(void) init_s(dm_arg, min_sizeof_dm_ioctl, 0); ioctl(-1, dummy_check_cmds[i].arg, dm_arg); printf("ioctl(-1, %s, {version=4.1.2, data_size=%zu%s, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\"%s, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\"%s, " "flags=0}) = -1 EBADF (%m)\n", dummy_check_cmds[i].str, min_sizeof_dm_ioctl, dummy_check_cmds[i].has_params ? ", data_start=0" : "", @@ -340,14 +325,14 @@ main(void) ioctl(-1, DM_DEV_SUSPEND, &s); printf("ioctl(-1, DM_DEV_SUSPEND, " "{version=4.1.2, data_size=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "flags=DM_SUSPEND_FLAG}) = -1 EBADF (%m)\n", sizeof(s.ioc)); init_s(&s.ioc, sizeof(s.ioc), 0); s.ioc.event_nr = 0xbadc0ded; ioctl(-1, DM_DEV_SUSPEND, &s); printf("ioctl(-1, DM_DEV_SUSPEND, " - "{version=4.1.2, data_size=%zu, dev=makedev(18, 52), " + "{version=4.1.2, data_size=%zu, dev=makedev(0x12, 0x34), " "name=\"nnn\", uuid=\"uuu\", event_nr=3134983661, " "flags=0}) = -1 EBADF (%m)\n", sizeof(s.ioc)); @@ -364,7 +349,7 @@ main(void) ioctl(-1, DM_TABLE_LOAD, &s); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%u, data_start=%u, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=1, flags=0, " # if VERBOSE "{sector_start=16, length=32, target_type=\"tgt\", " @@ -381,7 +366,7 @@ main(void) ioctl(-1, DM_TABLE_LOAD, dm_arg); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=0, flags=0}) = -1 EBADF (%m)\n", sizeof(*dm_arg), min_sizeof_dm_ioctl); @@ -392,11 +377,11 @@ main(void) ioctl(-1, DM_TABLE_LOAD, dm_arg); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%zu, data_start=%u, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=1234, flags=0, " # if VERBOSE - "/* misplaced struct dm_target_spec */ ..." -# else /* !VERBOSE */ + "??? /* misplaced struct dm_target_spec */" +# else "..." # endif /* VERBOSE */ "}) = -1 EBADF (%m)\n", sizeof(*dm_arg), 0xfffffff8); @@ -409,7 +394,7 @@ main(void) ioctl(-1, DM_TABLE_LOAD, dm_arg_open1); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=3735936673, flags=0, " # if VERBOSE "%p" @@ -437,7 +422,7 @@ main(void) errstr = sprintrc(rc); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=2, flags=0, ", sizeof(*dm_arg_open2), offsetof(struct dm_table_open_test, target1)); @@ -481,7 +466,7 @@ main(void) errstr = sprintrc(rc); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=4, flags=0, ", offsetof(struct dm_table_open_test, target5), offsetof(struct dm_table_open_test, target0)); @@ -491,13 +476,13 @@ main(void) print_dm_target_spec(&dm_arg_open3->target1, 15); printf("\"\\377\"}, "); print_dm_target_spec(&dm_arg_open3->target1, 42); - printf("\"\\1\\2\"}, /* misplaced struct dm_target_spec */ ..."); + printf("\"\\1\\2\"}, ??? /* misplaced struct dm_target_spec */"); # else /* !VERBOSE */ printf("..."); # endif /* VERBOSE */ printf("}) = %s\n", errstr); - #define FILL_DM_TARGET(id, id_next) \ +# define FILL_DM_TARGET(id, id_next) \ do { \ init_dm_target_spec(&dm_arg_open3->target##id, id); \ dm_arg_open3->target##id.next = \ @@ -505,10 +490,10 @@ main(void) target##id_next) - \ offsetof(struct dm_table_open_test, \ target##id); \ - strncpy(dm_arg_open3->param##id, str129 + id * 2, id); \ + memcpy(dm_arg_open3->param##id, str129 + id * 2, id); \ dm_arg_open3->param##id[id] = '\0'; \ } while (0) - #define PRINT_DM_TARGET(id) \ +# define PRINT_DM_TARGET(id) \ do { \ print_dm_target_spec(&dm_arg_open3->target##id, id); \ printf("\"%.*s\"}, ", id, str129 + id * 2); \ @@ -532,7 +517,7 @@ main(void) errstr = sprintrc(rc); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=3134983661, flags=0, ", sizeof(*dm_arg_open3), offsetof(struct dm_table_open_test, target0)); @@ -558,7 +543,7 @@ main(void) ioctl(-1, DM_TARGET_MSG, &s); printf("ioctl(-1, DM_TARGET_MSG, " "{version=4.1.2, data_size=%u, data_start=%u, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0, " # if VERBOSE "{sector=4660, message=\"long targ\"...}" # else /* !VERBOSE */ @@ -573,9 +558,9 @@ main(void) ioctl(-1, DM_TARGET_MSG, dm_arg); printf("ioctl(-1, DM_TARGET_MSG, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0, " # if VERBOSE - "/* misplaced struct dm_target_msg */" + "??? /* misplaced struct dm_target_msg */" # else /* !VERBOSE */ "..." # endif /* VERBOSE */ @@ -588,9 +573,9 @@ main(void) ioctl(-1, DM_TARGET_MSG, dm_arg); printf("ioctl(-1, DM_TARGET_MSG, " "{version=4.1.2, data_size=%zu, data_start=%u, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0, " # if VERBOSE - "/* misplaced struct dm_target_msg */" + "??? /* misplaced struct dm_target_msg */" # else /* !VERBOSE */ "..." # endif /* VERBOSE */ @@ -604,7 +589,7 @@ main(void) ioctl(-1, DM_TARGET_MSG, dm_arg); printf("ioctl(-1, DM_TARGET_MSG, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0, " # if VERBOSE "%p" # else /* !VERBOSE */ @@ -627,7 +612,7 @@ main(void) errstr = sprintrc(rc); printf("ioctl(-1, DM_TARGET_MSG, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, ", + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0, ", sizeof(*dm_arg_msg) + 1, offsetof(struct dm_target_msg_test, msg)); # if VERBOSE @@ -648,7 +633,7 @@ main(void) errstr = sprintrc(rc); printf("ioctl(-1, DM_TARGET_MSG, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, ", + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0, ", sizeof(*dm_arg_msg), offsetof(struct dm_target_msg_test, msg)); # if VERBOSE printf("{sector=%" PRI__u64 ", message=\"\"}", @@ -665,7 +650,7 @@ main(void) ioctl(-1, DM_DEV_SET_GEOMETRY, &s); printf("ioctl(-1, DM_DEV_SET_GEOMETRY, " "{version=4.1.2, data_size=%u, data_start=%u, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", flags=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", flags=0, " # if VERBOSE "string=\"10 20 30 \"..." # else /* !VERBOSE */ @@ -683,7 +668,7 @@ main(void) ioctl(-1, DM_DEV_RENAME, unaligned_dm_arg); printf("ioctl(-1, DM_DEV_RENAME, " "{version=4.1.2, data_size=%zu, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", event_nr=0, " "flags=0, " # if VERBOSE "string=%p" @@ -703,10 +688,10 @@ main(void) ioctl(-1, DM_DEV_RENAME, &s); printf("ioctl(-1, DM_DEV_RENAME, " "{version=4.1.2, data_size=%u, data_start=3735928559, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", event_nr=0, " "flags=0, " # if VERBOSE - "/* misplaced string */" + "??? /* misplaced string */" # else /* !VERBOSE */ "..." # endif /* VERBOSE */ @@ -720,7 +705,7 @@ main(void) ioctl(-1, DM_DEV_RENAME, &s); printf("ioctl(-1, DM_DEV_RENAME, " "{version=4.1.2, data_size=%u, data_start=%zu, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", event_nr=0, " "flags=0, " # if VERBOSE "string=\"nn\"" @@ -737,7 +722,7 @@ main(void) ioctl(-1, DM_DEV_RENAME, &s); printf("ioctl(-1, DM_DEV_RENAME, " "{version=4.1.2, data_size=%u, data_start=%u, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", event_nr=0, " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", event_nr=0, " "flags=0, " # if VERBOSE "string=\"new long \"..." @@ -754,13 +739,15 @@ main(void) ioctl(-1, DM_TABLE_LOAD, &s); printf("ioctl(-1, DM_TABLE_LOAD, " "{version=4.1.2, data_size=%u, data_start=%u, " - "dev=makedev(18, 52), name=\"nnn\", uuid=\"uuu\", " + "dev=makedev(0x12, 0x34), name=\"nnn\", uuid=\"uuu\", " "target_count=4294967295, flags=0, " # if VERBOSE - "{sector_start=0, length=0, target_type=\"\", string=\"\"}, " - "/* misplaced struct dm_target_spec */ " + "{sector_start=0, length=0, target_type=\"\", string=\"\"}" + ", ??? /* misplaced struct dm_target_spec */" +# else + "..." # endif /* VERBOSE */ - "...}) = -1 EBADF (%m)\n", + "}) = -1 EBADF (%m)\n", s.ioc.data_size, s.ioc.data_start); puts("+++ exited with 0 +++"); diff --git a/tests/ioctl_dm.gen.test b/tests/ioctl_dm.gen.test new file mode 100755 index 00000000..b60c7175 --- /dev/null +++ b/tests/ioctl_dm.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_dm +ioctl.test -s9); do not edit. +set -- -s9 +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_dm.test b/tests/ioctl_dm.test deleted file mode 100755 index 64852051..00000000 --- a/tests/ioctl_dm.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check decoding of DM* ioctls. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a16 -s9 -eioctl $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests/ioctl_evdev-success-v.c b/tests/ioctl_evdev-success-v.c new file mode 100644 index 00000000..6fc35477 --- /dev/null +++ b/tests/ioctl_evdev-success-v.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "ioctl_evdev-success.c" diff --git a/tests/ioctl_evdev-success-v.test b/tests/ioctl_evdev-success-v.test new file mode 100755 index 00000000..faedee30 --- /dev/null +++ b/tests/ioctl_evdev-success-v.test @@ -0,0 +1,18 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +: ${IOCTL_INJECT_START=256} +: ${IOCTL_INJECT_RETVAL=8} + +run_prog +run_strace -a16 -v -e trace=ioctl \ + -e inject=ioctl:retval="${IOCTL_INJECT_RETVAL}":when="${IOCTL_INJECT_START}+" \ + ../ioctl_evdev-success-v "${IOCTL_INJECT_START}" "${IOCTL_INJECT_RETVAL}"> "$EXP" +grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests/ioctl_evdev-success.c b/tests/ioctl_evdev-success.c new file mode 100644 index 00000000..7887d417 --- /dev/null +++ b/tests/ioctl_evdev-success.c @@ -0,0 +1,239 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_INPUT_H + +# include +# include +# include +# include +# include +# include "print_fields.h" + +static const char *errstr; + +struct evdev_check { + unsigned long cmd; + const char *cmd_str; + void *arg_ptr; + void (*print_arg)(long rc, void *ptr, void *arg); +}; + +static long +invoke_test_syscall(unsigned long cmd, void *p) +{ + long rc = ioctl(-1, cmd, p); + errstr = sprintrc(rc); + static char inj_errstr[4096]; + + snprintf(inj_errstr, sizeof(inj_errstr), "%s (INJECTED)", errstr); + errstr = inj_errstr; + return rc; +} + +static void +test_evdev(struct evdev_check *check, void *arg) +{ + long rc = invoke_test_syscall(check->cmd, check->arg_ptr); + printf("ioctl(-1, %s, ", check->cmd_str); + if (check->print_arg) + check->print_arg(rc, check->arg_ptr, arg); + else + printf("%p", check->arg_ptr); + printf(") = %s\n", errstr); +} + +static void +print_input_absinfo(long rc, void *ptr, void *arg) +{ + struct input_absinfo *absinfo = ptr; + + if (rc < 0) { + printf("%p", absinfo); + return; + } + PRINT_FIELD_U("{", *absinfo, value); + PRINT_FIELD_U(", ", *absinfo, minimum); +# if VERBOSE + PRINT_FIELD_U(", ", *absinfo, maximum); + PRINT_FIELD_U(", ", *absinfo, fuzz); + PRINT_FIELD_U(", ", *absinfo, flat); +# ifdef HAVE_STRUCT_INPUT_ABSINFO_RESOLUTION + PRINT_FIELD_U(", ", *absinfo, resolution); +# endif +# else + printf(", ..."); +# endif + printf("}"); +} + +static void +print_input_id(long rc, void *ptr, void *arg) +{ + struct input_id *id = ptr; + + if (rc < 0) { + printf("%p", id); + return; + } + printf("{ID_BUS=%" PRIu16 + ", ID_VENDOR=%" PRIu16 + ", ID_PRODUCT=%" PRIu16 + ", ID_VERSION=%" PRIu16 "}", + id->bustype, id->vendor, id->product, id->version); +} + +# ifdef EVIOCGMTSLOTS +static void +print_mtslots(long rc, void *ptr, void *arg) +{ + int *buffer = ptr; + const char **str = arg; + int num = atoi(*(str + 1)); + + if (rc < 0) { + printf("%p", buffer); + return; + } + + printf("{code=%s", *str); + printf(", values=["); + for (unsigned int i = 1; i <= (unsigned) num; i++) + printf("%s%s", i > 1 ? ", " : "", *(str + i + 1)); + printf("]}"); +} +# endif + +static void +print_getbit(long rc, void *ptr, void *arg) +{ + const char **str = arg; + int num = atoi(*str); + + if (rc < 0) { + printf("%p", ptr); + return; + } + + printf("["); + printf("%s", *(str + 1)); + for (unsigned int i = 2; i <= (unsigned) num; i++) { +# if ! VERBOSE + if (i > 4) { + printf(", ..."); + break; + } +# endif + printf(", "); + printf("%s", *(str + i)); + } + printf("]"); +} + +int +main(int argc, char **argv) +{ + unsigned long num_skip; + long inject_retval; + bool locked = false; + + if (argc == 1) + return 0; + + if (argc < 3) + error_msg_and_fail("Usage: %s NUM_SKIP INJECT_RETVAL", argv[0]); + + num_skip = strtoul(argv[1], NULL, 0); + inject_retval = strtol(argv[2], NULL, 0); + + if (inject_retval < 0) + error_msg_and_fail("Expected non-negative INJECT_RETVAL, " + "but got %ld", inject_retval); + + for (unsigned int i = 0; i < num_skip; i++) { + long rc = ioctl(-1, EVIOCGID, NULL); + printf("ioctl(-1, EVIOCGID, NULL) = %s%s\n", + sprintrc(rc), + rc == inject_retval ? " (INJECTED)" : ""); + + if (rc != inject_retval) + continue; + + locked = true; + break; + } + + if (!locked) + error_msg_and_fail("Hasn't locked on ioctl(-1" + ", EVIOCGID, NULL) returning %lu", + inject_retval); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct input_id, id); + TAIL_ALLOC_OBJECT_CONST_PTR(struct input_absinfo, absinfo); + TAIL_ALLOC_OBJECT_CONST_PTR(int, bad_addr_slot); +# ifdef EVIOCGMTSLOTS + int mtslots[] = { ABS_MT_SLOT, 1, 3 }; + /* we use the second element to indicate the number of values */ + /* mtslots_str[1] is "2" so the number of values is 2 */ + const char *mtslots_str[] = { "ABS_MT_SLOT", "2", "1", "3" }; + + /* invalid flag */ + int invalid_mtslot[] = { -1, 1 }; + char invalid_str[4096]; + snprintf(invalid_str, sizeof(invalid_str), "%#x /* ABS_MT_??? */", invalid_mtslot[0]); + const char *invalid_mtslot_str[] = { invalid_str, "1", "1" }; +# endif + + /* set more than 4 bits */ + unsigned long ev_more[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED | 1 << EV_SND | 1 << EV_PWR }; + /* we use the first element to indicate the number of set bits */ + /* ev_more_str[0] is "5" so the number of set bits is 5 */ + const char *ev_more_str[] = { "5", "EV_ABS", "EV_MSC", "EV_LED", "EV_SND", "EV_PWR" }; + + /* set less than 4 bits */ + unsigned long ev_less[] = { 1 << EV_ABS | 1 << EV_MSC | 1 << EV_LED }; + const char *ev_less_str[] = { "3", "EV_ABS", "EV_MSC", "EV_LED" }; + + /* set zero bit */ + unsigned long ev_zero[] = { 0x0 }; + const char *ev_zero_str[] = { "0", " 0 " }; + + /* KEY_MAX is 0x2ff which is greater than retval * 8 */ + unsigned long key[] = { 1 << KEY_1 | 1 << KEY_2, 0 }; + const char *key_str[] = { "2", "KEY_1", "KEY_2" }; + + struct { + struct evdev_check check; + void *ptr; + } a[] = { + { { ARG_STR(EVIOCGID), id, print_input_id }, NULL }, + { { ARG_STR(EVIOCGABS(ABS_X)), absinfo, print_input_absinfo }, NULL }, + { { ARG_STR(EVIOCGABS(ABS_Y)), absinfo, print_input_absinfo }, NULL }, + { { ARG_STR(EVIOCGABS(ABS_Y)), absinfo, print_input_absinfo }, NULL }, + { { ARG_STR(EVIOCGBIT(0, 0)), ev_more, print_getbit }, &ev_more_str }, + { { ARG_STR(EVIOCGBIT(0, 0)), ev_less, print_getbit }, &ev_less_str }, + { { ARG_STR(EVIOCGBIT(0, 0)), ev_zero, print_getbit }, &ev_zero_str }, + { { ARG_STR(EVIOCGBIT(EV_KEY, 0)), key, print_getbit }, &key_str}, +# ifdef EVIOCGMTSLOTS + { { ARG_STR(EVIOCGMTSLOTS(12)), mtslots, print_mtslots }, &mtslots_str }, + { { ARG_STR(EVIOCGMTSLOTS(8)), invalid_mtslot, print_mtslots }, &invalid_mtslot_str } +# endif + }; + for (unsigned int i = 0; i < ARRAY_SIZE(a); i++) { + test_evdev(&a[i].check, a[i].ptr); + } + + puts("+++ exited with 0 +++"); + return 0; +} +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_INPUT_H") + +#endif diff --git a/tests/ioctl_evdev-success.test b/tests/ioctl_evdev-success.test new file mode 100755 index 00000000..54b0a20a --- /dev/null +++ b/tests/ioctl_evdev-success.test @@ -0,0 +1,18 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +: ${IOCTL_INJECT_START=256} +: ${IOCTL_INJECT_RETVAL=8} + +run_prog +run_strace -a16 -e trace=ioctl \ + -e inject=ioctl:retval="${IOCTL_INJECT_RETVAL}":when="${IOCTL_INJECT_START}+" \ + ../ioctl_evdev-success "${IOCTL_INJECT_START}" "${IOCTL_INJECT_RETVAL}"> "$EXP" +grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests/ioctl_evdev-v.gen.test b/tests/ioctl_evdev-v.gen.test new file mode 100755 index 00000000..bf74ef4c --- /dev/null +++ b/tests/ioctl_evdev-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_evdev-v +ioctl.test -v); do not edit. +set -- -v +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_evdev-v.test b/tests/ioctl_evdev-v.test deleted file mode 100755 index 87941010..00000000 --- a/tests/ioctl_evdev-v.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check verbose decoding EVIOC* ioctls. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a16 -veioctl $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests/ioctl_evdev.c b/tests/ioctl_evdev.c index d12323ee..02be472c 100644 --- a/tests/ioctl_evdev.c +++ b/tests/ioctl_evdev.c @@ -2,29 +2,10 @@ * This file is part of ioctl_evdev strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -38,6 +19,13 @@ # include # include +# ifndef EV_SW +# define EV_SW 5 +# endif +# ifndef ABS_MT_TOOL_Y +# define ABS_MT_TOOL_Y 0x3d +# endif + static const unsigned int magic = 0xdeadbeef; static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; @@ -66,9 +54,13 @@ print_ffe_common(const struct ff_effect *const ffe, const char *const type_str) # endif /* VERBOSE */ } -# define TEST_NULL_ARG(cmd) \ - ioctl(-1, cmd, 0); \ - printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd) +# define TEST_NULL_ARG_EX(cmd, str) \ + do { \ + ioctl(-1, cmd, 0); \ + printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", str); \ + } while (0) + +# define TEST_NULL_ARG(cmd) TEST_NULL_ARG_EX(cmd, #cmd) int main(void) @@ -102,6 +94,7 @@ main(void) TEST_NULL_ARG(EVIOCGLED(0)); # ifdef EVIOCGMTSLOTS TEST_NULL_ARG(EVIOCGMTSLOTS(0)); + TEST_NULL_ARG(EVIOCGMTSLOTS(8)); # endif # ifdef EVIOCGPROP TEST_NULL_ARG(EVIOCGPROP(0)); @@ -114,14 +107,24 @@ main(void) TEST_NULL_ARG(EVIOCGABS(ABS_X)); TEST_NULL_ARG(EVIOCSABS(ABS_X)); - TEST_NULL_ARG(EVIOCGBIT(EV_SYN, 0)); + TEST_NULL_ARG_EX(EVIOCGABS(0xe), "EVIOCGABS(0xe /* ABS_??? */)"); + TEST_NULL_ARG_EX(EVIOCSABS(0xe), "EVIOCSABS(0xe /* ABS_??? */)"); + + TEST_NULL_ARG(EVIOCGABS(ABS_MT_TOOL_Y)); + TEST_NULL_ARG(EVIOCSABS(ABS_MT_TOOL_Y)); + + TEST_NULL_ARG_EX(EVIOCGABS(0x3e), "EVIOCGABS(0x3e /* ABS_??? */)"); + TEST_NULL_ARG_EX(EVIOCSABS(0x3e), "EVIOCSABS(0x3e /* ABS_??? */)"); + + TEST_NULL_ARG_EX(EVIOCGABS(0x3f), "EVIOCGABS(0x3f /* ABS_??? */)"); + TEST_NULL_ARG_EX(EVIOCSABS(0x3f), "EVIOCSABS(0x3f /* ABS_??? */)"); + + TEST_NULL_ARG(EVIOCGBIT(0, 0)); TEST_NULL_ARG(EVIOCGBIT(EV_KEY, 1)); TEST_NULL_ARG(EVIOCGBIT(EV_REL, 2)); TEST_NULL_ARG(EVIOCGBIT(EV_ABS, 3)); TEST_NULL_ARG(EVIOCGBIT(EV_MSC, 4)); -# ifdef EV_SW TEST_NULL_ARG(EVIOCGBIT(EV_SW, 5)); -# endif TEST_NULL_ARG(EVIOCGBIT(EV_LED, 6)); TEST_NULL_ARG(EVIOCGBIT(EV_SND, 7)); TEST_NULL_ARG(EVIOCGBIT(EV_REP, 8)); @@ -129,6 +132,12 @@ main(void) TEST_NULL_ARG(EVIOCGBIT(EV_PWR, 10)); TEST_NULL_ARG(EVIOCGBIT(EV_FF_STATUS, 11)); + TEST_NULL_ARG_EX(EVIOCGBIT(0x6, 12), "EVIOCGBIT(0x6 /* EV_??? */, 12)"); + TEST_NULL_ARG_EX(EVIOCGBIT(0x18, 13), + "EVIOCGBIT(0x18 /* EV_??? */, 13)"); + TEST_NULL_ARG_EX(EVIOCGBIT(0x1f, 14), + "EVIOCGBIT(0x1f /* EV_??? */, 14)"); + ioctl(-1, EVIOCGBIT(EV_MAX, 42), 0); printf("ioctl(-1, EVIOCGBIT(%#x /* EV_??? */, 42), NULL)" " = -1 EBADF (%m)\n", EV_MAX); @@ -148,7 +157,7 @@ main(void) void *const page = tail_alloc(size); fill_memory(page, size); - int *const val_int = tail_alloc(sizeof(*val_int)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, val_int); *val_int = magic; # ifdef EVIOCSCLOCKID @@ -172,7 +181,7 @@ main(void) pair_int[0], "KEY_ESC"); # ifdef EVIOCSKEYCODE_V2 - struct input_keymap_entry *const ike = tail_alloc(sizeof(*ike)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct input_keymap_entry, ike); fill_memory(ike, sizeof(*ike)); ike->keycode = 2; @@ -196,24 +205,24 @@ main(void) printf("}) = -1 EBADF (%m)\n"); # endif - struct ff_effect *const ffe = tail_alloc(sizeof(*ffe)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct ff_effect, ffe); fill_memory(ffe, sizeof(*ffe)); ffe->type = FF_CONSTANT; ioctl(-1, EVIOCSFF, ffe); print_ffe_common(ffe, "FF_CONSTANT"); -# if VERBOSE +# if VERBOSE printf(", constant={level=%hd", ffe->u.constant.level); print_envelope(&ffe->u.constant.envelope); printf("}"); -# else +# else printf("..."); -# endif +# endif errno = EBADF; printf("}) = -1 EBADF (%m)\n"); -# if VERBOSE +# if VERBOSE ffe->type = FF_RAMP; ioctl(-1, EVIOCSFF, ffe); print_ffe_common(ffe, "FF_RAMP"); @@ -250,7 +259,7 @@ main(void) print_ffe_common(ffe, "0xff /* FF_??? */"); errno = EBADF; printf("}) = -1 EBADF (%m)\n"); -# endif +# endif ioctl(-1, _IOC(_IOC_READ, 0x45, 0x1, 0xff), lmagic); printf("ioctl(-1, %s, %#lx) = -1 EBADF (%m)\n", diff --git a/tests/ioctl_evdev.gen.test b/tests/ioctl_evdev.gen.test new file mode 100755 index 00000000..68a43f7c --- /dev/null +++ b/tests/ioctl_evdev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_evdev +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_evdev.test b/tests/ioctl_evdev.test deleted file mode 100755 index 7ed2e98a..00000000 --- a/tests/ioctl_evdev.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of EVIOC* ioctls. - -. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_inotify.c b/tests/ioctl_inotify.c new file mode 100644 index 00000000..6be0c0ee --- /dev/null +++ b/tests/ioctl_inotify.c @@ -0,0 +1,61 @@ +/* + * This file is part of ioctl_inotify strace test. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include + +#ifndef INOTIFY_IOC_SETNEXTWD +# define INOTIFY_IOC_SETNEXTWD _IOW('I', 0, int32_t) +#endif + +static long +sys_ioctl(kernel_long_t fd, kernel_ulong_t cmd, kernel_ulong_t arg) +{ + return syscall(__NR_ioctl, fd, cmd, arg); +} + +int +main(void) +{ + static const kernel_ulong_t unknown_inotify_cmd = + (kernel_ulong_t) 0xbadc0dedfeed49edULL; + static const kernel_ulong_t magic = + (kernel_ulong_t) 0xdeadbeefbadc0dedULL; + + /* Unknown inotify commands */ + sys_ioctl(-1, unknown_inotify_cmd, magic); + printf("ioctl(-1, _IOC(%s_IOC_READ|_IOC_WRITE, 0x49, %#x, %#x), " + "%#lx) = -1 EBADF (%m)\n", + _IOC_DIR((unsigned int) unknown_inotify_cmd) & _IOC_NONE ? + "_IOC_NONE|" : "", + _IOC_NR((unsigned int) unknown_inotify_cmd), + _IOC_SIZE((unsigned int) unknown_inotify_cmd), + (unsigned long) magic); + + sys_ioctl(-1, INOTIFY_IOC_SETNEXTWD + 1, magic); + printf("ioctl(-1, _IOC(_IOC_WRITE, 0x49, %#x, %#x), %#lx)" + " = -1 EBADF (%m)\n", + (unsigned int) _IOC_NR(INOTIFY_IOC_SETNEXTWD + 1), + (unsigned int) _IOC_SIZE(INOTIFY_IOC_SETNEXTWD + 1), + (unsigned long) magic); + + /* INOTIFY_IOC_SETNEXTWD */ + sys_ioctl(-1, INOTIFY_IOC_SETNEXTWD, magic); + printf("ioctl(-1, INOTIFY_IOC_SETNEXTWD, %d) = -1 EBADF (%m)\n", + (int) magic); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/ioctl_inotify.gen.test b/tests/ioctl_inotify.gen.test new file mode 100755 index 00000000..237a98b8 --- /dev/null +++ b/tests/ioctl_inotify.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_inotify +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_kvm_run-v.c b/tests/ioctl_kvm_run-v.c new file mode 100644 index 00000000..388339b0 --- /dev/null +++ b/tests/ioctl_kvm_run-v.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "ioctl_kvm_run.c" diff --git a/tests/ioctl_kvm_run-v.gen.test b/tests/ioctl_kvm_run-v.gen.test new file mode 100755 index 00000000..6f20ee48 --- /dev/null +++ b/tests/ioctl_kvm_run-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_kvm_run-v +ioctl.test -v -a36 -y); do not edit. +set -- -v -a36 -y +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_kvm_run.c b/tests/ioctl_kvm_run.c new file mode 100644 index 00000000..4a569708 --- /dev/null +++ b/tests/ioctl_kvm_run.c @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "ioctl_kvm_run_common.c" + +#if need_print_KVM_RUN + +static void +print_KVM_RUN(const int fd, const char *const dev, const unsigned int reason) +{ + printf("ioctl(%d<%s>, KVM_RUN, 0) = 0\n", fd, dev); +} + +#endif diff --git a/tests/ioctl_kvm_run.gen.test b/tests/ioctl_kvm_run.gen.test new file mode 100755 index 00000000..7ab473ba --- /dev/null +++ b/tests/ioctl_kvm_run.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_kvm_run +ioctl.test -a36 -y); do not edit. +set -- -a36 -y +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_kvm_run_auxstr_vcpu.c b/tests/ioctl_kvm_run_auxstr_vcpu.c new file mode 100644 index 00000000..9140d3b2 --- /dev/null +++ b/tests/ioctl_kvm_run_auxstr_vcpu.c @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#define KVM_NO_CPUID_CALLBACK \ + error_msg_and_skip("newer kernel (>= 4.16) is needed") + +#include "ioctl_kvm_run_common.c" + +#if need_print_KVM_RUN + +static void +print_KVM_RUN(const int fd, const char *const dev, const unsigned int reason) +{ + const char *str; + +# define CASE_ENTRY(R) case R: str = #R; break + switch (reason) { + CASE_ENTRY(KVM_EXIT_HLT); + CASE_ENTRY(KVM_EXIT_IO); + CASE_ENTRY(KVM_EXIT_MMIO); + default: str = "???"; + } + + printf("ioctl(%d<%s>, KVM_RUN, 0) = 0 (%s)\n", fd, dev, str); +} + +#endif diff --git a/tests/ioctl_kvm_run_auxstr_vcpu.gen.test b/tests/ioctl_kvm_run_auxstr_vcpu.gen.test new file mode 100755 index 00000000..d2995db8 --- /dev/null +++ b/tests/ioctl_kvm_run_auxstr_vcpu.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_kvm_run_auxstr_vcpu +ioctl.test -a36 -y -e kvm=vcpu); do not edit. +set -- -a36 -y -e kvm=vcpu +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_kvm_run_common.c b/tests/ioctl_kvm_run_common.c new file mode 100644 index 00000000..26e72cec --- /dev/null +++ b/tests/ioctl_kvm_run_common.c @@ -0,0 +1,412 @@ +/* + * Check decoding of KVM_* commands of ioctl syscall using /dev/kvm API. + * Based on kvmtest.c from https://lwn.net/Articles/658512/ + * + * kvmtest.c author: Josh Triplett + * Copyright (c) 2015 Intel Corporation + * Copyright (c) 2017-2018 The strace developers. + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to + * deal in the Software without restriction, including without limitation the + * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + */ + +#include "tests.h" + +#if defined HAVE_LINUX_KVM_H \ + && defined HAVE_STRUCT_KVM_CPUID2 \ + && defined HAVE_STRUCT_KVM_REGS \ + && defined HAVE_STRUCT_KVM_SREGS \ + && defined HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION \ + &&(defined __x86_64__ || defined __i386__) + +# include +# include +# include +# include +# include +# include +# include +# include +# include + +# ifndef KVM_MAX_CPUID_ENTRIES +# define KVM_MAX_CPUID_ENTRIES 80 +# endif + +# include "xlat.h" +# include "xlat/kvm_cpuid_flags.h" + +static int +kvm_ioctl(int fd, unsigned long cmd, const char *cmd_str, void *arg) +{ + int rc = ioctl(fd, cmd, arg); + if (rc < 0) + perror_msg_and_skip("%s", cmd_str); + return rc; +} + +# define KVM_IOCTL(fd_, cmd_, arg_) \ + kvm_ioctl((fd_), (cmd_), #cmd_, (arg_)) + +static const char dev[] = "/dev/kvm"; +static const char vm_dev[] = "anon_inode:kvm-vm"; +static char vcpu_dev[] = "anon_inode:kvm-vcpu:0"; +static size_t page_size; + +extern const char code[]; +extern const unsigned short code_size; + +__asm__( + ".type code, @object \n" + "code: \n" + " mov $0xd80003f8, %edx \n" + " mov $'\n', %al \n" + " out %al, (%dx) \n" + " hlt \n" + ".size code, . - code \n" + ".type code_size, @object \n" + "code_size: \n" + " .short . - code \n" + ".size code_size, . - code_size \n" + ); + +static void +print_kvm_segment(const struct kvm_segment *seg) +{ + printf("{base=%#jx, limit=%u, selector=%u, type=%u, present=%u, " + "dpl=%u, db=%u, s=%u, l=%u, g=%u, avl=%u}", + (uintmax_t) seg->base, seg->limit, seg->selector, seg->type, + seg->present, seg->dpl, seg->db, seg->s, seg->l, seg->g, + seg->avl); +} + +static void +print_kvm_sregs(const struct kvm_sregs *sregs) +{ + printf("{cs="); + print_kvm_segment(&sregs->cs); +# if VERBOSE + printf(", ds="); + print_kvm_segment(&sregs->ds); + printf(", es="); + print_kvm_segment(&sregs->es); + printf(", fs="); + print_kvm_segment(&sregs->fs); + printf(", gs="); + print_kvm_segment(&sregs->gs); + printf(", ss="); + print_kvm_segment(&sregs->ss); + printf(", tr="); + print_kvm_segment(&sregs->tr); + printf(", ldt="); + print_kvm_segment(&sregs->ldt); + printf(", gdt={base=%#jx, limit=%u}, idt={base=%#jx, limit=%u}, " + "cr0=%llu, cr2=%llu, cr3=%llu, cr4=%llu, cr8=%llu, efer=%llu, " + "apic_base=%#jx", (uintmax_t) sregs->gdt.base, sregs->gdt.limit, + (uintmax_t) sregs->idt.base, sregs->idt.limit, sregs->cr0, + sregs->cr2, sregs->cr3, sregs->cr4, sregs->cr8, sregs->efer, + (uintmax_t)sregs->apic_base); + printf(", interrupt_bitmap=["); + for (size_t i = 0; i < ARRAY_SIZE(sregs->interrupt_bitmap); i++) { + if (i) + printf(", "); + printf("%#jx", (uintmax_t) sregs->interrupt_bitmap[i]); + } + printf("]"); +# else + printf(", ..."); +# endif + printf("}"); +} + +static void +print_kvm_regs(const struct kvm_regs *regs) +{ + printf("{rax=%#jx", (uintmax_t) regs->rax); +# if VERBOSE + printf(", rbx=%#jx, rcx=%#jx, rdx=%#jx, rsi=%#jx, rdi=%#jx", + (uintmax_t) regs->rbx, (uintmax_t) regs->rcx, + (uintmax_t) regs->rdx, (uintmax_t) regs->rsi, + (uintmax_t) regs->rdi); +# else + printf(", ..."); +# endif + printf(", rsp=%#jx, rbp=%#jx", (uintmax_t) regs->rsp, + (uintmax_t) regs->rbp); +# if VERBOSE + printf(", r8=%#jx, r9=%#jx, r10=%#jx, r11=%#jx, r12=%#jx, r13=%#jx" + ", r14=%#jx, r15=%#jx", + (uintmax_t) regs->r8, (uintmax_t) regs->r9, + (uintmax_t) regs->r10, (uintmax_t) regs->r11, + (uintmax_t) regs->r12, (uintmax_t) regs->r13, + (uintmax_t) regs->r14, (uintmax_t) regs->r15); +# else + printf(", ..."); +# endif + printf(", rip=%#jx, rflags=%#jx}", (uintmax_t) regs->rip, + (uintmax_t) regs->rflags); +} + +# define need_print_KVM_RUN 1 + +static void +print_KVM_RUN(const int fd, const char *const dev, const unsigned int reason); + +static void +run_kvm(const int vcpu_fd, struct kvm_run *const run, const size_t mmap_size, + void *const mem) +{ + /* Initialize CS to point at 0, via a read-modify-write of sregs. */ + struct kvm_sregs sregs; + KVM_IOCTL(vcpu_fd, KVM_GET_SREGS, &sregs); + printf("ioctl(%d<%s>, KVM_GET_SREGS, ", vcpu_fd, vcpu_dev); + print_kvm_sregs(&sregs); + printf(") = 0\n"); + + sregs.cs.base = 0; + sregs.cs.selector = 0; + KVM_IOCTL(vcpu_fd, KVM_SET_SREGS, &sregs); + printf("ioctl(%d<%s>, KVM_SET_SREGS, ", vcpu_fd, vcpu_dev); + print_kvm_sregs(&sregs); + printf(") = 0\n"); + + /* + * Initialize registers: instruction pointer for our code, addends, + * and initial flags required by x86 architecture. + */ + struct kvm_regs regs = { + .rip = page_size, + .rax = 2, + .rbx = 2, + .rflags = 0x2, + }; + KVM_IOCTL(vcpu_fd, KVM_SET_REGS, ®s); + printf("ioctl(%d<%s>, KVM_SET_REGS, ", vcpu_fd, vcpu_dev); + print_kvm_regs(®s); + printf(") = 0\n"); + + /* Copy the code */ + memcpy(mem, code, code_size); + + const char *p = "\n"; + + /* Repeatedly run code and handle VM exits. */ + for (;;) { + KVM_IOCTL(vcpu_fd, KVM_RUN, NULL); + print_KVM_RUN(vcpu_fd, vcpu_dev, run->exit_reason); + + switch (run->exit_reason) { + case KVM_EXIT_HLT: + if (p) + error_msg_and_fail("premature KVM_EXIT_HLT"); + return; + case KVM_EXIT_IO: + if (run->io.direction == KVM_EXIT_IO_OUT + && run->io.size == 1 + && run->io.port == 0x03f8 + && run->io.count == 1 + && run->io.data_offset < mmap_size + && p && *p == ((char *) run)[run->io.data_offset]) + p = NULL; + else + error_msg_and_fail("unhandled KVM_EXIT_IO"); + break; + case KVM_EXIT_MMIO: + error_msg_and_fail("Got an unexpected MMIO exit:" + " phys_addr %#llx," + " data %02x %02x %02x %02x" + " %02x %02x %02x %02x," + " len %u, is_write %hhu", + (unsigned long long) run->mmio.phys_addr, + run->mmio.data[0], run->mmio.data[1], + run->mmio.data[2], run->mmio.data[3], + run->mmio.data[4], run->mmio.data[5], + run->mmio.data[6], run->mmio.data[7], + run->mmio.len, run->mmio.is_write); + + default: + error_msg_and_fail("exit_reason = %#x", + run->exit_reason); + } + } +} + +static int +vcpu_dev_should_have_cpuid(int fd) +{ + int r = 0; + char *filename = NULL; + char buf[sizeof(vcpu_dev)]; + + if (asprintf(&filename, "/proc/%d/fd/%d", getpid(), fd) < 0) + error_msg_and_fail("asprintf"); + + if (readlink(filename, buf, sizeof(buf)) == sizeof(buf) - 1 + && (memcmp(buf, vcpu_dev, sizeof(buf) - 1) == 0)) + r = 1; + free(filename); + return r; +} + +static void +print_cpuid_ioctl(int fd, const char *fd_dev, + const char *ioctl_name, const struct kvm_cpuid2 *cpuid) +{ + printf("ioctl(%d<%s>, %s, {nent=%u, entries=[", + fd, fd_dev, ioctl_name, cpuid->nent); +# if VERBOSE + for (size_t i = 0; i < cpuid->nent; i++) { + if (i) + printf(", "); + printf("{function=%#x, index=%#x, flags=", + cpuid->entries[i].function, cpuid->entries[i].index); + printflags(kvm_cpuid_flags, cpuid->entries[i].flags, + "KVM_CPUID_FLAG_???"); + printf(", eax=%#x, ebx=%#x, ecx=%#x, edx=%#x}", + cpuid->entries[i].eax, cpuid->entries[i].ebx, + cpuid->entries[i].ecx, cpuid->entries[i].edx); + } +# else + if (cpuid->nent) + printf("..."); +# endif + printf("]}) = 0\n"); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int kvm = open(dev, O_RDWR); + if (kvm < 0) + perror_msg_and_skip("open: %s", dev); + + /* Make sure we have the stable version of the API */ + int ret = KVM_IOCTL(kvm, KVM_GET_API_VERSION, 0); + if (ret != KVM_API_VERSION) + error_msg_and_skip("KVM_GET_API_VERSION returned %d" + ", KVM_API_VERSION is %d", + kvm, KVM_API_VERSION); + printf("ioctl(%d<%s>, KVM_GET_API_VERSION, 0) = %d\n", + kvm, dev, ret); + + ret = KVM_IOCTL(kvm, KVM_CHECK_EXTENSION, + (void *) (uintptr_t) KVM_CAP_USER_MEMORY); + printf("ioctl(%d<%s>, KVM_CHECK_EXTENSION, KVM_CAP_USER_MEMORY) = %d\n", + kvm, dev, ret); + + int vm_fd = KVM_IOCTL(kvm, KVM_CREATE_VM, 0); + printf("ioctl(%d<%s>, KVM_CREATE_VM, 0) = %d<%s>\n", + kvm, dev, vm_fd, vm_dev); + + /* Allocate one aligned page of guest memory to hold the code. */ + page_size = get_page_size(); + void *const mem = mmap(NULL, page_size, PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_ANONYMOUS, -1, 0); + if (mem == MAP_FAILED) + perror_msg_and_fail("mmap page"); + + /* Map it to the second page frame (to avoid the real-mode IDT at 0). */ + struct kvm_userspace_memory_region region = { + .slot = 0, + .guest_phys_addr = page_size, + .memory_size = page_size, + .userspace_addr = (uintptr_t) mem, + }; + KVM_IOCTL(vm_fd, KVM_SET_USER_MEMORY_REGION, ®ion); + printf("ioctl(%d<%s>, KVM_SET_USER_MEMORY_REGION" + ", {slot=0, flags=0, guest_phys_addr=%#lx, memory_size=%lu" + ", userspace_addr=%p}) = 0\n", vm_fd, vm_dev, + (unsigned long) page_size, (unsigned long) page_size, mem); + + int vcpu_fd = KVM_IOCTL(vm_fd, KVM_CREATE_VCPU, NULL); + if (!vcpu_dev_should_have_cpuid(vcpu_fd)) { + /* + * This is an older kernel that doesn't place a cpuid + * at the end of the dentry associated with vcpu_fd. + * Trim the cpuid part of vcpu_dev like: + * "anon_inode:kvm-vcpu:0" -> "anon_inode:kvm-vcpu" + */ + vcpu_dev[strlen (vcpu_dev) - 2] = '\0'; +# ifdef KVM_NO_CPUID_CALLBACK + KVM_NO_CPUID_CALLBACK; +# endif + } + + printf("ioctl(%d<%s>, KVM_CREATE_VCPU, 0) = %d<%s>\n", + vm_fd, vm_dev, vcpu_fd, vcpu_dev); + + /* Map the shared kvm_run structure and following data. */ + ret = KVM_IOCTL(kvm, KVM_GET_VCPU_MMAP_SIZE, NULL); + struct kvm_run *run; + if (ret < (int) sizeof(*run)) + error_msg_and_fail("KVM_GET_VCPU_MMAP_SIZE returned %d < %d", + ret, (int) sizeof(*run)); + printf("ioctl(%d<%s>, KVM_GET_VCPU_MMAP_SIZE, 0) = %d\n", + kvm, dev, ret); + + const size_t mmap_size = (ret + page_size - 1) & -page_size; + run = mmap(NULL, mmap_size, PROT_READ | PROT_WRITE, + MAP_SHARED, vcpu_fd, 0); + if (run == MAP_FAILED) + perror_msg_and_fail("mmap vcpu"); + + size_t cpuid_nent = KVM_MAX_CPUID_ENTRIES; + struct kvm_cpuid2 *cpuid = tail_alloc(sizeof(*cpuid) + + cpuid_nent * + sizeof(*cpuid->entries)); + + cpuid->nent = 0; + ioctl(kvm, KVM_GET_SUPPORTED_CPUID, cpuid); + printf("ioctl(%d<%s>, KVM_GET_SUPPORTED_CPUID, %p) = -1 E2BIG (%m)\n", + kvm, dev, cpuid); + + cpuid->nent = cpuid_nent; + + KVM_IOCTL(kvm, KVM_GET_SUPPORTED_CPUID, cpuid); + print_cpuid_ioctl(kvm, dev, "KVM_GET_SUPPORTED_CPUID", cpuid); + + struct kvm_cpuid2 cpuid_tmp = { .nent = 0 }; + KVM_IOCTL(vcpu_fd, KVM_SET_CPUID2, &cpuid_tmp); + printf("ioctl(%d<%s>, KVM_SET_CPUID2, {nent=%u, entries=[]}) = 0\n", + vcpu_fd, vcpu_dev, cpuid_tmp.nent); + + KVM_IOCTL(vcpu_fd, KVM_SET_CPUID2, cpuid); + print_cpuid_ioctl(vcpu_fd, vcpu_dev, "KVM_SET_CPUID2", cpuid); + + ioctl(vcpu_fd, KVM_SET_CPUID2, NULL); + printf("ioctl(%d<%s>, KVM_SET_CPUID2, NULL) = -1 EFAULT (%m)\n", + vcpu_fd, vcpu_dev); + + run_kvm(vcpu_fd, run, mmap_size, mem); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else /* !HAVE_LINUX_KVM_H */ + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_KVM_H && HAVE_STRUCT_KVM_CPUID2 && " + "HAVE_STRUCT_KVM_REGS && HAVE_STRUCT_KVM_SREGS && " + "HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION && " + "(__x86_64__ || __i386__)") + +# define need_print_KVM_RUN 0 + +#endif diff --git a/tests/ioctl_loop-nv.gen.test b/tests/ioctl_loop-nv.gen.test new file mode 100755 index 00000000..d9da86a2 --- /dev/null +++ b/tests/ioctl_loop-nv.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_loop-nv +ioctl.test -a22 -e verbose=none); do not edit. +set -- -a22 -e verbose=none +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_loop-nv.test b/tests/ioctl_loop-nv.test deleted file mode 100755 index dcc27e1d..00000000 --- a/tests/ioctl_loop-nv.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check non-verbose decoding of LOOP_* ioctls. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a22 -eioctl -e verbose=none $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests/ioctl_loop-v.gen.test b/tests/ioctl_loop-v.gen.test new file mode 100755 index 00000000..b03bf784 --- /dev/null +++ b/tests/ioctl_loop-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_loop-v +ioctl.test -v); do not edit. +set -- -v +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_loop-v.test b/tests/ioctl_loop-v.test deleted file mode 100755 index ff3995d8..00000000 --- a/tests/ioctl_loop-v.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check non-abbreviated decoding of LOOP_* ioctls. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a22 -v -eioctl $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests/ioctl_loop.c b/tests/ioctl_loop.c index a95e775d..53665603 100644 --- a/tests/ioctl_loop.c +++ b/tests/ioctl_loop.c @@ -3,47 +3,39 @@ * * Copyright (c) 2016 JingPiao Chen * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include -#include #include #include +#include #include #include +#include #include #include +#include "print_fields.h" + +#define XLAT_MACROS_ONLY #include "xlat/loop_cmds.h" +#undef XLAT_MACROS_ONLY #ifndef ABBREV # define ABBREV 0 #endif +static long +sys_ioctl(kernel_long_t fd, kernel_ulong_t cmd, kernel_ulong_t arg) +{ + return syscall(__NR_ioctl, fd, cmd, arg); +} + static void print_loop_info(struct loop_info * const info, bool print_encrypt, const char *encrypt_type, const char *encrypt_key, @@ -54,8 +46,8 @@ print_loop_info(struct loop_info * const info, bool print_encrypt, #else printf("{lo_number=%d", info->lo_number); # if VERBOSE - printf(", lo_device=makedev(%u, %u), lo_inode=%lu, " - "lo_rdevice=makedev(%u, %u)", + printf(", lo_device=makedev(%#x, %#x), lo_inode=%lu, " + "lo_rdevice=makedev(%#x, %#x)", major(info->lo_device), minor(info->lo_device), info->lo_inode, major(info->lo_rdevice), minor(info->lo_rdevice)); @@ -80,8 +72,7 @@ print_loop_info(struct loop_info * const info, bool print_encrypt, else printf("%#x /* LO_FLAGS_??? */", info->lo_flags); - printf(", lo_name=\"%.*s\"", - (int) sizeof(info->lo_name) - 1, info->lo_name); + PRINT_FIELD_CSTRING(", ", *info, lo_name); if (VERBOSE || print_encrypt) printf(", lo_encrypt_key=\"%.*s\"", @@ -111,8 +102,8 @@ print_loop_info64(struct loop_info64 * const info64, bool print_encrypt, printf("%p", info64); #else # if VERBOSE - printf("{lo_device=makedev(%u, %u), lo_inode=%" PRIu64 - ", lo_rdevice=makedev(%u, %u), lo_offset=%#" PRIx64 + printf("{lo_device=makedev(%#x, %#x), lo_inode=%" PRIu64 + ", lo_rdevice=makedev(%#x, %#x), lo_offset=%#" PRIx64 ", lo_sizelimit=%" PRIu64 ", lo_number=%" PRIu32, major(info64->lo_device), minor(info64->lo_device), (uint64_t) info64->lo_inode, @@ -143,17 +134,16 @@ print_loop_info64(struct loop_info64 * const info64, bool print_encrypt, printf("%s", flags); else printf("%#x /* LO_FLAGS_??? */", info64->lo_flags); - printf(", lo_file_name=\"%.*s\"", - (int) sizeof(info64->lo_file_name) - 1, info64->lo_file_name); + PRINT_FIELD_CSTRING(", ", *info64, lo_file_name); - if (VERBOSE || print_encrypt) - printf(", lo_crypt_name=\"%.*s\", lo_encrypt_key=\"%.*s\"", - (int) sizeof(info64->lo_crypt_name) - 1, - info64->lo_crypt_name, + if (VERBOSE || print_encrypt) { + PRINT_FIELD_CSTRING(", ", *info64, lo_crypt_name); + printf(", lo_encrypt_key=\"%.*s\"", encrypt_key ? (int) strlen(encrypt_key) : (int) sizeof(info64->lo_encrypt_key), encrypt_key ? encrypt_key : (char *) info64->lo_encrypt_key); + } # if VERBOSE printf(", lo_init=[%#" PRIx64 ", %#" PRIx64 "]}", @@ -175,35 +165,37 @@ main(void) static const kernel_ulong_t kernel_mask = ((kernel_ulong_t) -1) - ((unsigned long) -1L); - struct loop_info * const info = tail_alloc(sizeof(*info)); - struct loop_info64 * const info64 = tail_alloc(sizeof(*info64)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct loop_info, info); + TAIL_ALLOC_OBJECT_CONST_PTR(struct loop_info64, info64); /* Unknown loop commands */ - ioctl(-1, unknown_loop_cmd, magic); - printf("ioctl(-1, _IOC(_IOC_READ|_IOC_WRITE%s, 0x4c, %#x, %#x), " + sys_ioctl(-1, unknown_loop_cmd, magic); + printf("ioctl(-1, _IOC(%s_IOC_READ|_IOC_WRITE, 0x4c, %#x, %#x), " "%#lx) = -1 EBADF (%m)\n", _IOC_DIR((unsigned int) unknown_loop_cmd) & _IOC_NONE ? - "|_IOC_NONE" : "", + "_IOC_NONE|" : "", _IOC_NR((unsigned int) unknown_loop_cmd), _IOC_SIZE((unsigned int) unknown_loop_cmd), (unsigned long) magic); - ioctl(-1, LOOP_SET_DIRECT_IO + 1, magic); - printf("ioctl(-1, _IOC(0, 0x4c, %#x, %#x), %#lx) = " + sys_ioctl(-1, LOOP_SET_BLOCK_SIZE + 1, magic); + printf("ioctl(-1, _IOC(%s, 0x4c, %#x, %#x), %#lx) = " "-1 EBADF (%m)\n", - _IOC_NR(LOOP_SET_DIRECT_IO + 1), - _IOC_SIZE(LOOP_SET_DIRECT_IO + 1), + _IOC_NONE ? "0" : "_IOC_NONE", + _IOC_NR(LOOP_SET_BLOCK_SIZE + 1), + _IOC_SIZE(LOOP_SET_BLOCK_SIZE + 1), (unsigned long) magic); - ioctl(-1, LOOP_CTL_GET_FREE + 1, magic); - printf("ioctl(-1, _IOC(0, 0x4c, %#x, %#x), %#lx) = " + sys_ioctl(-1, LOOP_CTL_GET_FREE + 1, magic); + printf("ioctl(-1, _IOC(%s, 0x4c, %#x, %#x), %#lx) = " "-1 EBADF (%m)\n", + _IOC_NONE ? "0" : "_IOC_NONE", _IOC_NR(LOOP_CTL_GET_FREE + 1), _IOC_SIZE(LOOP_CTL_GET_FREE + 1), (unsigned long) magic); /* LOOP_SET_FD */ - ioctl(-1, LOOP_SET_FD, magic); + sys_ioctl(-1, LOOP_SET_FD, magic); printf("ioctl(-1, LOOP_SET_FD, %d) = -1 EBADF (%m)\n", (unsigned int) magic); @@ -290,7 +282,7 @@ main(void) printf("ioctl(-1, LOOP_GET_STATUS64, %p) = -1 EBADF (%m)\n", info64); /* LOOP_CHANGE_FD */ - ioctl(-1, LOOP_CHANGE_FD, magic); + sys_ioctl(-1, LOOP_CHANGE_FD, magic); printf("ioctl(-1, LOOP_CHANGE_FD, %d) = -1 EBADF (%m)\n", (unsigned int) magic); @@ -299,17 +291,22 @@ main(void) printf("ioctl(-1, LOOP_SET_CAPACITY) = -1 EBADF (%m)\n"); /* LOOP_SET_DIRECT_IO */ - ioctl(-1, LOOP_SET_DIRECT_IO, magic); + sys_ioctl(-1, LOOP_SET_DIRECT_IO, magic); printf("ioctl(-1, LOOP_SET_DIRECT_IO, %lu) = -1 EBADF (%m)\n", (unsigned long) magic); + /* LOOP_SET_BLOCK_SIZE */ + sys_ioctl(-1, LOOP_SET_BLOCK_SIZE, magic); + printf("ioctl(-1, LOOP_SET_BLOCK_SIZE, %lu) = -1 EBADF (%m)\n", + (unsigned long) magic); + /* LOOP_CTL_ADD */ - ioctl(-1, LOOP_CTL_ADD, magic); + sys_ioctl(-1, LOOP_CTL_ADD, magic); printf("ioctl(-1, LOOP_CTL_ADD, %d) = -1 EBADF (%m)\n", (unsigned int) magic); /* LOOP_CTL_REMOVE */ - ioctl(-1, LOOP_CTL_REMOVE, magic); + sys_ioctl(-1, LOOP_CTL_REMOVE, magic); printf("ioctl(-1, LOOP_CTL_REMOVE, %d) = -1 EBADF (%m)\n", (unsigned int) magic); diff --git a/tests/ioctl_loop.gen.test b/tests/ioctl_loop.gen.test new file mode 100755 index 00000000..d4ec35ac --- /dev/null +++ b/tests/ioctl_loop.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_loop +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_loop.test b/tests/ioctl_loop.test deleted file mode 100755 index 112cd636..00000000 --- a/tests/ioctl_loop.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check decoding of LOOP_* ioctls. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a22 -eioctl $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests/ioctl_mtd.c b/tests/ioctl_mtd.c index a37d5d0f..cfc1d442 100644 --- a/tests/ioctl_mtd.c +++ b/tests/ioctl_mtd.c @@ -2,49 +2,28 @@ * This file is part of ioctl_mtd strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" -#include -#include -#include -#include -#include -#include -#include -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) -# include "mtd-abi.h" -#else +#ifdef HAVE_STRUCT_MTD_WRITE_REQ + +# include +# include +# include +# include +# include +# include +# include # include -#endif static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; -#define TEST_NULL_ARG(cmd) \ +# define TEST_NULL_ARG(cmd) \ do { \ ioctl(-1, cmd, 0); \ if (_IOC_DIR(cmd) == _IOC_WRITE) \ @@ -57,15 +36,17 @@ static const unsigned long lmagic = (unsigned long) 0xdeadbeefbadc0dedULL; (unsigned int) _IOC_NR(cmd), #cmd); \ else \ printf("ioctl(-1, %s, NULL) = -1 EBADF (%m)\n", #cmd); \ - } while (0) - -#define TEST_erase_info_user(cmd, eiu) \ - ioctl(-1, cmd, eiu); \ - printf("ioctl(-1, MIXER_%s(%u) or %s, {start=%#x, length=%#x})" \ - " = -1 EBADF (%m)\n", \ - (_IOC_DIR(cmd) == _IOC_READ) ? "READ" : "WRITE", \ - (unsigned int) _IOC_NR(cmd), #cmd, \ - eiu->start, eiu->length) + } while (0) + +# define TEST_erase_info_user(cmd, eiu) \ + do { \ + ioctl(-1, cmd, eiu); \ + printf("ioctl(-1, MIXER_%s(%u) or %s, {start=%#x, length=%#x})" \ + " = -1 EBADF (%m)\n", \ + (_IOC_DIR(cmd) == _IOC_READ) ? "READ" : "WRITE", \ + (unsigned int) _IOC_NR(cmd), #cmd, \ + eiu->start, eiu->length); \ + } while (0) int main(void) @@ -95,13 +76,13 @@ main(void) ioctl(-1, MTDFILEMODE, MTD_FILE_MODE_NORMAL); printf("ioctl(-1, MTDFILEMODE, MTD_FILE_MODE_NORMAL) = -1 EBADF (%m)\n"); - int *const opt = tail_alloc(sizeof(*opt)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, opt); *opt = MTD_OTP_OFF; ioctl(-1, OTPSELECT, opt); printf("ioctl(-1, MIXER_READ(%u) or OTPSELECT, [MTD_OTP_OFF])" " = -1 EBADF (%m)\n", (unsigned int) _IOC_NR(OTPSELECT)); - uint64_t *const v64 = tail_alloc(sizeof(*v64)); + TAIL_ALLOC_OBJECT_CONST_PTR(uint64_t, v64); fill_memory(v64, sizeof(*v64)); ioctl(-1, MEMGETBADBLOCK, v64); @@ -114,17 +95,17 @@ main(void) " = -1 EBADF (%m)\n", (unsigned int) _IOC_NR(MEMSETBADBLOCK), *v64); - struct region_info_user *const riu = tail_alloc(sizeof(*riu)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct region_info_user, riu); fill_memory(riu, sizeof(*riu)); ioctl(-1, MEMGETREGIONINFO, riu); printf("ioctl(-1, %s, {regionindex=%#x}) = -1 EBADF (%m)\n", "MEMGETREGIONINFO" -#ifdef __i386__ +# ifdef __i386__ " or MTRRIOC_GET_PAGE_ENTRY" -#endif +# endif , riu->regionindex); - struct erase_info_user *const eiu = tail_alloc(sizeof(*eiu)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct erase_info_user, eiu); fill_memory(eiu, sizeof(*eiu)); TEST_erase_info_user(MEMERASE, eiu); @@ -132,7 +113,7 @@ main(void) TEST_erase_info_user(MEMUNLOCK, eiu); TEST_erase_info_user(MEMISLOCKED, eiu); - struct erase_info_user64 *const eiu64 = tail_alloc(sizeof(*eiu64)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct erase_info_user64, eiu64); fill_memory(eiu64, sizeof(*eiu64)); ioctl(-1, MEMERASE64, eiu64); printf("ioctl(-1, MIXER_WRITE(%u) or %s, {start=%#llx, length=%#llx})" @@ -141,7 +122,7 @@ main(void) (unsigned long long) eiu64->start, (unsigned long long) eiu64->length); - struct mtd_oob_buf *const oob = tail_alloc(sizeof(*oob)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct mtd_oob_buf, oob); fill_memory(oob, sizeof(*oob)); ioctl(-1, MEMWRITEOOB, oob); @@ -152,7 +133,7 @@ main(void) printf("ioctl(-1, MEMREADOOB, {start=%#x, length=%#x, ptr=%p})" " = -1 EBADF (%m)\n", oob->start, oob->length, oob->ptr); - struct mtd_oob_buf64 *const oob64 = tail_alloc(sizeof(*oob64)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct mtd_oob_buf64, oob64); fill_memory(oob64, sizeof(*oob64)); ioctl(-1, MEMWRITEOOB64, oob64); @@ -168,14 +149,14 @@ main(void) (unsigned long long) oob64->usr_ptr); - struct otp_info *const oi = tail_alloc(sizeof(*oi)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct otp_info, oi); fill_memory(oi, sizeof(*oi)); ioctl(-1, OTPLOCK, oi); printf("ioctl(-1, MIXER_READ(%u) or OTPLOCK" ", {start=%#x, length=%#x, locked=%u}) = -1 EBADF (%m)\n", (unsigned int) _IOC_NR(OTPLOCK), oi->start, oi->length, oi->locked); - struct mtd_write_req *const wr = tail_alloc(sizeof(*wr)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct mtd_write_req, wr); fill_memory(wr, sizeof(*wr)); wr->mode = MTD_OPS_PLACE_OOB; ioctl(-1, MEMWRITE, wr); @@ -195,3 +176,9 @@ main(void) puts("+++ exited with 0 +++"); return 0; } + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_MTD_WRITE_REQ") + +#endif diff --git a/tests/ioctl_mtd.gen.test b/tests/ioctl_mtd.gen.test new file mode 100755 index 00000000..65b00037 --- /dev/null +++ b/tests/ioctl_mtd.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_mtd +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_mtd.test b/tests/ioctl_mtd.test deleted file mode 100755 index 08428073..00000000 --- a/tests/ioctl_mtd.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of 'M' type ioctls. - -. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_nbd.c b/tests/ioctl_nbd.c new file mode 100644 index 00000000..0992ca28 --- /dev/null +++ b/tests/ioctl_nbd.c @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +#define XLAT_MACROS_ONLY +#include "xlat/nbd_ioctl_cmds.h" +#include "xlat/nbd_ioctl_flags.h" +#undef XLAT_MACROS_ONLY + +#define RVAL_EBADF " = -1 EBADF (%m)\n" + +int +main(void) +{ + static const unsigned long ubeef = (unsigned long) 0xcafef00ddeadbeefULL; + static const char null_path[] = "/dev/null"; + + int fd = open(null_path, O_RDONLY); + if (fd < 0) + perror_msg_and_fail("open(\"%s\")", null_path); + + skip_if_unavailable("/proc/self/fd/"); + + ioctl(-1, NBD_DISCONNECT, NULL); + printf("ioctl(-1, NBD_DISCONNECT)" RVAL_EBADF); + ioctl(-1, NBD_CLEAR_SOCK, NULL); + printf("ioctl(-1, NBD_CLEAR_SOCK)" RVAL_EBADF); + ioctl(-1, NBD_DO_IT, NULL); + printf("ioctl(-1, NBD_DO_IT)" RVAL_EBADF); + ioctl(-1, NBD_CLEAR_QUE, NULL); + printf("ioctl(-1, NBD_CLEAR_QUE)" RVAL_EBADF); + ioctl(-1, NBD_PRINT_DEBUG, NULL); + printf("ioctl(-1, NBD_PRINT_DEBUG)" RVAL_EBADF); + ioctl(-1, NBD_SET_SOCK, fd); + printf("ioctl(-1, NBD_SET_SOCK, %d)" RVAL_EBADF, fd); + + ioctl(-1, NBD_SET_BLKSIZE, ubeef); + printf("ioctl(-1, NBD_SET_BLKSIZE, %lu)" RVAL_EBADF, ubeef); + ioctl(-1, NBD_SET_SIZE, ubeef); + printf("ioctl(-1, NBD_SET_SIZE, %lu)" RVAL_EBADF, ubeef); + ioctl(-1, NBD_SET_SIZE_BLOCKS, ubeef); + printf("ioctl(-1, NBD_SET_SIZE_BLOCKS, %lu)" RVAL_EBADF, ubeef); + + ioctl(-1, NBD_SET_TIMEOUT, ubeef); + printf("ioctl(-1, NBD_SET_TIMEOUT, %lu)" RVAL_EBADF, ubeef); + + ioctl(-1, NBD_SET_FLAGS, 0); + printf("ioctl(-1, NBD_SET_FLAGS, 0)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_HAS_FLAGS); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_HAS_FLAGS)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_READ_ONLY); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_READ_ONLY)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_FLUSH); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_FLUSH)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_FUA); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_FUA)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_TRIM); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_TRIM)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_WRITE_ZEROES); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_WRITE_ZEROES)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_DF); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_DF)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_CAN_MULTI_CONN); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_CAN_MULTI_CONN)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_RESIZE); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_RESIZE)" RVAL_EBADF); + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_CACHE); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_SEND_CACHE)" RVAL_EBADF); + + ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_HAS_FLAGS|NBD_FLAG_READ_ONLY| + NBD_FLAG_SEND_FUA|NBD_FLAG_SEND_CACHE| + (1 << 15)|(1<<31)); + printf("ioctl(-1, NBD_SET_FLAGS, NBD_FLAG_HAS_FLAGS|NBD_FLAG_READ_ONLY|" + "NBD_FLAG_SEND_FUA|NBD_FLAG_SEND_CACHE|0x80008000)" RVAL_EBADF); + + ioctl(-1, _IOC(_IOC_NONE, 0xab, 0xb, 0), NULL); + printf("ioctl(-1, _IOC(_IOC_NONE, 0xab, 0xb, 0), 0)" RVAL_EBADF); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/ioctl_nbd.gen.test b/tests/ioctl_nbd.gen.test new file mode 100755 index 00000000..55e287a2 --- /dev/null +++ b/tests/ioctl_nbd.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_nbd +ioctl.test -y); do not edit. +set -- -y +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_nsfs.c b/tests/ioctl_nsfs.c new file mode 100644 index 00000000..74dbe6e9 --- /dev/null +++ b/tests/ioctl_nsfs.c @@ -0,0 +1,126 @@ +/* + * Check decoding of NS_* commands of ioctl syscall. + * + * Copyright (c) 2017 Nikolay Marchuk + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include +#include "nsfs.h" + +#ifndef CLONE_NEWUSER +# define CLONE_NEWUSER 0x10000000 +#endif + +static void +test_no_namespace(void) +{ + ioctl(-1, NS_GET_USERNS); + printf("ioctl(-1, NS_GET_USERNS) = -1 EBADF (%m)\n"); + ioctl(-1, NS_GET_PARENT); + printf("ioctl(-1, NS_GET_PARENT) = -1 EBADF (%m)\n"); + ioctl(-1, NS_GET_NSTYPE); + printf("ioctl(-1, NS_GET_NSTYPE) = -1 EBADF (%m)\n"); + ioctl(-1, NS_GET_OWNER_UID, NULL); + printf("ioctl(-1, NS_GET_OWNER_UID, NULL) = -1 EBADF (%m)\n"); +} + +static void +test_clone(pid_t pid) +{ + char path[sizeof("/proc/%d/ns/user") + sizeof(int)*3]; + snprintf(path, sizeof(path), "/proc/%d/ns/user", pid); + + int ns_fd = open(path, O_RDONLY); + if (ns_fd == -1) + perror_msg_and_skip("open: %s", path); + + int userns_fd = ioctl(ns_fd, NS_GET_USERNS); + printf("ioctl(%d, NS_GET_USERNS) = %s\n", ns_fd, sprintrc(userns_fd)); + + int parent_ns_fd = ioctl(userns_fd, NS_GET_PARENT); + printf("ioctl(%d, NS_GET_PARENT) = %s\n", + userns_fd, sprintrc(parent_ns_fd)); + + int nstype = ioctl(userns_fd, NS_GET_NSTYPE); + if (nstype == -1) { + printf("ioctl(%d, NS_GET_NSTYPE) = %s\n", + userns_fd, sprintrc(nstype)); + } else { + printf("ioctl(%d, NS_GET_NSTYPE) = %d (CLONE_NEWUSER)\n", + userns_fd, nstype); + } + + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, uid); + int rc = ioctl(userns_fd, NS_GET_OWNER_UID, uid); + if (rc == -1) { + printf("ioctl(%d, NS_GET_OWNER_UID, %p) = %s\n", + userns_fd, uid, sprintrc(rc)); + } else { + printf("ioctl(%d, NS_GET_OWNER_UID, [%u]) = %d\n", + userns_fd, *uid, rc); + } +} + +static int +child(void *arg) +{ + int *pipefd = (int *) arg; + close(pipefd[1]); + /* Wait for EOF from pipe. */ + if (read(pipefd[0], &pipefd[1], 1)) + perror_msg_and_fail("read"); + return 0; +} + +#ifdef IA64 +extern int __clone2(int (*)(void *), void *, size_t, int, void *, ...); +# define clone(fn, child_stack, flags, arg) \ + __clone2(fn, child_stack, get_page_size() / 2, flags, arg) +#endif + +static void +test_user_namespace(void) +{ + pid_t pid; + int pipefd[2]; + int status; + + if (pipe(pipefd)) + perror_msg_and_fail("pipe"); + + pid = clone(child, tail_alloc(get_page_size() / 2), + CLONE_NEWUSER | CLONE_UNTRACED | SIGCHLD, pipefd); + if (pid == -1) { + perror("clone"); + return; + } + close(pipefd[0]); + test_clone(pid); + close(pipefd[1]); + if (wait(&status) != pid) { + perror_msg_and_fail("wait"); + } else if (status != 0) { + error_msg_and_fail("unexpected child exit status %d", status); + } +} + +int +main(void) +{ + test_no_namespace(); + test_user_namespace(); + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/ioctl_nsfs.gen.test b/tests/ioctl_nsfs.gen.test new file mode 100755 index 00000000..f9adc5f0 --- /dev/null +++ b/tests/ioctl_nsfs.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_nsfs +ioctl.test -esignal=none); do not edit. +set -- -esignal=none +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_perf-success.c b/tests/ioctl_perf-success.c new file mode 100644 index 00000000..eaf572ac --- /dev/null +++ b/tests/ioctl_perf-success.c @@ -0,0 +1,145 @@ +/* + * Check decoding of successful PERF_EVENT_IOC_{ID,QUERY_BPF} ioctls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_PERF_EVENT_H + +# include +# include +# include +# include +# include +# include +# include + +# ifndef PERF_EVENT_IOC_ID +# define PERF_EVENT_IOC_ID _IOR('$', 7, void *) +# endif + +# ifndef PERF_EVENT_IOC_QUERY_BPF +# define PERF_EVENT_IOC_QUERY_BPF _IOWR('$', 10, void *) + +struct perf_event_query_bpf { + uint32_t ids_len; + uint32_t prog_cnt; + uint32_t ids[0]; +}; +# endif + +int +main(int argc, char **argv) +{ + static const uint64_t magic64 = 0xfacefeeddeadc0deULL; + + TAIL_ALLOC_OBJECT_CONST_PTR(uint64_t, u64_ptr); + uint64_t *const u64_efault = u64_ptr + 1; + uint32_t *const u32_arr = tail_alloc(sizeof(uint32_t) * 4); + uint32_t *const u32_efault = u32_arr + 4; + + unsigned long num_skip; + long inject_retval; + bool locked = false; + + *u64_ptr = magic64; + + if (argc == 1) + return 0; + + if (argc < 3) + error_msg_and_fail("Usage: %s NUM_SKIP INJECT_RETVAL", argv[0]); + + num_skip = strtoul(argv[1], NULL, 0); + inject_retval = strtol(argv[2], NULL, 0); + + if (inject_retval < 0) + error_msg_and_fail("Expected non-negative INJECT_RETVAL, " + "but got %ld", inject_retval); + + for (unsigned long i = 0; i < num_skip; i++) { + long ret = ioctl(-1, PERF_EVENT_IOC_ID, NULL); + + printf("ioctl(-1, PERF_EVENT_IOC_ID, NULL) = %s%s\n", + sprintrc(ret), + ret == inject_retval ? " (INJECTED)" : ""); + + if (ret != inject_retval) + continue; + + locked = true; + break; + } + + if (!locked) + error_msg_and_fail("Hasn't locked on ioctl(-1" + ", PERF_EVENT_IOC_ID, NULL) returning %lu", + inject_retval); + + /* PERF_EVENT_IOC_ID */ + assert(ioctl(-1, PERF_EVENT_IOC_ID, NULL) == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_ID, NULL) = %ld (INJECTED)\n", + inject_retval); + + assert(ioctl(-1, PERF_EVENT_IOC_ID, u64_efault) == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_ID, %p) = %ld (INJECTED)\n", + u64_efault, inject_retval); + + assert(ioctl(-1, PERF_EVENT_IOC_ID, u64_ptr) == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_ID, [%" PRIu64 "]) = %ld (INJECTED)\n", + magic64, inject_retval); + + /* PERF_EVENT_IOC_QUERY_BPF */ + assert(ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, NULL) == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, NULL) = %ld (INJECTED)\n", + inject_retval); + + assert(ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, u32_efault) + == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, %p) = %ld (INJECTED)\n", + u32_efault, inject_retval); + + u32_arr[3] = 0xdeadbeef; + assert(ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, u32_arr + 3) + == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, {ids_len=3735928559, ...}) " + "= %ld (INJECTED)\n", + inject_retval); + + u32_arr[2] = 0xdecaffed; + assert(ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, u32_arr + 2) + == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, {ids_len=3737845741" + ", prog_cnt=3735928559, ids=%p})" + " = %ld (INJECTED)\n", + u32_efault, inject_retval); + + u32_arr[0] = 0xbadc0ded; + u32_arr[1] = 5; + assert(ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, u32_arr) == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, {ids_len=3134983661" + ", prog_cnt=5, ids=[3737845741, 3735928559, ... /* %p */]})" + " = %ld (INJECTED)\n", + u32_efault, inject_retval); + + u32_arr[1] = 2; + assert(ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, u32_arr) == inject_retval); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, {ids_len=3134983661" + ", prog_cnt=2, ids=[3737845741, 3735928559]})" + " = %ld (INJECTED)\n", + inject_retval); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_PERF_EVENT_H"); + +#endif diff --git a/tests/ioctl_perf-success.test b/tests/ioctl_perf-success.test new file mode 100755 index 00000000..2edd1d34 --- /dev/null +++ b/tests/ioctl_perf-success.test @@ -0,0 +1,20 @@ +#!/bin/sh -efu +# +# Check decoding of successful PERF_EVENT_IOC_{ID,QUERY_BPF} ioctls. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +: ${IOCTL_INJECT_START=256} +: ${IOCTL_INJECT_RETVAL=42} + +run_prog +run_strace -a35 -e trace=ioctl \ + -e inject=ioctl:retval="${IOCTL_INJECT_RETVAL}":when="${IOCTL_INJECT_START}+" \ + ../ioctl_perf-success "${IOCTL_INJECT_START}" "${IOCTL_INJECT_RETVAL}" > "$EXP" +grep -v '^ioctl([012][,<]' < "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests/ioctl_perf.c b/tests/ioctl_perf.c new file mode 100644 index 00000000..30cb35f6 --- /dev/null +++ b/tests/ioctl_perf.c @@ -0,0 +1,218 @@ +/* + * Check decoding of PERF_EVENT_IOC_* commands of ioctl syscall. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_PERF_EVENT_H + +# include +# include +# include +# include +# include +# include +# include + +/* + * Workaround the bug in kernel UAPI that was fixed + * in Linux commit v2.6.33-rc1~48^2~288^2~19. + */ +# ifndef u64 +# define u64 uint64_t +# endif + +# define XLAT_MACROS_ONLY +# include "xlat/perf_ioctl_cmds.h" +# undef XLAT_MACROS_ONLY + +# define STR16 "0123456789abcdef" + +static long +sys_ioctl(kernel_long_t fd, kernel_ulong_t cmd, kernel_ulong_t arg) +{ + return syscall(__NR_ioctl, fd, cmd, arg); +} + +int +main(void) +{ + static const kernel_ulong_t unknown_perf_cmd = + (kernel_ulong_t) 0xbadc0dedfeed24edULL; + static const kernel_ulong_t magic = + (kernel_ulong_t) 0xdeadbeefbadc0dedULL; + static const uint64_t magic64 = 0xfacefeeddeadc0deULL; + static const char str[] = STR16 STR16 STR16 STR16; + + static struct { + unsigned int cmd; + const char *str; + } flag_iocs[] = { + { ARG_STR(PERF_EVENT_IOC_ENABLE) }, + { ARG_STR(PERF_EVENT_IOC_DISABLE) }, + { ARG_STR(PERF_EVENT_IOC_RESET) }, + }; + + TAIL_ALLOC_OBJECT_CONST_PTR(uint64_t, u64_ptr); + uint64_t *const u64_efault = u64_ptr + 1; + uint32_t *const u32_arr = tail_alloc(sizeof(uint32_t) * 4); + uint32_t *const u32_efault = u32_arr + 4; + char *const str_ptr = tail_memdup(str, sizeof(str)); + char *const str_efault = str_ptr + sizeof(str); + TAIL_ALLOC_OBJECT_CONST_PTR(struct perf_event_attr, pea_ptr); + + *u64_ptr = magic64; + fill_memory_ex(pea_ptr, sizeof(*pea_ptr), 0xaa, 0x55); + + /* Unknown perf commands */ + sys_ioctl(-1, unknown_perf_cmd, magic); + printf("ioctl(-1, _IOC(%s_IOC_READ|_IOC_WRITE, 0x24, %#x, %#x), " + "%#lx) = -1 EBADF (%m)\n", + _IOC_DIR((unsigned int) unknown_perf_cmd) & _IOC_NONE ? + "_IOC_NONE|" : "", + _IOC_NR((unsigned int) unknown_perf_cmd), + _IOC_SIZE((unsigned int) unknown_perf_cmd), + (unsigned long) magic); + + sys_ioctl(-1, PERF_EVENT_IOC_MODIFY_ATTRIBUTES + 1, magic); + printf("ioctl(-1, _IOC(_IOC_WRITE, 0x24, %#x, %#x), %#lx)" + " = -1 EBADF (%m)\n", + (unsigned int) _IOC_NR(PERF_EVENT_IOC_MODIFY_ATTRIBUTES + 1), + (unsigned int) _IOC_SIZE(PERF_EVENT_IOC_MODIFY_ATTRIBUTES + 1), + (unsigned long) magic); + + /* PERF_EVENT_IOC_{ENABLE,DISABLE,RESET} */ + for (unsigned i = 0; i < ARRAY_SIZE(flag_iocs); i++) { + ioctl(-1, flag_iocs[i].cmd, 0); + printf("ioctl(-1, %s, 0) = -1 EBADF (%m)\n", flag_iocs[i].str); + + ioctl(-1, flag_iocs[i].cmd, 1); + printf("ioctl(-1, %s, PERF_IOC_FLAG_GROUP) = -1 EBADF (%m)\n", + flag_iocs[i].str); + + ioctl(-1, flag_iocs[i].cmd, 2); + printf("ioctl(-1, %s, 0x2 /* PERF_IOC_FLAG_??? */) " + "= -1 EBADF (%m)\n", + flag_iocs[i].str); + + sys_ioctl(-1, flag_iocs[i].cmd, magic); + printf("ioctl(-1, %s, PERF_IOC_FLAG_GROUP|%#x) " + "= -1 EBADF (%m)\n", + flag_iocs[i].str, (unsigned int) magic & ~1U); + } + + /* PERF_EVENT_IOC_REFRESH */ + sys_ioctl(-1, PERF_EVENT_IOC_REFRESH, magic); + printf("ioctl(-1, PERF_EVENT_IOC_REFRESH, %d) = -1 EBADF (%m)\n", + (int) magic); + + /* PERF_EVENT_IOC_PERIOD */ + ioctl(-1, PERF_EVENT_IOC_PERIOD, NULL); + printf("ioctl(-1, PERF_EVENT_IOC_PERIOD, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, PERF_EVENT_IOC_PERIOD, u64_efault); + printf("ioctl(-1, PERF_EVENT_IOC_PERIOD, %p) = -1 EBADF (%m)\n", + u64_efault); + + ioctl(-1, PERF_EVENT_IOC_PERIOD, u64_ptr); + printf("ioctl(-1, PERF_EVENT_IOC_PERIOD, [%" PRIu64 "])" + " = -1 EBADF (%m)\n", + magic64); + + /* PERF_EVENT_IOC_SET_OUTPUT */ + sys_ioctl(-1, PERF_EVENT_IOC_SET_OUTPUT, magic); + printf("ioctl(-1, PERF_EVENT_IOC_SET_OUTPUT, %d) = -1 EBADF (%m)\n", + (int) magic); + + /* PERF_EVENT_IOC_SET_FILTER */ + ioctl(-1, PERF_EVENT_IOC_SET_FILTER, NULL); + printf("ioctl(-1, PERF_EVENT_IOC_SET_FILTER, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, PERF_EVENT_IOC_SET_FILTER, str_efault); + printf("ioctl(-1, PERF_EVENT_IOC_SET_FILTER, %p) = -1 EBADF (%m)\n", + str_efault); + + ioctl(-1, PERF_EVENT_IOC_SET_FILTER, str_ptr); + printf("ioctl(-1, PERF_EVENT_IOC_SET_FILTER, \"%.32s\"...)" + " = -1 EBADF (%m)\n", + str_ptr); + + ioctl(-1, PERF_EVENT_IOC_SET_FILTER, str_ptr + 40); + printf("ioctl(-1, PERF_EVENT_IOC_SET_FILTER, \"%.32s\")" + " = -1 EBADF (%m)\n", + str_ptr + 40); + + str_ptr[sizeof(str) - 1] = '0'; + ioctl(-1, PERF_EVENT_IOC_SET_FILTER, str_ptr + 40); + printf("ioctl(-1, PERF_EVENT_IOC_SET_FILTER, %p)" + " = -1 EBADF (%m)\n", + str_ptr + 40); + + /* PERF_EVENT_IOC_ID */ + ioctl(-1, PERF_EVENT_IOC_ID, NULL); + printf("ioctl(-1, PERF_EVENT_IOC_ID, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, PERF_EVENT_IOC_ID, u64_efault); + printf("ioctl(-1, PERF_EVENT_IOC_ID, %p) = -1 EBADF (%m)\n", + u64_efault); + + ioctl(-1, PERF_EVENT_IOC_ID, u64_ptr); + printf("ioctl(-1, PERF_EVENT_IOC_ID, %p) = -1 EBADF (%m)\n", + u64_ptr); + + /* PERF_EVENT_IOC_SET_BPF */ + sys_ioctl(-1, PERF_EVENT_IOC_SET_BPF, magic); + printf("ioctl(-1, PERF_EVENT_IOC_SET_BPF, %d) = -1 EBADF (%m)\n", + (int) magic); + + /* PERF_EVENT_IOC_PAUSE_OUTPUT */ + sys_ioctl(-1, PERF_EVENT_IOC_PAUSE_OUTPUT, magic); + printf("ioctl(-1, PERF_EVENT_IOC_PAUSE_OUTPUT, %lu) = -1 EBADF (%m)\n", + (unsigned long) magic); + + /* PERF_EVENT_IOC_QUERY_BPF */ + ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, NULL); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, NULL) = -1 EBADF (%m)\n"); + + ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, u32_efault); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, %p) = -1 EBADF (%m)\n", + u32_efault); + + u32_arr[0] = 0xbadc0ded; + ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, u32_arr); + printf("ioctl(-1, PERF_EVENT_IOC_QUERY_BPF, {ids_len=3134983661, ...})" + " = -1 EBADF (%m)\n"); + + /* PERF_EVENT_IOC_MODIFY_ATTRIBUTES */ + ioctl(-1, PERF_EVENT_IOC_MODIFY_ATTRIBUTES, NULL); + printf("ioctl(-1, PERF_EVENT_IOC_MODIFY_ATTRIBUTES, NULL)" + " = -1 EBADF (%m)\n"); + + ioctl(-1, PERF_EVENT_IOC_MODIFY_ATTRIBUTES, pea_ptr + 1); + printf("ioctl(-1, PERF_EVENT_IOC_MODIFY_ATTRIBUTES, %p)" + " = -1 EBADF (%m)\n", + pea_ptr + 1); + + printf("ioctl(-1, PERF_EVENT_IOC_MODIFY_ATTRIBUTES" + ", {type=%#x /* PERF_TYPE_??? */" + ", size=%#x /* PERF_ATTR_SIZE_??? */" + ", config=%#llx, ...}) = -1 EBADF (%m)\n", + (unsigned int) pea_ptr->type, + (unsigned int) pea_ptr->size, + (unsigned long long) pea_ptr->config); + ioctl(-1, PERF_EVENT_IOC_MODIFY_ATTRIBUTES, pea_ptr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_PERF_EVENT_H"); + +#endif diff --git a/tests/ioctl_perf.gen.test b/tests/ioctl_perf.gen.test new file mode 100755 index 00000000..0264f349 --- /dev/null +++ b/tests/ioctl_perf.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_perf +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_ptp.c b/tests/ioctl_ptp.c new file mode 100644 index 00000000..52d9698a --- /dev/null +++ b/tests/ioctl_ptp.c @@ -0,0 +1,111 @@ +/* + * Check decoding of PTP_* commands of ioctl syscall. + * + * Copyright (c) 2018 Harsha Sharma + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_PTP_SYS_OFFSET + +# include +# include +# include +# include +# include +# include +# include +# include + +# include "xlat.h" +# include "xlat/ptp_flags_options.h" + +static void +test_no_device(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct ptp_clock_caps, caps); + fill_memory(caps, sizeof(*caps)); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct ptp_sys_offset, sysoff); + fill_memory(sysoff, sizeof(*sysoff)); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct ptp_extts_request, extts); + fill_memory(extts, sizeof(*extts)); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct ptp_perout_request, perout); + fill_memory(perout, sizeof(*perout)); + + int saved_errno; + + /* PTP_CLOCK_GETCAPS */ + ioctl(-1, PTP_CLOCK_GETCAPS, NULL); + printf("ioctl(-1, PTP_CLOCK_GETCAPS, NULL) = -1 EBADF (%m)\n"); + ioctl(-1, PTP_CLOCK_GETCAPS, caps); + printf("ioctl(-1, PTP_CLOCK_GETCAPS, %p) = -1 EBADF (%m)\n", caps); + + /* PTP_SYS_OFFSET */ + ioctl(-1, PTP_SYS_OFFSET, NULL); + printf("ioctl(-1, PTP_SYS_OFFSET, NULL) = -1 EBADF (%m)\n"); + ioctl(-1, PTP_SYS_OFFSET, sysoff); + printf("ioctl(-1, PTP_SYS_OFFSET, {n_samples=%u}) = -1 EBADF (%m)\n", + sysoff->n_samples); + + /* PTP_ENABLE_PPS */ + ioctl(-1, PTP_ENABLE_PPS, 0); + printf("ioctl(-1, PTP_ENABLE_PPS, 0) = -1 EBADF (%m)\n"); + ioctl(-1, PTP_ENABLE_PPS, 1); + printf("ioctl(-1, PTP_ENABLE_PPS, 1) = -1 EBADF (%m)\n"); + + /* PTP_EXTTS_REQUEST */ + ioctl(-1, PTP_EXTTS_REQUEST, NULL); + printf("ioctl(-1, PTP_EXTTS_REQUEST, NULL) = -1 EBADF (%m)\n"); + ioctl(-1, PTP_EXTTS_REQUEST, extts); + saved_errno = errno; + printf("ioctl(-1, PTP_EXTTS_REQUEST, {index=%d, flags=", extts->index); + printflags(ptp_flags_options, extts->flags, "PTP_???"); + errno = saved_errno; + printf("}) = -1 EBADF (%m)\n"); + + /* PTP_PEROUT_REQUEST */ + ioctl(-1, PTP_PEROUT_REQUEST, NULL); + printf("ioctl(-1, PTP_PEROUT_REQUEST, NULL) = -1 EBADF (%m)\n"); + ioctl(-1, PTP_PEROUT_REQUEST, perout); + saved_errno = errno; + printf("ioctl(-1, PTP_PEROUT_REQUEST, {start={sec=%" PRId64 + ", nsec=%" PRIu32 "}, period={sec=%" PRId64 ", nsec=%" PRIu32 "}" + ", index=%d, flags=", + (int64_t) perout->start.sec, perout->start.nsec, + (int64_t)perout->period.sec, perout->period.nsec, perout->index); + printflags(ptp_flags_options, perout->flags, "PTP_???"); + errno = saved_errno; + printf("}) = -1 EBADF (%m)\n"); + + /* unrecognized */ + ioctl(-1, _IOC(_IOC_READ, PTP_CLK_MAGIC, 0xff, 0xfe), 0); + printf("ioctl(-1, _IOC(_IOC_READ, %#x, 0xff, 0xfe), 0)" + " = -1 EBADF (%m)\n", PTP_CLK_MAGIC); + + const unsigned long arg = (unsigned long) 0xfacefeeddeadbeefULL; + ioctl(-1, _IOC(_IOC_WRITE, PTP_CLK_MAGIC, 0xfd, 0xfc), arg); + printf("ioctl(-1, _IOC(_IOC_WRITE, %#x, 0xfd, 0xfc), %#lx)" + " = -1 EBADF (%m)\n", PTP_CLK_MAGIC, arg); +} + +int +main(void) +{ + test_no_device(); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_PTP_SYS_OFFSET") + +#endif /* HAVE_STRUCT_PTP_SYS_OFFSET */ diff --git a/tests/ioctl_ptp.gen.test b/tests/ioctl_ptp.gen.test new file mode 100755 index 00000000..6c0b0a92 --- /dev/null +++ b/tests/ioctl_ptp.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_ptp +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_random.c b/tests/ioctl_random.c new file mode 100644 index 00000000..0d8e9f28 --- /dev/null +++ b/tests/ioctl_random.c @@ -0,0 +1,61 @@ +/* + * Check decoding of RND* commands of ioctl syscall. + * + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +#define XLAT_MACROS_ONLY +#include "xlat/random_ioctl_cmds.h" +#undef XLAT_MACROS_ONLY + +#define RVAL_EBADF " = -1 EBADF (%m)\n" + +int +main(void) +{ + union { + char c[sizeof(struct rand_pool_info) + 8]; + struct rand_pool_info info; + } u; + struct rand_pool_info *info = &u.info; + int cnt = 6; + + memcpy(info->buf, "12345678", 8); + info->buf_size = 8; + info->entropy_count = 3; + + ioctl(-1, RNDGETENTCNT, &cnt); + printf("ioctl(-1, RNDGETENTCNT, %p)" RVAL_EBADF, &cnt); + ioctl(-1, RNDADDTOENTCNT, &cnt); + printf("ioctl(-1, RNDADDTOENTCNT, [6])" RVAL_EBADF); + + ioctl(-1, RNDADDENTROPY, NULL); + printf("ioctl(-1, RNDADDENTROPY, NULL)" RVAL_EBADF); + ioctl(-1, RNDADDENTROPY, info); + printf("ioctl(-1, RNDADDENTROPY, {entropy_count=3, buf_size=8, buf=\"12345678\"})" RVAL_EBADF); + + ioctl(-1, RNDZAPENTCNT); + printf("ioctl(-1, FASTRPC_IOCTL_INIT_ATTACH or RNDZAPENTCNT)" + RVAL_EBADF); + ioctl(-1, RNDCLEARPOOL); + printf("ioctl(-1, RNDCLEARPOOL)" RVAL_EBADF); + ioctl(-1, RNDRESEEDCRNG); + printf("ioctl(-1, RNDRESEEDCRNG)" RVAL_EBADF); + + ioctl(-1, _IO('R', 0xff), NULL); + printf("ioctl(-1, _IOC(_IOC_NONE, %#x, 0xff, 0), 0)" RVAL_EBADF, 'R'); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/ioctl_random.gen.test b/tests/ioctl_random.gen.test new file mode 100755 index 00000000..3afcab0a --- /dev/null +++ b/tests/ioctl_random.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_random +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_rtc-v.gen.test b/tests/ioctl_rtc-v.gen.test new file mode 100755 index 00000000..820181b0 --- /dev/null +++ b/tests/ioctl_rtc-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_rtc-v +ioctl.test -v); do not edit. +set -- -v +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_rtc-v.test b/tests/ioctl_rtc-v.test deleted file mode 100755 index a255322d..00000000 --- a/tests/ioctl_rtc-v.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check verbose decoding of RTC_* ioctls. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a16 -veioctl $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests/ioctl_rtc.c b/tests/ioctl_rtc.c index 49d7ec7b..d192e378 100644 --- a/tests/ioctl_rtc.c +++ b/tests/ioctl_rtc.c @@ -2,29 +2,10 @@ * This file is part of ioctl_rtc strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -73,13 +54,13 @@ main(void) void *const page = tail_alloc(size); fill_memory(page, size); - struct rtc_time *rt = tail_alloc(sizeof(*rt)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct rtc_time, rt); fill_memory(rt, sizeof(*rt)); - struct rtc_wkalrm *wk = tail_alloc(sizeof(*wk)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct rtc_wkalrm, wk); fill_memory(wk, sizeof(*wk)); - struct rtc_pll_info *pll = tail_alloc(sizeof(*pll)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct rtc_pll_info, pll); fill_memory(pll, sizeof(*pll)); /* RTC_ALM_READ */ diff --git a/tests/ioctl_rtc.gen.test b/tests/ioctl_rtc.gen.test new file mode 100755 index 00000000..310b5588 --- /dev/null +++ b/tests/ioctl_rtc.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_rtc +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_rtc.test b/tests/ioctl_rtc.test deleted file mode 100755 index 4545f2ae..00000000 --- a/tests/ioctl_rtc.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check basic decoding of RTC_* ioctls. - -. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_scsi.c b/tests/ioctl_scsi.c index 0db94d84..b6347b62 100644 --- a/tests/ioctl_scsi.c +++ b/tests/ioctl_scsi.c @@ -2,29 +2,10 @@ * Check decoding of SCSI ioctl commands. * * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -69,7 +50,7 @@ int main(void) { - int *const pint = tail_alloc(sizeof(*pint)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, pint); *pint = (int) 0xfacefeed; TEST_NO_ARG(SG_GET_TIMEOUT); @@ -137,13 +118,14 @@ main(void) "SG_SCSI_RESET"); ioctl(-1, 0x22ff, 0); - printf("ioctl(-1, _IOC(0, 0x22, 0xff, 0), 0) = -1 EBADF (%m)\n"); + printf("ioctl(-1, _IOC(%s, 0x22, 0xff, 0), 0) = -1 EBADF (%m)\n", + _IOC_NONE ? "0" : "_IOC_NONE"); static const unsigned long magic = (unsigned long) 0xdeadbeeffacefeedULL; ioctl(-1, 0x22ff, magic); - printf("ioctl(-1, _IOC(0, 0x22, 0xff, 0), %#lx) = -1 EBADF (%m)\n", - magic); + printf("ioctl(-1, _IOC(%s, 0x22, 0xff, 0), %#lx) = -1 EBADF (%m)\n", + _IOC_NONE ? "0" : "_IOC_NONE", magic); puts("+++ exited with 0 +++"); return 0; diff --git a/tests/ioctl_scsi.gen.test b/tests/ioctl_scsi.gen.test new file mode 100755 index 00000000..499bfc49 --- /dev/null +++ b/tests/ioctl_scsi.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_scsi +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_scsi.test b/tests/ioctl_scsi.test deleted file mode 100755 index 2710f12b..00000000 --- a/tests/ioctl_scsi.test +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -# Check decoding of SCSI ioctl commands. -. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_sg_io_v3.c b/tests/ioctl_sg_io_v3.c index ef25795b..b857892f 100644 --- a/tests/ioctl_sg_io_v3.c +++ b/tests/ioctl_sg_io_v3.c @@ -1,30 +1,10 @@ /* * Check decoding of ioctl SG_IO v3 commands. * - * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -43,7 +23,7 @@ main(void) ioctl(-1, SG_IO, 0); printf("ioctl(-1, SG_IO, NULL) = -1 EBADF (%m)\n"); - struct sg_io_hdr *const sg_io = tail_alloc(sizeof(*sg_io)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sg_io_hdr, sg_io); fill_memory(sg_io, sizeof(*sg_io)); const void *const efault = sg_io + 1; @@ -53,7 +33,7 @@ main(void) ioctl(-1, SG_IO, sg_io); printf("ioctl(-1, SG_IO, [%u]) = -1 EBADF (%m)\n", sg_io->interface_id); - unsigned int *const piid = tail_alloc(sizeof(*piid)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, piid); *piid = (unsigned char) 'S'; ioctl(-1, SG_IO, piid); printf("ioctl(-1, SG_IO, {interface_id='S', %p}) = -1 EBADF (%m)\n", piid + 1); @@ -198,12 +178,12 @@ main(void) sg_io->iovec_count, sg_io->dxfer_len, sg_io->timeout, - * (unsigned char *) (iov[0].iov_base + 0), - * (unsigned char *) (iov[0].iov_base + 1), + *(unsigned char *) (iov[0].iov_base + 0), + *(unsigned char *) (iov[0].iov_base + 1), (unsigned int) iov[0].iov_len, - * (unsigned char *) (iov[1].iov_base + 0), - * (unsigned char *) (iov[1].iov_base + 1), - * (unsigned char *) (iov[1].iov_base + 2), + *(unsigned char *) (iov[1].iov_base + 0), + *(unsigned char *) (iov[1].iov_base + 1), + *(unsigned char *) (iov[1].iov_base + 2), (unsigned int) iov[1].iov_len, sg_io->status, sg_io->masked_status, @@ -248,12 +228,12 @@ main(void) sg_io->iovec_count, sg_io->dxfer_len, sg_io->timeout, - * (unsigned char *) (iov[0].iov_base + 0), - * (unsigned char *) (iov[0].iov_base + 1), + *(unsigned char *) (iov[0].iov_base + 0), + *(unsigned char *) (iov[0].iov_base + 1), (unsigned int) iov[0].iov_len, - * (unsigned char *) (iov[1].iov_base + 0), - * (unsigned char *) (iov[1].iov_base + 1), - * (unsigned char *) (iov[1].iov_base + 2), + *(unsigned char *) (iov[1].iov_base + 0), + *(unsigned char *) (iov[1].iov_base + 1), + *(unsigned char *) (iov[1].iov_base + 2), (unsigned int) iov[1].iov_len, sg_io->status, sg_io->masked_status, @@ -300,10 +280,10 @@ main(void) sg_io->iovec_count, sg_io->dxfer_len, sg_io->timeout, - * (unsigned char *) (sg_io->dxferp + 0), - * (unsigned char *) (sg_io->dxferp + 1), - * (unsigned char *) (sg_io->dxferp + 2), - * (unsigned char *) (sg_io->dxferp + 3), + *(unsigned char *) (sg_io->dxferp + 0), + *(unsigned char *) (sg_io->dxferp + 1), + *(unsigned char *) (sg_io->dxferp + 2), + *(unsigned char *) (sg_io->dxferp + 3), sg_io->status, sg_io->masked_status, sg_io->msg_status, @@ -348,11 +328,11 @@ main(void) sg_io->iovec_count, sg_io->dxfer_len, sg_io->timeout, - * (unsigned char *) (sg_io->dxferp + 0), - * (unsigned char *) (sg_io->dxferp + 1), - * (unsigned char *) (sg_io->dxferp + 2), - * (unsigned char *) (sg_io->dxferp + 0), - * (unsigned char *) (sg_io->dxferp + 1), + *(unsigned char *) (sg_io->dxferp + 0), + *(unsigned char *) (sg_io->dxferp + 1), + *(unsigned char *) (sg_io->dxferp + 2), + *(unsigned char *) (sg_io->dxferp + 0), + *(unsigned char *) (sg_io->dxferp + 1), sg_io->status, sg_io->masked_status, sg_io->msg_status, @@ -394,9 +374,9 @@ main(void) sg_io->iovec_count, sg_io->dxfer_len, sg_io->timeout, - * (unsigned char *) (sg_io->dxferp + 0), - * (unsigned char *) (sg_io->dxferp + 1), - * (unsigned char *) (sg_io->dxferp + 2), + *(unsigned char *) (sg_io->dxferp + 0), + *(unsigned char *) (sg_io->dxferp + 1), + *(unsigned char *) (sg_io->dxferp + 2), sg_io->status, sg_io->masked_status, sg_io->msg_status, diff --git a/tests/ioctl_sg_io_v3.gen.test b/tests/ioctl_sg_io_v3.gen.test new file mode 100755 index 00000000..ef8fd14d --- /dev/null +++ b/tests/ioctl_sg_io_v3.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_sg_io_v3 +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_sg_io_v3.test b/tests/ioctl_sg_io_v3.test deleted file mode 100755 index dacacdf4..00000000 --- a/tests/ioctl_sg_io_v3.test +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -# Check decoding of ioctl SG_IO v3 commands. -. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_sg_io_v4.c b/tests/ioctl_sg_io_v4.c index 5f899eee..59438285 100644 --- a/tests/ioctl_sg_io_v4.c +++ b/tests/ioctl_sg_io_v4.c @@ -1,30 +1,10 @@ /* * Check decoding of ioctl SG_IO v4 commands. * - * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -45,7 +25,7 @@ main(void) ioctl(-1, SG_IO, 0); printf("ioctl(-1, SG_IO, NULL) = -1 EBADF (%m)\n"); - struct sg_io_v4 *const sg_io = tail_alloc(sizeof(*sg_io)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sg_io_v4, sg_io); fill_memory(sg_io, sizeof(*sg_io)); const void *const efault = sg_io + 1; @@ -55,7 +35,7 @@ main(void) ioctl(-1, SG_IO, sg_io); printf("ioctl(-1, SG_IO, [%u]) = -1 EBADF (%m)\n", sg_io->guard); - unsigned int *const pguard = tail_alloc(sizeof(*pguard)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, pguard); *pguard = (unsigned char) 'Q'; ioctl(-1, SG_IO, pguard); printf("ioctl(-1, SG_IO, {guard='Q', %p}) = -1 EBADF (%m)\n", pguard + 1); @@ -189,9 +169,9 @@ main(void) ", dout_resid=%d" ", generated_tag=%#" PRI__x64 "}) = -1 EBADF (%m)\n", sg_io->request_len, - * (unsigned char *) ((unsigned long) sg_io->request + 0), - * (unsigned char *) ((unsigned long) sg_io->request + 1), - * (unsigned char *) ((unsigned long) sg_io->request + 2), + *(unsigned char *) ((unsigned long) sg_io->request + 0), + *(unsigned char *) ((unsigned long) sg_io->request + 1), + *(unsigned char *) ((unsigned long) sg_io->request + 2), sg_io->request_tag, sg_io->request_attr, sg_io->request_priority, @@ -201,22 +181,22 @@ main(void) sg_io->dout_xfer_len, sg_io->din_iovec_count, sg_io->din_xfer_len, - * (unsigned char *) (iov[0].iov_base + 0), - * (unsigned char *) (iov[0].iov_base + 1), + *(unsigned char *) (iov[0].iov_base + 0), + *(unsigned char *) (iov[0].iov_base + 1), (unsigned int) iov[0].iov_len, - * (unsigned char *) (iov[1].iov_base + 0), - * (unsigned char *) (iov[1].iov_base + 1), - * (unsigned char *) (iov[1].iov_base + 2), + *(unsigned char *) (iov[1].iov_base + 0), + *(unsigned char *) (iov[1].iov_base + 1), + *(unsigned char *) (iov[1].iov_base + 2), (unsigned int) iov[1].iov_len, sg_io->timeout, sg_io->usr_ptr, sg_io->response_len, - * (unsigned char *) ((unsigned long) sg_io->response + 0), - * (unsigned char *) ((unsigned long) sg_io->response + 1), - * (unsigned char *) ((unsigned long) sg_io->din_xferp + 0), - * (unsigned char *) ((unsigned long) sg_io->din_xferp + 1), - * (unsigned char *) ((unsigned long) sg_io->din_xferp + 2), - * (unsigned char *) ((unsigned long) sg_io->din_xferp + 3), + *(unsigned char *) ((unsigned long) sg_io->response + 0), + *(unsigned char *) ((unsigned long) sg_io->response + 1), + *(unsigned char *) ((unsigned long) sg_io->din_xferp + 0), + *(unsigned char *) ((unsigned long) sg_io->din_xferp + 1), + *(unsigned char *) ((unsigned long) sg_io->din_xferp + 2), + *(unsigned char *) ((unsigned long) sg_io->din_xferp + 3), sg_io->driver_status, sg_io->transport_status, sg_io->device_status, diff --git a/tests/ioctl_sg_io_v4.gen.test b/tests/ioctl_sg_io_v4.gen.test new file mode 100755 index 00000000..4aa4e4e9 --- /dev/null +++ b/tests/ioctl_sg_io_v4.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_sg_io_v4 +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_sg_io_v4.test b/tests/ioctl_sg_io_v4.test deleted file mode 100755 index 25567224..00000000 --- a/tests/ioctl_sg_io_v4.test +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -# Check decoding of ioctl SG_IO v4 commands. -. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_sock_gifconf.c b/tests/ioctl_sock_gifconf.c index ae0bea4f..0db9d7da 100644 --- a/tests/ioctl_sock_gifconf.c +++ b/tests/ioctl_sock_gifconf.c @@ -2,34 +2,14 @@ * Check decoding of SIOCGIFCONF command of ioctl syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" -#include #include #include @@ -104,7 +84,7 @@ print_ifconf(struct ifconf *ifc, int in_len, char *in_buf, long rc) static void gifconf_ioctl(int fd, struct ifconf *ifc, bool ifc_valid) { - const char * errstr; + const char *errstr; int in_len; char *in_buf; long rc; @@ -134,7 +114,7 @@ int main(int argc, char *argv[]) { struct ifreq *ifr = tail_alloc(2 * sizeof(*ifr)); - struct ifconf *ifc = tail_alloc(sizeof(*ifc)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct ifconf, ifc); struct sockaddr_in addr; int fd; diff --git a/tests/ioctl_sock_gifconf.gen.test b/tests/ioctl_sock_gifconf.gen.test new file mode 100755 index 00000000..5d6fe2f4 --- /dev/null +++ b/tests/ioctl_sock_gifconf.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_sock_gifconf +ioctl.test -a28 -s1); do not edit. +set -- -a28 -s1 +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_sock_gifconf.test b/tests/ioctl_sock_gifconf.test deleted file mode 100755 index 2e2fc019..00000000 --- a/tests/ioctl_sock_gifconf.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check decoding of SIOCGIFCONF ioctl. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -a28 -s1 -eioctl $args > "$EXP" -check_prog grep -grep -v '^ioctl([012],' < "$LOG" > "$OUT" -match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests/ioctl_uffdio.c b/tests/ioctl_uffdio.c index 10b8b843..19104442 100644 --- a/tests/ioctl_uffdio.c +++ b/tests/ioctl_uffdio.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Red Hat, Inc. + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -43,6 +24,9 @@ # include # include +# include "xlat.h" +# include "xlat/uffd_api_features.h" + int main(void) { @@ -54,7 +38,7 @@ main(void) perror_msg_and_skip("userfaultfd"); /* ---- API ---- */ - struct uffdio_api *api_struct = tail_alloc(sizeof(*api_struct)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct uffdio_api, api_struct); /* With a bad fd */ memset(api_struct, 0, sizeof(*api_struct)); @@ -69,10 +53,14 @@ main(void) api_struct->api = UFFD_API; api_struct->features = 0; rc = ioctl(fd, UFFDIO_API, api_struct); - printf("ioctl(%d, UFFDIO_API, {api=0xaa, features=0, " - "features.out=%#" PRIx64 ", " "ioctls=1<<_UFFDIO_REGISTER|" - "1<<_UFFDIO_UNREGISTER|1<<_UFFDIO_API", - fd, (uint64_t)api_struct->features); + printf("ioctl(%d, UFFDIO_API, {api=0xaa, features=0", fd); + if (api_struct->features) { + printf(" => features="); + printflags(uffd_api_features, api_struct->features, + "UFFD_FEATURE_???"); + } + printf(", ioctls=1<<_UFFDIO_REGISTER|" + "1<<_UFFDIO_UNREGISTER|1<<_UFFDIO_API"); api_struct->ioctls &= ~(1ull<<_UFFDIO_REGISTER| 1ull<<_UFFDIO_UNREGISTER| 1ull<<_UFFDIO_API); @@ -127,7 +115,7 @@ main(void) * userfaultfd will cause us to stall. */ /* ---- COPY ---- */ - struct uffdio_copy *copy_struct = tail_alloc(sizeof(*copy_struct)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct uffdio_copy, copy_struct); memset(copy_struct, 0, sizeof(*copy_struct)); rc = ioctl(-1, UFFDIO_COPY, copy_struct); @@ -148,7 +136,7 @@ main(void) fd, area2, area1, pagesize, pagesize, rc); /* ---- ZEROPAGE ---- */ - struct uffdio_zeropage *zero_struct = tail_alloc(sizeof(*zero_struct)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct uffdio_zeropage, zero_struct); madvise(area2, pagesize, MADV_DONTNEED); memset(zero_struct, 0, sizeof(*zero_struct)); @@ -169,7 +157,7 @@ main(void) fd, area2, pagesize, pagesize, rc); /* ---- WAKE ---- */ - struct uffdio_range *range_struct = tail_alloc(sizeof(*range_struct)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct uffdio_range, range_struct); memset(range_struct, 0, sizeof(*range_struct)); rc = ioctl(-1, UFFDIO_WAKE, range_struct); diff --git a/tests/ioctl_uffdio.gen.test b/tests/ioctl_uffdio.gen.test new file mode 100755 index 00000000..ed73c5f0 --- /dev/null +++ b/tests/ioctl_uffdio.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_uffdio +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_uffdio.test b/tests/ioctl_uffdio.test deleted file mode 100755 index fae9b556..00000000 --- a/tests/ioctl_uffdio.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check userfaultfd ioctl decoding. - -. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_v4l2.c b/tests/ioctl_v4l2.c index af8c3419..54e9ee7c 100644 --- a/tests/ioctl_v4l2.c +++ b/tests/ioctl_v4l2.c @@ -1,66 +1,365 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" +#include #include #include #include #include #include -#if WORDS_BIGENDIAN -# define cc0(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 24)) -# define cc1(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 16)) -# define cc2(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 8)) -# define cc3(arg) ((unsigned int) (unsigned char) (arg)) -# define fourcc(a0, a1, a2, a3) \ - ((unsigned int)(a3) | \ - ((unsigned int)(a2) << 8) | \ - ((unsigned int)(a1) << 16) | \ - ((unsigned int)(a0) << 24)) -#else -# define cc0(arg) ((unsigned int) (unsigned char) (arg)) -# define cc1(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 8)) -# define cc2(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 16)) -# define cc3(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 24)) -# define fourcc(a0, a1, a2, a3) \ +#define cc0(arg) ((unsigned int) (unsigned char) (arg)) +#define cc1(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 8)) +#define cc2(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 16)) +#define cc3(arg) ((unsigned int) (unsigned char) ((unsigned int) (arg) >> 24)) +#define fourcc(a0, a1, a2, a3) \ ((unsigned int)(a0) | \ ((unsigned int)(a1) << 8) | \ ((unsigned int)(a2) << 16) | \ ((unsigned int)(a3) << 24)) -#endif static const unsigned int magic = 0xdeadbeef; +static const unsigned int pf_magic = fourcc('S', '5', '0', '8'); +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT +static const unsigned int sf_magic = fourcc('R', 'U', '1', '2'); +#endif + +static void +init_v4l2_format(struct v4l2_format *const f, + const unsigned int buf_type) +{ + memset(f, -1, sizeof(*f)); + f->type = buf_type; + switch (buf_type) { + case V4L2_BUF_TYPE_VIDEO_CAPTURE: + case V4L2_BUF_TYPE_VIDEO_OUTPUT: + f->fmt.pix.width = 0x657b8160; + f->fmt.pix.height = 0x951c0047; + if (buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE) + f->fmt.pix.pixelformat = magic; + else + f->fmt.pix.pixelformat = pf_magic; + f->fmt.pix.field = V4L2_FIELD_NONE; + f->fmt.pix.bytesperline = 0xdf20d185; + f->fmt.pix.sizeimage = 0x0cf7be41; + f->fmt.pix.colorspace = V4L2_COLORSPACE_JPEG; + break; +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE + case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: + case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: { + unsigned int i; + + f->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; + f->fmt.pix_mp.width = 0x1f3b774b; + f->fmt.pix_mp.height = 0xab96a8d6; + if (buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) + f->fmt.pix_mp.pixelformat = magic; + else + f->fmt.pix_mp.pixelformat = pf_magic; + f->fmt.pix_mp.field = V4L2_FIELD_NONE; + f->fmt.pix_mp.colorspace = V4L2_COLORSPACE_JPEG; + struct v4l2_plane_pix_format *cur_pix = + f->fmt.pix_mp.plane_fmt; + for (i = 0; + i < ARRAY_SIZE(f->fmt.pix_mp.plane_fmt); + i++) { + cur_pix[i].sizeimage = 0x1e3c531c | i; + cur_pix[i].bytesperline = 0xa983d721 | i; + } + break; + } +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY + case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: +#endif + case V4L2_BUF_TYPE_VIDEO_OVERLAY: + f->fmt.win.w.left = 0xe8373662; + f->fmt.win.w.top = 0x0336d283; + f->fmt.win.w.width = 0x9235fe72; + f->fmt.win.w.height = 0xbbd886c8; + f->fmt.win.field = V4L2_FIELD_ANY; + f->fmt.win.chromakey = 0xdb1f991f; + f->fmt.win.clipcount = 2; + f->fmt.win.clips = + tail_alloc(sizeof(*f->fmt.win.clips) * + f->fmt.win.clipcount); + f->fmt.win.clips[0].c.left = 0x3313d36e; + f->fmt.win.clips[0].c.top = 0xcdffe510; + f->fmt.win.clips[0].c.width = 0x2064f3a8; + f->fmt.win.clips[0].c.height = 0xd06d314a; + f->fmt.win.clips[1].c.left = 0xd8c8a83f; + f->fmt.win.clips[1].c.top = 0x336e87ba; + f->fmt.win.clips[1].c.width = 0x9e3a6fb3; + f->fmt.win.clips[1].c.height = 0x05617b76; + + f->fmt.win.bitmap = (void *) -2UL; +#ifdef HAVE_STRUCT_V4L2_WINDOW_GLOBAL_ALPHA + f->fmt.win.global_alpha = 0xce; +#endif + break; + case V4L2_BUF_TYPE_VBI_CAPTURE: + case V4L2_BUF_TYPE_VBI_OUTPUT: + f->fmt.vbi.sampling_rate = 0x3d9b5b79; + f->fmt.vbi.offset = 0x055b3a09; + f->fmt.vbi.samples_per_line = 0xf176d436; + if (buf_type == V4L2_BUF_TYPE_VBI_CAPTURE) + f->fmt.vbi.sample_format = magic; + else + f->fmt.vbi.sample_format = pf_magic; + f->fmt.vbi.start[0] = 0x9858e2eb; + f->fmt.vbi.start[1] = 0x8a4dc8c1; + f->fmt.vbi.count[0] = 0x4bcf36a3; + f->fmt.vbi.count[1] = 0x97dff65f; + f->fmt.vbi.flags = V4L2_VBI_INTERLACED; + break; +#if HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE + case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: + case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: { + unsigned int i; + + f->fmt.sliced.service_set = V4L2_SLICED_VPS; + f->fmt.sliced.io_size = 0xd897925a; + for (i = 0; + i < ARRAY_SIZE(f->fmt.sliced.service_lines[0]); + i++) { + f->fmt.sliced.service_lines[0][i] = 0xc38e | i; + f->fmt.sliced.service_lines[1][i] = 0x3abb | i; + } + break; + } +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT + case V4L2_BUF_TYPE_SDR_OUTPUT: + f->fmt.sdr.pixelformat = sf_magic; +# ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE + f->fmt.sdr.buffersize = 0x25afabfb; +# endif + break; +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE + case V4L2_BUF_TYPE_SDR_CAPTURE: + f->fmt.sdr.pixelformat = magic; +# ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE + f->fmt.sdr.buffersize = 0x25afabfb; +# endif + break; +#endif + } +} + +static void +dprint_ioctl_v4l2(struct v4l2_format *const f, + const char *request, const unsigned int buf_type, + const char *buf_type_string) +{ + int saved_errno; + + switch (buf_type) { + case V4L2_BUF_TYPE_VIDEO_CAPTURE: + case V4L2_BUF_TYPE_VIDEO_OUTPUT: + saved_errno = errno; + printf("ioctl(-1, %s, {type=%s" + ", fmt.pix={width=%u, height=%u, pixelformat=", + request, + buf_type_string, + f->fmt.pix.width, f->fmt.pix.height); + + if (buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE) + printf("v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')", + cc0(magic), cc1(magic), cc2(magic), cc3(magic)); + else + printf("v4l2_fourcc('%c', '%c', '%c', '%c') " + "/* V4L2_PIX_FMT_SPCA508 */", + cc0(pf_magic), cc1(pf_magic), cc2(pf_magic), + cc3(pf_magic)); + + errno = saved_errno; + printf(", field=V4L2_FIELD_NONE, bytesperline=%u, sizeimage=%u" + ", colorspace=V4L2_COLORSPACE_JPEG}}) = -1 EBADF (%m)\n", + f->fmt.pix.bytesperline, + f->fmt.pix.sizeimage); + break; +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE + case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: + case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: { + unsigned int i; + + saved_errno = errno; + printf("ioctl(-1, %s" + ", {type=%s" + ", fmt.pix_mp={width=%u, height=%u, pixelformat=", + request, + buf_type_string, + f->fmt.pix_mp.width, f->fmt.pix_mp.height); + + if (buf_type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) + printf("v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')", + cc0(magic), cc1(magic), cc2(magic), cc3(magic)); + else + printf("v4l2_fourcc('%c', '%c', '%c', '%c') " + "/* V4L2_PIX_FMT_SPCA508 */", + cc0(pf_magic), cc1(pf_magic), cc2(pf_magic), + cc3(pf_magic)); + + printf(", field=V4L2_FIELD_NONE, colorspace=" + "V4L2_COLORSPACE_JPEG, plane_fmt=["); + for (i = 0; + i < ARRAY_SIZE(f->fmt.pix_mp.plane_fmt); + ++i) { + if (i) + printf(", "); + printf("{sizeimage=%u, bytesperline=%u}", + f->fmt.pix_mp.plane_fmt[i].sizeimage, + f->fmt.pix_mp.plane_fmt[i].bytesperline); + } + errno = saved_errno; + printf("], num_planes=%u}}) = -1 EBADF (%m)\n", + f->fmt.pix_mp.num_planes); + break; + } +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY + case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: +#endif + case V4L2_BUF_TYPE_VIDEO_OVERLAY: + printf("ioctl(-1, %s, {type=%s" + ", fmt.win={left=%d, top=%d, width=%u, height=%u" + ", field=V4L2_FIELD_ANY, chromakey=%#x, clips=" + "[{left=%d, top=%d, width=%u, height=%u}, " + "{left=%d, top=%d, width=%u, height=%u}]" + ", clipcount=%u, bitmap=%p" +#ifdef HAVE_STRUCT_V4L2_WINDOW_GLOBAL_ALPHA + ", global_alpha=%#x" +#endif + "}}) = -1 EBADF (%m)\n", + request, + buf_type_string, + f->fmt.win.w.left, f->fmt.win.w.top, + f->fmt.win.w.width, f->fmt.win.w.height, + f->fmt.win.chromakey, + f->fmt.win.clips[0].c.left, + f->fmt.win.clips[0].c.top, + f->fmt.win.clips[0].c.width, + f->fmt.win.clips[0].c.height, + f->fmt.win.clips[1].c.left, + f->fmt.win.clips[1].c.top, + f->fmt.win.clips[1].c.width, + f->fmt.win.clips[1].c.height, + f->fmt.win.clipcount, f->fmt.win.bitmap +#ifdef HAVE_STRUCT_V4L2_WINDOW_GLOBAL_ALPHA + , f->fmt.win.global_alpha +#endif + ); + break; + case V4L2_BUF_TYPE_VBI_CAPTURE: + case V4L2_BUF_TYPE_VBI_OUTPUT: + saved_errno = errno; + printf("ioctl(-1, %s, {type=%s" + ", fmt.vbi={sampling_rate=%u, offset=%u" + ", samples_per_line=%u, sample_format=", + request, + buf_type_string, + f->fmt.vbi.sampling_rate, f->fmt.vbi.offset, + f->fmt.vbi.samples_per_line); + + if (buf_type == V4L2_BUF_TYPE_VBI_CAPTURE) + printf("v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')", + cc0(magic), cc1(magic), cc2(magic), cc3(magic)); + else + printf("v4l2_fourcc('%c', '%c', '%c', '%c') " + "/* V4L2_PIX_FMT_SPCA508 */", + cc0(pf_magic), cc1(pf_magic), cc2(pf_magic), + cc3(pf_magic)); + + errno = saved_errno; + printf(", start=[%u, %u], count=[%u, %u]" + ", flags=V4L2_VBI_INTERLACED}})" + " = -1 EBADF (%m)\n", + f->fmt.vbi.start[0], f->fmt.vbi.start[1], + f->fmt.vbi.count[0], f->fmt.vbi.count[1]); + break; +#if HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE + case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: + case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: { + unsigned int i, j; + + printf("ioctl(-1, %s, {type=%s" + ", fmt.sliced={service_set=V4L2_SLICED_VPS" + ", io_size=%u, service_lines=[", + request, + buf_type_string, + f->fmt.sliced.io_size); + for (i = 0; + i < ARRAY_SIZE(f->fmt.sliced.service_lines); + i++) { + if (i > 0) + printf(", "); + printf("["); + for (j = 0; + j < ARRAY_SIZE(f->fmt.sliced.service_lines[0]); + j++) { + if (j > 0) + printf(", "); + printf("%#x", + f->fmt.sliced.service_lines[i][j]); + } + printf("]"); + } + printf("]}}) = -1 EBADF (%m)\n"); + break; + } +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT + case V4L2_BUF_TYPE_SDR_OUTPUT: +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE + case V4L2_BUF_TYPE_SDR_CAPTURE: + saved_errno = errno; + printf("ioctl(-1, %s, {type=%s" + ", fmt.sdr={pixelformat=", + request, + buf_type_string); + + if (buf_type == V4L2_BUF_TYPE_SDR_CAPTURE) + printf("v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')", + cc0(magic), cc1(magic), cc2(magic), cc3(magic)); +# if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT + else + printf("v4l2_fourcc('%c', '%c', '%c', '%c') " + "/* V4L2_SDR_FMT_RU12LE */", + cc0(sf_magic), cc1(sf_magic), cc2(sf_magic), + cc3(sf_magic)); +# endif + + errno = saved_errno; + printf( +# ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE + ", buffersize=%u" +# endif + "}}) = -1 EBADF (%m)\n" +# ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE + , f->fmt.sdr.buffersize +# endif + ); + break; +#endif + } +} +#define print_ioctl_v4l2(v4l2_format, request, buf_type) \ + dprint_ioctl_v4l2((v4l2_format), (request), (buf_type), #buf_type) int -main(void ) +main(void) { const unsigned int size = get_page_size(); void *const page = tail_alloc(size); + void *const page_end = page + size; fill_memory(page, size); unsigned char cc[sizeof(int)] = { 'A', '\'', '\\', '\xfa' }; @@ -76,7 +375,7 @@ main(void ) ioctl(-1, VIDIOC_ENUM_FMT, 0); printf("ioctl(-1, VIDIOC_ENUM_FMT, NULL) = -1 EBADF (%m)\n"); - struct v4l2_fmtdesc *const p_fmtdesc = tail_alloc(sizeof(*p_fmtdesc)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_fmtdesc, p_fmtdesc); p_fmtdesc->index = magic; p_fmtdesc->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ioctl(-1, VIDIOC_ENUM_FMT, p_fmtdesc); @@ -88,99 +387,167 @@ main(void ) ioctl(-1, VIDIOC_G_FMT, 0); printf("ioctl(-1, VIDIOC_G_FMT, NULL) = -1 EBADF (%m)\n"); - struct v4l2_format *const p_format = tail_alloc(sizeof(*p_format)); - p_format->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; + TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_format, p_format); + p_format->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; ioctl(-1, VIDIOC_G_FMT, p_format); printf("ioctl(-1, VIDIOC_G_FMT" ", {type=V4L2_BUF_TYPE_VIDEO_CAPTURE}) = -1 EBADF (%m)\n"); +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE + p_format->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE}) =" + " -1 EBADF (%m)\n"); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY + p_format->type = V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY; + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY}) =" + " -1 EBADF (%m)\n"); +#endif + p_format->type = V4L2_BUF_TYPE_VIDEO_OVERLAY; + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_VIDEO_OVERLAY}) =" + " -1 EBADF (%m)\n"); + p_format->type = V4L2_BUF_TYPE_VBI_CAPTURE; + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_VBI_CAPTURE}) = -1 EBADF (%m)\n"); +#if HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE + p_format->type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE; + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_SLICED_VBI_CAPTURE}) = -1 EBADF (%m)\n"); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE + p_format->type = V4L2_BUF_TYPE_SDR_CAPTURE; + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_SDR_CAPTURE}) = -1 EBADF (%m)\n"); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT + p_format->type = V4L2_BUF_TYPE_SDR_OUTPUT; + ioctl(-1, VIDIOC_G_FMT, p_format); + printf("ioctl(-1, VIDIOC_G_FMT" + ", {type=V4L2_BUF_TYPE_SDR_OUTPUT}) = -1 EBADF (%m)\n"); +#endif /* VIDIOC_S_FMT */ ioctl(-1, VIDIOC_S_FMT, 0); printf("ioctl(-1, VIDIOC_S_FMT, NULL) = -1 EBADF (%m)\n"); - p_format->type = V4L2_BUF_TYPE_VIDEO_OUTPUT; - p_format->fmt.pix.width = 0xdad1beaf; - p_format->fmt.pix.height = 0xdad2beaf; - p_format->fmt.pix.pixelformat = magic; - p_format->fmt.pix.field = V4L2_FIELD_NONE; - p_format->fmt.pix.bytesperline = 0xdad3beaf; - p_format->fmt.pix.sizeimage = 0xdad4beaf; - p_format->fmt.pix.colorspace = V4L2_COLORSPACE_JPEG; - + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_OUTPUT); ioctl(-1, VIDIOC_S_FMT, p_format); - printf("ioctl(-1, VIDIOC_S_FMT, {type=V4L2_BUF_TYPE_VIDEO_OUTPUT" - ", fmt.pix={width=%u, height=%u, pixelformat=" - "v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')" - ", field=V4L2_FIELD_NONE, bytesperline=%u, sizeimage=%u" - ", colorspace=V4L2_COLORSPACE_JPEG}}) = -1 EBADF (%m)\n", - p_format->fmt.pix.width, p_format->fmt.pix.height, - cc0(magic), cc1(magic), cc2(magic), cc3(magic), - p_format->fmt.pix.bytesperline, p_format->fmt.pix.sizeimage); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", V4L2_BUF_TYPE_VIDEO_OUTPUT); +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); + ioctl(-1, VIDIOC_S_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", + V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY); + ioctl(-1, VIDIOC_S_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", + V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY); +#endif + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_OVERLAY); + ioctl(-1, VIDIOC_S_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", + V4L2_BUF_TYPE_VIDEO_OVERLAY); + init_v4l2_format(p_format, V4L2_BUF_TYPE_VBI_CAPTURE); + ioctl(-1, VIDIOC_S_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", V4L2_BUF_TYPE_VBI_CAPTURE); +#if HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE + init_v4l2_format(p_format, V4L2_BUF_TYPE_SLICED_VBI_CAPTURE); + ioctl(-1, VIDIOC_S_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", + V4L2_BUF_TYPE_SLICED_VBI_CAPTURE); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE + init_v4l2_format(p_format, V4L2_BUF_TYPE_SDR_CAPTURE); + ioctl(-1, VIDIOC_S_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", V4L2_BUF_TYPE_SDR_CAPTURE); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT + init_v4l2_format(p_format, V4L2_BUF_TYPE_SDR_OUTPUT); + ioctl(-1, VIDIOC_S_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_S_FMT", V4L2_BUF_TYPE_SDR_OUTPUT); +#endif /* VIDIOC_TRY_FMT */ ioctl(-1, VIDIOC_TRY_FMT, 0); printf("ioctl(-1, VIDIOC_TRY_FMT, NULL) = -1 EBADF (%m)\n"); + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_OUTPUT); + ioctl(-1, VIDIOC_TRY_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", + V4L2_BUF_TYPE_VIDEO_OUTPUT); #if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE - memset(p_format, -1, sizeof(*p_format)); - p_format->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; - p_format->fmt.pix_mp.width = 0xdad1beaf; - p_format->fmt.pix_mp.height = 0xdad2beaf; - p_format->fmt.pix_mp.pixelformat = magic; - p_format->fmt.pix_mp.field = V4L2_FIELD_NONE; - p_format->fmt.pix_mp.colorspace = V4L2_COLORSPACE_JPEG; - unsigned int i; - for (i = 0; i < ARRAY_SIZE(p_format->fmt.pix_mp.plane_fmt); ++i) { - p_format->fmt.pix_mp.plane_fmt[i].sizeimage = 0xbadc0de0 | i; - p_format->fmt.pix_mp.plane_fmt[i].bytesperline = 0xdadbeaf0 | i; - } + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); ioctl(-1, VIDIOC_TRY_FMT, p_format); - printf("ioctl(-1, VIDIOC_TRY_FMT" - ", {type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE" - ", fmt.pix_mp={width=%u, height=%u, pixelformat=" - "v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')" - ", field=V4L2_FIELD_NONE, colorspace=V4L2_COLORSPACE_JPEG" - ", plane_fmt=[", - p_format->fmt.pix_mp.width, p_format->fmt.pix_mp.height, - cc0(magic), cc1(magic), cc2(magic), cc3(magic)); - for (i = 0; i < ARRAY_SIZE(p_format->fmt.pix_mp.plane_fmt); ++i) { - if (i) - printf(", "); - printf("{sizeimage=%u, bytesperline=%u}", - p_format->fmt.pix_mp.plane_fmt[i].sizeimage, - p_format->fmt.pix_mp.plane_fmt[i].bytesperline); - } - printf("], num_planes=%u}}) = -1 EBADF (%m)\n", - p_format->fmt.pix_mp.num_planes); -#else + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", + V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY); + ioctl(-1, VIDIOC_TRY_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", + V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY); +#endif + init_v4l2_format(p_format, V4L2_BUF_TYPE_VIDEO_OVERLAY); + ioctl(-1, VIDIOC_TRY_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", + V4L2_BUF_TYPE_VIDEO_OVERLAY); + + init_v4l2_format(p_format, V4L2_BUF_TYPE_VBI_CAPTURE); + ioctl(-1, VIDIOC_TRY_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", V4L2_BUF_TYPE_VBI_CAPTURE); +#if HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE + init_v4l2_format(p_format, V4L2_BUF_TYPE_SLICED_VBI_CAPTURE); + ioctl(-1, VIDIOC_TRY_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", + V4L2_BUF_TYPE_SLICED_VBI_CAPTURE); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE + init_v4l2_format(p_format, V4L2_BUF_TYPE_SDR_CAPTURE); + ioctl(-1, VIDIOC_TRY_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", V4L2_BUF_TYPE_SDR_CAPTURE); +#endif +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT + init_v4l2_format(p_format, V4L2_BUF_TYPE_SDR_OUTPUT); + ioctl(-1, VIDIOC_TRY_FMT, p_format); + print_ioctl_v4l2(p_format, "VIDIOC_TRY_FMT", V4L2_BUF_TYPE_SDR_OUTPUT); +#endif struct v4l2_format *const p_v4l2_format = - page + size - sizeof(*p_v4l2_format); + page_end - sizeof(*p_v4l2_format); ioctl(-1, VIDIOC_TRY_FMT, p_v4l2_format); printf("ioctl(-1, VIDIOC_TRY_FMT, {type=%#x /* V4L2_BUF_TYPE_??? */})" " = -1 EBADF (%m)\n", p_v4l2_format->type); -#endif /* VIDIOC_REQBUFS */ ioctl(-1, VIDIOC_REQBUFS, 0); printf("ioctl(-1, VIDIOC_REQBUFS, NULL) = -1 EBADF (%m)\n"); struct v4l2_requestbuffers *const p_v4l2_requestbuffers = - page + size - sizeof(*p_v4l2_requestbuffers); + page_end - sizeof(*p_v4l2_requestbuffers); ioctl(-1, VIDIOC_REQBUFS, p_v4l2_requestbuffers); - printf("ioctl(-1, VIDIOC_REQBUFS, {count=%u, type=%#x" - " /* V4L2_BUF_TYPE_??? */, memory=%#x /* V4L2_MEMORY_??? */})" + printf("ioctl(-1, VIDIOC_REQBUFS, {type=%#x /* V4L2_BUF_TYPE_??? */, " + "memory=%#x /* V4L2_MEMORY_??? */, count=%u})" " = -1 EBADF (%m)\n", - p_v4l2_requestbuffers->count, p_v4l2_requestbuffers->type, - p_v4l2_requestbuffers->memory); + p_v4l2_requestbuffers->memory, + p_v4l2_requestbuffers->count); /* VIDIOC_QUERYBUF */ ioctl(-1, VIDIOC_QUERYBUF, 0); printf("ioctl(-1, VIDIOC_QUERYBUF, NULL) = -1 EBADF (%m)\n"); struct v4l2_buffer *const p_v4l2_buffer = - page + size - sizeof(*p_v4l2_buffer); + page_end - sizeof(*p_v4l2_buffer); ioctl(-1, VIDIOC_QUERYBUF, p_v4l2_buffer); printf("ioctl(-1, VIDIOC_QUERYBUF, {type=%#x /* V4L2_BUF_TYPE_??? */" ", index=%u}) = -1 EBADF (%m)\n", @@ -216,7 +583,7 @@ main(void ) printf("ioctl(-1, VIDIOC_S_FBUF, NULL) = -1 EBADF (%m)\n"); struct v4l2_framebuffer *const p_v4l2_framebuffer = - page + size - sizeof(*p_v4l2_framebuffer); + page_end - sizeof(*p_v4l2_framebuffer); ioctl(-1, VIDIOC_S_FBUF, p_v4l2_framebuffer); printf("ioctl(-1, VIDIOC_S_FBUF, {capability=%#x" ", flags=%#x, base=%p}) = -1 EBADF (%m)\n", @@ -228,7 +595,7 @@ main(void ) ioctl(-1, VIDIOC_STREAMON, 0); printf("ioctl(-1, VIDIOC_STREAMON, NULL) = -1 EBADF (%m)\n"); - int *const p_int = page + size - sizeof(int); + int *const p_int = page_end - sizeof(int); ioctl(-1, VIDIOC_STREAMON, p_int); printf("ioctl(-1, VIDIOC_STREAMON, [%#x /* V4L2_BUF_TYPE_??? */])" " = -1 EBADF (%m)\n", *p_int); @@ -246,7 +613,7 @@ main(void ) printf("ioctl(-1, VIDIOC_G_PARM, NULL) = -1 EBADF (%m)\n"); struct v4l2_streamparm *const p_v4l2_streamparm = - page + size - sizeof(*p_v4l2_streamparm); + page_end - sizeof(*p_v4l2_streamparm); ioctl(-1, VIDIOC_G_PARM, p_v4l2_streamparm); printf("ioctl(-1, VIDIOC_G_PARM, {type=%#x /* V4L2_BUF_TYPE_??? */})" " = -1 EBADF (%m)\n", p_v4l2_streamparm->type); @@ -259,8 +626,7 @@ main(void ) printf("ioctl(-1, VIDIOC_S_PARM, {type=%#x /* V4L2_BUF_TYPE_??? */})" " = -1 EBADF (%m)\n", p_v4l2_streamparm->type); - struct v4l2_streamparm *const p_streamparm = - tail_alloc(sizeof(*p_streamparm)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_streamparm, p_streamparm); p_streamparm->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; p_streamparm->parm.capture.capability = V4L2_CAP_TIMEPERFRAME; p_streamparm->parm.capture.capturemode = V4L2_MODE_HIGHQUALITY; @@ -295,7 +661,7 @@ main(void ) ioctl(-1, VIDIOC_S_STD, 0); printf("ioctl(-1, VIDIOC_S_STD, NULL) = -1 EBADF (%m)\n"); - long long *const p_longlong = page + size - sizeof(*p_longlong); + long long *const p_longlong = page_end - sizeof(*p_longlong); ioctl(-1, VIDIOC_S_STD, p_longlong); printf("ioctl(-1, VIDIOC_S_STD, [%#llx]) = -1 EBADF (%m)\n", *p_longlong); @@ -305,7 +671,7 @@ main(void ) printf("ioctl(-1, VIDIOC_ENUMSTD, NULL) = -1 EBADF (%m)\n"); struct v4l2_standard *const p_v4l2_standard = - page + size - sizeof(*p_v4l2_standard); + page_end - sizeof(*p_v4l2_standard); ioctl(-1, VIDIOC_ENUMSTD, p_v4l2_standard); printf("ioctl(-1, VIDIOC_ENUMSTD, {index=%u}) = -1 EBADF (%m)\n", p_v4l2_standard->index); @@ -315,7 +681,7 @@ main(void ) printf("ioctl(-1, VIDIOC_ENUMINPUT, NULL) = -1 EBADF (%m)\n"); struct v4l2_input *const p_v4l2_input = - page + size - sizeof(*p_v4l2_input); + page_end - sizeof(*p_v4l2_input); ioctl(-1, VIDIOC_ENUMINPUT, p_v4l2_input); printf("ioctl(-1, VIDIOC_ENUMINPUT, {index=%u}) = -1 EBADF (%m)\n", p_v4l2_input->index); @@ -325,7 +691,7 @@ main(void ) printf("ioctl(-1, VIDIOC_G_CTRL, NULL) = -1 EBADF (%m)\n"); struct v4l2_control *const p_v4l2_control = - page + size - sizeof(*p_v4l2_control); + page_end - sizeof(*p_v4l2_control); ioctl(-1, VIDIOC_G_CTRL, p_v4l2_control); printf("ioctl(-1, VIDIOC_G_CTRL, {id=%#x /* V4L2_CID_??? */})" " = -1 EBADF (%m)\n", p_v4l2_control->id); @@ -339,24 +705,59 @@ main(void ) ", value=%d}) = -1 EBADF (%m)\n", p_v4l2_control->id, p_v4l2_control->value); + /* VIDIOC_G_TUNER */ + ioctl(-1, VIDIOC_G_TUNER, 0); + printf("ioctl(-1, VIDIOC_G_TUNER, NULL) = -1 EBADF (%m)\n"); + + struct v4l2_tuner *const p_v4l2_tuner = + page_end - sizeof(*p_v4l2_tuner); + ioctl(-1, VIDIOC_G_TUNER, p_v4l2_tuner); + printf("ioctl(-1, VIDIOC_G_TUNER, {index=%u})" + " = -1 EBADF (%m)\n", p_v4l2_tuner->index); + + /* VIDIOC_S_TUNER */ + ioctl(-1, VIDIOC_S_TUNER, 0); + printf("ioctl(-1, VIDIOC_S_TUNER, NULL) = -1 EBADF (%m)\n"); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_tuner, p_tuner); + p_tuner->index = 0x4fb6df39; + strcpy((char *) p_tuner->name, "cum tacent clamant"); + p_tuner->type = V4L2_TUNER_RADIO; + p_tuner->capability = V4L2_TUNER_CAP_LOW; + p_tuner->rangelow = 0xa673bc29; + p_tuner->rangehigh = 0xbaf16d12; + p_tuner->rxsubchans = V4L2_TUNER_SUB_MONO; + p_tuner->audmode = V4L2_TUNER_MODE_MONO; + p_tuner->signal = 0x10bf92c8; + p_tuner->afc = 0x3bf7e18b; + ioctl(-1, VIDIOC_S_TUNER, p_tuner); + printf("ioctl(-1, VIDIOC_S_TUNER, {index=%u" + ", name=\"cum tacent clamant\"" + ", type=V4L2_TUNER_RADIO, capability=V4L2_TUNER_CAP_LOW" + ", rangelow=%u, rangehigh=%u" + ", rxsubchans=V4L2_TUNER_SUB_MONO" + ", audmode=V4L2_TUNER_MODE_MONO, signal=%d, afc=%d" + "}) = -1 EBADF (%m)\n", + p_tuner->index, p_tuner->rangelow, + p_tuner->rangehigh, p_tuner->signal, p_tuner->afc); + /* VIDIOC_QUERYCTRL */ ioctl(-1, VIDIOC_QUERYCTRL, 0); printf("ioctl(-1, VIDIOC_QUERYCTRL, NULL) = -1 EBADF (%m)\n"); struct v4l2_queryctrl *const p_v4l2_queryctrl = - page + size - sizeof(*p_v4l2_queryctrl); + page_end - sizeof(*p_v4l2_queryctrl); ioctl(-1, VIDIOC_QUERYCTRL, p_v4l2_queryctrl); -# ifdef V4L2_CTRL_FLAG_NEXT_CTRL +#ifdef V4L2_CTRL_FLAG_NEXT_CTRL printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=V4L2_CTRL_FLAG_NEXT_CTRL" "|%#x /* V4L2_CID_??? */}) = -1 EBADF (%m)\n", p_v4l2_queryctrl->id & ~V4L2_CTRL_FLAG_NEXT_CTRL); -# else +#else printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=%#x /* V4L2_CID_??? */})" " = -1 EBADF (%m)\n", p_v4l2_queryctrl->id); -# endif +#endif - struct v4l2_queryctrl *const p_queryctrl = - tail_alloc(sizeof(*p_queryctrl)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_queryctrl, p_queryctrl); p_queryctrl->id = V4L2_CID_SATURATION; ioctl(-1, VIDIOC_QUERYCTRL, p_queryctrl); printf("ioctl(-1, VIDIOC_QUERYCTRL, {id=V4L2_CID_SATURATION})" @@ -381,7 +782,7 @@ main(void ) printf("ioctl(-1, VIDIOC_CROPCAP, NULL) = -1 EBADF (%m)\n"); struct v4l2_cropcap *const p_v4l2_cropcap = - page + size - sizeof(*p_v4l2_cropcap); + page_end - sizeof(*p_v4l2_cropcap); ioctl(-1, VIDIOC_CROPCAP, p_v4l2_cropcap); printf("ioctl(-1, VIDIOC_CROPCAP, {type=%#x /* V4L2_BUF_TYPE_??? */})" " = -1 EBADF (%m)\n", p_v4l2_cropcap->type); @@ -391,7 +792,7 @@ main(void ) printf("ioctl(-1, VIDIOC_G_CROP, NULL) = -1 EBADF (%m)\n"); struct v4l2_crop *const p_v4l2_crop = - page + size - sizeof(*p_v4l2_crop); + page_end - sizeof(*p_v4l2_crop); ioctl(-1, VIDIOC_G_CROP, p_v4l2_crop); printf("ioctl(-1, VIDIOC_G_CROP, {type=%#x /* V4L2_BUF_TYPE_??? */})" " = -1 EBADF (%m)\n", p_v4l2_crop->type); @@ -414,8 +815,7 @@ main(void ) ioctl(-1, VIDIOC_S_EXT_CTRLS, 0); printf("ioctl(-1, VIDIOC_S_EXT_CTRLS, NULL) = -1 EBADF (%m)\n"); - struct v4l2_ext_controls *const p_ext_controls = - tail_alloc(sizeof(*p_ext_controls)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_ext_controls, p_ext_controls); p_ext_controls->ctrl_class = V4L2_CTRL_CLASS_USER; p_ext_controls->count = 0; p_ext_controls->controls = (void *) -2UL; @@ -423,6 +823,21 @@ main(void ) printf("ioctl(-1, VIDIOC_S_EXT_CTRLS, {ctrl_class=V4L2_CTRL_CLASS_USER" ", count=%u}) = -1 EBADF (%m)\n", p_ext_controls->count); + p_ext_controls->ctrl_class = 0x00a30000; + p_ext_controls->count = magic; + ioctl(-1, VIDIOC_S_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_S_EXT_CTRLS, {ctrl_class=V4L2_CTRL_CLASS_DETECT" + ", count=%u, controls=%p}) = -1 EBADF (%m)\n", + p_ext_controls->count, p_ext_controls->controls); + + p_ext_controls->ctrl_class = 0x00a40000; + p_ext_controls->count = magic; + ioctl(-1, VIDIOC_S_EXT_CTRLS, p_ext_controls); + printf("ioctl(-1, VIDIOC_S_EXT_CTRLS" + ", {ctrl_class=0xa40000 /* V4L2_CTRL_CLASS_??? */" + ", count=%u, controls=%p}) = -1 EBADF (%m)\n", + p_ext_controls->count, p_ext_controls->controls); + p_ext_controls->ctrl_class = V4L2_CTRL_CLASS_MPEG; p_ext_controls->count = magic; ioctl(-1, VIDIOC_S_EXT_CTRLS, p_ext_controls); @@ -464,7 +879,7 @@ main(void ) ", {ctrl_class=V4L2_CTRL_CLASS_MPEG, count=%u, controls=" "[{id=V4L2_CID_BRIGHTNESS, size=0, value=%d, value64=%lld}" ", {id=V4L2_CID_CONTRAST, size=2, string=\"\\377\\377\"}" - ", %p]}) = -1 EBADF (%m)\n", + ", ... /* %p */]}) = -1 EBADF (%m)\n", p_ext_controls->count, p_ext_controls->controls[0].value, (long long) p_ext_controls->controls[0].value64, @@ -500,8 +915,7 @@ main(void ) ioctl(-1, VIDIOC_ENUM_FRAMESIZES, 0); printf("ioctl(-1, VIDIOC_ENUM_FRAMESIZES, NULL) = -1 EBADF (%m)\n"); - struct v4l2_frmsizeenum *const p_frmsizeenum = - tail_alloc(sizeof(*p_frmsizeenum)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct v4l2_frmsizeenum, p_frmsizeenum); p_frmsizeenum->index = magic; p_frmsizeenum->pixel_format = fourcc(cc[0], cc[1], cc[2], cc[3]); @@ -517,7 +931,7 @@ main(void ) printf("ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, NULL) = -1 EBADF (%m)\n"); struct v4l2_frmivalenum *const p_v4l2_frmivalenum = - page + size - sizeof(*p_v4l2_frmivalenum); + page_end - sizeof(*p_v4l2_frmivalenum); ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, p_v4l2_frmivalenum); printf("ioctl(-1, VIDIOC_ENUM_FRAMEINTERVALS, {index=%u" ", pixel_format=v4l2_fourcc('\\x%x', '\\x%x', '\\x%x', '\\x%x')" @@ -536,7 +950,7 @@ main(void ) printf("ioctl(-1, VIDIOC_CREATE_BUFS, NULL) = -1 EBADF (%m)\n"); struct v4l2_create_buffers *const p_v4l2_create_buffers = - page + size - sizeof(*p_v4l2_create_buffers); + page_end - sizeof(*p_v4l2_create_buffers); ioctl(-1, VIDIOC_CREATE_BUFS, p_v4l2_create_buffers); printf("ioctl(-1, VIDIOC_CREATE_BUFS, {count=%u, memory=%#x" " /* V4L2_MEMORY_??? */, format={type=%#x" diff --git a/tests/ioctl_v4l2.gen.test b/tests/ioctl_v4l2.gen.test new file mode 100755 index 00000000..4c571447 --- /dev/null +++ b/tests/ioctl_v4l2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioctl_v4l2 +ioctl.test ); do not edit. +set -- +. "${srcdir=.}/ioctl.test" diff --git a/tests/ioctl_v4l2.test b/tests/ioctl_v4l2.test deleted file mode 100755 index a092a3cd..00000000 --- a/tests/ioctl_v4l2.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check basic VIDIOC_* ioctl decoding. - -. "${srcdir=.}/ioctl.test" diff --git a/tests/ioperm.c b/tests/ioperm.c index 2f02b523..3f99b2db 100644 --- a/tests/ioperm.c +++ b/tests/ioperm.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/ioperm.gen.test b/tests/ioperm.gen.test new file mode 100755 index 00000000..bc69f69e --- /dev/null +++ b/tests/ioperm.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioperm -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests/ioperm.test b/tests/ioperm.test deleted file mode 100755 index 8c1c1cc7..00000000 --- a/tests/ioperm.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check ioperm syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests/iopl.c b/tests/iopl.c index 14ec29e3..f8904030 100644 --- a/tests/iopl.c +++ b/tests/iopl.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/iopl.gen.test b/tests/iopl.gen.test new file mode 100755 index 00000000..f7769d23 --- /dev/null +++ b/tests/iopl.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (iopl -a8 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 diff --git a/tests/iopl.test b/tests/iopl.test deleted file mode 100755 index d0b5b113..00000000 --- a/tests/iopl.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check iopl syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a8 diff --git a/tests/ioprio-Xabbrev.c b/tests/ioprio-Xabbrev.c new file mode 100644 index 00000000..01a07f48 --- /dev/null +++ b/tests/ioprio-Xabbrev.c @@ -0,0 +1 @@ +#include "ioprio.c" diff --git a/tests/ioprio-Xabbrev.gen.test b/tests/ioprio-Xabbrev.gen.test new file mode 100755 index 00000000..156c048b --- /dev/null +++ b/tests/ioprio-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioprio-Xabbrev -a18 -e trace=ioprio_get,ioprio_set -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 -e trace=ioprio_get,ioprio_set -Xabbrev diff --git a/tests/ioprio-Xraw.c b/tests/ioprio-Xraw.c new file mode 100644 index 00000000..6a815069 --- /dev/null +++ b/tests/ioprio-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "ioprio.c" diff --git a/tests/ioprio-Xraw.gen.test b/tests/ioprio-Xraw.gen.test new file mode 100755 index 00000000..92c614e5 --- /dev/null +++ b/tests/ioprio-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioprio-Xraw -a18 -e trace=ioprio_get,ioprio_set -Xraw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 -e trace=ioprio_get,ioprio_set -Xraw diff --git a/tests/ioprio-Xverbose.c b/tests/ioprio-Xverbose.c new file mode 100644 index 00000000..3c12bb6c --- /dev/null +++ b/tests/ioprio-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "ioprio.c" diff --git a/tests/ioprio-Xverbose.gen.test b/tests/ioprio-Xverbose.gen.test new file mode 100755 index 00000000..97e6154b --- /dev/null +++ b/tests/ioprio-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioprio-Xverbose -a18 -e trace=ioprio_get,ioprio_set -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 -e trace=ioprio_get,ioprio_set -Xverbose diff --git a/tests/ioprio.c b/tests/ioprio.c index 44ace6c3..65775963 100644 --- a/tests/ioprio.c +++ b/tests/ioprio.c @@ -2,29 +2,10 @@ * Check decoding of ioprio_get and ioprio_set syscalls. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -46,14 +27,6 @@ enum { # include "xlat.h" # include "xlat/ioprio_class.h" -void -print_ioprio(unsigned long val) -{ - printf(" (IOPRIO_PRIO_VALUE("); - printxval(ioprio_class, val >> 13, "IOPRIO_CLASS_???"); - printf(", %d))", (int) (val & 0x1fff)); -} - int main(void) { @@ -63,32 +36,78 @@ main(void) (kernel_ulong_t) 0xbadc0dedda7a1057ULL; static const kernel_ulong_t bogus_ioprio = (kernel_ulong_t) 0xdec0ded1facefeedULL; +# if !XLAT_RAW static const char * const bogus_ioprio_str = "IOPRIO_PRIO_VALUE(0x7d677 /* IOPRIO_CLASS_??? */, 7917)"; +# endif long rc; + const char *errstr; rc = syscall(__NR_ioprio_get, bogus_which, bogus_who); + errstr = sprintrc(rc); +# if XLAT_RAW + printf("ioprio_get(%#x, %d) = %s\n", + (int) bogus_which, (int) bogus_who, errstr); +# else /* XLAT_ABBREV || XLAT_VERBOSE */ printf("ioprio_get(%#x /* IOPRIO_WHO_??? */, %d) = %s\n", - (int) bogus_which, (int) bogus_who, sprintrc(rc)); + (int) bogus_which, (int) bogus_who, errstr); +# endif rc = syscall(__NR_ioprio_get, 1, 0); - printf("ioprio_get(IOPRIO_WHO_PROCESS, 0) = %s", sprintrc(rc)); - - if (rc >= -1) - print_ioprio(rc); - + errstr = sprintrc(rc); +# if XLAT_RAW + printf("ioprio_get(0x1, 0) = %s\n", errstr); +# elif XLAT_VERBOSE + printf("ioprio_get(0x1 /* IOPRIO_WHO_PROCESS */, 0) = %s", errstr); + if (rc >= 0) { + printf(" (IOPRIO_PRIO_VALUE(%u /* ", (unsigned int) rc >> 13); + printxval(ioprio_class, (unsigned int) rc >> 13, + "IOPRIO_CLASS_???"); + printf(" */, %u))", (unsigned int) rc & 0x1fff); + } + puts(""); +# else /* XLAT_ABBREV */ + printf("ioprio_get(IOPRIO_WHO_PROCESS, 0) = %s", errstr); + if (rc >= 0) { + printf(" (IOPRIO_PRIO_VALUE("); + printxval(ioprio_class, (unsigned int) rc >> 13, + "IOPRIO_CLASS_???"); + printf(", %u))", (unsigned int) rc & 0x1fff); + } puts(""); +# endif rc = syscall(__NR_ioprio_set, 2, 0, 8191); - printf("ioprio_set(IOPRIO_WHO_PGRP, 0, " - "IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 8191)) = %s\n", - sprintrc(rc)); + errstr = sprintrc(rc); +# if XLAT_RAW + printf("ioprio_set(%#x, 0, 8191) = %s\n", 2, errstr); +# elif XLAT_VERBOSE + printf("ioprio_set(%#x /* IOPRIO_WHO_PGRP */, 0, 8191" + " /* IOPRIO_PRIO_VALUE(0 /* IOPRIO_CLASS_NONE */, 8191) */)" + " = %s\n", + 2, errstr); +# else /* XLAT_ABBREV */ + printf("ioprio_set(IOPRIO_WHO_PGRP, 0" + ", IOPRIO_PRIO_VALUE(IOPRIO_CLASS_NONE, 8191)) = %s\n", + errstr); +# endif rc = syscall(__NR_ioprio_set, bogus_which, bogus_who, bogus_ioprio); + errstr = sprintrc(rc); +# if XLAT_RAW + printf("ioprio_set(%#x, %d, %d) = %s\n", + (int) bogus_which, (int) bogus_who, (int) bogus_ioprio, + errstr); +# elif XLAT_VERBOSE + printf("ioprio_set(%#x /* IOPRIO_WHO_??? */, %d, %d /* %s */) = %s\n", + (int) bogus_which, (int) bogus_who, (int) bogus_ioprio, + bogus_ioprio_str, errstr); +# else /* XLAT_ABBREV */ printf("ioprio_set(%#x /* IOPRIO_WHO_??? */, %d, %s) = %s\n", (int) bogus_which, (int) bogus_who, bogus_ioprio_str, - sprintrc(rc)); + errstr); +# endif puts("+++ exited with 0 +++"); diff --git a/tests/ioprio.gen.test b/tests/ioprio.gen.test new file mode 100755 index 00000000..f43f78ed --- /dev/null +++ b/tests/ioprio.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ioprio -a18 -e trace=ioprio_get,ioprio_set); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 -e trace=ioprio_get,ioprio_set diff --git a/tests/ioprio.test b/tests/ioprio.test deleted file mode 100755 index e79310b3..00000000 --- a/tests/ioprio.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check iprio_get and iprio_set syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a18 -e trace=ioprio_get,ioprio_set diff --git a/tests/ip_mreq.c b/tests/ip_mreq.c index fa0c504b..4744bd38 100644 --- a/tests/ip_mreq.c +++ b/tests/ip_mreq.c @@ -1,51 +1,33 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include #if defined IP_ADD_MEMBERSHIP && defined IPV6_ADD_MEMBERSHIP \ - && defined IPV6_JOIN_ANYCAST && defined HAVE_IF_INDEXTONAME + && defined IPV6_JOIN_ANYCAST +# include # include # include # include # include # include +# define multi4addr "224.0.0.3" +# define multi6addr "ff01::c" +# define interface "127.0.0.1" + int main(void) { - static const char multi4addr[] = "224.0.0.3"; - static const char multi6addr[] = "ff01::c"; - static const char interface[] = "127.0.0.1"; - - struct ip_mreq *const m4 = tail_alloc(sizeof(*m4)); - struct ipv6_mreq *const m6 = tail_alloc(sizeof(*m6)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct ip_mreq, m4); + TAIL_ALLOC_OBJECT_CONST_PTR(struct ipv6_mreq, m6); unsigned int i; int rc; @@ -53,7 +35,7 @@ main(void) inet_pton(AF_INET, interface, &m4->imr_interface); inet_pton(AF_INET6, multi6addr, &m6->ipv6mr_multiaddr); - m6->ipv6mr_interface = if_nametoindex("lo"); + m6->ipv6mr_interface = ifindex_lo(); if (!m6->ipv6mr_interface) perror_msg_and_skip("lo"); @@ -62,87 +44,91 @@ main(void) perror_msg_and_skip("socket"); struct { - int level; - const char *str_level; - int optname; - const char *str_optname; - void *optval; - unsigned int optsize; - } short_any[] = { + const int level; + const char *const str_level; + const int name; + const char *str_name; + const void *const val; + unsigned int size; + const char *const addr; + } opts[] = { { ARG_STR(SOL_IP), ARG_STR(IP_ADD_MEMBERSHIP), - m4, sizeof(*m4) + m4, sizeof(*m4), + "{imr_multiaddr=inet_addr(\"" multi4addr + "\"), imr_interface=inet_addr(\"" interface "\")}" }, { ARG_STR(SOL_IP), ARG_STR(IP_DROP_MEMBERSHIP), - m4, sizeof(*m4) + m4, sizeof(*m4), + "{imr_multiaddr=inet_addr(\"" multi4addr + "\"), imr_interface=inet_addr(\"" interface "\")}" }, { ARG_STR(SOL_IPV6), ARG_STR(IPV6_ADD_MEMBERSHIP), - m6, sizeof(*m6) + m6, sizeof(*m6), + "{inet_pton(AF_INET6, \"" multi6addr + "\", &ipv6mr_multiaddr)" + ", ipv6mr_interface=" IFINDEX_LO_STR "}" }, { ARG_STR(SOL_IPV6), ARG_STR(IPV6_DROP_MEMBERSHIP), - m6, sizeof(*m6) + m6, sizeof(*m6), + "{inet_pton(AF_INET6, \"" multi6addr + "\", &ipv6mr_multiaddr)" + ", ipv6mr_interface=" IFINDEX_LO_STR "}" }, { ARG_STR(SOL_IPV6), ARG_STR(IPV6_JOIN_ANYCAST), - m6, sizeof(*m6) + m6, sizeof(*m6), + "{inet_pton(AF_INET6, \"" multi6addr + "\", &ipv6mr_multiaddr)" + ", ipv6mr_interface=" IFINDEX_LO_STR "}" }, { ARG_STR(SOL_IPV6), ARG_STR(IPV6_LEAVE_ANYCAST), - m6, sizeof(*m6) + m6, sizeof(*m6), + "{inet_pton(AF_INET6, \"" multi6addr + "\", &ipv6mr_multiaddr)" + ", ipv6mr_interface=" IFINDEX_LO_STR "}" } }; - for (i = 0; i < ARRAY_SIZE(short_any); ++i) { - rc = setsockopt(0, short_any[i].level, short_any[i].optname, - short_any[i].optval, 1); - printf("setsockopt(0, %s, %s, \"\\%hho\", 1) = %s\n", - short_any[i].str_level, short_any[i].str_optname, - * (unsigned char *) short_any[i].optval, - sprintrc(rc)); - - rc = setsockopt(0, short_any[i].level, short_any[i].optname, - short_any[i].optval + 1, short_any[i].optsize); + for (i = 0; i < ARRAY_SIZE(opts); ++i) { + /* optlen < 0, EINVAL */ + rc = setsockopt(0, opts[i].level, opts[i].name, + opts[i].val, -1); + printf("setsockopt(0, %s, %s, %p, -1) = %s\n", + opts[i].str_level, opts[i].str_name, + opts[i].val, sprintrc(rc)); + + /* optlen < sizeof(struct), EINVAL */ + rc = setsockopt(0, opts[i].level, opts[i].name, + opts[i].val, opts[i].size - 1); printf("setsockopt(0, %s, %s, %p, %u) = %s\n", - short_any[i].str_level, short_any[i].str_optname, - short_any[i].optval + 1, short_any[i].optsize, - sprintrc(rc)); - } + opts[i].str_level, opts[i].str_name, + opts[i].val, opts[i].size - 1, sprintrc(rc)); - struct { - int optname; - const char *str_optname; - } long_ip[] = { - { ARG_STR(IP_ADD_MEMBERSHIP) }, - { ARG_STR(IP_DROP_MEMBERSHIP) } - }, long_ipv6[] = { - { ARG_STR(IPV6_ADD_MEMBERSHIP) }, - { ARG_STR(IPV6_DROP_MEMBERSHIP) }, - { ARG_STR(IPV6_JOIN_ANYCAST) }, - { ARG_STR(IPV6_LEAVE_ANYCAST) } - }; - - for (i = 0; i < ARRAY_SIZE(long_ip); ++i) { - rc = setsockopt(0, SOL_IP, long_ip[i].optname, - m4, sizeof(*m4)); - printf("setsockopt(0, SOL_IP, %s" - ", {imr_multiaddr=inet_addr(\"%s\")" - ", imr_interface=inet_addr(\"%s\")}, %u) = %s\n", - long_ip[i].str_optname, multi4addr, - interface, (unsigned) sizeof(*m4), sprintrc(rc)); - } - - for (i = 0; i < ARRAY_SIZE(long_ipv6); ++i) { - rc = setsockopt(0, SOL_IPV6, long_ipv6[i].optname, - m6, sizeof(*m6)); - printf("setsockopt(0, SOL_IPV6, %s" - ", {ipv6mr_multiaddr=inet_pton(\"%s\")" - ", ipv6mr_interface=if_nametoindex(\"lo\")}" - ", %u) = %s\n", - long_ipv6[i].str_optname, multi6addr, - (unsigned) sizeof(*m6), sprintrc(rc)); + /* optval EFAULT */ + rc = setsockopt(0, opts[i].level, opts[i].name, + opts[i].val + 1, opts[i].size); + printf("setsockopt(0, %s, %s, %p, %u) = %s\n", + opts[i].str_level, opts[i].str_name, + opts[i].val + 1, opts[i].size, sprintrc(rc)); + + /* classic */ + rc = setsockopt(0, opts[i].level, opts[i].name, + opts[i].val, opts[i].size); + printf("setsockopt(0, %s, %s, %s, %u) = %s\n", + opts[i].str_level, opts[i].str_name, + opts[i].addr, opts[i].size, sprintrc(rc)); + + /* optlen > sizeof(struct), shortened */ + rc = setsockopt(0, opts[i].level, opts[i].name, + opts[i].val, INT_MAX); + printf("setsockopt(0, %s, %s, %s, %u) = %s\n", + opts[i].str_level, opts[i].str_name, + opts[i].addr, INT_MAX, sprintrc(rc)); } puts("+++ exited with 0 +++"); @@ -152,6 +138,6 @@ main(void) #else SKIP_MAIN_UNDEFINED("IP_ADD_MEMBERSHIP && IPV6_ADD_MEMBERSHIP" - " && IPV6_JOIN_ANYCAST && HAVE_IF_INDEXTONAME") + " && IPV6_JOIN_ANYCAST") #endif diff --git a/tests/ip_mreq.gen.test b/tests/ip_mreq.gen.test new file mode 100755 index 00000000..990387a6 --- /dev/null +++ b/tests/ip_mreq.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ip_mreq -e trace=setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt diff --git a/tests/ip_mreq.test b/tests/ip_mreq.test deleted file mode 100755 index d0a9e0f1..00000000 --- a/tests/ip_mreq.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check {IP,IPV6}_{ADD,DROP}_MEMBERSHIP setsockopt decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=setsockopt diff --git a/tests/ipc.c b/tests/ipc.c index c64d3716..5c86f207 100644 --- a/tests/ipc.c +++ b/tests/ipc.c @@ -1,30 +1,10 @@ /* * Check decoding of ipc syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/ipc.gen.test b/tests/ipc.gen.test new file mode 100755 index 00000000..0aa75789 --- /dev/null +++ b/tests/ipc.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc -a19 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests/ipc.sh b/tests/ipc.sh index 752d4bb2..58e4309b 100644 --- a/tests/ipc.sh +++ b/tests/ipc.sh @@ -1,13 +1,16 @@ #!/bin/sh - +# # Check decoding of ipc syscalls +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog > /dev/null -run_strace -eipc $args > "$OUT" -match_grep "$LOG" "$OUT" - -rm -f "$OUT" +run_strace -eipc "$@" $args > "$EXP" +match_grep "$LOG" "$EXP" exit 0 diff --git a/tests/ipc.test b/tests/ipc.test deleted file mode 100755 index aa33fa61..00000000 --- a/tests/ipc.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of ipc syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a19 diff --git a/tests/ipc_msg-Xabbrev.c b/tests/ipc_msg-Xabbrev.c new file mode 100644 index 00000000..f4535e8b --- /dev/null +++ b/tests/ipc_msg-Xabbrev.c @@ -0,0 +1 @@ +#include "ipc_msg.c" diff --git a/tests/ipc_msg-Xabbrev.gen.test b/tests/ipc_msg-Xabbrev.gen.test new file mode 100755 index 00000000..0969ee1e --- /dev/null +++ b/tests/ipc_msg-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_msg-Xabbrev +ipc.sh -Xabbrev -a26); do not edit. +set -- -Xabbrev -a26 +. "${srcdir=.}/ipc.sh" diff --git a/tests/ipc_msg-Xraw.c b/tests/ipc_msg-Xraw.c new file mode 100644 index 00000000..9c016d30 --- /dev/null +++ b/tests/ipc_msg-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "ipc_msg.c" diff --git a/tests/ipc_msg-Xraw.gen.test b/tests/ipc_msg-Xraw.gen.test new file mode 100755 index 00000000..5d5d7322 --- /dev/null +++ b/tests/ipc_msg-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_msg-Xraw +ipc.sh -Xraw -a16); do not edit. +set -- -Xraw -a16 +. "${srcdir=.}/ipc.sh" diff --git a/tests/ipc_msg-Xverbose.c b/tests/ipc_msg-Xverbose.c new file mode 100644 index 00000000..3f59f984 --- /dev/null +++ b/tests/ipc_msg-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "ipc_msg.c" diff --git a/tests/ipc_msg-Xverbose.gen.test b/tests/ipc_msg-Xverbose.gen.test new file mode 100755 index 00000000..88c79a00 --- /dev/null +++ b/tests/ipc_msg-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_msg-Xverbose +ipc.sh -Xverbose -a34); do not edit. +set -- -Xverbose -a34 +. "${srcdir=.}/ipc.sh" diff --git a/tests/ipc_msg.c b/tests/ipc_msg.c index b4938439..b12f4af3 100644 --- a/tests/ipc_msg.c +++ b/tests/ipc_msg.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2015 Elvira Khabirova * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -35,6 +16,10 @@ #include "xlat.h" #include "xlat/resource_flags.h" +#ifndef MSG_STAT_ANY +# define MSG_STAT_ANY 13 +#endif + /* * Before glibc-2.22-122-gbe48165, ppc64 code tried to retrieve data * provided in third argument of msgctl call (in case of IPC_SET cmd) @@ -52,13 +37,50 @@ # define TEST_MSGCTL_BOGUS_ADDR 1 #endif +#if XLAT_RAW +# define str_ipc_excl_nowait "0xface1c00" +# define str_ipc_private "0" +# define str_ipc_rmid "0" +# define str_ipc_set "0x1" +# define str_ipc_stat "0x2" +# define str_msg_stat "0xb" +# define str_msg_info "0xc" +# define str_msg_stat_any "0xd" +# define str_ipc_64 "0x100" +# define str_bogus_cmd "0xdeadbeef" +#elif XLAT_VERBOSE +# define str_ipc_excl_nowait \ + "0xface1c00 /\\* IPC_EXCL\\|IPC_NOWAIT\\|0xface1000 \\*/" +# define str_ipc_private "0 /\\* IPC_PRIVATE \\*/" +# define str_ipc_rmid "0 /\\* IPC_RMID \\*/" +# define str_ipc_set "0x1 /\\* IPC_SET \\*/" +# define str_ipc_stat "0x2 /\\* IPC_STAT \\*/" +# define str_msg_stat "0xb /\\* MSG_STAT \\*/" +# define str_msg_info "0xc /\\* MSG_INFO \\*/" +# define str_msg_stat_any "0xd /\\* MSG_STAT_ANY \\*/" +# define str_ipc_64 "0x100 /\\* IPC_64 \\*/" +# define str_bogus_cmd "0xdeadbeef /\\* MSG_\\?\\?\\? \\*/" +#else +# define str_ipc_excl_nowait "IPC_EXCL\\|IPC_NOWAIT\\|0xface1000" +# define str_ipc_private "IPC_PRIVATE" +# define str_ipc_rmid "IPC_RMID" +# define str_ipc_set "IPC_SET" +# define str_ipc_stat "IPC_STAT" +# define str_msg_stat "MSG_STAT" +# define str_msg_info "MSG_INFO" +# define str_msg_stat_any "MSG_STAT_ANY" +# define str_ipc_64 "IPC_64" +# define str_bogus_cmd "0xdeadbeef /\\* MSG_\\?\\?\\? \\*/" +#endif + static int id = -1; static void cleanup(void) { msgctl(id, IPC_RMID, NULL); - printf("msgctl\\(%d, (IPC_64\\|)?IPC_RMID, NULL\\) += 0\n", id); + printf("msgctl\\(%d, (%s\\|)?%s, NULL\\) += 0\n", + id, str_ipc_64, str_ipc_rmid); id = -1; } @@ -67,7 +89,7 @@ main(void) { static const key_t private_key = (key_t) (0xffffffff00000000ULL | IPC_PRIVATE); - static const key_t bogus_key = (key_t) 0xeca86420fdb97531ULL; + static const key_t bogus_key = (key_t) 0xeca86420fdb9f531ULL; static const int bogus_msgid = 0xfdb97531; static const int bogus_cmd = 0xdeadbeef; #if TEST_MSGCTL_BOGUS_ADDR @@ -79,37 +101,36 @@ main(void) struct msqid_ds ds; rc = msgget(bogus_key, bogus_flags); - printf("msgget\\(%#llx, %s%s%s%#x\\|%#04o\\) += %s\n", + printf("msgget\\(%#llx, %s\\|%#04o\\) = %s\n", zero_extend_signed_to_ull(bogus_key), - IPC_CREAT & bogus_flags ? "IPC_CREAT\\|" : "", - IPC_EXCL & bogus_flags ? "IPC_EXCL\\|" : "", - IPC_NOWAIT & bogus_flags ? "IPC_NOWAIT\\|" : "", - bogus_flags & ~(0777 | IPC_CREAT | IPC_EXCL | IPC_NOWAIT), + str_ipc_excl_nowait, bogus_flags & 0777, sprintrc_grep(rc)); id = msgget(private_key, 0600); if (id < 0) perror_msg_and_skip("msgget"); - printf("msgget\\(IPC_PRIVATE, 0600\\) += %d\n", id); + printf("msgget\\(%s, 0600\\) = %d\n", str_ipc_private, id); atexit(cleanup); rc = msgctl(bogus_msgid, bogus_cmd, NULL); - printf("msgctl\\(%d, (IPC_64\\|)?%#x /\\* MSG_\\?\\?\\? \\*/, NULL\\)" - " += %s\n", bogus_msgid, bogus_cmd, sprintrc_grep(rc)); + printf("msgctl\\(%d, (%s\\|)?%s, NULL\\) = %s\n", + bogus_msgid, str_ipc_64, str_bogus_cmd, sprintrc_grep(rc)); #if TEST_MSGCTL_BOGUS_ADDR rc = msgctl(bogus_msgid, IPC_SET, bogus_addr); - printf("msgctl\\(%d, (IPC_64\\|)?IPC_SET, %p\\) += %s\n", - bogus_msgid, bogus_addr, sprintrc_grep(rc)); + printf("msgctl\\(%d, (%s\\|)?%s, %p\\) = %s\n", + bogus_msgid, str_ipc_64, str_ipc_set, bogus_addr, + sprintrc_grep(rc)); #endif if (msgctl(id, IPC_STAT, &ds)) perror_msg_and_skip("msgctl IPC_STAT"); - printf("msgctl\\(%d, (IPC_64\\|)?IPC_STAT, \\{msg_perm=\\{uid=%u" + printf("msgctl\\(%d, (%s\\|)?%s, \\{msg_perm=\\{uid=%u" ", gid=%u, mode=%#o, key=%u, cuid=%u, cgid=%u\\}, msg_stime=%u" ", msg_rtime=%u, msg_ctime=%u, msg_qnum=%u, msg_qbytes=%u" - ", msg_lspid=%u, msg_lrpid=%u\\}\\) += 0\n", - id, (unsigned) ds.msg_perm.uid, (unsigned) ds.msg_perm.gid, + ", msg_lspid=%u, msg_lrpid=%u\\}\\) = 0\n", + id, str_ipc_64, str_ipc_stat, + (unsigned) ds.msg_perm.uid, (unsigned) ds.msg_perm.gid, (unsigned) ds.msg_perm.mode, (unsigned) ds.msg_perm.__key, (unsigned) ds.msg_perm.cuid, (unsigned) ds.msg_perm.cgid, (unsigned) ds.msg_stime, (unsigned) ds.msg_rtime, @@ -119,18 +140,22 @@ main(void) if (msgctl(id, IPC_SET, &ds)) perror_msg_and_skip("msgctl IPC_SET"); - printf("msgctl\\(%d, (IPC_64\\|)?IPC_SET, \\{msg_perm=\\{uid=%u" - ", gid=%u, mode=%#o\\}, ...\\}\\) += 0\n", - id, (unsigned) ds.msg_perm.uid, (unsigned) ds.msg_perm.gid, - (unsigned) ds.msg_perm.mode); + printf("msgctl\\(%d, (%s\\|)?%s, \\{msg_perm=\\{uid=%u" + ", gid=%u, mode=%#o\\}, ...\\}\\) = 0\n", + id, str_ipc_64, str_ipc_set, (unsigned) ds.msg_perm.uid, + (unsigned) ds.msg_perm.gid, (unsigned) ds.msg_perm.mode); rc = msgctl(0, MSG_INFO, &ds); - printf("msgctl\\(0, (IPC_64\\|)?MSG_INFO, %p\\) += %s\n", - &ds, sprintrc_grep(rc)); + printf("msgctl\\(0, (%s\\|)?%s, %p\\) = %s\n", + str_ipc_64, str_msg_info, &ds, sprintrc_grep(rc)); rc = msgctl(id, MSG_STAT, &ds); - printf("msgctl\\(%d, (IPC_64\\|)?MSG_STAT, %p\\) += %s\n", - id, &ds, sprintrc_grep(rc)); + printf("msgctl\\(%d, (%s\\|)?%s, %p\\) = %s\n", + id, str_ipc_64, str_msg_stat, &ds, sprintrc_grep(rc)); + + rc = msgctl(id, MSG_STAT_ANY, &ds); + printf("msgctl\\(%d, (%s\\|)?%s, %p\\) = %s\n", + id, str_ipc_64, str_msg_stat_any, &ds, sprintrc_grep(rc)); return 0; } diff --git a/tests/ipc_msg.gen.test b/tests/ipc_msg.gen.test new file mode 100755 index 00000000..82026198 --- /dev/null +++ b/tests/ipc_msg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_msg +ipc.sh -a26); do not edit. +set -- -a26 +. "${srcdir=.}/ipc.sh" diff --git a/tests/ipc_msg.test b/tests/ipc_msg.test deleted file mode 100755 index 177495b0..00000000 --- a/tests/ipc_msg.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of ipc msgget/msgctl syscalls - -. "${srcdir=.}/ipc.sh" diff --git a/tests/ipc_msgbuf-Xabbrev.c b/tests/ipc_msgbuf-Xabbrev.c new file mode 100644 index 00000000..e2f09eb1 --- /dev/null +++ b/tests/ipc_msgbuf-Xabbrev.c @@ -0,0 +1 @@ +#include "ipc_msgbuf.c" diff --git a/tests/ipc_msgbuf-Xabbrev.gen.test b/tests/ipc_msgbuf-Xabbrev.gen.test new file mode 100755 index 00000000..402d804e --- /dev/null +++ b/tests/ipc_msgbuf-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_msgbuf-Xabbrev +ipc_msgbuf.test -Xabbrev); do not edit. +set -- -Xabbrev +. "${srcdir=.}/ipc_msgbuf.test" diff --git a/tests/ipc_msgbuf-Xraw.c b/tests/ipc_msgbuf-Xraw.c new file mode 100644 index 00000000..c6f8a31b --- /dev/null +++ b/tests/ipc_msgbuf-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "ipc_msgbuf.c" diff --git a/tests/ipc_msgbuf-Xraw.gen.test b/tests/ipc_msgbuf-Xraw.gen.test new file mode 100755 index 00000000..c1112cb6 --- /dev/null +++ b/tests/ipc_msgbuf-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_msgbuf-Xraw +ipc_msgbuf.test -Xraw -a22); do not edit. +set -- -Xraw -a22 +. "${srcdir=.}/ipc_msgbuf.test" diff --git a/tests/ipc_msgbuf-Xverbose.c b/tests/ipc_msgbuf-Xverbose.c new file mode 100644 index 00000000..ae09a4ad --- /dev/null +++ b/tests/ipc_msgbuf-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "ipc_msgbuf.c" diff --git a/tests/ipc_msgbuf-Xverbose.gen.test b/tests/ipc_msgbuf-Xverbose.gen.test new file mode 100755 index 00000000..2c72eb71 --- /dev/null +++ b/tests/ipc_msgbuf-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_msgbuf-Xverbose +ipc_msgbuf.test -Xverbose); do not edit. +set -- -Xverbose +. "${srcdir=.}/ipc_msgbuf.test" diff --git a/tests/ipc_msgbuf.c b/tests/ipc_msgbuf.c index 1c34494d..92525f94 100644 --- a/tests/ipc_msgbuf.c +++ b/tests/ipc_msgbuf.c @@ -1,33 +1,17 @@ /* * Copyright (c) 2015 Elvira Khabirova * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" +#include #include +#include +#include #include #include #include @@ -37,17 +21,54 @@ static int msqid = -1; -static void +#if XLAT_RAW +# define str_ipc_creat "0x200" +# define str_ipc_private "0" +# define str_ipc_rmid "0" +# define str_ipc_64 "0x100" +#elif XLAT_VERBOSE +# define str_ipc_creat "0x200 /\\* IPC_CREAT \\*/" +# define str_ipc_private "0 /\\* IPC_PRIVATE \\*/" +# define str_ipc_rmid "0 /\\* IPC_RMID \\*/" +# define str_ipc_64 "0x100 /\\* IPC_64 \\*/" +#else +# define str_ipc_creat "IPC_CREAT" +# define str_ipc_private "IPC_PRIVATE" +# define str_ipc_rmid "IPC_RMID" +# define str_ipc_64 "IPC_64" +#endif + +static int cleanup(void) { - msgctl(msqid, IPC_RMID, 0); - msqid = -1; + if (msqid != -1) { + int rc = msgctl(msqid, IPC_RMID, 0); + printf("msgctl\\(%d, (%s\\|)?%s, NULL\\) = 0\n", + msqid, str_ipc_64, str_ipc_rmid); + msqid = -1; + if (rc == -1) + return 77; + puts("\\+\\+\\+ exited with 0 \\+\\+\\+"); + } + return 0; +} + +int +sys_msgrcv(int msqid, void *msgp, size_t sz, kernel_long_t msgtyp, + int msgflg) +{ +#if defined __x86_64__ && defined __ILP32__ + return syscall(__NR_msgrcv, msqid, msgp, sz, msgtyp, msgflg); +#else + return msgrcv(msqid, msgp, sz, msgtyp, msgflg); +#endif } int -main (void) +main(void) { - const long mtype = 0xdefaced; + /* mtype has to be positive */ + const kernel_long_t mtype = (kernel_long_t) 0x7facefed5adc0dedULL; struct { kernel_long_t mtype; char mtext[msgsz]; @@ -58,10 +79,23 @@ main (void) msqid = msgget(IPC_PRIVATE, IPC_CREAT | S_IRWXU); if (msqid == -1) perror_msg_and_skip("msgget"); - atexit(cleanup); + printf("msgget\\(%s, %s\\|0700\\) = %d\n", + str_ipc_private, str_ipc_creat, msqid); + + typedef void (*atexit_func)(void); + atexit((atexit_func) cleanup); + + printf("msgsnd\\(%d, \\{%lld, \"" text_string "\\\\0\"\\}, 14, 0\\)" + " = 0\n", + msqid, (long long) mtype); if (msgsnd(msqid, &msg, msgsz, 0) == -1) perror_msg_and_skip("msgsnd"); - if (msgrcv(msqid, &msg, msgsz, mtype, 0) != msgsz) + + if (sys_msgrcv(msqid, &msg, msgsz, -mtype, 0) != msgsz) perror_msg_and_skip("msgrcv"); - return 0; + printf("msgrcv\\(%d, \\{%lld, \"" text_string "\\\\0\"\\}, 14, %lld" + ", 0\\) = 14\n", + msqid, (long long) mtype, -(long long) mtype); + + return cleanup(); } diff --git a/tests/ipc_msgbuf.expected b/tests/ipc_msgbuf.expected deleted file mode 100644 index 880424bf..00000000 --- a/tests/ipc_msgbuf.expected +++ /dev/null @@ -1,4 +0,0 @@ -msgget\(IPC_PRIVATE, IPC_CREAT\|0700\) += [0-9]* -msgsnd\([0-9]*, \{233811181, "STRACE_STRING\\0"\}, 14, 0\) += 0 -msgrcv\([0-9]*, \{233811181, "STRACE_STRING\\0"\}, 14, 233811181, 0\) += 14 -msgctl\([0-9]*, (IPC_64\|)?IPC_RMID, NULL\) += 0 diff --git a/tests/ipc_msgbuf.test b/tests/ipc_msgbuf.test index d0b65d1a..4e26578a 100755 --- a/tests/ipc_msgbuf.test +++ b/tests/ipc_msgbuf.test @@ -1,11 +1,16 @@ #!/bin/sh - +# # Check msgget, msgsnd, msgrcv, msgctl syscalls decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog -run_strace -v -e msgget,msgsnd,msgrcv,msgctl $args -match_grep +run_strace -a26 -v -e msgget,msgsnd,msgrcv,msgctl "$@" $args > "$EXP" +match_grep "$LOG" "$EXP" exit 0 diff --git a/tests/ipc_sem-Xabbrev.c b/tests/ipc_sem-Xabbrev.c new file mode 100644 index 00000000..727005ad --- /dev/null +++ b/tests/ipc_sem-Xabbrev.c @@ -0,0 +1 @@ +#include "ipc_sem.c" diff --git a/tests/ipc_sem-Xabbrev.gen.test b/tests/ipc_sem-Xabbrev.gen.test new file mode 100755 index 00000000..0757a48b --- /dev/null +++ b/tests/ipc_sem-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_sem-Xabbrev +ipc.sh -Xabbrev -a29); do not edit. +set -- -Xabbrev -a29 +. "${srcdir=.}/ipc.sh" diff --git a/tests/ipc_sem-Xraw.c b/tests/ipc_sem-Xraw.c new file mode 100644 index 00000000..0a57c0ac --- /dev/null +++ b/tests/ipc_sem-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "ipc_sem.c" diff --git a/tests/ipc_sem-Xraw.gen.test b/tests/ipc_sem-Xraw.gen.test new file mode 100755 index 00000000..07d59e51 --- /dev/null +++ b/tests/ipc_sem-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_sem-Xraw +ipc.sh -Xraw -a19); do not edit. +set -- -Xraw -a19 +. "${srcdir=.}/ipc.sh" diff --git a/tests/ipc_sem-Xverbose.c b/tests/ipc_sem-Xverbose.c new file mode 100644 index 00000000..56e83806 --- /dev/null +++ b/tests/ipc_sem-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "ipc_sem.c" diff --git a/tests/ipc_sem-Xverbose.gen.test b/tests/ipc_sem-Xverbose.gen.test new file mode 100755 index 00000000..43a61d08 --- /dev/null +++ b/tests/ipc_sem-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_sem-Xverbose +ipc.sh -Xverbose -a36); do not edit. +set -- -Xverbose -a36 +. "${srcdir=.}/ipc.sh" diff --git a/tests/ipc_sem.c b/tests/ipc_sem.c index 8f6382cc..7341f728 100644 --- a/tests/ipc_sem.c +++ b/tests/ipc_sem.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2015 Andreas Schwab * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -35,11 +16,48 @@ #include "xlat.h" #include "xlat/resource_flags.h" +#ifndef SEM_STAT_ANY +# define SEM_STAT_ANY 20 +#endif + +#if XLAT_RAW +# define str_ipc_flags "0xface1e00" +# define str_ipc_private "0" +# define str_ipc_rmid "0" +# define str_ipc_stat "0x2" +# define str_sem_stat "0x12" +# define str_sem_info "0x13" +# define str_sem_stat_any "0x14" +# define str_ipc_64 "0x100" +# define str_bogus_cmd "0xdeadbeef" +#elif XLAT_VERBOSE +# define str_ipc_flags \ + "0xface1e00 /\\* IPC_CREAT\\|IPC_EXCL\\|IPC_NOWAIT\\|0xface1000 \\*/" +# define str_ipc_private "0 /\\* IPC_PRIVATE \\*/" +# define str_ipc_rmid "0 /\\* IPC_RMID \\*/" +# define str_ipc_stat "0x2 /\\* IPC_STAT \\*/" +# define str_sem_stat "0x12 /\\* SEM_STAT \\*/" +# define str_sem_info "0x13 /\\* SEM_INFO \\*/" +# define str_sem_stat_any "0x14 /\\* SEM_STAT_ANY \\*/" +# define str_ipc_64 "0x100 /\\* IPC_64 \\*/" +# define str_bogus_cmd "0xdeadbeef /\\* SEM_\\?\\?\\? \\*/" +#else +# define str_ipc_flags "IPC_CREAT\\|IPC_EXCL\\|IPC_NOWAIT\\|0xface1000" +# define str_ipc_private "IPC_PRIVATE" +# define str_ipc_rmid "IPC_RMID" +# define str_ipc_stat "IPC_STAT" +# define str_sem_stat "SEM_STAT" +# define str_sem_info "SEM_INFO" +# define str_sem_stat_any "SEM_STAT_ANY" +# define str_ipc_64 "IPC_64" +# define str_bogus_cmd "0xdeadbeef /\\* SEM_\\?\\?\\? \\*/" +#endif + union semun { - int val; /* Value for SETVAL */ - struct semid_ds *buf; /* Buffer for IPC_STAT, IPC_SET */ - unsigned short *array; /* Array for GETALL, SETALL */ - struct seminfo *__buf; /* Buffer for IPC_INFO + int val; /* Value for SETVAL */ + struct semid_ds *buf; /* Buffer for IPC_STAT, IPC_SET */ + unsigned short *array; /* Array for GETALL, SETALL */ + struct seminfo *__buf; /* Buffer for IPC_INFO (Linux-specific) */ }; @@ -49,8 +67,8 @@ static void cleanup(void) { semctl(id, 0, IPC_RMID, 0); - printf("semctl\\(%d, 0, (IPC_64\\|)?IPC_RMID, \\[?NULL\\]?\\) += 0\n", - id); + printf("semctl\\(%d, 0, (%s\\|)?%s, \\[?NULL\\]?\\) = 0\n", + id, str_ipc_64, str_ipc_rmid); id = -1; } @@ -74,42 +92,41 @@ main(void) struct seminfo info; rc = semget(bogus_key, bogus_size, bogus_flags); - printf("semget\\(%#llx, %d, %s%s%s%#x\\|%#04o\\) += %s\n", + printf("semget\\(%#llx, %d, %s\\|%#04o\\) = %s\n", zero_extend_signed_to_ull(bogus_key), bogus_size, - IPC_CREAT & bogus_flags ? "IPC_CREAT\\|" : "", - IPC_EXCL & bogus_flags ? "IPC_EXCL\\|" : "", - IPC_NOWAIT & bogus_flags ? "IPC_NOWAIT\\|" : "", - bogus_flags & ~(0777 | IPC_CREAT | IPC_EXCL | IPC_NOWAIT), - bogus_flags & 0777, sprintrc_grep(rc)); + str_ipc_flags, bogus_flags & 0777, sprintrc_grep(rc)); id = semget(private_key, 1, 0600); if (id < 0) perror_msg_and_skip("semget"); - printf("semget\\(IPC_PRIVATE, 1, 0600\\) += %d\n", id); + printf("semget\\(%s, 1, 0600\\) = %d\n", str_ipc_private, id); atexit(cleanup); rc = semctl(bogus_semid, bogus_semnum, bogus_cmd, bogus_arg); #define SEMCTL_BOGUS_ARG_FMT "(%#lx|\\[(%#lx|NULL)\\]|NULL)" - printf("semctl\\(%d, %d, (IPC_64\\|)?%#x /\\* SEM_\\?\\?\\? \\*/" - ", " SEMCTL_BOGUS_ARG_FMT "\\) += %s\n", - bogus_semid, bogus_semnum, bogus_cmd, + printf("semctl\\(%d, %d, (%s\\|)?%s, " SEMCTL_BOGUS_ARG_FMT "\\) = %s\n", + bogus_semid, bogus_semnum, str_ipc_64, str_bogus_cmd, bogus_arg, bogus_arg, sprintrc_grep(rc)); un.buf = &ds; if (semctl(id, 0, IPC_STAT, un)) perror_msg_and_skip("semctl IPC_STAT"); - printf("semctl\\(%d, 0, (IPC_64\\|)?IPC_STAT, \\[?%p\\]?\\) += 0\n", - id, &ds); + printf("semctl\\(%d, 0, (%s\\|)?%s, \\[?%p\\]?\\) = 0\n", + id, str_ipc_64, str_ipc_stat, &ds); un.__buf = &info; rc = semctl(0, 0, SEM_INFO, un); - printf("semctl\\(0, 0, (IPC_64\\|)?SEM_INFO, \\[?%p\\]?\\) += %s\n", - &info, sprintrc_grep(rc)); + printf("semctl\\(0, 0, (%s\\|)?%s, \\[?%p\\]?\\) = %s\n", + str_ipc_64, str_sem_info, &info, sprintrc_grep(rc)); un.buf = &ds; rc = semctl(id, 0, SEM_STAT, un); - printf("semctl\\(%d, 0, (IPC_64\\|)?SEM_STAT, \\[?%p\\]?\\) += %s\n", - id, &ds, sprintrc_grep(rc)); + printf("semctl\\(%d, 0, (%s\\|)?%s, \\[?%p\\]?\\) = %s\n", + id, str_ipc_64, str_sem_stat, &ds, sprintrc_grep(rc)); + + rc = semctl(id, 0, SEM_STAT_ANY, un); + printf("semctl\\(%d, 0, (%s\\|)?%s, (%p|\\[(%p|NULL)\\]|NULL)\\) = %s\n", + id, str_ipc_64, str_sem_stat_any, &ds, &ds, sprintrc_grep(rc)); return 0; } diff --git a/tests/ipc_sem.gen.test b/tests/ipc_sem.gen.test new file mode 100755 index 00000000..173b3af3 --- /dev/null +++ b/tests/ipc_sem.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_sem +ipc.sh -a29); do not edit. +set -- -a29 +. "${srcdir=.}/ipc.sh" diff --git a/tests/ipc_sem.test b/tests/ipc_sem.test deleted file mode 100755 index cc93d07b..00000000 --- a/tests/ipc_sem.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check decoding of ipc semget/semctl syscalls - -. "${srcdir=.}/ipc.sh" diff --git a/tests/ipc_shm-Xabbrev.c b/tests/ipc_shm-Xabbrev.c new file mode 100644 index 00000000..c191aeaa --- /dev/null +++ b/tests/ipc_shm-Xabbrev.c @@ -0,0 +1 @@ +#include "ipc_shm.c" diff --git a/tests/ipc_shm-Xabbrev.gen.test b/tests/ipc_shm-Xabbrev.gen.test new file mode 100755 index 00000000..d68c2462 --- /dev/null +++ b/tests/ipc_shm-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_shm-Xabbrev +ipc.sh -Xabbrev -a29); do not edit. +set -- -Xabbrev -a29 +. "${srcdir=.}/ipc.sh" diff --git a/tests/ipc_shm-Xraw.c b/tests/ipc_shm-Xraw.c new file mode 100644 index 00000000..08e09ac1 --- /dev/null +++ b/tests/ipc_shm-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "ipc_shm.c" diff --git a/tests/ipc_shm-Xraw.gen.test b/tests/ipc_shm-Xraw.gen.test new file mode 100755 index 00000000..071eef67 --- /dev/null +++ b/tests/ipc_shm-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_shm-Xraw +ipc.sh -Xraw -a19); do not edit. +set -- -Xraw -a19 +. "${srcdir=.}/ipc.sh" diff --git a/tests/ipc_shm-Xverbose.c b/tests/ipc_shm-Xverbose.c new file mode 100644 index 00000000..b936785f --- /dev/null +++ b/tests/ipc_shm-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "ipc_shm.c" diff --git a/tests/ipc_shm-Xverbose.gen.test b/tests/ipc_shm-Xverbose.gen.test new file mode 100755 index 00000000..170adeee --- /dev/null +++ b/tests/ipc_shm-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ipc_shm-Xverbose +ipc.sh -Xverbose -a36); do not edit. +set -- -Xverbose -a36 +. "${srcdir=.}/ipc.sh" diff --git a/tests/ipc_shm.c b/tests/ipc_shm.c index 66960ff9..76c19d8d 100644 --- a/tests/ipc_shm.c +++ b/tests/ipc_shm.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2015 Elvira Khabirova * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,16 +13,70 @@ #include #include +#ifndef SHM_HUGE_SHIFT +# define SHM_HUGE_SHIFT 26 +#endif + +#ifndef SHM_HUGE_MASK +# define SHM_HUGE_MASK 0x3f +#endif + +#ifndef SHM_STAT_ANY +# define SHM_STAT_ANY 15 +#endif + #include "xlat.h" #include "xlat/shm_resource_flags.h" +#if XLAT_RAW +# define str_ipc_flags "0x2ce1e00" +# define str_shm_huge "21<<26" +# define str_ipc_private "0" +# define str_ipc_rmid "0" +# define str_ipc_set "0x1" +# define str_ipc_stat "0x2" +# define str_shm_stat "0xd" +# define str_shm_info "0xe" +# define str_shm_stat_any "0xf" +# define str_ipc_64 "0x100" +# define str_bogus_cmd "0xdefaced2" +#elif XLAT_VERBOSE +# define str_ipc_flags \ + "0x2ce1e00 /\\* IPC_CREAT\\|IPC_EXCL\\|SHM_HUGETLB\\|SHM_NORESERVE" \ + "\\|0x2ce0000 \\*/" +# define str_shm_huge "21<<26 /\\* SHM_HUGE_SHIFT \\*/" +# define str_ipc_private "0 /\\* IPC_PRIVATE \\*/" +# define str_ipc_rmid "0 /\\* IPC_RMID \\*/" +# define str_ipc_set "0x1 /\\* IPC_SET \\*/" +# define str_ipc_stat "0x2 /\\* IPC_STAT \\*/" +# define str_shm_stat "0xd /\\* SHM_STAT \\*/" +# define str_shm_info "0xe /\\* SHM_INFO \\*/" +# define str_shm_stat_any "0xf /\\* SHM_STAT_ANY \\*/" +# define str_ipc_64 "0x100 /\\* IPC_64 \\*/" +# define str_bogus_cmd "0xdefaced2 /\\* SHM_\\?\\?\\? \\*/" +#else +# define str_ipc_flags \ + "IPC_CREAT\\|IPC_EXCL\\|SHM_HUGETLB\\|SHM_NORESERVE\\|0x2ce0000" +# define str_shm_huge "21< + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef MIPS + +int +main(void) +{ + __asm__(".set noreorder; li $a0, 0; li $v0, 5058; syscall"); + return 77; +} + +#else + +SKIP_MAIN_UNDEFINED("MIPS") + +#endif diff --git a/tests/kcmp-y.c b/tests/kcmp-y.c new file mode 100644 index 00000000..02ad90e5 --- /dev/null +++ b/tests/kcmp-y.c @@ -0,0 +1,3 @@ +#define VERBOSE_FD 1 + +#include "kcmp.c" diff --git a/tests/kcmp-y.gen.test b/tests/kcmp-y.gen.test new file mode 100755 index 00000000..065db9d0 --- /dev/null +++ b/tests/kcmp-y.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kcmp-y -a22 -y -e trace=kcmp); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -y -e trace=kcmp diff --git a/tests/kcmp.c b/tests/kcmp.c index cb497c9f..4e3433ee 100644 --- a/tests/kcmp.c +++ b/tests/kcmp.c @@ -1,30 +1,11 @@ /* * Check decoding of kcmp syscall. * - * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2017 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -34,15 +15,67 @@ #ifdef __NR_kcmp +# include +# include +# include # include +# include # include -# define KCMP_FILE 0 -# define KCMP_SYSVSEM 6 +# ifndef VERBOSE_FD +# define VERBOSE_FD 0 +# endif + +/* + * We prefer to use system headers in order to catch some possible deviations in + * system's headers from our perception of reality, but happy to include our own + * definitions as well. + */ +# ifdef HAVE_LINUX_KCMP_H +# include +# else +# define KCMP_FILE 0 +# define KCMP_VM 1 +# define KCMP_FILES 2 +# define KCMP_FS 3 +# define KCMP_SIGHAND 4 +# define KCMP_IO 5 +# define KCMP_SYSVSEM 6 +# endif + +/* All other kcmp types have been added atomically */ +# define KCMP_EPOLL_TFD 7 + +# ifndef HAVE_STRUCT_KCMP_EPOLL_SLOT +struct kcmp_epoll_slot { + uint32_t efd; + uint32_t tfd; + uint32_t toff; +}; +# endif + +static const kernel_ulong_t kcmp_max_type = KCMP_EPOLL_TFD; + +static const char null_path[] = "/dev/null"; +static const char zero_path[] = "/dev/zero"; + +# define NULL_FD 23 +# define ZERO_FD 42 +static void +printpidfd(const char *prefix, pid_t pid, unsigned fd) +{ + printf("%s%d", prefix, fd); +} + +/* + * Last argument is optional and is used as follows: + * * When type is KCMP_EPOLL_TFD, it signalises whether idx2 is a valid + * pointer. + */ static void do_kcmp(kernel_ulong_t pid1, kernel_ulong_t pid2, kernel_ulong_t type, - const char *type_str, kernel_ulong_t idx1, kernel_ulong_t idx2) + const char *type_str, kernel_ulong_t idx1, kernel_ulong_t idx2, ...) { long rc; const char *errstr; @@ -57,11 +90,37 @@ do_kcmp(kernel_ulong_t pid1, kernel_ulong_t pid2, kernel_ulong_t type, else printf("%#x /* KCMP_??? */", (int) type); - if (type == KCMP_FILE) - printf(", %u, %u", (unsigned) idx1, (unsigned) idx2); - else if (type > KCMP_SYSVSEM) + if (type == KCMP_FILE) { + printpidfd(", ", pid1, idx1); + printpidfd(", ", pid2, idx2); + } else if (type == KCMP_EPOLL_TFD) { + va_list ap; + int valid_ptr; + + va_start(ap, idx2); + valid_ptr = va_arg(ap, int); + va_end(ap); + + printpidfd(", ", pid1, idx1); + printf(", "); + + if (valid_ptr) { + struct kcmp_epoll_slot *slot = + (struct kcmp_epoll_slot *) (uintptr_t) idx2; + + printpidfd("{efd=", pid2, slot->efd); + printpidfd(", tfd=", pid2, slot->tfd); + printf(", toff=%llu}", (unsigned long long) slot->toff); + } else { + if (idx2) + printf("%#llx", (unsigned long long) idx2); + else + printf("NULL"); + } + } else if (type > kcmp_max_type) { printf(", %#llx, %#llx", (unsigned long long) idx1, (unsigned long long) idx2); + } printf(") = %s\n", errstr); } @@ -79,18 +138,71 @@ main(void) (kernel_ulong_t) 0xdec0ded3dec0ded4ULL; static const kernel_ulong_t bogus_idx2 = (kernel_ulong_t) 0xba5e1e55deadc0deULL; + static const struct kcmp_epoll_slot slot_data[] = { + { 0xdeadc0de, 0xfacef157, 0xbadc0ded }, + { NULL_FD, ZERO_FD, 0 }, + { 0, 0, 0 }, + }; + static kernel_ulong_t ptr_check = + F8ILL_KULONG_SUPPORTED ? F8ILL_KULONG_MASK : 0; + + int fd; + unsigned i; + TAIL_ALLOC_OBJECT_CONST_PTR(struct kcmp_epoll_slot, slot); + + /* Open some files to test printpidfd */ + fd = open(null_path, O_RDONLY); + if (fd < 0) + perror_msg_and_fail("open(\"%s\")", null_path); + if (fd != NULL_FD) { + if (dup2(fd, NULL_FD) < 0) + perror_msg_and_fail("dup2(fd, NULL_FD)"); + close(fd); + } + + fd = open(zero_path, O_RDONLY); + if (fd < 0) + perror_msg_and_fail("open(\"%s\")", zero_path); + if (fd != ZERO_FD) { + if (dup2(fd, ZERO_FD) < 0) + perror_msg_and_fail("dup2(fd, ZERO_FD)"); + close(fd); + } + + close(0); /* Invalid values */ do_kcmp(bogus_pid1, bogus_pid2, bogus_type, NULL, bogus_idx1, bogus_idx2); - do_kcmp(0, 0, KCMP_SYSVSEM + 1, NULL, 0, 0); + do_kcmp(F8ILL_KULONG_MASK, F8ILL_KULONG_MASK, kcmp_max_type + 1, NULL, + 0, 0); /* KCMP_FILE is the only type which has additional args */ do_kcmp(3141592653U, 2718281828U, ARG_STR(KCMP_FILE), bogus_idx1, bogus_idx2); - /* Some type without additional args */ + do_kcmp(-1, -1, ARG_STR(KCMP_FILE), NULL_FD, ZERO_FD); + + /* Types without additional args */ + do_kcmp(-1, -1, ARG_STR(KCMP_VM), bogus_idx1, bogus_idx2); + do_kcmp(-1, -1, ARG_STR(KCMP_FILES), bogus_idx1, bogus_idx2); + do_kcmp(-1, -1, ARG_STR(KCMP_FS), bogus_idx1, bogus_idx2); + do_kcmp(-1, -1, ARG_STR(KCMP_SIGHAND), bogus_idx1, bogus_idx2); + do_kcmp(-1, -1, ARG_STR(KCMP_IO), bogus_idx1, bogus_idx2); do_kcmp(-1, -1, ARG_STR(KCMP_SYSVSEM), bogus_idx1, bogus_idx2); + /* KCMP_EPOLL_TFD checks */ + do_kcmp(-1, -1, ARG_STR(KCMP_EPOLL_TFD), + F8ILL_KULONG_MASK | 2718281828U, ptr_check, 0); + do_kcmp(-1, -1, ARG_STR(KCMP_EPOLL_TFD), + 3141592653U, (uintptr_t) slot + 1, 0); + + for (i = 0; i < ARRAY_SIZE(slot_data); i++) { + memcpy(slot, slot_data + i, sizeof(*slot)); + + do_kcmp(getpid(), getppid(), ARG_STR(KCMP_EPOLL_TFD), NULL_FD, + (uintptr_t) slot, 1); + } + puts("+++ exited with 0 +++"); return 0; diff --git a/tests/kcmp.gen.test b/tests/kcmp.gen.test new file mode 100755 index 00000000..139e909b --- /dev/null +++ b/tests/kcmp.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kcmp -a22 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests/kcmp.test b/tests/kcmp.test deleted file mode 100755 index d022aeba..00000000 --- a/tests/kcmp.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of kcmp syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests/kern_features-fault.test b/tests/kern_features-fault.test new file mode 100755 index 00000000..a46c839f --- /dev/null +++ b/tests/kern_features-fault.test @@ -0,0 +1,43 @@ +#!/bin/sh +# +# Check decoding of SPARC-specific kern_features syscall. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +run_prog ../kern_features > /dev/null +prog="$args" +fault_args='-a16 -e trace=kern_features -e inject=kern_features:retval=' + +test_run_rval() +{ + local run rval + run="$1"; shift + rval="$1"; shift + + run_strace $fault_args$rval $prog $run > "$EXP" + match_diff "$LOG" "$EXP" +} + +test_run_rval 0 0 +test_run_rval 1 1 +test_run_rval 2 2 +test_run_rval 3 2147483646 # 0x7ffffffe +test_run_rval 4 2147483647 # 0x7fffffff + +exit 0 # injecting retval < 0 not supported yet + +case "$SIZEOF_KERNEL_LONG_T" in +4) + test_run_rval 5 3735943886 # 0xdeadface + test_run_rval 6 4294967295 # 0xffffffff + ;; +8) + test_run_rval 5 13464652301225294542 # 0xbadc0deddeadface + test_run_rval 6 18446744073709551615 # 0xffffffffffffffff + ;; +esac diff --git a/tests/kern_features.c b/tests/kern_features.c new file mode 100644 index 00000000..4814414d --- /dev/null +++ b/tests/kern_features.c @@ -0,0 +1,100 @@ +/* + * Check decoding of SPARC-specific kern_features syscall. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include + +#include "raw_syscall.h" +#include "scno.h" + +#if defined __NR_kern_features && defined raw_syscall_0 + +# include +# include +# include +# include + +static void +test_kern_features(unsigned int num) +{ + /* The expected return codes, as enforced by fault injection */ + static struct { + kernel_ulong_t ret; + const char *str; + } checks[] = { + { 0, NULL }, + { 1, "KERN_FEATURE_MIXED_MODE_STACK" }, + { 2, "0x2" }, + { 0x7ffffffe, "0x7ffffffe" }, + { 0x7fffffff, "KERN_FEATURE_MIXED_MODE_STACK|0x7ffffffe" }, + { (kernel_ulong_t) 0xbadc0deddeadfaceULL, + sizeof(kernel_ulong_t) == 8 ? + "0xbadc0deddeadface" : "0xdeadface" }, + { (kernel_ulong_t) -1ULL, + sizeof(kernel_ulong_t) == 8 ? + "KERN_FEATURE_MIXED_MODE_STACK|0xfffffffffffffffe" : + "KERN_FEATURE_MIXED_MODE_STACK|0xfffffffe" }, + }; + + kernel_ulong_t err = 0; + kernel_ulong_t rc = raw_syscall_0(__NR_kern_features, &err); + + if (err) { + errno = rc; + printf("kern_features() = %s\n", sprintrc(-1)); + return; + } + + printf("kern_features() = %#llx", (unsigned long long) rc); + + if (num < ARRAY_SIZE(checks)) { + if (rc != checks[num].ret) + error_msg_and_fail("Expected return value (%llx) " + "doesn't match expected one (%#llx)", + (unsigned long long) rc, + (unsigned long long) checks[num].ret); + + if (checks[num].str) + printf(" (%s)", checks[num].str); + + printf(" (INJECTED)"); + } else if (rc) { + printf(" ("); + + if (rc & 1) + printf("KERN_FEATURE_MIXED_MODE_STACK"); + + if (rc & ~1ULL) { + if (rc & 1) + printf("|"); + + printf("%#llx", rc & ~1ULL); + } + + printf(")"); + } + + puts(""); +} + +int +main(int ac, char **av) +{ + test_kern_features(ac > 1 ? atoi(av[1]) : -1); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_kern_features && raw_syscall_0"); + +#endif diff --git a/tests/kern_features.gen.test b/tests/kern_features.gen.test new file mode 100755 index 00000000..317614a4 --- /dev/null +++ b/tests/kern_features.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kern_features -a16 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 diff --git a/tests/kernel_version-Xabbrev.c b/tests/kernel_version-Xabbrev.c new file mode 100644 index 00000000..2d6da358 --- /dev/null +++ b/tests/kernel_version-Xabbrev.c @@ -0,0 +1 @@ +#include "kernel_version.c" diff --git a/tests/kernel_version-Xabbrev.gen.test b/tests/kernel_version-Xabbrev.gen.test new file mode 100755 index 00000000..abfd5676 --- /dev/null +++ b/tests/kernel_version-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kernel_version-Xabbrev -a16 -Xabbrev -v -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 -Xabbrev -v -e trace=bpf diff --git a/tests/kernel_version-Xraw.c b/tests/kernel_version-Xraw.c new file mode 100644 index 00000000..cf27608b --- /dev/null +++ b/tests/kernel_version-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "kernel_version.c" diff --git a/tests/kernel_version-Xraw.gen.test b/tests/kernel_version-Xraw.gen.test new file mode 100755 index 00000000..e274faad --- /dev/null +++ b/tests/kernel_version-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kernel_version-Xraw -a16 -Xraw -v -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 -Xraw -v -e trace=bpf diff --git a/tests/kernel_version-Xverbose.c b/tests/kernel_version-Xverbose.c new file mode 100644 index 00000000..cc6eb1b7 --- /dev/null +++ b/tests/kernel_version-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "kernel_version.c" diff --git a/tests/kernel_version-Xverbose.gen.test b/tests/kernel_version-Xverbose.gen.test new file mode 100755 index 00000000..b9536ca3 --- /dev/null +++ b/tests/kernel_version-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kernel_version-Xverbose -a16 -Xverbose -v -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 -Xverbose -v -e trace=bpf diff --git a/tests/kernel_version.c b/tests/kernel_version.c new file mode 100644 index 00000000..6e1c0eac --- /dev/null +++ b/tests/kernel_version.c @@ -0,0 +1,104 @@ +/* + * Check kernel version decoding. + * + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +#include +#include "scno.h" + +#ifdef HAVE_LINUX_BPF_H +# include +#endif + +#include "bpf_attr.h" +#include "print_fields.h" + +#include "xlat.h" +#include "xlat/bpf_commands.h" + +#define CMD_STR(x) #x +static const char *errstr; + +static void +print_bpf_attr(void) +{ +#if XLAT_RAW + printf("{prog_type=0x16" +#else + printf("{prog_type=0x16 /* BPF_PROG_TYPE_??? */" +#endif + ", insn_cnt=3134983661" + ", insns=NULL" + ", license=NULL" + ", log_level=24" + ", log_size=3141592653" + ", log_buf=NULL" +#if XLAT_RAW + ", kern_version=0xcafef00d" +#elif XLAT_VERBOSE + ", kern_version=0xcafef00d" + " /* KERNEL_VERSION(51966, 240, 13) */" +#else + ", kern_version=KERNEL_VERSION(51966, 240, 13)" +#endif + ", prog_flags=0" + ", prog_name=\"\"" + ", prog_ifindex=0" + ", expected_attach_type=" +#if XLAT_RAW + "0" +#elif XLAT_VERBOSE + "0 /* BPF_CGROUP_INET_INGRESS */" +#else /* XLAT_ABBREV */ + "BPF_CGROUP_INET_INGRESS" +#endif + ", prog_btf_fd=0" + ", func_info_rec_size=0" + ", func_info=NULL" + ", func_info_cnt=0" + ", line_info_rec_size=0" + ", line_info=NULL" + ", line_info_cnt=0}"); +} + +int +main(void) +{ + long ret; + struct BPF_PROG_LOAD_struct prog = { + .prog_type = 22, + .insn_cnt = 0xbadc0ded, + .insns = 0, + .license = 0, + .log_level = 24, + .log_size = 3141592653U, + .log_buf = 0, + .kern_version = 0xcafef00d, + .prog_flags = 0, + }; + ret = syscall(__NR_bpf, BPF_PROG_LOAD, &prog, sizeof(prog)); + errstr = sprintrc(ret); +#if XLAT_RAW + printf("bpf(%#x, ", BPF_PROG_LOAD); +#elif XLAT_VERBOSE + printf("bpf(%#x /* %s */, ", BPF_PROG_LOAD, CMD_STR(BPF_PROG_LOAD)); +#else + printf("bpf(%s, ", CMD_STR(BPF_PROG_LOAD)); +#endif + print_bpf_attr(); + printf(", %u) = %s\n", (unsigned int) sizeof(prog), errstr); + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/kernel_version.gen.test b/tests/kernel_version.gen.test new file mode 100755 index 00000000..8430c763 --- /dev/null +++ b/tests/kernel_version.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kernel_version -a16 -v -e trace=bpf); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 -v -e trace=bpf diff --git a/tests/kexec_file_load.c b/tests/kexec_file_load.c index be90a37d..5e5d91ed 100644 --- a/tests/kexec_file_load.c +++ b/tests/kexec_file_load.c @@ -2,29 +2,10 @@ * Check decoding of kexec_file_load syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -44,7 +25,7 @@ struct strval { const char *str; }; -#define CMDLINE_STR "deadcodebaddatadefaced"; +# define CMDLINE_STR "deadcodebaddatadefaced" int main(void) diff --git a/tests/kexec_file_load.gen.test b/tests/kexec_file_load.gen.test new file mode 100755 index 00000000..11013497 --- /dev/null +++ b/tests/kexec_file_load.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kexec_file_load -s9 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s9 diff --git a/tests/kexec_file_load.test b/tests/kexec_file_load.test deleted file mode 100755 index c95e1238..00000000 --- a/tests/kexec_file_load.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of kexec_file_load syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s9 diff --git a/tests/kexec_load.c b/tests/kexec_load.c index 330238de..ae7a72c0 100644 --- a/tests/kexec_load.c +++ b/tests/kexec_load.c @@ -2,29 +2,10 @@ * Check decoding of kexec_load syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -62,8 +43,7 @@ main(void) }; static const kernel_ulong_t bogus_zero = - sizeof(long) < sizeof(kernel_long_t) ? - (kernel_ulong_t) 0xffffffff00000000ULL : 0; + sizeof(long) < sizeof(kernel_long_t) ? F8ILL_KULONG_MASK : 0; static const kernel_ulong_t bogus_entry = (kernel_ulong_t) 0xdeadca57badda7a1ULL; static const kernel_ulong_t bogus_nsegs = @@ -129,7 +109,7 @@ main(void) printf("{buf=%p, bufsz=%zu, mem=%p, memsz=%zu}, ", segms[i].buf, segms[i].bufsz, segms[i].mem, segms[i].memsz); - printf("%p], %s%s) = %s\n", + printf("... /* %p */], %s%s) = %s\n", segms + NUM_SEGMS, sizeof(long) == 8 ? flags[0].str64 : flags[0].str32, flags[0].str, errstr); diff --git a/tests/kexec_load.gen.test b/tests/kexec_load.gen.test new file mode 100755 index 00000000..6ce18317 --- /dev/null +++ b/tests/kexec_load.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kexec_load -s9 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s9 diff --git a/tests/kexec_load.test b/tests/kexec_load.test deleted file mode 100755 index 4b1511e9..00000000 --- a/tests/kexec_load.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of kexec_load syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s9 diff --git a/tests/keyctl-Xabbrev.c b/tests/keyctl-Xabbrev.c new file mode 100644 index 00000000..7b6b0dcc --- /dev/null +++ b/tests/keyctl-Xabbrev.c @@ -0,0 +1 @@ +#include "keyctl.c" diff --git a/tests/keyctl-Xabbrev.gen.test b/tests/keyctl-Xabbrev.gen.test new file mode 100755 index 00000000..0068a032 --- /dev/null +++ b/tests/keyctl-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (keyctl-Xabbrev -a31 -s10 -e trace=keyctl -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 -s10 -e trace=keyctl -Xabbrev diff --git a/tests/keyctl-Xraw.c b/tests/keyctl-Xraw.c new file mode 100644 index 00000000..202c22a9 --- /dev/null +++ b/tests/keyctl-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "keyctl.c" diff --git a/tests/keyctl-Xraw.gen.test b/tests/keyctl-Xraw.gen.test new file mode 100755 index 00000000..2d89ea79 --- /dev/null +++ b/tests/keyctl-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (keyctl-Xraw -a13 -s10 -e trace=keyctl -Xraw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 -s10 -e trace=keyctl -Xraw diff --git a/tests/keyctl-Xverbose.c b/tests/keyctl-Xverbose.c new file mode 100644 index 00000000..9f9d744a --- /dev/null +++ b/tests/keyctl-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "keyctl.c" diff --git a/tests/keyctl-Xverbose.gen.test b/tests/keyctl-Xverbose.gen.test new file mode 100755 index 00000000..a0cdd7de --- /dev/null +++ b/tests/keyctl-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (keyctl-Xverbose -a41 -s10 -e trace=keyctl -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a41 -s10 -e trace=keyctl -Xverbose diff --git a/tests/keyctl.c b/tests/keyctl.c index 2e26076b..ccfd3b44 100644 --- a/tests/keyctl.c +++ b/tests/keyctl.c @@ -2,29 +2,10 @@ * Check decoding of keyctl syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,10 +17,10 @@ # include # include +# include # include # include # include -# include # include # include # include @@ -55,6 +36,15 @@ struct keyctl_dh_params { }; # endif +# ifndef HAVE_STRUCT_KEYCTL_KDF_PARAMS +struct keyctl_kdf_params { + char *hashname; + char *otherinfo; + uint32_t otherinfolen; + uint32_t __spare[8]; +}; +# endif + # include "xlat.h" # include "xlat/keyctl_commands.h" @@ -74,7 +64,18 @@ static const size_t limit = 10; * significantly breaking interface. */ bool nul_terminated_buf = true; -bool buf_in_arg = false; +bool buf_in_arg; + +/* From ioctl_dm.c */ +# define STR32 "AbCdEfGhIjKlMnOpQrStUvWxYz012345" + +# if XLAT_RAW +# define XARG_STR(v_) (v_), STRINGIFY(v_) +# elif XLAT_VERBOSE +# define XARG_STR(v_) (v_), STRINGIFY(v_) " /* " #v_ " */" +# else +# define XARG_STR ARG_STR +# endif /* * When this is called with positive size, the buffer provided is an "out" @@ -97,17 +98,11 @@ print_quoted_string_limit(const char *str, size_t size, long rc) if (!nul_terminated_buf || (strnlen(str, limited_size) == limited_size)) { - printf("\""); print_quoted_memory(str, limited_size); if (print_size > limit) - printf("\"..."); - else - printf("\""); - } else { - printf("\""); + printf("..."); + } else print_quoted_string(str); - printf("\""); - } } static void @@ -121,9 +116,9 @@ print_arg(kernel_ulong_t arg, const char *str, const char *fmt, size_t size, printf("%s", str); } else { if (size == sizeof(uint64_t)) - printf(fmt, (uint64_t)arg); + printf(fmt, (uint64_t) arg); else if (size == sizeof(uint32_t)) - printf(fmt, (uint32_t)arg); + printf(fmt, (uint32_t) arg); else print_quoted_string_limit((void *) (uintptr_t) arg, size, rc); @@ -180,7 +175,13 @@ do_keyctl(kernel_ulong_t cmd, const char *cmd_str, ...) long rc = syscall(__NR_keyctl, cmd, args[0], args[1], args[2], args[3]); const char *errstr = sprintrc(rc); +# if XLAT_RAW + printf("keyctl(%#x", (unsigned) cmd); +# elif XLAT_VERBOSE + printf("keyctl(%#x /* %s */", (unsigned) cmd, cmd_str); +# else printf("keyctl(%s", cmd_str); +# endif for (i = 0; i < cnt; i++) { printf(", "); print_arg(args[i], arg_str[i], arg_fmt[i], arg_sz[i], rc); @@ -188,6 +189,85 @@ do_keyctl(kernel_ulong_t cmd, const char *cmd_str, ...) printf(") = %s\n", errstr); } +int +append_str(char **buf, size_t *left, const char *fmt, ...) +{ + int ret; + va_list ap; + + va_start(ap, fmt); + ret = vsnprintf(*buf, *left, fmt, ap); + va_end(ap); + + assert((ret >= 0) && ((unsigned) ret < *left)); + + *left -= ret; + *buf += ret; + + return ret; +} + +const char * +kckdfp_to_str(struct keyctl_kdf_params *kdf, bool deref_hash, bool deref_oi, + bool print_spare, const char *hash_str, const char *oi_str) +{ + static char buf[4096]; + + size_t left = sizeof(buf); + char *pos = buf; + + append_str(&pos, &left, "{hashname="); + + if (deref_hash && hash_str) { + append_str(&pos, &left, "%s", hash_str); + } else if (!kdf->hashname) { + append_str(&pos, &left, "NULL"); + } else if (deref_hash) { + append_str(&pos, &left, "\"%.*s\"", limit, kdf->hashname); + + if (strnlen(kdf->hashname, limit + 1) > limit) + append_str(&pos, &left, "..."); + } else { + append_str(&pos, &left, "%p", kdf->hashname); + } + + append_str(&pos, &left, ", otherinfo="); + + if (deref_oi && oi_str) { + append_str(&pos, &left, "%s", oi_str); + } else if (!kdf->otherinfo) { + append_str(&pos, &left, "NULL"); + } else if (deref_oi) { + append_str(&pos, &left, "\"%.*s\"", limit, kdf->otherinfo); + + if (strnlen(kdf->otherinfo, limit + 1) > limit) + append_str(&pos, &left, "..."); + } else { + append_str(&pos, &left, "%p", kdf->otherinfo); + } + + append_str(&pos, &left, ", otherinfolen=%u", kdf->otherinfolen); + + if (print_spare) { + size_t i; + + append_str(&pos, &left, ", __spare=["); + + for (i = 0; i < ARRAY_SIZE(kdf->__spare); i++) { + if (i) + append_str(&pos, &left, ", "); + + append_str(&pos, &left, "%#x", kdf->__spare[i]); + } + + append_str(&pos, &left, "]"); + } + + append_str(&pos, &left, "}"); + + return buf; +} + int main(void) { @@ -212,9 +292,50 @@ main(void) static const char *bogus_key3_str = "-557785390"; static const struct keyctl_dh_params kcdhp_data = { - KEY_SPEC_GROUP_KEYRING, 1234567890, 3141592653U }; - static const char *kcdhp_str = "{private=KEY_SPEC_GROUP_KEYRING, " - "prime=1234567890, base=-1153374643}"; + .private = KEY_SPEC_GROUP_KEYRING, + .prime = 1234567890, + .base = 3141592653U + }; + static const char *kcdhp_str = "{private=" +# if XLAT_RAW || XLAT_VERBOSE + "-6" +# endif +# if XLAT_VERBOSE + " /* " +# endif +# if !XLAT_RAW + "KEY_SPEC_GROUP_KEYRING" +# endif +# if XLAT_VERBOSE + " */" +# endif + ", prime=1234567890, base=-1153374643}"; + + /* + * It's bigger than current hash name size limit, but since it's + * implementation-dependent and totally internal, we do not rely + * on it much. + */ + static const char long_hash_data[] = STR32 STR32 STR32 STR32 "xxx"; + static const char short_hash_data[] = "hmac(aes)"; + static const char otherinfo1_data[] = "\1\2 OH HAI THAR\255\0\1"; + static const char otherinfo2_data[] = "\1\2\n\255\0\1"; + static const struct keyctl_kdf_params kckdfp_data[] = { + [0] = { NULL, NULL, 0, { 0 } }, + [1] = { NULL /* Changed to unaccessible address in copy */, + NULL, 0xbadc0dedU, { [7] = 0xdeadfeedU } }, + [2] = { NULL /* long_hash_data */, + NULL /* Changed to unaccessible address in copy */, + 0, { 0 } }, + [3] = { NULL /* unterminated1 */, + NULL /* otherinfo_data */, 0, { 1 } }, + [4] = { NULL /* short_hash_data */, + NULL /* otherinfo1_data */, sizeof(otherinfo1_data), + { 0, 0xfacebeef, 0, 0xba5e1ead } }, + [5] = { NULL /* short_hash_data */, + NULL /* otherinfo2_data */, sizeof(otherinfo2_data), + { 0 } }, + }; char *bogus_str = tail_memdup(unterminated1, sizeof(unterminated1)); char *bogus_desc = tail_memdup(unterminated2, sizeof(unterminated2)); @@ -223,6 +344,15 @@ main(void) char *long_type = tail_memdup(long_type_str, sizeof(long_type_str)); char *long_desc = tail_memdup(long_desc_str, sizeof(long_desc_str)); char *kcdhp = tail_memdup(&kcdhp_data, sizeof(kcdhp_data)); + char *kckdfp_long_hash = tail_memdup(long_hash_data, + sizeof(long_hash_data)); + char *kckdfp_short_hash = tail_memdup(short_hash_data, + sizeof(short_hash_data)); + char *kckdfp_otherinfo1 = tail_memdup(otherinfo1_data, + sizeof(otherinfo1_data)); + char *kckdfp_otherinfo2 = tail_memdup(otherinfo2_data, + sizeof(otherinfo2_data)); + char *kckdfp_char = tail_alloc(sizeof(kckdfp_data[0])); struct iovec *key_iov = tail_alloc(sizeof(*key_iov) * IOV_SIZE); char *bogus_buf1 = tail_alloc(9); char *bogus_buf2 = tail_alloc(256); @@ -230,7 +360,7 @@ main(void) char *key_iov_str2 = tail_alloc(4096); ssize_t ret; ssize_t kis_size = 0; - int i; + size_t i; key_iov[0].iov_base = short_type; key_iov[0].iov_len = sizeof(short_type_str); @@ -297,42 +427,58 @@ main(void) /* Invalid command */ do_keyctl((kernel_ulong_t) 0xbadc0dedfacefeedULL, - "0xfacefeed /* KEYCTL_??? */", +# if XLAT_VERBOSE + "KEYCTL_???" +# else + "0xfacefeed" +# if !XLAT_RAW + " /* KEYCTL_??? */" +# endif +# endif + , sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfee1badc0de5ULL, NULL, kulong_fmt, + (kernel_ulong_t) 0xdeadfee1badc0de5ULL, NULL, + kulong_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfee2badc0de6ULL, NULL, kulong_fmt, + (kernel_ulong_t) 0xdeadfee2badc0de6ULL, NULL, + kulong_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfee3badc0de7ULL, NULL, kulong_fmt, + (kernel_ulong_t) 0xdeadfee3badc0de7ULL, NULL, + kulong_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, kulong_fmt); + (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, + kulong_fmt); /* GET_KEYRING_ID */ do_keyctl(ARG_STR(KEYCTL_GET_KEYRING_ID), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xbadc0dedffffffffLLU, "-1", - NULL, 0UL); + (kernel_ulong_t) 0xbadc0dedffffffffLLU, "-1", NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_GET_KEYRING_ID), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), "%d", - sizeof(int), 3141592653U, NULL, "%d", - NULL, 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), "%d", + sizeof(int), 3141592653U, NULL, "%d", NULL, + 0UL); /* KEYCTL_JOIN_SESSION_KEYRING */ do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), - sizeof(char *), ARG_STR(NULL), NULL, 0UL); + sizeof(char *), ARG_STR(NULL), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, 0UL); do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), - sizeof(char *), bogus_str, NULL, ptr_fmt, 0UL); + sizeof(char *), bogus_str, NULL, ptr_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), - sizeof(char *), ARG_STR("bogus name"), NULL, 0UL); + sizeof(char *), ARG_STR("bogus name"), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_JOIN_SESSION_KEYRING), sizeof(char *), "very long keyring name", "\"very long \"...", - NULL, 0UL); + NULL, + 0UL); /* KEYCTL_UPDATE */ @@ -340,21 +486,21 @@ main(void) buf_in_arg = true; do_keyctl(ARG_STR(KEYCTL_UPDATE), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, sizeof(char *), ARG_STR(NULL), NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 0, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 0, NULL, ksize_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_UPDATE), sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, ksize_fmt, + (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, ksize_fmt, 0UL); do_keyctl(ARG_STR(KEYCTL_UPDATE), sizeof(int32_t), bogus_key2, NULL, "%d", sizeof(char *), bogus_str, NULL, ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, ksize_fmt, + (kernel_ulong_t) 0xdeadfee4badc0de8ULL, NULL, ksize_fmt, 0UL); do_keyctl(ARG_STR(KEYCTL_UPDATE), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, @@ -369,11 +515,14 @@ main(void) /* KEYCTL_REVOKE */ do_keyctl(ARG_STR(KEYCTL_REVOKE), - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_REVOKE), - sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key1, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_REVOKE), - sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key2, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_REVOKE), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, 0UL); @@ -381,34 +530,55 @@ main(void) /* KEYCTL_CHOWN */ do_keyctl(ARG_STR(KEYCTL_CHOWN), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, sizeof(uid_t), ARG_STR(-1), NULL, - sizeof(gid_t), ARG_STR(-1), NULL, 0UL); + sizeof(gid_t), ARG_STR(-1), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_CHOWN), sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(uid_t), 2718281828U, NULL, "%u", - sizeof(gid_t), 3141592653U, NULL, "%u", 0UL); + sizeof(gid_t), 3141592653U, NULL, "%u", + 0UL); /* KEYCTL_SETPERM */ do_keyctl(ARG_STR(KEYCTL_SETPERM), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQKEY_AUTH_KEY), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_REQKEY_AUTH_KEY), NULL, sizeof(uint32_t), 0xffffffffU, - "KEY_POS_VIEW|KEY_POS_READ|KEY_POS_WRITE|" - "KEY_POS_SEARCH|KEY_POS_LINK|KEY_POS_SETATTR|" - "KEY_USR_VIEW|KEY_USR_READ|KEY_USR_WRITE|" - "KEY_USR_SEARCH|KEY_USR_LINK|KEY_USR_SETATTR|" - "KEY_GRP_VIEW|KEY_GRP_READ|KEY_GRP_WRITE|" - "KEY_GRP_SEARCH|KEY_GRP_LINK|KEY_GRP_SETATTR|" - "KEY_OTH_VIEW|KEY_OTH_READ|KEY_OTH_WRITE|" - "KEY_OTH_SEARCH|KEY_OTH_LINK|KEY_OTH_SETATTR|" - "0xc0c0c0c0", NULL, 0UL); +# if XLAT_RAW || XLAT_VERBOSE + "0xffffffff" +# endif +# if XLAT_VERBOSE + " /* " +# endif +# if !XLAT_RAW + "KEY_POS_VIEW|KEY_POS_READ|KEY_POS_WRITE|" + "KEY_POS_SEARCH|KEY_POS_LINK|KEY_POS_SETATTR|" + "KEY_USR_VIEW|KEY_USR_READ|KEY_USR_WRITE|" + "KEY_USR_SEARCH|KEY_USR_LINK|KEY_USR_SETATTR|" + "KEY_GRP_VIEW|KEY_GRP_READ|KEY_GRP_WRITE|" + "KEY_GRP_SEARCH|KEY_GRP_LINK|KEY_GRP_SETATTR|" + "KEY_OTH_VIEW|KEY_OTH_READ|KEY_OTH_WRITE|" + "KEY_OTH_SEARCH|KEY_OTH_LINK|KEY_OTH_SETATTR|" + "0xc0c0c0c0" +# endif +# if XLAT_VERBOSE + " */" +# endif + , NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_SETPERM), sizeof(int32_t), bogus_key1, NULL, "%d", - sizeof(uint32_t), 0, NULL, "%#x", 0UL); + sizeof(uint32_t), 0, NULL, "%#x", + 0UL); do_keyctl(ARG_STR(KEYCTL_SETPERM), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, - sizeof(uint32_t), 0xc0c0c0c0, "0xc0c0c0c0 /* KEY_??? */", + sizeof(uint32_t), 0xc0c0c0c0, + "0xc0c0c0c0" +# if !XLAT_RAW + " /* KEY_??? */" +# endif + , NULL, 0UL); @@ -418,38 +588,41 @@ main(void) sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, 0UL); do_keyctl(ARG_STR(KEYCTL_DESCRIBE), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, 0UL); do_keyctl(ARG_STR(KEYCTL_DESCRIBE), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 9, NULL, ksize_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_DESCRIBE), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 256, NULL, ksize_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_DESCRIBE), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) -4, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) -4, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) -4, NULL, ksize_fmt, + 0UL); /* KEYCTL_CLEAR */ do_keyctl(ARG_STR(KEYCTL_CLEAR), - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_CLEAR), - sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key1, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_CLEAR), - sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key2, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_CLEAR), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, 0UL); @@ -458,12 +631,14 @@ main(void) /* KEYCTL_LINK */ do_keyctl(ARG_STR(KEYCTL_LINK), sizeof(int32_t), bogus_key1, NULL, "%d", - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_LINK), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, - sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), bogus_key2, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_LINK), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, 0UL); @@ -471,13 +646,14 @@ main(void) /* KEYCTL_UNLINK */ do_keyctl(ARG_STR(KEYCTL_UNLINK), sizeof(int32_t), bogus_key1, NULL, "%d", - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); do_keyctl(ARG_STR(KEYCTL_UNLINK), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, - sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), bogus_key2, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_UNLINK), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, 0UL); @@ -486,7 +662,7 @@ main(void) buf_in_arg = true; do_keyctl(ARG_STR(KEYCTL_SEARCH), - sizeof(int32_t), ARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, sizeof(char *), ARG_STR(NULL), NULL, sizeof(char *), ARG_STR(NULL), NULL, sizeof(int32_t), 0, NULL, "%d"); @@ -494,7 +670,7 @@ main(void) sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, sizeof(char *), (char *) 0xfffff00dfffff157ULL, NULL, ptr_fmt, - sizeof(int32_t), ARG_STR(KEY_SPEC_USER_SESSION_KEYRING), + sizeof(int32_t), XARG_STR(KEY_SPEC_USER_SESSION_KEYRING), NULL); do_keyctl(ARG_STR(KEYCTL_SEARCH), sizeof(int32_t), bogus_key2, NULL, "%d", @@ -512,6 +688,34 @@ main(void) sizeof(long_type_str), long_desc, NULL, NULL, sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); + /* KEYCTL_RESTRICT_KEYRING */ + + do_keyctl(ARG_STR(KEYCTL_RESTRICT_KEYRING), + sizeof(int32_t), XARG_STR(KEY_SPEC_REQUESTOR_KEYRING), NULL, + sizeof(char *), ARG_STR(NULL), NULL, + sizeof(char *), ARG_STR(NULL), NULL, + NULL); + do_keyctl(ARG_STR(KEYCTL_RESTRICT_KEYRING), + sizeof(int32_t), bogus_key1, NULL, "%d", + sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, + sizeof(char *), (char *) 0xfffff00dfffff157ULL, NULL, ptr_fmt, + NULL); + do_keyctl(ARG_STR(KEYCTL_RESTRICT_KEYRING), + sizeof(int32_t), bogus_key2, NULL, "%d", + sizeof(char *), bogus_str, NULL, ptr_fmt, + sizeof(char *), bogus_desc, NULL, ptr_fmt, + NULL); + do_keyctl(ARG_STR(KEYCTL_RESTRICT_KEYRING), + sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, + sizeof(short_type_str), short_type, NULL, NULL, + sizeof(short_desc_str), short_desc, NULL, NULL, + NULL); + do_keyctl(ARG_STR(KEYCTL_RESTRICT_KEYRING), + sizeof(int32_t), 0, NULL, "%d", + sizeof(long_type_str), long_type, NULL, NULL, + sizeof(long_type_str), long_desc, NULL, NULL, + NULL); + buf_in_arg = false; @@ -532,23 +736,23 @@ main(void) sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, 0UL); do_keyctl(ARG_STR(KEYCTL_READ), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 9, NULL, ksize_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_READ), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 256, NULL, ksize_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_READ), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) -4, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) -4, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) -4, NULL, ksize_fmt, + 0UL); nul_terminated_buf = true; @@ -559,33 +763,33 @@ main(void) sizeof(int32_t), 0, NULL, "%d", sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, sizeof(int32_t), 0, NULL, "%d"); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfeedLLU, NULL, ksize_fmt, + (kernel_ulong_t) 0xdeadfeedLLU, NULL, ksize_fmt, sizeof(int32_t), bogus_key1, NULL, "%d"); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), sizeof(int32_t), bogus_key2, NULL, "%d", sizeof(char *), bogus_str, NULL, ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 32LLU, NULL, ksize_fmt, + (kernel_ulong_t) 32LLU, NULL, ksize_fmt, sizeof(int32_t), bogus_key2, NULL, "%d"); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(short_type_str), short_desc, NULL, NULL, sizeof(kernel_ulong_t), - (kernel_ulong_t) sizeof(short_type_str) - 1, NULL, - ksize_fmt, + (kernel_ulong_t) sizeof(short_type_str) - 1, NULL, + ksize_fmt, sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE), - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, sizeof(long_type_str), long_desc, NULL, NULL, sizeof(kernel_ulong_t), - (kernel_ulong_t) sizeof(long_type_str), NULL, ksize_fmt, - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL); + (kernel_ulong_t) sizeof(long_type_str), NULL, ksize_fmt, + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL); buf_in_arg = false; @@ -594,16 +798,20 @@ main(void) do_keyctl(ARG_STR(KEYCTL_NEGATE), sizeof(int32_t), 0, NULL, "%d", sizeof(uint32_t), 0, NULL, "%u", - sizeof(int32_t), 0, NULL, "%d", 0UL); + sizeof(int32_t), 0, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_NEGATE), sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(uint32_t), 3141592653U, NULL, "%u", - sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key1, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_NEGATE), sizeof(int32_t), bogus_key2, NULL, "%d", sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, - sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", + NULL, + sizeof(int32_t), bogus_key2, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_NEGATE), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(kernel_ulong_t), @@ -614,7 +822,7 @@ main(void) /* KEYCTL_SET_REQKEY_KEYRING */ do_keyctl(ARG_STR(KEYCTL_SET_REQKEY_KEYRING), - sizeof(int32_t), ARG_STR(KEY_REQKEY_DEFL_NO_CHANGE), NULL, + sizeof(int32_t), XARG_STR(KEY_REQKEY_DEFL_NO_CHANGE), NULL, 0UL); /* * Keep it commented out until proper way of faking syscalls is not @@ -622,34 +830,44 @@ main(void) */ /* do_keyctl(ARG_STR(KEYCTL_SET_REQKEY_KEYRING), sizeof(int32_t), - ARG_STR(KEY_REQKEY_DEFL_REQUESTOR_KEYRING), NULL, 0UL); */ + XARG_STR(KEY_REQKEY_DEFL_REQUESTOR_KEYRING), NULL, 0UL); */ do_keyctl(ARG_STR(KEYCTL_SET_REQKEY_KEYRING), sizeof(kernel_ulong_t), (kernel_ulong_t) 0xfeedf157badc0dedLLU, - "0xbadc0ded /* KEY_REQKEY_DEFL_??? */", NULL, 0UL); + "-1159983635" +# if !XLAT_RAW + " /* KEY_REQKEY_DEFL_??? */" +# endif + , NULL, 0UL); /* KEYCTL_SET_TIMEOUT */ do_keyctl(ARG_STR(KEYCTL_SET_TIMEOUT), sizeof(int32_t), 0, NULL, "%d", - sizeof(uint32_t), 0, NULL, "%u", 0UL); + sizeof(uint32_t), 0, NULL, "%u", + 0UL); do_keyctl(ARG_STR(KEYCTL_SET_TIMEOUT), sizeof(int32_t), bogus_key1, NULL, "%d", - sizeof(uint32_t), 3141592653U, NULL, "%u", 0UL); + sizeof(uint32_t), 3141592653U, NULL, "%u", + 0UL); do_keyctl(ARG_STR(KEYCTL_SET_TIMEOUT), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", + NULL, 0UL); /* KEYCTL_ASSUME_AUTHORITY */ do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), - sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key1, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), - sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key2, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_ASSUME_AUTHORITY), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, 0UL); @@ -659,28 +877,29 @@ main(void) do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(char *), ARG_STR(NULL), ptr_fmt, - sizeof(uint32_t), 0xbadc0dedU, NULL, "%u", 0UL); + sizeof(uint32_t), 0xbadc0dedU, NULL, "%u", + 0UL); do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, 0UL); do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 9, NULL, ksize_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 256, NULL, ksize_fmt, + 0UL); do_keyctl(ARG_STR(KEYCTL_GET_SECURITY), - sizeof(int32_t), ARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_THREAD_KEYRING), NULL, (size_t) -4, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) -4, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) -4, NULL, ksize_fmt, + 0UL); /* KEYCTL_SESSION_TO_PARENT */ @@ -701,15 +920,18 @@ main(void) do_keyctl(ARG_STR(KEYCTL_REJECT), sizeof(int32_t), bogus_key2, NULL, "%d", sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadca75facef157LLU, "4207866199", NULL, + (kernel_ulong_t) 0xdeadca75facef157LLU, "4207866199", + NULL, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", + NULL, sizeof(int32_t), bogus_key2, NULL, "%d"); do_keyctl(ARG_STR(KEYCTL_REJECT), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", NULL, - sizeof(uint32_t), ARG_STR(ENODEV), NULL, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, "3134983661", + NULL, + sizeof(uint32_t), XARG_STR(ENODEV), NULL, sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); @@ -718,19 +940,19 @@ main(void) sizeof(int32_t), 0, NULL, "%d", sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, sizeof(int32_t), 0, NULL, "%d"); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), sizeof(int32_t), bogus_key1, NULL, "%d", sizeof(char *), (char *) 0xfffffacefffffeedULL, NULL, ptr_fmt, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xdeadfeedLLU, NULL, ksize_fmt, + sizeof(kernel_ulong_t), (kernel_ulong_t) 0xdeadfeedLLU, NULL, + ksize_fmt, sizeof(int32_t), bogus_key1, NULL, "%d"); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), sizeof(int32_t), bogus_key2, NULL, "%d", sizeof(char *), key_iov + IOV_SIZE, NULL, ptr_fmt, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 32LLU, NULL, ksize_fmt, + sizeof(kernel_ulong_t), (kernel_ulong_t) 32LLU, NULL, + ksize_fmt, sizeof(int32_t), bogus_key2, NULL, "%d"); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, @@ -739,20 +961,23 @@ main(void) ksize_fmt, sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL); do_keyctl(ARG_STR(KEYCTL_INSTANTIATE_IOV), - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, sizeof(key_iov), key_iov, key_iov_str2, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) IOV_SIZE, NULL, ksize_fmt, - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL); + sizeof(kernel_ulong_t), (kernel_ulong_t) IOV_SIZE, NULL, + ksize_fmt, + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL); /* KEYCTL_INVALIDATE */ do_keyctl(ARG_STR(KEYCTL_INVALIDATE), - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_INVALIDATE), - sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key1, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_INVALIDATE), - sizeof(int32_t), bogus_key2, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key2, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_INVALIDATE), sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, 0UL); @@ -761,10 +986,12 @@ main(void) /* KEYCTL_GET_PERSISTENT */ do_keyctl(ARG_STR(KEYCTL_GET_PERSISTENT), sizeof(uid_t), ARG_STR(-1), NULL, - sizeof(int32_t), ARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, 0UL); + sizeof(int32_t), XARG_STR(KEY_SPEC_GROUP_KEYRING), NULL, + 0UL); do_keyctl(ARG_STR(KEYCTL_GET_PERSISTENT), sizeof(uid_t), 2718281828U, NULL, "%u", - sizeof(int32_t), bogus_key1, NULL, "%d", 0UL); + sizeof(int32_t), bogus_key1, NULL, "%d", + 0UL); do_keyctl(ARG_STR(KEYCTL_GET_PERSISTENT), sizeof(uid_t), 2718281828U, NULL, "%u", sizeof(kernel_ulong_t), bogus_key3, bogus_key3_str, NULL, @@ -782,29 +1009,86 @@ main(void) sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(char *), ARG_STR(NULL), ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, - 0UL); + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + sizeof(char *), ARG_STR(NULL), ptr_fmt); do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), sizeof(char *), kcdhp + 1, NULL, ptr_fmt, sizeof(char *), (char *) 0xfffff157ffffdeadULL, NULL, ptr_fmt, sizeof(kernel_ulong_t), - (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, - 0UL); + (kernel_ulong_t) 0xfeedf157badc0dedLLU, NULL, ksize_fmt, + sizeof(char *), ARG_STR(NULL), ptr_fmt); do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), sizeof(kcdhp), kcdhp, kcdhp_str, NULL, (size_t) 9, (uintptr_t) bogus_buf1, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 9, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 9, NULL, ksize_fmt, + sizeof(char *), ARG_STR(NULL), ptr_fmt); do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), sizeof(kcdhp), kcdhp, kcdhp_str, NULL, (size_t) 256, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) 256, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) 256, NULL, ksize_fmt, + sizeof(char *), ARG_STR(NULL), ptr_fmt); do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), sizeof(kcdhp), kcdhp, kcdhp_str, NULL, (size_t) -1, (uintptr_t) bogus_buf2, NULL, NULL, - sizeof(kernel_ulong_t), - (kernel_ulong_t) -1, NULL, ksize_fmt, 0UL); + sizeof(kernel_ulong_t), (kernel_ulong_t) -1, NULL, ksize_fmt, + sizeof(char *), kckdfp_char + 1, NULL, ptr_fmt); + + /* KEYCTL_DH_COMPUTE + KDF */ + + for (i = 0; i < ARRAY_SIZE(kckdfp_data); i++) { + struct keyctl_kdf_params *kckdfp = + (struct keyctl_kdf_params *) kckdfp_char; + bool deref_hash = true; + bool deref_opts = true; + bool print_spare = false; + const char *hash_str = NULL; + const char *oi_str = NULL; + + memcpy(kckdfp, kckdfp_data + i, sizeof(kckdfp_data[i])); + + switch (i) { + case 1: + deref_hash = false; + print_spare = true; + kckdfp->hashname = + kckdfp_short_hash + sizeof(short_hash_data); + break; + case 2: + deref_opts = false; + kckdfp->hashname = kckdfp_long_hash; + kckdfp->otherinfo = + kckdfp_otherinfo1 + sizeof(otherinfo1_data); + break; + case 3: + deref_opts = false; + deref_hash = false; + print_spare = true; + kckdfp->hashname = bogus_str; + kckdfp->otherinfo = kckdfp_otherinfo1; + break; + case 4: + oi_str = "\"\\1\\2 OH HAI \"..."; + print_spare = true; + kckdfp->hashname = kckdfp_short_hash; + kckdfp->otherinfo = kckdfp_otherinfo1; + break; + case 5: + oi_str = "\"\\1\\2\\n\\255\\0\\1\\0\""; + kckdfp->hashname = kckdfp_short_hash; + kckdfp->otherinfo = kckdfp_otherinfo2; + break; + } + + do_keyctl(ARG_STR(KEYCTL_DH_COMPUTE), + sizeof(kcdhp), kcdhp, kcdhp_str, NULL, + (size_t) -1, (uintptr_t) bogus_buf2, NULL, NULL, + sizeof(kernel_ulong_t), (kernel_ulong_t) -1, NULL, + ksize_fmt, + sizeof(kckdfp), kckdfp_char, + kckdfp_to_str(kckdfp, deref_hash, deref_opts, + print_spare, hash_str, oi_str), + NULL); + } nul_terminated_buf = true; diff --git a/tests/keyctl.gen.test b/tests/keyctl.gen.test new file mode 100755 index 00000000..82afad99 --- /dev/null +++ b/tests/keyctl.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (keyctl -a31 -s10); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 -s10 diff --git a/tests/keyctl.test b/tests/keyctl.test deleted file mode 100755 index 875a82d3..00000000 --- a/tests/keyctl.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of keyctl syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a31 -s10 diff --git a/tests/kill.c b/tests/kill.c index cb884aa1..4ef9b628 100644 --- a/tests/kill.c +++ b/tests/kill.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Fei Jie + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -66,7 +47,7 @@ main(void) (int) big_pid, (int) big_sig, rc, errno2name()); rc = syscall(__NR_kill, (long) 0xdefaced00000000ULL | pid, 0); - printf("kill(%d, SIG_0) = %ld\n", pid, rc); + printf("kill(%d, 0) = %ld\n", pid, rc); puts("+++ exited with 0 +++"); return 0; diff --git a/tests/kill.gen.test b/tests/kill.gen.test new file mode 100755 index 00000000..08a004e9 --- /dev/null +++ b/tests/kill.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (kill -a12 -esignal=none); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 -esignal=none diff --git a/tests/kill.test b/tests/kill.test deleted file mode 100755 index 7a3a51aa..00000000 --- a/tests/kill.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of kill syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a12 -esignal=none diff --git a/tests/kill_child.c b/tests/kill_child.c new file mode 100644 index 00000000..55b83aba --- /dev/null +++ b/tests/kill_child.c @@ -0,0 +1,69 @@ +/* + * Check for the corner case that previously lead to segfault + * due to an attempt to access unitialised tcp->s_ent. + * + * 13994 ????( + * ... + * 13994 <... ???? resumed>) = ? + * + * Copyright (c) 2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +#define ITERS 10000 +#define SC_ITERS 10000 + +int +main(void) +{ + volatile sig_atomic_t *const mem = + mmap(NULL, get_page_size(), PROT_READ | PROT_WRITE, + MAP_SHARED | MAP_ANONYMOUS, -1, 0); + if (mem == MAP_FAILED) + perror_msg_and_fail("mmap"); + + for (unsigned int i = 0; i < ITERS; ++i) { + mem[0] = mem[1] = 0; + + const pid_t pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + /* wait for the parent */ + while (!mem[0]) + ; + /* let the parent know we are running */ + mem[1] = 1; + + for (unsigned int j = 0; j < SC_ITERS; j++) + sched_yield(); + + pause(); + return 0; + } + + /* let the child know we are running */ + mem[0] = 1; + /* wait for the child */ + while (!mem[1]) + ; + + if (kill(pid, SIGKILL)) + perror_msg_and_fail("kill"); + if (wait(NULL) != pid) + perror_msg_and_fail("wait"); + } + + return 0; +} diff --git a/tests/kill_child.test b/tests/kill_child.test new file mode 100755 index 00000000..312592bd --- /dev/null +++ b/tests/kill_child.test @@ -0,0 +1,31 @@ +#!/bin/sh +# +# Check whether repeated killing of just forked processes crashes strace. +# +# Copyright (c) 2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog_skip_if_failed date +%s > /dev/null +s0="$(date +%s)" + +run_prog +args="-f -qq -e signal=none -e trace=sched_yield,/kill $args" + +# Run strace until the known corner case is observed. +while :; do + run_strace $args + + # Printing of "<... SYSCALL resumed>" in strace.c:print_event_exit + # used to segfault when the syscall number had not been obtained + # on syscall entering. + grep -q '^[1-9][0-9]* <\.\.\. ???? resumed>) \+= ?$' "$LOG" && exit 0 + + s1="$(date +%s)" + if [ "$(($s1-$s0))" -gt "$(($TIMEOUT_DURATION/2))" ]; then + skip_ 'Unable to reproduce <... ???? resumed>' + fi +done diff --git a/tests/ksysent.c b/tests/ksysent.c index 8cac93ca..4319bdb2 100644 --- a/tests/ksysent.c +++ b/tests/ksysent.c @@ -2,29 +2,10 @@ * Validate syscallent.h file. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -33,24 +14,14 @@ #include #include -#define TD 0 -#define TF 0 -#define TI 0 -#define TN 0 -#define TP 0 -#define TS 0 -#define TM 0 -#define NF 0 -#define MA 0 -#define SI 0 -#define SE 0 -#define CST 0 -#define SEN(arg) 0,0 +#include "sysent_shorthand_defs.h" static const struct_sysent syscallent[] = { #include "syscallent.h" }; +#include "sysent_shorthand_undefs.h" + typedef const char *pstr_t; static const pstr_t ksyslist[] = { #include "ksysent.h" diff --git a/tests/ksysent.sed b/tests/ksysent.sed index 63ded4a9..c35ba22f 100644 --- a/tests/ksysent.sed +++ b/tests/ksysent.sed @@ -1,9 +1,14 @@ #!/bin/sed -rnf +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later # should not have been exported at all -/#define[[:space:]]+__NR_(sys_epoll_|arch_specific_syscall|syscalls|syscall_count|syscall_max|available|reserved|unused)/d +/#define[[:space:]]+__NR_(sys_epoll_|arch_specific_syscall|arm_sync_file_range|syscalls|syscall_count|syscall_max|available|reserved|unused)/d -# should not have been named this way +# should not have been named this way s/__NR_(arm|xtensa)_fadvise64_64/__NR_fadvise64_64/ # legacy names diff --git a/tests/ksysent.test b/tests/ksysent.test index 80266488..347ed675 100755 --- a/tests/ksysent.test +++ b/tests/ksysent.test @@ -1,4 +1,9 @@ #!/bin/sh +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later # Validate syscallent.h diff --git a/tests/lchown.c b/tests/lchown.c index a07c878c..c9008219 100644 --- a/tests/lchown.c +++ b/tests/lchown.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/lchown.gen.test b/tests/lchown.gen.test new file mode 100755 index 00000000..d346c76d --- /dev/null +++ b/tests/lchown.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (lchown -a30 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 diff --git a/tests/lchown.test b/tests/lchown.test deleted file mode 100755 index ceeaa859..00000000 --- a/tests/lchown.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check lchown syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a30 diff --git a/tests/lchown32.c b/tests/lchown32.c index 29cb01db..1a505e1f 100644 --- a/tests/lchown32.c +++ b/tests/lchown32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/lchown32.gen.test b/tests/lchown32.gen.test new file mode 100755 index 00000000..5da2349c --- /dev/null +++ b/tests/lchown32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (lchown32 -a32 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 diff --git a/tests/lchown32.test b/tests/lchown32.test deleted file mode 100755 index 6ee1ac95..00000000 --- a/tests/lchown32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check lchown32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a32 diff --git a/tests/libmmsg.c b/tests/libmmsg.c index b0db26d2..0f23597d 100644 --- a/tests/libmmsg.c +++ b/tests/libmmsg.c @@ -1,30 +1,10 @@ /* * Wrappers for recvmmsg and sendmmsg syscalls. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/libsocketcall.c b/tests/libsocketcall.c index 04d6710f..34f65478 100644 --- a/tests/libsocketcall.c +++ b/tests/libsocketcall.c @@ -1,30 +1,10 @@ /* * Invoke a socket syscall, either directly or via __NR_socketcall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -43,7 +23,7 @@ socketcall(const int nr, const int call, int rc = -1; errno = ENOSYS; -# ifdef __NR_socketcall +#ifdef __NR_socketcall static int have_socketcall = -1; if (have_socketcall < 0) { @@ -59,7 +39,7 @@ socketcall(const int nr, const int call, const long args[] = { a1, a2, a3, a4, a5 }; rc = syscall(__NR_socketcall, call, args); } else -# endif +#endif { if (nr != -1) rc = syscall(nr, a1, a2, a3, a4, a5); diff --git a/tests/link.c b/tests/link.c index d6550fd3..357eb0be 100644 --- a/tests/link.c +++ b/tests/link.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/link.gen.test b/tests/link.gen.test new file mode 100755 index 00000000..2ec3f5b8 --- /dev/null +++ b/tests/link.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (link ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/link.test b/tests/link.test deleted file mode 100755 index cfa2b0cc..00000000 --- a/tests/link.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check link syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/linkat.c b/tests/linkat.c index 64b900ea..748ddf18 100644 --- a/tests/linkat.c +++ b/tests/linkat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/linkat.gen.test b/tests/linkat.gen.test new file mode 100755 index 00000000..8bdf78b4 --- /dev/null +++ b/tests/linkat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (linkat ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/linkat.test b/tests/linkat.test deleted file mode 100755 index 5627de7f..00000000 --- a/tests/linkat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check linkat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/list_sigaction_signum.c b/tests/list_sigaction_signum.c new file mode 100644 index 00000000..bf495406 --- /dev/null +++ b/tests/list_sigaction_signum.c @@ -0,0 +1,37 @@ +/* + * List signal numbers that are valid arguments for sigaction syscall. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include + +int +main(void) +{ + unsigned int i; + + for (i = 1; i < 32; ++i) { + static const struct sigaction ign = { .sa_handler = SIG_IGN }; + static const struct sigaction dfl = { .sa_handler = SIG_DFL }; + struct sigaction act; + + if (sigaction(i, &ign, NULL) || + sigaction(i, NULL, &act) || + ign.sa_handler != act.sa_handler || + sigaction(i, &dfl, NULL) || + sigaction(i, NULL, &act) || + dfl.sa_handler != act.sa_handler) + continue; + + printf("%u\n", i); + } + + return 0; +} diff --git a/tests/llseek.c b/tests/llseek.c index e687e947..169fa913 100644 --- a/tests/llseek.c +++ b/tests/llseek.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/llseek.test b/tests/llseek.test index cf1607ed..a2858398 100755 --- a/tests/llseek.test +++ b/tests/llseek.test @@ -1,15 +1,16 @@ #!/bin/sh - +# # Check _llseek syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" check_prog grep run_prog > /dev/null run_strace -e_llseek $args > "$EXP" -grep -v '^lseek([0-9]' < "$LOG" > "$OUT" +grep -v '^_llseek([0-9]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" - -exit 0 diff --git a/tests/localtime.c b/tests/localtime.c new file mode 100644 index 00000000..652d3e6a --- /dev/null +++ b/tests/localtime.c @@ -0,0 +1,37 @@ +/* + * Check handling of localtime() returning NULL in printleader(). + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include + +#include + +int +main(void) +{ + struct timespec ts; + int pid; + + assert(!clock_gettime(CLOCK_REALTIME, &ts)); + + pid = syscall(__NR_gettid); + + /* We expect localtime to fail here */ + printf("%lld.%06ld gettid() = %d\n", + (long long) ts.tv_sec, (long) (ts.tv_nsec / 1000), pid); + + printf("%lld.%06ld +++ exited with 0 +++\n", + (long long) ts.tv_sec, (long) (ts.tv_nsec / 1000)); + + return 0; +} diff --git a/tests/localtime.test b/tests/localtime.test new file mode 100755 index 00000000..e2ce1325 --- /dev/null +++ b/tests/localtime.test @@ -0,0 +1,18 @@ +#!/bin/sh +# +# Check handling of localtime() failure in printleader(). +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +check_prog faketime +faketime -f +1000000000000000000x0 ../$NAME | grep -q '^100000000' \ + || framework_skip_ 'faketime failed to fake time' + +STRACE="faketime -f +1000000000000000000x0 $STRACE" + +run_strace_match_diff -tt -a10 -e trace=gettid diff --git a/tests/lookup_dcookie.c b/tests/lookup_dcookie.c index 986180ce..430ae135 100644 --- a/tests/lookup_dcookie.c +++ b/tests/lookup_dcookie.c @@ -2,29 +2,10 @@ * Check decoding of lookup_dcookie syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/lookup_dcookie.gen.test b/tests/lookup_dcookie.gen.test new file mode 100755 index 00000000..616c7057 --- /dev/null +++ b/tests/lookup_dcookie.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (lookup_dcookie -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests/lookup_dcookie.test b/tests/lookup_dcookie.test deleted file mode 100755 index 47e1c2d6..00000000 --- a/tests/lookup_dcookie.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of lookup_cookie syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests/looping_threads.c b/tests/looping_threads.c new file mode 100644 index 00000000..2f5e9550 --- /dev/null +++ b/tests/looping_threads.c @@ -0,0 +1,121 @@ +/* + * Check tracing of looping threads. + * + * Copyright (c) 2009-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include + +static void * +thread(void *arg) +{ + for (;;) + getuid(); + return arg; +} + +int +main(int ac, const char *av[]) +{ + assert(ac == 3); + + int timeout = atoi(av[1]); + assert(timeout > 0); + + int num_threads = atoi(av[2]); + assert(num_threads > 0); + + /* + * Unblock all signals. + */ + static sigset_t mask; + if (sigprocmask(SIG_SETMASK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + /* + * Reset SIGALRM and SIGHUP signal handlers. + */ + static const struct sigaction sa_def = { .sa_handler = SIG_DFL }; + if (sigaction(SIGHUP, &sa_def, NULL)) + perror_msg_and_fail("sigaction SIGHUP"); + if (sigaction(SIGALRM, &sa_def, NULL)) + perror_msg_and_fail("sigaction SIGALRM"); + + /* + * Create a new process group. + */ + if (setpgid(0, 0)) + perror_msg_and_fail("setpgid"); + + /* + * Set an alarm clock. + */ + alarm(timeout); + + /* + * When the main process terminates, the process group becomes orphaned. + * If any member of the orphaned process group is stopped, then + * a SIGHUP signal followed by a SIGCONT signal is sent to each process + * in the orphaned process group. + * Create a process in a stopped state to activate this behaviour. + */ + const pid_t stopped = fork(); + if (stopped < 0) + perror_msg_and_fail("fork"); + if (!stopped) { + raise(SIGSTOP); + _exit(0); + } + + /* + * Wait for the process to stop. + */ + int status; + if (waitpid(stopped, &status, WUNTRACED) != stopped) + perror_msg_and_fail("waitpid WUNTRACED"); + if (!WIFSTOPPED(status) || WSTOPSIG(status) != SIGSTOP) + error_msg_and_fail("waitpid WUNTRACED: " + "unexpected wait status %d", status); + /* + * Create all threads in a subprocess, this guarantees that + * their tracer will not be their parent. + */ + pid_t pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + if (!pid) { + for (int i = 0; i < num_threads; i++) { + pthread_t t; + if ((errno = pthread_create(&t, NULL, thread, NULL))) { + if (EAGAIN == errno) + break; + perror_msg_and_fail("pthread_create #%d", i); + } + } + + /* This terminates all threads created above. */ + _exit(0); + } + + if (waitpid(pid, &status, 0) != pid) + perror_msg_and_fail("waitpid"); + if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) + error_msg_and_fail("waitpid: unexpected wait status %d", + status); + + /* + * Make the process group orphaned. + */ + return 0; +} diff --git a/tests/looping_threads.test b/tests/looping_threads.test new file mode 100755 index 00000000..e8b0bbb5 --- /dev/null +++ b/tests/looping_threads.test @@ -0,0 +1,38 @@ +#!/bin/sh +# +# Check tracing of looping threads. +# +# Copyright (c) 2009-2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" +. "${srcdir=.}/PTRACE_SEIZE.sh" + +run_prog ../orphaned_process_group > /dev/null + +run_prog_skip_if_failed date +%s > /dev/null +s0="$(date +%s)" + +check_prog nproc +inc="$(nproc)" +[ "$inc" -ge 1 ] || inc=1 + +timeout_2="$(($TIMEOUT_DURATION/2))" +timeout_8="$(($TIMEOUT_DURATION/8))" +nproc=1 + +run_prog "../$NAME" "$timeout_8" "$nproc" + +while :; do + run_strace -f -qq -enone -esignal=none "../$NAME" "$timeout_2" "$nproc" + + s1="$(date +%s)" + [ "$(($s1-$s0))" -lt "$timeout_8" ] || + break + + nproc="$(($nproc+$inc))" +done + +warn_ "$ME_: nproc=$nproc elapsed=$(($s1-$s0))" diff --git a/tests/lseek.c b/tests/lseek.c index 4428c4e9..0e12bf9c 100644 --- a/tests/lseek.c +++ b/tests/lseek.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/lseek.test b/tests/lseek.test index f96a91d1..646f7313 100755 --- a/tests/lseek.test +++ b/tests/lseek.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check lseek syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -9,7 +14,3 @@ run_prog > /dev/null run_strace -a30 -elseek $args > "$EXP" grep -v '^lseek([0-9]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" - -exit 0 diff --git a/tests/lstat.c b/tests/lstat.c index 3754f766..1a200fe7 100644 --- a/tests/lstat.c +++ b/tests/lstat.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/lstat.gen.test b/tests/lstat.gen.test new file mode 100755 index 00000000..7231c491 --- /dev/null +++ b/tests/lstat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (lstat -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests/lstat.test b/tests/lstat.test deleted file mode 100755 index f513bb48..00000000 --- a/tests/lstat.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check lstat syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests/lstat64.c b/tests/lstat64.c index da06609d..0c0cf879 100644 --- a/tests/lstat64.c +++ b/tests/lstat64.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/lstat64.gen.test b/tests/lstat64.gen.test new file mode 100755 index 00000000..124cce4b --- /dev/null +++ b/tests/lstat64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (lstat64 -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests/lstat64.test b/tests/lstat64.test deleted file mode 100755 index fcafe79d..00000000 --- a/tests/lstat64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check lstat64 syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests/lstatx.c b/tests/lstatx.c index cdd1124b..b49c4055 100644 --- a/tests/lstatx.c +++ b/tests/lstatx.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #define TEST_SYSCALL_INVOKE(sample, pst) \ diff --git a/tests/madvise.c b/tests/madvise.c new file mode 100644 index 00000000..33a7abbe --- /dev/null +++ b/tests/madvise.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include + +static const char *errstr; + +static long +k_madvise(const kernel_ulong_t addr, + const kernel_ulong_t length, + const kernel_ulong_t advice) +{ + long rc = syscall(__NR_madvise, addr, length, advice); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + const unsigned long length = get_page_size(); + void *const addr = tail_alloc(length); + long rc; + + rc = madvise(addr, length, MADV_NORMAL); + printf("madvise(%p, %lu, MADV_NORMAL) = %s\n", + addr, length, sprintrc(rc)); + + static const kernel_ulong_t advice = + (kernel_ulong_t) 0xfacefeed00000000ULL | MADV_RANDOM; + rc = k_madvise((uintptr_t) addr, length, advice); + printf("madvise(%p, %lu, MADV_RANDOM) = %s\n", + addr, length, sprintrc(rc)); + + static const kernel_ulong_t bogus_length = + (kernel_ulong_t) 0xfffffffffffffaceULL; + rc = k_madvise(0, bogus_length, MADV_SEQUENTIAL); + printf("madvise(NULL, %llu, MADV_SEQUENTIAL) = %s\n", + (unsigned long long) bogus_length, sprintrc(rc)); + + if (F8ILL_KULONG_SUPPORTED) { + rc = k_madvise(f8ill_ptr_to_kulong(addr), length, MADV_NORMAL); + printf("madvise(%#llx, %lu, MADV_NORMAL) = %s\n", + (unsigned long long) f8ill_ptr_to_kulong(addr), + length, sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/madvise.gen.test b/tests/madvise.gen.test new file mode 100755 index 00000000..a549cf94 --- /dev/null +++ b/tests/madvise.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (madvise -a33 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 diff --git a/tests/match.awk b/tests/match.awk index abfbae92..d91c5182 100644 --- a/tests/match.awk +++ b/tests/match.awk @@ -1,29 +1,9 @@ #!/bin/gawk # -# Copyright (c) 2014-2015 Dmitry V. Levin +# Copyright (c) 2014-2018 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later # s[] is array of match strings # r[] is array of match patterns diff --git a/tests/mbind.c b/tests/mbind.c index b0544263..8e478a6f 100644 --- a/tests/mbind.c +++ b/tests/mbind.c @@ -1,30 +1,10 @@ /* * Check decoding of mbind syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/mbind.gen.test b/tests/mbind.gen.test new file mode 100755 index 00000000..c47e0fc1 --- /dev/null +++ b/tests/mbind.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mbind ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/mbind.test b/tests/mbind.test deleted file mode 100755 index 2a07cac6..00000000 --- a/tests/mbind.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of mbind syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/membarrier.c b/tests/membarrier.c index 330893b6..0e55497b 100644 --- a/tests/membarrier.c +++ b/tests/membarrier.c @@ -1,28 +1,9 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -44,10 +25,49 @@ main(void) printf("membarrier(0x3 /* MEMBARRIER_CMD_??? */, 255) = %s\n", sprintrc(-1)); if (saved_errno != ENOSYS) { - /* the test needs to be updated? */ - assert(syscall(__NR_membarrier, 0, 0) == 1); - puts("membarrier(MEMBARRIER_CMD_QUERY, 0)" - " = 0x1 (MEMBARRIER_CMD_SHARED)"); + const char *text_global; + const char *text; + int rc = syscall(__NR_membarrier, 0, 0); + + assert(rc >= 0); + + text_global = rc & 1 ? "MEMBARRIER_CMD_GLOBAL" : ""; + + switch (rc & ~1) { + case 0: + text = ""; + break; + case 8: + text = "MEMBARRIER_CMD_PRIVATE_EXPEDITED"; + break; + case 8|16: + text = "MEMBARRIER_CMD_PRIVATE_EXPEDITED|" + "MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED"; + break; + + case 2|4|8|16: + text = "MEMBARRIER_CMD_GLOBAL_EXPEDITED|" + "MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED|" + "MEMBARRIER_CMD_PRIVATE_EXPEDITED|" + "MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED"; + break; + + case 2|4|8|16|32|64: + text = "MEMBARRIER_CMD_GLOBAL_EXPEDITED|" + "MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED|" + "MEMBARRIER_CMD_PRIVATE_EXPEDITED|" + "MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED|" + "MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE|" + "MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE"; + break; + + default: + error_msg_and_fail("membarrier returned %#x, does" + " the test have to be updated?", rc); + } + printf("membarrier(MEMBARRIER_CMD_QUERY, 0) = %#x (%s%s%s)\n", + rc, text_global, text[0] && text_global[0] ? "|" : "", + text); } puts("+++ exited with 0 +++"); return 0; diff --git a/tests/membarrier.gen.test b/tests/membarrier.gen.test new file mode 100755 index 00000000..6ae6e915 --- /dev/null +++ b/tests/membarrier.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (membarrier -a36 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests/membarrier.test b/tests/membarrier.test deleted file mode 100755 index ad1f713b..00000000 --- a/tests/membarrier.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check membarrier syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a36 diff --git a/tests/memfd_create-Xabbrev.c b/tests/memfd_create-Xabbrev.c new file mode 100644 index 00000000..f738c743 --- /dev/null +++ b/tests/memfd_create-Xabbrev.c @@ -0,0 +1 @@ +#include "memfd_create.c" diff --git a/tests/memfd_create-Xabbrev.gen.test b/tests/memfd_create-Xabbrev.gen.test new file mode 100755 index 00000000..32f3e23e --- /dev/null +++ b/tests/memfd_create-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (memfd_create-Xabbrev -Xabbrev -e trace=memfd_create); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xabbrev -e trace=memfd_create diff --git a/tests/memfd_create-Xraw.c b/tests/memfd_create-Xraw.c new file mode 100644 index 00000000..0673d2d0 --- /dev/null +++ b/tests/memfd_create-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "memfd_create.c" diff --git a/tests/memfd_create-Xraw.gen.test b/tests/memfd_create-Xraw.gen.test new file mode 100755 index 00000000..97bd6029 --- /dev/null +++ b/tests/memfd_create-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (memfd_create-Xraw -a30 -Xraw -e trace=memfd_create); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 -Xraw -e trace=memfd_create diff --git a/tests/memfd_create-Xverbose.c b/tests/memfd_create-Xverbose.c new file mode 100644 index 00000000..4c428c48 --- /dev/null +++ b/tests/memfd_create-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "memfd_create.c" diff --git a/tests/memfd_create-Xverbose.gen.test b/tests/memfd_create-Xverbose.gen.test new file mode 100755 index 00000000..c3c6846e --- /dev/null +++ b/tests/memfd_create-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (memfd_create-Xverbose -Xverbose -e trace=memfd_create); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xverbose -e trace=memfd_create diff --git a/tests/memfd_create.c b/tests/memfd_create.c index 480fd177..2658a1ba 100644 --- a/tests/memfd_create.c +++ b/tests/memfd_create.c @@ -1,3 +1,12 @@ +/* + * Check decoding of memfd_create syscall. + * + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include "scno.h" @@ -5,16 +14,95 @@ #ifdef __NR_memfd_create # include +# include # include +# ifdef HAVE_LINUX_MEMFD_H +# include +# endif + +# ifndef MFD_HUGE_SHIFT +# define MFD_HUGE_SHIFT 26 +# endif + +# ifndef MFD_HUGE_MASK +# define MFD_HUGE_MASK 0x3f +# endif + +static const char *errstr; + +static long +k_memfd_create(const kernel_ulong_t name, const kernel_ulong_t flags) +{ + const long rc = syscall(__NR_memfd_create, name, flags); + errstr = sprintrc(rc); + return rc; +} + int main(void) { - static const char text[] = "strace"; - int rc = syscall(__NR_memfd_create, text, 7); + const size_t size = 255 - (sizeof("memfd:") - 1) + 1; + char *pattern = tail_alloc(size); + fill_memory_ex(pattern, size, '0', 10); + + k_memfd_create((uintptr_t) pattern, 0); + printf("memfd_create(\"%.*s\"..., 0) = %s\n", + (int) size - 1, pattern, errstr); + + kernel_ulong_t flags = (kernel_ulong_t) 0xfacefeed00000007ULL; +# define flags1_str "MFD_CLOEXEC|MFD_ALLOW_SEALING|MFD_HUGETLB" + + k_memfd_create((uintptr_t) pattern, flags); +# if XLAT_VERBOSE + printf("memfd_create(\"%.*s\"..., %s /* %s */) = %s\n", + (int) size - 1, pattern, + "0x7", flags1_str, errstr); +# else + printf("memfd_create(\"%.*s\"..., %s) = %s\n", + (int) size - 1, pattern, +# if XLAT_RAW + "0x7", +# else + flags1_str, +# endif + errstr); +# endif + + pattern[size - 1] = '\0'; + flags = 30 << MFD_HUGE_SHIFT; + k_memfd_create((uintptr_t) pattern, flags); +# if XLAT_RAW + printf("memfd_create(\"%s\", %#x) = %s\n", + pattern, (unsigned int) flags, errstr); +# elif XLAT_VERBOSE + printf("memfd_create(\"%s\", %#x /* %s */) = %s\n", + pattern, (unsigned int) flags, "30< + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/migrate_pages.gen.test b/tests/migrate_pages.gen.test new file mode 100755 index 00000000..0ea017d0 --- /dev/null +++ b/tests/migrate_pages.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (migrate_pages -a33 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 diff --git a/tests/migrate_pages.test b/tests/migrate_pages.test deleted file mode 100755 index fad53b79..00000000 --- a/tests/migrate_pages.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check migrate_pages syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a33 diff --git a/tests/mincore.c b/tests/mincore.c index ea2b49e3..01619b05 100644 --- a/tests/mincore.c +++ b/tests/mincore.c @@ -1,36 +1,15 @@ /* * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include #include -#define DEFAULT_STRLEN 32 - static void print_mincore(const unsigned int pages, void *const addr, const size_t size, unsigned char *const vec) diff --git a/tests/mincore.gen.test b/tests/mincore.gen.test new file mode 100755 index 00000000..45e43e25 --- /dev/null +++ b/tests/mincore.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mincore -a22 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests/mincore.test b/tests/mincore.test deleted file mode 100755 index 6af9f492..00000000 --- a/tests/mincore.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mincore syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a22 diff --git a/tests/mkdir.c b/tests/mkdir.c index d971b188..e6e62ef6 100644 --- a/tests/mkdir.c +++ b/tests/mkdir.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/mkdir.gen.test b/tests/mkdir.gen.test new file mode 100755 index 00000000..8d34c8b2 --- /dev/null +++ b/tests/mkdir.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mkdir -a20 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests/mkdir.test b/tests/mkdir.test deleted file mode 100755 index 38ed6928..00000000 --- a/tests/mkdir.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mkdir syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 diff --git a/tests/mkdirat.c b/tests/mkdirat.c index 6bfe4a5f..91bf06be 100644 --- a/tests/mkdirat.c +++ b/tests/mkdirat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/mkdirat.gen.test b/tests/mkdirat.gen.test new file mode 100755 index 00000000..eef8e526 --- /dev/null +++ b/tests/mkdirat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mkdirat -a28 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests/mkdirat.test b/tests/mkdirat.test deleted file mode 100755 index 0fcb841a..00000000 --- a/tests/mkdirat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mkdirat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 diff --git a/tests/mknod.c b/tests/mknod.c index 4cc1c5cb..94d80284 100644 --- a/tests/mknod.c +++ b/tests/mknod.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -8,7 +15,7 @@ # include # include -static const char sample[] = "mknod"; +static const char *sample; static long call_mknod(unsigned short mode, unsigned long dev) @@ -18,9 +25,10 @@ call_mknod(unsigned short mode, unsigned long dev) } int -main(void) +main(int ac, char **av) { unsigned long dev = (unsigned long) 0xdeadbeefbadc0dedULL; + sample = av[0]; long rc = call_mknod(0, dev); printf("mknod(\"%s\", 000) = %ld %s (%m)\n", @@ -49,7 +57,7 @@ main(void) dev = (unsigned long) 0xdeadbeef00000000ULL | makedev(1, 7); rc = call_mknod(S_IFCHR | 024, dev); - printf("mknod(\"%s\", S_IFCHR|024, makedev(1, 7)) = %ld %s (%m)\n", + printf("mknod(\"%s\", S_IFCHR|024, makedev(0x1, 0x7)) = %ld %s (%m)\n", sample, rc, errno2name()); const unsigned short mode = (0xffff & ~S_IFMT) | S_IFBLK; @@ -57,8 +65,8 @@ main(void) rc = call_mknod(mode, dev); printf("mknod(\"%s\", S_IFBLK|S_ISUID|S_ISGID|S_ISVTX|%#03ho" - ", makedev(%u, %u)) = %ld %s (%m)\n", - sample, mode & ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX), + ", makedev(%#x, %#x)) = %ld %s (%m)\n", + sample, (short) (mode & ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX)), major((unsigned) dev), minor((unsigned) dev), rc, errno2name()); diff --git a/tests/mknod.gen.test b/tests/mknod.gen.test new file mode 100755 index 00000000..ce08e99f --- /dev/null +++ b/tests/mknod.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mknod -a18 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 diff --git a/tests/mknod.test b/tests/mknod.test deleted file mode 100755 index 195f1e33..00000000 --- a/tests/mknod.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mknod syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a18 diff --git a/tests/mknodat.c b/tests/mknodat.c index 756e2771..34b34d80 100644 --- a/tests/mknodat.c +++ b/tests/mknodat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -50,7 +57,7 @@ main(void) dev = (unsigned long) 0xdeadbeef00000000ULL | makedev(1, 7); rc = call_mknodat(S_IFCHR | 024, dev); - printf("mknodat(-1, \"%s\", S_IFCHR|024, makedev(1, 7)) = %ld %s (%m)\n", + printf("mknodat(-1, \"%s\", S_IFCHR|024, makedev(0x1, 0x7)) = %ld %s (%m)\n", sample, rc, errno2name()); const unsigned short mode = (0xffff & ~S_IFMT) | S_IFBLK; @@ -58,8 +65,8 @@ main(void) rc = call_mknodat(mode, dev); printf("mknodat(-1, \"%s\", S_IFBLK|S_ISUID|S_ISGID|S_ISVTX|%#03ho" - ", makedev(%u, %u)) = %ld %s (%m)\n", - sample, mode & ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX), + ", makedev(%#x, %#x)) = %ld %s (%m)\n", + sample, (short) (mode & ~(S_IFMT|S_ISUID|S_ISGID|S_ISVTX)), major((unsigned) dev), minor((unsigned) dev), rc, errno2name()); diff --git a/tests/mknodat.gen.test b/tests/mknodat.gen.test new file mode 100755 index 00000000..dce7d449 --- /dev/null +++ b/tests/mknodat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mknodat -a35 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests/mknodat.test b/tests/mknodat.test deleted file mode 100755 index 1701a368..00000000 --- a/tests/mknodat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mknodat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a35 diff --git a/tests/mlock.c b/tests/mlock.c index 8e9806bd..0f31d20c 100644 --- a/tests/mlock.c +++ b/tests/mlock.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/mlock.gen.test b/tests/mlock.gen.test new file mode 100755 index 00000000..2c8ea5e1 --- /dev/null +++ b/tests/mlock.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mlock -a20 -e trace=mlock,munlock); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -e trace=mlock,munlock diff --git a/tests/mlock.test b/tests/mlock.test deleted file mode 100755 index 9a73a306..00000000 --- a/tests/mlock.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mlock and munlock syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=mlock,munlock -a20 diff --git a/tests/mlock2.c b/tests/mlock2.c index 71a2003e..23f1cd9a 100644 --- a/tests/mlock2.c +++ b/tests/mlock2.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/mlock2.gen.test b/tests/mlock2.gen.test new file mode 100755 index 00000000..ff94eb89 --- /dev/null +++ b/tests/mlock2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mlock2 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/mlock2.test b/tests/mlock2.test deleted file mode 100755 index bc412e97..00000000 --- a/tests/mlock2.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mlock2 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/mlockall.c b/tests/mlockall.c index 682d070d..20428ce7 100644 --- a/tests/mlockall.c +++ b/tests/mlockall.c @@ -1,30 +1,10 @@ /* * Check decoding of mlockall syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/mlockall.gen.test b/tests/mlockall.gen.test new file mode 100755 index 00000000..59ef67f8 --- /dev/null +++ b/tests/mlockall.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mlockall -a12 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests/mlockall.test b/tests/mlockall.test deleted file mode 100755 index d7a6182d..00000000 --- a/tests/mlockall.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of mlockall syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a12 diff --git a/tests/mmap-Xabbrev.c b/tests/mmap-Xabbrev.c new file mode 100644 index 00000000..b31ce427 --- /dev/null +++ b/tests/mmap-Xabbrev.c @@ -0,0 +1 @@ +#include "mmap.c" diff --git a/tests/mmap-Xabbrev.gen.test b/tests/mmap-Xabbrev.gen.test new file mode 100755 index 00000000..b11a84ff --- /dev/null +++ b/tests/mmap-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmap-Xabbrev +mmap.test abbrev); do not edit. +set -- abbrev +. "${srcdir=.}/mmap.test" diff --git a/tests/mmap-Xraw.c b/tests/mmap-Xraw.c new file mode 100644 index 00000000..ef25c030 --- /dev/null +++ b/tests/mmap-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "mmap.c" diff --git a/tests/mmap-Xraw.gen.test b/tests/mmap-Xraw.gen.test new file mode 100755 index 00000000..3caca91d --- /dev/null +++ b/tests/mmap-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmap-Xraw +mmap.test raw 14); do not edit. +set -- raw 14 +. "${srcdir=.}/mmap.test" diff --git a/tests/mmap-Xverbose.c b/tests/mmap-Xverbose.c new file mode 100644 index 00000000..08e9e305 --- /dev/null +++ b/tests/mmap-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "mmap.c" diff --git a/tests/mmap-Xverbose.gen.test b/tests/mmap-Xverbose.gen.test new file mode 100755 index 00000000..99b41c02 --- /dev/null +++ b/tests/mmap-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmap-Xverbose +mmap.test verbose); do not edit. +set -- verbose +. "${srcdir=.}/mmap.test" diff --git a/tests/mmap.c b/tests/mmap.c index f726f63e..1f6322fe 100644 --- a/tests/mmap.c +++ b/tests/mmap.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -57,25 +38,59 @@ main(int ac, char **av) (void) close(0); (void) close(0); +#if XLAT_RAW + printf("%s(NULL, 0, %#x, %#x, 0, 0) = -1 EBADF (%m)\n", + name, PROT_NONE, MAP_FILE); +#elif XLAT_VERBOSE + printf("%s(NULL, 0, %#x /* PROT_NONE */, %#x /* MAP_FILE */, 0, 0) " + "= -1 EBADF (%m)\n", + name, PROT_NONE, MAP_FILE); +#else printf("%s(NULL, 0, PROT_NONE, MAP_FILE, 0, 0) = -1 EBADF (%m)\n", name); +#endif mmap(NULL, 0, PROT_NONE, MAP_FILE, 0, 0); p = mmap(addr, length1, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, fd, offset); if (MAP_FAILED == p) perror_msg_and_fail("mmap"); +#if XLAT_RAW + printf("%s(%p, %lu, %#x, " + "%#x, %d, %#jx) = %p\n", + name, addr, length1, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, fd, uoffset, p); +#elif XLAT_VERBOSE + printf("%s(%p, %lu, %#x /* PROT_READ|PROT_WRITE */, " + "%#x /* MAP_PRIVATE|MAP_ANONYMOUS */, %d, %#jx) = %p\n", + name, addr, length1, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, fd, uoffset, p); +#else printf("%s(%p, %lu, PROT_READ|PROT_WRITE, " "MAP_PRIVATE|MAP_ANONYMOUS, %d, %#jx) = %p\n", name, addr, length1, fd, uoffset, p); +#endif if (msync(p, length1, MS_SYNC)) perror_msg_and_fail("msync"); +#if XLAT_RAW + printf("msync(%p, %lu, %#x) = 0\n", p, length1, MS_SYNC); +#elif XLAT_VERBOSE + printf("msync(%p, %lu, %#x /* MS_SYNC */) = 0\n", p, length1, MS_SYNC); +#else printf("msync(%p, %lu, MS_SYNC) = 0\n", p, length1); +#endif if (mprotect(p, length1, PROT_NONE)) perror_msg_and_fail("mprotect"); +#if XLAT_RAW + printf("mprotect(%p, %lu, %#x) = 0\n", p, length1, PROT_NONE); +#elif XLAT_VERBOSE + printf("mprotect(%p, %lu, %#x /* PROT_NONE */) = 0\n", + p, length1, PROT_NONE); +#else printf("mprotect(%p, %lu, PROT_NONE) = 0\n", p, length1); +#endif addr = mremap(p, length1, length2, 0); if (MAP_FAILED == addr) @@ -86,20 +101,33 @@ main(int ac, char **av) addr + length2); if (MAP_FAILED == p) perror_msg_and_fail("mremap"); +#if XLAT_RAW + printf("mremap(%p, %lu, %lu, %#x, %p) = %p\n", + addr, length2, length3, MREMAP_MAYMOVE | MREMAP_FIXED, + addr + length2, p); +#elif XLAT_VERBOSE + printf("mremap(%p, %lu, %lu, %#x /* MREMAP_MAYMOVE|MREMAP_FIXED */" + ", %p) = %p\n", + addr, length2, length3, MREMAP_MAYMOVE | MREMAP_FIXED, + addr + length2, p); +#else printf("mremap(%p, %lu, %lu, MREMAP_MAYMOVE|MREMAP_FIXED" ", %p) = %p\n", addr, length2, length3, addr + length2, p); - - if (madvise(p, length3, MADV_NORMAL)) - perror_msg_and_fail("madvise"); - printf("madvise(%p, %lu, MADV_NORMAL) = 0\n", p, length3); +#endif if (munmap(p, length3)) perror_msg_and_fail("munmap"); printf("munmap(%p, %lu) = 0\n", p, length3); - if (mlockall(MCL_FUTURE)) - perror_msg_and_fail("mlockall"); - puts("mlockall(MCL_FUTURE) = 0"); + printf("mlockall("); +#if XLAT_RAW + printf("%#x", MCL_FUTURE); +#elif XLAT_VERBOSE + printf("%#x /* MCL_FUTURE */", MCL_FUTURE); +#else + printf("MCL_FUTURE"); +#endif + printf(") = %s\n", sprintrc(mlockall(MCL_FUTURE))); puts("+++ exited with 0 +++"); return 0; diff --git a/tests/mmap.test b/tests/mmap.test index 0b87114a..a47f0db0 100755 --- a/tests/mmap.test +++ b/tests/mmap.test @@ -4,29 +4,10 @@ # syscalls decoding. # # Copyright (c) 2015-2016 Dmitry V. Levin +# Copyright (c) 2015-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -34,15 +15,20 @@ check_prog grep check_prog sed run_prog > /dev/null +xlat_opt="" +[ "$#" -gt 0 ] && xlat_opt="-X$1" +align=20 +[ "$#" -gt 1 ] && align="$2" + syscall= for n in mmap mmap2; do $STRACE -e$n -h > /dev/null && syscall=$syscall,$n done run_strace -e$syscall $args > /dev/null -if grep '^mmap(NULL, 0, PROT_NONE,' < "$LOG" > /dev/null; then +if grep '^mmap(NULL, 0, \(0 /* PROT_NONE */\|0\|PROT_NONE\),' < "$LOG" > /dev/null; then mmap=mmap -elif grep '^mmap2(NULL, 0, PROT_NONE,' < "$LOG" > /dev/null; then +elif grep '^mmap2(NULL, 0, \(0 \/\* PROT_NONE \*\/\|0\|PROT_NONE\),' < "$LOG" > /dev/null; then mmap=mmap2 else dump_log_and_fail_with "mmap/mmap2 not found in $STRACE $args output" @@ -50,9 +36,7 @@ fi syscall=$mmap,madvise,mlockall,mprotect,mremap,msync,munmap -run_prog "./$NAME" $mmap > /dev/null -run_strace -a20 -e$syscall $args > "$EXP" -sed -n "/^$mmap(NULL, 0, PROT_NONE,/,\$p" < "$LOG" > "$OUT" +run_prog "../$NAME" $mmap > /dev/null +run_strace -a$align -e$syscall $xlat_opt $args > "$EXP" +sed -n "/^$mmap(NULL, 0, \(0 \/\* PROT_NONE \*\/\|0\|PROT_NONE\),/,\$p" < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests/mmap64-Xabbrev.c b/tests/mmap64-Xabbrev.c new file mode 100644 index 00000000..cbd77896 --- /dev/null +++ b/tests/mmap64-Xabbrev.c @@ -0,0 +1 @@ +#include "mmap64.c" diff --git a/tests/mmap64-Xabbrev.gen.test b/tests/mmap64-Xabbrev.gen.test new file mode 100755 index 00000000..3e2c94ba --- /dev/null +++ b/tests/mmap64-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmap64-Xabbrev +mmap.test abbrev); do not edit. +set -- abbrev +. "${srcdir=.}/mmap.test" diff --git a/tests/mmap64-Xraw.c b/tests/mmap64-Xraw.c new file mode 100644 index 00000000..f75f235f --- /dev/null +++ b/tests/mmap64-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "mmap64.c" diff --git a/tests/mmap64-Xraw.gen.test b/tests/mmap64-Xraw.gen.test new file mode 100755 index 00000000..7aeed02f --- /dev/null +++ b/tests/mmap64-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmap64-Xraw +mmap.test raw 14); do not edit. +set -- raw 14 +. "${srcdir=.}/mmap.test" diff --git a/tests/mmap64-Xverbose.c b/tests/mmap64-Xverbose.c new file mode 100644 index 00000000..f72513e1 --- /dev/null +++ b/tests/mmap64-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "mmap64.c" diff --git a/tests/mmap64-Xverbose.gen.test b/tests/mmap64-Xverbose.gen.test new file mode 100755 index 00000000..0d675d98 --- /dev/null +++ b/tests/mmap64-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmap64-Xverbose +mmap.test verbose); do not edit. +set -- verbose +. "${srcdir=.}/mmap.test" diff --git a/tests/mmap64.gen.test b/tests/mmap64.gen.test new file mode 100755 index 00000000..0ecd5294 --- /dev/null +++ b/tests/mmap64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmap64 +mmap.test ); do not edit. +set -- +. "${srcdir=.}/mmap.test" diff --git a/tests/mmap64.test b/tests/mmap64.test deleted file mode 100755 index 51f1896e..00000000 --- a/tests/mmap64.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check mmap/mprotect/munmap syscalls decoding. -# Target executable was compiled with -D_FILE_OFFSET_BITS=64. - -. "${srcdir=.}/mmap.test" diff --git a/tests/mmsg-silent.c b/tests/mmsg-silent.c index 47d0a504..82e373d2 100644 --- a/tests/mmsg-silent.c +++ b/tests/mmsg-silent.c @@ -1,30 +1,10 @@ /* * Check silent decoding of sendmmsg and recvmmsg syscalls. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/mmsg-silent.gen.test b/tests/mmsg-silent.gen.test new file mode 100755 index 00000000..47863f26 --- /dev/null +++ b/tests/mmsg-silent.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmsg-silent -a25 -e verbose=none -e trace=sendmmsg,recvmmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 -e verbose=none -e trace=sendmmsg,recvmmsg diff --git a/tests/mmsg-silent.test b/tests/mmsg-silent.test deleted file mode 100755 index 775e0ad3..00000000 --- a/tests/mmsg-silent.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check silent decoding of sendmmsg and recvmmsg syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a25 -e verbose=none -e trace=sendmmsg,recvmmsg diff --git a/tests/mmsg.c b/tests/mmsg.c index 88805d16..ab8fdf6e 100644 --- a/tests/mmsg.c +++ b/tests/mmsg.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2014 Masatake YAMATO * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -113,14 +94,16 @@ main(void) " | 00000 %-49s %-16s |\n", w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), - ARRAY_SIZE(w0_iov_), + (unsigned int) ARRAY_SIZE(w0_iov_), LENGTH_OF(w0_c) + LENGTH_OF(w1_c), - w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w1_iov_), + w2_c, LENGTH_OF(w2_c), (unsigned int) ARRAY_SIZE(w1_iov_), LENGTH_OF(w2_c), n_w_mmh, r, - ARRAY_SIZE(w0_iov_), LENGTH_OF(w0_c), w0_d, w0_c, + (unsigned int) ARRAY_SIZE(w0_iov_), + LENGTH_OF(w0_c), w0_d, w0_c, LENGTH_OF(w1_c), w1_d, w1_c, - ARRAY_SIZE(w1_iov_), LENGTH_OF(w2_c), w2_d, w2_c); + (unsigned int) ARRAY_SIZE(w1_iov_), + LENGTH_OF(w2_c), w2_d, w2_c); const unsigned int w_len = LENGTH_OF(w0_c) + LENGTH_OF(w1_c) + LENGTH_OF(w2_c); @@ -184,11 +167,14 @@ main(void) " = %u buffers in vector 1\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - r0_c, r_len, ARRAY_SIZE(r0_iov_), LENGTH_OF(r0_c), - r1_c, r_len, r_len, ARRAY_SIZE(r1_iov_), LENGTH_OF(r1_c), + r0_c, r_len, (unsigned int) ARRAY_SIZE(r0_iov_), + LENGTH_OF(r0_c), r1_c, r_len, r_len, + (unsigned int) ARRAY_SIZE(r1_iov_), LENGTH_OF(r1_c), n_r_mmh, r, - ARRAY_SIZE(r0_iov_), LENGTH_OF(r0_c), r0_d, r0_c, - ARRAY_SIZE(r1_iov_), LENGTH_OF(r1_c), r1_d, r1_c); + (unsigned int) ARRAY_SIZE(r0_iov_), LENGTH_OF(r0_c), + r0_d, r0_c, + (unsigned int) ARRAY_SIZE(r1_iov_), LENGTH_OF(r1_c), + r1_d, r1_c); tprintf("+++ exited with 0 +++\n"); return 0; diff --git a/tests/mmsg.gen.test b/tests/mmsg.gen.test new file mode 100755 index 00000000..4d90e3d2 --- /dev/null +++ b/tests/mmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmsg -e read=0 -e write=1 -e trace=recvmmsg,sendmmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e read=0 -e write=1 -e trace=recvmmsg,sendmmsg diff --git a/tests/mmsg.test b/tests/mmsg.test deleted file mode 100755 index a8148ba8..00000000 --- a/tests/mmsg.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check how iovecs in struct mmsghdr are decoded. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=recvmmsg,sendmmsg -e read=0 -e write=1 diff --git a/tests/mmsg_name-v.gen.test b/tests/mmsg_name-v.gen.test new file mode 100755 index 00000000..e34946fc --- /dev/null +++ b/tests/mmsg_name-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmsg_name-v -v -a25 -e trace=sendmmsg,recvmmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -a25 -e trace=sendmmsg,recvmmsg diff --git a/tests/mmsg_name-v.test b/tests/mmsg_name-v.test deleted file mode 100755 index ab8dfba6..00000000 --- a/tests/mmsg_name-v.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# Check verbose decoding of msg_name* fields of struct msghdr array argument -# of sendmmsg and recvmmsg syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -a25 -e trace=sendmmsg,recvmmsg diff --git a/tests/mmsg_name.c b/tests/mmsg_name.c index a7a55c55..fce004bb 100644 --- a/tests/mmsg_name.c +++ b/tests/mmsg_name.c @@ -3,29 +3,10 @@ * of sendmmsg and recvmmsg syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,8 +21,6 @@ #include "msghdr.h" -#define DEFAULT_STRLEN 32 - #define IOV_MAX1 (IOV_MAX + 1) #ifndef TEST_NAME @@ -77,7 +56,7 @@ print_msghdr(const struct msghdr *const msg, const int user_msg_namelen) } printf("%d, msg_iov=[{iov_base=\"%c\", iov_len=1}]" ", msg_iovlen=1, msg_controllen=0, msg_flags=0}", - (int) msg->msg_namelen, * (char *) msg->msg_iov[0].iov_base); + (int) msg->msg_namelen, *(char *) msg->msg_iov[0].iov_base); } static void @@ -121,9 +100,9 @@ test_mmsg_name(const int send_fd, const int recv_fd) if (i) printf(", "); if (i >= IOV_MAX -# if !VERBOSE +#if !VERBOSE || i >= DEFAULT_STRLEN -# endif +#endif ) { printf("..."); break; @@ -153,7 +132,7 @@ test_mmsg_name(const int send_fd, const int recv_fd) printf("sendmmsg(-1, [{msg_hdr="); print_msghdr(&send_mh[IOV_MAX].msg_hdr, 0); errno = saved_errno; - printf("}, %p], %u, MSG_DONTWAIT) = %d %s (%m)\n", + printf("}, ... /* %p */], %u, MSG_DONTWAIT) = %d %s (%m)\n", &send_mh[IOV_MAX1], 2, rc, errno2name()); rc = send_mmsg(send_fd, send_mh, IOV_MAX1, MSG_DONTWAIT); diff --git a/tests/mmsg_name.gen.test b/tests/mmsg_name.gen.test new file mode 100755 index 00000000..ac542946 --- /dev/null +++ b/tests/mmsg_name.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mmsg_name -a25 -e trace=sendmmsg,recvmmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 -e trace=sendmmsg,recvmmsg diff --git a/tests/mmsg_name.test b/tests/mmsg_name.test deleted file mode 100755 index e18c9722..00000000 --- a/tests/mmsg_name.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# Check decoding of msg_name* fields of struct msghdr array argument -# of sendmmsg and recvmmsg syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a25 -e trace=sendmmsg,recvmmsg diff --git a/tests/modify_ldt.c b/tests/modify_ldt.c new file mode 100644 index 00000000..78e370e4 --- /dev/null +++ b/tests/modify_ldt.c @@ -0,0 +1,117 @@ +/* + * Check decoding of modify_ldt syscall. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include + +#if defined __NR_modify_ldt && defined HAVE_STRUCT_USER_DESC + +# include +# include +# include + +# include "print_user_desc.c" + +void +printrc(long rc) +{ +# ifdef __x86_64__ + int err = -rc; + + /* Thanks, long return type of syscall(2) */ + printf("%lld", zero_extend_signed_to_ull(rc)); + + if (err > 0 && err < 0x1000) { + errno = err; + printf(" %s (%m)", errno2name()); + } +# else + printf("%s", sprintrc(rc)); +# endif + + puts(""); +} + +int +main(void) +{ + static const kernel_ulong_t bogus_func = + (kernel_ulong_t) 0xbadc0dedda7a1057ULL; + static const kernel_ulong_t bogus_bytecount = + (kernel_ulong_t) 0xdeadfacefa57beefULL; + + TAIL_ALLOC_OBJECT_CONST_PTR(struct user_desc, us); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, bogus_int); + long rc; + + fill_memory(us, sizeof(*us)); + + rc = syscall(__NR_modify_ldt, 0, 0, 0); + printf("modify_ldt(0, NULL, 0) = "); + printrc(rc); + + rc = syscall(__NR_modify_ldt, bogus_func, (kernel_long_t) -1, + bogus_bytecount); + printf("modify_ldt(%d, %#llx, %llu) = ", + (int) bogus_func, + zero_extend_signed_to_ull((kernel_long_t) -1), + (unsigned long long) bogus_bytecount); + printrc(rc); + + rc = syscall(__NR_modify_ldt, bogus_func, us + 1, 0); + printf("modify_ldt(%d, %p, 0) = ", (int) bogus_func, us + 1); + printrc(rc); + + rc = syscall(__NR_modify_ldt, bogus_func, us, 42); + printf("modify_ldt(%d, %p, 42) = ", (int) bogus_func, us); + printrc(rc); + + rc = syscall(__NR_modify_ldt, bogus_func, us + 1, sizeof(*us)); + printf("modify_ldt(%d, %p, %zu) = ", + (int) bogus_func, us + 1, sizeof(*us)); + printrc(rc); + + /* + * print_user_desc handles entry_number field in a special way for + * get_thread_area syscall, so let's also check here that we don't + * retrieve it accidentally. + */ + rc = syscall(__NR_modify_ldt, bogus_func, bogus_int, sizeof(*us)); + printf("modify_ldt(%d, %p, %zu) = ", + (int) bogus_func, bogus_int, sizeof(*us)); + printrc(rc); + + rc = syscall(__NR_modify_ldt, bogus_func, us, sizeof(*us)); + printf("modify_ldt(%d, ", (int) bogus_func); + print_user_desc(us, NULL); + printf(", %zu) = ", sizeof(*us)); + printrc(rc); + + fill_memory_ex(us, sizeof(*us), 0x55, 80); + us->entry_number = -1; + us->base_addr = 0; + us->limit = 0; + + rc = syscall(__NR_modify_ldt, bogus_func, us, sizeof(*us)); + printf("modify_ldt(%d, ", (int) bogus_func); + print_user_desc(us, "-1"); + printf(", %zu) = ", sizeof(*us)); + printrc(rc); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_modify_ldt && HAVE_STRUCT_USER_DESC"); + +#endif diff --git a/tests/modify_ldt.gen.test b/tests/modify_ldt.gen.test new file mode 100755 index 00000000..1a85b067 --- /dev/null +++ b/tests/modify_ldt.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (modify_ldt -a23 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 diff --git a/tests/mount-Xabbrev.c b/tests/mount-Xabbrev.c new file mode 100644 index 00000000..0f6fecde --- /dev/null +++ b/tests/mount-Xabbrev.c @@ -0,0 +1 @@ +#include "mount.c" diff --git a/tests/mount-Xabbrev.gen.test b/tests/mount-Xabbrev.gen.test new file mode 100755 index 00000000..10e261ff --- /dev/null +++ b/tests/mount-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mount-Xabbrev -a33 -e trace=mount -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -e trace=mount -Xabbrev diff --git a/tests/mount-Xraw.c b/tests/mount-Xraw.c new file mode 100644 index 00000000..3aa1f084 --- /dev/null +++ b/tests/mount-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "mount.c" diff --git a/tests/mount-Xraw.gen.test b/tests/mount-Xraw.gen.test new file mode 100755 index 00000000..ce852f88 --- /dev/null +++ b/tests/mount-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mount-Xraw -a33 -e trace=mount -Xraw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -e trace=mount -Xraw diff --git a/tests/mount-Xverbose.c b/tests/mount-Xverbose.c new file mode 100644 index 00000000..0b211c7a --- /dev/null +++ b/tests/mount-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "mount.c" diff --git a/tests/mount-Xverbose.gen.test b/tests/mount-Xverbose.gen.test new file mode 100755 index 00000000..c780070e --- /dev/null +++ b/tests/mount-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mount-Xverbose -a33 -e trace=mount -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -e trace=mount -Xverbose diff --git a/tests/mount.c b/tests/mount.c index cbfe42f8..05bc310d 100644 --- a/tests/mount.c +++ b/tests/mount.c @@ -2,29 +2,10 @@ * Check decoding of mount syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,7 +21,34 @@ # define MS_RELATIME (1ul << 21) #endif -#define str_ro_nosuid_nodev_noexec "MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC" +#if XLAT_RAW +# define str_unknown "0x300" +# define str_submount_200 "0x4000200" +# define str_mgc_val "0xc0ed0000" +# define str_remount "0x20" +# define str_bind "0x1000" +# define str_ro_nosuid_nodev_noexec "0xf" +# define str_ro_nosuid_nodev_noexec_relatime "0x20000f" +#elif XLAT_VERBOSE +# define str_unknown "0x300 /* MS_??? */" +# define str_submount_200 "0x4000200 /* MS_SUBMOUNT|0x200 */" +# define str_mgc_val "0xc0ed0000 /* MS_MGC_VAL */" +# define str_remount "0x20 /* MS_REMOUNT */" +# define str_bind "0x1000 /* MS_BIND */" +# define str_ro_nosuid_nodev_noexec \ + "0xf /* MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC */" +# define str_ro_nosuid_nodev_noexec_relatime \ + "0x20000f /* MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_RELATIME */" +#else /* !XLAT_RAW && !XLAT_VERBOSE */ +# define str_unknown "0x300 /* MS_??? */" +# define str_submount_200 "MS_SUBMOUNT|0x200" +# define str_mgc_val "MS_MGC_VAL" +# define str_remount "MS_REMOUNT" +# define str_bind "MS_BIND" +# define str_ro_nosuid_nodev_noexec "MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC" +# define str_ro_nosuid_nodev_noexec_relatime \ + "MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_RELATIME" +#endif /* XLAT_RAW, XLAT_VERBOSE */ int main(void) @@ -49,35 +57,59 @@ main(void) static const char target[] = "mount_target"; static const char fstype[] = "mount_fstype"; static const char data[] = "mount_data"; + TAIL_ALLOC_OBJECT_CONST_PTR(char, bogus); + + bogus[0] = 'a'; + + int rc = mount(NULL, NULL, NULL, 0, NULL); + printf("mount(NULL, NULL, NULL, 0, NULL) = %s\n", + sprintrc(rc)); + + rc = mount(bogus, bogus, bogus, 768, bogus); + printf("mount(%p, %p, %p, %s, %p) = %s\n", + bogus, bogus, bogus, str_unknown, bogus, sprintrc(rc)); - int rc = mount(source, target, fstype, 15, data); - printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", + rc = mount(bogus + 1, bogus + 1, bogus + 1, 0x4000200, bogus + 1); + printf("mount(%p, %p, %p, %s, %p) = %s\n", + bogus + 1, bogus + 1, bogus + 1, str_submount_200, + bogus + 1, sprintrc(rc)); + + rc = mount(source, target, fstype, 15, data); + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %s\n", source, target, fstype, str_ro_nosuid_nodev_noexec, - data, rc, errno2name()); + data, sprintrc(rc)); rc = mount(source, target, fstype, MS_RELATIME | 15, data); - printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %s\n", source, target, fstype, - str_ro_nosuid_nodev_noexec "|MS_RELATIME", - data, rc, errno2name()); + str_ro_nosuid_nodev_noexec_relatime, + data, sprintrc(rc)); rc = mount(source, target, fstype, MS_MGC_VAL, data); - printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", - source, target, fstype, "MS_MGC_VAL", data, rc, errno2name()); + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %s\n", + source, target, fstype, str_mgc_val, data, sprintrc(rc)); rc = mount(source, target, fstype, MS_MGC_VAL | 15, data); - printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %d %s (%m)\n", + printf("mount(\"%s\", \"%s\", \"%s\", %s, \"%s\") = %s\n", source, target, fstype, - "MS_MGC_VAL|" str_ro_nosuid_nodev_noexec, - data, rc, errno2name()); + str_mgc_val "|" str_ro_nosuid_nodev_noexec, + data, sprintrc(rc)); + + rc = mount(source, target, NULL, MS_REMOUNT, data); + printf("mount(\"%s\", \"%s\", NULL, %s, \"%s\") = %s\n", + source, target, str_remount, data, sprintrc(rc)); rc = mount(source, target, fstype, MS_REMOUNT, data); - printf("mount(\"%s\", \"%s\", %p, %s, \"%s\") = %d %s (%m)\n", - source, target, fstype, "MS_REMOUNT", data, rc, errno2name()); + printf("mount(\"%s\", \"%s\", %p, %s, \"%s\") = %s\n", + source, target, fstype, str_remount, data, sprintrc(rc)); + + rc = mount(source, target, NULL, MS_BIND, data); + printf("mount(\"%s\", \"%s\", NULL, %s, %p) = %s\n", + source, target, str_bind, data, sprintrc(rc)); - rc = mount(source, target, fstype, MS_BIND, data); - printf("mount(\"%s\", \"%s\", %p, %s, %p) = %d %s (%m)\n", - source, target, fstype, "MS_BIND", data, rc, errno2name()); + rc = mount(source, target, fstype, MS_BIND, NULL); + printf("mount(\"%s\", \"%s\", %p, %s, NULL) = %s\n", + source, target, fstype, str_bind, sprintrc(rc)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests/mount.gen.test b/tests/mount.gen.test new file mode 100755 index 00000000..2a3639c8 --- /dev/null +++ b/tests/mount.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mount -a33 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 diff --git a/tests/mount.test b/tests/mount.test deleted file mode 100755 index 40fdca95..00000000 --- a/tests/mount.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of mount syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/move_pages-Xabbrev.c b/tests/move_pages-Xabbrev.c new file mode 100644 index 00000000..d0949884 --- /dev/null +++ b/tests/move_pages-Xabbrev.c @@ -0,0 +1 @@ +#include "move_pages.c" diff --git a/tests/move_pages-Xabbrev.gen.test b/tests/move_pages-Xabbrev.gen.test new file mode 100755 index 00000000..4a17a0db --- /dev/null +++ b/tests/move_pages-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (move_pages-Xabbrev -s3 -e trace=move_pages -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 -e trace=move_pages -Xabbrev diff --git a/tests/move_pages-Xraw.c b/tests/move_pages-Xraw.c new file mode 100644 index 00000000..e9a6cc08 --- /dev/null +++ b/tests/move_pages-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "move_pages.c" diff --git a/tests/move_pages-Xraw.gen.test b/tests/move_pages-Xraw.gen.test new file mode 100755 index 00000000..6465b0f9 --- /dev/null +++ b/tests/move_pages-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (move_pages-Xraw -s3 -a36 -e trace=move_pages -Xraw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 -a36 -e trace=move_pages -Xraw diff --git a/tests/move_pages-Xverbose.c b/tests/move_pages-Xverbose.c new file mode 100644 index 00000000..71fcdee6 --- /dev/null +++ b/tests/move_pages-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "move_pages.c" diff --git a/tests/move_pages-Xverbose.gen.test b/tests/move_pages-Xverbose.gen.test new file mode 100755 index 00000000..15e95c94 --- /dev/null +++ b/tests/move_pages-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (move_pages-Xverbose -s3 -e trace=move_pages -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 -e trace=move_pages -Xverbose diff --git a/tests/move_pages.c b/tests/move_pages.c index f4ccafa2..895c7c6f 100644 --- a/tests/move_pages.c +++ b/tests/move_pages.c @@ -2,29 +2,10 @@ * Check decoding of move_pages syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -62,7 +43,7 @@ print_page_array(const void **const pages, break; } } else { - printf("%p", pages + i); + printf("... /* %p */", pages + i); break; } const void *const addr = pages[i]; @@ -98,7 +79,7 @@ print_node_array(const int *const nodes, break; } } else { - printf("%p", nodes + i); + printf("... /* %p */", nodes + i); break; } printf("%d", nodes[i]); @@ -125,8 +106,16 @@ print_status_array(const int *const status, const unsigned long count) if (status[i] >= 0) { printf("%d", status[i]); } else { +# if !XLAT_RAW errno = -status[i]; - printf("%s", errno2name()); +# endif +# if XLAT_RAW + printf("%d", status[i]); +# elif XLAT_VERBOSE + printf("%d /* -%s */", status[i], errno2name()); +# else + printf("-%s", errno2name()); +# endif } } printf("]"); @@ -152,7 +141,13 @@ print_stat_pages(const unsigned long pid, const unsigned long count, } else { print_status_array(status, count); } +# if XLAT_RAW + printf(", 0x2) = %s\n", errstr); +# elif XLAT_VERBOSE + printf(", 0x2 /* MPOL_MF_MOVE */) = %s\n", errstr); +# else /* XLAT_ABBREV */ printf(", MPOL_MF_MOVE) = %s\n", errstr); +# endif } static void @@ -178,7 +173,13 @@ print_move_pages(const unsigned long pid, printf("%p", status); else printf("[]"); +# if XLAT_RAW + printf(", 0x4) = %s\n", errstr); +# elif XLAT_VERBOSE + printf(", 0x4 /* MPOL_MF_MOVE_ALL */) = %s\n", errstr); +# else /* XLAT_ABBREV */ printf(", MPOL_MF_MOVE_ALL) = %s\n", errstr); +# endif } int @@ -190,9 +191,9 @@ main(void) const unsigned page_size = get_page_size(); const void *const page = tail_alloc(page_size); const void *const efault = page + page_size; - const void **pages = tail_alloc(sizeof(*pages)); - int *nodes = tail_alloc(sizeof(*nodes)); - int *status = tail_alloc(sizeof(*status)); + TAIL_ALLOC_OBJECT_VAR_PTR(const void *, pages); + TAIL_ALLOC_OBJECT_VAR_PTR(int, nodes); + TAIL_ALLOC_OBJECT_VAR_PTR(int, status); print_stat_pages(pid, 0, pages, status); print_move_pages(pid, 0, 0, pages, nodes, status); diff --git a/tests/move_pages.gen.test b/tests/move_pages.gen.test new file mode 100755 index 00000000..9d472ef9 --- /dev/null +++ b/tests/move_pages.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (move_pages -s3 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 diff --git a/tests/move_pages.test b/tests/move_pages.test deleted file mode 100755 index f9577172..00000000 --- a/tests/move_pages.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of move_pages syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s3 diff --git a/tests/mq.c b/tests/mq.c index 9c2ffc8e..a083e5a1 100644 --- a/tests/mq.c +++ b/tests/mq.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2015 Elvira Khabirova * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -37,17 +18,19 @@ # include # include -# define NAME "strace-mq.test" - int -main (void) +main(void) { struct mq_attr attr; (void) close(0); - if (mq_open("/" NAME, O_CREAT, 0700, NULL)) + char *name; + if (asprintf(&name, "/strace-mq-%u.sample", getpid()) < 0) + perror_msg_and_fail("asprintf"); + + if (mq_open(name, O_CREAT, 0700, NULL)) perror_msg_and_skip("mq_open"); - printf("mq_open(\"%s\", O_RDONLY|O_CREAT, 0700, NULL) = 0\n", NAME); + printf("mq_open(\"%s\", O_RDONLY|O_CREAT, 0700, NULL) = 0\n", name + 1); if (mq_getattr(0, &attr)) perror_msg_and_skip("mq_getattr"); @@ -63,9 +46,9 @@ main (void) (long long) attr.mq_maxmsg, (long long) attr.mq_msgsize); - if (mq_unlink("/" NAME)) + if (mq_unlink(name)) perror_msg_and_skip("mq_unlink"); - printf("mq_unlink(\"%s\") = 0\n", NAME); + printf("mq_unlink(\"%s\") = 0\n", name + 1); puts("+++ exited with 0 +++"); return 0; diff --git a/tests/mq.gen.test b/tests/mq.gen.test new file mode 100755 index 00000000..8be520d6 --- /dev/null +++ b/tests/mq.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mq -a32 -e trace=mq_getsetattr,mq_open,mq_unlink); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -e trace=mq_getsetattr,mq_open,mq_unlink diff --git a/tests/mq.test b/tests/mq.test deleted file mode 100755 index 746b07b7..00000000 --- a/tests/mq.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of mq_open, mq_getsetattr, and mq_unlink syscalls. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a28 -e trace=mq_getsetattr,mq_open,mq_unlink diff --git a/tests/mq_sendrecv-read.gen.test b/tests/mq_sendrecv-read.gen.test new file mode 100755 index 00000000..278e9b7b --- /dev/null +++ b/tests/mq_sendrecv-read.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mq_sendrecv-read -eread=0 -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -eread=0 -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink diff --git a/tests/mq_sendrecv-read.test b/tests/mq_sendrecv-read.test deleted file mode 100755 index eb4ad75e..00000000 --- a/tests/mq_sendrecv-read.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of mq_open, mq_notify, mq_timedsend, mq_timedreceive syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink -eread=0 -a14 diff --git a/tests/mq_sendrecv-write.gen.test b/tests/mq_sendrecv-write.gen.test new file mode 100755 index 00000000..5963eb41 --- /dev/null +++ b/tests/mq_sendrecv-write.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mq_sendrecv-write -ewrite=0 -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -ewrite=0 -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink diff --git a/tests/mq_sendrecv-write.test b/tests/mq_sendrecv-write.test deleted file mode 100755 index 38277ec6..00000000 --- a/tests/mq_sendrecv-write.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of mq_open, mq_notify, mq_timedsend, mq_timedreceive syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink -ewrite=0 -a14 diff --git a/tests/mq_sendrecv.c b/tests/mq_sendrecv.c index c151542c..7af0f36e 100644 --- a/tests/mq_sendrecv.c +++ b/tests/mq_sendrecv.c @@ -3,29 +3,10 @@ * mq_unlink syscalls. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,7 +21,6 @@ # include # include # include -# include # include # include # include @@ -49,10 +29,6 @@ # include "sigevent.h" -# ifndef MQ_NAME -# define MQ_NAME "mq_sendrecv.sample" -# endif - # ifndef DUMPIO_READ # define DUMPIO_READ 0 # endif @@ -61,6 +37,7 @@ # define DUMPIO_WRITE 0 # endif +static char *mq_name; enum { NUM_ATTRS = 8, @@ -83,7 +60,7 @@ printstr(unsigned char start, unsigned int count) printf("\""); } -#if DUMPIO_READ || DUMPIO_WRITE +# if DUMPIO_READ || DUMPIO_WRITE static void dumpstr(unsigned char start, unsigned int count) { @@ -117,15 +94,15 @@ dumpstr(unsigned char start, unsigned int count) } } } -#endif /* DUMPIO_READ || DUMPIO_WRITE */ +# endif /* DUMPIO_READ || DUMPIO_WRITE */ static void cleanup(void) { long rc; - rc = syscall(__NR_mq_unlink, MQ_NAME); - printf("mq_unlink(\"" MQ_NAME "\") = %s\n", sprintrc(rc)); + rc = syscall(__NR_mq_unlink, mq_name); + printf("mq_unlink(\"%s\") = %s\n", mq_name, sprintrc(rc)); puts("+++ exited with 0 +++"); } @@ -147,9 +124,9 @@ do_send(int fd, char *msg, unsigned int msg_size, struct timespec *tmout, if (cropped) printf("..."); errno = saved_errno; - printf(", %u, 42, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", msg_size, - (intmax_t) tmout->tv_sec, (intmax_t) tmout->tv_nsec, - sprintrc(rc)); + printf(", %u, 42, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", msg_size, + (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); errno = saved_errno; if (rc == -1) { @@ -185,9 +162,9 @@ do_recv(int fd, char *msg, unsigned int msg_size, struct timespec *tmout, printf("%p", msg); } errno = saved_errno; - printf(", %u, [42], {tv_sec=%jd, tv_nsec=%jd}) = %s\n", MSG_SIZE, - (intmax_t) tmout->tv_sec, - (intmax_t) tmout->tv_nsec, sprintrc(rc)); + printf(", %u, [42], {tv_sec=%lld, tv_nsec=%llu}) = %s\n", MSG_SIZE, + (long long) tmout->tv_sec, + zero_extend_signed_to_ull(tmout->tv_nsec), sprintrc(rc)); errno = saved_errno; if (rc == -1) { @@ -230,7 +207,7 @@ main(void) static const struct timespec future_tmout_data = { .tv_sec = (time_t) 0x7ea1fade7e57faceLL, .tv_nsec = 999999999, - };; + }; struct_sigevent bogus_sev_data = { .sigev_notify = 0xdefaced, .sigev_signo = 0xfacefeed, @@ -242,7 +219,7 @@ main(void) kernel_long_t *bogus_attrs = tail_alloc(sizeof(*bogus_attrs) * NUM_ATTRS); char *msg = tail_alloc(MSG_SIZE); - unsigned *bogus_prio_ptr = tail_alloc(sizeof(*bogus_prio_ptr)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned, bogus_prio_ptr); struct timespec *bogus_tmout = tail_memdup(&bogus_tmout_data, sizeof(*bogus_tmout)); struct timespec *future_tmout = tail_memdup(&future_tmout_data, @@ -278,8 +255,8 @@ main(void) /* Valid attributes structure */ rc = syscall(__NR_mq_open, msg, O_CREAT | bogus_oflags, bogus_mode, bogus_attrs); - printf("mq_open(%p, O_ACCMODE|O_CREAT, %#o, {mq_flags=%#llx, " - "mq_maxmsg=%lld, mq_msgsize=%lld, mq_curmsgs=%lld}) = %s\n", + printf("mq_open(%p, O_ACCMODE|O_CREAT, %#o, {mq_flags=%#llx" + ", mq_maxmsg=%lld, mq_msgsize=%lld, mq_curmsgs=%lld}) = %s\n", msg, (unsigned short) bogus_mode, (unsigned long long) (kernel_ulong_t) bogus_attrs[0], (long long) bogus_attrs[1], @@ -304,12 +281,12 @@ main(void) /* Partially invalid message (memory only partially available) */ rc = syscall(__NR_mq_timedsend, bogus_fd, msg + MSG_SIZE - MSG_CUT, MSG_SIZE, bogus_prio, bogus_tmout); - printf("mq_timedsend(%d, %p, %llu, %u, {tv_sec=%jd, tv_nsec=%jd}) = " - "%s\n", + printf("mq_timedsend(%d, %p, %llu, %u, {tv_sec=%lld, tv_nsec=%llu})" + " = %s\n", (int) bogus_fd, msg + MSG_SIZE - MSG_CUT, (unsigned long long) MSG_SIZE, (unsigned) bogus_prio, - (intmax_t) bogus_tmout->tv_sec, (intmax_t) bogus_tmout->tv_nsec, - sprintrc(rc)); + (long long) bogus_tmout->tv_sec, + zero_extend_signed_to_ull(bogus_tmout->tv_nsec), sprintrc(rc)); /* Fully valid message, uncut */ rc = syscall(__NR_mq_timedsend, bogus_fd, msg + MSG_SIZE - MSG_CUT, @@ -317,10 +294,10 @@ main(void) errstr = sprintrc(rc); printf("mq_timedsend(%d, ", (int) bogus_fd); printstr(MSG_START + MSG_SIZE - MSG_CUT, MSG_CUT); - printf(", %llu, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + printf(", %llu, %u, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", (unsigned long long) MSG_CUT, (unsigned) bogus_prio, - (intmax_t) bogus_tmout->tv_sec, (intmax_t) bogus_tmout->tv_nsec, - errstr); + (long long) bogus_tmout->tv_sec, + zero_extend_signed_to_ull(bogus_tmout->tv_nsec), errstr); /* Partially invalid message, cut at maxstrlen */ rc = syscall(__NR_mq_timedsend, bogus_fd, msg + MSG_CUT, MSG_SIZE, @@ -328,10 +305,10 @@ main(void) errstr = sprintrc(rc); printf("mq_timedsend(%d, ", (int) bogus_fd); printstr(MSG_START + MSG_CUT, MSG_MAX_UNCUT); - printf("..., %llu, %u, {tv_sec=%jd, tv_nsec=%jd}) = %s\n", + printf("..., %llu, %u, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", (unsigned long long) MSG_SIZE, (unsigned) bogus_prio, - (intmax_t) bogus_tmout->tv_sec, (intmax_t) bogus_tmout->tv_nsec, - errstr); + (long long) bogus_tmout->tv_sec, + zero_extend_signed_to_ull(bogus_tmout->tv_nsec), errstr); /* mq_timedreceive */ @@ -351,11 +328,11 @@ main(void) /* Invalid fd, valid msg pointer */ rc = syscall(__NR_mq_timedreceive, bogus_fd, msg, bogus_size, bogus_prio_ptr, bogus_tmout); - printf("mq_timedreceive(%d, %p, %llu, %p, {tv_sec=%jd, tv_nsec=%jd}) = " - "%s\n", + printf("mq_timedreceive(%d, %p, %llu, %p, {tv_sec=%lld, tv_nsec=%llu}) " + "= %s\n", (int) bogus_fd, msg, (unsigned long long) bogus_size, - bogus_prio_ptr, (intmax_t) bogus_tmout->tv_sec, - (intmax_t) bogus_tmout->tv_nsec, sprintrc(rc)); + bogus_prio_ptr, (long long) bogus_tmout->tv_sec, + zero_extend_signed_to_ull(bogus_tmout->tv_nsec), sprintrc(rc)); /* mq_notify */ @@ -381,8 +358,8 @@ main(void) /* SIGEV_NONE */ bogus_sev->sigev_notify = SIGEV_NONE; rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); - printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}, " - "sigev_signo=%u, sigev_notify=SIGEV_NONE}) = %s\n", + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}" + ", sigev_signo=%u, sigev_notify=SIGEV_NONE}) = %s\n", (int) bogus_fd, bogus_sev->sigev_value.sival_int, bogus_sev->sigev_value.sival_ptr, bogus_sev->sigev_signo, sprintrc(rc)); @@ -391,8 +368,8 @@ main(void) bogus_sev->sigev_notify = SIGEV_SIGNAL; bogus_sev->sigev_signo = SIGALRM; rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); - printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}, " - "sigev_signo=SIGALRM, sigev_notify=SIGEV_SIGNAL}) = %s\n", + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}" + ", sigev_signo=SIGALRM, sigev_notify=SIGEV_SIGNAL}) = %s\n", (int) bogus_fd, bogus_sev->sigev_value.sival_int, bogus_sev->sigev_value.sival_ptr, sprintrc(rc)); @@ -403,10 +380,10 @@ main(void) bogus_sev->sigev_un.sigev_thread.attribute = (unsigned long) 0xcafef00dfacefeedULL; rc = syscall(__NR_mq_notify, bogus_fd, bogus_sev); - printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}, " - "sigev_signo=SIGALRM, sigev_notify=SIGEV_THREAD, " - "sigev_notify_function=%#lx, sigev_notify_attributes=%#lx}) = " - "%s\n", + printf("mq_notify(%d, {sigev_value={sival_int=%d, sival_ptr=%#lx}" + ", sigev_signo=SIGALRM, sigev_notify=SIGEV_THREAD" + ", sigev_notify_function=%#lx, sigev_notify_attributes=%#lx})" + " = %s\n", (int) bogus_fd, bogus_sev->sigev_value.sival_int, bogus_sev->sigev_value.sival_ptr, bogus_sev->sigev_un.sigev_thread.function, @@ -430,13 +407,16 @@ main(void) /* Sending and receiving test */ + if (asprintf(&mq_name, "strace-mq_sendrecv-%u.sample", getpid()) < 0) + perror_msg_and_fail("asprintf"); + # if DUMPIO_READ || DUMPIO_WRITE close(0); # endif bogus_attrs[1] = 2; bogus_attrs[2] = MSG_SIZE; - fd = rc = syscall(__NR_mq_open, MQ_NAME, - O_CREAT|O_RDWR|O_NONBLOCK, S_IRWXU, bogus_attrs); + fd = rc = syscall(__NR_mq_open, mq_name, + O_CREAT|O_RDWR|O_NONBLOCK, S_IRWXU, bogus_attrs); errstr = sprintrc(rc); if (rc < 0) perror_msg_and_skip("mq_open"); @@ -448,11 +428,11 @@ main(void) # endif fill_memory_ex(bogus_attrs, sizeof(*bogus_attrs) * NUM_ATTRS, 0xbb, 0x70); - printf("mq_open(\"" MQ_NAME "\", O_RDWR|O_CREAT|O_NONBLOCK, " - "0700, {mq_flags=%#llx, mq_maxmsg=2, mq_msgsize=%u, " - "mq_curmsgs=%lld}) = %s\n", - (unsigned long long) (kernel_ulong_t) bogus_attrs[0], MSG_SIZE, - (long long) bogus_attrs[3], errstr); + printf("mq_open(\"%s\", O_RDWR|O_CREAT|O_NONBLOCK, 0700" + ", {mq_flags=%#llx, mq_maxmsg=2, mq_msgsize=%u" + ", mq_curmsgs=%lld}) = %s\n", + mq_name, (unsigned long long) (kernel_ulong_t) bogus_attrs[0], + MSG_SIZE, (long long) bogus_attrs[3], errstr); rc = syscall(__NR_mq_getsetattr, fd, NULL, bogus_attrs); if (rc < 0) diff --git a/tests/mq_sendrecv.gen.test b/tests/mq_sendrecv.gen.test new file mode 100755 index 00000000..d82576f9 --- /dev/null +++ b/tests/mq_sendrecv.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (mq_sendrecv -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink diff --git a/tests/mq_sendrecv.test b/tests/mq_sendrecv.test deleted file mode 100755 index 67f4d63c..00000000 --- a/tests/mq_sendrecv.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of mq_open, mq_notify, mq_timedsend, mq_timedreceive syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=mq_open,mq_notify,mq_timedsend,mq_timedreceive,mq_unlink -a14 diff --git a/tests/msg_control-v.gen.test b/tests/msg_control-v.gen.test new file mode 100755 index 00000000..0a0de15e --- /dev/null +++ b/tests/msg_control-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (msg_control-v -v -a21 -e trace=sendmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -a21 -e trace=sendmsg diff --git a/tests/msg_control-v.test b/tests/msg_control-v.test deleted file mode 100755 index 41f98428..00000000 --- a/tests/msg_control-v.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check verbose decoding of struct msghdr ancillary data. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -a21 -e trace=sendmsg diff --git a/tests/msg_control.c b/tests/msg_control.c index 709a3075..a4a32a88 100644 --- a/tests/msg_control.c +++ b/tests/msg_control.c @@ -2,29 +2,10 @@ * Check decoding of struct msghdr ancillary data. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -39,6 +20,17 @@ #include #include +#if defined HAVE_STRUCT___KERNEL_SOCK_TIMEVAL \ + || defined HAVE_STRUCT___KERNEL_TIMESPEC +# include +#endif + +#include "xlat.h" +#define XLAT_MACROS_ONLY +#include "xlat/sock_options.h" +#include "xlat/scmvals.h" +#undef XLAT_MACROS_ONLY + #ifndef SOL_IP # define SOL_IP 0 #endif @@ -46,10 +38,6 @@ # define SOL_TCP 6 #endif -#ifndef SCM_SECURITY -# define SCM_SECURITY 3 -#endif - #define MIN_SIZE_OF(type, member) \ (offsetof(type, member) + sizeof(((type *) 0)->member)) @@ -59,8 +47,6 @@ get_cmsghdr(void *const page, const size_t len) return page - CMSG_ALIGN(len); } -#define DEFAULT_STRLEN 32 - static void print_fds(const struct cmsghdr *const cmsg, const size_t cmsg_len) { @@ -130,7 +116,7 @@ test_scm_rights1(struct msghdr *const mh, print_fds(cmsg, src_len); printf("}"); if (aligned_cms_len < msg_controllen) - printf(", %p", (void *) cmsg + aligned_cms_len); + printf(", ... /* %p */", (void *) cmsg + aligned_cms_len); printf("]"); } @@ -193,7 +179,7 @@ test_scm_rights2(struct msghdr *const mh, print_fds(cmsg[1], src1_len); printf("}"); if (aligned_cms_len[1] < msg_controllen1) - printf(", %p", (void *) cmsg[1] + aligned_cms_len[1]); + printf(", ... /* %p */", (void *) cmsg[1] + aligned_cms_len[1]); printf("]"); errno = saved_errno; @@ -228,6 +214,308 @@ test_scm_rights3(struct msghdr *const mh, void *const page, const size_t nfds) (unsigned long) len, rc, errno2name()); } +static void +test_scm_timestamp_old(struct msghdr *const mh, void *const page) +{ + size_t len = CMSG_SPACE(sizeof(struct timeval)); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct timeval)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMP_OLD; + struct timeval *tv = (struct timeval *) CMSG_DATA(cmsg); + tv->tv_sec = 123456789; + tv->tv_usec = 987654; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMP_OLD" + ", cmsg_data={tv_sec=%lld, tv_usec=%llu}}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, + (long long) tv->tv_sec, zero_extend_signed_to_ull(tv->tv_usec), + (unsigned long) len, rc, errno2name()); + + len = CMSG_SPACE(sizeof(struct timeval) - sizeof(long)); + cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct timeval) - sizeof(long)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMP_OLD; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMP_OLD, cmsg_data=?}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, + (unsigned long) len, rc, errno2name()); +} + +static void +test_scm_timestampns_old(struct msghdr *const mh, void *const page) +{ + size_t len = CMSG_SPACE(sizeof(struct timespec)); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct timespec)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPNS_OLD; + struct timespec *ts = (struct timespec *) CMSG_DATA(cmsg); + ts->tv_sec = 123456789; + ts->tv_nsec = 987654321; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPNS_OLD" + ", cmsg_data={tv_sec=%lld, tv_nsec=%llu}}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, + (long long) ts->tv_sec, zero_extend_signed_to_ull(ts->tv_nsec), + (unsigned long) len, rc, errno2name()); + + len = CMSG_SPACE(sizeof(struct timespec) - sizeof(long)); + cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct timespec) - sizeof(long)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPNS_OLD; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPNS_OLD" + ", cmsg_data=?}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, + (unsigned long) len, rc, errno2name()); +} + +static void +test_scm_timestamping_old(struct msghdr *const mh, void *const page) +{ + size_t len = CMSG_SPACE(3 * sizeof(struct timespec)); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(3 * sizeof(struct timespec)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPING_OLD; + struct timespec *ts = (struct timespec *) CMSG_DATA(cmsg); + ts[0].tv_sec = 123456789; + ts[0].tv_nsec = 987654321; + ts[1].tv_sec = 123456790; + ts[1].tv_nsec = 987654320; + ts[2].tv_sec = 123456791; + ts[2].tv_nsec = 987654319; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPING_OLD" + ", cmsg_data=[{tv_sec=%lld, tv_nsec=%llu}" + ", {tv_sec=%lld, tv_nsec=%llu}, {tv_sec=%lld, tv_nsec=%llu}]}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, (long long) ts[0].tv_sec, + zero_extend_signed_to_ull(ts[0].tv_nsec), + (long long) ts[1].tv_sec, + zero_extend_signed_to_ull(ts[1].tv_nsec), + (long long) ts[2].tv_sec, + zero_extend_signed_to_ull(ts[2].tv_nsec), + (unsigned long) len, rc, errno2name()); + + len = CMSG_SPACE(3 * sizeof(struct timespec) - sizeof(long)); + cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(3 * sizeof(struct timespec) - sizeof(long)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPING_OLD; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPING_OLD" + ", cmsg_data=?}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %d %s (%m)\n", + (unsigned) cmsg->cmsg_len, + (unsigned long) len, rc, errno2name()); +} + +#ifdef HAVE_STRUCT___KERNEL_SOCK_TIMEVAL +static void +test_scm_timestamp_new(struct msghdr *const mh, void *const page) +{ + size_t len = CMSG_SPACE(sizeof(struct __kernel_sock_timeval)); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct __kernel_sock_timeval)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMP_NEW; + struct __kernel_sock_timeval *tv = + (struct __kernel_sock_timeval *) CMSG_DATA(cmsg); + tv->tv_sec = 0xdefaceddeadbeef; + tv->tv_usec = 0xdec0dedcafef00d; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMP_NEW" + ", cmsg_data={tv_sec=%lld, tv_usec=%llu}}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %s\n", + (unsigned) cmsg->cmsg_len, + (long long) tv->tv_sec, zero_extend_signed_to_ull(tv->tv_usec), + (unsigned long) len, sprintrc(rc)); + + len = CMSG_SPACE(sizeof(struct __kernel_sock_timeval) - sizeof(long)); + cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = + CMSG_LEN(sizeof(struct __kernel_sock_timeval) - sizeof(long)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMP_NEW; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMP_NEW, cmsg_data=?}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %s\n", + (unsigned) cmsg->cmsg_len, + (unsigned long) len, sprintrc(rc)); +} +#endif /* HAVE_STRUCT___KERNEL_SOCK_TIMEVAL */ + +#ifdef HAVE_STRUCT___KERNEL_TIMESPEC +static void +test_scm_timestampns_new(struct msghdr *const mh, void *const page) +{ + size_t len = CMSG_SPACE(sizeof(struct __kernel_timespec)); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(sizeof(struct __kernel_timespec)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPNS_NEW; + struct __kernel_timespec *ts = + (struct __kernel_timespec *) CMSG_DATA(cmsg); + ts->tv_sec = 0xdefaceddeadbeef; + ts->tv_nsec = 0xdec0dedcafef00d; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPNS_NEW" + ", cmsg_data={tv_sec=%lld, tv_nsec=%llu}}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %s\n", + (unsigned) cmsg->cmsg_len, + (long long) ts->tv_sec, zero_extend_signed_to_ull(ts->tv_nsec), + (unsigned long) len, sprintrc(rc)); + + len = CMSG_SPACE(sizeof(struct __kernel_timespec) - sizeof(long)); + cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = + CMSG_LEN(sizeof(struct __kernel_timespec) - sizeof(long)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPNS_NEW; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPNS_NEW" + ", cmsg_data=?}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %s\n", + (unsigned) cmsg->cmsg_len, + (unsigned long) len, sprintrc(rc)); +} + +static void +test_scm_timestamping_new(struct msghdr *const mh, void *const page) +{ + size_t len = CMSG_SPACE(3 * sizeof(struct __kernel_timespec)); + struct cmsghdr *cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = CMSG_LEN(3 * sizeof(struct __kernel_timespec)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPING_NEW; + struct __kernel_timespec *ts = + (struct __kernel_timespec *) CMSG_DATA(cmsg); + ts[0].tv_sec = 0xdeface0deadbef1; + ts[0].tv_nsec = 0xdec0de2cafef0d3; + ts[1].tv_sec = 0xdeface4deadbef5; + ts[1].tv_nsec = 0xdec0de6cafef0d7; + ts[2].tv_sec = 0xdeface8deadbef9; + ts[2].tv_nsec = 0xdec0dedcafef00d; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + int rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPING_NEW" + ", cmsg_data=[{tv_sec=%lld, tv_nsec=%llu}" + ", {tv_sec=%lld, tv_nsec=%llu}, {tv_sec=%lld, tv_nsec=%llu}]}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %s\n", + (unsigned) cmsg->cmsg_len, (long long) ts[0].tv_sec, + zero_extend_signed_to_ull(ts[0].tv_nsec), + (long long) ts[1].tv_sec, + zero_extend_signed_to_ull(ts[1].tv_nsec), + (long long) ts[2].tv_sec, + zero_extend_signed_to_ull(ts[2].tv_nsec), + (unsigned long) len, sprintrc(rc)); + + len = CMSG_SPACE(3 * sizeof(struct __kernel_timespec) - sizeof(long)); + cmsg = get_cmsghdr(page, len); + + cmsg->cmsg_len = + CMSG_LEN(3 * sizeof(struct __kernel_timespec) - sizeof(long)); + cmsg->cmsg_level = SOL_SOCKET; + cmsg->cmsg_type = SO_TIMESTAMPING_NEW; + + mh->msg_control = cmsg; + mh->msg_controllen = len; + + rc = sendmsg(-1, mh, 0); + printf("sendmsg(-1, {msg_name=NULL, msg_namelen=0, msg_iov=NULL" + ", msg_iovlen=0, msg_control=[{cmsg_len=%u" + ", cmsg_level=SOL_SOCKET, cmsg_type=SO_TIMESTAMPING_NEW" + ", cmsg_data=?}]" + ", msg_controllen=%lu, msg_flags=0}, 0) = %s\n", + (unsigned) cmsg->cmsg_len, + (unsigned long) len, sprintrc(rc)); +} +#endif /* HAVE_STRUCT___KERNEL_TIMESPEC */ + static void print_security(const struct cmsghdr *const cmsg, const size_t cmsg_len) { @@ -277,7 +565,7 @@ test_scm_security(struct msghdr *const mh, print_security(cmsg, src_len); printf("}"); if (aligned_cms_len < msg_controllen) - printf(", %p", (void *) cmsg + aligned_cms_len); + printf(", ... /* %p */", (void *) cmsg + aligned_cms_len); printf("]"); errno = saved_errno; @@ -377,12 +665,23 @@ test_sol_socket(struct msghdr *const mh, void *const page) test_scm_rights3(mh, page, DEFAULT_STRLEN); test_scm_rights3(mh, page, DEFAULT_STRLEN + 1); + test_scm_timestamp_old(mh, page); + test_scm_timestampns_old(mh, page); + test_scm_timestamping_old(mh, page); +#ifdef HAVE_STRUCT___KERNEL_SOCK_TIMEVAL + test_scm_timestamp_new(mh, page); +#endif +#ifdef HAVE_STRUCT___KERNEL_TIMESPEC + test_scm_timestampns_new(mh, page); + test_scm_timestamping_new(mh, page); +#endif + test_unknown_type(mh, page, ARG_STR(SOL_SOCKET), "SCM_???"); } static void test_ip_pktinfo(struct msghdr *const mh, void *const page, - const int cmsg_type, const char *const cmsg_type_str) + const int cmsg_type, const char *const cmsg_type_str) { const unsigned int len = CMSG_SPACE(sizeof(struct in_pktinfo)); struct cmsghdr *const cmsg = get_cmsghdr(page, len); @@ -392,11 +691,7 @@ test_ip_pktinfo(struct msghdr *const mh, void *const page, cmsg->cmsg_type = cmsg_type; struct in_pktinfo *const info = (struct in_pktinfo *) CMSG_DATA(cmsg); -#ifdef HAVE_IF_INDEXTONAME - info->ipi_ifindex = if_nametoindex("lo"); -#else - info->ipi_ifindex = 1; -#endif + info->ipi_ifindex = ifindex_lo(); info->ipi_spec_dst.s_addr = inet_addr("1.2.3.4"); info->ipi_addr.s_addr = inet_addr("5.6.7.8"); @@ -411,12 +706,7 @@ test_ip_pktinfo(struct msghdr *const mh, void *const page, ", ipi_addr=inet_addr(\"%s\")}}]" ", msg_controllen=%u, msg_flags=0}, 0) = %d %s (%m)\n", (unsigned) cmsg->cmsg_len, cmsg_type_str, -#ifdef HAVE_IF_INDEXTONAME - "if_nametoindex(\"lo\")", -#else - "1", -#endif - "1.2.3.4", "5.6.7.8", len, rc, errno2name()); + IFINDEX_LO_STR, "1.2.3.4", "5.6.7.8", len, rc, errno2name()); } static void @@ -447,7 +737,7 @@ test_ip_uint(struct msghdr *const mh, void *const page, static void test_ip_uint8_t(struct msghdr *const mh, void *const page, - const int cmsg_type, const char *const cmsg_type_str) + const int cmsg_type, const char *const cmsg_type_str) { const unsigned int len = CMSG_SPACE(1); struct cmsghdr *const cmsg = get_cmsghdr(page, len); @@ -529,7 +819,7 @@ struct sock_ee { static void test_ip_recverr(struct msghdr *const mh, void *const page, - const int cmsg_type, const char *const cmsg_type_str) + const int cmsg_type, const char *const cmsg_type_str) { const unsigned int len = CMSG_SPACE(sizeof(struct sock_ee)); struct cmsghdr *const cmsg = get_cmsghdr(page, len); @@ -689,7 +979,7 @@ int main(int ac, const char **av) int rc = sendmsg(-1, 0, 0); printf("sendmsg(-1, NULL, 0) = %d %s (%m)\n", rc, errno2name()); - struct msghdr *mh = tail_alloc(sizeof(*mh)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct msghdr, mh); memset(mh, 0, sizeof(*mh)); test_big_len(mh); diff --git a/tests/msg_control.gen.test b/tests/msg_control.gen.test new file mode 100755 index 00000000..446ebcb3 --- /dev/null +++ b/tests/msg_control.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (msg_control -a21 -e trace=sendmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 -e trace=sendmsg diff --git a/tests/msg_control.test b/tests/msg_control.test deleted file mode 100755 index 809ec7bb..00000000 --- a/tests/msg_control.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of struct msghdr ancillary data. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a21 -e trace=sendmsg diff --git a/tests/msg_name.c b/tests/msg_name.c index c2ddda2a..d4973e08 100644 --- a/tests/msg_name.c +++ b/tests/msg_name.c @@ -2,29 +2,10 @@ * Check decoding of struct msghdr.msg_name* arguments of recvmsg syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -47,13 +28,13 @@ send_recv(const int send_fd, const int recv_fd, static void test_msg_name(const int send_fd, const int recv_fd) { - char *const recv_buf = tail_alloc(sizeof(*recv_buf)); - struct iovec *const iov = tail_alloc(sizeof(*iov)); + TAIL_ALLOC_OBJECT_CONST_PTR(char, recv_buf); + TAIL_ALLOC_OBJECT_CONST_PTR(struct iovec, iov); iov->iov_base = recv_buf; iov->iov_len = sizeof(*recv_buf); - struct sockaddr_un *const addr = tail_alloc(sizeof(*addr)); - struct msghdr *const msg = tail_alloc(sizeof(*msg)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sockaddr_un, addr); + TAIL_ALLOC_OBJECT_CONST_PTR(struct msghdr, msg); msg->msg_name = addr; msg->msg_namelen = sizeof(*addr); msg->msg_iov = iov; diff --git a/tests/msg_name.gen.test b/tests/msg_name.gen.test new file mode 100755 index 00000000..2d0ae902 --- /dev/null +++ b/tests/msg_name.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (msg_name -a20 -e trace=recvmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -e trace=recvmsg diff --git a/tests/msg_name.test b/tests/msg_name.test deleted file mode 100755 index ac06dd55..00000000 --- a/tests/msg_name.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of struct msghdr.msg_name* arguments of recvmsg syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 -e trace=recvmsg diff --git a/tests/munlockall.c b/tests/munlockall.c index 9ac69423..0f103c8f 100644 --- a/tests/munlockall.c +++ b/tests/munlockall.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -6,7 +13,7 @@ int main(void) { - printf("munlockall() = %d\n", munlockall()); + printf("munlockall() = %s\n", sprintrc(munlockall())); puts("+++ exited with 0 +++"); return 0; diff --git a/tests/munlockall.gen.test b/tests/munlockall.gen.test new file mode 100755 index 00000000..2e4e0c4f --- /dev/null +++ b/tests/munlockall.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (munlockall -a13 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 diff --git a/tests/munlockall.test b/tests/munlockall.test deleted file mode 100755 index e25d60a8..00000000 --- a/tests/munlockall.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check munlockall syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a13 diff --git a/tests/nanosleep.c b/tests/nanosleep.c index 9f0e626f..c7ebf496 100644 --- a/tests/nanosleep.c +++ b/tests/nanosleep.c @@ -1,28 +1,11 @@ /* + * Check decoding of nanosleep syscall. + * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -57,40 +40,62 @@ main(void) if (nanosleep(&req.ts, NULL)) perror_msg_and_fail("nanosleep"); - printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, NULL) = 0\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec); + printf("nanosleep({tv_sec=%lld, tv_nsec=%llu}, NULL) = 0\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec)); assert(nanosleep(NULL, &rem.ts) == -1); printf("nanosleep(NULL, %p) = -1 EFAULT (%m)\n", &rem.ts); if (nanosleep(&req.ts, &rem.ts)) perror_msg_and_fail("nanosleep"); - printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, %p) = 0\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + printf("nanosleep({tv_sec=%lld, tv_nsec=%llu}, %p) = 0\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); req.ts.tv_nsec = 1000000000; assert(nanosleep(&req.ts, &rem.ts) == -1); - printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, %p) = -1 EINVAL (%m)\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, &rem.ts); + printf("nanosleep({tv_sec=%lld, tv_nsec=%llu}, %p) = -1 EINVAL (%m)\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); + + req.ts.tv_sec = 0xdeadbeefU; + req.ts.tv_nsec = 0xfacefeedU; + assert(nanosleep(&req.ts, &rem.ts) == -1); + printf("nanosleep({tv_sec=%lld, tv_nsec=%llu}, %p) = -1 EINVAL (%m)\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); + + req.ts.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + req.ts.tv_nsec = (long) 0xbadc0dedfacefeedLL; + assert(nanosleep(&req.ts, &rem.ts) == -1); + printf("nanosleep({tv_sec=%lld, tv_nsec=%llu}, %p) = -1 EINVAL (%m)\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); + + req.ts.tv_sec = -1; + req.ts.tv_nsec = -1; + assert(nanosleep(&req.ts, &rem.ts) == -1); + printf("nanosleep({tv_sec=%lld, tv_nsec=%llu}, %p) = -1 EINVAL (%m)\n", + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), &rem.ts); assert(sigaction(SIGALRM, &act, NULL) == 0); assert(sigprocmask(SIG_SETMASK, &set, NULL) == 0); if (setitimer(ITIMER_REAL, &itv, NULL)) perror_msg_and_skip("setitimer"); - printf("setitimer(ITIMER_REAL, {it_interval={tv_sec=%jd, tv_usec=%jd}" - ", it_value={tv_sec=%jd, tv_usec=%jd}}, NULL) = 0\n", - (intmax_t) itv.it_interval.tv_sec, - (intmax_t) itv.it_interval.tv_usec, - (intmax_t) itv.it_value.tv_sec, - (intmax_t) itv.it_value.tv_usec); + req.ts.tv_sec = 0; req.ts.tv_nsec = 999999999; assert(nanosleep(&req.ts, &rem.ts) == -1); - printf("nanosleep({tv_sec=%jd, tv_nsec=%jd}, {tv_sec=%jd, tv_nsec=%jd})" + printf("nanosleep({tv_sec=%lld, tv_nsec=%llu}" + ", {tv_sec=%lld, tv_nsec=%llu})" " = ? ERESTART_RESTARTBLOCK (Interrupted by signal)\n", - (intmax_t) req.ts.tv_sec, (intmax_t) req.ts.tv_nsec, - (intmax_t) rem.ts.tv_sec, (intmax_t) rem.ts.tv_nsec); + (long long) req.ts.tv_sec, + zero_extend_signed_to_ull(req.ts.tv_nsec), + (long long) rem.ts.tv_sec, + zero_extend_signed_to_ull(rem.ts.tv_nsec)); puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); puts("+++ exited with 0 +++"); diff --git a/tests/nanosleep.gen.test b/tests/nanosleep.gen.test new file mode 100755 index 00000000..41928ded --- /dev/null +++ b/tests/nanosleep.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nanosleep -a20 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests/nanosleep.test b/tests/nanosleep.test deleted file mode 100755 index 055a8dcd..00000000 --- a/tests/nanosleep.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check nanosleep and setitimer syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 -e trace=nanosleep,setitimer diff --git a/tests/net-accept-connect.c b/tests/net-accept-connect.c index 04c05a60..326cd8c1 100644 --- a/tests/net-accept-connect.c +++ b/tests/net-accept-connect.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2013-2016 Dmitry V. Levin + * Copyright (c) 2013-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -48,15 +29,16 @@ main(int ac, const char **av) struct sockaddr_un addr = { .sun_family = AF_UNIX, }; - socklen_t len; assert(ac == 2); - assert(strlen(av[1]) > 0); + socklen_t len = strlen(av[1]); + assert(len > 0 && len <= sizeof(addr.sun_path)); - strncpy(addr.sun_path, av[1], sizeof(addr.sun_path)); - len = offsetof(struct sockaddr_un, sun_path) + strlen(av[1]) + 1; - if (len > sizeof(addr)) - len = sizeof(addr); + if (++len > sizeof(addr.sun_path)) + len = sizeof(addr.sun_path); + + memcpy(addr.sun_path, av[1], len); + len += offsetof(struct sockaddr_un, sun_path); unlink(av[1]); close(0); @@ -69,7 +51,7 @@ main(int ac, const char **av) if (listen(0, 5)) perror_msg_and_skip("listen"); - memset(&addr, 0, sizeof addr); + memset(&addr, 0, sizeof(addr)); assert(getsockname(0, (struct sockaddr *) &addr, &len) == 0); if (len > sizeof(addr)) len = sizeof(addr); diff --git a/tests/net-icmp_filter.c b/tests/net-icmp_filter.c index f3f99f14..81b24293 100644 --- a/tests/net-icmp_filter.c +++ b/tests/net-icmp_filter.c @@ -2,29 +2,10 @@ * Check decoding of ICMP_FILTER. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -43,13 +24,13 @@ main(void) printf("setsockopt(-1, SOL_RAW, ICMP_FILTER, NULL, 0) = -1 %s (%m)\n", errno2name()); - socklen_t *const plen = tail_alloc(sizeof(*plen)); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, plen); void *const efault = plen + 1; - struct icmp_filter *const f = tail_alloc(sizeof(*f)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct icmp_filter, f); getsockopt(-1, SOL_RAW, ICMP_FILTER, f, plen); - printf("getsockopt(-1, SOL_RAW, ICMP_FILTER, %p, %p) = -1 %s (%m)\n", - f, plen, errno2name()); + printf("getsockopt(-1, SOL_RAW, ICMP_FILTER, %p, [%d]) = -1 %s (%m)\n", + f, *plen, errno2name()); setsockopt(-1, SOL_RAW, ICMP_FILTER, efault, sizeof(*f)); printf("setsockopt(-1, SOL_RAW, ICMP_FILTER, %p, %u) = -1 %s (%m)\n", diff --git a/tests/net-icmp_filter.gen.test b/tests/net-icmp_filter.gen.test new file mode 100755 index 00000000..bf6c765f --- /dev/null +++ b/tests/net-icmp_filter.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-icmp_filter -e trace=getsockopt,setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt,setsockopt diff --git a/tests/net-icmp_filter.test b/tests/net-icmp_filter.test deleted file mode 100755 index c05a5e65..00000000 --- a/tests/net-icmp_filter.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of ICMP_FILTER. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=getsockopt,setsockopt diff --git a/tests/net-packet_mreq-Xabbrev.c b/tests/net-packet_mreq-Xabbrev.c new file mode 100644 index 00000000..027bf5a4 --- /dev/null +++ b/tests/net-packet_mreq-Xabbrev.c @@ -0,0 +1 @@ +#include "net-packet_mreq.c" diff --git a/tests/net-packet_mreq-Xabbrev.gen.test b/tests/net-packet_mreq-Xabbrev.gen.test new file mode 100755 index 00000000..66c5243b --- /dev/null +++ b/tests/net-packet_mreq-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-packet_mreq-Xabbrev -e trace=setsockopt -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt -Xabbrev diff --git a/tests/net-packet_mreq-Xraw.c b/tests/net-packet_mreq-Xraw.c new file mode 100644 index 00000000..0b041c3e --- /dev/null +++ b/tests/net-packet_mreq-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "net-packet_mreq.c" diff --git a/tests/net-packet_mreq-Xraw.gen.test b/tests/net-packet_mreq-Xraw.gen.test new file mode 100755 index 00000000..67ba710f --- /dev/null +++ b/tests/net-packet_mreq-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-packet_mreq-Xraw -e trace=setsockopt -Xraw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt -Xraw diff --git a/tests/net-packet_mreq-Xverbose.c b/tests/net-packet_mreq-Xverbose.c new file mode 100644 index 00000000..02185bab --- /dev/null +++ b/tests/net-packet_mreq-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "net-packet_mreq.c" diff --git a/tests/net-packet_mreq-Xverbose.gen.test b/tests/net-packet_mreq-Xverbose.gen.test new file mode 100755 index 00000000..d1c96342 --- /dev/null +++ b/tests/net-packet_mreq-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-packet_mreq-Xverbose -e trace=setsockopt -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt -Xverbose diff --git a/tests/net-packet_mreq.c b/tests/net-packet_mreq.c new file mode 100644 index 00000000..6b64e9eb --- /dev/null +++ b/tests/net-packet_mreq.c @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +static const char *errstr; + +static long +packet_mreq_membership(int optname, void *optval, socklen_t len) +{ + long rc = setsockopt(-1, SOL_PACKET, optname, optval, len); + errstr = sprintrc(rc); + return rc; +} + +static void +test_packet_mreq(const int optname, const char *const optname_str) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct packet_mreq, pmreq); + socklen_t len = sizeof(struct packet_mreq); + + /* setsockopt with optname unknown */ + packet_mreq_membership(-1, NULL, 0); +#if XLAT_RAW + printf("setsockopt(-1, %#x, %#x, NULL, 0) = %s\n", + SOL_PACKET, -1, errstr); +#elif XLAT_VERBOSE + printf("setsockopt(-1, %#x /* SOL_PACKET */, %#x /* PACKET_??? */" + ", NULL, 0) = %s\n", SOL_PACKET, -1, errstr); +#else + printf("setsockopt(-1, SOL_PACKET, %#x /* PACKET_??? */, NULL, 0) = %s\n", + -1, errstr); +#endif + + /* setsockopt with mr_type unknown */ + pmreq->mr_ifindex = 0; + pmreq->mr_alen = ARRAY_SIZE(pmreq->mr_address); + packet_mreq_membership(optname, pmreq, len); +#if XLAT_RAW + printf("setsockopt(-1, %#x, %#x, {mr_ifindex=%d," + " mr_type=%#x, mr_alen=%d, mr_address=", + SOL_PACKET, optname, pmreq->mr_ifindex, + pmreq->mr_type, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, + ARRAY_SIZE(pmreq->mr_address)); + printf("}, %d) = %s\n", len, errstr); +#elif XLAT_VERBOSE + printf("setsockopt(-1, %#x /* SOL_PACKET */, %#x /* %s */" + ", {mr_ifindex=%d, mr_type=%#x /* PACKET_MR_??? */" + ", mr_alen=%d, mr_address=", + SOL_PACKET, optname, optname_str, pmreq->mr_ifindex, + pmreq->mr_type, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, + ARRAY_SIZE(pmreq->mr_address)); + printf(" /* "); + for (unsigned int i = 0; i < ARRAY_SIZE(pmreq->mr_address); i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf(" */}, %d) = %s\n", len, errstr); +#else + printf("setsockopt(-1, SOL_PACKET, %s, {mr_ifindex=%d," + " mr_type=%#x /* PACKET_MR_??? */, mr_alen=%d, mr_address=", + optname_str, pmreq->mr_ifindex, pmreq->mr_type, pmreq->mr_alen); + for (unsigned int i = 0; i < ARRAY_SIZE(pmreq->mr_address); i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf("}, %d) = %s\n", len, errstr); +#endif + + /* setsockopt with mr_type unknown and mr_alen > sizeof(mr_address) */ + pmreq->mr_alen = ARRAY_SIZE(pmreq->mr_address) + 1; + packet_mreq_membership(optname, pmreq, len); +#if XLAT_RAW + printf("setsockopt(-1, %#x, %#x, {mr_ifindex=%d," + " mr_type=%#x, mr_alen=%d, mr_address=", + SOL_PACKET, optname, pmreq->mr_ifindex, + pmreq->mr_type, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, + ARRAY_SIZE(pmreq->mr_address)); + printf("}, %d) = %s\n", len, errstr); +#elif XLAT_VERBOSE + printf("setsockopt(-1, %#x /* SOL_PACKET */, %#x /* %s */" + ", {mr_ifindex=%d, mr_type=%#x /* PACKET_MR_??? */" + ", mr_alen=%d, mr_address=", + SOL_PACKET, optname, optname_str, pmreq->mr_ifindex, + pmreq->mr_type, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, + ARRAY_SIZE(pmreq->mr_address)); + printf(" /* "); + for (unsigned int i = 0; i < ARRAY_SIZE(pmreq->mr_address); i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf(" */}, %d) = %s\n", len, errstr); +#else + printf("setsockopt(-1, SOL_PACKET, %s, {mr_ifindex=%d," + " mr_type=%#x /* PACKET_MR_??? */, mr_alen=%d, mr_address=", + optname_str, pmreq->mr_ifindex, pmreq->mr_type, pmreq->mr_alen); + for (unsigned int i = 0; i < ARRAY_SIZE(pmreq->mr_address); i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf("}, %d) = %s\n", len, errstr); +#endif + + /* setsockopt with mr_type unknown and mr_alen < sizeof(mr_address) */ + pmreq->mr_alen = ARRAY_SIZE(pmreq->mr_address) - 1; + packet_mreq_membership(optname, pmreq, len); +#if XLAT_RAW + printf("setsockopt(-1, %#x, %#x, {mr_ifindex=%d," + " mr_type=%#x, mr_alen=%d, mr_address=", + SOL_PACKET, optname, pmreq->mr_ifindex, + pmreq->mr_type, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, pmreq->mr_alen); + printf("}, %d) = %s\n", len, errstr); +#elif XLAT_VERBOSE + printf("setsockopt(-1, %#x /* SOL_PACKET */, %#x /* %s */" + ", {mr_ifindex=%d, mr_type=%#x /* PACKET_MR_??? */" + ", mr_alen=%d, mr_address=", + SOL_PACKET, optname, optname_str, pmreq->mr_ifindex, + pmreq->mr_type, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, pmreq->mr_alen); + printf(" /* "); + for (unsigned int i = 0; i < pmreq->mr_alen; i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf(" */}, %d) = %s\n", len, errstr); +#else + printf("setsockopt(-1, SOL_PACKET, %s, {mr_ifindex=%d," + " mr_type=%#x /* PACKET_MR_??? */, mr_alen=%d, mr_address=", + optname_str, pmreq->mr_ifindex, pmreq->mr_type, pmreq->mr_alen); + for (unsigned int i = 0; i < pmreq->mr_alen; i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf("}, %d) = %s\n", len, errstr); +#endif + + /* setsockopt with valid mr_type */ + pmreq->mr_alen = ARRAY_SIZE(pmreq->mr_address); + static const struct { + unsigned short type; + const char *const type_str; + } a[] = { + { ARG_STR(PACKET_MR_MULTICAST) }, + { ARG_STR(PACKET_MR_PROMISC) }, + { ARG_STR(PACKET_MR_ALLMULTI) }, +#ifdef PACKET_MR_UNICAST + { ARG_STR(PACKET_MR_UNICAST) }, +#endif + }; + + for (unsigned int i = 0; i < ARRAY_SIZE(a); i++) { + pmreq->mr_type = a[i].type; + packet_mreq_membership(optname, pmreq, len); +#if XLAT_RAW + printf("setsockopt(-1, %#x, %#x, {mr_ifindex=%d," + " mr_type=%#x, mr_alen=%d, mr_address=", + SOL_PACKET, optname, pmreq->mr_ifindex, + pmreq->mr_type, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, pmreq->mr_alen); + printf("}, %d) = %s\n", len, errstr); +#elif XLAT_VERBOSE + printf("setsockopt(-1, %#x /* SOL_PACKET */, %#x /* %s */" + ", {mr_ifindex=%d, mr_type=%#x /* %s */" + ", mr_alen=%d, mr_address=", + SOL_PACKET, optname, optname_str, pmreq->mr_ifindex, + pmreq->mr_type, a[i].type_str, pmreq->mr_alen); + print_quoted_hex((const void *) pmreq->mr_address, pmreq->mr_alen); + printf(" /* "); + for (unsigned int i = 0; i < pmreq->mr_alen; i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf(" */}, %d) = %s\n", len, errstr); +#else + printf("setsockopt(-1, SOL_PACKET, %s, {mr_ifindex=%d," + " mr_type=%s, mr_alen=%d, mr_address=", + optname_str, pmreq->mr_ifindex, a[i].type_str, pmreq->mr_alen); + for (unsigned int i = 0; i < pmreq->mr_alen; i++) + printf("%s%02x", i > 0 ? ":" : "", pmreq->mr_address[i]); + printf("}, %d) = %s\n", len, errstr); +#endif + } + + /* setsockopt with optlen larger than usual */ + len = len + 1; + packet_mreq_membership(optname, pmreq, len); +#if XLAT_RAW + printf("setsockopt(-1, %#x, %#x, %p, %d) = %s\n", + SOL_PACKET, optname, pmreq, len, errstr); +#elif XLAT_VERBOSE + printf("setsockopt(-1, %#x /* SOL_PACKET */, %#x /* %s */" + ", %p, %d) = %s\n", SOL_PACKET, optname, optname_str, + pmreq, len, errstr); +#else + printf("setsockopt(-1, SOL_PACKET, %s, %p," + " %d) = %s\n", optname_str, pmreq, len, errstr); +#endif +} + +int +main(void) +{ + test_packet_mreq(ARG_STR(PACKET_ADD_MEMBERSHIP)); + test_packet_mreq(ARG_STR(PACKET_DROP_MEMBERSHIP)); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/net-packet_mreq.gen.test b/tests/net-packet_mreq.gen.test new file mode 100755 index 00000000..9dd034a9 --- /dev/null +++ b/tests/net-packet_mreq.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-packet_mreq -e trace=setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt diff --git a/tests/net-sockaddr.c b/tests/net-sockaddr.c index bf37779f..cd973922 100644 --- a/tests/net-sockaddr.c +++ b/tests/net-sockaddr.c @@ -2,29 +2,10 @@ * Check decoding of sockaddr structures * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,11 +17,13 @@ #include #include #include +#include "netlink.h" +#include #include #include #include +#include #include -#include #ifdef HAVE_BLUETOOTH_BLUETOOTH_H # include # include @@ -49,15 +32,10 @@ # include #endif -#ifdef HAVE_IF_INDEXTONAME -/* used to conflict with */ -extern unsigned int if_nametoindex(const char *); -#endif - static void check_un(void) { - struct sockaddr_un *un = tail_alloc(sizeof(*un)); + TAIL_ALLOC_OBJECT_VAR_PTR(struct sockaddr_un, un); un->sun_family = AF_UNIX; memset(un->sun_path, '0', sizeof(un->sun_path)); unsigned int len = sizeof(*un); @@ -133,7 +111,7 @@ check_in(void) const unsigned short h_port = 12345; static const char h_addr[] = "12.34.56.78"; - struct sockaddr_in *in = tail_alloc(sizeof(*in)); + TAIL_ALLOC_OBJECT_VAR_PTR(struct sockaddr_in, in); in->sin_family = AF_INET; in->sin_port = htons(h_port); in->sin_addr.s_addr = inet_addr(h_addr); @@ -178,26 +156,24 @@ check_in6_linklocal(struct sockaddr_in6 *const in6, const char *const h_addr) unsigned int len = sizeof(*in6); int ret = connect(-1, (void *) in6, len); printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" - ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" ", sin6_flowinfo=htonl(%u)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" ", sin6_scope_id=%u}, %u)" " = %d EBADF (%m)\n", - ntohs(in6->sin6_port), h_addr, - ntohl(in6->sin6_flowinfo), in6->sin6_scope_id, len, ret); + ntohs(in6->sin6_port), ntohl(in6->sin6_flowinfo), + h_addr, in6->sin6_scope_id, len, ret); -#ifdef HAVE_IF_INDEXTONAME - in6->sin6_scope_id = if_nametoindex("lo"); + in6->sin6_scope_id = ifindex_lo(); if (in6->sin6_scope_id) { ret = connect(-1, (void *) in6, len); printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" - ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" ", sin6_flowinfo=htonl(%u)" - ", sin6_scope_id=if_nametoindex(\"lo\")}, %u)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" + ", sin6_scope_id=%s}, %u)" " = %d EBADF (%m)\n", - ntohs(in6->sin6_port), h_addr, - ntohl(in6->sin6_flowinfo), len, ret); + ntohs(in6->sin6_port), ntohl(in6->sin6_flowinfo), h_addr, + IFINDEX_LO_STR, len, ret); } -#endif } static void @@ -207,7 +183,7 @@ check_in6(void) const unsigned int h_flowinfo = 1234567890; static const char h_addr[] = "12:34:56:78:90:ab:cd:ef"; - struct sockaddr_in6 *in6 = tail_alloc(sizeof(*in6)); + TAIL_ALLOC_OBJECT_VAR_PTR(struct sockaddr_in6, in6); in6->sin6_family = AF_INET6; in6->sin6_port = htons(h_port); in6->sin6_flowinfo = htonl(h_flowinfo); @@ -216,10 +192,11 @@ check_in6(void) unsigned int len = sizeof(*in6); int ret = connect(-1, (void *) in6, len); printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", sin6_flowinfo=htonl(%u)" ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" - ", sin6_flowinfo=htonl(%u), sin6_scope_id=%u}, %u)" + ", sin6_scope_id=%u}, %u)" " = %d EBADF (%m)\n", - h_port, h_addr, h_flowinfo, in6->sin6_scope_id, len, ret); + h_port, h_flowinfo, h_addr, in6->sin6_scope_id, len, ret); check_in6_linklocal(in6, "fe80::"); check_in6_linklocal(in6, "ff42::"); @@ -233,10 +210,11 @@ check_in6(void) len = sizeof(*in6) + 4; ret = connect(-1, (void *) in6, len); printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", sin6_flowinfo=htonl(%u)" ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" - ", sin6_flowinfo=htonl(%u), sin6_scope_id=%u}, %u)" + ", sin6_scope_id=%u}, %u)" " = %d EBADF (%m)\n", - h_port, h_addr, h_flowinfo, in6->sin6_scope_id, len, ret); + h_port, h_flowinfo, h_addr, in6->sin6_scope_id, len, ret); in6 = ((void *) in6) + 4 + sizeof(in6->sin6_scope_id); in6->sin6_family = AF_INET6; @@ -246,10 +224,10 @@ check_in6(void) len = sizeof(*in6) - sizeof(in6->sin6_scope_id); ret = connect(-1, (void *) in6, len); printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" - ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" - ", sin6_flowinfo=htonl(%u)}, %u)" + ", sin6_flowinfo=htonl(%u)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)}, %u)" " = %d EBADF (%m)\n", - h_port, h_addr, h_flowinfo, len, ret); + h_port, h_flowinfo, h_addr, len, ret); in6 = ((void *) in6) + 4; in6->sin6_family = AF_INET6; @@ -295,10 +273,185 @@ check_ipx(void) c_ipx.sipx_type, len, ret); } +/* for a bit more compact AX.25 address definitions */ +#define AX25_ADDR(c_, s_) \ + { { (c_)[0] << 1, (c_)[1] << 1, (c_)[2] << 1, \ + (c_)[3] << 1, (c_)[4] << 1, (c_)[5] << 1, (s_) << 1 } } \ + /* End of AX25_ADDR definition */ + +static void +check_ax25(void) +{ + const struct full_sockaddr_ax25 ax25 = { + .fsa_ax25 = { + .sax25_family = AF_AX25, + .sax25_call = AX25_ADDR("VALID ", 13), + .sax25_ndigis = 8, + }, + .fsa_digipeater = { + AX25_ADDR("SPA CE", 0), + AX25_ADDR("SSID ", 16), + AX25_ADDR(" ", 0), + AX25_ADDR("NULL\0", 3), + AX25_ADDR("A-B-C", 4), + AX25_ADDR(",}]\"\\'", 5), + AX25_ADDR("DASH-0", 6), + AX25_ADDR("\n\tABCD", 7), + }, + }; + const ax25_address aux_addrs[] = { + AX25_ADDR("VALID2", 7), + AX25_ADDR("OK ", 15), + AX25_ADDR("FINE ", 2), + AX25_ADDR("smalls", 9), + }; + + enum { AX25_ALIGN = ALIGNOF(struct full_sockaddr_ax25), }; + size_t size = sizeof(ax25); + size_t surplus = ROUNDUP(sizeof(ax25_address), AX25_ALIGN); + void *sax_void = midtail_alloc(size, surplus); + struct full_sockaddr_ax25 *sax = sax_void; + long rc; + + fill_memory(sax, size); + sax->fsa_ax25.sax25_family = AF_AX25; + rc = connect(-1, sax_void, sizeof(struct sockaddr_ax25) - 1); + printf("connect(-1, {sa_family=AF_AX25, sa_data=\"\\202\\203\\204\\205" + "\\206\\207\\210\\211\\212\\213\\214\\215\\216\"}, %zu) = %s\n", + sizeof(struct sockaddr_ax25) - 1, sprintrc(rc)); + + memcpy(sax, &ax25, sizeof(ax25)); + rc = connect(-1, sax_void, sizeof(struct sockaddr_ax25)); + printf("connect(-1, {sa_family=AF_AX25, fsa_ax25={sax25_call=VALID-13" + ", sax25_ndigis=8}, fsa_digipeater=[/* ??? */]}, %zu) = %s\n", + sizeof(struct sockaddr_ax25), sprintrc(rc)); + + sax->fsa_ax25.sax25_ndigis = 0; + rc = connect(-1, sax_void, sizeof(struct sockaddr_ax25)); + printf("connect(-1, {sa_family=AF_AX25, sax25_call=VALID-13" + ", sax25_ndigis=0}, %zu) = %s\n", + sizeof(struct sockaddr_ax25), sprintrc(rc)); + + sax->fsa_ax25.sax25_ndigis = 8; + size = sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 3 + 1; + rc = connect(-1, sax_void, size); + printf("connect(-1, {sa_family=AF_AX25, fsa_ax25={sax25_call=VALID-13" + ", sax25_ndigis=8}, fsa_digipeater" + "=[{ax25_call=\"\\xa6\\xa0\\x82\\x40\\x86\\x8a\\x00\"" + "} /* SPA CE-0 */" + ", {ax25_call=\"\\xa6\\xa6\\x92\\x88\\x40\\x40\\x20\"" + "} /* SSID-0 */" + ", *" + ", /* ??? */], ...}, %zu) = %s\n", + size, sprintrc(rc)); + + sax->fsa_digipeater[2].ax25_call[6] = 0x4; + size = sizeof(struct sockaddr_ax25) + sizeof(ax25_address) * 4; + rc = connect(-1, sax_void, size); + printf("connect(-1, {sa_family=AF_AX25, fsa_ax25={sax25_call=VALID-13" + ", sax25_ndigis=8}, fsa_digipeater" + "=[{ax25_call=\"\\xa6\\xa0\\x82\\x40\\x86\\x8a\\x00\"" + "} /* SPA CE-0 */" + ", {ax25_call=\"\\xa6\\xa6\\x92\\x88\\x40\\x40\\x20\"" + "} /* SSID-0 */" + ", {ax25_call=\"\\x40\\x40\\x40\\x40\\x40\\x40\\x04\"} /* -2 */" + ", {ax25_call=\"\\x9c\\xaa\\x98\\x98\\x00\\x00\\x06\"}" + ", /* ??? */]}, %zu) = %s\n", + size, sprintrc(rc)); + + memcpy(sax->fsa_digipeater, aux_addrs, sizeof(aux_addrs)); + sax->fsa_digipeater[2].ax25_call[6] = 0xa5; + sax->fsa_digipeater[4].ax25_call[5] = 0x40; + for (size_t i = 0; i < 3; i++) { + size = sizeof(ax25) + sizeof(ax25_address) * (i / 2); + rc = connect(-1, sax_void, size); + printf("connect(-1, {sa_family=AF_AX25" + ", fsa_ax25={sax25_call=VALID-13, sax25_ndigis=%d}" + ", fsa_digipeater=[VALID2-7, OK-15, %s /* FINE-2 */" + ", {ax25_call=\"\\xe6\\xda\\xc2\\xd8\\xd8\\xe6\\x12\"" + "} /* smalls-9 */" + ", {ax25_call=\"\\x%s\\x%s\\x84\\x5a\\x86\\x40\\x08\"" + "} /* %sB-C-4 */" + ", {ax25_call=\"\\x58\\xfa\\xba\\x44\\x%s\\x%s\\x0a\"" + "}%s" + ", {ax25_call=\"\\x88\\x82\\xa6\\x90\\x5a\\x%s\\x0c\"" + "}%s" + "%s]%s}, %zu) = %s\n" + , sax->fsa_ax25.sax25_ndigis + , i + ? "{ax25_call=\"\\x8c\\x92\\x9c\\x8a\\x40\\x41\\x04\"}" + : "{ax25_call=\"\\x8c\\x92\\x9c\\x8a\\x40\\x40\\xa5\"}" + , i ? "40" : "82" + , i ? "40" : "5a" + , i ? " " : "A-" + , i ? "54" : "b8" + , i ? "5e" : "4e" + , i ? "" : " /* ,}]\"\\'-5 */" + , i ? "fe" : "60" + , i ? "" : " /* DASH-0-6 */" + , i == 1 + ? "" + : ", {ax25_call=\"\\x14\\x12\\x82\\x84\\x86\\x88\\x0e\"}" + , i > 1 ? ", ..." : "" + , size, sprintrc(rc)); + + if (i == 1) { + sax_void = (char *) sax_void - surplus; + memmove(sax_void, sax, sizeof(ax25)); + sax = sax_void; + } + + sax->fsa_ax25.sax25_ndigis = 7 + 2 * i; + + sax->fsa_digipeater[2].ax25_call[5] = 0x41; + sax->fsa_digipeater[2].ax25_call[6] = 0x4; + + sax->fsa_digipeater[4].ax25_call[0] = 0x40; + sax->fsa_digipeater[4].ax25_call[1] = 0x40; + + sax->fsa_digipeater[5].ax25_call[4] = '*' << 1; + sax->fsa_digipeater[5].ax25_call[5] = '/' << 1; + + sax->fsa_digipeater[6].ax25_call[5] = 0xfe; + } +} + +static void +check_x25(void) +{ + static const struct sockaddr_x25 c_x25 = { + .sx25_family = AF_X25, + .sx25_addr = { "0123456789abcdef" }, + }; + void *x25_void = tail_memdup(&c_x25, sizeof(c_x25) + 1); + struct sockaddr_x25 *x25 = x25_void; + long rc; + + rc = connect(-1, x25, sizeof(c_x25) - 1); + printf("connect(-1, {sa_family=AF_X25" + ", sa_data=\"0123456789abcde\"}, %zu) = %s\n", + sizeof(c_x25) - 1, sprintrc(rc)); + + for (size_t i = 0; i < 2; i++) { + rc = connect(-1, x25, sizeof(c_x25) + i); + printf("connect(-1, {sa_family=AF_X25" + ", sx25_addr={x25_addr=\"0123456789abcde\"...}" + "}, %zu) = %s\n", + sizeof(c_x25) + i, sprintrc(rc)); + } + + x25->sx25_addr.x25_addr[10] = '\0'; + rc = connect(-1, x25, sizeof(c_x25)); + printf("connect(-1, {sa_family=AF_X25" + ", sx25_addr={x25_addr=\"0123456789\"}" + "}, %zu) = %s\n", + sizeof(c_x25), sprintrc(rc)); +} + static void check_nl(void) { - struct sockaddr_nl *nl = tail_alloc(sizeof(*nl)); + TAIL_ALLOC_OBJECT_VAR_PTR(struct sockaddr_nl, nl); nl->nl_family = AF_NETLINK; nl->nl_pid = 1234567890; nl->nl_groups = 0xfacefeed; @@ -370,19 +523,16 @@ check_ll(void) ", sll_pkttype=PACKET_HOST, sll_halen=0}, %u)" " = %d EBADF (%m)\n", c_ll.sll_ifindex, len, ret); -#ifdef HAVE_IF_INDEXTONAME - const int id = if_nametoindex("lo"); - if (id) { - ((struct sockaddr_ll *) ll)->sll_ifindex = id; + ((struct sockaddr_ll *) ll)->sll_ifindex = ifindex_lo(); + if (((struct sockaddr_ll *) ll)->sll_ifindex) { ret = connect(-1, ll, len); printf("connect(-1, {sa_family=AF_PACKET" ", sll_protocol=htons(ETH_P_ALL)" - ", sll_ifindex=if_nametoindex(\"lo\")" + ", sll_ifindex=%s" ", sll_hatype=ARPHRD_ETHER" ", sll_pkttype=PACKET_HOST, sll_halen=0}, %u)" - " = %d EBADF (%m)\n", len, ret); + " = %d EBADF (%m)\n", IFINDEX_LO_STR, len, ret); } -#endif } #ifdef HAVE_BLUETOOTH_BLUETOOTH_H @@ -390,7 +540,7 @@ static void check_hci(void) { const unsigned short h_port = 12345; - struct sockaddr_hci *hci = tail_alloc(sizeof(*hci)); + TAIL_ALLOC_OBJECT_VAR_PTR(struct sockaddr_hci, hci); hci->hci_family = AF_BLUETOOTH; hci->hci_dev = htobs(h_port); hci->hci_channel = HCI_CHANNEL_RAW; @@ -445,25 +595,86 @@ check_l2(void) { const unsigned short h_psm = 12345; const unsigned short h_cid = 13579; - const struct sockaddr_l2 c_l2 = { + struct sockaddr_l2 c_l2 = { .l2_family = AF_BLUETOOTH, .l2_psm = htobs(h_psm), .l2_bdaddr.b = "abcdef", .l2_cid = htobs(h_cid), - .l2_bdaddr_type = 42 +# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE + .l2_bdaddr_type = 0xce, +# endif }; void *l2 = tail_memdup(&c_l2, sizeof(c_l2)); unsigned int len = sizeof(c_l2); + int ret = connect(-1, l2, len); printf("connect(-1, {sa_family=AF_BLUETOOTH" - ", l2_psm=htobs(%hu)" + ", l2_psm=htobs(L2CAP_PSM_DYN_START + %hu)" + ", l2_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + ", l2_cid=htobs(L2CAP_CID_DYN_START + %hu)" +# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE + ", l2_bdaddr_type=0xce /* BDADDR_??? */" +# endif + "}, %u) = %d EBADF (%m)\n", + (short) (h_psm - 0x1001), + c_l2.l2_bdaddr.b[0], c_l2.l2_bdaddr.b[1], + c_l2.l2_bdaddr.b[2], c_l2.l2_bdaddr.b[3], + c_l2.l2_bdaddr.b[4], c_l2.l2_bdaddr.b[5], + (short) (h_cid - 0x40), len, ret); + + c_l2.l2_psm = htobs(1); + c_l2.l2_cid = htobs(1); +# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE + c_l2.l2_bdaddr_type = BDADDR_LE_RANDOM; +# endif + memcpy(l2, &c_l2, sizeof(c_l2)); + ret = connect(-1, l2, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", l2_psm=htobs(L2CAP_PSM_SDP)" + ", l2_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + ", l2_cid=htobs(L2CAP_CID_SIGNALING)" +# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE + ", l2_bdaddr_type=BDADDR_LE_RANDOM" +# endif + "}, %u) = %d EBADF (%m)\n", + c_l2.l2_bdaddr.b[0], c_l2.l2_bdaddr.b[1], + c_l2.l2_bdaddr.b[2], c_l2.l2_bdaddr.b[3], + c_l2.l2_bdaddr.b[4], c_l2.l2_bdaddr.b[5], + len, ret); + + c_l2.l2_psm = htobs(0xbad); + c_l2.l2_cid = htobs(8); +# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE + c_l2.l2_bdaddr_type = 3; +# endif + memcpy(l2, &c_l2, sizeof(c_l2)); + ret = connect(-1, l2, len); + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", l2_psm=htobs(0xbad /* L2CAP_PSM_??? */)" + ", l2_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + ", l2_cid=htobs(0x8 /* L2CAP_CID_??? */)" +# ifdef HAVE_STRUCT_SOCKADDR_L2_L2_BDADDR_TYPE + ", l2_bdaddr_type=0x3 /* BDADDR_??? */" +# endif + "}, %u) = %d EBADF (%m)\n", + c_l2.l2_bdaddr.b[0], c_l2.l2_bdaddr.b[1], + c_l2.l2_bdaddr.b[2], c_l2.l2_bdaddr.b[3], + c_l2.l2_bdaddr.b[4], c_l2.l2_bdaddr.b[5], + len, ret); + + c_l2.l2_psm = htobs(0x10ff); + c_l2.l2_cid = htobs(0xffff); + memcpy(l2, &c_l2, 12); + ret = connect(-1, l2, 12); + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", l2_psm=htobs(L2CAP_PSM_AUTO_END)" ", l2_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" - ", l2_cid=htobs(%hu), l2_bdaddr_type=%u}" - ", %u) = %d EBADF (%m)\n", h_psm, + ", l2_cid=htobs(L2CAP_CID_DYN_END)" + "}, 12) = %d EBADF (%m)\n", c_l2.l2_bdaddr.b[0], c_l2.l2_bdaddr.b[1], c_l2.l2_bdaddr.b[2], c_l2.l2_bdaddr.b[3], c_l2.l2_bdaddr.b[4], c_l2.l2_bdaddr.b[5], - h_cid, c_l2.l2_bdaddr_type, len, ret); + ret); } #endif @@ -502,6 +713,8 @@ main(void) check_in(); check_in6(); check_ipx(); + check_ax25(); + check_x25(); check_nl(); check_ll(); #ifdef HAVE_BLUETOOTH_BLUETOOTH_H diff --git a/tests/net-sockaddr.gen.test b/tests/net-sockaddr.gen.test new file mode 100755 index 00000000..53c8335a --- /dev/null +++ b/tests/net-sockaddr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-sockaddr -a24 -e trace=connect); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 -e trace=connect diff --git a/tests/net-sockaddr.test b/tests/net-sockaddr.test deleted file mode 100755 index cdfe536f..00000000 --- a/tests/net-sockaddr.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of sockaddr structures. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 -e trace=connect diff --git a/tests/net-tpacket_req.c b/tests/net-tpacket_req.c new file mode 100644 index 00000000..b11ddf8e --- /dev/null +++ b/tests/net-tpacket_req.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +static const char *errstr; + +static long +set_tpacket_req(int optname, void *optval, socklen_t len) +{ + long rc = setsockopt(-1, SOL_PACKET, optname, optval, len); + errstr = sprintrc(rc); + return rc; +} + +static void +test_tpacket_req(const int optname, const char *const optname_str) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct tpacket_req, tpreq); + socklen_t len; + + /* setsockopt with optname unknown */ + set_tpacket_req(-1, NULL, 0); + printf("setsockopt(-1, SOL_PACKET, %#x /* PACKET_??? */, NULL, 0) = %s\n", + -1, errstr); + + /* classic setsockopt */ + len = sizeof(struct tpacket_req); + set_tpacket_req(optname, tpreq, len); + printf("setsockopt(-1, SOL_PACKET, %s, {tp_block_size=%u," + " tp_block_nr=%u, tp_frame_size=%u, tp_frame_nr=%u}, %d) = %s\n", + optname_str, tpreq->tp_block_size, tpreq->tp_block_nr, + tpreq->tp_frame_size, tpreq->tp_frame_nr, len, errstr); + + /* setsockopt with optlen larger than usual */ + len = len + 1; + set_tpacket_req(optname, tpreq, len); + printf("setsockopt(-1, SOL_PACKET, %s, %p," + " %d) = %s\n", optname_str, tpreq, len, errstr); +} + +int +main(void) +{ + test_tpacket_req(ARG_STR(PACKET_RX_RING)); +#ifdef PACKET_TX_RING + test_tpacket_req(ARG_STR(PACKET_TX_RING)); +#endif + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/net-tpacket_req.gen.test b/tests/net-tpacket_req.gen.test new file mode 100755 index 00000000..6fc4e601 --- /dev/null +++ b/tests/net-tpacket_req.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-tpacket_req -e trace=setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=setsockopt diff --git a/tests/net-tpacket_stats-success.c b/tests/net-tpacket_stats-success.c new file mode 100644 index 00000000..883ec048 --- /dev/null +++ b/tests/net-tpacket_stats-success.c @@ -0,0 +1,2 @@ +#define INJECT_RETVAL 42 +#include "net-tpacket_stats.c" diff --git a/tests/net-tpacket_stats-success.test b/tests/net-tpacket_stats-success.test new file mode 100755 index 00000000..47ab84ef --- /dev/null +++ b/tests/net-tpacket_stats-success.test @@ -0,0 +1,11 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + + . "${srcdir=.}/scno_tampering.sh" + +run_strace -e trace=getsockopt -e inject=getsockopt:retval=42 ../net-tpacket_stats-success > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests/net-tpacket_stats.c b/tests/net-tpacket_stats.c new file mode 100644 index 00000000..22f5fa25 --- /dev/null +++ b/tests/net-tpacket_stats.c @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include "print_fields.h" + +static const char *errstr; + +struct tp_stats { + unsigned int tp_packets, tp_drops, tp_freeze_q_cnt; +}; + +static long +get_tpacket_stats(void *optval, socklen_t *len) +{ + struct tp_stats *tpstats = optval; + socklen_t optlen = *len; + long rc = getsockopt(-1, SOL_PACKET, PACKET_STATISTICS, tpstats, len); + errstr = sprintrc(rc); +#ifdef INJECT_RETVAL + if (rc != INJECT_RETVAL) + error_msg_and_fail("Got a return value of %ld != %d", + rc, INJECT_RETVAL); + + static char inj_errstr[4096]; + + snprintf(inj_errstr, sizeof(inj_errstr), "%s (INJECTED)", errstr); + errstr = inj_errstr; +#endif + printf("getsockopt(-1, SOL_PACKET, PACKET_STATISTICS"); + if (rc < 0 || optlen <= 0) { + printf(", %p", tpstats); + } else if (optlen < sizeof(tpstats->tp_packets)) { + printf(", {tp_packets="); + print_quoted_hex(tpstats, optlen); + printf("}"); + } else { + PRINT_FIELD_U(", {", *tpstats, tp_packets); + + if (optlen > offsetof(struct tp_stats, tp_drops)) { + optlen -= offsetof(struct tp_stats, tp_drops); + if (optlen < sizeof(tpstats->tp_drops)) { + printf(", tp_drops="); + print_quoted_hex(tpstats, optlen); + } else { + PRINT_FIELD_U(", ", *tpstats, tp_drops); + + if (optlen > offsetof(struct tp_stats, tp_freeze_q_cnt) - + offsetof(struct tp_stats, tp_drops)) { + optlen -= offsetof(struct tp_stats, tp_freeze_q_cnt) - + offsetof(struct tp_stats, tp_drops); + if (optlen < sizeof(tpstats->tp_freeze_q_cnt)) { + printf(", tp_freeze_q_cnt="); + print_quoted_hex(tpstats, optlen); + } else { + PRINT_FIELD_U(", ", *tpstats, tp_freeze_q_cnt); + } + } + } + } + printf("}"); + } + printf(", [%d]) = %s\n", *len, errstr); + + return rc; +} + +int +main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct tp_stats, tp_stats); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); + + /* offset of (truncated) struct tp_stats.tp_packets */ + const unsigned int offset_tp_packets = offsetofend(struct tp_stats, tp_packets); + const unsigned int tp_packets_truncated = offset_tp_packets - 1; + /* offset of (truncated) struct tp_stats.tp_drops */ + const unsigned int offset_tp_drops = offsetofend(struct tp_stats, tp_drops); + const unsigned int tp_drops_truncated = offset_tp_drops - 1; + /* offset of (truncated) struct tp_stats.tp_freeze_q_cnt */ + const unsigned int offset_tp_freeze_q_cnt = offsetofend(struct tp_stats, tp_freeze_q_cnt); + const unsigned int tp_freeze_q_cnt_truncated = offset_tp_freeze_q_cnt - 1; + + *len = sizeof(*tp_stats); + + /* classic getsockopt */ + unsigned int optlen = *len; + get_tpacket_stats(tp_stats, &optlen); + + /* getsockopt with zero optlen */ + optlen = 0; + get_tpacket_stats(tp_stats, &optlen); + + /* + * getsockopt with optlen less than offsetofend(struct tp_stats.tp_packets): + * the part of struct tp_stats.tp_packets is printed in hex. + */ + optlen = tp_packets_truncated; + get_tpacket_stats(tp_stats, &optlen); + + /* + * getsockopt with optlen equals to offsetofend(struct tp_stats.tp_packets): + * struct tp_stats.tp_drops and struct tp_stats.offset_tp_freeze_q_cnt + * are not printed. + */ + optlen = offset_tp_packets; + get_tpacket_stats(tp_stats, &optlen); + + /* + * getsockopt with optlen greater than offsetofend(struct tp_stats.tp_packets) + * but less than offsetofend(struct tp_stats, tp_drops): + * the part of struct tp_stats.tp_drops is printed in hex. + */ + optlen = tp_drops_truncated; + get_tpacket_stats(tp_stats, &optlen); + + /* + * getsockopt with optlen equals to offsetofend(struct tp_stats.tp_drops): + * struct tp_stats.tp_freeze_q_cnt is not printed. + */ + optlen = offset_tp_drops; + get_tpacket_stats(tp_stats, &optlen); + + /* + * getsockopt with optlen greater than offsetofend(struct tp_stats.tp_drops) + * but less than offsetofend(struct tp_stats, tp_freeze_q_cnt): + * the part of struct tp_stats.tp_freeze_q_cnt is printed in hex. + */ + optlen = tp_freeze_q_cnt_truncated; + get_tpacket_stats(tp_stats, &optlen); + + /* + * getsockopt with optlen equals to offsetofend(struct tp_stats.tp_freeze_q_cnt): + */ + optlen = offset_tp_freeze_q_cnt; + get_tpacket_stats(tp_stats, &optlen); + + /* + * getsockopt with optlen greater than sizeof(struct tp_stats) + */ + optlen = offset_tp_freeze_q_cnt + 1; + get_tpacket_stats(tp_stats, &optlen); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/net-tpacket_stats.gen.test b/tests/net-tpacket_stats.gen.test new file mode 100755 index 00000000..2df46550 --- /dev/null +++ b/tests/net-tpacket_stats.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-tpacket_stats -e trace=getsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt diff --git a/tests/net-y-unix.c b/tests/net-y-unix.c index 3efc2f64..e9d218b5 100644 --- a/tests/net-y-unix.c +++ b/tests/net-y-unix.c @@ -1,30 +1,11 @@ /* * This file is part of net-y-unix strace test. * - * Copyright (c) 2013-2016 Dmitry V. Levin + * Copyright (c) 2013-2017 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -34,23 +15,26 @@ #include #include #include -#include #include #include +#include "accept_compat.h" + +#define TEST_SOCKET "net-y-unix.socket" + int -main(int ac, const char **av) +main(void) { - assert(ac == 2); + skip_if_unavailable("/proc/self/fd/"); - struct sockaddr_un addr = { .sun_family = AF_UNIX }; - unsigned int sun_path_len = strlen(av[1]); - assert(sun_path_len > 0 && sun_path_len <= sizeof(addr.sun_path)); - strncpy(addr.sun_path, av[1], sizeof(addr.sun_path)); + static const struct sockaddr_un addr = { + .sun_family = AF_UNIX, + .sun_path = TEST_SOCKET + }; struct sockaddr * const listen_sa = tail_memdup(&addr, sizeof(addr)); - socklen_t * const len = tail_alloc(sizeof(socklen_t)); - *len = offsetof(struct sockaddr_un, sun_path) + strlen(av[1]) + 1; + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); + *len = offsetof(struct sockaddr_un, sun_path) + strlen(TEST_SOCKET) + 1; if (*len > sizeof(addr)) *len = sizeof(addr); @@ -61,17 +45,18 @@ main(int ac, const char **av) printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", listen_fd, listen_inode); - (void) unlink(av[1]); + (void) unlink(TEST_SOCKET); if (bind(listen_fd, listen_sa, *len)) perror_msg_and_skip("bind"); printf("bind(%d, {sa_family=AF_UNIX, sun_path=\"%s\"}" - ", %u) = 0\n", listen_fd, listen_inode, av[1], (unsigned) *len); + ", %u) = 0\n", + listen_fd, listen_inode, TEST_SOCKET, (unsigned) *len); if (listen(listen_fd, 1)) perror_msg_and_skip("listen"); printf("listen(%d, 1) = 0\n", listen_fd, listen_inode); - unsigned int * const optval = tail_alloc(sizeof(unsigned int)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, optval); *len = sizeof(*optval); if (getsockopt(listen_fd, SOL_SOCKET, SO_PASSCRED, optval, len)) perror_msg_and_fail("getsockopt"); @@ -85,7 +70,7 @@ main(int ac, const char **av) perror_msg_and_fail("getsockname"); printf("getsockname(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", listen_fd, listen_inode, - av[1], (int) sizeof(addr), (int) *len); + TEST_SOCKET, (int) sizeof(addr), (int) *len); int connect_fd = socket(AF_UNIX, SOCK_STREAM, 0); if (connect_fd < 0) @@ -98,12 +83,12 @@ main(int ac, const char **av) perror_msg_and_fail("connect"); printf("connect(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, %u) = 0\n", - connect_fd, connect_inode, av[1], (unsigned) *len); + connect_fd, connect_inode, TEST_SOCKET, (unsigned) *len); struct sockaddr * const accept_sa = tail_alloc(sizeof(addr)); memset(accept_sa, 0, sizeof(addr)); *len = sizeof(addr); - int accept_fd = accept(listen_fd, accept_sa, len); + int accept_fd = do_accept(listen_fd, accept_sa, len); if (accept_fd < 0) perror_msg_and_fail("accept"); unsigned long accept_inode = inode_of_sockfd(accept_fd); @@ -119,7 +104,7 @@ main(int ac, const char **av) perror_msg_and_fail("getpeername"); printf("getpeername(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", connect_fd, connect_inode, - av[1], (int) sizeof(addr), (int) *len); + TEST_SOCKET, (int) sizeof(addr), (int) *len); char text[] = "text"; assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, 0) @@ -163,23 +148,23 @@ main(int ac, const char **av) perror_msg_and_fail("getsockname"); printf("getsockname(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", - listen_fd, listen_inode, av[1], + listen_fd, listen_inode, TEST_SOCKET, (int) sizeof(addr), (int) *len); if (connect(connect_fd, listen_sa, *len)) perror_msg_and_fail("connect"); printf("connect(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, %u) = 0\n", - connect_fd, connect_inode, av[1], (unsigned) *len); + connect_fd, connect_inode, TEST_SOCKET, (unsigned) *len); memset(accept_sa, 0, sizeof(addr)); *len = sizeof(addr); - accept_fd = accept(listen_fd, accept_sa, len); + accept_fd = do_accept(listen_fd, accept_sa, len); if (accept_fd < 0) perror_msg_and_fail("accept"); accept_inode = inode_of_sockfd(accept_fd); const char * const sun_path1 = - ((struct sockaddr_un *) accept_sa) -> sun_path + 1; + ((struct sockaddr_un *) accept_sa)->sun_path + 1; printf("accept(%d, {sa_family=AF_UNIX" ", sun_path=@\"%s\"}, [%d->%d]) = %d\n", listen_fd, listen_inode, sun_path1, @@ -192,7 +177,7 @@ main(int ac, const char **av) perror_msg_and_fail("getpeername"); printf("getpeername(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", - connect_fd, connect_inode, av[1], + connect_fd, connect_inode, TEST_SOCKET, (int) sizeof(addr), (int) *len); memset(accept_sa, 0, sizeof(addr)); @@ -224,7 +209,7 @@ main(int ac, const char **av) assert(close(accept_fd) == 0); printf("close(%d) = 0\n", accept_fd, accept_inode); - assert(unlink(av[1]) == 0); + assert(unlink(TEST_SOCKET) == 0); assert(close(listen_fd) == 0); printf("close(%d) = 0\n", diff --git a/tests/net-y-unix.test b/tests/net-y-unix.test index aec8159f..aaaf9705 100755 --- a/tests/net-y-unix.test +++ b/tests/net-y-unix.test @@ -2,45 +2,18 @@ # # Check decoding of network syscalls in -y mode. # -# Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -# strace -y is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - check_prog sed -addr="$NAME-local-stream" -run_prog "./$NAME" $addr > /dev/null - +run_prog > /dev/null run_strace -a20 -y -eclose,network $args > "$EXP" + # Filter out close() calls made by ld.so and libc. sed -n '/socket/,$p' < "$LOG" > "$OUT" - match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests/net-yy-inet.c b/tests/net-yy-inet.c index f76f941d..03264faa 100644 --- a/tests/net-yy-inet.c +++ b/tests/net-yy-inet.c @@ -2,29 +2,10 @@ * This file is part of net-yy-inet strace test. * * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -38,78 +19,99 @@ #include #include +#include "accept_compat.h" + +#ifndef ADDR_FAMILY +# define ADDR_FAMILY_FIELD sin_family +# define ADDR_FAMILY AF_INET +# define AF_STR "AF_INET" +# define LOOPBACK_FIELD .sin_addr.s_addr = htonl(INADDR_LOOPBACK) +# define LOOPBACK "127.0.0.1" +# define SOCKADDR_TYPE sockaddr_in +# define TCP_STR "TCP" +# define INPORT sin_port +# define INPORT_STR "sin_port" +# define INADDR_STR "sin_addr=inet_addr(\"" LOOPBACK "\")" +# define SA_FIELDS "" +#endif + int main(void) { - const struct sockaddr_in addr = { - .sin_family = AF_INET, - .sin_addr.s_addr = htonl(INADDR_LOOPBACK) + skip_if_unavailable("/proc/self/fd/"); + + const struct SOCKADDR_TYPE addr = { + .ADDR_FAMILY_FIELD = ADDR_FAMILY, + LOOPBACK_FIELD }; struct sockaddr * const listen_sa = tail_memdup(&addr, sizeof(addr)); - socklen_t * const len = tail_alloc(sizeof(socklen_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); *len = sizeof(addr); - const int listen_fd = socket(AF_INET, SOCK_STREAM, 0); + const int listen_fd = socket(ADDR_FAMILY, SOCK_STREAM, 0); if (listen_fd < 0) perror_msg_and_skip("socket"); const unsigned long listen_inode = inode_of_sockfd(listen_fd); - printf("socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = %d\n", + printf("socket(" AF_STR ", SOCK_STREAM, IPPROTO_IP) = %d<" TCP_STR + ":[%lu]>\n", listen_fd, listen_inode); if (bind(listen_fd, listen_sa, *len)) perror_msg_and_skip("bind"); - printf("bind(%d, {sa_family=AF_INET, sin_port=htons(0)" - ", sin_addr=inet_addr(\"127.0.0.1\")}, %u) = 0\n", + printf("bind(%d<" TCP_STR ":[%lu]>, {sa_family=" AF_STR ", " INPORT_STR + "=htons(0), " INADDR_STR SA_FIELDS "}, %u) = 0\n", listen_fd, listen_inode, (unsigned) *len); if (listen(listen_fd, 1)) perror_msg_and_skip("listen"); - printf("listen(%d, 1) = 0\n", listen_fd, listen_inode); + printf("listen(%d<" TCP_STR ":[%lu]>, 1) = 0\n", + listen_fd, listen_inode); memset(listen_sa, 0, sizeof(addr)); *len = sizeof(addr); if (getsockname(listen_fd, listen_sa, len)) perror_msg_and_fail("getsockname"); const unsigned int listen_port = - ntohs(((struct sockaddr_in *) listen_sa) -> sin_port); - printf("getsockname(%d, {sa_family=AF_INET" - ", sin_port=htons(%u), sin_addr=inet_addr(\"127.0.0.1\")}" + ntohs(((struct SOCKADDR_TYPE *) listen_sa)->INPORT); + printf("getsockname(%d<" TCP_STR ":[" LOOPBACK ":%u]>, {sa_family=" + AF_STR ", " INPORT_STR "=htons(%u), " INADDR_STR SA_FIELDS "}" ", [%u]) = 0\n", listen_fd, listen_port, listen_port, (unsigned) *len); - unsigned int * const optval = tail_alloc(sizeof(unsigned int)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, optval); *len = sizeof(*optval); if (getsockopt(listen_fd, SOL_TCP, TCP_MAXSEG, optval, len)) perror_msg_and_fail("getsockopt"); - printf("getsockopt(%d, SOL_TCP, TCP_MAXSEG" - ", [%u], [%u]) = 0\n", + printf("getsockopt(%d<" TCP_STR ":[" LOOPBACK ":%u]>, SOL_TCP, " + "TCP_MAXSEG, [%u], [%u]) = 0\n", listen_fd, listen_port, *optval, (unsigned) *len); - const int connect_fd = socket(AF_INET, SOCK_STREAM, 0); + const int connect_fd = socket(ADDR_FAMILY, SOCK_STREAM, 0); if (connect_fd < 0) perror_msg_and_fail("socket"); const unsigned long connect_inode = inode_of_sockfd(connect_fd); - printf("socket(AF_INET, SOCK_STREAM, IPPROTO_IP) = %d\n", + printf("socket(" AF_STR ", SOCK_STREAM, IPPROTO_IP) = %d<" TCP_STR + ":[%lu]>\n", connect_fd, connect_inode); *len = sizeof(addr); if (connect(connect_fd, listen_sa, *len)) perror_msg_and_fail("connect"); - printf("connect(%d, {sa_family=AF_INET, sin_port=htons(%u)" - ", sin_addr=inet_addr(\"127.0.0.1\")}, %u) = 0\n", + printf("connect(%d<" TCP_STR ":[%lu]>, {sa_family=" AF_STR ", " + INPORT_STR "=htons(%u), " INADDR_STR SA_FIELDS "}, %u) = 0\n", connect_fd, connect_inode, listen_port, (unsigned) *len); struct sockaddr * const accept_sa = tail_alloc(sizeof(addr)); memset(accept_sa, 0, sizeof(addr)); *len = sizeof(addr); - const int accept_fd = accept(listen_fd, accept_sa, len); + const int accept_fd = do_accept(listen_fd, accept_sa, len); if (accept_fd < 0) perror_msg_and_fail("accept"); const unsigned int connect_port = - ntohs(((struct sockaddr_in *) accept_sa) -> sin_port); - printf("accept(%d, {sa_family=AF_INET" - ", sin_port=htons(%u), sin_addr=inet_addr(\"127.0.0.1\")}" - ", [%u]) = %d127.0.0.1:%u]>\n", + ntohs(((struct SOCKADDR_TYPE *) accept_sa)->INPORT); + printf("accept(%d<" TCP_STR ":[" LOOPBACK ":%u]>, {sa_family=" AF_STR + ", " INPORT_STR "=htons(%u), " INADDR_STR SA_FIELDS "}" + ", [%u]) = %d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>\n", listen_fd, listen_port, connect_port, (unsigned) *len, accept_fd, listen_port, connect_port); @@ -117,9 +119,9 @@ main(void) *len = sizeof(addr); if (getpeername(accept_fd, accept_sa, len)) perror_msg_and_fail("getpeername"); - printf("getpeername(%d127.0.0.1:%u]>" - ", {sa_family=AF_INET, sin_port=htons(%u)" - ", sin_addr=inet_addr(\"127.0.0.1\")}, [%u]) = 0\n", + printf("getpeername(%d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>" + ", {sa_family=" AF_STR ", " INPORT_STR "=htons(%u)" + ", " INADDR_STR SA_FIELDS "}, [%u]) = 0\n", accept_fd, listen_port, connect_port, connect_port, (unsigned) *len); @@ -127,16 +129,16 @@ main(void) *len = sizeof(addr); if (getpeername(connect_fd, listen_sa, len)) perror_msg_and_fail("getpeername"); - printf("getpeername(%d127.0.0.1:%u]>" - ", {sa_family=AF_INET, sin_port=htons(%u)" - ", sin_addr=inet_addr(\"127.0.0.1\")}, [%u]) = 0\n", + printf("getpeername(%d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>" + ", {sa_family=" AF_STR ", " INPORT_STR "=htons(%u)" + ", " INADDR_STR SA_FIELDS "}, [%u]) = 0\n", connect_fd, connect_port, listen_port, listen_port, (unsigned) *len); *len = sizeof(*optval); if (setsockopt(connect_fd, SOL_TCP, TCP_MAXSEG, optval, *len)) perror_msg_and_fail("setsockopt"); - printf("setsockopt(%d127.0.0.1:%u]>" + printf("setsockopt(%d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>" ", SOL_TCP, TCP_MAXSEG, [%u], %u) = 0\n", connect_fd, connect_port, listen_port, *optval, (unsigned) *len); @@ -144,28 +146,30 @@ main(void) char text[] = "text"; assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTROUTE | MSG_DONTWAIT, NULL, 0) == sizeof(text) - 1); - printf("sendto(%d127.0.0.1:%u]>, \"%s\", %u" - ", MSG_DONTROUTE|MSG_DONTWAIT, NULL, 0) = %u\n", + printf("sendto(%d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>, " + "\"%s\", %u, MSG_DONTROUTE|MSG_DONTWAIT, NULL, 0) = %u\n", connect_fd, connect_port, listen_port, text, (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); assert(close(connect_fd) == 0); - printf("close(%d127.0.0.1:%u]>) = 0\n", + printf("close(%d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>) = " + "0\n", connect_fd, connect_port, listen_port); assert(recvfrom(accept_fd, text, sizeof(text) - 1, MSG_WAITALL, NULL, NULL) == sizeof(text) - 1); - printf("recvfrom(%d127.0.0.1:%u]>, \"%s\", %u" - ", MSG_WAITALL, NULL, NULL) = %u\n", + printf("recvfrom(%d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>, " + "\"%s\", %u, MSG_WAITALL, NULL, NULL) = %u\n", accept_fd, listen_port, connect_port, text, (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); assert(close(accept_fd) == 0); - printf("close(%d127.0.0.1:%u]>) = 0\n", + printf("close(%d<" TCP_STR ":[" LOOPBACK ":%u->" LOOPBACK ":%u]>) = " + "0\n", accept_fd, listen_port, connect_port); assert(close(listen_fd) == 0); - printf("close(%d) = 0\n", + printf("close(%d<" TCP_STR ":[" LOOPBACK ":%u]>) = 0\n", listen_fd, listen_port); puts("+++ exited with 0 +++"); diff --git a/tests/net-yy-inet.test b/tests/net-yy-inet.test index 2ebf91fa..71a2a0c7 100755 --- a/tests/net-yy-inet.test +++ b/tests/net-yy-inet.test @@ -3,44 +3,19 @@ # Check decoding of ip:port pairs associated with socket descriptors # # Copyright (c) 2014-2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -# strace -yy is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - check_prog sed -run_prog ./netlink_inet_diag - -run_prog "./$NAME" > /dev/null +run_prog ../netlink_inet_diag +run_prog > /dev/null run_strace -a22 -yy -eclose,network $args > "$EXP" + # Filter out close() calls made by ld.so and libc. sed -n '/socket/,$p' < "$LOG" > "$OUT" - match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests/net-yy-inet6.c b/tests/net-yy-inet6.c new file mode 100644 index 00000000..b8a7e240 --- /dev/null +++ b/tests/net-yy-inet6.c @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#define ADDR_FAMILY_FIELD sin6_family +#define ADDR_FAMILY AF_INET6 +#define AF_STR "AF_INET6" +#define LOOPBACK_FIELD .sin6_addr = IN6ADDR_LOOPBACK_INIT +#define LOOPBACK "[::1]" +#define SOCKADDR_TYPE sockaddr_in6 +#define TCP_STR "TCPv6" +#define INPORT sin6_port +#define INPORT_STR "sin6_port" +#define INADDR_STR "sin6_flowinfo=htonl(0)" \ + ", inet_pton(AF_INET6, \"::1\", &sin6_addr)" +#define SA_FIELDS ", sin6_scope_id=0" + +#include "net-yy-inet.c" diff --git a/tests/net-yy-inet6.gen.test b/tests/net-yy-inet6.gen.test new file mode 100755 index 00000000..afa38c6e --- /dev/null +++ b/tests/net-yy-inet6.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (net-yy-inet6 +net-yy-inet.test ); do not edit. +set -- +. "${srcdir=.}/net-yy-inet.test" diff --git a/tests/net-yy-netlink.c b/tests/net-yy-netlink.c index 64d0efca..38b1a0d4 100644 --- a/tests/net-yy-netlink.c +++ b/tests/net-yy-netlink.c @@ -1,31 +1,12 @@ /* * This file is part of net-yy-netlink strace test. * - * Copyright (c) 2013-2016 Dmitry V. Levin + * Copyright (c) 2013-2017 Dmitry V. Levin * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,24 +17,21 @@ #include #include #include -#include +#include "netlink.h" #include #include -#if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG -# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG -#endif - int main(void) { - unsigned magic = 1234; + skip_if_unavailable("/proc/self/fd/"); + struct sockaddr_nl addr = { .nl_family = AF_NETLINK, - .nl_pid = 1234 + .nl_pid = getpid() }; struct sockaddr *const sa = tail_memdup(&addr, sizeof(addr)); - socklen_t * const len = tail_alloc(sizeof(socklen_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); *len = sizeof(addr); const int fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG); @@ -67,17 +45,17 @@ main(void) perror_msg_and_skip("bind"); printf("bind(%d, {sa_family=AF_NETLINK" ", nl_pid=%u, nl_groups=00000000}, %u) = 0\n", - fd, inode, magic, (unsigned) *len); + fd, inode, addr.nl_pid, (unsigned) *len); if (getsockname(fd, sa, len)) perror_msg_and_fail("getsockname"); printf("getsockname(%d, {sa_family=AF_NETLINK" ", nl_pid=%u, nl_groups=00000000}, [%u]) = 0\n", - fd, magic, magic, (unsigned) *len); + fd, addr.nl_pid, addr.nl_pid, (unsigned) *len); if (close(fd)) perror_msg_and_fail("close"); - printf("close(%d) = 0\n", fd, magic); + printf("close(%d) = 0\n", fd, addr.nl_pid); puts("+++ exited with 0 +++"); return 0; diff --git a/tests/net-yy-netlink.test b/tests/net-yy-netlink.test index bff1d861..892c9799 100755 --- a/tests/net-yy-netlink.test +++ b/tests/net-yy-netlink.test @@ -6,44 +6,19 @@ # Copyright (c) 2014 Masatake YAMATO # Copyright (c) 2014-2016 Dmitry V. Levin # Copyright (c) 2016 Fabien Siron +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -# strace -yy is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - check_prog sed -run_prog ./netlink_netlink_diag - -run_prog "./$NAME" > /dev/null +run_prog ../netlink_netlink_diag +run_prog > /dev/null run_strace -a22 -yy -eclose,network $args > "$EXP" + # Filter out close() calls made by ld.so and libc. sed -n '/socket/,$p' < "$LOG" > "$OUT" - match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests/net-yy-unix.c b/tests/net-yy-unix.c index 63637bdd..0380da3f 100644 --- a/tests/net-yy-unix.c +++ b/tests/net-yy-unix.c @@ -1,30 +1,11 @@ /* * This file is part of net-yy-unix strace test. * - * Copyright (c) 2013-2016 Dmitry V. Levin + * Copyright (c) 2013-2017 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -34,23 +15,26 @@ #include #include #include -#include #include #include +#include "accept_compat.h" + +#define TEST_SOCKET "net-yy-unix.socket" + int -main(int ac, const char **av) +main(void) { - assert(ac == 2); + skip_if_unavailable("/proc/self/fd/"); - struct sockaddr_un addr = { .sun_family = AF_UNIX }; - unsigned int sun_path_len = strlen(av[1]); - assert(sun_path_len > 0 && sun_path_len <= sizeof(addr.sun_path)); - strncpy(addr.sun_path, av[1], sizeof(addr.sun_path)); + struct sockaddr_un addr = { + .sun_family = AF_UNIX, + .sun_path = TEST_SOCKET + }; struct sockaddr * const listen_sa = tail_memdup(&addr, sizeof(addr)); - socklen_t * const len = tail_alloc(sizeof(socklen_t)); - *len = offsetof(struct sockaddr_un, sun_path) + strlen(av[1]) + 1; + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); + *len = offsetof(struct sockaddr_un, sun_path) + strlen(TEST_SOCKET) + 1; if (*len > sizeof(addr)) *len = sizeof(addr); @@ -61,24 +45,25 @@ main(int ac, const char **av) printf("socket(AF_UNIX, SOCK_STREAM, 0) = %d\n", listen_fd, listen_inode); - (void) unlink(av[1]); + (void) unlink(TEST_SOCKET); if (bind(listen_fd, listen_sa, *len)) perror_msg_and_skip("bind"); printf("bind(%d, {sa_family=AF_UNIX, sun_path=\"%s\"}" - ", %u) = 0\n", listen_fd, listen_inode, av[1], (unsigned) *len); + ", %u) = 0\n", + listen_fd, listen_inode, TEST_SOCKET, (unsigned) *len); if (listen(listen_fd, 1)) perror_msg_and_skip("listen"); printf("listen(%d, 1) = 0\n", - listen_fd, listen_inode, av[1]); + listen_fd, listen_inode, TEST_SOCKET); - unsigned int * const optval = tail_alloc(sizeof(unsigned int)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, optval); *len = sizeof(*optval); if (getsockopt(listen_fd, SOL_SOCKET, SO_PASSCRED, optval, len)) perror_msg_and_fail("getsockopt"); printf("getsockopt(%d, SOL_SOCKET, SO_PASSCRED" ", [%u], [%u]) = 0\n", - listen_fd, listen_inode, av[1], *optval, (unsigned) *len); + listen_fd, listen_inode, TEST_SOCKET, *optval, (unsigned) *len); memset(listen_sa, 0, sizeof(addr)); *len = sizeof(addr); @@ -86,7 +71,7 @@ main(int ac, const char **av) perror_msg_and_fail("getsockname"); printf("getsockname(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", listen_fd, listen_inode, - av[1], av[1], (int) sizeof(addr), (int) *len); + TEST_SOCKET, TEST_SOCKET, (int) sizeof(addr), (int) *len); int connect_fd = socket(AF_UNIX, SOCK_STREAM, 0); if (connect_fd < 0) @@ -99,19 +84,20 @@ main(int ac, const char **av) perror_msg_and_fail("connect"); printf("connect(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, %u) = 0\n", - connect_fd, connect_inode, av[1], (unsigned) *len); + connect_fd, connect_inode, TEST_SOCKET, (unsigned) *len); struct sockaddr * const accept_sa = tail_alloc(sizeof(addr)); memset(accept_sa, 0, sizeof(addr)); *len = sizeof(addr); - int accept_fd = accept(listen_fd, accept_sa, len); + int accept_fd = do_accept(listen_fd, accept_sa, len); if (accept_fd < 0) perror_msg_and_fail("accept"); unsigned long accept_inode = inode_of_sockfd(accept_fd); printf("accept(%d, {sa_family=AF_UNIX}" ", [%d->%d]) = %d%lu,\"%s\"]>\n", - listen_fd, listen_inode, av[1], (int) sizeof(addr), (int) *len, - accept_fd, accept_inode, connect_inode, av[1]); + listen_fd, listen_inode, TEST_SOCKET, + (int) sizeof(addr), (int) *len, + accept_fd, accept_inode, connect_inode, TEST_SOCKET); memset(listen_sa, 0, sizeof(addr)); *len = sizeof(addr); @@ -120,7 +106,7 @@ main(int ac, const char **av) printf("getpeername(%d%lu]>, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", connect_fd, connect_inode, - accept_inode, av[1], (int) sizeof(addr), (int) *len); + accept_inode, TEST_SOCKET, (int) sizeof(addr), (int) *len); char text[] = "text"; assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, 0) @@ -134,7 +120,7 @@ main(int ac, const char **av) == sizeof(text) - 1); printf("recvfrom(%d%lu,\"%s\"]>, \"%s\", %u, MSG_DONTWAIT" ", NULL, NULL) = %u\n", - accept_fd, accept_inode, connect_inode, av[1], text, + accept_fd, accept_inode, connect_inode, TEST_SOCKET, text, (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); assert(close(connect_fd) == 0); @@ -143,7 +129,7 @@ main(int ac, const char **av) assert(close(accept_fd) == 0); printf("close(%d%lu,\"%s\"]>) = 0\n", - accept_fd, accept_inode, connect_inode, av[1]); + accept_fd, accept_inode, connect_inode, TEST_SOCKET); connect_fd = socket(AF_UNIX, SOCK_STREAM, 0); if (connect_fd < 0) @@ -166,27 +152,27 @@ main(int ac, const char **av) perror_msg_and_fail("getsockname"); printf("getsockname(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", listen_fd, listen_inode, - av[1], av[1], (int) sizeof(addr), (int) *len); + TEST_SOCKET, TEST_SOCKET, (int) sizeof(addr), (int) *len); if (connect(connect_fd, listen_sa, *len)) perror_msg_and_fail("connect"); printf("connect(%d, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, %u) = 0\n", - connect_fd, connect_inode, av[1], (unsigned) *len); + connect_fd, connect_inode, TEST_SOCKET, (unsigned) *len); memset(accept_sa, 0, sizeof(addr)); *len = sizeof(addr); - accept_fd = accept(listen_fd, accept_sa, len); + accept_fd = do_accept(listen_fd, accept_sa, len); if (accept_fd < 0) perror_msg_and_fail("accept"); accept_inode = inode_of_sockfd(accept_fd); const char * const sun_path1 = - ((struct sockaddr_un *) accept_sa) -> sun_path + 1; + ((struct sockaddr_un *) accept_sa)->sun_path + 1; printf("accept(%d, {sa_family=AF_UNIX" ", sun_path=@\"%s\"}, [%d->%d]) = %d%lu,\"%s\"]>\n", - listen_fd, listen_inode, av[1], sun_path1, + listen_fd, listen_inode, TEST_SOCKET, sun_path1, (int) sizeof(addr), (int) *len, - accept_fd, accept_inode, connect_inode, av[1]); + accept_fd, accept_inode, connect_inode, TEST_SOCKET); memset(listen_sa, 0, sizeof(addr)); *len = sizeof(addr); @@ -194,7 +180,7 @@ main(int ac, const char **av) perror_msg_and_fail("getpeername"); printf("getpeername(%d%lu,@\"%s\"]>, {sa_family=AF_UNIX" ", sun_path=\"%s\"}, [%d->%d]) = 0\n", connect_fd, connect_inode, - accept_inode, sun_path1, av[1], (int) sizeof(addr), (int) *len); + accept_inode, sun_path1, TEST_SOCKET, (int) sizeof(addr), (int) *len); assert(sendto(connect_fd, text, sizeof(text) - 1, MSG_DONTWAIT, NULL, 0) == sizeof(text) - 1); @@ -207,7 +193,7 @@ main(int ac, const char **av) == sizeof(text) - 1); printf("recvfrom(%d%lu,\"%s\"]>, \"%s\", %u, MSG_DONTWAIT" ", NULL, NULL) = %u\n", - accept_fd, accept_inode, connect_inode, av[1], text, + accept_fd, accept_inode, connect_inode, TEST_SOCKET, text, (unsigned) sizeof(text) - 1, (unsigned) sizeof(text) - 1); assert(close(connect_fd) == 0); @@ -216,13 +202,13 @@ main(int ac, const char **av) assert(close(accept_fd) == 0); printf("close(%d%lu,\"%s\"]>) = 0\n", - accept_fd, accept_inode, connect_inode, av[1]); + accept_fd, accept_inode, connect_inode, TEST_SOCKET); - assert(unlink(av[1]) == 0); + assert(unlink(TEST_SOCKET) == 0); assert(close(listen_fd) == 0); printf("close(%d) = 0\n", - listen_fd, listen_inode, av[1]); + listen_fd, listen_inode, TEST_SOCKET); puts("+++ exited with 0 +++"); return 0; diff --git a/tests/net-yy-unix.test b/tests/net-yy-unix.test index b82761c3..d00dd2c1 100755 --- a/tests/net-yy-unix.test +++ b/tests/net-yy-unix.test @@ -4,46 +4,19 @@ # associated with unix domain socket descriptors. # # Copyright (c) 2014 Masatake YAMATO -# Copyright (c) 2014-2016 Dmitry V. Levin +# Copyright (c) 2014-2018 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -# strace -yy is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - check_prog sed -run_prog ./netlink_unix_diag - -addr="$NAME-local-stream" -run_prog "./$NAME" $addr > /dev/null +run_prog ../netlink_unix_diag +run_prog > /dev/null run_strace -a22 -yy -eclose,network $args > "$EXP" + # Filter out close() calls made by ld.so and libc. sed -n '/socket/,$p' < "$LOG" > "$OUT" - match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests/net.expected b/tests/net.expected index 80dd0701..e33e2966 100644 --- a/tests/net.expected +++ b/tests/net.expected @@ -3,5 +3,5 @@ [1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +bind\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="net-local-stream"\}, 19\) += 0 [1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +listen\(0, 5\) += 0 [1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +getsockname\(0, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="net-local-stream"\}, \[19\]\) += 0 -[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +accept\(0, \{sa_family=AF_(LOCAL|UNIX|FILE)\}, \[19->2\]\) += 1 +[1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +accept4?\(0, \{sa_family=AF_(LOCAL|UNIX|FILE)\}, \[19->2\](, 0)?\) += 1 [1-9][0-9]* +[0-9]+:[0-9]+:[0-9]+\.[0-9]+ +connect\(1, \{sa_family=AF_(LOCAL|UNIX|FILE), sun_path="net-local-stream"\}, 19\) += 0 diff --git a/tests/net.test b/tests/net.test index cf943ffa..cca850a9 100755 --- a/tests/net.test +++ b/tests/net.test @@ -1,11 +1,16 @@ #!/bin/sh - +# # Check how network syscalls are traced. +# +# Copyright (c) 2014-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./net-accept-connect net-local-stream -run_strace_merge -enetwork $args +run_prog ../net-accept-connect net-local-stream +run_strace_merge -e%network $args match_grep exit 0 diff --git a/tests/netlink_audit.c b/tests/netlink_audit.c new file mode 100644 index 00000000..eba609a1 --- /dev/null +++ b/tests/netlink_audit.c @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include "netlink.h" + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = AUDIT_GET, + .nlmsg_flags = NLM_F_REQUEST, + }; + + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=AUDIT_GET" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_AUDIT); + + test_nlmsg_type(fd); + + printf("+++ exited with 0 +++\n"); + + return 0; +} diff --git a/tests/netlink_audit.gen.test b/tests/netlink_audit.gen.test new file mode 100755 index 00000000..5c17038e --- /dev/null +++ b/tests/netlink_audit.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_audit +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/netlink_crypto.c b/tests/netlink_crypto.c new file mode 100644 index 00000000..e2a5be0c --- /dev/null +++ b/tests/netlink_crypto.c @@ -0,0 +1,161 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_CRYPTOUSER_H + +# include +# include +# include +# include +# include "test_netlink.h" + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = CRYPTO_MSG_NEWALG, + .nlmsg_flags = NLM_F_REQUEST, + }; + + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=CRYPTO_MSG_NEWALG" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = CRYPTO_MSG_GETALG; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=CRYPTO_MSG_GETALG" + ", flags=NLM_F_REQUEST|NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = CRYPTO_MSG_NEWALG; + nlh.nlmsg_flags = NLM_F_ECHO | NLM_F_REPLACE; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=CRYPTO_MSG_NEWALG" + ", flags=NLM_F_ECHO|NLM_F_REPLACE, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = CRYPTO_MSG_DELALG; + nlh.nlmsg_flags = NLM_F_ECHO | NLM_F_NONREC; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=CRYPTO_MSG_DELALG" + ", flags=NLM_F_ECHO|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = CRYPTO_MSG_UPDATEALG; + nlh.nlmsg_flags = NLM_F_REPLACE; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=CRYPTO_MSG_UPDATEALG" + ", flags=%#x /* NLM_F_??? */, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, NLM_F_REPLACE, + (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_crypto_msg_newalg(const int fd) +{ + struct crypto_user_alg alg = { + .cru_name = "abcd", + .cru_driver_name = "efgh", + .cru_module_name = "dcba", + .cru_type = 0xabcdfabc, + .cru_mask = 0xfedabacd, + .cru_refcnt = 0xbcacfacd, + .cru_flags = 0xefacdbad + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(alg)); + + TEST_NETLINK_OBJECT_EX(fd, nlh0, + CRYPTO_MSG_NEWALG, NLM_F_REQUEST, + alg, print_quoted_memory, + printf("{cru_name=\"abcd\"" + ", cru_driver_name=\"efgh\"" + ", cru_module_name=\"dcba\""); + PRINT_FIELD_X(", ", alg, cru_type); + PRINT_FIELD_X(", ", alg, cru_mask); + PRINT_FIELD_U(", ", alg, cru_refcnt); + PRINT_FIELD_X(", ", alg, cru_flags); + printf("}")); + + fill_memory_ex(alg.cru_name, sizeof(alg.cru_name), '0', 10); + fill_memory_ex(alg.cru_driver_name, sizeof(alg.cru_driver_name), + 'a', 'z' - 'a' + 1); + fill_memory_ex(alg.cru_module_name, sizeof(alg.cru_module_name), + 'A', 'Z' - 'A' + 1); + + TEST_NETLINK_OBJECT_EX(fd, nlh0, + CRYPTO_MSG_NEWALG, NLM_F_REQUEST, + alg, print_quoted_memory, + printf("{cru_name="); + print_quoted_memory(alg.cru_name, + sizeof(alg.cru_name) - 1); + printf("..., cru_driver_name="); + print_quoted_memory(alg.cru_driver_name, + sizeof(alg.cru_driver_name) - 1); + printf("..., cru_module_name="); + print_quoted_memory(alg.cru_module_name, + sizeof(alg.cru_module_name) - 1); + PRINT_FIELD_X("..., ", alg, cru_type); + PRINT_FIELD_X(", ", alg, cru_mask); + PRINT_FIELD_U(", ", alg, cru_refcnt); + PRINT_FIELD_X(", ", alg, cru_flags); + printf("}")); +} + +static void +test_crypto_msg_unspec(const int fd) +{ + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, 4); + + TEST_NETLINK_(fd, nlh0, + 0xffff, "0xffff /* CRYPTO_MSG_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + 4, "abcd", 4, printf("\"\\x61\\x62\\x63\\x64\"")); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_CRYPTO); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + test_crypto_msg_newalg(fd); + test_crypto_msg_unspec(fd); + + printf("+++ exited with 0 +++\n"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_CRYPTOUSER_H") + +#endif diff --git a/tests/netlink_crypto.gen.test b/tests/netlink_crypto.gen.test new file mode 100755 index 00000000..fcb4c3d9 --- /dev/null +++ b/tests/netlink_crypto.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_crypto +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/netlink_generic.c b/tests/netlink_generic.c new file mode 100644 index 00000000..485ece11 --- /dev/null +++ b/tests/netlink_generic.c @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +/* This test case is based on netlink_selinux.c */ + +#include "tests.h" + +#include +#include +#include +#include +#include "netlink.h" +#include + +static void +test_nlmsg_type(const int fd) +{ + /* + * Though GENL_ID_CTRL number is statically fixed in this test case, + * strace does not have a builtin knowledge that the corresponding + * string is "nlctrl". + */ + long rc; + struct { + const struct nlmsghdr nlh; + struct genlmsghdr gnlh; + } req = { + .nlh = { + .nlmsg_len = sizeof(req), + .nlmsg_type = GENL_ID_CTRL, + .nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST + }, + .gnlh = { + .cmd = CTRL_CMD_GETFAMILY + } + }; + + rc = sendto(fd, &req, sizeof(req), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=nlctrl" + ", flags=NLM_F_REQUEST|0x300, seq=0, pid=0}" + ", \"\\x03\\x00\\x00\\x00\"}, %u" + ", MSG_DONTWAIT, NULL, 0) = %s\n", + fd, req.nlh.nlmsg_len, + (unsigned int) sizeof(req), sprintrc(rc)); +} + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_GENERIC); + + test_nlmsg_type(fd); + + printf("+++ exited with 0 +++\n"); + + return 0; +} diff --git a/tests/netlink_generic.gen.test b/tests/netlink_generic.gen.test new file mode 100755 index 00000000..6f304d3a --- /dev/null +++ b/tests/netlink_generic.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_generic +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/netlink_inet_diag.c b/tests/netlink_inet_diag.c index 2332e203..e3ccc05c 100644 --- a/tests/netlink_inet_diag.c +++ b/tests/netlink_inet_diag.c @@ -2,29 +2,10 @@ * This file is part of inet-yy strace test. * * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,7 +13,7 @@ #include #include #include -#include +#include "netlink.h" #include #include @@ -99,8 +80,8 @@ check_responses(const int fd) perror_msg_and_skip("recvmsg"); struct nlmsghdr *h = &hdr_buf.hdr; - if (!NLMSG_OK(h, ret)) - error_msg_and_skip("!NLMSG_OK"); + if (!is_nlmsg_ok(h, ret)) + error_msg_and_skip("!is_nlmsg_ok"); if (h->nlmsg_type == NLMSG_ERROR) { const struct nlmsgerr *err = NLMSG_DATA(h); if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err))) diff --git a/tests/netlink_kobject_uevent.c b/tests/netlink_kobject_uevent.c new file mode 100644 index 00000000..17f3e1ea --- /dev/null +++ b/tests/netlink_kobject_uevent.c @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include "netlink.h" +#include "netlink_kobject_uevent.h" + +static const char *errstr; + +static ssize_t +sys_send(const int fd, const void *const buf, const size_t len) +{ + const ssize_t rc = sendto(fd, buf, len, MSG_DONTWAIT, NULL, 0); + errstr = sprintrc(rc); + return rc; +} + +static void +test_nlmsg_type_udev(const int fd) +{ + static const char extra[] = "12345678"; + struct udev_monitor_netlink_header uh = { + .prefix = "libudev", + .magic = htonl(0xfeedcafe), + .header_size = sizeof(uh), + .properties_off = 40, + .properties_len = 299, + .filter_subsystem_hash = htonl(0xc370b302), + .filter_devtype_hash = htonl(0x10800000), + .filter_tag_bloom_hi = htonl(0x2000400), + .filter_tag_bloom_lo = htonl(0x10800000), + }; + const unsigned int extra_len = LENGTH_OF(extra); + const unsigned int uh_len = sizeof(uh); + + char *const buf = tail_alloc(uh_len + extra_len); + memcpy(buf + extra_len, &uh, uh_len); + + sys_send(fd, buf + extra_len, uh_len); + printf("sendto(%d, {{prefix=\"%s\", magic=htonl(%#x)" + ", header_size=%u, properties_off=%u, properties_len=%u" + ", filter_subsystem_hash=htonl(%#x)" + ", filter_devtype_hash=htonl(%#x)" + ", filter_tag_bloom_hi=htonl(%#x)" + ", filter_tag_bloom_lo=htonl(%#x)}}, %u, MSG_DONTWAIT, NULL, " + "0) = %s\n" + , fd, uh.prefix, + ntohl(uh.magic), uh.header_size, uh.properties_off, + uh.properties_len, ntohl(uh.filter_subsystem_hash), + ntohl(uh.filter_devtype_hash), ntohl(uh.filter_tag_bloom_hi), + ntohl(uh.filter_tag_bloom_lo), uh_len, errstr); + + memcpy(buf, &uh, uh_len); + memcpy(buf + uh_len, extra, extra_len); + sys_send(fd, buf, uh_len + extra_len); + printf("sendto(%d, {{prefix=\"%s\", magic=htonl(%#x)" + ", header_size=%u, properties_off=%u, properties_len=%u" + ", filter_subsystem_hash=htonl(%#x)" + ", filter_devtype_hash=htonl(%#x)" + ", filter_tag_bloom_hi=htonl(%#x)" + ", filter_tag_bloom_lo=htonl(%#x)}, " + , fd, uh.prefix, + ntohl(uh.magic), uh.header_size, uh.properties_off, + uh.properties_len, ntohl(uh.filter_subsystem_hash), + ntohl(uh.filter_devtype_hash), ntohl(uh.filter_tag_bloom_hi), + ntohl(uh.filter_tag_bloom_lo)); + print_quoted_memory(buf + uh_len, extra_len); + printf("}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + uh_len + extra_len, errstr); + + memcpy(buf + extra_len + 1, &uh, uh_len - 1); + sys_send(fd, buf + extra_len + 1, uh_len); + printf("sendto(%d, ", fd); + print_quoted_memory(&uh, MIN(uh_len - 1, DEFAULT_STRLEN)); + printf("%s, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + (uh_len - 1 > DEFAULT_STRLEN ? "..." : ""), + uh_len, errstr); +} + +static void +test_nlmsg_type_kernel(const int fd) +{ + struct udev_monitor_netlink_header uh = { + .prefix = "change@", + .magic = htonl(0xfeedcafe), + .header_size = sizeof(uh), + .properties_off = 10, + .properties_len = 299, + .filter_subsystem_hash = htonl(0xfffffff), + .filter_devtype_hash = htonl(0x10000000), + .filter_tag_bloom_hi = htonl(0x2000400), + }; + const unsigned int uh_len = sizeof(uh); + + TAIL_ALLOC_OBJECT_CONST_PTR(struct udev_monitor_netlink_header, p); + memcpy(p, &uh, uh_len); + + sys_send(fd, p, uh_len); + printf("sendto(%d, ", fd); + print_quoted_memory(&uh, MIN(uh_len, DEFAULT_STRLEN)); + printf("%s, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + (uh_len > DEFAULT_STRLEN ? "..." : ""), + uh_len, errstr); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_KOBJECT_UEVENT); + + test_nlmsg_type_udev(fd); + test_nlmsg_type_kernel(fd); + /* test using data that looks like a zero-length C string */ + char *const buf = tail_alloc(DEFAULT_STRLEN + 1); + buf[0] = '='; + fill_memory_ex(buf + 1, DEFAULT_STRLEN, 0, DEFAULT_STRLEN); + + sys_send(fd, buf + 1, DEFAULT_STRLEN); + printf("sendto(%d, ", fd); + print_quoted_memory(buf + 1, DEFAULT_STRLEN); + printf(", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + DEFAULT_STRLEN, errstr); + + sys_send(fd, buf, DEFAULT_STRLEN + 1); + printf("sendto(%d, ", fd); + print_quoted_memory(buf, DEFAULT_STRLEN); + printf("..., %u, MSG_DONTWAIT, NULL, 0) = %s\n", + DEFAULT_STRLEN + 1, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/netlink_kobject_uevent.gen.test b/tests/netlink_kobject_uevent.gen.test new file mode 100755 index 00000000..46bdebd1 --- /dev/null +++ b/tests/netlink_kobject_uevent.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_kobject_uevent +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/netlink_netfilter.c b/tests/netlink_netfilter.c new file mode 100644 index 00000000..6f535d4b --- /dev/null +++ b/tests/netlink_netfilter.c @@ -0,0 +1,189 @@ +/* + * Copyright (c) 2017, 2018 Chen Jingpiao + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_H + +# include +# include +# include +# include +# include +# include +# include "test_netlink.h" +# include +# ifdef HAVE_LINUX_NETFILTER_NF_TABLES_H +# include +# endif + +# ifndef NFNETLINK_V0 +# define NFNETLINK_V0 0 +# endif +# ifndef NFNL_SUBSYS_NFTABLES +# define NFNL_SUBSYS_NFTABLES 10 +# endif +# ifndef NFT_MSG_NEWTABLE +# define NFT_MSG_NEWTABLE 0 +# endif + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + +# ifdef NFNL_MSG_BATCH_BEGIN + nlh.nlmsg_type = NFNL_MSG_BATCH_BEGIN; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=NFNL_MSG_BATCH_BEGIN" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +# endif + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK << 8 | 0xff; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK<<8|0xff /* IPCTNL_MSG_CT_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = 0xffff; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=0xff /* NFNL_SUBSYS_??? */<<8|0xff" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_nlmsg_done(const int fd) +{ + const int num = 0xabcdefad; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(num)); + + TEST_NETLINK(fd, nlh0, NLMSG_DONE, NLM_F_REQUEST, + sizeof(num), &num, sizeof(num), + printf("%d", num)); +} + +static void +test_nfgenmsg(const int fd) +{ + static const struct nlattr nla = { + .nla_len = sizeof(nla), + .nla_type = 0x0bcd + }; + + struct nfgenmsg msg = { + .nfgen_family = AF_UNIX, + .version = NFNETLINK_V0, + .res_id = NFNL_SUBSYS_NFTABLES + }; + char str_buf[NLMSG_ALIGN(sizeof(msg)) + 4]; + char nla_buf[NLMSG_ALIGN(sizeof(msg)) + sizeof(nla)]; + + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, + MAX(sizeof(str_buf), sizeof(nla_buf))); + + TEST_NETLINK_OBJECT_EX_(fd, nlh0, + NFNL_SUBSYS_NFTABLES << 8 | NFT_MSG_NEWTABLE, + "NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_NEWTABLE", + NLM_F_REQUEST, "NLM_F_REQUEST", + msg, print_quoted_hex, + printf("{nfgen_family=AF_UNIX"); + printf(", version=NFNETLINK_V0"); + printf(", res_id="); + if (htons(NFNL_SUBSYS_NFTABLES) == NFNL_SUBSYS_NFTABLES) + printf("htons(NFNL_SUBSYS_NFTABLES)"); + else + printf("NFNL_SUBSYS_NFTABLES"); + ); + + msg.res_id = htons(NFNL_SUBSYS_NFTABLES); + TEST_NETLINK_(fd, nlh0, + NFNL_SUBSYS_NFTABLES << 8 | NFT_MSG_NEWTABLE, + "NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_NEWTABLE", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(msg), &msg, sizeof(msg), + printf("{nfgen_family=AF_UNIX"); + printf(", version=NFNETLINK_V0"); + printf(", res_id=htons(NFNL_SUBSYS_NFTABLES)")); + + msg.res_id = htons(0xabcd); + TEST_NETLINK_(fd, nlh0, + NFNL_SUBSYS_NFTABLES << 8 | NFT_MSG_NEWTABLE, + "NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_NEWTABLE", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(msg), &msg, sizeof(msg), + printf("{nfgen_family=AF_UNIX"); + printf(", version=NFNETLINK_V0"); + printf(", res_id=htons(%d)", 0xabcd)); + +# ifdef NFNL_MSG_BATCH_BEGIN + msg.res_id = htons(NFNL_SUBSYS_NFTABLES); + TEST_NETLINK(fd, nlh0, + NFNL_MSG_BATCH_BEGIN, NLM_F_REQUEST, + sizeof(msg), &msg, sizeof(msg), + printf("{nfgen_family=AF_UNIX"); + printf(", version=NFNETLINK_V0"); + printf(", res_id=htons(%d)", NFNL_SUBSYS_NFTABLES)); + + msg.res_id = htons(0xabcd); + memcpy(str_buf, &msg, sizeof(msg)); + memcpy(str_buf + NLMSG_ALIGN(sizeof(msg)), "1234", 4); + + TEST_NETLINK(fd, nlh0, + NFNL_MSG_BATCH_BEGIN, NLM_F_REQUEST, + sizeof(str_buf), str_buf, sizeof(str_buf), + printf("{nfgen_family=AF_UNIX"); + printf(", version=NFNETLINK_V0"); + printf(", res_id=htons(%d)" + ", \"\\x31\\x32\\x33\\x34\"", 0xabcd)); +# endif /* NFNL_MSG_BATCH_BEGIN */ + + msg.res_id = htons(NFNL_SUBSYS_NFTABLES); + memcpy(nla_buf, &msg, sizeof(msg)); + memcpy(nla_buf + NLMSG_ALIGN(sizeof(msg)), &nla, sizeof(nla)); + + TEST_NETLINK_(fd, nlh0, + NFNL_SUBSYS_NFTABLES << 8 | 0xff, + "NFNL_SUBSYS_NFTABLES<<8|0xff /* NFT_MSG_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(nla_buf), nla_buf, sizeof(nla_buf), + printf("{nfgen_family=AF_UNIX"); + printf(", version=NFNETLINK_V0"); + printf(", res_id=htons(NFNL_SUBSYS_NFTABLES)" + ", {nla_len=%d, nla_type=%#x}", + nla.nla_len, nla.nla_type)); +} + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_done(fd); + test_nfgenmsg(fd); + + printf("+++ exited with 0 +++\n"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_H") + +#endif diff --git a/tests/netlink_netfilter.gen.test b/tests/netlink_netfilter.gen.test new file mode 100755 index 00000000..94b3f369 --- /dev/null +++ b/tests/netlink_netfilter.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_netfilter +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/netlink_netlink_diag.c b/tests/netlink_netlink_diag.c index fc32822b..f397605f 100644 --- a/tests/netlink_netlink_diag.c +++ b/tests/netlink_netlink_diag.c @@ -3,29 +3,10 @@ * * Copyright (c) 2014-2016 Dmitry V. Levin * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -33,14 +14,10 @@ #include #include #include -#include +#include "netlink.h" #include #include -#if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG -# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG -#endif - static void send_query(const int fd) { @@ -58,8 +35,7 @@ send_query(const int fd) }, .ndr = { .sdiag_family = AF_NETLINK, - .sdiag_protocol = NDIAG_PROTO_ALL, - .ndiag_show = NDIAG_SHOW_MEMINFO + .sdiag_protocol = NDIAG_PROTO_ALL } }; struct iovec iov = { @@ -104,8 +80,8 @@ check_responses(const int fd) perror_msg_and_skip("recvmsg"); struct nlmsghdr *h = &hdr_buf.hdr; - if (!NLMSG_OK(h, ret)) - error_msg_and_skip("!NLMSG_OK"); + if (!is_nlmsg_ok(h, ret)) + error_msg_and_skip("!is_nlmsg_ok"); if (h->nlmsg_type == NLMSG_ERROR) { const struct nlmsgerr *err = NLMSG_DATA(h); if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err))) diff --git a/tests/netlink_protocol.c b/tests/netlink_protocol.c index 34e114be..fd901d88 100644 --- a/tests/netlink_protocol.c +++ b/tests/netlink_protocol.c @@ -1,31 +1,12 @@ /* * Check decoding of netlink protocol. * - * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2014-2017 Dmitry V. Levin * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -38,14 +19,10 @@ # include # include # include -# include +# include "netlink.h" # include # include -# if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG -# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG -# endif - static void send_query(const int fd) { @@ -87,21 +64,23 @@ send_query(const int fd) /* whole message length < sizeof(struct nlmsghdr) */ rc = sendto(fd, req->magic, sizeof(req->magic), MSG_DONTWAIT, NULL, 0); - printf("sendto(%d, \"abcd\", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + printf("sendto(%d, \"\\x61\\x62\\x63\\x64\"" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, (unsigned) sizeof(req->magic), sprintrc(rc)); /* a single message with some data */ rc = sendto(fd, req, sizeof(*req), MSG_DONTWAIT, NULL, 0); printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}, \"abcd\"}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + ", seq=0, pid=0}, \"\\x61\\x62\\x63\\x64\"}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, req->nlh.nlmsg_len, NLM_F_DUMP, (unsigned) sizeof(*req), sprintrc(rc)); /* a single message without data */ req->nlh.nlmsg_len = sizeof(req->nlh); rc = sendto(fd, &req->nlh, sizeof(req->nlh), MSG_DONTWAIT, NULL, 0); - printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + printf("sendto(%d, {len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, req->nlh.nlmsg_len, NLM_F_DUMP, (unsigned) sizeof(req->nlh), sprintrc(rc)); @@ -109,15 +88,16 @@ send_query(const int fd) req->nlh.nlmsg_len = sizeof(*req) + 8; rc = sendto(fd, req, sizeof(*req), MSG_DONTWAIT, NULL, 0); printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}, \"abcd\"}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + ", seq=0, pid=0}, \"\\x61\\x62\\x63\\x64\"}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, req->nlh.nlmsg_len, NLM_F_DUMP, (unsigned) sizeof(*req), sprintrc(rc)); /* nlmsg_len < sizeof(struct nlmsghdr) */ req->nlh.nlmsg_len = 8; rc = sendto(fd, req, sizeof(*req), MSG_DONTWAIT, NULL, 0); - printf("sendto(%d, {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + printf("sendto(%d, {len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, req->nlh.nlmsg_len, NLM_F_DUMP, (unsigned) sizeof(*req), sprintrc(rc)); @@ -126,14 +106,16 @@ send_query(const int fd) struct req req1; char padding[NLMSG_ALIGN(sizeof(struct req)) - sizeof(struct req)]; struct req req2; - } *const reqs = tail_alloc(sizeof(*reqs)); + }; + TAIL_ALLOC_OBJECT_CONST_PTR(struct reqs, reqs); memcpy(&reqs->req1, &c_req, sizeof(c_req)); memcpy(&reqs->req2, &c_req, sizeof(c_req)); rc = sendto(fd, reqs, sizeof(*reqs), MSG_DONTWAIT, NULL, 0); printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}, \"abcd\"}, {{len=%u, type=NLMSG_NOOP" - ", flags=NLM_F_REQUEST|0x%x, seq=0, pid=0}, \"abcd\"}]" + ", seq=0, pid=0}, \"\\x61\\x62\\x63\\x64\"}" + ", {{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}, \"\\x61\\x62\\x63\\x64\"}]" ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP, reqs->req2.nlh.nlmsg_len, NLM_F_DUMP, @@ -143,8 +125,8 @@ send_query(const int fd) void *const efault2 = tail_memdup(&reqs->req1, sizeof(reqs->req1)); rc = sendto(fd, efault2, sizeof(*reqs), MSG_DONTWAIT, NULL, 0); printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}, \"abcd\"}, %p], %u, MSG_DONTWAIT, NULL, 0)" - " = %s\n", + ", seq=0, pid=0}, \"\\x61\\x62\\x63\\x64\"}" + ", ... /* %p */], %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP, &((struct reqs *) efault2)->req2, (unsigned) sizeof(*reqs), sprintrc(rc)); @@ -154,26 +136,25 @@ send_query(const int fd) NULL, 0); errstr = sprintrc(rc); printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}, \"abcd\"}, \"", + ", seq=0, pid=0}, \"\\x61\\x62\\x63\\x64\"}, ", fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP); - print_quoted_memory((void *) &reqs->req2.nlh, - sizeof(reqs->req2) - sizeof(req->nlh)); - printf("\"], %u, MSG_DONTWAIT, NULL, 0) = %s\n", + print_quoted_hex(&reqs->req2.nlh, + sizeof(reqs->req2) - sizeof(req->nlh)); + printf("], %u, MSG_DONTWAIT, NULL, 0) = %s\n", (unsigned) (sizeof(*reqs) - sizeof(req->nlh)), errstr); /* second nlmsg_len < sizeof(struct nlmsghdr) */ reqs->req2.nlh.nlmsg_len = 4; rc = sendto(fd, reqs, sizeof(*reqs), MSG_DONTWAIT, NULL, 0); printf("sendto(%d, [{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=0, pid=0}, \"abcd\"}, {{len=%u, type=NLMSG_NOOP" - ", flags=NLM_F_REQUEST|0x%x, seq=0, pid=0}}], %u" - ", MSG_DONTWAIT, NULL, 0) = %s\n", + ", seq=0, pid=0}, \"\\x61\\x62\\x63\\x64\"}" + ", {len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=0, pid=0}], %u, MSG_DONTWAIT, NULL, 0) = %s\n", fd, reqs->req1.nlh.nlmsg_len, NLM_F_DUMP, reqs->req2.nlh.nlmsg_len, NLM_F_DUMP, (unsigned) sizeof(*reqs), sprintrc(rc)); /* abbreviated output */ -# define DEFAULT_STRLEN 32 # define ABBREV_LEN (DEFAULT_STRLEN + 1) const unsigned int msg_len = sizeof(struct nlmsghdr) * ABBREV_LEN; struct nlmsghdr *const msgs = tail_alloc(msg_len); @@ -192,31 +173,220 @@ send_query(const int fd) for (i = 0; i < DEFAULT_STRLEN; ++i) { if (i) printf(", "); - printf("{{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" - ", seq=%u, pid=0}}", + printf("{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=%u, pid=0}", msgs[i].nlmsg_len, NLM_F_DUMP, msgs[i].nlmsg_seq); } printf(", ...], %u, MSG_DONTWAIT, NULL, 0) = %s\n", msg_len, errstr); } -int main(void) +static void +test_nlmsgerr(const int fd) +{ + struct nlmsgerr *err; + struct nlmsghdr *nlh; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(*err) + 4); + long rc; + + /* error message without enough room for the error code */ + nlh = nlh0; + nlh->nlmsg_len = NLMSG_HDRLEN + 4; + nlh->nlmsg_type = NLMSG_ERROR; + nlh->nlmsg_flags = NLM_F_REQUEST; + nlh->nlmsg_seq = 0; + nlh->nlmsg_pid = 0; + + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_ERROR, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, %p}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh->nlmsg_len, nlh0 + NLMSG_HDRLEN, + nlh->nlmsg_len, sprintrc(rc)); + + nlh->nlmsg_len = NLMSG_HDRLEN + 2; + nlh = nlh0 - 2; + memmove(nlh, nlh0, sizeof(*nlh)); + memcpy(NLMSG_DATA(nlh), "42", 2); + + rc = sendto(fd, nlh, NLMSG_HDRLEN + 2, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_ERROR, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, \"\\x34\\x32\"}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, NLMSG_HDRLEN + 2, NLMSG_HDRLEN + 2, sprintrc(rc)); + + /* error message with room for the error code only */ + nlh = nlh0 - sizeof(err->error); + nlh->nlmsg_len = NLMSG_HDRLEN + sizeof(err->error); + nlh->nlmsg_type = NLMSG_ERROR; + nlh->nlmsg_flags = NLM_F_REQUEST; + nlh->nlmsg_seq = 0; + nlh->nlmsg_pid = 0; + err = NLMSG_DATA(nlh); + err->error = 42; + + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_ERROR, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, {error=42}}, %u, MSG_DONTWAIT, NULL, 0)" + " = %s\n", fd, nlh->nlmsg_len, nlh->nlmsg_len, sprintrc(rc)); + + err->error = -1; + + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_ERROR, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, {error=-EPERM}}, %u, MSG_DONTWAIT, NULL, 0)" + " = %s\n", fd, nlh->nlmsg_len, nlh->nlmsg_len, sprintrc(rc)); + + err->error = -32767; + nlh->nlmsg_len += sizeof(err->msg.nlmsg_len); + + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_ERROR, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, {error=-32767, msg=%p}}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh->nlmsg_len, nlh0 + NLMSG_HDRLEN, + nlh->nlmsg_len, sprintrc(rc)); + + /* error message with room for the error code and a header */ + nlh = nlh0 - sizeof(*err); + nlh->nlmsg_len = NLMSG_HDRLEN + sizeof(*err); + nlh->nlmsg_type = NLMSG_ERROR; + nlh->nlmsg_flags = NLM_F_REQUEST; + nlh->nlmsg_seq = 0; + nlh->nlmsg_pid = 0; + err = NLMSG_DATA(nlh); + err->error = -13; + err->msg.nlmsg_len = NLMSG_HDRLEN; + err->msg.nlmsg_type = NLMSG_NOOP; + err->msg.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST; + err->msg.nlmsg_seq = 42; + err->msg.nlmsg_pid = 1234; + + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_ERROR, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, {error=-EACCES" + ", msg={len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=%u, pid=%u}}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh->nlmsg_len, err->msg.nlmsg_len, NLM_F_DUMP, + err->msg.nlmsg_seq, err->msg.nlmsg_pid, + nlh->nlmsg_len, sprintrc(rc)); + + /* error message with room for the error code, a header, and some data */ + nlh = nlh0 - sizeof(*err) - 4; + nlh->nlmsg_len = NLMSG_HDRLEN + sizeof(*err) + 4; + nlh->nlmsg_type = NLMSG_ERROR; + nlh->nlmsg_flags = NLM_F_REQUEST; + nlh->nlmsg_seq = 0; + nlh->nlmsg_pid = 0; + err = NLMSG_DATA(nlh); + err->error = -13; + err->msg.nlmsg_len = NLMSG_HDRLEN + 4; + err->msg.nlmsg_type = NLMSG_NOOP; + err->msg.nlmsg_flags = NLM_F_DUMP | NLM_F_REQUEST; + err->msg.nlmsg_seq = 421; + err->msg.nlmsg_pid = 12345; + memcpy(NLMSG_DATA(&err->msg), "abcd", 4); + + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_ERROR, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, {error=-EACCES" + ", msg={{len=%u, type=NLMSG_NOOP, flags=NLM_F_REQUEST|0x%x" + ", seq=%u, pid=%u}, \"\\x61\\x62\\x63\\x64\"}}}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh->nlmsg_len, err->msg.nlmsg_len, NLM_F_DUMP, + err->msg.nlmsg_seq, err->msg.nlmsg_pid, + nlh->nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_done(const int fd) { - struct sockaddr_nl addr; - socklen_t len = sizeof(addr); - int fd; + struct nlmsghdr *nlh; + const int num = 0xfacefeed; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(num)); + long rc; + + /* NLMSG_DONE message without enough room for an integer payload */ + nlh = nlh0; + *nlh = (struct nlmsghdr) { + .nlmsg_len = NLMSG_HDRLEN + sizeof(num), + .nlmsg_type = NLMSG_DONE, + .nlmsg_flags = NLM_F_MULTI + }; + + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_DONE, flags=NLM_F_MULTI" + ", seq=0, pid=0}, %p}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh->nlmsg_len, nlh0 + NLMSG_HDRLEN, + nlh->nlmsg_len, sprintrc(rc)); + + /* NLMSG_DONE message with enough room for an oddly short payload */ + nlh->nlmsg_len = NLMSG_HDRLEN + 2; + nlh = nlh0 - 2; + /* Beware of unaligned access to nlh members. */ + memmove(nlh, nlh0, sizeof(*nlh)); + memcpy(NLMSG_DATA(nlh), "42", 2); + + rc = sendto(fd, nlh, NLMSG_HDRLEN + 2, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_DONE, flags=NLM_F_MULTI, seq=0" + ", pid=0}, \"\\x34\\x32\"}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, NLMSG_HDRLEN + 2, NLMSG_HDRLEN + 2, sprintrc(rc)); + + /* NLMSG_DONE message with enough room for an integer payload */ + nlh = nlh0 - sizeof(num); + *nlh = (struct nlmsghdr) { + .nlmsg_len = NLMSG_HDRLEN + sizeof(num), + .nlmsg_type = NLMSG_DONE, + .nlmsg_flags = NLM_F_MULTI + }; + memcpy(NLMSG_DATA(nlh), &num, sizeof(num)); - memset(&addr, 0, sizeof(addr)); - addr.nl_family = AF_NETLINK; + rc = sendto(fd, nlh, nlh->nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=NLMSG_DONE, flags=NLM_F_MULTI" + ", seq=0, pid=0}, %d}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh->nlmsg_len, num, nlh->nlmsg_len, sprintrc(rc)); +} + +# if defined NLM_F_CAPPED || defined NLM_F_ACK_TLVS +static void +test_ack_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = NLMSG_ERROR, + }; - if ((fd = socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG)) == -1) - perror_msg_and_skip("socket AF_NETLINK"); +# ifdef NLM_F_CAPPED + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_CAPPED, + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=NLMSG_ERROR" + ", flags=NLM_F_REQUEST|NLM_F_CAPPED, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +# endif + +# ifdef NLM_F_ACK_TLVS + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK_TLVS; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=NLMSG_ERROR" + ", flags=NLM_F_REQUEST|NLM_F_ACK_TLVS, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +# endif + +# if defined NLM_F_CAPPED && defined NLM_F_ACK_TLVS + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_CAPPED | NLM_F_ACK_TLVS; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=NLMSG_ERROR" + ", flags=NLM_F_REQUEST|NLM_F_CAPPED|NLM_F_ACK_TLVS, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +# endif +} +# endif - printf("socket(AF_NETLINK, SOCK_RAW, NETLINK_SOCK_DIAG) = %d\n", - fd); - if (bind(fd, (struct sockaddr *) &addr, len)) - perror_msg_and_skip("bind"); - printf("bind(%d, {sa_family=AF_NETLINK, nl_pid=0, nl_groups=00000000}" - ", %u) = 0\n", fd, len); +int main(void) +{ + const int fd = create_nl_socket(NETLINK_SOCK_DIAG); char *path; if (asprintf(&path, "/proc/self/fd/%u", fd) < 0) @@ -227,9 +397,13 @@ int main(void) free(path); send_query(fd); + test_nlmsgerr(fd); + test_nlmsg_done(fd); +# if defined NLM_F_CAPPED || defined NLM_F_ACK_TLVS + test_ack_flags(fd); +# endif - printf("+++ exited with 0 +++\n"); - + puts("+++ exited with 0 +++"); return 0; } diff --git a/tests/netlink_protocol.gen.test b/tests/netlink_protocol.gen.test new file mode 100755 index 00000000..18d06677 --- /dev/null +++ b/tests/netlink_protocol.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_protocol -e trace=sendto); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=sendto diff --git a/tests/netlink_protocol.test b/tests/netlink_protocol.test deleted file mode 100755 index ab2bb1e8..00000000 --- a/tests/netlink_protocol.test +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# Check decoding of netlink protocol. - -. "${srcdir=.}/init.sh" - -# getfdproto is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - -run_strace_match_diff -e trace=network diff --git a/tests/netlink_route.c b/tests/netlink_route.c new file mode 100644 index 00000000..9281e9a4 --- /dev/null +++ b/tests/netlink_route.c @@ -0,0 +1,477 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include "test_netlink.h" +#ifdef HAVE_STRUCT_DCBMSG +# include +#endif +#ifdef HAVE_LINUX_FIB_RULES_H +# include +#endif +#ifdef HAVE_LINUX_IF_ADDR_H +# include +#endif +#ifdef HAVE_STRUCT_IFADDRLBLMSG +# include +#endif +#include +#include +#include +#ifdef HAVE_LINUX_NEIGHBOUR_H +# include +#endif +#ifdef HAVE_STRUCT_NETCONFMSG +# include +#endif +#include + +#define TEST_NL_ROUTE(fd_, nlh0_, type_, obj_, print_family_, ...) \ + do { \ + /* family and string */ \ + TEST_NETLINK((fd_), (nlh0_), \ + type_, NLM_F_REQUEST, \ + sizeof(obj_) - 1, \ + &(obj_), sizeof(obj_) - 1, \ + (print_family_); \ + printf(", ...}")); \ + \ + /* sizeof(obj_) */ \ + TEST_NETLINK((fd_), (nlh0_), \ + type_, NLM_F_REQUEST, \ + sizeof(obj_), &(obj_), sizeof(obj_), \ + (print_family_); \ + __VA_ARGS__); \ + \ + /* short read of sizeof(obj_) */ \ + TEST_NETLINK((fd_), (nlh0_), \ + type_, NLM_F_REQUEST, \ + sizeof(obj_), &(obj_), sizeof(obj_) - 1, \ + (print_family_); \ + printf(", %p}", \ + NLMSG_DATA(TEST_NETLINK_nlh) + 1)); \ + } while (0) + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = RTM_GETLINK, + .nlmsg_flags = NLM_F_REQUEST, + }; + + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=RTM_GETLINK" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = RTM_GETLINK; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=RTM_GETLINK" + ", flags=NLM_F_REQUEST|NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = RTM_DELACTION; + nlh.nlmsg_flags = NLM_F_ROOT; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=RTM_DELACTION" + ", flags=NLM_F_ROOT, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = RTM_NEWLINK; + nlh.nlmsg_flags = NLM_F_ECHO | NLM_F_REPLACE; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=RTM_NEWLINK" + ", flags=NLM_F_ECHO|NLM_F_REPLACE, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = RTM_DELLINK; + nlh.nlmsg_flags = NLM_F_NONREC; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=RTM_DELLINK" + ", flags=NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_nlmsg_done(const int fd) +{ + const int num = 0xabcdefad; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(num)); + + TEST_NETLINK(fd, nlh0, NLMSG_DONE, NLM_F_REQUEST, + sizeof(num), &num, sizeof(num), + printf("%d", num)); +} + +static void +test_rtnl_unspec(const int fd) +{ + uint8_t family = 0; + char buf[sizeof(family) + 4]; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(buf)); + + /* unspecified family only */ + TEST_NETLINK_(fd, nlh0, + 0xffff, "0xffff /* RTM_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(family), &family, sizeof(family), + printf("{family=AF_UNSPEC}")); + + /* unknown family only */ + family = 0xff; + TEST_NETLINK_(fd, nlh0, + 0xffff, "0xffff /* RTM_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(family), &family, sizeof(family), + printf("{family=0xff /* AF_??? */}")); + + /* short read of family */ + TEST_NETLINK_(fd, nlh0, + 0xffff, "0xffff /* RTM_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(family), &family, sizeof(family) - 1, + printf("%p", NLMSG_DATA(TEST_NETLINK_nlh))); + + /* unspecified family and string */ + family = 0; + memcpy(buf, &family, sizeof(family)); + memcpy(buf + sizeof(family), "1234", 4); + TEST_NETLINK_(fd, nlh0, + 0xffff, "0xffff /* RTM_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(buf), buf, sizeof(buf), + printf("{family=AF_UNSPEC, \"\\x31\\x32\\x33\\x34\"}")); + + /* unknown family and string */ + family = 0xfd; + memcpy(buf, &family, sizeof(family)); + TEST_NETLINK_(fd, nlh0, + 0xffff, "0xffff /* RTM_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + sizeof(buf), buf, sizeof(buf), + printf("{family=%#x /* AF_??? */" + ", \"\\x31\\x32\\x33\\x34\"}", family)); +} + +static void +test_rtnl_link(const int fd) +{ + const struct ifinfomsg ifinfo = { + .ifi_family = AF_UNIX, + .ifi_type = ARPHRD_LOOPBACK, + .ifi_index = ifindex_lo(), + .ifi_flags = IFF_UP, + .ifi_change = 0xfabcdeba + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(ifinfo)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETLINK, ifinfo, + printf("{ifi_family=AF_UNIX"), + printf(", ifi_type=ARPHRD_LOOPBACK" + ", ifi_index=" IFINDEX_LO_STR + ", ifi_flags=IFF_UP"); + PRINT_FIELD_X(", ", ifinfo, ifi_change); + printf("}")); +} + +static void +test_rtnl_addr(const int fd) +{ + const struct ifaddrmsg msg = { + .ifa_family = AF_UNIX, + .ifa_prefixlen = 0xde, + .ifa_flags = IFA_F_SECONDARY, + .ifa_scope = RT_SCOPE_UNIVERSE, + .ifa_index = ifindex_lo() + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETADDR, msg, + printf("{ifa_family=AF_UNIX"), + PRINT_FIELD_U(", ", msg, ifa_prefixlen); + printf(", ifa_flags=IFA_F_SECONDARY" + ", ifa_scope=RT_SCOPE_UNIVERSE" + ", ifa_index=" IFINDEX_LO_STR); + printf("}")); +} + +static void +test_rtnl_route(const int fd) +{ + static const struct rtmsg msg = { + .rtm_family = AF_UNIX, + .rtm_dst_len = 0xaf, + .rtm_src_len = 0xda, + .rtm_tos = IPTOS_LOWDELAY, + .rtm_table = RT_TABLE_DEFAULT, + .rtm_protocol = RTPROT_KERNEL, + .rtm_scope = RT_SCOPE_UNIVERSE, + .rtm_type = RTN_LOCAL, + .rtm_flags = RTM_F_NOTIFY + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETROUTE, msg, + printf("{rtm_family=AF_UNIX"), + PRINT_FIELD_U(", ", msg, rtm_dst_len); + PRINT_FIELD_U(", ", msg, rtm_src_len); + printf(", rtm_tos=IPTOS_LOWDELAY" + ", rtm_table=RT_TABLE_DEFAULT" + ", rtm_protocol=RTPROT_KERNEL" + ", rtm_scope=RT_SCOPE_UNIVERSE" + ", rtm_type=RTN_LOCAL" + ", rtm_flags=RTM_F_NOTIFY}")); +} + +#ifdef HAVE_LINUX_FIB_RULES_H +static void +test_rtnl_rule(const int fd) +{ + struct rtmsg msg = { + .rtm_family = AF_UNIX, + .rtm_dst_len = 0xaf, + .rtm_src_len = 0xda, + .rtm_tos = IPTOS_LOWDELAY, + .rtm_table = RT_TABLE_UNSPEC, + .rtm_type = FR_ACT_TO_TBL, + .rtm_flags = FIB_RULE_INVERT + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETRULE, msg, + printf("{family=AF_UNIX"), + printf(", dst_len=%u, src_len=%u" + ", tos=IPTOS_LOWDELAY" + ", table=RT_TABLE_UNSPEC" + ", action=FR_ACT_TO_TBL" + ", flags=FIB_RULE_INVERT}", + msg.rtm_dst_len, + msg.rtm_src_len)); +} +#endif + +static void +test_rtnl_neigh(const int fd) +{ + const struct ndmsg msg = { + .ndm_family = AF_UNIX, + .ndm_ifindex = ifindex_lo(), + .ndm_state = NUD_PERMANENT, + .ndm_flags = NTF_PROXY, + .ndm_type = RTN_UNSPEC + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETNEIGH, msg, + printf("{ndm_family=AF_UNIX"), + printf(", ndm_ifindex=" IFINDEX_LO_STR + ", ndm_state=NUD_PERMANENT" + ", ndm_flags=NTF_PROXY" + ", ndm_type=RTN_UNSPEC}")); +} + +static void +test_rtnl_neightbl(const int fd) +{ + static const struct ndtmsg msg = { + .ndtm_family = AF_NETLINK + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NETLINK(fd, nlh0, + RTM_GETNEIGHTBL, NLM_F_REQUEST, + sizeof(msg), &msg, sizeof(msg), + printf("{ndtm_family=AF_NETLINK}")); +} + +static void +test_rtnl_tc(const int fd) +{ + const struct tcmsg msg = { + .tcm_family = AF_UNIX, + .tcm_ifindex = ifindex_lo(), + .tcm_handle = 0xfadcdafb, + .tcm_parent = 0xafbcadab, + .tcm_info = 0xbcaedafa + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETQDISC, msg, + printf("{tcm_family=AF_UNIX"), + printf(", tcm_ifindex=" IFINDEX_LO_STR); + PRINT_FIELD_U(", ", msg, tcm_handle); + PRINT_FIELD_U(", ", msg, tcm_parent); + PRINT_FIELD_U(", ", msg, tcm_info); + printf("}")); +} + +static void +test_rtnl_tca(const int fd) +{ + struct tcamsg msg = { + .tca_family = AF_INET + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NETLINK(fd, nlh0, + RTM_GETACTION, NLM_F_REQUEST, + sizeof(msg), &msg, sizeof(msg), + printf("{tca_family=AF_INET}")); +} + +#ifdef HAVE_STRUCT_IFADDRLBLMSG +static void +test_rtnl_addrlabel(const int fd) +{ + const struct ifaddrlblmsg msg = { + .ifal_family = AF_UNIX, + .ifal_prefixlen = 0xaf, + .ifal_flags = 0xbd, + .ifal_index = ifindex_lo(), + .ifal_seq = 0xfadcdafb + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETADDRLABEL, msg, + printf("{ifal_family=AF_UNIX"), + PRINT_FIELD_U(", ", msg, ifal_prefixlen); + PRINT_FIELD_U(", ", msg, ifal_flags); + printf(", ifal_index=" IFINDEX_LO_STR); + PRINT_FIELD_U(", ", msg, ifal_seq); + printf("}")); +} +#endif + +#ifdef HAVE_STRUCT_DCBMSG +static void +test_rtnl_dcb(const int fd) +{ + static const struct dcbmsg msg = { + .dcb_family = AF_UNIX, + .cmd = DCB_CMD_UNDEFINED + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETDCB, msg, + printf("{dcb_family=AF_UNIX"), + printf(", cmd=DCB_CMD_UNDEFINED}")); +} +#endif + +#ifdef HAVE_STRUCT_NETCONFMSG +static void +test_rtnl_netconf(const int fd) +{ + static const struct netconfmsg msg = { + .ncm_family = AF_INET + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NETLINK(fd, nlh0, + RTM_GETNETCONF, NLM_F_REQUEST, + sizeof(msg), &msg, sizeof(msg), + printf("{ncm_family=AF_INET}")); +} +#endif + +#ifdef HAVE_STRUCT_BR_PORT_MSG +static void +test_rtnl_mdb(const int fd) +{ + const struct br_port_msg msg = { + .family = AF_UNIX, + .ifindex = ifindex_lo() + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NL_ROUTE(fd, nlh0, RTM_GETMDB, msg, + printf("{family=AF_UNIX"), + printf(", ifindex=" IFINDEX_LO_STR "}")); +} +#endif + +#ifdef RTM_NEWNSID +static void +test_rtnl_nsid(const int fd) +{ + static const struct rtgenmsg msg = { + .rtgen_family = AF_UNIX + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NETLINK(fd, nlh0, + RTM_GETNSID, NLM_F_REQUEST, + sizeof(msg), &msg, sizeof(msg), + printf("{rtgen_family=AF_UNIX}")); +} +#endif + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_ROUTE); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + test_nlmsg_done(fd); + test_rtnl_unspec(fd); + test_rtnl_link(fd); + test_rtnl_addr(fd); + test_rtnl_route(fd); +#ifdef HAVE_LINUX_FIB_RULES_H + test_rtnl_rule(fd); +#endif + test_rtnl_neigh(fd); + test_rtnl_neightbl(fd); + test_rtnl_tc(fd); + test_rtnl_tca(fd); +#ifdef HAVE_STRUCT_IFADDRLBLMSG + test_rtnl_addrlabel(fd); +#endif +#ifdef HAVE_STRUCT_DCBMSG + test_rtnl_dcb(fd); +#endif +#ifdef HAVE_STRUCT_NETCONFMSG + test_rtnl_netconf(fd); +#endif +#ifdef HAVE_STRUCT_BR_PORT_MSG + test_rtnl_mdb(fd); +#endif +#ifdef RTM_NEWNSID + test_rtnl_nsid(fd); +#endif + + printf("+++ exited with 0 +++\n"); + + return 0; +} diff --git a/tests/netlink_route.gen.test b/tests/netlink_route.gen.test new file mode 100755 index 00000000..bd9c0d95 --- /dev/null +++ b/tests/netlink_route.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_route +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/netlink_selinux.c b/tests/netlink_selinux.c new file mode 100644 index 00000000..85b50478 --- /dev/null +++ b/tests/netlink_selinux.c @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include "test_netlink.h" +#include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = SELNL_MSG_SETENFORCE, + .nlmsg_flags = NLM_F_REQUEST, + }; + + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=SELNL_MSG_SETENFORCE" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_selnl_msg_unspec(const int fd) +{ + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, 4); + + TEST_NETLINK_(fd, nlh0, + 0xffff, "0xffff /* SELNL_MSG_??? */", + NLM_F_REQUEST, "NLM_F_REQUEST", + 4, "1234", 4, + printf("\"\\x31\\x32\\x33\\x34\"")); +} + +static void +test_selnl_msg_setenforce(const int fd) +{ + static const struct selnl_msg_setenforce msg = { + .val = 0xfbdcdfab + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NETLINK_OBJECT(fd, nlh0, + SELNL_MSG_SETENFORCE, NLM_F_REQUEST, msg, + PRINT_FIELD_D("{", msg, val); + printf("}")); +} + +static void +test_selnl_msg_policyload(const int fd) +{ + static const struct selnl_msg_policyload msg = { + .seqno = 0xabdcfabc + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(msg)); + + TEST_NETLINK_OBJECT(fd, nlh0, + SELNL_MSG_POLICYLOAD, NLM_F_REQUEST, msg, + PRINT_FIELD_U("{", msg, seqno); + printf("}")); +} + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_SELINUX); + + test_nlmsg_type(fd); + test_selnl_msg_unspec(fd); + test_selnl_msg_setenforce(fd); + test_selnl_msg_policyload(fd); + + printf("+++ exited with 0 +++\n"); + + return 0; +} diff --git a/tests/netlink_selinux.gen.test b/tests/netlink_selinux.gen.test new file mode 100755 index 00000000..484ffae7 --- /dev/null +++ b/tests/netlink_selinux.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_selinux +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/netlink_sock_diag-v.sh b/tests/netlink_sock_diag-v.sh new file mode 100755 index 00000000..0fb467db --- /dev/null +++ b/tests/netlink_sock_diag-v.sh @@ -0,0 +1,13 @@ +#!/bin/sh +# +# Check verbose decoding of NETLINK_SOCK_DIAG protocol +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog ../netlink_netlink_diag +run_strace_match_diff -v -e trace=sendto diff --git a/tests/netlink_sock_diag.c b/tests/netlink_sock_diag.c new file mode 100644 index 00000000..591c3944 --- /dev/null +++ b/tests/netlink_sock_diag.c @@ -0,0 +1,659 @@ +/* + * Copyright (c) 2016 Fabien Siron + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include "test_netlink.h" +#include +#include +#include +#include +#ifdef AF_SMC +# include +#endif +#include +#include + +#define SMC_ACTIVE 1 + +#define TEST_SOCK_DIAG(fd_, nlh0_, \ + family_, type_, flags_, \ + obj_, print_family_, ...) \ + \ + do { \ + /* family only */ \ + uint8_t family = (family_); \ + TEST_NETLINK_((fd_), (nlh0_), \ + type_, #type_, \ + flags_, #flags_, \ + sizeof(family), &family, sizeof(family), \ + printf("{family=%s}", #family_)); \ + \ + /* family and string */ \ + char buf[sizeof(family) + 4]; \ + memcpy(buf, &family, sizeof(family)); \ + memcpy(buf + sizeof(family), "1234", 4); \ + TEST_NETLINK_((fd_), (nlh0_), \ + type_, #type_, \ + flags_, #flags_, \ + sizeof(buf), buf, sizeof(buf), \ + (print_family_); \ + printf(", ...}")); \ + \ + /* sizeof(obj_) */ \ + TEST_NETLINK_((fd_), (nlh0_), \ + type_, #type_, \ + flags_, #flags_, \ + sizeof(obj_), &(obj_), sizeof(obj_), \ + (print_family_); \ + __VA_ARGS__); \ + \ + /* short read of sizeof(obj_) */ \ + TEST_NETLINK_((fd_), (nlh0_), \ + type_, #type_, \ + flags_, #flags_, \ + sizeof(obj_), &(obj_), sizeof(obj_) - 1, \ + (print_family_); \ + printf(", %p}", \ + NLMSG_DATA(TEST_NETLINK_nlh) + 1));\ + } while (0) + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_REQUEST, + }; + + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP, + }; + + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_REQUEST|NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_odd_family_req(const int fd) +{ + uint8_t family = 0; + char buf[sizeof(family) + 4]; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(buf)); + + /* unspecified family only */ + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, + NLM_F_REQUEST, + sizeof(family), &family, sizeof(family), + printf("{family=AF_UNSPEC}")); + + /* unknown family only */ + family = 0xff; + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, + NLM_F_REQUEST, + sizeof(family), &family, sizeof(family), + printf("{family=%#x /* AF_??? */}", family)); + + /* short read of family */ + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, + NLM_F_REQUEST, + sizeof(family), &family, sizeof(family) - 1, + printf("%p", NLMSG_DATA(TEST_NETLINK_nlh))); + + /* unspecified family and string */ + family = 0; + memcpy(buf, &family, sizeof(family)); + memcpy(buf + sizeof(family), "1234", 4); + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, + NLM_F_REQUEST, + sizeof(buf), buf, sizeof(buf), + printf("{family=AF_UNSPEC, \"\\x31\\x32\\x33\\x34\"}")); + + /* unknown family and string */ + family = 0xfd; + memcpy(buf, &family, sizeof(family)); + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, + NLM_F_REQUEST, + sizeof(buf), buf, sizeof(buf), + printf("{family=%#x /* AF_??? */" + ", \"\\x31\\x32\\x33\\x34\"}", family)); +} + +static void +test_odd_family_msg(const int fd) +{ + uint8_t family = 0; + char buf[sizeof(family) + 4]; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(buf)); + + /* unspecified family only */ + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, NLM_F_DUMP, + sizeof(family), &family, sizeof(family), + printf("{family=AF_UNSPEC}")); + + /* unknown family only */ + family = 0xff; + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, NLM_F_DUMP, + sizeof(family), &family, sizeof(family), + printf("{family=%#x /* AF_??? */}", family)); + + /* short read of family */ + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, NLM_F_DUMP, + sizeof(family), &family, sizeof(family) - 1, + printf("%p", NLMSG_DATA(TEST_NETLINK_nlh))); + + /* unspecified family and string */ + family = 0; + memcpy(buf, &family, sizeof(family)); + memcpy(buf + sizeof(family), "1234", 4); + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, NLM_F_DUMP, + sizeof(buf), buf, sizeof(buf), + printf("{family=AF_UNSPEC, \"\\x31\\x32\\x33\\x34\"}")); + + /* unknown family and string */ + family = 0xfd; + memcpy(buf, &family, sizeof(family)); + TEST_NETLINK(fd, nlh0, + SOCK_DIAG_BY_FAMILY, NLM_F_DUMP, + sizeof(buf), buf, sizeof(buf), + printf("{family=%#x /* AF_??? */" + ", \"\\x31\\x32\\x33\\x34\"}", family)); +} + +static void +test_unix_diag_req(const int fd) +{ + static const struct unix_diag_req req = { + .sdiag_family = AF_UNIX, + .sdiag_protocol = 253, + .udiag_states = 1 << TCP_ESTABLISHED | 1 << TCP_LISTEN, + .udiag_ino = 0xfacefeed, + .udiag_show = UDIAG_SHOW_NAME, + .udiag_cookie = { 0xdeadbeef, 0xbadc0ded } + }; + void *const nlh0 = midtail_alloc(NLMSG_HDRLEN, sizeof(req)); + TEST_SOCK_DIAG(fd, nlh0, AF_UNIX, + SOCK_DIAG_BY_FAMILY, NLM_F_REQUEST, req, + printf("{sdiag_family=AF_UNIX"), + PRINT_FIELD_U(", ", req, sdiag_protocol); + printf(", udiag_states=1< + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,14 +17,10 @@ #include #include #include -#include +#include "netlink.h" #include #include -#if !defined NETLINK_SOCK_DIAG && defined NETLINK_INET_DIAG -# define NETLINK_SOCK_DIAG NETLINK_INET_DIAG -#endif - static void send_query(const int fd) { @@ -107,8 +84,8 @@ check_responses(const int fd) perror_msg_and_skip("recvmsg"); struct nlmsghdr *h = &hdr_buf.hdr; - if (!NLMSG_OK(h, ret)) - error_msg_and_skip("!NLMSG_OK"); + if (!is_nlmsg_ok(h, ret)) + error_msg_and_skip("!is_nlmsg_ok"); if (h->nlmsg_type == NLMSG_ERROR) { const struct nlmsgerr *err = NLMSG_DATA(h); if (h->nlmsg_len < NLMSG_LENGTH(sizeof(*err))) diff --git a/tests/netlink_xfrm.c b/tests/netlink_xfrm.c new file mode 100644 index 00000000..26095fba --- /dev/null +++ b/tests/netlink_xfrm.c @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include "netlink.h" +#include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_type = XFRM_MSG_NEWSA, + .nlmsg_flags = NLM_F_REQUEST, + }; + + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=XFRM_MSG_NEWSA" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = XFRM_MSG_GETSA; + nlh.nlmsg_flags = NLM_F_DUMP; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=XFRM_MSG_GETSA" + ", flags=NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = XFRM_MSG_NEWSA; + nlh.nlmsg_flags = NLM_F_REPLACE; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=XFRM_MSG_NEWSA" + ", flags=NLM_F_REPLACE, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = XFRM_MSG_DELSA; + nlh.nlmsg_flags = NLM_F_ECHO | NLM_F_NONREC; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=XFRM_MSG_DELSA" + ", flags=NLM_F_ECHO|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, (unsigned) sizeof(nlh), sprintrc(rc)); + + nlh.nlmsg_type = XFRM_MSG_ALLOCSPI; + nlh.nlmsg_flags = NLM_F_ECHO | NLM_F_REPLACE; + rc = sendto(fd, &nlh, sizeof(nlh), MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u, type=XFRM_MSG_ALLOCSPI" + ", flags=NLM_F_ECHO|%#x, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, NLM_F_REPLACE, + (unsigned) sizeof(nlh), sprintrc(rc)); +} + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_XFRM); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + printf("+++ exited with 0 +++\n"); + + return 0; +} diff --git a/tests/netlink_xfrm.gen.test b/tests/netlink_xfrm.gen.test new file mode 100755 index 00000000..36918982 --- /dev/null +++ b/tests/netlink_xfrm.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (netlink_xfrm +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/newfstatat.c b/tests/newfstatat.c index b501d880..955dce6d 100644 --- a/tests/newfstatat.c +++ b/tests/newfstatat.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/newfstatat.gen.test b/tests/newfstatat.gen.test new file mode 100755 index 00000000..40ec797c --- /dev/null +++ b/tests/newfstatat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (newfstatat -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests/newfstatat.test b/tests/newfstatat.test deleted file mode 100755 index 6d83ec08..00000000 --- a/tests/newfstatat.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check newfstatat syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests/nfnetlink_acct.c b/tests/nfnetlink_acct.c new file mode 100644 index 00000000..7e4f6d5d --- /dev/null +++ b/tests/nfnetlink_acct.c @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_ACCT_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_ACCT << 8 | NFNL_MSG_ACCT_NEW; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_ACCT<<8|NFNL_MSG_ACCT_NEW" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_ACCT << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_ACCT<<8|0xff /* NFNL_MSG_ACCT_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = NFNL_SUBSYS_ACCT << 8 | NFNL_MSG_ACCT_NEW; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_ACCT<<8|NFNL_MSG_ACCT_NEW" + ", flags=NLM_F_REQUEST|NLM_F_CREATE, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_ACCT << 8 | NFNL_MSG_ACCT_GET; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_MATCH; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_ACCT<<8|NFNL_MSG_ACCT_GET" + ", flags=NLM_F_REQUEST|NLM_F_MATCH, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_ACCT << 8 | NFNL_MSG_ACCT_DEL; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_NONREC; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_ACCT<<8|NFNL_MSG_ACCT_DEL" + ", flags=NLM_F_REQUEST|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_ACCT_H") + +#endif diff --git a/tests/nfnetlink_acct.gen.test b/tests/nfnetlink_acct.gen.test new file mode 100755 index 00000000..e3aa8892 --- /dev/null +++ b/tests/nfnetlink_acct.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_acct +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nfnetlink_cthelper.c b/tests/nfnetlink_cthelper.c new file mode 100644 index 00000000..860ad293 --- /dev/null +++ b/tests/nfnetlink_cthelper.c @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_CTHELPER_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_CTHELPER << 8 | NFNL_MSG_CTHELPER_NEW; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTHELPER<<8|NFNL_MSG_CTHELPER_NEW" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTHELPER << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTHELPER<<8|0xff /* NFNL_MSG_CTHELPER_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = NFNL_SUBSYS_CTHELPER << 8 | NFNL_MSG_CTHELPER_NEW; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_REPLACE; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTHELPER<<8|NFNL_MSG_CTHELPER_NEW" + ", flags=NLM_F_REQUEST|NLM_F_REPLACE, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTHELPER << 8 | NFNL_MSG_CTHELPER_GET; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTHELPER<<8|NFNL_MSG_CTHELPER_GET" + ", flags=NLM_F_REQUEST|NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTHELPER << 8 | NFNL_MSG_CTHELPER_DEL; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_NONREC; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTHELPER<<8|NFNL_MSG_CTHELPER_DEL" + ", flags=NLM_F_REQUEST|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_CTHELPER_H") + +#endif diff --git a/tests/nfnetlink_cthelper.gen.test b/tests/nfnetlink_cthelper.gen.test new file mode 100755 index 00000000..fa26e14a --- /dev/null +++ b/tests/nfnetlink_cthelper.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_cthelper +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nfnetlink_ctnetlink.c b/tests/nfnetlink_ctnetlink.c new file mode 100644 index 00000000..ee53ef88 --- /dev/null +++ b/tests/nfnetlink_ctnetlink.c @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_CONNTRACK_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK << 8 | IPCTNL_MSG_CT_NEW; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK<<8|IPCTNL_MSG_CT_NEW" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK<<8|0xff /* IPCTNL_MSG_CT_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK << 8 | IPCTNL_MSG_CT_NEW; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_REPLACE; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK<<8|IPCTNL_MSG_CT_NEW" + ", flags=NLM_F_REQUEST|NLM_F_REPLACE, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK << 8 | IPCTNL_MSG_CT_GET; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK<<8|IPCTNL_MSG_CT_GET" + ", flags=NLM_F_REQUEST|NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK << 8 | IPCTNL_MSG_CT_DELETE; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_NONREC; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK<<8|IPCTNL_MSG_CT_DELETE" + ", flags=NLM_F_REQUEST|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_CONNTRACK_H") + +#endif diff --git a/tests/nfnetlink_ctnetlink.gen.test b/tests/nfnetlink_ctnetlink.gen.test new file mode 100755 index 00000000..9e9ad153 --- /dev/null +++ b/tests/nfnetlink_ctnetlink.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_ctnetlink +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nfnetlink_ctnetlink_exp.c b/tests/nfnetlink_ctnetlink_exp.c new file mode 100644 index 00000000..13c8a3bc --- /dev/null +++ b/tests/nfnetlink_ctnetlink_exp.c @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_CONNTRACK_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK_EXP << 8 | IPCTNL_MSG_EXP_NEW; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_EXP<<8|IPCTNL_MSG_EXP_NEW" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK_EXP << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_EXP<<8|0xff /* IPCTNL_MSG_EXP_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK_EXP << 8 | IPCTNL_MSG_EXP_NEW; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_EXCL; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_EXP<<8|IPCTNL_MSG_EXP_NEW" + ", flags=NLM_F_REQUEST|NLM_F_EXCL, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK_EXP << 8 | IPCTNL_MSG_EXP_GET; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ROOT; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_EXP<<8|IPCTNL_MSG_EXP_GET" + ", flags=NLM_F_REQUEST|NLM_F_ROOT, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK_EXP << 8 | IPCTNL_MSG_EXP_DELETE; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_NONREC; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_EXP<<8|IPCTNL_MSG_EXP_DELETE" + ", flags=NLM_F_REQUEST|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_CONNTRACK_H") + +#endif diff --git a/tests/nfnetlink_ctnetlink_exp.gen.test b/tests/nfnetlink_ctnetlink_exp.gen.test new file mode 100755 index 00000000..4ed3707e --- /dev/null +++ b/tests/nfnetlink_ctnetlink_exp.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_ctnetlink_exp +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nfnetlink_cttimeout.c b/tests/nfnetlink_cttimeout.c new file mode 100644 index 00000000..9602df7c --- /dev/null +++ b/tests/nfnetlink_cttimeout.c @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_CTTIMEOUT_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = + NFNL_SUBSYS_CTNETLINK_TIMEOUT << 8 | IPCTNL_MSG_TIMEOUT_NEW; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_TIMEOUT<<8|IPCTNL_MSG_TIMEOUT_NEW" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_CTNETLINK_TIMEOUT << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_TIMEOUT<<8|0xff /* IPCTNL_MSG_TIMEOUT_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = + NFNL_SUBSYS_CTNETLINK_TIMEOUT << 8 | IPCTNL_MSG_TIMEOUT_NEW; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_APPEND; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_TIMEOUT<<8|IPCTNL_MSG_TIMEOUT_NEW" + ", flags=NLM_F_REQUEST|NLM_F_APPEND, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = + NFNL_SUBSYS_CTNETLINK_TIMEOUT << 8 | IPCTNL_MSG_TIMEOUT_GET; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_ATOMIC; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_TIMEOUT<<8|IPCTNL_MSG_TIMEOUT_GET" + ", flags=NLM_F_REQUEST|NLM_F_ATOMIC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = + NFNL_SUBSYS_CTNETLINK_TIMEOUT << 8 | IPCTNL_MSG_TIMEOUT_DELETE; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_NONREC; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_CTNETLINK_TIMEOUT<<8|IPCTNL_MSG_TIMEOUT_DELETE" + ", flags=NLM_F_REQUEST|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_CTTIMEOUT_H") + +#endif diff --git a/tests/nfnetlink_cttimeout.gen.test b/tests/nfnetlink_cttimeout.gen.test new file mode 100755 index 00000000..ab42fc78 --- /dev/null +++ b/tests/nfnetlink_cttimeout.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_cttimeout +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nfnetlink_ipset.c b/tests/nfnetlink_ipset.c new file mode 100644 index 00000000..853ac307 --- /dev/null +++ b/tests/nfnetlink_ipset.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_IPSET_IP_SET_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_IPSET << 8 | IPSET_CMD_NONE; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_IPSET<<8|IPSET_CMD_NONE" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_IPSET << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_IPSET<<8|0xff /* IPSET_CMD_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_IPSET_IP_SET_H") + +#endif diff --git a/tests/nfnetlink_ipset.gen.test b/tests/nfnetlink_ipset.gen.test new file mode 100755 index 00000000..ea129fbc --- /dev/null +++ b/tests/nfnetlink_ipset.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_ipset +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nfnetlink_nft_compat.c b/tests/nfnetlink_nft_compat.c new file mode 100644 index 00000000..e5514f66 --- /dev/null +++ b/tests/nfnetlink_nft_compat.c @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NF_TABLES_COMPAT_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_NFT_COMPAT << 8 | NFNL_MSG_COMPAT_GET; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFT_COMPAT<<8|NFNL_MSG_COMPAT_GET" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_NFT_COMPAT << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFT_COMPAT<<8|0xff /* NFNL_MSG_COMPAT_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = NFNL_SUBSYS_NFT_COMPAT << 8 | NFNL_MSG_COMPAT_GET; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFT_COMPAT<<8|NFNL_MSG_COMPAT_GET" + ", flags=NLM_F_REQUEST|NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NF_TABLES_COMPAT_H") + +#endif diff --git a/tests/nfnetlink_nft_compat.gen.test b/tests/nfnetlink_nft_compat.gen.test new file mode 100755 index 00000000..aff04c5f --- /dev/null +++ b/tests/nfnetlink_nft_compat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_nft_compat +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nfnetlink_nftables.c b/tests/nfnetlink_nftables.c new file mode 100644 index 00000000..e959f703 --- /dev/null +++ b/tests/nfnetlink_nftables.c @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NF_TABLES_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_NFTABLES << 8 | NFT_MSG_NEWTABLE; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_NEWTABLE" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_NFTABLES << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFTABLES<<8|0xff /* NFT_MSG_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +static void +test_nlmsg_flags(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + }; + + nlh.nlmsg_type = NFNL_SUBSYS_NFTABLES << 8 | NFT_MSG_NEWTABLE; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_REPLACE; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_NEWTABLE" + ", flags=NLM_F_REQUEST|NLM_F_REPLACE, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_NFTABLES << 8 | NFT_MSG_GETTABLE; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_DUMP; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_GETTABLE" + ", flags=NLM_F_REQUEST|NLM_F_DUMP, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_NFTABLES << 8 | NFT_MSG_DELTABLE; + nlh.nlmsg_flags = NLM_F_REQUEST | NLM_F_NONREC; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_NFTABLES<<8|NFT_MSG_DELTABLE" + ", flags=NLM_F_REQUEST|NLM_F_NONREC, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + test_nlmsg_flags(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NF_TABLES_H") + +#endif diff --git a/tests/nfnetlink_nftables.gen.test b/tests/nfnetlink_nftables.gen.test new file mode 100755 index 00000000..c23ad330 --- /dev/null +++ b/tests/nfnetlink_nftables.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_nftables +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nfnetlink_osf.c b/tests/nfnetlink_osf.c new file mode 100644 index 00000000..755615fc --- /dev/null +++ b/tests/nfnetlink_osf.c @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_XT_OSF_H + +# include +# include +# include "netlink.h" +# include +# include +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_OSF << 8 | OSF_MSG_ADD; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_OSF<<8|OSF_MSG_ADD" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_OSF << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_OSF<<8|0xff /* OSF_MSG_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_XT_OSF_H") + +#endif diff --git a/tests/nfnetlink_osf.gen.test b/tests/nfnetlink_osf.gen.test new file mode 100755 index 00000000..aa540907 --- /dev/null +++ b/tests/nfnetlink_osf.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_osf +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nfnetlink_queue.c b/tests/nfnetlink_queue.c new file mode 100644 index 00000000..960c497e --- /dev/null +++ b/tests/nfnetlink_queue.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_QUEUE_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_QUEUE << 8 | NFQNL_MSG_PACKET; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_QUEUE<<8|NFQNL_MSG_PACKET" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_QUEUE << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_QUEUE<<8|0xff /* NFQNL_MSG_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_QUEUE_H") + +#endif diff --git a/tests/nfnetlink_queue.gen.test b/tests/nfnetlink_queue.gen.test new file mode 100755 index 00000000..965e0d24 --- /dev/null +++ b/tests/nfnetlink_queue.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_queue +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nfnetlink_ulog.c b/tests/nfnetlink_ulog.c new file mode 100644 index 00000000..294e9a7e --- /dev/null +++ b/tests/nfnetlink_ulog.c @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_NETFILTER_NFNETLINK_LOG_H + +# include +# include +# include "netlink.h" +# include +# include + +static void +test_nlmsg_type(const int fd) +{ + long rc; + struct nlmsghdr nlh = { + .nlmsg_len = sizeof(nlh), + .nlmsg_flags = NLM_F_REQUEST, + }; + + nlh.nlmsg_type = NFNL_SUBSYS_ULOG << 8 | NFULNL_MSG_PACKET; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_ULOG<<8|NFULNL_MSG_PACKET" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); + + nlh.nlmsg_type = NFNL_SUBSYS_ULOG << 8 | 0xff; + rc = sendto(fd, &nlh, nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {len=%u" + ", type=NFNL_SUBSYS_ULOG<<8|0xff /* NFULNL_MSG_??? */" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, nlh.nlmsg_len, nlh.nlmsg_len, sprintrc(rc)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_NETFILTER); + + test_nlmsg_type(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_NETFILTER_NFNETLINK_LOG_H") + +#endif diff --git a/tests/nfnetlink_ulog.gen.test b/tests/nfnetlink_ulog.gen.test new file mode 100755 index 00000000..825ad9f6 --- /dev/null +++ b/tests/nfnetlink_ulog.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nfnetlink_ulog +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr.c b/tests/nlattr.c new file mode 100644 index 00000000..2c5927b2 --- /dev/null +++ b/tests/nlattr.c @@ -0,0 +1,313 @@ +/* + * Check decoding of netlink attribute. + * + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include "netlink.h" +#include +#include +#include + +static void +test_nlattr(const int fd) +{ + static const struct msg { + struct nlmsghdr nlh; + struct unix_diag_msg udm; + } c_msg = { + .nlh = { + .nlmsg_len = sizeof(struct msg), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP + }, + .udm = { + .udiag_family = AF_UNIX, + .udiag_type = SOCK_STREAM, + .udiag_state = TCP_FIN_WAIT1 + } + }; + struct msg *msg; + struct nlattr *nla; + unsigned int msg_len; + long rc; + + /* fetch fail: len < sizeof(struct nlattr) */ + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + 2; + msg = tail_memdup(&c_msg, msg_len); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + memcpy(nla, "12", 2); + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, \"\\x31\\x32\"}, %u" + ", MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, msg_len, sprintrc(rc)); + + /* fetch fail: short read */ + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + sizeof(*nla); + msg = tail_memdup(&c_msg, msg_len - 1); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, %p}, %u" + ", MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, (void *) msg + NLMSG_SPACE(sizeof(msg->udm)), + msg_len, sprintrc(rc)); + + /* print one struct nlattr */ + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + sizeof(*nla); + msg = tail_memdup(&c_msg, msg_len); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + *nla = (struct nlattr) { + .nla_len = sizeof(*nla), + .nla_type = UNIX_DIAG_NAME + }; + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {nla_len=%u" + ", nla_type=UNIX_DIAG_NAME}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, msg_len, sprintrc(rc)); + + /* print one struct nlattr with nla_len out of msg_len bounds */ + nla->nla_len += 8; + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {nla_len=%u" + ", nla_type=UNIX_DIAG_NAME}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, msg_len, sprintrc(rc)); + + /* print one struct nlattr and some data */ + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + NLA_HDRLEN + 4; + msg = tail_memdup(&c_msg, msg_len); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + *nla = (struct nlattr) { + .nla_len = NLA_HDRLEN + 4, + .nla_type = UNIX_DIAG_SHUTDOWN + 1 + }; + memcpy(RTA_DATA(nla), "1234", 4); + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {{nla_len=%u" + ", nla_type=%#x /* UNIX_DIAG_??? */}" + ", \"\\x31\\x32\\x33\\x34\"}}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, UNIX_DIAG_SHUTDOWN + 1, + msg_len, sprintrc(rc)); + + /* print one struct nlattr and fetch fail second struct nlattr */ + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + NLA_HDRLEN + 2; + msg = tail_memdup(&c_msg, msg_len); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + SET_STRUCT(struct nlattr, nla, + .nla_len = NLA_HDRLEN, + .nla_type = UNIX_DIAG_NAME + ); + memcpy(nla + 1, "12", 2); + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, [{nla_len=%u" + ", nla_type=UNIX_DIAG_NAME}, \"\\x31\\x32\"]}, %u" + ", MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, NLA_HDRLEN, msg_len, sprintrc(rc)); + + /* print one struct nlattr and short read of second struct nlattr */ + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + NLA_HDRLEN * 2; + msg = tail_memdup(&c_msg, msg_len - 1); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + SET_STRUCT(struct nlattr, nla, + .nla_len = NLA_HDRLEN, + .nla_type = UNIX_DIAG_NAME + ); + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, [{nla_len=%u" + ", nla_type=UNIX_DIAG_NAME}, ... /* %p */]}, %u" + ", MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, NLA_HDRLEN, nla + 1, msg_len, sprintrc(rc)); + + /* print two struct nlattr */ + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + NLA_HDRLEN * 2; + msg = tail_memdup(&c_msg, msg_len); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + *nla = (struct nlattr) { + .nla_len = NLA_HDRLEN, + .nla_type = UNIX_DIAG_NAME + }; + *(nla + 1) = (struct nlattr) { + .nla_len = NLA_HDRLEN, + .nla_type = UNIX_DIAG_PEER + }; + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, [{nla_len=%u" + ", nla_type=UNIX_DIAG_NAME}, {nla_len=%u" + ", nla_type=UNIX_DIAG_PEER}]}, %u" + ", MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, nla->nla_len, + msg_len, sprintrc(rc)); + + /* print first nlattr only when its nla_len is less than NLA_HDRLEN */ + nla->nla_len = NLA_HDRLEN - 1; + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {nla_len=%u" + ", nla_type=UNIX_DIAG_NAME}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, msg_len, sprintrc(rc)); + + /* unrecognized attribute data, abbreviated output */ +#define ABBREV_LEN (DEFAULT_STRLEN + 1) + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + NLA_HDRLEN * ABBREV_LEN * 2; + msg = tail_alloc(msg_len); + memcpy(msg, &c_msg, sizeof(c_msg)); + msg->nlh.nlmsg_len = msg_len; + unsigned int i; + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + for (i = 0; i < ABBREV_LEN; ++i) { + nla[i * 2] = (struct nlattr) { + .nla_len = NLA_HDRLEN * 2 - 1, + .nla_type = UNIX_DIAG_SHUTDOWN + 1 + i + }; + fill_memory_ex(&nla[i * 2 + 1], NLA_HDRLEN, + '0' + i, '~' - '0' - i); + } + + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}" + ", {udiag_family=AF_UNIX, udiag_type=SOCK_STREAM" + ", udiag_state=TCP_FIN_WAIT1, udiag_ino=0" + ", udiag_cookie=[0, 0]}, [", + fd, msg_len); + for (i = 0; i < DEFAULT_STRLEN; ++i) { + if (i) + printf(", "); + printf("{{nla_len=%u, nla_type=%#x /* UNIX_DIAG_??? */}, ", + nla->nla_len, UNIX_DIAG_SHUTDOWN + 1 + i); + print_quoted_hex(&nla[i * 2 + 1], NLA_HDRLEN - 1); + printf("}"); + } + printf(", ...]}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", + msg_len, sprintrc(rc)); +} + +static void +test_nla_type(const int fd) +{ + static const struct msg { + struct nlmsghdr nlh; + struct unix_diag_msg udm; + } c_msg = { + .nlh = { + .nlmsg_len = sizeof(struct msg), + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP + }, + .udm = { + .udiag_family = AF_UNIX, + .udiag_type = SOCK_STREAM, + .udiag_state = TCP_FIN_WAIT1 + } + }; + struct msg *msg; + struct nlattr *nla; + unsigned int msg_len; + long rc; + + msg_len = NLMSG_SPACE(sizeof(msg->udm)) + sizeof(*nla); + msg = tail_memdup(&c_msg, msg_len); + memcpy(&msg->nlh.nlmsg_len, &msg_len, sizeof(msg_len)); + nla = NLMSG_ATTR(msg, sizeof(msg->udm)); + *nla = (struct nlattr) { + .nla_len = sizeof(*nla), + .nla_type = NLA_F_NESTED | UNIX_DIAG_NAME + }; + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {nla_len=%u" + ", nla_type=NLA_F_NESTED|UNIX_DIAG_NAME}}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, msg_len, sprintrc(rc)); + + nla->nla_type = NLA_F_NET_BYTEORDER | UNIX_DIAG_NAME; + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {nla_len=%u" + ", nla_type=NLA_F_NET_BYTEORDER|UNIX_DIAG_NAME}}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, msg_len, sprintrc(rc)); + + nla->nla_type = NLA_F_NESTED | NLA_F_NET_BYTEORDER | UNIX_DIAG_NAME; + rc = sendto(fd, msg, msg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {nla_len=%u" + ", nla_type=NLA_F_NESTED|NLA_F_NET_BYTEORDER|UNIX_DIAG_NAME}}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg_len, nla->nla_len, msg_len, sprintrc(rc)); + + nla->nla_type = NLA_F_NESTED | (UNIX_DIAG_SHUTDOWN + 1); + rc = sendto(fd, msg, msg->nlh.nlmsg_len, MSG_DONTWAIT, NULL, 0); + printf("sendto(%d, {{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_FIN_WAIT1" + ", udiag_ino=0, udiag_cookie=[0, 0]}, {nla_len=%u" + ", nla_type=NLA_F_NESTED|%#x /* UNIX_DIAG_??? */}}" + ", %u, MSG_DONTWAIT, NULL, 0) = %s\n", + fd, msg->nlh.nlmsg_len, nla->nla_len, UNIX_DIAG_SHUTDOWN + 1, + msg->nlh.nlmsg_len, sprintrc(rc)); +} + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_SOCK_DIAG); + + test_nlattr(fd); + test_nla_type(fd); + + puts("+++ exited with 0 +++"); + + return 0; +} diff --git a/tests/nlattr.gen.test b/tests/nlattr.gen.test new file mode 100755 index 00000000..0ea2f185 --- /dev/null +++ b/tests/nlattr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_br_port_msg.c b/tests/nlattr_br_port_msg.c new file mode 100644 index 00000000..9a7c3f25 --- /dev/null +++ b/tests/nlattr_br_port_msg.c @@ -0,0 +1,74 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_BR_PORT_MSG + +# include +# include +# include "test_nlattr.h" +# include +# include + +static void +init_br_port_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETMDB, + .nlmsg_flags = NLM_F_DUMP + ); + + struct br_port_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct br_port_msg, msg, + .family = AF_UNIX, + .ifindex = ifindex_lo() + ); +} + +static void +print_br_port_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETMDB, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {family=AF_UNIX" + ", ifindex=" IFINDEX_LO_STR "}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + + const unsigned int hdrlen = sizeof(struct br_port_msg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 4); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* MDBA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_br_port_msg, print_br_port_msg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_BR_PORT_MSG") + +#endif diff --git a/tests/nlattr_br_port_msg.gen.test b/tests/nlattr_br_port_msg.gen.test new file mode 100755 index 00000000..c9572759 --- /dev/null +++ b/tests/nlattr_br_port_msg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_br_port_msg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_crypto_user_alg.c b/tests/nlattr_crypto_user_alg.c new file mode 100644 index 00000000..f90c6208 --- /dev/null +++ b/tests/nlattr_crypto_user_alg.c @@ -0,0 +1,175 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_CRYPTOUSER_H + +# include +# include +# include "test_nlattr.h" +# include + +# define CRYPTOCFGA_REPORT_LARVAL 2 + +static void +init_crypto_user_alg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = CRYPTO_MSG_GETALG, + .nlmsg_flags = NLM_F_DUMP + ); + + struct crypto_user_alg *const alg = NLMSG_DATA(nlh); + SET_STRUCT(struct crypto_user_alg, alg, + .cru_name = "abcd", + .cru_driver_name = "efgh", + .cru_module_name = "ijkl", + ); +} + +static void +print_crypto_user_alg(const unsigned int msg_len) +{ + printf("{len=%u, type=CRYPTO_MSG_GETALG" + ", flags=NLM_F_DUMP, seq=0, pid=0}" + ", {cru_name=\"abcd\", cru_driver_name=\"efgh\"" + ", cru_module_name=\"ijkl\", cru_type=0" + ", cru_mask=0, cru_refcnt=0, cru_flags=0}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_CRYPTO); + const unsigned int hdrlen = sizeof(struct crypto_user_alg); + /* + * There are also other structures, but they are not bigger than + * DEFAULT_STRLEN so far. + */ + void *const nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + DEFAULT_STRLEN); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + char *const str = tail_alloc(DEFAULT_STRLEN); + fill_memory_ex(str, DEFAULT_STRLEN, '0', 10); + TEST_NLATTR(fd, nlh0, hdrlen, + init_crypto_user_alg, print_crypto_user_alg, + CRYPTOCFGA_REPORT_LARVAL, + DEFAULT_STRLEN, str, DEFAULT_STRLEN, + printf("{type=\"%.*s\"...}", DEFAULT_STRLEN, str)); + str[DEFAULT_STRLEN - 1] = '\0'; + TEST_NLATTR(fd, nlh0, hdrlen, + init_crypto_user_alg, print_crypto_user_alg, + CRYPTOCFGA_REPORT_LARVAL, + DEFAULT_STRLEN, str, DEFAULT_STRLEN, + printf("{type=\"%s\"}", str)); + +# ifdef HAVE_STRUCT_CRYPTO_REPORT_HASH + static const struct crypto_report_hash rhash = { + .type = "efgh", + .blocksize = 0xabcdefdc, + .digestsize = 0xfebcdacd + }; + TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen, + init_crypto_user_alg, print_crypto_user_alg, + CRYPTOCFGA_REPORT_HASH, + pattern, rhash, print_quoted_memory, + printf("{type=\"efgh\""); + PRINT_FIELD_U(", ", rhash, blocksize); + PRINT_FIELD_U(", ", rhash, digestsize); + printf("}")); +# endif + +# ifdef HAVE_STRUCT_CRYPTO_REPORT_BLKCIPHER + static const struct crypto_report_blkcipher rblkcipher = { + .type = "abcd", + .geniv = "efgh", + .blocksize = 0xabcdefac, + .min_keysize = 0xfeadbcda, + .max_keysize = 0xbdacdeac, + .ivsize = 0xefacbdac + }; + TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen, + init_crypto_user_alg, print_crypto_user_alg, + CRYPTOCFGA_REPORT_BLKCIPHER, + pattern, rblkcipher, print_quoted_memory, + printf("{type=\"abcd\", geniv=\"efgh\""); + PRINT_FIELD_U(", ", rblkcipher, blocksize); + PRINT_FIELD_U(", ", rblkcipher, min_keysize); + PRINT_FIELD_U(", ", rblkcipher, max_keysize); + PRINT_FIELD_U(", ", rblkcipher, ivsize); + printf("}")); +# endif + +# ifdef HAVE_STRUCT_CRYPTO_REPORT_AEAD + static const struct crypto_report_aead raead = { + .type = "abcd", + .geniv = "efgh", + .blocksize = 0xbaefdbac, + .maxauthsize = 0xfdbdbcda, + .ivsize = 0xacbefdac + }; + TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen, + init_crypto_user_alg, print_crypto_user_alg, + CRYPTOCFGA_REPORT_AEAD, + pattern, raead, print_quoted_memory, + printf("{type=\"abcd\", geniv=\"efgh\""); + PRINT_FIELD_U(", ", raead, blocksize); + PRINT_FIELD_U(", ", raead, maxauthsize); + PRINT_FIELD_U(", ", raead, ivsize); + printf("}")); +# endif + +# ifdef HAVE_STRUCT_CRYPTO_REPORT_RNG + static const struct crypto_report_rng rrng = { + .type = "abcd", + .seedsize = 0xabcdefac + }; + TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen, + init_crypto_user_alg, print_crypto_user_alg, + CRYPTOCFGA_REPORT_RNG, + pattern, rrng, print_quoted_memory, + printf("{type=\"abcd\""); + PRINT_FIELD_U(", ", rrng, seedsize); + printf("}")); +# endif + +# ifdef HAVE_STRUCT_CRYPTO_REPORT_CIPHER + static const struct crypto_report_cipher rcipher = { + .type = "abcd", + .blocksize = 0xabcdefac, + .min_keysize = 0xfeadbcda, + .max_keysize = 0xbdacdeac, + }; + TEST_NLATTR_OBJECT_EX(fd, nlh0, hdrlen, + init_crypto_user_alg, print_crypto_user_alg, + CRYPTOCFGA_REPORT_CIPHER, + pattern, rcipher, print_quoted_memory, + printf("{type=\"abcd\""); + PRINT_FIELD_U(", ", rcipher, blocksize); + PRINT_FIELD_U(", ", rcipher, min_keysize); + PRINT_FIELD_U(", ", rcipher, max_keysize); + printf("}")); +# endif + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_CRYPTOUSER_H"); + +#endif diff --git a/tests/nlattr_crypto_user_alg.gen.test b/tests/nlattr_crypto_user_alg.gen.test new file mode 100755 index 00000000..e52b6be7 --- /dev/null +++ b/tests/nlattr_crypto_user_alg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_crypto_user_alg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_dcbmsg.c b/tests/nlattr_dcbmsg.c new file mode 100644 index 00000000..06efb283 --- /dev/null +++ b/tests/nlattr_dcbmsg.c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_DCBMSG + +# include +# include "test_nlattr.h" +# include +# include + +static void +init_dcbmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETDCB, + .nlmsg_flags = NLM_F_DUMP + ); + + struct dcbmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct dcbmsg, msg, + .dcb_family = AF_UNIX, + .cmd = DCB_CMD_UNDEFINED + ); +} + +static void +print_dcbmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETDCB, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {dcb_family=AF_UNIX" + ", cmd=DCB_CMD_UNDEFINED}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct dcbmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 4); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* DCB_ATTR_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_dcbmsg, print_dcbmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_DCBMSG") + +#endif diff --git a/tests/nlattr_dcbmsg.gen.test b/tests/nlattr_dcbmsg.gen.test new file mode 100755 index 00000000..f9ef39f7 --- /dev/null +++ b/tests/nlattr_dcbmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_dcbmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_fib_rule_hdr.c b/tests/nlattr_fib_rule_hdr.c new file mode 100644 index 00000000..d5ba13e2 --- /dev/null +++ b/tests/nlattr_fib_rule_hdr.c @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_LINUX_FIB_RULES_H + +# include +# include +# include "test_nlattr.h" +# include +# include +# include +# include + +# define FRA_TUN_ID 12 +# define FRA_TABLE 15 +# define FRA_UID_RANGE 20 +# define FRA_PROTOCOL 21 +# define FRA_IP_PROTO 22 +# define FRA_SPORT_RANGE 23 +# define FRA_DPORT_RANGE 24 + +# ifndef HAVE_STRUCT_FIB_RULE_PORT_RANGE +struct fib_rule_port_range { + uint16_t start; + uint16_t end; +}; +# endif /* HAVE_STRUCT_FIB_RULE_PORT_RANGE */ + +static void +init_rtmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETRULE, + .nlmsg_flags = NLM_F_DUMP + ); + + struct rtmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct rtmsg, msg, + .rtm_family = AF_UNIX, + .rtm_tos = IPTOS_LOWDELAY, + .rtm_table = RT_TABLE_UNSPEC, + .rtm_type = FR_ACT_TO_TBL, + .rtm_flags = FIB_RULE_INVERT + ); +} + +static void +print_rtmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETRULE, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {family=AF_UNIX" + ", dst_len=0, src_len=0" + ", tos=IPTOS_LOWDELAY" + ", table=RT_TABLE_UNSPEC" + ", action=FR_ACT_TO_TBL" + ", flags=FIB_RULE_INVERT}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct rtmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 8); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* FRA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_DST, 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + const uint32_t table_id = RT_TABLE_DEFAULT; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_TABLE, pattern, table_id, + printf("RT_TABLE_DEFAULT")); + +# ifdef HAVE_STRUCT_FIB_RULE_UID_RANGE + static const struct fib_rule_uid_range range = { + .start = 0xabcdedad, + .end = 0xbcdeadba + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_UID_RANGE, pattern, range, + PRINT_FIELD_U("{", range, start); + PRINT_FIELD_U(", ", range, end); + printf("}")); +# endif +# if defined HAVE_BE64TOH || defined be64toh + const uint64_t tun_id = 0xabcdcdbeedabadef; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_TUN_ID, pattern, tun_id, + printf("htobe64(%" PRIu64 ")", be64toh(tun_id))); +# endif + + uint8_t proto; + + static const struct { + uint8_t arg; + const char *str; + } proto_args[] = { + { ARG_STR(RTPROT_UNSPEC) }, + { 5, "0x5 /* RTPROT_??? */" }, + { 17, "RTPROT_MROUTED" }, + { 42, "RTPROT_BABEL" }, + { 43, "0x2b /* RTPROT_??? */" }, + { ARG_STR(0xde) " /* RTPROT_??? */" }, + }; + + for (unsigned i = 0; i < ARRAY_SIZE(proto_args); i++) { + proto = proto_args[i].arg; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_PROTOCOL, pattern, proto, + printf("%s", proto_args[i].str)); + } + + static const struct { + uint8_t arg; + const char *str; + } ipproto_args[] = { + { ARG_STR(IPPROTO_TCP) }, + { 254, "0xfe /* IPPROTO_??? */" }, + { ARG_STR(IPPROTO_RAW) }, + }; + + for (unsigned i = 0; i < ARRAY_SIZE(ipproto_args); i++) { + proto = ipproto_args[i].arg; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_IP_PROTO, pattern, proto, + printf("%s", ipproto_args[i].str)); + } + + static const struct fib_rule_port_range prange = { + .start = 0xabcd, + .end = 0xfeed, + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_SPORT_RANGE, pattern, prange, + PRINT_FIELD_U("{", prange, start); + PRINT_FIELD_U(", ", prange, end); + printf("}")); + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + FRA_DPORT_RANGE, pattern, prange, + PRINT_FIELD_U("{", prange, start); + PRINT_FIELD_U(", ", prange, end); + printf("}")); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_LINUX_FIB_RULES_H") + +#endif diff --git a/tests/nlattr_fib_rule_hdr.gen.test b/tests/nlattr_fib_rule_hdr.gen.test new file mode 100755 index 00000000..fb61343d --- /dev/null +++ b/tests/nlattr_fib_rule_hdr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_fib_rule_hdr +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_ifaddrlblmsg.c b/tests/nlattr_ifaddrlblmsg.c new file mode 100644 index 00000000..ce9d7a80 --- /dev/null +++ b/tests/nlattr_ifaddrlblmsg.c @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_IFADDRLBLMSG + +# include +# include "test_nlattr.h" +# include +# include + +static void +init_ifaddrlblmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETADDRLABEL, + .nlmsg_flags = NLM_F_DUMP + ); + + struct ifaddrlblmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct ifaddrlblmsg, msg, + .ifal_family = AF_UNIX, + .ifal_index = ifindex_lo() + ); +} + +static void +print_ifaddrlblmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETADDRLABEL, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {ifal_family=AF_UNIX" + ", ifal_prefixlen=0, ifal_flags=0" + ", ifal_index=" IFINDEX_LO_STR + ", ifal_seq=0}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct ifaddrlblmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 4); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* IFAL_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_ifaddrlblmsg, print_ifaddrlblmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifaddrlblmsg, print_ifaddrlblmsg, + IFAL_ADDRESS, 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_IFADDRLBLMSG") + +#endif diff --git a/tests/nlattr_ifaddrlblmsg.gen.test b/tests/nlattr_ifaddrlblmsg.gen.test new file mode 100755 index 00000000..0f51430f --- /dev/null +++ b/tests/nlattr_ifaddrlblmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifaddrlblmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_ifaddrmsg.c b/tests/nlattr_ifaddrmsg.c new file mode 100644 index 00000000..4e952555 --- /dev/null +++ b/tests/nlattr_ifaddrmsg.c @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include "test_nlattr.h" +#ifdef HAVE_LINUX_IF_ADDR_H +# include +#endif +#include + +#define IFA_FLAGS 8 + +#define SET_IFA_FAMILY(af) \ + do { \ + ifa_family = af; \ + ifa_family_str = #af; \ + } \ + while (0) + +uint8_t ifa_family; +const char *ifa_family_str; + +static void +init_ifaddrmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETADDR, + .nlmsg_flags = NLM_F_DUMP + ); + + struct ifaddrmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct ifaddrmsg, msg, + .ifa_family = ifa_family, + .ifa_flags = IFA_F_SECONDARY, + .ifa_scope = RT_SCOPE_UNIVERSE, + .ifa_index = ifindex_lo() + ); +} + +static void +print_ifaddrmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETADDR, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {ifa_family=%s" + ", ifa_prefixlen=0" + ", ifa_flags=IFA_F_SECONDARY" + ", ifa_scope=RT_SCOPE_UNIVERSE" + ", ifa_index=" IFINDEX_LO_STR "}", + msg_len, ifa_family_str); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + static const char address4[] = "12.34.56.78"; + static const char address6[] = "12:34:56:78:90:ab:cd:ef"; + static const struct ifa_cacheinfo ci = { + .ifa_prefered = 0xabcdefac, + .ifa_valid = 0xbcdadbca, + .cstamp = 0xcdabedba, + .tstamp = 0xdebabdac + }; + + struct in_addr a4; + struct in6_addr a6; + const uint32_t ifa_flags = IFA_F_SECONDARY | IFA_F_PERMANENT; + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct ifaddrmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + MAX(sizeof(ci), sizeof(a6))); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + SET_IFA_FAMILY(AF_UNSPEC); + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* IFA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_ifaddrmsg, print_ifaddrmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifaddrmsg, print_ifaddrmsg, + IFA_ADDRESS, 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + SET_IFA_FAMILY(AF_INET); + + if (!inet_pton(AF_INET, address4, &a4)) + perror_msg_and_skip("inet_pton"); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifaddrmsg, print_ifaddrmsg, + IFA_ADDRESS, pattern, a4, + printf("inet_addr(\"%s\")", address4)); + + SET_IFA_FAMILY(AF_INET6); + + if (!inet_pton(AF_INET6, address6, &a6)) + perror_msg_and_skip("inet_pton"); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifaddrmsg, print_ifaddrmsg, + IFA_ADDRESS, pattern, a6, + printf("inet_pton(AF_INET6, \"%s\")", address6)); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifaddrmsg, print_ifaddrmsg, + IFA_CACHEINFO, pattern, ci, + PRINT_FIELD_U("{", ci, ifa_prefered); + PRINT_FIELD_U(", ", ci, ifa_valid); + PRINT_FIELD_U(", ", ci, cstamp); + PRINT_FIELD_U(", ", ci, tstamp); + printf("}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifaddrmsg, print_ifaddrmsg, + IFA_FLAGS, pattern, ifa_flags, + printf("IFA_F_SECONDARY|IFA_F_PERMANENT")); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/nlattr_ifaddrmsg.gen.test b/tests/nlattr_ifaddrmsg.gen.test new file mode 100755 index 00000000..3fb81bdb --- /dev/null +++ b/tests/nlattr_ifaddrmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifaddrmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_ifinfomsg.c b/tests/nlattr_ifinfomsg.c new file mode 100644 index 00000000..a8660196 --- /dev/null +++ b/tests/nlattr_ifinfomsg.c @@ -0,0 +1,346 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include "test_nlattr.h" + +#include +#include +#ifdef HAVE_LINUX_IF_LINK_H +# include +#endif +#include + +#ifndef IFLA_LINKINFO +# define IFLA_LINKINFO 18 +#endif +#ifndef IFLA_VF_PORTS +# define IFLA_VF_PORTS 24 +#endif +#define IFLA_LINK_NETNSID 37 +#define IFLA_EVENT 44 + +#ifndef IFLA_INFO_KIND +# define IFLA_INFO_KIND 1 +#endif + +#ifndef IFLA_VF_PORT +# define IFLA_VF_PORT 1 +#endif + +static void +init_ifinfomsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETLINK, + .nlmsg_flags = NLM_F_DUMP + ); + + struct ifinfomsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct ifinfomsg, msg, + .ifi_family = AF_UNIX, + .ifi_type = ARPHRD_LOOPBACK, + .ifi_index = ifindex_lo(), + .ifi_flags = IFF_UP, + ); +} + +static void +print_ifinfomsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETLINK, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {ifi_family=AF_UNIX" + ", ifi_type=ARPHRD_LOOPBACK" + ", ifi_index=" IFINDEX_LO_STR + ", ifi_flags=IFF_UP, ifi_change=0}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + static const struct rtnl_link_stats st = { + .rx_packets = 0xabcdefac, + .tx_packets = 0xbcdacdab, + .rx_bytes = 0xcdbafaab, + .tx_bytes = 0xdafabadb, + .rx_errors = 0xeabcdaeb, + .tx_errors = 0xfefabeab, + .rx_dropped = 0xadbafafb, + .tx_dropped = 0xbdffabda, + .multicast = 0xcdabdfea, + .collisions = 0xefadbaeb, + .rx_length_errors = 0xfabffabd, + .rx_over_errors = 0xafbafabc, + .rx_crc_errors = 0xbfdabdad, + .rx_frame_errors = 0xcfdabfad, + .rx_fifo_errors = 0xddfdebad, + .rx_missed_errors = 0xefabdcba, + .tx_aborted_errors = 0xefdadbfa, + .tx_carrier_errors = 0xfaefbada, + .tx_fifo_errors = 0xaebdffab, + .tx_heartbeat_errors = 0xbadebaaf, + .tx_window_errors = 0xcdafbada, + .rx_compressed = 0xdeffadbd, + .tx_compressed = 0xefdadfab + }; + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct ifinfomsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(st)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* IFLA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + const int32_t netnsid = 0xacbdabda; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_LINK_NETNSID, pattern, netnsid, + printf("%d", netnsid)); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_STATS, pattern, st, + PRINT_FIELD_U("{", st, rx_packets); + PRINT_FIELD_U(", ", st, tx_packets); + PRINT_FIELD_U(", ", st, rx_bytes); + PRINT_FIELD_U(", ", st, tx_bytes); + PRINT_FIELD_U(", ", st, rx_errors); + PRINT_FIELD_U(", ", st, tx_errors); + PRINT_FIELD_U(", ", st, rx_dropped); + PRINT_FIELD_U(", ", st, tx_dropped); + PRINT_FIELD_U(", ", st, multicast); + PRINT_FIELD_U(", ", st, collisions); + PRINT_FIELD_U(", ", st, rx_length_errors); + PRINT_FIELD_U(", ", st, rx_over_errors); + PRINT_FIELD_U(", ", st, rx_crc_errors); + PRINT_FIELD_U(", ", st, rx_frame_errors); + PRINT_FIELD_U(", ", st, rx_fifo_errors); + PRINT_FIELD_U(", ", st, rx_missed_errors); + PRINT_FIELD_U(", ", st, tx_aborted_errors); + PRINT_FIELD_U(", ", st, tx_carrier_errors); + PRINT_FIELD_U(", ", st, tx_fifo_errors); + PRINT_FIELD_U(", ", st, tx_heartbeat_errors); + PRINT_FIELD_U(", ", st, tx_window_errors); + PRINT_FIELD_U(", ", st, rx_compressed); + PRINT_FIELD_U(", ", st, tx_compressed); +#ifdef HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER + PRINT_FIELD_U(", ", st, rx_nohandler); +#endif + printf("}")); + +#ifdef HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER + const unsigned int sizeof_stats = + offsetofend(struct rtnl_link_stats, tx_compressed); + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_STATS, sizeof_stats, &st, sizeof_stats, + PRINT_FIELD_U("{", st, rx_packets); + PRINT_FIELD_U(", ", st, tx_packets); + PRINT_FIELD_U(", ", st, rx_bytes); + PRINT_FIELD_U(", ", st, tx_bytes); + PRINT_FIELD_U(", ", st, rx_errors); + PRINT_FIELD_U(", ", st, tx_errors); + PRINT_FIELD_U(", ", st, rx_dropped); + PRINT_FIELD_U(", ", st, tx_dropped); + PRINT_FIELD_U(", ", st, multicast); + PRINT_FIELD_U(", ", st, collisions); + PRINT_FIELD_U(", ", st, rx_length_errors); + PRINT_FIELD_U(", ", st, rx_over_errors); + PRINT_FIELD_U(", ", st, rx_crc_errors); + PRINT_FIELD_U(", ", st, rx_frame_errors); + PRINT_FIELD_U(", ", st, rx_fifo_errors); + PRINT_FIELD_U(", ", st, rx_missed_errors); + PRINT_FIELD_U(", ", st, tx_aborted_errors); + PRINT_FIELD_U(", ", st, tx_carrier_errors); + PRINT_FIELD_U(", ", st, tx_fifo_errors); + PRINT_FIELD_U(", ", st, tx_heartbeat_errors); + PRINT_FIELD_U(", ", st, tx_window_errors); + PRINT_FIELD_U(", ", st, rx_compressed); + PRINT_FIELD_U(", ", st, tx_compressed); + printf("}")); +#endif /* HAVE_STRUCT_RTNL_LINK_STATS_RX_NOHANDLER */ + + static const struct rtnl_link_ifmap map = { + .mem_start = 0xadcbefedefbcdedb, + .mem_end = 0xefcbeabdecdcdefa, + .base_addr = 0xaddbeabdfaacdbae, + .irq = 0xefaf, + .dma = 0xab, + .port = 0xcd + }; + const unsigned int sizeof_ifmap = + offsetofend(struct rtnl_link_ifmap, port); + const unsigned int plen = sizeof_ifmap - 1 > DEFAULT_STRLEN + ? DEFAULT_STRLEN + : (int) sizeof_ifmap - 1; + /* len < sizeof_ifmap */ + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_MAP, plen, pattern, plen, + print_quoted_hex(pattern, plen)); + + /* short read of sizeof_ifmap */ + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_MAP, sizeof_ifmap, &map, sizeof_ifmap - 1, + printf("%p", RTA_DATA(TEST_NLATTR_nla))); + + /* sizeof_ifmap */ + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_MAP, sizeof_ifmap, &map, sizeof_ifmap, + PRINT_FIELD_X("{", map, mem_start); + PRINT_FIELD_X(", ", map, mem_end); + PRINT_FIELD_X(", ", map, base_addr); + PRINT_FIELD_U(", ", map, irq); + PRINT_FIELD_U(", ", map, dma); + PRINT_FIELD_U(", ", map, port); + printf("}")); + +#ifdef HAVE_STRUCT_RTNL_LINK_STATS64 + static const struct rtnl_link_stats64 st64 = { + .rx_packets = 0xadcbefedefbcdedb, + .tx_packets = 0xbdabdedabdcdeabd, + .rx_bytes = 0xcdbaefbaeadfabec, + .tx_bytes = 0xdbaedbafabbeacdb, + .rx_errors = 0xefabfdaefabaefab, + .tx_errors = 0xfaebfabfabbaeabf, + .rx_dropped = 0xacdbaedbadbabeba, + .tx_dropped = 0xbcdeffebdabeadbe, + .multicast = 0xeeffbaeabaeffabe, + .collisions = 0xffbaefcefbafacef, + .rx_length_errors = 0xaabbdeabceffdecb, + .rx_over_errors = 0xbbdcdadebadeaeed, + .rx_crc_errors= 0xccdeabecefaedbef, + .rx_frame_errors = 0xddbedaedebcedaef, + .rx_fifo_errors = 0xeffbadefafdaeaab, + .rx_missed_errors = 0xfefaebccceadeecd, + .tx_aborted_errors = 0xabcdadefcdadef, + .tx_carrier_errors = 0xbccdafaeeaaefe, + .tx_fifo_errors = 0xcddefdbedeadce, + .tx_heartbeat_errors = 0xedaededdadcdea, + .tx_window_errors = 0xfdacdeaccedcda, + .rx_compressed = 0xacdbbcacdbccef, + .tx_compressed = 0xbcdadefcdedfea + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_STATS64, pattern, st64, + PRINT_FIELD_U("{", st64, rx_packets); + PRINT_FIELD_U(", ", st64, tx_packets); + PRINT_FIELD_U(", ", st64, rx_bytes); + PRINT_FIELD_U(", ", st64, tx_bytes); + PRINT_FIELD_U(", ", st64, rx_errors); + PRINT_FIELD_U(", ", st64, tx_errors); + PRINT_FIELD_U(", ", st64, rx_dropped); + PRINT_FIELD_U(", ", st64, tx_dropped); + PRINT_FIELD_U(", ", st64, multicast); + PRINT_FIELD_U(", ", st64, collisions); + PRINT_FIELD_U(", ", st64, rx_length_errors); + PRINT_FIELD_U(", ", st64, rx_over_errors); + PRINT_FIELD_U(", ", st64, rx_crc_errors); + PRINT_FIELD_U(", ", st64, rx_frame_errors); + PRINT_FIELD_U(", ", st64, rx_fifo_errors); + PRINT_FIELD_U(", ", st64, rx_missed_errors); + PRINT_FIELD_U(", ", st64, tx_aborted_errors); + PRINT_FIELD_U(", ", st64, tx_carrier_errors); + PRINT_FIELD_U(", ", st64, tx_fifo_errors); + PRINT_FIELD_U(", ", st64, tx_heartbeat_errors); + PRINT_FIELD_U(", ", st64, tx_window_errors); + PRINT_FIELD_U(", ", st64, rx_compressed); + PRINT_FIELD_U(", ", st64, tx_compressed); +# ifdef HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER + PRINT_FIELD_U(", ", st64, rx_nohandler); +# endif + printf("}")); + +# ifdef HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER + const unsigned int sizeof_stats64 = + offsetofend(struct rtnl_link_stats64, tx_compressed); + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_STATS64, sizeof_stats64, &st64, sizeof_stats64, + PRINT_FIELD_U("{", st64, rx_packets); + PRINT_FIELD_U(", ", st64, tx_packets); + PRINT_FIELD_U(", ", st64, rx_bytes); + PRINT_FIELD_U(", ", st64, tx_bytes); + PRINT_FIELD_U(", ", st64, rx_errors); + PRINT_FIELD_U(", ", st64, tx_errors); + PRINT_FIELD_U(", ", st64, rx_dropped); + PRINT_FIELD_U(", ", st64, tx_dropped); + PRINT_FIELD_U(", ", st64, multicast); + PRINT_FIELD_U(", ", st64, collisions); + PRINT_FIELD_U(", ", st64, rx_length_errors); + PRINT_FIELD_U(", ", st64, rx_over_errors); + PRINT_FIELD_U(", ", st64, rx_crc_errors); + PRINT_FIELD_U(", ", st64, rx_frame_errors); + PRINT_FIELD_U(", ", st64, rx_fifo_errors); + PRINT_FIELD_U(", ", st64, rx_missed_errors); + PRINT_FIELD_U(", ", st64, tx_aborted_errors); + PRINT_FIELD_U(", ", st64, tx_carrier_errors); + PRINT_FIELD_U(", ", st64, tx_fifo_errors); + PRINT_FIELD_U(", ", st64, tx_heartbeat_errors); + PRINT_FIELD_U(", ", st64, tx_window_errors); + PRINT_FIELD_U(", ", st64, rx_compressed); + PRINT_FIELD_U(", ", st64, tx_compressed); + printf("}")); +# endif /* HAVE_STRUCT_RTNL_LINK_STATS64_RX_NOHANDLER */ +#endif /* HAVE_STRUCT_RTNL_LINK_STATS64 */ + + struct nlattr nla = { + .nla_len = sizeof(nla), + .nla_type = IFLA_INFO_KIND, + }; + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_LINKINFO, sizeof(nla), &nla, sizeof(nla), + printf("{nla_len=%u, nla_type=IFLA_INFO_KIND}", + nla.nla_len)); + + nla.nla_type = IFLA_VF_PORT; + TEST_NLATTR(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_VF_PORTS, sizeof(nla), &nla, sizeof(nla), + printf("{nla_len=%u, nla_type=IFLA_VF_PORT}", + nla.nla_len)); + + static const struct { + uint32_t val; + const char *str; + } ifla_events[] = { + { 0, "IFLA_EVENT_NONE" }, + { 6, "IFLA_EVENT_BONDING_OPTIONS" }, + { ARG_STR(0x7) " /* IFLA_EVENT_??? */" }, + { ARG_STR(0xdeadfeed) " /* IFLA_EVENT_??? */" }, + }; + for (size_t i = 0; i < ARRAY_SIZE(ifla_events); i++) { + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_EVENT, pattern, ifla_events[i].val, + printf("%s", ifla_events[i].str)); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/nlattr_ifinfomsg.gen.test b/tests/nlattr_ifinfomsg.gen.test new file mode 100755 index 00000000..b9a6456a --- /dev/null +++ b/tests/nlattr_ifinfomsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifinfomsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_ifla.h b/tests/nlattr_ifla.h new file mode 100644 index 00000000..6772ae29 --- /dev/null +++ b/tests/nlattr_ifla.h @@ -0,0 +1,58 @@ +/* + * netlink attribute ifinfomsg common code. + * + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef STRACE_TESTS_NLATTR_IFLA_H +# define STRACE_TESTS_NLATTR_IFLA_H + +# include "tests.h" + +# ifndef IFLA_ATTR +# error "Please define IFLA_ATTR before including this file" +# endif + +static const unsigned int hdrlen = sizeof(struct ifinfomsg); + +static void +init_ifinfomsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETLINK, + .nlmsg_flags = NLM_F_DUMP + ); + + struct ifinfomsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct ifinfomsg, msg, + .ifi_family = AF_UNIX, + .ifi_type = ARPHRD_LOOPBACK, + .ifi_index = ifindex_lo(), + .ifi_flags = IFF_UP, + ); + + struct nlattr *const nla = NLMSG_ATTR(nlh, sizeof(*msg)); + SET_STRUCT(struct nlattr, nla, + .nla_len = msg_len - NLMSG_SPACE(hdrlen), + .nla_type = IFLA_ATTR + ); +} + +static void +print_ifinfomsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETLINK, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {ifi_family=AF_UNIX" + ", ifi_type=ARPHRD_LOOPBACK" + ", ifi_index=" IFINDEX_LO_STR + ", ifi_flags=IFF_UP, ifi_change=0}" + ", {{nla_len=%u, nla_type=" STRINGIFY_VAL(IFLA_ATTR) "}", + msg_len, msg_len - NLMSG_SPACE(hdrlen)); +} + +#endif /* STRACE_TESTS_NLATTR_IFLA_H */ diff --git a/tests/nlattr_ifla_af_spec.c b/tests/nlattr_ifla_af_spec.c new file mode 100644 index 00000000..e5e76c60 --- /dev/null +++ b/tests/nlattr_ifla_af_spec.c @@ -0,0 +1,303 @@ +/* + * IFLA_AF_SPEC netlink attribute decoding check. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include "test_nlattr.h" + +#include +#include +#ifdef HAVE_LINUX_IF_LINK_H +# include +#endif +#include + +#if !HAVE_DECL_IFLA_AF_SPEC +enum { IFLA_AF_SPEC = 26 }; +#endif + +#define XLAT_MACROS_ONLY +#include "xlat/rtnl_ifla_af_spec_inet_attrs.h" +#include "xlat/rtnl_ifla_af_spec_inet6_attrs.h" +#undef XLAT_MACROS_ONLY + +#ifndef HAVE_STRUCT_IFLA_CACHEINFO +struct ifla_cacheinfo { + uint32_t max_reasm_len; + uint32_t tstamp; + uint32_t reachable_time; + uint32_t retrans_time; +}; +#endif + +#define IFLA_ATTR IFLA_AF_SPEC +#include "nlattr_ifla.h" + +#define AF_SPEC_FUNCS(family_) \ + static void \ + init_##family_##_msg(struct nlmsghdr *const nlh, \ + const unsigned int msg_len) \ + { \ + init_ifinfomsg(nlh, msg_len); \ + \ + struct nlattr *nla = NLMSG_ATTR(nlh, hdrlen); \ + nla += 1; \ + SET_STRUCT(struct nlattr, nla, \ + .nla_len = msg_len - NLMSG_SPACE(hdrlen) \ + - NLA_HDRLEN, \ + .nla_type = family_, \ + ); \ + } \ + \ + static void \ + print_##family_##_msg(const unsigned int msg_len) \ + { \ + print_ifinfomsg(msg_len); \ + printf(", {{nla_len=%u, nla_type=" #family_ "}", \ + msg_len - NLMSG_SPACE(hdrlen) - NLA_HDRLEN); \ + } \ + /* end of AF_SPEC_FUNCS definition */ + +AF_SPEC_FUNCS(AF_INET) +AF_SPEC_FUNCS(AF_INET6) + +static void +print_arr_val(uint32_t *val, size_t idx, const char *idx_str) +{ + if (idx_str) + printf("[%s] = ", idx_str); + else + printf("[%zu] = ", idx); + + printf("%d", *val); +} + +static void +print_arr_uval(uint64_t *val, size_t idx, const char *idx_str) +{ + if (idx_str) + printf("[%s] = ", idx_str); + else + printf("[%zu] = ", idx); + + printf("%" PRIu64, *val); +} + +static void +print_inet_conf_val(uint32_t *val, size_t idx) +{ + static const char * const strs[] = { + "IPV4_DEVCONF_FORWARDING-1", + "IPV4_DEVCONF_MC_FORWARDING-1", + }; + + print_arr_val(val, idx, idx < ARRAY_SIZE(strs) ? strs[idx] : NULL); +} + + +static void +print_inet6_conf_val(uint32_t *val, size_t idx) +{ + static const char * const strs[] = { + "DEVCONF_FORWARDING", + "DEVCONF_HOPLIMIT", + }; + + print_arr_val(val, idx, idx < ARRAY_SIZE(strs) ? strs[idx] : NULL); +} + +static void +print_inet6_stats_val(uint64_t *val, size_t idx) +{ + static const char * const strs[] = { + "IPSTATS_MIB_NUM", + "IPSTATS_MIB_INPKTS", + }; + + print_arr_uval(val, idx, idx < ARRAY_SIZE(strs) ? strs[idx] : NULL); +} + +static void +print_icmp6_stats_val(uint64_t *val, size_t idx) +{ + static const char * const strs[] = { + "ICMP6_MIB_NUM", + "ICMP6_MIB_INMSGS", + "ICMP6_MIB_INERRORS", + "ICMP6_MIB_OUTMSGS", + "ICMP6_MIB_OUTERRORS", + "ICMP6_MIB_CSUMERRORS", + "6 /* ICMP6_MIB_??? */", + }; + + print_arr_uval(val, idx, idx < ARRAY_SIZE(strs) ? strs[idx] : NULL); +} + +int +main(void) +{ + static const uint8_t unknown_msg[] = { 0xab, 0xac, 0xdb, 0xcd }; + + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + + const unsigned int hdrlen = sizeof(struct ifinfomsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), 3 * NLA_HDRLEN + 256); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + + /* unknown AF_* */ + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + AF_UNIX, pattern, unknown_msg, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + /* AF_INET */ + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET_msg, print_AF_INET_msg, + 0, "IFLA_INET_UNSPEC", pattern, + unknown_msg, print_quoted_hex, 2, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET_msg, print_AF_INET_msg, + 2, "0x2 /* IFLA_INET_??? */", pattern, + unknown_msg, print_quoted_hex, 2, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + /* AF_INET: IFLA_INET_CONF */ + uint32_t inet_conf_vals[] = { 0xdeadc0de, 0xda7aface }; + TEST_NESTED_NLATTR_ARRAY_EX(fd, nlh0, hdrlen, + init_AF_INET_msg, print_AF_INET_msg, + IFLA_INET_CONF, pattern, + inet_conf_vals, 2, print_inet_conf_val); + + /* AF_INET6 */ + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + 0, "IFLA_INET6_UNSPEC", pattern, + unknown_msg, print_quoted_hex, 2, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + 9, "0x9 /* IFLA_INET6_??? */", pattern, + unknown_msg, print_quoted_hex, 2, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + /* AF_INET6: IFLA_INET6_FLAGS */ + static const struct { + uint32_t flags; + const char *str; + } inet6_flags[] = { + { 0xf, "0xf /* IF_??? */" }, + { 0x10, "IF_RS_SENT" }, + { 0xc0, "IF_RA_MANAGED|IF_RA_OTHERCONF" }, + { 0xdeadc0de, "IF_RS_SENT|IF_RA_MANAGED|IF_RA_OTHERCONF" + "|IF_READY|0x5eadc00e" }, + }; + + for (size_t i = 0; i < ARRAY_SIZE(inet6_flags); i++) { + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET6_msg, + print_AF_INET6_msg, + 1, "IFLA_INET6_FLAGS", pattern, + inet6_flags[i].flags, + print_quoted_hex, 2, + printf("%s", inet6_flags[i].str)); + } + + /* AF_INET6: IFLA_INET6_CONF */ + uint32_t inet6_conf_vals[] = { 0xdeadc0de, 0xda7aface }; + TEST_NESTED_NLATTR_ARRAY_EX(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + IFLA_INET6_CONF, pattern, + inet6_conf_vals, 2, print_inet6_conf_val); + + /* AF_INET6: IFLA_INET6_STATS */ + uint64_t inet6_stats_vals[] = { 0xdeadc0deda7aface, 0xdec0deedbadc0ded }; + TEST_NESTED_NLATTR_ARRAY_EX(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + IFLA_INET6_STATS, pattern, + inet6_stats_vals, 2, print_inet6_stats_val); + + /* AF_INET6: IFLA_INET6_MCAST */ + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + 4, "IFLA_INET6_MCAST", pattern, + unknown_msg, print_quoted_hex, 2, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + /* AF_INET6: IFLA_INET6_CACHEINFO */ + static const struct ifla_cacheinfo ci = { + 0xbadc0ded, 0xfacebeef, 0xdecafeed, 0xdeadfeed, + }; + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + 5, "IFLA_INET6_CACHEINFO", pattern, + ci, print_quoted_hex, 2, + PRINT_FIELD_U("{", ci, max_reasm_len); + PRINT_FIELD_U(", ", ci, tstamp); + PRINT_FIELD_U(", ", ci, reachable_time); + PRINT_FIELD_U(", ", ci, retrans_time); + printf("}")); + + /* AF_INET6: IFLA_INET6_ICMP6STATS */ + uint64_t icmp6_stats_vals[] = { + 0xdeadc0deda7aface, 0xdec0deedbadc0ded, 0xfacebeefdeadfeed, + 0xdeadc0deda7afacd, 0xdec0deedbadc0dee, 0xfacebeefdeadfeef, + 0xdeadc0deda7afacc + }; + TEST_NESTED_NLATTR_ARRAY_EX(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + IFLA_INET6_ICMP6STATS, pattern, + icmp6_stats_vals, 2, print_icmp6_stats_val); + + /* AF_INET6: IFLA_INET6_TOKEN */ + uint8_t inet6_addr[16] = { + 0xba, 0xdc, 0x0d, 0xed, 0xfa, 0xce, 0xbe, 0xef, + 0xde, 0xca, 0xfe, 0xed, 0xde, 0xad, 0xfe, 0xed, + }; + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET6_msg, print_AF_INET6_msg, + 7, "IFLA_INET6_TOKEN", pattern, + inet6_addr, print_quoted_hex, 2, + printf("inet_pton(AF_INET6" + ", \"badc:ded:face:beef" + ":deca:feed:dead:feed\")")); + + /* AF_INET6: IFLA_INET6_ */ + static const struct { + uint8_t flags; + const char *str; + } agms[] = { + { 0x0, "IN6_ADDR_GEN_MODE_EUI64" }, + { 0x3, "IN6_ADDR_GEN_MODE_RANDOM" }, + { 0x4, "0x4 /* IN6_ADDR_GEN_MODE_??? */" }, + { 0xff, "0xff /* IN6_ADDR_GEN_MODE_??? */" }, + }; + + for (size_t i = 0; i < ARRAY_SIZE(agms); i++) { + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_AF_INET6_msg, + print_AF_INET6_msg, + 8, "IFLA_INET6_ADDR_GEN_MODE", + pattern, agms[i].flags, + print_quoted_hex, 2, + printf("%s", agms[i].str)); + } + + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/nlattr_ifla_af_spec.gen.test b/tests/nlattr_ifla_af_spec.gen.test new file mode 100755 index 00000000..601eeb22 --- /dev/null +++ b/tests/nlattr_ifla_af_spec.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifla_af_spec +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_ifla_brport.c b/tests/nlattr_ifla_brport.c new file mode 100644 index 00000000..f8ef1caf --- /dev/null +++ b/tests/nlattr_ifla_brport.c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include "test_nlattr.h" +#include +#include +#ifdef HAVE_LINUX_IF_LINK_H +# include +#endif +#include + +#if !HAVE_DECL_IFLA_PROTINFO +enum { IFLA_PROTINFO = 12 }; +#endif + +#define IFLA_BRPORT_PRIORITY 2 +#define IFLA_BRPORT_MESSAGE_AGE_TIMER 21 + +#define IFLA_ATTR IFLA_PROTINFO +#include "nlattr_ifla.h" + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const uint16_t u16 = 0xabcd; + const uint64_t u64 = 0xabcdedeeefeafeab; + const int fd = create_nl_socket(NETLINK_ROUTE); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN * 2 + sizeof(u64)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_BRPORT_PRIORITY, pattern, u16, + printf("%u", u16)); + + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_BRPORT_MESSAGE_AGE_TIMER, pattern, u64, + printf("%" PRIu64, u64)); + +#ifdef HAVE_STRUCT_IFLA_BRIDGE_ID + static const struct ifla_bridge_id id = { + .prio = { 0xab, 0xcd }, + .addr = { 0xab, 0xcd, 0xef, 0xac, 0xbc, 0xcd } + }; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_BRPORT_ROOT_ID, pattern, id, + printf("{prio=[%u, %u]" + ", addr=%02x:%02x:%02x:%02x:%02x:%02x}", + id.prio[0], id.prio[1], + id.addr[0], id.addr[1], id.addr[2], + id.addr[3], id.addr[4], id.addr[5])); +#endif + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/nlattr_ifla_brport.gen.test b/tests/nlattr_ifla_brport.gen.test new file mode 100755 index 00000000..6758d8d1 --- /dev/null +++ b/tests/nlattr_ifla_brport.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifla_brport +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_ifla_linkinfo.c b/tests/nlattr_ifla_linkinfo.c new file mode 100644 index 00000000..080e7371 --- /dev/null +++ b/tests/nlattr_ifla_linkinfo.c @@ -0,0 +1,692 @@ +/* + * IFLA_LINKINFO netlink attribute decoding check. + * + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include + +#include "test_nlattr.h" + +#include +#include +#ifdef HAVE_LINUX_IF_LINK_H +# include +#endif +#include + +#define XLAT_MACROS_ONLY +#include +#include +#undef XLAT_MACROS_ONLY + +#define IFLA_ATTR IFLA_LINKINFO +#include "nlattr_ifla.h" + +#define COMMA , +#define TEST_UNKNOWN_TUNNELS(fd_, nlh0_, objtype_, objtype_str_, \ + obj_, objsz_, arrstrs_, ...) \ + do { \ + /* 64 is guestimate for maximum unknown type len */ \ + char buf[8 * 2 + 64 + objsz_]; \ + const char **arrstrs[] = arrstrs_; \ + const char ***arrstrs_pos = arrstrs; \ + const char **arrstr = *arrstrs_pos; \ + const char *type = NULL; \ + \ + for (type = arrstr ? arrstr[0] : NULL; type && arrstr; \ + type = (++arrstr)[0] ? arrstr[0] \ + : (++arrstrs_pos)[0] \ + ? (arrstr = arrstrs_pos[0])[0] \ + : NULL) \ + { \ + size_t type_len = strlen(type) + 1; \ + \ + if (type_len > 64) \ + error_msg_and_fail("Unexpectedly long " \ + "unknown type: \"%s\" " \ + "(length is %zu)", \ + type, type_len); \ + \ + struct nlattr obj_nla = { \ + .nla_len = NLA_HDRLEN + (objsz_), \ + .nla_type = (objtype_), \ + }; \ + \ + char *pos = buf; \ + memcpy(pos, type, type_len); \ + pos += NLA_ALIGN(type_len); \ + memcpy(pos, &obj_nla, sizeof(obj_nla)); \ + pos += sizeof(obj_nla); \ + memcpy(pos, (obj_), (objsz_)); \ + \ + TEST_NLATTR_EX_((fd_), \ + (nlh0_) - hdrlen - (pos - buf), \ + hdrlen + NLA_HDRLEN, \ + init_ifinfomsg, print_ifinfomsg, \ + IFLA_INFO_KIND, "IFLA_INFO_KIND", \ + type_len, objsz_ + (pos - buf), \ + buf, objsz_ + (pos - buf), \ + printf("\"%s\"}", type); \ + printf(", {{nla_len=%zu" \ + ", nla_type=%s}, ", \ + (objsz_) + NLA_HDRLEN, \ + (objtype_str_)); \ + \ + { __VA_ARGS__; } \ + \ + printf("}")); \ + } \ + } while (0) + +#define TEST_LINKINFO_(fd_, nlh0_, nla_type_, nla_type_str_, tuntype_, \ + obj_, objsz_, pattern_, fallback_func_, ...) \ + do { \ + size_t tuntype_len = strlen(tuntype_) + 1; \ + char *buf = tail_alloc(NLA_ALIGN(tuntype_len) \ + + NLA_HDRLEN + (objsz_)); \ + char *pos = buf; \ + \ + struct nlattr obj_nla = { \ + .nla_len = NLA_HDRLEN + (objsz_), \ + .nla_type = (nla_type_), \ + }; \ + \ + memcpy(pos, (tuntype_), tuntype_len); \ + pos += NLA_ALIGN(tuntype_len); \ + memcpy(pos, &obj_nla, sizeof(obj_nla)); \ + pos += sizeof(obj_nla); \ + memcpy(pos, &(obj_), (objsz_)); \ + \ + if (fallback_func_ == print_quoted_hex) { \ + TEST_NLATTR_EX_((fd_), \ + (nlh0_) - NLA_HDRLEN, \ + hdrlen + NLA_HDRLEN, \ + init_ifinfomsg, print_ifinfomsg, \ + IFLA_INFO_KIND, "IFLA_INFO_KIND", \ + tuntype_len, \ + objsz_ + (pos - buf) - 1, \ + buf, objsz_ + (pos - buf) - 1, \ + printf("\"%s\"}", (tuntype_)); \ + printf(", {{nla_len=%zu" \ + ", nla_type=%s}, ", \ + (objsz_) + NLA_HDRLEN, \ + (nla_type_str_)); \ + (fallback_func_)((obj_), \ + (objsz_) - 1); \ + printf("}")); \ + } \ + \ + TEST_NLATTR_EX_((fd_), (nlh0_) - NLA_HDRLEN, \ + hdrlen + NLA_HDRLEN, \ + init_ifinfomsg, print_ifinfomsg, \ + IFLA_INFO_KIND, "IFLA_INFO_KIND", \ + tuntype_len, objsz_ + (pos - buf), \ + buf, objsz_ + (pos - buf) - 1, \ + printf("\"%s\"}", (tuntype_)); \ + printf(", {{nla_len=%zu, nla_type=%s}, ", \ + (objsz_) + NLA_HDRLEN, \ + (nla_type_str_)); \ + printf("%p}", \ + RTA_DATA(NLMSG_ATTR(nlh, \ + (hdrlen + NLA_HDRLEN + (pos - buf)))) \ + ) \ + ); \ + \ + TEST_NLATTR_EX_((fd_), (nlh0_) - NLA_HDRLEN, \ + hdrlen + NLA_HDRLEN, \ + init_ifinfomsg, print_ifinfomsg, \ + IFLA_INFO_KIND, "IFLA_INFO_KIND", \ + tuntype_len, objsz_ + (pos - buf), \ + buf, objsz_ + (pos - buf), \ + printf("\"%s\"}", (tuntype_)); \ + printf(", {{nla_len=%zu, nla_type=%s}, ", \ + (objsz_) + NLA_HDRLEN, \ + (nla_type_str_)); \ + \ + { __VA_ARGS__; } \ + \ + printf("}")); \ + } while (0) + +#define TEST_LINKINFO(fd_, nlh0_, nla_type_, tuntype_, \ + obj_, pattern_, fallback_func_, ...) \ + TEST_LINKINFO_((fd_), (nlh0_), nla_type_, #nla_type_, (tuntype_), \ + (obj_), sizeof(obj_), pattern_, fallback_func_, \ + __VA_ARGS__) + +#define TEST_NESTED_LINKINFO(fd_, nlh0_, \ + nla_type_, nla_type_str_, tuntype_, \ + subnla_type_, subnla_type_str_, \ + obj_, pattern_, ...) \ + do { \ + size_t tuntype_len = strlen(tuntype_) + 1; \ + struct { \ + size_t sz; \ + const char *str; \ + } attrs[] = { __VA_ARGS__ }; \ + size_t tunhdrlen; \ + size_t buflen = NLA_ALIGN(tuntype_len) + NLA_HDRLEN; \ + size_t attrsz = 0; \ + \ + for (size_t i = 0; i < ARRAY_SIZE(attrs); i++) \ + attrsz += NLA_HDRLEN + NLA_ALIGN(attrs[i].sz); \ + \ + buflen += attrsz; \ + \ + char *buf = tail_alloc(buflen); \ + char *pos = buf; \ + \ + struct nlattr nla = { \ + .nla_len = NLA_HDRLEN + attrsz, \ + .nla_type = (nla_type_), \ + }; \ + \ + memcpy(pos, (tuntype_), tuntype_len); \ + pos += NLA_ALIGN(tuntype_len); \ + memcpy(pos, &nla, sizeof(nla)); \ + pos += sizeof(nla); \ + \ + tunhdrlen = pos - buf; \ + \ + nla.nla_type = subnla_type_; \ + \ + for (size_t i = 0; i < ARRAY_SIZE(attrs); i++) { \ + nla.nla_len = NLA_HDRLEN + attrs[i].sz; \ + memcpy(pos, &nla, sizeof(nla)); \ + pos += sizeof(nla); \ + \ + memcpy(pos, &(obj_), MIN(sizeof(obj_), attrs[i].sz)); \ + \ + if (attrs[i].sz > sizeof(obj_)) \ + memcpy(pos + sizeof(obj_), \ + &(pattern_), \ + attrs[i].sz - sizeof(obj_)); \ + \ + pos += NLA_ALIGN(attrs[i].sz); \ + } \ + \ + TEST_NLATTR_EX_((fd_), (nlh0_) - hdrlen - tunhdrlen, \ + hdrlen + NLA_HDRLEN, \ + init_ifinfomsg, print_ifinfomsg, \ + IFLA_INFO_KIND, "IFLA_INFO_KIND", \ + tuntype_len, buflen, \ + buf, buflen, \ + printf("\"%s\"}", (tuntype_)); \ + printf(", {{nla_len=%zu, nla_type=%s}, [", \ + attrsz + NLA_HDRLEN, \ + (nla_type_str_)); \ + \ + for (size_t i = 0; i < ARRAY_SIZE(attrs); i++) \ + printf("%s%s{nla_len=%zu" \ + ", nla_type=%s}%s%s%s", \ + i ? ", " : "", \ + attrs[i].str ? "{": "", \ + attrs[i].sz + NLA_HDRLEN, \ + subnla_type_str_, \ + attrs[i].str ? ", ": "", \ + attrs[i].str ?: "", \ + attrs[i].str ? "}" : ""); \ + \ + printf("]}")); \ + } while (0) + +int +main(void) +{ + static const uint8_t unknown_msg[] = { 0xab, 0xac, 0xdb, 0xcd }; + static const char *unsupported_tunnel_types[] = { + "batadv", "bond", + "caif", "cfhsi", + "dummy", + "erspan", + "geneve", "gre", "gretap", "gtp", + "hsr", + "ifb", "ip6erspan", "ip6gre", "ip6gretap", "ip6tnl", + "ipip", "ipoib", "ipvlan", "ipvtap", + "lowpan", + "macsec", "macvlan", "macvtap", + "netdevsim", "nlmon", + "openvswitch", + "ppp", + "rmnet", + "sit", + "team", + "vcan", "veth", "vlan", "vrf", "vsockmon", + "vti", "vti6", "vxcan", "vxlan", + NULL + }; + static const char *unsupported_xstats_types[] = { + "bridge", + "tun", + NULL + }; + static const char *unsupported_data_types[] = { + "can", + NULL + }; + + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + + const unsigned int hdrlen = sizeof(struct ifinfomsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), 2 * NLA_HDRLEN + 256); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + + /* unknown AF_INFO_* type */ + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_INFO_UNSPEC, pattern, unknown_msg, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + 6, "0x6 /* IFLA_INFO_??? */", pattern, + unknown_msg, print_quoted_hex, 1, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + + /* IFLA_INFO_KIND */ + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_INFO_KIND, "IFLA_INFO_KIND", pattern, + unknown_msg, print_quoted_stringn, 1, + printf("\"\\253\\254\\333\\315\"...")); + + + /* IFLA_INFO_KIND + IFLA_INFO_UNSPEC */ + TEST_UNKNOWN_TUNNELS(fd, nlh0, IFLA_INFO_UNSPEC, "IFLA_INFO_UNSPEC", + unknown_msg, sizeof(unknown_msg), + {unsupported_tunnel_types COMMA + unsupported_xstats_types COMMA + unsupported_data_types COMMA + NULL}, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + + /* IFLA_INFO_KIND + IFLA_INFO_KIND */ + TEST_UNKNOWN_TUNNELS(fd, nlh0, IFLA_INFO_KIND, "IFLA_INFO_KIND", + unknown_msg, sizeof(unknown_msg), + {unsupported_tunnel_types COMMA + unsupported_xstats_types COMMA + unsupported_data_types COMMA + NULL}, + printf("\"\\253\\254\\333\\315\"...")); + + + /* IFLA_INFO_KIND + IFLA_INFO_DATA */ + TEST_UNKNOWN_TUNNELS(fd, nlh0, IFLA_INFO_DATA, "IFLA_INFO_DATA", + unknown_msg, sizeof(unknown_msg), + {unsupported_tunnel_types COMMA + unsupported_data_types COMMA + NULL}, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + struct val_name { + unsigned int val; + const char *name; + }; + + static const uint64_t u64_val = 0xdeadc0defacefeedULL; + static const uint32_t u32_val = 0xbadc0dedU; + static const uint16_t u16_val = 0xdeed; + static const uint8_t u8_val = 0xa1; + + /* bridge attrs */ + static const struct val_name und_br_attrs[] = { + { 0, "IFLA_BR_UNSPEC" }, + { 20, "IFLA_BR_GROUP_ADDR" }, + { 21, "IFLA_BR_FDB_FLUSH" }, + { 40, "IFLA_BR_PAD" }, + { 47, "0x2f /* IFLA_BR_??? */" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(und_br_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + und_br_attrs[k].val, und_br_attrs[k].name, + unknown_msg, pattern, + { 2, "\"\\xab\\xac\"" }, + { 4, "\"\\xab\\xac\\xdb\\xcd\"" }, + { 6, + "\"\\xab\\xac\\xdb\\xcd\\x61\\x62\"" }, + { 8, "\"\\xab\\xac\\xdb\\xcd\\x61\\x62" + "\\x63\\x64\"" }, + { 10, "\"\\xab\\xac\\xdb\\xcd\\x61\\x62" + "\\x63\\x64\\x65\\x66\"" }); + } + + static const struct val_name u64_br_attrs[] = { + { 16, "IFLA_BR_HELLO_TIMER" }, + { 17, "IFLA_BR_TCN_TIMER" }, + { 18, "IFLA_BR_TOPOLOGY_CHANGE_TIMER" }, + { 19, "IFLA_BR_GC_TIMER" }, + { 30, "IFLA_BR_MCAST_LAST_MEMBER_INTVL" }, + { 31, "IFLA_BR_MCAST_MEMBERSHIP_INTVL" }, + { 32, "IFLA_BR_MCAST_QUERIER_INTVL" }, + { 33, "IFLA_BR_MCAST_QUERY_INTVL" }, + { 34, "IFLA_BR_MCAST_QUERY_RESPONSE_INTVL" }, + { 35, "IFLA_BR_MCAST_STARTUP_QUERY_INTVL" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(u64_br_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + u64_br_attrs[k].val, u64_br_attrs[k].name, + u64_val, pattern, + { 7, "\"" +#if WORDS_BIGENDIAN + "\\xde\\xad\\xc0\\xde\\xfa\\xce\\xfe" +#else + "\\xed\\xfe\\xce\\xfa\\xde\\xc0\\xad" +#endif + "\"" }, + { 8, "16045693111314087661" }, + { 9, "16045693111314087661" }); + } + + static const struct val_name u32_br_attrs[] = { + { 1, "IFLA_BR_FORWARD_DELAY" }, + { 2, "IFLA_BR_HELLO_TIME" }, + { 3, "IFLA_BR_MAX_AGE" }, + { 4, "IFLA_BR_AGEING_TIME" }, + { 5, "IFLA_BR_STP_STATE" }, + { 13, "IFLA_BR_ROOT_PATH_COST" }, + { 26, "IFLA_BR_MCAST_HASH_ELASTICITY" }, + { 27, "IFLA_BR_MCAST_HASH_MAX" }, + { 28, "IFLA_BR_MCAST_LAST_MEMBER_CNT" }, + { 29, "IFLA_BR_MCAST_STARTUP_QUERY_CNT" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(u32_br_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + u32_br_attrs[k].val, u32_br_attrs[k].name, + u32_val, pattern, + { 3, "\"" +#if WORDS_BIGENDIAN + "\\xba\\xdc\\x0d" +#else + "\\xed\\x0d\\xdc" +#endif + "\"" }, + { 4, "3134983661" }, + { 5, "3134983661" }); + } + + static const struct val_name u16_br_attrs[] = { + { 6, "IFLA_BR_PRIORITY" }, + { 12, "IFLA_BR_ROOT_PORT" }, + { 39, "IFLA_BR_VLAN_DEFAULT_PVID" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(u16_br_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + u16_br_attrs[k].val, u16_br_attrs[k].name, + u16_val, pattern, + { 1, "\"" +#if WORDS_BIGENDIAN + "\\xde" +#else + "\\xed" +#endif + "\"" }, + { 2, "57069" }, + { 3, "57069" }); + } + + + static const struct val_name x16_br_attrs[] = { + { 9, "IFLA_BR_GROUP_FWD_MASK" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(x16_br_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + x16_br_attrs[k].val, x16_br_attrs[k].name, + u16_val, pattern, + { 1, "\"" +#if WORDS_BIGENDIAN + "\\xde" +#else + "\\xed" +#endif + "\"" }, + { 2, "0xdeed" }, + { 3, "0xdeed" }); + } + + static const struct val_name u8_br_attrs[] = { + { 7, "IFLA_BR_VLAN_FILTERING" }, + { 14, "IFLA_BR_TOPOLOGY_CHANGE" }, + { 15, "IFLA_BR_TOPOLOGY_CHANGE_DETECTED" }, + { 22, "IFLA_BR_MCAST_ROUTER" }, + { 23, "IFLA_BR_MCAST_SNOOPING" }, + { 24, "IFLA_BR_MCAST_QUERY_USE_IFADDR" }, + { 25, "IFLA_BR_MCAST_QUERIER" }, + { 36, "IFLA_BR_NF_CALL_IPTABLES" }, + { 37, "IFLA_BR_NF_CALL_IP6TABLES" }, + { 38, "IFLA_BR_NF_CALL_ARPTABLES" }, + { 41, "IFLA_BR_VLAN_STATS_ENABLED" }, + { 42, "IFLA_BR_MCAST_STATS_ENABLED" }, + { 43, "IFLA_BR_MCAST_IGMP_VERSION" }, + { 44, "IFLA_BR_MCAST_MLD_VERSION" }, + { 45, "IFLA_BR_VLAN_STATS_PER_PORT" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(u8_br_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + u8_br_attrs[k].val, u8_br_attrs[k].name, + u8_val, pattern, + { 0, NULL }, + { 1, "161" }, + { 2, "161" }); + } + + unsigned short eth_p = htons(0x88C7); + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + 8, "IFLA_BR_VLAN_PROTOCOL", + eth_p, pattern, + { 1, "\"\\x88\"" }, + { 2, "htons(ETH_P_PREAUTH)" }, + { 2, "htons(ETH_P_PREAUTH)" }); + + static const uint8_t bridge_id[] + = { 0xbe, 0xef, 0xfa, 0xce, 0xde, 0xc0, 0xde, 0xad }; + static const struct val_name br_id_attrs[] = { + { 10, "IFLA_BR_ROOT_ID" }, + { 11, "IFLA_BR_BRIDGE_ID" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(br_id_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "bridge", + br_id_attrs[k].val, br_id_attrs[k].name, + bridge_id, pattern, + { 7, "\"\\xbe\\xef\\xfa\\xce" + "\\xde\\xc0\\xde\"" }, + { 8, "{prio=[190, 239]" + ", addr=fa:ce:de:c0:de:ad}" }, + { 9, "{prio=[190, 239]" + ", addr=fa:ce:de:c0:de:ad}" }); + } + + /* tun attrs */ + static const struct val_name u8_tun_attrs[] = { + { 4, "IFLA_TUN_PI" }, + { 5, "IFLA_TUN_VNET_HDR" }, + { 6, "IFLA_TUN_PERSIST" }, + { 7, "IFLA_TUN_MULTI_QUEUE" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(u8_tun_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "tun", + u8_tun_attrs[k].val, u8_tun_attrs[k].name, + u8_val, pattern, + { 0, NULL }, + { 1, "161" }, + { 2, "161" }); + } + + static const struct val_name u32_tun_attrs[] = { + { 8, "IFLA_TUN_NUM_QUEUES" }, + { 9, "IFLA_TUN_NUM_DISABLED_QUEUES" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(u32_tun_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "tun", + u32_tun_attrs[k].val, + u32_tun_attrs[k].name, + u32_val, pattern, + { 3, "\"" +#if WORDS_BIGENDIAN + "\\xba\\xdc\\x0d" +#else + "\\xed\\x0d\\xdc" +#endif + "\"" }, + { 4, "3134983661" }, + { 5, "3134983661" }); + } + + static const struct val_name und_tun_attrs[] = { + { 0, "IFLA_TUN_UNSPEC" }, + { 10, "0xa /* IFLA_TUN_??? */" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(und_tun_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "tun", + und_tun_attrs[k].val, + und_tun_attrs[k].name, + unknown_msg, pattern, + { 2, "\"\\xab\\xac\"" }, + { 4, "\"\\xab\\xac\\xdb\\xcd\"" }, + { 6, + "\"\\xab\\xac\\xdb\\xcd\\x61\\x62\"" }, + { 8, "\"\\xab\\xac\\xdb\\xcd\\x61\\x62" + "\\x63\\x64\"" }, + { 10, "\"\\xab\\xac\\xdb\\xcd\\x61\\x62" + "\\x63\\x64\\x65\\x66\"" }); + } + + static const uint32_t minus_one = 0xffffffffU; + static const struct val_name uid_tun_attrs[] = { + { 1, "IFLA_TUN_OWNER" }, + { 2, "IFLA_TUN_GROUP" }, + }; + + for (size_t k = 0; k < ARRAY_SIZE(uid_tun_attrs); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "tun", + uid_tun_attrs[k].val, + uid_tun_attrs[k].name, + u32_val, pattern, + { 3, "\"" +#if WORDS_BIGENDIAN + "\\xba\\xdc\\x0d" +#else + "\\xed\\x0d\\xdc" +#endif + "\"" }, + { 4, "3134983661" }, + { 5, "3134983661" }); + + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "tun", + uid_tun_attrs[k].val, + uid_tun_attrs[k].name, + minus_one, pattern, + { 3, "\"\\xff\\xff\\xff\"" }, + { 4, "-1" }, + { 5, "-1" }); + } + + static const struct { + uint8_t val; + const char *str; + } tun_types[] = { + { 0, "0 /* IFF_??? */"}, + { 1, "IFF_TUN"}, + { 2, "IFF_TAP"}, + { 3, "0x3 /* IFF_??? */"}, + { 0xda, "0xda /* IFF_??? */"}, + }; + + for (size_t k = 0; k < ARRAY_SIZE(tun_types); k++) { + TEST_NESTED_LINKINFO(fd, nlh0, 2, "IFLA_INFO_DATA", "tun", + 3, "IFLA_TUN_TYPE", + tun_types[k].val, pattern, + { 0, NULL }, + { 1, tun_types[k].str }, + { 2, tun_types[k].str }); + } + + + /* IFLA_INFO_KIND + IFLA_INFO_XSTATS */ + TEST_UNKNOWN_TUNNELS(fd, nlh0, IFLA_INFO_XSTATS, "IFLA_INFO_XSTATS", + unknown_msg, sizeof(unknown_msg), + {unsupported_tunnel_types COMMA + /* + * can decoder decodes its data only if it's big + * enough. + */ + unsupported_xstats_types COMMA + unsupported_data_types COMMA + NULL}, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + uint32_t can_stats_data[] = { + 0xbadc0de0, 0xbadc0de1, 0xbadc0de2, 0xbadc0de3, + 0xbadc0de4, 0xbadc0de5, + }; + + TEST_LINKINFO(fd, nlh0, IFLA_INFO_XSTATS, "can", + can_stats_data, pattern, print_quoted_hex, + printf("{bus_error=3134983648" + ", error_warning=3134983649" + ", error_passive=3134983650" + ", bus_off=3134983651" + ", arbitration_lost=3134983652" + ", restarts=3134983653}")); + + + /* IFLA_INFO_KIND + IFLA_INFO_SLVAE_KIND */ + TEST_UNKNOWN_TUNNELS(fd, nlh0, + IFLA_INFO_SLAVE_KIND, "IFLA_INFO_SLAVE_KIND", + unknown_msg, sizeof(unknown_msg), + {unsupported_tunnel_types COMMA + unsupported_xstats_types COMMA + unsupported_data_types COMMA + NULL}, + printf("\"\\253\\254\\333\\315\"...")); + + + /* IFLA_INFO_KIND + IFLA_INFO_SLAVE_DATA */ + TEST_UNKNOWN_TUNNELS(fd, nlh0, + IFLA_INFO_SLAVE_DATA, "IFLA_INFO_SLAVE_DATA", + unknown_msg, sizeof(unknown_msg), + {unsupported_tunnel_types COMMA + unsupported_xstats_types COMMA + unsupported_data_types COMMA + NULL}, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + + /* IFLA_INFO_KIND + unknown type */ + TEST_UNKNOWN_TUNNELS(fd, nlh0, 6, "0x6 /* IFLA_INFO_??? */", + unknown_msg, sizeof(unknown_msg), + {unsupported_tunnel_types COMMA + unsupported_xstats_types COMMA + unsupported_data_types COMMA + NULL}, + printf("\"\\xab\\xac\\xdb\\xcd\"")); + + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/nlattr_ifla_linkinfo.gen.test b/tests/nlattr_ifla_linkinfo.gen.test new file mode 100755 index 00000000..816ba99c --- /dev/null +++ b/tests/nlattr_ifla_linkinfo.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifla_linkinfo +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_ifla_port.c b/tests/nlattr_ifla_port.c new file mode 100644 index 00000000..df2a2ef6 --- /dev/null +++ b/tests/nlattr_ifla_port.c @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include "test_nlattr.h" +#include +#include +#ifdef HAVE_LINUX_IF_LINK_H +# include +#endif +#include + +#if !HAVE_DECL_IFLA_PORT_SELF +enum { IFLA_PORT_SELF = 25 }; +#endif +#ifndef IFLA_PORT_VF +# define IFLA_PORT_VF 1 +#endif + +#define IFLA_ATTR IFLA_PORT_SELF +#include "nlattr_ifla.h" + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), 2 * NLA_HDRLEN + 8); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const uint32_t num = 0xabacdbcd; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_PORT_VF, pattern, num, + printf("%u", num)); + +#ifdef HAVE_STRUCT_IFLA_PORT_VSI + static const struct ifla_port_vsi vsi = { + .vsi_mgr_id = 0xab, + .vsi_type_id = "abc", + .vsi_type_version = 0xef + }; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_PORT_VSI_TYPE, pattern, vsi, + PRINT_FIELD_U("{", vsi, vsi_mgr_id); + printf(", vsi_type_id=\"\\x61\\x62\\x63\""); + PRINT_FIELD_U(", ", vsi, vsi_type_version); + printf("}")); +#endif + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/nlattr_ifla_port.gen.test b/tests/nlattr_ifla_port.gen.test new file mode 100755 index 00000000..ecea89a4 --- /dev/null +++ b/tests/nlattr_ifla_port.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifla_port +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_ifla_xdp.c b/tests/nlattr_ifla_xdp.c new file mode 100644 index 00000000..232f2145 --- /dev/null +++ b/tests/nlattr_ifla_xdp.c @@ -0,0 +1,123 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include "test_nlattr.h" +#include +#include +#ifdef HAVE_LINUX_IF_LINK_H +# include +#endif +#include + +#if !HAVE_DECL_IFLA_XDP +enum { IFLA_XDP = 43 }; +#endif +#ifndef IFLA_XDP_FD +# define IFLA_XDP_FD 1 +#endif + +#ifndef IFLA_XDP_ATTACHED +# define IFLA_XDP_ATTACHED 2 +#endif + +#ifndef IFLA_XDP_PROG_ID +# define IFLA_XDP_PROG_ID 4 +#endif + +#ifndef IFLA_XDP_DRV_PROG_ID +# define IFLA_XDP_DRV_PROG_ID 5 +#endif + +#ifndef IFLA_XDP_SKB_PROG_ID +# define IFLA_XDP_SKB_PROG_ID 6 +#endif + +#ifndef IFLA_XDP_HW_PROG_ID +# define IFLA_XDP_HW_PROG_ID 7 +#endif + +#ifndef XDP_ATTACHED_NONE +# define XDP_ATTACHED_NONE 0 +#endif + +#ifndef XDP_ATTACHED_MULTI +# define XDP_ATTACHED_MULTI 4 +#endif + +#define IFLA_ATTR IFLA_XDP +#include "nlattr_ifla.h" + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int32_t num = 0xabacdbcd; + const int fd = create_nl_socket(NETLINK_ROUTE); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(num)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_XDP_FD, pattern, num, + printf("%d", num)); + + static const struct { + uint8_t val; + const char *str; + } attach_types[] = { + { ARG_STR(XDP_ATTACHED_NONE) }, + { ARG_STR(XDP_ATTACHED_MULTI) }, + { ARG_STR(0x5) " /* XDP_ATTACHED_??? */" }, + { ARG_STR(0xfe) " /* XDP_ATTACHED_??? */" }, + }; + + for (size_t i = 0; i < ARRAY_SIZE(attach_types); i++) { + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_XDP_ATTACHED, pattern, + attach_types[i].val, + printf("%s", attach_types[i].str)); + } + +#ifdef XDP_FLAGS_UPDATE_IF_NOEXIST + const uint32_t flags = XDP_FLAGS_UPDATE_IF_NOEXIST; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + IFLA_XDP_FLAGS, pattern, flags, + printf("XDP_FLAGS_UPDATE_IF_NOEXIST")); +#endif + + static const struct { + uint32_t val; + const char *str; + } attrs[] = { + { ARG_STR(IFLA_XDP_PROG_ID) }, + { ARG_STR(IFLA_XDP_DRV_PROG_ID) }, + { ARG_STR(IFLA_XDP_SKB_PROG_ID) }, + { ARG_STR(IFLA_XDP_HW_PROG_ID) }, + }; + + for (size_t i = 0; i < ARRAY_SIZE(attrs); i++) { + TEST_NESTED_NLATTR_OBJECT_EX_(fd, nlh0, hdrlen, + init_ifinfomsg, print_ifinfomsg, + attrs[i].val, attrs[i].str, + pattern, num, + print_quoted_hex, 1, + printf("%u", num)); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/nlattr_ifla_xdp.gen.test b/tests/nlattr_ifla_xdp.gen.test new file mode 100755 index 00000000..c6e0fab3 --- /dev/null +++ b/tests/nlattr_ifla_xdp.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ifla_xdp +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_inet_diag_msg.c b/tests/nlattr_inet_diag_msg.c new file mode 100644 index 00000000..97f5a95e --- /dev/null +++ b/tests/nlattr_inet_diag_msg.c @@ -0,0 +1,205 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include "test_nlattr.h" +#include +#include + +static const char * const sk_meminfo_strs[] = { + "SK_MEMINFO_RMEM_ALLOC", + "SK_MEMINFO_RCVBUF", + "SK_MEMINFO_WMEM_ALLOC", + "SK_MEMINFO_SNDBUF", + "SK_MEMINFO_FWD_ALLOC", + "SK_MEMINFO_WMEM_QUEUED", + "SK_MEMINFO_OPTMEM", + "SK_MEMINFO_BACKLOG", + "SK_MEMINFO_DROPS", +}; + +static const char address[] = "10.11.12.13"; + +static void +init_inet_diag_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP + ); + + struct inet_diag_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct inet_diag_msg, msg, + .idiag_family = AF_INET, + .idiag_state = TCP_LISTEN, + .id.idiag_if = ifindex_lo() + ); + + if (!inet_pton(AF_INET, address, msg->id.idiag_src) || + !inet_pton(AF_INET, address, msg->id.idiag_dst)) + perror_msg_and_skip("inet_pton"); +} + +static void +print_inet_diag_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {idiag_family=AF_INET" + ", idiag_state=TCP_LISTEN, idiag_timer=0, idiag_retrans=0" + ", id={idiag_sport=htons(0), idiag_dport=htons(0)" + ", idiag_src=inet_addr(\"%s\")" + ", idiag_dst=inet_addr(\"%s\")" + ", idiag_if=" IFINDEX_LO_STR + ", idiag_cookie=[0, 0]}" + ", idiag_expires=0, idiag_rqueue=0, idiag_wqueue=0" + ", idiag_uid=0, idiag_inode=0}", + msg_len, address, address); +} + +static void +print_uint(const unsigned int *p, size_t i) +{ + if (i >= ARRAY_SIZE(sk_meminfo_strs)) + printf("[%zu /* SK_MEMINFO_??? */", i); + else + printf("[%s", sk_meminfo_strs[i]); + + printf("] = %u", *p); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + static const struct inet_diag_meminfo minfo = { + .idiag_rmem = 0xfadcacdb, + .idiag_wmem = 0xbdabcada, + .idiag_fmem = 0xbadbfafb, + .idiag_tmem = 0xfdacdadf + }; + static const struct tcpvegas_info vegas = { + .tcpv_enabled = 0xfadcacdb, + .tcpv_rttcnt = 0xbdabcada, + .tcpv_rtt = 0xbadbfafb, + .tcpv_minrtt = 0xfdacdadf + }; + static const struct tcp_dctcp_info dctcp = { + .dctcp_enabled = 0xfdac, + .dctcp_ce_state = 0xfadc, + .dctcp_alpha = 0xbdabcada, + .dctcp_ab_ecn = 0xbadbfafb, + .dctcp_ab_tot = 0xfdacdadf + }; + static const struct tcp_bbr_info bbr = { + .bbr_bw_lo = 0xfdacdadf, + .bbr_bw_hi = 0xfadcacdb, + .bbr_min_rtt = 0xbdabcada, + .bbr_pacing_gain = 0xbadbfafb, + .bbr_cwnd_gain = 0xfdacdadf + }; + static const uint32_t mem[] = { 0xaffacbad, 0xffadbcab }; + static uint32_t bigmem[SK_MEMINFO_VARS + 1]; + static const uint32_t mark = 0xabdfadca; + static const uint8_t shutdown = 0xcd; + + const int fd = create_nl_socket(NETLINK_SOCK_DIAG); + const unsigned int hdrlen = sizeof(struct inet_diag_msg); + void *const nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + + MAX(sizeof(bigmem), DEFAULT_STRLEN)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_MEMINFO, pattern, minfo, + PRINT_FIELD_U("{", minfo, idiag_rmem); + PRINT_FIELD_U(", ", minfo, idiag_wmem); + PRINT_FIELD_U(", ", minfo, idiag_fmem); + PRINT_FIELD_U(", ", minfo, idiag_tmem); + printf("}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_VEGASINFO, pattern, vegas, + PRINT_FIELD_U("{", vegas, tcpv_enabled); + PRINT_FIELD_U(", ", vegas, tcpv_rttcnt); + PRINT_FIELD_U(", ", vegas, tcpv_rtt); + PRINT_FIELD_U(", ", vegas, tcpv_minrtt); + printf("}")); + + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_DCTCPINFO, pattern, dctcp, + PRINT_FIELD_U("{", dctcp, dctcp_enabled); + PRINT_FIELD_U(", ", dctcp, dctcp_ce_state); + PRINT_FIELD_U(", ", dctcp, dctcp_alpha); + PRINT_FIELD_U(", ", dctcp, dctcp_ab_ecn); + PRINT_FIELD_U(", ", dctcp, dctcp_ab_tot); + printf("}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_BBRINFO, pattern, bbr, + PRINT_FIELD_X("{", bbr, bbr_bw_lo); + PRINT_FIELD_X(", ", bbr, bbr_bw_hi); + PRINT_FIELD_U(", ", bbr, bbr_min_rtt); + PRINT_FIELD_U(", ", bbr, bbr_pacing_gain); + PRINT_FIELD_U(", ", bbr, bbr_cwnd_gain); + printf("}")); + + TEST_NLATTR_ARRAY(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_SKMEMINFO, pattern, mem, print_uint); + + memcpy(bigmem, pattern, sizeof(bigmem)); + + TEST_NLATTR_ARRAY(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_SKMEMINFO, pattern, bigmem, print_uint); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_MARK, pattern, mark, + printf("%u", mark)); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, + INET_DIAG_CLASS_ID, pattern, mark, + printf("%u", mark)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, INET_DIAG_SHUTDOWN, + sizeof(shutdown), &shutdown, sizeof(shutdown), + printf("%u", shutdown)); + + char *const str = tail_alloc(DEFAULT_STRLEN); + fill_memory_ex(str, DEFAULT_STRLEN, '0', 10); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, INET_DIAG_CONG, + DEFAULT_STRLEN, str, DEFAULT_STRLEN, + printf("\"%.*s\"...", DEFAULT_STRLEN, str)); + str[DEFAULT_STRLEN - 1] = '\0'; + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_msg, print_inet_diag_msg, INET_DIAG_CONG, + DEFAULT_STRLEN, str, DEFAULT_STRLEN, + printf("\"%s\"", str)); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/nlattr_inet_diag_msg.gen.test b/tests/nlattr_inet_diag_msg.gen.test new file mode 100755 index 00000000..953a23df --- /dev/null +++ b/tests/nlattr_inet_diag_msg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_inet_diag_msg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_inet_diag_req_compat.c b/tests/nlattr_inet_diag_req_compat.c new file mode 100644 index 00000000..8cce46cd --- /dev/null +++ b/tests/nlattr_inet_diag_req_compat.c @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include "test_nlattr.h" +#include +#include +#include + +static const char address[] = "10.11.12.13"; + +static void +init_inet_diag_req(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = TCPDIAG_GETSOCK, + .nlmsg_flags = NLM_F_REQUEST + ); + + struct inet_diag_req *const req = NLMSG_DATA(nlh); + SET_STRUCT(struct inet_diag_req, req, + .idiag_family = AF_INET, + .idiag_ext = 1 << (INET_DIAG_TOS - 1), + .idiag_states = 1 << TCP_LAST_ACK, + .id.idiag_if = ifindex_lo() + ); + + if (!inet_pton(AF_INET, address, req->id.idiag_src) || + !inet_pton(AF_INET, address, req->id.idiag_dst)) + perror_msg_and_skip("inet_pton"); +} + +static void +print_inet_diag_req(const unsigned int msg_len) +{ + printf("{len=%u, type=TCPDIAG_GETSOCK, flags=NLM_F_REQUEST" + ", seq=0, pid=0}, {idiag_family=AF_INET" + ", idiag_src_len=0, idiag_dst_len=0" + ", idiag_ext=1<<(INET_DIAG_TOS-1)" + ", id={idiag_sport=htons(0), idiag_dport=htons(0)" + ", idiag_src=inet_addr(\"%s\")" + ", idiag_dst=inet_addr(\"%s\")" + ", idiag_if=" IFINDEX_LO_STR + ", idiag_cookie=[0, 0]}" + ", idiag_states=1< + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include "test_nlattr.h" +#include +#include +#include + +static const char address[] = "10.11.12.13"; +static const unsigned int hdrlen = sizeof(struct inet_diag_req_v2); +static void *nlh0; +static char pattern[4096]; + +static void +init_inet_diag_req_v2(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_REQUEST + ); + + struct inet_diag_req_v2 *const req = NLMSG_DATA(nlh); + SET_STRUCT(struct inet_diag_req_v2, req, + .sdiag_family = AF_INET, + .idiag_ext = 1 << (INET_DIAG_CONG - 1), + .sdiag_protocol = IPPROTO_TCP, + .idiag_states = 1 << TCP_CLOSE, + .id.idiag_if = ifindex_lo() + ); + + if (!inet_pton(AF_INET, address, req->id.idiag_src) || + !inet_pton(AF_INET, address, req->id.idiag_dst)) + perror_msg_and_skip("inet_pton"); +} + +static void +print_inet_diag_req_v2(const unsigned int msg_len) +{ + printf("{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_REQUEST, seq=0, pid=0}" + ", {sdiag_family=AF_INET, sdiag_protocol=IPPROTO_TCP" + ", idiag_ext=1<<(INET_DIAG_CONG-1)" + ", idiag_states=1< DEFAULT_STRLEN ? + sizeof(op) + DEFAULT_STRLEN : sizeof(buf) - 1; + memcpy(buf + sizeof(op), &pattern, sizeof(cond)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + plen, buf, plen, + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + print_quoted_hex(buf + sizeof(op), plen - sizeof(op)); + printf("}")); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf) - 1, + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + printf("%p}", RTA_DATA(TEST_NLATTR_nla) + sizeof(op))); + + memcpy(buf + sizeof(op), &cond, sizeof(cond)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf), + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + printf("{family=AF_UNSPEC"); + PRINT_FIELD_U(", ", cond, prefix_len); + PRINT_FIELD_U(", ", cond, port); + printf("}}")); +} + +static void +print_inet_diag_hostcond(const char *const family) +{ + printf("{family=%s, prefix_len=0, port=0, ", family); +} + +static void +test_in_addr(const int fd) +{ + static const struct inet_diag_bc_op op = { + .code = INET_DIAG_BC_S_COND, + }; + static const struct inet_diag_hostcond cond = { + .family = AF_INET, + }; + struct in_addr addr; + if (!inet_pton(AF_INET, address, &addr)) + perror_msg_and_skip("inet_pton"); + + char buf[sizeof(op) + sizeof(cond) + sizeof(addr)]; + memcpy(buf, &op, sizeof(op)); + memcpy(buf + sizeof(op), &cond, sizeof(cond)); + + const unsigned int plen = sizeof(addr) - 1 > DEFAULT_STRLEN ? + sizeof(cond) + sizeof(cond) + DEFAULT_STRLEN : sizeof(buf) - 1; + memcpy(buf + sizeof(op) + sizeof(cond), &pattern, sizeof(addr)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + plen, buf, plen, + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + print_inet_diag_hostcond("AF_INET"); + printf("addr="); + print_quoted_hex(pattern, plen - sizeof(op) - sizeof(cond)); + printf("}}")); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf) - 1, + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + print_inet_diag_hostcond("AF_INET"); + printf("addr=%p}}", + RTA_DATA(TEST_NLATTR_nla) + + sizeof(op) + sizeof(cond))); + + memcpy(buf + sizeof(op) + sizeof(cond), &addr, sizeof(addr)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf), + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + print_inet_diag_hostcond("AF_INET"); + printf("addr=inet_addr(\"%s\")}}", address)); +} + +static void +test_in6_addr(const int fd) +{ + const char address6[] = "12:34:56:78:90:ab:cd:ef"; + static const struct inet_diag_bc_op op = { + .code = INET_DIAG_BC_S_COND, + }; + static const struct inet_diag_hostcond cond = { + .family = AF_INET6, + }; + struct in6_addr addr; + if (!inet_pton(AF_INET6, address6, &addr)) + perror_msg_and_skip("inet_pton"); + + char buf[sizeof(op) + sizeof(cond) + sizeof(addr)]; + memcpy(buf, &op, sizeof(op)); + memcpy(buf + sizeof(op), &cond, sizeof(cond)); + + const unsigned int plen = sizeof(addr) - 1 > DEFAULT_STRLEN ? + sizeof(cond) + sizeof(cond) + DEFAULT_STRLEN : sizeof(buf) - 1; + memcpy(buf + sizeof(op) + sizeof(cond), &pattern, sizeof(addr)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + plen, buf, plen, + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + print_inet_diag_hostcond("AF_INET6"); + printf("addr="); + print_quoted_hex(pattern, plen - sizeof(op) - sizeof(cond)); + printf("}}")); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf) - 1, + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + print_inet_diag_hostcond("AF_INET6"); + printf("addr=%p}}", + RTA_DATA(TEST_NLATTR_nla) + + sizeof(op) + sizeof(cond))); + + memcpy(buf + sizeof(op) + sizeof(cond), &addr, sizeof(addr)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf), + print_inet_diag_bc_op("INET_DIAG_BC_S_COND"); + print_inet_diag_hostcond("AF_INET6"); + printf("inet_pton(AF_INET6, \"%s\", &addr)}}", address6)); +} + +static void +test_inet_diag_bc_dev_cond(const int fd) +{ + static const struct inet_diag_bc_op op = { + .code = INET_DIAG_BC_DEV_COND, + }; + const uint32_t ifindex = ifindex_lo(); + char buf[sizeof(op) + sizeof(ifindex)]; + memcpy(buf, &op, sizeof(op)); + memcpy(buf + sizeof(op), pattern, sizeof(ifindex)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf) - 1, buf, sizeof(buf) - 1, + print_inet_diag_bc_op("INET_DIAG_BC_DEV_COND"); + print_quoted_hex(pattern, sizeof(ifindex) - 1); + printf("}")); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf) - 1, + print_inet_diag_bc_op("INET_DIAG_BC_DEV_COND"); + printf("%p}", RTA_DATA(TEST_NLATTR_nla) + sizeof(op))); + + memcpy(buf + sizeof(op), &ifindex, sizeof(ifindex)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf), + print_inet_diag_bc_op("INET_DIAG_BC_DEV_COND"); + printf(IFINDEX_LO_STR "}")); +} + +static void +test_inet_diag_bc_s_le(const int fd) +{ + static const struct inet_diag_bc_op op[] = { + { + .code = INET_DIAG_BC_S_LE, + }, + { + .code = INET_DIAG_BC_DEV_COND, + .yes = 0xaf, + .no = 0xafcd + } + }; + + char buf[sizeof(op)]; + memcpy(buf, op, sizeof(op[0])); + memcpy(buf + sizeof(op[0]), pattern, sizeof(op[1])); + + const unsigned int plen = sizeof(op[1]) - 1 > DEFAULT_STRLEN ? + sizeof(op[0]) + DEFAULT_STRLEN : sizeof(buf) - 1; + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + plen, buf, plen, + print_inet_diag_bc_op("INET_DIAG_BC_S_LE"); + print_quoted_hex(buf + sizeof(op[0]), plen - sizeof(op[0])); + printf("}")); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf) - 1, + print_inet_diag_bc_op("INET_DIAG_BC_S_LE"); + printf("%p}", RTA_DATA(TEST_NLATTR_nla) + sizeof(op[0]))); + + memcpy(buf + sizeof(op[0]), &op[1], sizeof(op[1])); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf), + print_inet_diag_bc_op("INET_DIAG_BC_S_LE"); + printf("{code=INET_DIAG_BC_DEV_COND"); + PRINT_FIELD_U(", ", op[1], yes); + PRINT_FIELD_U(", ", op[1], no); + printf("}}")); +}; + +static void +test_inet_diag_bc_mark_cond(const int fd) +{ + static const struct inet_diag_bc_op op = { + .code = INET_DIAG_BC_MARK_COND, + }; + static const struct inet_diag_markcond markcond = { + .mark = 0xafbcafcd, + .mask = 0xbafaacda + }; + char buf[sizeof(op) + sizeof(markcond)]; + memcpy(buf, &op, sizeof(op)); + memcpy(buf + sizeof(op), pattern, sizeof(markcond)); + + const unsigned int plen = sizeof(markcond) - 1 > DEFAULT_STRLEN ? + sizeof(markcond) + DEFAULT_STRLEN : sizeof(buf) - 1; + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + plen, buf, plen, + print_inet_diag_bc_op("INET_DIAG_BC_MARK_COND"); + print_quoted_hex(buf + sizeof(op), plen - sizeof(op)); + printf("}")); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf) - 1, + print_inet_diag_bc_op("INET_DIAG_BC_MARK_COND"); + printf("%p}", RTA_DATA(TEST_NLATTR_nla) + sizeof(op))); + + memcpy(buf + sizeof(op), &markcond, sizeof(markcond)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf), + print_inet_diag_bc_op("INET_DIAG_BC_MARK_COND"); + PRINT_FIELD_U("{", markcond, mark); + PRINT_FIELD_U(", ", markcond, mask); + printf("}}")); +} + +static void +test_inet_diag_bc_nop(const int fd) +{ + static const struct inet_diag_bc_op op = { + .code = INET_DIAG_BC_AUTO, + }; + char buf[sizeof(op) + 4]; + memcpy(buf, &op, sizeof(op)); + memcpy(buf + sizeof(op), pattern, 4); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_inet_diag_req_v2, print_inet_diag_req_v2, + INET_DIAG_REQ_BYTECODE, + sizeof(buf), buf, sizeof(buf), + print_inet_diag_bc_op("INET_DIAG_BC_AUTO"); + print_quoted_hex(buf + sizeof(op), + sizeof(buf) - sizeof(op)); + printf("}")); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + int fd = create_nl_socket(NETLINK_SOCK_DIAG); + nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + + sizeof(struct inet_diag_bc_op) + + sizeof(struct inet_diag_hostcond) + + sizeof(struct in6_addr) + DEFAULT_STRLEN); + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + test_inet_diag_bc_op(fd); + test_inet_diag_bc_s_cond(fd); + test_in_addr(fd); + test_in6_addr(fd); + test_inet_diag_bc_dev_cond(fd); + test_inet_diag_bc_s_le(fd); + test_inet_diag_bc_mark_cond(fd); + test_inet_diag_bc_nop(fd); + + printf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests/nlattr_inet_diag_req_v2.gen.test b/tests/nlattr_inet_diag_req_v2.gen.test new file mode 100755 index 00000000..01c73a13 --- /dev/null +++ b/tests/nlattr_inet_diag_req_v2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_inet_diag_req_v2 +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_mdba_mdb_entry.c b/tests/nlattr_mdba_mdb_entry.c new file mode 100644 index 00000000..7ac89ff0 --- /dev/null +++ b/tests/nlattr_mdba_mdb_entry.c @@ -0,0 +1,167 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_BR_PORT_MSG + +# include +# include "test_nlattr.h" +# include +# include +# include + +# ifndef MDB_TEMPORARY +# define MDB_TEMPORARY 0 +# endif +# ifndef MDBA_MDB_ENTRY_INFO +# define MDBA_MDB_ENTRY_INFO 1 +# endif +# ifndef MDBA_MDB_EATTR_TIMER +# define MDBA_MDB_EATTR_TIMER 1 +# endif + +const unsigned int hdrlen = sizeof(struct br_port_msg); + +static void +init_br_port_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + unsigned int len = msg_len; + + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = len, + .nlmsg_type = RTM_GETMDB, + .nlmsg_flags = NLM_F_DUMP + ); + + struct br_port_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct br_port_msg, msg, + .family = AF_UNIX, + .ifindex = ifindex_lo() + ); + + struct nlattr *nla = NLMSG_ATTR(nlh, sizeof(*msg)); + len -= NLMSG_SPACE(hdrlen); + SET_STRUCT(struct nlattr, nla, + .nla_len = len, + .nla_type = MDBA_MDB + ); + + nla = nla + 1; + len -= NLA_HDRLEN; + SET_STRUCT(struct nlattr, nla, + .nla_len = len, + .nla_type = MDBA_MDB_ENTRY + ); +} + +static void +print_br_port_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETMDB, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {family=AF_UNIX" + ", ifindex=" IFINDEX_LO_STR "}" + ", {{nla_len=%u, nla_type=MDBA_MDB}" + ", {{nla_len=%u, nla_type=MDBA_MDB_ENTRY}", + msg_len, msg_len - NLMSG_SPACE(hdrlen), + msg_len - NLMSG_SPACE(hdrlen) - NLA_HDRLEN); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 4 +# ifdef HAVE_STRUCT_BR_MDB_ENTRY + - 4 + NLA_HDRLEN * 2 + sizeof(struct nlattr) + + sizeof(struct br_mdb_entry) +# endif + ); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* MDBA_MDB_ENTRY_??? */", nla_type); + TEST_NLATTR_(fd, nlh0 - NLA_HDRLEN * 2, hdrlen + NLA_HDRLEN * 2, + init_br_port_msg, print_br_port_msg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4); + printf("}}")); + +# ifdef HAVE_STRUCT_BR_MDB_ENTRY + struct br_mdb_entry entry = { + .ifindex = ifindex_lo(), + .state = MDB_TEMPORARY, +# ifdef HAVE_STRUCT_BR_MDB_ENTRY_FLAGS + .flags = MDB_FLAGS_OFFLOAD, +# endif +# ifdef HAVE_STRUCT_BR_MDB_ENTRY_VID + .vid = 0xcdef, +# endif + .addr = { + .proto = htons(AF_UNSPEC) + } + }; + + memcpy(&entry.addr.u, pattern, sizeof(entry.addr.u)); + TEST_NESTED_NLATTR_OBJECT_EX(fd, nlh0, hdrlen, + init_br_port_msg, print_br_port_msg, + MDBA_MDB_ENTRY_INFO, pattern, entry, 2, + printf("{ifindex=" IFINDEX_LO_STR); + printf(", state=MDB_TEMPORARY"); +# ifdef HAVE_STRUCT_BR_MDB_ENTRY_FLAGS + printf(", flags=MDB_FLAGS_OFFLOAD"); +# endif +# ifdef HAVE_STRUCT_BR_MDB_ENTRY_VID + PRINT_FIELD_U(", ", entry, vid); +# endif + printf(", addr={u="); + print_quoted_hex(&entry.addr.u, + sizeof(entry.addr.u)); + printf(", proto=htons(AF_UNSPEC)}}")); + + static const struct nlattr nla = { + .nla_len = sizeof(nla), + .nla_type = MDBA_MDB_EATTR_TIMER + }; + char buf[NLMSG_ALIGN(sizeof(entry)) + sizeof(nla)]; + memcpy(buf, &entry, sizeof(entry)); + memcpy(buf + NLMSG_ALIGN(sizeof(entry)), &nla, sizeof(nla)); + TEST_NLATTR(fd, nlh0 - NLA_HDRLEN * 2, hdrlen + NLA_HDRLEN * 2, + init_br_port_msg, print_br_port_msg, + MDBA_MDB_ENTRY_INFO, sizeof(buf), buf, sizeof(buf), + printf("{ifindex=" IFINDEX_LO_STR); + printf(", state=MDB_TEMPORARY"); +# ifdef HAVE_STRUCT_BR_MDB_ENTRY_FLAGS + printf(", flags=MDB_FLAGS_OFFLOAD"); +# endif +# ifdef HAVE_STRUCT_BR_MDB_ENTRY_VID + PRINT_FIELD_U(", ", entry, vid); +# endif + printf(", addr={u="); + print_quoted_hex(&entry.addr.u, sizeof(entry.addr.u)); + printf(", proto=htons(AF_UNSPEC)}}" + ", {nla_len=%u, nla_type=MDBA_MDB_EATTR_TIMER}}}", + nla.nla_len)); +# endif /* HAVE_STRUCT_BR_MDB_ENTRY */ + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_BR_PORT_MSG") + +#endif diff --git a/tests/nlattr_mdba_mdb_entry.gen.test b/tests/nlattr_mdba_mdb_entry.gen.test new file mode 100755 index 00000000..8d09a033 --- /dev/null +++ b/tests/nlattr_mdba_mdb_entry.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_mdba_mdb_entry +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_mdba_router_port.c b/tests/nlattr_mdba_router_port.c new file mode 100644 index 00000000..7ec9992a --- /dev/null +++ b/tests/nlattr_mdba_router_port.c @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_BR_PORT_MSG + +# include +# include "test_nlattr.h" +# include +# include + +# ifndef MDBA_ROUTER +# define MDBA_ROUTER 2 +# endif +# ifndef MDBA_ROUTER_PORT +# define MDBA_ROUTER_PORT 1 +# endif +# ifndef MDBA_ROUTER_PATTR_TYPE +# define MDBA_ROUTER_PATTR_TYPE 2 +# endif +# ifndef MDB_RTR_TYPE_DISABLED +# define MDB_RTR_TYPE_DISABLED 0 +# endif + +const unsigned int hdrlen = sizeof(struct br_port_msg); + +static void +init_br_port_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETMDB, + .nlmsg_flags = NLM_F_DUMP + ); + + struct br_port_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct br_port_msg, msg, + .family = AF_UNIX, + .ifindex = ifindex_lo() + ); + + struct nlattr *nla = NLMSG_ATTR(nlh, sizeof(*msg)); + SET_STRUCT(struct nlattr, nla, + .nla_len = msg_len - NLMSG_SPACE(hdrlen), + .nla_type = MDBA_ROUTER + ); +} + +static void +print_br_port_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETMDB, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {family=AF_UNIX" + ", ifindex=" IFINDEX_LO_STR "}" + ", {{nla_len=%u, nla_type=MDBA_ROUTER}", + msg_len, msg_len - NLMSG_SPACE(hdrlen)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const uint32_t ifindex = ifindex_lo(); + const uint8_t type = MDB_RTR_TYPE_DISABLED; + static const struct nlattr nla = { + .nla_len = NLA_HDRLEN + sizeof(type), + .nla_type = MDBA_ROUTER_PATTR_TYPE + }; + char buf[NLMSG_ALIGN(ifindex) + NLA_HDRLEN + sizeof(type)]; + + const int fd = create_nl_socket(NETLINK_ROUTE); + + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(buf)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_br_port_msg, print_br_port_msg, + MDBA_ROUTER_PORT, pattern, ifindex, + printf(IFINDEX_LO_STR)); + + memcpy(buf, &ifindex, sizeof(ifindex)); + memcpy(buf + NLMSG_ALIGN(ifindex), &nla, sizeof(nla)); + memcpy(buf + NLMSG_ALIGN(ifindex) + NLA_HDRLEN, &type, sizeof(type)); + TEST_NLATTR(fd, nlh0 - NLA_HDRLEN, hdrlen + NLA_HDRLEN, + init_br_port_msg, print_br_port_msg, + MDBA_ROUTER_PORT, sizeof(buf), buf, sizeof(buf), + printf(IFINDEX_LO_STR + ", {{nla_len=%u, nla_type=MDBA_ROUTER_PATTR_TYPE}" + ", MDB_RTR_TYPE_DISABLED}}", + nla.nla_len)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_BR_PORT_MSG") + +#endif diff --git a/tests/nlattr_mdba_router_port.gen.test b/tests/nlattr_mdba_router_port.gen.test new file mode 100755 index 00000000..97230e84 --- /dev/null +++ b/tests/nlattr_mdba_router_port.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_mdba_router_port +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_ndmsg.c b/tests/nlattr_ndmsg.c new file mode 100644 index 00000000..2dd82ce4 --- /dev/null +++ b/tests/nlattr_ndmsg.c @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include "test_nlattr.h" +#ifdef HAVE_LINUX_NEIGHBOUR_H +# include +#endif +#include + +#define NDA_PORT 6 + +static void +init_ndmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETNEIGH, + .nlmsg_flags = NLM_F_DUMP + ); + + struct ndmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct ndmsg, msg, + .ndm_family = AF_UNIX, + .ndm_ifindex = ifindex_lo(), + .ndm_state = NUD_PERMANENT, + .ndm_flags = NTF_PROXY, + .ndm_type = RTN_UNSPEC + ); +} + +static void +print_ndmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETNEIGH, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {ndm_family=AF_UNIX" + ", ndm_ifindex=" IFINDEX_LO_STR + ", ndm_state=NUD_PERMANENT" + ", ndm_flags=NTF_PROXY" + ", ndm_type=RTN_UNSPEC}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct ndmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(struct nda_cacheinfo)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* NDA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_ndmsg, print_ndmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_ndmsg, print_ndmsg, + NDA_DST, 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + static const struct nda_cacheinfo ci = { + .ndm_confirmed = 0xabcdedad, + .ndm_used = 0xbcdaedad, + .ndm_updated = 0xcdbadeda, + .ndm_refcnt = 0xdeadbeda + }; + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ndmsg, print_ndmsg, + NDA_CACHEINFO, pattern, ci, + PRINT_FIELD_U("{", ci, ndm_confirmed); + PRINT_FIELD_U(", ", ci, ndm_used); + PRINT_FIELD_U(", ", ci, ndm_updated); + PRINT_FIELD_U(", ", ci, ndm_refcnt); + printf("}")); + + const uint16_t port = 0xabcd; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ndmsg, print_ndmsg, + NDA_PORT, pattern, port, + printf("htons(%u)", ntohs(port))); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/nlattr_ndmsg.gen.test b/tests/nlattr_ndmsg.gen.test new file mode 100755 index 00000000..1d2763b0 --- /dev/null +++ b/tests/nlattr_ndmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ndmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_ndtmsg.c b/tests/nlattr_ndtmsg.c new file mode 100644 index 00000000..c41ff40c --- /dev/null +++ b/tests/nlattr_ndtmsg.c @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include "test_nlattr.h" +#ifdef HAVE_LINUX_NEIGHBOUR_H +# include +#endif +#include + +#define NDTA_PARMS 6 +#define NDTPA_IFINDEX 1 + +static void +init_ndtmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETNEIGHTBL, + .nlmsg_flags = NLM_F_DUMP + ); + + struct ndtmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct ndtmsg, msg, + .ndtm_family = AF_NETLINK + ); +} + +static void +print_ndtmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETNEIGHTBL, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {ndtm_family=AF_NETLINK}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct ndtmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 11 * 8); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* NDTA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_ndtmsg, print_ndtmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + +#ifdef HAVE_STRUCT_NDT_CONFIG + static const struct ndt_config ndtc = { + .ndtc_key_len = 0xabcd, + .ndtc_entry_size = 0xbcda, + .ndtc_entries = 0xcdabedad, + .ndtc_last_flush = 0xdebaedba, + .ndtc_last_rand = 0xedadedab, + .ndtc_hash_rnd = 0xfeadedaf, + .ndtc_hash_mask = 0xadbcdead, + .ndtc_hash_chain_gc = 0xbdaedacd, + .ndtc_proxy_qlen = 0xcdeaedab + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ndtmsg, print_ndtmsg, + NDTA_CONFIG, pattern, ndtc, + PRINT_FIELD_U("{", ndtc, ndtc_key_len); + PRINT_FIELD_U(", ", ndtc, ndtc_entry_size); + PRINT_FIELD_U(", ", ndtc, ndtc_entries); + PRINT_FIELD_U(", ", ndtc, ndtc_last_flush); + PRINT_FIELD_U(", ", ndtc, ndtc_last_rand); + PRINT_FIELD_U(", ", ndtc, ndtc_hash_rnd); + PRINT_FIELD_0X(", ", ndtc, ndtc_hash_mask); + PRINT_FIELD_U(", ", ndtc, ndtc_hash_chain_gc); + PRINT_FIELD_U(", ", ndtc, ndtc_proxy_qlen); + printf("}")); +#endif /* HAVE_STRUCT_NDT_CONFIG */ + + static const struct nlattr nla = { + .nla_len = sizeof(nla), + .nla_type = NDTPA_IFINDEX + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ndtmsg, print_ndtmsg, + NDTA_PARMS, pattern, nla, + PRINT_FIELD_U("{", nla, nla_len); + printf(", nla_type=NDTPA_IFINDEX}")); + +#ifdef HAVE_STRUCT_NDT_STATS + static const struct ndt_stats ndtst = { + .ndts_allocs = 0xabcdedabedadedfa, + .ndts_destroys = 0xbcdefabefacdbaad, + .ndts_hash_grows = 0xcdbadefacdcbaede, + .ndts_res_failed = 0xdedbaecfdbcadcfe, + .ndts_lookups = 0xedfafdedbdadedec, + .ndts_hits = 0xfebdeadebcddeade, + .ndts_rcv_probes_mcast = 0xadebfeadecddeafe, + .ndts_rcv_probes_ucast = 0xbcdefeacdadecdfe, + .ndts_periodic_gc_runs = 0xedffeadedeffbecc, + .ndts_forced_gc_runs = 0xfeefefeabedeedcd, +# ifdef HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS + .ndts_table_fulls = 0xadebfefaecdfeade +# endif /* HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS */ + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_ndtmsg, print_ndtmsg, + NDTA_STATS, pattern, ndtst, + PRINT_FIELD_U("{", ndtst, ndts_allocs); + PRINT_FIELD_U(", ", ndtst, ndts_destroys); + PRINT_FIELD_U(", ", ndtst, ndts_hash_grows); + PRINT_FIELD_U(", ", ndtst, ndts_res_failed); + PRINT_FIELD_U(", ", ndtst, ndts_lookups); + PRINT_FIELD_U(", ", ndtst, ndts_hits); + PRINT_FIELD_U(", ", ndtst, ndts_rcv_probes_mcast); + PRINT_FIELD_U(", ", ndtst, ndts_rcv_probes_ucast); + PRINT_FIELD_U(", ", ndtst, ndts_periodic_gc_runs); + PRINT_FIELD_U(", ", ndtst, ndts_forced_gc_runs); +# ifdef HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS + PRINT_FIELD_U(", ", ndtst, ndts_table_fulls); +# endif /* HAVE_STRUCT_NDT_STATS_NDTS_TABLE_FULLS */ + printf("}")); +#endif /* HAVE_STRUCT_NDT_STATS */ + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/nlattr_ndtmsg.gen.test b/tests/nlattr_ndtmsg.gen.test new file mode 100755 index 00000000..bf7d122a --- /dev/null +++ b/tests/nlattr_ndtmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_ndtmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_netconfmsg.c b/tests/nlattr_netconfmsg.c new file mode 100644 index 00000000..52ded742 --- /dev/null +++ b/tests/nlattr_netconfmsg.c @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_NETCONFMSG + +# include +# include "test_nlattr.h" +# include +# include + +static void +init_netconfmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETNETCONF, + .nlmsg_flags = NLM_F_DUMP + ); + + struct netconfmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct netconfmsg, msg, + .ncm_family = AF_INET + ); +} + +static void +print_netconfmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETNETCONF, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {ncm_family=AF_INET}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + + const unsigned int hdrlen = sizeof(struct netconfmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 4); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* NETCONFA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_netconfmsg, print_netconfmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_NETCONFMSG") + +#endif diff --git a/tests/nlattr_netconfmsg.gen.test b/tests/nlattr_netconfmsg.gen.test new file mode 100755 index 00000000..27f3a66b --- /dev/null +++ b/tests/nlattr_netconfmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_netconfmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_netlink_diag_msg.c b/tests/nlattr_netlink_diag_msg.c new file mode 100644 index 00000000..b5d71a68 --- /dev/null +++ b/tests/nlattr_netlink_diag_msg.c @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include "test_nlattr.h" +#include +#include + +static void +init_netlink_diag_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP + ); + + struct netlink_diag_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct netlink_diag_msg, msg, + .ndiag_family = AF_NETLINK, + .ndiag_type = SOCK_RAW, + .ndiag_protocol = NETLINK_ROUTE, + .ndiag_state = NETLINK_CONNECTED + ); +} + +static void +print_netlink_diag_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {ndiag_family=AF_NETLINK" + ", ndiag_type=SOCK_RAW, ndiag_protocol=NETLINK_ROUTE" + ", ndiag_state=NETLINK_CONNECTED, ndiag_portid=0" + ", ndiag_dst_portid=0, ndiag_dst_group=0, ndiag_ino=0" + ", ndiag_cookie=[0, 0]}", + msg_len); +} + +static void +print_xlong(const unsigned long *p, size_t i) +{ + printf("%#lx", *p); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + static const unsigned long groups[] = { + (unsigned long) 0xdeadbeefbadc0dedULL, + (unsigned long) 0xdeadbeefbadc0dedULL + }; + static const struct netlink_diag_ring ndr = { + .ndr_block_size = 0xfabfabdc, + .ndr_block_nr = 0xabcdabda, + .ndr_frame_size = 0xcbadbafa, + .ndr_frame_nr = 0xdbcafadb + }; + static const uint32_t flags = + NDIAG_FLAG_CB_RUNNING | NDIAG_FLAG_PKTINFO; + + const int fd = create_nl_socket(NETLINK_SOCK_DIAG); + const unsigned int hdrlen = sizeof(struct netlink_diag_msg); + void *const nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + + MAX(sizeof(groups), sizeof(ndr))); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NLATTR_ARRAY(fd, nlh0, hdrlen, + init_netlink_diag_msg, print_netlink_diag_msg, + NETLINK_DIAG_GROUPS, pattern, groups, print_xlong); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_netlink_diag_msg, print_netlink_diag_msg, + NETLINK_DIAG_RX_RING, pattern, ndr, + PRINT_FIELD_U("{", ndr, ndr_block_size); + PRINT_FIELD_U(", ", ndr, ndr_block_nr); + PRINT_FIELD_U(", ", ndr, ndr_frame_size); + PRINT_FIELD_U(", ", ndr, ndr_frame_nr); + printf("}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_netlink_diag_msg, print_netlink_diag_msg, + NETLINK_DIAG_FLAGS, pattern, flags, + printf("NDIAG_FLAG_CB_RUNNING|NDIAG_FLAG_PKTINFO")); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/nlattr_netlink_diag_msg.gen.test b/tests/nlattr_netlink_diag_msg.gen.test new file mode 100755 index 00000000..eacc6df4 --- /dev/null +++ b/tests/nlattr_netlink_diag_msg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_netlink_diag_msg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_nlmsgerr.c b/tests/nlattr_nlmsgerr.c new file mode 100644 index 00000000..75be9e75 --- /dev/null +++ b/tests/nlattr_nlmsgerr.c @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include "test_nlattr.h" + +#define NLMSGERR_ATTR_COOKIE 3 + +static void +init_nlmsgerr(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = NLMSG_ERROR, + .nlmsg_flags = NLM_F_REQUEST | NLM_F_CAPPED + ); + + struct nlmsgerr *const err = NLMSG_DATA(nlh); + SET_STRUCT(struct nlmsgerr, err, + .error = -13, + .msg = { + .nlmsg_len = NLMSG_HDRLEN + 4, + .nlmsg_type = NLMSG_NOOP, + .nlmsg_flags = NLM_F_REQUEST, + } + ); +} + +static void +print_nlmsgerr(const unsigned int msg_len) +{ + printf("{len=%u, type=NLMSG_ERROR" + ", flags=NLM_F_REQUEST|NLM_F_CAPPED" + ", seq=0, pid=0}, {error=-EACCES" + ", msg={len=%u, type=NLMSG_NOOP" + ", flags=NLM_F_REQUEST, seq=0, pid=0}", + msg_len, NLMSG_HDRLEN + 4); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + static const uint8_t cookie[] = { 0xab, 0xfe }; + + const int fd = create_nl_socket(NETLINK_SOCK_DIAG); + const unsigned int hdrlen = sizeof(struct nlmsgerr); + void *const nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(cookie)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_nlmsgerr, print_nlmsgerr, + NLMSGERR_ATTR_COOKIE, + sizeof(cookie), cookie, sizeof(cookie), + printf("[%u, %u]", cookie[0], cookie[1]); + printf("}")); + + printf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests/nlattr_nlmsgerr.gen.test b/tests/nlattr_nlmsgerr.gen.test new file mode 100755 index 00000000..f06ea429 --- /dev/null +++ b/tests/nlattr_nlmsgerr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_nlmsgerr +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_packet_diag_msg.c b/tests/nlattr_packet_diag_msg.c new file mode 100644 index 00000000..0d74a2f3 --- /dev/null +++ b/tests/nlattr_packet_diag_msg.c @@ -0,0 +1,158 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include "test_nlattr.h" +#include +#include +#include +#include +#include + +static void +init_packet_diag_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP + ); + + struct packet_diag_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct packet_diag_msg, msg, + .pdiag_family = AF_PACKET, + .pdiag_type = SOCK_STREAM, + .pdiag_num = 3, + ); +} + +static void +print_packet_diag_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}" + ", {pdiag_family=AF_PACKET" + ", pdiag_type=SOCK_STREAM, pdiag_num=ETH_P_ALL" + ", pdiag_ino=0, pdiag_cookie=[0, 0]}", + msg_len); +} + +static void +print_packet_diag_mclist(const struct packet_diag_mclist *const dml, size_t i) +{ + printf("{pdmc_index=" IFINDEX_LO_STR); + PRINT_FIELD_U(", ", *dml, pdmc_count); + PRINT_FIELD_U(", ", *dml, pdmc_type); + PRINT_FIELD_U(", ", *dml, pdmc_alen); + printf(", pdmc_addr="); + print_quoted_hex(dml->pdmc_addr, dml->pdmc_alen); + printf("}"); +} + +static const struct sock_filter filter[] = { + BPF_STMT(BPF_LD|BPF_B|BPF_ABS, SKF_AD_OFF+SKF_AD_PKTTYPE), + BPF_STMT(BPF_RET|BPF_K, 0x2a) +}; + +static void +print_sock_filter(const struct sock_filter *const f, size_t i) +{ + if (f == filter) + printf("BPF_STMT(BPF_LD|BPF_B|BPF_ABS" + ", SKF_AD_OFF+SKF_AD_PKTTYPE)"); + else + printf("BPF_STMT(BPF_RET|BPF_K, 0x2a)"); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + struct packet_diag_info pinfo = { + .pdi_index = ifindex_lo(), + .pdi_version = 2, + .pdi_reserve = 0xcfaacdaf, + .pdi_copy_thresh = 0xdabacdaf, + .pdi_tstamp = 0xeafbaadf, + .pdi_flags = PDI_RUNNING + }; + const struct packet_diag_mclist dml[] = { + { + .pdmc_index = ifindex_lo(), + .pdmc_count = 0xabcdaefc, + .pdmc_type = 0xcdaf, + .pdmc_alen = 4, + .pdmc_addr = "1234" + }, + { + .pdmc_index = ifindex_lo(), + .pdmc_count = 0xdaefeafc, + .pdmc_type = 0xadef, + .pdmc_alen = 4, + .pdmc_addr = "5678" + } + }; + static const struct packet_diag_ring pdr = { + .pdr_block_size = 0xabcdafed, + .pdr_block_nr = 0xbcadefae, + .pdr_frame_size = 0xcabdfeac, + .pdr_frame_nr = 0xdeaeadef, + .pdr_retire_tmo = 0xedbafeac, + .pdr_sizeof_priv = 0xfeadeacd, + .pdr_features = 0xadebadea + }; + + int fd = create_nl_socket(NETLINK_SOCK_DIAG); + const unsigned int hdrlen = sizeof(struct packet_diag_msg); + void *const nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(dml)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_packet_diag_msg, print_packet_diag_msg, + PACKET_DIAG_INFO, pattern, pinfo, + printf("{pdi_index=%s", IFINDEX_LO_STR); + printf(", pdi_version=TPACKET_V3"); + PRINT_FIELD_U(", ", pinfo, pdi_reserve); + PRINT_FIELD_U(", ", pinfo, pdi_copy_thresh); + PRINT_FIELD_U(", ", pinfo, pdi_tstamp); + printf(", pdi_flags=PDI_RUNNING}")); + + TEST_NLATTR_ARRAY(fd, nlh0, hdrlen, + init_packet_diag_msg, print_packet_diag_msg, + PACKET_DIAG_MCLIST, pattern, dml, + print_packet_diag_mclist); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_packet_diag_msg, print_packet_diag_msg, + PACKET_DIAG_RX_RING, pattern, pdr, + PRINT_FIELD_U("{", pdr, pdr_block_size); + PRINT_FIELD_U(", ", pdr, pdr_block_nr); + PRINT_FIELD_U(", ", pdr, pdr_frame_size); + PRINT_FIELD_U(", ", pdr, pdr_frame_nr); + PRINT_FIELD_U(", ", pdr, pdr_retire_tmo); + PRINT_FIELD_U(", ", pdr, pdr_sizeof_priv); + PRINT_FIELD_U(", ", pdr, pdr_features); + printf("}")); + + TEST_NLATTR_ARRAY(fd, nlh0, hdrlen, + init_packet_diag_msg, print_packet_diag_msg, + PACKET_DIAG_FILTER, pattern, filter, + print_sock_filter); + + printf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests/nlattr_packet_diag_msg.gen.test b/tests/nlattr_packet_diag_msg.gen.test new file mode 100755 index 00000000..7177ea2a --- /dev/null +++ b/tests/nlattr_packet_diag_msg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_packet_diag_msg +netlink_sock_diag-v.sh ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag-v.sh" diff --git a/tests/nlattr_rtgenmsg.c b/tests/nlattr_rtgenmsg.c new file mode 100644 index 00000000..c17ab048 --- /dev/null +++ b/tests/nlattr_rtgenmsg.c @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include "netlink.h" +#include + +#ifdef RTM_GETNSID + +# include "test_nlattr.h" + +static void +init_rtgenmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETNSID, + .nlmsg_flags = NLM_F_DUMP + ); + + struct rtgenmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct rtgenmsg, msg, + .rtgen_family = AF_UNIX + ); +} + +static void +print_rtgenmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETNSID, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {rtgen_family=AF_UNIX}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct rtgenmsg); + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(nla_type_str)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + sprintf(nla_type_str, "%#x /* NETNSA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_rtgenmsg, print_rtgenmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("RTM_GETNSID") + +#endif diff --git a/tests/nlattr_rtgenmsg.gen.test b/tests/nlattr_rtgenmsg.gen.test new file mode 100755 index 00000000..37ec8425 --- /dev/null +++ b/tests/nlattr_rtgenmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_rtgenmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_rtmsg.c b/tests/nlattr_rtmsg.c new file mode 100644 index 00000000..f4efa4c0 --- /dev/null +++ b/tests/nlattr_rtmsg.c @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include "test_nlattr.h" +#include +#include + +#define RTA_ENCAP_TYPE 21 +#define LWTUNNEL_ENCAP_NONE 0 + +static void +init_rtmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETROUTE, + .nlmsg_flags = NLM_F_DUMP + ); + + struct rtmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct rtmsg, msg, + .rtm_family = AF_UNIX, + .rtm_tos = IPTOS_LOWDELAY, + .rtm_table = RT_TABLE_DEFAULT, + .rtm_protocol = RTPROT_KERNEL, + .rtm_scope = RT_SCOPE_UNIVERSE, + .rtm_type = RTN_LOCAL, + .rtm_flags = RTM_F_NOTIFY + ); +} + +static void +print_rtmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETROUTE, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {rtm_family=AF_UNIX" + ", rtm_dst_len=0, rtm_src_len=0" + ", rtm_tos=IPTOS_LOWDELAY" + ", rtm_table=RT_TABLE_DEFAULT" + ", rtm_protocol=RTPROT_KERNEL" + ", rtm_scope=RT_SCOPE_UNIVERSE" + ", rtm_type=RTN_LOCAL" + ", rtm_flags=RTM_F_NOTIFY}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct rtmsg); + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(nla_type_str)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + sprintf(nla_type_str, "%#x /* RTA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_DST, 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + const uint32_t ifindex = ifindex_lo(); + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_OIF, pattern, ifindex, + printf(IFINDEX_LO_STR)); + + const uint32_t rt_class_id = RT_TABLE_DEFAULT; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_TABLE, pattern, rt_class_id, + printf("RT_TABLE_DEFAULT")); + + struct nlattr nla = { + .nla_type = RTAX_LOCK, + .nla_len = sizeof(nla) + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_METRICS, pattern, nla, + printf("{nla_len=%u, nla_type=RTAX_LOCK}", + nla.nla_len)); + struct rtnexthop nh = { + .rtnh_len = sizeof(nh) - 1, + .rtnh_flags = RTNH_F_DEAD, + .rtnh_hops = 0xab, + .rtnh_ifindex = ifindex_lo() + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_MULTIPATH, pattern, nh, + printf("{rtnh_len=%u, rtnh_flags=RTNH_F_DEAD" + ", rtnh_hops=%u" + ", rtnh_ifindex=" IFINDEX_LO_STR "}", + nh.rtnh_len, nh.rtnh_hops)); + + char buf[RTNH_ALIGN(sizeof(nh)) + sizeof(nla)]; + nh.rtnh_len = sizeof(buf); + nla.nla_type = RTA_DST; + memcpy(buf, &nh, sizeof(nh)); + memcpy(buf + RTNH_ALIGN(sizeof(nh)), &nla, sizeof(nla)); + TEST_NLATTR(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_MULTIPATH, sizeof(buf), buf, sizeof(buf), + printf("{rtnh_len=%u, rtnh_flags=RTNH_F_DEAD" + ", rtnh_hops=%u, rtnh_ifindex=" IFINDEX_LO_STR "}" + ", {nla_len=%u, nla_type=RTA_DST}", + nh.rtnh_len, nh.rtnh_hops, nla.nla_len)); + + static const struct rta_cacheinfo ci = { + .rta_clntref = 0xabcdefab, + .rta_lastuse = 0xbdadaedc, + .rta_expires = 0xcdadebad, + .rta_error = 0xdaedadeb, + .rta_used = 0xedfabdad, + .rta_id = 0xfeadbcda, + .rta_ts = 0xacdbaded, + .rta_tsage = 0xbadeadef + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_CACHEINFO, pattern, ci, + PRINT_FIELD_U("{", ci, rta_clntref); + PRINT_FIELD_U(", ", ci, rta_lastuse); + PRINT_FIELD_U(", ", ci, rta_expires); + PRINT_FIELD_U(", ", ci, rta_error); + PRINT_FIELD_U(", ", ci, rta_used); + PRINT_FIELD_X(", ", ci, rta_id); + PRINT_FIELD_U(", ", ci, rta_ts); + PRINT_FIELD_U(", ", ci, rta_tsage); + printf("}")); + +#ifdef HAVE_STRUCT_RTA_MFC_STATS + static const struct rta_mfc_stats mfcs = { + .mfcs_packets = 0xadcdedfdadefadcd, + .mfcs_bytes = 0xbaedadedcdedadbd, + .mfcs_wrong_if = 0xcddeabeedaedabfa + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_MFC_STATS, pattern, mfcs, + PRINT_FIELD_U("{", mfcs, mfcs_packets); + PRINT_FIELD_U(", ", mfcs, mfcs_bytes); + PRINT_FIELD_U(", ", mfcs, mfcs_wrong_if); + printf("}")); +#endif + +#ifdef HAVE_STRUCT_RTVIA + static const struct rtvia via = { + .rtvia_family = AF_INET + }; + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_VIA, pattern, via, + printf("{rtvia_family=AF_INET}")); + + static const char address4[] = "12.34.56.78"; + struct in_addr a4 = { + .s_addr = inet_addr(address4) + }; + char rtviabuf[sizeof(via) + sizeof(a4)]; + memcpy(rtviabuf, &via, sizeof(via)); + memcpy(rtviabuf + sizeof(via), &a4, sizeof(a4)); + + TEST_NLATTR(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_VIA, sizeof(rtviabuf), rtviabuf, sizeof(rtviabuf), + printf("{rtvia_family=AF_INET" + ", rtvia_addr=inet_addr(\"%s\")}", address4)); +#endif + + const uint16_t encap_type = LWTUNNEL_ENCAP_NONE; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_rtmsg, print_rtmsg, + RTA_ENCAP_TYPE, pattern, encap_type, + printf("LWTUNNEL_ENCAP_NONE")); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/nlattr_rtmsg.gen.test b/tests/nlattr_rtmsg.gen.test new file mode 100755 index 00000000..f075529a --- /dev/null +++ b/tests/nlattr_rtmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_rtmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_smc_diag_msg.c b/tests/nlattr_smc_diag_msg.c new file mode 100644 index 00000000..3f47a515 --- /dev/null +++ b/tests/nlattr_smc_diag_msg.c @@ -0,0 +1,231 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifndef AF_SMC +# define AF_SMC 43 +#endif + +#include +#include +#include +#include +#include "test_nlattr.h" +#include +#include +#include + +#ifndef SMC_CLNT +# define SMC_CLNT 0 +#endif +#ifndef SMC_ACTIVE +# define SMC_ACTIVE 1 +#endif + +static const char address[] = "12.34.56.78"; + +static void +init_smc_diag_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP + ); + + struct smc_diag_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct smc_diag_msg, msg, + .diag_family = AF_SMC, + .diag_state = SMC_ACTIVE + ); + + if (!inet_pton(AF_INET, address, msg->id.idiag_src) || + !inet_pton(AF_INET, address, msg->id.idiag_dst)) + perror_msg_and_skip("inet_pton"); +} + +static void +print_smc_diag_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}" + ", {diag_family=AF_SMC, diag_state=SMC_ACTIVE" + ", diag_fallback=SMC_DIAG_MODE_SMCR, diag_shutdown=0" + ", id={idiag_sport=htons(0), idiag_dport=htons(0)" + ", idiag_src=inet_addr(\"%s\")" + ", idiag_dst=inet_addr(\"%s\")" + ", idiag_if=0, idiag_cookie=[0, 0]}" + ", diag_uid=0, diag_inode=0}", + msg_len, address, address); +} + +#define PRINT_FIELD_SMC_DIAG_CURSOR(prefix_, where_, field_) \ + do { \ + printf("%s%s=", (prefix_), #field_); \ + PRINT_FIELD_U("{", (where_).field_, reserved); \ + PRINT_FIELD_U(", ", (where_).field_, wrap); \ + PRINT_FIELD_U(", ", (where_).field_, count); \ + printf("}"); \ + } while (0) + +int main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + static const struct smc_diag_conninfo cinfo = { + .token = 0xabcdefac, + .sndbuf_size = 0xbcdaefad, + .rmbe_size = 0xcdbaefab, + .peer_rmbe_size = 0xdbcdedaf, + .rx_prod = { + .reserved = 0xabc1, + .wrap = 0xbca1, + .count = 0xcdedbad1 + }, + .rx_cons = { + .reserved = 0xabc2, + .wrap = 0xbca2, + .count = 0xcdedbad2 + }, + .tx_prod = { + .reserved = 0xabc3, + .wrap = 0xbca3, + .count = 0xcdedbad3 + }, + .tx_cons = { + .reserved = 0xabc4, + .wrap = 0xbca4, + .count = 0xcdedbad4 + }, + .rx_prod_flags = 0xff, + .rx_conn_state_flags = 0xff, + .tx_prod_flags = 0xff, + .tx_conn_state_flags = 0xff, + .tx_prep = { + .reserved = 0xabc5, + .wrap = 0xbca5, + .count = 0xcdedbad5 + }, + .tx_sent = { + .reserved = 0xabc6, + .wrap = 0xbca6, + .count = 0xcdedbad6 + }, + .tx_fin = { + .reserved = 0xabc7, + .wrap = 0xbca7, + .count = 0xcdedbad7 + } + }; + static const struct smc_diag_lgrinfo linfo = { + .lnk[0] = { + .link_id = 0xaf, + .ibport = 0xfa, + .ibname = "123", + .gid = "456", + .peer_gid = "789" + }, + .role = SMC_CLNT + }; + static const struct smcd_diag_dmbinfo dinfo = { + .linkid = 0xdeadc0de, + .peer_gid = 0xbefeededbadc0dedULL, + .my_gid = 0xdeec0dedfacebeefULL, + .token = 0xcafedecaffeedeedULL, + .peer_token = 0xfeedfacebeeff00dULL, + }; + static const struct smc_diag_fallback fb1 = { + .reason = 0, + .peer_diagnosis = 0x03020000, + }; + static const struct smc_diag_fallback fb2 = { + .reason = 0x03060000, + .peer_diagnosis = 0x99999999, + }; + static uint8_t sd1 = 0x23; + static uint8_t sd2 = 0x40; + + int fd = create_nl_socket(NETLINK_SOCK_DIAG); + const unsigned int hdrlen = sizeof(struct smc_diag_msg); + void *const nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + + MAX(sizeof(cinfo), sizeof(linfo))); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_smc_diag_msg, print_smc_diag_msg, + SMC_DIAG_SHUTDOWN, pattern, sd1, + printf("RCV_SHUTDOWN|SEND_SHUTDOWN|0x20")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_smc_diag_msg, print_smc_diag_msg, + SMC_DIAG_SHUTDOWN, pattern, sd2, + printf("0x40 /* ???_SHUTDOWN */")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_smc_diag_msg, print_smc_diag_msg, + SMC_DIAG_CONNINFO, pattern, cinfo, + PRINT_FIELD_U("{", cinfo, token); + PRINT_FIELD_U(", ", cinfo, sndbuf_size); + PRINT_FIELD_U(", ", cinfo, rmbe_size); + PRINT_FIELD_U(", ", cinfo, peer_rmbe_size); + PRINT_FIELD_SMC_DIAG_CURSOR(", ", cinfo, rx_prod); + PRINT_FIELD_SMC_DIAG_CURSOR(", ", cinfo, rx_cons); + PRINT_FIELD_SMC_DIAG_CURSOR(", ", cinfo, tx_prod); + PRINT_FIELD_SMC_DIAG_CURSOR(", ", cinfo, tx_cons); + printf(", rx_prod_flags=0xff"); + printf(", rx_conn_state_flags=0xff"); + printf(", tx_prod_flags=0xff"); + printf(", tx_conn_state_flags=0xff"); + PRINT_FIELD_SMC_DIAG_CURSOR(", ", cinfo, tx_prep); + PRINT_FIELD_SMC_DIAG_CURSOR(", ", cinfo, tx_sent); + PRINT_FIELD_SMC_DIAG_CURSOR(", ", cinfo, tx_fin); + printf("}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_smc_diag_msg, print_smc_diag_msg, + SMC_DIAG_LGRINFO, pattern, linfo, + PRINT_FIELD_U("{lnk[0]={", linfo.lnk[0], link_id); + printf(", ibname=\"%s\"", linfo.lnk[0].ibname); + PRINT_FIELD_U(", ", linfo.lnk[0], ibport); + printf(", gid=\"%s\"", linfo.lnk[0].gid); + printf(", peer_gid=\"%s\"}", linfo.lnk[0].peer_gid); + printf(", role=SMC_CLNT}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_smc_diag_msg, print_smc_diag_msg, + SMC_DIAG_DMBINFO, pattern, dinfo, + PRINT_FIELD_U("{", dinfo, linkid); + PRINT_FIELD_X(", ", dinfo, peer_gid); + PRINT_FIELD_X(", ", dinfo, my_gid); + PRINT_FIELD_X(", ", dinfo, token); + PRINT_FIELD_X(", ", dinfo, peer_token); + printf("}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_smc_diag_msg, print_smc_diag_msg, + SMC_DIAG_FALLBACK, pattern, fb1, + printf("{reason=0 /* SMC_CLC_DECL_??? */"); + printf(", peer_diagnosis=0x3020000" + " /* SMC_CLC_DECL_IPSEC */}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_smc_diag_msg, print_smc_diag_msg, + SMC_DIAG_FALLBACK, pattern, fb2, + printf("{reason=0x3060000" + " /* SMC_CLC_DECL_OPTUNSUPP */"); + printf(", peer_diagnosis=0x99999999" + " /* SMC_CLC_DECL_??? */}")); + + printf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests/nlattr_smc_diag_msg.gen.test b/tests/nlattr_smc_diag_msg.gen.test new file mode 100755 index 00000000..e64d21e2 --- /dev/null +++ b/tests/nlattr_smc_diag_msg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_smc_diag_msg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_tc_stats.c b/tests/nlattr_tc_stats.c new file mode 100644 index 00000000..c0ebaf89 --- /dev/null +++ b/tests/nlattr_tc_stats.c @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_GNET_STATS_BASIC + +# include +# include +# include "test_nlattr.h" +# include +# include + +const unsigned int hdrlen = sizeof(struct tcmsg); + +static void +init_tcmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETQDISC, + .nlmsg_flags = NLM_F_DUMP + ); + + struct tcmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct tcmsg, msg, + .tcm_family = AF_UNIX, + .tcm_ifindex = ifindex_lo() + ); + + struct nlattr *const nla = NLMSG_ATTR(nlh, sizeof(*msg)); + SET_STRUCT(struct nlattr, nla, + .nla_len = msg_len - NLMSG_SPACE(hdrlen), + .nla_type = TCA_STATS2 + ); +} + +static void +print_tcmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETQDISC, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {tcm_family=AF_UNIX" + ", tcm_ifindex=" IFINDEX_LO_STR + ", tcm_handle=0, tcm_parent=0, tcm_info=0}" + ", {{nla_len=%u, nla_type=TCA_STATS2}", + msg_len, msg_len - NLMSG_SPACE(hdrlen)); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 8 * 5); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + static const struct gnet_stats_basic sb = { + .bytes = 0xabcdebdafefeadeb, + .packets = 0xbdcdeabf + }; + char buf[offsetofend(struct gnet_stats_basic, packets)]; + memcpy(buf, &sb, sizeof(buf)); + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_STATS_BASIC, pattern, buf, + PRINT_FIELD_U("{", sb, bytes); + PRINT_FIELD_U(", ", sb, packets); + printf("}")); + +# ifdef HAVE_STRUCT_GNET_STATS_RATE_EST + static const struct gnet_stats_rate_est est = { + .bps = 0xebcdaebd, + .pps = 0xabdceade, + }; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_STATS_RATE_EST, pattern, est, + PRINT_FIELD_U("{", est, bps); + PRINT_FIELD_U(", ", est, pps); + printf("}")); +# endif + +# ifdef HAVE_STRUCT_GNET_STATS_QUEUE + static const struct gnet_stats_queue qstats = { + .qlen = 0xabcdeabd, + .backlog = 0xbcdaebad, + .drops = 0xcdbeaedb, + .requeues = 0xdebaefab, + .overlimits = 0xefaebade + }; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_STATS_QUEUE, pattern, qstats, + PRINT_FIELD_U("{", qstats, qlen); + PRINT_FIELD_U(", ", qstats, backlog); + PRINT_FIELD_U(", ", qstats, drops); + PRINT_FIELD_U(", ", qstats, requeues); + PRINT_FIELD_U(", ", qstats, overlimits); + printf("}")); +# endif + +# ifdef HAVE_STRUCT_GNET_STATS_RATE_EST64 + static const struct gnet_stats_rate_est64 est64 = { + .bps = 0xacbdcdefafecaebf, + .pps = 0xcdabeabdfeabceaf + }; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_STATS_RATE_EST64, pattern, est64, + PRINT_FIELD_U("{", est64, bps); + PRINT_FIELD_U(", ", est64, pps); + printf("}")); +# endif + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_STRUCT_GNET_STATS_BASIC") + +#endif diff --git a/tests/nlattr_tc_stats.gen.test b/tests/nlattr_tc_stats.gen.test new file mode 100755 index 00000000..11cadd2d --- /dev/null +++ b/tests/nlattr_tc_stats.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_tc_stats +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_tca_stab.c b/tests/nlattr_tca_stab.c new file mode 100644 index 00000000..d339dbc8 --- /dev/null +++ b/tests/nlattr_tca_stab.c @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include "test_nlattr.h" +#include +#include + +#ifndef TCA_STAB +# define TCA_STAB 8 +#endif +#if !HAVE_DECL_TCA_STAB_DATA +enum { TCA_STAB_DATA = 2 }; +#endif + +const unsigned int hdrlen = sizeof(struct tcmsg); + +static void +init_tcmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETQDISC, + .nlmsg_flags = NLM_F_DUMP + ); + + struct tcmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct tcmsg, msg, + .tcm_family = AF_UNIX, + .tcm_ifindex = ifindex_lo() + ); + + struct nlattr *const nla = NLMSG_ATTR(nlh, sizeof(*msg)); + SET_STRUCT(struct nlattr, nla, + .nla_len = msg_len - NLMSG_SPACE(hdrlen), + .nla_type = TCA_STAB + ); +} + +static void +print_tcmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETQDISC, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {tcm_family=AF_UNIX" + ", tcm_ifindex=" IFINDEX_LO_STR + ", tcm_handle=0, tcm_parent=0, tcm_info=0}" + ", {{nla_len=%u, nla_type=TCA_STAB}", + msg_len, msg_len - NLMSG_SPACE(hdrlen)); +} + +static void +print_uint16(const uint16_t *p, size_t idx) +{ + printf("%u", *p); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 4 +#ifdef HAVE_STRUCT_TC_SIZESPEC + - 4 + sizeof(struct tc_sizespec) +#endif + ); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + +#ifdef HAVE_STRUCT_TC_SIZESPEC + static const struct tc_sizespec s = { + .cell_log = 0xab, + .size_log = 0xcd, + .cell_align = 0xefab, + .overhead = 0xcdadeefa, + .linklayer = 0xefbaafeb, + .mpu = 0xfebfaefb, + .mtu = 0xacdbefab, + .tsize = 0xbdeaabed + }; + TEST_NESTED_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_STAB_BASE, pattern, s, + PRINT_FIELD_U("{", s, cell_log); + PRINT_FIELD_U(", ", s, size_log); + PRINT_FIELD_D(", ", s, cell_align); + PRINT_FIELD_D(", ", s, overhead); + PRINT_FIELD_U(", ", s, linklayer); + PRINT_FIELD_U(", ", s, mpu); + PRINT_FIELD_U(", ", s, mtu); + PRINT_FIELD_U(", ", s, tsize); + printf("}")); +#endif + + uint16_t data[2] = { 0xacbd, 0xefba }; + TEST_NESTED_NLATTR_ARRAY(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_STAB_DATA, pattern, data, print_uint16); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/nlattr_tca_stab.gen.test b/tests/nlattr_tca_stab.gen.test new file mode 100755 index 00000000..81d36c70 --- /dev/null +++ b/tests/nlattr_tca_stab.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_tca_stab +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_tcamsg.c b/tests/nlattr_tcamsg.c new file mode 100644 index 00000000..b8bd7e35 --- /dev/null +++ b/tests/nlattr_tcamsg.c @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include "test_nlattr.h" +#include + +static void +init_tcamsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETACTION, + .nlmsg_flags = NLM_F_DUMP + ); + + struct tcamsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct tcamsg, msg, + .tca_family = AF_INET + ); +} + +static void +print_tcamsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETACTION, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {tca_family=AF_INET}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct tcamsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), NLA_HDRLEN + 4); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* TCA_ACT_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_tcamsg, print_tcamsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/nlattr_tcamsg.gen.test b/tests/nlattr_tcamsg.gen.test new file mode 100755 index 00000000..1a6408d9 --- /dev/null +++ b/tests/nlattr_tcamsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_tcamsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_tcmsg.c b/tests/nlattr_tcmsg.c new file mode 100644 index 00000000..f76b2f87 --- /dev/null +++ b/tests/nlattr_tcmsg.c @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include "test_nlattr.h" +#include +#include + +static void +init_tcmsg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = RTM_GETQDISC, + .nlmsg_flags = NLM_F_DUMP + ); + + struct tcmsg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct tcmsg, msg, + .tcm_family = AF_UNIX, + .tcm_ifindex = ifindex_lo() + ); + +} + +static void +print_tcmsg(const unsigned int msg_len) +{ + printf("{len=%u, type=RTM_GETQDISC, flags=NLM_F_DUMP" + ", seq=0, pid=0}, {tcm_family=AF_UNIX" + ", tcm_ifindex=" IFINDEX_LO_STR + ", tcm_handle=0, tcm_parent=0, tcm_info=0}", + msg_len); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + const int fd = create_nl_socket(NETLINK_ROUTE); + const unsigned int hdrlen = sizeof(struct tcmsg); + void *nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(struct tc_stats)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + const unsigned int nla_type = 0xffff & NLA_TYPE_MASK; + char nla_type_str[256]; + sprintf(nla_type_str, "%#x /* TCA_??? */", nla_type); + TEST_NLATTR_(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + nla_type, nla_type_str, + 4, pattern, 4, + print_quoted_hex(pattern, 4)); + + static const struct tc_stats st = { + .bytes = 0xabcdcdbefeadefac, + .packets = 0xbcdeaefd, + .drops = 0xcdedafed, + .overlimits = 0xdcdbefad, + .bps = 0xefaebfad, + .pps = 0xfefbaedb, + .qlen = 0xabcdefab, + .backlog = 0xbdeabeab + }; + char buf[offsetofend(struct tc_stats, backlog)]; + memcpy(buf, &st, sizeof(buf)); + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_STATS, pattern, buf, + PRINT_FIELD_U("{", st, bytes); + PRINT_FIELD_U(", ", st, packets); + PRINT_FIELD_U(", ", st, drops); + PRINT_FIELD_U(", ", st, overlimits); + PRINT_FIELD_U(", ", st, bps); + PRINT_FIELD_U(", ", st, pps); + PRINT_FIELD_U(", ", st, qlen); + PRINT_FIELD_U(", ", st, backlog); + printf("}")); + + static const struct tc_estimator est = { + .interval = 0xcd, + .ewma_log = 0xab + }; + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_tcmsg, print_tcmsg, + TCA_RATE, pattern, est, + PRINT_FIELD_D("{", est, interval); + PRINT_FIELD_U(", ", est, ewma_log); + printf("}")); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/nlattr_tcmsg.gen.test b/tests/nlattr_tcmsg.gen.test new file mode 100755 index 00000000..7e70ca26 --- /dev/null +++ b/tests/nlattr_tcmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_tcmsg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nlattr_unix_diag_msg.c b/tests/nlattr_unix_diag_msg.c new file mode 100644 index 00000000..4d964eab --- /dev/null +++ b/tests/nlattr_unix_diag_msg.c @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include "test_nlattr.h" +#include +#include + +static void +init_unix_diag_msg(struct nlmsghdr *const nlh, const unsigned int msg_len) +{ + SET_STRUCT(struct nlmsghdr, nlh, + .nlmsg_len = msg_len, + .nlmsg_type = SOCK_DIAG_BY_FAMILY, + .nlmsg_flags = NLM_F_DUMP + ); + + struct unix_diag_msg *const msg = NLMSG_DATA(nlh); + SET_STRUCT(struct unix_diag_msg, msg, + .udiag_family = AF_UNIX, + .udiag_type = SOCK_STREAM, + .udiag_state = TCP_ESTABLISHED + ); +} + +static void +print_unix_diag_msg(const unsigned int msg_len) +{ + printf("{len=%u, type=SOCK_DIAG_BY_FAMILY" + ", flags=NLM_F_DUMP, seq=0, pid=0}, {udiag_family=AF_UNIX" + ", udiag_type=SOCK_STREAM, udiag_state=TCP_ESTABLISHED" + ", udiag_ino=0, udiag_cookie=[0, 0]}", + msg_len); +} + +static void +print_uint(const unsigned int *p, size_t i) +{ + printf("%u", *p); +} + +int +main(void) +{ + skip_if_unavailable("/proc/self/fd/"); + + static const struct unix_diag_vfs uv = { + .udiag_vfs_dev = 0xabcddafa, + .udiag_vfs_ino = 0xbafabcda + }; + static const struct unix_diag_rqlen rql = { + .udiag_rqueue = 0xfabdcdad, + .udiag_wqueue = 0xbacdadcf + }; + static const uint32_t inode[] = { 0xadbcadbc, 0xfabdcdac }; + + const int fd = create_nl_socket(NETLINK_SOCK_DIAG); + const unsigned int hdrlen = sizeof(struct unix_diag_msg); + void *const nlh0 = midtail_alloc(NLMSG_SPACE(hdrlen), + NLA_HDRLEN + sizeof(inode)); + + static char pattern[4096]; + fill_memory_ex(pattern, sizeof(pattern), 'a', 'z' - 'a' + 1); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_unix_diag_msg, print_unix_diag_msg, + UNIX_DIAG_VFS, pattern, uv, + printf("{udiag_vfs_dev=makedev(%#x, %#x)", + major(uv.udiag_vfs_dev), + minor(uv.udiag_vfs_dev)); + PRINT_FIELD_U(", ", uv, udiag_vfs_ino); + printf("}")); + + TEST_NLATTR_OBJECT(fd, nlh0, hdrlen, + init_unix_diag_msg, print_unix_diag_msg, + UNIX_DIAG_RQLEN, pattern, rql, + PRINT_FIELD_U("{", rql, udiag_rqueue); + PRINT_FIELD_U(", ", rql, udiag_wqueue); + printf("}")); + + TEST_NLATTR_ARRAY(fd, nlh0, hdrlen, + init_unix_diag_msg, print_unix_diag_msg, + UNIX_DIAG_ICONS, pattern, inode, print_uint); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/nlattr_unix_diag_msg.gen.test b/tests/nlattr_unix_diag_msg.gen.test new file mode 100755 index 00000000..fd5b8286 --- /dev/null +++ b/tests/nlattr_unix_diag_msg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (nlattr_unix_diag_msg +netlink_sock_diag.test ); do not edit. +set -- +. "${srcdir=.}/netlink_sock_diag.test" diff --git a/tests/nsyscalls-d.c b/tests/nsyscalls-d.c new file mode 100644 index 00000000..1525dea0 --- /dev/null +++ b/tests/nsyscalls-d.c @@ -0,0 +1,2 @@ +#define DEBUG_PRINT 1 +#include "nsyscalls.c" diff --git a/tests/nsyscalls-d.test b/tests/nsyscalls-d.test new file mode 100755 index 00000000..a6495b6b --- /dev/null +++ b/tests/nsyscalls-d.test @@ -0,0 +1,31 @@ +#!/bin/sh +# +# Check decoding of out-of-range syscalls along with debug ouput +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +: ${debug_flag=-d} +NAME=nsyscalls-d + +if [ "$MIPS_ABI" = "o32" ]; then + syscall=syscall + [ -z "$debug_flag" ] || + skip_ "mips $MIPS_ABI is not supported by this test yet" +else + syscall=none +fi + +run_strace $debug_flag -e trace=$syscall ../$NAME "$STRACE_EXE" 9 \ + 2> "$LOG-err-all" > "$EXP" 9> "$EXP-err" + +[ -n "$debug_flag" ] || > "$EXP-err" + +grep "invalid syscall" "$LOG-err-all" > "$LOG-err" + +match_diff "$LOG" "$EXP" +match_diff "$LOG-err" "$EXP-err" diff --git a/tests/nsyscalls-nd.test b/tests/nsyscalls-nd.test new file mode 100755 index 00000000..f578f9aa --- /dev/null +++ b/tests/nsyscalls-nd.test @@ -0,0 +1,9 @@ +#!/bin/sh +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +debug_flag= +. "${srcdir=.}"/nsyscalls-d.test diff --git a/tests/nsyscalls.c b/tests/nsyscalls.c index aecf7aa7..529f50ee 100644 --- a/tests/nsyscalls.c +++ b/tests/nsyscalls.c @@ -2,56 +2,32 @@ * Check decoding of out-of-range syscalls. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include "sysent.h" #include #include +#include #include #include -#define TD 0 -#define TF 0 -#define TI 0 -#define TN 0 -#define TP 0 -#define TS 0 -#define TM 0 -#define NF 0 -#define MA 0 -#define SI 0 -#define SE 0 -#define CST 0 -#define SEN(arg) 0,0 +#include "sysent_shorthand_defs.h" static const struct_sysent syscallent[] = { #include "syscallent.h" }; +#include "sysent_shorthand_undefs.h" + +#ifndef DEBUG_PRINT +# define DEBUG_PRINT 0 +#endif + #if defined __X32_SYSCALL_BIT && defined __NR_read \ && (__X32_SYSCALL_BIT & __NR_read) != 0 # define SYSCALL_BIT __X32_SYSCALL_BIT @@ -59,6 +35,11 @@ static const struct_sysent syscallent[] = { # define SYSCALL_BIT 0 #endif +#if DEBUG_PRINT +static const char *strace_name; +static FILE *debug_out; +#endif + static void test_syscall(const unsigned long nr) { @@ -73,27 +54,52 @@ test_syscall(const unsigned long nr) long rc = syscall(nr | SYSCALL_BIT, a[0], a[1], a[2], a[3], a[4], a[5]); + +#if DEBUG_PRINT + fprintf(debug_out, "%s: pid %d invalid syscall %#lx\n", + strace_name, getpid(), nr | SYSCALL_BIT); +#endif + #ifdef LINUX_MIPSO32 printf("syscall(%#lx, %#lx, %#lx, %#lx, %#lx, %#lx, %#lx)" - " = %ld ENOSYS (%m)\n", nr | SYSCALL_BIT, - a[0], a[1], a[2], a[3], a[4], a[5], rc); + " = %s\n", nr | SYSCALL_BIT, + a[0], a[1], a[2], a[3], a[4], a[5], sprintrc(rc)); #else - printf("syscall_%lu(%#llx, %#llx, %#llx, %#llx, %#llx, %#llx)" - " = %ld (errno %d)\n", nr, + printf("syscall_%#lx(%#llx, %#llx, %#llx, %#llx, %#llx, %#llx)" + " = %s\n", nr | SYSCALL_BIT, (unsigned long long) a[0], (unsigned long long) a[1], (unsigned long long) a[2], (unsigned long long) a[3], (unsigned long long) a[4], (unsigned long long) a[5], - rc, errno); + sprintrc(rc)); #endif } int -main(void) +main(int argc, char *argv[]) { +#if DEBUG_PRINT + if (argc < 3) + error_msg_and_fail("Not enough arguments. " + "Usage: %s STRACE_NAME DEBUG_OUT_FD", + argv[0]); + + strace_name = argv[1]; + + errno = 0; + int debug_out_fd = strtol(argv[2], NULL, 0); + if (errno) + error_msg_and_fail("Not a number: %s", argv[2]); + + debug_out = fdopen(debug_out_fd, "a"); + if (!debug_out) + perror_msg_and_fail("fdopen: %d", debug_out_fd); +#endif + test_syscall(ARRAY_SIZE(syscallent)); + (void) syscallent; /* workaround for clang bug #33068 */ #ifdef SYS_socket_subcall test_syscall(SYS_socket_subcall + 1); diff --git a/tests/nsyscalls.test b/tests/nsyscalls.test index 61f72d52..08d45ac6 100755 --- a/tests/nsyscalls.test +++ b/tests/nsyscalls.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check decoding of out-of-range syscalls. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests/old_mmap-P.c b/tests/old_mmap-P.c new file mode 100644 index 00000000..bb28e889 --- /dev/null +++ b/tests/old_mmap-P.c @@ -0,0 +1,3 @@ +#define TEST_FD 9 +#define PATH_TRACING +#include "old_mmap.c" diff --git a/tests/old_mmap-P.gen.test b/tests/old_mmap-P.gen.test new file mode 100755 index 00000000..b1de9345 --- /dev/null +++ b/tests/old_mmap-P.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (old_mmap-P -e trace=mmap -P "/dev/full" 9>>/dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=mmap -P "/dev/full" 9>>/dev/full diff --git a/tests/old_mmap-Xabbrev.c b/tests/old_mmap-Xabbrev.c new file mode 100644 index 00000000..033503cc --- /dev/null +++ b/tests/old_mmap-Xabbrev.c @@ -0,0 +1 @@ +#include "old_mmap.c" diff --git a/tests/old_mmap-Xabbrev.gen.test b/tests/old_mmap-Xabbrev.gen.test new file mode 100755 index 00000000..0ee5608e --- /dev/null +++ b/tests/old_mmap-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (old_mmap-Xabbrev -a11 -e trace=mmap -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=mmap -Xabbrev diff --git a/tests/old_mmap-Xraw.c b/tests/old_mmap-Xraw.c new file mode 100644 index 00000000..06de40b4 --- /dev/null +++ b/tests/old_mmap-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "old_mmap.c" diff --git a/tests/old_mmap-Xraw.gen.test b/tests/old_mmap-Xraw.gen.test new file mode 100755 index 00000000..6d7d3cf4 --- /dev/null +++ b/tests/old_mmap-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (old_mmap-Xraw -a11 -e trace=mmap -Xraw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=mmap -Xraw diff --git a/tests/old_mmap-Xverbose.c b/tests/old_mmap-Xverbose.c new file mode 100644 index 00000000..b141fec9 --- /dev/null +++ b/tests/old_mmap-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "old_mmap.c" diff --git a/tests/old_mmap-Xverbose.gen.test b/tests/old_mmap-Xverbose.gen.test new file mode 100755 index 00000000..6534a931 --- /dev/null +++ b/tests/old_mmap-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (old_mmap-Xverbose -a11 -e trace=mmap -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=mmap -Xverbose diff --git a/tests/old_mmap-v-none.c b/tests/old_mmap-v-none.c new file mode 100644 index 00000000..033503cc --- /dev/null +++ b/tests/old_mmap-v-none.c @@ -0,0 +1 @@ +#include "old_mmap.c" diff --git a/tests/old_mmap-v-none.gen.test b/tests/old_mmap-v-none.gen.test new file mode 100755 index 00000000..a568d989 --- /dev/null +++ b/tests/old_mmap-v-none.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (old_mmap-v-none -a11 -e trace=mmap -e verbose=none); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=mmap -e verbose=none diff --git a/tests/old_mmap.c b/tests/old_mmap.c index 2725fb75..92ab3efb 100644 --- a/tests/old_mmap.c +++ b/tests/old_mmap.c @@ -2,29 +2,10 @@ * Check decoding of "old mmap" edition of mmap syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,57 +17,86 @@ * it would require additional efforts to filter out mmap calls made by glibc. */ -#if defined __NR_mmap && \ -( defined __arm__ \ - || defined __i386__ \ - || (defined __s390__ && !defined __s390x__) \ -) +#if defined __NR_mmap \ + && (defined __arm__ || defined __i386__ || defined __m68k__ \ + || defined __s390__ || defined __s390x__) \ + && (defined PATH_TRACING || !(defined __s390x__ || defined __m68k__)) # include # include # include # include +# ifndef TEST_FD +# define TEST_FD -2LU +# endif + int main(void) { long rc = syscall(__NR_mmap, 0); +# ifndef PATH_TRACING printf("mmap(NULL) = %ld %s (%m)\n", rc, errno2name()); +# endif - const unsigned int args1_c[6] = { - 0xdeadbeef, /* addr */ - 0xfacefeed, /* len */ + const unsigned long args1_c[6] = { + (unsigned long) 0xbadc0deddeadbeefULL, /* addr */ + (unsigned long) 0xdeefacedfacefeedULL, /* len */ PROT_READ|PROT_EXEC, /* prot */ MAP_FILE|MAP_FIXED, /* flags */ - -2U, /* fd */ - 0xbadc0ded /* offset */ + TEST_FD, /* fd */ + (unsigned long) 0xdecaffedbadc0dedULL /* offset */ }; - const unsigned int page_size = get_page_size(); - const unsigned int args2_c[6] = { + const unsigned long page_size = get_page_size(); + const unsigned long args2_c[6] = { 0, page_size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, - -1U, - 0xfaced000 & -page_size + -1LU, + (unsigned long) 0xda7a1057faced000ULL & -page_size }; void *args = tail_memdup(args1_c, sizeof(args1_c)); rc = syscall(__NR_mmap, args); - printf("mmap(%#x, %u, PROT_READ|PROT_EXEC, MAP_FILE|MAP_FIXED" - ", %d, %#x) = %ld %s (%m)\n", - args1_c[0], args1_c[1], args1_c[4], args1_c[5], +# if XLAT_RAW + printf("mmap(%#lx, %lu, %#x, %#x, %d, %#lx) = %ld %s (%m)\n", + args1_c[0], args1_c[1], PROT_READ|PROT_EXEC, MAP_FILE | MAP_FIXED, + (int) args1_c[4], args1_c[5], rc, errno2name()); +# elif XLAT_VERBOSE + printf("mmap(%#lx, %lu, %#x /* PROT_READ|PROT_EXEC */" + ", %#x /* MAP_FILE|MAP_FIXED */, %d, %#lx) = %ld %s (%m)\n", + args1_c[0], args1_c[1], PROT_READ|PROT_EXEC, MAP_FILE | MAP_FIXED, + (int) args1_c[4], args1_c[5], rc, errno2name()); +# else + printf("mmap(%#lx, %lu, PROT_READ|PROT_EXEC, MAP_FILE|MAP_FIXED" + ", %d, %#lx) = %ld %s (%m)\n", + args1_c[0], args1_c[1], (int) args1_c[4], args1_c[5], rc, errno2name()); +# endif memcpy(args, args2_c, sizeof(args2_c)); rc = syscall(__NR_mmap, args); - printf("mmap(NULL, %u, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS" - ", %d, %#x) = %#lx\n", - args2_c[1], args2_c[4], args2_c[5], rc); +# ifndef PATH_TRACING +# if XLAT_RAW + printf("mmap(NULL, %lu, %#x, %#x, %d, %#lx) = %#lx\n", + args2_c[1], PROT_READ|PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, + (int) args2_c[4], args2_c[5], rc); +# elif XLAT_VERBOSE + printf("mmap(NULL, %lu, %#x /* PROT_READ|PROT_WRITE */" + ", %#x /* MAP_PRIVATE|MAP_ANONYMOUS */, %d, %#lx) = %#lx\n", + args2_c[1], PROT_READ|PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, + (int) args2_c[4], args2_c[5], rc); +# else + printf("mmap(NULL, %lu, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS" + ", %d, %#lx) = %#lx\n", + args2_c[1], (int) args2_c[4], args2_c[5], rc); +# endif +# endif void *addr = (void *) rc; if (mprotect(addr, page_size, PROT_NONE)) - perror_msg_and_fail("mprotect(%p, %u, PROT_NONE)", + perror_msg_and_fail("mprotect(%p, %lu, PROT_NONE)", addr, page_size); puts("+++ exited with 0 +++"); @@ -95,7 +105,9 @@ main(void) #else -SKIP_MAIN_UNDEFINED("__NR_mmap && (__arm__ || __i386__" - " || (__s390__ && !__s390x__))") +SKIP_MAIN_UNDEFINED("defined __NR_mmap " + "&& (defined __arm__ || defined __i386__ || defined __m68k__ " + "|| defined __s390__ || defined __s390x__) " + "&& (defined PATH_TRACING || !(defined __s390x__ || defined __m68k__))") #endif diff --git a/tests/old_mmap.gen.test b/tests/old_mmap.gen.test new file mode 100755 index 00000000..1913eec2 --- /dev/null +++ b/tests/old_mmap.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (old_mmap -a11 -e trace=mmap); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=mmap diff --git a/tests/old_mmap.test b/tests/old_mmap.test deleted file mode 100755 index af776ff7..00000000 --- a/tests/old_mmap.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of "old mmap" edition of mmap syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a11 -e trace=mmap diff --git a/tests/oldfstat.c b/tests/oldfstat.c index f5a94416..c2624777 100644 --- a/tests/oldfstat.c +++ b/tests/oldfstat.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/oldfstat.gen.test b/tests/oldfstat.gen.test new file mode 100755 index 00000000..2b48b397 --- /dev/null +++ b/tests/oldfstat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (oldfstat -a18 -v -P stat.sample); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a18 -v -P stat.sample diff --git a/tests/oldfstat.test b/tests/oldfstat.test deleted file mode 100755 index 66a10561..00000000 --- a/tests/oldfstat.test +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -# Check oldfstat syscall decoding. - -. "${srcdir=.}/init.sh" - -# strace -P is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - -syscall=$NAME -run_prog > /dev/null -sample=$syscall.sample -> "$sample" -run_strace -ve$syscall -P$sample -a21 $args > "$OUT" -match_diff "$LOG" "$OUT" -rm -f "$OUT" - -exit 0 diff --git a/tests/oldlstat.c b/tests/oldlstat.c index 66132370..0444b17f 100644 --- a/tests/oldlstat.c +++ b/tests/oldlstat.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/oldlstat.gen.test b/tests/oldlstat.gen.test new file mode 100755 index 00000000..3202b924 --- /dev/null +++ b/tests/oldlstat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (oldlstat -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests/oldlstat.test b/tests/oldlstat.test deleted file mode 100755 index a0f9ab93..00000000 --- a/tests/oldlstat.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check oldlstat syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests/oldselect-P.c b/tests/oldselect-P.c new file mode 100644 index 00000000..67e21343 --- /dev/null +++ b/tests/oldselect-P.c @@ -0,0 +1,2 @@ +#define PATH_TRACING_FD 9 +#include "oldselect.c" diff --git a/tests/oldselect-P.gen.test b/tests/oldselect-P.gen.test new file mode 100755 index 00000000..3486ffd6 --- /dev/null +++ b/tests/oldselect-P.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (oldselect-P -a13 -e trace=select -P /dev/full 9>>/dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 -e trace=select -P /dev/full 9>>/dev/full diff --git a/tests/oldselect-efault-P.c b/tests/oldselect-efault-P.c new file mode 100644 index 00000000..9ebf73d2 --- /dev/null +++ b/tests/oldselect-efault-P.c @@ -0,0 +1,2 @@ +#define PATH_TRACING_FD 9 +#include "oldselect-efault.c" diff --git a/tests/oldselect-efault-P.gen.test b/tests/oldselect-efault-P.gen.test new file mode 100755 index 00000000..a3d71768 --- /dev/null +++ b/tests/oldselect-efault-P.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (oldselect-efault-P -a13 -e trace=select -P /dev/full 9>>/dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 -e trace=select -P /dev/full 9>>/dev/full diff --git a/tests/oldselect-efault.c b/tests/oldselect-efault.c new file mode 100644 index 00000000..4e927521 --- /dev/null +++ b/tests/oldselect-efault.c @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#if defined __NR_select && defined __NR__newselect \ + && __NR_select != __NR__newselect \ + && !defined __sparc__ + +# include +# include +# include +# include +# include + +static const char *errstr; + +static long +xselect(const kernel_ulong_t args) +{ + static const kernel_ulong_t dummy = F8ILL_KULONG_MASK | 0xfacefeed; + long rc = syscall(__NR_select, args, dummy, dummy, dummy, dummy, dummy); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + unsigned long *const args = tail_alloc(sizeof(*args) * 4); + memset(args, 0, sizeof(*args) * 4); + + xselect(0); +# ifndef PATH_TRACING_FD + printf("select(NULL) = %s\n", errstr); +# endif + + xselect((uintptr_t) args); +# ifndef PATH_TRACING_FD + printf("select(%p) = %s\n", args, errstr); +# endif + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_select && __NR__newselect" + " && __NR_select != __NR__newselect" + " && !defined __sparc__") + +#endif diff --git a/tests/oldselect-efault.gen.test b/tests/oldselect-efault.gen.test new file mode 100755 index 00000000..bfeb5571 --- /dev/null +++ b/tests/oldselect-efault.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (oldselect-efault -a13 -e trace=select); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 -e trace=select diff --git a/tests/oldselect.c b/tests/oldselect.c index 7413fc33..0af35541 100644 --- a/tests/oldselect.c +++ b/tests/oldselect.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -30,37 +10,38 @@ #if defined __NR_select && defined __NR__newselect \ && __NR_select != __NR__newselect \ - && !defined SPARC - -# include -# include + && !defined __sparc__ -int -main(void) -{ - int fds[2]; - fd_set r = {}, w = {}; - struct timeval timeout = { .tv_sec = 0, .tv_usec = 42 }; - long args[] = { - 2, (long) &r, (long) &w, 0, (long) &timeout, - 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded, 0xdeadbeef - }; +# define TEST_SYSCALL_NR __NR_select +# define TEST_SYSCALL_STR "select" +# define xselect xselect +# include "xselect.c" - (void) close(0); - (void) close(1); - if (pipe(fds)) - perror_msg_and_fail("pipe"); +static uint32_t *args; - FD_SET(0, &w); - FD_SET(1, &r); - if (syscall(__NR_select, args)) - perror_msg_and_skip("select"); - - return 0; +static long +xselect(const kernel_ulong_t nfds, + const kernel_ulong_t rs, + const kernel_ulong_t ws, + const kernel_ulong_t es, + const kernel_ulong_t tv) +{ + if (!args) + args = tail_alloc(sizeof(*args) * 5); + args[0] = nfds; + args[1] = rs; + args[2] = ws; + args[3] = es; + args[4] = tv; + long rc = syscall(TEST_SYSCALL_NR, args); + errstr = sprintrc(rc); + return rc; } #else -SKIP_MAIN_UNDEFINED("__NR_select && __NR__newselect") +SKIP_MAIN_UNDEFINED("__NR_select && __NR__newselect" + " && __NR_select != __NR__newselect" + " && !defined __sparc__") #endif diff --git a/tests/oldselect.expected b/tests/oldselect.expected deleted file mode 100644 index d6e7f3c4..00000000 --- a/tests/oldselect.expected +++ /dev/null @@ -1,2 +0,0 @@ -select(2, [1], [0], NULL, {tv_sec=0, tv_usec=42}) = 0 (Timeout) -+++ exited with 0 +++ diff --git a/tests/oldselect.gen.test b/tests/oldselect.gen.test new file mode 100755 index 00000000..1f10cbe3 --- /dev/null +++ b/tests/oldselect.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (oldselect -a13 -e trace=select); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 -e trace=select diff --git a/tests/oldselect.test b/tests/oldselect.test deleted file mode 100755 index 35661ad4..00000000 --- a/tests/oldselect.test +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# Check old select syscall decoding. - -. "${srcdir=.}/init.sh" - -run_prog -run_strace -a34 -eselect $args -match_diff - -exit 0 diff --git a/tests/oldstat.c b/tests/oldstat.c index d06e2bc6..03b40335 100644 --- a/tests/oldstat.c +++ b/tests/oldstat.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/oldstat.gen.test b/tests/oldstat.gen.test new file mode 100755 index 00000000..f265ac56 --- /dev/null +++ b/tests/oldstat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (oldstat -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests/oldstat.test b/tests/oldstat.test deleted file mode 100755 index 42d70f7f..00000000 --- a/tests/oldstat.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check oldstat syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests/open.c b/tests/open.c index 01e89b0f..43a3ae68 100644 --- a/tests/open.c +++ b/tests/open.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -30,7 +11,7 @@ #ifdef __NR_open -# include +# include # include # include @@ -56,16 +37,11 @@ main(void) sample, sprintrc(fd)); } -#ifdef O_TMPFILE -# if O_TMPFILE == (O_TMPFILE & ~O_DIRECTORY) -# define STR_O_TMPFILE "O_TMPFILE" -# else -# define STR_O_TMPFILE "O_DIRECTORY|O_TMPFILE" -# endif +# ifdef O_TMPFILE fd = syscall(__NR_open, sample, O_WRONLY|O_TMPFILE, 0600); - printf("open(\"%s\", O_WRONLY|%s, 0600) = %s\n", - sample, STR_O_TMPFILE, sprintrc(fd)); -#endif /* O_TMPFILE */ + printf("open(\"%s\", O_WRONLY|O_TMPFILE, 0600) = %s\n", + sample, sprintrc(fd)); +# endif /* O_TMPFILE */ puts("+++ exited with 0 +++"); return 0; diff --git a/tests/open.gen.test b/tests/open.gen.test new file mode 100755 index 00000000..eb931a34 --- /dev/null +++ b/tests/open.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (open -a30 -P $NAME.sample); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a30 -P $NAME.sample diff --git a/tests/open.test b/tests/open.test deleted file mode 100755 index 6df19cb8..00000000 --- a/tests/open.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check open syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a30 -P $NAME.sample diff --git a/tests/openat.c b/tests/openat.c index 1d6765cf..d4a74178 100644 --- a/tests/openat.c +++ b/tests/openat.c @@ -1,44 +1,44 @@ /* * Copyright (c) 2016 Katerina Koukiou + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include -#if defined __NR_openat +#ifdef __NR_openat -# include +# include # include # include +# ifdef O_TMPFILE +/* The kernel & C libraries often inline O_DIRECTORY. */ +# define STRACE_O_TMPFILE (O_TMPFILE & ~O_DIRECTORY) +# else +# define STRACE_O_TMPFILE 0 +# endif + +static const char sample[] = "openat.sample"; + +static void +test_mode_flag(unsigned int mode_val, const char *mode_str, + unsigned int flag_val, const char *flag_str) +{ + long rc = syscall(__NR_openat, -1, sample, mode_val | flag_val, 0); + printf("openat(-1, \"%s\", %s%s%s%s) = %s\n", + sample, mode_str, + flag_val ? "|" : "", flag_str, + flag_val & (O_CREAT | STRACE_O_TMPFILE) ? ", 000" : "", + sprintrc(rc)); +} + int main(void) { - static const char sample[] = "openat.sample"; - long fd = syscall(__NR_openat, -100, sample, O_RDONLY|O_CREAT, 0400); printf("openat(AT_FDCWD, \"%s\", O_RDONLY|O_CREAT, 0400) = %s\n", sample, sprintrc(fd)); @@ -53,6 +53,54 @@ main(void) sample, sprintrc(fd)); } + struct { + unsigned int val; + const char *str; + } modes[] = { + { ARG_STR(O_RDONLY) }, + { ARG_STR(O_WRONLY) }, + { ARG_STR(O_RDWR) }, + { ARG_STR(O_ACCMODE) } + }, flags[] = { + { ARG_STR(O_APPEND) }, + { ARG_STR(O_DIRECT) }, + { ARG_STR(O_DIRECTORY) }, + { ARG_STR(O_EXCL) }, + { ARG_STR(O_LARGEFILE) }, + { ARG_STR(O_NOATIME) }, + { ARG_STR(O_NOCTTY) }, + { ARG_STR(O_NOFOLLOW) }, + { ARG_STR(O_NONBLOCK) }, + { ARG_STR(O_SYNC) }, + { ARG_STR(O_TRUNC) }, + { ARG_STR(O_CREAT) }, +# ifdef O_CLOEXEC + { ARG_STR(O_CLOEXEC) }, +# endif +# ifdef O_DSYNC + { ARG_STR(O_DSYNC) }, +# endif +# ifdef __O_SYNC + { ARG_STR(__O_SYNC) }, +# endif +# ifdef O_PATH + { ARG_STR(O_PATH) }, +# endif +# ifdef O_TMPFILE + { ARG_STR(O_TMPFILE) }, +# endif +# ifdef __O_TMPFILE + { ARG_STR(__O_TMPFILE) }, +# endif + { ARG_STR(0x80000000) }, + { 0, "" } + }; + + for (unsigned int m = 0; m < ARRAY_SIZE(modes); ++m) + for (unsigned int f = 0; f < ARRAY_SIZE(flags); ++f) + test_mode_flag(modes[m].val, modes[m].str, + flags[f].val, flags[f].str); + puts("+++ exited with 0 +++"); return 0; } diff --git a/tests/openat.gen.test b/tests/openat.gen.test new file mode 100755 index 00000000..29dd3491 --- /dev/null +++ b/tests/openat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (openat -a36 -P $NAME.sample); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 -P $NAME.sample diff --git a/tests/openat.test b/tests/openat.test deleted file mode 100755 index 68c4cee1..00000000 --- a/tests/openat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check openat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -P $NAME.sample diff --git a/tests/opipe.test b/tests/opipe.test index 90e6838a..d6777250 100755 --- a/tests/opipe.test +++ b/tests/opipe.test @@ -1,16 +1,19 @@ #!/bin/sh - +# # Check how -o '|pipe' works. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" check_prog grep -run_prog grep chdir $srcdir/umovestr.expected > "$EXP" -run_prog ./umovestr +grep chdir $srcdir/umovestr.expected > "$EXP" +run_prog ../umovestr -> "$LOG" || fail_ "failed to write $LOG" $STRACE -o "|cat > $LOG && $SLEEP_A_BIT && grep chdir < $LOG > $OUT" -e chdir $args || dump_log_and_fail_with "$STRACE $args failed" match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests/options-syntax.test b/tests/options-syntax.test index 592b0e03..5e43b3ab 100755 --- a/tests/options-syntax.test +++ b/tests/options-syntax.test @@ -3,62 +3,12 @@ # Check strace options syntax. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (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" +# SPDX-License-Identifier: GPL-2.0-or-later -check_exit_status_and_stderr() -{ - $STRACE "$@" 2> "$LOG" && - dump_log_and_fail_with \ - "strace $* failed to handle the error properly" - match_diff "$LOG" "$EXP" || - dump_log_and_fail_with \ - "strace $* failed to print expected diagnostics" -} - -strace_exp="${STRACE##* }" - -check_e() -{ - local pattern="$1"; shift - cat > "$EXP" << __EOF__ -$strace_exp: $pattern -__EOF__ - check_exit_status_and_stderr "$@" -} - -check_h() -{ - local pattern="$1"; shift - cat > "$EXP" << __EOF__ -$strace_exp: $pattern -Try '$strace_exp -h' for more information. -__EOF__ - check_exit_status_and_stderr "$@" -} +. "${srcdir=.}/syntax.sh" check_e "Invalid process id: '0'" -p 0 check_e "Invalid process id: '-42'" -p -42 @@ -67,26 +17,10 @@ check_e "Invalid process id: 'a'" -p 1,a check_e "Syscall 'chdir' for -b isn't supported" -b chdir check_e "Syscall 'chdir' for -b isn't supported" -b execve -b chdir -check_e "invalid system call '-1'" -e-1 -check_e "invalid system call '-2'" -e -2 -check_e "invalid system call '-3'" -etrace=-3 -check_e "invalid system call '-4'" -e trace=-4 -check_e "invalid system call '-5'" -e trace=1,-5 -check_e "invalid system call '2147483647'" -e 2147483647 -check_e "invalid system call '2147483648'" -e 2147483648 -check_e "invalid system call '4294967295'" -e 4294967295 -check_e "invalid system call '4294967296'" -e 4294967296 +check_e_using_grep 'exec: File *name too long' "$(printf '%4096s' ' ')" -check_e "invalid descriptor '-1'" -eread=-1 -check_e "invalid descriptor '-42'" -ewrite=-42 -check_e "invalid descriptor '2147483648'" -eread=2147483648 -check_e "invalid descriptor '4294967296'" -ewrite=4294967296 -check_e "invalid descriptor 'foo'" -eread=foo -check_e "invalid descriptor ''" -ewrite= -check_e "invalid descriptor ','" -eread=, -check_e "invalid descriptor '!'" -ewrite='!' -check_e "invalid descriptor '!'" -eread='0,!' -check_e "invalid descriptor '!,'" -ewrite='!,' +ff_name="$(printf '%4084s' ' ')" +check_e_using_grep "$ff_name: File *name too long" -ff -o "$ff_name" true check_h 'must have PROG [ARGS] or -p PID' check_h 'PROG [ARGS] must be specified with -D' -D -p $$ @@ -100,10 +34,63 @@ check_h 'piping the output and -ff are mutually exclusive' -o '!' -ff true check_h "invalid -a argument: '-42'" -a -42 check_h "invalid -O argument: '-42'" -O -42 check_h "invalid -s argument: '-42'" -s -42 +check_h "invalid -s argument: '1073741824'" -s 1073741824 check_h "invalid -I argument: '5'" -I 5 +check_h "invalid -X argument: 'test'" -Xtest +check_h "invalid -X argument: 'a'" -Xa +check_h "invalid -X argument: 'abbreviated'" -X abbreviated + +check_h "incorrect personality designator '' in qualification 'getcwd@'" -e trace=getcwd@ +check_h "incorrect personality designator '42' in qualification 'getcwd@42'" -e trace=getcwd@42 +check_h "incorrect personality designator '42' in qualification 'getcwd@42'" -e trace=gettid,getcwd@42 +check_h "incorrect personality designator '42' in qualification '23@42'" -e trace=23@42,123 + +check_e "invalid system call '/getcwd@ohmy'" -e trace=/getcwd@ohmy +check_e "invalid -e kvm= argument: 'chdir'" -e kvm=chdir + +case "$STRACE_NATIVE_ARCH" in +x86_64) + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@64 + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@32 + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@x32 + ;; +x32) + check_h "incorrect personality designator '64' in qualification 'getcwd@64'" -e trace=getcwd@64 + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@32 + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@x32 + ;; +aarch64|powerpc64|riscv|s390x|sparc64|tile) + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@64 + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@32 + check_h "incorrect personality designator 'x32' in qualification 'getcwd@x32'" -e trace=getcwd@x32 + ;; +*) + pers="$((SIZEOF_LONG * 8))" + inv_pers="$((96 - pers))" + check_h "must have PROG [ARGS] or -p PID" -e trace=getcwd@"$pers" + check_h "incorrect personality designator '$inv_pers' in qualification 'getcwd@$inv_pers'" -e trace=getcwd@"$inv_pers" + check_h "incorrect personality designator 'x32' in qualification 'getcwd@x32'" -e trace=getcwd@x32 +esac + +../zeroargc "$STRACE_EXE" /bin/true 2> "$LOG" && + dump_log_and_fail_with \ + 'zeroargc strace failed to handle the error properly' +cat > "$EXP" << __EOF__ +$STRACE_EXE: must have PROG [ARGS] or -p PID +Try '$STRACE_EXE -h' for more information. +__EOF__ +diff -u -- "$EXP" "$LOG" > /dev/null || { + cat > "$EXP" <<- '__EOF__' + strace: must have PROG [ARGS] or -p PID + Try 'strace -h' for more information. + __EOF__ + match_diff "$LOG" "$EXP" \ + "zeroargc $STRACE $args output mismatch" +} -if [ -n "${UID-}" ]; then - if [ "${UID-}" = 0 ]; then +uid="${UID:-`id -u`}" +if [ "$uid" -ge 0 ]; then + if [ "$uid" -eq 0 ]; then umsg="Cannot find user ':nosuchuser:'" else umsg='You must be root to use the -u option' @@ -113,17 +100,14 @@ if [ -n "${UID-}" ]; then for c in i r t T y; do check_e "-$c has no effect with -c -$strace_exp: $umsg" -u :nosuchuser: -c -$c true +$STRACE_EXE: $umsg" -u :nosuchuser: -c -$c true done check_e "-i has no effect with -c -$strace_exp: -r has no effect with -c -$strace_exp: -t has no effect with -c -$strace_exp: -T has no effect with -c -$strace_exp: -y has no effect with -c -$strace_exp: $umsg" -u :nosuchuser: -cirtTy true - - check_e "-tt has no effect with -r -$strace_exp: $umsg" -u :nosuchuser: -r -tt true +$STRACE_EXE: -r has no effect with -c +$STRACE_EXE: -t has no effect with -c +$STRACE_EXE: -T has no effect with -c +$STRACE_EXE: -y has no effect with -c +$STRACE_EXE: $umsg" -u :nosuchuser: -cirtTy true fi args='-p 2147483647' @@ -133,7 +117,7 @@ $STRACE $args 2> "$LOG" && for cmd in PTRACE_SEIZE PTRACE_ATTACH; do cat > "$EXP" << __EOF__ -$strace_exp: attach: ptrace($cmd, 2147483647): No such process +$STRACE_EXE: attach: ptrace($cmd, 2147483647): No such process __EOF__ diff -- "$EXP" "$LOG" || continue @@ -144,5 +128,3 @@ done [ -z "$args" ] || dump_log_and_fail_with \ "strace $args failed to print expected diagnostics" - -rm -f "$EXP" diff --git a/tests/orphaned_process_group.c b/tests/orphaned_process_group.c new file mode 100644 index 00000000..83ab6e39 --- /dev/null +++ b/tests/orphaned_process_group.c @@ -0,0 +1,155 @@ +/* + * Check tracing of orphaned process group. + * + * Copyright (c) 2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include +#include +#include + +#define TIMEOUT 5 + +static void +alarm_handler(const int no) +{ + error_msg_and_skip("Orphaned process group semantics" + " is not supported by the kernel"); +} + +int +main(void) +{ + int status; + + /* + * Unblock all signals. + */ + static sigset_t mask; + if (sigprocmask(SIG_SETMASK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + /* + * Create a pipe to track termination of processes. + */ + int pipe_fds[2]; + if (pipe(pipe_fds)) + perror_msg_and_fail("pipe"); + + /* + * Create a leader for its own new process group. + */ + pid_t leader = fork(); + if (leader < 0) + perror_msg_and_fail("fork"); + + if (leader) { + /* + * Close the writing end of the pipe. + */ + close(pipe_fds[1]); + + /* + * Install the SIGALRM signal handler. + */ + static const struct sigaction sa = { + .sa_handler = alarm_handler + }; + if (sigaction(SIGALRM, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + /* + * Set an alarm clock. + */ + alarm(TIMEOUT); + + /* + * Wait for termination of the child process. + */ + if (waitpid(leader, &status, 0) != leader) + perror_msg_and_fail("waitpid leader"); + if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) + error_msg_and_fail("waitpid leader: " + "unexpected wait status %d", + status); + + /* + * Wait for termination of all processes + * in the process group of the child process. + */ + if (read(pipe_fds[0], &status, sizeof(status)) != 0) + perror_msg_and_fail("read"); + + /* + * At this point all processes are gone. + * Let the tracer time to catch up. + */ + alarm(0); + sleep(1); + return 0; + } + + /* + * Close the reading end of the pipe. + */ + close(pipe_fds[0]); + + /* + * Create a new process group. + */ + if (setpgid(0, 0)) + perror_msg_and_fail("setpgid"); + + /* + * When the leader process terminates, the process group becomes orphaned. + * If any member of the orphaned process group is stopped, then + * a SIGHUP signal followed by a SIGCONT signal is sent to each process + * in the orphaned process group. + * Create a process in a stopped state to activate this behaviour. + */ + const pid_t stopped = fork(); + if (stopped < 0) + perror_msg_and_fail("fork"); + if (!stopped) { + static const struct sigaction sa = { .sa_handler = SIG_DFL }; + if (sigaction(SIGHUP, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + raise(SIGSTOP); + _exit(0); + } + + /* + * Wait for the process to stop. + */ + if (waitpid(stopped, &status, WUNTRACED) != stopped) + perror_msg_and_fail("waitpid WUNTRACED"); + if (!WIFSTOPPED(status) || WSTOPSIG(status) != SIGSTOP) + error_msg_and_fail("unexpected wait status %d", status); + + /* + * Print the expected output. + */ + leader = getpid(); + printf("%-5d --- %s {si_signo=%s, si_code=SI_TKILL" + ", si_pid=%d, si_uid=%u} ---\n", + stopped, "SIGSTOP", "SIGSTOP", stopped, geteuid()); + printf("%-5d --- stopped by SIGSTOP ---\n", stopped); + printf("%-5d +++ exited with 0 +++\n", leader); + printf("%-5d --- %s {si_signo=%s, si_code=SI_KERNEL} ---\n", + stopped, "SIGHUP", "SIGHUP"); + printf("%-5d +++ killed by %s +++\n", stopped, "SIGHUP"); + printf("%-5d +++ exited with 0 +++\n", getppid()); + + /* + * Make the process group orphaned. + */ + return 0; +} diff --git a/tests/orphaned_process_group.gen.test b/tests/orphaned_process_group.gen.test new file mode 100755 index 00000000..c000fd5f --- /dev/null +++ b/tests/orphaned_process_group.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (orphaned_process_group . "${srcdir=.}/PTRACE_SEIZE.sh"; run_strace_match_diff -f -e trace=none -e signal='!chld'); do not edit. +. "${srcdir=.}/init.sh" +. "${srcdir=.}/PTRACE_SEIZE.sh"; run_strace_match_diff -f -e trace=none -e signal='!chld' diff --git a/tests/osf_utimes.c b/tests/osf_utimes.c new file mode 100644 index 00000000..d721e394 --- /dev/null +++ b/tests/osf_utimes.c @@ -0,0 +1,25 @@ +/* + * Check decoding of osf_utimes syscall. + * + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_osf_utimes + +# define TEST_SYSCALL_NR __NR_osf_utimes +# define TEST_SYSCALL_STR "osf_utimes" +# define TEST_STRUCT struct timeval32 +struct timeval32 { int tv_sec, tv_usec; }; +# include "xutimes.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_osf_utimes") + +#endif diff --git a/tests/osf_utimes.gen.test b/tests/osf_utimes.gen.test new file mode 100755 index 00000000..9e683b47 --- /dev/null +++ b/tests/osf_utimes.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (osf_utimes -a21 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests/overflowuid.c b/tests/overflowuid.c index a3c742b4..6a7a8f93 100644 --- a/tests/overflowuid.c +++ b/tests/overflowuid.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2014-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/pause.c b/tests/pause.c index 86873620..0260a6bc 100644 --- a/tests/pause.c +++ b/tests/pause.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015-2016 Dmitry V. Levin * Copyright (c) 2016 Fei Jie + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/pause.gen.test b/tests/pause.gen.test new file mode 100755 index 00000000..76492b6c --- /dev/null +++ b/tests/pause.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pause -a8 -esignal=none); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a8 -esignal=none diff --git a/tests/pause.test b/tests/pause.test deleted file mode 100755 index c5fdacde..00000000 --- a/tests/pause.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of pause syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a8 -esignal=none diff --git a/tests/pc.c b/tests/pc.c index f53acd45..0bc28d18 100644 --- a/tests/pc.c +++ b/tests/pc.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/pc.test b/tests/pc.test index beadb7d7..40221e57 100755 --- a/tests/pc.test +++ b/tests/pc.test @@ -3,29 +3,10 @@ # Check -i option. # # Copyright (c) 2015 Dmitry V. Levin +# Copyright (c) 2015-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -47,15 +28,11 @@ addr="$(echo "$ip" |sed -r 's/^0+//')" && [ -n "$addr" ] || dump_log_and_fail_with -EXPECTED="$LOG.expected" -cat > "$EXPECTED" << __EOF__ +cat > "$EXP" << __EOF__ \\[[[:xdigit:]]{$len}\\] munmap\\(0x[[:xdigit:]]+, 0\\) += -1 .* \\[pid +$pid\\] \\[$ip\\] --- SIGSEGV \\{si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x$addr\\} --- \\[pid +$pid\\] \\[\\?{$len}\\] \\+\\+\\+ killed by SIGSEGV( \\(core dumped\\))? \\+\\+\\+ \\[\\?{$len}\\] \\+\\+\\+ exited with 0 \\+\\+\\+ __EOF__ -match_grep "$LOG" "$EXPECTED" -rm -f "$EXPECTED" - -exit 0 +match_grep "$LOG" "$EXP" diff --git a/tests/perf_event_open.c b/tests/perf_event_open.c index 0ffea292..ae38b6de 100644 --- a/tests/perf_event_open.c +++ b/tests/perf_event_open.c @@ -2,29 +2,10 @@ * Check verbose decoding of perf_event_open syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -34,7 +15,6 @@ # include # include -# include # include # include # include @@ -72,36 +52,37 @@ struct u64_val_str { const char *str; }; -/* In order to avoid endianess-specific hackery */ +/* In order to avoid endianness-specific hackery. */ struct pea_flags { - uint64_t disabled :1, - inherit :1, - pinned :1, - exclusive :1, - exclude_user :1, - exclude_kernel :1, - exclude_hv :1, - exclude_idle :1, - mmap :1, - comm :1, - freq :1, - inherit_stat :1, - enable_on_exec :1, - task :1, - watermark :1, - precise_ip :2, - mmap_data :1, - sample_id_all :1, - exclude_host :1, - exclude_guest :1, - exclude_callchain_kernel :1, - exclude_callchain_user :1, - mmap2 :1, - comm_exec :1, - use_clockid :1, - context_switch :1, - write_backward :1, - __reserved_1 :36; + uint64_t disabled :1, + inherit :1, + pinned :1, + exclusive :1, + exclude_user :1, + exclude_kernel :1, + exclude_hv :1, + exclude_idle :1, + mmap :1, + comm :1, + freq :1, + inherit_stat :1, + enable_on_exec :1, + task :1, + watermark :1, + precise_ip :2, + mmap_data :1, + sample_id_all :1, + exclude_host :1, + exclude_guest :1, + exclude_callchain_kernel :1, + exclude_callchain_user :1, + mmap2 :1, + comm_exec :1, + use_clockid :1, + context_switch :1, + write_backward :1, + namespaces :1, + __reserved_1 :35; }; static const char * @@ -255,104 +236,112 @@ print_event_attr(struct perf_event_attr *attr_ptr, size_t size, flags_data.raw = ((uint64_t *) attr)[5]; val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_PRECISE_IP +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_PRECISE_IP attr->precise_ip; -# else +# else flags_data.flags.precise_ip; -# endif +# endif printf(", precise_ip=%" PRIu64 " /* %s */", val, precise_ip_desc); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP_DATA +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP_DATA attr->mmap_data; -# else +# else flags_data.flags.mmap_data; -# endif +# endif printf(", mmap_data=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_ID_ALL +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_ID_ALL attr->sample_id_all; -# else +# else flags_data.flags.sample_id_all; -# endif +# endif printf(", sample_id_all=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_HOST +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_HOST attr->exclude_host; -# else +# else flags_data.flags.exclude_host; -# endif +# endif printf(", exclude_host=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_GUEST +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_GUEST attr->exclude_guest; -# else +# else flags_data.flags.exclude_guest; -# endif +# endif printf(", exclude_guest=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_KERNEL +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_KERNEL attr->exclude_callchain_kernel; -# else +# else flags_data.flags.exclude_callchain_kernel; -# endif +# endif printf(", exclude_callchain_kernel=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_USER +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_EXCLUDE_CALLCHAIN_USER attr->exclude_callchain_user; -# else +# else flags_data.flags.exclude_callchain_user; -# endif +# endif printf(", exclude_callchain_user=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP2 +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP2 attr->mmap2; -# else +# else flags_data.flags.mmap2; -# endif +# endif printf(", mmap2=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_COMM_EXEC +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_COMM_EXEC attr->comm_exec; -# else +# else flags_data.flags.comm_exec; -# endif +# endif printf(", comm_exec=%" PRIu64, val); use_clockid = val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_USE_CLOCKID +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_USE_CLOCKID attr->use_clockid; -# else +# else flags_data.flags.use_clockid; -# endif +# endif printf(", use_clockid=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONTEXT_SWITCH +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONTEXT_SWITCH attr->context_switch; -# else +# else flags_data.flags.context_switch; -# endif +# endif printf(", context_switch=%" PRIu64, val); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_WRITE_BACKWARD +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_WRITE_BACKWARD attr->write_backward; -# else +# else flags_data.flags.write_backward; -# endif +# endif printf(", write_backward=%" PRIu64, val); + val = +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_NAMESPACES + attr->namespaces; +# else + flags_data.flags.namespaces; +# endif + printf(", namespaces=%" PRIu64, val); + val = flags_data.flags.__reserved_1; if (val) - printf(", __reserved_1=%#" PRIx64 " /* Bits 63..28 */", val); + printf(", __reserved_1=%#" PRIx64 " /* Bits 63..29 */", val); printf(", %s=%u", attr->watermark ? "wakeup_watermark" : "wakeup_events", @@ -362,11 +351,11 @@ print_event_attr(struct perf_event_attr *attr_ptr, size_t size, printf(", bp_type=%s", bp_type); val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG1 +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG1 attr->config1; -# else +# else ((uint64_t *) attr)[56 / sizeof(uint64_t)]; -# endif +# endif printf(", %s=%#" PRIx64, attr->type == PERF_TYPE_BREAKPOINT ? "bp_addr" : "config1", val); @@ -378,11 +367,11 @@ print_event_attr(struct perf_event_attr *attr_ptr, size_t size, } val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG2 +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_CONFIG2 attr->config2; -# else +# else ((uint64_t *) attr)[64 / sizeof(uint64_t)]; -# endif +# endif if (attr->type == PERF_TYPE_BREAKPOINT) printf(", bp_len=%" PRIu64, val); else @@ -408,11 +397,11 @@ print_event_attr(struct perf_event_attr *attr_ptr, size_t size, } val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_USER +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_USER attr->sample_regs_user; -# else +# else ((uint64_t *) attr)[80 / sizeof(uint64_t)]; -# endif +# endif printf(", sample_regs_user=%#" PRIx64, val); if (size <= 88) { @@ -421,11 +410,11 @@ print_event_attr(struct perf_event_attr *attr_ptr, size_t size, } val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_STACK_USER +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_STACK_USER attr->sample_stack_user; -# else +# else ((uint32_t *) attr)[88 / sizeof(uint32_t)]; -# endif +# endif /* * Print branch sample type only in case PERF_SAMPLE_STACK_USER * is set in the sample_type field. @@ -448,42 +437,42 @@ print_event_attr(struct perf_event_attr *attr_ptr, size_t size, } val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_INTR +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_REGS_INTR attr->sample_regs_intr; -# else +# else ((uint64_t *) attr)[96 / sizeof(uint64_t)]; -# endif +# endif printf(", sample_regs_intr=%#" PRIx64, val); /* End of version 4 of the structure */ if (size <= 104) { - cutoff =104; + cutoff = 104; goto end; } val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_AUX_WATERMARK +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_AUX_WATERMARK attr->aux_watermark; -# else +# else ((uint32_t *) attr)[104 / sizeof(uint32_t)]; -# endif +# endif printf(", aux_watermark=%" PRIu32, (uint32_t) val); if (size <= 108) { - cutoff =108; + cutoff = 108; goto end; } val = -# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_MAX_STACK +# ifdef HAVE_STRUCT_PERF_EVENT_ATTR_SAMPLE_MAX_STACK attr->sample_max_stack; -# else +# else ((uint16_t *) attr)[108 / sizeof(uint16_t)]; -# endif +# endif printf(", sample_max_stack=%" PRIu16, (uint16_t) val); if (size <= 110) { - cutoff =110; + cutoff = 110; goto end; } @@ -522,7 +511,8 @@ end: "PERF_SAMPLE_BRANCH_IND_JUMP|" \ "PERF_SAMPLE_BRANCH_CALL|" \ "PERF_SAMPLE_BRANCH_NO_FLAGS|" \ - "PERF_SAMPLE_BRANCH_NO_CYCLES" + "PERF_SAMPLE_BRANCH_NO_CYCLES|" \ + "PERF_SAMPLE_BRANCH_TYPE_SAVE" int main(void) @@ -607,7 +597,7 @@ main(void) static const struct u64_val_str sample_types[] = { { ARG_STR(0) }, { 0x800, "PERF_SAMPLE_BRANCH_STACK" }, - { ARG_ULL_STR(0xdeadc0deda780000) " /* PERF_SAMPLE_??? */" }, + { ARG_ULL_STR(0xdeadc0deda700000) " /* PERF_SAMPLE_??? */" }, { 0xffffffffffffffffULL, "PERF_SAMPLE_IP|PERF_SAMPLE_TID|PERF_SAMPLE_TIME|" "PERF_SAMPLE_ADDR|PERF_SAMPLE_READ|" @@ -617,7 +607,8 @@ main(void) "PERF_SAMPLE_REGS_USER|PERF_SAMPLE_STACK_USER|" "PERF_SAMPLE_WEIGHT|PERF_SAMPLE_DATA_SRC|" "PERF_SAMPLE_IDENTIFIER|PERF_SAMPLE_TRANSACTION|" - "PERF_SAMPLE_REGS_INTR|0xfffffffffff80000" }, + "PERF_SAMPLE_REGS_INTR|PERF_SAMPLE_PHYS_ADDR|" + "0xfffffffffff00000" }, }; static const struct u64_val_str read_formats[] = { { ARG_STR(0) }, @@ -649,11 +640,11 @@ main(void) static const struct u64_val_str branch_sample_types[] = { { ARG_STR(0) }, { 0x80, "PERF_SAMPLE_BRANCH_ABORT_TX" }, - { 0xffff, BRANCH_TYPE_ALL }, - { ARG_ULL_STR(0xdeadcaffeeed0000) + { 0x1ffff, BRANCH_TYPE_ALL }, + { ARG_ULL_STR(0xdeadcaffeeec0000) " /* PERF_SAMPLE_BRANCH_??? */" }, { 0xffffffffffffffffULL, - BRANCH_TYPE_ALL "|0xffffffffffff0000" } + BRANCH_TYPE_ALL "|0xfffffffffffe0000" } }; static const struct s32_val_str clockids[] = { { 11, "CLOCK_TAI" }, @@ -681,7 +672,7 @@ main(void) ATTR_REC(attr_big_size), }; - struct perf_event_attr *small_attr = tail_alloc(sizeof(*small_attr)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct perf_event_attr, small_attr); struct { struct perf_event_attr *attr; @@ -717,7 +708,7 @@ main(void) for (i = 0; i < ARRAY_SIZE(args); i++) { rc = syscall(__NR_perf_event_open, args[i].attr, args[i].pid, - args[i].cpu, args[i].group_fd, args[i].flags); + args[i].cpu, args[i].group_fd, args[i].flags); printf("perf_event_open(%s, %d, %d, %d, %s) = %s\n", printaddr(args[i].attr), args[i].pid, args[i].cpu, args[i].group_fd, args[i].flags_str, sprintrc(rc)); @@ -792,19 +783,19 @@ main(void) attr->size = 0; rc = syscall(__NR_perf_event_open, attr, args[args_idx].pid, - args[args_idx].cpu, args[args_idx].group_fd, - args[args_idx].flags); + args[args_idx].cpu, args[args_idx].group_fd, + args[args_idx].flags); printf("perf_event_open("); print_event_attr(attr, i ? ((i == 1) ? 0 : size) : size + 8, - attr_types[type_idx].str, - attr_configs[type_idx][config_idx].str, - sample_types[sample_type_idx].str, - read_formats[read_format_idx].str, - ip_desc_str, - bp_types[bp_type_idx].str, - branch_sample_types[branch_sample_type_idx].str, - clockids[clockid_idx].str, size); + attr_types[type_idx].str, + attr_configs[type_idx][config_idx].str, + sample_types[sample_type_idx].str, + read_formats[read_format_idx].str, + ip_desc_str, + bp_types[bp_type_idx].str, + branch_sample_types[branch_sample_type_idx].str, + clockids[clockid_idx].str, size); printf(", %d, %d, %d, %s) = %s\n", args[args_idx].pid, args[args_idx].cpu, args[args_idx].group_fd, args[args_idx].flags_str, sprintrc(rc)); diff --git a/tests/perf_event_open.gen.test b/tests/perf_event_open.gen.test new file mode 100755 index 00000000..02d468ab --- /dev/null +++ b/tests/perf_event_open.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (perf_event_open -a1 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a1 diff --git a/tests/perf_event_open.test b/tests/perf_event_open.test deleted file mode 100755 index 499134b4..00000000 --- a/tests/perf_event_open.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# Check perf_event_open syscall decoding. - -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a1 diff --git a/tests/perf_event_open_nonverbose.c b/tests/perf_event_open_nonverbose.c index 45d7c8f2..b87cb2c6 100644 --- a/tests/perf_event_open_nonverbose.c +++ b/tests/perf_event_open_nonverbose.c @@ -2,29 +2,10 @@ * Check decoding of perf_event_open syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -41,11 +22,11 @@ # include "xlat.h" # include "xlat/perf_event_open_flags.h" -#if ULONG_MAX > UINT_MAX -#define LONG_STR_PREFIX "ffffffff" -#else -#define LONG_STR_PREFIX "" -#endif +# if ULONG_MAX > UINT_MAX +# define LONG_STR_PREFIX "ffffffff" +# else +# define LONG_STR_PREFIX "" +# endif static const char *printaddr(void *ptr) { @@ -62,7 +43,7 @@ static const char *printaddr(void *ptr) int main(void) { - struct perf_event_attr *attr = tail_alloc(sizeof(*attr)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct perf_event_attr, attr); attr->type = PERF_TYPE_HARDWARE; attr->size = sizeof(*attr); diff --git a/tests/perf_event_open_nonverbose.gen.test b/tests/perf_event_open_nonverbose.gen.test new file mode 100755 index 00000000..f1ed333e --- /dev/null +++ b/tests/perf_event_open_nonverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (perf_event_open_nonverbose -a34 -e verbose=none -e trace=perf_event_open); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a34 -e verbose=none -e trace=perf_event_open diff --git a/tests/perf_event_open_nonverbose.test b/tests/perf_event_open_nonverbose.test deleted file mode 100755 index 404827fe..00000000 --- a/tests/perf_event_open_nonverbose.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of perf_event_open syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a34 -e verbose=none -e trace=perf_event_open diff --git a/tests/perf_event_open_unabbrev.gen.test b/tests/perf_event_open_unabbrev.gen.test new file mode 100755 index 00000000..1d9bd851 --- /dev/null +++ b/tests/perf_event_open_unabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (perf_event_open_unabbrev -a1 -v -e trace=perf_event_open); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a1 -v -e trace=perf_event_open diff --git a/tests/perf_event_open_unabbrev.test b/tests/perf_event_open_unabbrev.test deleted file mode 100755 index f17fd17e..00000000 --- a/tests/perf_event_open_unabbrev.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# Check perf_event_open syscall decoding. - -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a1 -v -e trace=perf_event_open diff --git a/tests/personality-Xabbrev.c b/tests/personality-Xabbrev.c new file mode 100644 index 00000000..2e993dc1 --- /dev/null +++ b/tests/personality-Xabbrev.c @@ -0,0 +1 @@ +#include "personality.c" diff --git a/tests/personality-Xabbrev.gen.test b/tests/personality-Xabbrev.gen.test new file mode 100755 index 00000000..df93e6cb --- /dev/null +++ b/tests/personality-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (personality-Xabbrev +personality.test -Xabbrev); do not edit. +set -- -Xabbrev +. "${srcdir=.}/personality.test" diff --git a/tests/personality-Xraw.c b/tests/personality-Xraw.c new file mode 100644 index 00000000..59702f8b --- /dev/null +++ b/tests/personality-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "personality.c" diff --git a/tests/personality-Xraw.gen.test b/tests/personality-Xraw.gen.test new file mode 100755 index 00000000..559f0f3a --- /dev/null +++ b/tests/personality-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (personality-Xraw +personality.test -a15 -Xraw); do not edit. +set -- -a15 -Xraw +. "${srcdir=.}/personality.test" diff --git a/tests/personality-Xverbose.c b/tests/personality-Xverbose.c new file mode 100644 index 00000000..545ebe71 --- /dev/null +++ b/tests/personality-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "personality.c" diff --git a/tests/personality-Xverbose.gen.test b/tests/personality-Xverbose.gen.test new file mode 100755 index 00000000..b6ce2094 --- /dev/null +++ b/tests/personality-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (personality-Xverbose +personality.test -Xverbose); do not edit. +set -- -Xverbose +. "${srcdir=.}/personality.test" diff --git a/tests/personality.c b/tests/personality.c index 7a279a14..5169c1d4 100644 --- a/tests/personality.c +++ b/tests/personality.c @@ -1,78 +1,84 @@ /* * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include #include +#if XLAT_RAW +# define linux_type_str "0" +# define good_type_str "0x6" +# define bad_type_str "0x1f" +# define good_flags_str "0x7000000" +# define bad_flags_str "0x10000" +# define good_bad_flags_str "0x7010000" +#elif XLAT_VERBOSE +# define linux_type_str "0 /\\* PER_LINUX \\*/" +# define good_type_str "0x6 /\\* PER_BSD \\*/" +# define bad_type_str "0x1f /\\* PER_\\?\\?\\? \\*/" +# define good_flags_str \ + "0x7000000 /\\* SHORT_INODE\\|WHOLE_SECONDS\\|STICKY_TIMEOUTS \\*/" +# define bad_flags_str "0x10000" +# define good_bad_flags_str \ + "0x7010000 /\\* SHORT_INODE\\|WHOLE_SECONDS\\|STICKY_TIMEOUTS" \ + "\\|0x10000 \\*/" +#else +# define linux_type_str "PER_LINUX" +# define good_type_str "PER_BSD" +# define bad_type_str "0x1f /\\* PER_\\?\\?\\? \\*/" +# define good_flags_str "SHORT_INODE\\|WHOLE_SECONDS\\|STICKY_TIMEOUTS" +# define bad_flags_str "0x10000" +# define good_bad_flags_str \ + "SHORT_INODE\\|WHOLE_SECONDS\\|STICKY_TIMEOUTS\\|0x10000" +#endif + 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); + printf("personality\\(%s\\) = %#x \\([^)]*\\)\n", + linux_type_str, saved_pers); personality(0xffffffff); - puts("personality\\(0xffffffff\\) = 0 \\(PER_LINUX\\)"); + printf("personality\\(0xffffffff\\) = 0 \\(%s\\)\n", linux_type_str); personality(good_flags); - printf("personality\\(PER_LINUX\\|%s\\) = 0 \\(PER_LINUX\\)\n", - good_flags_str); + printf("personality\\(%s\\|%s\\) = 0 \\(%s\\)\n", + linux_type_str, good_flags_str, linux_type_str); personality(bad_flags); - printf("personality\\(PER_LINUX\\|%s\\)" - " = %#x \\(PER_LINUX\\|%s\\)\n", - bad_flags_str, good_flags, good_flags_str); + printf("personality\\(%s\\|%s\\)" + " = %#x \\(%s\\|%s\\)\n", + linux_type_str, bad_flags_str, + good_flags, linux_type_str, 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); + printf("personality\\(%s\\|%s\\)" + " = %#x \\(%s\\|%s\\)\n", + linux_type_str, good_bad_flags_str, + bad_flags, linux_type_str, bad_flags_str); /* another valid type */ personality(good_type); - printf("personality\\(%s\\) = %#x \\(PER_LINUX\\|%s\\|%s\\)\n", + printf("personality\\(%s\\) = %#x \\(%s\\|%s\\)\n", good_type_str, good_flags | bad_flags, - good_flags_str, bad_flags_str); + linux_type_str, good_bad_flags_str); personality(good_type | good_flags); printf("personality\\(%s\\|%s\\) = %#x \\(%s\\)\n", @@ -84,16 +90,16 @@ int main(void) 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, + printf("personality\\(%s\\|%s\\) = %#x \\(%s\\|%s\\)\n", + good_type_str, good_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", + printf("personality\\(%s\\) = %#x \\(%s\\|%s\\)\n", bad_type_str, good_type | good_flags | bad_flags, - good_type_str, good_flags_str, bad_flags_str); + good_type_str, good_bad_flags_str); personality(bad_type | good_flags); printf("personality\\(%s\\|%s\\) = %#x \\(%s\\)\n", @@ -105,14 +111,14 @@ int main(void) 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, + printf("personality\\(%s\\|%s\\) = %#x \\(%s\\|%s\\)\n", + bad_type_str, good_bad_flags_str, bad_type | bad_flags, bad_type_str, bad_flags_str); personality(saved_pers); - printf("personality\\([^)]*\\) = %#x \\(%s\\|%s\\|%s\\)\n", + printf("personality\\([^)]*\\) = %#x \\(%s\\|%s\\)\n", bad_type | good_flags | bad_flags, - bad_type_str, good_flags_str, bad_flags_str); + bad_type_str, good_bad_flags_str); return 0; } diff --git a/tests/personality.test b/tests/personality.test index 8f8c0adb..6d2b65c7 100755 --- a/tests/personality.test +++ b/tests/personality.test @@ -1,12 +1,14 @@ #!/bin/sh - +# # Check personality syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog > /dev/null -run_strace -a20 -epersonality $args > "$OUT" -match_grep "$LOG" "$OUT" -rm -f "$OUT" - -exit 0 +run_strace -a20 -epersonality "$@" $args > "$EXP" +match_grep "$LOG" "$EXP" diff --git a/tests/pidfd_send_signal.c b/tests/pidfd_send_signal.c new file mode 100644 index 00000000..014e43de --- /dev/null +++ b/tests/pidfd_send_signal.c @@ -0,0 +1,71 @@ +/* + * Check decoding of pidfd_send_signal syscall. + * + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include "scno.h" + +#ifdef __NR_pidfd_send_signal + +# include +# include +# include + +static const char *errstr; + +static long +sys_pidfd_send_signal(int pidfd, int sig, const void *info, int flags) +{ + kernel_ulong_t fill = (kernel_ulong_t) 0xdefaced00000000ULL; + kernel_ulong_t arg1 = fill | (unsigned int) pidfd; + kernel_ulong_t arg2 = fill | (unsigned int) sig; + kernel_ulong_t arg3 = (unsigned long) info; + kernel_ulong_t arg4 = fill | (unsigned int) flags; + + long rc = syscall(__NR_pidfd_send_signal, arg1, arg2, arg3, arg4); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const char null_path[] = "/dev/null"; + + int fd = open(null_path, O_RDONLY); + if (fd < 0) + perror_msg_and_fail("open: %s", null_path); + + TAIL_ALLOC_OBJECT_CONST_PTR(siginfo_t, si); + const void *esi = (const void *) si + 1; + + sys_pidfd_send_signal(fd, SIGUSR1, esi, 0); + printf("pidfd_send_signal(%d, SIGUSR1, %p, 0) = %s\n", + fd, esi, errstr); + + si->si_signo = SIGUSR1; + si->si_code = SI_QUEUE; + + sys_pidfd_send_signal(fd, SIGUSR2, si, -1); + printf("pidfd_send_signal(%d, SIGUSR2, {si_signo=SIGUSR1" + ", si_code=SI_QUEUE, si_errno=%d, si_pid=%u, si_uid=%u" + ", si_value={int=%d, ptr=%p}}, %#x) = %s\n", + fd, si->si_errno, si->si_pid, si->si_uid, si->si_int, si->si_ptr, + -1U, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_pidfd_send_signal") + +#endif diff --git a/tests/pidfd_send_signal.gen.test b/tests/pidfd_send_signal.gen.test new file mode 100755 index 00000000..a1e8466c --- /dev/null +++ b/tests/pidfd_send_signal.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pidfd_send_signal ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/pipe.c b/tests/pipe.c index 41c7f215..bdfc7565 100644 --- a/tests/pipe.c +++ b/tests/pipe.c @@ -2,29 +2,10 @@ * Check decoding of pipe syscall. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/pipe.test b/tests/pipe.test index 0ae414d4..af70b08d 100755 --- a/tests/pipe.test +++ b/tests/pipe.test @@ -1,6 +1,12 @@ #!/bin/sh - +# # Check decoding of pipe syscall. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" run_prog diff --git a/tests/pipe2.c b/tests/pipe2.c index 375ae74f..d948a1c6 100644 --- a/tests/pipe2.c +++ b/tests/pipe2.c @@ -1,30 +1,10 @@ /* * Check decoding of pipe2 syscall. * - * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -39,18 +19,16 @@ int main(void) { - static const kernel_ulong_t bogus_zero = - (kernel_ulong_t) 0xffffffff00000000ULL; int *const fds = tail_alloc(sizeof(*fds) * 2); int *const efault = fds + 1; long rc; - rc = syscall(__NR_pipe2, fds, bogus_zero | O_NONBLOCK); + rc = syscall(__NR_pipe2, fds, F8ILL_KULONG_MASK | O_NONBLOCK); if (rc) perror_msg_and_skip("pipe2"); printf("pipe2([%d, %d], O_NONBLOCK) = 0\n", fds[0], fds[1]); - rc = syscall(__NR_pipe2, efault, bogus_zero); + rc = syscall(__NR_pipe2, efault, F8ILL_KULONG_MASK); printf("pipe2(%p, 0) = %s\n", efault, sprintrc(rc)); if (F8ILL_KULONG_SUPPORTED) { diff --git a/tests/pipe2.gen.test b/tests/pipe2.gen.test new file mode 100755 index 00000000..50b8fd64 --- /dev/null +++ b/tests/pipe2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pipe2 -a15 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests/pipe2.test b/tests/pipe2.test deleted file mode 100755 index aff6cd44..00000000 --- a/tests/pipe2.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of pipe2 syscall. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a15 diff --git a/tests/pipe_maxfd.c b/tests/pipe_maxfd.c index a1343f91..a4ec48c4 100644 --- a/tests/pipe_maxfd.c +++ b/tests/pipe_maxfd.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/pkey_alloc.c b/tests/pkey_alloc.c index 45772787..6a92be40 100644 --- a/tests/pkey_alloc.c +++ b/tests/pkey_alloc.c @@ -2,29 +2,10 @@ * Check decoding of pkey_alloc syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -53,10 +34,12 @@ main(void) sizeof(kernel_ulong_t) > sizeof(int) ? "PKEY_DISABLE_WRITE|0xbadc0ded00000000" : "PKEY_DISABLE_WRITE" }, - { 0xdec0ded, "PKEY_DISABLE_ACCESS|0xdec0dec" }, - { 0x3, "PKEY_DISABLE_ACCESS|PKEY_DISABLE_WRITE" }, + { 0xdec0ded, "PKEY_DISABLE_ACCESS|PKEY_DISABLE_EXECUTE|" + "0xdec0de8" }, + { 0x7, "PKEY_DISABLE_ACCESS|PKEY_DISABLE_WRITE|" + "PKEY_DISABLE_EXECUTE" }, { ARG_STR(0) }, - { 0xbadc0dec, "0xbadc0dec /* PKEY_??? */" }, + { 0xbadc0de8, "0xbadc0de8 /* PKEY_??? */" }, }; long rc; diff --git a/tests/pkey_alloc.gen.test b/tests/pkey_alloc.gen.test new file mode 100755 index 00000000..fb554efc --- /dev/null +++ b/tests/pkey_alloc.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pkey_alloc -a17 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests/pkey_alloc.test b/tests/pkey_alloc.test deleted file mode 100755 index f168c21a..00000000 --- a/tests/pkey_alloc.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of pkey_alloc syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a17 diff --git a/tests/pkey_free.c b/tests/pkey_free.c index 95a2ad26..7bcb3f9a 100644 --- a/tests/pkey_free.c +++ b/tests/pkey_free.c @@ -2,29 +2,10 @@ * Check decoding of pkey_free syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/pkey_free.gen.test b/tests/pkey_free.gen.test new file mode 100755 index 00000000..0374cc73 --- /dev/null +++ b/tests/pkey_free.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pkey_free -a13 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a13 diff --git a/tests/pkey_free.test b/tests/pkey_free.test deleted file mode 100755 index 9c01c3e7..00000000 --- a/tests/pkey_free.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of pkey_free syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a13 diff --git a/tests/pkey_mprotect.c b/tests/pkey_mprotect.c index 529abd1f..c9c96daa 100644 --- a/tests/pkey_mprotect.c +++ b/tests/pkey_mprotect.c @@ -2,29 +2,10 @@ * Check decoding of pkey_mprotect syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/pkey_mprotect.gen.test b/tests/pkey_mprotect.gen.test new file mode 100755 index 00000000..11a902a5 --- /dev/null +++ b/tests/pkey_mprotect.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pkey_mprotect -a37 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a37 diff --git a/tests/pkey_mprotect.test b/tests/pkey_mprotect.test deleted file mode 100755 index 922d4919..00000000 --- a/tests/pkey_mprotect.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of pkey_mprotect syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a37 diff --git a/tests/poll-P.c b/tests/poll-P.c new file mode 100644 index 00000000..7bbeb795 --- /dev/null +++ b/tests/poll-P.c @@ -0,0 +1,2 @@ +#define PATH_TRACING_FD 9 +#include "poll.c" diff --git a/tests/poll-P.test b/tests/poll-P.test new file mode 100755 index 00000000..8ba2d303 --- /dev/null +++ b/tests/poll-P.test @@ -0,0 +1,22 @@ +#!/bin/sh +# +# Check path tracing of poll syscall. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog > /dev/null +run_strace -a16 -vepoll -P /dev/full 9>>/dev/full \ + $args > "$EXP" +match_diff "$LOG" "$EXP" + +for abbrev in 0 1 2 3 4 5; do + run_prog "../$NAME" $abbrev > /dev/null + run_strace -a16 -epoll -s$abbrev -P /dev/full 9>>/dev/full \ + $args > "$EXP" + match_diff "$LOG" "$EXP" +done diff --git a/tests/poll.c b/tests/poll.c index c47c97e5..c08bee8e 100644 --- a/tests/poll.c +++ b/tests/poll.c @@ -1,30 +1,10 @@ /* - * This file is part of poll strace test. + * Check decoding of poll syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -37,15 +17,18 @@ # include # include # include +# include # include -#define PRINT_EVENT(flag, member) \ - if (member & flag) { \ - if (member != pfd->member) \ - tprintf("|"); \ - tprintf(#flag); \ - member &= ~flag; \ - } +# define PRINT_EVENT(flag, member) \ + do { \ + if (member & flag) { \ + if (member != pfd->member) \ + tprintf("|"); \ + tprintf(#flag); \ + member &= ~flag; \ + } \ + } while (0) static void print_pollfd_entering(const struct pollfd *const pfd) @@ -56,24 +39,24 @@ print_pollfd_entering(const struct pollfd *const pfd) short events = pfd->events; if (pfd->events) { - PRINT_EVENT(POLLIN, events) - PRINT_EVENT(POLLPRI, events) - PRINT_EVENT(POLLOUT, events) -#ifdef POLLRDNORM - PRINT_EVENT(POLLRDNORM, events) -#endif -#ifdef POLLWRNORM - PRINT_EVENT(POLLWRNORM, events) -#endif -#ifdef POLLRDBAND - PRINT_EVENT(POLLRDBAND, events) -#endif -#ifdef POLLWRBAND - PRINT_EVENT(POLLWRBAND, events) -#endif - PRINT_EVENT(POLLERR, events) - PRINT_EVENT(POLLHUP, events) - PRINT_EVENT(POLLNVAL, events) + PRINT_EVENT(POLLIN, events); + PRINT_EVENT(POLLPRI, events); + PRINT_EVENT(POLLOUT, events); +# ifdef POLLRDNORM + PRINT_EVENT(POLLRDNORM, events); +# endif +# ifdef POLLWRNORM + PRINT_EVENT(POLLWRNORM, events); +# endif +# ifdef POLLRDBAND + PRINT_EVENT(POLLRDBAND, events); +# endif +# ifdef POLLWRBAND + PRINT_EVENT(POLLWRBAND, events); +# endif + PRINT_EVENT(POLLERR, events); + PRINT_EVENT(POLLHUP, events); + PRINT_EVENT(POLLNVAL, events); } else tprintf("0"); } @@ -92,7 +75,7 @@ print_pollfd_array_entering(const struct pollfd *const pfd, if (i) tprintf(", "); if (i >= valid) { - tprintf("%p", &pfd[i]); + tprintf("... /* %p */", &pfd[i]); break; } if (i >= abbrev) { @@ -123,24 +106,24 @@ print_pollfd_exiting(const struct pollfd *const pfd, tprintf("{fd=%d, revents=", pfd->fd); short revents = pfd->revents; - PRINT_EVENT(POLLIN, revents) - PRINT_EVENT(POLLPRI, revents) - PRINT_EVENT(POLLOUT, revents) -#ifdef POLLRDNORM - PRINT_EVENT(POLLRDNORM, revents) -#endif -#ifdef POLLWRNORM - PRINT_EVENT(POLLWRNORM, revents) -#endif -#ifdef POLLRDBAND - PRINT_EVENT(POLLRDBAND, revents) -#endif -#ifdef POLLWRBAND - PRINT_EVENT(POLLWRBAND, revents) -#endif - PRINT_EVENT(POLLERR, revents) - PRINT_EVENT(POLLHUP, revents) - PRINT_EVENT(POLLNVAL, revents) + PRINT_EVENT(POLLIN, revents); + PRINT_EVENT(POLLPRI, revents); + PRINT_EVENT(POLLOUT, revents); +# ifdef POLLRDNORM + PRINT_EVENT(POLLRDNORM, revents); +# endif +# ifdef POLLWRNORM + PRINT_EVENT(POLLWRNORM, revents); +# endif +# ifdef POLLRDBAND + PRINT_EVENT(POLLRDBAND, revents); +# endif +# ifdef POLLWRBAND + PRINT_EVENT(POLLWRBAND, revents); +# endif + PRINT_EVENT(POLLERR, revents); + PRINT_EVENT(POLLHUP, revents); + PRINT_EVENT(POLLNVAL, revents); tprintf("}"); } @@ -160,12 +143,19 @@ print_pollfd_array_exiting(const struct pollfd *const pfd, int main(int ac, char **av) { +# ifdef PATH_TRACING_FD + skip_if_unavailable("/proc/self/fd/"); +# endif + tprintf("%s", ""); assert(syscall(__NR_poll, NULL, 42, 0) == -1); if (ENOSYS == errno) perror_msg_and_skip("poll"); + +# ifndef PATH_TRACING_FD tprintf("poll(NULL, 42, 0) = -1 EFAULT (%m)\n"); +# endif int fds[2]; if (pipe(fds) || pipe(fds)) @@ -184,17 +174,22 @@ main(int ac, char **av) int rc = syscall(__NR_poll, tail_fds0, 0, timeout); assert(rc == 0); +# ifndef PATH_TRACING_FD tprintf("poll([], 0, %d) = %d (Timeout)\n", timeout, rc); +# endif rc = syscall(__NR_poll, tail_fds0, ARRAY_SIZE(pfds0), timeout); assert(rc == 3); +# ifndef PATH_TRACING_FD tprintf("poll("); print_pollfd_array_entering(tail_fds0, ARRAY_SIZE(pfds0), ARRAY_SIZE(pfds0), abbrev); - tprintf(", %u, %d) = %d (", ARRAY_SIZE(pfds0), timeout, rc); + tprintf(", %u, %d) = %d (", + (unsigned int) ARRAY_SIZE(pfds0), timeout, rc); print_pollfd_array_exiting(tail_fds0, ARRAY_SIZE(pfds0), abbrev); tprintf(")\n"); +# endif /* !PATH_TRACING_FD */ tail_fds0[0].fd = -1; tail_fds0[2].fd = -3; @@ -202,24 +197,30 @@ main(int ac, char **av) rc = syscall(__NR_poll, tail_fds0, ARRAY_SIZE(pfds0), timeout); assert(rc == 2); +# ifndef PATH_TRACING_FD tprintf("poll("); print_pollfd_array_entering(tail_fds0, ARRAY_SIZE(pfds0), ARRAY_SIZE(pfds0), abbrev); - tprintf(", %u, %d) = %d (", ARRAY_SIZE(pfds0), timeout, rc); + tprintf(", %u, %d) = %d (", + (unsigned int) ARRAY_SIZE(pfds0), timeout, rc); print_pollfd_array_exiting(tail_fds0, ARRAY_SIZE(pfds0), abbrev); tprintf(")\n"); +# endif /* !PATH_TRACING_FD */ tail_fds0[1].fd = -2; tail_fds0[4].fd = -5; rc = syscall(__NR_poll, tail_fds0, ARRAY_SIZE(pfds0), timeout); assert(rc == 1); +# ifndef PATH_TRACING_FD tprintf("poll("); print_pollfd_array_entering(tail_fds0, ARRAY_SIZE(pfds0), ARRAY_SIZE(pfds0), abbrev); - tprintf(", %u, %d) = %d (", ARRAY_SIZE(pfds0), timeout, rc); + tprintf(", %u, %d) = %d (", + (unsigned int) ARRAY_SIZE(pfds0), timeout, rc); print_pollfd_array_exiting(tail_fds0, ARRAY_SIZE(pfds0), abbrev); tprintf(")\n"); +# endif /* !PATH_TRACING_FD */ struct pollfd pfds1[] = { { .fd = 1, .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, @@ -229,24 +230,58 @@ main(int ac, char **av) rc = syscall(__NR_poll, tail_fds1, ARRAY_SIZE(pfds1), timeout); assert(rc == 0); +# ifndef PATH_TRACING_FD tprintf("poll("); print_pollfd_array_entering(tail_fds1, ARRAY_SIZE(pfds1), ARRAY_SIZE(pfds1), abbrev); - tprintf(", %u, %d) = %d (Timeout)\n", ARRAY_SIZE(pfds1), timeout, rc); + tprintf(", %u, %d) = %d (Timeout)\n", + (unsigned int) ARRAY_SIZE(pfds1), timeout, rc); +# endif /* !PATH_TRACING_FD */ const void *const efault = tail_fds0 + ARRAY_SIZE(pfds0); rc = syscall(__NR_poll, efault, 1, 0); assert(rc == -1); + +# ifndef PATH_TRACING_FD tprintf("poll(%p, 1, 0) = -1 EFAULT (%m)\n", efault); +# endif const unsigned int valid = 1; const void *const epfds = tail_fds0 + ARRAY_SIZE(pfds0) - valid; rc = syscall(__NR_poll, epfds, valid + 1, 0); assert(rc == -1); + +# ifndef PATH_TRACING_FD + tprintf("poll("); + print_pollfd_array_entering(epfds, valid + 1, valid, abbrev); + errno = EFAULT; + tprintf(", %u, 0) = -1 EFAULT (%m)\n", valid + 1); +# endif /* !PATH_TRACING_FD */ + +# ifdef PATH_TRACING_FD + memcpy(tail_fds0, pfds0, sizeof(pfds0)); + tail_fds0[4].fd = PATH_TRACING_FD; + + rc = syscall(__NR_poll, tail_fds0, ARRAY_SIZE(pfds0), timeout); + assert(rc == 3); + + tprintf("poll("); + print_pollfd_array_entering(tail_fds0, ARRAY_SIZE(pfds0), + ARRAY_SIZE(pfds0), abbrev); + tprintf(", %u, %d) = %d (", + (unsigned int) ARRAY_SIZE(pfds0), timeout, rc); + print_pollfd_array_exiting(tail_fds0, ARRAY_SIZE(pfds0), abbrev); + tprintf(")\n"); + + rc = syscall(__NR_poll, epfds, valid + 1, 0); + assert(rc == -1); + + /* the 1st pollfd element is readable and contains PATH_TRACING_FD */ tprintf("poll("); print_pollfd_array_entering(epfds, valid + 1, valid, abbrev); errno = EFAULT; tprintf(", %u, 0) = -1 EFAULT (%m)\n", valid + 1); +# endif /* PATH_TRACING_FD */ tprintf("+++ exited with 0 +++\n"); return 0; diff --git a/tests/poll.test b/tests/poll.test index b74be29e..0e8691e2 100755 --- a/tests/poll.test +++ b/tests/poll.test @@ -1,17 +1,20 @@ #!/bin/sh - +# # Check poll syscall decoding. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog > /dev/null -run_strace -a16 -vepoll $args > "$OUT" -match_diff "$LOG" "$OUT" +run_strace -a16 -vepoll $args > "$EXP" +match_diff "$LOG" "$EXP" for abbrev in 0 1 2 3 4 5; do - run_prog "./$NAME" $abbrev > /dev/null - run_strace -a16 -epoll -s$abbrev $args > "$OUT" - match_diff "$LOG" "$OUT" + run_prog "../$NAME" $abbrev > /dev/null + run_strace -a16 -epoll -s$abbrev $args > "$EXP" + match_diff "$LOG" "$EXP" done - -rm -f "$OUT" diff --git a/tests/ppoll-P.c b/tests/ppoll-P.c new file mode 100644 index 00000000..c2c572e2 --- /dev/null +++ b/tests/ppoll-P.c @@ -0,0 +1,2 @@ +#define PATH_TRACING_FD 9 +#include "ppoll.c" diff --git a/tests/ppoll-P.gen.test b/tests/ppoll-P.gen.test new file mode 100755 index 00000000..25a97048 --- /dev/null +++ b/tests/ppoll-P.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ppoll-P -s2 -e trace=ppoll -P /dev/full 9>>/dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s2 -e trace=ppoll -P /dev/full 9>>/dev/full diff --git a/tests/ppoll-v.c b/tests/ppoll-v.c new file mode 100644 index 00000000..cf4fdea7 --- /dev/null +++ b/tests/ppoll-v.c @@ -0,0 +1,3 @@ +/* This file is part of ppoll-v strace test. */ +#define VERBOSE 1 +#include "ppoll.c" diff --git a/tests/ppoll-v.expected b/tests/ppoll-v.expected deleted file mode 100644 index 31070ad1..00000000 --- a/tests/ppoll-v.expected +++ /dev/null @@ -1,3 +0,0 @@ -ppoll\(\[\{fd=0, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=1, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}, \{fd=3, events=POLLIN\|POLLPRI\}, \{fd=4, events=POLLOUT\}\], 4, \{tv_sec=42, tv_nsec=999999999\}, \[(USR2 CHLD|CHLD USR2)\], (4|8|16)\) = 2 \(\[\{fd=1, revents=POLLOUT(\|POLLWRNORM)?\}, \{fd=4, revents=POLLOUT\}\], left \{tv_sec=42, tv_nsec=9[0-9]{8}\}\) -ppoll\(\[\{fd=1, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=0, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}\], 2, \{tv_sec=0, tv_nsec=999\}, ~\[HUP KILL STOP[^]]*\], (4|8|16)\) = 0 \(Timeout\) -ppoll\(NULL, 42, NULL, NULL, (4|8|16)\) = -1 EFAULT .* diff --git a/tests/ppoll-v.gen.test b/tests/ppoll-v.gen.test new file mode 100755 index 00000000..cd1fcc60 --- /dev/null +++ b/tests/ppoll-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ppoll-v -v -s2 -e trace=ppoll); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -s2 -e trace=ppoll diff --git a/tests/ppoll.c b/tests/ppoll.c index 46d7e816..e7a4474f 100644 --- a/tests/ppoll.c +++ b/tests/ppoll.c @@ -1,94 +1,221 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin - * All rights reserved. + * Check decoding of ppoll syscall. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" -#include -#include -#include -#include +#include + +#ifdef __NR_ppoll + +# include +# include +# include +# include +# include +# include + +static const char *errstr; -static void -test1(void) +static long +sys_ppoll(const kernel_ulong_t ufds, + const kernel_ulong_t nfds, + const kernel_ulong_t tsp, + const kernel_ulong_t sigmask, + const kernel_ulong_t sigsetsize) { - const struct timespec timeout = { .tv_sec = 42, .tv_nsec = 999999999 }; - struct pollfd fds[] = { - { .fd = 0, .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, - { .fd = 1, .events = POLLOUT | POLLWRNORM | POLLWRBAND }, - { .fd = 3, .events = POLLIN | POLLPRI }, - { .fd = 4, .events = POLLOUT } - }; + long rc = syscall(__NR_ppoll, ufds, nfds, tsp, sigmask, sigsetsize); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ +# ifdef PATH_TRACING_FD + skip_if_unavailable("/proc/self/fd/"); +# endif + static const kernel_ulong_t bogus_nfds = + (kernel_ulong_t) 0xdeadbeeffacefeedULL; + static const kernel_ulong_t bogus_sigsetsize = + (kernel_ulong_t) 0xdeadbeefbadc0dedULL; + static const char *const POLLWRNORM_str = + (POLLWRNORM == POLLOUT) ? "" : "|POLLWRNORM"; + static const char *const USR2_CHLD_str = + (SIGUSR2 < SIGCHLD) ? "USR2 CHLD" : "CHLD USR2"; + void *const efault = tail_alloc(1024) + 1024; + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, ts); + const unsigned int sigset_size = get_sigset_size(); + void *const sigmask = tail_alloc(sigset_size); + struct pollfd *fds; sigset_t mask; + int pipe_fd[4]; + long rc; + + sys_ppoll(0, bogus_nfds, 0, 0, bogus_sigsetsize); + if (ENOSYS == errno) + perror_msg_and_skip("ppoll"); +# ifndef PATH_TRACING_FD + printf("ppoll(NULL, %u, NULL, NULL, %llu) = %s\n", + (unsigned) bogus_nfds, (unsigned long long) bogus_sigsetsize, + errstr); +# endif + + sys_ppoll((unsigned long) efault, 42, (unsigned long) efault + 8, + (unsigned long) efault + 16, sigset_size); +# ifndef PATH_TRACING_FD + printf("ppoll(%p, %u, %p, %p, %u) = %s\n", + efault, 42, efault + 8, efault + 16, sigset_size, errstr); +# endif + + ts->tv_sec = 0xdeadbeefU; + ts->tv_nsec = 0xfacefeedU; + sys_ppoll(0, 0, (unsigned long) ts, 0, sigset_size); +# ifndef PATH_TRACING_FD + printf("ppoll(NULL, 0, {tv_sec=%lld, tv_nsec=%llu}, NULL, %u) = %s\n", + (long long) ts->tv_sec, zero_extend_signed_to_ull(ts->tv_nsec), + sigset_size, errstr); +# endif + + ts->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + ts->tv_nsec = (long) 0xbadc0dedfacefeedL; + sys_ppoll(0, 0, (unsigned long) ts, 0, sigset_size); +# ifndef PATH_TRACING_FD + printf("ppoll(NULL, 0, {tv_sec=%lld, tv_nsec=%llu}, NULL, %u) = %s\n", + (long long) ts->tv_sec, zero_extend_signed_to_ull(ts->tv_nsec), + sigset_size, errstr); +# endif + + if (pipe(pipe_fd) || pipe(pipe_fd + 2)) + perror_msg_and_fail("pipe"); + + ts->tv_sec = 42; + ts->tv_nsec = 999999999; + + const struct pollfd fds1[] = { + { .fd = pipe_fd[0], .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, + { .fd = pipe_fd[1], .events = POLLOUT | POLLWRNORM | POLLWRBAND }, + { .fd = pipe_fd[2], .events = POLLIN | POLLPRI }, + { .fd = pipe_fd[3], .events = POLLOUT } + }; + fds = efault - sizeof(fds1); + memcpy(fds, fds1, sizeof(fds1)); + sigemptyset(&mask); sigaddset(&mask, SIGUSR2); sigaddset(&mask, SIGCHLD); + memcpy(sigmask, &mask, sigset_size); - int rc = ppoll(fds, sizeof(fds) / sizeof(*fds), &timeout, &mask); - if (rc < 0) - perror_msg_and_skip("ppoll"); - assert(rc == 2); -} + rc = sys_ppoll((unsigned long) fds, + F8ILL_KULONG_MASK | ARRAY_SIZE(fds1), (unsigned long) ts, + (unsigned long) sigmask, sigset_size); + if (rc != 2) + perror_msg_and_fail("ppoll 1"); +# ifndef PATH_TRACING_FD + printf("ppoll([{fd=%d, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}" + ", {fd=%d, events=POLLOUT%s|POLLWRBAND}" +# if VERBOSE + ", {fd=%d, events=POLLIN|POLLPRI}, {fd=%d, events=POLLOUT}]" +# else + ", ...]" +# endif + ", %u, {tv_sec=42, tv_nsec=999999999}, [%s], %u) = %ld" + " ([{fd=%d, revents=POLLOUT%s}, {fd=%d, revents=POLLOUT}]" + ", left {tv_sec=%u, tv_nsec=%u})\n", + pipe_fd[0], pipe_fd[1], POLLWRNORM_str, +# if VERBOSE + pipe_fd[2], pipe_fd[3], +# endif + (unsigned int) ARRAY_SIZE(fds1), USR2_CHLD_str, + (unsigned int) sigset_size, rc, pipe_fd[1], POLLWRNORM_str, + pipe_fd[3], (unsigned int) ts->tv_sec, + (unsigned int) ts->tv_nsec); +# endif /* !PATH_TRACING_FD */ -static void -test2(void) -{ - const struct timespec timeout = { .tv_sec = 0, .tv_nsec = 999 }; - struct pollfd fds[] = { - { .fd = 1, .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, - { .fd = 0, .events = POLLOUT | POLLWRNORM | POLLWRBAND } +# ifdef PATH_TRACING_FD + ts->tv_sec = 123; + ts->tv_nsec = 987654321; + fds[3].fd = PATH_TRACING_FD; + + rc = sys_ppoll((unsigned long) fds, + F8ILL_KULONG_MASK | ARRAY_SIZE(fds1), (unsigned long) ts, + (unsigned long) sigmask, sigset_size); + if (rc != 2) + perror_msg_and_fail("ppoll -P"); + printf("ppoll([{fd=%d, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}" + ", {fd=%d, events=POLLOUT%s|POLLWRBAND}" +# if VERBOSE + ", {fd=%d, events=POLLIN|POLLPRI}, {fd=%d, events=POLLOUT}]" +# else + ", ...]" +# endif + ", %u, {tv_sec=123, tv_nsec=987654321}, [%s], %u) = %ld" + " ([{fd=%d, revents=POLLOUT%s}, {fd=%d, revents=POLLOUT}]" + ", left {tv_sec=%u, tv_nsec=%u})\n", + pipe_fd[0], pipe_fd[1], POLLWRNORM_str, +# if VERBOSE + pipe_fd[2], PATH_TRACING_FD, +# endif + (unsigned int) ARRAY_SIZE(fds1), USR2_CHLD_str, + (unsigned int) sigset_size, rc, pipe_fd[1], POLLWRNORM_str, + PATH_TRACING_FD, (unsigned int) ts->tv_sec, + (unsigned int) ts->tv_nsec); +# endif /* PATH_TRACING_FD */ + + ts->tv_sec = 0; + ts->tv_nsec = 999; + const struct pollfd fds2[] = { + { .fd = pipe_fd[1], .events = POLLIN | POLLPRI | POLLRDNORM | POLLRDBAND }, + { .fd = pipe_fd[0], .events = POLLOUT | POLLWRNORM | POLLWRBAND } }; + fds = efault - sizeof(fds2); + memcpy(fds, fds2, sizeof(fds2)); - sigset_t mask; - sigfillset(&mask); + memset(&mask, -1, sizeof(mask)); sigdelset(&mask, SIGHUP); sigdelset(&mask, SIGKILL); sigdelset(&mask, SIGSTOP); + memcpy(sigmask, &mask, sigset_size); - int rc = ppoll(fds, sizeof(fds) / sizeof(*fds), &timeout, &mask); - if (rc < 0) - perror_msg_and_skip("ppoll"); - assert(rc == 0); -} + rc = sys_ppoll((unsigned long) fds, + F8ILL_KULONG_MASK | ARRAY_SIZE(fds2), (unsigned long) ts, + (unsigned long) sigmask, sigset_size); + if (rc != 0) + perror_msg_and_fail("ppoll 2"); +# ifndef PATH_TRACING_FD + printf("ppoll([{fd=%d, events=POLLIN|POLLPRI|POLLRDNORM|POLLRDBAND}" + ", {fd=%d, events=POLLOUT%s|POLLWRBAND}], %u" + ", {tv_sec=0, tv_nsec=999}, ~[HUP KILL STOP], %u)" + " = %ld (Timeout)\n", + pipe_fd[1], pipe_fd[0], POLLWRNORM_str, + (unsigned) ARRAY_SIZE(fds2), sigset_size, rc); +# endif /* !PATH_TRACING_FD */ -int -main(void) -{ - int fds[2]; - - (void) close(0); - (void) close(1); - (void) close(3); - (void) close(4); - if (pipe(fds) || pipe(fds)) - perror_msg_and_fail("pipe"); + if (F8ILL_KULONG_SUPPORTED) { + sys_ppoll(f8ill_ptr_to_kulong(fds), ARRAY_SIZE(fds2), + f8ill_ptr_to_kulong(ts), f8ill_ptr_to_kulong(sigmask), + sigset_size); +# ifndef PATH_TRACING_FD + printf("ppoll(%#llx, %u, %#llx, %#llx, %u) = %s\n", + (unsigned long long) f8ill_ptr_to_kulong(fds), + (unsigned) ARRAY_SIZE(fds2), + (unsigned long long) f8ill_ptr_to_kulong(ts), + (unsigned long long) f8ill_ptr_to_kulong(sigmask), + (unsigned) sigset_size, errstr); +# endif /* !PATH_TRACING_FD */ + } - test1(); - test2(); - - assert(ppoll(NULL, 42, NULL, NULL) < 0); + puts("+++ exited with 0 +++"); return 0; } + +#else + +SKIP_MAIN_UNDEFINED("__NR_ppoll") + +#endif diff --git a/tests/ppoll.expected b/tests/ppoll.expected deleted file mode 100644 index c38a2062..00000000 --- a/tests/ppoll.expected +++ /dev/null @@ -1,3 +0,0 @@ -ppoll\(\[\{fd=0, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=1, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}, \.\.\.\], 4, \{tv_sec=42, tv_nsec=999999999\}, \[(USR2 CHLD|CHLD USR2)\], (4|8|16)\) = 2 \(\[\{fd=1, revents=POLLOUT(\|POLLWRNORM)?\}, \{fd=4, revents=POLLOUT\}\], left \{tv_sec=42, tv_nsec=9[0-9]{8}\}\) -ppoll\(\[\{fd=1, events=POLLIN\|POLLPRI\|POLLRDNORM\|POLLRDBAND\}, \{fd=0, events=POLLOUT(\|POLLWRNORM)?\|POLLWRBAND\}\], 2, \{tv_sec=0, tv_nsec=999\}, ~\[HUP KILL STOP[^]]*\], (4|8|16)\) = 0 \(Timeout\) -ppoll\(NULL, 42, NULL, NULL, (4|8|16)\) = -1 EFAULT .* diff --git a/tests/ppoll.gen.test b/tests/ppoll.gen.test new file mode 100755 index 00000000..120e9536 --- /dev/null +++ b/tests/ppoll.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ppoll -s2 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s2 diff --git a/tests/ppoll.test b/tests/ppoll.test deleted file mode 100755 index 98389ee6..00000000 --- a/tests/ppoll.test +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -# Check ppoll syscall decoding. - -. "${srcdir=.}/init.sh" - -run_prog -run_strace -a30 -s2 -e ppoll $args -match_grep -run_strace -a30 -v -s2 -e ppoll $args -match_grep "$LOG" "$srcdir/$NAME-v.expected" - -exit 0 diff --git a/tests/prctl-arg2-intptr.c b/tests/prctl-arg2-intptr.c index ee000ebe..be894270 100644 --- a/tests/prctl-arg2-intptr.c +++ b/tests/prctl-arg2-intptr.c @@ -4,29 +4,10 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -70,7 +51,7 @@ main(void) { 11, "PR_GET_FPEXC" }, }; - unsigned int *ptr = tail_alloc(sizeof(*ptr)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, ptr); long rc; unsigned int i; diff --git a/tests/prctl-arg2-intptr.test b/tests/prctl-arg2-intptr.test index bcef8065..feb5a2b9 100755 --- a/tests/prctl-arg2-intptr.test +++ b/tests/prctl-arg2-intptr.test @@ -1,7 +1,13 @@ #!/bin/sh - +# # Check decoding of prctl PR_GET_CHILD_SUBREAPER, PR_GET_ENDIAN, PR_GET_FPEMU, # and PR_GET_FPEXC operations. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" check_prog grep @@ -10,5 +16,3 @@ run_strace -a25 -eprctl $args > "$EXP" LC_ALL=C grep -Ev '^prctl\(PR_[GS]ET_([^CEF]|.[^HNP]|..[^DEI])' \ < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests/prctl-dumpable.c b/tests/prctl-dumpable.c index 1049bcee..7740d52a 100644 --- a/tests/prctl-dumpable.c +++ b/tests/prctl-dumpable.c @@ -3,36 +3,18 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include #include -#if defined __NR_prctl && defined PR_GET_DUMPABLE && defined PR_SET_DUMPABLE +#if defined __NR_prctl && defined PR_GET_DUMPABLE && defined PR_SET_DUMPABLE \ + && !defined __ia64__ # include # include @@ -101,6 +83,7 @@ main(void) #else -SKIP_MAIN_UNDEFINED("__NR_prctl && PR_GET_DUMPABLE && PR_SET_DUMPABLE") +SKIP_MAIN_UNDEFINED("__NR_prctl && PR_GET_DUMPABLE && PR_SET_DUMPABLE" + " && !__ia64__") #endif diff --git a/tests/prctl-dumpable.test b/tests/prctl-dumpable.test index 08acb8b9..8662f79c 100755 --- a/tests/prctl-dumpable.test +++ b/tests/prctl-dumpable.test @@ -1,6 +1,12 @@ #!/bin/sh - +# # Check decoding of prctl PR_GET_DUMPABLE and PR_SET_DUMPABLE operations. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" check_prog grep @@ -8,5 +14,3 @@ run_prog > /dev/null run_strace -a23 -eprctl $args > "$EXP" grep -v '^prctl(PR_[GS]ET_[^D][^U]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests/prctl-name.c b/tests/prctl-name.c index 308c275f..16d85911 100644 --- a/tests/prctl-name.c +++ b/tests/prctl-name.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/prctl-name.test b/tests/prctl-name.test index 071179c5..b19efc0f 100755 --- a/tests/prctl-name.test +++ b/tests/prctl-name.test @@ -1,6 +1,12 @@ #!/bin/sh - +# # Check decoding of prctl PR_GET_NAME/PR_SET_NAME operations. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" check_prog grep @@ -8,5 +14,3 @@ run_prog > /dev/null run_strace -a23 -eprctl $args > "$EXP" grep -v '^prctl(PR_GET_[^N][^A]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests/prctl-no-args.c b/tests/prctl-no-args.c index 57e1b733..8ce13d80 100644 --- a/tests/prctl-no-args.c +++ b/tests/prctl-no-args.c @@ -4,29 +4,10 @@ * PR_TASK_PERF_EVENTS_DISABLE, and PR_TASK_PERF_EVENTS_ENABLE. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -57,7 +38,7 @@ main(void) { 32, "PR_TASK_PERF_EVENTS_ENABLE" }, }; - unsigned int *ptr = tail_alloc(sizeof(*ptr)); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, ptr); unsigned int i; for (i = 0; i < ARRAY_SIZE(options); i++) { diff --git a/tests/prctl-no-args.test b/tests/prctl-no-args.test index ce8ca67b..72d0f525 100755 --- a/tests/prctl-no-args.test +++ b/tests/prctl-no-args.test @@ -1,8 +1,14 @@ #!/bin/sh - +# # Check decoding of prctl PR_GET_KEEPCAPS, PR_GET_SECCOMP, PR_GET_TIMERSLACK, # PR_GET_TIMING, PR_TASK_PERF_EVENTS_DISABLE, and PR_TASK_PERF_EVENTS_ENABLE # operations. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" check_prog grep @@ -10,5 +16,3 @@ run_prog > /dev/null run_strace -a21 -eprctl $args > "$EXP" grep -v '^prctl(PR_[GS]ET_[^KST][^EI][^CEM]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests/prctl-pdeathsig.c b/tests/prctl-pdeathsig.c index c1760307..6ffbbad7 100644 --- a/tests/prctl-pdeathsig.c +++ b/tests/prctl-pdeathsig.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 JingPiao Chen * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -44,7 +25,7 @@ main(void) static const kernel_ulong_t bogus_signal = (kernel_ulong_t) 0xbadc0deddeadfeedULL; - int *pdeathsig = tail_alloc(sizeof(*pdeathsig)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, pdeathsig); long rc; rc = syscall(__NR_prctl, PR_SET_PDEATHSIG, bogus_signal); diff --git a/tests/prctl-pdeathsig.test b/tests/prctl-pdeathsig.test index 2777503a..faa40dbb 100755 --- a/tests/prctl-pdeathsig.test +++ b/tests/prctl-pdeathsig.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check prctl PR_GET_PDEATHSIG PR_SET_PDEATHSIG decoding. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -9,5 +14,3 @@ run_prog > /dev/null run_strace -a30 -eprctl $args > "$EXP" grep -v '^prctl(PR_[GS]ET_[^P][^D]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests/prctl-seccomp-filter-v.c b/tests/prctl-seccomp-filter-v.c index 69316fbe..f29cfad6 100644 --- a/tests/prctl-seccomp-filter-v.c +++ b/tests/prctl-seccomp-filter-v.c @@ -2,29 +2,10 @@ * Check verbose decoding of prctl PR_SET_SECCOMP SECCOMP_MODE_FILTER. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,9 +21,7 @@ #ifdef HAVE_LINUX_SECCOMP_H # include #endif -#ifdef HAVE_LINUX_FILTER_H -# include -#endif +#include #if defined HAVE_PRCTL \ && defined PR_SET_NO_NEW_PRIVS \ @@ -52,23 +31,23 @@ && defined BPF_JUMP \ && defined BPF_STMT -#define SOCK_FILTER_ALLOW_SYSCALL(nr) \ +# define SOCK_FILTER_ALLOW_SYSCALL(nr) \ BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW) -#define SOCK_FILTER_DENY_SYSCALL(nr, err) \ +# define SOCK_FILTER_DENY_SYSCALL(nr, err) \ BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|(SECCOMP_RET_DATA & (err))) -#define SOCK_FILTER_KILL_PROCESS \ +# define SOCK_FILTER_KILL_PROCESS \ BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL) -#define PRINT_ALLOW_SYSCALL(nr) \ +# define PRINT_ALLOW_SYSCALL(nr) \ printf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW), ", \ __NR_ ## nr) -#define PRINT_DENY_SYSCALL(nr, err) \ +# define PRINT_DENY_SYSCALL(nr, err) \ printf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|%#x), ", \ __NR_ ## nr, err) @@ -115,7 +94,7 @@ main(void) PRINT_DENY_SYSCALL(sync, EBUSY), PRINT_DENY_SYSCALL(setsid, EPERM), - printf("BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL)"); + printf("BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL_THREAD)"); puts("]}) = 0"); puts("+++ exited with 0 +++"); diff --git a/tests/prctl-seccomp-filter-v.test b/tests/prctl-seccomp-filter-v.test index 44e4a782..9f94a66e 100755 --- a/tests/prctl-seccomp-filter-v.test +++ b/tests/prctl-seccomp-filter-v.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check verbose decoding of prctl PR_SET_SECCOMP SECCOMP_MODE_FILTER. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -9,5 +14,3 @@ run_prog > /dev/null run_strace -v -eprctl $args > "$EXP" grep -v '^prctl(PR_GET_' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests/prctl-seccomp-strict.c b/tests/prctl-seccomp-strict.c index a78f8173..0573126e 100644 --- a/tests/prctl-seccomp-strict.c +++ b/tests/prctl-seccomp-strict.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/prctl-seccomp-strict.test b/tests/prctl-seccomp-strict.test index 1f987df7..e7e23df2 100755 --- a/tests/prctl-seccomp-strict.test +++ b/tests/prctl-seccomp-strict.test @@ -1,11 +1,16 @@ #!/bin/sh - +# # Check how prctl PR_SET_SECCOMP SECCOMP_MODE_STRICT is decoded. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" check_prog grep -set -- "./$NAME" +set -- "../$NAME" "$@" > /dev/null || { case $? in 77) skip_ "$* exited with code 77" ;; @@ -16,4 +21,3 @@ set -- "./$NAME" run_strace -eprctl "$@" > "$EXP" grep -v '^prctl(PR_GET_' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" -rm -f "$EXP" "$OUT" diff --git a/tests/prctl-securebits.c b/tests/prctl-securebits.c index 741973af..5b32f5b5 100644 --- a/tests/prctl-securebits.c +++ b/tests/prctl-securebits.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/prctl-securebits.test b/tests/prctl-securebits.test index c91e62a6..e50dc2eb 100755 --- a/tests/prctl-securebits.test +++ b/tests/prctl-securebits.test @@ -1,6 +1,12 @@ #!/bin/sh - +# # Check decoding of prctl PR_GET_SECUREBITS/PR_SET_SECUREBITS operations. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" check_prog grep @@ -8,5 +14,3 @@ run_prog > /dev/null run_strace -a25 -eprctl $args > "$EXP" grep -v '^prctl(PR_[GS]ET_[^S][^E][^C][^U]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests/prctl-spec-inject.c b/tests/prctl-spec-inject.c new file mode 100644 index 00000000..3fa2df2d --- /dev/null +++ b/tests/prctl-spec-inject.c @@ -0,0 +1,148 @@ +/* + * Check decoding of PR_SET_SPECULATION_CTRL and PR_GET_SPECULATION_CTRL + * prctl operations. + * + * Copyright (c) 2018-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_prctl + +# include +# include +# include +# include + +static long injected_val; + +long +do_prctl(kernel_ulong_t cmd, kernel_ulong_t arg2, kernel_ulong_t arg3) +{ + long rc = syscall(__NR_prctl, cmd, arg2, arg3); + + if (rc != injected_val) + error_msg_and_fail("Return value (%ld) differs from expected " + "injected value (%ld)", + rc, injected_val); + + return rc; +} + +int +main(int argc, char **argv) +{ + static const kernel_ulong_t bogus_arg2 = + (kernel_ulong_t) 0xdeadfacebadc0dedULL; + static const kernel_ulong_t bogus_arg3 = + (kernel_ulong_t) 0xdecafeedbeefda7eULL; + + static const struct { + long arg; + const char *str; + } spec_strs[] = { + { 0, "PR_SPEC_STORE_BYPASS" }, + { 1, "PR_SPEC_INDIRECT_BRANCH" }, + }; + + static const struct { + long arg; + const char *str; + } get_strs[] = { + { -1, "" }, + { 0, " (PR_SPEC_NOT_AFFECTED)" }, + { 1, " (PR_SPEC_PRCTL)" }, + { 3, " (PR_SPEC_PRCTL|PR_SPEC_ENABLE)" }, + { 8, " (PR_SPEC_FORCE_DISABLE)" }, + { 16, " (PR_SPEC_DISABLE_NOEXEC)" }, + { 32, " (0x20)" }, + { 42, " (PR_SPEC_ENABLE|PR_SPEC_FORCE_DISABLE|0x20)" }, + }; + static const struct { + kernel_ulong_t arg; + const char *str; + } set_strs[] = { + { 0, "0 /* PR_SPEC_??? */" }, + { 1, "0x1 /* PR_SPEC_??? */" }, + { 2, "PR_SPEC_ENABLE" }, + { 3, "0x3 /* PR_SPEC_??? */" }, + { 8, "PR_SPEC_FORCE_DISABLE" }, + { 16, "PR_SPEC_DISABLE_NOEXEC" }, + { 32, "0x20 /* PR_SPEC_??? */" }, + { (kernel_ulong_t) 0xdecafeedbeefda7eULL, "0x" +# if SIZEOF_KERNEL_LONG_T == 8 + "decafeed" +# endif + "beefda7e /* PR_SPEC_??? */" }, + }; + + long rc; + const char *str = NULL; + + if (argc < 2) + error_msg_and_fail("Usage: %s INJECTED_VAL", argv[0]); + + injected_val = strtol(argv[1], NULL, 0); + + /* PR_GET_SPECULATION_CTRL */ + rc = do_prctl(52, 2, bogus_arg3); + printf("prctl(PR_GET_SPECULATION_CTRL, 0x2 /* PR_SPEC_??? */) " + "= %s (INJECTED)\n", sprintrc(rc)); + + rc = do_prctl(52, bogus_arg2, bogus_arg3); + printf("prctl(PR_GET_SPECULATION_CTRL, %#llx /* PR_SPEC_??? */) " + "= %s (INJECTED)\n", + (unsigned long long) bogus_arg2, sprintrc(rc)); + + for (unsigned c = 0; c < ARRAY_SIZE(spec_strs); c++) { + rc = do_prctl(52, spec_strs[c].arg, bogus_arg3); + + for (unsigned i = 0; i < ARRAY_SIZE(get_strs); i++) { + if (get_strs[i].arg == rc) { + str = get_strs[i].str; + break; + } + } + if (!str) + error_msg_and_fail("Unknown return value: %ld", rc); + + printf("prctl(PR_GET_SPECULATION_CTRL, %s) = %s%s (INJECTED)\n", + spec_strs[c].str, sprintrc(rc), str); + } + + + /* PR_SET_SPECULATION_CTRL*/ + rc = do_prctl(53, 2, bogus_arg3); + printf("prctl(PR_SET_SPECULATION_CTRL, 0x2 /* PR_SPEC_??? */, %#llx) " + "= %s (INJECTED)\n", + (unsigned long long) bogus_arg3, sprintrc(rc)); + + rc = do_prctl(53, bogus_arg2, bogus_arg3); + printf("prctl(PR_SET_SPECULATION_CTRL, %#llx /* PR_SPEC_??? */, %#llx) " + "= %s (INJECTED)\n", + (unsigned long long) bogus_arg2, + (unsigned long long) bogus_arg3, + sprintrc(rc)); + + for (unsigned c = 0; c < ARRAY_SIZE(spec_strs); c++) { + for (unsigned i = 0; i < ARRAY_SIZE(set_strs); i++) { + rc = do_prctl(53, spec_strs[c].arg, set_strs[i].arg); + printf("prctl(PR_SET_SPECULATION_CTRL, %s" + ", %s) = %s (INJECTED)\n", + spec_strs[c].str, set_strs[i].str, sprintrc(rc)); + } + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_prctl") + +#endif diff --git a/tests/prctl-spec-inject.test b/tests/prctl-spec-inject.test new file mode 100755 index 00000000..c86fc204 --- /dev/null +++ b/tests/prctl-spec-inject.test @@ -0,0 +1,35 @@ +#!/bin/sh -efu +# +# Check decoding of PR_SET_SPECULATION_CTRL and PR_GET_SPECULATION_CTRL +# prctl operations. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +fault_args='-a53 -e trace=prctl -e inject=prctl:' +prog="../$NAME" + +test_run_rval() +{ + local run rval injexpr + run="$1"; shift + rval="$1"; shift + injexpr="$1"; shift + + run_strace $fault_args$injexpr $prog $rval > "$EXP" + LC_ALL=C grep -Ev '^prctl\(PR_[GS]ET_([^S][^P][^E][^C]])' \ + < "$LOG" > "$OUT" + match_diff "$OUT" "$EXP" +} + +test_run_rval 0 -1 "error=ENOTTY" +test_run_rval 1 0 "retval=0" +test_run_rval 2 1 "retval=1" +test_run_rval 3 3 "retval=3" +test_run_rval 4 8 "retval=8" +test_run_rval 5 16 "retval=16" +test_run_rval 6 42 "retval=42" diff --git a/tests/prctl-tid_address.c b/tests/prctl-tid_address.c index 24e45031..9652f00d 100644 --- a/tests/prctl-tid_address.c +++ b/tests/prctl-tid_address.c @@ -2,29 +2,10 @@ * Check decoding of prctl PR_GET_TID_ADDRESS operation. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -59,7 +40,7 @@ main(void) (kernel_ulong_t) 0xfffffffffffffffdULL; /* Note that kernel puts kernel-sized pointer even on x32 */ - kernel_ulong_t *ptr = tail_alloc(sizeof(*ptr)); + TAIL_ALLOC_OBJECT_CONST_PTR(kernel_ulong_t, ptr); long rc; long set_ok; diff --git a/tests/prctl-tid_address.test b/tests/prctl-tid_address.test index dc7b7c32..f4a229f9 100755 --- a/tests/prctl-tid_address.test +++ b/tests/prctl-tid_address.test @@ -1,6 +1,12 @@ #!/bin/sh - +# # Check decoding of prctl PR_GET_TID_ADDRESS operation. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" check_prog grep @@ -8,5 +14,3 @@ run_prog > /dev/null run_strace -a23 -eprctl $args > "$EXP" LC_ALL=C grep -Ev '^prctl\(PR_[GS]ET_([^T]|.[^I]|..[^D])' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests/prctl-tsc.c b/tests/prctl-tsc.c index fd9362d7..0ac27ecd 100644 --- a/tests/prctl-tsc.c +++ b/tests/prctl-tsc.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 JingPiao Chen * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -43,7 +24,7 @@ main(void) static const kernel_ulong_t bogus_tsc = (kernel_ulong_t) 0xdeadc0defacebeefULL; - int *tsc = tail_alloc(sizeof(*tsc)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, tsc); long rc; rc = syscall(__NR_prctl, PR_SET_TSC, 0); diff --git a/tests/prctl-tsc.test b/tests/prctl-tsc.test index a906ba89..6dd891d6 100755 --- a/tests/prctl-tsc.test +++ b/tests/prctl-tsc.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check prctl PR_GET_TSC PR_SET_TSC decoding. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -9,5 +14,3 @@ run_prog > /dev/null run_strace -a24 -eprctl $args > "$EXP" grep -v '^prctl(PR_[GS]ET_[^T][^S]' < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" diff --git a/tests/pread64-pwrite64.c b/tests/pread64-pwrite64.c index 4a0932a9..83cb9bac 100644 --- a/tests/pread64-pwrite64.c +++ b/tests/pread64-pwrite64.c @@ -2,29 +2,10 @@ * Check decoding of pread64 and pwrite64 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -123,7 +104,9 @@ main(void) { tprintf("%s", ""); - static char tmp[] = "pread64-pwrite64-tmpfile"; + skip_if_unavailable("/proc/self/fd/"); + + static const char tmp[] = "pread64-pwrite64-tmpfile"; if (open(tmp, O_CREAT|O_RDONLY|O_TRUNC, 0600) != 0) perror_msg_and_fail("creat: %s", tmp); if (open(tmp, O_WRONLY) != 1) @@ -166,6 +149,7 @@ main(void) if (rc != -1) perror_msg_and_fail("pwrite64: expected -1, returned %ld", rc); tprintf("pwrite64(1, \"\\0\", 1, -3) = -1 EINVAL (%m)\n"); + dump_str(nil, 1); rc = pwrite(1, w, w_len, 0); if (rc != (int) w_len) diff --git a/tests/pread64-pwrite64.gen.test b/tests/pread64-pwrite64.gen.test new file mode 100755 index 00000000..b53e0697 --- /dev/null +++ b/tests/pread64-pwrite64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pread64-pwrite64 -a21 -eread=0 -ewrite=1 -e trace=pread64,pwrite64 -P pread64-pwrite64-tmpfile -P /dev/zero -P /dev/null); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 -eread=0 -ewrite=1 -e trace=pread64,pwrite64 -P pread64-pwrite64-tmpfile -P /dev/zero -P /dev/null diff --git a/tests/pread64-pwrite64.test b/tests/pread64-pwrite64.test deleted file mode 100755 index e585406d..00000000 --- a/tests/pread64-pwrite64.test +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# Check decoding and dumping of pread64 and pwrite64 syscalls. - -. "${srcdir=.}/init.sh" - -# strace -P is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - -tmpfile=pread64-pwrite64-tmpfile -> $tmpfile - -run_strace_match_diff \ - -a21 -eread=0 -ewrite=1 -e trace=pread64,pwrite64 \ - -P $tmpfile -P /dev/zero -P /dev/null - -rm -f $tmpfile diff --git a/tests/preadv-pwritev.c b/tests/preadv-pwritev.c index b2d2a824..abbe63d5 100644 --- a/tests/preadv-pwritev.c +++ b/tests/preadv-pwritev.c @@ -2,29 +2,10 @@ * Check decoding of preadv and pwritev syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -98,7 +79,7 @@ main(void) tprintf("pwritev(1, [], 0, 0) = 0\n"); rc = pwritev(1, w_iov + ARRAY_SIZE(w_iov_) - 1, 2, 0); - tprintf("pwritev(1, [{iov_base=\"%s\", iov_len=%u}, %p], 2, 0)" + tprintf("pwritev(1, [{iov_base=\"%s\", iov_len=%u}, ... /* %p */], 2, 0)" " = %ld %s (%m)\n", w2_c, LENGTH_OF(w2_c), w_iov + ARRAY_SIZE(w_iov_), rc, errno2name()); @@ -121,7 +102,7 @@ main(void) " * %u bytes in buffer 2\n" " | 00000 %-49s %-16s |\n", w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), - w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w_iov_), w_len, + w2_c, LENGTH_OF(w2_c), (unsigned int) ARRAY_SIZE(w_iov_), w_len, LENGTH_OF(w0_c), w0_d, w0_c, LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); @@ -142,7 +123,8 @@ main(void) tprintf("preadv(0, [{iov_base=\"%s\", iov_len=%u}], %u, 0) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + r0_c, r_len, (unsigned int) ARRAY_SIZE(r0_iov_), + r_len, r_len, r0_d, r0_c); void *r1 = tail_alloc(r_len); void *r2 = tail_alloc(w_len); @@ -166,7 +148,7 @@ main(void) ", {iov_base=\"\", iov_len=%u}], %u, %u) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), + r1_c, r_len, w_len, (unsigned int) ARRAY_SIZE(r1_iov_), r_len, w_len - r_len, w_len - r_len, r1_d, r1_c); close(0); diff --git a/tests/preadv-pwritev.gen.test b/tests/preadv-pwritev.gen.test new file mode 100755 index 00000000..5ed8297c --- /dev/null +++ b/tests/preadv-pwritev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (preadv-pwritev -a19 -eread=0 -ewrite=1 -e trace=preadv,pwritev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 -eread=0 -ewrite=1 -e trace=preadv,pwritev diff --git a/tests/preadv-pwritev.test b/tests/preadv-pwritev.test deleted file mode 100755 index cb2a0772..00000000 --- a/tests/preadv-pwritev.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding and dumping of preadv and pwritev syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a19 -eread=0 -ewrite=1 -e trace=preadv,pwritev diff --git a/tests/preadv.c b/tests/preadv.c index fb5d3ad7..3d1b504e 100644 --- a/tests/preadv.c +++ b/tests/preadv.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -66,7 +47,7 @@ main(void) { const off_t offset = 0xdefaceddeadbeefLL; char *buf = tail_alloc(LEN); - struct iovec *iov = tail_alloc(sizeof(*iov)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct iovec, iov); iov->iov_base = buf; iov->iov_len = LEN; @@ -124,7 +105,7 @@ main(void) perror_msg_and_fail("preadv: expected %u, returned %ld", r_len, rc); printf("preadv(%d, [{iov_base=\"%s\", iov_len=%u}], %u, 0) = %u\n", - fd, r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len); + fd, r0_c, r_len, (unsigned int) ARRAY_SIZE(r0_iov_), r_len); void *r1 = tail_alloc(r_len); void *r2 = tail_alloc(LENGTH_OF(w)); @@ -146,8 +127,9 @@ main(void) (int) LENGTH_OF(w) - r_len, rc); printf("preadv(%d, [{iov_base=\"%s\", iov_len=%u}" ", {iov_base=\"\", iov_len=%u}], %u, %u) = %u\n", - fd, r1_c, r_len, LENGTH_OF(w), ARRAY_SIZE(r1_iov_), - r_len, LENGTH_OF(w) - r_len); + fd, r1_c, r_len, LENGTH_OF(w), + (unsigned int) ARRAY_SIZE(r1_iov_), + r_len, LENGTH_OF(w) - r_len); puts("+++ exited with 0 +++"); return 0; diff --git a/tests/preadv.gen.test b/tests/preadv.gen.test new file mode 100755 index 00000000..c3fabe6f --- /dev/null +++ b/tests/preadv.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (preadv -a21 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests/preadv.test b/tests/preadv.test deleted file mode 100755 index d1abdb7d..00000000 --- a/tests/preadv.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check preadv syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a21 diff --git a/tests/preadv2-pwritev2.c b/tests/preadv2-pwritev2.c index f7c46c0a..1266562e 100644 --- a/tests/preadv2-pwritev2.c +++ b/tests/preadv2-pwritev2.c @@ -2,29 +2,10 @@ * Check decoding of preadv2 and pwritev2 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -103,7 +84,7 @@ dumpio(void) tprintf("pwritev2(1, [], 0, 0, 0) = 0\n"); rc = pw(1, w_iov + ARRAY_SIZE(w_iov_) - 1, 2, 0); - tprintf("pwritev2(1, [{iov_base=\"%s\", iov_len=%u}, %p], 2, 0, 0)" + tprintf("pwritev2(1, [{iov_base=\"%s\", iov_len=%u}, ... /* %p */], 2, 0, 0)" " = %ld %s (%m)\n", w2_c, LENGTH_OF(w2_c), w_iov + ARRAY_SIZE(w_iov_), rc, errno2name()); @@ -126,7 +107,7 @@ dumpio(void) " * %u bytes in buffer 2\n" " | 00000 %-49s %-16s |\n", w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), - w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w_iov_), w_len, + w2_c, LENGTH_OF(w2_c), (unsigned int) ARRAY_SIZE(w_iov_), w_len, LENGTH_OF(w0_c), w0_d, w0_c, LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); @@ -147,7 +128,8 @@ dumpio(void) tprintf("preadv2(0, [{iov_base=\"%s\", iov_len=%u}], %u, 0, 0) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + r0_c, r_len, (unsigned int) ARRAY_SIZE(r0_iov_), + r_len, r_len, r0_d, r0_c); void *r1 = tail_alloc(r_len); void *r2 = tail_alloc(w_len); @@ -171,7 +153,7 @@ dumpio(void) ", {iov_base=\"\", iov_len=%u}], %u, %u, 0) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), + r1_c, r_len, w_len, (unsigned int) ARRAY_SIZE(r1_iov_), r_len, w_len - r_len, w_len - r_len, r1_d, r1_c); close(0); @@ -181,28 +163,64 @@ int main(void) { const kernel_ulong_t vlen = (kernel_ulong_t) 0xfac1fed2dad3bef4ULL; - const unsigned long long pos = 0xfac5fed6dad7bef8; + const unsigned long long pos = 0x7ac5fed6dad7bef8; const kernel_ulong_t pos_l = (kernel_ulong_t) pos; - const kernel_ulong_t pos_h = - (sizeof(kernel_ulong_t) == sizeof(long long)) ? - (kernel_ulong_t) 0xbadc0deddeadbeefULL : 0xfac5fed6UL; - int test_dumpio = 1; + long rc; + bool skip_dumpio_test = false; tprintf("%s", ""); - syscall(__NR_preadv2, -1, NULL, vlen, pos_l, pos_h, 1); - if (ENOSYS == errno) - test_dumpio = 0; - tprintf("preadv2(-1, NULL, %lu, %lld, RWF_HIPRI) = -1 %s (%m)\n", - (unsigned long) vlen, pos, errno2name()); - - syscall(__NR_pwritev2, -1, NULL, vlen, pos_l, pos_h, 1); - if (ENOSYS == errno) - test_dumpio = 0; - tprintf("pwritev2(-1, NULL, %lu, %lld, RWF_HIPRI) = -1 %s (%m)\n", - (unsigned long) vlen, pos, errno2name()); - - if (test_dumpio) +# if defined __x86_64__ && defined __ILP32__ + /* + * x32 is the only architecture where preadv2 takes 5 arguments, + * see preadv64v2 in kernel sources. + */ + rc = syscall(__NR_preadv2, -1, NULL, vlen, pos_l, 1); +# else + const kernel_ulong_t pos_h = + (sizeof(pos_l) == sizeof(pos)) ? + (kernel_ulong_t) 0xbadc0deddeadbeefULL : + (kernel_ulong_t) (pos >> 32); + rc = syscall(__NR_preadv2, -1, NULL, vlen, pos_l, pos_h, 1); +# endif + if (rc != -1) + error_msg_and_fail("preadv2: expected -1, returned %ld", rc); + switch (errno) { + case ENOSYS: + skip_dumpio_test = true; + break; + case EBADF: + break; + default: + perror_msg_and_fail("preadv2"); + } + tprintf("preadv2(-1, NULL, %lu, %lld, RWF_HIPRI) = %s\n", + (unsigned long) vlen, pos, sprintrc(rc)); + +# if defined __x86_64__ && defined __ILP32__ + /* + * x32 is the only architecture where pwritev2 takes 5 arguments, + * see pwritev64v2 in kernel sources. + */ + rc = syscall(__NR_pwritev2, -1, NULL, vlen, pos_l, 1); +# else + rc = syscall(__NR_pwritev2, -1, NULL, vlen, pos_l, pos_h, 1); +# endif + if (rc != -1) + error_msg_and_fail("pwritev2: expected -1, returned %ld", rc); + switch (errno) { + case ENOSYS: + skip_dumpio_test = true; + break; + case EBADF: + break; + default: + perror_msg_and_fail("pwritev2"); + } + tprintf("pwritev2(-1, NULL, %lu, %lld, RWF_HIPRI) = %s\n", + (unsigned long) vlen, pos, sprintrc(rc)); + + if (!skip_dumpio_test) dumpio(); tprintf("%s\n", "+++ exited with 0 +++"); diff --git a/tests/preadv2-pwritev2.gen.test b/tests/preadv2-pwritev2.gen.test new file mode 100755 index 00000000..2f89b413 --- /dev/null +++ b/tests/preadv2-pwritev2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (preadv2-pwritev2 -a22 -eread=0 -ewrite=1 -e trace=preadv2,pwritev2); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -eread=0 -ewrite=1 -e trace=preadv2,pwritev2 diff --git a/tests/preadv2-pwritev2.test b/tests/preadv2-pwritev2.test deleted file mode 100755 index 5641ef46..00000000 --- a/tests/preadv2-pwritev2.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding and dumping of preadv2 and pwritev2 syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a22 -eread=0 -ewrite=1 -e trace=preadv2,pwritev2 diff --git a/tests/print_maxfd.c b/tests/print_maxfd.c index c3d4ea88..bb3ada40 100644 --- a/tests/print_maxfd.c +++ b/tests/print_maxfd.c @@ -1,30 +1,10 @@ /* * Print the maximum descriptor number available. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/print_quoted_string.c b/tests/print_quoted_string.c index 3ad86024..ba4b5ec2 100644 --- a/tests/print_quoted_string.c +++ b/tests/print_quoted_string.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -9,6 +16,12 @@ * Assumes instr is NUL-terminated. */ +void +print_quoted_string_ex(const char *instr, bool quote, const char *escape_chars) +{ + print_quoted_memory_ex(instr, strlen(instr), quote, escape_chars); +} + void print_quoted_string(const char *instr) { @@ -16,11 +29,62 @@ print_quoted_string(const char *instr) } void -print_quoted_memory(const char *instr, const size_t len) +print_quoted_cstring(const char *instr, const size_t size) +{ + const size_t len = strnlen(instr, size); + if (len < size) { + print_quoted_memory(instr, len); + } else { + print_quoted_memory(instr, size - 1); + printf("..."); + } +} + +void +print_quoted_stringn(const char *instr, const size_t size) { - const unsigned char *str = (const unsigned char*) instr; + const size_t len = strnlen(instr, size); + if (len < size) { + print_quoted_memory(instr, len); + } else { + print_quoted_memory(instr, size); + printf("..."); + } +} + +static void +print_octal(unsigned char c, char next) +{ + putchar('\\'); + + char c1 = '0' + (c & 0x7); + char c2 = '0' + ((c >> 3) & 0x7); + char c3 = '0' + (c >> 6); + + if (next >= '0' && next <= '7') { + /* Print \octal */ + putchar(c3); + putchar(c2); + } else { + /* Print \[[o]o]o */ + if (c3 != '0') + putchar(c3); + if (c3 != '0' || c2 != '0') + putchar(c2); + } + putchar(c1); +} + +void +print_quoted_memory_ex(const void *const instr, const size_t len, + bool quote, const char *escape_chars) +{ + const unsigned char *str = (const unsigned char *) instr; size_t i; + if (quote) + putchar('"'); + for (i = 0; i < len; ++i) { const int c = str[i]; switch (c) { @@ -46,30 +110,36 @@ print_quoted_memory(const char *instr, const size_t len) printf("\\v"); break; default: - if (c >= ' ' && c <= 0x7e) + if (c >= ' ' && c <= 0x7e && + !(escape_chars && strchr(escape_chars, c))) { putchar(c); - else { - putchar('\\'); - - char c1 = '0' + (c & 0x7); - char c2 = '0' + ((c >> 3) & 0x7); - char c3 = '0' + (c >> 6); - - if (*str >= '0' && *str <= '9') { - /* Print \octal */ - putchar(c3); - putchar(c2); - } else { - /* Print \[[o]o]o */ - if (c3 != '0') - putchar(c3); - if (c3 != '0' || c2 != '0') - putchar(c2); - } - putchar(c1); + } else { + print_octal(c, + i < (len - 1) ? str[i + 1] : 0); } + break; } } + if (quote) + putchar('"'); +} + +void +print_quoted_memory(const void *const instr, const size_t len) +{ + print_quoted_memory_ex(instr, len, true, NULL); +} + +void +print_quoted_hex(const void *const instr, const size_t len) +{ + const unsigned char *str = instr; + size_t i; + + printf("\""); + for (i = 0; i < len; i++) + printf("\\x%02x", str[i]); + printf("\""); } diff --git a/tests/print_time.c b/tests/print_time.c new file mode 100644 index 00000000..9d7abde5 --- /dev/null +++ b/tests/print_time.c @@ -0,0 +1,54 @@ +/* + * Print time_t and nanoseconds in symbolic format. + * + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include + +static void +print_time_t_ex(const time_t t, const unsigned long long part_sec, + const unsigned int max_part_sec, const int width, + const int comment) +{ + + if ((!t && !part_sec) || part_sec > max_part_sec) + return; + + const struct tm *const p = localtime(&t); + char buf[256]; + if (!p || !strftime(buf, sizeof(buf), "%FT%T", p)) + return; + + if (comment) + fputs(" /* ", stdout); + + fputs(buf, stdout); + + if (part_sec) + printf(".%0*llu", width, part_sec); + + if (strftime(buf, sizeof(buf), "%z", p)) + fputs(buf, stdout); + + if (comment) + fputs(" */", stdout); +} + +void +print_time_t_nsec(const time_t t, const unsigned long long nsec, int comment) +{ + print_time_t_ex(t, nsec, 999999999, 9, comment); +} + +void +print_time_t_usec(const time_t t, const unsigned long long usec, int comment) +{ + print_time_t_ex(t, usec, 999999, 6, comment); +} diff --git a/tests/print_user_desc.c b/tests/print_user_desc.c new file mode 100644 index 00000000..55f304c0 --- /dev/null +++ b/tests/print_user_desc.c @@ -0,0 +1,58 @@ +/* + * Auxiliary printing function for the struct user_desc type. + * Used by modify_ldt and xet_thread_area tests. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_STRUCT_USER_DESC + +# include + +/** + * Print user_desc structure. + * + * @param us Pointer to struct user_desc to print. + * @param entry_str If not NULL, the string is printed as a value of + * entry_number field. + */ +static void +print_user_desc(struct user_desc *us, const char *entry_str) +{ + if (entry_str) + printf("{entry_number=%s", entry_str); + else + printf("{entry_number=%u", us->entry_number); + + printf(", base_addr=%#08x" + ", limit=%#08x" + ", seg_32bit=%u" + ", contents=%u" + ", read_exec_only=%u" + ", limit_in_pages=%u" + ", seg_not_present=%u" + ", useable=%u" +# ifdef __x86_64__ + ", lm=%u" +# endif + "}", + us->base_addr, + us->limit, + us->seg_32bit, + us->contents, + us->read_exec_only, + us->limit_in_pages, + us->seg_not_present, + us->useable +# ifdef __x86_64__ + , us->lm +# endif + ); +} + +#endif /* HAVE_STRUCT_USER_DESC */ diff --git a/tests/printflags.c b/tests/printflags.c index badc85d3..e9d66471 100644 --- a/tests/printflags.c +++ b/tests/printflags.c @@ -3,30 +3,10 @@ * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman - * Copyright (c) 2005-2016 Dmitry V. Levin + * Copyright (c) 2005-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/printpath-umovestr-legacy.test b/tests/printpath-umovestr-legacy.test new file mode 100755 index 00000000..bc5c98bb --- /dev/null +++ b/tests/printpath-umovestr-legacy.test @@ -0,0 +1,32 @@ +#!/bin/sh +# +# Force legacy printpath/umovestr using process_vm_readv fault injection. +# +# Copyright (c) 2017-2018 Dmitry V. Levin +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +> "$LOG" || fail_ "failed to write $LOG" +fault_args='-qq -esignal=none -etrace=process_vm_readv -efault=process_vm_readv' +args='../printpath-umovestr-peekdata' + +$STRACE -o "$LOG" $fault_args $args > /dev/null || { + rc=$? + if [ $rc -eq 77 ]; then + skip_ "$fault_args $args exited with code 77" + else + fail_ "$fault_args $args failed with code $rc" + fi +} + +> "$LOG" || fail_ "failed to write $LOG" +args="-a11 -e signal=none -e trace=chdir $args skip-process_vm_readv-check" + +$STRACE -o /dev/null $fault_args \ + $STRACE -o "$LOG" $args > "$EXP" || + dump_log_and_fail_with "$STRACE $args failed with code $?" + +match_diff "$LOG" "$EXP" diff --git a/tests/printpath-umovestr-peekdata.c b/tests/printpath-umovestr-peekdata.c new file mode 100644 index 00000000..c4093a32 --- /dev/null +++ b/tests/printpath-umovestr-peekdata.c @@ -0,0 +1,27 @@ +/* + * Test PTRACE_PEEKDATA-based printpath/umovestr. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include "test_ucopy.h" +#include + +int +main(int ac, char **av) +{ + if (ac < 2 && test_process_vm_readv()) + error_msg_and_skip("process_vm_readv is available"); + + if (!test_ptrace_peekdata()) + perror_msg_and_skip("PTRACE_PEEKDATA"); + + test_printpath(sizeof(long) * 4); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/printpath-umovestr-peekdata.gen.test b/tests/printpath-umovestr-peekdata.gen.test new file mode 100755 index 00000000..6fe65eeb --- /dev/null +++ b/tests/printpath-umovestr-peekdata.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printpath-umovestr-peekdata -a11 -e signal=none -e trace=chdir); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e signal=none -e trace=chdir diff --git a/tests/printpath-umovestr-undumpable.c b/tests/printpath-umovestr-undumpable.c new file mode 100644 index 00000000..216b6cac --- /dev/null +++ b/tests/printpath-umovestr-undumpable.c @@ -0,0 +1,51 @@ +/* + * Force legacy printpath/umovestr using PR_SET_DUMPABLE. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_PRCTL +# include +#endif + +#if defined HAVE_PRCTL && defined PR_SET_DUMPABLE + +# include +# include + +# include "test_ucopy.h" + +int +main(void) +{ + if (!test_process_vm_readv()) + perror_msg_and_skip("process_vm_readv"); + + /* + * Clearing dumpable flag disallows process_vm_readv. + * If the kernel does not contain commit + * 84d77d3f06e7e8dea057d10e8ec77ad71f721be3, then + * PTRACE_PEEKDATA remains allowed. + */ + if (prctl(PR_SET_DUMPABLE, 0)) + perror_msg_and_skip("PR_SET_DUMPABLE 0"); + + if (!test_ptrace_peekdata()) + perror_msg_and_skip("PTRACE_PEEKDATA"); + + test_printpath(sizeof(long) * 4); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PRCTL && PR_SET_DUMPABLE") + +#endif diff --git a/tests/printpath-umovestr-undumpable.gen.test b/tests/printpath-umovestr-undumpable.gen.test new file mode 100755 index 00000000..cca64424 --- /dev/null +++ b/tests/printpath-umovestr-undumpable.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printpath-umovestr-undumpable -a11 -e signal=none -e trace=chdir); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e signal=none -e trace=chdir diff --git a/tests/printpath-umovestr.c b/tests/printpath-umovestr.c new file mode 100644 index 00000000..2782a988 --- /dev/null +++ b/tests/printpath-umovestr.c @@ -0,0 +1,26 @@ +/* + * Test regular printpath/umovestr. + * + * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include "test_ucopy.h" +#include +#include + +int +main(void) +{ + if (!test_process_vm_readv()) + perror_msg_and_skip("process_vm_readv"); + + test_printpath(PATH_MAX); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/printpath-umovestr.gen.test b/tests/printpath-umovestr.gen.test new file mode 100755 index 00000000..c827a7d2 --- /dev/null +++ b/tests/printpath-umovestr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printpath-umovestr -a11 -e signal=none -e trace=chdir); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e signal=none -e trace=chdir diff --git a/tests/printsignal-Xabbrev.c b/tests/printsignal-Xabbrev.c new file mode 100644 index 00000000..dfd93eee --- /dev/null +++ b/tests/printsignal-Xabbrev.c @@ -0,0 +1 @@ +#include "printsignal.c" diff --git a/tests/printsignal-Xabbrev.gen.test b/tests/printsignal-Xabbrev.gen.test new file mode 100755 index 00000000..fbb7a435 --- /dev/null +++ b/tests/printsignal-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printsignal-Xabbrev -a11 -Xabbrev -e signal=none -e trace=kill); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -Xabbrev -e signal=none -e trace=kill diff --git a/tests/printsignal-Xraw.c b/tests/printsignal-Xraw.c new file mode 100644 index 00000000..47d75b77 --- /dev/null +++ b/tests/printsignal-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "printsignal.c" diff --git a/tests/printsignal-Xraw.gen.test b/tests/printsignal-Xraw.gen.test new file mode 100755 index 00000000..ede2f5e1 --- /dev/null +++ b/tests/printsignal-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printsignal-Xraw -a11 -Xraw -e signal=none -e trace=kill); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -Xraw -e signal=none -e trace=kill diff --git a/tests/printsignal-Xverbose.c b/tests/printsignal-Xverbose.c new file mode 100644 index 00000000..4bb13302 --- /dev/null +++ b/tests/printsignal-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "printsignal.c" diff --git a/tests/printsignal-Xverbose.gen.test b/tests/printsignal-Xverbose.gen.test new file mode 100755 index 00000000..ae0560df --- /dev/null +++ b/tests/printsignal-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printsignal-Xverbose -a11 -Xverbose -e signal=none -e trace=kill); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -Xverbose -e signal=none -e trace=kill diff --git a/tests/printsignal.c b/tests/printsignal.c new file mode 100644 index 00000000..4f5f9866 --- /dev/null +++ b/tests/printsignal.c @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include "tests.h" +#include +#include +#include + +int +main(void) +{ + const pid_t pid = getpid(); + int rc = kill(pid, SIGCONT); +#if XLAT_RAW + printf("kill(%d, %d) = %s\n", pid, SIGCONT, sprintrc(rc)); +#elif XLAT_VERBOSE + printf("kill(%d, %d /* SIGCONT */) = %s\n", pid, SIGCONT, sprintrc(rc)); +#else /* XLAT_ABBREV */ + printf("kill(%d, SIGCONT) = %s\n", pid, sprintrc(rc)); +#endif + + static const int sigs[] = { 0, 256, -1 }; + for (unsigned int i = 0; i < ARRAY_SIZE(sigs); ++i) { + rc = kill(pid, sigs[i]); + printf("kill(%d, %d) = %s\n", pid, sigs[i], sprintrc(rc)); + } + + printf("+++ exited with 0 +++\n"); + return 0; +} diff --git a/tests/printstr.c b/tests/printstr.c index 330234f1..f1204e00 100644 --- a/tests/printstr.c +++ b/tests/printstr.c @@ -2,29 +2,10 @@ * Check decoding of non-NUL-terminated strings when len == -1. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -34,13 +15,11 @@ #include #include -#define DEFAULT_STRLEN 32 - int main(void) { char *const buf = tail_alloc(DEFAULT_STRLEN + 1); - const struct iovec io = { + struct iovec io = { .iov_base = buf, .iov_len = -1 }; @@ -64,6 +43,11 @@ main(void) tprintf("writev(-1, [{iov_base=\"\\0%*s\"..., iov_len=%lu}], 1)" " = %s\n", DEFAULT_STRLEN - 1, buf + 1, -1UL, sprintrc(rc)); + ++io.iov_base; + rc = writev(-1, &io, 1); + tprintf("writev(-1, [{iov_base=%p, iov_len=%lu}], 1) = %s\n", + io.iov_base, -1UL, sprintrc(rc)); + tprintf("+++ exited with 0 +++\n"); return 0; } diff --git a/tests/printstr.gen.test b/tests/printstr.gen.test new file mode 100755 index 00000000..c3bd93a3 --- /dev/null +++ b/tests/printstr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printstr -e trace=writev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=writev diff --git a/tests/printstr.test b/tests/printstr.test deleted file mode 100755 index 5f164eb7..00000000 --- a/tests/printstr.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of non-NUL-terminated strings when len == -1. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -e trace=writev diff --git a/tests/printstrn-umoven-legacy.test b/tests/printstrn-umoven-legacy.test new file mode 100755 index 00000000..062b8b07 --- /dev/null +++ b/tests/printstrn-umoven-legacy.test @@ -0,0 +1,32 @@ +#!/bin/sh +# +# Force legacy printstrn/umoven using process_vm_readv fault injection. +# +# Copyright (c) 2017-2018 Dmitry V. Levin +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +> "$LOG" || fail_ "failed to write $LOG" +fault_args='-qq -esignal=none -etrace=process_vm_readv -efault=process_vm_readv' +args='../printstrn-umoven-peekdata' + +$STRACE -o "$LOG" $fault_args $args > /dev/null || { + rc=$? + if [ $rc -eq 77 ]; then + skip_ "$fault_args $args exited with code 77" + else + fail_ "$fault_args $args failed with code $rc" + fi +} + +> "$LOG" || fail_ "failed to write $LOG" +args="-e signal=none -e trace=add_key $args skip-process_vm_readv-check" + +$STRACE -o /dev/null $fault_args \ + $STRACE -o "$LOG" $args > "$EXP" || + dump_log_and_fail_with "$STRACE $args failed with code $?" + +match_diff "$LOG" "$EXP" diff --git a/tests/printstrn-umoven-peekdata.c b/tests/printstrn-umoven-peekdata.c new file mode 100644 index 00000000..c80d9124 --- /dev/null +++ b/tests/printstrn-umoven-peekdata.c @@ -0,0 +1,27 @@ +/* + * Test PTRACE_PEEKDATA-based printstrn/umoven. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include "test_ucopy.h" +#include + +int +main(int ac, char **av) +{ + if (ac < 2 && test_process_vm_readv()) + error_msg_and_skip("process_vm_readv is available"); + + if (!test_ptrace_peekdata()) + perror_msg_and_skip("PTRACE_PEEKDATA"); + + test_printstrn(DEFAULT_STRLEN); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/printstrn-umoven-peekdata.gen.test b/tests/printstrn-umoven-peekdata.gen.test new file mode 100755 index 00000000..61f648ae --- /dev/null +++ b/tests/printstrn-umoven-peekdata.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printstrn-umoven-peekdata -e signal=none -e trace=add_key); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e signal=none -e trace=add_key diff --git a/tests/printstrn-umoven-undumpable.c b/tests/printstrn-umoven-undumpable.c new file mode 100644 index 00000000..be3f8d4b --- /dev/null +++ b/tests/printstrn-umoven-undumpable.c @@ -0,0 +1,51 @@ +/* + * Force legacy printpath/umovestr using PR_SET_DUMPABLE. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#ifdef HAVE_PRCTL +# include +#endif + +#if defined HAVE_PRCTL && defined PR_SET_DUMPABLE + +# include +# include + +# include "test_ucopy.h" + +int +main(void) +{ + if (!test_process_vm_readv()) + perror_msg_and_skip("process_vm_readv"); + + /* + * Clearing dumpable flag disallows process_vm_readv. + * If the kernel does not contain commit + * 84d77d3f06e7e8dea057d10e8ec77ad71f721be3, then + * PTRACE_PEEKDATA remains allowed. + */ + if (prctl(PR_SET_DUMPABLE, 0)) + perror_msg_and_skip("PR_SET_DUMPABLE 0"); + + if (!test_ptrace_peekdata()) + perror_msg_and_skip("PTRACE_PEEKDATA"); + + test_printstrn(DEFAULT_STRLEN); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_PRCTL && PR_SET_DUMPABLE") + +#endif diff --git a/tests/printstrn-umoven-undumpable.gen.test b/tests/printstrn-umoven-undumpable.gen.test new file mode 100755 index 00000000..1dee526f --- /dev/null +++ b/tests/printstrn-umoven-undumpable.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printstrn-umoven-undumpable -e signal=none -e trace=add_key); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e signal=none -e trace=add_key diff --git a/tests/printstrn-umoven.c b/tests/printstrn-umoven.c new file mode 100644 index 00000000..f9aa75dc --- /dev/null +++ b/tests/printstrn-umoven.c @@ -0,0 +1,24 @@ +/* + * Test regular printstrn/umoven. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include "test_ucopy.h" +#include + +int +main(void) +{ + if (!test_process_vm_readv()) + perror_msg_and_skip("process_vm_readv"); + + test_printstrn(4096); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/printstrn-umoven.gen.test b/tests/printstrn-umoven.gen.test new file mode 100755 index 00000000..4187238c --- /dev/null +++ b/tests/printstrn-umoven.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (printstrn-umoven -s4096 -e signal=none -e trace=add_key); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s4096 -e signal=none -e trace=add_key diff --git a/tests/printxval.c b/tests/printxval.c index 4fb61c84..0cd629e4 100644 --- a/tests/printxval.c +++ b/tests/printxval.c @@ -3,30 +3,10 @@ * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman - * Copyright (c) 2005-2016 Dmitry V. Levin + * Copyright (c) 2005-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/prlimit64.c b/tests/prlimit64.c index 1e651161..688ca75f 100644 --- a/tests/prlimit64.c +++ b/tests/prlimit64.c @@ -1,30 +1,10 @@ /* * Check decoding of prlimit64 syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/prlimit64.gen.test b/tests/prlimit64.gen.test new file mode 100755 index 00000000..2c94fc9d --- /dev/null +++ b/tests/prlimit64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (prlimit64 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/prlimit64.test b/tests/prlimit64.test deleted file mode 100755 index 2d2240d7..00000000 --- a/tests/prlimit64.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of prlimit64 syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/process_vm_readv.c b/tests/process_vm_readv.c index cfb8f786..422000b8 100644 --- a/tests/process_vm_readv.c +++ b/tests/process_vm_readv.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/process_vm_readv.gen.test b/tests/process_vm_readv.gen.test new file mode 100755 index 00000000..31425887 --- /dev/null +++ b/tests/process_vm_readv.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (process_vm_readv -s5 -a37); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s5 -a37 diff --git a/tests/process_vm_readv.test b/tests/process_vm_readv.test deleted file mode 100755 index c092f5a3..00000000 --- a/tests/process_vm_readv.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of process_vm_readv syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s5 -a37 diff --git a/tests/process_vm_readv_writev.c b/tests/process_vm_readv_writev.c index 2a089395..9309135a 100644 --- a/tests/process_vm_readv_writev.c +++ b/tests/process_vm_readv_writev.c @@ -2,29 +2,10 @@ * Check decoding of process_vm_readv/process_vm_writev syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -51,7 +32,7 @@ enum { MAX_SEGM_COUNT = 2, MAX_STR_LEN = 5 }; struct print_iov_arg { uint32_t count; uint32_t valid :1, - string :1, + string :1, addr_term:1, check_rc :1; uint32_t str_segms; @@ -134,7 +115,7 @@ print_iov(const struct iovec *iov, const void *arg_ptr, long rc) } if (arg->addr_term) - printf(", %p", iov + arg->count); + printf(", ... /* %p */", iov + arg->count); printf("]"); } @@ -247,14 +228,15 @@ main(void) 2, {SEGM1_BASE, SEGM2_BASE}, {SIZE_1, SIZE_2} }; struct print_iov_arg rmt_arg = { ARRAY_SIZE(rmt_iovec), 1 }; - struct print_iov_arg bogus_arg_cut = - { ARRAY_SIZE(bogus_iovec) - 2, 1, 0, 1 }; - struct print_iov_arg lcl_arg_cut = - { ARRAY_SIZE(lcl_iovec) - 2, 1, 1, 1, 0, 2, - {SEGM1_BASE + SIZE_11 + SIZE_12, SEGM2_BASE}, - {SIZE_13, SIZE_2} }; - struct print_iov_arg rmt_arg_cut = - { ARRAY_SIZE(rmt_iovec) - 2, 1 }; + struct print_iov_arg bogus_arg_cut = { + ARRAY_SIZE(bogus_iovec) - 2, 1, 0, 1 + }; + struct print_iov_arg lcl_arg_cut = { + ARRAY_SIZE(lcl_iovec) - 2, 1, 1, 1, 0, 2, + { SEGM1_BASE + SIZE_11 + SIZE_12, SEGM2_BASE }, + {SIZE_13, SIZE_2} + }; + struct print_iov_arg rmt_arg_cut = { ARRAY_SIZE(rmt_iovec) - 2, 1 }; fill_memory_ex(data1_out, SIZE_1, SEGM1_BASE, SIZE_1); diff --git a/tests/process_vm_writev.c b/tests/process_vm_writev.c index 6271c01b..848a9e91 100644 --- a/tests/process_vm_writev.c +++ b/tests/process_vm_writev.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/process_vm_writev.gen.test b/tests/process_vm_writev.gen.test new file mode 100755 index 00000000..0b912c09 --- /dev/null +++ b/tests/process_vm_writev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (process_vm_writev -s5 -a38); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s5 -a38 diff --git a/tests/process_vm_writev.test b/tests/process_vm_writev.test deleted file mode 100755 index f690e6a9..00000000 --- a/tests/process_vm_writev.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of process_vm_writev syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s5 -a38 diff --git a/tests/pselect6.c b/tests/pselect6.c index f2644853..c8122e27 100644 --- a/tests/pselect6.c +++ b/tests/pselect6.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ /* @@ -95,20 +76,20 @@ int main(int ac, char **av) FD_SET(fds[0], set[1]); FD_SET(fds[1], set[1]); assert(syscall(__NR_pselect6, fds[1] + 1, NULL, set[1], NULL, &tm.ts, NULL) == 3); - printf("pselect6(%d, NULL, [1 2 %d %d], NULL, " - "{tv_sec=%lld, tv_nsec=%lld}, NULL) = 3 (out [1 2 %d], left " - "{tv_sec=%lld, tv_nsec=%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], - (long long) tm.ts.tv_sec, (long long) tm.ts.tv_nsec); + printf("pselect6(%d, NULL, [1 2 %d %d], NULL" + ", {tv_sec=%lld, tv_nsec=%llu}, NULL) = 3 (out [1 2 %d]" + ", left {tv_sec=%lld, tv_nsec=%llu})\n", + fds[1] + 1, fds[0], fds[1], (long long) tm_in.ts.tv_sec, + zero_extend_signed_to_ull(tm_in.ts.tv_nsec), + fds[1], (long long) tm.ts.tv_sec, + zero_extend_signed_to_ull(tm.ts.tv_nsec)); /* * Now the crash case that trinity found, negative nfds * but with a pointer to a large chunk of valid memory. */ FD_ZERO(set[0]); - FD_SET(fds[1],set[0]); + FD_SET(fds[1], set[0]); assert(pselect(-1, NULL, set[0], NULL, NULL, &mask) == -1); printf("pselect6(-1, NULL, %p, NULL, NULL, {[HUP CHLD], %u}) " "= -1 EINVAL (%m)\n", set[0], NSIG_BYTES); @@ -117,26 +98,45 @@ int main(int ac, char **av) * Another variant, with nfds exceeding FD_SETSIZE limit. */ FD_ZERO(set[0]); - FD_SET(fds[0],set[0]); + FD_SET(fds[0], set[0]); FD_ZERO(set[1]); tm.ts.tv_sec = 0; tm.ts.tv_nsec = 123; assert(pselect(FD_SETSIZE + 1, set[0], set[1], NULL, &tm.ts, &mask) == 0); - printf("pselect6(%d, [%d], [], NULL, {tv_sec=0, tv_nsec=123}, " - "{[HUP CHLD], %u}) = 0 (Timeout)\n", + printf("pselect6(%d, [%d], [], NULL, {tv_sec=0, tv_nsec=123}" + ", {[HUP CHLD], %u}) = 0 (Timeout)\n", FD_SETSIZE + 1, fds[0], NSIG_BYTES); /* * See how timeouts are decoded. */ + tm.ts.tv_sec = 0xdeadbeefU; + tm.ts.tv_nsec = 0xfacefeedU; + assert(pselect(0, NULL, NULL, NULL, &tm.ts, NULL) == -1); + printf("pselect6(0, NULL, NULL, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}, {NULL, %u}) = %s\n", + (long long) tm.ts.tv_sec, + zero_extend_signed_to_ull(tm.ts.tv_nsec), + NSIG_BYTES, sprintrc(-1)); + + tm.ts.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + tm.ts.tv_nsec = (long) 0xbadc0dedfacefeedLL; + assert(pselect(0, NULL, NULL, NULL, &tm.ts, NULL) == -1); + printf("pselect6(0, NULL, NULL, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}, {NULL, %u}) = %s\n", + (long long) tm.ts.tv_sec, + zero_extend_signed_to_ull(tm.ts.tv_nsec), + NSIG_BYTES, sprintrc(-1)); + assert(sigaction(SIGALRM, &act, NULL) == 0); assert(setitimer(ITIMER_REAL, &itv, NULL) == 0); + tm.ts.tv_sec = 0; tm.ts.tv_nsec = 222222222; assert(pselect(0, NULL, NULL, NULL, &tm.ts, &mask) == -1); - printf("pselect6(0, NULL, NULL, NULL, {tv_sec=0, tv_nsec=222222222}, " - "{[HUP CHLD], %u}) = " - "? ERESTARTNOHAND (To be restarted if no handler)\n", + printf("pselect6(0, NULL, NULL, NULL, {tv_sec=0, tv_nsec=222222222}" + ", {[HUP CHLD], %u})" + " = ? ERESTARTNOHAND (To be restarted if no handler)\n", NSIG_BYTES); puts("--- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---"); diff --git a/tests/pselect6.gen.test b/tests/pselect6.gen.test new file mode 100755 index 00000000..29d38963 --- /dev/null +++ b/tests/pselect6.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pselect6 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/pselect6.test b/tests/pselect6.test deleted file mode 100755 index 203f8e24..00000000 --- a/tests/pselect6.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check pselect6 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/ptrace.c b/tests/ptrace.c index 80ce8cbb..63435a76 100644 --- a/tests/ptrace.c +++ b/tests/ptrace.c @@ -2,44 +2,25 @@ * Check decoding of ptrace syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include -#ifdef __NR_rt_sigprocmask - -# include -# include -# include -# include -# include -# include -# include "ptrace.h" -# include +#include +#include "ptrace.h" +#include +#include +#include +#include +#include +#include +#include +#include static const char *errstr; @@ -59,10 +40,11 @@ test_peeksiginfo(unsigned long pid, const unsigned long bad_request) printf("ptrace(PTRACE_PEEKSIGINFO, %u, NULL, %#lx) = %s\n", (unsigned) pid, bad_request, errstr); - struct { + struct psi { unsigned long long off; unsigned int flags, nr; - } *const psi = tail_alloc(sizeof(*psi)); + }; + TAIL_ALLOC_OBJECT_CONST_PTR(struct psi, psi); psi->off = 0xdeadbeeffacefeedULL; psi->flags = 1; @@ -115,7 +97,7 @@ test_peeksiginfo(unsigned long pid, const unsigned long bad_request) if (errno == EINTR) continue; saved = errno; - kill (pid, SIGKILL); + kill(pid, SIGKILL); errno = saved; perror_msg_and_fail("wait"); } @@ -160,11 +142,11 @@ test_peeksiginfo(unsigned long pid, const unsigned long bad_request) if (do_ptrace(PTRACE_CONT, pid, 0, 0)) { saved = errno; - kill (pid, SIGKILL); + kill(pid, SIGKILL); errno = saved; perror_msg_and_fail("ptrace"); } - printf("ptrace(PTRACE_CONT, %ld, NULL, SIG_0) = 0\n", pid); + printf("ptrace(PTRACE_CONT, %ld, NULL, 0) = 0\n", pid); } } @@ -178,46 +160,40 @@ main(void) const unsigned long pid = (unsigned long) 0xdefaced00000000ULL | (unsigned) getpid(); - unsigned int sigset_size; + TAIL_ALLOC_OBJECT_CONST_PTR(uint64_t, filter_off); - for (sigset_size = 1024 / 8; sigset_size; sigset_size >>= 1) { - if (!syscall(__NR_rt_sigprocmask, - SIG_SETMASK, NULL, NULL, sigset_size)) - break; - } - if (!sigset_size) - perror_msg_and_fail("rt_sigprocmask"); + const unsigned int sigset_size = get_sigset_size(); void *const k_set = tail_alloc(sigset_size); - siginfo_t *const sip = tail_alloc(sizeof(*sip)); + TAIL_ALLOC_OBJECT_CONST_PTR(siginfo_t, sip); do_ptrace(bad_request, pid, 0, 0); printf("ptrace(%#lx /* PTRACE_??? */, %u, NULL, NULL) = %s\n", bad_request, (unsigned) pid, errstr); do_ptrace(PTRACE_PEEKDATA, pid, bad_request, bad_data); -# ifdef IA64 +#ifdef IA64 printf("ptrace(PTRACE_PEEKDATA, %u, %#lx) = %s\n", (unsigned) pid, bad_request, errstr); -# else +#else printf("ptrace(PTRACE_PEEKDATA, %u, %#lx, %#lx) = %s\n", (unsigned) pid, bad_request, bad_data, errstr); #endif do_ptrace(PTRACE_PEEKTEXT, pid, bad_request, bad_data); -# ifdef IA64 +#ifdef IA64 printf("ptrace(PTRACE_PEEKTEXT, %u, %#lx) = %s\n", (unsigned) pid, bad_request, errstr); -# else +#else printf("ptrace(PTRACE_PEEKTEXT, %u, %#lx, %#lx) = %s\n", (unsigned) pid, bad_request, bad_data, errstr); #endif do_ptrace(PTRACE_PEEKUSER, pid, bad_request, bad_data); -# ifdef IA64 +#ifdef IA64 printf("ptrace(PTRACE_PEEKUSER, %u, %#lx) = %s\n", (unsigned) pid, bad_request, errstr); -# else +#else printf("ptrace(PTRACE_PEEKUSER, %u, %#lx, %#lx) = %s\n", (unsigned) pid, bad_request, bad_data, errstr); #endif @@ -255,6 +231,22 @@ main(void) printf("ptrace(PTRACE_SECCOMP_GET_FILTER, %u, 42, NULL) = %s\n", (unsigned) pid, errstr); + do_ptrace(PTRACE_SECCOMP_GET_METADATA, pid, bad_data, 0); + printf("ptrace(PTRACE_SECCOMP_GET_METADATA, %u, %lu, NULL) = %s\n", + (unsigned) pid, bad_data, errstr); + + do_ptrace(PTRACE_SECCOMP_GET_METADATA, pid, 7, + (unsigned long) filter_off); + printf("ptrace(PTRACE_SECCOMP_GET_METADATA, %u, 7, %p) = %s\n", + (unsigned) pid, filter_off, errstr); + + *filter_off = 0xfacefeeddeadc0deULL; + do_ptrace(PTRACE_SECCOMP_GET_METADATA, pid, bad_data, + (unsigned long) filter_off); + printf("ptrace(PTRACE_SECCOMP_GET_METADATA, %u, %lu, " + "{filter_off=%" PRIu64 "}) = %s\n", + (unsigned) pid, bad_data, *filter_off, errstr); + do_ptrace(PTRACE_GETEVENTMSG, pid, bad_request, bad_data); printf("ptrace(PTRACE_GETEVENTMSG, %u, %#lx, %#lx) = %s\n", (unsigned) pid, bad_request, bad_data, errstr); @@ -446,10 +438,3 @@ main(void) puts("+++ exited with 0 +++"); return 0; } - - -#else - -SKIP_MAIN_UNDEFINED("__NR_rt_sigprocmask") - -#endif diff --git a/tests/ptrace.gen.test b/tests/ptrace.gen.test new file mode 100755 index 00000000..4b932509 --- /dev/null +++ b/tests/ptrace.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ptrace -a23 -e signal=none); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 -e signal=none diff --git a/tests/ptrace.test b/tests/ptrace.test deleted file mode 100755 index 5add9be4..00000000 --- a/tests/ptrace.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of ptrace syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a23 -e signal=none diff --git a/tests/ptrace_syscall_info.c b/tests/ptrace_syscall_info.c new file mode 100644 index 00000000..ea29d22e --- /dev/null +++ b/tests/ptrace_syscall_info.c @@ -0,0 +1,460 @@ +/* + * Check decoding of ptrace PTRACE_GET_SYSCALL_INFO request. + * + * Copyright (c) 2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include "ptrace.h" +#include +#include "scno.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "xlat.h" +#include "xlat/audit_arch.h" + +static const char *errstr; + +static long +do_ptrace(unsigned long request, unsigned long pid, + unsigned long addr, unsigned long data) +{ + long rc = syscall(__NR_ptrace, request, pid, addr, data); + errstr = sprintrc(rc); + return rc; +} + +static pid_t pid; + +static void +kill_tracee(void) +{ + if (!pid) + return; + int saved_errno = errno; + kill(pid, SIGKILL); + errno = saved_errno; +} + +#define FAIL(fmt_, ...) \ + do { \ + kill_tracee(); \ + error_msg_and_fail("%s:%d: " fmt_, \ + __FILE__, __LINE__, ##__VA_ARGS__); \ + } while (0) + +#define PFAIL(fmt_, ...) \ + do { \ + kill_tracee(); \ + perror_msg_and_fail("%s:%d: " fmt_, \ + __FILE__, __LINE__, ##__VA_ARGS__); \ + } while (0) + +static const unsigned long args[][7] = { + /* a sequence of architecture-agnostic syscalls */ + { + __NR_chdir, + (unsigned long) "", + 0xbad1fed1, + 0xbad2fed2, + 0xbad3fed3, + 0xbad4fed4, + 0xbad5fed5 + }, + { + __NR_gettid, + 0xcaf0bea0, + 0xcaf1bea1, + 0xcaf2bea2, + 0xcaf3bea3, + 0xcaf4bea4, + 0xcaf5bea5 + }, + { + __NR_exit_group, + 0, + 0xfac1c0d1, + 0xfac2c0d2, + 0xfac3c0d3, + 0xfac4c0d4, + 0xfac5c0d5 + } +}; + +static const unsigned int expected_none_size = + offsetof(struct ptrace_syscall_info, entry); +static const unsigned int expected_entry_size = + offsetofend(struct ptrace_syscall_info, entry.args); +static const unsigned int expected_exit_size = + offsetofend(struct ptrace_syscall_info, exit.is_error); + +static unsigned long end_of_page; +static unsigned int ptrace_stop; + +static bool +test_none(void) +{ + do_ptrace(PTRACE_GET_SYSCALL_INFO, pid, 1, 0); + printf("ptrace(PTRACE_GET_SYSCALL_INFO, %d, 1, NULL) = %s\n", + pid, errstr); + + do_ptrace(PTRACE_GET_SYSCALL_INFO, pid, 1, end_of_page); + printf("ptrace(PTRACE_GET_SYSCALL_INFO, %d, 1, %#lx) = %s\n", + pid, end_of_page, errstr); + + for (unsigned int size = 0; + size <= sizeof(struct ptrace_syscall_info); ++size) { + unsigned long buf = end_of_page - size; + memset((void *) buf, -1, size); + + long rc = do_ptrace(PTRACE_GET_SYSCALL_INFO, pid, size, buf); + if (rc < 0) { + printf("ptrace(PTRACE_GET_SYSCALL_INFO, %d, %u, %#lx)" + " = %s\n", + pid, (unsigned int) size, buf, errstr); + return false; + } + if (rc < (long) expected_none_size) + FAIL("signal stop mismatch"); + + printf("ptrace(PTRACE_GET_SYSCALL_INFO, %d, %u, ", + pid, size); + if (!size) { + printf("%#lx) = %s\n", buf, errstr); + continue; + } + + /* copy to a local structure to avoid unaligned access */ + struct ptrace_syscall_info info; + memcpy(&info, (void *) buf, MIN(size, expected_none_size)); + + if (info.op != PTRACE_SYSCALL_INFO_NONE) + FAIL("signal stop mismatch"); + printf("{op=PTRACE_SYSCALL_INFO_NONE"); + + if (size < offsetofend(struct ptrace_syscall_info, arch)) + goto printed_none; + if (!info.arch) + FAIL("signal stop mismatch"); + printf(", arch="); + printxval(audit_arch, info.arch, "AUDIT_ARCH_???"); + + if (size < offsetofend(struct ptrace_syscall_info, + instruction_pointer)) + goto printed_none; + if (!info.instruction_pointer) + FAIL("signal stop mismatch"); + printf(", instruction_pointer=%#llx", + (unsigned long long) info.instruction_pointer); + + if (size < offsetofend(struct ptrace_syscall_info, + stack_pointer)) + goto printed_none; + if (!info.stack_pointer) + FAIL("signal stop mismatch"); + printf(", stack_pointer=%#llx", + (unsigned long long) info.stack_pointer); + +printed_none: + printf("}) = %s\n", errstr); + } + + return true; +} + +static void +test_entry(void) +{ + for (unsigned int size = 0; + size <= sizeof(struct ptrace_syscall_info); ++size) { + unsigned long buf = end_of_page - size; + memset((void *) buf, -1, size); + + long rc = do_ptrace(PTRACE_GET_SYSCALL_INFO, pid, size, buf); + if (rc < 0) + PFAIL("PTRACE_GET_SYSCALL_INFO"); + + if (rc < (long) expected_entry_size) + FAIL("#%d: entry stop mismatch", ptrace_stop); + + printf("ptrace(PTRACE_GET_SYSCALL_INFO, %d, %u, ", + pid, size); + if (!size) { + printf("%#lx) = %s\n", buf, errstr); + continue; + } + + /* copy to a local structure to avoid unaligned access */ + struct ptrace_syscall_info info; + memcpy(&info, (void *) buf, MIN(size, expected_entry_size)); + + if (info.op != PTRACE_SYSCALL_INFO_ENTRY) + FAIL("#%d: entry stop mismatch", ptrace_stop); + printf("{op=PTRACE_SYSCALL_INFO_ENTRY"); + + if (size < offsetofend(struct ptrace_syscall_info, arch)) + goto printed_entry_common; + if (!info.arch) + FAIL("#%d: entry stop mismatch", ptrace_stop); + printf(", arch="); + printxval(audit_arch, info.arch, "AUDIT_ARCH_???"); + + if (size < offsetofend(struct ptrace_syscall_info, + instruction_pointer)) + goto printed_entry_common; + if (!info.instruction_pointer) + FAIL("#%d: entry stop mismatch", ptrace_stop); + printf(", instruction_pointer=%#llx", + (unsigned long long) info.instruction_pointer); + + if (size < offsetofend(struct ptrace_syscall_info, + stack_pointer)) + goto printed_entry_common; + if (!info.stack_pointer) + FAIL("#%d: entry stop mismatch", ptrace_stop); + printf(", stack_pointer=%#llx", + (unsigned long long) info.stack_pointer); + + if (size < offsetofend(struct ptrace_syscall_info, entry.nr)) + goto printed_entry_common; + const unsigned long *exp_args = args[ptrace_stop / 2]; + if (info.entry.nr != exp_args[0]) + FAIL("#%d: entry stop mismatch", ptrace_stop); + printf(", entry={nr=%llu", (unsigned long long) info.entry.nr); + + for (unsigned int i = 0; i < ARRAY_SIZE(info.entry.args); ++i) { + const unsigned int i_size = + offsetofend(struct ptrace_syscall_info, + entry.args[i]); + if (size < i_size) { + if (i) + break; + goto printed_entry_nr; + } + if (info.entry.args[i] != exp_args[i + 1]) + FAIL("#%d: entry stop mismatch", ptrace_stop); + printf("%s%#llx", (i ? ", " : ", arg=["), + (unsigned long long) info.entry.args[i]); + } + printf("]"); + +printed_entry_nr: + printf("}"); + +printed_entry_common: + printf("}) = %s\n", errstr); + } +} + +static void +test_exit(void) +{ + for (unsigned int size = 0; + size <= sizeof(struct ptrace_syscall_info); ++size) { + unsigned long buf = end_of_page - size; + memset((void *) buf, -1, size); + + long rc = do_ptrace(PTRACE_GET_SYSCALL_INFO, pid, size, buf); + if (rc < 0) + PFAIL("PTRACE_GET_SYSCALL_INFO"); + + if (rc < (long) expected_exit_size) + FAIL("#%d: exit stop mismatch", ptrace_stop); + + printf("ptrace(PTRACE_GET_SYSCALL_INFO, %d, %u, ", + pid, size); + if (!size) { + printf("%#lx) = %s\n", buf, errstr); + continue; + } + + /* copy to a local structure to avoid unaligned access */ + struct ptrace_syscall_info info; + memcpy(&info, (void *) buf, MIN(size, expected_exit_size)); + + if (info.op != PTRACE_SYSCALL_INFO_EXIT) + FAIL("#%d: exit stop mismatch", ptrace_stop); + printf("{op=PTRACE_SYSCALL_INFO_EXIT"); + + if (size < offsetofend(struct ptrace_syscall_info, arch)) + goto printed_exit_common; + if (!info.arch) + FAIL("#%d: exit stop mismatch", ptrace_stop); + printf(", arch="); + printxval(audit_arch, info.arch, "AUDIT_ARCH_???"); + + if (size < offsetofend(struct ptrace_syscall_info, + instruction_pointer)) + goto printed_exit_common; + if (!info.instruction_pointer) + FAIL("#%d: exit stop mismatch", ptrace_stop); + printf(", instruction_pointer=%#llx", + (unsigned long long) info.instruction_pointer); + + if (size < offsetofend(struct ptrace_syscall_info, + stack_pointer)) + goto printed_exit_common; + if (!info.stack_pointer) + FAIL("#%d: exit stop mismatch", ptrace_stop); + printf(", stack_pointer=%#llx", + (unsigned long long) info.stack_pointer); + + const struct { + unsigned int is_error; + int rval; + const char *str; + } exit_param[] = { + { 1, -ENOENT, "-ENOENT" }, /* chdir */ + { 0, pid, NULL } /* gettid */ + }, *exp_param = &exit_param[ptrace_stop / 2 - 1]; + + if (size < offsetofend(struct ptrace_syscall_info, exit.rval)) + goto printed_exit_common; + if (info.exit.rval != exp_param->rval) + FAIL("#%d: exit stop mismatch", ptrace_stop); + if (size >= expected_exit_size && info.exit.is_error) { + printf(", exit={rval=%s", exp_param->str); + } else { + printf(", exit={rval=%lld", (long long) info.exit.rval); + } + + if (size >= expected_exit_size) { + if (info.exit.is_error != exp_param->is_error) + FAIL("#%d: exit stop mismatch", ptrace_stop); + printf(", is_error=%u", + (unsigned int) info.exit.is_error); + } + + printf("}"); + +printed_exit_common: + printf("}) = %s\n", errstr); + } +} + +int +main(void) +{ + end_of_page = (unsigned long) tail_alloc(1) + 1; + + pid = getpid(); + do_ptrace(PTRACE_GET_SYSCALL_INFO, pid, 0, 0); + printf("ptrace(PTRACE_GET_SYSCALL_INFO, %d, 0, NULL) = %s\n", + pid, errstr); + + pid = fork(); + if (pid < 0) + PFAIL("fork"); + + if (pid == 0) { + /* get the pid before PTRACE_TRACEME */ + pid = getpid(); + if (do_ptrace(PTRACE_TRACEME, 0, 0, 0) < 0) { + /* exit with a nonzero exit status */ + PFAIL("PTRACE_TRACEME"); + } + kill(pid, SIGSTOP); + for (unsigned int i = 0; i < ARRAY_SIZE(args); ++i) { + syscall(args[i][0], + args[i][1], args[i][2], args[i][3], + args[i][4], args[i][5], args[i][6]); + } + /* unreachable */ + _exit(1); + } + + for (ptrace_stop = 0; ; ++ptrace_stop) { + int status; + long rc = waitpid(pid, &status, 0); + if (rc != pid) { + /* cannot happen */ + PFAIL("#%d: unexpected wait result %ld", + ptrace_stop, rc); + } + if (WIFEXITED(status)) { + /* tracee is no more */ + pid = 0; + if (WEXITSTATUS(status) == 0) + break; + FAIL("#%d: unexpected exit status %u", + ptrace_stop, WEXITSTATUS(status)); + } + if (WIFSIGNALED(status)) { + /* tracee is no more */ + pid = 0; + FAIL("#%d: unexpected signal %u", + ptrace_stop, WTERMSIG(status)); + } + if (!WIFSTOPPED(status)) { + /* cannot happen */ + FAIL("#%d: unexpected wait status %#x", + ptrace_stop, status); + } + + switch (WSTOPSIG(status)) { + case SIGSTOP: + if (ptrace_stop) + FAIL("#%d: unexpected signal stop", + ptrace_stop); + if (do_ptrace(PTRACE_SETOPTIONS, pid, 0, + PTRACE_O_TRACESYSGOOD) < 0) { + /* cannot happen */ + PFAIL("PTRACE_SETOPTIONS"); + } + printf("ptrace(PTRACE_SETOPTIONS, %d, NULL" + ", PTRACE_O_TRACESYSGOOD) = 0\n", pid); + + if (!test_none()) + goto done; + break; + + case SIGTRAP | 0x80: + switch (ptrace_stop) { + case 1: /* entering chdir */ + case 3: /* entering gettid */ + case 5: /* entering exit_group */ + test_entry(); + break; + case 2: /* exiting chdir */ + case 4: /* exiting gettid */ + test_exit(); + break; + default: + FAIL("#%d: unexpected syscall stop", + ptrace_stop); + } + break; + + default: + FAIL("#%d: unexpected stop signal %#x", + ptrace_stop, WSTOPSIG(status)); + } + + if (do_ptrace(PTRACE_SYSCALL, pid, 0, 0) < 0) { + /* cannot happen */ + PFAIL("PTRACE_SYSCALL"); + } + printf("ptrace(PTRACE_SYSCALL, %d, NULL, 0) = 0\n", pid); + } + +done: + if (pid) { + kill_tracee(); + waitpid(pid, NULL, 0); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/ptrace_syscall_info.gen.test b/tests/ptrace_syscall_info.gen.test new file mode 100755 index 00000000..1314eee6 --- /dev/null +++ b/tests/ptrace_syscall_info.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ptrace_syscall_info -a35 -e signal=none -e trace=ptrace); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 -e signal=none -e trace=ptrace diff --git a/tests/pure_executables.am b/tests/pure_executables.am new file mode 100644 index 00000000..cc844502 --- /dev/null +++ b/tests/pure_executables.am @@ -0,0 +1,522 @@ +# Generated by ./tests/gen_pure_executables.sh from ./tests/pure_executables.list; do not edit. +PURE_EXECUTABLES = \ + _newselect \ + accept \ + accept4 \ + access \ + acct \ + add_key \ + adjtimex \ + aio \ + aio_pgetevents \ + alarm \ + bpf \ + bpf-obj_get_info_by_fd \ + bpf-obj_get_info_by_fd-prog \ + bpf-obj_get_info_by_fd-prog-v \ + bpf-obj_get_info_by_fd-v \ + bpf-v \ + brk \ + btrfs \ + caps \ + chmod \ + chown \ + chown32 \ + chroot \ + clock_adjtime \ + clock_nanosleep \ + clock_xettime \ + copy_file_range \ + creat \ + delete_module \ + dev-yy \ + dup \ + dup2 \ + dup3 \ + epoll_create \ + epoll_create1 \ + epoll_ctl \ + epoll_pwait \ + epoll_wait \ + erestartsys \ + eventfd \ + execve \ + execveat \ + faccessat \ + fadvise64 \ + fadvise64_64 \ + fallocate \ + fanotify_init \ + fanotify_mark \ + fanotify_mark-Xabbrev \ + fanotify_mark-Xraw \ + fanotify_mark-Xverbose \ + fchdir \ + fchmod \ + fchmodat \ + fchown \ + fchown32 \ + fchownat \ + fcntl \ + fcntl64 \ + fdatasync \ + fflush \ + file_handle \ + file_ioctl \ + finit_module \ + flock \ + fstat \ + fstat-Xabbrev \ + fstat-Xraw \ + fstat-Xverbose \ + fstat64 \ + fstat64-Xabbrev \ + fstat64-Xraw \ + fstat64-Xverbose \ + fstatat64 \ + fstatfs \ + fstatfs64 \ + fsync \ + ftruncate \ + ftruncate64 \ + futex \ + futimesat \ + get_mempolicy \ + getcpu \ + getcwd \ + getdents \ + getdents64 \ + getegid \ + getegid32 \ + geteuid \ + geteuid32 \ + getgid \ + getgid32 \ + getgroups \ + getgroups32 \ + getpeername \ + getpgrp \ + getpid \ + getppid \ + getrandom \ + getresgid \ + getresgid32 \ + getresuid \ + getresuid32 \ + getrlimit \ + getrusage \ + getsid \ + getsockname \ + getuid \ + getuid32 \ + getxxid \ + group_req \ + inet-cmsg \ + init_module \ + inotify \ + inotify_init1 \ + io_uring_enter \ + io_uring_register \ + io_uring_setup \ + ioctl \ + ioctl_block \ + ioctl_dm \ + ioctl_evdev \ + ioctl_inotify \ + ioctl_kvm_run \ + ioctl_kvm_run-v \ + ioctl_kvm_run_auxstr_vcpu \ + ioctl_loop \ + ioctl_mtd \ + ioctl_nbd \ + ioctl_perf \ + ioctl_ptp \ + ioctl_random \ + ioctl_rtc \ + ioctl_scsi \ + ioctl_sg_io_v3 \ + ioctl_sg_io_v4 \ + ioctl_sock_gifconf \ + ioctl_uffdio \ + ioctl_v4l2 \ + ioperm \ + iopl \ + ioprio \ + ioprio-Xabbrev \ + ioprio-Xraw \ + ioprio-Xverbose \ + ip_mreq \ + ipc \ + ipc_msg \ + ipc_msg-Xabbrev \ + ipc_msg-Xraw \ + ipc_msg-Xverbose \ + ipc_msgbuf \ + ipc_msgbuf-Xabbrev \ + ipc_msgbuf-Xraw \ + ipc_msgbuf-Xverbose \ + ipc_sem \ + ipc_sem-Xabbrev \ + ipc_sem-Xraw \ + ipc_sem-Xverbose \ + ipc_shm \ + ipc_shm-Xabbrev \ + ipc_shm-Xraw \ + ipc_shm-Xverbose \ + kcmp \ + kcmp-y \ + kern_features \ + kernel_version \ + kernel_version-Xabbrev \ + kernel_version-Xraw \ + kernel_version-Xverbose \ + kexec_file_load \ + kexec_load \ + keyctl \ + keyctl-Xabbrev \ + keyctl-Xraw \ + keyctl-Xverbose \ + kill \ + lchown \ + lchown32 \ + link \ + linkat \ + llseek \ + lookup_dcookie \ + lseek \ + lstat \ + lstat64 \ + madvise \ + mbind \ + membarrier \ + memfd_create \ + memfd_create-Xabbrev \ + memfd_create-Xraw \ + memfd_create-Xverbose \ + migrate_pages \ + mincore \ + mkdir \ + mkdirat \ + mknod \ + mknodat \ + mlock \ + mlock2 \ + mlockall \ + mmap \ + mmap-Xabbrev \ + mmap-Xraw \ + mmap-Xverbose \ + mmap64 \ + mmap64-Xabbrev \ + mmap64-Xraw \ + mmap64-Xverbose \ + mmsg \ + mmsg_name \ + modify_ldt \ + mount \ + mount-Xabbrev \ + mount-Xraw \ + mount-Xverbose \ + move_pages \ + move_pages-Xabbrev \ + move_pages-Xraw \ + move_pages-Xverbose \ + mq \ + mq_sendrecv \ + mq_sendrecv-read \ + mq_sendrecv-write \ + msg_control \ + msg_name \ + munlockall \ + nanosleep \ + net-icmp_filter \ + net-packet_mreq \ + net-packet_mreq-Xabbrev \ + net-packet_mreq-Xraw \ + net-packet_mreq-Xverbose \ + net-sockaddr \ + net-tpacket_req \ + net-tpacket_stats \ + net-y-unix \ + net-yy-inet \ + net-yy-inet6 \ + net-yy-netlink \ + net-yy-unix \ + netlink_audit \ + netlink_crypto \ + netlink_generic \ + netlink_kobject_uevent \ + netlink_netfilter \ + netlink_protocol \ + netlink_route \ + netlink_selinux \ + netlink_sock_diag \ + netlink_xfrm \ + newfstatat \ + nfnetlink_acct \ + nfnetlink_cthelper \ + nfnetlink_ctnetlink \ + nfnetlink_ctnetlink_exp \ + nfnetlink_cttimeout \ + nfnetlink_ipset \ + nfnetlink_nft_compat \ + nfnetlink_nftables \ + nfnetlink_osf \ + nfnetlink_queue \ + nfnetlink_ulog \ + nlattr \ + nlattr_br_port_msg \ + nlattr_crypto_user_alg \ + nlattr_dcbmsg \ + nlattr_fib_rule_hdr \ + nlattr_ifaddrlblmsg \ + nlattr_ifaddrmsg \ + nlattr_ifinfomsg \ + nlattr_ifla_af_spec \ + nlattr_ifla_brport \ + nlattr_ifla_linkinfo \ + nlattr_ifla_port \ + nlattr_ifla_xdp \ + nlattr_inet_diag_msg \ + nlattr_inet_diag_req_compat \ + nlattr_inet_diag_req_v2 \ + nlattr_mdba_mdb_entry \ + nlattr_mdba_router_port \ + nlattr_ndmsg \ + nlattr_ndtmsg \ + nlattr_netconfmsg \ + nlattr_netlink_diag_msg \ + nlattr_nlmsgerr \ + nlattr_packet_diag_msg \ + nlattr_rtgenmsg \ + nlattr_rtmsg \ + nlattr_smc_diag_msg \ + nlattr_tc_stats \ + nlattr_tca_stab \ + nlattr_tcamsg \ + nlattr_tcmsg \ + nlattr_unix_diag_msg \ + old_mmap \ + old_mmap-P \ + old_mmap-Xabbrev \ + old_mmap-Xraw \ + old_mmap-Xverbose \ + old_mmap-v-none \ + oldfstat \ + oldlstat \ + oldselect \ + oldselect-efault \ + oldstat \ + open \ + openat \ + osf_utimes \ + pause \ + perf_event_open \ + personality \ + personality-Xabbrev \ + personality-Xraw \ + personality-Xverbose \ + pidfd_send_signal \ + pipe \ + pipe2 \ + pkey_alloc \ + pkey_free \ + pkey_mprotect \ + poll \ + poll-P \ + ppoll \ + ppoll-P \ + prctl-arg2-intptr \ + prctl-dumpable \ + prctl-name \ + prctl-no-args \ + prctl-pdeathsig \ + prctl-securebits \ + prctl-tid_address \ + prctl-tsc \ + pread64-pwrite64 \ + preadv \ + preadv-pwritev \ + preadv2-pwritev2 \ + printpath-umovestr \ + printpath-umovestr-peekdata \ + printpath-umovestr-undumpable \ + printsignal-Xabbrev \ + printsignal-Xraw \ + printsignal-Xverbose \ + printstr \ + printstrn-umoven \ + printstrn-umoven-peekdata \ + printstrn-umoven-undumpable \ + prlimit64 \ + process_vm_readv \ + process_vm_writev \ + pselect6 \ + ptrace \ + ptrace_syscall_info \ + pwritev \ + quotactl \ + quotactl-Xabbrev \ + quotactl-Xraw \ + quotactl-Xverbose \ + quotactl-xfs \ + read-write \ + readahead \ + readdir \ + readlink \ + readlinkat \ + readv \ + reboot \ + recvfrom \ + recvmmsg-timeout \ + recvmsg \ + remap_file_pages \ + remap_file_pages-Xabbrev \ + remap_file_pages-Xraw \ + remap_file_pages-Xverbose \ + rename \ + renameat \ + renameat2 \ + request_key \ + riscv_flush_icache \ + rmdir \ + rt_sigaction \ + rt_sigpending \ + rt_sigprocmask \ + rt_sigqueueinfo \ + rt_sigreturn \ + rt_sigsuspend \ + rt_sigtimedwait \ + rt_tgsigqueueinfo \ + s390_guarded_storage \ + s390_guarded_storage-v \ + s390_pci_mmio_read_write \ + s390_runtime_instr \ + s390_sthyi \ + s390_sthyi-v \ + sched_get_priority_mxx \ + sched_rr_get_interval \ + sched_xetaffinity \ + sched_xetattr \ + sched_xetparam \ + sched_xetscheduler \ + sched_yield \ + seccomp-filter \ + seccomp_get_action_avail \ + select \ + semop \ + sendfile \ + sendfile64 \ + set_mempolicy \ + setdomainname \ + setfsgid \ + setfsgid32 \ + setfsuid \ + setfsuid32 \ + setgid \ + setgid32 \ + setgroups \ + setgroups32 \ + sethostname \ + setns \ + setregid \ + setregid32 \ + setresgid \ + setresgid32 \ + setresuid \ + setresuid32 \ + setreuid \ + setreuid32 \ + setrlimit \ + setrlimit-Xabbrev \ + setrlimit-Xraw \ + setrlimit-Xverbose \ + setuid \ + setuid32 \ + shmxt \ + shutdown \ + sigaction \ + sigaltstack \ + siginfo \ + signal \ + signalfd4 \ + sigpending \ + sigprocmask \ + sigreturn \ + sigsuspend \ + so_error \ + so_linger \ + so_peercred \ + so_peercred-Xabbrev \ + so_peercred-Xraw \ + so_peercred-Xverbose \ + sock_filter-v \ + sock_filter-v-Xabbrev \ + sock_filter-v-Xraw \ + sock_filter-v-Xverbose \ + sockaddr_xlat-Xabbrev \ + sockaddr_xlat-Xraw \ + sockaddr_xlat-Xverbose \ + socketcall \ + sockopt-sol_netlink \ + sockopt-timestamp \ + splice \ + stat \ + stat64 \ + statfs \ + statfs64 \ + statx \ + swap \ + sxetmask \ + symlink \ + symlinkat \ + sync \ + sync_file_range \ + sync_file_range2 \ + sysinfo \ + syslog \ + tee \ + time \ + timer_create \ + timer_xettime \ + timerfd_xettime \ + times \ + times-fail \ + truncate \ + truncate64 \ + ugetrlimit \ + uio \ + umask \ + umount \ + umount2 \ + umoven-illptr \ + umovestr \ + umovestr-illptr \ + umovestr2 \ + umovestr3 \ + uname \ + unlink \ + unlinkat \ + unshare \ + userfaultfd \ + ustat \ + utime \ + utimensat \ + utimensat-Xabbrev \ + utimensat-Xraw \ + utimensat-Xverbose \ + utimes \ + vhangup \ + vmsplice \ + wait4 \ + waitid \ + waitpid \ + xattr \ + xattr-strings \ + xet_robust_list \ + xet_thread_area_x86 \ + xetitimer \ + xetpgid \ + xetpriority \ + xettimeofday \ + # diff --git a/tests/pure_executables.list b/tests/pure_executables.list new file mode 100755 index 00000000..37225209 --- /dev/null +++ b/tests/pure_executables.list @@ -0,0 +1,526 @@ +# Executables without side effects. +# +# Copyright (c) 2017-2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +_newselect +accept +accept4 +access +acct +add_key +adjtimex +aio +aio_pgetevents +alarm +bpf +bpf-obj_get_info_by_fd +bpf-obj_get_info_by_fd-prog +bpf-obj_get_info_by_fd-prog-v +bpf-obj_get_info_by_fd-v +bpf-v +brk +btrfs +caps +chmod +chown +chown32 +chroot +clock_adjtime +clock_nanosleep +clock_xettime +copy_file_range +creat +delete_module +dev-yy +dup +dup2 +dup3 +epoll_create +epoll_create1 +epoll_ctl +epoll_pwait +epoll_wait +erestartsys +eventfd +execve +execveat +faccessat +fadvise64 +fadvise64_64 +fallocate +fanotify_init +fanotify_mark +fanotify_mark-Xabbrev +fanotify_mark-Xraw +fanotify_mark-Xverbose +fchdir +fchmod +fchmodat +fchown +fchown32 +fchownat +fcntl +fcntl64 +fdatasync +fflush +file_handle +file_ioctl +finit_module +flock +fstat +fstat-Xabbrev +fstat-Xraw +fstat-Xverbose +fstat64 +fstat64-Xabbrev +fstat64-Xraw +fstat64-Xverbose +fstatat64 +fstatfs +fstatfs64 +fsync +ftruncate +ftruncate64 +futex +futimesat +get_mempolicy +getcpu +getcwd +getdents +getdents64 +getegid +getegid32 +geteuid +geteuid32 +getgid +getgid32 +getgroups +getgroups32 +getpeername +getpgrp +getpid +getppid +getrandom +getresgid +getresgid32 +getresuid +getresuid32 +getrlimit +getrusage +getsid +getsockname +getuid +getuid32 +getxxid +group_req +inet-cmsg +init_module +inotify +inotify_init1 +io_uring_enter +io_uring_register +io_uring_setup +ioctl +ioctl_block +ioctl_dm +ioctl_evdev +ioctl_inotify +ioctl_kvm_run +ioctl_kvm_run-v +ioctl_kvm_run_auxstr_vcpu +ioctl_loop +ioctl_mtd +ioctl_nbd +ioctl_perf +ioctl_ptp +ioctl_random +ioctl_rtc +ioctl_scsi +ioctl_sg_io_v3 +ioctl_sg_io_v4 +ioctl_sock_gifconf +ioctl_uffdio +ioctl_v4l2 +ioperm +iopl +ioprio +ioprio-Xabbrev +ioprio-Xraw +ioprio-Xverbose +ip_mreq +ipc +ipc_msg +ipc_msg-Xabbrev +ipc_msg-Xraw +ipc_msg-Xverbose +ipc_msgbuf +ipc_msgbuf-Xabbrev +ipc_msgbuf-Xraw +ipc_msgbuf-Xverbose +ipc_sem +ipc_sem-Xabbrev +ipc_sem-Xraw +ipc_sem-Xverbose +ipc_shm +ipc_shm-Xabbrev +ipc_shm-Xraw +ipc_shm-Xverbose +kcmp +kcmp-y +kern_features +kernel_version +kernel_version-Xabbrev +kernel_version-Xraw +kernel_version-Xverbose +kexec_file_load +kexec_load +keyctl +keyctl-Xabbrev +keyctl-Xraw +keyctl-Xverbose +kill +lchown +lchown32 +link +linkat +llseek +lookup_dcookie +lseek +lstat +lstat64 +madvise +mbind +membarrier +memfd_create +memfd_create-Xabbrev +memfd_create-Xraw +memfd_create-Xverbose +migrate_pages +mincore +mkdir +mkdirat +mknod +mknodat +mlock +mlock2 +mlockall +mmap +mmap-Xabbrev +mmap-Xraw +mmap-Xverbose +mmap64 +mmap64-Xabbrev +mmap64-Xraw +mmap64-Xverbose +mmsg +mmsg_name +modify_ldt +mount +mount-Xabbrev +mount-Xraw +mount-Xverbose +move_pages +move_pages-Xabbrev +move_pages-Xraw +move_pages-Xverbose +mq +mq_sendrecv +mq_sendrecv-read +mq_sendrecv-write +msg_control +msg_name +munlockall +nanosleep +net-icmp_filter +net-packet_mreq +net-packet_mreq-Xabbrev +net-packet_mreq-Xraw +net-packet_mreq-Xverbose +net-sockaddr +net-tpacket_req +net-tpacket_stats +net-y-unix +net-yy-inet +net-yy-inet6 +net-yy-netlink +net-yy-unix +netlink_audit +netlink_crypto +netlink_generic +netlink_kobject_uevent +netlink_netfilter +netlink_protocol +netlink_route +netlink_selinux +netlink_sock_diag +netlink_xfrm +newfstatat +nfnetlink_acct +nfnetlink_cthelper +nfnetlink_ctnetlink +nfnetlink_ctnetlink_exp +nfnetlink_cttimeout +nfnetlink_ipset +nfnetlink_nft_compat +nfnetlink_nftables +nfnetlink_osf +nfnetlink_queue +nfnetlink_ulog +nlattr +nlattr_br_port_msg +nlattr_crypto_user_alg +nlattr_dcbmsg +nlattr_fib_rule_hdr +nlattr_ifaddrlblmsg +nlattr_ifaddrmsg +nlattr_ifinfomsg +nlattr_ifla_af_spec +nlattr_ifla_brport +nlattr_ifla_linkinfo +nlattr_ifla_port +nlattr_ifla_xdp +nlattr_inet_diag_msg +nlattr_inet_diag_req_compat +nlattr_inet_diag_req_v2 +nlattr_mdba_mdb_entry +nlattr_mdba_router_port +nlattr_ndmsg +nlattr_ndtmsg +nlattr_netconfmsg +nlattr_netlink_diag_msg +nlattr_nlmsgerr +nlattr_packet_diag_msg +nlattr_rtgenmsg +nlattr_rtmsg +nlattr_smc_diag_msg +nlattr_tc_stats +nlattr_tca_stab +nlattr_tcamsg +nlattr_tcmsg +nlattr_unix_diag_msg +old_mmap +old_mmap-P +old_mmap-Xabbrev +old_mmap-Xraw +old_mmap-Xverbose +old_mmap-v-none +oldfstat +oldlstat +oldselect +oldselect-efault +oldstat +open +openat +osf_utimes +pause +perf_event_open +personality +personality-Xabbrev +personality-Xraw +personality-Xverbose +pidfd_send_signal +pipe +pipe2 +pkey_alloc +pkey_free +pkey_mprotect +poll +poll-P +ppoll +ppoll-P +prctl-arg2-intptr +prctl-dumpable +prctl-name +prctl-no-args +prctl-pdeathsig +prctl-securebits +prctl-tid_address +prctl-tsc +pread64-pwrite64 +preadv +preadv-pwritev +preadv2-pwritev2 +printpath-umovestr +printpath-umovestr-peekdata +printpath-umovestr-undumpable +printsignal-Xabbrev +printsignal-Xraw +printsignal-Xverbose +printstr +printstrn-umoven +printstrn-umoven-peekdata +printstrn-umoven-undumpable +prlimit64 +process_vm_readv +process_vm_writev +pselect6 +ptrace +ptrace_syscall_info +pwritev +quotactl +quotactl-Xabbrev +quotactl-Xraw +quotactl-Xverbose +quotactl-xfs +read-write +readahead +readdir +readlink +readlinkat +readv +reboot +recvfrom +recvmmsg-timeout +recvmsg +remap_file_pages +remap_file_pages-Xabbrev +remap_file_pages-Xraw +remap_file_pages-Xverbose +rename +renameat +renameat2 +request_key +riscv_flush_icache +rmdir +rt_sigaction +rt_sigpending +rt_sigprocmask +rt_sigqueueinfo +rt_sigreturn +rt_sigsuspend +rt_sigtimedwait +rt_tgsigqueueinfo +s390_guarded_storage +s390_guarded_storage-v +s390_pci_mmio_read_write +s390_runtime_instr +s390_sthyi +s390_sthyi-v +sched_get_priority_mxx +sched_rr_get_interval +sched_xetaffinity +sched_xetattr +sched_xetparam +sched_xetscheduler +sched_yield +seccomp-filter +seccomp_get_action_avail +select +semop +sendfile +sendfile64 +set_mempolicy +setdomainname +setfsgid +setfsgid32 +setfsuid +setfsuid32 +setgid +setgid32 +setgroups +setgroups32 +sethostname +setns +setregid +setregid32 +setresgid +setresgid32 +setresuid +setresuid32 +setreuid +setreuid32 +setrlimit +setrlimit-Xabbrev +setrlimit-Xraw +setrlimit-Xverbose +setuid +setuid32 +shmxt +shutdown +sigaction +sigaltstack +siginfo +signal +signalfd4 +sigpending +sigprocmask +sigreturn +sigsuspend +so_error +so_linger +so_peercred +so_peercred-Xabbrev +so_peercred-Xraw +so_peercred-Xverbose +sock_filter-v +sock_filter-v-Xabbrev +sock_filter-v-Xraw +sock_filter-v-Xverbose +sockaddr_xlat-Xabbrev +sockaddr_xlat-Xraw +sockaddr_xlat-Xverbose +socketcall +sockopt-sol_netlink +sockopt-timestamp +splice +stat +stat64 +statfs +statfs64 +statx +swap +sxetmask +symlink +symlinkat +sync +sync_file_range +sync_file_range2 +sysinfo +syslog +tee +time +timer_create +timer_xettime +timerfd_xettime +times +times-fail +truncate +truncate64 +ugetrlimit +uio +umask +umount +umount2 +umoven-illptr +umovestr +umovestr-illptr +umovestr2 +umovestr3 +uname +unlink +unlinkat +unshare +userfaultfd +ustat +utime +utimensat +utimensat-Xabbrev +utimensat-Xraw +utimensat-Xverbose +utimes +vhangup +vmsplice +wait4 +waitid +waitpid +xattr +xattr-strings +xet_robust_list +xet_thread_area_x86 +xetitimer +xetpgid +xetpriority +xettimeofday diff --git a/tests/pwritev.c b/tests/pwritev.c index 58e5b41e..a1442ab4 100644 --- a/tests/pwritev.c +++ b/tests/pwritev.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -65,7 +46,7 @@ print_iovec(const struct iovec *iov, unsigned int cnt, unsigned int size) if (i) fputs(", ", stdout); if (i == size) { - printf("%p", &iov[i]); + printf("... /* %p */", &iov[i]); break; } if (i == LIM) { diff --git a/tests/pwritev.gen.test b/tests/pwritev.gen.test new file mode 100755 index 00000000..e54fd154 --- /dev/null +++ b/tests/pwritev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (pwritev -a22 -s7); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -s7 diff --git a/tests/pwritev.test b/tests/pwritev.test deleted file mode 100755 index 0aed6835..00000000 --- a/tests/pwritev.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check pwritev syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a22 -s7 diff --git a/tests/qual_fault-exit_group.test b/tests/qual_fault-exit_group.test index c98ffc6e..48a1b8c8 100755 --- a/tests/qual_fault-exit_group.test +++ b/tests/qual_fault-exit_group.test @@ -3,29 +3,10 @@ # Check decoding of fault injected exit_group syscall. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/scno_tampering.sh" @@ -41,13 +22,13 @@ test_with() match_diff } -test_with -eexit,exit_group -efault=exit_group:error=ENOSYS ./answer +test_with -eexit,exit_group -efault=exit_group:error=ENOSYS ../answer test_with -eexit,exit_group -efault=exit_group:error=ENOSYS \ - -efault=\!process:error=1 ./answer + -efault=\!process:error=1 ../answer test_with -eexit,exit_group -efault=all:error=ENOSYS \ - -efault=exit:error=1:when=2+ ./answer + -efault=exit:error=1:when=2+ ../answer test_with -eexit,exit_group -efault=exit_group:error=ENOSYS \ - -efault=\!desc,file,memory,process,signal,network,ipc:error=1 ./answer + -efault=\!%desc,%file,%memory,%process,%signal,%network,%ipc:error=1 ../answer diff --git a/tests/qual_fault-syntax.test b/tests/qual_fault-syntax.test index 85093fc7..c4fd27bf 100755 --- a/tests/qual_fault-syntax.test +++ b/tests/qual_fault-syntax.test @@ -2,30 +2,10 @@ # # Check -e fault= syntax. # -# Copyright (c) 2016=2017 Dmitry V. Levin +# Copyright (c) 2016-2018 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -40,16 +20,7 @@ fail_with() "strace -e fault=$* failed to handle an argument error properly" } -for arg in '' , ,, ,,, : :: ::: \! \!, \!: \ - invalid_syscall_name \ - invalid_syscall_name:when=3 \ - -1 \!-1 \ - -1:when=4 \ - -2 \ - -2:when=5 \ - 32767 \!32767 \ - 32767:when=6 \ - chdir:42 \!chdir:42 \ +for arg in chdir:42 \!chdir:42 \ chdir:42:when=7 \ chdir:invalid \ chdir:invalid:when=8 \ @@ -92,15 +63,15 @@ for arg in '' , ,, ,,, : :: ::: \! \!, \!: \ chdir:when=65536:error=30 \ chdir:when=1+65536 \ chdir:when=1+65536:error=31 \ - file,nonsense \ - \!desc,nonsense \ - chdir,nonsense \ - \!chdir,nonsense \ - 1,nonsense \ - \!1,nonsense \ chdir:retval=0 \ chdir:signal=1 \ chdir:error=1:error=2 \ + chdir:syscall=invalid \ + chdir:syscall=chdir \ + chdir:syscall=%file \ + chdir:syscall=-42 \ + chdir:syscall=42 \ + chdir:syscall=gettid:syscall=gettid \ ; do $STRACE -e fault="$arg" true 2> "$LOG" && fail_with "$arg" diff --git a/tests/qual_fault-syscall.test b/tests/qual_fault-syscall.test new file mode 100755 index 00000000..cae97f5e --- /dev/null +++ b/tests/qual_fault-syscall.test @@ -0,0 +1,3 @@ +suffix=:syscall=gettid +name_override=qual_fault +. "${srcdir=.}/qual_fault.test" diff --git a/tests/qual_fault.c b/tests/qual_fault.c index d26dc7ce..63bbade0 100644 --- a/tests/qual_fault.c +++ b/tests/qual_fault.c @@ -2,44 +2,29 @@ * Check that fault injection works properly. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include #include +#include +#include #include #include #include #include #include #include +#include -static const int expfd = 4; -static const int gotfd = 5; +static int exp_fd; +static int got_fd; +static int out_fd; #define DEFAULT_ERRNO ENOSYS @@ -57,13 +42,13 @@ invoke(int fail) int rc; if (!fail) { - rc = write(expfd, io.iov_base, io.iov_len); + rc = write(exp_fd, io.iov_base, io.iov_len); if (rc != (int) io.iov_len) perror_msg_and_fail("write"); } errno = 0; - rc = writev(gotfd, &io, 1); + rc = writev(got_fd, &io, 1); if (fail) { if (!(rc == -1 && errno == err)) @@ -72,12 +57,13 @@ invoke(int fail) err, rc, errno); if (is_raw) - tprintf("writev(%#x, %p, 0x1) = -1 (errno %d)" - " (INJECTED)\n", gotfd, &io, err); + tprintf("writev(%#x, %p, 0x1)" + " = -1 %s (%m) (INJECTED)\n", + got_fd, &io, errstr); else tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%d}], 1)" " = -1 %s (%m) (INJECTED)\n", - gotfd, buf, (int) io.iov_len, errstr); + got_fd, buf, (int) io.iov_len, errstr); } else { if (rc != (int) io.iov_len) perror_msg_and_fail("expected %d" @@ -85,23 +71,35 @@ invoke(int fail) (int) io.iov_len, rc, errno); if (is_raw) - tprintf("writev(%#x, %p, 0x1) = %#x\n", gotfd, &io, rc); + tprintf("writev(%#x, %p, 0x1) = %#x\n", + got_fd, &io, rc); else tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%d}], 1)" " = %d\n", - gotfd, buf, (int) io.iov_len, (int) io.iov_len); + got_fd, buf, (int) io.iov_len, + (int) io.iov_len); } } -int -main(int argc, char *argv[]) +static int +open_file(const char *prefix, int proc) { - struct stat st; + static const int open_flags = O_WRONLY | O_TRUNC | O_CREAT; + static char path[PATH_MAX + 1]; + + snprintf(path, sizeof(path), "%s.%d", prefix, proc); - assert(fstat(expfd, &st) == 0); - assert(fstat(gotfd, &st) == 0); + int fd = open(path, open_flags, 0600); + if (fd < 0) + perror_msg_and_fail("open: %s", path); - assert(argc == 6); + return fd; +} + +int +main(int argc, char *argv[]) +{ + assert(argc == 11); is_raw = !strcmp("raw", argv[1]); @@ -124,25 +122,71 @@ main(int argc, char *argv[]) first = atoi(argv[3]); step = atoi(argv[4]); iter = atoi(argv[5]); + int num_procs = atoi(argv[6]); + char *exp_prefix = argv[7]; + char *got_prefix = argv[8]; + char *out_prefix = argv[9]; + char *pid_prefix = argv[10]; assert(first > 0); assert(step >= 0); + assert(num_procs > 0); + + int proc; + for (proc = 0; proc < num_procs; ++proc) { + int ret = fork(); - tprintf("%s", ""); + if (ret < 0) + perror_msg_and_fail("fork"); - int i; - for (i = 1; i <= iter; ++i) { - int fail = 0; - if (first > 0) { - --first; - if (first == 0) { - fail = 1; - first = step; + if (ret > 0) { + int pidfd = open_file(pid_prefix, proc); + + char pidstr[sizeof(ret) * 3]; + int len = snprintf(pidstr, sizeof(pidstr), "%d", ret); + assert(len > 0 && len < (int) sizeof(pidstr)); + assert(write(pidfd, pidstr, len) == len); + + close(pidfd); + + continue; + } + + tprintf("%s", ""); + + exp_fd = open_file(exp_prefix, proc); + got_fd = open_file(got_prefix, proc); + out_fd = open_file(out_prefix, proc); + + /* This magic forces tprintf to write where we want it. */ + dup2(out_fd, 3); + + int i; + for (i = 1; i <= iter; ++i) { + int fail = 0; + if (first > 0) { + --first; + if (first == 0) { + fail = 1; + first = step; + } } + invoke(fail); } - invoke(fail); + + tprintf("%s\n", "+++ exited with 0 +++"); + return 0; + } + + for (proc = 0; proc < num_procs; ++proc) { + int status; + int ret = wait(&status); + if (ret <= 0) + perror_msg_and_fail("wait %d", proc); + if (status) + error_msg_and_fail("wait: pid=%d status=%d", + ret, status); } - tprintf("%s\n", "+++ exited with 0 +++"); return 0; } diff --git a/tests/qual_fault.test b/tests/qual_fault.test index e194a787..497e35ea 100755 --- a/tests/qual_fault.test +++ b/tests/qual_fault.test @@ -1,31 +1,12 @@ -#!/bin/sh +#!/bin/sh -efu # # Check that fault injection works properly. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/scno_tampering.sh" @@ -34,16 +15,20 @@ # F+ # F+S -N=16 +N=100 + +: ${suffix=} +[ -z "${name_override-}" ] || NAME="$name_override" check_fault_injection() { - local trace fault err first step extra + local trace fault err first step procs extra trace=$1; shift fault=$1; shift err=$1; shift first=$1; shift step=$1; shift + procs=$1; shift extra="$*" local when= @@ -73,31 +58,39 @@ check_fault_injection() outexp="$NAME.out.exp" outgot="$NAME.out.got" + outout="$NAME.out.out" + outpid="$NAME.pid" + + run_strace -a11 -ff -e trace=$trace \ + "$@" -e fault=$fault$when$error$suffix $extra \ + ../$NAME $raw "$err" "$first" "$step" $N \ + "$procs" "$outexp" "$outgot" "$outout" "$outpid" - run_strace -a11 -e trace=$trace \ - "$@" -e fault=$fault$when$error $extra \ - ./$NAME $raw "$err" "$first" "$step" $N \ - > "$EXP" 4> "$outexp" 5> "$outgot" + for i in $(seq 0 $((procs - 1)) ) + do + pid=$(cat "$outpid.$i") - match_diff "$EXP" "$LOG" - match_diff "$outexp" "$outgot" - rm -f "$EXP" "$outexp" "$outgot" + match_diff "$LOG.$pid" "$outout.$i" + match_diff "$outgot.$i" "$outexp.$i" + done } for err in '' ENOSYS 22 einval; do for fault in writev desc,51; do check_fault_injection \ - writev $fault "$err" '' '' -efault=chdir + writev $fault "$err" '' '' 1 -efault=chdir check_fault_injection \ - writev $fault "$err" '' '' -efault=chdir -efault=none + writev $fault "$err" '' '' 1 -efault=chdir -efault=none for F in 1 2 3 5 7 11; do check_fault_injection \ - writev $fault "$err" $F '' + writev $fault "$err" $F '' 1 check_fault_injection \ - writev $fault "$err" $F + + writev $fault "$err" $F + 1 for S in 1 2 3 5 7 11; do check_fault_injection \ - writev $fault "$err" $F $S + writev $fault "$err" $F $S 1 + check_fault_injection \ + writev $fault "$err" $F $S 4 done done done diff --git a/tests/qual_inject-error-signal-syscall.test b/tests/qual_inject-error-signal-syscall.test new file mode 100755 index 00000000..0adb35d7 --- /dev/null +++ b/tests/qual_inject-error-signal-syscall.test @@ -0,0 +1,3 @@ +suffix=:syscall=gettid +name_override=qual_inject-error-signal +. "${srcdir=.}/qual_inject-error-signal.test" diff --git a/tests/qual_inject-error-signal.c b/tests/qual_inject-error-signal.c index f4ccd824..4c89d78a 100644 --- a/tests/qual_inject-error-signal.c +++ b/tests/qual_inject-error-signal.c @@ -1,30 +1,10 @@ /* * Check fault injection along with signal injection. * - * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/qual_inject-error-signal.test b/tests/qual_inject-error-signal.test index fcbcc398..2392e8bd 100755 --- a/tests/qual_inject-error-signal.test +++ b/tests/qual_inject-error-signal.test @@ -1,8 +1,18 @@ #!/bin/sh - +# # Check fault injection along with signal injection. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/scno_tampering.sh" -run_strace -a12 -echdir,exit_group -einject=chdir:error=ENOENT:signal=USR1 \ - "./$NAME" +: ${suffix=} +[ -z "${name_override-}" ] || NAME="$name_override" + +run_strace -a12 -echdir,exit_group \ + -einject=chdir:error=ENOENT:signal=USR1"$suffix" \ + "../$NAME" match_diff diff --git a/tests/qual_inject-retval-syscall.test b/tests/qual_inject-retval-syscall.test new file mode 100755 index 00000000..fca9354c --- /dev/null +++ b/tests/qual_inject-retval-syscall.test @@ -0,0 +1,3 @@ +suffix=:syscall=gettid +name_override=qual_inject-retval +. "${srcdir=.}/qual_inject-retval.test" diff --git a/tests/qual_inject-retval.c b/tests/qual_inject-retval.c index ac9801eb..16419a49 100644 --- a/tests/qual_inject-retval.c +++ b/tests/qual_inject-retval.c @@ -2,29 +2,10 @@ * Check success injection. * * Copyright (c) 2017 Elvira Khabirova + * Copyright (c) 2017-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/qual_inject-retval.test b/tests/qual_inject-retval.test index 419030ad..956d373d 100755 --- a/tests/qual_inject-retval.test +++ b/tests/qual_inject-retval.test @@ -1,9 +1,17 @@ #!/bin/sh - +# # Check success injection. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/scno_tampering.sh" +: ${suffix=} +[ -z "${name_override-}" ] || NAME="$name_override" + check_injection() { local syscall rval @@ -11,10 +19,9 @@ check_injection() syscall=chdir rval="$1"; shift - run_strace -a12 -e$syscall -einject="$syscall:retval=$rval" "$@" \ - ./qual_inject-retval "$rval" > "$EXP" + run_strace -a12 -e$syscall -einject="$syscall:retval=$rval$suffix" "$@" \ + ../qual_inject-retval "$rval" > "$EXP" match_diff "$LOG" "$EXP" - rm -f "$EXP" } check_injection 0 diff --git a/tests/qual_inject-signal-syscall.test b/tests/qual_inject-signal-syscall.test new file mode 100755 index 00000000..42e9a268 --- /dev/null +++ b/tests/qual_inject-signal-syscall.test @@ -0,0 +1,3 @@ +suffix=:syscall=gettid +name_override=qual_inject-signal +. "${srcdir=.}/qual_inject-signal.test" diff --git a/tests/qual_inject-signal.c b/tests/qual_inject-signal.c index ff56a286..c09b8322 100644 --- a/tests/qual_inject-signal.c +++ b/tests/qual_inject-signal.c @@ -1,30 +1,10 @@ /* * Check that signal injection works properly. * - * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/qual_inject-signal.test b/tests/qual_inject-signal.test index 88002ce9..54a3498d 100755 --- a/tests/qual_inject-signal.test +++ b/tests/qual_inject-signal.test @@ -1,8 +1,17 @@ #!/bin/sh - +# # Check signal injection. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + . "${srcdir=.}/init.sh" -run_strace -a12 -echdir,exit_group -einject=chdir:signal=USR1 \ - ./$NAME +: ${suffix=} +[ -z "${name_override-}" ] || NAME="$name_override" + +run_strace -a12 -echdir,exit_group -einject=chdir:signal=USR1"$suffix" \ + ../$NAME match_diff diff --git a/tests/qual_inject-syntax.test b/tests/qual_inject-syntax.test index a9e44d74..53245345 100755 --- a/tests/qual_inject-syntax.test +++ b/tests/qual_inject-syntax.test @@ -2,30 +2,10 @@ # # Check -e inject= syntax. # -# Copyright (c) 2016-2017 Dmitry V. Levin +# Copyright (c) 2016-2018 Dmitry V. Levin # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -40,17 +20,7 @@ fail_with() "strace -e inject=$* failed to handle an argument error properly" } -for arg in '' , ,, ,,, : :: ::: \! \!, \!: \ - invalid_syscall_name \ - invalid_syscall_name:when=3 \ - -1 \!-1 \ - -1:when=4 \ - -2 \ - -2:when=5 \ - 32767 \!32767 \ - 32767:when=6 \ - 42 \ - chdir \ +for arg in 42 chdir \ chdir:42 \!chdir:42 \ chdir:42:when=7 \ chdir:invalid \ @@ -94,20 +64,30 @@ for arg in '' , ,, ,,, : :: ::: \! \!, \!: \ chdir:when=65536:error=30 \ chdir:when=1+65536 \ chdir:when=1+65536:error=31 \ - file,nonsense \ - \!desc,nonsense \ - chdir,nonsense \ - \!chdir,nonsense \ - 1,nonsense \ - \!1,nonsense \ - chdir:retval=-1 \ + chdir:retval=a \ + chdir:retval=0b \ + chdir:retval=0x10000000000000000 \ chdir:signal=0 \ chdir:signal=129 \ + chdir:signal=1:signal=2 \ + chdir:signal=1:retval=0:signal=2 \ chdir:retval=0:retval=1 \ chdir:error=1:error=2 \ chdir:retval=0:error=1 \ chdir:error=1:retval=0 \ chdir:retval=0:signal=1:error=1 \ + chdir:delay_enter=-1 \ + chdir:delay_exit=-2 \ + chdir:delay_enter=1:delay_enter=2 \ + chdir:delay_exit=3:delay_exit=4 \ + chdir:delay_enter=5:delay_exit=6:delay_enter=7 \ + chdir:delay_exit=8:delay_enter=9:delay_exit=10 \ + chdir:syscall=invalid \ + chdir:syscall=chdir \ + chdir:syscall=%file \ + chdir:syscall=-42 \ + chdir:syscall=42 \ + chdir:syscall=gettid:syscall=gettid \ ; do $STRACE -e inject="$arg" true 2> "$LOG" && fail_with "$arg" diff --git a/tests/qual_signal.c b/tests/qual_signal.c index 106dabea..31dc8f7d 100644 --- a/tests/qual_signal.c +++ b/tests/qual_signal.c @@ -1,30 +1,10 @@ /* * Check how strace -e signal=set works. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/qual_signal.test b/tests/qual_signal.test index 54a37a30..8fd2b69d 100755 --- a/tests/qual_signal.test +++ b/tests/qual_signal.test @@ -3,29 +3,10 @@ # Check how strace -e signal=set works. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -34,10 +15,9 @@ test_one_sig() local sigs sigs="$1"; shift - run_prog "./$NAME" "$@" > /dev/null - run_strace -e trace=none -e signal="$sigs" "./$NAME" "$@" > "$EXP" + run_prog "../$NAME" "$@" > /dev/null + run_strace -e trace=none -e signal="$sigs" "../$NAME" "$@" > "$EXP" match_diff "$LOG" "$EXP" - rm -f "$EXP" } test_sigs() diff --git a/tests/qual_syscall.test b/tests/qual_syscall.test index f7eb06d5..945fc8c7 100755 --- a/tests/qual_syscall.test +++ b/tests/qual_syscall.test @@ -2,20 +2,25 @@ # Check how strace -e abbrev=set, -e raw=set, -e trace=set, # and -e verbose=set work. +# +# Copyright (c) 2014-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./umovestr -pattern_abbrev_verbose='execve("\./umovestr", \["\./umovestr"\], \[/\* [[:digit:]]* vars \*/\]) = 0' -pattern_nonabbrev_verbose='execve("\./umovestr", \["\./umovestr"\], \[".*\"\(\.\.\.\)\?\]) = 0' -pattern_nonverbose='execve("\./umovestr", 0x[[:xdigit:]]*, 0x[[:xdigit:]]*) = 0' +run_prog ../umovestr +pattern_abbrev_verbose='execve("\.\./umovestr", \["\.\./umovestr"\], 0x[[:xdigit:]]* /\* [[:digit:]]* vars \*/) = 0' +pattern_nonabbrev_verbose='execve("\.\./umovestr", \["\.\./umovestr"\], \[".*\"\(\.\.\.\)\?\]) = 0' +pattern_nonverbose='execve("\.\./umovestr", 0x[[:xdigit:]]*, 0x[[:xdigit:]]*) = 0' pattern_raw='execve(0x[[:xdigit:]]*, 0x[[:xdigit:]]*, 0x[[:xdigit:]]*) = 0' check_output_mismatch() { local pattern pattern="$1"; shift - run_strace "$@" ./umovestr + run_strace "$@" ../umovestr LC_ALL=C grep -x "$pattern" "$LOG" > /dev/null || { printf '%s\n%s\n' \ 'Failed patterns of expected output:' "$pattern" @@ -28,15 +33,19 @@ LC_ALL=C grep -v -x "$pattern_abbrev_verbose" "$LOG" | LC_ALL=C grep '^[[:alnum:]_]*(' > /dev/null && dump_log_and_fail_with "$STRACE $args unexpected output" -check_output_mismatch "$pattern_abbrev_verbose" -e trace=process +check_output_mismatch "$pattern_abbrev_verbose" -e trace=%process LC_ALL=C grep '^chdir' "$LOG" > /dev/null && dump_log_and_fail_with "$STRACE $args unexpected output" -run_strace -e 42 ./umovestr +run_strace -e 42 ../umovestr LC_ALL=C grep '^[[:alnum:]_]*(' "$LOG" > /dev/null && dump_log_and_fail_with "$STRACE $args unexpected output" -for a in execve \!chdir all \!none \ +run_strace -e/ -e42 ../umovestr +LC_ALL=C grep '^[[:alnum:]_]*(' "$LOG" > /dev/null && + dump_log_and_fail_with "$STRACE $args unexpected output" + +for a in execve \!chdir /. all \!none \ file process \!desc \!ipc \!memory \!network \!signal; do check_output_mismatch \ "$pattern_abbrev_verbose" -e abbrev="$a" -e execve diff --git a/tests/qualify_personality.sh b/tests/qualify_personality.sh new file mode 100644 index 00000000..d57314fc --- /dev/null +++ b/tests/qualify_personality.sh @@ -0,0 +1,74 @@ +#! /bin/sh -efu +# +# Common code for per-personality qualification tests +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +[ 2 -le "$#" ] || + fail_ 'No personality designation ("64", "32", "x32") specified' + +pers="$1" +shift +trace_expr="$1" +shift +skip="${1-}" + +case "$STRACE_NATIVE_ARCH" in +x86_64) + supported_pers='64 32 x32' + ;; +x32) + supported_pers='x32 32' + ;; +aarch64|powerpc64|riscv|s390x|sparc64|tile) + supported_pers='64 32' + ;; +*) + supported_pers="$(($SIZEOF_LONG * 8))" + ;; +esac + +# Detect current personality designation +if [ "x$STRACE_NATIVE_ARCH" = "x$STRACE_ARCH" ]; then + case "$STRACE_NATIVE_ARCH" in + x32) + cur_pers=x32 + ;; + *) + cur_pers="$(($SIZEOF_LONG * 8))" + ;; + esac +else + if [ "x$SIZEOF_KERNEL_LONG_T" = "x$SIZEOF_LONG" ]; then + [ 4 -eq "$SIZEOF_LONG" ] || + fail_ "sizeof(long) = $SIZEOF_LONG != 4" + cur_pers=32 + else + [ 8 -eq "$SIZEOF_KERNEL_LONG_T" ] || + fail_ "sizeof(kernel_long_t) = $SIZEOF_KERNEL_LONG_T != 8" + [ 4 -eq "$SIZEOF_LONG" ] || + fail_ "sizeof(long) = $SIZEOF_LONG != 4" + cur_pers=x32 + fi +fi + +pers_found=0 +set -- $supported_pers +for i; do + [ "x$pers" != "x$i" ] || pers_found=1 +done + +[ "$pers_found" = 1 ] || + skip_ "Personality '$pers' is not supported on architecture" \ + "'$STRACE_NATIVE_ARCH' (supported personalities: $supported_pers)" + +# If tested personality is not equivalent to current personality, reset $NAME, +# so "$NAME.in", which is used by test_trace_expr, points to an empty file. +[ "x$pers" = "x$cur_pers" ] || NAME=qualify_personality_empty + +test_trace_expr "$skip" -e trace="${trace_expr}@${pers}" diff --git a/tests/qualify_personality_empty.in b/tests/qualify_personality_empty.in new file mode 100644 index 00000000..e69de29b diff --git a/tests/quotactl-Xabbrev.c b/tests/quotactl-Xabbrev.c new file mode 100644 index 00000000..e2b3c502 --- /dev/null +++ b/tests/quotactl-Xabbrev.c @@ -0,0 +1 @@ +#include "quotactl.c" diff --git a/tests/quotactl-Xabbrev.gen.test b/tests/quotactl-Xabbrev.gen.test new file mode 100755 index 00000000..67c27d35 --- /dev/null +++ b/tests/quotactl-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (quotactl-Xabbrev -Xabbrev -e trace=quotactl); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xabbrev -e trace=quotactl diff --git a/tests/quotactl-Xraw.c b/tests/quotactl-Xraw.c new file mode 100644 index 00000000..f6dd8ffe --- /dev/null +++ b/tests/quotactl-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "quotactl.c" diff --git a/tests/quotactl-Xraw.gen.test b/tests/quotactl-Xraw.gen.test new file mode 100755 index 00000000..8f2f25b0 --- /dev/null +++ b/tests/quotactl-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (quotactl-Xraw -a27 -Xraw -e trace=quotactl); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 -Xraw -e trace=quotactl diff --git a/tests/quotactl-Xverbose.c b/tests/quotactl-Xverbose.c new file mode 100644 index 00000000..55d484e8 --- /dev/null +++ b/tests/quotactl-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "quotactl.c" diff --git a/tests/quotactl-Xverbose.gen.test b/tests/quotactl-Xverbose.gen.test new file mode 100755 index 00000000..7d06db57 --- /dev/null +++ b/tests/quotactl-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (quotactl-Xverbose -Xverbose -e trace=quotactl); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xverbose -e trace=quotactl diff --git a/tests/quotactl-success-v.c b/tests/quotactl-success-v.c new file mode 100644 index 00000000..4d1c7b30 --- /dev/null +++ b/tests/quotactl-success-v.c @@ -0,0 +1,2 @@ +#define INJECT_RETVAL 42 +#include "quotactl-v.c" diff --git a/tests/quotactl-success-v.test b/tests/quotactl-success-v.test new file mode 100755 index 00000000..b8112042 --- /dev/null +++ b/tests/quotactl-success-v.test @@ -0,0 +1,11 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +run_strace -v -e trace=quotactl -e inject=quotactl:retval=42 ../quotactl-success-v > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests/quotactl-success.c b/tests/quotactl-success.c new file mode 100644 index 00000000..aa2b9dc0 --- /dev/null +++ b/tests/quotactl-success.c @@ -0,0 +1,2 @@ +#define INJECT_RETVAL 42 +#include "quotactl.c" diff --git a/tests/quotactl-success.test b/tests/quotactl-success.test new file mode 100755 index 00000000..d041ebd9 --- /dev/null +++ b/tests/quotactl-success.test @@ -0,0 +1,11 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +run_strace -e trace=quotactl -e inject=quotactl:retval=42 ../quotactl-success > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests/quotactl-v.gen.test b/tests/quotactl-v.gen.test new file mode 100755 index 00000000..8659ed23 --- /dev/null +++ b/tests/quotactl-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (quotactl-v -v -e trace=quotactl); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=quotactl diff --git a/tests/quotactl-v.test b/tests/quotactl-v.test deleted file mode 100755 index 6adaf82c..00000000 --- a/tests/quotactl-v.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check non-abbreviated decoding of quotactl syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -e trace=quotactl diff --git a/tests/quotactl-xfs-success-v.c b/tests/quotactl-xfs-success-v.c new file mode 100644 index 00000000..6e7b2b51 --- /dev/null +++ b/tests/quotactl-xfs-success-v.c @@ -0,0 +1,2 @@ +#define INJECT_RETVAL 42 +#include "quotactl-xfs-v.c" diff --git a/tests/quotactl-xfs-success-v.test b/tests/quotactl-xfs-success-v.test new file mode 100755 index 00000000..7bcfa8ac --- /dev/null +++ b/tests/quotactl-xfs-success-v.test @@ -0,0 +1,11 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +run_strace -v -e trace=quotactl -e inject=quotactl:retval=42 ../quotactl-xfs-success-v > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests/quotactl-xfs-success.c b/tests/quotactl-xfs-success.c new file mode 100644 index 00000000..f498b8ae --- /dev/null +++ b/tests/quotactl-xfs-success.c @@ -0,0 +1,2 @@ +#define INJECT_RETVAL 42 +#include "quotactl-xfs.c" diff --git a/tests/quotactl-xfs-success.test b/tests/quotactl-xfs-success.test new file mode 100755 index 00000000..e9041dad --- /dev/null +++ b/tests/quotactl-xfs-success.test @@ -0,0 +1,11 @@ +#!/bin/sh -efu +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/scno_tampering.sh" + +run_strace -e trace=quotactl -e inject=quotactl:retval=42 ../quotactl-xfs-success > "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests/quotactl-xfs-v.gen.test b/tests/quotactl-xfs-v.gen.test new file mode 100755 index 00000000..f1f7e0ae --- /dev/null +++ b/tests/quotactl-xfs-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (quotactl-xfs-v -v -e trace=quotactl); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=quotactl diff --git a/tests/quotactl-xfs-v.test b/tests/quotactl-xfs-v.test deleted file mode 100755 index d5ffc7d6..00000000 --- a/tests/quotactl-xfs-v.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check non-abbreviated decoding of quotactl xfs subcommands. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -e trace=quotactl diff --git a/tests/quotactl-xfs.c b/tests/quotactl-xfs.c index e420d1c9..1fae566d 100644 --- a/tests/quotactl-xfs.c +++ b/tests/quotactl-xfs.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -70,7 +51,7 @@ struct fs_quota_statv { struct fs_qfilestatv qs_pquota; /* project quota information */ int32_t qs_btimelimit; /* limit for blks timer */ int32_t qs_itimelimit; /* limit for inodes timer */ - int32_t qs_rtbtimelimit; /* limit for rt blks timer */ + int32_t qs_rtbtimelimit; /* limit for rt blks timer */ uint16_t qs_bwarnlimit; /* limit for num warnings */ uint16_t qs_iwarnlimit; /* limit for num warnings */ uint64_t qs_pad2[8]; /* for future proofing */ @@ -91,34 +72,34 @@ print_xdisk_quota(int rc, void *ptr, void *arg) struct fs_disk_quota *dq = ptr; long out_arg = (long) arg; - if (((rc != 0) && out_arg) || (out_arg > 1)) { + if (((rc < 0) && out_arg) || (out_arg > 1)) { printf("%p", dq); return; } - PRINT_FIELD_D("{", dq, d_version); + PRINT_FIELD_D("{", *dq, d_version); printf(", d_flags="); printflags(xfs_dqblk_flags, (uint8_t) dq->d_flags, "XFS_???_QUOTA"); - PRINT_FIELD_X(", ", dq, d_fieldmask); - PRINT_FIELD_U(", ", dq, d_id); - PRINT_FIELD_U(", ", dq, d_blk_hardlimit); - PRINT_FIELD_U(", ", dq, d_blk_softlimit); - PRINT_FIELD_U(", ", dq, d_ino_hardlimit); - PRINT_FIELD_U(", ", dq, d_ino_softlimit); - PRINT_FIELD_U(", ", dq, d_bcount); - PRINT_FIELD_U(", ", dq, d_icount); + PRINT_FIELD_X(", ", *dq, d_fieldmask); + PRINT_FIELD_U(", ", *dq, d_id); + PRINT_FIELD_U(", ", *dq, d_blk_hardlimit); + PRINT_FIELD_U(", ", *dq, d_blk_softlimit); + PRINT_FIELD_U(", ", *dq, d_ino_hardlimit); + PRINT_FIELD_U(", ", *dq, d_ino_softlimit); + PRINT_FIELD_U(", ", *dq, d_bcount); + PRINT_FIELD_U(", ", *dq, d_icount); # if VERBOSE - PRINT_FIELD_D(", ", dq, d_itimer); - PRINT_FIELD_D(", ", dq, d_btimer); - PRINT_FIELD_U(", ", dq, d_iwarns); - PRINT_FIELD_U(", ", dq, d_bwarns); - PRINT_FIELD_U(", ", dq, d_rtb_hardlimit); - PRINT_FIELD_U(", ", dq, d_rtb_softlimit); - PRINT_FIELD_U(", ", dq, d_rtbcount); - PRINT_FIELD_D(", ", dq, d_rtbtimer); - PRINT_FIELD_U(", ", dq, d_rtbwarns); + PRINT_FIELD_D(", ", *dq, d_itimer); + PRINT_FIELD_D(", ", *dq, d_btimer); + PRINT_FIELD_U(", ", *dq, d_iwarns); + PRINT_FIELD_U(", ", *dq, d_bwarns); + PRINT_FIELD_U(", ", *dq, d_rtb_hardlimit); + PRINT_FIELD_U(", ", *dq, d_rtb_softlimit); + PRINT_FIELD_U(", ", *dq, d_rtbcount); + PRINT_FIELD_D(", ", *dq, d_rtbtimer); + PRINT_FIELD_U(", ", *dq, d_rtbwarns); # else printf(", ..."); # endif /* !VERBOSE */ @@ -131,28 +112,28 @@ print_xquota_stat(int rc, void *ptr, void *arg) struct fs_quota_stat *qs = ptr; long out_arg = (long) arg; - if (((rc != 0) && out_arg) || (out_arg > 1)) { + if (((rc < 0) && out_arg) || (out_arg > 1)) { printf("%p", qs); return; } - PRINT_FIELD_D("{", qs, qs_version); + PRINT_FIELD_D("{", *qs, qs_version); # if VERBOSE printf(", qs_flags="); printflags(xfs_quota_flags, qs->qs_flags, "XFS_QUOTA_???"); - PRINT_FIELD_U(", qs_uquota={", &qs->qs_uquota, qfs_ino); - PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nblks); - PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nextents); - PRINT_FIELD_U("}, qs_gquota={", &qs->qs_gquota, qfs_ino); - PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nblks); - PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nextents); - PRINT_FIELD_U("}, ", qs, qs_incoredqs); - PRINT_FIELD_D(", ", qs, qs_btimelimit); - PRINT_FIELD_D(", ", qs, qs_itimelimit); - PRINT_FIELD_D(", ", qs, qs_rtbtimelimit); - PRINT_FIELD_U(", ", qs, qs_bwarnlimit); - PRINT_FIELD_U(", ", qs, qs_iwarnlimit); + PRINT_FIELD_U(", qs_uquota={", qs->qs_uquota, qfs_ino); + PRINT_FIELD_U(", ", qs->qs_uquota, qfs_nblks); + PRINT_FIELD_U(", ", qs->qs_uquota, qfs_nextents); + PRINT_FIELD_U("}, qs_gquota={", qs->qs_gquota, qfs_ino); + PRINT_FIELD_U(", ", qs->qs_gquota, qfs_nblks); + PRINT_FIELD_U(", ", qs->qs_gquota, qfs_nextents); + PRINT_FIELD_U("}, ", *qs, qs_incoredqs); + PRINT_FIELD_D(", ", *qs, qs_btimelimit); + PRINT_FIELD_D(", ", *qs, qs_itimelimit); + PRINT_FIELD_D(", ", *qs, qs_rtbtimelimit); + PRINT_FIELD_U(", ", *qs, qs_bwarnlimit); + PRINT_FIELD_U(", ", *qs, qs_iwarnlimit); # else printf(", ..."); # endif /* !VERBOSE */ @@ -165,31 +146,31 @@ print_xquota_statv(int rc, void *ptr, void *arg) struct fs_quota_statv *qs = ptr; long out_arg = (long) arg; - if (((rc != 0) && out_arg) || (out_arg > 1)) { + if (((rc < 0) && out_arg) || (out_arg > 1)) { printf("%p", qs); return; } - PRINT_FIELD_D("{", qs, qs_version); + PRINT_FIELD_D("{", *qs, qs_version); # if VERBOSE printf(", qs_flags="); printflags(xfs_quota_flags, qs->qs_flags, "XFS_QUOTA_???"); - PRINT_FIELD_U(", ", qs, qs_incoredqs); - PRINT_FIELD_U(", qs_uquota={", &qs->qs_uquota, qfs_ino); - PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nblks); - PRINT_FIELD_U(", ", &qs->qs_uquota, qfs_nextents); - PRINT_FIELD_U("}, qs_gquota={", &qs->qs_gquota, qfs_ino); - PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nblks); - PRINT_FIELD_U(", ", &qs->qs_gquota, qfs_nextents); - PRINT_FIELD_U("}, qs_pquota={", &qs->qs_pquota, qfs_ino); - PRINT_FIELD_U(", ", &qs->qs_pquota, qfs_nblks); - PRINT_FIELD_U(", ", &qs->qs_pquota, qfs_nextents); - PRINT_FIELD_D("}, ", qs, qs_btimelimit); - PRINT_FIELD_D(", ", qs, qs_itimelimit); - PRINT_FIELD_D(", ", qs, qs_rtbtimelimit); - PRINT_FIELD_U(", ", qs, qs_bwarnlimit); - PRINT_FIELD_U(", ", qs, qs_iwarnlimit); + PRINT_FIELD_U(", ", *qs, qs_incoredqs); + PRINT_FIELD_U(", qs_uquota={", qs->qs_uquota, qfs_ino); + PRINT_FIELD_U(", ", qs->qs_uquota, qfs_nblks); + PRINT_FIELD_U(", ", qs->qs_uquota, qfs_nextents); + PRINT_FIELD_U("}, qs_gquota={", qs->qs_gquota, qfs_ino); + PRINT_FIELD_U(", ", qs->qs_gquota, qfs_nblks); + PRINT_FIELD_U(", ", qs->qs_gquota, qfs_nextents); + PRINT_FIELD_U("}, qs_pquota={", qs->qs_pquota, qfs_ino); + PRINT_FIELD_U(", ", qs->qs_pquota, qfs_nblks); + PRINT_FIELD_U(", ", qs->qs_pquota, qfs_nextents); + PRINT_FIELD_D("}, ", *qs, qs_btimelimit); + PRINT_FIELD_D(", ", *qs, qs_itimelimit); + PRINT_FIELD_D(", ", *qs, qs_rtbtimelimit); + PRINT_FIELD_U(", ", *qs, qs_bwarnlimit); + PRINT_FIELD_U(", ", *qs, qs_iwarnlimit); # else printf(", ..."); # endif /* !VERBOSE */ @@ -206,13 +187,13 @@ main(void) char bogus_addr_str[sizeof(void *) * 2 + sizeof("0x")]; char unterminated_str[sizeof(void *) * 2 + sizeof("0x")]; - long rc; - struct fs_disk_quota *xdq = tail_alloc(sizeof(*xdq)); - struct fs_quota_stat *xqstat = tail_alloc(sizeof(*xqstat)); - struct fs_quota_statv *xqstatv = tail_alloc(sizeof(*xqstatv)); - uint32_t *flags = tail_alloc(sizeof(*flags)); + static char invalid_cmd_str[1024]; + TAIL_ALLOC_OBJECT_CONST_PTR(struct fs_disk_quota, xdq); + TAIL_ALLOC_OBJECT_CONST_PTR(struct fs_quota_stat, xqstat); + TAIL_ALLOC_OBJECT_CONST_PTR(struct fs_quota_statv, xqstatv); + TAIL_ALLOC_OBJECT_CONST_PTR(uint32_t, flags); char *unterminated = tail_memdup(unterminated_data, - sizeof(unterminated_data)); + sizeof(unterminated_data)); snprintf(bogus_special_str, sizeof(bogus_special_str), "%p", bogus_special); @@ -233,12 +214,12 @@ main(void) "|XFS_QUOTA_GDQ_ACCT|XFS_QUOTA_GDQ_ENFD" "|XFS_QUOTA_PDQ_ENFD|0xdeadbec0]"); - rc = syscall(__NR_quotactl, QCMD(Q_XQUOTAON, 0xfacefeed), bogus_dev, - bogus_id, bogus_addr); - printf("quotactl(QCMD(Q_XQUOTAON, %#x /* ???QUOTA */)" - ", %s, %p) = %s\n", - QCMD_TYPE(QCMD(Q_XQUOTAON, 0xfacefeed)), - bogus_dev_str, bogus_addr, sprintrc(rc)); + snprintf(invalid_cmd_str, sizeof(invalid_cmd_str), + "QCMD(Q_XQUOTAON, %#x /* ???QUOTA */)", + QCMD_TYPE(QCMD(Q_XQUOTAON, 0xfacefeed))); + check_quota(CQF_ID_SKIP, + QCMD(Q_XQUOTAON, 0xfacefeed), invalid_cmd_str, + bogus_dev, bogus_dev_str, bogus_addr); /* Q_XQUOTAOFF */ @@ -263,12 +244,12 @@ main(void) /* Q_XGETQUOTA */ /* Trying our best to get successful result */ - check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, USRQUOTA)), + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_XGETQUOTA, USRQUOTA)), ARG_STR("/dev/sda1"), getuid(), xdq, print_xdisk_quota, (intptr_t) 1); - check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, GRPQUOTA)), - ARG_STR(NULL), -1, xdq, print_xdisk_quota, (intptr_t) 2); + check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_XGETQUOTA, GRPQUOTA)), + ARG_STR(NULL), -1, xdq, print_xdisk_quota, (intptr_t) 1); /* Q_XGETNEXTQUOTA */ @@ -297,20 +278,29 @@ main(void) ARG_STR("/dev/sda1"), xqstat, print_xquota_stat, (intptr_t) 1); check_quota(CQF_ID_SKIP | CQF_ADDR_CB, - ARG_STR(QCMD(Q_XGETQSTATV, PRJQUOTA)), + ARG_STR(QCMD(Q_XGETQSTAT, USRQUOTA)), + ARG_STR("NULL"), xqstat, print_xquota_stat, (intptr_t) 1); + + check_quota(CQF_ID_SKIP, + ARG_STR(QCMD(Q_XGETQSTAT, PRJQUOTA)), unterminated, unterminated_str, - xqstat + 1, print_xquota_stat, (intptr_t) 2); + xqstat + 1); /* Q_XGETQSTATV */ check_quota(CQF_ID_SKIP | CQF_ADDR_CB, - ARG_STR(QCMD(Q_XGETQSTAT, USRQUOTA)), - ARG_STR("/dev/sda1"), xqstatv, print_xquota_statv, 1); + ARG_STR(QCMD(Q_XGETQSTATV, USRQUOTA)), + ARG_STR("/dev/sda1"), xqstatv, print_xquota_statv, (intptr_t) 1); check_quota(CQF_ID_SKIP | CQF_ADDR_CB, ARG_STR(QCMD(Q_XGETQSTATV, GRPQUOTA)), - ARG_STR(NULL), xqstatv, print_xquota_statv, (intptr_t) 2); + ARG_STR(NULL), xqstatv, print_xquota_statv, (intptr_t) 1); + + check_quota(CQF_ID_SKIP, + ARG_STR(QCMD(Q_XGETQSTATV, PRJQUOTA)), + unterminated, unterminated_str, + xqstatv + 1); /* Q_XQUOTARM */ diff --git a/tests/quotactl-xfs.gen.test b/tests/quotactl-xfs.gen.test new file mode 100755 index 00000000..cd7d11c5 --- /dev/null +++ b/tests/quotactl-xfs.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (quotactl-xfs -e trace=quotactl); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=quotactl diff --git a/tests/quotactl-xfs.test b/tests/quotactl-xfs.test deleted file mode 100755 index 404a7372..00000000 --- a/tests/quotactl-xfs.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of quotactl xfs subcommands. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=quotactl diff --git a/tests/quotactl.c b/tests/quotactl.c index 3a7c1132..3a995276 100644 --- a/tests/quotactl.c +++ b/tests/quotactl.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -76,27 +57,31 @@ struct if_nextdqblk { # include "xlat/if_dqinfo_flags.h" # include "xlat/if_dqinfo_valid.h" +# define QUOTA_STR(_arg) (_arg), gen_quotacmd(#_arg, _arg) +# define QUOTA_ID_STR(_arg) (_arg), gen_quotaid(#_arg, _arg) +# define QUOTA_STR_INVALID(_arg, str) (_arg), gen_quotacmd(str, _arg) + void print_dqblk(long rc, void *ptr, void *arg) { struct if_dqblk *db = ptr; long out_arg = (long) arg; - if (((rc != 0) && out_arg) || (out_arg > 1)) { + if (((rc < 0) && out_arg) || (out_arg > 1)) { printf("%p", db); return; } - PRINT_FIELD_U("{", db, dqb_bhardlimit); - PRINT_FIELD_U(", ", db, dqb_bsoftlimit); - PRINT_FIELD_U(", ", db, dqb_curspace); - PRINT_FIELD_U(", ", db, dqb_ihardlimit); - PRINT_FIELD_U(", ", db, dqb_isoftlimit); - PRINT_FIELD_U(", ", db, dqb_curinodes); + PRINT_FIELD_U("{", *db, dqb_bhardlimit); + PRINT_FIELD_U(", ", *db, dqb_bsoftlimit); + PRINT_FIELD_U(", ", *db, dqb_curspace); + PRINT_FIELD_U(", ", *db, dqb_ihardlimit); + PRINT_FIELD_U(", ", *db, dqb_isoftlimit); + PRINT_FIELD_U(", ", *db, dqb_curinodes); # if VERBOSE - PRINT_FIELD_U(", ", db, dqb_btime); - PRINT_FIELD_U(", ", db, dqb_itime); + PRINT_FIELD_U(", ", *db, dqb_btime); + PRINT_FIELD_U(", ", *db, dqb_itime); printf(", dqb_valid="); printflags(if_dqblk_valid, db->dqb_valid, "QIF_???"); @@ -112,28 +97,28 @@ print_nextdqblk(long rc, void *ptr, void *arg) struct if_nextdqblk *db = ptr; long out_arg = (long) arg; - if (((rc != 0) && out_arg) || (out_arg > 1)) { + if (((rc < 0) && out_arg) || (out_arg > 1)) { printf("%p", db); return; } - PRINT_FIELD_U("{", db, dqb_bhardlimit); - PRINT_FIELD_U(", ", db, dqb_bsoftlimit); - PRINT_FIELD_U(", ", db, dqb_curspace); - PRINT_FIELD_U(", ", db, dqb_ihardlimit); - PRINT_FIELD_U(", ", db, dqb_isoftlimit); - PRINT_FIELD_U(", ", db, dqb_curinodes); + PRINT_FIELD_U("{", *db, dqb_bhardlimit); + PRINT_FIELD_U(", ", *db, dqb_bsoftlimit); + PRINT_FIELD_U(", ", *db, dqb_curspace); + PRINT_FIELD_U(", ", *db, dqb_ihardlimit); + PRINT_FIELD_U(", ", *db, dqb_isoftlimit); + PRINT_FIELD_U(", ", *db, dqb_curinodes); # if VERBOSE - PRINT_FIELD_U(", ", db, dqb_btime); - PRINT_FIELD_U(", ", db, dqb_itime); + PRINT_FIELD_U(", ", *db, dqb_btime); + PRINT_FIELD_U(", ", *db, dqb_itime); printf(", dqb_valid="); printflags(if_dqblk_valid, db->dqb_valid, "QIF_???"); - PRINT_FIELD_U(", ", db, dqb_id); + PRINT_FIELD_U(", ", *db, dqb_id); # else - PRINT_FIELD_U(", ", db, dqb_id); + PRINT_FIELD_U(", ", *db, dqb_id); printf(", ..."); # endif /* !VERBOSE */ printf("}"); @@ -145,21 +130,107 @@ print_dqinfo(long rc, void *ptr, void *arg) struct if_dqinfo *di = ptr; long out_arg = (long) arg; - if (((rc != 0) && out_arg) || (out_arg > 1)) { + if (((rc < 0) && out_arg) || (out_arg > 1)) { printf("%p", di); return; } - PRINT_FIELD_U("{", di, dqi_bgrace); - PRINT_FIELD_U(", ", di, dqi_igrace); + PRINT_FIELD_U("{", *di, dqi_bgrace); + PRINT_FIELD_U(", ", *di, dqi_igrace); printf(", dqi_flags="); +# if XLAT_RAW + printf("%#x", di->dqi_flags); +# elif XLAT_VERBOSE + printf("%#x /* ", di->dqi_flags); printflags(if_dqinfo_flags, di->dqi_flags, "DQF_???"); + printf(" */"); +# else /* XLAT_ABBREV */ + printflags(if_dqinfo_flags, di->dqi_flags, "DQF_???"); +# endif printf(", dqi_valid="); +# if XLAT_RAW + printf("%#x", di->dqi_valid); +# elif XLAT_VERBOSE + printf("%#x /* ", di->dqi_valid); + printflags(if_dqinfo_valid, di->dqi_valid, "IIF_???"); + printf(" */"); +# else /* XLAT_ABBREV */ printflags(if_dqinfo_valid, di->dqi_valid, "IIF_???"); +# endif printf("}"); } +void +print_dqfmt(long rc, void *ptr, void *arg) +{ + uint32_t *fmtval = ptr; + long out_arg = (long) arg; + const char *fmtstr; + + if (((rc < 0) && out_arg) || (out_arg > 1)) { + printf("%p", fmtval); + return; + } + printf("["); +# if XLAT_RAW + printf("%#x]", *fmtval); + return; +# else + switch (*fmtval) { + case 1: + fmtstr = "QFMT_VFS_OLD"; + break; + case 2: + fmtstr = "QFMT_VFS_V0"; + break; + case 3: + fmtstr = "QFMT_OCFS2"; + break; + case 4: + fmtstr = "QFMT_VFS_V1"; + break; + default: + printf("%#x /* QFMT_VFS_??? */]", *fmtval); + return; + } +# endif +# if XLAT_VERBOSE + printf("%#x /* %s */]", *fmtval, fmtstr); +# else + printf("%s]", fmtstr); +# endif +} + +const char * +gen_quotacmd(const char *abbrev_str, const uint32_t cmd) +{ + static char quotacmd_str[2048]; + +# if XLAT_RAW + snprintf(quotacmd_str, sizeof(quotacmd_str), "%u", cmd); +# elif XLAT_VERBOSE + snprintf(quotacmd_str, sizeof(quotacmd_str), "%u /* %s */", cmd, abbrev_str); +# else + return abbrev_str; +# endif + return quotacmd_str; +} + +const char * +gen_quotaid(const char *abbrev_str, const uint32_t id) +{ + static char quotaid_str[1024]; + +# if XLAT_RAW + snprintf(quotaid_str, sizeof(quotaid_str), "%#x", id); +# elif XLAT_VERBOSE + snprintf(quotaid_str, sizeof(quotaid_str), "%#x /* %s */", id, abbrev_str); +# else + return abbrev_str; +# endif + return quotaid_str; +} int main(void) @@ -170,14 +241,14 @@ main(void) char bogus_special_str[sizeof(void *) * 2 + sizeof("0x")]; char unterminated_str[sizeof(void *) * 2 + sizeof("0x")]; - long rc; + static char invalid_cmd_str[1024]; + static char invalid_id_str[1024]; char *unterminated = tail_memdup(unterminated_data, sizeof(unterminated_data)); - struct if_dqblk *dqblk = tail_alloc(sizeof(*dqblk)); - struct if_dqinfo *dqinfo = tail_alloc(sizeof(*dqinfo)); - uint32_t *fmt = tail_alloc(sizeof(*fmt)); - struct if_nextdqblk *nextdqblk = tail_alloc(sizeof(*nextdqblk)); - + TAIL_ALLOC_OBJECT_CONST_PTR(struct if_dqblk, dqblk); + TAIL_ALLOC_OBJECT_CONST_PTR(struct if_dqinfo, dqinfo); + TAIL_ALLOC_OBJECT_CONST_PTR(uint32_t, fmt); + TAIL_ALLOC_OBJECT_CONST_PTR(struct if_nextdqblk, nextdqblk); snprintf(bogus_special_str, sizeof(bogus_special_str), "%p", bogus_special); @@ -186,63 +257,71 @@ main(void) /* Invalid commands */ + snprintf(invalid_cmd_str, sizeof(invalid_cmd_str), + "QCMD(%#x /* Q_??? */, %#x /* ???QUOTA */)", + QCMD_CMD(bogus_cmd), QCMD_TYPE(bogus_cmd)); + check_quota(CQF_NONE, bogus_cmd, gen_quotacmd(invalid_cmd_str, bogus_cmd), + bogus_special, bogus_special_str, bogus_id, bogus_addr); - rc = syscall(__NR_quotactl, bogus_cmd, bogus_special, bogus_id, - bogus_addr); - printf("quotactl(QCMD(%#x /* Q_??? */, %#x /* ???QUOTA */)" - ", %p, %u, %p) = %s\n", - QCMD_CMD(bogus_cmd), QCMD_TYPE(bogus_cmd), - bogus_special, bogus_id, bogus_addr, sprintrc(rc)); - - rc = syscall(__NR_quotactl, 0, NULL, -1, NULL); - printf("quotactl(QCMD(0 /* Q_??? */, USRQUOTA), NULL, -1, NULL) = %s\n", - sprintrc(rc)); + snprintf(invalid_cmd_str, sizeof(invalid_cmd_str), + "QCMD(0 /* Q_??? */, USRQUOTA)"); + check_quota(CQF_ADDR_STR, 0, gen_quotacmd(invalid_cmd_str, 0), + ARG_STR(NULL), -1, ARG_STR(NULL)); /* Q_QUOTAON */ check_quota(CQF_ID_STR | CQF_ADDR_STR, - ARG_STR(QCMD(Q_QUOTAON, USRQUOTA)), - ARG_STR("/dev/bogus/"), ARG_STR(QFMT_VFS_OLD), + QUOTA_STR(QCMD(Q_QUOTAON, USRQUOTA)), + ARG_STR("/dev/bogus/"), QUOTA_ID_STR(QFMT_VFS_OLD), ARG_STR("/tmp/bogus/")); - rc = syscall(__NR_quotactl, QCMD(Q_QUOTAON, 0xfacefeed), bogus_dev, - bogus_id, bogus_addr); - printf("quotactl(QCMD(Q_QUOTAON, %#x /* ???QUOTA */)" - ", %s, %#x /* QFMT_VFS_??? */, %p) = %s\n", - QCMD_TYPE(QCMD(Q_QUOTAON, 0xfacefeed)), - bogus_dev_str, bogus_id, bogus_addr, sprintrc(rc)); + snprintf(invalid_cmd_str, sizeof(invalid_cmd_str), + "QCMD(Q_QUOTAON, %#x /* ???QUOTA */)", + QCMD_TYPE(QCMD(Q_QUOTAON, 0xfacefeed))); +# if XLAT_RAW + snprintf(invalid_id_str, sizeof(invalid_id_str), + "%#x", bogus_id); +# else + snprintf(invalid_id_str, sizeof(invalid_id_str), + "%#x /* QFMT_VFS_??? */", bogus_id); +# endif + check_quota(CQF_ID_STR, QCMD(Q_QUOTAON, 0xfacefeed), + gen_quotacmd(invalid_cmd_str, QCMD(Q_QUOTAON, 0xfacefeed)), + bogus_dev, bogus_dev_str, + bogus_id, invalid_id_str, bogus_addr); /* Q_QUOTAOFF */ check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, - ARG_STR(QCMD(Q_QUOTAOFF, USRQUOTA)), + QUOTA_STR(QCMD(Q_QUOTAOFF, USRQUOTA)), bogus_special, bogus_special_str); check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, - ARG_STR(QCMD(Q_QUOTAOFF, GRPQUOTA)), + QUOTA_STR(QCMD(Q_QUOTAOFF, GRPQUOTA)), ARG_STR("/dev/bogus/")); check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, - ARG_STR(QCMD(Q_QUOTAOFF, PRJQUOTA)), ARG_STR(NULL)); + QUOTA_STR(QCMD(Q_QUOTAOFF, PRJQUOTA)), ARG_STR(NULL)); + const char *cmd_str = "QCMD(Q_QUOTAOFF, 0x3 /* ???QUOTA */)"; check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, - QCMD(Q_QUOTAOFF, 3), "QCMD(Q_QUOTAOFF, 0x3 /* ???QUOTA */)", + QUOTA_STR_INVALID(QCMD(Q_QUOTAOFF, 3), cmd_str), ARG_STR(NULL)); /* Q_GETQUOTA */ /* Trying our best to get successful result */ - check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, USRQUOTA)), + check_quota(CQF_ADDR_CB, QUOTA_STR(QCMD(Q_GETQUOTA, USRQUOTA)), ARG_STR("/dev/sda1"), getuid(), dqblk, print_dqblk, (intptr_t) 1); - check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETQUOTA, GRPQUOTA)), - ARG_STR(NULL), -1, dqblk, print_dqblk, (intptr_t) 2); + check_quota(CQF_ADDR_CB, QUOTA_STR(QCMD(Q_GETQUOTA, GRPQUOTA)), + ARG_STR(NULL), -1, dqblk, print_dqblk, (intptr_t) 1); /* Q_GETNEXTQUOTA */ - check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_GETNEXTQUOTA, USRQUOTA)), + check_quota(CQF_ADDR_CB, QUOTA_STR(QCMD(Q_GETNEXTQUOTA, USRQUOTA)), ARG_STR("/dev/sda1"), 0, nextdqblk, print_nextdqblk, (intptr_t) 1); @@ -251,10 +330,10 @@ main(void) fill_memory(dqblk, sizeof(*dqblk)); - check_quota(CQF_NONE, ARG_STR(QCMD(Q_SETQUOTA, PRJQUOTA)), + check_quota(CQF_NONE, QUOTA_STR(QCMD(Q_SETQUOTA, PRJQUOTA)), bogus_special, bogus_special_str, 0, bogus_addr); - check_quota(CQF_ADDR_CB, ARG_STR(QCMD(Q_SETQUOTA, PRJQUOTA)), + check_quota(CQF_ADDR_CB, QUOTA_STR(QCMD(Q_SETQUOTA, PRJQUOTA)), ARG_STR("/dev/bogus/"), 3141592653U, dqblk, print_dqblk, (intptr_t) 0); @@ -262,13 +341,13 @@ main(void) /* Q_GETINFO */ check_quota(CQF_ID_SKIP | CQF_ADDR_CB, - ARG_STR(QCMD(Q_GETINFO, GRPQUOTA)), + QUOTA_STR(QCMD(Q_GETINFO, GRPQUOTA)), ARG_STR("/dev/sda1"), dqinfo, print_dqinfo, (intptr_t) 1); check_quota(CQF_ID_SKIP | CQF_ADDR_CB, - ARG_STR(QCMD(Q_GETINFO, GRPQUOTA)), + QUOTA_STR(QCMD(Q_GETINFO, GRPQUOTA)), bogus_special, bogus_special_str, dqinfo, - print_dqinfo, (intptr_t) 2); + print_dqinfo, (intptr_t) 1); /* Q_SETINFO */ @@ -277,34 +356,40 @@ main(void) dqinfo->dqi_flags = 0xdeadabcd; check_quota(CQF_ID_SKIP | CQF_ADDR_STR, - ARG_STR(QCMD(Q_SETINFO, PRJQUOTA)), + QUOTA_STR(QCMD(Q_SETINFO, PRJQUOTA)), bogus_special, bogus_special_str, ARG_STR(NULL)); check_quota(CQF_ID_SKIP | CQF_ADDR_CB, - ARG_STR(QCMD(Q_SETINFO, USRQUOTA)), + QUOTA_STR(QCMD(Q_SETINFO, USRQUOTA)), ARG_STR("/dev/bogus/"), dqinfo, print_dqinfo, (intptr_t) 0); /* Q_GETFMT */ check_quota(CQF_ID_SKIP | CQF_ADDR_STR, - ARG_STR(QCMD(Q_GETFMT, PRJQUOTA)), + QUOTA_STR(QCMD(Q_GETFMT, PRJQUOTA)), bogus_special, bogus_special_str, ARG_STR(NULL)); check_quota(CQF_ID_SKIP, - ARG_STR(QCMD(Q_GETFMT, USRQUOTA)), + QUOTA_STR(QCMD(Q_GETFMT, USRQUOTA)), unterminated, unterminated_str, fmt + 1); - check_quota(CQF_ID_SKIP, - ARG_STR(QCMD(Q_GETFMT, GRPQUOTA)), - ARG_STR("/dev/sda1"), fmt); + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + QUOTA_STR(QCMD(Q_GETFMT, GRPQUOTA)), + ARG_STR("/dev/sda1"), fmt, print_dqfmt, (uintptr_t) 1); + /* Try to check valid quota format */ + *fmt = QFMT_VFS_OLD; + check_quota(CQF_ID_SKIP | CQF_ADDR_CB, + QUOTA_STR(QCMD(Q_GETFMT, GRPQUOTA)), + ARG_STR("/dev/sda1"), fmt, print_dqfmt, (uintptr_t) 1); /* Q_SYNC */ check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, - ARG_STR(QCMD(Q_SYNC, USRQUOTA)), + QUOTA_STR(QCMD(Q_SYNC, USRQUOTA)), bogus_special, bogus_special_str); + cmd_str = "QCMD(Q_SYNC, 0xff /* ???QUOTA */)"; check_quota(CQF_ID_SKIP | CQF_ADDR_SKIP, - QCMD(Q_SYNC, 0xfff), "QCMD(Q_SYNC, 0xff /* ???QUOTA */)", + QUOTA_STR_INVALID(QCMD(Q_SYNC, 0xfff), cmd_str), ARG_STR(NULL)); puts("+++ exited with 0 +++"); diff --git a/tests/quotactl.gen.test b/tests/quotactl.gen.test new file mode 100755 index 00000000..6d2dc754 --- /dev/null +++ b/tests/quotactl.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (quotactl ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/quotactl.h b/tests/quotactl.h index 31eaec58..4d29ac11 100644 --- a/tests/quotactl.h +++ b/tests/quotactl.h @@ -3,37 +3,19 @@ * * Copyright (c) 2016 Eugene Syromyatnikov * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef STRACE_TESTS_QUOTACTL_H -#define STRACE_TESTS_QUOTACTL_H +# define STRACE_TESTS_QUOTACTL_H # include # include # include +# include "print_fields.h" # ifdef HAVE_LINUX_QUOTA_H /* Broken in CentOS 5: has extern spinlock_t dq_data_lock; declaration */ @@ -57,18 +39,6 @@ # define PRJQUOTA 2 # endif -# define PRINT_FIELD_D(prefix, where, field) \ - printf("%s%s=%lld", (prefix), #field, \ - sign_extend_unsigned_to_ll((where)->field)) - -# define PRINT_FIELD_U(prefix, where, field) \ - printf("%s%s=%llu", (prefix), #field, \ - zero_extend_signed_to_ull((where)->field)) - -# define PRINT_FIELD_X(prefix, where, field) \ - printf("%s%s=%#llx", (prefix), #field, \ - zero_extend_signed_to_ull((where)->field)) - typedef void (*print_cb)(long rc, void *addr, void *arg); enum check_quotactl_flag_bits { @@ -88,7 +58,73 @@ enum check_quotactl_flags { CQF_ADDR_CB = 1 << CQF_ADDR_CB_BIT, }; +static const char *errstr; +/** + * Generic quotactl syscall checker function. Call convention: + * + * check_quota(flags, cmd, cmd_str, special, special_str + * [, id [, id_str]] + * [, addr [, { addr_cb, addr_cb_arg | addr_str }]]) + * + * check_quota performs a syscall invocation and prints the expected output + * for it. + * + * It might be useful to employ ARG_STR macro for passing cmd/cmd_str, + * special_special_str, id/id_str, and addr/addr_str argument pairs. + * + * @param flags Check flags: + * - CQF_ID_SKIP: the "id" syscall argument is ignored + * in the syscall invocation. No id and id_str arguments + * should be provided if this flag is set. + * This flag has priority over the CQF_ID_STR flag. + * - CQF_ID_STR: the "id" syscall argument has a special string + * representation. id_str argument should be provided if this + * flag is set; no id_str argument should be provided and id + * argument is printed as unsigned integer (with an exception + * for -1, which is printed as signed) if this flag is not set. + * - CQF_ADDR_SKIP: the "addr" syscall argument is ignored + * in the syscall invocation. None of the addr, addr_cb, + * addr_cb_arg, and/or addr_str arguments should be provided + * if this flag is set. This flag has priority + * over the CQF_ADDR_STR and CQF_ADDR_CB flags. + * - CQF_ADDR_CB: the "addr" syscall argument printing is handled + * via a callback function. addr_cb (that points to a callback + * function of type print_cb) and addr_cb_arg (an opaque pointer + * that is passed to addr_cb in the third argument) should + * be provided if this flag is set. + * This flag has priority over the CQF_ADDR_STR flag. + * - CQF_ADDR_STR: addr syscall argument has a special string + * representation. addr_str argument should be provided if this + * flag is set. If both CQF_ADDR_CB and CQF_ADDR_STR flags + * are not set, addr syscall argument is printed using "%p" + * printf format. + * @param cmd Value of the "cmd" syscall argument that should be passed + * in the syscall invocation. + * @param cmd_str String representation of the "cmd" syscall argument. + * @param special Value of the "special" syscall argument that should be passed + * in the syscall invocation. + * @param special_str String representation of the "special" syscall argument. + * @param ... Additional arguments depend on the flags being set: + * - id: Value of the "id" syscall argument. Provided + * if CQF_ID_SKIP is not set, otherwise -1 is passed + * in the syscall invocation and the argument is not printed + * in the expected output. + * - id_str: String representation of the "id" syscall argument. + * Provided if CQF_ID_SKIP is not set and CQF_ID_STR is set. + * - addr: Value of the "addr" syscall argument. Provided + * if CQF_ADDR_SKIP is not set, otherwise NULL is passed + * in the syscall invocation and the argument is not printed + * in the expected output. + * - addr_cb: Callback function that is called for the "addr" + * syscall argument printing. Should be of print_cb type. + * Provided if CQF_ADDR_SKIP is not set and CQF_ADDR_CB is set. + * - addr_cb_arg: Opaque pointer that is passed to addr_cb, + * Provided if CQF_ADDR_SKIP is not set and CQF_ADDR_CB is set. + * - addr_str: String representation of the "addr" syscall argument. + * Provided if CQF_ADDR_SKIP is not set, CQF_ADDR_CB is not set, + * and CQF_ADDR_STR is set. + */ static inline void check_quota(uint32_t flags, int cmd, const char *cmd_str, const char *special, const char *special_str, ...) @@ -126,6 +162,20 @@ check_quota(uint32_t flags, int cmd, const char *cmd_str, va_end(ap); rc = syscall(__NR_quotactl, cmd, special, id, addr); + + errstr = sprintrc(rc); + +# ifdef INJECT_RETVAL + if (rc != INJECT_RETVAL) + error_msg_and_fail("Got a return value of %ld != %d", + rc, INJECT_RETVAL); + + static char inj_errstr[4096]; + + snprintf(inj_errstr, sizeof(inj_errstr), "%s (INJECTED)", errstr); + errstr = inj_errstr; +# endif + printf("quotactl(%s, %s", cmd_str, special_str); if (!(flags & CQF_ID_SKIP)) { @@ -150,7 +200,7 @@ check_quota(uint32_t flags, int cmd, const char *cmd_str, } } - printf(") = %s\n", sprintrc(rc)); + printf(") = %s\n", errstr); } diff --git a/tests/quotactl.test b/tests/quotactl.test deleted file mode 100755 index d0101f46..00000000 --- a/tests/quotactl.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of quotactl syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/read-write.c b/tests/read-write.c index 262e07b5..0217670b 100644 --- a/tests/read-write.c +++ b/tests/read-write.c @@ -2,29 +2,10 @@ * Check decoding and dumping of read and write syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,31 +17,52 @@ #include static void -dump_str(const char *str, const unsigned int len) +dump_str_ex(const char *str, const unsigned int len, const int idx_w) { - static const char dots[16] = "................"; + static const char chars[256] = + "................................" + " !\"#$%&'()*+,-./0123456789:;<=>?" + "@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_" + "`abcdefghijklmnopqrstuvwxyz{|}~." + "................................" + "................................" + "................................" + "................................"; unsigned int i; for (i = 0; i < len; i += 16) { unsigned int n = len - i > 16 ? 16 : len - i; const char *dump = hexdump_memdup(str + i, n); - tprintf(" | %05x %-49s %-16.*s |\n", - i, dump, n, dots); + tprintf(" | %0*x %-49s %-16.*s |\n", + idx_w, i, dump, n, chars + i % 0x100); free((void *) dump); } } +static inline void +dump_str(const char *str, const unsigned int len) +{ + dump_str_ex(str, len, 5); +} + static void print_hex(const char *str, const unsigned int len) { const unsigned char *ustr = (const unsigned char *) str; unsigned int i; + tprintf("\""); + for (i = 0; i < len; ++i) { unsigned int c = ustr[i]; + if (i >= DEFAULT_STRLEN) { + tprintf("\"..."); + return; + } + switch (c) { case '\t': tprintf("\\t"); break; @@ -76,6 +78,8 @@ print_hex(const char *str, const unsigned int len) tprintf("\\%o", ustr[i]); } } + + tprintf("\""); } static long @@ -93,9 +97,12 @@ k_write(unsigned int fd, const void *buf, size_t count) } static void -test_dump(const unsigned int len) +test_dump(const unsigned int len, bool err_desc) { static char *buf; + const char *rc_str; + int in_fd = err_desc ? 5 : 0; + int out_fd = err_desc ? 4 : 1; if (buf) { size_t ps1 = get_page_size() - 1; @@ -104,28 +111,34 @@ test_dump(const unsigned int len) buf = tail_alloc(len); } - long rc = k_read(0, buf, len); - if (rc != (int) len) + long rc = k_read(in_fd, buf, len); + rc_str = sprintrc(rc); + if (err_desc ^ (rc != (int) len)) perror_msg_and_fail("read: expected %d, returned %ld", - len, rc); + err_desc ? -1 : (int) len, rc); - tprintf("%s(%d, \"", "read", 0); - print_hex(buf, len); - tprintf("\", %d) = %ld\n", len, rc); - dump_str(buf, len); + tprintf("%s(%d, ", "read", in_fd); + if (!err_desc) + print_hex(buf, len); + else + tprintf("%p", buf); + tprintf(", %d) = %s\n", len, rc_str); + if (!err_desc) + dump_str(buf, len); unsigned int i; for (i = 0; i < len; ++i) buf[i] = i; - rc = k_write(1, buf, len); - if (rc != (int) len) + rc = k_write(out_fd, buf, len); + rc_str = sprintrc(rc); + if (err_desc ^ (rc != (int) len)) perror_msg_and_fail("write: expected %d, returned %ld", - len, rc); + err_desc ? -1 : (int) len, rc); - tprintf("%s(%d, \"", "write", 1); + tprintf("%s(%d, ", "write", out_fd); print_hex(buf, len); - tprintf("\", %d) = %ld\n", len, rc); + tprintf(", %d) = %s\n", len, rc_str); dump_str(buf, len); if (!len) @@ -137,7 +150,9 @@ main(void) { tprintf("%s", ""); - static char tmp[] = "read-write-tmpfile"; + skip_if_unavailable("/proc/self/fd/"); + + static const char tmp[] = "read-write-tmpfile"; if (open(tmp, O_CREAT|O_RDONLY|O_TRUNC, 0600) != 0) perror_msg_and_fail("creat: %s", tmp); if (open(tmp, O_WRONLY) != 1) @@ -180,7 +195,6 @@ main(void) tprintf("write(1, \"%s\", %u) = %ld\n" " | 00000 %-49s %-16s |\n", w_c, w_len, rc, w_d, w_c); - close(1); rc = k_read(0, r0, 0); if (rc) @@ -209,15 +223,64 @@ main(void) r1_c, w_len, rc, r1_d, r1_c); close(0); + /* + * Check partial dump; relies on dumpstr() implementation details + * (maximum size of chunk to be copied at once). + */ + static const size_t six_wide_size = 1 << 20; + static const size_t fetch_size = 1 << 16; + static const char big_buf_str[] = + "\\0\\1\\2\\3\\4\\5\\6\\7" + "\\10\\t\\n\\v\\f\\r\\16\\17" + "\\20\\21\\22\\23\\24\\25\\26\\27" + "\\30\\31\\32\\33\\34\\35\\36\\37"; + const size_t buf_size = six_wide_size + fetch_size; + const size_t sizes[] = { + six_wide_size, + six_wide_size + 1, + buf_size, + buf_size + 1, + buf_size + 2, + }; + char *big_buf = tail_alloc(buf_size); + + fill_memory_ex(big_buf, buf_size, 0, 0x100); + + for (size_t i = 0; i < ARRAY_SIZE(sizes); i++) { + rc = k_write(1, big_buf, sizes[i]); + tprintf("write(1, \"%s\"..., %zu) = %s\n", + big_buf_str, sizes[i], sprintrc(rc)); + dump_str_ex(big_buf, MIN(sizes[i], buf_size), + sizes[i] > six_wide_size ? 6 : 5); + + if (sizes[i] == buf_size + 1) + tprintf(" | \n", + getpid(), big_buf + buf_size); + + if (sizes[i] == buf_size + 2) + tprintf(" | \n", + getpid(), big_buf + buf_size); + } + + close(1); + if (open("/dev/zero", O_RDONLY)) perror_msg_and_fail("open"); if (open("/dev/null", O_WRONLY) != 1) perror_msg_and_fail("open"); + if (open("/dev/zero", O_RDONLY) != 4) + perror_msg_and_fail("open"); + + if (open("/dev/null", O_WRONLY) != 5) + perror_msg_and_fail("open"); + unsigned int i; - for (i = 0; i <= 32; ++i) - test_dump(i); + for (i = 0; i <= DEFAULT_STRLEN; ++i) + test_dump(i, false); + + test_dump(256, true); tprintf("+++ exited with 0 +++\n"); return 0; diff --git a/tests/read-write.gen.test b/tests/read-write.gen.test new file mode 100755 index 00000000..c66628f2 --- /dev/null +++ b/tests/read-write.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (read-write -a15 -eread=0,5 -ewrite=1,4 -e trace=read,write -P read-write-tmpfile -P /dev/zero -P /dev/null); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 -eread=0,5 -ewrite=1,4 -e trace=read,write -P read-write-tmpfile -P /dev/zero -P /dev/null diff --git a/tests/read-write.test b/tests/read-write.test deleted file mode 100755 index 3700541f..00000000 --- a/tests/read-write.test +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/sh - -# Check decoding and dumping of read and write syscalls. - -. "${srcdir=.}/init.sh" - -# strace -P is implemented using /proc/self/fd -[ -d /proc/self/fd/ ] || - framework_skip_ '/proc/self/fd/ is not available' - -tmpfile=read-write-tmpfile -> $tmpfile - -run_strace_match_diff \ - -a15 -eread=0 -ewrite=1 -e trace=read,write \ - -P $tmpfile -P /dev/zero -P /dev/null - -rm -f $tmpfile diff --git a/tests/readahead.c b/tests/readahead.c index c11b577d..1b21fe59 100644 --- a/tests/readahead.c +++ b/tests/readahead.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,7 +17,7 @@ * see https://sourceware.org/bugzilla/show_bug.cgi?id=5208 */ # if !(defined __GLIBC_MINOR__ && \ - (__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 8) + (__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 8) # undef HAVE_READAHEAD # endif /* glibc < 2.8 */ /* @@ -44,7 +25,7 @@ * see https://sourceware.org/bugzilla/show_bug.cgi?id=21026 */ # if defined LINUX_MIPSN64 && !(defined __GLIBC_MINOR__ && \ - (__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 25) + (__GLIBC__ << 16) + __GLIBC_MINOR__ >= (2 << 16) + 25) # undef HAVE_READAHEAD # endif /* LINUX_MIPSN64 && glibc < 2.25 */ # endif /* __GLIBC__ */ diff --git a/tests/readahead.gen.test b/tests/readahead.gen.test new file mode 100755 index 00000000..c27ab0d0 --- /dev/null +++ b/tests/readahead.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (readahead -a1 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a1 diff --git a/tests/readahead.test b/tests/readahead.test deleted file mode 100755 index 397c6903..00000000 --- a/tests/readahead.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check readahead syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a1 diff --git a/tests/readdir.c b/tests/readdir.c index 8c483620..284c221e 100644 --- a/tests/readdir.c +++ b/tests/readdir.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -58,9 +39,9 @@ static const char qname[] = "A\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nA\\nZ"; int -main(int ac, const char **av) +main(void) { - char *dname; + static const char dname[] = "readdir.test.tmp.dir"; struct { unsigned long d_ino; unsigned long d_off; @@ -69,8 +50,6 @@ main(int ac, const char **av) } e; int rc; - assert(ac == 1); - assert(asprintf(&dname, "%s.test.tmp.dir", av[0]) > 0); assert(!mkdir(dname, 0700)); assert(!chdir(dname)); (void) close(0); diff --git a/tests/readdir.gen.test b/tests/readdir.gen.test new file mode 100755 index 00000000..09aad4f6 --- /dev/null +++ b/tests/readdir.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (readdir -a16 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 diff --git a/tests/readdir.test b/tests/readdir.test deleted file mode 100755 index e3132737..00000000 --- a/tests/readdir.test +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -# Check readdir syscall decoding. - -. "${srcdir=.}/init.sh" - -rm -rf -- "$LOG".dir -run_strace_match_diff -a16 diff --git a/tests/readlink.c b/tests/readlink.c index 4ddf5fac..c2a9b22c 100644 --- a/tests/readlink.c +++ b/tests/readlink.c @@ -1,29 +1,9 @@ /* * Copyright (c) 2015 Gleb Fotengauer-Malinovskiy - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/readlink.gen.test b/tests/readlink.gen.test new file mode 100755 index 00000000..42632341 --- /dev/null +++ b/tests/readlink.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (readlink -xx ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -xx diff --git a/tests/readlink.test b/tests/readlink.test deleted file mode 100755 index c026ecbe..00000000 --- a/tests/readlink.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check readlink syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -xx diff --git a/tests/readlinkat.c b/tests/readlinkat.c index 4d3b516c..6909ac0b 100644 --- a/tests/readlinkat.c +++ b/tests/readlinkat.c @@ -1,29 +1,9 @@ /* * Copyright (c) 2015 Gleb Fotengauer-Malinovskiy - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/readlinkat.gen.test b/tests/readlinkat.gen.test new file mode 100755 index 00000000..d7de9932 --- /dev/null +++ b/tests/readlinkat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (readlinkat -xx ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -xx diff --git a/tests/readlinkat.test b/tests/readlinkat.test deleted file mode 100755 index 229c8e1e..00000000 --- a/tests/readlinkat.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check readlinkat syscall decoding. - -. "${srcdir=.}/readlink.test" diff --git a/tests/readv.c b/tests/readv.c index 0e5aab65..185d12cc 100644 --- a/tests/readv.c +++ b/tests/readv.c @@ -2,29 +2,10 @@ * Check decoding of readv and writev syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -88,7 +69,7 @@ main(void) fds[1], (long) writev(fds[1], w_iov, 0)); rc = writev(fds[1], w_iov + ARRAY_SIZE(w_iov_) - 1, 2); - tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%u}, %p], 2)" + tprintf("writev(%d, [{iov_base=\"%s\", iov_len=%u}, ... /* %p */], 2)" " = %ld %s (%m)\n", fds[1], w2_c, LENGTH_OF(w2_c), w_iov + ARRAY_SIZE(w_iov_), rc, errno2name()); @@ -108,7 +89,7 @@ main(void) " * %u bytes in buffer 2\n" " | 00000 %-49s %-16s |\n", fds[1], w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), - w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(w_iov_), w_len, + w2_c, LENGTH_OF(w2_c), (unsigned int) ARRAY_SIZE(w_iov_), w_len, LENGTH_OF(w0_c), w0_d, w0_c, LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); @@ -126,8 +107,8 @@ main(void) tprintf("readv(%d, [{iov_base=\"%s\", iov_len=%u}], %u) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - fds[0], - r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + fds[0], r0_c, r_len, (unsigned int) ARRAY_SIZE(r0_iov_), + r_len, r_len, r0_d, r0_c); void *r1 = tail_alloc(r_len); void *r2 = tail_alloc(w_len); @@ -148,8 +129,8 @@ main(void) ", {iov_base=\"\", iov_len=%u}], %u) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - fds[0], r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), w_len - r_len, - w_len - r_len, r1_d, r1_c); + fds[0], r1_c, r_len, w_len, (unsigned int) ARRAY_SIZE(r1_iov_), + w_len - r_len, w_len - r_len, r1_d, r1_c); close(fds[0]); tprintf("+++ exited with 0 +++\n"); diff --git a/tests/readv.test b/tests/readv.test index dc187996..ddeb6f97 100755 --- a/tests/readv.test +++ b/tests/readv.test @@ -3,29 +3,10 @@ # Check decoding and dumping of readv and writev syscalls. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -38,7 +19,7 @@ run_strace_match_diff -a16 -e trace=readv,writev \ run_strace_match_diff -a16 -e trace=readv,writev \ -eread='!all' -ewrite=none -eread='!0,1,2' -ewrite='!0,1,2' -wfd="$(./print_maxfd)" +wfd="$(../print_maxfd)" rfd="$(($wfd - 1))" run_strace_match_diff -a16 -e trace=readv,writev \ -eread="$rfd" -ewrite="$wfd" diff --git a/tests/reboot.c b/tests/reboot.c index 9b09e647..8bc9c6b0 100644 --- a/tests/reboot.c +++ b/tests/reboot.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -10,21 +17,83 @@ # define INVALID_MAGIC 319887762 # define INVALID_CMD 0x01234568 +# define STR32 "AbCdEfGhIjKlMnOpQrStUvWxYz012345" +# define STR128 STR32 STR32 STR32 STR32 + int main(void) { + static const kernel_ulong_t bogus_magic1 = + (kernel_ulong_t) 0xFFFFFFFFFFFFFFFFULL; + static const kernel_ulong_t bogus_magic2 = + (kernel_ulong_t) 0xdeadfacefa57beefULL; + static const kernel_ulong_t bogus_cmd = + (kernel_ulong_t) 0xbadda7a09caffee1ULL; static const char buf[] = "reboot"; - long rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, \ - INVALID_MAGIC, LINUX_REBOOT_CMD_RESTART2, buf); + static const char str256_buf[] = STR128 STR128; + + long rc; + char *str256 = tail_memdup(str256_buf, sizeof(str256_buf) - 1); + + rc = syscall(__NR_reboot, 0, 0, 0, 0); + printf("reboot(0 /* LINUX_REBOOT_MAGIC_??? */, " + "0 /* LINUX_REBOOT_MAGIC_??? */, " + "LINUX_REBOOT_CMD_CAD_OFF) = %s\n", + sprintrc(rc)); + + rc = syscall(__NR_reboot, bogus_magic1, bogus_magic2, bogus_cmd, -1); + printf("reboot(%#x /* LINUX_REBOOT_MAGIC_??? */, " + "%#x /* LINUX_REBOOT_MAGIC_??? */, " + "%#x /* LINUX_REBOOT_CMD_??? */) = %s\n", + (unsigned int) bogus_magic1, (unsigned int) bogus_magic2, + (unsigned int) bogus_cmd, sprintrc(rc)); + + rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, + INVALID_MAGIC, LINUX_REBOOT_CMD_RESTART2, buf); printf("reboot(LINUX_REBOOT_MAGIC1, %#x /* LINUX_REBOOT_MAGIC_??? */," - " LINUX_REBOOT_CMD_RESTART2, \"%s\") = %ld %s (%m)\n", - INVALID_MAGIC, buf, rc, errno2name()); + " LINUX_REBOOT_CMD_RESTART2, \"%s\") = %s\n", + INVALID_MAGIC, buf, sprintrc(rc)); - rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, \ - LINUX_REBOOT_MAGIC2, INVALID_CMD); + rc = syscall(__NR_reboot, LINUX_REBOOT_MAGIC1, + LINUX_REBOOT_MAGIC2, INVALID_CMD); printf("reboot(LINUX_REBOOT_MAGIC1, LINUX_REBOOT_MAGIC2," - " %#x /* LINUX_REBOOT_CMD_??? */) = %ld %s (%m)\n", - INVALID_CMD, rc, errno2name()); + " %#x /* LINUX_REBOOT_CMD_??? */) = %s\n", + INVALID_CMD, sprintrc(rc)); + + rc = syscall(__NR_reboot, INVALID_MAGIC, LINUX_REBOOT_MAGIC2A, + LINUX_REBOOT_CMD_RESTART2, str256); + printf("reboot(%#x /* LINUX_REBOOT_MAGIC_??? */, LINUX_REBOOT_MAGIC2A, " + "LINUX_REBOOT_CMD_RESTART2, \"%.255s\"...) = %s\n", + INVALID_MAGIC, str256, sprintrc(rc)); + + rc = syscall(__NR_reboot, INVALID_MAGIC, LINUX_REBOOT_MAGIC2B, + LINUX_REBOOT_CMD_RESTART2, str256 + 1); + printf("reboot(%#x /* LINUX_REBOOT_MAGIC_??? */, LINUX_REBOOT_MAGIC2B, " + "LINUX_REBOOT_CMD_RESTART2, \"%.255s\"...) = %s\n", + INVALID_MAGIC, str256 + 1, sprintrc(rc)); + + rc = syscall(__NR_reboot, INVALID_MAGIC, LINUX_REBOOT_MAGIC2C, + LINUX_REBOOT_CMD_RESTART2, str256 + 2); + printf("reboot(%#x /* LINUX_REBOOT_MAGIC_??? */, LINUX_REBOOT_MAGIC2C, " + "LINUX_REBOOT_CMD_RESTART2, %p) = %s\n", + INVALID_MAGIC, str256 + 2, sprintrc(rc)); + + str256[255] = '\0'; + rc = syscall(__NR_reboot, INVALID_MAGIC, bogus_magic1, + LINUX_REBOOT_CMD_RESTART2, str256); + printf("reboot(%#x /* LINUX_REBOOT_MAGIC_??? */, " + "%#x /* LINUX_REBOOT_MAGIC_??? */, " + "LINUX_REBOOT_CMD_RESTART2, \"%.255s\"...) = %s\n", + INVALID_MAGIC, (unsigned int) bogus_magic1, str256, + sprintrc(rc)); + + rc = syscall(__NR_reboot, INVALID_MAGIC, bogus_magic1, + LINUX_REBOOT_CMD_RESTART2, str256 + 1); + printf("reboot(%#x /* LINUX_REBOOT_MAGIC_??? */, " + "%#x /* LINUX_REBOOT_MAGIC_??? */, " + "LINUX_REBOOT_CMD_RESTART2, \"%.254s\") = %s\n", + INVALID_MAGIC, (unsigned int) bogus_magic1, str256 + 1, + sprintrc(rc)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests/reboot.gen.test b/tests/reboot.gen.test new file mode 100755 index 00000000..06d2f0cb --- /dev/null +++ b/tests/reboot.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (reboot -s 256); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s 256 diff --git a/tests/reboot.test b/tests/reboot.test deleted file mode 100755 index a97dd21a..00000000 --- a/tests/reboot.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check reboot syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/recvfrom.c b/tests/recvfrom.c index b12454d2..c363f6fa 100644 --- a/tests/recvfrom.c +++ b/tests/recvfrom.c @@ -1,30 +1,10 @@ /* * Check decoding of sockaddr related arguments of recvfrom syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #define TEST_SYSCALL_NAME recvfrom diff --git a/tests/recvfrom.gen.test b/tests/recvfrom.gen.test new file mode 100755 index 00000000..2741d210 --- /dev/null +++ b/tests/recvfrom.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (recvfrom -a35 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests/recvfrom.test b/tests/recvfrom.test deleted file mode 100755 index 9dfbc898..00000000 --- a/tests/recvfrom.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of sockaddr related arguments of recvfrom syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a35 diff --git a/tests/recvmmsg-timeout.c b/tests/recvmmsg-timeout.c index 7cf064db..2e703da0 100644 --- a/tests/recvmmsg-timeout.c +++ b/tests/recvmmsg-timeout.c @@ -2,29 +2,10 @@ * Check decoding of timeout argument of recvmmsg syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -50,13 +31,15 @@ main(void) .msg_iovlen = 1 } }; - struct timespec t = { .tv_sec = 0, .tv_nsec = 12345678 }; + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, ts); + ts->tv_sec = 0; + ts->tv_nsec = 12345678; - int rc = recv_mmsg(-1, &mh, 1, 0, &t); + int rc = recv_mmsg(-1, &mh, 1, 0, ts); printf("recvmmsg(-1, %p, 1, 0, {tv_sec=0, tv_nsec=12345678})" - " = %d %s (%m)\n", &mh, rc, errno2name()); + " = %s\n", &mh, sprintrc(rc)); - rc = recv_mmsg(fds[0], &mh, 1, 0, &t); + rc = recv_mmsg(fds[0], &mh, 1, 0, ts); if (rc < 0) perror_msg_and_skip("recvmmsg"); printf("recvmmsg(%d, [{msg_hdr={msg_name=NULL, msg_namelen=0" @@ -64,7 +47,23 @@ main(void) ", msg_controllen=0, msg_flags=0}, msg_len=1}], 1, 0" ", {tv_sec=0, tv_nsec=12345678}) = " "%d (left {tv_sec=0, tv_nsec=%d})\n", - fds[0], rc, (int) t.tv_nsec); + fds[0], rc, (int) ts->tv_nsec); + + ts->tv_sec = 0xdeadbeefU; + ts->tv_nsec = 0xfacefeedU; + + rc = recv_mmsg(fds[0], &mh, 1, 0, ts); + printf("recvmmsg(%d, %p, 1, 0, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + fds[0], &mh, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), sprintrc(rc)); + + ts->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + ts->tv_nsec = (long) 0xbadc0dedfacefeedLL; + + rc = recv_mmsg(fds[0], &mh, 1, 0, ts); + printf("recvmmsg(%d, %p, 1, 0, {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + fds[0], &mh, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), sprintrc(rc)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests/recvmmsg-timeout.gen.test b/tests/recvmmsg-timeout.gen.test new file mode 100755 index 00000000..6306de76 --- /dev/null +++ b/tests/recvmmsg-timeout.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (recvmmsg-timeout -a25 -e trace=recvmmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 -e trace=recvmmsg diff --git a/tests/recvmmsg-timeout.test b/tests/recvmmsg-timeout.test deleted file mode 100755 index 36a12221..00000000 --- a/tests/recvmmsg-timeout.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of timeout argument of recvmmsg syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a25 -e trace=recvmmsg diff --git a/tests/recvmsg.c b/tests/recvmsg.c index fa41a9d4..f61fffb7 100644 --- a/tests/recvmsg.c +++ b/tests/recvmsg.c @@ -2,29 +2,10 @@ * Check decoding of recvmsg and sendmsg syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -100,7 +81,7 @@ main(void) w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), w2_c, LENGTH_OF(w2_c), - ARRAY_SIZE(w_iov_), w_len, + (unsigned int) ARRAY_SIZE(w_iov_), w_len, LENGTH_OF(w0_c), w0_d, w0_c, LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); @@ -127,7 +108,8 @@ main(void) ", msg_controllen=0, msg_flags=0}, 0) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - r0_c, r_len, ARRAY_SIZE(r0_iov_), r_len, r_len, r0_d, r0_c); + r0_c, r_len, (unsigned int) ARRAY_SIZE(r0_iov_), + r_len, r_len, r0_d, r0_c); void *r1 = tail_alloc(r_len); void *r2 = tail_alloc(w_len); @@ -151,8 +133,8 @@ main(void) ", msg_iovlen=%u, msg_controllen=0, msg_flags=0}, 0) = %u\n" " * %u bytes in buffer 0\n" " | 00000 %-49s %-16s |\n", - r1_c, r_len, w_len, ARRAY_SIZE(r1_iov_), w_len - r_len, - w_len - r_len, r1_d, r1_c); + r1_c, r_len, w_len, (unsigned int) ARRAY_SIZE(r1_iov_), + w_len - r_len, w_len - r_len, r1_d, r1_c); close(0); tprintf("+++ exited with 0 +++\n"); diff --git a/tests/recvmsg.gen.test b/tests/recvmsg.gen.test new file mode 100755 index 00000000..fc8ef067 --- /dev/null +++ b/tests/recvmsg.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (recvmsg -eread=0 -ewrite=1 -e trace=recvmsg,sendmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -eread=0 -ewrite=1 -e trace=recvmsg,sendmsg diff --git a/tests/recvmsg.test b/tests/recvmsg.test deleted file mode 100755 index e373a20a..00000000 --- a/tests/recvmsg.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of recvmsg and sendmsg syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -eread=0 -ewrite=1 -e trace=recvmsg,sendmsg diff --git a/tests/redirect-fds.c b/tests/redirect-fds.c index fc1073a7..afce7d4c 100644 --- a/tests/redirect-fds.c +++ b/tests/redirect-fds.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/redirect-fds.test b/tests/redirect-fds.test index ddef8fab..a833a586 100755 --- a/tests/redirect-fds.test +++ b/tests/redirect-fds.test @@ -3,29 +3,10 @@ # Check that strace does not leak placeholder descriptors. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -47,18 +28,17 @@ check_fd() a2="$2" a3="$3" + rm -f "$LOG" "$fd0" "$fd1" "$fd2" touch "$LOG" "$fd0" || framework_skip_ 'failed to create files' - set -- "\"./$NAME\"" "\"$1\"" "\"$2\"" "\"$3\"" + set -- "\"../$NAME\"" "\"$1\"" "\"$2\"" "\"$3\"" eval "$@" "<${a1:-&-}" ">${a2:-&-}" "2>${a3:-&-}" || fail_ "$* failed with code $rc" set -- "$STRACE" -o"$LOG" -echdir "$@" eval "$@" "<${a1:-&-}" ">${a2:-&-}" "2>${a3:-&-}" || dump_log_and_fail_with "$* failed with code $?" - - rm -f "$LOG" "$fd0" "$fd1" "$fd2" } check_fd "$fd0" "$fd1" "$fd2" diff --git a/tests/redirect.test b/tests/redirect.test index fa0c5369..ebf91bec 100755 --- a/tests/redirect.test +++ b/tests/redirect.test @@ -3,29 +3,10 @@ # Ensure that strace does not retain stdin and stdout descriptors. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -74,5 +55,3 @@ $STRACE -qq -enone -esignal=none \ if [ -s "$OUT" ]; then fail_ "$STRACE failed to redirect standard output" fi - -rm -f -- "$OUT" diff --git a/tests/regex.gen.test b/tests/regex.gen.test new file mode 100755 index 00000000..71a02d67 --- /dev/null +++ b/tests/regex.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (regex test_trace_expr '' -etrace='/^(.*_)?statv?fs'); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -etrace='/^(.*_)?statv?fs' diff --git a/tests/regex.in b/tests/regex.in new file mode 100755 index 00000000..7c4adfe1 --- /dev/null +++ b/tests/regex.in @@ -0,0 +1,2 @@ +statfs -a17 +statfs64 -a23 diff --git a/tests/remap_file_pages-Xabbrev.c b/tests/remap_file_pages-Xabbrev.c new file mode 100644 index 00000000..d808f423 --- /dev/null +++ b/tests/remap_file_pages-Xabbrev.c @@ -0,0 +1 @@ +#include "remap_file_pages.c" diff --git a/tests/remap_file_pages-Xabbrev.gen.test b/tests/remap_file_pages-Xabbrev.gen.test new file mode 100755 index 00000000..76c45daa --- /dev/null +++ b/tests/remap_file_pages-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (remap_file_pages-Xabbrev -Xabbrev -e trace=remap_file_pages); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xabbrev -e trace=remap_file_pages diff --git a/tests/remap_file_pages-Xraw.c b/tests/remap_file_pages-Xraw.c new file mode 100644 index 00000000..f01d20af --- /dev/null +++ b/tests/remap_file_pages-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "remap_file_pages.c" diff --git a/tests/remap_file_pages-Xraw.gen.test b/tests/remap_file_pages-Xraw.gen.test new file mode 100755 index 00000000..2e022399 --- /dev/null +++ b/tests/remap_file_pages-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (remap_file_pages-Xraw -Xraw -e trace=remap_file_pages); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xraw -e trace=remap_file_pages diff --git a/tests/remap_file_pages-Xverbose.c b/tests/remap_file_pages-Xverbose.c new file mode 100644 index 00000000..51e0e34e --- /dev/null +++ b/tests/remap_file_pages-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "remap_file_pages.c" diff --git a/tests/remap_file_pages-Xverbose.gen.test b/tests/remap_file_pages-Xverbose.gen.test new file mode 100755 index 00000000..eb1e0f65 --- /dev/null +++ b/tests/remap_file_pages-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (remap_file_pages-Xverbose -Xverbose -e trace=remap_file_pages); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xverbose -e trace=remap_file_pages diff --git a/tests/remap_file_pages.c b/tests/remap_file_pages.c index 452d2de7..2a2bfc6e 100644 --- a/tests/remap_file_pages.c +++ b/tests/remap_file_pages.c @@ -1,54 +1,111 @@ /* * Check decoding of remap_file_pages syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2017 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include +#include "scno.h" #ifdef __NR_remap_file_pages # include -# include +# include # include +# include + +static const char *errstr; + +static long +k_remap_file_pages(const kernel_ulong_t addr, + const kernel_ulong_t size, + const kernel_ulong_t prot, + const kernel_ulong_t pgoff, + const kernel_ulong_t flags) +{ + const long rc = syscall(__NR_remap_file_pages, + addr, size, prot, pgoff, flags); + errstr = sprintrc(rc); + return rc; +} int main(void) { - const unsigned long addr = (unsigned long) 0xfacefeeddeadbeefULL; - const unsigned long size = (unsigned long) 0xdefaced1bad2f00dULL; - const unsigned long prot = PROT_READ|PROT_WRITE|PROT_EXEC; - const unsigned long pgoff = (unsigned long) 0xcaf3babebad4deedULL; - const unsigned long flags = MAP_PRIVATE|MAP_ANONYMOUS; - - long rc = syscall(__NR_remap_file_pages, addr, size, prot, pgoff, flags); - printf("remap_file_pages(%#lx, %lu, %s, %lu, %s) = %ld %s (%m)\n", - addr, size, "PROT_READ|PROT_WRITE|PROT_EXEC", pgoff, - "MAP_PRIVATE|MAP_ANONYMOUS", rc, errno2name()); + kernel_ulong_t addr = (kernel_ulong_t) 0xfacefeeddeadbeefULL; + kernel_ulong_t size = (kernel_ulong_t) 0xdefaced1bad2f00dULL; + kernel_ulong_t prot = PROT_READ|PROT_WRITE|PROT_EXEC; + kernel_ulong_t pgoff = (kernel_ulong_t) 0xcaf3babebad4deedULL; + kernel_ulong_t flags = MAP_PRIVATE|MAP_ANONYMOUS; +# define prot1_str "PROT_READ|PROT_WRITE|PROT_EXEC" +# define flags1_str "MAP_PRIVATE|MAP_ANONYMOUS" + + k_remap_file_pages(addr, size, prot, pgoff, flags); +# if XLAT_RAW + printf("remap_file_pages(%#jx, %ju, %#jx, %ju, %#jx) = %s\n", + (uintmax_t) addr, (uintmax_t) size, (uintmax_t) prot, + (uintmax_t) pgoff, (uintmax_t) flags, errstr); +# elif XLAT_VERBOSE + printf("remap_file_pages(%#jx, %ju, %#jx /* %s */, %ju, %#jx /* %s */)" + " = %s\n", + (uintmax_t) addr, (uintmax_t) size, (uintmax_t) prot, prot1_str, + (uintmax_t) pgoff, (uintmax_t) flags, + flags1_str, errstr); +# else /* XLAT_ABBREV */ + printf("remap_file_pages(%#jx, %ju, %s, %ju, %s) = %s\n", + (uintmax_t) addr, (uintmax_t) size, prot1_str, + (uintmax_t) pgoff, flags1_str, errstr); +# endif + +# ifdef MAP_HUGETLB +# ifndef MAP_HUGE_2MB +# ifndef MAP_HUGE_SHIFT +# define MAP_HUGE_SHIFT 26 +# endif +# define MAP_HUGE_2MB (21 << MAP_HUGE_SHIFT) +# endif /* !MAP_HUGE_2MB */ + addr = (kernel_ulong_t) 0xfacefeeddeadf00dULL; + size = (kernel_ulong_t) 0xdefaced1bad2beefULL; + prot = (kernel_ulong_t) 0xdefaced00000000ULL | PROT_NONE; + flags = MAP_TYPE | MAP_FIXED | MAP_NORESERVE | MAP_HUGETLB | MAP_HUGE_2MB; + + k_remap_file_pages(addr, size, prot, pgoff, flags); + +/* + * HP PA-RISC is the only architecture that has MAP_TYPE defined to 0x3, which + * is also used for MAP_SHARED_VALIDATE since Linux commit v4.15-rc1~71^2^2~23. + */ +# ifdef __hppa__ +# define MAP_TYPE_str "MAP_SHARED_VALIDATE" +# else +# define MAP_TYPE_str "0xf /* MAP_??? */" +# endif +# define flags2_str \ + MAP_TYPE_str "|MAP_FIXED|MAP_NORESERVE|MAP_HUGETLB|21< diff --git a/tests/rename.gen.test b/tests/rename.gen.test new file mode 100755 index 00000000..81fb0398 --- /dev/null +++ b/tests/rename.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rename -a35 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests/rename.test b/tests/rename.test deleted file mode 100755 index 9067e4cc..00000000 --- a/tests/rename.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check rename syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a35 diff --git a/tests/renameat.c b/tests/renameat.c index 2b874efa..7f11893f 100644 --- a/tests/renameat.c +++ b/tests/renameat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/renameat.gen.test b/tests/renameat.gen.test new file mode 100755 index 00000000..dbc6e05b --- /dev/null +++ b/tests/renameat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (renameat ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/renameat.test b/tests/renameat.test deleted file mode 100755 index 9b0a61dd..00000000 --- a/tests/renameat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check renameat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/renameat2.c b/tests/renameat2.c index 33f88988..663c0638 100644 --- a/tests/renameat2.c +++ b/tests/renameat2.c @@ -1,30 +1,10 @@ /* * Check decoding of renameat2 syscall. * - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/renameat2.gen.test b/tests/renameat2.gen.test new file mode 100755 index 00000000..78251cb2 --- /dev/null +++ b/tests/renameat2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (renameat2 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/renameat2.test b/tests/renameat2.test deleted file mode 100755 index 4c176bbd..00000000 --- a/tests/renameat2.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check renameat2 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/request_key.c b/tests/request_key.c index fea977b2..20ae12f6 100644 --- a/tests/request_key.c +++ b/tests/request_key.c @@ -2,29 +2,10 @@ * Check decoding of request_key syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -69,8 +50,7 @@ main(void) { static const char unterminated1[] = { '\1', '\2', '\3', '\4', '\5' }; static const char unterminated2[] = { '\6', '\7', '\10', '\11', '\12' }; - static const char unterminated3[] = - { '\16', '\17', '\20', '\21', '\22' }; + static const char unterminated3[] = { '\16', '\17', '\20', '\21', '\22' }; char *bogus_type = tail_memdup(unterminated1, sizeof(unterminated1)); char *bogus_desc = tail_memdup(unterminated2, sizeof(unterminated2)); @@ -101,7 +81,7 @@ main(void) { bogus_desc, NULL }, { ARG_STR("\25\26\27\30\31") }, { ARG_STR("desc") }, - { "overly long description", _STR("overly long ") "..." }, + { "overly long description", STRINGIFY("overly long ") "..." }, }; struct { @@ -113,7 +93,7 @@ main(void) { bogus_info, NULL }, { ARG_STR("\32\33\34\35\36") }, { ARG_STR("info") }, - { "overly long info", _STR("overly long ") "..." }, + { "overly long info", STRINGIFY("overly long ") "..." }, }; struct { diff --git a/tests/request_key.gen.test b/tests/request_key.gen.test new file mode 100755 index 00000000..aeac708f --- /dev/null +++ b/tests/request_key.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (request_key -a33 -s12); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -s12 diff --git a/tests/request_key.test b/tests/request_key.test deleted file mode 100755 index 9812a18e..00000000 --- a/tests/request_key.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of request_key syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a33 -s12 diff --git a/tests/restart_syscall.c b/tests/restart_syscall.c index e492e62e..9a8f7e3a 100644 --- a/tests/restart_syscall.c +++ b/tests/restart_syscall.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -55,23 +36,24 @@ main(void) if (nanosleep(&req, &rem)) perror_msg_and_fail("nanosleep"); - printf("nanosleep\\(\\{tv_sec=%jd, tv_nsec=%jd\\}, " - "\\{tv_sec=%jd, tv_nsec=%jd\\}\\)" + printf("nanosleep\\(\\{tv_sec=%lld, tv_nsec=%llu\\}" + ", \\{tv_sec=%lld, tv_nsec=%llu\\}\\)" " = \\? ERESTART_RESTARTBLOCK \\(Interrupted by signal\\)\n", - (intmax_t) req.tv_sec, (intmax_t) req.tv_nsec, - (intmax_t) rem.tv_sec, (intmax_t) rem.tv_nsec); + (long long) req.tv_sec, zero_extend_signed_to_ull(req.tv_nsec), + (long long) rem.tv_sec, zero_extend_signed_to_ull(rem.tv_nsec)); puts("--- SIGALRM \\{si_signo=SIGALRM, si_code=SI_KERNEL\\} ---"); -#ifdef __arm__ +# 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\\{tv_sec=%jd, tv_nsec=%jd\\}), " - "%p|restart_syscall\\(<\\.\\.\\." +# define ALTERNATIVE_NANOSLEEP_REQ "0xfffffffc|" +# else +# define ALTERNATIVE_NANOSLEEP_REQ "" +# endif + printf("(nanosleep\\((%s\\{tv_sec=%lld, tv_nsec=%llu\\})" + ", %p|restart_syscall\\(<\\.\\.\\." " resuming interrupted nanosleep \\.\\.\\.>)\\) = 0\n", ALTERNATIVE_NANOSLEEP_REQ, - (intmax_t) req.tv_sec, (intmax_t) req.tv_nsec, &rem); + (long long) req.tv_sec, zero_extend_signed_to_ull(req.tv_nsec), + &rem); puts("\\+\\+\\+ exited with 0 \\+\\+\\+"); return 0; diff --git a/tests/restart_syscall.test b/tests/restart_syscall.test index 6dfda168..8dde6684 100755 --- a/tests/restart_syscall.test +++ b/tests/restart_syscall.test @@ -1,13 +1,15 @@ #!/bin/sh - +# # Check how "resuming interrupted nanosleep" works. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog > /dev/null syscalls=nanosleep,restart_syscall -run_strace -a20 -e trace=$syscalls $args > "$OUT" -match_grep "$LOG" "$OUT" -rm -f "$OUT" - -exit 0 +run_strace -a20 -e trace=$syscalls $args > "$EXP" +match_grep "$LOG" "$EXP" diff --git a/tests/riscv_flush_icache.c b/tests/riscv_flush_icache.c new file mode 100644 index 00000000..27abf75b --- /dev/null +++ b/tests/riscv_flush_icache.c @@ -0,0 +1,73 @@ +/* + * Check decoding of riscv_flush_icache syscall. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include + +#include "scno.h" + +#ifdef __NR_riscv_flush_icache + +# include +# include +# include + +int main(void) +{ + static struct { + kernel_ulong_t addr; + const char *str; + } addrs[] = { + { (kernel_ulong_t) (uintptr_t) ARG_STR(NULL) }, + { (kernel_ulong_t) 0xbadc0deddeadf157ULL, + sizeof(kernel_ulong_t) == 8 ? "0xbadc0deddeadf157" : + "0xdeadf157" }, + }; + static struct { + kernel_ulong_t val; + const char *str; + } flags[] = { + { ARG_STR(0) }, + { 1, "SYS_RISCV_FLUSH_ICACHE_LOCAL" }, + { (kernel_ulong_t) 0xfacefeedfffffffeULL, + sizeof(kernel_ulong_t) == 8 ? + "0xfacefeedfffffffe /* SYS_RISCV_FLUSH_ICACHE_??? */" : + "0xfffffffe /* SYS_RISCV_FLUSH_ICACHE_??? */" }, + { (kernel_ulong_t) 0xfacefeedffffffffULL, + sizeof(kernel_ulong_t) == 8 ? + "SYS_RISCV_FLUSH_ICACHE_LOCAL|0xfacefeedfffffffe" : + "SYS_RISCV_FLUSH_ICACHE_LOCAL|0xfffffffe" }, + }; + + for (size_t i = 0; i < ARRAY_SIZE(addrs); i++) { + for (size_t j = 0; j < ARRAY_SIZE(addrs); j++) { + for (size_t k = 0; k < ARRAY_SIZE(flags); k++) { + long rc = syscall(__NR_riscv_flush_icache, + addrs[i].addr, + addrs[j].addr, + flags[k].val); + + printf("riscv_flush_icache(%s, %s, %s) = %s\n", + addrs[i].str, addrs[j].str, flags[k].str, + sprintrc(rc)); + } + } + } + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_riscv_flush_icache"); + +#endif diff --git a/tests/riscv_flush_icache.gen.test b/tests/riscv_flush_icache.gen.test new file mode 100755 index 00000000..1a1f793a --- /dev/null +++ b/tests/riscv_flush_icache.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (riscv_flush_icache -a34 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a34 diff --git a/tests/rmdir.c b/tests/rmdir.c index 20952d84..505303ad 100644 --- a/tests/rmdir.c +++ b/tests/rmdir.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/rmdir.gen.test b/tests/rmdir.gen.test new file mode 100755 index 00000000..8b346af9 --- /dev/null +++ b/tests/rmdir.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rmdir -a22 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests/rmdir.test b/tests/rmdir.test deleted file mode 100755 index 81ee66b8..00000000 --- a/tests/rmdir.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check rmdir syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a22 diff --git a/tests/rt_sigaction.awk b/tests/rt_sigaction.awk new file mode 100644 index 00000000..81dd8130 --- /dev/null +++ b/tests/rt_sigaction.awk @@ -0,0 +1,76 @@ +#!/bin/gawk +# +# Copyright (c) 2014-2015 Dmitry V. Levin +# Copyright (c) 2016 Elvira Khabirova +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +BEGIN { + n1[1][1] = n2[1][1] = "SIG_IGN" + n1[1][2] = n2[1][2] = "\\[HUP INT\\]" + n1[1][3] = "SA_RESTORER\\|SA_RESTART" + n2[1][3] = "SA_RESTART" + n1[1][4] = ", sa_restorer=0x[0-9a-f]+" + n2[1][4] = "" + + n1[2][1] = n2[2][1] = "0x[0-9a-f]+" + n1[2][2] = n2[2][2] = "\\[QUIT TERM\\]" + n1[2][3] = "SA_RESTORER\\|SA_SIGINFO" + n2[2][3] = "SA_SIGINFO" + n1[2][4] = ", sa_restorer=0x[0-9a-f]+" + n2[2][4] = "" + + n1[3][1] = n2[3][1] = "SIG_DFL" + n1[3][2] = n2[3][2] = "\\[\\]" + n1[3][3] = "SA_RESTORER" + n2[3][3] = "0" + n1[3][4] = ", sa_restorer=0x[0-9a-f]+" + n2[3][4] = "" + + n1[4][1] = n2[4][1] = "SIG_DFL" + n1[4][2] = n2[4][2] = "~\\[HUP( ((RT|SIGRT)[^] ]+|[3-9][0-9]|1[0-9][0-9]))*\\]" + n1[4][3] = "SA_RESTORER" + n2[4][3] = "0" + n1[4][4] = ", sa_restorer=0x[0-9a-f]+" + n2[4][4] = "" + + o1[1][1] = o2[1][1] = "SIG_DFL" + o1[1][2] = o2[1][2] = "\\[\\]" + o1[1][3] = o2[1][3] = "0" + o1[1][4] = o2[1][4] = "" + + for (i = 2; i < 5; i++) { + for (j = 1; j < 5; j++) { + o1[i][j] = n1[i - 1][j] + o2[i][j] = n2[i - 1][j] + } + } + + a1 = "(0x[0-9a-f]+, )?(4|8|16)" + a2 = "(4|8|16)(, 0x[0-9a-f]+)?" + a3 = "0x[0-9a-f]+, (4|8|16)" + + for (i = 1; i < 5; i++) { + r[i] = "^rt_sigaction\\(SIGUSR2, (" \ + "\\{sa_handler=" n1[i][1] ", sa_mask=" n1[i][2] \ + ", sa_flags=" n1[i][3] n1[i][4] "\\}, \\{sa_handler=" \ + o1[i][1] ", sa_mask=" o1[i][2] ", sa_flags=" o1[i][3] \ + o1[i][4] "\\}, " a1 "|" \ + "\\{sa_handler=" n2[i][1] ", sa_mask=" n2[i][2] \ + ", sa_flags=" n2[i][3] n2[i][4] "\\}, \\{sa_handler=" \ + o2[i][1] ", sa_mask=" o2[i][2] ", sa_flags=" o2[i][3] \ + o2[i][4] "\\}, " a2 "|" \ + "\\{sa_handler=" n2[i][1] ", sa_mask=" n2[i][2] \ + ", sa_flags=" n2[i][3] n2[i][4] "\\}, \\{sa_handler=" \ + o2[i][1] ", sa_mask=" o2[i][2] ", sa_flags=" o2[i][3] \ + o2[i][4] "\\}, " a3 ")\\) = 0$" + } + s[5] = "+++ exited with 0 +++" + + lines = 5 + fail = 0 +} + +@include "match.awk" diff --git a/tests/rt_sigaction.c b/tests/rt_sigaction.c new file mode 100644 index 00000000..852b417b --- /dev/null +++ b/tests/rt_sigaction.c @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2014-2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include +#include +#include +#include + +static void handle_signal(int no) +{ + _exit(128 + no); +} + +int +main(void) +{ + struct sigaction sa, sa0; + + sa.sa_handler = SIG_IGN; + sigemptyset(&sa.sa_mask); + sigaddset(&sa.sa_mask, SIGHUP); + sigaddset(&sa.sa_mask, SIGINT); + sa.sa_flags = SA_RESTART; + assert(!sigaction(SIGUSR2, &sa, &sa0)); + + sa.sa_handler = handle_signal; + sigemptyset(&sa.sa_mask); + sigaddset(&sa.sa_mask, SIGQUIT); + sigaddset(&sa.sa_mask, SIGTERM); + sa.sa_flags = SA_SIGINFO; + assert(!sigaction(SIGUSR2, &sa, &sa0)); + + sa.sa_handler = SIG_DFL; + sigemptyset(&sa.sa_mask); + sa.sa_flags = 0; + assert(!sigaction(SIGUSR2, &sa, &sa0)); + + sigfillset(&sa.sa_mask); + sigdelset(&sa.sa_mask, SIGHUP); + assert(!sigaction(SIGUSR2, &sa, &sa0)); + + return 0; +} diff --git a/tests/rt_sigaction.test b/tests/rt_sigaction.test new file mode 100755 index 00000000..afbbb540 --- /dev/null +++ b/tests/rt_sigaction.test @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Check rt_sigaction decoding. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog +run_strace -ert_sigaction $args +match_awk + +exit 0 diff --git a/tests/rt_sigpending.c b/tests/rt_sigpending.c index accf6913..06b15db2 100644 --- a/tests/rt_sigpending.c +++ b/tests/rt_sigpending.c @@ -2,29 +2,10 @@ * This file is part of rt_sigpending strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -54,12 +35,12 @@ iterate(const char *const text, unsigned int size, void *set) break; } if (size) { -#if WORDS_BIGENDIAN +# if WORDS_BIGENDIAN if (size < sizeof(long)) tprintf("rt_sigpending(%s, %u) = 0\n", "[]", size); else -#endif +# endif tprintf("rt_sigpending(%s, %u) = 0\n", text, size); } else { @@ -78,7 +59,7 @@ main(void) const unsigned int big_size = 1024 / 8; void *k_set = tail_alloc(big_size); - sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(sigset_t, libc_set); sigemptyset(libc_set); if (sigprocmask(SIG_SETMASK, libc_set, NULL)) diff --git a/tests/rt_sigpending.gen.test b/tests/rt_sigpending.gen.test new file mode 100755 index 00000000..d52858af --- /dev/null +++ b/tests/rt_sigpending.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rt_sigpending -a20 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests/rt_sigpending.test b/tests/rt_sigpending.test deleted file mode 100755 index 40c83a81..00000000 --- a/tests/rt_sigpending.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check rt_sigpending syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 diff --git a/tests/rt_sigprocmask.c b/tests/rt_sigprocmask.c index 27e357fa..e6f513da 100644 --- a/tests/rt_sigprocmask.c +++ b/tests/rt_sigprocmask.c @@ -2,29 +2,10 @@ * This file is part of rt_sigprocmask strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -91,7 +72,7 @@ main(void) void *const k_set = tail_alloc(set_size); void *const old_set = tail_alloc(set_size); - sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(sigset_t, libc_set); memset(k_set, 0, set_size); if (k_sigprocmask(SIG_SETMASK, k_set, NULL, set_size)) diff --git a/tests/rt_sigprocmask.gen.test b/tests/rt_sigprocmask.gen.test new file mode 100755 index 00000000..67fcdc0f --- /dev/null +++ b/tests/rt_sigprocmask.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rt_sigprocmask ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/rt_sigprocmask.test b/tests/rt_sigprocmask.test deleted file mode 100755 index 1e60ebde..00000000 --- a/tests/rt_sigprocmask.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check rt_sigprocmask syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/rt_sigqueueinfo.c b/tests/rt_sigqueueinfo.c index aba6776c..0455dd40 100644 --- a/tests/rt_sigqueueinfo.c +++ b/tests/rt_sigqueueinfo.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015 Elvira Khabirova + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,7 +13,7 @@ #include int -main (void) +main(void) { struct sigaction sa = { .sa_handler = SIG_IGN diff --git a/tests/rt_sigqueueinfo.gen.test b/tests/rt_sigqueueinfo.gen.test new file mode 100755 index 00000000..d11eecc0 --- /dev/null +++ b/tests/rt_sigqueueinfo.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rt_sigqueueinfo -esignal=none ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests/rt_sigqueueinfo.test b/tests/rt_sigqueueinfo.test deleted file mode 100755 index c03c76f2..00000000 --- a/tests/rt_sigqueueinfo.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of rt_sigqueueinfo syscall - -. "${srcdir=.}/init.sh" -run_strace_match_diff -esignal=none diff --git a/tests/rt_sigreturn.c b/tests/rt_sigreturn.c new file mode 100644 index 00000000..4a45b5d5 --- /dev/null +++ b/tests/rt_sigreturn.c @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +#ifdef ASM_SIGRTMIN +# define RT_0 ASM_SIGRTMIN +#else +/* Linux kernel >= 3.18 defines SIGRTMIN to 32 on all architectures. */ +# define RT_0 32 +#endif + +static void +handler(int no, siginfo_t *si, void *uc) +{ +} + +int +main(void) +{ + static sigset_t set; + sigemptyset(&set); + sigaddset(&set, SIGINT); + sigaddset(&set, SIGUSR2); + sigaddset(&set, SIGCHLD); + sigaddset(&set, RT_0 + 3); + sigaddset(&set, RT_0 + 4); + sigaddset(&set, RT_0 + 5); + sigaddset(&set, RT_0 + 26); + sigaddset(&set, RT_0 + 27); + if (sigprocmask(SIG_SETMASK, &set, NULL)) + perror_msg_and_fail("sigprocmask"); + sigemptyset(&set); + + static const struct sigaction sa = { + .sa_sigaction = handler, + .sa_flags = SA_SIGINFO + }; + if (sigaction(SIGUSR1, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + if (raise(SIGUSR1)) + perror_msg_and_fail("raise"); + + static const char *const sigs = + (SIGUSR2 < SIGCHLD) ? "INT USR2 CHLD" : "INT CHLD USR2"; + static const char *const rt_sigs = "RT_3 RT_4 RT_5 RT_26 RT_27"; + printf("rt_sigreturn({mask=[%s %s]}) = 0\n", sigs, rt_sigs); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/rt_sigreturn.gen.test b/tests/rt_sigreturn.gen.test new file mode 100755 index 00000000..d8b153e3 --- /dev/null +++ b/tests/rt_sigreturn.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rt_sigreturn -esignal='!USR1' ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal='!USR1' diff --git a/tests/rt_sigsuspend.c b/tests/rt_sigsuspend.c index 73e13364..55ae6239 100644 --- a/tests/rt_sigsuspend.c +++ b/tests/rt_sigsuspend.c @@ -2,29 +2,10 @@ * This file is part of rt_sigsuspend strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -88,7 +69,7 @@ main(void) void *k_set = tail_alloc(big_size); memset(k_set, 0, big_size); - sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(sigset_t, libc_set); sigemptyset(libc_set); sigaddset(libc_set, SIGUSR1); if (sigprocmask(SIG_SETMASK, libc_set, NULL)) diff --git a/tests/rt_sigsuspend.gen.test b/tests/rt_sigsuspend.gen.test new file mode 100755 index 00000000..d5d1d5f3 --- /dev/null +++ b/tests/rt_sigsuspend.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rt_sigsuspend -a20 -esignal=none); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -esignal=none diff --git a/tests/rt_sigsuspend.test b/tests/rt_sigsuspend.test deleted file mode 100755 index 2e30fd4b..00000000 --- a/tests/rt_sigsuspend.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check rt_sigsuspend syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 -esignal=none diff --git a/tests/rt_sigtimedwait.c b/tests/rt_sigtimedwait.c index 10311e6e..56144f52 100644 --- a/tests/rt_sigtimedwait.c +++ b/tests/rt_sigtimedwait.c @@ -2,29 +2,10 @@ * This file is part of rt_sigtimedwait strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -54,25 +35,27 @@ iterate(const char *const text, const void *set, for (;;) { assert(k_sigtimedwait(set, NULL, timeout, size) == -1); if (EINTR == errno) { - tprintf("rt_sigtimedwait(%s, NULL, " - "{tv_sec=%jd, tv_nsec=%jd}, %u)" + tprintf("rt_sigtimedwait(%s, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}, %u)" " = -1 EAGAIN (%m)\n", text, - (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, + (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), size); } else { if (size < sizeof(long)) - tprintf("rt_sigtimedwait(%p, NULL, " - "{tv_sec=%jd, tv_nsec=%jd}" + tprintf("rt_sigtimedwait(%p, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}" ", %u) = -1 EINVAL (%m)\n", - set, (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, size); + set, (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), + size); else - tprintf("rt_sigtimedwait(%s, NULL, " - "{tv_sec=%jd, tv_nsec=%jd}" + tprintf("rt_sigtimedwait(%s, NULL" + ", {tv_sec=%lld, tv_nsec=%llu}" ", %u) = -1 EINVAL (%m)\n", - text, (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, size); + text, (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), + size); } if (!size) break; @@ -86,8 +69,8 @@ main(void) { tprintf("%s", ""); - siginfo_t *const info = tail_alloc(sizeof(*info)); - struct timespec *const timeout = tail_alloc(sizeof(*timeout)); + TAIL_ALLOC_OBJECT_CONST_PTR(siginfo_t, info); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, timeout); timeout->tv_sec = 0; timeout->tv_nsec = 42; @@ -100,37 +83,58 @@ main(void) assert(k_sigtimedwait(k_set, NULL, timeout, set_size) == -1); if (EAGAIN == errno) break; - tprintf("rt_sigtimedwait(%p, NULL, {tv_sec=%jd, tv_nsec=%jd}, %u)" - " = -1 EINVAL (%m)\n", - k_set, (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, set_size); + tprintf("rt_sigtimedwait(%p, NULL, {tv_sec=%lld, tv_nsec=%llu}" + ", %u) = -1 EINVAL (%m)\n", + k_set, (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); } if (!set_size) perror_msg_and_fail("rt_sigtimedwait"); - tprintf("rt_sigtimedwait([], NULL, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", - (intmax_t) timeout->tv_sec, (intmax_t) timeout->tv_nsec, - set_size); + tprintf("rt_sigtimedwait([], NULL, {tv_sec=%lld, tv_nsec=%llu}, %u)" + " = -1 EAGAIN (%m)\n", + (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); + + timeout->tv_sec = 0xdeadbeefU; + timeout->tv_nsec = 0xfacefeedU; + assert(k_sigtimedwait(k_set, NULL, timeout, set_size) == -1); + tprintf("rt_sigtimedwait([], NULL, {tv_sec=%lld, tv_nsec=%llu}" + ", %u) = -1 EINVAL (%m)\n", + (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); + + timeout->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + timeout->tv_nsec = (long) 0xbadc0dedfacefeedLL; + assert(k_sigtimedwait(k_set, NULL, timeout, set_size) == -1); + tprintf("rt_sigtimedwait([], NULL, {tv_sec=%lld, tv_nsec=%llu}" + ", %u) = -1 EINVAL (%m)\n", + (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); + + timeout->tv_sec = 0; + timeout->tv_nsec = 42; - sigset_t *const libc_set = tail_alloc(sizeof(sigset_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(sigset_t, libc_set); sigemptyset(libc_set); sigaddset(libc_set, SIGHUP); memcpy(k_set, libc_set, set_size); assert(k_sigtimedwait(k_set, info, timeout, set_size) == -1); assert(EAGAIN == errno); - tprintf("rt_sigtimedwait([HUP], %p, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", - info, (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, set_size); + tprintf("rt_sigtimedwait([HUP], %p, {tv_sec=%lld, tv_nsec=%llu}, %u)" + " = -1 EAGAIN (%m)\n", + info, (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); sigaddset(libc_set, SIGINT); memcpy(k_set, libc_set, set_size); assert(k_sigtimedwait(k_set, info, timeout, set_size) == -1); assert(EAGAIN == errno); - tprintf("rt_sigtimedwait([HUP INT], %p, {tv_sec=%jd, tv_nsec=%jd}, %u)" + tprintf("rt_sigtimedwait([HUP INT], %p, {tv_sec=%lld, tv_nsec=%llu}, %u)" " = -1 EAGAIN (%m)\n", - info, (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, set_size); + info, (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); sigaddset(libc_set, SIGQUIT); sigaddset(libc_set, SIGALRM); @@ -139,17 +143,19 @@ main(void) assert(k_sigtimedwait(k_set, info, timeout, set_size) == -1); assert(EAGAIN == errno); - tprintf("rt_sigtimedwait(%s, %p, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", + tprintf("rt_sigtimedwait(%s, %p, {tv_sec=%lld, tv_nsec=%llu}, %u)" + " = -1 EAGAIN (%m)\n", "[HUP INT QUIT ALRM TERM]", - info, (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, set_size); + info, (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); memset(k_set - set_size, -1, set_size); assert(k_sigtimedwait(k_set - set_size, info, timeout, set_size) == -1); assert(EAGAIN == errno); - tprintf("rt_sigtimedwait(~[], %p, {tv_sec=%jd, tv_nsec=%jd}, %u) = -1 EAGAIN (%m)\n", - info, (intmax_t) timeout->tv_sec, - (intmax_t) timeout->tv_nsec, set_size); + tprintf("rt_sigtimedwait(~[], %p, {tv_sec=%lld, tv_nsec=%llu}, %u)" + " = -1 EAGAIN (%m)\n", + info, (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size); if (sigprocmask(SIG_SETMASK, libc_set, NULL)) perror_msg_and_fail("sigprocmask"); @@ -164,9 +170,11 @@ main(void) raise(SIGALRM); assert(k_sigtimedwait(k_set, info, timeout, set_size) == SIGALRM); tprintf("rt_sigtimedwait(%s, {si_signo=%s, si_code=SI_TKILL" - ", si_pid=%d, si_uid=%d}, {tv_sec=%jd, tv_nsec=%jd}, %u) = %d (%s)\n", + ", si_pid=%d, si_uid=%d}, {tv_sec=%lld, tv_nsec=%llu}, %u)" + " = %d (%s)\n", "[HUP INT QUIT ALRM TERM]", "SIGALRM", getpid(), getuid(), - (intmax_t) timeout->tv_sec, (intmax_t) timeout->tv_nsec, + (long long) timeout->tv_sec, + zero_extend_signed_to_ull(timeout->tv_nsec), set_size, SIGALRM, "SIGALRM"); raise(SIGALRM); diff --git a/tests/rt_sigtimedwait.gen.test b/tests/rt_sigtimedwait.gen.test new file mode 100755 index 00000000..a9409ae9 --- /dev/null +++ b/tests/rt_sigtimedwait.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rt_sigtimedwait -a38 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a38 diff --git a/tests/rt_sigtimedwait.test b/tests/rt_sigtimedwait.test deleted file mode 100755 index e15fb779..00000000 --- a/tests/rt_sigtimedwait.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check rt_sigtimedwait syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a38 diff --git a/tests/rt_tgsigqueueinfo.c b/tests/rt_tgsigqueueinfo.c index ec093481..e3ad0e22 100644 --- a/tests/rt_tgsigqueueinfo.c +++ b/tests/rt_tgsigqueueinfo.c @@ -2,29 +2,10 @@ * This file is part of rt_tgsigqueueinfo strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -42,14 +23,14 @@ static long k_tgsigqueueinfo(const pid_t pid, const int sig, const void *const info) { return syscall(__NR_rt_tgsigqueueinfo, - (unsigned long) 0xffffffff00000000ULL | pid, - (unsigned long) 0xffffffff00000000ULL | pid, - (unsigned long) 0xffffffff00000000ULL | sig, + F8ILL_KULONG_MASK | pid, + F8ILL_KULONG_MASK | pid, + F8ILL_KULONG_MASK | sig, info); } int -main (void) +main(void) { const struct sigaction sa = { .sa_handler = SIG_IGN @@ -57,14 +38,15 @@ main (void) if (sigaction(SIGUSR1, &sa, NULL)) perror_msg_and_fail("sigaction"); - siginfo_t *const info = tail_alloc(sizeof(*info)); + TAIL_ALLOC_OBJECT_CONST_PTR(siginfo_t, info); memset(info, 0, sizeof(*info)); info->si_signo = SIGUSR1; info->si_errno = ENOENT; info->si_code = SI_QUEUE; info->si_pid = getpid(); info->si_uid = getuid(); - info->si_value.sival_ptr = (void *) (unsigned long) 0xdeadbeeffacefeedULL; + info->si_value.sival_ptr = + (void *) (unsigned long) 0xdeadbeeffacefeedULL; if (k_tgsigqueueinfo(info->si_pid, SIGUSR1, info)) (errno == ENOSYS ? perror_msg_and_skip : perror_msg_and_fail)( diff --git a/tests/rt_tgsigqueueinfo.gen.test b/tests/rt_tgsigqueueinfo.gen.test new file mode 100755 index 00000000..0539e35a --- /dev/null +++ b/tests/rt_tgsigqueueinfo.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (rt_tgsigqueueinfo -esignal=none ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests/rt_tgsigqueueinfo.test b/tests/rt_tgsigqueueinfo.test deleted file mode 100755 index ab24e2d6..00000000 --- a/tests/rt_tgsigqueueinfo.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of rt_tgsigqueueinfo syscall - -. "${srcdir=.}/init.sh" -run_strace_match_diff -esignal=none diff --git a/tests/run.sh b/tests/run.sh index 02d99123..1a0aa7e5 100755 --- a/tests/run.sh +++ b/tests/run.sh @@ -1,12 +1,22 @@ #!/bin/sh +# +# Copyright (c) 2013-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" $STRACE -V > /dev/null || framework_failure_ "$STRACE is not available" -TIMEOUT="timeout -s 9 $TIMEOUT_DURATION" +TIMEOUT="timeout -k 5 -s XCPU $TIMEOUT_DURATION" $TIMEOUT true > /dev/null 2>&1 || TIMEOUT= -exec $TIMEOUT "$@" +if [ $# -eq 0 ]; then + echo 'No command or test-file specified' >&2 + exit 1 +fi + +exec $TIMEOUT "$@" < /dev/null diff --git a/tests/run_expect_termsig.c b/tests/run_expect_termsig.c new file mode 100644 index 00000000..f6b72d07 --- /dev/null +++ b/tests/run_expect_termsig.c @@ -0,0 +1,38 @@ +/* + * Execute a command, expect its termination with a specified signal. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include +#include + +int +main(int ac, char **av) +{ + if (ac < 3) + error_msg_and_fail("usage: run_expect_termsig signo path..."); + + signal(SIGCHLD, SIG_DFL); + + pid_t pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + execvp(av[2], av + 2); + perror_msg_and_fail("execvp: %s", av[2]); + } + + int status; + if (waitpid(pid, &status, 0) != pid) + perror_msg_and_fail("waitpid"); + + return !(WIFSIGNALED(status) && WTERMSIG(status) == atoi(av[1])); +} diff --git a/tests/s390_guarded_storage-v.c b/tests/s390_guarded_storage-v.c new file mode 100644 index 00000000..05afd9fe --- /dev/null +++ b/tests/s390_guarded_storage-v.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "s390_guarded_storage.c" diff --git a/tests/s390_guarded_storage-v.gen.test b/tests/s390_guarded_storage-v.gen.test new file mode 100755 index 00000000..045ff762 --- /dev/null +++ b/tests/s390_guarded_storage-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (s390_guarded_storage-v -e trace=s390_guarded_storage -a32 -v); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=s390_guarded_storage -a32 -v diff --git a/tests/s390_guarded_storage.c b/tests/s390_guarded_storage.c new file mode 100644 index 00000000..a84c1413 --- /dev/null +++ b/tests/s390_guarded_storage.c @@ -0,0 +1,208 @@ +/* + * Check decoding of s390_guarded_storage syscall. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#if defined __NR_s390_guarded_storage && defined HAVE_ASM_GUARDED_STORAGE_H + +# include +# include +# include +# include + +# include + +# ifndef VERBOSE +# define VERBOSE 0 +# endif + +static void +gs_no_arg(kernel_ulong_t val, const char *val_str) +{ + static const kernel_ulong_t bogus_addr = + (kernel_ulong_t) 0xcaffeedadeadbed5ULL; + static const kernel_ulong_t bogus_cmd_mask = + (kernel_ulong_t) 0xbadc0ded00000000ULL; + long rc; + + rc = syscall(__NR_s390_guarded_storage, val | bogus_cmd_mask, + bogus_addr); + printf("s390_guarded_storage(%s) = %s\n", val_str, sprintrc(rc)); +} + +static void +gs_print_epl(uint64_t addr, bool valid, const char *str) +{ + if (!valid) { + if (str) + printf("%s", str); + else + printf("%#" PRIx64, addr); + + return; + } + + struct gs_epl *gsepl = (struct gs_epl *) (uintptr_t) addr; + + printf("[{"); + +# if VERBOSE + if (gsepl->pad1) + printf("pad1=%#02x, ", gsepl->pad1); + + printf("gs_eam=%#02x /* extended addressing mode: %u, " + "basic addressing mode: %u */" + ", gs_eci=%#02x /* CPU in TX: %u, CPU in CX: %u, " + "instruction: %s */" + ", gs_eai=%#02x /* DAT: %u, address space indication: %u, " + "AR number: %u */, ", + gsepl->gs_eam, gsepl->e, gsepl->b, + gsepl->gs_eci, gsepl->tx, gsepl->cx, + gsepl->in ? "LLGFGS": "LGG", + gsepl->gs_eai, gsepl->t, gsepl->as, gsepl->ar); + + if (gsepl->pad2) + printf("pad2=%#08x, ", gsepl->pad2); +# endif /* VERBOSE */ + + printf("gs_eha=%#llx, ", (unsigned long long) gsepl->gs_eha); + +# if VERBOSE + printf("gs_eia=%#llx, gs_eoa=%#llx, gs_eir=%#llx, gs_era=%#llx", + (unsigned long long) gsepl->gs_eia, + (unsigned long long) gsepl->gs_eoa, + (unsigned long long) gsepl->gs_eir, + (unsigned long long) gsepl->gs_era); +# else /* !VERBOSE */ + printf("..."); +# endif /* VERBOSE */ + + printf("}]"); +} + +static void +gs_set_cb(kernel_ulong_t addr, bool valid, bool epl_valid, + const char *bc_str, const char *epl_str) +{ + static const kernel_ulong_t bogus_cmd_mask = + (kernel_ulong_t) 0xda7a105700000000ULL; + + long rc; + + printf("s390_guarded_storage(GS_SET_BC_CB, "); + + if (valid) { + struct gs_cb *gscb = (struct gs_cb *) (uintptr_t) addr; + + printf("{"); + + if (gscb->reserved) + printf("reserved=%#016llx, ", + (unsigned long long) gscb->reserved); + + printf("gsd=%#16llx", + (unsigned long long) gscb->gsd); +# if VERBOSE + printf(" /* GS origin: "); + + unsigned int gsc = gscb->gsd & 0x3F; + unsigned int gls = (gscb->gsd >> 8) & 7; + bool gsc_valid = gsc >= 25 && gsc <= 56; + + if (gsc_valid) { + uint64_t gls = gscb->gsd >> gsc; + int field_size = 2 + (67 - gsc) / 4; + + printf("%#0*" PRIx64, field_size, gls); + } else { + printf("[invalid]"); + } + + printf(", guard load shift: %u, GS characteristic: %u */", + gls, gsc); +# endif /* VERBOSE */ + + printf(", gssm=%#016llx, gs_epl_a=", + (unsigned long long) gscb->gssm); + + gs_print_epl(gscb->gs_epl_a, epl_valid, epl_str); + + printf("}"); + } else { + if (bc_str) + printf("%s", bc_str); + else + printf("%#llx", (unsigned long long) addr); + } + + rc = syscall(__NR_s390_guarded_storage, + GS_SET_BC_CB | bogus_cmd_mask, addr); + printf(") = %s\n", sprintrc(rc)); +} + +int +main(void) +{ + static const kernel_ulong_t bogus_cmd = + (kernel_ulong_t) 0xdeafbeefdeadc0deULL; + static const kernel_ulong_t bogus_addr = + (kernel_ulong_t) 0xfacefeedac0ffeedULL; + + TAIL_ALLOC_OBJECT_CONST_PTR(struct gs_cb, gscb); + TAIL_ALLOC_OBJECT_CONST_PTR(struct gs_epl, gsepl); + + long rc; + + rc = syscall(__NR_s390_guarded_storage, 5, 0); + printf("s390_guarded_storage(0x5 /* GS_??? */, NULL) = %s\n", + sprintrc(rc)); + + rc = syscall(__NR_s390_guarded_storage, bogus_cmd, bogus_addr); + printf("s390_guarded_storage(%#x /* GS_??? */, %#lx) = %s\n", + (unsigned) bogus_cmd, (unsigned long) bogus_addr, sprintrc(rc)); + + gs_no_arg(ARG_STR(GS_BROADCAST)); + gs_no_arg(ARG_STR(GS_CLEAR_BC_CB)); + gs_no_arg(ARG_STR(GS_DISABLE)); + gs_no_arg(ARG_STR(GS_ENABLE)); + + fill_memory(gscb, sizeof(*gscb)); + fill_memory_ex(gsepl, sizeof(*gsepl), 0xA5, 0x5A); + + gs_set_cb(0, false, false, "NULL", NULL); + gs_set_cb((uintptr_t) (gscb + 1), false, false, NULL, NULL); + + gscb->gs_epl_a = 0; + gs_set_cb((uintptr_t) gscb, true, false, NULL, "NULL"); + + fill_memory_ex(gscb, sizeof(*gscb), 0x5A, 0xA5); + gscb->gs_epl_a = (uintptr_t) (gsepl + 1) | + (sizeof(kernel_ulong_t) < sizeof(uint64_t) ? + 0xc0debad000000000ULL : 0); + gs_set_cb((uintptr_t) gscb, true, false, NULL, NULL); + + fill_memory_ex(gscb, sizeof(*gscb), 0xA7, 0xA5); + gscb->gs_epl_a = (uintptr_t) gsepl; + gs_set_cb((uintptr_t) gscb, true, true, NULL, NULL); + + fill_memory_ex(gscb, sizeof(*gscb), 0x55, 0xAA); + fill_memory_ex(gsepl, sizeof(*gsepl), 0x5A, 0xA5); + gscb->gs_epl_a = (uintptr_t) gsepl; + gs_set_cb((uintptr_t) gscb, true, true, NULL, NULL); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_s390_guarded_storage && HAVE_ASM_GUARDED_STORAGE_H") + +#endif diff --git a/tests/s390_guarded_storage.gen.test b/tests/s390_guarded_storage.gen.test new file mode 100755 index 00000000..28b59814 --- /dev/null +++ b/tests/s390_guarded_storage.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (s390_guarded_storage -a32 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 diff --git a/tests/s390_pci_mmio_read_write.c b/tests/s390_pci_mmio_read_write.c new file mode 100644 index 00000000..0cd160c6 --- /dev/null +++ b/tests/s390_pci_mmio_read_write.c @@ -0,0 +1,134 @@ +/* + * Check decoding of s390_pci_mmio_read and s390_pci_mmio_write syscalls. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#if defined __NR_s390_pci_mmio_read && defined __NR_s390_pci_mmio_write + +# include +# include +# include +# include + +static void +do_call(bool wr, kernel_ulong_t mmio_addr, kernel_ulong_t buf, + kernel_ulong_t len, bool buf_valid, const char *buf_str) +{ + long saved_errno = 0; + long rc = 0; + + printf("s390_pci_mmio_%s(%#llx, ", wr ? "write" : "read", + (unsigned long long) mmio_addr); + + if (!wr) { + rc = syscall(__NR_s390_pci_mmio_read, mmio_addr, buf, len); + saved_errno = errno; + } + + if (buf_valid && !rc) { + char *buf_ptr = (char *) (uintptr_t) buf; + + print_quoted_hex(buf_ptr, + len > DEFAULT_STRLEN ? DEFAULT_STRLEN : len); + + if (len > DEFAULT_STRLEN) + printf("..."); + } else { + if (buf_str) + printf("%s", buf_str); + else + printf("%#llx", (unsigned long long) buf); + } + + printf(", %llu) = ", (unsigned long long) len); + + if (wr) + rc = syscall(__NR_s390_pci_mmio_write, mmio_addr, buf, len); + else + errno = saved_errno; + + puts(sprintrc(rc)); +} + +int +main(void) +{ + static const size_t buf_size = DEFAULT_STRLEN + 10; + + char *buf = tail_alloc(buf_size); + + bool bools[] = { true, false }; + + kernel_ulong_t addrs[] = { + 0, + (kernel_ulong_t) 0xdeafbeefdeadc0deULL, + }; + + struct { + kernel_ulong_t buf; + const char *str; + size_t size; + } bufs[] = { + { (kernel_ulong_t) ARG_STR(NULL), 0 }, + { (kernel_ulong_t) (buf + buf_size), NULL, 0 }, + { (kernel_ulong_t) (buf), NULL, buf_size }, + { (kernel_ulong_t) (buf + 9), NULL, buf_size - 9 }, + { (kernel_ulong_t) (buf + 10), NULL, buf_size - 10 }, + { (kernel_ulong_t) (buf + 16), NULL, buf_size - 16 }, + { (kernel_ulong_t) (buf + 26), NULL, buf_size - 26 }, + { (kernel_ulong_t) (buf + 28), NULL, buf_size - 28 }, + }; + + kernel_ulong_t sizes[] = { + 0, + DEFAULT_STRLEN / 2, + DEFAULT_STRLEN - 10, + DEFAULT_STRLEN, + DEFAULT_STRLEN + 1, + buf_size, + buf_size + 10, + (kernel_ulong_t) 0xfacefeedac0ffeedULL, + }; + + unsigned int i, j, k, l; + unsigned int ctr = 0; + + for (i = 0; i < ARRAY_SIZE(addrs); i++) { + for (j = 0; j < ARRAY_SIZE(bufs); j++) { + for (k = 0; k < ARRAY_SIZE(sizes); k++) { + for (l = 0; l < ARRAY_SIZE(bools); l++) { + bool valid = bufs[j].buf && + bufs[j].size >= + MIN(sizes[k], + DEFAULT_STRLEN + 1); + + if (bufs[j].size && bools[l]) + fill_memory_ex((char *) buf, + bufs[j].size, + 0xC0 + ctr, 255); + + do_call(bools[l], addrs[i], bufs[j].buf, + sizes[k], valid, bufs[j].str); + + ctr++; + } + } + } + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_s390_pci_mmio_read && __NR_s390_pci_mmio_write"); + +#endif diff --git a/tests/s390_pci_mmio_read_write.gen.test b/tests/s390_pci_mmio_read_write.gen.test new file mode 100755 index 00000000..cf32e0b3 --- /dev/null +++ b/tests/s390_pci_mmio_read_write.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (s390_pci_mmio_read_write -e trace=s390_pci_mmio_read,s390_pci_mmio_write -a30); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=s390_pci_mmio_read,s390_pci_mmio_write -a30 diff --git a/tests/s390_runtime_instr.c b/tests/s390_runtime_instr.c new file mode 100644 index 00000000..db31719b --- /dev/null +++ b/tests/s390_runtime_instr.c @@ -0,0 +1,78 @@ +/* + * Check decoding of s390_runtime_instr syscall. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#if defined __NR_s390_runtime_instr + +# include +# include +# include +# include + +int +main(void) +{ + static struct { + kernel_ulong_t cmd; + const char * cmd_str; + } cmd_args[] = { + { 0, "0 /* S390_RUNTIME_INSTR_??? */" }, + { 4, "4 /* S390_RUNTIME_INSTR_??? */" }, + { (kernel_ulong_t) 0xdeafbeefdeadc0deULL, + "-559038242 /* S390_RUNTIME_INSTR_??? */" }, + { 2, "S390_RUNTIME_INSTR_STOP" }, + }; + + static struct { + kernel_ulong_t sig; + const char * sig_str; + } start_sig_args[] = { + { 0, "0" }, + { (kernel_ulong_t) 0xfacefeedac0ffeedULL, NULL }, + { ARG_STR(SIGALRM) }, + { 33, "SIGRT_1" }, + { 63, "SIGRT_31" }, + }; + + unsigned int i; + long rc; + + for (i = 0; i < ARRAY_SIZE(cmd_args); i++) { + rc = syscall(__NR_s390_runtime_instr, cmd_args[i].cmd, 0xdead); + printf("s390_runtime_instr(%s) = %s\n", + cmd_args[i].cmd_str, sprintrc(rc)); + } + + for (i = 0; i < ARRAY_SIZE(start_sig_args); i++) { + long saved_errno; + + rc = syscall(__NR_s390_runtime_instr, 1, start_sig_args[i].sig); + saved_errno = errno; + printf("s390_runtime_instr(S390_RUNTIME_INSTR_START, "); + + if (start_sig_args[i].sig_str) + printf("%s", start_sig_args[i].sig_str); + else + printf("%d", (int) start_sig_args[i].sig); + + errno = saved_errno; + printf(") = %s\n", sprintrc(rc)); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_s390_runtime_instr") + +#endif diff --git a/tests/s390_runtime_instr.gen.test b/tests/s390_runtime_instr.gen.test new file mode 100755 index 00000000..83e81502 --- /dev/null +++ b/tests/s390_runtime_instr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (s390_runtime_instr -a44 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a44 diff --git a/tests/s390_sthyi-v.c b/tests/s390_sthyi-v.c new file mode 100644 index 00000000..86055203 --- /dev/null +++ b/tests/s390_sthyi-v.c @@ -0,0 +1,2 @@ +#define VERBOSE 1 +#include "s390_sthyi.c" diff --git a/tests/s390_sthyi-v.gen.test b/tests/s390_sthyi-v.gen.test new file mode 100755 index 00000000..27ab447b --- /dev/null +++ b/tests/s390_sthyi-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (s390_sthyi-v -e trace=s390_sthyi -a47 -v); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=s390_sthyi -a47 -v diff --git a/tests/s390_sthyi.c b/tests/s390_sthyi.c new file mode 100644 index 00000000..5186fdc9 --- /dev/null +++ b/tests/s390_sthyi.c @@ -0,0 +1,763 @@ +/* + * Check decoding of s390_sthyi syscall. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#if defined HAVE_ICONV_H && defined HAVE_ICONV_OPEN && defined __NR_s390_sthyi + +# include +# include +# include +# include +# include +# include + +# include + +# define EBCDIC_MAX_LEN 16 + +# ifndef VERBOSE +# define VERBOSE 0 +# endif + +static inline bool +print_0x8(const char *prefix, unsigned char *buf, unsigned int offs, bool zero) +{ + if (!zero && !buf[offs]) + return false; + + printf("%s=%#02hhx", prefix, buf[offs]); + + return true; +} + +static inline bool +print_u8(const char *prefix, unsigned char *buf, unsigned int offs, bool zero) +{ + if (!zero && !buf[offs]) + return false; + + printf("%s=%hhu", prefix, buf[offs]); + + return true; +} + +static inline bool +print_u16(const char *prefix, unsigned char *buf, unsigned int offs, bool zero) +{ + uint16_t val = *(uint16_t *) (buf + offs); + + if (!zero && !val) + return false; + + printf("%s=%" PRIu16, prefix, val); + + return true; +} + +static inline bool +print_x32(const char *prefix, unsigned char *buf, unsigned int offs, bool zero) +{ + uint32_t val = *(uint32_t *) (buf + offs); + + if (!zero && !val) + return false; + + printf("%s=%#" PRIx32, prefix, val); + + return true; +} + +static inline bool +print_weight(const char *prefix, unsigned char *buf, unsigned int offs, + bool zero) +{ + uint32_t val = *(uint32_t *) (buf + offs); + + if (print_x32(prefix, buf, offs, zero)) { + if (val) + printf(" /* %u %u/65536 cores */", + val >> 16, val & 0xFFFF); + else + printf(" /* unlimited */"); + + return true; + } + + return false; +} + +static inline char * +ebcdic2ascii(unsigned char *ebcdic, size_t size) +{ + static char ascii_buf[EBCDIC_MAX_LEN]; + + char *ebcdic_pos = (char *) ebcdic; + char *ascii_pos = ascii_buf; + size_t ebcdic_left = size; + size_t ascii_left = size; + size_t ret; + + iconv_t cd = iconv_open("ASCII", "EBCDICUS"); + + if (size > sizeof(ascii_buf)) + error_msg_and_fail("ebcdic2ascii: EBCDIC string is too big: " + "%zu (maximum is %zu)", + size, sizeof(ascii_buf)); + if (cd == (iconv_t) -1) + perror_msg_and_fail("ebcdic2ascii: unable to allocate a " + "conversion descriptior for converting " + "EBCDIC to ASCII"); + + while ((ret = iconv(cd, &ebcdic_pos, &ebcdic_left, + &ascii_pos, &ascii_left)) == (size_t) -1) { + switch (errno) { + case EILSEQ: + case EINVAL: /* That one is quite unexpected, actually */ + if (!ebcdic_left || !ascii_left) + goto ebcdic2ascii_end; + + *ascii_pos++ = ' '; + ebcdic_pos++; + ebcdic_left--; + + break; + + case E2BIG: + perror_msg_and_fail("ebcdic2ascii: ran out of " + "ASCII buffer unexpectedly"); + default: + perror_msg_and_fail("ebcdic2ascii: unexpected error"); + } + } + +ebcdic2ascii_end: + iconv_close(cd); + + if (ebcdic_left != ascii_left) + error_msg_and_fail("ebcdic2ascii: ASCII string differs in size " + "from EBCDIC"); + + return ascii_buf; +} + +static inline bool +is_empty(unsigned char *ptr, size_t size) +{ + size_t i; + + for (i = 0; !*ptr && i < size; ptr++, i++) + ; + + return i == size; +} + +static inline bool +print_ebcdic(const char *prefix, unsigned char *addr, unsigned int offs, + size_t size, bool zero, bool blank) +{ + const char *ascii = ebcdic2ascii(addr + offs, size); + + if (!zero) { + size_t i; + + for (i = 0; (addr[offs + i] == (blank ? 64 : 0)) && (i < size); + i++) + ; + + if (i == size) + return false; + } + + printf("%s=", prefix); + print_quoted_hex((char *) (addr + offs), size); + printf(" /* "); + print_quoted_memory(ascii, size); + printf(" */"); + + return true; +} + +static void +print_hypervisor_header(unsigned char *buf, int level, unsigned int offs_pos, + unsigned int len_pos, bool mt) +{ + uint16_t offs = *(uint16_t *) (buf + offs_pos); + uint16_t hdr_size = *(uint16_t *) (buf + len_pos); + unsigned char *cur; + + if (!offs) + return; + if (hdr_size < 32) + error_msg_and_fail("sthyi: hypervisor %d section is too small " + "(got %hu, 32 expected)", level, hdr_size); + + cur = buf + offs; + + printf(", /* hypervisor %d */ {infyflg1", level); + print_0x8("", cur, 0, true); +# if VERBOSE + if (cur[0]) { + bool printed = false; + + printf(" /* "); + if (cur[0] & 0x80) { + printf("0x80 - guest CPU usage had limiting is using " + "the consumption method"); + printed = true; + } + if (cur[0] & 0x40) { + if (printed) + printf(", "); + printf("0x40 - LIMITHARD caps use prorated core time " + "for capping"); + printed = true; + } + if (cur[0] & 0x3F) { + if (printed) + printf(", "); + printf("%#hhx - ???", cur[0] & 0x3F); + } + printf(" */"); + } + + print_0x8(", infyflg2", cur, 1, false); + print_0x8(", infyval1", cur, 2, false); + print_0x8(", infyval2", cur, 3, false); + + print_u8(", infytype", cur, 4, true); + if (cur[4] == 1) + printf(" /* z/VM is the hypervisor */"); + else + printf(" /* unknown hypervisor type */"); + + if (cur[5]) + printf(", reserved_1__=\"\\x%#02hhx\"", cur[5]); + + print_u8(", infycpt", cur, 6, mt); + print_u8(", infyiflt", cur, 7, mt); +# endif /* !VERBOSE */ + + print_ebcdic(", infysyid", cur, 8, 8, VERBOSE, true); + print_ebcdic(", infyclnm", cur, 16, 8, VERBOSE, true); + + print_u16(", infyscps", cur, 24, VERBOSE); + print_u16(", infydcps", cur, 26, VERBOSE); + print_u16(", infysifl", cur, 28, VERBOSE); + print_u16(", infydifl", cur, 30, VERBOSE); + +# if VERBOSE + if (hdr_size > 32 && !is_empty(cur + 32, hdr_size - 32)) { + printf(", "); + print_quoted_hex((char *) (cur + 32), hdr_size - 32); + } +# else /* !VERBOSE */ + printf(", ..."); +# endif /* !VERBOSE */ + + printf("}"); +} + +static void +print_guest_header(unsigned char *buf, int level, unsigned int offs_pos, + unsigned int len_pos) +{ + uint16_t offs = *(uint16_t *) (buf + offs_pos); + uint16_t hdr_size = *(uint16_t *) (buf + len_pos); + unsigned char *cur; + + if (!offs) + return; + if (hdr_size < 56) + error_msg_and_fail("sthyi: guest %d section is too small " + "(got %hu, 56 expected)", level, hdr_size); + + cur = buf + offs; + + printf(", /* guest %d */ {infgflg1", level); + print_0x8("", cur, 0, true); +# if VERBOSE + if (cur[0]) { + bool printed = false; + + printf(" /* "); + if (cur[0] & 0x80) { + printf("0x80 - guest is mobility enabled"); + printed = true; + } + if (cur[0] & 0x40) { + if (printed) + printf(", "); + printf("0x40 - guest has multiple virtual CPU types"); + printed = true; + } + if (cur[0] & 0x20) { + if (printed) + printf(", "); + printf("0x20 - guest CP dispatch type has LIMITHARD " + "cap"); + printed = true; + } + if (cur[0] & 0x10) { + if (printed) + printf(", "); + printf("0x10 - guest IFL dispatch type has LIMITHARD " + "cap"); + printed = true; + } + if (cur[0] & 0x08) { + if (printed) + printf(", "); + printf("0x08 - virtual CPs are thread dispatched"); + printed = true; + } + if (cur[0] & 0x04) { + if (printed) + printf(", "); + printf("0x04 - virtual IFLs are thread dispatched"); + printed = true; + } + if (cur[0] & 0x3) { + if (printed) + printf(", "); + printf("%#hhx - ???", cur[0] & 0x3); + } + printf(" */"); + } + + print_0x8(", infgflg2", cur, 1, false); + print_0x8(", infgval1", cur, 2, false); + print_0x8(", infgval2", cur, 3, false); +# endif /* !VERBOSE */ + + print_ebcdic(", infgusid", cur, 4, 8, true, false); + + print_u16(", infgscps", cur, 12, VERBOSE); + print_u16(", infgdcps", cur, 14, VERBOSE); + +# if VERBOSE + print_u8(", infgcpdt", cur, 16, true); + if (cur[16] == 0) + printf(" /* General Purpose (CP) */"); + else + printf(" /* unknown */"); + + if (cur[17] || cur[18] || cur[19]) + printf(", reserved_1__=\"\\x%#02hhx\\x%#02hhx\\x%#02hhx\"", + cur[17], cur[18], cur[19]); +# endif /* !VERBOSE */ + + print_weight(", infgcpcc", cur, 20, VERBOSE); + + print_u16(", infgsifl", cur, 24, VERBOSE); + print_u16(", infgdifl", cur, 26, VERBOSE); + +# if VERBOSE + print_u8(", infgifdt", cur, 28, true); + if (cur[28] == 0) + printf(" /* General Purpose (CP) */"); + else if (cur[28] == 3) + printf(" /* Integrated Facility for Linux (IFL) */"); + else + printf(" /* unknown */"); + + if (cur[29] || cur[30] || cur[31]) + printf(", reserved_2__=\"\\x%#02hhx\\x%#02hhx\\x%#02hhx\"", + cur[29], cur[30], cur[31]); +# endif /* !VERBOSE */ + + print_weight(", infgifcc", cur, 32, VERBOSE); + + print_0x8(", infgpflg", cur, 36, true); +# if VERBOSE + if (cur[36]) { + bool printed = false; + + printf(" /* "); + if (cur[36] & 0x80) { + printf("0x80 - CPU pool's CP virtual type has " + "LIMITHARD cap"); + printed = true; + } + if (cur[36] & 0x40) { + if (printed) + printf(", "); + printf("0x40 - CPU pool's CP virtual type has " + "CAPACITY cap"); + printed = true; + } + if (cur[36] & 0x20) { + if (printed) + printf(", "); + printf("0x20 - CPU pool's IFL virtual type has " + "LIMITHARD cap"); + printed = true; + } + if (cur[36] & 0x10) { + if (printed) + printf(", "); + printf("0x10 - CPU pool's IFL virtual type has " + "CAPACITY cap"); + printed = true; + } + if (cur[36] & 0x08) { + if (printed) + printf(", "); + printf("0x08 - CPU pool uses prorated core time"); + printed = true; + } + if (cur[36] & 0x7) { + if (printed) + printf(", "); + printf("%#hhx - ???", cur[36] & 0x7); + } + printf(" */"); + } + + if (cur[37] || cur[38] || cur[39]) + printf(", reserved_3__=\"\\x%#02hhx\\x%#02hhx\\x%#02hhx\"", + cur[37], cur[38], cur[39]); + + print_ebcdic(", infgpnam", cur, 40, 8, false, true); + + print_weight(", infgpccc", cur, 48, true); + print_weight(", infgpicc", cur, 52, true); + + if (hdr_size > 56 && !is_empty(cur + 56, hdr_size - 56)) { + printf(", "); + print_quoted_hex((char *) (cur + 56), hdr_size - 56); + } +# else /* !VERBOSE */ + printf(", ..."); +# endif /* !VERBOSE */ + + printf("}"); +} + +static void +print_sthyi(unsigned char *buf) +{ + unsigned char *cur; + uint16_t hdr_size; + uint16_t offs; + bool mt = false; + + hdr_size = *(uint16_t *) (buf + 10); + if (hdr_size < 44) + error_msg_and_fail("sthyi: header section is too small " + "(got %hu, 44 expected)", hdr_size); + + /* INFHFLG1 */ + print_0x8("{/* header */ {infhflg1", buf, 0, true); +# if VERBOSE + if (buf[0]) { + bool printed = false; + + printf(" /* "); + if (buf[0] & 0x80) { + printf("0x80 - Global Performance Data unavailable"); + printed = true; + } + if (buf[0] & 0x40) { + if (printed) + printf(", "); + printf("0x40 - One or more hypervisor levels below " + "this level does not support the STHYI " + "instruction"); + printed = true; + } + if (buf[0] & 0x20) { + if (printed) + printf(", "); + printf("0x20 - Virtualization stack is incomplete"); + printed = true; + } + if (buf[0] & 0x10) { + if (printed) + printf(", "); + printf("0x10 - Execution environment is not within a " + "logical partition"); + printed = true; + } + if (buf[0] & 0xF) { + if (printed) + printf(", "); + printf("%#hhx - ???", buf[0] & 0xF); + } + printf(" */"); + } + + print_0x8(", infhflg2", buf, 1, false); + print_0x8(", infhval1", buf, 2, false); + print_0x8(", infhval2", buf, 3, false); + + /* Reserved */ + if (buf[4] || buf[5] || buf[6]) + printf(", reserved_1__=\"\\x%#02hhx\\x%#02hhx\\x%#02hhx\"", + buf[4], buf[5], buf[6]); + + print_u8(", infhygct", buf, 7, true); + print_u16(", infhtotl", buf, 8, true); + print_u16(", infhdln", buf, 10, true); + print_u16(", infmoff", buf, 12, true); + print_u16(", infmlen", buf, 14, true); + print_u16(", infpoff", buf, 16, true); + print_u16(", infplen", buf, 18, true); + print_u16(", infhoff1", buf, 20, true); + print_u16(", infhlen1", buf, 22, true); + print_u16(", infgoff1", buf, 24, true); + print_u16(", infglen1", buf, 26, true); + print_u16(", infhoff2", buf, 28, true); + print_u16(", infhlen2", buf, 30, true); + print_u16(", infgoff2", buf, 32, true); + print_u16(", infglen2", buf, 34, true); + print_u16(", infhoff3", buf, 36, true); + print_u16(", infhlen3", buf, 38, true); + print_u16(", infgoff3", buf, 40, true); + print_u16(", infglen3", buf, 42, true); + + if (hdr_size > 44 && !is_empty(buf + 44, hdr_size - 44)) { + printf(", "); + print_quoted_hex((char *) (buf + 44), hdr_size - 44); + } +# else /* !VERBOSE */ + printf(", ..."); +# endif /* !VERBOSE */ + + printf("}"); + + /* Machine header */ + offs = *(uint16_t *) (buf + 12); + if (!offs) + goto partition_hdr; + + hdr_size = *(uint16_t *) (buf + 14); + if (hdr_size < 60) + error_msg_and_fail("sthyi: machine section is too small " + "(got %hu, 60 expected)", hdr_size); + + cur = buf + offs; + + printf(", /* machine */ {"); + +# if VERBOSE + print_0x8("infmflg1", cur, 0, false); + if (cur[0]) + printf(", "); + print_0x8("infmflg2", cur, 1, false); + if (cur[1]) + printf(", "); +# endif /* !VERBOSE */ + print_0x8("infmval1", cur, 2, true); + + bool cnt_valid = cur[2] & 0x80; +# if VERBOSE + bool id_valid = cur[2] & 0x40; + bool name_valid = cur[2] & 0x20; + + printf(" /* processor count validity: %d, machine ID validity: %d, " + "machine name validity: %d", + !!cnt_valid, !!id_valid, !!name_valid); + if (cur[2] & 0x1F) + printf(", %#hhx - ???", cur[2] & 0x1F); + printf(" */"); + print_0x8(", infmval2", cur, 3, false); +# endif /* !VERBOSE */ + + print_u16(", infmscps", cur, 4, cnt_valid); + print_u16(", infmdcps", cur, 6, cnt_valid); + print_u16(", infmsifl", cur, 8, cnt_valid); + print_u16(", infmdifl", cur, 10, cnt_valid); + +# if VERBOSE + print_ebcdic(", infmname", cur, 12, 8, name_valid, false); + + print_ebcdic(", infmtype", cur, 20, 4, id_valid, false); + print_ebcdic(", infmmanu", cur, 24, 16, id_valid, false); + print_ebcdic(", infmseq", cur, 40, 16, id_valid, false); + print_ebcdic(", infmpman", cur, 56, 4, id_valid, false); + + if (hdr_size > 60 && !is_empty(cur + 60, hdr_size - 60)) { + printf(", "); + print_quoted_hex((char *) (cur + 60), hdr_size - 60); + } +# else /* !VERBOSE */ + printf(", ..."); +# endif /* !VERBOSE */ + + printf("}"); + +partition_hdr: + /* Partition header */ + offs = *(uint16_t *) (buf + 16); + if (!offs) + goto hv_hdr; + + hdr_size = *(uint16_t *) (buf + 18); + if (hdr_size < 56) + error_msg_and_fail("sthyi: partition section is too small " + "(got %hu, 56 expected)", hdr_size); + + cur = buf + offs; + + print_0x8(", /* partition */ {infpflg1", cur, 0, true); + mt = !!(cur[0] & 0x80); +# if VERBOSE + if (cur[0]) { + bool printed = false; + + printf(" /* "); + if (cur[0] & 0x80) { + printf("0x80 - multithreading is enabled"); + printed = true; + } + if (cur[0] & 0x7F) { + if (printed) + printf(", "); + printf("%#hhx - ???", cur[0] & 0x7F); + } + printf(" */"); + } + print_0x8(", infpflg2", cur, 1, false); +# endif /* !VERBOSE */ + print_0x8(", infpval1", cur, 2, true); + + bool pcnt_valid = cur[2] & 0x80; + bool pid_valid = cur[2] & 0x10; +# if VERBOSE + bool pwcap_valid = cur[2] & 0x40; + bool pacap_valid = cur[2] & 0x20; + bool lpar_valid = cur[2] & 0x08; +# endif /* !VERBOSE */ + +# if VERBOSE + printf(" /* processor count validity: %d, partition weight-based " + "capacity validity: %d, partition absolute capacity validity: " + "%d, partition ID validity: %d, LPAR group absolute capacity " + "capping information validity: %d", + !!pcnt_valid, !!pwcap_valid, !!pacap_valid, !!pid_valid, + !!lpar_valid); + if (cur[2] & 0x7) + printf(", %#hhx - ???", cur[2] & 0x7); + printf(" */"); + + print_0x8(", infpval2", cur, 3, false); +# endif /* !VERBOSE */ + + print_u16(", infppnum", cur, 4, pid_valid); + + print_u16(", infpscps", cur, 6, pcnt_valid); + print_u16(", infpdcps", cur, 8, pcnt_valid); + print_u16(", infpsifl", cur, 10, pcnt_valid); + print_u16(", infpdifl", cur, 12, pcnt_valid); + +# if VERBOSE + if (cur[14] || cur[15]) + printf(", reserved_1__=\"\\x%#02hhx\\x%#02hhx\"", + cur[14], cur[15]); +# endif /* !VERBOSE */ + + print_ebcdic(", infppnam", cur, 16, 8, pid_valid, false); + +# if VERBOSE + print_weight(", infpwbcp", cur, 24, pwcap_valid); + print_weight(", infpabcp", cur, 28, pacap_valid); + print_weight(", infpwbif", cur, 32, pwcap_valid); + print_weight(", infpabif", cur, 36, pacap_valid); + + if (print_ebcdic(", infplgnm", cur, 40, 8, false, false)) { + + print_weight(", infplgcp", cur, 48, false); + print_weight(", infplgif", cur, 52, false); + } else { + if (lpar_valid) { + printf(", infplgnm="); + print_quoted_hex((char *) (cur + 40), 8); + } + + print_x32(", infplgcp", cur, 48, false); + print_x32(", infplgif", cur, 52, false); + } + + if (hdr_size > 56 && !is_empty(cur + 56, hdr_size - 56)) { + printf(", "); + print_quoted_hex((char *) (cur + 56), hdr_size - 56); + } +# else /* !VERBOSE */ + printf(", ..."); +# endif /* !VERBOSE */ + + printf("}"); + +hv_hdr: + /* Hypervisor/guest headers */ + print_hypervisor_header(buf, 1, 20, 22, mt); + print_guest_header(buf, 1, 24, 26); + print_hypervisor_header(buf, 2, 28, 30, mt); + print_guest_header(buf, 2, 32, 34); + print_hypervisor_header(buf, 3, 36, 38, mt); + print_guest_header(buf, 3, 40, 42); + + printf("}"); +} + +int +main(void) +{ + static const kernel_ulong_t bogus_func = + (kernel_ulong_t) 0xdeafbeefdeadc0deULL; + static const kernel_ulong_t bogus_resp_buf = + (kernel_ulong_t) 0xfacefeedac0ffeedULL; + static const kernel_ulong_t bogus_ret_code = + (kernel_ulong_t) 0xf00dfa57decaffedULL; + static const kernel_ulong_t bogus_flags = + (kernel_ulong_t) 0xfee1deadfa57beefULL; + + unsigned char *buf = tail_alloc(PAGE_SIZE); + TAIL_ALLOC_OBJECT_CONST_PTR(uint64_t, ret); + + long rc; + + rc = syscall(__NR_s390_sthyi, 0, 0, 0, 0); + printf("s390_sthyi(STHYI_FC_CP_IFL_CAP, NULL, NULL, 0) = %s\n", + sprintrc(rc)); + + rc = syscall(__NR_s390_sthyi, bogus_func, bogus_resp_buf, + bogus_ret_code, bogus_flags); + printf("s390_sthyi(%#llx /* STHYI_FC_??? */, %#llx, %#llx, %#llx) = " + "%s\n", + (unsigned long long) bogus_func, + (unsigned long long) bogus_resp_buf, + (unsigned long long) bogus_ret_code, + (unsigned long long) bogus_flags, + sprintrc(rc)); + + rc = syscall(__NR_s390_sthyi, bogus_func, buf, ret, 0); + printf("s390_sthyi(%#llx /* STHYI_FC_??? */, %p, %p, 0) = %s\n", + (unsigned long long) bogus_func, buf, ret, sprintrc(rc)); + + rc = syscall(__NR_s390_sthyi, 0, buf, ret, 0); + if (rc) + error_msg_and_skip("syscall(__NR_s390_sthyi, 0, buf, ret, 0) " + "returned unexpected value of %ld", rc); + + printf("s390_sthyi(STHYI_FC_CP_IFL_CAP, "); + print_sthyi(buf); + printf(", [0], 0) = 0\n"); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("HAVE_ICONV_H && HAVE_ICONV_OPEN && __NR_s390_sthyi") + +#endif diff --git a/tests/s390_sthyi.gen.test b/tests/s390_sthyi.gen.test new file mode 100755 index 00000000..cf271374 --- /dev/null +++ b/tests/s390_sthyi.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (s390_sthyi -a47 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a47 diff --git a/tests/sched.gen.test b/tests/sched.gen.test new file mode 100755 index 00000000..67471176 --- /dev/null +++ b/tests/sched.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched test_trace_expr times -e/sched); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr times -e/sched diff --git a/tests/sched.in b/tests/sched.in new file mode 100755 index 00000000..46031d6c --- /dev/null +++ b/tests/sched.in @@ -0,0 +1,7 @@ +sched_xetaffinity -a28 +sched_xetparam -a23 +sched_rr_get_interval -a31 +sched_get_priority_mxx -a33 +sched_xetattr -a29 +sched_xetscheduler -a22 +sched_yield -a14 diff --git a/tests/sched_get_priority_mxx.c b/tests/sched_get_priority_mxx.c index fc14b27c..7715d286 100644 --- a/tests/sched_get_priority_mxx.c +++ b/tests/sched_get_priority_mxx.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -24,6 +31,6 @@ main(void) #else SKIP_MAIN_UNDEFINED("__NR_sched_get_priority_min" - " && defined __NR_sched_get_priority_max"); + " && defined __NR_sched_get_priority_max"); #endif diff --git a/tests/sched_get_priority_mxx.gen.test b/tests/sched_get_priority_mxx.gen.test new file mode 100755 index 00000000..a2359972 --- /dev/null +++ b/tests/sched_get_priority_mxx.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched_get_priority_mxx -a33 -e trace=sched_get_priority_min,sched_get_priority_max); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -e trace=sched_get_priority_min,sched_get_priority_max diff --git a/tests/sched_get_priority_mxx.test b/tests/sched_get_priority_mxx.test deleted file mode 100755 index 0d1a1a78..00000000 --- a/tests/sched_get_priority_mxx.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sched_get_priority_min and sched_get_priority_max syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a33 -e trace=sched_get_priority_min,sched_get_priority_max diff --git a/tests/sched_rr_get_interval.c b/tests/sched_rr_get_interval.c index 0aacd2b7..b1117f3b 100644 --- a/tests/sched_rr_get_interval.c +++ b/tests/sched_rr_get_interval.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -11,7 +18,7 @@ int main(void) { - struct timespec *const tp = tail_alloc(sizeof(struct timespec)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, tp); long rc; rc = syscall(__NR_sched_rr_get_interval, 0, NULL); @@ -25,8 +32,10 @@ main(void) rc = syscall(__NR_sched_rr_get_interval, 0, tp); if (rc == 0) - printf("sched_rr_get_interval(0, {tv_sec=%jd, tv_nsec=%jd}) = " - "0\n", (intmax_t)tp->tv_sec, (intmax_t)tp->tv_nsec); + printf("sched_rr_get_interval(0, {tv_sec=%lld, tv_nsec=%llu})" + " = 0\n", + (long long) tp->tv_sec, + zero_extend_signed_to_ull(tp->tv_nsec)); else printf("sched_rr_get_interval(-1, %p) = %s\n", tp, sprintrc(rc)); diff --git a/tests/sched_rr_get_interval.gen.test b/tests/sched_rr_get_interval.gen.test new file mode 100755 index 00000000..02aad002 --- /dev/null +++ b/tests/sched_rr_get_interval.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched_rr_get_interval -a31 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 diff --git a/tests/sched_rr_get_interval.test b/tests/sched_rr_get_interval.test deleted file mode 100755 index 828ba5d0..00000000 --- a/tests/sched_rr_get_interval.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sched_rr_get_interval syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a31 diff --git a/tests/sched_xetaffinity.c b/tests/sched_xetaffinity.c index 41a18202..4e6fbe20 100644 --- a/tests/sched_xetaffinity.c +++ b/tests/sched_xetaffinity.c @@ -1,30 +1,10 @@ /* * This file is part of sched_xetaffinity strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/sched_xetaffinity.gen.test b/tests/sched_xetaffinity.gen.test new file mode 100755 index 00000000..7a1c75be --- /dev/null +++ b/tests/sched_xetaffinity.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched_xetaffinity -a28 -e trace=sched_getaffinity,sched_setaffinity); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 -e trace=sched_getaffinity,sched_setaffinity diff --git a/tests/sched_xetaffinity.test b/tests/sched_xetaffinity.test deleted file mode 100755 index 246ea21a..00000000 --- a/tests/sched_xetaffinity.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sched_getaffinity and sched_setaffinity syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 -e trace=sched_getaffinity,sched_setaffinity diff --git a/tests/sched_xetattr.c b/tests/sched_xetattr.c index 1b484915..3440876b 100644 --- a/tests/sched_xetattr.c +++ b/tests/sched_xetattr.c @@ -1,28 +1,9 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,95 +13,254 @@ # include # include +# include # include +# include "sched_attr.h" +# include "xlat.h" +# include "xlat/schedulers.h" + +static const char *errstr; + +static long +sys_sched_getattr(kernel_ulong_t pid, kernel_ulong_t attr, + kernel_ulong_t size, kernel_ulong_t flags) +{ + long rc = syscall(__NR_sched_getattr, pid, attr, size, flags); + errstr = sprintrc(rc); + return rc; +} + +static long +sys_sched_setattr(kernel_ulong_t pid, kernel_ulong_t attr, kernel_ulong_t flags) +{ + long rc = syscall(__NR_sched_setattr, pid, attr, flags); + errstr = sprintrc(rc); + return rc; +} int main(void) { - struct { - uint32_t size; - uint32_t sched_policy; - uint64_t sched_flags; - int32_t sched_nice; - uint32_t sched_priority; - uint64_t sched_runtime; - uint64_t sched_deadline; - uint64_t sched_period; - } *sched_attr = tail_alloc(sizeof(*sched_attr)); - - long rc = syscall(__NR_sched_getattr, 0xdeadface, NULL, 0, 0); - printf("sched_getattr\\(%d, NULL, 0, 0\\) += %s\n", - 0xdeadface, sprintrc_grep(rc)); - - rc = syscall(__NR_sched_getattr, -1, - sched_attr, 0xbadfaced, 0xc0defeed); - printf("sched_getattr\\(-1, %p, %u, %u\\) += %s\n", - sched_attr, 0xbadfaced, 0xc0defeed, sprintrc_grep(rc)); - - rc = syscall(__NR_sched_getattr, 0, - sched_attr + 1, sizeof(*sched_attr), 0); - printf("sched_getattr\\(0, %p, %u, 0\\) += %s\n", - sched_attr + 1, (unsigned)sizeof(*sched_attr), - sprintrc_grep(rc)); - - if (syscall(__NR_sched_getattr, 0, sched_attr, sizeof(*sched_attr), 0)) - perror_msg_and_skip("sched_getattr"); + static const kernel_ulong_t bogus_pid = + (kernel_ulong_t) 0xdefacedfacefeedULL; + static const kernel_ulong_t bogus_size = + (kernel_ulong_t) 0xdefacedcafef00dULL; + static const kernel_ulong_t bogus_flags = + (kernel_ulong_t) 0xdefaceddeadc0deULL; + + TAIL_ALLOC_OBJECT_CONST_PTR(struct sched_attr, attr); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, psize); + void *const efault = attr + 1; + + sys_sched_getattr(0, 0, 0, 0); + printf("sched_getattr(0, NULL, 0, 0) = %s\n", errstr); - printf("sched_getattr\\(0, \\{size=%u, sched_policy=SCHED_[A-Z]+" - ", sched_flags=%s, sched_nice=%d, sched_priority=%u" + sys_sched_getattr(0, (unsigned long) attr, 0, 0); + printf("sched_getattr(0, %p, 0, 0) = %s\n", attr, errstr); + + sys_sched_getattr(bogus_pid, 0, 0, 0); + printf("sched_getattr(%d, NULL, 0, 0) = %s\n", (int) bogus_pid, errstr); + + sys_sched_getattr(-1U, (unsigned long) attr, bogus_size, bogus_flags); + printf("sched_getattr(-1, %p, %s%u, %u) = %s\n", + attr, +# if defined __arm64__ || defined __aarch64__ + "0xdefaced<<32|", +# else + "", +# endif + (unsigned) bogus_size, (unsigned) bogus_flags, errstr); + + sys_sched_getattr(0, (unsigned long) efault, sizeof(*attr), 0); + printf("sched_getattr(0, %p, %u, 0) = %s\n", + efault, (unsigned) sizeof(*attr), errstr); + + if (sys_sched_getattr(0, (unsigned long) attr, sizeof(*attr), 0)) + perror_msg_and_skip("sched_getattr"); + printf("sched_getattr(0, {size=%u, sched_policy=", attr->size); + printxval(schedulers, attr->sched_policy, NULL); + printf(", sched_flags=%s, sched_nice=%d, sched_priority=%u" ", sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 - ", sched_period=%" PRIu64 "\\}, %u, 0\\) += 0\n", - sched_attr->size, - sched_attr->sched_flags ? "SCHED_FLAG_RESET_ON_FORK" : "0", - sched_attr->sched_nice, - sched_attr->sched_priority, - sched_attr->sched_runtime, - sched_attr->sched_deadline, - sched_attr->sched_period, - (unsigned) sizeof(*sched_attr)); - - sched_attr->sched_flags |= 1; - if (syscall(__NR_sched_setattr, 0, sched_attr, 0)) + ", sched_period=%" PRIu64 "}, %u, 0) = 0\n", + attr->sched_flags ? "SCHED_FLAG_RESET_ON_FORK" : "0", + attr->sched_nice, + attr->sched_priority, + attr->sched_runtime, + attr->sched_deadline, + attr->sched_period, + (unsigned) sizeof(*attr)); + +# if defined __arm64__ || defined __aarch64__ + long rc = +# endif + sys_sched_getattr(F8ILL_KULONG_MASK, (unsigned long) attr, + F8ILL_KULONG_MASK | sizeof(*attr), F8ILL_KULONG_MASK); +# if defined __arm64__ || defined __aarch64__ + if (rc) { + printf("sched_getattr(0, %p, 0xffffffff<<32|%u, 0) = %s\n", + attr, (unsigned) sizeof(*attr), errstr); + } else +# endif + { + printf("sched_getattr(0, {size=%u, sched_policy=", attr->size); + printxval(schedulers, attr->sched_policy, NULL); + printf(", sched_flags=%s, sched_nice=%d, sched_priority=%u" + ", sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 + ", sched_period=%" PRIu64 "}, %u, 0) = 0\n", + attr->sched_flags ? "SCHED_FLAG_RESET_ON_FORK" : "0", + attr->sched_nice, + attr->sched_priority, + attr->sched_runtime, + attr->sched_deadline, + attr->sched_period, + (unsigned) sizeof(*attr)); + } + + sys_sched_setattr(bogus_pid, 0, 0); + printf("sched_setattr(%d, NULL, 0) = %s\n", (int) bogus_pid, errstr); + + attr->sched_flags |= 1; + + if (sys_sched_setattr(0, (unsigned long) attr, 0)) perror_msg_and_skip("sched_setattr"); + printf("sched_setattr(0, {size=%u, sched_policy=", attr->size); + printxval(schedulers, attr->sched_policy, NULL); + printf(", sched_flags=%s, sched_nice=%d, sched_priority=%u" + ", sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 + ", sched_period=%" PRIu64 "}, 0) = 0\n", + "SCHED_FLAG_RESET_ON_FORK", + attr->sched_nice, + attr->sched_priority, + attr->sched_runtime, + attr->sched_deadline, + attr->sched_period); - printf("sched_setattr\\(0, \\{size=%u, sched_policy=SCHED_[A-Z]+" - ", sched_flags=%s, sched_nice=%d, sched_priority=%u" + sys_sched_setattr(F8ILL_KULONG_MASK, (unsigned long) attr, + F8ILL_KULONG_MASK); + printf("sched_setattr(0, {size=%u, sched_policy=", attr->size); + printxval(schedulers, attr->sched_policy, NULL); + printf(", sched_flags=%s, sched_nice=%d, sched_priority=%u" ", sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 - ", sched_period=%" PRIu64 "\\}, 0\\) += 0\n", - sched_attr->size, + ", sched_period=%" PRIu64 "}, 0) = 0\n", "SCHED_FLAG_RESET_ON_FORK", - sched_attr->sched_nice, - sched_attr->sched_priority, - sched_attr->sched_runtime, - sched_attr->sched_deadline, - sched_attr->sched_period); - - sched_attr->size = 0x90807060; - sched_attr->sched_policy = 0xca7faced; - sched_attr->sched_flags = 0xbadc0ded1057da7aULL; - sched_attr->sched_nice = 0xafbfcfdf; - sched_attr->sched_priority = 0xb8c8d8e8; - sched_attr->sched_runtime = 0xbadcaffedeadf157ULL; - sched_attr->sched_deadline = 0xc0de70a57badac75ULL; - sched_attr->sched_period = 0xded1ca7edda7aca7ULL; - - rc = syscall(__NR_sched_setattr, 0xfacec0de, sched_attr, 0xbeeff00d); - - printf("sched_setattr\\(%d, \\{size=%u, " - "sched_policy=%#x /\\* SCHED_\\?\\?\\? \\*/, " - "sched_flags=%#" PRIx64 " /\\* SCHED_FLAG_\\?\\?\\? \\*/, " - "sched_nice=%d, sched_priority=%u, sched_runtime=%" PRIu64 ", " - "sched_deadline=%" PRIu64 ", sched_period=%" PRIu64 "\\}, " - "%u\\) += %s\n", - 0xfacec0de, sched_attr->size, - sched_attr->sched_policy, - sched_attr->sched_flags, - sched_attr->sched_nice, - sched_attr->sched_priority, - sched_attr->sched_runtime, - sched_attr->sched_deadline, - sched_attr->sched_period, 0xbeeff00d, sprintrc_grep(rc)); + attr->sched_nice, + attr->sched_priority, + attr->sched_runtime, + attr->sched_deadline, + attr->sched_period); + + *psize = attr->size; + + sys_sched_setattr(0, (unsigned long) psize, 0); + printf("sched_setattr(0, %p, 0) = %s\n", psize, errstr); + + attr->size = 0; + + sys_sched_setattr(0, (unsigned long) attr, 0); + printf("sched_setattr(0, {size=%u, sched_policy=", attr->size); + printxval(schedulers, attr->sched_policy, NULL); + printf(", sched_flags=%s, sched_nice=%d, sched_priority=%u" + ", sched_runtime=%" PRIu64 ", sched_deadline=%" PRIu64 + ", sched_period=%" PRIu64 "}, 0) = 0\n", + "SCHED_FLAG_RESET_ON_FORK", + attr->sched_nice, + attr->sched_priority, + attr->sched_runtime, + attr->sched_deadline, + attr->sched_period); + + attr->size = 1; + + sys_sched_setattr(0, (unsigned long) attr, 0); + printf("sched_setattr(0, {size=%u} => {size=%u}, 0) = %s\n", + 1, attr->size, errstr); + + attr->size = SCHED_ATTR_MIN_SIZE - 1; + + sys_sched_setattr(0, (unsigned long) attr, 0); + printf("sched_setattr(0, {size=%u} => {size=%u}, 0) = %s\n", + SCHED_ATTR_MIN_SIZE - 1, attr->size, errstr); + + attr->size = 0x90807060; + attr->sched_policy = 0xca7faced; + attr->sched_flags = 0xbadc0ded1057da78ULL; + attr->sched_nice = 0xafbfcfdf; + attr->sched_priority = 0xb8c8d8e8; + attr->sched_runtime = 0xbadcaffedeadf157ULL; + attr->sched_deadline = 0xc0de70a57badac75ULL; + attr->sched_period = 0xded1ca7edda7aca7ULL; + + sys_sched_setattr(bogus_pid, (unsigned long) attr, bogus_flags); + printf("sched_setattr(%d, {size=%u, sched_policy=%#x /* SCHED_??? */, " + "sched_flags=%#" PRIx64 " /* SCHED_FLAG_??? */, " + "sched_nice=%d, sched_priority=%u, sched_runtime=%" PRIu64 ", " + "sched_deadline=%" PRIu64 ", sched_period=%" PRIu64 ", ...}, %u)" + " = %s\n", + (int) bogus_pid, + attr->size, + attr->sched_policy, + attr->sched_flags, + attr->sched_nice, + attr->sched_priority, + attr->sched_runtime, + attr->sched_deadline, + attr->sched_period, + (unsigned) bogus_flags, errstr); + + if (F8ILL_KULONG_SUPPORTED) { + const kernel_ulong_t ill = f8ill_ptr_to_kulong(attr); + + sys_sched_getattr(0, ill, sizeof(*attr), 0); + printf("sched_getattr(0, %#llx, %u, 0) = %s\n", + (unsigned long long) ill, (unsigned) sizeof(*attr), + errstr); + + sys_sched_setattr(0, ill, 0); + printf("sched_setattr(0, %#llx, 0) = %s\n", + (unsigned long long) ill, errstr); + } + + + attr->size = 0x90807060; + attr->sched_policy = 0xca7faced; + attr->sched_flags = 0xfULL; + attr->sched_nice = 0xafbfcfdf; + attr->sched_priority = 0xb8c8d8e8; + attr->sched_runtime = 0xbadcaffedeadf157ULL; + attr->sched_deadline = 0xc0de70a57badac75ULL; + attr->sched_period = 0xded1ca7edda7aca7ULL; + + sys_sched_setattr(bogus_pid, (unsigned long) attr, bogus_flags); + printf("sched_setattr(%d, {size=%u, sched_policy=%#x /* SCHED_??? */, " + "sched_flags=SCHED_FLAG_RESET_ON_FORK|SCHED_FLAG_RECLAIM|" + "SCHED_FLAG_DL_OVERRUN|0x8, " + "sched_nice=%d, sched_priority=%u, sched_runtime=%" PRIu64 ", " + "sched_deadline=%" PRIu64 ", sched_period=%" PRIu64 ", ...}, %u)" + " = %s\n", + (int) bogus_pid, + attr->size, + attr->sched_policy, + attr->sched_nice, + attr->sched_priority, + attr->sched_runtime, + attr->sched_deadline, + attr->sched_period, + (unsigned) bogus_flags, errstr); + + if (F8ILL_KULONG_SUPPORTED) { + const kernel_ulong_t ill = f8ill_ptr_to_kulong(attr); + + sys_sched_getattr(0, ill, sizeof(*attr), 0); + printf("sched_getattr(0, %#llx, %u, 0) = %s\n", + (unsigned long long) ill, (unsigned) sizeof(*attr), + errstr); + + sys_sched_setattr(0, ill, 0); + printf("sched_setattr(0, %#llx, 0) = %s\n", + (unsigned long long) ill, errstr); + } + puts("+++ exited with 0 +++"); return 0; } diff --git a/tests/sched_xetattr.gen.test b/tests/sched_xetattr.gen.test new file mode 100755 index 00000000..e4f31c52 --- /dev/null +++ b/tests/sched_xetattr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched_xetattr -a29 -e trace=sched_getattr,sched_setattr); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a29 -e trace=sched_getattr,sched_setattr diff --git a/tests/sched_xetattr.test b/tests/sched_xetattr.test deleted file mode 100755 index c2c7914c..00000000 --- a/tests/sched_xetattr.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check sched_getattr and sched_setattr syscalls decoding. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -e sched_getattr,sched_setattr $args > "$OUT" -match_grep "$LOG" "$OUT" -rm -f "$OUT" - -exit 0 diff --git a/tests/sched_xetparam.c b/tests/sched_xetparam.c index e761a9d0..e1325a6f 100644 --- a/tests/sched_xetparam.c +++ b/tests/sched_xetparam.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/sched_xetparam.gen.test b/tests/sched_xetparam.gen.test new file mode 100755 index 00000000..220ffb26 --- /dev/null +++ b/tests/sched_xetparam.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched_xetparam -a23 -e trace=sched_getparam,sched_setparam); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 -e trace=sched_getparam,sched_setparam diff --git a/tests/sched_xetparam.test b/tests/sched_xetparam.test deleted file mode 100755 index c9fede13..00000000 --- a/tests/sched_xetparam.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sched_getparam and sched_setparam syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a23 -e trace=sched_getparam,sched_setparam diff --git a/tests/sched_xetscheduler.c b/tests/sched_xetscheduler.c index 7faee8cd..bc48085a 100644 --- a/tests/sched_xetscheduler.c +++ b/tests/sched_xetscheduler.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -10,7 +17,7 @@ int main(void) { - struct sched_param *const param = tail_alloc(sizeof(struct sched_param)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sched_param, param); long rc = syscall(__NR_sched_getscheduler, 0); const char *scheduler; switch (rc) { diff --git a/tests/sched_xetscheduler.gen.test b/tests/sched_xetscheduler.gen.test new file mode 100755 index 00000000..0a800725 --- /dev/null +++ b/tests/sched_xetscheduler.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched_xetscheduler -a22 -e trace=sched_getscheduler,sched_setscheduler); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -e trace=sched_getscheduler,sched_setscheduler diff --git a/tests/sched_xetscheduler.test b/tests/sched_xetscheduler.test deleted file mode 100755 index 07c93f31..00000000 --- a/tests/sched_xetscheduler.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sched_getscheduler and sched_setscheduler syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a22 -e trace=sched_getscheduler,sched_setscheduler diff --git a/tests/sched_yield.c b/tests/sched_yield.c index 355e7e8d..40b55617 100644 --- a/tests/sched_yield.c +++ b/tests/sched_yield.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/sched_yield.gen.test b/tests/sched_yield.gen.test new file mode 100755 index 00000000..4b035fd8 --- /dev/null +++ b/tests/sched_yield.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sched_yield -a14 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests/sched_yield.test b/tests/sched_yield.test deleted file mode 100755 index f0c2c303..00000000 --- a/tests/sched_yield.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sched_yield syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a14 diff --git a/tests/scm_rights-fd.test b/tests/scm_rights-fd.test index 8447375f..b053aa82 100755 --- a/tests/scm_rights-fd.test +++ b/tests/scm_rights-fd.test @@ -3,29 +3,10 @@ # Check how SCM_RIGHTS and SCM_CREDENTIALS control messages are decoded in -y mode. # # Copyright (c) 2014-2015 Dmitry V. Levin +# Copyright (c) 2014-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -34,22 +15,19 @@ framework_skip_ '/proc/self/fd/ is not available' check_prog mkdir -check_prog rm check_prog seq check_prog touch -dir="$LOG.dir" -rm -rf -- "$dir" -mkdir -- "$dir" || +mkdir dir || framework_skip_ 'failed to create a directory' -file="$dir/$(for i in $(seq 1 127); do echo A; done; echo Z)" +file="dir/$(for i in $(seq 1 127); do echo A; done; echo Z)" touch -- "$file" || framework_skip_ 'failed to create a file' -run_prog ./scm_rights /dev/zero -run_strace -y -x -enetwork $args "$file" +run_prog ../scm_rights /dev/zero +run_strace -y -x -e%network $args "$file" hex='[[:xdigit:]]' n='[1-9][0-9]*' @@ -66,15 +44,9 @@ msg_tail=', msg_controllen='"$n"', msg_flags=0' rights='\{cmsg_len='"$n"', cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, cmsg_data='"$rights_data"'\}' creds='\{cmsg_len='"$n"', cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS, cmsg_data='"$ids"'\}' -EXPECTED="$LOG.expected" - -cat > "$EXPECTED" << __EOF__ +cat > "$EXP" << __EOF__ sendmsg\\(3$socket, $msg_head\\[$rights\\]$msg_tail\\}, 0\\) = 15 recvmsg\\(0$socket, $msg_head\\[$creds, $rights\\]$msg_tail\\}, 0\\) = 15 __EOF__ -match_grep "$LOG" "$EXPECTED" -rm -f "$EXPECTED" -rm -rf -- "$dir" - -exit 0 +match_grep "$LOG" "$EXP" diff --git a/tests/scm_rights.c b/tests/scm_rights.c index 42caed7c..f1171064 100644 --- a/tests/scm_rights.c +++ b/tests/scm_rights.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -44,11 +25,11 @@ int main(int ac, const char **av) void *data = tail_alloc(data_size); memcpy(data, sample, data_size); - struct iovec *iov = tail_alloc(sizeof(struct iovec)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct iovec, iov); iov->iov_base = data; iov->iov_len = data_size; - struct msghdr *mh = tail_alloc(sizeof(struct msghdr)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct msghdr, mh); memset(mh, 0, sizeof(*mh)); mh->msg_iov = iov; mh->msg_iovlen = 1; diff --git a/tests/scno_tampering.sh b/tests/scno_tampering.sh index 6aa78432..8c921dfe 100755 --- a/tests/scno_tampering.sh +++ b/tests/scno_tampering.sh @@ -3,29 +3,10 @@ # Skip the test if arch+kernel combination is not supported. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -49,10 +30,17 @@ case "$STRACE_ARCH" in require_min_kernel_version_or_skip 4.5 ;; mips) # Only the native ABI is supported by the kernel properly, see - # https://sourceforge.net/p/strace/mailman/message/35587571/ + # https://lists.strace.io/pipermail/strace-devel/2017-January/005896.html + msg_prefix="mips $MIPS_ABI scno tampering does not work" uname_m="$(uname -m)" case "$MIPS_ABI:$uname_m" in - o32:mips|n64:mips64) ;; - *) skip_ "$MIPS_ABI scno tampering does not work on $uname_m yet" ;; + n64:mips64) ;; + o32:mips) + # is it really mips32? + if ../is_linux_mips_n64; then + skip_ "$msg_prefix on mips n64 yet" + fi + ;; + *) skip_ "$msg_prefix on $uname_m yet" ;; esac ;; esac diff --git a/tests/seccomp-filter-v.c b/tests/seccomp-filter-v.c index dbf686d1..98eaeee5 100644 --- a/tests/seccomp-filter-v.c +++ b/tests/seccomp-filter-v.c @@ -2,29 +2,10 @@ * Check verbose decoding of seccomp SECCOMP_SET_MODE_FILTER. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -41,9 +22,7 @@ #ifdef HAVE_LINUX_SECCOMP_H # include #endif -#ifdef HAVE_LINUX_FILTER_H -# include -#endif +#include #if defined __NR_seccomp \ && defined PR_SET_NO_NEW_PRIVS \ @@ -52,23 +31,23 @@ && defined BPF_JUMP \ && defined BPF_STMT -#define SOCK_FILTER_ALLOW_SYSCALL(nr) \ +# define SOCK_FILTER_ALLOW_SYSCALL(nr) \ BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW) -#define SOCK_FILTER_DENY_SYSCALL(nr, err) \ +# define SOCK_FILTER_DENY_SYSCALL(nr, err) \ BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, __NR_ ## nr, 0, 1), \ BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|(SECCOMP_RET_DATA & (err))) -#define SOCK_FILTER_KILL_PROCESS \ +# define SOCK_FILTER_KILL_PROCESS \ BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL) -#define PRINT_ALLOW_SYSCALL(nr) \ +# define PRINT_ALLOW_SYSCALL(nr) \ tprintf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW), ", \ __NR_ ## nr) -#define PRINT_DENY_SYSCALL(nr, err) \ +# define PRINT_DENY_SYSCALL(nr, err) \ tprintf("BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, %#x, 0, 0x1), " \ "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|%#x), ", \ __NR_ ## nr, err) @@ -90,22 +69,18 @@ static const struct sock_filter filter_c[] = { SOCK_FILTER_KILL_PROCESS }; -#ifndef BPF_MAXINSNS -# define BPF_MAXINSNS 4096 -#endif - int main(void) { tprintf("%s", ""); static const char kill_stmt_txt[] = - "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL)"; + "BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_KILL_THREAD)"; struct sock_filter *const filter = tail_memdup(filter_c, sizeof(filter_c)); struct sock_filter *const big_filter = tail_alloc(sizeof(*big_filter) * (BPF_MAXINSNS + 1)); - struct sock_fprog *const prog = tail_alloc(sizeof(*prog)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sock_fprog, prog); int fds[2]; if (pipe(fds)) @@ -123,7 +98,7 @@ main(void) prog->len = 3; syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, 0, prog); tprintf("seccomp(SECCOMP_SET_MODE_FILTER, 0, {len=%u" - ", filter=[%s, %p]}) = -1 EFAULT (%m)\n", + ", filter=[%s, ... /* %p */]}) = -1 EFAULT (%m)\n", prog->len, kill_stmt_txt, filter + ARRAY_SIZE(filter_c)); prog->len = 0; @@ -141,11 +116,14 @@ main(void) prog->filter = big_filter; prog->len = BPF_MAXINSNS + 1; tprintf("seccomp(SECCOMP_SET_MODE_FILTER, %s, {len=%u, filter=[", - "SECCOMP_FILTER_FLAG_TSYNC|0xfffffffe", prog->len); + "SECCOMP_FILTER_FLAG_TSYNC|SECCOMP_FILTER_FLAG_LOG|" + "SECCOMP_FILTER_FLAG_SPEC_ALLOW|" + "SECCOMP_FILTER_FLAG_NEW_LISTENER|0xfffffff0", + prog->len); for (i = 0; i < BPF_MAXINSNS; ++i) { if (i) tprintf(", "); - switch(BPF_CLASS(i)) { + switch (BPF_CLASS(i)) { case BPF_LD: tprintf("BPF_STMT(BPF_LD|BPF_W|BPF_IMM, %#x)", i << 16); break; diff --git a/tests/seccomp-filter-v.gen.test b/tests/seccomp-filter-v.gen.test new file mode 100755 index 00000000..efce6372 --- /dev/null +++ b/tests/seccomp-filter-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (seccomp-filter-v -v -e trace=seccomp); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=seccomp diff --git a/tests/seccomp-filter-v.test b/tests/seccomp-filter-v.test deleted file mode 100755 index f873eb6f..00000000 --- a/tests/seccomp-filter-v.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check verbose decoding of seccomp SECCOMP_SET_MODE_FILTER. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -e trace=seccomp diff --git a/tests/seccomp-filter.c b/tests/seccomp-filter.c index d4d76dd3..5e28ffca 100644 --- a/tests/seccomp-filter.c +++ b/tests/seccomp-filter.c @@ -2,29 +2,10 @@ * Check decoding of seccomp SECCOMP_SET_MODE_FILTER. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,9 +17,7 @@ #ifdef HAVE_LINUX_SECCOMP_H # include #endif -#ifdef HAVE_LINUX_FILTER_H -# include -#endif +#include #if defined __NR_seccomp && defined SECCOMP_SET_MODE_FILTER @@ -49,19 +28,22 @@ main(void) { struct sock_filter *const filter = tail_alloc(sizeof(*filter) * N); const void *const efault = tail_alloc(1); - struct sock_fprog *const prog = tail_alloc(sizeof(*prog)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sock_fprog, prog); long rc; prog->filter = filter; prog->len = N; rc = syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, -1, prog); printf("seccomp(SECCOMP_SET_MODE_FILTER, %s, {len=%u, filter=%p})" - " = %ld %s (%m)\n", "SECCOMP_FILTER_FLAG_TSYNC|0xfffffffe", + " = %ld %s (%m)\n", + "SECCOMP_FILTER_FLAG_TSYNC|SECCOMP_FILTER_FLAG_LOG|" + "SECCOMP_FILTER_FLAG_SPEC_ALLOW|" + "SECCOMP_FILTER_FLAG_NEW_LISTENER|0xfffffff0", prog->len, prog->filter, rc, errno2name()); - rc = syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, -2L, efault); + rc = syscall(__NR_seccomp, SECCOMP_SET_MODE_FILTER, -16L, efault); printf("seccomp(SECCOMP_SET_MODE_FILTER, %s, %p) = %ld %s (%m)\n", - "0xfffffffe /* SECCOMP_FILTER_FLAG_??? */", + "0xfffffff0 /* SECCOMP_FILTER_FLAG_??? */", efault, rc, errno2name()); puts("+++ exited with 0 +++"); diff --git a/tests/seccomp-filter.gen.test b/tests/seccomp-filter.gen.test new file mode 100755 index 00000000..52af0d54 --- /dev/null +++ b/tests/seccomp-filter.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (seccomp-filter -e trace=seccomp); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=seccomp diff --git a/tests/seccomp-filter.test b/tests/seccomp-filter.test deleted file mode 100755 index 65c6d495..00000000 --- a/tests/seccomp-filter.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of seccomp SECCOMP_SET_MODE_FILTER. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=seccomp diff --git a/tests/seccomp-strict.c b/tests/seccomp-strict.c index 237b0eca..1d088109 100644 --- a/tests/seccomp-strict.c +++ b/tests/seccomp-strict.c @@ -1,30 +1,10 @@ /* * Check how seccomp SECCOMP_SET_MODE_STRICT is decoded. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/seccomp-strict.test b/tests/seccomp-strict.test index b354c6a2..3525e20c 100755 --- a/tests/seccomp-strict.test +++ b/tests/seccomp-strict.test @@ -1,10 +1,15 @@ #!/bin/sh - +# # Check how seccomp SECCOMP_SET_MODE_STRICT is decoded. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -set -- "./$NAME" +set -- "../$NAME" "$@" > /dev/null || { case $? in 77) skip_ "$* exited with code 77" ;; @@ -14,4 +19,3 @@ set -- "./$NAME" } run_strace -eseccomp "$@" > "$EXP" match_diff "$LOG" "$EXP" -rm -f "$EXP" diff --git a/tests/seccomp_get_action_avail.c b/tests/seccomp_get_action_avail.c new file mode 100644 index 00000000..e61678f4 --- /dev/null +++ b/tests/seccomp_get_action_avail.c @@ -0,0 +1,108 @@ +/* + * Check decoding of seccomp SECCOMP_GET_ACTION_AVAIL. + * + * Copyright (c) 2017-2019 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_seccomp + +# include +# include +# include + +# ifdef HAVE_LINUX_SECCOMP_H +# include +# endif + +# ifndef SECCOMP_GET_ACTION_AVAIL +# define SECCOMP_GET_ACTION_AVAIL 2 +# endif + +static const char *errstr; + +static long +k_seccomp(const kernel_ulong_t op, const kernel_ulong_t flags, + const kernel_ulong_t args) +{ + const long rc = syscall(__NR_seccomp, op, flags, args); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(uint32_t, act); + kernel_ulong_t op = (kernel_ulong_t) 0xfacefeed00000000ULL + | SECCOMP_GET_ACTION_AVAIL; + kernel_ulong_t flags = (kernel_ulong_t) 0xdeadbeef00000000ULL; + unsigned int i; + + struct { + uint32_t val; + const char *str; + } actions [] = { + { 0, "SECCOMP_RET_KILL_THREAD" }, +# ifdef SECCOMP_RET_KILL_PROCESS + { ARG_STR(SECCOMP_RET_KILL_PROCESS) }, +# endif +# ifdef SECCOMP_RET_TRAP + { ARG_STR(SECCOMP_RET_TRAP) }, +# endif +# ifdef SECCOMP_RET_ERRNO + { ARG_STR(SECCOMP_RET_ERRNO) }, +# endif +# ifdef SECCOMP_RET_USER_NOTIF + { ARG_STR(SECCOMP_RET_USER_NOTIF) }, +# endif +# ifdef SECCOMP_RET_TRACE + { ARG_STR(SECCOMP_RET_TRACE) }, +# endif +# ifdef SECCOMP_RET_LOG + { ARG_STR(SECCOMP_RET_LOG) }, +# endif +# ifdef SECCOMP_RET_ALLOW + { ARG_STR(SECCOMP_RET_ALLOW) }, +# endif + { 0xffffffff, "0xffffffff /* SECCOMP_RET_??? */" } + }; + + for (i = 0; i < ARRAY_SIZE(actions); ++i) { + *act = actions[i].val; + k_seccomp(op, flags, (uintptr_t) act); + printf("seccomp(SECCOMP_GET_ACTION_AVAIL, 0, [%s]) = %s\n", + actions[i].str, errstr); + } + + *act = actions[0].val; + + k_seccomp(op, flags, (uintptr_t) (act + 1)); + printf("seccomp(SECCOMP_GET_ACTION_AVAIL, 0, %p) = %s\n", + act + 1, errstr); + + if (F8ILL_KULONG_SUPPORTED) { + k_seccomp(op, flags, f8ill_ptr_to_kulong(act)); + printf("seccomp(SECCOMP_GET_ACTION_AVAIL, 0, %#jx) = %s\n", + (uintmax_t) f8ill_ptr_to_kulong(act), errstr); + } + + flags |= 0xcafef00d; + k_seccomp(op, flags, 0); + printf("seccomp(SECCOMP_GET_ACTION_AVAIL, %u, NULL) = %s\n", + (unsigned int) flags, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_seccomp") + +#endif diff --git a/tests/seccomp_get_action_avail.gen.test b/tests/seccomp_get_action_avail.gen.test new file mode 100755 index 00000000..49974510 --- /dev/null +++ b/tests/seccomp_get_action_avail.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (seccomp_get_action_avail -e trace=seccomp); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=seccomp diff --git a/tests/select-P.c b/tests/select-P.c new file mode 100644 index 00000000..868deed6 --- /dev/null +++ b/tests/select-P.c @@ -0,0 +1,2 @@ +#define PATH_TRACING_FD 9 +#include "select.c" diff --git a/tests/select-P.gen.test b/tests/select-P.gen.test new file mode 100755 index 00000000..2f6fc7bc --- /dev/null +++ b/tests/select-P.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (select-P -a36 -e trace=select -P /dev/full 9>>/dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 -e trace=select -P /dev/full 9>>/dev/full diff --git a/tests/select.c b/tests/select.c index b5ff259d..7935032b 100644 --- a/tests/select.c +++ b/tests/select.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/select.gen.test b/tests/select.gen.test new file mode 100755 index 00000000..23836149 --- /dev/null +++ b/tests/select.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (select -a36 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests/select.test b/tests/select.test deleted file mode 100755 index 60b88caf..00000000 --- a/tests/select.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check select syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a36 diff --git a/tests/semop.c b/tests/semop.c index a2ff2635..f7f04701 100644 --- a/tests/semop.c +++ b/tests/semop.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include @@ -9,8 +16,7 @@ #include "xlat.h" #include "xlat/semop_flags.h" -union semun -{ +union semun { int val; struct semid_ds *buf; unsigned short *array; @@ -33,9 +39,7 @@ main(void) static void * const bogus_sops = (void *) -1L; static const size_t bogus_nsops = (size_t) 0xdefaceddeadbeefULL; - static const struct timespec ts_data = { 1, 123456789 }; - - struct timespec *ts = tail_memdup(&ts_data, sizeof(*ts)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timespec, ts); int rc; id = semget(IPC_PRIVATE, 1, 0600); @@ -47,8 +51,8 @@ main(void) if (semctl(id, 0, SETVAL, sem_union) == -1) perror_msg_and_skip("semctl"); - struct sembuf *const sem_b = tail_alloc(sizeof(*sem_b)); - struct sembuf *const sem_b2 = tail_alloc(sizeof(*sem_b2)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sembuf, sem_b); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sembuf, sem_b2); rc = semop(bogus_semid, NULL, bogus_nsops); printf("semop(%d, NULL, %u) = %s\n", @@ -67,11 +71,11 @@ main(void) sem_b2->sem_flg = 0xbeef; rc = semop(bogus_semid, sem_b2, 2); - printf("semop(%d, [{%hu, %hd, %s%s%#hx}, %p], %u) = %s\n", + printf("semop(%d, [{%hu, %hd, %s%s%#hx}, ... /* %p */], %u) = %s\n", bogus_semid, sem_b2->sem_num, sem_b2->sem_op, sem_b2->sem_flg & SEM_UNDO ? "SEM_UNDO|" : "", sem_b2->sem_flg & IPC_NOWAIT ? "IPC_NOWAIT|" : "", - sem_b2->sem_flg & ~(SEM_UNDO | IPC_NOWAIT), + (short) (sem_b2->sem_flg & ~(SEM_UNDO | IPC_NOWAIT)), sem_b2 + 1, 2, sprintrc(rc)); if (semop(id, sem_b, 1)) @@ -91,15 +95,17 @@ main(void) printf("semtimedop(%d, %p, 1, %p) = %s\n", id, sem_b + 1, ts + 1, sprintrc(rc)); + ts->tv_sec = 1; + ts->tv_nsec = 123456789; rc = semtimedop(bogus_semid, sem_b2, 2, ts); - printf("semtimedop(%d, [{%hu, %hd, %s%s%#hx}, %p], %u, " - "{tv_sec=%jd, tv_nsec=%jd}) = %s\n", + printf("semtimedop(%d, [{%hu, %hd, %s%s%#hx}, ... /* %p */], %u" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", bogus_semid, sem_b2->sem_num, sem_b2->sem_op, sem_b2->sem_flg & SEM_UNDO ? "SEM_UNDO|" : "", sem_b2->sem_flg & IPC_NOWAIT ? "IPC_NOWAIT|" : "", - sem_b2->sem_flg & ~(SEM_UNDO | IPC_NOWAIT), + (short) (sem_b2->sem_flg & ~(SEM_UNDO | IPC_NOWAIT)), sem_b2 + 1, 2, - (intmax_t) ts->tv_sec, (intmax_t) ts->tv_nsec, + (long long) ts->tv_sec, zero_extend_signed_to_ull(ts->tv_nsec), sprintrc(rc)); sem_b->sem_op = 1; @@ -110,9 +116,27 @@ main(void) sem_b->sem_op = -1; if (semtimedop(id, sem_b, 1, ts)) perror_msg_and_skip("semtimedop, -1"); - printf("semtimedop(%d, [{0, -1, SEM_UNDO}], 1, " - "{tv_sec=%jd, tv_nsec=%jd}) = 0\n", id, - (intmax_t) ts->tv_sec, (intmax_t) ts->tv_nsec); + printf("semtimedop(%d, [{0, -1, SEM_UNDO}], 1" + ", {tv_sec=%lld, tv_nsec=%llu}) = 0\n", id, + (long long) ts->tv_sec, zero_extend_signed_to_ull(ts->tv_nsec)); + + sem_b->sem_op = 1; + ts->tv_sec = 0xdeadbeefU; + ts->tv_nsec = 0xfacefeedU; + rc = semtimedop(id, sem_b, 1, ts); + printf("semtimedop(%d, [{0, 1, SEM_UNDO}], 1" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + id, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), sprintrc(rc)); + + sem_b->sem_op = -1; + ts->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + ts->tv_nsec = (long) 0xbadc0dedfacefeedLL; + rc = semtimedop(id, sem_b, 1, ts); + printf("semtimedop(%d, [{0, -1, SEM_UNDO}], 1" + ", {tv_sec=%lld, tv_nsec=%llu}) = %s\n", + id, (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), sprintrc(rc)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests/semop.gen.test b/tests/semop.gen.test new file mode 100755 index 00000000..21b67ead --- /dev/null +++ b/tests/semop.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (semop -a32 -e trace=semop,semtimedop); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -e trace=semop,semtimedop diff --git a/tests/semop.test b/tests/semop.test deleted file mode 100755 index 3e77d2f9..00000000 --- a/tests/semop.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check semop syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a32 -e trace=semop,semtimedop diff --git a/tests/sendfile.c b/tests/sendfile.c index 23f096b6..6ef3232e 100644 --- a/tests/sendfile.c +++ b/tests/sendfile.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -35,15 +16,13 @@ # include # include # include +# include # include # include -# include int -main(int ac, const char **av) +main(void) { - assert(ac == 1); - (void) close(0); if (open("/dev/zero", O_RDONLY) != 0) perror_msg_and_skip("open: %s", "/dev/zero"); @@ -52,58 +31,62 @@ main(int ac, const char **av) if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) perror_msg_and_skip("socketpair"); - int reg_in = open(av[0], O_RDONLY); - if (reg_in < 0) - perror_msg_and_fail("open: %s", av[0]); - - struct stat stb; - assert(fstat(reg_in, &stb) == 0); - const size_t blen = stb.st_size / 3; - const size_t alen = stb.st_size - blen; - assert(S_ISREG(stb.st_mode) && blen > 0); - - const size_t page_len = get_page_size(); - assert(syscall(__NR_sendfile, 0, 1, NULL, page_len) == -1); + const unsigned int page_size = get_page_size(); + assert(syscall(__NR_sendfile, 0, 1, NULL, page_size) == -1); if (EBADF != errno) perror_msg_and_skip("sendfile"); - printf("sendfile(0, 1, NULL, %lu) = -1 EBADF (%m)\n", - (unsigned long) page_len); + printf("sendfile(0, 1, NULL, %u) = -1 EBADF (%m)\n", page_size); + + unsigned int file_size = 0; + socklen_t optlen = sizeof(file_size); + if (getsockopt(sv[1], SOL_SOCKET, SO_SNDBUF, &file_size, &optlen)) + perror_msg_and_fail("getsockopt"); + if (file_size < 1024) + error_msg_and_skip("SO_SNDBUF too small: %u", file_size); + + file_size /= 4; + if (file_size / 16 > page_size) + file_size = page_size * 16; + const unsigned int blen = file_size / 3; + const unsigned int alen = file_size - blen; + + static const char fname[] = "sendfile-tmpfile"; + int reg_in = open(fname, O_RDWR | O_CREAT | O_TRUNC, 0600); + if (reg_in < 0) + perror_msg_and_fail("open: %s", fname); + if (unlink(fname)) + perror_msg_and_fail("unlink: %s", fname); + if (ftruncate(reg_in, file_size)) + perror_msg_and_fail("ftruncate: %s", fname); - uint32_t *p_off = tail_alloc(sizeof(uint32_t)); + TAIL_ALLOC_OBJECT_VAR_PTR(uint32_t, p_off); void *p = p_off + 1; *p_off = 0; - assert(syscall(__NR_sendfile, 0, 1, p, page_len) == -1); - printf("sendfile(0, 1, %#lx, %lu) = -1 EFAULT (%m)\n", - (unsigned long) p, (unsigned long) page_len); + assert(syscall(__NR_sendfile, 0, 1, p, page_size) == -1); + printf("sendfile(0, 1, %p, %u) = -1 EFAULT (%m)\n", p, page_size); assert(syscall(__NR_sendfile, sv[1], reg_in, NULL, alen) == (long) alen); - printf("sendfile(%d, %d, NULL, %lu) = %lu\n", - sv[1], reg_in, (unsigned long) alen, - (unsigned long) alen); + printf("sendfile(%d, %d, NULL, %u) = %u\n", + sv[1], reg_in, alen, alen); p = p_off; if (syscall(__NR_sendfile, sv[1], reg_in, p_off, alen) != (long) alen) { - printf("sendfile(%d, %d, %#lx, %lu) = -1 EFAULT (%m)\n", - sv[1], reg_in, (unsigned long) p_off, - (unsigned long) alen); + printf("sendfile(%d, %d, %#lx, %u) = -1 EFAULT (%m)\n", + sv[1], reg_in, (unsigned long) p_off, alen); --p_off; *p_off = 0; assert(syscall(__NR_sendfile, sv[1], reg_in, p_off, alen) == (long) alen); } - printf("sendfile(%d, %d, [0] => [%lu], %lu) = %lu\n", - sv[1], reg_in, (unsigned long) alen, - (unsigned long) alen, (unsigned long) alen); + printf("sendfile(%d, %d, [0] => [%u], %u) = %u\n", + sv[1], reg_in, alen, alen, alen); - assert(syscall(__NR_sendfile, sv[1], reg_in, p_off, stb.st_size + 1) + assert(syscall(__NR_sendfile, sv[1], reg_in, p_off, file_size + 1) == (long) blen); - printf("sendfile(%d, %d, [%lu] => [%lu], %lu) = %lu\n", - sv[1], reg_in, (unsigned long) alen, - (unsigned long) stb.st_size, - (unsigned long) stb.st_size + 1, - (unsigned long) blen); + printf("sendfile(%d, %d, [%u] => [%u], %u) = %u\n", + sv[1], reg_in, alen, file_size, file_size + 1, blen); if (p_off != p) { uint64_t *p_off64 = (uint64_t *) p_off; diff --git a/tests/sendfile.gen.test b/tests/sendfile.gen.test new file mode 100755 index 00000000..d32ef3ad --- /dev/null +++ b/tests/sendfile.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sendfile -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests/sendfile.test b/tests/sendfile.test deleted file mode 100755 index 48dba585..00000000 --- a/tests/sendfile.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sendfile syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests/sendfile64.c b/tests/sendfile64.c index 7208c300..c318ace8 100644 --- a/tests/sendfile64.c +++ b/tests/sendfile64.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -35,15 +16,13 @@ # include # include # include +# include # include # include -# include int -main(int ac, const char **av) +main(void) { - assert(ac == 1); - (void) close(0); if (open("/dev/zero", O_RDONLY) != 0) perror_msg_and_skip("open: %s", "/dev/zero"); @@ -52,50 +31,55 @@ main(int ac, const char **av) if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) perror_msg_and_skip("socketpair"); - int reg_in = open(av[0], O_RDONLY); - if (reg_in < 0) - perror_msg_and_fail("open: %s", av[0]); - - struct stat stb; - assert(fstat(reg_in, &stb) == 0); - const size_t blen = stb.st_size / 3; - const size_t alen = stb.st_size - blen; - assert(S_ISREG(stb.st_mode) && blen > 0); - - const size_t page_len = get_page_size(); - assert(syscall(__NR_sendfile64, 0, 1, NULL, page_len) == -1); + const unsigned int page_size = get_page_size(); + assert(syscall(__NR_sendfile64, 0, 1, NULL, page_size) == -1); if (EBADF != errno) perror_msg_and_skip("sendfile64"); - printf("sendfile64(0, 1, NULL, %lu) = -1 EBADF (%m)\n", - (unsigned long) page_len); + printf("sendfile64(0, 1, NULL, %u) = -1 EBADF (%m)\n", page_size); + + unsigned int file_size = 0; + socklen_t optlen = sizeof(file_size); + if (getsockopt(sv[1], SOL_SOCKET, SO_SNDBUF, &file_size, &optlen)) + perror_msg_and_fail("getsockopt"); + if (file_size < 1024) + error_msg_and_skip("SO_SNDBUF too small: %u", file_size); + + file_size /= 4; + if (file_size / 16 > page_size) + file_size = page_size * 16; + const unsigned int blen = file_size / 3; + const unsigned int alen = file_size - blen; + + static const char fname[] = "sendfile64-tmpfile"; + int reg_in = open(fname, O_RDWR | O_CREAT | O_TRUNC, 0600); + if (reg_in < 0) + perror_msg_and_fail("open: %s", fname); + if (unlink(fname)) + perror_msg_and_fail("unlink: %s", fname); + if (ftruncate(reg_in, file_size)) + perror_msg_and_fail("ftruncate: %s", fname); - uint64_t *p_off = tail_alloc(sizeof(uint64_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(uint64_t, p_off); void *p = p_off + 1; *p_off = 0; - assert(syscall(__NR_sendfile64, 0, 1, p, page_len) == -1); - printf("sendfile64(0, 1, %#lx, %lu) = -1 EFAULT (%m)\n", - (unsigned long) p, (unsigned long) page_len); + assert(syscall(__NR_sendfile64, 0, 1, p, page_size) == -1); + printf("sendfile64(0, 1, %p, %u) = -1 EFAULT (%m)\n", p, page_size); assert(syscall(__NR_sendfile64, sv[1], reg_in, NULL, alen) == (long) alen); - printf("sendfile64(%d, %d, NULL, %lu) = %lu\n", - sv[1], reg_in, (unsigned long) alen, - (unsigned long) alen); + printf("sendfile64(%d, %d, NULL, %u) = %u\n", + sv[1], reg_in, alen, alen); assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, alen) == (long) alen); - printf("sendfile64(%d, %d, [0] => [%lu], %lu) = %lu\n", - sv[1], reg_in, (unsigned long) alen, - (unsigned long) alen, (unsigned long) alen); + printf("sendfile64(%d, %d, [0] => [%u], %u) = %u\n", + sv[1], reg_in, alen, alen, alen); - assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, stb.st_size + 1) + assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, file_size + 1) == (long) blen); - printf("sendfile64(%d, %d, [%lu] => [%lu], %lu) = %lu\n", - sv[1], reg_in, (unsigned long) alen, - (unsigned long) stb.st_size, - (unsigned long) stb.st_size + 1, - (unsigned long) blen); + printf("sendfile64(%d, %d, [%u] => [%u], %u) = %u\n", + sv[1], reg_in, alen, file_size, file_size + 1, blen); *p_off = 0xcafef00dfacefeedULL; assert(syscall(__NR_sendfile64, sv[1], reg_in, p_off, 1) == -1); diff --git a/tests/sendfile64.gen.test b/tests/sendfile64.gen.test new file mode 100755 index 00000000..24f0746f --- /dev/null +++ b/tests/sendfile64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sendfile64 -a29 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a29 diff --git a/tests/sendfile64.test b/tests/sendfile64.test deleted file mode 100755 index faa05254..00000000 --- a/tests/sendfile64.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sendfile64 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a29 diff --git a/tests/set_mempolicy.c b/tests/set_mempolicy.c index f3261a09..46703713 100644 --- a/tests/set_mempolicy.c +++ b/tests/set_mempolicy.c @@ -2,29 +2,10 @@ * Check decoding of set_mempolicy syscall. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -76,7 +57,7 @@ print_nodes(const unsigned long maxnode, unsigned int offset) printf("%#0*lx", (int) sizeof(long) * 2 + 2, nodemask[i]); } else { - printf("%p", nodemask + i); + printf("... /* %p */", nodemask + i); break; } } diff --git a/tests/set_mempolicy.gen.test b/tests/set_mempolicy.gen.test new file mode 100755 index 00000000..f8c81c75 --- /dev/null +++ b/tests/set_mempolicy.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (set_mempolicy -s3 -a35); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s3 -a35 diff --git a/tests/set_mempolicy.test b/tests/set_mempolicy.test deleted file mode 100755 index 0ed6666c..00000000 --- a/tests/set_mempolicy.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check set_mempolicy syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s3 -a35 diff --git a/tests/set_ptracer_any.c b/tests/set_ptracer_any.c index bc2f90ca..747359c2 100644 --- a/tests/set_ptracer_any.c +++ b/tests/set_ptracer_any.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2013-2015 Dmitry V. Levin + * Copyright (c) 2013-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,10 +17,16 @@ int main(int argc, char **argv) { if (argc < 2) return 99; -#if defined HAVE_PRCTL && defined PR_SET_PTRACER && defined PR_SET_PTRACER_ANY - /* Turn off restrictions on tracing if applicable. If the options +#ifdef HAVE_PRCTL + /* Turn off restrictions on tracing if applicable. If the command * aren't available on this system, that's OK too. */ - (void) prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY); +# ifndef PR_SET_PTRACER +# define PR_SET_PTRACER 0x59616d61 +# endif +# ifndef PR_SET_PTRACER_ANY +# define PR_SET_PTRACER_ANY -1UL +# endif + (void) prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0); #endif if (write(1, "\n", 1) != 1) { perror("write"); diff --git a/tests/set_sigblock.c b/tests/set_sigblock.c new file mode 100644 index 00000000..6ac1bedd --- /dev/null +++ b/tests/set_sigblock.c @@ -0,0 +1,33 @@ +/* + * Execute a command with the specified signal blocked/unblocked. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +int +main(int ac, char **av) +{ + if (ac < 4) + error_msg_and_fail("usage: set_sigblock 0|1 signum path..."); + + const int block = atoi(av[1]); + const int signum = atoi(av[2]); + sigset_t mask; + + sigemptyset(&mask); + if (sigaddset(&mask, signum)) + perror_msg_and_fail("sigaddset: %s", av[2]); + if (sigprocmask(block ? SIG_BLOCK : SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + execvp(av[3], av + 3); + perror_msg_and_fail("execvp: %s", av[3]); +} diff --git a/tests/set_sigign.c b/tests/set_sigign.c new file mode 100644 index 00000000..faf5a741 --- /dev/null +++ b/tests/set_sigign.c @@ -0,0 +1,29 @@ +/* + * Execute a command with a signal handler set to SIG_IGN/SIG_DFL. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +int +main(int ac, char **av) +{ + if (ac < 4) + error_msg_and_fail("usage: set_sigign 0|1 signum path..."); + + const int ign = atoi(av[1]); + const int signum = atoi(av[2]); + + if (signal(signum, ign ? SIG_IGN : SIG_DFL) == SIG_ERR) + perror_msg_and_fail("signal: %s", av[2]); + + execvp(av[3], av + 3); + perror_msg_and_fail("execvp: %s", av[3]); +} diff --git a/tests/setdomainname.c b/tests/setdomainname.c index f3e24840..177c0fd7 100644 --- a/tests/setdomainname.c +++ b/tests/setdomainname.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/setdomainname.gen.test b/tests/setdomainname.gen.test new file mode 100755 index 00000000..1f29563f --- /dev/null +++ b/tests/setdomainname.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setdomainname -a24 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests/setdomainname.test b/tests/setdomainname.test deleted file mode 100755 index 2159e7c4..00000000 --- a/tests/setdomainname.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setdomainname syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 diff --git a/tests/setfsgid.c b/tests/setfsgid.c index 871f4b35..496b2679 100644 --- a/tests/setfsgid.c +++ b/tests/setfsgid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/setfsgid.gen.test b/tests/setfsgid.gen.test new file mode 100755 index 00000000..bbb30cc1 --- /dev/null +++ b/tests/setfsgid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setfsgid -a12 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests/setfsgid.test b/tests/setfsgid.test deleted file mode 100755 index 0ae2b0a2..00000000 --- a/tests/setfsgid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setfsgid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a12 diff --git a/tests/setfsgid32.c b/tests/setfsgid32.c index 6279abd3..a931602c 100644 --- a/tests/setfsgid32.c +++ b/tests/setfsgid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/setfsgid32.gen.test b/tests/setfsgid32.gen.test new file mode 100755 index 00000000..63b3eca0 --- /dev/null +++ b/tests/setfsgid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setfsgid32 -a14 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests/setfsgid32.test b/tests/setfsgid32.test deleted file mode 100755 index 9b7a2bf8..00000000 --- a/tests/setfsgid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setfsgid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a14 diff --git a/tests/setfsugid.c b/tests/setfsugid.c index 79ba34d8..0447544a 100644 --- a/tests/setfsugid.c +++ b/tests/setfsugid.c @@ -2,29 +2,10 @@ * Check decoding of setfsuid/setfsgid/setfsuid32/setfsgid32 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -47,7 +28,7 @@ main(void) const kernel_ulong_t tests[] = { ugid, 0xffff0000U | ugid, - (kernel_ulong_t) 0xffffffff00000000ULL | ugid, + F8ILL_KULONG_MASK | ugid, 0xffffU, -1U, -1L, diff --git a/tests/setfsuid.c b/tests/setfsuid.c index d6faf971..269d38f2 100644 --- a/tests/setfsuid.c +++ b/tests/setfsuid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/setfsuid.gen.test b/tests/setfsuid.gen.test new file mode 100755 index 00000000..5896b303 --- /dev/null +++ b/tests/setfsuid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setfsuid -a12 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests/setfsuid.test b/tests/setfsuid.test deleted file mode 100755 index 18a10219..00000000 --- a/tests/setfsuid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setfsuid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a12 diff --git a/tests/setfsuid32.c b/tests/setfsuid32.c index b71cf235..cfcc0f83 100644 --- a/tests/setfsuid32.c +++ b/tests/setfsuid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/setfsuid32.gen.test b/tests/setfsuid32.gen.test new file mode 100755 index 00000000..52d0820f --- /dev/null +++ b/tests/setfsuid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setfsuid32 -a14 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests/setfsuid32.test b/tests/setfsuid32.test deleted file mode 100755 index 2dce3cc9..00000000 --- a/tests/setfsuid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setfsuid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a14 diff --git a/tests/setgid.c b/tests/setgid.c index 8794a0a4..3374924a 100644 --- a/tests/setgid.c +++ b/tests/setgid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/setgid.gen.test b/tests/setgid.gen.test new file mode 100755 index 00000000..be188d1f --- /dev/null +++ b/tests/setgid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setgid -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests/setgid.test b/tests/setgid.test deleted file mode 100755 index a3a90041..00000000 --- a/tests/setgid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setgid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 diff --git a/tests/setgid32.c b/tests/setgid32.c index 17f43c58..427c77b0 100644 --- a/tests/setgid32.c +++ b/tests/setgid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/setgid32.gen.test b/tests/setgid32.gen.test new file mode 100755 index 00000000..9020b809 --- /dev/null +++ b/tests/setgid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setgid32 -a12 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests/setgid32.test b/tests/setgid32.test deleted file mode 100755 index 11a87e12..00000000 --- a/tests/setgid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setgid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a12 diff --git a/tests/setgroups.c b/tests/setgroups.c index 1ec8333f..a47f1024 100644 --- a/tests/setgroups.c +++ b/tests/setgroups.c @@ -2,29 +2,10 @@ * Check decoding of setgroups/setgroups32 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifdef __NR_setgroups32 @@ -75,7 +56,7 @@ main(void) long rc = syscall(SYSCALL_NR, 0, 0); printf("%s(0, NULL) = %s\n", SYSCALL_NAME, sprintrc(rc)); - rc = syscall(SYSCALL_NR, (long) 0xffffffff00000000ULL, 0); + rc = syscall(SYSCALL_NR, F8ILL_KULONG_MASK, 0); printf("%s(0, NULL) = %s\n", SYSCALL_NAME, sprintrc(rc)); rc = syscall(SYSCALL_NR, 1, 0); @@ -91,7 +72,7 @@ main(void) printf("%s(%d, NULL) = %s\n", SYSCALL_NAME, -1, sprintrc(rc)); /* check how the second argument is decoded */ - const GID_TYPE *const g1 = tail_alloc(sizeof(*g1)); + TAIL_ALLOC_OBJECT_CONST_PTR(const GID_TYPE, g1); GID_TYPE *const g2 = tail_alloc(sizeof(*g2) * 2); GID_TYPE *const g3 = tail_alloc(sizeof(*g3) * 3); @@ -114,7 +95,7 @@ main(void) errstr = sprintrc(rc); printf("%s(2, [", SYSCALL_NAME); printuid(*g1); - printf(", %p]) = %s\n", g1 + 1, errstr); + printf(", ... /* %p */]) = %s\n", g1 + 1, errstr); g2[0] = -2; g2[1] = -3; @@ -132,7 +113,7 @@ main(void) printuid(g2[0]); printf(", "); printuid(g2[1]); - printf(", %p]) = %s\n", g2 + 2, errstr); + printf(", ... /* %p */]) = %s\n", g2 + 2, errstr); g3[0] = 0; g3[1] = 1; @@ -164,9 +145,7 @@ main(void) printuid(g3[1]); printf(", ...]) = %s\n", errstr); - const unsigned long size = - (unsigned long) 0xffffffff00000000ULL | ngroups_max; - rc = syscall(SYSCALL_NR, size, g3); + rc = syscall(SYSCALL_NR, F8ILL_KULONG_MASK | ngroups_max, g3); errstr = sprintrc(rc); printf("%s(%d, [", SYSCALL_NAME, ngroups_max); printuid(g3[0]); diff --git a/tests/setgroups.gen.test b/tests/setgroups.gen.test new file mode 100755 index 00000000..01ec2e71 --- /dev/null +++ b/tests/setgroups.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setgroups -s2 -a17); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s2 -a17 diff --git a/tests/setgroups.test b/tests/setgroups.test deleted file mode 100755 index 0dcc8f75..00000000 --- a/tests/setgroups.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setgroups syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s2 -a17 diff --git a/tests/setgroups32.c b/tests/setgroups32.c index ecf00bbd..935b73a9 100644 --- a/tests/setgroups32.c +++ b/tests/setgroups32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/setgroups32.gen.test b/tests/setgroups32.gen.test new file mode 100755 index 00000000..e9e70ad3 --- /dev/null +++ b/tests/setgroups32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setgroups32 -s2 -a19); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -s2 -a19 diff --git a/tests/setgroups32.test b/tests/setgroups32.test deleted file mode 100755 index ee4750d1..00000000 --- a/tests/setgroups32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setgroups32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -s2 -a19 diff --git a/tests/sethostname.c b/tests/sethostname.c index e1b2f069..c9b89c12 100644 --- a/tests/sethostname.c +++ b/tests/sethostname.c @@ -3,29 +3,10 @@ * * Copyright (c) 2016 Fei Jie * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,13 +17,13 @@ # include # include -#ifdef HAVE_LINUX_UTSNAME_H -# include -#endif +# ifdef HAVE_LINUX_UTSNAME_H +# include +# endif -#ifndef __NEW_UTS_LEN -# define __NEW_UTS_LEN 64 -#endif +# ifndef __NEW_UTS_LEN +# define __NEW_UTS_LEN 64 +# endif int main(void) diff --git a/tests/sethostname.gen.test b/tests/sethostname.gen.test new file mode 100755 index 00000000..d68ed189 --- /dev/null +++ b/tests/sethostname.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sethostname -a22 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 diff --git a/tests/sethostname.test b/tests/sethostname.test deleted file mode 100755 index 78f8c58e..00000000 --- a/tests/sethostname.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sethostname syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a22 diff --git a/tests/setns.c b/tests/setns.c index 54a15317..8ef7a19b 100644 --- a/tests/setns.c +++ b/tests/setns.c @@ -2,29 +2,10 @@ * Check decoding of setns syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/setns.gen.test b/tests/setns.gen.test new file mode 100755 index 00000000..e25738bf --- /dev/null +++ b/tests/setns.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setns -a21 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests/setns.test b/tests/setns.test deleted file mode 100755 index e9a905ab..00000000 --- a/tests/setns.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of setns syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a21 diff --git a/tests/setregid.c b/tests/setregid.c index e1da7862..68639e6a 100644 --- a/tests/setregid.c +++ b/tests/setregid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/setregid.gen.test b/tests/setregid.gen.test new file mode 100755 index 00000000..f84b1acb --- /dev/null +++ b/tests/setregid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setregid -a15 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests/setregid.test b/tests/setregid.test deleted file mode 100755 index 101c7bdf..00000000 --- a/tests/setregid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setregid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a15 diff --git a/tests/setregid32.c b/tests/setregid32.c index 3cf0daf6..6291bc58 100644 --- a/tests/setregid32.c +++ b/tests/setregid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/setregid32.gen.test b/tests/setregid32.gen.test new file mode 100755 index 00000000..7320c8cf --- /dev/null +++ b/tests/setregid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setregid32 -a17 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests/setregid32.test b/tests/setregid32.test deleted file mode 100755 index e57e66c4..00000000 --- a/tests/setregid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setregid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a17 diff --git a/tests/setresgid.c b/tests/setresgid.c index 8701df8e..f3a160e3 100644 --- a/tests/setresgid.c +++ b/tests/setresgid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/setresgid.gen.test b/tests/setresgid.gen.test new file mode 100755 index 00000000..792313c2 --- /dev/null +++ b/tests/setresgid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setresgid -a19 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests/setresgid.test b/tests/setresgid.test deleted file mode 100755 index 5a695742..00000000 --- a/tests/setresgid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setresgid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a19 diff --git a/tests/setresgid32.c b/tests/setresgid32.c index dfce4572..e05ae8f8 100644 --- a/tests/setresgid32.c +++ b/tests/setresgid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/setresgid32.gen.test b/tests/setresgid32.gen.test new file mode 100755 index 00000000..6ecf936b --- /dev/null +++ b/tests/setresgid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setresgid32 -a21 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests/setresgid32.test b/tests/setresgid32.test deleted file mode 100755 index 528b2c9e..00000000 --- a/tests/setresgid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setresgid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a21 diff --git a/tests/setresugid.c b/tests/setresugid.c index 711bd317..07322cd7 100644 --- a/tests/setresugid.c +++ b/tests/setresugid.c @@ -1,30 +1,10 @@ /* * Check decoding of setresuid/setresgid/setresuid32/setresgid32 syscalls. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include diff --git a/tests/setresuid.c b/tests/setresuid.c index 3a9dbd1f..855a9bf7 100644 --- a/tests/setresuid.c +++ b/tests/setresuid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/setresuid.gen.test b/tests/setresuid.gen.test new file mode 100755 index 00000000..a0dcb4ba --- /dev/null +++ b/tests/setresuid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setresuid -a19 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 diff --git a/tests/setresuid.test b/tests/setresuid.test deleted file mode 100755 index f1219e06..00000000 --- a/tests/setresuid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setresuid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a19 diff --git a/tests/setresuid32.c b/tests/setresuid32.c index 387268a7..ccfc2a51 100644 --- a/tests/setresuid32.c +++ b/tests/setresuid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/setresuid32.gen.test b/tests/setresuid32.gen.test new file mode 100755 index 00000000..a9f43969 --- /dev/null +++ b/tests/setresuid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setresuid32 -a21 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a21 diff --git a/tests/setresuid32.test b/tests/setresuid32.test deleted file mode 100755 index 942a3a65..00000000 --- a/tests/setresuid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setresuid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a21 diff --git a/tests/setreugid.c b/tests/setreugid.c index 38c80d57..f195fd51 100644 --- a/tests/setreugid.c +++ b/tests/setreugid.c @@ -1,30 +1,10 @@ /* * Check decoding of setreuid/setregid/setreuid32/setregid32 syscalls. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include diff --git a/tests/setreuid.c b/tests/setreuid.c index 68e75192..1e34dd18 100644 --- a/tests/setreuid.c +++ b/tests/setreuid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/setreuid.gen.test b/tests/setreuid.gen.test new file mode 100755 index 00000000..0ecaef0b --- /dev/null +++ b/tests/setreuid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setreuid -a15 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests/setreuid.test b/tests/setreuid.test deleted file mode 100755 index b6db3c1d..00000000 --- a/tests/setreuid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setreuid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a15 diff --git a/tests/setreuid32.c b/tests/setreuid32.c index ba017621..c0345db7 100644 --- a/tests/setreuid32.c +++ b/tests/setreuid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/setreuid32.gen.test b/tests/setreuid32.gen.test new file mode 100755 index 00000000..3eb0e95a --- /dev/null +++ b/tests/setreuid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setreuid32 -a17 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests/setreuid32.test b/tests/setreuid32.test deleted file mode 100755 index 23323d47..00000000 --- a/tests/setreuid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setreuid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a17 diff --git a/tests/setrlimit-Xabbrev.c b/tests/setrlimit-Xabbrev.c new file mode 100644 index 00000000..d5cf2ad3 --- /dev/null +++ b/tests/setrlimit-Xabbrev.c @@ -0,0 +1 @@ +#include "setrlimit.c" diff --git a/tests/setrlimit-Xabbrev.gen.test b/tests/setrlimit-Xabbrev.gen.test new file mode 100755 index 00000000..82d97839 --- /dev/null +++ b/tests/setrlimit-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setrlimit-Xabbrev -a27 -e trace=setrlimit -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 -e trace=setrlimit -Xabbrev diff --git a/tests/setrlimit-Xraw.c b/tests/setrlimit-Xraw.c new file mode 100644 index 00000000..1a5ead0b --- /dev/null +++ b/tests/setrlimit-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "setrlimit.c" diff --git a/tests/setrlimit-Xraw.gen.test b/tests/setrlimit-Xraw.gen.test new file mode 100755 index 00000000..b079d510 --- /dev/null +++ b/tests/setrlimit-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setrlimit-Xraw -a19 -e trace=setrlimit -Xraw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 -e trace=setrlimit -Xraw diff --git a/tests/setrlimit-Xverbose.c b/tests/setrlimit-Xverbose.c new file mode 100644 index 00000000..20cd135f --- /dev/null +++ b/tests/setrlimit-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "setrlimit.c" diff --git a/tests/setrlimit-Xverbose.gen.test b/tests/setrlimit-Xverbose.gen.test new file mode 100755 index 00000000..03dd8b04 --- /dev/null +++ b/tests/setrlimit-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setrlimit-Xverbose -a36 -e trace=setrlimit -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 -e trace=setrlimit -Xverbose diff --git a/tests/setrlimit.c b/tests/setrlimit.c index e93c8e37..099e2402 100644 --- a/tests/setrlimit.c +++ b/tests/setrlimit.c @@ -1,30 +1,11 @@ /* * Check decoding of setrlimit syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -43,7 +24,16 @@ main(void) for (xlat = resources; xlat->str; ++xlat) { unsigned long res = 0xfacefeed00000000ULL | xlat->val; long rc = syscall(__NR_setrlimit, res, 0); +# if XLAT_RAW + printf("setrlimit(%#x, NULL) = %s\n", + (unsigned int) xlat->val, sprintrc(rc)); +# elif XLAT_VERBOSE + printf("setrlimit(%#x /* %s */, NULL) = %s\n", + (unsigned int) xlat->val, + xlat->str, sprintrc(rc)); +# else printf("setrlimit(%s, NULL) = %s\n", xlat->str, sprintrc(rc)); +# endif struct rlimit libc_rlim = {}; if (getrlimit((int) res, &libc_rlim)) @@ -53,10 +43,23 @@ main(void) rc = syscall(__NR_setrlimit, res, rlimit); const char *errstr = sprintrc(rc); +# if XLAT_RAW + printf("setrlimit(%#x, {rlim_cur=%s, rlim_max=%s}) = %s\n", + (unsigned int) xlat->val, + sprint_rlim(rlimit[0]), sprint_rlim(rlimit[1]), + errstr); +# elif XLAT_VERBOSE + printf("setrlimit(%#x /* %s */," + " {rlim_cur=%s, rlim_max=%s}) = %s\n", + (unsigned int) xlat->val, xlat->str, + sprint_rlim(rlimit[0]), sprint_rlim(rlimit[1]), + errstr); +# else printf("setrlimit(%s, {rlim_cur=%s, rlim_max=%s}) = %s\n", xlat->str, sprint_rlim(rlimit[0]), sprint_rlim(rlimit[1]), errstr); +# endif } puts("+++ exited with 0 +++"); diff --git a/tests/setrlimit.gen.test b/tests/setrlimit.gen.test new file mode 100755 index 00000000..0d1508d3 --- /dev/null +++ b/tests/setrlimit.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setrlimit -a27 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a27 diff --git a/tests/setrlimit.test b/tests/setrlimit.test deleted file mode 100755 index 79206089..00000000 --- a/tests/setrlimit.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of getrlimit/ugetrlimit/setrlimit syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a27 diff --git a/tests/setugid.c b/tests/setugid.c index aba277c5..b09cacb4 100644 --- a/tests/setugid.c +++ b/tests/setugid.c @@ -2,29 +2,10 @@ * Check decoding of setuid/setgid/setuid32/setgid32 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -61,6 +42,8 @@ main(void) const unsigned int num = (unsigned UGID_TYPE) tests[i]; long expected; + errno = 0; + if (num == ugid) expected = 0; else if ((UGID_TYPE) num == (UGID_TYPE) -1U) @@ -77,8 +60,9 @@ main(void) SYSCALL_NAME, ugid, errstr); break; } - perror_msg_and_fail("%s(%#lx) != %ld", - SYSCALL_NAME, tests[i], expected); + perror_msg_and_fail("%s(%#lx) = %ld != %ld", + SYSCALL_NAME, tests[i], + rc, expected); } printf("%s(", SYSCALL_NAME); diff --git a/tests/setuid.c b/tests/setuid.c index df2e46b1..4a8243e8 100644 --- a/tests/setuid.c +++ b/tests/setuid.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/setuid.gen.test b/tests/setuid.gen.test new file mode 100755 index 00000000..00aeb7a2 --- /dev/null +++ b/tests/setuid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setuid -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests/setuid.test b/tests/setuid.test deleted file mode 100755 index 9279233a..00000000 --- a/tests/setuid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setuid syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 diff --git a/tests/setuid32.c b/tests/setuid32.c index c837d547..ba1b2e2d 100644 --- a/tests/setuid32.c +++ b/tests/setuid32.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/setuid32.gen.test b/tests/setuid32.gen.test new file mode 100755 index 00000000..ac8df8f2 --- /dev/null +++ b/tests/setuid32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (setuid32 -a12 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 diff --git a/tests/setuid32.test b/tests/setuid32.test deleted file mode 100755 index 7998392a..00000000 --- a/tests/setuid32.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setuid32 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a12 diff --git a/tests/shmxt.c b/tests/shmxt.c index 23cc7ccf..3742a484 100644 --- a/tests/shmxt.c +++ b/tests/shmxt.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include @@ -18,6 +25,10 @@ cleanup(void) # define SHMAT "shmat" #endif +#ifndef SHM_EXEC +# define SHM_EXEC 0100000 +#endif + int main(void) { @@ -34,8 +45,8 @@ main(void) atexit(cleanup); rc = (long) shmat(bogus_shmid, bogus_shmaddr, bogus_shmflg); - printf("%s(%d, %p, SHM_REMAP|SHM_RDONLY|SHM_RND|%#x) = %s\n", - SHMAT, bogus_shmid, bogus_shmaddr, bogus_shmflg & ~0x7000, + printf("%s(%d, %p, SHM_RDONLY|SHM_RND|SHM_REMAP|SHM_EXEC|%#x) = %s\n", + SHMAT, bogus_shmid, bogus_shmaddr, bogus_shmflg & ~0xf000, sprintrc(rc)); shmat(id, NULL, SHM_REMAP); @@ -50,18 +61,31 @@ main(void) rc = shmdt(NULL); printf("shmdt(NULL) = %s\n", sprintrc(rc)); - if (shmdt(shmaddr)) - perror_msg_and_skip("shmdt"); - printf("shmdt(%p) = 0\n", shmaddr); + rc = shmdt(shmaddr); + printf("shmdt(%p) = %s\n", shmaddr, sprintrc(rc)); ++shmaddr; void *shmaddr2 = shmat(id, shmaddr, SHM_RND); if (shmaddr2 == (void *)(-1)) printf("%s(%d, %p, SHM_RND) = -1 %s (%m)\n", SHMAT, id, shmaddr, errno2name()); - else + else { printf("%s(%d, %p, SHM_RND) = %p\n", SHMAT, id, shmaddr, shmaddr2); + rc = shmdt(shmaddr2); + printf("shmdt(%p) = %s\n", shmaddr2, sprintrc(rc)); + } + + shmaddr = shmat(id, NULL, SHM_RDONLY|SHM_EXEC); + if (shmaddr == (void *)(-1)) + printf("%s(%d, NULL, SHM_RDONLY|SHM_EXEC) = %s\n", + SHMAT, id, sprintrc(-1)); + else { + printf("%s(%d, NULL, SHM_RDONLY|SHM_EXEC) = %p\n", + SHMAT, id, shmaddr); + rc = shmdt(shmaddr); + printf("shmdt(%p) = %s\n", shmaddr, sprintrc(rc)); + } puts("+++ exited with 0 +++"); return 0; diff --git a/tests/shmxt.gen.test b/tests/shmxt.gen.test new file mode 100755 index 00000000..dd9d35f0 --- /dev/null +++ b/tests/shmxt.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (shmxt -a11 -e trace='/(osf_)?shmat,shmdt'); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace='/(osf_)?shmat,shmdt' diff --git a/tests/shmxt.test b/tests/shmxt.test deleted file mode 100755 index 3757cfa4..00000000 --- a/tests/shmxt.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check shmat and shmdt syscalls decoding. - -. "${srcdir=.}/init.sh" - -case "$STRACE_ARCH" in - alpha) shmat=osf_shmat ;; - *) shmat=shmat ;; -esac - -run_strace_match_diff -e trace=$shmat,shmdt -a11 diff --git a/tests/shutdown.c b/tests/shutdown.c index d770c43a..5297a0eb 100644 --- a/tests/shutdown.c +++ b/tests/shutdown.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + /* Check decoding of shutdown syscall. */ #include "tests.h" diff --git a/tests/shutdown.gen.test b/tests/shutdown.gen.test new file mode 100755 index 00000000..7fde46ee --- /dev/null +++ b/tests/shutdown.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (shutdown -a24 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests/shutdown.test b/tests/shutdown.test deleted file mode 100755 index 22f0d5ab..00000000 --- a/tests/shutdown.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of shutdown syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 diff --git a/tests/sigaction.awk b/tests/sigaction.awk deleted file mode 100644 index 9c3a9ed3..00000000 --- a/tests/sigaction.awk +++ /dev/null @@ -1,95 +0,0 @@ -#!/bin/gawk -# -# Copyright (c) 2014-2015 Dmitry V. Levin -# Copyright (c) 2016 Elvira Khabirova -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (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][1] = n2[1][1] = "SIG_IGN" - n1[1][2] = n2[1][2] = "\\[HUP INT\\]" - n1[1][3] = "SA_RESTORER\\|SA_RESTART" - n2[1][3] = "SA_RESTART" - n1[1][4] = ", sa_restorer=0x[0-9a-f]+" - n2[1][4] = "" - - n1[2][1] = n2[2][1] = "0x[0-9a-f]+" - n1[2][2] = n2[2][2] = "\\[QUIT TERM\\]" - n1[2][3] = "SA_RESTORER\\|SA_SIGINFO" - n2[2][3] = "SA_SIGINFO" - n1[2][4] = ", sa_restorer=0x[0-9a-f]+" - n2[2][4] = "" - - n1[3][1] = n2[3][1] = "SIG_DFL" - n1[3][2] = n2[3][2] = "\\[\\]" - n1[3][3] = "SA_RESTORER" - n2[3][3] = "0" - n1[3][4] = ", sa_restorer=0x[0-9a-f]+" - n2[3][4] = "" - - n1[4][1] = n2[4][1] = "SIG_DFL" - n1[4][2] = n2[4][2] = "~\\[HUP( ((RT|SIGRT)[^] ]+|[3-9][0-9]|1[0-9][0-9]))*\\]" - n1[4][3] = "SA_RESTORER" - n2[4][3] = "0" - n1[4][4] = ", sa_restorer=0x[0-9a-f]+" - n2[4][4] = "" - - o1[1][1] = o2[1][1] = "SIG_DFL" - o1[1][2] = o2[1][2] = "\\[\\]" - o1[1][3] = o2[1][3] = "0" - o1[1][4] = o2[1][4] = "" - - for (i = 2; i < 5; i++) { - for (j = 1; j < 5; j++) { - o1[i][j] = n1[i - 1][j] - o2[i][j] = n2[i - 1][j] - } - } - - a1 = "(0x[0-9a-f]+, )?(4|8|16)" - a2 = "(4|8|16)(, 0x[0-9a-f]+)?" - a3 = "0x[0-9a-f]+, (4|8|16)" - - for (i = 1; i < 5; i++) { - r[i] = "^rt_sigaction\\(SIGUSR2, (" \ - "\\{sa_handler=" n1[i][1] ", sa_mask=" n1[i][2] \ - ", sa_flags=" n1[i][3] n1[i][4] "\\}, \\{sa_handler=" \ - o1[i][1] ", sa_mask=" o1[i][2] ", sa_flags=" o1[i][3] \ - o1[i][4] "\\}, " a1 "|" \ - "\\{sa_handler=" n2[i][1] ", sa_mask=" n2[i][2] \ - ", sa_flags=" n2[i][3] n2[i][4] "\\}, \\{sa_handler=" \ - o2[i][1] ", sa_mask=" o2[i][2] ", sa_flags=" o2[i][3] \ - o2[i][4] "\\}, " a2 "|" \ - "\\{sa_handler=" n2[i][1] ", sa_mask=" n2[i][2] \ - ", sa_flags=" n2[i][3] n2[i][4] "\\}, \\{sa_handler=" \ - o2[i][1] ", sa_mask=" o2[i][2] ", sa_flags=" o2[i][3] \ - o2[i][4] "\\}, " a3 ")\\) = 0$" - } - s[5] = "+++ exited with 0 +++" - - lines = 5 - fail = 0 -} - -@include "match.awk" diff --git a/tests/sigaction.c b/tests/sigaction.c index 1c034ff3..fe6280ce 100644 --- a/tests/sigaction.c +++ b/tests/sigaction.c @@ -1,67 +1,185 @@ /* - * Copyright (c) 2014-2015 Dmitry V. Levin - * All rights reserved. + * Check decoding of sigaction syscall. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Copyright (c) 2014-2018 Dmitry V. Levin + * All rights reserved. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ -#include -#include -#include -#include +#include "tests.h" +#include + +#ifdef __NR_sigaction + +# include +# include +# include +# include +# include + +struct set_sa { +# if defined MIPS + unsigned int flags; + unsigned long handler; + unsigned long mask[1]; +# elif defined ALPHA + unsigned long handler; + unsigned long mask[1]; + unsigned int flags; +# else + unsigned long handler; + unsigned long mask[1]; + unsigned long flags; + unsigned long restorer; +# endif +} +# ifdef ALPHA + ATTRIBUTE_PACKED +# endif +; + +typedef struct set_sa struct_set_sa; + +# ifdef MIPS + +struct get_sa { + unsigned int flags; + unsigned long handler; + unsigned long mask[4]; +}; + +typedef struct get_sa struct_get_sa; -static void handle_signal(int no) +# else + +typedef struct set_sa struct_get_sa; + +# endif + +static long +k_sigaction(const kernel_ulong_t signum, const kernel_ulong_t new_act, + const kernel_ulong_t old_act) { - _exit(128 + no); + return syscall(__NR_sigaction, signum, new_act, old_act); } +# if defined SPARC || defined SPARC64 +/* + * See arch/sparc/kernel/sys_sparc_32.c:sys_sparc_sigaction + * and arch/sparc/kernel/sys_sparc32.c:compat_sys_sparc_sigaction + */ +# define ADDR_INT ((unsigned int) -0xdefaced) +# define SIGNO_INT ((unsigned int) -SIGUSR1) +# define SIG_STR "-SIGUSR1" +# else +# define ADDR_INT ((unsigned int) 0xdefaced) +# define SIGNO_INT ((unsigned int) SIGUSR1) +# define SIG_STR "SIGUSR1" +# endif +static const kernel_ulong_t signo = + (kernel_ulong_t) 0xbadc0ded00000000ULL | SIGNO_INT; +static const kernel_ulong_t addr = + (kernel_ulong_t) 0xfacefeed00000000ULL | ADDR_INT; + int main(void) { - struct sigaction sa, sa0; - - sa.sa_handler = SIG_IGN; - sigemptyset(&sa.sa_mask); - sigaddset(&sa.sa_mask, SIGHUP); - sigaddset(&sa.sa_mask, SIGINT); - sa.sa_flags = SA_RESTART; - assert(!sigaction(SIGUSR2, &sa, &sa0)); - - sa.sa_handler = handle_signal; - sigemptyset(&sa.sa_mask); - sigaddset(&sa.sa_mask, SIGQUIT); - sigaddset(&sa.sa_mask, SIGTERM); - sa.sa_flags = SA_SIGINFO; - assert(!sigaction(SIGUSR2, &sa, &sa0)); - - sa.sa_handler = SIG_DFL; - sigemptyset(&sa.sa_mask); - sa.sa_flags = 0; - assert(!sigaction(SIGUSR2, &sa, &sa0)); - - sigfillset(&sa.sa_mask); - sigdelset(&sa.sa_mask, SIGHUP); - assert(!sigaction(SIGUSR2, &sa, &sa0)); + union { + sigset_t libc[1]; + unsigned long old[1]; + } mask; + + TAIL_ALLOC_OBJECT_CONST_PTR(struct_set_sa, new_act); + TAIL_ALLOC_OBJECT_CONST_PTR(struct_get_sa, old_act); + + if (k_sigaction(signo, 0, 0)) + perror_msg_and_skip("sigaction"); + puts("sigaction(" SIG_STR ", NULL, NULL) = 0"); + + k_sigaction(signo, 0, 0); + puts("sigaction(" SIG_STR ", NULL, NULL) = 0"); + k_sigaction(signo, (uintptr_t) (new_act + 1), 0); + printf("sigaction(" SIG_STR ", %p, NULL) = -1 EFAULT (%m)\n", + new_act + 1); + + k_sigaction(signo, (uintptr_t) new_act + 2, 0); + printf("sigaction(" SIG_STR ", %#lx, NULL) = -1 EFAULT (%m)\n", + (unsigned long) new_act + 2); + + k_sigaction(signo, 0, (uintptr_t) (old_act + 1)); + printf("sigaction(" SIG_STR ", NULL, %p) = -1 EFAULT (%m)\n", + old_act + 1); + + k_sigaction(signo, 0, (uintptr_t) old_act + 2); + printf("sigaction(" SIG_STR ", NULL, %#lx) = -1 EFAULT (%m)\n", + (unsigned long) old_act + 2); + + k_sigaction(addr, 0, 0); + printf("sigaction(%d, NULL, NULL) = -1 EINVAL (%m)\n", ADDR_INT); + + memset(new_act, 0, sizeof(*new_act)); + + k_sigaction(signo, (uintptr_t) new_act, 0); + puts("sigaction(" SIG_STR ", {sa_handler=SIG_DFL, sa_mask=[]" + ", sa_flags=0}, NULL) = 0"); + + sigemptyset(mask.libc); + sigaddset(mask.libc, SIGHUP); + sigaddset(mask.libc, SIGINT); + + new_act->handler = (uintptr_t) SIG_IGN; + memcpy(new_act->mask, mask.old, sizeof(mask.old)); + new_act->flags = SA_SIGINFO; + + k_sigaction(signo, (uintptr_t) new_act, (uintptr_t) old_act); + puts("sigaction(" SIG_STR ", {sa_handler=SIG_IGN, sa_mask=[HUP INT]" + ", sa_flags=SA_SIGINFO}, {sa_handler=SIG_DFL, sa_mask=[]" + ", sa_flags=0}) = 0"); + + sigemptyset(mask.libc); + sigaddset(mask.libc, SIGQUIT); + sigaddset(mask.libc, SIGTERM); + + new_act->handler = (unsigned long) addr; + memcpy(new_act->mask, mask.old, sizeof(mask.old)); + new_act->flags = SA_ONSTACK | SA_RESTART; + + k_sigaction(signo, (uintptr_t) new_act, (uintptr_t) old_act); + printf("sigaction(" SIG_STR ", {sa_handler=%#lx, sa_mask=[QUIT TERM]" + ", sa_flags=SA_ONSTACK|SA_RESTART}, {sa_handler=SIG_IGN" + ", sa_mask=[HUP INT], sa_flags=SA_SIGINFO}) = 0\n", + new_act->handler); + + memset(mask.old, -1, sizeof(mask.old)); + sigdelset(mask.libc, SIGHUP); + + memcpy(new_act->mask, mask.old, sizeof(mask.old)); +# ifdef SA_RESTORER + new_act->flags = SA_RESTORER; + new_act->restorer = (unsigned long) 0xdeadfacecafef00dULL; +# define SA_RESTORER_FMT ", sa_flags=SA_RESTORER, sa_restorer=%#lx" +# define SA_RESTORER_ARGS , new_act->restorer +# else + new_act->flags = SA_NODEFER; +# define SA_RESTORER_FMT ", sa_flags=SA_NODEFER" +# define SA_RESTORER_ARGS +# endif + + k_sigaction(signo, (uintptr_t) new_act, (uintptr_t) old_act); + printf("sigaction(" SIG_STR ", {sa_handler=%#lx, sa_mask=~[HUP]" + SA_RESTORER_FMT "}, {sa_handler=%#lx, sa_mask=[QUIT TERM]" + ", sa_flags=SA_ONSTACK|SA_RESTART}) = 0\n", + new_act->handler SA_RESTORER_ARGS, + new_act->handler); + + puts("+++ exited with 0 +++"); return 0; } + +#else + +SKIP_MAIN_UNDEFINED("__NR_sigaction") + +#endif diff --git a/tests/sigaction.gen.test b/tests/sigaction.gen.test new file mode 100755 index 00000000..1db6b3aa --- /dev/null +++ b/tests/sigaction.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sigaction -a31 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a31 diff --git a/tests/sigaction.test b/tests/sigaction.test deleted file mode 100755 index fcde3baf..00000000 --- a/tests/sigaction.test +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# Check rt_sigaction decoding. - -. "${srcdir=.}/init.sh" - -run_prog -run_strace -ert_sigaction $args -match_awk - -exit 0 diff --git a/tests/sigaltstack.c b/tests/sigaltstack.c index 884e3c55..905f71c7 100644 --- a/tests/sigaltstack.c +++ b/tests/sigaltstack.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/sigaltstack.test b/tests/sigaltstack.test index ff83c2ea..a2ff4414 100755 --- a/tests/sigaltstack.test +++ b/tests/sigaltstack.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check sigaltstack syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests/sigblock.test b/tests/sigblock.test new file mode 100755 index 00000000..ab1eaeb7 --- /dev/null +++ b/tests/sigblock.test @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Check signal mask transparency. +# Starting with commit v4.17-5-gf83b49b strace is expected +# to forward the signal mask to tracees unchanged. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog ../list_sigaction_signum > /dev/null +saved_STRACE="$STRACE" + +for sig in $(../list_sigaction_signum); do + for block in 0 1; do + set_cmd="../set_sigblock $block $sig" + check_cmd="../check_sigblock $block $sig" + run_prog $set_cmd $check_cmd + STRACE="$set_cmd $saved_STRACE" + for i in '' -I1 -I2 -I3 -I4; do + run_strace $i -enone $check_cmd + done + done +done diff --git a/tests/sigign.test b/tests/sigign.test new file mode 100755 index 00000000..07a8180c --- /dev/null +++ b/tests/sigign.test @@ -0,0 +1,27 @@ +#!/bin/sh +# +# Check signal disposition transparency. +# Starting with commit v4.17-8-ge97a66f strace is expected +# to forward the signal disposition to tracees unchanged. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog ../list_sigaction_signum > /dev/null +saved_STRACE="$STRACE" + +for sig in $(../list_sigaction_signum); do + for ign in 0 1; do + set_cmd="../set_sigign $ign $sig" + check_cmd="../check_sigign $ign $sig" + run_prog $set_cmd $check_cmd + STRACE="$set_cmd $saved_STRACE" + for i in '' -I1 -I2 -I3 -I4; do + run_strace $i -enone $check_cmd + done + done +done diff --git a/tests/siginfo.c b/tests/siginfo.c index 2ecb13fd..7789ff27 100644 --- a/tests/siginfo.c +++ b/tests/siginfo.c @@ -1,30 +1,10 @@ /* * Check SIGCHLD siginfo_t decoding. * - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/siginfo.gen.test b/tests/siginfo.gen.test new file mode 100755 index 00000000..33792b94 --- /dev/null +++ b/tests/siginfo.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (siginfo -e trace=none); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=none diff --git a/tests/siginfo.test b/tests/siginfo.test deleted file mode 100755 index 725f714f..00000000 --- a/tests/siginfo.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check SIGCHLD siginfo_t decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=none diff --git a/tests/signal.c b/tests/signal.c new file mode 100644 index 00000000..40cd77f5 --- /dev/null +++ b/tests/signal.c @@ -0,0 +1,112 @@ +/* + * Check decoding of signal syscall. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_signal + +# include +# include +# include +# include +# include +# include + +static long +k_signal(const kernel_ulong_t signum, const kernel_ulong_t handler) +{ + return syscall(__NR_signal, signum, handler); +} + +int +main(void) +{ + static const uintptr_t sig_ign = (uintptr_t) SIG_IGN; + static const uintptr_t sig_dfl = (uintptr_t) SIG_DFL; + static const kernel_ulong_t sigusr1 = + (kernel_ulong_t) 0xfacefeed00000000ULL | SIGUSR1; + static const struct sigaction act = { .sa_handler = SIG_DFL }; + long rc; + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, SIGUSR1); + if (sigprocmask(SIG_BLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask SIG_BLOCK"); + + if (sigaction(SIGUSR1, &act, NULL)) + perror_msg_and_fail("sigaction"); + + rc = k_signal(sigusr1, sig_ign); + + if (rc == -1L) { + printf("signal(SIGUSR1, SIG_IGN) = %s\n", sprintrc(rc)); + } else if (rc != (long) sig_dfl) { + error_msg_and_fail("signal(SIGUSR1, SIG_IGN) = %#lx\n", rc); + } else { + printf("signal(SIGUSR1, SIG_IGN) = %#lx (SIG_DFL)\n", rc); + + /* + * Raise and unblock SIGUSR1. + * If signal syscall failed to set SIGUSR1 handler to SIG_IGN, + * the process will be terminated by SIGUSR1. + */ + raise(SIGUSR1); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask SIG_UNBLOCK"); + + if (sigprocmask(SIG_BLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask SIG_BLOCK"); + } + + rc = k_signal(SIGUSR1, sig_dfl); + + if (rc == -1L) { + printf("signal(SIGUSR1, SIG_DFL) = %s\n", sprintrc(rc)); + } else if (rc != (long) sig_ign) { + error_msg_and_fail("signal(SIGUSR1, SIG_DFL) = %#lx\n", rc); + } else { + printf("signal(SIGUSR1, SIG_DFL) = %#lx (SIG_IGN)\n", rc); + } + + const kernel_ulong_t addr = (kernel_ulong_t) 0xfacefeeddeadbeefULL; + rc = k_signal(SIGUSR1, addr); + + if (rc == -1L) { + printf("signal(SIGUSR1, %#llx) = %s\n", + (unsigned long long) addr, sprintrc(rc)); + } else if (rc != (long) sig_dfl) { + error_msg_and_fail("signal(SIGUSR1, %#llx) = %#lx\n", + (unsigned long long) addr, rc); + } else { + printf("signal(SIGUSR1, %#llx) = %#lx (SIG_DFL)\n", + (unsigned long long) addr, rc); + } + + rc = k_signal(SIGUSR1, sig_ign); + + if (rc == -1L) { + printf("signal(SIGUSR1, SIG_IGN) = %s\n", sprintrc(rc)); + } else { + printf("signal(SIGUSR1, SIG_IGN) = %#lx\n", rc); + } + + rc = k_signal(addr, sig_ign); + printf("signal(%d, SIG_IGN) = %s\n", (int) addr, sprintrc(rc)); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_signal") + +#endif diff --git a/tests/signal.gen.test b/tests/signal.gen.test new file mode 100755 index 00000000..81359ca5 --- /dev/null +++ b/tests/signal.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (signal -a25 -e signal=none -e trace='/^signal$'); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a25 -e signal=none -e trace='/^signal$' diff --git a/tests/signal2name.c b/tests/signal2name.c index e301f4ee..1d8e7c59 100644 --- a/tests/signal2name.c +++ b/tests/signal2name.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -50,6 +57,7 @@ signal2name(int sig) CASE(SIGPWR); CASE(SIGSTKFLT); #endif - default: perror_msg_and_fail("unknown signal number %d", sig); + default: + perror_msg_and_fail("unknown signal number %d", sig); } } diff --git a/tests/signal_receive.c b/tests/signal_receive.c index 1c4293e5..ad3b4ebd 100644 --- a/tests/signal_receive.c +++ b/tests/signal_receive.c @@ -1,43 +1,107 @@ +/* + * Check decoding of signal delivery. + * + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include #include -void sig_print(const char *signame, const int pid, const int uid) -{ - printf("kill(%d, %s) = 0\n" - "--- %s {si_signo=%s, si_code=SI_USER, si_pid=%d" - ", si_uid=%d} ---\n", - pid, signame, signame, signame, pid, uid); -} +static volatile int s_sig, s_code, s_pid, s_uid; static void -handler(int sig) +handler(int sig, siginfo_t *info, void *ucontext) { + s_sig = info->si_signo; + s_code = info->si_code; + s_pid = info->si_pid; + s_uid = info->si_uid; } int main(void) { - int sig, pid = getpid(), uid = getuid(); - const struct sigaction act = { .sa_handler = handler }; - sigset_t mask; - sigemptyset(&mask); - - for (sig = 1; sig <= 31; sig++) { - if( sig != SIGKILL && sig != SIGSTOP) { - sigaction(sig, &act, NULL); - sigaddset(&mask, sig); + static const char prefix[] = "KERNEL BUG"; + int printed = 0; + + const int pid = getpid(); + const int uid = geteuid(); + + for (int sig = 1; sig <= 31; ++sig) { + if (sig == SIGKILL || sig == SIGSTOP) + continue; + + sigset_t mask; + sigemptyset(&mask); + sigaddset(&mask, sig); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + static const struct sigaction act = { + .sa_sigaction = handler, + .sa_flags = SA_SIGINFO + }; + if (sigaction(sig, &act, NULL)) + perror_msg_and_fail("sigaction: %d", sig); + + if (kill(pid, sig) != 0) + perror_msg_and_fail("kill: %d", sig); + +#ifdef MPERS_IS_m32 + /* + * The tracee has received a compat siginfo_t but + * the tracer has received a native siginfo_t. + */ + const int e_sig = sig; + const int e_pid = pid; + const int e_uid = uid; +#else + /* + * If the tracee is a native process, + * then the tracer is also native. + * If the tracee is a compat process, + * then the tracer is also compat. + * Anyway, both the tracee and the tracer + * have received the same siginfo_t. + */ + const int e_sig = s_sig; + const int e_pid = s_pid; + const int e_uid = s_uid; +#endif + printf("kill(%d, %s) = 0\n", pid, signal2name(sig)); + printf("--- %s {si_signo=%s, si_code=SI_USER, si_pid=%d" + ", si_uid=%d} ---\n", + signal2name(sig), signal2name(e_sig), e_pid, e_uid); + + if (s_code || sig != s_sig || pid != s_pid || uid != s_uid) { + /* + * The kernel has failed to initialize siginfo_t + * properly. There is nothing that could be done + * on the strace side to workaround the kernel bug, + * so just print some useful diagnostics. + */ + if (!printed) { + printed = 1; + fprintf(stderr, "%s: siginfo_t\n", prefix); + } + fprintf(stderr, + "%s: expected: si_signo=%d, si_code=%d" + ", si_pid=%d, si_uid=%d\n" + "%s: received: si_signo=%d, si_code=%d" + ", si_pid=%d, si_uid=%d\n", + prefix, sig, SI_USER, pid, uid, + prefix, sig, s_code, s_pid, s_uid); } } - sigprocmask(SIG_UNBLOCK, &mask, NULL); - for (sig = 1; sig <= 31; sig++) { - if(sig != SIGKILL && sig != SIGSTOP) { - if (kill(pid, sig) != 0) - perror_msg_and_fail("kill: %d", sig); - sig_print(signal2name(sig), pid, uid); - } + if (printed) { + fprintf(stderr, "%s: end of diagnostics\n" + "*** PLEASE FIX THE KERNEL ***\n", prefix); } puts("+++ exited with 0 +++"); diff --git a/tests/signal_receive.gen.test b/tests/signal_receive.gen.test new file mode 100755 index 00000000..79e8fb84 --- /dev/null +++ b/tests/signal_receive.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (signal_receive -a16 -e trace=kill); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 -e trace=kill diff --git a/tests/signal_receive.test b/tests/signal_receive.test deleted file mode 100755 index 9685b666..00000000 --- a/tests/signal_receive.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check whether strace traces signals properly. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a16 -e trace=kill diff --git a/tests/signalfd4.c b/tests/signalfd4.c index 47e49b50..71df2dcc 100644 --- a/tests/signalfd4.c +++ b/tests/signalfd4.c @@ -2,37 +2,17 @@ * Check decoding of signalfd4 syscall. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include #include -#if defined __NR_rt_sigprocmask \ - && defined HAVE_SYS_SIGNALFD_H \ +#if defined HAVE_SYS_SIGNALFD_H \ && defined HAVE_SIGNALFD \ && defined O_CLOEXEC @@ -41,24 +21,6 @@ # include # include -static unsigned int -get_sigset_size(void) -{ - const unsigned int big_size = 1024 / 8; - unsigned int set_size; - - for (set_size = big_size; set_size; set_size >>= 1) { - if (!syscall(__NR_rt_sigprocmask, SIG_SETMASK, - NULL, NULL, set_size)) - break; - } - - if (!set_size) - perror_msg_and_fail("rt_sigprocmask"); - - return set_size; -} - int main(void) { @@ -80,7 +42,6 @@ main(void) #else -SKIP_MAIN_UNDEFINED("__NR_rt_sigprocmask && HAVE_SYS_SIGNALFD_H" - " && HAVE_SIGNALFD && O_CLOEXEC") +SKIP_MAIN_UNDEFINED("HAVE_SYS_SIGNALFD_H && HAVE_SIGNALFD && O_CLOEXEC") #endif diff --git a/tests/signalfd4.gen.test b/tests/signalfd4.gen.test new file mode 100755 index 00000000..dee4274c --- /dev/null +++ b/tests/signalfd4.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (signalfd4 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/signalfd4.test b/tests/signalfd4.test deleted file mode 100755 index a615a5bf..00000000 --- a/tests/signalfd4.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of signalfd4 syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/sigpending.c b/tests/sigpending.c new file mode 100644 index 00000000..f065c873 --- /dev/null +++ b/tests/sigpending.c @@ -0,0 +1,86 @@ +/* + * Check decoding of sigpending syscall. + * + * Copyright (c) 2016-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_sigpending + +# include +# include +# include +# include +# include + +static const char *errstr; + +static long +k_sigpending(const kernel_ulong_t set) +{ + const long rc = syscall(__NR_sigpending, set); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(kernel_ulong_t, k_set); + TAIL_ALLOC_OBJECT_CONST_PTR(sigset_t, libc_set); + + sigemptyset(libc_set); + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + + if (k_sigpending((uintptr_t) libc_set)) + perror_msg_and_skip("sigpending"); + else + puts("sigpending([]) = 0"); + + k_sigpending((uintptr_t) k_set); + puts("sigpending([]) = 0"); + + k_sigpending((uintptr_t) (k_set + 1)); + printf("sigpending(%p) = -1 EFAULT (%m)\n", k_set + 1); + + uintptr_t efault = sizeof(*k_set) / 2 + (uintptr_t) k_set; + k_sigpending(efault); + printf("sigpending(%#jx) = -1 EFAULT (%m)\n", (uintmax_t) efault); + + sigaddset(libc_set, SIGHUP); + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + raise(SIGHUP); + + k_sigpending((uintptr_t) k_set); + puts("sigpending([HUP]) = 0"); + + sigaddset(libc_set, SIGINT); + if (sigprocmask(SIG_SETMASK, libc_set, NULL)) + perror_msg_and_fail("sigprocmask"); + raise(SIGINT); + + k_sigpending((uintptr_t) k_set); + puts("sigpending([HUP INT]) = 0"); + + if (F8ILL_KULONG_SUPPORTED) { + k_sigpending(f8ill_ptr_to_kulong(k_set)); + printf("sigpending(%#jx) = %s\n", + (uintmax_t) f8ill_ptr_to_kulong(k_set), errstr); + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sigpending") + +#endif diff --git a/tests/sigpending.gen.test b/tests/sigpending.gen.test new file mode 100755 index 00000000..c061868c --- /dev/null +++ b/tests/sigpending.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sigpending -a15 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a15 diff --git a/tests/sigprocmask.c b/tests/sigprocmask.c new file mode 100644 index 00000000..566b8346 --- /dev/null +++ b/tests/sigprocmask.c @@ -0,0 +1,131 @@ +/* + * Check decoding of sigprocmask syscall. + * + * Copyright (c) 2016-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_sigprocmask + +# include +# include +# include +# include +# include + +static const char *errstr; + +static long +k_sigprocmask(const kernel_ulong_t how, const kernel_ulong_t new_set, + const kernel_ulong_t old_set) +{ + const long rc = syscall(__NR_sigprocmask, how, new_set, old_set); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const kernel_ulong_t sig_block = + (kernel_ulong_t) 0xfacefeed00000000ULL | SIG_BLOCK; + static const kernel_ulong_t sig_unblock = + (kernel_ulong_t) 0xfacefeed00000000ULL | SIG_UNBLOCK; + static const kernel_ulong_t sig_setmask = + (kernel_ulong_t) 0xfacefeed00000000ULL | SIG_SETMASK; + + if (k_sigprocmask(sig_setmask, 0, 0)) + perror_msg_and_skip("sigprocmask"); + puts("sigprocmask(SIG_SETMASK, NULL, NULL) = 0"); + + TAIL_ALLOC_OBJECT_CONST_PTR(kernel_ulong_t, new_set); + TAIL_ALLOC_OBJECT_CONST_PTR(kernel_ulong_t, old_set); + TAIL_ALLOC_OBJECT_CONST_PTR(sigset_t, libc_set); + + memset(new_set, 0, sizeof(*new_set)); + k_sigprocmask(sig_setmask, (uintptr_t) new_set, 0); + printf("sigprocmask(SIG_SETMASK, [], NULL) = %s\n", errstr); + + k_sigprocmask(sig_unblock, + (uintptr_t) (new_set - 1), (uintptr_t) old_set); + puts("sigprocmask(SIG_UNBLOCK, ~[], []) = 0"); + + if (F8ILL_KULONG_SUPPORTED) { + k_sigprocmask(sig_unblock, f8ill_ptr_to_kulong(new_set), 0); + printf("sigprocmask(SIG_UNBLOCK, %#jx, NULL) = %s\n", + (uintmax_t) f8ill_ptr_to_kulong(new_set), errstr); + + k_sigprocmask(sig_unblock, 0, f8ill_ptr_to_kulong(old_set)); + printf("sigprocmask(SIG_UNBLOCK, NULL, %#jx) = %s\n", + (uintmax_t) f8ill_ptr_to_kulong(old_set), errstr); + } + + sigemptyset(libc_set); + sigaddset(libc_set, SIGHUP); + memcpy(new_set, libc_set, sizeof(*new_set)); + + k_sigprocmask(sig_block, (uintptr_t) new_set, (uintptr_t) old_set); + puts("sigprocmask(SIG_BLOCK, [HUP], []) = 0"); + + memset(libc_set, -1, sizeof(*libc_set)); + sigdelset(libc_set, SIGHUP); + memcpy(new_set, libc_set, sizeof(*new_set)); + + k_sigprocmask(sig_unblock, (uintptr_t) new_set, (uintptr_t) old_set); + puts("sigprocmask(SIG_UNBLOCK, ~[HUP], [HUP]) = 0"); + + sigdelset(libc_set, SIGKILL); + memcpy(new_set, libc_set, sizeof(*new_set)); + + k_sigprocmask(sig_unblock, (uintptr_t) new_set, (uintptr_t) old_set); + puts("sigprocmask(SIG_UNBLOCK, ~[HUP KILL], [HUP]) = 0"); + + sigemptyset(libc_set); + sigaddset(libc_set, SIGHUP); + sigaddset(libc_set, SIGINT); + sigaddset(libc_set, SIGQUIT); + sigaddset(libc_set, SIGALRM); + sigaddset(libc_set, SIGTERM); + memcpy(new_set, libc_set, sizeof(*new_set)); + + k_sigprocmask(sig_block, (uintptr_t) new_set, (uintptr_t) old_set); + printf("sigprocmask(SIG_BLOCK, %s, [HUP]) = 0\n", + "[HUP INT QUIT ALRM TERM]"); + + k_sigprocmask(sig_setmask, 0, (uintptr_t) old_set); + printf("sigprocmask(SIG_SETMASK, NULL, %s) = 0\n", + "[HUP INT QUIT ALRM TERM]"); + + k_sigprocmask(sig_setmask, (uintptr_t) (new_set + 1), 0); + printf("sigprocmask(SIG_SETMASK, %p, NULL) = %s\n", + new_set + 1, errstr); + + k_sigprocmask(sig_setmask, + (uintptr_t) new_set, (uintptr_t) (old_set + 1)); + printf("sigprocmask(SIG_SETMASK, %s, %p) = %s\n", + "[HUP INT QUIT ALRM TERM]", old_set + 1, errstr); + + uintptr_t efault = sizeof(*new_set) / 2 + (uintptr_t) new_set; + + k_sigprocmask(sig_setmask, efault, 0); + printf("sigprocmask(SIG_SETMASK, %#jx, NULL) = %s\n", + (uintmax_t) efault, errstr); + + k_sigprocmask(sig_setmask, 0, efault); + printf("sigprocmask(SIG_SETMASK, NULL, %#jx) = %s\n", + (uintmax_t) efault, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sigprocmask") + +#endif diff --git a/tests/sigprocmask.gen.test b/tests/sigprocmask.gen.test new file mode 100755 index 00000000..065b74d7 --- /dev/null +++ b/tests/sigprocmask.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sigprocmask -a34 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a34 diff --git a/tests/sigreturn.c b/tests/sigreturn.c index dace040a..5dece0a4 100644 --- a/tests/sigreturn.c +++ b/tests/sigreturn.c @@ -1,48 +1,43 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" -#include -#include +#include -#ifdef ASM_SIGRTMIN -# define RT_0 ASM_SIGRTMIN -#else -/* Linux kernel >= 3.18 defines SIGRTMIN to 32 on all architectures. */ -# define RT_0 32 +#if defined __powerpc64__ \ + || (defined __sparc__ && defined __arch64__) +/* Old sigreturn is defined but not implemented in the kernel. */ +# undef __NR_sigreturn #endif -static void handler(int sig) +#ifdef __NR_sigreturn + +# include +# include +# include + +# ifdef ASM_SIGRTMIN +# define RT_0 ASM_SIGRTMIN +# else +/* Linux kernel >= 3.18 defines SIGRTMIN to 32 on all architectures. */ +# define RT_0 32 +# endif + +static void +handler(int sig) { } -int main(void) { - sigset_t set; +int +main(void) +{ + static sigset_t set; sigemptyset(&set); + sigaddset(&set, SIGINT); sigaddset(&set, SIGUSR2); sigaddset(&set, SIGCHLD); sigaddset(&set, RT_0 + 3); @@ -50,8 +45,28 @@ int main(void) { sigaddset(&set, RT_0 + 5); sigaddset(&set, RT_0 + 26); sigaddset(&set, RT_0 + 27); - sigprocmask(SIG_SETMASK, &set, NULL); - signal(SIGUSR1, handler); - raise(SIGUSR1); + if (sigprocmask(SIG_SETMASK, &set, NULL)) + perror_msg_and_fail("sigprocmask"); + sigemptyset(&set); + + /* This should result to old sigreturn. */ + if (signal(SIGUSR1, handler) == SIG_ERR) + perror_msg_and_fail("sigaction"); + + if (raise(SIGUSR1)) + perror_msg_and_fail("raise"); + + static const char *const sigs = + (SIGUSR2 < SIGCHLD) ? "INT USR2 CHLD" : "INT CHLD USR2"; + static const char *const rt_sigs = "RT_3 RT_4 RT_5 RT_26 RT_27"; + printf("sigreturn({mask=[%s %s]}) = 0\n", sigs, rt_sigs); + + puts("+++ exited with 0 +++"); return 0; } + +#else + +SKIP_MAIN_UNDEFINED("__NR_sigreturn") + +#endif diff --git a/tests/sigreturn.gen.test b/tests/sigreturn.gen.test new file mode 100755 index 00000000..3b67c9d0 --- /dev/null +++ b/tests/sigreturn.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sigreturn -esignal='!USR1' ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal='!USR1' diff --git a/tests/sigreturn.test b/tests/sigreturn.test deleted file mode 100755 index f9a612bf..00000000 --- a/tests/sigreturn.test +++ /dev/null @@ -1,48 +0,0 @@ -#!/bin/sh -# -# Check rt_sigprocmask and sigreturn/rt_sigreturn decoding. -# -# Copyright (c) 2015-2016 Dmitry V. Levin -# All rights reserved. -# -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (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" - -run_prog -run_strace -esignal $args - -mask='\[(USR2 CHLD|CHLD USR2) RT_3 RT_4 RT_5 RT_26 RT_27\]' -rt_sigprocmask='rt_sigprocmask\(SIG_SETMASK, '"$mask"', NULL, [[:digit:]]+\) += 0' -osf_sigprocmask='osf_sigprocmask\(SIG_SETMASK, '"$mask"'\) += 0 +\(old mask \[[^]]*\]\)' -EXPECTED="$LOG.expected" - -cat > "$EXPECTED" << __EOF__ -$rt_sigprocmask|$osf_sigprocmask -(rt_)?sigreturn\\((\\{mask=$mask\\})?\\) += 0 -__EOF__ - -match_grep "$LOG" "$EXPECTED" -rm -f "$EXPECTED" - -exit 0 diff --git a/tests/sigsuspend.c b/tests/sigsuspend.c new file mode 100644 index 00000000..11ffae83 --- /dev/null +++ b/tests/sigsuspend.c @@ -0,0 +1,97 @@ +/* + * Check decoding of sigsuspend syscall. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_sigsuspend + +# include +# include +# include +# include +# include +# include +# include + +# ifdef MIPS +# define SIGNAL_MASK_BY_REF 1 +# else +# define SIGNAL_MASK_BY_REF 0 +# endif + +static long +k_sigsuspend(const kernel_ulong_t arg1, + const kernel_ulong_t arg2, + const kernel_ulong_t arg3) +{ + return syscall(__NR_sigsuspend, arg1, arg2, arg3); +} + +static int signo; +static const char *sigtxt[] = { + [SIGUSR1] = "USR1", + [SIGUSR2] = "USR2" +}; + +static void +handler(int i) +{ + signo = i; +} + +int +main(void) +{ + union { + sigset_t libc_mask; + unsigned long old_mask; + } u; + + sigemptyset(&u.libc_mask); + sigaddset(&u.libc_mask, SIGUSR1); + sigaddset(&u.libc_mask, SIGUSR2); + if (sigprocmask(SIG_SETMASK, &u.libc_mask, NULL)) + perror_msg_and_fail("sigprocmask"); + + const struct sigaction sa = { .sa_handler = handler }; + if (sigaction(SIGUSR1, &sa, NULL) || sigaction(SIGUSR2, &sa, NULL)) + perror_msg_and_fail("sigaction"); + + raise(SIGUSR1); + raise(SIGUSR2); + + u.old_mask = -1UL; + sigdelset(&u.libc_mask, SIGUSR1); + const unsigned long mask1 = u.old_mask; + + u.old_mask = -1UL; + sigdelset(&u.libc_mask, SIGUSR2); + const unsigned long mask2 = u.old_mask; + +# if SIGNAL_MASK_BY_REF + k_sigsuspend((uintptr_t) &mask1, 0xdeadbeef, (uintptr_t) &mask2); +# else + k_sigsuspend(mask1, 0xdeadbeef, mask2); +# endif + if (EINTR != errno) + perror_msg_and_skip("sigsuspend"); + + printf("sigsuspend(~[%s]) = ? ERESTARTNOHAND" + " (To be restarted if no handler)\n", sigtxt[signo]); + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sigsuspend") + +#endif diff --git a/tests/sigsuspend.gen.test b/tests/sigsuspend.gen.test new file mode 100755 index 00000000..afd0207e --- /dev/null +++ b/tests/sigsuspend.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sigsuspend -a19 -esignal=none); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a19 -esignal=none diff --git a/tests/skip_unavailable.c b/tests/skip_unavailable.c new file mode 100644 index 00000000..761a10c3 --- /dev/null +++ b/tests/skip_unavailable.c @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include + +void +skip_if_unavailable(const char *const path) +{ + struct stat st; + + if (stat(path, &st)) + perror_msg_and_skip("stat: %s", path); +} diff --git a/tests/sleep.c b/tests/sleep.c index f4bce3cd..0cdfcebc 100644 --- a/tests/sleep.c +++ b/tests/sleep.c @@ -1,30 +1,10 @@ /* * A simple nanosleep based sleep(1) replacement. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/so_error.c b/tests/so_error.c new file mode 100644 index 00000000..2592a3c1 --- /dev/null +++ b/tests/so_error.c @@ -0,0 +1,103 @@ +/* + * Check decoding of SO_ERROR socket option. + * + * Copyright (c) 2018 Masatake YAMATO + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +static in_port_t +reserve_ephemeral_port(void) +{ + int sd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + if (sd < 0) + perror_msg_and_skip("server socket AF_UNIX SOCK_STREAM"); + + struct sockaddr_in addr = { + .sin_family = AF_INET, + .sin_addr.s_addr = htonl(INADDR_LOOPBACK), + }; + + /* + * The range is defined in /proc/sys/net/ipv4/ip_local_port_range. + * We use the default range here. + */ + for (in_port_t port = 49152; port < 61000; port++) { + /* Just bind here. No listen. */ + addr.sin_port = htons(port); + if (bind(sd, &addr, sizeof(addr)) == 0) + return port; + } + error_msg_and_skip("no ephemeral port available for test purposes"); +} + +int +main(void) +{ + in_port_t port = reserve_ephemeral_port (); + + /* + * Connect to the reserved port in NONBLOCK mode. + * The port is reserved but not listened. So + * the client doing "connect" gets error asynchronously. + */ + int fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + if (fd < 0) + perror_msg_and_skip("socket AF_UNIX SOCK_STREAM"); + + int flag = fcntl(fd, F_GETFL); + if (flag < 0) + perror_msg_and_skip("fcntl F_GETFL"); + flag |= O_NONBLOCK; + if (fcntl(fd, F_SETFL, flag) < 0) + perror_msg_and_skip("fcntl F_SETFL"); + + struct sockaddr_in addr = { + .sin_family = AF_INET, + .sin_addr.s_addr = htonl(INADDR_LOOPBACK), + .sin_port = htons(port), + }; + if (connect(fd, &addr, sizeof(addr)) == 0) + error_msg_and_skip("connect unexpectedly succeeded"); + if (errno != EINPROGRESS) + perror_msg_and_skip("connect failed for unexpected reason"); + + struct timeval to = { + .tv_sec = 1, + .tv_usec = 0, + }; + fd_set wfds; + FD_ZERO(&wfds); + FD_SET(fd, &wfds); + if (select(fd + 1, NULL, &wfds, NULL, &to) < 0) + perror_msg_and_skip("select"); + + int sock_errno; + socklen_t optlen = sizeof(sock_errno); + if (getsockopt(fd, SOL_SOCKET, SO_ERROR, &sock_errno, &optlen) < 0) + perror_msg_and_skip("getsockopt"); + if (sock_errno != ECONNREFUSED) { + errno = sock_errno; + perror_msg_and_skip("unexpected socket error"); + } + if (optlen != sizeof(sock_errno)) + error_msg_and_skip("unexpected data size for error option: %d", + optlen); + + printf("getsockopt(%d, SOL_SOCKET, SO_ERROR, [ECONNREFUSED], [%u]) = 0\n", + fd, optlen); + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/so_error.gen.test b/tests/so_error.gen.test new file mode 100755 index 00000000..9083e4d4 --- /dev/null +++ b/tests/so_error.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (so_error -e trace=getsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt diff --git a/tests/so_linger.c b/tests/so_linger.c new file mode 100644 index 00000000..b10fa067 --- /dev/null +++ b/tests/so_linger.c @@ -0,0 +1,161 @@ +/* + * Check decoding of SO_LINGER socket option. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +static const char *errstr; + +static int +get_linger(int fd, void *val, socklen_t *len) +{ + int rc = getsockopt(fd, SOL_SOCKET, SO_LINGER, val, len); + errstr = sprintrc(rc); + return rc; +} + +static int +set_linger(int fd, void *val, socklen_t len) +{ + int rc = setsockopt(fd, SOL_SOCKET, SO_LINGER, val, len); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct linger, linger); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); + + const unsigned int sizeof_l_onoff = sizeof(linger->l_onoff); + struct linger *const l_onoff = tail_alloc(sizeof_l_onoff); + + const unsigned int sizeof_l_onoff_truncated = sizeof_l_onoff - 1; + struct linger *const l_onoff_truncated = + tail_alloc(sizeof_l_onoff_truncated); + + const unsigned int sizeof_l_linger_truncated = + offsetofend(struct linger, l_linger) - 1; + struct linger *const l_linger_truncated = + tail_alloc(sizeof_l_linger_truncated); + + int fd = socket(AF_UNIX, SOCK_STREAM, 0); + if (fd < 0) + perror_msg_and_skip("socket AF_UNIX SOCK_STREAM"); + + /* classic getsockopt */ + *len = sizeof(*linger); + get_linger(fd, linger, len); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, {l_onoff=%d, l_linger=%d}" + ", [%d]) = %s\n", + fd, linger->l_onoff, linger->l_linger, *len, errstr); + + /* classic setsockopt */ + linger->l_onoff = -15; + linger->l_linger = -42; + set_linger(fd, linger, sizeof(*linger)); + printf("setsockopt(%d, SOL_SOCKET, SO_LINGER, {l_onoff=%d, l_linger=%d}" + ", %d) = %s\n", + fd, linger->l_onoff, linger->l_linger, + (unsigned int) sizeof(*linger), errstr); + + /* setsockopt with optlen larger than necessary */ + set_linger(fd, linger, sizeof(*linger) + 1); + printf("setsockopt(%d, SOL_SOCKET, SO_LINGER, {l_onoff=%d, l_linger=%d}" + ", %d) = %s\n", + fd, linger->l_onoff, linger->l_linger, + (unsigned int) sizeof(*linger) + 1, errstr); + + /* setsockopt with optlen < 0 - EINVAL */ + set_linger(fd, linger, -1U); + printf("setsockopt(%d, SOL_SOCKET, SO_LINGER, %p, -1) = %s\n", + fd, linger, errstr); + + /* setsockopt with optlen smaller than necessary - EINVAL */ + set_linger(fd, linger, sizeof(linger->l_onoff)); + printf("setsockopt(%d, SOL_SOCKET, SO_LINGER, %p, %d) = %s\n", + fd, linger, (unsigned int) sizeof(linger->l_onoff), errstr); + + /* setsockopt optval EFAULT */ + set_linger(fd, &linger->l_linger, sizeof(*linger)); + printf("setsockopt(%d, SOL_SOCKET, SO_LINGER, %p, %d) = %s\n", + fd, &linger->l_linger, (unsigned int) sizeof(*linger), errstr); + + /* getsockopt with zero optlen */ + *len = 0; + get_linger(fd, linger, len); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, %p, [0]) = %s\n", + fd, linger, errstr); + + /* getsockopt with optlen larger than necessary - shortened */ + *len = sizeof(*linger) + 1; + get_linger(fd, linger, len); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, {l_onoff=%d, l_linger=%d}" + ", [%u->%d]) = %s\n", + fd, linger->l_onoff, linger->l_linger, + (unsigned int) sizeof(*linger) + 1, *len, errstr); + + /* + * getsockopt with optlen less than sizeof(linger->l_onoff): + * the part of struct linger.l_onoff is printed in hex. + */ + *len = sizeof_l_onoff_truncated; + get_linger(fd, l_onoff_truncated, len); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, {l_onoff=", fd); + print_quoted_hex(l_onoff_truncated, *len); + printf("}, [%d]) = %s\n", *len, errstr); + + /* + * getsockopt with optlen equals to sizeof(struct linger.l_onoff): + * struct linger.l_linger is not printed. + */ + *len = sizeof_l_onoff; + get_linger(fd, l_onoff, len); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, {l_onoff=%d}" + ", [%d]) = %s\n", + fd, l_onoff->l_onoff, *len, errstr); + + /* + * getsockopt with optlen greater than sizeof(struct linger.l_onoff) + * but smaller than sizeof(struct linger): + * the part of struct linger.l_linger is printed in hex. + */ + *len = sizeof_l_linger_truncated; + get_linger(fd, l_linger_truncated, len); + /* + * Copy to a properly aligned structure to avoid unaligned access + * to struct linger.l_onoff field. + */ + memcpy(linger, l_linger_truncated, sizeof_l_linger_truncated); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, {l_onoff=%d, l_linger=", + fd, linger->l_onoff); + print_quoted_hex(&linger->l_linger, sizeof_l_linger_truncated - + offsetof(struct linger, l_linger)); + printf("}, [%d]) = %s\n", *len, errstr); + + /* getsockopt optval EFAULT */ + *len = sizeof(*linger); + get_linger(fd, &linger->l_linger, len); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, %p, [%d]) = %s\n", + fd, &linger->l_linger, *len, errstr); + + /* getsockopt optlen EFAULT */ + get_linger(fd, linger, len + 1); + printf("getsockopt(%d, SOL_SOCKET, SO_LINGER, %p, %p) = %s\n", + fd, linger, len + 1, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/so_linger.gen.test b/tests/so_linger.gen.test new file mode 100755 index 00000000..8362163a --- /dev/null +++ b/tests/so_linger.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (so_linger -e trace=getsockopt,setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt,setsockopt diff --git a/tests/so_peercred-Xabbrev.c b/tests/so_peercred-Xabbrev.c new file mode 100644 index 00000000..a7056a66 --- /dev/null +++ b/tests/so_peercred-Xabbrev.c @@ -0,0 +1 @@ +#include "so_peercred.c" diff --git a/tests/so_peercred-Xabbrev.gen.test b/tests/so_peercred-Xabbrev.gen.test new file mode 100755 index 00000000..64a5538b --- /dev/null +++ b/tests/so_peercred-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (so_peercred-Xabbrev -e trace=getsockopt -Xabbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt -Xabbrev diff --git a/tests/so_peercred-Xraw.c b/tests/so_peercred-Xraw.c new file mode 100644 index 00000000..e45f2df4 --- /dev/null +++ b/tests/so_peercred-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "so_peercred.c" diff --git a/tests/so_peercred-Xraw.gen.test b/tests/so_peercred-Xraw.gen.test new file mode 100755 index 00000000..471ae599 --- /dev/null +++ b/tests/so_peercred-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (so_peercred-Xraw -e trace=getsockopt -Xraw -a39); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt -Xraw -a39 diff --git a/tests/so_peercred-Xverbose.c b/tests/so_peercred-Xverbose.c new file mode 100644 index 00000000..1bb47e98 --- /dev/null +++ b/tests/so_peercred-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "so_peercred.c" diff --git a/tests/so_peercred-Xverbose.gen.test b/tests/so_peercred-Xverbose.gen.test new file mode 100755 index 00000000..2926517b --- /dev/null +++ b/tests/so_peercred-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (so_peercred-Xverbose -e trace=getsockopt -Xverbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt -Xverbose diff --git a/tests/so_peercred.c b/tests/so_peercred.c new file mode 100644 index 00000000..151bb175 --- /dev/null +++ b/tests/so_peercred.c @@ -0,0 +1,190 @@ +/* + * Check decoding of SO_PEERCRED socket option. + * + * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +#include "print_fields.h" + +static const char *errstr; + +static int +get_peercred(int fd, void *val, socklen_t *len) +{ + int rc = getsockopt(fd, SOL_SOCKET, SO_PEERCRED, val, len); + errstr = sprintrc(rc); + return rc; +} + +static const char * +so_str(void) +{ + static char buf[256]; + + if (!buf[0]) { +#if XLAT_RAW + snprintf(buf, sizeof(buf), + "%#x, %#x", SOL_SOCKET, SO_PEERCRED); +#elif XLAT_VERBOSE + snprintf(buf, sizeof(buf), + "%#x /* SOL_SOCKET */, %#x /* SO_PEERCRED */", + SOL_SOCKET, SO_PEERCRED); +#else + snprintf(buf, sizeof(buf), + "SOL_SOCKET, SO_PEERCRED"); +#endif + } + + return buf; +} + +int +main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct ucred, peercred); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); + + const unsigned int sizeof_pid = sizeof(peercred->pid); + struct ucred *const pid = tail_alloc(sizeof_pid); + + const unsigned int sizeof_pid_truncated = sizeof_pid - 1; + struct ucred *const pid_truncated = + tail_alloc(sizeof_pid_truncated); + + const unsigned int sizeof_uid = offsetofend(struct ucred, uid); + struct ucred *const uid = tail_alloc(sizeof_uid); + + const unsigned int sizeof_uid_truncated = sizeof_uid - 1; + struct ucred *const uid_truncated = + tail_alloc(sizeof_uid_truncated); + + const unsigned int sizeof_gid_truncated = + offsetofend(struct ucred, gid) - 1; + struct ucred *const gid_truncated = + tail_alloc(sizeof_gid_truncated); + + int sv[2]; + if (socketpair(AF_UNIX, SOCK_STREAM, 0, sv)) + perror_msg_and_skip("socketpair AF_UNIX SOCK_STREAM"); + + /* classic getsockopt */ + *len = sizeof(*peercred); + get_peercred(sv[0], peercred, len); + printf("getsockopt(%d, %s", sv[0], so_str()); + PRINT_FIELD_D(", {", *peercred, pid); + PRINT_FIELD_UID(", ", *peercred, uid); + PRINT_FIELD_UID(", ", *peercred, gid); + printf("}, [%d]) = %s\n", *len, errstr); + + /* getsockopt with zero optlen */ + *len = 0; + get_peercred(sv[0], peercred, len); + printf("getsockopt(%d, %s, %p, [0]) = %s\n", + sv[0], so_str(), peercred, errstr); + + /* getsockopt with optlen larger than necessary - shortened */ + *len = sizeof(*peercred) + 1; + get_peercred(sv[0], peercred, len); + printf("getsockopt(%d, %s", sv[0], so_str()); + PRINT_FIELD_D(", {", *peercred, pid); + PRINT_FIELD_UID(", ", *peercred, uid); + PRINT_FIELD_UID(", ", *peercred, gid); + printf("}, [%u->%d]) = %s\n", + (unsigned int) sizeof(*peercred) + 1, *len, errstr); + + /* + * getsockopt with optlen less than offsetofend(struct ucred, pid): + * the part of struct ucred.pid is printed in hex. + */ + *len = sizeof_pid_truncated; + get_peercred(sv[0], pid_truncated, len); + printf("getsockopt(%d, %s, {pid=", sv[0], so_str()); + print_quoted_hex(pid_truncated, *len); + printf("}, [%d]) = %s\n", *len, errstr); + + /* + * getsockopt with optlen equals to sizeof(struct ucred.pid): + * struct ucred.uid and struct ucred.gid are not printed. + */ + *len = sizeof_pid; + get_peercred(sv[0], pid, len); + printf("getsockopt(%d, %s", sv[0], so_str()); + PRINT_FIELD_D(", {", *pid, pid); + printf("}, [%d]) = %s\n", *len, errstr); + + /* + * getsockopt with optlen greater than sizeof(struct ucred.pid) + * but smaller than offsetofend(struct ucred, uid): + * the part of struct ucred.uid is printed in hex. + */ + *len = sizeof_uid_truncated; + get_peercred(sv[0], uid_truncated, len); + /* + * Copy to a properly aligned structure to avoid unaligned access + * to struct ucred.pid field. + */ + memcpy(uid, uid_truncated, sizeof_uid_truncated); + printf("getsockopt(%d, %s", sv[0], so_str()); + PRINT_FIELD_D(", {", *uid, pid); + printf(", uid="); + print_quoted_hex(&uid->uid, sizeof_uid_truncated - + offsetof(struct ucred, uid)); + printf("}, [%d]) = %s\n", *len, errstr); + + /* + * getsockopt with optlen equals to offsetofend(struct ucred, uid): + * struct ucred.gid is not printed. + */ + *len = sizeof_uid; + get_peercred(sv[0], uid, len); + printf("getsockopt(%d, %s", sv[0], so_str()); + PRINT_FIELD_D(", {", *uid, pid); + PRINT_FIELD_UID(", ", *uid, uid); + printf("}, [%d]) = %s\n", *len, errstr); + + /* + * getsockopt with optlen greater than sizeof(struct ucred.uid) + * but smaller than offsetofend(struct ucred, gid): + * the part of struct ucred.gid is printed in hex. + */ + *len = sizeof_gid_truncated; + get_peercred(sv[0], gid_truncated, len); + /* + * Copy to a properly aligned structure to avoid unaligned access + * to struct ucred.pid and struct ucred.uid fields. + */ + memcpy(peercred, gid_truncated, sizeof_gid_truncated); + printf("getsockopt(%d, %s", sv[0], so_str()); + PRINT_FIELD_D(", {", *peercred, pid); + PRINT_FIELD_UID(", ", *peercred, uid); + printf(", gid="); + print_quoted_hex(&peercred->gid, sizeof_gid_truncated - + offsetof(struct ucred, gid)); + printf("}, [%d]) = %s\n", *len, errstr); + + /* getsockopt optval EFAULT */ + *len = sizeof(*peercred); + get_peercred(sv[0], &peercred->uid, len); + printf("getsockopt(%d, %s, %p, [%d]) = %s\n", + sv[0], so_str(), &peercred->uid, *len, errstr); + + /* getsockopt optlen EFAULT */ + get_peercred(sv[0], peercred, len + 1); + printf("getsockopt(%d, %s, %p, %p) = %s\n", + sv[0], so_str(), peercred, len + 1, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/so_peercred.gen.test b/tests/so_peercred.gen.test new file mode 100755 index 00000000..02eb4793 --- /dev/null +++ b/tests/so_peercred.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (so_peercred -e trace=getsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt diff --git a/tests/sock_filter-v-Xabbrev.c b/tests/sock_filter-v-Xabbrev.c new file mode 100644 index 00000000..ac680e2c --- /dev/null +++ b/tests/sock_filter-v-Xabbrev.c @@ -0,0 +1 @@ +#include "sock_filter-v.c" diff --git a/tests/sock_filter-v-Xabbrev.gen.test b/tests/sock_filter-v-Xabbrev.gen.test new file mode 100755 index 00000000..e52763fa --- /dev/null +++ b/tests/sock_filter-v-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sock_filter-v-Xabbrev -v -e trace=getsockopt,setsockopt -X abbrev); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=getsockopt,setsockopt -X abbrev diff --git a/tests/sock_filter-v-Xraw.c b/tests/sock_filter-v-Xraw.c new file mode 100644 index 00000000..e85309c1 --- /dev/null +++ b/tests/sock_filter-v-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "sock_filter-v.c" diff --git a/tests/sock_filter-v-Xraw.gen.test b/tests/sock_filter-v-Xraw.gen.test new file mode 100755 index 00000000..3c7df814 --- /dev/null +++ b/tests/sock_filter-v-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sock_filter-v-Xraw -a 37 -v -e trace=getsockopt,setsockopt -X raw); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a 37 -v -e trace=getsockopt,setsockopt -X raw diff --git a/tests/sock_filter-v-Xverbose.c b/tests/sock_filter-v-Xverbose.c new file mode 100644 index 00000000..59d76bdf --- /dev/null +++ b/tests/sock_filter-v-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "sock_filter-v.c" diff --git a/tests/sock_filter-v-Xverbose.gen.test b/tests/sock_filter-v-Xverbose.gen.test new file mode 100755 index 00000000..b58c5b51 --- /dev/null +++ b/tests/sock_filter-v-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sock_filter-v-Xverbose -v -e trace=getsockopt,setsockopt -X verbose); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=getsockopt,setsockopt -X verbose diff --git a/tests/sock_filter-v.c b/tests/sock_filter-v.c new file mode 100644 index 00000000..ac483646 --- /dev/null +++ b/tests/sock_filter-v.c @@ -0,0 +1,211 @@ +/* + * Check decoding of socket filters. + * + * Copyright (c) 2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include + +/* SO_GET_FILTER was introduced by Linux commit v3.8-rc1~139^2~518 */ +#ifndef SO_GET_FILTER +# define SO_GET_FILTER SO_ATTACH_FILTER +#endif + +#define HEX_FMT "%#x" + +#if XLAT_RAW +# define XLAT_FMT HEX_FMT +# define XLAT_ARGS(a_) (a_) +#elif XLAT_VERBOSE +# define XLAT_FMT HEX_FMT " /* %s */" +# define XLAT_ARGS(a_) (a_), #a_ +#else +# define XLAT_FMT "%s" +# define XLAT_ARGS(a_) #a_ +#endif + +#define PRINT_STMT(pfx, code_fmt, k_fmt, ...) \ + printf("%sBPF_STMT(" code_fmt ", " k_fmt ")", pfx, __VA_ARGS__) + +#define PRINT_JUMP(pfx, code_fmt, k, jt, jf, ...) \ + printf("%sBPF_JUMP(" code_fmt ", %#x, %#x, %#x)", \ + pfx, __VA_ARGS__, k, jt, jf) + +static const struct sock_filter bpf_filter[] = { + BPF_STMT(BPF_LD|BPF_B|BPF_ABS, SKF_LL_OFF+4), + BPF_STMT(BPF_LD|BPF_B|BPF_ABS, SKF_NET_OFF+8), + BPF_STMT(BPF_LD|BPF_B|BPF_ABS, SKF_AD_OFF+SKF_AD_PROTOCOL), + BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, IPPROTO_UDP, 0, 5), + BPF_STMT(BPF_LD|BPF_W|BPF_LEN, 0), + BPF_JUMP(BPF_JMP|BPF_K|BPF_JGE, 100, 0, 3), + BPF_STMT(BPF_LD|BPF_B|BPF_ABS, 42), + BPF_JUMP(BPF_JMP|BPF_K|BPF_JEQ, 'a', 0, 1), + BPF_STMT(BPF_RET|BPF_K, -1U), + BPF_STMT(BPF_RET|BPF_K, 0) +}; + +static void +print_filter(void) +{ + PRINT_STMT("[", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + XLAT_FMT "+4", + XLAT_ARGS(BPF_LD), XLAT_ARGS(BPF_B), XLAT_ARGS(BPF_ABS), + XLAT_ARGS(SKF_LL_OFF)); + PRINT_STMT(", ", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + XLAT_FMT "+8", + XLAT_ARGS(BPF_LD), XLAT_ARGS(BPF_B), XLAT_ARGS(BPF_ABS), + XLAT_ARGS(SKF_NET_OFF)); + PRINT_STMT(", ", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + XLAT_FMT "+" XLAT_FMT, + XLAT_ARGS(BPF_LD), XLAT_ARGS(BPF_B), XLAT_ARGS(BPF_ABS), + XLAT_ARGS(SKF_AD_OFF), XLAT_ARGS(SKF_AD_PROTOCOL)); + PRINT_JUMP(", ", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + IPPROTO_UDP, 0, 5, + XLAT_ARGS(BPF_JMP), XLAT_ARGS(BPF_K), XLAT_ARGS(BPF_JEQ)); + PRINT_STMT(", ", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + HEX_FMT, + XLAT_ARGS(BPF_LD), XLAT_ARGS(BPF_W), XLAT_ARGS(BPF_LEN), + 0); + PRINT_JUMP(", ", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + 100, 0, 3, + XLAT_ARGS(BPF_JMP), XLAT_ARGS(BPF_K), XLAT_ARGS(BPF_JGE)); + PRINT_STMT(", ", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + HEX_FMT, + XLAT_ARGS(BPF_LD), XLAT_ARGS(BPF_B), XLAT_ARGS(BPF_ABS), + 42); + PRINT_JUMP(", ", XLAT_FMT "|" XLAT_FMT "|" XLAT_FMT, + 'a', 0, 1, + XLAT_ARGS(BPF_JMP), XLAT_ARGS(BPF_K), XLAT_ARGS(BPF_JEQ)); + PRINT_STMT(", ", XLAT_FMT "|" XLAT_FMT, + HEX_FMT, + XLAT_ARGS(BPF_RET), XLAT_ARGS(BPF_K), + -1U); + PRINT_STMT(", ", XLAT_FMT "|" XLAT_FMT, + HEX_FMT, + XLAT_ARGS(BPF_RET), XLAT_ARGS(BPF_K), + 0); + putchar(']'); +} + +static const char *errstr; + +static int +get_filter(int fd, void *val, socklen_t *len) +{ + int rc = getsockopt(fd, SOL_SOCKET, SO_GET_FILTER, val, len); + errstr = sprintrc(rc); + return rc; +} + +static int +set_filter(int fd, void *val, socklen_t len) +{ + int rc = setsockopt(fd, SOL_SOCKET, SO_ATTACH_FILTER, val, len); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + int rc; + struct sock_filter *const filter = + tail_memdup(bpf_filter, sizeof(bpf_filter)); + void *const efault = filter + ARRAY_SIZE(bpf_filter); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sock_fprog, prog); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); + + prog->len = ARRAY_SIZE(bpf_filter); + prog->filter = filter; + + int fd = socket(AF_INET, SOCK_DGRAM, 0); + if (fd < 0) + perror_msg_and_skip("socket AF_INET SOCK_DGRAM"); + + /* query sock_filter program length -> 0 */ + *len = BPF_MAXINSNS; + rc = get_filter(fd, NULL, len); + if (rc) + perror_msg_and_skip("getsockopt SOL_SOCKET SO_GET_FILTER"); + printf("getsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", NULL, [%u->0]) " + "= 0\n", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_GET_FILTER), + BPF_MAXINSNS); + + /* getsockopt NULL optlen - EFAULT */ + rc = get_filter(fd, NULL, NULL); + printf("getsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", NULL, NULL) " + "= %s\n", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_GET_FILTER), errstr); + + /* attach a filter */ + rc = set_filter(fd, prog, sizeof(*prog)); + if (rc) + perror_msg_and_skip("setsockopt SOL_SOCKET SO_ATTACH_FILTER"); + printf("setsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", {len=%u, filter=", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_ATTACH_FILTER), + prog->len); + print_filter(); + printf("}, %u) = 0\n", (unsigned int) sizeof(*prog)); + + /* setsockopt optlen is too small - EINVAL */ + rc = set_filter(fd, prog, sizeof(*prog) - 4); + printf("setsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", %p, %u) = %s\n", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_ATTACH_FILTER), prog, + (unsigned int) sizeof(*prog) - 4, errstr); + +#ifdef SO_ATTACH_REUSEPORT_CBPF + rc = setsockopt(fd, SOL_SOCKET, SO_ATTACH_REUSEPORT_CBPF, + prog, sizeof(*prog)); + errstr = sprintrc(rc); + printf("setsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", {len=%u, filter=", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_ATTACH_REUSEPORT_CBPF), + prog->len); + print_filter(); + printf("}, %u) = %s\n", (unsigned int) sizeof(*prog), errstr); +#endif + + /* query sock_filter program length -> ARRAY_SIZE(bpf_filter) */ + *len = 0; + rc = get_filter(fd, efault, len); + printf("getsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", %p, [0->%u]) " + "= %s\n", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_GET_FILTER), efault, + (unsigned int) ARRAY_SIZE(bpf_filter), errstr); + + /* getsockopt optlen is too small - EINVAL */ + *len = ARRAY_SIZE(bpf_filter) - 1; + rc = get_filter(fd, efault, len); + printf("getsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", %p, [%u]) = %s\n", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_GET_FILTER), efault, + (unsigned int) ARRAY_SIZE(bpf_filter) - 1, errstr); + + /* getsockopt optval EFAULT */ + *len = ARRAY_SIZE(bpf_filter); + rc = get_filter(fd, filter + 1, len); + printf("getsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", %p, [%u]) = %s\n", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_GET_FILTER), + filter + 1, (unsigned int) ARRAY_SIZE(bpf_filter), errstr); + + /* getsockopt optlen is too large - truncated */ + *len = ARRAY_SIZE(bpf_filter) + 1; + rc = get_filter(fd, filter, len); + printf("getsockopt(%d, " XLAT_FMT ", " XLAT_FMT ", ", + fd, XLAT_ARGS(SOL_SOCKET), XLAT_ARGS(SO_GET_FILTER)); + print_filter(); + printf(", [%u->%d]) = %s\n", + (unsigned int) ARRAY_SIZE(bpf_filter) + 1, *len, errstr); + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/sock_filter-v.gen.test b/tests/sock_filter-v.gen.test new file mode 100755 index 00000000..611c2de9 --- /dev/null +++ b/tests/sock_filter-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sock_filter-v -v -e trace=getsockopt,setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e trace=getsockopt,setsockopt diff --git a/tests/sockaddr_xlat-Xabbrev.c b/tests/sockaddr_xlat-Xabbrev.c new file mode 100644 index 00000000..e994e5ea --- /dev/null +++ b/tests/sockaddr_xlat-Xabbrev.c @@ -0,0 +1 @@ +#include "sockaddr_xlat.c" diff --git a/tests/sockaddr_xlat-Xabbrev.gen.test b/tests/sockaddr_xlat-Xabbrev.gen.test new file mode 100755 index 00000000..efdf0ac7 --- /dev/null +++ b/tests/sockaddr_xlat-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sockaddr_xlat-Xabbrev -Xabbrev -e trace=connect); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xabbrev -e trace=connect diff --git a/tests/sockaddr_xlat-Xraw.c b/tests/sockaddr_xlat-Xraw.c new file mode 100644 index 00000000..fb2d73df --- /dev/null +++ b/tests/sockaddr_xlat-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "sockaddr_xlat.c" diff --git a/tests/sockaddr_xlat-Xraw.gen.test b/tests/sockaddr_xlat-Xraw.gen.test new file mode 100755 index 00000000..d5339a7b --- /dev/null +++ b/tests/sockaddr_xlat-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sockaddr_xlat-Xraw -Xraw -e trace=connect); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xraw -e trace=connect diff --git a/tests/sockaddr_xlat-Xverbose.c b/tests/sockaddr_xlat-Xverbose.c new file mode 100644 index 00000000..d628975b --- /dev/null +++ b/tests/sockaddr_xlat-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "sockaddr_xlat.c" diff --git a/tests/sockaddr_xlat-Xverbose.gen.test b/tests/sockaddr_xlat-Xverbose.gen.test new file mode 100755 index 00000000..bde087b1 --- /dev/null +++ b/tests/sockaddr_xlat-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sockaddr_xlat-Xverbose -Xverbose -e trace=connect); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -Xverbose -e trace=connect diff --git a/tests/sockaddr_xlat.c b/tests/sockaddr_xlat.c new file mode 100644 index 00000000..b467c934 --- /dev/null +++ b/tests/sockaddr_xlat.c @@ -0,0 +1,271 @@ +/* + * Check decoding of sockaddr fields under xlat styles. + * + * Copyright (c) 2015-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ +#include "tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_BLUETOOTH_BLUETOOTH_H +# include +# include +# include +# include +# include +#endif + +static void +check_ll(void) +{ + struct sockaddr_ll c_ll = { + .sll_family = AF_PACKET, + .sll_protocol = htons(ETH_P_ALL), + .sll_ifindex = 0xfacefeed, + .sll_hatype = ARPHRD_ETHER, + .sll_pkttype = PACKET_HOST, + .sll_halen = sizeof(c_ll.sll_addr), + .sll_addr = "abcdefgh" + }; + unsigned int len = sizeof(c_ll); + int rc = connect(-1, (void *) &c_ll, len); + const char *errstr = sprintrc(rc); + +#if XLAT_RAW + printf("connect(-1, {sa_family=%#x, sll_protocol=", AF_PACKET); + print_quoted_hex(&c_ll.sll_protocol, sizeof(c_ll.sll_protocol)); + printf(", sll_ifindex=%u, sll_hatype=%#x" + ", sll_pkttype=%u, sll_halen=%u, sll_addr=" + "[%#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x]" + "}, %u) = %s\n", + c_ll.sll_ifindex, ARPHRD_ETHER, + PACKET_HOST, c_ll.sll_halen, + c_ll.sll_addr[0], c_ll.sll_addr[1], + c_ll.sll_addr[2], c_ll.sll_addr[3], + c_ll.sll_addr[4], c_ll.sll_addr[5], + c_ll.sll_addr[6], c_ll.sll_addr[7], + len, errstr); +#elif XLAT_VERBOSE + printf("connect(-1, {sa_family=%#x /* AF_PACKET */" + ", sll_protocol=", AF_PACKET); + print_quoted_hex(&c_ll.sll_protocol, sizeof(c_ll.sll_protocol)); + printf(" /* htons(ETH_P_ALL) */" + ", sll_ifindex=%u, sll_hatype=%#x /* ARPHRD_ETHER */" + ", sll_pkttype=%u /* PACKET_HOST */, sll_halen=%u, sll_addr=" + "[%#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x]" + "}, %u) = %s\n", + c_ll.sll_ifindex, ARPHRD_ETHER, + PACKET_HOST, c_ll.sll_halen, + c_ll.sll_addr[0], c_ll.sll_addr[1], + c_ll.sll_addr[2], c_ll.sll_addr[3], + c_ll.sll_addr[4], c_ll.sll_addr[5], + c_ll.sll_addr[6], c_ll.sll_addr[7], + len, errstr); + +#else /* XLAT_ABBREV */ + printf("connect(-1, {sa_family=AF_PACKET" + ", sll_protocol=htons(ETH_P_ALL)" + ", sll_ifindex=%u, sll_hatype=ARPHRD_ETHER" + ", sll_pkttype=PACKET_HOST, sll_halen=%u, sll_addr=" + "[%#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x, %#02x]" + "}, %u) = %s\n", + c_ll.sll_ifindex, c_ll.sll_halen, + c_ll.sll_addr[0], c_ll.sll_addr[1], + c_ll.sll_addr[2], c_ll.sll_addr[3], + c_ll.sll_addr[4], c_ll.sll_addr[5], + c_ll.sll_addr[6], c_ll.sll_addr[7], + len, errstr); +#endif +} + +static void +check_in(void) +{ + const unsigned short h_port = 12345; + static const char h_addr[] = "127.0.0.1"; + struct sockaddr_in in = { + .sin_family = AF_INET, + .sin_port = htons(h_port), + .sin_addr.s_addr = inet_addr(h_addr) + }; + unsigned int len = sizeof(in); + int rc = connect(-1, (void *) &in, len); + const char * errstr = sprintrc(rc); +#if XLAT_RAW + printf("connect(-1, {sa_family=%#x, sin_port=", AF_INET); + print_quoted_hex((const void *) &in.sin_port, sizeof(in.sin_port)); + printf(", sin_addr="); + print_quoted_hex((const void *) &in.sin_addr.s_addr, + sizeof(in.sin_addr.s_addr)); + printf("}, %u) = %s\n", len, errstr); +#elif XLAT_VERBOSE + printf("connect(-1, {sa_family=%#x /* AF_INET */, sin_port=", AF_INET); + print_quoted_hex((const void *) &in.sin_port, sizeof(in.sin_port)); + printf(" /* htons(%hu) */, sin_addr=", h_port); + print_quoted_hex((const void *) &in.sin_addr.s_addr, + sizeof(in.sin_addr.s_addr)); + printf(" /* inet_addr(\"%s\") */}, %u) = %s\n", + h_addr, len, errstr); +#else /* XLAT_ABBREV */ + printf("connect(-1, {sa_family=AF_INET, sin_port=htons(%hu)" + ", sin_addr=inet_addr(\"%s\")}, %u) = %s\n", + h_port, h_addr, len, errstr); +#endif +} + +static void +validate_in6(struct sockaddr_in6 *const in6, const char *const h_addr) +{ + inet_pton(AF_INET6, h_addr, &in6->sin6_addr); + + unsigned int len = sizeof(*in6); + int rc = connect(-1, (void *) in6, len); + const char *errstr = sprintrc(rc); +#if XLAT_RAW + printf("connect(-1, {sa_family=%#x, sin6_port=", AF_INET6); + print_quoted_hex(&in6->sin6_port, sizeof(in6->sin6_port)); + printf(", sin6_flowinfo="); + print_quoted_hex(&in6->sin6_flowinfo, sizeof(in6->sin6_flowinfo)); + printf(", sin6_addr="); + print_quoted_hex(&in6->sin6_addr, sizeof(struct in6_addr)); + printf(", sin6_scope_id=%u}, %u) = %s\n", + in6->sin6_scope_id, len, errstr); +#elif XLAT_VERBOSE + printf("connect(-1, {sa_family=%#x /* AF_INET6 */", AF_INET6); + printf(", sin6_port="); + print_quoted_hex(&in6->sin6_port, sizeof(in6->sin6_port)); + printf(" /* htons(%hu) */", ntohs(in6->sin6_port)); + printf(", sin6_flowinfo="); + print_quoted_hex(&in6->sin6_flowinfo, sizeof(in6->sin6_flowinfo)); + printf(" /* htonl(%u) */", ntohl(in6->sin6_flowinfo)); + printf(", sin6_addr="); + print_quoted_hex(&in6->sin6_addr, sizeof(struct in6_addr)); + printf(" /* inet_pton(AF_INET6, \"%s\") */", h_addr); + printf(", sin6_scope_id=%u}, %u) = %s\n", + in6->sin6_scope_id, len, errstr); +#else + printf("connect(-1, {sa_family=AF_INET6, sin6_port=htons(%hu)" + ", sin6_flowinfo=htonl(%u)" + ", inet_pton(AF_INET6, \"%s\", &sin6_addr)" + ", sin6_scope_id=%u}, %u)" + " = %s\n", + ntohs(in6->sin6_port), ntohl(in6->sin6_flowinfo), + h_addr, in6->sin6_scope_id, len, errstr); +#endif +} + +static void +check_in6(void) +{ + struct sockaddr_in6 in6 = { + .sin6_family = AF_INET6, + .sin6_port = htons(12345), + .sin6_flowinfo = htonl(123456890), + .sin6_scope_id = 0xfacefeed + }; + + validate_in6(&in6, "12:34:56:78:90:ab:cd:ef"); + validate_in6(&in6, "::"); + validate_in6(&in6, "::1"); +} + +#ifdef HAVE_BLUETOOTH_BLUETOOTH_H +static void +check_sco(void) +{ + const struct sockaddr_sco c_sco = { + .sco_family = AF_BLUETOOTH, + .sco_bdaddr.b = "abcdef" + }; + void *sco = tail_memdup(&c_sco, sizeof(c_sco)); + unsigned int len = sizeof(c_sco); + int ret = connect(-1, sco, len); + const char *errstr = sprintrc(ret); +# if XLAT_RAW + printf("connect(-1, {sa_family=%#x, sco_bdaddr=", AF_BLUETOOTH); + print_quoted_hex((const void *) &c_sco.sco_bdaddr, + sizeof(c_sco.sco_bdaddr)); + printf("}, %u) = %s\n", len, errstr); +# elif XLAT_VERBOSE + printf("connect(-1, {sa_family=%#x /* AF_BLUETOOTH */" + ", sco_bdaddr=", AF_BLUETOOTH); + print_quoted_hex((const void *) &c_sco.sco_bdaddr, + sizeof(c_sco.sco_bdaddr)); + printf(" /* %02x:%02x:%02x:%02x:%02x:%02x */" + "}, %u) = %s\n", + c_sco.sco_bdaddr.b[0], c_sco.sco_bdaddr.b[1], + c_sco.sco_bdaddr.b[2], c_sco.sco_bdaddr.b[3], + c_sco.sco_bdaddr.b[4], c_sco.sco_bdaddr.b[5], + len, errstr); +# else + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", sco_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + "}, %u) = %s\n", + c_sco.sco_bdaddr.b[0], c_sco.sco_bdaddr.b[1], + c_sco.sco_bdaddr.b[2], c_sco.sco_bdaddr.b[3], + c_sco.sco_bdaddr.b[4], c_sco.sco_bdaddr.b[5], + len, errstr); +# endif +} + +static void +check_rc(void) +{ + const struct sockaddr_rc c_rc = { + .rc_family = AF_BLUETOOTH, + .rc_bdaddr.b = "abcdef", + .rc_channel = 42 + }; + void *rc = tail_memdup(&c_rc, sizeof(c_rc)); + unsigned int len = sizeof(c_rc); + int ret = connect(-1, rc, len); + const char *errstr = sprintrc(ret); +# if XLAT_RAW + printf("connect(-1, {sa_family=%#x, rc_bdaddr=", AF_BLUETOOTH); + print_quoted_hex((const void *) &c_rc.rc_bdaddr, + sizeof(c_rc.rc_bdaddr)); + printf(", rc_channel=%u}, %u) = %s\n", c_rc.rc_channel, len, errstr); +# elif XLAT_VERBOSE + printf("connect(-1, {sa_family=%#x /* AF_BLUETOOTH */" + ", rc_bdaddr=", AF_BLUETOOTH); + print_quoted_hex((const void *) &c_rc.rc_bdaddr, + sizeof(c_rc.rc_bdaddr)); + printf(" /* %02x:%02x:%02x:%02x:%02x:%02x */" + ", rc_channel=%u}, %u) = %s\n", + c_rc.rc_bdaddr.b[0], c_rc.rc_bdaddr.b[1], + c_rc.rc_bdaddr.b[2], c_rc.rc_bdaddr.b[3], + c_rc.rc_bdaddr.b[4], c_rc.rc_bdaddr.b[5], + c_rc.rc_channel, len, errstr); +# else + printf("connect(-1, {sa_family=AF_BLUETOOTH" + ", rc_bdaddr=%02x:%02x:%02x:%02x:%02x:%02x" + ", rc_channel=%u}, %u) = %s\n", + c_rc.rc_bdaddr.b[0], c_rc.rc_bdaddr.b[1], + c_rc.rc_bdaddr.b[2], c_rc.rc_bdaddr.b[3], + c_rc.rc_bdaddr.b[4], c_rc.rc_bdaddr.b[5], + c_rc.rc_channel, len, errstr); +# endif +} +#endif /* HAVE_BLUETOOTH_BLUETOOTH_H */ + +int +main(void) +{ + check_ll(); + check_in(); + check_in6(); +#ifdef HAVE_BLUETOOTH_BLUETOOTH_H + check_sco(); + check_rc(); +#endif + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/socketcall.c b/tests/socketcall.c index 4fe1ea3a..aa68a7eb 100644 --- a/tests/socketcall.c +++ b/tests/socketcall.c @@ -1,30 +1,10 @@ /* * Check decoding of socketcall syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/socketcall.gen.test b/tests/socketcall.gen.test new file mode 100755 index 00000000..d18b0364 --- /dev/null +++ b/tests/socketcall.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (socketcall -a20 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 diff --git a/tests/socketcall.test b/tests/socketcall.test deleted file mode 100755 index 959bc83d..00000000 --- a/tests/socketcall.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of socketcall syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 diff --git a/tests/sockname.c b/tests/sockname.c index c5072cac..cac4f4e2 100644 --- a/tests/sockname.c +++ b/tests/sockname.c @@ -2,29 +2,10 @@ * Check decoding of sockname family syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -41,9 +22,9 @@ # error TEST_SYSCALL_NAME must be defined #endif -#define TEST_SYSCALL_STR__(a) #a -#define TEST_SYSCALL_STR_(a) TEST_SYSCALL_STR__(a) -#define TEST_SYSCALL_STR TEST_SYSCALL_STR_(TEST_SYSCALL_NAME) +#ifndef TEST_SYSCALL_STR +# define TEST_SYSCALL_STR STRINGIFY_VAL(TEST_SYSCALL_NAME) +#endif #define TEST_SOCKET TEST_SYSCALL_STR ".socket" #ifdef TEST_SYSCALL_PREPARE @@ -74,7 +55,7 @@ static void test_sockname_syscall(const int fd) { - socklen_t *const plen = tail_alloc(sizeof(*plen)); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, plen); *plen = sizeof(struct sockaddr_un); struct sockaddr_un *addr = tail_alloc(*plen); diff --git a/tests/sockopt-sol_netlink.c b/tests/sockopt-sol_netlink.c new file mode 100644 index 00000000..a797a6f1 --- /dev/null +++ b/tests/sockopt-sol_netlink.c @@ -0,0 +1,193 @@ +/* + * Check decoding of getsockopt and setsockopt for SOL_NETLINK level. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include "netlink.h" +#include + +#ifndef SOL_NETLINK +# define SOL_NETLINK 270 +#endif + +static int rc; +static const char *errstr; + +static int +get_sockopt(int fd, int name, void *val, socklen_t *len) +{ + rc = getsockopt(fd, SOL_NETLINK, name, val, len); + errstr = sprintrc(rc); + return rc; +} + +static int +set_sockopt(int fd, int name, void *val, socklen_t len) +{ + rc = setsockopt(fd, SOL_NETLINK, name, val, len); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const struct { + int val; + const char *str; + } names[] = { +#ifdef NETLINK_ADD_MEMBERSHIP + { ARG_STR(NETLINK_ADD_MEMBERSHIP) }, +#endif +#ifdef NETLINK_DROP_MEMBERSHIP + { ARG_STR(NETLINK_DROP_MEMBERSHIP) }, +#endif +#ifdef NETLINK_PKTINFO + { ARG_STR(NETLINK_PKTINFO) }, +#endif +#ifdef NETLINK_BROADCAST_ERROR + { ARG_STR(NETLINK_BROADCAST_ERROR) }, +#endif +#ifdef NETLINK_NO_ENOBUFS + { ARG_STR(NETLINK_NO_ENOBUFS) }, +#endif +#ifdef NETLINK_RX_RING + { ARG_STR(NETLINK_RX_RING) }, +#endif +#ifdef NETLINK_TX_RING + { ARG_STR(NETLINK_TX_RING) }, +#endif +#ifdef NETLINK_LISTEN_ALL_NSID + { ARG_STR(NETLINK_LISTEN_ALL_NSID) }, +#endif +#ifdef NETLINK_LIST_MEMBERSHIPS + { ARG_STR(NETLINK_LIST_MEMBERSHIPS) }, +#endif +#ifdef NETLINK_CAP_ACK + { ARG_STR(NETLINK_CAP_ACK) }, +#endif +#ifdef NETLINK_EXT_ACK + { ARG_STR(NETLINK_EXT_ACK) }, +#endif + }; + + TAIL_ALLOC_OBJECT_CONST_PTR(int, val); + TAIL_ALLOC_OBJECT_CONST_PTR(socklen_t, len); + void *const efault = val + 1; + int fd = socket(AF_NETLINK, SOCK_RAW, 0); + if (fd < 0) + perror_msg_and_skip("socket AF_NETLINK SOCK_RAW"); + unsigned int i; + + for (i = 0; i < ARRAY_SIZE(names); ++i) { + /* getsockopt */ + + /* classic */ + *len = sizeof(*val); + get_sockopt(fd, names[i].val, val, len); + printf("getsockopt(%d, SOL_NETLINK, %s, ", fd, names[i].str); + if (rc) + printf("%p", val); + else + printf("[%d]", *val); + printf(", [%d]) = %s\n", *len, errstr); + + /* optlen larger than necessary - shortened */ + *len = sizeof(*val) + 1; + get_sockopt(fd, names[i].val, val, len); + printf("getsockopt(%d, SOL_NETLINK, %s, ", fd, names[i].str); + if (rc) + printf("%p", val); + else + printf("[%d]", *val); + printf(", [%d", (int) sizeof(*val) + 1); + if ((int) sizeof(*val) + 1 != *len) + printf("->%d", *len); + printf("]) = %s\n", errstr); + + /* zero optlen - print returned optlen */ + *len = 0; + get_sockopt(fd, names[i].val, NULL, len); + printf("getsockopt(%d, SOL_NETLINK, %s, NULL, [0", + fd, names[i].str); + if (*len) + printf("->%d", *len); + printf("]) = %s\n", errstr); + +#ifdef NETLINK_LIST_MEMBERSHIPS + if (names[i].val != NETLINK_LIST_MEMBERSHIPS) { +#endif + /* optlen shorter than necessary - print address */ + *len = sizeof(*val) - 1; + get_sockopt(fd, names[i].val, val, len); + printf("getsockopt(%d, SOL_NETLINK, %s, %p, [%d", + fd, names[i].str, val, (int) sizeof(*val) - 1); + if ((int) sizeof(*val) - 1 != *len) + printf("->%d", *len); + printf("]) = %s\n", errstr); +#ifdef NETLINK_LIST_MEMBERSHIPS + } else { + /* optlen shorter than required for the first element */ + *len = sizeof(*val) - 1; + get_sockopt(fd, names[i].val, efault, len); + printf("getsockopt(%d, SOL_NETLINK, %s, ", + fd, names[i].str); + if (rc) + printf("%p", efault); + else + printf("[]"); + printf(", [%d", (int) sizeof(*val) - 1); + if ((int) sizeof(*val) - 1 != *len) + printf("->%d", *len); + printf("]) = %s\n", errstr); + } +#endif + + /* optval EFAULT - print address */ + *len = sizeof(*val); + get_sockopt(fd, names[i].val, efault, len); + printf("getsockopt(%d, SOL_NETLINK, %s, %p, [%d]) = %s\n", + fd, names[i].str, efault, *len, errstr); + + /* optlen EFAULT - print address */ + get_sockopt(fd, names[i].val, val, len + 1); + printf("getsockopt(%d, SOL_NETLINK, %s, %p, %p) = %s\n", + fd, names[i].str, val, len + 1, errstr); + + /* setsockopt */ + + /* classic */ + *val = 0xdefaced; + set_sockopt(fd, names[i].val, val, sizeof(*val)); + printf("setsockopt(%d, SOL_NETLINK, %s, [%d], %d) = %s\n", + fd, names[i].str, *val, (int) sizeof(*val), errstr); + + /* optlen larger than necessary - shortened */ + set_sockopt(fd, names[i].val, val, sizeof(*val) + 1); + printf("setsockopt(%d, SOL_NETLINK, %s, [%d], %d) = %s\n", + fd, names[i].str, *val, (int) sizeof(*val) + 1, errstr); + + /* optlen < 0 - print address */ + set_sockopt(fd, names[i].val, val, -1U); + printf("setsockopt(%d, SOL_NETLINK, %s, %p, -1) = %s\n", + fd, names[i].str, val, errstr); + + /* optlen smaller than necessary - print address */ + set_sockopt(fd, names[i].val, val, sizeof(*val) - 1); + printf("setsockopt(%d, SOL_NETLINK, %s, %p, %d) = %s\n", + fd, names[i].str, val, (int) sizeof(*val) - 1, errstr); + + /* optval EFAULT - print address */ + set_sockopt(fd, names[i].val, efault, sizeof(*val)); + printf("setsockopt(%d, SOL_NETLINK, %s, %p, %d) = %s\n", + fd, names[i].str, efault, (int) sizeof(*val), errstr); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/sockopt-sol_netlink.gen.test b/tests/sockopt-sol_netlink.gen.test new file mode 100755 index 00000000..a2ba06dd --- /dev/null +++ b/tests/sockopt-sol_netlink.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sockopt-sol_netlink -e trace=getsockopt,setsockopt); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=getsockopt,setsockopt diff --git a/tests/sockopt-timestamp.c b/tests/sockopt-timestamp.c new file mode 100644 index 00000000..c2659925 --- /dev/null +++ b/tests/sockopt-timestamp.c @@ -0,0 +1,197 @@ +/* + * Check decoding of timestamp control messages. + * + * Copyright (c) 2019 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +#if defined HAVE_STRUCT___KERNEL_SOCK_TIMEVAL \ + || defined HAVE_STRUCT___KERNEL_TIMESPEC +# include +#endif + +#define XLAT_MACROS_ONLY +#include "xlat/sock_options.h" +#undef XLAT_MACROS_ONLY + +static void +print_timestamp_old(const struct cmsghdr *c) +{ + const void *cmsg_header = c; + const void *cmsg_data = CMSG_DATA(c); + const struct timeval *tv = cmsg_data; + const unsigned int expected_len = sizeof(*tv); + const unsigned int data_len = c->cmsg_len - (cmsg_data - cmsg_header); + + if (expected_len != data_len) + perror_msg_and_fail("sizeof(struct timeval) = %u" + ", data_len = %u\n", + expected_len, data_len); + printf("{tv_sec=%lld, tv_usec=%lld}", + (long long) tv->tv_sec, (long long) tv->tv_usec); +} + +static void +print_timestampns_old(const struct cmsghdr *c) +{ + const void *cmsg_header = c; + const void *cmsg_data = CMSG_DATA(c); + const struct timespec *ts = cmsg_data; + const unsigned int expected_len = sizeof(*ts); + const unsigned int data_len = c->cmsg_len - (cmsg_data - cmsg_header); + + if (expected_len != data_len) + perror_msg_and_fail("sizeof(struct timespec) = %u" + ", data_len = %u\n", + expected_len, data_len); + printf("{tv_sec=%lld, tv_nsec=%lld}", + (long long) ts->tv_sec, (long long) ts->tv_nsec); +} + +#ifdef HAVE_STRUCT___KERNEL_SOCK_TIMEVAL +static void +print_timestamp_new(const struct cmsghdr *c) +{ + const void *cmsg_header = c; + const void *cmsg_data = CMSG_DATA(c); + const struct __kernel_sock_timeval *tv = cmsg_data; + const unsigned int expected_len = sizeof(*tv); + const unsigned int data_len = c->cmsg_len - (cmsg_data - cmsg_header); + + if (expected_len != data_len) + perror_msg_and_fail("sizeof(struct __kernel_sock_timeval) = %u" + ", data_len = %u\n", + expected_len, data_len); + printf("{tv_sec=%lld, tv_usec=%lld}", + (long long) tv->tv_sec, (long long) tv->tv_usec); +} +#endif /* HAVE_STRUCT___KERNEL_SOCK_TIMEVAL */ + +#ifdef HAVE_STRUCT___KERNEL_TIMESPEC +static void +print_timestampns_new(const struct cmsghdr *c) +{ + const void *cmsg_header = c; + const void *cmsg_data = CMSG_DATA(c); + const struct __kernel_timespec *ts = cmsg_data; + const unsigned int expected_len = sizeof(*ts); + const unsigned int data_len = c->cmsg_len - (cmsg_data - cmsg_header); + + if (expected_len != data_len) + perror_msg_and_fail("sizeof(struct __kernel_timespec) = %u" + ", data_len = %u\n", + expected_len, data_len); + printf("{tv_sec=%lld, tv_nsec=%lld}", + (long long) ts->tv_sec, (long long) ts->tv_nsec); +} +#endif /* HAVE_STRUCT___KERNEL_TIMESPEC */ + +static unsigned int +test_sockopt(int so_val, const char *str, void (*fun)(const struct cmsghdr *)) +{ + static const char data[] = "socketpair"; + const size_t size = sizeof(data) - 1; + + int sv[2]; + if (socketpair(AF_UNIX, SOCK_DGRAM, 0, sv)) + perror_msg_and_skip(data); + + const int opt_1 = 1; + if (setsockopt(sv[0], SOL_SOCKET, so_val, &opt_1, sizeof(opt_1))) { + perror(str); + return 0; + } + + if (send(sv[1], data, size, 0) != (int) size) + perror_msg_and_fail("send"); + if (close(sv[1])) + perror_msg_and_fail("close send"); + + char buf[size]; + struct iovec iov = { + .iov_base = buf, + .iov_len = sizeof(buf) + }; + struct cmsghdr control[16]; + struct msghdr mh = { + .msg_iov = &iov, + .msg_iovlen = 1, + .msg_control = control, + .msg_controllen = sizeof(control) + }; + + if (recvmsg(sv[0], &mh, 0) != (int) size) + perror_msg_and_fail("recvmsg"); + if (close(sv[0])) + perror_msg_and_fail("close recv"); + + printf("recvmsg(%d, {msg_name=NULL, msg_namelen=0" + ", msg_iov=[{iov_base=\"%s\", iov_len=%u}], msg_iovlen=1", + sv[0], data, (unsigned int) size); + + unsigned int tested = 0; + if (mh.msg_controllen) { + printf(", msg_control=["); + for (struct cmsghdr *c = CMSG_FIRSTHDR(&mh); c; + c = CMSG_NXTHDR(&mh, c)) { + printf("%s{cmsg_len=%lu, cmsg_level=", + (c == control ? "" : ", "), + (unsigned long) c->cmsg_len); + if (c->cmsg_level == SOL_SOCKET) { + printf("SOL_SOCKET"); + } else { + printf("%d", c->cmsg_level); + } + printf(", cmsg_type="); + if (c->cmsg_type == so_val) { + printf("%s, cmsg_data=", str); + fun(c); + tested = 1; + } else { + printf("%d", c->cmsg_type); + } + printf("}"); + } + printf("]"); + } + printf(", msg_controllen=%lu, msg_flags=0}, 0) = %u\n", + (unsigned long) mh.msg_controllen, (unsigned int) size); + + return tested; +} + +int +main(void) +{ + static const struct { + int val; + const char *str; + void (*fun)(const struct cmsghdr *); + } tests[] = { + { SO_TIMESTAMP_OLD, "SO_TIMESTAMP_OLD", print_timestamp_old }, + { SO_TIMESTAMPNS_OLD, "SO_TIMESTAMPNS_OLD", print_timestampns_old }, +#ifdef HAVE_STRUCT___KERNEL_SOCK_TIMEVAL + { SO_TIMESTAMP_NEW, "SO_TIMESTAMP_NEW", print_timestamp_new }, +#endif +#ifdef HAVE_STRUCT___KERNEL_TIMESPEC + { SO_TIMESTAMPNS_NEW, "SO_TIMESTAMPNS_NEW", print_timestampns_new }, +#endif + }; + unsigned int tested = 0; + for (unsigned int i = 0; i < ARRAY_SIZE(tests); ++i) + tested |= test_sockopt(tests[i].val, + tests[i].str, + tests[i].fun); + if (!tested) + return 77; + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/sockopt-timestamp.gen.test b/tests/sockopt-timestamp.gen.test new file mode 100755 index 00000000..a71ca4c4 --- /dev/null +++ b/tests/sockopt-timestamp.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sockopt-timestamp -e trace=recvmsg); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=recvmsg diff --git a/tests/splice.c b/tests/splice.c index b6f25256..2acdde7f 100644 --- a/tests/splice.c +++ b/tests/splice.c @@ -2,29 +2,10 @@ * This file is part of splice strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,8 +21,8 @@ main(void) { const long int fd_in = (long int) 0xdeadbeefffffffffULL; const long int fd_out = (long int) 0xdeadbeeffffffffeULL; - long long int *const off_in = tail_alloc(sizeof(*off_in)); - long long int *const off_out = tail_alloc(sizeof(*off_out)); + TAIL_ALLOC_OBJECT_CONST_PTR(long long int, off_in); + TAIL_ALLOC_OBJECT_CONST_PTR(long long int, off_out); *off_in = 0xdeadbef1facefed1ULL; *off_out = 0xdeadbef2facefed2ULL; const size_t len = (size_t) 0xdeadbef3facefed3ULL; diff --git a/tests/splice.gen.test b/tests/splice.gen.test new file mode 100755 index 00000000..75660806 --- /dev/null +++ b/tests/splice.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (splice ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/splice.test b/tests/splice.test deleted file mode 100755 index cc5c327e..00000000 --- a/tests/splice.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check splice syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/sprintrc.c b/tests/sprintrc.c index 7423afb6..5266ef18 100644 --- a/tests/sprintrc.c +++ b/tests/sprintrc.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -54,9 +35,6 @@ sprintrc_ex(long rc, enum sprintrc_fmt fmt) }; static char buf[4096]; - if (fmt >= ARRAY_SIZE(formats)) - perror_msg_and_fail("sprintrc_ex: incorrect format provided"); - if (rc == 0) return "0"; diff --git a/tests/stack-fcall-0.c b/tests/stack-fcall-0.c index 12a260de..8a26a79c 100644 --- a/tests/stack-fcall-0.c +++ b/tests/stack-fcall-0.c @@ -1,4 +1,11 @@ -int f1(int i); +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "stack-fcall.h" int f0(int i) { diff --git a/tests/stack-fcall-1.c b/tests/stack-fcall-1.c index 8716702d..b5cd89b3 100644 --- a/tests/stack-fcall-1.c +++ b/tests/stack-fcall-1.c @@ -1,4 +1,11 @@ -int f2(int i); +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "stack-fcall.h" int f1(int i) { diff --git a/tests/stack-fcall-2.c b/tests/stack-fcall-2.c index 19f8cf83..16beee58 100644 --- a/tests/stack-fcall-2.c +++ b/tests/stack-fcall-2.c @@ -1,4 +1,11 @@ -int f3(int i); +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "stack-fcall.h" int f2(int i) { diff --git a/tests/stack-fcall-3.c b/tests/stack-fcall-3.c index 3af1667f..538b6565 100644 --- a/tests/stack-fcall-3.c +++ b/tests/stack-fcall-3.c @@ -1,6 +1,23 @@ +/* + * Copyright (c) 2014-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include #include +#include "stack-fcall.h" + int f3(int i) { - return getpid() + i; + switch (i) { + case 1: + return kill(getpid(), SIGURG); + + default: + return chdir("") + i; + } + } diff --git a/tests/stack-fcall-mangled-0.c b/tests/stack-fcall-mangled-0.c new file mode 100644 index 00000000..47549401 --- /dev/null +++ b/tests/stack-fcall-mangled-0.c @@ -0,0 +1,2 @@ +#define MANGLE +#include "stack-fcall-0.c" diff --git a/tests/stack-fcall-mangled-1.c b/tests/stack-fcall-mangled-1.c new file mode 100644 index 00000000..492c562b --- /dev/null +++ b/tests/stack-fcall-mangled-1.c @@ -0,0 +1,2 @@ +#define MANGLE +#include "stack-fcall-1.c" diff --git a/tests/stack-fcall-mangled-2.c b/tests/stack-fcall-mangled-2.c new file mode 100644 index 00000000..eb7c3624 --- /dev/null +++ b/tests/stack-fcall-mangled-2.c @@ -0,0 +1,2 @@ +#define MANGLE +#include "stack-fcall-2.c" diff --git a/tests/stack-fcall-mangled-3.c b/tests/stack-fcall-mangled-3.c new file mode 100644 index 00000000..98f738b4 --- /dev/null +++ b/tests/stack-fcall-mangled-3.c @@ -0,0 +1,2 @@ +#define MANGLE +#include "stack-fcall-3.c" diff --git a/tests/stack-fcall-mangled.c b/tests/stack-fcall-mangled.c new file mode 100644 index 00000000..67862059 --- /dev/null +++ b/tests/stack-fcall-mangled.c @@ -0,0 +1,2 @@ +#define MANGLE +#include "stack-fcall.c" diff --git a/tests/stack-fcall.c b/tests/stack-fcall.c index 134d54f6..cf4000e5 100644 --- a/tests/stack-fcall.c +++ b/tests/stack-fcall.c @@ -1,7 +1,15 @@ -int f0(int i); +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ -int main(int argc, char** argv) +#include "stack-fcall.h" + +int main(void) { - f0(argc); + f0(0); + f0(1); return 0; } diff --git a/tests/stack-fcall.h b/tests/stack-fcall.h new file mode 100644 index 00000000..cca0f94f --- /dev/null +++ b/tests/stack-fcall.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifdef MANGLE + +# define f0 _ZN2ns2f0Ei +# define f1 _ZN2ns2f1Ei +# define f2 _ZN2ns2f2Ei +# define f3 _ZN2ns2f3Ei + +#endif + +int f0(int i); +int f1(int i); +int f2(int i); +int f3(int i); diff --git a/tests/stat.c b/tests/stat.c index d4ca7b0b..8c8daad1 100644 --- a/tests/stat.c +++ b/tests/stat.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/stat.gen.test b/tests/stat.gen.test new file mode 100755 index 00000000..13ccd0b8 --- /dev/null +++ b/tests/stat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (stat -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests/stat.test b/tests/stat.test deleted file mode 100755 index ba8938c0..00000000 --- a/tests/stat.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check stat syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests/stat64.c b/tests/stat64.c index 782de33d..12ded432 100644 --- a/tests/stat64.c +++ b/tests/stat64.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/stat64.gen.test b/tests/stat64.gen.test new file mode 100755 index 00000000..f49df37a --- /dev/null +++ b/tests/stat64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (stat64 -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests/stat64.test b/tests/stat64.test deleted file mode 100755 index abcfb9ec..00000000 --- a/tests/stat64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check stat64 syscall decoding. - -. "${srcdir=.}/statx.sh" diff --git a/tests/statfs.c b/tests/statfs.c index 6032a668..5672a7fc 100644 --- a/tests/statfs.c +++ b/tests/statfs.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2014-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/statfs.expected b/tests/statfs.expected deleted file mode 100644 index 11e9f0b1..00000000 --- a/tests/statfs.expected +++ /dev/null @@ -1 +0,0 @@ -statfs(64)?\("/proc/self/status"(, [1-9][0-9]*)?, \{f_type=PROC_SUPER_MAGIC, f_bsize=[1-9][0-9]*, f_blocks=[0-9]+, f_bfree=[0-9]+, f_bavail=[0-9]+, f_files=[0-9]+, f_ffree=[0-9]+, f_fsid=\{val=\[[0-9]+, [0-9]+\]\}, f_namelen=[1-9][0-9]*(, f_frsize=[0-9]+)?(, f_flags=ST_VALID(\|ST_[A-Z]+)*)?\}\) += 0 diff --git a/tests/statfs.gen.test b/tests/statfs.gen.test new file mode 100755 index 00000000..32204a14 --- /dev/null +++ b/tests/statfs.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (statfs -a17 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests/statfs.test b/tests/statfs.test deleted file mode 100755 index 6075576f..00000000 --- a/tests/statfs.test +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -# Check statfs syscall decoding. - -. "${srcdir=.}/init.sh" - -# this test probes /proc/self/status -[ -f /proc/self/status ] || - framework_skip_ '/proc/self/status is not available' - -run_strace_match_diff -a17 diff --git a/tests/statfs64.c b/tests/statfs64.c index f46e7670..1e0a4b24 100644 --- a/tests/statfs64.c +++ b/tests/statfs64.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/statfs64.gen.test b/tests/statfs64.gen.test new file mode 100755 index 00000000..8f6f06f7 --- /dev/null +++ b/tests/statfs64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (statfs64 -a23 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 diff --git a/tests/statfs64.test b/tests/statfs64.test deleted file mode 100755 index 9c0aa278..00000000 --- a/tests/statfs64.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check statfs64 syscall decoding. - -. "${srcdir=.}/statfs.test" diff --git a/tests/statx.c b/tests/statx.c new file mode 100644 index 00000000..c5e86ad2 --- /dev/null +++ b/tests/statx.c @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#ifdef __NR_statx + +# include +# include "xlat.h" +# include "xlat/statx_masks.h" +# include "xlat/statx_attrs.h" +# include "xlat/at_statx_sync_types.h" + +# define IS_STATX 1 +# define TEST_SYSCALL_STR "statx" +# define STRUCT_STAT struct statx +# define STRUCT_STAT_STR "struct statx" +# define STRUCT_STAT_IS_STAT64 0 + +static unsigned TEST_SYSCALL_STATX_FLAGS = AT_STATX_SYNC_AS_STAT; +static const char *TEST_SYSCALL_STATX_FLAGS_STR = "AT_STATX_SYNC_AS_STAT"; +static unsigned TEST_SYSCALL_STATX_MASK = STATX_ALL; +static const char *TEST_SYSCALL_STATX_MASK_STR = "STATX_ALL"; + +# define TEST_SYSCALL_INVOKE(sample, pst) \ + syscall(__NR_statx, AT_FDCWD, sample, TEST_SYSCALL_STATX_FLAGS, \ + TEST_SYSCALL_STATX_MASK, pst) +# define PRINT_SYSCALL_HEADER(sample) \ + do { \ + int saved_errno = errno; \ + printf("%s(AT_FDCWD, \"%s\", %s, %s, ", \ + TEST_SYSCALL_STR, sample, TEST_SYSCALL_STATX_FLAGS_STR, \ + TEST_SYSCALL_STATX_MASK_STR) +# define PRINT_SYSCALL_FOOTER(rc) \ + errno = saved_errno; \ + printf(") = %s\n", sprintrc(rc)); \ + } while (0) + +# include "xstatx.c" + +#else + +SKIP_MAIN_UNDEFINED("__NR_statx") + +#endif diff --git a/tests/statx.gen.test b/tests/statx.gen.test new file mode 100755 index 00000000..bff3e3f2 --- /dev/null +++ b/tests/statx.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (statx -a32 -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a32 -v -P stat.sample -P /dev/full diff --git a/tests/statx.sh b/tests/statx.sh deleted file mode 100755 index a630193d..00000000 --- a/tests/statx.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of stat family syscalls. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -P $NAME.sample -P /dev/full -a32 diff --git a/tests/strace-C.test b/tests/strace-C.test index ccca9a09..5d3e37dc 100755 --- a/tests/strace-C.test +++ b/tests/strace-C.test @@ -1,9 +1,14 @@ #!/bin/sh - +# # Check -C option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./sleep 0 -run_strace -a24 -C -enanosleep ./sleep 1 +run_prog ../sleep 0 +run_strace -a24 -C -enanosleep ../sleep 1 match_grep diff --git a/tests/strace-E.expected b/tests/strace-E.expected index d7823b7a..3ae2c28e 100644 --- a/tests/strace-E.expected +++ b/tests/strace-E.expected @@ -1 +1 @@ -execve\("\./sleep", \["\./sleep", "0"\], \[.*"option_E_var=OPTION_E_VAL".*\]\) = 0 +execve\("\.\./sleep", \["\.\./sleep", "0"\], \[.*"option_E_var=OPTION_E_VAL".*\]\) = 0 diff --git a/tests/strace-E.test b/tests/strace-E.test index d76ec3f5..82b95df5 100755 --- a/tests/strace-E.test +++ b/tests/strace-E.test @@ -1,9 +1,14 @@ #!/bin/sh - +# # Check -E option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./sleep 0 > /dev/null +run_prog ../sleep 0 > /dev/null run_strace -E option_E_var=OPTION_E_VAL -v $args match_grep diff --git a/tests/strace-S.test b/tests/strace-S.test index 3ea315ce..4b5be6d9 100755 --- a/tests/strace-S.test +++ b/tests/strace-S.test @@ -1,10 +1,15 @@ #!/bin/sh - +# # Check -S option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./readv > /dev/null +run_prog ../readv > /dev/null test_c() { @@ -13,7 +18,7 @@ test_c() sortopts="$1"; shift sedexpr="$1"; shift - run_strace -c -w -S "$sortby" ./readv > /dev/null + run_strace -c -w -S "$sortby" ../readv > /dev/null sed -r -n -e "$sedexpr" < "$LOG" > "$OUT" [ -s "$OUT" ] || @@ -28,5 +33,3 @@ test_c() c='[[:space:]]+([^[:space:]]+)' test_c calls '-n -r' '/^[[:space:]]+[0-9]/ s/^'"$c$c$c$c"'[[:space:]].*/\4/p' test_c name '' '/^[[:space:]]+[0-9]/ s/^'"$c$c$c$c"'([[:space:]]+[0-9]+)?'"$c"'$/\6/p' - -rm -f "$OUT" diff --git a/tests/strace-T.test b/tests/strace-T.test index 7ab84a74..7c3136b7 100755 --- a/tests/strace-T.test +++ b/tests/strace-T.test @@ -1,9 +1,14 @@ #!/bin/sh - +# # Check -T option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./sleep 0 -run_strace -a24 -T -enanosleep ./sleep 1 +run_prog ../sleep 0 +run_strace -a24 -T -enanosleep ../sleep 1 match_grep diff --git a/tests/strace-V.test b/tests/strace-V.test index 9a051e00..a0274c28 100755 --- a/tests/strace-V.test +++ b/tests/strace-V.test @@ -8,17 +8,62 @@ year="$(date +%Y)" run_strace -V > "$LOG" -getval() +getstr() { - sed -r -n 's/#define[[:space:]]*'"$1"'[[:space:]]*"([^"]*)".*/\1/p' ../config.h + sed -r -n 's/#define[[:space:]]*'"$1"'[[:space:]]*"([^"]*)".*/\1/p' \ + ../../config.h } +# getoption OPTION YES_STRING [NO_STRING] +# +# Returns YES_STRING in case OPTION is enabled (present in config.h and has +# a non-zero numeric value). Otherwise, NO_STRING (or empty string, if not +# specified) is returned. +getoption() +{ + local opt + opt=$(sed -r -n 's/#define[[:space:]]*'"$1"'[[:space:]]*([0-9]+)$/\1/p' \ + ../../config.h) + if [ -n "$opt" -a "$opt" -ne 0 ]; then + printf "%s" "$2" + else + printf "%s" "${3-}" + fi +} + +config_year=$(getstr COPYRIGHT_YEAR) + +[ "$year" -ge "$config_year" ] && [ "$config_year" -ge 2017 ] || { + echo >&2 "The year derived from config.h (${config_year}) does not pass sanity checks." + exit 1 +} + +option_unwind=$(getoption ENABLE_STACKTRACE \ + " stack-trace=$(getstr USE_UNWINDER)") +option_demangle=$(getoption USE_DEMANGLE " stack-demangle") + +option_m32= +option_mx32= +case "$STRACE_NATIVE_ARCH" in +x86_64) + option_m32=$(getoption HAVE_M32_MPERS ' m32-mpers' ' no-m32-mpers') + option_mx32=$(getoption HAVE_MX32_MPERS ' mx32-mpers' ' no-mx32-mpers') + ;; +aarch64|powerpc64|riscv|s390x|sparc64|tile|x32) + option_m32=$(getoption HAVE_M32_MPERS ' m32-mpers' ' no-m32-mpers') + ;; +esac + +features="${option_unwind}${option_demangle}${option_m32}${option_mx32}" +[ -n "$features" ] || features=" (none)" + cat > "$EXP" << __EOF__ -$(getval PACKAGE_NAME) -- version $(getval PACKAGE_VERSION) -Copyright (C) 1991-$year The strace developers <$(getval PACKAGE_URL)>. +$(getstr PACKAGE_NAME) -- version $(getstr PACKAGE_VERSION) +Copyright (c) 1991-${config_year} The strace developers <$(getstr PACKAGE_URL)>. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +Optional features enabled:${features} __EOF__ -match_diff "$EXP" "$LOG" -rm -f "$EXP" +match_diff "$LOG" "$EXP" diff --git a/tests/strace-ff.test b/tests/strace-ff.test index 2ce06f19..429549f2 100755 --- a/tests/strace-ff.test +++ b/tests/strace-ff.test @@ -1,13 +1,18 @@ #!/bin/sh - +# # Check -ff option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog_skip_if_failed \ kill -0 $$ -./set_ptracer_any ./sleep 1 > "$OUT" & +../set_ptracer_any ../sleep 3 > "$OUT" & tracee_pid=$! while ! [ -s "$OUT" ]; do @@ -15,7 +20,6 @@ while ! [ -s "$OUT" ]; do fail_ 'set_ptracer_any sleep failed' done -rm -f "$LOG".* run_strace -a14 -eexit_group -ff -p $tracee_pid # check that output matches @@ -25,5 +29,3 @@ match_diff "$LOG.$tracee_pid" set -- "$LOG".* [ "$LOG.$tracee_pid" = "$*" ] || fail_ "too many output files: $*" - -rm -f "$OUT" "$LOG.$tracee_pid" diff --git a/tests/strace-k-demangle.expected b/tests/strace-k-demangle.expected new file mode 100644 index 00000000..c1b48037 --- /dev/null +++ b/tests/strace-k-demangle.expected @@ -0,0 +1,2 @@ +^chdir .*(__kernel_vsyscall )?(__)?chdir ns::f3\(int\) ns::f2\(int\) ns::f1\(int\) ns::f0\(int\) main +^SIGURG .*(__kernel_vsyscall )?(__)?kill ns::f3\(int\) ns::f2\(int\) ns::f1\(int\) ns::f0\(int\) main diff --git a/tests/strace-k-demangle.test b/tests/strace-k-demangle.test new file mode 100755 index 00000000..3789d0ea --- /dev/null +++ b/tests/strace-k-demangle.test @@ -0,0 +1,12 @@ +#!/bin/sh +# +# Check strace -k symbol names demangling. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +test_prog=../stack-fcall-mangled + +. "${srcdir=.}"/strace-k.test diff --git a/tests/strace-k.expected b/tests/strace-k.expected new file mode 100644 index 00000000..e40c339e --- /dev/null +++ b/tests/strace-k.expected @@ -0,0 +1,2 @@ +^chdir .*(__kernel_vsyscaln )?(__)?chdir f3 f2 f1 f0 main +^SIGURG .*(__kernel_vsyscaln )?(__)?kill f3 f2 f1 f0 main diff --git a/tests/strace-k.test b/tests/strace-k.test index d5e8ed2b..7a323431 100755 --- a/tests/strace-k.test +++ b/tests/strace-k.test @@ -4,29 +4,10 @@ # # Copyright (c) 2014 Masatake YAMATO # Copyright (c) 2014-2016 Dmitry V. Levin +# Copyright (c) 2014-2019 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -34,20 +15,66 @@ [ -f /proc/self/maps ] || framework_skip_ '/proc/self/maps is not available' +check_prog grep check_prog sed check_prog tr -run_prog ./stack-fcall -run_strace -e getpid -k $args +run_prog "${test_prog=../stack-fcall}" +run_strace -e chdir -k $args -expected='getpid f3 f2 f1 f0 main ' -result=$(sed -r -n '1,/\(main\+0x[a-f0-9]+\) .*/ s/^.*\(([^+]+)\+0x[a-f0-9]+\) .*/\1/p' "$LOG" | - tr '\n' ' ') +expected="$srcdir/$NAME.expected" +awk ' +/^[^ ]/ { + if (out != "") + print out -test "$result" = "$expected" || { - echo "expected: \"$expected\"" - echo "result: \"$result\"" - dump_log_and_fail_with "$STRACE $args output mismatch" + syscall = gensub(/^([[:alnum:]_]+)\(.*/, "\\1", 1) + signal = gensub(/^--- ([A-Z]+) .*/, "\\1", 1) + + if (syscall != $0) { + out = syscall + stop = 0 + } else if (signal != $0) { + out = signal + stop = 0 + } else { + out = "" + } } -exit 0 +/^ >[^(]+\(([^+]+)\+0x[a-f0-9]+\) / && !stop { + sym = gensub(/^ >[^(]+\(([^+]+)\+0x[a-f0-9]+\) .*$/, "\\1", 1) + out = out " " sym + if (sym == "main") + stop = 1 +}' "$LOG" > "$OUT" + +LC_ALL=C grep -E -x -f "$expected" < "$OUT" > /dev/null || { + cat >&2 <<__EOF__ +Failed pattern of expected output: +$(cat "$expected") +Actual output: +$(cat "$OUT") +__EOF__ + + pattern= + case "$STRACE_ARCH" in + aarch64|i386|ppc*|s390*|sparc*|x32|x86*) + # These architectures are supported by elfutils libdw, + # see grep '\.*\' elfutils/backends + ;; + arm) pattern='No DWARF information found' + # This is also supported by elfutils libdw + # but the latter needs debuginfo for unwinding. + ;; + *) pattern='Unwinding not supported for this architecture' + ;; + esac + if [ -n "$pattern" ] && + LC_ALL=C grep -x " > $pattern" < "$LOG" > /dev/null; then + cat < "$LOG" >&2 + skip_ "stack tracing is not fully supported on $STRACE_ARCH yet" + fi + + dump_log_and_fail_with "$STRACE $args output mismatch" +} diff --git a/tests/strace-log-merge-error.test b/tests/strace-log-merge-error.test new file mode 100755 index 00000000..35a2de82 --- /dev/null +++ b/tests/strace-log-merge-error.test @@ -0,0 +1,37 @@ +#!/bin/sh +# +# Check strace-log-merge error diagnostics. +# +# Copyright (c) 2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +rm -f -- "$LOG".[0-9]* +echo "strace-log-merge: $LOG: strace output not found" > "$EXP" + +check_strace_log_merge() +{ + "$srcdir"/../strace-log-merge "$LOG" > "$OUT" 2> "$LOG" + rc=$? + + [ $rc -gt 0 ] || + dump_log_and_fail_with 'strace-log-merge unexpectedly succeeded' + + [ ! -s "$OUT" ] || + dump_log_and_fail_with 'strace-log-merge unexpectedly produced output' + + match_diff "$LOG" "$EXP" 'strace-log-merge error diagnostics mismatch' +} + +check_strace_log_merge + +echo '1234567890.123456 +++ exited with 0 +++' > "$LOG".0 +check_strace_log_merge + +echo > "$LOG".1 +check_strace_log_merge + +rm -f -- "$LOG".[0-9]* diff --git a/tests/strace-log-merge-suffix.test b/tests/strace-log-merge-suffix.test new file mode 100755 index 00000000..51a2e5fb --- /dev/null +++ b/tests/strace-log-merge-suffix.test @@ -0,0 +1,29 @@ +#!/bin/sh +# +# Check strace-log-merge pid formatting. +# +# Copyright (c) 2019 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +rm -f -- "$LOG".[0-9]* + +echo '3456789012.345678 +++ exited with 3 +++' > "$LOG".4294967295 +echo '1234567890.123456 +++ exited with 2 +++' > "$LOG".65535 +echo '2345678901.234567 +++ exited with 1 +++' > "$LOG".1 + +cat > "$EXP" <<'EOF' +65535 1234567890.123456 +++ exited with 2 +++ +1 2345678901.234567 +++ exited with 1 +++ +4294967295 3456789012.345678 +++ exited with 3 +++ +EOF + +"$srcdir"/../strace-log-merge "$LOG" > "$OUT" 2> "$LOG" || + dump_log_and_fail_with 'strace-log-merge failed' + +match_diff "$OUT" "$EXP" 'strace-log-merge output mismatch' + +rm -f -- "$LOG".[0-9]* diff --git a/tests/strace-r.expected b/tests/strace-r.expected index 8009c353..2a5b9773 100644 --- a/tests/strace-r.expected +++ b/tests/strace-r.expected @@ -1,2 +1,2 @@ -[ ]{5}0\.0{6} execve\("\./sleep", \["\./sleep", "1"\], \[/\* [[:digit:]]+ vars \*/\]\) = 0 +[ ]{5}0\.0{6} execve\("\.\./sleep", \["\.\./sleep", "1"\], 0x[[:xdigit:]]* /\* [[:digit:]]* vars \*/\) = 0 [ ]{5}(1\.[01]|0\.9)[[:digit:]]{5} \+\+\+ exited with 0 \+\+\+ diff --git a/tests/strace-r.test b/tests/strace-r.test index 4ba01f12..936f4a15 100755 --- a/tests/strace-r.test +++ b/tests/strace-r.test @@ -1,9 +1,14 @@ #!/bin/sh - +# # Check -r option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./sleep 0 -run_strace -r -eexecve ./sleep 1 +run_prog ../sleep 0 +run_strace -r -eexecve ../sleep 1 match_grep diff --git a/tests/strace-t.test b/tests/strace-t.test index 1d213e63..a06408db 100755 --- a/tests/strace-t.test +++ b/tests/strace-t.test @@ -1,20 +1,34 @@ #!/bin/sh - +# # Check -t option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog_skip_if_failed date +%T > /dev/null -run_prog ./sleep 0 +run_prog_skip_if_failed date +%s > "$LOG" +run_prog_skip_if_failed date +%T --date "@$(cat "$LOG")" > /dev/null +run_prog ../sleep 0 -t0="$(date +%T)" +s0="$(date +%s)" run_strace -t -eexecve $args -t1="$(date +%T)" +s1="$(date +%s)" + +s="$s0" +t_reg= +while [ "$s" -le "$s1" ]; do + t="$(date +%T --date "@$s")" + [ -z "$t_reg" ] && t_reg="$t" || t_reg="$t_reg|$t" + s=$(($s + 1)) +done +t_reg="($t_reg)" -EXPECTED="$LOG.expected" -cat > "$EXPECTED" << __EOF__ -($t0|$t1) execve\\("\\./sleep", \\["\\./sleep", "0"\\], \\[/\\* [[:digit:]]+ vars \\*/\\]\\) = 0 +cat > "$EXP" << __EOF__ +$t_reg execve\\("\\.\\./sleep", \\["\\.\\./sleep", "0"\\], 0x[[:xdigit:]]* /\\* [[:digit:]]* vars \\*/\\) = 0 +$t_reg \\+\\+\\+ exited with 0 \\+\\+\\+ __EOF__ -match_grep "$LOG" "$EXPECTED" -rm -f "$EXPECTED" +match_grep "$LOG" "$EXP" diff --git a/tests/strace-tt.test b/tests/strace-tt.test index 3f80001e..4d1331b1 100755 --- a/tests/strace-tt.test +++ b/tests/strace-tt.test @@ -1,12 +1,17 @@ #!/bin/sh - +# # Check -tt option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog_skip_if_failed date +%s > "$LOG" run_prog_skip_if_failed date +%T --date "@$(cat "$LOG")" > /dev/null -run_prog ./sleep 0 +run_prog ../sleep 0 s0="$(date +%s)" run_strace -tt -eexecve $args @@ -21,8 +26,7 @@ while [ "$s" -le "$s1" ]; do done cat > "$EXP" << __EOF__ -($t_reg)\\.[[:digit:]]{6} execve\\("\\./sleep", \\["\\./sleep", "0"\\], \\[/\\* [[:digit:]]+ vars \\*/\\]\\) = 0 +($t_reg)\\.[[:digit:]]{6} execve\\("\\.\\./sleep", \\["\\.\\./sleep", "0"\\], 0x[[:xdigit:]]* /\\* [[:digit:]]* vars \\*/\\) = 0 __EOF__ match_grep "$LOG" "$EXP" -rm -f "$EXP" diff --git a/tests/strace-ttt.test b/tests/strace-ttt.test index 4439715b..089ff064 100755 --- a/tests/strace-ttt.test +++ b/tests/strace-ttt.test @@ -1,11 +1,16 @@ #!/bin/sh - +# # Check -ttt option. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog_skip_if_failed date +%s > /dev/null -run_prog ./sleep 0 +run_prog ../sleep 0 s0="$(date +%s)" run_strace -ttt -eexecve $args @@ -19,8 +24,7 @@ while [ "$s" -le "$s1" ]; do done cat > "$EXP" << __EOF__ -($t_reg)\\.[[:digit:]]{6} execve\\("\\./sleep", \\["\\./sleep", "0"\\], \\[/\\* [[:digit:]]+ vars \\*/\\]\\) = 0 +($t_reg)\\.[[:digit:]]{6} execve\\("\\.\\./sleep", \\["\\.\\./sleep", "0"\\], 0x[[:xdigit:]]* /\\* [[:digit:]]+ vars \\*/\\) = 0 __EOF__ match_grep "$LOG" "$EXP" -rm -f "$EXP" diff --git a/tests/strace.supp b/tests/strace.supp index 578b0a25..248a4716 100644 --- a/tests/strace.supp +++ b/tests/strace.supp @@ -5,3 +5,13 @@ fun:sched_getaffinity* fun:get_cpuset_size } + +{ + qualify_tokens: memleak before error_msg_and_die + Memcheck:Leak + match-leak-kinds: possible + fun:malloc + fun:strdup + fun:xstrdup + fun:qualify_tokens +} diff --git a/tests/struct_flock.c b/tests/struct_flock.c deleted file mode 100644 index 34cf58e6..00000000 --- a/tests/struct_flock.c +++ /dev/null @@ -1,107 +0,0 @@ -/* - * Copyright (c) 2015-2016 Dmitry V. Levin - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (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 -#include -#include -#include -#include "flock.h" - -#define FILE_LEN 4096 -#define EINVAL_STR "-1 EINVAL (Invalid argument)" - -#define TEST_FLOCK_EINVAL(cmd) test_flock_einval(cmd, #cmd) - -#ifdef HAVE_TYPEOF -# define TYPEOF_FLOCK_OFF_T typeof(((struct_kernel_flock *) NULL)->l_len) -#else -# define TYPEOF_FLOCK_OFF_T off_t -#endif - -static long -invoke_test_syscall(const unsigned int cmd, void *const p) -{ - const unsigned long op = (unsigned long) 0xffffffff00000000ULL | cmd; - - return syscall(TEST_SYSCALL_NR, 0, op, (unsigned long) p); -} - -static void -test_flock_einval(const int cmd, const char *name) -{ - struct_kernel_flock fl = { - .l_type = F_RDLCK, - .l_start = (TYPEOF_FLOCK_OFF_T) 0xdefaced1facefeedULL, - .l_len = (TYPEOF_FLOCK_OFF_T) 0xdefaced2cafef00dULL - }; - invoke_test_syscall(cmd, &fl); - printf("%s(0, %s, {l_type=F_RDLCK, l_whence=SEEK_SET" - ", l_start=%jd, l_len=%jd}) = %s\n", TEST_SYSCALL_STR, name, - (intmax_t) fl.l_start, (intmax_t) fl.l_len, EINVAL_STR); -} - -static void -test_flock(void) -{ - TEST_FLOCK_EINVAL(F_SETLK); - TEST_FLOCK_EINVAL(F_SETLKW); - - struct_kernel_flock fl = { - .l_type = F_RDLCK, - .l_len = FILE_LEN - }; - long rc = invoke_test_syscall(F_SETLK, &fl); - printf("%s(0, F_SETLK, {l_type=F_RDLCK, l_whence=SEEK_SET" - ", l_start=0, l_len=%d}) = %s\n", - TEST_SYSCALL_STR, FILE_LEN, rc ? EINVAL_STR : "0"); - if (rc) - return; - - invoke_test_syscall(F_GETLK, &fl); - printf("%s(0, F_GETLK, {l_type=F_UNLCK, l_whence=SEEK_SET" - ", l_start=0, l_len=%d, l_pid=0}) = 0\n", - TEST_SYSCALL_STR, FILE_LEN); - - invoke_test_syscall(F_SETLK, &fl); - printf("%s(0, F_SETLK, {l_type=F_UNLCK, l_whence=SEEK_SET" - ", l_start=0, l_len=%d}) = 0\n", - TEST_SYSCALL_STR, FILE_LEN); -} - -static void -create_sample(void) -{ - char fname[] = TEST_SYSCALL_STR "_XXXXXX"; - - (void) close(0); - if (mkstemp(fname)) - perror_msg_and_fail("mkstemp: %s", fname); - if (unlink(fname)) - perror_msg_and_fail("unlink: %s", fname); - if (ftruncate(0, FILE_LEN)) - perror_msg_and_fail("ftruncate"); -} diff --git a/tests/sun_path.test b/tests/sun_path.test index 728328a8..a2aab664 100755 --- a/tests/sun_path.test +++ b/tests/sun_path.test @@ -1,10 +1,15 @@ #!/bin/sh - +# # Check how long sun_path addresses are traced. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./net-accept-connect 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678 +run_prog ../net-accept-connect 123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678 run_strace_merge -ebind,connect,getsockname $args match_grep diff --git a/tests/swap.c b/tests/swap.c index 77b25050..a854182e 100644 --- a/tests/swap.c +++ b/tests/swap.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/swap.gen.test b/tests/swap.gen.test new file mode 100755 index 00000000..4ca78914 --- /dev/null +++ b/tests/swap.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (swap -a23 -e trace=swapon,swapoff); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a23 -e trace=swapon,swapoff diff --git a/tests/swap.test b/tests/swap.test deleted file mode 100755 index a30e1fd8..00000000 --- a/tests/swap.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check swapon and swapoff syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a23 -e trace=swapon,swapoff diff --git a/tests/sxetmask.c b/tests/sxetmask.c new file mode 100644 index 00000000..3ad2368e --- /dev/null +++ b/tests/sxetmask.c @@ -0,0 +1,104 @@ +/* + * Check decoding of sgetmask and ssetmask syscalls. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include + +#if defined __NR_sgetmask && defined __NR_ssetmask + +# include +# include +# include +# include +# include +# include + +static long +k_sgetmask(void) +{ + return syscall(__NR_sgetmask); +} + +static long +k_ssetmask(const kernel_ulong_t arg) +{ + return syscall(__NR_ssetmask, arg); +} + +int +main(void) +{ + union { + sigset_t libc_mask; + unsigned long old_mask; + } uset, uget; + long rc; + + /* + * Block, reset, and raise SIGUSR1. + * If a subsequent ssetmask call fails to set the proper mask, + * the process will be terminated by SIGUSR1. + */ + sigemptyset(&uset.libc_mask); + sigaddset(&uset.libc_mask, SIGUSR1); + if (sigprocmask(SIG_SETMASK, &uset.libc_mask, NULL)) + perror_msg_and_fail("sigprocmask"); + if (signal(SIGUSR1, SIG_DFL) == SIG_ERR) + perror_msg_and_fail("signal"); + raise(SIGUSR1); + + sigaddset(&uset.libc_mask, SIGUSR2); + rc = k_ssetmask((kernel_ulong_t) 0xfacefeed00000000ULL | uset.old_mask); + if (rc == -1L) { + printf("ssetmask([USR1 USR2]) = %s\n", sprintrc(rc)); + } else { + printf("ssetmask([USR1 USR2]) = %#lx (old mask [USR1])\n", rc); + /* + * Use a regular sigprocmask call to check the value + * returned by the ssetmask call being tested. + */ + if (sigprocmask(SIG_SETMASK, NULL, &uget.libc_mask)) + perror_msg_and_fail("sigprocmask"); + if (uset.old_mask != uget.old_mask) + error_msg_and_fail("sigprocmask returned %#lx" + " instead of %#lx", + uget.old_mask, uset.old_mask); + } + + rc = k_sgetmask(); + if (rc == -1L) { + printf("sgetmask() = %s\n", sprintrc(rc)); + } else { + printf("sgetmask() = %#lx (mask [USR1 USR2])\n", rc); + if (uget.old_mask != (unsigned long) rc) + error_msg_and_fail("sigprocmask returned %#lx", + uget.old_mask); + + if (sizeof(long) > 4) { + sigaddset(&uset.libc_mask, 32 + 27); + if (sigprocmask(SIG_SETMASK, &uset.libc_mask, NULL)) + perror_msg_and_fail("sigprocmask"); + rc = k_sgetmask(); + printf("sgetmask() = %#lx" + " (mask [USR1 USR2 RT_27])\n", rc); + if (uset.old_mask != (unsigned long) rc) + error_msg_and_fail("sigprocmask set %#lx", + uset.old_mask); + } + } + + puts("+++ exited with 0 +++"); + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_sgetmask && __NR_ssetmask") + +#endif diff --git a/tests/sxetmask.gen.test b/tests/sxetmask.gen.test new file mode 100755 index 00000000..fea9e4a0 --- /dev/null +++ b/tests/sxetmask.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sxetmask -a11 -e trace=sgetmask,ssetmask); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=sgetmask,ssetmask diff --git a/tests/symlink.c b/tests/symlink.c index 72cb4908..8283a8e2 100644 --- a/tests/symlink.c +++ b/tests/symlink.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -7,14 +14,12 @@ # include int -main(void) +main(int ac, char **av) { - static const char sample_1[] = "symlink_new"; - static const char sample_2[] = "symlink"; + static const char sample[] = "symlink.sample"; - long rc = syscall(__NR_symlink, sample_1, sample_2); - printf("symlink(\"%s\", \"%s\") = %ld %s (%m)\n", - sample_1, sample_2, rc, errno2name()); + long rc = syscall(__NR_symlink, sample, av[0]); + printf("symlink(\"%s\", \"%s\") = %s\n", sample, av[0], sprintrc(rc)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests/symlink.gen.test b/tests/symlink.gen.test new file mode 100755 index 00000000..8cedfbf4 --- /dev/null +++ b/tests/symlink.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (symlink -a34 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a34 diff --git a/tests/symlink.test b/tests/symlink.test deleted file mode 100755 index 79b93baa..00000000 --- a/tests/symlink.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check symlink syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a34 diff --git a/tests/symlinkat.c b/tests/symlinkat.c index 6e5d617d..be36b941 100644 --- a/tests/symlinkat.c +++ b/tests/symlinkat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/symlinkat.gen.test b/tests/symlinkat.gen.test new file mode 100755 index 00000000..12455dd9 --- /dev/null +++ b/tests/symlinkat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (symlinkat ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/symlinkat.test b/tests/symlinkat.test deleted file mode 100755 index d8501ffd..00000000 --- a/tests/symlinkat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check symlinkat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/sync.c b/tests/sync.c index e6e7ce37..e0b654d0 100644 --- a/tests/sync.c +++ b/tests/sync.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/sync.gen.test b/tests/sync.gen.test new file mode 100755 index 00000000..8436a1fa --- /dev/null +++ b/tests/sync.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sync -a7 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a7 diff --git a/tests/sync.test b/tests/sync.test deleted file mode 100755 index f6bf6c8f..00000000 --- a/tests/sync.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sync syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a7 diff --git a/tests/sync_file_range.c b/tests/sync_file_range.c index 67d31a89..9eba7815 100644 --- a/tests/sync_file_range.c +++ b/tests/sync_file_range.c @@ -1,30 +1,10 @@ /* * Check decoding of sync_file_range syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/sync_file_range.gen.test b/tests/sync_file_range.gen.test new file mode 100755 index 00000000..2f41c7db --- /dev/null +++ b/tests/sync_file_range.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sync_file_range ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/sync_file_range.test b/tests/sync_file_range.test deleted file mode 100755 index 6aa86d6c..00000000 --- a/tests/sync_file_range.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sync_file_range syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/sync_file_range2.c b/tests/sync_file_range2.c index 6ce7db26..03af1005 100644 --- a/tests/sync_file_range2.c +++ b/tests/sync_file_range2.c @@ -1,30 +1,10 @@ /* * Check decoding of sync_file_range2 syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/sync_file_range2.gen.test b/tests/sync_file_range2.gen.test new file mode 100755 index 00000000..d432647a --- /dev/null +++ b/tests/sync_file_range2.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sync_file_range2 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/sync_file_range2.test b/tests/sync_file_range2.test deleted file mode 100755 index 0d9945ed..00000000 --- a/tests/sync_file_range2.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check sync_file_range2 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/syntax.sh b/tests/syntax.sh new file mode 100644 index 00000000..2e30e6a1 --- /dev/null +++ b/tests/syntax.sh @@ -0,0 +1,59 @@ +#!/bin/sh +# +# Define syntax testing primitives. +# +# Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +check_exit_status_and_stderr() +{ + $STRACE "$@" 2> "$LOG" && + dump_log_and_fail_with \ + "strace $* failed to handle the error properly" + match_diff "$LOG" "$EXP" || + dump_log_and_fail_with \ + "strace $* failed to print expected diagnostics" +} + +check_exit_status_and_stderr_using_grep() +{ + $STRACE "$@" 2> "$LOG" && + dump_log_and_fail_with \ + "strace $* failed to handle the error properly" + match_grep "$LOG" "$EXP" || + dump_log_and_fail_with \ + "strace $* failed to print expected diagnostics" +} + +check_e() +{ + local pattern="$1"; shift + cat > "$EXP" << __EOF__ +$STRACE_EXE: $pattern +__EOF__ + check_exit_status_and_stderr "$@" +} + +check_e_using_grep() +{ + local pattern="$1"; shift + cat > "$EXP" << __EOF__ +$STRACE_EXE: $pattern +__EOF__ + check_exit_status_and_stderr_using_grep "$@" +} + +check_h() +{ + local pattern="$1"; shift + cat > "$EXP" << __EOF__ +$STRACE_EXE: $pattern +Try '$STRACE_EXE -h' for more information. +__EOF__ + check_exit_status_and_stderr "$@" +} diff --git a/tests/sysinfo.c b/tests/sysinfo.c index 377bdc9c..bf07661a 100644 --- a/tests/sysinfo.c +++ b/tests/sysinfo.c @@ -3,29 +3,10 @@ * * Copyright (c) 2015 Elvira Khabirova * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -38,7 +19,7 @@ main(void) sysinfo(NULL); printf("sysinfo(NULL) = -1 EFAULT (%m)\n"); - struct sysinfo * const si = tail_alloc(sizeof(*si)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct sysinfo, si); if (sysinfo(si)) perror_msg_and_skip("sysinfo"); diff --git a/tests/sysinfo.gen.test b/tests/sysinfo.gen.test new file mode 100755 index 00000000..fa462376 --- /dev/null +++ b/tests/sysinfo.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (sysinfo -a14 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 diff --git a/tests/sysinfo.test b/tests/sysinfo.test deleted file mode 100755 index 806d8b61..00000000 --- a/tests/sysinfo.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of sysinfo syscall - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a14 diff --git a/tests/syslog.c b/tests/syslog.c index 5df96cb8..363fdf96 100644 --- a/tests/syslog.c +++ b/tests/syslog.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/syslog.gen.test b/tests/syslog.gen.test new file mode 100755 index 00000000..5707a3e2 --- /dev/null +++ b/tests/syslog.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (syslog -a36 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 diff --git a/tests/syslog.test b/tests/syslog.test deleted file mode 100755 index 1c2158e4..00000000 --- a/tests/syslog.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check syslog syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a36 diff --git a/tests/tail_alloc.c b/tests/tail_alloc.c index 08081d4f..693196ef 100644 --- a/tests/tail_alloc.c +++ b/tests/tail_alloc.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/tee.c b/tests/tee.c index 66d1c94f..2137c351 100644 --- a/tests/tee.c +++ b/tests/tee.c @@ -1,30 +1,10 @@ /* * This file is part of tee strace test. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/tee.gen.test b/tests/tee.gen.test new file mode 100755 index 00000000..b5fbfc05 --- /dev/null +++ b/tests/tee.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (tee ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/tee.test b/tests/tee.test deleted file mode 100755 index 76b60003..00000000 --- a/tests/tee.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check tee syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/termsig.test b/tests/termsig.test new file mode 100755 index 00000000..d41ddf0a --- /dev/null +++ b/tests/termsig.test @@ -0,0 +1,20 @@ +#!/bin/sh +# +# Check termination signal forwarding. +# +# Copyright (c) 2017-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_expect_termsig="../run_expect_termsig 15" +unblock_reset_raise="../unblock_reset_raise 15" + +run_prog $run_expect_termsig $unblock_reset_raise +STRACE="$run_expect_termsig $STRACE" + +for i in 1 2 3 4; do + run_strace -I$i -enone -esignal=none $unblock_reset_raise +done diff --git a/tests/test_netlink.h b/tests/test_netlink.h new file mode 100644 index 00000000..2ce476d5 --- /dev/null +++ b/tests/test_netlink.h @@ -0,0 +1,104 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include "print_fields.h" + +#include +#include +#include +#include +#include "netlink.h" + +#define TEST_NETLINK_(fd_, nlh0_, \ + type_, type_str_, \ + flags_, flags_str_, \ + data_len_, src_, slen_, ...) \ + do { \ + struct nlmsghdr *const TEST_NETLINK_nlh = \ + (nlh0_) - (slen_); \ + const unsigned int msg_len = \ + NLMSG_HDRLEN + (data_len_); \ + \ + SET_STRUCT(struct nlmsghdr, TEST_NETLINK_nlh, \ + .nlmsg_len = msg_len, \ + .nlmsg_type = (type_), \ + .nlmsg_flags = (flags_) \ + ); \ + memcpy(NLMSG_DATA(TEST_NETLINK_nlh), (src_), (slen_)); \ + \ + const char *const errstr = \ + sprintrc(sendto((fd_), TEST_NETLINK_nlh, \ + msg_len, MSG_DONTWAIT, \ + NULL, 0)); \ + \ + printf("sendto(%d, {{len=%u, type=%s" \ + ", flags=%s, seq=0, pid=0}, ", \ + (fd_), msg_len, (type_str_), (flags_str_)); \ + \ + { __VA_ARGS__; } \ + \ + printf("}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", \ + msg_len, errstr); \ + } while (0) + +#define TEST_NETLINK(fd_, nlh0_, type_, flags_, \ + data_len_, src_, slen_, ...) \ + TEST_NETLINK_((fd_), (nlh0_), \ + (type_), #type_, \ + (flags_), #flags_, \ + (data_len_), (src_), (slen_), __VA_ARGS__) + +#define TEST_NETLINK_OBJECT_EX_(fd_, nlh0_, \ + type_, type_str_, \ + flags_, flags_str_, \ + obj_, fallback_func, ...) \ + do { \ + char pattern[DEFAULT_STRLEN]; \ + fill_memory_ex(pattern, sizeof(pattern), \ + 'a', 'z' - 'a' + 1); \ + const unsigned int plen = \ + sizeof(obj_) - 1 > DEFAULT_STRLEN \ + ? DEFAULT_STRLEN : (int) sizeof(obj_) - 1; \ + /* len < sizeof(obj_) */ \ + TEST_NETLINK_((fd_), (nlh0_), \ + (type_), (type_str_), \ + (flags_), (flags_str_), \ + plen, pattern, plen, \ + (fallback_func)(pattern, plen)); \ + /* short read of sizeof(obj_) */ \ + TEST_NETLINK_((fd_), (nlh0_), \ + (type_), (type_str_), \ + (flags_), (flags_str_), \ + sizeof(obj_), \ + pattern, plen, \ + printf("%p", \ + NLMSG_DATA(TEST_NETLINK_nlh))); \ + /* sizeof(obj_) */ \ + TEST_NETLINK_((fd_), (nlh0_), \ + (type_), (type_str_), \ + (flags_), (flags_str_), \ + sizeof(obj_), \ + &(obj_), sizeof(obj_), \ + __VA_ARGS__); \ + } while (0) + +#define TEST_NETLINK_OBJECT_EX(fd_, nlh0_, \ + type_, flags_, \ + obj_, fallback_func, ...) \ + TEST_NETLINK_OBJECT_EX_((fd_), (nlh0), \ + (type_), #type_, \ + (flags_), #flags_, \ + (obj_), (fallback_func), __VA_ARGS__) + +#define TEST_NETLINK_OBJECT(fd_, nlh0_, \ + type_, flags_, \ + obj_, ...) \ + TEST_NETLINK_OBJECT_EX_((fd_), (nlh0), \ + (type_), #type_, \ + (flags_), #flags_, \ + (obj_), print_quoted_hex, __VA_ARGS__) diff --git a/tests/test_nlattr.h b/tests/test_nlattr.h new file mode 100644 index 00000000..8b8c66b8 --- /dev/null +++ b/tests/test_nlattr.h @@ -0,0 +1,343 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include "print_fields.h" + +#include +#include +#include +#include +#include "netlink.h" +#include + +static void +init_nlattr(struct nlattr *const nla, + const uint16_t nla_len, + const uint16_t nla_type, + const void *const src, + const size_t n) +{ + SET_STRUCT(struct nlattr, nla, + .nla_len = nla_len, + .nla_type = nla_type, + ); + + memcpy(RTA_DATA(nla), src, n); +} + +static void +print_nlattr(const unsigned int nla_len, const char *const nla_type, bool add_data) +{ + printf(", %s{{nla_len=%u, nla_type=%s}, ", + add_data ? "[" : "", nla_len, nla_type); +} + +#define TEST_NLATTR_EX_(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, nla_type_str_, \ + nla_data_len_, nla_total_len_, \ + src_, slen_, ...) \ + do { \ + struct nlmsghdr *const nlh = \ + (nlh0_) - (NLA_HDRLEN + (slen_)); \ + struct nlattr *const TEST_NLATTR_nla = \ + NLMSG_ATTR(nlh, (hdrlen_)); \ + const unsigned int nla_len = \ + NLA_HDRLEN + (nla_data_len_); \ + const unsigned int msg_len = \ + NLMSG_SPACE(hdrlen_) + NLA_HDRLEN + (nla_total_len_); \ + \ + (init_msg_)(nlh, msg_len); \ + init_nlattr(TEST_NLATTR_nla, nla_len, (nla_type_), \ + (src_), (slen_)); \ + \ + const char *const errstr = \ + sprintrc(sendto((fd_), nlh, msg_len, \ + MSG_DONTWAIT, NULL, 0)); \ + \ + printf("sendto(%d, {", (fd_)); \ + (print_msg_)(msg_len); \ + print_nlattr(nla_len, (nla_type_str_), \ + (nla_total_len_) > (nla_data_len_)); \ + \ + { __VA_ARGS__; } \ + \ + if ((nla_total_len_) > (nla_data_len_)) \ + printf("]"); \ + \ + printf("}}, %u, MSG_DONTWAIT, NULL, 0) = %s\n", \ + msg_len, errstr); \ + } while (0) + +#define TEST_NLATTR_(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, nla_type_str_, \ + nla_data_len_, src_, slen_, ...) \ + TEST_NLATTR_EX_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), (nla_type_str_), \ + (nla_data_len_), (nla_data_len_), \ + (src_), (slen_), __VA_ARGS__) + +#define TEST_NLATTR(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, \ + nla_data_len_, src_, slen_, ...) \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + (nla_data_len_), (src_), (slen_), __VA_ARGS__) + +#define TEST_NLATTR_OBJECT_EX_(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, nla_type_str_, \ + pattern_, obj_, fallback_func, ...) \ + do { \ + const unsigned int plen = \ + sizeof(obj_) - 1 > DEFAULT_STRLEN \ + ? DEFAULT_STRLEN : (int) sizeof(obj_) - 1; \ + /* len < sizeof(obj_) */ \ + if (plen > 0) \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), (nla_type_str_), \ + plen, (pattern_), plen, \ + (fallback_func)((pattern_), plen)); \ + /* short read of sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), (nla_type_str_), \ + sizeof(obj_), \ + (pattern_), sizeof(obj_) - 1, \ + printf("%p", \ + RTA_DATA(NLMSG_ATTR(nlh, (hdrlen_))))); \ + /* sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), (nla_type_str_), \ + sizeof(obj_), \ + &(obj_), sizeof(obj_), \ + __VA_ARGS__); \ + } while (0) + +#define TEST_NLATTR_OBJECT_EX(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, \ + pattern_, obj_, fallback_func, ...) \ + TEST_NLATTR_OBJECT_EX_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + (pattern_), (obj_), (fallback_func), \ + __VA_ARGS__) + +#define TEST_NLATTR_OBJECT(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, pattern_, obj_, ...) \ + TEST_NLATTR_OBJECT_EX_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + (pattern_), (obj_), print_quoted_hex, \ + __VA_ARGS__) + +#define TEST_NLATTR_ARRAY(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, pattern_, obj_, print_elem_) \ + do { \ + const unsigned int plen = \ + sizeof((obj_)[0]) - 1 > DEFAULT_STRLEN \ + ? DEFAULT_STRLEN : (int) sizeof((obj_)[0]) - 1; \ + /* len < sizeof((obj_)[0]) */ \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + plen, (pattern_), plen, \ + print_quoted_hex((pattern_), plen)); \ + /* sizeof((obj_)[0]) < len < sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + sizeof(obj_) - 1, \ + &(obj_), sizeof(obj_) - 1, \ + printf("["); \ + size_t i; \ + for (i = 0; i < ARRAY_SIZE(obj_) - 1; ++i) { \ + if (i) printf(", "); \ + (print_elem_)(&(obj_)[i], i); \ + } \ + printf("]")); \ + /* short read of sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + sizeof(obj_), \ + &(obj_), sizeof(obj_) - 1, \ + printf("["); \ + size_t i; \ + for (i = 0; i < ARRAY_SIZE(obj_) - 1; ++i) { \ + if (i) printf(", "); \ + (print_elem_)(&(obj_)[i], i); \ + } \ + printf(", ... /* %p */]", \ + RTA_DATA(NLMSG_ATTR(nlh, (hdrlen_))) \ + + sizeof(obj_) - sizeof((obj_)[0]))); \ + /* sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + sizeof(obj_), \ + &(obj_), sizeof(obj_), \ + printf("["); \ + size_t i; \ + for (i = 0; i < ARRAY_SIZE(obj_); ++i) { \ + if (i) printf(", "); \ + (print_elem_)(&(obj_)[i], i); \ + } \ + printf("]")); \ + } while (0) + +#define TEST_NESTED_NLATTR_OBJECT_EX_(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, nla_type_str_, \ + pattern_, obj_, fallback_func, \ + depth_, ...) \ + do { \ + const unsigned int plen = \ + sizeof(obj_) - 1 > DEFAULT_STRLEN \ + ? DEFAULT_STRLEN : (int) sizeof(obj_) - 1; \ + /* len < sizeof(obj_) */ \ + if (plen > 0) \ + TEST_NLATTR_((fd_), (nlh0_) - NLA_HDRLEN * depth_, \ + (hdrlen_) + NLA_HDRLEN * depth_, \ + (init_msg_), (print_msg_), \ + (nla_type_), (nla_type_str_), \ + plen, (pattern_), plen, \ + (fallback_func)((pattern_), plen); \ + size_t i; \ + for (i = 0; i < depth_; ++i) \ + printf("}")); \ + /* short read of sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_) - NLA_HDRLEN * depth_, \ + (hdrlen_) + NLA_HDRLEN * depth_, \ + (init_msg_), (print_msg_), \ + (nla_type_), (nla_type_str_), \ + sizeof(obj_), \ + (pattern_), sizeof(obj_) - 1, \ + printf("%p", RTA_DATA(TEST_NLATTR_nla)); \ + size_t i; \ + for (i = 0; i < depth_; ++i) \ + printf("}")); \ + /* sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_) - NLA_HDRLEN * depth_, \ + (hdrlen_) + NLA_HDRLEN * depth_, \ + (init_msg_), (print_msg_), \ + (nla_type_), (nla_type_str_), \ + sizeof(obj_), \ + &(obj_), sizeof(obj_), \ + __VA_ARGS__; \ + size_t i; \ + for (i = 0; i < depth_; ++i) \ + printf("}")); \ + } while (0) + +#define TEST_NESTED_NLATTR_OBJECT_EX(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, pattern_, obj_, \ + depth_, ...) \ + TEST_NESTED_NLATTR_OBJECT_EX_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + (pattern_), (obj_), \ + print_quoted_hex, (depth_), \ + __VA_ARGS__) + +#define TEST_NESTED_NLATTR_OBJECT(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, pattern_, obj_, ...) \ + TEST_NESTED_NLATTR_OBJECT_EX_((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + (pattern_), (obj_), \ + print_quoted_hex, 1, \ + __VA_ARGS__) + +#define TEST_NESTED_NLATTR_ARRAY_EX(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, pattern_, obj_, depth_, \ + print_elem_) \ + do { \ + const unsigned int plen = \ + sizeof((obj_)[0]) - 1 > DEFAULT_STRLEN \ + ? DEFAULT_STRLEN : (int) sizeof((obj_)[0]) - 1; \ + /* len < sizeof((obj_)[0]) */ \ + TEST_NLATTR_((fd_), (nlh0_) - NLA_HDRLEN * depth_, \ + (hdrlen_) + NLA_HDRLEN * depth_, \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + plen, (pattern_), plen, \ + print_quoted_hex((pattern_), plen); \ + for (size_t i = 0; i < depth_; ++i) \ + printf("}")); \ + /* sizeof((obj_)[0]) < len < sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_) - NLA_HDRLEN * depth_, \ + (hdrlen_) + NLA_HDRLEN * depth_, \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + sizeof(obj_) - 1, \ + &(obj_), sizeof(obj_) - 1, \ + printf("["); \ + size_t i; \ + for (i = 0; i < ARRAY_SIZE(obj_) - 1; ++i) { \ + if (i) printf(", "); \ + (print_elem_)(&(obj_)[i], i); \ + } \ + printf("]"); \ + for (i = 0; i < depth_; ++i) \ + printf("}")); \ + /* short read of sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_) - NLA_HDRLEN * depth_, \ + (hdrlen_) + NLA_HDRLEN * depth_, \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + sizeof(obj_), \ + &(obj_), sizeof(obj_) - 1, \ + printf("["); \ + size_t i; \ + for (i = 0; i < ARRAY_SIZE(obj_) - 1; ++i) { \ + if (i) printf(", "); \ + (print_elem_)(&(obj_)[i], i); \ + } \ + printf(", ... /* %p */]", \ + RTA_DATA(TEST_NLATTR_nla) \ + + sizeof(obj_) - sizeof((obj_)[0])); \ + for (i = 0; i < depth_; ++i) \ + printf("}")); \ + /* sizeof(obj_) */ \ + TEST_NLATTR_((fd_), (nlh0_) - NLA_HDRLEN * depth_, \ + (hdrlen_) + NLA_HDRLEN * depth_, \ + (init_msg_), (print_msg_), \ + (nla_type_), #nla_type_, \ + sizeof(obj_), \ + &(obj_), sizeof(obj_), \ + printf("["); \ + size_t i; \ + for (i = 0; i < ARRAY_SIZE(obj_); ++i) { \ + if (i) printf(", "); \ + (print_elem_)(&(obj_)[i], i); \ + } \ + printf("]"); \ + for (i = 0; i < depth_; ++i) \ + printf("}")); \ + } while (0) + +#define TEST_NESTED_NLATTR_ARRAY(fd_, nlh0_, hdrlen_, \ + init_msg_, print_msg_, \ + nla_type_, pattern_, obj_, print_elem_)\ + TEST_NESTED_NLATTR_ARRAY_EX((fd_), (nlh0_), (hdrlen_), \ + (init_msg_), (print_msg_), \ + nla_type_, (pattern_), (obj_), 1, \ + (print_elem_)) diff --git a/tests/test_printpath.c b/tests/test_printpath.c new file mode 100644 index 00000000..e341e389 --- /dev/null +++ b/tests/test_printpath.c @@ -0,0 +1,91 @@ +/* + * Test printpath/umovestr. + * + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include + +#include "test_ucopy.h" + +static void +test_printpath_at(char *const p, const unsigned int test_max) +{ + /* + * / + * /. + * /.. + * /... + * /../. + * /../.. + * /../../ + */ + + char *const eop = p + (test_max - 1); + *eop = '\0'; + unsigned int i; + for (i = 1; i < test_max; ++i) { + const unsigned int i_1 = i - 1; + memmove(eop - i, eop - i_1, i_1); + eop[-1] = "/.."[i_1 % 3]; + if (chdir(eop - i)) + perror_msg_and_fail("chdir"); + printf("chdir(\"%s\") = 0\n", eop - i); + } +} + +static void +test_efault(const unsigned int test_max) +{ + char *p = tail_alloc(test_max); + const char *const efault = p + test_max; + memset(p, '/', test_max); + + for (; p <= efault; ++p) { + if (p <= efault - PATH_MAX) + continue; + printf("chdir(%p) = %s\n", p, sprintrc(chdir(p))); + } +} + +static void +test_enametoolong(void) +{ + char *p = tail_alloc(PATH_MAX); + memset(p, '/', PATH_MAX); + + printf("chdir(\"%.*s\"...) = %s\n", + PATH_MAX - 1, p, sprintrc(chdir(p))); +} + +void +test_printpath(const unsigned int test_max) +{ + /* + * /../..| + * /../.|. + * /../|.. + * /..|/.. + * /.|./.. + * /|../.. + * |/../.. + */ + const unsigned int page_size = get_page_size(); + char *p = tail_alloc(test_max + page_size); + unsigned int i; + for (i = 1; i < sizeof(long); ++i) + test_printpath_at(p + i, test_max); + for (i = 0; i < sizeof(long); ++i) + test_printpath_at(p + page_size - i, test_max); + test_efault(test_max); + test_enametoolong(); +} diff --git a/tests/test_printstrn.c b/tests/test_printstrn.c new file mode 100644 index 00000000..09c438d1 --- /dev/null +++ b/tests/test_printstrn.c @@ -0,0 +1,99 @@ +/* + * Test printstrn/umoven. + * + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include + +#include "scno.h" +#include "test_ucopy.h" + +static const char *errstr; + +static void add_key(const char *addr, const unsigned int len) +{ + errstr = sprintrc(syscall(__NR_add_key, 0, 0, addr, len, -1)); +} + +static void +test_printstrn_at(char *const p, const unsigned int test_max) +{ + unsigned int i; + + for (i = 0; i <= test_max; ++i) { + add_key(p + (test_max - i), i); + printf("add_key(NULL, NULL, \"%.*s\", %u" + ", KEY_SPEC_THREAD_KEYRING) = %s\n", + (int) i, p + (test_max - i), i, errstr); + } +} + +static void +test_efault(const unsigned int test_max) +{ + char *p = tail_alloc(test_max); + memset(p, '/', test_max); + unsigned int i; + + for (i = 0; i <= test_max; ++i) { + unsigned int j; + for (j = 1; j <= sizeof(long); ++j) { + add_key(p + (test_max - i), i + j); + printf("add_key(NULL, NULL, %p, %u" + ", KEY_SPEC_THREAD_KEYRING) = %s\n", + p + (test_max - i), i + j, errstr); + } + } +} + +static void +test_print_memory(char *const p, const unsigned int test_max) +{ + add_key(p, test_max); + printf("add_key(NULL, NULL, "); + print_quoted_memory(p, test_max); + printf(", %u, KEY_SPEC_THREAD_KEYRING) = %s\n", test_max, errstr); +} + +void +test_printstrn(const unsigned int test_max) +{ + /* + * abcdefgh| + * abcdefg|h + * abcdef|gh + * abcde|fgh + * abcd|efgh + * abc|defgh + * ab|cdefgh + * a|bcdefgh + * |abcdefgh + */ + const unsigned int page_size = get_page_size(); + char *p = tail_alloc(test_max + page_size); + fill_memory_ex(p, test_max + page_size, 'a', 'z' - 'a' + 1); + + unsigned int i; + for (i = 1; i <= sizeof(long); ++i) + test_printstrn_at(p + i, test_max); + for (i = 0; i < sizeof(long); ++i) + test_printstrn_at(p + page_size - i, test_max); + test_efault(test_max); + + fill_memory_ex(p, test_max + page_size, 0x00, 0xFF); + /* Test corner cases when octal quoting goes before digit */ + for (i = 0; i < 11; i++) + p[2 + 3 * i] = '0' + i - 1; + + test_print_memory(p, test_max); +} diff --git a/tests/test_ucopy.c b/tests/test_ucopy.c new file mode 100644 index 00000000..78d393b2 --- /dev/null +++ b/tests/test_ucopy.c @@ -0,0 +1,143 @@ +/* + * Test whether process_vm_readv and PTRACE_PEEKDATA work. + * + * Copyright (c) 2016-2017 Dmitry V. Levin + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "test_ucopy.h" + +#ifndef HAVE_PROCESS_VM_READV + +# include +# include "scno.h" +static ssize_t +strace_process_vm_readv(pid_t pid, + const struct iovec *lvec, + unsigned long liovcnt, + const struct iovec *rvec, + unsigned long riovcnt, + unsigned long flags) +{ + return syscall(__NR_process_vm_readv, + (long) pid, lvec, liovcnt, rvec, riovcnt, flags); +} +# define process_vm_readv strace_process_vm_readv + +#endif /* !HAVE_PROCESS_VM_READV */ + +static bool +call_process_vm_readv(const int pid, long *const addr) +{ + long data = 0; + + const struct iovec local = { + .iov_base = &data, + .iov_len = sizeof(data) + }; + const struct iovec remote = { + .iov_base = addr, + .iov_len = sizeof(*addr) + }; + + return process_vm_readv(pid, &local, 1, &remote, 1, 0) == sizeof(data) + && data == 1; +} + +static bool +call_ptrace_peekdata(const int pid, long *const addr) +{ + return ptrace(PTRACE_PEEKDATA, pid, addr, 0) == 1; +} + +static bool +test_ucopy(bool (*fn)(int pid, long *addr)) +{ + static long data; + + data = 0; + bool rc = false; + int saved = 0; + + pid_t pid = fork(); + if (pid < 0) + perror_msg_and_fail("fork"); + + if (!pid) { + data = 1; + if (ptrace(PTRACE_TRACEME, 0, 0, 0)) + perror_msg_and_fail("PTRACE_TRACEME"); + raise(SIGSTOP); + _exit(0); + } + + for (;;) { + int status, tracee; + + errno = 0; + tracee = wait(&status); + if (tracee != pid) { + if (errno == EINTR) + continue; + saved = errno; + kill(pid, SIGKILL); + errno = saved; + perror_msg_and_fail("wait"); + } + if (WIFEXITED(status)) { + if (WEXITSTATUS(status) == 0) + break; + error_msg_and_fail("unexpected exit status %u", + WEXITSTATUS(status)); + } + if (WIFSIGNALED(status)) + error_msg_and_fail("unexpected signal %u", + WTERMSIG(status)); + if (!WIFSTOPPED(status) || WSTOPSIG(status) != SIGSTOP) { + kill(pid, SIGKILL); + error_msg_and_fail("unexpected wait status %x", + status); + } + + errno = 0; + rc = fn(pid, &data); + if (!rc) + saved = errno; + + if (ptrace(PTRACE_CONT, pid, 0, 0)) { + saved = errno; + kill(pid, SIGKILL); + errno = saved; + perror_msg_and_fail("PTRACE_CONT"); + } + } + + if (!rc) + errno = saved; + return rc; +} + +bool +test_process_vm_readv(void) +{ + return test_ucopy(call_process_vm_readv); +} + +bool +test_ptrace_peekdata(void) +{ + return test_ucopy(call_ptrace_peekdata); +} diff --git a/tests/test_ucopy.h b/tests/test_ucopy.h new file mode 100644 index 00000000..1a3b2819 --- /dev/null +++ b/tests/test_ucopy.h @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include + +extern bool +test_process_vm_readv(void); + +extern bool +test_ptrace_peekdata(void); + +extern void +test_printpath(unsigned int test_max_size); + +extern void +test_printstrn(unsigned int test_max_size); diff --git a/tests/tests.h b/tests/tests.h index d4294de9..1a1b02c3 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -1,49 +1,66 @@ /* * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef STRACE_TESTS_H -#define STRACE_TESTS_H +# define STRACE_TESTS_H # ifdef HAVE_CONFIG_H # include "config.h" # endif +# ifdef TESTS_SIZEOF_KERNEL_LONG_T +# undef SIZEOF_KERNEL_LONG_T +# define SIZEOF_KERNEL_LONG_T TESTS_SIZEOF_KERNEL_LONG_T +# endif + +# ifdef TESTS_SIZEOF_LONG +# undef SIZEOF_LONG +# define SIZEOF_LONG TESTS_SIZEOF_LONG +# endif + +# include # include # include "kernel_types.h" # include "gcc_compat.h" +# include "macros.h" + +/* + * The printf-like function to use in header files + * shared between strace and its tests. + */ +# ifndef STRACE_PRINTF +# define STRACE_PRINTF printf +# endif /* Tests of "strace -v" are expected to define VERBOSE to 1. */ -#ifndef VERBOSE -# define VERBOSE 0 -#endif +# ifndef VERBOSE +# define VERBOSE 0 +# endif + +/* xlat verbosity defaults */ +# ifndef XLAT_RAW +# define XLAT_RAW 0 +# endif +# ifndef XLAT_VERBOSE +# define XLAT_VERBOSE 0 +# endif + +# ifndef DEFAULT_STRLEN +/* Default maximum # of bytes printed in printstr et al. */ +# define DEFAULT_STRLEN 32 +# endif /* Cached sysconf(_SC_PAGESIZE). */ size_t get_page_size(void); +/* The size of kernel's sigset_t. */ +unsigned int get_sigset_size(void); + /* Print message and strerror(errno) to stderr, then exit(1). */ void perror_msg_and_fail(const char *, ...) ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; @@ -57,9 +74,21 @@ void error_msg_and_skip(const char *, ...) void perror_msg_and_skip(const char *, ...) ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN; +# ifndef perror_msg_and_fail +# define perror_msg_and_fail(fmt_, ...) \ + perror_msg_and_fail("%s:%d: " fmt_, __FILE__, __LINE__, ##__VA_ARGS__) +# endif +# ifndef perror_msg_and_fail +# define error_msg_and_fail(fmt_, ...) \ + error_msg_and_fail("%s:%d: " fmt_, __FILE__, __LINE__, ##__VA_ARGS__) +# endif + +/* Stat the specified file and skip the test if the stat call failed. */ +void skip_if_unavailable(const char *); + /* * Allocate memory that ends on the page boundary. - * Pages allocated by this call are preceeded by an unmapped page + * Pages allocated by this call are preceded by an unmapped page * and followed also by an unmapped page. */ void *tail_alloc(const size_t) @@ -68,13 +97,32 @@ void *tail_alloc(const size_t) void *tail_memdup(const void *, const size_t) ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((2)); +# define midtail_alloc(after_, before_) \ + ((void *) ((char *) tail_alloc(((before_) + (after_))) + (before_))) + +/* + * Allocate an object of the specified type at the end + * of a mapped memory region. + * Assign its address to the specified constant pointer. + */ +# define TAIL_ALLOC_OBJECT_CONST_PTR(type_name, type_ptr) \ + type_name *const type_ptr = tail_alloc(sizeof(*type_ptr)) + +/* + * Allocate an object of the specified type at the end + * of a mapped memory region. + * Assign its address to the specified variable pointer. + */ +# define TAIL_ALLOC_OBJECT_VAR_PTR(type_name, type_ptr) \ + type_name *type_ptr = tail_alloc(sizeof(*type_ptr)) + /* * Fill memory (pointed by ptr, having size bytes) with different bytes (with * values starting with start and resetting every period) in order to catch * sign, byte order and/or alignment errors. */ void fill_memory_ex(void *ptr, size_t size, unsigned char start, - unsigned char period); + unsigned int period); /* Shortcut for fill_memory_ex(ptr, size, 0x80, 0x80) */ void fill_memory(void *ptr, size_t size); @@ -94,11 +142,39 @@ const char *hexquote_strndup(const char *, size_t); /* Return inode number of socket descriptor. */ unsigned long inode_of_sockfd(int); +/* Print string in a quoted form with optional escape characters. */ +void print_quoted_string_ex(const char *, bool quote, const char *escape_str); + /* Print string in a quoted form. */ void print_quoted_string(const char *); +/* + * Print a NUL-terminated string `str' of length up to `size' - 1 + * in a quoted form. + */ +void print_quoted_cstring(const char *str, size_t size); + +/* + * Print a NUL-terminated string `str' of length up to `size' + * in a quoted form. + */ +void print_quoted_stringn(const char *str, size_t size); + +/* Print memory in a quoted form with optional escape characters. */ +void print_quoted_memory_ex(const void *, size_t, bool quote, + const char *escape_chars); + /* Print memory in a quoted form. */ -void print_quoted_memory(const char *, size_t); +void print_quoted_memory(const void *, size_t); + +/* Print memory in a hexquoted form. */ +void print_quoted_hex(const void *, size_t); + +/* Print time_t and nanoseconds in symbolic format. */ +void print_time_t_nsec(time_t, unsigned long long, int); + +/* Print time_t and microseconds in symbolic format. */ +void print_time_t_usec(time_t, unsigned long long, int); /* Read an int from the file. */ int read_int_from_file(const char *, int *); @@ -138,11 +214,24 @@ struct timespec; int recv_mmsg(int, struct mmsghdr *, unsigned int, unsigned int, struct timespec *); int send_mmsg(int, struct mmsghdr *, unsigned int, unsigned int); +/* Create a netlink socket. */ +int create_nl_socket_ext(int proto, const char *name); +# define create_nl_socket(proto) create_nl_socket_ext((proto), #proto) + /* Create a pipe with maximized descriptor numbers. */ void pipe_maxfd(int pipefd[2]); -#define F8ILL_KULONG_SUPPORTED (sizeof(void *) < sizeof(kernel_ulong_t)) -#define F8ILL_KULONG_MASK ((kernel_ulong_t) 0xffffffff00000000ULL) +/* if_nametoindex("lo") */ +unsigned int ifindex_lo(void); + +# ifdef HAVE_IF_INDEXTONAME +# define IFINDEX_LO_STR "if_nametoindex(\"lo\")" +# else +# define IFINDEX_LO_STR "1" +# endif + +# define F8ILL_KULONG_SUPPORTED (sizeof(void *) < sizeof(kernel_ulong_t)) +# define F8ILL_KULONG_MASK ((kernel_ulong_t) 0xffffffff00000000ULL) /* * For 64-bit kernel_ulong_t and 32-bit pointer, @@ -157,11 +246,10 @@ f8ill_ptr_to_kulong(const void *const ptr) ? F8ILL_KULONG_MASK | uptr : (kernel_ulong_t) uptr; } -# define ARRAY_SIZE(arg) ((unsigned int) (sizeof(arg) / sizeof((arg)[0]))) # define LENGTH_OF(arg) ((unsigned int) sizeof(arg) - 1) /* Zero-extend a signed integer type to unsigned long long. */ -#define zero_extend_signed_to_ull(v) \ +# define zero_extend_signed_to_ull(v) \ (sizeof(v) == sizeof(char) ? (unsigned long long) (unsigned char) (v) : \ sizeof(v) == sizeof(short) ? (unsigned long long) (unsigned short) (v) : \ sizeof(v) == sizeof(int) ? (unsigned long long) (unsigned int) (v) : \ @@ -169,7 +257,7 @@ f8ill_ptr_to_kulong(const void *const ptr) (unsigned long long) (v)) /* Sign-extend an unsigned integer type to long long. */ -#define sign_extend_unsigned_to_ll(v) \ +# define sign_extend_unsigned_to_ll(v) \ (sizeof(v) == sizeof(char) ? (long long) (char) (v) : \ sizeof(v) == sizeof(short) ? (long long) (short) (v) : \ sizeof(v) == sizeof(int) ? (long long) (int) (v) : \ @@ -179,26 +267,6 @@ f8ill_ptr_to_kulong(const void *const ptr) # define SKIP_MAIN_UNDEFINED(arg) \ int main(void) { error_msg_and_skip("undefined: %s", arg); } -/* - * The kernel used to define 64-bit types on 64-bit systems on a per-arch - * basis. Some architectures would use unsigned long and others would use - * unsigned long long. These types were exported as part of the - * kernel-userspace ABI and now must be maintained forever. This matches - * what the kernel exports for each architecture so we don't need to cast - * every printing of __u64 or __s64 to stdint types. - */ -# if SIZEOF_LONG == 4 -# define PRI__64 "ll" -# elif defined ALPHA || defined IA64 || defined MIPS || defined POWERPC -# define PRI__64 "l" -# else -# define PRI__64 "ll" -# endif - -# define PRI__d64 PRI__64"d" -# define PRI__u64 PRI__64"u" -# define PRI__x64 PRI__64"x" - # if WORDS_BIGENDIAN # define LL_PAIR(HI, LO) (HI), (LO) # else @@ -206,8 +274,19 @@ f8ill_ptr_to_kulong(const void *const ptr) # endif # define LL_VAL_TO_PAIR(llval) LL_PAIR((long) ((llval) >> 32), (long) (llval)) -# define _STR(_arg) #_arg # define ARG_STR(_arg) (_arg), #_arg # define ARG_ULL_STR(_arg) _arg##ULL, #_arg +/* + * Assign an object of type DEST_TYPE at address DEST_ADDR + * using memcpy to avoid potential unaligned access. + */ +# define SET_STRUCT(DEST_TYPE, DEST_ADDR, ...) \ + do { \ + DEST_TYPE dest_type_tmp_var = { __VA_ARGS__ }; \ + memcpy(DEST_ADDR, &dest_type_tmp_var, sizeof(dest_type_tmp_var)); \ + } while (0) + +# define NLMSG_ATTR(nlh, hdrlen) ((void *)(nlh) + NLMSG_SPACE(hdrlen)) + #endif /* !STRACE_TESTS_H */ diff --git a/tests/threads-execve.c b/tests/threads-execve.c index 853645ff..56fab529 100644 --- a/tests/threads-execve.c +++ b/tests/threads-execve.c @@ -2,29 +2,10 @@ * Check decoding of threads when a non-leader thread invokes execve. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -136,31 +117,31 @@ thread(void *arg) switch (action % NUMBER_OF_ACTIONS) { case ACTION_exit: printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" - ", [/* %u vars */] \n", + ", %p /* %u vars */ \n", tid, argv[0], argv[0], argv[1], argv[2], - arglen(environ), leader); + environ, arglen(environ), leader); break; case ACTION_rt_sigsuspend: printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" - ", [/* %u vars */] \n" + ", %p /* %u vars */ \n" "%-5d <... rt_sigsuspend resumed>) = ?\n", tid, argv[0], argv[0], argv[1], argv[2], - arglen(environ), + environ, arglen(environ), leader); break; case ACTION_nanosleep: printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" - ", [/* %u vars */] \n" + ", %p /* %u vars */ \n" "%-5d <... nanosleep resumed> )" " = ?\n", tid, argv[0], argv[0], argv[1], argv[2], - arglen(environ), + environ, arglen(environ), leader); break; } printf("%-5d +++ superseded by execve in pid %u +++\n" - "%-5d <... execve resumed> ) = 0\n", + "%-5d <... execve resumed>) = 0\n", leader, tid, leader); @@ -180,18 +161,15 @@ main(int ac, char **av) if (clock_nanosleep(CLOCK_REALTIME, 0, &ts, NULL)) perror_msg_and_skip("clock_nanosleep CLOCK_REALTIME"); - printf("%-5d execve(\"%s\", [\"%s\"], [/* %u vars */]) = 0\n", - leader, av[0], av[0], arglen(environ)); - get_sigsetsize(); static char buf[sizeof(sigsetsize) * 3]; sprintf(buf, "%u", sigsetsize); char *argv[] = { av[0], buf, (char *) "0", NULL }; printf("%-5d execve(\"%s\", [\"%s\", \"%s\", \"%s\"]" - ", [/* %u vars */]) = 0\n", + ", %p /* %u vars */) = 0\n", leader, argv[0], argv[0], argv[1], argv[2], - arglen(environ)); + environ, arglen(environ)); execve(argv[0], argv, environ); perror_msg_and_fail("execve"); } diff --git a/tests/threads-execve.test b/tests/threads-execve.test index 4a771467..04ce15df 100755 --- a/tests/threads-execve.test +++ b/tests/threads-execve.test @@ -3,29 +3,10 @@ # Check decoding of threads when a non-leader thread invokes execve. # # Copyright (c) 2016 Dmitry V. Levin +# Copyright (c) 2016-2019 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -34,17 +15,20 @@ require_min_kernel_version_or_skip 3.1 check_prog diff +run_prog_skip_if_failed date +%s > /dev/null +s0="$(date +%s)" + run_prog > /dev/null set -- -a21 -f -esignal=none -e trace=execve,exit,nanosleep,rt_sigsuspend $args # Due to probabilistic nature of the test, try it several times. -i=0 -while [ $i -le 9 ]; do +while :; do run_strace "$@" > "$EXP" - diff -- "$EXP" "$LOG" || continue - rm -f "$EXP" - exit 0 + sed 1d < "$LOG" > "$OUT" + diff -- "$EXP" "$OUT" && exit 0 + s1="$(date +%s)" + if [ "$(($s1-$s0))" -gt "$(($TIMEOUT_DURATION/2))" ]; then + fail_ "$STRACE $* output mismatch" + fi done - -fail_ "$STRACE $* output mismatch" diff --git a/tests/time.c b/tests/time.c index 4a5cde9c..330c8846 100644 --- a/tests/time.c +++ b/tests/time.c @@ -2,29 +2,10 @@ * This file is part of time strace test. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,15 +21,24 @@ int main(void) { - time_t *p = tail_alloc(sizeof(time_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(time_t, p); time_t t = syscall(__NR_time, NULL); if ((time_t) -1 == t) perror_msg_and_skip("time"); - printf("time(NULL) = %jd\n", (intmax_t) t); + printf("time(NULL) = %lld (", (long long) t); + print_time_t_nsec(t, 0, 0); + puts(")"); + + t = syscall(__NR_time, p + 1); + printf("time(%p) = %s\n", p + 1, sprintrc(t)); t = syscall(__NR_time, p); - printf("time([%jd]) = %jd\n", (intmax_t) *p, (intmax_t) t); + printf("time([%lld", (long long) *p); + print_time_t_nsec((time_t) *p, 0, 1), + printf("]) = %lld (", (long long) t); + print_time_t_nsec(t, 0, 0); + puts(")"); puts("+++ exited with 0 +++"); return 0; diff --git a/tests/time.gen.test b/tests/time.gen.test new file mode 100755 index 00000000..3269b164 --- /dev/null +++ b/tests/time.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (time -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests/time.test b/tests/time.test deleted file mode 100755 index 6ab193a4..00000000 --- a/tests/time.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check time syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a10 diff --git a/tests/timer_create.c b/tests/timer_create.c index 1a259627..c9c64813 100644 --- a/tests/timer_create.c +++ b/tests/timer_create.c @@ -1,30 +1,10 @@ /* * This file is part of timer_create strace test. * - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -98,9 +78,9 @@ main(void) sev.sigev_un.sigev_thread.attribute, tid[2]); -#ifndef SIGEV_THREAD_ID -# define SIGEV_THREAD_ID 4 -#endif +# ifndef SIGEV_THREAD_ID +# define SIGEV_THREAD_ID 4 +# endif sev.sigev_notify = SIGEV_THREAD_ID; sev.sigev_un.tid = getpid(); if (syscall(__NR_timer_create, CLOCK_MONOTONIC, &sev, &tid[3])) diff --git a/tests/timer_create.gen.test b/tests/timer_create.gen.test new file mode 100755 index 00000000..bf652612 --- /dev/null +++ b/tests/timer_create.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (timer_create ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/timer_create.test b/tests/timer_create.test deleted file mode 100755 index 870a1795..00000000 --- a/tests/timer_create.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check timer_create syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/timer_xettime.c b/tests/timer_xettime.c index 9eabbf08..17390c2d 100644 --- a/tests/timer_xettime.c +++ b/tests/timer_xettime.c @@ -2,29 +2,10 @@ * This file is part of timer_xettime strace test. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -47,6 +28,7 @@ main(void) printf("timer_settime(%d, TIMER_ABSTIME, NULL, NULL)" " = -1 EINVAL (%m)\n", 0xdefaced); + long rc; int tid; struct sigevent sev = { .sigev_notify = SIGEV_NONE }; @@ -55,51 +37,61 @@ main(void) printf("timer_create(CLOCK_MONOTONIC, {sigev_signo=0" ", sigev_notify=SIGEV_NONE}, [%d]) = 0\n", tid); - struct { - struct itimerspec its; - uint32_t pad[4]; - } old = { - .its = { - .it_interval = { 0xdeface5, 0xdeface6 }, - .it_value = { 0xdeface7, 0xdeface8 } - }, - .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } - }, new = { - .its = { - .it_interval = { 0xdeface1, 0xdeface2 }, - .it_value = { 0xdeface3, 0xdeface4 } - }, - .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } - }; - - if (syscall(__NR_timer_settime, tid, 0, &new.its, &old.its)) + TAIL_ALLOC_OBJECT_CONST_PTR(struct itimerspec, its_new); + TAIL_ALLOC_OBJECT_CONST_PTR(struct itimerspec, its_old); + + its_new->it_interval.tv_sec = 0xdeadbeefU; + its_new->it_interval.tv_nsec = 0xfacefeedU; + its_new->it_value.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + its_new->it_value.tv_nsec = (long) 0xbadc0dedfacefeedLL; + + rc = syscall(__NR_timer_settime, tid, 0, its_new, its_old); + printf("timer_settime(%d, 0" + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}, %p) = %s\n", + tid, (long long) its_new->it_interval.tv_sec, + zero_extend_signed_to_ull(its_new->it_interval.tv_nsec), + (long long) its_new->it_value.tv_sec, + zero_extend_signed_to_ull(its_new->it_value.tv_nsec), + its_old, sprintrc(rc)); + + its_new->it_interval.tv_sec = 0xdeface1; + its_new->it_interval.tv_nsec = 0xdeface2; + its_new->it_value.tv_sec = 0xdeface3; + its_new->it_value.tv_nsec = 0xdeface4; + its_old->it_interval.tv_sec = 0xdeface5; + its_old->it_interval.tv_nsec = 0xdeface6; + its_old->it_value.tv_sec = 0xdeface7; + its_old->it_value.tv_nsec = 0xdeface8; + + if (syscall(__NR_timer_settime, tid, 0, its_new, its_old)) perror_msg_and_skip("timer_settime"); printf("timer_settime(%d, 0" - ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" - ", it_value={tv_sec=%jd, tv_nsec=%jd}}" - ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" - ", it_value={tv_sec=%jd, tv_nsec=%jd}}" + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}" + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}" ") = 0\n", tid, - (intmax_t) new.its.it_interval.tv_sec, - (intmax_t) new.its.it_interval.tv_nsec, - (intmax_t) new.its.it_value.tv_sec, - (intmax_t) new.its.it_value.tv_nsec, - (intmax_t) old.its.it_interval.tv_sec, - (intmax_t) old.its.it_interval.tv_nsec, - (intmax_t) old.its.it_value.tv_sec, - (intmax_t) old.its.it_value.tv_nsec); - - if (syscall(__NR_timer_gettime, tid, &old.its)) + (long long) its_new->it_interval.tv_sec, + zero_extend_signed_to_ull(its_new->it_interval.tv_nsec), + (long long) its_new->it_value.tv_sec, + zero_extend_signed_to_ull(its_new->it_value.tv_nsec), + (long long) its_old->it_interval.tv_sec, + zero_extend_signed_to_ull(its_old->it_interval.tv_nsec), + (long long) its_old->it_value.tv_sec, + zero_extend_signed_to_ull(its_old->it_value.tv_nsec)); + + if (syscall(__NR_timer_gettime, tid, its_old)) perror_msg_and_skip("timer_gettime"); printf("timer_gettime(%d" - ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" - ", it_value={tv_sec=%jd, tv_nsec=%jd}}) = 0\n", + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}) = 0\n", tid, - (intmax_t) old.its.it_interval.tv_sec, - (intmax_t) old.its.it_interval.tv_nsec, - (intmax_t) old.its.it_value.tv_sec, - (intmax_t) old.its.it_value.tv_nsec); + (long long) its_old->it_interval.tv_sec, + zero_extend_signed_to_ull(its_old->it_interval.tv_nsec), + (long long) its_old->it_value.tv_sec, + zero_extend_signed_to_ull(its_old->it_value.tv_nsec)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests/timer_xettime.gen.test b/tests/timer_xettime.gen.test new file mode 100755 index 00000000..6e2dffaa --- /dev/null +++ b/tests/timer_xettime.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (timer_xettime -e trace=timer_create,timer_settime,timer_gettime); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=timer_create,timer_settime,timer_gettime diff --git a/tests/timer_xettime.test b/tests/timer_xettime.test deleted file mode 100755 index 08bcdd68..00000000 --- a/tests/timer_xettime.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check timer_create, timer_settime, and timer_gettime syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=timer_create,timer_settime,timer_gettime diff --git a/tests/timerfd_xettime.c b/tests/timerfd_xettime.c index ca7124ec..73616677 100644 --- a/tests/timerfd_xettime.c +++ b/tests/timerfd_xettime.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -47,49 +28,59 @@ main(void) perror_msg_and_skip("timerfd_create"); puts("timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC|TFD_NONBLOCK) = 0"); - struct { - struct itimerspec its; - uint32_t pad[4]; - } old = { - .its = { - .it_interval = { 0xdeface5, 0xdeface6 }, - .it_value = { 0xdeface7, 0xdeface8 } - }, - .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } - }, new = { - .its = { - .it_interval = { 0xdeface1, 0xdeface2 }, - .it_value = { 0xdeface3, 0xdeface4 } - }, - .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } - }; + TAIL_ALLOC_OBJECT_CONST_PTR(struct itimerspec, its_new); + TAIL_ALLOC_OBJECT_CONST_PTR(struct itimerspec, its_old); + + its_new->it_interval.tv_sec = 0xdeadbeefU; + its_new->it_interval.tv_nsec = 0xfacefeedU; + its_new->it_value.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + its_new->it_value.tv_nsec = (long) 0xbadc0dedfacefeedLL; + + long rc = syscall(__NR_timerfd_settime, 0, 0, its_new, its_old); + printf("timerfd_settime(0, 0" + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}, %p) = %s\n", + (long long) its_new->it_interval.tv_sec, + zero_extend_signed_to_ull(its_new->it_interval.tv_nsec), + (long long) its_new->it_value.tv_sec, + zero_extend_signed_to_ull(its_new->it_value.tv_nsec), + its_old, sprintrc(rc)); + + its_new->it_interval.tv_sec = 0xdeface1; + its_new->it_interval.tv_nsec = 0xdeface2; + its_new->it_value.tv_sec = 0xdeface3; + its_new->it_value.tv_nsec = 0xdeface4; + its_old->it_interval.tv_sec = 0xdeface5; + its_old->it_interval.tv_nsec = 0xdeface6; + its_old->it_value.tv_sec = 0xdeface7; + its_old->it_value.tv_nsec = 0xdeface8; - if (syscall(__NR_timerfd_settime, 0, 0, &new.its, &old.its)) + if (syscall(__NR_timerfd_settime, 0, 0, its_new, its_old)) perror_msg_and_skip("timerfd_settime"); printf("timerfd_settime(0, 0" - ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" - ", it_value={tv_sec=%jd, tv_nsec=%jd}}" - ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" - ", it_value={tv_sec=%jd, tv_nsec=%jd}}" + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}" + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}" ") = 0\n", - (intmax_t) new.its.it_interval.tv_sec, - (intmax_t) new.its.it_interval.tv_nsec, - (intmax_t) new.its.it_value.tv_sec, - (intmax_t) new.its.it_value.tv_nsec, - (intmax_t) old.its.it_interval.tv_sec, - (intmax_t) old.its.it_interval.tv_nsec, - (intmax_t) old.its.it_value.tv_sec, - (intmax_t) old.its.it_value.tv_nsec); + (long long) its_new->it_interval.tv_sec, + zero_extend_signed_to_ull(its_new->it_interval.tv_nsec), + (long long) its_new->it_value.tv_sec, + zero_extend_signed_to_ull(its_new->it_value.tv_nsec), + (long long) its_old->it_interval.tv_sec, + zero_extend_signed_to_ull(its_old->it_interval.tv_nsec), + (long long) its_old->it_value.tv_sec, + zero_extend_signed_to_ull(its_old->it_value.tv_nsec)); - if (syscall(__NR_timerfd_gettime, 0, &old.its)) + if (syscall(__NR_timerfd_gettime, 0, its_old)) perror_msg_and_skip("timerfd_gettime"); printf("timerfd_gettime(0" - ", {it_interval={tv_sec=%jd, tv_nsec=%jd}" - ", it_value={tv_sec=%jd, tv_nsec=%jd}}) = 0\n", - (intmax_t) old.its.it_interval.tv_sec, - (intmax_t) old.its.it_interval.tv_nsec, - (intmax_t) old.its.it_value.tv_sec, - (intmax_t) old.its.it_value.tv_nsec); + ", {it_interval={tv_sec=%lld, tv_nsec=%llu}" + ", it_value={tv_sec=%lld, tv_nsec=%llu}}) = 0\n", + (long long) its_old->it_interval.tv_sec, + zero_extend_signed_to_ull(its_old->it_interval.tv_nsec), + (long long) its_old->it_value.tv_sec, + zero_extend_signed_to_ull(its_old->it_value.tv_nsec)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests/timerfd_xettime.gen.test b/tests/timerfd_xettime.gen.test new file mode 100755 index 00000000..97e560bd --- /dev/null +++ b/tests/timerfd_xettime.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (timerfd_xettime -e trace=timerfd_create,timerfd_settime,timerfd_gettime); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -e trace=timerfd_create,timerfd_settime,timerfd_gettime diff --git a/tests/timerfd_xettime.test b/tests/timerfd_xettime.test deleted file mode 100755 index 75aa21c2..00000000 --- a/tests/timerfd_xettime.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check timerfd_create, timerfd_settime, and timerfd_gettime syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=timerfd_create,timerfd_settime,timerfd_gettime diff --git a/tests/times-fail.c b/tests/times-fail.c index cb69bd43..551803df 100644 --- a/tests/times-fail.c +++ b/tests/times-fail.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2015-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include #include @@ -5,7 +12,7 @@ #include int -main (void) +main(void) { assert(syscall(__NR_times, 0x42) == -1); printf("times(0x42) = -1 EFAULT (%m)\n"); diff --git a/tests/times-fail.gen.test b/tests/times-fail.gen.test new file mode 100755 index 00000000..9934d193 --- /dev/null +++ b/tests/times-fail.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (times-fail -a12 -e trace=times); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a12 -e trace=times diff --git a/tests/times-fail.test b/tests/times-fail.test deleted file mode 100755 index ee28a060..00000000 --- a/tests/times-fail.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of failing times syscall - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a12 -e trace=times diff --git a/tests/times.c b/tests/times.c index 2c7b95e5..a390dde4 100644 --- a/tests/times.c +++ b/tests/times.c @@ -1,29 +1,10 @@ /* * Copyright (c) 2015 Eugene Syromyatnikov * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ /** @@ -49,7 +30,7 @@ enum { }; int -main (void) +main(void) { struct timespec ts; volatile int dummy = 0; diff --git a/tests/times.gen.test b/tests/times.gen.test new file mode 100755 index 00000000..06b036fc --- /dev/null +++ b/tests/times.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (times -esignal=none ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests/times.test b/tests/times.test deleted file mode 100755 index b97e0d33..00000000 --- a/tests/times.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of times syscall - -. "${srcdir=.}/init.sh" -run_strace_match_diff -esignal=none diff --git a/tests/tprintf.c b/tests/tprintf.c index a759d8af..060af760 100644 --- a/tests/tprintf.c +++ b/tests/tprintf.c @@ -1,30 +1,10 @@ /* * Close stdin, move stdout to a non-standard descriptor, and print. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/trace_fstat.gen.test b/tests/trace_fstat.gen.test new file mode 100755 index 00000000..c3aede16 --- /dev/null +++ b/tests/trace_fstat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_fstat test_trace_expr '' -e%fstat -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e%fstat -v -P stat.sample -P /dev/full diff --git a/tests/trace_fstat.in b/tests/trace_fstat.in new file mode 100644 index 00000000..3fde131d --- /dev/null +++ b/tests/trace_fstat.in @@ -0,0 +1,11 @@ +fstat -a15 +fstat-Xabbrev -a15 -Xabbrev +fstat-Xraw -a15 -Xraw +fstat-Xverbose -a15 -Xverbose +fstat64 -a17 +fstat64-Xabbrev -a17 -Xabbrev +fstat64-Xraw -a17 -Xraw +fstat64-Xverbose -a17 -Xverbose +fstatat64 -a32 +newfstatat -a32 +oldfstat -a21 diff --git a/tests/trace_fstatfs.gen.test b/tests/trace_fstatfs.gen.test new file mode 100755 index 00000000..063f624c --- /dev/null +++ b/tests/trace_fstatfs.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_fstatfs test_trace_expr '' -e%fstatfs); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e%fstatfs diff --git a/tests/trace_fstatfs.in b/tests/trace_fstatfs.in new file mode 100644 index 00000000..6441a079 --- /dev/null +++ b/tests/trace_fstatfs.in @@ -0,0 +1,2 @@ +fstatfs -a18 +fstatfs64 -a24 diff --git a/tests/trace_lstat.gen.test b/tests/trace_lstat.gen.test new file mode 100755 index 00000000..a05b7a15 --- /dev/null +++ b/tests/trace_lstat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_lstat test_trace_expr '' -e%lstat -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e%lstat -v -P stat.sample -P /dev/full diff --git a/tests/trace_lstat.in b/tests/trace_lstat.in new file mode 100644 index 00000000..abbabc49 --- /dev/null +++ b/tests/trace_lstat.in @@ -0,0 +1,3 @@ +lstat -a32 +lstat64 -a32 +oldlstat -a32 diff --git a/tests/trace_personality_32.gen.test b/tests/trace_personality_32.gen.test new file mode 100755 index 00000000..a5f5c7d1 --- /dev/null +++ b/tests/trace_personality_32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_personality_32 +qualify_personality.sh 32 'getcwd' 'fsync-y'); do not edit. +set -- 32 'getcwd' 'fsync-y' +. "${srcdir=.}/qualify_personality.sh" diff --git a/tests/trace_personality_32.in b/tests/trace_personality_32.in new file mode 100644 index 00000000..9da47c1a --- /dev/null +++ b/tests/trace_personality_32.in @@ -0,0 +1 @@ +getcwd -a18 diff --git a/tests/trace_personality_64.gen.test b/tests/trace_personality_64.gen.test new file mode 100755 index 00000000..5b961efa --- /dev/null +++ b/tests/trace_personality_64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_personality_64 +qualify_personality.sh 64 'getcwd' 'fsync-y'); do not edit. +set -- 64 'getcwd' 'fsync-y' +. "${srcdir=.}/qualify_personality.sh" diff --git a/tests/trace_personality_64.in b/tests/trace_personality_64.in new file mode 100644 index 00000000..9da47c1a --- /dev/null +++ b/tests/trace_personality_64.in @@ -0,0 +1 @@ +getcwd -a18 diff --git a/tests/trace_personality_regex_32.gen.test b/tests/trace_personality_regex_32.gen.test new file mode 100755 index 00000000..f2800d2a --- /dev/null +++ b/tests/trace_personality_regex_32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_personality_regex_32 +qualify_personality.sh 32 '/clock.*' 'times|fcntl.*'); do not edit. +set -- 32 '/clock.*' 'times|fcntl.*' +. "${srcdir=.}/qualify_personality.sh" diff --git a/tests/trace_personality_regex_32.in b/tests/trace_personality_regex_32.in new file mode 100755 index 00000000..864de290 --- /dev/null +++ b/tests/trace_personality_regex_32.in @@ -0,0 +1,3 @@ +clock_adjtime -a37 +clock_nanosleep +clock_xettime -a36 diff --git a/tests/trace_personality_regex_64.gen.test b/tests/trace_personality_regex_64.gen.test new file mode 100755 index 00000000..4b19f1b0 --- /dev/null +++ b/tests/trace_personality_regex_64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_personality_regex_64 +qualify_personality.sh 64 '/clock.*' 'times|fcntl.*'); do not edit. +set -- 64 '/clock.*' 'times|fcntl.*' +. "${srcdir=.}/qualify_personality.sh" diff --git a/tests/trace_personality_regex_64.in b/tests/trace_personality_regex_64.in new file mode 100755 index 00000000..864de290 --- /dev/null +++ b/tests/trace_personality_regex_64.in @@ -0,0 +1,3 @@ +clock_adjtime -a37 +clock_nanosleep +clock_xettime -a36 diff --git a/tests/trace_personality_regex_x32.gen.test b/tests/trace_personality_regex_x32.gen.test new file mode 100755 index 00000000..7f416712 --- /dev/null +++ b/tests/trace_personality_regex_x32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_personality_regex_x32 +qualify_personality.sh x32 '/clock.*' 'times|fcntl.*'); do not edit. +set -- x32 '/clock.*' 'times|fcntl.*' +. "${srcdir=.}/qualify_personality.sh" diff --git a/tests/trace_personality_regex_x32.in b/tests/trace_personality_regex_x32.in new file mode 100755 index 00000000..864de290 --- /dev/null +++ b/tests/trace_personality_regex_x32.in @@ -0,0 +1,3 @@ +clock_adjtime -a37 +clock_nanosleep +clock_xettime -a36 diff --git a/tests/trace_personality_x32.gen.test b/tests/trace_personality_x32.gen.test new file mode 100755 index 00000000..724499ae --- /dev/null +++ b/tests/trace_personality_x32.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_personality_x32 +qualify_personality.sh x32 'getcwd' 'fsync-y'); do not edit. +set -- x32 'getcwd' 'fsync-y' +. "${srcdir=.}/qualify_personality.sh" diff --git a/tests/trace_personality_x32.in b/tests/trace_personality_x32.in new file mode 100644 index 00000000..9da47c1a --- /dev/null +++ b/tests/trace_personality_x32.in @@ -0,0 +1 @@ +getcwd -a18 diff --git a/tests/trace_question.gen.test b/tests/trace_question.gen.test new file mode 100755 index 00000000..76b3578c --- /dev/null +++ b/tests/trace_question.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_question test_trace_expr '' -e?osf_utimes,?/^pkey_.*); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e?osf_utimes,?/^pkey_.* diff --git a/tests/trace_question.in b/tests/trace_question.in new file mode 100644 index 00000000..74d662c5 --- /dev/null +++ b/tests/trace_question.in @@ -0,0 +1,4 @@ +osf_utimes -a21 +pkey_alloc -a17 +pkey_free -a13 +pkey_mprotect -a37 diff --git a/tests/trace_stat.gen.test b/tests/trace_stat.gen.test new file mode 100755 index 00000000..ae95ab86 --- /dev/null +++ b/tests/trace_stat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_stat test_trace_expr '' -e%stat -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e%stat -v -P stat.sample -P /dev/full diff --git a/tests/trace_stat.in b/tests/trace_stat.in new file mode 100644 index 00000000..f105d784 --- /dev/null +++ b/tests/trace_stat.in @@ -0,0 +1,3 @@ +oldstat -a32 +stat -a32 +stat64 -a32 diff --git a/tests/trace_stat_like.gen.test b/tests/trace_stat_like.gen.test new file mode 100755 index 00000000..5681a8a3 --- /dev/null +++ b/tests/trace_stat_like.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_stat_like test_trace_expr '' -e%%stat -v -P stat.sample -P /dev/full); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e%%stat -v -P stat.sample -P /dev/full diff --git a/tests/trace_stat_like.in b/tests/trace_stat_like.in new file mode 100644 index 00000000..c48addbf --- /dev/null +++ b/tests/trace_stat_like.in @@ -0,0 +1,18 @@ +fstat -a15 +fstat-Xabbrev -a15 -Xabbrev +fstat-Xraw -a15 -Xraw +fstat-Xverbose -a15 -Xverbose +fstat64 -a17 +fstat64-Xabbrev -a17 -Xabbrev +fstat64-Xraw -a17 -Xraw +fstat64-Xverbose -a17 -Xverbose +fstatat64 -a32 +lstat -a32 +lstat64 -a32 +newfstatat -a32 +oldfstat -a21 +oldlstat -a32 +oldstat -a32 +stat -a32 +stat64 -a32 +statx -a32 diff --git a/tests/trace_statfs.gen.test b/tests/trace_statfs.gen.test new file mode 100755 index 00000000..957412b9 --- /dev/null +++ b/tests/trace_statfs.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_statfs test_trace_expr '' -e%statfs); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e%statfs diff --git a/tests/trace_statfs.in b/tests/trace_statfs.in new file mode 100644 index 00000000..7c4adfe1 --- /dev/null +++ b/tests/trace_statfs.in @@ -0,0 +1,2 @@ +statfs -a17 +statfs64 -a23 diff --git a/tests/trace_statfs_like.gen.test b/tests/trace_statfs_like.gen.test new file mode 100755 index 00000000..be1a9c03 --- /dev/null +++ b/tests/trace_statfs_like.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (trace_statfs_like test_trace_expr '' -e%%statfs); do not edit. +. "${srcdir=.}/init.sh" +test_trace_expr '' -e%%statfs diff --git a/tests/trace_statfs_like.in b/tests/trace_statfs_like.in new file mode 100644 index 00000000..285aec6c --- /dev/null +++ b/tests/trace_statfs_like.in @@ -0,0 +1,5 @@ +statfs -a17 +statfs64 -a23 +fstatfs -a18 +fstatfs64 -a24 +ustat -a33 diff --git a/tests/truncate.c b/tests/truncate.c index d9529334..bfb6299b 100644 --- a/tests/truncate.c +++ b/tests/truncate.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/truncate.gen.test b/tests/truncate.gen.test new file mode 100755 index 00000000..7a631ef0 --- /dev/null +++ b/tests/truncate.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (truncate ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/truncate.test b/tests/truncate.test deleted file mode 100755 index 6bf1e702..00000000 --- a/tests/truncate.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check truncate syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/truncate64.c b/tests/truncate64.c index 8c29ea81..1dceb414 100644 --- a/tests/truncate64.c +++ b/tests/truncate64.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/truncate64.gen.test b/tests/truncate64.gen.test new file mode 100755 index 00000000..2b368f44 --- /dev/null +++ b/tests/truncate64.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (truncate64 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff diff --git a/tests/truncate64.test b/tests/truncate64.test deleted file mode 100755 index c4668062..00000000 --- a/tests/truncate64.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check truncate64 syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff diff --git a/tests/ugetrlimit.c b/tests/ugetrlimit.c index a99e496d..49627c1f 100644 --- a/tests/ugetrlimit.c +++ b/tests/ugetrlimit.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/ugetrlimit.gen.test b/tests/ugetrlimit.gen.test new file mode 100755 index 00000000..a412fe6a --- /dev/null +++ b/tests/ugetrlimit.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ugetrlimit -a28 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests/ugetrlimit.test b/tests/ugetrlimit.test deleted file mode 100755 index f4648ff1..00000000 --- a/tests/ugetrlimit.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of ugetrlimit syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 diff --git a/tests/uio.c b/tests/uio.c index 6291f972..d1a1cc51 100644 --- a/tests/uio.c +++ b/tests/uio.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2014-2016 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -39,16 +20,16 @@ main(void) { const off_t offset = 0xdefaceddeadbeefLL; char buf[4]; - struct iovec iov = { buf, sizeof buf }; + struct iovec iov = { buf, sizeof(buf) }; (void) close(0); assert(open("/dev/zero", O_RDONLY) == 0); - assert(pread(0, buf, sizeof buf, offset) == 4); + assert(pread(0, buf, sizeof(buf), offset) == 4); assert(preadv(0, &iov, 1, offset) == 4); assert(!close(0)); assert(open("/dev/null", O_WRONLY) == 0); - assert(pwrite(0, buf, sizeof buf, offset) == 4); + assert(pwrite(0, buf, sizeof(buf), offset) == 4); assert(pwritev(0, &iov, 1, offset) == 4); assert(!close(0)); diff --git a/tests/uio.test b/tests/uio.test index 020b97e9..75eb5de2 100755 --- a/tests/uio.test +++ b/tests/uio.test @@ -1,11 +1,16 @@ #!/bin/sh - +# # Check how pread/pwrite and preadv/pwritev syscalls are traced. +# +# Copyright (c) 2014-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" run_prog -run_strace -edesc $args +run_strace -e%desc $args match_grep exit 0 diff --git a/tests/umask.c b/tests/umask.c index 86903a95..1a196f43 100644 --- a/tests/umask.c +++ b/tests/umask.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include #include diff --git a/tests/umask.gen.test b/tests/umask.gen.test new file mode 100755 index 00000000..5d6c3187 --- /dev/null +++ b/tests/umask.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (umask -a11 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 diff --git a/tests/umask.test b/tests/umask.test deleted file mode 100755 index 1351721f..00000000 --- a/tests/umask.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check umask syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a11 diff --git a/tests/umode_t.c b/tests/umode_t.c index 5041638e..9c4e304f 100644 --- a/tests/umode_t.c +++ b/tests/umode_t.c @@ -2,29 +2,10 @@ * Check decoding of umode_t type syscall arguments. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -38,7 +19,7 @@ # define TEST_SYSCALL_PREFIX_STR "" #endif -static const char sample[] = TEST_SYSCALL_STR; +static const char *sample; static void test_syscall(unsigned short mode) @@ -49,17 +30,18 @@ test_syscall(unsigned short mode) if (mode <= 07) printf("%s(%s\"%s\", 00%d) = %ld %s (%m)\n", - sample, TEST_SYSCALL_PREFIX_STR, + TEST_SYSCALL_STR, TEST_SYSCALL_PREFIX_STR, sample, (int) mode, rc, errno2name()); else printf("%s(%s\"%s\", %#03ho) = %ld %s (%m)\n", - sample, TEST_SYSCALL_PREFIX_STR, + TEST_SYSCALL_STR, TEST_SYSCALL_PREFIX_STR, sample, mode, rc, errno2name()); } int -main(void) +main(int ac, char **av) { + sample = av[0]; test_syscall(0); test_syscall(0xffff); test_syscall(06); diff --git a/tests/umount.c b/tests/umount.c index eda7ae5c..cd89aa0b 100644 --- a/tests/umount.c +++ b/tests/umount.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2019 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -35,7 +15,7 @@ #ifdef __NR_oldumount # define TEST_SYSCALL_STR "oldumount" #else -# if defined __NR_umount && defined __NR_umount2 +# if defined __NR_umount && defined __NR_umount2 && __NR_umount != __NR_umount2 # define __NR_oldumount __NR_umount # define TEST_SYSCALL_STR "umount" # endif diff --git a/tests/umount.test b/tests/umount.test index a5840d54..e98ad9f3 100755 --- a/tests/umount.test +++ b/tests/umount.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check umount syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests/umount2.c b/tests/umount2.c index 1a6d8451..d313d597 100644 --- a/tests/umount2.c +++ b/tests/umount2.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2019 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,7 +12,7 @@ #include #include -#ifdef __NR_umount2 +#if defined __NR_umount2 && (!defined __NR_umount || __NR_umount2 != __NR_umount) # define TEST_SYSCALL_STR "umount2" #else # define __NR_umount2 __NR_umount diff --git a/tests/umount2.test b/tests/umount2.test index c43b38db..33b466d5 100755 --- a/tests/umount2.test +++ b/tests/umount2.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check umount2 syscall decoding. +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" diff --git a/tests/umoven-illptr.c b/tests/umoven-illptr.c index 4deee163..25839f77 100644 --- a/tests/umoven-illptr.c +++ b/tests/umoven-illptr.c @@ -1,30 +1,10 @@ /* * Check decoding of invalid pointer by umoven. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/umoven-illptr.gen.test b/tests/umoven-illptr.gen.test new file mode 100755 index 00000000..eea7b1c2 --- /dev/null +++ b/tests/umoven-illptr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (umoven-illptr -a36 -e trace=nanosleep); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a36 -e trace=nanosleep diff --git a/tests/umoven-illptr.test b/tests/umoven-illptr.test deleted file mode 100755 index 7b8cb314..00000000 --- a/tests/umoven-illptr.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of invalid pointer by umoven. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a36 -e trace=nanosleep diff --git a/tests/umovestr-illptr.c b/tests/umovestr-illptr.c index dea6885d..5a24357a 100644 --- a/tests/umovestr-illptr.c +++ b/tests/umovestr-illptr.c @@ -1,30 +1,10 @@ /* * Check decoding of invalid pointer by umovestr. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/umovestr-illptr.gen.test b/tests/umovestr-illptr.gen.test new file mode 100755 index 00000000..7685d442 --- /dev/null +++ b/tests/umovestr-illptr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (umovestr-illptr -a11 -e trace=chdir); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=chdir diff --git a/tests/umovestr-illptr.test b/tests/umovestr-illptr.test deleted file mode 100755 index 6f1cc862..00000000 --- a/tests/umovestr-illptr.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of invalid pointer by umovestr. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a11 -e trace=chdir diff --git a/tests/umovestr.c b/tests/umovestr.c index 95fccb67..6cb5f78d 100644 --- a/tests/umovestr.c +++ b/tests/umovestr.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/umovestr.test b/tests/umovestr.test index 5ae8ffa9..3bfe1900 100755 --- a/tests/umovestr.test +++ b/tests/umovestr.test @@ -1,4 +1,9 @@ #!/bin/sh +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later # umovestr short read regression test diff --git a/tests/umovestr2.c b/tests/umovestr2.c index b2c63d80..a8bbf5ca 100644 --- a/tests/umovestr2.c +++ b/tests/umovestr2.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/umovestr2.test b/tests/umovestr2.test index 5c5d561f..278a9675 100755 --- a/tests/umovestr2.test +++ b/tests/umovestr2.test @@ -1,4 +1,9 @@ #!/bin/sh +# +# Copyright (c) 2015-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later # umovestr short read regression test @@ -9,7 +14,3 @@ run_strace -veexecve -s262144 $args > "$EXP" check_prog sed sed 1d < "$LOG" > "$OUT" match_diff "$OUT" "$EXP" - -rm -f "$EXP" "$OUT" - -exit 0 diff --git a/tests/umovestr3.c b/tests/umovestr3.c index cf2fa7d4..524ee33f 100644 --- a/tests/umovestr3.c +++ b/tests/umovestr3.c @@ -1,34 +1,15 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" +#include #include #include -#include int main(void) diff --git a/tests/umovestr3.gen.test b/tests/umovestr3.gen.test new file mode 100755 index 00000000..b16e1edd --- /dev/null +++ b/tests/umovestr3.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (umovestr3 -a14 -e trace=chdir); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a14 -e trace=chdir diff --git a/tests/umovestr3.test b/tests/umovestr3.test deleted file mode 100755 index d5be2832..00000000 --- a/tests/umovestr3.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# yet another umovestr short read test - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a14 -e trace=chdir diff --git a/tests/uname.c b/tests/uname.c index cd6f51cd..386fd99b 100644 --- a/tests/uname.c +++ b/tests/uname.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -10,26 +17,25 @@ int main(int ac, char **av) { int abbrev = ac > 1; - struct utsname *const uname = tail_alloc(sizeof(struct utsname)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct utsname, uname); int rc = syscall(__NR_uname, uname); - printf("uname({sysname=\""); + printf("uname({sysname="); print_quoted_string(uname->sysname); - printf("\", nodename=\""); + printf(", nodename="); print_quoted_string(uname->nodename); if (abbrev) { - printf("\", ..."); + printf(", ..."); } else { - printf("\", release=\""); + printf(", release="); print_quoted_string(uname->release); - printf("\", version=\""); + printf(", version="); print_quoted_string(uname->version); - printf("\", machine=\""); + printf(", machine="); print_quoted_string(uname->machine); # ifdef HAVE_STRUCT_UTSNAME_DOMAINNAME - printf("\", domainname=\""); + printf(", domainname="); print_quoted_string(uname->domainname); # endif - printf("\""); } printf("}) = %d\n", rc); diff --git a/tests/uname.test b/tests/uname.test index 03fe30cd..2272c4f0 100755 --- a/tests/uname.test +++ b/tests/uname.test @@ -1,6 +1,11 @@ #!/bin/sh - +# # Check uname syscall decoding. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" @@ -10,9 +15,8 @@ run_prog > /dev/null run_strace -v -euname $args > "$EXP" uniq < "$LOG" > "$OUT" -run_prog "./$NAME" abbrev > /dev/null +run_prog "../$NAME" abbrev > /dev/null run_strace -euname $args >> "$EXP" uniq < "$LOG" >> "$OUT" match_diff "$OUT" "$EXP" -rm -f "$OUT" "$EXP" diff --git a/tests/unblock_reset_raise.c b/tests/unblock_reset_raise.c new file mode 100644 index 00000000..68479b76 --- /dev/null +++ b/tests/unblock_reset_raise.c @@ -0,0 +1,34 @@ +/* + * Unblock, reset, and raise a signal. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include +#include + +int +main(int ac, char **av) +{ + if (ac != 2) + error_msg_and_fail("usage: unblock_raise signo"); + + sigset_t mask; + sigemptyset(&mask); + const int signo = atoi(av[1]); + if (sigaddset(&mask, signo)) + perror_msg_and_fail("sigaddset: %s", av[1]); + if (sigprocmask(SIG_UNBLOCK, &mask, NULL)) + perror_msg_and_fail("sigprocmask"); + if (signal(signo, SIG_DFL) == SIG_ERR) + perror_msg_and_fail("signal: %s", av[1]); + if (raise(signo)) + perror_msg_and_fail("raise: %s", av[1]); + + return 0; +} diff --git a/tests/unix-pair-send-recv.c b/tests/unix-pair-send-recv.c index d4ac0d23..73ddd1e0 100644 --- a/tests/unix-pair-send-recv.c +++ b/tests/unix-pair-send-recv.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/unix-pair-send-recv.test b/tests/unix-pair-send-recv.test index 4defdebb..60def6ab 100755 --- a/tests/unix-pair-send-recv.test +++ b/tests/unix-pair-send-recv.test @@ -1,10 +1,15 @@ #!/bin/sh - +# # Check decoding and dumping of send and recv syscalls. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./unix-pair-send-recv abcdefghijklmnopqrstuvwxyz +run_prog ../unix-pair-send-recv abcdefghijklmnopqrstuvwxyz run_strace -a32 -esignal=none -esend,recv -eread=0 -ewrite=0 $args match_diff diff --git a/tests/unix-pair-sendto-recvfrom.c b/tests/unix-pair-sendto-recvfrom.c index cea382c9..98508e2d 100644 --- a/tests/unix-pair-sendto-recvfrom.c +++ b/tests/unix-pair-sendto-recvfrom.c @@ -2,29 +2,10 @@ * Check decoding and dumping of sendto and recvfrom syscalls. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -71,7 +52,7 @@ main(int ac, char **av) assert(recvfrom(0, av[1], len, MSG_WAITALL, NULL, NULL) == len); assert(close(0) == 0); - int status; + int status; assert(waitpid(pid, &status, 0) == pid); assert(status == 0); } else { diff --git a/tests/unix-pair-sendto-recvfrom.test b/tests/unix-pair-sendto-recvfrom.test index 21afe236..bd59ab7d 100755 --- a/tests/unix-pair-sendto-recvfrom.test +++ b/tests/unix-pair-sendto-recvfrom.test @@ -1,10 +1,15 @@ #!/bin/sh - +# # Check decoding and dumping of sendto and recvfrom syscalls. +# +# Copyright (c) 2016-2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later . "${srcdir=.}/init.sh" -run_prog ./unix-pair-sendto-recvfrom abcdefghijklmnopqrstuvwxyz +run_prog ../unix-pair-sendto-recvfrom abcdefghijklmnopqrstuvwxyz run_strace -esignal=none -esendto,recvfrom -eread=0 -ewrite=0 $args match_diff diff --git a/tests/unlink.c b/tests/unlink.c index bbb1de15..9c33b624 100644 --- a/tests/unlink.c +++ b/tests/unlink.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/unlink.gen.test b/tests/unlink.gen.test new file mode 100755 index 00000000..63bc0c42 --- /dev/null +++ b/tests/unlink.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (unlink -a24 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 diff --git a/tests/unlink.test b/tests/unlink.test deleted file mode 100755 index 09bf79a7..00000000 --- a/tests/unlink.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check unlink syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 diff --git a/tests/unlinkat.c b/tests/unlinkat.c index 22c3de39..0ae67964 100644 --- a/tests/unlinkat.c +++ b/tests/unlinkat.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/unlinkat.gen.test b/tests/unlinkat.gen.test new file mode 100755 index 00000000..5de79084 --- /dev/null +++ b/tests/unlinkat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (unlinkat -a35 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a35 diff --git a/tests/unlinkat.test b/tests/unlinkat.test deleted file mode 100755 index 864261f7..00000000 --- a/tests/unlinkat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check unlinkat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a35 diff --git a/tests/unshare.c b/tests/unshare.c index 5aedde47..a49f9ef9 100644 --- a/tests/unshare.c +++ b/tests/unshare.c @@ -2,29 +2,10 @@ * Check decoding of unshare syscall. * * Copyright (c) 2016 Eugene Syromyatnikov + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/unshare.gen.test b/tests/unshare.gen.test new file mode 100755 index 00000000..782ce47a --- /dev/null +++ b/tests/unshare.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (unshare -a11 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 diff --git a/tests/unshare.test b/tests/unshare.test deleted file mode 100755 index ccb9575e..00000000 --- a/tests/unshare.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of setns syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a11 diff --git a/tests/userfaultfd.c b/tests/userfaultfd.c index 60432fa3..9e59c0fe 100644 --- a/tests/userfaultfd.c +++ b/tests/userfaultfd.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/userfaultfd.gen.test b/tests/userfaultfd.gen.test new file mode 100755 index 00000000..61b6988e --- /dev/null +++ b/tests/userfaultfd.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (userfaultfd -a38 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a38 diff --git a/tests/userfaultfd.test b/tests/userfaultfd.test deleted file mode 100755 index af8b6fbe..00000000 --- a/tests/userfaultfd.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check userfaultfd syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a38 diff --git a/tests/ustat.c b/tests/ustat.c index 57bb29c2..0945a70d 100644 --- a/tests/ustat.c +++ b/tests/ustat.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -47,7 +28,7 @@ main(void) long rc; # ifdef HAVE_USTAT_H - struct ustat *const ust = tail_alloc(sizeof(*ust)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct ustat, ust); struct stat st; if (stat(".", &st)) perror_msg_and_fail("stat"); @@ -55,10 +36,10 @@ main(void) dev = (unsigned int) st.st_dev; rc = syscall(__NR_ustat, dev, ust); if (rc) - printf("ustat(makedev(%u, %u), %p) = %s\n", + printf("ustat(makedev(%#x, %#x), %p) = %s\n", major(dev), minor(dev), ust, sprintrc(rc)); else - printf("ustat(makedev(%u, %u)" + printf("ustat(makedev(%#x, %#x)" ", {f_tfree=%llu, f_tinode=%llu}) = 0\n", major(dev), minor(dev), zero_extend_signed_to_ull(ust->f_tfree), @@ -67,11 +48,11 @@ main(void) dev = (unsigned int) magic; rc = syscall(__NR_ustat, magic, 0); - printf("ustat(makedev(%u, %u), NULL) = %s\n", + printf("ustat(makedev(%#x, %#x), NULL) = %s\n", major(dev), minor(dev), sprintrc(rc)); rc = syscall(__NR_ustat, magic, buf); - printf("ustat(makedev(%u, %u), %p) = %s\n", + printf("ustat(makedev(%#x, %#x), %p) = %s\n", major(dev), minor(dev), buf, sprintrc(rc)); puts("+++ exited with 0 +++"); diff --git a/tests/ustat.gen.test b/tests/ustat.gen.test new file mode 100755 index 00000000..2b09f7e9 --- /dev/null +++ b/tests/ustat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (ustat -a33 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 diff --git a/tests/ustat.test b/tests/ustat.test deleted file mode 100755 index 60a88e0a..00000000 --- a/tests/ustat.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check ustat syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a33 diff --git a/tests/utime.c b/tests/utime.c index 8fd594f0..151b31a9 100644 --- a/tests/utime.c +++ b/tests/utime.c @@ -2,29 +2,10 @@ * Check decoding of utime syscall. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -38,17 +19,6 @@ # include # include - -static void -print_tm(const struct tm * const p) -{ - char buf[256]; - - strftime(buf, sizeof(buf), "%FT%T%z", p); - - printf("%s", buf); -} - static long k_utime(const void *const filename, const void *const times) { @@ -60,8 +30,7 @@ main(void) { static const char *const dummy_str = "dummy filename"; - const time_t t = time(NULL); - const struct tm * const p = localtime(&t); + const time_t t = 1492350678; const struct utimbuf u = { .actime = t, .modtime = t }; const struct utimbuf *const tail_u = tail_memdup(&u, sizeof(u)); const char *const dummy_filename = @@ -80,10 +49,10 @@ main(void) rc = k_utime("utime\nfilename", tail_u); const char *errstr = sprintrc(rc); - printf("utime(\"utime\\nfilename\", {actime="); - print_tm(p); - printf(", modtime="); - print_tm(p); + printf("utime(\"utime\\nfilename\", {actime=%lld", (long long) t); + print_time_t_nsec(t, 0, 1); + printf(", modtime=%lld", (long long) t); + print_time_t_nsec(t, 0, 1); printf("}) = %s\n", errstr); puts("+++ exited with 0 +++"); diff --git a/tests/utime.gen.test b/tests/utime.gen.test new file mode 100755 index 00000000..58ebc5ac --- /dev/null +++ b/tests/utime.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (utime -a16 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a16 diff --git a/tests/utime.test b/tests/utime.test deleted file mode 100755 index bd64c532..00000000 --- a/tests/utime.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of utime syscall. -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a 16 -e trace=utime diff --git a/tests/utimensat-Xabbrev.c b/tests/utimensat-Xabbrev.c new file mode 100644 index 00000000..77a4ca03 --- /dev/null +++ b/tests/utimensat-Xabbrev.c @@ -0,0 +1 @@ +#include "utimensat.c" diff --git a/tests/utimensat-Xabbrev.gen.test b/tests/utimensat-Xabbrev.gen.test new file mode 100755 index 00000000..2bd1c40f --- /dev/null +++ b/tests/utimensat-Xabbrev.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (utimensat-Xabbrev -a33 -Xabbrev -e trace=utimensat); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 -Xabbrev -e trace=utimensat diff --git a/tests/utimensat-Xraw.c b/tests/utimensat-Xraw.c new file mode 100644 index 00000000..5cd1f01c --- /dev/null +++ b/tests/utimensat-Xraw.c @@ -0,0 +1,2 @@ +#define XLAT_RAW 1 +#include "utimensat.c" diff --git a/tests/utimensat-Xraw.gen.test b/tests/utimensat-Xraw.gen.test new file mode 100755 index 00000000..7cf0d58c --- /dev/null +++ b/tests/utimensat-Xraw.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (utimensat-Xraw -a29 -Xraw -e trace=utimensat); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a29 -Xraw -e trace=utimensat diff --git a/tests/utimensat-Xverbose.c b/tests/utimensat-Xverbose.c new file mode 100644 index 00000000..cbcceae1 --- /dev/null +++ b/tests/utimensat-Xverbose.c @@ -0,0 +1,2 @@ +#define XLAT_VERBOSE 1 +#include "utimensat.c" diff --git a/tests/utimensat-Xverbose.gen.test b/tests/utimensat-Xverbose.gen.test new file mode 100755 index 00000000..c49f2668 --- /dev/null +++ b/tests/utimensat-Xverbose.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (utimensat-Xverbose -a44 -Xverbose -e trace=utimensat); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a44 -Xverbose -e trace=utimensat diff --git a/tests/utimensat.c b/tests/utimensat.c index 6d9faac2..170b2c89 100644 --- a/tests/utimensat.c +++ b/tests/utimensat.c @@ -1,93 +1,220 @@ /* - * This file is part of utimensat strace test. + * Check decoding of utimensat syscall. * - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2017 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" -#include -#include #include #include #include #include #include - -#if defined HAVE_UTIMENSAT \ - && defined AT_FDCWD && defined AT_SYMLINK_NOFOLLOW \ - && defined UTIME_NOW && defined UTIME_OMIT +#include +#include + +#if defined __NR_utimensat && defined UTIME_NOW && defined UTIME_OMIT + +# if SIZEOF_KERNEL_LONG_T == 4 +# define big_tv_sec "-559038737" +# define huge_tv_sec "-559038737" +# else +# define big_tv_sec "3735928559" +# define huge_tv_sec "-3819351491602432273" +# endif + +# if XLAT_RAW +# define str_at_fdcwd "-100" +# define str_at_symlink_nofollow "0x100" +# define str_at_removedir "0x200" +# define str_flags1 "0x600" +# define str_flags2 "0xffffffff" +# define str_utime_now_omit \ + "[{tv_sec=" big_tv_sec ", tv_nsec=1073741823}, " \ + "{tv_sec=" huge_tv_sec ", tv_nsec=1073741822}]" +# elif XLAT_VERBOSE +# define str_at_fdcwd "-100 /* AT_FDCWD */" +# define str_at_symlink_nofollow "0x100 /* AT_SYMLINK_NOFOLLOW */" +# define str_at_removedir "0x200 /* AT_REMOVEDIR */" +# define str_flags1 \ + "0x600 /* AT_REMOVEDIR|AT_SYMLINK_FOLLOW */" +# define str_flags2 \ + "0xffffffff /* AT_SYMLINK_NOFOLLOW|AT_REMOVEDIR|AT_SYMLINK_FOLLOW" \ + "|AT_NO_AUTOMOUNT|AT_EMPTY_PATH|0xffffe0ff */" +# define str_utime_now_omit \ + "[{tv_sec=" big_tv_sec ", tv_nsec=1073741823} /* UTIME_NOW */, " \ + "{tv_sec=" huge_tv_sec ", tv_nsec=1073741822} /* UTIME_OMIT */]" +# else +# define str_at_fdcwd "AT_FDCWD" +# define str_at_symlink_nofollow "AT_SYMLINK_NOFOLLOW" +# define str_at_removedir "AT_REMOVEDIR" +# define str_flags1 "AT_REMOVEDIR|AT_SYMLINK_FOLLOW" +# define str_flags2 \ + "AT_SYMLINK_NOFOLLOW|AT_REMOVEDIR|AT_SYMLINK_FOLLOW" \ + "|AT_NO_AUTOMOUNT|AT_EMPTY_PATH|0xffffe0ff" +# define str_utime_now_omit "[UTIME_NOW, UTIME_OMIT]" +# endif static void print_ts(const struct timespec *ts) { - printf("{tv_sec=%ju, tv_nsec=%ju}", (uintmax_t) ts->tv_sec, - (uintmax_t) ts->tv_nsec); + printf("{tv_sec=%lld, tv_nsec=%llu}", (long long) ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec)); + print_time_t_nsec(ts->tv_sec, + zero_extend_signed_to_ull(ts->tv_nsec), 1); +} + +static const char *errstr; + +static long +k_utimensat(const kernel_ulong_t dirfd, + const kernel_ulong_t pathname, + const kernel_ulong_t times, + const kernel_ulong_t flags) +{ + long rc = syscall(__NR_utimensat, dirfd, pathname, times, flags); + errstr = sprintrc(rc); + return rc; } int main(void) { - static const char fname[] = "utimensat\nfilename"; + static const kernel_ulong_t bogus_fd = + (kernel_ulong_t) 0xbadc0deddeadbeef; + static const kernel_ulong_t kfdcwd = + (kernel_ulong_t) 0xdefaced00000000 | -100U; + static const char proto_fname[] = "utimensat\nfilename"; + static const char qname[] = "\"utimensat\\nfilename\""; + + char *const fname = tail_memdup(proto_fname, sizeof(proto_fname)); + const kernel_ulong_t kfname = (uintptr_t) fname; + struct timespec *const ts = tail_alloc(sizeof(*ts) * 2); + + (void) close(0); + + /* dirfd */ + k_utimensat(0, kfname, 0, 0); + printf("utimensat(0, %s, NULL, 0) = %s\n", qname, errstr); + + k_utimensat(bogus_fd, kfname, 0, 0); + printf("utimensat(%d, %s, NULL, 0) = %s\n", + (int) bogus_fd, qname, errstr); + + k_utimensat(-100U, kfname, 0, 0); + printf("utimensat(" str_at_fdcwd ", %s, NULL, 0) = %s\n", qname, errstr); + + k_utimensat(kfdcwd, kfname, 0, 0); + printf("utimensat(" str_at_fdcwd ", %s, NULL, 0) = %s\n", qname, errstr); + + /* pathname */ + k_utimensat(kfdcwd, 0, 0, 0); + printf("utimensat(" str_at_fdcwd ", NULL, NULL, 0) = %s\n", errstr); + + k_utimensat(kfdcwd, kfname + sizeof(proto_fname) - 1, 0, 0); + printf("utimensat(" str_at_fdcwd ", \"\", NULL, 0) = %s\n", errstr); + + fname[sizeof(proto_fname) - 1] = '+'; + k_utimensat(kfdcwd, kfname, 0, 0); + fname[sizeof(proto_fname) - 1] = '\0'; + printf("utimensat(" str_at_fdcwd ", %p, NULL, 0) = %s\n", fname, errstr); + + if (F8ILL_KULONG_SUPPORTED) { + k_utimensat(kfdcwd, f8ill_ptr_to_kulong(fname), 0, 0); + printf("utimensat(" str_at_fdcwd ", %#jx, NULL, 0) = %s\n", + (uintmax_t) f8ill_ptr_to_kulong(fname), errstr); + } + + /* times */ + k_utimensat(kfdcwd, kfname, (uintptr_t) (ts + 1), 0); + printf("utimensat(" str_at_fdcwd ", %s, %p, 0) = %s\n", + qname, ts + 1, errstr); + + k_utimensat(kfdcwd, kfname, (uintptr_t) (ts + 2), 0); + printf("utimensat(" str_at_fdcwd ", %s, %p, 0)" + " = %s\n", qname, ts + 2, errstr); + + ts[0].tv_sec = 1492358706; + ts[0].tv_nsec = 123456789; + ts[1].tv_sec = 1492357068; + ts[1].tv_nsec = 234567890; + + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, 0x100); + printf("utimensat(" str_at_fdcwd ", %s, [", qname); + print_ts(&ts[0]); + printf(", "); + print_ts(&ts[1]); + printf("], " str_at_symlink_nofollow ") = %s\n", errstr); - assert(utimensat(AT_FDCWD, fname, NULL, 0) == -1); - if (ENOENT != errno) - error_msg_and_skip("utimensat"); + ts[0].tv_sec = -1; + ts[0].tv_nsec = 2000000000; + ts[1].tv_sec = (time_t) -0x100000001LL; + ts[1].tv_nsec = 2345678900U; - #define PREFIX "utimensat(AT_FDCWD, \"utimensat\\nfilename\", " - printf(PREFIX "NULL, 0) = -1 ENOENT (%m)\n"); + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, 0x100); + printf("utimensat(" str_at_fdcwd ", %s, [", qname); + print_ts(&ts[0]); + printf(", "); + print_ts(&ts[1]); + printf("], " str_at_symlink_nofollow ") = %s\n", errstr); - struct timeval tv; - struct timespec ts[2]; + ts[0].tv_sec = 0; + ts[0].tv_nsec = 0; + ts[1].tv_sec = (time_t) 0xcafef00ddeadbeefLL; + ts[1].tv_nsec = 0; - if (gettimeofday(&tv, NULL)) - perror_msg_and_skip("gettimeofday"); + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, 0x100); + printf("utimensat(" str_at_fdcwd ", %s, [", qname); + print_ts(&ts[0]); + printf(", "); + print_ts(&ts[1]); + printf("], " str_at_symlink_nofollow ") = %s\n", errstr); - ts[0].tv_sec = tv.tv_sec; - ts[0].tv_nsec = tv.tv_usec; - ts[1].tv_sec = tv.tv_sec - 1; - ts[1].tv_nsec = tv.tv_usec + 1; + ts[0].tv_sec = 0xdeadbeefU; + ts[0].tv_nsec = 0xfacefeedU; + ts[1].tv_sec = (time_t) 0xcafef00ddeadbeefLL; + ts[1].tv_nsec = (long) 0xbadc0dedfacefeedLL; - printf(PREFIX "["); + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, 0x100); + printf("utimensat(" str_at_fdcwd ", %s, [", qname); print_ts(&ts[0]); printf(", "); print_ts(&ts[1]); - printf("], AT_SYMLINK_NOFOLLOW) = -1 ENOENT "); - - assert(utimensat(AT_FDCWD, fname, ts, AT_SYMLINK_NOFOLLOW) == -1); - if (ENOENT != errno) - error_msg_and_skip("utimensat"); - printf("(%m)\n"); + printf("], " str_at_symlink_nofollow ") = %s\n", errstr); ts[0].tv_nsec = UTIME_NOW; ts[1].tv_nsec = UTIME_OMIT; - assert(utimensat(AT_FDCWD, fname, ts, AT_SYMLINK_NOFOLLOW) == -1); - if (ENOENT != errno) - error_msg_and_skip("utimensat"); - printf(PREFIX "[UTIME_NOW, UTIME_OMIT], AT_SYMLINK_NOFOLLOW)" - " = -1 ENOENT (%m)\n"); + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, 0x100); + printf("utimensat(" str_at_fdcwd ", %s, " str_utime_now_omit + ", " str_at_symlink_nofollow ") = %s\n", qname, errstr); + + if (F8ILL_KULONG_SUPPORTED) { + k_utimensat(kfdcwd, kfname, f8ill_ptr_to_kulong(ts), 0); + printf("utimensat(" str_at_fdcwd ", %s, %#jx, 0) = %s\n", + qname, (uintmax_t) f8ill_ptr_to_kulong(ts), errstr); + } + + /* flags */ + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, + (kernel_ulong_t) 0xdefaced00000200); + printf("utimensat(" str_at_fdcwd ", %s, " str_utime_now_omit + ", " str_at_removedir ") = %s\n", + qname, errstr); + + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, + (kernel_ulong_t) 0xdefaced00000600); + printf("utimensat(" str_at_fdcwd ", %s, " str_utime_now_omit + ", " str_flags1 ") = %s\n", + qname, errstr); + + k_utimensat(kfdcwd, kfname, (uintptr_t) ts, (kernel_ulong_t) -1ULL); + printf("utimensat(" str_at_fdcwd ", %s, " str_utime_now_omit + ", " str_flags2 ") = %s\n", + qname, errstr); puts("+++ exited with 0 +++"); return 0; @@ -95,7 +222,6 @@ main(void) #else -SKIP_MAIN_UNDEFINED("HAVE_UTIMENSAT && AT_FDCWD && AT_SYMLINK_NOFOLLOW" - " && UTIME_NOW && UTIME_OMIT") +SKIP_MAIN_UNDEFINED("__NR_utimensat && UTIME_NOW && UTIME_OMIT") #endif diff --git a/tests/utimensat.gen.test b/tests/utimensat.gen.test new file mode 100755 index 00000000..07dffa37 --- /dev/null +++ b/tests/utimensat.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (utimensat -a33 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a33 diff --git a/tests/utimensat.test b/tests/utimensat.test deleted file mode 100755 index 52e3f316..00000000 --- a/tests/utimensat.test +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -# Check decoding of utimensat syscall. - -. "${srcdir=.}/init.sh" - -run_prog > /dev/null -run_strace -e utimensat $args > "$OUT" - -check_prog grep -LC_ALL=C grep -x "utimensat(.*" "$LOG" > /dev/null || { - rm -f "$OUT" - skip_ 'test executable does not use utimensat syscall' -} - -match_diff "$LOG" "$OUT" - -rm -f "$OUT" - -exit 0 diff --git a/tests/utimes.c b/tests/utimes.c index bbfa0310..1aee6db3 100644 --- a/tests/utimes.c +++ b/tests/utimes.c @@ -1,30 +1,10 @@ /* * Check decoding of utimes syscall. * - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -32,50 +12,10 @@ #ifdef __NR_utimes -# include -# include -# include -# include - -int -main(void) -{ - struct timeval tv; - if (gettimeofday(&tv, NULL)) - perror_msg_and_fail("gettimeofday"); - - static const char sample[] = "utimes_sample"; - - long rc = syscall(__NR_utimes, sample, 0); - printf("utimes(\"%s\", NULL) = %ld %s (%m)\n", - sample, rc, errno2name()); - - struct timeval *const ts = tail_alloc(sizeof(*ts) * 2); - - ts[0].tv_sec = tv.tv_sec; - ts[0].tv_usec = tv.tv_usec; - ts[1].tv_sec = tv.tv_sec - 1; - ts[1].tv_usec = tv.tv_usec + 1; - - rc = syscall(__NR_utimes, 0, ts + 2); - printf("utimes(NULL, %p) = %ld %s (%m)\n", ts + 2, rc, errno2name()); - - rc = syscall(__NR_utimes, 0, ts + 1); - printf("utimes(NULL, [{tv_sec=%jd, tv_usec=%jd}, %p]) = " - "%ld %s (%m)\n", - (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, - ts + 2, rc, errno2name()); - - rc = syscall(__NR_utimes, "", ts); - printf("utimes(\"\", [{tv_sec=%jd, tv_usec=%jd}, " - "{tv_sec=%jd, tv_usec=%jd}]) = %ld %s (%m)\n", - (intmax_t) ts[0].tv_sec, (intmax_t) ts[0].tv_usec, - (intmax_t) ts[1].tv_sec, (intmax_t) ts[1].tv_usec, - rc, errno2name()); - - puts("+++ exited with 0 +++"); - return 0; -} +# define TEST_SYSCALL_NR __NR_utimes +# define TEST_SYSCALL_STR "utimes" +# define TEST_STRUCT struct timeval +# include "xutimes.c" #else diff --git a/tests/utimes.gen.test b/tests/utimes.gen.test new file mode 100755 index 00000000..559243e9 --- /dev/null +++ b/tests/utimes.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (utimes -a17 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a17 diff --git a/tests/utimes.test b/tests/utimes.test deleted file mode 100755 index 99143a0b..00000000 --- a/tests/utimes.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check utimes syscall decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a21 diff --git a/tests/vfork-f.c b/tests/vfork-f.c index b14e4b49..ec31da96 100644 --- a/tests/vfork-f.c +++ b/tests/vfork-f.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/vfork-f.gen.test b/tests/vfork-f.gen.test new file mode 100755 index 00000000..b3c1c6b0 --- /dev/null +++ b/tests/vfork-f.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (vfork-f -a26 -qq -f -e signal=none -e trace=chdir); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a26 -qq -f -e signal=none -e trace=chdir diff --git a/tests/vfork-f.test b/tests/vfork-f.test deleted file mode 100755 index ff4422b2..00000000 --- a/tests/vfork-f.test +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -# Check how strace -f follows vfork syscall. - -. "${srcdir=.}/fork-f.test" diff --git a/tests/vhangup.c b/tests/vhangup.c index e7ddabba..1a786cc3 100644 --- a/tests/vhangup.c +++ b/tests/vhangup.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include diff --git a/tests/vhangup.gen.test b/tests/vhangup.gen.test new file mode 100755 index 00000000..da192169 --- /dev/null +++ b/tests/vhangup.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (vhangup -a10 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a10 diff --git a/tests/vhangup.test b/tests/vhangup.test deleted file mode 100755 index 8fe1cacb..00000000 --- a/tests/vhangup.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# Check vhangup syscall decoding. - -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a10 diff --git a/tests/vmsplice.c b/tests/vmsplice.c index f29962e3..b986dafa 100644 --- a/tests/vmsplice.c +++ b/tests/vmsplice.c @@ -2,29 +2,10 @@ * This file is part of vmsplice strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -86,7 +67,7 @@ main(void) " * %u bytes in buffer 2\n" " | 00000 %-49s %-16s |\n", w0_c, LENGTH_OF(w0_c), w1_c, LENGTH_OF(w1_c), - w2_c, LENGTH_OF(w2_c), ARRAY_SIZE(iov_), + w2_c, LENGTH_OF(w2_c), (unsigned int) ARRAY_SIZE(iov_), "SPLICE_F_NONBLOCK", len, LENGTH_OF(w0_c), w0_d, w0_c, LENGTH_OF(w1_c), w1_d, w1_c, LENGTH_OF(w2_c), w2_d, w2_c); diff --git a/tests/vmsplice.gen.test b/tests/vmsplice.gen.test new file mode 100755 index 00000000..0dc18b63 --- /dev/null +++ b/tests/vmsplice.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (vmsplice -ewrite=1 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -ewrite=1 diff --git a/tests/vmsplice.test b/tests/vmsplice.test deleted file mode 100755 index 8a80650e..00000000 --- a/tests/vmsplice.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of vmsplice syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -ewrite=1 diff --git a/tests/wait4-v.gen.test b/tests/wait4-v.gen.test new file mode 100755 index 00000000..5b23f422 --- /dev/null +++ b/tests/wait4-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (wait4-v -v -e signal=none -e trace=wait4); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e signal=none -e trace=wait4 diff --git a/tests/wait4-v.test b/tests/wait4-v.test deleted file mode 100755 index 58e55f25..00000000 --- a/tests/wait4-v.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check verbose decoding of wait4 syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -e signal=none -e trace=wait4 diff --git a/tests/wait4.c b/tests/wait4.c index ccb3ebb9..29b0cadd 100644 --- a/tests/wait4.c +++ b/tests/wait4.c @@ -2,29 +2,10 @@ * Check decoding of wait4 syscall. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -40,8 +21,8 @@ sprint_rusage(const struct rusage *const ru) { static char buf[1024]; snprintf(buf, sizeof(buf), - "{ru_utime={tv_sec=%lu, tv_usec=%lu}" - ", ru_stime={tv_sec=%lu, tv_usec=%lu}" + "{ru_utime={tv_sec=%lld, tv_usec=%llu}" + ", ru_stime={tv_sec=%lld, tv_usec=%llu}" #if VERBOSE ", ru_maxrss=%lu" ", ru_ixrss=%lu" @@ -60,10 +41,10 @@ sprint_rusage(const struct rusage *const ru) #else ", ...}" #endif - , (long) ru->ru_utime.tv_sec - , (long) ru->ru_utime.tv_usec - , (long) ru->ru_stime.tv_sec - , (long) ru->ru_stime.tv_usec + , (long long) ru->ru_utime.tv_sec + , zero_extend_signed_to_ull(ru->ru_utime.tv_usec) + , (long long) ru->ru_stime.tv_sec + , zero_extend_signed_to_ull(ru->ru_stime.tv_usec) #if VERBOSE , (long) ru->ru_maxrss , (long) ru->ru_ixrss @@ -119,12 +100,12 @@ main(void) (void) close(0); - int *const s = tail_alloc(sizeof(*s)); + TAIL_ALLOC_OBJECT_CONST_PTR(int, s); if (wait4(pid, s, WNOHANG|__WALL, NULL)) perror_msg_and_fail("wait4 #1"); tprintf("wait4(%d, %p, WNOHANG|__WALL, NULL) = 0\n", pid, s); - struct rusage *const rusage = tail_alloc(sizeof(*rusage)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct rusage, rusage); if (wait4(pid, s, WNOHANG|__WALL, rusage)) perror_msg_and_fail("wait4 #2"); tprintf("wait4(%d, %p, WNOHANG|__WALL, %p) = 0\n", pid, s, rusage); diff --git a/tests/wait4.gen.test b/tests/wait4.gen.test new file mode 100755 index 00000000..22a982fd --- /dev/null +++ b/tests/wait4.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (wait4 -esignal=none ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests/wait4.test b/tests/wait4.test deleted file mode 100755 index 6338d1f6..00000000 --- a/tests/wait4.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of wait4 syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -esignal=none diff --git a/tests/waitid-v.gen.test b/tests/waitid-v.gen.test new file mode 100755 index 00000000..45744cd5 --- /dev/null +++ b/tests/waitid-v.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (waitid-v -v -e signal=none -e trace=waitid); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -v -e signal=none -e trace=waitid diff --git a/tests/waitid-v.test b/tests/waitid-v.test deleted file mode 100755 index eb498cb0..00000000 --- a/tests/waitid-v.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check verbose decoding of waitid syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -v -e signal=none -e trace=waitid diff --git a/tests/waitid.c b/tests/waitid.c index 6a102990..f4e4a0a8 100644 --- a/tests/waitid.c +++ b/tests/waitid.c @@ -2,29 +2,10 @@ * Check decoding of waitid syscall. * * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -42,8 +23,8 @@ sprint_rusage(const struct rusage *const ru) { static char buf[1024]; snprintf(buf, sizeof(buf), - "{ru_utime={tv_sec=%lld, tv_usec=%lld}" - ", ru_stime={tv_sec=%lld, tv_usec=%lld}" + "{ru_utime={tv_sec=%lld, tv_usec=%llu}" + ", ru_stime={tv_sec=%lld, tv_usec=%llu}" #if VERBOSE ", ru_maxrss=%llu" ", ru_ixrss=%llu" @@ -63,9 +44,9 @@ sprint_rusage(const struct rusage *const ru) ", ...}" #endif , (long long) ru->ru_utime.tv_sec - , (long long) ru->ru_utime.tv_usec + , zero_extend_signed_to_ull(ru->ru_utime.tv_usec) , (long long) ru->ru_stime.tv_sec - , (long long) ru->ru_stime.tv_usec + , zero_extend_signed_to_ull(ru->ru_stime.tv_usec) #if VERBOSE , zero_extend_signed_to_ull(ru->ru_maxrss) , zero_extend_signed_to_ull(ru->ru_ixrss) @@ -110,7 +91,8 @@ si_code_2_name(const int code) #ifdef CLD_CONTINUED CASE(CLD_CONTINUED); #endif - default: perror_msg_and_fail("unknown si_code %d", code); + default: + perror_msg_and_fail("unknown si_code %d", code); } } @@ -185,9 +167,9 @@ main(void) perror_msg_and_fail("waitid #1"); tprintf("waitid(P_PID, %d, NULL, WNOHANG|WEXITED, NULL) = 0\n", pid); - siginfo_t *const sinfo = tail_alloc(sizeof(*sinfo)); + TAIL_ALLOC_OBJECT_CONST_PTR(siginfo_t, sinfo); memset(sinfo, 0, sizeof(*sinfo)); - struct rusage *const rusage = tail_alloc(sizeof(*rusage)); + TAIL_ALLOC_OBJECT_CONST_PTR(struct rusage, rusage); if (do_waitid(P_PID, pid, sinfo, WNOHANG|WEXITED|WSTOPPED, rusage)) perror_msg_and_fail("waitid #2"); tprintf("waitid(P_PID, %d, {}, WNOHANG|WEXITED|WSTOPPED, %s) = 0\n", diff --git a/tests/waitid.gen.test b/tests/waitid.gen.test new file mode 100755 index 00000000..22edd673 --- /dev/null +++ b/tests/waitid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (waitid -esignal=none ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -esignal=none diff --git a/tests/waitid.test b/tests/waitid.test deleted file mode 100755 index 3bcba3ab..00000000 --- a/tests/waitid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of waitid syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -esignal=none diff --git a/tests/waitpid.c b/tests/waitpid.c index 2e22e245..7069bec8 100644 --- a/tests/waitpid.c +++ b/tests/waitpid.c @@ -1,30 +1,10 @@ /* * Check decoding of waitpid syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" diff --git a/tests/waitpid.gen.test b/tests/waitpid.gen.test new file mode 100755 index 00000000..a5678a1a --- /dev/null +++ b/tests/waitpid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (waitpid -a28 ); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a28 diff --git a/tests/waitpid.test b/tests/waitpid.test deleted file mode 100755 index 93807d1f..00000000 --- a/tests/waitpid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check decoding of waitpid syscall. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a28 diff --git a/tests/xattr-strings.c b/tests/xattr-strings.c index 310929a9..a3fdabbd 100644 --- a/tests/xattr-strings.c +++ b/tests/xattr-strings.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #ifdef HAVE_SYS_XATTR_H diff --git a/tests/xattr-strings.gen.test b/tests/xattr-strings.gen.test new file mode 100755 index 00000000..33178926 --- /dev/null +++ b/tests/xattr-strings.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (xattr-strings -a22 -s 4 -e trace=fsetxattr); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -s 4 -e trace=fsetxattr diff --git a/tests/xattr-strings.test b/tests/xattr-strings.test deleted file mode 100755 index 25ef360b..00000000 --- a/tests/xattr-strings.test +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/sh - -# Check *xattr syscalls decoding when limiting string size. - -. "${srcdir=.}/init.sh" - -run_strace_match_diff -a22 -s 4 -e trace=fsetxattr diff --git a/tests/xattr.c b/tests/xattr.c index a772eced..56783694 100644 --- a/tests/xattr.c +++ b/tests/xattr.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,8 +17,6 @@ # define XATTR_SIZE_MAX 65536 # endif -#define DEFAULT_STRLEN 32 - int main(void) { @@ -114,9 +93,7 @@ main(void) else { const int ellipsis = rc > DEFAULT_STRLEN; - putchar('"'); print_quoted_memory(big, ellipsis ? DEFAULT_STRLEN : rc); - putchar('"'); if (ellipsis) fputs("...", stdout); } diff --git a/tests/xattr.gen.test b/tests/xattr.gen.test new file mode 100755 index 00000000..030f2ce0 --- /dev/null +++ b/tests/xattr.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (xattr -a22 -e trace=getxattr,fgetxattr,lgetxattr,setxattr,fsetxattr,lsetxattr,listxattr,flistxattr,llistxattr,removexattr,fremovexattr,lremovexattr); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a22 -e trace=getxattr,fgetxattr,lgetxattr,setxattr,fsetxattr,lsetxattr,listxattr,flistxattr,llistxattr,removexattr,fremovexattr,lremovexattr diff --git a/tests/xattr.test b/tests/xattr.test deleted file mode 100755 index 8c7a87b9..00000000 --- a/tests/xattr.test +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -# Check *xattr syscalls decoding. - -. "${srcdir=.}/init.sh" - -syscalls= -for n in getxattr setxattr listxattr removexattr; do - syscalls="$syscalls,${n},f${n},l${n}" -done - -run_strace_match_diff -a22 -e trace=$syscalls diff --git a/tests/xchownx.c b/tests/xchownx.c index fe582835..8820e00d 100644 --- a/tests/xchownx.c +++ b/tests/xchownx.c @@ -2,29 +2,10 @@ * Check decoding of chown/chown32/lchown/lchown32/fchown/fchown32 syscalls. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -45,10 +26,17 @@ # define CHECK_OVERFLOWGID(arg) #endif -#define UNLINK_SAMPLE \ - if (unlink(sample)) perror_msg_and_fail("unlink") -#define CLOSE_SAMPLE \ - if (close(fd)) perror_msg_and_fail("close") +#define UNLINK_SAMPLE \ + do { \ + if (unlink(sample)) \ + perror_msg_and_fail("unlink"); \ + } while (0) + +#define CLOSE_SAMPLE \ + do { \ + if (close(fd)) \ + perror_msg_and_fail("close"); \ + } while (0) #ifdef ACCESS_BY_DESCRIPTOR # define SYSCALL_ARG1 fd diff --git a/tests/xet_robust_list.c b/tests/xet_robust_list.c index 211dec45..cf4f2234 100644 --- a/tests/xet_robust_list.c +++ b/tests/xet_robust_list.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -51,8 +32,8 @@ main(void) { const pid_t pid = getpid(); const long long_pid = (unsigned long) (0xdeadbeef00000000LL | pid); - void **p_head = tail_alloc(sizeof(void *)); - size_t *p_len = tail_alloc(sizeof(size_t)); + TAIL_ALLOC_OBJECT_CONST_PTR(void *, p_head); + TAIL_ALLOC_OBJECT_CONST_PTR(size_t, p_len); if (syscall(__NR_get_robust_list, long_pid, p_head, p_len)) perror_msg_and_skip("get_robust_list"); diff --git a/tests/xet_robust_list.gen.test b/tests/xet_robust_list.gen.test new file mode 100755 index 00000000..798cdff5 --- /dev/null +++ b/tests/xet_robust_list.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (xet_robust_list -a24 -e trace=get_robust_list,set_robust_list); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a24 -e trace=get_robust_list,set_robust_list diff --git a/tests/xet_robust_list.test b/tests/xet_robust_list.test deleted file mode 100755 index 8a3a3820..00000000 --- a/tests/xet_robust_list.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check get_robust_list and set_robust_list syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a24 -e trace=get_robust_list,set_robust_list diff --git a/tests/xet_thread_area_x86.c b/tests/xet_thread_area_x86.c new file mode 100644 index 00000000..a1efd319 --- /dev/null +++ b/tests/xet_thread_area_x86.c @@ -0,0 +1,206 @@ +/* + * Check decoding of set_thread_area and get_thread_area syscalls on x86 + * architecture. + * + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" + +#include + +#if defined __NR_get_thread_area && defined __NR_set_thread_area \ + && defined HAVE_STRUCT_USER_DESC + +# include +# include +# include +# include +# include +# include + +# include "print_user_desc.c" + +long errnum; + +static void +printptr(kernel_ulong_t ptr, const char *ptr_str) +{ + if (ptr_str) + printf("%s", ptr_str); + else + printf("%#llx", zero_extend_signed_to_ull(ptr)); +} + +/** + * Perform set_thread_area call along with printing the expected output. + * + * @param ptr_val Pointer to thread area argument. + * @param ptr_str Explicit string representation of the argument. + * @param valid Whether argument points to the valid memory and its contents + * should be decoded. + * @param entry_number_str explicit decoding of the entry_number field. + */ +static long +set_thread_area(kernel_ulong_t ptr_val, const char *ptr_str, bool valid, + const char *entry_number_str) +{ + struct user_desc *ptr = (struct user_desc *) (uintptr_t) ptr_val; + long rc = -1; + int saved_errno; + + rc = syscall(__NR_set_thread_area, ptr_val); + saved_errno = errno; + printf("set_thread_area("); + + if (valid) + print_user_desc(ptr, entry_number_str); + else + printptr(ptr_val, ptr_str); + + errno = saved_errno; + printf(") = %s", sprintrc(rc)); + if (!rc) + printf(" (entry_number=%u)", ptr->entry_number); + + puts(""); + + return rc; +} + +/** + * Perform get_thread_are call along with printing the expected output and + * checking the result against the argument of the previous set_thread_area + * call, if it had place. + * + * @param ptr_val Pointer to thread area argument. + * @param ptr_str Explicit string representation of the argument. + * @param valid Whether argument points to the valid memory and its contents + * should be decoded. + * @param set_rc Return code of the previous set_thread_area call. + * @param expected The value of the argument passed to the previous + * set_thread_area call. + */ +static void +get_thread_area(kernel_ulong_t ptr_val, const char *ptr_str, bool valid, + long set_rc, kernel_ulong_t expected) +{ + struct user_desc *ptr = (struct user_desc *) (uintptr_t) ptr_val; + struct user_desc *expected_ptr = + (struct user_desc *) (uintptr_t) expected; + int saved_errno; + long rc; + + rc = syscall(__NR_get_thread_area, ptr_val); + saved_errno = errno; + + printf("get_thread_area("); + + if (valid && !rc) { + if (!set_rc) { + assert(ptr->entry_number == expected_ptr->entry_number); + assert(ptr->base_addr == expected_ptr->base_addr); + assert(ptr->limit == expected_ptr->limit); + assert(ptr->seg_32bit == expected_ptr->seg_32bit); + assert(ptr->contents == expected_ptr->contents); + assert(ptr->read_exec_only == + expected_ptr->read_exec_only); + assert(ptr->limit_in_pages == + expected_ptr->limit_in_pages); + assert(ptr->seg_not_present == + expected_ptr->seg_not_present); + assert(ptr->useable == expected_ptr->useable); + /* + * We do not check lm as 32-bit processes ignore it, and + * only 32-bit processes can successfully execute + * get_thread_area. + */ + } + + print_user_desc(ptr, + (int) ptr->entry_number == -1 ? "-1" : NULL); + } else { + printptr(ptr_val, ptr_str); + } + + errno = saved_errno; + printf(") = %s\n", sprintrc(rc)); +} + +int main(void) +{ + TAIL_ALLOC_OBJECT_CONST_PTR(struct user_desc, ta1); + TAIL_ALLOC_OBJECT_CONST_PTR(struct user_desc, ta2); + TAIL_ALLOC_OBJECT_CONST_PTR(unsigned int, bogus_entry_number); + + long set_rc = -1; + + /* + * Let's do some weird syscall, it will mark the beginning of our + * expected output. + */ + syscall(__NR_reboot, 0, 0, 0, 0); + + set_rc = set_thread_area((uintptr_t) ARG_STR(NULL), false, NULL); + get_thread_area((uintptr_t) ARG_STR(NULL), false, set_rc, + (uintptr_t) NULL); + + set_rc = set_thread_area(-1, NULL, false, NULL); + get_thread_area(-1, NULL, false, set_rc, -1); + + fill_memory(ta1, sizeof(*ta1)); + fill_memory_ex(ta2, sizeof(*ta2), 0xA5, 0x5A); + + set_thread_area((uintptr_t) (ta1 + 1), NULL, false, NULL); + + set_thread_area((uintptr_t) bogus_entry_number, NULL, false, NULL); + + set_thread_area((uintptr_t) ta1, NULL, true, NULL); + + ta1->entry_number = -1; + ta1->base_addr = 0; + ta1->limit = 0; + ta1->contents = 1; + ta1->seg_32bit = 1; + ta1->seg_not_present = 0; + + set_rc = set_thread_area((uintptr_t) ta1, NULL, true, "-1"); + + *bogus_entry_number = 2718281828U; + get_thread_area((uintptr_t) bogus_entry_number, + "{entry_number=2718281828, ...}", + false, set_rc, (uintptr_t) ta1); + + /* That one should return -EFAULT on i386 */ + *bogus_entry_number = 12; + get_thread_area((uintptr_t) bogus_entry_number, + "{entry_number=12, ...}", + false, set_rc, (uintptr_t) ta1); + + ta2->entry_number = 3141592653U; + get_thread_area((uintptr_t) ta2, "{entry_number=3141592653, ...}", + false, set_rc, (uintptr_t) ta1); + + ta2->entry_number = -1; + get_thread_area((uintptr_t) ta2, "{entry_number=-1, ...}", + false, set_rc, (uintptr_t) ta1); + + ta2->entry_number = ta1->entry_number; + assert(set_rc == 0 || (int) ta2->entry_number == -1); + get_thread_area((uintptr_t) ta2, "{entry_number=-1, ...}", + true, set_rc, (uintptr_t) ta1); + + puts("+++ exited with 0 +++"); + + return 0; +} + +#else + +SKIP_MAIN_UNDEFINED("__NR_get_thread_area && __NR_set_thread_area" + " && HAVE_STRUCT_USER_DESC"); + +#endif diff --git a/tests/xet_thread_area_x86.test b/tests/xet_thread_area_x86.test new file mode 100755 index 00000000..2f7fe27a --- /dev/null +++ b/tests/xet_thread_area_x86.test @@ -0,0 +1,16 @@ +#!/bin/sh +# +# Check decoding of set_thread_area and get_thread_area syscalls on x86. +# +# Copyright (c) 2018 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +check_prog sed +run_prog > /dev/null +run_strace -a22 -e trace=reboot,/[gs]et_thread_area $args > "$EXP" +sed '0,/^reboot/d' "$LOG" > "$OUT" +match_diff "$OUT" "$EXP" diff --git a/tests/xetitimer.c b/tests/xetitimer.c index 4b17edd3..8d758974 100644 --- a/tests/xetitimer.c +++ b/tests/xetitimer.c @@ -1,76 +1,163 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin - * All rights reserved. + * Check decoding of setitimer and getitimer syscalls. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" #include #include #include +#include +#include int main(void) { - struct { - struct itimerval itv; - uint32_t pad[4]; - } old = { - .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } - }, new = { - .itv = { - .it_interval = { 0xc0de1, 0xc0de2 }, - .it_value = { 0xc0de3, 0xc0de4 } - }, - .pad = { 0xdeadbeef, 0xbadc0ded, 0xdeadbeef, 0xbadc0ded } + static const struct itimerval new = { + .it_interval = { 0xc0de1, 0xc0de2 }, + .it_value = { 0xc0de3, 0xc0de4 } }; + static const kernel_ulong_t long_timer = + F8ILL_KULONG_MASK | ITIMER_REAL; + static const kernel_ulong_t bogus_timer = + (kernel_ulong_t) 0xfacefeeddeadbeefULL; + + TAIL_ALLOC_OBJECT_CONST_PTR(struct itimerval, p_old); + struct itimerval *const p_new = tail_memdup(&new, sizeof(new)); + void *const efault = tail_alloc(sizeof(new) - 8); + long rc; - if (setitimer(ITIMER_REAL, &new.itv, &old.itv)) + if (setitimer(ITIMER_REAL, p_new, NULL)) perror_msg_and_skip("setitimer"); printf("setitimer(ITIMER_REAL" - ", {it_interval={tv_sec=%jd, tv_usec=%jd}, " - "it_value={tv_sec=%jd, tv_usec=%jd}}" - ", {it_interval={tv_sec=%jd, tv_usec=%jd}, " - "it_value={tv_sec=%jd, tv_usec=%jd}}) = 0\n", - (intmax_t) new.itv.it_interval.tv_sec, - (intmax_t) new.itv.it_interval.tv_usec, - (intmax_t) new.itv.it_value.tv_sec, - (intmax_t) new.itv.it_value.tv_usec, - (intmax_t) old.itv.it_interval.tv_sec, - (intmax_t) old.itv.it_interval.tv_usec, - (intmax_t) old.itv.it_value.tv_sec, - (intmax_t) old.itv.it_value.tv_usec); - - if (getitimer(ITIMER_REAL, &old.itv)) + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}" + ", NULL) = 0\n", + (long long) new.it_interval.tv_sec, + zero_extend_signed_to_ull(new.it_interval.tv_usec), + (long long) new.it_value.tv_sec, + zero_extend_signed_to_ull(new.it_value.tv_usec)); + + fill_memory(p_old, sizeof(*p_old)); + if (getitimer(ITIMER_REAL, p_old)) perror_msg_and_skip("getitimer"); printf("getitimer(ITIMER_REAL" - ", {it_interval={tv_sec=%jd, tv_usec=%jd}, " - "it_value={tv_sec=%jd, tv_usec=%jd}}) = 0\n", - (intmax_t) old.itv.it_interval.tv_sec, - (intmax_t) old.itv.it_interval.tv_usec, - (intmax_t) old.itv.it_value.tv_sec, - (intmax_t) old.itv.it_value.tv_usec); + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}) = 0\n", + (long long) p_old->it_interval.tv_sec, + zero_extend_signed_to_ull(p_old->it_interval.tv_usec), + (long long) p_old->it_value.tv_sec, + zero_extend_signed_to_ull(p_old->it_value.tv_usec)); + + fill_memory(p_old, sizeof(*p_old)); + setitimer(ITIMER_REAL, p_new, p_old); + printf("setitimer(ITIMER_REAL" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}) = 0\n", + (long long) new.it_interval.tv_sec, + zero_extend_signed_to_ull(new.it_interval.tv_usec), + (long long) new.it_value.tv_sec, + zero_extend_signed_to_ull(new.it_value.tv_usec), + (long long) p_old->it_interval.tv_sec, + zero_extend_signed_to_ull(p_old->it_interval.tv_usec), + (long long) p_old->it_value.tv_sec, + zero_extend_signed_to_ull(p_old->it_value.tv_usec)); + + rc = getitimer(ITIMER_REAL, efault); + printf("getitimer(ITIMER_REAL, %p) = %s\n", efault, sprintrc(rc)); + + rc = setitimer(ITIMER_REAL, p_new, efault); + printf("setitimer(ITIMER_REAL" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}, %p) = %s\n", + (long long) new.it_interval.tv_sec, + zero_extend_signed_to_ull(new.it_interval.tv_usec), + (long long) new.it_value.tv_sec, + zero_extend_signed_to_ull(new.it_value.tv_usec), + efault, sprintrc(rc)); + + rc = setitimer(ITIMER_REAL, efault, p_old); + printf("setitimer(ITIMER_REAL, %p, %p) = %s\n", + efault, p_old, sprintrc(rc)); + + fill_memory(p_old, sizeof(*p_old)); + rc = syscall(__NR_setitimer, long_timer, p_new, p_old); + printf("setitimer(ITIMER_REAL" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}) = %s\n", + (long long) new.it_interval.tv_sec, + zero_extend_signed_to_ull(new.it_interval.tv_usec), + (long long) new.it_value.tv_sec, + zero_extend_signed_to_ull(new.it_value.tv_usec), + (long long) p_old->it_interval.tv_sec, + zero_extend_signed_to_ull(p_old->it_interval.tv_usec), + (long long) p_old->it_value.tv_sec, + zero_extend_signed_to_ull(p_old->it_value.tv_usec), + sprintrc(rc)); + + fill_memory(p_old, sizeof(*p_old)); + rc = syscall(__NR_getitimer, long_timer, p_old); + printf("getitimer(ITIMER_REAL" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}) = %s\n", + (long long) p_old->it_interval.tv_sec, + zero_extend_signed_to_ull(p_old->it_interval.tv_usec), + (long long) p_old->it_value.tv_sec, + zero_extend_signed_to_ull(p_old->it_value.tv_usec), + sprintrc(rc)); + + rc = syscall(__NR_setitimer, bogus_timer, p_new, p_old); + printf("setitimer(%#x /* ITIMER_??? */" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}, %p) = %s\n", + (int) bogus_timer, + (long long) new.it_interval.tv_sec, + zero_extend_signed_to_ull(new.it_interval.tv_usec), + (long long) new.it_value.tv_sec, + zero_extend_signed_to_ull(new.it_value.tv_usec), + p_old, sprintrc(rc)); + + rc = syscall(__NR_getitimer, bogus_timer, p_old); + printf("getitimer(%#x /* ITIMER_??? */, %p) = %s\n", + (int) bogus_timer, p_old, sprintrc(rc)); + + if (F8ILL_KULONG_SUPPORTED) { + const kernel_ulong_t ill_new = f8ill_ptr_to_kulong(p_new); + const kernel_ulong_t ill_old = f8ill_ptr_to_kulong(p_old); + + rc = syscall(__NR_setitimer, long_timer, ill_new, ill_old); + printf("setitimer(ITIMER_REAL, %#llx, %#llx) = %s\n", + (unsigned long long) ill_new, + (unsigned long long) ill_old, + sprintrc(rc)); + + rc = syscall(__NR_getitimer, long_timer, ill_old); + printf("getitimer(ITIMER_REAL, %#llx) = %s\n", + (unsigned long long) ill_old, sprintrc(rc)); + } + + p_new->it_interval.tv_sec = 0xdeadbeefU; + p_new->it_interval.tv_usec = 0xfacefeedU; + p_new->it_value.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + p_new->it_value.tv_usec = (suseconds_t) 0xbadc0dedfacefeedLL; + + rc = setitimer(ITIMER_REAL, p_new, p_old); + printf("setitimer(ITIMER_REAL" + ", {it_interval={tv_sec=%lld, tv_usec=%llu}" + ", it_value={tv_sec=%lld, tv_usec=%llu}}, %p) = %s\n", + (long long) p_new->it_interval.tv_sec, + zero_extend_signed_to_ull(p_new->it_interval.tv_usec), + (long long) p_new->it_value.tv_sec, + zero_extend_signed_to_ull(p_new->it_value.tv_usec), + p_old, sprintrc(rc)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests/xetitimer.gen.test b/tests/xetitimer.gen.test new file mode 100755 index 00000000..0cdb9267 --- /dev/null +++ b/tests/xetitimer.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (xetitimer -a29 -e trace=setitimer,getitimer); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a29 -e trace=setitimer,getitimer diff --git a/tests/xetitimer.test b/tests/xetitimer.test deleted file mode 100755 index 4aa00cce..00000000 --- a/tests/xetitimer.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check setitimer and getitimer syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -e trace=setitimer,getitimer diff --git a/tests/xetpgid.c b/tests/xetpgid.c index 24e0d7f0..46dd332d 100644 --- a/tests/xetpgid.c +++ b/tests/xetpgid.c @@ -2,29 +2,10 @@ * This file is part of xetpgid strace test. * * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -39,13 +20,10 @@ int main(void) { const int pid = getpid(); - long rc = syscall(__NR_getpgid, - (unsigned long) 0xffffffff00000000ULL | pid); + long rc = syscall(__NR_getpgid, F8ILL_KULONG_MASK | pid); printf("getpgid(%d) = %ld\n", pid, rc); - rc = syscall(__NR_setpgid, - (unsigned long) 0xffffffff00000000ULL, - (unsigned long) 0xffffffff00000000ULL | pid); + rc = syscall(__NR_setpgid, F8ILL_KULONG_MASK, F8ILL_KULONG_MASK | pid); printf("setpgid(0, %d) = %ld\n", pid, rc); puts("+++ exited with 0 +++"); diff --git a/tests/xetpgid.gen.test b/tests/xetpgid.gen.test new file mode 100755 index 00000000..fc57fc41 --- /dev/null +++ b/tests/xetpgid.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (xetpgid -a11 -e trace=getpgid,setpgid); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a11 -e trace=getpgid,setpgid diff --git a/tests/xetpgid.test b/tests/xetpgid.test deleted file mode 100755 index 07f4f9e8..00000000 --- a/tests/xetpgid.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getpgid and setpgid syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a11 -e trace=getpgid,setpgid diff --git a/tests/xetpriority.c b/tests/xetpriority.c index ed552598..5cd97ea9 100644 --- a/tests/xetpriority.c +++ b/tests/xetpriority.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + #include "tests.h" #include @@ -12,12 +19,11 @@ main(void) { const int pid = getpid(); long rc = syscall(__NR_getpriority, PRIO_PROCESS, - (unsigned long) 0xffffffff00000000ULL | pid); + F8ILL_KULONG_MASK | pid); printf("getpriority(PRIO_PROCESS, %d) = %ld\n", pid, rc); rc = syscall(__NR_setpriority, PRIO_PROCESS, - (unsigned long) 0xffffffff00000000ULL | pid, - (unsigned long) 0xffffffff00000000ULL); + F8ILL_KULONG_MASK | pid, F8ILL_KULONG_MASK); printf("setpriority(PRIO_PROCESS, %d, 0) = %s\n", pid, sprintrc(rc)); puts("+++ exited with 0 +++"); diff --git a/tests/xetpriority.gen.test b/tests/xetpriority.gen.test new file mode 100755 index 00000000..4b955247 --- /dev/null +++ b/tests/xetpriority.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (xetpriority -a29 -e trace=getpriority,setpriority); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a29 -e trace=getpriority,setpriority diff --git a/tests/xetpriority.test b/tests/xetpriority.test deleted file mode 100755 index 2c84ba41..00000000 --- a/tests/xetpriority.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check getpriority and setpriority syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a29 -e trace=getpriority,setpriority diff --git a/tests/xettimeofday.c b/tests/xettimeofday.c index d36c57b4..9c811262 100644 --- a/tests/xettimeofday.c +++ b/tests/xettimeofday.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include "tests.h" @@ -36,36 +17,49 @@ int main(void) { - struct { - struct timeval tv; - uint32_t pad0[2]; - struct timezone tz; - uint32_t pad1[2]; - } t = { - .pad0 = { 0xdeadbeef, 0xbadc0ded }, - .pad1 = { 0xdeadbeef, 0xbadc0ded } - }; + TAIL_ALLOC_OBJECT_CONST_PTR(struct timeval, tv); + TAIL_ALLOC_OBJECT_CONST_PTR(struct timezone, tz); - if (syscall(__NR_gettimeofday, &t.tv, NULL)) + if (syscall(__NR_gettimeofday, tv, NULL)) perror_msg_and_skip("gettimeofday"); - printf("gettimeofday({tv_sec=%jd, tv_usec=%jd}, NULL) = 0\n", - (intmax_t) t.tv.tv_sec, (intmax_t) t.tv.tv_usec); + printf("gettimeofday({tv_sec=%lld, tv_usec=%llu}, NULL) = 0\n", + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); - if (syscall(__NR_gettimeofday, &t.tv, &t.tz)) + if (syscall(__NR_gettimeofday, tv, tz)) perror_msg_and_skip("gettimeofday"); - printf("gettimeofday({tv_sec=%jd, tv_usec=%jd}" + printf("gettimeofday({tv_sec=%lld, tv_usec=%llu}" ", {tz_minuteswest=%d, tz_dsttime=%d}) = 0\n", - (intmax_t) t.tv.tv_sec, (intmax_t) t.tv.tv_usec, - t.tz.tz_minuteswest, t.tz.tz_dsttime); + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec), + tz->tz_minuteswest, tz->tz_dsttime); + + tv->tv_sec = -1; + tv->tv_usec = 1000000; + assert(syscall(__NR_settimeofday, tv, tz) == -1); + printf("settimeofday({tv_sec=%lld, tv_usec=%llu}" + ", {tz_minuteswest=%d, tz_dsttime=%d}) = %s\n", + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec), + tz->tz_minuteswest, tz->tz_dsttime, sprintrc(-1)); + + tv->tv_sec = 0xdeadbeefU; + tv->tv_usec = 0xfacefeedU; + assert(syscall(__NR_settimeofday, tv, tz) == -1); + printf("settimeofday({tv_sec=%lld, tv_usec=%llu}" + ", {tz_minuteswest=%d, tz_dsttime=%d}) = %s\n", + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec), + tz->tz_minuteswest, tz->tz_dsttime, sprintrc(-1)); - t.tv.tv_sec = -1; - t.tv.tv_usec = 1000000000; - assert(syscall(__NR_settimeofday, &t.tv, &t.tz) == -1); - printf("settimeofday({tv_sec=%jd, tv_usec=%jd}" - ", {tz_minuteswest=%d, tz_dsttime=%d})" - " = -1 EINVAL (%m)\n", - (intmax_t) t.tv.tv_sec, (intmax_t) t.tv.tv_usec, - t.tz.tz_minuteswest, t.tz.tz_dsttime); + tv->tv_sec = (time_t) 0xcafef00ddeadbeefLL; + tv->tv_usec = (suseconds_t) 0xbadc0dedfacefeedLL; + assert(syscall(__NR_settimeofday, tv, tz) == -1); + printf("settimeofday({tv_sec=%lld, tv_usec=%llu}" + ", {tz_minuteswest=%d, tz_dsttime=%d}) = %s\n", + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec), + tz->tz_minuteswest, tz->tz_dsttime, sprintrc(-1)); puts("+++ exited with 0 +++"); return 0; diff --git a/tests/xettimeofday.gen.test b/tests/xettimeofday.gen.test new file mode 100755 index 00000000..1a021e49 --- /dev/null +++ b/tests/xettimeofday.gen.test @@ -0,0 +1,4 @@ +#!/bin/sh -efu +# Generated by ./tests/gen_tests.sh from ./tests/gen_tests.in (xettimeofday -a20 -e trace=gettimeofday,settimeofday); do not edit. +. "${srcdir=.}/init.sh" +run_strace_match_diff -a20 -e trace=gettimeofday,settimeofday diff --git a/tests/xettimeofday.test b/tests/xettimeofday.test deleted file mode 100755 index 68764e46..00000000 --- a/tests/xettimeofday.test +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# Check gettimeofday and settimeofday syscalls decoding. - -. "${srcdir=.}/init.sh" -run_strace_match_diff -a20 -e trace=gettimeofday,settimeofday diff --git a/tests/xgetrlimit.c b/tests/xgetrlimit.c index 78d9cb99..a1c89e9b 100644 --- a/tests/xgetrlimit.c +++ b/tests/xgetrlimit.c @@ -1,30 +1,11 @@ /* * Check decoding of getrlimit/ugetrlimit syscall. * - * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 Dmitry V. Levin + * Copyright (c) 2016-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -39,23 +20,55 @@ const char * sprint_rlim(kernel_ulong_t lim) { + static char buf[2][ /* space for 2 llu strings */ + 2*sizeof(lim)*3 + + /* space for XLAT_STYLE_ABBREV decoding */ + sizeof("*1024") + sizeof("RLIM64_INFINITY") + + /* space for C style comments */ + 6]; + static unsigned int i; + + i &= 1; + +#if XLAT_RAW + sprintf(buf[i], "%llu", (unsigned long long) lim); + return buf[i++]; +#else if (sizeof(lim) == sizeof(uint64_t)) { - if (lim == (kernel_ulong_t) -1ULL) + if (lim == (kernel_ulong_t) -1ULL) { +# if XLAT_VERBOSE + sprintf(buf[i], "%llu /* RLIM64_INFINITY */", + (unsigned long long) lim); + return buf[i++]; +# else /* XLAT_ABBREV */ return "RLIM64_INFINITY"; +# endif + } } else { - if (lim == (kernel_ulong_t) -1U) + if (lim == (kernel_ulong_t) -1U) { +# if XLAT_VERBOSE + sprintf(buf[i], "%llu /* RLIM_INFINITY */", + (unsigned long long) lim); + return buf[i++]; +# else /* XLAT_ABBREV */ return "RLIM_INFINITY"; +# endif + } } - static char buf[2][sizeof(lim)*3 + sizeof("*1024")]; - static int i; - i &= 1; if (lim > 1024 && lim % 1024 == 0) +# if XLAT_VERBOSE + sprintf(buf[i], "%llu /* %llu*1024 */", + (unsigned long long) lim, + (unsigned long long) lim / 1024); +# else /* XLAT_ABBREV */ sprintf(buf[i], "%llu*1024", (unsigned long long) lim / 1024); +# endif else sprintf(buf[i], "%llu", (unsigned long long) lim); return buf[i++]; +#endif /* !XLAT_RAW */ } #ifdef NR_GETRLIMIT @@ -71,13 +84,13 @@ main(void) long rc = syscall(NR_GETRLIMIT, res, 0); if (rc && ENOSYS == errno) perror_msg_and_skip(STR_GETRLIMIT); - printf("%s(%s, NULL) = %ld %s (%m)\n", - STR_GETRLIMIT, xlat->str, rc, errno2name()); + printf("%s(%s, NULL) = %s\n", + STR_GETRLIMIT, xlat->str, sprintrc(rc)); rc = syscall(NR_GETRLIMIT, res, rlimit); if (rc) - printf("%s(%s, NULL) = %ld %s (%m)\n", - STR_GETRLIMIT, xlat->str, rc, errno2name()); + printf("%s(%s, %p) = %s\n", + STR_GETRLIMIT, xlat->str, rlimit, sprintrc(rc)); else printf("%s(%s, {rlim_cur=%s, rlim_max=%s})" " = 0\n", STR_GETRLIMIT, xlat->str, diff --git a/tests/xselect.c b/tests/xselect.c index 39e87ac7..f6048f25 100644 --- a/tests/xselect.c +++ b/tests/xselect.c @@ -1,104 +1,453 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin - * All rights reserved. + * Check decoding of select/_newselect syscalls. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. + * Copyright (c) 2015-2018 Dmitry V. Levin + * Copyright (c) 2015-2017 The strace developers. + * All rights reserved. * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ /* * Based on test by Dr. David Alan Gilbert */ -#include +#include +#include +#include #include +#include #include #include -static fd_set set[0x1000000 / sizeof(fd_set)]; +static const char *errstr; -int main(void) +static long +xselect(const kernel_ulong_t nfds, + const kernel_ulong_t rs, + const kernel_ulong_t ws, + const kernel_ulong_t es, + const kernel_ulong_t tv) +#ifndef xselect { - int fds[2]; - struct { - struct timeval tv; - int pad[2]; - } tm_in = { - .tv = { .tv_sec = 0xc0de1, .tv_usec = 0xc0de2 }, - .pad = { 0xdeadbeef, 0xbadc0ded } - }, tm = tm_in; + long rc = syscall(TEST_SYSCALL_NR, + F8ILL_KULONG_MASK | nfds, rs, ws, es, tv); + errstr = sprintrc(rc); + return rc; +} +#else + ; +#endif + +#define XSELECT(expected_, ...) \ + do { \ + long rc = xselect(__VA_ARGS__); \ + if (rc != (expected_)) \ + perror_msg_and_fail(TEST_SYSCALL_STR \ + ": expected %d" \ + ", returned %ld", \ + (expected_), rc); \ + } while (0) \ +/* End of XSELECT definition. */ + +int +main(void) +{ +#ifdef PATH_TRACING_FD + skip_if_unavailable("/proc/self/fd/"); +#endif + for (int i = 3; i < FD_SETSIZE; ++i) { +#ifdef PATH_TRACING_FD + if (i == PATH_TRACING_FD) + continue; +#endif + (void) close(i); + } + + int fds[2]; if (pipe(fds)) perror_msg_and_fail("pipe"); + static const int smallset_size = sizeof(kernel_ulong_t) * 8; + const int nfds = fds[1] + 1; + if (nfds > smallset_size) + error_msg_and_fail("nfds[%d] > smallset_size[%d]\n", + nfds, smallset_size); + + struct timeval tv_in = { 0, 123 }; + struct timeval *const tv = tail_memdup(&tv_in, sizeof(tv_in)); + const uintptr_t a_tv = (uintptr_t) tv; + + TAIL_ALLOC_OBJECT_VAR_PTR(kernel_ulong_t, l_rs); + fd_set *const rs = (void *) l_rs; + const uintptr_t a_rs = (uintptr_t) rs; + + TAIL_ALLOC_OBJECT_VAR_PTR(kernel_ulong_t, l_ws); + fd_set *const ws = (void *) l_ws; + const uintptr_t a_ws = (uintptr_t) ws; + + TAIL_ALLOC_OBJECT_VAR_PTR(kernel_ulong_t, l_es); + fd_set *const es = (void *) l_es; + const uintptr_t a_es = (uintptr_t) es; + + long rc; + /* - * Start with a nice simple select. + * An equivalent of nanosleep. */ - FD_ZERO(set); - FD_SET(fds[0], set); - FD_SET(fds[1], set); - int rc = syscall(TEST_SYSCALL_NR, fds[1] + 1, set, set, set, NULL); - if (rc < 0) - perror_msg_and_skip(TEST_SYSCALL_STR); - assert(rc == 1); - printf("%s(%d, [%d %d], [%d %d], [%d %d], NULL) = 1 ()\n", - TEST_SYSCALL_STR, fds[1] + 1, fds[0], fds[1], - fds[0], fds[1], fds[0], fds[1]); + if (xselect(0, 0, 0, 0, a_tv)) { + if (errno == ENOSYS) + perror_msg_and_skip(TEST_SYSCALL_STR); + else + perror_msg_and_fail(TEST_SYSCALL_STR); + } +#ifndef PATH_TRACING_FD + printf("%s(0, NULL, NULL, NULL, {tv_sec=%lld, tv_usec=%llu})" + " = 0 (Timeout)\n", + TEST_SYSCALL_STR, (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec)); +#endif + + /* EFAULT on tv argument */ + XSELECT(-1, 0, 0, 0, 0, a_tv + 1); +#ifndef PATH_TRACING_FD + printf("%s(0, NULL, NULL, NULL, %#lx) = %s\n", + TEST_SYSCALL_STR, (unsigned long) a_tv + 1, errstr); +#endif + + /* + * Start with a nice simple select with the same set. + */ + for (int i = nfds; i <= smallset_size; ++i) { + *l_rs = (1UL << fds[0]) | (1UL << fds[1]); + XSELECT(1, i, a_rs, a_rs, a_rs, 0); +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [%d %d], [%d %d], NULL) = 1 ()\n", + TEST_SYSCALL_STR, i, fds[0], fds[1], + fds[0], fds[1], fds[0], fds[1]); +#else + *l_rs = (1UL << fds[0]) | (1UL << fds[1]) | + (1UL << PATH_TRACING_FD); + XSELECT(i > PATH_TRACING_FD ? 3 : 1, i, a_rs, a_rs, a_rs, 0); + if (i > PATH_TRACING_FD) { + printf("%s(%d, [%d %d %d], [%d %d %d], [%d %d %d]" + ", NULL) = 3 ()\n", + TEST_SYSCALL_STR, i, + fds[0], fds[1], PATH_TRACING_FD, + fds[0], fds[1], PATH_TRACING_FD, + fds[0], fds[1], PATH_TRACING_FD); + } +#endif + } + + /* + * Odd timeout. + */ + *l_rs = (1UL << fds[0]) | (1UL << fds[1]); + tv_in.tv_sec = 0xdeadbeefU; + tv_in.tv_usec = 0xfacefeedU; + memcpy(tv, &tv_in, sizeof(tv_in)); + rc = xselect(nfds, a_rs, a_rs, a_rs, a_tv); + if (rc < 0) { +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [%d %d], [%d %d]" + ", {tv_sec=%lld, tv_usec=%llu}) = %s\n", + TEST_SYSCALL_STR, nfds, fds[0], fds[1], + fds[0], fds[1], fds[0], fds[1], + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + errstr); +#endif /* !PATH_TRACING_FD */ + } else { +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [%d %d], [%d %d]" + ", {tv_sec=%lld, tv_usec=%llu}) = %ld" + " (left {tv_sec=%lld, tv_usec=%llu})\n", + TEST_SYSCALL_STR, nfds, fds[0], fds[1], + fds[0], fds[1], fds[0], fds[1], + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + rc, (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); +#endif /* !PATH_TRACING_FD */ + } + + /* + * Very odd timeout. + */ + *l_rs = (1UL << fds[0]) | (1UL << fds[1]); + tv_in.tv_sec = (time_t) 0xcafef00ddeadbeefLL; + tv_in.tv_usec = (suseconds_t) 0xbadc0dedfacefeedLL; + memcpy(tv, &tv_in, sizeof(tv_in)); + rc = xselect(nfds, a_rs, a_rs, a_rs, a_tv); + if (rc < 0) { +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [%d %d], [%d %d]" + ", {tv_sec=%lld, tv_usec=%llu}) = %s\n", + TEST_SYSCALL_STR, nfds, fds[0], fds[1], + fds[0], fds[1], fds[0], fds[1], + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + errstr); +#endif /* PATH_TRACING_FD */ + } else { +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [%d %d], [%d %d]" + ", {tv_sec=%lld, tv_usec=%llu}) = %ld" + " (left {tv_sec=%lld, tv_usec=%llu})\n", + TEST_SYSCALL_STR, nfds, fds[0], fds[1], + fds[0], fds[1], fds[0], fds[1], + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + rc, (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); +#endif /* PATH_TRACING_FD */ + } /* * Another simple one, with a timeout. */ - FD_SET(1, set); - FD_SET(2, set); - FD_SET(fds[0], set); - FD_SET(fds[1], set); - assert(syscall(TEST_SYSCALL_NR, fds[1] + 1, NULL, set, NULL, &tm.tv) == 3); - printf("%s(%d, NULL, [1 2 %d %d], NULL, {tv_sec=%lld, tv_usec=%lld})" - " = 3 (out [1 2 %d], left {tv_sec=%lld, tv_usec=%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], - (long long) tm.tv.tv_sec, (long long) tm.tv.tv_usec); + for (int i = nfds; i <= smallset_size; ++i) { + *l_rs = (1UL << fds[0]) | (1UL << fds[1]); + *l_ws = (1UL << 1) | (1UL << 2) | + (1UL << fds[0]) | (1UL << fds[1]); + *l_es = 0; + tv_in.tv_sec = 0xc0de1; + tv_in.tv_usec = 0xc0de2; + memcpy(tv, &tv_in, sizeof(tv_in)); + XSELECT(3, i, a_rs, a_ws, a_es, a_tv); +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [%d %d %d %d], []" + ", {tv_sec=%lld, tv_usec=%llu}) = 3 (out [1 2 %d]" + ", left {tv_sec=%lld, tv_usec=%llu})\n", + TEST_SYSCALL_STR, i, fds[0], fds[1], + 1, 2, fds[0], fds[1], + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + fds[1], + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); +#else + *l_rs = (1UL << fds[0]) | (1UL << fds[1]) | + (1UL << PATH_TRACING_FD); + *l_ws = (1UL << 1) | (1UL << 2) | + (1UL << fds[0]) | (1UL << fds[1]); + tv_in.tv_sec = 0xc0de1; + tv_in.tv_usec = 0xc0de2; + memcpy(tv, &tv_in, sizeof(tv_in)); + XSELECT(3 + (i > PATH_TRACING_FD), i, a_rs, a_ws, a_es, a_tv); + if (i > PATH_TRACING_FD) { + printf("%s(%d, [%d %d %d], [%d %d %d %d], []" + ", {tv_sec=%lld, tv_usec=%llu})" + " = 4 (in [%d], out [1 2 %d]" + ", left {tv_sec=%lld, tv_usec=%llu})\n", + TEST_SYSCALL_STR, i, + fds[0], fds[1], PATH_TRACING_FD, + 1, 2, fds[0], fds[1], + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + PATH_TRACING_FD, fds[1], + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); + } + + *l_rs = (1UL << fds[0]) | (1UL << fds[1]); + *l_ws = (1UL << 1) | (1UL << 2) | + (1UL << fds[0]) | (1UL << fds[1]) | + (1UL << PATH_TRACING_FD); + tv_in.tv_sec = 0xc0de1; + tv_in.tv_usec = 0xc0de2; + memcpy(tv, &tv_in, sizeof(tv_in)); + XSELECT(3 + (i > PATH_TRACING_FD), i, a_rs, a_ws, a_es, a_tv); + if (i > PATH_TRACING_FD) { + printf("%s(%d, [%d %d], [%d %d %d %d %d], []" + ", {tv_sec=%lld, tv_usec=%llu})" + " = 4 (out [1 2 %d %d]" + ", left {tv_sec=%lld, tv_usec=%llu})\n", + TEST_SYSCALL_STR, i, + fds[0], fds[1], + 1, 2, fds[0], fds[1], PATH_TRACING_FD, + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + fds[1], PATH_TRACING_FD, + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); + } + + *l_rs = (1UL << fds[0]) | (1UL << fds[1]); + *l_ws = (1UL << 1) | (1UL << 2) | + (1UL << fds[0]) | (1UL << fds[1]); + *l_es = (1UL << PATH_TRACING_FD); + tv_in.tv_sec = 0xc0de1; + tv_in.tv_usec = 0xc0de2; + memcpy(tv, &tv_in, sizeof(tv_in)); + XSELECT(3, i, a_rs, a_ws, a_es, a_tv); + if (i > PATH_TRACING_FD) { + printf("%s(%d, [%d %d], [%d %d %d %d], [%d]" + ", {tv_sec=%lld, tv_usec=%llu}) = 3 (out [1 2 %d]" + ", left {tv_sec=%lld, tv_usec=%llu})\n", + TEST_SYSCALL_STR, i, + fds[0], fds[1], + 1, 2, fds[0], fds[1], PATH_TRACING_FD, + (long long) tv_in.tv_sec, + zero_extend_signed_to_ull(tv_in.tv_usec), + fds[1], + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); + } + +#endif /* PATH_TRACING_FD */ + } /* * Now the crash case that trinity found, negative nfds * but with a pointer to a large chunk of valid memory. */ - FD_ZERO(set); - FD_SET(fds[1],set); - assert(syscall(TEST_SYSCALL_NR, -1, NULL, set, NULL, NULL) == -1); - printf("%s(-1, NULL, %p, NULL, NULL) = -1 EINVAL (%m)\n", - TEST_SYSCALL_STR, set); + static fd_set set[0x1000000 / sizeof(fd_set)]; + FD_SET(fds[1], set); + XSELECT(-1, -1U, 0, (uintptr_t) set, 0, 0); +#ifndef PATH_TRACING_FD + printf("%s(-1, NULL, %p, NULL, NULL) = %s\n", + TEST_SYSCALL_STR, set, errstr); +#endif + + /* + * Big sets, nfds exceeds FD_SETSIZE limit. + */ + const size_t big_size = sizeof(fd_set) + sizeof(long); + fd_set *const big_rs = tail_alloc(big_size); + const uintptr_t a_big_rs = (uintptr_t) big_rs; + + fd_set *const big_ws = tail_alloc(big_size); + const uintptr_t a_big_ws = (uintptr_t) big_ws; + + for (unsigned int i = FD_SETSIZE; i <= big_size * 8; ++i) { + memset(big_rs, 0, big_size); + memset(big_ws, 0, big_size); + FD_SET(fds[0], big_rs); + tv->tv_sec = 0; + tv->tv_usec = 10 + (i - FD_SETSIZE); + XSELECT(0, i, a_big_rs, a_big_ws, 0, a_tv); +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d], [], NULL, {tv_sec=0, tv_usec=%d})" + " = 0 (Timeout)\n", + TEST_SYSCALL_STR, i, fds[0], 10 + (i - FD_SETSIZE)); +#else + FD_SET(fds[0], big_rs); + FD_SET(PATH_TRACING_FD, big_rs); + tv->tv_sec = 0; + tv->tv_usec = 10 + (i - FD_SETSIZE); + XSELECT(1, i, a_big_rs, a_big_ws, 0, a_tv); + printf("%s(%d, [%d %d], [], NULL, {tv_sec=0, tv_usec=%d})" + " = 1 (in [%d], left {tv_sec=0, tv_usec=%llu})\n", + TEST_SYSCALL_STR, i, fds[0], PATH_TRACING_FD, + 10 + (i - FD_SETSIZE), PATH_TRACING_FD, + zero_extend_signed_to_ull(tv->tv_usec)); +#endif /* PATH_TRACING_FD */ + } + + /* + * Huge sets, nfds equals to INT_MAX. + */ + FD_SET(fds[0], set); + FD_SET(fds[1], set); + tv->tv_sec = 0; + tv->tv_usec = 123; + XSELECT(0, INT_MAX, (uintptr_t) set, (uintptr_t) &set[1], + (uintptr_t) &set[2], a_tv); +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [], [], {tv_sec=0, tv_usec=123})" + " = 0 (Timeout)\n", + TEST_SYSCALL_STR, INT_MAX, fds[0], fds[1]); +#else + FD_SET(fds[0], set); + FD_SET(fds[1], set); + FD_SET(PATH_TRACING_FD, set); + tv->tv_sec = 0; + tv->tv_usec = 123; + XSELECT(1, INT_MAX, (uintptr_t) set, (uintptr_t) &set[1], + (uintptr_t) &set[2], a_tv); + printf("%s(%d, [%d %d %d], [], [], {tv_sec=0, tv_usec=123})" + " = 1 (in [%d], left {tv_sec=0, tv_usec=%llu})\n", + TEST_SYSCALL_STR, INT_MAX, fds[0], fds[1], PATH_TRACING_FD, + PATH_TRACING_FD, zero_extend_signed_to_ull(tv->tv_usec)); +#endif /* PATH_TRACING_FD */ + + /* + * Small sets, nfds exceeds FD_SETSIZE limit. + * The kernel seems to be fine with it but strace cannot follow. + */ + *l_rs = (1UL << fds[0]) | (1UL << fds[1]) +#ifdef PATH_TRACING_FD + | (1UL << PATH_TRACING_FD) +#endif + ; + *l_ws = (1UL << fds[0]); + *l_es = (1UL << fds[0]) | (1UL << fds[1]) +#ifdef PATH_TRACING_FD + | (1UL << PATH_TRACING_FD) +#endif + ; + tv->tv_sec = 0; + tv->tv_usec = 123; + rc = xselect(FD_SETSIZE + 1, a_rs, a_ws, a_es, a_tv); + if (rc < 0) { +#ifndef PATH_TRACING_FD + printf("%s(%d, %p, %p, %p, {tv_sec=0, tv_usec=123}) = %s\n", + TEST_SYSCALL_STR, FD_SETSIZE + 1, rs, ws, es, errstr); +#endif + } else { +#ifndef PATH_TRACING_FD + printf("%s(%d, %p, %p, %p, {tv_sec=0, tv_usec=123})" + " = 0 (Timeout)\n", + TEST_SYSCALL_STR, FD_SETSIZE + 1, rs, ws, es); +#endif + } + + /* + * Small sets, one of allocated descriptors exceeds smallset_size. + */ + if (dup2(fds[1], smallset_size) != smallset_size) + perror_msg_and_fail("dup2"); +#ifdef PATH_TRACING_FD + FD_SET(PATH_TRACING_FD, rs); + FD_SET(PATH_TRACING_FD, ws); + FD_SET(PATH_TRACING_FD, es); +#endif + XSELECT(-1, smallset_size + 1, a_rs, a_ws, a_es, 0); +#ifndef PATH_TRACING_FD + printf("%s(%d, %p, %p, %p, NULL) = %s\n", + TEST_SYSCALL_STR, smallset_size + 1, rs, ws, es, errstr); +#endif /* - * Another variant, with nfds exceeding FD_SETSIZE limit. + * Small and big sets, + * one of allocated descriptors exceeds smallset_size. */ - FD_ZERO(set); - FD_SET(fds[0],set); - tm.tv.tv_sec = 0; - tm.tv.tv_usec = 123; - assert(syscall(TEST_SYSCALL_NR, FD_SETSIZE + 1, set, set + 1, NULL, &tm.tv) == 0); - printf("%s(%d, [%d], [], NULL, {tv_sec=0, tv_usec=123}) = 0 (Timeout)\n", - TEST_SYSCALL_STR, FD_SETSIZE + 1, fds[0]); + memset(big_rs, 0, big_size); + FD_SET(fds[0], big_rs); + FD_SET(smallset_size, big_rs); + memset(big_ws, 0, big_size); + FD_SET(fds[1], big_ws); + FD_SET(smallset_size, big_ws); + XSELECT(-1, smallset_size + 1, a_big_rs, a_big_ws, a_es, 0); +#ifndef PATH_TRACING_FD + printf("%s(%d, [%d %d], [%d %d], %p, NULL) = %s\n", + TEST_SYSCALL_STR, smallset_size + 1, + fds[0], smallset_size, + fds[1], smallset_size, + es, errstr); +#endif /* !PATH_TRACING_FD */ + XSELECT(-1, smallset_size + 1, a_es, a_big_ws, a_big_rs, 0); +#ifndef PATH_TRACING_FD + printf("%s(%d, %p, [%d %d], [%d %d], NULL) = %s\n", + TEST_SYSCALL_STR, smallset_size + 1, + es, + fds[1], smallset_size, + fds[0], smallset_size, + errstr); +#endif /* !PATH_TRACING_FD */ puts("+++ exited with 0 +++"); return 0; diff --git a/tests/xstatfs.c b/tests/xstatfs.c index 26c43dee..a7f7dd2d 100644 --- a/tests/xstatfs.c +++ b/tests/xstatfs.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #define SYSCALL_INVOKE(file, desc, ptr, size) \ diff --git a/tests/xstatfs64.c b/tests/xstatfs64.c index 8f50de29..5a3dcb47 100644 --- a/tests/xstatfs64.c +++ b/tests/xstatfs64.c @@ -1,28 +1,8 @@ /* - * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #define SYSCALL_INVOKE(file, desc, ptr, size) \ diff --git a/tests/xstatfsx.c b/tests/xstatfsx.c index d8288f1f..1b91e844 100644 --- a/tests/xstatfsx.c +++ b/tests/xstatfsx.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #include @@ -37,12 +18,17 @@ #include "xlat/statfs_flags.h" #define PRINT_NUM(arg) \ - if (sizeof(b->arg) == sizeof(int)) \ - printf(", %s=%u", #arg, (unsigned int) b->arg); \ - else if (sizeof(b->arg) == sizeof(long)) \ - printf(", %s=%lu", #arg, (unsigned long) b->arg); \ - else \ - printf(", %s=%llu", #arg, (unsigned long long) b->arg) + do { \ + if (sizeof(b->arg) == sizeof(int)) \ + printf(", %s=%u", #arg, \ + (unsigned int) b->arg); \ + else if (sizeof(b->arg) == sizeof(long)) \ + printf(", %s=%lu", #arg, \ + (unsigned long) b->arg); \ + else \ + printf(", %s=%llu", #arg, \ + (unsigned long long) b->arg); \ + } while (0) static void print_statfs_type(const char *const prefix, const unsigned int magic) @@ -62,9 +48,9 @@ print_statfs(const char *const sample, const char *magic_str) { int fd = open(sample, O_RDONLY); if (fd < 0) - perror_msg_and_fail("open: %s", sample); + perror_msg_and_skip("open: %s", sample); - STRUCT_STATFS *const b = tail_alloc(sizeof(*b)); + TAIL_ALLOC_OBJECT_CONST_PTR(STRUCT_STATFS, b); long rc = SYSCALL_INVOKE(sample, fd, b, sizeof(*b)); if (rc) perror_msg_and_skip(SYSCALL_NAME); diff --git a/tests/xstatx.c b/tests/xstatx.c index 0d5fca87..0d223bdc 100644 --- a/tests/xstatx.c +++ b/tests/xstatx.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2015-2016 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: GPL-2.0-or-later */ #if defined HAVE_FTRUNCATE && defined HAVE_FUTIMENS @@ -47,26 +28,8 @@ # include # include -static void -print_time(const time_t t) -{ - if (!t) { - printf("0"); - return; - } - - struct tm *p = localtime(&t); - - if (p) { - char buf[256]; - - strftime(buf, sizeof(buf), "%FT%T%z", p); - - printf("%s", buf); - } else { - printf("%llu", zero_extend_signed_to_ull(t)); - } -} +# include "print_fields.h" +# include "statx.h" # ifndef STRUCT_STAT # define STRUCT_STAT struct stat @@ -81,10 +44,14 @@ typedef off_t libc_off_t; # define stat libc_stat # define stat64 libc_stat64 +# define statx libc_statx +# define statx_timestamp libc_statx_timestamp # include # include -# undef stat +# undef statx_timestamp +# undef statx # undef stat64 +# undef stat # undef st_atime # undef st_mtime @@ -130,6 +97,11 @@ typedef off_t libc_off_t; # define OLD_STAT 0 # endif +# ifndef IS_STATX +# define IS_STATX 0 +# endif + +# if !XLAT_RAW /* Fixes -Wunused warning */ static void print_ftype(const unsigned int mode) { @@ -150,59 +122,168 @@ print_perms(const unsigned int mode) { printf("%#o", mode & ~S_IFMT); } +# endif + +static void +print_st_mode(const unsigned int mode) +{ +# if XLAT_RAW + printf("%#o", mode); +# elif XLAT_VERBOSE + printf("%#o /* ", mode); + print_ftype(mode); + printf("|"); + print_perms(mode); + printf(" */"); +# else + print_ftype(mode); + printf("|"); + print_perms(mode); +# endif +} + +# if !IS_STATX + +static const char * +sprint_makedev(const unsigned long long val) +{ + static char devid[256]; + int ret; + +# if XLAT_RAW + ret = snprintf(devid, sizeof(devid), + "%#llx", val); +# elif XLAT_VERBOSE + ret = snprintf(devid, sizeof(devid), + "%#llx /* makedev(%#x, %#x) */", + val, major(val), minor(val)); +# else /* XLAT_ABBREV */ + ret = snprintf(devid, sizeof(devid), + "makedev(%#x, %#x)", + major(val), minor(val)); +# endif + if (ret < 0) + perror_msg_and_fail("sprint_makedev(%llx)", val); + if ((unsigned) ret >= sizeof(devid)) + error_msg_and_fail("sprint_makedev(%llx): buffer " + "overflow", val); + return devid; +} + static void print_stat(const STRUCT_STAT *st) { - printf("{st_dev=makedev(%u, %u)", - (unsigned int) major(zero_extend_signed_to_ull(st->st_dev)), - (unsigned int) minor(zero_extend_signed_to_ull(st->st_dev))); + unsigned long long dev, rdev; + + dev = zero_extend_signed_to_ull(st->st_dev); + rdev = zero_extend_signed_to_ull(st->st_rdev); + printf("{st_dev=%s", sprint_makedev(dev)); printf(", st_ino=%llu", zero_extend_signed_to_ull(st->st_ino)); printf(", st_mode="); - print_ftype(st->st_mode); - printf("|"); - print_perms(st->st_mode); + print_st_mode(st->st_mode); printf(", st_nlink=%llu", zero_extend_signed_to_ull(st->st_nlink)); printf(", st_uid=%llu", zero_extend_signed_to_ull(st->st_uid)); printf(", st_gid=%llu", zero_extend_signed_to_ull(st->st_gid)); -# if OLD_STAT +# if OLD_STAT printf(", st_blksize=0, st_blocks=0"); -# else /* !OLD_STAT */ +# else /* !OLD_STAT */ printf(", st_blksize=%llu", zero_extend_signed_to_ull(st->st_blksize)); printf(", st_blocks=%llu", zero_extend_signed_to_ull(st->st_blocks)); -# endif /* OLD_STAT */ +# endif /* OLD_STAT */ switch (st->st_mode & S_IFMT) { case S_IFCHR: case S_IFBLK: - printf(", st_rdev=makedev(%u, %u)", - (unsigned int) major(zero_extend_signed_to_ull(st->st_rdev)), - (unsigned int) minor(zero_extend_signed_to_ull(st->st_rdev))); + printf(", st_rdev=%s", sprint_makedev(rdev)); break; default: printf(", st_size=%llu", zero_extend_signed_to_ull(st->st_size)); } - printf(", st_atime="); - print_time(sign_extend_unsigned_to_ll(st->st_atime)); -# if defined(HAVE_STRUCT_STAT_ST_MTIME_NSEC) && !OLD_STAT - if (st->st_atime_nsec) - printf(".%09llu", zero_extend_signed_to_ull(st->st_atime_nsec)); -# endif - printf(", st_mtime="); - print_time(sign_extend_unsigned_to_ll(st->st_mtime)); -# if defined(HAVE_STRUCT_STAT_ST_MTIME_NSEC) && !OLD_STAT - if (st->st_mtime_nsec) - printf(".%09llu", zero_extend_signed_to_ull(st->st_mtime_nsec)); -# endif - printf(", st_ctime="); - print_time(sign_extend_unsigned_to_ll(st->st_ctime)); -# if defined(HAVE_STRUCT_STAT_ST_MTIME_NSEC) && !OLD_STAT - if (st->st_ctime_nsec) - printf(".%09llu", zero_extend_signed_to_ull(st->st_ctime_nsec)); -# endif +# if defined(HAVE_STRUCT_STAT_ST_MTIME_NSEC) && !OLD_STAT +# define TIME_NSEC(val) zero_extend_signed_to_ull(val) +# define HAVE_NSEC 1 +# else +# define TIME_NSEC(val) 0ULL +# define HAVE_NSEC 0 +# endif + +# define PRINT_ST_TIME(field) \ + do { \ + printf(", st_" #field "=%lld", \ + sign_extend_unsigned_to_ll(st->st_ ## field)); \ + print_time_t_nsec(sign_extend_unsigned_to_ll(st->st_ ## field), \ + TIME_NSEC(st->st_ ## field ## _nsec), 1); \ + if (HAVE_NSEC) \ + printf(", st_" #field "_nsec=%llu", \ + TIME_NSEC(st->st_ ## field ## _nsec)); \ + } while (0) + + PRINT_ST_TIME(atime); + PRINT_ST_TIME(mtime); + PRINT_ST_TIME(ctime); printf("}"); } +# else /* !IS_STATX */ + +static void +print_stat(const STRUCT_STAT *st) +{ +# define PRINT_FIELD_U32_UID(field) \ + do { \ + if (st->field == (uint32_t) -1) \ + printf(", %s=-1", #field); \ + else \ + printf(", %s=%llu", #field, \ + (unsigned long long) st->field); \ + } while (0) + +# define PRINT_FIELD_TIME(field) \ + do { \ + printf(", %s={tv_sec=%lld, tv_nsec=%u}", \ + #field, (long long) st->field.tv_sec, \ + (unsigned) st->field.tv_nsec); \ + print_time_t_nsec(st->field.tv_sec, \ + zero_extend_signed_to_ull(st->field.tv_nsec), \ + 1); \ + } while (0) + + printf("{stx_mask="); + printflags(statx_masks, st->stx_mask, "STATX_???"); + + PRINT_FIELD_U(", ", *st, stx_blksize); + + printf(", stx_attributes="); + printflags(statx_attrs, st->stx_attributes, "STATX_ATTR_???"); + + PRINT_FIELD_U(", ", *st, stx_nlink); + PRINT_FIELD_U32_UID(stx_uid); + PRINT_FIELD_U32_UID(stx_gid); + + printf(", stx_mode="); + print_st_mode(st->stx_mode); + + PRINT_FIELD_U(", ", *st, stx_ino); + PRINT_FIELD_U(", ", *st, stx_size); + PRINT_FIELD_U(", ", *st, stx_blocks); + + printf(", stx_attributes_mask="); + printflags(statx_attrs, st->stx_attributes_mask, "STATX_ATTR_???"); + + PRINT_FIELD_TIME(stx_atime); + PRINT_FIELD_TIME(stx_btime); + PRINT_FIELD_TIME(stx_ctime); + PRINT_FIELD_TIME(stx_mtime); + PRINT_FIELD_U(", ", *st, stx_rdev_major); + PRINT_FIELD_U(", ", *st, stx_rdev_minor); + PRINT_FIELD_U(", ", *st, stx_dev_major); + PRINT_FIELD_U(", ", *st, stx_dev_minor); + printf("}"); +} + +# endif /* !IS_STATX */ + static int create_sample(const char *fname, const libc_off_t size) { @@ -229,19 +310,19 @@ create_sample(const char *fname, const libc_off_t size) int main(void) { -# if !IS_FSTAT +# if IS_FSTAT + skip_if_unavailable("/proc/self/fd/"); +# else static const char full[] = "/dev/full"; # endif - static const char sample[] = TEST_SYSCALL_STR ".sample"; - STRUCT_STAT st[2]; + static const char sample[] = "stat.sample"; + TAIL_ALLOC_OBJECT_CONST_PTR(STRUCT_STAT, st); int rc; rc = create_sample(sample, SAMPLE_SIZE); - if (rc) { - (void) unlink(sample); + if (rc) return rc; - } # if TEST_BOGUS_STRUCT_STAT STRUCT_STAT *st_cut = tail_alloc(sizeof(long) * 4); @@ -262,46 +343,71 @@ main(void) # endif if ((rc = TEST_SYSCALL_INVOKE(sample, st))) { -# if OLD_STAT - if (errno != EOVERFLOW) -# endif - { + if (errno != EOVERFLOW) { + rc = (errno == ENOSYS) ? 77 : 1; perror(TEST_SYSCALL_STR); - (void) unlink(sample); - return 77; + return rc; } } - (void) unlink(sample); + +# if IS_STATX +# define ST_SIZE_FIELD stx_size +# else +# define ST_SIZE_FIELD st_size +# endif if (!rc && zero_extend_signed_to_ull(SAMPLE_SIZE) != - zero_extend_signed_to_ull(st[0].st_size)) { + zero_extend_signed_to_ull(st->ST_SIZE_FIELD)) { fprintf(stderr, "Size mismatch: " "requested size(%llu) != st_size(%llu)\n", zero_extend_signed_to_ull(SAMPLE_SIZE), - zero_extend_signed_to_ull(st[0].st_size)); + zero_extend_signed_to_ull(st->ST_SIZE_FIELD)); fprintf(stderr, "The most likely reason for this is incorrect" " definition of %s.\n" "Here is some diagnostics that might help:\n", STRUCT_STAT_STR); -#define LOG_STAT_OFFSETOF_SIZEOF(object, member) \ +# define LOG_STAT_OFFSETOF_SIZEOF(object, member) \ fprintf(stderr, "offsetof(%s, %s) = %zu" \ ", sizeof(%s) = %zu\n", \ STRUCT_STAT_STR, #member, \ offsetof(STRUCT_STAT, member), \ #member, sizeof((object).member)) - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_dev); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_ino); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_mode); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_nlink); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_uid); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_gid); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_rdev); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_size); -# if !OLD_STAT - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_blksize); - LOG_STAT_OFFSETOF_SIZEOF(st[0], st_blocks); -# endif /* !OLD_STAT */ +# if IS_STATX + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_mask); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_blksize); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_attributes); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_nlink); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_uid); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_gid); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_mode); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_ino); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_size); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_blocks); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_attributes_mask); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_atime); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_btime); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_ctime); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_mtime); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_rdev_major); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_rdev_minor); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_dev_major); + LOG_STAT_OFFSETOF_SIZEOF(*st, stx_dev_minor); +# else + LOG_STAT_OFFSETOF_SIZEOF(*st, st_dev); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_ino); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_mode); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_nlink); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_uid); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_gid); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_rdev); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_size); +# if !OLD_STAT + LOG_STAT_OFFSETOF_SIZEOF(*st, st_blksize); + LOG_STAT_OFFSETOF_SIZEOF(*st, st_blocks); +# endif /* !OLD_STAT */ + +# endif /* IS_STATX */ return 1; } @@ -313,6 +419,69 @@ main(void) print_stat(st); PRINT_SYSCALL_FOOTER(rc); +# if IS_STATX + +# define INVOKE() \ + do { \ + rc = TEST_SYSCALL_INVOKE(sample, st); \ + PRINT_SYSCALL_HEADER(sample); \ + if (rc) \ + printf("%p", st); \ + else \ + print_stat(st); \ + PRINT_SYSCALL_FOOTER(rc); \ + } while (0) + +# define SET_FLAGS_INVOKE(flags, flags_str) \ + do { \ + TEST_SYSCALL_STATX_FLAGS = flags; \ + TEST_SYSCALL_STATX_FLAGS_STR = flags_str; \ + INVOKE(); \ + } while (0) + +# define SET_MASK_INVOKE(mask, mask_str) \ + do { \ + TEST_SYSCALL_STATX_MASK = mask; \ + TEST_SYSCALL_STATX_MASK_STR = mask_str; \ + INVOKE(); \ + } while (0) + + unsigned old_flags = TEST_SYSCALL_STATX_FLAGS; + const char *old_flags_str = TEST_SYSCALL_STATX_FLAGS_STR; + unsigned old_mask = TEST_SYSCALL_STATX_MASK; + const char *old_mask_str = TEST_SYSCALL_STATX_MASK_STR; + + SET_FLAGS_INVOKE(AT_SYMLINK_FOLLOW | 0xffff0000U, + "AT_STATX_SYNC_AS_STAT|AT_SYMLINK_FOLLOW|0xffff0000"); + + SET_FLAGS_INVOKE(AT_STATX_SYNC_TYPE, + "AT_STATX_FORCE_SYNC|AT_STATX_DONT_SYNC"); + + SET_FLAGS_INVOKE(0xffffff, + "AT_STATX_FORCE_SYNC|AT_STATX_DONT_SYNC|AT_SYMLINK_NOFOLLOW|" + "AT_REMOVEDIR|AT_SYMLINK_FOLLOW|AT_NO_AUTOMOUNT|AT_EMPTY_PATH|" + "0xff80ff"); + + /* We're done playing with flags. */ + TEST_SYSCALL_STATX_FLAGS = old_flags; + TEST_SYSCALL_STATX_FLAGS_STR = old_flags_str; + + SET_MASK_INVOKE(0, "0"); + SET_MASK_INVOKE(0xfffff000U, "0xfffff000 /* STATX_??? */"); + + SET_MASK_INVOKE(0xfffffffbU, + "STATX_TYPE|STATX_MODE|STATX_UID|STATX_GID|STATX_ATIME|" + "STATX_MTIME|STATX_CTIME|STATX_INO|STATX_SIZE|STATX_BLOCKS|" + "STATX_BTIME|0xfffff000"); + + SET_MASK_INVOKE(STATX_UID, "STATX_UID"); + + /* ...and with mask. */ + TEST_SYSCALL_STATX_MASK = old_mask; + TEST_SYSCALL_STATX_MASK_STR = old_mask_str; + +# endif /* IS_STATX */ + puts("+++ exited with 0 +++"); return 0; } diff --git a/tests/xutimes.c b/tests/xutimes.c new file mode 100644 index 00000000..7ad123cc --- /dev/null +++ b/tests/xutimes.c @@ -0,0 +1,129 @@ +/* + * Check decoding of utimes/osf_utimes syscall. + * + * Copyright (c) 2015-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#ifndef TEST_SYSCALL_NR +# error TEST_SYSCALL_NR must be defined +#endif + +#ifndef TEST_SYSCALL_STR +# error TEST_SYSCALL_STR must be defined +#endif + +#ifndef TEST_STRUCT +# error TEST_STRUCT must be defined +#endif + +#include +#include +#include +#include + +static void +print_tv(const TEST_STRUCT *const tv) +{ + printf("{tv_sec=%lld, tv_usec=%llu}", + (long long) tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec)); + print_time_t_usec(tv->tv_sec, + zero_extend_signed_to_ull(tv->tv_usec), 1); +} + +static const char *errstr; + +static long +k_utimes(const kernel_ulong_t pathname, const kernel_ulong_t times) +{ + long rc = syscall(TEST_SYSCALL_NR, pathname, times); + errstr = sprintrc(rc); + return rc; +} + +int +main(void) +{ + static const char proto_fname[] = TEST_SYSCALL_STR "_sample"; + static const char qname[] = "\"" TEST_SYSCALL_STR "_sample\""; + + char *const fname = tail_memdup(proto_fname, sizeof(proto_fname)); + const kernel_ulong_t kfname = (uintptr_t) fname; + TEST_STRUCT *const tv = tail_alloc(sizeof(*tv) * 2); + + /* pathname */ + k_utimes(0, 0); + printf("%s(NULL, NULL) = %s\n", TEST_SYSCALL_STR, errstr); + + k_utimes(kfname + sizeof(proto_fname) - 1, 0); + printf("%s(\"\", NULL) = %s\n", TEST_SYSCALL_STR, errstr); + + k_utimes(kfname, 0); + printf("%s(%s, NULL) = %s\n", TEST_SYSCALL_STR, qname, errstr); + + fname[sizeof(proto_fname) - 1] = '+'; + k_utimes(kfname, 0); + fname[sizeof(proto_fname) - 1] = '\0'; + printf("%s(%p, NULL) = %s\n", TEST_SYSCALL_STR, fname, errstr); + + if (F8ILL_KULONG_SUPPORTED) { + k_utimes(f8ill_ptr_to_kulong(fname), 0); + printf("%s(%#jx, NULL) = %s\n", TEST_SYSCALL_STR, + (uintmax_t) f8ill_ptr_to_kulong(fname), errstr); + } + + /* times */ + k_utimes(kfname, (uintptr_t) (tv + 1)); + printf("%s(%s, %p) = %s\n", TEST_SYSCALL_STR, + qname, tv + 1, errstr); + + k_utimes(kfname, (uintptr_t) (tv + 2)); + printf("%s(%s, %p) = %s\n", TEST_SYSCALL_STR, + qname, tv + 2, errstr); + + tv[0].tv_sec = 0xdeadbeefU; + tv[0].tv_usec = 0xfacefeedU; + tv[1].tv_sec = (time_t) 0xcafef00ddeadbeefLL; + tv[1].tv_usec = (suseconds_t) 0xbadc0dedfacefeedLL; + + k_utimes(kfname, (uintptr_t) tv); + printf("%s(%s, [", TEST_SYSCALL_STR, qname); + print_tv(&tv[0]); + printf(", "); + print_tv(&tv[1]); + printf("]) = %s\n", errstr); + + tv[0].tv_sec = 1492358607; + tv[0].tv_usec = 1000000; + tv[1].tv_sec = 1492356078; + tv[1].tv_usec = 1000001; + + k_utimes(kfname, (uintptr_t) tv); + printf("%s(%s, [", TEST_SYSCALL_STR, qname); + print_tv(&tv[0]); + printf(", "); + print_tv(&tv[1]); + printf("]) = %s\n", errstr); + + tv[0].tv_usec = 345678; + tv[1].tv_usec = 456789; + + k_utimes(kfname, (uintptr_t) tv); + printf("%s(%s, [", TEST_SYSCALL_STR, qname); + print_tv(&tv[0]); + printf(", "); + print_tv(&tv[1]); + printf("]) = %s\n", errstr); + + if (F8ILL_KULONG_SUPPORTED) { + k_utimes(kfname, f8ill_ptr_to_kulong(tv)); + printf("%s(%s, %#jx) = %s\n", TEST_SYSCALL_STR, + qname, (uintmax_t) f8ill_ptr_to_kulong(tv), errstr); + } + + puts("+++ exited with 0 +++"); + return 0; +} diff --git a/tests/zeroargc.c b/tests/zeroargc.c new file mode 100644 index 00000000..672959c4 --- /dev/null +++ b/tests/zeroargc.c @@ -0,0 +1,23 @@ +/* + * Execute an executable with zero argc and specified anvironment. + * + * Copyright (c) 2017-2018 Dmitry V. Levin + * All rights reserved. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "tests.h" +#include +#include + +int +main(const int ac, char **const av) +{ + if (ac < 2) + error_msg_and_fail("missing operand"); + const char *const path = av[1]; + av[1] = 0; + execve(path, av + 1, av + 2); + perror_msg_and_fail("execve: %s", path); +} diff --git a/time.c b/time.c index 6c542f63..5b163c84 100644 --- a/time.c +++ b/time.c @@ -2,29 +2,10 @@ * Copyright (c) 1991, 1992 Paul Kranenburg * Copyright (c) 1993 Branko Lankester * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -86,10 +67,12 @@ SYS_FUNC(osf_settimeofday) } #endif -SYS_FUNC(nanosleep) +#if HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS +static int +do_nanosleep(struct tcb *const tcp, const print_obj_by_addr_fn print_ts) { if (entering(tcp)) { - print_timespec(tcp, tcp->u_arg[0]); + print_ts(tcp, tcp->u_arg[0]); tprints(", "); } else { @@ -101,7 +84,7 @@ SYS_FUNC(nanosleep) */ if (is_erestart(tcp)) { temporarily_clear_syserror(tcp); - print_timespec(tcp, tcp->u_arg[1]); + print_ts(tcp, tcp->u_arg[1]); restore_cleared_syserror(tcp); } else { printaddr(tcp->u_arg[1]); @@ -109,13 +92,29 @@ SYS_FUNC(nanosleep) } return 0; } +#endif /* HAVE_ARCH_TIME32_SYSCALLS || HAVE_ARCH_OLD_TIME64_SYSCALLS */ + +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(nanosleep_time32) +{ + return do_nanosleep(tcp, print_timespec32); +} +#endif + +#if HAVE_ARCH_OLD_TIME64_SYSCALLS +SYS_FUNC(nanosleep_time64) +{ + return do_nanosleep(tcp, print_timespec64); +} +#endif #include "xlat/itimer_which.h" SYS_FUNC(getitimer) { if (entering(tcp)) { - printxval(itimer_which, tcp->u_arg[0], "ITIMER_???"); + printxval_index(itimer_which, (unsigned int) tcp->u_arg[0], + "ITIMER_???"); tprints(", "); } else { print_itimerval(tcp, tcp->u_arg[1]); @@ -127,7 +126,8 @@ SYS_FUNC(getitimer) SYS_FUNC(osf_getitimer) { if (entering(tcp)) { - printxval(itimer_which, tcp->u_arg[0], "ITIMER_???"); + printxval_index(itimer_which, (unsigned int) tcp->u_arg[0], + "ITIMER_???"); tprints(", "); } else { print_itimerval32(tcp, tcp->u_arg[1]); @@ -139,7 +139,8 @@ SYS_FUNC(osf_getitimer) SYS_FUNC(setitimer) { if (entering(tcp)) { - printxval(itimer_which, tcp->u_arg[0], "ITIMER_???"); + printxval_index(itimer_which, (unsigned int) tcp->u_arg[0], + "ITIMER_???"); tprints(", "); print_itimerval(tcp, tcp->u_arg[1]); tprints(", "); @@ -153,7 +154,8 @@ SYS_FUNC(setitimer) SYS_FUNC(osf_setitimer) { if (entering(tcp)) { - printxval(itimer_which, tcp->u_arg[0], "ITIMER_???"); + printxval_index(itimer_which, (unsigned int) tcp->u_arg[0], + "ITIMER_???"); tprints(", "); print_itimerval32(tcp, tcp->u_arg[1]); tprints(", "); @@ -167,22 +169,37 @@ SYS_FUNC(osf_setitimer) #include "xlat/adjtimex_state.h" static int -do_adjtimex(struct tcb *const tcp, const kernel_ulong_t addr) +do_adjtimex(struct tcb *const tcp, const print_obj_by_addr_fn print_tx, + const kernel_ulong_t addr) { - if (print_timex(tcp, addr)) + if (print_tx(tcp, addr)) return 0; - tcp->auxstr = xlookup(adjtimex_state, (kernel_ulong_t) tcp->u_rval); - if (tcp->auxstr) - return RVAL_STR; + tcp->auxstr = xlat_idx(adjtimex_state, ARRAY_SIZE(adjtimex_state) - 1, + (kernel_ulong_t) tcp->u_rval); + return RVAL_STR; +} + +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(adjtimex32) +{ + if (exiting(tcp)) + return do_adjtimex(tcp, print_timex32, tcp->u_arg[0]); return 0; } +#endif -SYS_FUNC(adjtimex) +#if HAVE_ARCH_OLD_TIME64_SYSCALLS +SYS_FUNC(adjtimex64) { if (exiting(tcp)) - return do_adjtimex(tcp, tcp->u_arg[0]); +# ifndef SPARC64 + return do_adjtimex(tcp, print_timex64, tcp->u_arg[0]); +# else + return do_adjtimex(tcp, print_sparc64_timex, tcp->u_arg[0]); +# endif return 0; } +#endif #include "xlat/clockflags.h" #include "xlat/clocknames.h" @@ -194,50 +211,91 @@ printclockname(int clockid) # include "xlat/cpuclocknames.h" if (clockid < 0) { + if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_ABBREV) + tprintf("%d", clockid); + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_RAW) + return; + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) + tprints(" /* "); + if ((clockid & CLOCKFD_MASK) == CLOCKFD) tprintf("FD_TO_CLOCKID(%d)", CLOCKID_TO_FD(clockid)); else { - if(CPUCLOCK_PERTHREAD(clockid)) - tprintf("MAKE_THREAD_CPUCLOCK(%d,", CPUCLOCK_PID(clockid)); - else - tprintf("MAKE_PROCESS_CPUCLOCK(%d,", CPUCLOCK_PID(clockid)); - printxval(cpuclocknames, clockid & CLOCKFD_MASK, "CPUCLOCK_???"); + tprintf("%s(%d,", + CPUCLOCK_PERTHREAD(clockid) ? + "MAKE_THREAD_CPUCLOCK" : + "MAKE_PROCESS_CPUCLOCK", + CPUCLOCK_PID(clockid)); + printxval_index(cpuclocknames, + (unsigned int) clockid & CLOCKFD_MASK, + "CPUCLOCK_???"); tprints(")"); } - } - else + + if (xlat_verbose(xlat_verbosity) == XLAT_STYLE_VERBOSE) + tprints(" */"); + } else #endif - printxval(clocknames, clockid, "CLOCK_???"); + printxval_index(clocknames, clockid, "CLOCK_???"); } -SYS_FUNC(clock_settime) +static int +do_clock_settime(struct tcb *const tcp, const print_obj_by_addr_fn print_ts) { printclockname(tcp->u_arg[0]); tprints(", "); - print_timespec(tcp, tcp->u_arg[1]); + print_ts(tcp, tcp->u_arg[1]); return RVAL_DECODED; } -SYS_FUNC(clock_gettime) +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(clock_settime32) +{ + return do_clock_settime(tcp, print_timespec32); +} +#endif + +SYS_FUNC(clock_settime64) +{ + return do_clock_settime(tcp, print_timespec64); +} + +static int +do_clock_gettime(struct tcb *const tcp, const print_obj_by_addr_fn print_ts) { if (entering(tcp)) { printclockname(tcp->u_arg[0]); tprints(", "); } else { - print_timespec(tcp, tcp->u_arg[1]); + print_ts(tcp, tcp->u_arg[1]); } return 0; } -SYS_FUNC(clock_nanosleep) +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(clock_gettime32) +{ + return do_clock_gettime(tcp, print_timespec32); +} +#endif + +SYS_FUNC(clock_gettime64) +{ + return do_clock_gettime(tcp, print_timespec64); +} + +static int +do_clock_nanosleep(struct tcb *const tcp, const print_obj_by_addr_fn print_ts) { if (entering(tcp)) { printclockname(tcp->u_arg[0]); tprints(", "); printflags(clockflags, tcp->u_arg[1], "TIMER_???"); tprints(", "); - print_timespec(tcp, tcp->u_arg[2]); + print_ts(tcp, tcp->u_arg[2]); tprints(", "); } else { /* @@ -246,7 +304,7 @@ SYS_FUNC(clock_nanosleep) */ if (!tcp->u_arg[1] && is_erestart(tcp)) { temporarily_clear_syserror(tcp); - print_timespec(tcp, tcp->u_arg[3]); + print_ts(tcp, tcp->u_arg[3]); restore_cleared_syserror(tcp); } else { printaddr(tcp->u_arg[3]); @@ -255,15 +313,47 @@ SYS_FUNC(clock_nanosleep) return 0; } -SYS_FUNC(clock_adjtime) +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(clock_nanosleep_time32) +{ + return do_clock_nanosleep(tcp, print_timespec32); +} +#endif + +SYS_FUNC(clock_nanosleep_time64) +{ + return do_clock_nanosleep(tcp, print_timespec64); +} + +static int +do_clock_adjtime(struct tcb *const tcp, const print_obj_by_addr_fn print_tx) { if (exiting(tcp)) - return do_adjtimex(tcp, tcp->u_arg[1]); + return do_adjtimex(tcp, print_tx, tcp->u_arg[1]); printclockname(tcp->u_arg[0]); tprints(", "); return 0; } +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(clock_adjtime32) +{ + return do_clock_adjtime(tcp, print_timex32); +} +#endif + +SYS_FUNC(clock_adjtime64) +{ + return do_clock_adjtime(tcp, print_timex64); +} + +#ifdef SPARC64 +SYS_FUNC(clock_sparc64_adjtime) +{ + return do_clock_adjtime(tcp, print_sparc64_timex); +} +#endif + SYS_FUNC(timer_create) { if (entering(tcp)) { @@ -277,30 +367,56 @@ SYS_FUNC(timer_create) return 0; } -SYS_FUNC(timer_settime) +static int +do_timer_settime(struct tcb *const tcp, const print_obj_by_addr_fn print_its) { if (entering(tcp)) { tprintf("%d, ", (int) tcp->u_arg[0]); printflags(clockflags, tcp->u_arg[1], "TIMER_???"); tprints(", "); - print_itimerspec(tcp, tcp->u_arg[2]); + print_its(tcp, tcp->u_arg[2]); tprints(", "); } else { - print_itimerspec(tcp, tcp->u_arg[3]); + print_its(tcp, tcp->u_arg[3]); } return 0; } -SYS_FUNC(timer_gettime) +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(timer_settime32) +{ + return do_timer_settime(tcp, print_itimerspec32); +} +#endif + +SYS_FUNC(timer_settime64) +{ + return do_timer_settime(tcp, print_itimerspec64); +} + +static int +do_timer_gettime(struct tcb *const tcp, const print_obj_by_addr_fn print_its) { if (entering(tcp)) { tprintf("%d, ", (int) tcp->u_arg[0]); } else { - print_itimerspec(tcp, tcp->u_arg[1]); + print_its(tcp, tcp->u_arg[1]); } return 0; } +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(timer_gettime32) +{ + return do_timer_gettime(tcp, print_itimerspec32); +} +#endif + +SYS_FUNC(timer_gettime64) +{ + return do_timer_gettime(tcp, print_itimerspec64); +} + #include "xlat/timerfdflags.h" SYS_FUNC(timerfd_create) @@ -312,28 +428,54 @@ SYS_FUNC(timerfd_create) return RVAL_DECODED | RVAL_FD; } -SYS_FUNC(timerfd_settime) +static int +do_timerfd_settime(struct tcb *const tcp, const print_obj_by_addr_fn print_its) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); tprints(", "); printflags(timerfdflags, tcp->u_arg[1], "TFD_???"); tprints(", "); - print_itimerspec(tcp, tcp->u_arg[2]); + print_its(tcp, tcp->u_arg[2]); tprints(", "); } else { - print_itimerspec(tcp, tcp->u_arg[3]); + print_its(tcp, tcp->u_arg[3]); } return 0; } -SYS_FUNC(timerfd_gettime) +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(timerfd_settime32) +{ + return do_timerfd_settime(tcp, print_itimerspec32); +} +#endif + +SYS_FUNC(timerfd_settime64) +{ + return do_timerfd_settime(tcp, print_itimerspec64); +} + +static int +do_timerfd_gettime(struct tcb *const tcp, const print_obj_by_addr_fn print_its) { if (entering(tcp)) { printfd(tcp, tcp->u_arg[0]); tprints(", "); } else { - print_itimerspec(tcp, tcp->u_arg[1]); + print_its(tcp, tcp->u_arg[1]); } return 0; } + +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(timerfd_gettime32) +{ + return do_timerfd_gettime(tcp, print_itimerspec32); +} +#endif + +SYS_FUNC(timerfd_gettime64) +{ + return do_timerfd_gettime(tcp, print_itimerspec64); +} diff --git a/times.c b/times.c index b165a2b0..ccdd76c3 100644 --- a/times.c +++ b/times.c @@ -6,29 +6,10 @@ * Copyright (c) 2012 H.J. Lu * Copyright (c) 2015 Elvira Khabirova * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -41,10 +22,7 @@ SYS_FUNC(times) { tms_t tbuf; - if (entering(tcp)) - return 0; - - if (!umove_or_printaddr(tcp, tcp->u_arg[0], &tbuf)) { + if (exiting(tcp) && !umove_or_printaddr(tcp, tcp->u_arg[0], &tbuf)) { tprintf("{tms_utime=%llu, tms_stime=%llu, ", zero_extend_signed_to_ull(tbuf.tms_utime), zero_extend_signed_to_ull(tbuf.tms_stime)); @@ -53,5 +31,5 @@ SYS_FUNC(times) zero_extend_signed_to_ull(tbuf.tms_cstime)); } - return syserror(tcp) ? RVAL_DECIMAL : RVAL_UDECIMAL; + return 0; } diff --git a/trace_event.h b/trace_event.h new file mode 100644 index 00000000..53a711b8 --- /dev/null +++ b/trace_event.h @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2017-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_TRACE_EVENT_H +# define STRACE_TRACE_EVENT_H + +/* Possible trace event loop states. Returned by next_event() and dispatched by + * dispatch_event(). */ +enum trace_event { + /* Break the main loop. */ + TE_BREAK, + + /* Call next_event() again. */ + TE_NEXT, + + /* Restart the tracee with signal 0 and call next_event() again. */ + TE_RESTART, + + /* + * For all the events below, current_tcp is set to current tracee's + * tcb. All the suggested actions imply that you want to continue + * tracing of the current tracee; alternatively, you can detach it. + */ + + /* + * Syscall entry or exit. + * Restart the tracee with signal 0, or with an injected signal number. + */ + TE_SYSCALL_STOP, + + /* + * Tracee received signal with number WSTOPSIG(*pstatus); signal info + * is written to *si. Restart the tracee (with that signal number + * if you want to deliver it). + */ + TE_SIGNAL_DELIVERY_STOP, + + /* + * Tracee was killed by a signal with number WTERMSIG(*pstatus). + */ + TE_SIGNALLED, + + /* + * Tracee was stopped by a signal with number WSTOPSIG(*pstatus). + * Restart the tracee with that signal number. + */ + TE_GROUP_STOP, + + /* + * Tracee exited with status WEXITSTATUS(*pstatus). + */ + TE_EXITED, + + /* + * Tracee is going to perform execve(). + * Restart the tracee with signal 0. + */ + TE_STOP_BEFORE_EXECVE, + + /* + * Tracee is going to terminate. + * Restart the tracee with signal 0. + */ + TE_STOP_BEFORE_EXIT, +}; + +#endif /* !STRACE_TRACE_EVENT_H */ diff --git a/truncate.c b/truncate.c index f18394d9..12918dd9 100644 --- a/truncate.c +++ b/truncate.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" SYS_FUNC(truncate) diff --git a/ubi.c b/ubi.c index b4706552..a3422538 100644 --- a/ubi.c +++ b/ubi.c @@ -1,43 +1,19 @@ /* * Copyright (c) 2012 Mike Frysinger + * Copyright (c) 2012-2018 The strace developers. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" -#include +#ifdef HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024 -/* The UBI api changes, so we have to keep a local copy */ -#include -#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 7, 0) -# include "ubi-user.h" -#else +# include # include -#endif -#include "xlat/ubi_volume_types.h" -#include "xlat/ubi_volume_props.h" +# include "xlat/ubi_volume_types.h" +# include "xlat/ubi_volume_props.h" int ubi_ioctl(struct tcb *const tcp, const unsigned int code, @@ -60,14 +36,13 @@ ubi_ioctl(struct tcb *const tcp, const unsigned int code, mkvol.alignment, (int64_t)mkvol.bytes); printxval(ubi_volume_types, (uint8_t) mkvol.vol_type, "UBI_???_VOLUME"); - tprintf(", name_len=%" PRIi16 ", name=", mkvol.name_len); - if (print_quoted_string(mkvol.name, - CLAMP(mkvol.name_len, 0, UBI_MAX_VOLUME_NAME), - QUOTE_0_TERMINATED) > 0) { - tprints("..."); - } + tprintf(", name_len=%" PRIi16 ", name=", + mkvol.name_len); + print_quoted_cstring(mkvol.name, + CLAMP(mkvol.name_len, 0, + UBI_MAX_VOLUME_NAME)); tprints("}"); - return 1; + return 0; } if (!syserror(tcp)) { tprints(" => "); @@ -102,11 +77,9 @@ ubi_ioctl(struct tcb *const tcp, const unsigned int code, tprintf("{vol_id=%" PRIi32 ", name_len=%" PRIi16 ", name=", rnvol.ents[c].vol_id, rnvol.ents[c].name_len); - if (print_quoted_string(rnvol.ents[c].name, - CLAMP(rnvol.ents[c].name_len, 0, UBI_MAX_VOLUME_NAME), - QUOTE_0_TERMINATED) > 0) { - tprints("..."); - } + print_quoted_cstring(rnvol.ents[c].name, + CLAMP(rnvol.ents[c].name_len, 0, + UBI_MAX_VOLUME_NAME)); tprints("}"); } tprints("]}"); @@ -137,7 +110,7 @@ ubi_ioctl(struct tcb *const tcp, const unsigned int code, ", max_beb_per1024=%" PRIi16 "}", attach.ubi_num, attach.mtd_num, attach.vid_hdr_offset, attach.max_beb_per1024); - return 1; + return 0; } if (!syserror(tcp)) { tprints(" => "); @@ -185,12 +158,12 @@ ubi_ioctl(struct tcb *const tcp, const unsigned int code, printnum_int(tcp, arg, "%d"); break; -#ifdef UBI_IOCVOLCRBLK +# ifdef UBI_IOCVOLCRBLK case UBI_IOCVOLCRBLK: -#endif -#ifdef UBI_IOCVOLRMBLK +# endif +# ifdef UBI_IOCVOLRMBLK case UBI_IOCVOLRMBLK: -#endif +# endif /* no arguments */ break; @@ -198,5 +171,7 @@ ubi_ioctl(struct tcb *const tcp, const unsigned int code, return RVAL_DECODED; } - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } + +#endif /* HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024 */ diff --git a/ucopy.c b/ucopy.c new file mode 100644 index 00000000..7db49c4a --- /dev/null +++ b/ucopy.c @@ -0,0 +1,308 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation + * Linux for s390 port by D.J. Barrow + * + * Copyright (c) 1999-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include +#include + +#include "scno.h" +#include "ptrace.h" + +static bool process_vm_readv_not_supported; + +#ifndef HAVE_PROCESS_VM_READV +/* + * Need to do this since process_vm_readv() is not yet available in libc. + * When libc is updated, only "static bool process_vm_readv_not_supported" + * line remains. + * The name is different to avoid potential collision with OS headers. + */ +static ssize_t strace_process_vm_readv(pid_t pid, + const struct iovec *lvec, + unsigned long liovcnt, + const struct iovec *rvec, + unsigned long riovcnt, + unsigned long flags) +{ + return syscall(__NR_process_vm_readv, + (long) pid, lvec, liovcnt, rvec, riovcnt, flags); +} +# define process_vm_readv strace_process_vm_readv +#endif /* !HAVE_PROCESS_VM_READV */ + +static ssize_t +vm_read_mem(const pid_t pid, void *const laddr, + const kernel_ulong_t raddr, const size_t len) +{ + const unsigned long truncated_raddr = raddr; + +#if SIZEOF_LONG < SIZEOF_KERNEL_LONG_T + if (raddr != (kernel_ulong_t) truncated_raddr) { + errno = EIO; + return -1; + } +#endif + + const struct iovec local = { + .iov_base = laddr, + .iov_len = len + }; + const struct iovec remote = { + .iov_base = (void *) truncated_raddr, + .iov_len = len + }; + + const ssize_t rc = process_vm_readv(pid, &local, 1, &remote, 1, 0); + if (rc < 0 && errno == ENOSYS) + process_vm_readv_not_supported = true; + + return rc; +} + +static bool +tracee_addr_is_invalid(kernel_ulong_t addr) +{ + return +#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG + current_wordsize < sizeof(addr) && addr & ~(kernel_ulong_t) -1U; +#else + false; +#endif +} + +/* legacy method of copying from tracee */ +static int +umoven_peekdata(const int pid, kernel_ulong_t addr, unsigned int len, + void *laddr) +{ + unsigned int nread = 0; + unsigned int residue = addr & (sizeof(long) - 1); + + while (len) { + addr &= -sizeof(long); /* aligned address */ + + errno = 0; + union { + long val; + char x[sizeof(long)]; + } u = { .val = ptrace(PTRACE_PEEKDATA, pid, addr, 0) }; + + switch (errno) { + case 0: + break; + case ESRCH: case EINVAL: + /* these could be seen if the process is gone */ + return -1; + case EFAULT: case EIO: case EPERM: + /* address space is inaccessible */ + if (nread) { + perror_msg("umoven: short read (%u < %u) @0x%" PRI_klx, + nread, nread + len, addr - nread); + } + return -1; + default: + /* all the rest is strange and should be reported */ + perror_msg("umoven: PTRACE_PEEKDATA pid:%d @0x%" PRI_klx, + pid, addr); + return -1; + } + + unsigned int m = MIN(sizeof(long) - residue, len); + memcpy(laddr, &u.x[residue], m); + residue = 0; + addr += sizeof(long); + laddr += m; + nread += m; + len -= m; + } + + return 0; +} + +/* + * Copy `len' bytes of data from process `pid' + * at address `addr' to our space at `our_addr'. + */ +int +umoven(struct tcb *const tcp, kernel_ulong_t addr, unsigned int len, + void *const our_addr) +{ + if (tracee_addr_is_invalid(addr)) + return -1; + + const int pid = tcp->pid; + + if (process_vm_readv_not_supported) + return umoven_peekdata(pid, addr, len, our_addr); + + int r = vm_read_mem(pid, our_addr, addr, len); + if ((unsigned int) r == len) + return 0; + if (r >= 0) { + error_msg("umoven: short read (%u < %u) @0x%" PRI_klx, + (unsigned int) r, len, addr); + return -1; + } + switch (errno) { + case ENOSYS: + case EPERM: + /* try PTRACE_PEEKDATA */ + return umoven_peekdata(pid, addr, len, our_addr); + case ESRCH: + /* the process is gone */ + return -1; + case EFAULT: case EIO: + /* address space is inaccessible */ + return -1; + default: + /* all the rest is strange and should be reported */ + perror_msg("process_vm_readv: pid:%d @0x%" PRI_klx, + pid, addr); + return -1; + } +} + +/* + * Like umoven_peekdata but make the additional effort of looking + * for a terminating zero byte. + */ +static int +umovestr_peekdata(const int pid, kernel_ulong_t addr, unsigned int len, + void *laddr) +{ + unsigned int nread = 0; + unsigned int residue = addr & (sizeof(long) - 1); + void *const orig_addr = laddr; + + while (len) { + addr &= -sizeof(long); /* aligned address */ + + errno = 0; + union { + unsigned long val; + char x[sizeof(long)]; + } u = { .val = ptrace(PTRACE_PEEKDATA, pid, addr, 0) }; + + switch (errno) { + case 0: + break; + case ESRCH: case EINVAL: + /* these could be seen if the process is gone */ + return -1; + case EFAULT: case EIO: case EPERM: + /* address space is inaccessible */ + if (nread) { + perror_msg("umovestr: short read (%d < %d) @0x%" PRI_klx, + nread, nread + len, addr - nread); + } + return -1; + default: + /* all the rest is strange and should be reported */ + perror_msg("umovestr: PTRACE_PEEKDATA pid:%d @0x%" PRI_klx, + pid, addr); + return -1; + } + + unsigned int m = MIN(sizeof(long) - residue, len); + memcpy(laddr, &u.x[residue], m); + while (residue < sizeof(long)) + if (u.x[residue++] == '\0') + return (laddr - orig_addr) + residue; + residue = 0; + addr += sizeof(long); + laddr += m; + nread += m; + len -= m; + } + + return 0; +} + +/* + * Like `umove' but make the additional effort of looking + * for a terminating zero byte. + * + * Returns < 0 on error, strlen + 1 if NUL was seen, + * else 0 if len bytes were read but no NUL byte seen. + * + * Note: there is no guarantee we won't overwrite some bytes + * in laddr[] _after_ terminating NUL (but, of course, + * we never write past laddr[len-1]). + */ +int +umovestr(struct tcb *const tcp, kernel_ulong_t addr, unsigned int len, + char *laddr) +{ + if (tracee_addr_is_invalid(addr)) + return -1; + + const int pid = tcp->pid; + + if (process_vm_readv_not_supported) + return umovestr_peekdata(pid, addr, len, laddr); + + const size_t page_size = get_pagesize(); + const size_t page_mask = page_size - 1; + unsigned int nread = 0; + + while (len) { + /* + * Don't cross pages, otherwise we can get EFAULT + * and fail to notice that terminating NUL lies + * in the existing (first) page. + */ + unsigned int chunk_len = len > page_size ? page_size : len; + unsigned int end_in_page = (addr + chunk_len) & page_mask; + if (chunk_len > end_in_page) /* crosses to the next page */ + chunk_len -= end_in_page; + + int r = vm_read_mem(pid, laddr, addr, chunk_len); + if (r > 0) { + char *nul_addr = memchr(laddr, '\0', r); + + if (nul_addr) + return (nul_addr - laddr) + 1; + addr += r; + laddr += r; + nread += r; + len -= r; + continue; + } + switch (errno) { + case ENOSYS: + case EPERM: + /* try PTRACE_PEEKDATA */ + if (!nread) + return umovestr_peekdata(pid, addr, + len, laddr); + ATTRIBUTE_FALLTHROUGH; + case EFAULT: case EIO: + /* address space is inaccessible */ + if (nread) + perror_msg("umovestr: short read (%d < %d) @0x%" PRI_klx, + nread, nread + len, addr - nread); + return -1; + case ESRCH: + /* the process is gone */ + return -1; + default: + /* all the rest is strange and should be reported */ + perror_msg("process_vm_readv: pid:%d @0x%" PRI_klx, + pid, addr); + return -1; + } + } + + return 0; +} diff --git a/uid.c b/uid.c index 80d81ce4..e9276203 100644 --- a/uid.c +++ b/uid.c @@ -4,29 +4,10 @@ * Copyright (c) 1993-1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman * Copyright (c) 2003-2016 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #ifdef STRACE_UID_SIZE @@ -34,9 +15,9 @@ # error invalid STRACE_UID_SIZE # endif -# define SIZEIFY(x) SIZEIFY_(x,STRACE_UID_SIZE) -# define SIZEIFY_(x,size) SIZEIFY__(x,size) -# define SIZEIFY__(x,size) x ## size +# define SIZEIFY(x) SIZEIFY_(x, STRACE_UID_SIZE) +# define SIZEIFY_(x, size) SIZEIFY__(x, size) +# define SIZEIFY__(x, size) x ## size # define printuid SIZEIFY(printuid) # define sys_chown SIZEIFY(sys_chown) @@ -54,7 +35,7 @@ #include "defs.h" #ifdef STRACE_UID_SIZE -# if !NEED_UID16_PARSERS +# if !HAVE_ARCH_UID16_SYSCALLS # undef STRACE_UID_SIZE # endif #else @@ -70,14 +51,14 @@ SYS_FUNC(getuid) { - return RVAL_UDECIMAL | RVAL_DECODED; + return RVAL_DECODED; } SYS_FUNC(setfsuid) { printuid("", tcp->u_arg[0]); - return RVAL_UDECIMAL | RVAL_DECODED; + return RVAL_DECODED; } SYS_FUNC(setuid) @@ -159,7 +140,7 @@ printuid(const char *text, const unsigned int uid) static bool print_gid(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) { - printuid("", (* (uid_t *) elem_buf)); + printuid("", (*(uid_t *) elem_buf)); return true; } @@ -179,7 +160,7 @@ print_groups(struct tcb *const tcp, const unsigned int len, uid_t gid; print_array(tcp, addr, len, &gid, sizeof(gid), - umoven_or_printaddr, print_gid, 0); + tfetch_mem, print_gid, 0); } SYS_FUNC(setgroups) diff --git a/uid16.c b/uid16.c index c6d665df..9502c2d3 100644 --- a/uid16.c +++ b/uid16.c @@ -1,2 +1,9 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #define STRACE_UID_SIZE 16 #include "uid.c" diff --git a/umask.c b/umask.c index d42258a9..43de25e1 100644 --- a/umask.c +++ b/umask.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" SYS_FUNC(umask) diff --git a/umount.c b/umount.c index 8fafeabe..7f431654 100644 --- a/umount.c +++ b/umount.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" #include "xlat/umount_flags.h" diff --git a/uname.c b/uname.c index 3df11e8e..b68bbaeb 100644 --- a/uname.c +++ b/uname.c @@ -4,33 +4,14 @@ * Copyright (c) 1993-1996 Rick Sladkey * Copyright (c) 1996-1999 Wichert Akkerman * Copyright (c) 2012-2015 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" - +#include "print_fields.h" #include SYS_FUNC(uname) @@ -41,22 +22,17 @@ SYS_FUNC(uname) return 0; if (!umove_or_printaddr(tcp, tcp->u_arg[0], &uname)) { -#define PRINT_UTS_MEMBER(prefix, member) \ - tprints(prefix #member "="); \ - print_quoted_string(uname.member, sizeof(uname.member), \ - QUOTE_0_TERMINATED) - - PRINT_UTS_MEMBER("{", sysname); - PRINT_UTS_MEMBER(", ", nodename); + PRINT_FIELD_CSTRING("{", uname, sysname); + PRINT_FIELD_CSTRING(", ", uname, nodename); if (abbrev(tcp)) { tprints(", ...}"); return 0; } - PRINT_UTS_MEMBER(", ", release); - PRINT_UTS_MEMBER(", ", version); - PRINT_UTS_MEMBER(", ", machine); + PRINT_FIELD_CSTRING(", ", uname, release); + PRINT_FIELD_CSTRING(", ", uname, version); + PRINT_FIELD_CSTRING(", ", uname, machine); #ifdef HAVE_STRUCT_UTSNAME_DOMAINNAME - PRINT_UTS_MEMBER(", ", domainname); + PRINT_FIELD_CSTRING(", ", uname, domainname); #endif tprints("}"); } diff --git a/unwind-libdw.c b/unwind-libdw.c new file mode 100644 index 00000000..d9fa79ca --- /dev/null +++ b/unwind-libdw.c @@ -0,0 +1,191 @@ +/* + * This file is based on a patch submitted by Mark Wielaard + * to ltrace project: + * https://anonscm.debian.org/cgit/collab-maint/ltrace.git/commit/?id=dfefa9f057857735a073ea655f5cb34351032c8e + * + * It was re-licensed for strace by the original author: + * https://lists.strace.io/pipermail/strace-devel/2018-March/008063.html + * + * Copyright (c) 2014-2018 Mark Wielaard + * Copyright (c) 2018 Masatake YAMATO + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "unwind.h" +#include "mmap_notify.h" +#include + +struct ctx { + Dwfl *dwfl; + unsigned int last_proc_updating; +}; + +static unsigned int mapping_generation; + +static void +update_mapping_generation(struct tcb *tcp, void *unused) +{ + mapping_generation++; +} + +static void +init(void) +{ + mmap_notify_register_client(update_mapping_generation, NULL); +} + +static void * +tcb_init(struct tcb *tcp) +{ + static const Dwfl_Callbacks proc_callbacks = { + .find_elf = dwfl_linux_proc_find_elf, + .find_debuginfo = dwfl_standard_find_debuginfo + }; + + Dwfl *dwfl = dwfl_begin(&proc_callbacks); + if (dwfl == NULL) { + error_msg("dwfl_begin: %s", dwfl_errmsg(-1)); + return NULL; + } + + int r = dwfl_linux_proc_attach(dwfl, tcp->pid, true); + if (r) { + const char *msg = NULL; + + if (r < 0) + msg = dwfl_errmsg(-1); + else if (r > 0) + msg = strerror(r); + + error_msg("dwfl_linux_proc_attach returned an error" + " for process %d: %s", tcp->pid, msg); + dwfl_end(dwfl); + return NULL; + } + + struct ctx *ctx = xmalloc(sizeof(*ctx)); + ctx->dwfl = dwfl; + ctx->last_proc_updating = 0; + return ctx; +} + +static void +tcb_fin(struct tcb *tcp) +{ + struct ctx *ctx = tcp->unwind_ctx; + if (ctx) { + dwfl_end(ctx->dwfl); + free(ctx); + } +} + +static void +flush_cache_maybe(struct tcb *tcp) +{ + struct ctx *ctx = tcp->unwind_ctx; + if (!ctx) + return; + + if (ctx->last_proc_updating == mapping_generation) + return; + + int r = dwfl_linux_proc_report(ctx->dwfl, tcp->pid); + + if (r < 0) + error_msg("dwfl_linux_proc_report returned an error" + " for pid %d: %s", tcp->pid, dwfl_errmsg(-1)); + else if (r > 0) + error_msg("dwfl_linux_proc_report returned an error" + " for pid %d", tcp->pid); + else if (dwfl_report_end(ctx->dwfl, NULL, NULL) != 0) + error_msg("dwfl_report_end returned an error" + " for pid %d: %s", tcp->pid, dwfl_errmsg(-1)); + + ctx->last_proc_updating = mapping_generation; +} + +struct frame_user_data { + unwind_call_action_fn call_action; + unwind_error_action_fn error_action; + void *data; + int stack_depth; +}; + +static int +frame_callback(Dwfl_Frame *state, void *arg) +{ + struct frame_user_data *user_data = arg; + Dwarf_Addr pc; + bool isactivation; + + if (!dwfl_frame_pc(state, &pc, &isactivation)) { + /* Propagate the error to the caller. */ + return -1; + } + + if (!isactivation) + pc--; + + Dwfl *dwfl = dwfl_thread_dwfl(dwfl_frame_thread(state)); + Dwfl_Module *mod = dwfl_addrmodule(dwfl, pc); + GElf_Off off = 0; + + if (mod != NULL) { + const char *modname = NULL; + const char *symname = NULL; + GElf_Sym sym; + Dwarf_Addr true_offset = pc; + + modname = dwfl_module_info(mod, NULL, NULL, NULL, NULL, + NULL, NULL, NULL); + symname = dwfl_module_addrinfo(mod, pc, &off, &sym, + NULL, NULL, NULL); + dwfl_module_relocate_address(mod, &true_offset); + user_data->call_action(user_data->data, modname, symname, + off, true_offset); + } + /* Max number of frames to print reached? */ + if (user_data->stack_depth-- == 0) + return DWARF_CB_ABORT; + + return DWARF_CB_OK; +} + +static void +tcb_walk(struct tcb *tcp, + unwind_call_action_fn call_action, + unwind_error_action_fn error_action, + void *data) +{ + struct ctx *ctx = tcp->unwind_ctx; + if (!ctx) + return; + + struct frame_user_data user_data = { + .call_action = call_action, + .error_action = error_action, + .data = data, + .stack_depth = 256, + }; + + flush_cache_maybe(tcp); + + int r = dwfl_getthread_frames(ctx->dwfl, tcp->pid, frame_callback, + &user_data); + if (r) + error_action(data, + r < 0 ? dwfl_errmsg(-1) : "too many stack frames", + 0); +} + +const struct unwind_unwinder_t unwinder = { + .name = "libdw", + .init = init, + .tcb_init = tcb_init, + .tcb_fin = tcb_fin, + .tcb_walk = tcb_walk, +}; diff --git a/unwind-libunwind.c b/unwind-libunwind.c new file mode 100644 index 00000000..76ec658f --- /dev/null +++ b/unwind-libunwind.c @@ -0,0 +1,170 @@ +/* + * Copyright (c) 2013 Luca Clementi + * Copyright (c) 2013-2018 The strace developers. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "unwind.h" + +#include "mmap_cache.h" +#include + +static unw_addr_space_t libunwind_as; + +static void +init(void) +{ + mmap_cache_enable(); + + libunwind_as = unw_create_addr_space(&_UPT_accessors, 0); + if (!libunwind_as) + error_msg_and_die("failed to create address space" + " for stack tracing"); + unw_set_caching_policy(libunwind_as, UNW_CACHE_GLOBAL); +} + +static void * +tcb_init(struct tcb *tcp) +{ + void *r = _UPT_create(tcp->pid); + + if (!r) + perror_msg_and_die("_UPT_create"); + return r; +} + +static void +tcb_fin(struct tcb *tcp) +{ + _UPT_destroy(tcp->unwind_ctx); +} + +static void +get_symbol_name(unw_cursor_t *cursor, char **name, + size_t *size, unw_word_t *offset) +{ + for (;;) { + int rc = unw_get_proc_name(cursor, *name, *size, offset); + + if (rc == 0) + break; + if (rc != -UNW_ENOMEM) { + **name = '\0'; + *offset = 0; + break; + } + *name = xgrowarray(*name, size, 1); + } +} + +static int +print_stack_frame(struct tcb *tcp, + unwind_call_action_fn call_action, + unwind_error_action_fn error_action, + void *data, + unw_cursor_t *cursor, + char **symbol_name, + size_t *symbol_name_size) +{ + unw_word_t ip; + + if (unw_get_reg(cursor, UNW_REG_IP, &ip) < 0) { + perror_msg("cannot walk the stack of process %d", tcp->pid); + return -1; + } + + struct mmap_cache_entry_t *entry = mmap_cache_search(tcp, ip); + + if (entry + /* ignore mappings that have no PROT_EXEC bit set */ + && (entry->protections & MMAP_CACHE_PROT_EXECUTABLE)) { + unw_word_t function_offset; + + get_symbol_name(cursor, symbol_name, symbol_name_size, + &function_offset); + unsigned long true_offset = + ip - entry->start_addr + entry->mmap_offset; + call_action(data, + entry->binary_filename, + *symbol_name, + function_offset, + true_offset); + + return 0; + } + + /* + * there is a bug in libunwind >= 1.0 + * after a set_tid_address syscall + * unw_get_reg returns IP == 0 + */ + if (ip) + error_action(data, "unexpected_backtracing_error", ip); + return -1; +} + +static void +walk(struct tcb *tcp, + unwind_call_action_fn call_action, + unwind_error_action_fn error_action, + void *data) +{ + char *symbol_name; + size_t symbol_name_size = 40; + unw_cursor_t cursor; + int stack_depth; + + if (!tcp->mmap_cache) + error_func_msg_and_die("mmap_cache is NULL"); + + symbol_name = xmalloc(symbol_name_size); + + if (unw_init_remote(&cursor, libunwind_as, tcp->unwind_ctx) < 0) + perror_func_msg_and_die("cannot initialize libunwind"); + + for (stack_depth = 0; stack_depth < 256; ++stack_depth) { + if (print_stack_frame(tcp, call_action, error_action, data, + &cursor, &symbol_name, &symbol_name_size) < 0) + break; + if (unw_step(&cursor) <= 0) + break; + } + if (stack_depth >= 256) + error_action(data, "too many stack frames", 0); + + free(symbol_name); +} + +static void +tcb_walk(struct tcb *tcp, + unwind_call_action_fn call_action, + unwind_error_action_fn error_action, + void *data) +{ + switch (mmap_cache_rebuild_if_invalid(tcp, __func__)) { + case MMAP_CACHE_REBUILD_RENEWED: + /* + * Rebuild the unwinder internal cache. + * Called when mmap cache subsystem detects a + * change of tracee memory mapping. + */ + unw_flush_cache(libunwind_as, 0, 0); + ATTRIBUTE_FALLTHROUGH; + case MMAP_CACHE_REBUILD_READY: + walk(tcp, call_action, error_action, data); + break; + default: + /* Do nothing */ + ; + } +} + +const struct unwind_unwinder_t unwinder = { + .name = "libunwind", + .init = init, + .tcb_init = tcb_init, + .tcb_fin = tcb_fin, + .tcb_walk = tcb_walk, +}; diff --git a/unwind.c b/unwind.c index 326d184e..42e6a7fa 100644 --- a/unwind.c +++ b/unwind.c @@ -1,386 +1,70 @@ /* * Copyright (c) 2013 Luca Clementi + * Copyright (c) 2013-2018 The strace developers. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" -#include -#include - -#ifdef _LARGEFILE64_SOURCE -# ifdef HAVE_FOPEN64 -# define fopen_for_input fopen64 -# else -# define fopen_for_input fopen +#include "unwind.h" + +#ifdef USE_DEMANGLE +# if defined HAVE_DEMANGLE_H +# include +# elif defined HAVE_LIBIBERTY_DEMANGLE_H +# include # endif -#else -# define fopen_for_input fopen #endif -#define DPRINTF(F, A, ...) if (debug_flag) error_msg("[unwind(" A ")] " F, __VA_ARGS__) - -/* - * Кeep a sorted array of cache entries, - * so that we can binary search through it. - */ -struct mmap_cache_t { - /** - * example entry: - * 7fabbb09b000-7fabbb09f000 r-xp 00179000 fc:00 1180246 /lib/libc-2.11.1.so - * - * start_addr is 0x7fabbb09b000 - * end_addr is 0x7fabbb09f000 - * mmap_offset is 0x179000 - * binary_filename is "/lib/libc-2.11.1.so" - */ - unsigned long start_addr; - unsigned long end_addr; - unsigned long mmap_offset; - char *binary_filename; -}; - -/* - * Type used in stacktrace walker - */ -typedef void (*call_action_fn)(void *data, - const char *binary_filename, - const char *symbol_name, - unw_word_t function_offset, - unsigned long true_offset); -typedef void (*error_action_fn)(void *data, - const char *error, - unsigned long true_offset); - /* * Type used in stacktrace capturing */ struct call_t { - struct call_t* next; - char *output_line; + struct call_t *next; + char *output_line; }; -struct queue_t { - struct call_t *tail; - struct call_t *head; +struct unwind_queue_t { + struct call_t *tail; + struct call_t *head; }; -static void queue_print(struct queue_t *queue); -static void delete_mmap_cache(struct tcb *tcp, const char *caller); +static void queue_print(struct unwind_queue_t *queue); -static unw_addr_space_t libunwind_as; -static unsigned int mmap_cache_generation; +static const char asprintf_error_str[] = "???"; void unwind_init(void) { - libunwind_as = unw_create_addr_space(&_UPT_accessors, 0); - if (!libunwind_as) - error_msg_and_die("failed to create address space for stack tracing"); - unw_set_caching_policy(libunwind_as, UNW_CACHE_GLOBAL); + if (unwinder.init) + unwinder.init(); } void unwind_tcb_init(struct tcb *tcp) { - if (tcp->libunwind_ui) + if (tcp->unwind_queue) return; - tcp->libunwind_ui = _UPT_create(tcp->pid); - if (!tcp->libunwind_ui) - die_out_of_memory(); + tcp->unwind_queue = xmalloc(sizeof(*tcp->unwind_queue)); + tcp->unwind_queue->head = NULL; + tcp->unwind_queue->tail = NULL; - tcp->queue = xmalloc(sizeof(*tcp->queue)); - tcp->queue->head = NULL; - tcp->queue->tail = NULL; + tcp->unwind_ctx = unwinder.tcb_init(tcp); } void unwind_tcb_fin(struct tcb *tcp) { - queue_print(tcp->queue); - free(tcp->queue); - tcp->queue = NULL; - - delete_mmap_cache(tcp, __FUNCTION__); - - _UPT_destroy(tcp->libunwind_ui); - tcp->libunwind_ui = NULL; -} - -/* - * caching of /proc/ID/maps for each process to speed up stack tracing - * - * The cache must be refreshed after syscalls that affect memory mappings, - * e.g. mmap, mprotect, munmap, execve. - */ -static void -build_mmap_cache(struct tcb* tcp) -{ - FILE *fp; - struct mmap_cache_t *cache_head; - /* start with a small dynamically-allocated array and then expand it */ - size_t cur_array_size = 10; - char filename[sizeof("/proc/4294967296/maps")]; - char buffer[PATH_MAX + 80]; - - unw_flush_cache(libunwind_as, 0, 0); - - sprintf(filename, "/proc/%u/maps", tcp->pid); - fp = fopen_for_input(filename, "r"); - if (!fp) { - perror_msg("fopen: %s", filename); - return; - } - - cache_head = xcalloc(cur_array_size, sizeof(*cache_head)); - - while (fgets(buffer, sizeof(buffer), fp) != NULL) { - struct mmap_cache_t *entry; - unsigned long start_addr, end_addr, mmap_offset; - char exec_bit; - char binary_path[PATH_MAX]; - - if (sscanf(buffer, "%lx-%lx %*c%*c%c%*c %lx %*x:%*x %*d %[^\n]", - &start_addr, &end_addr, &exec_bit, - &mmap_offset, binary_path) != 5) - continue; - - /* ignore mappings that have no PROT_EXEC bit set */ - if (exec_bit != 'x') - continue; - - if (end_addr < start_addr) { - error_msg("%s: unrecognized file format", filename); - break; - } - - /* - * sanity check to make sure that we're storing - * non-overlapping regions in ascending order - */ - if (tcp->mmap_cache_size > 0) { - entry = &cache_head[tcp->mmap_cache_size - 1]; - if (entry->start_addr == start_addr && - entry->end_addr == end_addr) { - /* duplicate entry, e.g. [vsyscall] */ - continue; - } - if (start_addr <= entry->start_addr || - start_addr < entry->end_addr) { - error_msg("%s: overlapping memory region", - filename); - continue; - } - } - - if (tcp->mmap_cache_size >= cur_array_size) { - cur_array_size *= 2; - cache_head = xreallocarray(cache_head, cur_array_size, - sizeof(*cache_head)); - } - - entry = &cache_head[tcp->mmap_cache_size]; - entry->start_addr = start_addr; - entry->end_addr = end_addr; - entry->mmap_offset = mmap_offset; - entry->binary_filename = xstrdup(binary_path); - tcp->mmap_cache_size++; - } - fclose(fp); - tcp->mmap_cache = cache_head; - tcp->mmap_cache_generation = mmap_cache_generation; - - DPRINTF("tgen=%u, ggen=%u, tcp=%p, cache=%p", - "cache-build", - tcp->mmap_cache_generation, - mmap_cache_generation, - tcp, tcp->mmap_cache); -} - -/* deleting the cache */ -static void -delete_mmap_cache(struct tcb *tcp, const char *caller) -{ - unsigned int i; - - DPRINTF("tgen=%u, ggen=%u, tcp=%p, cache=%p, caller=%s", - "cache-delete", - tcp->mmap_cache_generation, - mmap_cache_generation, - tcp, tcp->mmap_cache, caller); - - for (i = 0; i < tcp->mmap_cache_size; i++) { - free(tcp->mmap_cache[i].binary_filename); - tcp->mmap_cache[i].binary_filename = NULL; - } - free(tcp->mmap_cache); - tcp->mmap_cache = NULL; - tcp->mmap_cache_size = 0; -} - -static bool -rebuild_cache_if_invalid(struct tcb *tcp, const char *caller) -{ - if ((tcp->mmap_cache_generation != mmap_cache_generation) - && tcp->mmap_cache) - delete_mmap_cache(tcp, caller); - - if (!tcp->mmap_cache) - build_mmap_cache(tcp); - - if (!tcp->mmap_cache || !tcp->mmap_cache_size) - return false; - else - return true; -} - -void -unwind_cache_invalidate(struct tcb* tcp) -{ -#if SUPPORTED_PERSONALITIES > 1 - if (tcp->currpers != DEFAULT_PERSONALITY) { - /* disable strack trace */ + if (!tcp->unwind_queue) return; - } -#endif - mmap_cache_generation++; - DPRINTF("tgen=%u, ggen=%u, tcp=%p, cache=%p", "increment", - tcp->mmap_cache_generation, - mmap_cache_generation, - tcp, - tcp->mmap_cache); -} - -static void -get_symbol_name(unw_cursor_t *cursor, char **name, - size_t *size, unw_word_t *offset) -{ - for (;;) { - int rc = unw_get_proc_name(cursor, *name, *size, offset); - if (rc == 0) - break; - if (rc != -UNW_ENOMEM) { - **name = '\0'; - *offset = 0; - break; - } - *name = xreallocarray(*name, 2, *size); - *size *= 2; - } -} - -static int -print_stack_frame(struct tcb *tcp, - call_action_fn call_action, - error_action_fn error_action, - void *data, - unw_cursor_t *cursor, - char **symbol_name, - size_t *symbol_name_size) -{ - unw_word_t ip; - int lower = 0; - int upper = (int) tcp->mmap_cache_size - 1; - - if (unw_get_reg(cursor, UNW_REG_IP, &ip) < 0) { - perror_msg("Can't walk the stack of process %d", tcp->pid); - return -1; - } - while (lower <= upper) { - struct mmap_cache_t *cur_mmap_cache; - int mid = (upper + lower) / 2; - - cur_mmap_cache = &tcp->mmap_cache[mid]; - - if (ip >= cur_mmap_cache->start_addr && - ip < cur_mmap_cache->end_addr) { - unsigned long true_offset; - unw_word_t function_offset; - - get_symbol_name(cursor, symbol_name, symbol_name_size, - &function_offset); - true_offset = ip - cur_mmap_cache->start_addr + - cur_mmap_cache->mmap_offset; - call_action(data, - cur_mmap_cache->binary_filename, - *symbol_name, - function_offset, - true_offset); - return 0; - } - else if (ip < cur_mmap_cache->start_addr) - upper = mid - 1; - else - lower = mid + 1; - } + queue_print(tcp->unwind_queue); + free(tcp->unwind_queue); + tcp->unwind_queue = NULL; - /* - * there is a bug in libunwind >= 1.0 - * after a set_tid_address syscall - * unw_get_reg returns IP == 0 - */ - if(ip) - error_action(data, "unexpected_backtracing_error", ip); - return -1; -} - -/* - * walking the stack - */ -static void -stacktrace_walk(struct tcb *tcp, - call_action_fn call_action, - error_action_fn error_action, - void *data) -{ - char *symbol_name; - size_t symbol_name_size = 40; - unw_cursor_t cursor; - int stack_depth; - - if (!tcp->mmap_cache) - error_msg_and_die("bug: mmap_cache is NULL"); - if (tcp->mmap_cache_size == 0) - error_msg_and_die("bug: mmap_cache is empty"); - - symbol_name = xmalloc(symbol_name_size); - - if (unw_init_remote(&cursor, libunwind_as, tcp->libunwind_ui) < 0) - perror_msg_and_die("Can't initiate libunwind"); - - for (stack_depth = 0; stack_depth < 256; ++stack_depth) { - if (print_stack_frame(tcp, call_action, error_action, data, - &cursor, &symbol_name, &symbol_name_size) < 0) - break; - if (unw_step(&cursor) <= 0) - break; - } - if (stack_depth >= 256) - error_action(data, "too many stack frames", 0); - - free(symbol_name); + unwinder.tcb_fin(tcp); + tcp->unwind_ctx = NULL; } /* @@ -395,10 +79,10 @@ stacktrace_walk(struct tcb *tcp, * /lib64/libc.so.6(__libc_start_main+0xed) [0x7fa2f8a5976d] * ./a.out() [0x400569] */ -#define STACK_ENTRY_SYMBOL_FMT \ +#define STACK_ENTRY_SYMBOL_FMT(SYM) \ " > %s(%s+0x%lx) [0x%lx]\n", \ binary_filename, \ - symbol_name, \ + (SYM), \ (unsigned long) function_offset, \ true_offset #define STACK_ENTRY_NOSYMBOL_FMT \ @@ -415,15 +99,28 @@ static void print_call_cb(void *dummy, const char *binary_filename, const char *symbol_name, - unw_word_t function_offset, + unwind_function_offset_t function_offset, unsigned long true_offset) { - if (symbol_name && (symbol_name[0] != '\0')) - tprintf(STACK_ENTRY_SYMBOL_FMT); + if (symbol_name && (symbol_name[0] != '\0')) { +#ifdef USE_DEMANGLE + char *demangled_name = + cplus_demangle(symbol_name, + DMGL_AUTO | DMGL_PARAMS); +#endif + tprintf(STACK_ENTRY_SYMBOL_FMT( +#ifdef USE_DEMANGLE + demangled_name ? demangled_name : +#endif + symbol_name)); +#ifdef USE_DEMANGLE + free(demangled_name); +#endif + } else if (binary_filename) tprintf(STACK_ENTRY_NOSYMBOL_FMT); else - tprintf(STACK_ENTRY_BUG_FMT, __FUNCTION__); + tprintf(STACK_ENTRY_BUG_FMT, __func__); line_ended(); } @@ -444,38 +141,54 @@ print_error_cb(void *dummy, static char * sprint_call_or_error(const char *binary_filename, const char *symbol_name, - unw_word_t function_offset, + unwind_function_offset_t function_offset, unsigned long true_offset, const char *error) { - char *output_line = NULL; - int n; - - if (symbol_name) - n = asprintf(&output_line, STACK_ENTRY_SYMBOL_FMT); - else if (binary_filename) - n = asprintf(&output_line, STACK_ENTRY_NOSYMBOL_FMT); - else if (error) - n = true_offset - ? asprintf(&output_line, STACK_ENTRY_ERROR_WITH_OFFSET_FMT) - : asprintf(&output_line, STACK_ENTRY_ERROR_FMT); - else - n = asprintf(&output_line, STACK_ENTRY_BUG_FMT, __FUNCTION__); - - if (n < 0) - error_msg_and_die("error in asprintf"); - - return output_line; + char *output_line = NULL; + int n; + + if (symbol_name) { +#ifdef USE_DEMANGLE + char *demangled_name = + cplus_demangle(symbol_name, + DMGL_AUTO | DMGL_PARAMS); +#endif + n = asprintf(&output_line, + STACK_ENTRY_SYMBOL_FMT( +#ifdef USE_DEMANGLE + demangled_name ? demangled_name : +#endif + symbol_name)); +#ifdef USE_DEMANGLE + free(demangled_name); +#endif + } + else if (binary_filename) + n = asprintf(&output_line, STACK_ENTRY_NOSYMBOL_FMT); + else if (error) + n = true_offset + ? asprintf(&output_line, STACK_ENTRY_ERROR_WITH_OFFSET_FMT) + : asprintf(&output_line, STACK_ENTRY_ERROR_FMT); + else + n = asprintf(&output_line, STACK_ENTRY_BUG_FMT, __func__); + + if (n < 0) { + perror_func_msg("asprintf"); + output_line = (char *) asprintf_error_str; + } + + return output_line; } /* * queue manipulators */ static void -queue_put(struct queue_t *queue, +queue_put(struct unwind_queue_t *queue, const char *binary_filename, const char *symbol_name, - unw_word_t function_offset, + unwind_function_offset_t function_offset, unsigned long true_offset, const char *error) { @@ -502,7 +215,7 @@ static void queue_put_call(void *queue, const char *binary_filename, const char *symbol_name, - unw_word_t function_offset, + unwind_function_offset_t function_offset, unsigned long true_offset) { queue_put(queue, @@ -522,7 +235,7 @@ queue_put_error(void *queue, } static void -queue_print(struct queue_t *queue) +queue_print(struct unwind_queue_t *queue) { struct call_t *call, *tmp; @@ -536,7 +249,9 @@ queue_print(struct queue_t *queue) tprints(tmp->output_line); line_ended(); - free(tmp->output_line); + if (tmp->output_line != asprintf_error_str) + free(tmp->output_line); + tmp->output_line = NULL; tmp->next = NULL; free(tmp); @@ -547,42 +262,40 @@ queue_print(struct queue_t *queue) * printing stack */ void -unwind_print_stacktrace(struct tcb* tcp) +unwind_tcb_print(struct tcb *tcp) { #if SUPPORTED_PERSONALITIES > 1 if (tcp->currpers != DEFAULT_PERSONALITY) { - /* disable strack trace */ + /* disable stack trace */ return; } #endif - if (tcp->queue->head) { - DPRINTF("tcp=%p, queue=%p", "queueprint", tcp, tcp->queue->head); - queue_print(tcp->queue); - } - else if (rebuild_cache_if_invalid(tcp, __FUNCTION__)) { - DPRINTF("tcp=%p, queue=%p", "stackprint", tcp, tcp->queue->head); - stacktrace_walk(tcp, print_call_cb, print_error_cb, NULL); - } + if (tcp->unwind_queue->head) { + debug_func_msg("head: tcp=%p, queue=%p", + tcp, tcp->unwind_queue->head); + queue_print(tcp->unwind_queue); + } else + unwinder.tcb_walk(tcp, print_call_cb, print_error_cb, NULL); } /* * capturing stack */ void -unwind_capture_stacktrace(struct tcb *tcp) +unwind_tcb_capture(struct tcb *tcp) { #if SUPPORTED_PERSONALITIES > 1 if (tcp->currpers != DEFAULT_PERSONALITY) { - /* disable strack trace */ + /* disable stack trace */ return; } #endif - if (tcp->queue->head) + if (tcp->unwind_queue->head) error_msg_and_die("bug: unprinted entries in queue"); - - if (rebuild_cache_if_invalid(tcp, __FUNCTION__)) { - stacktrace_walk(tcp, queue_put_call, queue_put_error, - tcp->queue); - DPRINTF("tcp=%p, queue=%p", "captured", tcp, tcp->queue->head); + else { + debug_func_msg("walk: tcp=%p, queue=%p", + tcp, tcp->unwind_queue->head); + unwinder.tcb_walk(tcp, queue_put_call, queue_put_error, + tcp->unwind_queue); } } diff --git a/unwind.h b/unwind.h new file mode 100644 index 00000000..1cf4c367 --- /dev/null +++ b/unwind.h @@ -0,0 +1,50 @@ +/* + * Unwinder backends interface. + * + * Copyright (c) 2013 Luca Clementi + * Copyright (c) 2013-2018 The strace developers. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_UNWIND_H +# define STRACE_UNWIND_H + +# include "defs.h" + +/* + * Type used in stacktrace walker. + */ + +/* This storage be enough large to store unw_word_t. */ +typedef unsigned long unwind_function_offset_t; + +typedef void (*unwind_call_action_fn)(void *data, + const char *binary_filename, + const char *symbol_name, + unwind_function_offset_t function_offset, + unsigned long true_offset); +typedef void (*unwind_error_action_fn)(void *data, + const char *error, + unsigned long true_offset); + +struct unwind_unwinder_t { + const char *name; + + /* Initialize the unwinder. */ + void (*init)(void); + + /* Make/destroy the context data attached to tcb. */ + void * (*tcb_init)(struct tcb *); + void (*tcb_fin)(struct tcb *); + + /* Walk the stack. */ + void (*tcb_walk)(struct tcb *, + unwind_call_action_fn, + unwind_error_action_fn, + void *); +}; + +extern const struct unwind_unwinder_t unwinder; + +#endif /* !STRACE_UNWIND_H */ diff --git a/upeek.c b/upeek.c index 01a12d35..0618f270 100644 --- a/upeek.c +++ b/upeek.c @@ -6,44 +6,26 @@ * Copyright (c) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation * Linux for s390 port by D.J. Barrow * + * Copyright (c) 1999-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" #include "ptrace.h" int -upeek(int pid, unsigned long off, kernel_ulong_t *res) +upeek(struct tcb *tcp, unsigned long off, kernel_ulong_t *res) { long val; errno = 0; - val = ptrace(PTRACE_PEEKUSER, (pid_t) pid, (void *) off, 0); + val = ptrace(PTRACE_PEEKUSER, (pid_t) tcp->pid, (void *) off, 0); if (val == -1 && errno) { if (errno != ESRCH) { - perror_msg("upeek: PTRACE_PEEKUSER pid:%d @0x%lx)", pid, off); + perror_msg("upeek: PTRACE_PEEKUSER pid:%d @0x%lx)", + tcp->pid, off); } return -1; } diff --git a/upoke.c b/upoke.c index dda0b8d7..ae532e48 100644 --- a/upoke.c +++ b/upoke.c @@ -1,39 +1,22 @@ /* * Copyright (c) 2016 Dmitry V. Levin + * Copyright (c) 2016-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" #include "ptrace.h" +#include "ptrace_pokeuser.c" int -upoke(int pid, unsigned long off, kernel_ulong_t val) +upoke(struct tcb *tcp, unsigned long off, kernel_ulong_t val) { - if (ptrace(PTRACE_POKEUSER, pid, off, val)) { + if (ptrace_pokeuser(tcp->pid, off, val) < 0) { if (errno != ESRCH) - perror_msg("upoke: PTRACE_POKEUSER pid:%d @%#lx)", pid, off); + perror_msg("upoke: PTRACE_POKEUSER pid:%d @%#lx)", + tcp->pid, off); return -1; } return 0; diff --git a/userfaultfd.c b/userfaultfd.c index aeeb3eab..c251a6bb 100644 --- a/userfaultfd.c +++ b/userfaultfd.c @@ -1,31 +1,13 @@ /* * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" +#include "print_fields.h" #include #include "xlat/uffd_flags.h" @@ -41,6 +23,7 @@ SYS_FUNC(userfaultfd) # include # include +# include "xlat/uffd_api_features.h" # include "xlat/uffd_api_flags.h" # include "xlat/uffd_copy_flags.h" # include "xlat/uffd_register_ioctl_flags.h" @@ -50,110 +33,149 @@ SYS_FUNC(userfaultfd) static void tprintf_uffdio_range(const struct uffdio_range *range) { - tprintf("{start=%#" PRI__x64 ", len=%#" PRI__x64 "}", - range->start, range->len); + PRINT_FIELD_X("{", *range, start); + PRINT_FIELD_X(", ", *range, len); + tprints("}"); } +# define PRINT_FIELD_UFFDIO_RANGE(prefix_, where_, field_) \ + do { \ + STRACE_PRINTF("%s%s=", (prefix_), #field_); \ + tprintf_uffdio_range(&(where_).field_); \ + } while (0) + int uffdio_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t arg) { switch (code) { case UFFDIO_API: { + uint64_t *entering_features; struct uffdio_api ua; + if (entering(tcp)) { tprints(", "); if (umove_or_printaddr(tcp, arg, &ua)) - return RVAL_DECODED | 1; - /* Features is intended to contain some flags, but - * there aren't any defined yet. - */ - tprintf("{api=%#" PRI__x64 - ", features=%#" PRI__x64, - ua.api, ua.features); - } else { - if (!syserror(tcp) && !umove(tcp, arg, &ua)) { - tprintf(", features.out=%#" PRI__x64 - ", ioctls=", ua.features); - printflags64(uffd_api_flags, ua.ioctls, - "_UFFDIO_???"); + break; + PRINT_FIELD_X("{", ua, api); + PRINT_FIELD_FLAGS(", ", ua, features, uffd_api_features, + "UFFD_FEATURE_???"); + entering_features = malloc(sizeof(*entering_features)); + if (entering_features) { + *entering_features = ua.features; + set_tcb_priv_data(tcp, entering_features, free); + } + + return 0; + } + + if (!syserror(tcp) && !umove(tcp, arg, &ua)) { + entering_features = get_tcb_priv_data(tcp); + + if (!entering_features + || *entering_features != ua.features) { + PRINT_FIELD_FLAGS(" => ", ua, features, + uffd_api_features, + "UFFD_FEATURE_???"); } - tprints("}"); + + PRINT_FIELD_FLAGS(", ", ua, ioctls, uffd_api_flags, + "_UFFDIO_???"); } - return 1; + + tprints("}"); + + break; } case UFFDIO_COPY: { struct uffdio_copy uc; + if (entering(tcp)) { tprints(", "); if (umove_or_printaddr(tcp, arg, &uc)) - return RVAL_DECODED | 1; - tprintf("{dst=%#" PRI__x64 ", src=%#" PRI__x64 - ", len=%#" PRI__x64 ", mode=", - uc.dst, uc.src, uc.len); - printflags64(uffd_copy_flags, uc.mode, - "UFFDIO_COPY_???"); - } else { - if (!syserror(tcp) && !umove(tcp, arg, &uc)) - tprintf(", copy=%#" PRI__x64, uc.copy); - tprints("}"); + return RVAL_IOCTL_DECODED; + PRINT_FIELD_X("{", uc, dst); + PRINT_FIELD_X(", ", uc, src); + PRINT_FIELD_X(", ", uc, len); + PRINT_FIELD_FLAGS(", ", uc, mode, uffd_copy_flags, + "UFFDIO_COPY_???"); + + return 0; } - return 1; + + if (!syserror(tcp) && !umove(tcp, arg, &uc)) + PRINT_FIELD_X(", ", uc, copy); + + tprints("}"); + + break; } case UFFDIO_REGISTER: { struct uffdio_register ur; + if (entering(tcp)) { tprints(", "); if (umove_or_printaddr(tcp, arg, &ur)) - return RVAL_DECODED | 1; - tprints("{range="); - tprintf_uffdio_range(&ur.range); - tprints(", mode="); - printflags64(uffd_register_mode_flags, ur.mode, - "UFFDIO_REGISTER_MODE_???"); - } else { - if (!syserror(tcp) && !umove(tcp, arg, &ur)) { - tprints(", ioctls="); - printflags64(uffd_register_ioctl_flags, - ur.ioctls, "UFFDIO_???"); - } - tprints("}"); + return RVAL_IOCTL_DECODED; + PRINT_FIELD_UFFDIO_RANGE("{", ur, range); + PRINT_FIELD_FLAGS(", ", ur, mode, + uffd_register_mode_flags, + "UFFDIO_REGISTER_MODE_???"); + + return 0; + } + + if (!syserror(tcp) && !umove(tcp, arg, &ur)) { + PRINT_FIELD_FLAGS(", ", ur, ioctls, + uffd_register_ioctl_flags, + "UFFDIO_???"); } - return 1; + + tprints("}"); + + break; } case UFFDIO_UNREGISTER: case UFFDIO_WAKE: { struct uffdio_range ura; + tprints(", "); + if (!umove_or_printaddr(tcp, arg, &ura)) tprintf_uffdio_range(&ura); - return RVAL_DECODED | 1; + + break; } case UFFDIO_ZEROPAGE: { struct uffdio_zeropage uz; + if (entering(tcp)) { tprints(", "); if (umove_or_printaddr(tcp, arg, &uz)) - return RVAL_DECODED | 1; - tprints("{range="); - tprintf_uffdio_range(&uz.range); - tprints(", mode="); - printflags64(uffd_zeropage_flags, uz.mode, - "UFFDIO_ZEROPAGE_???"); - } else { - if (!syserror(tcp) && !umove(tcp, arg, &uz)) - tprintf(", zeropage=%#" PRI__x64, uz.zeropage); - tprints("}"); + return RVAL_IOCTL_DECODED; + PRINT_FIELD_UFFDIO_RANGE("{", uz, range); + PRINT_FIELD_FLAGS(", ", uz, mode, uffd_zeropage_flags, + "UFFDIO_ZEROPAGE_???"); + + return 0; } - return 1; + + if (!syserror(tcp) && !umove(tcp, arg, &uz)) + PRINT_FIELD_X(", ", uz, zeropage); + + tprints("}"); + + break; } default: return RVAL_DECODED; } + + return RVAL_IOCTL_DECODED; } #endif /* HAVE_LINUX_USERFAULTFD_H */ diff --git a/ustat.c b/ustat.c index 76550632..814ed431 100644 --- a/ustat.c +++ b/ustat.c @@ -1,28 +1,9 @@ /* * Copyright (c) 2017 JingPiao Chen + * Copyright (c) 2017-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/util.c b/util.c index a38f8217..fa384c59 100644 --- a/util.c +++ b/util.c @@ -6,164 +6,89 @@ * Copyright (c) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation * Linux for s390 port by D.J. Barrow * + * Copyright (c) 1999-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" -#include +#include #include #include +#include +#include #ifdef HAVE_SYS_XATTR_H # include #endif #include -#include - -#include "scno.h" -#include "regs.h" -#include "ptrace.h" - -int -string_to_uint_ex(const char *const str, char **const endptr, - const unsigned int max_val, const char *const accepted_ending) -{ - char *end; - long val; - - if (!*str) - return -1; - - errno = 0; - val = strtol(str, &end, 10); - - if (str == end || val < 0 || (unsigned long) val > max_val - || (val == LONG_MAX && errno == ERANGE)) - return -1; - - if (*end && (!accepted_ending || !strchr(accepted_ending, *end))) - return -1; - - if (endptr) - *endptr = end; - - return (int) val; -} -int -string_to_uint(const char *const str) -{ - return string_to_uint_upto(str, INT_MAX); -} +#include "largefile_wrappers.h" +#include "print_utils.h" +#include "static_assert.h" +#include "xlat.h" +#include "xstring.h" int -tv_nz(const struct timeval *a) +ts_nz(const struct timespec *a) { - return a->tv_sec || a->tv_usec; + return a->tv_sec || a->tv_nsec; } int -tv_cmp(const struct timeval *a, const struct timeval *b) +ts_cmp(const struct timespec *a, const struct timespec *b) { if (a->tv_sec < b->tv_sec - || (a->tv_sec == b->tv_sec && a->tv_usec < b->tv_usec)) + || (a->tv_sec == b->tv_sec && a->tv_nsec < b->tv_nsec)) return -1; if (a->tv_sec > b->tv_sec - || (a->tv_sec == b->tv_sec && a->tv_usec > b->tv_usec)) + || (a->tv_sec == b->tv_sec && a->tv_nsec > b->tv_nsec)) return 1; return 0; } double -tv_float(const struct timeval *tv) +ts_float(const struct timespec *tv) { - return tv->tv_sec + tv->tv_usec/1000000.0; + return tv->tv_sec + tv->tv_nsec/1000000000.0; } void -tv_add(struct timeval *tv, const struct timeval *a, const struct timeval *b) +ts_add(struct timespec *tv, const struct timespec *a, const struct timespec *b) { tv->tv_sec = a->tv_sec + b->tv_sec; - tv->tv_usec = a->tv_usec + b->tv_usec; - if (tv->tv_usec >= 1000000) { + tv->tv_nsec = a->tv_nsec + b->tv_nsec; + if (tv->tv_nsec >= 1000000000) { tv->tv_sec++; - tv->tv_usec -= 1000000; + tv->tv_nsec -= 1000000000; } } void -tv_sub(struct timeval *tv, const struct timeval *a, const struct timeval *b) +ts_sub(struct timespec *tv, const struct timespec *a, const struct timespec *b) { tv->tv_sec = a->tv_sec - b->tv_sec; - tv->tv_usec = a->tv_usec - b->tv_usec; - if (((long) tv->tv_usec) < 0) { + tv->tv_nsec = a->tv_nsec - b->tv_nsec; + if (tv->tv_nsec < 0) { tv->tv_sec--; - tv->tv_usec += 1000000; + tv->tv_nsec += 1000000000; } } void -tv_div(struct timeval *tv, const struct timeval *a, int n) +ts_div(struct timespec *tv, const struct timespec *a, int n) { - tv->tv_usec = (a->tv_sec % n * 1000000 + a->tv_usec + n / 2) / n; - tv->tv_sec = a->tv_sec / n + tv->tv_usec / 1000000; - tv->tv_usec %= 1000000; + long long nsec = (a->tv_sec % n * 1000000000LL + a->tv_nsec + n / 2) / n; + tv->tv_sec = a->tv_sec / n + nsec / 1000000000; + tv->tv_nsec = nsec % 1000000000; } void -tv_mul(struct timeval *tv, const struct timeval *a, int n) -{ - tv->tv_usec = a->tv_usec * n; - tv->tv_sec = a->tv_sec * n + tv->tv_usec / 1000000; - tv->tv_usec %= 1000000; -} - -const char * -xlookup(const struct xlat *xlat, const uint64_t val) +ts_mul(struct timespec *tv, const struct timespec *a, int n) { - for (; xlat->str != NULL; xlat++) - if (xlat->val == val) - return xlat->str; - return NULL; -} - -static int -xlat_bsearch_compare(const void *a, const void *b) -{ - const uint64_t val1 = *(const uint64_t *) a; - const uint64_t val2 = ((const struct xlat *) b)->val; - return (val1 > val2) ? 1 : (val1 < val2) ? -1 : 0; -} - -const char * -xlat_search(const struct xlat *xlat, const size_t nmemb, const uint64_t val) -{ - const struct xlat *e = - bsearch((const void*) &val, - xlat, nmemb, sizeof(*xlat), xlat_bsearch_compare); - - return e ? e->str : NULL; + long long nsec = a->tv_nsec * n; + tv->tv_sec = a->tv_sec * n + nsec / 1000000000; + tv->tv_nsec = nsec % 1000000000; } #if !defined HAVE_STPCPY @@ -190,7 +115,7 @@ int next_set_bit(const void *bit_array, unsigned cur_bit, unsigned size_bits) { const unsigned endian = 1; - int little_endian = * (char *) (void *) &endian; + int little_endian = *(char *) (void *) &endian; const uint8_t *array = bit_array; unsigned pos = cur_bit / 8; @@ -224,73 +149,6 @@ next_set_bit(const void *bit_array, unsigned cur_bit, unsigned size_bits) } } -/** - * Print entry in struct xlat table, if there. - * - * @param val Value to search a literal representation for. - * @param dflt String (abbreviated in comment syntax) which should be emitted - * if no appropriate xlat value has been found. - * @param xlat (And the following arguments) Pointers to arrays of xlat values. - * The last argument should be NULL. - * @return 1 if appropriate xlat value has been found, 0 otherwise. - */ -int -printxvals(const uint64_t val, const char *dflt, const struct xlat *xlat, ...) -{ - va_list args; - - va_start(args, xlat); - for (; xlat; xlat = va_arg(args, const struct xlat *)) { - const char *str = xlookup(xlat, val); - - if (str) { - tprints(str); - va_end(args); - return 1; - } - } - /* No hits -- print raw # instead. */ - tprintf("%#" PRIx64, val); - if (dflt) - tprintf(" /* %s */", dflt); - - va_end(args); - - return 0; -} - -/** - * Print entry in sorted struct xlat table, if it is there. - * - * @param xlat Pointer to an array of xlat values (not terminated with - * XLAT_END). - * @param xlat_size Number of xlat elements present in array (usually ARRAY_SIZE - * if array is declared in the unit's scope and not - * terminated with XLAT_END). - * @param val Value to search literal representation for. - * @param dflt String (abbreviated in comment syntax) which should be - * emitted if no appropriate xlat value has been found. - * @return 1 if appropriate xlat value has been found, 0 - * otherwise. - */ -int -printxval_searchn(const struct xlat *xlat, size_t xlat_size, uint64_t val, - const char *dflt) -{ - const char *s = xlat_search(xlat, xlat_size, val); - - if (s) { - tprints(s); - return 1; - } - - tprintf("%#" PRIx64, val); - if (dflt) - tprintf(" /* %s */", dflt); - - return 0; -} - /* * Fetch 64bit argument at position arg_no and * return the index of the next argument. @@ -314,10 +172,10 @@ getllval(struct tcb *tcp, unsigned long long *val, int arg_no) arg_no++; } #else /* SIZEOF_KERNEL_LONG_T == 4 */ -# if defined __ARM_EABI__ || \ - defined LINUX_MIPSO32 || \ - defined POWERPC || \ - defined XTENSA +# if defined __ARM_EABI__ \ + || defined LINUX_MIPSO32 \ + || defined POWERPC \ + || defined XTENSA /* Align arg_no to the next even number. */ arg_no = (arg_no + 1) & 0xe; # elif defined SH @@ -352,111 +210,13 @@ printllval(struct tcb *tcp, const char *format, int arg_no) return arg_no; } -/* - * Interpret `xlat' as an array of flags - * print the entries whose bits are on in `flags' - * return # of flags printed. - */ -void -addflags(const struct xlat *xlat, uint64_t flags) -{ - for (; xlat->str; xlat++) { - if (xlat->val && (flags & xlat->val) == xlat->val) { - tprintf("|%s", xlat->str); - flags &= ~xlat->val; - } - } - if (flags) { - tprintf("|%#" PRIx64, flags); - } -} - -/* - * Interpret `xlat' as an array of flags. - * Print to static string the entries whose bits are on in `flags' - * Return static string. - */ -const char * -sprintflags(const char *prefix, const struct xlat *xlat, uint64_t flags) -{ - static char outstr[1024]; - char *outptr; - int found = 0; - - outptr = stpcpy(outstr, prefix); - - if (flags == 0 && xlat->val == 0 && xlat->str) { - strcpy(outptr, xlat->str); - return outstr; - } - - for (; xlat->str; xlat++) { - if (xlat->val && (flags & xlat->val) == xlat->val) { - if (found) - *outptr++ = '|'; - outptr = stpcpy(outptr, xlat->str); - found = 1; - flags &= ~xlat->val; - if (!flags) - break; - } - } - if (flags) { - if (found) - *outptr++ = '|'; - outptr += sprintf(outptr, "%#" PRIx64, flags); - } - - return outstr; -} - -int -printflags64(const struct xlat *xlat, uint64_t flags, const char *dflt) -{ - int n; - const char *sep; - - if (flags == 0 && xlat->val == 0 && xlat->str) { - tprints(xlat->str); - return 1; - } - - sep = ""; - for (n = 0; xlat->str; xlat++) { - if (xlat->val && (flags & xlat->val) == xlat->val) { - tprintf("%s%s", sep, xlat->str); - flags &= ~xlat->val; - sep = "|"; - n++; - } - } - - if (n) { - if (flags) { - tprintf("%s%#" PRIx64, sep, flags); - n++; - } - } else { - if (flags) { - tprintf("%#" PRIx64, flags); - if (dflt) - tprintf(" /* %s */", dflt); - } else { - if (dflt) - tprints("0"); - } - } - - return n; -} - void -printaddr(const kernel_ulong_t addr) +printaddr64(const uint64_t addr) { if (!addr) tprints("NULL"); else - tprintf("%#" PRI_klx, addr); + tprintf("%#" PRIx64, addr); } #define DEF_PRINTNUM(name, type) \ @@ -481,7 +241,7 @@ printnum_addr_ ## name(struct tcb *tcp, const kernel_ulong_t addr) \ if (umove_or_printaddr(tcp, addr, &num)) \ return false; \ tprints("["); \ - printaddr(num); \ + printaddr64(num); \ tprints("]"); \ return true; \ } @@ -545,23 +305,89 @@ printnum_addr_klong_int(struct tcb *tcp, const kernel_ulong_t addr) } #endif /* !current_klongsize */ +/** + * Prints time to a (static internal) buffer and returns pointer to it. + * Returns NULL if the provided time specification is not correct. + * + * @param sec Seconds since epoch. + * @param part_sec Amount of second parts since the start of a second. + * @param max_part_sec Maximum value of a valid part_sec. + * @param width 1 + floor(log10(max_part_sec)). + * @return Pointer to a statically allocated string on success, + * NULL on error. + */ +static const char * +sprinttime_ex(const long long sec, const unsigned long long part_sec, + const unsigned int max_part_sec, const int width) +{ + static char buf[sizeof(int) * 3 * 6 + sizeof(part_sec) * 3 + + sizeof("+0000")]; + + if ((sec == 0 && part_sec == 0) || part_sec > max_part_sec) + return NULL; + + time_t t = (time_t) sec; + struct tm *tmp = (sec == t) ? localtime(&t) : NULL; + if (!tmp) + return NULL; + + size_t pos = strftime(buf, sizeof(buf), "%FT%T", tmp); + if (!pos) + return NULL; + + if (part_sec > 0) + pos += xsnprintf(buf + pos, sizeof(buf) - pos, ".%0*llu", + width, part_sec); + + return strftime(buf + pos, sizeof(buf) - pos, "%z", tmp) ? buf : NULL; +} + const char * -sprinttime(time_t t) +sprinttime(long long sec) { - struct tm *tmp; - static char buf[sizeof(int) * 3 * 6 + sizeof("+0000")]; + return sprinttime_ex(sec, 0, 0, 0); +} - if (t == 0) { - strcpy(buf, "0"); - return buf; - } - tmp = localtime(&t); - if (tmp) - strftime(buf, sizeof(buf), "%FT%T%z", tmp); - else - snprintf(buf, sizeof(buf), "%lu", (unsigned long) t); +const char * +sprinttime_usec(long long sec, unsigned long long usec) +{ + return sprinttime_ex(sec, usec, 999999, 6); +} - return buf; +const char * +sprinttime_nsec(long long sec, unsigned long long nsec) +{ + return sprinttime_ex(sec, nsec, 999999999, 9); +} + +void +print_uuid(const unsigned char *uuid) +{ + const char str[] = { + BYTE_HEX_CHARS(uuid[0]), + BYTE_HEX_CHARS(uuid[1]), + BYTE_HEX_CHARS(uuid[2]), + BYTE_HEX_CHARS(uuid[3]), + '-', + BYTE_HEX_CHARS(uuid[4]), + BYTE_HEX_CHARS(uuid[5]), + '-', + BYTE_HEX_CHARS(uuid[6]), + BYTE_HEX_CHARS(uuid[7]), + '-', + BYTE_HEX_CHARS(uuid[8]), + BYTE_HEX_CHARS(uuid[9]), + '-', + BYTE_HEX_CHARS(uuid[10]), + BYTE_HEX_CHARS(uuid[11]), + BYTE_HEX_CHARS(uuid[12]), + BYTE_HEX_CHARS(uuid[13]), + BYTE_HEX_CHARS(uuid[14]), + BYTE_HEX_CHARS(uuid[15]), + '\0' + }; + + tprints(str); } enum sock_proto @@ -576,7 +402,7 @@ getfdproto(struct tcb *tcp, int fd) if (fd < 0) return SOCK_PROTO_UNKNOWN; - sprintf(path, "/proc/%u/fd/%u", tcp->pid, fd); + xsprintf(path, "/proc/%u/fd/%u", tcp->pid, fd); r = getxattr(path, "system.sockprotoname", buf, bufsize - 1); if (r <= 0) return SOCK_PROTO_UNKNOWN; @@ -594,31 +420,77 @@ getfdproto(struct tcb *tcp, int fd) #endif } +unsigned long +getfdinode(struct tcb *tcp, int fd) +{ + char path[PATH_MAX + 1]; + + if (getfdpath(tcp, fd, path, sizeof(path)) >= 0) { + const char *str = STR_STRIP_PREFIX(path, "socket:["); + + if (str != path) { + const size_t str_len = strlen(str); + if (str_len && str[str_len - 1] == ']') + return strtoul(str, NULL, 10); + } + } + + return 0; +} + +static bool +printsocket(struct tcb *tcp, int fd, const char *path) +{ + const char *str = STR_STRIP_PREFIX(path, "socket:["); + size_t len; + unsigned long inode; + + return (str != path) + && (len = strlen(str)) + && (str[len - 1] == ']') + && (inode = strtoul(str, NULL, 10)) + && print_sockaddr_by_inode(tcp, fd, inode); +} + +static bool +printdev(struct tcb *tcp, int fd, const char *path) +{ + strace_stat_t st; + + if (path[0] != '/') + return false; + + if (stat_file(path, &st)) { + debug_func_perror_msg("stat(\"%s\")", path); + return false; + } + + switch (st.st_mode & S_IFMT) { + case S_IFBLK: + case S_IFCHR: + print_quoted_string_ex(path, strlen(path), + QUOTE_OMIT_LEADING_TRAILING_QUOTES, + "<>"); + tprintf("<%s %u:%u>", + S_ISBLK(st.st_mode)? "block" : "char", + major(st.st_rdev), minor(st.st_rdev)); + return true; + } + + return false; +} + void printfd(struct tcb *tcp, int fd) { char path[PATH_MAX + 1]; if (show_fd_path && getfdpath(tcp, fd, path, sizeof(path)) >= 0) { - static const char socket_prefix[] = "socket:["; - const size_t socket_prefix_len = sizeof(socket_prefix) - 1; - const size_t path_len = strlen(path); - tprintf("%d<", fd); - if (show_fd_path > 1 && - strncmp(path, socket_prefix, socket_prefix_len) == 0 && - path[path_len - 1] == ']') { - unsigned long inode = - strtoul(path + socket_prefix_len, NULL, 10); - - if (!print_sockaddr_by_inode_cached(inode)) { - const enum sock_proto proto = - getfdproto(tcp, fd); - if (!print_sockaddr_by_inode(inode, proto)) - tprints(path); - } - } else { - print_quoted_string(path, path_len, - QUOTE_OMIT_LEADING_TRAILING_QUOTES); + if (show_fd_path <= 1 + || (!printsocket(tcp, fd, path) + && !printdev(tcp, fd, path))) { + print_quoted_string_ex(path, strlen(path), + QUOTE_OMIT_LEADING_TRAILING_QUOTES, "<>"); } tprints(">"); } else @@ -629,6 +501,9 @@ printfd(struct tcb *tcp, int fd) * Quote string `instr' of length `size' * Write up to (3 + `size' * 4) bytes to `outstr' buffer. * + * `escape_chars' specifies characters (in addition to characters with + * codes 0..31, 127..255, single and double quotes) that should be escaped. + * * If QUOTE_0_TERMINATED `style' flag is set, * treat `instr' as a NUL-terminated string, * checking up to (`size' + 1) bytes of `instr'. @@ -641,12 +516,13 @@ printfd(struct tcb *tcp, int fd) */ int string_quote(const char *instr, char *outstr, const unsigned int size, - const unsigned int style) + const unsigned int style, const char *escape_chars) { const unsigned char *ustr = (const unsigned char *) instr; char *s = outstr; unsigned int i; int usehex, c, eol; + bool printable; if (style & QUOTE_0_TERMINATED) eol = '\0'; @@ -680,6 +556,8 @@ string_quote(const char *instr, char *outstr, const unsigned int size, } } + if (style & QUOTE_EMIT_COMMENT) + s = stpcpy(s, " /* "); if (!(style & QUOTE_OMIT_LEADING_TRAILING_QUOTES)) *s++ = '\"'; @@ -692,73 +570,81 @@ string_quote(const char *instr, char *outstr, const unsigned int size, goto asciz_ended; *s++ = '\\'; *s++ = 'x'; - *s++ = "0123456789abcdef"[c >> 4]; - *s++ = "0123456789abcdef"[c & 0xf]; + s = sprint_byte_hex(s, c); } - } else { - for (i = 0; i < size; ++i) { - c = ustr[i]; - /* Check for NUL-terminated string. */ - if (c == eol) - goto asciz_ended; - if ((i == (size - 1)) && - (style & QUOTE_OMIT_TRAILING_0) && (c == '\0')) - goto asciz_ended; - switch (c) { - case '\"': case '\\': - *s++ = '\\'; - *s++ = c; - break; - case '\f': - *s++ = '\\'; - *s++ = 'f'; - break; - case '\n': - *s++ = '\\'; - *s++ = 'n'; - break; - case '\r': - *s++ = '\\'; - *s++ = 'r'; - break; - case '\t': - *s++ = '\\'; - *s++ = 't'; - break; - case '\v': - *s++ = '\\'; - *s++ = 'v'; - break; - default: - if (c >= ' ' && c <= 0x7e) - *s++ = c; - else { - /* Print \octal */ - *s++ = '\\'; - if (i + 1 < size - && ustr[i + 1] >= '0' - && ustr[i + 1] <= '9' - ) { - /* Print \ooo */ + + goto string_ended; + } + + for (i = 0; i < size; ++i) { + c = ustr[i]; + /* Check for NUL-terminated string. */ + if (c == eol) + goto asciz_ended; + if ((i == (size - 1)) && + (style & QUOTE_OMIT_TRAILING_0) && (c == '\0')) + goto asciz_ended; + switch (c) { + case '\"': case '\\': + *s++ = '\\'; + *s++ = c; + break; + case '\f': + *s++ = '\\'; + *s++ = 'f'; + break; + case '\n': + *s++ = '\\'; + *s++ = 'n'; + break; + case '\r': + *s++ = '\\'; + *s++ = 'r'; + break; + case '\t': + *s++ = '\\'; + *s++ = 't'; + break; + case '\v': + *s++ = '\\'; + *s++ = 'v'; + break; + default: + printable = is_print(c); + + if (printable && escape_chars) + printable = !strchr(escape_chars, c); + + if (printable) { + *s++ = c; + } else { + /* Print \octal */ + *s++ = '\\'; + if (i + 1 < size + && ustr[i + 1] >= '0' + && ustr[i + 1] <= '7' + ) { + /* Print \ooo */ + *s++ = '0' + (c >> 6); + *s++ = '0' + ((c >> 3) & 0x7); + } else { + /* Print \[[o]o]o */ + if ((c >> 3) != 0) { + if ((c >> 6) != 0) *s++ = '0' + (c >> 6); - *s++ = '0' + ((c >> 3) & 0x7); - } else { - /* Print \[[o]o]o */ - if ((c >> 3) != 0) { - if ((c >> 6) != 0) - *s++ = '0' + (c >> 6); - *s++ = '0' + ((c >> 3) & 0x7); - } - } - *s++ = '0' + (c & 0x7); + *s++ = '0' + ((c >> 3) & 0x7); } - break; + } + *s++ = '0' + (c & 0x7); } } } + string_ended: if (!(style & QUOTE_OMIT_LEADING_TRAILING_QUOTES)) *s++ = '\"'; + if (style & QUOTE_EMIT_COMMENT) + s = stpcpy(s, " */"); *s = '\0'; /* Return zero if we printed entire ASCIZ string (didn't truncate it) */ @@ -774,6 +660,8 @@ string_quote(const char *instr, char *outstr, const unsigned int size, asciz_ended: if (!(style & QUOTE_OMIT_LEADING_TRAILING_QUOTES)) *s++ = '\"'; + if (style & QUOTE_EMIT_COMMENT) + s = stpcpy(s, " */"); *s = '\0'; /* Return zero: we printed entire ASCIZ string (didn't truncate it) */ return 0; @@ -798,8 +686,8 @@ string_quote(const char *instr, char *outstr, const unsigned int size, * Note that if QUOTE_0_TERMINATED is not set, always returns 1. */ int -print_quoted_string(const char *str, unsigned int size, - const unsigned int style) +print_quoted_string_ex(const char *str, unsigned int size, + const unsigned int style, const char *escape_chars) { char *buf; char *outstr; @@ -811,11 +699,13 @@ print_quoted_string(const char *str, unsigned int size, alloc_size = 4 * size; if (alloc_size / 4 != size) { - error_msg("Out of memory"); + error_func_msg("requested %u bytes exceeds %u bytes limit", + size, -1U / 4); tprints("???"); return -1; } - alloc_size += 1 + (style & QUOTE_OMIT_LEADING_TRAILING_QUOTES ? 0 : 2); + alloc_size += 1 + (style & QUOTE_OMIT_LEADING_TRAILING_QUOTES ? 0 : 2) + + (style & QUOTE_EMIT_COMMENT ? 7 : 0); if (use_alloca(alloc_size)) { outstr = alloca(alloc_size); @@ -823,55 +713,83 @@ print_quoted_string(const char *str, unsigned int size, } else { outstr = buf = malloc(alloc_size); if (!buf) { - error_msg("Out of memory"); + error_func_msg("memory exhausted when tried to allocate" + " %u bytes", alloc_size); tprints("???"); return -1; } } - rc = string_quote(str, outstr, size, style); + rc = string_quote(str, outstr, size, style, escape_chars); tprints(outstr); free(buf); return rc; } +inline int +print_quoted_string(const char *str, unsigned int size, + const unsigned int style) +{ + return print_quoted_string_ex(str, size, style, NULL); +} + +/* + * Quote a NUL-terminated string `str' of length up to `size' - 1 + * and print the result. + * + * Returns 0 if NUL was seen, 1 otherwise. + */ +int +print_quoted_cstring(const char *str, unsigned int size) +{ + int unterminated = + print_quoted_string(str, size, QUOTE_0_TERMINATED); + + if (unterminated) + tprints("..."); + + return unterminated; +} + /* * Print path string specified by address `addr' and length `n'. * If path length exceeds `n', append `...' to the output. + * + * Returns the result of umovenstr. */ -void +int printpathn(struct tcb *const tcp, const kernel_ulong_t addr, unsigned int n) { - char path[PATH_MAX + 1]; + char path[PATH_MAX]; int nul_seen; if (!addr) { tprints("NULL"); - return; + return -1; } /* Cap path length to the path buffer size */ - if (n > sizeof path - 1) - n = sizeof path - 1; + if (n > sizeof(path) - 1) + n = sizeof(path) - 1; /* Fetch one byte more to find out whether path length > n. */ nul_seen = umovestr(tcp, addr, n + 1, path); if (nul_seen < 0) printaddr(addr); else { - path[n++] = '\0'; - print_quoted_string(path, n, QUOTE_0_TERMINATED); - if (!nul_seen) - tprints("..."); + path[n++] = !nul_seen; + print_quoted_cstring(path, n); } + + return nul_seen; } -void +int printpath(struct tcb *const tcp, const kernel_ulong_t addr) { /* Size must correspond to char path[] size in printpathn */ - printpathn(tcp, addr, PATH_MAX); + return printpathn(tcp, addr, PATH_MAX - 1); } /* @@ -881,13 +799,17 @@ printpath(struct tcb *const tcp, const kernel_ulong_t addr) * Pass `user_style' on to `string_quote'. * Append `...' to the output if either the string length exceeds `max_strlen', * or QUOTE_0_TERMINATED bit is set and the string length exceeds `len'. + * + * Returns the result of umovenstr if style has QUOTE_0_TERMINATED, + * or the result of umoven otherwise. */ -void +int printstr_ex(struct tcb *const tcp, const kernel_ulong_t addr, const kernel_ulong_t len, const unsigned int user_style) { - static char *str = NULL; + static char *str; static char *outstr; + unsigned int size; unsigned int style = user_style; int rc; @@ -895,14 +817,17 @@ printstr_ex(struct tcb *const tcp, const kernel_ulong_t addr, if (!addr) { tprints("NULL"); - return; + return -1; } /* Allocate static buffers if they are not allocated yet. */ if (!str) { - unsigned int outstr_size = 4 * max_strlen + /*for quotes and NUL:*/ 3; + const unsigned int outstr_size = + 4 * max_strlen + /* for quotes and NUL */ 3; + /* + * We can assume that outstr_size / 4 == max_strlen + * since we have a guarantee that max_strlen <= -1U / 4. + */ - if (outstr_size / 4 != max_strlen) - die_out_of_memory(); str = xmalloc(max_strlen + 1); outstr = xmalloc(outstr_size); } @@ -919,7 +844,7 @@ printstr_ex(struct tcb *const tcp, const kernel_ulong_t addr, if (rc < 0) { printaddr(addr); - return; + return rc; } if (size > max_strlen) @@ -930,7 +855,7 @@ printstr_ex(struct tcb *const tcp, const kernel_ulong_t addr, /* If string_quote didn't see NUL and (it was supposed to be ASCIZ str * or we were requested to print more than -s NUM chars)... */ - ellipsis = string_quote(str, outstr, size, style) + ellipsis = string_quote(str, outstr, size, style, NULL) && len && ((style & QUOTE_0_TERMINATED) || len > max_strlen); @@ -938,6 +863,8 @@ printstr_ex(struct tcb *const tcp, const kernel_ulong_t addr, tprints(outstr); if (ellipsis) tprints("..."); + + return rc; } void @@ -949,27 +876,32 @@ dumpiov_upto(struct tcb *const tcp, const int len, const kernel_ulong_t addr, struct { uint32_t base; uint32_t len; } *iov32; struct { uint64_t base; uint64_t len; } *iov64; } iovu; -#define iov iovu.iov64 -#define sizeof_iov \ - (current_wordsize == 4 ? sizeof(*iovu.iov32) : sizeof(*iovu.iov64)) -#define iov_iov_base(i) \ +# define iov iovu.iov64 +# define sizeof_iov \ + (current_wordsize == 4 ? (unsigned int) sizeof(*iovu.iov32) \ + : (unsigned int) sizeof(*iovu.iov64)) +# define iov_iov_base(i) \ (current_wordsize == 4 ? (uint64_t) iovu.iov32[i].base : iovu.iov64[i].base) -#define iov_iov_len(i) \ +# define iov_iov_len(i) \ (current_wordsize == 4 ? (uint64_t) iovu.iov32[i].len : iovu.iov64[i].len) #else struct iovec *iov; -#define sizeof_iov sizeof(*iov) -#define iov_iov_base(i) ptr_to_kulong(iov[i].iov_base) -#define iov_iov_len(i) iov[i].iov_len +# define sizeof_iov ((unsigned int) sizeof(*iov)) +# define iov_iov_base(i) ptr_to_kulong(iov[i].iov_base) +# define iov_iov_len(i) iov[i].iov_len #endif int i; - unsigned size; + unsigned int size = sizeof_iov * len; + if (size / sizeof_iov != (unsigned int) len) { + error_func_msg("requested %u iovec elements exceeds" + " %u iovec limit", len, -1U / sizeof_iov); + return; + } - size = sizeof_iov * len; - /* Assuming no sane program has millions of iovs */ - if ((unsigned)len > 1024*1024 /* insane or negative size? */ - || (iov = malloc(size)) == NULL) { - error_msg("Out of memory"); + iov = malloc(size); + if (!iov) { + error_func_msg("memory exhausted when tried to allocate" + " %u bytes", size); return; } if (umoven(tcp, addr, size, iov) >= 0) { @@ -993,415 +925,264 @@ dumpiov_upto(struct tcb *const tcp, const int len, const kernel_ulong_t addr, #undef iov } +#define ILOG2_ITER_(val_, ret_, bit_) \ + do { \ + typeof(ret_) shift_ = \ + ((val_) > ((((typeof(val_)) 1) \ + << (1 << (bit_))) - 1)) << (bit_); \ + (val_) >>= shift_; \ + (ret_) |= shift_; \ + } while (0) + +/** + * Calculate floor(log2(val)), with the exception of val == 0, for which 0 + * is returned as well. + * + * @param val 64-bit value to calculate integer base-2 logarithm for. + * @return (unsigned int) floor(log2(val)) if val > 0, 0 if val == 0. + */ +static inline unsigned int +ilog2_64(uint64_t val) +{ + unsigned int ret = 0; + + ILOG2_ITER_(val, ret, 5); + ILOG2_ITER_(val, ret, 4); + ILOG2_ITER_(val, ret, 3); + ILOG2_ITER_(val, ret, 2); + ILOG2_ITER_(val, ret, 1); + ILOG2_ITER_(val, ret, 0); + + return ret; +} + +/** + * Calculate floor(log2(val)), with the exception of val == 0, for which 0 + * is returned as well. + * + * @param val 32-bit value to calculate integer base-2 logarithm for. + * @return (unsigned int) floor(log2(val)) if val > 0, 0 if val == 0. + */ +static inline unsigned int +ilog2_32(uint32_t val) +{ + unsigned int ret = 0; + + ILOG2_ITER_(val, ret, 4); + ILOG2_ITER_(val, ret, 3); + ILOG2_ITER_(val, ret, 2); + ILOG2_ITER_(val, ret, 1); + ILOG2_ITER_(val, ret, 0); + + return ret; +} + +#undef ILOG2_ITER_ + +#if SIZEOF_KERNEL_LONG_T > 4 +# define ilog2_klong ilog2_64 +#else +# define ilog2_klong ilog2_32 +#endif + void -dumpstr(struct tcb *const tcp, const kernel_ulong_t addr, const int len) +dumpstr(struct tcb *const tcp, const kernel_ulong_t addr, + const kernel_ulong_t len) { - static int strsize = -1; - static unsigned char *str; + /* xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx 1234567890123456 */ + enum { + HEX_BIT = 4, - char outbuf[ - ( - (sizeof( - "xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx " - "1234567890123456") + /*in case I'm off by few:*/ 4) - /*align to 8 to make memset easier:*/ + 7) & -8 - ]; - const unsigned char *src; - int i; + DUMPSTR_GROUP_BYTES = 8, + DUMPSTR_GROUPS = 2, + DUMPSTR_WIDTH_BYTES = DUMPSTR_GROUP_BYTES * DUMPSTR_GROUPS, + + /** Width of formatted dump in characters. */ + DUMPSTR_WIDTH_CHARS = DUMPSTR_WIDTH_BYTES + + sizeof("xx") * DUMPSTR_WIDTH_BYTES + DUMPSTR_GROUPS, + + DUMPSTR_GROUP_MASK = DUMPSTR_GROUP_BYTES - 1, + DUMPSTR_BYTES_MASK = DUMPSTR_WIDTH_BYTES - 1, + + /** Minimal width of the offset field in the output. */ + DUMPSTR_OFFS_MIN_CHARS = 5, + + /** Arbitrarily chosen internal dumpstr buffer limit. */ + DUMPSTR_BUF_MAXSZ = 1 << 16, + }; + + static_assert(!(DUMPSTR_BUF_MAXSZ % DUMPSTR_WIDTH_BYTES), + "Maximum internal buffer size should be divisible " + "by amount of bytes dumped per line"); + static_assert(!(DUMPSTR_GROUP_BYTES & DUMPSTR_GROUP_MASK), + "DUMPSTR_GROUP_BYTES is not power of 2"); + static_assert(!(DUMPSTR_WIDTH_BYTES & DUMPSTR_BYTES_MASK), + "DUMPSTR_WIDTH_BYTES is not power of 2"); + + if (len > len + DUMPSTR_WIDTH_BYTES || addr + len < addr) { + debug_func_msg("len %" PRI_klu " at addr %#" PRI_klx + " is too big, skipped", len, addr); + return; + } + + static kernel_ulong_t strsize; + static unsigned char *str; - memset(outbuf, ' ', sizeof(outbuf)); + const kernel_ulong_t alloc_size = + MIN(ROUNDUP(len, DUMPSTR_WIDTH_BYTES), DUMPSTR_BUF_MAXSZ); - if (strsize < len + 16) { + if (strsize < alloc_size) { free(str); - str = malloc(len + 16); + str = malloc(alloc_size); if (!str) { - strsize = -1; - error_msg("Out of memory"); + strsize = 0; + error_func_msg("memory exhausted when tried to allocate" + " %" PRI_klu " bytes", alloc_size); return; } - strsize = len + 16; + strsize = alloc_size; } - if (umoven(tcp, addr, len, str) < 0) - return; - - /* Space-pad to 16 bytes */ - i = len; - while (i & 0xf) - str[i++] = ' '; + /** + * Characters needed in order to print the offset field. We calculate + * it this way in order to avoid ilog2_64 call most of the time. + */ + const int offs_chars = len > (1 << (DUMPSTR_OFFS_MIN_CHARS * HEX_BIT)) + ? 1 + ilog2_klong(len - 1) / HEX_BIT : DUMPSTR_OFFS_MIN_CHARS; + kernel_ulong_t i = 0; + const unsigned char *src; - i = 0; - src = str; while (i < len) { + /* + * It is important to overwrite all the byte values, as we + * re-use the buffer in order to avoid its re-initialisation. + */ + static char outbuf[] = { + [0 ... DUMPSTR_WIDTH_CHARS - 1] = ' ', + '\0' + }; char *dst = outbuf; - /* Hex dump */ + + /* Fetching data from tracee. */ + if (!i || (i % DUMPSTR_BUF_MAXSZ) == 0) { + kernel_ulong_t fetch_size = MIN(len - i, alloc_size); + + if (umoven(tcp, addr + i, fetch_size, str) < 0) { + /* + * Don't silently abort if we have printed + * something already. + */ + if (i) + tprintf(" | \n", + fetch_size, + fetch_size == 1 ? "" : "s", + tcp->pid, addr + i); + return; + } + src = str; + } + + /* hex dump */ do { if (i < len) { - *dst++ = "0123456789abcdef"[*src >> 4]; - *dst++ = "0123456789abcdef"[*src & 0xf]; - } - else { + dst = sprint_byte_hex(dst, *src); + } else { *dst++ = ' '; *dst++ = ' '; } - dst++; /* space is there by memset */ + dst++; /* space is there */ i++; - if ((i & 7) == 0) - dst++; /* space is there by memset */ + if ((i & DUMPSTR_GROUP_MASK) == 0) + dst++; /* space is there */ src++; - } while (i & 0xf); + } while (i & DUMPSTR_BYTES_MASK); + /* ASCII dump */ - i -= 16; - src -= 16; + i -= DUMPSTR_WIDTH_BYTES; + src -= DUMPSTR_WIDTH_BYTES; do { - if (*src >= ' ' && *src < 0x7f) - *dst++ = *src; - else - *dst++ = '.'; + if (i < len) { + if (is_print(*src)) + *dst++ = *src; + else + *dst++ = '.'; + } else { + *dst++ = ' '; + } src++; - } while (++i & 0xf); - *dst = '\0'; - tprintf(" | %05x %s |\n", i - 16, outbuf); + } while (++i & DUMPSTR_BYTES_MASK); + + tprintf(" | %0*" PRI_klx " %s |\n", + offs_chars, i - DUMPSTR_WIDTH_BYTES, outbuf); } } -static bool process_vm_readv_not_supported = 0; -#ifndef HAVE_PROCESS_VM_READV -/* - * Need to do this since process_vm_readv() is not yet available in libc. - * When libc is be updated, only "static bool process_vm_readv_not_supported" - * line should remain. - */ -/* Have to avoid duplicating with the C library headers. */ -static ssize_t strace_process_vm_readv(pid_t pid, - const struct iovec *lvec, - unsigned long liovcnt, - const struct iovec *rvec, - unsigned long riovcnt, - unsigned long flags) +bool +tfetch_mem64(struct tcb *const tcp, const uint64_t addr, + const unsigned int len, void *const our_addr) { - return syscall(__NR_process_vm_readv, (long)pid, lvec, liovcnt, rvec, riovcnt, flags); + return addr && verbose(tcp) && + (entering(tcp) || !syserror(tcp)) && + !umoven(tcp, addr, len, our_addr); } -# define process_vm_readv strace_process_vm_readv -#endif /* !HAVE_PROCESS_VM_READV */ -static ssize_t -vm_read_mem(const pid_t pid, void *const laddr, - const kernel_ulong_t raddr, const size_t len) +bool +tfetch_mem64_ignore_syserror(struct tcb *const tcp, const uint64_t addr, + const unsigned int len, void *const our_addr) { - const unsigned long truncated_raddr = raddr; - - if (raddr != (kernel_ulong_t) truncated_raddr) { - errno = EIO; - return -1; - } - - const struct iovec local = { - .iov_base = laddr, - .iov_len = len - }; - const struct iovec remote = { - .iov_base = (void *) truncated_raddr, - .iov_len = len - }; - - return process_vm_readv(pid, &local, 1, &remote, 1, 0); + return addr && verbose(tcp) && + !umoven(tcp, addr, len, our_addr); } -/* - * move `len' bytes of data from process `pid' - * at address `addr' to our space at `our_addr' - */ int -umoven(struct tcb *const tcp, kernel_ulong_t addr, unsigned int len, - void *const our_addr) +umoven_or_printaddr64(struct tcb *const tcp, const uint64_t addr, + const unsigned int len, void *const our_addr) { - char *laddr = our_addr; - int pid = tcp->pid; - unsigned int n, m, nread; - union { - long val; - char x[sizeof(long)]; - } u; - -#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG - if (current_wordsize < sizeof(addr) - && (addr & (~ (kernel_ulong_t) -1U))) { - return -1; - } -#endif - - if (!process_vm_readv_not_supported) { - int r = vm_read_mem(pid, laddr, addr, len); - if ((unsigned int) r == len) - return 0; - if (r >= 0) { - error_msg("umoven: short read (%u < %u) @0x%" PRI_klx, - (unsigned int) r, len, addr); - return -1; - } - switch (errno) { - case ENOSYS: - process_vm_readv_not_supported = 1; - break; - case EPERM: - /* operation not permitted, try PTRACE_PEEKDATA */ - break; - case ESRCH: - /* the process is gone */ - return -1; - case EFAULT: case EIO: - /* address space is inaccessible */ - return -1; - default: - /* all the rest is strange and should be reported */ - perror_msg("process_vm_readv"); - return -1; - } - } - - nread = 0; - if (addr & (sizeof(long) - 1)) { - /* addr not a multiple of sizeof(long) */ - n = addr & (sizeof(long) - 1); /* residue */ - addr &= -sizeof(long); /* aligned address */ - errno = 0; - u.val = ptrace(PTRACE_PEEKDATA, pid, addr, 0); - switch (errno) { - case 0: - break; - case ESRCH: case EINVAL: - /* these could be seen if the process is gone */ - return -1; - case EFAULT: case EIO: case EPERM: - /* address space is inaccessible */ - return -1; - default: - /* all the rest is strange and should be reported */ - perror_msg("umoven: PTRACE_PEEKDATA pid:%d @0x%" PRI_klx, - pid, addr); - return -1; - } - m = MIN(sizeof(long) - n, len); - memcpy(laddr, &u.x[n], m); - addr += sizeof(long); - laddr += m; - nread += m; - len -= m; - } - while (len) { - errno = 0; - u.val = ptrace(PTRACE_PEEKDATA, pid, addr, 0); - switch (errno) { - case 0: - break; - case ESRCH: case EINVAL: - /* these could be seen if the process is gone */ - return -1; - case EFAULT: case EIO: case EPERM: - /* address space is inaccessible */ - if (nread) { - perror_msg("umoven: short read (%u < %u) @0x%" PRI_klx, - nread, nread + len, addr - nread); - } - return -1; - default: - /* all the rest is strange and should be reported */ - perror_msg("umoven: PTRACE_PEEKDATA pid:%d @0x%" PRI_klx, - pid, addr); - return -1; - } - m = MIN(sizeof(long), len); - memcpy(laddr, u.x, m); - addr += sizeof(long); - laddr += m; - nread += m; - len -= m; - } - - return 0; + if (tfetch_mem64(tcp, addr, len, our_addr)) + return 0; + printaddr64(addr); + return -1; } int -umoven_or_printaddr(struct tcb *const tcp, const kernel_ulong_t addr, - const unsigned int len, void *const our_addr) +umoven_or_printaddr64_ignore_syserror(struct tcb *const tcp, + const uint64_t addr, + const unsigned int len, + void *const our_addr) { - if (!addr || !verbose(tcp) || (exiting(tcp) && syserror(tcp)) || - umoven(tcp, addr, len, our_addr) < 0) { - printaddr(addr); - return -1; - } - return 0; + if (tfetch_mem64_ignore_syserror(tcp, addr, len, our_addr)) + return 0; + printaddr64(addr); + return -1; } -int -umoven_or_printaddr_ignore_syserror(struct tcb *const tcp, - const kernel_ulong_t addr, - const unsigned int len, - void *const our_addr) +bool +print_int32_array_member(struct tcb *tcp, void *elem_buf, size_t elem_size, + void *data) { - if (!addr || !verbose(tcp) || umoven(tcp, addr, len, our_addr) < 0) { - printaddr(addr); - return -1; - } - return 0; + tprintf("%" PRId32, *(int32_t *) elem_buf); + + return true; } -/* - * Like `umove' but make the additional effort of looking - * for a terminating zero byte. - * - * Returns < 0 on error, > 0 if NUL was seen, - * (TODO if useful: return count of bytes including NUL), - * else 0 if len bytes were read but no NUL byte seen. - * - * Note: there is no guarantee we won't overwrite some bytes - * in laddr[] _after_ terminating NUL (but, of course, - * we never write past laddr[len-1]). - */ -int -umovestr(struct tcb *const tcp, kernel_ulong_t addr, unsigned int len, char *laddr) +bool +print_uint32_array_member(struct tcb *tcp, void *elem_buf, size_t elem_size, + void *data) { - const unsigned long x01010101 = (unsigned long) 0x0101010101010101ULL; - const unsigned long x80808080 = (unsigned long) 0x8080808080808080ULL; + tprintf("%" PRIu32, *(uint32_t *) elem_buf); - int pid = tcp->pid; - unsigned int n, m, nread; - union { - unsigned long val; - char x[sizeof(long)]; - } u; - -#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG - if (current_wordsize < sizeof(addr) - && (addr & (~ (kernel_ulong_t) -1U))) { - return -1; - } -#endif - - nread = 0; - if (!process_vm_readv_not_supported) { - const size_t page_size = get_pagesize(); - const size_t page_mask = page_size - 1; - - while (len > 0) { - unsigned int chunk_len; - unsigned int end_in_page; + return true; +} - /* - * Don't cross pages, otherwise we can get EFAULT - * and fail to notice that terminating NUL lies - * in the existing (first) page. - */ - chunk_len = len > page_size ? page_size : len; - end_in_page = (addr + chunk_len) & page_mask; - if (chunk_len > end_in_page) /* crosses to the next page */ - chunk_len -= end_in_page; - - int r = vm_read_mem(pid, laddr, addr, chunk_len); - if (r > 0) { - if (memchr(laddr, '\0', r)) - return 1; - addr += r; - laddr += r; - nread += r; - len -= r; - continue; - } - switch (errno) { - case ENOSYS: - process_vm_readv_not_supported = 1; - goto vm_readv_didnt_work; - case ESRCH: - /* the process is gone */ - return -1; - case EPERM: - /* operation not permitted, try PTRACE_PEEKDATA */ - if (!nread) - goto vm_readv_didnt_work; - /* fall through */ - case EFAULT: case EIO: - /* address space is inaccessible */ - if (nread) { - perror_msg("umovestr: short read (%d < %d) @0x%" PRI_klx, - nread, nread + len, addr - nread); - } - return -1; - default: - /* all the rest is strange and should be reported */ - perror_msg("process_vm_readv"); - return -1; - } - } - return 0; - } - vm_readv_didnt_work: - - if (addr & (sizeof(long) - 1)) { - /* addr not a multiple of sizeof(long) */ - n = addr & (sizeof(long) - 1); /* residue */ - addr &= -sizeof(long); /* aligned address */ - errno = 0; - u.val = ptrace(PTRACE_PEEKDATA, pid, addr, 0); - switch (errno) { - case 0: - break; - case ESRCH: case EINVAL: - /* these could be seen if the process is gone */ - return -1; - case EFAULT: case EIO: case EPERM: - /* address space is inaccessible */ - return -1; - default: - /* all the rest is strange and should be reported */ - perror_msg("umovestr: PTRACE_PEEKDATA pid:%d @0x%" PRI_klx, - pid, addr); - return -1; - } - m = MIN(sizeof(long) - n, len); - memcpy(laddr, &u.x[n], m); - while (n & (sizeof(long) - 1)) - if (u.x[n++] == '\0') - return 1; - addr += sizeof(long); - laddr += m; - nread += m; - len -= m; - } +bool +print_uint64_array_member(struct tcb *tcp, void *elem_buf, size_t elem_size, + void *data) +{ + tprintf("%" PRIu64, *(uint64_t *) elem_buf); - while (len) { - errno = 0; - u.val = ptrace(PTRACE_PEEKDATA, pid, addr, 0); - switch (errno) { - case 0: - break; - case ESRCH: case EINVAL: - /* these could be seen if the process is gone */ - return -1; - case EFAULT: case EIO: case EPERM: - /* address space is inaccessible */ - if (nread) { - perror_msg("umovestr: short read (%d < %d) @0x%" PRI_klx, - nread, nread + len, addr - nread); - } - return -1; - default: - /* all the rest is strange and should be reported */ - perror_msg("umovestr: PTRACE_PEEKDATA pid:%d @0x%" PRI_klx, - pid, addr); - return -1; - } - m = MIN(sizeof(long), len); - memcpy(laddr, u.x, m); - /* "If a NUL char exists in this word" */ - if ((u.val - x01010101) & ~u.val & x80808080) - return 1; - addr += sizeof(long); - laddr += m; - nread += m; - len -= m; - } - return 0; + return true; } /* @@ -1410,8 +1191,8 @@ umovestr(struct tcb *const tcp, kernel_ulong_t addr, unsigned int len, char *lad * * Array elements are being fetched to the address specified by elem_buf. * - * The fetcher callback function specified by umoven_func should follow - * the same semantics as umoven_or_printaddr function. + * The fetcher callback function specified by tfetch_mem_func should follow + * the same semantics as tfetch_mem function. * * The printer callback function specified by print_func is expected * to print something; if it returns false, no more iterations will be made. @@ -1423,9 +1204,7 @@ umovestr(struct tcb *const tcp, kernel_ulong_t addr, unsigned int len, char *lad * - "NULL", if start_addr is NULL; * - "[]", if nmemb is 0; * - start_addr, if nmemb * elem_size overflows or wraps around; - * - nothing, if the first element cannot be fetched - * (if umoven_func returns non-zero), but it is assumed that - * umoven_func has printed the address it failed to fetch data from; + * - start_addr, if the first tfetch_mem_func invocation returned false; * - elements of the array, delimited by ", ", with the array itself * enclosed with [] brackets. * @@ -1434,25 +1213,22 @@ umovestr(struct tcb *const tcp, kernel_ulong_t addr, unsigned int len, char *lad * - "..." is printed instead of max_strlen+1 element * and no more iterations will be made. * - * This function returns true only if - * - umoven_func has been called at least once AND - * - umoven_func has not returned false. + * This function returns true only if tfetch_mem_func has returned true + * at least once. */ bool -print_array(struct tcb *const tcp, - const kernel_ulong_t start_addr, - const size_t nmemb, - void *const elem_buf, - const size_t elem_size, - int (*const umoven_func)(struct tcb *, - kernel_ulong_t, - unsigned int, - void *), - bool (*const print_func)(struct tcb *, - void *elem_buf, - size_t elem_size, - void *opaque_data), - void *const opaque_data) +print_array_ex(struct tcb *const tcp, + const kernel_ulong_t start_addr, + const size_t nmemb, + void *const elem_buf, + const size_t elem_size, + tfetch_mem_fn tfetch_mem_func, + print_fn print_func, + void *const opaque_data, + unsigned int flags, + const struct xlat *index_xlat, + size_t index_xlat_size, + const char *index_dflt) { if (!start_addr) { tprints("NULL"); @@ -1476,13 +1252,22 @@ print_array(struct tcb *const tcp, (abbrev(tcp) && max_strlen < nmemb) ? start_addr + elem_size * max_strlen : end_addr; kernel_ulong_t cur; + kernel_ulong_t idx = 0; + enum xlat_style xlat_style = flags & XLAT_STYLE_MASK; - for (cur = start_addr; cur < end_addr; cur += elem_size) { + for (cur = start_addr; cur < end_addr; cur += elem_size, idx++) { if (cur != start_addr) tprints(", "); - if (umoven_func(tcp, cur, elem_size, elem_buf)) + if (!tfetch_mem_func(tcp, cur, elem_size, elem_buf)) { + if (cur == start_addr) + printaddr(cur); + else { + tprints("..."); + printaddr_comment(cur); + } break; + } if (cur == start_addr) tprints("["); @@ -1493,6 +1278,25 @@ print_array(struct tcb *const tcp, break; } + if (flags & PAF_PRINT_INDICES) { + tprints("["); + + if (!index_xlat) { + print_xlat_ex(idx, NULL, xlat_style); + } else if (flags & PAF_INDEX_XLAT_VALUE_INDEXED) { + printxval_indexn_ex(index_xlat, + index_xlat_size, idx, + index_dflt, xlat_style); + } else { + printxvals_ex(idx, index_dflt, xlat_style, + (flags & PAF_INDEX_XLAT_SORTED) + && idx ? NULL : index_xlat, + NULL); + } + + tprints("] = "); + } + if (!print_func(tcp, elem_buf, elem_size, opaque_data)) { cur = end_addr; break; @@ -1507,7 +1311,7 @@ print_array(struct tcb *const tcp, int printargs(struct tcb *tcp) { - const int n = tcp->s_ent->nargs; + const int n = n_args(tcp); int i; for (i = 0; i < n; ++i) tprintf("%s%#" PRI_klx, i ? ", " : "", tcp->u_arg[i]); @@ -1517,7 +1321,7 @@ printargs(struct tcb *tcp) int printargs_u(struct tcb *tcp) { - const int n = tcp->s_ent->nargs; + const int n = n_args(tcp); int i; for (i = 0; i < n; ++i) tprintf("%s%u", i ? ", " : "", @@ -1528,7 +1332,7 @@ printargs_u(struct tcb *tcp) int printargs_d(struct tcb *tcp) { - const int n = tcp->s_ent->nargs; + const int n = n_args(tcp); int i; for (i = 0; i < n; ++i) tprintf("%s%d", i ? ", " : "", @@ -1536,14 +1340,19 @@ printargs_d(struct tcb *tcp) return RVAL_DECODED; } -#if defined _LARGEFILE64_SOURCE && defined HAVE_OPEN64 -# define open_file open64 -#else -# define open_file open -#endif +/* Print abnormal high bits of a kernel_ulong_t value. */ +void +print_abnormal_hi(const kernel_ulong_t val) +{ + if (current_klongsize > 4) { + const unsigned int hi = (unsigned int) ((uint64_t) val >> 32); + if (hi) + tprintf("%#x<<32|", hi); + } +} int -read_int_from_file(const char *const fname, int *const pvalue) +read_int_from_file(struct tcb *tcp, const char *const fname, int *const pvalue) { const int fd = open_file(fname, O_RDONLY); if (fd < 0) diff --git a/utime.c b/utime.c index 8126b350..b6bd119d 100644 --- a/utime.c +++ b/utime.c @@ -1,3 +1,10 @@ +/* + * Copyright (c) 2014-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #include "defs.h" #include DEF_MPERS_TYPE(utimbuf_t) @@ -15,8 +22,11 @@ SYS_FUNC(utime) printpath(tcp, tcp->u_arg[0]); tprints(", "); if (!umove_or_printaddr(tcp, tcp->u_arg[1], &u)) { - tprintf("{actime=%s,", sprinttime(u.actime)); - tprintf(" modtime=%s}", sprinttime(u.modtime)); + tprintf("{actime=%lld", (long long) u.actime); + tprints_comment(sprinttime(u.actime)); + tprintf(", modtime=%lld", (long long) u.modtime); + tprints_comment(sprinttime(u.modtime)); + tprints("}"); } return RVAL_DECODED; diff --git a/utimes.c b/utimes.c index 2908529b..bee78098 100644 --- a/utimes.c +++ b/utimes.c @@ -6,29 +6,10 @@ * Copyright (c) 2006-2007 Ulrich Drepper * Copyright (c) 2006 Bernhard Kaindl * Copyright (c) 2006-2015 Dmitry V. Levin + * Copyright (c) 2014-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" @@ -37,7 +18,7 @@ SYS_FUNC(utimes) { printpath(tcp, tcp->u_arg[0]); tprints(", "); - print_timeval_pair(tcp, tcp->u_arg[1]); + print_timeval_utimes(tcp, tcp->u_arg[1]); return RVAL_DECODED; } @@ -47,29 +28,42 @@ SYS_FUNC(futimesat) print_dirfd(tcp, tcp->u_arg[0]); printpath(tcp, tcp->u_arg[1]); tprints(", "); - print_timeval_pair(tcp, tcp->u_arg[2]); + print_timeval_utimes(tcp, tcp->u_arg[2]); return RVAL_DECODED; } -SYS_FUNC(utimensat) +static int +do_utimensat(struct tcb *const tcp, const print_obj_by_addr_fn print_ts) { print_dirfd(tcp, tcp->u_arg[0]); printpath(tcp, tcp->u_arg[1]); tprints(", "); - print_timespec_utime_pair(tcp, tcp->u_arg[2]); + print_ts(tcp, tcp->u_arg[2]); tprints(", "); printflags(at_flags, tcp->u_arg[3], "AT_???"); return RVAL_DECODED; } +#if HAVE_ARCH_TIME32_SYSCALLS +SYS_FUNC(utimensat_time32) +{ + return do_utimensat(tcp, print_timespec32_utime_pair); +} +#endif + +SYS_FUNC(utimensat_time64) +{ + return do_utimensat(tcp, print_timespec64_utime_pair); +} + #ifdef ALPHA SYS_FUNC(osf_utimes) { printpath(tcp, tcp->u_arg[0]); tprints(", "); - print_timeval32_pair(tcp, tcp->u_arg[1]); + print_timeval32_utimes(tcp, tcp->u_arg[1]); return RVAL_DECODED; } diff --git a/v4l2.c b/v4l2.c index 637e8788..b325cf8b 100644 --- a/v4l2.c +++ b/v4l2.c @@ -2,35 +2,24 @@ * Copyright (c) 2014 Philippe De Muyter * Copyright (c) 2014 William Manley * Copyright (c) 2011 Peter Zotov + * Copyright (c) 2014-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" +#include +#include +#include +#include + #include DEF_MPERS_TYPE(struct_v4l2_buffer) -#include DEF_MPERS_TYPE(struct_v4l2_create_buffers) +#include DEF_MPERS_TYPE(struct_v4l2_clip) +#ifdef VIDIOC_CREATE_BUFS +# include DEF_MPERS_TYPE(struct_v4l2_create_buffers) +#endif #include DEF_MPERS_TYPE(struct_v4l2_ext_control) #include DEF_MPERS_TYPE(struct_v4l2_ext_controls) #include DEF_MPERS_TYPE(struct_v4l2_format) @@ -38,13 +27,11 @@ #include DEF_MPERS_TYPE(struct_v4l2_input) #include DEF_MPERS_TYPE(struct_v4l2_standard) -#include -#include -#include -#include - typedef struct v4l2_buffer struct_v4l2_buffer; +typedef struct v4l2_clip struct_v4l2_clip; +#ifdef VIDIOC_CREATE_BUFS typedef struct v4l2_create_buffers struct_v4l2_create_buffers; +#endif typedef struct v4l2_ext_control struct_v4l2_ext_control; typedef struct v4l2_ext_controls struct_v4l2_ext_controls; typedef struct v4l2_format struct_v4l2_format; @@ -54,15 +41,13 @@ typedef struct v4l2_standard struct_v4l2_standard; #include MPERS_DEFS -/* some historical constants */ -#ifndef V4L2_CID_HCENTER -#define V4L2_CID_HCENTER (V4L2_CID_BASE+22) -#endif -#ifndef V4L2_CID_VCENTER -#define V4L2_CID_VCENTER (V4L2_CID_BASE+23) -#endif -#ifndef V4L2_CID_BAND_STOP_FILTER -#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33) +#include "print_fields.h" +#include "print_utils.h" +#include "xstring.h" + +/* v4l2_fourcc_be was added by Linux commit v3.18-rc1~101^2^2~127 */ +#ifndef v4l2_fourcc_be +# define v4l2_fourcc_be(a, b, c, d) (v4l2_fourcc(a, b, c, d) | (1 << 31)) #endif #define FMT_FRACT "%u/%u" @@ -71,29 +56,24 @@ typedef struct v4l2_standard struct_v4l2_standard; #define FMT_RECT "{left=%d, top=%d, width=%u, height=%u}" #define ARGS_RECT(x) (x).left, (x).top, (x).width, (x).height +#include "xlat/v4l2_pix_fmts.h" +#include "xlat/v4l2_sdr_fmts.h" + static void -print_pixelformat(uint32_t fourcc) +print_pixelformat(uint32_t fourcc, const struct xlat *xlat) { - const union { - uint32_t pixelformat; - unsigned char cc[sizeof(uint32_t)]; - } u = { -#if WORDS_BIGENDIAN - .cc = { - (unsigned char) (fourcc >> 24), - (unsigned char) (fourcc >> 16), - (unsigned char) (fourcc >> 8), - (unsigned char) fourcc - } -#else - .pixelformat = fourcc -#endif + unsigned char a[] = { + (unsigned char) fourcc, + (unsigned char) (fourcc >> 8), + (unsigned char) (fourcc >> 16), + (unsigned char) (fourcc >> 24), }; unsigned int i; tprints("v4l2_fourcc("); - for (i = 0; i < sizeof(u.cc); ++i) { - unsigned char c = u.cc[i]; + /* Generic char array printing routine. */ + for (i = 0; i < ARRAY_SIZE(a); ++i) { + unsigned char c = a[i]; if (i) tprints(", "); @@ -106,7 +86,7 @@ print_pixelformat(uint32_t fourcc) '\0' }; tprints(sym); - } else if (c >= ' ' && c <= 0x7e) { + } else if (is_print(c)) { char sym[] = { '\'', c, @@ -116,18 +96,20 @@ print_pixelformat(uint32_t fourcc) tprints(sym); } else { char hex[] = { - '\'', - '\\', - 'x', - "0123456789abcdef"[c >> 4], - "0123456789abcdef"[c & 0xf], - '\'', + BYTE_HEX_CHARS_PRINTF_QUOTED(c), '\0' }; tprints(hex); } } tprints(")"); + + if (xlat) { + const char *pixfmt_name = xlookup(xlat, fourcc); + + if (pixfmt_name) + tprints_comment(pixfmt_name); + } } #include "xlat/v4l2_device_capabilities_flags.h" @@ -141,16 +123,10 @@ print_v4l2_capability(struct tcb *const tcp, const kernel_ulong_t arg) return 0; tprints(", "); if (umove_or_printaddr(tcp, arg, &caps)) - return 1; - tprints("{driver="); - print_quoted_string((const char *) caps.driver, - sizeof(caps.driver), QUOTE_0_TERMINATED); - tprints(", card="); - print_quoted_string((const char *) caps.card, - sizeof(caps.card), QUOTE_0_TERMINATED); - tprints(", bus_info="); - print_quoted_string((const char *) caps.bus_info, - sizeof(caps.bus_info), QUOTE_0_TERMINATED); + return RVAL_IOCTL_DECODED; + PRINT_FIELD_CSTRING("{", caps, driver); + PRINT_FIELD_CSTRING(", ", caps, card); + PRINT_FIELD_CSTRING(", ", caps, bus_info); tprintf(", version=%u.%u.%u, capabilities=", (caps.version >> 16) & 0xFF, (caps.version >> 8) & 0xFF, @@ -163,7 +139,7 @@ print_v4l2_capability(struct tcb *const tcp, const kernel_ulong_t arg) "V4L2_CAP_???"); #endif tprints("}"); - return 1; + return RVAL_IOCTL_DECODED; } #include "xlat/v4l2_buf_types.h" @@ -177,7 +153,7 @@ print_v4l2_fmtdesc(struct tcb *const tcp, const kernel_ulong_t arg) if (entering(tcp)) { tprints(", "); if (umove_or_printaddr(tcp, arg, &f)) - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; tprintf("{index=%u, type=", f.index); printxval(v4l2_buf_types, f.type, "V4L2_BUF_TYPE_???"); return 0; @@ -187,30 +163,39 @@ print_v4l2_fmtdesc(struct tcb *const tcp, const kernel_ulong_t arg) tprints(", flags="); printflags(v4l2_format_description_flags, f.flags, "V4L2_FMT_FLAG_???"); - tprints(", description="); - print_quoted_string((const char *) f.description, - sizeof(f.description), - QUOTE_0_TERMINATED); + PRINT_FIELD_CSTRING(", ", f, description); tprints(", pixelformat="); - print_pixelformat(f.pixelformat); + print_pixelformat(f.pixelformat, v4l2_pix_fmts); } tprints("}"); - return 1; + return RVAL_IOCTL_DECODED; } #include "xlat/v4l2_fields.h" #include "xlat/v4l2_colorspaces.h" +#include "xlat/v4l2_vbi_flags.h" +#include "xlat/v4l2_sliced_flags.h" -static void -print_v4l2_format_fmt(const char *prefix, const struct_v4l2_format *f) +static bool +print_v4l2_clip(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data) { + const struct_v4l2_clip *p = elem_buf; + tprintf(FMT_RECT, ARGS_RECT(p->c)); + return true; +} + +static bool +print_v4l2_format_fmt(struct tcb *const tcp, const char *prefix, + const struct_v4l2_format *f) +{ + bool ret = true; switch (f->type) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: case V4L2_BUF_TYPE_VIDEO_OUTPUT: tprints(prefix); tprintf("fmt.pix={width=%u, height=%u, pixelformat=", f->fmt.pix.width, f->fmt.pix.height); - print_pixelformat(f->fmt.pix.pixelformat); + print_pixelformat(f->fmt.pix.pixelformat, v4l2_pix_fmts); tprints(", field="); printxval(v4l2_fields, f->fmt.pix.field, "V4L2_FIELD_???"); tprintf(", bytesperline=%u, sizeimage=%u, colorspace=", @@ -227,7 +212,7 @@ print_v4l2_format_fmt(const char *prefix, const struct_v4l2_format *f) tprints(prefix); tprintf("fmt.pix_mp={width=%u, height=%u, pixelformat=", f->fmt.pix_mp.width, f->fmt.pix_mp.height); - print_pixelformat(f->fmt.pix_mp.pixelformat); + print_pixelformat(f->fmt.pix_mp.pixelformat, v4l2_pix_fmts); tprints(", field="); printxval(v4l2_fields, f->fmt.pix_mp.field, "V4L2_FIELD_???"); tprints(", colorspace="); @@ -244,42 +229,97 @@ print_v4l2_format_fmt(const char *prefix, const struct_v4l2_format *f) f->fmt.pix_mp.plane_fmt[i].sizeimage, f->fmt.pix_mp.plane_fmt[i].bytesperline); } - tprintf("], num_planes=%u}", (unsigned) f->fmt.pix_mp.num_planes); + tprintf("], num_planes=%u}", + (unsigned) f->fmt.pix_mp.num_planes); break; } #endif - - /* TODO: Complete this switch statement */ -#if 0 - case V4L2_BUF_TYPE_VIDEO_OVERLAY: + /* OUTPUT_OVERLAY since Linux v2.6.22-rc1~1118^2~179 */ #if HAVE_DECL_V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: #endif + case V4L2_BUF_TYPE_VIDEO_OVERLAY: { + struct_v4l2_clip clip; tprints(prefix); - tprints("fmt.win={???}"); + tprintf("fmt.win={left=%d, top=%d, width=%u, height=%u, field=", + ARGS_RECT(f->fmt.win.w)); + printxval(v4l2_fields, f->fmt.win.field, "V4L2_FIELD_???"); + tprintf(", chromakey=%#x, clips=", f->fmt.win.chromakey); + ret = print_array(tcp, ptr_to_kulong(f->fmt.win.clips), + f->fmt.win.clipcount, &clip, sizeof(clip), + tfetch_mem, print_v4l2_clip, 0); + tprintf(", clipcount=%u, bitmap=", f->fmt.win.clipcount); + printaddr(ptr_to_kulong(f->fmt.win.bitmap)); +#ifdef HAVE_STRUCT_V4L2_WINDOW_GLOBAL_ALPHA + tprintf(", global_alpha=%#x", f->fmt.win.global_alpha); +#endif + tprints("}"); break; - + } case V4L2_BUF_TYPE_VBI_CAPTURE: case V4L2_BUF_TYPE_VBI_OUTPUT: tprints(prefix); - tprints("fmt.vbi={???}"); + tprintf("fmt.vbi={sampling_rate=%u, offset=%u, " + "samples_per_line=%u, sample_format=", + f->fmt.vbi.sampling_rate, f->fmt.vbi.offset, + f->fmt.vbi.samples_per_line); + print_pixelformat(f->fmt.vbi.sample_format, v4l2_pix_fmts); + tprintf(", start=[%u, %u], count=[%u, %u], ", + f->fmt.vbi.start[0], f->fmt.vbi.start[1], + f->fmt.vbi.count[0], f->fmt.vbi.count[1]); + tprints("flags="); + printxval(v4l2_vbi_flags, f->fmt.vbi.flags, "V4L2_VBI_???"); + tprints("}"); break; - + /* both since Linux v2.6.14-rc2~64 */ +#if HAVE_DECL_V4L2_BUF_TYPE_SLICED_VBI_CAPTURE case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE: - case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: + case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT: { + unsigned int i, j; + tprints(prefix); - tprints("fmt.sliced={???}"); + tprints("fmt.sliced={service_set="); + printxval(v4l2_sliced_flags, f->fmt.sliced.service_set, + "V4L2_SLICED_???"); + tprintf(", io_size=%u, service_lines=[", + f->fmt.sliced.io_size); + for (i = 0; i < ARRAY_SIZE(f->fmt.sliced.service_lines); i++) { + if (i > 0) + tprints(", "); + tprints("["); + for (j = 0; + j < ARRAY_SIZE(f->fmt.sliced.service_lines[0]); + j++) { + if (j > 0) + tprints(", "); + tprintf("%#x", + f->fmt.sliced.service_lines[i][j]); + } + tprints("]"); + } + tprints("]}"); break; - + } +#endif + /* since Linux v4.4-rc1~118^2~14 */ +#if HAVE_DECL_V4L2_BUF_TYPE_SDR_OUTPUT + case V4L2_BUF_TYPE_SDR_OUTPUT: +#endif + /* since Linux v3.15-rc1~85^2~213 */ #if HAVE_DECL_V4L2_BUF_TYPE_SDR_CAPTURE case V4L2_BUF_TYPE_SDR_CAPTURE: - case V4L2_BUF_TYPE_SDR_OUTPUT: tprints(prefix); - tprints("fmt.sdr={???}"); + tprints("fmt.sdr={pixelformat="); + print_pixelformat(f->fmt.sdr.pixelformat, v4l2_sdr_fmts); +# ifdef HAVE_STRUCT_V4L2_SDR_FORMAT_BUFFERSIZE + tprintf(", buffersize=%u", + f->fmt.sdr.buffersize); +# endif + tprints("}"); break; -#endif #endif } + return ret; } static int @@ -291,20 +331,25 @@ print_v4l2_format(struct tcb *const tcp, const kernel_ulong_t arg, if (entering(tcp)) { tprints(", "); if (umove_or_printaddr(tcp, arg, &f)) - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; tprints("{type="); printxval(v4l2_buf_types, f.type, "V4L2_BUF_TYPE_???"); if (is_get) return 0; - print_v4l2_format_fmt(", ", &f); - } else { - if (!syserror(tcp) && !umove(tcp, arg, &f)) { - const char *delim = is_get ? ", " : " => "; - print_v4l2_format_fmt(delim, &f); + if (!print_v4l2_format_fmt(tcp, ", ", &f)) { + tprints("}"); + return RVAL_IOCTL_DECODED; } - tprints("}"); + + return 0; } - return 1; + + if (!syserror(tcp) && !umove(tcp, arg, &f)) + print_v4l2_format_fmt(tcp, is_get ? ", " : " => ", &f); + + tprints("}"); + + return RVAL_IOCTL_DECODED; } #include "xlat/v4l2_memories.h" @@ -316,23 +361,31 @@ print_v4l2_requestbuffers(struct tcb *const tcp, const kernel_ulong_t arg) if (entering(tcp)) { tprints(", "); + if (umove_or_printaddr(tcp, arg, &reqbufs)) - return RVAL_DECODED | 1; - tprintf("{count=%u, type=", reqbufs.count); + return RVAL_IOCTL_DECODED; + + tprintf("{type="); printxval(v4l2_buf_types, reqbufs.type, "V4L2_BUF_TYPE_???"); tprints(", memory="); printxval(v4l2_memories, reqbufs.memory, "V4L2_MEMORY_???"); - tprints("}"); + tprintf(", count=%u", reqbufs.count); + return 0; - } else { - static char outstr[sizeof("{count=}") + sizeof(int) * 3]; + } + + if (!syserror(tcp)) { + tprints(" => "); - if (syserror(tcp) || umove(tcp, arg, &reqbufs) < 0) - return 1; - sprintf(outstr, "{count=%u}", reqbufs.count); - tcp->auxstr = outstr; - return 1 + RVAL_STR; + if (!umove(tcp, arg, &reqbufs)) + tprintf("%u", reqbufs.count); + else + tprints("???"); } + + tprints("}"); + + return RVAL_IOCTL_DECODED; } #include "xlat/v4l2_buf_flags.h" @@ -346,37 +399,41 @@ print_v4l2_buffer(struct tcb *const tcp, const unsigned int code, if (entering(tcp)) { tprints(", "); if (umove_or_printaddr(tcp, arg, &b)) - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; tprints("{type="); printxval(v4l2_buf_types, b.type, "V4L2_BUF_TYPE_???"); if (code != VIDIOC_DQBUF) tprintf(", index=%u", b.index); - } else { - if (!syserror(tcp) && umove(tcp, arg, &b) == 0) { - if (code == VIDIOC_DQBUF) - tprintf(", index=%u", b.index); - tprints(", memory="); - printxval(v4l2_memories, b.memory, "V4L2_MEMORY_???"); - - if (b.memory == V4L2_MEMORY_MMAP) { - tprintf(", m.offset=%#x", b.m.offset); - } else if (b.memory == V4L2_MEMORY_USERPTR) { - tprints(", m.userptr="); - printaddr(b.m.userptr); - } - tprintf(", length=%u, bytesused=%u, flags=", - b.length, b.bytesused); - printflags(v4l2_buf_flags, b.flags, "V4L2_BUF_FLAG_???"); - if (code == VIDIOC_DQBUF) { - tprints(", timestamp = "); - MPERS_FUNC_NAME(print_struct_timeval)(&b.timestamp); - } - tprints(", ..."); + return 0; + } + + if (!syserror(tcp) && !umove(tcp, arg, &b)) { + if (code == VIDIOC_DQBUF) + tprintf(", index=%u", b.index); + tprints(", memory="); + printxval(v4l2_memories, b.memory, "V4L2_MEMORY_???"); + + if (b.memory == V4L2_MEMORY_MMAP) { + tprintf(", m.offset=%#x", b.m.offset); + } else if (b.memory == V4L2_MEMORY_USERPTR) { + tprints(", m.userptr="); + printaddr(b.m.userptr); } - tprints("}"); + + tprintf(", length=%u, bytesused=%u, flags=", + b.length, b.bytesused); + printflags(v4l2_buf_flags, b.flags, "V4L2_BUF_FLAG_???"); + if (code == VIDIOC_DQBUF) { + tprints(", timestamp = "); + MPERS_FUNC_NAME(print_struct_timeval)(&b.timestamp); + } + tprints(", ..."); } - return 1; + + tprints("}"); + + return RVAL_IOCTL_DECODED; } static int @@ -392,7 +449,7 @@ print_v4l2_framebuffer(struct tcb *const tcp, const kernel_ulong_t arg) tprints("}"); } - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } static int @@ -406,7 +463,7 @@ print_v4l2_buf_type(struct tcb *const tcp, const kernel_ulong_t arg) printxval(v4l2_buf_types, type, "V4L2_BUF_TYPE_???"); tprints("]"); } - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } #include "xlat/v4l2_streaming_capabilities.h" @@ -421,7 +478,7 @@ print_v4l2_streamparm(struct tcb *const tcp, const kernel_ulong_t arg, if (entering(tcp)) { tprints(", "); if (umove_or_printaddr(tcp, arg, &s)) - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; tprints("{type="); printxval(v4l2_buf_types, s.type, "V4L2_BUF_TYPE_???"); switch (s.type) { @@ -433,12 +490,12 @@ print_v4l2_streamparm(struct tcb *const tcp, const kernel_ulong_t arg, break; default: tprints("}"); - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } } else { if (syserror(tcp) || umove(tcp, arg, &s) < 0) { tprints("}"); - return 1; + return RVAL_IOCTL_DECODED; } tprints(is_get ? ", " : " => "); } @@ -472,9 +529,12 @@ print_v4l2_streamparm(struct tcb *const tcp, const kernel_ulong_t arg, s.parm.output.extendedmode, s.parm.output.writebuffers); } - if (exiting(tcp)) + if (entering(tcp)) { + return 0; + } else { tprints("}"); - return 1; + return RVAL_IOCTL_DECODED; + } } static int @@ -485,21 +545,22 @@ print_v4l2_standard(struct tcb *const tcp, const kernel_ulong_t arg) if (entering(tcp)) { tprints(", "); if (umove_or_printaddr(tcp, arg, &s)) - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; tprintf("{index=%u", s.index); - } else { - if (!syserror(tcp) && !umove(tcp, arg, &s)) { - tprints(", name="); - print_quoted_string((const char *) s.name, - sizeof(s.name), - QUOTE_0_TERMINATED); - tprintf(", frameperiod=" FMT_FRACT, - ARGS_FRACT(s.frameperiod)); - tprintf(", framelines=%d", s.framelines); - } - tprints("}"); + + return 0; } - return 1; + + if (!syserror(tcp) && !umove(tcp, arg, &s)) { + PRINT_FIELD_CSTRING(", ", s, name); + tprintf(", frameperiod=" FMT_FRACT, + ARGS_FRACT(s.frameperiod)); + tprintf(", framelines=%d", s.framelines); + } + + tprints("}"); + + return RVAL_IOCTL_DECODED; } #include "xlat/v4l2_input_types.h" @@ -512,23 +573,29 @@ print_v4l2_input(struct tcb *const tcp, const kernel_ulong_t arg) if (entering(tcp)) { tprints(", "); if (umove_or_printaddr(tcp, arg, &i)) - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; tprintf("{index=%u", i.index); - } else { - if (!syserror(tcp) && !umove(tcp, arg, &i)) { - tprints(", name="); - print_quoted_string((const char *) i.name, - sizeof(i.name), - QUOTE_0_TERMINATED); - tprints(", type="); - printxval(v4l2_input_types, i.type, - "V4L2_INPUT_TYPE_???"); - } - tprints("}"); + + return 0; } - return 1; + + if (!syserror(tcp) && !umove(tcp, arg, &i)) { + PRINT_FIELD_CSTRING(", ", i, name); + tprints(", type="); + printxval(v4l2_input_types, i.type, "V4L2_INPUT_TYPE_???"); + } + + tprints("}"); + + return RVAL_IOCTL_DECODED; } +/* + * We include it here and not before print_v4l2_ext_controls as we need + * V4L2_CTRL_CLASS_* definitions for V4L2_CID_*_BASE ones. + */ +#include "xlat/v4l2_control_classes.h" +#include "xlat/v4l2_control_id_bases.h" #include "xlat/v4l2_control_ids.h" static int @@ -540,7 +607,7 @@ print_v4l2_control(struct tcb *const tcp, const kernel_ulong_t arg, if (entering(tcp)) { tprints(", "); if (umove_or_printaddr(tcp, arg, &c)) - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; tprints("{id="); printxval(v4l2_control_ids, c.id, "V4L2_CID_???"); if (!is_get) @@ -554,7 +621,57 @@ print_v4l2_control(struct tcb *const tcp, const kernel_ulong_t arg, } tprints("}"); - return 1; + + return RVAL_IOCTL_DECODED; +} + +#include "xlat/v4l2_tuner_types.h" +#include "xlat/v4l2_tuner_capabilities.h" +#include "xlat/v4l2_tuner_rxsubchanses.h" +#include "xlat/v4l2_tuner_audmodes.h" + +static int +print_v4l2_tuner(struct tcb *const tcp, const kernel_ulong_t arg, + const bool is_get) +{ + struct v4l2_tuner c; + if (entering(tcp)) { + tprints(", "); + if (umove_or_printaddr(tcp, arg, &c)) + return RVAL_IOCTL_DECODED; + tprintf("{index=%u", c.index); + if (is_get) + return 0; + tprints(", "); + } else { + if (syserror(tcp) || umove(tcp, arg, &c) < 0) { + tprints("}"); + return RVAL_IOCTL_DECODED; + } + tprints(is_get ? ", " : " => "); + } + + PRINT_FIELD_CSTRING("", c, name); + tprints(", type="); + printxval(v4l2_tuner_types, c.type, "V4L2_TUNER_TYPE_???"); + tprints(", capability="); + printxval(v4l2_tuner_capabilities, c.capability, + "V4L2_TUNER_CAP_???"); + tprintf(", rangelow=%u, rangehigh=%u, rxsubchans=", + c.rangelow, c.rangehigh); + printxval(v4l2_tuner_rxsubchanses, c.rxsubchans, + "V4L2_TUNER_SUB_???"); + tprints(", audmode="); + printxval(v4l2_tuner_audmodes, c.audmode, + "V4L2_TUNER_MODE_???"); + tprintf(", signal=%d, afc=%d", c.signal, c.afc); + + if (entering(tcp)) { + return 0; + } else { + tprints("}"); + return RVAL_IOCTL_DECODED; + } } #include "xlat/v4l2_control_types.h" @@ -568,12 +685,12 @@ print_v4l2_queryctrl(struct tcb *const tcp, const kernel_ulong_t arg) if (entering(tcp)) { tprints(", "); if (umove_or_printaddr(tcp, arg, &c)) - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; tprints("{id="); } else { if (syserror(tcp) || umove(tcp, arg, &c) < 0) { tprints("}"); - return 1; + return RVAL_IOCTL_DECODED; } if (get_tcb_priv_ulong(tcp)) tprints(" => "); @@ -584,7 +701,8 @@ print_v4l2_queryctrl(struct tcb *const tcp, const kernel_ulong_t arg) const unsigned long next = c.id & V4L2_CTRL_FLAG_NEXT_CTRL; set_tcb_priv_ulong(tcp, next); if (next) { - tprints("V4L2_CTRL_FLAG_NEXT_CTRL|"); + print_xlat(V4L2_CTRL_FLAG_NEXT_CTRL); + tprints("|"); c.id &= ~V4L2_CTRL_FLAG_NEXT_CTRL; } #endif @@ -594,17 +712,14 @@ print_v4l2_queryctrl(struct tcb *const tcp, const kernel_ulong_t arg) if (exiting(tcp)) { tprints(", type="); printxval(v4l2_control_types, c.type, "V4L2_CTRL_TYPE_???"); - tprints(", name="); - print_quoted_string((const char *) c.name, - sizeof(c.name), - QUOTE_0_TERMINATED); + PRINT_FIELD_CSTRING(", ", c, name); tprintf(", minimum=%d, maximum=%d, step=%d" ", default_value=%d, flags=", c.minimum, c.maximum, c.step, c.default_value); printflags(v4l2_control_flags, c.flags, "V4L2_CTRL_FLAG_???"); tprints("}"); } - return 1; + return entering(tcp) ? 0 : RVAL_IOCTL_DECODED; } static int @@ -615,11 +730,13 @@ print_v4l2_cropcap(struct tcb *const tcp, const kernel_ulong_t arg) if (entering(tcp)) { tprints(", "); if (umove_or_printaddr(tcp, arg, &c)) - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; tprints("{type="); printxval(v4l2_buf_types, c.type, "V4L2_BUF_TYPE_???"); + return 0; } + if (!syserror(tcp) && !umove(tcp, arg, &c)) { tprintf(", bounds=" FMT_RECT ", defrect=" FMT_RECT @@ -628,8 +745,10 @@ print_v4l2_cropcap(struct tcb *const tcp, const kernel_ulong_t arg) ARGS_RECT(c.defrect), ARGS_FRACT(c.pixelaspect)); } + tprints("}"); - return 1; + + return RVAL_IOCTL_DECODED; } static int @@ -641,7 +760,7 @@ print_v4l2_crop(struct tcb *const tcp, const kernel_ulong_t arg, if (entering(tcp)) { tprints(", "); if (umove_or_printaddr(tcp, arg, &c)) - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; tprints("{type="); printxval(v4l2_buf_types, c.type, "V4L2_BUF_TYPE_???"); if (is_get) @@ -653,7 +772,8 @@ print_v4l2_crop(struct tcb *const tcp, const kernel_ulong_t arg, } tprints("}"); - return RVAL_DECODED | 1; + + return RVAL_IOCTL_DECODED; } #ifdef VIDIOC_S_EXT_CTRLS @@ -677,8 +797,6 @@ print_v4l2_ext_control(struct tcb *tcp, void *elem_buf, size_t elem_size, void * return true; } -#include "xlat/v4l2_control_classes.h" - static int print_v4l2_ext_controls(struct tcb *const tcp, const kernel_ulong_t arg, const bool is_get) @@ -688,14 +806,14 @@ print_v4l2_ext_controls(struct tcb *const tcp, const kernel_ulong_t arg, if (entering(tcp)) { tprints(", "); if (umove_or_printaddr(tcp, arg, &c)) - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; tprints("{ctrl_class="); printxval(v4l2_control_classes, c.ctrl_class, "V4L2_CTRL_CLASS_???"); tprintf(", count=%u", c.count); if (!c.count) { tprints("}"); - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } if (is_get) return 0; @@ -703,7 +821,7 @@ print_v4l2_ext_controls(struct tcb *const tcp, const kernel_ulong_t arg, } else { if (umove(tcp, arg, &c) < 0) { tprints("}"); - return 1; + return RVAL_IOCTL_DECODED; } tprints(is_get ? ", " : " => "); } @@ -712,7 +830,7 @@ print_v4l2_ext_controls(struct tcb *const tcp, const kernel_ulong_t arg, struct_v4l2_ext_control ctrl; bool fail = !print_array(tcp, ptr_to_kulong(c.controls), c.count, &ctrl, sizeof(ctrl), - umoven_or_printaddr_ignore_syserror, + tfetch_mem_ignore_syserror, print_v4l2_ext_control, 0); if (exiting(tcp) && syserror(tcp)) @@ -720,9 +838,11 @@ print_v4l2_ext_controls(struct tcb *const tcp, const kernel_ulong_t arg, if (exiting(tcp) || fail) { tprints("}"); - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; } - return 1; + + /* entering */ + return 0; } #endif /* VIDIOC_S_EXT_CTRLS */ @@ -737,9 +857,9 @@ print_v4l2_frmsizeenum(struct tcb *const tcp, const kernel_ulong_t arg) if (entering(tcp)) { tprints(", "); if (umove_or_printaddr(tcp, arg, &s)) - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; tprintf("{index=%u, pixel_format=", s.index); - print_pixelformat(s.pixel_format); + print_pixelformat(s.pixel_format, v4l2_pix_fmts); return 0; } @@ -762,7 +882,7 @@ print_v4l2_frmsizeenum(struct tcb *const tcp, const kernel_ulong_t arg) } } tprints("}"); - return 1; + return RVAL_IOCTL_DECODED; } #endif /* VIDIOC_ENUM_FRAMESIZES */ @@ -777,12 +897,13 @@ print_v4l2_frmivalenum(struct tcb *const tcp, const kernel_ulong_t arg) if (entering(tcp)) { tprints(", "); if (umove_or_printaddr(tcp, arg, &f)) - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; tprintf("{index=%u, pixel_format=", f.index); - print_pixelformat(f.pixel_format); + print_pixelformat(f.pixel_format, v4l2_pix_fmts); tprintf(", width=%u, height=%u", f.width, f.height); return 0; } + if (!syserror(tcp) && !umove(tcp, arg, &f)) { tprints(", type="); printxval(v4l2_frameinterval_types, f.type, @@ -802,8 +923,10 @@ print_v4l2_frmivalenum(struct tcb *const tcp, const kernel_ulong_t arg) break; } } + tprints("}"); - return 1; + + return RVAL_IOCTL_DECODED; } #endif /* VIDIOC_ENUM_FRAMEINTERVALS */ @@ -811,31 +934,33 @@ print_v4l2_frmivalenum(struct tcb *const tcp, const kernel_ulong_t arg) static int print_v4l2_create_buffers(struct tcb *const tcp, const kernel_ulong_t arg) { + static const char fmt[] = "{index=%u, count=%u}"; + static char outstr[sizeof(fmt) + sizeof(int) * 6]; + struct_v4l2_create_buffers b; if (entering(tcp)) { tprints(", "); if (umove_or_printaddr(tcp, arg, &b)) - return RVAL_DECODED | 1; + return RVAL_IOCTL_DECODED; tprintf("{count=%u, memory=", b.count); printxval(v4l2_memories, b.memory, "V4L2_MEMORY_???"); tprints(", format={type="); printxval(v4l2_buf_types, b.format.type, "V4L2_BUF_TYPE_???"); - print_v4l2_format_fmt(", ", + print_v4l2_format_fmt(tcp, ", ", (struct_v4l2_format *) &b.format); tprints("}}"); return 0; - } else { - static const char fmt[] = "{index=%u, count=%u}"; - static char outstr[sizeof(fmt) + sizeof(int) * 6]; - - if (syserror(tcp) || umove(tcp, arg, &b) < 0) - return 1; - sprintf(outstr, fmt, b.index, b.count); - tcp->auxstr = outstr; - return 1 + RVAL_STR; } + + if (syserror(tcp) || umove(tcp, arg, &b)) + return RVAL_IOCTL_DECODED; + + xsprintf(outstr, fmt, b.index, b.count); + tcp->auxstr = outstr; + + return RVAL_IOCTL_DECODED | RVAL_STR; } #endif /* VIDIOC_CREATE_BUFS */ @@ -868,7 +993,7 @@ MPERS_PRINTER_DECL(int, v4l2_ioctl, struct tcb *const tcp, case VIDIOC_G_FBUF: /* R */ if (entering(tcp)) return 0; - /* fall through */ + ATTRIBUTE_FALLTHROUGH; case VIDIOC_S_FBUF: /* W */ return print_v4l2_framebuffer(tcp, arg); @@ -883,11 +1008,11 @@ MPERS_PRINTER_DECL(int, v4l2_ioctl, struct tcb *const tcp, case VIDIOC_G_STD: /* R */ if (entering(tcp)) return 0; - /* fall through */ + ATTRIBUTE_FALLTHROUGH; case VIDIOC_S_STD: /* W */ tprints(", "); printnum_int64(tcp, arg, "%#" PRIx64); - return RVAL_DECODED | 1; + break; case VIDIOC_ENUMSTD: /* RW */ return print_v4l2_standard(tcp, arg); @@ -899,17 +1024,21 @@ MPERS_PRINTER_DECL(int, v4l2_ioctl, struct tcb *const tcp, case VIDIOC_S_CTRL: /* RW */ return print_v4l2_control(tcp, arg, code == VIDIOC_G_CTRL); + case VIDIOC_G_TUNER: /* RW */ + case VIDIOC_S_TUNER: /* RW */ + return print_v4l2_tuner(tcp, arg, code == VIDIOC_G_TUNER); + case VIDIOC_QUERYCTRL: /* RW */ return print_v4l2_queryctrl(tcp, arg); case VIDIOC_G_INPUT: /* R */ if (entering(tcp)) return 0; - /* fall through */ + ATTRIBUTE_FALLTHROUGH; case VIDIOC_S_INPUT: /* RW */ tprints(", "); printnum_int(tcp, arg, "%u"); - return RVAL_DECODED | 1; + break; case VIDIOC_CROPCAP: /* RW */ return print_v4l2_cropcap(tcp, arg); @@ -944,4 +1073,6 @@ MPERS_PRINTER_DECL(int, v4l2_ioctl, struct tcb *const tcp, default: return RVAL_DECODED; } + + return RVAL_IOCTL_DECODED; } diff --git a/wait.c b/wait.c index 58dba8e4..dbc917b1 100644 --- a/wait.c +++ b/wait.c @@ -7,57 +7,18 @@ * Copyright (c) 2004 Ulrich Drepper * Copyright (c) 2009-2013 Denys Vlasenko * Copyright (c) 2014-2015 Dmitry V. Levin + * Copyright (c) 2014-2018 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" +#include "ptrace.h" -#include +#include "wait.h" #include "xlat/wait4_options.h" - -#if !defined WCOREFLAG && defined WCOREFLG -# define WCOREFLAG WCOREFLG -#endif -#ifndef WCOREFLAG -# define WCOREFLAG 0x80 -#endif -#ifndef WCOREDUMP -# define WCOREDUMP(status) ((status) & 0200) -#endif -#ifndef W_STOPCODE -# define W_STOPCODE(sig) ((sig) << 8 | 0x7f) -#endif -#ifndef W_EXITCODE -# define W_EXITCODE(ret, sig) ((ret) << 8 | (sig)) -#endif -#ifndef W_CONTINUED -# define W_CONTINUED 0xffff -#endif - -#include "ptrace.h" #include "xlat/ptrace_events.h" static int @@ -73,17 +34,15 @@ printstatus(int status) if (WIFSTOPPED(status)) { int sig = WSTOPSIG(status); tprintf("[{WIFSTOPPED(s) && WSTOPSIG(s) == %s%s}", - signame(sig & 0x7f), + sprintsigname(sig & 0x7f), sig & 0x80 ? " | 0x80" : ""); status &= ~W_STOPCODE(sig); - } - else if (WIFSIGNALED(status)) { + } else if (WIFSIGNALED(status)) { tprintf("[{WIFSIGNALED(s) && WTERMSIG(s) == %s%s}", - signame(WTERMSIG(status)), + sprintsigname(WTERMSIG(status)), WCOREDUMP(status) ? " && WCOREDUMP(s)" : ""); status &= ~(W_EXITCODE(0, WTERMSIG(status)) | WCOREFLAG); - } - else if (WIFEXITED(status)) { + } else if (WIFEXITED(status)) { tprintf("[{WIFEXITED(s) && WEXITSTATUS(s) == %d}", WEXITSTATUS(status)); exited = 1; diff --git a/wait.h b/wait.h new file mode 100644 index 00000000..f4e626bc --- /dev/null +++ b/wait.h @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2004-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_WAIT_H +# define STRACE_WAIT_H + +# include "defs.h" + +# include + +# include "static_assert.h" + +/* + * On Linux, the "core dumped" flag is hard-coded to 0x80: + * fs/coredump.c:coredump_finish() after v3.10-rc1~143^2~41, + * fs/coredump.c:do_coredump() between v3.7-rc1~134^2~4 and v3.10-rc1~143^2~41, + * or fs/exec.c:do_coredump() before v3.7-rc1~134^2~4 + */ +# ifndef WCOREFLAG +# define WCOREFLAG 0x80 +# else +static_assert((WCOREFLAG) == 0x80, "WCOREFLAG != 0x80"); +# endif +# ifndef WCOREDUMP +# define WCOREDUMP(status) ((status) & (WCOREFLAG)) +# endif + +# ifndef W_STOPCODE +# define W_STOPCODE(sig) ((sig) << 8 | 0x7f) +# endif +# ifndef W_EXITCODE +# define W_EXITCODE(ret, sig) ((ret) << 8 | (sig)) +# endif +# ifndef W_CONTINUED +# define W_CONTINUED 0xffff +# endif + +#endif /* STRACE_WAIT_H */ diff --git a/xattr.c b/xattr.c index e7f550bf..9e88a832 100644 --- a/xattr.c +++ b/xattr.c @@ -1,30 +1,10 @@ /* * Copyright (c) 2002-2005 Roland McGrath * Copyright (c) 2004 Ulrich Drepper - * Copyright (c) 2005-2016 Dmitry V. Levin + * Copyright (c) 2005-2018 Dmitry V. Levin * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ #include "defs.h" diff --git a/xfs_quota_stat.h b/xfs_quota_stat.h new file mode 100644 index 00000000..3e78004a --- /dev/null +++ b/xfs_quota_stat.h @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include +#include "kernel_types.h" + +typedef struct fs_qfilestat { + uint64_t qfs_ino; /* inode number */ + uint64_t qfs_nblks; /* number of BBs 512-byte-blks */ + uint32_t qfs_nextents; /* number of extents */ +} fs_qfilestat_t; + +struct xfs_dqstats { + int8_t qs_version; /* version number for future changes */ + uint16_t qs_flags; /* XFS_QUOTA_{U,P,G}DQ_{ACCT,ENFD} */ + int8_t qs_pad; /* unused */ + fs_qfilestat_t qs_uquota; /* user quota storage information */ + fs_qfilestat_t qs_gquota; /* group quota storage information */ + uint32_t qs_incoredqs; /* number of dquots incore */ + int32_t qs_btimelimit; /* limit for blks timer */ + int32_t qs_itimelimit; /* limit for inodes timer */ + int32_t qs_rtbtimelimit; /* limit for rt blks timer */ + uint16_t qs_bwarnlimit; /* limit for num warnings */ + uint16_t qs_iwarnlimit; /* limit for num warnings */ +}; diff --git a/xlat.c b/xlat.c new file mode 100644 index 00000000..62245f9c --- /dev/null +++ b/xlat.c @@ -0,0 +1,500 @@ +/* + * Copyright (c) 1991, 1992 Paul Kranenburg + * Copyright (c) 1993 Branko Lankester + * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey + * Copyright (c) 1996-1999 Wichert Akkerman + * Copyright (c) 1999-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#include "defs.h" +#include "xstring.h" +#include + +static inline enum xlat_style +get_xlat_style(enum xlat_style style) +{ + if (xlat_verbose(style) == XLAT_STYLE_DEFAULT) + return style | xlat_verbosity; + + return style; +} + +static inline const char * +sprint_xlat_val(uint64_t val, enum xlat_style style) +{ + static char buf[sizeof(val) * 3]; + + switch (xlat_format(style)) { + case XLAT_STYLE_FMT_D: + xsprintf(buf, "%" PRId64, val); + break; + + case XLAT_STYLE_FMT_U: + xsprintf(buf, "%" PRIu64, val); + break; + + case XLAT_STYLE_FMT_X: + xsprintf(buf, "%#" PRIx64, val); + break; + } + + return buf; +} + +static inline void +print_xlat_val(uint64_t val, enum xlat_style style) +{ + tprints(sprint_xlat_val(val, style)); +} + +const char * +xlookup(const struct xlat *xlat, const uint64_t val) +{ + static const struct xlat *pos; + + if (xlat) + pos = xlat; + + for (; pos->str != NULL; pos++) + if (pos->val == val) + return pos->str; + return NULL; +} + +static int +xlat_bsearch_compare(const void *a, const void *b) +{ + const uint64_t val1 = *(const uint64_t *) a; + const uint64_t val2 = ((const struct xlat *) b)->val; + return (val1 > val2) ? 1 : (val1 < val2) ? -1 : 0; +} + +const char * +xlat_search(const struct xlat *xlat, const size_t nmemb, const uint64_t val) +{ + static const struct xlat *pos; + static size_t memb_left; + + if (xlat) { + pos = xlat; + memb_left = nmemb; + } + + const struct xlat *e = + bsearch((const void *) &val, + pos, memb_left, sizeof(*pos), xlat_bsearch_compare); + + if (e) { + memb_left -= e - pos; + return e->str; + } else { + return NULL; + } +} + +/** + * Print entry in struct xlat table, if there. + * + * @param val Value to search a literal representation for. + * @param dflt String (abbreviated in comment syntax) which should be emitted + * if no appropriate xlat value has been found. + * @param style Style in which xlat value should be printed. + * @param xlat (And the following arguments) Pointers to arrays of xlat values. + * The last argument should be NULL. + * @return 1 if appropriate xlat value has been found, 0 otherwise. + */ +int +printxvals_ex(const uint64_t val, const char *dflt, enum xlat_style style, + const struct xlat *xlat, ...) +{ + static const struct xlat *last; + + style = get_xlat_style(style); + + if (xlat_verbose(style) == XLAT_STYLE_RAW) { + print_xlat_val(val, style); + return 0; + } + + const char *str = NULL; + va_list args; + + va_start(args, xlat); + + if (!xlat) + xlat = last; + + for (; xlat; xlat = va_arg(args, const struct xlat *)) { + last = xlat; + + str = xlookup(xlat, val); + + if (str) { + if (xlat_verbose(style) == XLAT_STYLE_VERBOSE) { + print_xlat_val(val, style); + tprints_comment(str); + } else { + tprints(str); + } + + goto printxvals_ex_end; + } + } + + /* No hits -- print raw # instead. */ + print_xlat_val(val, style); + tprints_comment(dflt); + +printxvals_ex_end: + va_end(args); + + return !!str; +} + +int +sprintxval_ex(char *const buf, const size_t size, const struct xlat *const x, + const unsigned int val, const char *const dflt, + enum xlat_style style) +{ + style = get_xlat_style(style); + + if (xlat_verbose(style) == XLAT_STYLE_RAW) + return xsnprintf(buf, size, "%s", sprint_xlat_val(val, style)); + + const char *const str = xlookup(x, val); + + if (str) { + if (xlat_verbose(style) == XLAT_STYLE_VERBOSE) + return xsnprintf(buf, size, "%s /* %s */", + sprint_xlat_val(val, style), str); + else + return xsnprintf(buf, size, "%s", str); + } + if (dflt) + return xsnprintf(buf, size, "%s /* %s */", + sprint_xlat_val(val, style), dflt); + + return xsnprintf(buf, size, "%s", sprint_xlat_val(val, style)); +} + +/** + * Print entry in sorted struct xlat table, if it is there. + * + * @param xlat Pointer to an array of xlat values (not terminated with + * XLAT_END). + * @param xlat_size Number of xlat elements present in array (usually ARRAY_SIZE + * if array is declared in the unit's scope and not + * terminated with XLAT_END). + * @param val Value to search literal representation for. + * @param dflt String (abbreviated in comment syntax) which should be + * emitted if no appropriate xlat value has been found. + * @param style Style in which xlat value should be printed. + * @param fn Search function. + * @return 1 if appropriate xlat value has been found, 0 + * otherwise. + */ +static int +printxval_sized(const struct xlat *xlat, size_t xlat_size, uint64_t val, + const char *dflt, enum xlat_style style, + const char *(* fn)(const struct xlat *, size_t, uint64_t)) +{ + style = get_xlat_style(style); + + if (xlat_verbose(style) == XLAT_STYLE_RAW) { + print_xlat_val(val, style); + return 0; + } + + const char *s = fn(xlat, xlat_size, val); + + if (s) { + if (xlat_verbose(style) == XLAT_STYLE_VERBOSE) { + print_xlat_val(val, style); + tprints_comment(s); + } else { + tprints(s); + } + return 1; + } + + print_xlat_val(val, style); + tprints_comment(dflt); + + return 0; +} + +int +printxval_searchn_ex(const struct xlat *xlat, size_t xlat_size, uint64_t val, + const char *dflt, enum xlat_style style) +{ + return printxval_sized(xlat, xlat_size, val, dflt, style, + xlat_search); +} + +const char * +xlat_idx(const struct xlat *xlat, size_t nmemb, uint64_t val) +{ + static const struct xlat *pos; + static size_t memb_left; + + if (xlat) { + pos = xlat; + memb_left = nmemb; + } + + if (val >= memb_left) + return NULL; + + if (val != pos[val].val) { + if (pos[val].val == 0) + return NULL; /* a hole in the index */ + + error_func_msg("Unexpected xlat value %" PRIu64 + " at index %" PRIu64, + pos[val].val, val); + return NULL; + } + + return pos[val].str; +} + +int +printxval_indexn_ex(const struct xlat *xlat, size_t xlat_size, uint64_t val, + const char *dflt, enum xlat_style style) +{ + return printxval_sized(xlat, xlat_size, val, dflt, style, xlat_idx); +} + +/* + * Interpret `xlat' as an array of flags. + * Print to static string the entries whose bits are on in `flags' + * Return static string. If 0 is provided as flags, and there is no flag that + * has the value of 0 (it should be the first in xlat table), return NULL. + * + * Expected output: + * +------------+------------+---------+------------+ + * | flags != 0 | xlat found | style | output | + * +------------+------------+---------+------------+ + * | false | (any) | raw | | + * | true | (any) | raw | VAL | + * +------------+------------+---------+------------+ + * | false | false | abbrev | | + * | true | false | abbrev | VAL | + * | (any) | true | abbrev | XLAT | + * +------------+------------+---------+------------+ + * | false | false | verbose | | + * | true | false | verbose | VAL | + * | (any) | true | verbose | VAL (XLAT) | + * +------------+------------+---------+------------+ + */ +const char * +sprintflags_ex(const char *prefix, const struct xlat *xlat, uint64_t flags, + enum xlat_style style) +{ + static char outstr[1024]; + char *outptr; + int found = 0; + + outptr = stpcpy(outstr, prefix); + style = get_xlat_style(style); + + if (xlat_verbose(style) == XLAT_STYLE_RAW) { + if (!flags) + return NULL; + + outptr = xappendstr(outstr, outptr, "%s", + sprint_xlat_val(flags, style)); + + return outstr; + } + + if (flags == 0 && xlat->val == 0 && xlat->str) { + if (xlat_verbose(style) == XLAT_STYLE_VERBOSE) { + outptr = xappendstr(outstr, outptr, "0 /* %s */", + xlat->str); + } else { + strcpy(outptr, xlat->str); + } + + return outstr; + } + + if (xlat_verbose(style) == XLAT_STYLE_VERBOSE && flags) + outptr = xappendstr(outstr, outptr, "%s", + sprint_xlat_val(flags, style)); + + for (; flags && xlat->str; xlat++) { + if (xlat->val && (flags & xlat->val) == xlat->val) { + if (found) + *outptr++ = '|'; + else if (xlat_verbose(style) == XLAT_STYLE_VERBOSE) + outptr = stpcpy(outptr, " /* "); + + outptr = stpcpy(outptr, xlat->str); + found = 1; + flags &= ~xlat->val; + } + } + + if (flags) { + if (found) + *outptr++ = '|'; + if (found || xlat_verbose(style) != XLAT_STYLE_VERBOSE) + outptr = xappendstr(outstr, outptr, "%s", + sprint_xlat_val(flags, style)); + } else { + if (!found) + return NULL; + } + + if (found && xlat_verbose(style) == XLAT_STYLE_VERBOSE) + outptr = stpcpy(outptr, " */"); + + return outstr; +} + +/** + * Print flags from multiple xlat tables. + * + * Expected output: + * +------------+--------------+------------+---------+------------+ + * | flags != 0 | dflt != NULL | xlat found | style | output | + * +------------+--------------+------------+---------+------------+ + * | false | false | (any) | raw | | + * | false | true | (any) | raw | VAL | + * | true | (any) | (any) | raw | VAL | + * +------------+--------------+------------+---------+------------+ + * | false | false | false | abbrev | | + * | false | true | false | abbrev | VAL | + * | true | false | false | abbrev | VAL | + * | true | true | false | abbrev | VAL (DFLT) | + * | (any) | (any) | true | abbrev | XLAT | + * +------------+--------------+------------+---------+------------+ + * | false | false | false | verbose | | + * | false | true | false | verbose | VAL | + * | true | false | false | verbose | VAL | + * | true | true | false | verbose | VAL (DFLT) | + * | (any) | (any) | true | verbose | VAL (XLAT) | + * +------------+--------------+------------+---------+------------+ + */ +int +printflags_ex(uint64_t flags, const char *dflt, enum xlat_style style, + const struct xlat *xlat, ...) +{ + style = get_xlat_style(style); + + if (xlat_verbose(style) == XLAT_STYLE_RAW) { + if (flags || dflt) { + print_xlat_val(flags, style); + return 1; + } + + return 0; + } + + const char *init_sep = ""; + unsigned int n = 0; + va_list args; + + if (xlat_verbose(style) == XLAT_STYLE_VERBOSE) { + init_sep = " /* "; + if (flags) + print_xlat_val(flags, style); + } + + va_start(args, xlat); + for (; xlat; xlat = va_arg(args, const struct xlat *)) { + for (; (flags || !n) && xlat->str; ++xlat) { + if ((flags == xlat->val) || + (xlat->val && (flags & xlat->val) == xlat->val)) { + if (xlat_verbose(style) == XLAT_STYLE_VERBOSE + && !flags) + tprints("0"); + tprintf("%s%s", + (n++ ? "|" : init_sep), xlat->str); + flags &= ~xlat->val; + } + if (!flags) + break; + } + } + va_end(args); + + if (n) { + if (flags) { + tprints("|"); + print_xlat_val(flags, style); + n++; + } + + if (xlat_verbose(style) == XLAT_STYLE_VERBOSE) + tprints(" */"); + } else { + if (flags) { + if (xlat_verbose(style) != XLAT_STYLE_VERBOSE) + print_xlat_val(flags, style); + tprints_comment(dflt); + } else { + if (dflt) + tprints("0"); + } + } + + return n; +} + +void +print_xlat_ex(const uint64_t val, const char *str, enum xlat_style style) +{ + bool default_str = style & PXF_DEFAULT_STR; + style = get_xlat_style(style); + + switch (xlat_verbose(style)) { + case XLAT_STYLE_ABBREV: + if (str) { + if (default_str) { + print_xlat_val(val, style); + tprints_comment(str); + } else { + tprints(str); + } + break; + } + ATTRIBUTE_FALLTHROUGH; + + case XLAT_STYLE_RAW: + print_xlat_val(val, style); + break; + + default: + error_func_msg("Unexpected style value of %#x", style); + ATTRIBUTE_FALLTHROUGH; + + case XLAT_STYLE_VERBOSE: + print_xlat_val(val, style); + tprints_comment(str); + } +} + +void +printxval_dispatch_ex(const struct xlat *xlat, size_t xlat_size, uint64_t val, + const char *dflt, enum xlat_type xt, + enum xlat_style style) +{ + switch (xt) { + case XT_NORMAL: + printxvals_ex(val, dflt, style, xlat, NULL); + break; + + case XT_SORTED: + printxval_searchn_ex(xlat, xlat_size, val, dflt, style); + break; + + case XT_INDEXED: + printxval_indexn_ex(xlat, xlat_size, val, dflt, style); + break; + } +} diff --git a/xlat.h b/xlat.h index aaa7aab0..366678ac 100644 --- a/xlat.h +++ b/xlat.h @@ -1,8 +1,53 @@ +/* + * Copyright (c) 2016-2018 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + #ifndef STRACE_XLAT_H -#define STRACE_XLAT_H +# define STRACE_XLAT_H # include +enum xlat_type { + XT_NORMAL, + XT_SORTED, + XT_INDEXED, +}; + +enum xlat_style { + /** + * Special value that is used for passing to *print{xval,flags}*_ex + * routines that indicates that no overriding of user-supplied xlat + * verbosity/formatting configuration is intended. + */ + XLAT_STYLE_DEFAULT = 0, + + /** Print xlat value as is without xlat processing */ + XLAT_STYLE_RAW = 1 << 0, + /** + * Historic strace style, process xlat and print the result (xlat + * constant name/combination of flags), raw number only if nothing is + * found. + */ + XLAT_STYLE_ABBREV = 1 << 1, + /** Always print both raw number and xlat processing result. */ + XLAT_STYLE_VERBOSE = XLAT_STYLE_RAW | XLAT_STYLE_ABBREV, + +# define XLAT_STYLE_FORMAT_SHIFT 2 +# define XLAT_STYLE_VERBOSITY_MASK ((1 << XLAT_STYLE_FORMAT_SHIFT) - 1) + + XLAT_STYLE_FMT_X = 0 << XLAT_STYLE_FORMAT_SHIFT, + XLAT_STYLE_FMT_U = 1 << XLAT_STYLE_FORMAT_SHIFT, + XLAT_STYLE_FMT_D = 2 << XLAT_STYLE_FORMAT_SHIFT, + +# define XLAT_STYLE_FORMAT_MASK (3 << XLAT_STYLE_FORMAT_SHIFT) + +# define XLAT_STYLE_SPEC_BITS (XLAT_STYLE_FORMAT_SHIFT + 2) +# define XLAT_STYLE_MASK ((1 << XLAT_STYLE_SPEC_BITS) - 1) +}; + struct xlat { uint64_t val; const char *str; diff --git a/xlat/Makemodule.am b/xlat/Makemodule.am index 5ba716a1..e7ac1c38 100644 --- a/xlat/Makemodule.am +++ b/xlat/Makemodule.am @@ -1,9 +1,7 @@ -XLAT_INPUT_FILES = xlat/access_flags.in xlat/aclipc.in xlat/addrfams.in xlat/adjtimex_modes.in xlat/adjtimex_state.in xlat/adjtimex_status.in xlat/advise.in xlat/af_packet_types.in xlat/archvals.in xlat/arp_hardware_types.in xlat/at_flags.in xlat/atomic_ops.in xlat/audit_arch.in xlat/baud_options.in xlat/blkpg_ops.in xlat/bootflags1.in xlat/bootflags2.in xlat/bootflags3.in xlat/bpf_attach_type.in xlat/bpf_class.in xlat/bpf_commands.in xlat/bpf_map_types.in xlat/bpf_map_update_elem_flags.in xlat/bpf_miscop.in xlat/bpf_mode.in xlat/bpf_op_alu.in xlat/bpf_op_jmp.in xlat/bpf_prog_types.in xlat/bpf_rval.in xlat/bpf_size.in xlat/bpf_src.in xlat/bsg_flags.in xlat/bsg_protocol.in xlat/bsg_subprotocol.in xlat/bt_protocols.in xlat/btrfs_balance_args.in xlat/btrfs_balance_ctl_cmds.in xlat/btrfs_balance_flags.in xlat/btrfs_balance_state.in xlat/btrfs_compress_types.in xlat/btrfs_defrag_flags.in xlat/btrfs_dev_replace_cmds.in xlat/btrfs_dev_replace_results.in xlat/btrfs_dev_replace_state.in xlat/btrfs_dev_stats_flags.in xlat/btrfs_dev_stats_values.in xlat/btrfs_features_compat.in xlat/btrfs_features_compat_ro.in xlat/btrfs_features_incompat.in xlat/btrfs_key_types.in xlat/btrfs_qgroup_ctl_cmds.in xlat/btrfs_qgroup_inherit_flags.in xlat/btrfs_qgroup_limit_flags.in xlat/btrfs_qgroup_status_flags.in xlat/btrfs_scrub_flags.in xlat/btrfs_send_flags.in xlat/btrfs_snap_flags_v2.in xlat/btrfs_space_info_flags.in xlat/btrfs_tree_objectids.in xlat/cacheflush_scope.in xlat/cap.in xlat/cap_mask0.in xlat/cap_mask1.in xlat/cap_version.in xlat/clockflags.in xlat/clocknames.in xlat/clone_flags.in xlat/cpuclocknames.in xlat/delete_module_flags.in xlat/dirent_types.in xlat/dm_flags.in xlat/efd_flags.in xlat/epollctls.in xlat/epollevents.in xlat/epollflags.in xlat/ethernet_protocols.in xlat/evdev_abs.in xlat/evdev_autorepeat.in xlat/evdev_ev.in xlat/evdev_ff_status.in xlat/evdev_ff_types.in xlat/evdev_keycode.in xlat/evdev_leds.in xlat/evdev_misc.in xlat/evdev_mtslots.in xlat/evdev_prop.in xlat/evdev_relative_axes.in xlat/evdev_snd.in xlat/evdev_switch.in xlat/evdev_sync.in xlat/f_owner_types.in xlat/f_seals.in xlat/falloc_flags.in xlat/fan_classes.in xlat/fan_event_flags.in xlat/fan_init_flags.in xlat/fan_mark_flags.in xlat/fcntl64cmds.in xlat/fcntlcmds.in xlat/fdflags.in xlat/fiemap_extent_flags.in xlat/fiemap_flags.in xlat/flockcmds.in xlat/fsmagic.in xlat/futexops.in xlat/futexwakecmps.in xlat/futexwakeops.in xlat/getrandom_flags.in xlat/getsockipoptions.in xlat/getsockipv6options.in xlat/hci_channels.in xlat/hw_breakpoint_len.in xlat/hw_breakpoint_type.in xlat/icmpfilterflags.in xlat/if_dqblk_valid.in xlat/if_dqinfo_flags.in xlat/if_dqinfo_valid.in xlat/iffflags.in xlat/inet_protocols.in xlat/inotify_flags.in xlat/inotify_init_flags.in xlat/ioctl_dirs.in xlat/ioprio_class.in xlat/ioprio_who.in xlat/ip_cmsg_types.in xlat/ipc_msg_flags.in xlat/ipccalls.in xlat/itimer_which.in xlat/kcmp_types.in xlat/kexec_arch_values.in xlat/kexec_file_load_flags.in xlat/kexec_load_flags.in xlat/key_perms.in xlat/key_reqkeys.in xlat/key_spec.in xlat/keyctl_commands.in xlat/lockfcmds.in xlat/loop_cmds.in xlat/loop_crypt_type_options.in xlat/loop_flags_options.in xlat/madvise_cmds.in xlat/mbindflags.in xlat/mctl_sync.in xlat/membarrier_cmds.in xlat/memfd_create_flags.in xlat/mempolicyflags.in xlat/mlock_flags.in xlat/mlockall_flags.in xlat/mmap_flags.in xlat/mmap_prot.in xlat/modem_flags.in xlat/modetypes.in xlat/module_init_flags.in xlat/mount_flags.in xlat/move_pages_flags.in xlat/mq_attr_flags.in xlat/mremap_flags.in xlat/msg_flags.in xlat/msgctl_flags.in xlat/mtd_file_mode_options.in xlat/mtd_flags_options.in xlat/mtd_mode_options.in xlat/mtd_nandecc_options.in xlat/mtd_otp_options.in xlat/mtd_type_options.in xlat/name_to_handle_at_flags.in xlat/netlink_flags.in xlat/netlink_protocols.in xlat/netlink_types.in xlat/notifyflags.in xlat/nt_descriptor_types.in xlat/open_access_modes.in xlat/open_mode_flags.in xlat/openmodessol.in xlat/packet_mreq_type.in xlat/perf_attr_size.in xlat/perf_branch_sample_type.in xlat/perf_event_open_flags.in xlat/perf_event_read_format.in xlat/perf_event_sample_format.in xlat/perf_hw_cache_id.in xlat/perf_hw_cache_op_id.in xlat/perf_hw_cache_op_result_id.in xlat/perf_hw_id.in xlat/perf_sw_ids.in xlat/perf_type_id.in xlat/personality_flags.in xlat/personality_types.in xlat/pkey_access.in xlat/policies.in xlat/pollflags.in xlat/pr_cap_ambient.in xlat/pr_dumpable.in xlat/pr_fp_mode.in xlat/pr_mce_kill.in xlat/pr_mce_kill_policy.in xlat/pr_set_mm.in xlat/pr_tsc.in xlat/pr_unalign_flags.in xlat/prctl_options.in xlat/priorities.in xlat/ptp_flags_options.in xlat/ptrace_cmds.in xlat/ptrace_events.in xlat/ptrace_peeksiginfo_flags.in xlat/ptrace_setoptions_flags.in xlat/quota_formats.in xlat/quotacmds.in xlat/quotatypes.in xlat/rename_flags.in xlat/resource_flags.in xlat/resources.in xlat/rwf_flags.in xlat/sa_handler_values.in xlat/sched_flags.in xlat/schedulers.in xlat/scmvals.in xlat/scsi_sg_commands.in xlat/secbits.in xlat/seccomp_filter_flags.in xlat/seccomp_mode.in xlat/seccomp_ops.in xlat/seccomp_ret_action.in xlat/semctl_flags.in xlat/semop_flags.in xlat/setns_types.in xlat/setsockipoptions.in xlat/setsockipv6options.in xlat/sfd_flags.in xlat/sg_io_dxfer_direction.in xlat/sg_io_flags.in xlat/sg_io_info.in xlat/sg_scsi_reset.in xlat/shm_flags.in xlat/shm_resource_flags.in xlat/shmctl_flags.in xlat/shutdown_modes.in xlat/sigact_flags.in xlat/sigaltstack_flags.in xlat/sigbus_codes.in xlat/sigchld_codes.in xlat/sigemt_codes.in xlat/sigev_value.in xlat/sigfpe_codes.in xlat/sigill_codes.in xlat/siginfo_codes.in xlat/sigpoll_codes.in xlat/sigprocmaskcmds.in xlat/sigprof_codes.in xlat/sigsegv_codes.in xlat/sigsys_codes.in xlat/sigtrap_codes.in xlat/sock_type_flags.in xlat/socketcalls.in xlat/socketlayers.in xlat/sockipoptions.in xlat/sockipv6options.in xlat/sockipxoptions.in xlat/sockoptions.in xlat/sockpacketoptions.in xlat/sockrawoptions.in xlat/socksctpoptions.in xlat/socktcpoptions.in xlat/socktypes.in xlat/splice_flags.in xlat/sram_alloc_flags.in xlat/statfs_flags.in xlat/swap_flags.in xlat/sync_file_range_flags.in xlat/sysctl_kern.in xlat/sysctl_net.in xlat/sysctl_net_core.in xlat/sysctl_net_ipv4.in xlat/sysctl_net_ipv4_conf.in xlat/sysctl_net_ipv4_route.in xlat/sysctl_net_ipv6.in xlat/sysctl_net_ipv6_route.in xlat/sysctl_net_unix.in xlat/sysctl_root.in xlat/sysctl_vm.in xlat/syslog_action_type.in xlat/sysmips_operations.in xlat/tcflsh_options.in xlat/tcxonc_options.in xlat/timerfdflags.in xlat/ubi_volume_props.in xlat/ubi_volume_types.in xlat/uffd_api_flags.in xlat/uffd_copy_flags.in xlat/uffd_flags.in xlat/uffd_register_ioctl_flags.in xlat/uffd_register_mode_flags.in xlat/uffd_zeropage_flags.in xlat/umount_flags.in xlat/unshare_flags.in xlat/usagewho.in xlat/v4l2_buf_flags.in xlat/v4l2_buf_types.in xlat/v4l2_capture_modes.in xlat/v4l2_colorspaces.in xlat/v4l2_control_classes.in xlat/v4l2_control_flags.in xlat/v4l2_control_ids.in xlat/v4l2_control_types.in xlat/v4l2_device_capabilities_flags.in xlat/v4l2_fields.in xlat/v4l2_format_description_flags.in xlat/v4l2_frameinterval_types.in xlat/v4l2_framesize_types.in xlat/v4l2_input_types.in xlat/v4l2_memories.in xlat/v4l2_streaming_capabilities.in xlat/wait4_options.in xlat/waitid_types.in xlat/whence_codes.in xlat/xattrflags.in xlat/xfs_dqblk_flags.in xlat/xfs_quota_flags.in -XLAT_HEADER_FILES = xlat/access_flags.h xlat/aclipc.h xlat/addrfams.h xlat/adjtimex_modes.h xlat/adjtimex_state.h xlat/adjtimex_status.h xlat/advise.h xlat/af_packet_types.h xlat/archvals.h xlat/arp_hardware_types.h xlat/at_flags.h xlat/atomic_ops.h xlat/audit_arch.h xlat/baud_options.h xlat/blkpg_ops.h xlat/bootflags1.h xlat/bootflags2.h xlat/bootflags3.h xlat/bpf_attach_type.h xlat/bpf_class.h xlat/bpf_commands.h xlat/bpf_map_types.h xlat/bpf_map_update_elem_flags.h xlat/bpf_miscop.h xlat/bpf_mode.h xlat/bpf_op_alu.h xlat/bpf_op_jmp.h xlat/bpf_prog_types.h xlat/bpf_rval.h xlat/bpf_size.h xlat/bpf_src.h xlat/bsg_flags.h xlat/bsg_protocol.h xlat/bsg_subprotocol.h xlat/bt_protocols.h xlat/btrfs_balance_args.h xlat/btrfs_balance_ctl_cmds.h xlat/btrfs_balance_flags.h xlat/btrfs_balance_state.h xlat/btrfs_compress_types.h xlat/btrfs_defrag_flags.h xlat/btrfs_dev_replace_cmds.h xlat/btrfs_dev_replace_results.h xlat/btrfs_dev_replace_state.h xlat/btrfs_dev_stats_flags.h xlat/btrfs_dev_stats_values.h xlat/btrfs_features_compat.h xlat/btrfs_features_compat_ro.h xlat/btrfs_features_incompat.h xlat/btrfs_key_types.h xlat/btrfs_qgroup_ctl_cmds.h xlat/btrfs_qgroup_inherit_flags.h xlat/btrfs_qgroup_limit_flags.h xlat/btrfs_qgroup_status_flags.h xlat/btrfs_scrub_flags.h xlat/btrfs_send_flags.h xlat/btrfs_snap_flags_v2.h xlat/btrfs_space_info_flags.h xlat/btrfs_tree_objectids.h xlat/cacheflush_scope.h xlat/cap.h xlat/cap_mask0.h xlat/cap_mask1.h xlat/cap_version.h xlat/clockflags.h xlat/clocknames.h xlat/clone_flags.h xlat/cpuclocknames.h xlat/delete_module_flags.h xlat/dirent_types.h xlat/dm_flags.h xlat/efd_flags.h xlat/epollctls.h xlat/epollevents.h xlat/epollflags.h xlat/ethernet_protocols.h xlat/evdev_abs.h xlat/evdev_autorepeat.h xlat/evdev_ev.h xlat/evdev_ff_status.h xlat/evdev_ff_types.h xlat/evdev_keycode.h xlat/evdev_leds.h xlat/evdev_misc.h xlat/evdev_mtslots.h xlat/evdev_prop.h xlat/evdev_relative_axes.h xlat/evdev_snd.h xlat/evdev_switch.h xlat/evdev_sync.h xlat/f_owner_types.h xlat/f_seals.h xlat/falloc_flags.h xlat/fan_classes.h xlat/fan_event_flags.h xlat/fan_init_flags.h xlat/fan_mark_flags.h xlat/fcntl64cmds.h xlat/fcntlcmds.h xlat/fdflags.h xlat/fiemap_extent_flags.h xlat/fiemap_flags.h xlat/flockcmds.h xlat/fsmagic.h xlat/futexops.h xlat/futexwakecmps.h xlat/futexwakeops.h xlat/getrandom_flags.h xlat/getsockipoptions.h xlat/getsockipv6options.h xlat/hci_channels.h xlat/hw_breakpoint_len.h xlat/hw_breakpoint_type.h xlat/icmpfilterflags.h xlat/if_dqblk_valid.h xlat/if_dqinfo_flags.h xlat/if_dqinfo_valid.h xlat/iffflags.h xlat/inet_protocols.h xlat/inotify_flags.h xlat/inotify_init_flags.h xlat/ioctl_dirs.h xlat/ioprio_class.h xlat/ioprio_who.h xlat/ip_cmsg_types.h xlat/ipc_msg_flags.h xlat/ipccalls.h xlat/itimer_which.h xlat/kcmp_types.h xlat/kexec_arch_values.h xlat/kexec_file_load_flags.h xlat/kexec_load_flags.h xlat/key_perms.h xlat/key_reqkeys.h xlat/key_spec.h xlat/keyctl_commands.h xlat/lockfcmds.h xlat/loop_cmds.h xlat/loop_crypt_type_options.h xlat/loop_flags_options.h xlat/madvise_cmds.h xlat/mbindflags.h xlat/mctl_sync.h xlat/membarrier_cmds.h xlat/memfd_create_flags.h xlat/mempolicyflags.h xlat/mlock_flags.h xlat/mlockall_flags.h xlat/mmap_flags.h xlat/mmap_prot.h xlat/modem_flags.h xlat/modetypes.h xlat/module_init_flags.h xlat/mount_flags.h xlat/move_pages_flags.h xlat/mq_attr_flags.h xlat/mremap_flags.h xlat/msg_flags.h xlat/msgctl_flags.h xlat/mtd_file_mode_options.h xlat/mtd_flags_options.h xlat/mtd_mode_options.h xlat/mtd_nandecc_options.h xlat/mtd_otp_options.h xlat/mtd_type_options.h xlat/name_to_handle_at_flags.h xlat/netlink_flags.h xlat/netlink_protocols.h xlat/netlink_types.h xlat/notifyflags.h xlat/nt_descriptor_types.h xlat/open_access_modes.h xlat/open_mode_flags.h xlat/openmodessol.h xlat/packet_mreq_type.h xlat/perf_attr_size.h xlat/perf_branch_sample_type.h xlat/perf_event_open_flags.h xlat/perf_event_read_format.h xlat/perf_event_sample_format.h xlat/perf_hw_cache_id.h xlat/perf_hw_cache_op_id.h xlat/perf_hw_cache_op_result_id.h xlat/perf_hw_id.h xlat/perf_sw_ids.h xlat/perf_type_id.h xlat/personality_flags.h xlat/personality_types.h xlat/pkey_access.h xlat/policies.h xlat/pollflags.h xlat/pr_cap_ambient.h xlat/pr_dumpable.h xlat/pr_fp_mode.h xlat/pr_mce_kill.h xlat/pr_mce_kill_policy.h xlat/pr_set_mm.h xlat/pr_tsc.h xlat/pr_unalign_flags.h xlat/prctl_options.h xlat/priorities.h xlat/ptp_flags_options.h xlat/ptrace_cmds.h xlat/ptrace_events.h xlat/ptrace_peeksiginfo_flags.h xlat/ptrace_setoptions_flags.h xlat/quota_formats.h xlat/quotacmds.h xlat/quotatypes.h xlat/rename_flags.h xlat/resource_flags.h xlat/resources.h xlat/rwf_flags.h xlat/sa_handler_values.h xlat/sched_flags.h xlat/schedulers.h xlat/scmvals.h xlat/scsi_sg_commands.h xlat/secbits.h xlat/seccomp_filter_flags.h xlat/seccomp_mode.h xlat/seccomp_ops.h xlat/seccomp_ret_action.h xlat/semctl_flags.h xlat/semop_flags.h xlat/setns_types.h xlat/setsockipoptions.h xlat/setsockipv6options.h xlat/sfd_flags.h xlat/sg_io_dxfer_direction.h xlat/sg_io_flags.h xlat/sg_io_info.h xlat/sg_scsi_reset.h xlat/shm_flags.h xlat/shm_resource_flags.h xlat/shmctl_flags.h xlat/shutdown_modes.h xlat/sigact_flags.h xlat/sigaltstack_flags.h xlat/sigbus_codes.h xlat/sigchld_codes.h xlat/sigemt_codes.h xlat/sigev_value.h xlat/sigfpe_codes.h xlat/sigill_codes.h xlat/siginfo_codes.h xlat/sigpoll_codes.h xlat/sigprocmaskcmds.h xlat/sigprof_codes.h xlat/sigsegv_codes.h xlat/sigsys_codes.h xlat/sigtrap_codes.h xlat/sock_type_flags.h xlat/socketcalls.h xlat/socketlayers.h xlat/sockipoptions.h xlat/sockipv6options.h xlat/sockipxoptions.h xlat/sockoptions.h xlat/sockpacketoptions.h xlat/sockrawoptions.h xlat/socksctpoptions.h xlat/socktcpoptions.h xlat/socktypes.h xlat/splice_flags.h xlat/sram_alloc_flags.h xlat/statfs_flags.h xlat/swap_flags.h xlat/sync_file_range_flags.h xlat/sysctl_kern.h xlat/sysctl_net.h xlat/sysctl_net_core.h xlat/sysctl_net_ipv4.h xlat/sysctl_net_ipv4_conf.h xlat/sysctl_net_ipv4_route.h xlat/sysctl_net_ipv6.h xlat/sysctl_net_ipv6_route.h xlat/sysctl_net_unix.h xlat/sysctl_root.h xlat/sysctl_vm.h xlat/syslog_action_type.h xlat/sysmips_operations.h xlat/tcflsh_options.h xlat/tcxonc_options.h xlat/timerfdflags.h xlat/ubi_volume_props.h xlat/ubi_volume_types.h xlat/uffd_api_flags.h xlat/uffd_copy_flags.h xlat/uffd_flags.h xlat/uffd_register_ioctl_flags.h xlat/uffd_register_mode_flags.h xlat/uffd_zeropage_flags.h xlat/umount_flags.h xlat/unshare_flags.h xlat/usagewho.h xlat/v4l2_buf_flags.h xlat/v4l2_buf_types.h xlat/v4l2_capture_modes.h xlat/v4l2_colorspaces.h xlat/v4l2_control_classes.h xlat/v4l2_control_flags.h xlat/v4l2_control_ids.h xlat/v4l2_control_types.h xlat/v4l2_device_capabilities_flags.h xlat/v4l2_fields.h xlat/v4l2_format_description_flags.h xlat/v4l2_frameinterval_types.h xlat/v4l2_framesize_types.h xlat/v4l2_input_types.h xlat/v4l2_memories.h xlat/v4l2_streaming_capabilities.h xlat/wait4_options.h xlat/waitid_types.h xlat/whence_codes.h xlat/xattrflags.h xlat/xfs_dqblk_flags.h xlat/xfs_quota_flags.h +XLAT_INPUT_FILES = xlat/access_flags.in xlat/addrfams.in xlat/adjtimex_modes.in xlat/adjtimex_state.in xlat/adjtimex_status.in xlat/advise.in xlat/af_packet_types.in xlat/af_packet_versions.in xlat/aio_cmds.in xlat/archvals.in xlat/arp_hardware_types.in xlat/at_flags.in xlat/at_statx_sync_types.in xlat/atomic_ops.in xlat/audit_arch.in xlat/ax25_protocols.in xlat/baud_options.in xlat/bdaddr_types.in xlat/blkpg_ops.in xlat/block_ioctl_cmds.in xlat/bluetooth_l2_cid.in xlat/bluetooth_l2_psm.in xlat/bootflags1.in xlat/bootflags2.in xlat/bootflags3.in xlat/bpf_attach_flags.in xlat/bpf_attach_type.in xlat/bpf_class.in xlat/bpf_commands.in xlat/bpf_file_mode_flags.in xlat/bpf_map_flags.in xlat/bpf_map_types.in xlat/bpf_map_update_elem_flags.in xlat/bpf_miscop.in xlat/bpf_mode.in xlat/bpf_op_alu.in xlat/bpf_op_jmp.in xlat/bpf_prog_flags.in xlat/bpf_prog_types.in xlat/bpf_query_flags.in xlat/bpf_rval.in xlat/bpf_size.in xlat/bpf_src.in xlat/bpf_task_fd_type.in xlat/bsg_flags.in xlat/bsg_protocol.in xlat/bsg_subprotocol.in xlat/bt_protocols.in xlat/btrfs_balance_args.in xlat/btrfs_balance_ctl_cmds.in xlat/btrfs_balance_flags.in xlat/btrfs_balance_state.in xlat/btrfs_compress_types.in xlat/btrfs_cont_reading_from_srcdev_mode.in xlat/btrfs_defrag_flags.in xlat/btrfs_dev_replace_cmds.in xlat/btrfs_dev_replace_results.in xlat/btrfs_dev_replace_state.in xlat/btrfs_dev_stats_flags.in xlat/btrfs_dev_stats_values.in xlat/btrfs_features_compat.in xlat/btrfs_features_compat_ro.in xlat/btrfs_features_incompat.in xlat/btrfs_key_types.in xlat/btrfs_logical_ino_args_flags.in xlat/btrfs_qgroup_ctl_cmds.in xlat/btrfs_qgroup_inherit_flags.in xlat/btrfs_qgroup_limit_flags.in xlat/btrfs_qgroup_status_flags.in xlat/btrfs_scrub_flags.in xlat/btrfs_send_flags.in xlat/btrfs_snap_flags_v2.in xlat/btrfs_space_info_flags.in xlat/btrfs_tree_objectids.in xlat/cacheflush_scope.in xlat/caif_protocols.in xlat/can_protocols.in xlat/cap.in xlat/cap_mask0.in xlat/cap_mask1.in xlat/cap_version.in xlat/clockflags.in xlat/clocknames.in xlat/clone_flags.in xlat/cpuclocknames.in xlat/crypto_nl_attrs.in xlat/dcb_commands.in xlat/delete_module_flags.in xlat/dirent_types.in xlat/dm_flags.in xlat/ebpf_class.in xlat/ebpf_mode.in xlat/ebpf_op_alu.in xlat/ebpf_op_jmp.in xlat/ebpf_regs.in xlat/ebpf_size.in xlat/efd_flags.in xlat/epollctls.in xlat/epollevents.in xlat/epollflags.in xlat/ethernet_protocols.in xlat/evdev_abs.in xlat/evdev_autorepeat.in xlat/evdev_ev.in xlat/evdev_ff_status.in xlat/evdev_ff_types.in xlat/evdev_keycode.in xlat/evdev_leds.in xlat/evdev_misc.in xlat/evdev_mtslots.in xlat/evdev_prop.in xlat/evdev_relative_axes.in xlat/evdev_snd.in xlat/evdev_switch.in xlat/f_owner_types.in xlat/f_seals.in xlat/falloc_flags.in xlat/fan_classes.in xlat/fan_event_flags.in xlat/fan_init_flags.in xlat/fan_mark_flags.in xlat/fcntlcmds.in xlat/fdflags.in xlat/fib_rule_actions.in xlat/fib_rule_flags.in xlat/fiemap_extent_flags.in xlat/fiemap_flags.in xlat/flockcmds.in xlat/fsmagic.in xlat/futexbitset.in xlat/futexops.in xlat/futexwakecmps.in xlat/futexwakeops.in xlat/getrandom_flags.in xlat/getsock_ip_options.in xlat/getsock_ipv6_options.in xlat/getsock_options.in xlat/hci_channels.in xlat/hw_breakpoint_len.in xlat/hw_breakpoint_type.in xlat/icmpfilterflags.in xlat/if_dqblk_valid.in xlat/if_dqinfo_flags.in xlat/if_dqinfo_valid.in xlat/ifaddrflags.in xlat/iffflags.in xlat/in6_addr_gen_mode.in xlat/inet6_devconf_indices.in xlat/inet6_if_flags.in xlat/inet_devconf_indices.in xlat/inet_diag_attrs.in xlat/inet_diag_bytecodes.in xlat/inet_diag_extended_flags.in xlat/inet_diag_req_attrs.in xlat/inet_protocols.in xlat/inotify_flags.in xlat/inotify_init_flags.in xlat/ioctl_dirs.in xlat/ioprio_class.in xlat/ioprio_who.in xlat/ip_cmsg_types.in xlat/ip_type_of_services.in xlat/ipc_msg_flags.in xlat/ipc_private.in xlat/ipccalls.in xlat/irda_protocols.in xlat/isdn_protocols.in xlat/itimer_which.in xlat/kcm_protocols.in xlat/kcmp_types.in xlat/kexec_arch_values.in xlat/kexec_file_load_flags.in xlat/kexec_load_flags.in xlat/key_perms.in xlat/key_reqkeys.in xlat/key_spec.in xlat/keyctl_commands.in xlat/kvm_cap.in xlat/kvm_cpuid_flags.in xlat/kvm_exit_reason.in xlat/kvm_mem_flags.in xlat/lockfcmds.in xlat/loop_cmds.in xlat/loop_crypt_type_options.in xlat/loop_flags_options.in xlat/lwtunnel_encap_types.in xlat/madvise_cmds.in xlat/mbindflags.in xlat/mctl_sync.in xlat/mdb_flags.in xlat/mdb_states.in xlat/membarrier_cmds.in xlat/memfd_create_flags.in xlat/mempolicyflags.in xlat/mlock_flags.in xlat/mlockall_flags.in xlat/mmap_flags.in xlat/mmap_prot.in xlat/modem_flags.in xlat/modetypes.in xlat/module_init_flags.in xlat/mount_flags.in xlat/move_pages_flags.in xlat/mq_attr_flags.in xlat/mremap_flags.in xlat/msg_flags.in xlat/msgctl_flags.in xlat/mtd_file_mode_options.in xlat/mtd_flags_options.in xlat/mtd_mode_options.in xlat/mtd_nandecc_options.in xlat/mtd_otp_options.in xlat/mtd_type_options.in xlat/multicast_router_types.in xlat/name_to_handle_at_flags.in xlat/nbd_ioctl_cmds.in xlat/nbd_ioctl_flags.in xlat/neighbor_cache_entry_flags.in xlat/neighbor_cache_entry_states.in xlat/netfilter_versions.in xlat/netlink_ack_flags.in xlat/netlink_delete_flags.in xlat/netlink_diag_attrs.in xlat/netlink_diag_show.in xlat/netlink_flags.in xlat/netlink_get_flags.in xlat/netlink_new_flags.in xlat/netlink_protocols.in xlat/netlink_sk_meminfo_indices.in xlat/netlink_socket_flags.in xlat/netlink_states.in xlat/netlink_types.in xlat/nf_acct_msg_types.in xlat/nf_cthelper_msg_types.in xlat/nf_ctnetlink_exp_msg_types.in xlat/nf_ctnetlink_msg_types.in xlat/nf_cttimeout_msg_types.in xlat/nf_ipset_msg_types.in xlat/nf_nft_compat_msg_types.in xlat/nf_nftables_msg_types.in xlat/nf_osf_msg_types.in xlat/nf_queue_msg_types.in xlat/nf_ulog_msg_types.in xlat/nfc_protocols.in xlat/nl_audit_types.in xlat/nl_crypto_types.in xlat/nl_netfilter_msg_types.in xlat/nl_netfilter_subsys_ids.in xlat/nl_route_types.in xlat/nl_selinux_types.in xlat/nl_sock_diag_types.in xlat/nl_xfrm_types.in xlat/nlmsgerr_attrs.in xlat/notifyflags.in xlat/nt_descriptor_types.in xlat/numa_node.in xlat/open_access_modes.in xlat/open_mode_flags.in xlat/packet_diag_attrs.in xlat/packet_diag_info_flags.in xlat/packet_diag_show.in xlat/packet_mreq_type.in xlat/perf_attr_size.in xlat/perf_branch_sample_type.in xlat/perf_event_open_flags.in xlat/perf_event_read_format.in xlat/perf_event_sample_format.in xlat/perf_hw_cache_id.in xlat/perf_hw_cache_op_id.in xlat/perf_hw_cache_op_result_id.in xlat/perf_hw_id.in xlat/perf_ioctl_cmds.in xlat/perf_ioctl_flags.in xlat/perf_sw_ids.in xlat/perf_type_id.in xlat/personality_flags.in xlat/personality_types.in xlat/phonet_protocols.in xlat/pkey_access.in xlat/policies.in xlat/pollflags.in xlat/pr_cap_ambient.in xlat/pr_dumpable.in xlat/pr_fp_mode.in xlat/pr_mce_kill.in xlat/pr_mce_kill_policy.in xlat/pr_set_mm.in xlat/pr_spec_cmds.in xlat/pr_spec_get_store_bypass_flags.in xlat/pr_spec_set_store_bypass_flags.in xlat/pr_sve_vl_flags.in xlat/pr_tsc.in xlat/pr_unalign_flags.in xlat/prctl_options.in xlat/priorities.in xlat/ptp_flags_options.in xlat/ptrace_cmds.in xlat/ptrace_events.in xlat/ptrace_peeksiginfo_flags.in xlat/ptrace_setoptions_flags.in xlat/ptrace_syscall_info_op.in xlat/quota_formats.in xlat/quotacmds.in xlat/quotatypes.in xlat/random_ioctl_cmds.in xlat/rename_flags.in xlat/resource_flags.in xlat/resources.in xlat/riscv_flush_icache_flags.in xlat/route_nexthop_flags.in xlat/routing_flags.in xlat/routing_protocols.in xlat/routing_scopes.in xlat/routing_table_ids.in xlat/routing_types.in xlat/rtnl_addr_attrs.in xlat/rtnl_addrlabel_attrs.in xlat/rtnl_dcb_attrs.in xlat/rtnl_ifla_af_spec_inet6_attrs.in xlat/rtnl_ifla_af_spec_inet_attrs.in xlat/rtnl_ifla_brport_attrs.in xlat/rtnl_ifla_events.in xlat/rtnl_ifla_info_attrs.in xlat/rtnl_ifla_info_data_bridge_attrs.in xlat/rtnl_ifla_info_data_tun_attrs.in xlat/rtnl_ifla_port_attrs.in xlat/rtnl_ifla_vf_port_attrs.in xlat/rtnl_ifla_xdp_attached_mode.in xlat/rtnl_ifla_xdp_attrs.in xlat/rtnl_link_attrs.in xlat/rtnl_mdb_attrs.in xlat/rtnl_mdba_mdb_attrs.in xlat/rtnl_mdba_mdb_eattr_attrs.in xlat/rtnl_mdba_mdb_entry_attrs.in xlat/rtnl_mdba_router_attrs.in xlat/rtnl_mdba_router_pattr_attrs.in xlat/rtnl_neigh_attrs.in xlat/rtnl_neightbl_attrs.in xlat/rtnl_neightbl_parms_attrs.in xlat/rtnl_netconf_attrs.in xlat/rtnl_nsid_attrs.in xlat/rtnl_route_attrs.in xlat/rtnl_rta_metrics_attrs.in xlat/rtnl_rule_attrs.in xlat/rtnl_tc_action_attrs.in xlat/rtnl_tc_attrs.in xlat/rtnl_tca_stab_attrs.in xlat/rtnl_tca_stats_attrs.in xlat/rwf_flags.in xlat/s390_guarded_storage_commands.in xlat/s390_runtime_instr_commands.in xlat/s390_sthyi_function_codes.in xlat/sa_handler_values.in xlat/sched_flags.in xlat/schedulers.in xlat/scmvals.in xlat/scsi_sg_commands.in xlat/secbits.in xlat/seccomp_filter_flags.in xlat/seccomp_mode.in xlat/seccomp_ops.in xlat/seccomp_ret_action.in xlat/semctl_flags.in xlat/semop_flags.in xlat/setns_types.in xlat/setsock_ip_options.in xlat/setsock_ipv6_options.in xlat/setsock_options.in xlat/sfd_flags.in xlat/sg_io_dxfer_direction.in xlat/sg_io_flags.in xlat/sg_io_info.in xlat/sg_scsi_reset.in xlat/shm_flags.in xlat/shm_resource_flags.in xlat/shmctl_flags.in xlat/shutdown_modes.in xlat/sigact_flags.in xlat/sigaltstack_flags.in xlat/sigbus_codes.in xlat/sigchld_codes.in xlat/sigemt_codes.in xlat/sigev_value.in xlat/sigfpe_codes.in xlat/sigill_codes.in xlat/siginfo_codes.in xlat/sigpoll_codes.in xlat/sigprocmaskcmds.in xlat/sigprof_codes.in xlat/sigsegv_codes.in xlat/sigsys_codes.in xlat/sigtrap_codes.in xlat/skf_ad.in xlat/skf_off.in xlat/smc_decl_codes.in xlat/smc_diag_attrs.in xlat/smc_diag_extended_flags.in xlat/smc_diag_mode.in xlat/smc_link_group_roles.in xlat/smc_protocols.in xlat/smc_states.in xlat/snmp_icmp6_stats.in xlat/snmp_ip_stats.in xlat/sock_alg_options.in xlat/sock_ax25_options.in xlat/sock_bluetooth_options.in xlat/sock_caif_options.in xlat/sock_dccp_options.in xlat/sock_ip_options.in xlat/sock_ipv6_options.in xlat/sock_ipx_options.in xlat/sock_irda_options.in xlat/sock_iucv_options.in xlat/sock_kcm_options.in xlat/sock_llc_options.in xlat/sock_netlink_options.in xlat/sock_nfcllcp_options.in xlat/sock_options.in xlat/sock_packet_options.in xlat/sock_pnp_options.in xlat/sock_pppol2tp_options.in xlat/sock_raw_options.in xlat/sock_rds_options.in xlat/sock_rxrpc_options.in xlat/sock_sctp_options.in xlat/sock_shutdown_flags.in xlat/sock_tcp_options.in xlat/sock_tipc_options.in xlat/sock_tls_options.in xlat/sock_type_flags.in xlat/sock_udp_options.in xlat/sock_xdp_options.in xlat/socketcalls.in xlat/socketlayers.in xlat/socktypes.in xlat/sparc_kern_features.in xlat/splice_flags.in xlat/sram_alloc_flags.in xlat/statfs_flags.in xlat/statx_attrs.in xlat/statx_masks.in xlat/swap_flags.in xlat/sync_file_range_flags.in xlat/sysctl_kern.in xlat/sysctl_net.in xlat/sysctl_net_core.in xlat/sysctl_net_ipv4.in xlat/sysctl_net_ipv4_conf.in xlat/sysctl_net_ipv4_route.in xlat/sysctl_net_ipv6.in xlat/sysctl_net_ipv6_route.in xlat/sysctl_net_unix.in xlat/sysctl_root.in xlat/sysctl_vm.in xlat/syslog_action_type.in xlat/sysmips_operations.in xlat/tcflsh_options.in xlat/tcp_state_flags.in xlat/tcp_states.in xlat/tcxonc_options.in xlat/timerfdflags.in xlat/tun_device_types.in xlat/ubi_volume_props.in xlat/ubi_volume_types.in xlat/uffd_api_features.in xlat/uffd_api_flags.in xlat/uffd_copy_flags.in xlat/uffd_flags.in xlat/uffd_register_ioctl_flags.in xlat/uffd_register_mode_flags.in xlat/uffd_zeropage_flags.in xlat/umount_flags.in xlat/unix_diag_attrs.in xlat/unix_diag_show.in xlat/unshare_flags.in xlat/uring_enter_flags.in xlat/uring_register_opcodes.in xlat/uring_setup_flags.in xlat/usagewho.in xlat/v4l2_buf_flags.in xlat/v4l2_buf_types.in xlat/v4l2_capture_modes.in xlat/v4l2_colorspaces.in xlat/v4l2_control_classes.in xlat/v4l2_control_flags.in xlat/v4l2_control_id_bases.in xlat/v4l2_control_ids.in xlat/v4l2_control_types.in xlat/v4l2_device_capabilities_flags.in xlat/v4l2_fields.in xlat/v4l2_format_description_flags.in xlat/v4l2_frameinterval_types.in xlat/v4l2_framesize_types.in xlat/v4l2_input_types.in xlat/v4l2_memories.in xlat/v4l2_pix_fmts.in xlat/v4l2_sdr_fmts.in xlat/v4l2_sliced_flags.in xlat/v4l2_streaming_capabilities.in xlat/v4l2_tuner_audmodes.in xlat/v4l2_tuner_capabilities.in xlat/v4l2_tuner_rxsubchanses.in xlat/v4l2_tuner_types.in xlat/v4l2_vbi_flags.in xlat/wait4_options.in xlat/waitid_types.in xlat/whence_codes.in xlat/xattrflags.in xlat/xdp_flags.in xlat/xfs_dqblk_flags.in xlat/xfs_quota_flags.in +XLAT_HEADER_FILES = xlat/access_flags.h xlat/addrfams.h xlat/adjtimex_modes.h xlat/adjtimex_state.h xlat/adjtimex_status.h xlat/advise.h xlat/af_packet_types.h xlat/af_packet_versions.h xlat/aio_cmds.h xlat/archvals.h xlat/arp_hardware_types.h xlat/at_flags.h xlat/at_statx_sync_types.h xlat/atomic_ops.h xlat/audit_arch.h xlat/ax25_protocols.h xlat/baud_options.h xlat/bdaddr_types.h xlat/blkpg_ops.h xlat/block_ioctl_cmds.h xlat/bluetooth_l2_cid.h xlat/bluetooth_l2_psm.h xlat/bootflags1.h xlat/bootflags2.h xlat/bootflags3.h xlat/bpf_attach_flags.h xlat/bpf_attach_type.h xlat/bpf_class.h xlat/bpf_commands.h xlat/bpf_file_mode_flags.h xlat/bpf_map_flags.h xlat/bpf_map_types.h xlat/bpf_map_update_elem_flags.h xlat/bpf_miscop.h xlat/bpf_mode.h xlat/bpf_op_alu.h xlat/bpf_op_jmp.h xlat/bpf_prog_flags.h xlat/bpf_prog_types.h xlat/bpf_query_flags.h xlat/bpf_rval.h xlat/bpf_size.h xlat/bpf_src.h xlat/bpf_task_fd_type.h xlat/bsg_flags.h xlat/bsg_protocol.h xlat/bsg_subprotocol.h xlat/bt_protocols.h xlat/btrfs_balance_args.h xlat/btrfs_balance_ctl_cmds.h xlat/btrfs_balance_flags.h xlat/btrfs_balance_state.h xlat/btrfs_compress_types.h xlat/btrfs_cont_reading_from_srcdev_mode.h xlat/btrfs_defrag_flags.h xlat/btrfs_dev_replace_cmds.h xlat/btrfs_dev_replace_results.h xlat/btrfs_dev_replace_state.h xlat/btrfs_dev_stats_flags.h xlat/btrfs_dev_stats_values.h xlat/btrfs_features_compat.h xlat/btrfs_features_compat_ro.h xlat/btrfs_features_incompat.h xlat/btrfs_key_types.h xlat/btrfs_logical_ino_args_flags.h xlat/btrfs_qgroup_ctl_cmds.h xlat/btrfs_qgroup_inherit_flags.h xlat/btrfs_qgroup_limit_flags.h xlat/btrfs_qgroup_status_flags.h xlat/btrfs_scrub_flags.h xlat/btrfs_send_flags.h xlat/btrfs_snap_flags_v2.h xlat/btrfs_space_info_flags.h xlat/btrfs_tree_objectids.h xlat/cacheflush_scope.h xlat/caif_protocols.h xlat/can_protocols.h xlat/cap.h xlat/cap_mask0.h xlat/cap_mask1.h xlat/cap_version.h xlat/clockflags.h xlat/clocknames.h xlat/clone_flags.h xlat/cpuclocknames.h xlat/crypto_nl_attrs.h xlat/dcb_commands.h xlat/delete_module_flags.h xlat/dirent_types.h xlat/dm_flags.h xlat/ebpf_class.h xlat/ebpf_mode.h xlat/ebpf_op_alu.h xlat/ebpf_op_jmp.h xlat/ebpf_regs.h xlat/ebpf_size.h xlat/efd_flags.h xlat/epollctls.h xlat/epollevents.h xlat/epollflags.h xlat/ethernet_protocols.h xlat/evdev_abs.h xlat/evdev_autorepeat.h xlat/evdev_ev.h xlat/evdev_ff_status.h xlat/evdev_ff_types.h xlat/evdev_keycode.h xlat/evdev_leds.h xlat/evdev_misc.h xlat/evdev_mtslots.h xlat/evdev_prop.h xlat/evdev_relative_axes.h xlat/evdev_snd.h xlat/evdev_switch.h xlat/f_owner_types.h xlat/f_seals.h xlat/falloc_flags.h xlat/fan_classes.h xlat/fan_event_flags.h xlat/fan_init_flags.h xlat/fan_mark_flags.h xlat/fcntlcmds.h xlat/fdflags.h xlat/fib_rule_actions.h xlat/fib_rule_flags.h xlat/fiemap_extent_flags.h xlat/fiemap_flags.h xlat/flockcmds.h xlat/fsmagic.h xlat/futexbitset.h xlat/futexops.h xlat/futexwakecmps.h xlat/futexwakeops.h xlat/getrandom_flags.h xlat/getsock_ip_options.h xlat/getsock_ipv6_options.h xlat/getsock_options.h xlat/hci_channels.h xlat/hw_breakpoint_len.h xlat/hw_breakpoint_type.h xlat/icmpfilterflags.h xlat/if_dqblk_valid.h xlat/if_dqinfo_flags.h xlat/if_dqinfo_valid.h xlat/ifaddrflags.h xlat/iffflags.h xlat/in6_addr_gen_mode.h xlat/inet6_devconf_indices.h xlat/inet6_if_flags.h xlat/inet_devconf_indices.h xlat/inet_diag_attrs.h xlat/inet_diag_bytecodes.h xlat/inet_diag_extended_flags.h xlat/inet_diag_req_attrs.h xlat/inet_protocols.h xlat/inotify_flags.h xlat/inotify_init_flags.h xlat/ioctl_dirs.h xlat/ioprio_class.h xlat/ioprio_who.h xlat/ip_cmsg_types.h xlat/ip_type_of_services.h xlat/ipc_msg_flags.h xlat/ipc_private.h xlat/ipccalls.h xlat/irda_protocols.h xlat/isdn_protocols.h xlat/itimer_which.h xlat/kcm_protocols.h xlat/kcmp_types.h xlat/kexec_arch_values.h xlat/kexec_file_load_flags.h xlat/kexec_load_flags.h xlat/key_perms.h xlat/key_reqkeys.h xlat/key_spec.h xlat/keyctl_commands.h xlat/kvm_cap.h xlat/kvm_cpuid_flags.h xlat/kvm_exit_reason.h xlat/kvm_mem_flags.h xlat/lockfcmds.h xlat/loop_cmds.h xlat/loop_crypt_type_options.h xlat/loop_flags_options.h xlat/lwtunnel_encap_types.h xlat/madvise_cmds.h xlat/mbindflags.h xlat/mctl_sync.h xlat/mdb_flags.h xlat/mdb_states.h xlat/membarrier_cmds.h xlat/memfd_create_flags.h xlat/mempolicyflags.h xlat/mlock_flags.h xlat/mlockall_flags.h xlat/mmap_flags.h xlat/mmap_prot.h xlat/modem_flags.h xlat/modetypes.h xlat/module_init_flags.h xlat/mount_flags.h xlat/move_pages_flags.h xlat/mq_attr_flags.h xlat/mremap_flags.h xlat/msg_flags.h xlat/msgctl_flags.h xlat/mtd_file_mode_options.h xlat/mtd_flags_options.h xlat/mtd_mode_options.h xlat/mtd_nandecc_options.h xlat/mtd_otp_options.h xlat/mtd_type_options.h xlat/multicast_router_types.h xlat/name_to_handle_at_flags.h xlat/nbd_ioctl_cmds.h xlat/nbd_ioctl_flags.h xlat/neighbor_cache_entry_flags.h xlat/neighbor_cache_entry_states.h xlat/netfilter_versions.h xlat/netlink_ack_flags.h xlat/netlink_delete_flags.h xlat/netlink_diag_attrs.h xlat/netlink_diag_show.h xlat/netlink_flags.h xlat/netlink_get_flags.h xlat/netlink_new_flags.h xlat/netlink_protocols.h xlat/netlink_sk_meminfo_indices.h xlat/netlink_socket_flags.h xlat/netlink_states.h xlat/netlink_types.h xlat/nf_acct_msg_types.h xlat/nf_cthelper_msg_types.h xlat/nf_ctnetlink_exp_msg_types.h xlat/nf_ctnetlink_msg_types.h xlat/nf_cttimeout_msg_types.h xlat/nf_ipset_msg_types.h xlat/nf_nft_compat_msg_types.h xlat/nf_nftables_msg_types.h xlat/nf_osf_msg_types.h xlat/nf_queue_msg_types.h xlat/nf_ulog_msg_types.h xlat/nfc_protocols.h xlat/nl_audit_types.h xlat/nl_crypto_types.h xlat/nl_netfilter_msg_types.h xlat/nl_netfilter_subsys_ids.h xlat/nl_route_types.h xlat/nl_selinux_types.h xlat/nl_sock_diag_types.h xlat/nl_xfrm_types.h xlat/nlmsgerr_attrs.h xlat/notifyflags.h xlat/nt_descriptor_types.h xlat/numa_node.h xlat/open_access_modes.h xlat/open_mode_flags.h xlat/packet_diag_attrs.h xlat/packet_diag_info_flags.h xlat/packet_diag_show.h xlat/packet_mreq_type.h xlat/perf_attr_size.h xlat/perf_branch_sample_type.h xlat/perf_event_open_flags.h xlat/perf_event_read_format.h xlat/perf_event_sample_format.h xlat/perf_hw_cache_id.h xlat/perf_hw_cache_op_id.h xlat/perf_hw_cache_op_result_id.h xlat/perf_hw_id.h xlat/perf_ioctl_cmds.h xlat/perf_ioctl_flags.h xlat/perf_sw_ids.h xlat/perf_type_id.h xlat/personality_flags.h xlat/personality_types.h xlat/phonet_protocols.h xlat/pkey_access.h xlat/policies.h xlat/pollflags.h xlat/pr_cap_ambient.h xlat/pr_dumpable.h xlat/pr_fp_mode.h xlat/pr_mce_kill.h xlat/pr_mce_kill_policy.h xlat/pr_set_mm.h xlat/pr_spec_cmds.h xlat/pr_spec_get_store_bypass_flags.h xlat/pr_spec_set_store_bypass_flags.h xlat/pr_sve_vl_flags.h xlat/pr_tsc.h xlat/pr_unalign_flags.h xlat/prctl_options.h xlat/priorities.h xlat/ptp_flags_options.h xlat/ptrace_cmds.h xlat/ptrace_events.h xlat/ptrace_peeksiginfo_flags.h xlat/ptrace_setoptions_flags.h xlat/ptrace_syscall_info_op.h xlat/quota_formats.h xlat/quotacmds.h xlat/quotatypes.h xlat/random_ioctl_cmds.h xlat/rename_flags.h xlat/resource_flags.h xlat/resources.h xlat/riscv_flush_icache_flags.h xlat/route_nexthop_flags.h xlat/routing_flags.h xlat/routing_protocols.h xlat/routing_scopes.h xlat/routing_table_ids.h xlat/routing_types.h xlat/rtnl_addr_attrs.h xlat/rtnl_addrlabel_attrs.h xlat/rtnl_dcb_attrs.h xlat/rtnl_ifla_af_spec_inet6_attrs.h xlat/rtnl_ifla_af_spec_inet_attrs.h xlat/rtnl_ifla_brport_attrs.h xlat/rtnl_ifla_events.h xlat/rtnl_ifla_info_attrs.h xlat/rtnl_ifla_info_data_bridge_attrs.h xlat/rtnl_ifla_info_data_tun_attrs.h xlat/rtnl_ifla_port_attrs.h xlat/rtnl_ifla_vf_port_attrs.h xlat/rtnl_ifla_xdp_attached_mode.h xlat/rtnl_ifla_xdp_attrs.h xlat/rtnl_link_attrs.h xlat/rtnl_mdb_attrs.h xlat/rtnl_mdba_mdb_attrs.h xlat/rtnl_mdba_mdb_eattr_attrs.h xlat/rtnl_mdba_mdb_entry_attrs.h xlat/rtnl_mdba_router_attrs.h xlat/rtnl_mdba_router_pattr_attrs.h xlat/rtnl_neigh_attrs.h xlat/rtnl_neightbl_attrs.h xlat/rtnl_neightbl_parms_attrs.h xlat/rtnl_netconf_attrs.h xlat/rtnl_nsid_attrs.h xlat/rtnl_route_attrs.h xlat/rtnl_rta_metrics_attrs.h xlat/rtnl_rule_attrs.h xlat/rtnl_tc_action_attrs.h xlat/rtnl_tc_attrs.h xlat/rtnl_tca_stab_attrs.h xlat/rtnl_tca_stats_attrs.h xlat/rwf_flags.h xlat/s390_guarded_storage_commands.h xlat/s390_runtime_instr_commands.h xlat/s390_sthyi_function_codes.h xlat/sa_handler_values.h xlat/sched_flags.h xlat/schedulers.h xlat/scmvals.h xlat/scsi_sg_commands.h xlat/secbits.h xlat/seccomp_filter_flags.h xlat/seccomp_mode.h xlat/seccomp_ops.h xlat/seccomp_ret_action.h xlat/semctl_flags.h xlat/semop_flags.h xlat/setns_types.h xlat/setsock_ip_options.h xlat/setsock_ipv6_options.h xlat/setsock_options.h xlat/sfd_flags.h xlat/sg_io_dxfer_direction.h xlat/sg_io_flags.h xlat/sg_io_info.h xlat/sg_scsi_reset.h xlat/shm_flags.h xlat/shm_resource_flags.h xlat/shmctl_flags.h xlat/shutdown_modes.h xlat/sigact_flags.h xlat/sigaltstack_flags.h xlat/sigbus_codes.h xlat/sigchld_codes.h xlat/sigemt_codes.h xlat/sigev_value.h xlat/sigfpe_codes.h xlat/sigill_codes.h xlat/siginfo_codes.h xlat/sigpoll_codes.h xlat/sigprocmaskcmds.h xlat/sigprof_codes.h xlat/sigsegv_codes.h xlat/sigsys_codes.h xlat/sigtrap_codes.h xlat/skf_ad.h xlat/skf_off.h xlat/smc_decl_codes.h xlat/smc_diag_attrs.h xlat/smc_diag_extended_flags.h xlat/smc_diag_mode.h xlat/smc_link_group_roles.h xlat/smc_protocols.h xlat/smc_states.h xlat/snmp_icmp6_stats.h xlat/snmp_ip_stats.h xlat/sock_alg_options.h xlat/sock_ax25_options.h xlat/sock_bluetooth_options.h xlat/sock_caif_options.h xlat/sock_dccp_options.h xlat/sock_ip_options.h xlat/sock_ipv6_options.h xlat/sock_ipx_options.h xlat/sock_irda_options.h xlat/sock_iucv_options.h xlat/sock_kcm_options.h xlat/sock_llc_options.h xlat/sock_netlink_options.h xlat/sock_nfcllcp_options.h xlat/sock_options.h xlat/sock_packet_options.h xlat/sock_pnp_options.h xlat/sock_pppol2tp_options.h xlat/sock_raw_options.h xlat/sock_rds_options.h xlat/sock_rxrpc_options.h xlat/sock_sctp_options.h xlat/sock_shutdown_flags.h xlat/sock_tcp_options.h xlat/sock_tipc_options.h xlat/sock_tls_options.h xlat/sock_type_flags.h xlat/sock_udp_options.h xlat/sock_xdp_options.h xlat/socketcalls.h xlat/socketlayers.h xlat/socktypes.h xlat/sparc_kern_features.h xlat/splice_flags.h xlat/sram_alloc_flags.h xlat/statfs_flags.h xlat/statx_attrs.h xlat/statx_masks.h xlat/swap_flags.h xlat/sync_file_range_flags.h xlat/sysctl_kern.h xlat/sysctl_net.h xlat/sysctl_net_core.h xlat/sysctl_net_ipv4.h xlat/sysctl_net_ipv4_conf.h xlat/sysctl_net_ipv4_route.h xlat/sysctl_net_ipv6.h xlat/sysctl_net_ipv6_route.h xlat/sysctl_net_unix.h xlat/sysctl_root.h xlat/sysctl_vm.h xlat/syslog_action_type.h xlat/sysmips_operations.h xlat/tcflsh_options.h xlat/tcp_state_flags.h xlat/tcp_states.h xlat/tcxonc_options.h xlat/timerfdflags.h xlat/tun_device_types.h xlat/ubi_volume_props.h xlat/ubi_volume_types.h xlat/uffd_api_features.h xlat/uffd_api_flags.h xlat/uffd_copy_flags.h xlat/uffd_flags.h xlat/uffd_register_ioctl_flags.h xlat/uffd_register_mode_flags.h xlat/uffd_zeropage_flags.h xlat/umount_flags.h xlat/unix_diag_attrs.h xlat/unix_diag_show.h xlat/unshare_flags.h xlat/uring_enter_flags.h xlat/uring_register_opcodes.h xlat/uring_setup_flags.h xlat/usagewho.h xlat/v4l2_buf_flags.h xlat/v4l2_buf_types.h xlat/v4l2_capture_modes.h xlat/v4l2_colorspaces.h xlat/v4l2_control_classes.h xlat/v4l2_control_flags.h xlat/v4l2_control_id_bases.h xlat/v4l2_control_ids.h xlat/v4l2_control_types.h xlat/v4l2_device_capabilities_flags.h xlat/v4l2_fields.h xlat/v4l2_format_description_flags.h xlat/v4l2_frameinterval_types.h xlat/v4l2_framesize_types.h xlat/v4l2_input_types.h xlat/v4l2_memories.h xlat/v4l2_pix_fmts.h xlat/v4l2_sdr_fmts.h xlat/v4l2_sliced_flags.h xlat/v4l2_streaming_capabilities.h xlat/v4l2_tuner_audmodes.h xlat/v4l2_tuner_capabilities.h xlat/v4l2_tuner_rxsubchanses.h xlat/v4l2_tuner_types.h xlat/v4l2_vbi_flags.h xlat/wait4_options.h xlat/waitid_types.h xlat/whence_codes.h xlat/xattrflags.h xlat/xdp_flags.h xlat/xfs_dqblk_flags.h xlat/xfs_quota_flags.h $(top_srcdir)/xlat/access_flags.h: $(top_srcdir)/xlat/access_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/aclipc.h: $(top_srcdir)/xlat/aclipc.in $(top_srcdir)/xlat/gen.sh - $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/addrfams.h: $(top_srcdir)/xlat/addrfams.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/adjtimex_modes.h: $(top_srcdir)/xlat/adjtimex_modes.in $(top_srcdir)/xlat/gen.sh @@ -16,32 +14,54 @@ $(top_srcdir)/xlat/advise.h: $(top_srcdir)/xlat/advise.in $(top_srcdir)/xlat/gen $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/af_packet_types.h: $(top_srcdir)/xlat/af_packet_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/af_packet_versions.h: $(top_srcdir)/xlat/af_packet_versions.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/aio_cmds.h: $(top_srcdir)/xlat/aio_cmds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/archvals.h: $(top_srcdir)/xlat/archvals.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/arp_hardware_types.h: $(top_srcdir)/xlat/arp_hardware_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/at_flags.h: $(top_srcdir)/xlat/at_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/at_statx_sync_types.h: $(top_srcdir)/xlat/at_statx_sync_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/atomic_ops.h: $(top_srcdir)/xlat/atomic_ops.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/audit_arch.h: $(top_srcdir)/xlat/audit_arch.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ax25_protocols.h: $(top_srcdir)/xlat/ax25_protocols.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/baud_options.h: $(top_srcdir)/xlat/baud_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bdaddr_types.h: $(top_srcdir)/xlat/bdaddr_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/blkpg_ops.h: $(top_srcdir)/xlat/blkpg_ops.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/block_ioctl_cmds.h: $(top_srcdir)/xlat/block_ioctl_cmds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bluetooth_l2_cid.h: $(top_srcdir)/xlat/bluetooth_l2_cid.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bluetooth_l2_psm.h: $(top_srcdir)/xlat/bluetooth_l2_psm.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bootflags1.h: $(top_srcdir)/xlat/bootflags1.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bootflags2.h: $(top_srcdir)/xlat/bootflags2.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bootflags3.h: $(top_srcdir)/xlat/bootflags3.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_attach_flags.h: $(top_srcdir)/xlat/bpf_attach_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bpf_attach_type.h: $(top_srcdir)/xlat/bpf_attach_type.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bpf_class.h: $(top_srcdir)/xlat/bpf_class.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bpf_commands.h: $(top_srcdir)/xlat/bpf_commands.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_file_mode_flags.h: $(top_srcdir)/xlat/bpf_file_mode_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_map_flags.h: $(top_srcdir)/xlat/bpf_map_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bpf_map_types.h: $(top_srcdir)/xlat/bpf_map_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bpf_map_update_elem_flags.h: $(top_srcdir)/xlat/bpf_map_update_elem_flags.in $(top_srcdir)/xlat/gen.sh @@ -54,14 +74,20 @@ $(top_srcdir)/xlat/bpf_op_alu.h: $(top_srcdir)/xlat/bpf_op_alu.in $(top_srcdir)/ $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bpf_op_jmp.h: $(top_srcdir)/xlat/bpf_op_jmp.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_prog_flags.h: $(top_srcdir)/xlat/bpf_prog_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bpf_prog_types.h: $(top_srcdir)/xlat/bpf_prog_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_query_flags.h: $(top_srcdir)/xlat/bpf_query_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bpf_rval.h: $(top_srcdir)/xlat/bpf_rval.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bpf_size.h: $(top_srcdir)/xlat/bpf_size.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bpf_src.h: $(top_srcdir)/xlat/bpf_src.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/bpf_task_fd_type.h: $(top_srcdir)/xlat/bpf_task_fd_type.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bsg_flags.h: $(top_srcdir)/xlat/bsg_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/bsg_protocol.h: $(top_srcdir)/xlat/bsg_protocol.in $(top_srcdir)/xlat/gen.sh @@ -80,6 +106,8 @@ $(top_srcdir)/xlat/btrfs_balance_state.h: $(top_srcdir)/xlat/btrfs_balance_state $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/btrfs_compress_types.h: $(top_srcdir)/xlat/btrfs_compress_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_cont_reading_from_srcdev_mode.h: $(top_srcdir)/xlat/btrfs_cont_reading_from_srcdev_mode.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/btrfs_defrag_flags.h: $(top_srcdir)/xlat/btrfs_defrag_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/btrfs_dev_replace_cmds.h: $(top_srcdir)/xlat/btrfs_dev_replace_cmds.in $(top_srcdir)/xlat/gen.sh @@ -100,6 +128,8 @@ $(top_srcdir)/xlat/btrfs_features_incompat.h: $(top_srcdir)/xlat/btrfs_features_ $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/btrfs_key_types.h: $(top_srcdir)/xlat/btrfs_key_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/btrfs_logical_ino_args_flags.h: $(top_srcdir)/xlat/btrfs_logical_ino_args_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/btrfs_qgroup_ctl_cmds.h: $(top_srcdir)/xlat/btrfs_qgroup_ctl_cmds.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/btrfs_qgroup_inherit_flags.h: $(top_srcdir)/xlat/btrfs_qgroup_inherit_flags.in $(top_srcdir)/xlat/gen.sh @@ -120,6 +150,10 @@ $(top_srcdir)/xlat/btrfs_tree_objectids.h: $(top_srcdir)/xlat/btrfs_tree_objecti $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/cacheflush_scope.h: $(top_srcdir)/xlat/cacheflush_scope.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/caif_protocols.h: $(top_srcdir)/xlat/caif_protocols.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/can_protocols.h: $(top_srcdir)/xlat/can_protocols.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/cap.h: $(top_srcdir)/xlat/cap.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/cap_mask0.h: $(top_srcdir)/xlat/cap_mask0.in $(top_srcdir)/xlat/gen.sh @@ -136,12 +170,28 @@ $(top_srcdir)/xlat/clone_flags.h: $(top_srcdir)/xlat/clone_flags.in $(top_srcdir $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/cpuclocknames.h: $(top_srcdir)/xlat/cpuclocknames.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/crypto_nl_attrs.h: $(top_srcdir)/xlat/crypto_nl_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/dcb_commands.h: $(top_srcdir)/xlat/dcb_commands.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/delete_module_flags.h: $(top_srcdir)/xlat/delete_module_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/dirent_types.h: $(top_srcdir)/xlat/dirent_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/dm_flags.h: $(top_srcdir)/xlat/dm_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ebpf_class.h: $(top_srcdir)/xlat/ebpf_class.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ebpf_mode.h: $(top_srcdir)/xlat/ebpf_mode.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ebpf_op_alu.h: $(top_srcdir)/xlat/ebpf_op_alu.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ebpf_op_jmp.h: $(top_srcdir)/xlat/ebpf_op_jmp.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ebpf_regs.h: $(top_srcdir)/xlat/ebpf_regs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ebpf_size.h: $(top_srcdir)/xlat/ebpf_size.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/efd_flags.h: $(top_srcdir)/xlat/efd_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/epollctls.h: $(top_srcdir)/xlat/epollctls.in $(top_srcdir)/xlat/gen.sh @@ -178,8 +228,6 @@ $(top_srcdir)/xlat/evdev_snd.h: $(top_srcdir)/xlat/evdev_snd.in $(top_srcdir)/xl $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/evdev_switch.h: $(top_srcdir)/xlat/evdev_switch.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/evdev_sync.h: $(top_srcdir)/xlat/evdev_sync.in $(top_srcdir)/xlat/gen.sh - $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/f_owner_types.h: $(top_srcdir)/xlat/f_owner_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/f_seals.h: $(top_srcdir)/xlat/f_seals.in $(top_srcdir)/xlat/gen.sh @@ -194,12 +242,14 @@ $(top_srcdir)/xlat/fan_init_flags.h: $(top_srcdir)/xlat/fan_init_flags.in $(top_ $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/fan_mark_flags.h: $(top_srcdir)/xlat/fan_mark_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/fcntl64cmds.h: $(top_srcdir)/xlat/fcntl64cmds.in $(top_srcdir)/xlat/gen.sh - $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/fcntlcmds.h: $(top_srcdir)/xlat/fcntlcmds.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/fdflags.h: $(top_srcdir)/xlat/fdflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/fib_rule_actions.h: $(top_srcdir)/xlat/fib_rule_actions.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/fib_rule_flags.h: $(top_srcdir)/xlat/fib_rule_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/fiemap_extent_flags.h: $(top_srcdir)/xlat/fiemap_extent_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/fiemap_flags.h: $(top_srcdir)/xlat/fiemap_flags.in $(top_srcdir)/xlat/gen.sh @@ -208,6 +258,8 @@ $(top_srcdir)/xlat/flockcmds.h: $(top_srcdir)/xlat/flockcmds.in $(top_srcdir)/xl $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/fsmagic.h: $(top_srcdir)/xlat/fsmagic.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/futexbitset.h: $(top_srcdir)/xlat/futexbitset.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/futexops.h: $(top_srcdir)/xlat/futexops.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/futexwakecmps.h: $(top_srcdir)/xlat/futexwakecmps.in $(top_srcdir)/xlat/gen.sh @@ -216,9 +268,11 @@ $(top_srcdir)/xlat/futexwakeops.h: $(top_srcdir)/xlat/futexwakeops.in $(top_srcd $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/getrandom_flags.h: $(top_srcdir)/xlat/getrandom_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/getsockipoptions.h: $(top_srcdir)/xlat/getsockipoptions.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/getsock_ip_options.h: $(top_srcdir)/xlat/getsock_ip_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/getsock_ipv6_options.h: $(top_srcdir)/xlat/getsock_ipv6_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/getsockipv6options.h: $(top_srcdir)/xlat/getsockipv6options.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/getsock_options.h: $(top_srcdir)/xlat/getsock_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/hci_channels.h: $(top_srcdir)/xlat/hci_channels.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ @@ -234,8 +288,26 @@ $(top_srcdir)/xlat/if_dqinfo_flags.h: $(top_srcdir)/xlat/if_dqinfo_flags.in $(to $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/if_dqinfo_valid.h: $(top_srcdir)/xlat/if_dqinfo_valid.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ifaddrflags.h: $(top_srcdir)/xlat/ifaddrflags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/iffflags.h: $(top_srcdir)/xlat/iffflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/in6_addr_gen_mode.h: $(top_srcdir)/xlat/in6_addr_gen_mode.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/inet6_devconf_indices.h: $(top_srcdir)/xlat/inet6_devconf_indices.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/inet6_if_flags.h: $(top_srcdir)/xlat/inet6_if_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/inet_devconf_indices.h: $(top_srcdir)/xlat/inet_devconf_indices.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/inet_diag_attrs.h: $(top_srcdir)/xlat/inet_diag_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/inet_diag_bytecodes.h: $(top_srcdir)/xlat/inet_diag_bytecodes.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/inet_diag_extended_flags.h: $(top_srcdir)/xlat/inet_diag_extended_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/inet_diag_req_attrs.h: $(top_srcdir)/xlat/inet_diag_req_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/inet_protocols.h: $(top_srcdir)/xlat/inet_protocols.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/inotify_flags.h: $(top_srcdir)/xlat/inotify_flags.in $(top_srcdir)/xlat/gen.sh @@ -250,12 +322,22 @@ $(top_srcdir)/xlat/ioprio_who.h: $(top_srcdir)/xlat/ioprio_who.in $(top_srcdir)/ $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/ip_cmsg_types.h: $(top_srcdir)/xlat/ip_cmsg_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ip_type_of_services.h: $(top_srcdir)/xlat/ip_type_of_services.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/ipc_msg_flags.h: $(top_srcdir)/xlat/ipc_msg_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ipc_private.h: $(top_srcdir)/xlat/ipc_private.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/ipccalls.h: $(top_srcdir)/xlat/ipccalls.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/irda_protocols.h: $(top_srcdir)/xlat/irda_protocols.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/isdn_protocols.h: $(top_srcdir)/xlat/isdn_protocols.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/itimer_which.h: $(top_srcdir)/xlat/itimer_which.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/kcm_protocols.h: $(top_srcdir)/xlat/kcm_protocols.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/kcmp_types.h: $(top_srcdir)/xlat/kcmp_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/kexec_arch_values.h: $(top_srcdir)/xlat/kexec_arch_values.in $(top_srcdir)/xlat/gen.sh @@ -272,6 +354,14 @@ $(top_srcdir)/xlat/key_spec.h: $(top_srcdir)/xlat/key_spec.in $(top_srcdir)/xlat $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/keyctl_commands.h: $(top_srcdir)/xlat/keyctl_commands.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/kvm_cap.h: $(top_srcdir)/xlat/kvm_cap.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/kvm_cpuid_flags.h: $(top_srcdir)/xlat/kvm_cpuid_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/kvm_exit_reason.h: $(top_srcdir)/xlat/kvm_exit_reason.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/kvm_mem_flags.h: $(top_srcdir)/xlat/kvm_mem_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/lockfcmds.h: $(top_srcdir)/xlat/lockfcmds.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/loop_cmds.h: $(top_srcdir)/xlat/loop_cmds.in $(top_srcdir)/xlat/gen.sh @@ -280,12 +370,18 @@ $(top_srcdir)/xlat/loop_crypt_type_options.h: $(top_srcdir)/xlat/loop_crypt_type $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/loop_flags_options.h: $(top_srcdir)/xlat/loop_flags_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/lwtunnel_encap_types.h: $(top_srcdir)/xlat/lwtunnel_encap_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/madvise_cmds.h: $(top_srcdir)/xlat/madvise_cmds.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/mbindflags.h: $(top_srcdir)/xlat/mbindflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/mctl_sync.h: $(top_srcdir)/xlat/mctl_sync.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/mdb_flags.h: $(top_srcdir)/xlat/mdb_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/mdb_states.h: $(top_srcdir)/xlat/mdb_states.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/membarrier_cmds.h: $(top_srcdir)/xlat/membarrier_cmds.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/memfd_create_flags.h: $(top_srcdir)/xlat/memfd_create_flags.in $(top_srcdir)/xlat/gen.sh @@ -330,23 +426,101 @@ $(top_srcdir)/xlat/mtd_otp_options.h: $(top_srcdir)/xlat/mtd_otp_options.in $(to $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/mtd_type_options.h: $(top_srcdir)/xlat/mtd_type_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/multicast_router_types.h: $(top_srcdir)/xlat/multicast_router_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/name_to_handle_at_flags.h: $(top_srcdir)/xlat/name_to_handle_at_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nbd_ioctl_cmds.h: $(top_srcdir)/xlat/nbd_ioctl_cmds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nbd_ioctl_flags.h: $(top_srcdir)/xlat/nbd_ioctl_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/neighbor_cache_entry_flags.h: $(top_srcdir)/xlat/neighbor_cache_entry_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/neighbor_cache_entry_states.h: $(top_srcdir)/xlat/neighbor_cache_entry_states.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netfilter_versions.h: $(top_srcdir)/xlat/netfilter_versions.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netlink_ack_flags.h: $(top_srcdir)/xlat/netlink_ack_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netlink_delete_flags.h: $(top_srcdir)/xlat/netlink_delete_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netlink_diag_attrs.h: $(top_srcdir)/xlat/netlink_diag_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netlink_diag_show.h: $(top_srcdir)/xlat/netlink_diag_show.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/netlink_flags.h: $(top_srcdir)/xlat/netlink_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netlink_get_flags.h: $(top_srcdir)/xlat/netlink_get_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netlink_new_flags.h: $(top_srcdir)/xlat/netlink_new_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/netlink_protocols.h: $(top_srcdir)/xlat/netlink_protocols.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netlink_sk_meminfo_indices.h: $(top_srcdir)/xlat/netlink_sk_meminfo_indices.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netlink_socket_flags.h: $(top_srcdir)/xlat/netlink_socket_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/netlink_states.h: $(top_srcdir)/xlat/netlink_states.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/netlink_types.h: $(top_srcdir)/xlat/netlink_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nf_acct_msg_types.h: $(top_srcdir)/xlat/nf_acct_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nf_cthelper_msg_types.h: $(top_srcdir)/xlat/nf_cthelper_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nf_ctnetlink_exp_msg_types.h: $(top_srcdir)/xlat/nf_ctnetlink_exp_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nf_ctnetlink_msg_types.h: $(top_srcdir)/xlat/nf_ctnetlink_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nf_cttimeout_msg_types.h: $(top_srcdir)/xlat/nf_cttimeout_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nf_ipset_msg_types.h: $(top_srcdir)/xlat/nf_ipset_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nf_nft_compat_msg_types.h: $(top_srcdir)/xlat/nf_nft_compat_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nf_nftables_msg_types.h: $(top_srcdir)/xlat/nf_nftables_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nf_osf_msg_types.h: $(top_srcdir)/xlat/nf_osf_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nf_queue_msg_types.h: $(top_srcdir)/xlat/nf_queue_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nf_ulog_msg_types.h: $(top_srcdir)/xlat/nf_ulog_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nfc_protocols.h: $(top_srcdir)/xlat/nfc_protocols.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nl_audit_types.h: $(top_srcdir)/xlat/nl_audit_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nl_crypto_types.h: $(top_srcdir)/xlat/nl_crypto_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nl_netfilter_msg_types.h: $(top_srcdir)/xlat/nl_netfilter_msg_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nl_netfilter_subsys_ids.h: $(top_srcdir)/xlat/nl_netfilter_subsys_ids.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nl_route_types.h: $(top_srcdir)/xlat/nl_route_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nl_selinux_types.h: $(top_srcdir)/xlat/nl_selinux_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nl_sock_diag_types.h: $(top_srcdir)/xlat/nl_sock_diag_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nl_xfrm_types.h: $(top_srcdir)/xlat/nl_xfrm_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/nlmsgerr_attrs.h: $(top_srcdir)/xlat/nlmsgerr_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/notifyflags.h: $(top_srcdir)/xlat/notifyflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/nt_descriptor_types.h: $(top_srcdir)/xlat/nt_descriptor_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/numa_node.h: $(top_srcdir)/xlat/numa_node.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/open_access_modes.h: $(top_srcdir)/xlat/open_access_modes.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/open_mode_flags.h: $(top_srcdir)/xlat/open_mode_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/openmodessol.h: $(top_srcdir)/xlat/openmodessol.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/packet_diag_attrs.h: $(top_srcdir)/xlat/packet_diag_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/packet_diag_info_flags.h: $(top_srcdir)/xlat/packet_diag_info_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/packet_diag_show.h: $(top_srcdir)/xlat/packet_diag_show.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/packet_mreq_type.h: $(top_srcdir)/xlat/packet_mreq_type.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ @@ -368,6 +542,10 @@ $(top_srcdir)/xlat/perf_hw_cache_op_result_id.h: $(top_srcdir)/xlat/perf_hw_cach $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/perf_hw_id.h: $(top_srcdir)/xlat/perf_hw_id.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/perf_ioctl_cmds.h: $(top_srcdir)/xlat/perf_ioctl_cmds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/perf_ioctl_flags.h: $(top_srcdir)/xlat/perf_ioctl_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/perf_sw_ids.h: $(top_srcdir)/xlat/perf_sw_ids.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/perf_type_id.h: $(top_srcdir)/xlat/perf_type_id.in $(top_srcdir)/xlat/gen.sh @@ -376,6 +554,8 @@ $(top_srcdir)/xlat/personality_flags.h: $(top_srcdir)/xlat/personality_flags.in $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/personality_types.h: $(top_srcdir)/xlat/personality_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/phonet_protocols.h: $(top_srcdir)/xlat/phonet_protocols.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/pkey_access.h: $(top_srcdir)/xlat/pkey_access.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/policies.h: $(top_srcdir)/xlat/policies.in $(top_srcdir)/xlat/gen.sh @@ -394,6 +574,14 @@ $(top_srcdir)/xlat/pr_mce_kill_policy.h: $(top_srcdir)/xlat/pr_mce_kill_policy.i $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/pr_set_mm.h: $(top_srcdir)/xlat/pr_set_mm.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_spec_cmds.h: $(top_srcdir)/xlat/pr_spec_cmds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_spec_get_store_bypass_flags.h: $(top_srcdir)/xlat/pr_spec_get_store_bypass_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_spec_set_store_bypass_flags.h: $(top_srcdir)/xlat/pr_spec_set_store_bypass_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/pr_sve_vl_flags.h: $(top_srcdir)/xlat/pr_sve_vl_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/pr_tsc.h: $(top_srcdir)/xlat/pr_tsc.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/pr_unalign_flags.h: $(top_srcdir)/xlat/pr_unalign_flags.in $(top_srcdir)/xlat/gen.sh @@ -412,20 +600,110 @@ $(top_srcdir)/xlat/ptrace_peeksiginfo_flags.h: $(top_srcdir)/xlat/ptrace_peeksig $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/ptrace_setoptions_flags.h: $(top_srcdir)/xlat/ptrace_setoptions_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/ptrace_syscall_info_op.h: $(top_srcdir)/xlat/ptrace_syscall_info_op.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/quota_formats.h: $(top_srcdir)/xlat/quota_formats.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/quotacmds.h: $(top_srcdir)/xlat/quotacmds.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/quotatypes.h: $(top_srcdir)/xlat/quotatypes.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/random_ioctl_cmds.h: $(top_srcdir)/xlat/random_ioctl_cmds.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/rename_flags.h: $(top_srcdir)/xlat/rename_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/resource_flags.h: $(top_srcdir)/xlat/resource_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/resources.h: $(top_srcdir)/xlat/resources.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/riscv_flush_icache_flags.h: $(top_srcdir)/xlat/riscv_flush_icache_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/route_nexthop_flags.h: $(top_srcdir)/xlat/route_nexthop_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/routing_flags.h: $(top_srcdir)/xlat/routing_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/routing_protocols.h: $(top_srcdir)/xlat/routing_protocols.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/routing_scopes.h: $(top_srcdir)/xlat/routing_scopes.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/routing_table_ids.h: $(top_srcdir)/xlat/routing_table_ids.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/routing_types.h: $(top_srcdir)/xlat/routing_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_addr_attrs.h: $(top_srcdir)/xlat/rtnl_addr_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_addrlabel_attrs.h: $(top_srcdir)/xlat/rtnl_addrlabel_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_dcb_attrs.h: $(top_srcdir)/xlat/rtnl_dcb_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_ifla_af_spec_inet6_attrs.h: $(top_srcdir)/xlat/rtnl_ifla_af_spec_inet6_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_ifla_af_spec_inet_attrs.h: $(top_srcdir)/xlat/rtnl_ifla_af_spec_inet_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_ifla_brport_attrs.h: $(top_srcdir)/xlat/rtnl_ifla_brport_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_ifla_events.h: $(top_srcdir)/xlat/rtnl_ifla_events.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_ifla_info_attrs.h: $(top_srcdir)/xlat/rtnl_ifla_info_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_ifla_info_data_bridge_attrs.h: $(top_srcdir)/xlat/rtnl_ifla_info_data_bridge_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_ifla_info_data_tun_attrs.h: $(top_srcdir)/xlat/rtnl_ifla_info_data_tun_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_ifla_port_attrs.h: $(top_srcdir)/xlat/rtnl_ifla_port_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_ifla_vf_port_attrs.h: $(top_srcdir)/xlat/rtnl_ifla_vf_port_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_ifla_xdp_attached_mode.h: $(top_srcdir)/xlat/rtnl_ifla_xdp_attached_mode.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_ifla_xdp_attrs.h: $(top_srcdir)/xlat/rtnl_ifla_xdp_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_link_attrs.h: $(top_srcdir)/xlat/rtnl_link_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_mdb_attrs.h: $(top_srcdir)/xlat/rtnl_mdb_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_mdba_mdb_attrs.h: $(top_srcdir)/xlat/rtnl_mdba_mdb_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_mdba_mdb_eattr_attrs.h: $(top_srcdir)/xlat/rtnl_mdba_mdb_eattr_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_mdba_mdb_entry_attrs.h: $(top_srcdir)/xlat/rtnl_mdba_mdb_entry_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_mdba_router_attrs.h: $(top_srcdir)/xlat/rtnl_mdba_router_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_mdba_router_pattr_attrs.h: $(top_srcdir)/xlat/rtnl_mdba_router_pattr_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_neigh_attrs.h: $(top_srcdir)/xlat/rtnl_neigh_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_neightbl_attrs.h: $(top_srcdir)/xlat/rtnl_neightbl_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_neightbl_parms_attrs.h: $(top_srcdir)/xlat/rtnl_neightbl_parms_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_netconf_attrs.h: $(top_srcdir)/xlat/rtnl_netconf_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_nsid_attrs.h: $(top_srcdir)/xlat/rtnl_nsid_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_route_attrs.h: $(top_srcdir)/xlat/rtnl_route_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_rta_metrics_attrs.h: $(top_srcdir)/xlat/rtnl_rta_metrics_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_rule_attrs.h: $(top_srcdir)/xlat/rtnl_rule_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_tc_action_attrs.h: $(top_srcdir)/xlat/rtnl_tc_action_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_tc_attrs.h: $(top_srcdir)/xlat/rtnl_tc_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_tca_stab_attrs.h: $(top_srcdir)/xlat/rtnl_tca_stab_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/rtnl_tca_stats_attrs.h: $(top_srcdir)/xlat/rtnl_tca_stats_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/rwf_flags.h: $(top_srcdir)/xlat/rwf_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/s390_guarded_storage_commands.h: $(top_srcdir)/xlat/s390_guarded_storage_commands.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/s390_runtime_instr_commands.h: $(top_srcdir)/xlat/s390_runtime_instr_commands.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/s390_sthyi_function_codes.h: $(top_srcdir)/xlat/s390_sthyi_function_codes.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/sa_handler_values.h: $(top_srcdir)/xlat/sa_handler_values.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/sched_flags.h: $(top_srcdir)/xlat/sched_flags.in $(top_srcdir)/xlat/gen.sh @@ -452,9 +730,11 @@ $(top_srcdir)/xlat/semop_flags.h: $(top_srcdir)/xlat/semop_flags.in $(top_srcdir $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/setns_types.h: $(top_srcdir)/xlat/setns_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/setsockipoptions.h: $(top_srcdir)/xlat/setsockipoptions.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/setsock_ip_options.h: $(top_srcdir)/xlat/setsock_ip_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/setsockipv6options.h: $(top_srcdir)/xlat/setsockipv6options.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/setsock_ipv6_options.h: $(top_srcdir)/xlat/setsock_ipv6_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/setsock_options.h: $(top_srcdir)/xlat/setsock_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/sfd_flags.h: $(top_srcdir)/xlat/sfd_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ @@ -504,36 +784,104 @@ $(top_srcdir)/xlat/sigsys_codes.h: $(top_srcdir)/xlat/sigsys_codes.in $(top_srcd $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/sigtrap_codes.h: $(top_srcdir)/xlat/sigtrap_codes.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/sock_type_flags.h: $(top_srcdir)/xlat/sock_type_flags.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/skf_ad.h: $(top_srcdir)/xlat/skf_ad.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/socketcalls.h: $(top_srcdir)/xlat/socketcalls.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/skf_off.h: $(top_srcdir)/xlat/skf_off.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/socketlayers.h: $(top_srcdir)/xlat/socketlayers.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/smc_decl_codes.h: $(top_srcdir)/xlat/smc_decl_codes.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/smc_diag_attrs.h: $(top_srcdir)/xlat/smc_diag_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/smc_diag_extended_flags.h: $(top_srcdir)/xlat/smc_diag_extended_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/smc_diag_mode.h: $(top_srcdir)/xlat/smc_diag_mode.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/smc_link_group_roles.h: $(top_srcdir)/xlat/smc_link_group_roles.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/smc_protocols.h: $(top_srcdir)/xlat/smc_protocols.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/sockipoptions.h: $(top_srcdir)/xlat/sockipoptions.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/smc_states.h: $(top_srcdir)/xlat/smc_states.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/sockipv6options.h: $(top_srcdir)/xlat/sockipv6options.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/snmp_icmp6_stats.h: $(top_srcdir)/xlat/snmp_icmp6_stats.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/sockipxoptions.h: $(top_srcdir)/xlat/sockipxoptions.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/snmp_ip_stats.h: $(top_srcdir)/xlat/snmp_ip_stats.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/sockoptions.h: $(top_srcdir)/xlat/sockoptions.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/sock_alg_options.h: $(top_srcdir)/xlat/sock_alg_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/sockpacketoptions.h: $(top_srcdir)/xlat/sockpacketoptions.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/sock_ax25_options.h: $(top_srcdir)/xlat/sock_ax25_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/sockrawoptions.h: $(top_srcdir)/xlat/sockrawoptions.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/sock_bluetooth_options.h: $(top_srcdir)/xlat/sock_bluetooth_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/socksctpoptions.h: $(top_srcdir)/xlat/socksctpoptions.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/sock_caif_options.h: $(top_srcdir)/xlat/sock_caif_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ -$(top_srcdir)/xlat/socktcpoptions.h: $(top_srcdir)/xlat/socktcpoptions.in $(top_srcdir)/xlat/gen.sh +$(top_srcdir)/xlat/sock_dccp_options.h: $(top_srcdir)/xlat/sock_dccp_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_ip_options.h: $(top_srcdir)/xlat/sock_ip_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_ipv6_options.h: $(top_srcdir)/xlat/sock_ipv6_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_ipx_options.h: $(top_srcdir)/xlat/sock_ipx_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_irda_options.h: $(top_srcdir)/xlat/sock_irda_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_iucv_options.h: $(top_srcdir)/xlat/sock_iucv_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_kcm_options.h: $(top_srcdir)/xlat/sock_kcm_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_llc_options.h: $(top_srcdir)/xlat/sock_llc_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_netlink_options.h: $(top_srcdir)/xlat/sock_netlink_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_nfcllcp_options.h: $(top_srcdir)/xlat/sock_nfcllcp_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_options.h: $(top_srcdir)/xlat/sock_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_packet_options.h: $(top_srcdir)/xlat/sock_packet_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_pnp_options.h: $(top_srcdir)/xlat/sock_pnp_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_pppol2tp_options.h: $(top_srcdir)/xlat/sock_pppol2tp_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_raw_options.h: $(top_srcdir)/xlat/sock_raw_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_rds_options.h: $(top_srcdir)/xlat/sock_rds_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_rxrpc_options.h: $(top_srcdir)/xlat/sock_rxrpc_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_sctp_options.h: $(top_srcdir)/xlat/sock_sctp_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_shutdown_flags.h: $(top_srcdir)/xlat/sock_shutdown_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_tcp_options.h: $(top_srcdir)/xlat/sock_tcp_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_tipc_options.h: $(top_srcdir)/xlat/sock_tipc_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_tls_options.h: $(top_srcdir)/xlat/sock_tls_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_type_flags.h: $(top_srcdir)/xlat/sock_type_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_udp_options.h: $(top_srcdir)/xlat/sock_udp_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sock_xdp_options.h: $(top_srcdir)/xlat/sock_xdp_options.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/socketcalls.h: $(top_srcdir)/xlat/socketcalls.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/socketlayers.h: $(top_srcdir)/xlat/socketlayers.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/socktypes.h: $(top_srcdir)/xlat/socktypes.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/sparc_kern_features.h: $(top_srcdir)/xlat/sparc_kern_features.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/splice_flags.h: $(top_srcdir)/xlat/splice_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/sram_alloc_flags.h: $(top_srcdir)/xlat/sram_alloc_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/statfs_flags.h: $(top_srcdir)/xlat/statfs_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/statx_attrs.h: $(top_srcdir)/xlat/statx_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/statx_masks.h: $(top_srcdir)/xlat/statx_masks.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/swap_flags.h: $(top_srcdir)/xlat/swap_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/sync_file_range_flags.h: $(top_srcdir)/xlat/sync_file_range_flags.in $(top_srcdir)/xlat/gen.sh @@ -566,14 +914,22 @@ $(top_srcdir)/xlat/sysmips_operations.h: $(top_srcdir)/xlat/sysmips_operations.i $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/tcflsh_options.h: $(top_srcdir)/xlat/tcflsh_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/tcp_state_flags.h: $(top_srcdir)/xlat/tcp_state_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/tcp_states.h: $(top_srcdir)/xlat/tcp_states.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/tcxonc_options.h: $(top_srcdir)/xlat/tcxonc_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/timerfdflags.h: $(top_srcdir)/xlat/timerfdflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/tun_device_types.h: $(top_srcdir)/xlat/tun_device_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/ubi_volume_props.h: $(top_srcdir)/xlat/ubi_volume_props.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/ubi_volume_types.h: $(top_srcdir)/xlat/ubi_volume_types.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/uffd_api_features.h: $(top_srcdir)/xlat/uffd_api_features.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/uffd_api_flags.h: $(top_srcdir)/xlat/uffd_api_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/uffd_copy_flags.h: $(top_srcdir)/xlat/uffd_copy_flags.in $(top_srcdir)/xlat/gen.sh @@ -588,8 +944,18 @@ $(top_srcdir)/xlat/uffd_zeropage_flags.h: $(top_srcdir)/xlat/uffd_zeropage_flags $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/umount_flags.h: $(top_srcdir)/xlat/umount_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/unix_diag_attrs.h: $(top_srcdir)/xlat/unix_diag_attrs.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/unix_diag_show.h: $(top_srcdir)/xlat/unix_diag_show.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/unshare_flags.h: $(top_srcdir)/xlat/unshare_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/uring_enter_flags.h: $(top_srcdir)/xlat/uring_enter_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/uring_register_opcodes.h: $(top_srcdir)/xlat/uring_register_opcodes.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/uring_setup_flags.h: $(top_srcdir)/xlat/uring_setup_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/usagewho.h: $(top_srcdir)/xlat/usagewho.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/v4l2_buf_flags.h: $(top_srcdir)/xlat/v4l2_buf_flags.in $(top_srcdir)/xlat/gen.sh @@ -604,6 +970,8 @@ $(top_srcdir)/xlat/v4l2_control_classes.h: $(top_srcdir)/xlat/v4l2_control_class $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/v4l2_control_flags.h: $(top_srcdir)/xlat/v4l2_control_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_control_id_bases.h: $(top_srcdir)/xlat/v4l2_control_id_bases.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/v4l2_control_ids.h: $(top_srcdir)/xlat/v4l2_control_ids.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/v4l2_control_types.h: $(top_srcdir)/xlat/v4l2_control_types.in $(top_srcdir)/xlat/gen.sh @@ -622,8 +990,24 @@ $(top_srcdir)/xlat/v4l2_input_types.h: $(top_srcdir)/xlat/v4l2_input_types.in $( $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/v4l2_memories.h: $(top_srcdir)/xlat/v4l2_memories.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_pix_fmts.h: $(top_srcdir)/xlat/v4l2_pix_fmts.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_sdr_fmts.h: $(top_srcdir)/xlat/v4l2_sdr_fmts.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_sliced_flags.h: $(top_srcdir)/xlat/v4l2_sliced_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/v4l2_streaming_capabilities.h: $(top_srcdir)/xlat/v4l2_streaming_capabilities.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_tuner_audmodes.h: $(top_srcdir)/xlat/v4l2_tuner_audmodes.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_tuner_capabilities.h: $(top_srcdir)/xlat/v4l2_tuner_capabilities.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_tuner_rxsubchanses.h: $(top_srcdir)/xlat/v4l2_tuner_rxsubchanses.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_tuner_types.h: $(top_srcdir)/xlat/v4l2_tuner_types.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/v4l2_vbi_flags.h: $(top_srcdir)/xlat/v4l2_vbi_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/wait4_options.h: $(top_srcdir)/xlat/wait4_options.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/waitid_types.h: $(top_srcdir)/xlat/waitid_types.in $(top_srcdir)/xlat/gen.sh @@ -632,6 +1016,8 @@ $(top_srcdir)/xlat/whence_codes.h: $(top_srcdir)/xlat/whence_codes.in $(top_srcd $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/xattrflags.h: $(top_srcdir)/xlat/xattrflags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ +$(top_srcdir)/xlat/xdp_flags.h: $(top_srcdir)/xlat/xdp_flags.in $(top_srcdir)/xlat/gen.sh + $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/xfs_dqblk_flags.h: $(top_srcdir)/xlat/xfs_dqblk_flags.in $(top_srcdir)/xlat/gen.sh $(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@ $(top_srcdir)/xlat/xfs_quota_flags.h: $(top_srcdir)/xlat/xfs_quota_flags.in $(top_srcdir)/xlat/gen.sh diff --git a/xlat/access_flags.h b/xlat/access_flags.h index a30f082d..e12a08c3 100644 --- a/xlat/access_flags.h +++ b/xlat/access_flags.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/access_flags.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat access_flags in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat access_flags in mpers mode + +# else static const struct xlat access_flags[] = { @@ -29,4 +35,6 @@ const struct xlat access_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/aclipc.h b/xlat/aclipc.h deleted file mode 100644 index 6dabb837..00000000 --- a/xlat/aclipc.h +++ /dev/null @@ -1,23 +0,0 @@ -/* Generated by ./xlat/gen.sh from ./xlat/aclipc.in; do not edit. */ - -#ifdef IN_MPERS - -# error static const struct xlat aclipc in mpers mode - -#else - -static -const struct xlat aclipc[] = { -#if defined(IPC_SHM) || (defined(HAVE_DECL_IPC_SHM) && HAVE_DECL_IPC_SHM) - XLAT(IPC_SHM), -#endif -#if defined(IPC_SEM) || (defined(HAVE_DECL_IPC_SEM) && HAVE_DECL_IPC_SEM) - XLAT(IPC_SEM), -#endif -#if defined(IPC_MSG) || (defined(HAVE_DECL_IPC_MSG) && HAVE_DECL_IPC_MSG) - XLAT(IPC_MSG), -#endif - XLAT_END -}; - -#endif /* !IN_MPERS */ diff --git a/xlat/aclipc.in b/xlat/aclipc.in deleted file mode 100644 index fd4d61c0..00000000 --- a/xlat/aclipc.in +++ /dev/null @@ -1,3 +0,0 @@ -IPC_SHM -IPC_SEM -IPC_MSG diff --git a/xlat/addrfams.h b/xlat/addrfams.h index fc437b29..b9510839 100644 --- a/xlat/addrfams.h +++ b/xlat/addrfams.h @@ -1,181 +1,377 @@ /* Generated by ./xlat/gen.sh from ./xlat/addrfams.in; do not edit. */ -#if !(defined(AF_UNSPEC) || (defined(HAVE_DECL_AF_UNSPEC) && HAVE_DECL_AF_UNSPEC)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(AF_UNSPEC) || (defined(HAVE_DECL_AF_UNSPEC) && HAVE_DECL_AF_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_UNSPEC) == (0), "AF_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_UNSPEC 0 #endif -#if !(defined(AF_UNIX) || (defined(HAVE_DECL_AF_UNIX) && HAVE_DECL_AF_UNIX)) +#if defined(AF_UNIX) || (defined(HAVE_DECL_AF_UNIX) && HAVE_DECL_AF_UNIX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_UNIX) == (1), "AF_UNIX != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_UNIX 1 #endif -#if !(defined(AF_INET) || (defined(HAVE_DECL_AF_INET) && HAVE_DECL_AF_INET)) +#if defined(AF_INET) || (defined(HAVE_DECL_AF_INET) && HAVE_DECL_AF_INET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_INET) == (2), "AF_INET != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_INET 2 #endif -#if !(defined(AF_AX25) || (defined(HAVE_DECL_AF_AX25) && HAVE_DECL_AF_AX25)) +#if defined(AF_AX25) || (defined(HAVE_DECL_AF_AX25) && HAVE_DECL_AF_AX25) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_AX25) == (3), "AF_AX25 != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_AX25 3 #endif -#if !(defined(AF_IPX) || (defined(HAVE_DECL_AF_IPX) && HAVE_DECL_AF_IPX)) +#if defined(AF_IPX) || (defined(HAVE_DECL_AF_IPX) && HAVE_DECL_AF_IPX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_IPX) == (4), "AF_IPX != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_IPX 4 #endif -#if !(defined(AF_APPLETALK) || (defined(HAVE_DECL_AF_APPLETALK) && HAVE_DECL_AF_APPLETALK)) +#if defined(AF_APPLETALK) || (defined(HAVE_DECL_AF_APPLETALK) && HAVE_DECL_AF_APPLETALK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_APPLETALK) == (5), "AF_APPLETALK != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_APPLETALK 5 #endif -#if !(defined(AF_NETROM) || (defined(HAVE_DECL_AF_NETROM) && HAVE_DECL_AF_NETROM)) +#if defined(AF_NETROM) || (defined(HAVE_DECL_AF_NETROM) && HAVE_DECL_AF_NETROM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_NETROM) == (6), "AF_NETROM != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_NETROM 6 #endif -#if !(defined(AF_BRIDGE) || (defined(HAVE_DECL_AF_BRIDGE) && HAVE_DECL_AF_BRIDGE)) +#if defined(AF_BRIDGE) || (defined(HAVE_DECL_AF_BRIDGE) && HAVE_DECL_AF_BRIDGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_BRIDGE) == (7), "AF_BRIDGE != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_BRIDGE 7 #endif -#if !(defined(AF_ATMPVC) || (defined(HAVE_DECL_AF_ATMPVC) && HAVE_DECL_AF_ATMPVC)) +#if defined(AF_ATMPVC) || (defined(HAVE_DECL_AF_ATMPVC) && HAVE_DECL_AF_ATMPVC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_ATMPVC) == (8), "AF_ATMPVC != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_ATMPVC 8 #endif -#if !(defined(AF_X25) || (defined(HAVE_DECL_AF_X25) && HAVE_DECL_AF_X25)) +#if defined(AF_X25) || (defined(HAVE_DECL_AF_X25) && HAVE_DECL_AF_X25) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_X25) == (9), "AF_X25 != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_X25 9 #endif -#if !(defined(AF_INET6) || (defined(HAVE_DECL_AF_INET6) && HAVE_DECL_AF_INET6)) +#if defined(AF_INET6) || (defined(HAVE_DECL_AF_INET6) && HAVE_DECL_AF_INET6) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_INET6) == (10), "AF_INET6 != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_INET6 10 #endif -#if !(defined(AF_ROSE) || (defined(HAVE_DECL_AF_ROSE) && HAVE_DECL_AF_ROSE)) +#if defined(AF_ROSE) || (defined(HAVE_DECL_AF_ROSE) && HAVE_DECL_AF_ROSE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_ROSE) == (11), "AF_ROSE != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_ROSE 11 #endif -#if !(defined(AF_DECnet) || (defined(HAVE_DECL_AF_DECnet) && HAVE_DECL_AF_DECnet)) +#if defined(AF_DECnet) || (defined(HAVE_DECL_AF_DECnet) && HAVE_DECL_AF_DECnet) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_DECnet) == (12), "AF_DECnet != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_DECnet 12 #endif -#if !(defined(AF_NETBEUI) || (defined(HAVE_DECL_AF_NETBEUI) && HAVE_DECL_AF_NETBEUI)) +#if defined(AF_NETBEUI) || (defined(HAVE_DECL_AF_NETBEUI) && HAVE_DECL_AF_NETBEUI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_NETBEUI) == (13), "AF_NETBEUI != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_NETBEUI 13 #endif -#if !(defined(AF_SECURITY) || (defined(HAVE_DECL_AF_SECURITY) && HAVE_DECL_AF_SECURITY)) +#if defined(AF_SECURITY) || (defined(HAVE_DECL_AF_SECURITY) && HAVE_DECL_AF_SECURITY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_SECURITY) == (14), "AF_SECURITY != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_SECURITY 14 #endif -#if !(defined(AF_KEY) || (defined(HAVE_DECL_AF_KEY) && HAVE_DECL_AF_KEY)) +#if defined(AF_KEY) || (defined(HAVE_DECL_AF_KEY) && HAVE_DECL_AF_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_KEY) == (15), "AF_KEY != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_KEY 15 #endif -#if !(defined(AF_NETLINK) || (defined(HAVE_DECL_AF_NETLINK) && HAVE_DECL_AF_NETLINK)) +#if defined(AF_NETLINK) || (defined(HAVE_DECL_AF_NETLINK) && HAVE_DECL_AF_NETLINK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_NETLINK) == (16), "AF_NETLINK != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_NETLINK 16 #endif -#if !(defined(AF_PACKET) || (defined(HAVE_DECL_AF_PACKET) && HAVE_DECL_AF_PACKET)) +#if defined(AF_PACKET) || (defined(HAVE_DECL_AF_PACKET) && HAVE_DECL_AF_PACKET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_PACKET) == (17), "AF_PACKET != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_PACKET 17 #endif -#if !(defined(AF_ASH) || (defined(HAVE_DECL_AF_ASH) && HAVE_DECL_AF_ASH)) +#if defined(AF_ASH) || (defined(HAVE_DECL_AF_ASH) && HAVE_DECL_AF_ASH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_ASH) == (18), "AF_ASH != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_ASH 18 #endif -#if !(defined(AF_ECONET) || (defined(HAVE_DECL_AF_ECONET) && HAVE_DECL_AF_ECONET)) +#if defined(AF_ECONET) || (defined(HAVE_DECL_AF_ECONET) && HAVE_DECL_AF_ECONET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_ECONET) == (19), "AF_ECONET != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_ECONET 19 #endif -#if !(defined(AF_ATMSVC) || (defined(HAVE_DECL_AF_ATMSVC) && HAVE_DECL_AF_ATMSVC)) +#if defined(AF_ATMSVC) || (defined(HAVE_DECL_AF_ATMSVC) && HAVE_DECL_AF_ATMSVC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_ATMSVC) == (20), "AF_ATMSVC != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_ATMSVC 20 #endif -#if !(defined(AF_RDS) || (defined(HAVE_DECL_AF_RDS) && HAVE_DECL_AF_RDS)) +#if defined(AF_RDS) || (defined(HAVE_DECL_AF_RDS) && HAVE_DECL_AF_RDS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_RDS) == (21), "AF_RDS != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_RDS 21 #endif -#if !(defined(AF_SNA) || (defined(HAVE_DECL_AF_SNA) && HAVE_DECL_AF_SNA)) +#if defined(AF_SNA) || (defined(HAVE_DECL_AF_SNA) && HAVE_DECL_AF_SNA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_SNA) == (22), "AF_SNA != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_SNA 22 #endif -#if !(defined(AF_IRDA) || (defined(HAVE_DECL_AF_IRDA) && HAVE_DECL_AF_IRDA)) +#if defined(AF_IRDA) || (defined(HAVE_DECL_AF_IRDA) && HAVE_DECL_AF_IRDA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_IRDA) == (23), "AF_IRDA != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_IRDA 23 #endif -#if !(defined(AF_PPPOX) || (defined(HAVE_DECL_AF_PPPOX) && HAVE_DECL_AF_PPPOX)) +#if defined(AF_PPPOX) || (defined(HAVE_DECL_AF_PPPOX) && HAVE_DECL_AF_PPPOX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_PPPOX) == (24), "AF_PPPOX != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_PPPOX 24 #endif -#if !(defined(AF_WANPIPE) || (defined(HAVE_DECL_AF_WANPIPE) && HAVE_DECL_AF_WANPIPE)) +#if defined(AF_WANPIPE) || (defined(HAVE_DECL_AF_WANPIPE) && HAVE_DECL_AF_WANPIPE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_WANPIPE) == (25), "AF_WANPIPE != 25"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_WANPIPE 25 #endif -#if !(defined(AF_LLC) || (defined(HAVE_DECL_AF_LLC) && HAVE_DECL_AF_LLC)) +#if defined(AF_LLC) || (defined(HAVE_DECL_AF_LLC) && HAVE_DECL_AF_LLC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_LLC) == (26), "AF_LLC != 26"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_LLC 26 #endif -#if !(defined(AF_IB) || (defined(HAVE_DECL_AF_IB) && HAVE_DECL_AF_IB)) +#if defined(AF_IB) || (defined(HAVE_DECL_AF_IB) && HAVE_DECL_AF_IB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_IB) == (27), "AF_IB != 27"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_IB 27 #endif -#if !(defined(AF_MPLS) || (defined(HAVE_DECL_AF_MPLS) && HAVE_DECL_AF_MPLS)) +#if defined(AF_MPLS) || (defined(HAVE_DECL_AF_MPLS) && HAVE_DECL_AF_MPLS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_MPLS) == (28), "AF_MPLS != 28"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_MPLS 28 #endif -#if !(defined(AF_CAN) || (defined(HAVE_DECL_AF_CAN) && HAVE_DECL_AF_CAN)) +#if defined(AF_CAN) || (defined(HAVE_DECL_AF_CAN) && HAVE_DECL_AF_CAN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_CAN) == (29), "AF_CAN != 29"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_CAN 29 #endif -#if !(defined(AF_TIPC) || (defined(HAVE_DECL_AF_TIPC) && HAVE_DECL_AF_TIPC)) +#if defined(AF_TIPC) || (defined(HAVE_DECL_AF_TIPC) && HAVE_DECL_AF_TIPC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_TIPC) == (30), "AF_TIPC != 30"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_TIPC 30 #endif -#if !(defined(AF_BLUETOOTH) || (defined(HAVE_DECL_AF_BLUETOOTH) && HAVE_DECL_AF_BLUETOOTH)) +#if defined(AF_BLUETOOTH) || (defined(HAVE_DECL_AF_BLUETOOTH) && HAVE_DECL_AF_BLUETOOTH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_BLUETOOTH) == (31), "AF_BLUETOOTH != 31"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_BLUETOOTH 31 #endif -#if !(defined(AF_IUCV) || (defined(HAVE_DECL_AF_IUCV) && HAVE_DECL_AF_IUCV)) +#if defined(AF_IUCV) || (defined(HAVE_DECL_AF_IUCV) && HAVE_DECL_AF_IUCV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_IUCV) == (32), "AF_IUCV != 32"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_IUCV 32 #endif -#if !(defined(AF_RXRPC) || (defined(HAVE_DECL_AF_RXRPC) && HAVE_DECL_AF_RXRPC)) +#if defined(AF_RXRPC) || (defined(HAVE_DECL_AF_RXRPC) && HAVE_DECL_AF_RXRPC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_RXRPC) == (33), "AF_RXRPC != 33"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_RXRPC 33 #endif -#if !(defined(AF_ISDN) || (defined(HAVE_DECL_AF_ISDN) && HAVE_DECL_AF_ISDN)) +#if defined(AF_ISDN) || (defined(HAVE_DECL_AF_ISDN) && HAVE_DECL_AF_ISDN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_ISDN) == (34), "AF_ISDN != 34"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_ISDN 34 #endif -#if !(defined(AF_PHONET) || (defined(HAVE_DECL_AF_PHONET) && HAVE_DECL_AF_PHONET)) +#if defined(AF_PHONET) || (defined(HAVE_DECL_AF_PHONET) && HAVE_DECL_AF_PHONET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_PHONET) == (35), "AF_PHONET != 35"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_PHONET 35 #endif -#if !(defined(AF_IEEE802154) || (defined(HAVE_DECL_AF_IEEE802154) && HAVE_DECL_AF_IEEE802154)) +#if defined(AF_IEEE802154) || (defined(HAVE_DECL_AF_IEEE802154) && HAVE_DECL_AF_IEEE802154) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_IEEE802154) == (36), "AF_IEEE802154 != 36"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_IEEE802154 36 #endif -#if !(defined(AF_CAIF) || (defined(HAVE_DECL_AF_CAIF) && HAVE_DECL_AF_CAIF)) +#if defined(AF_CAIF) || (defined(HAVE_DECL_AF_CAIF) && HAVE_DECL_AF_CAIF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_CAIF) == (37), "AF_CAIF != 37"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_CAIF 37 #endif -#if !(defined(AF_ALG) || (defined(HAVE_DECL_AF_ALG) && HAVE_DECL_AF_ALG)) +#if defined(AF_ALG) || (defined(HAVE_DECL_AF_ALG) && HAVE_DECL_AF_ALG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_ALG) == (38), "AF_ALG != 38"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_ALG 38 #endif -#if !(defined(AF_NFC) || (defined(HAVE_DECL_AF_NFC) && HAVE_DECL_AF_NFC)) +#if defined(AF_NFC) || (defined(HAVE_DECL_AF_NFC) && HAVE_DECL_AF_NFC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_NFC) == (39), "AF_NFC != 39"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_NFC 39 #endif -#if !(defined(AF_VSOCK) || (defined(HAVE_DECL_AF_VSOCK) && HAVE_DECL_AF_VSOCK)) +#if defined(AF_VSOCK) || (defined(HAVE_DECL_AF_VSOCK) && HAVE_DECL_AF_VSOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_VSOCK) == (40), "AF_VSOCK != 40"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_VSOCK 40 #endif -#if !(defined(AF_KCM) || (defined(HAVE_DECL_AF_KCM) && HAVE_DECL_AF_KCM)) +#if defined(AF_KCM) || (defined(HAVE_DECL_AF_KCM) && HAVE_DECL_AF_KCM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_KCM) == (41), "AF_KCM != 41"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_KCM 41 #endif -#if !(defined(AF_QIPCRTR) || (defined(HAVE_DECL_AF_QIPCRTR) && HAVE_DECL_AF_QIPCRTR)) +#if defined(AF_QIPCRTR) || (defined(HAVE_DECL_AF_QIPCRTR) && HAVE_DECL_AF_QIPCRTR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_QIPCRTR) == (42), "AF_QIPCRTR != 42"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AF_QIPCRTR 42 #endif +#if defined(AF_SMC) || (defined(HAVE_DECL_AF_SMC) && HAVE_DECL_AF_SMC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_SMC) == (43), "AF_SMC != 43"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AF_SMC 43 +#endif +#if defined(AF_XDP) || (defined(HAVE_DECL_AF_XDP) && HAVE_DECL_AF_XDP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AF_XDP) == (44), "AF_XDP != 44"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AF_XDP 44 +#endif + +#ifndef XLAT_MACROS_ONLY -#ifndef IN_MPERS +# ifndef IN_MPERS const struct xlat addrfams[] = { - XLAT(AF_UNSPEC), - XLAT(AF_UNIX), - XLAT(AF_INET), - XLAT(AF_AX25), - XLAT(AF_IPX), - XLAT(AF_APPLETALK), - XLAT(AF_NETROM), - XLAT(AF_BRIDGE), - XLAT(AF_ATMPVC), - XLAT(AF_X25), - XLAT(AF_INET6), - XLAT(AF_ROSE), - XLAT(AF_DECnet), - XLAT(AF_NETBEUI), - XLAT(AF_SECURITY), - XLAT(AF_KEY), - XLAT(AF_NETLINK), - XLAT(AF_PACKET), - XLAT(AF_ASH), - XLAT(AF_ECONET), - XLAT(AF_ATMSVC), - XLAT(AF_RDS), - XLAT(AF_SNA), - XLAT(AF_IRDA), - XLAT(AF_PPPOX), - XLAT(AF_WANPIPE), - XLAT(AF_LLC), - XLAT(AF_IB), - XLAT(AF_MPLS), - XLAT(AF_CAN), - XLAT(AF_TIPC), - XLAT(AF_BLUETOOTH), - XLAT(AF_IUCV), - XLAT(AF_RXRPC), - XLAT(AF_ISDN), - XLAT(AF_PHONET), - XLAT(AF_IEEE802154), - XLAT(AF_CAIF), - XLAT(AF_ALG), - XLAT(AF_NFC), - XLAT(AF_VSOCK), - XLAT(AF_KCM), - XLAT(AF_QIPCRTR), + [AF_UNSPEC] = XLAT(AF_UNSPEC), + [AF_UNIX] = XLAT(AF_UNIX), + [AF_INET] = XLAT(AF_INET), + [AF_AX25] = XLAT(AF_AX25), + [AF_IPX] = XLAT(AF_IPX), + [AF_APPLETALK] = XLAT(AF_APPLETALK), + [AF_NETROM] = XLAT(AF_NETROM), + [AF_BRIDGE] = XLAT(AF_BRIDGE), + [AF_ATMPVC] = XLAT(AF_ATMPVC), + [AF_X25] = XLAT(AF_X25), + [AF_INET6] = XLAT(AF_INET6), + [AF_ROSE] = XLAT(AF_ROSE), + [AF_DECnet] = XLAT(AF_DECnet), + [AF_NETBEUI] = XLAT(AF_NETBEUI), + [AF_SECURITY] = XLAT(AF_SECURITY), + [AF_KEY] = XLAT(AF_KEY), + [AF_NETLINK] = XLAT(AF_NETLINK), + [AF_PACKET] = XLAT(AF_PACKET), + [AF_ASH] = XLAT(AF_ASH), + [AF_ECONET] = XLAT(AF_ECONET), + [AF_ATMSVC] = XLAT(AF_ATMSVC), + [AF_RDS] = XLAT(AF_RDS), + [AF_SNA] = XLAT(AF_SNA), + [AF_IRDA] = XLAT(AF_IRDA), + [AF_PPPOX] = XLAT(AF_PPPOX), + [AF_WANPIPE] = XLAT(AF_WANPIPE), + [AF_LLC] = XLAT(AF_LLC), + [AF_IB] = XLAT(AF_IB), + [AF_MPLS] = XLAT(AF_MPLS), + [AF_CAN] = XLAT(AF_CAN), + [AF_TIPC] = XLAT(AF_TIPC), + [AF_BLUETOOTH] = XLAT(AF_BLUETOOTH), + [AF_IUCV] = XLAT(AF_IUCV), + [AF_RXRPC] = XLAT(AF_RXRPC), + [AF_ISDN] = XLAT(AF_ISDN), + [AF_PHONET] = XLAT(AF_PHONET), + [AF_IEEE802154] = XLAT(AF_IEEE802154), + [AF_CAIF] = XLAT(AF_CAIF), + [AF_ALG] = XLAT(AF_ALG), + [AF_NFC] = XLAT(AF_NFC), + [AF_VSOCK] = XLAT(AF_VSOCK), + [AF_KCM] = XLAT(AF_KCM), + [AF_QIPCRTR] = XLAT(AF_QIPCRTR), + [AF_SMC] = XLAT(AF_SMC), + [AF_XDP] = XLAT(AF_XDP), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/addrfams.in b/xlat/addrfams.in index 315667eb..e6a62329 100644 --- a/xlat/addrfams.in +++ b/xlat/addrfams.in @@ -1,3 +1,4 @@ +#value_indexed AF_UNSPEC 0 AF_UNIX 1 AF_INET 2 @@ -41,3 +42,5 @@ AF_NFC 39 AF_VSOCK 40 AF_KCM 41 AF_QIPCRTR 42 +AF_SMC 43 +AF_XDP 44 diff --git a/xlat/adjtimex_modes.h b/xlat/adjtimex_modes.h index 7415fe8e..8f57ca29 100644 --- a/xlat/adjtimex_modes.h +++ b/xlat/adjtimex_modes.h @@ -1,56 +1,126 @@ /* Generated by ./xlat/gen.sh from ./xlat/adjtimex_modes.in; do not edit. */ -#ifdef IN_MPERS - -extern const struct xlat adjtimex_modes[]; +#include "gcc_compat.h" +#include "static_assert.h" +#if defined(ADJ_OFFSET_SS_READ) || (defined(HAVE_DECL_ADJ_OFFSET_SS_READ) && HAVE_DECL_ADJ_OFFSET_SS_READ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ADJ_OFFSET_SS_READ) == (0xa001), "ADJ_OFFSET_SS_READ != 0xa001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE #else - -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) -static -# endif -const struct xlat adjtimex_modes[] = { - XLAT(0), +# define ADJ_OFFSET_SS_READ 0xa001 +#endif +#if defined(ADJ_OFFSET_SINGLESHOT) || (defined(HAVE_DECL_ADJ_OFFSET_SINGLESHOT) && HAVE_DECL_ADJ_OFFSET_SINGLESHOT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ADJ_OFFSET_SINGLESHOT) == (0x8001), "ADJ_OFFSET_SINGLESHOT != 0x8001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ADJ_OFFSET_SINGLESHOT 0x8001 +#endif #if defined(ADJ_OFFSET) || (defined(HAVE_DECL_ADJ_OFFSET) && HAVE_DECL_ADJ_OFFSET) - XLAT(ADJ_OFFSET), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ADJ_OFFSET) == (0x0001), "ADJ_OFFSET != 0x0001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ADJ_OFFSET 0x0001 #endif #if defined(ADJ_FREQUENCY) || (defined(HAVE_DECL_ADJ_FREQUENCY) && HAVE_DECL_ADJ_FREQUENCY) - XLAT(ADJ_FREQUENCY), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ADJ_FREQUENCY) == (0x0002), "ADJ_FREQUENCY != 0x0002"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ADJ_FREQUENCY 0x0002 #endif #if defined(ADJ_MAXERROR) || (defined(HAVE_DECL_ADJ_MAXERROR) && HAVE_DECL_ADJ_MAXERROR) - XLAT(ADJ_MAXERROR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ADJ_MAXERROR) == (0x0004), "ADJ_MAXERROR != 0x0004"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ADJ_MAXERROR 0x0004 #endif #if defined(ADJ_ESTERROR) || (defined(HAVE_DECL_ADJ_ESTERROR) && HAVE_DECL_ADJ_ESTERROR) - XLAT(ADJ_ESTERROR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ADJ_ESTERROR) == (0x0008), "ADJ_ESTERROR != 0x0008"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ADJ_ESTERROR 0x0008 #endif #if defined(ADJ_STATUS) || (defined(HAVE_DECL_ADJ_STATUS) && HAVE_DECL_ADJ_STATUS) - XLAT(ADJ_STATUS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ADJ_STATUS) == (0x0010), "ADJ_STATUS != 0x0010"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ADJ_STATUS 0x0010 #endif #if defined(ADJ_TIMECONST) || (defined(HAVE_DECL_ADJ_TIMECONST) && HAVE_DECL_ADJ_TIMECONST) - XLAT(ADJ_TIMECONST), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ADJ_TIMECONST) == (0x0020), "ADJ_TIMECONST != 0x0020"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ADJ_TIMECONST 0x0020 #endif #if defined(ADJ_TAI) || (defined(HAVE_DECL_ADJ_TAI) && HAVE_DECL_ADJ_TAI) - XLAT(ADJ_TAI), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ADJ_TAI) == (0x0080), "ADJ_TAI != 0x0080"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ADJ_TAI 0x0080 #endif #if defined(ADJ_SETOFFSET) || (defined(HAVE_DECL_ADJ_SETOFFSET) && HAVE_DECL_ADJ_SETOFFSET) - XLAT(ADJ_SETOFFSET), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ADJ_SETOFFSET) == (0x0100), "ADJ_SETOFFSET != 0x0100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ADJ_SETOFFSET 0x0100 #endif #if defined(ADJ_MICRO) || (defined(HAVE_DECL_ADJ_MICRO) && HAVE_DECL_ADJ_MICRO) - XLAT(ADJ_MICRO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ADJ_MICRO) == (0x1000), "ADJ_MICRO != 0x1000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ADJ_MICRO 0x1000 #endif #if defined(ADJ_NANO) || (defined(HAVE_DECL_ADJ_NANO) && HAVE_DECL_ADJ_NANO) - XLAT(ADJ_NANO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ADJ_NANO) == (0x2000), "ADJ_NANO != 0x2000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ADJ_NANO 0x2000 #endif #if defined(ADJ_TICK) || (defined(HAVE_DECL_ADJ_TICK) && HAVE_DECL_ADJ_TICK) - XLAT(ADJ_TICK), -#endif -#if defined(ADJ_OFFSET_SINGLESHOT) || (defined(HAVE_DECL_ADJ_OFFSET_SINGLESHOT) && HAVE_DECL_ADJ_OFFSET_SINGLESHOT) - XLAT(ADJ_OFFSET_SINGLESHOT), -#endif -#if defined(ADJ_OFFSET_SS_READ) || (defined(HAVE_DECL_ADJ_OFFSET_SS_READ) && HAVE_DECL_ADJ_OFFSET_SS_READ) - XLAT(ADJ_OFFSET_SS_READ), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ADJ_TICK) == (0x4000), "ADJ_TICK != 0x4000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ADJ_TICK 0x4000 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat adjtimex_modes in mpers mode + +# else + +static +const struct xlat adjtimex_modes[] = { + XLAT(ADJ_OFFSET_SS_READ), + XLAT(ADJ_OFFSET_SINGLESHOT), + XLAT(ADJ_OFFSET), + XLAT(ADJ_FREQUENCY), + XLAT(ADJ_MAXERROR), + XLAT(ADJ_ESTERROR), + XLAT(ADJ_STATUS), + XLAT(ADJ_TIMECONST), + XLAT(ADJ_TAI), + XLAT(ADJ_SETOFFSET), + XLAT(ADJ_MICRO), + XLAT(ADJ_NANO), + XLAT(ADJ_TICK), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/adjtimex_modes.in b/xlat/adjtimex_modes.in index e2ca6809..fa616e60 100644 --- a/xlat/adjtimex_modes.in +++ b/xlat/adjtimex_modes.in @@ -1,14 +1,13 @@ -0 -ADJ_OFFSET -ADJ_FREQUENCY -ADJ_MAXERROR -ADJ_ESTERROR -ADJ_STATUS -ADJ_TIMECONST -ADJ_TAI -ADJ_SETOFFSET -ADJ_MICRO -ADJ_NANO -ADJ_TICK -ADJ_OFFSET_SINGLESHOT -ADJ_OFFSET_SS_READ +ADJ_OFFSET_SS_READ 0xa001 +ADJ_OFFSET_SINGLESHOT 0x8001 +ADJ_OFFSET 0x0001 +ADJ_FREQUENCY 0x0002 +ADJ_MAXERROR 0x0004 +ADJ_ESTERROR 0x0008 +ADJ_STATUS 0x0010 +ADJ_TIMECONST 0x0020 +ADJ_TAI 0x0080 +ADJ_SETOFFSET 0x0100 +ADJ_MICRO 0x1000 +ADJ_NANO 0x2000 +ADJ_TICK 0x4000 diff --git a/xlat/adjtimex_state.h b/xlat/adjtimex_state.h index 888f1b6d..01b760c9 100644 --- a/xlat/adjtimex_state.h +++ b/xlat/adjtimex_state.h @@ -1,32 +1,70 @@ /* Generated by ./xlat/gen.sh from ./xlat/adjtimex_state.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat adjtimex_state in mpers mode - -#else - -static -const struct xlat adjtimex_state[] = { #if defined(TIME_OK) || (defined(HAVE_DECL_TIME_OK) && HAVE_DECL_TIME_OK) - XLAT(TIME_OK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TIME_OK) == (0), "TIME_OK != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TIME_OK 0 #endif #if defined(TIME_INS) || (defined(HAVE_DECL_TIME_INS) && HAVE_DECL_TIME_INS) - XLAT(TIME_INS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TIME_INS) == (1), "TIME_INS != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TIME_INS 1 #endif #if defined(TIME_DEL) || (defined(HAVE_DECL_TIME_DEL) && HAVE_DECL_TIME_DEL) - XLAT(TIME_DEL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TIME_DEL) == (2), "TIME_DEL != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TIME_DEL 2 #endif #if defined(TIME_OOP) || (defined(HAVE_DECL_TIME_OOP) && HAVE_DECL_TIME_OOP) - XLAT(TIME_OOP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TIME_OOP) == (3), "TIME_OOP != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TIME_OOP 3 #endif #if defined(TIME_WAIT) || (defined(HAVE_DECL_TIME_WAIT) && HAVE_DECL_TIME_WAIT) - XLAT(TIME_WAIT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TIME_WAIT) == (4), "TIME_WAIT != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TIME_WAIT 4 #endif #if defined(TIME_ERROR) || (defined(HAVE_DECL_TIME_ERROR) && HAVE_DECL_TIME_ERROR) - XLAT(TIME_ERROR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TIME_ERROR) == (5), "TIME_ERROR != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TIME_ERROR 5 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat adjtimex_state in mpers mode + +# else + +static +const struct xlat adjtimex_state[] = { + [TIME_OK] = XLAT(TIME_OK), + [TIME_INS] = XLAT(TIME_INS), + [TIME_DEL] = XLAT(TIME_DEL), + [TIME_OOP] = XLAT(TIME_OOP), + [TIME_WAIT] = XLAT(TIME_WAIT), + [TIME_ERROR] = XLAT(TIME_ERROR), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/adjtimex_state.in b/xlat/adjtimex_state.in index 873b9a1e..c4ec23c4 100644 --- a/xlat/adjtimex_state.in +++ b/xlat/adjtimex_state.in @@ -1,6 +1,7 @@ -TIME_OK -TIME_INS -TIME_DEL -TIME_OOP -TIME_WAIT -TIME_ERROR +#value_indexed +TIME_OK 0 +TIME_INS 1 +TIME_DEL 2 +TIME_OOP 3 +TIME_WAIT 4 +TIME_ERROR 5 diff --git a/xlat/adjtimex_status.h b/xlat/adjtimex_status.h index 16e7811c..b9e249e2 100644 --- a/xlat/adjtimex_status.h +++ b/xlat/adjtimex_status.h @@ -1,64 +1,150 @@ /* Generated by ./xlat/gen.sh from ./xlat/adjtimex_status.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -extern const struct xlat adjtimex_status[]; - -#else - -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) -static -# endif -const struct xlat adjtimex_status[] = { #if defined(STA_PLL) || (defined(HAVE_DECL_STA_PLL) && HAVE_DECL_STA_PLL) - XLAT(STA_PLL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STA_PLL) == (0x0001), "STA_PLL != 0x0001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STA_PLL 0x0001 #endif #if defined(STA_PPSFREQ) || (defined(HAVE_DECL_STA_PPSFREQ) && HAVE_DECL_STA_PPSFREQ) - XLAT(STA_PPSFREQ), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STA_PPSFREQ) == (0x0002), "STA_PPSFREQ != 0x0002"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STA_PPSFREQ 0x0002 #endif #if defined(STA_PPSTIME) || (defined(HAVE_DECL_STA_PPSTIME) && HAVE_DECL_STA_PPSTIME) - XLAT(STA_PPSTIME), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STA_PPSTIME) == (0x0004), "STA_PPSTIME != 0x0004"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STA_PPSTIME 0x0004 #endif #if defined(STA_FLL) || (defined(HAVE_DECL_STA_FLL) && HAVE_DECL_STA_FLL) - XLAT(STA_FLL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STA_FLL) == (0x0008), "STA_FLL != 0x0008"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STA_FLL 0x0008 #endif #if defined(STA_INS) || (defined(HAVE_DECL_STA_INS) && HAVE_DECL_STA_INS) - XLAT(STA_INS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STA_INS) == (0x0010), "STA_INS != 0x0010"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STA_INS 0x0010 #endif #if defined(STA_DEL) || (defined(HAVE_DECL_STA_DEL) && HAVE_DECL_STA_DEL) - XLAT(STA_DEL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STA_DEL) == (0x0020), "STA_DEL != 0x0020"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STA_DEL 0x0020 #endif #if defined(STA_UNSYNC) || (defined(HAVE_DECL_STA_UNSYNC) && HAVE_DECL_STA_UNSYNC) - XLAT(STA_UNSYNC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STA_UNSYNC) == (0x0040), "STA_UNSYNC != 0x0040"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STA_UNSYNC 0x0040 #endif #if defined(STA_FREQHOLD) || (defined(HAVE_DECL_STA_FREQHOLD) && HAVE_DECL_STA_FREQHOLD) - XLAT(STA_FREQHOLD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STA_FREQHOLD) == (0x0080), "STA_FREQHOLD != 0x0080"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STA_FREQHOLD 0x0080 #endif #if defined(STA_PPSSIGNAL) || (defined(HAVE_DECL_STA_PPSSIGNAL) && HAVE_DECL_STA_PPSSIGNAL) - XLAT(STA_PPSSIGNAL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STA_PPSSIGNAL) == (0x0100), "STA_PPSSIGNAL != 0x0100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STA_PPSSIGNAL 0x0100 #endif #if defined(STA_PPSJITTER) || (defined(HAVE_DECL_STA_PPSJITTER) && HAVE_DECL_STA_PPSJITTER) - XLAT(STA_PPSJITTER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STA_PPSJITTER) == (0x0200), "STA_PPSJITTER != 0x0200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STA_PPSJITTER 0x0200 #endif #if defined(STA_PPSWANDER) || (defined(HAVE_DECL_STA_PPSWANDER) && HAVE_DECL_STA_PPSWANDER) - XLAT(STA_PPSWANDER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STA_PPSWANDER) == (0x0400), "STA_PPSWANDER != 0x0400"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STA_PPSWANDER 0x0400 #endif #if defined(STA_PPSERROR) || (defined(HAVE_DECL_STA_PPSERROR) && HAVE_DECL_STA_PPSERROR) - XLAT(STA_PPSERROR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STA_PPSERROR) == (0x0800), "STA_PPSERROR != 0x0800"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STA_PPSERROR 0x0800 #endif #if defined(STA_CLOCKERR) || (defined(HAVE_DECL_STA_CLOCKERR) && HAVE_DECL_STA_CLOCKERR) - XLAT(STA_CLOCKERR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STA_CLOCKERR) == (0x1000), "STA_CLOCKERR != 0x1000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STA_CLOCKERR 0x1000 #endif #if defined(STA_NANO) || (defined(HAVE_DECL_STA_NANO) && HAVE_DECL_STA_NANO) - XLAT(STA_NANO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STA_NANO) == (0x2000), "STA_NANO != 0x2000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STA_NANO 0x2000 #endif #if defined(STA_MODE) || (defined(HAVE_DECL_STA_MODE) && HAVE_DECL_STA_MODE) - XLAT(STA_MODE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STA_MODE) == (0x4000), "STA_MODE != 0x4000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STA_MODE 0x4000 #endif #if defined(STA_CLK) || (defined(HAVE_DECL_STA_CLK) && HAVE_DECL_STA_CLK) - XLAT(STA_CLK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STA_CLK) == (0x8000), "STA_CLK != 0x8000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STA_CLK 0x8000 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat adjtimex_status in mpers mode + +# else + +static +const struct xlat adjtimex_status[] = { + XLAT(STA_PLL), + XLAT(STA_PPSFREQ), + XLAT(STA_PPSTIME), + XLAT(STA_FLL), + XLAT(STA_INS), + XLAT(STA_DEL), + XLAT(STA_UNSYNC), + XLAT(STA_FREQHOLD), + XLAT(STA_PPSSIGNAL), + XLAT(STA_PPSJITTER), + XLAT(STA_PPSWANDER), + XLAT(STA_PPSERROR), + XLAT(STA_CLOCKERR), + XLAT(STA_NANO), + XLAT(STA_MODE), + XLAT(STA_CLK), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/adjtimex_status.in b/xlat/adjtimex_status.in index c6b62641..7b83da88 100644 --- a/xlat/adjtimex_status.in +++ b/xlat/adjtimex_status.in @@ -1,16 +1,16 @@ -STA_PLL -STA_PPSFREQ -STA_PPSTIME -STA_FLL -STA_INS -STA_DEL -STA_UNSYNC -STA_FREQHOLD -STA_PPSSIGNAL -STA_PPSJITTER -STA_PPSWANDER -STA_PPSERROR -STA_CLOCKERR -STA_NANO -STA_MODE -STA_CLK +STA_PLL 0x0001 +STA_PPSFREQ 0x0002 +STA_PPSTIME 0x0004 +STA_FLL 0x0008 +STA_INS 0x0010 +STA_DEL 0x0020 +STA_UNSYNC 0x0040 +STA_FREQHOLD 0x0080 +STA_PPSSIGNAL 0x0100 +STA_PPSJITTER 0x0200 +STA_PPSWANDER 0x0400 +STA_PPSERROR 0x0800 +STA_CLOCKERR 0x1000 +STA_NANO 0x2000 +STA_MODE 0x4000 +STA_CLK 0x8000 diff --git a/xlat/advise.h b/xlat/advise.h index 526219d1..cf525228 100644 --- a/xlat/advise.h +++ b/xlat/advise.h @@ -1,32 +1,92 @@ /* Generated by ./xlat/gen.sh from ./xlat/advise.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat advise in mpers mode - -#else - -static -const struct xlat advise[] = { #if defined(POSIX_FADV_NORMAL) || (defined(HAVE_DECL_POSIX_FADV_NORMAL) && HAVE_DECL_POSIX_FADV_NORMAL) - XLAT(POSIX_FADV_NORMAL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POSIX_FADV_NORMAL) == (0), "POSIX_FADV_NORMAL != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POSIX_FADV_NORMAL 0 #endif #if defined(POSIX_FADV_RANDOM) || (defined(HAVE_DECL_POSIX_FADV_RANDOM) && HAVE_DECL_POSIX_FADV_RANDOM) - XLAT(POSIX_FADV_RANDOM), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POSIX_FADV_RANDOM) == (1), "POSIX_FADV_RANDOM != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POSIX_FADV_RANDOM 1 #endif #if defined(POSIX_FADV_SEQUENTIAL) || (defined(HAVE_DECL_POSIX_FADV_SEQUENTIAL) && HAVE_DECL_POSIX_FADV_SEQUENTIAL) - XLAT(POSIX_FADV_SEQUENTIAL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POSIX_FADV_SEQUENTIAL) == (2), "POSIX_FADV_SEQUENTIAL != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POSIX_FADV_SEQUENTIAL 2 #endif #if defined(POSIX_FADV_WILLNEED) || (defined(HAVE_DECL_POSIX_FADV_WILLNEED) && HAVE_DECL_POSIX_FADV_WILLNEED) - XLAT(POSIX_FADV_WILLNEED), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POSIX_FADV_WILLNEED) == (3), "POSIX_FADV_WILLNEED != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POSIX_FADV_WILLNEED 3 #endif +#if defined __s390x__ #if defined(POSIX_FADV_DONTNEED) || (defined(HAVE_DECL_POSIX_FADV_DONTNEED) && HAVE_DECL_POSIX_FADV_DONTNEED) - XLAT(POSIX_FADV_DONTNEED), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POSIX_FADV_DONTNEED) == (6), "POSIX_FADV_DONTNEED != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POSIX_FADV_DONTNEED 6 #endif #if defined(POSIX_FADV_NOREUSE) || (defined(HAVE_DECL_POSIX_FADV_NOREUSE) && HAVE_DECL_POSIX_FADV_NOREUSE) - XLAT(POSIX_FADV_NOREUSE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POSIX_FADV_NOREUSE) == (7), "POSIX_FADV_NOREUSE != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POSIX_FADV_NOREUSE 7 +#endif +#else +#if defined(POSIX_FADV_DONTNEED) || (defined(HAVE_DECL_POSIX_FADV_DONTNEED) && HAVE_DECL_POSIX_FADV_DONTNEED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POSIX_FADV_DONTNEED) == (4), "POSIX_FADV_DONTNEED != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POSIX_FADV_DONTNEED 4 +#endif +#if defined(POSIX_FADV_NOREUSE) || (defined(HAVE_DECL_POSIX_FADV_NOREUSE) && HAVE_DECL_POSIX_FADV_NOREUSE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POSIX_FADV_NOREUSE) == (5), "POSIX_FADV_NOREUSE != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POSIX_FADV_NOREUSE 5 +#endif +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat advise in mpers mode + +# else + +static +const struct xlat advise[] = { + XLAT(POSIX_FADV_NORMAL), + XLAT(POSIX_FADV_RANDOM), + XLAT(POSIX_FADV_SEQUENTIAL), + XLAT(POSIX_FADV_WILLNEED), +#if defined __s390x__ + XLAT(POSIX_FADV_DONTNEED), + XLAT(POSIX_FADV_NOREUSE), +#else + XLAT(POSIX_FADV_DONTNEED), + XLAT(POSIX_FADV_NOREUSE), #endif XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/advise.in b/xlat/advise.in index 47540e08..5284335f 100644 --- a/xlat/advise.in +++ b/xlat/advise.in @@ -1,6 +1,11 @@ -POSIX_FADV_NORMAL -POSIX_FADV_RANDOM -POSIX_FADV_SEQUENTIAL -POSIX_FADV_WILLNEED -POSIX_FADV_DONTNEED -POSIX_FADV_NOREUSE +POSIX_FADV_NORMAL 0 +POSIX_FADV_RANDOM 1 +POSIX_FADV_SEQUENTIAL 2 +POSIX_FADV_WILLNEED 3 +#if defined __s390x__ +POSIX_FADV_DONTNEED 6 +POSIX_FADV_NOREUSE 7 +#else +POSIX_FADV_DONTNEED 4 +POSIX_FADV_NOREUSE 5 +#endif diff --git a/xlat/af_packet_types.h b/xlat/af_packet_types.h index 72bb4192..c104813d 100644 --- a/xlat/af_packet_types.h +++ b/xlat/af_packet_types.h @@ -1,35 +1,86 @@ /* Generated by ./xlat/gen.sh from ./xlat/af_packet_types.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat af_packet_types in mpers mode - -#else - -static -const struct xlat af_packet_types[] = { #if defined(PACKET_HOST) || (defined(HAVE_DECL_PACKET_HOST) && HAVE_DECL_PACKET_HOST) - XLAT(PACKET_HOST), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PACKET_HOST) == (0), "PACKET_HOST != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PACKET_HOST 0 #endif #if defined(PACKET_BROADCAST) || (defined(HAVE_DECL_PACKET_BROADCAST) && HAVE_DECL_PACKET_BROADCAST) - XLAT(PACKET_BROADCAST), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PACKET_BROADCAST) == (1), "PACKET_BROADCAST != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PACKET_BROADCAST 1 #endif #if defined(PACKET_MULTICAST) || (defined(HAVE_DECL_PACKET_MULTICAST) && HAVE_DECL_PACKET_MULTICAST) - XLAT(PACKET_MULTICAST), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PACKET_MULTICAST) == (2), "PACKET_MULTICAST != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PACKET_MULTICAST 2 #endif #if defined(PACKET_OTHERHOST) || (defined(HAVE_DECL_PACKET_OTHERHOST) && HAVE_DECL_PACKET_OTHERHOST) - XLAT(PACKET_OTHERHOST), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PACKET_OTHERHOST) == (3), "PACKET_OTHERHOST != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PACKET_OTHERHOST 3 #endif #if defined(PACKET_OUTGOING) || (defined(HAVE_DECL_PACKET_OUTGOING) && HAVE_DECL_PACKET_OUTGOING) - XLAT(PACKET_OUTGOING), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PACKET_OUTGOING) == (4), "PACKET_OUTGOING != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PACKET_OUTGOING 4 #endif #if defined(PACKET_LOOPBACK) || (defined(HAVE_DECL_PACKET_LOOPBACK) && HAVE_DECL_PACKET_LOOPBACK) - XLAT(PACKET_LOOPBACK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PACKET_LOOPBACK) == (5), "PACKET_LOOPBACK != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PACKET_LOOPBACK 5 #endif -#if defined(PACKET_FASTROUTE) || (defined(HAVE_DECL_PACKET_FASTROUTE) && HAVE_DECL_PACKET_FASTROUTE) - XLAT(PACKET_FASTROUTE), +#if defined(PACKET_USER) || (defined(HAVE_DECL_PACKET_USER) && HAVE_DECL_PACKET_USER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PACKET_USER) == (6), "PACKET_USER != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PACKET_USER 6 +#endif +#if defined(PACKET_KERNEL) || (defined(HAVE_DECL_PACKET_KERNEL) && HAVE_DECL_PACKET_KERNEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PACKET_KERNEL) == (7), "PACKET_KERNEL != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PACKET_KERNEL 7 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat af_packet_types in mpers mode + +# else + +static +const struct xlat af_packet_types[] = { + [PACKET_HOST] = XLAT(PACKET_HOST), + [PACKET_BROADCAST] = XLAT(PACKET_BROADCAST), + [PACKET_MULTICAST] = XLAT(PACKET_MULTICAST), + [PACKET_OTHERHOST] = XLAT(PACKET_OTHERHOST), + [PACKET_OUTGOING] = XLAT(PACKET_OUTGOING), + [PACKET_LOOPBACK] = XLAT(PACKET_LOOPBACK), + [PACKET_USER] = XLAT(PACKET_USER), + [PACKET_KERNEL] = XLAT(PACKET_KERNEL), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/af_packet_types.in b/xlat/af_packet_types.in index 18cf6558..68f75152 100644 --- a/xlat/af_packet_types.in +++ b/xlat/af_packet_types.in @@ -1,7 +1,9 @@ -PACKET_HOST -PACKET_BROADCAST -PACKET_MULTICAST -PACKET_OTHERHOST -PACKET_OUTGOING -PACKET_LOOPBACK -PACKET_FASTROUTE +#value_indexed +PACKET_HOST 0 +PACKET_BROADCAST 1 +PACKET_MULTICAST 2 +PACKET_OTHERHOST 3 +PACKET_OUTGOING 4 +PACKET_LOOPBACK 5 +PACKET_USER 6 +PACKET_KERNEL 7 diff --git a/xlat/af_packet_versions.h b/xlat/af_packet_versions.h new file mode 100644 index 00000000..8d82eba9 --- /dev/null +++ b/xlat/af_packet_versions.h @@ -0,0 +1,46 @@ +/* Generated by ./xlat/gen.sh from ./xlat/af_packet_versions.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(TPACKET_V1) || (defined(HAVE_DECL_TPACKET_V1) && HAVE_DECL_TPACKET_V1) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TPACKET_V1) == (0), "TPACKET_V1 != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TPACKET_V1 0 +#endif +#if defined(TPACKET_V2) || (defined(HAVE_DECL_TPACKET_V2) && HAVE_DECL_TPACKET_V2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TPACKET_V2) == (1), "TPACKET_V2 != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TPACKET_V2 1 +#endif +#if defined(TPACKET_V3) || (defined(HAVE_DECL_TPACKET_V3) && HAVE_DECL_TPACKET_V3) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TPACKET_V3) == (2), "TPACKET_V3 != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TPACKET_V3 2 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat af_packet_versions in mpers mode + +# else + +static +const struct xlat af_packet_versions[] = { + XLAT(TPACKET_V1), + XLAT(TPACKET_V2), + XLAT(TPACKET_V3), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/af_packet_versions.in b/xlat/af_packet_versions.in new file mode 100644 index 00000000..399cdf4d --- /dev/null +++ b/xlat/af_packet_versions.in @@ -0,0 +1,3 @@ +TPACKET_V1 0 +TPACKET_V2 1 +TPACKET_V3 2 diff --git a/xlat/aio_cmds.h b/xlat/aio_cmds.h new file mode 100644 index 00000000..dd558e8e --- /dev/null +++ b/xlat/aio_cmds.h @@ -0,0 +1,94 @@ +/* Generated by ./xlat/gen.sh from ./xlat/aio_cmds.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IOCB_CMD_PREAD) || (defined(HAVE_DECL_IOCB_CMD_PREAD) && HAVE_DECL_IOCB_CMD_PREAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IOCB_CMD_PREAD) == (0), "IOCB_CMD_PREAD != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IOCB_CMD_PREAD 0 +#endif +#if defined(IOCB_CMD_PWRITE) || (defined(HAVE_DECL_IOCB_CMD_PWRITE) && HAVE_DECL_IOCB_CMD_PWRITE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IOCB_CMD_PWRITE) == (1), "IOCB_CMD_PWRITE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IOCB_CMD_PWRITE 1 +#endif +#if defined(IOCB_CMD_FSYNC) || (defined(HAVE_DECL_IOCB_CMD_FSYNC) && HAVE_DECL_IOCB_CMD_FSYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IOCB_CMD_FSYNC) == (2), "IOCB_CMD_FSYNC != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IOCB_CMD_FSYNC 2 +#endif +#if defined(IOCB_CMD_FDSYNC) || (defined(HAVE_DECL_IOCB_CMD_FDSYNC) && HAVE_DECL_IOCB_CMD_FDSYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IOCB_CMD_FDSYNC) == (3), "IOCB_CMD_FDSYNC != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IOCB_CMD_FDSYNC 3 +#endif +#if defined(IOCB_CMD_PREADX) || (defined(HAVE_DECL_IOCB_CMD_PREADX) && HAVE_DECL_IOCB_CMD_PREADX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IOCB_CMD_PREADX) == (4), "IOCB_CMD_PREADX != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IOCB_CMD_PREADX 4 +#endif +#if defined(IOCB_CMD_POLL) || (defined(HAVE_DECL_IOCB_CMD_POLL) && HAVE_DECL_IOCB_CMD_POLL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IOCB_CMD_POLL) == (5), "IOCB_CMD_POLL != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IOCB_CMD_POLL 5 +#endif +#if defined(IOCB_CMD_NOOP) || (defined(HAVE_DECL_IOCB_CMD_NOOP) && HAVE_DECL_IOCB_CMD_NOOP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IOCB_CMD_NOOP) == (6), "IOCB_CMD_NOOP != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IOCB_CMD_NOOP 6 +#endif +#if defined(IOCB_CMD_PREADV) || (defined(HAVE_DECL_IOCB_CMD_PREADV) && HAVE_DECL_IOCB_CMD_PREADV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IOCB_CMD_PREADV) == (7), "IOCB_CMD_PREADV != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IOCB_CMD_PREADV 7 +#endif +#if defined(IOCB_CMD_PWRITEV) || (defined(HAVE_DECL_IOCB_CMD_PWRITEV) && HAVE_DECL_IOCB_CMD_PWRITEV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IOCB_CMD_PWRITEV) == (8), "IOCB_CMD_PWRITEV != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IOCB_CMD_PWRITEV 8 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat aio_cmds in mpers mode + +# else + +static +const struct xlat aio_cmds[] = { + [IOCB_CMD_PREAD] = XLAT(IOCB_CMD_PREAD), + [IOCB_CMD_PWRITE] = XLAT(IOCB_CMD_PWRITE), + [IOCB_CMD_FSYNC] = XLAT(IOCB_CMD_FSYNC), + [IOCB_CMD_FDSYNC] = XLAT(IOCB_CMD_FDSYNC), + [IOCB_CMD_PREADX] = XLAT(IOCB_CMD_PREADX), + [IOCB_CMD_POLL] = XLAT(IOCB_CMD_POLL), + [IOCB_CMD_NOOP] = XLAT(IOCB_CMD_NOOP), + [IOCB_CMD_PREADV] = XLAT(IOCB_CMD_PREADV), + [IOCB_CMD_PWRITEV] = XLAT(IOCB_CMD_PWRITEV), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/aio_cmds.in b/xlat/aio_cmds.in new file mode 100644 index 00000000..fd27d94a --- /dev/null +++ b/xlat/aio_cmds.in @@ -0,0 +1,10 @@ +#value_indexed +IOCB_CMD_PREAD 0 +IOCB_CMD_PWRITE 1 +IOCB_CMD_FSYNC 2 +IOCB_CMD_FDSYNC 3 +IOCB_CMD_PREADX 4 +IOCB_CMD_POLL 5 +IOCB_CMD_NOOP 6 +IOCB_CMD_PREADV 7 +IOCB_CMD_PWRITEV 8 diff --git a/xlat/archvals.h b/xlat/archvals.h index 1f441d52..2e5264a8 100644 --- a/xlat/archvals.h +++ b/xlat/archvals.h @@ -1,38 +1,94 @@ /* Generated by ./xlat/gen.sh from ./xlat/archvals.in; do not edit. */ -#if !(defined(ARCH_MAP_VDSO_X32) || (defined(HAVE_DECL_ARCH_MAP_VDSO_X32) && HAVE_DECL_ARCH_MAP_VDSO_X32)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(ARCH_SET_GS) || (defined(HAVE_DECL_ARCH_SET_GS) && HAVE_DECL_ARCH_SET_GS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARCH_SET_GS) == (0x1001), "ARCH_SET_GS != 0x1001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARCH_SET_GS 0x1001 +#endif +#if defined(ARCH_SET_FS) || (defined(HAVE_DECL_ARCH_SET_FS) && HAVE_DECL_ARCH_SET_FS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARCH_SET_FS) == (0x1002), "ARCH_SET_FS != 0x1002"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARCH_SET_FS 0x1002 +#endif +#if defined(ARCH_GET_FS) || (defined(HAVE_DECL_ARCH_GET_FS) && HAVE_DECL_ARCH_GET_FS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARCH_GET_FS) == (0x1003), "ARCH_GET_FS != 0x1003"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARCH_GET_FS 0x1003 +#endif +#if defined(ARCH_GET_GS) || (defined(HAVE_DECL_ARCH_GET_GS) && HAVE_DECL_ARCH_GET_GS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARCH_GET_GS) == (0x1004), "ARCH_GET_GS != 0x1004"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARCH_GET_GS 0x1004 +#endif +#if defined(ARCH_GET_CPUID) || (defined(HAVE_DECL_ARCH_GET_CPUID) && HAVE_DECL_ARCH_GET_CPUID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARCH_GET_CPUID) == (0x1011), "ARCH_GET_CPUID != 0x1011"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARCH_GET_CPUID 0x1011 +#endif +#if defined(ARCH_SET_CPUID) || (defined(HAVE_DECL_ARCH_SET_CPUID) && HAVE_DECL_ARCH_SET_CPUID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARCH_SET_CPUID) == (0x1012), "ARCH_SET_CPUID != 0x1012"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARCH_SET_CPUID 0x1012 +#endif +#if defined(ARCH_MAP_VDSO_X32) || (defined(HAVE_DECL_ARCH_MAP_VDSO_X32) && HAVE_DECL_ARCH_MAP_VDSO_X32) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARCH_MAP_VDSO_X32) == (0x2001), "ARCH_MAP_VDSO_X32 != 0x2001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define ARCH_MAP_VDSO_X32 0x2001 #endif -#if !(defined(ARCH_MAP_VDSO_32) || (defined(HAVE_DECL_ARCH_MAP_VDSO_32) && HAVE_DECL_ARCH_MAP_VDSO_32)) +#if defined(ARCH_MAP_VDSO_32) || (defined(HAVE_DECL_ARCH_MAP_VDSO_32) && HAVE_DECL_ARCH_MAP_VDSO_32) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARCH_MAP_VDSO_32) == (0x2002), "ARCH_MAP_VDSO_32 != 0x2002"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define ARCH_MAP_VDSO_32 0x2002 #endif -#if !(defined(ARCH_MAP_VDSO_64) || (defined(HAVE_DECL_ARCH_MAP_VDSO_64) && HAVE_DECL_ARCH_MAP_VDSO_64)) +#if defined(ARCH_MAP_VDSO_64) || (defined(HAVE_DECL_ARCH_MAP_VDSO_64) && HAVE_DECL_ARCH_MAP_VDSO_64) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARCH_MAP_VDSO_64) == (0x2003), "ARCH_MAP_VDSO_64 != 0x2003"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define ARCH_MAP_VDSO_64 0x2003 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat archvals in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat archvals in mpers mode + +# else static const struct xlat archvals[] = { -#if defined(ARCH_SET_GS) || (defined(HAVE_DECL_ARCH_SET_GS) && HAVE_DECL_ARCH_SET_GS) - XLAT(ARCH_SET_GS), -#endif -#if defined(ARCH_SET_FS) || (defined(HAVE_DECL_ARCH_SET_FS) && HAVE_DECL_ARCH_SET_FS) - XLAT(ARCH_SET_FS), -#endif -#if defined(ARCH_GET_FS) || (defined(HAVE_DECL_ARCH_GET_FS) && HAVE_DECL_ARCH_GET_FS) - XLAT(ARCH_GET_FS), -#endif -#if defined(ARCH_GET_GS) || (defined(HAVE_DECL_ARCH_GET_GS) && HAVE_DECL_ARCH_GET_GS) - XLAT(ARCH_GET_GS), -#endif + XLAT(ARCH_SET_GS), + XLAT(ARCH_SET_FS), + XLAT(ARCH_GET_FS), + XLAT(ARCH_GET_GS), + XLAT(ARCH_GET_CPUID), + XLAT(ARCH_SET_CPUID), XLAT(ARCH_MAP_VDSO_X32), XLAT(ARCH_MAP_VDSO_32), XLAT(ARCH_MAP_VDSO_64), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/archvals.in b/xlat/archvals.in index def419d0..1dbbb8d0 100644 --- a/xlat/archvals.in +++ b/xlat/archvals.in @@ -1,7 +1,9 @@ -ARCH_SET_GS -ARCH_SET_FS -ARCH_GET_FS -ARCH_GET_GS +ARCH_SET_GS 0x1001 +ARCH_SET_FS 0x1002 +ARCH_GET_FS 0x1003 +ARCH_GET_GS 0x1004 +ARCH_GET_CPUID 0x1011 +ARCH_SET_CPUID 0x1012 ARCH_MAP_VDSO_X32 0x2001 ARCH_MAP_VDSO_32 0x2002 ARCH_MAP_VDSO_64 0x2003 diff --git a/xlat/arp_hardware_types.h b/xlat/arp_hardware_types.h index 7e669b3d..3da3fc5a 100644 --- a/xlat/arp_hardware_types.h +++ b/xlat/arp_hardware_types.h @@ -1,206 +1,546 @@ /* Generated by ./xlat/gen.sh from ./xlat/arp_hardware_types.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat arp_hardware_types in mpers mode - -#else - -static -const struct xlat arp_hardware_types[] = { #if defined(ARPHRD_NETROM) || (defined(HAVE_DECL_ARPHRD_NETROM) && HAVE_DECL_ARPHRD_NETROM) - XLAT(ARPHRD_NETROM), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_NETROM) == (0), "ARPHRD_NETROM != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_NETROM 0 #endif #if defined(ARPHRD_ETHER) || (defined(HAVE_DECL_ARPHRD_ETHER) && HAVE_DECL_ARPHRD_ETHER) - XLAT(ARPHRD_ETHER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_ETHER) == (1), "ARPHRD_ETHER != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_ETHER 1 #endif #if defined(ARPHRD_EETHER) || (defined(HAVE_DECL_ARPHRD_EETHER) && HAVE_DECL_ARPHRD_EETHER) - XLAT(ARPHRD_EETHER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_EETHER) == (2), "ARPHRD_EETHER != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_EETHER 2 #endif #if defined(ARPHRD_AX25) || (defined(HAVE_DECL_ARPHRD_AX25) && HAVE_DECL_ARPHRD_AX25) - XLAT(ARPHRD_AX25), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_AX25) == (3), "ARPHRD_AX25 != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_AX25 3 #endif #if defined(ARPHRD_PRONET) || (defined(HAVE_DECL_ARPHRD_PRONET) && HAVE_DECL_ARPHRD_PRONET) - XLAT(ARPHRD_PRONET), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_PRONET) == (4), "ARPHRD_PRONET != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_PRONET 4 #endif #if defined(ARPHRD_CHAOS) || (defined(HAVE_DECL_ARPHRD_CHAOS) && HAVE_DECL_ARPHRD_CHAOS) - XLAT(ARPHRD_CHAOS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_CHAOS) == (5), "ARPHRD_CHAOS != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_CHAOS 5 #endif #if defined(ARPHRD_IEEE802) || (defined(HAVE_DECL_ARPHRD_IEEE802) && HAVE_DECL_ARPHRD_IEEE802) - XLAT(ARPHRD_IEEE802), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_IEEE802) == (6), "ARPHRD_IEEE802 != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_IEEE802 6 #endif #if defined(ARPHRD_ARCNET) || (defined(HAVE_DECL_ARPHRD_ARCNET) && HAVE_DECL_ARPHRD_ARCNET) - XLAT(ARPHRD_ARCNET), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_ARCNET) == (7), "ARPHRD_ARCNET != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_ARCNET 7 #endif #if defined(ARPHRD_APPLETLK) || (defined(HAVE_DECL_ARPHRD_APPLETLK) && HAVE_DECL_ARPHRD_APPLETLK) - XLAT(ARPHRD_APPLETLK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_APPLETLK) == (8), "ARPHRD_APPLETLK != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_APPLETLK 8 #endif #if defined(ARPHRD_DLCI) || (defined(HAVE_DECL_ARPHRD_DLCI) && HAVE_DECL_ARPHRD_DLCI) - XLAT(ARPHRD_DLCI), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_DLCI) == (15), "ARPHRD_DLCI != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_DLCI 15 #endif #if defined(ARPHRD_ATM) || (defined(HAVE_DECL_ARPHRD_ATM) && HAVE_DECL_ARPHRD_ATM) - XLAT(ARPHRD_ATM), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_ATM) == (19), "ARPHRD_ATM != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_ATM 19 #endif #if defined(ARPHRD_METRICOM) || (defined(HAVE_DECL_ARPHRD_METRICOM) && HAVE_DECL_ARPHRD_METRICOM) - XLAT(ARPHRD_METRICOM), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_METRICOM) == (23), "ARPHRD_METRICOM != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_METRICOM 23 #endif #if defined(ARPHRD_IEEE1394) || (defined(HAVE_DECL_ARPHRD_IEEE1394) && HAVE_DECL_ARPHRD_IEEE1394) - XLAT(ARPHRD_IEEE1394), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_IEEE1394) == (24), "ARPHRD_IEEE1394 != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_IEEE1394 24 #endif #if defined(ARPHRD_EUI64) || (defined(HAVE_DECL_ARPHRD_EUI64) && HAVE_DECL_ARPHRD_EUI64) - XLAT(ARPHRD_EUI64), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_EUI64) == (27), "ARPHRD_EUI64 != 27"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_EUI64 27 #endif #if defined(ARPHRD_INFINIBAND) || (defined(HAVE_DECL_ARPHRD_INFINIBAND) && HAVE_DECL_ARPHRD_INFINIBAND) - XLAT(ARPHRD_INFINIBAND), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_INFINIBAND) == (32), "ARPHRD_INFINIBAND != 32"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_INFINIBAND 32 #endif #if defined(ARPHRD_SLIP) || (defined(HAVE_DECL_ARPHRD_SLIP) && HAVE_DECL_ARPHRD_SLIP) - XLAT(ARPHRD_SLIP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_SLIP) == (256), "ARPHRD_SLIP != 256"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_SLIP 256 #endif #if defined(ARPHRD_CSLIP) || (defined(HAVE_DECL_ARPHRD_CSLIP) && HAVE_DECL_ARPHRD_CSLIP) - XLAT(ARPHRD_CSLIP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_CSLIP) == (257), "ARPHRD_CSLIP != 257"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_CSLIP 257 #endif #if defined(ARPHRD_SLIP6) || (defined(HAVE_DECL_ARPHRD_SLIP6) && HAVE_DECL_ARPHRD_SLIP6) - XLAT(ARPHRD_SLIP6), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_SLIP6) == (258), "ARPHRD_SLIP6 != 258"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_SLIP6 258 #endif #if defined(ARPHRD_CSLIP6) || (defined(HAVE_DECL_ARPHRD_CSLIP6) && HAVE_DECL_ARPHRD_CSLIP6) - XLAT(ARPHRD_CSLIP6), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_CSLIP6) == (259), "ARPHRD_CSLIP6 != 259"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_CSLIP6 259 #endif #if defined(ARPHRD_RSRVD) || (defined(HAVE_DECL_ARPHRD_RSRVD) && HAVE_DECL_ARPHRD_RSRVD) - XLAT(ARPHRD_RSRVD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_RSRVD) == (260), "ARPHRD_RSRVD != 260"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_RSRVD 260 #endif #if defined(ARPHRD_ADAPT) || (defined(HAVE_DECL_ARPHRD_ADAPT) && HAVE_DECL_ARPHRD_ADAPT) - XLAT(ARPHRD_ADAPT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_ADAPT) == (264), "ARPHRD_ADAPT != 264"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_ADAPT 264 #endif #if defined(ARPHRD_ROSE) || (defined(HAVE_DECL_ARPHRD_ROSE) && HAVE_DECL_ARPHRD_ROSE) - XLAT(ARPHRD_ROSE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_ROSE) == (270), "ARPHRD_ROSE != 270"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_ROSE 270 #endif #if defined(ARPHRD_X25) || (defined(HAVE_DECL_ARPHRD_X25) && HAVE_DECL_ARPHRD_X25) - XLAT(ARPHRD_X25), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_X25) == (271), "ARPHRD_X25 != 271"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_X25 271 #endif #if defined(ARPHRD_HWX25) || (defined(HAVE_DECL_ARPHRD_HWX25) && HAVE_DECL_ARPHRD_HWX25) - XLAT(ARPHRD_HWX25), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_HWX25) == (272), "ARPHRD_HWX25 != 272"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_HWX25 272 #endif #if defined(ARPHRD_CAN) || (defined(HAVE_DECL_ARPHRD_CAN) && HAVE_DECL_ARPHRD_CAN) - XLAT(ARPHRD_CAN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_CAN) == (280), "ARPHRD_CAN != 280"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_CAN 280 #endif #if defined(ARPHRD_PPP) || (defined(HAVE_DECL_ARPHRD_PPP) && HAVE_DECL_ARPHRD_PPP) - XLAT(ARPHRD_PPP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_PPP) == (512), "ARPHRD_PPP != 512"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_PPP 512 #endif #if defined(ARPHRD_CISCO) || (defined(HAVE_DECL_ARPHRD_CISCO) && HAVE_DECL_ARPHRD_CISCO) - XLAT(ARPHRD_CISCO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_CISCO) == (513), "ARPHRD_CISCO != 513"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_CISCO 513 #endif #if defined(ARPHRD_LAPB) || (defined(HAVE_DECL_ARPHRD_LAPB) && HAVE_DECL_ARPHRD_LAPB) - XLAT(ARPHRD_LAPB), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_LAPB) == (516), "ARPHRD_LAPB != 516"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_LAPB 516 #endif #if defined(ARPHRD_DDCMP) || (defined(HAVE_DECL_ARPHRD_DDCMP) && HAVE_DECL_ARPHRD_DDCMP) - XLAT(ARPHRD_DDCMP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_DDCMP) == (517), "ARPHRD_DDCMP != 517"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_DDCMP 517 #endif #if defined(ARPHRD_RAWHDLC) || (defined(HAVE_DECL_ARPHRD_RAWHDLC) && HAVE_DECL_ARPHRD_RAWHDLC) - XLAT(ARPHRD_RAWHDLC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_RAWHDLC) == (518), "ARPHRD_RAWHDLC != 518"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_RAWHDLC 518 +#endif +#if defined(ARPHRD_RAWIP) || (defined(HAVE_DECL_ARPHRD_RAWIP) && HAVE_DECL_ARPHRD_RAWIP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_RAWIP) == (519), "ARPHRD_RAWIP != 519"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_RAWIP 519 #endif #if defined(ARPHRD_TUNNEL) || (defined(HAVE_DECL_ARPHRD_TUNNEL) && HAVE_DECL_ARPHRD_TUNNEL) - XLAT(ARPHRD_TUNNEL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_TUNNEL) == (768), "ARPHRD_TUNNEL != 768"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_TUNNEL 768 #endif #if defined(ARPHRD_TUNNEL6) || (defined(HAVE_DECL_ARPHRD_TUNNEL6) && HAVE_DECL_ARPHRD_TUNNEL6) - XLAT(ARPHRD_TUNNEL6), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_TUNNEL6) == (769), "ARPHRD_TUNNEL6 != 769"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_TUNNEL6 769 #endif #if defined(ARPHRD_FRAD) || (defined(HAVE_DECL_ARPHRD_FRAD) && HAVE_DECL_ARPHRD_FRAD) - XLAT(ARPHRD_FRAD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_FRAD) == (770), "ARPHRD_FRAD != 770"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_FRAD 770 #endif #if defined(ARPHRD_SKIP) || (defined(HAVE_DECL_ARPHRD_SKIP) && HAVE_DECL_ARPHRD_SKIP) - XLAT(ARPHRD_SKIP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_SKIP) == (771), "ARPHRD_SKIP != 771"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_SKIP 771 #endif #if defined(ARPHRD_LOOPBACK) || (defined(HAVE_DECL_ARPHRD_LOOPBACK) && HAVE_DECL_ARPHRD_LOOPBACK) - XLAT(ARPHRD_LOOPBACK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_LOOPBACK) == (772), "ARPHRD_LOOPBACK != 772"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_LOOPBACK 772 #endif #if defined(ARPHRD_LOCALTLK) || (defined(HAVE_DECL_ARPHRD_LOCALTLK) && HAVE_DECL_ARPHRD_LOCALTLK) - XLAT(ARPHRD_LOCALTLK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_LOCALTLK) == (773), "ARPHRD_LOCALTLK != 773"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_LOCALTLK 773 #endif #if defined(ARPHRD_FDDI) || (defined(HAVE_DECL_ARPHRD_FDDI) && HAVE_DECL_ARPHRD_FDDI) - XLAT(ARPHRD_FDDI), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_FDDI) == (774), "ARPHRD_FDDI != 774"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_FDDI 774 #endif #if defined(ARPHRD_BIF) || (defined(HAVE_DECL_ARPHRD_BIF) && HAVE_DECL_ARPHRD_BIF) - XLAT(ARPHRD_BIF), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_BIF) == (775), "ARPHRD_BIF != 775"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_BIF 775 #endif #if defined(ARPHRD_SIT) || (defined(HAVE_DECL_ARPHRD_SIT) && HAVE_DECL_ARPHRD_SIT) - XLAT(ARPHRD_SIT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_SIT) == (776), "ARPHRD_SIT != 776"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_SIT 776 #endif #if defined(ARPHRD_IPDDP) || (defined(HAVE_DECL_ARPHRD_IPDDP) && HAVE_DECL_ARPHRD_IPDDP) - XLAT(ARPHRD_IPDDP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_IPDDP) == (777), "ARPHRD_IPDDP != 777"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_IPDDP 777 #endif #if defined(ARPHRD_IPGRE) || (defined(HAVE_DECL_ARPHRD_IPGRE) && HAVE_DECL_ARPHRD_IPGRE) - XLAT(ARPHRD_IPGRE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_IPGRE) == (778), "ARPHRD_IPGRE != 778"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_IPGRE 778 #endif #if defined(ARPHRD_PIMREG) || (defined(HAVE_DECL_ARPHRD_PIMREG) && HAVE_DECL_ARPHRD_PIMREG) - XLAT(ARPHRD_PIMREG), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_PIMREG) == (779), "ARPHRD_PIMREG != 779"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_PIMREG 779 #endif #if defined(ARPHRD_HIPPI) || (defined(HAVE_DECL_ARPHRD_HIPPI) && HAVE_DECL_ARPHRD_HIPPI) - XLAT(ARPHRD_HIPPI), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_HIPPI) == (780), "ARPHRD_HIPPI != 780"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_HIPPI 780 #endif #if defined(ARPHRD_ASH) || (defined(HAVE_DECL_ARPHRD_ASH) && HAVE_DECL_ARPHRD_ASH) - XLAT(ARPHRD_ASH), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_ASH) == (781), "ARPHRD_ASH != 781"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_ASH 781 #endif #if defined(ARPHRD_ECONET) || (defined(HAVE_DECL_ARPHRD_ECONET) && HAVE_DECL_ARPHRD_ECONET) - XLAT(ARPHRD_ECONET), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_ECONET) == (782), "ARPHRD_ECONET != 782"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_ECONET 782 #endif #if defined(ARPHRD_IRDA) || (defined(HAVE_DECL_ARPHRD_IRDA) && HAVE_DECL_ARPHRD_IRDA) - XLAT(ARPHRD_IRDA), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_IRDA) == (783), "ARPHRD_IRDA != 783"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_IRDA 783 #endif #if defined(ARPHRD_FCPP) || (defined(HAVE_DECL_ARPHRD_FCPP) && HAVE_DECL_ARPHRD_FCPP) - XLAT(ARPHRD_FCPP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_FCPP) == (784), "ARPHRD_FCPP != 784"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_FCPP 784 #endif #if defined(ARPHRD_FCAL) || (defined(HAVE_DECL_ARPHRD_FCAL) && HAVE_DECL_ARPHRD_FCAL) - XLAT(ARPHRD_FCAL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_FCAL) == (785), "ARPHRD_FCAL != 785"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_FCAL 785 #endif #if defined(ARPHRD_FCPL) || (defined(HAVE_DECL_ARPHRD_FCPL) && HAVE_DECL_ARPHRD_FCPL) - XLAT(ARPHRD_FCPL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_FCPL) == (786), "ARPHRD_FCPL != 786"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_FCPL 786 #endif #if defined(ARPHRD_FCFABRIC) || (defined(HAVE_DECL_ARPHRD_FCFABRIC) && HAVE_DECL_ARPHRD_FCFABRIC) - XLAT(ARPHRD_FCFABRIC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_FCFABRIC) == (787), "ARPHRD_FCFABRIC != 787"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_FCFABRIC 787 #endif #if defined(ARPHRD_IEEE802_TR) || (defined(HAVE_DECL_ARPHRD_IEEE802_TR) && HAVE_DECL_ARPHRD_IEEE802_TR) - XLAT(ARPHRD_IEEE802_TR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_IEEE802_TR) == (800), "ARPHRD_IEEE802_TR != 800"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_IEEE802_TR 800 #endif #if defined(ARPHRD_IEEE80211) || (defined(HAVE_DECL_ARPHRD_IEEE80211) && HAVE_DECL_ARPHRD_IEEE80211) - XLAT(ARPHRD_IEEE80211), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_IEEE80211) == (801), "ARPHRD_IEEE80211 != 801"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_IEEE80211 801 #endif #if defined(ARPHRD_IEEE80211_PRISM) || (defined(HAVE_DECL_ARPHRD_IEEE80211_PRISM) && HAVE_DECL_ARPHRD_IEEE80211_PRISM) - XLAT(ARPHRD_IEEE80211_PRISM), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_IEEE80211_PRISM) == (802), "ARPHRD_IEEE80211_PRISM != 802"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_IEEE80211_PRISM 802 #endif #if defined(ARPHRD_IEEE80211_RADIOTAP) || (defined(HAVE_DECL_ARPHRD_IEEE80211_RADIOTAP) && HAVE_DECL_ARPHRD_IEEE80211_RADIOTAP) - XLAT(ARPHRD_IEEE80211_RADIOTAP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_IEEE80211_RADIOTAP) == (803), "ARPHRD_IEEE80211_RADIOTAP != 803"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_IEEE80211_RADIOTAP 803 #endif #if defined(ARPHRD_IEEE802154) || (defined(HAVE_DECL_ARPHRD_IEEE802154) && HAVE_DECL_ARPHRD_IEEE802154) - XLAT(ARPHRD_IEEE802154), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_IEEE802154) == (804), "ARPHRD_IEEE802154 != 804"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_IEEE802154 804 #endif #if defined(ARPHRD_IEEE802154_MONITOR) || (defined(HAVE_DECL_ARPHRD_IEEE802154_MONITOR) && HAVE_DECL_ARPHRD_IEEE802154_MONITOR) - XLAT(ARPHRD_IEEE802154_MONITOR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_IEEE802154_MONITOR) == (805), "ARPHRD_IEEE802154_MONITOR != 805"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_IEEE802154_MONITOR 805 #endif #if defined(ARPHRD_PHONET) || (defined(HAVE_DECL_ARPHRD_PHONET) && HAVE_DECL_ARPHRD_PHONET) - XLAT(ARPHRD_PHONET), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_PHONET) == (820), "ARPHRD_PHONET != 820"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_PHONET 820 #endif #if defined(ARPHRD_PHONET_PIPE) || (defined(HAVE_DECL_ARPHRD_PHONET_PIPE) && HAVE_DECL_ARPHRD_PHONET_PIPE) - XLAT(ARPHRD_PHONET_PIPE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_PHONET_PIPE) == (821), "ARPHRD_PHONET_PIPE != 821"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_PHONET_PIPE 821 #endif #if defined(ARPHRD_CAIF) || (defined(HAVE_DECL_ARPHRD_CAIF) && HAVE_DECL_ARPHRD_CAIF) - XLAT(ARPHRD_CAIF), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_CAIF) == (822), "ARPHRD_CAIF != 822"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_CAIF 822 #endif #if defined(ARPHRD_IP6GRE) || (defined(HAVE_DECL_ARPHRD_IP6GRE) && HAVE_DECL_ARPHRD_IP6GRE) - XLAT(ARPHRD_IP6GRE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_IP6GRE) == (823), "ARPHRD_IP6GRE != 823"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_IP6GRE 823 #endif #if defined(ARPHRD_NETLINK) || (defined(HAVE_DECL_ARPHRD_NETLINK) && HAVE_DECL_ARPHRD_NETLINK) - XLAT(ARPHRD_NETLINK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_NETLINK) == (824), "ARPHRD_NETLINK != 824"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_NETLINK 824 #endif #if defined(ARPHRD_6LOWPAN) || (defined(HAVE_DECL_ARPHRD_6LOWPAN) && HAVE_DECL_ARPHRD_6LOWPAN) - XLAT(ARPHRD_6LOWPAN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_6LOWPAN) == (825), "ARPHRD_6LOWPAN != 825"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_6LOWPAN 825 #endif -#if defined(ARPHRD_VOID) || (defined(HAVE_DECL_ARPHRD_VOID) && HAVE_DECL_ARPHRD_VOID) - XLAT(ARPHRD_VOID), +#if defined(ARPHRD_VSOCKMON) || (defined(HAVE_DECL_ARPHRD_VSOCKMON) && HAVE_DECL_ARPHRD_VSOCKMON) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_VSOCKMON) == (826), "ARPHRD_VSOCKMON != 826"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_VSOCKMON 826 #endif #if defined(ARPHRD_NONE) || (defined(HAVE_DECL_ARPHRD_NONE) && HAVE_DECL_ARPHRD_NONE) - XLAT(ARPHRD_NONE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_NONE) == (0xFFFE), "ARPHRD_NONE != 0xFFFE"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_NONE 0xFFFE #endif +#if defined(ARPHRD_VOID) || (defined(HAVE_DECL_ARPHRD_VOID) && HAVE_DECL_ARPHRD_VOID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ARPHRD_VOID) == (0xFFFF), "ARPHRD_VOID != 0xFFFF"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ARPHRD_VOID 0xFFFF +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS + +const struct xlat arp_hardware_types[] = { + + XLAT(ARPHRD_NETROM), + XLAT(ARPHRD_ETHER), + XLAT(ARPHRD_EETHER), + XLAT(ARPHRD_AX25), + XLAT(ARPHRD_PRONET), + XLAT(ARPHRD_CHAOS), + XLAT(ARPHRD_IEEE802), + XLAT(ARPHRD_ARCNET), + XLAT(ARPHRD_APPLETLK), + XLAT(ARPHRD_DLCI), + XLAT(ARPHRD_ATM), + XLAT(ARPHRD_METRICOM), + XLAT(ARPHRD_IEEE1394), + XLAT(ARPHRD_EUI64), + XLAT(ARPHRD_INFINIBAND), + XLAT(ARPHRD_SLIP), + XLAT(ARPHRD_CSLIP), + XLAT(ARPHRD_SLIP6), + XLAT(ARPHRD_CSLIP6), + XLAT(ARPHRD_RSRVD), + XLAT(ARPHRD_ADAPT), + XLAT(ARPHRD_ROSE), + XLAT(ARPHRD_X25), + XLAT(ARPHRD_HWX25), + XLAT(ARPHRD_CAN), + XLAT(ARPHRD_PPP), + XLAT(ARPHRD_CISCO), + XLAT(ARPHRD_LAPB), + XLAT(ARPHRD_DDCMP), + XLAT(ARPHRD_RAWHDLC), + XLAT(ARPHRD_RAWIP), + XLAT(ARPHRD_TUNNEL), + XLAT(ARPHRD_TUNNEL6), + XLAT(ARPHRD_FRAD), + XLAT(ARPHRD_SKIP), + XLAT(ARPHRD_LOOPBACK), + XLAT(ARPHRD_LOCALTLK), + XLAT(ARPHRD_FDDI), + XLAT(ARPHRD_BIF), + XLAT(ARPHRD_SIT), + XLAT(ARPHRD_IPDDP), + XLAT(ARPHRD_IPGRE), + XLAT(ARPHRD_PIMREG), + XLAT(ARPHRD_HIPPI), + XLAT(ARPHRD_ASH), + XLAT(ARPHRD_ECONET), + XLAT(ARPHRD_IRDA), + XLAT(ARPHRD_FCPP), + XLAT(ARPHRD_FCAL), + XLAT(ARPHRD_FCPL), + XLAT(ARPHRD_FCFABRIC), + XLAT(ARPHRD_IEEE802_TR), + XLAT(ARPHRD_IEEE80211), + XLAT(ARPHRD_IEEE80211_PRISM), + XLAT(ARPHRD_IEEE80211_RADIOTAP), + XLAT(ARPHRD_IEEE802154), + XLAT(ARPHRD_IEEE802154_MONITOR), + XLAT(ARPHRD_PHONET), + XLAT(ARPHRD_PHONET_PIPE), + XLAT(ARPHRD_CAIF), + XLAT(ARPHRD_IP6GRE), + XLAT(ARPHRD_NETLINK), + XLAT(ARPHRD_6LOWPAN), + XLAT(ARPHRD_VSOCKMON), + XLAT(ARPHRD_NONE), + XLAT(ARPHRD_VOID), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/arp_hardware_types.in b/xlat/arp_hardware_types.in index df8b4fcf..3d81314a 100644 --- a/xlat/arp_hardware_types.in +++ b/xlat/arp_hardware_types.in @@ -1,64 +1,67 @@ -ARPHRD_NETROM -ARPHRD_ETHER -ARPHRD_EETHER -ARPHRD_AX25 -ARPHRD_PRONET -ARPHRD_CHAOS -ARPHRD_IEEE802 -ARPHRD_ARCNET -ARPHRD_APPLETLK -ARPHRD_DLCI -ARPHRD_ATM -ARPHRD_METRICOM -ARPHRD_IEEE1394 -ARPHRD_EUI64 -ARPHRD_INFINIBAND -ARPHRD_SLIP -ARPHRD_CSLIP -ARPHRD_SLIP6 -ARPHRD_CSLIP6 -ARPHRD_RSRVD -ARPHRD_ADAPT -ARPHRD_ROSE -ARPHRD_X25 -ARPHRD_HWX25 -ARPHRD_CAN -ARPHRD_PPP -ARPHRD_CISCO -ARPHRD_LAPB -ARPHRD_DDCMP -ARPHRD_RAWHDLC -ARPHRD_TUNNEL -ARPHRD_TUNNEL6 -ARPHRD_FRAD -ARPHRD_SKIP -ARPHRD_LOOPBACK -ARPHRD_LOCALTLK -ARPHRD_FDDI -ARPHRD_BIF -ARPHRD_SIT -ARPHRD_IPDDP -ARPHRD_IPGRE -ARPHRD_PIMREG -ARPHRD_HIPPI -ARPHRD_ASH -ARPHRD_ECONET -ARPHRD_IRDA -ARPHRD_FCPP -ARPHRD_FCAL -ARPHRD_FCPL -ARPHRD_FCFABRIC -ARPHRD_IEEE802_TR -ARPHRD_IEEE80211 -ARPHRD_IEEE80211_PRISM -ARPHRD_IEEE80211_RADIOTAP -ARPHRD_IEEE802154 -ARPHRD_IEEE802154_MONITOR -ARPHRD_PHONET -ARPHRD_PHONET_PIPE -ARPHRD_CAIF -ARPHRD_IP6GRE -ARPHRD_NETLINK -ARPHRD_6LOWPAN -ARPHRD_VOID -ARPHRD_NONE +/* sort -k2,2g */ +ARPHRD_NETROM 0 +ARPHRD_ETHER 1 +ARPHRD_EETHER 2 +ARPHRD_AX25 3 +ARPHRD_PRONET 4 +ARPHRD_CHAOS 5 +ARPHRD_IEEE802 6 +ARPHRD_ARCNET 7 +ARPHRD_APPLETLK 8 +ARPHRD_DLCI 15 +ARPHRD_ATM 19 +ARPHRD_METRICOM 23 +ARPHRD_IEEE1394 24 +ARPHRD_EUI64 27 +ARPHRD_INFINIBAND 32 +ARPHRD_SLIP 256 +ARPHRD_CSLIP 257 +ARPHRD_SLIP6 258 +ARPHRD_CSLIP6 259 +ARPHRD_RSRVD 260 +ARPHRD_ADAPT 264 +ARPHRD_ROSE 270 +ARPHRD_X25 271 +ARPHRD_HWX25 272 +ARPHRD_CAN 280 +ARPHRD_PPP 512 +ARPHRD_CISCO 513 +ARPHRD_LAPB 516 +ARPHRD_DDCMP 517 +ARPHRD_RAWHDLC 518 +ARPHRD_RAWIP 519 +ARPHRD_TUNNEL 768 +ARPHRD_TUNNEL6 769 +ARPHRD_FRAD 770 +ARPHRD_SKIP 771 +ARPHRD_LOOPBACK 772 +ARPHRD_LOCALTLK 773 +ARPHRD_FDDI 774 +ARPHRD_BIF 775 +ARPHRD_SIT 776 +ARPHRD_IPDDP 777 +ARPHRD_IPGRE 778 +ARPHRD_PIMREG 779 +ARPHRD_HIPPI 780 +ARPHRD_ASH 781 +ARPHRD_ECONET 782 +ARPHRD_IRDA 783 +ARPHRD_FCPP 784 +ARPHRD_FCAL 785 +ARPHRD_FCPL 786 +ARPHRD_FCFABRIC 787 +ARPHRD_IEEE802_TR 800 +ARPHRD_IEEE80211 801 +ARPHRD_IEEE80211_PRISM 802 +ARPHRD_IEEE80211_RADIOTAP 803 +ARPHRD_IEEE802154 804 +ARPHRD_IEEE802154_MONITOR 805 +ARPHRD_PHONET 820 +ARPHRD_PHONET_PIPE 821 +ARPHRD_CAIF 822 +ARPHRD_IP6GRE 823 +ARPHRD_NETLINK 824 +ARPHRD_6LOWPAN 825 +ARPHRD_VSOCKMON 826 +ARPHRD_NONE 0xFFFE +ARPHRD_VOID 0xFFFF diff --git a/xlat/at_flags.h b/xlat/at_flags.h index 5bebc0bc..bb16a8ef 100644 --- a/xlat/at_flags.h +++ b/xlat/at_flags.h @@ -1,21 +1,47 @@ /* Generated by ./xlat/gen.sh from ./xlat/at_flags.in; do not edit. */ -#if !(defined(AT_SYMLINK_NOFOLLOW) || (defined(HAVE_DECL_AT_SYMLINK_NOFOLLOW) && HAVE_DECL_AT_SYMLINK_NOFOLLOW)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(AT_SYMLINK_NOFOLLOW) || (defined(HAVE_DECL_AT_SYMLINK_NOFOLLOW) && HAVE_DECL_AT_SYMLINK_NOFOLLOW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AT_SYMLINK_NOFOLLOW) == (0x100), "AT_SYMLINK_NOFOLLOW != 0x100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AT_SYMLINK_NOFOLLOW 0x100 #endif -#if !(defined(AT_REMOVEDIR) || (defined(HAVE_DECL_AT_REMOVEDIR) && HAVE_DECL_AT_REMOVEDIR)) +#if defined(AT_REMOVEDIR) || (defined(HAVE_DECL_AT_REMOVEDIR) && HAVE_DECL_AT_REMOVEDIR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AT_REMOVEDIR) == (0x200), "AT_REMOVEDIR != 0x200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AT_REMOVEDIR 0x200 #endif -#if !(defined(AT_SYMLINK_FOLLOW) || (defined(HAVE_DECL_AT_SYMLINK_FOLLOW) && HAVE_DECL_AT_SYMLINK_FOLLOW)) +#if defined(AT_SYMLINK_FOLLOW) || (defined(HAVE_DECL_AT_SYMLINK_FOLLOW) && HAVE_DECL_AT_SYMLINK_FOLLOW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AT_SYMLINK_FOLLOW) == (0x400), "AT_SYMLINK_FOLLOW != 0x400"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AT_SYMLINK_FOLLOW 0x400 #endif -#if !(defined(AT_NO_AUTOMOUNT) || (defined(HAVE_DECL_AT_NO_AUTOMOUNT) && HAVE_DECL_AT_NO_AUTOMOUNT)) +#if defined(AT_NO_AUTOMOUNT) || (defined(HAVE_DECL_AT_NO_AUTOMOUNT) && HAVE_DECL_AT_NO_AUTOMOUNT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AT_NO_AUTOMOUNT) == (0x800), "AT_NO_AUTOMOUNT != 0x800"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AT_NO_AUTOMOUNT 0x800 #endif -#if !(defined(AT_EMPTY_PATH) || (defined(HAVE_DECL_AT_EMPTY_PATH) && HAVE_DECL_AT_EMPTY_PATH)) +#if defined(AT_EMPTY_PATH) || (defined(HAVE_DECL_AT_EMPTY_PATH) && HAVE_DECL_AT_EMPTY_PATH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AT_EMPTY_PATH) == (0x1000), "AT_EMPTY_PATH != 0x1000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AT_EMPTY_PATH 0x1000 #endif -#ifndef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS const struct xlat at_flags[] = { XLAT(AT_SYMLINK_NOFOLLOW), @@ -26,4 +52,6 @@ const struct xlat at_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/at_statx_sync_types.h b/xlat/at_statx_sync_types.h new file mode 100644 index 00000000..2850d53e --- /dev/null +++ b/xlat/at_statx_sync_types.h @@ -0,0 +1,55 @@ +/* Generated by ./xlat/gen.sh from ./xlat/at_statx_sync_types.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(AT_STATX_SYNC_AS_STAT) || (defined(HAVE_DECL_AT_STATX_SYNC_AS_STAT) && HAVE_DECL_AT_STATX_SYNC_AS_STAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AT_STATX_SYNC_AS_STAT) == (0x0000), "AT_STATX_SYNC_AS_STAT != 0x0000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AT_STATX_SYNC_AS_STAT 0x0000 +#endif +#if defined(AT_STATX_FORCE_SYNC) || (defined(HAVE_DECL_AT_STATX_FORCE_SYNC) && HAVE_DECL_AT_STATX_FORCE_SYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AT_STATX_FORCE_SYNC) == (0x2000), "AT_STATX_FORCE_SYNC != 0x2000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AT_STATX_FORCE_SYNC 0x2000 +#endif +#if defined(AT_STATX_DONT_SYNC) || (defined(HAVE_DECL_AT_STATX_DONT_SYNC) && HAVE_DECL_AT_STATX_DONT_SYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AT_STATX_DONT_SYNC) == (0x4000), "AT_STATX_DONT_SYNC != 0x4000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AT_STATX_DONT_SYNC 0x4000 +#endif +#if defined(AT_STATX_SYNC_TYPE) || (defined(HAVE_DECL_AT_STATX_SYNC_TYPE) && HAVE_DECL_AT_STATX_SYNC_TYPE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AT_STATX_SYNC_TYPE) == (0x6000), "AT_STATX_SYNC_TYPE != 0x6000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AT_STATX_SYNC_TYPE 0x6000 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat at_statx_sync_types in mpers mode + +# else + +static +const struct xlat at_statx_sync_types[] = { + XLAT(AT_STATX_SYNC_AS_STAT), + XLAT(AT_STATX_FORCE_SYNC), + XLAT(AT_STATX_DONT_SYNC), + + XLAT(AT_STATX_SYNC_TYPE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/at_statx_sync_types.in b/xlat/at_statx_sync_types.in new file mode 100644 index 00000000..5d0ed494 --- /dev/null +++ b/xlat/at_statx_sync_types.in @@ -0,0 +1,5 @@ +AT_STATX_SYNC_AS_STAT 0x0000 +AT_STATX_FORCE_SYNC 0x2000 +AT_STATX_DONT_SYNC 0x4000 + +AT_STATX_SYNC_TYPE 0x6000 diff --git a/xlat/atomic_ops.h b/xlat/atomic_ops.h index 224dfea1..17e0323d 100644 --- a/xlat/atomic_ops.h +++ b/xlat/atomic_ops.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/atomic_ops.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat atomic_ops in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat atomic_ops in mpers mode + +# else static const struct xlat atomic_ops[] = { @@ -20,4 +26,6 @@ const struct xlat atomic_ops[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/audit_arch.h b/xlat/audit_arch.h index 16d39473..fbeb0f54 100644 --- a/xlat/audit_arch.h +++ b/xlat/audit_arch.h @@ -1,4 +1,8 @@ /* Generated by ./xlat/gen.sh from ./xlat/audit_arch.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + #ifdef EM_ARM #endif #ifdef EM_FRV @@ -8,17 +12,12 @@ #ifdef EM_OPENRISC #endif -#ifdef IN_MPERS - -extern const struct xlat audit_arch[]; +#ifndef XLAT_MACROS_ONLY -#else +# ifndef IN_MPERS -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) -static -# endif const struct xlat audit_arch[] = { -/* linux used to have linux/elf-em.h out of sync with linux/audit.h */ + #if defined(AUDIT_ARCH_AARCH64) || (defined(HAVE_DECL_AUDIT_ARCH_AARCH64) && HAVE_DECL_AUDIT_ARCH_AARCH64) XLAT(AUDIT_ARCH_AARCH64), #endif @@ -126,4 +125,6 @@ const struct xlat audit_arch[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ax25_protocols.h b/xlat/ax25_protocols.h new file mode 100644 index 00000000..8f72ebb8 --- /dev/null +++ b/xlat/ax25_protocols.h @@ -0,0 +1,130 @@ +/* Generated by ./xlat/gen.sh from ./xlat/ax25_protocols.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(AX25_P_ROSE) || (defined(HAVE_DECL_AX25_P_ROSE) && HAVE_DECL_AX25_P_ROSE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_P_ROSE) == (0x01), "AX25_P_ROSE != 0x01"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_P_ROSE 0x01 +#endif +#if defined(AX25_P_VJCOMP) || (defined(HAVE_DECL_AX25_P_VJCOMP) && HAVE_DECL_AX25_P_VJCOMP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_P_VJCOMP) == (0x06), "AX25_P_VJCOMP != 0x06"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_P_VJCOMP 0x06 +#endif +#if defined(AX25_P_VJUNCOMP) || (defined(HAVE_DECL_AX25_P_VJUNCOMP) && HAVE_DECL_AX25_P_VJUNCOMP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_P_VJUNCOMP) == (0x07), "AX25_P_VJUNCOMP != 0x07"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_P_VJUNCOMP 0x07 +#endif +#if defined(AX25_P_SEGMENT) || (defined(HAVE_DECL_AX25_P_SEGMENT) && HAVE_DECL_AX25_P_SEGMENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_P_SEGMENT) == (0x08), "AX25_P_SEGMENT != 0x08"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_P_SEGMENT 0x08 +#endif +#if defined(AX25_P_TEXNET) || (defined(HAVE_DECL_AX25_P_TEXNET) && HAVE_DECL_AX25_P_TEXNET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_P_TEXNET) == (0xc3), "AX25_P_TEXNET != 0xc3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_P_TEXNET 0xc3 +#endif +#if defined(AX25_P_LQ) || (defined(HAVE_DECL_AX25_P_LQ) && HAVE_DECL_AX25_P_LQ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_P_LQ) == (0xc4), "AX25_P_LQ != 0xc4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_P_LQ 0xc4 +#endif +#if defined(AX25_P_ATALK) || (defined(HAVE_DECL_AX25_P_ATALK) && HAVE_DECL_AX25_P_ATALK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_P_ATALK) == (0xca), "AX25_P_ATALK != 0xca"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_P_ATALK 0xca +#endif +#if defined(AX25_P_ATALK_ARP) || (defined(HAVE_DECL_AX25_P_ATALK_ARP) && HAVE_DECL_AX25_P_ATALK_ARP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_P_ATALK_ARP) == (0xcb), "AX25_P_ATALK_ARP != 0xcb"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_P_ATALK_ARP 0xcb +#endif +#if defined(AX25_P_IP) || (defined(HAVE_DECL_AX25_P_IP) && HAVE_DECL_AX25_P_IP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_P_IP) == (0xcc), "AX25_P_IP != 0xcc"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_P_IP 0xcc +#endif +#if defined(AX25_P_ARP) || (defined(HAVE_DECL_AX25_P_ARP) && HAVE_DECL_AX25_P_ARP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_P_ARP) == (0xcd), "AX25_P_ARP != 0xcd"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_P_ARP 0xcd +#endif +#if defined(AX25_P_FLEXNET) || (defined(HAVE_DECL_AX25_P_FLEXNET) && HAVE_DECL_AX25_P_FLEXNET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_P_FLEXNET) == (0xce), "AX25_P_FLEXNET != 0xce"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_P_FLEXNET 0xce +#endif +#if defined(AX25_P_NETROM) || (defined(HAVE_DECL_AX25_P_NETROM) && HAVE_DECL_AX25_P_NETROM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_P_NETROM) == (0xcf), "AX25_P_NETROM != 0xcf"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_P_NETROM 0xcf +#endif +#if defined(AX25_P_TEXT) || (defined(HAVE_DECL_AX25_P_TEXT) && HAVE_DECL_AX25_P_TEXT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_P_TEXT) == (0xf0), "AX25_P_TEXT != 0xf0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_P_TEXT 0xf0 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat ax25_protocols in mpers mode + +# else + +static +const struct xlat ax25_protocols[] = { + + + XLAT(AX25_P_ROSE), + XLAT(AX25_P_VJCOMP), + + XLAT(AX25_P_VJUNCOMP), + + XLAT(AX25_P_SEGMENT), + XLAT(AX25_P_TEXNET), + XLAT(AX25_P_LQ), + XLAT(AX25_P_ATALK), + XLAT(AX25_P_ATALK_ARP), + XLAT(AX25_P_IP), + XLAT(AX25_P_ARP), + XLAT(AX25_P_FLEXNET), + XLAT(AX25_P_NETROM), + XLAT(AX25_P_TEXT), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ax25_protocols.in b/xlat/ax25_protocols.in new file mode 100644 index 00000000..89ced436 --- /dev/null +++ b/xlat/ax25_protocols.in @@ -0,0 +1,17 @@ +/* sorted */ +/* Those are pulled from include/net/ax25.h, they should be part of UAPI */ +AX25_P_ROSE 0x01 +AX25_P_VJCOMP 0x06 /* Compressed TCP/IP packet */ + /* Van Jacobsen (RFC 1144) */ +AX25_P_VJUNCOMP 0x07 /* Uncompressed TCP/IP packet */ + /* Van Jacobsen (RFC 1144) */ +AX25_P_SEGMENT 0x08 /* Segmentation fragment */ +AX25_P_TEXNET 0xc3 /* TEXTNET datagram protocol */ +AX25_P_LQ 0xc4 /* Link Quality Protocol */ +AX25_P_ATALK 0xca /* Appletalk */ +AX25_P_ATALK_ARP 0xcb /* Appletalk ARP */ +AX25_P_IP 0xcc /* ARPA Internet Protocol */ +AX25_P_ARP 0xcd /* ARPA Address Resolution */ +AX25_P_FLEXNET 0xce /* FlexNet */ +AX25_P_NETROM 0xcf /* NET/ROM */ +AX25_P_TEXT 0xf0 /* No layer 3 protocol impl. */ diff --git a/xlat/baud_options.h b/xlat/baud_options.h index 0ea7336f..62e706f3 100644 --- a/xlat/baud_options.h +++ b/xlat/baud_options.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/baud_options.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat baud_options in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat baud_options in mpers mode + +# else static const struct xlat baud_options[] = { @@ -110,4 +116,6 @@ const struct xlat baud_options[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bdaddr_types.h b/xlat/bdaddr_types.h new file mode 100644 index 00000000..110ee4d3 --- /dev/null +++ b/xlat/bdaddr_types.h @@ -0,0 +1,46 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bdaddr_types.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BDADDR_BREDR) || (defined(HAVE_DECL_BDADDR_BREDR) && HAVE_DECL_BDADDR_BREDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BDADDR_BREDR) == (0), "BDADDR_BREDR != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BDADDR_BREDR 0 +#endif +#if defined(BDADDR_LE_PUBLIC) || (defined(HAVE_DECL_BDADDR_LE_PUBLIC) && HAVE_DECL_BDADDR_LE_PUBLIC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BDADDR_LE_PUBLIC) == (1), "BDADDR_LE_PUBLIC != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BDADDR_LE_PUBLIC 1 +#endif +#if defined(BDADDR_LE_RANDOM) || (defined(HAVE_DECL_BDADDR_LE_RANDOM) && HAVE_DECL_BDADDR_LE_RANDOM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BDADDR_LE_RANDOM) == (2), "BDADDR_LE_RANDOM != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BDADDR_LE_RANDOM 2 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat bdaddr_types in mpers mode + +# else + +static +const struct xlat bdaddr_types[] = { + [BDADDR_BREDR] = XLAT(BDADDR_BREDR), + [BDADDR_LE_PUBLIC] = XLAT(BDADDR_LE_PUBLIC), + [BDADDR_LE_RANDOM] = XLAT(BDADDR_LE_RANDOM), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bdaddr_types.in b/xlat/bdaddr_types.in new file mode 100644 index 00000000..b81b6fc3 --- /dev/null +++ b/xlat/bdaddr_types.in @@ -0,0 +1,4 @@ +#value_indexed +BDADDR_BREDR 0 +BDADDR_LE_PUBLIC 1 +BDADDR_LE_RANDOM 2 diff --git a/xlat/blkpg_ops.h b/xlat/blkpg_ops.h index bc36705e..81171dcf 100644 --- a/xlat/blkpg_ops.h +++ b/xlat/blkpg_ops.h @@ -1,23 +1,41 @@ /* Generated by ./xlat/gen.sh from ./xlat/blkpg_ops.in; do not edit. */ -#if !(defined(BLKPG_ADD_PARTITION) || (defined(HAVE_DECL_BLKPG_ADD_PARTITION) && HAVE_DECL_BLKPG_ADD_PARTITION)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BLKPG_ADD_PARTITION) || (defined(HAVE_DECL_BLKPG_ADD_PARTITION) && HAVE_DECL_BLKPG_ADD_PARTITION) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKPG_ADD_PARTITION) == (1), "BLKPG_ADD_PARTITION != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BLKPG_ADD_PARTITION 1 #endif -#if !(defined(BLKPG_DEL_PARTITION) || (defined(HAVE_DECL_BLKPG_DEL_PARTITION) && HAVE_DECL_BLKPG_DEL_PARTITION)) +#if defined(BLKPG_DEL_PARTITION) || (defined(HAVE_DECL_BLKPG_DEL_PARTITION) && HAVE_DECL_BLKPG_DEL_PARTITION) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKPG_DEL_PARTITION) == (2), "BLKPG_DEL_PARTITION != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BLKPG_DEL_PARTITION 2 #endif -#if !(defined(BLKPG_RESIZE_PARTITION) || (defined(HAVE_DECL_BLKPG_RESIZE_PARTITION) && HAVE_DECL_BLKPG_RESIZE_PARTITION)) +#if defined(BLKPG_RESIZE_PARTITION) || (defined(HAVE_DECL_BLKPG_RESIZE_PARTITION) && HAVE_DECL_BLKPG_RESIZE_PARTITION) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKPG_RESIZE_PARTITION) == (3), "BLKPG_RESIZE_PARTITION != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BLKPG_RESIZE_PARTITION 3 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat blkpg_ops[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat blkpg_ops[] = { XLAT(BLKPG_ADD_PARTITION), XLAT(BLKPG_DEL_PARTITION), @@ -25,4 +43,6 @@ const struct xlat blkpg_ops[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/block_ioctl_cmds.h b/xlat/block_ioctl_cmds.h new file mode 100644 index 00000000..a0935a67 --- /dev/null +++ b/xlat/block_ioctl_cmds.h @@ -0,0 +1,301 @@ +/* Generated by ./xlat/gen.sh from ./xlat/block_ioctl_cmds.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BLKROSET) || (defined(HAVE_DECL_BLKROSET) && HAVE_DECL_BLKROSET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKROSET) == (_IO(0x12, 93)), "BLKROSET != _IO(0x12, 93)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKROSET _IO(0x12, 93) +#endif +#if defined(BLKROGET) || (defined(HAVE_DECL_BLKROGET) && HAVE_DECL_BLKROGET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKROGET) == (_IO(0x12, 94)), "BLKROGET != _IO(0x12, 94)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKROGET _IO(0x12, 94) +#endif +#if defined(BLKRRPART) || (defined(HAVE_DECL_BLKRRPART) && HAVE_DECL_BLKRRPART) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKRRPART) == (_IO(0x12, 95)), "BLKRRPART != _IO(0x12, 95)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKRRPART _IO(0x12, 95) +#endif +#if defined(BLKGETSIZE) || (defined(HAVE_DECL_BLKGETSIZE) && HAVE_DECL_BLKGETSIZE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKGETSIZE) == (_IO(0x12, 96)), "BLKGETSIZE != _IO(0x12, 96)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKGETSIZE _IO(0x12, 96) +#endif +#if defined(BLKFLSBUF) || (defined(HAVE_DECL_BLKFLSBUF) && HAVE_DECL_BLKFLSBUF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKFLSBUF) == (_IO(0x12, 97)), "BLKFLSBUF != _IO(0x12, 97)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKFLSBUF _IO(0x12, 97) +#endif +#if defined(BLKRASET) || (defined(HAVE_DECL_BLKRASET) && HAVE_DECL_BLKRASET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKRASET) == (_IO(0x12, 98)), "BLKRASET != _IO(0x12, 98)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKRASET _IO(0x12, 98) +#endif +#if defined(BLKRAGET) || (defined(HAVE_DECL_BLKRAGET) && HAVE_DECL_BLKRAGET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKRAGET) == (_IO(0x12, 99)), "BLKRAGET != _IO(0x12, 99)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKRAGET _IO(0x12, 99) +#endif +#if defined(BLKFRASET) || (defined(HAVE_DECL_BLKFRASET) && HAVE_DECL_BLKFRASET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKFRASET) == (_IO(0x12, 100)), "BLKFRASET != _IO(0x12, 100)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKFRASET _IO(0x12, 100) +#endif +#if defined(BLKFRAGET) || (defined(HAVE_DECL_BLKFRAGET) && HAVE_DECL_BLKFRAGET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKFRAGET) == (_IO(0x12, 101)), "BLKFRAGET != _IO(0x12, 101)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKFRAGET _IO(0x12, 101) +#endif +#if defined(BLKSECTSET) || (defined(HAVE_DECL_BLKSECTSET) && HAVE_DECL_BLKSECTSET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKSECTSET) == (_IO(0x12, 102)), "BLKSECTSET != _IO(0x12, 102)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKSECTSET _IO(0x12, 102) +#endif +#if defined(BLKSECTGET) || (defined(HAVE_DECL_BLKSECTGET) && HAVE_DECL_BLKSECTGET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKSECTGET) == (_IO(0x12, 103)), "BLKSECTGET != _IO(0x12, 103)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKSECTGET _IO(0x12, 103) +#endif +#if defined(BLKSSZGET) || (defined(HAVE_DECL_BLKSSZGET) && HAVE_DECL_BLKSSZGET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKSSZGET) == (_IO(0x12, 104)), "BLKSSZGET != _IO(0x12, 104)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKSSZGET _IO(0x12, 104) +#endif +#if defined(BLKPG) || (defined(HAVE_DECL_BLKPG) && HAVE_DECL_BLKPG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKPG) == (_IO(0x12, 105)), "BLKPG != _IO(0x12, 105)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKPG _IO(0x12, 105) +#endif +#if defined(BLKELVGET) || (defined(HAVE_DECL_BLKELVGET) && HAVE_DECL_BLKELVGET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKELVGET) == (_IOR(0x12, 106, size_t)), "BLKELVGET != _IOR(0x12, 106, size_t)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKELVGET _IOR(0x12, 106, size_t) +#endif +#if defined(BLKELVSET) || (defined(HAVE_DECL_BLKELVSET) && HAVE_DECL_BLKELVSET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKELVSET) == (_IOW(0x12, 107, size_t)), "BLKELVSET != _IOW(0x12, 107, size_t)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKELVSET _IOW(0x12, 107, size_t) +#endif +#if defined(BLKBSZGET) || (defined(HAVE_DECL_BLKBSZGET) && HAVE_DECL_BLKBSZGET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKBSZGET) == (_IOR(0x12, 112, size_t)), "BLKBSZGET != _IOR(0x12, 112, size_t)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKBSZGET _IOR(0x12, 112, size_t) +#endif +#if defined(BLKBSZSET) || (defined(HAVE_DECL_BLKBSZSET) && HAVE_DECL_BLKBSZSET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKBSZSET) == (_IOW(0x12, 113, size_t)), "BLKBSZSET != _IOW(0x12, 113, size_t)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKBSZSET _IOW(0x12, 113, size_t) +#endif +#if defined(BLKGETSIZE64) || (defined(HAVE_DECL_BLKGETSIZE64) && HAVE_DECL_BLKGETSIZE64) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKGETSIZE64) == (_IOR(0x12, 114, size_t)), "BLKGETSIZE64 != _IOR(0x12, 114, size_t)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKGETSIZE64 _IOR(0x12, 114, size_t) +#endif +#if defined(BLKTRACESETUP) || (defined(HAVE_DECL_BLKTRACESETUP) && HAVE_DECL_BLKTRACESETUP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKTRACESETUP) == (_IOWR(0x12, 115, struct blk_user_trace_setup)), "BLKTRACESETUP != _IOWR(0x12, 115, struct blk_user_trace_setup)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKTRACESETUP _IOWR(0x12, 115, struct blk_user_trace_setup) +#endif +#if defined(BLKTRACESTART) || (defined(HAVE_DECL_BLKTRACESTART) && HAVE_DECL_BLKTRACESTART) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKTRACESTART) == (_IO(0x12, 116)), "BLKTRACESTART != _IO(0x12, 116)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKTRACESTART _IO(0x12, 116) +#endif +#if defined(BLKTRACESTOP) || (defined(HAVE_DECL_BLKTRACESTOP) && HAVE_DECL_BLKTRACESTOP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKTRACESTOP) == (_IO(0x12, 117)), "BLKTRACESTOP != _IO(0x12, 117)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKTRACESTOP _IO(0x12, 117) +#endif +#if defined(BLKTRACETEARDOWN) || (defined(HAVE_DECL_BLKTRACETEARDOWN) && HAVE_DECL_BLKTRACETEARDOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKTRACETEARDOWN) == (_IO(0x12, 118)), "BLKTRACETEARDOWN != _IO(0x12, 118)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKTRACETEARDOWN _IO(0x12, 118) +#endif +#if defined(BLKDISCARD) || (defined(HAVE_DECL_BLKDISCARD) && HAVE_DECL_BLKDISCARD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKDISCARD) == (_IO(0x12, 119)), "BLKDISCARD != _IO(0x12, 119)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKDISCARD _IO(0x12, 119) +#endif +#if defined(BLKIOMIN) || (defined(HAVE_DECL_BLKIOMIN) && HAVE_DECL_BLKIOMIN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKIOMIN) == (_IO(0x12, 120)), "BLKIOMIN != _IO(0x12, 120)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKIOMIN _IO(0x12, 120) +#endif +#if defined(BLKIOOPT) || (defined(HAVE_DECL_BLKIOOPT) && HAVE_DECL_BLKIOOPT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKIOOPT) == (_IO(0x12, 121)), "BLKIOOPT != _IO(0x12, 121)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKIOOPT _IO(0x12, 121) +#endif +#if defined(BLKALIGNOFF) || (defined(HAVE_DECL_BLKALIGNOFF) && HAVE_DECL_BLKALIGNOFF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKALIGNOFF) == (_IO(0x12, 122)), "BLKALIGNOFF != _IO(0x12, 122)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKALIGNOFF _IO(0x12, 122) +#endif +#if defined(BLKPBSZGET) || (defined(HAVE_DECL_BLKPBSZGET) && HAVE_DECL_BLKPBSZGET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKPBSZGET) == (_IO(0x12, 123)), "BLKPBSZGET != _IO(0x12, 123)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKPBSZGET _IO(0x12, 123) +#endif +#if defined(BLKDISCARDZEROES) || (defined(HAVE_DECL_BLKDISCARDZEROES) && HAVE_DECL_BLKDISCARDZEROES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKDISCARDZEROES) == (_IO(0x12, 124)), "BLKDISCARDZEROES != _IO(0x12, 124)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKDISCARDZEROES _IO(0x12, 124) +#endif +#if defined(BLKSECDISCARD) || (defined(HAVE_DECL_BLKSECDISCARD) && HAVE_DECL_BLKSECDISCARD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKSECDISCARD) == (_IO(0x12, 125)), "BLKSECDISCARD != _IO(0x12, 125)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKSECDISCARD _IO(0x12, 125) +#endif +#if defined(BLKROTATIONAL) || (defined(HAVE_DECL_BLKROTATIONAL) && HAVE_DECL_BLKROTATIONAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKROTATIONAL) == (_IO(0x12, 126)), "BLKROTATIONAL != _IO(0x12, 126)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKROTATIONAL _IO(0x12, 126) +#endif +#if defined(BLKZEROOUT) || (defined(HAVE_DECL_BLKZEROOUT) && HAVE_DECL_BLKZEROOUT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKZEROOUT) == (_IO(0x12, 127)), "BLKZEROOUT != _IO(0x12, 127)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKZEROOUT _IO(0x12, 127) +#endif +#if defined(BLKDAXGET) || (defined(HAVE_DECL_BLKDAXGET) && HAVE_DECL_BLKDAXGET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKDAXGET) == (_IO(0x12, 129)), "BLKDAXGET != _IO(0x12, 129)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKDAXGET _IO(0x12, 129) +#endif +#if defined(BLKGETZONESZ) || (defined(HAVE_DECL_BLKGETZONESZ) && HAVE_DECL_BLKGETZONESZ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKGETZONESZ) == (_IOR(0x12, 132, uint32_t)), "BLKGETZONESZ != _IOR(0x12, 132, uint32_t)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKGETZONESZ _IOR(0x12, 132, uint32_t) +#endif +#if defined(BLKGETNRZONES) || (defined(HAVE_DECL_BLKGETNRZONES) && HAVE_DECL_BLKGETNRZONES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BLKGETNRZONES) == (_IOR(0x12, 133, uint32_t)), "BLKGETNRZONES != _IOR(0x12, 133, uint32_t)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BLKGETNRZONES _IOR(0x12, 133, uint32_t) +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +extern const struct xlat block_ioctl_cmds[]; + +# else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat block_ioctl_cmds[] = { + XLAT(BLKROSET), + XLAT(BLKROGET), + XLAT(BLKRRPART), + XLAT(BLKGETSIZE), + XLAT(BLKFLSBUF), + XLAT(BLKRASET), + XLAT(BLKRAGET), + XLAT(BLKFRASET), + XLAT(BLKFRAGET), + XLAT(BLKSECTSET), + XLAT(BLKSECTGET), + XLAT(BLKSSZGET), + XLAT(BLKPG), + XLAT(BLKELVGET), + XLAT(BLKELVSET), + XLAT(BLKBSZGET), + XLAT(BLKBSZSET), + XLAT(BLKGETSIZE64), + XLAT(BLKTRACESETUP), + XLAT(BLKTRACESTART), + XLAT(BLKTRACESTOP), + XLAT(BLKTRACETEARDOWN), + XLAT(BLKDISCARD), + XLAT(BLKIOMIN), + XLAT(BLKIOOPT), + XLAT(BLKALIGNOFF), + XLAT(BLKPBSZGET), + XLAT(BLKDISCARDZEROES), + XLAT(BLKSECDISCARD), + XLAT(BLKROTATIONAL), + XLAT(BLKZEROOUT), + + + + XLAT(BLKDAXGET), + + + XLAT(BLKGETZONESZ), + XLAT(BLKGETNRZONES), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/block_ioctl_cmds.in b/xlat/block_ioctl_cmds.in new file mode 100644 index 00000000..45c402f2 --- /dev/null +++ b/xlat/block_ioctl_cmds.in @@ -0,0 +1,39 @@ +BLKROSET _IO(0x12, 93) +BLKROGET _IO(0x12, 94) +BLKRRPART _IO(0x12, 95) +BLKGETSIZE _IO(0x12, 96) +BLKFLSBUF _IO(0x12, 97) +BLKRASET _IO(0x12, 98) +BLKRAGET _IO(0x12, 99) +BLKFRASET _IO(0x12, 100) +BLKFRAGET _IO(0x12, 101) +BLKSECTSET _IO(0x12, 102) +BLKSECTGET _IO(0x12, 103) +BLKSSZGET _IO(0x12, 104) +BLKPG _IO(0x12, 105) +BLKELVGET _IOR(0x12, 106, size_t) +BLKELVSET _IOW(0x12, 107, size_t) +BLKBSZGET _IOR(0x12, 112, size_t) +BLKBSZSET _IOW(0x12, 113, size_t) +BLKGETSIZE64 _IOR(0x12, 114, size_t) +BLKTRACESETUP _IOWR(0x12, 115, struct blk_user_trace_setup) +BLKTRACESTART _IO(0x12, 116) +BLKTRACESTOP _IO(0x12, 117) +BLKTRACETEARDOWN _IO(0x12, 118) +BLKDISCARD _IO(0x12, 119) +BLKIOMIN _IO(0x12, 120) +BLKIOOPT _IO(0x12, 121) +BLKALIGNOFF _IO(0x12, 122) +BLKPBSZGET _IO(0x12, 123) +BLKDISCARDZEROES _IO(0x12, 124) +BLKSECDISCARD _IO(0x12, 125) +BLKROTATIONAL _IO(0x12, 126) +BLKZEROOUT _IO(0x12, 127) +/* BLKDAXSET was present between v4.5-rc1~112^2^2~16 and v4.5-rc3~23^2~3 */ +/* BLKDAXSET _IO(0x12, 128) */ +/* BLKDAXGET was present between v4.5-rc1~112^2^2~16 and v4.7-rc1~78^2^2~4 */ +BLKDAXGET _IO(0x12, 129) +/* BLKREPORTZONE _IOWR(0x12, 130, struct blk_zone_report) */ +/* BLKRESETZONE _IOW(0x12, 131, struct blk_zone_range) */ +BLKGETZONESZ _IOR(0x12, 132, uint32_t) +BLKGETNRZONES _IOR(0x12, 133, uint32_t) diff --git a/xlat/bluetooth_l2_cid.h b/xlat/bluetooth_l2_cid.h new file mode 100644 index 00000000..654e5aad --- /dev/null +++ b/xlat/bluetooth_l2_cid.h @@ -0,0 +1,103 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bluetooth_l2_cid.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(L2CAP_CID_SIGNALING) || (defined(HAVE_DECL_L2CAP_CID_SIGNALING) && HAVE_DECL_L2CAP_CID_SIGNALING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((L2CAP_CID_SIGNALING) == (0x0001), "L2CAP_CID_SIGNALING != 0x0001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define L2CAP_CID_SIGNALING 0x0001 +#endif +#if defined(L2CAP_CID_CONN_LESS) || (defined(HAVE_DECL_L2CAP_CID_CONN_LESS) && HAVE_DECL_L2CAP_CID_CONN_LESS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((L2CAP_CID_CONN_LESS) == (0x0002), "L2CAP_CID_CONN_LESS != 0x0002"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define L2CAP_CID_CONN_LESS 0x0002 +#endif +#if defined(L2CAP_CID_A2MP) || (defined(HAVE_DECL_L2CAP_CID_A2MP) && HAVE_DECL_L2CAP_CID_A2MP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((L2CAP_CID_A2MP) == (0x0003), "L2CAP_CID_A2MP != 0x0003"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define L2CAP_CID_A2MP 0x0003 +#endif +#if defined(L2CAP_CID_ATT) || (defined(HAVE_DECL_L2CAP_CID_ATT) && HAVE_DECL_L2CAP_CID_ATT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((L2CAP_CID_ATT) == (0x0004), "L2CAP_CID_ATT != 0x0004"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define L2CAP_CID_ATT 0x0004 +#endif +#if defined(L2CAP_CID_LE_SIGNALING) || (defined(HAVE_DECL_L2CAP_CID_LE_SIGNALING) && HAVE_DECL_L2CAP_CID_LE_SIGNALING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((L2CAP_CID_LE_SIGNALING) == (0x0005), "L2CAP_CID_LE_SIGNALING != 0x0005"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define L2CAP_CID_LE_SIGNALING 0x0005 +#endif +#if defined(L2CAP_CID_SMP) || (defined(HAVE_DECL_L2CAP_CID_SMP) && HAVE_DECL_L2CAP_CID_SMP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((L2CAP_CID_SMP) == (0x0006), "L2CAP_CID_SMP != 0x0006"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define L2CAP_CID_SMP 0x0006 +#endif +#if defined(L2CAP_CID_SMP_BREDR) || (defined(HAVE_DECL_L2CAP_CID_SMP_BREDR) && HAVE_DECL_L2CAP_CID_SMP_BREDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((L2CAP_CID_SMP_BREDR) == (0x0007), "L2CAP_CID_SMP_BREDR != 0x0007"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define L2CAP_CID_SMP_BREDR 0x0007 +#endif +#if defined(L2CAP_CID_DYN_START) || (defined(HAVE_DECL_L2CAP_CID_DYN_START) && HAVE_DECL_L2CAP_CID_DYN_START) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((L2CAP_CID_DYN_START) == (0x0040), "L2CAP_CID_DYN_START != 0x0040"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define L2CAP_CID_DYN_START 0x0040 +#endif +#if defined(L2CAP_CID_LE_DYN_END) || (defined(HAVE_DECL_L2CAP_CID_LE_DYN_END) && HAVE_DECL_L2CAP_CID_LE_DYN_END) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((L2CAP_CID_LE_DYN_END) == (0x007f), "L2CAP_CID_LE_DYN_END != 0x007f"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define L2CAP_CID_LE_DYN_END 0x007f +#endif +#if defined(L2CAP_CID_DYN_END) || (defined(HAVE_DECL_L2CAP_CID_DYN_END) && HAVE_DECL_L2CAP_CID_DYN_END) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((L2CAP_CID_DYN_END) == (0xffff), "L2CAP_CID_DYN_END != 0xffff"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define L2CAP_CID_DYN_END 0xffff +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat bluetooth_l2_cid in mpers mode + +# else + +static +const struct xlat bluetooth_l2_cid[] = { + + XLAT(L2CAP_CID_SIGNALING), + XLAT(L2CAP_CID_CONN_LESS), + XLAT(L2CAP_CID_A2MP), + XLAT(L2CAP_CID_ATT), + XLAT(L2CAP_CID_LE_SIGNALING), + XLAT(L2CAP_CID_SMP), + XLAT(L2CAP_CID_SMP_BREDR), + XLAT(L2CAP_CID_DYN_START), + XLAT(L2CAP_CID_LE_DYN_END), + XLAT(L2CAP_CID_DYN_END), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bluetooth_l2_cid.in b/xlat/bluetooth_l2_cid.in new file mode 100644 index 00000000..5fd8fd17 --- /dev/null +++ b/xlat/bluetooth_l2_cid.in @@ -0,0 +1,11 @@ +/* sort -k2,2 */ +L2CAP_CID_SIGNALING 0x0001 +L2CAP_CID_CONN_LESS 0x0002 +L2CAP_CID_A2MP 0x0003 +L2CAP_CID_ATT 0x0004 +L2CAP_CID_LE_SIGNALING 0x0005 +L2CAP_CID_SMP 0x0006 +L2CAP_CID_SMP_BREDR 0x0007 +L2CAP_CID_DYN_START 0x0040 +L2CAP_CID_LE_DYN_END 0x007f +L2CAP_CID_DYN_END 0xffff diff --git a/xlat/bluetooth_l2_psm.h b/xlat/bluetooth_l2_psm.h new file mode 100644 index 00000000..358316a5 --- /dev/null +++ b/xlat/bluetooth_l2_psm.h @@ -0,0 +1,95 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bluetooth_l2_psm.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(L2CAP_PSM_SDP) || (defined(HAVE_DECL_L2CAP_PSM_SDP) && HAVE_DECL_L2CAP_PSM_SDP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((L2CAP_PSM_SDP) == (0x0001), "L2CAP_PSM_SDP != 0x0001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define L2CAP_PSM_SDP 0x0001 +#endif +#if defined(L2CAP_PSM_RFCOMM) || (defined(HAVE_DECL_L2CAP_PSM_RFCOMM) && HAVE_DECL_L2CAP_PSM_RFCOMM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((L2CAP_PSM_RFCOMM) == (0x0003), "L2CAP_PSM_RFCOMM != 0x0003"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define L2CAP_PSM_RFCOMM 0x0003 +#endif +#if defined(L2CAP_PSM_3DSP) || (defined(HAVE_DECL_L2CAP_PSM_3DSP) && HAVE_DECL_L2CAP_PSM_3DSP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((L2CAP_PSM_3DSP) == (0x0021), "L2CAP_PSM_3DSP != 0x0021"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define L2CAP_PSM_3DSP 0x0021 +#endif +#if defined(L2CAP_PSM_IPSP) || (defined(HAVE_DECL_L2CAP_PSM_IPSP) && HAVE_DECL_L2CAP_PSM_IPSP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((L2CAP_PSM_IPSP) == (0x0023), "L2CAP_PSM_IPSP != 0x0023"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define L2CAP_PSM_IPSP 0x0023 +#endif +#if defined(L2CAP_PSM_LE_DYN_START) || (defined(HAVE_DECL_L2CAP_PSM_LE_DYN_START) && HAVE_DECL_L2CAP_PSM_LE_DYN_START) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((L2CAP_PSM_LE_DYN_START) == (0x0080), "L2CAP_PSM_LE_DYN_START != 0x0080"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define L2CAP_PSM_LE_DYN_START 0x0080 +#endif +#if defined(L2CAP_PSM_LE_DYN_END) || (defined(HAVE_DECL_L2CAP_PSM_LE_DYN_END) && HAVE_DECL_L2CAP_PSM_LE_DYN_END) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((L2CAP_PSM_LE_DYN_END) == (0x00ff), "L2CAP_PSM_LE_DYN_END != 0x00ff"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define L2CAP_PSM_LE_DYN_END 0x00ff +#endif +#if defined(L2CAP_PSM_DYN_START) || (defined(HAVE_DECL_L2CAP_PSM_DYN_START) && HAVE_DECL_L2CAP_PSM_DYN_START) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((L2CAP_PSM_DYN_START) == (0x1001), "L2CAP_PSM_DYN_START != 0x1001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define L2CAP_PSM_DYN_START 0x1001 +#endif +#if defined(L2CAP_PSM_AUTO_END) || (defined(HAVE_DECL_L2CAP_PSM_AUTO_END) && HAVE_DECL_L2CAP_PSM_AUTO_END) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((L2CAP_PSM_AUTO_END) == (0x10ff), "L2CAP_PSM_AUTO_END != 0x10ff"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define L2CAP_PSM_AUTO_END 0x10ff +#endif +#if defined(L2CAP_PSM_DYN_END) || (defined(HAVE_DECL_L2CAP_PSM_DYN_END) && HAVE_DECL_L2CAP_PSM_DYN_END) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((L2CAP_PSM_DYN_END) == (0xffff), "L2CAP_PSM_DYN_END != 0xffff"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define L2CAP_PSM_DYN_END 0xffff +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat bluetooth_l2_psm in mpers mode + +# else + +static +const struct xlat bluetooth_l2_psm[] = { + + XLAT(L2CAP_PSM_SDP), + XLAT(L2CAP_PSM_RFCOMM), + XLAT(L2CAP_PSM_3DSP), + XLAT(L2CAP_PSM_IPSP), + XLAT(L2CAP_PSM_LE_DYN_START), + XLAT(L2CAP_PSM_LE_DYN_END), + XLAT(L2CAP_PSM_DYN_START), + XLAT(L2CAP_PSM_AUTO_END), + XLAT(L2CAP_PSM_DYN_END), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bluetooth_l2_psm.in b/xlat/bluetooth_l2_psm.in new file mode 100644 index 00000000..afac026a --- /dev/null +++ b/xlat/bluetooth_l2_psm.in @@ -0,0 +1,10 @@ +/* sort -k2,2 */ +L2CAP_PSM_SDP 0x0001 +L2CAP_PSM_RFCOMM 0x0003 +L2CAP_PSM_3DSP 0x0021 +L2CAP_PSM_IPSP 0x0023 +L2CAP_PSM_LE_DYN_START 0x0080 +L2CAP_PSM_LE_DYN_END 0x00ff +L2CAP_PSM_DYN_START 0x1001 +L2CAP_PSM_AUTO_END 0x10ff +L2CAP_PSM_DYN_END 0xffff diff --git a/xlat/bootflags1.h b/xlat/bootflags1.h index fb271408..d868f9c8 100644 --- a/xlat/bootflags1.h +++ b/xlat/bootflags1.h @@ -1,13 +1,23 @@ /* Generated by ./xlat/gen.sh from ./xlat/bootflags1.in; do not edit. */ -#if !(defined(LINUX_REBOOT_MAGIC1) || (defined(HAVE_DECL_LINUX_REBOOT_MAGIC1) && HAVE_DECL_LINUX_REBOOT_MAGIC1)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(LINUX_REBOOT_MAGIC1) || (defined(HAVE_DECL_LINUX_REBOOT_MAGIC1) && HAVE_DECL_LINUX_REBOOT_MAGIC1) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LINUX_REBOOT_MAGIC1) == (0xfee1dead), "LINUX_REBOOT_MAGIC1 != 0xfee1dead"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LINUX_REBOOT_MAGIC1 0xfee1dead #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat bootflags1 in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat bootflags1 in mpers mode + +# else static const struct xlat bootflags1[] = { @@ -15,4 +25,6 @@ const struct xlat bootflags1[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bootflags2.h b/xlat/bootflags2.h index 612aae18..6560af3e 100644 --- a/xlat/bootflags2.h +++ b/xlat/bootflags2.h @@ -1,22 +1,44 @@ /* Generated by ./xlat/gen.sh from ./xlat/bootflags2.in; do not edit. */ -#if !(defined(LINUX_REBOOT_MAGIC2) || (defined(HAVE_DECL_LINUX_REBOOT_MAGIC2) && HAVE_DECL_LINUX_REBOOT_MAGIC2)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(LINUX_REBOOT_MAGIC2) || (defined(HAVE_DECL_LINUX_REBOOT_MAGIC2) && HAVE_DECL_LINUX_REBOOT_MAGIC2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LINUX_REBOOT_MAGIC2) == (672274793), "LINUX_REBOOT_MAGIC2 != 672274793"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LINUX_REBOOT_MAGIC2 672274793 #endif -#if !(defined(LINUX_REBOOT_MAGIC2A) || (defined(HAVE_DECL_LINUX_REBOOT_MAGIC2A) && HAVE_DECL_LINUX_REBOOT_MAGIC2A)) +#if defined(LINUX_REBOOT_MAGIC2A) || (defined(HAVE_DECL_LINUX_REBOOT_MAGIC2A) && HAVE_DECL_LINUX_REBOOT_MAGIC2A) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LINUX_REBOOT_MAGIC2A) == (85072278), "LINUX_REBOOT_MAGIC2A != 85072278"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LINUX_REBOOT_MAGIC2A 85072278 #endif -#if !(defined(LINUX_REBOOT_MAGIC2B) || (defined(HAVE_DECL_LINUX_REBOOT_MAGIC2B) && HAVE_DECL_LINUX_REBOOT_MAGIC2B)) +#if defined(LINUX_REBOOT_MAGIC2B) || (defined(HAVE_DECL_LINUX_REBOOT_MAGIC2B) && HAVE_DECL_LINUX_REBOOT_MAGIC2B) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LINUX_REBOOT_MAGIC2B) == (369367448), "LINUX_REBOOT_MAGIC2B != 369367448"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LINUX_REBOOT_MAGIC2B 369367448 #endif -#if !(defined(LINUX_REBOOT_MAGIC2C) || (defined(HAVE_DECL_LINUX_REBOOT_MAGIC2C) && HAVE_DECL_LINUX_REBOOT_MAGIC2C)) +#if defined(LINUX_REBOOT_MAGIC2C) || (defined(HAVE_DECL_LINUX_REBOOT_MAGIC2C) && HAVE_DECL_LINUX_REBOOT_MAGIC2C) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LINUX_REBOOT_MAGIC2C) == (537993216), "LINUX_REBOOT_MAGIC2C != 537993216"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LINUX_REBOOT_MAGIC2C 537993216 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat bootflags2 in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat bootflags2 in mpers mode + +# else static const struct xlat bootflags2[] = { @@ -27,4 +49,6 @@ const struct xlat bootflags2[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bootflags3.h b/xlat/bootflags3.h index 47ea9cf2..e11a06f6 100644 --- a/xlat/bootflags3.h +++ b/xlat/bootflags3.h @@ -1,34 +1,72 @@ /* Generated by ./xlat/gen.sh from ./xlat/bootflags3.in; do not edit. */ -#if !(defined(LINUX_REBOOT_CMD_RESTART) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_RESTART) && HAVE_DECL_LINUX_REBOOT_CMD_RESTART)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(LINUX_REBOOT_CMD_RESTART) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_RESTART) && HAVE_DECL_LINUX_REBOOT_CMD_RESTART) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LINUX_REBOOT_CMD_RESTART) == (0x01234567), "LINUX_REBOOT_CMD_RESTART != 0x01234567"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LINUX_REBOOT_CMD_RESTART 0x01234567 #endif -#if !(defined(LINUX_REBOOT_CMD_HALT) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_HALT) && HAVE_DECL_LINUX_REBOOT_CMD_HALT)) +#if defined(LINUX_REBOOT_CMD_HALT) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_HALT) && HAVE_DECL_LINUX_REBOOT_CMD_HALT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LINUX_REBOOT_CMD_HALT) == (0xCDEF0123), "LINUX_REBOOT_CMD_HALT != 0xCDEF0123"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LINUX_REBOOT_CMD_HALT 0xCDEF0123 #endif -#if !(defined(LINUX_REBOOT_CMD_CAD_ON) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_CAD_ON) && HAVE_DECL_LINUX_REBOOT_CMD_CAD_ON)) +#if defined(LINUX_REBOOT_CMD_CAD_ON) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_CAD_ON) && HAVE_DECL_LINUX_REBOOT_CMD_CAD_ON) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LINUX_REBOOT_CMD_CAD_ON) == (0x89ABCDEF), "LINUX_REBOOT_CMD_CAD_ON != 0x89ABCDEF"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LINUX_REBOOT_CMD_CAD_ON 0x89ABCDEF #endif -#if !(defined(LINUX_REBOOT_CMD_CAD_OFF) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_CAD_OFF) && HAVE_DECL_LINUX_REBOOT_CMD_CAD_OFF)) +#if defined(LINUX_REBOOT_CMD_CAD_OFF) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_CAD_OFF) && HAVE_DECL_LINUX_REBOOT_CMD_CAD_OFF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LINUX_REBOOT_CMD_CAD_OFF) == (0x00000000), "LINUX_REBOOT_CMD_CAD_OFF != 0x00000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LINUX_REBOOT_CMD_CAD_OFF 0x00000000 #endif -#if !(defined(LINUX_REBOOT_CMD_POWER_OFF) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_POWER_OFF) && HAVE_DECL_LINUX_REBOOT_CMD_POWER_OFF)) +#if defined(LINUX_REBOOT_CMD_POWER_OFF) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_POWER_OFF) && HAVE_DECL_LINUX_REBOOT_CMD_POWER_OFF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LINUX_REBOOT_CMD_POWER_OFF) == (0x4321FEDC), "LINUX_REBOOT_CMD_POWER_OFF != 0x4321FEDC"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LINUX_REBOOT_CMD_POWER_OFF 0x4321FEDC #endif -#if !(defined(LINUX_REBOOT_CMD_RESTART2) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_RESTART2) && HAVE_DECL_LINUX_REBOOT_CMD_RESTART2)) +#if defined(LINUX_REBOOT_CMD_RESTART2) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_RESTART2) && HAVE_DECL_LINUX_REBOOT_CMD_RESTART2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LINUX_REBOOT_CMD_RESTART2) == (0xA1B2C3D4), "LINUX_REBOOT_CMD_RESTART2 != 0xA1B2C3D4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LINUX_REBOOT_CMD_RESTART2 0xA1B2C3D4 #endif -#if !(defined(LINUX_REBOOT_CMD_SW_SUSPEND) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_SW_SUSPEND) && HAVE_DECL_LINUX_REBOOT_CMD_SW_SUSPEND)) +#if defined(LINUX_REBOOT_CMD_SW_SUSPEND) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_SW_SUSPEND) && HAVE_DECL_LINUX_REBOOT_CMD_SW_SUSPEND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LINUX_REBOOT_CMD_SW_SUSPEND) == (0xD000FCE2), "LINUX_REBOOT_CMD_SW_SUSPEND != 0xD000FCE2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LINUX_REBOOT_CMD_SW_SUSPEND 0xD000FCE2 #endif -#if !(defined(LINUX_REBOOT_CMD_KEXEC) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_KEXEC) && HAVE_DECL_LINUX_REBOOT_CMD_KEXEC)) +#if defined(LINUX_REBOOT_CMD_KEXEC) || (defined(HAVE_DECL_LINUX_REBOOT_CMD_KEXEC) && HAVE_DECL_LINUX_REBOOT_CMD_KEXEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LINUX_REBOOT_CMD_KEXEC) == (0x45584543), "LINUX_REBOOT_CMD_KEXEC != 0x45584543"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LINUX_REBOOT_CMD_KEXEC 0x45584543 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat bootflags3 in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat bootflags3 in mpers mode + +# else static const struct xlat bootflags3[] = { @@ -43,4 +81,6 @@ const struct xlat bootflags3[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bpf_attach_flags.h b/xlat/bpf_attach_flags.h new file mode 100644 index 00000000..753d8f16 --- /dev/null +++ b/xlat/bpf_attach_flags.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bpf_attach_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BPF_F_ALLOW_OVERRIDE) || (defined(HAVE_DECL_BPF_F_ALLOW_OVERRIDE) && HAVE_DECL_BPF_F_ALLOW_OVERRIDE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_F_ALLOW_OVERRIDE) == (1), "BPF_F_ALLOW_OVERRIDE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_F_ALLOW_OVERRIDE 1 +#endif +#if defined(BPF_F_ALLOW_MULTI) || (defined(HAVE_DECL_BPF_F_ALLOW_MULTI) && HAVE_DECL_BPF_F_ALLOW_MULTI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_F_ALLOW_MULTI) == (2), "BPF_F_ALLOW_MULTI != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_F_ALLOW_MULTI 2 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat bpf_attach_flags in mpers mode + +# else + +static +const struct xlat bpf_attach_flags[] = { + XLAT(BPF_F_ALLOW_OVERRIDE), + XLAT(BPF_F_ALLOW_MULTI), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bpf_attach_flags.in b/xlat/bpf_attach_flags.in new file mode 100644 index 00000000..a67c02b6 --- /dev/null +++ b/xlat/bpf_attach_flags.in @@ -0,0 +1,2 @@ +BPF_F_ALLOW_OVERRIDE 1 +BPF_F_ALLOW_MULTI 2 diff --git a/xlat/bpf_attach_type.h b/xlat/bpf_attach_type.h index 26745533..d2fe008e 100644 --- a/xlat/bpf_attach_type.h +++ b/xlat/bpf_attach_type.h @@ -1,26 +1,166 @@ /* Generated by ./xlat/gen.sh from ./xlat/bpf_attach_type.in; do not edit. */ -#if !(defined(BPF_CGROUP_INET_INGRESS) || (defined(HAVE_DECL_BPF_CGROUP_INET_INGRESS) && HAVE_DECL_BPF_CGROUP_INET_INGRESS)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BPF_CGROUP_INET_INGRESS) || (defined(HAVE_DECL_BPF_CGROUP_INET_INGRESS) && HAVE_DECL_BPF_CGROUP_INET_INGRESS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_CGROUP_INET_INGRESS) == (0), "BPF_CGROUP_INET_INGRESS != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_CGROUP_INET_INGRESS 0 #endif -#if !(defined(BPF_CGROUP_INET_EGRESS) || (defined(HAVE_DECL_BPF_CGROUP_INET_EGRESS) && HAVE_DECL_BPF_CGROUP_INET_EGRESS)) +#if defined(BPF_CGROUP_INET_EGRESS) || (defined(HAVE_DECL_BPF_CGROUP_INET_EGRESS) && HAVE_DECL_BPF_CGROUP_INET_EGRESS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_CGROUP_INET_EGRESS) == (1), "BPF_CGROUP_INET_EGRESS != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_CGROUP_INET_EGRESS 1 #endif -#if !(defined(BPF_CGROUP_INET_SOCK_CREATE) || (defined(HAVE_DECL_BPF_CGROUP_INET_SOCK_CREATE) && HAVE_DECL_BPF_CGROUP_INET_SOCK_CREATE)) +#if defined(BPF_CGROUP_INET_SOCK_CREATE) || (defined(HAVE_DECL_BPF_CGROUP_INET_SOCK_CREATE) && HAVE_DECL_BPF_CGROUP_INET_SOCK_CREATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_CGROUP_INET_SOCK_CREATE) == (2), "BPF_CGROUP_INET_SOCK_CREATE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_CGROUP_INET_SOCK_CREATE 2 #endif +#if defined(BPF_CGROUP_SOCK_OPS) || (defined(HAVE_DECL_BPF_CGROUP_SOCK_OPS) && HAVE_DECL_BPF_CGROUP_SOCK_OPS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_CGROUP_SOCK_OPS) == (3), "BPF_CGROUP_SOCK_OPS != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_CGROUP_SOCK_OPS 3 +#endif +#if defined(BPF_SK_SKB_STREAM_PARSER) || (defined(HAVE_DECL_BPF_SK_SKB_STREAM_PARSER) && HAVE_DECL_BPF_SK_SKB_STREAM_PARSER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_SK_SKB_STREAM_PARSER) == (4), "BPF_SK_SKB_STREAM_PARSER != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_SK_SKB_STREAM_PARSER 4 +#endif +#if defined(BPF_SK_SKB_STREAM_VERDICT) || (defined(HAVE_DECL_BPF_SK_SKB_STREAM_VERDICT) && HAVE_DECL_BPF_SK_SKB_STREAM_VERDICT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_SK_SKB_STREAM_VERDICT) == (5), "BPF_SK_SKB_STREAM_VERDICT != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_SK_SKB_STREAM_VERDICT 5 +#endif +#if defined(BPF_CGROUP_DEVICE) || (defined(HAVE_DECL_BPF_CGROUP_DEVICE) && HAVE_DECL_BPF_CGROUP_DEVICE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_CGROUP_DEVICE) == (6), "BPF_CGROUP_DEVICE != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_CGROUP_DEVICE 6 +#endif +#if defined(BPF_SK_MSG_VERDICT) || (defined(HAVE_DECL_BPF_SK_MSG_VERDICT) && HAVE_DECL_BPF_SK_MSG_VERDICT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_SK_MSG_VERDICT) == (7), "BPF_SK_MSG_VERDICT != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_SK_MSG_VERDICT 7 +#endif +#if defined(BPF_CGROUP_INET4_BIND) || (defined(HAVE_DECL_BPF_CGROUP_INET4_BIND) && HAVE_DECL_BPF_CGROUP_INET4_BIND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_CGROUP_INET4_BIND) == (8), "BPF_CGROUP_INET4_BIND != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_CGROUP_INET4_BIND 8 +#endif +#if defined(BPF_CGROUP_INET6_BIND) || (defined(HAVE_DECL_BPF_CGROUP_INET6_BIND) && HAVE_DECL_BPF_CGROUP_INET6_BIND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_CGROUP_INET6_BIND) == (9), "BPF_CGROUP_INET6_BIND != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_CGROUP_INET6_BIND 9 +#endif +#if defined(BPF_CGROUP_INET4_CONNECT) || (defined(HAVE_DECL_BPF_CGROUP_INET4_CONNECT) && HAVE_DECL_BPF_CGROUP_INET4_CONNECT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_CGROUP_INET4_CONNECT) == (10), "BPF_CGROUP_INET4_CONNECT != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_CGROUP_INET4_CONNECT 10 +#endif +#if defined(BPF_CGROUP_INET6_CONNECT) || (defined(HAVE_DECL_BPF_CGROUP_INET6_CONNECT) && HAVE_DECL_BPF_CGROUP_INET6_CONNECT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_CGROUP_INET6_CONNECT) == (11), "BPF_CGROUP_INET6_CONNECT != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_CGROUP_INET6_CONNECT 11 +#endif +#if defined(BPF_CGROUP_INET4_POST_BIND) || (defined(HAVE_DECL_BPF_CGROUP_INET4_POST_BIND) && HAVE_DECL_BPF_CGROUP_INET4_POST_BIND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_CGROUP_INET4_POST_BIND) == (12), "BPF_CGROUP_INET4_POST_BIND != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_CGROUP_INET4_POST_BIND 12 +#endif +#if defined(BPF_CGROUP_INET6_POST_BIND) || (defined(HAVE_DECL_BPF_CGROUP_INET6_POST_BIND) && HAVE_DECL_BPF_CGROUP_INET6_POST_BIND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_CGROUP_INET6_POST_BIND) == (13), "BPF_CGROUP_INET6_POST_BIND != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_CGROUP_INET6_POST_BIND 13 +#endif +#if defined(BPF_CGROUP_UDP4_SENDMSG) || (defined(HAVE_DECL_BPF_CGROUP_UDP4_SENDMSG) && HAVE_DECL_BPF_CGROUP_UDP4_SENDMSG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_CGROUP_UDP4_SENDMSG) == (14), "BPF_CGROUP_UDP4_SENDMSG != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_CGROUP_UDP4_SENDMSG 14 +#endif +#if defined(BPF_CGROUP_UDP6_SENDMSG) || (defined(HAVE_DECL_BPF_CGROUP_UDP6_SENDMSG) && HAVE_DECL_BPF_CGROUP_UDP6_SENDMSG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_CGROUP_UDP6_SENDMSG) == (15), "BPF_CGROUP_UDP6_SENDMSG != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_CGROUP_UDP6_SENDMSG 15 +#endif +#if defined(BPF_LIRC_MODE2) || (defined(HAVE_DECL_BPF_LIRC_MODE2) && HAVE_DECL_BPF_LIRC_MODE2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_LIRC_MODE2) == (16), "BPF_LIRC_MODE2 != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_LIRC_MODE2 16 +#endif +#if defined(BPF_FLOW_DISSECTOR) || (defined(HAVE_DECL_BPF_FLOW_DISSECTOR) && HAVE_DECL_BPF_FLOW_DISSECTOR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_FLOW_DISSECTOR) == (17), "BPF_FLOW_DISSECTOR != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_FLOW_DISSECTOR 17 +#endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat bpf_attach_type in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat bpf_attach_type in mpers mode + +# else static const struct xlat bpf_attach_type[] = { - XLAT(BPF_CGROUP_INET_INGRESS), - XLAT(BPF_CGROUP_INET_EGRESS), - XLAT(BPF_CGROUP_INET_SOCK_CREATE), + [BPF_CGROUP_INET_INGRESS] = XLAT(BPF_CGROUP_INET_INGRESS), + [BPF_CGROUP_INET_EGRESS] = XLAT(BPF_CGROUP_INET_EGRESS), + [BPF_CGROUP_INET_SOCK_CREATE] = XLAT(BPF_CGROUP_INET_SOCK_CREATE), + [BPF_CGROUP_SOCK_OPS] = XLAT(BPF_CGROUP_SOCK_OPS), + [BPF_SK_SKB_STREAM_PARSER] = XLAT(BPF_SK_SKB_STREAM_PARSER), + [BPF_SK_SKB_STREAM_VERDICT] = XLAT(BPF_SK_SKB_STREAM_VERDICT), + [BPF_CGROUP_DEVICE] = XLAT(BPF_CGROUP_DEVICE), + [BPF_SK_MSG_VERDICT] = XLAT(BPF_SK_MSG_VERDICT), + [BPF_CGROUP_INET4_BIND] = XLAT(BPF_CGROUP_INET4_BIND), + [BPF_CGROUP_INET6_BIND] = XLAT(BPF_CGROUP_INET6_BIND), + [BPF_CGROUP_INET4_CONNECT] = XLAT(BPF_CGROUP_INET4_CONNECT), + [BPF_CGROUP_INET6_CONNECT] = XLAT(BPF_CGROUP_INET6_CONNECT), + [BPF_CGROUP_INET4_POST_BIND] = XLAT(BPF_CGROUP_INET4_POST_BIND), + [BPF_CGROUP_INET6_POST_BIND] = XLAT(BPF_CGROUP_INET6_POST_BIND), + [BPF_CGROUP_UDP4_SENDMSG] = XLAT(BPF_CGROUP_UDP4_SENDMSG), + [BPF_CGROUP_UDP6_SENDMSG] = XLAT(BPF_CGROUP_UDP6_SENDMSG), + [BPF_LIRC_MODE2] = XLAT(BPF_LIRC_MODE2), + [BPF_FLOW_DISSECTOR] = XLAT(BPF_FLOW_DISSECTOR), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bpf_attach_type.in b/xlat/bpf_attach_type.in index f78bc5be..29a58b81 100644 --- a/xlat/bpf_attach_type.in +++ b/xlat/bpf_attach_type.in @@ -1,3 +1,19 @@ +#value_indexed BPF_CGROUP_INET_INGRESS 0 BPF_CGROUP_INET_EGRESS 1 BPF_CGROUP_INET_SOCK_CREATE 2 +BPF_CGROUP_SOCK_OPS 3 +BPF_SK_SKB_STREAM_PARSER 4 +BPF_SK_SKB_STREAM_VERDICT 5 +BPF_CGROUP_DEVICE 6 +BPF_SK_MSG_VERDICT 7 +BPF_CGROUP_INET4_BIND 8 +BPF_CGROUP_INET6_BIND 9 +BPF_CGROUP_INET4_CONNECT 10 +BPF_CGROUP_INET6_CONNECT 11 +BPF_CGROUP_INET4_POST_BIND 12 +BPF_CGROUP_INET6_POST_BIND 13 +BPF_CGROUP_UDP4_SENDMSG 14 +BPF_CGROUP_UDP6_SENDMSG 15 +BPF_LIRC_MODE2 16 +BPF_FLOW_DISSECTOR 17 diff --git a/xlat/bpf_class.h b/xlat/bpf_class.h index bdabc9a3..a45ebd7f 100644 --- a/xlat/bpf_class.h +++ b/xlat/bpf_class.h @@ -1,38 +1,86 @@ /* Generated by ./xlat/gen.sh from ./xlat/bpf_class.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat bpf_class in mpers mode - -#else - -static -const struct xlat bpf_class[] = { #if defined(BPF_LD) || (defined(HAVE_DECL_BPF_LD) && HAVE_DECL_BPF_LD) - XLAT(BPF_LD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_LD) == (0x0), "BPF_LD != 0x0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_LD 0x0 #endif #if defined(BPF_LDX) || (defined(HAVE_DECL_BPF_LDX) && HAVE_DECL_BPF_LDX) - XLAT(BPF_LDX), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_LDX) == (0x1), "BPF_LDX != 0x1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_LDX 0x1 #endif #if defined(BPF_ST) || (defined(HAVE_DECL_BPF_ST) && HAVE_DECL_BPF_ST) - XLAT(BPF_ST), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_ST) == (0x2), "BPF_ST != 0x2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_ST 0x2 #endif #if defined(BPF_STX) || (defined(HAVE_DECL_BPF_STX) && HAVE_DECL_BPF_STX) - XLAT(BPF_STX), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_STX) == (0x3), "BPF_STX != 0x3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_STX 0x3 #endif #if defined(BPF_ALU) || (defined(HAVE_DECL_BPF_ALU) && HAVE_DECL_BPF_ALU) - XLAT(BPF_ALU), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_ALU) == (0x4), "BPF_ALU != 0x4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_ALU 0x4 #endif #if defined(BPF_JMP) || (defined(HAVE_DECL_BPF_JMP) && HAVE_DECL_BPF_JMP) - XLAT(BPF_JMP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_JMP) == (0x5), "BPF_JMP != 0x5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_JMP 0x5 #endif #if defined(BPF_RET) || (defined(HAVE_DECL_BPF_RET) && HAVE_DECL_BPF_RET) - XLAT(BPF_RET), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_RET) == (0x6), "BPF_RET != 0x6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_RET 0x6 #endif #if defined(BPF_MISC) || (defined(HAVE_DECL_BPF_MISC) && HAVE_DECL_BPF_MISC) - XLAT(BPF_MISC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MISC) == (0x7), "BPF_MISC != 0x7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_MISC 0x7 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat bpf_class in mpers mode + +# else + +static +const struct xlat bpf_class[] = { + [BPF_LD] = XLAT(BPF_LD), + [BPF_LDX] = XLAT(BPF_LDX), + [BPF_ST] = XLAT(BPF_ST), + [BPF_STX] = XLAT(BPF_STX), + [BPF_ALU] = XLAT(BPF_ALU), + [BPF_JMP] = XLAT(BPF_JMP), + [BPF_RET] = XLAT(BPF_RET), + [BPF_MISC] = XLAT(BPF_MISC), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bpf_class.in b/xlat/bpf_class.in index f8bd3d7f..69f6d166 100644 --- a/xlat/bpf_class.in +++ b/xlat/bpf_class.in @@ -1,8 +1,9 @@ -BPF_LD -BPF_LDX -BPF_ST -BPF_STX -BPF_ALU -BPF_JMP -BPF_RET -BPF_MISC +#value_indexed +BPF_LD 0x0 +BPF_LDX 0x1 +BPF_ST 0x2 +BPF_STX 0x3 +BPF_ALU 0x4 +BPF_JMP 0x5 +BPF_RET 0x6 +BPF_MISC 0x7 diff --git a/xlat/bpf_commands.h b/xlat/bpf_commands.h index a498ee35..bd99d5a7 100644 --- a/xlat/bpf_commands.h +++ b/xlat/bpf_commands.h @@ -1,54 +1,198 @@ /* Generated by ./xlat/gen.sh from ./xlat/bpf_commands.in; do not edit. */ -#if !(defined(BPF_MAP_CREATE) || (defined(HAVE_DECL_BPF_MAP_CREATE) && HAVE_DECL_BPF_MAP_CREATE)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BPF_MAP_CREATE) || (defined(HAVE_DECL_BPF_MAP_CREATE) && HAVE_DECL_BPF_MAP_CREATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_CREATE) == (0), "BPF_MAP_CREATE != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_MAP_CREATE 0 #endif -#if !(defined(BPF_MAP_LOOKUP_ELEM) || (defined(HAVE_DECL_BPF_MAP_LOOKUP_ELEM) && HAVE_DECL_BPF_MAP_LOOKUP_ELEM)) +#if defined(BPF_MAP_LOOKUP_ELEM) || (defined(HAVE_DECL_BPF_MAP_LOOKUP_ELEM) && HAVE_DECL_BPF_MAP_LOOKUP_ELEM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_LOOKUP_ELEM) == (1), "BPF_MAP_LOOKUP_ELEM != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_MAP_LOOKUP_ELEM 1 #endif -#if !(defined(BPF_MAP_UPDATE_ELEM) || (defined(HAVE_DECL_BPF_MAP_UPDATE_ELEM) && HAVE_DECL_BPF_MAP_UPDATE_ELEM)) +#if defined(BPF_MAP_UPDATE_ELEM) || (defined(HAVE_DECL_BPF_MAP_UPDATE_ELEM) && HAVE_DECL_BPF_MAP_UPDATE_ELEM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_UPDATE_ELEM) == (2), "BPF_MAP_UPDATE_ELEM != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_MAP_UPDATE_ELEM 2 #endif -#if !(defined(BPF_MAP_DELETE_ELEM) || (defined(HAVE_DECL_BPF_MAP_DELETE_ELEM) && HAVE_DECL_BPF_MAP_DELETE_ELEM)) +#if defined(BPF_MAP_DELETE_ELEM) || (defined(HAVE_DECL_BPF_MAP_DELETE_ELEM) && HAVE_DECL_BPF_MAP_DELETE_ELEM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_DELETE_ELEM) == (3), "BPF_MAP_DELETE_ELEM != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_MAP_DELETE_ELEM 3 #endif -#if !(defined(BPF_MAP_GET_NEXT_KEY) || (defined(HAVE_DECL_BPF_MAP_GET_NEXT_KEY) && HAVE_DECL_BPF_MAP_GET_NEXT_KEY)) +#if defined(BPF_MAP_GET_NEXT_KEY) || (defined(HAVE_DECL_BPF_MAP_GET_NEXT_KEY) && HAVE_DECL_BPF_MAP_GET_NEXT_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_GET_NEXT_KEY) == (4), "BPF_MAP_GET_NEXT_KEY != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_MAP_GET_NEXT_KEY 4 #endif -#if !(defined(BPF_PROG_LOAD) || (defined(HAVE_DECL_BPF_PROG_LOAD) && HAVE_DECL_BPF_PROG_LOAD)) +#if defined(BPF_PROG_LOAD) || (defined(HAVE_DECL_BPF_PROG_LOAD) && HAVE_DECL_BPF_PROG_LOAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_LOAD) == (5), "BPF_PROG_LOAD != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_PROG_LOAD 5 #endif -#if !(defined(BPF_OBJ_PIN) || (defined(HAVE_DECL_BPF_OBJ_PIN) && HAVE_DECL_BPF_OBJ_PIN)) +#if defined(BPF_OBJ_PIN) || (defined(HAVE_DECL_BPF_OBJ_PIN) && HAVE_DECL_BPF_OBJ_PIN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_OBJ_PIN) == (6), "BPF_OBJ_PIN != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_OBJ_PIN 6 #endif -#if !(defined(BPF_OBJ_GET) || (defined(HAVE_DECL_BPF_OBJ_GET) && HAVE_DECL_BPF_OBJ_GET)) +#if defined(BPF_OBJ_GET) || (defined(HAVE_DECL_BPF_OBJ_GET) && HAVE_DECL_BPF_OBJ_GET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_OBJ_GET) == (7), "BPF_OBJ_GET != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_OBJ_GET 7 #endif -#if !(defined(BPF_PROG_ATTACH) || (defined(HAVE_DECL_BPF_PROG_ATTACH) && HAVE_DECL_BPF_PROG_ATTACH)) +#if defined(BPF_PROG_ATTACH) || (defined(HAVE_DECL_BPF_PROG_ATTACH) && HAVE_DECL_BPF_PROG_ATTACH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_ATTACH) == (8), "BPF_PROG_ATTACH != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_PROG_ATTACH 8 #endif -#if !(defined(BPF_PROG_DETACH) || (defined(HAVE_DECL_BPF_PROG_DETACH) && HAVE_DECL_BPF_PROG_DETACH)) +#if defined(BPF_PROG_DETACH) || (defined(HAVE_DECL_BPF_PROG_DETACH) && HAVE_DECL_BPF_PROG_DETACH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_DETACH) == (9), "BPF_PROG_DETACH != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_PROG_DETACH 9 #endif +#if defined(BPF_PROG_TEST_RUN) || (defined(HAVE_DECL_BPF_PROG_TEST_RUN) && HAVE_DECL_BPF_PROG_TEST_RUN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_TEST_RUN) == (10), "BPF_PROG_TEST_RUN != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_PROG_TEST_RUN 10 +#endif +#if defined(BPF_PROG_GET_NEXT_ID) || (defined(HAVE_DECL_BPF_PROG_GET_NEXT_ID) && HAVE_DECL_BPF_PROG_GET_NEXT_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_GET_NEXT_ID) == (11), "BPF_PROG_GET_NEXT_ID != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_PROG_GET_NEXT_ID 11 +#endif +#if defined(BPF_MAP_GET_NEXT_ID) || (defined(HAVE_DECL_BPF_MAP_GET_NEXT_ID) && HAVE_DECL_BPF_MAP_GET_NEXT_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_GET_NEXT_ID) == (12), "BPF_MAP_GET_NEXT_ID != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_MAP_GET_NEXT_ID 12 +#endif +#if defined(BPF_PROG_GET_FD_BY_ID) || (defined(HAVE_DECL_BPF_PROG_GET_FD_BY_ID) && HAVE_DECL_BPF_PROG_GET_FD_BY_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_GET_FD_BY_ID) == (13), "BPF_PROG_GET_FD_BY_ID != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_PROG_GET_FD_BY_ID 13 +#endif +#if defined(BPF_MAP_GET_FD_BY_ID) || (defined(HAVE_DECL_BPF_MAP_GET_FD_BY_ID) && HAVE_DECL_BPF_MAP_GET_FD_BY_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_GET_FD_BY_ID) == (14), "BPF_MAP_GET_FD_BY_ID != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_MAP_GET_FD_BY_ID 14 +#endif +#if defined(BPF_OBJ_GET_INFO_BY_FD) || (defined(HAVE_DECL_BPF_OBJ_GET_INFO_BY_FD) && HAVE_DECL_BPF_OBJ_GET_INFO_BY_FD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_OBJ_GET_INFO_BY_FD) == (15), "BPF_OBJ_GET_INFO_BY_FD != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_OBJ_GET_INFO_BY_FD 15 +#endif +#if defined(BPF_PROG_QUERY) || (defined(HAVE_DECL_BPF_PROG_QUERY) && HAVE_DECL_BPF_PROG_QUERY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_QUERY) == (16), "BPF_PROG_QUERY != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_PROG_QUERY 16 +#endif +#if defined(BPF_RAW_TRACEPOINT_OPEN) || (defined(HAVE_DECL_BPF_RAW_TRACEPOINT_OPEN) && HAVE_DECL_BPF_RAW_TRACEPOINT_OPEN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_RAW_TRACEPOINT_OPEN) == (17), "BPF_RAW_TRACEPOINT_OPEN != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_RAW_TRACEPOINT_OPEN 17 +#endif +#if defined(BPF_BTF_LOAD) || (defined(HAVE_DECL_BPF_BTF_LOAD) && HAVE_DECL_BPF_BTF_LOAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_BTF_LOAD) == (18), "BPF_BTF_LOAD != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_BTF_LOAD 18 +#endif +#if defined(BPF_BTF_GET_FD_BY_ID) || (defined(HAVE_DECL_BPF_BTF_GET_FD_BY_ID) && HAVE_DECL_BPF_BTF_GET_FD_BY_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_BTF_GET_FD_BY_ID) == (19), "BPF_BTF_GET_FD_BY_ID != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_BTF_GET_FD_BY_ID 19 +#endif +#if defined(BPF_TASK_FD_QUERY) || (defined(HAVE_DECL_BPF_TASK_FD_QUERY) && HAVE_DECL_BPF_TASK_FD_QUERY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_TASK_FD_QUERY) == (20), "BPF_TASK_FD_QUERY != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_TASK_FD_QUERY 20 +#endif +#if defined(BPF_MAP_LOOKUP_AND_DELETE_ELEM) || (defined(HAVE_DECL_BPF_MAP_LOOKUP_AND_DELETE_ELEM) && HAVE_DECL_BPF_MAP_LOOKUP_AND_DELETE_ELEM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_LOOKUP_AND_DELETE_ELEM) == (21), "BPF_MAP_LOOKUP_AND_DELETE_ELEM != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_MAP_LOOKUP_AND_DELETE_ELEM 21 +#endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat bpf_commands in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat bpf_commands in mpers mode + +# else static const struct xlat bpf_commands[] = { - XLAT(BPF_MAP_CREATE), - XLAT(BPF_MAP_LOOKUP_ELEM), - XLAT(BPF_MAP_UPDATE_ELEM), - XLAT(BPF_MAP_DELETE_ELEM), - XLAT(BPF_MAP_GET_NEXT_KEY), - XLAT(BPF_PROG_LOAD), - XLAT(BPF_OBJ_PIN), - XLAT(BPF_OBJ_GET), - XLAT(BPF_PROG_ATTACH), - XLAT(BPF_PROG_DETACH), + [BPF_MAP_CREATE] = XLAT(BPF_MAP_CREATE), + [BPF_MAP_LOOKUP_ELEM] = XLAT(BPF_MAP_LOOKUP_ELEM), + [BPF_MAP_UPDATE_ELEM] = XLAT(BPF_MAP_UPDATE_ELEM), + [BPF_MAP_DELETE_ELEM] = XLAT(BPF_MAP_DELETE_ELEM), + [BPF_MAP_GET_NEXT_KEY] = XLAT(BPF_MAP_GET_NEXT_KEY), + [BPF_PROG_LOAD] = XLAT(BPF_PROG_LOAD), + [BPF_OBJ_PIN] = XLAT(BPF_OBJ_PIN), + [BPF_OBJ_GET] = XLAT(BPF_OBJ_GET), + [BPF_PROG_ATTACH] = XLAT(BPF_PROG_ATTACH), + [BPF_PROG_DETACH] = XLAT(BPF_PROG_DETACH), + [BPF_PROG_TEST_RUN] = XLAT(BPF_PROG_TEST_RUN), + [BPF_PROG_GET_NEXT_ID] = XLAT(BPF_PROG_GET_NEXT_ID), + [BPF_MAP_GET_NEXT_ID] = XLAT(BPF_MAP_GET_NEXT_ID), + [BPF_PROG_GET_FD_BY_ID] = XLAT(BPF_PROG_GET_FD_BY_ID), + [BPF_MAP_GET_FD_BY_ID] = XLAT(BPF_MAP_GET_FD_BY_ID), + [BPF_OBJ_GET_INFO_BY_FD] = XLAT(BPF_OBJ_GET_INFO_BY_FD), + [BPF_PROG_QUERY] = XLAT(BPF_PROG_QUERY), + [BPF_RAW_TRACEPOINT_OPEN] = XLAT(BPF_RAW_TRACEPOINT_OPEN), + [BPF_BTF_LOAD] = XLAT(BPF_BTF_LOAD), + [BPF_BTF_GET_FD_BY_ID] = XLAT(BPF_BTF_GET_FD_BY_ID), + [BPF_TASK_FD_QUERY] = XLAT(BPF_TASK_FD_QUERY), + [BPF_MAP_LOOKUP_AND_DELETE_ELEM] = XLAT(BPF_MAP_LOOKUP_AND_DELETE_ELEM), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bpf_commands.in b/xlat/bpf_commands.in index bcec9a5d..6dff998d 100644 --- a/xlat/bpf_commands.in +++ b/xlat/bpf_commands.in @@ -1,3 +1,4 @@ +#value_indexed BPF_MAP_CREATE 0 BPF_MAP_LOOKUP_ELEM 1 BPF_MAP_UPDATE_ELEM 2 @@ -8,3 +9,15 @@ BPF_OBJ_PIN 6 BPF_OBJ_GET 7 BPF_PROG_ATTACH 8 BPF_PROG_DETACH 9 +BPF_PROG_TEST_RUN 10 +BPF_PROG_GET_NEXT_ID 11 +BPF_MAP_GET_NEXT_ID 12 +BPF_PROG_GET_FD_BY_ID 13 +BPF_MAP_GET_FD_BY_ID 14 +BPF_OBJ_GET_INFO_BY_FD 15 +BPF_PROG_QUERY 16 +BPF_RAW_TRACEPOINT_OPEN 17 +BPF_BTF_LOAD 18 +BPF_BTF_GET_FD_BY_ID 19 +BPF_TASK_FD_QUERY 20 +BPF_MAP_LOOKUP_AND_DELETE_ELEM 21 diff --git a/xlat/bpf_file_mode_flags.h b/xlat/bpf_file_mode_flags.h new file mode 100644 index 00000000..3a6baf54 --- /dev/null +++ b/xlat/bpf_file_mode_flags.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bpf_file_mode_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BPF_F_RDONLY) || (defined(HAVE_DECL_BPF_F_RDONLY) && HAVE_DECL_BPF_F_RDONLY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_F_RDONLY) == ((1U << 3)), "BPF_F_RDONLY != (1U << 3)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_F_RDONLY (1U << 3) +#endif +#if defined(BPF_F_WRONLY) || (defined(HAVE_DECL_BPF_F_WRONLY) && HAVE_DECL_BPF_F_WRONLY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_F_WRONLY) == ((1U << 4)), "BPF_F_WRONLY != (1U << 4)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_F_WRONLY (1U << 4) +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat bpf_file_mode_flags in mpers mode + +# else + +static +const struct xlat bpf_file_mode_flags[] = { + XLAT(BPF_F_RDONLY), + XLAT(BPF_F_WRONLY), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bpf_file_mode_flags.in b/xlat/bpf_file_mode_flags.in new file mode 100644 index 00000000..c345891a --- /dev/null +++ b/xlat/bpf_file_mode_flags.in @@ -0,0 +1,2 @@ +BPF_F_RDONLY (1U << 3) +BPF_F_WRONLY (1U << 4) diff --git a/xlat/bpf_map_flags.h b/xlat/bpf_map_flags.h new file mode 100644 index 00000000..dcfd0fc0 --- /dev/null +++ b/xlat/bpf_map_flags.h @@ -0,0 +1,78 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bpf_map_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BPF_F_NO_PREALLOC) || (defined(HAVE_DECL_BPF_F_NO_PREALLOC) && HAVE_DECL_BPF_F_NO_PREALLOC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_F_NO_PREALLOC) == (1U), "BPF_F_NO_PREALLOC != 1U"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_F_NO_PREALLOC 1U +#endif +#if defined(BPF_F_NO_COMMON_LRU) || (defined(HAVE_DECL_BPF_F_NO_COMMON_LRU) && HAVE_DECL_BPF_F_NO_COMMON_LRU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_F_NO_COMMON_LRU) == ((1U << 1)), "BPF_F_NO_COMMON_LRU != (1U << 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_F_NO_COMMON_LRU (1U << 1) +#endif +#if defined(BPF_F_NUMA_NODE) || (defined(HAVE_DECL_BPF_F_NUMA_NODE) && HAVE_DECL_BPF_F_NUMA_NODE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_F_NUMA_NODE) == ((1U << 2)), "BPF_F_NUMA_NODE != (1U << 2)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_F_NUMA_NODE (1U << 2) +#endif +#if defined(BPF_F_RDONLY) || (defined(HAVE_DECL_BPF_F_RDONLY) && HAVE_DECL_BPF_F_RDONLY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_F_RDONLY) == ((1U << 3)), "BPF_F_RDONLY != (1U << 3)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_F_RDONLY (1U << 3) +#endif +#if defined(BPF_F_WRONLY) || (defined(HAVE_DECL_BPF_F_WRONLY) && HAVE_DECL_BPF_F_WRONLY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_F_WRONLY) == ((1U << 4)), "BPF_F_WRONLY != (1U << 4)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_F_WRONLY (1U << 4) +#endif +#if defined(BPF_F_STACK_BUILD_ID) || (defined(HAVE_DECL_BPF_F_STACK_BUILD_ID) && HAVE_DECL_BPF_F_STACK_BUILD_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_F_STACK_BUILD_ID) == ((1U << 5)), "BPF_F_STACK_BUILD_ID != (1U << 5)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_F_STACK_BUILD_ID (1U << 5) +#endif +#if defined(BPF_F_ZERO_SEED) || (defined(HAVE_DECL_BPF_F_ZERO_SEED) && HAVE_DECL_BPF_F_ZERO_SEED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_F_ZERO_SEED) == ((1U << 6)), "BPF_F_ZERO_SEED != (1U << 6)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_F_ZERO_SEED (1U << 6) +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat bpf_map_flags in mpers mode + +# else + +static +const struct xlat bpf_map_flags[] = { + XLAT(BPF_F_NO_PREALLOC), + XLAT(BPF_F_NO_COMMON_LRU), + XLAT(BPF_F_NUMA_NODE), + XLAT(BPF_F_RDONLY), + XLAT(BPF_F_WRONLY), + XLAT(BPF_F_STACK_BUILD_ID), + XLAT(BPF_F_ZERO_SEED), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bpf_map_flags.in b/xlat/bpf_map_flags.in new file mode 100644 index 00000000..a2790db6 --- /dev/null +++ b/xlat/bpf_map_flags.in @@ -0,0 +1,7 @@ +BPF_F_NO_PREALLOC 1U +BPF_F_NO_COMMON_LRU (1U << 1) +BPF_F_NUMA_NODE (1U << 2) +BPF_F_RDONLY (1U << 3) +BPF_F_WRONLY (1U << 4) +BPF_F_STACK_BUILD_ID (1U << 5) +BPF_F_ZERO_SEED (1U << 6) diff --git a/xlat/bpf_map_types.h b/xlat/bpf_map_types.h index 2544c89c..a6b4a3b3 100644 --- a/xlat/bpf_map_types.h +++ b/xlat/bpf_map_types.h @@ -1,62 +1,214 @@ /* Generated by ./xlat/gen.sh from ./xlat/bpf_map_types.in; do not edit. */ -#if !(defined(BPF_MAP_TYPE_UNSPEC) || (defined(HAVE_DECL_BPF_MAP_TYPE_UNSPEC) && HAVE_DECL_BPF_MAP_TYPE_UNSPEC)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BPF_MAP_TYPE_UNSPEC) || (defined(HAVE_DECL_BPF_MAP_TYPE_UNSPEC) && HAVE_DECL_BPF_MAP_TYPE_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_UNSPEC) == (0), "BPF_MAP_TYPE_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_MAP_TYPE_UNSPEC 0 #endif -#if !(defined(BPF_MAP_TYPE_HASH) || (defined(HAVE_DECL_BPF_MAP_TYPE_HASH) && HAVE_DECL_BPF_MAP_TYPE_HASH)) +#if defined(BPF_MAP_TYPE_HASH) || (defined(HAVE_DECL_BPF_MAP_TYPE_HASH) && HAVE_DECL_BPF_MAP_TYPE_HASH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_HASH) == (1), "BPF_MAP_TYPE_HASH != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_MAP_TYPE_HASH 1 #endif -#if !(defined(BPF_MAP_TYPE_ARRAY) || (defined(HAVE_DECL_BPF_MAP_TYPE_ARRAY) && HAVE_DECL_BPF_MAP_TYPE_ARRAY)) +#if defined(BPF_MAP_TYPE_ARRAY) || (defined(HAVE_DECL_BPF_MAP_TYPE_ARRAY) && HAVE_DECL_BPF_MAP_TYPE_ARRAY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_ARRAY) == (2), "BPF_MAP_TYPE_ARRAY != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_MAP_TYPE_ARRAY 2 #endif -#if !(defined(BPF_MAP_TYPE_PROG_ARRAY) || (defined(HAVE_DECL_BPF_MAP_TYPE_PROG_ARRAY) && HAVE_DECL_BPF_MAP_TYPE_PROG_ARRAY)) +#if defined(BPF_MAP_TYPE_PROG_ARRAY) || (defined(HAVE_DECL_BPF_MAP_TYPE_PROG_ARRAY) && HAVE_DECL_BPF_MAP_TYPE_PROG_ARRAY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_PROG_ARRAY) == (3), "BPF_MAP_TYPE_PROG_ARRAY != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_MAP_TYPE_PROG_ARRAY 3 #endif -#if !(defined(BPF_MAP_TYPE_PERF_EVENT_ARRAY) || (defined(HAVE_DECL_BPF_MAP_TYPE_PERF_EVENT_ARRAY) && HAVE_DECL_BPF_MAP_TYPE_PERF_EVENT_ARRAY)) +#if defined(BPF_MAP_TYPE_PERF_EVENT_ARRAY) || (defined(HAVE_DECL_BPF_MAP_TYPE_PERF_EVENT_ARRAY) && HAVE_DECL_BPF_MAP_TYPE_PERF_EVENT_ARRAY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_PERF_EVENT_ARRAY) == (4), "BPF_MAP_TYPE_PERF_EVENT_ARRAY != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_MAP_TYPE_PERF_EVENT_ARRAY 4 #endif -#if !(defined(BPF_MAP_TYPE_PERCPU_HASH) || (defined(HAVE_DECL_BPF_MAP_TYPE_PERCPU_HASH) && HAVE_DECL_BPF_MAP_TYPE_PERCPU_HASH)) +#if defined(BPF_MAP_TYPE_PERCPU_HASH) || (defined(HAVE_DECL_BPF_MAP_TYPE_PERCPU_HASH) && HAVE_DECL_BPF_MAP_TYPE_PERCPU_HASH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_PERCPU_HASH) == (5), "BPF_MAP_TYPE_PERCPU_HASH != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_MAP_TYPE_PERCPU_HASH 5 #endif -#if !(defined(BPF_MAP_TYPE_PERCPU_ARRAY) || (defined(HAVE_DECL_BPF_MAP_TYPE_PERCPU_ARRAY) && HAVE_DECL_BPF_MAP_TYPE_PERCPU_ARRAY)) +#if defined(BPF_MAP_TYPE_PERCPU_ARRAY) || (defined(HAVE_DECL_BPF_MAP_TYPE_PERCPU_ARRAY) && HAVE_DECL_BPF_MAP_TYPE_PERCPU_ARRAY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_PERCPU_ARRAY) == (6), "BPF_MAP_TYPE_PERCPU_ARRAY != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_MAP_TYPE_PERCPU_ARRAY 6 #endif -#if !(defined(BPF_MAP_TYPE_STACK_TRACE) || (defined(HAVE_DECL_BPF_MAP_TYPE_STACK_TRACE) && HAVE_DECL_BPF_MAP_TYPE_STACK_TRACE)) +#if defined(BPF_MAP_TYPE_STACK_TRACE) || (defined(HAVE_DECL_BPF_MAP_TYPE_STACK_TRACE) && HAVE_DECL_BPF_MAP_TYPE_STACK_TRACE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_STACK_TRACE) == (7), "BPF_MAP_TYPE_STACK_TRACE != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_MAP_TYPE_STACK_TRACE 7 #endif -#if !(defined(BPF_MAP_TYPE_CGROUP_ARRAY) || (defined(HAVE_DECL_BPF_MAP_TYPE_CGROUP_ARRAY) && HAVE_DECL_BPF_MAP_TYPE_CGROUP_ARRAY)) +#if defined(BPF_MAP_TYPE_CGROUP_ARRAY) || (defined(HAVE_DECL_BPF_MAP_TYPE_CGROUP_ARRAY) && HAVE_DECL_BPF_MAP_TYPE_CGROUP_ARRAY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_CGROUP_ARRAY) == (8), "BPF_MAP_TYPE_CGROUP_ARRAY != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_MAP_TYPE_CGROUP_ARRAY 8 #endif -#if !(defined(BPF_MAP_TYPE_LRU_HASH) || (defined(HAVE_DECL_BPF_MAP_TYPE_LRU_HASH) && HAVE_DECL_BPF_MAP_TYPE_LRU_HASH)) +#if defined(BPF_MAP_TYPE_LRU_HASH) || (defined(HAVE_DECL_BPF_MAP_TYPE_LRU_HASH) && HAVE_DECL_BPF_MAP_TYPE_LRU_HASH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_LRU_HASH) == (9), "BPF_MAP_TYPE_LRU_HASH != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_MAP_TYPE_LRU_HASH 9 #endif -#if !(defined(BPF_MAP_TYPE_LRU_PERCPU_HASH) || (defined(HAVE_DECL_BPF_MAP_TYPE_LRU_PERCPU_HASH) && HAVE_DECL_BPF_MAP_TYPE_LRU_PERCPU_HASH)) +#if defined(BPF_MAP_TYPE_LRU_PERCPU_HASH) || (defined(HAVE_DECL_BPF_MAP_TYPE_LRU_PERCPU_HASH) && HAVE_DECL_BPF_MAP_TYPE_LRU_PERCPU_HASH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_LRU_PERCPU_HASH) == (10), "BPF_MAP_TYPE_LRU_PERCPU_HASH != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_MAP_TYPE_LRU_PERCPU_HASH 10 #endif -#if !(defined(BPF_MAP_TYPE_LPM_TRIE) || (defined(HAVE_DECL_BPF_MAP_TYPE_LPM_TRIE) && HAVE_DECL_BPF_MAP_TYPE_LPM_TRIE)) +#if defined(BPF_MAP_TYPE_LPM_TRIE) || (defined(HAVE_DECL_BPF_MAP_TYPE_LPM_TRIE) && HAVE_DECL_BPF_MAP_TYPE_LPM_TRIE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_LPM_TRIE) == (11), "BPF_MAP_TYPE_LPM_TRIE != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_MAP_TYPE_LPM_TRIE 11 #endif +#if defined(BPF_MAP_TYPE_ARRAY_OF_MAPS) || (defined(HAVE_DECL_BPF_MAP_TYPE_ARRAY_OF_MAPS) && HAVE_DECL_BPF_MAP_TYPE_ARRAY_OF_MAPS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_ARRAY_OF_MAPS) == (12), "BPF_MAP_TYPE_ARRAY_OF_MAPS != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_MAP_TYPE_ARRAY_OF_MAPS 12 +#endif +#if defined(BPF_MAP_TYPE_HASH_OF_MAPS) || (defined(HAVE_DECL_BPF_MAP_TYPE_HASH_OF_MAPS) && HAVE_DECL_BPF_MAP_TYPE_HASH_OF_MAPS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_HASH_OF_MAPS) == (13), "BPF_MAP_TYPE_HASH_OF_MAPS != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_MAP_TYPE_HASH_OF_MAPS 13 +#endif +#if defined(BPF_MAP_TYPE_DEVMAP) || (defined(HAVE_DECL_BPF_MAP_TYPE_DEVMAP) && HAVE_DECL_BPF_MAP_TYPE_DEVMAP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_DEVMAP) == (14), "BPF_MAP_TYPE_DEVMAP != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_MAP_TYPE_DEVMAP 14 +#endif +#if defined(BPF_MAP_TYPE_SOCKMAP) || (defined(HAVE_DECL_BPF_MAP_TYPE_SOCKMAP) && HAVE_DECL_BPF_MAP_TYPE_SOCKMAP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_SOCKMAP) == (15), "BPF_MAP_TYPE_SOCKMAP != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_MAP_TYPE_SOCKMAP 15 +#endif +#if defined(BPF_MAP_TYPE_CPUMAP) || (defined(HAVE_DECL_BPF_MAP_TYPE_CPUMAP) && HAVE_DECL_BPF_MAP_TYPE_CPUMAP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_CPUMAP) == (16), "BPF_MAP_TYPE_CPUMAP != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_MAP_TYPE_CPUMAP 16 +#endif +#if defined(BPF_MAP_TYPE_XSKMAP) || (defined(HAVE_DECL_BPF_MAP_TYPE_XSKMAP) && HAVE_DECL_BPF_MAP_TYPE_XSKMAP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_XSKMAP) == (17), "BPF_MAP_TYPE_XSKMAP != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_MAP_TYPE_XSKMAP 17 +#endif +#if defined(BPF_MAP_TYPE_SOCKHASH) || (defined(HAVE_DECL_BPF_MAP_TYPE_SOCKHASH) && HAVE_DECL_BPF_MAP_TYPE_SOCKHASH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_SOCKHASH) == (18), "BPF_MAP_TYPE_SOCKHASH != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_MAP_TYPE_SOCKHASH 18 +#endif +#if defined(BPF_MAP_TYPE_CGROUP_STORAGE) || (defined(HAVE_DECL_BPF_MAP_TYPE_CGROUP_STORAGE) && HAVE_DECL_BPF_MAP_TYPE_CGROUP_STORAGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_CGROUP_STORAGE) == (19), "BPF_MAP_TYPE_CGROUP_STORAGE != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_MAP_TYPE_CGROUP_STORAGE 19 +#endif +#if defined(BPF_MAP_TYPE_REUSEPORT_SOCKARRAY) || (defined(HAVE_DECL_BPF_MAP_TYPE_REUSEPORT_SOCKARRAY) && HAVE_DECL_BPF_MAP_TYPE_REUSEPORT_SOCKARRAY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_REUSEPORT_SOCKARRAY) == (20), "BPF_MAP_TYPE_REUSEPORT_SOCKARRAY != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_MAP_TYPE_REUSEPORT_SOCKARRAY 20 +#endif +#if defined(BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE) || (defined(HAVE_DECL_BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE) && HAVE_DECL_BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE) == (21), "BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE 21 +#endif +#if defined(BPF_MAP_TYPE_QUEUE) || (defined(HAVE_DECL_BPF_MAP_TYPE_QUEUE) && HAVE_DECL_BPF_MAP_TYPE_QUEUE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_QUEUE) == (22), "BPF_MAP_TYPE_QUEUE != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_MAP_TYPE_QUEUE 22 +#endif +#if defined(BPF_MAP_TYPE_STACK) || (defined(HAVE_DECL_BPF_MAP_TYPE_STACK) && HAVE_DECL_BPF_MAP_TYPE_STACK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MAP_TYPE_STACK) == (23), "BPF_MAP_TYPE_STACK != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_MAP_TYPE_STACK 23 +#endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat bpf_map_types in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat bpf_map_types in mpers mode + +# else static const struct xlat bpf_map_types[] = { - XLAT(BPF_MAP_TYPE_UNSPEC), - XLAT(BPF_MAP_TYPE_HASH), - XLAT(BPF_MAP_TYPE_ARRAY), - XLAT(BPF_MAP_TYPE_PROG_ARRAY), - XLAT(BPF_MAP_TYPE_PERF_EVENT_ARRAY), - XLAT(BPF_MAP_TYPE_PERCPU_HASH), - XLAT(BPF_MAP_TYPE_PERCPU_ARRAY), - XLAT(BPF_MAP_TYPE_STACK_TRACE), - XLAT(BPF_MAP_TYPE_CGROUP_ARRAY), - XLAT(BPF_MAP_TYPE_LRU_HASH), - XLAT(BPF_MAP_TYPE_LRU_PERCPU_HASH), - XLAT(BPF_MAP_TYPE_LPM_TRIE), + [BPF_MAP_TYPE_UNSPEC] = XLAT(BPF_MAP_TYPE_UNSPEC), + [BPF_MAP_TYPE_HASH] = XLAT(BPF_MAP_TYPE_HASH), + [BPF_MAP_TYPE_ARRAY] = XLAT(BPF_MAP_TYPE_ARRAY), + [BPF_MAP_TYPE_PROG_ARRAY] = XLAT(BPF_MAP_TYPE_PROG_ARRAY), + [BPF_MAP_TYPE_PERF_EVENT_ARRAY] = XLAT(BPF_MAP_TYPE_PERF_EVENT_ARRAY), + [BPF_MAP_TYPE_PERCPU_HASH] = XLAT(BPF_MAP_TYPE_PERCPU_HASH), + [BPF_MAP_TYPE_PERCPU_ARRAY] = XLAT(BPF_MAP_TYPE_PERCPU_ARRAY), + [BPF_MAP_TYPE_STACK_TRACE] = XLAT(BPF_MAP_TYPE_STACK_TRACE), + [BPF_MAP_TYPE_CGROUP_ARRAY] = XLAT(BPF_MAP_TYPE_CGROUP_ARRAY), + [BPF_MAP_TYPE_LRU_HASH] = XLAT(BPF_MAP_TYPE_LRU_HASH), + [BPF_MAP_TYPE_LRU_PERCPU_HASH] = XLAT(BPF_MAP_TYPE_LRU_PERCPU_HASH), + [BPF_MAP_TYPE_LPM_TRIE] = XLAT(BPF_MAP_TYPE_LPM_TRIE), + [BPF_MAP_TYPE_ARRAY_OF_MAPS] = XLAT(BPF_MAP_TYPE_ARRAY_OF_MAPS), + [BPF_MAP_TYPE_HASH_OF_MAPS] = XLAT(BPF_MAP_TYPE_HASH_OF_MAPS), + [BPF_MAP_TYPE_DEVMAP] = XLAT(BPF_MAP_TYPE_DEVMAP), + [BPF_MAP_TYPE_SOCKMAP] = XLAT(BPF_MAP_TYPE_SOCKMAP), + [BPF_MAP_TYPE_CPUMAP] = XLAT(BPF_MAP_TYPE_CPUMAP), + [BPF_MAP_TYPE_XSKMAP] = XLAT(BPF_MAP_TYPE_XSKMAP), + [BPF_MAP_TYPE_SOCKHASH] = XLAT(BPF_MAP_TYPE_SOCKHASH), + [BPF_MAP_TYPE_CGROUP_STORAGE] = XLAT(BPF_MAP_TYPE_CGROUP_STORAGE), + [BPF_MAP_TYPE_REUSEPORT_SOCKARRAY] = XLAT(BPF_MAP_TYPE_REUSEPORT_SOCKARRAY), + [BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE] = XLAT(BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE), + [BPF_MAP_TYPE_QUEUE] = XLAT(BPF_MAP_TYPE_QUEUE), + [BPF_MAP_TYPE_STACK] = XLAT(BPF_MAP_TYPE_STACK), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bpf_map_types.in b/xlat/bpf_map_types.in index e3222d38..8a67d3ed 100644 --- a/xlat/bpf_map_types.in +++ b/xlat/bpf_map_types.in @@ -1,3 +1,4 @@ +#value_indexed BPF_MAP_TYPE_UNSPEC 0 BPF_MAP_TYPE_HASH 1 BPF_MAP_TYPE_ARRAY 2 @@ -10,3 +11,15 @@ BPF_MAP_TYPE_CGROUP_ARRAY 8 BPF_MAP_TYPE_LRU_HASH 9 BPF_MAP_TYPE_LRU_PERCPU_HASH 10 BPF_MAP_TYPE_LPM_TRIE 11 +BPF_MAP_TYPE_ARRAY_OF_MAPS 12 +BPF_MAP_TYPE_HASH_OF_MAPS 13 +BPF_MAP_TYPE_DEVMAP 14 +BPF_MAP_TYPE_SOCKMAP 15 +BPF_MAP_TYPE_CPUMAP 16 +BPF_MAP_TYPE_XSKMAP 17 +BPF_MAP_TYPE_SOCKHASH 18 +BPF_MAP_TYPE_CGROUP_STORAGE 19 +BPF_MAP_TYPE_REUSEPORT_SOCKARRAY 20 +BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE 21 +BPF_MAP_TYPE_QUEUE 22 +BPF_MAP_TYPE_STACK 23 diff --git a/xlat/bpf_map_update_elem_flags.h b/xlat/bpf_map_update_elem_flags.h index 038863e6..9d60ac40 100644 --- a/xlat/bpf_map_update_elem_flags.h +++ b/xlat/bpf_map_update_elem_flags.h @@ -1,26 +1,54 @@ /* Generated by ./xlat/gen.sh from ./xlat/bpf_map_update_elem_flags.in; do not edit. */ -#if !(defined(BPF_ANY) || (defined(HAVE_DECL_BPF_ANY) && HAVE_DECL_BPF_ANY)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BPF_ANY) || (defined(HAVE_DECL_BPF_ANY) && HAVE_DECL_BPF_ANY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_ANY) == (0), "BPF_ANY != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_ANY 0 #endif -#if !(defined(BPF_NOEXIST) || (defined(HAVE_DECL_BPF_NOEXIST) && HAVE_DECL_BPF_NOEXIST)) +#if defined(BPF_NOEXIST) || (defined(HAVE_DECL_BPF_NOEXIST) && HAVE_DECL_BPF_NOEXIST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_NOEXIST) == (1), "BPF_NOEXIST != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_NOEXIST 1 #endif -#if !(defined(BPF_EXIST) || (defined(HAVE_DECL_BPF_EXIST) && HAVE_DECL_BPF_EXIST)) +#if defined(BPF_EXIST) || (defined(HAVE_DECL_BPF_EXIST) && HAVE_DECL_BPF_EXIST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_EXIST) == (2), "BPF_EXIST != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_EXIST 2 #endif +#if defined(BPF_F_LOCK) || (defined(HAVE_DECL_BPF_F_LOCK) && HAVE_DECL_BPF_F_LOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_F_LOCK) == (4), "BPF_F_LOCK != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_F_LOCK 4 +#endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat bpf_map_update_elem_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat bpf_map_update_elem_flags in mpers mode + +# else static const struct xlat bpf_map_update_elem_flags[] = { - XLAT(BPF_ANY), - XLAT(BPF_NOEXIST), - XLAT(BPF_EXIST), + [BPF_ANY] = XLAT(BPF_ANY), + [BPF_NOEXIST] = XLAT(BPF_NOEXIST), + [BPF_EXIST] = XLAT(BPF_EXIST), + [BPF_F_LOCK] = XLAT(BPF_F_LOCK), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bpf_map_update_elem_flags.in b/xlat/bpf_map_update_elem_flags.in index 6b1d61fc..03f362cb 100644 --- a/xlat/bpf_map_update_elem_flags.in +++ b/xlat/bpf_map_update_elem_flags.in @@ -1,3 +1,5 @@ +#value_indexed BPF_ANY 0 BPF_NOEXIST 1 BPF_EXIST 2 +BPF_F_LOCK 4 diff --git a/xlat/bpf_miscop.h b/xlat/bpf_miscop.h index bedf35b6..3a930e65 100644 --- a/xlat/bpf_miscop.h +++ b/xlat/bpf_miscop.h @@ -1,20 +1,38 @@ /* Generated by ./xlat/gen.sh from ./xlat/bpf_miscop.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat bpf_miscop in mpers mode - -#else - -static -const struct xlat bpf_miscop[] = { #if defined(BPF_TAX) || (defined(HAVE_DECL_BPF_TAX) && HAVE_DECL_BPF_TAX) - XLAT(BPF_TAX), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_TAX) == (0x00), "BPF_TAX != 0x00"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_TAX 0x00 #endif #if defined(BPF_TXA) || (defined(HAVE_DECL_BPF_TXA) && HAVE_DECL_BPF_TXA) - XLAT(BPF_TXA), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_TXA) == (0x80), "BPF_TXA != 0x80"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_TXA 0x80 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat bpf_miscop in mpers mode + +# else + +static +const struct xlat bpf_miscop[] = { + XLAT(BPF_TAX), + XLAT(BPF_TXA), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bpf_miscop.in b/xlat/bpf_miscop.in index c9703b1d..6df47b3a 100644 --- a/xlat/bpf_miscop.in +++ b/xlat/bpf_miscop.in @@ -1,2 +1,2 @@ -BPF_TAX -BPF_TXA +BPF_TAX 0x00 +BPF_TXA 0x80 diff --git a/xlat/bpf_mode.h b/xlat/bpf_mode.h index 0e3c862e..5cb73d6b 100644 --- a/xlat/bpf_mode.h +++ b/xlat/bpf_mode.h @@ -1,35 +1,78 @@ /* Generated by ./xlat/gen.sh from ./xlat/bpf_mode.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat bpf_mode in mpers mode - -#else - -static -const struct xlat bpf_mode[] = { #if defined(BPF_IMM) || (defined(HAVE_DECL_BPF_IMM) && HAVE_DECL_BPF_IMM) - XLAT(BPF_IMM), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_IMM) == (0x00), "BPF_IMM != 0x00"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_IMM 0x00 #endif #if defined(BPF_ABS) || (defined(HAVE_DECL_BPF_ABS) && HAVE_DECL_BPF_ABS) - XLAT(BPF_ABS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_ABS) == (0x20), "BPF_ABS != 0x20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_ABS 0x20 #endif #if defined(BPF_IND) || (defined(HAVE_DECL_BPF_IND) && HAVE_DECL_BPF_IND) - XLAT(BPF_IND), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_IND) == (0x40), "BPF_IND != 0x40"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_IND 0x40 #endif #if defined(BPF_MEM) || (defined(HAVE_DECL_BPF_MEM) && HAVE_DECL_BPF_MEM) - XLAT(BPF_MEM), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MEM) == (0x60), "BPF_MEM != 0x60"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_MEM 0x60 #endif #if defined(BPF_LEN) || (defined(HAVE_DECL_BPF_LEN) && HAVE_DECL_BPF_LEN) - XLAT(BPF_LEN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_LEN) == (0x80), "BPF_LEN != 0x80"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_LEN 0x80 #endif #if defined(BPF_MSH) || (defined(HAVE_DECL_BPF_MSH) && HAVE_DECL_BPF_MSH) - XLAT(BPF_MSH), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MSH) == (0xa0), "BPF_MSH != 0xa0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_MSH 0xa0 #endif #if defined(BPF_XADD) || (defined(HAVE_DECL_BPF_XADD) && HAVE_DECL_BPF_XADD) - XLAT(BPF_XADD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_XADD) == (0xc0), "BPF_XADD != 0xc0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_XADD 0xc0 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat bpf_mode in mpers mode + +# else + +static +const struct xlat bpf_mode[] = { + XLAT(BPF_IMM), + XLAT(BPF_ABS), + XLAT(BPF_IND), + XLAT(BPF_MEM), + XLAT(BPF_LEN), + XLAT(BPF_MSH), + XLAT(BPF_XADD), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bpf_mode.in b/xlat/bpf_mode.in index 10adecdd..a412c0ed 100644 --- a/xlat/bpf_mode.in +++ b/xlat/bpf_mode.in @@ -1,7 +1,7 @@ -BPF_IMM -BPF_ABS -BPF_IND -BPF_MEM -BPF_LEN -BPF_MSH -BPF_XADD +BPF_IMM 0x00 +BPF_ABS 0x20 +BPF_IND 0x40 +BPF_MEM 0x60 +BPF_LEN 0x80 +BPF_MSH 0xa0 +BPF_XADD 0xc0 diff --git a/xlat/bpf_op_alu.h b/xlat/bpf_op_alu.h index d20a8c76..96be4230 100644 --- a/xlat/bpf_op_alu.h +++ b/xlat/bpf_op_alu.h @@ -1,53 +1,134 @@ /* Generated by ./xlat/gen.sh from ./xlat/bpf_op_alu.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat bpf_op_alu in mpers mode - -#else - -static -const struct xlat bpf_op_alu[] = { #if defined(BPF_ADD) || (defined(HAVE_DECL_BPF_ADD) && HAVE_DECL_BPF_ADD) - XLAT(BPF_ADD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_ADD) == (0x00), "BPF_ADD != 0x00"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_ADD 0x00 #endif #if defined(BPF_SUB) || (defined(HAVE_DECL_BPF_SUB) && HAVE_DECL_BPF_SUB) - XLAT(BPF_SUB), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_SUB) == (0x10), "BPF_SUB != 0x10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_SUB 0x10 #endif #if defined(BPF_MUL) || (defined(HAVE_DECL_BPF_MUL) && HAVE_DECL_BPF_MUL) - XLAT(BPF_MUL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MUL) == (0x20), "BPF_MUL != 0x20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_MUL 0x20 #endif #if defined(BPF_DIV) || (defined(HAVE_DECL_BPF_DIV) && HAVE_DECL_BPF_DIV) - XLAT(BPF_DIV), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_DIV) == (0x30), "BPF_DIV != 0x30"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_DIV 0x30 #endif #if defined(BPF_OR) || (defined(HAVE_DECL_BPF_OR) && HAVE_DECL_BPF_OR) - XLAT(BPF_OR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_OR) == (0x40), "BPF_OR != 0x40"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_OR 0x40 #endif #if defined(BPF_AND) || (defined(HAVE_DECL_BPF_AND) && HAVE_DECL_BPF_AND) - XLAT(BPF_AND), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_AND) == (0x50), "BPF_AND != 0x50"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_AND 0x50 #endif #if defined(BPF_LSH) || (defined(HAVE_DECL_BPF_LSH) && HAVE_DECL_BPF_LSH) - XLAT(BPF_LSH), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_LSH) == (0x60), "BPF_LSH != 0x60"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_LSH 0x60 #endif #if defined(BPF_RSH) || (defined(HAVE_DECL_BPF_RSH) && HAVE_DECL_BPF_RSH) - XLAT(BPF_RSH), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_RSH) == (0x70), "BPF_RSH != 0x70"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_RSH 0x70 #endif #if defined(BPF_NEG) || (defined(HAVE_DECL_BPF_NEG) && HAVE_DECL_BPF_NEG) - XLAT(BPF_NEG), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_NEG) == (0x80), "BPF_NEG != 0x80"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_NEG 0x80 #endif #if defined(BPF_MOD) || (defined(HAVE_DECL_BPF_MOD) && HAVE_DECL_BPF_MOD) - XLAT(BPF_MOD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MOD) == (0x90), "BPF_MOD != 0x90"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_MOD 0x90 #endif #if defined(BPF_XOR) || (defined(HAVE_DECL_BPF_XOR) && HAVE_DECL_BPF_XOR) - XLAT(BPF_XOR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_XOR) == (0xa0), "BPF_XOR != 0xa0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_XOR 0xa0 #endif #if defined(BPF_MOV) || (defined(HAVE_DECL_BPF_MOV) && HAVE_DECL_BPF_MOV) - XLAT(BPF_MOV), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MOV) == (0xb0), "BPF_MOV != 0xb0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_MOV 0xb0 #endif #if defined(BPF_ARSH) || (defined(HAVE_DECL_BPF_ARSH) && HAVE_DECL_BPF_ARSH) - XLAT(BPF_ARSH), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_ARSH) == (0xc0), "BPF_ARSH != 0xc0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_ARSH 0xc0 #endif +#if defined(BPF_END) || (defined(HAVE_DECL_BPF_END) && HAVE_DECL_BPF_END) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_END) == (0xd0), "BPF_END != 0xd0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_END 0xd0 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat bpf_op_alu in mpers mode + +# else + +static +const struct xlat bpf_op_alu[] = { + XLAT(BPF_ADD), + XLAT(BPF_SUB), + XLAT(BPF_MUL), + XLAT(BPF_DIV), + XLAT(BPF_OR), + XLAT(BPF_AND), + XLAT(BPF_LSH), + XLAT(BPF_RSH), + XLAT(BPF_NEG), + XLAT(BPF_MOD), + XLAT(BPF_XOR), + XLAT(BPF_MOV), + XLAT(BPF_ARSH), + XLAT(BPF_END), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bpf_op_alu.in b/xlat/bpf_op_alu.in index e43aec60..5016a46e 100644 --- a/xlat/bpf_op_alu.in +++ b/xlat/bpf_op_alu.in @@ -1,13 +1,14 @@ -BPF_ADD -BPF_SUB -BPF_MUL -BPF_DIV -BPF_OR -BPF_AND -BPF_LSH -BPF_RSH -BPF_NEG -BPF_MOD -BPF_XOR -BPF_MOV -BPF_ARSH +BPF_ADD 0x00 +BPF_SUB 0x10 +BPF_MUL 0x20 +BPF_DIV 0x30 +BPF_OR 0x40 +BPF_AND 0x50 +BPF_LSH 0x60 +BPF_RSH 0x70 +BPF_NEG 0x80 +BPF_MOD 0x90 +BPF_XOR 0xa0 +BPF_MOV 0xb0 +BPF_ARSH 0xc0 +BPF_END 0xd0 diff --git a/xlat/bpf_op_jmp.h b/xlat/bpf_op_jmp.h index d43b30ec..56d1a42b 100644 --- a/xlat/bpf_op_jmp.h +++ b/xlat/bpf_op_jmp.h @@ -1,44 +1,134 @@ /* Generated by ./xlat/gen.sh from ./xlat/bpf_op_jmp.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat bpf_op_jmp in mpers mode - -#else - -static -const struct xlat bpf_op_jmp[] = { #if defined(BPF_JA) || (defined(HAVE_DECL_BPF_JA) && HAVE_DECL_BPF_JA) - XLAT(BPF_JA), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_JA) == (0x00), "BPF_JA != 0x00"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_JA 0x00 #endif #if defined(BPF_JEQ) || (defined(HAVE_DECL_BPF_JEQ) && HAVE_DECL_BPF_JEQ) - XLAT(BPF_JEQ), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_JEQ) == (0x10), "BPF_JEQ != 0x10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_JEQ 0x10 #endif #if defined(BPF_JGT) || (defined(HAVE_DECL_BPF_JGT) && HAVE_DECL_BPF_JGT) - XLAT(BPF_JGT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_JGT) == (0x20), "BPF_JGT != 0x20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_JGT 0x20 #endif #if defined(BPF_JGE) || (defined(HAVE_DECL_BPF_JGE) && HAVE_DECL_BPF_JGE) - XLAT(BPF_JGE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_JGE) == (0x30), "BPF_JGE != 0x30"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_JGE 0x30 #endif #if defined(BPF_JSET) || (defined(HAVE_DECL_BPF_JSET) && HAVE_DECL_BPF_JSET) - XLAT(BPF_JSET), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_JSET) == (0x40), "BPF_JSET != 0x40"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_JSET 0x40 #endif #if defined(BPF_JNE) || (defined(HAVE_DECL_BPF_JNE) && HAVE_DECL_BPF_JNE) - XLAT(BPF_JNE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_JNE) == (0x50), "BPF_JNE != 0x50"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_JNE 0x50 #endif #if defined(BPF_JSGT) || (defined(HAVE_DECL_BPF_JSGT) && HAVE_DECL_BPF_JSGT) - XLAT(BPF_JSGT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_JSGT) == (0x60), "BPF_JSGT != 0x60"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_JSGT 0x60 #endif #if defined(BPF_JSGE) || (defined(HAVE_DECL_BPF_JSGE) && HAVE_DECL_BPF_JSGE) - XLAT(BPF_JSGE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_JSGE) == (0x70), "BPF_JSGE != 0x70"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_JSGE 0x70 #endif #if defined(BPF_CALL) || (defined(HAVE_DECL_BPF_CALL) && HAVE_DECL_BPF_CALL) - XLAT(BPF_CALL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_CALL) == (0x80), "BPF_CALL != 0x80"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_CALL 0x80 #endif #if defined(BPF_EXIT) || (defined(HAVE_DECL_BPF_EXIT) && HAVE_DECL_BPF_EXIT) - XLAT(BPF_EXIT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_EXIT) == (0x90), "BPF_EXIT != 0x90"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_EXIT 0x90 #endif +#if defined(BPF_JLT) || (defined(HAVE_DECL_BPF_JLT) && HAVE_DECL_BPF_JLT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_JLT) == (0xa0), "BPF_JLT != 0xa0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_JLT 0xa0 +#endif +#if defined(BPF_JLE) || (defined(HAVE_DECL_BPF_JLE) && HAVE_DECL_BPF_JLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_JLE) == (0xb0), "BPF_JLE != 0xb0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_JLE 0xb0 +#endif +#if defined(BPF_JSLT) || (defined(HAVE_DECL_BPF_JSLT) && HAVE_DECL_BPF_JSLT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_JSLT) == (0xc0), "BPF_JSLT != 0xc0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_JSLT 0xc0 +#endif +#if defined(BPF_JSLE) || (defined(HAVE_DECL_BPF_JSLE) && HAVE_DECL_BPF_JSLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_JSLE) == (0xd0), "BPF_JSLE != 0xd0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_JSLE 0xd0 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat bpf_op_jmp in mpers mode + +# else + +static +const struct xlat bpf_op_jmp[] = { + XLAT(BPF_JA), + XLAT(BPF_JEQ), + XLAT(BPF_JGT), + XLAT(BPF_JGE), + XLAT(BPF_JSET), + XLAT(BPF_JNE), + XLAT(BPF_JSGT), + XLAT(BPF_JSGE), + XLAT(BPF_CALL), + XLAT(BPF_EXIT), + XLAT(BPF_JLT), + XLAT(BPF_JLE), + XLAT(BPF_JSLT), + XLAT(BPF_JSLE), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bpf_op_jmp.in b/xlat/bpf_op_jmp.in index 456c0af8..1e9b6f70 100644 --- a/xlat/bpf_op_jmp.in +++ b/xlat/bpf_op_jmp.in @@ -1,10 +1,14 @@ -BPF_JA -BPF_JEQ -BPF_JGT -BPF_JGE -BPF_JSET -BPF_JNE -BPF_JSGT -BPF_JSGE -BPF_CALL -BPF_EXIT +BPF_JA 0x00 +BPF_JEQ 0x10 +BPF_JGT 0x20 +BPF_JGE 0x30 +BPF_JSET 0x40 +BPF_JNE 0x50 +BPF_JSGT 0x60 +BPF_JSGE 0x70 +BPF_CALL 0x80 +BPF_EXIT 0x90 +BPF_JLT 0xa0 +BPF_JLE 0xb0 +BPF_JSLT 0xc0 +BPF_JSLE 0xd0 diff --git a/xlat/bpf_prog_flags.h b/xlat/bpf_prog_flags.h new file mode 100644 index 00000000..e33d0b63 --- /dev/null +++ b/xlat/bpf_prog_flags.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bpf_prog_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BPF_F_STRICT_ALIGNMENT) || (defined(HAVE_DECL_BPF_F_STRICT_ALIGNMENT) && HAVE_DECL_BPF_F_STRICT_ALIGNMENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_F_STRICT_ALIGNMENT) == (1U), "BPF_F_STRICT_ALIGNMENT != 1U"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_F_STRICT_ALIGNMENT 1U +#endif +#if defined(BPF_F_ANY_ALIGNMENT) || (defined(HAVE_DECL_BPF_F_ANY_ALIGNMENT) && HAVE_DECL_BPF_F_ANY_ALIGNMENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_F_ANY_ALIGNMENT) == ((1U << 1)), "BPF_F_ANY_ALIGNMENT != (1U << 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_F_ANY_ALIGNMENT (1U << 1) +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat bpf_prog_flags in mpers mode + +# else + +static +const struct xlat bpf_prog_flags[] = { + XLAT(BPF_F_STRICT_ALIGNMENT), + XLAT(BPF_F_ANY_ALIGNMENT), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bpf_prog_flags.in b/xlat/bpf_prog_flags.in new file mode 100644 index 00000000..e9eb42aa --- /dev/null +++ b/xlat/bpf_prog_flags.in @@ -0,0 +1,2 @@ +BPF_F_STRICT_ALIGNMENT 1U +BPF_F_ANY_ALIGNMENT (1U << 1) diff --git a/xlat/bpf_prog_types.h b/xlat/bpf_prog_types.h index 9eac9520..14bd253d 100644 --- a/xlat/bpf_prog_types.h +++ b/xlat/bpf_prog_types.h @@ -1,66 +1,198 @@ /* Generated by ./xlat/gen.sh from ./xlat/bpf_prog_types.in; do not edit. */ -#if !(defined(BPF_PROG_TYPE_UNSPEC) || (defined(HAVE_DECL_BPF_PROG_TYPE_UNSPEC) && HAVE_DECL_BPF_PROG_TYPE_UNSPEC)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BPF_PROG_TYPE_UNSPEC) || (defined(HAVE_DECL_BPF_PROG_TYPE_UNSPEC) && HAVE_DECL_BPF_PROG_TYPE_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_TYPE_UNSPEC) == (0), "BPF_PROG_TYPE_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_PROG_TYPE_UNSPEC 0 #endif -#if !(defined(BPF_PROG_TYPE_SOCKET_FILTER) || (defined(HAVE_DECL_BPF_PROG_TYPE_SOCKET_FILTER) && HAVE_DECL_BPF_PROG_TYPE_SOCKET_FILTER)) +#if defined(BPF_PROG_TYPE_SOCKET_FILTER) || (defined(HAVE_DECL_BPF_PROG_TYPE_SOCKET_FILTER) && HAVE_DECL_BPF_PROG_TYPE_SOCKET_FILTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_TYPE_SOCKET_FILTER) == (1), "BPF_PROG_TYPE_SOCKET_FILTER != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_PROG_TYPE_SOCKET_FILTER 1 #endif -#if !(defined(BPF_PROG_TYPE_KPROBE) || (defined(HAVE_DECL_BPF_PROG_TYPE_KPROBE) && HAVE_DECL_BPF_PROG_TYPE_KPROBE)) +#if defined(BPF_PROG_TYPE_KPROBE) || (defined(HAVE_DECL_BPF_PROG_TYPE_KPROBE) && HAVE_DECL_BPF_PROG_TYPE_KPROBE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_TYPE_KPROBE) == (2), "BPF_PROG_TYPE_KPROBE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_PROG_TYPE_KPROBE 2 #endif -#if !(defined(BPF_PROG_TYPE_SCHED_CLS) || (defined(HAVE_DECL_BPF_PROG_TYPE_SCHED_CLS) && HAVE_DECL_BPF_PROG_TYPE_SCHED_CLS)) +#if defined(BPF_PROG_TYPE_SCHED_CLS) || (defined(HAVE_DECL_BPF_PROG_TYPE_SCHED_CLS) && HAVE_DECL_BPF_PROG_TYPE_SCHED_CLS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_TYPE_SCHED_CLS) == (3), "BPF_PROG_TYPE_SCHED_CLS != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_PROG_TYPE_SCHED_CLS 3 #endif -#if !(defined(BPF_PROG_TYPE_SCHED_ACT) || (defined(HAVE_DECL_BPF_PROG_TYPE_SCHED_ACT) && HAVE_DECL_BPF_PROG_TYPE_SCHED_ACT)) +#if defined(BPF_PROG_TYPE_SCHED_ACT) || (defined(HAVE_DECL_BPF_PROG_TYPE_SCHED_ACT) && HAVE_DECL_BPF_PROG_TYPE_SCHED_ACT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_TYPE_SCHED_ACT) == (4), "BPF_PROG_TYPE_SCHED_ACT != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_PROG_TYPE_SCHED_ACT 4 #endif -#if !(defined(BPF_PROG_TYPE_TRACEPOINT) || (defined(HAVE_DECL_BPF_PROG_TYPE_TRACEPOINT) && HAVE_DECL_BPF_PROG_TYPE_TRACEPOINT)) +#if defined(BPF_PROG_TYPE_TRACEPOINT) || (defined(HAVE_DECL_BPF_PROG_TYPE_TRACEPOINT) && HAVE_DECL_BPF_PROG_TYPE_TRACEPOINT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_TYPE_TRACEPOINT) == (5), "BPF_PROG_TYPE_TRACEPOINT != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_PROG_TYPE_TRACEPOINT 5 #endif -#if !(defined(BPF_PROG_TYPE_XDP) || (defined(HAVE_DECL_BPF_PROG_TYPE_XDP) && HAVE_DECL_BPF_PROG_TYPE_XDP)) +#if defined(BPF_PROG_TYPE_XDP) || (defined(HAVE_DECL_BPF_PROG_TYPE_XDP) && HAVE_DECL_BPF_PROG_TYPE_XDP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_TYPE_XDP) == (6), "BPF_PROG_TYPE_XDP != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_PROG_TYPE_XDP 6 #endif -#if !(defined(BPF_PROG_TYPE_PERF_EVENT) || (defined(HAVE_DECL_BPF_PROG_TYPE_PERF_EVENT) && HAVE_DECL_BPF_PROG_TYPE_PERF_EVENT)) +#if defined(BPF_PROG_TYPE_PERF_EVENT) || (defined(HAVE_DECL_BPF_PROG_TYPE_PERF_EVENT) && HAVE_DECL_BPF_PROG_TYPE_PERF_EVENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_TYPE_PERF_EVENT) == (7), "BPF_PROG_TYPE_PERF_EVENT != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_PROG_TYPE_PERF_EVENT 7 #endif -#if !(defined(BPF_PROG_TYPE_CGROUP_SKB) || (defined(HAVE_DECL_BPF_PROG_TYPE_CGROUP_SKB) && HAVE_DECL_BPF_PROG_TYPE_CGROUP_SKB)) +#if defined(BPF_PROG_TYPE_CGROUP_SKB) || (defined(HAVE_DECL_BPF_PROG_TYPE_CGROUP_SKB) && HAVE_DECL_BPF_PROG_TYPE_CGROUP_SKB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_TYPE_CGROUP_SKB) == (8), "BPF_PROG_TYPE_CGROUP_SKB != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_PROG_TYPE_CGROUP_SKB 8 #endif -#if !(defined(BPF_PROG_TYPE_CGROUP_SOCK) || (defined(HAVE_DECL_BPF_PROG_TYPE_CGROUP_SOCK) && HAVE_DECL_BPF_PROG_TYPE_CGROUP_SOCK)) +#if defined(BPF_PROG_TYPE_CGROUP_SOCK) || (defined(HAVE_DECL_BPF_PROG_TYPE_CGROUP_SOCK) && HAVE_DECL_BPF_PROG_TYPE_CGROUP_SOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_TYPE_CGROUP_SOCK) == (9), "BPF_PROG_TYPE_CGROUP_SOCK != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_PROG_TYPE_CGROUP_SOCK 9 #endif -#if !(defined(BPF_PROG_TYPE_LWT_IN) || (defined(HAVE_DECL_BPF_PROG_TYPE_LWT_IN) && HAVE_DECL_BPF_PROG_TYPE_LWT_IN)) +#if defined(BPF_PROG_TYPE_LWT_IN) || (defined(HAVE_DECL_BPF_PROG_TYPE_LWT_IN) && HAVE_DECL_BPF_PROG_TYPE_LWT_IN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_TYPE_LWT_IN) == (10), "BPF_PROG_TYPE_LWT_IN != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_PROG_TYPE_LWT_IN 10 #endif -#if !(defined(BPF_PROG_TYPE_LWT_OUT) || (defined(HAVE_DECL_BPF_PROG_TYPE_LWT_OUT) && HAVE_DECL_BPF_PROG_TYPE_LWT_OUT)) +#if defined(BPF_PROG_TYPE_LWT_OUT) || (defined(HAVE_DECL_BPF_PROG_TYPE_LWT_OUT) && HAVE_DECL_BPF_PROG_TYPE_LWT_OUT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_TYPE_LWT_OUT) == (11), "BPF_PROG_TYPE_LWT_OUT != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_PROG_TYPE_LWT_OUT 11 #endif -#if !(defined(BPF_PROG_TYPE_LWT_XMIT) || (defined(HAVE_DECL_BPF_PROG_TYPE_LWT_XMIT) && HAVE_DECL_BPF_PROG_TYPE_LWT_XMIT)) +#if defined(BPF_PROG_TYPE_LWT_XMIT) || (defined(HAVE_DECL_BPF_PROG_TYPE_LWT_XMIT) && HAVE_DECL_BPF_PROG_TYPE_LWT_XMIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_TYPE_LWT_XMIT) == (12), "BPF_PROG_TYPE_LWT_XMIT != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BPF_PROG_TYPE_LWT_XMIT 12 #endif +#if defined(BPF_PROG_TYPE_SOCK_OPS) || (defined(HAVE_DECL_BPF_PROG_TYPE_SOCK_OPS) && HAVE_DECL_BPF_PROG_TYPE_SOCK_OPS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_TYPE_SOCK_OPS) == (13), "BPF_PROG_TYPE_SOCK_OPS != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_PROG_TYPE_SOCK_OPS 13 +#endif +#if defined(BPF_PROG_TYPE_SK_SKB) || (defined(HAVE_DECL_BPF_PROG_TYPE_SK_SKB) && HAVE_DECL_BPF_PROG_TYPE_SK_SKB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_TYPE_SK_SKB) == (14), "BPF_PROG_TYPE_SK_SKB != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_PROG_TYPE_SK_SKB 14 +#endif +#if defined(BPF_PROG_TYPE_CGROUP_DEVICE) || (defined(HAVE_DECL_BPF_PROG_TYPE_CGROUP_DEVICE) && HAVE_DECL_BPF_PROG_TYPE_CGROUP_DEVICE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_TYPE_CGROUP_DEVICE) == (15), "BPF_PROG_TYPE_CGROUP_DEVICE != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_PROG_TYPE_CGROUP_DEVICE 15 +#endif +#if defined(BPF_PROG_TYPE_SK_MSG) || (defined(HAVE_DECL_BPF_PROG_TYPE_SK_MSG) && HAVE_DECL_BPF_PROG_TYPE_SK_MSG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_TYPE_SK_MSG) == (16), "BPF_PROG_TYPE_SK_MSG != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_PROG_TYPE_SK_MSG 16 +#endif +#if defined(BPF_PROG_TYPE_RAW_TRACEPOINT) || (defined(HAVE_DECL_BPF_PROG_TYPE_RAW_TRACEPOINT) && HAVE_DECL_BPF_PROG_TYPE_RAW_TRACEPOINT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_TYPE_RAW_TRACEPOINT) == (17), "BPF_PROG_TYPE_RAW_TRACEPOINT != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_PROG_TYPE_RAW_TRACEPOINT 17 +#endif +#if defined(BPF_PROG_TYPE_LWT_SEG6LOCAL) || (defined(HAVE_DECL_BPF_PROG_TYPE_LWT_SEG6LOCAL) && HAVE_DECL_BPF_PROG_TYPE_LWT_SEG6LOCAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_TYPE_LWT_SEG6LOCAL) == (18), "BPF_PROG_TYPE_LWT_SEG6LOCAL != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_PROG_TYPE_LWT_SEG6LOCAL 18 +#endif +#if defined(BPF_PROG_TYPE_LIRC_MODE2) || (defined(HAVE_DECL_BPF_PROG_TYPE_LIRC_MODE2) && HAVE_DECL_BPF_PROG_TYPE_LIRC_MODE2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_TYPE_LIRC_MODE2) == (19), "BPF_PROG_TYPE_LIRC_MODE2 != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_PROG_TYPE_LIRC_MODE2 19 +#endif +#if defined(BPF_PROG_TYPE_SK_REUSEPORT) || (defined(HAVE_DECL_BPF_PROG_TYPE_SK_REUSEPORT) && HAVE_DECL_BPF_PROG_TYPE_SK_REUSEPORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_TYPE_SK_REUSEPORT) == (20), "BPF_PROG_TYPE_SK_REUSEPORT != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_PROG_TYPE_SK_REUSEPORT 20 +#endif +#if defined(BPF_PROG_TYPE_FLOW_DISSECTOR) || (defined(HAVE_DECL_BPF_PROG_TYPE_FLOW_DISSECTOR) && HAVE_DECL_BPF_PROG_TYPE_FLOW_DISSECTOR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_PROG_TYPE_FLOW_DISSECTOR) == (21), "BPF_PROG_TYPE_FLOW_DISSECTOR != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_PROG_TYPE_FLOW_DISSECTOR 21 +#endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat bpf_prog_types in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat bpf_prog_types in mpers mode + +# else static const struct xlat bpf_prog_types[] = { - XLAT(BPF_PROG_TYPE_UNSPEC), - XLAT(BPF_PROG_TYPE_SOCKET_FILTER), - XLAT(BPF_PROG_TYPE_KPROBE), - XLAT(BPF_PROG_TYPE_SCHED_CLS), - XLAT(BPF_PROG_TYPE_SCHED_ACT), - XLAT(BPF_PROG_TYPE_TRACEPOINT), - XLAT(BPF_PROG_TYPE_XDP), - XLAT(BPF_PROG_TYPE_PERF_EVENT), - XLAT(BPF_PROG_TYPE_CGROUP_SKB), - XLAT(BPF_PROG_TYPE_CGROUP_SOCK), - XLAT(BPF_PROG_TYPE_LWT_IN), - XLAT(BPF_PROG_TYPE_LWT_OUT), - XLAT(BPF_PROG_TYPE_LWT_XMIT), + [BPF_PROG_TYPE_UNSPEC] = XLAT(BPF_PROG_TYPE_UNSPEC), + [BPF_PROG_TYPE_SOCKET_FILTER] = XLAT(BPF_PROG_TYPE_SOCKET_FILTER), + [BPF_PROG_TYPE_KPROBE] = XLAT(BPF_PROG_TYPE_KPROBE), + [BPF_PROG_TYPE_SCHED_CLS] = XLAT(BPF_PROG_TYPE_SCHED_CLS), + [BPF_PROG_TYPE_SCHED_ACT] = XLAT(BPF_PROG_TYPE_SCHED_ACT), + [BPF_PROG_TYPE_TRACEPOINT] = XLAT(BPF_PROG_TYPE_TRACEPOINT), + [BPF_PROG_TYPE_XDP] = XLAT(BPF_PROG_TYPE_XDP), + [BPF_PROG_TYPE_PERF_EVENT] = XLAT(BPF_PROG_TYPE_PERF_EVENT), + [BPF_PROG_TYPE_CGROUP_SKB] = XLAT(BPF_PROG_TYPE_CGROUP_SKB), + [BPF_PROG_TYPE_CGROUP_SOCK] = XLAT(BPF_PROG_TYPE_CGROUP_SOCK), + [BPF_PROG_TYPE_LWT_IN] = XLAT(BPF_PROG_TYPE_LWT_IN), + [BPF_PROG_TYPE_LWT_OUT] = XLAT(BPF_PROG_TYPE_LWT_OUT), + [BPF_PROG_TYPE_LWT_XMIT] = XLAT(BPF_PROG_TYPE_LWT_XMIT), + [BPF_PROG_TYPE_SOCK_OPS] = XLAT(BPF_PROG_TYPE_SOCK_OPS), + [BPF_PROG_TYPE_SK_SKB] = XLAT(BPF_PROG_TYPE_SK_SKB), + [BPF_PROG_TYPE_CGROUP_DEVICE] = XLAT(BPF_PROG_TYPE_CGROUP_DEVICE), + [BPF_PROG_TYPE_SK_MSG] = XLAT(BPF_PROG_TYPE_SK_MSG), + [BPF_PROG_TYPE_RAW_TRACEPOINT] = XLAT(BPF_PROG_TYPE_RAW_TRACEPOINT), + [BPF_PROG_TYPE_LWT_SEG6LOCAL] = XLAT(BPF_PROG_TYPE_LWT_SEG6LOCAL), + [BPF_PROG_TYPE_LIRC_MODE2] = XLAT(BPF_PROG_TYPE_LIRC_MODE2), + [BPF_PROG_TYPE_SK_REUSEPORT] = XLAT(BPF_PROG_TYPE_SK_REUSEPORT), + [BPF_PROG_TYPE_FLOW_DISSECTOR] = XLAT(BPF_PROG_TYPE_FLOW_DISSECTOR), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bpf_prog_types.in b/xlat/bpf_prog_types.in index bad608ec..dd1b4079 100644 --- a/xlat/bpf_prog_types.in +++ b/xlat/bpf_prog_types.in @@ -1,3 +1,4 @@ +#value_indexed BPF_PROG_TYPE_UNSPEC 0 BPF_PROG_TYPE_SOCKET_FILTER 1 BPF_PROG_TYPE_KPROBE 2 @@ -11,3 +12,12 @@ BPF_PROG_TYPE_CGROUP_SOCK 9 BPF_PROG_TYPE_LWT_IN 10 BPF_PROG_TYPE_LWT_OUT 11 BPF_PROG_TYPE_LWT_XMIT 12 +BPF_PROG_TYPE_SOCK_OPS 13 +BPF_PROG_TYPE_SK_SKB 14 +BPF_PROG_TYPE_CGROUP_DEVICE 15 +BPF_PROG_TYPE_SK_MSG 16 +BPF_PROG_TYPE_RAW_TRACEPOINT 17 +BPF_PROG_TYPE_LWT_SEG6LOCAL 18 +BPF_PROG_TYPE_LIRC_MODE2 19 +BPF_PROG_TYPE_SK_REUSEPORT 20 +BPF_PROG_TYPE_FLOW_DISSECTOR 21 diff --git a/xlat/bpf_query_flags.h b/xlat/bpf_query_flags.h new file mode 100644 index 00000000..38f84b4d --- /dev/null +++ b/xlat/bpf_query_flags.h @@ -0,0 +1,30 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bpf_query_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BPF_F_QUERY_EFFECTIVE) || (defined(HAVE_DECL_BPF_F_QUERY_EFFECTIVE) && HAVE_DECL_BPF_F_QUERY_EFFECTIVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_F_QUERY_EFFECTIVE) == ((1U << 0)), "BPF_F_QUERY_EFFECTIVE != (1U << 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_F_QUERY_EFFECTIVE (1U << 0) +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat bpf_query_flags in mpers mode + +# else + +static +const struct xlat bpf_query_flags[] = { + XLAT(BPF_F_QUERY_EFFECTIVE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bpf_query_flags.in b/xlat/bpf_query_flags.in new file mode 100644 index 00000000..b380ac1b --- /dev/null +++ b/xlat/bpf_query_flags.in @@ -0,0 +1 @@ +BPF_F_QUERY_EFFECTIVE (1U << 0) diff --git a/xlat/bpf_rval.h b/xlat/bpf_rval.h index 8f84f03f..85a11c1a 100644 --- a/xlat/bpf_rval.h +++ b/xlat/bpf_rval.h @@ -1,23 +1,46 @@ /* Generated by ./xlat/gen.sh from ./xlat/bpf_rval.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat bpf_rval in mpers mode - -#else - -static -const struct xlat bpf_rval[] = { #if defined(BPF_K) || (defined(HAVE_DECL_BPF_K) && HAVE_DECL_BPF_K) - XLAT(BPF_K), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_K) == (0x00), "BPF_K != 0x00"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_K 0x00 #endif #if defined(BPF_X) || (defined(HAVE_DECL_BPF_X) && HAVE_DECL_BPF_X) - XLAT(BPF_X), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_X) == (0x08), "BPF_X != 0x08"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_X 0x08 #endif #if defined(BPF_A) || (defined(HAVE_DECL_BPF_A) && HAVE_DECL_BPF_A) - XLAT(BPF_A), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_A) == (0x10), "BPF_A != 0x10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_A 0x10 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat bpf_rval in mpers mode + +# else + +static +const struct xlat bpf_rval[] = { + XLAT(BPF_K), + XLAT(BPF_X), + XLAT(BPF_A), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bpf_rval.in b/xlat/bpf_rval.in index 44e137ec..37073bd2 100644 --- a/xlat/bpf_rval.in +++ b/xlat/bpf_rval.in @@ -1,3 +1,3 @@ -BPF_K -BPF_X -BPF_A +BPF_K 0x00 +BPF_X 0x08 +BPF_A 0x10 diff --git a/xlat/bpf_size.h b/xlat/bpf_size.h index f07bc9ca..51aa5399 100644 --- a/xlat/bpf_size.h +++ b/xlat/bpf_size.h @@ -1,26 +1,54 @@ /* Generated by ./xlat/gen.sh from ./xlat/bpf_size.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat bpf_size in mpers mode - -#else - -static -const struct xlat bpf_size[] = { #if defined(BPF_W) || (defined(HAVE_DECL_BPF_W) && HAVE_DECL_BPF_W) - XLAT(BPF_W), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_W) == (0x00), "BPF_W != 0x00"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_W 0x00 #endif #if defined(BPF_H) || (defined(HAVE_DECL_BPF_H) && HAVE_DECL_BPF_H) - XLAT(BPF_H), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_H) == (0x08), "BPF_H != 0x08"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_H 0x08 #endif #if defined(BPF_B) || (defined(HAVE_DECL_BPF_B) && HAVE_DECL_BPF_B) - XLAT(BPF_B), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_B) == (0x10), "BPF_B != 0x10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_B 0x10 #endif #if defined(BPF_DW) || (defined(HAVE_DECL_BPF_DW) && HAVE_DECL_BPF_DW) - XLAT(BPF_DW), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_DW) == (0x18), "BPF_DW != 0x18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_DW 0x18 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat bpf_size in mpers mode + +# else + +static +const struct xlat bpf_size[] = { + XLAT(BPF_W), + XLAT(BPF_H), + XLAT(BPF_B), + XLAT(BPF_DW), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bpf_size.in b/xlat/bpf_size.in index 5e0a5085..104428fc 100644 --- a/xlat/bpf_size.in +++ b/xlat/bpf_size.in @@ -1,4 +1,4 @@ -BPF_W -BPF_H -BPF_B -BPF_DW +BPF_W 0x00 +BPF_H 0x08 +BPF_B 0x10 +BPF_DW 0x18 diff --git a/xlat/bpf_src.h b/xlat/bpf_src.h index c063e75d..eee32dda 100644 --- a/xlat/bpf_src.h +++ b/xlat/bpf_src.h @@ -1,20 +1,38 @@ /* Generated by ./xlat/gen.sh from ./xlat/bpf_src.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat bpf_src in mpers mode - -#else - -static -const struct xlat bpf_src[] = { #if defined(BPF_K) || (defined(HAVE_DECL_BPF_K) && HAVE_DECL_BPF_K) - XLAT(BPF_K), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_K) == (0x00), "BPF_K != 0x00"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_K 0x00 #endif #if defined(BPF_X) || (defined(HAVE_DECL_BPF_X) && HAVE_DECL_BPF_X) - XLAT(BPF_X), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_X) == (0x08), "BPF_X != 0x08"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_X 0x08 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat bpf_src in mpers mode + +# else + +static +const struct xlat bpf_src[] = { + XLAT(BPF_K), + XLAT(BPF_X), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bpf_src.in b/xlat/bpf_src.in index ede6abb9..46237178 100644 --- a/xlat/bpf_src.in +++ b/xlat/bpf_src.in @@ -1,2 +1,2 @@ -BPF_K -BPF_X +BPF_K 0x00 +BPF_X 0x08 diff --git a/xlat/bpf_task_fd_type.h b/xlat/bpf_task_fd_type.h new file mode 100644 index 00000000..c4d1993d --- /dev/null +++ b/xlat/bpf_task_fd_type.h @@ -0,0 +1,70 @@ +/* Generated by ./xlat/gen.sh from ./xlat/bpf_task_fd_type.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BPF_FD_TYPE_RAW_TRACEPOINT) || (defined(HAVE_DECL_BPF_FD_TYPE_RAW_TRACEPOINT) && HAVE_DECL_BPF_FD_TYPE_RAW_TRACEPOINT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_FD_TYPE_RAW_TRACEPOINT) == (0), "BPF_FD_TYPE_RAW_TRACEPOINT != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_FD_TYPE_RAW_TRACEPOINT 0 +#endif +#if defined(BPF_FD_TYPE_TRACEPOINT) || (defined(HAVE_DECL_BPF_FD_TYPE_TRACEPOINT) && HAVE_DECL_BPF_FD_TYPE_TRACEPOINT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_FD_TYPE_TRACEPOINT) == (1), "BPF_FD_TYPE_TRACEPOINT != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_FD_TYPE_TRACEPOINT 1 +#endif +#if defined(BPF_FD_TYPE_KPROBE) || (defined(HAVE_DECL_BPF_FD_TYPE_KPROBE) && HAVE_DECL_BPF_FD_TYPE_KPROBE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_FD_TYPE_KPROBE) == (2), "BPF_FD_TYPE_KPROBE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_FD_TYPE_KPROBE 2 +#endif +#if defined(BPF_FD_TYPE_KRETPROBE) || (defined(HAVE_DECL_BPF_FD_TYPE_KRETPROBE) && HAVE_DECL_BPF_FD_TYPE_KRETPROBE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_FD_TYPE_KRETPROBE) == (3), "BPF_FD_TYPE_KRETPROBE != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_FD_TYPE_KRETPROBE 3 +#endif +#if defined(BPF_FD_TYPE_UPROBE) || (defined(HAVE_DECL_BPF_FD_TYPE_UPROBE) && HAVE_DECL_BPF_FD_TYPE_UPROBE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_FD_TYPE_UPROBE) == (4), "BPF_FD_TYPE_UPROBE != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_FD_TYPE_UPROBE 4 +#endif +#if defined(BPF_FD_TYPE_URETPROBE) || (defined(HAVE_DECL_BPF_FD_TYPE_URETPROBE) && HAVE_DECL_BPF_FD_TYPE_URETPROBE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_FD_TYPE_URETPROBE) == (5), "BPF_FD_TYPE_URETPROBE != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_FD_TYPE_URETPROBE 5 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat bpf_task_fd_type in mpers mode + +# else + +static +const struct xlat bpf_task_fd_type[] = { + [BPF_FD_TYPE_RAW_TRACEPOINT] = XLAT(BPF_FD_TYPE_RAW_TRACEPOINT), + [BPF_FD_TYPE_TRACEPOINT] = XLAT(BPF_FD_TYPE_TRACEPOINT), + [BPF_FD_TYPE_KPROBE] = XLAT(BPF_FD_TYPE_KPROBE), + [BPF_FD_TYPE_KRETPROBE] = XLAT(BPF_FD_TYPE_KRETPROBE), + [BPF_FD_TYPE_UPROBE] = XLAT(BPF_FD_TYPE_UPROBE), + [BPF_FD_TYPE_URETPROBE] = XLAT(BPF_FD_TYPE_URETPROBE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bpf_task_fd_type.in b/xlat/bpf_task_fd_type.in new file mode 100644 index 00000000..33e89ada --- /dev/null +++ b/xlat/bpf_task_fd_type.in @@ -0,0 +1,7 @@ +#value_indexed +BPF_FD_TYPE_RAW_TRACEPOINT 0 +BPF_FD_TYPE_TRACEPOINT 1 +BPF_FD_TYPE_KPROBE 2 +BPF_FD_TYPE_KRETPROBE 3 +BPF_FD_TYPE_UPROBE 4 +BPF_FD_TYPE_URETPROBE 5 diff --git a/xlat/bsg_flags.h b/xlat/bsg_flags.h index c5f28d9a..fc0f083b 100644 --- a/xlat/bsg_flags.h +++ b/xlat/bsg_flags.h @@ -1,16 +1,30 @@ /* Generated by ./xlat/gen.sh from ./xlat/bsg_flags.in; do not edit. */ -#if !(defined(BSG_FLAG_Q_AT_TAIL) || (defined(HAVE_DECL_BSG_FLAG_Q_AT_TAIL) && HAVE_DECL_BSG_FLAG_Q_AT_TAIL)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BSG_FLAG_Q_AT_TAIL) || (defined(HAVE_DECL_BSG_FLAG_Q_AT_TAIL) && HAVE_DECL_BSG_FLAG_Q_AT_TAIL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BSG_FLAG_Q_AT_TAIL) == (0x10), "BSG_FLAG_Q_AT_TAIL != 0x10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BSG_FLAG_Q_AT_TAIL 0x10 #endif -#if !(defined(BSG_FLAG_Q_AT_HEAD) || (defined(HAVE_DECL_BSG_FLAG_Q_AT_HEAD) && HAVE_DECL_BSG_FLAG_Q_AT_HEAD)) +#if defined(BSG_FLAG_Q_AT_HEAD) || (defined(HAVE_DECL_BSG_FLAG_Q_AT_HEAD) && HAVE_DECL_BSG_FLAG_Q_AT_HEAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BSG_FLAG_Q_AT_HEAD) == (0x20), "BSG_FLAG_Q_AT_HEAD != 0x20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BSG_FLAG_Q_AT_HEAD 0x20 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat bsg_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat bsg_flags in mpers mode + +# else static const struct xlat bsg_flags[] = { @@ -19,4 +33,6 @@ const struct xlat bsg_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bsg_protocol.h b/xlat/bsg_protocol.h index 541085da..fba6c1e5 100644 --- a/xlat/bsg_protocol.h +++ b/xlat/bsg_protocol.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/bsg_protocol.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat bsg_protocol in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat bsg_protocol in mpers mode + +# else static const struct xlat bsg_protocol[] = { @@ -14,4 +20,6 @@ const struct xlat bsg_protocol[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bsg_subprotocol.h b/xlat/bsg_subprotocol.h index 80732138..20752c44 100644 --- a/xlat/bsg_subprotocol.h +++ b/xlat/bsg_subprotocol.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/bsg_subprotocol.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat bsg_subprotocol in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat bsg_subprotocol in mpers mode + +# else static const struct xlat bsg_subprotocol[] = { @@ -20,4 +26,6 @@ const struct xlat bsg_subprotocol[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bt_protocols.h b/xlat/bt_protocols.h index 7b0e1645..bd2db019 100644 --- a/xlat/bt_protocols.h +++ b/xlat/bt_protocols.h @@ -1,38 +1,86 @@ /* Generated by ./xlat/gen.sh from ./xlat/bt_protocols.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat bt_protocols in mpers mode - -#else - -static -const struct xlat bt_protocols[] = { #if defined(BTPROTO_L2CAP) || (defined(HAVE_DECL_BTPROTO_L2CAP) && HAVE_DECL_BTPROTO_L2CAP) - XLAT(BTPROTO_L2CAP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTPROTO_L2CAP) == (0), "BTPROTO_L2CAP != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTPROTO_L2CAP 0 #endif #if defined(BTPROTO_HCI) || (defined(HAVE_DECL_BTPROTO_HCI) && HAVE_DECL_BTPROTO_HCI) - XLAT(BTPROTO_HCI), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTPROTO_HCI) == (1), "BTPROTO_HCI != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTPROTO_HCI 1 #endif #if defined(BTPROTO_SCO) || (defined(HAVE_DECL_BTPROTO_SCO) && HAVE_DECL_BTPROTO_SCO) - XLAT(BTPROTO_SCO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTPROTO_SCO) == (2), "BTPROTO_SCO != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTPROTO_SCO 2 #endif #if defined(BTPROTO_RFCOMM) || (defined(HAVE_DECL_BTPROTO_RFCOMM) && HAVE_DECL_BTPROTO_RFCOMM) - XLAT(BTPROTO_RFCOMM), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTPROTO_RFCOMM) == (3), "BTPROTO_RFCOMM != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTPROTO_RFCOMM 3 #endif #if defined(BTPROTO_BNEP) || (defined(HAVE_DECL_BTPROTO_BNEP) && HAVE_DECL_BTPROTO_BNEP) - XLAT(BTPROTO_BNEP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTPROTO_BNEP) == (4), "BTPROTO_BNEP != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTPROTO_BNEP 4 #endif #if defined(BTPROTO_CMTP) || (defined(HAVE_DECL_BTPROTO_CMTP) && HAVE_DECL_BTPROTO_CMTP) - XLAT(BTPROTO_CMTP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTPROTO_CMTP) == (5), "BTPROTO_CMTP != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTPROTO_CMTP 5 #endif #if defined(BTPROTO_HIDP) || (defined(HAVE_DECL_BTPROTO_HIDP) && HAVE_DECL_BTPROTO_HIDP) - XLAT(BTPROTO_HIDP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTPROTO_HIDP) == (6), "BTPROTO_HIDP != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTPROTO_HIDP 6 #endif #if defined(BTPROTO_AVDTP) || (defined(HAVE_DECL_BTPROTO_AVDTP) && HAVE_DECL_BTPROTO_AVDTP) - XLAT(BTPROTO_AVDTP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTPROTO_AVDTP) == (7), "BTPROTO_AVDTP != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTPROTO_AVDTP 7 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat bt_protocols in mpers mode + +# else + +static +const struct xlat bt_protocols[] = { + [BTPROTO_L2CAP] = XLAT(BTPROTO_L2CAP), + [BTPROTO_HCI] = XLAT(BTPROTO_HCI), + [BTPROTO_SCO] = XLAT(BTPROTO_SCO), + [BTPROTO_RFCOMM] = XLAT(BTPROTO_RFCOMM), + [BTPROTO_BNEP] = XLAT(BTPROTO_BNEP), + [BTPROTO_CMTP] = XLAT(BTPROTO_CMTP), + [BTPROTO_HIDP] = XLAT(BTPROTO_HIDP), + [BTPROTO_AVDTP] = XLAT(BTPROTO_AVDTP), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/bt_protocols.in b/xlat/bt_protocols.in index 1f7f3485..a0ad0565 100644 --- a/xlat/bt_protocols.in +++ b/xlat/bt_protocols.in @@ -1,8 +1,9 @@ -BTPROTO_L2CAP -BTPROTO_HCI -BTPROTO_SCO -BTPROTO_RFCOMM -BTPROTO_BNEP -BTPROTO_CMTP -BTPROTO_HIDP -BTPROTO_AVDTP +#value_indexed +BTPROTO_L2CAP 0 +BTPROTO_HCI 1 +BTPROTO_SCO 2 +BTPROTO_RFCOMM 3 +BTPROTO_BNEP 4 +BTPROTO_CMTP 5 +BTPROTO_HIDP 6 +BTPROTO_AVDTP 7 diff --git a/xlat/btrfs_balance_args.h b/xlat/btrfs_balance_args.h index d1f10918..11eced64 100644 --- a/xlat/btrfs_balance_args.h +++ b/xlat/btrfs_balance_args.h @@ -1,47 +1,97 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_balance_args.in; do not edit. */ -#if !(defined(BTRFS_BALANCE_ARGS_PROFILES) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_PROFILES) && HAVE_DECL_BTRFS_BALANCE_ARGS_PROFILES)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BTRFS_BALANCE_ARGS_PROFILES) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_PROFILES) && HAVE_DECL_BTRFS_BALANCE_ARGS_PROFILES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BALANCE_ARGS_PROFILES) == ((1ULL << 0)), "BTRFS_BALANCE_ARGS_PROFILES != (1ULL << 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BALANCE_ARGS_PROFILES (1ULL << 0) #endif -#if !(defined(BTRFS_BALANCE_ARGS_USAGE) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_USAGE) && HAVE_DECL_BTRFS_BALANCE_ARGS_USAGE)) +#if defined(BTRFS_BALANCE_ARGS_USAGE) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_USAGE) && HAVE_DECL_BTRFS_BALANCE_ARGS_USAGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BALANCE_ARGS_USAGE) == ((1ULL << 1)), "BTRFS_BALANCE_ARGS_USAGE != (1ULL << 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BALANCE_ARGS_USAGE (1ULL << 1) #endif -#if !(defined(BTRFS_BALANCE_ARGS_DEVID) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_DEVID) && HAVE_DECL_BTRFS_BALANCE_ARGS_DEVID)) +#if defined(BTRFS_BALANCE_ARGS_DEVID) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_DEVID) && HAVE_DECL_BTRFS_BALANCE_ARGS_DEVID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BALANCE_ARGS_DEVID) == ((1ULL << 2)), "BTRFS_BALANCE_ARGS_DEVID != (1ULL << 2)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BALANCE_ARGS_DEVID (1ULL << 2) #endif -#if !(defined(BTRFS_BALANCE_ARGS_DRANGE) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_DRANGE) && HAVE_DECL_BTRFS_BALANCE_ARGS_DRANGE)) +#if defined(BTRFS_BALANCE_ARGS_DRANGE) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_DRANGE) && HAVE_DECL_BTRFS_BALANCE_ARGS_DRANGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BALANCE_ARGS_DRANGE) == ((1ULL << 3)), "BTRFS_BALANCE_ARGS_DRANGE != (1ULL << 3)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BALANCE_ARGS_DRANGE (1ULL << 3) #endif -#if !(defined(BTRFS_BALANCE_ARGS_VRANGE) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_VRANGE) && HAVE_DECL_BTRFS_BALANCE_ARGS_VRANGE)) +#if defined(BTRFS_BALANCE_ARGS_VRANGE) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_VRANGE) && HAVE_DECL_BTRFS_BALANCE_ARGS_VRANGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BALANCE_ARGS_VRANGE) == ((1ULL << 4)), "BTRFS_BALANCE_ARGS_VRANGE != (1ULL << 4)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BALANCE_ARGS_VRANGE (1ULL << 4) #endif -#if !(defined(BTRFS_BALANCE_ARGS_LIMIT) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_LIMIT) && HAVE_DECL_BTRFS_BALANCE_ARGS_LIMIT)) +#if defined(BTRFS_BALANCE_ARGS_LIMIT) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_LIMIT) && HAVE_DECL_BTRFS_BALANCE_ARGS_LIMIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BALANCE_ARGS_LIMIT) == ((1ULL << 5)), "BTRFS_BALANCE_ARGS_LIMIT != (1ULL << 5)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BALANCE_ARGS_LIMIT (1ULL << 5) #endif -#if !(defined(BTRFS_BALANCE_ARGS_LIMIT_RANGE) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_LIMIT_RANGE) && HAVE_DECL_BTRFS_BALANCE_ARGS_LIMIT_RANGE)) +#if defined(BTRFS_BALANCE_ARGS_LIMIT_RANGE) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_LIMIT_RANGE) && HAVE_DECL_BTRFS_BALANCE_ARGS_LIMIT_RANGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BALANCE_ARGS_LIMIT_RANGE) == ((1ULL << 6)), "BTRFS_BALANCE_ARGS_LIMIT_RANGE != (1ULL << 6)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BALANCE_ARGS_LIMIT_RANGE (1ULL << 6) #endif -#if !(defined(BTRFS_BALANCE_ARGS_STRIPES_RANGE) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_STRIPES_RANGE) && HAVE_DECL_BTRFS_BALANCE_ARGS_STRIPES_RANGE)) +#if defined(BTRFS_BALANCE_ARGS_STRIPES_RANGE) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_STRIPES_RANGE) && HAVE_DECL_BTRFS_BALANCE_ARGS_STRIPES_RANGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BALANCE_ARGS_STRIPES_RANGE) == ((1ULL << 7)), "BTRFS_BALANCE_ARGS_STRIPES_RANGE != (1ULL << 7)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BALANCE_ARGS_STRIPES_RANGE (1ULL << 7) #endif -#if !(defined(BTRFS_BALANCE_ARGS_CONVERT) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_CONVERT) && HAVE_DECL_BTRFS_BALANCE_ARGS_CONVERT)) +#if defined(BTRFS_BALANCE_ARGS_CONVERT) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_CONVERT) && HAVE_DECL_BTRFS_BALANCE_ARGS_CONVERT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BALANCE_ARGS_CONVERT) == ((1ULL << 8)), "BTRFS_BALANCE_ARGS_CONVERT != (1ULL << 8)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BALANCE_ARGS_CONVERT (1ULL << 8) #endif -#if !(defined(BTRFS_BALANCE_ARGS_SOFT) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_SOFT) && HAVE_DECL_BTRFS_BALANCE_ARGS_SOFT)) +#if defined(BTRFS_BALANCE_ARGS_SOFT) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_SOFT) && HAVE_DECL_BTRFS_BALANCE_ARGS_SOFT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BALANCE_ARGS_SOFT) == ((1ULL << 9)), "BTRFS_BALANCE_ARGS_SOFT != (1ULL << 9)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BALANCE_ARGS_SOFT (1ULL << 9) #endif -#if !(defined(BTRFS_BALANCE_ARGS_USAGE_RANGE) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_USAGE_RANGE) && HAVE_DECL_BTRFS_BALANCE_ARGS_USAGE_RANGE)) +#if defined(BTRFS_BALANCE_ARGS_USAGE_RANGE) || (defined(HAVE_DECL_BTRFS_BALANCE_ARGS_USAGE_RANGE) && HAVE_DECL_BTRFS_BALANCE_ARGS_USAGE_RANGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BALANCE_ARGS_USAGE_RANGE) == ((1ULL << 10)), "BTRFS_BALANCE_ARGS_USAGE_RANGE != (1ULL << 10)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BALANCE_ARGS_USAGE_RANGE (1ULL << 10) #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat btrfs_balance_args[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_balance_args[] = { XLAT_TYPE(uint64_t, BTRFS_BALANCE_ARGS_PROFILES), XLAT_TYPE(uint64_t, BTRFS_BALANCE_ARGS_USAGE), @@ -57,4 +107,6 @@ const struct xlat btrfs_balance_args[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_balance_ctl_cmds.h b/xlat/btrfs_balance_ctl_cmds.h index 9bdc820e..a7c0040e 100644 --- a/xlat/btrfs_balance_ctl_cmds.h +++ b/xlat/btrfs_balance_ctl_cmds.h @@ -1,24 +1,40 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_balance_ctl_cmds.in; do not edit. */ -#if !(defined(BTRFS_BALANCE_CTL_PAUSE) || (defined(HAVE_DECL_BTRFS_BALANCE_CTL_PAUSE) && HAVE_DECL_BTRFS_BALANCE_CTL_PAUSE)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BTRFS_BALANCE_CTL_PAUSE) || (defined(HAVE_DECL_BTRFS_BALANCE_CTL_PAUSE) && HAVE_DECL_BTRFS_BALANCE_CTL_PAUSE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BALANCE_CTL_PAUSE) == (1), "BTRFS_BALANCE_CTL_PAUSE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BALANCE_CTL_PAUSE 1 #endif -#if !(defined(BTRFS_BALANCE_CTL_CANCEL) || (defined(HAVE_DECL_BTRFS_BALANCE_CTL_CANCEL) && HAVE_DECL_BTRFS_BALANCE_CTL_CANCEL)) +#if defined(BTRFS_BALANCE_CTL_CANCEL) || (defined(HAVE_DECL_BTRFS_BALANCE_CTL_CANCEL) && HAVE_DECL_BTRFS_BALANCE_CTL_CANCEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BALANCE_CTL_CANCEL) == (2), "BTRFS_BALANCE_CTL_CANCEL != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BALANCE_CTL_CANCEL 2 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat btrfs_balance_ctl_cmds[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_balance_ctl_cmds[] = { XLAT(BTRFS_BALANCE_CTL_PAUSE), XLAT(BTRFS_BALANCE_CTL_CANCEL), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_balance_flags.h b/xlat/btrfs_balance_flags.h index c071b6e1..87537552 100644 --- a/xlat/btrfs_balance_flags.h +++ b/xlat/btrfs_balance_flags.h @@ -1,29 +1,55 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_balance_flags.in; do not edit. */ -#if !(defined(BTRFS_BALANCE_DATA) || (defined(HAVE_DECL_BTRFS_BALANCE_DATA) && HAVE_DECL_BTRFS_BALANCE_DATA)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BTRFS_BALANCE_DATA) || (defined(HAVE_DECL_BTRFS_BALANCE_DATA) && HAVE_DECL_BTRFS_BALANCE_DATA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BALANCE_DATA) == ((1ULL << 0)), "BTRFS_BALANCE_DATA != (1ULL << 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BALANCE_DATA (1ULL << 0) #endif -#if !(defined(BTRFS_BALANCE_SYSTEM) || (defined(HAVE_DECL_BTRFS_BALANCE_SYSTEM) && HAVE_DECL_BTRFS_BALANCE_SYSTEM)) +#if defined(BTRFS_BALANCE_SYSTEM) || (defined(HAVE_DECL_BTRFS_BALANCE_SYSTEM) && HAVE_DECL_BTRFS_BALANCE_SYSTEM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BALANCE_SYSTEM) == ((1ULL << 1)), "BTRFS_BALANCE_SYSTEM != (1ULL << 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BALANCE_SYSTEM (1ULL << 1) #endif -#if !(defined(BTRFS_BALANCE_METADATA) || (defined(HAVE_DECL_BTRFS_BALANCE_METADATA) && HAVE_DECL_BTRFS_BALANCE_METADATA)) +#if defined(BTRFS_BALANCE_METADATA) || (defined(HAVE_DECL_BTRFS_BALANCE_METADATA) && HAVE_DECL_BTRFS_BALANCE_METADATA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BALANCE_METADATA) == ((1ULL << 2)), "BTRFS_BALANCE_METADATA != (1ULL << 2)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BALANCE_METADATA (1ULL << 2) #endif -#if !(defined(BTRFS_BALANCE_FORCE) || (defined(HAVE_DECL_BTRFS_BALANCE_FORCE) && HAVE_DECL_BTRFS_BALANCE_FORCE)) +#if defined(BTRFS_BALANCE_FORCE) || (defined(HAVE_DECL_BTRFS_BALANCE_FORCE) && HAVE_DECL_BTRFS_BALANCE_FORCE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BALANCE_FORCE) == ((1ULL << 3)), "BTRFS_BALANCE_FORCE != (1ULL << 3)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BALANCE_FORCE (1ULL << 3) #endif -#if !(defined(BTRFS_BALANCE_RESUME) || (defined(HAVE_DECL_BTRFS_BALANCE_RESUME) && HAVE_DECL_BTRFS_BALANCE_RESUME)) +#if defined(BTRFS_BALANCE_RESUME) || (defined(HAVE_DECL_BTRFS_BALANCE_RESUME) && HAVE_DECL_BTRFS_BALANCE_RESUME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BALANCE_RESUME) == ((1ULL << 4)), "BTRFS_BALANCE_RESUME != (1ULL << 4)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BALANCE_RESUME (1ULL << 4) #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat btrfs_balance_flags[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_balance_flags[] = { XLAT_TYPE(uint64_t, BTRFS_BALANCE_DATA), XLAT_TYPE(uint64_t, BTRFS_BALANCE_SYSTEM), @@ -33,4 +59,6 @@ const struct xlat btrfs_balance_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_balance_state.h b/xlat/btrfs_balance_state.h index 64c8511c..1a14a03d 100644 --- a/xlat/btrfs_balance_state.h +++ b/xlat/btrfs_balance_state.h @@ -1,23 +1,41 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_balance_state.in; do not edit. */ -#if !(defined(BTRFS_BALANCE_STATE_RUNNING) || (defined(HAVE_DECL_BTRFS_BALANCE_STATE_RUNNING) && HAVE_DECL_BTRFS_BALANCE_STATE_RUNNING)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BTRFS_BALANCE_STATE_RUNNING) || (defined(HAVE_DECL_BTRFS_BALANCE_STATE_RUNNING) && HAVE_DECL_BTRFS_BALANCE_STATE_RUNNING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BALANCE_STATE_RUNNING) == ((1ULL << 0)), "BTRFS_BALANCE_STATE_RUNNING != (1ULL << 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BALANCE_STATE_RUNNING (1ULL << 0) #endif -#if !(defined(BTRFS_BALANCE_STATE_PAUSE_REQ) || (defined(HAVE_DECL_BTRFS_BALANCE_STATE_PAUSE_REQ) && HAVE_DECL_BTRFS_BALANCE_STATE_PAUSE_REQ)) +#if defined(BTRFS_BALANCE_STATE_PAUSE_REQ) || (defined(HAVE_DECL_BTRFS_BALANCE_STATE_PAUSE_REQ) && HAVE_DECL_BTRFS_BALANCE_STATE_PAUSE_REQ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BALANCE_STATE_PAUSE_REQ) == ((1ULL << 1)), "BTRFS_BALANCE_STATE_PAUSE_REQ != (1ULL << 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BALANCE_STATE_PAUSE_REQ (1ULL << 1) #endif -#if !(defined(BTRFS_BALANCE_STATE_CANCEL_REQ) || (defined(HAVE_DECL_BTRFS_BALANCE_STATE_CANCEL_REQ) && HAVE_DECL_BTRFS_BALANCE_STATE_CANCEL_REQ)) +#if defined(BTRFS_BALANCE_STATE_CANCEL_REQ) || (defined(HAVE_DECL_BTRFS_BALANCE_STATE_CANCEL_REQ) && HAVE_DECL_BTRFS_BALANCE_STATE_CANCEL_REQ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BALANCE_STATE_CANCEL_REQ) == ((1ULL << 2)), "BTRFS_BALANCE_STATE_CANCEL_REQ != (1ULL << 2)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BALANCE_STATE_CANCEL_REQ (1ULL << 2) #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat btrfs_balance_state[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_balance_state[] = { XLAT(BTRFS_BALANCE_STATE_RUNNING), XLAT(BTRFS_BALANCE_STATE_PAUSE_REQ), @@ -25,4 +43,6 @@ const struct xlat btrfs_balance_state[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_compress_types.h b/xlat/btrfs_compress_types.h index dd89c637..50fa15fc 100644 --- a/xlat/btrfs_compress_types.h +++ b/xlat/btrfs_compress_types.h @@ -1,23 +1,41 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_compress_types.in; do not edit. */ -#if !(defined(BTRFS_COMPRESS_NONE) || (defined(HAVE_DECL_BTRFS_COMPRESS_NONE) && HAVE_DECL_BTRFS_COMPRESS_NONE)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BTRFS_COMPRESS_NONE) || (defined(HAVE_DECL_BTRFS_COMPRESS_NONE) && HAVE_DECL_BTRFS_COMPRESS_NONE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_COMPRESS_NONE) == (0), "BTRFS_COMPRESS_NONE != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_COMPRESS_NONE 0 #endif -#if !(defined(BTRFS_COMPRESS_ZLIB) || (defined(HAVE_DECL_BTRFS_COMPRESS_ZLIB) && HAVE_DECL_BTRFS_COMPRESS_ZLIB)) +#if defined(BTRFS_COMPRESS_ZLIB) || (defined(HAVE_DECL_BTRFS_COMPRESS_ZLIB) && HAVE_DECL_BTRFS_COMPRESS_ZLIB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_COMPRESS_ZLIB) == (1), "BTRFS_COMPRESS_ZLIB != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_COMPRESS_ZLIB 1 #endif -#if !(defined(BTRFS_COMPRESS_LZO) || (defined(HAVE_DECL_BTRFS_COMPRESS_LZO) && HAVE_DECL_BTRFS_COMPRESS_LZO)) +#if defined(BTRFS_COMPRESS_LZO) || (defined(HAVE_DECL_BTRFS_COMPRESS_LZO) && HAVE_DECL_BTRFS_COMPRESS_LZO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_COMPRESS_LZO) == (2), "BTRFS_COMPRESS_LZO != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_COMPRESS_LZO 2 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat btrfs_compress_types[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_compress_types[] = { XLAT(BTRFS_COMPRESS_NONE), XLAT(BTRFS_COMPRESS_ZLIB), @@ -25,4 +43,6 @@ const struct xlat btrfs_compress_types[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_cont_reading_from_srcdev_mode.h b/xlat/btrfs_cont_reading_from_srcdev_mode.h new file mode 100644 index 00000000..4904e933 --- /dev/null +++ b/xlat/btrfs_cont_reading_from_srcdev_mode.h @@ -0,0 +1,40 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_cont_reading_from_srcdev_mode.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_ALWAYS) || (defined(HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_ALWAYS) && HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_ALWAYS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_ALWAYS) == (0), "BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_ALWAYS != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_ALWAYS 0 +#endif +#if defined(BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_AVOID) || (defined(HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_AVOID) && HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_AVOID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_AVOID) == (1), "BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_AVOID != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_AVOID 1 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +extern const struct xlat btrfs_cont_reading_from_srcdev_mode[]; + +# else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_cont_reading_from_srcdev_mode[] = { + XLAT(BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_ALWAYS), + XLAT(BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_AVOID), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_cont_reading_from_srcdev_mode.in b/xlat/btrfs_cont_reading_from_srcdev_mode.in new file mode 100644 index 00000000..0a1decfb --- /dev/null +++ b/xlat/btrfs_cont_reading_from_srcdev_mode.in @@ -0,0 +1,2 @@ +BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_ALWAYS 0 +BTRFS_IOCTL_DEV_REPLACE_CONT_READING_FROM_SRCDEV_MODE_AVOID 1 diff --git a/xlat/btrfs_defrag_flags.h b/xlat/btrfs_defrag_flags.h index 2990b21d..7fac3a4f 100644 --- a/xlat/btrfs_defrag_flags.h +++ b/xlat/btrfs_defrag_flags.h @@ -1,14 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_defrag_flags.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat btrfs_defrag_flags[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_defrag_flags[] = { #if defined(BTRFS_DEFRAG_RANGE_COMPRESS) || (defined(HAVE_DECL_BTRFS_DEFRAG_RANGE_COMPRESS) && HAVE_DECL_BTRFS_DEFRAG_RANGE_COMPRESS) XLAT_TYPE(uint64_t, BTRFS_DEFRAG_RANGE_COMPRESS), @@ -19,4 +25,6 @@ const struct xlat btrfs_defrag_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_dev_replace_cmds.h b/xlat/btrfs_dev_replace_cmds.h index 83bd044e..f612ebdf 100644 --- a/xlat/btrfs_dev_replace_cmds.h +++ b/xlat/btrfs_dev_replace_cmds.h @@ -1,14 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_dev_replace_cmds.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat btrfs_dev_replace_cmds[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_dev_replace_cmds[] = { #if defined(BTRFS_IOCTL_DEV_REPLACE_CMD_START) || (defined(HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_CMD_START) && HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_CMD_START) XLAT_TYPE(uint64_t, BTRFS_IOCTL_DEV_REPLACE_CMD_START), @@ -22,4 +28,6 @@ const struct xlat btrfs_dev_replace_cmds[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_dev_replace_results.h b/xlat/btrfs_dev_replace_results.h index 62fe4f8e..cf96f4f4 100644 --- a/xlat/btrfs_dev_replace_results.h +++ b/xlat/btrfs_dev_replace_results.h @@ -1,14 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_dev_replace_results.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat btrfs_dev_replace_results[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_dev_replace_results[] = { #if defined(BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR) || (defined(HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR) && HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR) XLAT_TYPE(uint64_t, BTRFS_IOCTL_DEV_REPLACE_RESULT_NO_ERROR), @@ -25,4 +31,6 @@ const struct xlat btrfs_dev_replace_results[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_dev_replace_state.h b/xlat/btrfs_dev_replace_state.h index 7095c1af..de5cf7bf 100644 --- a/xlat/btrfs_dev_replace_state.h +++ b/xlat/btrfs_dev_replace_state.h @@ -1,14 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_dev_replace_state.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat btrfs_dev_replace_state[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_dev_replace_state[] = { #if defined(BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED) || (defined(HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED) && HAVE_DECL_BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED) XLAT_TYPE(uint64_t, BTRFS_IOCTL_DEV_REPLACE_STATE_NEVER_STARTED), @@ -28,4 +34,6 @@ const struct xlat btrfs_dev_replace_state[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_dev_stats_flags.h b/xlat/btrfs_dev_stats_flags.h index 7bfbb092..29793e5f 100644 --- a/xlat/btrfs_dev_stats_flags.h +++ b/xlat/btrfs_dev_stats_flags.h @@ -1,14 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_dev_stats_flags.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat btrfs_dev_stats_flags[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_dev_stats_flags[] = { #if defined(BTRFS_DEV_STATS_RESET) || (defined(HAVE_DECL_BTRFS_DEV_STATS_RESET) && HAVE_DECL_BTRFS_DEV_STATS_RESET) XLAT_TYPE(uint64_t, BTRFS_DEV_STATS_RESET), @@ -16,4 +22,6 @@ const struct xlat btrfs_dev_stats_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_dev_stats_values.h b/xlat/btrfs_dev_stats_values.h index eaaeff0c..07150711 100644 --- a/xlat/btrfs_dev_stats_values.h +++ b/xlat/btrfs_dev_stats_values.h @@ -1,14 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_dev_stats_values.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat btrfs_dev_stats_values[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_dev_stats_values[] = { XLAT_TYPE(uint64_t, BTRFS_DEV_STAT_WRITE_ERRS), XLAT_TYPE(uint64_t, BTRFS_DEV_STAT_READ_ERRS), @@ -18,4 +24,6 @@ const struct xlat btrfs_dev_stats_values[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_features_compat.h b/xlat/btrfs_features_compat.h index d1e61d8e..754dc9e1 100644 --- a/xlat/btrfs_features_compat.h +++ b/xlat/btrfs_features_compat.h @@ -1,16 +1,24 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_features_compat.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat btrfs_features_compat[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_features_compat[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_features_compat_ro.h b/xlat/btrfs_features_compat_ro.h index 324324a2..348782ba 100644 --- a/xlat/btrfs_features_compat_ro.h +++ b/xlat/btrfs_features_compat_ro.h @@ -1,24 +1,40 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_features_compat_ro.in; do not edit. */ -#if !(defined(BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE) || (defined(HAVE_DECL_BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE) && HAVE_DECL_BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE) || (defined(HAVE_DECL_BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE) && HAVE_DECL_BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE) == ((1ULL << 0)), "BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE != (1ULL << 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE (1ULL << 0) #endif -#if !(defined(BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID) || (defined(HAVE_DECL_BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID) && HAVE_DECL_BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID)) +#if defined(BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID) || (defined(HAVE_DECL_BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID) && HAVE_DECL_BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID) == ((1ULL << 1)), "BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID != (1ULL << 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID (1ULL << 1) #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat btrfs_features_compat_ro[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_features_compat_ro[] = { XLAT_TYPE(uint64_t, BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE), XLAT_TYPE(uint64_t, BTRFS_FEATURE_COMPAT_RO_FREE_SPACE_TREE_VALID), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_features_incompat.h b/xlat/btrfs_features_incompat.h index b012f412..ce06f491 100644 --- a/xlat/btrfs_features_incompat.h +++ b/xlat/btrfs_features_incompat.h @@ -1,44 +1,97 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_features_incompat.in; do not edit. */ -#if !(defined(BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF) == ((1ULL << 0)), "BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF != (1ULL << 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF (1ULL << 0) #endif -#if !(defined(BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL)) +#if defined(BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL) == ((1ULL << 1)), "BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL != (1ULL << 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL (1ULL << 1) #endif -#if !(defined(BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS)) +#if defined(BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS) == ((1ULL << 2)), "BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS != (1ULL << 2)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_FEATURE_INCOMPAT_MIXED_GROUPS (1ULL << 2) #endif -#if !(defined(BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO)) +#if defined(BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO) == ((1ULL << 3)), "BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO != (1ULL << 3)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_FEATURE_INCOMPAT_COMPRESS_LZO (1ULL << 3) #endif -#if !(defined(BTRFS_FEATURE_INCOMPAT_COMPRESS_LZOv2) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_COMPRESS_LZOv2) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_COMPRESS_LZOv2)) +#if defined(BTRFS_FEATURE_INCOMPAT_COMPRESS_LZOv2) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_COMPRESS_LZOv2) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_COMPRESS_LZOv2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_FEATURE_INCOMPAT_COMPRESS_LZOv2) == ((1ULL << 4)), "BTRFS_FEATURE_INCOMPAT_COMPRESS_LZOv2 != (1ULL << 4)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_FEATURE_INCOMPAT_COMPRESS_LZOv2 (1ULL << 4) #endif -#if !(defined(BTRFS_FEATURE_INCOMPAT_BIG_METADATA) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_BIG_METADATA) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_BIG_METADATA)) +#if defined(BTRFS_FEATURE_INCOMPAT_BIG_METADATA) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_BIG_METADATA) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_BIG_METADATA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_FEATURE_INCOMPAT_BIG_METADATA) == ((1ULL << 5)), "BTRFS_FEATURE_INCOMPAT_BIG_METADATA != (1ULL << 5)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_FEATURE_INCOMPAT_BIG_METADATA (1ULL << 5) #endif -#if !(defined(BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF)) +#if defined(BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF) == ((1ULL << 6)), "BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF != (1ULL << 6)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF (1ULL << 6) #endif -#if !(defined(BTRFS_FEATURE_INCOMPAT_RAID56) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_RAID56) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_RAID56)) +#if defined(BTRFS_FEATURE_INCOMPAT_RAID56) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_RAID56) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_RAID56) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_FEATURE_INCOMPAT_RAID56) == ((1ULL << 7)), "BTRFS_FEATURE_INCOMPAT_RAID56 != (1ULL << 7)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_FEATURE_INCOMPAT_RAID56 (1ULL << 7) #endif -#if !(defined(BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA)) +#if defined(BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA) == ((1ULL << 8)), "BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA != (1ULL << 8)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA (1ULL << 8) #endif -#if !(defined(BTRFS_FEATURE_INCOMPAT_NO_HOLES) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_NO_HOLES) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_NO_HOLES)) +#if defined(BTRFS_FEATURE_INCOMPAT_NO_HOLES) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_NO_HOLES) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_NO_HOLES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_FEATURE_INCOMPAT_NO_HOLES) == ((1ULL << 9)), "BTRFS_FEATURE_INCOMPAT_NO_HOLES != (1ULL << 9)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_FEATURE_INCOMPAT_NO_HOLES (1ULL << 9) #endif +#if defined(BTRFS_FEATURE_INCOMPAT_METADATA_UUID) || (defined(HAVE_DECL_BTRFS_FEATURE_INCOMPAT_METADATA_UUID) && HAVE_DECL_BTRFS_FEATURE_INCOMPAT_METADATA_UUID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_FEATURE_INCOMPAT_METADATA_UUID) == ((1ULL << 10)), "BTRFS_FEATURE_INCOMPAT_METADATA_UUID != (1ULL << 10)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTRFS_FEATURE_INCOMPAT_METADATA_UUID (1ULL << 10) +#endif + +#ifndef XLAT_MACROS_ONLY -#ifdef IN_MPERS +# ifdef IN_MPERS extern const struct xlat btrfs_features_incompat[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_features_incompat[] = { XLAT_TYPE(uint64_t, BTRFS_FEATURE_INCOMPAT_MIXED_BACKREF), XLAT_TYPE(uint64_t, BTRFS_FEATURE_INCOMPAT_DEFAULT_SUBVOL), @@ -50,7 +103,10 @@ const struct xlat btrfs_features_incompat[] = { XLAT_TYPE(uint64_t, BTRFS_FEATURE_INCOMPAT_RAID56), XLAT_TYPE(uint64_t, BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA), XLAT_TYPE(uint64_t, BTRFS_FEATURE_INCOMPAT_NO_HOLES), + XLAT_TYPE(uint64_t, BTRFS_FEATURE_INCOMPAT_METADATA_UUID), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_features_incompat.in b/xlat/btrfs_features_incompat.in index 45baacf5..248772b5 100644 --- a/xlat/btrfs_features_incompat.in +++ b/xlat/btrfs_features_incompat.in @@ -9,3 +9,4 @@ BTRFS_FEATURE_INCOMPAT_EXTENDED_IREF (1ULL << 6) BTRFS_FEATURE_INCOMPAT_RAID56 (1ULL << 7) BTRFS_FEATURE_INCOMPAT_SKINNY_METADATA (1ULL << 8) BTRFS_FEATURE_INCOMPAT_NO_HOLES (1ULL << 9) +BTRFS_FEATURE_INCOMPAT_METADATA_UUID (1ULL << 10) diff --git a/xlat/btrfs_key_types.h b/xlat/btrfs_key_types.h index 1a72165e..71fcaba0 100644 --- a/xlat/btrfs_key_types.h +++ b/xlat/btrfs_key_types.h @@ -1,137 +1,307 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_key_types.in; do not edit. */ -#if !(defined(BTRFS_INODE_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_INODE_ITEM_KEY) && HAVE_DECL_BTRFS_INODE_ITEM_KEY)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BTRFS_INODE_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_INODE_ITEM_KEY) && HAVE_DECL_BTRFS_INODE_ITEM_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_INODE_ITEM_KEY) == (1), "BTRFS_INODE_ITEM_KEY != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_INODE_ITEM_KEY 1 #endif -#if !(defined(BTRFS_INODE_REF_KEY) || (defined(HAVE_DECL_BTRFS_INODE_REF_KEY) && HAVE_DECL_BTRFS_INODE_REF_KEY)) +#if defined(BTRFS_INODE_REF_KEY) || (defined(HAVE_DECL_BTRFS_INODE_REF_KEY) && HAVE_DECL_BTRFS_INODE_REF_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_INODE_REF_KEY) == (12), "BTRFS_INODE_REF_KEY != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_INODE_REF_KEY 12 #endif -#if !(defined(BTRFS_INODE_EXTREF_KEY) || (defined(HAVE_DECL_BTRFS_INODE_EXTREF_KEY) && HAVE_DECL_BTRFS_INODE_EXTREF_KEY)) +#if defined(BTRFS_INODE_EXTREF_KEY) || (defined(HAVE_DECL_BTRFS_INODE_EXTREF_KEY) && HAVE_DECL_BTRFS_INODE_EXTREF_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_INODE_EXTREF_KEY) == (13), "BTRFS_INODE_EXTREF_KEY != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_INODE_EXTREF_KEY 13 #endif -#if !(defined(BTRFS_XATTR_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_XATTR_ITEM_KEY) && HAVE_DECL_BTRFS_XATTR_ITEM_KEY)) +#if defined(BTRFS_XATTR_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_XATTR_ITEM_KEY) && HAVE_DECL_BTRFS_XATTR_ITEM_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_XATTR_ITEM_KEY) == (24), "BTRFS_XATTR_ITEM_KEY != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_XATTR_ITEM_KEY 24 #endif -#if !(defined(BTRFS_ORPHAN_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_ORPHAN_ITEM_KEY) && HAVE_DECL_BTRFS_ORPHAN_ITEM_KEY)) +#if defined(BTRFS_ORPHAN_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_ORPHAN_ITEM_KEY) && HAVE_DECL_BTRFS_ORPHAN_ITEM_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_ORPHAN_ITEM_KEY) == (48), "BTRFS_ORPHAN_ITEM_KEY != 48"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_ORPHAN_ITEM_KEY 48 #endif -#if !(defined(BTRFS_DIR_LOG_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_DIR_LOG_ITEM_KEY) && HAVE_DECL_BTRFS_DIR_LOG_ITEM_KEY)) +#if defined(BTRFS_DIR_LOG_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_DIR_LOG_ITEM_KEY) && HAVE_DECL_BTRFS_DIR_LOG_ITEM_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_DIR_LOG_ITEM_KEY) == (60), "BTRFS_DIR_LOG_ITEM_KEY != 60"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_DIR_LOG_ITEM_KEY 60 #endif -#if !(defined(BTRFS_DIR_LOG_INDEX_KEY) || (defined(HAVE_DECL_BTRFS_DIR_LOG_INDEX_KEY) && HAVE_DECL_BTRFS_DIR_LOG_INDEX_KEY)) +#if defined(BTRFS_DIR_LOG_INDEX_KEY) || (defined(HAVE_DECL_BTRFS_DIR_LOG_INDEX_KEY) && HAVE_DECL_BTRFS_DIR_LOG_INDEX_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_DIR_LOG_INDEX_KEY) == (72), "BTRFS_DIR_LOG_INDEX_KEY != 72"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_DIR_LOG_INDEX_KEY 72 #endif -#if !(defined(BTRFS_DIR_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_DIR_ITEM_KEY) && HAVE_DECL_BTRFS_DIR_ITEM_KEY)) +#if defined(BTRFS_DIR_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_DIR_ITEM_KEY) && HAVE_DECL_BTRFS_DIR_ITEM_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_DIR_ITEM_KEY) == (84), "BTRFS_DIR_ITEM_KEY != 84"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_DIR_ITEM_KEY 84 #endif -#if !(defined(BTRFS_DIR_INDEX_KEY) || (defined(HAVE_DECL_BTRFS_DIR_INDEX_KEY) && HAVE_DECL_BTRFS_DIR_INDEX_KEY)) +#if defined(BTRFS_DIR_INDEX_KEY) || (defined(HAVE_DECL_BTRFS_DIR_INDEX_KEY) && HAVE_DECL_BTRFS_DIR_INDEX_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_DIR_INDEX_KEY) == (96), "BTRFS_DIR_INDEX_KEY != 96"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_DIR_INDEX_KEY 96 #endif -#if !(defined(BTRFS_EXTENT_DATA_KEY) || (defined(HAVE_DECL_BTRFS_EXTENT_DATA_KEY) && HAVE_DECL_BTRFS_EXTENT_DATA_KEY)) +#if defined(BTRFS_EXTENT_DATA_KEY) || (defined(HAVE_DECL_BTRFS_EXTENT_DATA_KEY) && HAVE_DECL_BTRFS_EXTENT_DATA_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_EXTENT_DATA_KEY) == (108), "BTRFS_EXTENT_DATA_KEY != 108"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_EXTENT_DATA_KEY 108 #endif -#if !(defined(BTRFS_EXTENT_CSUM_KEY) || (defined(HAVE_DECL_BTRFS_EXTENT_CSUM_KEY) && HAVE_DECL_BTRFS_EXTENT_CSUM_KEY)) +#if defined(BTRFS_EXTENT_CSUM_KEY) || (defined(HAVE_DECL_BTRFS_EXTENT_CSUM_KEY) && HAVE_DECL_BTRFS_EXTENT_CSUM_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_EXTENT_CSUM_KEY) == (128), "BTRFS_EXTENT_CSUM_KEY != 128"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_EXTENT_CSUM_KEY 128 #endif -#if !(defined(BTRFS_ROOT_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_ROOT_ITEM_KEY) && HAVE_DECL_BTRFS_ROOT_ITEM_KEY)) +#if defined(BTRFS_ROOT_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_ROOT_ITEM_KEY) && HAVE_DECL_BTRFS_ROOT_ITEM_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_ROOT_ITEM_KEY) == (132), "BTRFS_ROOT_ITEM_KEY != 132"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_ROOT_ITEM_KEY 132 #endif -#if !(defined(BTRFS_ROOT_BACKREF_KEY) || (defined(HAVE_DECL_BTRFS_ROOT_BACKREF_KEY) && HAVE_DECL_BTRFS_ROOT_BACKREF_KEY)) +#if defined(BTRFS_ROOT_BACKREF_KEY) || (defined(HAVE_DECL_BTRFS_ROOT_BACKREF_KEY) && HAVE_DECL_BTRFS_ROOT_BACKREF_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_ROOT_BACKREF_KEY) == (144), "BTRFS_ROOT_BACKREF_KEY != 144"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_ROOT_BACKREF_KEY 144 #endif -#if !(defined(BTRFS_ROOT_REF_KEY) || (defined(HAVE_DECL_BTRFS_ROOT_REF_KEY) && HAVE_DECL_BTRFS_ROOT_REF_KEY)) +#if defined(BTRFS_ROOT_REF_KEY) || (defined(HAVE_DECL_BTRFS_ROOT_REF_KEY) && HAVE_DECL_BTRFS_ROOT_REF_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_ROOT_REF_KEY) == (156), "BTRFS_ROOT_REF_KEY != 156"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_ROOT_REF_KEY 156 #endif -#if !(defined(BTRFS_EXTENT_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_EXTENT_ITEM_KEY) && HAVE_DECL_BTRFS_EXTENT_ITEM_KEY)) +#if defined(BTRFS_EXTENT_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_EXTENT_ITEM_KEY) && HAVE_DECL_BTRFS_EXTENT_ITEM_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_EXTENT_ITEM_KEY) == (168), "BTRFS_EXTENT_ITEM_KEY != 168"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_EXTENT_ITEM_KEY 168 #endif -#if !(defined(BTRFS_METADATA_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_METADATA_ITEM_KEY) && HAVE_DECL_BTRFS_METADATA_ITEM_KEY)) +#if defined(BTRFS_METADATA_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_METADATA_ITEM_KEY) && HAVE_DECL_BTRFS_METADATA_ITEM_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_METADATA_ITEM_KEY) == (169), "BTRFS_METADATA_ITEM_KEY != 169"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_METADATA_ITEM_KEY 169 #endif -#if !(defined(BTRFS_TREE_BLOCK_REF_KEY) || (defined(HAVE_DECL_BTRFS_TREE_BLOCK_REF_KEY) && HAVE_DECL_BTRFS_TREE_BLOCK_REF_KEY)) +#if defined(BTRFS_TREE_BLOCK_REF_KEY) || (defined(HAVE_DECL_BTRFS_TREE_BLOCK_REF_KEY) && HAVE_DECL_BTRFS_TREE_BLOCK_REF_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_TREE_BLOCK_REF_KEY) == (176), "BTRFS_TREE_BLOCK_REF_KEY != 176"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_TREE_BLOCK_REF_KEY 176 #endif -#if !(defined(BTRFS_EXTENT_DATA_REF_KEY) || (defined(HAVE_DECL_BTRFS_EXTENT_DATA_REF_KEY) && HAVE_DECL_BTRFS_EXTENT_DATA_REF_KEY)) +#if defined(BTRFS_EXTENT_DATA_REF_KEY) || (defined(HAVE_DECL_BTRFS_EXTENT_DATA_REF_KEY) && HAVE_DECL_BTRFS_EXTENT_DATA_REF_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_EXTENT_DATA_REF_KEY) == (178), "BTRFS_EXTENT_DATA_REF_KEY != 178"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_EXTENT_DATA_REF_KEY 178 #endif -#if !(defined(BTRFS_EXTENT_REF_V0_KEY) || (defined(HAVE_DECL_BTRFS_EXTENT_REF_V0_KEY) && HAVE_DECL_BTRFS_EXTENT_REF_V0_KEY)) +#if defined(BTRFS_EXTENT_REF_V0_KEY) || (defined(HAVE_DECL_BTRFS_EXTENT_REF_V0_KEY) && HAVE_DECL_BTRFS_EXTENT_REF_V0_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_EXTENT_REF_V0_KEY) == (180), "BTRFS_EXTENT_REF_V0_KEY != 180"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_EXTENT_REF_V0_KEY 180 #endif -#if !(defined(BTRFS_SHARED_BLOCK_REF_KEY) || (defined(HAVE_DECL_BTRFS_SHARED_BLOCK_REF_KEY) && HAVE_DECL_BTRFS_SHARED_BLOCK_REF_KEY)) +#if defined(BTRFS_SHARED_BLOCK_REF_KEY) || (defined(HAVE_DECL_BTRFS_SHARED_BLOCK_REF_KEY) && HAVE_DECL_BTRFS_SHARED_BLOCK_REF_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_SHARED_BLOCK_REF_KEY) == (182), "BTRFS_SHARED_BLOCK_REF_KEY != 182"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_SHARED_BLOCK_REF_KEY 182 #endif -#if !(defined(BTRFS_SHARED_DATA_REF_KEY) || (defined(HAVE_DECL_BTRFS_SHARED_DATA_REF_KEY) && HAVE_DECL_BTRFS_SHARED_DATA_REF_KEY)) +#if defined(BTRFS_SHARED_DATA_REF_KEY) || (defined(HAVE_DECL_BTRFS_SHARED_DATA_REF_KEY) && HAVE_DECL_BTRFS_SHARED_DATA_REF_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_SHARED_DATA_REF_KEY) == (184), "BTRFS_SHARED_DATA_REF_KEY != 184"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_SHARED_DATA_REF_KEY 184 #endif -#if !(defined(BTRFS_BLOCK_GROUP_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_ITEM_KEY) && HAVE_DECL_BTRFS_BLOCK_GROUP_ITEM_KEY)) +#if defined(BTRFS_BLOCK_GROUP_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_ITEM_KEY) && HAVE_DECL_BTRFS_BLOCK_GROUP_ITEM_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BLOCK_GROUP_ITEM_KEY) == (192), "BTRFS_BLOCK_GROUP_ITEM_KEY != 192"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BLOCK_GROUP_ITEM_KEY 192 #endif -#if !(defined(BTRFS_FREE_SPACE_INFO_KEY) || (defined(HAVE_DECL_BTRFS_FREE_SPACE_INFO_KEY) && HAVE_DECL_BTRFS_FREE_SPACE_INFO_KEY)) +#if defined(BTRFS_FREE_SPACE_INFO_KEY) || (defined(HAVE_DECL_BTRFS_FREE_SPACE_INFO_KEY) && HAVE_DECL_BTRFS_FREE_SPACE_INFO_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_FREE_SPACE_INFO_KEY) == (198), "BTRFS_FREE_SPACE_INFO_KEY != 198"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_FREE_SPACE_INFO_KEY 198 #endif -#if !(defined(BTRFS_FREE_SPACE_EXTENT_KEY) || (defined(HAVE_DECL_BTRFS_FREE_SPACE_EXTENT_KEY) && HAVE_DECL_BTRFS_FREE_SPACE_EXTENT_KEY)) +#if defined(BTRFS_FREE_SPACE_EXTENT_KEY) || (defined(HAVE_DECL_BTRFS_FREE_SPACE_EXTENT_KEY) && HAVE_DECL_BTRFS_FREE_SPACE_EXTENT_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_FREE_SPACE_EXTENT_KEY) == (199), "BTRFS_FREE_SPACE_EXTENT_KEY != 199"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_FREE_SPACE_EXTENT_KEY 199 #endif -#if !(defined(BTRFS_FREE_SPACE_BITMAP_KEY) || (defined(HAVE_DECL_BTRFS_FREE_SPACE_BITMAP_KEY) && HAVE_DECL_BTRFS_FREE_SPACE_BITMAP_KEY)) +#if defined(BTRFS_FREE_SPACE_BITMAP_KEY) || (defined(HAVE_DECL_BTRFS_FREE_SPACE_BITMAP_KEY) && HAVE_DECL_BTRFS_FREE_SPACE_BITMAP_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_FREE_SPACE_BITMAP_KEY) == (200), "BTRFS_FREE_SPACE_BITMAP_KEY != 200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_FREE_SPACE_BITMAP_KEY 200 #endif -#if !(defined(BTRFS_DEV_EXTENT_KEY) || (defined(HAVE_DECL_BTRFS_DEV_EXTENT_KEY) && HAVE_DECL_BTRFS_DEV_EXTENT_KEY)) +#if defined(BTRFS_DEV_EXTENT_KEY) || (defined(HAVE_DECL_BTRFS_DEV_EXTENT_KEY) && HAVE_DECL_BTRFS_DEV_EXTENT_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_DEV_EXTENT_KEY) == (204), "BTRFS_DEV_EXTENT_KEY != 204"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_DEV_EXTENT_KEY 204 #endif -#if !(defined(BTRFS_DEV_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_DEV_ITEM_KEY) && HAVE_DECL_BTRFS_DEV_ITEM_KEY)) +#if defined(BTRFS_DEV_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_DEV_ITEM_KEY) && HAVE_DECL_BTRFS_DEV_ITEM_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_DEV_ITEM_KEY) == (216), "BTRFS_DEV_ITEM_KEY != 216"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_DEV_ITEM_KEY 216 #endif -#if !(defined(BTRFS_CHUNK_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_CHUNK_ITEM_KEY) && HAVE_DECL_BTRFS_CHUNK_ITEM_KEY)) +#if defined(BTRFS_CHUNK_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_CHUNK_ITEM_KEY) && HAVE_DECL_BTRFS_CHUNK_ITEM_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_CHUNK_ITEM_KEY) == (228), "BTRFS_CHUNK_ITEM_KEY != 228"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_CHUNK_ITEM_KEY 228 #endif -#if !(defined(BTRFS_QGROUP_STATUS_KEY) || (defined(HAVE_DECL_BTRFS_QGROUP_STATUS_KEY) && HAVE_DECL_BTRFS_QGROUP_STATUS_KEY)) +#if defined(BTRFS_QGROUP_STATUS_KEY) || (defined(HAVE_DECL_BTRFS_QGROUP_STATUS_KEY) && HAVE_DECL_BTRFS_QGROUP_STATUS_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_QGROUP_STATUS_KEY) == (240), "BTRFS_QGROUP_STATUS_KEY != 240"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_QGROUP_STATUS_KEY 240 #endif -#if !(defined(BTRFS_QGROUP_INFO_KEY) || (defined(HAVE_DECL_BTRFS_QGROUP_INFO_KEY) && HAVE_DECL_BTRFS_QGROUP_INFO_KEY)) +#if defined(BTRFS_QGROUP_INFO_KEY) || (defined(HAVE_DECL_BTRFS_QGROUP_INFO_KEY) && HAVE_DECL_BTRFS_QGROUP_INFO_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_QGROUP_INFO_KEY) == (242), "BTRFS_QGROUP_INFO_KEY != 242"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_QGROUP_INFO_KEY 242 #endif -#if !(defined(BTRFS_QGROUP_LIMIT_KEY) || (defined(HAVE_DECL_BTRFS_QGROUP_LIMIT_KEY) && HAVE_DECL_BTRFS_QGROUP_LIMIT_KEY)) +#if defined(BTRFS_QGROUP_LIMIT_KEY) || (defined(HAVE_DECL_BTRFS_QGROUP_LIMIT_KEY) && HAVE_DECL_BTRFS_QGROUP_LIMIT_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_QGROUP_LIMIT_KEY) == (244), "BTRFS_QGROUP_LIMIT_KEY != 244"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_QGROUP_LIMIT_KEY 244 #endif -#if !(defined(BTRFS_QGROUP_RELATION_KEY) || (defined(HAVE_DECL_BTRFS_QGROUP_RELATION_KEY) && HAVE_DECL_BTRFS_QGROUP_RELATION_KEY)) +#if defined(BTRFS_QGROUP_RELATION_KEY) || (defined(HAVE_DECL_BTRFS_QGROUP_RELATION_KEY) && HAVE_DECL_BTRFS_QGROUP_RELATION_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_QGROUP_RELATION_KEY) == (246), "BTRFS_QGROUP_RELATION_KEY != 246"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_QGROUP_RELATION_KEY 246 #endif -#if !(defined(BTRFS_BALANCE_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_BALANCE_ITEM_KEY) && HAVE_DECL_BTRFS_BALANCE_ITEM_KEY)) +#if defined(BTRFS_BALANCE_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_BALANCE_ITEM_KEY) && HAVE_DECL_BTRFS_BALANCE_ITEM_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BALANCE_ITEM_KEY) == (248), "BTRFS_BALANCE_ITEM_KEY != 248"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BALANCE_ITEM_KEY 248 #endif -#if !(defined(BTRFS_TEMPORARY_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_TEMPORARY_ITEM_KEY) && HAVE_DECL_BTRFS_TEMPORARY_ITEM_KEY)) +#if defined(BTRFS_TEMPORARY_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_TEMPORARY_ITEM_KEY) && HAVE_DECL_BTRFS_TEMPORARY_ITEM_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_TEMPORARY_ITEM_KEY) == (248), "BTRFS_TEMPORARY_ITEM_KEY != 248"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_TEMPORARY_ITEM_KEY 248 #endif -#if !(defined(BTRFS_DEV_STATS_KEY) || (defined(HAVE_DECL_BTRFS_DEV_STATS_KEY) && HAVE_DECL_BTRFS_DEV_STATS_KEY)) +#if defined(BTRFS_DEV_STATS_KEY) || (defined(HAVE_DECL_BTRFS_DEV_STATS_KEY) && HAVE_DECL_BTRFS_DEV_STATS_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_DEV_STATS_KEY) == (249), "BTRFS_DEV_STATS_KEY != 249"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_DEV_STATS_KEY 249 #endif -#if !(defined(BTRFS_PERSISTENT_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_PERSISTENT_ITEM_KEY) && HAVE_DECL_BTRFS_PERSISTENT_ITEM_KEY)) +#if defined(BTRFS_PERSISTENT_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_PERSISTENT_ITEM_KEY) && HAVE_DECL_BTRFS_PERSISTENT_ITEM_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_PERSISTENT_ITEM_KEY) == (249), "BTRFS_PERSISTENT_ITEM_KEY != 249"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_PERSISTENT_ITEM_KEY 249 #endif -#if !(defined(BTRFS_DEV_REPLACE_KEY) || (defined(HAVE_DECL_BTRFS_DEV_REPLACE_KEY) && HAVE_DECL_BTRFS_DEV_REPLACE_KEY)) +#if defined(BTRFS_DEV_REPLACE_KEY) || (defined(HAVE_DECL_BTRFS_DEV_REPLACE_KEY) && HAVE_DECL_BTRFS_DEV_REPLACE_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_DEV_REPLACE_KEY) == (250), "BTRFS_DEV_REPLACE_KEY != 250"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_DEV_REPLACE_KEY 250 #endif -#if !(defined(BTRFS_UUID_KEY_SUBVOL) || (defined(HAVE_DECL_BTRFS_UUID_KEY_SUBVOL) && HAVE_DECL_BTRFS_UUID_KEY_SUBVOL)) +#if defined(BTRFS_UUID_KEY_SUBVOL) || (defined(HAVE_DECL_BTRFS_UUID_KEY_SUBVOL) && HAVE_DECL_BTRFS_UUID_KEY_SUBVOL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_UUID_KEY_SUBVOL) == (251), "BTRFS_UUID_KEY_SUBVOL != 251"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_UUID_KEY_SUBVOL 251 #endif -#if !(defined(BTRFS_UUID_KEY_RECEIVED_SUBVOL) || (defined(HAVE_DECL_BTRFS_UUID_KEY_RECEIVED_SUBVOL) && HAVE_DECL_BTRFS_UUID_KEY_RECEIVED_SUBVOL)) +#if defined(BTRFS_UUID_KEY_RECEIVED_SUBVOL) || (defined(HAVE_DECL_BTRFS_UUID_KEY_RECEIVED_SUBVOL) && HAVE_DECL_BTRFS_UUID_KEY_RECEIVED_SUBVOL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_UUID_KEY_RECEIVED_SUBVOL) == (252), "BTRFS_UUID_KEY_RECEIVED_SUBVOL != 252"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_UUID_KEY_RECEIVED_SUBVOL 252 #endif -#if !(defined(BTRFS_STRING_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_STRING_ITEM_KEY) && HAVE_DECL_BTRFS_STRING_ITEM_KEY)) +#if defined(BTRFS_STRING_ITEM_KEY) || (defined(HAVE_DECL_BTRFS_STRING_ITEM_KEY) && HAVE_DECL_BTRFS_STRING_ITEM_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_STRING_ITEM_KEY) == (253), "BTRFS_STRING_ITEM_KEY != 253"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_STRING_ITEM_KEY 253 #endif -#if !(defined(UINT32_MAX) || (defined(HAVE_DECL_UINT32_MAX) && HAVE_DECL_UINT32_MAX)) +#if defined(UINT32_MAX) || (defined(HAVE_DECL_UINT32_MAX) && HAVE_DECL_UINT32_MAX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((UINT32_MAX) == (-1U), "UINT32_MAX != -1U"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define UINT32_MAX -1U #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat btrfs_key_types[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_key_types[] = { XLAT_TYPE(uint64_t, BTRFS_INODE_ITEM_KEY), XLAT_TYPE(uint64_t, BTRFS_INODE_REF_KEY), @@ -177,4 +347,6 @@ const struct xlat btrfs_key_types[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_logical_ino_args_flags.h b/xlat/btrfs_logical_ino_args_flags.h new file mode 100644 index 00000000..ca969b76 --- /dev/null +++ b/xlat/btrfs_logical_ino_args_flags.h @@ -0,0 +1,32 @@ +/* Generated by ./xlat/gen.sh from ./xlat/btrfs_logical_ino_args_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET) || (defined(HAVE_DECL_BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET) && HAVE_DECL_BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET) == ((1ULL << 0)), "BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET != (1ULL << 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET (1ULL << 0) +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +extern const struct xlat btrfs_logical_ino_args_flags[]; + +# else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat btrfs_logical_ino_args_flags[] = { + XLAT(BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_logical_ino_args_flags.in b/xlat/btrfs_logical_ino_args_flags.in new file mode 100644 index 00000000..5eea6c24 --- /dev/null +++ b/xlat/btrfs_logical_ino_args_flags.in @@ -0,0 +1 @@ +BTRFS_LOGICAL_INO_ARGS_IGNORE_OFFSET (1ULL << 0) diff --git a/xlat/btrfs_qgroup_ctl_cmds.h b/xlat/btrfs_qgroup_ctl_cmds.h index 25bdce2f..932f7274 100644 --- a/xlat/btrfs_qgroup_ctl_cmds.h +++ b/xlat/btrfs_qgroup_ctl_cmds.h @@ -1,14 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_qgroup_ctl_cmds.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat btrfs_qgroup_ctl_cmds[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_qgroup_ctl_cmds[] = { #if defined(BTRFS_QUOTA_CTL_ENABLE) || (defined(HAVE_DECL_BTRFS_QUOTA_CTL_ENABLE) && HAVE_DECL_BTRFS_QUOTA_CTL_ENABLE) XLAT_TYPE(uint64_t, BTRFS_QUOTA_CTL_ENABLE), @@ -22,4 +28,6 @@ const struct xlat btrfs_qgroup_ctl_cmds[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_qgroup_inherit_flags.h b/xlat/btrfs_qgroup_inherit_flags.h index ead56ea2..5f8d2f2d 100644 --- a/xlat/btrfs_qgroup_inherit_flags.h +++ b/xlat/btrfs_qgroup_inherit_flags.h @@ -1,14 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_qgroup_inherit_flags.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat btrfs_qgroup_inherit_flags[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_qgroup_inherit_flags[] = { #if defined(BTRFS_QGROUP_INHERIT_SET_LIMITS) || (defined(HAVE_DECL_BTRFS_QGROUP_INHERIT_SET_LIMITS) && HAVE_DECL_BTRFS_QGROUP_INHERIT_SET_LIMITS) XLAT_TYPE(uint64_t, BTRFS_QGROUP_INHERIT_SET_LIMITS), @@ -16,4 +22,6 @@ const struct xlat btrfs_qgroup_inherit_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_qgroup_limit_flags.h b/xlat/btrfs_qgroup_limit_flags.h index 114c8760..5932d120 100644 --- a/xlat/btrfs_qgroup_limit_flags.h +++ b/xlat/btrfs_qgroup_limit_flags.h @@ -1,32 +1,62 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_qgroup_limit_flags.in; do not edit. */ -#if !(defined(BTRFS_QGROUP_LIMIT_MAX_RFER) || (defined(HAVE_DECL_BTRFS_QGROUP_LIMIT_MAX_RFER) && HAVE_DECL_BTRFS_QGROUP_LIMIT_MAX_RFER)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BTRFS_QGROUP_LIMIT_MAX_RFER) || (defined(HAVE_DECL_BTRFS_QGROUP_LIMIT_MAX_RFER) && HAVE_DECL_BTRFS_QGROUP_LIMIT_MAX_RFER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_QGROUP_LIMIT_MAX_RFER) == ((1ULL << 0)), "BTRFS_QGROUP_LIMIT_MAX_RFER != (1ULL << 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_QGROUP_LIMIT_MAX_RFER (1ULL << 0) #endif -#if !(defined(BTRFS_QGROUP_LIMIT_MAX_EXCL) || (defined(HAVE_DECL_BTRFS_QGROUP_LIMIT_MAX_EXCL) && HAVE_DECL_BTRFS_QGROUP_LIMIT_MAX_EXCL)) +#if defined(BTRFS_QGROUP_LIMIT_MAX_EXCL) || (defined(HAVE_DECL_BTRFS_QGROUP_LIMIT_MAX_EXCL) && HAVE_DECL_BTRFS_QGROUP_LIMIT_MAX_EXCL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_QGROUP_LIMIT_MAX_EXCL) == ((1ULL << 1)), "BTRFS_QGROUP_LIMIT_MAX_EXCL != (1ULL << 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_QGROUP_LIMIT_MAX_EXCL (1ULL << 1) #endif -#if !(defined(BTRFS_QGROUP_LIMIT_RSV_RFER) || (defined(HAVE_DECL_BTRFS_QGROUP_LIMIT_RSV_RFER) && HAVE_DECL_BTRFS_QGROUP_LIMIT_RSV_RFER)) +#if defined(BTRFS_QGROUP_LIMIT_RSV_RFER) || (defined(HAVE_DECL_BTRFS_QGROUP_LIMIT_RSV_RFER) && HAVE_DECL_BTRFS_QGROUP_LIMIT_RSV_RFER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_QGROUP_LIMIT_RSV_RFER) == ((1ULL << 2)), "BTRFS_QGROUP_LIMIT_RSV_RFER != (1ULL << 2)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_QGROUP_LIMIT_RSV_RFER (1ULL << 2) #endif -#if !(defined(BTRFS_QGROUP_LIMIT_RSV_EXCL) || (defined(HAVE_DECL_BTRFS_QGROUP_LIMIT_RSV_EXCL) && HAVE_DECL_BTRFS_QGROUP_LIMIT_RSV_EXCL)) +#if defined(BTRFS_QGROUP_LIMIT_RSV_EXCL) || (defined(HAVE_DECL_BTRFS_QGROUP_LIMIT_RSV_EXCL) && HAVE_DECL_BTRFS_QGROUP_LIMIT_RSV_EXCL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_QGROUP_LIMIT_RSV_EXCL) == ((1ULL << 3)), "BTRFS_QGROUP_LIMIT_RSV_EXCL != (1ULL << 3)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_QGROUP_LIMIT_RSV_EXCL (1ULL << 3) #endif -#if !(defined(BTRFS_QGROUP_LIMIT_RFER_CMPR) || (defined(HAVE_DECL_BTRFS_QGROUP_LIMIT_RFER_CMPR) && HAVE_DECL_BTRFS_QGROUP_LIMIT_RFER_CMPR)) +#if defined(BTRFS_QGROUP_LIMIT_RFER_CMPR) || (defined(HAVE_DECL_BTRFS_QGROUP_LIMIT_RFER_CMPR) && HAVE_DECL_BTRFS_QGROUP_LIMIT_RFER_CMPR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_QGROUP_LIMIT_RFER_CMPR) == ((1ULL << 4)), "BTRFS_QGROUP_LIMIT_RFER_CMPR != (1ULL << 4)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_QGROUP_LIMIT_RFER_CMPR (1ULL << 4) #endif -#if !(defined(BTRFS_QGROUP_LIMIT_EXCL_CMPR) || (defined(HAVE_DECL_BTRFS_QGROUP_LIMIT_EXCL_CMPR) && HAVE_DECL_BTRFS_QGROUP_LIMIT_EXCL_CMPR)) +#if defined(BTRFS_QGROUP_LIMIT_EXCL_CMPR) || (defined(HAVE_DECL_BTRFS_QGROUP_LIMIT_EXCL_CMPR) && HAVE_DECL_BTRFS_QGROUP_LIMIT_EXCL_CMPR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_QGROUP_LIMIT_EXCL_CMPR) == ((1ULL << 5)), "BTRFS_QGROUP_LIMIT_EXCL_CMPR != (1ULL << 5)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_QGROUP_LIMIT_EXCL_CMPR (1ULL << 5) #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat btrfs_qgroup_limit_flags[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_qgroup_limit_flags[] = { XLAT_TYPE(uint64_t, BTRFS_QGROUP_LIMIT_MAX_RFER), XLAT_TYPE(uint64_t, BTRFS_QGROUP_LIMIT_MAX_EXCL), @@ -37,4 +67,6 @@ const struct xlat btrfs_qgroup_limit_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_qgroup_status_flags.h b/xlat/btrfs_qgroup_status_flags.h index d02a86bd..252ef61e 100644 --- a/xlat/btrfs_qgroup_status_flags.h +++ b/xlat/btrfs_qgroup_status_flags.h @@ -1,24 +1,40 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_qgroup_status_flags.in; do not edit. */ -#if !(defined(BTRFS_QGROUP_STATUS_FLAG_ON) || (defined(HAVE_DECL_BTRFS_QGROUP_STATUS_FLAG_ON) && HAVE_DECL_BTRFS_QGROUP_STATUS_FLAG_ON)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BTRFS_QGROUP_STATUS_FLAG_ON) || (defined(HAVE_DECL_BTRFS_QGROUP_STATUS_FLAG_ON) && HAVE_DECL_BTRFS_QGROUP_STATUS_FLAG_ON) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_QGROUP_STATUS_FLAG_ON) == ((1ULL << 0)), "BTRFS_QGROUP_STATUS_FLAG_ON != (1ULL << 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_QGROUP_STATUS_FLAG_ON (1ULL << 0) #endif -#if !(defined(BTRFS_QGROUP_STATUS_FLAG_RESCAN) || (defined(HAVE_DECL_BTRFS_QGROUP_STATUS_FLAG_RESCAN) && HAVE_DECL_BTRFS_QGROUP_STATUS_FLAG_RESCAN)) +#if defined(BTRFS_QGROUP_STATUS_FLAG_RESCAN) || (defined(HAVE_DECL_BTRFS_QGROUP_STATUS_FLAG_RESCAN) && HAVE_DECL_BTRFS_QGROUP_STATUS_FLAG_RESCAN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_QGROUP_STATUS_FLAG_RESCAN) == ((1ULL << 1)), "BTRFS_QGROUP_STATUS_FLAG_RESCAN != (1ULL << 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_QGROUP_STATUS_FLAG_RESCAN (1ULL << 1) #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat btrfs_qgroup_status_flags[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_qgroup_status_flags[] = { XLAT_TYPE(uint64_t, BTRFS_QGROUP_STATUS_FLAG_ON), XLAT_TYPE(uint64_t, BTRFS_QGROUP_STATUS_FLAG_RESCAN), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_scrub_flags.h b/xlat/btrfs_scrub_flags.h index 5823e347..b5964763 100644 --- a/xlat/btrfs_scrub_flags.h +++ b/xlat/btrfs_scrub_flags.h @@ -1,20 +1,32 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_scrub_flags.in; do not edit. */ -#if !(defined(BTRFS_SCRUB_READONLY) || (defined(HAVE_DECL_BTRFS_SCRUB_READONLY) && HAVE_DECL_BTRFS_SCRUB_READONLY)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BTRFS_SCRUB_READONLY) || (defined(HAVE_DECL_BTRFS_SCRUB_READONLY) && HAVE_DECL_BTRFS_SCRUB_READONLY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_SCRUB_READONLY) == (1), "BTRFS_SCRUB_READONLY != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_SCRUB_READONLY 1 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat btrfs_scrub_flags[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_scrub_flags[] = { XLAT_TYPE(uint64_t, BTRFS_SCRUB_READONLY), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_send_flags.h b/xlat/btrfs_send_flags.h index be2b02a6..a357f71e 100644 --- a/xlat/btrfs_send_flags.h +++ b/xlat/btrfs_send_flags.h @@ -1,23 +1,41 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_send_flags.in; do not edit. */ -#if !(defined(BTRFS_SEND_FLAG_NO_FILE_DATA) || (defined(HAVE_DECL_BTRFS_SEND_FLAG_NO_FILE_DATA) && HAVE_DECL_BTRFS_SEND_FLAG_NO_FILE_DATA)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BTRFS_SEND_FLAG_NO_FILE_DATA) || (defined(HAVE_DECL_BTRFS_SEND_FLAG_NO_FILE_DATA) && HAVE_DECL_BTRFS_SEND_FLAG_NO_FILE_DATA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_SEND_FLAG_NO_FILE_DATA) == (0x1), "BTRFS_SEND_FLAG_NO_FILE_DATA != 0x1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_SEND_FLAG_NO_FILE_DATA 0x1 #endif -#if !(defined(BTRFS_SEND_FLAG_OMIT_STREAM_HEADER) || (defined(HAVE_DECL_BTRFS_SEND_FLAG_OMIT_STREAM_HEADER) && HAVE_DECL_BTRFS_SEND_FLAG_OMIT_STREAM_HEADER)) +#if defined(BTRFS_SEND_FLAG_OMIT_STREAM_HEADER) || (defined(HAVE_DECL_BTRFS_SEND_FLAG_OMIT_STREAM_HEADER) && HAVE_DECL_BTRFS_SEND_FLAG_OMIT_STREAM_HEADER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_SEND_FLAG_OMIT_STREAM_HEADER) == (0x2), "BTRFS_SEND_FLAG_OMIT_STREAM_HEADER != 0x2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_SEND_FLAG_OMIT_STREAM_HEADER 0x2 #endif -#if !(defined(BTRFS_SEND_FLAG_OMIT_END_CMD) || (defined(HAVE_DECL_BTRFS_SEND_FLAG_OMIT_END_CMD) && HAVE_DECL_BTRFS_SEND_FLAG_OMIT_END_CMD)) +#if defined(BTRFS_SEND_FLAG_OMIT_END_CMD) || (defined(HAVE_DECL_BTRFS_SEND_FLAG_OMIT_END_CMD) && HAVE_DECL_BTRFS_SEND_FLAG_OMIT_END_CMD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_SEND_FLAG_OMIT_END_CMD) == (0x4), "BTRFS_SEND_FLAG_OMIT_END_CMD != 0x4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_SEND_FLAG_OMIT_END_CMD 0x4 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat btrfs_send_flags[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_send_flags[] = { XLAT(BTRFS_SEND_FLAG_NO_FILE_DATA), XLAT(BTRFS_SEND_FLAG_OMIT_STREAM_HEADER), @@ -25,4 +43,6 @@ const struct xlat btrfs_send_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_snap_flags_v2.h b/xlat/btrfs_snap_flags_v2.h index 42088520..00fd6809 100644 --- a/xlat/btrfs_snap_flags_v2.h +++ b/xlat/btrfs_snap_flags_v2.h @@ -1,14 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_snap_flags_v2.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat btrfs_snap_flags_v2[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_snap_flags_v2[] = { #if defined(BTRFS_SUBVOL_CREATE_ASYNC) || (defined(HAVE_DECL_BTRFS_SUBVOL_CREATE_ASYNC) && HAVE_DECL_BTRFS_SUBVOL_CREATE_ASYNC) XLAT_TYPE(uint64_t, BTRFS_SUBVOL_CREATE_ASYNC), @@ -22,4 +28,6 @@ const struct xlat btrfs_snap_flags_v2[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_space_info_flags.h b/xlat/btrfs_space_info_flags.h index 7dcf06c4..665612db 100644 --- a/xlat/btrfs_space_info_flags.h +++ b/xlat/btrfs_space_info_flags.h @@ -1,47 +1,97 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_space_info_flags.in; do not edit. */ -#if !(defined(BTRFS_BLOCK_GROUP_DATA) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_DATA) && HAVE_DECL_BTRFS_BLOCK_GROUP_DATA)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BTRFS_BLOCK_GROUP_DATA) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_DATA) && HAVE_DECL_BTRFS_BLOCK_GROUP_DATA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BLOCK_GROUP_DATA) == ((1ULL << 0)), "BTRFS_BLOCK_GROUP_DATA != (1ULL << 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BLOCK_GROUP_DATA (1ULL << 0) #endif -#if !(defined(BTRFS_BLOCK_GROUP_SYSTEM) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_SYSTEM) && HAVE_DECL_BTRFS_BLOCK_GROUP_SYSTEM)) +#if defined(BTRFS_BLOCK_GROUP_SYSTEM) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_SYSTEM) && HAVE_DECL_BTRFS_BLOCK_GROUP_SYSTEM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BLOCK_GROUP_SYSTEM) == ((1ULL << 1)), "BTRFS_BLOCK_GROUP_SYSTEM != (1ULL << 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BLOCK_GROUP_SYSTEM (1ULL << 1) #endif -#if !(defined(BTRFS_BLOCK_GROUP_METADATA) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_METADATA) && HAVE_DECL_BTRFS_BLOCK_GROUP_METADATA)) +#if defined(BTRFS_BLOCK_GROUP_METADATA) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_METADATA) && HAVE_DECL_BTRFS_BLOCK_GROUP_METADATA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BLOCK_GROUP_METADATA) == ((1ULL << 2)), "BTRFS_BLOCK_GROUP_METADATA != (1ULL << 2)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BLOCK_GROUP_METADATA (1ULL << 2) #endif -#if !(defined(BTRFS_BLOCK_GROUP_RAID0) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_RAID0) && HAVE_DECL_BTRFS_BLOCK_GROUP_RAID0)) +#if defined(BTRFS_BLOCK_GROUP_RAID0) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_RAID0) && HAVE_DECL_BTRFS_BLOCK_GROUP_RAID0) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BLOCK_GROUP_RAID0) == ((1ULL << 3)), "BTRFS_BLOCK_GROUP_RAID0 != (1ULL << 3)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BLOCK_GROUP_RAID0 (1ULL << 3) #endif -#if !(defined(BTRFS_BLOCK_GROUP_RAID1) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_RAID1) && HAVE_DECL_BTRFS_BLOCK_GROUP_RAID1)) +#if defined(BTRFS_BLOCK_GROUP_RAID1) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_RAID1) && HAVE_DECL_BTRFS_BLOCK_GROUP_RAID1) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BLOCK_GROUP_RAID1) == ((1ULL << 4)), "BTRFS_BLOCK_GROUP_RAID1 != (1ULL << 4)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BLOCK_GROUP_RAID1 (1ULL << 4) #endif -#if !(defined(BTRFS_BLOCK_GROUP_DUP) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_DUP) && HAVE_DECL_BTRFS_BLOCK_GROUP_DUP)) +#if defined(BTRFS_BLOCK_GROUP_DUP) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_DUP) && HAVE_DECL_BTRFS_BLOCK_GROUP_DUP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BLOCK_GROUP_DUP) == ((1ULL << 5)), "BTRFS_BLOCK_GROUP_DUP != (1ULL << 5)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BLOCK_GROUP_DUP (1ULL << 5) #endif -#if !(defined(BTRFS_BLOCK_GROUP_RAID10) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_RAID10) && HAVE_DECL_BTRFS_BLOCK_GROUP_RAID10)) +#if defined(BTRFS_BLOCK_GROUP_RAID10) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_RAID10) && HAVE_DECL_BTRFS_BLOCK_GROUP_RAID10) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BLOCK_GROUP_RAID10) == ((1ULL << 6)), "BTRFS_BLOCK_GROUP_RAID10 != (1ULL << 6)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BLOCK_GROUP_RAID10 (1ULL << 6) #endif -#if !(defined(BTRFS_BLOCK_GROUP_RAID5) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_RAID5) && HAVE_DECL_BTRFS_BLOCK_GROUP_RAID5)) +#if defined(BTRFS_BLOCK_GROUP_RAID5) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_RAID5) && HAVE_DECL_BTRFS_BLOCK_GROUP_RAID5) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BLOCK_GROUP_RAID5) == ((1ULL << 7)), "BTRFS_BLOCK_GROUP_RAID5 != (1ULL << 7)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BLOCK_GROUP_RAID5 (1ULL << 7) #endif -#if !(defined(BTRFS_BLOCK_GROUP_RAID6) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_RAID6) && HAVE_DECL_BTRFS_BLOCK_GROUP_RAID6)) +#if defined(BTRFS_BLOCK_GROUP_RAID6) || (defined(HAVE_DECL_BTRFS_BLOCK_GROUP_RAID6) && HAVE_DECL_BTRFS_BLOCK_GROUP_RAID6) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_BLOCK_GROUP_RAID6) == ((1ULL << 8)), "BTRFS_BLOCK_GROUP_RAID6 != (1ULL << 8)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_BLOCK_GROUP_RAID6 (1ULL << 8) #endif -#if !(defined(BTRFS_AVAIL_ALLOC_BIT_SINGLE) || (defined(HAVE_DECL_BTRFS_AVAIL_ALLOC_BIT_SINGLE) && HAVE_DECL_BTRFS_AVAIL_ALLOC_BIT_SINGLE)) +#if defined(BTRFS_AVAIL_ALLOC_BIT_SINGLE) || (defined(HAVE_DECL_BTRFS_AVAIL_ALLOC_BIT_SINGLE) && HAVE_DECL_BTRFS_AVAIL_ALLOC_BIT_SINGLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_AVAIL_ALLOC_BIT_SINGLE) == ((1ULL << 48)), "BTRFS_AVAIL_ALLOC_BIT_SINGLE != (1ULL << 48)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_AVAIL_ALLOC_BIT_SINGLE (1ULL << 48) #endif -#if !(defined(BTRFS_SPACE_INFO_GLOBAL_RSV) || (defined(HAVE_DECL_BTRFS_SPACE_INFO_GLOBAL_RSV) && HAVE_DECL_BTRFS_SPACE_INFO_GLOBAL_RSV)) +#if defined(BTRFS_SPACE_INFO_GLOBAL_RSV) || (defined(HAVE_DECL_BTRFS_SPACE_INFO_GLOBAL_RSV) && HAVE_DECL_BTRFS_SPACE_INFO_GLOBAL_RSV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_SPACE_INFO_GLOBAL_RSV) == ((1ULL << 49)), "BTRFS_SPACE_INFO_GLOBAL_RSV != (1ULL << 49)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_SPACE_INFO_GLOBAL_RSV (1ULL << 49) #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat btrfs_space_info_flags[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_space_info_flags[] = { XLAT_TYPE(uint64_t, BTRFS_BLOCK_GROUP_DATA), XLAT_TYPE(uint64_t, BTRFS_BLOCK_GROUP_SYSTEM), @@ -57,4 +107,6 @@ const struct xlat btrfs_space_info_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/btrfs_tree_objectids.h b/xlat/btrfs_tree_objectids.h index f96ee7f0..5acf1096 100644 --- a/xlat/btrfs_tree_objectids.h +++ b/xlat/btrfs_tree_objectids.h @@ -1,53 +1,111 @@ /* Generated by ./xlat/gen.sh from ./xlat/btrfs_tree_objectids.in; do not edit. */ -#if !(defined(BTRFS_ROOT_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_ROOT_TREE_OBJECTID) && HAVE_DECL_BTRFS_ROOT_TREE_OBJECTID)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BTRFS_ROOT_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_ROOT_TREE_OBJECTID) && HAVE_DECL_BTRFS_ROOT_TREE_OBJECTID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_ROOT_TREE_OBJECTID) == (1ULL), "BTRFS_ROOT_TREE_OBJECTID != 1ULL"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_ROOT_TREE_OBJECTID 1ULL #endif -#if !(defined(BTRFS_EXTENT_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_EXTENT_TREE_OBJECTID) && HAVE_DECL_BTRFS_EXTENT_TREE_OBJECTID)) +#if defined(BTRFS_EXTENT_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_EXTENT_TREE_OBJECTID) && HAVE_DECL_BTRFS_EXTENT_TREE_OBJECTID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_EXTENT_TREE_OBJECTID) == (2ULL), "BTRFS_EXTENT_TREE_OBJECTID != 2ULL"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_EXTENT_TREE_OBJECTID 2ULL #endif -#if !(defined(BTRFS_CHUNK_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_CHUNK_TREE_OBJECTID) && HAVE_DECL_BTRFS_CHUNK_TREE_OBJECTID)) +#if defined(BTRFS_CHUNK_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_CHUNK_TREE_OBJECTID) && HAVE_DECL_BTRFS_CHUNK_TREE_OBJECTID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_CHUNK_TREE_OBJECTID) == (3ULL), "BTRFS_CHUNK_TREE_OBJECTID != 3ULL"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_CHUNK_TREE_OBJECTID 3ULL #endif -#if !(defined(BTRFS_DEV_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_DEV_TREE_OBJECTID) && HAVE_DECL_BTRFS_DEV_TREE_OBJECTID)) +#if defined(BTRFS_DEV_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_DEV_TREE_OBJECTID) && HAVE_DECL_BTRFS_DEV_TREE_OBJECTID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_DEV_TREE_OBJECTID) == (4ULL), "BTRFS_DEV_TREE_OBJECTID != 4ULL"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_DEV_TREE_OBJECTID 4ULL #endif -#if !(defined(BTRFS_FS_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_FS_TREE_OBJECTID) && HAVE_DECL_BTRFS_FS_TREE_OBJECTID)) +#if defined(BTRFS_FS_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_FS_TREE_OBJECTID) && HAVE_DECL_BTRFS_FS_TREE_OBJECTID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_FS_TREE_OBJECTID) == (5ULL), "BTRFS_FS_TREE_OBJECTID != 5ULL"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_FS_TREE_OBJECTID 5ULL #endif -#if !(defined(BTRFS_ROOT_TREE_DIR_OBJECTID) || (defined(HAVE_DECL_BTRFS_ROOT_TREE_DIR_OBJECTID) && HAVE_DECL_BTRFS_ROOT_TREE_DIR_OBJECTID)) +#if defined(BTRFS_ROOT_TREE_DIR_OBJECTID) || (defined(HAVE_DECL_BTRFS_ROOT_TREE_DIR_OBJECTID) && HAVE_DECL_BTRFS_ROOT_TREE_DIR_OBJECTID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_ROOT_TREE_DIR_OBJECTID) == (6ULL), "BTRFS_ROOT_TREE_DIR_OBJECTID != 6ULL"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_ROOT_TREE_DIR_OBJECTID 6ULL #endif -#if !(defined(BTRFS_CSUM_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_CSUM_TREE_OBJECTID) && HAVE_DECL_BTRFS_CSUM_TREE_OBJECTID)) +#if defined(BTRFS_CSUM_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_CSUM_TREE_OBJECTID) && HAVE_DECL_BTRFS_CSUM_TREE_OBJECTID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_CSUM_TREE_OBJECTID) == (7ULL), "BTRFS_CSUM_TREE_OBJECTID != 7ULL"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_CSUM_TREE_OBJECTID 7ULL #endif -#if !(defined(BTRFS_QUOTA_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_QUOTA_TREE_OBJECTID) && HAVE_DECL_BTRFS_QUOTA_TREE_OBJECTID)) +#if defined(BTRFS_QUOTA_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_QUOTA_TREE_OBJECTID) && HAVE_DECL_BTRFS_QUOTA_TREE_OBJECTID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_QUOTA_TREE_OBJECTID) == (8ULL), "BTRFS_QUOTA_TREE_OBJECTID != 8ULL"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_QUOTA_TREE_OBJECTID 8ULL #endif -#if !(defined(BTRFS_UUID_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_UUID_TREE_OBJECTID) && HAVE_DECL_BTRFS_UUID_TREE_OBJECTID)) +#if defined(BTRFS_UUID_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_UUID_TREE_OBJECTID) && HAVE_DECL_BTRFS_UUID_TREE_OBJECTID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_UUID_TREE_OBJECTID) == (9ULL), "BTRFS_UUID_TREE_OBJECTID != 9ULL"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_UUID_TREE_OBJECTID 9ULL #endif -#if !(defined(BTRFS_FREE_SPACE_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_FREE_SPACE_TREE_OBJECTID) && HAVE_DECL_BTRFS_FREE_SPACE_TREE_OBJECTID)) +#if defined(BTRFS_FREE_SPACE_TREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_FREE_SPACE_TREE_OBJECTID) && HAVE_DECL_BTRFS_FREE_SPACE_TREE_OBJECTID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_FREE_SPACE_TREE_OBJECTID) == (10ULL), "BTRFS_FREE_SPACE_TREE_OBJECTID != 10ULL"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_FREE_SPACE_TREE_OBJECTID 10ULL #endif -#if !(defined(BTRFS_FIRST_FREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_FIRST_FREE_OBJECTID) && HAVE_DECL_BTRFS_FIRST_FREE_OBJECTID)) +#if defined(BTRFS_FIRST_FREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_FIRST_FREE_OBJECTID) && HAVE_DECL_BTRFS_FIRST_FREE_OBJECTID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_FIRST_FREE_OBJECTID) == (256ULL), "BTRFS_FIRST_FREE_OBJECTID != 256ULL"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_FIRST_FREE_OBJECTID 256ULL #endif -#if !(defined(BTRFS_LAST_FREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_LAST_FREE_OBJECTID) && HAVE_DECL_BTRFS_LAST_FREE_OBJECTID)) +#if defined(BTRFS_LAST_FREE_OBJECTID) || (defined(HAVE_DECL_BTRFS_LAST_FREE_OBJECTID) && HAVE_DECL_BTRFS_LAST_FREE_OBJECTID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTRFS_LAST_FREE_OBJECTID) == (-256ULL), "BTRFS_LAST_FREE_OBJECTID != -256ULL"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BTRFS_LAST_FREE_OBJECTID -256ULL #endif -#if !(defined(UINT64_MAX) || (defined(HAVE_DECL_UINT64_MAX) && HAVE_DECL_UINT64_MAX)) +#if defined(UINT64_MAX) || (defined(HAVE_DECL_UINT64_MAX) && HAVE_DECL_UINT64_MAX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((UINT64_MAX) == (-1ULL), "UINT64_MAX != -1ULL"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define UINT64_MAX -1ULL #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat btrfs_tree_objectids[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat btrfs_tree_objectids[] = { XLAT_TYPE(uint64_t, BTRFS_ROOT_TREE_OBJECTID), XLAT_TYPE(uint64_t, BTRFS_EXTENT_TREE_OBJECTID), @@ -65,4 +123,6 @@ const struct xlat btrfs_tree_objectids[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/cacheflush_scope.h b/xlat/cacheflush_scope.h index 48597741..eac973e3 100644 --- a/xlat/cacheflush_scope.h +++ b/xlat/cacheflush_scope.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/cacheflush_scope.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat cacheflush_scope in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat cacheflush_scope in mpers mode + +# else static const struct xlat cacheflush_scope[] = { @@ -20,4 +26,6 @@ const struct xlat cacheflush_scope[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/caif_protocols.h b/xlat/caif_protocols.h new file mode 100644 index 00000000..5c193a12 --- /dev/null +++ b/xlat/caif_protocols.h @@ -0,0 +1,70 @@ +/* Generated by ./xlat/gen.sh from ./xlat/caif_protocols.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(CAIFPROTO_AT) || (defined(HAVE_DECL_CAIFPROTO_AT) && HAVE_DECL_CAIFPROTO_AT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CAIFPROTO_AT) == (0), "CAIFPROTO_AT != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CAIFPROTO_AT 0 +#endif +#if defined(CAIFPROTO_DATAGRAM) || (defined(HAVE_DECL_CAIFPROTO_DATAGRAM) && HAVE_DECL_CAIFPROTO_DATAGRAM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CAIFPROTO_DATAGRAM) == (1), "CAIFPROTO_DATAGRAM != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CAIFPROTO_DATAGRAM 1 +#endif +#if defined(CAIFPROTO_DATAGRAM_LOOP) || (defined(HAVE_DECL_CAIFPROTO_DATAGRAM_LOOP) && HAVE_DECL_CAIFPROTO_DATAGRAM_LOOP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CAIFPROTO_DATAGRAM_LOOP) == (2), "CAIFPROTO_DATAGRAM_LOOP != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CAIFPROTO_DATAGRAM_LOOP 2 +#endif +#if defined(CAIFPROTO_UTIL) || (defined(HAVE_DECL_CAIFPROTO_UTIL) && HAVE_DECL_CAIFPROTO_UTIL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CAIFPROTO_UTIL) == (3), "CAIFPROTO_UTIL != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CAIFPROTO_UTIL 3 +#endif +#if defined(CAIFPROTO_RFM) || (defined(HAVE_DECL_CAIFPROTO_RFM) && HAVE_DECL_CAIFPROTO_RFM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CAIFPROTO_RFM) == (4), "CAIFPROTO_RFM != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CAIFPROTO_RFM 4 +#endif +#if defined(CAIFPROTO_DEBUG) || (defined(HAVE_DECL_CAIFPROTO_DEBUG) && HAVE_DECL_CAIFPROTO_DEBUG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CAIFPROTO_DEBUG) == (5), "CAIFPROTO_DEBUG != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CAIFPROTO_DEBUG 5 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat caif_protocols in mpers mode + +# else + +static +const struct xlat caif_protocols[] = { + [CAIFPROTO_AT] = XLAT(CAIFPROTO_AT), + [CAIFPROTO_DATAGRAM] = XLAT(CAIFPROTO_DATAGRAM), + [CAIFPROTO_DATAGRAM_LOOP] = XLAT(CAIFPROTO_DATAGRAM_LOOP), + [CAIFPROTO_UTIL] = XLAT(CAIFPROTO_UTIL), + [CAIFPROTO_RFM] = XLAT(CAIFPROTO_RFM), + [CAIFPROTO_DEBUG] = XLAT(CAIFPROTO_DEBUG), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/caif_protocols.in b/xlat/caif_protocols.in new file mode 100644 index 00000000..76ba8960 --- /dev/null +++ b/xlat/caif_protocols.in @@ -0,0 +1,7 @@ +#value_indexed +CAIFPROTO_AT 0 +CAIFPROTO_DATAGRAM 1 +CAIFPROTO_DATAGRAM_LOOP 2 +CAIFPROTO_UTIL 3 +CAIFPROTO_RFM 4 +CAIFPROTO_DEBUG 5 diff --git a/xlat/can_protocols.h b/xlat/can_protocols.h new file mode 100644 index 00000000..3e207f7d --- /dev/null +++ b/xlat/can_protocols.h @@ -0,0 +1,70 @@ +/* Generated by ./xlat/gen.sh from ./xlat/can_protocols.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(CAN_RAW) || (defined(HAVE_DECL_CAN_RAW) && HAVE_DECL_CAN_RAW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CAN_RAW) == (1), "CAN_RAW != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CAN_RAW 1 +#endif +#if defined(CAN_BCM) || (defined(HAVE_DECL_CAN_BCM) && HAVE_DECL_CAN_BCM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CAN_BCM) == (2), "CAN_BCM != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CAN_BCM 2 +#endif +#if defined(CAN_TP16) || (defined(HAVE_DECL_CAN_TP16) && HAVE_DECL_CAN_TP16) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CAN_TP16) == (3), "CAN_TP16 != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CAN_TP16 3 +#endif +#if defined(CAN_TP20) || (defined(HAVE_DECL_CAN_TP20) && HAVE_DECL_CAN_TP20) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CAN_TP20) == (4), "CAN_TP20 != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CAN_TP20 4 +#endif +#if defined(CAN_MCNET) || (defined(HAVE_DECL_CAN_MCNET) && HAVE_DECL_CAN_MCNET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CAN_MCNET) == (5), "CAN_MCNET != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CAN_MCNET 5 +#endif +#if defined(CAN_ISOTP) || (defined(HAVE_DECL_CAN_ISOTP) && HAVE_DECL_CAN_ISOTP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CAN_ISOTP) == (6), "CAN_ISOTP != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CAN_ISOTP 6 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat can_protocols in mpers mode + +# else + +static +const struct xlat can_protocols[] = { + [CAN_RAW] = XLAT(CAN_RAW), + [CAN_BCM] = XLAT(CAN_BCM), + [CAN_TP16] = XLAT(CAN_TP16), + [CAN_TP20] = XLAT(CAN_TP20), + [CAN_MCNET] = XLAT(CAN_MCNET), + [CAN_ISOTP] = XLAT(CAN_ISOTP), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/can_protocols.in b/xlat/can_protocols.in new file mode 100644 index 00000000..f74caa73 --- /dev/null +++ b/xlat/can_protocols.in @@ -0,0 +1,7 @@ +#value_indexed +CAN_RAW 1 +CAN_BCM 2 +CAN_TP16 3 +CAN_TP20 4 +CAN_MCNET 5 +CAN_ISOTP 6 diff --git a/xlat/cap.h b/xlat/cap.h index fb50990e..c8205f70 100644 --- a/xlat/cap.h +++ b/xlat/cap.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/cap.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat cap in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat cap in mpers mode + +# else static const struct xlat cap[] = { @@ -49,4 +55,6 @@ const struct xlat cap[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/cap_mask0.h b/xlat/cap_mask0.h index 4402dc22..84d529f2 100644 --- a/xlat/cap_mask0.h +++ b/xlat/cap_mask0.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/cap_mask0.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat cap_mask0 in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat cap_mask0 in mpers mode + +# else static const struct xlat cap_mask0[] = { @@ -43,4 +49,6 @@ const struct xlat cap_mask0[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/cap_mask1.h b/xlat/cap_mask1.h index 074f5c62..c32c0196 100644 --- a/xlat/cap_mask1.h +++ b/xlat/cap_mask1.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/cap_mask1.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat cap_mask1 in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat cap_mask1 in mpers mode + +# else static const struct xlat cap_mask1[] = { @@ -17,4 +23,6 @@ const struct xlat cap_mask1[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/cap_version.h b/xlat/cap_version.h index 35c9189c..69ca874a 100644 --- a/xlat/cap_version.h +++ b/xlat/cap_version.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/cap_version.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat cap_version in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat cap_version in mpers mode + +# else static const struct xlat cap_version[] = { @@ -14,4 +20,6 @@ const struct xlat cap_version[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/clockflags.h b/xlat/clockflags.h index d24419d3..4f343a1c 100644 --- a/xlat/clockflags.h +++ b/xlat/clockflags.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/clockflags.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat clockflags in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat clockflags in mpers mode + +# else static const struct xlat clockflags[] = { @@ -14,4 +20,6 @@ const struct xlat clockflags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/clocknames.h b/xlat/clocknames.h index 71de9dae..a2932f91 100644 --- a/xlat/clocknames.h +++ b/xlat/clocknames.h @@ -1,62 +1,113 @@ /* Generated by ./xlat/gen.sh from ./xlat/clocknames.in; do not edit. */ -#if !(defined(CLOCK_REALTIME) || (defined(HAVE_DECL_CLOCK_REALTIME) && HAVE_DECL_CLOCK_REALTIME)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(CLOCK_REALTIME) || (defined(HAVE_DECL_CLOCK_REALTIME) && HAVE_DECL_CLOCK_REALTIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLOCK_REALTIME) == (0), "CLOCK_REALTIME != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLOCK_REALTIME 0 #endif -#if !(defined(CLOCK_MONOTONIC) || (defined(HAVE_DECL_CLOCK_MONOTONIC) && HAVE_DECL_CLOCK_MONOTONIC)) +#if defined(CLOCK_MONOTONIC) || (defined(HAVE_DECL_CLOCK_MONOTONIC) && HAVE_DECL_CLOCK_MONOTONIC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLOCK_MONOTONIC) == (1), "CLOCK_MONOTONIC != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLOCK_MONOTONIC 1 #endif -#if !(defined(CLOCK_PROCESS_CPUTIME_ID) || (defined(HAVE_DECL_CLOCK_PROCESS_CPUTIME_ID) && HAVE_DECL_CLOCK_PROCESS_CPUTIME_ID)) +#if defined(CLOCK_PROCESS_CPUTIME_ID) || (defined(HAVE_DECL_CLOCK_PROCESS_CPUTIME_ID) && HAVE_DECL_CLOCK_PROCESS_CPUTIME_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLOCK_PROCESS_CPUTIME_ID) == (2), "CLOCK_PROCESS_CPUTIME_ID != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLOCK_PROCESS_CPUTIME_ID 2 #endif -#if !(defined(CLOCK_THREAD_CPUTIME_ID) || (defined(HAVE_DECL_CLOCK_THREAD_CPUTIME_ID) && HAVE_DECL_CLOCK_THREAD_CPUTIME_ID)) +#if defined(CLOCK_THREAD_CPUTIME_ID) || (defined(HAVE_DECL_CLOCK_THREAD_CPUTIME_ID) && HAVE_DECL_CLOCK_THREAD_CPUTIME_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLOCK_THREAD_CPUTIME_ID) == (3), "CLOCK_THREAD_CPUTIME_ID != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLOCK_THREAD_CPUTIME_ID 3 #endif -#if !(defined(CLOCK_MONOTONIC_RAW) || (defined(HAVE_DECL_CLOCK_MONOTONIC_RAW) && HAVE_DECL_CLOCK_MONOTONIC_RAW)) +#if defined(CLOCK_MONOTONIC_RAW) || (defined(HAVE_DECL_CLOCK_MONOTONIC_RAW) && HAVE_DECL_CLOCK_MONOTONIC_RAW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLOCK_MONOTONIC_RAW) == (4), "CLOCK_MONOTONIC_RAW != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLOCK_MONOTONIC_RAW 4 #endif -#if !(defined(CLOCK_REALTIME_COARSE) || (defined(HAVE_DECL_CLOCK_REALTIME_COARSE) && HAVE_DECL_CLOCK_REALTIME_COARSE)) +#if defined(CLOCK_REALTIME_COARSE) || (defined(HAVE_DECL_CLOCK_REALTIME_COARSE) && HAVE_DECL_CLOCK_REALTIME_COARSE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLOCK_REALTIME_COARSE) == (5), "CLOCK_REALTIME_COARSE != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLOCK_REALTIME_COARSE 5 #endif -#if !(defined(CLOCK_MONOTONIC_COARSE) || (defined(HAVE_DECL_CLOCK_MONOTONIC_COARSE) && HAVE_DECL_CLOCK_MONOTONIC_COARSE)) +#if defined(CLOCK_MONOTONIC_COARSE) || (defined(HAVE_DECL_CLOCK_MONOTONIC_COARSE) && HAVE_DECL_CLOCK_MONOTONIC_COARSE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLOCK_MONOTONIC_COARSE) == (6), "CLOCK_MONOTONIC_COARSE != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLOCK_MONOTONIC_COARSE 6 #endif -#if !(defined(CLOCK_BOOTTIME) || (defined(HAVE_DECL_CLOCK_BOOTTIME) && HAVE_DECL_CLOCK_BOOTTIME)) +#if defined(CLOCK_BOOTTIME) || (defined(HAVE_DECL_CLOCK_BOOTTIME) && HAVE_DECL_CLOCK_BOOTTIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLOCK_BOOTTIME) == (7), "CLOCK_BOOTTIME != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLOCK_BOOTTIME 7 #endif -#if !(defined(CLOCK_REALTIME_ALARM) || (defined(HAVE_DECL_CLOCK_REALTIME_ALARM) && HAVE_DECL_CLOCK_REALTIME_ALARM)) +#if defined(CLOCK_REALTIME_ALARM) || (defined(HAVE_DECL_CLOCK_REALTIME_ALARM) && HAVE_DECL_CLOCK_REALTIME_ALARM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLOCK_REALTIME_ALARM) == (8), "CLOCK_REALTIME_ALARM != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLOCK_REALTIME_ALARM 8 #endif -#if !(defined(CLOCK_BOOTTIME_ALARM) || (defined(HAVE_DECL_CLOCK_BOOTTIME_ALARM) && HAVE_DECL_CLOCK_BOOTTIME_ALARM)) +#if defined(CLOCK_BOOTTIME_ALARM) || (defined(HAVE_DECL_CLOCK_BOOTTIME_ALARM) && HAVE_DECL_CLOCK_BOOTTIME_ALARM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLOCK_BOOTTIME_ALARM) == (9), "CLOCK_BOOTTIME_ALARM != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLOCK_BOOTTIME_ALARM 9 #endif -#if !(defined(CLOCK_SGI_CYCLE) || (defined(HAVE_DECL_CLOCK_SGI_CYCLE) && HAVE_DECL_CLOCK_SGI_CYCLE)) +#if defined(CLOCK_SGI_CYCLE) || (defined(HAVE_DECL_CLOCK_SGI_CYCLE) && HAVE_DECL_CLOCK_SGI_CYCLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLOCK_SGI_CYCLE) == (10), "CLOCK_SGI_CYCLE != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLOCK_SGI_CYCLE 10 #endif -#if !(defined(CLOCK_TAI) || (defined(HAVE_DECL_CLOCK_TAI) && HAVE_DECL_CLOCK_TAI)) +#if defined(CLOCK_TAI) || (defined(HAVE_DECL_CLOCK_TAI) && HAVE_DECL_CLOCK_TAI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLOCK_TAI) == (11), "CLOCK_TAI != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLOCK_TAI 11 #endif -#ifdef IN_MPERS - -# error static const struct xlat clocknames in mpers mode +#ifndef XLAT_MACROS_ONLY -#else +# ifndef IN_MPERS -static const struct xlat clocknames[] = { - XLAT(CLOCK_REALTIME), - XLAT(CLOCK_MONOTONIC), - XLAT(CLOCK_PROCESS_CPUTIME_ID), - XLAT(CLOCK_THREAD_CPUTIME_ID), - XLAT(CLOCK_MONOTONIC_RAW), - XLAT(CLOCK_REALTIME_COARSE), - XLAT(CLOCK_MONOTONIC_COARSE), - XLAT(CLOCK_BOOTTIME), - XLAT(CLOCK_REALTIME_ALARM), - XLAT(CLOCK_BOOTTIME_ALARM), - XLAT(CLOCK_SGI_CYCLE), - XLAT(CLOCK_TAI), + [CLOCK_REALTIME] = XLAT(CLOCK_REALTIME), + [CLOCK_MONOTONIC] = XLAT(CLOCK_MONOTONIC), + [CLOCK_PROCESS_CPUTIME_ID] = XLAT(CLOCK_PROCESS_CPUTIME_ID), + [CLOCK_THREAD_CPUTIME_ID] = XLAT(CLOCK_THREAD_CPUTIME_ID), + [CLOCK_MONOTONIC_RAW] = XLAT(CLOCK_MONOTONIC_RAW), + [CLOCK_REALTIME_COARSE] = XLAT(CLOCK_REALTIME_COARSE), + [CLOCK_MONOTONIC_COARSE] = XLAT(CLOCK_MONOTONIC_COARSE), + [CLOCK_BOOTTIME] = XLAT(CLOCK_BOOTTIME), + [CLOCK_REALTIME_ALARM] = XLAT(CLOCK_REALTIME_ALARM), + [CLOCK_BOOTTIME_ALARM] = XLAT(CLOCK_BOOTTIME_ALARM), + [CLOCK_SGI_CYCLE] = XLAT(CLOCK_SGI_CYCLE), + [CLOCK_TAI] = XLAT(CLOCK_TAI), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/clocknames.in b/xlat/clocknames.in index 1d0d3727..207ade8e 100644 --- a/xlat/clocknames.in +++ b/xlat/clocknames.in @@ -1,3 +1,4 @@ +#value_indexed CLOCK_REALTIME 0 CLOCK_MONOTONIC 1 CLOCK_PROCESS_CPUTIME_ID 2 diff --git a/xlat/clone_flags.h b/xlat/clone_flags.h index a7e4c4bd..d2d939fd 100644 --- a/xlat/clone_flags.h +++ b/xlat/clone_flags.h @@ -1,79 +1,177 @@ /* Generated by ./xlat/gen.sh from ./xlat/clone_flags.in; do not edit. */ -#if !(defined(CLONE_VM) || (defined(HAVE_DECL_CLONE_VM) && HAVE_DECL_CLONE_VM)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(CLONE_VM) || (defined(HAVE_DECL_CLONE_VM) && HAVE_DECL_CLONE_VM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_VM) == (0x00000100), "CLONE_VM != 0x00000100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_VM 0x00000100 #endif -#if !(defined(CLONE_FS) || (defined(HAVE_DECL_CLONE_FS) && HAVE_DECL_CLONE_FS)) +#if defined(CLONE_FS) || (defined(HAVE_DECL_CLONE_FS) && HAVE_DECL_CLONE_FS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_FS) == (0x00000200), "CLONE_FS != 0x00000200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_FS 0x00000200 #endif -#if !(defined(CLONE_FILES) || (defined(HAVE_DECL_CLONE_FILES) && HAVE_DECL_CLONE_FILES)) +#if defined(CLONE_FILES) || (defined(HAVE_DECL_CLONE_FILES) && HAVE_DECL_CLONE_FILES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_FILES) == (0x00000400), "CLONE_FILES != 0x00000400"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_FILES 0x00000400 #endif -#if !(defined(CLONE_SIGHAND) || (defined(HAVE_DECL_CLONE_SIGHAND) && HAVE_DECL_CLONE_SIGHAND)) +#if defined(CLONE_SIGHAND) || (defined(HAVE_DECL_CLONE_SIGHAND) && HAVE_DECL_CLONE_SIGHAND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_SIGHAND) == (0x00000800), "CLONE_SIGHAND != 0x00000800"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_SIGHAND 0x00000800 #endif -#if !(defined(CLONE_IDLETASK) || (defined(HAVE_DECL_CLONE_IDLETASK) && HAVE_DECL_CLONE_IDLETASK)) +#if defined(CLONE_IDLETASK) || (defined(HAVE_DECL_CLONE_IDLETASK) && HAVE_DECL_CLONE_IDLETASK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_IDLETASK) == (0x00001000), "CLONE_IDLETASK != 0x00001000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_IDLETASK 0x00001000 #endif -#if !(defined(CLONE_PTRACE) || (defined(HAVE_DECL_CLONE_PTRACE) && HAVE_DECL_CLONE_PTRACE)) +#if defined(CLONE_PTRACE) || (defined(HAVE_DECL_CLONE_PTRACE) && HAVE_DECL_CLONE_PTRACE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_PTRACE) == (0x00002000), "CLONE_PTRACE != 0x00002000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_PTRACE 0x00002000 #endif -#if !(defined(CLONE_VFORK) || (defined(HAVE_DECL_CLONE_VFORK) && HAVE_DECL_CLONE_VFORK)) +#if defined(CLONE_VFORK) || (defined(HAVE_DECL_CLONE_VFORK) && HAVE_DECL_CLONE_VFORK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_VFORK) == (0x00004000), "CLONE_VFORK != 0x00004000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_VFORK 0x00004000 #endif -#if !(defined(CLONE_PARENT) || (defined(HAVE_DECL_CLONE_PARENT) && HAVE_DECL_CLONE_PARENT)) +#if defined(CLONE_PARENT) || (defined(HAVE_DECL_CLONE_PARENT) && HAVE_DECL_CLONE_PARENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_PARENT) == (0x00008000), "CLONE_PARENT != 0x00008000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_PARENT 0x00008000 #endif -#if !(defined(CLONE_THREAD) || (defined(HAVE_DECL_CLONE_THREAD) && HAVE_DECL_CLONE_THREAD)) +#if defined(CLONE_THREAD) || (defined(HAVE_DECL_CLONE_THREAD) && HAVE_DECL_CLONE_THREAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_THREAD) == (0x00010000), "CLONE_THREAD != 0x00010000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_THREAD 0x00010000 #endif -#if !(defined(CLONE_NEWNS) || (defined(HAVE_DECL_CLONE_NEWNS) && HAVE_DECL_CLONE_NEWNS)) +#if defined(CLONE_NEWNS) || (defined(HAVE_DECL_CLONE_NEWNS) && HAVE_DECL_CLONE_NEWNS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_NEWNS) == (0x00020000), "CLONE_NEWNS != 0x00020000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_NEWNS 0x00020000 #endif -#if !(defined(CLONE_SYSVSEM) || (defined(HAVE_DECL_CLONE_SYSVSEM) && HAVE_DECL_CLONE_SYSVSEM)) +#if defined(CLONE_SYSVSEM) || (defined(HAVE_DECL_CLONE_SYSVSEM) && HAVE_DECL_CLONE_SYSVSEM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_SYSVSEM) == (0x00040000), "CLONE_SYSVSEM != 0x00040000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_SYSVSEM 0x00040000 #endif -#if !(defined(CLONE_SETTLS) || (defined(HAVE_DECL_CLONE_SETTLS) && HAVE_DECL_CLONE_SETTLS)) +#if defined(CLONE_SETTLS) || (defined(HAVE_DECL_CLONE_SETTLS) && HAVE_DECL_CLONE_SETTLS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_SETTLS) == (0x00080000), "CLONE_SETTLS != 0x00080000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_SETTLS 0x00080000 #endif -#if !(defined(CLONE_PARENT_SETTID) || (defined(HAVE_DECL_CLONE_PARENT_SETTID) && HAVE_DECL_CLONE_PARENT_SETTID)) +#if defined(CLONE_PARENT_SETTID) || (defined(HAVE_DECL_CLONE_PARENT_SETTID) && HAVE_DECL_CLONE_PARENT_SETTID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_PARENT_SETTID) == (0x00100000), "CLONE_PARENT_SETTID != 0x00100000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_PARENT_SETTID 0x00100000 #endif -#if !(defined(CLONE_CHILD_CLEARTID) || (defined(HAVE_DECL_CLONE_CHILD_CLEARTID) && HAVE_DECL_CLONE_CHILD_CLEARTID)) +#if defined(CLONE_CHILD_CLEARTID) || (defined(HAVE_DECL_CLONE_CHILD_CLEARTID) && HAVE_DECL_CLONE_CHILD_CLEARTID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_CHILD_CLEARTID) == (0x00200000), "CLONE_CHILD_CLEARTID != 0x00200000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_CHILD_CLEARTID 0x00200000 #endif -#if !(defined(CLONE_UNTRACED) || (defined(HAVE_DECL_CLONE_UNTRACED) && HAVE_DECL_CLONE_UNTRACED)) +#if defined(CLONE_UNTRACED) || (defined(HAVE_DECL_CLONE_UNTRACED) && HAVE_DECL_CLONE_UNTRACED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_UNTRACED) == (0x00800000), "CLONE_UNTRACED != 0x00800000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_UNTRACED 0x00800000 #endif -#if !(defined(CLONE_CHILD_SETTID) || (defined(HAVE_DECL_CLONE_CHILD_SETTID) && HAVE_DECL_CLONE_CHILD_SETTID)) +#if defined(CLONE_CHILD_SETTID) || (defined(HAVE_DECL_CLONE_CHILD_SETTID) && HAVE_DECL_CLONE_CHILD_SETTID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_CHILD_SETTID) == (0x01000000), "CLONE_CHILD_SETTID != 0x01000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_CHILD_SETTID 0x01000000 #endif -#if !(defined(CLONE_NEWCGROUP) || (defined(HAVE_DECL_CLONE_NEWCGROUP) && HAVE_DECL_CLONE_NEWCGROUP)) +#if defined(CLONE_NEWCGROUP) || (defined(HAVE_DECL_CLONE_NEWCGROUP) && HAVE_DECL_CLONE_NEWCGROUP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_NEWCGROUP) == (0x02000000), "CLONE_NEWCGROUP != 0x02000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_NEWCGROUP 0x02000000 #endif -#if !(defined(CLONE_NEWUTS) || (defined(HAVE_DECL_CLONE_NEWUTS) && HAVE_DECL_CLONE_NEWUTS)) +#if defined(CLONE_NEWUTS) || (defined(HAVE_DECL_CLONE_NEWUTS) && HAVE_DECL_CLONE_NEWUTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_NEWUTS) == (0x04000000), "CLONE_NEWUTS != 0x04000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_NEWUTS 0x04000000 #endif -#if !(defined(CLONE_NEWIPC) || (defined(HAVE_DECL_CLONE_NEWIPC) && HAVE_DECL_CLONE_NEWIPC)) +#if defined(CLONE_NEWIPC) || (defined(HAVE_DECL_CLONE_NEWIPC) && HAVE_DECL_CLONE_NEWIPC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_NEWIPC) == (0x08000000), "CLONE_NEWIPC != 0x08000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_NEWIPC 0x08000000 #endif -#if !(defined(CLONE_NEWUSER) || (defined(HAVE_DECL_CLONE_NEWUSER) && HAVE_DECL_CLONE_NEWUSER)) +#if defined(CLONE_NEWUSER) || (defined(HAVE_DECL_CLONE_NEWUSER) && HAVE_DECL_CLONE_NEWUSER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_NEWUSER) == (0x10000000), "CLONE_NEWUSER != 0x10000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_NEWUSER 0x10000000 #endif -#if !(defined(CLONE_NEWPID) || (defined(HAVE_DECL_CLONE_NEWPID) && HAVE_DECL_CLONE_NEWPID)) +#if defined(CLONE_NEWPID) || (defined(HAVE_DECL_CLONE_NEWPID) && HAVE_DECL_CLONE_NEWPID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_NEWPID) == (0x20000000), "CLONE_NEWPID != 0x20000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_NEWPID 0x20000000 #endif -#if !(defined(CLONE_NEWNET) || (defined(HAVE_DECL_CLONE_NEWNET) && HAVE_DECL_CLONE_NEWNET)) +#if defined(CLONE_NEWNET) || (defined(HAVE_DECL_CLONE_NEWNET) && HAVE_DECL_CLONE_NEWNET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_NEWNET) == (0x40000000), "CLONE_NEWNET != 0x40000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_NEWNET 0x40000000 #endif -#if !(defined(CLONE_IO) || (defined(HAVE_DECL_CLONE_IO) && HAVE_DECL_CLONE_IO)) +#if defined(CLONE_IO) || (defined(HAVE_DECL_CLONE_IO) && HAVE_DECL_CLONE_IO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_IO) == (0x80000000), "CLONE_IO != 0x80000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_IO 0x80000000 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat clone_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat clone_flags in mpers mode + +# else static const struct xlat clone_flags[] = { @@ -103,4 +201,6 @@ const struct xlat clone_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/cpuclocknames.h b/xlat/cpuclocknames.h index 89751590..93331c93 100644 --- a/xlat/cpuclocknames.h +++ b/xlat/cpuclocknames.h @@ -1,23 +1,46 @@ /* Generated by ./xlat/gen.sh from ./xlat/cpuclocknames.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat cpuclocknames in mpers mode - -#else - -static -const struct xlat cpuclocknames[] = { #if defined(CPUCLOCK_PROF) || (defined(HAVE_DECL_CPUCLOCK_PROF) && HAVE_DECL_CPUCLOCK_PROF) - XLAT(CPUCLOCK_PROF), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CPUCLOCK_PROF) == (0), "CPUCLOCK_PROF != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CPUCLOCK_PROF 0 #endif #if defined(CPUCLOCK_VIRT) || (defined(HAVE_DECL_CPUCLOCK_VIRT) && HAVE_DECL_CPUCLOCK_VIRT) - XLAT(CPUCLOCK_VIRT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CPUCLOCK_VIRT) == (1), "CPUCLOCK_VIRT != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CPUCLOCK_VIRT 1 #endif #if defined(CPUCLOCK_SCHED) || (defined(HAVE_DECL_CPUCLOCK_SCHED) && HAVE_DECL_CPUCLOCK_SCHED) - XLAT(CPUCLOCK_SCHED), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CPUCLOCK_SCHED) == (2), "CPUCLOCK_SCHED != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CPUCLOCK_SCHED 2 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat cpuclocknames in mpers mode + +# else + +static +const struct xlat cpuclocknames[] = { + [CPUCLOCK_PROF] = XLAT(CPUCLOCK_PROF), + [CPUCLOCK_VIRT] = XLAT(CPUCLOCK_VIRT), + [CPUCLOCK_SCHED] = XLAT(CPUCLOCK_SCHED), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/cpuclocknames.in b/xlat/cpuclocknames.in index e61fa8f6..b7b9a828 100644 --- a/xlat/cpuclocknames.in +++ b/xlat/cpuclocknames.in @@ -1,3 +1,4 @@ -CPUCLOCK_PROF -CPUCLOCK_VIRT -CPUCLOCK_SCHED +#value_indexed +CPUCLOCK_PROF 0 +CPUCLOCK_VIRT 1 +CPUCLOCK_SCHED 2 diff --git a/xlat/crypto_nl_attrs.h b/xlat/crypto_nl_attrs.h new file mode 100644 index 00000000..46fbcb8e --- /dev/null +++ b/xlat/crypto_nl_attrs.h @@ -0,0 +1,118 @@ +/* Generated by ./xlat/gen.sh from ./xlat/crypto_nl_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(CRYPTOCFGA_UNSPEC) || (defined(HAVE_DECL_CRYPTOCFGA_UNSPEC) && HAVE_DECL_CRYPTOCFGA_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CRYPTOCFGA_UNSPEC) == (0), "CRYPTOCFGA_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CRYPTOCFGA_UNSPEC 0 +#endif +#if defined(CRYPTOCFGA_PRIORITY_VAL) || (defined(HAVE_DECL_CRYPTOCFGA_PRIORITY_VAL) && HAVE_DECL_CRYPTOCFGA_PRIORITY_VAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CRYPTOCFGA_PRIORITY_VAL) == (1), "CRYPTOCFGA_PRIORITY_VAL != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CRYPTOCFGA_PRIORITY_VAL 1 +#endif +#if defined(CRYPTOCFGA_REPORT_LARVAL) || (defined(HAVE_DECL_CRYPTOCFGA_REPORT_LARVAL) && HAVE_DECL_CRYPTOCFGA_REPORT_LARVAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CRYPTOCFGA_REPORT_LARVAL) == (2), "CRYPTOCFGA_REPORT_LARVAL != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CRYPTOCFGA_REPORT_LARVAL 2 +#endif +#if defined(CRYPTOCFGA_REPORT_HASH) || (defined(HAVE_DECL_CRYPTOCFGA_REPORT_HASH) && HAVE_DECL_CRYPTOCFGA_REPORT_HASH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CRYPTOCFGA_REPORT_HASH) == (3), "CRYPTOCFGA_REPORT_HASH != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CRYPTOCFGA_REPORT_HASH 3 +#endif +#if defined(CRYPTOCFGA_REPORT_BLKCIPHER) || (defined(HAVE_DECL_CRYPTOCFGA_REPORT_BLKCIPHER) && HAVE_DECL_CRYPTOCFGA_REPORT_BLKCIPHER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CRYPTOCFGA_REPORT_BLKCIPHER) == (4), "CRYPTOCFGA_REPORT_BLKCIPHER != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CRYPTOCFGA_REPORT_BLKCIPHER 4 +#endif +#if defined(CRYPTOCFGA_REPORT_AEAD) || (defined(HAVE_DECL_CRYPTOCFGA_REPORT_AEAD) && HAVE_DECL_CRYPTOCFGA_REPORT_AEAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CRYPTOCFGA_REPORT_AEAD) == (5), "CRYPTOCFGA_REPORT_AEAD != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CRYPTOCFGA_REPORT_AEAD 5 +#endif +#if defined(CRYPTOCFGA_REPORT_COMPRESS) || (defined(HAVE_DECL_CRYPTOCFGA_REPORT_COMPRESS) && HAVE_DECL_CRYPTOCFGA_REPORT_COMPRESS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CRYPTOCFGA_REPORT_COMPRESS) == (6), "CRYPTOCFGA_REPORT_COMPRESS != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CRYPTOCFGA_REPORT_COMPRESS 6 +#endif +#if defined(CRYPTOCFGA_REPORT_RNG) || (defined(HAVE_DECL_CRYPTOCFGA_REPORT_RNG) && HAVE_DECL_CRYPTOCFGA_REPORT_RNG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CRYPTOCFGA_REPORT_RNG) == (7), "CRYPTOCFGA_REPORT_RNG != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CRYPTOCFGA_REPORT_RNG 7 +#endif +#if defined(CRYPTOCFGA_REPORT_CIPHER) || (defined(HAVE_DECL_CRYPTOCFGA_REPORT_CIPHER) && HAVE_DECL_CRYPTOCFGA_REPORT_CIPHER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CRYPTOCFGA_REPORT_CIPHER) == (8), "CRYPTOCFGA_REPORT_CIPHER != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CRYPTOCFGA_REPORT_CIPHER 8 +#endif +#if defined(CRYPTOCFGA_REPORT_AKCIPHER) || (defined(HAVE_DECL_CRYPTOCFGA_REPORT_AKCIPHER) && HAVE_DECL_CRYPTOCFGA_REPORT_AKCIPHER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CRYPTOCFGA_REPORT_AKCIPHER) == (9), "CRYPTOCFGA_REPORT_AKCIPHER != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CRYPTOCFGA_REPORT_AKCIPHER 9 +#endif +#if defined(CRYPTOCFGA_REPORT_KPP) || (defined(HAVE_DECL_CRYPTOCFGA_REPORT_KPP) && HAVE_DECL_CRYPTOCFGA_REPORT_KPP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CRYPTOCFGA_REPORT_KPP) == (10), "CRYPTOCFGA_REPORT_KPP != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CRYPTOCFGA_REPORT_KPP 10 +#endif +#if defined(CRYPTOCFGA_REPORT_ACOMP) || (defined(HAVE_DECL_CRYPTOCFGA_REPORT_ACOMP) && HAVE_DECL_CRYPTOCFGA_REPORT_ACOMP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CRYPTOCFGA_REPORT_ACOMP) == (11), "CRYPTOCFGA_REPORT_ACOMP != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CRYPTOCFGA_REPORT_ACOMP 11 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat crypto_nl_attrs in mpers mode + +# else + +static +const struct xlat crypto_nl_attrs[] = { + XLAT(CRYPTOCFGA_UNSPEC), + XLAT(CRYPTOCFGA_PRIORITY_VAL), + XLAT(CRYPTOCFGA_REPORT_LARVAL), + XLAT(CRYPTOCFGA_REPORT_HASH), + XLAT(CRYPTOCFGA_REPORT_BLKCIPHER), + XLAT(CRYPTOCFGA_REPORT_AEAD), + XLAT(CRYPTOCFGA_REPORT_COMPRESS), + XLAT(CRYPTOCFGA_REPORT_RNG), + XLAT(CRYPTOCFGA_REPORT_CIPHER), + XLAT(CRYPTOCFGA_REPORT_AKCIPHER), + XLAT(CRYPTOCFGA_REPORT_KPP), + XLAT(CRYPTOCFGA_REPORT_ACOMP), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/crypto_nl_attrs.in b/xlat/crypto_nl_attrs.in new file mode 100644 index 00000000..02b36628 --- /dev/null +++ b/xlat/crypto_nl_attrs.in @@ -0,0 +1,12 @@ +CRYPTOCFGA_UNSPEC 0 +CRYPTOCFGA_PRIORITY_VAL 1 +CRYPTOCFGA_REPORT_LARVAL 2 +CRYPTOCFGA_REPORT_HASH 3 +CRYPTOCFGA_REPORT_BLKCIPHER 4 +CRYPTOCFGA_REPORT_AEAD 5 +CRYPTOCFGA_REPORT_COMPRESS 6 +CRYPTOCFGA_REPORT_RNG 7 +CRYPTOCFGA_REPORT_CIPHER 8 +CRYPTOCFGA_REPORT_AKCIPHER 9 +CRYPTOCFGA_REPORT_KPP 10 +CRYPTOCFGA_REPORT_ACOMP 11 diff --git a/xlat/dcb_commands.h b/xlat/dcb_commands.h new file mode 100644 index 00000000..768dbc13 --- /dev/null +++ b/xlat/dcb_commands.h @@ -0,0 +1,246 @@ +/* Generated by ./xlat/gen.sh from ./xlat/dcb_commands.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(DCB_CMD_UNDEFINED) || (defined(HAVE_DECL_DCB_CMD_UNDEFINED) && HAVE_DECL_DCB_CMD_UNDEFINED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_UNDEFINED) == (0), "DCB_CMD_UNDEFINED != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_UNDEFINED 0 +#endif +#if defined(DCB_CMD_GSTATE) || (defined(HAVE_DECL_DCB_CMD_GSTATE) && HAVE_DECL_DCB_CMD_GSTATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_GSTATE) == (1), "DCB_CMD_GSTATE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_GSTATE 1 +#endif +#if defined(DCB_CMD_SSTATE) || (defined(HAVE_DECL_DCB_CMD_SSTATE) && HAVE_DECL_DCB_CMD_SSTATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_SSTATE) == (2), "DCB_CMD_SSTATE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_SSTATE 2 +#endif +#if defined(DCB_CMD_PGTX_GCFG) || (defined(HAVE_DECL_DCB_CMD_PGTX_GCFG) && HAVE_DECL_DCB_CMD_PGTX_GCFG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_PGTX_GCFG) == (3), "DCB_CMD_PGTX_GCFG != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_PGTX_GCFG 3 +#endif +#if defined(DCB_CMD_PGTX_SCFG) || (defined(HAVE_DECL_DCB_CMD_PGTX_SCFG) && HAVE_DECL_DCB_CMD_PGTX_SCFG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_PGTX_SCFG) == (4), "DCB_CMD_PGTX_SCFG != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_PGTX_SCFG 4 +#endif +#if defined(DCB_CMD_PGRX_GCFG) || (defined(HAVE_DECL_DCB_CMD_PGRX_GCFG) && HAVE_DECL_DCB_CMD_PGRX_GCFG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_PGRX_GCFG) == (5), "DCB_CMD_PGRX_GCFG != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_PGRX_GCFG 5 +#endif +#if defined(DCB_CMD_PGRX_SCFG) || (defined(HAVE_DECL_DCB_CMD_PGRX_SCFG) && HAVE_DECL_DCB_CMD_PGRX_SCFG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_PGRX_SCFG) == (6), "DCB_CMD_PGRX_SCFG != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_PGRX_SCFG 6 +#endif +#if defined(DCB_CMD_PFC_GCFG) || (defined(HAVE_DECL_DCB_CMD_PFC_GCFG) && HAVE_DECL_DCB_CMD_PFC_GCFG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_PFC_GCFG) == (7), "DCB_CMD_PFC_GCFG != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_PFC_GCFG 7 +#endif +#if defined(DCB_CMD_PFC_SCFG) || (defined(HAVE_DECL_DCB_CMD_PFC_SCFG) && HAVE_DECL_DCB_CMD_PFC_SCFG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_PFC_SCFG) == (8), "DCB_CMD_PFC_SCFG != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_PFC_SCFG 8 +#endif +#if defined(DCB_CMD_SET_ALL) || (defined(HAVE_DECL_DCB_CMD_SET_ALL) && HAVE_DECL_DCB_CMD_SET_ALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_SET_ALL) == (9), "DCB_CMD_SET_ALL != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_SET_ALL 9 +#endif +#if defined(DCB_CMD_GPERM_HWADDR) || (defined(HAVE_DECL_DCB_CMD_GPERM_HWADDR) && HAVE_DECL_DCB_CMD_GPERM_HWADDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_GPERM_HWADDR) == (10), "DCB_CMD_GPERM_HWADDR != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_GPERM_HWADDR 10 +#endif +#if defined(DCB_CMD_GCAP) || (defined(HAVE_DECL_DCB_CMD_GCAP) && HAVE_DECL_DCB_CMD_GCAP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_GCAP) == (11), "DCB_CMD_GCAP != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_GCAP 11 +#endif +#if defined(DCB_CMD_GNUMTCS) || (defined(HAVE_DECL_DCB_CMD_GNUMTCS) && HAVE_DECL_DCB_CMD_GNUMTCS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_GNUMTCS) == (12), "DCB_CMD_GNUMTCS != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_GNUMTCS 12 +#endif +#if defined(DCB_CMD_SNUMTCS) || (defined(HAVE_DECL_DCB_CMD_SNUMTCS) && HAVE_DECL_DCB_CMD_SNUMTCS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_SNUMTCS) == (13), "DCB_CMD_SNUMTCS != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_SNUMTCS 13 +#endif +#if defined(DCB_CMD_PFC_GSTATE) || (defined(HAVE_DECL_DCB_CMD_PFC_GSTATE) && HAVE_DECL_DCB_CMD_PFC_GSTATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_PFC_GSTATE) == (14), "DCB_CMD_PFC_GSTATE != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_PFC_GSTATE 14 +#endif +#if defined(DCB_CMD_PFC_SSTATE) || (defined(HAVE_DECL_DCB_CMD_PFC_SSTATE) && HAVE_DECL_DCB_CMD_PFC_SSTATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_PFC_SSTATE) == (15), "DCB_CMD_PFC_SSTATE != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_PFC_SSTATE 15 +#endif +#if defined(DCB_CMD_BCN_GCFG) || (defined(HAVE_DECL_DCB_CMD_BCN_GCFG) && HAVE_DECL_DCB_CMD_BCN_GCFG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_BCN_GCFG) == (16), "DCB_CMD_BCN_GCFG != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_BCN_GCFG 16 +#endif +#if defined(DCB_CMD_BCN_SCFG) || (defined(HAVE_DECL_DCB_CMD_BCN_SCFG) && HAVE_DECL_DCB_CMD_BCN_SCFG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_BCN_SCFG) == (17), "DCB_CMD_BCN_SCFG != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_BCN_SCFG 17 +#endif +#if defined(DCB_CMD_GAPP) || (defined(HAVE_DECL_DCB_CMD_GAPP) && HAVE_DECL_DCB_CMD_GAPP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_GAPP) == (18), "DCB_CMD_GAPP != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_GAPP 18 +#endif +#if defined(DCB_CMD_SAPP) || (defined(HAVE_DECL_DCB_CMD_SAPP) && HAVE_DECL_DCB_CMD_SAPP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_SAPP) == (19), "DCB_CMD_SAPP != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_SAPP 19 +#endif +#if defined(DCB_CMD_IEEE_SET) || (defined(HAVE_DECL_DCB_CMD_IEEE_SET) && HAVE_DECL_DCB_CMD_IEEE_SET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_IEEE_SET) == (20), "DCB_CMD_IEEE_SET != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_IEEE_SET 20 +#endif +#if defined(DCB_CMD_IEEE_GET) || (defined(HAVE_DECL_DCB_CMD_IEEE_GET) && HAVE_DECL_DCB_CMD_IEEE_GET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_IEEE_GET) == (21), "DCB_CMD_IEEE_GET != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_IEEE_GET 21 +#endif +#if defined(DCB_CMD_GDCBX) || (defined(HAVE_DECL_DCB_CMD_GDCBX) && HAVE_DECL_DCB_CMD_GDCBX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_GDCBX) == (22), "DCB_CMD_GDCBX != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_GDCBX 22 +#endif +#if defined(DCB_CMD_SDCBX) || (defined(HAVE_DECL_DCB_CMD_SDCBX) && HAVE_DECL_DCB_CMD_SDCBX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_SDCBX) == (23), "DCB_CMD_SDCBX != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_SDCBX 23 +#endif +#if defined(DCB_CMD_GFEATCFG) || (defined(HAVE_DECL_DCB_CMD_GFEATCFG) && HAVE_DECL_DCB_CMD_GFEATCFG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_GFEATCFG) == (24), "DCB_CMD_GFEATCFG != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_GFEATCFG 24 +#endif +#if defined(DCB_CMD_SFEATCFG) || (defined(HAVE_DECL_DCB_CMD_SFEATCFG) && HAVE_DECL_DCB_CMD_SFEATCFG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_SFEATCFG) == (25), "DCB_CMD_SFEATCFG != 25"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_SFEATCFG 25 +#endif +#if defined(DCB_CMD_CEE_GET) || (defined(HAVE_DECL_DCB_CMD_CEE_GET) && HAVE_DECL_DCB_CMD_CEE_GET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_CEE_GET) == (26), "DCB_CMD_CEE_GET != 26"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_CEE_GET 26 +#endif +#if defined(DCB_CMD_IEEE_DEL) || (defined(HAVE_DECL_DCB_CMD_IEEE_DEL) && HAVE_DECL_DCB_CMD_IEEE_DEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_CMD_IEEE_DEL) == (27), "DCB_CMD_IEEE_DEL != 27"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_CMD_IEEE_DEL 27 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat dcb_commands in mpers mode + +# else + +static +const struct xlat dcb_commands[] = { + XLAT(DCB_CMD_UNDEFINED), + XLAT(DCB_CMD_GSTATE), + XLAT(DCB_CMD_SSTATE), + XLAT(DCB_CMD_PGTX_GCFG), + XLAT(DCB_CMD_PGTX_SCFG), + XLAT(DCB_CMD_PGRX_GCFG), + XLAT(DCB_CMD_PGRX_SCFG), + XLAT(DCB_CMD_PFC_GCFG), + XLAT(DCB_CMD_PFC_SCFG), + XLAT(DCB_CMD_SET_ALL), + XLAT(DCB_CMD_GPERM_HWADDR), + XLAT(DCB_CMD_GCAP), + XLAT(DCB_CMD_GNUMTCS), + XLAT(DCB_CMD_SNUMTCS), + XLAT(DCB_CMD_PFC_GSTATE), + XLAT(DCB_CMD_PFC_SSTATE), + XLAT(DCB_CMD_BCN_GCFG), + XLAT(DCB_CMD_BCN_SCFG), + XLAT(DCB_CMD_GAPP), + XLAT(DCB_CMD_SAPP), + XLAT(DCB_CMD_IEEE_SET), + XLAT(DCB_CMD_IEEE_GET), + XLAT(DCB_CMD_GDCBX), + XLAT(DCB_CMD_SDCBX), + XLAT(DCB_CMD_GFEATCFG), + XLAT(DCB_CMD_SFEATCFG), + XLAT(DCB_CMD_CEE_GET), + XLAT(DCB_CMD_IEEE_DEL), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/dcb_commands.in b/xlat/dcb_commands.in new file mode 100644 index 00000000..6a5e6133 --- /dev/null +++ b/xlat/dcb_commands.in @@ -0,0 +1,28 @@ +DCB_CMD_UNDEFINED 0 +DCB_CMD_GSTATE 1 +DCB_CMD_SSTATE 2 +DCB_CMD_PGTX_GCFG 3 +DCB_CMD_PGTX_SCFG 4 +DCB_CMD_PGRX_GCFG 5 +DCB_CMD_PGRX_SCFG 6 +DCB_CMD_PFC_GCFG 7 +DCB_CMD_PFC_SCFG 8 +DCB_CMD_SET_ALL 9 +DCB_CMD_GPERM_HWADDR 10 +DCB_CMD_GCAP 11 +DCB_CMD_GNUMTCS 12 +DCB_CMD_SNUMTCS 13 +DCB_CMD_PFC_GSTATE 14 +DCB_CMD_PFC_SSTATE 15 +DCB_CMD_BCN_GCFG 16 +DCB_CMD_BCN_SCFG 17 +DCB_CMD_GAPP 18 +DCB_CMD_SAPP 19 +DCB_CMD_IEEE_SET 20 +DCB_CMD_IEEE_GET 21 +DCB_CMD_GDCBX 22 +DCB_CMD_SDCBX 23 +DCB_CMD_GFEATCFG 24 +DCB_CMD_SFEATCFG 25 +DCB_CMD_CEE_GET 26 +DCB_CMD_IEEE_DEL 27 diff --git a/xlat/delete_module_flags.h b/xlat/delete_module_flags.h index 279c45ab..8c09810a 100644 --- a/xlat/delete_module_flags.h +++ b/xlat/delete_module_flags.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/delete_module_flags.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat delete_module_flags in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat delete_module_flags in mpers mode + +# else static const struct xlat delete_module_flags[] = { @@ -17,4 +23,6 @@ const struct xlat delete_module_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/dirent_types.h b/xlat/dirent_types.h index 42df495e..0d21f501 100644 --- a/xlat/dirent_types.h +++ b/xlat/dirent_types.h @@ -1,6 +1,12 @@ /* Generated by ./xlat/gen.sh from ./xlat/dirent_types.in; do not edit. */ -#ifndef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS const struct xlat dirent_types[] = { #if defined(DT_UNKNOWN) || (defined(HAVE_DECL_DT_UNKNOWN) && HAVE_DECL_DT_UNKNOWN) @@ -33,4 +39,6 @@ const struct xlat dirent_types[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/dm_flags.h b/xlat/dm_flags.h index 921b7b06..88b508cb 100644 --- a/xlat/dm_flags.h +++ b/xlat/dm_flags.h @@ -1,70 +1,148 @@ /* Generated by ./xlat/gen.sh from ./xlat/dm_flags.in; do not edit. */ -#if !(defined(DM_READONLY_FLAG) || (defined(HAVE_DECL_DM_READONLY_FLAG) && HAVE_DECL_DM_READONLY_FLAG)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(DM_READONLY_FLAG) || (defined(HAVE_DECL_DM_READONLY_FLAG) && HAVE_DECL_DM_READONLY_FLAG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DM_READONLY_FLAG) == ((1 << 0)), "DM_READONLY_FLAG != (1 << 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define DM_READONLY_FLAG (1 << 0) #endif -#if !(defined(DM_SUSPEND_FLAG) || (defined(HAVE_DECL_DM_SUSPEND_FLAG) && HAVE_DECL_DM_SUSPEND_FLAG)) +#if defined(DM_SUSPEND_FLAG) || (defined(HAVE_DECL_DM_SUSPEND_FLAG) && HAVE_DECL_DM_SUSPEND_FLAG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DM_SUSPEND_FLAG) == ((1 << 1)), "DM_SUSPEND_FLAG != (1 << 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define DM_SUSPEND_FLAG (1 << 1) #endif -#if !(defined(DM_EXISTS_FLAG) || (defined(HAVE_DECL_DM_EXISTS_FLAG) && HAVE_DECL_DM_EXISTS_FLAG)) +#if defined(DM_EXISTS_FLAG) || (defined(HAVE_DECL_DM_EXISTS_FLAG) && HAVE_DECL_DM_EXISTS_FLAG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DM_EXISTS_FLAG) == ((1 << 2)), "DM_EXISTS_FLAG != (1 << 2)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define DM_EXISTS_FLAG (1 << 2) #endif -#if !(defined(DM_PERSISTENT_DEV_FLAG) || (defined(HAVE_DECL_DM_PERSISTENT_DEV_FLAG) && HAVE_DECL_DM_PERSISTENT_DEV_FLAG)) +#if defined(DM_PERSISTENT_DEV_FLAG) || (defined(HAVE_DECL_DM_PERSISTENT_DEV_FLAG) && HAVE_DECL_DM_PERSISTENT_DEV_FLAG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DM_PERSISTENT_DEV_FLAG) == ((1 << 3)), "DM_PERSISTENT_DEV_FLAG != (1 << 3)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define DM_PERSISTENT_DEV_FLAG (1 << 3) #endif -#if !(defined(DM_STATUS_TABLE_FLAG) || (defined(HAVE_DECL_DM_STATUS_TABLE_FLAG) && HAVE_DECL_DM_STATUS_TABLE_FLAG)) +#if defined(DM_STATUS_TABLE_FLAG) || (defined(HAVE_DECL_DM_STATUS_TABLE_FLAG) && HAVE_DECL_DM_STATUS_TABLE_FLAG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DM_STATUS_TABLE_FLAG) == ((1 << 4)), "DM_STATUS_TABLE_FLAG != (1 << 4)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define DM_STATUS_TABLE_FLAG (1 << 4) #endif -#if !(defined(DM_ACTIVE_PRESENT_FLAG) || (defined(HAVE_DECL_DM_ACTIVE_PRESENT_FLAG) && HAVE_DECL_DM_ACTIVE_PRESENT_FLAG)) +#if defined(DM_ACTIVE_PRESENT_FLAG) || (defined(HAVE_DECL_DM_ACTIVE_PRESENT_FLAG) && HAVE_DECL_DM_ACTIVE_PRESENT_FLAG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DM_ACTIVE_PRESENT_FLAG) == ((1 << 5)), "DM_ACTIVE_PRESENT_FLAG != (1 << 5)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define DM_ACTIVE_PRESENT_FLAG (1 << 5) #endif -#if !(defined(DM_INACTIVE_PRESENT_FLAG) || (defined(HAVE_DECL_DM_INACTIVE_PRESENT_FLAG) && HAVE_DECL_DM_INACTIVE_PRESENT_FLAG)) +#if defined(DM_INACTIVE_PRESENT_FLAG) || (defined(HAVE_DECL_DM_INACTIVE_PRESENT_FLAG) && HAVE_DECL_DM_INACTIVE_PRESENT_FLAG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DM_INACTIVE_PRESENT_FLAG) == ((1 << 6)), "DM_INACTIVE_PRESENT_FLAG != (1 << 6)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define DM_INACTIVE_PRESENT_FLAG (1 << 6) #endif -#if !(defined(DM_BUFFER_FULL_FLAG) || (defined(HAVE_DECL_DM_BUFFER_FULL_FLAG) && HAVE_DECL_DM_BUFFER_FULL_FLAG)) +#if defined(DM_BUFFER_FULL_FLAG) || (defined(HAVE_DECL_DM_BUFFER_FULL_FLAG) && HAVE_DECL_DM_BUFFER_FULL_FLAG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DM_BUFFER_FULL_FLAG) == ((1 << 8)), "DM_BUFFER_FULL_FLAG != (1 << 8)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define DM_BUFFER_FULL_FLAG (1 << 8) #endif -#if !(defined(DM_SKIP_BDGET_FLAG) || (defined(HAVE_DECL_DM_SKIP_BDGET_FLAG) && HAVE_DECL_DM_SKIP_BDGET_FLAG)) +#if defined(DM_SKIP_BDGET_FLAG) || (defined(HAVE_DECL_DM_SKIP_BDGET_FLAG) && HAVE_DECL_DM_SKIP_BDGET_FLAG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DM_SKIP_BDGET_FLAG) == ((1 << 9)), "DM_SKIP_BDGET_FLAG != (1 << 9)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define DM_SKIP_BDGET_FLAG (1 << 9) #endif -#if !(defined(DM_SKIP_LOCKFS_FLAG) || (defined(HAVE_DECL_DM_SKIP_LOCKFS_FLAG) && HAVE_DECL_DM_SKIP_LOCKFS_FLAG)) +#if defined(DM_SKIP_LOCKFS_FLAG) || (defined(HAVE_DECL_DM_SKIP_LOCKFS_FLAG) && HAVE_DECL_DM_SKIP_LOCKFS_FLAG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DM_SKIP_LOCKFS_FLAG) == ((1 << 10)), "DM_SKIP_LOCKFS_FLAG != (1 << 10)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define DM_SKIP_LOCKFS_FLAG (1 << 10) #endif -#if !(defined(DM_NOFLUSH_FLAG) || (defined(HAVE_DECL_DM_NOFLUSH_FLAG) && HAVE_DECL_DM_NOFLUSH_FLAG)) +#if defined(DM_NOFLUSH_FLAG) || (defined(HAVE_DECL_DM_NOFLUSH_FLAG) && HAVE_DECL_DM_NOFLUSH_FLAG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DM_NOFLUSH_FLAG) == ((1 << 11)), "DM_NOFLUSH_FLAG != (1 << 11)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define DM_NOFLUSH_FLAG (1 << 11) #endif -#if !(defined(DM_QUERY_INACTIVE_TABLE_FLAG) || (defined(HAVE_DECL_DM_QUERY_INACTIVE_TABLE_FLAG) && HAVE_DECL_DM_QUERY_INACTIVE_TABLE_FLAG)) +#if defined(DM_QUERY_INACTIVE_TABLE_FLAG) || (defined(HAVE_DECL_DM_QUERY_INACTIVE_TABLE_FLAG) && HAVE_DECL_DM_QUERY_INACTIVE_TABLE_FLAG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DM_QUERY_INACTIVE_TABLE_FLAG) == ((1 << 12)), "DM_QUERY_INACTIVE_TABLE_FLAG != (1 << 12)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define DM_QUERY_INACTIVE_TABLE_FLAG (1 << 12) #endif -#if !(defined(DM_UEVENT_GENERATED_FLAG) || (defined(HAVE_DECL_DM_UEVENT_GENERATED_FLAG) && HAVE_DECL_DM_UEVENT_GENERATED_FLAG)) +#if defined(DM_UEVENT_GENERATED_FLAG) || (defined(HAVE_DECL_DM_UEVENT_GENERATED_FLAG) && HAVE_DECL_DM_UEVENT_GENERATED_FLAG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DM_UEVENT_GENERATED_FLAG) == ((1 << 13)), "DM_UEVENT_GENERATED_FLAG != (1 << 13)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define DM_UEVENT_GENERATED_FLAG (1 << 13) #endif -#if !(defined(DM_UUID_FLAG) || (defined(HAVE_DECL_DM_UUID_FLAG) && HAVE_DECL_DM_UUID_FLAG)) +#if defined(DM_UUID_FLAG) || (defined(HAVE_DECL_DM_UUID_FLAG) && HAVE_DECL_DM_UUID_FLAG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DM_UUID_FLAG) == ((1 << 14)), "DM_UUID_FLAG != (1 << 14)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define DM_UUID_FLAG (1 << 14) #endif -#if !(defined(DM_SECURE_DATA_FLAG) || (defined(HAVE_DECL_DM_SECURE_DATA_FLAG) && HAVE_DECL_DM_SECURE_DATA_FLAG)) +#if defined(DM_SECURE_DATA_FLAG) || (defined(HAVE_DECL_DM_SECURE_DATA_FLAG) && HAVE_DECL_DM_SECURE_DATA_FLAG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DM_SECURE_DATA_FLAG) == ((1 << 15)), "DM_SECURE_DATA_FLAG != (1 << 15)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define DM_SECURE_DATA_FLAG (1 << 15) #endif -#if !(defined(DM_DATA_OUT_FLAG) || (defined(HAVE_DECL_DM_DATA_OUT_FLAG) && HAVE_DECL_DM_DATA_OUT_FLAG)) +#if defined(DM_DATA_OUT_FLAG) || (defined(HAVE_DECL_DM_DATA_OUT_FLAG) && HAVE_DECL_DM_DATA_OUT_FLAG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DM_DATA_OUT_FLAG) == ((1 << 16)), "DM_DATA_OUT_FLAG != (1 << 16)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define DM_DATA_OUT_FLAG (1 << 16) #endif -#if !(defined(DM_DEFERRED_REMOVE) || (defined(HAVE_DECL_DM_DEFERRED_REMOVE) && HAVE_DECL_DM_DEFERRED_REMOVE)) +#if defined(DM_DEFERRED_REMOVE) || (defined(HAVE_DECL_DM_DEFERRED_REMOVE) && HAVE_DECL_DM_DEFERRED_REMOVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DM_DEFERRED_REMOVE) == ((1 << 17)), "DM_DEFERRED_REMOVE != (1 << 17)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define DM_DEFERRED_REMOVE (1 << 17) #endif -#if !(defined(DM_INTERNAL_SUSPEND_FLAG) || (defined(HAVE_DECL_DM_INTERNAL_SUSPEND_FLAG) && HAVE_DECL_DM_INTERNAL_SUSPEND_FLAG)) +#if defined(DM_INTERNAL_SUSPEND_FLAG) || (defined(HAVE_DECL_DM_INTERNAL_SUSPEND_FLAG) && HAVE_DECL_DM_INTERNAL_SUSPEND_FLAG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DM_INTERNAL_SUSPEND_FLAG) == ((1 << 18)), "DM_INTERNAL_SUSPEND_FLAG != (1 << 18)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define DM_INTERNAL_SUSPEND_FLAG (1 << 18) #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat dm_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat dm_flags in mpers mode + +# else static const struct xlat dm_flags[] = { XLAT(DM_READONLY_FLAG), XLAT(DM_SUSPEND_FLAG), -/* Defined in lvm2/libdm/ioctl/libdm-iface.c */ + XLAT(DM_EXISTS_FLAG), XLAT(DM_PERSISTENT_DEV_FLAG), XLAT(DM_STATUS_TABLE_FLAG), @@ -84,4 +162,6 @@ const struct xlat dm_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ebpf_class.h b/xlat/ebpf_class.h new file mode 100644 index 00000000..f8d5ac43 --- /dev/null +++ b/xlat/ebpf_class.h @@ -0,0 +1,86 @@ +/* Generated by ./xlat/gen.sh from ./xlat/ebpf_class.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BPF_LD) || (defined(HAVE_DECL_BPF_LD) && HAVE_DECL_BPF_LD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_LD) == (0x0), "BPF_LD != 0x0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_LD 0x0 +#endif +#if defined(BPF_LDX) || (defined(HAVE_DECL_BPF_LDX) && HAVE_DECL_BPF_LDX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_LDX) == (0x1), "BPF_LDX != 0x1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_LDX 0x1 +#endif +#if defined(BPF_ST) || (defined(HAVE_DECL_BPF_ST) && HAVE_DECL_BPF_ST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_ST) == (0x2), "BPF_ST != 0x2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_ST 0x2 +#endif +#if defined(BPF_STX) || (defined(HAVE_DECL_BPF_STX) && HAVE_DECL_BPF_STX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_STX) == (0x3), "BPF_STX != 0x3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_STX 0x3 +#endif +#if defined(BPF_ALU) || (defined(HAVE_DECL_BPF_ALU) && HAVE_DECL_BPF_ALU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_ALU) == (0x4), "BPF_ALU != 0x4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_ALU 0x4 +#endif +#if defined(BPF_JMP) || (defined(HAVE_DECL_BPF_JMP) && HAVE_DECL_BPF_JMP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_JMP) == (0x5), "BPF_JMP != 0x5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_JMP 0x5 +#endif +#if defined(BPF_JMP32) || (defined(HAVE_DECL_BPF_JMP32) && HAVE_DECL_BPF_JMP32) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_JMP32) == (0x6), "BPF_JMP32 != 0x6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_JMP32 0x6 +#endif +#if defined(BPF_ALU64) || (defined(HAVE_DECL_BPF_ALU64) && HAVE_DECL_BPF_ALU64) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_ALU64) == (0x7), "BPF_ALU64 != 0x7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_ALU64 0x7 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat ebpf_class in mpers mode + +# else + +static +const struct xlat ebpf_class[] = { + [BPF_LD] = XLAT(BPF_LD), + [BPF_LDX] = XLAT(BPF_LDX), + [BPF_ST] = XLAT(BPF_ST), + [BPF_STX] = XLAT(BPF_STX), + [BPF_ALU] = XLAT(BPF_ALU), + [BPF_JMP] = XLAT(BPF_JMP), + [BPF_JMP32] = XLAT(BPF_JMP32), + [BPF_ALU64] = XLAT(BPF_ALU64), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ebpf_class.in b/xlat/ebpf_class.in new file mode 100644 index 00000000..259bdd9d --- /dev/null +++ b/xlat/ebpf_class.in @@ -0,0 +1,9 @@ +#value_indexed +BPF_LD 0x0 +BPF_LDX 0x1 +BPF_ST 0x2 +BPF_STX 0x3 +BPF_ALU 0x4 +BPF_JMP 0x5 +BPF_JMP32 0x6 +BPF_ALU64 0x7 diff --git a/xlat/ebpf_mode.h b/xlat/ebpf_mode.h new file mode 100644 index 00000000..5fddcfb6 --- /dev/null +++ b/xlat/ebpf_mode.h @@ -0,0 +1,62 @@ +/* Generated by ./xlat/gen.sh from ./xlat/ebpf_mode.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BPF_IMM) || (defined(HAVE_DECL_BPF_IMM) && HAVE_DECL_BPF_IMM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_IMM) == (0x00), "BPF_IMM != 0x00"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_IMM 0x00 +#endif +#if defined(BPF_ABS) || (defined(HAVE_DECL_BPF_ABS) && HAVE_DECL_BPF_ABS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_ABS) == (0x20), "BPF_ABS != 0x20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_ABS 0x20 +#endif +#if defined(BPF_IND) || (defined(HAVE_DECL_BPF_IND) && HAVE_DECL_BPF_IND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_IND) == (0x40), "BPF_IND != 0x40"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_IND 0x40 +#endif +#if defined(BPF_MEM) || (defined(HAVE_DECL_BPF_MEM) && HAVE_DECL_BPF_MEM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MEM) == (0x60), "BPF_MEM != 0x60"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_MEM 0x60 +#endif +#if defined(BPF_XADD) || (defined(HAVE_DECL_BPF_XADD) && HAVE_DECL_BPF_XADD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_XADD) == (0xc0), "BPF_XADD != 0xc0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_XADD 0xc0 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat ebpf_mode in mpers mode + +# else + +static +const struct xlat ebpf_mode[] = { + XLAT(BPF_IMM), + XLAT(BPF_ABS), + XLAT(BPF_IND), + XLAT(BPF_MEM), + XLAT(BPF_XADD), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ebpf_mode.in b/xlat/ebpf_mode.in new file mode 100644 index 00000000..d8a65b6d --- /dev/null +++ b/xlat/ebpf_mode.in @@ -0,0 +1,5 @@ +BPF_IMM 0x00 +BPF_ABS 0x20 +BPF_IND 0x40 +BPF_MEM 0x60 +BPF_XADD 0xc0 diff --git a/xlat/ebpf_op_alu.h b/xlat/ebpf_op_alu.h new file mode 100644 index 00000000..2a5151c3 --- /dev/null +++ b/xlat/ebpf_op_alu.h @@ -0,0 +1,46 @@ +/* Generated by ./xlat/gen.sh from ./xlat/ebpf_op_alu.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BPF_MOV) || (defined(HAVE_DECL_BPF_MOV) && HAVE_DECL_BPF_MOV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_MOV) == (0xb0), "BPF_MOV != 0xb0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_MOV 0xb0 +#endif +#if defined(BPF_ARSH) || (defined(HAVE_DECL_BPF_ARSH) && HAVE_DECL_BPF_ARSH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_ARSH) == (0xc0), "BPF_ARSH != 0xc0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_ARSH 0xc0 +#endif +#if defined(BPF_END) || (defined(HAVE_DECL_BPF_END) && HAVE_DECL_BPF_END) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_END) == (0xd0), "BPF_END != 0xd0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_END 0xd0 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat ebpf_op_alu in mpers mode + +# else + +static +const struct xlat ebpf_op_alu[] = { + XLAT(BPF_MOV), + XLAT(BPF_ARSH), + XLAT(BPF_END), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ebpf_op_alu.in b/xlat/ebpf_op_alu.in new file mode 100644 index 00000000..2b46f200 --- /dev/null +++ b/xlat/ebpf_op_alu.in @@ -0,0 +1,3 @@ +BPF_MOV 0xb0 +BPF_ARSH 0xc0 +BPF_END 0xd0 diff --git a/xlat/ebpf_op_jmp.h b/xlat/ebpf_op_jmp.h new file mode 100644 index 00000000..d1feb21c --- /dev/null +++ b/xlat/ebpf_op_jmp.h @@ -0,0 +1,94 @@ +/* Generated by ./xlat/gen.sh from ./xlat/ebpf_op_jmp.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BPF_JNE) || (defined(HAVE_DECL_BPF_JNE) && HAVE_DECL_BPF_JNE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_JNE) == (0x50), "BPF_JNE != 0x50"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_JNE 0x50 +#endif +#if defined(BPF_JSGT) || (defined(HAVE_DECL_BPF_JSGT) && HAVE_DECL_BPF_JSGT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_JSGT) == (0x60), "BPF_JSGT != 0x60"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_JSGT 0x60 +#endif +#if defined(BPF_JSGE) || (defined(HAVE_DECL_BPF_JSGE) && HAVE_DECL_BPF_JSGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_JSGE) == (0x70), "BPF_JSGE != 0x70"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_JSGE 0x70 +#endif +#if defined(BPF_CALL) || (defined(HAVE_DECL_BPF_CALL) && HAVE_DECL_BPF_CALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_CALL) == (0x80), "BPF_CALL != 0x80"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_CALL 0x80 +#endif +#if defined(BPF_EXIT) || (defined(HAVE_DECL_BPF_EXIT) && HAVE_DECL_BPF_EXIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_EXIT) == (0x90), "BPF_EXIT != 0x90"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_EXIT 0x90 +#endif +#if defined(BPF_JLT) || (defined(HAVE_DECL_BPF_JLT) && HAVE_DECL_BPF_JLT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_JLT) == (0xa0), "BPF_JLT != 0xa0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_JLT 0xa0 +#endif +#if defined(BPF_JLE) || (defined(HAVE_DECL_BPF_JLE) && HAVE_DECL_BPF_JLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_JLE) == (0xb0), "BPF_JLE != 0xb0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_JLE 0xb0 +#endif +#if defined(BPF_JSLT) || (defined(HAVE_DECL_BPF_JSLT) && HAVE_DECL_BPF_JSLT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_JSLT) == (0xc0), "BPF_JSLT != 0xc0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_JSLT 0xc0 +#endif +#if defined(BPF_JSLE) || (defined(HAVE_DECL_BPF_JSLE) && HAVE_DECL_BPF_JSLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_JSLE) == (0xd0), "BPF_JSLE != 0xd0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_JSLE 0xd0 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat ebpf_op_jmp in mpers mode + +# else + +static +const struct xlat ebpf_op_jmp[] = { + XLAT(BPF_JNE), + XLAT(BPF_JSGT), + XLAT(BPF_JSGE), + XLAT(BPF_CALL), + XLAT(BPF_EXIT), + XLAT(BPF_JLT), + XLAT(BPF_JLE), + XLAT(BPF_JSLT), + XLAT(BPF_JSLE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ebpf_op_jmp.in b/xlat/ebpf_op_jmp.in new file mode 100644 index 00000000..8d49cf67 --- /dev/null +++ b/xlat/ebpf_op_jmp.in @@ -0,0 +1,9 @@ +BPF_JNE 0x50 +BPF_JSGT 0x60 +BPF_JSGE 0x70 +BPF_CALL 0x80 +BPF_EXIT 0x90 +BPF_JLT 0xa0 +BPF_JLE 0xb0 +BPF_JSLT 0xc0 +BPF_JSLE 0xd0 diff --git a/xlat/ebpf_regs.h b/xlat/ebpf_regs.h new file mode 100644 index 00000000..67985169 --- /dev/null +++ b/xlat/ebpf_regs.h @@ -0,0 +1,110 @@ +/* Generated by ./xlat/gen.sh from ./xlat/ebpf_regs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BPF_REG_0) || (defined(HAVE_DECL_BPF_REG_0) && HAVE_DECL_BPF_REG_0) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_REG_0) == (0), "BPF_REG_0 != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_REG_0 0 +#endif +#if defined(BPF_REG_1) || (defined(HAVE_DECL_BPF_REG_1) && HAVE_DECL_BPF_REG_1) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_REG_1) == (1), "BPF_REG_1 != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_REG_1 1 +#endif +#if defined(BPF_REG_2) || (defined(HAVE_DECL_BPF_REG_2) && HAVE_DECL_BPF_REG_2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_REG_2) == (2), "BPF_REG_2 != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_REG_2 2 +#endif +#if defined(BPF_REG_3) || (defined(HAVE_DECL_BPF_REG_3) && HAVE_DECL_BPF_REG_3) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_REG_3) == (3), "BPF_REG_3 != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_REG_3 3 +#endif +#if defined(BPF_REG_4) || (defined(HAVE_DECL_BPF_REG_4) && HAVE_DECL_BPF_REG_4) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_REG_4) == (4), "BPF_REG_4 != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_REG_4 4 +#endif +#if defined(BPF_REG_5) || (defined(HAVE_DECL_BPF_REG_5) && HAVE_DECL_BPF_REG_5) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_REG_5) == (5), "BPF_REG_5 != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_REG_5 5 +#endif +#if defined(BPF_REG_6) || (defined(HAVE_DECL_BPF_REG_6) && HAVE_DECL_BPF_REG_6) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_REG_6) == (6), "BPF_REG_6 != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_REG_6 6 +#endif +#if defined(BPF_REG_7) || (defined(HAVE_DECL_BPF_REG_7) && HAVE_DECL_BPF_REG_7) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_REG_7) == (7), "BPF_REG_7 != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_REG_7 7 +#endif +#if defined(BPF_REG_8) || (defined(HAVE_DECL_BPF_REG_8) && HAVE_DECL_BPF_REG_8) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_REG_8) == (8), "BPF_REG_8 != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_REG_8 8 +#endif +#if defined(BPF_REG_9) || (defined(HAVE_DECL_BPF_REG_9) && HAVE_DECL_BPF_REG_9) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_REG_9) == (9), "BPF_REG_9 != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_REG_9 9 +#endif +#if defined(BPF_REG_10) || (defined(HAVE_DECL_BPF_REG_10) && HAVE_DECL_BPF_REG_10) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_REG_10) == (10), "BPF_REG_10 != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_REG_10 10 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat ebpf_regs in mpers mode + +# else + +static +const struct xlat ebpf_regs[] = { + [BPF_REG_0] = XLAT(BPF_REG_0), + [BPF_REG_1] = XLAT(BPF_REG_1), + [BPF_REG_2] = XLAT(BPF_REG_2), + [BPF_REG_3] = XLAT(BPF_REG_3), + [BPF_REG_4] = XLAT(BPF_REG_4), + [BPF_REG_5] = XLAT(BPF_REG_5), + [BPF_REG_6] = XLAT(BPF_REG_6), + [BPF_REG_7] = XLAT(BPF_REG_7), + [BPF_REG_8] = XLAT(BPF_REG_8), + [BPF_REG_9] = XLAT(BPF_REG_9), + [BPF_REG_10] = XLAT(BPF_REG_10), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ebpf_regs.in b/xlat/ebpf_regs.in new file mode 100644 index 00000000..9db066ef --- /dev/null +++ b/xlat/ebpf_regs.in @@ -0,0 +1,12 @@ +#value_indexed +BPF_REG_0 0 +BPF_REG_1 1 +BPF_REG_2 2 +BPF_REG_3 3 +BPF_REG_4 4 +BPF_REG_5 5 +BPF_REG_6 6 +BPF_REG_7 7 +BPF_REG_8 8 +BPF_REG_9 9 +BPF_REG_10 10 diff --git a/xlat/ebpf_size.h b/xlat/ebpf_size.h new file mode 100644 index 00000000..b3d32d2d --- /dev/null +++ b/xlat/ebpf_size.h @@ -0,0 +1,30 @@ +/* Generated by ./xlat/gen.sh from ./xlat/ebpf_size.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BPF_DW) || (defined(HAVE_DECL_BPF_DW) && HAVE_DECL_BPF_DW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BPF_DW) == (0x18), "BPF_DW != 0x18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BPF_DW 0x18 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat ebpf_size in mpers mode + +# else + +static +const struct xlat ebpf_size[] = { + XLAT(BPF_DW), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ebpf_size.in b/xlat/ebpf_size.in new file mode 100644 index 00000000..5f9afa38 --- /dev/null +++ b/xlat/ebpf_size.in @@ -0,0 +1 @@ +BPF_DW 0x18 diff --git a/xlat/efd_flags.h b/xlat/efd_flags.h index 641f1169..e61316ad 100644 --- a/xlat/efd_flags.h +++ b/xlat/efd_flags.h @@ -1,21 +1,39 @@ /* Generated by ./xlat/gen.sh from ./xlat/efd_flags.in; do not edit. */ -#if !(defined(EFD_SEMAPHORE) || (defined(HAVE_DECL_EFD_SEMAPHORE) && HAVE_DECL_EFD_SEMAPHORE)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(EFD_SEMAPHORE) || (defined(HAVE_DECL_EFD_SEMAPHORE) && HAVE_DECL_EFD_SEMAPHORE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EFD_SEMAPHORE) == (1), "EFD_SEMAPHORE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define EFD_SEMAPHORE 1 #endif #if defined EFD_CLOEXEC || defined O_CLOEXEC -#if !(defined(EFD_CLOEXEC) || (defined(HAVE_DECL_EFD_CLOEXEC) && HAVE_DECL_EFD_CLOEXEC)) +#if defined(EFD_CLOEXEC) || (defined(HAVE_DECL_EFD_CLOEXEC) && HAVE_DECL_EFD_CLOEXEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EFD_CLOEXEC) == (O_CLOEXEC), "EFD_CLOEXEC != O_CLOEXEC"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define EFD_CLOEXEC O_CLOEXEC #endif #endif -#if !(defined(EFD_NONBLOCK) || (defined(HAVE_DECL_EFD_NONBLOCK) && HAVE_DECL_EFD_NONBLOCK)) +#if defined(EFD_NONBLOCK) || (defined(HAVE_DECL_EFD_NONBLOCK) && HAVE_DECL_EFD_NONBLOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EFD_NONBLOCK) == (O_NONBLOCK), "EFD_NONBLOCK != O_NONBLOCK"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define EFD_NONBLOCK O_NONBLOCK #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat efd_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat efd_flags in mpers mode + +# else static const struct xlat efd_flags[] = { @@ -27,4 +45,6 @@ const struct xlat efd_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/epollctls.h b/xlat/epollctls.h index 6b06d8c7..a3b7419b 100644 --- a/xlat/epollctls.h +++ b/xlat/epollctls.h @@ -1,19 +1,37 @@ /* Generated by ./xlat/gen.sh from ./xlat/epollctls.in; do not edit. */ -#if !(defined(EPOLL_CTL_ADD) || (defined(HAVE_DECL_EPOLL_CTL_ADD) && HAVE_DECL_EPOLL_CTL_ADD)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(EPOLL_CTL_ADD) || (defined(HAVE_DECL_EPOLL_CTL_ADD) && HAVE_DECL_EPOLL_CTL_ADD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EPOLL_CTL_ADD) == (1), "EPOLL_CTL_ADD != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define EPOLL_CTL_ADD 1 #endif -#if !(defined(EPOLL_CTL_DEL) || (defined(HAVE_DECL_EPOLL_CTL_DEL) && HAVE_DECL_EPOLL_CTL_DEL)) +#if defined(EPOLL_CTL_DEL) || (defined(HAVE_DECL_EPOLL_CTL_DEL) && HAVE_DECL_EPOLL_CTL_DEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EPOLL_CTL_DEL) == (2), "EPOLL_CTL_DEL != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define EPOLL_CTL_DEL 2 #endif -#if !(defined(EPOLL_CTL_MOD) || (defined(HAVE_DECL_EPOLL_CTL_MOD) && HAVE_DECL_EPOLL_CTL_MOD)) +#if defined(EPOLL_CTL_MOD) || (defined(HAVE_DECL_EPOLL_CTL_MOD) && HAVE_DECL_EPOLL_CTL_MOD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EPOLL_CTL_MOD) == (3), "EPOLL_CTL_MOD != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define EPOLL_CTL_MOD 3 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat epollctls in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat epollctls in mpers mode + +# else static const struct xlat epollctls[] = { @@ -23,4 +41,6 @@ const struct xlat epollctls[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/epollevents.h b/xlat/epollevents.h index 3b98b6d3..45d9cd94 100644 --- a/xlat/epollevents.h +++ b/xlat/epollevents.h @@ -1,59 +1,150 @@ /* Generated by ./xlat/gen.sh from ./xlat/epollevents.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat epollevents in mpers mode - -#else - -static -const struct xlat epollevents[] = { #if defined(EPOLLIN) || (defined(HAVE_DECL_EPOLLIN) && HAVE_DECL_EPOLLIN) - XLAT(EPOLLIN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EPOLLIN) == (0x00000001), "EPOLLIN != 0x00000001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EPOLLIN 0x00000001 #endif #if defined(EPOLLPRI) || (defined(HAVE_DECL_EPOLLPRI) && HAVE_DECL_EPOLLPRI) - XLAT(EPOLLPRI), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EPOLLPRI) == (0x00000002), "EPOLLPRI != 0x00000002"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EPOLLPRI 0x00000002 #endif #if defined(EPOLLOUT) || (defined(HAVE_DECL_EPOLLOUT) && HAVE_DECL_EPOLLOUT) - XLAT(EPOLLOUT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EPOLLOUT) == (0x00000004), "EPOLLOUT != 0x00000004"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EPOLLOUT 0x00000004 +#endif +#if defined(EPOLLERR) || (defined(HAVE_DECL_EPOLLERR) && HAVE_DECL_EPOLLERR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EPOLLERR) == (0x00000008), "EPOLLERR != 0x00000008"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EPOLLERR 0x00000008 +#endif +#if defined(EPOLLHUP) || (defined(HAVE_DECL_EPOLLHUP) && HAVE_DECL_EPOLLHUP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EPOLLHUP) == (0x00000010), "EPOLLHUP != 0x00000010"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EPOLLHUP 0x00000010 +#endif +#if defined(EPOLLNVAL) || (defined(HAVE_DECL_EPOLLNVAL) && HAVE_DECL_EPOLLNVAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EPOLLNVAL) == (0x00000020), "EPOLLNVAL != 0x00000020"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EPOLLNVAL 0x00000020 #endif #if defined(EPOLLRDNORM) || (defined(HAVE_DECL_EPOLLRDNORM) && HAVE_DECL_EPOLLRDNORM) - XLAT(EPOLLRDNORM), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EPOLLRDNORM) == (0x00000040), "EPOLLRDNORM != 0x00000040"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EPOLLRDNORM 0x00000040 #endif #if defined(EPOLLRDBAND) || (defined(HAVE_DECL_EPOLLRDBAND) && HAVE_DECL_EPOLLRDBAND) - XLAT(EPOLLRDBAND), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EPOLLRDBAND) == (0x00000080), "EPOLLRDBAND != 0x00000080"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EPOLLRDBAND 0x00000080 #endif #if defined(EPOLLWRNORM) || (defined(HAVE_DECL_EPOLLWRNORM) && HAVE_DECL_EPOLLWRNORM) - XLAT(EPOLLWRNORM), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EPOLLWRNORM) == (0x00000100), "EPOLLWRNORM != 0x00000100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EPOLLWRNORM 0x00000100 #endif #if defined(EPOLLWRBAND) || (defined(HAVE_DECL_EPOLLWRBAND) && HAVE_DECL_EPOLLWRBAND) - XLAT(EPOLLWRBAND), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EPOLLWRBAND) == (0x00000200), "EPOLLWRBAND != 0x00000200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EPOLLWRBAND 0x00000200 #endif #if defined(EPOLLMSG) || (defined(HAVE_DECL_EPOLLMSG) && HAVE_DECL_EPOLLMSG) - XLAT(EPOLLMSG), -#endif -#if defined(EPOLLERR) || (defined(HAVE_DECL_EPOLLERR) && HAVE_DECL_EPOLLERR) - XLAT(EPOLLERR), -#endif -#if defined(EPOLLHUP) || (defined(HAVE_DECL_EPOLLHUP) && HAVE_DECL_EPOLLHUP) - XLAT(EPOLLHUP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EPOLLMSG) == (0x00000400), "EPOLLMSG != 0x00000400"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EPOLLMSG 0x00000400 #endif #if defined(EPOLLRDHUP) || (defined(HAVE_DECL_EPOLLRDHUP) && HAVE_DECL_EPOLLRDHUP) - XLAT(EPOLLRDHUP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EPOLLRDHUP) == (0x00002000), "EPOLLRDHUP != 0x00002000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EPOLLRDHUP 0x00002000 #endif #if defined(EPOLLEXCLUSIVE) || (defined(HAVE_DECL_EPOLLEXCLUSIVE) && HAVE_DECL_EPOLLEXCLUSIVE) - XLAT(EPOLLEXCLUSIVE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EPOLLEXCLUSIVE) == (0x10000000), "EPOLLEXCLUSIVE != 0x10000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EPOLLEXCLUSIVE 0x10000000 #endif #if defined(EPOLLWAKEUP) || (defined(HAVE_DECL_EPOLLWAKEUP) && HAVE_DECL_EPOLLWAKEUP) - XLAT(EPOLLWAKEUP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EPOLLWAKEUP) == (0x20000000), "EPOLLWAKEUP != 0x20000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EPOLLWAKEUP 0x20000000 #endif #if defined(EPOLLONESHOT) || (defined(HAVE_DECL_EPOLLONESHOT) && HAVE_DECL_EPOLLONESHOT) - XLAT(EPOLLONESHOT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EPOLLONESHOT) == (0x40000000), "EPOLLONESHOT != 0x40000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EPOLLONESHOT 0x40000000 #endif #if defined(EPOLLET) || (defined(HAVE_DECL_EPOLLET) && HAVE_DECL_EPOLLET) - XLAT(EPOLLET), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EPOLLET) == (0x80000000), "EPOLLET != 0x80000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EPOLLET 0x80000000 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat epollevents in mpers mode + +# else + +static +const struct xlat epollevents[] = { + XLAT(EPOLLIN), + XLAT(EPOLLPRI), + XLAT(EPOLLOUT), + XLAT(EPOLLERR), + XLAT(EPOLLHUP), + XLAT(EPOLLNVAL), + XLAT(EPOLLRDNORM), + XLAT(EPOLLRDBAND), + XLAT(EPOLLWRNORM), + XLAT(EPOLLWRBAND), + XLAT(EPOLLMSG), + XLAT(EPOLLRDHUP), + XLAT(EPOLLEXCLUSIVE), + XLAT(EPOLLWAKEUP), + XLAT(EPOLLONESHOT), + XLAT(EPOLLET), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/epollevents.in b/xlat/epollevents.in index 6fa67074..2dced004 100644 --- a/xlat/epollevents.in +++ b/xlat/epollevents.in @@ -1,15 +1,16 @@ -EPOLLIN -EPOLLPRI -EPOLLOUT -EPOLLRDNORM -EPOLLRDBAND -EPOLLWRNORM -EPOLLWRBAND -EPOLLMSG -EPOLLERR -EPOLLHUP -EPOLLRDHUP -EPOLLEXCLUSIVE -EPOLLWAKEUP -EPOLLONESHOT -EPOLLET +EPOLLIN 0x00000001 +EPOLLPRI 0x00000002 +EPOLLOUT 0x00000004 +EPOLLERR 0x00000008 +EPOLLHUP 0x00000010 +EPOLLNVAL 0x00000020 +EPOLLRDNORM 0x00000040 +EPOLLRDBAND 0x00000080 +EPOLLWRNORM 0x00000100 +EPOLLWRBAND 0x00000200 +EPOLLMSG 0x00000400 +EPOLLRDHUP 0x00002000 +EPOLLEXCLUSIVE 0x10000000 +EPOLLWAKEUP 0x20000000 +EPOLLONESHOT 0x40000000 +EPOLLET 0x80000000 diff --git a/xlat/epollflags.h b/xlat/epollflags.h index cae4fe91..faf4b0ca 100644 --- a/xlat/epollflags.h +++ b/xlat/epollflags.h @@ -1,15 +1,25 @@ /* Generated by ./xlat/gen.sh from ./xlat/epollflags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + #if defined EPOLL_CLOEXEC || defined O_CLOEXEC -#if !(defined(EPOLL_CLOEXEC) || (defined(HAVE_DECL_EPOLL_CLOEXEC) && HAVE_DECL_EPOLL_CLOEXEC)) +#if defined(EPOLL_CLOEXEC) || (defined(HAVE_DECL_EPOLL_CLOEXEC) && HAVE_DECL_EPOLL_CLOEXEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EPOLL_CLOEXEC) == (O_CLOEXEC), "EPOLL_CLOEXEC != O_CLOEXEC"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define EPOLL_CLOEXEC O_CLOEXEC #endif #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat epollflags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat epollflags in mpers mode + +# else static const struct xlat epollflags[] = { @@ -19,4 +29,6 @@ const struct xlat epollflags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ethernet_protocols.h b/xlat/ethernet_protocols.h index 035ca8c8..67c64cbe 100644 --- a/xlat/ethernet_protocols.h +++ b/xlat/ethernet_protocols.h @@ -1,266 +1,746 @@ /* Generated by ./xlat/gen.sh from ./xlat/ethernet_protocols.in; do not edit. */ -#ifdef IN_MPERS - -# error static const struct xlat ethernet_protocols in mpers mode +#include "gcc_compat.h" +#include "static_assert.h" +#if defined(ETH_P_802_3) || (defined(HAVE_DECL_ETH_P_802_3) && HAVE_DECL_ETH_P_802_3) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_802_3) == (0x0001), "ETH_P_802_3 != 0x0001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE #else - -static -const struct xlat ethernet_protocols[] = { +# define ETH_P_802_3 0x0001 +#endif +#if defined(ETH_P_AX25) || (defined(HAVE_DECL_ETH_P_AX25) && HAVE_DECL_ETH_P_AX25) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_AX25) == (0x0002), "ETH_P_AX25 != 0x0002"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_AX25 0x0002 +#endif +#if defined(ETH_P_ALL) || (defined(HAVE_DECL_ETH_P_ALL) && HAVE_DECL_ETH_P_ALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_ALL) == (0x0003), "ETH_P_ALL != 0x0003"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_ALL 0x0003 +#endif +#if defined(ETH_P_802_2) || (defined(HAVE_DECL_ETH_P_802_2) && HAVE_DECL_ETH_P_802_2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_802_2) == (0x0004), "ETH_P_802_2 != 0x0004"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_802_2 0x0004 +#endif +#if defined(ETH_P_SNAP) || (defined(HAVE_DECL_ETH_P_SNAP) && HAVE_DECL_ETH_P_SNAP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_SNAP) == (0x0005), "ETH_P_SNAP != 0x0005"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_SNAP 0x0005 +#endif +#if defined(ETH_P_DDCMP) || (defined(HAVE_DECL_ETH_P_DDCMP) && HAVE_DECL_ETH_P_DDCMP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_DDCMP) == (0x0006), "ETH_P_DDCMP != 0x0006"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_DDCMP 0x0006 +#endif +#if defined(ETH_P_WAN_PPP) || (defined(HAVE_DECL_ETH_P_WAN_PPP) && HAVE_DECL_ETH_P_WAN_PPP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_WAN_PPP) == (0x0007), "ETH_P_WAN_PPP != 0x0007"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_WAN_PPP 0x0007 +#endif +#if defined(ETH_P_PPP_MP) || (defined(HAVE_DECL_ETH_P_PPP_MP) && HAVE_DECL_ETH_P_PPP_MP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_PPP_MP) == (0x0008), "ETH_P_PPP_MP != 0x0008"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_PPP_MP 0x0008 +#endif +#if defined(ETH_P_LOCALTALK) || (defined(HAVE_DECL_ETH_P_LOCALTALK) && HAVE_DECL_ETH_P_LOCALTALK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_LOCALTALK) == (0x0009), "ETH_P_LOCALTALK != 0x0009"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_LOCALTALK 0x0009 +#endif +#if defined(ETH_P_CAN) || (defined(HAVE_DECL_ETH_P_CAN) && HAVE_DECL_ETH_P_CAN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_CAN) == (0x000C), "ETH_P_CAN != 0x000C"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_CAN 0x000C +#endif +#if defined(ETH_P_CANFD) || (defined(HAVE_DECL_ETH_P_CANFD) && HAVE_DECL_ETH_P_CANFD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_CANFD) == (0x000D), "ETH_P_CANFD != 0x000D"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_CANFD 0x000D +#endif +#if defined(ETH_P_PPPTALK) || (defined(HAVE_DECL_ETH_P_PPPTALK) && HAVE_DECL_ETH_P_PPPTALK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_PPPTALK) == (0x0010), "ETH_P_PPPTALK != 0x0010"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_PPPTALK 0x0010 +#endif +#if defined(ETH_P_TR_802_2) || (defined(HAVE_DECL_ETH_P_TR_802_2) && HAVE_DECL_ETH_P_TR_802_2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_TR_802_2) == (0x0011), "ETH_P_TR_802_2 != 0x0011"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_TR_802_2 0x0011 +#endif +#if defined(ETH_P_MOBITEX) || (defined(HAVE_DECL_ETH_P_MOBITEX) && HAVE_DECL_ETH_P_MOBITEX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_MOBITEX) == (0x0015), "ETH_P_MOBITEX != 0x0015"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_MOBITEX 0x0015 +#endif +#if defined(ETH_P_CONTROL) || (defined(HAVE_DECL_ETH_P_CONTROL) && HAVE_DECL_ETH_P_CONTROL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_CONTROL) == (0x0016), "ETH_P_CONTROL != 0x0016"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_CONTROL 0x0016 +#endif +#if defined(ETH_P_IRDA) || (defined(HAVE_DECL_ETH_P_IRDA) && HAVE_DECL_ETH_P_IRDA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_IRDA) == (0x0017), "ETH_P_IRDA != 0x0017"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_IRDA 0x0017 +#endif +#if defined(ETH_P_ECONET) || (defined(HAVE_DECL_ETH_P_ECONET) && HAVE_DECL_ETH_P_ECONET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_ECONET) == (0x0018), "ETH_P_ECONET != 0x0018"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_ECONET 0x0018 +#endif +#if defined(ETH_P_HDLC) || (defined(HAVE_DECL_ETH_P_HDLC) && HAVE_DECL_ETH_P_HDLC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_HDLC) == (0x0019), "ETH_P_HDLC != 0x0019"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_HDLC 0x0019 +#endif +#if defined(ETH_P_ARCNET) || (defined(HAVE_DECL_ETH_P_ARCNET) && HAVE_DECL_ETH_P_ARCNET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_ARCNET) == (0x001A), "ETH_P_ARCNET != 0x001A"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_ARCNET 0x001A +#endif +#if defined(ETH_P_DSA) || (defined(HAVE_DECL_ETH_P_DSA) && HAVE_DECL_ETH_P_DSA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_DSA) == (0x001B), "ETH_P_DSA != 0x001B"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_DSA 0x001B +#endif +#if defined(ETH_P_TRAILER) || (defined(HAVE_DECL_ETH_P_TRAILER) && HAVE_DECL_ETH_P_TRAILER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_TRAILER) == (0x001C), "ETH_P_TRAILER != 0x001C"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_TRAILER 0x001C +#endif #if defined(ETH_P_LOOP) || (defined(HAVE_DECL_ETH_P_LOOP) && HAVE_DECL_ETH_P_LOOP) - XLAT(ETH_P_LOOP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_LOOP) == (0x0060), "ETH_P_LOOP != 0x0060"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_LOOP 0x0060 +#endif +#if defined(ETH_P_PHONET) || (defined(HAVE_DECL_ETH_P_PHONET) && HAVE_DECL_ETH_P_PHONET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_PHONET) == (0x00F5), "ETH_P_PHONET != 0x00F5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_PHONET 0x00F5 +#endif +#if defined(ETH_P_IEEE802154) || (defined(HAVE_DECL_ETH_P_IEEE802154) && HAVE_DECL_ETH_P_IEEE802154) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_IEEE802154) == (0x00F6), "ETH_P_IEEE802154 != 0x00F6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_IEEE802154 0x00F6 +#endif +#if defined(ETH_P_CAIF) || (defined(HAVE_DECL_ETH_P_CAIF) && HAVE_DECL_ETH_P_CAIF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_CAIF) == (0x00F7), "ETH_P_CAIF != 0x00F7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_CAIF 0x00F7 +#endif +#if defined(ETH_P_XDSA) || (defined(HAVE_DECL_ETH_P_XDSA) && HAVE_DECL_ETH_P_XDSA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_XDSA) == (0x00F8), "ETH_P_XDSA != 0x00F8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_XDSA 0x00F8 +#endif +#if defined(ETH_P_MAP) || (defined(HAVE_DECL_ETH_P_MAP) && HAVE_DECL_ETH_P_MAP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_MAP) == (0x00F9), "ETH_P_MAP != 0x00F9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_MAP 0x00F9 #endif #if defined(ETH_P_PUP) || (defined(HAVE_DECL_ETH_P_PUP) && HAVE_DECL_ETH_P_PUP) - XLAT(ETH_P_PUP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_PUP) == (0x0200), "ETH_P_PUP != 0x0200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_PUP 0x0200 #endif #if defined(ETH_P_PUPAT) || (defined(HAVE_DECL_ETH_P_PUPAT) && HAVE_DECL_ETH_P_PUPAT) - XLAT(ETH_P_PUPAT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_PUPAT) == (0x0201), "ETH_P_PUPAT != 0x0201"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_PUPAT 0x0201 #endif -#if defined(ETH_P_TSN) || (defined(HAVE_DECL_ETH_P_TSN) && HAVE_DECL_ETH_P_TSN) - XLAT(ETH_P_TSN), +#if defined(ETH_P_802_3_MIN) || (defined(HAVE_DECL_ETH_P_802_3_MIN) && HAVE_DECL_ETH_P_802_3_MIN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_802_3_MIN) == (0x0600), "ETH_P_802_3_MIN != 0x0600"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_802_3_MIN 0x0600 #endif #if defined(ETH_P_IP) || (defined(HAVE_DECL_ETH_P_IP) && HAVE_DECL_ETH_P_IP) - XLAT(ETH_P_IP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_IP) == (0x0800), "ETH_P_IP != 0x0800"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_IP 0x0800 #endif #if defined(ETH_P_X25) || (defined(HAVE_DECL_ETH_P_X25) && HAVE_DECL_ETH_P_X25) - XLAT(ETH_P_X25), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_X25) == (0x0805), "ETH_P_X25 != 0x0805"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_X25 0x0805 #endif #if defined(ETH_P_ARP) || (defined(HAVE_DECL_ETH_P_ARP) && HAVE_DECL_ETH_P_ARP) - XLAT(ETH_P_ARP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_ARP) == (0x0806), "ETH_P_ARP != 0x0806"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_ARP 0x0806 #endif #if defined(ETH_P_BPQ) || (defined(HAVE_DECL_ETH_P_BPQ) && HAVE_DECL_ETH_P_BPQ) - XLAT(ETH_P_BPQ), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_BPQ) == (0x08FF), "ETH_P_BPQ != 0x08FF"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_BPQ 0x08FF #endif #if defined(ETH_P_IEEEPUP) || (defined(HAVE_DECL_ETH_P_IEEEPUP) && HAVE_DECL_ETH_P_IEEEPUP) - XLAT(ETH_P_IEEEPUP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_IEEEPUP) == (0x0a00), "ETH_P_IEEEPUP != 0x0a00"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_IEEEPUP 0x0a00 #endif #if defined(ETH_P_IEEEPUPAT) || (defined(HAVE_DECL_ETH_P_IEEEPUPAT) && HAVE_DECL_ETH_P_IEEEPUPAT) - XLAT(ETH_P_IEEEPUPAT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_IEEEPUPAT) == (0x0a01), "ETH_P_IEEEPUPAT != 0x0a01"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_IEEEPUPAT 0x0a01 +#endif +#if defined(ETH_P_ERSPAN2) || (defined(HAVE_DECL_ETH_P_ERSPAN2) && HAVE_DECL_ETH_P_ERSPAN2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_ERSPAN2) == (0x22EB), "ETH_P_ERSPAN2 != 0x22EB"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_ERSPAN2 0x22EB +#endif +#if defined(ETH_P_TSN) || (defined(HAVE_DECL_ETH_P_TSN) && HAVE_DECL_ETH_P_TSN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_TSN) == (0x22F0), "ETH_P_TSN != 0x22F0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_TSN 0x22F0 #endif #if defined(ETH_P_BATMAN) || (defined(HAVE_DECL_ETH_P_BATMAN) && HAVE_DECL_ETH_P_BATMAN) - XLAT(ETH_P_BATMAN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_BATMAN) == (0x4305), "ETH_P_BATMAN != 0x4305"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_BATMAN 0x4305 #endif #if defined(ETH_P_DEC) || (defined(HAVE_DECL_ETH_P_DEC) && HAVE_DECL_ETH_P_DEC) - XLAT(ETH_P_DEC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_DEC) == (0x6000), "ETH_P_DEC != 0x6000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_DEC 0x6000 #endif #if defined(ETH_P_DNA_DL) || (defined(HAVE_DECL_ETH_P_DNA_DL) && HAVE_DECL_ETH_P_DNA_DL) - XLAT(ETH_P_DNA_DL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_DNA_DL) == (0x6001), "ETH_P_DNA_DL != 0x6001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_DNA_DL 0x6001 #endif #if defined(ETH_P_DNA_RC) || (defined(HAVE_DECL_ETH_P_DNA_RC) && HAVE_DECL_ETH_P_DNA_RC) - XLAT(ETH_P_DNA_RC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_DNA_RC) == (0x6002), "ETH_P_DNA_RC != 0x6002"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_DNA_RC 0x6002 #endif #if defined(ETH_P_DNA_RT) || (defined(HAVE_DECL_ETH_P_DNA_RT) && HAVE_DECL_ETH_P_DNA_RT) - XLAT(ETH_P_DNA_RT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_DNA_RT) == (0x6003), "ETH_P_DNA_RT != 0x6003"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_DNA_RT 0x6003 #endif #if defined(ETH_P_LAT) || (defined(HAVE_DECL_ETH_P_LAT) && HAVE_DECL_ETH_P_LAT) - XLAT(ETH_P_LAT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_LAT) == (0x6004), "ETH_P_LAT != 0x6004"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_LAT 0x6004 #endif #if defined(ETH_P_DIAG) || (defined(HAVE_DECL_ETH_P_DIAG) && HAVE_DECL_ETH_P_DIAG) - XLAT(ETH_P_DIAG), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_DIAG) == (0x6005), "ETH_P_DIAG != 0x6005"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_DIAG 0x6005 #endif #if defined(ETH_P_CUST) || (defined(HAVE_DECL_ETH_P_CUST) && HAVE_DECL_ETH_P_CUST) - XLAT(ETH_P_CUST), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_CUST) == (0x6006), "ETH_P_CUST != 0x6006"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_CUST 0x6006 #endif #if defined(ETH_P_SCA) || (defined(HAVE_DECL_ETH_P_SCA) && HAVE_DECL_ETH_P_SCA) - XLAT(ETH_P_SCA), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_SCA) == (0x6007), "ETH_P_SCA != 0x6007"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_SCA 0x6007 #endif #if defined(ETH_P_TEB) || (defined(HAVE_DECL_ETH_P_TEB) && HAVE_DECL_ETH_P_TEB) - XLAT(ETH_P_TEB), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_TEB) == (0x6558), "ETH_P_TEB != 0x6558"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_TEB 0x6558 #endif #if defined(ETH_P_RARP) || (defined(HAVE_DECL_ETH_P_RARP) && HAVE_DECL_ETH_P_RARP) - XLAT(ETH_P_RARP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_RARP) == (0x8035), "ETH_P_RARP != 0x8035"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_RARP 0x8035 #endif #if defined(ETH_P_ATALK) || (defined(HAVE_DECL_ETH_P_ATALK) && HAVE_DECL_ETH_P_ATALK) - XLAT(ETH_P_ATALK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_ATALK) == (0x809B), "ETH_P_ATALK != 0x809B"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_ATALK 0x809B #endif #if defined(ETH_P_AARP) || (defined(HAVE_DECL_ETH_P_AARP) && HAVE_DECL_ETH_P_AARP) - XLAT(ETH_P_AARP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_AARP) == (0x80F3), "ETH_P_AARP != 0x80F3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_AARP 0x80F3 #endif #if defined(ETH_P_8021Q) || (defined(HAVE_DECL_ETH_P_8021Q) && HAVE_DECL_ETH_P_8021Q) - XLAT(ETH_P_8021Q), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_8021Q) == (0x8100), "ETH_P_8021Q != 0x8100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_8021Q 0x8100 #endif #if defined(ETH_P_IPX) || (defined(HAVE_DECL_ETH_P_IPX) && HAVE_DECL_ETH_P_IPX) - XLAT(ETH_P_IPX), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_IPX) == (0x8137), "ETH_P_IPX != 0x8137"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_IPX 0x8137 #endif #if defined(ETH_P_IPV6) || (defined(HAVE_DECL_ETH_P_IPV6) && HAVE_DECL_ETH_P_IPV6) - XLAT(ETH_P_IPV6), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_IPV6) == (0x86DD), "ETH_P_IPV6 != 0x86DD"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_IPV6 0x86DD #endif #if defined(ETH_P_PAUSE) || (defined(HAVE_DECL_ETH_P_PAUSE) && HAVE_DECL_ETH_P_PAUSE) - XLAT(ETH_P_PAUSE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_PAUSE) == (0x8808), "ETH_P_PAUSE != 0x8808"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_PAUSE 0x8808 #endif #if defined(ETH_P_SLOW) || (defined(HAVE_DECL_ETH_P_SLOW) && HAVE_DECL_ETH_P_SLOW) - XLAT(ETH_P_SLOW), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_SLOW) == (0x8809), "ETH_P_SLOW != 0x8809"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_SLOW 0x8809 #endif #if defined(ETH_P_WCCP) || (defined(HAVE_DECL_ETH_P_WCCP) && HAVE_DECL_ETH_P_WCCP) - XLAT(ETH_P_WCCP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_WCCP) == (0x883E), "ETH_P_WCCP != 0x883E"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_WCCP 0x883E #endif #if defined(ETH_P_MPLS_UC) || (defined(HAVE_DECL_ETH_P_MPLS_UC) && HAVE_DECL_ETH_P_MPLS_UC) - XLAT(ETH_P_MPLS_UC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_MPLS_UC) == (0x8847), "ETH_P_MPLS_UC != 0x8847"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_MPLS_UC 0x8847 #endif #if defined(ETH_P_MPLS_MC) || (defined(HAVE_DECL_ETH_P_MPLS_MC) && HAVE_DECL_ETH_P_MPLS_MC) - XLAT(ETH_P_MPLS_MC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_MPLS_MC) == (0x8848), "ETH_P_MPLS_MC != 0x8848"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_MPLS_MC 0x8848 #endif #if defined(ETH_P_ATMMPOA) || (defined(HAVE_DECL_ETH_P_ATMMPOA) && HAVE_DECL_ETH_P_ATMMPOA) - XLAT(ETH_P_ATMMPOA), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_ATMMPOA) == (0x884c), "ETH_P_ATMMPOA != 0x884c"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_ATMMPOA 0x884c #endif #if defined(ETH_P_PPP_DISC) || (defined(HAVE_DECL_ETH_P_PPP_DISC) && HAVE_DECL_ETH_P_PPP_DISC) - XLAT(ETH_P_PPP_DISC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_PPP_DISC) == (0x8863), "ETH_P_PPP_DISC != 0x8863"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_PPP_DISC 0x8863 #endif #if defined(ETH_P_PPP_SES) || (defined(HAVE_DECL_ETH_P_PPP_SES) && HAVE_DECL_ETH_P_PPP_SES) - XLAT(ETH_P_PPP_SES), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_PPP_SES) == (0x8864), "ETH_P_PPP_SES != 0x8864"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_PPP_SES 0x8864 #endif #if defined(ETH_P_LINK_CTL) || (defined(HAVE_DECL_ETH_P_LINK_CTL) && HAVE_DECL_ETH_P_LINK_CTL) - XLAT(ETH_P_LINK_CTL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_LINK_CTL) == (0x886c), "ETH_P_LINK_CTL != 0x886c"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_LINK_CTL 0x886c #endif #if defined(ETH_P_ATMFATE) || (defined(HAVE_DECL_ETH_P_ATMFATE) && HAVE_DECL_ETH_P_ATMFATE) - XLAT(ETH_P_ATMFATE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_ATMFATE) == (0x8884), "ETH_P_ATMFATE != 0x8884"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_ATMFATE 0x8884 #endif #if defined(ETH_P_PAE) || (defined(HAVE_DECL_ETH_P_PAE) && HAVE_DECL_ETH_P_PAE) - XLAT(ETH_P_PAE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_PAE) == (0x888E), "ETH_P_PAE != 0x888E"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_PAE 0x888E #endif #if defined(ETH_P_AOE) || (defined(HAVE_DECL_ETH_P_AOE) && HAVE_DECL_ETH_P_AOE) - XLAT(ETH_P_AOE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_AOE) == (0x88A2), "ETH_P_AOE != 0x88A2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_AOE 0x88A2 #endif #if defined(ETH_P_8021AD) || (defined(HAVE_DECL_ETH_P_8021AD) && HAVE_DECL_ETH_P_8021AD) - XLAT(ETH_P_8021AD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_8021AD) == (0x88A8), "ETH_P_8021AD != 0x88A8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_8021AD 0x88A8 #endif #if defined(ETH_P_802_EX1) || (defined(HAVE_DECL_ETH_P_802_EX1) && HAVE_DECL_ETH_P_802_EX1) - XLAT(ETH_P_802_EX1), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_802_EX1) == (0x88B5), "ETH_P_802_EX1 != 0x88B5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_802_EX1 0x88B5 +#endif +#if defined(ETH_P_ERSPAN) || (defined(HAVE_DECL_ETH_P_ERSPAN) && HAVE_DECL_ETH_P_ERSPAN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_ERSPAN) == (0x88BE), "ETH_P_ERSPAN != 0x88BE"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_ERSPAN 0x88BE +#endif +#if defined(ETH_P_PREAUTH) || (defined(HAVE_DECL_ETH_P_PREAUTH) && HAVE_DECL_ETH_P_PREAUTH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_PREAUTH) == (0x88C7), "ETH_P_PREAUTH != 0x88C7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_PREAUTH 0x88C7 #endif #if defined(ETH_P_TIPC) || (defined(HAVE_DECL_ETH_P_TIPC) && HAVE_DECL_ETH_P_TIPC) - XLAT(ETH_P_TIPC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_TIPC) == (0x88CA), "ETH_P_TIPC != 0x88CA"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_TIPC 0x88CA #endif #if defined(ETH_P_MACSEC) || (defined(HAVE_DECL_ETH_P_MACSEC) && HAVE_DECL_ETH_P_MACSEC) - XLAT(ETH_P_MACSEC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_MACSEC) == (0x88E5), "ETH_P_MACSEC != 0x88E5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_MACSEC 0x88E5 #endif #if defined(ETH_P_8021AH) || (defined(HAVE_DECL_ETH_P_8021AH) && HAVE_DECL_ETH_P_8021AH) - XLAT(ETH_P_8021AH), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_8021AH) == (0x88E7), "ETH_P_8021AH != 0x88E7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_8021AH 0x88E7 #endif #if defined(ETH_P_MVRP) || (defined(HAVE_DECL_ETH_P_MVRP) && HAVE_DECL_ETH_P_MVRP) - XLAT(ETH_P_MVRP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_MVRP) == (0x88F5), "ETH_P_MVRP != 0x88F5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_MVRP 0x88F5 #endif #if defined(ETH_P_1588) || (defined(HAVE_DECL_ETH_P_1588) && HAVE_DECL_ETH_P_1588) - XLAT(ETH_P_1588), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_1588) == (0x88F7), "ETH_P_1588 != 0x88F7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_1588 0x88F7 #endif #if defined(ETH_P_NCSI) || (defined(HAVE_DECL_ETH_P_NCSI) && HAVE_DECL_ETH_P_NCSI) - XLAT(ETH_P_NCSI), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_NCSI) == (0x88F8), "ETH_P_NCSI != 0x88F8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_NCSI 0x88F8 #endif #if defined(ETH_P_PRP) || (defined(HAVE_DECL_ETH_P_PRP) && HAVE_DECL_ETH_P_PRP) - XLAT(ETH_P_PRP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_PRP) == (0x88FB), "ETH_P_PRP != 0x88FB"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_PRP 0x88FB #endif #if defined(ETH_P_FCOE) || (defined(HAVE_DECL_ETH_P_FCOE) && HAVE_DECL_ETH_P_FCOE) - XLAT(ETH_P_FCOE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_FCOE) == (0x8906), "ETH_P_FCOE != 0x8906"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_FCOE 0x8906 #endif #if defined(ETH_P_TDLS) || (defined(HAVE_DECL_ETH_P_TDLS) && HAVE_DECL_ETH_P_TDLS) - XLAT(ETH_P_TDLS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_TDLS) == (0x890D), "ETH_P_TDLS != 0x890D"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_TDLS 0x890D #endif #if defined(ETH_P_FIP) || (defined(HAVE_DECL_ETH_P_FIP) && HAVE_DECL_ETH_P_FIP) - XLAT(ETH_P_FIP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_FIP) == (0x8914), "ETH_P_FIP != 0x8914"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_FIP 0x8914 +#endif +#if defined(ETH_P_IBOE) || (defined(HAVE_DECL_ETH_P_IBOE) && HAVE_DECL_ETH_P_IBOE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_IBOE) == (0x8915), "ETH_P_IBOE != 0x8915"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_IBOE 0x8915 #endif #if defined(ETH_P_80221) || (defined(HAVE_DECL_ETH_P_80221) && HAVE_DECL_ETH_P_80221) - XLAT(ETH_P_80221), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_80221) == (0x8917), "ETH_P_80221 != 0x8917"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_80221 0x8917 #endif #if defined(ETH_P_HSR) || (defined(HAVE_DECL_ETH_P_HSR) && HAVE_DECL_ETH_P_HSR) - XLAT(ETH_P_HSR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_HSR) == (0x892F), "ETH_P_HSR != 0x892F"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_HSR 0x892F +#endif +#if defined(ETH_P_NSH) || (defined(HAVE_DECL_ETH_P_NSH) && HAVE_DECL_ETH_P_NSH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_NSH) == (0x894F), "ETH_P_NSH != 0x894F"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_NSH 0x894F #endif #if defined(ETH_P_LOOPBACK) || (defined(HAVE_DECL_ETH_P_LOOPBACK) && HAVE_DECL_ETH_P_LOOPBACK) - XLAT(ETH_P_LOOPBACK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_LOOPBACK) == (0x9000), "ETH_P_LOOPBACK != 0x9000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_LOOPBACK 0x9000 #endif #if defined(ETH_P_QINQ1) || (defined(HAVE_DECL_ETH_P_QINQ1) && HAVE_DECL_ETH_P_QINQ1) - XLAT(ETH_P_QINQ1), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_QINQ1) == (0x9100), "ETH_P_QINQ1 != 0x9100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_QINQ1 0x9100 #endif #if defined(ETH_P_QINQ2) || (defined(HAVE_DECL_ETH_P_QINQ2) && HAVE_DECL_ETH_P_QINQ2) - XLAT(ETH_P_QINQ2), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_QINQ2) == (0x9200), "ETH_P_QINQ2 != 0x9200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_QINQ2 0x9200 #endif #if defined(ETH_P_QINQ3) || (defined(HAVE_DECL_ETH_P_QINQ3) && HAVE_DECL_ETH_P_QINQ3) - XLAT(ETH_P_QINQ3), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_QINQ3) == (0x9300), "ETH_P_QINQ3 != 0x9300"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_QINQ3 0x9300 #endif #if defined(ETH_P_EDSA) || (defined(HAVE_DECL_ETH_P_EDSA) && HAVE_DECL_ETH_P_EDSA) - XLAT(ETH_P_EDSA), -#endif -#if defined(ETH_P_AF_IUCV) || (defined(HAVE_DECL_ETH_P_AF_IUCV) && HAVE_DECL_ETH_P_AF_IUCV) - XLAT(ETH_P_AF_IUCV), -#endif -#if defined(ETH_P_802_3_MIN) || (defined(HAVE_DECL_ETH_P_802_3_MIN) && HAVE_DECL_ETH_P_802_3_MIN) - XLAT(ETH_P_802_3_MIN), -#endif -#if defined(ETH_P_802_3) || (defined(HAVE_DECL_ETH_P_802_3) && HAVE_DECL_ETH_P_802_3) - XLAT(ETH_P_802_3), -#endif -#if defined(ETH_P_AX25) || (defined(HAVE_DECL_ETH_P_AX25) && HAVE_DECL_ETH_P_AX25) - XLAT(ETH_P_AX25), -#endif -#if defined(ETH_P_ALL) || (defined(HAVE_DECL_ETH_P_ALL) && HAVE_DECL_ETH_P_ALL) - XLAT(ETH_P_ALL), -#endif -#if defined(ETH_P_802_2) || (defined(HAVE_DECL_ETH_P_802_2) && HAVE_DECL_ETH_P_802_2) - XLAT(ETH_P_802_2), -#endif -#if defined(ETH_P_SNAP) || (defined(HAVE_DECL_ETH_P_SNAP) && HAVE_DECL_ETH_P_SNAP) - XLAT(ETH_P_SNAP), -#endif -#if defined(ETH_P_DDCMP) || (defined(HAVE_DECL_ETH_P_DDCMP) && HAVE_DECL_ETH_P_DDCMP) - XLAT(ETH_P_DDCMP), -#endif -#if defined(ETH_P_WAN_PPP) || (defined(HAVE_DECL_ETH_P_WAN_PPP) && HAVE_DECL_ETH_P_WAN_PPP) - XLAT(ETH_P_WAN_PPP), -#endif -#if defined(ETH_P_PPP_MP) || (defined(HAVE_DECL_ETH_P_PPP_MP) && HAVE_DECL_ETH_P_PPP_MP) - XLAT(ETH_P_PPP_MP), -#endif -#if defined(ETH_P_LOCALTALK) || (defined(HAVE_DECL_ETH_P_LOCALTALK) && HAVE_DECL_ETH_P_LOCALTALK) - XLAT(ETH_P_LOCALTALK), -#endif -#if defined(ETH_P_CAN) || (defined(HAVE_DECL_ETH_P_CAN) && HAVE_DECL_ETH_P_CAN) - XLAT(ETH_P_CAN), -#endif -#if defined(ETH_P_CANFD) || (defined(HAVE_DECL_ETH_P_CANFD) && HAVE_DECL_ETH_P_CANFD) - XLAT(ETH_P_CANFD), -#endif -#if defined(ETH_P_PPPTALK) || (defined(HAVE_DECL_ETH_P_PPPTALK) && HAVE_DECL_ETH_P_PPPTALK) - XLAT(ETH_P_PPPTALK), -#endif -#if defined(ETH_P_TR_802_2) || (defined(HAVE_DECL_ETH_P_TR_802_2) && HAVE_DECL_ETH_P_TR_802_2) - XLAT(ETH_P_TR_802_2), -#endif -#if defined(ETH_P_MOBITEX) || (defined(HAVE_DECL_ETH_P_MOBITEX) && HAVE_DECL_ETH_P_MOBITEX) - XLAT(ETH_P_MOBITEX), -#endif -#if defined(ETH_P_CONTROL) || (defined(HAVE_DECL_ETH_P_CONTROL) && HAVE_DECL_ETH_P_CONTROL) - XLAT(ETH_P_CONTROL), -#endif -#if defined(ETH_P_IRDA) || (defined(HAVE_DECL_ETH_P_IRDA) && HAVE_DECL_ETH_P_IRDA) - XLAT(ETH_P_IRDA), -#endif -#if defined(ETH_P_ECONET) || (defined(HAVE_DECL_ETH_P_ECONET) && HAVE_DECL_ETH_P_ECONET) - XLAT(ETH_P_ECONET), -#endif -#if defined(ETH_P_HDLC) || (defined(HAVE_DECL_ETH_P_HDLC) && HAVE_DECL_ETH_P_HDLC) - XLAT(ETH_P_HDLC), -#endif -#if defined(ETH_P_ARCNET) || (defined(HAVE_DECL_ETH_P_ARCNET) && HAVE_DECL_ETH_P_ARCNET) - XLAT(ETH_P_ARCNET), -#endif -#if defined(ETH_P_DSA) || (defined(HAVE_DECL_ETH_P_DSA) && HAVE_DECL_ETH_P_DSA) - XLAT(ETH_P_DSA), -#endif -#if defined(ETH_P_TRAILER) || (defined(HAVE_DECL_ETH_P_TRAILER) && HAVE_DECL_ETH_P_TRAILER) - XLAT(ETH_P_TRAILER), -#endif -#if defined(ETH_P_PHONET) || (defined(HAVE_DECL_ETH_P_PHONET) && HAVE_DECL_ETH_P_PHONET) - XLAT(ETH_P_PHONET), -#endif -#if defined(ETH_P_IEEE802154) || (defined(HAVE_DECL_ETH_P_IEEE802154) && HAVE_DECL_ETH_P_IEEE802154) - XLAT(ETH_P_IEEE802154), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_EDSA) == (0xDADA), "ETH_P_EDSA != 0xDADA"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_EDSA 0xDADA #endif -#if defined(ETH_P_CAIF) || (defined(HAVE_DECL_ETH_P_CAIF) && HAVE_DECL_ETH_P_CAIF) - XLAT(ETH_P_CAIF), +#if defined(ETH_P_IFE) || (defined(HAVE_DECL_ETH_P_IFE) && HAVE_DECL_ETH_P_IFE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_IFE) == (0xED3E), "ETH_P_IFE != 0xED3E"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_IFE 0xED3E #endif -#if defined(ETH_P_XDSA) || (defined(HAVE_DECL_ETH_P_XDSA) && HAVE_DECL_ETH_P_XDSA) - XLAT(ETH_P_XDSA), +#if defined(ETH_P_AF_IUCV) || (defined(HAVE_DECL_ETH_P_AF_IUCV) && HAVE_DECL_ETH_P_AF_IUCV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ETH_P_AF_IUCV) == (0xFBFB), "ETH_P_AF_IUCV != 0xFBFB"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ETH_P_AF_IUCV 0xFBFB #endif + +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS + +const struct xlat ethernet_protocols[] = { + + XLAT(ETH_P_802_3), + XLAT(ETH_P_AX25), + XLAT(ETH_P_ALL), + XLAT(ETH_P_802_2), + XLAT(ETH_P_SNAP), + XLAT(ETH_P_DDCMP), + XLAT(ETH_P_WAN_PPP), + XLAT(ETH_P_PPP_MP), + XLAT(ETH_P_LOCALTALK), + XLAT(ETH_P_CAN), + XLAT(ETH_P_CANFD), + XLAT(ETH_P_PPPTALK), + XLAT(ETH_P_TR_802_2), + XLAT(ETH_P_MOBITEX), + XLAT(ETH_P_CONTROL), + XLAT(ETH_P_IRDA), + XLAT(ETH_P_ECONET), + XLAT(ETH_P_HDLC), + XLAT(ETH_P_ARCNET), + XLAT(ETH_P_DSA), + XLAT(ETH_P_TRAILER), + XLAT(ETH_P_LOOP), + XLAT(ETH_P_PHONET), + XLAT(ETH_P_IEEE802154), + XLAT(ETH_P_CAIF), + XLAT(ETH_P_XDSA), + XLAT(ETH_P_MAP), + XLAT(ETH_P_PUP), + XLAT(ETH_P_PUPAT), + XLAT(ETH_P_802_3_MIN), + XLAT(ETH_P_IP), + XLAT(ETH_P_X25), + XLAT(ETH_P_ARP), + XLAT(ETH_P_BPQ), + XLAT(ETH_P_IEEEPUP), + XLAT(ETH_P_IEEEPUPAT), + XLAT(ETH_P_ERSPAN2), + XLAT(ETH_P_TSN), + XLAT(ETH_P_BATMAN), + XLAT(ETH_P_DEC), + XLAT(ETH_P_DNA_DL), + XLAT(ETH_P_DNA_RC), + XLAT(ETH_P_DNA_RT), + XLAT(ETH_P_LAT), + XLAT(ETH_P_DIAG), + XLAT(ETH_P_CUST), + XLAT(ETH_P_SCA), + XLAT(ETH_P_TEB), + XLAT(ETH_P_RARP), + XLAT(ETH_P_ATALK), + XLAT(ETH_P_AARP), + XLAT(ETH_P_8021Q), + XLAT(ETH_P_IPX), + XLAT(ETH_P_IPV6), + XLAT(ETH_P_PAUSE), + XLAT(ETH_P_SLOW), + XLAT(ETH_P_WCCP), + XLAT(ETH_P_MPLS_UC), + XLAT(ETH_P_MPLS_MC), + XLAT(ETH_P_ATMMPOA), + XLAT(ETH_P_PPP_DISC), + XLAT(ETH_P_PPP_SES), + XLAT(ETH_P_LINK_CTL), + XLAT(ETH_P_ATMFATE), + XLAT(ETH_P_PAE), + XLAT(ETH_P_AOE), + XLAT(ETH_P_8021AD), + XLAT(ETH_P_802_EX1), + XLAT(ETH_P_ERSPAN), + XLAT(ETH_P_PREAUTH), + XLAT(ETH_P_TIPC), + XLAT(ETH_P_MACSEC), + XLAT(ETH_P_8021AH), + XLAT(ETH_P_MVRP), + XLAT(ETH_P_1588), + XLAT(ETH_P_NCSI), + XLAT(ETH_P_PRP), + XLAT(ETH_P_FCOE), + XLAT(ETH_P_TDLS), + XLAT(ETH_P_FIP), + XLAT(ETH_P_IBOE), + XLAT(ETH_P_80221), + XLAT(ETH_P_HSR), + XLAT(ETH_P_NSH), + XLAT(ETH_P_LOOPBACK), + XLAT(ETH_P_QINQ1), + XLAT(ETH_P_QINQ2), + XLAT(ETH_P_QINQ3), + XLAT(ETH_P_EDSA), + XLAT(ETH_P_IFE), + XLAT(ETH_P_AF_IUCV), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ethernet_protocols.in b/xlat/ethernet_protocols.in index 522d1bee..80c52a96 100644 --- a/xlat/ethernet_protocols.in +++ b/xlat/ethernet_protocols.in @@ -1,84 +1,92 @@ -ETH_P_LOOP -ETH_P_PUP -ETH_P_PUPAT -ETH_P_TSN -ETH_P_IP -ETH_P_X25 -ETH_P_ARP -ETH_P_BPQ -ETH_P_IEEEPUP -ETH_P_IEEEPUPAT -ETH_P_BATMAN -ETH_P_DEC -ETH_P_DNA_DL -ETH_P_DNA_RC -ETH_P_DNA_RT -ETH_P_LAT -ETH_P_DIAG -ETH_P_CUST -ETH_P_SCA -ETH_P_TEB -ETH_P_RARP -ETH_P_ATALK -ETH_P_AARP -ETH_P_8021Q -ETH_P_IPX -ETH_P_IPV6 -ETH_P_PAUSE -ETH_P_SLOW -ETH_P_WCCP -ETH_P_MPLS_UC -ETH_P_MPLS_MC -ETH_P_ATMMPOA -ETH_P_PPP_DISC -ETH_P_PPP_SES -ETH_P_LINK_CTL -ETH_P_ATMFATE -ETH_P_PAE -ETH_P_AOE -ETH_P_8021AD -ETH_P_802_EX1 -ETH_P_TIPC -ETH_P_MACSEC -ETH_P_8021AH -ETH_P_MVRP -ETH_P_1588 -ETH_P_NCSI -ETH_P_PRP -ETH_P_FCOE -ETH_P_TDLS -ETH_P_FIP -ETH_P_80221 -ETH_P_HSR -ETH_P_LOOPBACK -ETH_P_QINQ1 -ETH_P_QINQ2 -ETH_P_QINQ3 -ETH_P_EDSA -ETH_P_AF_IUCV -ETH_P_802_3_MIN -ETH_P_802_3 -ETH_P_AX25 -ETH_P_ALL -ETH_P_802_2 -ETH_P_SNAP -ETH_P_DDCMP -ETH_P_WAN_PPP -ETH_P_PPP_MP -ETH_P_LOCALTALK -ETH_P_CAN -ETH_P_CANFD -ETH_P_PPPTALK -ETH_P_TR_802_2 -ETH_P_MOBITEX -ETH_P_CONTROL -ETH_P_IRDA -ETH_P_ECONET -ETH_P_HDLC -ETH_P_ARCNET -ETH_P_DSA -ETH_P_TRAILER -ETH_P_PHONET -ETH_P_IEEE802154 -ETH_P_CAIF -ETH_P_XDSA +/* sort -k2,2 */ +ETH_P_802_3 0x0001 /* Dummy type for 802.3 frames */ +ETH_P_AX25 0x0002 /* Dummy protocol id for AX.25 */ +ETH_P_ALL 0x0003 /* Every packet (be careful!!!) */ +ETH_P_802_2 0x0004 /* 802.2 frames */ +ETH_P_SNAP 0x0005 /* Internal only */ +ETH_P_DDCMP 0x0006 /* DEC DDCMP: Internal only */ +ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/ +ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */ +ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */ +ETH_P_CAN 0x000C /* CAN: Controller Area Network */ +ETH_P_CANFD 0x000D /* CANFD: CAN flexible data rate*/ +ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/ +ETH_P_TR_802_2 0x0011 /* 802.2 frames */ +ETH_P_MOBITEX 0x0015 /* Mobitex (kaz@cafe.net) */ +ETH_P_CONTROL 0x0016 /* Card specific control frames */ +ETH_P_IRDA 0x0017 /* Linux-IrDA */ +ETH_P_ECONET 0x0018 /* Acorn Econet */ +ETH_P_HDLC 0x0019 /* HDLC frames */ +ETH_P_ARCNET 0x001A /* 1A for ArcNet :-) */ +ETH_P_DSA 0x001B /* Distributed Switch Arch. */ +ETH_P_TRAILER 0x001C /* Trailer switch tagging */ +ETH_P_LOOP 0x0060 /* Ethernet Loopback packet */ +ETH_P_PHONET 0x00F5 /* Nokia Phonet frames */ +ETH_P_IEEE802154 0x00F6 /* IEEE802.15.4 frame */ +ETH_P_CAIF 0x00F7 /* ST-Ericsson CAIF protocol */ +ETH_P_XDSA 0x00F8 /* Multiplexed DSA protocol */ +ETH_P_MAP 0x00F9 /* Qualcomm multiplexing and aggregation protocol */ +ETH_P_PUP 0x0200 /* Xerox PUP packet */ +ETH_P_PUPAT 0x0201 /* Xerox PUP Addr Trans packet */ +ETH_P_802_3_MIN 0x0600 /* If the value in the ethernet type is less than this value then the frame is Ethernet II. Else it is 802.3 */ +ETH_P_IP 0x0800 /* Internet Protocol packet */ +ETH_P_X25 0x0805 /* CCITT X.25 */ +ETH_P_ARP 0x0806 /* Address Resolution packet */ +ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */ +ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */ +ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */ +ETH_P_ERSPAN2 0x22EB /* ERSPAN version 2 (type III) */ +ETH_P_TSN 0x22F0 /* TSN (IEEE 1722) packet */ +ETH_P_BATMAN 0x4305 /* B.A.T.M.A.N.-Advanced packet [ NOT AN OFFICIALLY REGISTERED ID ] */ +ETH_P_DEC 0x6000 /* DEC Assigned proto */ +ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */ +ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */ +ETH_P_DNA_RT 0x6003 /* DEC DNA Routing */ +ETH_P_LAT 0x6004 /* DEC LAT */ +ETH_P_DIAG 0x6005 /* DEC Diagnostics */ +ETH_P_CUST 0x6006 /* DEC Customer use */ +ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */ +ETH_P_TEB 0x6558 /* Trans Ether Bridging */ +ETH_P_RARP 0x8035 /* Reverse Addr Res packet */ +ETH_P_ATALK 0x809B /* Appletalk DDP */ +ETH_P_AARP 0x80F3 /* Appletalk AARP */ +ETH_P_8021Q 0x8100 /* 802.1Q VLAN Extended Header */ +ETH_P_IPX 0x8137 /* IPX over DIX */ +ETH_P_IPV6 0x86DD /* IPv6 over bluebook */ +ETH_P_PAUSE 0x8808 /* IEEE Pause frames. See 802.3 31B */ +ETH_P_SLOW 0x8809 /* Slow Protocol. See 802.3ad 43B */ +ETH_P_WCCP 0x883E /* Web-cache coordination protocol */ +ETH_P_MPLS_UC 0x8847 /* MPLS Unicast traffic */ +ETH_P_MPLS_MC 0x8848 /* MPLS Multicast traffic */ +ETH_P_ATMMPOA 0x884c /* MultiProtocol Over ATM */ +ETH_P_PPP_DISC 0x8863 /* PPPoE discovery messages */ +ETH_P_PPP_SES 0x8864 /* PPPoE session messages */ +ETH_P_LINK_CTL 0x886c /* HPNA, wlan link local tunnel */ +ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport over Ethernet */ +ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ +ETH_P_AOE 0x88A2 /* ATA over Ethernet */ +ETH_P_8021AD 0x88A8 /* 802.1ad Service VLAN */ +ETH_P_802_EX1 0x88B5 /* 802.1 Local Experimental 1. */ +ETH_P_ERSPAN 0x88BE /* ERSPAN type II */ +ETH_P_PREAUTH 0x88C7 /* 802.11 Preauthentication */ +ETH_P_TIPC 0x88CA /* TIPC */ +ETH_P_MACSEC 0x88E5 /* 802.1ae MACsec */ +ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */ +ETH_P_MVRP 0x88F5 /* 802.1Q MVRP */ +ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */ +ETH_P_NCSI 0x88F8 /* NCSI protocol */ +ETH_P_PRP 0x88FB /* IEC 62439-3 PRP/HSRv0 */ +ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */ +ETH_P_TDLS 0x890D /* TDLS */ +ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */ +ETH_P_IBOE 0x8915 /* Infiniband over Ethernet */ +ETH_P_80221 0x8917 /* IEEE 802.21 Media Independent Handover Protocol */ +ETH_P_HSR 0x892F /* IEC 62439-3 HSRv1 */ +ETH_P_NSH 0x894F /* Network Service Header */ +ETH_P_LOOPBACK 0x9000 /* Ethernet loopback packet, per IEEE 802.3 */ +ETH_P_QINQ1 0x9100 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */ +ETH_P_QINQ2 0x9200 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */ +ETH_P_QINQ3 0x9300 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */ +ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */ +ETH_P_IFE 0xED3E /* ForCES inter-FE LFB type */ +ETH_P_AF_IUCV 0xFBFB /* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */ diff --git a/xlat/evdev_abs.h b/xlat/evdev_abs.h index 3edd1f3a..b9aafaf3 100644 --- a/xlat/evdev_abs.h +++ b/xlat/evdev_abs.h @@ -1,132 +1,353 @@ /* Generated by ./xlat/gen.sh from ./xlat/evdev_abs.in; do not edit. */ -#ifndef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -const struct xlat evdev_abs[] = { #if defined(ABS_X) || (defined(HAVE_DECL_ABS_X) && HAVE_DECL_ABS_X) - XLAT(ABS_X), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_X) == (0x00), "ABS_X != 0x00"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_X 0x00 #endif #if defined(ABS_Y) || (defined(HAVE_DECL_ABS_Y) && HAVE_DECL_ABS_Y) - XLAT(ABS_Y), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_Y) == (0x01), "ABS_Y != 0x01"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_Y 0x01 #endif #if defined(ABS_Z) || (defined(HAVE_DECL_ABS_Z) && HAVE_DECL_ABS_Z) - XLAT(ABS_Z), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_Z) == (0x02), "ABS_Z != 0x02"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_Z 0x02 #endif #if defined(ABS_RX) || (defined(HAVE_DECL_ABS_RX) && HAVE_DECL_ABS_RX) - XLAT(ABS_RX), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_RX) == (0x03), "ABS_RX != 0x03"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_RX 0x03 #endif #if defined(ABS_RY) || (defined(HAVE_DECL_ABS_RY) && HAVE_DECL_ABS_RY) - XLAT(ABS_RY), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_RY) == (0x04), "ABS_RY != 0x04"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_RY 0x04 #endif #if defined(ABS_RZ) || (defined(HAVE_DECL_ABS_RZ) && HAVE_DECL_ABS_RZ) - XLAT(ABS_RZ), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_RZ) == (0x05), "ABS_RZ != 0x05"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_RZ 0x05 #endif #if defined(ABS_THROTTLE) || (defined(HAVE_DECL_ABS_THROTTLE) && HAVE_DECL_ABS_THROTTLE) - XLAT(ABS_THROTTLE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_THROTTLE) == (0x06), "ABS_THROTTLE != 0x06"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_THROTTLE 0x06 #endif #if defined(ABS_RUDDER) || (defined(HAVE_DECL_ABS_RUDDER) && HAVE_DECL_ABS_RUDDER) - XLAT(ABS_RUDDER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_RUDDER) == (0x07), "ABS_RUDDER != 0x07"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_RUDDER 0x07 #endif #if defined(ABS_WHEEL) || (defined(HAVE_DECL_ABS_WHEEL) && HAVE_DECL_ABS_WHEEL) - XLAT(ABS_WHEEL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_WHEEL) == (0x08), "ABS_WHEEL != 0x08"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_WHEEL 0x08 #endif #if defined(ABS_GAS) || (defined(HAVE_DECL_ABS_GAS) && HAVE_DECL_ABS_GAS) - XLAT(ABS_GAS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_GAS) == (0x09), "ABS_GAS != 0x09"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_GAS 0x09 #endif #if defined(ABS_BRAKE) || (defined(HAVE_DECL_ABS_BRAKE) && HAVE_DECL_ABS_BRAKE) - XLAT(ABS_BRAKE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_BRAKE) == (0x0a), "ABS_BRAKE != 0x0a"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_BRAKE 0x0a #endif #if defined(ABS_HAT0X) || (defined(HAVE_DECL_ABS_HAT0X) && HAVE_DECL_ABS_HAT0X) - XLAT(ABS_HAT0X), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_HAT0X) == (0x10), "ABS_HAT0X != 0x10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_HAT0X 0x10 #endif #if defined(ABS_HAT0Y) || (defined(HAVE_DECL_ABS_HAT0Y) && HAVE_DECL_ABS_HAT0Y) - XLAT(ABS_HAT0Y), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_HAT0Y) == (0x11), "ABS_HAT0Y != 0x11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_HAT0Y 0x11 #endif #if defined(ABS_HAT1X) || (defined(HAVE_DECL_ABS_HAT1X) && HAVE_DECL_ABS_HAT1X) - XLAT(ABS_HAT1X), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_HAT1X) == (0x12), "ABS_HAT1X != 0x12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_HAT1X 0x12 #endif #if defined(ABS_HAT1Y) || (defined(HAVE_DECL_ABS_HAT1Y) && HAVE_DECL_ABS_HAT1Y) - XLAT(ABS_HAT1Y), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_HAT1Y) == (0x13), "ABS_HAT1Y != 0x13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_HAT1Y 0x13 #endif #if defined(ABS_HAT2X) || (defined(HAVE_DECL_ABS_HAT2X) && HAVE_DECL_ABS_HAT2X) - XLAT(ABS_HAT2X), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_HAT2X) == (0x14), "ABS_HAT2X != 0x14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_HAT2X 0x14 #endif #if defined(ABS_HAT2Y) || (defined(HAVE_DECL_ABS_HAT2Y) && HAVE_DECL_ABS_HAT2Y) - XLAT(ABS_HAT2Y), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_HAT2Y) == (0x15), "ABS_HAT2Y != 0x15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_HAT2Y 0x15 #endif #if defined(ABS_HAT3X) || (defined(HAVE_DECL_ABS_HAT3X) && HAVE_DECL_ABS_HAT3X) - XLAT(ABS_HAT3X), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_HAT3X) == (0x16), "ABS_HAT3X != 0x16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_HAT3X 0x16 #endif #if defined(ABS_HAT3Y) || (defined(HAVE_DECL_ABS_HAT3Y) && HAVE_DECL_ABS_HAT3Y) - XLAT(ABS_HAT3Y), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_HAT3Y) == (0x17), "ABS_HAT3Y != 0x17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_HAT3Y 0x17 #endif #if defined(ABS_PRESSURE) || (defined(HAVE_DECL_ABS_PRESSURE) && HAVE_DECL_ABS_PRESSURE) - XLAT(ABS_PRESSURE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_PRESSURE) == (0x18), "ABS_PRESSURE != 0x18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_PRESSURE 0x18 #endif #if defined(ABS_DISTANCE) || (defined(HAVE_DECL_ABS_DISTANCE) && HAVE_DECL_ABS_DISTANCE) - XLAT(ABS_DISTANCE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_DISTANCE) == (0x19), "ABS_DISTANCE != 0x19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_DISTANCE 0x19 #endif #if defined(ABS_TILT_X) || (defined(HAVE_DECL_ABS_TILT_X) && HAVE_DECL_ABS_TILT_X) - XLAT(ABS_TILT_X), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_TILT_X) == (0x1a), "ABS_TILT_X != 0x1a"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_TILT_X 0x1a #endif #if defined(ABS_TILT_Y) || (defined(HAVE_DECL_ABS_TILT_Y) && HAVE_DECL_ABS_TILT_Y) - XLAT(ABS_TILT_Y), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_TILT_Y) == (0x1b), "ABS_TILT_Y != 0x1b"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_TILT_Y 0x1b #endif #if defined(ABS_TOOL_WIDTH) || (defined(HAVE_DECL_ABS_TOOL_WIDTH) && HAVE_DECL_ABS_TOOL_WIDTH) - XLAT(ABS_TOOL_WIDTH), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_TOOL_WIDTH) == (0x1c), "ABS_TOOL_WIDTH != 0x1c"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_TOOL_WIDTH 0x1c #endif #if defined(ABS_VOLUME) || (defined(HAVE_DECL_ABS_VOLUME) && HAVE_DECL_ABS_VOLUME) - XLAT(ABS_VOLUME), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_VOLUME) == (0x20), "ABS_VOLUME != 0x20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_VOLUME 0x20 #endif #if defined(ABS_MISC) || (defined(HAVE_DECL_ABS_MISC) && HAVE_DECL_ABS_MISC) - XLAT(ABS_MISC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_MISC) == (0x28), "ABS_MISC != 0x28"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_MISC 0x28 +#endif +#if defined(ABS_RESERVED) || (defined(HAVE_DECL_ABS_RESERVED) && HAVE_DECL_ABS_RESERVED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_RESERVED) == (0x2e), "ABS_RESERVED != 0x2e"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_RESERVED 0x2e #endif #if defined(ABS_MT_SLOT) || (defined(HAVE_DECL_ABS_MT_SLOT) && HAVE_DECL_ABS_MT_SLOT) - XLAT(ABS_MT_SLOT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_MT_SLOT) == (0x2f), "ABS_MT_SLOT != 0x2f"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_MT_SLOT 0x2f #endif #if defined(ABS_MT_TOUCH_MAJOR) || (defined(HAVE_DECL_ABS_MT_TOUCH_MAJOR) && HAVE_DECL_ABS_MT_TOUCH_MAJOR) - XLAT(ABS_MT_TOUCH_MAJOR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_MT_TOUCH_MAJOR) == (0x30), "ABS_MT_TOUCH_MAJOR != 0x30"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_MT_TOUCH_MAJOR 0x30 #endif #if defined(ABS_MT_TOUCH_MINOR) || (defined(HAVE_DECL_ABS_MT_TOUCH_MINOR) && HAVE_DECL_ABS_MT_TOUCH_MINOR) - XLAT(ABS_MT_TOUCH_MINOR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_MT_TOUCH_MINOR) == (0x31), "ABS_MT_TOUCH_MINOR != 0x31"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_MT_TOUCH_MINOR 0x31 #endif #if defined(ABS_MT_WIDTH_MAJOR) || (defined(HAVE_DECL_ABS_MT_WIDTH_MAJOR) && HAVE_DECL_ABS_MT_WIDTH_MAJOR) - XLAT(ABS_MT_WIDTH_MAJOR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_MT_WIDTH_MAJOR) == (0x32), "ABS_MT_WIDTH_MAJOR != 0x32"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_MT_WIDTH_MAJOR 0x32 #endif #if defined(ABS_MT_WIDTH_MINOR) || (defined(HAVE_DECL_ABS_MT_WIDTH_MINOR) && HAVE_DECL_ABS_MT_WIDTH_MINOR) - XLAT(ABS_MT_WIDTH_MINOR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_MT_WIDTH_MINOR) == (0x33), "ABS_MT_WIDTH_MINOR != 0x33"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_MT_WIDTH_MINOR 0x33 #endif #if defined(ABS_MT_ORIENTATION) || (defined(HAVE_DECL_ABS_MT_ORIENTATION) && HAVE_DECL_ABS_MT_ORIENTATION) - XLAT(ABS_MT_ORIENTATION), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_MT_ORIENTATION) == (0x34), "ABS_MT_ORIENTATION != 0x34"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_MT_ORIENTATION 0x34 #endif #if defined(ABS_MT_POSITION_X) || (defined(HAVE_DECL_ABS_MT_POSITION_X) && HAVE_DECL_ABS_MT_POSITION_X) - XLAT(ABS_MT_POSITION_X), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_MT_POSITION_X) == (0x35), "ABS_MT_POSITION_X != 0x35"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_MT_POSITION_X 0x35 #endif #if defined(ABS_MT_POSITION_Y) || (defined(HAVE_DECL_ABS_MT_POSITION_Y) && HAVE_DECL_ABS_MT_POSITION_Y) - XLAT(ABS_MT_POSITION_Y), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_MT_POSITION_Y) == (0x36), "ABS_MT_POSITION_Y != 0x36"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_MT_POSITION_Y 0x36 #endif #if defined(ABS_MT_TOOL_TYPE) || (defined(HAVE_DECL_ABS_MT_TOOL_TYPE) && HAVE_DECL_ABS_MT_TOOL_TYPE) - XLAT(ABS_MT_TOOL_TYPE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_MT_TOOL_TYPE) == (0x37), "ABS_MT_TOOL_TYPE != 0x37"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_MT_TOOL_TYPE 0x37 #endif #if defined(ABS_MT_BLOB_ID) || (defined(HAVE_DECL_ABS_MT_BLOB_ID) && HAVE_DECL_ABS_MT_BLOB_ID) - XLAT(ABS_MT_BLOB_ID), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_MT_BLOB_ID) == (0x38), "ABS_MT_BLOB_ID != 0x38"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_MT_BLOB_ID 0x38 #endif #if defined(ABS_MT_TRACKING_ID) || (defined(HAVE_DECL_ABS_MT_TRACKING_ID) && HAVE_DECL_ABS_MT_TRACKING_ID) - XLAT(ABS_MT_TRACKING_ID), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_MT_TRACKING_ID) == (0x39), "ABS_MT_TRACKING_ID != 0x39"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_MT_TRACKING_ID 0x39 #endif #if defined(ABS_MT_PRESSURE) || (defined(HAVE_DECL_ABS_MT_PRESSURE) && HAVE_DECL_ABS_MT_PRESSURE) - XLAT(ABS_MT_PRESSURE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_MT_PRESSURE) == (0x3a), "ABS_MT_PRESSURE != 0x3a"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_MT_PRESSURE 0x3a #endif #if defined(ABS_MT_DISTANCE) || (defined(HAVE_DECL_ABS_MT_DISTANCE) && HAVE_DECL_ABS_MT_DISTANCE) - XLAT(ABS_MT_DISTANCE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_MT_DISTANCE) == (0x3b), "ABS_MT_DISTANCE != 0x3b"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_MT_DISTANCE 0x3b #endif #if defined(ABS_MT_TOOL_X) || (defined(HAVE_DECL_ABS_MT_TOOL_X) && HAVE_DECL_ABS_MT_TOOL_X) - XLAT(ABS_MT_TOOL_X), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_MT_TOOL_X) == (0x3c), "ABS_MT_TOOL_X != 0x3c"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_MT_TOOL_X 0x3c #endif #if defined(ABS_MT_TOOL_Y) || (defined(HAVE_DECL_ABS_MT_TOOL_Y) && HAVE_DECL_ABS_MT_TOOL_Y) - XLAT(ABS_MT_TOOL_Y), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ABS_MT_TOOL_Y) == (0x3d), "ABS_MT_TOOL_Y != 0x3d"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ABS_MT_TOOL_Y 0x3d #endif + +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS + +const struct xlat evdev_abs[] = { + [ABS_X] = XLAT(ABS_X), + [ABS_Y] = XLAT(ABS_Y), + [ABS_Z] = XLAT(ABS_Z), + [ABS_RX] = XLAT(ABS_RX), + [ABS_RY] = XLAT(ABS_RY), + [ABS_RZ] = XLAT(ABS_RZ), + [ABS_THROTTLE] = XLAT(ABS_THROTTLE), + [ABS_RUDDER] = XLAT(ABS_RUDDER), + [ABS_WHEEL] = XLAT(ABS_WHEEL), + [ABS_GAS] = XLAT(ABS_GAS), + [ABS_BRAKE] = XLAT(ABS_BRAKE), + [ABS_HAT0X] = XLAT(ABS_HAT0X), + [ABS_HAT0Y] = XLAT(ABS_HAT0Y), + [ABS_HAT1X] = XLAT(ABS_HAT1X), + [ABS_HAT1Y] = XLAT(ABS_HAT1Y), + [ABS_HAT2X] = XLAT(ABS_HAT2X), + [ABS_HAT2Y] = XLAT(ABS_HAT2Y), + [ABS_HAT3X] = XLAT(ABS_HAT3X), + [ABS_HAT3Y] = XLAT(ABS_HAT3Y), + [ABS_PRESSURE] = XLAT(ABS_PRESSURE), + [ABS_DISTANCE] = XLAT(ABS_DISTANCE), + [ABS_TILT_X] = XLAT(ABS_TILT_X), + [ABS_TILT_Y] = XLAT(ABS_TILT_Y), + [ABS_TOOL_WIDTH] = XLAT(ABS_TOOL_WIDTH), + [ABS_VOLUME] = XLAT(ABS_VOLUME), + [ABS_MISC] = XLAT(ABS_MISC), + [ABS_RESERVED] = XLAT(ABS_RESERVED), + [ABS_MT_SLOT] = XLAT(ABS_MT_SLOT), + [ABS_MT_TOUCH_MAJOR] = XLAT(ABS_MT_TOUCH_MAJOR), + [ABS_MT_TOUCH_MINOR] = XLAT(ABS_MT_TOUCH_MINOR), + [ABS_MT_WIDTH_MAJOR] = XLAT(ABS_MT_WIDTH_MAJOR), + [ABS_MT_WIDTH_MINOR] = XLAT(ABS_MT_WIDTH_MINOR), + [ABS_MT_ORIENTATION] = XLAT(ABS_MT_ORIENTATION), + [ABS_MT_POSITION_X] = XLAT(ABS_MT_POSITION_X), + [ABS_MT_POSITION_Y] = XLAT(ABS_MT_POSITION_Y), + [ABS_MT_TOOL_TYPE] = XLAT(ABS_MT_TOOL_TYPE), + [ABS_MT_BLOB_ID] = XLAT(ABS_MT_BLOB_ID), + [ABS_MT_TRACKING_ID] = XLAT(ABS_MT_TRACKING_ID), + [ABS_MT_PRESSURE] = XLAT(ABS_MT_PRESSURE), + [ABS_MT_DISTANCE] = XLAT(ABS_MT_DISTANCE), + [ABS_MT_TOOL_X] = XLAT(ABS_MT_TOOL_X), + [ABS_MT_TOOL_Y] = XLAT(ABS_MT_TOOL_Y), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/evdev_abs.in b/xlat/evdev_abs.in index ec8c2f43..e2d69000 100644 --- a/xlat/evdev_abs.in +++ b/xlat/evdev_abs.in @@ -1,41 +1,43 @@ -ABS_X -ABS_Y -ABS_Z -ABS_RX -ABS_RY -ABS_RZ -ABS_THROTTLE -ABS_RUDDER -ABS_WHEEL -ABS_GAS -ABS_BRAKE -ABS_HAT0X -ABS_HAT0Y -ABS_HAT1X -ABS_HAT1Y -ABS_HAT2X -ABS_HAT2Y -ABS_HAT3X -ABS_HAT3Y -ABS_PRESSURE -ABS_DISTANCE -ABS_TILT_X -ABS_TILT_Y -ABS_TOOL_WIDTH -ABS_VOLUME -ABS_MISC -ABS_MT_SLOT -ABS_MT_TOUCH_MAJOR -ABS_MT_TOUCH_MINOR -ABS_MT_WIDTH_MAJOR -ABS_MT_WIDTH_MINOR -ABS_MT_ORIENTATION -ABS_MT_POSITION_X -ABS_MT_POSITION_Y -ABS_MT_TOOL_TYPE -ABS_MT_BLOB_ID -ABS_MT_TRACKING_ID -ABS_MT_PRESSURE -ABS_MT_DISTANCE -ABS_MT_TOOL_X -ABS_MT_TOOL_Y +#value_indexed +ABS_X 0x00 +ABS_Y 0x01 +ABS_Z 0x02 +ABS_RX 0x03 +ABS_RY 0x04 +ABS_RZ 0x05 +ABS_THROTTLE 0x06 +ABS_RUDDER 0x07 +ABS_WHEEL 0x08 +ABS_GAS 0x09 +ABS_BRAKE 0x0a +ABS_HAT0X 0x10 +ABS_HAT0Y 0x11 +ABS_HAT1X 0x12 +ABS_HAT1Y 0x13 +ABS_HAT2X 0x14 +ABS_HAT2Y 0x15 +ABS_HAT3X 0x16 +ABS_HAT3Y 0x17 +ABS_PRESSURE 0x18 +ABS_DISTANCE 0x19 +ABS_TILT_X 0x1a +ABS_TILT_Y 0x1b +ABS_TOOL_WIDTH 0x1c +ABS_VOLUME 0x20 +ABS_MISC 0x28 +ABS_RESERVED 0x2e +ABS_MT_SLOT 0x2f +ABS_MT_TOUCH_MAJOR 0x30 +ABS_MT_TOUCH_MINOR 0x31 +ABS_MT_WIDTH_MAJOR 0x32 +ABS_MT_WIDTH_MINOR 0x33 +ABS_MT_ORIENTATION 0x34 +ABS_MT_POSITION_X 0x35 +ABS_MT_POSITION_Y 0x36 +ABS_MT_TOOL_TYPE 0x37 +ABS_MT_BLOB_ID 0x38 +ABS_MT_TRACKING_ID 0x39 +ABS_MT_PRESSURE 0x3a +ABS_MT_DISTANCE 0x3b +ABS_MT_TOOL_X 0x3c +ABS_MT_TOOL_Y 0x3d diff --git a/xlat/evdev_autorepeat.h b/xlat/evdev_autorepeat.h index 67f1ce6d..c6edd503 100644 --- a/xlat/evdev_autorepeat.h +++ b/xlat/evdev_autorepeat.h @@ -1,22 +1,38 @@ /* Generated by ./xlat/gen.sh from ./xlat/evdev_autorepeat.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -extern const struct xlat evdev_autorepeat[]; - -#else - -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) -static -# endif -const struct xlat evdev_autorepeat[] = { #if defined(REP_DELAY) || (defined(HAVE_DECL_REP_DELAY) && HAVE_DECL_REP_DELAY) - XLAT(REP_DELAY), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((REP_DELAY) == (0x00), "REP_DELAY != 0x00"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define REP_DELAY 0x00 #endif #if defined(REP_PERIOD) || (defined(HAVE_DECL_REP_PERIOD) && HAVE_DECL_REP_PERIOD) - XLAT(REP_PERIOD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((REP_PERIOD) == (0x01), "REP_PERIOD != 0x01"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define REP_PERIOD 0x01 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat evdev_autorepeat in mpers mode + +# else + +static +const struct xlat evdev_autorepeat[] = { + [REP_DELAY] = XLAT(REP_DELAY), + [REP_PERIOD] = XLAT(REP_PERIOD), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/evdev_autorepeat.in b/xlat/evdev_autorepeat.in index ac8b8fb5..7ab7e2e7 100644 --- a/xlat/evdev_autorepeat.in +++ b/xlat/evdev_autorepeat.in @@ -1,2 +1,3 @@ -REP_DELAY -REP_PERIOD +#value_indexed +REP_DELAY 0x00 +REP_PERIOD 0x01 diff --git a/xlat/evdev_ev.h b/xlat/evdev_ev.h index 1d49445e..a112805d 100644 --- a/xlat/evdev_ev.h +++ b/xlat/evdev_ev.h @@ -1,50 +1,113 @@ /* Generated by ./xlat/gen.sh from ./xlat/evdev_ev.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat evdev_ev in mpers mode - -#else - -static -const struct xlat evdev_ev[] = { #if defined(EV_SYN) || (defined(HAVE_DECL_EV_SYN) && HAVE_DECL_EV_SYN) - XLAT(EV_SYN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EV_SYN) == (0x00), "EV_SYN != 0x00"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EV_SYN 0x00 #endif #if defined(EV_KEY) || (defined(HAVE_DECL_EV_KEY) && HAVE_DECL_EV_KEY) - XLAT(EV_KEY), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EV_KEY) == (0x01), "EV_KEY != 0x01"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EV_KEY 0x01 #endif #if defined(EV_REL) || (defined(HAVE_DECL_EV_REL) && HAVE_DECL_EV_REL) - XLAT(EV_REL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EV_REL) == (0x02), "EV_REL != 0x02"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EV_REL 0x02 #endif #if defined(EV_ABS) || (defined(HAVE_DECL_EV_ABS) && HAVE_DECL_EV_ABS) - XLAT(EV_ABS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EV_ABS) == (0x03), "EV_ABS != 0x03"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EV_ABS 0x03 #endif #if defined(EV_MSC) || (defined(HAVE_DECL_EV_MSC) && HAVE_DECL_EV_MSC) - XLAT(EV_MSC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EV_MSC) == (0x04), "EV_MSC != 0x04"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EV_MSC 0x04 #endif #if defined(EV_SW) || (defined(HAVE_DECL_EV_SW) && HAVE_DECL_EV_SW) - XLAT(EV_SW), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EV_SW) == (0x05), "EV_SW != 0x05"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EV_SW 0x05 #endif #if defined(EV_LED) || (defined(HAVE_DECL_EV_LED) && HAVE_DECL_EV_LED) - XLAT(EV_LED), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EV_LED) == (0x11), "EV_LED != 0x11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EV_LED 0x11 #endif #if defined(EV_SND) || (defined(HAVE_DECL_EV_SND) && HAVE_DECL_EV_SND) - XLAT(EV_SND), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EV_SND) == (0x12), "EV_SND != 0x12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EV_SND 0x12 #endif #if defined(EV_REP) || (defined(HAVE_DECL_EV_REP) && HAVE_DECL_EV_REP) - XLAT(EV_REP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EV_REP) == (0x14), "EV_REP != 0x14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EV_REP 0x14 #endif #if defined(EV_FF) || (defined(HAVE_DECL_EV_FF) && HAVE_DECL_EV_FF) - XLAT(EV_FF), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EV_FF) == (0x15), "EV_FF != 0x15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EV_FF 0x15 #endif #if defined(EV_PWR) || (defined(HAVE_DECL_EV_PWR) && HAVE_DECL_EV_PWR) - XLAT(EV_PWR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EV_PWR) == (0x16), "EV_PWR != 0x16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EV_PWR 0x16 #endif #if defined(EV_FF_STATUS) || (defined(HAVE_DECL_EV_FF_STATUS) && HAVE_DECL_EV_FF_STATUS) - XLAT(EV_FF_STATUS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EV_FF_STATUS) == (0x17), "EV_FF_STATUS != 0x17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define EV_FF_STATUS 0x17 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS + +const struct xlat evdev_ev[] = { + XLAT(EV_SYN), + XLAT(EV_KEY), + XLAT(EV_REL), + XLAT(EV_ABS), + XLAT(EV_MSC), + XLAT(EV_SW), + XLAT(EV_LED), + XLAT(EV_SND), + XLAT(EV_REP), + XLAT(EV_FF), + XLAT(EV_PWR), + XLAT(EV_FF_STATUS), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/evdev_ev.in b/xlat/evdev_ev.in index 0974b591..4d81952b 100644 --- a/xlat/evdev_ev.in +++ b/xlat/evdev_ev.in @@ -1,12 +1,12 @@ -EV_SYN -EV_KEY -EV_REL -EV_ABS -EV_MSC -EV_SW -EV_LED -EV_SND -EV_REP -EV_FF -EV_PWR -EV_FF_STATUS +EV_SYN 0x00 +EV_KEY 0x01 +EV_REL 0x02 +EV_ABS 0x03 +EV_MSC 0x04 +EV_SW 0x05 +EV_LED 0x11 +EV_SND 0x12 +EV_REP 0x14 +EV_FF 0x15 +EV_PWR 0x16 +EV_FF_STATUS 0x17 diff --git a/xlat/evdev_ff_status.h b/xlat/evdev_ff_status.h index 2313d1a0..947d545d 100644 --- a/xlat/evdev_ff_status.h +++ b/xlat/evdev_ff_status.h @@ -1,22 +1,38 @@ /* Generated by ./xlat/gen.sh from ./xlat/evdev_ff_status.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -extern const struct xlat evdev_ff_status[]; - -#else - -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) -static -# endif -const struct xlat evdev_ff_status[] = { #if defined(FF_STATUS_STOPPED) || (defined(HAVE_DECL_FF_STATUS_STOPPED) && HAVE_DECL_FF_STATUS_STOPPED) - XLAT(FF_STATUS_STOPPED), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FF_STATUS_STOPPED) == (0x00), "FF_STATUS_STOPPED != 0x00"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FF_STATUS_STOPPED 0x00 #endif #if defined(FF_STATUS_PLAYING) || (defined(HAVE_DECL_FF_STATUS_PLAYING) && HAVE_DECL_FF_STATUS_PLAYING) - XLAT(FF_STATUS_PLAYING), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FF_STATUS_PLAYING) == (0x01), "FF_STATUS_PLAYING != 0x01"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FF_STATUS_PLAYING 0x01 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat evdev_ff_status in mpers mode + +# else + +static +const struct xlat evdev_ff_status[] = { + [FF_STATUS_STOPPED] = XLAT(FF_STATUS_STOPPED), + [FF_STATUS_PLAYING] = XLAT(FF_STATUS_PLAYING), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/evdev_ff_status.in b/xlat/evdev_ff_status.in index 3f887101..1f2815f7 100644 --- a/xlat/evdev_ff_status.in +++ b/xlat/evdev_ff_status.in @@ -1,2 +1,3 @@ -FF_STATUS_STOPPED -FF_STATUS_PLAYING +#value_indexed +FF_STATUS_STOPPED 0x00 +FF_STATUS_PLAYING 0x01 diff --git a/xlat/evdev_ff_types.h b/xlat/evdev_ff_types.h index 2608bb12..3bc6b042 100644 --- a/xlat/evdev_ff_types.h +++ b/xlat/evdev_ff_types.h @@ -1,64 +1,151 @@ /* Generated by ./xlat/gen.sh from ./xlat/evdev_ff_types.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -extern const struct xlat evdev_ff_types[]; - -#else - -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) -static -# endif -const struct xlat evdev_ff_types[] = { #if defined(FF_RUMBLE) || (defined(HAVE_DECL_FF_RUMBLE) && HAVE_DECL_FF_RUMBLE) - XLAT(FF_RUMBLE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FF_RUMBLE) == (0x50), "FF_RUMBLE != 0x50"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FF_RUMBLE 0x50 #endif #if defined(FF_PERIODIC) || (defined(HAVE_DECL_FF_PERIODIC) && HAVE_DECL_FF_PERIODIC) - XLAT(FF_PERIODIC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FF_PERIODIC) == (0x51), "FF_PERIODIC != 0x51"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FF_PERIODIC 0x51 #endif #if defined(FF_CONSTANT) || (defined(HAVE_DECL_FF_CONSTANT) && HAVE_DECL_FF_CONSTANT) - XLAT(FF_CONSTANT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FF_CONSTANT) == (0x52), "FF_CONSTANT != 0x52"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FF_CONSTANT 0x52 #endif #if defined(FF_SPRING) || (defined(HAVE_DECL_FF_SPRING) && HAVE_DECL_FF_SPRING) - XLAT(FF_SPRING), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FF_SPRING) == (0x53), "FF_SPRING != 0x53"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FF_SPRING 0x53 #endif #if defined(FF_FRICTION) || (defined(HAVE_DECL_FF_FRICTION) && HAVE_DECL_FF_FRICTION) - XLAT(FF_FRICTION), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FF_FRICTION) == (0x54), "FF_FRICTION != 0x54"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FF_FRICTION 0x54 #endif #if defined(FF_DAMPER) || (defined(HAVE_DECL_FF_DAMPER) && HAVE_DECL_FF_DAMPER) - XLAT(FF_DAMPER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FF_DAMPER) == (0x55), "FF_DAMPER != 0x55"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FF_DAMPER 0x55 #endif #if defined(FF_INERTIA) || (defined(HAVE_DECL_FF_INERTIA) && HAVE_DECL_FF_INERTIA) - XLAT(FF_INERTIA), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FF_INERTIA) == (0x56), "FF_INERTIA != 0x56"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FF_INERTIA 0x56 #endif #if defined(FF_RAMP) || (defined(HAVE_DECL_FF_RAMP) && HAVE_DECL_FF_RAMP) - XLAT(FF_RAMP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FF_RAMP) == (0x57), "FF_RAMP != 0x57"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FF_RAMP 0x57 #endif #if defined(FF_SQUARE) || (defined(HAVE_DECL_FF_SQUARE) && HAVE_DECL_FF_SQUARE) - XLAT(FF_SQUARE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FF_SQUARE) == (0x58), "FF_SQUARE != 0x58"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FF_SQUARE 0x58 #endif #if defined(FF_TRIANGLE) || (defined(HAVE_DECL_FF_TRIANGLE) && HAVE_DECL_FF_TRIANGLE) - XLAT(FF_TRIANGLE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FF_TRIANGLE) == (0x59), "FF_TRIANGLE != 0x59"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FF_TRIANGLE 0x59 #endif #if defined(FF_SINE) || (defined(HAVE_DECL_FF_SINE) && HAVE_DECL_FF_SINE) - XLAT(FF_SINE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FF_SINE) == (0x5a), "FF_SINE != 0x5a"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FF_SINE 0x5a #endif #if defined(FF_SAW_UP) || (defined(HAVE_DECL_FF_SAW_UP) && HAVE_DECL_FF_SAW_UP) - XLAT(FF_SAW_UP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FF_SAW_UP) == (0x5b), "FF_SAW_UP != 0x5b"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FF_SAW_UP 0x5b #endif #if defined(FF_SAW_DOWN) || (defined(HAVE_DECL_FF_SAW_DOWN) && HAVE_DECL_FF_SAW_DOWN) - XLAT(FF_SAW_DOWN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FF_SAW_DOWN) == (0x5c), "FF_SAW_DOWN != 0x5c"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FF_SAW_DOWN 0x5c #endif #if defined(FF_CUSTOM) || (defined(HAVE_DECL_FF_CUSTOM) && HAVE_DECL_FF_CUSTOM) - XLAT(FF_CUSTOM), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FF_CUSTOM) == (0x5d), "FF_CUSTOM != 0x5d"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FF_CUSTOM 0x5d #endif #if defined(FF_GAIN) || (defined(HAVE_DECL_FF_GAIN) && HAVE_DECL_FF_GAIN) - XLAT(FF_GAIN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FF_GAIN) == (0x60), "FF_GAIN != 0x60"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FF_GAIN 0x60 #endif #if defined(FF_AUTOCENTER) || (defined(HAVE_DECL_FF_AUTOCENTER) && HAVE_DECL_FF_AUTOCENTER) - XLAT(FF_AUTOCENTER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FF_AUTOCENTER) == (0x61), "FF_AUTOCENTER != 0x61"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FF_AUTOCENTER 0x61 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat evdev_ff_types in mpers mode + +# else + +static +const struct xlat evdev_ff_types[] = { + + XLAT(FF_RUMBLE), + XLAT(FF_PERIODIC), + XLAT(FF_CONSTANT), + XLAT(FF_SPRING), + XLAT(FF_FRICTION), + XLAT(FF_DAMPER), + XLAT(FF_INERTIA), + XLAT(FF_RAMP), + XLAT(FF_SQUARE), + XLAT(FF_TRIANGLE), + XLAT(FF_SINE), + XLAT(FF_SAW_UP), + XLAT(FF_SAW_DOWN), + XLAT(FF_CUSTOM), + XLAT(FF_GAIN), + XLAT(FF_AUTOCENTER), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/evdev_ff_types.in b/xlat/evdev_ff_types.in index c6714f8f..72b87c53 100644 --- a/xlat/evdev_ff_types.in +++ b/xlat/evdev_ff_types.in @@ -1,16 +1,17 @@ -FF_RUMBLE -FF_PERIODIC -FF_CONSTANT -FF_SPRING -FF_FRICTION -FF_DAMPER -FF_INERTIA -FF_RAMP -FF_SQUARE -FF_TRIANGLE -FF_SINE -FF_SAW_UP -FF_SAW_DOWN -FF_CUSTOM -FF_GAIN -FF_AUTOCENTER +/* sort -k2,2 */ +FF_RUMBLE 0x50 +FF_PERIODIC 0x51 +FF_CONSTANT 0x52 +FF_SPRING 0x53 +FF_FRICTION 0x54 +FF_DAMPER 0x55 +FF_INERTIA 0x56 +FF_RAMP 0x57 +FF_SQUARE 0x58 +FF_TRIANGLE 0x59 +FF_SINE 0x5a +FF_SAW_UP 0x5b +FF_SAW_DOWN 0x5c +FF_CUSTOM 0x5d +FF_GAIN 0x60 +FF_AUTOCENTER 0x61 diff --git a/xlat/evdev_keycode.h b/xlat/evdev_keycode.h index c4efd2cd..9fedfb92 100644 --- a/xlat/evdev_keycode.h +++ b/xlat/evdev_keycode.h @@ -1,1721 +1,4474 @@ /* Generated by ./xlat/gen.sh from ./xlat/evdev_keycode.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -extern const struct xlat evdev_keycode[]; - -#else - -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) -static -# endif -const struct xlat evdev_keycode[] = { #if defined(KEY_RESERVED) || (defined(HAVE_DECL_KEY_RESERVED) && HAVE_DECL_KEY_RESERVED) - XLAT(KEY_RESERVED), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_RESERVED) == (0), "KEY_RESERVED != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_RESERVED 0 #endif #if defined(KEY_ESC) || (defined(HAVE_DECL_KEY_ESC) && HAVE_DECL_KEY_ESC) - XLAT(KEY_ESC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_ESC) == (1), "KEY_ESC != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_ESC 1 #endif #if defined(KEY_1) || (defined(HAVE_DECL_KEY_1) && HAVE_DECL_KEY_1) - XLAT(KEY_1), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_1) == (2), "KEY_1 != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_1 2 #endif #if defined(KEY_2) || (defined(HAVE_DECL_KEY_2) && HAVE_DECL_KEY_2) - XLAT(KEY_2), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_2) == (3), "KEY_2 != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_2 3 #endif #if defined(KEY_3) || (defined(HAVE_DECL_KEY_3) && HAVE_DECL_KEY_3) - XLAT(KEY_3), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_3) == (4), "KEY_3 != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_3 4 #endif #if defined(KEY_4) || (defined(HAVE_DECL_KEY_4) && HAVE_DECL_KEY_4) - XLAT(KEY_4), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_4) == (5), "KEY_4 != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_4 5 #endif #if defined(KEY_5) || (defined(HAVE_DECL_KEY_5) && HAVE_DECL_KEY_5) - XLAT(KEY_5), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_5) == (6), "KEY_5 != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_5 6 #endif #if defined(KEY_6) || (defined(HAVE_DECL_KEY_6) && HAVE_DECL_KEY_6) - XLAT(KEY_6), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_6) == (7), "KEY_6 != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_6 7 #endif #if defined(KEY_7) || (defined(HAVE_DECL_KEY_7) && HAVE_DECL_KEY_7) - XLAT(KEY_7), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_7) == (8), "KEY_7 != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_7 8 #endif #if defined(KEY_8) || (defined(HAVE_DECL_KEY_8) && HAVE_DECL_KEY_8) - XLAT(KEY_8), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_8) == (9), "KEY_8 != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_8 9 #endif #if defined(KEY_9) || (defined(HAVE_DECL_KEY_9) && HAVE_DECL_KEY_9) - XLAT(KEY_9), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_9) == (10), "KEY_9 != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_9 10 #endif #if defined(KEY_0) || (defined(HAVE_DECL_KEY_0) && HAVE_DECL_KEY_0) - XLAT(KEY_0), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_0) == (11), "KEY_0 != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_0 11 #endif #if defined(KEY_MINUS) || (defined(HAVE_DECL_KEY_MINUS) && HAVE_DECL_KEY_MINUS) - XLAT(KEY_MINUS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_MINUS) == (12), "KEY_MINUS != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_MINUS 12 #endif #if defined(KEY_EQUAL) || (defined(HAVE_DECL_KEY_EQUAL) && HAVE_DECL_KEY_EQUAL) - XLAT(KEY_EQUAL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_EQUAL) == (13), "KEY_EQUAL != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_EQUAL 13 #endif #if defined(KEY_BACKSPACE) || (defined(HAVE_DECL_KEY_BACKSPACE) && HAVE_DECL_KEY_BACKSPACE) - XLAT(KEY_BACKSPACE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BACKSPACE) == (14), "KEY_BACKSPACE != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BACKSPACE 14 #endif #if defined(KEY_TAB) || (defined(HAVE_DECL_KEY_TAB) && HAVE_DECL_KEY_TAB) - XLAT(KEY_TAB), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_TAB) == (15), "KEY_TAB != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_TAB 15 #endif #if defined(KEY_Q) || (defined(HAVE_DECL_KEY_Q) && HAVE_DECL_KEY_Q) - XLAT(KEY_Q), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_Q) == (16), "KEY_Q != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_Q 16 #endif #if defined(KEY_W) || (defined(HAVE_DECL_KEY_W) && HAVE_DECL_KEY_W) - XLAT(KEY_W), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_W) == (17), "KEY_W != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_W 17 #endif #if defined(KEY_E) || (defined(HAVE_DECL_KEY_E) && HAVE_DECL_KEY_E) - XLAT(KEY_E), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_E) == (18), "KEY_E != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_E 18 #endif #if defined(KEY_R) || (defined(HAVE_DECL_KEY_R) && HAVE_DECL_KEY_R) - XLAT(KEY_R), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_R) == (19), "KEY_R != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_R 19 #endif #if defined(KEY_T) || (defined(HAVE_DECL_KEY_T) && HAVE_DECL_KEY_T) - XLAT(KEY_T), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_T) == (20), "KEY_T != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_T 20 #endif #if defined(KEY_Y) || (defined(HAVE_DECL_KEY_Y) && HAVE_DECL_KEY_Y) - XLAT(KEY_Y), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_Y) == (21), "KEY_Y != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_Y 21 #endif #if defined(KEY_U) || (defined(HAVE_DECL_KEY_U) && HAVE_DECL_KEY_U) - XLAT(KEY_U), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_U) == (22), "KEY_U != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_U 22 #endif #if defined(KEY_I) || (defined(HAVE_DECL_KEY_I) && HAVE_DECL_KEY_I) - XLAT(KEY_I), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_I) == (23), "KEY_I != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_I 23 #endif #if defined(KEY_O) || (defined(HAVE_DECL_KEY_O) && HAVE_DECL_KEY_O) - XLAT(KEY_O), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_O) == (24), "KEY_O != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_O 24 #endif #if defined(KEY_P) || (defined(HAVE_DECL_KEY_P) && HAVE_DECL_KEY_P) - XLAT(KEY_P), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_P) == (25), "KEY_P != 25"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_P 25 #endif #if defined(KEY_LEFTBRACE) || (defined(HAVE_DECL_KEY_LEFTBRACE) && HAVE_DECL_KEY_LEFTBRACE) - XLAT(KEY_LEFTBRACE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_LEFTBRACE) == (26), "KEY_LEFTBRACE != 26"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_LEFTBRACE 26 #endif #if defined(KEY_RIGHTBRACE) || (defined(HAVE_DECL_KEY_RIGHTBRACE) && HAVE_DECL_KEY_RIGHTBRACE) - XLAT(KEY_RIGHTBRACE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_RIGHTBRACE) == (27), "KEY_RIGHTBRACE != 27"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_RIGHTBRACE 27 #endif #if defined(KEY_ENTER) || (defined(HAVE_DECL_KEY_ENTER) && HAVE_DECL_KEY_ENTER) - XLAT(KEY_ENTER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_ENTER) == (28), "KEY_ENTER != 28"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_ENTER 28 #endif #if defined(KEY_LEFTCTRL) || (defined(HAVE_DECL_KEY_LEFTCTRL) && HAVE_DECL_KEY_LEFTCTRL) - XLAT(KEY_LEFTCTRL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_LEFTCTRL) == (29), "KEY_LEFTCTRL != 29"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_LEFTCTRL 29 #endif #if defined(KEY_A) || (defined(HAVE_DECL_KEY_A) && HAVE_DECL_KEY_A) - XLAT(KEY_A), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_A) == (30), "KEY_A != 30"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_A 30 #endif #if defined(KEY_S) || (defined(HAVE_DECL_KEY_S) && HAVE_DECL_KEY_S) - XLAT(KEY_S), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_S) == (31), "KEY_S != 31"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_S 31 #endif #if defined(KEY_D) || (defined(HAVE_DECL_KEY_D) && HAVE_DECL_KEY_D) - XLAT(KEY_D), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_D) == (32), "KEY_D != 32"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_D 32 #endif #if defined(KEY_F) || (defined(HAVE_DECL_KEY_F) && HAVE_DECL_KEY_F) - XLAT(KEY_F), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F) == (33), "KEY_F != 33"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F 33 #endif #if defined(KEY_G) || (defined(HAVE_DECL_KEY_G) && HAVE_DECL_KEY_G) - XLAT(KEY_G), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_G) == (34), "KEY_G != 34"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_G 34 #endif #if defined(KEY_H) || (defined(HAVE_DECL_KEY_H) && HAVE_DECL_KEY_H) - XLAT(KEY_H), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_H) == (35), "KEY_H != 35"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_H 35 #endif #if defined(KEY_J) || (defined(HAVE_DECL_KEY_J) && HAVE_DECL_KEY_J) - XLAT(KEY_J), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_J) == (36), "KEY_J != 36"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_J 36 #endif #if defined(KEY_K) || (defined(HAVE_DECL_KEY_K) && HAVE_DECL_KEY_K) - XLAT(KEY_K), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_K) == (37), "KEY_K != 37"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_K 37 #endif #if defined(KEY_L) || (defined(HAVE_DECL_KEY_L) && HAVE_DECL_KEY_L) - XLAT(KEY_L), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_L) == (38), "KEY_L != 38"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_L 38 #endif #if defined(KEY_SEMICOLON) || (defined(HAVE_DECL_KEY_SEMICOLON) && HAVE_DECL_KEY_SEMICOLON) - XLAT(KEY_SEMICOLON), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SEMICOLON) == (39), "KEY_SEMICOLON != 39"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SEMICOLON 39 #endif #if defined(KEY_APOSTROPHE) || (defined(HAVE_DECL_KEY_APOSTROPHE) && HAVE_DECL_KEY_APOSTROPHE) - XLAT(KEY_APOSTROPHE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_APOSTROPHE) == (40), "KEY_APOSTROPHE != 40"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_APOSTROPHE 40 #endif #if defined(KEY_GRAVE) || (defined(HAVE_DECL_KEY_GRAVE) && HAVE_DECL_KEY_GRAVE) - XLAT(KEY_GRAVE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_GRAVE) == (41), "KEY_GRAVE != 41"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_GRAVE 41 #endif #if defined(KEY_LEFTSHIFT) || (defined(HAVE_DECL_KEY_LEFTSHIFT) && HAVE_DECL_KEY_LEFTSHIFT) - XLAT(KEY_LEFTSHIFT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_LEFTSHIFT) == (42), "KEY_LEFTSHIFT != 42"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_LEFTSHIFT 42 #endif #if defined(KEY_BACKSLASH) || (defined(HAVE_DECL_KEY_BACKSLASH) && HAVE_DECL_KEY_BACKSLASH) - XLAT(KEY_BACKSLASH), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BACKSLASH) == (43), "KEY_BACKSLASH != 43"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BACKSLASH 43 #endif #if defined(KEY_Z) || (defined(HAVE_DECL_KEY_Z) && HAVE_DECL_KEY_Z) - XLAT(KEY_Z), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_Z) == (44), "KEY_Z != 44"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_Z 44 #endif #if defined(KEY_X) || (defined(HAVE_DECL_KEY_X) && HAVE_DECL_KEY_X) - XLAT(KEY_X), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_X) == (45), "KEY_X != 45"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_X 45 #endif #if defined(KEY_C) || (defined(HAVE_DECL_KEY_C) && HAVE_DECL_KEY_C) - XLAT(KEY_C), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_C) == (46), "KEY_C != 46"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_C 46 #endif #if defined(KEY_V) || (defined(HAVE_DECL_KEY_V) && HAVE_DECL_KEY_V) - XLAT(KEY_V), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_V) == (47), "KEY_V != 47"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_V 47 #endif #if defined(KEY_B) || (defined(HAVE_DECL_KEY_B) && HAVE_DECL_KEY_B) - XLAT(KEY_B), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_B) == (48), "KEY_B != 48"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_B 48 #endif #if defined(KEY_N) || (defined(HAVE_DECL_KEY_N) && HAVE_DECL_KEY_N) - XLAT(KEY_N), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_N) == (49), "KEY_N != 49"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_N 49 #endif #if defined(KEY_M) || (defined(HAVE_DECL_KEY_M) && HAVE_DECL_KEY_M) - XLAT(KEY_M), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_M) == (50), "KEY_M != 50"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_M 50 #endif #if defined(KEY_COMMA) || (defined(HAVE_DECL_KEY_COMMA) && HAVE_DECL_KEY_COMMA) - XLAT(KEY_COMMA), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_COMMA) == (51), "KEY_COMMA != 51"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_COMMA 51 #endif #if defined(KEY_DOT) || (defined(HAVE_DECL_KEY_DOT) && HAVE_DECL_KEY_DOT) - XLAT(KEY_DOT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_DOT) == (52), "KEY_DOT != 52"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_DOT 52 #endif #if defined(KEY_SLASH) || (defined(HAVE_DECL_KEY_SLASH) && HAVE_DECL_KEY_SLASH) - XLAT(KEY_SLASH), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SLASH) == (53), "KEY_SLASH != 53"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SLASH 53 #endif #if defined(KEY_RIGHTSHIFT) || (defined(HAVE_DECL_KEY_RIGHTSHIFT) && HAVE_DECL_KEY_RIGHTSHIFT) - XLAT(KEY_RIGHTSHIFT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_RIGHTSHIFT) == (54), "KEY_RIGHTSHIFT != 54"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_RIGHTSHIFT 54 #endif #if defined(KEY_KPASTERISK) || (defined(HAVE_DECL_KEY_KPASTERISK) && HAVE_DECL_KEY_KPASTERISK) - XLAT(KEY_KPASTERISK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KPASTERISK) == (55), "KEY_KPASTERISK != 55"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KPASTERISK 55 #endif #if defined(KEY_LEFTALT) || (defined(HAVE_DECL_KEY_LEFTALT) && HAVE_DECL_KEY_LEFTALT) - XLAT(KEY_LEFTALT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_LEFTALT) == (56), "KEY_LEFTALT != 56"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_LEFTALT 56 #endif #if defined(KEY_SPACE) || (defined(HAVE_DECL_KEY_SPACE) && HAVE_DECL_KEY_SPACE) - XLAT(KEY_SPACE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SPACE) == (57), "KEY_SPACE != 57"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SPACE 57 #endif #if defined(KEY_CAPSLOCK) || (defined(HAVE_DECL_KEY_CAPSLOCK) && HAVE_DECL_KEY_CAPSLOCK) - XLAT(KEY_CAPSLOCK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CAPSLOCK) == (58), "KEY_CAPSLOCK != 58"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CAPSLOCK 58 #endif #if defined(KEY_F1) || (defined(HAVE_DECL_KEY_F1) && HAVE_DECL_KEY_F1) - XLAT(KEY_F1), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F1) == (59), "KEY_F1 != 59"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F1 59 #endif #if defined(KEY_F2) || (defined(HAVE_DECL_KEY_F2) && HAVE_DECL_KEY_F2) - XLAT(KEY_F2), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F2) == (60), "KEY_F2 != 60"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F2 60 #endif #if defined(KEY_F3) || (defined(HAVE_DECL_KEY_F3) && HAVE_DECL_KEY_F3) - XLAT(KEY_F3), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F3) == (61), "KEY_F3 != 61"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F3 61 #endif #if defined(KEY_F4) || (defined(HAVE_DECL_KEY_F4) && HAVE_DECL_KEY_F4) - XLAT(KEY_F4), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F4) == (62), "KEY_F4 != 62"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F4 62 #endif #if defined(KEY_F5) || (defined(HAVE_DECL_KEY_F5) && HAVE_DECL_KEY_F5) - XLAT(KEY_F5), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F5) == (63), "KEY_F5 != 63"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F5 63 #endif #if defined(KEY_F6) || (defined(HAVE_DECL_KEY_F6) && HAVE_DECL_KEY_F6) - XLAT(KEY_F6), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F6) == (64), "KEY_F6 != 64"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F6 64 #endif #if defined(KEY_F7) || (defined(HAVE_DECL_KEY_F7) && HAVE_DECL_KEY_F7) - XLAT(KEY_F7), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F7) == (65), "KEY_F7 != 65"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F7 65 #endif #if defined(KEY_F8) || (defined(HAVE_DECL_KEY_F8) && HAVE_DECL_KEY_F8) - XLAT(KEY_F8), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F8) == (66), "KEY_F8 != 66"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F8 66 #endif #if defined(KEY_F9) || (defined(HAVE_DECL_KEY_F9) && HAVE_DECL_KEY_F9) - XLAT(KEY_F9), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F9) == (67), "KEY_F9 != 67"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F9 67 #endif #if defined(KEY_F10) || (defined(HAVE_DECL_KEY_F10) && HAVE_DECL_KEY_F10) - XLAT(KEY_F10), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F10) == (68), "KEY_F10 != 68"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F10 68 #endif #if defined(KEY_NUMLOCK) || (defined(HAVE_DECL_KEY_NUMLOCK) && HAVE_DECL_KEY_NUMLOCK) - XLAT(KEY_NUMLOCK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NUMLOCK) == (69), "KEY_NUMLOCK != 69"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NUMLOCK 69 #endif #if defined(KEY_SCROLLLOCK) || (defined(HAVE_DECL_KEY_SCROLLLOCK) && HAVE_DECL_KEY_SCROLLLOCK) - XLAT(KEY_SCROLLLOCK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SCROLLLOCK) == (70), "KEY_SCROLLLOCK != 70"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SCROLLLOCK 70 #endif #if defined(KEY_KP7) || (defined(HAVE_DECL_KEY_KP7) && HAVE_DECL_KEY_KP7) - XLAT(KEY_KP7), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KP7) == (71), "KEY_KP7 != 71"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KP7 71 #endif #if defined(KEY_KP8) || (defined(HAVE_DECL_KEY_KP8) && HAVE_DECL_KEY_KP8) - XLAT(KEY_KP8), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KP8) == (72), "KEY_KP8 != 72"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KP8 72 #endif #if defined(KEY_KP9) || (defined(HAVE_DECL_KEY_KP9) && HAVE_DECL_KEY_KP9) - XLAT(KEY_KP9), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KP9) == (73), "KEY_KP9 != 73"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KP9 73 #endif #if defined(KEY_KPMINUS) || (defined(HAVE_DECL_KEY_KPMINUS) && HAVE_DECL_KEY_KPMINUS) - XLAT(KEY_KPMINUS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KPMINUS) == (74), "KEY_KPMINUS != 74"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KPMINUS 74 #endif #if defined(KEY_KP4) || (defined(HAVE_DECL_KEY_KP4) && HAVE_DECL_KEY_KP4) - XLAT(KEY_KP4), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KP4) == (75), "KEY_KP4 != 75"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KP4 75 #endif #if defined(KEY_KP5) || (defined(HAVE_DECL_KEY_KP5) && HAVE_DECL_KEY_KP5) - XLAT(KEY_KP5), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KP5) == (76), "KEY_KP5 != 76"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KP5 76 #endif #if defined(KEY_KP6) || (defined(HAVE_DECL_KEY_KP6) && HAVE_DECL_KEY_KP6) - XLAT(KEY_KP6), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KP6) == (77), "KEY_KP6 != 77"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KP6 77 #endif #if defined(KEY_KPPLUS) || (defined(HAVE_DECL_KEY_KPPLUS) && HAVE_DECL_KEY_KPPLUS) - XLAT(KEY_KPPLUS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KPPLUS) == (78), "KEY_KPPLUS != 78"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KPPLUS 78 #endif #if defined(KEY_KP1) || (defined(HAVE_DECL_KEY_KP1) && HAVE_DECL_KEY_KP1) - XLAT(KEY_KP1), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KP1) == (79), "KEY_KP1 != 79"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KP1 79 #endif #if defined(KEY_KP2) || (defined(HAVE_DECL_KEY_KP2) && HAVE_DECL_KEY_KP2) - XLAT(KEY_KP2), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KP2) == (80), "KEY_KP2 != 80"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KP2 80 #endif #if defined(KEY_KP3) || (defined(HAVE_DECL_KEY_KP3) && HAVE_DECL_KEY_KP3) - XLAT(KEY_KP3), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KP3) == (81), "KEY_KP3 != 81"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KP3 81 #endif #if defined(KEY_KP0) || (defined(HAVE_DECL_KEY_KP0) && HAVE_DECL_KEY_KP0) - XLAT(KEY_KP0), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KP0) == (82), "KEY_KP0 != 82"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KP0 82 #endif #if defined(KEY_KPDOT) || (defined(HAVE_DECL_KEY_KPDOT) && HAVE_DECL_KEY_KPDOT) - XLAT(KEY_KPDOT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KPDOT) == (83), "KEY_KPDOT != 83"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KPDOT 83 #endif - #if defined(KEY_ZENKAKUHANKAKU) || (defined(HAVE_DECL_KEY_ZENKAKUHANKAKU) && HAVE_DECL_KEY_ZENKAKUHANKAKU) - XLAT(KEY_ZENKAKUHANKAKU), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_ZENKAKUHANKAKU) == (85), "KEY_ZENKAKUHANKAKU != 85"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_ZENKAKUHANKAKU 85 #endif #if defined(KEY_102ND) || (defined(HAVE_DECL_KEY_102ND) && HAVE_DECL_KEY_102ND) - XLAT(KEY_102ND), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_102ND) == (86), "KEY_102ND != 86"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_102ND 86 #endif #if defined(KEY_F11) || (defined(HAVE_DECL_KEY_F11) && HAVE_DECL_KEY_F11) - XLAT(KEY_F11), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F11) == (87), "KEY_F11 != 87"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F11 87 #endif #if defined(KEY_F12) || (defined(HAVE_DECL_KEY_F12) && HAVE_DECL_KEY_F12) - XLAT(KEY_F12), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F12) == (88), "KEY_F12 != 88"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F12 88 #endif #if defined(KEY_RO) || (defined(HAVE_DECL_KEY_RO) && HAVE_DECL_KEY_RO) - XLAT(KEY_RO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_RO) == (89), "KEY_RO != 89"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_RO 89 #endif #if defined(KEY_KATAKANA) || (defined(HAVE_DECL_KEY_KATAKANA) && HAVE_DECL_KEY_KATAKANA) - XLAT(KEY_KATAKANA), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KATAKANA) == (90), "KEY_KATAKANA != 90"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KATAKANA 90 #endif #if defined(KEY_HIRAGANA) || (defined(HAVE_DECL_KEY_HIRAGANA) && HAVE_DECL_KEY_HIRAGANA) - XLAT(KEY_HIRAGANA), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_HIRAGANA) == (91), "KEY_HIRAGANA != 91"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_HIRAGANA 91 #endif #if defined(KEY_HENKAN) || (defined(HAVE_DECL_KEY_HENKAN) && HAVE_DECL_KEY_HENKAN) - XLAT(KEY_HENKAN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_HENKAN) == (92), "KEY_HENKAN != 92"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_HENKAN 92 #endif #if defined(KEY_KATAKANAHIRAGANA) || (defined(HAVE_DECL_KEY_KATAKANAHIRAGANA) && HAVE_DECL_KEY_KATAKANAHIRAGANA) - XLAT(KEY_KATAKANAHIRAGANA), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KATAKANAHIRAGANA) == (93), "KEY_KATAKANAHIRAGANA != 93"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KATAKANAHIRAGANA 93 #endif #if defined(KEY_MUHENKAN) || (defined(HAVE_DECL_KEY_MUHENKAN) && HAVE_DECL_KEY_MUHENKAN) - XLAT(KEY_MUHENKAN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_MUHENKAN) == (94), "KEY_MUHENKAN != 94"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_MUHENKAN 94 #endif #if defined(KEY_KPJPCOMMA) || (defined(HAVE_DECL_KEY_KPJPCOMMA) && HAVE_DECL_KEY_KPJPCOMMA) - XLAT(KEY_KPJPCOMMA), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KPJPCOMMA) == (95), "KEY_KPJPCOMMA != 95"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KPJPCOMMA 95 #endif #if defined(KEY_KPENTER) || (defined(HAVE_DECL_KEY_KPENTER) && HAVE_DECL_KEY_KPENTER) - XLAT(KEY_KPENTER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KPENTER) == (96), "KEY_KPENTER != 96"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KPENTER 96 #endif #if defined(KEY_RIGHTCTRL) || (defined(HAVE_DECL_KEY_RIGHTCTRL) && HAVE_DECL_KEY_RIGHTCTRL) - XLAT(KEY_RIGHTCTRL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_RIGHTCTRL) == (97), "KEY_RIGHTCTRL != 97"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_RIGHTCTRL 97 #endif #if defined(KEY_KPSLASH) || (defined(HAVE_DECL_KEY_KPSLASH) && HAVE_DECL_KEY_KPSLASH) - XLAT(KEY_KPSLASH), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KPSLASH) == (98), "KEY_KPSLASH != 98"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KPSLASH 98 #endif #if defined(KEY_SYSRQ) || (defined(HAVE_DECL_KEY_SYSRQ) && HAVE_DECL_KEY_SYSRQ) - XLAT(KEY_SYSRQ), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SYSRQ) == (99), "KEY_SYSRQ != 99"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SYSRQ 99 #endif #if defined(KEY_RIGHTALT) || (defined(HAVE_DECL_KEY_RIGHTALT) && HAVE_DECL_KEY_RIGHTALT) - XLAT(KEY_RIGHTALT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_RIGHTALT) == (100), "KEY_RIGHTALT != 100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_RIGHTALT 100 #endif #if defined(KEY_LINEFEED) || (defined(HAVE_DECL_KEY_LINEFEED) && HAVE_DECL_KEY_LINEFEED) - XLAT(KEY_LINEFEED), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_LINEFEED) == (101), "KEY_LINEFEED != 101"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_LINEFEED 101 #endif #if defined(KEY_HOME) || (defined(HAVE_DECL_KEY_HOME) && HAVE_DECL_KEY_HOME) - XLAT(KEY_HOME), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_HOME) == (102), "KEY_HOME != 102"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_HOME 102 #endif #if defined(KEY_UP) || (defined(HAVE_DECL_KEY_UP) && HAVE_DECL_KEY_UP) - XLAT(KEY_UP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_UP) == (103), "KEY_UP != 103"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_UP 103 #endif #if defined(KEY_PAGEUP) || (defined(HAVE_DECL_KEY_PAGEUP) && HAVE_DECL_KEY_PAGEUP) - XLAT(KEY_PAGEUP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_PAGEUP) == (104), "KEY_PAGEUP != 104"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_PAGEUP 104 #endif #if defined(KEY_LEFT) || (defined(HAVE_DECL_KEY_LEFT) && HAVE_DECL_KEY_LEFT) - XLAT(KEY_LEFT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_LEFT) == (105), "KEY_LEFT != 105"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_LEFT 105 #endif #if defined(KEY_RIGHT) || (defined(HAVE_DECL_KEY_RIGHT) && HAVE_DECL_KEY_RIGHT) - XLAT(KEY_RIGHT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_RIGHT) == (106), "KEY_RIGHT != 106"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_RIGHT 106 #endif #if defined(KEY_END) || (defined(HAVE_DECL_KEY_END) && HAVE_DECL_KEY_END) - XLAT(KEY_END), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_END) == (107), "KEY_END != 107"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_END 107 #endif #if defined(KEY_DOWN) || (defined(HAVE_DECL_KEY_DOWN) && HAVE_DECL_KEY_DOWN) - XLAT(KEY_DOWN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_DOWN) == (108), "KEY_DOWN != 108"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_DOWN 108 #endif #if defined(KEY_PAGEDOWN) || (defined(HAVE_DECL_KEY_PAGEDOWN) && HAVE_DECL_KEY_PAGEDOWN) - XLAT(KEY_PAGEDOWN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_PAGEDOWN) == (109), "KEY_PAGEDOWN != 109"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_PAGEDOWN 109 #endif #if defined(KEY_INSERT) || (defined(HAVE_DECL_KEY_INSERT) && HAVE_DECL_KEY_INSERT) - XLAT(KEY_INSERT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_INSERT) == (110), "KEY_INSERT != 110"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_INSERT 110 #endif #if defined(KEY_DELETE) || (defined(HAVE_DECL_KEY_DELETE) && HAVE_DECL_KEY_DELETE) - XLAT(KEY_DELETE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_DELETE) == (111), "KEY_DELETE != 111"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_DELETE 111 #endif #if defined(KEY_MACRO) || (defined(HAVE_DECL_KEY_MACRO) && HAVE_DECL_KEY_MACRO) - XLAT(KEY_MACRO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_MACRO) == (112), "KEY_MACRO != 112"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_MACRO 112 #endif #if defined(KEY_MUTE) || (defined(HAVE_DECL_KEY_MUTE) && HAVE_DECL_KEY_MUTE) - XLAT(KEY_MUTE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_MUTE) == (113), "KEY_MUTE != 113"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_MUTE 113 #endif #if defined(KEY_VOLUMEDOWN) || (defined(HAVE_DECL_KEY_VOLUMEDOWN) && HAVE_DECL_KEY_VOLUMEDOWN) - XLAT(KEY_VOLUMEDOWN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_VOLUMEDOWN) == (114), "KEY_VOLUMEDOWN != 114"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_VOLUMEDOWN 114 #endif #if defined(KEY_VOLUMEUP) || (defined(HAVE_DECL_KEY_VOLUMEUP) && HAVE_DECL_KEY_VOLUMEUP) - XLAT(KEY_VOLUMEUP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_VOLUMEUP) == (115), "KEY_VOLUMEUP != 115"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_VOLUMEUP 115 #endif #if defined(KEY_POWER) || (defined(HAVE_DECL_KEY_POWER) && HAVE_DECL_KEY_POWER) - XLAT(KEY_POWER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_POWER) == (116), "KEY_POWER != 116"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_POWER 116 #endif #if defined(KEY_KPEQUAL) || (defined(HAVE_DECL_KEY_KPEQUAL) && HAVE_DECL_KEY_KPEQUAL) - XLAT(KEY_KPEQUAL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KPEQUAL) == (117), "KEY_KPEQUAL != 117"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KPEQUAL 117 #endif #if defined(KEY_KPPLUSMINUS) || (defined(HAVE_DECL_KEY_KPPLUSMINUS) && HAVE_DECL_KEY_KPPLUSMINUS) - XLAT(KEY_KPPLUSMINUS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KPPLUSMINUS) == (118), "KEY_KPPLUSMINUS != 118"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KPPLUSMINUS 118 #endif #if defined(KEY_PAUSE) || (defined(HAVE_DECL_KEY_PAUSE) && HAVE_DECL_KEY_PAUSE) - XLAT(KEY_PAUSE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_PAUSE) == (119), "KEY_PAUSE != 119"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_PAUSE 119 #endif #if defined(KEY_SCALE) || (defined(HAVE_DECL_KEY_SCALE) && HAVE_DECL_KEY_SCALE) - XLAT(KEY_SCALE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SCALE) == (120), "KEY_SCALE != 120"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SCALE 120 #endif - #if defined(KEY_KPCOMMA) || (defined(HAVE_DECL_KEY_KPCOMMA) && HAVE_DECL_KEY_KPCOMMA) - XLAT(KEY_KPCOMMA), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KPCOMMA) == (121), "KEY_KPCOMMA != 121"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KPCOMMA 121 #endif #if defined(KEY_HANGEUL) || (defined(HAVE_DECL_KEY_HANGEUL) && HAVE_DECL_KEY_HANGEUL) - XLAT(KEY_HANGEUL), -#endif -#if defined(KEY_HANGUEL) || (defined(HAVE_DECL_KEY_HANGUEL) && HAVE_DECL_KEY_HANGUEL) - XLAT(KEY_HANGUEL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_HANGEUL) == (122), "KEY_HANGEUL != 122"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_HANGEUL 122 #endif #if defined(KEY_HANJA) || (defined(HAVE_DECL_KEY_HANJA) && HAVE_DECL_KEY_HANJA) - XLAT(KEY_HANJA), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_HANJA) == (123), "KEY_HANJA != 123"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_HANJA 123 #endif #if defined(KEY_YEN) || (defined(HAVE_DECL_KEY_YEN) && HAVE_DECL_KEY_YEN) - XLAT(KEY_YEN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_YEN) == (124), "KEY_YEN != 124"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_YEN 124 #endif #if defined(KEY_LEFTMETA) || (defined(HAVE_DECL_KEY_LEFTMETA) && HAVE_DECL_KEY_LEFTMETA) - XLAT(KEY_LEFTMETA), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_LEFTMETA) == (125), "KEY_LEFTMETA != 125"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_LEFTMETA 125 #endif #if defined(KEY_RIGHTMETA) || (defined(HAVE_DECL_KEY_RIGHTMETA) && HAVE_DECL_KEY_RIGHTMETA) - XLAT(KEY_RIGHTMETA), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_RIGHTMETA) == (126), "KEY_RIGHTMETA != 126"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_RIGHTMETA 126 #endif #if defined(KEY_COMPOSE) || (defined(HAVE_DECL_KEY_COMPOSE) && HAVE_DECL_KEY_COMPOSE) - XLAT(KEY_COMPOSE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_COMPOSE) == (127), "KEY_COMPOSE != 127"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_COMPOSE 127 #endif - #if defined(KEY_STOP) || (defined(HAVE_DECL_KEY_STOP) && HAVE_DECL_KEY_STOP) - XLAT(KEY_STOP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_STOP) == (128), "KEY_STOP != 128"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_STOP 128 #endif #if defined(KEY_AGAIN) || (defined(HAVE_DECL_KEY_AGAIN) && HAVE_DECL_KEY_AGAIN) - XLAT(KEY_AGAIN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_AGAIN) == (129), "KEY_AGAIN != 129"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_AGAIN 129 #endif #if defined(KEY_PROPS) || (defined(HAVE_DECL_KEY_PROPS) && HAVE_DECL_KEY_PROPS) - XLAT(KEY_PROPS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_PROPS) == (130), "KEY_PROPS != 130"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_PROPS 130 #endif #if defined(KEY_UNDO) || (defined(HAVE_DECL_KEY_UNDO) && HAVE_DECL_KEY_UNDO) - XLAT(KEY_UNDO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_UNDO) == (131), "KEY_UNDO != 131"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_UNDO 131 #endif #if defined(KEY_FRONT) || (defined(HAVE_DECL_KEY_FRONT) && HAVE_DECL_KEY_FRONT) - XLAT(KEY_FRONT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FRONT) == (132), "KEY_FRONT != 132"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FRONT 132 #endif #if defined(KEY_COPY) || (defined(HAVE_DECL_KEY_COPY) && HAVE_DECL_KEY_COPY) - XLAT(KEY_COPY), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_COPY) == (133), "KEY_COPY != 133"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_COPY 133 #endif #if defined(KEY_OPEN) || (defined(HAVE_DECL_KEY_OPEN) && HAVE_DECL_KEY_OPEN) - XLAT(KEY_OPEN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_OPEN) == (134), "KEY_OPEN != 134"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_OPEN 134 #endif #if defined(KEY_PASTE) || (defined(HAVE_DECL_KEY_PASTE) && HAVE_DECL_KEY_PASTE) - XLAT(KEY_PASTE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_PASTE) == (135), "KEY_PASTE != 135"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_PASTE 135 #endif #if defined(KEY_FIND) || (defined(HAVE_DECL_KEY_FIND) && HAVE_DECL_KEY_FIND) - XLAT(KEY_FIND), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FIND) == (136), "KEY_FIND != 136"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FIND 136 #endif #if defined(KEY_CUT) || (defined(HAVE_DECL_KEY_CUT) && HAVE_DECL_KEY_CUT) - XLAT(KEY_CUT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CUT) == (137), "KEY_CUT != 137"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CUT 137 #endif #if defined(KEY_HELP) || (defined(HAVE_DECL_KEY_HELP) && HAVE_DECL_KEY_HELP) - XLAT(KEY_HELP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_HELP) == (138), "KEY_HELP != 138"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_HELP 138 #endif #if defined(KEY_MENU) || (defined(HAVE_DECL_KEY_MENU) && HAVE_DECL_KEY_MENU) - XLAT(KEY_MENU), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_MENU) == (139), "KEY_MENU != 139"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_MENU 139 #endif #if defined(KEY_CALC) || (defined(HAVE_DECL_KEY_CALC) && HAVE_DECL_KEY_CALC) - XLAT(KEY_CALC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CALC) == (140), "KEY_CALC != 140"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CALC 140 #endif #if defined(KEY_SETUP) || (defined(HAVE_DECL_KEY_SETUP) && HAVE_DECL_KEY_SETUP) - XLAT(KEY_SETUP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SETUP) == (141), "KEY_SETUP != 141"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SETUP 141 #endif #if defined(KEY_SLEEP) || (defined(HAVE_DECL_KEY_SLEEP) && HAVE_DECL_KEY_SLEEP) - XLAT(KEY_SLEEP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SLEEP) == (142), "KEY_SLEEP != 142"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SLEEP 142 #endif #if defined(KEY_WAKEUP) || (defined(HAVE_DECL_KEY_WAKEUP) && HAVE_DECL_KEY_WAKEUP) - XLAT(KEY_WAKEUP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_WAKEUP) == (143), "KEY_WAKEUP != 143"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_WAKEUP 143 #endif #if defined(KEY_FILE) || (defined(HAVE_DECL_KEY_FILE) && HAVE_DECL_KEY_FILE) - XLAT(KEY_FILE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FILE) == (144), "KEY_FILE != 144"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FILE 144 #endif #if defined(KEY_SENDFILE) || (defined(HAVE_DECL_KEY_SENDFILE) && HAVE_DECL_KEY_SENDFILE) - XLAT(KEY_SENDFILE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SENDFILE) == (145), "KEY_SENDFILE != 145"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SENDFILE 145 #endif #if defined(KEY_DELETEFILE) || (defined(HAVE_DECL_KEY_DELETEFILE) && HAVE_DECL_KEY_DELETEFILE) - XLAT(KEY_DELETEFILE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_DELETEFILE) == (146), "KEY_DELETEFILE != 146"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_DELETEFILE 146 #endif #if defined(KEY_XFER) || (defined(HAVE_DECL_KEY_XFER) && HAVE_DECL_KEY_XFER) - XLAT(KEY_XFER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_XFER) == (147), "KEY_XFER != 147"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_XFER 147 #endif #if defined(KEY_PROG1) || (defined(HAVE_DECL_KEY_PROG1) && HAVE_DECL_KEY_PROG1) - XLAT(KEY_PROG1), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_PROG1) == (148), "KEY_PROG1 != 148"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_PROG1 148 #endif #if defined(KEY_PROG2) || (defined(HAVE_DECL_KEY_PROG2) && HAVE_DECL_KEY_PROG2) - XLAT(KEY_PROG2), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_PROG2) == (149), "KEY_PROG2 != 149"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_PROG2 149 #endif #if defined(KEY_WWW) || (defined(HAVE_DECL_KEY_WWW) && HAVE_DECL_KEY_WWW) - XLAT(KEY_WWW), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_WWW) == (150), "KEY_WWW != 150"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_WWW 150 #endif #if defined(KEY_MSDOS) || (defined(HAVE_DECL_KEY_MSDOS) && HAVE_DECL_KEY_MSDOS) - XLAT(KEY_MSDOS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_MSDOS) == (151), "KEY_MSDOS != 151"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_MSDOS 151 #endif #if defined(KEY_COFFEE) || (defined(HAVE_DECL_KEY_COFFEE) && HAVE_DECL_KEY_COFFEE) - XLAT(KEY_COFFEE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_COFFEE) == (152), "KEY_COFFEE != 152"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_COFFEE 152 #endif #if defined(KEY_ROTATE_DISPLAY) || (defined(HAVE_DECL_KEY_ROTATE_DISPLAY) && HAVE_DECL_KEY_ROTATE_DISPLAY) - XLAT(KEY_ROTATE_DISPLAY), -#endif -#if defined(KEY_DIRECTION) || (defined(HAVE_DECL_KEY_DIRECTION) && HAVE_DECL_KEY_DIRECTION) - XLAT(KEY_DIRECTION), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_ROTATE_DISPLAY) == (153), "KEY_ROTATE_DISPLAY != 153"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_ROTATE_DISPLAY 153 #endif #if defined(KEY_CYCLEWINDOWS) || (defined(HAVE_DECL_KEY_CYCLEWINDOWS) && HAVE_DECL_KEY_CYCLEWINDOWS) - XLAT(KEY_CYCLEWINDOWS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CYCLEWINDOWS) == (154), "KEY_CYCLEWINDOWS != 154"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CYCLEWINDOWS 154 #endif #if defined(KEY_MAIL) || (defined(HAVE_DECL_KEY_MAIL) && HAVE_DECL_KEY_MAIL) - XLAT(KEY_MAIL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_MAIL) == (155), "KEY_MAIL != 155"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_MAIL 155 #endif #if defined(KEY_BOOKMARKS) || (defined(HAVE_DECL_KEY_BOOKMARKS) && HAVE_DECL_KEY_BOOKMARKS) - XLAT(KEY_BOOKMARKS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BOOKMARKS) == (156), "KEY_BOOKMARKS != 156"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BOOKMARKS 156 #endif #if defined(KEY_COMPUTER) || (defined(HAVE_DECL_KEY_COMPUTER) && HAVE_DECL_KEY_COMPUTER) - XLAT(KEY_COMPUTER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_COMPUTER) == (157), "KEY_COMPUTER != 157"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_COMPUTER 157 #endif #if defined(KEY_BACK) || (defined(HAVE_DECL_KEY_BACK) && HAVE_DECL_KEY_BACK) - XLAT(KEY_BACK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BACK) == (158), "KEY_BACK != 158"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BACK 158 #endif #if defined(KEY_FORWARD) || (defined(HAVE_DECL_KEY_FORWARD) && HAVE_DECL_KEY_FORWARD) - XLAT(KEY_FORWARD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FORWARD) == (159), "KEY_FORWARD != 159"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FORWARD 159 #endif #if defined(KEY_CLOSECD) || (defined(HAVE_DECL_KEY_CLOSECD) && HAVE_DECL_KEY_CLOSECD) - XLAT(KEY_CLOSECD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CLOSECD) == (160), "KEY_CLOSECD != 160"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CLOSECD 160 #endif #if defined(KEY_EJECTCD) || (defined(HAVE_DECL_KEY_EJECTCD) && HAVE_DECL_KEY_EJECTCD) - XLAT(KEY_EJECTCD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_EJECTCD) == (161), "KEY_EJECTCD != 161"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_EJECTCD 161 #endif #if defined(KEY_EJECTCLOSECD) || (defined(HAVE_DECL_KEY_EJECTCLOSECD) && HAVE_DECL_KEY_EJECTCLOSECD) - XLAT(KEY_EJECTCLOSECD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_EJECTCLOSECD) == (162), "KEY_EJECTCLOSECD != 162"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_EJECTCLOSECD 162 #endif #if defined(KEY_NEXTSONG) || (defined(HAVE_DECL_KEY_NEXTSONG) && HAVE_DECL_KEY_NEXTSONG) - XLAT(KEY_NEXTSONG), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NEXTSONG) == (163), "KEY_NEXTSONG != 163"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NEXTSONG 163 #endif #if defined(KEY_PLAYPAUSE) || (defined(HAVE_DECL_KEY_PLAYPAUSE) && HAVE_DECL_KEY_PLAYPAUSE) - XLAT(KEY_PLAYPAUSE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_PLAYPAUSE) == (164), "KEY_PLAYPAUSE != 164"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_PLAYPAUSE 164 #endif #if defined(KEY_PREVIOUSSONG) || (defined(HAVE_DECL_KEY_PREVIOUSSONG) && HAVE_DECL_KEY_PREVIOUSSONG) - XLAT(KEY_PREVIOUSSONG), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_PREVIOUSSONG) == (165), "KEY_PREVIOUSSONG != 165"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_PREVIOUSSONG 165 #endif #if defined(KEY_STOPCD) || (defined(HAVE_DECL_KEY_STOPCD) && HAVE_DECL_KEY_STOPCD) - XLAT(KEY_STOPCD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_STOPCD) == (166), "KEY_STOPCD != 166"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_STOPCD 166 #endif #if defined(KEY_RECORD) || (defined(HAVE_DECL_KEY_RECORD) && HAVE_DECL_KEY_RECORD) - XLAT(KEY_RECORD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_RECORD) == (167), "KEY_RECORD != 167"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_RECORD 167 #endif #if defined(KEY_REWIND) || (defined(HAVE_DECL_KEY_REWIND) && HAVE_DECL_KEY_REWIND) - XLAT(KEY_REWIND), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_REWIND) == (168), "KEY_REWIND != 168"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_REWIND 168 #endif #if defined(KEY_PHONE) || (defined(HAVE_DECL_KEY_PHONE) && HAVE_DECL_KEY_PHONE) - XLAT(KEY_PHONE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_PHONE) == (169), "KEY_PHONE != 169"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_PHONE 169 #endif #if defined(KEY_ISO) || (defined(HAVE_DECL_KEY_ISO) && HAVE_DECL_KEY_ISO) - XLAT(KEY_ISO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_ISO) == (170), "KEY_ISO != 170"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_ISO 170 #endif #if defined(KEY_CONFIG) || (defined(HAVE_DECL_KEY_CONFIG) && HAVE_DECL_KEY_CONFIG) - XLAT(KEY_CONFIG), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CONFIG) == (171), "KEY_CONFIG != 171"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CONFIG 171 #endif #if defined(KEY_HOMEPAGE) || (defined(HAVE_DECL_KEY_HOMEPAGE) && HAVE_DECL_KEY_HOMEPAGE) - XLAT(KEY_HOMEPAGE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_HOMEPAGE) == (172), "KEY_HOMEPAGE != 172"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_HOMEPAGE 172 #endif #if defined(KEY_REFRESH) || (defined(HAVE_DECL_KEY_REFRESH) && HAVE_DECL_KEY_REFRESH) - XLAT(KEY_REFRESH), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_REFRESH) == (173), "KEY_REFRESH != 173"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_REFRESH 173 #endif #if defined(KEY_EXIT) || (defined(HAVE_DECL_KEY_EXIT) && HAVE_DECL_KEY_EXIT) - XLAT(KEY_EXIT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_EXIT) == (174), "KEY_EXIT != 174"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_EXIT 174 #endif #if defined(KEY_MOVE) || (defined(HAVE_DECL_KEY_MOVE) && HAVE_DECL_KEY_MOVE) - XLAT(KEY_MOVE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_MOVE) == (175), "KEY_MOVE != 175"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_MOVE 175 #endif #if defined(KEY_EDIT) || (defined(HAVE_DECL_KEY_EDIT) && HAVE_DECL_KEY_EDIT) - XLAT(KEY_EDIT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_EDIT) == (176), "KEY_EDIT != 176"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_EDIT 176 #endif #if defined(KEY_SCROLLUP) || (defined(HAVE_DECL_KEY_SCROLLUP) && HAVE_DECL_KEY_SCROLLUP) - XLAT(KEY_SCROLLUP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SCROLLUP) == (177), "KEY_SCROLLUP != 177"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SCROLLUP 177 #endif #if defined(KEY_SCROLLDOWN) || (defined(HAVE_DECL_KEY_SCROLLDOWN) && HAVE_DECL_KEY_SCROLLDOWN) - XLAT(KEY_SCROLLDOWN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SCROLLDOWN) == (178), "KEY_SCROLLDOWN != 178"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SCROLLDOWN 178 #endif #if defined(KEY_KPLEFTPAREN) || (defined(HAVE_DECL_KEY_KPLEFTPAREN) && HAVE_DECL_KEY_KPLEFTPAREN) - XLAT(KEY_KPLEFTPAREN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KPLEFTPAREN) == (179), "KEY_KPLEFTPAREN != 179"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KPLEFTPAREN 179 #endif #if defined(KEY_KPRIGHTPAREN) || (defined(HAVE_DECL_KEY_KPRIGHTPAREN) && HAVE_DECL_KEY_KPRIGHTPAREN) - XLAT(KEY_KPRIGHTPAREN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KPRIGHTPAREN) == (180), "KEY_KPRIGHTPAREN != 180"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KPRIGHTPAREN 180 #endif #if defined(KEY_NEW) || (defined(HAVE_DECL_KEY_NEW) && HAVE_DECL_KEY_NEW) - XLAT(KEY_NEW), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NEW) == (181), "KEY_NEW != 181"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NEW 181 #endif #if defined(KEY_REDO) || (defined(HAVE_DECL_KEY_REDO) && HAVE_DECL_KEY_REDO) - XLAT(KEY_REDO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_REDO) == (182), "KEY_REDO != 182"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_REDO 182 #endif - #if defined(KEY_F13) || (defined(HAVE_DECL_KEY_F13) && HAVE_DECL_KEY_F13) - XLAT(KEY_F13), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F13) == (183), "KEY_F13 != 183"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F13 183 #endif #if defined(KEY_F14) || (defined(HAVE_DECL_KEY_F14) && HAVE_DECL_KEY_F14) - XLAT(KEY_F14), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F14) == (184), "KEY_F14 != 184"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F14 184 #endif #if defined(KEY_F15) || (defined(HAVE_DECL_KEY_F15) && HAVE_DECL_KEY_F15) - XLAT(KEY_F15), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F15) == (185), "KEY_F15 != 185"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F15 185 #endif #if defined(KEY_F16) || (defined(HAVE_DECL_KEY_F16) && HAVE_DECL_KEY_F16) - XLAT(KEY_F16), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F16) == (186), "KEY_F16 != 186"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F16 186 #endif #if defined(KEY_F17) || (defined(HAVE_DECL_KEY_F17) && HAVE_DECL_KEY_F17) - XLAT(KEY_F17), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F17) == (187), "KEY_F17 != 187"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F17 187 #endif #if defined(KEY_F18) || (defined(HAVE_DECL_KEY_F18) && HAVE_DECL_KEY_F18) - XLAT(KEY_F18), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F18) == (188), "KEY_F18 != 188"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F18 188 #endif #if defined(KEY_F19) || (defined(HAVE_DECL_KEY_F19) && HAVE_DECL_KEY_F19) - XLAT(KEY_F19), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F19) == (189), "KEY_F19 != 189"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F19 189 #endif #if defined(KEY_F20) || (defined(HAVE_DECL_KEY_F20) && HAVE_DECL_KEY_F20) - XLAT(KEY_F20), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F20) == (190), "KEY_F20 != 190"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F20 190 #endif #if defined(KEY_F21) || (defined(HAVE_DECL_KEY_F21) && HAVE_DECL_KEY_F21) - XLAT(KEY_F21), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F21) == (191), "KEY_F21 != 191"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F21 191 #endif #if defined(KEY_F22) || (defined(HAVE_DECL_KEY_F22) && HAVE_DECL_KEY_F22) - XLAT(KEY_F22), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F22) == (192), "KEY_F22 != 192"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F22 192 #endif #if defined(KEY_F23) || (defined(HAVE_DECL_KEY_F23) && HAVE_DECL_KEY_F23) - XLAT(KEY_F23), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F23) == (193), "KEY_F23 != 193"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F23 193 #endif #if defined(KEY_F24) || (defined(HAVE_DECL_KEY_F24) && HAVE_DECL_KEY_F24) - XLAT(KEY_F24), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_F24) == (194), "KEY_F24 != 194"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_F24 194 #endif - #if defined(KEY_PLAYCD) || (defined(HAVE_DECL_KEY_PLAYCD) && HAVE_DECL_KEY_PLAYCD) - XLAT(KEY_PLAYCD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_PLAYCD) == (200), "KEY_PLAYCD != 200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_PLAYCD 200 #endif #if defined(KEY_PAUSECD) || (defined(HAVE_DECL_KEY_PAUSECD) && HAVE_DECL_KEY_PAUSECD) - XLAT(KEY_PAUSECD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_PAUSECD) == (201), "KEY_PAUSECD != 201"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_PAUSECD 201 #endif #if defined(KEY_PROG3) || (defined(HAVE_DECL_KEY_PROG3) && HAVE_DECL_KEY_PROG3) - XLAT(KEY_PROG3), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_PROG3) == (202), "KEY_PROG3 != 202"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_PROG3 202 #endif #if defined(KEY_PROG4) || (defined(HAVE_DECL_KEY_PROG4) && HAVE_DECL_KEY_PROG4) - XLAT(KEY_PROG4), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_PROG4) == (203), "KEY_PROG4 != 203"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_PROG4 203 #endif #if defined(KEY_DASHBOARD) || (defined(HAVE_DECL_KEY_DASHBOARD) && HAVE_DECL_KEY_DASHBOARD) - XLAT(KEY_DASHBOARD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_DASHBOARD) == (204), "KEY_DASHBOARD != 204"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_DASHBOARD 204 #endif #if defined(KEY_SUSPEND) || (defined(HAVE_DECL_KEY_SUSPEND) && HAVE_DECL_KEY_SUSPEND) - XLAT(KEY_SUSPEND), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SUSPEND) == (205), "KEY_SUSPEND != 205"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SUSPEND 205 #endif #if defined(KEY_CLOSE) || (defined(HAVE_DECL_KEY_CLOSE) && HAVE_DECL_KEY_CLOSE) - XLAT(KEY_CLOSE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CLOSE) == (206), "KEY_CLOSE != 206"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CLOSE 206 #endif #if defined(KEY_PLAY) || (defined(HAVE_DECL_KEY_PLAY) && HAVE_DECL_KEY_PLAY) - XLAT(KEY_PLAY), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_PLAY) == (207), "KEY_PLAY != 207"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_PLAY 207 #endif #if defined(KEY_FASTFORWARD) || (defined(HAVE_DECL_KEY_FASTFORWARD) && HAVE_DECL_KEY_FASTFORWARD) - XLAT(KEY_FASTFORWARD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FASTFORWARD) == (208), "KEY_FASTFORWARD != 208"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FASTFORWARD 208 #endif #if defined(KEY_BASSBOOST) || (defined(HAVE_DECL_KEY_BASSBOOST) && HAVE_DECL_KEY_BASSBOOST) - XLAT(KEY_BASSBOOST), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BASSBOOST) == (209), "KEY_BASSBOOST != 209"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BASSBOOST 209 #endif #if defined(KEY_PRINT) || (defined(HAVE_DECL_KEY_PRINT) && HAVE_DECL_KEY_PRINT) - XLAT(KEY_PRINT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_PRINT) == (210), "KEY_PRINT != 210"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_PRINT 210 #endif #if defined(KEY_HP) || (defined(HAVE_DECL_KEY_HP) && HAVE_DECL_KEY_HP) - XLAT(KEY_HP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_HP) == (211), "KEY_HP != 211"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_HP 211 #endif #if defined(KEY_CAMERA) || (defined(HAVE_DECL_KEY_CAMERA) && HAVE_DECL_KEY_CAMERA) - XLAT(KEY_CAMERA), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CAMERA) == (212), "KEY_CAMERA != 212"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CAMERA 212 #endif #if defined(KEY_SOUND) || (defined(HAVE_DECL_KEY_SOUND) && HAVE_DECL_KEY_SOUND) - XLAT(KEY_SOUND), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SOUND) == (213), "KEY_SOUND != 213"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SOUND 213 #endif #if defined(KEY_QUESTION) || (defined(HAVE_DECL_KEY_QUESTION) && HAVE_DECL_KEY_QUESTION) - XLAT(KEY_QUESTION), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_QUESTION) == (214), "KEY_QUESTION != 214"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_QUESTION 214 #endif #if defined(KEY_EMAIL) || (defined(HAVE_DECL_KEY_EMAIL) && HAVE_DECL_KEY_EMAIL) - XLAT(KEY_EMAIL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_EMAIL) == (215), "KEY_EMAIL != 215"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_EMAIL 215 #endif #if defined(KEY_CHAT) || (defined(HAVE_DECL_KEY_CHAT) && HAVE_DECL_KEY_CHAT) - XLAT(KEY_CHAT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CHAT) == (216), "KEY_CHAT != 216"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CHAT 216 #endif #if defined(KEY_SEARCH) || (defined(HAVE_DECL_KEY_SEARCH) && HAVE_DECL_KEY_SEARCH) - XLAT(KEY_SEARCH), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SEARCH) == (217), "KEY_SEARCH != 217"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SEARCH 217 #endif #if defined(KEY_CONNECT) || (defined(HAVE_DECL_KEY_CONNECT) && HAVE_DECL_KEY_CONNECT) - XLAT(KEY_CONNECT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CONNECT) == (218), "KEY_CONNECT != 218"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CONNECT 218 #endif #if defined(KEY_FINANCE) || (defined(HAVE_DECL_KEY_FINANCE) && HAVE_DECL_KEY_FINANCE) - XLAT(KEY_FINANCE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FINANCE) == (219), "KEY_FINANCE != 219"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FINANCE 219 #endif #if defined(KEY_SPORT) || (defined(HAVE_DECL_KEY_SPORT) && HAVE_DECL_KEY_SPORT) - XLAT(KEY_SPORT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SPORT) == (220), "KEY_SPORT != 220"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SPORT 220 #endif #if defined(KEY_SHOP) || (defined(HAVE_DECL_KEY_SHOP) && HAVE_DECL_KEY_SHOP) - XLAT(KEY_SHOP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SHOP) == (221), "KEY_SHOP != 221"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SHOP 221 #endif #if defined(KEY_ALTERASE) || (defined(HAVE_DECL_KEY_ALTERASE) && HAVE_DECL_KEY_ALTERASE) - XLAT(KEY_ALTERASE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_ALTERASE) == (222), "KEY_ALTERASE != 222"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_ALTERASE 222 #endif #if defined(KEY_CANCEL) || (defined(HAVE_DECL_KEY_CANCEL) && HAVE_DECL_KEY_CANCEL) - XLAT(KEY_CANCEL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CANCEL) == (223), "KEY_CANCEL != 223"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CANCEL 223 #endif #if defined(KEY_BRIGHTNESSDOWN) || (defined(HAVE_DECL_KEY_BRIGHTNESSDOWN) && HAVE_DECL_KEY_BRIGHTNESSDOWN) - XLAT(KEY_BRIGHTNESSDOWN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BRIGHTNESSDOWN) == (224), "KEY_BRIGHTNESSDOWN != 224"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BRIGHTNESSDOWN 224 #endif #if defined(KEY_BRIGHTNESSUP) || (defined(HAVE_DECL_KEY_BRIGHTNESSUP) && HAVE_DECL_KEY_BRIGHTNESSUP) - XLAT(KEY_BRIGHTNESSUP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BRIGHTNESSUP) == (225), "KEY_BRIGHTNESSUP != 225"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BRIGHTNESSUP 225 #endif #if defined(KEY_MEDIA) || (defined(HAVE_DECL_KEY_MEDIA) && HAVE_DECL_KEY_MEDIA) - XLAT(KEY_MEDIA), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_MEDIA) == (226), "KEY_MEDIA != 226"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_MEDIA 226 #endif - #if defined(KEY_SWITCHVIDEOMODE) || (defined(HAVE_DECL_KEY_SWITCHVIDEOMODE) && HAVE_DECL_KEY_SWITCHVIDEOMODE) - XLAT(KEY_SWITCHVIDEOMODE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SWITCHVIDEOMODE) == (227), "KEY_SWITCHVIDEOMODE != 227"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SWITCHVIDEOMODE 227 #endif - #if defined(KEY_KBDILLUMTOGGLE) || (defined(HAVE_DECL_KEY_KBDILLUMTOGGLE) && HAVE_DECL_KEY_KBDILLUMTOGGLE) - XLAT(KEY_KBDILLUMTOGGLE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KBDILLUMTOGGLE) == (228), "KEY_KBDILLUMTOGGLE != 228"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KBDILLUMTOGGLE 228 #endif #if defined(KEY_KBDILLUMDOWN) || (defined(HAVE_DECL_KEY_KBDILLUMDOWN) && HAVE_DECL_KEY_KBDILLUMDOWN) - XLAT(KEY_KBDILLUMDOWN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KBDILLUMDOWN) == (229), "KEY_KBDILLUMDOWN != 229"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KBDILLUMDOWN 229 #endif #if defined(KEY_KBDILLUMUP) || (defined(HAVE_DECL_KEY_KBDILLUMUP) && HAVE_DECL_KEY_KBDILLUMUP) - XLAT(KEY_KBDILLUMUP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KBDILLUMUP) == (230), "KEY_KBDILLUMUP != 230"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KBDILLUMUP 230 #endif - #if defined(KEY_SEND) || (defined(HAVE_DECL_KEY_SEND) && HAVE_DECL_KEY_SEND) - XLAT(KEY_SEND), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SEND) == (231), "KEY_SEND != 231"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SEND 231 #endif #if defined(KEY_REPLY) || (defined(HAVE_DECL_KEY_REPLY) && HAVE_DECL_KEY_REPLY) - XLAT(KEY_REPLY), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_REPLY) == (232), "KEY_REPLY != 232"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_REPLY 232 #endif #if defined(KEY_FORWARDMAIL) || (defined(HAVE_DECL_KEY_FORWARDMAIL) && HAVE_DECL_KEY_FORWARDMAIL) - XLAT(KEY_FORWARDMAIL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FORWARDMAIL) == (233), "KEY_FORWARDMAIL != 233"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FORWARDMAIL 233 #endif #if defined(KEY_SAVE) || (defined(HAVE_DECL_KEY_SAVE) && HAVE_DECL_KEY_SAVE) - XLAT(KEY_SAVE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SAVE) == (234), "KEY_SAVE != 234"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SAVE 234 #endif #if defined(KEY_DOCUMENTS) || (defined(HAVE_DECL_KEY_DOCUMENTS) && HAVE_DECL_KEY_DOCUMENTS) - XLAT(KEY_DOCUMENTS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_DOCUMENTS) == (235), "KEY_DOCUMENTS != 235"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_DOCUMENTS 235 #endif - #if defined(KEY_BATTERY) || (defined(HAVE_DECL_KEY_BATTERY) && HAVE_DECL_KEY_BATTERY) - XLAT(KEY_BATTERY), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BATTERY) == (236), "KEY_BATTERY != 236"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BATTERY 236 #endif - #if defined(KEY_BLUETOOTH) || (defined(HAVE_DECL_KEY_BLUETOOTH) && HAVE_DECL_KEY_BLUETOOTH) - XLAT(KEY_BLUETOOTH), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BLUETOOTH) == (237), "KEY_BLUETOOTH != 237"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BLUETOOTH 237 #endif #if defined(KEY_WLAN) || (defined(HAVE_DECL_KEY_WLAN) && HAVE_DECL_KEY_WLAN) - XLAT(KEY_WLAN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_WLAN) == (238), "KEY_WLAN != 238"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_WLAN 238 #endif #if defined(KEY_UWB) || (defined(HAVE_DECL_KEY_UWB) && HAVE_DECL_KEY_UWB) - XLAT(KEY_UWB), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_UWB) == (239), "KEY_UWB != 239"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_UWB 239 #endif - #if defined(KEY_UNKNOWN) || (defined(HAVE_DECL_KEY_UNKNOWN) && HAVE_DECL_KEY_UNKNOWN) - XLAT(KEY_UNKNOWN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_UNKNOWN) == (240), "KEY_UNKNOWN != 240"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_UNKNOWN 240 #endif - #if defined(KEY_VIDEO_NEXT) || (defined(HAVE_DECL_KEY_VIDEO_NEXT) && HAVE_DECL_KEY_VIDEO_NEXT) - XLAT(KEY_VIDEO_NEXT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_VIDEO_NEXT) == (241), "KEY_VIDEO_NEXT != 241"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_VIDEO_NEXT 241 #endif #if defined(KEY_VIDEO_PREV) || (defined(HAVE_DECL_KEY_VIDEO_PREV) && HAVE_DECL_KEY_VIDEO_PREV) - XLAT(KEY_VIDEO_PREV), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_VIDEO_PREV) == (242), "KEY_VIDEO_PREV != 242"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_VIDEO_PREV 242 #endif #if defined(KEY_BRIGHTNESS_CYCLE) || (defined(HAVE_DECL_KEY_BRIGHTNESS_CYCLE) && HAVE_DECL_KEY_BRIGHTNESS_CYCLE) - XLAT(KEY_BRIGHTNESS_CYCLE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BRIGHTNESS_CYCLE) == (243), "KEY_BRIGHTNESS_CYCLE != 243"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BRIGHTNESS_CYCLE 243 #endif #if defined(KEY_BRIGHTNESS_AUTO) || (defined(HAVE_DECL_KEY_BRIGHTNESS_AUTO) && HAVE_DECL_KEY_BRIGHTNESS_AUTO) - XLAT(KEY_BRIGHTNESS_AUTO), -#endif -#if defined(KEY_BRIGHTNESS_ZERO) || (defined(HAVE_DECL_KEY_BRIGHTNESS_ZERO) && HAVE_DECL_KEY_BRIGHTNESS_ZERO) - XLAT(KEY_BRIGHTNESS_ZERO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BRIGHTNESS_AUTO) == (244), "KEY_BRIGHTNESS_AUTO != 244"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BRIGHTNESS_AUTO 244 #endif #if defined(KEY_DISPLAY_OFF) || (defined(HAVE_DECL_KEY_DISPLAY_OFF) && HAVE_DECL_KEY_DISPLAY_OFF) - XLAT(KEY_DISPLAY_OFF), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_DISPLAY_OFF) == (245), "KEY_DISPLAY_OFF != 245"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_DISPLAY_OFF 245 #endif - #if defined(KEY_WWAN) || (defined(HAVE_DECL_KEY_WWAN) && HAVE_DECL_KEY_WWAN) - XLAT(KEY_WWAN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_WWAN) == (246), "KEY_WWAN != 246"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_WWAN 246 #endif -#if defined(KEY_WIMAX) || (defined(HAVE_DECL_KEY_WIMAX) && HAVE_DECL_KEY_WIMAX) - XLAT(KEY_WIMAX), +#ifndef STRACE_WORKAROUND_FOR_KEY_RFKILL +# define STRACE_WORKAROUND_FOR_KEY_RFKILL +# undef KEY_RFKILL #endif #if defined(KEY_RFKILL) || (defined(HAVE_DECL_KEY_RFKILL) && HAVE_DECL_KEY_RFKILL) - XLAT(KEY_RFKILL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_RFKILL) == (247), "KEY_RFKILL != 247"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_RFKILL 247 #endif - #if defined(KEY_MICMUTE) || (defined(HAVE_DECL_KEY_MICMUTE) && HAVE_DECL_KEY_MICMUTE) - XLAT(KEY_MICMUTE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_MICMUTE) == (248), "KEY_MICMUTE != 248"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_MICMUTE 248 #endif - #if defined(BTN_0) || (defined(HAVE_DECL_BTN_0) && HAVE_DECL_BTN_0) - XLAT(BTN_0), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_0) == (0x100), "BTN_0 != 0x100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_0 0x100 #endif #if defined(BTN_1) || (defined(HAVE_DECL_BTN_1) && HAVE_DECL_BTN_1) - XLAT(BTN_1), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_1) == (0x101), "BTN_1 != 0x101"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_1 0x101 #endif #if defined(BTN_2) || (defined(HAVE_DECL_BTN_2) && HAVE_DECL_BTN_2) - XLAT(BTN_2), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_2) == (0x102), "BTN_2 != 0x102"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_2 0x102 #endif #if defined(BTN_3) || (defined(HAVE_DECL_BTN_3) && HAVE_DECL_BTN_3) - XLAT(BTN_3), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_3) == (0x103), "BTN_3 != 0x103"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_3 0x103 #endif #if defined(BTN_4) || (defined(HAVE_DECL_BTN_4) && HAVE_DECL_BTN_4) - XLAT(BTN_4), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_4) == (0x104), "BTN_4 != 0x104"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_4 0x104 #endif #if defined(BTN_5) || (defined(HAVE_DECL_BTN_5) && HAVE_DECL_BTN_5) - XLAT(BTN_5), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_5) == (0x105), "BTN_5 != 0x105"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_5 0x105 #endif #if defined(BTN_6) || (defined(HAVE_DECL_BTN_6) && HAVE_DECL_BTN_6) - XLAT(BTN_6), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_6) == (0x106), "BTN_6 != 0x106"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_6 0x106 #endif #if defined(BTN_7) || (defined(HAVE_DECL_BTN_7) && HAVE_DECL_BTN_7) - XLAT(BTN_7), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_7) == (0x107), "BTN_7 != 0x107"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_7 0x107 #endif #if defined(BTN_8) || (defined(HAVE_DECL_BTN_8) && HAVE_DECL_BTN_8) - XLAT(BTN_8), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_8) == (0x108), "BTN_8 != 0x108"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_8 0x108 #endif #if defined(BTN_9) || (defined(HAVE_DECL_BTN_9) && HAVE_DECL_BTN_9) - XLAT(BTN_9), -#endif - -#if defined(BTN_MOUSE) || (defined(HAVE_DECL_BTN_MOUSE) && HAVE_DECL_BTN_MOUSE) - XLAT(BTN_MOUSE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_9) == (0x109), "BTN_9 != 0x109"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_9 0x109 #endif #if defined(BTN_LEFT) || (defined(HAVE_DECL_BTN_LEFT) && HAVE_DECL_BTN_LEFT) - XLAT(BTN_LEFT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_LEFT) == (0x110), "BTN_LEFT != 0x110"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_LEFT 0x110 #endif #if defined(BTN_RIGHT) || (defined(HAVE_DECL_BTN_RIGHT) && HAVE_DECL_BTN_RIGHT) - XLAT(BTN_RIGHT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_RIGHT) == (0x111), "BTN_RIGHT != 0x111"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_RIGHT 0x111 #endif #if defined(BTN_MIDDLE) || (defined(HAVE_DECL_BTN_MIDDLE) && HAVE_DECL_BTN_MIDDLE) - XLAT(BTN_MIDDLE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_MIDDLE) == (0x112), "BTN_MIDDLE != 0x112"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_MIDDLE 0x112 #endif #if defined(BTN_SIDE) || (defined(HAVE_DECL_BTN_SIDE) && HAVE_DECL_BTN_SIDE) - XLAT(BTN_SIDE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_SIDE) == (0x113), "BTN_SIDE != 0x113"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_SIDE 0x113 #endif #if defined(BTN_EXTRA) || (defined(HAVE_DECL_BTN_EXTRA) && HAVE_DECL_BTN_EXTRA) - XLAT(BTN_EXTRA), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_EXTRA) == (0x114), "BTN_EXTRA != 0x114"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_EXTRA 0x114 #endif #if defined(BTN_FORWARD) || (defined(HAVE_DECL_BTN_FORWARD) && HAVE_DECL_BTN_FORWARD) - XLAT(BTN_FORWARD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_FORWARD) == (0x115), "BTN_FORWARD != 0x115"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_FORWARD 0x115 #endif #if defined(BTN_BACK) || (defined(HAVE_DECL_BTN_BACK) && HAVE_DECL_BTN_BACK) - XLAT(BTN_BACK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_BACK) == (0x116), "BTN_BACK != 0x116"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_BACK 0x116 #endif #if defined(BTN_TASK) || (defined(HAVE_DECL_BTN_TASK) && HAVE_DECL_BTN_TASK) - XLAT(BTN_TASK), -#endif - -#if defined(BTN_JOYSTICK) || (defined(HAVE_DECL_BTN_JOYSTICK) && HAVE_DECL_BTN_JOYSTICK) - XLAT(BTN_JOYSTICK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TASK) == (0x117), "BTN_TASK != 0x117"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TASK 0x117 #endif #if defined(BTN_TRIGGER) || (defined(HAVE_DECL_BTN_TRIGGER) && HAVE_DECL_BTN_TRIGGER) - XLAT(BTN_TRIGGER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER) == (0x120), "BTN_TRIGGER != 0x120"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER 0x120 #endif #if defined(BTN_THUMB) || (defined(HAVE_DECL_BTN_THUMB) && HAVE_DECL_BTN_THUMB) - XLAT(BTN_THUMB), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_THUMB) == (0x121), "BTN_THUMB != 0x121"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_THUMB 0x121 #endif #if defined(BTN_THUMB2) || (defined(HAVE_DECL_BTN_THUMB2) && HAVE_DECL_BTN_THUMB2) - XLAT(BTN_THUMB2), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_THUMB2) == (0x122), "BTN_THUMB2 != 0x122"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_THUMB2 0x122 #endif #if defined(BTN_TOP) || (defined(HAVE_DECL_BTN_TOP) && HAVE_DECL_BTN_TOP) - XLAT(BTN_TOP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TOP) == (0x123), "BTN_TOP != 0x123"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TOP 0x123 #endif #if defined(BTN_TOP2) || (defined(HAVE_DECL_BTN_TOP2) && HAVE_DECL_BTN_TOP2) - XLAT(BTN_TOP2), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TOP2) == (0x124), "BTN_TOP2 != 0x124"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TOP2 0x124 #endif #if defined(BTN_PINKIE) || (defined(HAVE_DECL_BTN_PINKIE) && HAVE_DECL_BTN_PINKIE) - XLAT(BTN_PINKIE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_PINKIE) == (0x125), "BTN_PINKIE != 0x125"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_PINKIE 0x125 #endif #if defined(BTN_BASE) || (defined(HAVE_DECL_BTN_BASE) && HAVE_DECL_BTN_BASE) - XLAT(BTN_BASE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_BASE) == (0x126), "BTN_BASE != 0x126"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_BASE 0x126 #endif #if defined(BTN_BASE2) || (defined(HAVE_DECL_BTN_BASE2) && HAVE_DECL_BTN_BASE2) - XLAT(BTN_BASE2), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_BASE2) == (0x127), "BTN_BASE2 != 0x127"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_BASE2 0x127 #endif #if defined(BTN_BASE3) || (defined(HAVE_DECL_BTN_BASE3) && HAVE_DECL_BTN_BASE3) - XLAT(BTN_BASE3), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_BASE3) == (0x128), "BTN_BASE3 != 0x128"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_BASE3 0x128 #endif #if defined(BTN_BASE4) || (defined(HAVE_DECL_BTN_BASE4) && HAVE_DECL_BTN_BASE4) - XLAT(BTN_BASE4), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_BASE4) == (0x129), "BTN_BASE4 != 0x129"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_BASE4 0x129 #endif #if defined(BTN_BASE5) || (defined(HAVE_DECL_BTN_BASE5) && HAVE_DECL_BTN_BASE5) - XLAT(BTN_BASE5), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_BASE5) == (0x12a), "BTN_BASE5 != 0x12a"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_BASE5 0x12a #endif #if defined(BTN_BASE6) || (defined(HAVE_DECL_BTN_BASE6) && HAVE_DECL_BTN_BASE6) - XLAT(BTN_BASE6), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_BASE6) == (0x12b), "BTN_BASE6 != 0x12b"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_BASE6 0x12b #endif #if defined(BTN_DEAD) || (defined(HAVE_DECL_BTN_DEAD) && HAVE_DECL_BTN_DEAD) - XLAT(BTN_DEAD), -#endif - -#if defined(BTN_GAMEPAD) || (defined(HAVE_DECL_BTN_GAMEPAD) && HAVE_DECL_BTN_GAMEPAD) - XLAT(BTN_GAMEPAD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_DEAD) == (0x12f), "BTN_DEAD != 0x12f"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_DEAD 0x12f #endif #if defined(BTN_SOUTH) || (defined(HAVE_DECL_BTN_SOUTH) && HAVE_DECL_BTN_SOUTH) - XLAT(BTN_SOUTH), -#endif -#if defined(BTN_A) || (defined(HAVE_DECL_BTN_A) && HAVE_DECL_BTN_A) - XLAT(BTN_A), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_SOUTH) == (0x130), "BTN_SOUTH != 0x130"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_SOUTH 0x130 #endif #if defined(BTN_EAST) || (defined(HAVE_DECL_BTN_EAST) && HAVE_DECL_BTN_EAST) - XLAT(BTN_EAST), -#endif -#if defined(BTN_B) || (defined(HAVE_DECL_BTN_B) && HAVE_DECL_BTN_B) - XLAT(BTN_B), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_EAST) == (0x131), "BTN_EAST != 0x131"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_EAST 0x131 #endif #if defined(BTN_C) || (defined(HAVE_DECL_BTN_C) && HAVE_DECL_BTN_C) - XLAT(BTN_C), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_C) == (0x132), "BTN_C != 0x132"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_C 0x132 #endif #if defined(BTN_NORTH) || (defined(HAVE_DECL_BTN_NORTH) && HAVE_DECL_BTN_NORTH) - XLAT(BTN_NORTH), -#endif -#if defined(BTN_X) || (defined(HAVE_DECL_BTN_X) && HAVE_DECL_BTN_X) - XLAT(BTN_X), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_NORTH) == (0x133), "BTN_NORTH != 0x133"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_NORTH 0x133 #endif #if defined(BTN_WEST) || (defined(HAVE_DECL_BTN_WEST) && HAVE_DECL_BTN_WEST) - XLAT(BTN_WEST), -#endif -#if defined(BTN_Y) || (defined(HAVE_DECL_BTN_Y) && HAVE_DECL_BTN_Y) - XLAT(BTN_Y), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_WEST) == (0x134), "BTN_WEST != 0x134"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_WEST 0x134 #endif #if defined(BTN_Z) || (defined(HAVE_DECL_BTN_Z) && HAVE_DECL_BTN_Z) - XLAT(BTN_Z), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_Z) == (0x135), "BTN_Z != 0x135"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_Z 0x135 #endif #if defined(BTN_TL) || (defined(HAVE_DECL_BTN_TL) && HAVE_DECL_BTN_TL) - XLAT(BTN_TL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TL) == (0x136), "BTN_TL != 0x136"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TL 0x136 #endif #if defined(BTN_TR) || (defined(HAVE_DECL_BTN_TR) && HAVE_DECL_BTN_TR) - XLAT(BTN_TR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TR) == (0x137), "BTN_TR != 0x137"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TR 0x137 #endif #if defined(BTN_TL2) || (defined(HAVE_DECL_BTN_TL2) && HAVE_DECL_BTN_TL2) - XLAT(BTN_TL2), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TL2) == (0x138), "BTN_TL2 != 0x138"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TL2 0x138 #endif #if defined(BTN_TR2) || (defined(HAVE_DECL_BTN_TR2) && HAVE_DECL_BTN_TR2) - XLAT(BTN_TR2), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TR2) == (0x139), "BTN_TR2 != 0x139"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TR2 0x139 #endif #if defined(BTN_SELECT) || (defined(HAVE_DECL_BTN_SELECT) && HAVE_DECL_BTN_SELECT) - XLAT(BTN_SELECT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_SELECT) == (0x13a), "BTN_SELECT != 0x13a"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_SELECT 0x13a #endif #if defined(BTN_START) || (defined(HAVE_DECL_BTN_START) && HAVE_DECL_BTN_START) - XLAT(BTN_START), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_START) == (0x13b), "BTN_START != 0x13b"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_START 0x13b #endif #if defined(BTN_MODE) || (defined(HAVE_DECL_BTN_MODE) && HAVE_DECL_BTN_MODE) - XLAT(BTN_MODE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_MODE) == (0x13c), "BTN_MODE != 0x13c"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_MODE 0x13c #endif #if defined(BTN_THUMBL) || (defined(HAVE_DECL_BTN_THUMBL) && HAVE_DECL_BTN_THUMBL) - XLAT(BTN_THUMBL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_THUMBL) == (0x13d), "BTN_THUMBL != 0x13d"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_THUMBL 0x13d #endif #if defined(BTN_THUMBR) || (defined(HAVE_DECL_BTN_THUMBR) && HAVE_DECL_BTN_THUMBR) - XLAT(BTN_THUMBR), -#endif - -#if defined(BTN_DIGI) || (defined(HAVE_DECL_BTN_DIGI) && HAVE_DECL_BTN_DIGI) - XLAT(BTN_DIGI), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_THUMBR) == (0x13e), "BTN_THUMBR != 0x13e"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_THUMBR 0x13e #endif #if defined(BTN_TOOL_PEN) || (defined(HAVE_DECL_BTN_TOOL_PEN) && HAVE_DECL_BTN_TOOL_PEN) - XLAT(BTN_TOOL_PEN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TOOL_PEN) == (0x140), "BTN_TOOL_PEN != 0x140"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TOOL_PEN 0x140 #endif #if defined(BTN_TOOL_RUBBER) || (defined(HAVE_DECL_BTN_TOOL_RUBBER) && HAVE_DECL_BTN_TOOL_RUBBER) - XLAT(BTN_TOOL_RUBBER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TOOL_RUBBER) == (0x141), "BTN_TOOL_RUBBER != 0x141"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TOOL_RUBBER 0x141 #endif #if defined(BTN_TOOL_BRUSH) || (defined(HAVE_DECL_BTN_TOOL_BRUSH) && HAVE_DECL_BTN_TOOL_BRUSH) - XLAT(BTN_TOOL_BRUSH), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TOOL_BRUSH) == (0x142), "BTN_TOOL_BRUSH != 0x142"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TOOL_BRUSH 0x142 #endif #if defined(BTN_TOOL_PENCIL) || (defined(HAVE_DECL_BTN_TOOL_PENCIL) && HAVE_DECL_BTN_TOOL_PENCIL) - XLAT(BTN_TOOL_PENCIL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TOOL_PENCIL) == (0x143), "BTN_TOOL_PENCIL != 0x143"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TOOL_PENCIL 0x143 #endif #if defined(BTN_TOOL_AIRBRUSH) || (defined(HAVE_DECL_BTN_TOOL_AIRBRUSH) && HAVE_DECL_BTN_TOOL_AIRBRUSH) - XLAT(BTN_TOOL_AIRBRUSH), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TOOL_AIRBRUSH) == (0x144), "BTN_TOOL_AIRBRUSH != 0x144"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TOOL_AIRBRUSH 0x144 #endif #if defined(BTN_TOOL_FINGER) || (defined(HAVE_DECL_BTN_TOOL_FINGER) && HAVE_DECL_BTN_TOOL_FINGER) - XLAT(BTN_TOOL_FINGER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TOOL_FINGER) == (0x145), "BTN_TOOL_FINGER != 0x145"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TOOL_FINGER 0x145 #endif #if defined(BTN_TOOL_MOUSE) || (defined(HAVE_DECL_BTN_TOOL_MOUSE) && HAVE_DECL_BTN_TOOL_MOUSE) - XLAT(BTN_TOOL_MOUSE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TOOL_MOUSE) == (0x146), "BTN_TOOL_MOUSE != 0x146"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TOOL_MOUSE 0x146 #endif #if defined(BTN_TOOL_LENS) || (defined(HAVE_DECL_BTN_TOOL_LENS) && HAVE_DECL_BTN_TOOL_LENS) - XLAT(BTN_TOOL_LENS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TOOL_LENS) == (0x147), "BTN_TOOL_LENS != 0x147"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TOOL_LENS 0x147 #endif #if defined(BTN_TOOL_QUINTTAP) || (defined(HAVE_DECL_BTN_TOOL_QUINTTAP) && HAVE_DECL_BTN_TOOL_QUINTTAP) - XLAT(BTN_TOOL_QUINTTAP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TOOL_QUINTTAP) == (0x148), "BTN_TOOL_QUINTTAP != 0x148"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TOOL_QUINTTAP 0x148 +#endif +#if defined(BTN_STYLUS3) || (defined(HAVE_DECL_BTN_STYLUS3) && HAVE_DECL_BTN_STYLUS3) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_STYLUS3) == (0x149), "BTN_STYLUS3 != 0x149"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_STYLUS3 0x149 #endif #if defined(BTN_TOUCH) || (defined(HAVE_DECL_BTN_TOUCH) && HAVE_DECL_BTN_TOUCH) - XLAT(BTN_TOUCH), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TOUCH) == (0x14a), "BTN_TOUCH != 0x14a"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TOUCH 0x14a #endif #if defined(BTN_STYLUS) || (defined(HAVE_DECL_BTN_STYLUS) && HAVE_DECL_BTN_STYLUS) - XLAT(BTN_STYLUS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_STYLUS) == (0x14b), "BTN_STYLUS != 0x14b"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_STYLUS 0x14b #endif #if defined(BTN_STYLUS2) || (defined(HAVE_DECL_BTN_STYLUS2) && HAVE_DECL_BTN_STYLUS2) - XLAT(BTN_STYLUS2), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_STYLUS2) == (0x14c), "BTN_STYLUS2 != 0x14c"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_STYLUS2 0x14c #endif #if defined(BTN_TOOL_DOUBLETAP) || (defined(HAVE_DECL_BTN_TOOL_DOUBLETAP) && HAVE_DECL_BTN_TOOL_DOUBLETAP) - XLAT(BTN_TOOL_DOUBLETAP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TOOL_DOUBLETAP) == (0x14d), "BTN_TOOL_DOUBLETAP != 0x14d"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TOOL_DOUBLETAP 0x14d #endif #if defined(BTN_TOOL_TRIPLETAP) || (defined(HAVE_DECL_BTN_TOOL_TRIPLETAP) && HAVE_DECL_BTN_TOOL_TRIPLETAP) - XLAT(BTN_TOOL_TRIPLETAP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TOOL_TRIPLETAP) == (0x14e), "BTN_TOOL_TRIPLETAP != 0x14e"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TOOL_TRIPLETAP 0x14e #endif #if defined(BTN_TOOL_QUADTAP) || (defined(HAVE_DECL_BTN_TOOL_QUADTAP) && HAVE_DECL_BTN_TOOL_QUADTAP) - XLAT(BTN_TOOL_QUADTAP), -#endif - -#if defined(BTN_WHEEL) || (defined(HAVE_DECL_BTN_WHEEL) && HAVE_DECL_BTN_WHEEL) - XLAT(BTN_WHEEL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TOOL_QUADTAP) == (0x14f), "BTN_TOOL_QUADTAP != 0x14f"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TOOL_QUADTAP 0x14f #endif #if defined(BTN_GEAR_DOWN) || (defined(HAVE_DECL_BTN_GEAR_DOWN) && HAVE_DECL_BTN_GEAR_DOWN) - XLAT(BTN_GEAR_DOWN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_GEAR_DOWN) == (0x150), "BTN_GEAR_DOWN != 0x150"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_GEAR_DOWN 0x150 #endif #if defined(BTN_GEAR_UP) || (defined(HAVE_DECL_BTN_GEAR_UP) && HAVE_DECL_BTN_GEAR_UP) - XLAT(BTN_GEAR_UP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_GEAR_UP) == (0x151), "BTN_GEAR_UP != 0x151"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_GEAR_UP 0x151 #endif - #if defined(KEY_OK) || (defined(HAVE_DECL_KEY_OK) && HAVE_DECL_KEY_OK) - XLAT(KEY_OK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_OK) == (0x160), "KEY_OK != 0x160"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_OK 0x160 #endif #if defined(KEY_SELECT) || (defined(HAVE_DECL_KEY_SELECT) && HAVE_DECL_KEY_SELECT) - XLAT(KEY_SELECT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SELECT) == (0x161), "KEY_SELECT != 0x161"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SELECT 0x161 #endif #if defined(KEY_GOTO) || (defined(HAVE_DECL_KEY_GOTO) && HAVE_DECL_KEY_GOTO) - XLAT(KEY_GOTO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_GOTO) == (0x162), "KEY_GOTO != 0x162"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_GOTO 0x162 #endif #if defined(KEY_CLEAR) || (defined(HAVE_DECL_KEY_CLEAR) && HAVE_DECL_KEY_CLEAR) - XLAT(KEY_CLEAR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CLEAR) == (0x163), "KEY_CLEAR != 0x163"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CLEAR 0x163 #endif #if defined(KEY_POWER2) || (defined(HAVE_DECL_KEY_POWER2) && HAVE_DECL_KEY_POWER2) - XLAT(KEY_POWER2), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_POWER2) == (0x164), "KEY_POWER2 != 0x164"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_POWER2 0x164 #endif #if defined(KEY_OPTION) || (defined(HAVE_DECL_KEY_OPTION) && HAVE_DECL_KEY_OPTION) - XLAT(KEY_OPTION), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_OPTION) == (0x165), "KEY_OPTION != 0x165"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_OPTION 0x165 #endif #if defined(KEY_INFO) || (defined(HAVE_DECL_KEY_INFO) && HAVE_DECL_KEY_INFO) - XLAT(KEY_INFO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_INFO) == (0x166), "KEY_INFO != 0x166"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_INFO 0x166 #endif #if defined(KEY_TIME) || (defined(HAVE_DECL_KEY_TIME) && HAVE_DECL_KEY_TIME) - XLAT(KEY_TIME), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_TIME) == (0x167), "KEY_TIME != 0x167"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_TIME 0x167 #endif #if defined(KEY_VENDOR) || (defined(HAVE_DECL_KEY_VENDOR) && HAVE_DECL_KEY_VENDOR) - XLAT(KEY_VENDOR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_VENDOR) == (0x168), "KEY_VENDOR != 0x168"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_VENDOR 0x168 #endif #if defined(KEY_ARCHIVE) || (defined(HAVE_DECL_KEY_ARCHIVE) && HAVE_DECL_KEY_ARCHIVE) - XLAT(KEY_ARCHIVE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_ARCHIVE) == (0x169), "KEY_ARCHIVE != 0x169"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_ARCHIVE 0x169 #endif #if defined(KEY_PROGRAM) || (defined(HAVE_DECL_KEY_PROGRAM) && HAVE_DECL_KEY_PROGRAM) - XLAT(KEY_PROGRAM), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_PROGRAM) == (0x16a), "KEY_PROGRAM != 0x16a"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_PROGRAM 0x16a #endif #if defined(KEY_CHANNEL) || (defined(HAVE_DECL_KEY_CHANNEL) && HAVE_DECL_KEY_CHANNEL) - XLAT(KEY_CHANNEL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CHANNEL) == (0x16b), "KEY_CHANNEL != 0x16b"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CHANNEL 0x16b #endif #if defined(KEY_FAVORITES) || (defined(HAVE_DECL_KEY_FAVORITES) && HAVE_DECL_KEY_FAVORITES) - XLAT(KEY_FAVORITES), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FAVORITES) == (0x16c), "KEY_FAVORITES != 0x16c"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FAVORITES 0x16c #endif #if defined(KEY_EPG) || (defined(HAVE_DECL_KEY_EPG) && HAVE_DECL_KEY_EPG) - XLAT(KEY_EPG), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_EPG) == (0x16d), "KEY_EPG != 0x16d"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_EPG 0x16d #endif #if defined(KEY_PVR) || (defined(HAVE_DECL_KEY_PVR) && HAVE_DECL_KEY_PVR) - XLAT(KEY_PVR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_PVR) == (0x16e), "KEY_PVR != 0x16e"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_PVR 0x16e #endif #if defined(KEY_MHP) || (defined(HAVE_DECL_KEY_MHP) && HAVE_DECL_KEY_MHP) - XLAT(KEY_MHP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_MHP) == (0x16f), "KEY_MHP != 0x16f"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_MHP 0x16f #endif #if defined(KEY_LANGUAGE) || (defined(HAVE_DECL_KEY_LANGUAGE) && HAVE_DECL_KEY_LANGUAGE) - XLAT(KEY_LANGUAGE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_LANGUAGE) == (0x170), "KEY_LANGUAGE != 0x170"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_LANGUAGE 0x170 #endif #if defined(KEY_TITLE) || (defined(HAVE_DECL_KEY_TITLE) && HAVE_DECL_KEY_TITLE) - XLAT(KEY_TITLE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_TITLE) == (0x171), "KEY_TITLE != 0x171"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_TITLE 0x171 #endif #if defined(KEY_SUBTITLE) || (defined(HAVE_DECL_KEY_SUBTITLE) && HAVE_DECL_KEY_SUBTITLE) - XLAT(KEY_SUBTITLE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SUBTITLE) == (0x172), "KEY_SUBTITLE != 0x172"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SUBTITLE 0x172 #endif #if defined(KEY_ANGLE) || (defined(HAVE_DECL_KEY_ANGLE) && HAVE_DECL_KEY_ANGLE) - XLAT(KEY_ANGLE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_ANGLE) == (0x173), "KEY_ANGLE != 0x173"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_ANGLE 0x173 #endif #if defined(KEY_ZOOM) || (defined(HAVE_DECL_KEY_ZOOM) && HAVE_DECL_KEY_ZOOM) - XLAT(KEY_ZOOM), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_ZOOM) == (0x174), "KEY_ZOOM != 0x174"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_ZOOM 0x174 #endif #if defined(KEY_MODE) || (defined(HAVE_DECL_KEY_MODE) && HAVE_DECL_KEY_MODE) - XLAT(KEY_MODE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_MODE) == (0x175), "KEY_MODE != 0x175"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_MODE 0x175 #endif #if defined(KEY_KEYBOARD) || (defined(HAVE_DECL_KEY_KEYBOARD) && HAVE_DECL_KEY_KEYBOARD) - XLAT(KEY_KEYBOARD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KEYBOARD) == (0x176), "KEY_KEYBOARD != 0x176"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KEYBOARD 0x176 #endif #if defined(KEY_SCREEN) || (defined(HAVE_DECL_KEY_SCREEN) && HAVE_DECL_KEY_SCREEN) - XLAT(KEY_SCREEN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SCREEN) == (0x177), "KEY_SCREEN != 0x177"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SCREEN 0x177 #endif #if defined(KEY_PC) || (defined(HAVE_DECL_KEY_PC) && HAVE_DECL_KEY_PC) - XLAT(KEY_PC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_PC) == (0x178), "KEY_PC != 0x178"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_PC 0x178 #endif #if defined(KEY_TV) || (defined(HAVE_DECL_KEY_TV) && HAVE_DECL_KEY_TV) - XLAT(KEY_TV), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_TV) == (0x179), "KEY_TV != 0x179"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_TV 0x179 #endif #if defined(KEY_TV2) || (defined(HAVE_DECL_KEY_TV2) && HAVE_DECL_KEY_TV2) - XLAT(KEY_TV2), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_TV2) == (0x17a), "KEY_TV2 != 0x17a"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_TV2 0x17a #endif #if defined(KEY_VCR) || (defined(HAVE_DECL_KEY_VCR) && HAVE_DECL_KEY_VCR) - XLAT(KEY_VCR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_VCR) == (0x17b), "KEY_VCR != 0x17b"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_VCR 0x17b #endif #if defined(KEY_VCR2) || (defined(HAVE_DECL_KEY_VCR2) && HAVE_DECL_KEY_VCR2) - XLAT(KEY_VCR2), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_VCR2) == (0x17c), "KEY_VCR2 != 0x17c"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_VCR2 0x17c #endif #if defined(KEY_SAT) || (defined(HAVE_DECL_KEY_SAT) && HAVE_DECL_KEY_SAT) - XLAT(KEY_SAT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SAT) == (0x17d), "KEY_SAT != 0x17d"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SAT 0x17d #endif #if defined(KEY_SAT2) || (defined(HAVE_DECL_KEY_SAT2) && HAVE_DECL_KEY_SAT2) - XLAT(KEY_SAT2), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SAT2) == (0x17e), "KEY_SAT2 != 0x17e"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SAT2 0x17e #endif #if defined(KEY_CD) || (defined(HAVE_DECL_KEY_CD) && HAVE_DECL_KEY_CD) - XLAT(KEY_CD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CD) == (0x17f), "KEY_CD != 0x17f"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CD 0x17f #endif #if defined(KEY_TAPE) || (defined(HAVE_DECL_KEY_TAPE) && HAVE_DECL_KEY_TAPE) - XLAT(KEY_TAPE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_TAPE) == (0x180), "KEY_TAPE != 0x180"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_TAPE 0x180 #endif #if defined(KEY_RADIO) || (defined(HAVE_DECL_KEY_RADIO) && HAVE_DECL_KEY_RADIO) - XLAT(KEY_RADIO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_RADIO) == (0x181), "KEY_RADIO != 0x181"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_RADIO 0x181 #endif #if defined(KEY_TUNER) || (defined(HAVE_DECL_KEY_TUNER) && HAVE_DECL_KEY_TUNER) - XLAT(KEY_TUNER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_TUNER) == (0x182), "KEY_TUNER != 0x182"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_TUNER 0x182 #endif #if defined(KEY_PLAYER) || (defined(HAVE_DECL_KEY_PLAYER) && HAVE_DECL_KEY_PLAYER) - XLAT(KEY_PLAYER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_PLAYER) == (0x183), "KEY_PLAYER != 0x183"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_PLAYER 0x183 #endif #if defined(KEY_TEXT) || (defined(HAVE_DECL_KEY_TEXT) && HAVE_DECL_KEY_TEXT) - XLAT(KEY_TEXT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_TEXT) == (0x184), "KEY_TEXT != 0x184"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_TEXT 0x184 #endif #if defined(KEY_DVD) || (defined(HAVE_DECL_KEY_DVD) && HAVE_DECL_KEY_DVD) - XLAT(KEY_DVD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_DVD) == (0x185), "KEY_DVD != 0x185"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_DVD 0x185 #endif #if defined(KEY_AUX) || (defined(HAVE_DECL_KEY_AUX) && HAVE_DECL_KEY_AUX) - XLAT(KEY_AUX), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_AUX) == (0x186), "KEY_AUX != 0x186"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_AUX 0x186 #endif #if defined(KEY_MP3) || (defined(HAVE_DECL_KEY_MP3) && HAVE_DECL_KEY_MP3) - XLAT(KEY_MP3), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_MP3) == (0x187), "KEY_MP3 != 0x187"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_MP3 0x187 #endif #if defined(KEY_AUDIO) || (defined(HAVE_DECL_KEY_AUDIO) && HAVE_DECL_KEY_AUDIO) - XLAT(KEY_AUDIO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_AUDIO) == (0x188), "KEY_AUDIO != 0x188"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_AUDIO 0x188 #endif #if defined(KEY_VIDEO) || (defined(HAVE_DECL_KEY_VIDEO) && HAVE_DECL_KEY_VIDEO) - XLAT(KEY_VIDEO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_VIDEO) == (0x189), "KEY_VIDEO != 0x189"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_VIDEO 0x189 #endif #if defined(KEY_DIRECTORY) || (defined(HAVE_DECL_KEY_DIRECTORY) && HAVE_DECL_KEY_DIRECTORY) - XLAT(KEY_DIRECTORY), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_DIRECTORY) == (0x18a), "KEY_DIRECTORY != 0x18a"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_DIRECTORY 0x18a #endif #if defined(KEY_LIST) || (defined(HAVE_DECL_KEY_LIST) && HAVE_DECL_KEY_LIST) - XLAT(KEY_LIST), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_LIST) == (0x18b), "KEY_LIST != 0x18b"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_LIST 0x18b #endif #if defined(KEY_MEMO) || (defined(HAVE_DECL_KEY_MEMO) && HAVE_DECL_KEY_MEMO) - XLAT(KEY_MEMO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_MEMO) == (0x18c), "KEY_MEMO != 0x18c"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_MEMO 0x18c #endif #if defined(KEY_CALENDAR) || (defined(HAVE_DECL_KEY_CALENDAR) && HAVE_DECL_KEY_CALENDAR) - XLAT(KEY_CALENDAR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CALENDAR) == (0x18d), "KEY_CALENDAR != 0x18d"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CALENDAR 0x18d #endif #if defined(KEY_RED) || (defined(HAVE_DECL_KEY_RED) && HAVE_DECL_KEY_RED) - XLAT(KEY_RED), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_RED) == (0x18e), "KEY_RED != 0x18e"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_RED 0x18e #endif #if defined(KEY_GREEN) || (defined(HAVE_DECL_KEY_GREEN) && HAVE_DECL_KEY_GREEN) - XLAT(KEY_GREEN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_GREEN) == (0x18f), "KEY_GREEN != 0x18f"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_GREEN 0x18f #endif #if defined(KEY_YELLOW) || (defined(HAVE_DECL_KEY_YELLOW) && HAVE_DECL_KEY_YELLOW) - XLAT(KEY_YELLOW), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_YELLOW) == (0x190), "KEY_YELLOW != 0x190"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_YELLOW 0x190 #endif #if defined(KEY_BLUE) || (defined(HAVE_DECL_KEY_BLUE) && HAVE_DECL_KEY_BLUE) - XLAT(KEY_BLUE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BLUE) == (0x191), "KEY_BLUE != 0x191"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BLUE 0x191 #endif #if defined(KEY_CHANNELUP) || (defined(HAVE_DECL_KEY_CHANNELUP) && HAVE_DECL_KEY_CHANNELUP) - XLAT(KEY_CHANNELUP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CHANNELUP) == (0x192), "KEY_CHANNELUP != 0x192"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CHANNELUP 0x192 #endif #if defined(KEY_CHANNELDOWN) || (defined(HAVE_DECL_KEY_CHANNELDOWN) && HAVE_DECL_KEY_CHANNELDOWN) - XLAT(KEY_CHANNELDOWN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CHANNELDOWN) == (0x193), "KEY_CHANNELDOWN != 0x193"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CHANNELDOWN 0x193 #endif #if defined(KEY_FIRST) || (defined(HAVE_DECL_KEY_FIRST) && HAVE_DECL_KEY_FIRST) - XLAT(KEY_FIRST), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FIRST) == (0x194), "KEY_FIRST != 0x194"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FIRST 0x194 #endif #if defined(KEY_LAST) || (defined(HAVE_DECL_KEY_LAST) && HAVE_DECL_KEY_LAST) - XLAT(KEY_LAST), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_LAST) == (0x195), "KEY_LAST != 0x195"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_LAST 0x195 #endif #if defined(KEY_AB) || (defined(HAVE_DECL_KEY_AB) && HAVE_DECL_KEY_AB) - XLAT(KEY_AB), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_AB) == (0x196), "KEY_AB != 0x196"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_AB 0x196 #endif #if defined(KEY_NEXT) || (defined(HAVE_DECL_KEY_NEXT) && HAVE_DECL_KEY_NEXT) - XLAT(KEY_NEXT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NEXT) == (0x197), "KEY_NEXT != 0x197"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NEXT 0x197 #endif #if defined(KEY_RESTART) || (defined(HAVE_DECL_KEY_RESTART) && HAVE_DECL_KEY_RESTART) - XLAT(KEY_RESTART), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_RESTART) == (0x198), "KEY_RESTART != 0x198"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_RESTART 0x198 #endif #if defined(KEY_SLOW) || (defined(HAVE_DECL_KEY_SLOW) && HAVE_DECL_KEY_SLOW) - XLAT(KEY_SLOW), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SLOW) == (0x199), "KEY_SLOW != 0x199"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SLOW 0x199 #endif #if defined(KEY_SHUFFLE) || (defined(HAVE_DECL_KEY_SHUFFLE) && HAVE_DECL_KEY_SHUFFLE) - XLAT(KEY_SHUFFLE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SHUFFLE) == (0x19a), "KEY_SHUFFLE != 0x19a"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SHUFFLE 0x19a #endif #if defined(KEY_BREAK) || (defined(HAVE_DECL_KEY_BREAK) && HAVE_DECL_KEY_BREAK) - XLAT(KEY_BREAK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BREAK) == (0x19b), "KEY_BREAK != 0x19b"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BREAK 0x19b #endif #if defined(KEY_PREVIOUS) || (defined(HAVE_DECL_KEY_PREVIOUS) && HAVE_DECL_KEY_PREVIOUS) - XLAT(KEY_PREVIOUS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_PREVIOUS) == (0x19c), "KEY_PREVIOUS != 0x19c"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_PREVIOUS 0x19c #endif #if defined(KEY_DIGITS) || (defined(HAVE_DECL_KEY_DIGITS) && HAVE_DECL_KEY_DIGITS) - XLAT(KEY_DIGITS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_DIGITS) == (0x19d), "KEY_DIGITS != 0x19d"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_DIGITS 0x19d #endif #if defined(KEY_TEEN) || (defined(HAVE_DECL_KEY_TEEN) && HAVE_DECL_KEY_TEEN) - XLAT(KEY_TEEN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_TEEN) == (0x19e), "KEY_TEEN != 0x19e"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_TEEN 0x19e #endif #if defined(KEY_TWEN) || (defined(HAVE_DECL_KEY_TWEN) && HAVE_DECL_KEY_TWEN) - XLAT(KEY_TWEN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_TWEN) == (0x19f), "KEY_TWEN != 0x19f"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_TWEN 0x19f #endif #if defined(KEY_VIDEOPHONE) || (defined(HAVE_DECL_KEY_VIDEOPHONE) && HAVE_DECL_KEY_VIDEOPHONE) - XLAT(KEY_VIDEOPHONE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_VIDEOPHONE) == (0x1a0), "KEY_VIDEOPHONE != 0x1a0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_VIDEOPHONE 0x1a0 #endif #if defined(KEY_GAMES) || (defined(HAVE_DECL_KEY_GAMES) && HAVE_DECL_KEY_GAMES) - XLAT(KEY_GAMES), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_GAMES) == (0x1a1), "KEY_GAMES != 0x1a1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_GAMES 0x1a1 #endif #if defined(KEY_ZOOMIN) || (defined(HAVE_DECL_KEY_ZOOMIN) && HAVE_DECL_KEY_ZOOMIN) - XLAT(KEY_ZOOMIN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_ZOOMIN) == (0x1a2), "KEY_ZOOMIN != 0x1a2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_ZOOMIN 0x1a2 #endif #if defined(KEY_ZOOMOUT) || (defined(HAVE_DECL_KEY_ZOOMOUT) && HAVE_DECL_KEY_ZOOMOUT) - XLAT(KEY_ZOOMOUT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_ZOOMOUT) == (0x1a3), "KEY_ZOOMOUT != 0x1a3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_ZOOMOUT 0x1a3 #endif #if defined(KEY_ZOOMRESET) || (defined(HAVE_DECL_KEY_ZOOMRESET) && HAVE_DECL_KEY_ZOOMRESET) - XLAT(KEY_ZOOMRESET), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_ZOOMRESET) == (0x1a4), "KEY_ZOOMRESET != 0x1a4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_ZOOMRESET 0x1a4 #endif #if defined(KEY_WORDPROCESSOR) || (defined(HAVE_DECL_KEY_WORDPROCESSOR) && HAVE_DECL_KEY_WORDPROCESSOR) - XLAT(KEY_WORDPROCESSOR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_WORDPROCESSOR) == (0x1a5), "KEY_WORDPROCESSOR != 0x1a5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_WORDPROCESSOR 0x1a5 #endif #if defined(KEY_EDITOR) || (defined(HAVE_DECL_KEY_EDITOR) && HAVE_DECL_KEY_EDITOR) - XLAT(KEY_EDITOR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_EDITOR) == (0x1a6), "KEY_EDITOR != 0x1a6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_EDITOR 0x1a6 #endif #if defined(KEY_SPREADSHEET) || (defined(HAVE_DECL_KEY_SPREADSHEET) && HAVE_DECL_KEY_SPREADSHEET) - XLAT(KEY_SPREADSHEET), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SPREADSHEET) == (0x1a7), "KEY_SPREADSHEET != 0x1a7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SPREADSHEET 0x1a7 #endif #if defined(KEY_GRAPHICSEDITOR) || (defined(HAVE_DECL_KEY_GRAPHICSEDITOR) && HAVE_DECL_KEY_GRAPHICSEDITOR) - XLAT(KEY_GRAPHICSEDITOR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_GRAPHICSEDITOR) == (0x1a8), "KEY_GRAPHICSEDITOR != 0x1a8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_GRAPHICSEDITOR 0x1a8 #endif #if defined(KEY_PRESENTATION) || (defined(HAVE_DECL_KEY_PRESENTATION) && HAVE_DECL_KEY_PRESENTATION) - XLAT(KEY_PRESENTATION), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_PRESENTATION) == (0x1a9), "KEY_PRESENTATION != 0x1a9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_PRESENTATION 0x1a9 #endif #if defined(KEY_DATABASE) || (defined(HAVE_DECL_KEY_DATABASE) && HAVE_DECL_KEY_DATABASE) - XLAT(KEY_DATABASE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_DATABASE) == (0x1aa), "KEY_DATABASE != 0x1aa"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_DATABASE 0x1aa #endif #if defined(KEY_NEWS) || (defined(HAVE_DECL_KEY_NEWS) && HAVE_DECL_KEY_NEWS) - XLAT(KEY_NEWS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NEWS) == (0x1ab), "KEY_NEWS != 0x1ab"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NEWS 0x1ab #endif #if defined(KEY_VOICEMAIL) || (defined(HAVE_DECL_KEY_VOICEMAIL) && HAVE_DECL_KEY_VOICEMAIL) - XLAT(KEY_VOICEMAIL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_VOICEMAIL) == (0x1ac), "KEY_VOICEMAIL != 0x1ac"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_VOICEMAIL 0x1ac #endif #if defined(KEY_ADDRESSBOOK) || (defined(HAVE_DECL_KEY_ADDRESSBOOK) && HAVE_DECL_KEY_ADDRESSBOOK) - XLAT(KEY_ADDRESSBOOK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_ADDRESSBOOK) == (0x1ad), "KEY_ADDRESSBOOK != 0x1ad"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_ADDRESSBOOK 0x1ad #endif #if defined(KEY_MESSENGER) || (defined(HAVE_DECL_KEY_MESSENGER) && HAVE_DECL_KEY_MESSENGER) - XLAT(KEY_MESSENGER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_MESSENGER) == (0x1ae), "KEY_MESSENGER != 0x1ae"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_MESSENGER 0x1ae #endif #if defined(KEY_DISPLAYTOGGLE) || (defined(HAVE_DECL_KEY_DISPLAYTOGGLE) && HAVE_DECL_KEY_DISPLAYTOGGLE) - XLAT(KEY_DISPLAYTOGGLE), -#endif -#if defined(KEY_BRIGHTNESS_TOGGLE) || (defined(HAVE_DECL_KEY_BRIGHTNESS_TOGGLE) && HAVE_DECL_KEY_BRIGHTNESS_TOGGLE) - XLAT(KEY_BRIGHTNESS_TOGGLE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_DISPLAYTOGGLE) == (0x1af), "KEY_DISPLAYTOGGLE != 0x1af"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_DISPLAYTOGGLE 0x1af #endif #if defined(KEY_SPELLCHECK) || (defined(HAVE_DECL_KEY_SPELLCHECK) && HAVE_DECL_KEY_SPELLCHECK) - XLAT(KEY_SPELLCHECK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SPELLCHECK) == (0x1b0), "KEY_SPELLCHECK != 0x1b0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SPELLCHECK 0x1b0 #endif #if defined(KEY_LOGOFF) || (defined(HAVE_DECL_KEY_LOGOFF) && HAVE_DECL_KEY_LOGOFF) - XLAT(KEY_LOGOFF), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_LOGOFF) == (0x1b1), "KEY_LOGOFF != 0x1b1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_LOGOFF 0x1b1 #endif - #if defined(KEY_DOLLAR) || (defined(HAVE_DECL_KEY_DOLLAR) && HAVE_DECL_KEY_DOLLAR) - XLAT(KEY_DOLLAR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_DOLLAR) == (0x1b2), "KEY_DOLLAR != 0x1b2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_DOLLAR 0x1b2 #endif #if defined(KEY_EURO) || (defined(HAVE_DECL_KEY_EURO) && HAVE_DECL_KEY_EURO) - XLAT(KEY_EURO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_EURO) == (0x1b3), "KEY_EURO != 0x1b3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_EURO 0x1b3 #endif - #if defined(KEY_FRAMEBACK) || (defined(HAVE_DECL_KEY_FRAMEBACK) && HAVE_DECL_KEY_FRAMEBACK) - XLAT(KEY_FRAMEBACK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FRAMEBACK) == (0x1b4), "KEY_FRAMEBACK != 0x1b4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FRAMEBACK 0x1b4 #endif #if defined(KEY_FRAMEFORWARD) || (defined(HAVE_DECL_KEY_FRAMEFORWARD) && HAVE_DECL_KEY_FRAMEFORWARD) - XLAT(KEY_FRAMEFORWARD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FRAMEFORWARD) == (0x1b5), "KEY_FRAMEFORWARD != 0x1b5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FRAMEFORWARD 0x1b5 #endif #if defined(KEY_CONTEXT_MENU) || (defined(HAVE_DECL_KEY_CONTEXT_MENU) && HAVE_DECL_KEY_CONTEXT_MENU) - XLAT(KEY_CONTEXT_MENU), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CONTEXT_MENU) == (0x1b6), "KEY_CONTEXT_MENU != 0x1b6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CONTEXT_MENU 0x1b6 #endif #if defined(KEY_MEDIA_REPEAT) || (defined(HAVE_DECL_KEY_MEDIA_REPEAT) && HAVE_DECL_KEY_MEDIA_REPEAT) - XLAT(KEY_MEDIA_REPEAT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_MEDIA_REPEAT) == (0x1b7), "KEY_MEDIA_REPEAT != 0x1b7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_MEDIA_REPEAT 0x1b7 #endif #if defined(KEY_10CHANNELSUP) || (defined(HAVE_DECL_KEY_10CHANNELSUP) && HAVE_DECL_KEY_10CHANNELSUP) - XLAT(KEY_10CHANNELSUP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_10CHANNELSUP) == (0x1b8), "KEY_10CHANNELSUP != 0x1b8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_10CHANNELSUP 0x1b8 #endif #if defined(KEY_10CHANNELSDOWN) || (defined(HAVE_DECL_KEY_10CHANNELSDOWN) && HAVE_DECL_KEY_10CHANNELSDOWN) - XLAT(KEY_10CHANNELSDOWN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_10CHANNELSDOWN) == (0x1b9), "KEY_10CHANNELSDOWN != 0x1b9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_10CHANNELSDOWN 0x1b9 #endif #if defined(KEY_IMAGES) || (defined(HAVE_DECL_KEY_IMAGES) && HAVE_DECL_KEY_IMAGES) - XLAT(KEY_IMAGES), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_IMAGES) == (0x1ba), "KEY_IMAGES != 0x1ba"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_IMAGES 0x1ba #endif - #if defined(KEY_DEL_EOL) || (defined(HAVE_DECL_KEY_DEL_EOL) && HAVE_DECL_KEY_DEL_EOL) - XLAT(KEY_DEL_EOL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_DEL_EOL) == (0x1c0), "KEY_DEL_EOL != 0x1c0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_DEL_EOL 0x1c0 #endif #if defined(KEY_DEL_EOS) || (defined(HAVE_DECL_KEY_DEL_EOS) && HAVE_DECL_KEY_DEL_EOS) - XLAT(KEY_DEL_EOS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_DEL_EOS) == (0x1c1), "KEY_DEL_EOS != 0x1c1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_DEL_EOS 0x1c1 #endif #if defined(KEY_INS_LINE) || (defined(HAVE_DECL_KEY_INS_LINE) && HAVE_DECL_KEY_INS_LINE) - XLAT(KEY_INS_LINE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_INS_LINE) == (0x1c2), "KEY_INS_LINE != 0x1c2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_INS_LINE 0x1c2 #endif #if defined(KEY_DEL_LINE) || (defined(HAVE_DECL_KEY_DEL_LINE) && HAVE_DECL_KEY_DEL_LINE) - XLAT(KEY_DEL_LINE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_DEL_LINE) == (0x1c3), "KEY_DEL_LINE != 0x1c3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_DEL_LINE 0x1c3 #endif - #if defined(KEY_FN) || (defined(HAVE_DECL_KEY_FN) && HAVE_DECL_KEY_FN) - XLAT(KEY_FN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FN) == (0x1d0), "KEY_FN != 0x1d0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FN 0x1d0 #endif #if defined(KEY_FN_ESC) || (defined(HAVE_DECL_KEY_FN_ESC) && HAVE_DECL_KEY_FN_ESC) - XLAT(KEY_FN_ESC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FN_ESC) == (0x1d1), "KEY_FN_ESC != 0x1d1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FN_ESC 0x1d1 #endif #if defined(KEY_FN_F1) || (defined(HAVE_DECL_KEY_FN_F1) && HAVE_DECL_KEY_FN_F1) - XLAT(KEY_FN_F1), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FN_F1) == (0x1d2), "KEY_FN_F1 != 0x1d2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FN_F1 0x1d2 #endif #if defined(KEY_FN_F2) || (defined(HAVE_DECL_KEY_FN_F2) && HAVE_DECL_KEY_FN_F2) - XLAT(KEY_FN_F2), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FN_F2) == (0x1d3), "KEY_FN_F2 != 0x1d3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FN_F2 0x1d3 #endif #if defined(KEY_FN_F3) || (defined(HAVE_DECL_KEY_FN_F3) && HAVE_DECL_KEY_FN_F3) - XLAT(KEY_FN_F3), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FN_F3) == (0x1d4), "KEY_FN_F3 != 0x1d4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FN_F3 0x1d4 #endif #if defined(KEY_FN_F4) || (defined(HAVE_DECL_KEY_FN_F4) && HAVE_DECL_KEY_FN_F4) - XLAT(KEY_FN_F4), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FN_F4) == (0x1d5), "KEY_FN_F4 != 0x1d5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FN_F4 0x1d5 #endif #if defined(KEY_FN_F5) || (defined(HAVE_DECL_KEY_FN_F5) && HAVE_DECL_KEY_FN_F5) - XLAT(KEY_FN_F5), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FN_F5) == (0x1d6), "KEY_FN_F5 != 0x1d6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FN_F5 0x1d6 #endif #if defined(KEY_FN_F6) || (defined(HAVE_DECL_KEY_FN_F6) && HAVE_DECL_KEY_FN_F6) - XLAT(KEY_FN_F6), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FN_F6) == (0x1d7), "KEY_FN_F6 != 0x1d7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FN_F6 0x1d7 #endif #if defined(KEY_FN_F7) || (defined(HAVE_DECL_KEY_FN_F7) && HAVE_DECL_KEY_FN_F7) - XLAT(KEY_FN_F7), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FN_F7) == (0x1d8), "KEY_FN_F7 != 0x1d8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FN_F7 0x1d8 #endif #if defined(KEY_FN_F8) || (defined(HAVE_DECL_KEY_FN_F8) && HAVE_DECL_KEY_FN_F8) - XLAT(KEY_FN_F8), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FN_F8) == (0x1d9), "KEY_FN_F8 != 0x1d9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FN_F8 0x1d9 #endif #if defined(KEY_FN_F9) || (defined(HAVE_DECL_KEY_FN_F9) && HAVE_DECL_KEY_FN_F9) - XLAT(KEY_FN_F9), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FN_F9) == (0x1da), "KEY_FN_F9 != 0x1da"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FN_F9 0x1da #endif #if defined(KEY_FN_F10) || (defined(HAVE_DECL_KEY_FN_F10) && HAVE_DECL_KEY_FN_F10) - XLAT(KEY_FN_F10), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FN_F10) == (0x1db), "KEY_FN_F10 != 0x1db"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FN_F10 0x1db #endif #if defined(KEY_FN_F11) || (defined(HAVE_DECL_KEY_FN_F11) && HAVE_DECL_KEY_FN_F11) - XLAT(KEY_FN_F11), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FN_F11) == (0x1dc), "KEY_FN_F11 != 0x1dc"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FN_F11 0x1dc #endif #if defined(KEY_FN_F12) || (defined(HAVE_DECL_KEY_FN_F12) && HAVE_DECL_KEY_FN_F12) - XLAT(KEY_FN_F12), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FN_F12) == (0x1dd), "KEY_FN_F12 != 0x1dd"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FN_F12 0x1dd #endif #if defined(KEY_FN_1) || (defined(HAVE_DECL_KEY_FN_1) && HAVE_DECL_KEY_FN_1) - XLAT(KEY_FN_1), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FN_1) == (0x1de), "KEY_FN_1 != 0x1de"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FN_1 0x1de #endif #if defined(KEY_FN_2) || (defined(HAVE_DECL_KEY_FN_2) && HAVE_DECL_KEY_FN_2) - XLAT(KEY_FN_2), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FN_2) == (0x1df), "KEY_FN_2 != 0x1df"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FN_2 0x1df #endif #if defined(KEY_FN_D) || (defined(HAVE_DECL_KEY_FN_D) && HAVE_DECL_KEY_FN_D) - XLAT(KEY_FN_D), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FN_D) == (0x1e0), "KEY_FN_D != 0x1e0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FN_D 0x1e0 #endif #if defined(KEY_FN_E) || (defined(HAVE_DECL_KEY_FN_E) && HAVE_DECL_KEY_FN_E) - XLAT(KEY_FN_E), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FN_E) == (0x1e1), "KEY_FN_E != 0x1e1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FN_E 0x1e1 #endif #if defined(KEY_FN_F) || (defined(HAVE_DECL_KEY_FN_F) && HAVE_DECL_KEY_FN_F) - XLAT(KEY_FN_F), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FN_F) == (0x1e2), "KEY_FN_F != 0x1e2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FN_F 0x1e2 #endif #if defined(KEY_FN_S) || (defined(HAVE_DECL_KEY_FN_S) && HAVE_DECL_KEY_FN_S) - XLAT(KEY_FN_S), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FN_S) == (0x1e3), "KEY_FN_S != 0x1e3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FN_S 0x1e3 #endif #if defined(KEY_FN_B) || (defined(HAVE_DECL_KEY_FN_B) && HAVE_DECL_KEY_FN_B) - XLAT(KEY_FN_B), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FN_B) == (0x1e4), "KEY_FN_B != 0x1e4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FN_B 0x1e4 #endif - #if defined(KEY_BRL_DOT1) || (defined(HAVE_DECL_KEY_BRL_DOT1) && HAVE_DECL_KEY_BRL_DOT1) - XLAT(KEY_BRL_DOT1), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BRL_DOT1) == (0x1f1), "KEY_BRL_DOT1 != 0x1f1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BRL_DOT1 0x1f1 #endif #if defined(KEY_BRL_DOT2) || (defined(HAVE_DECL_KEY_BRL_DOT2) && HAVE_DECL_KEY_BRL_DOT2) - XLAT(KEY_BRL_DOT2), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BRL_DOT2) == (0x1f2), "KEY_BRL_DOT2 != 0x1f2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BRL_DOT2 0x1f2 #endif #if defined(KEY_BRL_DOT3) || (defined(HAVE_DECL_KEY_BRL_DOT3) && HAVE_DECL_KEY_BRL_DOT3) - XLAT(KEY_BRL_DOT3), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BRL_DOT3) == (0x1f3), "KEY_BRL_DOT3 != 0x1f3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BRL_DOT3 0x1f3 #endif #if defined(KEY_BRL_DOT4) || (defined(HAVE_DECL_KEY_BRL_DOT4) && HAVE_DECL_KEY_BRL_DOT4) - XLAT(KEY_BRL_DOT4), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BRL_DOT4) == (0x1f4), "KEY_BRL_DOT4 != 0x1f4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BRL_DOT4 0x1f4 #endif #if defined(KEY_BRL_DOT5) || (defined(HAVE_DECL_KEY_BRL_DOT5) && HAVE_DECL_KEY_BRL_DOT5) - XLAT(KEY_BRL_DOT5), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BRL_DOT5) == (0x1f5), "KEY_BRL_DOT5 != 0x1f5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BRL_DOT5 0x1f5 #endif #if defined(KEY_BRL_DOT6) || (defined(HAVE_DECL_KEY_BRL_DOT6) && HAVE_DECL_KEY_BRL_DOT6) - XLAT(KEY_BRL_DOT6), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BRL_DOT6) == (0x1f6), "KEY_BRL_DOT6 != 0x1f6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BRL_DOT6 0x1f6 #endif #if defined(KEY_BRL_DOT7) || (defined(HAVE_DECL_KEY_BRL_DOT7) && HAVE_DECL_KEY_BRL_DOT7) - XLAT(KEY_BRL_DOT7), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BRL_DOT7) == (0x1f7), "KEY_BRL_DOT7 != 0x1f7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BRL_DOT7 0x1f7 #endif #if defined(KEY_BRL_DOT8) || (defined(HAVE_DECL_KEY_BRL_DOT8) && HAVE_DECL_KEY_BRL_DOT8) - XLAT(KEY_BRL_DOT8), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BRL_DOT8) == (0x1f8), "KEY_BRL_DOT8 != 0x1f8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BRL_DOT8 0x1f8 #endif #if defined(KEY_BRL_DOT9) || (defined(HAVE_DECL_KEY_BRL_DOT9) && HAVE_DECL_KEY_BRL_DOT9) - XLAT(KEY_BRL_DOT9), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BRL_DOT9) == (0x1f9), "KEY_BRL_DOT9 != 0x1f9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BRL_DOT9 0x1f9 #endif #if defined(KEY_BRL_DOT10) || (defined(HAVE_DECL_KEY_BRL_DOT10) && HAVE_DECL_KEY_BRL_DOT10) - XLAT(KEY_BRL_DOT10), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BRL_DOT10) == (0x1fa), "KEY_BRL_DOT10 != 0x1fa"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BRL_DOT10 0x1fa #endif - #if defined(KEY_NUMERIC_0) || (defined(HAVE_DECL_KEY_NUMERIC_0) && HAVE_DECL_KEY_NUMERIC_0) - XLAT(KEY_NUMERIC_0), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NUMERIC_0) == (0x200), "KEY_NUMERIC_0 != 0x200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NUMERIC_0 0x200 #endif #if defined(KEY_NUMERIC_1) || (defined(HAVE_DECL_KEY_NUMERIC_1) && HAVE_DECL_KEY_NUMERIC_1) - XLAT(KEY_NUMERIC_1), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NUMERIC_1) == (0x201), "KEY_NUMERIC_1 != 0x201"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NUMERIC_1 0x201 #endif #if defined(KEY_NUMERIC_2) || (defined(HAVE_DECL_KEY_NUMERIC_2) && HAVE_DECL_KEY_NUMERIC_2) - XLAT(KEY_NUMERIC_2), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NUMERIC_2) == (0x202), "KEY_NUMERIC_2 != 0x202"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NUMERIC_2 0x202 #endif #if defined(KEY_NUMERIC_3) || (defined(HAVE_DECL_KEY_NUMERIC_3) && HAVE_DECL_KEY_NUMERIC_3) - XLAT(KEY_NUMERIC_3), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NUMERIC_3) == (0x203), "KEY_NUMERIC_3 != 0x203"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NUMERIC_3 0x203 #endif #if defined(KEY_NUMERIC_4) || (defined(HAVE_DECL_KEY_NUMERIC_4) && HAVE_DECL_KEY_NUMERIC_4) - XLAT(KEY_NUMERIC_4), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NUMERIC_4) == (0x204), "KEY_NUMERIC_4 != 0x204"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NUMERIC_4 0x204 #endif #if defined(KEY_NUMERIC_5) || (defined(HAVE_DECL_KEY_NUMERIC_5) && HAVE_DECL_KEY_NUMERIC_5) - XLAT(KEY_NUMERIC_5), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NUMERIC_5) == (0x205), "KEY_NUMERIC_5 != 0x205"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NUMERIC_5 0x205 #endif #if defined(KEY_NUMERIC_6) || (defined(HAVE_DECL_KEY_NUMERIC_6) && HAVE_DECL_KEY_NUMERIC_6) - XLAT(KEY_NUMERIC_6), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NUMERIC_6) == (0x206), "KEY_NUMERIC_6 != 0x206"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NUMERIC_6 0x206 #endif #if defined(KEY_NUMERIC_7) || (defined(HAVE_DECL_KEY_NUMERIC_7) && HAVE_DECL_KEY_NUMERIC_7) - XLAT(KEY_NUMERIC_7), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NUMERIC_7) == (0x207), "KEY_NUMERIC_7 != 0x207"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NUMERIC_7 0x207 #endif #if defined(KEY_NUMERIC_8) || (defined(HAVE_DECL_KEY_NUMERIC_8) && HAVE_DECL_KEY_NUMERIC_8) - XLAT(KEY_NUMERIC_8), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NUMERIC_8) == (0x208), "KEY_NUMERIC_8 != 0x208"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NUMERIC_8 0x208 #endif #if defined(KEY_NUMERIC_9) || (defined(HAVE_DECL_KEY_NUMERIC_9) && HAVE_DECL_KEY_NUMERIC_9) - XLAT(KEY_NUMERIC_9), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NUMERIC_9) == (0x209), "KEY_NUMERIC_9 != 0x209"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NUMERIC_9 0x209 #endif #if defined(KEY_NUMERIC_STAR) || (defined(HAVE_DECL_KEY_NUMERIC_STAR) && HAVE_DECL_KEY_NUMERIC_STAR) - XLAT(KEY_NUMERIC_STAR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NUMERIC_STAR) == (0x20a), "KEY_NUMERIC_STAR != 0x20a"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NUMERIC_STAR 0x20a #endif #if defined(KEY_NUMERIC_POUND) || (defined(HAVE_DECL_KEY_NUMERIC_POUND) && HAVE_DECL_KEY_NUMERIC_POUND) - XLAT(KEY_NUMERIC_POUND), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NUMERIC_POUND) == (0x20b), "KEY_NUMERIC_POUND != 0x20b"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NUMERIC_POUND 0x20b #endif #if defined(KEY_NUMERIC_A) || (defined(HAVE_DECL_KEY_NUMERIC_A) && HAVE_DECL_KEY_NUMERIC_A) - XLAT(KEY_NUMERIC_A), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NUMERIC_A) == (0x20c), "KEY_NUMERIC_A != 0x20c"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NUMERIC_A 0x20c #endif #if defined(KEY_NUMERIC_B) || (defined(HAVE_DECL_KEY_NUMERIC_B) && HAVE_DECL_KEY_NUMERIC_B) - XLAT(KEY_NUMERIC_B), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NUMERIC_B) == (0x20d), "KEY_NUMERIC_B != 0x20d"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NUMERIC_B 0x20d #endif #if defined(KEY_NUMERIC_C) || (defined(HAVE_DECL_KEY_NUMERIC_C) && HAVE_DECL_KEY_NUMERIC_C) - XLAT(KEY_NUMERIC_C), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NUMERIC_C) == (0x20e), "KEY_NUMERIC_C != 0x20e"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NUMERIC_C 0x20e #endif #if defined(KEY_NUMERIC_D) || (defined(HAVE_DECL_KEY_NUMERIC_D) && HAVE_DECL_KEY_NUMERIC_D) - XLAT(KEY_NUMERIC_D), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NUMERIC_D) == (0x20f), "KEY_NUMERIC_D != 0x20f"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NUMERIC_D 0x20f #endif - #if defined(KEY_CAMERA_FOCUS) || (defined(HAVE_DECL_KEY_CAMERA_FOCUS) && HAVE_DECL_KEY_CAMERA_FOCUS) - XLAT(KEY_CAMERA_FOCUS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CAMERA_FOCUS) == (0x210), "KEY_CAMERA_FOCUS != 0x210"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CAMERA_FOCUS 0x210 #endif #if defined(KEY_WPS_BUTTON) || (defined(HAVE_DECL_KEY_WPS_BUTTON) && HAVE_DECL_KEY_WPS_BUTTON) - XLAT(KEY_WPS_BUTTON), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_WPS_BUTTON) == (0x211), "KEY_WPS_BUTTON != 0x211"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_WPS_BUTTON 0x211 #endif - #if defined(KEY_TOUCHPAD_TOGGLE) || (defined(HAVE_DECL_KEY_TOUCHPAD_TOGGLE) && HAVE_DECL_KEY_TOUCHPAD_TOGGLE) - XLAT(KEY_TOUCHPAD_TOGGLE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_TOUCHPAD_TOGGLE) == (0x212), "KEY_TOUCHPAD_TOGGLE != 0x212"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_TOUCHPAD_TOGGLE 0x212 #endif #if defined(KEY_TOUCHPAD_ON) || (defined(HAVE_DECL_KEY_TOUCHPAD_ON) && HAVE_DECL_KEY_TOUCHPAD_ON) - XLAT(KEY_TOUCHPAD_ON), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_TOUCHPAD_ON) == (0x213), "KEY_TOUCHPAD_ON != 0x213"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_TOUCHPAD_ON 0x213 #endif #if defined(KEY_TOUCHPAD_OFF) || (defined(HAVE_DECL_KEY_TOUCHPAD_OFF) && HAVE_DECL_KEY_TOUCHPAD_OFF) - XLAT(KEY_TOUCHPAD_OFF), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_TOUCHPAD_OFF) == (0x214), "KEY_TOUCHPAD_OFF != 0x214"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_TOUCHPAD_OFF 0x214 #endif - #if defined(KEY_CAMERA_ZOOMIN) || (defined(HAVE_DECL_KEY_CAMERA_ZOOMIN) && HAVE_DECL_KEY_CAMERA_ZOOMIN) - XLAT(KEY_CAMERA_ZOOMIN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CAMERA_ZOOMIN) == (0x215), "KEY_CAMERA_ZOOMIN != 0x215"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CAMERA_ZOOMIN 0x215 #endif #if defined(KEY_CAMERA_ZOOMOUT) || (defined(HAVE_DECL_KEY_CAMERA_ZOOMOUT) && HAVE_DECL_KEY_CAMERA_ZOOMOUT) - XLAT(KEY_CAMERA_ZOOMOUT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CAMERA_ZOOMOUT) == (0x216), "KEY_CAMERA_ZOOMOUT != 0x216"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CAMERA_ZOOMOUT 0x216 #endif #if defined(KEY_CAMERA_UP) || (defined(HAVE_DECL_KEY_CAMERA_UP) && HAVE_DECL_KEY_CAMERA_UP) - XLAT(KEY_CAMERA_UP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CAMERA_UP) == (0x217), "KEY_CAMERA_UP != 0x217"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CAMERA_UP 0x217 #endif #if defined(KEY_CAMERA_DOWN) || (defined(HAVE_DECL_KEY_CAMERA_DOWN) && HAVE_DECL_KEY_CAMERA_DOWN) - XLAT(KEY_CAMERA_DOWN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CAMERA_DOWN) == (0x218), "KEY_CAMERA_DOWN != 0x218"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CAMERA_DOWN 0x218 #endif #if defined(KEY_CAMERA_LEFT) || (defined(HAVE_DECL_KEY_CAMERA_LEFT) && HAVE_DECL_KEY_CAMERA_LEFT) - XLAT(KEY_CAMERA_LEFT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CAMERA_LEFT) == (0x219), "KEY_CAMERA_LEFT != 0x219"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CAMERA_LEFT 0x219 #endif #if defined(KEY_CAMERA_RIGHT) || (defined(HAVE_DECL_KEY_CAMERA_RIGHT) && HAVE_DECL_KEY_CAMERA_RIGHT) - XLAT(KEY_CAMERA_RIGHT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CAMERA_RIGHT) == (0x21a), "KEY_CAMERA_RIGHT != 0x21a"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CAMERA_RIGHT 0x21a #endif - #if defined(KEY_ATTENDANT_ON) || (defined(HAVE_DECL_KEY_ATTENDANT_ON) && HAVE_DECL_KEY_ATTENDANT_ON) - XLAT(KEY_ATTENDANT_ON), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_ATTENDANT_ON) == (0x21b), "KEY_ATTENDANT_ON != 0x21b"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_ATTENDANT_ON 0x21b #endif #if defined(KEY_ATTENDANT_OFF) || (defined(HAVE_DECL_KEY_ATTENDANT_OFF) && HAVE_DECL_KEY_ATTENDANT_OFF) - XLAT(KEY_ATTENDANT_OFF), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_ATTENDANT_OFF) == (0x21c), "KEY_ATTENDANT_OFF != 0x21c"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_ATTENDANT_OFF 0x21c #endif #if defined(KEY_ATTENDANT_TOGGLE) || (defined(HAVE_DECL_KEY_ATTENDANT_TOGGLE) && HAVE_DECL_KEY_ATTENDANT_TOGGLE) - XLAT(KEY_ATTENDANT_TOGGLE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_ATTENDANT_TOGGLE) == (0x21d), "KEY_ATTENDANT_TOGGLE != 0x21d"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_ATTENDANT_TOGGLE 0x21d #endif #if defined(KEY_LIGHTS_TOGGLE) || (defined(HAVE_DECL_KEY_LIGHTS_TOGGLE) && HAVE_DECL_KEY_LIGHTS_TOGGLE) - XLAT(KEY_LIGHTS_TOGGLE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_LIGHTS_TOGGLE) == (0x21e), "KEY_LIGHTS_TOGGLE != 0x21e"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_LIGHTS_TOGGLE 0x21e #endif - #if defined(BTN_DPAD_UP) || (defined(HAVE_DECL_BTN_DPAD_UP) && HAVE_DECL_BTN_DPAD_UP) - XLAT(BTN_DPAD_UP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_DPAD_UP) == (0x220), "BTN_DPAD_UP != 0x220"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_DPAD_UP 0x220 #endif #if defined(BTN_DPAD_DOWN) || (defined(HAVE_DECL_BTN_DPAD_DOWN) && HAVE_DECL_BTN_DPAD_DOWN) - XLAT(BTN_DPAD_DOWN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_DPAD_DOWN) == (0x221), "BTN_DPAD_DOWN != 0x221"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_DPAD_DOWN 0x221 #endif #if defined(BTN_DPAD_LEFT) || (defined(HAVE_DECL_BTN_DPAD_LEFT) && HAVE_DECL_BTN_DPAD_LEFT) - XLAT(BTN_DPAD_LEFT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_DPAD_LEFT) == (0x222), "BTN_DPAD_LEFT != 0x222"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_DPAD_LEFT 0x222 #endif #if defined(BTN_DPAD_RIGHT) || (defined(HAVE_DECL_BTN_DPAD_RIGHT) && HAVE_DECL_BTN_DPAD_RIGHT) - XLAT(BTN_DPAD_RIGHT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_DPAD_RIGHT) == (0x223), "BTN_DPAD_RIGHT != 0x223"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_DPAD_RIGHT 0x223 #endif - #if defined(KEY_ALS_TOGGLE) || (defined(HAVE_DECL_KEY_ALS_TOGGLE) && HAVE_DECL_KEY_ALS_TOGGLE) - XLAT(KEY_ALS_TOGGLE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_ALS_TOGGLE) == (0x230), "KEY_ALS_TOGGLE != 0x230"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_ALS_TOGGLE 0x230 +#endif +#if defined(KEY_ROTATE_LOCK_TOGGLE) || (defined(HAVE_DECL_KEY_ROTATE_LOCK_TOGGLE) && HAVE_DECL_KEY_ROTATE_LOCK_TOGGLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_ROTATE_LOCK_TOGGLE) == (0x231), "KEY_ROTATE_LOCK_TOGGLE != 0x231"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_ROTATE_LOCK_TOGGLE 0x231 #endif - #if defined(KEY_BUTTONCONFIG) || (defined(HAVE_DECL_KEY_BUTTONCONFIG) && HAVE_DECL_KEY_BUTTONCONFIG) - XLAT(KEY_BUTTONCONFIG), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BUTTONCONFIG) == (0x240), "KEY_BUTTONCONFIG != 0x240"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BUTTONCONFIG 0x240 #endif #if defined(KEY_TASKMANAGER) || (defined(HAVE_DECL_KEY_TASKMANAGER) && HAVE_DECL_KEY_TASKMANAGER) - XLAT(KEY_TASKMANAGER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_TASKMANAGER) == (0x241), "KEY_TASKMANAGER != 0x241"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_TASKMANAGER 0x241 #endif #if defined(KEY_JOURNAL) || (defined(HAVE_DECL_KEY_JOURNAL) && HAVE_DECL_KEY_JOURNAL) - XLAT(KEY_JOURNAL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_JOURNAL) == (0x242), "KEY_JOURNAL != 0x242"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_JOURNAL 0x242 #endif #if defined(KEY_CONTROLPANEL) || (defined(HAVE_DECL_KEY_CONTROLPANEL) && HAVE_DECL_KEY_CONTROLPANEL) - XLAT(KEY_CONTROLPANEL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_CONTROLPANEL) == (0x243), "KEY_CONTROLPANEL != 0x243"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_CONTROLPANEL 0x243 #endif #if defined(KEY_APPSELECT) || (defined(HAVE_DECL_KEY_APPSELECT) && HAVE_DECL_KEY_APPSELECT) - XLAT(KEY_APPSELECT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_APPSELECT) == (0x244), "KEY_APPSELECT != 0x244"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_APPSELECT 0x244 #endif #if defined(KEY_SCREENSAVER) || (defined(HAVE_DECL_KEY_SCREENSAVER) && HAVE_DECL_KEY_SCREENSAVER) - XLAT(KEY_SCREENSAVER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SCREENSAVER) == (0x245), "KEY_SCREENSAVER != 0x245"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SCREENSAVER 0x245 #endif #if defined(KEY_VOICECOMMAND) || (defined(HAVE_DECL_KEY_VOICECOMMAND) && HAVE_DECL_KEY_VOICECOMMAND) - XLAT(KEY_VOICECOMMAND), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_VOICECOMMAND) == (0x246), "KEY_VOICECOMMAND != 0x246"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_VOICECOMMAND 0x246 +#endif +#if defined(KEY_ASSISTANT) || (defined(HAVE_DECL_KEY_ASSISTANT) && HAVE_DECL_KEY_ASSISTANT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_ASSISTANT) == (0x247), "KEY_ASSISTANT != 0x247"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_ASSISTANT 0x247 +#endif +#ifndef STRACE_WORKAROUND_FOR_KEY_BRIGHTNESS_MIN +# define STRACE_WORKAROUND_FOR_KEY_BRIGHTNESS_MIN +# undef KEY_BRIGHTNESS_MIN #endif - #if defined(KEY_BRIGHTNESS_MIN) || (defined(HAVE_DECL_KEY_BRIGHTNESS_MIN) && HAVE_DECL_KEY_BRIGHTNESS_MIN) - XLAT(KEY_BRIGHTNESS_MIN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BRIGHTNESS_MIN) == (0x250), "KEY_BRIGHTNESS_MIN != 0x250"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BRIGHTNESS_MIN 0x250 #endif #if defined(KEY_BRIGHTNESS_MAX) || (defined(HAVE_DECL_KEY_BRIGHTNESS_MAX) && HAVE_DECL_KEY_BRIGHTNESS_MAX) - XLAT(KEY_BRIGHTNESS_MAX), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_BRIGHTNESS_MAX) == (0x251), "KEY_BRIGHTNESS_MAX != 0x251"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_BRIGHTNESS_MAX 0x251 #endif - #if defined(KEY_KBDINPUTASSIST_PREV) || (defined(HAVE_DECL_KEY_KBDINPUTASSIST_PREV) && HAVE_DECL_KEY_KBDINPUTASSIST_PREV) - XLAT(KEY_KBDINPUTASSIST_PREV), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KBDINPUTASSIST_PREV) == (0x260), "KEY_KBDINPUTASSIST_PREV != 0x260"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KBDINPUTASSIST_PREV 0x260 #endif #if defined(KEY_KBDINPUTASSIST_NEXT) || (defined(HAVE_DECL_KEY_KBDINPUTASSIST_NEXT) && HAVE_DECL_KEY_KBDINPUTASSIST_NEXT) - XLAT(KEY_KBDINPUTASSIST_NEXT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KBDINPUTASSIST_NEXT) == (0x261), "KEY_KBDINPUTASSIST_NEXT != 0x261"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KBDINPUTASSIST_NEXT 0x261 #endif #if defined(KEY_KBDINPUTASSIST_PREVGROUP) || (defined(HAVE_DECL_KEY_KBDINPUTASSIST_PREVGROUP) && HAVE_DECL_KEY_KBDINPUTASSIST_PREVGROUP) - XLAT(KEY_KBDINPUTASSIST_PREVGROUP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KBDINPUTASSIST_PREVGROUP) == (0x262), "KEY_KBDINPUTASSIST_PREVGROUP != 0x262"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KBDINPUTASSIST_PREVGROUP 0x262 #endif #if defined(KEY_KBDINPUTASSIST_NEXTGROUP) || (defined(HAVE_DECL_KEY_KBDINPUTASSIST_NEXTGROUP) && HAVE_DECL_KEY_KBDINPUTASSIST_NEXTGROUP) - XLAT(KEY_KBDINPUTASSIST_NEXTGROUP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KBDINPUTASSIST_NEXTGROUP) == (0x263), "KEY_KBDINPUTASSIST_NEXTGROUP != 0x263"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KBDINPUTASSIST_NEXTGROUP 0x263 #endif #if defined(KEY_KBDINPUTASSIST_ACCEPT) || (defined(HAVE_DECL_KEY_KBDINPUTASSIST_ACCEPT) && HAVE_DECL_KEY_KBDINPUTASSIST_ACCEPT) - XLAT(KEY_KBDINPUTASSIST_ACCEPT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KBDINPUTASSIST_ACCEPT) == (0x264), "KEY_KBDINPUTASSIST_ACCEPT != 0x264"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KBDINPUTASSIST_ACCEPT 0x264 #endif #if defined(KEY_KBDINPUTASSIST_CANCEL) || (defined(HAVE_DECL_KEY_KBDINPUTASSIST_CANCEL) && HAVE_DECL_KEY_KBDINPUTASSIST_CANCEL) - XLAT(KEY_KBDINPUTASSIST_CANCEL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_KBDINPUTASSIST_CANCEL) == (0x265), "KEY_KBDINPUTASSIST_CANCEL != 0x265"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_KBDINPUTASSIST_CANCEL 0x265 #endif - #if defined(KEY_RIGHT_UP) || (defined(HAVE_DECL_KEY_RIGHT_UP) && HAVE_DECL_KEY_RIGHT_UP) - XLAT(KEY_RIGHT_UP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_RIGHT_UP) == (0x266), "KEY_RIGHT_UP != 0x266"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_RIGHT_UP 0x266 #endif #if defined(KEY_RIGHT_DOWN) || (defined(HAVE_DECL_KEY_RIGHT_DOWN) && HAVE_DECL_KEY_RIGHT_DOWN) - XLAT(KEY_RIGHT_DOWN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_RIGHT_DOWN) == (0x267), "KEY_RIGHT_DOWN != 0x267"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_RIGHT_DOWN 0x267 #endif #if defined(KEY_LEFT_UP) || (defined(HAVE_DECL_KEY_LEFT_UP) && HAVE_DECL_KEY_LEFT_UP) - XLAT(KEY_LEFT_UP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_LEFT_UP) == (0x268), "KEY_LEFT_UP != 0x268"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_LEFT_UP 0x268 #endif #if defined(KEY_LEFT_DOWN) || (defined(HAVE_DECL_KEY_LEFT_DOWN) && HAVE_DECL_KEY_LEFT_DOWN) - XLAT(KEY_LEFT_DOWN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_LEFT_DOWN) == (0x269), "KEY_LEFT_DOWN != 0x269"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_LEFT_DOWN 0x269 #endif - #if defined(KEY_ROOT_MENU) || (defined(HAVE_DECL_KEY_ROOT_MENU) && HAVE_DECL_KEY_ROOT_MENU) - XLAT(KEY_ROOT_MENU), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_ROOT_MENU) == (0x26a), "KEY_ROOT_MENU != 0x26a"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_ROOT_MENU 0x26a #endif #if defined(KEY_MEDIA_TOP_MENU) || (defined(HAVE_DECL_KEY_MEDIA_TOP_MENU) && HAVE_DECL_KEY_MEDIA_TOP_MENU) - XLAT(KEY_MEDIA_TOP_MENU), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_MEDIA_TOP_MENU) == (0x26b), "KEY_MEDIA_TOP_MENU != 0x26b"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_MEDIA_TOP_MENU 0x26b #endif #if defined(KEY_NUMERIC_11) || (defined(HAVE_DECL_KEY_NUMERIC_11) && HAVE_DECL_KEY_NUMERIC_11) - XLAT(KEY_NUMERIC_11), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NUMERIC_11) == (0x26c), "KEY_NUMERIC_11 != 0x26c"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NUMERIC_11 0x26c #endif #if defined(KEY_NUMERIC_12) || (defined(HAVE_DECL_KEY_NUMERIC_12) && HAVE_DECL_KEY_NUMERIC_12) - XLAT(KEY_NUMERIC_12), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NUMERIC_12) == (0x26d), "KEY_NUMERIC_12 != 0x26d"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NUMERIC_12 0x26d #endif - #if defined(KEY_AUDIO_DESC) || (defined(HAVE_DECL_KEY_AUDIO_DESC) && HAVE_DECL_KEY_AUDIO_DESC) - XLAT(KEY_AUDIO_DESC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_AUDIO_DESC) == (0x26e), "KEY_AUDIO_DESC != 0x26e"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_AUDIO_DESC 0x26e #endif #if defined(KEY_3D_MODE) || (defined(HAVE_DECL_KEY_3D_MODE) && HAVE_DECL_KEY_3D_MODE) - XLAT(KEY_3D_MODE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_3D_MODE) == (0x26f), "KEY_3D_MODE != 0x26f"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_3D_MODE 0x26f #endif #if defined(KEY_NEXT_FAVORITE) || (defined(HAVE_DECL_KEY_NEXT_FAVORITE) && HAVE_DECL_KEY_NEXT_FAVORITE) - XLAT(KEY_NEXT_FAVORITE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_NEXT_FAVORITE) == (0x270), "KEY_NEXT_FAVORITE != 0x270"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_NEXT_FAVORITE 0x270 #endif #if defined(KEY_STOP_RECORD) || (defined(HAVE_DECL_KEY_STOP_RECORD) && HAVE_DECL_KEY_STOP_RECORD) - XLAT(KEY_STOP_RECORD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_STOP_RECORD) == (0x271), "KEY_STOP_RECORD != 0x271"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_STOP_RECORD 0x271 #endif #if defined(KEY_PAUSE_RECORD) || (defined(HAVE_DECL_KEY_PAUSE_RECORD) && HAVE_DECL_KEY_PAUSE_RECORD) - XLAT(KEY_PAUSE_RECORD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_PAUSE_RECORD) == (0x272), "KEY_PAUSE_RECORD != 0x272"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_PAUSE_RECORD 0x272 #endif #if defined(KEY_VOD) || (defined(HAVE_DECL_KEY_VOD) && HAVE_DECL_KEY_VOD) - XLAT(KEY_VOD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_VOD) == (0x273), "KEY_VOD != 0x273"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_VOD 0x273 #endif #if defined(KEY_UNMUTE) || (defined(HAVE_DECL_KEY_UNMUTE) && HAVE_DECL_KEY_UNMUTE) - XLAT(KEY_UNMUTE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_UNMUTE) == (0x274), "KEY_UNMUTE != 0x274"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_UNMUTE 0x274 #endif #if defined(KEY_FASTREVERSE) || (defined(HAVE_DECL_KEY_FASTREVERSE) && HAVE_DECL_KEY_FASTREVERSE) - XLAT(KEY_FASTREVERSE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_FASTREVERSE) == (0x275), "KEY_FASTREVERSE != 0x275"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_FASTREVERSE 0x275 #endif #if defined(KEY_SLOWREVERSE) || (defined(HAVE_DECL_KEY_SLOWREVERSE) && HAVE_DECL_KEY_SLOWREVERSE) - XLAT(KEY_SLOWREVERSE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SLOWREVERSE) == (0x276), "KEY_SLOWREVERSE != 0x276"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_SLOWREVERSE 0x276 #endif - -#if defined(BTN_TRIGGER_HAPPY) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY) && HAVE_DECL_BTN_TRIGGER_HAPPY) - XLAT(BTN_TRIGGER_HAPPY), +#ifndef STRACE_WORKAROUND_FOR_KEY_DATA +# define STRACE_WORKAROUND_FOR_KEY_DATA +# undef KEY_DATA +#endif +#if defined(KEY_DATA) || (defined(HAVE_DECL_KEY_DATA) && HAVE_DECL_KEY_DATA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_DATA) == (0x277), "KEY_DATA != 0x277"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_DATA 0x277 +#endif +#if defined(KEY_ONSCREEN_KEYBOARD) || (defined(HAVE_DECL_KEY_ONSCREEN_KEYBOARD) && HAVE_DECL_KEY_ONSCREEN_KEYBOARD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_ONSCREEN_KEYBOARD) == (0x278), "KEY_ONSCREEN_KEYBOARD != 0x278"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEY_ONSCREEN_KEYBOARD 0x278 #endif #if defined(BTN_TRIGGER_HAPPY1) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY1) && HAVE_DECL_BTN_TRIGGER_HAPPY1) - XLAT(BTN_TRIGGER_HAPPY1), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY1) == (0x2c0), "BTN_TRIGGER_HAPPY1 != 0x2c0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY1 0x2c0 #endif #if defined(BTN_TRIGGER_HAPPY2) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY2) && HAVE_DECL_BTN_TRIGGER_HAPPY2) - XLAT(BTN_TRIGGER_HAPPY2), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY2) == (0x2c1), "BTN_TRIGGER_HAPPY2 != 0x2c1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY2 0x2c1 #endif #if defined(BTN_TRIGGER_HAPPY3) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY3) && HAVE_DECL_BTN_TRIGGER_HAPPY3) - XLAT(BTN_TRIGGER_HAPPY3), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY3) == (0x2c2), "BTN_TRIGGER_HAPPY3 != 0x2c2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY3 0x2c2 #endif #if defined(BTN_TRIGGER_HAPPY4) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY4) && HAVE_DECL_BTN_TRIGGER_HAPPY4) - XLAT(BTN_TRIGGER_HAPPY4), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY4) == (0x2c3), "BTN_TRIGGER_HAPPY4 != 0x2c3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY4 0x2c3 #endif #if defined(BTN_TRIGGER_HAPPY5) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY5) && HAVE_DECL_BTN_TRIGGER_HAPPY5) - XLAT(BTN_TRIGGER_HAPPY5), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY5) == (0x2c4), "BTN_TRIGGER_HAPPY5 != 0x2c4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY5 0x2c4 #endif #if defined(BTN_TRIGGER_HAPPY6) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY6) && HAVE_DECL_BTN_TRIGGER_HAPPY6) - XLAT(BTN_TRIGGER_HAPPY6), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY6) == (0x2c5), "BTN_TRIGGER_HAPPY6 != 0x2c5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY6 0x2c5 #endif #if defined(BTN_TRIGGER_HAPPY7) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY7) && HAVE_DECL_BTN_TRIGGER_HAPPY7) - XLAT(BTN_TRIGGER_HAPPY7), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY7) == (0x2c6), "BTN_TRIGGER_HAPPY7 != 0x2c6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY7 0x2c6 #endif #if defined(BTN_TRIGGER_HAPPY8) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY8) && HAVE_DECL_BTN_TRIGGER_HAPPY8) - XLAT(BTN_TRIGGER_HAPPY8), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY8) == (0x2c7), "BTN_TRIGGER_HAPPY8 != 0x2c7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY8 0x2c7 #endif #if defined(BTN_TRIGGER_HAPPY9) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY9) && HAVE_DECL_BTN_TRIGGER_HAPPY9) - XLAT(BTN_TRIGGER_HAPPY9), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY9) == (0x2c8), "BTN_TRIGGER_HAPPY9 != 0x2c8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY9 0x2c8 #endif #if defined(BTN_TRIGGER_HAPPY10) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY10) && HAVE_DECL_BTN_TRIGGER_HAPPY10) - XLAT(BTN_TRIGGER_HAPPY10), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY10) == (0x2c9), "BTN_TRIGGER_HAPPY10 != 0x2c9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY10 0x2c9 #endif #if defined(BTN_TRIGGER_HAPPY11) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY11) && HAVE_DECL_BTN_TRIGGER_HAPPY11) - XLAT(BTN_TRIGGER_HAPPY11), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY11) == (0x2ca), "BTN_TRIGGER_HAPPY11 != 0x2ca"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY11 0x2ca #endif #if defined(BTN_TRIGGER_HAPPY12) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY12) && HAVE_DECL_BTN_TRIGGER_HAPPY12) - XLAT(BTN_TRIGGER_HAPPY12), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY12) == (0x2cb), "BTN_TRIGGER_HAPPY12 != 0x2cb"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY12 0x2cb #endif #if defined(BTN_TRIGGER_HAPPY13) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY13) && HAVE_DECL_BTN_TRIGGER_HAPPY13) - XLAT(BTN_TRIGGER_HAPPY13), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY13) == (0x2cc), "BTN_TRIGGER_HAPPY13 != 0x2cc"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY13 0x2cc #endif #if defined(BTN_TRIGGER_HAPPY14) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY14) && HAVE_DECL_BTN_TRIGGER_HAPPY14) - XLAT(BTN_TRIGGER_HAPPY14), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY14) == (0x2cd), "BTN_TRIGGER_HAPPY14 != 0x2cd"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY14 0x2cd #endif #if defined(BTN_TRIGGER_HAPPY15) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY15) && HAVE_DECL_BTN_TRIGGER_HAPPY15) - XLAT(BTN_TRIGGER_HAPPY15), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY15) == (0x2ce), "BTN_TRIGGER_HAPPY15 != 0x2ce"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY15 0x2ce #endif #if defined(BTN_TRIGGER_HAPPY16) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY16) && HAVE_DECL_BTN_TRIGGER_HAPPY16) - XLAT(BTN_TRIGGER_HAPPY16), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY16) == (0x2cf), "BTN_TRIGGER_HAPPY16 != 0x2cf"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY16 0x2cf #endif #if defined(BTN_TRIGGER_HAPPY17) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY17) && HAVE_DECL_BTN_TRIGGER_HAPPY17) - XLAT(BTN_TRIGGER_HAPPY17), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY17) == (0x2d0), "BTN_TRIGGER_HAPPY17 != 0x2d0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY17 0x2d0 #endif #if defined(BTN_TRIGGER_HAPPY18) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY18) && HAVE_DECL_BTN_TRIGGER_HAPPY18) - XLAT(BTN_TRIGGER_HAPPY18), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY18) == (0x2d1), "BTN_TRIGGER_HAPPY18 != 0x2d1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY18 0x2d1 #endif #if defined(BTN_TRIGGER_HAPPY19) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY19) && HAVE_DECL_BTN_TRIGGER_HAPPY19) - XLAT(BTN_TRIGGER_HAPPY19), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY19) == (0x2d2), "BTN_TRIGGER_HAPPY19 != 0x2d2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY19 0x2d2 #endif #if defined(BTN_TRIGGER_HAPPY20) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY20) && HAVE_DECL_BTN_TRIGGER_HAPPY20) - XLAT(BTN_TRIGGER_HAPPY20), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY20) == (0x2d3), "BTN_TRIGGER_HAPPY20 != 0x2d3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY20 0x2d3 #endif #if defined(BTN_TRIGGER_HAPPY21) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY21) && HAVE_DECL_BTN_TRIGGER_HAPPY21) - XLAT(BTN_TRIGGER_HAPPY21), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY21) == (0x2d4), "BTN_TRIGGER_HAPPY21 != 0x2d4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY21 0x2d4 #endif #if defined(BTN_TRIGGER_HAPPY22) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY22) && HAVE_DECL_BTN_TRIGGER_HAPPY22) - XLAT(BTN_TRIGGER_HAPPY22), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY22) == (0x2d5), "BTN_TRIGGER_HAPPY22 != 0x2d5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY22 0x2d5 #endif #if defined(BTN_TRIGGER_HAPPY23) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY23) && HAVE_DECL_BTN_TRIGGER_HAPPY23) - XLAT(BTN_TRIGGER_HAPPY23), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY23) == (0x2d6), "BTN_TRIGGER_HAPPY23 != 0x2d6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY23 0x2d6 #endif #if defined(BTN_TRIGGER_HAPPY24) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY24) && HAVE_DECL_BTN_TRIGGER_HAPPY24) - XLAT(BTN_TRIGGER_HAPPY24), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY24) == (0x2d7), "BTN_TRIGGER_HAPPY24 != 0x2d7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY24 0x2d7 #endif #if defined(BTN_TRIGGER_HAPPY25) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY25) && HAVE_DECL_BTN_TRIGGER_HAPPY25) - XLAT(BTN_TRIGGER_HAPPY25), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY25) == (0x2d8), "BTN_TRIGGER_HAPPY25 != 0x2d8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY25 0x2d8 #endif #if defined(BTN_TRIGGER_HAPPY26) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY26) && HAVE_DECL_BTN_TRIGGER_HAPPY26) - XLAT(BTN_TRIGGER_HAPPY26), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY26) == (0x2d9), "BTN_TRIGGER_HAPPY26 != 0x2d9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY26 0x2d9 #endif #if defined(BTN_TRIGGER_HAPPY27) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY27) && HAVE_DECL_BTN_TRIGGER_HAPPY27) - XLAT(BTN_TRIGGER_HAPPY27), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY27) == (0x2da), "BTN_TRIGGER_HAPPY27 != 0x2da"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY27 0x2da #endif #if defined(BTN_TRIGGER_HAPPY28) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY28) && HAVE_DECL_BTN_TRIGGER_HAPPY28) - XLAT(BTN_TRIGGER_HAPPY28), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY28) == (0x2db), "BTN_TRIGGER_HAPPY28 != 0x2db"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY28 0x2db #endif #if defined(BTN_TRIGGER_HAPPY29) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY29) && HAVE_DECL_BTN_TRIGGER_HAPPY29) - XLAT(BTN_TRIGGER_HAPPY29), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY29) == (0x2dc), "BTN_TRIGGER_HAPPY29 != 0x2dc"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY29 0x2dc #endif #if defined(BTN_TRIGGER_HAPPY30) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY30) && HAVE_DECL_BTN_TRIGGER_HAPPY30) - XLAT(BTN_TRIGGER_HAPPY30), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY30) == (0x2dd), "BTN_TRIGGER_HAPPY30 != 0x2dd"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY30 0x2dd #endif #if defined(BTN_TRIGGER_HAPPY31) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY31) && HAVE_DECL_BTN_TRIGGER_HAPPY31) - XLAT(BTN_TRIGGER_HAPPY31), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY31) == (0x2de), "BTN_TRIGGER_HAPPY31 != 0x2de"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY31 0x2de #endif #if defined(BTN_TRIGGER_HAPPY32) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY32) && HAVE_DECL_BTN_TRIGGER_HAPPY32) - XLAT(BTN_TRIGGER_HAPPY32), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY32) == (0x2df), "BTN_TRIGGER_HAPPY32 != 0x2df"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY32 0x2df #endif #if defined(BTN_TRIGGER_HAPPY33) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY33) && HAVE_DECL_BTN_TRIGGER_HAPPY33) - XLAT(BTN_TRIGGER_HAPPY33), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY33) == (0x2e0), "BTN_TRIGGER_HAPPY33 != 0x2e0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY33 0x2e0 #endif #if defined(BTN_TRIGGER_HAPPY34) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY34) && HAVE_DECL_BTN_TRIGGER_HAPPY34) - XLAT(BTN_TRIGGER_HAPPY34), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY34) == (0x2e1), "BTN_TRIGGER_HAPPY34 != 0x2e1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY34 0x2e1 #endif #if defined(BTN_TRIGGER_HAPPY35) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY35) && HAVE_DECL_BTN_TRIGGER_HAPPY35) - XLAT(BTN_TRIGGER_HAPPY35), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY35) == (0x2e2), "BTN_TRIGGER_HAPPY35 != 0x2e2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY35 0x2e2 #endif #if defined(BTN_TRIGGER_HAPPY36) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY36) && HAVE_DECL_BTN_TRIGGER_HAPPY36) - XLAT(BTN_TRIGGER_HAPPY36), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY36) == (0x2e3), "BTN_TRIGGER_HAPPY36 != 0x2e3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY36 0x2e3 #endif #if defined(BTN_TRIGGER_HAPPY37) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY37) && HAVE_DECL_BTN_TRIGGER_HAPPY37) - XLAT(BTN_TRIGGER_HAPPY37), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY37) == (0x2e4), "BTN_TRIGGER_HAPPY37 != 0x2e4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY37 0x2e4 #endif #if defined(BTN_TRIGGER_HAPPY38) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY38) && HAVE_DECL_BTN_TRIGGER_HAPPY38) - XLAT(BTN_TRIGGER_HAPPY38), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY38) == (0x2e5), "BTN_TRIGGER_HAPPY38 != 0x2e5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY38 0x2e5 #endif #if defined(BTN_TRIGGER_HAPPY39) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY39) && HAVE_DECL_BTN_TRIGGER_HAPPY39) - XLAT(BTN_TRIGGER_HAPPY39), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY39) == (0x2e6), "BTN_TRIGGER_HAPPY39 != 0x2e6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY39 0x2e6 #endif #if defined(BTN_TRIGGER_HAPPY40) || (defined(HAVE_DECL_BTN_TRIGGER_HAPPY40) && HAVE_DECL_BTN_TRIGGER_HAPPY40) - XLAT(BTN_TRIGGER_HAPPY40), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BTN_TRIGGER_HAPPY40) == (0x2e7), "BTN_TRIGGER_HAPPY40 != 0x2e7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BTN_TRIGGER_HAPPY40 0x2e7 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat evdev_keycode in mpers mode + +# else + +static +const struct xlat evdev_keycode[] = { + + [KEY_RESERVED] = XLAT(KEY_RESERVED), + [KEY_ESC] = XLAT(KEY_ESC), + [KEY_1] = XLAT(KEY_1), + [KEY_2] = XLAT(KEY_2), + [KEY_3] = XLAT(KEY_3), + [KEY_4] = XLAT(KEY_4), + [KEY_5] = XLAT(KEY_5), + [KEY_6] = XLAT(KEY_6), + [KEY_7] = XLAT(KEY_7), + [KEY_8] = XLAT(KEY_8), + [KEY_9] = XLAT(KEY_9), + [KEY_0] = XLAT(KEY_0), + [KEY_MINUS] = XLAT(KEY_MINUS), + [KEY_EQUAL] = XLAT(KEY_EQUAL), + [KEY_BACKSPACE] = XLAT(KEY_BACKSPACE), + [KEY_TAB] = XLAT(KEY_TAB), + [KEY_Q] = XLAT(KEY_Q), + [KEY_W] = XLAT(KEY_W), + [KEY_E] = XLAT(KEY_E), + [KEY_R] = XLAT(KEY_R), + [KEY_T] = XLAT(KEY_T), + [KEY_Y] = XLAT(KEY_Y), + [KEY_U] = XLAT(KEY_U), + [KEY_I] = XLAT(KEY_I), + [KEY_O] = XLAT(KEY_O), + [KEY_P] = XLAT(KEY_P), + [KEY_LEFTBRACE] = XLAT(KEY_LEFTBRACE), + [KEY_RIGHTBRACE] = XLAT(KEY_RIGHTBRACE), + [KEY_ENTER] = XLAT(KEY_ENTER), + [KEY_LEFTCTRL] = XLAT(KEY_LEFTCTRL), + [KEY_A] = XLAT(KEY_A), + [KEY_S] = XLAT(KEY_S), + [KEY_D] = XLAT(KEY_D), + [KEY_F] = XLAT(KEY_F), + [KEY_G] = XLAT(KEY_G), + [KEY_H] = XLAT(KEY_H), + [KEY_J] = XLAT(KEY_J), + [KEY_K] = XLAT(KEY_K), + [KEY_L] = XLAT(KEY_L), + [KEY_SEMICOLON] = XLAT(KEY_SEMICOLON), + [KEY_APOSTROPHE] = XLAT(KEY_APOSTROPHE), + [KEY_GRAVE] = XLAT(KEY_GRAVE), + [KEY_LEFTSHIFT] = XLAT(KEY_LEFTSHIFT), + [KEY_BACKSLASH] = XLAT(KEY_BACKSLASH), + [KEY_Z] = XLAT(KEY_Z), + [KEY_X] = XLAT(KEY_X), + [KEY_C] = XLAT(KEY_C), + [KEY_V] = XLAT(KEY_V), + [KEY_B] = XLAT(KEY_B), + [KEY_N] = XLAT(KEY_N), + [KEY_M] = XLAT(KEY_M), + [KEY_COMMA] = XLAT(KEY_COMMA), + [KEY_DOT] = XLAT(KEY_DOT), + [KEY_SLASH] = XLAT(KEY_SLASH), + [KEY_RIGHTSHIFT] = XLAT(KEY_RIGHTSHIFT), + [KEY_KPASTERISK] = XLAT(KEY_KPASTERISK), + [KEY_LEFTALT] = XLAT(KEY_LEFTALT), + [KEY_SPACE] = XLAT(KEY_SPACE), + [KEY_CAPSLOCK] = XLAT(KEY_CAPSLOCK), + [KEY_F1] = XLAT(KEY_F1), + [KEY_F2] = XLAT(KEY_F2), + [KEY_F3] = XLAT(KEY_F3), + [KEY_F4] = XLAT(KEY_F4), + [KEY_F5] = XLAT(KEY_F5), + [KEY_F6] = XLAT(KEY_F6), + [KEY_F7] = XLAT(KEY_F7), + [KEY_F8] = XLAT(KEY_F8), + [KEY_F9] = XLAT(KEY_F9), + [KEY_F10] = XLAT(KEY_F10), + [KEY_NUMLOCK] = XLAT(KEY_NUMLOCK), + [KEY_SCROLLLOCK] = XLAT(KEY_SCROLLLOCK), + [KEY_KP7] = XLAT(KEY_KP7), + [KEY_KP8] = XLAT(KEY_KP8), + [KEY_KP9] = XLAT(KEY_KP9), + [KEY_KPMINUS] = XLAT(KEY_KPMINUS), + [KEY_KP4] = XLAT(KEY_KP4), + [KEY_KP5] = XLAT(KEY_KP5), + [KEY_KP6] = XLAT(KEY_KP6), + [KEY_KPPLUS] = XLAT(KEY_KPPLUS), + [KEY_KP1] = XLAT(KEY_KP1), + [KEY_KP2] = XLAT(KEY_KP2), + [KEY_KP3] = XLAT(KEY_KP3), + [KEY_KP0] = XLAT(KEY_KP0), + [KEY_KPDOT] = XLAT(KEY_KPDOT), + + [KEY_ZENKAKUHANKAKU] = XLAT(KEY_ZENKAKUHANKAKU), + [KEY_102ND] = XLAT(KEY_102ND), + [KEY_F11] = XLAT(KEY_F11), + [KEY_F12] = XLAT(KEY_F12), + [KEY_RO] = XLAT(KEY_RO), + [KEY_KATAKANA] = XLAT(KEY_KATAKANA), + [KEY_HIRAGANA] = XLAT(KEY_HIRAGANA), + [KEY_HENKAN] = XLAT(KEY_HENKAN), + [KEY_KATAKANAHIRAGANA] = XLAT(KEY_KATAKANAHIRAGANA), + [KEY_MUHENKAN] = XLAT(KEY_MUHENKAN), + [KEY_KPJPCOMMA] = XLAT(KEY_KPJPCOMMA), + [KEY_KPENTER] = XLAT(KEY_KPENTER), + [KEY_RIGHTCTRL] = XLAT(KEY_RIGHTCTRL), + [KEY_KPSLASH] = XLAT(KEY_KPSLASH), + [KEY_SYSRQ] = XLAT(KEY_SYSRQ), + [KEY_RIGHTALT] = XLAT(KEY_RIGHTALT), + [KEY_LINEFEED] = XLAT(KEY_LINEFEED), + [KEY_HOME] = XLAT(KEY_HOME), + [KEY_UP] = XLAT(KEY_UP), + [KEY_PAGEUP] = XLAT(KEY_PAGEUP), + [KEY_LEFT] = XLAT(KEY_LEFT), + [KEY_RIGHT] = XLAT(KEY_RIGHT), + [KEY_END] = XLAT(KEY_END), + [KEY_DOWN] = XLAT(KEY_DOWN), + [KEY_PAGEDOWN] = XLAT(KEY_PAGEDOWN), + [KEY_INSERT] = XLAT(KEY_INSERT), + [KEY_DELETE] = XLAT(KEY_DELETE), + [KEY_MACRO] = XLAT(KEY_MACRO), + [KEY_MUTE] = XLAT(KEY_MUTE), + [KEY_VOLUMEDOWN] = XLAT(KEY_VOLUMEDOWN), + [KEY_VOLUMEUP] = XLAT(KEY_VOLUMEUP), + [KEY_POWER] = XLAT(KEY_POWER), + [KEY_KPEQUAL] = XLAT(KEY_KPEQUAL), + [KEY_KPPLUSMINUS] = XLAT(KEY_KPPLUSMINUS), + [KEY_PAUSE] = XLAT(KEY_PAUSE), + [KEY_SCALE] = XLAT(KEY_SCALE), + + [KEY_KPCOMMA] = XLAT(KEY_KPCOMMA), + [KEY_HANGEUL] = XLAT(KEY_HANGEUL), + [KEY_HANJA] = XLAT(KEY_HANJA), + [KEY_YEN] = XLAT(KEY_YEN), + [KEY_LEFTMETA] = XLAT(KEY_LEFTMETA), + [KEY_RIGHTMETA] = XLAT(KEY_RIGHTMETA), + [KEY_COMPOSE] = XLAT(KEY_COMPOSE), + + [KEY_STOP] = XLAT(KEY_STOP), + [KEY_AGAIN] = XLAT(KEY_AGAIN), + [KEY_PROPS] = XLAT(KEY_PROPS), + [KEY_UNDO] = XLAT(KEY_UNDO), + [KEY_FRONT] = XLAT(KEY_FRONT), + [KEY_COPY] = XLAT(KEY_COPY), + [KEY_OPEN] = XLAT(KEY_OPEN), + [KEY_PASTE] = XLAT(KEY_PASTE), + [KEY_FIND] = XLAT(KEY_FIND), + [KEY_CUT] = XLAT(KEY_CUT), + [KEY_HELP] = XLAT(KEY_HELP), + [KEY_MENU] = XLAT(KEY_MENU), + [KEY_CALC] = XLAT(KEY_CALC), + [KEY_SETUP] = XLAT(KEY_SETUP), + [KEY_SLEEP] = XLAT(KEY_SLEEP), + [KEY_WAKEUP] = XLAT(KEY_WAKEUP), + [KEY_FILE] = XLAT(KEY_FILE), + [KEY_SENDFILE] = XLAT(KEY_SENDFILE), + [KEY_DELETEFILE] = XLAT(KEY_DELETEFILE), + [KEY_XFER] = XLAT(KEY_XFER), + [KEY_PROG1] = XLAT(KEY_PROG1), + [KEY_PROG2] = XLAT(KEY_PROG2), + [KEY_WWW] = XLAT(KEY_WWW), + [KEY_MSDOS] = XLAT(KEY_MSDOS), + [KEY_COFFEE] = XLAT(KEY_COFFEE), + [KEY_ROTATE_DISPLAY] = XLAT(KEY_ROTATE_DISPLAY), + [KEY_CYCLEWINDOWS] = XLAT(KEY_CYCLEWINDOWS), + [KEY_MAIL] = XLAT(KEY_MAIL), + [KEY_BOOKMARKS] = XLAT(KEY_BOOKMARKS), + [KEY_COMPUTER] = XLAT(KEY_COMPUTER), + [KEY_BACK] = XLAT(KEY_BACK), + [KEY_FORWARD] = XLAT(KEY_FORWARD), + [KEY_CLOSECD] = XLAT(KEY_CLOSECD), + [KEY_EJECTCD] = XLAT(KEY_EJECTCD), + [KEY_EJECTCLOSECD] = XLAT(KEY_EJECTCLOSECD), + [KEY_NEXTSONG] = XLAT(KEY_NEXTSONG), + [KEY_PLAYPAUSE] = XLAT(KEY_PLAYPAUSE), + [KEY_PREVIOUSSONG] = XLAT(KEY_PREVIOUSSONG), + [KEY_STOPCD] = XLAT(KEY_STOPCD), + [KEY_RECORD] = XLAT(KEY_RECORD), + [KEY_REWIND] = XLAT(KEY_REWIND), + [KEY_PHONE] = XLAT(KEY_PHONE), + [KEY_ISO] = XLAT(KEY_ISO), + [KEY_CONFIG] = XLAT(KEY_CONFIG), + [KEY_HOMEPAGE] = XLAT(KEY_HOMEPAGE), + [KEY_REFRESH] = XLAT(KEY_REFRESH), + [KEY_EXIT] = XLAT(KEY_EXIT), + [KEY_MOVE] = XLAT(KEY_MOVE), + [KEY_EDIT] = XLAT(KEY_EDIT), + [KEY_SCROLLUP] = XLAT(KEY_SCROLLUP), + [KEY_SCROLLDOWN] = XLAT(KEY_SCROLLDOWN), + [KEY_KPLEFTPAREN] = XLAT(KEY_KPLEFTPAREN), + [KEY_KPRIGHTPAREN] = XLAT(KEY_KPRIGHTPAREN), + [KEY_NEW] = XLAT(KEY_NEW), + [KEY_REDO] = XLAT(KEY_REDO), + + [KEY_F13] = XLAT(KEY_F13), + [KEY_F14] = XLAT(KEY_F14), + [KEY_F15] = XLAT(KEY_F15), + [KEY_F16] = XLAT(KEY_F16), + [KEY_F17] = XLAT(KEY_F17), + [KEY_F18] = XLAT(KEY_F18), + [KEY_F19] = XLAT(KEY_F19), + [KEY_F20] = XLAT(KEY_F20), + [KEY_F21] = XLAT(KEY_F21), + [KEY_F22] = XLAT(KEY_F22), + [KEY_F23] = XLAT(KEY_F23), + [KEY_F24] = XLAT(KEY_F24), + + [KEY_PLAYCD] = XLAT(KEY_PLAYCD), + [KEY_PAUSECD] = XLAT(KEY_PAUSECD), + [KEY_PROG3] = XLAT(KEY_PROG3), + [KEY_PROG4] = XLAT(KEY_PROG4), + [KEY_DASHBOARD] = XLAT(KEY_DASHBOARD), + [KEY_SUSPEND] = XLAT(KEY_SUSPEND), + [KEY_CLOSE] = XLAT(KEY_CLOSE), + [KEY_PLAY] = XLAT(KEY_PLAY), + [KEY_FASTFORWARD] = XLAT(KEY_FASTFORWARD), + [KEY_BASSBOOST] = XLAT(KEY_BASSBOOST), + [KEY_PRINT] = XLAT(KEY_PRINT), + [KEY_HP] = XLAT(KEY_HP), + [KEY_CAMERA] = XLAT(KEY_CAMERA), + [KEY_SOUND] = XLAT(KEY_SOUND), + [KEY_QUESTION] = XLAT(KEY_QUESTION), + [KEY_EMAIL] = XLAT(KEY_EMAIL), + [KEY_CHAT] = XLAT(KEY_CHAT), + [KEY_SEARCH] = XLAT(KEY_SEARCH), + [KEY_CONNECT] = XLAT(KEY_CONNECT), + [KEY_FINANCE] = XLAT(KEY_FINANCE), + [KEY_SPORT] = XLAT(KEY_SPORT), + [KEY_SHOP] = XLAT(KEY_SHOP), + [KEY_ALTERASE] = XLAT(KEY_ALTERASE), + [KEY_CANCEL] = XLAT(KEY_CANCEL), + [KEY_BRIGHTNESSDOWN] = XLAT(KEY_BRIGHTNESSDOWN), + [KEY_BRIGHTNESSUP] = XLAT(KEY_BRIGHTNESSUP), + [KEY_MEDIA] = XLAT(KEY_MEDIA), + + [KEY_SWITCHVIDEOMODE] = XLAT(KEY_SWITCHVIDEOMODE), + + [KEY_KBDILLUMTOGGLE] = XLAT(KEY_KBDILLUMTOGGLE), + [KEY_KBDILLUMDOWN] = XLAT(KEY_KBDILLUMDOWN), + [KEY_KBDILLUMUP] = XLAT(KEY_KBDILLUMUP), + + [KEY_SEND] = XLAT(KEY_SEND), + [KEY_REPLY] = XLAT(KEY_REPLY), + [KEY_FORWARDMAIL] = XLAT(KEY_FORWARDMAIL), + [KEY_SAVE] = XLAT(KEY_SAVE), + [KEY_DOCUMENTS] = XLAT(KEY_DOCUMENTS), + + [KEY_BATTERY] = XLAT(KEY_BATTERY), + + [KEY_BLUETOOTH] = XLAT(KEY_BLUETOOTH), + [KEY_WLAN] = XLAT(KEY_WLAN), + [KEY_UWB] = XLAT(KEY_UWB), + + [KEY_UNKNOWN] = XLAT(KEY_UNKNOWN), + + [KEY_VIDEO_NEXT] = XLAT(KEY_VIDEO_NEXT), + [KEY_VIDEO_PREV] = XLAT(KEY_VIDEO_PREV), + [KEY_BRIGHTNESS_CYCLE] = XLAT(KEY_BRIGHTNESS_CYCLE), + [KEY_BRIGHTNESS_AUTO] = XLAT(KEY_BRIGHTNESS_AUTO), + [KEY_DISPLAY_OFF] = XLAT(KEY_DISPLAY_OFF), + + [KEY_WWAN] = XLAT(KEY_WWAN), + +#ifndef STRACE_WORKAROUND_FOR_KEY_RFKILL +# define STRACE_WORKAROUND_FOR_KEY_RFKILL +/* +* KEY_RFKILL and KEY_NUMERIC_A constants were introduced by Linux kernel +* commits v2.6.33~17^2~2 and v4.1-rc1~150^2~1^10~6, respectively. +* Apparently, RHEL6 introduced an alternative KEY_RFKILL constant +* with the same value as upstream KEY_NUMERIC_A. +* Downstream vendors are *not* allowed to do this. +* Ignore the system value of KEY_RFKILL. +*/ +# undef KEY_RFKILL +#endif + [KEY_RFKILL] = XLAT(KEY_RFKILL), + + [KEY_MICMUTE] = XLAT(KEY_MICMUTE), + + [BTN_0] = XLAT(BTN_0), + [BTN_1] = XLAT(BTN_1), + [BTN_2] = XLAT(BTN_2), + [BTN_3] = XLAT(BTN_3), + [BTN_4] = XLAT(BTN_4), + [BTN_5] = XLAT(BTN_5), + [BTN_6] = XLAT(BTN_6), + [BTN_7] = XLAT(BTN_7), + [BTN_8] = XLAT(BTN_8), + [BTN_9] = XLAT(BTN_9), + + [BTN_LEFT] = XLAT(BTN_LEFT), + [BTN_RIGHT] = XLAT(BTN_RIGHT), + [BTN_MIDDLE] = XLAT(BTN_MIDDLE), + [BTN_SIDE] = XLAT(BTN_SIDE), + [BTN_EXTRA] = XLAT(BTN_EXTRA), + [BTN_FORWARD] = XLAT(BTN_FORWARD), + [BTN_BACK] = XLAT(BTN_BACK), + [BTN_TASK] = XLAT(BTN_TASK), + + [BTN_TRIGGER] = XLAT(BTN_TRIGGER), + [BTN_THUMB] = XLAT(BTN_THUMB), + [BTN_THUMB2] = XLAT(BTN_THUMB2), + [BTN_TOP] = XLAT(BTN_TOP), + [BTN_TOP2] = XLAT(BTN_TOP2), + [BTN_PINKIE] = XLAT(BTN_PINKIE), + [BTN_BASE] = XLAT(BTN_BASE), + [BTN_BASE2] = XLAT(BTN_BASE2), + [BTN_BASE3] = XLAT(BTN_BASE3), + [BTN_BASE4] = XLAT(BTN_BASE4), + [BTN_BASE5] = XLAT(BTN_BASE5), + [BTN_BASE6] = XLAT(BTN_BASE6), + [BTN_DEAD] = XLAT(BTN_DEAD), + + [BTN_SOUTH] = XLAT(BTN_SOUTH), + [BTN_EAST] = XLAT(BTN_EAST), + [BTN_C] = XLAT(BTN_C), + [BTN_NORTH] = XLAT(BTN_NORTH), + [BTN_WEST] = XLAT(BTN_WEST), + [BTN_Z] = XLAT(BTN_Z), + [BTN_TL] = XLAT(BTN_TL), + [BTN_TR] = XLAT(BTN_TR), + [BTN_TL2] = XLAT(BTN_TL2), + [BTN_TR2] = XLAT(BTN_TR2), + [BTN_SELECT] = XLAT(BTN_SELECT), + [BTN_START] = XLAT(BTN_START), + [BTN_MODE] = XLAT(BTN_MODE), + [BTN_THUMBL] = XLAT(BTN_THUMBL), + [BTN_THUMBR] = XLAT(BTN_THUMBR), + + [BTN_TOOL_PEN] = XLAT(BTN_TOOL_PEN), + [BTN_TOOL_RUBBER] = XLAT(BTN_TOOL_RUBBER), + [BTN_TOOL_BRUSH] = XLAT(BTN_TOOL_BRUSH), + [BTN_TOOL_PENCIL] = XLAT(BTN_TOOL_PENCIL), + [BTN_TOOL_AIRBRUSH] = XLAT(BTN_TOOL_AIRBRUSH), + [BTN_TOOL_FINGER] = XLAT(BTN_TOOL_FINGER), + [BTN_TOOL_MOUSE] = XLAT(BTN_TOOL_MOUSE), + [BTN_TOOL_LENS] = XLAT(BTN_TOOL_LENS), + [BTN_TOOL_QUINTTAP] = XLAT(BTN_TOOL_QUINTTAP), + [BTN_STYLUS3] = XLAT(BTN_STYLUS3), + [BTN_TOUCH] = XLAT(BTN_TOUCH), + [BTN_STYLUS] = XLAT(BTN_STYLUS), + [BTN_STYLUS2] = XLAT(BTN_STYLUS2), + [BTN_TOOL_DOUBLETAP] = XLAT(BTN_TOOL_DOUBLETAP), + [BTN_TOOL_TRIPLETAP] = XLAT(BTN_TOOL_TRIPLETAP), + [BTN_TOOL_QUADTAP] = XLAT(BTN_TOOL_QUADTAP), + + [BTN_GEAR_DOWN] = XLAT(BTN_GEAR_DOWN), + [BTN_GEAR_UP] = XLAT(BTN_GEAR_UP), + + [KEY_OK] = XLAT(KEY_OK), + [KEY_SELECT] = XLAT(KEY_SELECT), + [KEY_GOTO] = XLAT(KEY_GOTO), + [KEY_CLEAR] = XLAT(KEY_CLEAR), + [KEY_POWER2] = XLAT(KEY_POWER2), + [KEY_OPTION] = XLAT(KEY_OPTION), + [KEY_INFO] = XLAT(KEY_INFO), + [KEY_TIME] = XLAT(KEY_TIME), + [KEY_VENDOR] = XLAT(KEY_VENDOR), + [KEY_ARCHIVE] = XLAT(KEY_ARCHIVE), + [KEY_PROGRAM] = XLAT(KEY_PROGRAM), + [KEY_CHANNEL] = XLAT(KEY_CHANNEL), + [KEY_FAVORITES] = XLAT(KEY_FAVORITES), + [KEY_EPG] = XLAT(KEY_EPG), + [KEY_PVR] = XLAT(KEY_PVR), + [KEY_MHP] = XLAT(KEY_MHP), + [KEY_LANGUAGE] = XLAT(KEY_LANGUAGE), + [KEY_TITLE] = XLAT(KEY_TITLE), + [KEY_SUBTITLE] = XLAT(KEY_SUBTITLE), + [KEY_ANGLE] = XLAT(KEY_ANGLE), + [KEY_ZOOM] = XLAT(KEY_ZOOM), + [KEY_MODE] = XLAT(KEY_MODE), + [KEY_KEYBOARD] = XLAT(KEY_KEYBOARD), + [KEY_SCREEN] = XLAT(KEY_SCREEN), + [KEY_PC] = XLAT(KEY_PC), + [KEY_TV] = XLAT(KEY_TV), + [KEY_TV2] = XLAT(KEY_TV2), + [KEY_VCR] = XLAT(KEY_VCR), + [KEY_VCR2] = XLAT(KEY_VCR2), + [KEY_SAT] = XLAT(KEY_SAT), + [KEY_SAT2] = XLAT(KEY_SAT2), + [KEY_CD] = XLAT(KEY_CD), + [KEY_TAPE] = XLAT(KEY_TAPE), + [KEY_RADIO] = XLAT(KEY_RADIO), + [KEY_TUNER] = XLAT(KEY_TUNER), + [KEY_PLAYER] = XLAT(KEY_PLAYER), + [KEY_TEXT] = XLAT(KEY_TEXT), + [KEY_DVD] = XLAT(KEY_DVD), + [KEY_AUX] = XLAT(KEY_AUX), + [KEY_MP3] = XLAT(KEY_MP3), + [KEY_AUDIO] = XLAT(KEY_AUDIO), + [KEY_VIDEO] = XLAT(KEY_VIDEO), + [KEY_DIRECTORY] = XLAT(KEY_DIRECTORY), + [KEY_LIST] = XLAT(KEY_LIST), + [KEY_MEMO] = XLAT(KEY_MEMO), + [KEY_CALENDAR] = XLAT(KEY_CALENDAR), + [KEY_RED] = XLAT(KEY_RED), + [KEY_GREEN] = XLAT(KEY_GREEN), + [KEY_YELLOW] = XLAT(KEY_YELLOW), + [KEY_BLUE] = XLAT(KEY_BLUE), + [KEY_CHANNELUP] = XLAT(KEY_CHANNELUP), + [KEY_CHANNELDOWN] = XLAT(KEY_CHANNELDOWN), + [KEY_FIRST] = XLAT(KEY_FIRST), + [KEY_LAST] = XLAT(KEY_LAST), + [KEY_AB] = XLAT(KEY_AB), + [KEY_NEXT] = XLAT(KEY_NEXT), + [KEY_RESTART] = XLAT(KEY_RESTART), + [KEY_SLOW] = XLAT(KEY_SLOW), + [KEY_SHUFFLE] = XLAT(KEY_SHUFFLE), + [KEY_BREAK] = XLAT(KEY_BREAK), + [KEY_PREVIOUS] = XLAT(KEY_PREVIOUS), + [KEY_DIGITS] = XLAT(KEY_DIGITS), + [KEY_TEEN] = XLAT(KEY_TEEN), + [KEY_TWEN] = XLAT(KEY_TWEN), + [KEY_VIDEOPHONE] = XLAT(KEY_VIDEOPHONE), + [KEY_GAMES] = XLAT(KEY_GAMES), + [KEY_ZOOMIN] = XLAT(KEY_ZOOMIN), + [KEY_ZOOMOUT] = XLAT(KEY_ZOOMOUT), + [KEY_ZOOMRESET] = XLAT(KEY_ZOOMRESET), + [KEY_WORDPROCESSOR] = XLAT(KEY_WORDPROCESSOR), + [KEY_EDITOR] = XLAT(KEY_EDITOR), + [KEY_SPREADSHEET] = XLAT(KEY_SPREADSHEET), + [KEY_GRAPHICSEDITOR] = XLAT(KEY_GRAPHICSEDITOR), + [KEY_PRESENTATION] = XLAT(KEY_PRESENTATION), + [KEY_DATABASE] = XLAT(KEY_DATABASE), + [KEY_NEWS] = XLAT(KEY_NEWS), + [KEY_VOICEMAIL] = XLAT(KEY_VOICEMAIL), + [KEY_ADDRESSBOOK] = XLAT(KEY_ADDRESSBOOK), + [KEY_MESSENGER] = XLAT(KEY_MESSENGER), + [KEY_DISPLAYTOGGLE] = XLAT(KEY_DISPLAYTOGGLE), + [KEY_SPELLCHECK] = XLAT(KEY_SPELLCHECK), + [KEY_LOGOFF] = XLAT(KEY_LOGOFF), + + [KEY_DOLLAR] = XLAT(KEY_DOLLAR), + [KEY_EURO] = XLAT(KEY_EURO), + + [KEY_FRAMEBACK] = XLAT(KEY_FRAMEBACK), + [KEY_FRAMEFORWARD] = XLAT(KEY_FRAMEFORWARD), + [KEY_CONTEXT_MENU] = XLAT(KEY_CONTEXT_MENU), + [KEY_MEDIA_REPEAT] = XLAT(KEY_MEDIA_REPEAT), + [KEY_10CHANNELSUP] = XLAT(KEY_10CHANNELSUP), + [KEY_10CHANNELSDOWN] = XLAT(KEY_10CHANNELSDOWN), + [KEY_IMAGES] = XLAT(KEY_IMAGES), + + [KEY_DEL_EOL] = XLAT(KEY_DEL_EOL), + [KEY_DEL_EOS] = XLAT(KEY_DEL_EOS), + [KEY_INS_LINE] = XLAT(KEY_INS_LINE), + [KEY_DEL_LINE] = XLAT(KEY_DEL_LINE), + + [KEY_FN] = XLAT(KEY_FN), + [KEY_FN_ESC] = XLAT(KEY_FN_ESC), + [KEY_FN_F1] = XLAT(KEY_FN_F1), + [KEY_FN_F2] = XLAT(KEY_FN_F2), + [KEY_FN_F3] = XLAT(KEY_FN_F3), + [KEY_FN_F4] = XLAT(KEY_FN_F4), + [KEY_FN_F5] = XLAT(KEY_FN_F5), + [KEY_FN_F6] = XLAT(KEY_FN_F6), + [KEY_FN_F7] = XLAT(KEY_FN_F7), + [KEY_FN_F8] = XLAT(KEY_FN_F8), + [KEY_FN_F9] = XLAT(KEY_FN_F9), + [KEY_FN_F10] = XLAT(KEY_FN_F10), + [KEY_FN_F11] = XLAT(KEY_FN_F11), + [KEY_FN_F12] = XLAT(KEY_FN_F12), + [KEY_FN_1] = XLAT(KEY_FN_1), + [KEY_FN_2] = XLAT(KEY_FN_2), + [KEY_FN_D] = XLAT(KEY_FN_D), + [KEY_FN_E] = XLAT(KEY_FN_E), + [KEY_FN_F] = XLAT(KEY_FN_F), + [KEY_FN_S] = XLAT(KEY_FN_S), + [KEY_FN_B] = XLAT(KEY_FN_B), + + [KEY_BRL_DOT1] = XLAT(KEY_BRL_DOT1), + [KEY_BRL_DOT2] = XLAT(KEY_BRL_DOT2), + [KEY_BRL_DOT3] = XLAT(KEY_BRL_DOT3), + [KEY_BRL_DOT4] = XLAT(KEY_BRL_DOT4), + [KEY_BRL_DOT5] = XLAT(KEY_BRL_DOT5), + [KEY_BRL_DOT6] = XLAT(KEY_BRL_DOT6), + [KEY_BRL_DOT7] = XLAT(KEY_BRL_DOT7), + [KEY_BRL_DOT8] = XLAT(KEY_BRL_DOT8), + [KEY_BRL_DOT9] = XLAT(KEY_BRL_DOT9), + [KEY_BRL_DOT10] = XLAT(KEY_BRL_DOT10), + + [KEY_NUMERIC_0] = XLAT(KEY_NUMERIC_0), + [KEY_NUMERIC_1] = XLAT(KEY_NUMERIC_1), + [KEY_NUMERIC_2] = XLAT(KEY_NUMERIC_2), + [KEY_NUMERIC_3] = XLAT(KEY_NUMERIC_3), + [KEY_NUMERIC_4] = XLAT(KEY_NUMERIC_4), + [KEY_NUMERIC_5] = XLAT(KEY_NUMERIC_5), + [KEY_NUMERIC_6] = XLAT(KEY_NUMERIC_6), + [KEY_NUMERIC_7] = XLAT(KEY_NUMERIC_7), + [KEY_NUMERIC_8] = XLAT(KEY_NUMERIC_8), + [KEY_NUMERIC_9] = XLAT(KEY_NUMERIC_9), + [KEY_NUMERIC_STAR] = XLAT(KEY_NUMERIC_STAR), + [KEY_NUMERIC_POUND] = XLAT(KEY_NUMERIC_POUND), + [KEY_NUMERIC_A] = XLAT(KEY_NUMERIC_A), + [KEY_NUMERIC_B] = XLAT(KEY_NUMERIC_B), + [KEY_NUMERIC_C] = XLAT(KEY_NUMERIC_C), + [KEY_NUMERIC_D] = XLAT(KEY_NUMERIC_D), + + [KEY_CAMERA_FOCUS] = XLAT(KEY_CAMERA_FOCUS), + [KEY_WPS_BUTTON] = XLAT(KEY_WPS_BUTTON), + + [KEY_TOUCHPAD_TOGGLE] = XLAT(KEY_TOUCHPAD_TOGGLE), + [KEY_TOUCHPAD_ON] = XLAT(KEY_TOUCHPAD_ON), + [KEY_TOUCHPAD_OFF] = XLAT(KEY_TOUCHPAD_OFF), + + [KEY_CAMERA_ZOOMIN] = XLAT(KEY_CAMERA_ZOOMIN), + [KEY_CAMERA_ZOOMOUT] = XLAT(KEY_CAMERA_ZOOMOUT), + [KEY_CAMERA_UP] = XLAT(KEY_CAMERA_UP), + [KEY_CAMERA_DOWN] = XLAT(KEY_CAMERA_DOWN), + [KEY_CAMERA_LEFT] = XLAT(KEY_CAMERA_LEFT), + [KEY_CAMERA_RIGHT] = XLAT(KEY_CAMERA_RIGHT), + + [KEY_ATTENDANT_ON] = XLAT(KEY_ATTENDANT_ON), + [KEY_ATTENDANT_OFF] = XLAT(KEY_ATTENDANT_OFF), + [KEY_ATTENDANT_TOGGLE] = XLAT(KEY_ATTENDANT_TOGGLE), + [KEY_LIGHTS_TOGGLE] = XLAT(KEY_LIGHTS_TOGGLE), + + [BTN_DPAD_UP] = XLAT(BTN_DPAD_UP), + [BTN_DPAD_DOWN] = XLAT(BTN_DPAD_DOWN), + [BTN_DPAD_LEFT] = XLAT(BTN_DPAD_LEFT), + [BTN_DPAD_RIGHT] = XLAT(BTN_DPAD_RIGHT), + + [KEY_ALS_TOGGLE] = XLAT(KEY_ALS_TOGGLE), + [KEY_ROTATE_LOCK_TOGGLE] = XLAT(KEY_ROTATE_LOCK_TOGGLE), + + [KEY_BUTTONCONFIG] = XLAT(KEY_BUTTONCONFIG), + [KEY_TASKMANAGER] = XLAT(KEY_TASKMANAGER), + [KEY_JOURNAL] = XLAT(KEY_JOURNAL), + [KEY_CONTROLPANEL] = XLAT(KEY_CONTROLPANEL), + [KEY_APPSELECT] = XLAT(KEY_APPSELECT), + [KEY_SCREENSAVER] = XLAT(KEY_SCREENSAVER), + [KEY_VOICECOMMAND] = XLAT(KEY_VOICECOMMAND), + [KEY_ASSISTANT] = XLAT(KEY_ASSISTANT), + +#ifndef STRACE_WORKAROUND_FOR_KEY_BRIGHTNESS_MIN +# define STRACE_WORKAROUND_FOR_KEY_BRIGHTNESS_MIN +/* +* KEY_BRIGHTNESS_MIN and KEY_BRIGHTNESS_MAX constants were introduced +* by Linux kernel commit v3.16-rc1~30^2~6^2~1^2~7. +* Apparently, RHEL7 introduced an alternative KEY_BRIGHTNESS_MIN constant +* with the same value as upstream KEY_BRIGHTNESS_MAX. +* Downstream vendors are *not* allowed to do this. +* Ignore the system value of KEY_BRIGHTNESS_MIN. +*/ +# undef KEY_BRIGHTNESS_MIN +#endif + [KEY_BRIGHTNESS_MIN] = XLAT(KEY_BRIGHTNESS_MIN), + + [KEY_BRIGHTNESS_MAX] = XLAT(KEY_BRIGHTNESS_MAX), + + [KEY_KBDINPUTASSIST_PREV] = XLAT(KEY_KBDINPUTASSIST_PREV), + [KEY_KBDINPUTASSIST_NEXT] = XLAT(KEY_KBDINPUTASSIST_NEXT), + [KEY_KBDINPUTASSIST_PREVGROUP] = XLAT(KEY_KBDINPUTASSIST_PREVGROUP), + [KEY_KBDINPUTASSIST_NEXTGROUP] = XLAT(KEY_KBDINPUTASSIST_NEXTGROUP), + [KEY_KBDINPUTASSIST_ACCEPT] = XLAT(KEY_KBDINPUTASSIST_ACCEPT), + [KEY_KBDINPUTASSIST_CANCEL] = XLAT(KEY_KBDINPUTASSIST_CANCEL), + + [KEY_RIGHT_UP] = XLAT(KEY_RIGHT_UP), + [KEY_RIGHT_DOWN] = XLAT(KEY_RIGHT_DOWN), + [KEY_LEFT_UP] = XLAT(KEY_LEFT_UP), + [KEY_LEFT_DOWN] = XLAT(KEY_LEFT_DOWN), + + [KEY_ROOT_MENU] = XLAT(KEY_ROOT_MENU), + [KEY_MEDIA_TOP_MENU] = XLAT(KEY_MEDIA_TOP_MENU), + [KEY_NUMERIC_11] = XLAT(KEY_NUMERIC_11), + [KEY_NUMERIC_12] = XLAT(KEY_NUMERIC_12), + + [KEY_AUDIO_DESC] = XLAT(KEY_AUDIO_DESC), + [KEY_3D_MODE] = XLAT(KEY_3D_MODE), + [KEY_NEXT_FAVORITE] = XLAT(KEY_NEXT_FAVORITE), + [KEY_STOP_RECORD] = XLAT(KEY_STOP_RECORD), + [KEY_PAUSE_RECORD] = XLAT(KEY_PAUSE_RECORD), + [KEY_VOD] = XLAT(KEY_VOD), + [KEY_UNMUTE] = XLAT(KEY_UNMUTE), + [KEY_FASTREVERSE] = XLAT(KEY_FASTREVERSE), + [KEY_SLOWREVERSE] = XLAT(KEY_SLOWREVERSE), + +#ifndef STRACE_WORKAROUND_FOR_KEY_DATA +# define STRACE_WORKAROUND_FOR_KEY_DATA +/* +* Linux kernel commit v4.9-rc8~12^2 has changed the value of KEY_DATA +* constant introduced by commit v4.7-rc6~32^2~6^2 because the old value +* was already used by KEY_FASTREVERSE. +* Looks like the best way to handle this situation is to pretend that +* the old value of KEY_DATA didn't exist. +*/ +# undef KEY_DATA +#endif + [KEY_DATA] = XLAT(KEY_DATA), + + [KEY_ONSCREEN_KEYBOARD] = XLAT(KEY_ONSCREEN_KEYBOARD), + + [BTN_TRIGGER_HAPPY1] = XLAT(BTN_TRIGGER_HAPPY1), + [BTN_TRIGGER_HAPPY2] = XLAT(BTN_TRIGGER_HAPPY2), + [BTN_TRIGGER_HAPPY3] = XLAT(BTN_TRIGGER_HAPPY3), + [BTN_TRIGGER_HAPPY4] = XLAT(BTN_TRIGGER_HAPPY4), + [BTN_TRIGGER_HAPPY5] = XLAT(BTN_TRIGGER_HAPPY5), + [BTN_TRIGGER_HAPPY6] = XLAT(BTN_TRIGGER_HAPPY6), + [BTN_TRIGGER_HAPPY7] = XLAT(BTN_TRIGGER_HAPPY7), + [BTN_TRIGGER_HAPPY8] = XLAT(BTN_TRIGGER_HAPPY8), + [BTN_TRIGGER_HAPPY9] = XLAT(BTN_TRIGGER_HAPPY9), + [BTN_TRIGGER_HAPPY10] = XLAT(BTN_TRIGGER_HAPPY10), + [BTN_TRIGGER_HAPPY11] = XLAT(BTN_TRIGGER_HAPPY11), + [BTN_TRIGGER_HAPPY12] = XLAT(BTN_TRIGGER_HAPPY12), + [BTN_TRIGGER_HAPPY13] = XLAT(BTN_TRIGGER_HAPPY13), + [BTN_TRIGGER_HAPPY14] = XLAT(BTN_TRIGGER_HAPPY14), + [BTN_TRIGGER_HAPPY15] = XLAT(BTN_TRIGGER_HAPPY15), + [BTN_TRIGGER_HAPPY16] = XLAT(BTN_TRIGGER_HAPPY16), + [BTN_TRIGGER_HAPPY17] = XLAT(BTN_TRIGGER_HAPPY17), + [BTN_TRIGGER_HAPPY18] = XLAT(BTN_TRIGGER_HAPPY18), + [BTN_TRIGGER_HAPPY19] = XLAT(BTN_TRIGGER_HAPPY19), + [BTN_TRIGGER_HAPPY20] = XLAT(BTN_TRIGGER_HAPPY20), + [BTN_TRIGGER_HAPPY21] = XLAT(BTN_TRIGGER_HAPPY21), + [BTN_TRIGGER_HAPPY22] = XLAT(BTN_TRIGGER_HAPPY22), + [BTN_TRIGGER_HAPPY23] = XLAT(BTN_TRIGGER_HAPPY23), + [BTN_TRIGGER_HAPPY24] = XLAT(BTN_TRIGGER_HAPPY24), + [BTN_TRIGGER_HAPPY25] = XLAT(BTN_TRIGGER_HAPPY25), + [BTN_TRIGGER_HAPPY26] = XLAT(BTN_TRIGGER_HAPPY26), + [BTN_TRIGGER_HAPPY27] = XLAT(BTN_TRIGGER_HAPPY27), + [BTN_TRIGGER_HAPPY28] = XLAT(BTN_TRIGGER_HAPPY28), + [BTN_TRIGGER_HAPPY29] = XLAT(BTN_TRIGGER_HAPPY29), + [BTN_TRIGGER_HAPPY30] = XLAT(BTN_TRIGGER_HAPPY30), + [BTN_TRIGGER_HAPPY31] = XLAT(BTN_TRIGGER_HAPPY31), + [BTN_TRIGGER_HAPPY32] = XLAT(BTN_TRIGGER_HAPPY32), + [BTN_TRIGGER_HAPPY33] = XLAT(BTN_TRIGGER_HAPPY33), + [BTN_TRIGGER_HAPPY34] = XLAT(BTN_TRIGGER_HAPPY34), + [BTN_TRIGGER_HAPPY35] = XLAT(BTN_TRIGGER_HAPPY35), + [BTN_TRIGGER_HAPPY36] = XLAT(BTN_TRIGGER_HAPPY36), + [BTN_TRIGGER_HAPPY37] = XLAT(BTN_TRIGGER_HAPPY37), + [BTN_TRIGGER_HAPPY38] = XLAT(BTN_TRIGGER_HAPPY38), + [BTN_TRIGGER_HAPPY39] = XLAT(BTN_TRIGGER_HAPPY39), + [BTN_TRIGGER_HAPPY40] = XLAT(BTN_TRIGGER_HAPPY40), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/evdev_keycode.in b/xlat/evdev_keycode.in index 15c829a1..08fb5d10 100644 --- a/xlat/evdev_keycode.in +++ b/xlat/evdev_keycode.in @@ -1,595 +1,626 @@ -KEY_RESERVED -KEY_ESC -KEY_1 -KEY_2 -KEY_3 -KEY_4 -KEY_5 -KEY_6 -KEY_7 -KEY_8 -KEY_9 -KEY_0 -KEY_MINUS -KEY_EQUAL -KEY_BACKSPACE -KEY_TAB -KEY_Q -KEY_W -KEY_E -KEY_R -KEY_T -KEY_Y -KEY_U -KEY_I -KEY_O -KEY_P -KEY_LEFTBRACE -KEY_RIGHTBRACE -KEY_ENTER -KEY_LEFTCTRL -KEY_A -KEY_S -KEY_D -KEY_F -KEY_G -KEY_H -KEY_J -KEY_K -KEY_L -KEY_SEMICOLON -KEY_APOSTROPHE -KEY_GRAVE -KEY_LEFTSHIFT -KEY_BACKSLASH -KEY_Z -KEY_X -KEY_C -KEY_V -KEY_B -KEY_N -KEY_M -KEY_COMMA -KEY_DOT -KEY_SLASH -KEY_RIGHTSHIFT -KEY_KPASTERISK -KEY_LEFTALT -KEY_SPACE -KEY_CAPSLOCK -KEY_F1 -KEY_F2 -KEY_F3 -KEY_F4 -KEY_F5 -KEY_F6 -KEY_F7 -KEY_F8 -KEY_F9 -KEY_F10 -KEY_NUMLOCK -KEY_SCROLLLOCK -KEY_KP7 -KEY_KP8 -KEY_KP9 -KEY_KPMINUS -KEY_KP4 -KEY_KP5 -KEY_KP6 -KEY_KPPLUS -KEY_KP1 -KEY_KP2 -KEY_KP3 -KEY_KP0 -KEY_KPDOT - -KEY_ZENKAKUHANKAKU -KEY_102ND -KEY_F11 -KEY_F12 -KEY_RO -KEY_KATAKANA -KEY_HIRAGANA -KEY_HENKAN -KEY_KATAKANAHIRAGANA -KEY_MUHENKAN -KEY_KPJPCOMMA -KEY_KPENTER -KEY_RIGHTCTRL -KEY_KPSLASH -KEY_SYSRQ -KEY_RIGHTALT -KEY_LINEFEED -KEY_HOME -KEY_UP -KEY_PAGEUP -KEY_LEFT -KEY_RIGHT -KEY_END -KEY_DOWN -KEY_PAGEDOWN -KEY_INSERT -KEY_DELETE -KEY_MACRO -KEY_MUTE -KEY_VOLUMEDOWN -KEY_VOLUMEUP -KEY_POWER -KEY_KPEQUAL -KEY_KPPLUSMINUS -KEY_PAUSE -KEY_SCALE - -KEY_KPCOMMA -KEY_HANGEUL -KEY_HANGUEL -KEY_HANJA -KEY_YEN -KEY_LEFTMETA -KEY_RIGHTMETA -KEY_COMPOSE - -KEY_STOP -KEY_AGAIN -KEY_PROPS -KEY_UNDO -KEY_FRONT -KEY_COPY -KEY_OPEN -KEY_PASTE -KEY_FIND -KEY_CUT -KEY_HELP -KEY_MENU -KEY_CALC -KEY_SETUP -KEY_SLEEP -KEY_WAKEUP -KEY_FILE -KEY_SENDFILE -KEY_DELETEFILE -KEY_XFER -KEY_PROG1 -KEY_PROG2 -KEY_WWW -KEY_MSDOS -KEY_COFFEE -KEY_ROTATE_DISPLAY -KEY_DIRECTION -KEY_CYCLEWINDOWS -KEY_MAIL -KEY_BOOKMARKS -KEY_COMPUTER -KEY_BACK -KEY_FORWARD -KEY_CLOSECD -KEY_EJECTCD -KEY_EJECTCLOSECD -KEY_NEXTSONG -KEY_PLAYPAUSE -KEY_PREVIOUSSONG -KEY_STOPCD -KEY_RECORD -KEY_REWIND -KEY_PHONE -KEY_ISO -KEY_CONFIG -KEY_HOMEPAGE -KEY_REFRESH -KEY_EXIT -KEY_MOVE -KEY_EDIT -KEY_SCROLLUP -KEY_SCROLLDOWN -KEY_KPLEFTPAREN -KEY_KPRIGHTPAREN -KEY_NEW -KEY_REDO - -KEY_F13 -KEY_F14 -KEY_F15 -KEY_F16 -KEY_F17 -KEY_F18 -KEY_F19 -KEY_F20 -KEY_F21 -KEY_F22 -KEY_F23 -KEY_F24 - -KEY_PLAYCD -KEY_PAUSECD -KEY_PROG3 -KEY_PROG4 -KEY_DASHBOARD -KEY_SUSPEND -KEY_CLOSE -KEY_PLAY -KEY_FASTFORWARD -KEY_BASSBOOST -KEY_PRINT -KEY_HP -KEY_CAMERA -KEY_SOUND -KEY_QUESTION -KEY_EMAIL -KEY_CHAT -KEY_SEARCH -KEY_CONNECT -KEY_FINANCE -KEY_SPORT -KEY_SHOP -KEY_ALTERASE -KEY_CANCEL -KEY_BRIGHTNESSDOWN -KEY_BRIGHTNESSUP -KEY_MEDIA - -KEY_SWITCHVIDEOMODE - -KEY_KBDILLUMTOGGLE -KEY_KBDILLUMDOWN -KEY_KBDILLUMUP - -KEY_SEND -KEY_REPLY -KEY_FORWARDMAIL -KEY_SAVE -KEY_DOCUMENTS - -KEY_BATTERY - -KEY_BLUETOOTH -KEY_WLAN -KEY_UWB - -KEY_UNKNOWN - -KEY_VIDEO_NEXT -KEY_VIDEO_PREV -KEY_BRIGHTNESS_CYCLE -KEY_BRIGHTNESS_AUTO -KEY_BRIGHTNESS_ZERO -KEY_DISPLAY_OFF - -KEY_WWAN -KEY_WIMAX -KEY_RFKILL - -KEY_MICMUTE - -BTN_0 -BTN_1 -BTN_2 -BTN_3 -BTN_4 -BTN_5 -BTN_6 -BTN_7 -BTN_8 -BTN_9 - -BTN_MOUSE -BTN_LEFT -BTN_RIGHT -BTN_MIDDLE -BTN_SIDE -BTN_EXTRA -BTN_FORWARD -BTN_BACK -BTN_TASK - -BTN_JOYSTICK -BTN_TRIGGER -BTN_THUMB -BTN_THUMB2 -BTN_TOP -BTN_TOP2 -BTN_PINKIE -BTN_BASE -BTN_BASE2 -BTN_BASE3 -BTN_BASE4 -BTN_BASE5 -BTN_BASE6 -BTN_DEAD - -BTN_GAMEPAD -BTN_SOUTH -BTN_A -BTN_EAST -BTN_B -BTN_C -BTN_NORTH -BTN_X -BTN_WEST -BTN_Y -BTN_Z -BTN_TL -BTN_TR -BTN_TL2 -BTN_TR2 -BTN_SELECT -BTN_START -BTN_MODE -BTN_THUMBL -BTN_THUMBR - -BTN_DIGI -BTN_TOOL_PEN -BTN_TOOL_RUBBER -BTN_TOOL_BRUSH -BTN_TOOL_PENCIL -BTN_TOOL_AIRBRUSH -BTN_TOOL_FINGER -BTN_TOOL_MOUSE -BTN_TOOL_LENS -BTN_TOOL_QUINTTAP -BTN_TOUCH -BTN_STYLUS -BTN_STYLUS2 -BTN_TOOL_DOUBLETAP -BTN_TOOL_TRIPLETAP -BTN_TOOL_QUADTAP - -BTN_WHEEL -BTN_GEAR_DOWN -BTN_GEAR_UP - -KEY_OK -KEY_SELECT -KEY_GOTO -KEY_CLEAR -KEY_POWER2 -KEY_OPTION -KEY_INFO -KEY_TIME -KEY_VENDOR -KEY_ARCHIVE -KEY_PROGRAM -KEY_CHANNEL -KEY_FAVORITES -KEY_EPG -KEY_PVR -KEY_MHP -KEY_LANGUAGE -KEY_TITLE -KEY_SUBTITLE -KEY_ANGLE -KEY_ZOOM -KEY_MODE -KEY_KEYBOARD -KEY_SCREEN -KEY_PC -KEY_TV -KEY_TV2 -KEY_VCR -KEY_VCR2 -KEY_SAT -KEY_SAT2 -KEY_CD -KEY_TAPE -KEY_RADIO -KEY_TUNER -KEY_PLAYER -KEY_TEXT -KEY_DVD -KEY_AUX -KEY_MP3 -KEY_AUDIO -KEY_VIDEO -KEY_DIRECTORY -KEY_LIST -KEY_MEMO -KEY_CALENDAR -KEY_RED -KEY_GREEN -KEY_YELLOW -KEY_BLUE -KEY_CHANNELUP -KEY_CHANNELDOWN -KEY_FIRST -KEY_LAST -KEY_AB -KEY_NEXT -KEY_RESTART -KEY_SLOW -KEY_SHUFFLE -KEY_BREAK -KEY_PREVIOUS -KEY_DIGITS -KEY_TEEN -KEY_TWEN -KEY_VIDEOPHONE -KEY_GAMES -KEY_ZOOMIN -KEY_ZOOMOUT -KEY_ZOOMRESET -KEY_WORDPROCESSOR -KEY_EDITOR -KEY_SPREADSHEET -KEY_GRAPHICSEDITOR -KEY_PRESENTATION -KEY_DATABASE -KEY_NEWS -KEY_VOICEMAIL -KEY_ADDRESSBOOK -KEY_MESSENGER -KEY_DISPLAYTOGGLE -KEY_BRIGHTNESS_TOGGLE -KEY_SPELLCHECK -KEY_LOGOFF - -KEY_DOLLAR -KEY_EURO - -KEY_FRAMEBACK -KEY_FRAMEFORWARD -KEY_CONTEXT_MENU -KEY_MEDIA_REPEAT -KEY_10CHANNELSUP -KEY_10CHANNELSDOWN -KEY_IMAGES - -KEY_DEL_EOL -KEY_DEL_EOS -KEY_INS_LINE -KEY_DEL_LINE - -KEY_FN -KEY_FN_ESC -KEY_FN_F1 -KEY_FN_F2 -KEY_FN_F3 -KEY_FN_F4 -KEY_FN_F5 -KEY_FN_F6 -KEY_FN_F7 -KEY_FN_F8 -KEY_FN_F9 -KEY_FN_F10 -KEY_FN_F11 -KEY_FN_F12 -KEY_FN_1 -KEY_FN_2 -KEY_FN_D -KEY_FN_E -KEY_FN_F -KEY_FN_S -KEY_FN_B - -KEY_BRL_DOT1 -KEY_BRL_DOT2 -KEY_BRL_DOT3 -KEY_BRL_DOT4 -KEY_BRL_DOT5 -KEY_BRL_DOT6 -KEY_BRL_DOT7 -KEY_BRL_DOT8 -KEY_BRL_DOT9 -KEY_BRL_DOT10 - -KEY_NUMERIC_0 -KEY_NUMERIC_1 -KEY_NUMERIC_2 -KEY_NUMERIC_3 -KEY_NUMERIC_4 -KEY_NUMERIC_5 -KEY_NUMERIC_6 -KEY_NUMERIC_7 -KEY_NUMERIC_8 -KEY_NUMERIC_9 -KEY_NUMERIC_STAR -KEY_NUMERIC_POUND -KEY_NUMERIC_A -KEY_NUMERIC_B -KEY_NUMERIC_C -KEY_NUMERIC_D - -KEY_CAMERA_FOCUS -KEY_WPS_BUTTON - -KEY_TOUCHPAD_TOGGLE -KEY_TOUCHPAD_ON -KEY_TOUCHPAD_OFF - -KEY_CAMERA_ZOOMIN -KEY_CAMERA_ZOOMOUT -KEY_CAMERA_UP -KEY_CAMERA_DOWN -KEY_CAMERA_LEFT -KEY_CAMERA_RIGHT - -KEY_ATTENDANT_ON -KEY_ATTENDANT_OFF -KEY_ATTENDANT_TOGGLE -KEY_LIGHTS_TOGGLE - -BTN_DPAD_UP -BTN_DPAD_DOWN -BTN_DPAD_LEFT -BTN_DPAD_RIGHT - -KEY_ALS_TOGGLE - -KEY_BUTTONCONFIG -KEY_TASKMANAGER -KEY_JOURNAL -KEY_CONTROLPANEL -KEY_APPSELECT -KEY_SCREENSAVER -KEY_VOICECOMMAND - -KEY_BRIGHTNESS_MIN -KEY_BRIGHTNESS_MAX - -KEY_KBDINPUTASSIST_PREV -KEY_KBDINPUTASSIST_NEXT -KEY_KBDINPUTASSIST_PREVGROUP -KEY_KBDINPUTASSIST_NEXTGROUP -KEY_KBDINPUTASSIST_ACCEPT -KEY_KBDINPUTASSIST_CANCEL - -KEY_RIGHT_UP -KEY_RIGHT_DOWN -KEY_LEFT_UP -KEY_LEFT_DOWN - -KEY_ROOT_MENU -KEY_MEDIA_TOP_MENU -KEY_NUMERIC_11 -KEY_NUMERIC_12 - -KEY_AUDIO_DESC -KEY_3D_MODE -KEY_NEXT_FAVORITE -KEY_STOP_RECORD -KEY_PAUSE_RECORD -KEY_VOD -KEY_UNMUTE -KEY_FASTREVERSE -KEY_SLOWREVERSE - -BTN_TRIGGER_HAPPY -BTN_TRIGGER_HAPPY1 -BTN_TRIGGER_HAPPY2 -BTN_TRIGGER_HAPPY3 -BTN_TRIGGER_HAPPY4 -BTN_TRIGGER_HAPPY5 -BTN_TRIGGER_HAPPY6 -BTN_TRIGGER_HAPPY7 -BTN_TRIGGER_HAPPY8 -BTN_TRIGGER_HAPPY9 -BTN_TRIGGER_HAPPY10 -BTN_TRIGGER_HAPPY11 -BTN_TRIGGER_HAPPY12 -BTN_TRIGGER_HAPPY13 -BTN_TRIGGER_HAPPY14 -BTN_TRIGGER_HAPPY15 -BTN_TRIGGER_HAPPY16 -BTN_TRIGGER_HAPPY17 -BTN_TRIGGER_HAPPY18 -BTN_TRIGGER_HAPPY19 -BTN_TRIGGER_HAPPY20 -BTN_TRIGGER_HAPPY21 -BTN_TRIGGER_HAPPY22 -BTN_TRIGGER_HAPPY23 -BTN_TRIGGER_HAPPY24 -BTN_TRIGGER_HAPPY25 -BTN_TRIGGER_HAPPY26 -BTN_TRIGGER_HAPPY27 -BTN_TRIGGER_HAPPY28 -BTN_TRIGGER_HAPPY29 -BTN_TRIGGER_HAPPY30 -BTN_TRIGGER_HAPPY31 -BTN_TRIGGER_HAPPY32 -BTN_TRIGGER_HAPPY33 -BTN_TRIGGER_HAPPY34 -BTN_TRIGGER_HAPPY35 -BTN_TRIGGER_HAPPY36 -BTN_TRIGGER_HAPPY37 -BTN_TRIGGER_HAPPY38 -BTN_TRIGGER_HAPPY39 -BTN_TRIGGER_HAPPY40 +#value_indexed +/* awk '{if (NF>1) {n=strtonum($2)}; printf("%d %s\n", n, $0)}' |sort -s -k1,1n |sed 's/^[0-9]* //' */ +KEY_RESERVED 0 +KEY_ESC 1 +KEY_1 2 +KEY_2 3 +KEY_3 4 +KEY_4 5 +KEY_5 6 +KEY_6 7 +KEY_7 8 +KEY_8 9 +KEY_9 10 +KEY_0 11 +KEY_MINUS 12 +KEY_EQUAL 13 +KEY_BACKSPACE 14 +KEY_TAB 15 +KEY_Q 16 +KEY_W 17 +KEY_E 18 +KEY_R 19 +KEY_T 20 +KEY_Y 21 +KEY_U 22 +KEY_I 23 +KEY_O 24 +KEY_P 25 +KEY_LEFTBRACE 26 +KEY_RIGHTBRACE 27 +KEY_ENTER 28 +KEY_LEFTCTRL 29 +KEY_A 30 +KEY_S 31 +KEY_D 32 +KEY_F 33 +KEY_G 34 +KEY_H 35 +KEY_J 36 +KEY_K 37 +KEY_L 38 +KEY_SEMICOLON 39 +KEY_APOSTROPHE 40 +KEY_GRAVE 41 +KEY_LEFTSHIFT 42 +KEY_BACKSLASH 43 +KEY_Z 44 +KEY_X 45 +KEY_C 46 +KEY_V 47 +KEY_B 48 +KEY_N 49 +KEY_M 50 +KEY_COMMA 51 +KEY_DOT 52 +KEY_SLASH 53 +KEY_RIGHTSHIFT 54 +KEY_KPASTERISK 55 +KEY_LEFTALT 56 +KEY_SPACE 57 +KEY_CAPSLOCK 58 +KEY_F1 59 +KEY_F2 60 +KEY_F3 61 +KEY_F4 62 +KEY_F5 63 +KEY_F6 64 +KEY_F7 65 +KEY_F8 66 +KEY_F9 67 +KEY_F10 68 +KEY_NUMLOCK 69 +KEY_SCROLLLOCK 70 +KEY_KP7 71 +KEY_KP8 72 +KEY_KP9 73 +KEY_KPMINUS 74 +KEY_KP4 75 +KEY_KP5 76 +KEY_KP6 77 +KEY_KPPLUS 78 +KEY_KP1 79 +KEY_KP2 80 +KEY_KP3 81 +KEY_KP0 82 +KEY_KPDOT 83 + +KEY_ZENKAKUHANKAKU 85 +KEY_102ND 86 +KEY_F11 87 +KEY_F12 88 +KEY_RO 89 +KEY_KATAKANA 90 +KEY_HIRAGANA 91 +KEY_HENKAN 92 +KEY_KATAKANAHIRAGANA 93 +KEY_MUHENKAN 94 +KEY_KPJPCOMMA 95 +KEY_KPENTER 96 +KEY_RIGHTCTRL 97 +KEY_KPSLASH 98 +KEY_SYSRQ 99 +KEY_RIGHTALT 100 +KEY_LINEFEED 101 +KEY_HOME 102 +KEY_UP 103 +KEY_PAGEUP 104 +KEY_LEFT 105 +KEY_RIGHT 106 +KEY_END 107 +KEY_DOWN 108 +KEY_PAGEDOWN 109 +KEY_INSERT 110 +KEY_DELETE 111 +KEY_MACRO 112 +KEY_MUTE 113 +KEY_VOLUMEDOWN 114 +KEY_VOLUMEUP 115 +KEY_POWER 116 +KEY_KPEQUAL 117 +KEY_KPPLUSMINUS 118 +KEY_PAUSE 119 +KEY_SCALE 120 + +KEY_KPCOMMA 121 +KEY_HANGEUL 122 +KEY_HANJA 123 +KEY_YEN 124 +KEY_LEFTMETA 125 +KEY_RIGHTMETA 126 +KEY_COMPOSE 127 + +KEY_STOP 128 +KEY_AGAIN 129 +KEY_PROPS 130 +KEY_UNDO 131 +KEY_FRONT 132 +KEY_COPY 133 +KEY_OPEN 134 +KEY_PASTE 135 +KEY_FIND 136 +KEY_CUT 137 +KEY_HELP 138 +KEY_MENU 139 +KEY_CALC 140 +KEY_SETUP 141 +KEY_SLEEP 142 +KEY_WAKEUP 143 +KEY_FILE 144 +KEY_SENDFILE 145 +KEY_DELETEFILE 146 +KEY_XFER 147 +KEY_PROG1 148 +KEY_PROG2 149 +KEY_WWW 150 +KEY_MSDOS 151 +KEY_COFFEE 152 +KEY_ROTATE_DISPLAY 153 +KEY_CYCLEWINDOWS 154 +KEY_MAIL 155 +KEY_BOOKMARKS 156 +KEY_COMPUTER 157 +KEY_BACK 158 +KEY_FORWARD 159 +KEY_CLOSECD 160 +KEY_EJECTCD 161 +KEY_EJECTCLOSECD 162 +KEY_NEXTSONG 163 +KEY_PLAYPAUSE 164 +KEY_PREVIOUSSONG 165 +KEY_STOPCD 166 +KEY_RECORD 167 +KEY_REWIND 168 +KEY_PHONE 169 +KEY_ISO 170 +KEY_CONFIG 171 +KEY_HOMEPAGE 172 +KEY_REFRESH 173 +KEY_EXIT 174 +KEY_MOVE 175 +KEY_EDIT 176 +KEY_SCROLLUP 177 +KEY_SCROLLDOWN 178 +KEY_KPLEFTPAREN 179 +KEY_KPRIGHTPAREN 180 +KEY_NEW 181 +KEY_REDO 182 + +KEY_F13 183 +KEY_F14 184 +KEY_F15 185 +KEY_F16 186 +KEY_F17 187 +KEY_F18 188 +KEY_F19 189 +KEY_F20 190 +KEY_F21 191 +KEY_F22 192 +KEY_F23 193 +KEY_F24 194 + +KEY_PLAYCD 200 +KEY_PAUSECD 201 +KEY_PROG3 202 +KEY_PROG4 203 +KEY_DASHBOARD 204 +KEY_SUSPEND 205 +KEY_CLOSE 206 +KEY_PLAY 207 +KEY_FASTFORWARD 208 +KEY_BASSBOOST 209 +KEY_PRINT 210 +KEY_HP 211 +KEY_CAMERA 212 +KEY_SOUND 213 +KEY_QUESTION 214 +KEY_EMAIL 215 +KEY_CHAT 216 +KEY_SEARCH 217 +KEY_CONNECT 218 +KEY_FINANCE 219 +KEY_SPORT 220 +KEY_SHOP 221 +KEY_ALTERASE 222 +KEY_CANCEL 223 +KEY_BRIGHTNESSDOWN 224 +KEY_BRIGHTNESSUP 225 +KEY_MEDIA 226 + +KEY_SWITCHVIDEOMODE 227 + +KEY_KBDILLUMTOGGLE 228 +KEY_KBDILLUMDOWN 229 +KEY_KBDILLUMUP 230 + +KEY_SEND 231 +KEY_REPLY 232 +KEY_FORWARDMAIL 233 +KEY_SAVE 234 +KEY_DOCUMENTS 235 + +KEY_BATTERY 236 + +KEY_BLUETOOTH 237 +KEY_WLAN 238 +KEY_UWB 239 + +KEY_UNKNOWN 240 + +KEY_VIDEO_NEXT 241 +KEY_VIDEO_PREV 242 +KEY_BRIGHTNESS_CYCLE 243 +KEY_BRIGHTNESS_AUTO 244 +KEY_DISPLAY_OFF 245 + +KEY_WWAN 246 + +#ifndef STRACE_WORKAROUND_FOR_KEY_RFKILL +# define STRACE_WORKAROUND_FOR_KEY_RFKILL +/* + * KEY_RFKILL and KEY_NUMERIC_A constants were introduced by Linux kernel + * commits v2.6.33~17^2~2 and v4.1-rc1~150^2~1^10~6, respectively. + * Apparently, RHEL6 introduced an alternative KEY_RFKILL constant + * with the same value as upstream KEY_NUMERIC_A. + * Downstream vendors are *not* allowed to do this. + * Ignore the system value of KEY_RFKILL. + */ +# undef KEY_RFKILL +#endif +KEY_RFKILL 247 + +KEY_MICMUTE 248 + +BTN_0 0x100 +BTN_1 0x101 +BTN_2 0x102 +BTN_3 0x103 +BTN_4 0x104 +BTN_5 0x105 +BTN_6 0x106 +BTN_7 0x107 +BTN_8 0x108 +BTN_9 0x109 + +BTN_LEFT 0x110 +BTN_RIGHT 0x111 +BTN_MIDDLE 0x112 +BTN_SIDE 0x113 +BTN_EXTRA 0x114 +BTN_FORWARD 0x115 +BTN_BACK 0x116 +BTN_TASK 0x117 + +BTN_TRIGGER 0x120 +BTN_THUMB 0x121 +BTN_THUMB2 0x122 +BTN_TOP 0x123 +BTN_TOP2 0x124 +BTN_PINKIE 0x125 +BTN_BASE 0x126 +BTN_BASE2 0x127 +BTN_BASE3 0x128 +BTN_BASE4 0x129 +BTN_BASE5 0x12a +BTN_BASE6 0x12b +BTN_DEAD 0x12f + +BTN_SOUTH 0x130 +BTN_EAST 0x131 +BTN_C 0x132 +BTN_NORTH 0x133 +BTN_WEST 0x134 +BTN_Z 0x135 +BTN_TL 0x136 +BTN_TR 0x137 +BTN_TL2 0x138 +BTN_TR2 0x139 +BTN_SELECT 0x13a +BTN_START 0x13b +BTN_MODE 0x13c +BTN_THUMBL 0x13d +BTN_THUMBR 0x13e + +BTN_TOOL_PEN 0x140 +BTN_TOOL_RUBBER 0x141 +BTN_TOOL_BRUSH 0x142 +BTN_TOOL_PENCIL 0x143 +BTN_TOOL_AIRBRUSH 0x144 +BTN_TOOL_FINGER 0x145 +BTN_TOOL_MOUSE 0x146 +BTN_TOOL_LENS 0x147 +BTN_TOOL_QUINTTAP 0x148 +BTN_STYLUS3 0x149 +BTN_TOUCH 0x14a +BTN_STYLUS 0x14b +BTN_STYLUS2 0x14c +BTN_TOOL_DOUBLETAP 0x14d +BTN_TOOL_TRIPLETAP 0x14e +BTN_TOOL_QUADTAP 0x14f + +BTN_GEAR_DOWN 0x150 +BTN_GEAR_UP 0x151 + +KEY_OK 0x160 +KEY_SELECT 0x161 +KEY_GOTO 0x162 +KEY_CLEAR 0x163 +KEY_POWER2 0x164 +KEY_OPTION 0x165 +KEY_INFO 0x166 +KEY_TIME 0x167 +KEY_VENDOR 0x168 +KEY_ARCHIVE 0x169 +KEY_PROGRAM 0x16a +KEY_CHANNEL 0x16b +KEY_FAVORITES 0x16c +KEY_EPG 0x16d +KEY_PVR 0x16e +KEY_MHP 0x16f +KEY_LANGUAGE 0x170 +KEY_TITLE 0x171 +KEY_SUBTITLE 0x172 +KEY_ANGLE 0x173 +KEY_ZOOM 0x174 +KEY_MODE 0x175 +KEY_KEYBOARD 0x176 +KEY_SCREEN 0x177 +KEY_PC 0x178 +KEY_TV 0x179 +KEY_TV2 0x17a +KEY_VCR 0x17b +KEY_VCR2 0x17c +KEY_SAT 0x17d +KEY_SAT2 0x17e +KEY_CD 0x17f +KEY_TAPE 0x180 +KEY_RADIO 0x181 +KEY_TUNER 0x182 +KEY_PLAYER 0x183 +KEY_TEXT 0x184 +KEY_DVD 0x185 +KEY_AUX 0x186 +KEY_MP3 0x187 +KEY_AUDIO 0x188 +KEY_VIDEO 0x189 +KEY_DIRECTORY 0x18a +KEY_LIST 0x18b +KEY_MEMO 0x18c +KEY_CALENDAR 0x18d +KEY_RED 0x18e +KEY_GREEN 0x18f +KEY_YELLOW 0x190 +KEY_BLUE 0x191 +KEY_CHANNELUP 0x192 +KEY_CHANNELDOWN 0x193 +KEY_FIRST 0x194 +KEY_LAST 0x195 +KEY_AB 0x196 +KEY_NEXT 0x197 +KEY_RESTART 0x198 +KEY_SLOW 0x199 +KEY_SHUFFLE 0x19a +KEY_BREAK 0x19b +KEY_PREVIOUS 0x19c +KEY_DIGITS 0x19d +KEY_TEEN 0x19e +KEY_TWEN 0x19f +KEY_VIDEOPHONE 0x1a0 +KEY_GAMES 0x1a1 +KEY_ZOOMIN 0x1a2 +KEY_ZOOMOUT 0x1a3 +KEY_ZOOMRESET 0x1a4 +KEY_WORDPROCESSOR 0x1a5 +KEY_EDITOR 0x1a6 +KEY_SPREADSHEET 0x1a7 +KEY_GRAPHICSEDITOR 0x1a8 +KEY_PRESENTATION 0x1a9 +KEY_DATABASE 0x1aa +KEY_NEWS 0x1ab +KEY_VOICEMAIL 0x1ac +KEY_ADDRESSBOOK 0x1ad +KEY_MESSENGER 0x1ae +KEY_DISPLAYTOGGLE 0x1af +KEY_SPELLCHECK 0x1b0 +KEY_LOGOFF 0x1b1 + +KEY_DOLLAR 0x1b2 +KEY_EURO 0x1b3 + +KEY_FRAMEBACK 0x1b4 +KEY_FRAMEFORWARD 0x1b5 +KEY_CONTEXT_MENU 0x1b6 +KEY_MEDIA_REPEAT 0x1b7 +KEY_10CHANNELSUP 0x1b8 +KEY_10CHANNELSDOWN 0x1b9 +KEY_IMAGES 0x1ba + +KEY_DEL_EOL 0x1c0 +KEY_DEL_EOS 0x1c1 +KEY_INS_LINE 0x1c2 +KEY_DEL_LINE 0x1c3 + +KEY_FN 0x1d0 +KEY_FN_ESC 0x1d1 +KEY_FN_F1 0x1d2 +KEY_FN_F2 0x1d3 +KEY_FN_F3 0x1d4 +KEY_FN_F4 0x1d5 +KEY_FN_F5 0x1d6 +KEY_FN_F6 0x1d7 +KEY_FN_F7 0x1d8 +KEY_FN_F8 0x1d9 +KEY_FN_F9 0x1da +KEY_FN_F10 0x1db +KEY_FN_F11 0x1dc +KEY_FN_F12 0x1dd +KEY_FN_1 0x1de +KEY_FN_2 0x1df +KEY_FN_D 0x1e0 +KEY_FN_E 0x1e1 +KEY_FN_F 0x1e2 +KEY_FN_S 0x1e3 +KEY_FN_B 0x1e4 + +KEY_BRL_DOT1 0x1f1 +KEY_BRL_DOT2 0x1f2 +KEY_BRL_DOT3 0x1f3 +KEY_BRL_DOT4 0x1f4 +KEY_BRL_DOT5 0x1f5 +KEY_BRL_DOT6 0x1f6 +KEY_BRL_DOT7 0x1f7 +KEY_BRL_DOT8 0x1f8 +KEY_BRL_DOT9 0x1f9 +KEY_BRL_DOT10 0x1fa + +KEY_NUMERIC_0 0x200 +KEY_NUMERIC_1 0x201 +KEY_NUMERIC_2 0x202 +KEY_NUMERIC_3 0x203 +KEY_NUMERIC_4 0x204 +KEY_NUMERIC_5 0x205 +KEY_NUMERIC_6 0x206 +KEY_NUMERIC_7 0x207 +KEY_NUMERIC_8 0x208 +KEY_NUMERIC_9 0x209 +KEY_NUMERIC_STAR 0x20a +KEY_NUMERIC_POUND 0x20b +KEY_NUMERIC_A 0x20c +KEY_NUMERIC_B 0x20d +KEY_NUMERIC_C 0x20e +KEY_NUMERIC_D 0x20f + +KEY_CAMERA_FOCUS 0x210 +KEY_WPS_BUTTON 0x211 + +KEY_TOUCHPAD_TOGGLE 0x212 +KEY_TOUCHPAD_ON 0x213 +KEY_TOUCHPAD_OFF 0x214 + +KEY_CAMERA_ZOOMIN 0x215 +KEY_CAMERA_ZOOMOUT 0x216 +KEY_CAMERA_UP 0x217 +KEY_CAMERA_DOWN 0x218 +KEY_CAMERA_LEFT 0x219 +KEY_CAMERA_RIGHT 0x21a + +KEY_ATTENDANT_ON 0x21b +KEY_ATTENDANT_OFF 0x21c +KEY_ATTENDANT_TOGGLE 0x21d +KEY_LIGHTS_TOGGLE 0x21e + +BTN_DPAD_UP 0x220 +BTN_DPAD_DOWN 0x221 +BTN_DPAD_LEFT 0x222 +BTN_DPAD_RIGHT 0x223 + +KEY_ALS_TOGGLE 0x230 +KEY_ROTATE_LOCK_TOGGLE 0x231 + +KEY_BUTTONCONFIG 0x240 +KEY_TASKMANAGER 0x241 +KEY_JOURNAL 0x242 +KEY_CONTROLPANEL 0x243 +KEY_APPSELECT 0x244 +KEY_SCREENSAVER 0x245 +KEY_VOICECOMMAND 0x246 +KEY_ASSISTANT 0x247 + +#ifndef STRACE_WORKAROUND_FOR_KEY_BRIGHTNESS_MIN +# define STRACE_WORKAROUND_FOR_KEY_BRIGHTNESS_MIN +/* + * KEY_BRIGHTNESS_MIN and KEY_BRIGHTNESS_MAX constants were introduced + * by Linux kernel commit v3.16-rc1~30^2~6^2~1^2~7. + * Apparently, RHEL7 introduced an alternative KEY_BRIGHTNESS_MIN constant + * with the same value as upstream KEY_BRIGHTNESS_MAX. + * Downstream vendors are *not* allowed to do this. + * Ignore the system value of KEY_BRIGHTNESS_MIN. + */ +# undef KEY_BRIGHTNESS_MIN +#endif +KEY_BRIGHTNESS_MIN 0x250 + +KEY_BRIGHTNESS_MAX 0x251 + +KEY_KBDINPUTASSIST_PREV 0x260 +KEY_KBDINPUTASSIST_NEXT 0x261 +KEY_KBDINPUTASSIST_PREVGROUP 0x262 +KEY_KBDINPUTASSIST_NEXTGROUP 0x263 +KEY_KBDINPUTASSIST_ACCEPT 0x264 +KEY_KBDINPUTASSIST_CANCEL 0x265 + +KEY_RIGHT_UP 0x266 +KEY_RIGHT_DOWN 0x267 +KEY_LEFT_UP 0x268 +KEY_LEFT_DOWN 0x269 + +KEY_ROOT_MENU 0x26a +KEY_MEDIA_TOP_MENU 0x26b +KEY_NUMERIC_11 0x26c +KEY_NUMERIC_12 0x26d + +KEY_AUDIO_DESC 0x26e +KEY_3D_MODE 0x26f +KEY_NEXT_FAVORITE 0x270 +KEY_STOP_RECORD 0x271 +KEY_PAUSE_RECORD 0x272 +KEY_VOD 0x273 +KEY_UNMUTE 0x274 +KEY_FASTREVERSE 0x275 +KEY_SLOWREVERSE 0x276 + +#ifndef STRACE_WORKAROUND_FOR_KEY_DATA +# define STRACE_WORKAROUND_FOR_KEY_DATA +/* + * Linux kernel commit v4.9-rc8~12^2 has changed the value of KEY_DATA + * constant introduced by commit v4.7-rc6~32^2~6^2 because the old value + * was already used by KEY_FASTREVERSE. + * Looks like the best way to handle this situation is to pretend that + * the old value of KEY_DATA didn't exist. + */ +# undef KEY_DATA +#endif +KEY_DATA 0x277 + +KEY_ONSCREEN_KEYBOARD 0x278 + +BTN_TRIGGER_HAPPY1 0x2c0 +BTN_TRIGGER_HAPPY2 0x2c1 +BTN_TRIGGER_HAPPY3 0x2c2 +BTN_TRIGGER_HAPPY4 0x2c3 +BTN_TRIGGER_HAPPY5 0x2c4 +BTN_TRIGGER_HAPPY6 0x2c5 +BTN_TRIGGER_HAPPY7 0x2c6 +BTN_TRIGGER_HAPPY8 0x2c7 +BTN_TRIGGER_HAPPY9 0x2c8 +BTN_TRIGGER_HAPPY10 0x2c9 +BTN_TRIGGER_HAPPY11 0x2ca +BTN_TRIGGER_HAPPY12 0x2cb +BTN_TRIGGER_HAPPY13 0x2cc +BTN_TRIGGER_HAPPY14 0x2cd +BTN_TRIGGER_HAPPY15 0x2ce +BTN_TRIGGER_HAPPY16 0x2cf +BTN_TRIGGER_HAPPY17 0x2d0 +BTN_TRIGGER_HAPPY18 0x2d1 +BTN_TRIGGER_HAPPY19 0x2d2 +BTN_TRIGGER_HAPPY20 0x2d3 +BTN_TRIGGER_HAPPY21 0x2d4 +BTN_TRIGGER_HAPPY22 0x2d5 +BTN_TRIGGER_HAPPY23 0x2d6 +BTN_TRIGGER_HAPPY24 0x2d7 +BTN_TRIGGER_HAPPY25 0x2d8 +BTN_TRIGGER_HAPPY26 0x2d9 +BTN_TRIGGER_HAPPY27 0x2da +BTN_TRIGGER_HAPPY28 0x2db +BTN_TRIGGER_HAPPY29 0x2dc +BTN_TRIGGER_HAPPY30 0x2dd +BTN_TRIGGER_HAPPY31 0x2de +BTN_TRIGGER_HAPPY32 0x2df +BTN_TRIGGER_HAPPY33 0x2e0 +BTN_TRIGGER_HAPPY34 0x2e1 +BTN_TRIGGER_HAPPY35 0x2e2 +BTN_TRIGGER_HAPPY36 0x2e3 +BTN_TRIGGER_HAPPY37 0x2e4 +BTN_TRIGGER_HAPPY38 0x2e5 +BTN_TRIGGER_HAPPY39 0x2e6 +BTN_TRIGGER_HAPPY40 0x2e7 diff --git a/xlat/evdev_leds.h b/xlat/evdev_leds.h index 8f2b24c5..09dc0665 100644 --- a/xlat/evdev_leds.h +++ b/xlat/evdev_leds.h @@ -1,49 +1,110 @@ /* Generated by ./xlat/gen.sh from ./xlat/evdev_leds.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -extern const struct xlat evdev_leds[]; - -#else - -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) -static -# endif -const struct xlat evdev_leds[] = { #if defined(LED_NUML) || (defined(HAVE_DECL_LED_NUML) && HAVE_DECL_LED_NUML) - XLAT(LED_NUML), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LED_NUML) == (0x00), "LED_NUML != 0x00"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LED_NUML 0x00 #endif #if defined(LED_CAPSL) || (defined(HAVE_DECL_LED_CAPSL) && HAVE_DECL_LED_CAPSL) - XLAT(LED_CAPSL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LED_CAPSL) == (0x01), "LED_CAPSL != 0x01"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LED_CAPSL 0x01 #endif #if defined(LED_SCROLLL) || (defined(HAVE_DECL_LED_SCROLLL) && HAVE_DECL_LED_SCROLLL) - XLAT(LED_SCROLLL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LED_SCROLLL) == (0x02), "LED_SCROLLL != 0x02"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LED_SCROLLL 0x02 #endif #if defined(LED_COMPOSE) || (defined(HAVE_DECL_LED_COMPOSE) && HAVE_DECL_LED_COMPOSE) - XLAT(LED_COMPOSE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LED_COMPOSE) == (0x03), "LED_COMPOSE != 0x03"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LED_COMPOSE 0x03 #endif #if defined(LED_KANA) || (defined(HAVE_DECL_LED_KANA) && HAVE_DECL_LED_KANA) - XLAT(LED_KANA), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LED_KANA) == (0x04), "LED_KANA != 0x04"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LED_KANA 0x04 #endif #if defined(LED_SLEEP) || (defined(HAVE_DECL_LED_SLEEP) && HAVE_DECL_LED_SLEEP) - XLAT(LED_SLEEP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LED_SLEEP) == (0x05), "LED_SLEEP != 0x05"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LED_SLEEP 0x05 #endif #if defined(LED_SUSPEND) || (defined(HAVE_DECL_LED_SUSPEND) && HAVE_DECL_LED_SUSPEND) - XLAT(LED_SUSPEND), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LED_SUSPEND) == (0x06), "LED_SUSPEND != 0x06"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LED_SUSPEND 0x06 #endif #if defined(LED_MUTE) || (defined(HAVE_DECL_LED_MUTE) && HAVE_DECL_LED_MUTE) - XLAT(LED_MUTE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LED_MUTE) == (0x07), "LED_MUTE != 0x07"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LED_MUTE 0x07 #endif #if defined(LED_MISC) || (defined(HAVE_DECL_LED_MISC) && HAVE_DECL_LED_MISC) - XLAT(LED_MISC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LED_MISC) == (0x08), "LED_MISC != 0x08"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LED_MISC 0x08 #endif #if defined(LED_MAIL) || (defined(HAVE_DECL_LED_MAIL) && HAVE_DECL_LED_MAIL) - XLAT(LED_MAIL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LED_MAIL) == (0x09), "LED_MAIL != 0x09"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LED_MAIL 0x09 #endif #if defined(LED_CHARGING) || (defined(HAVE_DECL_LED_CHARGING) && HAVE_DECL_LED_CHARGING) - XLAT(LED_CHARGING), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LED_CHARGING) == (0x0a), "LED_CHARGING != 0x0a"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LED_CHARGING 0x0a #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat evdev_leds in mpers mode + +# else + +static +const struct xlat evdev_leds[] = { + [LED_NUML] = XLAT(LED_NUML), + [LED_CAPSL] = XLAT(LED_CAPSL), + [LED_SCROLLL] = XLAT(LED_SCROLLL), + [LED_COMPOSE] = XLAT(LED_COMPOSE), + [LED_KANA] = XLAT(LED_KANA), + [LED_SLEEP] = XLAT(LED_SLEEP), + [LED_SUSPEND] = XLAT(LED_SUSPEND), + [LED_MUTE] = XLAT(LED_MUTE), + [LED_MISC] = XLAT(LED_MISC), + [LED_MAIL] = XLAT(LED_MAIL), + [LED_CHARGING] = XLAT(LED_CHARGING), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/evdev_leds.in b/xlat/evdev_leds.in index c085ed34..6178bbd8 100644 --- a/xlat/evdev_leds.in +++ b/xlat/evdev_leds.in @@ -1,11 +1,12 @@ -LED_NUML -LED_CAPSL -LED_SCROLLL -LED_COMPOSE -LED_KANA -LED_SLEEP -LED_SUSPEND -LED_MUTE -LED_MISC -LED_MAIL -LED_CHARGING +#value_indexed +LED_NUML 0x00 +LED_CAPSL 0x01 +LED_SCROLLL 0x02 +LED_COMPOSE 0x03 +LED_KANA 0x04 +LED_SLEEP 0x05 +LED_SUSPEND 0x06 +LED_MUTE 0x07 +LED_MISC 0x08 +LED_MAIL 0x09 +LED_CHARGING 0x0a diff --git a/xlat/evdev_misc.h b/xlat/evdev_misc.h index 8a363d32..92c3879c 100644 --- a/xlat/evdev_misc.h +++ b/xlat/evdev_misc.h @@ -1,34 +1,70 @@ /* Generated by ./xlat/gen.sh from ./xlat/evdev_misc.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -extern const struct xlat evdev_misc[]; - -#else - -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) -static -# endif -const struct xlat evdev_misc[] = { #if defined(MSC_SERIAL) || (defined(HAVE_DECL_MSC_SERIAL) && HAVE_DECL_MSC_SERIAL) - XLAT(MSC_SERIAL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSC_SERIAL) == (0x00), "MSC_SERIAL != 0x00"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSC_SERIAL 0x00 #endif #if defined(MSC_PULSELED) || (defined(HAVE_DECL_MSC_PULSELED) && HAVE_DECL_MSC_PULSELED) - XLAT(MSC_PULSELED), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSC_PULSELED) == (0x01), "MSC_PULSELED != 0x01"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSC_PULSELED 0x01 #endif #if defined(MSC_GESTURE) || (defined(HAVE_DECL_MSC_GESTURE) && HAVE_DECL_MSC_GESTURE) - XLAT(MSC_GESTURE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSC_GESTURE) == (0x02), "MSC_GESTURE != 0x02"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSC_GESTURE 0x02 #endif #if defined(MSC_RAW) || (defined(HAVE_DECL_MSC_RAW) && HAVE_DECL_MSC_RAW) - XLAT(MSC_RAW), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSC_RAW) == (0x03), "MSC_RAW != 0x03"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSC_RAW 0x03 #endif #if defined(MSC_SCAN) || (defined(HAVE_DECL_MSC_SCAN) && HAVE_DECL_MSC_SCAN) - XLAT(MSC_SCAN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSC_SCAN) == (0x04), "MSC_SCAN != 0x04"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSC_SCAN 0x04 #endif #if defined(MSC_TIMESTAMP) || (defined(HAVE_DECL_MSC_TIMESTAMP) && HAVE_DECL_MSC_TIMESTAMP) - XLAT(MSC_TIMESTAMP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSC_TIMESTAMP) == (0x05), "MSC_TIMESTAMP != 0x05"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSC_TIMESTAMP 0x05 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat evdev_misc in mpers mode + +# else + +static +const struct xlat evdev_misc[] = { + [MSC_SERIAL] = XLAT(MSC_SERIAL), + [MSC_PULSELED] = XLAT(MSC_PULSELED), + [MSC_GESTURE] = XLAT(MSC_GESTURE), + [MSC_RAW] = XLAT(MSC_RAW), + [MSC_SCAN] = XLAT(MSC_SCAN), + [MSC_TIMESTAMP] = XLAT(MSC_TIMESTAMP), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/evdev_misc.in b/xlat/evdev_misc.in index 385ee4d1..0528092a 100644 --- a/xlat/evdev_misc.in +++ b/xlat/evdev_misc.in @@ -1,6 +1,7 @@ -MSC_SERIAL -MSC_PULSELED -MSC_GESTURE -MSC_RAW -MSC_SCAN -MSC_TIMESTAMP +#value_indexed +MSC_SERIAL 0x00 +MSC_PULSELED 0x01 +MSC_GESTURE 0x02 +MSC_RAW 0x03 +MSC_SCAN 0x04 +MSC_TIMESTAMP 0x05 diff --git a/xlat/evdev_mtslots.h b/xlat/evdev_mtslots.h index 4379f371..ec6ee61c 100644 --- a/xlat/evdev_mtslots.h +++ b/xlat/evdev_mtslots.h @@ -1,14 +1,18 @@ /* Generated by ./xlat/gen.sh from ./xlat/evdev_mtslots.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -extern const struct xlat evdev_mtslots[]; -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat evdev_mtslots in mpers mode + +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif const struct xlat evdev_mtslots[] = { #if defined(ABS_MT_SLOT) || (defined(HAVE_DECL_ABS_MT_SLOT) && HAVE_DECL_ABS_MT_SLOT) XLAT(ABS_MT_SLOT), @@ -58,4 +62,6 @@ const struct xlat evdev_mtslots[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/evdev_prop.h b/xlat/evdev_prop.h index 9f4f336b..ea872fbe 100644 --- a/xlat/evdev_prop.h +++ b/xlat/evdev_prop.h @@ -1,37 +1,78 @@ /* Generated by ./xlat/gen.sh from ./xlat/evdev_prop.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -extern const struct xlat evdev_prop[]; - -#else - -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) -static -# endif -const struct xlat evdev_prop[] = { #if defined(INPUT_PROP_POINTER) || (defined(HAVE_DECL_INPUT_PROP_POINTER) && HAVE_DECL_INPUT_PROP_POINTER) - XLAT(INPUT_PROP_POINTER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((INPUT_PROP_POINTER) == (0), "INPUT_PROP_POINTER != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define INPUT_PROP_POINTER 0 #endif #if defined(INPUT_PROP_DIRECT) || (defined(HAVE_DECL_INPUT_PROP_DIRECT) && HAVE_DECL_INPUT_PROP_DIRECT) - XLAT(INPUT_PROP_DIRECT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((INPUT_PROP_DIRECT) == (1), "INPUT_PROP_DIRECT != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define INPUT_PROP_DIRECT 1 #endif #if defined(INPUT_PROP_BUTTONPAD) || (defined(HAVE_DECL_INPUT_PROP_BUTTONPAD) && HAVE_DECL_INPUT_PROP_BUTTONPAD) - XLAT(INPUT_PROP_BUTTONPAD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((INPUT_PROP_BUTTONPAD) == (2), "INPUT_PROP_BUTTONPAD != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define INPUT_PROP_BUTTONPAD 2 #endif #if defined(INPUT_PROP_SEMI_MT) || (defined(HAVE_DECL_INPUT_PROP_SEMI_MT) && HAVE_DECL_INPUT_PROP_SEMI_MT) - XLAT(INPUT_PROP_SEMI_MT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((INPUT_PROP_SEMI_MT) == (3), "INPUT_PROP_SEMI_MT != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define INPUT_PROP_SEMI_MT 3 #endif #if defined(INPUT_PROP_TOPBUTTONPAD) || (defined(HAVE_DECL_INPUT_PROP_TOPBUTTONPAD) && HAVE_DECL_INPUT_PROP_TOPBUTTONPAD) - XLAT(INPUT_PROP_TOPBUTTONPAD), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((INPUT_PROP_TOPBUTTONPAD) == (4), "INPUT_PROP_TOPBUTTONPAD != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define INPUT_PROP_TOPBUTTONPAD 4 #endif #if defined(INPUT_PROP_POINTING_STICK) || (defined(HAVE_DECL_INPUT_PROP_POINTING_STICK) && HAVE_DECL_INPUT_PROP_POINTING_STICK) - XLAT(INPUT_PROP_POINTING_STICK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((INPUT_PROP_POINTING_STICK) == (5), "INPUT_PROP_POINTING_STICK != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define INPUT_PROP_POINTING_STICK 5 #endif #if defined(INPUT_PROP_ACCELEROMETER) || (defined(HAVE_DECL_INPUT_PROP_ACCELEROMETER) && HAVE_DECL_INPUT_PROP_ACCELEROMETER) - XLAT(INPUT_PROP_ACCELEROMETER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((INPUT_PROP_ACCELEROMETER) == (6), "INPUT_PROP_ACCELEROMETER != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define INPUT_PROP_ACCELEROMETER 6 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat evdev_prop in mpers mode + +# else + +static +const struct xlat evdev_prop[] = { + [INPUT_PROP_POINTER] = XLAT(INPUT_PROP_POINTER), + [INPUT_PROP_DIRECT] = XLAT(INPUT_PROP_DIRECT), + [INPUT_PROP_BUTTONPAD] = XLAT(INPUT_PROP_BUTTONPAD), + [INPUT_PROP_SEMI_MT] = XLAT(INPUT_PROP_SEMI_MT), + [INPUT_PROP_TOPBUTTONPAD] = XLAT(INPUT_PROP_TOPBUTTONPAD), + [INPUT_PROP_POINTING_STICK] = XLAT(INPUT_PROP_POINTING_STICK), + [INPUT_PROP_ACCELEROMETER] = XLAT(INPUT_PROP_ACCELEROMETER), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/evdev_prop.in b/xlat/evdev_prop.in index b6590004..5e7d025c 100644 --- a/xlat/evdev_prop.in +++ b/xlat/evdev_prop.in @@ -1,7 +1,8 @@ -INPUT_PROP_POINTER -INPUT_PROP_DIRECT -INPUT_PROP_BUTTONPAD -INPUT_PROP_SEMI_MT -INPUT_PROP_TOPBUTTONPAD -INPUT_PROP_POINTING_STICK -INPUT_PROP_ACCELEROMETER +#value_indexed +INPUT_PROP_POINTER 0 +INPUT_PROP_DIRECT 1 +INPUT_PROP_BUTTONPAD 2 +INPUT_PROP_SEMI_MT 3 +INPUT_PROP_TOPBUTTONPAD 4 +INPUT_PROP_POINTING_STICK 5 +INPUT_PROP_ACCELEROMETER 6 diff --git a/xlat/evdev_relative_axes.h b/xlat/evdev_relative_axes.h index b3b9b9a9..0c95784e 100644 --- a/xlat/evdev_relative_axes.h +++ b/xlat/evdev_relative_axes.h @@ -1,46 +1,126 @@ /* Generated by ./xlat/gen.sh from ./xlat/evdev_relative_axes.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -extern const struct xlat evdev_relative_axes[]; - -#else - -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) -static -# endif -const struct xlat evdev_relative_axes[] = { #if defined(REL_X) || (defined(HAVE_DECL_REL_X) && HAVE_DECL_REL_X) - XLAT(REL_X), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((REL_X) == (0x00), "REL_X != 0x00"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define REL_X 0x00 #endif #if defined(REL_Y) || (defined(HAVE_DECL_REL_Y) && HAVE_DECL_REL_Y) - XLAT(REL_Y), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((REL_Y) == (0x01), "REL_Y != 0x01"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define REL_Y 0x01 #endif #if defined(REL_Z) || (defined(HAVE_DECL_REL_Z) && HAVE_DECL_REL_Z) - XLAT(REL_Z), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((REL_Z) == (0x02), "REL_Z != 0x02"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define REL_Z 0x02 #endif #if defined(REL_RX) || (defined(HAVE_DECL_REL_RX) && HAVE_DECL_REL_RX) - XLAT(REL_RX), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((REL_RX) == (0x03), "REL_RX != 0x03"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define REL_RX 0x03 #endif #if defined(REL_RY) || (defined(HAVE_DECL_REL_RY) && HAVE_DECL_REL_RY) - XLAT(REL_RY), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((REL_RY) == (0x04), "REL_RY != 0x04"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define REL_RY 0x04 #endif #if defined(REL_RZ) || (defined(HAVE_DECL_REL_RZ) && HAVE_DECL_REL_RZ) - XLAT(REL_RZ), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((REL_RZ) == (0x05), "REL_RZ != 0x05"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define REL_RZ 0x05 #endif #if defined(REL_HWHEEL) || (defined(HAVE_DECL_REL_HWHEEL) && HAVE_DECL_REL_HWHEEL) - XLAT(REL_HWHEEL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((REL_HWHEEL) == (0x06), "REL_HWHEEL != 0x06"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define REL_HWHEEL 0x06 #endif #if defined(REL_DIAL) || (defined(HAVE_DECL_REL_DIAL) && HAVE_DECL_REL_DIAL) - XLAT(REL_DIAL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((REL_DIAL) == (0x07), "REL_DIAL != 0x07"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define REL_DIAL 0x07 #endif #if defined(REL_WHEEL) || (defined(HAVE_DECL_REL_WHEEL) && HAVE_DECL_REL_WHEEL) - XLAT(REL_WHEEL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((REL_WHEEL) == (0x08), "REL_WHEEL != 0x08"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define REL_WHEEL 0x08 #endif #if defined(REL_MISC) || (defined(HAVE_DECL_REL_MISC) && HAVE_DECL_REL_MISC) - XLAT(REL_MISC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((REL_MISC) == (0x09), "REL_MISC != 0x09"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define REL_MISC 0x09 #endif +#if defined(REL_RESERVED) || (defined(HAVE_DECL_REL_RESERVED) && HAVE_DECL_REL_RESERVED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((REL_RESERVED) == (0x0a), "REL_RESERVED != 0x0a"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define REL_RESERVED 0x0a +#endif +#if defined(REL_WHEEL_HI_RES) || (defined(HAVE_DECL_REL_WHEEL_HI_RES) && HAVE_DECL_REL_WHEEL_HI_RES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((REL_WHEEL_HI_RES) == (0x0b), "REL_WHEEL_HI_RES != 0x0b"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define REL_WHEEL_HI_RES 0x0b +#endif +#if defined(REL_HWHEEL_HI_RES) || (defined(HAVE_DECL_REL_HWHEEL_HI_RES) && HAVE_DECL_REL_HWHEEL_HI_RES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((REL_HWHEEL_HI_RES) == (0x0c), "REL_HWHEEL_HI_RES != 0x0c"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define REL_HWHEEL_HI_RES 0x0c +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat evdev_relative_axes in mpers mode + +# else + +static +const struct xlat evdev_relative_axes[] = { + [REL_X] = XLAT(REL_X), + [REL_Y] = XLAT(REL_Y), + [REL_Z] = XLAT(REL_Z), + [REL_RX] = XLAT(REL_RX), + [REL_RY] = XLAT(REL_RY), + [REL_RZ] = XLAT(REL_RZ), + [REL_HWHEEL] = XLAT(REL_HWHEEL), + [REL_DIAL] = XLAT(REL_DIAL), + [REL_WHEEL] = XLAT(REL_WHEEL), + [REL_MISC] = XLAT(REL_MISC), + [REL_RESERVED] = XLAT(REL_RESERVED), + [REL_WHEEL_HI_RES] = XLAT(REL_WHEEL_HI_RES), + [REL_HWHEEL_HI_RES] = XLAT(REL_HWHEEL_HI_RES), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/evdev_relative_axes.in b/xlat/evdev_relative_axes.in index 7158d47a..657289f7 100644 --- a/xlat/evdev_relative_axes.in +++ b/xlat/evdev_relative_axes.in @@ -1,10 +1,14 @@ -REL_X -REL_Y -REL_Z -REL_RX -REL_RY -REL_RZ -REL_HWHEEL -REL_DIAL -REL_WHEEL -REL_MISC +#value_indexed +REL_X 0x00 +REL_Y 0x01 +REL_Z 0x02 +REL_RX 0x03 +REL_RY 0x04 +REL_RZ 0x05 +REL_HWHEEL 0x06 +REL_DIAL 0x07 +REL_WHEEL 0x08 +REL_MISC 0x09 +REL_RESERVED 0x0a +REL_WHEEL_HI_RES 0x0b +REL_HWHEEL_HI_RES 0x0c diff --git a/xlat/evdev_snd.h b/xlat/evdev_snd.h index e03885f8..35d6c448 100644 --- a/xlat/evdev_snd.h +++ b/xlat/evdev_snd.h @@ -1,25 +1,46 @@ /* Generated by ./xlat/gen.sh from ./xlat/evdev_snd.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -extern const struct xlat evdev_snd[]; - -#else - -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) -static -# endif -const struct xlat evdev_snd[] = { #if defined(SND_CLICK) || (defined(HAVE_DECL_SND_CLICK) && HAVE_DECL_SND_CLICK) - XLAT(SND_CLICK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SND_CLICK) == (0x00), "SND_CLICK != 0x00"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SND_CLICK 0x00 #endif #if defined(SND_BELL) || (defined(HAVE_DECL_SND_BELL) && HAVE_DECL_SND_BELL) - XLAT(SND_BELL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SND_BELL) == (0x01), "SND_BELL != 0x01"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SND_BELL 0x01 #endif #if defined(SND_TONE) || (defined(HAVE_DECL_SND_TONE) && HAVE_DECL_SND_TONE) - XLAT(SND_TONE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SND_TONE) == (0x02), "SND_TONE != 0x02"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SND_TONE 0x02 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat evdev_snd in mpers mode + +# else + +static +const struct xlat evdev_snd[] = { + [SND_CLICK] = XLAT(SND_CLICK), + [SND_BELL] = XLAT(SND_BELL), + [SND_TONE] = XLAT(SND_TONE), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/evdev_snd.in b/xlat/evdev_snd.in index eaebe3c9..22e51cc1 100644 --- a/xlat/evdev_snd.in +++ b/xlat/evdev_snd.in @@ -1,3 +1,4 @@ -SND_CLICK -SND_BELL -SND_TONE +#value_indexed +SND_CLICK 0x00 +SND_BELL 0x01 +SND_TONE 0x02 diff --git a/xlat/evdev_switch.h b/xlat/evdev_switch.h index fb8c2cf6..d5aa9df9 100644 --- a/xlat/evdev_switch.h +++ b/xlat/evdev_switch.h @@ -1,64 +1,150 @@ /* Generated by ./xlat/gen.sh from ./xlat/evdev_switch.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -extern const struct xlat evdev_switch[]; - -#else - -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) -static -# endif -const struct xlat evdev_switch[] = { #if defined(SW_LID) || (defined(HAVE_DECL_SW_LID) && HAVE_DECL_SW_LID) - XLAT(SW_LID), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SW_LID) == (0x00), "SW_LID != 0x00"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SW_LID 0x00 #endif #if defined(SW_TABLET_MODE) || (defined(HAVE_DECL_SW_TABLET_MODE) && HAVE_DECL_SW_TABLET_MODE) - XLAT(SW_TABLET_MODE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SW_TABLET_MODE) == (0x01), "SW_TABLET_MODE != 0x01"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SW_TABLET_MODE 0x01 #endif #if defined(SW_HEADPHONE_INSERT) || (defined(HAVE_DECL_SW_HEADPHONE_INSERT) && HAVE_DECL_SW_HEADPHONE_INSERT) - XLAT(SW_HEADPHONE_INSERT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SW_HEADPHONE_INSERT) == (0x02), "SW_HEADPHONE_INSERT != 0x02"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SW_HEADPHONE_INSERT 0x02 #endif #if defined(SW_RFKILL_ALL) || (defined(HAVE_DECL_SW_RFKILL_ALL) && HAVE_DECL_SW_RFKILL_ALL) - XLAT(SW_RFKILL_ALL), -#endif -#if defined(SW_RADIO) || (defined(HAVE_DECL_SW_RADIO) && HAVE_DECL_SW_RADIO) - XLAT(SW_RADIO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SW_RFKILL_ALL) == (0x03), "SW_RFKILL_ALL != 0x03"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SW_RFKILL_ALL 0x03 #endif #if defined(SW_MICROPHONE_INSERT) || (defined(HAVE_DECL_SW_MICROPHONE_INSERT) && HAVE_DECL_SW_MICROPHONE_INSERT) - XLAT(SW_MICROPHONE_INSERT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SW_MICROPHONE_INSERT) == (0x04), "SW_MICROPHONE_INSERT != 0x04"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SW_MICROPHONE_INSERT 0x04 #endif #if defined(SW_DOCK) || (defined(HAVE_DECL_SW_DOCK) && HAVE_DECL_SW_DOCK) - XLAT(SW_DOCK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SW_DOCK) == (0x05), "SW_DOCK != 0x05"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SW_DOCK 0x05 #endif #if defined(SW_LINEOUT_INSERT) || (defined(HAVE_DECL_SW_LINEOUT_INSERT) && HAVE_DECL_SW_LINEOUT_INSERT) - XLAT(SW_LINEOUT_INSERT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SW_LINEOUT_INSERT) == (0x06), "SW_LINEOUT_INSERT != 0x06"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SW_LINEOUT_INSERT 0x06 #endif #if defined(SW_JACK_PHYSICAL_INSERT) || (defined(HAVE_DECL_SW_JACK_PHYSICAL_INSERT) && HAVE_DECL_SW_JACK_PHYSICAL_INSERT) - XLAT(SW_JACK_PHYSICAL_INSERT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SW_JACK_PHYSICAL_INSERT) == (0x07), "SW_JACK_PHYSICAL_INSERT != 0x07"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SW_JACK_PHYSICAL_INSERT 0x07 #endif #if defined(SW_VIDEOOUT_INSERT) || (defined(HAVE_DECL_SW_VIDEOOUT_INSERT) && HAVE_DECL_SW_VIDEOOUT_INSERT) - XLAT(SW_VIDEOOUT_INSERT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SW_VIDEOOUT_INSERT) == (0x08), "SW_VIDEOOUT_INSERT != 0x08"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SW_VIDEOOUT_INSERT 0x08 #endif #if defined(SW_CAMERA_LENS_COVER) || (defined(HAVE_DECL_SW_CAMERA_LENS_COVER) && HAVE_DECL_SW_CAMERA_LENS_COVER) - XLAT(SW_CAMERA_LENS_COVER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SW_CAMERA_LENS_COVER) == (0x09), "SW_CAMERA_LENS_COVER != 0x09"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SW_CAMERA_LENS_COVER 0x09 #endif #if defined(SW_KEYPAD_SLIDE) || (defined(HAVE_DECL_SW_KEYPAD_SLIDE) && HAVE_DECL_SW_KEYPAD_SLIDE) - XLAT(SW_KEYPAD_SLIDE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SW_KEYPAD_SLIDE) == (0x0a), "SW_KEYPAD_SLIDE != 0x0a"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SW_KEYPAD_SLIDE 0x0a #endif #if defined(SW_FRONT_PROXIMITY) || (defined(HAVE_DECL_SW_FRONT_PROXIMITY) && HAVE_DECL_SW_FRONT_PROXIMITY) - XLAT(SW_FRONT_PROXIMITY), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SW_FRONT_PROXIMITY) == (0x0b), "SW_FRONT_PROXIMITY != 0x0b"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SW_FRONT_PROXIMITY 0x0b #endif #if defined(SW_ROTATE_LOCK) || (defined(HAVE_DECL_SW_ROTATE_LOCK) && HAVE_DECL_SW_ROTATE_LOCK) - XLAT(SW_ROTATE_LOCK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SW_ROTATE_LOCK) == (0x0c), "SW_ROTATE_LOCK != 0x0c"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SW_ROTATE_LOCK 0x0c #endif #if defined(SW_LINEIN_INSERT) || (defined(HAVE_DECL_SW_LINEIN_INSERT) && HAVE_DECL_SW_LINEIN_INSERT) - XLAT(SW_LINEIN_INSERT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SW_LINEIN_INSERT) == (0x0d), "SW_LINEIN_INSERT != 0x0d"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SW_LINEIN_INSERT 0x0d #endif #if defined(SW_MUTE_DEVICE) || (defined(HAVE_DECL_SW_MUTE_DEVICE) && HAVE_DECL_SW_MUTE_DEVICE) - XLAT(SW_MUTE_DEVICE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SW_MUTE_DEVICE) == (0x0e), "SW_MUTE_DEVICE != 0x0e"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SW_MUTE_DEVICE 0x0e +#endif +#if defined(SW_PEN_INSERTED) || (defined(HAVE_DECL_SW_PEN_INSERTED) && HAVE_DECL_SW_PEN_INSERTED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SW_PEN_INSERTED) == (0x0f), "SW_PEN_INSERTED != 0x0f"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SW_PEN_INSERTED 0x0f #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat evdev_switch in mpers mode + +# else + +static +const struct xlat evdev_switch[] = { + [SW_LID] = XLAT(SW_LID), + [SW_TABLET_MODE] = XLAT(SW_TABLET_MODE), + [SW_HEADPHONE_INSERT] = XLAT(SW_HEADPHONE_INSERT), + [SW_RFKILL_ALL] = XLAT(SW_RFKILL_ALL), + [SW_MICROPHONE_INSERT] = XLAT(SW_MICROPHONE_INSERT), + [SW_DOCK] = XLAT(SW_DOCK), + [SW_LINEOUT_INSERT] = XLAT(SW_LINEOUT_INSERT), + [SW_JACK_PHYSICAL_INSERT] = XLAT(SW_JACK_PHYSICAL_INSERT), + [SW_VIDEOOUT_INSERT] = XLAT(SW_VIDEOOUT_INSERT), + [SW_CAMERA_LENS_COVER] = XLAT(SW_CAMERA_LENS_COVER), + [SW_KEYPAD_SLIDE] = XLAT(SW_KEYPAD_SLIDE), + [SW_FRONT_PROXIMITY] = XLAT(SW_FRONT_PROXIMITY), + [SW_ROTATE_LOCK] = XLAT(SW_ROTATE_LOCK), + [SW_LINEIN_INSERT] = XLAT(SW_LINEIN_INSERT), + [SW_MUTE_DEVICE] = XLAT(SW_MUTE_DEVICE), + [SW_PEN_INSERTED] = XLAT(SW_PEN_INSERTED), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/evdev_switch.in b/xlat/evdev_switch.in index 381d8387..8f808725 100644 --- a/xlat/evdev_switch.in +++ b/xlat/evdev_switch.in @@ -1,16 +1,17 @@ -SW_LID -SW_TABLET_MODE -SW_HEADPHONE_INSERT -SW_RFKILL_ALL -SW_RADIO -SW_MICROPHONE_INSERT -SW_DOCK -SW_LINEOUT_INSERT -SW_JACK_PHYSICAL_INSERT -SW_VIDEOOUT_INSERT -SW_CAMERA_LENS_COVER -SW_KEYPAD_SLIDE -SW_FRONT_PROXIMITY -SW_ROTATE_LOCK -SW_LINEIN_INSERT -SW_MUTE_DEVICE +#value_indexed +SW_LID 0x00 +SW_TABLET_MODE 0x01 +SW_HEADPHONE_INSERT 0x02 +SW_RFKILL_ALL 0x03 +SW_MICROPHONE_INSERT 0x04 +SW_DOCK 0x05 +SW_LINEOUT_INSERT 0x06 +SW_JACK_PHYSICAL_INSERT 0x07 +SW_VIDEOOUT_INSERT 0x08 +SW_CAMERA_LENS_COVER 0x09 +SW_KEYPAD_SLIDE 0x0a +SW_FRONT_PROXIMITY 0x0b +SW_ROTATE_LOCK 0x0c +SW_LINEIN_INSERT 0x0d +SW_MUTE_DEVICE 0x0e +SW_PEN_INSERTED 0x0f diff --git a/xlat/evdev_sync.h b/xlat/evdev_sync.h deleted file mode 100644 index 2e53d782..00000000 --- a/xlat/evdev_sync.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Generated by ./xlat/gen.sh from ./xlat/evdev_sync.in; do not edit. */ - -#ifdef IN_MPERS - -extern const struct xlat evdev_sync[]; - -#else - -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) -static -# endif -const struct xlat evdev_sync[] = { -#if defined(SYN_REPORT) || (defined(HAVE_DECL_SYN_REPORT) && HAVE_DECL_SYN_REPORT) - XLAT(SYN_REPORT), -#endif -#if defined(SYN_CONFIG) || (defined(HAVE_DECL_SYN_CONFIG) && HAVE_DECL_SYN_CONFIG) - XLAT(SYN_CONFIG), -#endif -#if defined(SYN_MT_REPORT) || (defined(HAVE_DECL_SYN_MT_REPORT) && HAVE_DECL_SYN_MT_REPORT) - XLAT(SYN_MT_REPORT), -#endif -#if defined(SYN_DROPPED) || (defined(HAVE_DECL_SYN_DROPPED) && HAVE_DECL_SYN_DROPPED) - XLAT(SYN_DROPPED), -#endif - XLAT_END -}; - -#endif /* !IN_MPERS */ diff --git a/xlat/evdev_sync.in b/xlat/evdev_sync.in deleted file mode 100644 index 39c2e4a9..00000000 --- a/xlat/evdev_sync.in +++ /dev/null @@ -1,4 +0,0 @@ -SYN_REPORT -SYN_CONFIG -SYN_MT_REPORT -SYN_DROPPED diff --git a/xlat/f_owner_types.h b/xlat/f_owner_types.h index 611895a9..76598710 100644 --- a/xlat/f_owner_types.h +++ b/xlat/f_owner_types.h @@ -1,19 +1,37 @@ /* Generated by ./xlat/gen.sh from ./xlat/f_owner_types.in; do not edit. */ -#if !(defined(F_OWNER_TID) || (defined(HAVE_DECL_F_OWNER_TID) && HAVE_DECL_F_OWNER_TID)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(F_OWNER_TID) || (defined(HAVE_DECL_F_OWNER_TID) && HAVE_DECL_F_OWNER_TID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_OWNER_TID) == (0), "F_OWNER_TID != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_OWNER_TID 0 #endif -#if !(defined(F_OWNER_PID) || (defined(HAVE_DECL_F_OWNER_PID) && HAVE_DECL_F_OWNER_PID)) +#if defined(F_OWNER_PID) || (defined(HAVE_DECL_F_OWNER_PID) && HAVE_DECL_F_OWNER_PID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_OWNER_PID) == (1), "F_OWNER_PID != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_OWNER_PID 1 #endif -#if !(defined(F_OWNER_PGRP) || (defined(HAVE_DECL_F_OWNER_PGRP) && HAVE_DECL_F_OWNER_PGRP)) +#if defined(F_OWNER_PGRP) || (defined(HAVE_DECL_F_OWNER_PGRP) && HAVE_DECL_F_OWNER_PGRP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_OWNER_PGRP) == (2), "F_OWNER_PGRP != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_OWNER_PGRP 2 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat f_owner_types in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat f_owner_types in mpers mode + +# else static const struct xlat f_owner_types[] = { @@ -23,4 +41,6 @@ const struct xlat f_owner_types[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/f_seals.h b/xlat/f_seals.h index 6efd0799..5f5a6b20 100644 --- a/xlat/f_seals.h +++ b/xlat/f_seals.h @@ -1,22 +1,51 @@ /* Generated by ./xlat/gen.sh from ./xlat/f_seals.in; do not edit. */ -#if !(defined(F_SEAL_SEAL) || (defined(HAVE_DECL_F_SEAL_SEAL) && HAVE_DECL_F_SEAL_SEAL)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(F_SEAL_SEAL) || (defined(HAVE_DECL_F_SEAL_SEAL) && HAVE_DECL_F_SEAL_SEAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SEAL_SEAL) == (1), "F_SEAL_SEAL != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_SEAL_SEAL 1 #endif -#if !(defined(F_SEAL_SHRINK) || (defined(HAVE_DECL_F_SEAL_SHRINK) && HAVE_DECL_F_SEAL_SHRINK)) +#if defined(F_SEAL_SHRINK) || (defined(HAVE_DECL_F_SEAL_SHRINK) && HAVE_DECL_F_SEAL_SHRINK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SEAL_SHRINK) == (2), "F_SEAL_SHRINK != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_SEAL_SHRINK 2 #endif -#if !(defined(F_SEAL_GROW) || (defined(HAVE_DECL_F_SEAL_GROW) && HAVE_DECL_F_SEAL_GROW)) +#if defined(F_SEAL_GROW) || (defined(HAVE_DECL_F_SEAL_GROW) && HAVE_DECL_F_SEAL_GROW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SEAL_GROW) == (4), "F_SEAL_GROW != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_SEAL_GROW 4 #endif -#if !(defined(F_SEAL_WRITE) || (defined(HAVE_DECL_F_SEAL_WRITE) && HAVE_DECL_F_SEAL_WRITE)) +#if defined(F_SEAL_WRITE) || (defined(HAVE_DECL_F_SEAL_WRITE) && HAVE_DECL_F_SEAL_WRITE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SEAL_WRITE) == (8), "F_SEAL_WRITE != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_SEAL_WRITE 8 #endif +#if defined(F_SEAL_FUTURE_WRITE) || (defined(HAVE_DECL_F_SEAL_FUTURE_WRITE) && HAVE_DECL_F_SEAL_FUTURE_WRITE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SEAL_FUTURE_WRITE) == (16), "F_SEAL_FUTURE_WRITE != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_SEAL_FUTURE_WRITE 16 +#endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat f_seals in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat f_seals in mpers mode + +# else static const struct xlat f_seals[] = { @@ -24,7 +53,10 @@ const struct xlat f_seals[] = { XLAT(F_SEAL_SHRINK), XLAT(F_SEAL_GROW), XLAT(F_SEAL_WRITE), + XLAT(F_SEAL_FUTURE_WRITE), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/f_seals.in b/xlat/f_seals.in index 7faad8f7..3bdceeb4 100644 --- a/xlat/f_seals.in +++ b/xlat/f_seals.in @@ -2,3 +2,4 @@ F_SEAL_SEAL 1 F_SEAL_SHRINK 2 F_SEAL_GROW 4 F_SEAL_WRITE 8 +F_SEAL_FUTURE_WRITE 16 diff --git a/xlat/falloc_flags.h b/xlat/falloc_flags.h index f75c9a8c..aaa7468a 100644 --- a/xlat/falloc_flags.h +++ b/xlat/falloc_flags.h @@ -1,31 +1,65 @@ /* Generated by ./xlat/gen.sh from ./xlat/falloc_flags.in; do not edit. */ -#if !(defined(FALLOC_FL_KEEP_SIZE) || (defined(HAVE_DECL_FALLOC_FL_KEEP_SIZE) && HAVE_DECL_FALLOC_FL_KEEP_SIZE)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(FALLOC_FL_KEEP_SIZE) || (defined(HAVE_DECL_FALLOC_FL_KEEP_SIZE) && HAVE_DECL_FALLOC_FL_KEEP_SIZE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FALLOC_FL_KEEP_SIZE) == (0x01), "FALLOC_FL_KEEP_SIZE != 0x01"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FALLOC_FL_KEEP_SIZE 0x01 #endif -#if !(defined(FALLOC_FL_PUNCH_HOLE) || (defined(HAVE_DECL_FALLOC_FL_PUNCH_HOLE) && HAVE_DECL_FALLOC_FL_PUNCH_HOLE)) +#if defined(FALLOC_FL_PUNCH_HOLE) || (defined(HAVE_DECL_FALLOC_FL_PUNCH_HOLE) && HAVE_DECL_FALLOC_FL_PUNCH_HOLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FALLOC_FL_PUNCH_HOLE) == (0x02), "FALLOC_FL_PUNCH_HOLE != 0x02"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FALLOC_FL_PUNCH_HOLE 0x02 #endif -#if !(defined(FALLOC_FL_NO_HIDE_STALE) || (defined(HAVE_DECL_FALLOC_FL_NO_HIDE_STALE) && HAVE_DECL_FALLOC_FL_NO_HIDE_STALE)) +#if defined(FALLOC_FL_NO_HIDE_STALE) || (defined(HAVE_DECL_FALLOC_FL_NO_HIDE_STALE) && HAVE_DECL_FALLOC_FL_NO_HIDE_STALE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FALLOC_FL_NO_HIDE_STALE) == (0x04), "FALLOC_FL_NO_HIDE_STALE != 0x04"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FALLOC_FL_NO_HIDE_STALE 0x04 #endif -#if !(defined(FALLOC_FL_COLLAPSE_RANGE) || (defined(HAVE_DECL_FALLOC_FL_COLLAPSE_RANGE) && HAVE_DECL_FALLOC_FL_COLLAPSE_RANGE)) +#if defined(FALLOC_FL_COLLAPSE_RANGE) || (defined(HAVE_DECL_FALLOC_FL_COLLAPSE_RANGE) && HAVE_DECL_FALLOC_FL_COLLAPSE_RANGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FALLOC_FL_COLLAPSE_RANGE) == (0x08), "FALLOC_FL_COLLAPSE_RANGE != 0x08"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FALLOC_FL_COLLAPSE_RANGE 0x08 #endif -#if !(defined(FALLOC_FL_ZERO_RANGE) || (defined(HAVE_DECL_FALLOC_FL_ZERO_RANGE) && HAVE_DECL_FALLOC_FL_ZERO_RANGE)) +#if defined(FALLOC_FL_ZERO_RANGE) || (defined(HAVE_DECL_FALLOC_FL_ZERO_RANGE) && HAVE_DECL_FALLOC_FL_ZERO_RANGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FALLOC_FL_ZERO_RANGE) == (0x10), "FALLOC_FL_ZERO_RANGE != 0x10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FALLOC_FL_ZERO_RANGE 0x10 #endif -#if !(defined(FALLOC_FL_INSERT_RANGE) || (defined(HAVE_DECL_FALLOC_FL_INSERT_RANGE) && HAVE_DECL_FALLOC_FL_INSERT_RANGE)) +#if defined(FALLOC_FL_INSERT_RANGE) || (defined(HAVE_DECL_FALLOC_FL_INSERT_RANGE) && HAVE_DECL_FALLOC_FL_INSERT_RANGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FALLOC_FL_INSERT_RANGE) == (0x20), "FALLOC_FL_INSERT_RANGE != 0x20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FALLOC_FL_INSERT_RANGE 0x20 #endif -#if !(defined(FALLOC_FL_UNSHARE_RANGE) || (defined(HAVE_DECL_FALLOC_FL_UNSHARE_RANGE) && HAVE_DECL_FALLOC_FL_UNSHARE_RANGE)) +#if defined(FALLOC_FL_UNSHARE_RANGE) || (defined(HAVE_DECL_FALLOC_FL_UNSHARE_RANGE) && HAVE_DECL_FALLOC_FL_UNSHARE_RANGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FALLOC_FL_UNSHARE_RANGE) == (0x40), "FALLOC_FL_UNSHARE_RANGE != 0x40"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FALLOC_FL_UNSHARE_RANGE 0x40 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat falloc_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat falloc_flags in mpers mode + +# else static const struct xlat falloc_flags[] = { @@ -39,4 +73,6 @@ const struct xlat falloc_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/fan_classes.h b/xlat/fan_classes.h index cd26d75a..ff4ff95d 100644 --- a/xlat/fan_classes.h +++ b/xlat/fan_classes.h @@ -1,19 +1,37 @@ /* Generated by ./xlat/gen.sh from ./xlat/fan_classes.in; do not edit. */ -#if !(defined(FAN_CLASS_NOTIF) || (defined(HAVE_DECL_FAN_CLASS_NOTIF) && HAVE_DECL_FAN_CLASS_NOTIF)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(FAN_CLASS_NOTIF) || (defined(HAVE_DECL_FAN_CLASS_NOTIF) && HAVE_DECL_FAN_CLASS_NOTIF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_CLASS_NOTIF) == (0x00000000), "FAN_CLASS_NOTIF != 0x00000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_CLASS_NOTIF 0x00000000 #endif -#if !(defined(FAN_CLASS_CONTENT) || (defined(HAVE_DECL_FAN_CLASS_CONTENT) && HAVE_DECL_FAN_CLASS_CONTENT)) +#if defined(FAN_CLASS_CONTENT) || (defined(HAVE_DECL_FAN_CLASS_CONTENT) && HAVE_DECL_FAN_CLASS_CONTENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_CLASS_CONTENT) == (0x00000004), "FAN_CLASS_CONTENT != 0x00000004"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_CLASS_CONTENT 0x00000004 #endif -#if !(defined(FAN_CLASS_PRE_CONTENT) || (defined(HAVE_DECL_FAN_CLASS_PRE_CONTENT) && HAVE_DECL_FAN_CLASS_PRE_CONTENT)) +#if defined(FAN_CLASS_PRE_CONTENT) || (defined(HAVE_DECL_FAN_CLASS_PRE_CONTENT) && HAVE_DECL_FAN_CLASS_PRE_CONTENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_CLASS_PRE_CONTENT) == (0x00000008), "FAN_CLASS_PRE_CONTENT != 0x00000008"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_CLASS_PRE_CONTENT 0x00000008 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat fan_classes in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat fan_classes in mpers mode + +# else static const struct xlat fan_classes[] = { @@ -23,4 +41,6 @@ const struct xlat fan_classes[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/fan_event_flags.h b/xlat/fan_event_flags.h index 7c19d826..a5bd03c3 100644 --- a/xlat/fan_event_flags.h +++ b/xlat/fan_event_flags.h @@ -1,54 +1,174 @@ /* Generated by ./xlat/gen.sh from ./xlat/fan_event_flags.in; do not edit. */ -#if !(defined(FAN_ACCESS) || (defined(HAVE_DECL_FAN_ACCESS) && HAVE_DECL_FAN_ACCESS)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(FAN_ACCESS) || (defined(HAVE_DECL_FAN_ACCESS) && HAVE_DECL_FAN_ACCESS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_ACCESS) == (0x00000001), "FAN_ACCESS != 0x00000001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_ACCESS 0x00000001 #endif -#if !(defined(FAN_MODIFY) || (defined(HAVE_DECL_FAN_MODIFY) && HAVE_DECL_FAN_MODIFY)) +#if defined(FAN_MODIFY) || (defined(HAVE_DECL_FAN_MODIFY) && HAVE_DECL_FAN_MODIFY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_MODIFY) == (0x00000002), "FAN_MODIFY != 0x00000002"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_MODIFY 0x00000002 #endif -#if !(defined(FAN_CLOSE_WRITE) || (defined(HAVE_DECL_FAN_CLOSE_WRITE) && HAVE_DECL_FAN_CLOSE_WRITE)) +#if defined(FAN_ATTRIB) || (defined(HAVE_DECL_FAN_ATTRIB) && HAVE_DECL_FAN_ATTRIB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_ATTRIB) == (0x00000004), "FAN_ATTRIB != 0x00000004"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FAN_ATTRIB 0x00000004 +#endif +#if defined(FAN_CLOSE_WRITE) || (defined(HAVE_DECL_FAN_CLOSE_WRITE) && HAVE_DECL_FAN_CLOSE_WRITE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_CLOSE_WRITE) == (0x00000008), "FAN_CLOSE_WRITE != 0x00000008"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_CLOSE_WRITE 0x00000008 #endif -#if !(defined(FAN_CLOSE_NOWRITE) || (defined(HAVE_DECL_FAN_CLOSE_NOWRITE) && HAVE_DECL_FAN_CLOSE_NOWRITE)) +#if defined(FAN_CLOSE_NOWRITE) || (defined(HAVE_DECL_FAN_CLOSE_NOWRITE) && HAVE_DECL_FAN_CLOSE_NOWRITE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_CLOSE_NOWRITE) == (0x00000010), "FAN_CLOSE_NOWRITE != 0x00000010"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_CLOSE_NOWRITE 0x00000010 #endif -#if !(defined(FAN_OPEN) || (defined(HAVE_DECL_FAN_OPEN) && HAVE_DECL_FAN_OPEN)) +#if defined(FAN_OPEN) || (defined(HAVE_DECL_FAN_OPEN) && HAVE_DECL_FAN_OPEN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_OPEN) == (0x00000020), "FAN_OPEN != 0x00000020"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_OPEN 0x00000020 #endif -#if !(defined(FAN_Q_OVERFLOW) || (defined(HAVE_DECL_FAN_Q_OVERFLOW) && HAVE_DECL_FAN_Q_OVERFLOW)) +#if defined(FAN_MOVED_FROM) || (defined(HAVE_DECL_FAN_MOVED_FROM) && HAVE_DECL_FAN_MOVED_FROM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_MOVED_FROM) == (0x00000040), "FAN_MOVED_FROM != 0x00000040"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FAN_MOVED_FROM 0x00000040 +#endif +#if defined(FAN_MOVED_TO) || (defined(HAVE_DECL_FAN_MOVED_TO) && HAVE_DECL_FAN_MOVED_TO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_MOVED_TO) == (0x00000080), "FAN_MOVED_TO != 0x00000080"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FAN_MOVED_TO 0x00000080 +#endif +#if defined(FAN_CREATE) || (defined(HAVE_DECL_FAN_CREATE) && HAVE_DECL_FAN_CREATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_CREATE) == (0x00000100), "FAN_CREATE != 0x00000100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FAN_CREATE 0x00000100 +#endif +#if defined(FAN_DELETE) || (defined(HAVE_DECL_FAN_DELETE) && HAVE_DECL_FAN_DELETE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_DELETE) == (0x00000200), "FAN_DELETE != 0x00000200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FAN_DELETE 0x00000200 +#endif +#if defined(FAN_DELETE_SELF) || (defined(HAVE_DECL_FAN_DELETE_SELF) && HAVE_DECL_FAN_DELETE_SELF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_DELETE_SELF) == (0x00000400), "FAN_DELETE_SELF != 0x00000400"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FAN_DELETE_SELF 0x00000400 +#endif +#if defined(FAN_MOVE_SELF) || (defined(HAVE_DECL_FAN_MOVE_SELF) && HAVE_DECL_FAN_MOVE_SELF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_MOVE_SELF) == (0x00000800), "FAN_MOVE_SELF != 0x00000800"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FAN_MOVE_SELF 0x00000800 +#endif +#if defined(FAN_OPEN_EXEC) || (defined(HAVE_DECL_FAN_OPEN_EXEC) && HAVE_DECL_FAN_OPEN_EXEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_OPEN_EXEC) == (0x00001000), "FAN_OPEN_EXEC != 0x00001000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FAN_OPEN_EXEC 0x00001000 +#endif +#if defined(FAN_Q_OVERFLOW) || (defined(HAVE_DECL_FAN_Q_OVERFLOW) && HAVE_DECL_FAN_Q_OVERFLOW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_Q_OVERFLOW) == (0x00004000), "FAN_Q_OVERFLOW != 0x00004000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_Q_OVERFLOW 0x00004000 #endif -#if !(defined(FAN_OPEN_PERM) || (defined(HAVE_DECL_FAN_OPEN_PERM) && HAVE_DECL_FAN_OPEN_PERM)) +#if defined(FAN_OPEN_PERM) || (defined(HAVE_DECL_FAN_OPEN_PERM) && HAVE_DECL_FAN_OPEN_PERM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_OPEN_PERM) == (0x00010000), "FAN_OPEN_PERM != 0x00010000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_OPEN_PERM 0x00010000 #endif -#if !(defined(FAN_ACCESS_PERM) || (defined(HAVE_DECL_FAN_ACCESS_PERM) && HAVE_DECL_FAN_ACCESS_PERM)) +#if defined(FAN_ACCESS_PERM) || (defined(HAVE_DECL_FAN_ACCESS_PERM) && HAVE_DECL_FAN_ACCESS_PERM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_ACCESS_PERM) == (0x00020000), "FAN_ACCESS_PERM != 0x00020000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_ACCESS_PERM 0x00020000 #endif -#if !(defined(FAN_ONDIR) || (defined(HAVE_DECL_FAN_ONDIR) && HAVE_DECL_FAN_ONDIR)) +#if defined(FAN_OPEN_EXEC_PERM) || (defined(HAVE_DECL_FAN_OPEN_EXEC_PERM) && HAVE_DECL_FAN_OPEN_EXEC_PERM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_OPEN_EXEC_PERM) == (0x00040000), "FAN_OPEN_EXEC_PERM != 0x00040000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FAN_OPEN_EXEC_PERM 0x00040000 +#endif +#if defined(FAN_ONDIR) || (defined(HAVE_DECL_FAN_ONDIR) && HAVE_DECL_FAN_ONDIR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_ONDIR) == (0x40000000), "FAN_ONDIR != 0x40000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_ONDIR 0x40000000 #endif -#if !(defined(FAN_EVENT_ON_CHILD) || (defined(HAVE_DECL_FAN_EVENT_ON_CHILD) && HAVE_DECL_FAN_EVENT_ON_CHILD)) +#if defined(FAN_EVENT_ON_CHILD) || (defined(HAVE_DECL_FAN_EVENT_ON_CHILD) && HAVE_DECL_FAN_EVENT_ON_CHILD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_EVENT_ON_CHILD) == (0x08000000), "FAN_EVENT_ON_CHILD != 0x08000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_EVENT_ON_CHILD 0x08000000 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat fan_event_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat fan_event_flags in mpers mode + +# else static const struct xlat fan_event_flags[] = { XLAT(FAN_ACCESS), XLAT(FAN_MODIFY), + XLAT(FAN_ATTRIB), XLAT(FAN_CLOSE_WRITE), XLAT(FAN_CLOSE_NOWRITE), XLAT(FAN_OPEN), + XLAT(FAN_MOVED_FROM), + XLAT(FAN_MOVED_TO), + XLAT(FAN_CREATE), + XLAT(FAN_DELETE), + XLAT(FAN_DELETE_SELF), + XLAT(FAN_MOVE_SELF), + XLAT(FAN_OPEN_EXEC), XLAT(FAN_Q_OVERFLOW), XLAT(FAN_OPEN_PERM), XLAT(FAN_ACCESS_PERM), + XLAT(FAN_OPEN_EXEC_PERM), XLAT(FAN_ONDIR), XLAT(FAN_EVENT_ON_CHILD), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/fan_event_flags.in b/xlat/fan_event_flags.in index c8d4552b..53ecdb69 100644 --- a/xlat/fan_event_flags.in +++ b/xlat/fan_event_flags.in @@ -1,10 +1,19 @@ -FAN_ACCESS 0x00000001 -FAN_MODIFY 0x00000002 -FAN_CLOSE_WRITE 0x00000008 -FAN_CLOSE_NOWRITE 0x00000010 -FAN_OPEN 0x00000020 -FAN_Q_OVERFLOW 0x00004000 -FAN_OPEN_PERM 0x00010000 -FAN_ACCESS_PERM 0x00020000 -FAN_ONDIR 0x40000000 -FAN_EVENT_ON_CHILD 0x08000000 +FAN_ACCESS 0x00000001 +FAN_MODIFY 0x00000002 +FAN_ATTRIB 0x00000004 +FAN_CLOSE_WRITE 0x00000008 +FAN_CLOSE_NOWRITE 0x00000010 +FAN_OPEN 0x00000020 +FAN_MOVED_FROM 0x00000040 +FAN_MOVED_TO 0x00000080 +FAN_CREATE 0x00000100 +FAN_DELETE 0x00000200 +FAN_DELETE_SELF 0x00000400 +FAN_MOVE_SELF 0x00000800 +FAN_OPEN_EXEC 0x00001000 +FAN_Q_OVERFLOW 0x00004000 +FAN_OPEN_PERM 0x00010000 +FAN_ACCESS_PERM 0x00020000 +FAN_OPEN_EXEC_PERM 0x00040000 +FAN_ONDIR 0x40000000 +FAN_EVENT_ON_CHILD 0x08000000 diff --git a/xlat/fan_init_flags.h b/xlat/fan_init_flags.h index b11e47a3..2cb87e24 100644 --- a/xlat/fan_init_flags.h +++ b/xlat/fan_init_flags.h @@ -1,22 +1,65 @@ /* Generated by ./xlat/gen.sh from ./xlat/fan_init_flags.in; do not edit. */ -#if !(defined(FAN_CLOEXEC) || (defined(HAVE_DECL_FAN_CLOEXEC) && HAVE_DECL_FAN_CLOEXEC)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(FAN_CLOEXEC) || (defined(HAVE_DECL_FAN_CLOEXEC) && HAVE_DECL_FAN_CLOEXEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_CLOEXEC) == (0x00000001), "FAN_CLOEXEC != 0x00000001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_CLOEXEC 0x00000001 #endif -#if !(defined(FAN_NONBLOCK) || (defined(HAVE_DECL_FAN_NONBLOCK) && HAVE_DECL_FAN_NONBLOCK)) +#if defined(FAN_NONBLOCK) || (defined(HAVE_DECL_FAN_NONBLOCK) && HAVE_DECL_FAN_NONBLOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_NONBLOCK) == (0x00000002), "FAN_NONBLOCK != 0x00000002"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_NONBLOCK 0x00000002 #endif -#if !(defined(FAN_UNLIMITED_QUEUE) || (defined(HAVE_DECL_FAN_UNLIMITED_QUEUE) && HAVE_DECL_FAN_UNLIMITED_QUEUE)) +#if defined(FAN_UNLIMITED_QUEUE) || (defined(HAVE_DECL_FAN_UNLIMITED_QUEUE) && HAVE_DECL_FAN_UNLIMITED_QUEUE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_UNLIMITED_QUEUE) == (0x00000010), "FAN_UNLIMITED_QUEUE != 0x00000010"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_UNLIMITED_QUEUE 0x00000010 #endif -#if !(defined(FAN_UNLIMITED_MARKS) || (defined(HAVE_DECL_FAN_UNLIMITED_MARKS) && HAVE_DECL_FAN_UNLIMITED_MARKS)) +#if defined(FAN_UNLIMITED_MARKS) || (defined(HAVE_DECL_FAN_UNLIMITED_MARKS) && HAVE_DECL_FAN_UNLIMITED_MARKS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_UNLIMITED_MARKS) == (0x00000020), "FAN_UNLIMITED_MARKS != 0x00000020"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_UNLIMITED_MARKS 0x00000020 #endif +#if defined(FAN_ENABLE_AUDIT) || (defined(HAVE_DECL_FAN_ENABLE_AUDIT) && HAVE_DECL_FAN_ENABLE_AUDIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_ENABLE_AUDIT) == (0x00000040), "FAN_ENABLE_AUDIT != 0x00000040"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FAN_ENABLE_AUDIT 0x00000040 +#endif +#if defined(FAN_REPORT_TID) || (defined(HAVE_DECL_FAN_REPORT_TID) && HAVE_DECL_FAN_REPORT_TID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_REPORT_TID) == (0x00000100), "FAN_REPORT_TID != 0x00000100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FAN_REPORT_TID 0x00000100 +#endif +#if defined(FAN_REPORT_FID) || (defined(HAVE_DECL_FAN_REPORT_FID) && HAVE_DECL_FAN_REPORT_FID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_REPORT_FID) == (0x00000200), "FAN_REPORT_FID != 0x00000200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FAN_REPORT_FID 0x00000200 +#endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat fan_init_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat fan_init_flags in mpers mode + +# else static const struct xlat fan_init_flags[] = { @@ -24,7 +67,12 @@ const struct xlat fan_init_flags[] = { XLAT(FAN_NONBLOCK), XLAT(FAN_UNLIMITED_QUEUE), XLAT(FAN_UNLIMITED_MARKS), + XLAT(FAN_ENABLE_AUDIT), + XLAT(FAN_REPORT_TID), + XLAT(FAN_REPORT_FID), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/fan_init_flags.in b/xlat/fan_init_flags.in index ca330392..14a9fd24 100644 --- a/xlat/fan_init_flags.in +++ b/xlat/fan_init_flags.in @@ -2,3 +2,6 @@ FAN_CLOEXEC 0x00000001 FAN_NONBLOCK 0x00000002 FAN_UNLIMITED_QUEUE 0x00000010 FAN_UNLIMITED_MARKS 0x00000020 +FAN_ENABLE_AUDIT 0x00000040 +FAN_REPORT_TID 0x00000100 +FAN_REPORT_FID 0x00000200 diff --git a/xlat/fan_mark_flags.h b/xlat/fan_mark_flags.h index f2f9140e..6f2e9f41 100644 --- a/xlat/fan_mark_flags.h +++ b/xlat/fan_mark_flags.h @@ -1,34 +1,79 @@ /* Generated by ./xlat/gen.sh from ./xlat/fan_mark_flags.in; do not edit. */ -#if !(defined(FAN_MARK_ADD) || (defined(HAVE_DECL_FAN_MARK_ADD) && HAVE_DECL_FAN_MARK_ADD)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(FAN_MARK_ADD) || (defined(HAVE_DECL_FAN_MARK_ADD) && HAVE_DECL_FAN_MARK_ADD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_MARK_ADD) == (0x00000001), "FAN_MARK_ADD != 0x00000001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_MARK_ADD 0x00000001 #endif -#if !(defined(FAN_MARK_REMOVE) || (defined(HAVE_DECL_FAN_MARK_REMOVE) && HAVE_DECL_FAN_MARK_REMOVE)) +#if defined(FAN_MARK_REMOVE) || (defined(HAVE_DECL_FAN_MARK_REMOVE) && HAVE_DECL_FAN_MARK_REMOVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_MARK_REMOVE) == (0x00000002), "FAN_MARK_REMOVE != 0x00000002"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_MARK_REMOVE 0x00000002 #endif -#if !(defined(FAN_MARK_DONT_FOLLOW) || (defined(HAVE_DECL_FAN_MARK_DONT_FOLLOW) && HAVE_DECL_FAN_MARK_DONT_FOLLOW)) +#if defined(FAN_MARK_DONT_FOLLOW) || (defined(HAVE_DECL_FAN_MARK_DONT_FOLLOW) && HAVE_DECL_FAN_MARK_DONT_FOLLOW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_MARK_DONT_FOLLOW) == (0x00000004), "FAN_MARK_DONT_FOLLOW != 0x00000004"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_MARK_DONT_FOLLOW 0x00000004 #endif -#if !(defined(FAN_MARK_ONLYDIR) || (defined(HAVE_DECL_FAN_MARK_ONLYDIR) && HAVE_DECL_FAN_MARK_ONLYDIR)) +#if defined(FAN_MARK_ONLYDIR) || (defined(HAVE_DECL_FAN_MARK_ONLYDIR) && HAVE_DECL_FAN_MARK_ONLYDIR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_MARK_ONLYDIR) == (0x00000008), "FAN_MARK_ONLYDIR != 0x00000008"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_MARK_ONLYDIR 0x00000008 #endif -#if !(defined(FAN_MARK_MOUNT) || (defined(HAVE_DECL_FAN_MARK_MOUNT) && HAVE_DECL_FAN_MARK_MOUNT)) +#if defined(FAN_MARK_MOUNT) || (defined(HAVE_DECL_FAN_MARK_MOUNT) && HAVE_DECL_FAN_MARK_MOUNT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_MARK_MOUNT) == (0x00000010), "FAN_MARK_MOUNT != 0x00000010"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_MARK_MOUNT 0x00000010 #endif -#if !(defined(FAN_MARK_IGNORED_MASK) || (defined(HAVE_DECL_FAN_MARK_IGNORED_MASK) && HAVE_DECL_FAN_MARK_IGNORED_MASK)) +#if defined(FAN_MARK_IGNORED_MASK) || (defined(HAVE_DECL_FAN_MARK_IGNORED_MASK) && HAVE_DECL_FAN_MARK_IGNORED_MASK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_MARK_IGNORED_MASK) == (0x00000020), "FAN_MARK_IGNORED_MASK != 0x00000020"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_MARK_IGNORED_MASK 0x00000020 #endif -#if !(defined(FAN_MARK_IGNORED_SURV_MODIFY) || (defined(HAVE_DECL_FAN_MARK_IGNORED_SURV_MODIFY) && HAVE_DECL_FAN_MARK_IGNORED_SURV_MODIFY)) +#if defined(FAN_MARK_IGNORED_SURV_MODIFY) || (defined(HAVE_DECL_FAN_MARK_IGNORED_SURV_MODIFY) && HAVE_DECL_FAN_MARK_IGNORED_SURV_MODIFY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_MARK_IGNORED_SURV_MODIFY) == (0x00000040), "FAN_MARK_IGNORED_SURV_MODIFY != 0x00000040"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040 #endif -#if !(defined(FAN_MARK_FLUSH) || (defined(HAVE_DECL_FAN_MARK_FLUSH) && HAVE_DECL_FAN_MARK_FLUSH)) +#if defined(FAN_MARK_FLUSH) || (defined(HAVE_DECL_FAN_MARK_FLUSH) && HAVE_DECL_FAN_MARK_FLUSH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_MARK_FLUSH) == (0x00000080), "FAN_MARK_FLUSH != 0x00000080"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FAN_MARK_FLUSH 0x00000080 #endif +#if defined(FAN_MARK_FILESYSTEM) || (defined(HAVE_DECL_FAN_MARK_FILESYSTEM) && HAVE_DECL_FAN_MARK_FILESYSTEM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FAN_MARK_FILESYSTEM) == (0x00000100), "FAN_MARK_FILESYSTEM != 0x00000100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FAN_MARK_FILESYSTEM 0x00000100 +#endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat fan_mark_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat fan_mark_flags in mpers mode + +# else static const struct xlat fan_mark_flags[] = { @@ -40,7 +85,10 @@ const struct xlat fan_mark_flags[] = { XLAT(FAN_MARK_IGNORED_MASK), XLAT(FAN_MARK_IGNORED_SURV_MODIFY), XLAT(FAN_MARK_FLUSH), + XLAT(FAN_MARK_FILESYSTEM), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/fan_mark_flags.in b/xlat/fan_mark_flags.in index 134af4b2..56cd8e58 100644 --- a/xlat/fan_mark_flags.in +++ b/xlat/fan_mark_flags.in @@ -6,3 +6,4 @@ FAN_MARK_MOUNT 0x00000010 FAN_MARK_IGNORED_MASK 0x00000020 FAN_MARK_IGNORED_SURV_MODIFY 0x00000040 FAN_MARK_FLUSH 0x00000080 +FAN_MARK_FILESYSTEM 0x00000100 diff --git a/xlat/fcntl64cmds.h b/xlat/fcntl64cmds.h deleted file mode 100644 index e01e533c..00000000 --- a/xlat/fcntl64cmds.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Generated by ./xlat/gen.sh from ./xlat/fcntl64cmds.in; do not edit. */ -#if !(defined(F_GETLK64) || (defined(HAVE_DECL_F_GETLK64) && HAVE_DECL_F_GETLK64)) -# define F_GETLK64 12 -#endif -#if !(defined(F_SETLK64) || (defined(HAVE_DECL_F_SETLK64) && HAVE_DECL_F_SETLK64)) -# define F_SETLK64 13 -#endif -#if !(defined(F_SETLKW64) || (defined(HAVE_DECL_F_SETLKW64) && HAVE_DECL_F_SETLKW64)) -# define F_SETLKW64 14 -#endif - -#ifdef IN_MPERS - -# error static const struct xlat fcntl64cmds in mpers mode - -#else - -static -const struct xlat fcntl64cmds[] = { -/* asm-generic/fcntl.h */ - XLAT(F_GETLK64), - XLAT(F_SETLK64), - XLAT(F_SETLKW64), - XLAT_END -}; - -#endif /* !IN_MPERS */ diff --git a/xlat/fcntl64cmds.in b/xlat/fcntl64cmds.in deleted file mode 100644 index 074efe45..00000000 --- a/xlat/fcntl64cmds.in +++ /dev/null @@ -1,4 +0,0 @@ -/* asm-generic/fcntl.h */ -F_GETLK64 12 -F_SETLK64 13 -F_SETLKW64 14 diff --git a/xlat/fcntlcmds.h b/xlat/fcntlcmds.h index 33280f33..ad354de1 100644 --- a/xlat/fcntlcmds.h +++ b/xlat/fcntlcmds.h @@ -1,115 +1,489 @@ /* Generated by ./xlat/gen.sh from ./xlat/fcntlcmds.in; do not edit. */ -#if !(defined(F_DUPFD) || (defined(HAVE_DECL_F_DUPFD) && HAVE_DECL_F_DUPFD)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(F_DUPFD) || (defined(HAVE_DECL_F_DUPFD) && HAVE_DECL_F_DUPFD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_DUPFD) == (0), "F_DUPFD != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_DUPFD 0 #endif -#if !(defined(F_GETFD) || (defined(HAVE_DECL_F_GETFD) && HAVE_DECL_F_GETFD)) +#if defined(F_GETFD) || (defined(HAVE_DECL_F_GETFD) && HAVE_DECL_F_GETFD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_GETFD) == (1), "F_GETFD != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_GETFD 1 #endif -#if !(defined(F_SETFD) || (defined(HAVE_DECL_F_SETFD) && HAVE_DECL_F_SETFD)) +#if defined(F_SETFD) || (defined(HAVE_DECL_F_SETFD) && HAVE_DECL_F_SETFD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SETFD) == (2), "F_SETFD != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_SETFD 2 #endif -#if !(defined(F_GETFL) || (defined(HAVE_DECL_F_GETFL) && HAVE_DECL_F_GETFL)) +#if defined(F_GETFL) || (defined(HAVE_DECL_F_GETFL) && HAVE_DECL_F_GETFL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_GETFL) == (3), "F_GETFL != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_GETFL 3 #endif -#if !(defined(F_SETFL) || (defined(HAVE_DECL_F_SETFL) && HAVE_DECL_F_SETFL)) +#if defined(F_SETFL) || (defined(HAVE_DECL_F_SETFL) && HAVE_DECL_F_SETFL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SETFL) == (4), "F_SETFL != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_SETFL 4 #endif -#if !(defined(F_GETLK) || (defined(HAVE_DECL_F_GETLK) && HAVE_DECL_F_GETLK)) +#if defined __alpha__ || defined __sparc__ +#if defined(F_GETLK) || (defined(HAVE_DECL_F_GETLK) && HAVE_DECL_F_GETLK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_GETLK) == (7), "F_GETLK != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_GETLK 7 +#endif +#elif defined __mips__ +#if defined(F_GETLK) || (defined(HAVE_DECL_F_GETLK) && HAVE_DECL_F_GETLK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_GETLK) == (14), "F_GETLK != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_GETLK 14 +#endif +#else +#if defined(F_GETLK) || (defined(HAVE_DECL_F_GETLK) && HAVE_DECL_F_GETLK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_GETLK) == (5), "F_GETLK != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_GETLK 5 #endif -#if !(defined(F_SETLK) || (defined(HAVE_DECL_F_SETLK) && HAVE_DECL_F_SETLK)) +#endif +#if defined __alpha__ || defined __sparc__ +#if defined(F_SETLK) || (defined(HAVE_DECL_F_SETLK) && HAVE_DECL_F_SETLK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SETLK) == (8), "F_SETLK != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_SETLK 8 +#endif +#if defined(F_SETLKW) || (defined(HAVE_DECL_F_SETLKW) && HAVE_DECL_F_SETLKW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SETLKW) == (9), "F_SETLKW != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_SETLKW 9 +#endif +#else +#if defined(F_SETLK) || (defined(HAVE_DECL_F_SETLK) && HAVE_DECL_F_SETLK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SETLK) == (6), "F_SETLK != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_SETLK 6 #endif -#if !(defined(F_SETLKW) || (defined(HAVE_DECL_F_SETLKW) && HAVE_DECL_F_SETLKW)) +#if defined(F_SETLKW) || (defined(HAVE_DECL_F_SETLKW) && HAVE_DECL_F_SETLKW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SETLKW) == (7), "F_SETLKW != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_SETLKW 7 #endif -#if !(defined(F_SETOWN) || (defined(HAVE_DECL_F_SETOWN) && HAVE_DECL_F_SETOWN)) +#endif +#if defined __alpha__ +#if defined(F_SETOWN) || (defined(HAVE_DECL_F_SETOWN) && HAVE_DECL_F_SETOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SETOWN) == (5), "F_SETOWN != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_SETOWN 5 +#endif +#if defined(F_GETOWN) || (defined(HAVE_DECL_F_GETOWN) && HAVE_DECL_F_GETOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_GETOWN) == (6), "F_GETOWN != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_GETOWN 6 +#endif +#elif defined __hppa__ +#if defined(F_GETOWN) || (defined(HAVE_DECL_F_GETOWN) && HAVE_DECL_F_GETOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_GETOWN) == (11), "F_GETOWN != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_GETOWN 11 +#endif +#if defined(F_SETOWN) || (defined(HAVE_DECL_F_SETOWN) && HAVE_DECL_F_SETOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SETOWN) == (12), "F_SETOWN != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_SETOWN 12 +#endif +#elif defined __mips__ +#if defined(F_GETOWN) || (defined(HAVE_DECL_F_GETOWN) && HAVE_DECL_F_GETOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_GETOWN) == (23), "F_GETOWN != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_GETOWN 23 +#endif +#if defined(F_SETOWN) || (defined(HAVE_DECL_F_SETOWN) && HAVE_DECL_F_SETOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SETOWN) == (24), "F_SETOWN != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_SETOWN 24 +#endif +#elif defined __sparc__ +#if defined(F_GETOWN) || (defined(HAVE_DECL_F_GETOWN) && HAVE_DECL_F_GETOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_GETOWN) == (5), "F_GETOWN != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_GETOWN 5 +#endif +#if defined(F_SETOWN) || (defined(HAVE_DECL_F_SETOWN) && HAVE_DECL_F_SETOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SETOWN) == (6), "F_SETOWN != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_SETOWN 6 +#endif +#else +#if defined(F_SETOWN) || (defined(HAVE_DECL_F_SETOWN) && HAVE_DECL_F_SETOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SETOWN) == (8), "F_SETOWN != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_SETOWN 8 #endif -#if !(defined(F_GETOWN) || (defined(HAVE_DECL_F_GETOWN) && HAVE_DECL_F_GETOWN)) +#if defined(F_GETOWN) || (defined(HAVE_DECL_F_GETOWN) && HAVE_DECL_F_GETOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_GETOWN) == (9), "F_GETOWN != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_GETOWN 9 #endif -#if !(defined(F_SETSIG) || (defined(HAVE_DECL_F_SETSIG) && HAVE_DECL_F_SETSIG)) +#endif +#ifdef __hppa__ +#if defined(F_SETSIG) || (defined(HAVE_DECL_F_SETSIG) && HAVE_DECL_F_SETSIG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SETSIG) == (13), "F_SETSIG != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_SETSIG 13 +#endif +#if defined(F_GETSIG) || (defined(HAVE_DECL_F_GETSIG) && HAVE_DECL_F_GETSIG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_GETSIG) == (14), "F_GETSIG != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_GETSIG 14 +#endif +#else +#if defined(F_SETSIG) || (defined(HAVE_DECL_F_SETSIG) && HAVE_DECL_F_SETSIG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SETSIG) == (10), "F_SETSIG != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_SETSIG 10 #endif -#if !(defined(F_GETSIG) || (defined(HAVE_DECL_F_GETSIG) && HAVE_DECL_F_GETSIG)) +#if defined(F_GETSIG) || (defined(HAVE_DECL_F_GETSIG) && HAVE_DECL_F_GETSIG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_GETSIG) == (11), "F_GETSIG != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_GETSIG 11 #endif -#if !(defined(F_SETOWN_EX) || (defined(HAVE_DECL_F_SETOWN_EX) && HAVE_DECL_F_SETOWN_EX)) +#endif +#if defined __hppa__ +#if defined(F_GETLK64) || (defined(HAVE_DECL_F_GETLK64) && HAVE_DECL_F_GETLK64) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_GETLK64) == (8), "F_GETLK64 != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_GETLK64 8 +#endif +#if defined(F_SETLK64) || (defined(HAVE_DECL_F_SETLK64) && HAVE_DECL_F_SETLK64) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SETLK64) == (9), "F_SETLK64 != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_SETLK64 9 +#endif +#if defined(F_SETLKW64) || (defined(HAVE_DECL_F_SETLKW64) && HAVE_DECL_F_SETLKW64) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SETLKW64) == (10), "F_SETLKW64 != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_SETLKW64 10 +#endif +#elif defined __mips__ && !defined __mips64 +#if defined(F_GETLK64) || (defined(HAVE_DECL_F_GETLK64) && HAVE_DECL_F_GETLK64) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_GETLK64) == (33), "F_GETLK64 != 33"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_GETLK64 33 +#endif +#if defined(F_SETLK64) || (defined(HAVE_DECL_F_SETLK64) && HAVE_DECL_F_SETLK64) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SETLK64) == (34), "F_SETLK64 != 34"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_SETLK64 34 +#endif +#if defined(F_SETLKW64) || (defined(HAVE_DECL_F_SETLKW64) && HAVE_DECL_F_SETLKW64) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SETLKW64) == (35), "F_SETLKW64 != 35"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_SETLKW64 35 +#endif +#else +#if defined(F_GETLK64) || (defined(HAVE_DECL_F_GETLK64) && HAVE_DECL_F_GETLK64) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_GETLK64) == (12), "F_GETLK64 != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_GETLK64 12 +#endif +#if defined(F_SETLK64) || (defined(HAVE_DECL_F_SETLK64) && HAVE_DECL_F_SETLK64) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SETLK64) == (13), "F_SETLK64 != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_SETLK64 13 +#endif +#if defined(F_SETLKW64) || (defined(HAVE_DECL_F_SETLKW64) && HAVE_DECL_F_SETLKW64) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SETLKW64) == (14), "F_SETLKW64 != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define F_SETLKW64 14 +#endif +#endif +#ifndef STRACE_WORKAROUND_FOR_F_OWNER_EX +# define STRACE_WORKAROUND_FOR_F_OWNER_EX +# if defined F_SETOWN_EX && F_SETOWN_EX != 15 +# warning invalid value of F_SETOWN_EX ignored +# endif +# undef F_SETOWN_EX +# if defined F_GETOWN_EX && F_GETOWN_EX != 16 +# warning invalid value of F_GETOWN_EX ignored +# endif +# undef F_GETOWN_EX +#endif +#if defined(F_SETOWN_EX) || (defined(HAVE_DECL_F_SETOWN_EX) && HAVE_DECL_F_SETOWN_EX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SETOWN_EX) == (15), "F_SETOWN_EX != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_SETOWN_EX 15 #endif -#if !(defined(F_GETOWN_EX) || (defined(HAVE_DECL_F_GETOWN_EX) && HAVE_DECL_F_GETOWN_EX)) +#if defined(F_GETOWN_EX) || (defined(HAVE_DECL_F_GETOWN_EX) && HAVE_DECL_F_GETOWN_EX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_GETOWN_EX) == (16), "F_GETOWN_EX != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_GETOWN_EX 16 #endif -#if !(defined(F_GETOWNER_UIDS) || (defined(HAVE_DECL_F_GETOWNER_UIDS) && HAVE_DECL_F_GETOWNER_UIDS)) +#if defined(F_GETOWNER_UIDS) || (defined(HAVE_DECL_F_GETOWNER_UIDS) && HAVE_DECL_F_GETOWNER_UIDS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_GETOWNER_UIDS) == (17), "F_GETOWNER_UIDS != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_GETOWNER_UIDS 17 #endif -#if !(defined(F_OFD_GETLK) || (defined(HAVE_DECL_F_OFD_GETLK) && HAVE_DECL_F_OFD_GETLK)) +#if defined(F_OFD_GETLK) || (defined(HAVE_DECL_F_OFD_GETLK) && HAVE_DECL_F_OFD_GETLK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_OFD_GETLK) == (36), "F_OFD_GETLK != 36"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_OFD_GETLK 36 #endif -#if !(defined(F_OFD_SETLK) || (defined(HAVE_DECL_F_OFD_SETLK) && HAVE_DECL_F_OFD_SETLK)) +#if defined(F_OFD_SETLK) || (defined(HAVE_DECL_F_OFD_SETLK) && HAVE_DECL_F_OFD_SETLK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_OFD_SETLK) == (37), "F_OFD_SETLK != 37"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_OFD_SETLK 37 #endif -#if !(defined(F_OFD_SETLKW) || (defined(HAVE_DECL_F_OFD_SETLKW) && HAVE_DECL_F_OFD_SETLKW)) +#if defined(F_OFD_SETLKW) || (defined(HAVE_DECL_F_OFD_SETLKW) && HAVE_DECL_F_OFD_SETLKW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_OFD_SETLKW) == (38), "F_OFD_SETLKW != 38"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_OFD_SETLKW 38 #endif -#if !(defined(F_SETLEASE) || (defined(HAVE_DECL_F_SETLEASE) && HAVE_DECL_F_SETLEASE)) +#if defined(F_SETLEASE) || (defined(HAVE_DECL_F_SETLEASE) && HAVE_DECL_F_SETLEASE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SETLEASE) == ((1024 + 0)), "F_SETLEASE != (1024 + 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_SETLEASE (1024 + 0) #endif -#if !(defined(F_GETLEASE) || (defined(HAVE_DECL_F_GETLEASE) && HAVE_DECL_F_GETLEASE)) +#if defined(F_GETLEASE) || (defined(HAVE_DECL_F_GETLEASE) && HAVE_DECL_F_GETLEASE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_GETLEASE) == ((1024 + 1)), "F_GETLEASE != (1024 + 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_GETLEASE (1024 + 1) #endif -#if !(defined(F_NOTIFY) || (defined(HAVE_DECL_F_NOTIFY) && HAVE_DECL_F_NOTIFY)) +#if defined(F_NOTIFY) || (defined(HAVE_DECL_F_NOTIFY) && HAVE_DECL_F_NOTIFY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_NOTIFY) == ((1024 + 2)), "F_NOTIFY != (1024 + 2)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_NOTIFY (1024 + 2) #endif -#if !(defined(F_CANCELLK) || (defined(HAVE_DECL_F_CANCELLK) && HAVE_DECL_F_CANCELLK)) +#if defined(F_CANCELLK) || (defined(HAVE_DECL_F_CANCELLK) && HAVE_DECL_F_CANCELLK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_CANCELLK) == ((1024 + 5)), "F_CANCELLK != (1024 + 5)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_CANCELLK (1024 + 5) #endif -#if !(defined(F_DUPFD_CLOEXEC) || (defined(HAVE_DECL_F_DUPFD_CLOEXEC) && HAVE_DECL_F_DUPFD_CLOEXEC)) +#if defined(F_DUPFD_CLOEXEC) || (defined(HAVE_DECL_F_DUPFD_CLOEXEC) && HAVE_DECL_F_DUPFD_CLOEXEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_DUPFD_CLOEXEC) == ((1024 + 6)), "F_DUPFD_CLOEXEC != (1024 + 6)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_DUPFD_CLOEXEC (1024 + 6) #endif -#if !(defined(F_SETPIPE_SZ) || (defined(HAVE_DECL_F_SETPIPE_SZ) && HAVE_DECL_F_SETPIPE_SZ)) +#if defined(F_SETPIPE_SZ) || (defined(HAVE_DECL_F_SETPIPE_SZ) && HAVE_DECL_F_SETPIPE_SZ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_SETPIPE_SZ) == ((1024 + 7)), "F_SETPIPE_SZ != (1024 + 7)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_SETPIPE_SZ (1024 + 7) #endif -#if !(defined(F_GETPIPE_SZ) || (defined(HAVE_DECL_F_GETPIPE_SZ) && HAVE_DECL_F_GETPIPE_SZ)) +#if defined(F_GETPIPE_SZ) || (defined(HAVE_DECL_F_GETPIPE_SZ) && HAVE_DECL_F_GETPIPE_SZ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_GETPIPE_SZ) == ((1024 + 8)), "F_GETPIPE_SZ != (1024 + 8)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_GETPIPE_SZ (1024 + 8) #endif -#if !(defined(F_ADD_SEALS) || (defined(HAVE_DECL_F_ADD_SEALS) && HAVE_DECL_F_ADD_SEALS)) +#if defined(F_ADD_SEALS) || (defined(HAVE_DECL_F_ADD_SEALS) && HAVE_DECL_F_ADD_SEALS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_ADD_SEALS) == ((1024 + 9)), "F_ADD_SEALS != (1024 + 9)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_ADD_SEALS (1024 + 9) #endif -#if !(defined(F_GET_SEALS) || (defined(HAVE_DECL_F_GET_SEALS) && HAVE_DECL_F_GET_SEALS)) +#if defined(F_GET_SEALS) || (defined(HAVE_DECL_F_GET_SEALS) && HAVE_DECL_F_GET_SEALS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((F_GET_SEALS) == ((1024 + 10)), "F_GET_SEALS != (1024 + 10)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define F_GET_SEALS (1024 + 10) #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat fcntlcmds in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat fcntlcmds in mpers mode + +# else static const struct xlat fcntlcmds[] = { -/* asm-generic/fcntl.h */ + XLAT(F_DUPFD), XLAT(F_GETFD), XLAT(F_SETFD), XLAT(F_GETFL), XLAT(F_SETFL), + +#if defined __alpha__ || defined __sparc__ + XLAT(F_GETLK), +#elif defined __mips__ + XLAT(F_GETLK), +#else XLAT(F_GETLK), +#endif + +#if defined __alpha__ || defined __sparc__ + XLAT(F_SETLK), + XLAT(F_SETLKW), +#else XLAT(F_SETLK), XLAT(F_SETLKW), +#endif + +#if defined __alpha__ + XLAT(F_SETOWN), + XLAT(F_GETOWN), +#elif defined __hppa__ + XLAT(F_GETOWN), + XLAT(F_SETOWN), +#elif defined __mips__ + XLAT(F_GETOWN), + XLAT(F_SETOWN), +#elif defined __sparc__ + XLAT(F_GETOWN), + XLAT(F_SETOWN), +#else XLAT(F_SETOWN), XLAT(F_GETOWN), +#endif + +#ifdef __hppa__ + XLAT(F_SETSIG), + XLAT(F_GETSIG), +#else XLAT(F_SETSIG), XLAT(F_GETSIG), +#endif + +#if defined __hppa__ + XLAT(F_GETLK64), + XLAT(F_SETLK64), + XLAT(F_SETLKW64), +#elif defined __mips__ && !defined __mips64 + XLAT(F_GETLK64), + XLAT(F_SETLK64), + XLAT(F_SETLKW64), +#else + XLAT(F_GETLK64), + XLAT(F_SETLK64), + XLAT(F_SETLKW64), +#endif + +#ifndef STRACE_WORKAROUND_FOR_F_OWNER_EX +# define STRACE_WORKAROUND_FOR_F_OWNER_EX +/* +* Linux kernel commit v2.6.32-rc7~23 has changed values of F_SETOWN_EX +* and F_GETOWN_EX constants introduced by commit v2.6.32-rc1~96 to fix +* the conflict with F_GETLK64 and F_SETLK64 constants. +* Looks like the best way to handle this situation is to pretend that +* old values of F_SETOWN_EX and F_GETOWN_EX didn't exist. +*/ +# if defined F_SETOWN_EX && F_SETOWN_EX != 15 +# warning invalid value of F_SETOWN_EX ignored +# endif +# undef F_SETOWN_EX +# if defined F_GETOWN_EX && F_GETOWN_EX != 16 +# warning invalid value of F_GETOWN_EX ignored +# endif +# undef F_GETOWN_EX +#endif XLAT(F_SETOWN_EX), XLAT(F_GETOWN_EX), + XLAT(F_GETOWNER_UIDS), XLAT(F_OFD_GETLK), XLAT(F_OFD_SETLK), XLAT(F_OFD_SETLKW), -/* linux/fcntl.h */ + XLAT(F_SETLEASE), XLAT(F_GETLEASE), XLAT(F_NOTIFY), @@ -122,4 +496,6 @@ const struct xlat fcntlcmds[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/fcntlcmds.in b/xlat/fcntlcmds.in index c050836c..5602e6ff 100644 --- a/xlat/fcntlcmds.in +++ b/xlat/fcntlcmds.in @@ -4,15 +4,83 @@ F_GETFD 1 F_SETFD 2 F_GETFL 3 F_SETFL 4 + +#if defined __alpha__ || defined __sparc__ +F_GETLK 7 +#elif defined __mips__ +F_GETLK 14 +#else F_GETLK 5 +#endif + +#if defined __alpha__ || defined __sparc__ +F_SETLK 8 +F_SETLKW 9 +#else F_SETLK 6 F_SETLKW 7 +#endif + +#if defined __alpha__ +F_SETOWN 5 +F_GETOWN 6 +#elif defined __hppa__ +F_GETOWN 11 +F_SETOWN 12 +#elif defined __mips__ +F_GETOWN 23 +F_SETOWN 24 +#elif defined __sparc__ +F_GETOWN 5 +F_SETOWN 6 +#else F_SETOWN 8 F_GETOWN 9 +#endif + +#ifdef __hppa__ +F_SETSIG 13 +F_GETSIG 14 +#else F_SETSIG 10 F_GETSIG 11 +#endif + +#if defined __hppa__ +F_GETLK64 8 +F_SETLK64 9 +F_SETLKW64 10 +#elif defined __mips__ && !defined __mips64 +F_GETLK64 33 +F_SETLK64 34 +F_SETLKW64 35 +#else +F_GETLK64 12 +F_SETLK64 13 +F_SETLKW64 14 +#endif + +#ifndef STRACE_WORKAROUND_FOR_F_OWNER_EX +# define STRACE_WORKAROUND_FOR_F_OWNER_EX +/* + * Linux kernel commit v2.6.32-rc7~23 has changed values of F_SETOWN_EX + * and F_GETOWN_EX constants introduced by commit v2.6.32-rc1~96 to fix + * the conflict with F_GETLK64 and F_SETLK64 constants. + * Looks like the best way to handle this situation is to pretend that + * old values of F_SETOWN_EX and F_GETOWN_EX didn't exist. + */ +# if defined F_SETOWN_EX && F_SETOWN_EX != 15 +# warning invalid value of F_SETOWN_EX ignored +# endif +# undef F_SETOWN_EX +# if defined F_GETOWN_EX && F_GETOWN_EX != 16 +# warning invalid value of F_GETOWN_EX ignored +# endif +# undef F_GETOWN_EX +#endif F_SETOWN_EX 15 F_GETOWN_EX 16 + F_GETOWNER_UIDS 17 F_OFD_GETLK 36 F_OFD_SETLK 37 diff --git a/xlat/fdflags.h b/xlat/fdflags.h index 8a5d03c4..5d627e34 100644 --- a/xlat/fdflags.h +++ b/xlat/fdflags.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/fdflags.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat fdflags in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat fdflags in mpers mode + +# else static const struct xlat fdflags[] = { @@ -14,4 +20,6 @@ const struct xlat fdflags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/fib_rule_actions.h b/xlat/fib_rule_actions.h new file mode 100644 index 00000000..5681ddba --- /dev/null +++ b/xlat/fib_rule_actions.h @@ -0,0 +1,94 @@ +/* Generated by ./xlat/gen.sh from ./xlat/fib_rule_actions.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(FR_ACT_UNSPEC) || (defined(HAVE_DECL_FR_ACT_UNSPEC) && HAVE_DECL_FR_ACT_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FR_ACT_UNSPEC) == (0), "FR_ACT_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FR_ACT_UNSPEC 0 +#endif +#if defined(FR_ACT_TO_TBL) || (defined(HAVE_DECL_FR_ACT_TO_TBL) && HAVE_DECL_FR_ACT_TO_TBL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FR_ACT_TO_TBL) == (1), "FR_ACT_TO_TBL != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FR_ACT_TO_TBL 1 +#endif +#if defined(FR_ACT_GOTO) || (defined(HAVE_DECL_FR_ACT_GOTO) && HAVE_DECL_FR_ACT_GOTO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FR_ACT_GOTO) == (2), "FR_ACT_GOTO != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FR_ACT_GOTO 2 +#endif +#if defined(FR_ACT_NOP) || (defined(HAVE_DECL_FR_ACT_NOP) && HAVE_DECL_FR_ACT_NOP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FR_ACT_NOP) == (3), "FR_ACT_NOP != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FR_ACT_NOP 3 +#endif +#if defined(FR_ACT_RES3) || (defined(HAVE_DECL_FR_ACT_RES3) && HAVE_DECL_FR_ACT_RES3) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FR_ACT_RES3) == (4), "FR_ACT_RES3 != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FR_ACT_RES3 4 +#endif +#if defined(FR_ACT_RES4) || (defined(HAVE_DECL_FR_ACT_RES4) && HAVE_DECL_FR_ACT_RES4) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FR_ACT_RES4) == (5), "FR_ACT_RES4 != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FR_ACT_RES4 5 +#endif +#if defined(FR_ACT_BLACKHOLE) || (defined(HAVE_DECL_FR_ACT_BLACKHOLE) && HAVE_DECL_FR_ACT_BLACKHOLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FR_ACT_BLACKHOLE) == (6), "FR_ACT_BLACKHOLE != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FR_ACT_BLACKHOLE 6 +#endif +#if defined(FR_ACT_UNREACHABLE) || (defined(HAVE_DECL_FR_ACT_UNREACHABLE) && HAVE_DECL_FR_ACT_UNREACHABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FR_ACT_UNREACHABLE) == (7), "FR_ACT_UNREACHABLE != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FR_ACT_UNREACHABLE 7 +#endif +#if defined(FR_ACT_PROHIBIT) || (defined(HAVE_DECL_FR_ACT_PROHIBIT) && HAVE_DECL_FR_ACT_PROHIBIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FR_ACT_PROHIBIT) == (8), "FR_ACT_PROHIBIT != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FR_ACT_PROHIBIT 8 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat fib_rule_actions in mpers mode + +# else + +static +const struct xlat fib_rule_actions[] = { + XLAT(FR_ACT_UNSPEC), + XLAT(FR_ACT_TO_TBL), + XLAT(FR_ACT_GOTO), + XLAT(FR_ACT_NOP), + XLAT(FR_ACT_RES3), + XLAT(FR_ACT_RES4), + XLAT(FR_ACT_BLACKHOLE), + XLAT(FR_ACT_UNREACHABLE), + XLAT(FR_ACT_PROHIBIT), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/fib_rule_actions.in b/xlat/fib_rule_actions.in new file mode 100644 index 00000000..55d59123 --- /dev/null +++ b/xlat/fib_rule_actions.in @@ -0,0 +1,9 @@ +FR_ACT_UNSPEC 0 +FR_ACT_TO_TBL 1 +FR_ACT_GOTO 2 +FR_ACT_NOP 3 +FR_ACT_RES3 4 +FR_ACT_RES4 5 +FR_ACT_BLACKHOLE 6 +FR_ACT_UNREACHABLE 7 +FR_ACT_PROHIBIT 8 diff --git a/xlat/fib_rule_flags.h b/xlat/fib_rule_flags.h new file mode 100644 index 00000000..b395b5ad --- /dev/null +++ b/xlat/fib_rule_flags.h @@ -0,0 +1,40 @@ +/* Generated by ./xlat/gen.sh from ./xlat/fib_rule_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat fib_rule_flags in mpers mode + +# else + +static +const struct xlat fib_rule_flags[] = { +#if defined(FIB_RULE_PERMANENT) || (defined(HAVE_DECL_FIB_RULE_PERMANENT) && HAVE_DECL_FIB_RULE_PERMANENT) + XLAT(FIB_RULE_PERMANENT), +#endif +#if defined(FIB_RULE_INVERT) || (defined(HAVE_DECL_FIB_RULE_INVERT) && HAVE_DECL_FIB_RULE_INVERT) + XLAT(FIB_RULE_INVERT), +#endif +#if defined(FIB_RULE_UNRESOLVED) || (defined(HAVE_DECL_FIB_RULE_UNRESOLVED) && HAVE_DECL_FIB_RULE_UNRESOLVED) + XLAT(FIB_RULE_UNRESOLVED), +#endif +#if defined(FIB_RULE_IIF_DETACHED) || (defined(HAVE_DECL_FIB_RULE_IIF_DETACHED) && HAVE_DECL_FIB_RULE_IIF_DETACHED) + XLAT(FIB_RULE_IIF_DETACHED), +#endif +#if defined(FIB_RULE_OIF_DETACHED) || (defined(HAVE_DECL_FIB_RULE_OIF_DETACHED) && HAVE_DECL_FIB_RULE_OIF_DETACHED) + XLAT(FIB_RULE_OIF_DETACHED), +#endif +#if defined(FIB_RULE_FIND_SADDR) || (defined(HAVE_DECL_FIB_RULE_FIND_SADDR) && HAVE_DECL_FIB_RULE_FIND_SADDR) + XLAT(FIB_RULE_FIND_SADDR), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/fib_rule_flags.in b/xlat/fib_rule_flags.in new file mode 100644 index 00000000..8f4d42c0 --- /dev/null +++ b/xlat/fib_rule_flags.in @@ -0,0 +1,6 @@ +FIB_RULE_PERMANENT +FIB_RULE_INVERT +FIB_RULE_UNRESOLVED +FIB_RULE_IIF_DETACHED +FIB_RULE_OIF_DETACHED +FIB_RULE_FIND_SADDR diff --git a/xlat/fiemap_extent_flags.h b/xlat/fiemap_extent_flags.h index 629328c4..41e85be8 100644 --- a/xlat/fiemap_extent_flags.h +++ b/xlat/fiemap_extent_flags.h @@ -1,43 +1,93 @@ /* Generated by ./xlat/gen.sh from ./xlat/fiemap_extent_flags.in; do not edit. */ -#if !(defined(FIEMAP_EXTENT_LAST) || (defined(HAVE_DECL_FIEMAP_EXTENT_LAST) && HAVE_DECL_FIEMAP_EXTENT_LAST)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(FIEMAP_EXTENT_LAST) || (defined(HAVE_DECL_FIEMAP_EXTENT_LAST) && HAVE_DECL_FIEMAP_EXTENT_LAST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FIEMAP_EXTENT_LAST) == (0x00000001), "FIEMAP_EXTENT_LAST != 0x00000001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FIEMAP_EXTENT_LAST 0x00000001 #endif -#if !(defined(FIEMAP_EXTENT_UNKNOWN) || (defined(HAVE_DECL_FIEMAP_EXTENT_UNKNOWN) && HAVE_DECL_FIEMAP_EXTENT_UNKNOWN)) +#if defined(FIEMAP_EXTENT_UNKNOWN) || (defined(HAVE_DECL_FIEMAP_EXTENT_UNKNOWN) && HAVE_DECL_FIEMAP_EXTENT_UNKNOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FIEMAP_EXTENT_UNKNOWN) == (0x00000002), "FIEMAP_EXTENT_UNKNOWN != 0x00000002"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FIEMAP_EXTENT_UNKNOWN 0x00000002 #endif -#if !(defined(FIEMAP_EXTENT_DELALLOC) || (defined(HAVE_DECL_FIEMAP_EXTENT_DELALLOC) && HAVE_DECL_FIEMAP_EXTENT_DELALLOC)) +#if defined(FIEMAP_EXTENT_DELALLOC) || (defined(HAVE_DECL_FIEMAP_EXTENT_DELALLOC) && HAVE_DECL_FIEMAP_EXTENT_DELALLOC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FIEMAP_EXTENT_DELALLOC) == (0x00000004), "FIEMAP_EXTENT_DELALLOC != 0x00000004"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FIEMAP_EXTENT_DELALLOC 0x00000004 #endif -#if !(defined(FIEMAP_EXTENT_ENCODED) || (defined(HAVE_DECL_FIEMAP_EXTENT_ENCODED) && HAVE_DECL_FIEMAP_EXTENT_ENCODED)) +#if defined(FIEMAP_EXTENT_ENCODED) || (defined(HAVE_DECL_FIEMAP_EXTENT_ENCODED) && HAVE_DECL_FIEMAP_EXTENT_ENCODED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FIEMAP_EXTENT_ENCODED) == (0x00000008), "FIEMAP_EXTENT_ENCODED != 0x00000008"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FIEMAP_EXTENT_ENCODED 0x00000008 #endif -#if !(defined(FIEMAP_EXTENT_DATA_ENCRYPTED) || (defined(HAVE_DECL_FIEMAP_EXTENT_DATA_ENCRYPTED) && HAVE_DECL_FIEMAP_EXTENT_DATA_ENCRYPTED)) +#if defined(FIEMAP_EXTENT_DATA_ENCRYPTED) || (defined(HAVE_DECL_FIEMAP_EXTENT_DATA_ENCRYPTED) && HAVE_DECL_FIEMAP_EXTENT_DATA_ENCRYPTED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FIEMAP_EXTENT_DATA_ENCRYPTED) == (0x00000080), "FIEMAP_EXTENT_DATA_ENCRYPTED != 0x00000080"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FIEMAP_EXTENT_DATA_ENCRYPTED 0x00000080 #endif -#if !(defined(FIEMAP_EXTENT_NOT_ALIGNED) || (defined(HAVE_DECL_FIEMAP_EXTENT_NOT_ALIGNED) && HAVE_DECL_FIEMAP_EXTENT_NOT_ALIGNED)) +#if defined(FIEMAP_EXTENT_NOT_ALIGNED) || (defined(HAVE_DECL_FIEMAP_EXTENT_NOT_ALIGNED) && HAVE_DECL_FIEMAP_EXTENT_NOT_ALIGNED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FIEMAP_EXTENT_NOT_ALIGNED) == (0x00000100), "FIEMAP_EXTENT_NOT_ALIGNED != 0x00000100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FIEMAP_EXTENT_NOT_ALIGNED 0x00000100 #endif -#if !(defined(FIEMAP_EXTENT_DATA_INLINE) || (defined(HAVE_DECL_FIEMAP_EXTENT_DATA_INLINE) && HAVE_DECL_FIEMAP_EXTENT_DATA_INLINE)) +#if defined(FIEMAP_EXTENT_DATA_INLINE) || (defined(HAVE_DECL_FIEMAP_EXTENT_DATA_INLINE) && HAVE_DECL_FIEMAP_EXTENT_DATA_INLINE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FIEMAP_EXTENT_DATA_INLINE) == (0x00000200), "FIEMAP_EXTENT_DATA_INLINE != 0x00000200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FIEMAP_EXTENT_DATA_INLINE 0x00000200 #endif -#if !(defined(FIEMAP_EXTENT_DATA_TAIL) || (defined(HAVE_DECL_FIEMAP_EXTENT_DATA_TAIL) && HAVE_DECL_FIEMAP_EXTENT_DATA_TAIL)) +#if defined(FIEMAP_EXTENT_DATA_TAIL) || (defined(HAVE_DECL_FIEMAP_EXTENT_DATA_TAIL) && HAVE_DECL_FIEMAP_EXTENT_DATA_TAIL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FIEMAP_EXTENT_DATA_TAIL) == (0x00000400), "FIEMAP_EXTENT_DATA_TAIL != 0x00000400"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FIEMAP_EXTENT_DATA_TAIL 0x00000400 #endif -#if !(defined(FIEMAP_EXTENT_UNWRITTEN) || (defined(HAVE_DECL_FIEMAP_EXTENT_UNWRITTEN) && HAVE_DECL_FIEMAP_EXTENT_UNWRITTEN)) +#if defined(FIEMAP_EXTENT_UNWRITTEN) || (defined(HAVE_DECL_FIEMAP_EXTENT_UNWRITTEN) && HAVE_DECL_FIEMAP_EXTENT_UNWRITTEN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FIEMAP_EXTENT_UNWRITTEN) == (0x00000800), "FIEMAP_EXTENT_UNWRITTEN != 0x00000800"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FIEMAP_EXTENT_UNWRITTEN 0x00000800 #endif -#if !(defined(FIEMAP_EXTENT_MERGED) || (defined(HAVE_DECL_FIEMAP_EXTENT_MERGED) && HAVE_DECL_FIEMAP_EXTENT_MERGED)) +#if defined(FIEMAP_EXTENT_MERGED) || (defined(HAVE_DECL_FIEMAP_EXTENT_MERGED) && HAVE_DECL_FIEMAP_EXTENT_MERGED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FIEMAP_EXTENT_MERGED) == (0x00001000), "FIEMAP_EXTENT_MERGED != 0x00001000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FIEMAP_EXTENT_MERGED 0x00001000 #endif -#if !(defined(FIEMAP_EXTENT_SHARED) || (defined(HAVE_DECL_FIEMAP_EXTENT_SHARED) && HAVE_DECL_FIEMAP_EXTENT_SHARED)) +#if defined(FIEMAP_EXTENT_SHARED) || (defined(HAVE_DECL_FIEMAP_EXTENT_SHARED) && HAVE_DECL_FIEMAP_EXTENT_SHARED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FIEMAP_EXTENT_SHARED) == (0x00002000), "FIEMAP_EXTENT_SHARED != 0x00002000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FIEMAP_EXTENT_SHARED 0x00002000 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat fiemap_extent_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat fiemap_extent_flags in mpers mode + +# else static const struct xlat fiemap_extent_flags[] = { @@ -55,4 +105,6 @@ const struct xlat fiemap_extent_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/fiemap_flags.h b/xlat/fiemap_flags.h index 4f463ef6..73395e8f 100644 --- a/xlat/fiemap_flags.h +++ b/xlat/fiemap_flags.h @@ -1,19 +1,37 @@ /* Generated by ./xlat/gen.sh from ./xlat/fiemap_flags.in; do not edit. */ -#if !(defined(FIEMAP_FLAG_SYNC) || (defined(HAVE_DECL_FIEMAP_FLAG_SYNC) && HAVE_DECL_FIEMAP_FLAG_SYNC)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(FIEMAP_FLAG_SYNC) || (defined(HAVE_DECL_FIEMAP_FLAG_SYNC) && HAVE_DECL_FIEMAP_FLAG_SYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FIEMAP_FLAG_SYNC) == (1), "FIEMAP_FLAG_SYNC != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FIEMAP_FLAG_SYNC 1 #endif -#if !(defined(FIEMAP_FLAG_XATTR) || (defined(HAVE_DECL_FIEMAP_FLAG_XATTR) && HAVE_DECL_FIEMAP_FLAG_XATTR)) +#if defined(FIEMAP_FLAG_XATTR) || (defined(HAVE_DECL_FIEMAP_FLAG_XATTR) && HAVE_DECL_FIEMAP_FLAG_XATTR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FIEMAP_FLAG_XATTR) == (2), "FIEMAP_FLAG_XATTR != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FIEMAP_FLAG_XATTR 2 #endif -#if !(defined(FIEMAP_FLAG_CACHE) || (defined(HAVE_DECL_FIEMAP_FLAG_CACHE) && HAVE_DECL_FIEMAP_FLAG_CACHE)) +#if defined(FIEMAP_FLAG_CACHE) || (defined(HAVE_DECL_FIEMAP_FLAG_CACHE) && HAVE_DECL_FIEMAP_FLAG_CACHE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FIEMAP_FLAG_CACHE) == (4), "FIEMAP_FLAG_CACHE != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FIEMAP_FLAG_CACHE 4 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat fiemap_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat fiemap_flags in mpers mode + +# else static const struct xlat fiemap_flags[] = { @@ -23,4 +41,6 @@ const struct xlat fiemap_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/flockcmds.h b/xlat/flockcmds.h index 2ccd714a..c7cf9399 100644 --- a/xlat/flockcmds.h +++ b/xlat/flockcmds.h @@ -1,34 +1,72 @@ /* Generated by ./xlat/gen.sh from ./xlat/flockcmds.in; do not edit. */ -#if !(defined(LOCK_SH) || (defined(HAVE_DECL_LOCK_SH) && HAVE_DECL_LOCK_SH)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(LOCK_SH) || (defined(HAVE_DECL_LOCK_SH) && HAVE_DECL_LOCK_SH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LOCK_SH) == (1), "LOCK_SH != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LOCK_SH 1 #endif -#if !(defined(LOCK_EX) || (defined(HAVE_DECL_LOCK_EX) && HAVE_DECL_LOCK_EX)) +#if defined(LOCK_EX) || (defined(HAVE_DECL_LOCK_EX) && HAVE_DECL_LOCK_EX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LOCK_EX) == (2), "LOCK_EX != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LOCK_EX 2 #endif -#if !(defined(LOCK_NB) || (defined(HAVE_DECL_LOCK_NB) && HAVE_DECL_LOCK_NB)) +#if defined(LOCK_NB) || (defined(HAVE_DECL_LOCK_NB) && HAVE_DECL_LOCK_NB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LOCK_NB) == (4), "LOCK_NB != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LOCK_NB 4 #endif -#if !(defined(LOCK_UN) || (defined(HAVE_DECL_LOCK_UN) && HAVE_DECL_LOCK_UN)) +#if defined(LOCK_UN) || (defined(HAVE_DECL_LOCK_UN) && HAVE_DECL_LOCK_UN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LOCK_UN) == (8), "LOCK_UN != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LOCK_UN 8 #endif -#if !(defined(LOCK_MAND) || (defined(HAVE_DECL_LOCK_MAND) && HAVE_DECL_LOCK_MAND)) +#if defined(LOCK_MAND) || (defined(HAVE_DECL_LOCK_MAND) && HAVE_DECL_LOCK_MAND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LOCK_MAND) == (32), "LOCK_MAND != 32"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LOCK_MAND 32 #endif -#if !(defined(LOCK_RW) || (defined(HAVE_DECL_LOCK_RW) && HAVE_DECL_LOCK_RW)) +#if defined(LOCK_RW) || (defined(HAVE_DECL_LOCK_RW) && HAVE_DECL_LOCK_RW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LOCK_RW) == (192), "LOCK_RW != 192"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LOCK_RW 192 #endif -#if !(defined(LOCK_READ) || (defined(HAVE_DECL_LOCK_READ) && HAVE_DECL_LOCK_READ)) +#if defined(LOCK_READ) || (defined(HAVE_DECL_LOCK_READ) && HAVE_DECL_LOCK_READ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LOCK_READ) == (64), "LOCK_READ != 64"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LOCK_READ 64 #endif -#if !(defined(LOCK_WRITE) || (defined(HAVE_DECL_LOCK_WRITE) && HAVE_DECL_LOCK_WRITE)) +#if defined(LOCK_WRITE) || (defined(HAVE_DECL_LOCK_WRITE) && HAVE_DECL_LOCK_WRITE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LOCK_WRITE) == (128), "LOCK_WRITE != 128"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LOCK_WRITE 128 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat flockcmds in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat flockcmds in mpers mode + +# else static const struct xlat flockcmds[] = { @@ -43,4 +81,6 @@ const struct xlat flockcmds[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/fsmagic.h b/xlat/fsmagic.h index b419ee91..a85e54ff 100644 --- a/xlat/fsmagic.h +++ b/xlat/fsmagic.h @@ -1,14 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/fsmagic.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat fsmagic in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat fsmagic in mpers mode + +# else static const struct xlat fsmagic[] = { -/* sorted by value, suitable for bsearch(3) */ + { 0x0000002f, "QNX4_SUPER_MAGIC" }, { 0x00000187, "AUTOFS_SUPER_MAGIC" }, { 0x00001373, "DEVFS_SUPER_MAGIC" }, @@ -77,6 +83,7 @@ const struct xlat fsmagic[] = { { 0x57ac6e9d, "STACK_END_MAGIC" }, { 0x58295829, "ZSMALLOC_MAGIC" }, { 0x58465342, "XFS_SB_MAGIC" }, +{ 0x5a3c69f0, "AAFS_MAGIC" }, { 0x6165676c, "PSTOREFS_MAGIC" }, { 0x61756673, "AUFS_SUPER_MAGIC" }, { 0x62646576, "BDEVFS_MAGIC" }, @@ -89,6 +96,7 @@ const struct xlat fsmagic[] = { { 0x65735546, "FUSE_SUPER_MAGIC" }, { 0x68191122, "QNX6_SUPER_MAGIC" }, { 0x6b414653, "AFS_FS_MAGIC" }, +{ 0x6c6f6f70, "BINDERFS_SUPER_MAGIC" }, { 0x6e736673, "NSFS_MAGIC" }, { 0x73636673, "SECURITYFS_MAGIC" }, { 0x73717368, "SQUASHFS_MAGIC" }, @@ -110,7 +118,9 @@ const struct xlat fsmagic[] = { { 0xf995e849, "HPFS_SUPER_MAGIC" }, { 0xfe534d42, "SMB2_MAGIC_NUMBER" }, { 0xff534d42, "CIFS_MAGIC_NUMBER" }, - /* this array should remain not NULL-terminated */ + XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/fsmagic.in b/xlat/fsmagic.in index 78fe16c0..ffab9e04 100644 --- a/xlat/fsmagic.in +++ b/xlat/fsmagic.in @@ -1,4 +1,4 @@ -/* sorted by value, suitable for bsearch(3) */ +/* sort -k2,2 */ { 0x0000002f, "QNX4_SUPER_MAGIC" }, { 0x00000187, "AUTOFS_SUPER_MAGIC" }, { 0x00001373, "DEVFS_SUPER_MAGIC" }, @@ -67,6 +67,7 @@ { 0x57ac6e9d, "STACK_END_MAGIC" }, { 0x58295829, "ZSMALLOC_MAGIC" }, { 0x58465342, "XFS_SB_MAGIC" }, +{ 0x5a3c69f0, "AAFS_MAGIC" }, { 0x6165676c, "PSTOREFS_MAGIC" }, { 0x61756673, "AUFS_SUPER_MAGIC" }, { 0x62646576, "BDEVFS_MAGIC" }, @@ -79,6 +80,7 @@ { 0x65735546, "FUSE_SUPER_MAGIC" }, { 0x68191122, "QNX6_SUPER_MAGIC" }, { 0x6b414653, "AFS_FS_MAGIC" }, +{ 0x6c6f6f70, "BINDERFS_SUPER_MAGIC" }, { 0x6e736673, "NSFS_MAGIC" }, { 0x73636673, "SECURITYFS_MAGIC" }, { 0x73717368, "SQUASHFS_MAGIC" }, @@ -100,4 +102,3 @@ { 0xf995e849, "HPFS_SUPER_MAGIC" }, { 0xfe534d42, "SMB2_MAGIC_NUMBER" }, { 0xff534d42, "CIFS_MAGIC_NUMBER" }, -#unterminated diff --git a/xlat/futexbitset.h b/xlat/futexbitset.h new file mode 100644 index 00000000..566c8cbc --- /dev/null +++ b/xlat/futexbitset.h @@ -0,0 +1,30 @@ +/* Generated by ./xlat/gen.sh from ./xlat/futexbitset.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(FUTEX_BITSET_MATCH_ANY) || (defined(HAVE_DECL_FUTEX_BITSET_MATCH_ANY) && HAVE_DECL_FUTEX_BITSET_MATCH_ANY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_BITSET_MATCH_ANY) == (0xffffffff), "FUTEX_BITSET_MATCH_ANY != 0xffffffff"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FUTEX_BITSET_MATCH_ANY 0xffffffff +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat futexbitset in mpers mode + +# else + +static +const struct xlat futexbitset[] = { + XLAT(FUTEX_BITSET_MATCH_ANY), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/futexbitset.in b/xlat/futexbitset.in new file mode 100644 index 00000000..1290c87c --- /dev/null +++ b/xlat/futexbitset.in @@ -0,0 +1 @@ +FUTEX_BITSET_MATCH_ANY 0xffffffff diff --git a/xlat/futexops.h b/xlat/futexops.h index 4efc761c..562f6af9 100644 --- a/xlat/futexops.h +++ b/xlat/futexops.h @@ -1,85 +1,191 @@ /* Generated by ./xlat/gen.sh from ./xlat/futexops.in; do not edit. */ -#if !(defined(FUTEX_WAIT) || (defined(HAVE_DECL_FUTEX_WAIT) && HAVE_DECL_FUTEX_WAIT)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(FUTEX_WAIT) || (defined(HAVE_DECL_FUTEX_WAIT) && HAVE_DECL_FUTEX_WAIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_WAIT) == (0), "FUTEX_WAIT != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_WAIT 0 #endif -#if !(defined(FUTEX_WAKE) || (defined(HAVE_DECL_FUTEX_WAKE) && HAVE_DECL_FUTEX_WAKE)) +#if defined(FUTEX_WAKE) || (defined(HAVE_DECL_FUTEX_WAKE) && HAVE_DECL_FUTEX_WAKE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_WAKE) == (1), "FUTEX_WAKE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_WAKE 1 #endif -#if !(defined(FUTEX_FD) || (defined(HAVE_DECL_FUTEX_FD) && HAVE_DECL_FUTEX_FD)) +#if defined(FUTEX_FD) || (defined(HAVE_DECL_FUTEX_FD) && HAVE_DECL_FUTEX_FD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_FD) == (2), "FUTEX_FD != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_FD 2 #endif -#if !(defined(FUTEX_REQUEUE) || (defined(HAVE_DECL_FUTEX_REQUEUE) && HAVE_DECL_FUTEX_REQUEUE)) +#if defined(FUTEX_REQUEUE) || (defined(HAVE_DECL_FUTEX_REQUEUE) && HAVE_DECL_FUTEX_REQUEUE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_REQUEUE) == (3), "FUTEX_REQUEUE != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_REQUEUE 3 #endif -#if !(defined(FUTEX_CMP_REQUEUE) || (defined(HAVE_DECL_FUTEX_CMP_REQUEUE) && HAVE_DECL_FUTEX_CMP_REQUEUE)) +#if defined(FUTEX_CMP_REQUEUE) || (defined(HAVE_DECL_FUTEX_CMP_REQUEUE) && HAVE_DECL_FUTEX_CMP_REQUEUE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_CMP_REQUEUE) == (4), "FUTEX_CMP_REQUEUE != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_CMP_REQUEUE 4 #endif -#if !(defined(FUTEX_WAKE_OP) || (defined(HAVE_DECL_FUTEX_WAKE_OP) && HAVE_DECL_FUTEX_WAKE_OP)) +#if defined(FUTEX_WAKE_OP) || (defined(HAVE_DECL_FUTEX_WAKE_OP) && HAVE_DECL_FUTEX_WAKE_OP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_WAKE_OP) == (5), "FUTEX_WAKE_OP != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_WAKE_OP 5 #endif -#if !(defined(FUTEX_LOCK_PI) || (defined(HAVE_DECL_FUTEX_LOCK_PI) && HAVE_DECL_FUTEX_LOCK_PI)) +#if defined(FUTEX_LOCK_PI) || (defined(HAVE_DECL_FUTEX_LOCK_PI) && HAVE_DECL_FUTEX_LOCK_PI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_LOCK_PI) == (6), "FUTEX_LOCK_PI != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_LOCK_PI 6 #endif -#if !(defined(FUTEX_UNLOCK_PI) || (defined(HAVE_DECL_FUTEX_UNLOCK_PI) && HAVE_DECL_FUTEX_UNLOCK_PI)) +#if defined(FUTEX_UNLOCK_PI) || (defined(HAVE_DECL_FUTEX_UNLOCK_PI) && HAVE_DECL_FUTEX_UNLOCK_PI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_UNLOCK_PI) == (7), "FUTEX_UNLOCK_PI != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_UNLOCK_PI 7 #endif -#if !(defined(FUTEX_TRYLOCK_PI) || (defined(HAVE_DECL_FUTEX_TRYLOCK_PI) && HAVE_DECL_FUTEX_TRYLOCK_PI)) +#if defined(FUTEX_TRYLOCK_PI) || (defined(HAVE_DECL_FUTEX_TRYLOCK_PI) && HAVE_DECL_FUTEX_TRYLOCK_PI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_TRYLOCK_PI) == (8), "FUTEX_TRYLOCK_PI != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_TRYLOCK_PI 8 #endif -#if !(defined(FUTEX_WAIT_BITSET) || (defined(HAVE_DECL_FUTEX_WAIT_BITSET) && HAVE_DECL_FUTEX_WAIT_BITSET)) +#if defined(FUTEX_WAIT_BITSET) || (defined(HAVE_DECL_FUTEX_WAIT_BITSET) && HAVE_DECL_FUTEX_WAIT_BITSET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_WAIT_BITSET) == (9), "FUTEX_WAIT_BITSET != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_WAIT_BITSET 9 #endif -#if !(defined(FUTEX_WAKE_BITSET) || (defined(HAVE_DECL_FUTEX_WAKE_BITSET) && HAVE_DECL_FUTEX_WAKE_BITSET)) +#if defined(FUTEX_WAKE_BITSET) || (defined(HAVE_DECL_FUTEX_WAKE_BITSET) && HAVE_DECL_FUTEX_WAKE_BITSET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_WAKE_BITSET) == (10), "FUTEX_WAKE_BITSET != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_WAKE_BITSET 10 #endif -#if !(defined(FUTEX_WAIT_REQUEUE_PI) || (defined(HAVE_DECL_FUTEX_WAIT_REQUEUE_PI) && HAVE_DECL_FUTEX_WAIT_REQUEUE_PI)) +#if defined(FUTEX_WAIT_REQUEUE_PI) || (defined(HAVE_DECL_FUTEX_WAIT_REQUEUE_PI) && HAVE_DECL_FUTEX_WAIT_REQUEUE_PI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_WAIT_REQUEUE_PI) == (11), "FUTEX_WAIT_REQUEUE_PI != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_WAIT_REQUEUE_PI 11 #endif -#if !(defined(FUTEX_CMP_REQUEUE_PI) || (defined(HAVE_DECL_FUTEX_CMP_REQUEUE_PI) && HAVE_DECL_FUTEX_CMP_REQUEUE_PI)) +#if defined(FUTEX_CMP_REQUEUE_PI) || (defined(HAVE_DECL_FUTEX_CMP_REQUEUE_PI) && HAVE_DECL_FUTEX_CMP_REQUEUE_PI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_CMP_REQUEUE_PI) == (12), "FUTEX_CMP_REQUEUE_PI != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_CMP_REQUEUE_PI 12 #endif -#if !(defined(FUTEX_WAIT_PRIVATE) || (defined(HAVE_DECL_FUTEX_WAIT_PRIVATE) && HAVE_DECL_FUTEX_WAIT_PRIVATE)) +#if defined(FUTEX_WAIT_PRIVATE) || (defined(HAVE_DECL_FUTEX_WAIT_PRIVATE) && HAVE_DECL_FUTEX_WAIT_PRIVATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_WAIT_PRIVATE) == ((FUTEX_WAIT | FUTEX_PRIVATE_FLAG)), "FUTEX_WAIT_PRIVATE != (FUTEX_WAIT | FUTEX_PRIVATE_FLAG)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_WAIT_PRIVATE (FUTEX_WAIT | FUTEX_PRIVATE_FLAG) #endif -#if !(defined(FUTEX_WAKE_PRIVATE) || (defined(HAVE_DECL_FUTEX_WAKE_PRIVATE) && HAVE_DECL_FUTEX_WAKE_PRIVATE)) +#if defined(FUTEX_WAKE_PRIVATE) || (defined(HAVE_DECL_FUTEX_WAKE_PRIVATE) && HAVE_DECL_FUTEX_WAKE_PRIVATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_WAKE_PRIVATE) == ((FUTEX_WAKE | FUTEX_PRIVATE_FLAG)), "FUTEX_WAKE_PRIVATE != (FUTEX_WAKE | FUTEX_PRIVATE_FLAG)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_WAKE_PRIVATE (FUTEX_WAKE | FUTEX_PRIVATE_FLAG) #endif -#if !(defined(FUTEX_REQUEUE_PRIVATE) || (defined(HAVE_DECL_FUTEX_REQUEUE_PRIVATE) && HAVE_DECL_FUTEX_REQUEUE_PRIVATE)) +#if defined(FUTEX_REQUEUE_PRIVATE) || (defined(HAVE_DECL_FUTEX_REQUEUE_PRIVATE) && HAVE_DECL_FUTEX_REQUEUE_PRIVATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_REQUEUE_PRIVATE) == ((FUTEX_REQUEUE | FUTEX_PRIVATE_FLAG)), "FUTEX_REQUEUE_PRIVATE != (FUTEX_REQUEUE | FUTEX_PRIVATE_FLAG)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_REQUEUE_PRIVATE (FUTEX_REQUEUE | FUTEX_PRIVATE_FLAG) #endif -#if !(defined(FUTEX_CMP_REQUEUE_PRIVATE) || (defined(HAVE_DECL_FUTEX_CMP_REQUEUE_PRIVATE) && HAVE_DECL_FUTEX_CMP_REQUEUE_PRIVATE)) +#if defined(FUTEX_CMP_REQUEUE_PRIVATE) || (defined(HAVE_DECL_FUTEX_CMP_REQUEUE_PRIVATE) && HAVE_DECL_FUTEX_CMP_REQUEUE_PRIVATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_CMP_REQUEUE_PRIVATE) == ((FUTEX_CMP_REQUEUE | FUTEX_PRIVATE_FLAG)), "FUTEX_CMP_REQUEUE_PRIVATE != (FUTEX_CMP_REQUEUE | FUTEX_PRIVATE_FLAG)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_CMP_REQUEUE_PRIVATE (FUTEX_CMP_REQUEUE | FUTEX_PRIVATE_FLAG) #endif -#if !(defined(FUTEX_WAKE_OP_PRIVATE) || (defined(HAVE_DECL_FUTEX_WAKE_OP_PRIVATE) && HAVE_DECL_FUTEX_WAKE_OP_PRIVATE)) +#if defined(FUTEX_WAKE_OP_PRIVATE) || (defined(HAVE_DECL_FUTEX_WAKE_OP_PRIVATE) && HAVE_DECL_FUTEX_WAKE_OP_PRIVATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_WAKE_OP_PRIVATE) == ((FUTEX_WAKE_OP | FUTEX_PRIVATE_FLAG)), "FUTEX_WAKE_OP_PRIVATE != (FUTEX_WAKE_OP | FUTEX_PRIVATE_FLAG)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_WAKE_OP_PRIVATE (FUTEX_WAKE_OP | FUTEX_PRIVATE_FLAG) #endif -#if !(defined(FUTEX_LOCK_PI_PRIVATE) || (defined(HAVE_DECL_FUTEX_LOCK_PI_PRIVATE) && HAVE_DECL_FUTEX_LOCK_PI_PRIVATE)) +#if defined(FUTEX_LOCK_PI_PRIVATE) || (defined(HAVE_DECL_FUTEX_LOCK_PI_PRIVATE) && HAVE_DECL_FUTEX_LOCK_PI_PRIVATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_LOCK_PI_PRIVATE) == ((FUTEX_LOCK_PI | FUTEX_PRIVATE_FLAG)), "FUTEX_LOCK_PI_PRIVATE != (FUTEX_LOCK_PI | FUTEX_PRIVATE_FLAG)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_LOCK_PI_PRIVATE (FUTEX_LOCK_PI | FUTEX_PRIVATE_FLAG) #endif -#if !(defined(FUTEX_UNLOCK_PI_PRIVATE) || (defined(HAVE_DECL_FUTEX_UNLOCK_PI_PRIVATE) && HAVE_DECL_FUTEX_UNLOCK_PI_PRIVATE)) +#if defined(FUTEX_UNLOCK_PI_PRIVATE) || (defined(HAVE_DECL_FUTEX_UNLOCK_PI_PRIVATE) && HAVE_DECL_FUTEX_UNLOCK_PI_PRIVATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_UNLOCK_PI_PRIVATE) == ((FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG)), "FUTEX_UNLOCK_PI_PRIVATE != (FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_UNLOCK_PI_PRIVATE (FUTEX_UNLOCK_PI | FUTEX_PRIVATE_FLAG) #endif -#if !(defined(FUTEX_TRYLOCK_PI_PRIVATE) || (defined(HAVE_DECL_FUTEX_TRYLOCK_PI_PRIVATE) && HAVE_DECL_FUTEX_TRYLOCK_PI_PRIVATE)) +#if defined(FUTEX_TRYLOCK_PI_PRIVATE) || (defined(HAVE_DECL_FUTEX_TRYLOCK_PI_PRIVATE) && HAVE_DECL_FUTEX_TRYLOCK_PI_PRIVATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_TRYLOCK_PI_PRIVATE) == ((FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG)), "FUTEX_TRYLOCK_PI_PRIVATE != (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_TRYLOCK_PI_PRIVATE (FUTEX_TRYLOCK_PI | FUTEX_PRIVATE_FLAG) #endif -#if !(defined(FUTEX_WAIT_BITSET_PRIVATE) || (defined(HAVE_DECL_FUTEX_WAIT_BITSET_PRIVATE) && HAVE_DECL_FUTEX_WAIT_BITSET_PRIVATE)) +#if defined(FUTEX_WAIT_BITSET_PRIVATE) || (defined(HAVE_DECL_FUTEX_WAIT_BITSET_PRIVATE) && HAVE_DECL_FUTEX_WAIT_BITSET_PRIVATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_WAIT_BITSET_PRIVATE) == ((FUTEX_WAIT_BITSET | FUTEX_PRIVATE_FLAG)), "FUTEX_WAIT_BITSET_PRIVATE != (FUTEX_WAIT_BITSET | FUTEX_PRIVATE_FLAG)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_WAIT_BITSET_PRIVATE (FUTEX_WAIT_BITSET | FUTEX_PRIVATE_FLAG) #endif -#if !(defined(FUTEX_WAKE_BITSET_PRIVATE) || (defined(HAVE_DECL_FUTEX_WAKE_BITSET_PRIVATE) && HAVE_DECL_FUTEX_WAKE_BITSET_PRIVATE)) +#if defined(FUTEX_WAKE_BITSET_PRIVATE) || (defined(HAVE_DECL_FUTEX_WAKE_BITSET_PRIVATE) && HAVE_DECL_FUTEX_WAKE_BITSET_PRIVATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_WAKE_BITSET_PRIVATE) == ((FUTEX_WAKE_BITSET | FUTEX_PRIVATE_FLAG)), "FUTEX_WAKE_BITSET_PRIVATE != (FUTEX_WAKE_BITSET | FUTEX_PRIVATE_FLAG)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_WAKE_BITSET_PRIVATE (FUTEX_WAKE_BITSET | FUTEX_PRIVATE_FLAG) #endif -#if !(defined(FUTEX_WAIT_REQUEUE_PI_PRIVATE) || (defined(HAVE_DECL_FUTEX_WAIT_REQUEUE_PI_PRIVATE) && HAVE_DECL_FUTEX_WAIT_REQUEUE_PI_PRIVATE)) +#if defined(FUTEX_WAIT_REQUEUE_PI_PRIVATE) || (defined(HAVE_DECL_FUTEX_WAIT_REQUEUE_PI_PRIVATE) && HAVE_DECL_FUTEX_WAIT_REQUEUE_PI_PRIVATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_WAIT_REQUEUE_PI_PRIVATE) == ((FUTEX_WAIT_REQUEUE_PI | FUTEX_PRIVATE_FLAG)), "FUTEX_WAIT_REQUEUE_PI_PRIVATE != (FUTEX_WAIT_REQUEUE_PI | FUTEX_PRIVATE_FLAG)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_WAIT_REQUEUE_PI_PRIVATE (FUTEX_WAIT_REQUEUE_PI | FUTEX_PRIVATE_FLAG) #endif -#if !(defined(FUTEX_CMP_REQUEUE_PI_PRIVATE) || (defined(HAVE_DECL_FUTEX_CMP_REQUEUE_PI_PRIVATE) && HAVE_DECL_FUTEX_CMP_REQUEUE_PI_PRIVATE)) +#if defined(FUTEX_CMP_REQUEUE_PI_PRIVATE) || (defined(HAVE_DECL_FUTEX_CMP_REQUEUE_PI_PRIVATE) && HAVE_DECL_FUTEX_CMP_REQUEUE_PI_PRIVATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_CMP_REQUEUE_PI_PRIVATE) == ((FUTEX_CMP_REQUEUE_PI | FUTEX_PRIVATE_FLAG)), "FUTEX_CMP_REQUEUE_PI_PRIVATE != (FUTEX_CMP_REQUEUE_PI | FUTEX_PRIVATE_FLAG)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_CMP_REQUEUE_PI_PRIVATE (FUTEX_CMP_REQUEUE_PI | FUTEX_PRIVATE_FLAG) #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat futexops in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat futexops in mpers mode + +# else static const struct xlat futexops[] = { @@ -132,4 +238,6 @@ const struct xlat futexops[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/futexwakecmps.h b/xlat/futexwakecmps.h index 379e0a09..b0ee5b0d 100644 --- a/xlat/futexwakecmps.h +++ b/xlat/futexwakecmps.h @@ -1,28 +1,58 @@ /* Generated by ./xlat/gen.sh from ./xlat/futexwakecmps.in; do not edit. */ -#if !(defined(FUTEX_OP_CMP_EQ) || (defined(HAVE_DECL_FUTEX_OP_CMP_EQ) && HAVE_DECL_FUTEX_OP_CMP_EQ)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(FUTEX_OP_CMP_EQ) || (defined(HAVE_DECL_FUTEX_OP_CMP_EQ) && HAVE_DECL_FUTEX_OP_CMP_EQ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_OP_CMP_EQ) == (0), "FUTEX_OP_CMP_EQ != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_OP_CMP_EQ 0 #endif -#if !(defined(FUTEX_OP_CMP_NE) || (defined(HAVE_DECL_FUTEX_OP_CMP_NE) && HAVE_DECL_FUTEX_OP_CMP_NE)) +#if defined(FUTEX_OP_CMP_NE) || (defined(HAVE_DECL_FUTEX_OP_CMP_NE) && HAVE_DECL_FUTEX_OP_CMP_NE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_OP_CMP_NE) == (1), "FUTEX_OP_CMP_NE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_OP_CMP_NE 1 #endif -#if !(defined(FUTEX_OP_CMP_LT) || (defined(HAVE_DECL_FUTEX_OP_CMP_LT) && HAVE_DECL_FUTEX_OP_CMP_LT)) +#if defined(FUTEX_OP_CMP_LT) || (defined(HAVE_DECL_FUTEX_OP_CMP_LT) && HAVE_DECL_FUTEX_OP_CMP_LT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_OP_CMP_LT) == (2), "FUTEX_OP_CMP_LT != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_OP_CMP_LT 2 #endif -#if !(defined(FUTEX_OP_CMP_LE) || (defined(HAVE_DECL_FUTEX_OP_CMP_LE) && HAVE_DECL_FUTEX_OP_CMP_LE)) +#if defined(FUTEX_OP_CMP_LE) || (defined(HAVE_DECL_FUTEX_OP_CMP_LE) && HAVE_DECL_FUTEX_OP_CMP_LE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_OP_CMP_LE) == (3), "FUTEX_OP_CMP_LE != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_OP_CMP_LE 3 #endif -#if !(defined(FUTEX_OP_CMP_GT) || (defined(HAVE_DECL_FUTEX_OP_CMP_GT) && HAVE_DECL_FUTEX_OP_CMP_GT)) +#if defined(FUTEX_OP_CMP_GT) || (defined(HAVE_DECL_FUTEX_OP_CMP_GT) && HAVE_DECL_FUTEX_OP_CMP_GT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_OP_CMP_GT) == (4), "FUTEX_OP_CMP_GT != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_OP_CMP_GT 4 #endif -#if !(defined(FUTEX_OP_CMP_GE) || (defined(HAVE_DECL_FUTEX_OP_CMP_GE) && HAVE_DECL_FUTEX_OP_CMP_GE)) +#if defined(FUTEX_OP_CMP_GE) || (defined(HAVE_DECL_FUTEX_OP_CMP_GE) && HAVE_DECL_FUTEX_OP_CMP_GE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_OP_CMP_GE) == (5), "FUTEX_OP_CMP_GE != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_OP_CMP_GE 5 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat futexwakecmps in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat futexwakecmps in mpers mode + +# else static const struct xlat futexwakecmps[] = { @@ -35,4 +65,6 @@ const struct xlat futexwakecmps[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/futexwakeops.h b/xlat/futexwakeops.h index cd9b6b5e..b6433536 100644 --- a/xlat/futexwakeops.h +++ b/xlat/futexwakeops.h @@ -1,25 +1,51 @@ /* Generated by ./xlat/gen.sh from ./xlat/futexwakeops.in; do not edit. */ -#if !(defined(FUTEX_OP_SET) || (defined(HAVE_DECL_FUTEX_OP_SET) && HAVE_DECL_FUTEX_OP_SET)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(FUTEX_OP_SET) || (defined(HAVE_DECL_FUTEX_OP_SET) && HAVE_DECL_FUTEX_OP_SET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_OP_SET) == (0), "FUTEX_OP_SET != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_OP_SET 0 #endif -#if !(defined(FUTEX_OP_ADD) || (defined(HAVE_DECL_FUTEX_OP_ADD) && HAVE_DECL_FUTEX_OP_ADD)) +#if defined(FUTEX_OP_ADD) || (defined(HAVE_DECL_FUTEX_OP_ADD) && HAVE_DECL_FUTEX_OP_ADD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_OP_ADD) == (1), "FUTEX_OP_ADD != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_OP_ADD 1 #endif -#if !(defined(FUTEX_OP_OR) || (defined(HAVE_DECL_FUTEX_OP_OR) && HAVE_DECL_FUTEX_OP_OR)) +#if defined(FUTEX_OP_OR) || (defined(HAVE_DECL_FUTEX_OP_OR) && HAVE_DECL_FUTEX_OP_OR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_OP_OR) == (2), "FUTEX_OP_OR != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_OP_OR 2 #endif -#if !(defined(FUTEX_OP_ANDN) || (defined(HAVE_DECL_FUTEX_OP_ANDN) && HAVE_DECL_FUTEX_OP_ANDN)) +#if defined(FUTEX_OP_ANDN) || (defined(HAVE_DECL_FUTEX_OP_ANDN) && HAVE_DECL_FUTEX_OP_ANDN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_OP_ANDN) == (3), "FUTEX_OP_ANDN != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_OP_ANDN 3 #endif -#if !(defined(FUTEX_OP_XOR) || (defined(HAVE_DECL_FUTEX_OP_XOR) && HAVE_DECL_FUTEX_OP_XOR)) +#if defined(FUTEX_OP_XOR) || (defined(HAVE_DECL_FUTEX_OP_XOR) && HAVE_DECL_FUTEX_OP_XOR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FUTEX_OP_XOR) == (4), "FUTEX_OP_XOR != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FUTEX_OP_XOR 4 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat futexwakeops in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat futexwakeops in mpers mode + +# else static const struct xlat futexwakeops[] = { @@ -31,4 +57,6 @@ const struct xlat futexwakeops[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/gen.sh b/xlat/gen.sh index d3dec2aa..30b2dd82 100755 --- a/xlat/gen.sh +++ b/xlat/gen.sh @@ -1,30 +1,13 @@ -#!/bin/sh +#!/bin/sh -efu # # Copyright (c) 2014-2015 Mike Frysinger # Copyright (c) 2014-2015 Dmitry V. Levin +# Copyright (c) 2014-2019 The strace developers. # All rights reserved. # -# Redistribution and use in source and binary forms, with or without -# modification, are permitted provided that the following conditions -# are met: -# 1. Redistributions of source code must retain the above copyright -# notice, this list of conditions and the following disclaimer. -# 2. Redistributions in binary form must reproduce the above copyright -# notice, this list of conditions and the following disclaimer in the -# documentation and/or other materials provided with the distribution. -# 3. The name of the author may not be used to endorse or promote products -# derived from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# SPDX-License-Identifier: LGPL-2.1-or-later + +export LC_ALL=C usage() { @@ -43,19 +26,26 @@ cond_def() line="$1"; shift local val - val="$(printf %s "$line" | - sed -r -n 's/^([^[:space:]]+).*$/\1/p')" - - local def - def="$(printf %s "${line}" | - sed -r -n 's/^[^[:space:]]+[[:space:]]+([^[:space:]].*)$/\1/p')" + val="${line%%[!A-Za-z0-9_]*}" + + local t def= + t="${line#*[ ]}" + if [ "$line" != "$t" ]; then + while [ "$def" != "$t" ]; do + def="$t" + t="${t##[ ]}" + done + fi if [ -n "$def" ]; then - cat <<-EOF - #if !(defined($val) || (defined(HAVE_DECL_$val) && HAVE_DECL_$val)) - # define $val $def - #endif - EOF + printf "%s\n" \ + "#if defined($val) || (defined(HAVE_DECL_$val) && HAVE_DECL_$val)" \ + "DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE" \ + "static_assert(($val) == ($def), \"$val != $def\");" \ + "DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE" \ + "#else" \ + "# define $val $def" \ + "#endif" fi } @@ -64,6 +54,7 @@ print_xlat() local val val="$1"; shift + [ 1 = "$value_indexed" ] && printf " [%s] =" "${val}" if [ -z "${val_type-}" ]; then echo " XLAT(${val})," else @@ -77,6 +68,7 @@ print_xlat_pair() val="$1"; shift str="$1"; shift + [ 1 = "$value_indexed" ] && printf " [%s] =" "${val}" if [ -z "${val_type-}" ]; then echo " XLAT_PAIR(${val}, \"${str}\")," else @@ -86,30 +78,29 @@ print_xlat_pair() cond_xlat() { - local line val m def xlat - line="$1"; shift - - val="$(printf %s "${line}" | sed -r -n 's/^([^[:space:]]+).*$/\1/p')" - m="${val%%|*}" - def="$(printf %s "${line}" | - sed -r -n 's/^[^[:space:]]+[[:space:]]+([^[:space:]].*)$/\1/p')" - - if [ "${m}" = "${m#1<<}" ]; then - xlat="$(print_xlat "${val}")" - else - xlat="$(print_xlat_pair "1ULL<<${val#1<<}" "${val}")" - m="${m#1<<}" - fi - - if [ -z "${def}" ]; then - cat <<-EOF - #if defined(${m}) || (defined(HAVE_DECL_${m}) && HAVE_DECL_${m}) - ${xlat} - #endif - EOF - else - echo "$xlat" - fi + echo "$1" | { + local val def m xlat + + read val def + + m="${val%%|*}" + + if [ "${m}" = "${m#1<<}" ]; then + xlat="$(print_xlat "${val}")" + else + xlat="$(print_xlat_pair "1ULL<<${val#1<<}" "${val}")" + m="${m#1<<}" + fi + + if [ -z "${def}" ]; then + printf "%s\n" \ + "#if defined(${m}) || (defined(HAVE_DECL_${m}) && HAVE_DECL_${m})" \ + " ${xlat}" \ + "#endif" + else + echo "$xlat" + fi + } } gen_header() @@ -122,18 +113,32 @@ gen_header() local decl="extern const struct xlat ${name}[];" local in_defs= in_mpers= - if grep -F -x "$decl" "$defs" > /dev/null; then + value_indexed=0 + + if grep -F -q -x "$decl" "$defs"; then in_defs=1 - elif grep -F -x "$decl" "$mpers" > /dev/null; then + elif grep -F -q -x "$decl" "$mpers"; then in_mpers=1 fi - echo "/* Generated by $0 from $1; do not edit. */" + cat <<-EOF + /* Generated by $0 from $1; do not edit. */ + + #include "gcc_compat.h" + #include "static_assert.h" - local unconditional= unterminated= line + EOF + + local unconditional= line # 1st pass: output directives. while read line; do - LC_COLLATE=C + case "$line" in + */\**) + line=$(printf "%s" "$line" | + sed "s|[[:space:]]*/\*.*\*/[[:space:]]*||") + ;; + esac + case $line in '#stop') exit 0 @@ -144,12 +149,12 @@ gen_header() '#unconditional') unconditional=1 ;; - '#unterminated') - unterminated=1 - ;; '#val_type '*) # to be processed during 2nd pass ;; + '#value_indexed') + value_indexed=1 + ;; '#'*) echo "${line}" ;; @@ -160,41 +165,53 @@ gen_header() esac done < "$input" - echo + cat <<-EOF + + #ifndef XLAT_MACROS_ONLY + + EOF + if [ -n "$in_defs" ]; then cat <<-EOF - #ifndef IN_MPERS + # ifndef IN_MPERS EOF elif [ -n "$in_mpers" ]; then cat <<-EOF - #ifdef IN_MPERS + # ifdef IN_MPERS ${decl} - #else + # else - # if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) + # if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static - # endif + # endif EOF else cat <<-EOF - #ifdef IN_MPERS + # ifdef IN_MPERS - # error static const struct xlat ${name} in mpers mode + # error static const struct xlat ${name} in mpers mode - #else + # else static EOF fi + echo "const struct xlat ${name}[] = {" unconditional= val_type= # 2nd pass: output everything. while read line; do - LC_COLLATE=C + case "$line" in + */\**) + line=$(printf "%s" "$line" | + sed "s|[[:space:]]*/\*.*\*/[[:space:]]*||") + ;; + esac + case ${line} in '#conditional') unconditional= @@ -202,8 +219,7 @@ gen_header() '#unconditional') unconditional=1 ;; - '#unterminated') - # processed during 1st pass + '#value_indexed') ;; '#val_type '*) val_type="${line#\#val_type }" @@ -230,16 +246,14 @@ gen_header() ;; esac done < "${input}" - if [ -n "${unterminated}" ]; then - echo " /* this array should remain not NULL-terminated */" - else - echo " XLAT_END" - fi + echo ' XLAT_END' cat <<-EOF }; - #endif /* !IN_MPERS */ + # endif /* !IN_MPERS */ + + #endif /* !XLAT_MACROS_ONLY */ EOF ) >"${output}" } @@ -289,25 +303,34 @@ main() local name local jobs=0 local ncpus="$(getconf _NPROCESSORS_ONLN)" + local pids= [ "${ncpus}" -ge 1 ] || ncpus=1 if [ -d "${input}" ]; then local f names= - for f in "${input}"/*.in; do + set +f + set -- "${input}"/*.in + set -f + for f; do [ -f "${f}" ] || continue name=${f##*/} name=${name%.in} gen_header "${f}" "${output}/${name}.h" "${name}" & + pids="$pids $!" names="${names} ${name}" : $(( jobs += 1 )) - if [ ${jobs} -ge ${ncpus} ]; then - jobs=0 - wait - fi + if [ "${jobs}" -gt "$(( ncpus * 2 ))" ]; then + read wait_pid rest + pids="$rest" + wait -n 2>/dev/null || wait "$wait_pid" + : $(( jobs -= 1 )) + fi <<- EOF + $pids + EOF done - gen_git "${output}/.gitignore" ${names} - gen_make "${output}/Makemodule.am" ${names} + gen_git "${output}/.gitignore" ${names} & + gen_make "${output}/Makemodule.am" ${names} & wait else name=${input##*/} diff --git a/xlat/getrandom_flags.h b/xlat/getrandom_flags.h index 6b88199f..e2877d1a 100644 --- a/xlat/getrandom_flags.h +++ b/xlat/getrandom_flags.h @@ -1,16 +1,30 @@ /* Generated by ./xlat/gen.sh from ./xlat/getrandom_flags.in; do not edit. */ -#if !(defined(GRND_NONBLOCK) || (defined(HAVE_DECL_GRND_NONBLOCK) && HAVE_DECL_GRND_NONBLOCK)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(GRND_NONBLOCK) || (defined(HAVE_DECL_GRND_NONBLOCK) && HAVE_DECL_GRND_NONBLOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((GRND_NONBLOCK) == (1), "GRND_NONBLOCK != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define GRND_NONBLOCK 1 #endif -#if !(defined(GRND_RANDOM) || (defined(HAVE_DECL_GRND_RANDOM) && HAVE_DECL_GRND_RANDOM)) +#if defined(GRND_RANDOM) || (defined(HAVE_DECL_GRND_RANDOM) && HAVE_DECL_GRND_RANDOM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((GRND_RANDOM) == (2), "GRND_RANDOM != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define GRND_RANDOM 2 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat getrandom_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat getrandom_flags in mpers mode + +# else static const struct xlat getrandom_flags[] = { @@ -19,4 +33,6 @@ const struct xlat getrandom_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/getsock_ip_options.h b/xlat/getsock_ip_options.h new file mode 100644 index 00000000..ca4bd9eb --- /dev/null +++ b/xlat/getsock_ip_options.h @@ -0,0 +1,91 @@ +/* Generated by ./xlat/gen.sh from ./xlat/getsock_ip_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat getsock_ip_options in mpers mode + +# else + +static +const struct xlat getsock_ip_options[] = { +/* +* Options specific to getsockopt(SOL_IP). +* Common {g,s}etsockopt(SOL_IP) options +* should be in sock_ip_options.in instead. +*/ + +#if defined(ARPT_SO_GET_INFO) || (defined(HAVE_DECL_ARPT_SO_GET_INFO) && HAVE_DECL_ARPT_SO_GET_INFO) + XLAT(ARPT_SO_GET_INFO), +#endif +#if defined(ARPT_SO_GET_ENTRIES) || (defined(HAVE_DECL_ARPT_SO_GET_ENTRIES) && HAVE_DECL_ARPT_SO_GET_ENTRIES) + XLAT(ARPT_SO_GET_ENTRIES), +#endif +#if defined(ARPT_SO_GET_REVISION_MATCH) || (defined(HAVE_DECL_ARPT_SO_GET_REVISION_MATCH) && HAVE_DECL_ARPT_SO_GET_REVISION_MATCH) + XLAT(ARPT_SO_GET_REVISION_MATCH), +#endif +#if defined(ARPT_SO_GET_REVISION_TARGET) || (defined(HAVE_DECL_ARPT_SO_GET_REVISION_TARGET) && HAVE_DECL_ARPT_SO_GET_REVISION_TARGET) + XLAT(ARPT_SO_GET_REVISION_TARGET), +#endif + +#if defined(EBT_SO_GET_INFO) || (defined(HAVE_DECL_EBT_SO_GET_INFO) && HAVE_DECL_EBT_SO_GET_INFO) + XLAT(EBT_SO_GET_INFO), +#endif +#if defined(EBT_SO_GET_ENTRIES) || (defined(HAVE_DECL_EBT_SO_GET_ENTRIES) && HAVE_DECL_EBT_SO_GET_ENTRIES) + XLAT(EBT_SO_GET_ENTRIES), +#endif +#if defined(EBT_SO_GET_INIT_INFO) || (defined(HAVE_DECL_EBT_SO_GET_INIT_INFO) && HAVE_DECL_EBT_SO_GET_INIT_INFO) + XLAT(EBT_SO_GET_INIT_INFO), +#endif +#if defined(EBT_SO_GET_INIT_ENTRIES) || (defined(HAVE_DECL_EBT_SO_GET_INIT_ENTRIES) && HAVE_DECL_EBT_SO_GET_INIT_ENTRIES) + XLAT(EBT_SO_GET_INIT_ENTRIES), +#endif + +#if defined(IP_VS_SO_GET_VERSION) || (defined(HAVE_DECL_IP_VS_SO_GET_VERSION) && HAVE_DECL_IP_VS_SO_GET_VERSION) + XLAT(IP_VS_SO_GET_VERSION), +#endif +#if defined(IP_VS_SO_GET_INFO) || (defined(HAVE_DECL_IP_VS_SO_GET_INFO) && HAVE_DECL_IP_VS_SO_GET_INFO) + XLAT(IP_VS_SO_GET_INFO), +#endif +#if defined(IP_VS_SO_GET_SERVICES) || (defined(HAVE_DECL_IP_VS_SO_GET_SERVICES) && HAVE_DECL_IP_VS_SO_GET_SERVICES) + XLAT(IP_VS_SO_GET_SERVICES), +#endif +#if defined(IP_VS_SO_GET_SERVICE) || (defined(HAVE_DECL_IP_VS_SO_GET_SERVICE) && HAVE_DECL_IP_VS_SO_GET_SERVICE) + XLAT(IP_VS_SO_GET_SERVICE), +#endif +#if defined(IP_VS_SO_GET_DESTS) || (defined(HAVE_DECL_IP_VS_SO_GET_DESTS) && HAVE_DECL_IP_VS_SO_GET_DESTS) + XLAT(IP_VS_SO_GET_DESTS), +#endif +#if defined(IP_VS_SO_GET_DEST) || (defined(HAVE_DECL_IP_VS_SO_GET_DEST) && HAVE_DECL_IP_VS_SO_GET_DEST) + XLAT(IP_VS_SO_GET_DEST), +#endif +#if defined(IP_VS_SO_GET_TIMEOUT) || (defined(HAVE_DECL_IP_VS_SO_GET_TIMEOUT) && HAVE_DECL_IP_VS_SO_GET_TIMEOUT) + XLAT(IP_VS_SO_GET_TIMEOUT), +#endif +#if defined(IP_VS_SO_GET_DAEMON) || (defined(HAVE_DECL_IP_VS_SO_GET_DAEMON) && HAVE_DECL_IP_VS_SO_GET_DAEMON) + XLAT(IP_VS_SO_GET_DAEMON), +#endif + +#if defined(IPT_SO_GET_INFO) || (defined(HAVE_DECL_IPT_SO_GET_INFO) && HAVE_DECL_IPT_SO_GET_INFO) + XLAT(IPT_SO_GET_INFO), +#endif +#if defined(IPT_SO_GET_ENTRIES) || (defined(HAVE_DECL_IPT_SO_GET_ENTRIES) && HAVE_DECL_IPT_SO_GET_ENTRIES) + XLAT(IPT_SO_GET_ENTRIES), +#endif +#if defined(IPT_SO_GET_REVISION_MATCH) || (defined(HAVE_DECL_IPT_SO_GET_REVISION_MATCH) && HAVE_DECL_IPT_SO_GET_REVISION_MATCH) + XLAT(IPT_SO_GET_REVISION_MATCH), +#endif +#if defined(IPT_SO_GET_REVISION_TARGET) || (defined(HAVE_DECL_IPT_SO_GET_REVISION_TARGET) && HAVE_DECL_IPT_SO_GET_REVISION_TARGET) + XLAT(IPT_SO_GET_REVISION_TARGET), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/getsock_ip_options.in b/xlat/getsock_ip_options.in new file mode 100644 index 00000000..7b054608 --- /dev/null +++ b/xlat/getsock_ip_options.in @@ -0,0 +1,29 @@ +/* + * Options specific to getsockopt(SOL_IP). + * Common {g,s}etsockopt(SOL_IP) options + * should be in sock_ip_options.in instead. + */ + +ARPT_SO_GET_INFO +ARPT_SO_GET_ENTRIES +ARPT_SO_GET_REVISION_MATCH +ARPT_SO_GET_REVISION_TARGET + +EBT_SO_GET_INFO +EBT_SO_GET_ENTRIES +EBT_SO_GET_INIT_INFO +EBT_SO_GET_INIT_ENTRIES + +IP_VS_SO_GET_VERSION +IP_VS_SO_GET_INFO +IP_VS_SO_GET_SERVICES +IP_VS_SO_GET_SERVICE +IP_VS_SO_GET_DESTS +IP_VS_SO_GET_DEST +IP_VS_SO_GET_TIMEOUT +IP_VS_SO_GET_DAEMON + +IPT_SO_GET_INFO +IPT_SO_GET_ENTRIES +IPT_SO_GET_REVISION_MATCH +IPT_SO_GET_REVISION_TARGET diff --git a/xlat/getsock_ipv6_options.h b/xlat/getsock_ipv6_options.h new file mode 100644 index 00000000..6525dfdb --- /dev/null +++ b/xlat/getsock_ipv6_options.h @@ -0,0 +1,40 @@ +/* Generated by ./xlat/gen.sh from ./xlat/getsock_ipv6_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat getsock_ipv6_options in mpers mode + +# else + +static +const struct xlat getsock_ipv6_options[] = { +/* +* Options specific to getsockopt(SOL_IPV6). +* Common {g,s}etsockopt(SOL_IPV6) options +* should be in sock_ipv6_options.in instead. +*/ + +#if defined(IP6T_SO_GET_INFO) || (defined(HAVE_DECL_IP6T_SO_GET_INFO) && HAVE_DECL_IP6T_SO_GET_INFO) + XLAT(IP6T_SO_GET_INFO), +#endif +#if defined(IP6T_SO_GET_ENTRIES) || (defined(HAVE_DECL_IP6T_SO_GET_ENTRIES) && HAVE_DECL_IP6T_SO_GET_ENTRIES) + XLAT(IP6T_SO_GET_ENTRIES), +#endif +#if defined(IP6T_SO_GET_REVISION_MATCH) || (defined(HAVE_DECL_IP6T_SO_GET_REVISION_MATCH) && HAVE_DECL_IP6T_SO_GET_REVISION_MATCH) + XLAT(IP6T_SO_GET_REVISION_MATCH), +#endif +#if defined(IP6T_SO_GET_REVISION_TARGET) || (defined(HAVE_DECL_IP6T_SO_GET_REVISION_TARGET) && HAVE_DECL_IP6T_SO_GET_REVISION_TARGET) + XLAT(IP6T_SO_GET_REVISION_TARGET), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/getsock_ipv6_options.in b/xlat/getsock_ipv6_options.in new file mode 100644 index 00000000..98c450fa --- /dev/null +++ b/xlat/getsock_ipv6_options.in @@ -0,0 +1,10 @@ +/* + * Options specific to getsockopt(SOL_IPV6). + * Common {g,s}etsockopt(SOL_IPV6) options + * should be in sock_ipv6_options.in instead. + */ + +IP6T_SO_GET_INFO +IP6T_SO_GET_ENTRIES +IP6T_SO_GET_REVISION_MATCH +IP6T_SO_GET_REVISION_TARGET diff --git a/xlat/getsock_options.h b/xlat/getsock_options.h new file mode 100644 index 00000000..1f2035fd --- /dev/null +++ b/xlat/getsock_options.h @@ -0,0 +1,44 @@ +/* Generated by ./xlat/gen.sh from ./xlat/getsock_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined __hppa__ +#if defined(SO_GET_FILTER) || (defined(HAVE_DECL_SO_GET_FILTER) && HAVE_DECL_SO_GET_FILTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_GET_FILTER) == (16410), "SO_GET_FILTER != 16410"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_GET_FILTER 16410 +#endif +#else +#if defined(SO_GET_FILTER) || (defined(HAVE_DECL_SO_GET_FILTER) && HAVE_DECL_SO_GET_FILTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_GET_FILTER) == (26), "SO_GET_FILTER != 26"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_GET_FILTER 26 +#endif +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat getsock_options in mpers mode + +# else + +static +const struct xlat getsock_options[] = { +#if defined __hppa__ + XLAT(SO_GET_FILTER), +#else + XLAT(SO_GET_FILTER), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/getsock_options.in b/xlat/getsock_options.in new file mode 100644 index 00000000..6e476239 --- /dev/null +++ b/xlat/getsock_options.in @@ -0,0 +1,5 @@ +#if defined __hppa__ +SO_GET_FILTER 16410 +#else +SO_GET_FILTER 26 +#endif diff --git a/xlat/getsockipoptions.h b/xlat/getsockipoptions.h deleted file mode 100644 index cd043a1f..00000000 --- a/xlat/getsockipoptions.h +++ /dev/null @@ -1,83 +0,0 @@ -/* Generated by ./xlat/gen.sh from ./xlat/getsockipoptions.in; do not edit. */ - -#ifdef IN_MPERS - -# error static const struct xlat getsockipoptions in mpers mode - -#else - -static -const struct xlat getsockipoptions[] = { -/* -* Options specific to getsockopt(SOL_IP). -* Common {g,s}etsockopt(SOL_IP) options -* should be in sockipoptions.in instead. -*/ - -#if defined(ARPT_SO_GET_INFO) || (defined(HAVE_DECL_ARPT_SO_GET_INFO) && HAVE_DECL_ARPT_SO_GET_INFO) - XLAT(ARPT_SO_GET_INFO), -#endif -#if defined(ARPT_SO_GET_ENTRIES) || (defined(HAVE_DECL_ARPT_SO_GET_ENTRIES) && HAVE_DECL_ARPT_SO_GET_ENTRIES) - XLAT(ARPT_SO_GET_ENTRIES), -#endif -#if defined(ARPT_SO_GET_REVISION_MATCH) || (defined(HAVE_DECL_ARPT_SO_GET_REVISION_MATCH) && HAVE_DECL_ARPT_SO_GET_REVISION_MATCH) - XLAT(ARPT_SO_GET_REVISION_MATCH), -#endif -#if defined(ARPT_SO_GET_REVISION_TARGET) || (defined(HAVE_DECL_ARPT_SO_GET_REVISION_TARGET) && HAVE_DECL_ARPT_SO_GET_REVISION_TARGET) - XLAT(ARPT_SO_GET_REVISION_TARGET), -#endif - -#if defined(EBT_SO_GET_INFO) || (defined(HAVE_DECL_EBT_SO_GET_INFO) && HAVE_DECL_EBT_SO_GET_INFO) - XLAT(EBT_SO_GET_INFO), -#endif -#if defined(EBT_SO_GET_ENTRIES) || (defined(HAVE_DECL_EBT_SO_GET_ENTRIES) && HAVE_DECL_EBT_SO_GET_ENTRIES) - XLAT(EBT_SO_GET_ENTRIES), -#endif -#if defined(EBT_SO_GET_INIT_INFO) || (defined(HAVE_DECL_EBT_SO_GET_INIT_INFO) && HAVE_DECL_EBT_SO_GET_INIT_INFO) - XLAT(EBT_SO_GET_INIT_INFO), -#endif -#if defined(EBT_SO_GET_INIT_ENTRIES) || (defined(HAVE_DECL_EBT_SO_GET_INIT_ENTRIES) && HAVE_DECL_EBT_SO_GET_INIT_ENTRIES) - XLAT(EBT_SO_GET_INIT_ENTRIES), -#endif - -#if defined(IP_VS_SO_GET_VERSION) || (defined(HAVE_DECL_IP_VS_SO_GET_VERSION) && HAVE_DECL_IP_VS_SO_GET_VERSION) - XLAT(IP_VS_SO_GET_VERSION), -#endif -#if defined(IP_VS_SO_GET_INFO) || (defined(HAVE_DECL_IP_VS_SO_GET_INFO) && HAVE_DECL_IP_VS_SO_GET_INFO) - XLAT(IP_VS_SO_GET_INFO), -#endif -#if defined(IP_VS_SO_GET_SERVICES) || (defined(HAVE_DECL_IP_VS_SO_GET_SERVICES) && HAVE_DECL_IP_VS_SO_GET_SERVICES) - XLAT(IP_VS_SO_GET_SERVICES), -#endif -#if defined(IP_VS_SO_GET_SERVICE) || (defined(HAVE_DECL_IP_VS_SO_GET_SERVICE) && HAVE_DECL_IP_VS_SO_GET_SERVICE) - XLAT(IP_VS_SO_GET_SERVICE), -#endif -#if defined(IP_VS_SO_GET_DESTS) || (defined(HAVE_DECL_IP_VS_SO_GET_DESTS) && HAVE_DECL_IP_VS_SO_GET_DESTS) - XLAT(IP_VS_SO_GET_DESTS), -#endif -#if defined(IP_VS_SO_GET_DEST) || (defined(HAVE_DECL_IP_VS_SO_GET_DEST) && HAVE_DECL_IP_VS_SO_GET_DEST) - XLAT(IP_VS_SO_GET_DEST), -#endif -#if defined(IP_VS_SO_GET_TIMEOUT) || (defined(HAVE_DECL_IP_VS_SO_GET_TIMEOUT) && HAVE_DECL_IP_VS_SO_GET_TIMEOUT) - XLAT(IP_VS_SO_GET_TIMEOUT), -#endif -#if defined(IP_VS_SO_GET_DAEMON) || (defined(HAVE_DECL_IP_VS_SO_GET_DAEMON) && HAVE_DECL_IP_VS_SO_GET_DAEMON) - XLAT(IP_VS_SO_GET_DAEMON), -#endif - -#if defined(IPT_SO_GET_INFO) || (defined(HAVE_DECL_IPT_SO_GET_INFO) && HAVE_DECL_IPT_SO_GET_INFO) - XLAT(IPT_SO_GET_INFO), -#endif -#if defined(IPT_SO_GET_ENTRIES) || (defined(HAVE_DECL_IPT_SO_GET_ENTRIES) && HAVE_DECL_IPT_SO_GET_ENTRIES) - XLAT(IPT_SO_GET_ENTRIES), -#endif -#if defined(IPT_SO_GET_REVISION_MATCH) || (defined(HAVE_DECL_IPT_SO_GET_REVISION_MATCH) && HAVE_DECL_IPT_SO_GET_REVISION_MATCH) - XLAT(IPT_SO_GET_REVISION_MATCH), -#endif -#if defined(IPT_SO_GET_REVISION_TARGET) || (defined(HAVE_DECL_IPT_SO_GET_REVISION_TARGET) && HAVE_DECL_IPT_SO_GET_REVISION_TARGET) - XLAT(IPT_SO_GET_REVISION_TARGET), -#endif - XLAT_END -}; - -#endif /* !IN_MPERS */ diff --git a/xlat/getsockipoptions.in b/xlat/getsockipoptions.in deleted file mode 100644 index 847cec2a..00000000 --- a/xlat/getsockipoptions.in +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Options specific to getsockopt(SOL_IP). - * Common {g,s}etsockopt(SOL_IP) options - * should be in sockipoptions.in instead. - */ - -ARPT_SO_GET_INFO -ARPT_SO_GET_ENTRIES -ARPT_SO_GET_REVISION_MATCH -ARPT_SO_GET_REVISION_TARGET - -EBT_SO_GET_INFO -EBT_SO_GET_ENTRIES -EBT_SO_GET_INIT_INFO -EBT_SO_GET_INIT_ENTRIES - -IP_VS_SO_GET_VERSION -IP_VS_SO_GET_INFO -IP_VS_SO_GET_SERVICES -IP_VS_SO_GET_SERVICE -IP_VS_SO_GET_DESTS -IP_VS_SO_GET_DEST -IP_VS_SO_GET_TIMEOUT -IP_VS_SO_GET_DAEMON - -IPT_SO_GET_INFO -IPT_SO_GET_ENTRIES -IPT_SO_GET_REVISION_MATCH -IPT_SO_GET_REVISION_TARGET diff --git a/xlat/getsockipv6options.h b/xlat/getsockipv6options.h deleted file mode 100644 index 402be181..00000000 --- a/xlat/getsockipv6options.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Generated by ./xlat/gen.sh from ./xlat/getsockipv6options.in; do not edit. */ - -#ifdef IN_MPERS - -# error static const struct xlat getsockipv6options in mpers mode - -#else - -static -const struct xlat getsockipv6options[] = { -/* -* Options specific to getsockopt(SOL_IPV6). -* Common {g,s}etsockopt(SOL_IPV6) options -* should be in sockipv6options.in instead. -*/ - -#if defined(IP6T_SO_GET_INFO) || (defined(HAVE_DECL_IP6T_SO_GET_INFO) && HAVE_DECL_IP6T_SO_GET_INFO) - XLAT(IP6T_SO_GET_INFO), -#endif -#if defined(IP6T_SO_GET_ENTRIES) || (defined(HAVE_DECL_IP6T_SO_GET_ENTRIES) && HAVE_DECL_IP6T_SO_GET_ENTRIES) - XLAT(IP6T_SO_GET_ENTRIES), -#endif -#if defined(IP6T_SO_GET_REVISION_MATCH) || (defined(HAVE_DECL_IP6T_SO_GET_REVISION_MATCH) && HAVE_DECL_IP6T_SO_GET_REVISION_MATCH) - XLAT(IP6T_SO_GET_REVISION_MATCH), -#endif -#if defined(IP6T_SO_GET_REVISION_TARGET) || (defined(HAVE_DECL_IP6T_SO_GET_REVISION_TARGET) && HAVE_DECL_IP6T_SO_GET_REVISION_TARGET) - XLAT(IP6T_SO_GET_REVISION_TARGET), -#endif - XLAT_END -}; - -#endif /* !IN_MPERS */ diff --git a/xlat/getsockipv6options.in b/xlat/getsockipv6options.in deleted file mode 100644 index da44a101..00000000 --- a/xlat/getsockipv6options.in +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Options specific to getsockopt(SOL_IPV6). - * Common {g,s}etsockopt(SOL_IPV6) options - * should be in sockipv6options.in instead. - */ - -IP6T_SO_GET_INFO -IP6T_SO_GET_ENTRIES -IP6T_SO_GET_REVISION_MATCH -IP6T_SO_GET_REVISION_TARGET diff --git a/xlat/hci_channels.h b/xlat/hci_channels.h index ab6d3e35..a989ff2c 100644 --- a/xlat/hci_channels.h +++ b/xlat/hci_channels.h @@ -1,29 +1,62 @@ /* Generated by ./xlat/gen.sh from ./xlat/hci_channels.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat hci_channels in mpers mode - -#else - -static -const struct xlat hci_channels[] = { #if defined(HCI_CHANNEL_RAW) || (defined(HAVE_DECL_HCI_CHANNEL_RAW) && HAVE_DECL_HCI_CHANNEL_RAW) - XLAT(HCI_CHANNEL_RAW), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((HCI_CHANNEL_RAW) == (0), "HCI_CHANNEL_RAW != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define HCI_CHANNEL_RAW 0 #endif #if defined(HCI_CHANNEL_USER) || (defined(HAVE_DECL_HCI_CHANNEL_USER) && HAVE_DECL_HCI_CHANNEL_USER) - XLAT(HCI_CHANNEL_USER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((HCI_CHANNEL_USER) == (1), "HCI_CHANNEL_USER != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define HCI_CHANNEL_USER 1 #endif #if defined(HCI_CHANNEL_MONITOR) || (defined(HAVE_DECL_HCI_CHANNEL_MONITOR) && HAVE_DECL_HCI_CHANNEL_MONITOR) - XLAT(HCI_CHANNEL_MONITOR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((HCI_CHANNEL_MONITOR) == (2), "HCI_CHANNEL_MONITOR != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define HCI_CHANNEL_MONITOR 2 #endif #if defined(HCI_CHANNEL_CONTROL) || (defined(HAVE_DECL_HCI_CHANNEL_CONTROL) && HAVE_DECL_HCI_CHANNEL_CONTROL) - XLAT(HCI_CHANNEL_CONTROL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((HCI_CHANNEL_CONTROL) == (3), "HCI_CHANNEL_CONTROL != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define HCI_CHANNEL_CONTROL 3 #endif #if defined(HCI_CHANNEL_LOGGING) || (defined(HAVE_DECL_HCI_CHANNEL_LOGGING) && HAVE_DECL_HCI_CHANNEL_LOGGING) - XLAT(HCI_CHANNEL_LOGGING), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((HCI_CHANNEL_LOGGING) == (4), "HCI_CHANNEL_LOGGING != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define HCI_CHANNEL_LOGGING 4 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat hci_channels in mpers mode + +# else + +static +const struct xlat hci_channels[] = { + [HCI_CHANNEL_RAW] = XLAT(HCI_CHANNEL_RAW), + [HCI_CHANNEL_USER] = XLAT(HCI_CHANNEL_USER), + [HCI_CHANNEL_MONITOR] = XLAT(HCI_CHANNEL_MONITOR), + [HCI_CHANNEL_CONTROL] = XLAT(HCI_CHANNEL_CONTROL), + [HCI_CHANNEL_LOGGING] = XLAT(HCI_CHANNEL_LOGGING), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/hci_channels.in b/xlat/hci_channels.in index 1fae39bb..42055bbe 100644 --- a/xlat/hci_channels.in +++ b/xlat/hci_channels.in @@ -1,5 +1,6 @@ -HCI_CHANNEL_RAW -HCI_CHANNEL_USER -HCI_CHANNEL_MONITOR -HCI_CHANNEL_CONTROL -HCI_CHANNEL_LOGGING +#value_indexed +HCI_CHANNEL_RAW 0 +HCI_CHANNEL_USER 1 +HCI_CHANNEL_MONITOR 2 +HCI_CHANNEL_CONTROL 3 +HCI_CHANNEL_LOGGING 4 diff --git a/xlat/hw_breakpoint_len.h b/xlat/hw_breakpoint_len.h index c1b042d6..cb6c4573 100644 --- a/xlat/hw_breakpoint_len.h +++ b/xlat/hw_breakpoint_len.h @@ -1,22 +1,44 @@ /* Generated by ./xlat/gen.sh from ./xlat/hw_breakpoint_len.in; do not edit. */ -#if !(defined(HW_BREAKPOINT_LEN_1) || (defined(HAVE_DECL_HW_BREAKPOINT_LEN_1) && HAVE_DECL_HW_BREAKPOINT_LEN_1)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(HW_BREAKPOINT_LEN_1) || (defined(HAVE_DECL_HW_BREAKPOINT_LEN_1) && HAVE_DECL_HW_BREAKPOINT_LEN_1) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((HW_BREAKPOINT_LEN_1) == (1), "HW_BREAKPOINT_LEN_1 != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define HW_BREAKPOINT_LEN_1 1 #endif -#if !(defined(HW_BREAKPOINT_LEN_2) || (defined(HAVE_DECL_HW_BREAKPOINT_LEN_2) && HAVE_DECL_HW_BREAKPOINT_LEN_2)) +#if defined(HW_BREAKPOINT_LEN_2) || (defined(HAVE_DECL_HW_BREAKPOINT_LEN_2) && HAVE_DECL_HW_BREAKPOINT_LEN_2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((HW_BREAKPOINT_LEN_2) == (2), "HW_BREAKPOINT_LEN_2 != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define HW_BREAKPOINT_LEN_2 2 #endif -#if !(defined(HW_BREAKPOINT_LEN_4) || (defined(HAVE_DECL_HW_BREAKPOINT_LEN_4) && HAVE_DECL_HW_BREAKPOINT_LEN_4)) +#if defined(HW_BREAKPOINT_LEN_4) || (defined(HAVE_DECL_HW_BREAKPOINT_LEN_4) && HAVE_DECL_HW_BREAKPOINT_LEN_4) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((HW_BREAKPOINT_LEN_4) == (4), "HW_BREAKPOINT_LEN_4 != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define HW_BREAKPOINT_LEN_4 4 #endif -#if !(defined(HW_BREAKPOINT_LEN_8) || (defined(HAVE_DECL_HW_BREAKPOINT_LEN_8) && HAVE_DECL_HW_BREAKPOINT_LEN_8)) +#if defined(HW_BREAKPOINT_LEN_8) || (defined(HAVE_DECL_HW_BREAKPOINT_LEN_8) && HAVE_DECL_HW_BREAKPOINT_LEN_8) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((HW_BREAKPOINT_LEN_8) == (8), "HW_BREAKPOINT_LEN_8 != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define HW_BREAKPOINT_LEN_8 8 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat hw_breakpoint_len in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat hw_breakpoint_len in mpers mode + +# else static const struct xlat hw_breakpoint_len[] = { @@ -27,4 +49,6 @@ const struct xlat hw_breakpoint_len[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/hw_breakpoint_type.h b/xlat/hw_breakpoint_type.h index ac48815a..30b3af8c 100644 --- a/xlat/hw_breakpoint_type.h +++ b/xlat/hw_breakpoint_type.h @@ -1,34 +1,63 @@ /* Generated by ./xlat/gen.sh from ./xlat/hw_breakpoint_type.in; do not edit. */ -#if !(defined(HW_BREAKPOINT_EMPTY) || (defined(HAVE_DECL_HW_BREAKPOINT_EMPTY) && HAVE_DECL_HW_BREAKPOINT_EMPTY)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(HW_BREAKPOINT_EMPTY) || (defined(HAVE_DECL_HW_BREAKPOINT_EMPTY) && HAVE_DECL_HW_BREAKPOINT_EMPTY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((HW_BREAKPOINT_EMPTY) == (0), "HW_BREAKPOINT_EMPTY != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define HW_BREAKPOINT_EMPTY 0 #endif -#if !(defined(HW_BREAKPOINT_R) || (defined(HAVE_DECL_HW_BREAKPOINT_R) && HAVE_DECL_HW_BREAKPOINT_R)) +#if defined(HW_BREAKPOINT_R) || (defined(HAVE_DECL_HW_BREAKPOINT_R) && HAVE_DECL_HW_BREAKPOINT_R) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((HW_BREAKPOINT_R) == (1), "HW_BREAKPOINT_R != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define HW_BREAKPOINT_R 1 #endif -#if !(defined(HW_BREAKPOINT_W) || (defined(HAVE_DECL_HW_BREAKPOINT_W) && HAVE_DECL_HW_BREAKPOINT_W)) +#if defined(HW_BREAKPOINT_W) || (defined(HAVE_DECL_HW_BREAKPOINT_W) && HAVE_DECL_HW_BREAKPOINT_W) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((HW_BREAKPOINT_W) == (2), "HW_BREAKPOINT_W != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define HW_BREAKPOINT_W 2 #endif -#if !(defined(HW_BREAKPOINT_RW) || (defined(HAVE_DECL_HW_BREAKPOINT_RW) && HAVE_DECL_HW_BREAKPOINT_RW)) -# define HW_BREAKPOINT_RW HW_BREAKPOINT_R | HW_BREAKPOINT_W +#if defined(HW_BREAKPOINT_RW) || (defined(HAVE_DECL_HW_BREAKPOINT_RW) && HAVE_DECL_HW_BREAKPOINT_RW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((HW_BREAKPOINT_RW) == (3), "HW_BREAKPOINT_RW != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define HW_BREAKPOINT_RW 3 #endif -#if !(defined(HW_BREAKPOINT_X) || (defined(HAVE_DECL_HW_BREAKPOINT_X) && HAVE_DECL_HW_BREAKPOINT_X)) +#if defined(HW_BREAKPOINT_X) || (defined(HAVE_DECL_HW_BREAKPOINT_X) && HAVE_DECL_HW_BREAKPOINT_X) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((HW_BREAKPOINT_X) == (4), "HW_BREAKPOINT_X != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define HW_BREAKPOINT_X 4 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat hw_breakpoint_type in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat hw_breakpoint_type in mpers mode + +# else static const struct xlat hw_breakpoint_type[] = { + XLAT(HW_BREAKPOINT_EMPTY), XLAT(HW_BREAKPOINT_R), XLAT(HW_BREAKPOINT_W), XLAT(HW_BREAKPOINT_RW), XLAT(HW_BREAKPOINT_X), - /* this array should remain not NULL-terminated */ + XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/hw_breakpoint_type.in b/xlat/hw_breakpoint_type.in index 33645d0c..0fc625b7 100644 --- a/xlat/hw_breakpoint_type.in +++ b/xlat/hw_breakpoint_type.in @@ -1,6 +1,6 @@ +/* sort -k2,2n */ HW_BREAKPOINT_EMPTY 0 HW_BREAKPOINT_R 1 HW_BREAKPOINT_W 2 -HW_BREAKPOINT_RW HW_BREAKPOINT_R | HW_BREAKPOINT_W +HW_BREAKPOINT_RW 3 HW_BREAKPOINT_X 4 -#unterminated diff --git a/xlat/icmpfilterflags.h b/xlat/icmpfilterflags.h index 1672a19b..a3f1300d 100644 --- a/xlat/icmpfilterflags.h +++ b/xlat/icmpfilterflags.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/icmpfilterflags.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat icmpfilterflags in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat icmpfilterflags in mpers mode + +# else static const struct xlat icmpfilterflags[] = { @@ -50,4 +56,6 @@ const struct xlat icmpfilterflags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/if_dqblk_valid.h b/xlat/if_dqblk_valid.h index 67d39346..e6d03bf2 100644 --- a/xlat/if_dqblk_valid.h +++ b/xlat/if_dqblk_valid.h @@ -1,28 +1,58 @@ /* Generated by ./xlat/gen.sh from ./xlat/if_dqblk_valid.in; do not edit. */ -#if !(defined(QIF_BLIMITS) || (defined(HAVE_DECL_QIF_BLIMITS) && HAVE_DECL_QIF_BLIMITS)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(QIF_BLIMITS) || (defined(HAVE_DECL_QIF_BLIMITS) && HAVE_DECL_QIF_BLIMITS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((QIF_BLIMITS) == ((1 << 0)), "QIF_BLIMITS != (1 << 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define QIF_BLIMITS (1 << 0) #endif -#if !(defined(QIF_SPACE) || (defined(HAVE_DECL_QIF_SPACE) && HAVE_DECL_QIF_SPACE)) +#if defined(QIF_SPACE) || (defined(HAVE_DECL_QIF_SPACE) && HAVE_DECL_QIF_SPACE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((QIF_SPACE) == ((1 << 1)), "QIF_SPACE != (1 << 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define QIF_SPACE (1 << 1) #endif -#if !(defined(QIF_ILIMITS) || (defined(HAVE_DECL_QIF_ILIMITS) && HAVE_DECL_QIF_ILIMITS)) +#if defined(QIF_ILIMITS) || (defined(HAVE_DECL_QIF_ILIMITS) && HAVE_DECL_QIF_ILIMITS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((QIF_ILIMITS) == ((1 << 2)), "QIF_ILIMITS != (1 << 2)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define QIF_ILIMITS (1 << 2) #endif -#if !(defined(QIF_INODES) || (defined(HAVE_DECL_QIF_INODES) && HAVE_DECL_QIF_INODES)) +#if defined(QIF_INODES) || (defined(HAVE_DECL_QIF_INODES) && HAVE_DECL_QIF_INODES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((QIF_INODES) == ((1 << 3)), "QIF_INODES != (1 << 3)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define QIF_INODES (1 << 3) #endif -#if !(defined(QIF_BTIME) || (defined(HAVE_DECL_QIF_BTIME) && HAVE_DECL_QIF_BTIME)) +#if defined(QIF_BTIME) || (defined(HAVE_DECL_QIF_BTIME) && HAVE_DECL_QIF_BTIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((QIF_BTIME) == ((1 << 4)), "QIF_BTIME != (1 << 4)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define QIF_BTIME (1 << 4) #endif -#if !(defined(QIF_ITIME) || (defined(HAVE_DECL_QIF_ITIME) && HAVE_DECL_QIF_ITIME)) +#if defined(QIF_ITIME) || (defined(HAVE_DECL_QIF_ITIME) && HAVE_DECL_QIF_ITIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((QIF_ITIME) == ((1 << 5)), "QIF_ITIME != (1 << 5)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define QIF_ITIME (1 << 5) #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat if_dqblk_valid in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat if_dqblk_valid in mpers mode + +# else static const struct xlat if_dqblk_valid[] = { @@ -35,4 +65,6 @@ const struct xlat if_dqblk_valid[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/if_dqinfo_flags.h b/xlat/if_dqinfo_flags.h index 72b26908..aeb76bda 100644 --- a/xlat/if_dqinfo_flags.h +++ b/xlat/if_dqinfo_flags.h @@ -1,16 +1,30 @@ /* Generated by ./xlat/gen.sh from ./xlat/if_dqinfo_flags.in; do not edit. */ -#if !(defined(DQF_ROOT_SQUASH) || (defined(HAVE_DECL_DQF_ROOT_SQUASH) && HAVE_DECL_DQF_ROOT_SQUASH)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(DQF_ROOT_SQUASH) || (defined(HAVE_DECL_DQF_ROOT_SQUASH) && HAVE_DECL_DQF_ROOT_SQUASH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DQF_ROOT_SQUASH) == ((1 << 0)), "DQF_ROOT_SQUASH != (1 << 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define DQF_ROOT_SQUASH (1 << 0) #endif -#if !(defined(DQF_SYS_FILE) || (defined(HAVE_DECL_DQF_SYS_FILE) && HAVE_DECL_DQF_SYS_FILE)) +#if defined(DQF_SYS_FILE) || (defined(HAVE_DECL_DQF_SYS_FILE) && HAVE_DECL_DQF_SYS_FILE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DQF_SYS_FILE) == ((1 << 16)), "DQF_SYS_FILE != (1 << 16)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define DQF_SYS_FILE (1 << 16) #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat if_dqinfo_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat if_dqinfo_flags in mpers mode + +# else static const struct xlat if_dqinfo_flags[] = { @@ -19,4 +33,6 @@ const struct xlat if_dqinfo_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/if_dqinfo_valid.h b/xlat/if_dqinfo_valid.h index 8944d17f..b4fc1272 100644 --- a/xlat/if_dqinfo_valid.h +++ b/xlat/if_dqinfo_valid.h @@ -1,19 +1,37 @@ /* Generated by ./xlat/gen.sh from ./xlat/if_dqinfo_valid.in; do not edit. */ -#if !(defined(IIF_BGRACE) || (defined(HAVE_DECL_IIF_BGRACE) && HAVE_DECL_IIF_BGRACE)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IIF_BGRACE) || (defined(HAVE_DECL_IIF_BGRACE) && HAVE_DECL_IIF_BGRACE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IIF_BGRACE) == ((1 << 0)), "IIF_BGRACE != (1 << 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IIF_BGRACE (1 << 0) #endif -#if !(defined(IIF_IGRACE) || (defined(HAVE_DECL_IIF_IGRACE) && HAVE_DECL_IIF_IGRACE)) +#if defined(IIF_IGRACE) || (defined(HAVE_DECL_IIF_IGRACE) && HAVE_DECL_IIF_IGRACE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IIF_IGRACE) == ((1 << 1)), "IIF_IGRACE != (1 << 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IIF_IGRACE (1 << 1) #endif -#if !(defined(IIF_FLAGS) || (defined(HAVE_DECL_IIF_FLAGS) && HAVE_DECL_IIF_FLAGS)) +#if defined(IIF_FLAGS) || (defined(HAVE_DECL_IIF_FLAGS) && HAVE_DECL_IIF_FLAGS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IIF_FLAGS) == ((1 << 2)), "IIF_FLAGS != (1 << 2)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IIF_FLAGS (1 << 2) #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat if_dqinfo_valid in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat if_dqinfo_valid in mpers mode + +# else static const struct xlat if_dqinfo_valid[] = { @@ -23,4 +41,6 @@ const struct xlat if_dqinfo_valid[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ifaddrflags.h b/xlat/ifaddrflags.h new file mode 100644 index 00000000..cc2c9894 --- /dev/null +++ b/xlat/ifaddrflags.h @@ -0,0 +1,58 @@ +/* Generated by ./xlat/gen.sh from ./xlat/ifaddrflags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat ifaddrflags in mpers mode + +# else + +static +const struct xlat ifaddrflags[] = { +#if defined(IFA_F_SECONDARY) || (defined(HAVE_DECL_IFA_F_SECONDARY) && HAVE_DECL_IFA_F_SECONDARY) + XLAT(IFA_F_SECONDARY), +#endif +#if defined(IFA_F_NODAD) || (defined(HAVE_DECL_IFA_F_NODAD) && HAVE_DECL_IFA_F_NODAD) + XLAT(IFA_F_NODAD), +#endif +#if defined(IFA_F_OPTIMISTIC) || (defined(HAVE_DECL_IFA_F_OPTIMISTIC) && HAVE_DECL_IFA_F_OPTIMISTIC) + XLAT(IFA_F_OPTIMISTIC), +#endif +#if defined(IFA_F_DADFAILED) || (defined(HAVE_DECL_IFA_F_DADFAILED) && HAVE_DECL_IFA_F_DADFAILED) + XLAT(IFA_F_DADFAILED), +#endif +#if defined(IFA_F_HOMEADDRESS) || (defined(HAVE_DECL_IFA_F_HOMEADDRESS) && HAVE_DECL_IFA_F_HOMEADDRESS) + XLAT(IFA_F_HOMEADDRESS), +#endif +#if defined(IFA_F_DEPRECATED) || (defined(HAVE_DECL_IFA_F_DEPRECATED) && HAVE_DECL_IFA_F_DEPRECATED) + XLAT(IFA_F_DEPRECATED), +#endif +#if defined(IFA_F_TENTATIVE) || (defined(HAVE_DECL_IFA_F_TENTATIVE) && HAVE_DECL_IFA_F_TENTATIVE) + XLAT(IFA_F_TENTATIVE), +#endif +#if defined(IFA_F_PERMANENT) || (defined(HAVE_DECL_IFA_F_PERMANENT) && HAVE_DECL_IFA_F_PERMANENT) + XLAT(IFA_F_PERMANENT), +#endif +#if defined(IFA_F_MANAGETEMPADDR) || (defined(HAVE_DECL_IFA_F_MANAGETEMPADDR) && HAVE_DECL_IFA_F_MANAGETEMPADDR) + XLAT(IFA_F_MANAGETEMPADDR), +#endif +#if defined(IFA_F_NOPREFIXROUTE) || (defined(HAVE_DECL_IFA_F_NOPREFIXROUTE) && HAVE_DECL_IFA_F_NOPREFIXROUTE) + XLAT(IFA_F_NOPREFIXROUTE), +#endif +#if defined(IFA_F_MCAUTOJOIN) || (defined(HAVE_DECL_IFA_F_MCAUTOJOIN) && HAVE_DECL_IFA_F_MCAUTOJOIN) + XLAT(IFA_F_MCAUTOJOIN), +#endif +#if defined(IFA_F_STABLE_PRIVACY) || (defined(HAVE_DECL_IFA_F_STABLE_PRIVACY) && HAVE_DECL_IFA_F_STABLE_PRIVACY) + XLAT(IFA_F_STABLE_PRIVACY), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ifaddrflags.in b/xlat/ifaddrflags.in new file mode 100644 index 00000000..19df46b1 --- /dev/null +++ b/xlat/ifaddrflags.in @@ -0,0 +1,12 @@ +IFA_F_SECONDARY +IFA_F_NODAD +IFA_F_OPTIMISTIC +IFA_F_DADFAILED +IFA_F_HOMEADDRESS +IFA_F_DEPRECATED +IFA_F_TENTATIVE +IFA_F_PERMANENT +IFA_F_MANAGETEMPADDR +IFA_F_NOPREFIXROUTE +IFA_F_MCAUTOJOIN +IFA_F_STABLE_PRIVACY diff --git a/xlat/iffflags.h b/xlat/iffflags.h index 7aaee51b..5c1b507d 100644 --- a/xlat/iffflags.h +++ b/xlat/iffflags.h @@ -1,61 +1,170 @@ /* Generated by ./xlat/gen.sh from ./xlat/iffflags.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -extern const struct xlat iffflags[]; - -#else - -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) -static -# endif -const struct xlat iffflags[] = { #if defined(IFF_UP) || (defined(HAVE_DECL_IFF_UP) && HAVE_DECL_IFF_UP) - XLAT(IFF_UP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFF_UP) == ((1 << 0)), "IFF_UP != (1 << 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFF_UP (1 << 0) #endif #if defined(IFF_BROADCAST) || (defined(HAVE_DECL_IFF_BROADCAST) && HAVE_DECL_IFF_BROADCAST) - XLAT(IFF_BROADCAST), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFF_BROADCAST) == ((1 << 1)), "IFF_BROADCAST != (1 << 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFF_BROADCAST (1 << 1) #endif #if defined(IFF_DEBUG) || (defined(HAVE_DECL_IFF_DEBUG) && HAVE_DECL_IFF_DEBUG) - XLAT(IFF_DEBUG), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFF_DEBUG) == ((1 << 2)), "IFF_DEBUG != (1 << 2)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFF_DEBUG (1 << 2) #endif #if defined(IFF_LOOPBACK) || (defined(HAVE_DECL_IFF_LOOPBACK) && HAVE_DECL_IFF_LOOPBACK) - XLAT(IFF_LOOPBACK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFF_LOOPBACK) == ((1 << 3)), "IFF_LOOPBACK != (1 << 3)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFF_LOOPBACK (1 << 3) #endif #if defined(IFF_POINTOPOINT) || (defined(HAVE_DECL_IFF_POINTOPOINT) && HAVE_DECL_IFF_POINTOPOINT) - XLAT(IFF_POINTOPOINT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFF_POINTOPOINT) == ((1 << 4)), "IFF_POINTOPOINT != (1 << 4)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFF_POINTOPOINT (1 << 4) #endif #if defined(IFF_NOTRAILERS) || (defined(HAVE_DECL_IFF_NOTRAILERS) && HAVE_DECL_IFF_NOTRAILERS) - XLAT(IFF_NOTRAILERS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFF_NOTRAILERS) == ((1 << 5)), "IFF_NOTRAILERS != (1 << 5)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFF_NOTRAILERS (1 << 5) #endif #if defined(IFF_RUNNING) || (defined(HAVE_DECL_IFF_RUNNING) && HAVE_DECL_IFF_RUNNING) - XLAT(IFF_RUNNING), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFF_RUNNING) == ((1 << 6)), "IFF_RUNNING != (1 << 6)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFF_RUNNING (1 << 6) #endif #if defined(IFF_NOARP) || (defined(HAVE_DECL_IFF_NOARP) && HAVE_DECL_IFF_NOARP) - XLAT(IFF_NOARP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFF_NOARP) == ((1 << 7)), "IFF_NOARP != (1 << 7)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFF_NOARP (1 << 7) #endif #if defined(IFF_PROMISC) || (defined(HAVE_DECL_IFF_PROMISC) && HAVE_DECL_IFF_PROMISC) - XLAT(IFF_PROMISC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFF_PROMISC) == ((1 << 8)), "IFF_PROMISC != (1 << 8)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFF_PROMISC (1 << 8) #endif #if defined(IFF_ALLMULTI) || (defined(HAVE_DECL_IFF_ALLMULTI) && HAVE_DECL_IFF_ALLMULTI) - XLAT(IFF_ALLMULTI), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFF_ALLMULTI) == ((1 << 9)), "IFF_ALLMULTI != (1 << 9)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFF_ALLMULTI (1 << 9) #endif #if defined(IFF_MASTER) || (defined(HAVE_DECL_IFF_MASTER) && HAVE_DECL_IFF_MASTER) - XLAT(IFF_MASTER), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFF_MASTER) == ((1 << 10)), "IFF_MASTER != (1 << 10)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFF_MASTER (1 << 10) #endif #if defined(IFF_SLAVE) || (defined(HAVE_DECL_IFF_SLAVE) && HAVE_DECL_IFF_SLAVE) - XLAT(IFF_SLAVE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFF_SLAVE) == ((1 << 11)), "IFF_SLAVE != (1 << 11)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFF_SLAVE (1 << 11) #endif #if defined(IFF_MULTICAST) || (defined(HAVE_DECL_IFF_MULTICAST) && HAVE_DECL_IFF_MULTICAST) - XLAT(IFF_MULTICAST), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFF_MULTICAST) == ((1 << 12)), "IFF_MULTICAST != (1 << 12)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFF_MULTICAST (1 << 12) #endif #if defined(IFF_PORTSEL) || (defined(HAVE_DECL_IFF_PORTSEL) && HAVE_DECL_IFF_PORTSEL) - XLAT(IFF_PORTSEL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFF_PORTSEL) == ((1 << 13)), "IFF_PORTSEL != (1 << 13)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFF_PORTSEL (1 << 13) #endif #if defined(IFF_AUTOMEDIA) || (defined(HAVE_DECL_IFF_AUTOMEDIA) && HAVE_DECL_IFF_AUTOMEDIA) - XLAT(IFF_AUTOMEDIA), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFF_AUTOMEDIA) == ((1 << 14)), "IFF_AUTOMEDIA != (1 << 14)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFF_AUTOMEDIA (1 << 14) +#endif +#if defined(IFF_DYNAMIC) || (defined(HAVE_DECL_IFF_DYNAMIC) && HAVE_DECL_IFF_DYNAMIC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFF_DYNAMIC) == ((1 << 15)), "IFF_DYNAMIC != (1 << 15)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFF_DYNAMIC (1 << 15) +#endif +#if defined(IFF_LOWER_UP) || (defined(HAVE_DECL_IFF_LOWER_UP) && HAVE_DECL_IFF_LOWER_UP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFF_LOWER_UP) == ((1 << 16)), "IFF_LOWER_UP != (1 << 16)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFF_LOWER_UP (1 << 16) +#endif +#if defined(IFF_DORMANT) || (defined(HAVE_DECL_IFF_DORMANT) && HAVE_DECL_IFF_DORMANT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFF_DORMANT) == ((1 << 17)), "IFF_DORMANT != (1 << 17)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFF_DORMANT (1 << 17) #endif +#if defined(IFF_ECHO) || (defined(HAVE_DECL_IFF_ECHO) && HAVE_DECL_IFF_ECHO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFF_ECHO) == ((1 << 18)), "IFF_ECHO != (1 << 18)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFF_ECHO (1 << 18) +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS + +const struct xlat iffflags[] = { + + XLAT(IFF_UP), + XLAT(IFF_BROADCAST), + XLAT(IFF_DEBUG), + XLAT(IFF_LOOPBACK), + XLAT(IFF_POINTOPOINT), + XLAT(IFF_NOTRAILERS), + XLAT(IFF_RUNNING), + XLAT(IFF_NOARP), + XLAT(IFF_PROMISC), + XLAT(IFF_ALLMULTI), + XLAT(IFF_MASTER), + XLAT(IFF_SLAVE), + XLAT(IFF_MULTICAST), + XLAT(IFF_PORTSEL), + XLAT(IFF_AUTOMEDIA), + XLAT(IFF_DYNAMIC), + XLAT(IFF_LOWER_UP), + XLAT(IFF_DORMANT), + XLAT(IFF_ECHO), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/iffflags.in b/xlat/iffflags.in index a6249b05..210495b7 100644 --- a/xlat/iffflags.in +++ b/xlat/iffflags.in @@ -1,15 +1,20 @@ -IFF_UP -IFF_BROADCAST -IFF_DEBUG -IFF_LOOPBACK -IFF_POINTOPOINT -IFF_NOTRAILERS -IFF_RUNNING -IFF_NOARP -IFF_PROMISC -IFF_ALLMULTI -IFF_MASTER -IFF_SLAVE -IFF_MULTICAST -IFF_PORTSEL -IFF_AUTOMEDIA +/* sort -k4,4g */ +IFF_UP (1 << 0) +IFF_BROADCAST (1 << 1) +IFF_DEBUG (1 << 2) +IFF_LOOPBACK (1 << 3) +IFF_POINTOPOINT (1 << 4) +IFF_NOTRAILERS (1 << 5) +IFF_RUNNING (1 << 6) +IFF_NOARP (1 << 7) +IFF_PROMISC (1 << 8) +IFF_ALLMULTI (1 << 9) +IFF_MASTER (1 << 10) +IFF_SLAVE (1 << 11) +IFF_MULTICAST (1 << 12) +IFF_PORTSEL (1 << 13) +IFF_AUTOMEDIA (1 << 14) +IFF_DYNAMIC (1 << 15) +IFF_LOWER_UP (1 << 16) +IFF_DORMANT (1 << 17) +IFF_ECHO (1 << 18) diff --git a/xlat/in6_addr_gen_mode.h b/xlat/in6_addr_gen_mode.h new file mode 100644 index 00000000..c11c00a7 --- /dev/null +++ b/xlat/in6_addr_gen_mode.h @@ -0,0 +1,54 @@ +/* Generated by ./xlat/gen.sh from ./xlat/in6_addr_gen_mode.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IN6_ADDR_GEN_MODE_EUI64) || (defined(HAVE_DECL_IN6_ADDR_GEN_MODE_EUI64) && HAVE_DECL_IN6_ADDR_GEN_MODE_EUI64) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN6_ADDR_GEN_MODE_EUI64) == (0), "IN6_ADDR_GEN_MODE_EUI64 != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IN6_ADDR_GEN_MODE_EUI64 0 +#endif +#if defined(IN6_ADDR_GEN_MODE_NONE) || (defined(HAVE_DECL_IN6_ADDR_GEN_MODE_NONE) && HAVE_DECL_IN6_ADDR_GEN_MODE_NONE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN6_ADDR_GEN_MODE_NONE) == (1), "IN6_ADDR_GEN_MODE_NONE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IN6_ADDR_GEN_MODE_NONE 1 +#endif +#if defined(IN6_ADDR_GEN_MODE_STABLE_PRIVACY) || (defined(HAVE_DECL_IN6_ADDR_GEN_MODE_STABLE_PRIVACY) && HAVE_DECL_IN6_ADDR_GEN_MODE_STABLE_PRIVACY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN6_ADDR_GEN_MODE_STABLE_PRIVACY) == (2), "IN6_ADDR_GEN_MODE_STABLE_PRIVACY != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IN6_ADDR_GEN_MODE_STABLE_PRIVACY 2 +#endif +#if defined(IN6_ADDR_GEN_MODE_RANDOM) || (defined(HAVE_DECL_IN6_ADDR_GEN_MODE_RANDOM) && HAVE_DECL_IN6_ADDR_GEN_MODE_RANDOM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN6_ADDR_GEN_MODE_RANDOM) == (3), "IN6_ADDR_GEN_MODE_RANDOM != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IN6_ADDR_GEN_MODE_RANDOM 3 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat in6_addr_gen_mode in mpers mode + +# else + +static +const struct xlat in6_addr_gen_mode[] = { + [IN6_ADDR_GEN_MODE_EUI64] = XLAT(IN6_ADDR_GEN_MODE_EUI64), + [IN6_ADDR_GEN_MODE_NONE] = XLAT(IN6_ADDR_GEN_MODE_NONE), + [IN6_ADDR_GEN_MODE_STABLE_PRIVACY] = XLAT(IN6_ADDR_GEN_MODE_STABLE_PRIVACY), + [IN6_ADDR_GEN_MODE_RANDOM] = XLAT(IN6_ADDR_GEN_MODE_RANDOM), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/in6_addr_gen_mode.in b/xlat/in6_addr_gen_mode.in new file mode 100644 index 00000000..5d01a135 --- /dev/null +++ b/xlat/in6_addr_gen_mode.in @@ -0,0 +1,5 @@ +#value_indexed +IN6_ADDR_GEN_MODE_EUI64 0 +IN6_ADDR_GEN_MODE_NONE 1 +IN6_ADDR_GEN_MODE_STABLE_PRIVACY 2 +IN6_ADDR_GEN_MODE_RANDOM 3 diff --git a/xlat/inet6_devconf_indices.h b/xlat/inet6_devconf_indices.h new file mode 100644 index 00000000..97a210b0 --- /dev/null +++ b/xlat/inet6_devconf_indices.h @@ -0,0 +1,430 @@ +/* Generated by ./xlat/gen.sh from ./xlat/inet6_devconf_indices.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(DEVCONF_FORWARDING) || (defined(HAVE_DECL_DEVCONF_FORWARDING) && HAVE_DECL_DEVCONF_FORWARDING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_FORWARDING) == (0), "DEVCONF_FORWARDING != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_FORWARDING 0 +#endif +#if defined(DEVCONF_HOPLIMIT) || (defined(HAVE_DECL_DEVCONF_HOPLIMIT) && HAVE_DECL_DEVCONF_HOPLIMIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_HOPLIMIT) == (1), "DEVCONF_HOPLIMIT != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_HOPLIMIT 1 +#endif +#if defined(DEVCONF_MTU6) || (defined(HAVE_DECL_DEVCONF_MTU6) && HAVE_DECL_DEVCONF_MTU6) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_MTU6) == (2), "DEVCONF_MTU6 != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_MTU6 2 +#endif +#if defined(DEVCONF_ACCEPT_RA) || (defined(HAVE_DECL_DEVCONF_ACCEPT_RA) && HAVE_DECL_DEVCONF_ACCEPT_RA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_ACCEPT_RA) == (3), "DEVCONF_ACCEPT_RA != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_ACCEPT_RA 3 +#endif +#if defined(DEVCONF_ACCEPT_REDIRECTS) || (defined(HAVE_DECL_DEVCONF_ACCEPT_REDIRECTS) && HAVE_DECL_DEVCONF_ACCEPT_REDIRECTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_ACCEPT_REDIRECTS) == (4), "DEVCONF_ACCEPT_REDIRECTS != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_ACCEPT_REDIRECTS 4 +#endif +#if defined(DEVCONF_AUTOCONF) || (defined(HAVE_DECL_DEVCONF_AUTOCONF) && HAVE_DECL_DEVCONF_AUTOCONF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_AUTOCONF) == (5), "DEVCONF_AUTOCONF != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_AUTOCONF 5 +#endif +#if defined(DEVCONF_DAD_TRANSMITS) || (defined(HAVE_DECL_DEVCONF_DAD_TRANSMITS) && HAVE_DECL_DEVCONF_DAD_TRANSMITS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_DAD_TRANSMITS) == (6), "DEVCONF_DAD_TRANSMITS != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_DAD_TRANSMITS 6 +#endif +#if defined(DEVCONF_RTR_SOLICITS) || (defined(HAVE_DECL_DEVCONF_RTR_SOLICITS) && HAVE_DECL_DEVCONF_RTR_SOLICITS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_RTR_SOLICITS) == (7), "DEVCONF_RTR_SOLICITS != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_RTR_SOLICITS 7 +#endif +#if defined(DEVCONF_RTR_SOLICIT_INTERVAL) || (defined(HAVE_DECL_DEVCONF_RTR_SOLICIT_INTERVAL) && HAVE_DECL_DEVCONF_RTR_SOLICIT_INTERVAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_RTR_SOLICIT_INTERVAL) == (8), "DEVCONF_RTR_SOLICIT_INTERVAL != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_RTR_SOLICIT_INTERVAL 8 +#endif +#if defined(DEVCONF_RTR_SOLICIT_DELAY) || (defined(HAVE_DECL_DEVCONF_RTR_SOLICIT_DELAY) && HAVE_DECL_DEVCONF_RTR_SOLICIT_DELAY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_RTR_SOLICIT_DELAY) == (9), "DEVCONF_RTR_SOLICIT_DELAY != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_RTR_SOLICIT_DELAY 9 +#endif +#if defined(DEVCONF_USE_TEMPADDR) || (defined(HAVE_DECL_DEVCONF_USE_TEMPADDR) && HAVE_DECL_DEVCONF_USE_TEMPADDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_USE_TEMPADDR) == (10), "DEVCONF_USE_TEMPADDR != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_USE_TEMPADDR 10 +#endif +#if defined(DEVCONF_TEMP_VALID_LFT) || (defined(HAVE_DECL_DEVCONF_TEMP_VALID_LFT) && HAVE_DECL_DEVCONF_TEMP_VALID_LFT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_TEMP_VALID_LFT) == (11), "DEVCONF_TEMP_VALID_LFT != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_TEMP_VALID_LFT 11 +#endif +#if defined(DEVCONF_TEMP_PREFERED_LFT) || (defined(HAVE_DECL_DEVCONF_TEMP_PREFERED_LFT) && HAVE_DECL_DEVCONF_TEMP_PREFERED_LFT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_TEMP_PREFERED_LFT) == (12), "DEVCONF_TEMP_PREFERED_LFT != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_TEMP_PREFERED_LFT 12 +#endif +#if defined(DEVCONF_REGEN_MAX_RETRY) || (defined(HAVE_DECL_DEVCONF_REGEN_MAX_RETRY) && HAVE_DECL_DEVCONF_REGEN_MAX_RETRY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_REGEN_MAX_RETRY) == (13), "DEVCONF_REGEN_MAX_RETRY != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_REGEN_MAX_RETRY 13 +#endif +#if defined(DEVCONF_MAX_DESYNC_FACTOR) || (defined(HAVE_DECL_DEVCONF_MAX_DESYNC_FACTOR) && HAVE_DECL_DEVCONF_MAX_DESYNC_FACTOR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_MAX_DESYNC_FACTOR) == (14), "DEVCONF_MAX_DESYNC_FACTOR != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_MAX_DESYNC_FACTOR 14 +#endif +#if defined(DEVCONF_MAX_ADDRESSES) || (defined(HAVE_DECL_DEVCONF_MAX_ADDRESSES) && HAVE_DECL_DEVCONF_MAX_ADDRESSES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_MAX_ADDRESSES) == (15), "DEVCONF_MAX_ADDRESSES != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_MAX_ADDRESSES 15 +#endif +#if defined(DEVCONF_FORCE_MLD_VERSION) || (defined(HAVE_DECL_DEVCONF_FORCE_MLD_VERSION) && HAVE_DECL_DEVCONF_FORCE_MLD_VERSION) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_FORCE_MLD_VERSION) == (16), "DEVCONF_FORCE_MLD_VERSION != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_FORCE_MLD_VERSION 16 +#endif +#if defined(DEVCONF_ACCEPT_RA_DEFRTR) || (defined(HAVE_DECL_DEVCONF_ACCEPT_RA_DEFRTR) && HAVE_DECL_DEVCONF_ACCEPT_RA_DEFRTR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_ACCEPT_RA_DEFRTR) == (17), "DEVCONF_ACCEPT_RA_DEFRTR != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_ACCEPT_RA_DEFRTR 17 +#endif +#if defined(DEVCONF_ACCEPT_RA_PINFO) || (defined(HAVE_DECL_DEVCONF_ACCEPT_RA_PINFO) && HAVE_DECL_DEVCONF_ACCEPT_RA_PINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_ACCEPT_RA_PINFO) == (18), "DEVCONF_ACCEPT_RA_PINFO != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_ACCEPT_RA_PINFO 18 +#endif +#if defined(DEVCONF_ACCEPT_RA_RTR_PREF) || (defined(HAVE_DECL_DEVCONF_ACCEPT_RA_RTR_PREF) && HAVE_DECL_DEVCONF_ACCEPT_RA_RTR_PREF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_ACCEPT_RA_RTR_PREF) == (19), "DEVCONF_ACCEPT_RA_RTR_PREF != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_ACCEPT_RA_RTR_PREF 19 +#endif +#if defined(DEVCONF_RTR_PROBE_INTERVAL) || (defined(HAVE_DECL_DEVCONF_RTR_PROBE_INTERVAL) && HAVE_DECL_DEVCONF_RTR_PROBE_INTERVAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_RTR_PROBE_INTERVAL) == (20), "DEVCONF_RTR_PROBE_INTERVAL != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_RTR_PROBE_INTERVAL 20 +#endif +#if defined(DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN) || (defined(HAVE_DECL_DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN) && HAVE_DECL_DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN) == (21), "DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN 21 +#endif +#if defined(DEVCONF_PROXY_NDP) || (defined(HAVE_DECL_DEVCONF_PROXY_NDP) && HAVE_DECL_DEVCONF_PROXY_NDP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_PROXY_NDP) == (22), "DEVCONF_PROXY_NDP != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_PROXY_NDP 22 +#endif +#if defined(DEVCONF_OPTIMISTIC_DAD) || (defined(HAVE_DECL_DEVCONF_OPTIMISTIC_DAD) && HAVE_DECL_DEVCONF_OPTIMISTIC_DAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_OPTIMISTIC_DAD) == (23), "DEVCONF_OPTIMISTIC_DAD != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_OPTIMISTIC_DAD 23 +#endif +#if defined(DEVCONF_ACCEPT_SOURCE_ROUTE) || (defined(HAVE_DECL_DEVCONF_ACCEPT_SOURCE_ROUTE) && HAVE_DECL_DEVCONF_ACCEPT_SOURCE_ROUTE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_ACCEPT_SOURCE_ROUTE) == (24), "DEVCONF_ACCEPT_SOURCE_ROUTE != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_ACCEPT_SOURCE_ROUTE 24 +#endif +#if defined(DEVCONF_MC_FORWARDING) || (defined(HAVE_DECL_DEVCONF_MC_FORWARDING) && HAVE_DECL_DEVCONF_MC_FORWARDING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_MC_FORWARDING) == (25), "DEVCONF_MC_FORWARDING != 25"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_MC_FORWARDING 25 +#endif +#if defined(DEVCONF_DISABLE_IPV6) || (defined(HAVE_DECL_DEVCONF_DISABLE_IPV6) && HAVE_DECL_DEVCONF_DISABLE_IPV6) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_DISABLE_IPV6) == (26), "DEVCONF_DISABLE_IPV6 != 26"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_DISABLE_IPV6 26 +#endif +#if defined(DEVCONF_ACCEPT_DAD) || (defined(HAVE_DECL_DEVCONF_ACCEPT_DAD) && HAVE_DECL_DEVCONF_ACCEPT_DAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_ACCEPT_DAD) == (27), "DEVCONF_ACCEPT_DAD != 27"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_ACCEPT_DAD 27 +#endif +#if defined(DEVCONF_FORCE_TLLAO) || (defined(HAVE_DECL_DEVCONF_FORCE_TLLAO) && HAVE_DECL_DEVCONF_FORCE_TLLAO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_FORCE_TLLAO) == (28), "DEVCONF_FORCE_TLLAO != 28"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_FORCE_TLLAO 28 +#endif +#if defined(DEVCONF_NDISC_NOTIFY) || (defined(HAVE_DECL_DEVCONF_NDISC_NOTIFY) && HAVE_DECL_DEVCONF_NDISC_NOTIFY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_NDISC_NOTIFY) == (29), "DEVCONF_NDISC_NOTIFY != 29"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_NDISC_NOTIFY 29 +#endif +#if defined(DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL) || (defined(HAVE_DECL_DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL) && HAVE_DECL_DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL) == (30), "DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL != 30"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL 30 +#endif +#if defined(DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL) || (defined(HAVE_DECL_DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL) && HAVE_DECL_DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL) == (31), "DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL != 31"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL 31 +#endif +#if defined(DEVCONF_SUPPRESS_FRAG_NDISC) || (defined(HAVE_DECL_DEVCONF_SUPPRESS_FRAG_NDISC) && HAVE_DECL_DEVCONF_SUPPRESS_FRAG_NDISC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_SUPPRESS_FRAG_NDISC) == (32), "DEVCONF_SUPPRESS_FRAG_NDISC != 32"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_SUPPRESS_FRAG_NDISC 32 +#endif +#if defined(DEVCONF_ACCEPT_RA_FROM_LOCAL) || (defined(HAVE_DECL_DEVCONF_ACCEPT_RA_FROM_LOCAL) && HAVE_DECL_DEVCONF_ACCEPT_RA_FROM_LOCAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_ACCEPT_RA_FROM_LOCAL) == (33), "DEVCONF_ACCEPT_RA_FROM_LOCAL != 33"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_ACCEPT_RA_FROM_LOCAL 33 +#endif +#if defined(DEVCONF_USE_OPTIMISTIC) || (defined(HAVE_DECL_DEVCONF_USE_OPTIMISTIC) && HAVE_DECL_DEVCONF_USE_OPTIMISTIC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_USE_OPTIMISTIC) == (34), "DEVCONF_USE_OPTIMISTIC != 34"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_USE_OPTIMISTIC 34 +#endif +#if defined(DEVCONF_ACCEPT_RA_MTU) || (defined(HAVE_DECL_DEVCONF_ACCEPT_RA_MTU) && HAVE_DECL_DEVCONF_ACCEPT_RA_MTU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_ACCEPT_RA_MTU) == (35), "DEVCONF_ACCEPT_RA_MTU != 35"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_ACCEPT_RA_MTU 35 +#endif +#if defined(DEVCONF_STABLE_SECRET) || (defined(HAVE_DECL_DEVCONF_STABLE_SECRET) && HAVE_DECL_DEVCONF_STABLE_SECRET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_STABLE_SECRET) == (36), "DEVCONF_STABLE_SECRET != 36"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_STABLE_SECRET 36 +#endif +#if defined(DEVCONF_USE_OIF_ADDRS_ONLY) || (defined(HAVE_DECL_DEVCONF_USE_OIF_ADDRS_ONLY) && HAVE_DECL_DEVCONF_USE_OIF_ADDRS_ONLY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_USE_OIF_ADDRS_ONLY) == (37), "DEVCONF_USE_OIF_ADDRS_ONLY != 37"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_USE_OIF_ADDRS_ONLY 37 +#endif +#if defined(DEVCONF_ACCEPT_RA_MIN_HOP_LIMIT) || (defined(HAVE_DECL_DEVCONF_ACCEPT_RA_MIN_HOP_LIMIT) && HAVE_DECL_DEVCONF_ACCEPT_RA_MIN_HOP_LIMIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_ACCEPT_RA_MIN_HOP_LIMIT) == (38), "DEVCONF_ACCEPT_RA_MIN_HOP_LIMIT != 38"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_ACCEPT_RA_MIN_HOP_LIMIT 38 +#endif +#if defined(DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN) || (defined(HAVE_DECL_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN) && HAVE_DECL_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN) == (39), "DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN != 39"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN 39 +#endif +#if defined(DEVCONF_DROP_UNICAST_IN_L2_MULTICAST) || (defined(HAVE_DECL_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST) && HAVE_DECL_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_DROP_UNICAST_IN_L2_MULTICAST) == (40), "DEVCONF_DROP_UNICAST_IN_L2_MULTICAST != 40"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_DROP_UNICAST_IN_L2_MULTICAST 40 +#endif +#if defined(DEVCONF_DROP_UNSOLICITED_NA) || (defined(HAVE_DECL_DEVCONF_DROP_UNSOLICITED_NA) && HAVE_DECL_DEVCONF_DROP_UNSOLICITED_NA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_DROP_UNSOLICITED_NA) == (41), "DEVCONF_DROP_UNSOLICITED_NA != 41"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_DROP_UNSOLICITED_NA 41 +#endif +#if defined(DEVCONF_KEEP_ADDR_ON_DOWN) || (defined(HAVE_DECL_DEVCONF_KEEP_ADDR_ON_DOWN) && HAVE_DECL_DEVCONF_KEEP_ADDR_ON_DOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_KEEP_ADDR_ON_DOWN) == (42), "DEVCONF_KEEP_ADDR_ON_DOWN != 42"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_KEEP_ADDR_ON_DOWN 42 +#endif +#if defined(DEVCONF_RTR_SOLICIT_MAX_INTERVAL) || (defined(HAVE_DECL_DEVCONF_RTR_SOLICIT_MAX_INTERVAL) && HAVE_DECL_DEVCONF_RTR_SOLICIT_MAX_INTERVAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_RTR_SOLICIT_MAX_INTERVAL) == (43), "DEVCONF_RTR_SOLICIT_MAX_INTERVAL != 43"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_RTR_SOLICIT_MAX_INTERVAL 43 +#endif +#if defined(DEVCONF_SEG6_ENABLED) || (defined(HAVE_DECL_DEVCONF_SEG6_ENABLED) && HAVE_DECL_DEVCONF_SEG6_ENABLED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_SEG6_ENABLED) == (44), "DEVCONF_SEG6_ENABLED != 44"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_SEG6_ENABLED 44 +#endif +#if defined(DEVCONF_SEG6_REQUIRE_HMAC) || (defined(HAVE_DECL_DEVCONF_SEG6_REQUIRE_HMAC) && HAVE_DECL_DEVCONF_SEG6_REQUIRE_HMAC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_SEG6_REQUIRE_HMAC) == (45), "DEVCONF_SEG6_REQUIRE_HMAC != 45"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_SEG6_REQUIRE_HMAC 45 +#endif +#if defined(DEVCONF_ENHANCED_DAD) || (defined(HAVE_DECL_DEVCONF_ENHANCED_DAD) && HAVE_DECL_DEVCONF_ENHANCED_DAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_ENHANCED_DAD) == (46), "DEVCONF_ENHANCED_DAD != 46"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_ENHANCED_DAD 46 +#endif +#if defined(DEVCONF_ADDR_GEN_MODE) || (defined(HAVE_DECL_DEVCONF_ADDR_GEN_MODE) && HAVE_DECL_DEVCONF_ADDR_GEN_MODE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_ADDR_GEN_MODE) == (47), "DEVCONF_ADDR_GEN_MODE != 47"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_ADDR_GEN_MODE 47 +#endif +#if defined(DEVCONF_DISABLE_POLICY) || (defined(HAVE_DECL_DEVCONF_DISABLE_POLICY) && HAVE_DECL_DEVCONF_DISABLE_POLICY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_DISABLE_POLICY) == (48), "DEVCONF_DISABLE_POLICY != 48"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_DISABLE_POLICY 48 +#endif +#if defined(DEVCONF_ACCEPT_RA_RT_INFO_MIN_PLEN) || (defined(HAVE_DECL_DEVCONF_ACCEPT_RA_RT_INFO_MIN_PLEN) && HAVE_DECL_DEVCONF_ACCEPT_RA_RT_INFO_MIN_PLEN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_ACCEPT_RA_RT_INFO_MIN_PLEN) == (49), "DEVCONF_ACCEPT_RA_RT_INFO_MIN_PLEN != 49"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_ACCEPT_RA_RT_INFO_MIN_PLEN 49 +#endif +#if defined(DEVCONF_NDISC_TCLASS) || (defined(HAVE_DECL_DEVCONF_NDISC_TCLASS) && HAVE_DECL_DEVCONF_NDISC_TCLASS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DEVCONF_NDISC_TCLASS) == (50), "DEVCONF_NDISC_TCLASS != 50"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DEVCONF_NDISC_TCLASS 50 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat inet6_devconf_indices in mpers mode + +# else + +static +const struct xlat inet6_devconf_indices[] = { + [DEVCONF_FORWARDING] = XLAT(DEVCONF_FORWARDING), + [DEVCONF_HOPLIMIT] = XLAT(DEVCONF_HOPLIMIT), + [DEVCONF_MTU6] = XLAT(DEVCONF_MTU6), + [DEVCONF_ACCEPT_RA] = XLAT(DEVCONF_ACCEPT_RA), + [DEVCONF_ACCEPT_REDIRECTS] = XLAT(DEVCONF_ACCEPT_REDIRECTS), + [DEVCONF_AUTOCONF] = XLAT(DEVCONF_AUTOCONF), + [DEVCONF_DAD_TRANSMITS] = XLAT(DEVCONF_DAD_TRANSMITS), + [DEVCONF_RTR_SOLICITS] = XLAT(DEVCONF_RTR_SOLICITS), + [DEVCONF_RTR_SOLICIT_INTERVAL] = XLAT(DEVCONF_RTR_SOLICIT_INTERVAL), + [DEVCONF_RTR_SOLICIT_DELAY] = XLAT(DEVCONF_RTR_SOLICIT_DELAY), + [DEVCONF_USE_TEMPADDR] = XLAT(DEVCONF_USE_TEMPADDR), + [DEVCONF_TEMP_VALID_LFT] = XLAT(DEVCONF_TEMP_VALID_LFT), + [DEVCONF_TEMP_PREFERED_LFT] = XLAT(DEVCONF_TEMP_PREFERED_LFT), + [DEVCONF_REGEN_MAX_RETRY] = XLAT(DEVCONF_REGEN_MAX_RETRY), + [DEVCONF_MAX_DESYNC_FACTOR] = XLAT(DEVCONF_MAX_DESYNC_FACTOR), + [DEVCONF_MAX_ADDRESSES] = XLAT(DEVCONF_MAX_ADDRESSES), + [DEVCONF_FORCE_MLD_VERSION] = XLAT(DEVCONF_FORCE_MLD_VERSION), + [DEVCONF_ACCEPT_RA_DEFRTR] = XLAT(DEVCONF_ACCEPT_RA_DEFRTR), + [DEVCONF_ACCEPT_RA_PINFO] = XLAT(DEVCONF_ACCEPT_RA_PINFO), + [DEVCONF_ACCEPT_RA_RTR_PREF] = XLAT(DEVCONF_ACCEPT_RA_RTR_PREF), + [DEVCONF_RTR_PROBE_INTERVAL] = XLAT(DEVCONF_RTR_PROBE_INTERVAL), + [DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN] = XLAT(DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN), + [DEVCONF_PROXY_NDP] = XLAT(DEVCONF_PROXY_NDP), + [DEVCONF_OPTIMISTIC_DAD] = XLAT(DEVCONF_OPTIMISTIC_DAD), + [DEVCONF_ACCEPT_SOURCE_ROUTE] = XLAT(DEVCONF_ACCEPT_SOURCE_ROUTE), + [DEVCONF_MC_FORWARDING] = XLAT(DEVCONF_MC_FORWARDING), + [DEVCONF_DISABLE_IPV6] = XLAT(DEVCONF_DISABLE_IPV6), + [DEVCONF_ACCEPT_DAD] = XLAT(DEVCONF_ACCEPT_DAD), + [DEVCONF_FORCE_TLLAO] = XLAT(DEVCONF_FORCE_TLLAO), + [DEVCONF_NDISC_NOTIFY] = XLAT(DEVCONF_NDISC_NOTIFY), + [DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL] = XLAT(DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL), + [DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL] = XLAT(DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL), + [DEVCONF_SUPPRESS_FRAG_NDISC] = XLAT(DEVCONF_SUPPRESS_FRAG_NDISC), + [DEVCONF_ACCEPT_RA_FROM_LOCAL] = XLAT(DEVCONF_ACCEPT_RA_FROM_LOCAL), + [DEVCONF_USE_OPTIMISTIC] = XLAT(DEVCONF_USE_OPTIMISTIC), + [DEVCONF_ACCEPT_RA_MTU] = XLAT(DEVCONF_ACCEPT_RA_MTU), + [DEVCONF_STABLE_SECRET] = XLAT(DEVCONF_STABLE_SECRET), + [DEVCONF_USE_OIF_ADDRS_ONLY] = XLAT(DEVCONF_USE_OIF_ADDRS_ONLY), + [DEVCONF_ACCEPT_RA_MIN_HOP_LIMIT] = XLAT(DEVCONF_ACCEPT_RA_MIN_HOP_LIMIT), + [DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN] = XLAT(DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN), + [DEVCONF_DROP_UNICAST_IN_L2_MULTICAST] = XLAT(DEVCONF_DROP_UNICAST_IN_L2_MULTICAST), + [DEVCONF_DROP_UNSOLICITED_NA] = XLAT(DEVCONF_DROP_UNSOLICITED_NA), + [DEVCONF_KEEP_ADDR_ON_DOWN] = XLAT(DEVCONF_KEEP_ADDR_ON_DOWN), + [DEVCONF_RTR_SOLICIT_MAX_INTERVAL] = XLAT(DEVCONF_RTR_SOLICIT_MAX_INTERVAL), + [DEVCONF_SEG6_ENABLED] = XLAT(DEVCONF_SEG6_ENABLED), + [DEVCONF_SEG6_REQUIRE_HMAC] = XLAT(DEVCONF_SEG6_REQUIRE_HMAC), + [DEVCONF_ENHANCED_DAD] = XLAT(DEVCONF_ENHANCED_DAD), + [DEVCONF_ADDR_GEN_MODE] = XLAT(DEVCONF_ADDR_GEN_MODE), + [DEVCONF_DISABLE_POLICY] = XLAT(DEVCONF_DISABLE_POLICY), + [DEVCONF_ACCEPT_RA_RT_INFO_MIN_PLEN] = XLAT(DEVCONF_ACCEPT_RA_RT_INFO_MIN_PLEN), + [DEVCONF_NDISC_TCLASS] = XLAT(DEVCONF_NDISC_TCLASS), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/inet6_devconf_indices.in b/xlat/inet6_devconf_indices.in new file mode 100644 index 00000000..89efe7fb --- /dev/null +++ b/xlat/inet6_devconf_indices.in @@ -0,0 +1,52 @@ +#value_indexed +DEVCONF_FORWARDING 0 +DEVCONF_HOPLIMIT 1 +DEVCONF_MTU6 2 +DEVCONF_ACCEPT_RA 3 +DEVCONF_ACCEPT_REDIRECTS 4 +DEVCONF_AUTOCONF 5 +DEVCONF_DAD_TRANSMITS 6 +DEVCONF_RTR_SOLICITS 7 +DEVCONF_RTR_SOLICIT_INTERVAL 8 +DEVCONF_RTR_SOLICIT_DELAY 9 +DEVCONF_USE_TEMPADDR 10 +DEVCONF_TEMP_VALID_LFT 11 +DEVCONF_TEMP_PREFERED_LFT 12 +DEVCONF_REGEN_MAX_RETRY 13 +DEVCONF_MAX_DESYNC_FACTOR 14 +DEVCONF_MAX_ADDRESSES 15 +DEVCONF_FORCE_MLD_VERSION 16 +DEVCONF_ACCEPT_RA_DEFRTR 17 +DEVCONF_ACCEPT_RA_PINFO 18 +DEVCONF_ACCEPT_RA_RTR_PREF 19 +DEVCONF_RTR_PROBE_INTERVAL 20 +DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN 21 +DEVCONF_PROXY_NDP 22 +DEVCONF_OPTIMISTIC_DAD 23 +DEVCONF_ACCEPT_SOURCE_ROUTE 24 +DEVCONF_MC_FORWARDING 25 +DEVCONF_DISABLE_IPV6 26 +DEVCONF_ACCEPT_DAD 27 +DEVCONF_FORCE_TLLAO 28 +DEVCONF_NDISC_NOTIFY 29 +DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL 30 +DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL 31 +DEVCONF_SUPPRESS_FRAG_NDISC 32 +DEVCONF_ACCEPT_RA_FROM_LOCAL 33 +DEVCONF_USE_OPTIMISTIC 34 +DEVCONF_ACCEPT_RA_MTU 35 +DEVCONF_STABLE_SECRET 36 +DEVCONF_USE_OIF_ADDRS_ONLY 37 +DEVCONF_ACCEPT_RA_MIN_HOP_LIMIT 38 +DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN 39 +DEVCONF_DROP_UNICAST_IN_L2_MULTICAST 40 +DEVCONF_DROP_UNSOLICITED_NA 41 +DEVCONF_KEEP_ADDR_ON_DOWN 42 +DEVCONF_RTR_SOLICIT_MAX_INTERVAL 43 +DEVCONF_SEG6_ENABLED 44 +DEVCONF_SEG6_REQUIRE_HMAC 45 +DEVCONF_ENHANCED_DAD 46 +DEVCONF_ADDR_GEN_MODE 47 +DEVCONF_DISABLE_POLICY 48 +DEVCONF_ACCEPT_RA_RT_INFO_MIN_PLEN 49 +DEVCONF_NDISC_TCLASS 50 diff --git a/xlat/inet6_if_flags.h b/xlat/inet6_if_flags.h new file mode 100644 index 00000000..74ba7d18 --- /dev/null +++ b/xlat/inet6_if_flags.h @@ -0,0 +1,63 @@ +/* Generated by ./xlat/gen.sh from ./xlat/inet6_if_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IF_RS_SENT) || (defined(HAVE_DECL_IF_RS_SENT) && HAVE_DECL_IF_RS_SENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IF_RS_SENT) == (0x10), "IF_RS_SENT != 0x10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IF_RS_SENT 0x10 +#endif +#if defined(IF_RA_RCVD) || (defined(HAVE_DECL_IF_RA_RCVD) && HAVE_DECL_IF_RA_RCVD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IF_RA_RCVD) == (0x20), "IF_RA_RCVD != 0x20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IF_RA_RCVD 0x20 +#endif +#if defined(IF_RA_MANAGED) || (defined(HAVE_DECL_IF_RA_MANAGED) && HAVE_DECL_IF_RA_MANAGED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IF_RA_MANAGED) == (0x40), "IF_RA_MANAGED != 0x40"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IF_RA_MANAGED 0x40 +#endif +#if defined(IF_RA_OTHERCONF) || (defined(HAVE_DECL_IF_RA_OTHERCONF) && HAVE_DECL_IF_RA_OTHERCONF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IF_RA_OTHERCONF) == (0x80), "IF_RA_OTHERCONF != 0x80"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IF_RA_OTHERCONF 0x80 +#endif +#if defined(IF_READY) || (defined(HAVE_DECL_IF_READY) && HAVE_DECL_IF_READY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IF_READY) == (0x80000000), "IF_READY != 0x80000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IF_READY 0x80000000 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat inet6_if_flags in mpers mode + +# else + +static +const struct xlat inet6_if_flags[] = { + + XLAT(IF_RS_SENT), + XLAT(IF_RA_RCVD), + XLAT(IF_RA_MANAGED), + XLAT(IF_RA_OTHERCONF), + XLAT(IF_READY), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/inet6_if_flags.in b/xlat/inet6_if_flags.in new file mode 100644 index 00000000..befd2232 --- /dev/null +++ b/xlat/inet6_if_flags.in @@ -0,0 +1,6 @@ +/* sort -k2,2g */ +IF_RS_SENT 0x10 +IF_RA_RCVD 0x20 +IF_RA_MANAGED 0x40 +IF_RA_OTHERCONF 0x80 +IF_READY 0x80000000 diff --git a/xlat/inet_devconf_indices.h b/xlat/inet_devconf_indices.h new file mode 100644 index 00000000..b1dd3cc8 --- /dev/null +++ b/xlat/inet_devconf_indices.h @@ -0,0 +1,279 @@ +/* Generated by ./xlat/gen.sh from ./xlat/inet_devconf_indices.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IPV4_DEVCONF_FORWARDING) || (defined(HAVE_DECL_IPV4_DEVCONF_FORWARDING) && HAVE_DECL_IPV4_DEVCONF_FORWARDING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_FORWARDING) == (1), "IPV4_DEVCONF_FORWARDING != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_FORWARDING 1 +#endif +#if defined(IPV4_DEVCONF_MC_FORWARDING) || (defined(HAVE_DECL_IPV4_DEVCONF_MC_FORWARDING) && HAVE_DECL_IPV4_DEVCONF_MC_FORWARDING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_MC_FORWARDING) == (2), "IPV4_DEVCONF_MC_FORWARDING != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_MC_FORWARDING 2 +#endif +#if defined(IPV4_DEVCONF_PROXY_ARP) || (defined(HAVE_DECL_IPV4_DEVCONF_PROXY_ARP) && HAVE_DECL_IPV4_DEVCONF_PROXY_ARP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_PROXY_ARP) == (3), "IPV4_DEVCONF_PROXY_ARP != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_PROXY_ARP 3 +#endif +#if defined(IPV4_DEVCONF_ACCEPT_REDIRECTS) || (defined(HAVE_DECL_IPV4_DEVCONF_ACCEPT_REDIRECTS) && HAVE_DECL_IPV4_DEVCONF_ACCEPT_REDIRECTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_ACCEPT_REDIRECTS) == (4), "IPV4_DEVCONF_ACCEPT_REDIRECTS != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_ACCEPT_REDIRECTS 4 +#endif +#if defined(IPV4_DEVCONF_SECURE_REDIRECTS) || (defined(HAVE_DECL_IPV4_DEVCONF_SECURE_REDIRECTS) && HAVE_DECL_IPV4_DEVCONF_SECURE_REDIRECTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_SECURE_REDIRECTS) == (5), "IPV4_DEVCONF_SECURE_REDIRECTS != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_SECURE_REDIRECTS 5 +#endif +#if defined(IPV4_DEVCONF_SEND_REDIRECTS) || (defined(HAVE_DECL_IPV4_DEVCONF_SEND_REDIRECTS) && HAVE_DECL_IPV4_DEVCONF_SEND_REDIRECTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_SEND_REDIRECTS) == (6), "IPV4_DEVCONF_SEND_REDIRECTS != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_SEND_REDIRECTS 6 +#endif +#if defined(IPV4_DEVCONF_SHARED_MEDIA) || (defined(HAVE_DECL_IPV4_DEVCONF_SHARED_MEDIA) && HAVE_DECL_IPV4_DEVCONF_SHARED_MEDIA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_SHARED_MEDIA) == (7), "IPV4_DEVCONF_SHARED_MEDIA != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_SHARED_MEDIA 7 +#endif +#if defined(IPV4_DEVCONF_RP_FILTER) || (defined(HAVE_DECL_IPV4_DEVCONF_RP_FILTER) && HAVE_DECL_IPV4_DEVCONF_RP_FILTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_RP_FILTER) == (8), "IPV4_DEVCONF_RP_FILTER != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_RP_FILTER 8 +#endif +#if defined(IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE) || (defined(HAVE_DECL_IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE) && HAVE_DECL_IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE) == (9), "IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE 9 +#endif +#if defined(IPV4_DEVCONF_BOOTP_RELAY) || (defined(HAVE_DECL_IPV4_DEVCONF_BOOTP_RELAY) && HAVE_DECL_IPV4_DEVCONF_BOOTP_RELAY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_BOOTP_RELAY) == (10), "IPV4_DEVCONF_BOOTP_RELAY != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_BOOTP_RELAY 10 +#endif +#if defined(IPV4_DEVCONF_LOG_MARTIANS) || (defined(HAVE_DECL_IPV4_DEVCONF_LOG_MARTIANS) && HAVE_DECL_IPV4_DEVCONF_LOG_MARTIANS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_LOG_MARTIANS) == (11), "IPV4_DEVCONF_LOG_MARTIANS != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_LOG_MARTIANS 11 +#endif +#if defined(IPV4_DEVCONF_TAG) || (defined(HAVE_DECL_IPV4_DEVCONF_TAG) && HAVE_DECL_IPV4_DEVCONF_TAG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_TAG) == (12), "IPV4_DEVCONF_TAG != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_TAG 12 +#endif +#if defined(IPV4_DEVCONF_ARPFILTER) || (defined(HAVE_DECL_IPV4_DEVCONF_ARPFILTER) && HAVE_DECL_IPV4_DEVCONF_ARPFILTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_ARPFILTER) == (13), "IPV4_DEVCONF_ARPFILTER != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_ARPFILTER 13 +#endif +#if defined(IPV4_DEVCONF_MEDIUM_ID) || (defined(HAVE_DECL_IPV4_DEVCONF_MEDIUM_ID) && HAVE_DECL_IPV4_DEVCONF_MEDIUM_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_MEDIUM_ID) == (14), "IPV4_DEVCONF_MEDIUM_ID != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_MEDIUM_ID 14 +#endif +#if defined(IPV4_DEVCONF_NOXFRM) || (defined(HAVE_DECL_IPV4_DEVCONF_NOXFRM) && HAVE_DECL_IPV4_DEVCONF_NOXFRM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_NOXFRM) == (15), "IPV4_DEVCONF_NOXFRM != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_NOXFRM 15 +#endif +#if defined(IPV4_DEVCONF_NOPOLICY) || (defined(HAVE_DECL_IPV4_DEVCONF_NOPOLICY) && HAVE_DECL_IPV4_DEVCONF_NOPOLICY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_NOPOLICY) == (16), "IPV4_DEVCONF_NOPOLICY != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_NOPOLICY 16 +#endif +#if defined(IPV4_DEVCONF_FORCE_IGMP_VERSION) || (defined(HAVE_DECL_IPV4_DEVCONF_FORCE_IGMP_VERSION) && HAVE_DECL_IPV4_DEVCONF_FORCE_IGMP_VERSION) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_FORCE_IGMP_VERSION) == (17), "IPV4_DEVCONF_FORCE_IGMP_VERSION != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_FORCE_IGMP_VERSION 17 +#endif +#if defined(IPV4_DEVCONF_ARP_ANNOUNCE) || (defined(HAVE_DECL_IPV4_DEVCONF_ARP_ANNOUNCE) && HAVE_DECL_IPV4_DEVCONF_ARP_ANNOUNCE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_ARP_ANNOUNCE) == (18), "IPV4_DEVCONF_ARP_ANNOUNCE != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_ARP_ANNOUNCE 18 +#endif +#if defined(IPV4_DEVCONF_ARP_IGNORE) || (defined(HAVE_DECL_IPV4_DEVCONF_ARP_IGNORE) && HAVE_DECL_IPV4_DEVCONF_ARP_IGNORE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_ARP_IGNORE) == (19), "IPV4_DEVCONF_ARP_IGNORE != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_ARP_IGNORE 19 +#endif +#if defined(IPV4_DEVCONF_PROMOTE_SECONDARIES) || (defined(HAVE_DECL_IPV4_DEVCONF_PROMOTE_SECONDARIES) && HAVE_DECL_IPV4_DEVCONF_PROMOTE_SECONDARIES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_PROMOTE_SECONDARIES) == (20), "IPV4_DEVCONF_PROMOTE_SECONDARIES != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_PROMOTE_SECONDARIES 20 +#endif +#if defined(IPV4_DEVCONF_ARP_ACCEPT) || (defined(HAVE_DECL_IPV4_DEVCONF_ARP_ACCEPT) && HAVE_DECL_IPV4_DEVCONF_ARP_ACCEPT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_ARP_ACCEPT) == (21), "IPV4_DEVCONF_ARP_ACCEPT != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_ARP_ACCEPT 21 +#endif +#if defined(IPV4_DEVCONF_ARP_NOTIFY) || (defined(HAVE_DECL_IPV4_DEVCONF_ARP_NOTIFY) && HAVE_DECL_IPV4_DEVCONF_ARP_NOTIFY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_ARP_NOTIFY) == (22), "IPV4_DEVCONF_ARP_NOTIFY != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_ARP_NOTIFY 22 +#endif +#if defined(IPV4_DEVCONF_ACCEPT_LOCAL) || (defined(HAVE_DECL_IPV4_DEVCONF_ACCEPT_LOCAL) && HAVE_DECL_IPV4_DEVCONF_ACCEPT_LOCAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_ACCEPT_LOCAL) == (23), "IPV4_DEVCONF_ACCEPT_LOCAL != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_ACCEPT_LOCAL 23 +#endif +#if defined(IPV4_DEVCONF_SRC_VMARK) || (defined(HAVE_DECL_IPV4_DEVCONF_SRC_VMARK) && HAVE_DECL_IPV4_DEVCONF_SRC_VMARK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_SRC_VMARK) == (24), "IPV4_DEVCONF_SRC_VMARK != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_SRC_VMARK 24 +#endif +#if defined(IPV4_DEVCONF_PROXY_ARP_PVLAN) || (defined(HAVE_DECL_IPV4_DEVCONF_PROXY_ARP_PVLAN) && HAVE_DECL_IPV4_DEVCONF_PROXY_ARP_PVLAN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_PROXY_ARP_PVLAN) == (25), "IPV4_DEVCONF_PROXY_ARP_PVLAN != 25"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_PROXY_ARP_PVLAN 25 +#endif +#if defined(IPV4_DEVCONF_ROUTE_LOCALNET) || (defined(HAVE_DECL_IPV4_DEVCONF_ROUTE_LOCALNET) && HAVE_DECL_IPV4_DEVCONF_ROUTE_LOCALNET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_ROUTE_LOCALNET) == (26), "IPV4_DEVCONF_ROUTE_LOCALNET != 26"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_ROUTE_LOCALNET 26 +#endif +#if defined(IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL) || (defined(HAVE_DECL_IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL) && HAVE_DECL_IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL) == (27), "IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL != 27"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL 27 +#endif +#if defined(IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL) || (defined(HAVE_DECL_IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL) && HAVE_DECL_IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL) == (28), "IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL != 28"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL 28 +#endif +#if defined(IPV4_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN) || (defined(HAVE_DECL_IPV4_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN) && HAVE_DECL_IPV4_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN) == (29), "IPV4_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN != 29"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN 29 +#endif +#if defined(IPV4_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST) || (defined(HAVE_DECL_IPV4_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST) && HAVE_DECL_IPV4_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST) == (30), "IPV4_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST != 30"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST 30 +#endif +#if defined(IPV4_DEVCONF_DROP_GRATUITOUS_ARP) || (defined(HAVE_DECL_IPV4_DEVCONF_DROP_GRATUITOUS_ARP) && HAVE_DECL_IPV4_DEVCONF_DROP_GRATUITOUS_ARP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_DROP_GRATUITOUS_ARP) == (31), "IPV4_DEVCONF_DROP_GRATUITOUS_ARP != 31"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_DROP_GRATUITOUS_ARP 31 +#endif +#if defined(IPV4_DEVCONF_BC_FORWARDING) || (defined(HAVE_DECL_IPV4_DEVCONF_BC_FORWARDING) && HAVE_DECL_IPV4_DEVCONF_BC_FORWARDING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPV4_DEVCONF_BC_FORWARDING) == (32), "IPV4_DEVCONF_BC_FORWARDING != 32"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPV4_DEVCONF_BC_FORWARDING 32 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat inet_devconf_indices in mpers mode + +# else + +static +const struct xlat inet_devconf_indices[] = { + + [IPV4_DEVCONF_FORWARDING-1] = XLAT(IPV4_DEVCONF_FORWARDING-1), + [IPV4_DEVCONF_MC_FORWARDING-1] = XLAT(IPV4_DEVCONF_MC_FORWARDING-1), + [IPV4_DEVCONF_PROXY_ARP-1] = XLAT(IPV4_DEVCONF_PROXY_ARP-1), + [IPV4_DEVCONF_ACCEPT_REDIRECTS-1] = XLAT(IPV4_DEVCONF_ACCEPT_REDIRECTS-1), + [IPV4_DEVCONF_SECURE_REDIRECTS-1] = XLAT(IPV4_DEVCONF_SECURE_REDIRECTS-1), + [IPV4_DEVCONF_SEND_REDIRECTS-1] = XLAT(IPV4_DEVCONF_SEND_REDIRECTS-1), + [IPV4_DEVCONF_SHARED_MEDIA-1] = XLAT(IPV4_DEVCONF_SHARED_MEDIA-1), + [IPV4_DEVCONF_RP_FILTER-1] = XLAT(IPV4_DEVCONF_RP_FILTER-1), + [IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE-1] = XLAT(IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE-1), + [IPV4_DEVCONF_BOOTP_RELAY-1] = XLAT(IPV4_DEVCONF_BOOTP_RELAY-1), + [IPV4_DEVCONF_LOG_MARTIANS-1] = XLAT(IPV4_DEVCONF_LOG_MARTIANS-1), + [IPV4_DEVCONF_TAG-1] = XLAT(IPV4_DEVCONF_TAG-1), + [IPV4_DEVCONF_ARPFILTER-1] = XLAT(IPV4_DEVCONF_ARPFILTER-1), + [IPV4_DEVCONF_MEDIUM_ID-1] = XLAT(IPV4_DEVCONF_MEDIUM_ID-1), + [IPV4_DEVCONF_NOXFRM-1] = XLAT(IPV4_DEVCONF_NOXFRM-1), + [IPV4_DEVCONF_NOPOLICY-1] = XLAT(IPV4_DEVCONF_NOPOLICY-1), + [IPV4_DEVCONF_FORCE_IGMP_VERSION-1] = XLAT(IPV4_DEVCONF_FORCE_IGMP_VERSION-1), + [IPV4_DEVCONF_ARP_ANNOUNCE-1] = XLAT(IPV4_DEVCONF_ARP_ANNOUNCE-1), + [IPV4_DEVCONF_ARP_IGNORE-1] = XLAT(IPV4_DEVCONF_ARP_IGNORE-1), + [IPV4_DEVCONF_PROMOTE_SECONDARIES-1] = XLAT(IPV4_DEVCONF_PROMOTE_SECONDARIES-1), + [IPV4_DEVCONF_ARP_ACCEPT-1] = XLAT(IPV4_DEVCONF_ARP_ACCEPT-1), + [IPV4_DEVCONF_ARP_NOTIFY-1] = XLAT(IPV4_DEVCONF_ARP_NOTIFY-1), + [IPV4_DEVCONF_ACCEPT_LOCAL-1] = XLAT(IPV4_DEVCONF_ACCEPT_LOCAL-1), + [IPV4_DEVCONF_SRC_VMARK-1] = XLAT(IPV4_DEVCONF_SRC_VMARK-1), + [IPV4_DEVCONF_PROXY_ARP_PVLAN-1] = XLAT(IPV4_DEVCONF_PROXY_ARP_PVLAN-1), + [IPV4_DEVCONF_ROUTE_LOCALNET-1] = XLAT(IPV4_DEVCONF_ROUTE_LOCALNET-1), + [IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL-1] = XLAT(IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL-1), + [IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL-1] = XLAT(IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL-1), + [IPV4_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN-1] = XLAT(IPV4_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN-1), + [IPV4_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST-1] = XLAT(IPV4_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST-1), + [IPV4_DEVCONF_DROP_GRATUITOUS_ARP-1] = XLAT(IPV4_DEVCONF_DROP_GRATUITOUS_ARP-1), + [IPV4_DEVCONF_BC_FORWARDING-1] = XLAT(IPV4_DEVCONF_BC_FORWARDING-1), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/inet_devconf_indices.in b/xlat/inet_devconf_indices.in new file mode 100644 index 00000000..dd262370 --- /dev/null +++ b/xlat/inet_devconf_indices.in @@ -0,0 +1,34 @@ +#value_indexed +/* These fallback definitions are for constants, not for expressions. */ +IPV4_DEVCONF_FORWARDING-1 1 +IPV4_DEVCONF_MC_FORWARDING-1 2 +IPV4_DEVCONF_PROXY_ARP-1 3 +IPV4_DEVCONF_ACCEPT_REDIRECTS-1 4 +IPV4_DEVCONF_SECURE_REDIRECTS-1 5 +IPV4_DEVCONF_SEND_REDIRECTS-1 6 +IPV4_DEVCONF_SHARED_MEDIA-1 7 +IPV4_DEVCONF_RP_FILTER-1 8 +IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE-1 9 +IPV4_DEVCONF_BOOTP_RELAY-1 10 +IPV4_DEVCONF_LOG_MARTIANS-1 11 +IPV4_DEVCONF_TAG-1 12 +IPV4_DEVCONF_ARPFILTER-1 13 +IPV4_DEVCONF_MEDIUM_ID-1 14 +IPV4_DEVCONF_NOXFRM-1 15 +IPV4_DEVCONF_NOPOLICY-1 16 +IPV4_DEVCONF_FORCE_IGMP_VERSION-1 17 +IPV4_DEVCONF_ARP_ANNOUNCE-1 18 +IPV4_DEVCONF_ARP_IGNORE-1 19 +IPV4_DEVCONF_PROMOTE_SECONDARIES-1 20 +IPV4_DEVCONF_ARP_ACCEPT-1 21 +IPV4_DEVCONF_ARP_NOTIFY-1 22 +IPV4_DEVCONF_ACCEPT_LOCAL-1 23 +IPV4_DEVCONF_SRC_VMARK-1 24 +IPV4_DEVCONF_PROXY_ARP_PVLAN-1 25 +IPV4_DEVCONF_ROUTE_LOCALNET-1 26 +IPV4_DEVCONF_IGMPV2_UNSOLICITED_REPORT_INTERVAL-1 27 +IPV4_DEVCONF_IGMPV3_UNSOLICITED_REPORT_INTERVAL-1 28 +IPV4_DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN-1 29 +IPV4_DEVCONF_DROP_UNICAST_IN_L2_MULTICAST-1 30 +IPV4_DEVCONF_DROP_GRATUITOUS_ARP-1 31 +IPV4_DEVCONF_BC_FORWARDING-1 32 diff --git a/xlat/inet_diag_attrs.h b/xlat/inet_diag_attrs.h new file mode 100644 index 00000000..ebfd2ad2 --- /dev/null +++ b/xlat/inet_diag_attrs.h @@ -0,0 +1,40 @@ +/* Generated by ./xlat/gen.sh from ./xlat/inet_diag_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat inet_diag_attrs in mpers mode + +# else + +static +const struct xlat inet_diag_attrs[] = { + XLAT(INET_DIAG_NONE), + XLAT(INET_DIAG_MEMINFO), + XLAT(INET_DIAG_INFO), + XLAT(INET_DIAG_VEGASINFO), + XLAT(INET_DIAG_CONG), + XLAT(INET_DIAG_TOS), + XLAT(INET_DIAG_TCLASS), + XLAT(INET_DIAG_SKMEMINFO), + XLAT(INET_DIAG_SHUTDOWN), + XLAT(INET_DIAG_DCTCPINFO), + XLAT(INET_DIAG_PROTOCOL), + XLAT(INET_DIAG_SKV6ONLY), + XLAT(INET_DIAG_LOCALS), + XLAT(INET_DIAG_PEERS), + XLAT(INET_DIAG_PAD), + XLAT(INET_DIAG_MARK), + XLAT(INET_DIAG_BBRINFO), + XLAT(INET_DIAG_CLASS_ID), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/inet_diag_attrs.in b/xlat/inet_diag_attrs.in new file mode 100644 index 00000000..4536ebc3 --- /dev/null +++ b/xlat/inet_diag_attrs.in @@ -0,0 +1,19 @@ +#unconditional +INET_DIAG_NONE +INET_DIAG_MEMINFO +INET_DIAG_INFO +INET_DIAG_VEGASINFO +INET_DIAG_CONG +INET_DIAG_TOS +INET_DIAG_TCLASS +INET_DIAG_SKMEMINFO +INET_DIAG_SHUTDOWN +INET_DIAG_DCTCPINFO +INET_DIAG_PROTOCOL +INET_DIAG_SKV6ONLY +INET_DIAG_LOCALS +INET_DIAG_PEERS +INET_DIAG_PAD +INET_DIAG_MARK +INET_DIAG_BBRINFO +INET_DIAG_CLASS_ID diff --git a/xlat/inet_diag_bytecodes.h b/xlat/inet_diag_bytecodes.h new file mode 100644 index 00000000..93286db2 --- /dev/null +++ b/xlat/inet_diag_bytecodes.h @@ -0,0 +1,35 @@ +/* Generated by ./xlat/gen.sh from ./xlat/inet_diag_bytecodes.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat inet_diag_bytecodes in mpers mode + +# else + +static +const struct xlat inet_diag_bytecodes[] = { + XLAT(INET_DIAG_BC_NOP), + XLAT(INET_DIAG_BC_JMP), + XLAT(INET_DIAG_BC_S_GE), + XLAT(INET_DIAG_BC_S_LE), + XLAT(INET_DIAG_BC_D_GE), + XLAT(INET_DIAG_BC_D_LE), + XLAT(INET_DIAG_BC_AUTO), + XLAT(INET_DIAG_BC_S_COND), + XLAT(INET_DIAG_BC_D_COND), + XLAT(INET_DIAG_BC_DEV_COND), + XLAT(INET_DIAG_BC_MARK_COND), + XLAT(INET_DIAG_BC_S_EQ), + XLAT(INET_DIAG_BC_D_EQ), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/inet_diag_bytecodes.in b/xlat/inet_diag_bytecodes.in new file mode 100644 index 00000000..ef1059a5 --- /dev/null +++ b/xlat/inet_diag_bytecodes.in @@ -0,0 +1,14 @@ +#unconditional +INET_DIAG_BC_NOP +INET_DIAG_BC_JMP +INET_DIAG_BC_S_GE +INET_DIAG_BC_S_LE +INET_DIAG_BC_D_GE +INET_DIAG_BC_D_LE +INET_DIAG_BC_AUTO +INET_DIAG_BC_S_COND +INET_DIAG_BC_D_COND +INET_DIAG_BC_DEV_COND +INET_DIAG_BC_MARK_COND +INET_DIAG_BC_S_EQ +INET_DIAG_BC_D_EQ diff --git a/xlat/inet_diag_extended_flags.h b/xlat/inet_diag_extended_flags.h new file mode 100644 index 00000000..410b9202 --- /dev/null +++ b/xlat/inet_diag_extended_flags.h @@ -0,0 +1,39 @@ +/* Generated by ./xlat/gen.sh from ./xlat/inet_diag_extended_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat inet_diag_extended_flags in mpers mode + +# else + +static +const struct xlat inet_diag_extended_flags[] = { + XLAT(1<<(INET_DIAG_MEMINFO-1)), + XLAT(1<<(INET_DIAG_INFO-1)), + XLAT(1<<(INET_DIAG_VEGASINFO-1)), + XLAT(1<<(INET_DIAG_CONG-1)), + XLAT(1<<(INET_DIAG_TOS-1)), + XLAT(1<<(INET_DIAG_TCLASS-1)), + XLAT(1<<(INET_DIAG_SKMEMINFO-1)), + XLAT(1<<(INET_DIAG_SHUTDOWN-1)), + XLAT(1<<(INET_DIAG_DCTCPINFO-1)), + XLAT(1<<(INET_DIAG_PROTOCOL-1)), + XLAT(1<<(INET_DIAG_SKV6ONLY-1)), + XLAT(1<<(INET_DIAG_LOCALS-1)), + XLAT(1<<(INET_DIAG_PEERS-1)), + XLAT(1<<(INET_DIAG_PAD-1)), + XLAT(1<<(INET_DIAG_MARK-1)), + XLAT(1<<(INET_DIAG_BBRINFO-1)), + XLAT(1<<(INET_DIAG_CLASS_ID-1)), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/inet_diag_extended_flags.in b/xlat/inet_diag_extended_flags.in new file mode 100644 index 00000000..182cac16 --- /dev/null +++ b/xlat/inet_diag_extended_flags.in @@ -0,0 +1,18 @@ +#unconditional +1<<(INET_DIAG_MEMINFO-1) +1<<(INET_DIAG_INFO-1) +1<<(INET_DIAG_VEGASINFO-1) +1<<(INET_DIAG_CONG-1) +1<<(INET_DIAG_TOS-1) +1<<(INET_DIAG_TCLASS-1) +1<<(INET_DIAG_SKMEMINFO-1) +1<<(INET_DIAG_SHUTDOWN-1) +1<<(INET_DIAG_DCTCPINFO-1) +1<<(INET_DIAG_PROTOCOL-1) +1<<(INET_DIAG_SKV6ONLY-1) +1<<(INET_DIAG_LOCALS-1) +1<<(INET_DIAG_PEERS-1) +1<<(INET_DIAG_PAD-1) +1<<(INET_DIAG_MARK-1) +1<<(INET_DIAG_BBRINFO-1) +1<<(INET_DIAG_CLASS_ID-1) diff --git a/xlat/inet_diag_req_attrs.h b/xlat/inet_diag_req_attrs.h new file mode 100644 index 00000000..be64b3fa --- /dev/null +++ b/xlat/inet_diag_req_attrs.h @@ -0,0 +1,24 @@ +/* Generated by ./xlat/gen.sh from ./xlat/inet_diag_req_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat inet_diag_req_attrs in mpers mode + +# else + +static +const struct xlat inet_diag_req_attrs[] = { + XLAT(INET_DIAG_REQ_NONE), + XLAT(INET_DIAG_REQ_BYTECODE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/inet_diag_req_attrs.in b/xlat/inet_diag_req_attrs.in new file mode 100644 index 00000000..c36369ee --- /dev/null +++ b/xlat/inet_diag_req_attrs.in @@ -0,0 +1,3 @@ +#unconditional +INET_DIAG_REQ_NONE +INET_DIAG_REQ_BYTECODE diff --git a/xlat/inet_protocols.h b/xlat/inet_protocols.h index 73d1133b..81672b81 100644 --- a/xlat/inet_protocols.h +++ b/xlat/inet_protocols.h @@ -1,113 +1,282 @@ /* Generated by ./xlat/gen.sh from ./xlat/inet_protocols.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat inet_protocols in mpers mode - -#else - -static -const struct xlat inet_protocols[] = { #if defined(IPPROTO_IP) || (defined(HAVE_DECL_IPPROTO_IP) && HAVE_DECL_IPPROTO_IP) - XLAT(IPPROTO_IP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_IP) == (0), "IPPROTO_IP != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_IP 0 #endif #if defined(IPPROTO_ICMP) || (defined(HAVE_DECL_IPPROTO_ICMP) && HAVE_DECL_IPPROTO_ICMP) - XLAT(IPPROTO_ICMP), -#endif -#if defined(IPPROTO_TCP) || (defined(HAVE_DECL_IPPROTO_TCP) && HAVE_DECL_IPPROTO_TCP) - XLAT(IPPROTO_TCP), -#endif -#if defined(IPPROTO_UDP) || (defined(HAVE_DECL_IPPROTO_UDP) && HAVE_DECL_IPPROTO_UDP) - XLAT(IPPROTO_UDP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_ICMP) == (1), "IPPROTO_ICMP != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_ICMP 1 #endif #if defined(IPPROTO_IGMP) || (defined(HAVE_DECL_IPPROTO_IGMP) && HAVE_DECL_IPPROTO_IGMP) - XLAT(IPPROTO_IGMP), -#endif -#if defined(IPPROTO_GGP) || (defined(HAVE_DECL_IPPROTO_GGP) && HAVE_DECL_IPPROTO_GGP) - XLAT(IPPROTO_GGP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_IGMP) == (2), "IPPROTO_IGMP != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_IGMP 2 #endif #if defined(IPPROTO_IPIP) || (defined(HAVE_DECL_IPPROTO_IPIP) && HAVE_DECL_IPPROTO_IPIP) - XLAT(IPPROTO_IPIP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_IPIP) == (4), "IPPROTO_IPIP != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_IPIP 4 +#endif +#if defined(IPPROTO_TCP) || (defined(HAVE_DECL_IPPROTO_TCP) && HAVE_DECL_IPPROTO_TCP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_TCP) == (6), "IPPROTO_TCP != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_TCP 6 #endif #if defined(IPPROTO_EGP) || (defined(HAVE_DECL_IPPROTO_EGP) && HAVE_DECL_IPPROTO_EGP) - XLAT(IPPROTO_EGP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_EGP) == (8), "IPPROTO_EGP != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_EGP 8 #endif #if defined(IPPROTO_PUP) || (defined(HAVE_DECL_IPPROTO_PUP) && HAVE_DECL_IPPROTO_PUP) - XLAT(IPPROTO_PUP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_PUP) == (12), "IPPROTO_PUP != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_PUP 12 +#endif +#if defined(IPPROTO_UDP) || (defined(HAVE_DECL_IPPROTO_UDP) && HAVE_DECL_IPPROTO_UDP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_UDP) == (17), "IPPROTO_UDP != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_UDP 17 #endif #if defined(IPPROTO_IDP) || (defined(HAVE_DECL_IPPROTO_IDP) && HAVE_DECL_IPPROTO_IDP) - XLAT(IPPROTO_IDP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_IDP) == (22), "IPPROTO_IDP != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_IDP 22 #endif #if defined(IPPROTO_TP) || (defined(HAVE_DECL_IPPROTO_TP) && HAVE_DECL_IPPROTO_TP) - XLAT(IPPROTO_TP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_TP) == (29), "IPPROTO_TP != 29"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_TP 29 #endif #if defined(IPPROTO_DCCP) || (defined(HAVE_DECL_IPPROTO_DCCP) && HAVE_DECL_IPPROTO_DCCP) - XLAT(IPPROTO_DCCP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_DCCP) == (33), "IPPROTO_DCCP != 33"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_DCCP 33 #endif #if defined(IPPROTO_IPV6) || (defined(HAVE_DECL_IPPROTO_IPV6) && HAVE_DECL_IPPROTO_IPV6) - XLAT(IPPROTO_IPV6), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_IPV6) == (41), "IPPROTO_IPV6 != 41"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_IPV6 41 #endif #if defined(IPPROTO_ROUTING) || (defined(HAVE_DECL_IPPROTO_ROUTING) && HAVE_DECL_IPPROTO_ROUTING) - XLAT(IPPROTO_ROUTING), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_ROUTING) == (43), "IPPROTO_ROUTING != 43"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_ROUTING 43 #endif #if defined(IPPROTO_FRAGMENT) || (defined(HAVE_DECL_IPPROTO_FRAGMENT) && HAVE_DECL_IPPROTO_FRAGMENT) - XLAT(IPPROTO_FRAGMENT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_FRAGMENT) == (44), "IPPROTO_FRAGMENT != 44"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_FRAGMENT 44 #endif #if defined(IPPROTO_RSVP) || (defined(HAVE_DECL_IPPROTO_RSVP) && HAVE_DECL_IPPROTO_RSVP) - XLAT(IPPROTO_RSVP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_RSVP) == (46), "IPPROTO_RSVP != 46"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_RSVP 46 #endif #if defined(IPPROTO_GRE) || (defined(HAVE_DECL_IPPROTO_GRE) && HAVE_DECL_IPPROTO_GRE) - XLAT(IPPROTO_GRE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_GRE) == (47), "IPPROTO_GRE != 47"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_GRE 47 #endif #if defined(IPPROTO_ESP) || (defined(HAVE_DECL_IPPROTO_ESP) && HAVE_DECL_IPPROTO_ESP) - XLAT(IPPROTO_ESP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_ESP) == (50), "IPPROTO_ESP != 50"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_ESP 50 #endif #if defined(IPPROTO_AH) || (defined(HAVE_DECL_IPPROTO_AH) && HAVE_DECL_IPPROTO_AH) - XLAT(IPPROTO_AH), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_AH) == (51), "IPPROTO_AH != 51"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_AH 51 #endif #if defined(IPPROTO_ICMPV6) || (defined(HAVE_DECL_IPPROTO_ICMPV6) && HAVE_DECL_IPPROTO_ICMPV6) - XLAT(IPPROTO_ICMPV6), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_ICMPV6) == (58), "IPPROTO_ICMPV6 != 58"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_ICMPV6 58 #endif #if defined(IPPROTO_NONE) || (defined(HAVE_DECL_IPPROTO_NONE) && HAVE_DECL_IPPROTO_NONE) - XLAT(IPPROTO_NONE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_NONE) == (59), "IPPROTO_NONE != 59"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_NONE 59 #endif #if defined(IPPROTO_DSTOPTS) || (defined(HAVE_DECL_IPPROTO_DSTOPTS) && HAVE_DECL_IPPROTO_DSTOPTS) - XLAT(IPPROTO_DSTOPTS), -#endif -#if defined(IPPROTO_HELLO) || (defined(HAVE_DECL_IPPROTO_HELLO) && HAVE_DECL_IPPROTO_HELLO) - XLAT(IPPROTO_HELLO), -#endif -#if defined(IPPROTO_ND) || (defined(HAVE_DECL_IPPROTO_ND) && HAVE_DECL_IPPROTO_ND) - XLAT(IPPROTO_ND), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_DSTOPTS) == (60), "IPPROTO_DSTOPTS != 60"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_DSTOPTS 60 #endif #if defined(IPPROTO_MTP) || (defined(HAVE_DECL_IPPROTO_MTP) && HAVE_DECL_IPPROTO_MTP) - XLAT(IPPROTO_MTP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_MTP) == (92), "IPPROTO_MTP != 92"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_MTP 92 +#endif +#if defined(IPPROTO_BEETPH) || (defined(HAVE_DECL_IPPROTO_BEETPH) && HAVE_DECL_IPPROTO_BEETPH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_BEETPH) == (94), "IPPROTO_BEETPH != 94"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_BEETPH 94 #endif #if defined(IPPROTO_ENCAP) || (defined(HAVE_DECL_IPPROTO_ENCAP) && HAVE_DECL_IPPROTO_ENCAP) - XLAT(IPPROTO_ENCAP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_ENCAP) == (98), "IPPROTO_ENCAP != 98"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_ENCAP 98 #endif #if defined(IPPROTO_PIM) || (defined(HAVE_DECL_IPPROTO_PIM) && HAVE_DECL_IPPROTO_PIM) - XLAT(IPPROTO_PIM), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_PIM) == (103), "IPPROTO_PIM != 103"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_PIM 103 #endif #if defined(IPPROTO_COMP) || (defined(HAVE_DECL_IPPROTO_COMP) && HAVE_DECL_IPPROTO_COMP) - XLAT(IPPROTO_COMP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_COMP) == (108), "IPPROTO_COMP != 108"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_COMP 108 +#endif +#if defined(IPPROTO_L2TP) || (defined(HAVE_DECL_IPPROTO_L2TP) && HAVE_DECL_IPPROTO_L2TP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_L2TP) == (115), "IPPROTO_L2TP != 115"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_L2TP 115 #endif #if defined(IPPROTO_SCTP) || (defined(HAVE_DECL_IPPROTO_SCTP) && HAVE_DECL_IPPROTO_SCTP) - XLAT(IPPROTO_SCTP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_SCTP) == (132), "IPPROTO_SCTP != 132"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_SCTP 132 +#endif +#if defined(IPPROTO_MH) || (defined(HAVE_DECL_IPPROTO_MH) && HAVE_DECL_IPPROTO_MH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_MH) == (135), "IPPROTO_MH != 135"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_MH 135 #endif #if defined(IPPROTO_UDPLITE) || (defined(HAVE_DECL_IPPROTO_UDPLITE) && HAVE_DECL_IPPROTO_UDPLITE) - XLAT(IPPROTO_UDPLITE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_UDPLITE) == (136), "IPPROTO_UDPLITE != 136"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_UDPLITE 136 #endif #if defined(IPPROTO_MPLS) || (defined(HAVE_DECL_IPPROTO_MPLS) && HAVE_DECL_IPPROTO_MPLS) - XLAT(IPPROTO_MPLS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_MPLS) == (137), "IPPROTO_MPLS != 137"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_MPLS 137 #endif #if defined(IPPROTO_RAW) || (defined(HAVE_DECL_IPPROTO_RAW) && HAVE_DECL_IPPROTO_RAW) - XLAT(IPPROTO_RAW), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_RAW) == (255), "IPPROTO_RAW != 255"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_RAW 255 #endif #if defined(IPPROTO_MAX) || (defined(HAVE_DECL_IPPROTO_MAX) && HAVE_DECL_IPPROTO_MAX) - XLAT(IPPROTO_MAX), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPPROTO_MAX) == (256), "IPPROTO_MAX != 256"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPPROTO_MAX 256 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS + +const struct xlat inet_protocols[] = { + + XLAT(IPPROTO_IP), + XLAT(IPPROTO_ICMP), + XLAT(IPPROTO_IGMP), + XLAT(IPPROTO_IPIP), + XLAT(IPPROTO_TCP), + XLAT(IPPROTO_EGP), + XLAT(IPPROTO_PUP), + XLAT(IPPROTO_UDP), + XLAT(IPPROTO_IDP), + XLAT(IPPROTO_TP), + XLAT(IPPROTO_DCCP), + XLAT(IPPROTO_IPV6), + XLAT(IPPROTO_ROUTING), + XLAT(IPPROTO_FRAGMENT), + XLAT(IPPROTO_RSVP), + XLAT(IPPROTO_GRE), + XLAT(IPPROTO_ESP), + XLAT(IPPROTO_AH), + XLAT(IPPROTO_ICMPV6), + XLAT(IPPROTO_NONE), + XLAT(IPPROTO_DSTOPTS), + XLAT(IPPROTO_MTP), + XLAT(IPPROTO_BEETPH), + XLAT(IPPROTO_ENCAP), + XLAT(IPPROTO_PIM), + XLAT(IPPROTO_COMP), + XLAT(IPPROTO_L2TP), + XLAT(IPPROTO_SCTP), + XLAT(IPPROTO_MH), + XLAT(IPPROTO_UDPLITE), + XLAT(IPPROTO_MPLS), + XLAT(IPPROTO_RAW), + XLAT(IPPROTO_MAX), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/inet_protocols.in b/xlat/inet_protocols.in index b7e13c97..b35b4283 100644 --- a/xlat/inet_protocols.in +++ b/xlat/inet_protocols.in @@ -1,33 +1,34 @@ -IPPROTO_IP -IPPROTO_ICMP -IPPROTO_TCP -IPPROTO_UDP -IPPROTO_IGMP -IPPROTO_GGP -IPPROTO_IPIP -IPPROTO_EGP -IPPROTO_PUP -IPPROTO_IDP -IPPROTO_TP -IPPROTO_DCCP -IPPROTO_IPV6 -IPPROTO_ROUTING -IPPROTO_FRAGMENT -IPPROTO_RSVP -IPPROTO_GRE -IPPROTO_ESP -IPPROTO_AH -IPPROTO_ICMPV6 -IPPROTO_NONE -IPPROTO_DSTOPTS -IPPROTO_HELLO -IPPROTO_ND -IPPROTO_MTP -IPPROTO_ENCAP -IPPROTO_PIM -IPPROTO_COMP -IPPROTO_SCTP -IPPROTO_UDPLITE -IPPROTO_MPLS -IPPROTO_RAW -IPPROTO_MAX +/* sort -k2,2n */ +IPPROTO_IP 0 +IPPROTO_ICMP 1 +IPPROTO_IGMP 2 +IPPROTO_IPIP 4 +IPPROTO_TCP 6 +IPPROTO_EGP 8 +IPPROTO_PUP 12 +IPPROTO_UDP 17 +IPPROTO_IDP 22 +IPPROTO_TP 29 +IPPROTO_DCCP 33 +IPPROTO_IPV6 41 +IPPROTO_ROUTING 43 +IPPROTO_FRAGMENT 44 +IPPROTO_RSVP 46 +IPPROTO_GRE 47 +IPPROTO_ESP 50 +IPPROTO_AH 51 +IPPROTO_ICMPV6 58 +IPPROTO_NONE 59 +IPPROTO_DSTOPTS 60 +IPPROTO_MTP 92 +IPPROTO_BEETPH 94 +IPPROTO_ENCAP 98 +IPPROTO_PIM 103 +IPPROTO_COMP 108 +IPPROTO_L2TP 115 +IPPROTO_SCTP 132 +IPPROTO_MH 135 +IPPROTO_UDPLITE 136 +IPPROTO_MPLS 137 +IPPROTO_RAW 255 +IPPROTO_MAX 256 diff --git a/xlat/inotify_flags.h b/xlat/inotify_flags.h index 5638f5bd..5d233d56 100644 --- a/xlat/inotify_flags.h +++ b/xlat/inotify_flags.h @@ -1,73 +1,170 @@ /* Generated by ./xlat/gen.sh from ./xlat/inotify_flags.in; do not edit. */ -#if !(defined(IN_ACCESS) || (defined(HAVE_DECL_IN_ACCESS) && HAVE_DECL_IN_ACCESS)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IN_ACCESS) || (defined(HAVE_DECL_IN_ACCESS) && HAVE_DECL_IN_ACCESS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_ACCESS) == (0x00000001), "IN_ACCESS != 0x00000001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IN_ACCESS 0x00000001 #endif -#if !(defined(IN_MODIFY) || (defined(HAVE_DECL_IN_MODIFY) && HAVE_DECL_IN_MODIFY)) +#if defined(IN_MODIFY) || (defined(HAVE_DECL_IN_MODIFY) && HAVE_DECL_IN_MODIFY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_MODIFY) == (0x00000002), "IN_MODIFY != 0x00000002"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IN_MODIFY 0x00000002 #endif -#if !(defined(IN_ATTRIB) || (defined(HAVE_DECL_IN_ATTRIB) && HAVE_DECL_IN_ATTRIB)) +#if defined(IN_ATTRIB) || (defined(HAVE_DECL_IN_ATTRIB) && HAVE_DECL_IN_ATTRIB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_ATTRIB) == (0x00000004), "IN_ATTRIB != 0x00000004"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IN_ATTRIB 0x00000004 #endif -#if !(defined(IN_CLOSE_WRITE) || (defined(HAVE_DECL_IN_CLOSE_WRITE) && HAVE_DECL_IN_CLOSE_WRITE)) +#if defined(IN_CLOSE_WRITE) || (defined(HAVE_DECL_IN_CLOSE_WRITE) && HAVE_DECL_IN_CLOSE_WRITE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_CLOSE_WRITE) == (0x00000008), "IN_CLOSE_WRITE != 0x00000008"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IN_CLOSE_WRITE 0x00000008 #endif -#if !(defined(IN_CLOSE_NOWRITE) || (defined(HAVE_DECL_IN_CLOSE_NOWRITE) && HAVE_DECL_IN_CLOSE_NOWRITE)) +#if defined(IN_CLOSE_NOWRITE) || (defined(HAVE_DECL_IN_CLOSE_NOWRITE) && HAVE_DECL_IN_CLOSE_NOWRITE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_CLOSE_NOWRITE) == (0x00000010), "IN_CLOSE_NOWRITE != 0x00000010"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IN_CLOSE_NOWRITE 0x00000010 #endif -#if !(defined(IN_OPEN) || (defined(HAVE_DECL_IN_OPEN) && HAVE_DECL_IN_OPEN)) +#if defined(IN_OPEN) || (defined(HAVE_DECL_IN_OPEN) && HAVE_DECL_IN_OPEN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_OPEN) == (0x00000020), "IN_OPEN != 0x00000020"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IN_OPEN 0x00000020 #endif -#if !(defined(IN_MOVED_FROM) || (defined(HAVE_DECL_IN_MOVED_FROM) && HAVE_DECL_IN_MOVED_FROM)) +#if defined(IN_MOVED_FROM) || (defined(HAVE_DECL_IN_MOVED_FROM) && HAVE_DECL_IN_MOVED_FROM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_MOVED_FROM) == (0x00000040), "IN_MOVED_FROM != 0x00000040"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IN_MOVED_FROM 0x00000040 #endif -#if !(defined(IN_MOVED_TO) || (defined(HAVE_DECL_IN_MOVED_TO) && HAVE_DECL_IN_MOVED_TO)) +#if defined(IN_MOVED_TO) || (defined(HAVE_DECL_IN_MOVED_TO) && HAVE_DECL_IN_MOVED_TO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_MOVED_TO) == (0x00000080), "IN_MOVED_TO != 0x00000080"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IN_MOVED_TO 0x00000080 #endif -#if !(defined(IN_CREATE) || (defined(HAVE_DECL_IN_CREATE) && HAVE_DECL_IN_CREATE)) +#if defined(IN_CREATE) || (defined(HAVE_DECL_IN_CREATE) && HAVE_DECL_IN_CREATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_CREATE) == (0x00000100), "IN_CREATE != 0x00000100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IN_CREATE 0x00000100 #endif -#if !(defined(IN_DELETE) || (defined(HAVE_DECL_IN_DELETE) && HAVE_DECL_IN_DELETE)) +#if defined(IN_DELETE) || (defined(HAVE_DECL_IN_DELETE) && HAVE_DECL_IN_DELETE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_DELETE) == (0x00000200), "IN_DELETE != 0x00000200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IN_DELETE 0x00000200 #endif -#if !(defined(IN_DELETE_SELF) || (defined(HAVE_DECL_IN_DELETE_SELF) && HAVE_DECL_IN_DELETE_SELF)) +#if defined(IN_DELETE_SELF) || (defined(HAVE_DECL_IN_DELETE_SELF) && HAVE_DECL_IN_DELETE_SELF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_DELETE_SELF) == (0x00000400), "IN_DELETE_SELF != 0x00000400"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IN_DELETE_SELF 0x00000400 #endif -#if !(defined(IN_MOVE_SELF) || (defined(HAVE_DECL_IN_MOVE_SELF) && HAVE_DECL_IN_MOVE_SELF)) +#if defined(IN_MOVE_SELF) || (defined(HAVE_DECL_IN_MOVE_SELF) && HAVE_DECL_IN_MOVE_SELF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_MOVE_SELF) == (0x00000800), "IN_MOVE_SELF != 0x00000800"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IN_MOVE_SELF 0x00000800 #endif -#if !(defined(IN_UNMOUNT) || (defined(HAVE_DECL_IN_UNMOUNT) && HAVE_DECL_IN_UNMOUNT)) +#if defined(IN_UNMOUNT) || (defined(HAVE_DECL_IN_UNMOUNT) && HAVE_DECL_IN_UNMOUNT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_UNMOUNT) == (0x00002000), "IN_UNMOUNT != 0x00002000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IN_UNMOUNT 0x00002000 #endif -#if !(defined(IN_Q_OVERFLOW) || (defined(HAVE_DECL_IN_Q_OVERFLOW) && HAVE_DECL_IN_Q_OVERFLOW)) +#if defined(IN_Q_OVERFLOW) || (defined(HAVE_DECL_IN_Q_OVERFLOW) && HAVE_DECL_IN_Q_OVERFLOW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_Q_OVERFLOW) == (0x00004000), "IN_Q_OVERFLOW != 0x00004000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IN_Q_OVERFLOW 0x00004000 #endif -#if !(defined(IN_IGNORED) || (defined(HAVE_DECL_IN_IGNORED) && HAVE_DECL_IN_IGNORED)) +#if defined(IN_IGNORED) || (defined(HAVE_DECL_IN_IGNORED) && HAVE_DECL_IN_IGNORED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_IGNORED) == (0x00008000), "IN_IGNORED != 0x00008000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IN_IGNORED 0x00008000 #endif -#if !(defined(IN_ONLYDIR) || (defined(HAVE_DECL_IN_ONLYDIR) && HAVE_DECL_IN_ONLYDIR)) +#if defined(IN_ONLYDIR) || (defined(HAVE_DECL_IN_ONLYDIR) && HAVE_DECL_IN_ONLYDIR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_ONLYDIR) == (0x01000000), "IN_ONLYDIR != 0x01000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IN_ONLYDIR 0x01000000 #endif -#if !(defined(IN_DONT_FOLLOW) || (defined(HAVE_DECL_IN_DONT_FOLLOW) && HAVE_DECL_IN_DONT_FOLLOW)) +#if defined(IN_DONT_FOLLOW) || (defined(HAVE_DECL_IN_DONT_FOLLOW) && HAVE_DECL_IN_DONT_FOLLOW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_DONT_FOLLOW) == (0x02000000), "IN_DONT_FOLLOW != 0x02000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IN_DONT_FOLLOW 0x02000000 #endif -#if !(defined(IN_EXCL_UNLINK) || (defined(HAVE_DECL_IN_EXCL_UNLINK) && HAVE_DECL_IN_EXCL_UNLINK)) +#if defined(IN_EXCL_UNLINK) || (defined(HAVE_DECL_IN_EXCL_UNLINK) && HAVE_DECL_IN_EXCL_UNLINK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_EXCL_UNLINK) == (0x04000000), "IN_EXCL_UNLINK != 0x04000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IN_EXCL_UNLINK 0x04000000 #endif -#if !(defined(IN_MASK_ADD) || (defined(HAVE_DECL_IN_MASK_ADD) && HAVE_DECL_IN_MASK_ADD)) +#if defined(IN_MASK_CREATE) || (defined(HAVE_DECL_IN_MASK_CREATE) && HAVE_DECL_IN_MASK_CREATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_MASK_CREATE) == (0x10000000), "IN_MASK_CREATE != 0x10000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IN_MASK_CREATE 0x10000000 +#endif +#if defined(IN_MASK_ADD) || (defined(HAVE_DECL_IN_MASK_ADD) && HAVE_DECL_IN_MASK_ADD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_MASK_ADD) == (0x20000000), "IN_MASK_ADD != 0x20000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IN_MASK_ADD 0x20000000 #endif -#if !(defined(IN_ISDIR) || (defined(HAVE_DECL_IN_ISDIR) && HAVE_DECL_IN_ISDIR)) +#if defined(IN_ISDIR) || (defined(HAVE_DECL_IN_ISDIR) && HAVE_DECL_IN_ISDIR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_ISDIR) == (0x40000000), "IN_ISDIR != 0x40000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IN_ISDIR 0x40000000 #endif -#if !(defined(IN_ONESHOT) || (defined(HAVE_DECL_IN_ONESHOT) && HAVE_DECL_IN_ONESHOT)) +#if defined(IN_ONESHOT) || (defined(HAVE_DECL_IN_ONESHOT) && HAVE_DECL_IN_ONESHOT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_ONESHOT) == (0x80000000), "IN_ONESHOT != 0x80000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IN_ONESHOT 0x80000000 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat inotify_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat inotify_flags in mpers mode + +# else static const struct xlat inotify_flags[] = { @@ -89,10 +186,13 @@ const struct xlat inotify_flags[] = { XLAT(IN_ONLYDIR), XLAT(IN_DONT_FOLLOW), XLAT(IN_EXCL_UNLINK), + XLAT(IN_MASK_CREATE), XLAT(IN_MASK_ADD), XLAT(IN_ISDIR), XLAT(IN_ONESHOT), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/inotify_flags.in b/xlat/inotify_flags.in index db1d8393..671bd0e6 100644 --- a/xlat/inotify_flags.in +++ b/xlat/inotify_flags.in @@ -16,6 +16,7 @@ IN_IGNORED 0x00008000 IN_ONLYDIR 0x01000000 IN_DONT_FOLLOW 0x02000000 IN_EXCL_UNLINK 0x04000000 +IN_MASK_CREATE 0x10000000 IN_MASK_ADD 0x20000000 IN_ISDIR 0x40000000 IN_ONESHOT 0x80000000 diff --git a/xlat/inotify_init_flags.h b/xlat/inotify_init_flags.h index f4131472..973a54bd 100644 --- a/xlat/inotify_init_flags.h +++ b/xlat/inotify_init_flags.h @@ -1,18 +1,32 @@ /* Generated by ./xlat/gen.sh from ./xlat/inotify_init_flags.in; do not edit. */ -#if !(defined(IN_NONBLOCK) || (defined(HAVE_DECL_IN_NONBLOCK) && HAVE_DECL_IN_NONBLOCK)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IN_NONBLOCK) || (defined(HAVE_DECL_IN_NONBLOCK) && HAVE_DECL_IN_NONBLOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_NONBLOCK) == (O_NONBLOCK), "IN_NONBLOCK != O_NONBLOCK"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IN_NONBLOCK O_NONBLOCK #endif #if defined IN_CLOEXEC || defined O_CLOEXEC -#if !(defined(IN_CLOEXEC) || (defined(HAVE_DECL_IN_CLOEXEC) && HAVE_DECL_IN_CLOEXEC)) +#if defined(IN_CLOEXEC) || (defined(HAVE_DECL_IN_CLOEXEC) && HAVE_DECL_IN_CLOEXEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IN_CLOEXEC) == (O_CLOEXEC), "IN_CLOEXEC != O_CLOEXEC"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IN_CLOEXEC O_CLOEXEC #endif #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat inotify_init_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat inotify_init_flags in mpers mode + +# else static const struct xlat inotify_init_flags[] = { @@ -23,4 +37,6 @@ const struct xlat inotify_init_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ioctl_dirs.h b/xlat/ioctl_dirs.h index 14bb3e44..b059862f 100644 --- a/xlat/ioctl_dirs.h +++ b/xlat/ioctl_dirs.h @@ -1,23 +1,31 @@ /* Generated by ./xlat/gen.sh from ./xlat/ioctl_dirs.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat ioctl_dirs in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat ioctl_dirs in mpers mode + +# else static const struct xlat ioctl_dirs[] = { +#if defined(_IOC_NONE) || (defined(HAVE_DECL__IOC_NONE) && HAVE_DECL__IOC_NONE) + XLAT(_IOC_NONE), +#endif #if defined(_IOC_READ) || (defined(HAVE_DECL__IOC_READ) && HAVE_DECL__IOC_READ) XLAT(_IOC_READ), #endif #if defined(_IOC_WRITE) || (defined(HAVE_DECL__IOC_WRITE) && HAVE_DECL__IOC_WRITE) XLAT(_IOC_WRITE), -#endif -#if defined(_IOC_NONE) || (defined(HAVE_DECL__IOC_NONE) && HAVE_DECL__IOC_NONE) - XLAT(_IOC_NONE), #endif XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ioctl_dirs.in b/xlat/ioctl_dirs.in index 4c97a869..c069dd73 100644 --- a/xlat/ioctl_dirs.in +++ b/xlat/ioctl_dirs.in @@ -1,3 +1,3 @@ +_IOC_NONE _IOC_READ _IOC_WRITE -_IOC_NONE diff --git a/xlat/ioprio_class.h b/xlat/ioprio_class.h index 3e4f893a..b3967842 100644 --- a/xlat/ioprio_class.h +++ b/xlat/ioprio_class.h @@ -1,10 +1,44 @@ /* Generated by ./xlat/gen.sh from ./xlat/ioprio_class.in; do not edit. */ -#ifdef IN_MPERS - -# error static const struct xlat ioprio_class in mpers mode +#include "gcc_compat.h" +#include "static_assert.h" +#if defined(IOPRIO_CLASS_NONE) || (defined(HAVE_DECL_IOPRIO_CLASS_NONE) && HAVE_DECL_IOPRIO_CLASS_NONE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IOPRIO_CLASS_NONE) == (0), "IOPRIO_CLASS_NONE != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IOPRIO_CLASS_NONE 0 +#endif +#if defined(IOPRIO_CLASS_RT) || (defined(HAVE_DECL_IOPRIO_CLASS_RT) && HAVE_DECL_IOPRIO_CLASS_RT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IOPRIO_CLASS_RT) == (1), "IOPRIO_CLASS_RT != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IOPRIO_CLASS_RT 1 +#endif +#if defined(IOPRIO_CLASS_BE) || (defined(HAVE_DECL_IOPRIO_CLASS_BE) && HAVE_DECL_IOPRIO_CLASS_BE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IOPRIO_CLASS_BE) == (2), "IOPRIO_CLASS_BE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE #else +# define IOPRIO_CLASS_BE 2 +#endif +#if defined(IOPRIO_CLASS_IDLE) || (defined(HAVE_DECL_IOPRIO_CLASS_IDLE) && HAVE_DECL_IOPRIO_CLASS_IDLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IOPRIO_CLASS_IDLE) == (3), "IOPRIO_CLASS_IDLE != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IOPRIO_CLASS_IDLE 3 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat ioprio_class in mpers mode + +# else static const struct xlat ioprio_class[] = { @@ -15,4 +49,6 @@ const struct xlat ioprio_class[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ioprio_class.in b/xlat/ioprio_class.in index 5020e5a1..f7a3ed25 100644 --- a/xlat/ioprio_class.in +++ b/xlat/ioprio_class.in @@ -1,5 +1,4 @@ -#unconditional -IOPRIO_CLASS_NONE -IOPRIO_CLASS_RT -IOPRIO_CLASS_BE -IOPRIO_CLASS_IDLE +IOPRIO_CLASS_NONE 0 +IOPRIO_CLASS_RT 1 +IOPRIO_CLASS_BE 2 +IOPRIO_CLASS_IDLE 3 diff --git a/xlat/ioprio_who.h b/xlat/ioprio_who.h index b7880ca5..9bb27030 100644 --- a/xlat/ioprio_who.h +++ b/xlat/ioprio_who.h @@ -1,10 +1,37 @@ /* Generated by ./xlat/gen.sh from ./xlat/ioprio_who.in; do not edit. */ -#ifdef IN_MPERS - -# error static const struct xlat ioprio_who in mpers mode +#include "gcc_compat.h" +#include "static_assert.h" +#if defined(IOPRIO_WHO_PROCESS) || (defined(HAVE_DECL_IOPRIO_WHO_PROCESS) && HAVE_DECL_IOPRIO_WHO_PROCESS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IOPRIO_WHO_PROCESS) == (1), "IOPRIO_WHO_PROCESS != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IOPRIO_WHO_PROCESS 1 +#endif +#if defined(IOPRIO_WHO_PGRP) || (defined(HAVE_DECL_IOPRIO_WHO_PGRP) && HAVE_DECL_IOPRIO_WHO_PGRP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IOPRIO_WHO_PGRP) == (2), "IOPRIO_WHO_PGRP != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE #else +# define IOPRIO_WHO_PGRP 2 +#endif +#if defined(IOPRIO_WHO_USER) || (defined(HAVE_DECL_IOPRIO_WHO_USER) && HAVE_DECL_IOPRIO_WHO_USER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IOPRIO_WHO_USER) == (3), "IOPRIO_WHO_USER != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IOPRIO_WHO_USER 3 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat ioprio_who in mpers mode + +# else static const struct xlat ioprio_who[] = { @@ -14,4 +41,6 @@ const struct xlat ioprio_who[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ioprio_who.in b/xlat/ioprio_who.in index 20b1bd18..dfb967c2 100644 --- a/xlat/ioprio_who.in +++ b/xlat/ioprio_who.in @@ -1,4 +1,3 @@ -#unconditional -IOPRIO_WHO_PROCESS -IOPRIO_WHO_PGRP -IOPRIO_WHO_USER +IOPRIO_WHO_PROCESS 1 +IOPRIO_WHO_PGRP 2 +IOPRIO_WHO_USER 3 diff --git a/xlat/ip_cmsg_types.h b/xlat/ip_cmsg_types.h index 979d2953..5d714e35 100644 --- a/xlat/ip_cmsg_types.h +++ b/xlat/ip_cmsg_types.h @@ -1,34 +1,72 @@ /* Generated by ./xlat/gen.sh from ./xlat/ip_cmsg_types.in; do not edit. */ -#if !(defined(IP_TOS) || (defined(HAVE_DECL_IP_TOS) && HAVE_DECL_IP_TOS)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IP_TOS) || (defined(HAVE_DECL_IP_TOS) && HAVE_DECL_IP_TOS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IP_TOS) == (1), "IP_TOS != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IP_TOS 1 #endif -#if !(defined(IP_TTL) || (defined(HAVE_DECL_IP_TTL) && HAVE_DECL_IP_TTL)) +#if defined(IP_TTL) || (defined(HAVE_DECL_IP_TTL) && HAVE_DECL_IP_TTL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IP_TTL) == (2), "IP_TTL != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IP_TTL 2 #endif -#if !(defined(IP_RECVOPTS) || (defined(HAVE_DECL_IP_RECVOPTS) && HAVE_DECL_IP_RECVOPTS)) +#if defined(IP_RECVOPTS) || (defined(HAVE_DECL_IP_RECVOPTS) && HAVE_DECL_IP_RECVOPTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IP_RECVOPTS) == (6), "IP_RECVOPTS != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IP_RECVOPTS 6 #endif -#if !(defined(IP_RETOPTS) || (defined(HAVE_DECL_IP_RETOPTS) && HAVE_DECL_IP_RETOPTS)) +#if defined(IP_RETOPTS) || (defined(HAVE_DECL_IP_RETOPTS) && HAVE_DECL_IP_RETOPTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IP_RETOPTS) == (7), "IP_RETOPTS != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IP_RETOPTS 7 #endif -#if !(defined(IP_PKTINFO) || (defined(HAVE_DECL_IP_PKTINFO) && HAVE_DECL_IP_PKTINFO)) +#if defined(IP_PKTINFO) || (defined(HAVE_DECL_IP_PKTINFO) && HAVE_DECL_IP_PKTINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IP_PKTINFO) == (8), "IP_PKTINFO != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IP_PKTINFO 8 #endif -#if !(defined(IP_RECVERR) || (defined(HAVE_DECL_IP_RECVERR) && HAVE_DECL_IP_RECVERR)) +#if defined(IP_RECVERR) || (defined(HAVE_DECL_IP_RECVERR) && HAVE_DECL_IP_RECVERR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IP_RECVERR) == (11), "IP_RECVERR != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IP_RECVERR 11 #endif -#if !(defined(IP_ORIGDSTADDR) || (defined(HAVE_DECL_IP_ORIGDSTADDR) && HAVE_DECL_IP_ORIGDSTADDR)) +#if defined(IP_ORIGDSTADDR) || (defined(HAVE_DECL_IP_ORIGDSTADDR) && HAVE_DECL_IP_ORIGDSTADDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IP_ORIGDSTADDR) == (20), "IP_ORIGDSTADDR != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IP_ORIGDSTADDR 20 #endif -#if !(defined(IP_CHECKSUM) || (defined(HAVE_DECL_IP_CHECKSUM) && HAVE_DECL_IP_CHECKSUM)) +#if defined(IP_CHECKSUM) || (defined(HAVE_DECL_IP_CHECKSUM) && HAVE_DECL_IP_CHECKSUM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IP_CHECKSUM) == (23), "IP_CHECKSUM != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define IP_CHECKSUM 23 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat ip_cmsg_types in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat ip_cmsg_types in mpers mode + +# else static const struct xlat ip_cmsg_types[] = { @@ -46,4 +84,6 @@ const struct xlat ip_cmsg_types[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ip_type_of_services.h b/xlat/ip_type_of_services.h new file mode 100644 index 00000000..78a451ca --- /dev/null +++ b/xlat/ip_type_of_services.h @@ -0,0 +1,29 @@ +/* Generated by ./xlat/gen.sh from ./xlat/ip_type_of_services.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS + +const struct xlat ip_type_of_services[] = { +#if defined(IPTOS_LOWDELAY) || (defined(HAVE_DECL_IPTOS_LOWDELAY) && HAVE_DECL_IPTOS_LOWDELAY) + XLAT(IPTOS_LOWDELAY), +#endif +#if defined(IPTOS_THROUGHPUT) || (defined(HAVE_DECL_IPTOS_THROUGHPUT) && HAVE_DECL_IPTOS_THROUGHPUT) + XLAT(IPTOS_THROUGHPUT), +#endif +#if defined(IPTOS_RELIABILITY) || (defined(HAVE_DECL_IPTOS_RELIABILITY) && HAVE_DECL_IPTOS_RELIABILITY) + XLAT(IPTOS_RELIABILITY), +#endif +#if defined(IPTOS_MINCOST) || (defined(HAVE_DECL_IPTOS_MINCOST) && HAVE_DECL_IPTOS_MINCOST) + XLAT(IPTOS_MINCOST), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ip_type_of_services.in b/xlat/ip_type_of_services.in new file mode 100644 index 00000000..41c526a1 --- /dev/null +++ b/xlat/ip_type_of_services.in @@ -0,0 +1,4 @@ +IPTOS_LOWDELAY +IPTOS_THROUGHPUT +IPTOS_RELIABILITY +IPTOS_MINCOST diff --git a/xlat/ipc_msg_flags.h b/xlat/ipc_msg_flags.h index a37ca879..df3bd1df 100644 --- a/xlat/ipc_msg_flags.h +++ b/xlat/ipc_msg_flags.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/ipc_msg_flags.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat ipc_msg_flags in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat ipc_msg_flags in mpers mode + +# else static const struct xlat ipc_msg_flags[] = { @@ -20,4 +26,6 @@ const struct xlat ipc_msg_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ipc_private.h b/xlat/ipc_private.h new file mode 100644 index 00000000..d6dd0ea0 --- /dev/null +++ b/xlat/ipc_private.h @@ -0,0 +1,25 @@ +/* Generated by ./xlat/gen.sh from ./xlat/ipc_private.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IPC_PRIVATE) || (defined(HAVE_DECL_IPC_PRIVATE) && HAVE_DECL_IPC_PRIVATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPC_PRIVATE) == (0), "IPC_PRIVATE != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPC_PRIVATE 0 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS + +const struct xlat ipc_private[] = { + XLAT(IPC_PRIVATE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ipc_private.in b/xlat/ipc_private.in new file mode 100644 index 00000000..b3b233be --- /dev/null +++ b/xlat/ipc_private.in @@ -0,0 +1 @@ +IPC_PRIVATE 0 diff --git a/xlat/ipccalls.h b/xlat/ipccalls.h index fc988e6a..1079e3eb 100644 --- a/xlat/ipccalls.h +++ b/xlat/ipccalls.h @@ -1,46 +1,100 @@ /* Generated by ./xlat/gen.sh from ./xlat/ipccalls.in; do not edit. */ -#if !(defined(SEMOP) || (defined(HAVE_DECL_SEMOP) && HAVE_DECL_SEMOP)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SEMOP) || (defined(HAVE_DECL_SEMOP) && HAVE_DECL_SEMOP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SEMOP) == (1), "SEMOP != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SEMOP 1 #endif -#if !(defined(SEMGET) || (defined(HAVE_DECL_SEMGET) && HAVE_DECL_SEMGET)) +#if defined(SEMGET) || (defined(HAVE_DECL_SEMGET) && HAVE_DECL_SEMGET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SEMGET) == (2), "SEMGET != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SEMGET 2 #endif -#if !(defined(SEMCTL) || (defined(HAVE_DECL_SEMCTL) && HAVE_DECL_SEMCTL)) +#if defined(SEMCTL) || (defined(HAVE_DECL_SEMCTL) && HAVE_DECL_SEMCTL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SEMCTL) == (3), "SEMCTL != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SEMCTL 3 #endif -#if !(defined(SEMTIMEDOP) || (defined(HAVE_DECL_SEMTIMEDOP) && HAVE_DECL_SEMTIMEDOP)) +#if defined(SEMTIMEDOP) || (defined(HAVE_DECL_SEMTIMEDOP) && HAVE_DECL_SEMTIMEDOP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SEMTIMEDOP) == (4), "SEMTIMEDOP != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SEMTIMEDOP 4 #endif -#if !(defined(MSGSND) || (defined(HAVE_DECL_MSGSND) && HAVE_DECL_MSGSND)) +#if defined(MSGSND) || (defined(HAVE_DECL_MSGSND) && HAVE_DECL_MSGSND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSGSND) == (11), "MSGSND != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MSGSND 11 #endif -#if !(defined(MSGRCV) || (defined(HAVE_DECL_MSGRCV) && HAVE_DECL_MSGRCV)) +#if defined(MSGRCV) || (defined(HAVE_DECL_MSGRCV) && HAVE_DECL_MSGRCV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSGRCV) == (12), "MSGRCV != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MSGRCV 12 #endif -#if !(defined(MSGGET) || (defined(HAVE_DECL_MSGGET) && HAVE_DECL_MSGGET)) +#if defined(MSGGET) || (defined(HAVE_DECL_MSGGET) && HAVE_DECL_MSGGET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSGGET) == (13), "MSGGET != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MSGGET 13 #endif -#if !(defined(MSGCTL) || (defined(HAVE_DECL_MSGCTL) && HAVE_DECL_MSGCTL)) +#if defined(MSGCTL) || (defined(HAVE_DECL_MSGCTL) && HAVE_DECL_MSGCTL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSGCTL) == (14), "MSGCTL != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MSGCTL 14 #endif -#if !(defined(SHMAT) || (defined(HAVE_DECL_SHMAT) && HAVE_DECL_SHMAT)) +#if defined(SHMAT) || (defined(HAVE_DECL_SHMAT) && HAVE_DECL_SHMAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SHMAT) == (21), "SHMAT != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SHMAT 21 #endif -#if !(defined(SHMDT) || (defined(HAVE_DECL_SHMDT) && HAVE_DECL_SHMDT)) +#if defined(SHMDT) || (defined(HAVE_DECL_SHMDT) && HAVE_DECL_SHMDT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SHMDT) == (22), "SHMDT != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SHMDT 22 #endif -#if !(defined(SHMGET) || (defined(HAVE_DECL_SHMGET) && HAVE_DECL_SHMGET)) +#if defined(SHMGET) || (defined(HAVE_DECL_SHMGET) && HAVE_DECL_SHMGET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SHMGET) == (23), "SHMGET != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SHMGET 23 #endif -#if !(defined(SHMCTL) || (defined(HAVE_DECL_SHMCTL) && HAVE_DECL_SHMCTL)) +#if defined(SHMCTL) || (defined(HAVE_DECL_SHMCTL) && HAVE_DECL_SHMCTL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SHMCTL) == (24), "SHMCTL != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SHMCTL 24 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat ipccalls in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat ipccalls in mpers mode + +# else static const struct xlat ipccalls[] = { @@ -59,4 +113,6 @@ const struct xlat ipccalls[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/irda_protocols.h b/xlat/irda_protocols.h new file mode 100644 index 00000000..6c7e9adc --- /dev/null +++ b/xlat/irda_protocols.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/irda_protocols.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IRDAPROTO_UNITDATA) || (defined(HAVE_DECL_IRDAPROTO_UNITDATA) && HAVE_DECL_IRDAPROTO_UNITDATA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IRDAPROTO_UNITDATA) == (0), "IRDAPROTO_UNITDATA != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IRDAPROTO_UNITDATA 0 +#endif +#if defined(IRDAPROTO_ULTRA) || (defined(HAVE_DECL_IRDAPROTO_ULTRA) && HAVE_DECL_IRDAPROTO_ULTRA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IRDAPROTO_ULTRA) == (1), "IRDAPROTO_ULTRA != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IRDAPROTO_ULTRA 1 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat irda_protocols in mpers mode + +# else + +static +const struct xlat irda_protocols[] = { + [IRDAPROTO_UNITDATA] = XLAT(IRDAPROTO_UNITDATA), + [IRDAPROTO_ULTRA] = XLAT(IRDAPROTO_ULTRA), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/irda_protocols.in b/xlat/irda_protocols.in new file mode 100644 index 00000000..e3cd40f6 --- /dev/null +++ b/xlat/irda_protocols.in @@ -0,0 +1,3 @@ +#value_indexed +IRDAPROTO_UNITDATA 0 +IRDAPROTO_ULTRA 1 diff --git a/xlat/isdn_protocols.h b/xlat/isdn_protocols.h new file mode 100644 index 00000000..51ecb7ad --- /dev/null +++ b/xlat/isdn_protocols.h @@ -0,0 +1,132 @@ +/* Generated by ./xlat/gen.sh from ./xlat/isdn_protocols.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(ISDN_P_BASE) || (defined(HAVE_DECL_ISDN_P_BASE) && HAVE_DECL_ISDN_P_BASE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ISDN_P_BASE) == (0), "ISDN_P_BASE != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ISDN_P_BASE 0 +#endif +#if defined(ISDN_P_TE_S0) || (defined(HAVE_DECL_ISDN_P_TE_S0) && HAVE_DECL_ISDN_P_TE_S0) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ISDN_P_TE_S0) == (1), "ISDN_P_TE_S0 != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ISDN_P_TE_S0 1 +#endif +#if defined(ISDN_P_NT_S0) || (defined(HAVE_DECL_ISDN_P_NT_S0) && HAVE_DECL_ISDN_P_NT_S0) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ISDN_P_NT_S0) == (2), "ISDN_P_NT_S0 != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ISDN_P_NT_S0 2 +#endif +#if defined(ISDN_P_TE_E1) || (defined(HAVE_DECL_ISDN_P_TE_E1) && HAVE_DECL_ISDN_P_TE_E1) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ISDN_P_TE_E1) == (3), "ISDN_P_TE_E1 != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ISDN_P_TE_E1 3 +#endif +#if defined(ISDN_P_NT_E1) || (defined(HAVE_DECL_ISDN_P_NT_E1) && HAVE_DECL_ISDN_P_NT_E1) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ISDN_P_NT_E1) == (4), "ISDN_P_NT_E1 != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ISDN_P_NT_E1 4 +#endif +#if defined(ISDN_P_LAPD_TE) || (defined(HAVE_DECL_ISDN_P_LAPD_TE) && HAVE_DECL_ISDN_P_LAPD_TE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ISDN_P_LAPD_TE) == (0x10), "ISDN_P_LAPD_TE != 0x10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ISDN_P_LAPD_TE 0x10 +#endif +#if defined(ISDN_P_LAPD_NT) || (defined(HAVE_DECL_ISDN_P_LAPD_NT) && HAVE_DECL_ISDN_P_LAPD_NT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ISDN_P_LAPD_NT) == (0x11), "ISDN_P_LAPD_NT != 0x11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ISDN_P_LAPD_NT 0x11 +#endif +#if defined(ISDN_P_B_RAW) || (defined(HAVE_DECL_ISDN_P_B_RAW) && HAVE_DECL_ISDN_P_B_RAW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ISDN_P_B_RAW) == (0x21), "ISDN_P_B_RAW != 0x21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ISDN_P_B_RAW 0x21 +#endif +#if defined(ISDN_P_B_HDLC) || (defined(HAVE_DECL_ISDN_P_B_HDLC) && HAVE_DECL_ISDN_P_B_HDLC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ISDN_P_B_HDLC) == (0x22), "ISDN_P_B_HDLC != 0x22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ISDN_P_B_HDLC 0x22 +#endif +#if defined(ISDN_P_B_X75SLP) || (defined(HAVE_DECL_ISDN_P_B_X75SLP) && HAVE_DECL_ISDN_P_B_X75SLP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ISDN_P_B_X75SLP) == (0x23), "ISDN_P_B_X75SLP != 0x23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ISDN_P_B_X75SLP 0x23 +#endif +#if defined(ISDN_P_B_L2DTMF) || (defined(HAVE_DECL_ISDN_P_B_L2DTMF) && HAVE_DECL_ISDN_P_B_L2DTMF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ISDN_P_B_L2DTMF) == (0x24), "ISDN_P_B_L2DTMF != 0x24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ISDN_P_B_L2DTMF 0x24 +#endif +#if defined(ISDN_P_B_L2DSP) || (defined(HAVE_DECL_ISDN_P_B_L2DSP) && HAVE_DECL_ISDN_P_B_L2DSP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ISDN_P_B_L2DSP) == (0x25), "ISDN_P_B_L2DSP != 0x25"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ISDN_P_B_L2DSP 0x25 +#endif +#if defined(ISDN_P_B_L2DSPHDLC) || (defined(HAVE_DECL_ISDN_P_B_L2DSPHDLC) && HAVE_DECL_ISDN_P_B_L2DSPHDLC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ISDN_P_B_L2DSPHDLC) == (0x26), "ISDN_P_B_L2DSPHDLC != 0x26"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ISDN_P_B_L2DSPHDLC 0x26 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat isdn_protocols in mpers mode + +# else + +static +const struct xlat isdn_protocols[] = { + XLAT(ISDN_P_BASE), + XLAT(ISDN_P_TE_S0), + XLAT(ISDN_P_NT_S0), + XLAT(ISDN_P_TE_E1), + XLAT(ISDN_P_NT_E1), + XLAT(ISDN_P_LAPD_TE), + XLAT(ISDN_P_LAPD_NT), + XLAT(ISDN_P_B_RAW), + XLAT(ISDN_P_B_HDLC), + XLAT(ISDN_P_B_X75SLP), + XLAT(ISDN_P_B_L2DTMF), + XLAT(ISDN_P_B_L2DSP), + XLAT(ISDN_P_B_L2DSPHDLC), +/* +* those two are present in include/linux/mISDNif.h but are not handled during +* socket creation. +*/ + + + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/isdn_protocols.in b/xlat/isdn_protocols.in new file mode 100644 index 00000000..a1936077 --- /dev/null +++ b/xlat/isdn_protocols.in @@ -0,0 +1,19 @@ +ISDN_P_BASE 0 +ISDN_P_TE_S0 1 +ISDN_P_NT_S0 2 +ISDN_P_TE_E1 3 +ISDN_P_NT_E1 4 +ISDN_P_LAPD_TE 0x10 +ISDN_P_LAPD_NT 0x11 +ISDN_P_B_RAW 0x21 +ISDN_P_B_HDLC 0x22 +ISDN_P_B_X75SLP 0x23 +ISDN_P_B_L2DTMF 0x24 +ISDN_P_B_L2DSP 0x25 +ISDN_P_B_L2DSPHDLC 0x26 +/* + * those two are present in include/linux/mISDNif.h but are not handled during + * socket creation. + */ +/* ISDN_P_B_T30_FAX 0x27 */ +/* ISDN_P_B_MODEM_ASYNC 0x28 */ diff --git a/xlat/itimer_which.h b/xlat/itimer_which.h index a9180c6a..c82be255 100644 --- a/xlat/itimer_which.h +++ b/xlat/itimer_which.h @@ -1,23 +1,46 @@ /* Generated by ./xlat/gen.sh from ./xlat/itimer_which.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat itimer_which in mpers mode - -#else - -static -const struct xlat itimer_which[] = { #if defined(ITIMER_REAL) || (defined(HAVE_DECL_ITIMER_REAL) && HAVE_DECL_ITIMER_REAL) - XLAT(ITIMER_REAL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ITIMER_REAL) == (0), "ITIMER_REAL != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ITIMER_REAL 0 #endif #if defined(ITIMER_VIRTUAL) || (defined(HAVE_DECL_ITIMER_VIRTUAL) && HAVE_DECL_ITIMER_VIRTUAL) - XLAT(ITIMER_VIRTUAL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ITIMER_VIRTUAL) == (1), "ITIMER_VIRTUAL != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ITIMER_VIRTUAL 1 #endif #if defined(ITIMER_PROF) || (defined(HAVE_DECL_ITIMER_PROF) && HAVE_DECL_ITIMER_PROF) - XLAT(ITIMER_PROF), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ITIMER_PROF) == (2), "ITIMER_PROF != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ITIMER_PROF 2 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat itimer_which in mpers mode + +# else + +static +const struct xlat itimer_which[] = { + [ITIMER_REAL] = XLAT(ITIMER_REAL), + [ITIMER_VIRTUAL] = XLAT(ITIMER_VIRTUAL), + [ITIMER_PROF] = XLAT(ITIMER_PROF), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/itimer_which.in b/xlat/itimer_which.in index 768b20f4..23635a23 100644 --- a/xlat/itimer_which.in +++ b/xlat/itimer_which.in @@ -1,3 +1,4 @@ -ITIMER_REAL -ITIMER_VIRTUAL -ITIMER_PROF +#value_indexed +ITIMER_REAL 0 +ITIMER_VIRTUAL 1 +ITIMER_PROF 2 diff --git a/xlat/kcm_protocols.h b/xlat/kcm_protocols.h new file mode 100644 index 00000000..e386380b --- /dev/null +++ b/xlat/kcm_protocols.h @@ -0,0 +1,30 @@ +/* Generated by ./xlat/gen.sh from ./xlat/kcm_protocols.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(KCMPROTO_CONNECTED) || (defined(HAVE_DECL_KCMPROTO_CONNECTED) && HAVE_DECL_KCMPROTO_CONNECTED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KCMPROTO_CONNECTED) == (0), "KCMPROTO_CONNECTED != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KCMPROTO_CONNECTED 0 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat kcm_protocols in mpers mode + +# else + +static +const struct xlat kcm_protocols[] = { + [KCMPROTO_CONNECTED] = XLAT(KCMPROTO_CONNECTED), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/kcm_protocols.in b/xlat/kcm_protocols.in new file mode 100644 index 00000000..0001455d --- /dev/null +++ b/xlat/kcm_protocols.in @@ -0,0 +1,2 @@ +#value_indexed +KCMPROTO_CONNECTED 0 diff --git a/xlat/kcmp_types.h b/xlat/kcmp_types.h index ba067f04..d666fa21 100644 --- a/xlat/kcmp_types.h +++ b/xlat/kcmp_types.h @@ -1,31 +1,72 @@ /* Generated by ./xlat/gen.sh from ./xlat/kcmp_types.in; do not edit. */ -#if !(defined(KCMP_FILE) || (defined(HAVE_DECL_KCMP_FILE) && HAVE_DECL_KCMP_FILE)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(KCMP_FILE) || (defined(HAVE_DECL_KCMP_FILE) && HAVE_DECL_KCMP_FILE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KCMP_FILE) == (0), "KCMP_FILE != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KCMP_FILE 0 #endif -#if !(defined(KCMP_VM) || (defined(HAVE_DECL_KCMP_VM) && HAVE_DECL_KCMP_VM)) +#if defined(KCMP_VM) || (defined(HAVE_DECL_KCMP_VM) && HAVE_DECL_KCMP_VM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KCMP_VM) == (1), "KCMP_VM != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KCMP_VM 1 #endif -#if !(defined(KCMP_FILES) || (defined(HAVE_DECL_KCMP_FILES) && HAVE_DECL_KCMP_FILES)) +#if defined(KCMP_FILES) || (defined(HAVE_DECL_KCMP_FILES) && HAVE_DECL_KCMP_FILES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KCMP_FILES) == (2), "KCMP_FILES != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KCMP_FILES 2 #endif -#if !(defined(KCMP_FS) || (defined(HAVE_DECL_KCMP_FS) && HAVE_DECL_KCMP_FS)) +#if defined(KCMP_FS) || (defined(HAVE_DECL_KCMP_FS) && HAVE_DECL_KCMP_FS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KCMP_FS) == (3), "KCMP_FS != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KCMP_FS 3 #endif -#if !(defined(KCMP_SIGHAND) || (defined(HAVE_DECL_KCMP_SIGHAND) && HAVE_DECL_KCMP_SIGHAND)) +#if defined(KCMP_SIGHAND) || (defined(HAVE_DECL_KCMP_SIGHAND) && HAVE_DECL_KCMP_SIGHAND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KCMP_SIGHAND) == (4), "KCMP_SIGHAND != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KCMP_SIGHAND 4 #endif -#if !(defined(KCMP_IO) || (defined(HAVE_DECL_KCMP_IO) && HAVE_DECL_KCMP_IO)) +#if defined(KCMP_IO) || (defined(HAVE_DECL_KCMP_IO) && HAVE_DECL_KCMP_IO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KCMP_IO) == (5), "KCMP_IO != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KCMP_IO 5 #endif -#if !(defined(KCMP_SYSVSEM) || (defined(HAVE_DECL_KCMP_SYSVSEM) && HAVE_DECL_KCMP_SYSVSEM)) +#if defined(KCMP_SYSVSEM) || (defined(HAVE_DECL_KCMP_SYSVSEM) && HAVE_DECL_KCMP_SYSVSEM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KCMP_SYSVSEM) == (6), "KCMP_SYSVSEM != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KCMP_SYSVSEM 6 #endif +#if defined(KCMP_EPOLL_TFD) || (defined(HAVE_DECL_KCMP_EPOLL_TFD) && HAVE_DECL_KCMP_EPOLL_TFD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KCMP_EPOLL_TFD) == (7), "KCMP_EPOLL_TFD != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KCMP_EPOLL_TFD 7 +#endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat kcmp_types in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat kcmp_types in mpers mode + +# else static const struct xlat kcmp_types[] = { @@ -36,7 +77,10 @@ const struct xlat kcmp_types[] = { XLAT(KCMP_SIGHAND), XLAT(KCMP_IO), XLAT(KCMP_SYSVSEM), + XLAT(KCMP_EPOLL_TFD), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/kcmp_types.in b/xlat/kcmp_types.in index 4357776c..c37cf22b 100644 --- a/xlat/kcmp_types.in +++ b/xlat/kcmp_types.in @@ -5,3 +5,4 @@ KCMP_FS 3 KCMP_SIGHAND 4 KCMP_IO 5 KCMP_SYSVSEM 6 +KCMP_EPOLL_TFD 7 diff --git a/xlat/kexec_arch_values.h b/xlat/kexec_arch_values.h index 537ba4b6..df40c4b1 100644 --- a/xlat/kexec_arch_values.h +++ b/xlat/kexec_arch_values.h @@ -1,49 +1,107 @@ /* Generated by ./xlat/gen.sh from ./xlat/kexec_arch_values.in; do not edit. */ -#if !(defined(KEXEC_ARCH_DEFAULT) || (defined(HAVE_DECL_KEXEC_ARCH_DEFAULT) && HAVE_DECL_KEXEC_ARCH_DEFAULT)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(KEXEC_ARCH_DEFAULT) || (defined(HAVE_DECL_KEXEC_ARCH_DEFAULT) && HAVE_DECL_KEXEC_ARCH_DEFAULT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEXEC_ARCH_DEFAULT) == (( 0 << 16)), "KEXEC_ARCH_DEFAULT != ( 0 << 16)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEXEC_ARCH_DEFAULT ( 0 << 16) #endif -#if !(defined(KEXEC_ARCH_386) || (defined(HAVE_DECL_KEXEC_ARCH_386) && HAVE_DECL_KEXEC_ARCH_386)) +#if defined(KEXEC_ARCH_386) || (defined(HAVE_DECL_KEXEC_ARCH_386) && HAVE_DECL_KEXEC_ARCH_386) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEXEC_ARCH_386) == (( 3 << 16)), "KEXEC_ARCH_386 != ( 3 << 16)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEXEC_ARCH_386 ( 3 << 16) #endif -#if !(defined(KEXEC_ARCH_68K) || (defined(HAVE_DECL_KEXEC_ARCH_68K) && HAVE_DECL_KEXEC_ARCH_68K)) +#if defined(KEXEC_ARCH_68K) || (defined(HAVE_DECL_KEXEC_ARCH_68K) && HAVE_DECL_KEXEC_ARCH_68K) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEXEC_ARCH_68K) == (( 4 << 16)), "KEXEC_ARCH_68K != ( 4 << 16)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEXEC_ARCH_68K ( 4 << 16) #endif -#if !(defined(KEXEC_ARCH_X86_64) || (defined(HAVE_DECL_KEXEC_ARCH_X86_64) && HAVE_DECL_KEXEC_ARCH_X86_64)) +#if defined(KEXEC_ARCH_X86_64) || (defined(HAVE_DECL_KEXEC_ARCH_X86_64) && HAVE_DECL_KEXEC_ARCH_X86_64) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEXEC_ARCH_X86_64) == ((62 << 16)), "KEXEC_ARCH_X86_64 != (62 << 16)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEXEC_ARCH_X86_64 (62 << 16) #endif -#if !(defined(KEXEC_ARCH_PPC) || (defined(HAVE_DECL_KEXEC_ARCH_PPC) && HAVE_DECL_KEXEC_ARCH_PPC)) +#if defined(KEXEC_ARCH_PPC) || (defined(HAVE_DECL_KEXEC_ARCH_PPC) && HAVE_DECL_KEXEC_ARCH_PPC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEXEC_ARCH_PPC) == ((20 << 16)), "KEXEC_ARCH_PPC != (20 << 16)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEXEC_ARCH_PPC (20 << 16) #endif -#if !(defined(KEXEC_ARCH_PPC64) || (defined(HAVE_DECL_KEXEC_ARCH_PPC64) && HAVE_DECL_KEXEC_ARCH_PPC64)) +#if defined(KEXEC_ARCH_PPC64) || (defined(HAVE_DECL_KEXEC_ARCH_PPC64) && HAVE_DECL_KEXEC_ARCH_PPC64) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEXEC_ARCH_PPC64) == ((21 << 16)), "KEXEC_ARCH_PPC64 != (21 << 16)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEXEC_ARCH_PPC64 (21 << 16) #endif -#if !(defined(KEXEC_ARCH_IA_64) || (defined(HAVE_DECL_KEXEC_ARCH_IA_64) && HAVE_DECL_KEXEC_ARCH_IA_64)) +#if defined(KEXEC_ARCH_IA_64) || (defined(HAVE_DECL_KEXEC_ARCH_IA_64) && HAVE_DECL_KEXEC_ARCH_IA_64) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEXEC_ARCH_IA_64) == ((50 << 16)), "KEXEC_ARCH_IA_64 != (50 << 16)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEXEC_ARCH_IA_64 (50 << 16) #endif -#if !(defined(KEXEC_ARCH_ARM) || (defined(HAVE_DECL_KEXEC_ARCH_ARM) && HAVE_DECL_KEXEC_ARCH_ARM)) +#if defined(KEXEC_ARCH_ARM) || (defined(HAVE_DECL_KEXEC_ARCH_ARM) && HAVE_DECL_KEXEC_ARCH_ARM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEXEC_ARCH_ARM) == ((40 << 16)), "KEXEC_ARCH_ARM != (40 << 16)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEXEC_ARCH_ARM (40 << 16) #endif -#if !(defined(KEXEC_ARCH_S390) || (defined(HAVE_DECL_KEXEC_ARCH_S390) && HAVE_DECL_KEXEC_ARCH_S390)) +#if defined(KEXEC_ARCH_S390) || (defined(HAVE_DECL_KEXEC_ARCH_S390) && HAVE_DECL_KEXEC_ARCH_S390) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEXEC_ARCH_S390) == ((22 << 16)), "KEXEC_ARCH_S390 != (22 << 16)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEXEC_ARCH_S390 (22 << 16) #endif -#if !(defined(KEXEC_ARCH_SH) || (defined(HAVE_DECL_KEXEC_ARCH_SH) && HAVE_DECL_KEXEC_ARCH_SH)) +#if defined(KEXEC_ARCH_SH) || (defined(HAVE_DECL_KEXEC_ARCH_SH) && HAVE_DECL_KEXEC_ARCH_SH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEXEC_ARCH_SH) == ((42 << 16)), "KEXEC_ARCH_SH != (42 << 16)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEXEC_ARCH_SH (42 << 16) #endif -#if !(defined(KEXEC_ARCH_MIPS_LE) || (defined(HAVE_DECL_KEXEC_ARCH_MIPS_LE) && HAVE_DECL_KEXEC_ARCH_MIPS_LE)) +#if defined(KEXEC_ARCH_MIPS_LE) || (defined(HAVE_DECL_KEXEC_ARCH_MIPS_LE) && HAVE_DECL_KEXEC_ARCH_MIPS_LE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEXEC_ARCH_MIPS_LE) == ((10 << 16)), "KEXEC_ARCH_MIPS_LE != (10 << 16)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEXEC_ARCH_MIPS_LE (10 << 16) #endif -#if !(defined(KEXEC_ARCH_MIPS) || (defined(HAVE_DECL_KEXEC_ARCH_MIPS) && HAVE_DECL_KEXEC_ARCH_MIPS)) +#if defined(KEXEC_ARCH_MIPS) || (defined(HAVE_DECL_KEXEC_ARCH_MIPS) && HAVE_DECL_KEXEC_ARCH_MIPS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEXEC_ARCH_MIPS) == (( 8 << 16)), "KEXEC_ARCH_MIPS != ( 8 << 16)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEXEC_ARCH_MIPS ( 8 << 16) #endif -#if !(defined(KEXEC_ARCH_AARCH64) || (defined(HAVE_DECL_KEXEC_ARCH_AARCH64) && HAVE_DECL_KEXEC_ARCH_AARCH64)) +#if defined(KEXEC_ARCH_AARCH64) || (defined(HAVE_DECL_KEXEC_ARCH_AARCH64) && HAVE_DECL_KEXEC_ARCH_AARCH64) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEXEC_ARCH_AARCH64) == ((183 << 16)), "KEXEC_ARCH_AARCH64 != (183 << 16)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEXEC_ARCH_AARCH64 (183 << 16) #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat kexec_arch_values in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat kexec_arch_values in mpers mode + +# else static const struct xlat kexec_arch_values[] = { @@ -63,4 +121,6 @@ const struct xlat kexec_arch_values[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/kexec_file_load_flags.h b/xlat/kexec_file_load_flags.h index 340ca3ff..5c257c82 100644 --- a/xlat/kexec_file_load_flags.h +++ b/xlat/kexec_file_load_flags.h @@ -1,19 +1,37 @@ /* Generated by ./xlat/gen.sh from ./xlat/kexec_file_load_flags.in; do not edit. */ -#if !(defined(KEXEC_FILE_UNLOAD) || (defined(HAVE_DECL_KEXEC_FILE_UNLOAD) && HAVE_DECL_KEXEC_FILE_UNLOAD)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(KEXEC_FILE_UNLOAD) || (defined(HAVE_DECL_KEXEC_FILE_UNLOAD) && HAVE_DECL_KEXEC_FILE_UNLOAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEXEC_FILE_UNLOAD) == (1), "KEXEC_FILE_UNLOAD != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEXEC_FILE_UNLOAD 1 #endif -#if !(defined(KEXEC_FILE_ON_CRASH) || (defined(HAVE_DECL_KEXEC_FILE_ON_CRASH) && HAVE_DECL_KEXEC_FILE_ON_CRASH)) +#if defined(KEXEC_FILE_ON_CRASH) || (defined(HAVE_DECL_KEXEC_FILE_ON_CRASH) && HAVE_DECL_KEXEC_FILE_ON_CRASH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEXEC_FILE_ON_CRASH) == (2), "KEXEC_FILE_ON_CRASH != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEXEC_FILE_ON_CRASH 2 #endif -#if !(defined(KEXEC_FILE_NO_INITRAMFS) || (defined(HAVE_DECL_KEXEC_FILE_NO_INITRAMFS) && HAVE_DECL_KEXEC_FILE_NO_INITRAMFS)) +#if defined(KEXEC_FILE_NO_INITRAMFS) || (defined(HAVE_DECL_KEXEC_FILE_NO_INITRAMFS) && HAVE_DECL_KEXEC_FILE_NO_INITRAMFS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEXEC_FILE_NO_INITRAMFS) == (4), "KEXEC_FILE_NO_INITRAMFS != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEXEC_FILE_NO_INITRAMFS 4 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat kexec_file_load_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat kexec_file_load_flags in mpers mode + +# else static const struct xlat kexec_file_load_flags[] = { @@ -23,4 +41,6 @@ const struct xlat kexec_file_load_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/kexec_load_flags.h b/xlat/kexec_load_flags.h index 00a51c7a..dcee0c11 100644 --- a/xlat/kexec_load_flags.h +++ b/xlat/kexec_load_flags.h @@ -1,16 +1,30 @@ /* Generated by ./xlat/gen.sh from ./xlat/kexec_load_flags.in; do not edit. */ -#if !(defined(KEXEC_ON_CRASH) || (defined(HAVE_DECL_KEXEC_ON_CRASH) && HAVE_DECL_KEXEC_ON_CRASH)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(KEXEC_ON_CRASH) || (defined(HAVE_DECL_KEXEC_ON_CRASH) && HAVE_DECL_KEXEC_ON_CRASH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEXEC_ON_CRASH) == (0x00000001), "KEXEC_ON_CRASH != 0x00000001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEXEC_ON_CRASH 0x00000001 #endif -#if !(defined(KEXEC_PRESERVE_CONTEXT) || (defined(HAVE_DECL_KEXEC_PRESERVE_CONTEXT) && HAVE_DECL_KEXEC_PRESERVE_CONTEXT)) +#if defined(KEXEC_PRESERVE_CONTEXT) || (defined(HAVE_DECL_KEXEC_PRESERVE_CONTEXT) && HAVE_DECL_KEXEC_PRESERVE_CONTEXT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEXEC_PRESERVE_CONTEXT) == (0x00000002), "KEXEC_PRESERVE_CONTEXT != 0x00000002"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEXEC_PRESERVE_CONTEXT 0x00000002 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat kexec_load_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat kexec_load_flags in mpers mode + +# else static const struct xlat kexec_load_flags[] = { @@ -19,4 +33,6 @@ const struct xlat kexec_load_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/key_perms.h b/xlat/key_perms.h index 4488f701..852a9fed 100644 --- a/xlat/key_perms.h +++ b/xlat/key_perms.h @@ -1,94 +1,212 @@ /* Generated by ./xlat/gen.sh from ./xlat/key_perms.in; do not edit. */ -#if !(defined(KEY_POS_VIEW) || (defined(HAVE_DECL_KEY_POS_VIEW) && HAVE_DECL_KEY_POS_VIEW)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(KEY_POS_VIEW) || (defined(HAVE_DECL_KEY_POS_VIEW) && HAVE_DECL_KEY_POS_VIEW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_POS_VIEW) == (0x01000000), "KEY_POS_VIEW != 0x01000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_POS_VIEW 0x01000000 #endif -#if !(defined(KEY_POS_READ) || (defined(HAVE_DECL_KEY_POS_READ) && HAVE_DECL_KEY_POS_READ)) +#if defined(KEY_POS_READ) || (defined(HAVE_DECL_KEY_POS_READ) && HAVE_DECL_KEY_POS_READ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_POS_READ) == (0x02000000), "KEY_POS_READ != 0x02000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_POS_READ 0x02000000 #endif -#if !(defined(KEY_POS_WRITE) || (defined(HAVE_DECL_KEY_POS_WRITE) && HAVE_DECL_KEY_POS_WRITE)) +#if defined(KEY_POS_WRITE) || (defined(HAVE_DECL_KEY_POS_WRITE) && HAVE_DECL_KEY_POS_WRITE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_POS_WRITE) == (0x04000000), "KEY_POS_WRITE != 0x04000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_POS_WRITE 0x04000000 #endif -#if !(defined(KEY_POS_SEARCH) || (defined(HAVE_DECL_KEY_POS_SEARCH) && HAVE_DECL_KEY_POS_SEARCH)) +#if defined(KEY_POS_SEARCH) || (defined(HAVE_DECL_KEY_POS_SEARCH) && HAVE_DECL_KEY_POS_SEARCH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_POS_SEARCH) == (0x08000000), "KEY_POS_SEARCH != 0x08000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_POS_SEARCH 0x08000000 #endif -#if !(defined(KEY_POS_LINK) || (defined(HAVE_DECL_KEY_POS_LINK) && HAVE_DECL_KEY_POS_LINK)) +#if defined(KEY_POS_LINK) || (defined(HAVE_DECL_KEY_POS_LINK) && HAVE_DECL_KEY_POS_LINK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_POS_LINK) == (0x10000000), "KEY_POS_LINK != 0x10000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_POS_LINK 0x10000000 #endif -#if !(defined(KEY_POS_SETATTR) || (defined(HAVE_DECL_KEY_POS_SETATTR) && HAVE_DECL_KEY_POS_SETATTR)) +#if defined(KEY_POS_SETATTR) || (defined(HAVE_DECL_KEY_POS_SETATTR) && HAVE_DECL_KEY_POS_SETATTR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_POS_SETATTR) == (0x20000000), "KEY_POS_SETATTR != 0x20000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_POS_SETATTR 0x20000000 #endif -#if !(defined(KEY_POS_ALL) || (defined(HAVE_DECL_KEY_POS_ALL) && HAVE_DECL_KEY_POS_ALL)) +#if defined(KEY_POS_ALL) || (defined(HAVE_DECL_KEY_POS_ALL) && HAVE_DECL_KEY_POS_ALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_POS_ALL) == (0x3f000000), "KEY_POS_ALL != 0x3f000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_POS_ALL 0x3f000000 #endif -#if !(defined(KEY_USR_VIEW) || (defined(HAVE_DECL_KEY_USR_VIEW) && HAVE_DECL_KEY_USR_VIEW)) +#if defined(KEY_USR_VIEW) || (defined(HAVE_DECL_KEY_USR_VIEW) && HAVE_DECL_KEY_USR_VIEW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_USR_VIEW) == (0x00010000), "KEY_USR_VIEW != 0x00010000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_USR_VIEW 0x00010000 #endif -#if !(defined(KEY_USR_READ) || (defined(HAVE_DECL_KEY_USR_READ) && HAVE_DECL_KEY_USR_READ)) +#if defined(KEY_USR_READ) || (defined(HAVE_DECL_KEY_USR_READ) && HAVE_DECL_KEY_USR_READ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_USR_READ) == (0x00020000), "KEY_USR_READ != 0x00020000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_USR_READ 0x00020000 #endif -#if !(defined(KEY_USR_WRITE) || (defined(HAVE_DECL_KEY_USR_WRITE) && HAVE_DECL_KEY_USR_WRITE)) +#if defined(KEY_USR_WRITE) || (defined(HAVE_DECL_KEY_USR_WRITE) && HAVE_DECL_KEY_USR_WRITE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_USR_WRITE) == (0x00040000), "KEY_USR_WRITE != 0x00040000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_USR_WRITE 0x00040000 #endif -#if !(defined(KEY_USR_SEARCH) || (defined(HAVE_DECL_KEY_USR_SEARCH) && HAVE_DECL_KEY_USR_SEARCH)) +#if defined(KEY_USR_SEARCH) || (defined(HAVE_DECL_KEY_USR_SEARCH) && HAVE_DECL_KEY_USR_SEARCH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_USR_SEARCH) == (0x00080000), "KEY_USR_SEARCH != 0x00080000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_USR_SEARCH 0x00080000 #endif -#if !(defined(KEY_USR_LINK) || (defined(HAVE_DECL_KEY_USR_LINK) && HAVE_DECL_KEY_USR_LINK)) +#if defined(KEY_USR_LINK) || (defined(HAVE_DECL_KEY_USR_LINK) && HAVE_DECL_KEY_USR_LINK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_USR_LINK) == (0x00100000), "KEY_USR_LINK != 0x00100000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_USR_LINK 0x00100000 #endif -#if !(defined(KEY_USR_SETATTR) || (defined(HAVE_DECL_KEY_USR_SETATTR) && HAVE_DECL_KEY_USR_SETATTR)) +#if defined(KEY_USR_SETATTR) || (defined(HAVE_DECL_KEY_USR_SETATTR) && HAVE_DECL_KEY_USR_SETATTR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_USR_SETATTR) == (0x00200000), "KEY_USR_SETATTR != 0x00200000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_USR_SETATTR 0x00200000 #endif -#if !(defined(KEY_USR_ALL) || (defined(HAVE_DECL_KEY_USR_ALL) && HAVE_DECL_KEY_USR_ALL)) +#if defined(KEY_USR_ALL) || (defined(HAVE_DECL_KEY_USR_ALL) && HAVE_DECL_KEY_USR_ALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_USR_ALL) == (0x003f0000), "KEY_USR_ALL != 0x003f0000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_USR_ALL 0x003f0000 #endif -#if !(defined(KEY_GRP_VIEW) || (defined(HAVE_DECL_KEY_GRP_VIEW) && HAVE_DECL_KEY_GRP_VIEW)) +#if defined(KEY_GRP_VIEW) || (defined(HAVE_DECL_KEY_GRP_VIEW) && HAVE_DECL_KEY_GRP_VIEW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_GRP_VIEW) == (0x00000100), "KEY_GRP_VIEW != 0x00000100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_GRP_VIEW 0x00000100 #endif -#if !(defined(KEY_GRP_READ) || (defined(HAVE_DECL_KEY_GRP_READ) && HAVE_DECL_KEY_GRP_READ)) +#if defined(KEY_GRP_READ) || (defined(HAVE_DECL_KEY_GRP_READ) && HAVE_DECL_KEY_GRP_READ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_GRP_READ) == (0x00000200), "KEY_GRP_READ != 0x00000200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_GRP_READ 0x00000200 #endif -#if !(defined(KEY_GRP_WRITE) || (defined(HAVE_DECL_KEY_GRP_WRITE) && HAVE_DECL_KEY_GRP_WRITE)) +#if defined(KEY_GRP_WRITE) || (defined(HAVE_DECL_KEY_GRP_WRITE) && HAVE_DECL_KEY_GRP_WRITE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_GRP_WRITE) == (0x00000400), "KEY_GRP_WRITE != 0x00000400"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_GRP_WRITE 0x00000400 #endif -#if !(defined(KEY_GRP_SEARCH) || (defined(HAVE_DECL_KEY_GRP_SEARCH) && HAVE_DECL_KEY_GRP_SEARCH)) +#if defined(KEY_GRP_SEARCH) || (defined(HAVE_DECL_KEY_GRP_SEARCH) && HAVE_DECL_KEY_GRP_SEARCH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_GRP_SEARCH) == (0x00000800), "KEY_GRP_SEARCH != 0x00000800"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_GRP_SEARCH 0x00000800 #endif -#if !(defined(KEY_GRP_LINK) || (defined(HAVE_DECL_KEY_GRP_LINK) && HAVE_DECL_KEY_GRP_LINK)) +#if defined(KEY_GRP_LINK) || (defined(HAVE_DECL_KEY_GRP_LINK) && HAVE_DECL_KEY_GRP_LINK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_GRP_LINK) == (0x00001000), "KEY_GRP_LINK != 0x00001000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_GRP_LINK 0x00001000 #endif -#if !(defined(KEY_GRP_SETATTR) || (defined(HAVE_DECL_KEY_GRP_SETATTR) && HAVE_DECL_KEY_GRP_SETATTR)) +#if defined(KEY_GRP_SETATTR) || (defined(HAVE_DECL_KEY_GRP_SETATTR) && HAVE_DECL_KEY_GRP_SETATTR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_GRP_SETATTR) == (0x00002000), "KEY_GRP_SETATTR != 0x00002000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_GRP_SETATTR 0x00002000 #endif -#if !(defined(KEY_GRP_ALL) || (defined(HAVE_DECL_KEY_GRP_ALL) && HAVE_DECL_KEY_GRP_ALL)) +#if defined(KEY_GRP_ALL) || (defined(HAVE_DECL_KEY_GRP_ALL) && HAVE_DECL_KEY_GRP_ALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_GRP_ALL) == (0x00003f00), "KEY_GRP_ALL != 0x00003f00"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_GRP_ALL 0x00003f00 #endif -#if !(defined(KEY_OTH_VIEW) || (defined(HAVE_DECL_KEY_OTH_VIEW) && HAVE_DECL_KEY_OTH_VIEW)) +#if defined(KEY_OTH_VIEW) || (defined(HAVE_DECL_KEY_OTH_VIEW) && HAVE_DECL_KEY_OTH_VIEW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_OTH_VIEW) == (0x00000001), "KEY_OTH_VIEW != 0x00000001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_OTH_VIEW 0x00000001 #endif -#if !(defined(KEY_OTH_READ) || (defined(HAVE_DECL_KEY_OTH_READ) && HAVE_DECL_KEY_OTH_READ)) +#if defined(KEY_OTH_READ) || (defined(HAVE_DECL_KEY_OTH_READ) && HAVE_DECL_KEY_OTH_READ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_OTH_READ) == (0x00000002), "KEY_OTH_READ != 0x00000002"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_OTH_READ 0x00000002 #endif -#if !(defined(KEY_OTH_WRITE) || (defined(HAVE_DECL_KEY_OTH_WRITE) && HAVE_DECL_KEY_OTH_WRITE)) +#if defined(KEY_OTH_WRITE) || (defined(HAVE_DECL_KEY_OTH_WRITE) && HAVE_DECL_KEY_OTH_WRITE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_OTH_WRITE) == (0x00000004), "KEY_OTH_WRITE != 0x00000004"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_OTH_WRITE 0x00000004 #endif -#if !(defined(KEY_OTH_SEARCH) || (defined(HAVE_DECL_KEY_OTH_SEARCH) && HAVE_DECL_KEY_OTH_SEARCH)) +#if defined(KEY_OTH_SEARCH) || (defined(HAVE_DECL_KEY_OTH_SEARCH) && HAVE_DECL_KEY_OTH_SEARCH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_OTH_SEARCH) == (0x00000008), "KEY_OTH_SEARCH != 0x00000008"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_OTH_SEARCH 0x00000008 #endif -#if !(defined(KEY_OTH_LINK) || (defined(HAVE_DECL_KEY_OTH_LINK) && HAVE_DECL_KEY_OTH_LINK)) +#if defined(KEY_OTH_LINK) || (defined(HAVE_DECL_KEY_OTH_LINK) && HAVE_DECL_KEY_OTH_LINK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_OTH_LINK) == (0x00000010), "KEY_OTH_LINK != 0x00000010"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_OTH_LINK 0x00000010 #endif -#if !(defined(KEY_OTH_SETATTR) || (defined(HAVE_DECL_KEY_OTH_SETATTR) && HAVE_DECL_KEY_OTH_SETATTR)) +#if defined(KEY_OTH_SETATTR) || (defined(HAVE_DECL_KEY_OTH_SETATTR) && HAVE_DECL_KEY_OTH_SETATTR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_OTH_SETATTR) == (0x00000020), "KEY_OTH_SETATTR != 0x00000020"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_OTH_SETATTR 0x00000020 #endif -#if !(defined(KEY_OTH_ALL) || (defined(HAVE_DECL_KEY_OTH_ALL) && HAVE_DECL_KEY_OTH_ALL)) +#if defined(KEY_OTH_ALL) || (defined(HAVE_DECL_KEY_OTH_ALL) && HAVE_DECL_KEY_OTH_ALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_OTH_ALL) == (0x0000003f), "KEY_OTH_ALL != 0x0000003f"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_OTH_ALL 0x0000003f #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat key_perms in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat key_perms in mpers mode + +# else static const struct xlat key_perms[] = { @@ -123,4 +241,6 @@ const struct xlat key_perms[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/key_reqkeys.h b/xlat/key_reqkeys.h index 920fbe48..52b0823e 100644 --- a/xlat/key_reqkeys.h +++ b/xlat/key_reqkeys.h @@ -1,50 +1,94 @@ /* Generated by ./xlat/gen.sh from ./xlat/key_reqkeys.in; do not edit. */ -#if !(defined(KEY_REQKEY_DEFL_NO_CHANGE) || (defined(HAVE_DECL_KEY_REQKEY_DEFL_NO_CHANGE) && HAVE_DECL_KEY_REQKEY_DEFL_NO_CHANGE)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(KEY_REQKEY_DEFL_NO_CHANGE) || (defined(HAVE_DECL_KEY_REQKEY_DEFL_NO_CHANGE) && HAVE_DECL_KEY_REQKEY_DEFL_NO_CHANGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_REQKEY_DEFL_NO_CHANGE) == (-1), "KEY_REQKEY_DEFL_NO_CHANGE != -1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_REQKEY_DEFL_NO_CHANGE -1 #endif -#if !(defined(KEY_REQKEY_DEFL_DEFAULT) || (defined(HAVE_DECL_KEY_REQKEY_DEFL_DEFAULT) && HAVE_DECL_KEY_REQKEY_DEFL_DEFAULT)) +#if defined(KEY_REQKEY_DEFL_DEFAULT) || (defined(HAVE_DECL_KEY_REQKEY_DEFL_DEFAULT) && HAVE_DECL_KEY_REQKEY_DEFL_DEFAULT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_REQKEY_DEFL_DEFAULT) == (0), "KEY_REQKEY_DEFL_DEFAULT != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_REQKEY_DEFL_DEFAULT 0 #endif -#if !(defined(KEY_REQKEY_DEFL_THREAD_KEYRING) || (defined(HAVE_DECL_KEY_REQKEY_DEFL_THREAD_KEYRING) && HAVE_DECL_KEY_REQKEY_DEFL_THREAD_KEYRING)) +#if defined(KEY_REQKEY_DEFL_THREAD_KEYRING) || (defined(HAVE_DECL_KEY_REQKEY_DEFL_THREAD_KEYRING) && HAVE_DECL_KEY_REQKEY_DEFL_THREAD_KEYRING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_REQKEY_DEFL_THREAD_KEYRING) == (1), "KEY_REQKEY_DEFL_THREAD_KEYRING != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_REQKEY_DEFL_THREAD_KEYRING 1 #endif -#if !(defined(KEY_REQKEY_DEFL_PROCESS_KEYRING) || (defined(HAVE_DECL_KEY_REQKEY_DEFL_PROCESS_KEYRING) && HAVE_DECL_KEY_REQKEY_DEFL_PROCESS_KEYRING)) +#if defined(KEY_REQKEY_DEFL_PROCESS_KEYRING) || (defined(HAVE_DECL_KEY_REQKEY_DEFL_PROCESS_KEYRING) && HAVE_DECL_KEY_REQKEY_DEFL_PROCESS_KEYRING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_REQKEY_DEFL_PROCESS_KEYRING) == (2), "KEY_REQKEY_DEFL_PROCESS_KEYRING != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_REQKEY_DEFL_PROCESS_KEYRING 2 #endif -#if !(defined(KEY_REQKEY_DEFL_SESSION_KEYRING) || (defined(HAVE_DECL_KEY_REQKEY_DEFL_SESSION_KEYRING) && HAVE_DECL_KEY_REQKEY_DEFL_SESSION_KEYRING)) +#if defined(KEY_REQKEY_DEFL_SESSION_KEYRING) || (defined(HAVE_DECL_KEY_REQKEY_DEFL_SESSION_KEYRING) && HAVE_DECL_KEY_REQKEY_DEFL_SESSION_KEYRING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_REQKEY_DEFL_SESSION_KEYRING) == (3), "KEY_REQKEY_DEFL_SESSION_KEYRING != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_REQKEY_DEFL_SESSION_KEYRING 3 #endif -#if !(defined(KEY_REQKEY_DEFL_USER_KEYRING) || (defined(HAVE_DECL_KEY_REQKEY_DEFL_USER_KEYRING) && HAVE_DECL_KEY_REQKEY_DEFL_USER_KEYRING)) +#if defined(KEY_REQKEY_DEFL_USER_KEYRING) || (defined(HAVE_DECL_KEY_REQKEY_DEFL_USER_KEYRING) && HAVE_DECL_KEY_REQKEY_DEFL_USER_KEYRING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_REQKEY_DEFL_USER_KEYRING) == (4), "KEY_REQKEY_DEFL_USER_KEYRING != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_REQKEY_DEFL_USER_KEYRING 4 #endif -#if !(defined(KEY_REQKEY_DEFL_USER_SESSION_KEYRING) || (defined(HAVE_DECL_KEY_REQKEY_DEFL_USER_SESSION_KEYRING) && HAVE_DECL_KEY_REQKEY_DEFL_USER_SESSION_KEYRING)) +#if defined(KEY_REQKEY_DEFL_USER_SESSION_KEYRING) || (defined(HAVE_DECL_KEY_REQKEY_DEFL_USER_SESSION_KEYRING) && HAVE_DECL_KEY_REQKEY_DEFL_USER_SESSION_KEYRING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_REQKEY_DEFL_USER_SESSION_KEYRING) == (5), "KEY_REQKEY_DEFL_USER_SESSION_KEYRING != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_REQKEY_DEFL_USER_SESSION_KEYRING 5 #endif -#if !(defined(KEY_REQKEY_DEFL_GROUP_KEYRING) || (defined(HAVE_DECL_KEY_REQKEY_DEFL_GROUP_KEYRING) && HAVE_DECL_KEY_REQKEY_DEFL_GROUP_KEYRING)) +#if defined(KEY_REQKEY_DEFL_GROUP_KEYRING) || (defined(HAVE_DECL_KEY_REQKEY_DEFL_GROUP_KEYRING) && HAVE_DECL_KEY_REQKEY_DEFL_GROUP_KEYRING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_REQKEY_DEFL_GROUP_KEYRING) == (6), "KEY_REQKEY_DEFL_GROUP_KEYRING != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_REQKEY_DEFL_GROUP_KEYRING 6 #endif -#if !(defined(KEY_REQKEY_DEFL_REQUESTOR_KEYRING) || (defined(HAVE_DECL_KEY_REQKEY_DEFL_REQUESTOR_KEYRING) && HAVE_DECL_KEY_REQKEY_DEFL_REQUESTOR_KEYRING)) +#if defined(KEY_REQKEY_DEFL_REQUESTOR_KEYRING) || (defined(HAVE_DECL_KEY_REQKEY_DEFL_REQUESTOR_KEYRING) && HAVE_DECL_KEY_REQKEY_DEFL_REQUESTOR_KEYRING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_REQKEY_DEFL_REQUESTOR_KEYRING) == (7), "KEY_REQKEY_DEFL_REQUESTOR_KEYRING != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_REQKEY_DEFL_REQUESTOR_KEYRING 7 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat key_reqkeys in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat key_reqkeys in mpers mode + +# else static const struct xlat key_reqkeys[] = { - XLAT(KEY_REQKEY_DEFL_NO_CHANGE), - XLAT(KEY_REQKEY_DEFL_DEFAULT), - XLAT(KEY_REQKEY_DEFL_THREAD_KEYRING), - XLAT(KEY_REQKEY_DEFL_PROCESS_KEYRING), - XLAT(KEY_REQKEY_DEFL_SESSION_KEYRING), - XLAT(KEY_REQKEY_DEFL_USER_KEYRING), - XLAT(KEY_REQKEY_DEFL_USER_SESSION_KEYRING), - XLAT(KEY_REQKEY_DEFL_GROUP_KEYRING), - XLAT(KEY_REQKEY_DEFL_REQUESTOR_KEYRING), + XLAT_TYPE(int, KEY_REQKEY_DEFL_NO_CHANGE), + XLAT_TYPE(int, KEY_REQKEY_DEFL_DEFAULT), + XLAT_TYPE(int, KEY_REQKEY_DEFL_THREAD_KEYRING), + XLAT_TYPE(int, KEY_REQKEY_DEFL_PROCESS_KEYRING), + XLAT_TYPE(int, KEY_REQKEY_DEFL_SESSION_KEYRING), + XLAT_TYPE(int, KEY_REQKEY_DEFL_USER_KEYRING), + XLAT_TYPE(int, KEY_REQKEY_DEFL_USER_SESSION_KEYRING), + XLAT_TYPE(int, KEY_REQKEY_DEFL_GROUP_KEYRING), + XLAT_TYPE(int, KEY_REQKEY_DEFL_REQUESTOR_KEYRING), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/key_reqkeys.in b/xlat/key_reqkeys.in index 747e440b..ca60ca69 100644 --- a/xlat/key_reqkeys.in +++ b/xlat/key_reqkeys.in @@ -1,3 +1,4 @@ +#val_type int KEY_REQKEY_DEFL_NO_CHANGE -1 KEY_REQKEY_DEFL_DEFAULT 0 KEY_REQKEY_DEFL_THREAD_KEYRING 1 diff --git a/xlat/key_spec.h b/xlat/key_spec.h index 888a8f36..98d317da 100644 --- a/xlat/key_spec.h +++ b/xlat/key_spec.h @@ -1,46 +1,86 @@ /* Generated by ./xlat/gen.sh from ./xlat/key_spec.in; do not edit. */ -#if !(defined(KEY_SPEC_THREAD_KEYRING) || (defined(HAVE_DECL_KEY_SPEC_THREAD_KEYRING) && HAVE_DECL_KEY_SPEC_THREAD_KEYRING)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(KEY_SPEC_THREAD_KEYRING) || (defined(HAVE_DECL_KEY_SPEC_THREAD_KEYRING) && HAVE_DECL_KEY_SPEC_THREAD_KEYRING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SPEC_THREAD_KEYRING) == (-1), "KEY_SPEC_THREAD_KEYRING != -1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_SPEC_THREAD_KEYRING -1 #endif -#if !(defined(KEY_SPEC_PROCESS_KEYRING) || (defined(HAVE_DECL_KEY_SPEC_PROCESS_KEYRING) && HAVE_DECL_KEY_SPEC_PROCESS_KEYRING)) +#if defined(KEY_SPEC_PROCESS_KEYRING) || (defined(HAVE_DECL_KEY_SPEC_PROCESS_KEYRING) && HAVE_DECL_KEY_SPEC_PROCESS_KEYRING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SPEC_PROCESS_KEYRING) == (-2), "KEY_SPEC_PROCESS_KEYRING != -2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_SPEC_PROCESS_KEYRING -2 #endif -#if !(defined(KEY_SPEC_SESSION_KEYRING) || (defined(HAVE_DECL_KEY_SPEC_SESSION_KEYRING) && HAVE_DECL_KEY_SPEC_SESSION_KEYRING)) +#if defined(KEY_SPEC_SESSION_KEYRING) || (defined(HAVE_DECL_KEY_SPEC_SESSION_KEYRING) && HAVE_DECL_KEY_SPEC_SESSION_KEYRING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SPEC_SESSION_KEYRING) == (-3), "KEY_SPEC_SESSION_KEYRING != -3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_SPEC_SESSION_KEYRING -3 #endif -#if !(defined(KEY_SPEC_USER_KEYRING) || (defined(HAVE_DECL_KEY_SPEC_USER_KEYRING) && HAVE_DECL_KEY_SPEC_USER_KEYRING)) +#if defined(KEY_SPEC_USER_KEYRING) || (defined(HAVE_DECL_KEY_SPEC_USER_KEYRING) && HAVE_DECL_KEY_SPEC_USER_KEYRING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SPEC_USER_KEYRING) == (-4), "KEY_SPEC_USER_KEYRING != -4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_SPEC_USER_KEYRING -4 #endif -#if !(defined(KEY_SPEC_USER_SESSION_KEYRING) || (defined(HAVE_DECL_KEY_SPEC_USER_SESSION_KEYRING) && HAVE_DECL_KEY_SPEC_USER_SESSION_KEYRING)) +#if defined(KEY_SPEC_USER_SESSION_KEYRING) || (defined(HAVE_DECL_KEY_SPEC_USER_SESSION_KEYRING) && HAVE_DECL_KEY_SPEC_USER_SESSION_KEYRING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SPEC_USER_SESSION_KEYRING) == (-5), "KEY_SPEC_USER_SESSION_KEYRING != -5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_SPEC_USER_SESSION_KEYRING -5 #endif -#if !(defined(KEY_SPEC_GROUP_KEYRING) || (defined(HAVE_DECL_KEY_SPEC_GROUP_KEYRING) && HAVE_DECL_KEY_SPEC_GROUP_KEYRING)) +#if defined(KEY_SPEC_GROUP_KEYRING) || (defined(HAVE_DECL_KEY_SPEC_GROUP_KEYRING) && HAVE_DECL_KEY_SPEC_GROUP_KEYRING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SPEC_GROUP_KEYRING) == (-6), "KEY_SPEC_GROUP_KEYRING != -6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_SPEC_GROUP_KEYRING -6 #endif -#if !(defined(KEY_SPEC_REQKEY_AUTH_KEY) || (defined(HAVE_DECL_KEY_SPEC_REQKEY_AUTH_KEY) && HAVE_DECL_KEY_SPEC_REQKEY_AUTH_KEY)) +#if defined(KEY_SPEC_REQKEY_AUTH_KEY) || (defined(HAVE_DECL_KEY_SPEC_REQKEY_AUTH_KEY) && HAVE_DECL_KEY_SPEC_REQKEY_AUTH_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SPEC_REQKEY_AUTH_KEY) == (-7), "KEY_SPEC_REQKEY_AUTH_KEY != -7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_SPEC_REQKEY_AUTH_KEY -7 #endif -#if !(defined(KEY_SPEC_REQUESTOR_KEYRING) || (defined(HAVE_DECL_KEY_SPEC_REQUESTOR_KEYRING) && HAVE_DECL_KEY_SPEC_REQUESTOR_KEYRING)) +#if defined(KEY_SPEC_REQUESTOR_KEYRING) || (defined(HAVE_DECL_KEY_SPEC_REQUESTOR_KEYRING) && HAVE_DECL_KEY_SPEC_REQUESTOR_KEYRING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEY_SPEC_REQUESTOR_KEYRING) == (-8), "KEY_SPEC_REQUESTOR_KEYRING != -8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEY_SPEC_REQUESTOR_KEYRING -8 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat key_spec in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat key_spec in mpers mode + +# else static const struct xlat key_spec[] = { - XLAT(KEY_SPEC_THREAD_KEYRING), - XLAT(KEY_SPEC_PROCESS_KEYRING), - XLAT(KEY_SPEC_SESSION_KEYRING), - XLAT(KEY_SPEC_USER_KEYRING), - XLAT(KEY_SPEC_USER_SESSION_KEYRING), - XLAT(KEY_SPEC_GROUP_KEYRING), - XLAT(KEY_SPEC_REQKEY_AUTH_KEY), - XLAT(KEY_SPEC_REQUESTOR_KEYRING), + XLAT_TYPE(int, KEY_SPEC_THREAD_KEYRING), + XLAT_TYPE(int, KEY_SPEC_PROCESS_KEYRING), + XLAT_TYPE(int, KEY_SPEC_SESSION_KEYRING), + XLAT_TYPE(int, KEY_SPEC_USER_KEYRING), + XLAT_TYPE(int, KEY_SPEC_USER_SESSION_KEYRING), + XLAT_TYPE(int, KEY_SPEC_GROUP_KEYRING), + XLAT_TYPE(int, KEY_SPEC_REQKEY_AUTH_KEY), + XLAT_TYPE(int, KEY_SPEC_REQUESTOR_KEYRING), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/key_spec.in b/xlat/key_spec.in index 3e879544..02d9ee04 100644 --- a/xlat/key_spec.in +++ b/xlat/key_spec.in @@ -1,3 +1,4 @@ +#val_type int KEY_SPEC_THREAD_KEYRING -1 KEY_SPEC_PROCESS_KEYRING -2 KEY_SPEC_SESSION_KEYRING -3 diff --git a/xlat/keyctl_commands.h b/xlat/keyctl_commands.h index 14a1e098..27662719 100644 --- a/xlat/keyctl_commands.h +++ b/xlat/keyctl_commands.h @@ -1,82 +1,191 @@ /* Generated by ./xlat/gen.sh from ./xlat/keyctl_commands.in; do not edit. */ -#if !(defined(KEYCTL_GET_KEYRING_ID) || (defined(HAVE_DECL_KEYCTL_GET_KEYRING_ID) && HAVE_DECL_KEYCTL_GET_KEYRING_ID)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(KEYCTL_GET_KEYRING_ID) || (defined(HAVE_DECL_KEYCTL_GET_KEYRING_ID) && HAVE_DECL_KEYCTL_GET_KEYRING_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_GET_KEYRING_ID) == (0), "KEYCTL_GET_KEYRING_ID != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_GET_KEYRING_ID 0 #endif -#if !(defined(KEYCTL_JOIN_SESSION_KEYRING) || (defined(HAVE_DECL_KEYCTL_JOIN_SESSION_KEYRING) && HAVE_DECL_KEYCTL_JOIN_SESSION_KEYRING)) +#if defined(KEYCTL_JOIN_SESSION_KEYRING) || (defined(HAVE_DECL_KEYCTL_JOIN_SESSION_KEYRING) && HAVE_DECL_KEYCTL_JOIN_SESSION_KEYRING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_JOIN_SESSION_KEYRING) == (1), "KEYCTL_JOIN_SESSION_KEYRING != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_JOIN_SESSION_KEYRING 1 #endif -#if !(defined(KEYCTL_UPDATE) || (defined(HAVE_DECL_KEYCTL_UPDATE) && HAVE_DECL_KEYCTL_UPDATE)) +#if defined(KEYCTL_UPDATE) || (defined(HAVE_DECL_KEYCTL_UPDATE) && HAVE_DECL_KEYCTL_UPDATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_UPDATE) == (2), "KEYCTL_UPDATE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_UPDATE 2 #endif -#if !(defined(KEYCTL_REVOKE) || (defined(HAVE_DECL_KEYCTL_REVOKE) && HAVE_DECL_KEYCTL_REVOKE)) +#if defined(KEYCTL_REVOKE) || (defined(HAVE_DECL_KEYCTL_REVOKE) && HAVE_DECL_KEYCTL_REVOKE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_REVOKE) == (3), "KEYCTL_REVOKE != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_REVOKE 3 #endif -#if !(defined(KEYCTL_CHOWN) || (defined(HAVE_DECL_KEYCTL_CHOWN) && HAVE_DECL_KEYCTL_CHOWN)) +#if defined(KEYCTL_CHOWN) || (defined(HAVE_DECL_KEYCTL_CHOWN) && HAVE_DECL_KEYCTL_CHOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_CHOWN) == (4), "KEYCTL_CHOWN != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_CHOWN 4 #endif -#if !(defined(KEYCTL_SETPERM) || (defined(HAVE_DECL_KEYCTL_SETPERM) && HAVE_DECL_KEYCTL_SETPERM)) +#if defined(KEYCTL_SETPERM) || (defined(HAVE_DECL_KEYCTL_SETPERM) && HAVE_DECL_KEYCTL_SETPERM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_SETPERM) == (5), "KEYCTL_SETPERM != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_SETPERM 5 #endif -#if !(defined(KEYCTL_DESCRIBE) || (defined(HAVE_DECL_KEYCTL_DESCRIBE) && HAVE_DECL_KEYCTL_DESCRIBE)) +#if defined(KEYCTL_DESCRIBE) || (defined(HAVE_DECL_KEYCTL_DESCRIBE) && HAVE_DECL_KEYCTL_DESCRIBE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_DESCRIBE) == (6), "KEYCTL_DESCRIBE != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_DESCRIBE 6 #endif -#if !(defined(KEYCTL_CLEAR) || (defined(HAVE_DECL_KEYCTL_CLEAR) && HAVE_DECL_KEYCTL_CLEAR)) +#if defined(KEYCTL_CLEAR) || (defined(HAVE_DECL_KEYCTL_CLEAR) && HAVE_DECL_KEYCTL_CLEAR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_CLEAR) == (7), "KEYCTL_CLEAR != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_CLEAR 7 #endif -#if !(defined(KEYCTL_LINK) || (defined(HAVE_DECL_KEYCTL_LINK) && HAVE_DECL_KEYCTL_LINK)) +#if defined(KEYCTL_LINK) || (defined(HAVE_DECL_KEYCTL_LINK) && HAVE_DECL_KEYCTL_LINK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_LINK) == (8), "KEYCTL_LINK != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_LINK 8 #endif -#if !(defined(KEYCTL_UNLINK) || (defined(HAVE_DECL_KEYCTL_UNLINK) && HAVE_DECL_KEYCTL_UNLINK)) +#if defined(KEYCTL_UNLINK) || (defined(HAVE_DECL_KEYCTL_UNLINK) && HAVE_DECL_KEYCTL_UNLINK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_UNLINK) == (9), "KEYCTL_UNLINK != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_UNLINK 9 #endif -#if !(defined(KEYCTL_SEARCH) || (defined(HAVE_DECL_KEYCTL_SEARCH) && HAVE_DECL_KEYCTL_SEARCH)) +#if defined(KEYCTL_SEARCH) || (defined(HAVE_DECL_KEYCTL_SEARCH) && HAVE_DECL_KEYCTL_SEARCH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_SEARCH) == (10), "KEYCTL_SEARCH != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_SEARCH 10 #endif -#if !(defined(KEYCTL_READ) || (defined(HAVE_DECL_KEYCTL_READ) && HAVE_DECL_KEYCTL_READ)) +#if defined(KEYCTL_READ) || (defined(HAVE_DECL_KEYCTL_READ) && HAVE_DECL_KEYCTL_READ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_READ) == (11), "KEYCTL_READ != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_READ 11 #endif -#if !(defined(KEYCTL_INSTANTIATE) || (defined(HAVE_DECL_KEYCTL_INSTANTIATE) && HAVE_DECL_KEYCTL_INSTANTIATE)) +#if defined(KEYCTL_INSTANTIATE) || (defined(HAVE_DECL_KEYCTL_INSTANTIATE) && HAVE_DECL_KEYCTL_INSTANTIATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_INSTANTIATE) == (12), "KEYCTL_INSTANTIATE != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_INSTANTIATE 12 #endif -#if !(defined(KEYCTL_NEGATE) || (defined(HAVE_DECL_KEYCTL_NEGATE) && HAVE_DECL_KEYCTL_NEGATE)) +#if defined(KEYCTL_NEGATE) || (defined(HAVE_DECL_KEYCTL_NEGATE) && HAVE_DECL_KEYCTL_NEGATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_NEGATE) == (13), "KEYCTL_NEGATE != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_NEGATE 13 #endif -#if !(defined(KEYCTL_SET_REQKEY_KEYRING) || (defined(HAVE_DECL_KEYCTL_SET_REQKEY_KEYRING) && HAVE_DECL_KEYCTL_SET_REQKEY_KEYRING)) +#if defined(KEYCTL_SET_REQKEY_KEYRING) || (defined(HAVE_DECL_KEYCTL_SET_REQKEY_KEYRING) && HAVE_DECL_KEYCTL_SET_REQKEY_KEYRING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_SET_REQKEY_KEYRING) == (14), "KEYCTL_SET_REQKEY_KEYRING != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_SET_REQKEY_KEYRING 14 #endif -#if !(defined(KEYCTL_SET_TIMEOUT) || (defined(HAVE_DECL_KEYCTL_SET_TIMEOUT) && HAVE_DECL_KEYCTL_SET_TIMEOUT)) +#if defined(KEYCTL_SET_TIMEOUT) || (defined(HAVE_DECL_KEYCTL_SET_TIMEOUT) && HAVE_DECL_KEYCTL_SET_TIMEOUT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_SET_TIMEOUT) == (15), "KEYCTL_SET_TIMEOUT != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_SET_TIMEOUT 15 #endif -#if !(defined(KEYCTL_ASSUME_AUTHORITY) || (defined(HAVE_DECL_KEYCTL_ASSUME_AUTHORITY) && HAVE_DECL_KEYCTL_ASSUME_AUTHORITY)) +#if defined(KEYCTL_ASSUME_AUTHORITY) || (defined(HAVE_DECL_KEYCTL_ASSUME_AUTHORITY) && HAVE_DECL_KEYCTL_ASSUME_AUTHORITY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_ASSUME_AUTHORITY) == (16), "KEYCTL_ASSUME_AUTHORITY != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_ASSUME_AUTHORITY 16 #endif -#if !(defined(KEYCTL_GET_SECURITY) || (defined(HAVE_DECL_KEYCTL_GET_SECURITY) && HAVE_DECL_KEYCTL_GET_SECURITY)) +#if defined(KEYCTL_GET_SECURITY) || (defined(HAVE_DECL_KEYCTL_GET_SECURITY) && HAVE_DECL_KEYCTL_GET_SECURITY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_GET_SECURITY) == (17), "KEYCTL_GET_SECURITY != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_GET_SECURITY 17 #endif -#if !(defined(KEYCTL_SESSION_TO_PARENT) || (defined(HAVE_DECL_KEYCTL_SESSION_TO_PARENT) && HAVE_DECL_KEYCTL_SESSION_TO_PARENT)) +#if defined(KEYCTL_SESSION_TO_PARENT) || (defined(HAVE_DECL_KEYCTL_SESSION_TO_PARENT) && HAVE_DECL_KEYCTL_SESSION_TO_PARENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_SESSION_TO_PARENT) == (18), "KEYCTL_SESSION_TO_PARENT != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_SESSION_TO_PARENT 18 #endif -#if !(defined(KEYCTL_REJECT) || (defined(HAVE_DECL_KEYCTL_REJECT) && HAVE_DECL_KEYCTL_REJECT)) +#if defined(KEYCTL_REJECT) || (defined(HAVE_DECL_KEYCTL_REJECT) && HAVE_DECL_KEYCTL_REJECT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_REJECT) == (19), "KEYCTL_REJECT != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_REJECT 19 #endif -#if !(defined(KEYCTL_INSTANTIATE_IOV) || (defined(HAVE_DECL_KEYCTL_INSTANTIATE_IOV) && HAVE_DECL_KEYCTL_INSTANTIATE_IOV)) +#if defined(KEYCTL_INSTANTIATE_IOV) || (defined(HAVE_DECL_KEYCTL_INSTANTIATE_IOV) && HAVE_DECL_KEYCTL_INSTANTIATE_IOV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_INSTANTIATE_IOV) == (20), "KEYCTL_INSTANTIATE_IOV != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_INSTANTIATE_IOV 20 #endif -#if !(defined(KEYCTL_INVALIDATE) || (defined(HAVE_DECL_KEYCTL_INVALIDATE) && HAVE_DECL_KEYCTL_INVALIDATE)) +#if defined(KEYCTL_INVALIDATE) || (defined(HAVE_DECL_KEYCTL_INVALIDATE) && HAVE_DECL_KEYCTL_INVALIDATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_INVALIDATE) == (21), "KEYCTL_INVALIDATE != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_INVALIDATE 21 #endif -#if !(defined(KEYCTL_GET_PERSISTENT) || (defined(HAVE_DECL_KEYCTL_GET_PERSISTENT) && HAVE_DECL_KEYCTL_GET_PERSISTENT)) +#if defined(KEYCTL_GET_PERSISTENT) || (defined(HAVE_DECL_KEYCTL_GET_PERSISTENT) && HAVE_DECL_KEYCTL_GET_PERSISTENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_GET_PERSISTENT) == (22), "KEYCTL_GET_PERSISTENT != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_GET_PERSISTENT 22 #endif -#if !(defined(KEYCTL_DH_COMPUTE) || (defined(HAVE_DECL_KEYCTL_DH_COMPUTE) && HAVE_DECL_KEYCTL_DH_COMPUTE)) +#if defined(KEYCTL_DH_COMPUTE) || (defined(HAVE_DECL_KEYCTL_DH_COMPUTE) && HAVE_DECL_KEYCTL_DH_COMPUTE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_DH_COMPUTE) == (23), "KEYCTL_DH_COMPUTE != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define KEYCTL_DH_COMPUTE 23 #endif +#if defined(KEYCTL_RESTRICT_KEYRING) || (defined(HAVE_DECL_KEYCTL_RESTRICT_KEYRING) && HAVE_DECL_KEYCTL_RESTRICT_KEYRING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KEYCTL_RESTRICT_KEYRING) == (29), "KEYCTL_RESTRICT_KEYRING != 29"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KEYCTL_RESTRICT_KEYRING 29 +#endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat keyctl_commands in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat keyctl_commands in mpers mode + +# else static const struct xlat keyctl_commands[] = { @@ -104,7 +213,10 @@ const struct xlat keyctl_commands[] = { XLAT(KEYCTL_INVALIDATE), XLAT(KEYCTL_GET_PERSISTENT), XLAT(KEYCTL_DH_COMPUTE), + XLAT(KEYCTL_RESTRICT_KEYRING), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/keyctl_commands.in b/xlat/keyctl_commands.in index a30d139b..5e1f4472 100644 --- a/xlat/keyctl_commands.in +++ b/xlat/keyctl_commands.in @@ -22,3 +22,4 @@ KEYCTL_INSTANTIATE_IOV 20 KEYCTL_INVALIDATE 21 KEYCTL_GET_PERSISTENT 22 KEYCTL_DH_COMPUTE 23 +KEYCTL_RESTRICT_KEYRING 29 diff --git a/xlat/kvm_cap.h b/xlat/kvm_cap.h new file mode 100644 index 00000000..5f40a275 --- /dev/null +++ b/xlat/kvm_cap.h @@ -0,0 +1,1318 @@ +/* Generated by ./xlat/gen.sh from ./xlat/kvm_cap.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(KVM_CAP_IRQCHIP) || (defined(HAVE_DECL_KVM_CAP_IRQCHIP) && HAVE_DECL_KVM_CAP_IRQCHIP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_IRQCHIP) == (0), "KVM_CAP_IRQCHIP != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_IRQCHIP 0 +#endif +#if defined(KVM_CAP_HLT) || (defined(HAVE_DECL_KVM_CAP_HLT) && HAVE_DECL_KVM_CAP_HLT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_HLT) == (1), "KVM_CAP_HLT != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_HLT 1 +#endif +#if defined(KVM_CAP_MMU_SHADOW_CACHE_CONTROL) || (defined(HAVE_DECL_KVM_CAP_MMU_SHADOW_CACHE_CONTROL) && HAVE_DECL_KVM_CAP_MMU_SHADOW_CACHE_CONTROL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_MMU_SHADOW_CACHE_CONTROL) == (2), "KVM_CAP_MMU_SHADOW_CACHE_CONTROL != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_MMU_SHADOW_CACHE_CONTROL 2 +#endif +#if defined(KVM_CAP_USER_MEMORY) || (defined(HAVE_DECL_KVM_CAP_USER_MEMORY) && HAVE_DECL_KVM_CAP_USER_MEMORY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_USER_MEMORY) == (3), "KVM_CAP_USER_MEMORY != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_USER_MEMORY 3 +#endif +#if defined(KVM_CAP_SET_TSS_ADDR) || (defined(HAVE_DECL_KVM_CAP_SET_TSS_ADDR) && HAVE_DECL_KVM_CAP_SET_TSS_ADDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_SET_TSS_ADDR) == (4), "KVM_CAP_SET_TSS_ADDR != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_SET_TSS_ADDR 4 +#endif +#if defined(KVM_CAP_VAPIC) || (defined(HAVE_DECL_KVM_CAP_VAPIC) && HAVE_DECL_KVM_CAP_VAPIC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_VAPIC) == (6), "KVM_CAP_VAPIC != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_VAPIC 6 +#endif +#if defined(KVM_CAP_EXT_CPUID) || (defined(HAVE_DECL_KVM_CAP_EXT_CPUID) && HAVE_DECL_KVM_CAP_EXT_CPUID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_EXT_CPUID) == (7), "KVM_CAP_EXT_CPUID != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_EXT_CPUID 7 +#endif +#if defined(KVM_CAP_CLOCKSOURCE) || (defined(HAVE_DECL_KVM_CAP_CLOCKSOURCE) && HAVE_DECL_KVM_CAP_CLOCKSOURCE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_CLOCKSOURCE) == (8), "KVM_CAP_CLOCKSOURCE != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_CLOCKSOURCE 8 +#endif +#if defined(KVM_CAP_NR_VCPUS) || (defined(HAVE_DECL_KVM_CAP_NR_VCPUS) && HAVE_DECL_KVM_CAP_NR_VCPUS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_NR_VCPUS) == (9), "KVM_CAP_NR_VCPUS != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_NR_VCPUS 9 +#endif +#if defined(KVM_CAP_NR_MEMSLOTS) || (defined(HAVE_DECL_KVM_CAP_NR_MEMSLOTS) && HAVE_DECL_KVM_CAP_NR_MEMSLOTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_NR_MEMSLOTS) == (10), "KVM_CAP_NR_MEMSLOTS != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_NR_MEMSLOTS 10 +#endif +#if defined(KVM_CAP_PIT) || (defined(HAVE_DECL_KVM_CAP_PIT) && HAVE_DECL_KVM_CAP_PIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PIT) == (11), "KVM_CAP_PIT != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PIT 11 +#endif +#if defined(KVM_CAP_NOP_IO_DELAY) || (defined(HAVE_DECL_KVM_CAP_NOP_IO_DELAY) && HAVE_DECL_KVM_CAP_NOP_IO_DELAY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_NOP_IO_DELAY) == (12), "KVM_CAP_NOP_IO_DELAY != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_NOP_IO_DELAY 12 +#endif +#if defined(KVM_CAP_PV_MMU) || (defined(HAVE_DECL_KVM_CAP_PV_MMU) && HAVE_DECL_KVM_CAP_PV_MMU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PV_MMU) == (13), "KVM_CAP_PV_MMU != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PV_MMU 13 +#endif +#if defined(KVM_CAP_MP_STATE) || (defined(HAVE_DECL_KVM_CAP_MP_STATE) && HAVE_DECL_KVM_CAP_MP_STATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_MP_STATE) == (14), "KVM_CAP_MP_STATE != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_MP_STATE 14 +#endif +#if defined(KVM_CAP_COALESCED_MMIO) || (defined(HAVE_DECL_KVM_CAP_COALESCED_MMIO) && HAVE_DECL_KVM_CAP_COALESCED_MMIO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_COALESCED_MMIO) == (15), "KVM_CAP_COALESCED_MMIO != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_COALESCED_MMIO 15 +#endif +#if defined(KVM_CAP_SYNC_MMU) || (defined(HAVE_DECL_KVM_CAP_SYNC_MMU) && HAVE_DECL_KVM_CAP_SYNC_MMU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_SYNC_MMU) == (16), "KVM_CAP_SYNC_MMU != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_SYNC_MMU 16 +#endif +#if defined(KVM_CAP_IOMMU) || (defined(HAVE_DECL_KVM_CAP_IOMMU) && HAVE_DECL_KVM_CAP_IOMMU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_IOMMU) == (18), "KVM_CAP_IOMMU != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_IOMMU 18 +#endif +#if defined(KVM_CAP_DESTROY_MEMORY_REGION_WORKS) || (defined(HAVE_DECL_KVM_CAP_DESTROY_MEMORY_REGION_WORKS) && HAVE_DECL_KVM_CAP_DESTROY_MEMORY_REGION_WORKS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_DESTROY_MEMORY_REGION_WORKS) == (21), "KVM_CAP_DESTROY_MEMORY_REGION_WORKS != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_DESTROY_MEMORY_REGION_WORKS 21 +#endif +#if defined(KVM_CAP_USER_NMI) || (defined(HAVE_DECL_KVM_CAP_USER_NMI) && HAVE_DECL_KVM_CAP_USER_NMI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_USER_NMI) == (22), "KVM_CAP_USER_NMI != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_USER_NMI 22 +#endif +#if defined(KVM_CAP_SET_GUEST_DEBUG) || (defined(HAVE_DECL_KVM_CAP_SET_GUEST_DEBUG) && HAVE_DECL_KVM_CAP_SET_GUEST_DEBUG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_SET_GUEST_DEBUG) == (23), "KVM_CAP_SET_GUEST_DEBUG != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_SET_GUEST_DEBUG 23 +#endif +#if defined(KVM_CAP_REINJECT_CONTROL) || (defined(HAVE_DECL_KVM_CAP_REINJECT_CONTROL) && HAVE_DECL_KVM_CAP_REINJECT_CONTROL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_REINJECT_CONTROL) == (24), "KVM_CAP_REINJECT_CONTROL != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_REINJECT_CONTROL 24 +#endif +#if defined(KVM_CAP_IRQ_ROUTING) || (defined(HAVE_DECL_KVM_CAP_IRQ_ROUTING) && HAVE_DECL_KVM_CAP_IRQ_ROUTING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_IRQ_ROUTING) == (25), "KVM_CAP_IRQ_ROUTING != 25"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_IRQ_ROUTING 25 +#endif +#if defined(KVM_CAP_IRQ_INJECT_STATUS) || (defined(HAVE_DECL_KVM_CAP_IRQ_INJECT_STATUS) && HAVE_DECL_KVM_CAP_IRQ_INJECT_STATUS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_IRQ_INJECT_STATUS) == (26), "KVM_CAP_IRQ_INJECT_STATUS != 26"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_IRQ_INJECT_STATUS 26 +#endif +#if defined(KVM_CAP_ASSIGN_DEV_IRQ) || (defined(HAVE_DECL_KVM_CAP_ASSIGN_DEV_IRQ) && HAVE_DECL_KVM_CAP_ASSIGN_DEV_IRQ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_ASSIGN_DEV_IRQ) == (29), "KVM_CAP_ASSIGN_DEV_IRQ != 29"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_ASSIGN_DEV_IRQ 29 +#endif +#if defined(KVM_CAP_JOIN_MEMORY_REGIONS_WORKS) || (defined(HAVE_DECL_KVM_CAP_JOIN_MEMORY_REGIONS_WORKS) && HAVE_DECL_KVM_CAP_JOIN_MEMORY_REGIONS_WORKS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_JOIN_MEMORY_REGIONS_WORKS) == (30), "KVM_CAP_JOIN_MEMORY_REGIONS_WORKS != 30"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_JOIN_MEMORY_REGIONS_WORKS 30 +#endif +#if defined(KVM_CAP_MCE) || (defined(HAVE_DECL_KVM_CAP_MCE) && HAVE_DECL_KVM_CAP_MCE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_MCE) == (31), "KVM_CAP_MCE != 31"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_MCE 31 +#endif +#if defined(KVM_CAP_IRQFD) || (defined(HAVE_DECL_KVM_CAP_IRQFD) && HAVE_DECL_KVM_CAP_IRQFD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_IRQFD) == (32), "KVM_CAP_IRQFD != 32"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_IRQFD 32 +#endif +#if defined(KVM_CAP_PIT2) || (defined(HAVE_DECL_KVM_CAP_PIT2) && HAVE_DECL_KVM_CAP_PIT2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PIT2) == (33), "KVM_CAP_PIT2 != 33"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PIT2 33 +#endif +#if defined(KVM_CAP_SET_BOOT_CPU_ID) || (defined(HAVE_DECL_KVM_CAP_SET_BOOT_CPU_ID) && HAVE_DECL_KVM_CAP_SET_BOOT_CPU_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_SET_BOOT_CPU_ID) == (34), "KVM_CAP_SET_BOOT_CPU_ID != 34"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_SET_BOOT_CPU_ID 34 +#endif +#if defined(KVM_CAP_PIT_STATE2) || (defined(HAVE_DECL_KVM_CAP_PIT_STATE2) && HAVE_DECL_KVM_CAP_PIT_STATE2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PIT_STATE2) == (35), "KVM_CAP_PIT_STATE2 != 35"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PIT_STATE2 35 +#endif +#if defined(KVM_CAP_IOEVENTFD) || (defined(HAVE_DECL_KVM_CAP_IOEVENTFD) && HAVE_DECL_KVM_CAP_IOEVENTFD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_IOEVENTFD) == (36), "KVM_CAP_IOEVENTFD != 36"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_IOEVENTFD 36 +#endif +#if defined(KVM_CAP_SET_IDENTITY_MAP_ADDR) || (defined(HAVE_DECL_KVM_CAP_SET_IDENTITY_MAP_ADDR) && HAVE_DECL_KVM_CAP_SET_IDENTITY_MAP_ADDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_SET_IDENTITY_MAP_ADDR) == (37), "KVM_CAP_SET_IDENTITY_MAP_ADDR != 37"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_SET_IDENTITY_MAP_ADDR 37 +#endif +#if defined(KVM_CAP_XEN_HVM) || (defined(HAVE_DECL_KVM_CAP_XEN_HVM) && HAVE_DECL_KVM_CAP_XEN_HVM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_XEN_HVM) == (38), "KVM_CAP_XEN_HVM != 38"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_XEN_HVM 38 +#endif +#if defined(KVM_CAP_ADJUST_CLOCK) || (defined(HAVE_DECL_KVM_CAP_ADJUST_CLOCK) && HAVE_DECL_KVM_CAP_ADJUST_CLOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_ADJUST_CLOCK) == (39), "KVM_CAP_ADJUST_CLOCK != 39"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_ADJUST_CLOCK 39 +#endif +#if defined(KVM_CAP_INTERNAL_ERROR_DATA) || (defined(HAVE_DECL_KVM_CAP_INTERNAL_ERROR_DATA) && HAVE_DECL_KVM_CAP_INTERNAL_ERROR_DATA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_INTERNAL_ERROR_DATA) == (40), "KVM_CAP_INTERNAL_ERROR_DATA != 40"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_INTERNAL_ERROR_DATA 40 +#endif +#if defined(KVM_CAP_VCPU_EVENTS) || (defined(HAVE_DECL_KVM_CAP_VCPU_EVENTS) && HAVE_DECL_KVM_CAP_VCPU_EVENTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_VCPU_EVENTS) == (41), "KVM_CAP_VCPU_EVENTS != 41"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_VCPU_EVENTS 41 +#endif +#if defined(KVM_CAP_S390_PSW) || (defined(HAVE_DECL_KVM_CAP_S390_PSW) && HAVE_DECL_KVM_CAP_S390_PSW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_S390_PSW) == (42), "KVM_CAP_S390_PSW != 42"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_S390_PSW 42 +#endif +#if defined(KVM_CAP_PPC_SEGSTATE) || (defined(HAVE_DECL_KVM_CAP_PPC_SEGSTATE) && HAVE_DECL_KVM_CAP_PPC_SEGSTATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_SEGSTATE) == (43), "KVM_CAP_PPC_SEGSTATE != 43"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_SEGSTATE 43 +#endif +#if defined(KVM_CAP_HYPERV) || (defined(HAVE_DECL_KVM_CAP_HYPERV) && HAVE_DECL_KVM_CAP_HYPERV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_HYPERV) == (44), "KVM_CAP_HYPERV != 44"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_HYPERV 44 +#endif +#if defined(KVM_CAP_HYPERV_VAPIC) || (defined(HAVE_DECL_KVM_CAP_HYPERV_VAPIC) && HAVE_DECL_KVM_CAP_HYPERV_VAPIC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_HYPERV_VAPIC) == (45), "KVM_CAP_HYPERV_VAPIC != 45"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_HYPERV_VAPIC 45 +#endif +#if defined(KVM_CAP_HYPERV_SPIN) || (defined(HAVE_DECL_KVM_CAP_HYPERV_SPIN) && HAVE_DECL_KVM_CAP_HYPERV_SPIN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_HYPERV_SPIN) == (46), "KVM_CAP_HYPERV_SPIN != 46"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_HYPERV_SPIN 46 +#endif +#if defined(KVM_CAP_PCI_SEGMENT) || (defined(HAVE_DECL_KVM_CAP_PCI_SEGMENT) && HAVE_DECL_KVM_CAP_PCI_SEGMENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PCI_SEGMENT) == (47), "KVM_CAP_PCI_SEGMENT != 47"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PCI_SEGMENT 47 +#endif +#if defined(KVM_CAP_PPC_PAIRED_SINGLES) || (defined(HAVE_DECL_KVM_CAP_PPC_PAIRED_SINGLES) && HAVE_DECL_KVM_CAP_PPC_PAIRED_SINGLES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_PAIRED_SINGLES) == (48), "KVM_CAP_PPC_PAIRED_SINGLES != 48"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_PAIRED_SINGLES 48 +#endif +#if defined(KVM_CAP_INTR_SHADOW) || (defined(HAVE_DECL_KVM_CAP_INTR_SHADOW) && HAVE_DECL_KVM_CAP_INTR_SHADOW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_INTR_SHADOW) == (49), "KVM_CAP_INTR_SHADOW != 49"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_INTR_SHADOW 49 +#endif +#if defined(KVM_CAP_DEBUGREGS) || (defined(HAVE_DECL_KVM_CAP_DEBUGREGS) && HAVE_DECL_KVM_CAP_DEBUGREGS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_DEBUGREGS) == (50), "KVM_CAP_DEBUGREGS != 50"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_DEBUGREGS 50 +#endif +#if defined(KVM_CAP_X86_ROBUST_SINGLESTEP) || (defined(HAVE_DECL_KVM_CAP_X86_ROBUST_SINGLESTEP) && HAVE_DECL_KVM_CAP_X86_ROBUST_SINGLESTEP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_X86_ROBUST_SINGLESTEP) == (51), "KVM_CAP_X86_ROBUST_SINGLESTEP != 51"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_X86_ROBUST_SINGLESTEP 51 +#endif +#if defined(KVM_CAP_PPC_OSI) || (defined(HAVE_DECL_KVM_CAP_PPC_OSI) && HAVE_DECL_KVM_CAP_PPC_OSI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_OSI) == (52), "KVM_CAP_PPC_OSI != 52"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_OSI 52 +#endif +#if defined(KVM_CAP_PPC_UNSET_IRQ) || (defined(HAVE_DECL_KVM_CAP_PPC_UNSET_IRQ) && HAVE_DECL_KVM_CAP_PPC_UNSET_IRQ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_UNSET_IRQ) == (53), "KVM_CAP_PPC_UNSET_IRQ != 53"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_UNSET_IRQ 53 +#endif +#if defined(KVM_CAP_ENABLE_CAP) || (defined(HAVE_DECL_KVM_CAP_ENABLE_CAP) && HAVE_DECL_KVM_CAP_ENABLE_CAP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_ENABLE_CAP) == (54), "KVM_CAP_ENABLE_CAP != 54"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_ENABLE_CAP 54 +#endif +#if defined(KVM_CAP_XSAVE) || (defined(HAVE_DECL_KVM_CAP_XSAVE) && HAVE_DECL_KVM_CAP_XSAVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_XSAVE) == (55), "KVM_CAP_XSAVE != 55"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_XSAVE 55 +#endif +#if defined(KVM_CAP_XCRS) || (defined(HAVE_DECL_KVM_CAP_XCRS) && HAVE_DECL_KVM_CAP_XCRS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_XCRS) == (56), "KVM_CAP_XCRS != 56"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_XCRS 56 +#endif +#if defined(KVM_CAP_PPC_GET_PVINFO) || (defined(HAVE_DECL_KVM_CAP_PPC_GET_PVINFO) && HAVE_DECL_KVM_CAP_PPC_GET_PVINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_GET_PVINFO) == (57), "KVM_CAP_PPC_GET_PVINFO != 57"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_GET_PVINFO 57 +#endif +#if defined(KVM_CAP_PPC_IRQ_LEVEL) || (defined(HAVE_DECL_KVM_CAP_PPC_IRQ_LEVEL) && HAVE_DECL_KVM_CAP_PPC_IRQ_LEVEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_IRQ_LEVEL) == (58), "KVM_CAP_PPC_IRQ_LEVEL != 58"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_IRQ_LEVEL 58 +#endif +#if defined(KVM_CAP_ASYNC_PF) || (defined(HAVE_DECL_KVM_CAP_ASYNC_PF) && HAVE_DECL_KVM_CAP_ASYNC_PF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_ASYNC_PF) == (59), "KVM_CAP_ASYNC_PF != 59"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_ASYNC_PF 59 +#endif +#if defined(KVM_CAP_TSC_CONTROL) || (defined(HAVE_DECL_KVM_CAP_TSC_CONTROL) && HAVE_DECL_KVM_CAP_TSC_CONTROL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_TSC_CONTROL) == (60), "KVM_CAP_TSC_CONTROL != 60"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_TSC_CONTROL 60 +#endif +#if defined(KVM_CAP_GET_TSC_KHZ) || (defined(HAVE_DECL_KVM_CAP_GET_TSC_KHZ) && HAVE_DECL_KVM_CAP_GET_TSC_KHZ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_GET_TSC_KHZ) == (61), "KVM_CAP_GET_TSC_KHZ != 61"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_GET_TSC_KHZ 61 +#endif +#if defined(KVM_CAP_PPC_BOOKE_SREGS) || (defined(HAVE_DECL_KVM_CAP_PPC_BOOKE_SREGS) && HAVE_DECL_KVM_CAP_PPC_BOOKE_SREGS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_BOOKE_SREGS) == (62), "KVM_CAP_PPC_BOOKE_SREGS != 62"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_BOOKE_SREGS 62 +#endif +#if defined(KVM_CAP_SPAPR_TCE) || (defined(HAVE_DECL_KVM_CAP_SPAPR_TCE) && HAVE_DECL_KVM_CAP_SPAPR_TCE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_SPAPR_TCE) == (63), "KVM_CAP_SPAPR_TCE != 63"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_SPAPR_TCE 63 +#endif +#if defined(KVM_CAP_PPC_SMT) || (defined(HAVE_DECL_KVM_CAP_PPC_SMT) && HAVE_DECL_KVM_CAP_PPC_SMT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_SMT) == (64), "KVM_CAP_PPC_SMT != 64"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_SMT 64 +#endif +#if defined(KVM_CAP_PPC_RMA) || (defined(HAVE_DECL_KVM_CAP_PPC_RMA) && HAVE_DECL_KVM_CAP_PPC_RMA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_RMA) == (65), "KVM_CAP_PPC_RMA != 65"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_RMA 65 +#endif +#if defined(KVM_CAP_MAX_VCPUS) || (defined(HAVE_DECL_KVM_CAP_MAX_VCPUS) && HAVE_DECL_KVM_CAP_MAX_VCPUS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_MAX_VCPUS) == (66), "KVM_CAP_MAX_VCPUS != 66"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_MAX_VCPUS 66 +#endif +#if defined(KVM_CAP_PPC_HIOR) || (defined(HAVE_DECL_KVM_CAP_PPC_HIOR) && HAVE_DECL_KVM_CAP_PPC_HIOR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_HIOR) == (67), "KVM_CAP_PPC_HIOR != 67"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_HIOR 67 +#endif +#if defined(KVM_CAP_PPC_PAPR) || (defined(HAVE_DECL_KVM_CAP_PPC_PAPR) && HAVE_DECL_KVM_CAP_PPC_PAPR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_PAPR) == (68), "KVM_CAP_PPC_PAPR != 68"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_PAPR 68 +#endif +#if defined(KVM_CAP_SW_TLB) || (defined(HAVE_DECL_KVM_CAP_SW_TLB) && HAVE_DECL_KVM_CAP_SW_TLB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_SW_TLB) == (69), "KVM_CAP_SW_TLB != 69"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_SW_TLB 69 +#endif +#if defined(KVM_CAP_ONE_REG) || (defined(HAVE_DECL_KVM_CAP_ONE_REG) && HAVE_DECL_KVM_CAP_ONE_REG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_ONE_REG) == (70), "KVM_CAP_ONE_REG != 70"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_ONE_REG 70 +#endif +#if defined(KVM_CAP_S390_GMAP) || (defined(HAVE_DECL_KVM_CAP_S390_GMAP) && HAVE_DECL_KVM_CAP_S390_GMAP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_S390_GMAP) == (71), "KVM_CAP_S390_GMAP != 71"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_S390_GMAP 71 +#endif +#if defined(KVM_CAP_TSC_DEADLINE_TIMER) || (defined(HAVE_DECL_KVM_CAP_TSC_DEADLINE_TIMER) && HAVE_DECL_KVM_CAP_TSC_DEADLINE_TIMER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_TSC_DEADLINE_TIMER) == (72), "KVM_CAP_TSC_DEADLINE_TIMER != 72"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_TSC_DEADLINE_TIMER 72 +#endif +#if defined(KVM_CAP_S390_UCONTROL) || (defined(HAVE_DECL_KVM_CAP_S390_UCONTROL) && HAVE_DECL_KVM_CAP_S390_UCONTROL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_S390_UCONTROL) == (73), "KVM_CAP_S390_UCONTROL != 73"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_S390_UCONTROL 73 +#endif +#if defined(KVM_CAP_SYNC_REGS) || (defined(HAVE_DECL_KVM_CAP_SYNC_REGS) && HAVE_DECL_KVM_CAP_SYNC_REGS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_SYNC_REGS) == (74), "KVM_CAP_SYNC_REGS != 74"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_SYNC_REGS 74 +#endif +#if defined(KVM_CAP_PCI_2_3) || (defined(HAVE_DECL_KVM_CAP_PCI_2_3) && HAVE_DECL_KVM_CAP_PCI_2_3) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PCI_2_3) == (75), "KVM_CAP_PCI_2_3 != 75"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PCI_2_3 75 +#endif +#if defined(KVM_CAP_KVMCLOCK_CTRL) || (defined(HAVE_DECL_KVM_CAP_KVMCLOCK_CTRL) && HAVE_DECL_KVM_CAP_KVMCLOCK_CTRL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_KVMCLOCK_CTRL) == (76), "KVM_CAP_KVMCLOCK_CTRL != 76"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_KVMCLOCK_CTRL 76 +#endif +#if defined(KVM_CAP_SIGNAL_MSI) || (defined(HAVE_DECL_KVM_CAP_SIGNAL_MSI) && HAVE_DECL_KVM_CAP_SIGNAL_MSI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_SIGNAL_MSI) == (77), "KVM_CAP_SIGNAL_MSI != 77"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_SIGNAL_MSI 77 +#endif +#if defined(KVM_CAP_PPC_GET_SMMU_INFO) || (defined(HAVE_DECL_KVM_CAP_PPC_GET_SMMU_INFO) && HAVE_DECL_KVM_CAP_PPC_GET_SMMU_INFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_GET_SMMU_INFO) == (78), "KVM_CAP_PPC_GET_SMMU_INFO != 78"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_GET_SMMU_INFO 78 +#endif +#if defined(KVM_CAP_S390_COW) || (defined(HAVE_DECL_KVM_CAP_S390_COW) && HAVE_DECL_KVM_CAP_S390_COW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_S390_COW) == (79), "KVM_CAP_S390_COW != 79"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_S390_COW 79 +#endif +#if defined(KVM_CAP_PPC_ALLOC_HTAB) || (defined(HAVE_DECL_KVM_CAP_PPC_ALLOC_HTAB) && HAVE_DECL_KVM_CAP_PPC_ALLOC_HTAB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_ALLOC_HTAB) == (80), "KVM_CAP_PPC_ALLOC_HTAB != 80"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_ALLOC_HTAB 80 +#endif +#if defined(KVM_CAP_READONLY_MEM) || (defined(HAVE_DECL_KVM_CAP_READONLY_MEM) && HAVE_DECL_KVM_CAP_READONLY_MEM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_READONLY_MEM) == (81), "KVM_CAP_READONLY_MEM != 81"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_READONLY_MEM 81 +#endif +#if defined(KVM_CAP_IRQFD_RESAMPLE) || (defined(HAVE_DECL_KVM_CAP_IRQFD_RESAMPLE) && HAVE_DECL_KVM_CAP_IRQFD_RESAMPLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_IRQFD_RESAMPLE) == (82), "KVM_CAP_IRQFD_RESAMPLE != 82"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_IRQFD_RESAMPLE 82 +#endif +#if defined(KVM_CAP_PPC_BOOKE_WATCHDOG) || (defined(HAVE_DECL_KVM_CAP_PPC_BOOKE_WATCHDOG) && HAVE_DECL_KVM_CAP_PPC_BOOKE_WATCHDOG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_BOOKE_WATCHDOG) == (83), "KVM_CAP_PPC_BOOKE_WATCHDOG != 83"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_BOOKE_WATCHDOG 83 +#endif +#if defined(KVM_CAP_PPC_HTAB_FD) || (defined(HAVE_DECL_KVM_CAP_PPC_HTAB_FD) && HAVE_DECL_KVM_CAP_PPC_HTAB_FD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_HTAB_FD) == (84), "KVM_CAP_PPC_HTAB_FD != 84"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_HTAB_FD 84 +#endif +#if defined(KVM_CAP_S390_CSS_SUPPORT) || (defined(HAVE_DECL_KVM_CAP_S390_CSS_SUPPORT) && HAVE_DECL_KVM_CAP_S390_CSS_SUPPORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_S390_CSS_SUPPORT) == (85), "KVM_CAP_S390_CSS_SUPPORT != 85"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_S390_CSS_SUPPORT 85 +#endif +#if defined(KVM_CAP_PPC_EPR) || (defined(HAVE_DECL_KVM_CAP_PPC_EPR) && HAVE_DECL_KVM_CAP_PPC_EPR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_EPR) == (86), "KVM_CAP_PPC_EPR != 86"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_EPR 86 +#endif +#if defined(KVM_CAP_ARM_PSCI) || (defined(HAVE_DECL_KVM_CAP_ARM_PSCI) && HAVE_DECL_KVM_CAP_ARM_PSCI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_ARM_PSCI) == (87), "KVM_CAP_ARM_PSCI != 87"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_ARM_PSCI 87 +#endif +#if defined(KVM_CAP_ARM_SET_DEVICE_ADDR) || (defined(HAVE_DECL_KVM_CAP_ARM_SET_DEVICE_ADDR) && HAVE_DECL_KVM_CAP_ARM_SET_DEVICE_ADDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_ARM_SET_DEVICE_ADDR) == (88), "KVM_CAP_ARM_SET_DEVICE_ADDR != 88"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_ARM_SET_DEVICE_ADDR 88 +#endif +#if defined(KVM_CAP_DEVICE_CTRL) || (defined(HAVE_DECL_KVM_CAP_DEVICE_CTRL) && HAVE_DECL_KVM_CAP_DEVICE_CTRL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_DEVICE_CTRL) == (89), "KVM_CAP_DEVICE_CTRL != 89"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_DEVICE_CTRL 89 +#endif +#if defined(KVM_CAP_IRQ_MPIC) || (defined(HAVE_DECL_KVM_CAP_IRQ_MPIC) && HAVE_DECL_KVM_CAP_IRQ_MPIC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_IRQ_MPIC) == (90), "KVM_CAP_IRQ_MPIC != 90"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_IRQ_MPIC 90 +#endif +#if defined(KVM_CAP_PPC_RTAS) || (defined(HAVE_DECL_KVM_CAP_PPC_RTAS) && HAVE_DECL_KVM_CAP_PPC_RTAS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_RTAS) == (91), "KVM_CAP_PPC_RTAS != 91"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_RTAS 91 +#endif +#if defined(KVM_CAP_IRQ_XICS) || (defined(HAVE_DECL_KVM_CAP_IRQ_XICS) && HAVE_DECL_KVM_CAP_IRQ_XICS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_IRQ_XICS) == (92), "KVM_CAP_IRQ_XICS != 92"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_IRQ_XICS 92 +#endif +#if defined(KVM_CAP_ARM_EL1_32BIT) || (defined(HAVE_DECL_KVM_CAP_ARM_EL1_32BIT) && HAVE_DECL_KVM_CAP_ARM_EL1_32BIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_ARM_EL1_32BIT) == (93), "KVM_CAP_ARM_EL1_32BIT != 93"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_ARM_EL1_32BIT 93 +#endif +#if defined(KVM_CAP_SPAPR_MULTITCE) || (defined(HAVE_DECL_KVM_CAP_SPAPR_MULTITCE) && HAVE_DECL_KVM_CAP_SPAPR_MULTITCE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_SPAPR_MULTITCE) == (94), "KVM_CAP_SPAPR_MULTITCE != 94"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_SPAPR_MULTITCE 94 +#endif +#if defined(KVM_CAP_EXT_EMUL_CPUID) || (defined(HAVE_DECL_KVM_CAP_EXT_EMUL_CPUID) && HAVE_DECL_KVM_CAP_EXT_EMUL_CPUID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_EXT_EMUL_CPUID) == (95), "KVM_CAP_EXT_EMUL_CPUID != 95"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_EXT_EMUL_CPUID 95 +#endif +#if defined(KVM_CAP_HYPERV_TIME) || (defined(HAVE_DECL_KVM_CAP_HYPERV_TIME) && HAVE_DECL_KVM_CAP_HYPERV_TIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_HYPERV_TIME) == (96), "KVM_CAP_HYPERV_TIME != 96"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_HYPERV_TIME 96 +#endif +#if defined(KVM_CAP_IOAPIC_POLARITY_IGNORED) || (defined(HAVE_DECL_KVM_CAP_IOAPIC_POLARITY_IGNORED) && HAVE_DECL_KVM_CAP_IOAPIC_POLARITY_IGNORED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_IOAPIC_POLARITY_IGNORED) == (97), "KVM_CAP_IOAPIC_POLARITY_IGNORED != 97"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_IOAPIC_POLARITY_IGNORED 97 +#endif +#if defined(KVM_CAP_ENABLE_CAP_VM) || (defined(HAVE_DECL_KVM_CAP_ENABLE_CAP_VM) && HAVE_DECL_KVM_CAP_ENABLE_CAP_VM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_ENABLE_CAP_VM) == (98), "KVM_CAP_ENABLE_CAP_VM != 98"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_ENABLE_CAP_VM 98 +#endif +#if defined(KVM_CAP_S390_IRQCHIP) || (defined(HAVE_DECL_KVM_CAP_S390_IRQCHIP) && HAVE_DECL_KVM_CAP_S390_IRQCHIP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_S390_IRQCHIP) == (99), "KVM_CAP_S390_IRQCHIP != 99"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_S390_IRQCHIP 99 +#endif +#if defined(KVM_CAP_IOEVENTFD_NO_LENGTH) || (defined(HAVE_DECL_KVM_CAP_IOEVENTFD_NO_LENGTH) && HAVE_DECL_KVM_CAP_IOEVENTFD_NO_LENGTH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_IOEVENTFD_NO_LENGTH) == (100), "KVM_CAP_IOEVENTFD_NO_LENGTH != 100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_IOEVENTFD_NO_LENGTH 100 +#endif +#if defined(KVM_CAP_VM_ATTRIBUTES) || (defined(HAVE_DECL_KVM_CAP_VM_ATTRIBUTES) && HAVE_DECL_KVM_CAP_VM_ATTRIBUTES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_VM_ATTRIBUTES) == (101), "KVM_CAP_VM_ATTRIBUTES != 101"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_VM_ATTRIBUTES 101 +#endif +#if defined(KVM_CAP_ARM_PSCI_0_2) || (defined(HAVE_DECL_KVM_CAP_ARM_PSCI_0_2) && HAVE_DECL_KVM_CAP_ARM_PSCI_0_2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_ARM_PSCI_0_2) == (102), "KVM_CAP_ARM_PSCI_0_2 != 102"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_ARM_PSCI_0_2 102 +#endif +#if defined(KVM_CAP_PPC_FIXUP_HCALL) || (defined(HAVE_DECL_KVM_CAP_PPC_FIXUP_HCALL) && HAVE_DECL_KVM_CAP_PPC_FIXUP_HCALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_FIXUP_HCALL) == (103), "KVM_CAP_PPC_FIXUP_HCALL != 103"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_FIXUP_HCALL 103 +#endif +#if defined(KVM_CAP_PPC_ENABLE_HCALL) || (defined(HAVE_DECL_KVM_CAP_PPC_ENABLE_HCALL) && HAVE_DECL_KVM_CAP_PPC_ENABLE_HCALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_ENABLE_HCALL) == (104), "KVM_CAP_PPC_ENABLE_HCALL != 104"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_ENABLE_HCALL 104 +#endif +#if defined(KVM_CAP_CHECK_EXTENSION_VM) || (defined(HAVE_DECL_KVM_CAP_CHECK_EXTENSION_VM) && HAVE_DECL_KVM_CAP_CHECK_EXTENSION_VM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_CHECK_EXTENSION_VM) == (105), "KVM_CAP_CHECK_EXTENSION_VM != 105"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_CHECK_EXTENSION_VM 105 +#endif +#if defined(KVM_CAP_S390_USER_SIGP) || (defined(HAVE_DECL_KVM_CAP_S390_USER_SIGP) && HAVE_DECL_KVM_CAP_S390_USER_SIGP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_S390_USER_SIGP) == (106), "KVM_CAP_S390_USER_SIGP != 106"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_S390_USER_SIGP 106 +#endif +#if defined(KVM_CAP_S390_VECTOR_REGISTERS) || (defined(HAVE_DECL_KVM_CAP_S390_VECTOR_REGISTERS) && HAVE_DECL_KVM_CAP_S390_VECTOR_REGISTERS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_S390_VECTOR_REGISTERS) == (107), "KVM_CAP_S390_VECTOR_REGISTERS != 107"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_S390_VECTOR_REGISTERS 107 +#endif +#if defined(KVM_CAP_S390_MEM_OP) || (defined(HAVE_DECL_KVM_CAP_S390_MEM_OP) && HAVE_DECL_KVM_CAP_S390_MEM_OP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_S390_MEM_OP) == (108), "KVM_CAP_S390_MEM_OP != 108"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_S390_MEM_OP 108 +#endif +#if defined(KVM_CAP_S390_USER_STSI) || (defined(HAVE_DECL_KVM_CAP_S390_USER_STSI) && HAVE_DECL_KVM_CAP_S390_USER_STSI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_S390_USER_STSI) == (109), "KVM_CAP_S390_USER_STSI != 109"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_S390_USER_STSI 109 +#endif +#if defined(KVM_CAP_S390_SKEYS) || (defined(HAVE_DECL_KVM_CAP_S390_SKEYS) && HAVE_DECL_KVM_CAP_S390_SKEYS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_S390_SKEYS) == (110), "KVM_CAP_S390_SKEYS != 110"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_S390_SKEYS 110 +#endif +#if defined(KVM_CAP_MIPS_FPU) || (defined(HAVE_DECL_KVM_CAP_MIPS_FPU) && HAVE_DECL_KVM_CAP_MIPS_FPU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_MIPS_FPU) == (111), "KVM_CAP_MIPS_FPU != 111"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_MIPS_FPU 111 +#endif +#if defined(KVM_CAP_MIPS_MSA) || (defined(HAVE_DECL_KVM_CAP_MIPS_MSA) && HAVE_DECL_KVM_CAP_MIPS_MSA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_MIPS_MSA) == (112), "KVM_CAP_MIPS_MSA != 112"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_MIPS_MSA 112 +#endif +#if defined(KVM_CAP_S390_INJECT_IRQ) || (defined(HAVE_DECL_KVM_CAP_S390_INJECT_IRQ) && HAVE_DECL_KVM_CAP_S390_INJECT_IRQ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_S390_INJECT_IRQ) == (113), "KVM_CAP_S390_INJECT_IRQ != 113"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_S390_INJECT_IRQ 113 +#endif +#if defined(KVM_CAP_S390_IRQ_STATE) || (defined(HAVE_DECL_KVM_CAP_S390_IRQ_STATE) && HAVE_DECL_KVM_CAP_S390_IRQ_STATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_S390_IRQ_STATE) == (114), "KVM_CAP_S390_IRQ_STATE != 114"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_S390_IRQ_STATE 114 +#endif +#if defined(KVM_CAP_PPC_HWRNG) || (defined(HAVE_DECL_KVM_CAP_PPC_HWRNG) && HAVE_DECL_KVM_CAP_PPC_HWRNG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_HWRNG) == (115), "KVM_CAP_PPC_HWRNG != 115"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_HWRNG 115 +#endif +#if defined(KVM_CAP_DISABLE_QUIRKS) || (defined(HAVE_DECL_KVM_CAP_DISABLE_QUIRKS) && HAVE_DECL_KVM_CAP_DISABLE_QUIRKS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_DISABLE_QUIRKS) == (116), "KVM_CAP_DISABLE_QUIRKS != 116"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_DISABLE_QUIRKS 116 +#endif +#if defined(KVM_CAP_X86_SMM) || (defined(HAVE_DECL_KVM_CAP_X86_SMM) && HAVE_DECL_KVM_CAP_X86_SMM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_X86_SMM) == (117), "KVM_CAP_X86_SMM != 117"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_X86_SMM 117 +#endif +#if defined(KVM_CAP_MULTI_ADDRESS_SPACE) || (defined(HAVE_DECL_KVM_CAP_MULTI_ADDRESS_SPACE) && HAVE_DECL_KVM_CAP_MULTI_ADDRESS_SPACE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_MULTI_ADDRESS_SPACE) == (118), "KVM_CAP_MULTI_ADDRESS_SPACE != 118"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_MULTI_ADDRESS_SPACE 118 +#endif +#if defined(KVM_CAP_GUEST_DEBUG_HW_BPS) || (defined(HAVE_DECL_KVM_CAP_GUEST_DEBUG_HW_BPS) && HAVE_DECL_KVM_CAP_GUEST_DEBUG_HW_BPS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_GUEST_DEBUG_HW_BPS) == (119), "KVM_CAP_GUEST_DEBUG_HW_BPS != 119"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_GUEST_DEBUG_HW_BPS 119 +#endif +#if defined(KVM_CAP_GUEST_DEBUG_HW_WPS) || (defined(HAVE_DECL_KVM_CAP_GUEST_DEBUG_HW_WPS) && HAVE_DECL_KVM_CAP_GUEST_DEBUG_HW_WPS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_GUEST_DEBUG_HW_WPS) == (120), "KVM_CAP_GUEST_DEBUG_HW_WPS != 120"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_GUEST_DEBUG_HW_WPS 120 +#endif +#if defined(KVM_CAP_SPLIT_IRQCHIP) || (defined(HAVE_DECL_KVM_CAP_SPLIT_IRQCHIP) && HAVE_DECL_KVM_CAP_SPLIT_IRQCHIP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_SPLIT_IRQCHIP) == (121), "KVM_CAP_SPLIT_IRQCHIP != 121"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_SPLIT_IRQCHIP 121 +#endif +#if defined(KVM_CAP_IOEVENTFD_ANY_LENGTH) || (defined(HAVE_DECL_KVM_CAP_IOEVENTFD_ANY_LENGTH) && HAVE_DECL_KVM_CAP_IOEVENTFD_ANY_LENGTH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_IOEVENTFD_ANY_LENGTH) == (122), "KVM_CAP_IOEVENTFD_ANY_LENGTH != 122"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_IOEVENTFD_ANY_LENGTH 122 +#endif +#if defined(KVM_CAP_HYPERV_SYNIC) || (defined(HAVE_DECL_KVM_CAP_HYPERV_SYNIC) && HAVE_DECL_KVM_CAP_HYPERV_SYNIC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_HYPERV_SYNIC) == (123), "KVM_CAP_HYPERV_SYNIC != 123"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_HYPERV_SYNIC 123 +#endif +#if defined(KVM_CAP_S390_RI) || (defined(HAVE_DECL_KVM_CAP_S390_RI) && HAVE_DECL_KVM_CAP_S390_RI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_S390_RI) == (124), "KVM_CAP_S390_RI != 124"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_S390_RI 124 +#endif +#if defined(KVM_CAP_SPAPR_TCE_64) || (defined(HAVE_DECL_KVM_CAP_SPAPR_TCE_64) && HAVE_DECL_KVM_CAP_SPAPR_TCE_64) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_SPAPR_TCE_64) == (125), "KVM_CAP_SPAPR_TCE_64 != 125"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_SPAPR_TCE_64 125 +#endif +#if defined(KVM_CAP_ARM_PMU_V3) || (defined(HAVE_DECL_KVM_CAP_ARM_PMU_V3) && HAVE_DECL_KVM_CAP_ARM_PMU_V3) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_ARM_PMU_V3) == (126), "KVM_CAP_ARM_PMU_V3 != 126"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_ARM_PMU_V3 126 +#endif +#if defined(KVM_CAP_VCPU_ATTRIBUTES) || (defined(HAVE_DECL_KVM_CAP_VCPU_ATTRIBUTES) && HAVE_DECL_KVM_CAP_VCPU_ATTRIBUTES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_VCPU_ATTRIBUTES) == (127), "KVM_CAP_VCPU_ATTRIBUTES != 127"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_VCPU_ATTRIBUTES 127 +#endif +#if defined(KVM_CAP_MAX_VCPU_ID) || (defined(HAVE_DECL_KVM_CAP_MAX_VCPU_ID) && HAVE_DECL_KVM_CAP_MAX_VCPU_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_MAX_VCPU_ID) == (128), "KVM_CAP_MAX_VCPU_ID != 128"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_MAX_VCPU_ID 128 +#endif +#if defined(KVM_CAP_X2APIC_API) || (defined(HAVE_DECL_KVM_CAP_X2APIC_API) && HAVE_DECL_KVM_CAP_X2APIC_API) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_X2APIC_API) == (129), "KVM_CAP_X2APIC_API != 129"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_X2APIC_API 129 +#endif +#if defined(KVM_CAP_S390_USER_INSTR0) || (defined(HAVE_DECL_KVM_CAP_S390_USER_INSTR0) && HAVE_DECL_KVM_CAP_S390_USER_INSTR0) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_S390_USER_INSTR0) == (130), "KVM_CAP_S390_USER_INSTR0 != 130"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_S390_USER_INSTR0 130 +#endif +#if defined(KVM_CAP_MSI_DEVID) || (defined(HAVE_DECL_KVM_CAP_MSI_DEVID) && HAVE_DECL_KVM_CAP_MSI_DEVID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_MSI_DEVID) == (131), "KVM_CAP_MSI_DEVID != 131"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_MSI_DEVID 131 +#endif +#if defined(KVM_CAP_PPC_HTM) || (defined(HAVE_DECL_KVM_CAP_PPC_HTM) && HAVE_DECL_KVM_CAP_PPC_HTM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_HTM) == (132), "KVM_CAP_PPC_HTM != 132"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_HTM 132 +#endif +#if defined(KVM_CAP_SPAPR_RESIZE_HPT) || (defined(HAVE_DECL_KVM_CAP_SPAPR_RESIZE_HPT) && HAVE_DECL_KVM_CAP_SPAPR_RESIZE_HPT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_SPAPR_RESIZE_HPT) == (133), "KVM_CAP_SPAPR_RESIZE_HPT != 133"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_SPAPR_RESIZE_HPT 133 +#endif +#if defined(KVM_CAP_PPC_MMU_RADIX) || (defined(HAVE_DECL_KVM_CAP_PPC_MMU_RADIX) && HAVE_DECL_KVM_CAP_PPC_MMU_RADIX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_MMU_RADIX) == (134), "KVM_CAP_PPC_MMU_RADIX != 134"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_MMU_RADIX 134 +#endif +#if defined(KVM_CAP_PPC_MMU_HASH_V3) || (defined(HAVE_DECL_KVM_CAP_PPC_MMU_HASH_V3) && HAVE_DECL_KVM_CAP_PPC_MMU_HASH_V3) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_MMU_HASH_V3) == (135), "KVM_CAP_PPC_MMU_HASH_V3 != 135"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_MMU_HASH_V3 135 +#endif +#if defined(KVM_CAP_IMMEDIATE_EXIT) || (defined(HAVE_DECL_KVM_CAP_IMMEDIATE_EXIT) && HAVE_DECL_KVM_CAP_IMMEDIATE_EXIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_IMMEDIATE_EXIT) == (136), "KVM_CAP_IMMEDIATE_EXIT != 136"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_IMMEDIATE_EXIT 136 +#endif +#if defined(KVM_CAP_MIPS_VZ) || (defined(HAVE_DECL_KVM_CAP_MIPS_VZ) && HAVE_DECL_KVM_CAP_MIPS_VZ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_MIPS_VZ) == (137), "KVM_CAP_MIPS_VZ != 137"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_MIPS_VZ 137 +#endif +#if defined(KVM_CAP_MIPS_TE) || (defined(HAVE_DECL_KVM_CAP_MIPS_TE) && HAVE_DECL_KVM_CAP_MIPS_TE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_MIPS_TE) == (138), "KVM_CAP_MIPS_TE != 138"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_MIPS_TE 138 +#endif +#if defined(KVM_CAP_MIPS_64BIT) || (defined(HAVE_DECL_KVM_CAP_MIPS_64BIT) && HAVE_DECL_KVM_CAP_MIPS_64BIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_MIPS_64BIT) == (139), "KVM_CAP_MIPS_64BIT != 139"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_MIPS_64BIT 139 +#endif +#if defined(KVM_CAP_S390_GS) || (defined(HAVE_DECL_KVM_CAP_S390_GS) && HAVE_DECL_KVM_CAP_S390_GS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_S390_GS) == (140), "KVM_CAP_S390_GS != 140"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_S390_GS 140 +#endif +#if defined(KVM_CAP_S390_AIS) || (defined(HAVE_DECL_KVM_CAP_S390_AIS) && HAVE_DECL_KVM_CAP_S390_AIS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_S390_AIS) == (141), "KVM_CAP_S390_AIS != 141"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_S390_AIS 141 +#endif +#if defined(KVM_CAP_SPAPR_TCE_VFIO) || (defined(HAVE_DECL_KVM_CAP_SPAPR_TCE_VFIO) && HAVE_DECL_KVM_CAP_SPAPR_TCE_VFIO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_SPAPR_TCE_VFIO) == (142), "KVM_CAP_SPAPR_TCE_VFIO != 142"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_SPAPR_TCE_VFIO 142 +#endif +#if defined(KVM_CAP_X86_DISABLE_EXITS) || (defined(HAVE_DECL_KVM_CAP_X86_DISABLE_EXITS) && HAVE_DECL_KVM_CAP_X86_DISABLE_EXITS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_X86_DISABLE_EXITS) == (143), "KVM_CAP_X86_DISABLE_EXITS != 143"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_X86_DISABLE_EXITS 143 +#endif +#if defined(KVM_CAP_ARM_USER_IRQ) || (defined(HAVE_DECL_KVM_CAP_ARM_USER_IRQ) && HAVE_DECL_KVM_CAP_ARM_USER_IRQ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_ARM_USER_IRQ) == (144), "KVM_CAP_ARM_USER_IRQ != 144"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_ARM_USER_IRQ 144 +#endif +#if defined(KVM_CAP_S390_CMMA_MIGRATION) || (defined(HAVE_DECL_KVM_CAP_S390_CMMA_MIGRATION) && HAVE_DECL_KVM_CAP_S390_CMMA_MIGRATION) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_S390_CMMA_MIGRATION) == (145), "KVM_CAP_S390_CMMA_MIGRATION != 145"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_S390_CMMA_MIGRATION 145 +#endif +#if defined(KVM_CAP_PPC_FWNMI) || (defined(HAVE_DECL_KVM_CAP_PPC_FWNMI) && HAVE_DECL_KVM_CAP_PPC_FWNMI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_FWNMI) == (146), "KVM_CAP_PPC_FWNMI != 146"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_FWNMI 146 +#endif +#if defined(KVM_CAP_PPC_SMT_POSSIBLE) || (defined(HAVE_DECL_KVM_CAP_PPC_SMT_POSSIBLE) && HAVE_DECL_KVM_CAP_PPC_SMT_POSSIBLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_SMT_POSSIBLE) == (147), "KVM_CAP_PPC_SMT_POSSIBLE != 147"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_SMT_POSSIBLE 147 +#endif +#if defined(KVM_CAP_HYPERV_SYNIC2) || (defined(HAVE_DECL_KVM_CAP_HYPERV_SYNIC2) && HAVE_DECL_KVM_CAP_HYPERV_SYNIC2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_HYPERV_SYNIC2) == (148), "KVM_CAP_HYPERV_SYNIC2 != 148"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_HYPERV_SYNIC2 148 +#endif +#if defined(KVM_CAP_HYPERV_VP_INDEX) || (defined(HAVE_DECL_KVM_CAP_HYPERV_VP_INDEX) && HAVE_DECL_KVM_CAP_HYPERV_VP_INDEX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_HYPERV_VP_INDEX) == (149), "KVM_CAP_HYPERV_VP_INDEX != 149"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_HYPERV_VP_INDEX 149 +#endif +#if defined(KVM_CAP_S390_AIS_MIGRATION) || (defined(HAVE_DECL_KVM_CAP_S390_AIS_MIGRATION) && HAVE_DECL_KVM_CAP_S390_AIS_MIGRATION) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_S390_AIS_MIGRATION) == (150), "KVM_CAP_S390_AIS_MIGRATION != 150"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_S390_AIS_MIGRATION 150 +#endif +#if defined(KVM_CAP_PPC_GET_CPU_CHAR) || (defined(HAVE_DECL_KVM_CAP_PPC_GET_CPU_CHAR) && HAVE_DECL_KVM_CAP_PPC_GET_CPU_CHAR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_GET_CPU_CHAR) == (151), "KVM_CAP_PPC_GET_CPU_CHAR != 151"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_GET_CPU_CHAR 151 +#endif +#if defined(KVM_CAP_S390_BPB) || (defined(HAVE_DECL_KVM_CAP_S390_BPB) && HAVE_DECL_KVM_CAP_S390_BPB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_S390_BPB) == (152), "KVM_CAP_S390_BPB != 152"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_S390_BPB 152 +#endif +#if defined(KVM_CAP_GET_MSR_FEATURES) || (defined(HAVE_DECL_KVM_CAP_GET_MSR_FEATURES) && HAVE_DECL_KVM_CAP_GET_MSR_FEATURES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_GET_MSR_FEATURES) == (153), "KVM_CAP_GET_MSR_FEATURES != 153"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_GET_MSR_FEATURES 153 +#endif +#if defined(KVM_CAP_HYPERV_EVENTFD) || (defined(HAVE_DECL_KVM_CAP_HYPERV_EVENTFD) && HAVE_DECL_KVM_CAP_HYPERV_EVENTFD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_HYPERV_EVENTFD) == (154), "KVM_CAP_HYPERV_EVENTFD != 154"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_HYPERV_EVENTFD 154 +#endif +#if defined(KVM_CAP_HYPERV_TLBFLUSH) || (defined(HAVE_DECL_KVM_CAP_HYPERV_TLBFLUSH) && HAVE_DECL_KVM_CAP_HYPERV_TLBFLUSH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_HYPERV_TLBFLUSH) == (155), "KVM_CAP_HYPERV_TLBFLUSH != 155"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_HYPERV_TLBFLUSH 155 +#endif +#if defined(KVM_CAP_S390_HPAGE_1M) || (defined(HAVE_DECL_KVM_CAP_S390_HPAGE_1M) && HAVE_DECL_KVM_CAP_S390_HPAGE_1M) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_S390_HPAGE_1M) == (156), "KVM_CAP_S390_HPAGE_1M != 156"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_S390_HPAGE_1M 156 +#endif +#if defined(KVM_CAP_NESTED_STATE) || (defined(HAVE_DECL_KVM_CAP_NESTED_STATE) && HAVE_DECL_KVM_CAP_NESTED_STATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_NESTED_STATE) == (157), "KVM_CAP_NESTED_STATE != 157"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_NESTED_STATE 157 +#endif +#if defined(KVM_CAP_ARM_INJECT_SERROR_ESR) || (defined(HAVE_DECL_KVM_CAP_ARM_INJECT_SERROR_ESR) && HAVE_DECL_KVM_CAP_ARM_INJECT_SERROR_ESR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_ARM_INJECT_SERROR_ESR) == (158), "KVM_CAP_ARM_INJECT_SERROR_ESR != 158"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_ARM_INJECT_SERROR_ESR 158 +#endif +#if defined(KVM_CAP_MSR_PLATFORM_INFO) || (defined(HAVE_DECL_KVM_CAP_MSR_PLATFORM_INFO) && HAVE_DECL_KVM_CAP_MSR_PLATFORM_INFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_MSR_PLATFORM_INFO) == (159), "KVM_CAP_MSR_PLATFORM_INFO != 159"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_MSR_PLATFORM_INFO 159 +#endif +#if defined(KVM_CAP_PPC_NESTED_HV) || (defined(HAVE_DECL_KVM_CAP_PPC_NESTED_HV) && HAVE_DECL_KVM_CAP_PPC_NESTED_HV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_PPC_NESTED_HV) == (160), "KVM_CAP_PPC_NESTED_HV != 160"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_PPC_NESTED_HV 160 +#endif +#if defined(KVM_CAP_HYPERV_SEND_IPI) || (defined(HAVE_DECL_KVM_CAP_HYPERV_SEND_IPI) && HAVE_DECL_KVM_CAP_HYPERV_SEND_IPI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_HYPERV_SEND_IPI) == (161), "KVM_CAP_HYPERV_SEND_IPI != 161"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_HYPERV_SEND_IPI 161 +#endif +#if defined(KVM_CAP_COALESCED_PIO) || (defined(HAVE_DECL_KVM_CAP_COALESCED_PIO) && HAVE_DECL_KVM_CAP_COALESCED_PIO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_COALESCED_PIO) == (162), "KVM_CAP_COALESCED_PIO != 162"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_COALESCED_PIO 162 +#endif +#if defined(KVM_CAP_HYPERV_ENLIGHTENED_VMCS) || (defined(HAVE_DECL_KVM_CAP_HYPERV_ENLIGHTENED_VMCS) && HAVE_DECL_KVM_CAP_HYPERV_ENLIGHTENED_VMCS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_HYPERV_ENLIGHTENED_VMCS) == (163), "KVM_CAP_HYPERV_ENLIGHTENED_VMCS != 163"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_HYPERV_ENLIGHTENED_VMCS 163 +#endif +#if defined(KVM_CAP_EXCEPTION_PAYLOAD) || (defined(HAVE_DECL_KVM_CAP_EXCEPTION_PAYLOAD) && HAVE_DECL_KVM_CAP_EXCEPTION_PAYLOAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_EXCEPTION_PAYLOAD) == (164), "KVM_CAP_EXCEPTION_PAYLOAD != 164"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_EXCEPTION_PAYLOAD 164 +#endif +#if defined(KVM_CAP_ARM_VM_IPA_SIZE) || (defined(HAVE_DECL_KVM_CAP_ARM_VM_IPA_SIZE) && HAVE_DECL_KVM_CAP_ARM_VM_IPA_SIZE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_ARM_VM_IPA_SIZE) == (165), "KVM_CAP_ARM_VM_IPA_SIZE != 165"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_ARM_VM_IPA_SIZE 165 +#endif +#if defined(KVM_CAP_MANUAL_DIRTY_LOG_PROTECT) || (defined(HAVE_DECL_KVM_CAP_MANUAL_DIRTY_LOG_PROTECT) && HAVE_DECL_KVM_CAP_MANUAL_DIRTY_LOG_PROTECT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_MANUAL_DIRTY_LOG_PROTECT) == (166), "KVM_CAP_MANUAL_DIRTY_LOG_PROTECT != 166"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_MANUAL_DIRTY_LOG_PROTECT 166 +#endif +#if defined(KVM_CAP_HYPERV_CPUID) || (defined(HAVE_DECL_KVM_CAP_HYPERV_CPUID) && HAVE_DECL_KVM_CAP_HYPERV_CPUID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CAP_HYPERV_CPUID) == (167), "KVM_CAP_HYPERV_CPUID != 167"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CAP_HYPERV_CPUID 167 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat kvm_cap in mpers mode + +# else + +static +const struct xlat kvm_cap[] = { + [KVM_CAP_IRQCHIP] = XLAT(KVM_CAP_IRQCHIP), + [KVM_CAP_HLT] = XLAT(KVM_CAP_HLT), + [KVM_CAP_MMU_SHADOW_CACHE_CONTROL] = XLAT(KVM_CAP_MMU_SHADOW_CACHE_CONTROL), + [KVM_CAP_USER_MEMORY] = XLAT(KVM_CAP_USER_MEMORY), + [KVM_CAP_SET_TSS_ADDR] = XLAT(KVM_CAP_SET_TSS_ADDR), + [KVM_CAP_VAPIC] = XLAT(KVM_CAP_VAPIC), + [KVM_CAP_EXT_CPUID] = XLAT(KVM_CAP_EXT_CPUID), + [KVM_CAP_CLOCKSOURCE] = XLAT(KVM_CAP_CLOCKSOURCE), + [KVM_CAP_NR_VCPUS] = XLAT(KVM_CAP_NR_VCPUS), + [KVM_CAP_NR_MEMSLOTS] = XLAT(KVM_CAP_NR_MEMSLOTS), + [KVM_CAP_PIT] = XLAT(KVM_CAP_PIT), + [KVM_CAP_NOP_IO_DELAY] = XLAT(KVM_CAP_NOP_IO_DELAY), + [KVM_CAP_PV_MMU] = XLAT(KVM_CAP_PV_MMU), + [KVM_CAP_MP_STATE] = XLAT(KVM_CAP_MP_STATE), + [KVM_CAP_COALESCED_MMIO] = XLAT(KVM_CAP_COALESCED_MMIO), + [KVM_CAP_SYNC_MMU] = XLAT(KVM_CAP_SYNC_MMU), + [KVM_CAP_IOMMU] = XLAT(KVM_CAP_IOMMU), + [KVM_CAP_DESTROY_MEMORY_REGION_WORKS] = XLAT(KVM_CAP_DESTROY_MEMORY_REGION_WORKS), + [KVM_CAP_USER_NMI] = XLAT(KVM_CAP_USER_NMI), + [KVM_CAP_SET_GUEST_DEBUG] = XLAT(KVM_CAP_SET_GUEST_DEBUG), + [KVM_CAP_REINJECT_CONTROL] = XLAT(KVM_CAP_REINJECT_CONTROL), + [KVM_CAP_IRQ_ROUTING] = XLAT(KVM_CAP_IRQ_ROUTING), + [KVM_CAP_IRQ_INJECT_STATUS] = XLAT(KVM_CAP_IRQ_INJECT_STATUS), + [KVM_CAP_ASSIGN_DEV_IRQ] = XLAT(KVM_CAP_ASSIGN_DEV_IRQ), + [KVM_CAP_JOIN_MEMORY_REGIONS_WORKS] = XLAT(KVM_CAP_JOIN_MEMORY_REGIONS_WORKS), + [KVM_CAP_MCE] = XLAT(KVM_CAP_MCE), + [KVM_CAP_IRQFD] = XLAT(KVM_CAP_IRQFD), + [KVM_CAP_PIT2] = XLAT(KVM_CAP_PIT2), + [KVM_CAP_SET_BOOT_CPU_ID] = XLAT(KVM_CAP_SET_BOOT_CPU_ID), + [KVM_CAP_PIT_STATE2] = XLAT(KVM_CAP_PIT_STATE2), + [KVM_CAP_IOEVENTFD] = XLAT(KVM_CAP_IOEVENTFD), + [KVM_CAP_SET_IDENTITY_MAP_ADDR] = XLAT(KVM_CAP_SET_IDENTITY_MAP_ADDR), + [KVM_CAP_XEN_HVM] = XLAT(KVM_CAP_XEN_HVM), + [KVM_CAP_ADJUST_CLOCK] = XLAT(KVM_CAP_ADJUST_CLOCK), + [KVM_CAP_INTERNAL_ERROR_DATA] = XLAT(KVM_CAP_INTERNAL_ERROR_DATA), + [KVM_CAP_VCPU_EVENTS] = XLAT(KVM_CAP_VCPU_EVENTS), + [KVM_CAP_S390_PSW] = XLAT(KVM_CAP_S390_PSW), + [KVM_CAP_PPC_SEGSTATE] = XLAT(KVM_CAP_PPC_SEGSTATE), + [KVM_CAP_HYPERV] = XLAT(KVM_CAP_HYPERV), + [KVM_CAP_HYPERV_VAPIC] = XLAT(KVM_CAP_HYPERV_VAPIC), + [KVM_CAP_HYPERV_SPIN] = XLAT(KVM_CAP_HYPERV_SPIN), + [KVM_CAP_PCI_SEGMENT] = XLAT(KVM_CAP_PCI_SEGMENT), + [KVM_CAP_PPC_PAIRED_SINGLES] = XLAT(KVM_CAP_PPC_PAIRED_SINGLES), + [KVM_CAP_INTR_SHADOW] = XLAT(KVM_CAP_INTR_SHADOW), + [KVM_CAP_DEBUGREGS] = XLAT(KVM_CAP_DEBUGREGS), + [KVM_CAP_X86_ROBUST_SINGLESTEP] = XLAT(KVM_CAP_X86_ROBUST_SINGLESTEP), + [KVM_CAP_PPC_OSI] = XLAT(KVM_CAP_PPC_OSI), + [KVM_CAP_PPC_UNSET_IRQ] = XLAT(KVM_CAP_PPC_UNSET_IRQ), + [KVM_CAP_ENABLE_CAP] = XLAT(KVM_CAP_ENABLE_CAP), + [KVM_CAP_XSAVE] = XLAT(KVM_CAP_XSAVE), + [KVM_CAP_XCRS] = XLAT(KVM_CAP_XCRS), + [KVM_CAP_PPC_GET_PVINFO] = XLAT(KVM_CAP_PPC_GET_PVINFO), + [KVM_CAP_PPC_IRQ_LEVEL] = XLAT(KVM_CAP_PPC_IRQ_LEVEL), + [KVM_CAP_ASYNC_PF] = XLAT(KVM_CAP_ASYNC_PF), + [KVM_CAP_TSC_CONTROL] = XLAT(KVM_CAP_TSC_CONTROL), + [KVM_CAP_GET_TSC_KHZ] = XLAT(KVM_CAP_GET_TSC_KHZ), + [KVM_CAP_PPC_BOOKE_SREGS] = XLAT(KVM_CAP_PPC_BOOKE_SREGS), + [KVM_CAP_SPAPR_TCE] = XLAT(KVM_CAP_SPAPR_TCE), + [KVM_CAP_PPC_SMT] = XLAT(KVM_CAP_PPC_SMT), + [KVM_CAP_PPC_RMA] = XLAT(KVM_CAP_PPC_RMA), + [KVM_CAP_MAX_VCPUS] = XLAT(KVM_CAP_MAX_VCPUS), + [KVM_CAP_PPC_HIOR] = XLAT(KVM_CAP_PPC_HIOR), + [KVM_CAP_PPC_PAPR] = XLAT(KVM_CAP_PPC_PAPR), + [KVM_CAP_SW_TLB] = XLAT(KVM_CAP_SW_TLB), + [KVM_CAP_ONE_REG] = XLAT(KVM_CAP_ONE_REG), + [KVM_CAP_S390_GMAP] = XLAT(KVM_CAP_S390_GMAP), + [KVM_CAP_TSC_DEADLINE_TIMER] = XLAT(KVM_CAP_TSC_DEADLINE_TIMER), + [KVM_CAP_S390_UCONTROL] = XLAT(KVM_CAP_S390_UCONTROL), + [KVM_CAP_SYNC_REGS] = XLAT(KVM_CAP_SYNC_REGS), + [KVM_CAP_PCI_2_3] = XLAT(KVM_CAP_PCI_2_3), + [KVM_CAP_KVMCLOCK_CTRL] = XLAT(KVM_CAP_KVMCLOCK_CTRL), + [KVM_CAP_SIGNAL_MSI] = XLAT(KVM_CAP_SIGNAL_MSI), + [KVM_CAP_PPC_GET_SMMU_INFO] = XLAT(KVM_CAP_PPC_GET_SMMU_INFO), + [KVM_CAP_S390_COW] = XLAT(KVM_CAP_S390_COW), + [KVM_CAP_PPC_ALLOC_HTAB] = XLAT(KVM_CAP_PPC_ALLOC_HTAB), + [KVM_CAP_READONLY_MEM] = XLAT(KVM_CAP_READONLY_MEM), + [KVM_CAP_IRQFD_RESAMPLE] = XLAT(KVM_CAP_IRQFD_RESAMPLE), + [KVM_CAP_PPC_BOOKE_WATCHDOG] = XLAT(KVM_CAP_PPC_BOOKE_WATCHDOG), + [KVM_CAP_PPC_HTAB_FD] = XLAT(KVM_CAP_PPC_HTAB_FD), + [KVM_CAP_S390_CSS_SUPPORT] = XLAT(KVM_CAP_S390_CSS_SUPPORT), + [KVM_CAP_PPC_EPR] = XLAT(KVM_CAP_PPC_EPR), + [KVM_CAP_ARM_PSCI] = XLAT(KVM_CAP_ARM_PSCI), + [KVM_CAP_ARM_SET_DEVICE_ADDR] = XLAT(KVM_CAP_ARM_SET_DEVICE_ADDR), + [KVM_CAP_DEVICE_CTRL] = XLAT(KVM_CAP_DEVICE_CTRL), + [KVM_CAP_IRQ_MPIC] = XLAT(KVM_CAP_IRQ_MPIC), + [KVM_CAP_PPC_RTAS] = XLAT(KVM_CAP_PPC_RTAS), + [KVM_CAP_IRQ_XICS] = XLAT(KVM_CAP_IRQ_XICS), + [KVM_CAP_ARM_EL1_32BIT] = XLAT(KVM_CAP_ARM_EL1_32BIT), + [KVM_CAP_SPAPR_MULTITCE] = XLAT(KVM_CAP_SPAPR_MULTITCE), + [KVM_CAP_EXT_EMUL_CPUID] = XLAT(KVM_CAP_EXT_EMUL_CPUID), + [KVM_CAP_HYPERV_TIME] = XLAT(KVM_CAP_HYPERV_TIME), + [KVM_CAP_IOAPIC_POLARITY_IGNORED] = XLAT(KVM_CAP_IOAPIC_POLARITY_IGNORED), + [KVM_CAP_ENABLE_CAP_VM] = XLAT(KVM_CAP_ENABLE_CAP_VM), + [KVM_CAP_S390_IRQCHIP] = XLAT(KVM_CAP_S390_IRQCHIP), + [KVM_CAP_IOEVENTFD_NO_LENGTH] = XLAT(KVM_CAP_IOEVENTFD_NO_LENGTH), + [KVM_CAP_VM_ATTRIBUTES] = XLAT(KVM_CAP_VM_ATTRIBUTES), + [KVM_CAP_ARM_PSCI_0_2] = XLAT(KVM_CAP_ARM_PSCI_0_2), + [KVM_CAP_PPC_FIXUP_HCALL] = XLAT(KVM_CAP_PPC_FIXUP_HCALL), + [KVM_CAP_PPC_ENABLE_HCALL] = XLAT(KVM_CAP_PPC_ENABLE_HCALL), + [KVM_CAP_CHECK_EXTENSION_VM] = XLAT(KVM_CAP_CHECK_EXTENSION_VM), + [KVM_CAP_S390_USER_SIGP] = XLAT(KVM_CAP_S390_USER_SIGP), + [KVM_CAP_S390_VECTOR_REGISTERS] = XLAT(KVM_CAP_S390_VECTOR_REGISTERS), + [KVM_CAP_S390_MEM_OP] = XLAT(KVM_CAP_S390_MEM_OP), + [KVM_CAP_S390_USER_STSI] = XLAT(KVM_CAP_S390_USER_STSI), + [KVM_CAP_S390_SKEYS] = XLAT(KVM_CAP_S390_SKEYS), + [KVM_CAP_MIPS_FPU] = XLAT(KVM_CAP_MIPS_FPU), + [KVM_CAP_MIPS_MSA] = XLAT(KVM_CAP_MIPS_MSA), + [KVM_CAP_S390_INJECT_IRQ] = XLAT(KVM_CAP_S390_INJECT_IRQ), + [KVM_CAP_S390_IRQ_STATE] = XLAT(KVM_CAP_S390_IRQ_STATE), + [KVM_CAP_PPC_HWRNG] = XLAT(KVM_CAP_PPC_HWRNG), + [KVM_CAP_DISABLE_QUIRKS] = XLAT(KVM_CAP_DISABLE_QUIRKS), + [KVM_CAP_X86_SMM] = XLAT(KVM_CAP_X86_SMM), + [KVM_CAP_MULTI_ADDRESS_SPACE] = XLAT(KVM_CAP_MULTI_ADDRESS_SPACE), + [KVM_CAP_GUEST_DEBUG_HW_BPS] = XLAT(KVM_CAP_GUEST_DEBUG_HW_BPS), + [KVM_CAP_GUEST_DEBUG_HW_WPS] = XLAT(KVM_CAP_GUEST_DEBUG_HW_WPS), + [KVM_CAP_SPLIT_IRQCHIP] = XLAT(KVM_CAP_SPLIT_IRQCHIP), + [KVM_CAP_IOEVENTFD_ANY_LENGTH] = XLAT(KVM_CAP_IOEVENTFD_ANY_LENGTH), + [KVM_CAP_HYPERV_SYNIC] = XLAT(KVM_CAP_HYPERV_SYNIC), + [KVM_CAP_S390_RI] = XLAT(KVM_CAP_S390_RI), + [KVM_CAP_SPAPR_TCE_64] = XLAT(KVM_CAP_SPAPR_TCE_64), + [KVM_CAP_ARM_PMU_V3] = XLAT(KVM_CAP_ARM_PMU_V3), + [KVM_CAP_VCPU_ATTRIBUTES] = XLAT(KVM_CAP_VCPU_ATTRIBUTES), + [KVM_CAP_MAX_VCPU_ID] = XLAT(KVM_CAP_MAX_VCPU_ID), + [KVM_CAP_X2APIC_API] = XLAT(KVM_CAP_X2APIC_API), + [KVM_CAP_S390_USER_INSTR0] = XLAT(KVM_CAP_S390_USER_INSTR0), + [KVM_CAP_MSI_DEVID] = XLAT(KVM_CAP_MSI_DEVID), + [KVM_CAP_PPC_HTM] = XLAT(KVM_CAP_PPC_HTM), + [KVM_CAP_SPAPR_RESIZE_HPT] = XLAT(KVM_CAP_SPAPR_RESIZE_HPT), + [KVM_CAP_PPC_MMU_RADIX] = XLAT(KVM_CAP_PPC_MMU_RADIX), + [KVM_CAP_PPC_MMU_HASH_V3] = XLAT(KVM_CAP_PPC_MMU_HASH_V3), + [KVM_CAP_IMMEDIATE_EXIT] = XLAT(KVM_CAP_IMMEDIATE_EXIT), + [KVM_CAP_MIPS_VZ] = XLAT(KVM_CAP_MIPS_VZ), + [KVM_CAP_MIPS_TE] = XLAT(KVM_CAP_MIPS_TE), + [KVM_CAP_MIPS_64BIT] = XLAT(KVM_CAP_MIPS_64BIT), + [KVM_CAP_S390_GS] = XLAT(KVM_CAP_S390_GS), + [KVM_CAP_S390_AIS] = XLAT(KVM_CAP_S390_AIS), + [KVM_CAP_SPAPR_TCE_VFIO] = XLAT(KVM_CAP_SPAPR_TCE_VFIO), + [KVM_CAP_X86_DISABLE_EXITS] = XLAT(KVM_CAP_X86_DISABLE_EXITS), + [KVM_CAP_ARM_USER_IRQ] = XLAT(KVM_CAP_ARM_USER_IRQ), + [KVM_CAP_S390_CMMA_MIGRATION] = XLAT(KVM_CAP_S390_CMMA_MIGRATION), + [KVM_CAP_PPC_FWNMI] = XLAT(KVM_CAP_PPC_FWNMI), + [KVM_CAP_PPC_SMT_POSSIBLE] = XLAT(KVM_CAP_PPC_SMT_POSSIBLE), + [KVM_CAP_HYPERV_SYNIC2] = XLAT(KVM_CAP_HYPERV_SYNIC2), + [KVM_CAP_HYPERV_VP_INDEX] = XLAT(KVM_CAP_HYPERV_VP_INDEX), + [KVM_CAP_S390_AIS_MIGRATION] = XLAT(KVM_CAP_S390_AIS_MIGRATION), + [KVM_CAP_PPC_GET_CPU_CHAR] = XLAT(KVM_CAP_PPC_GET_CPU_CHAR), + [KVM_CAP_S390_BPB] = XLAT(KVM_CAP_S390_BPB), + [KVM_CAP_GET_MSR_FEATURES] = XLAT(KVM_CAP_GET_MSR_FEATURES), + [KVM_CAP_HYPERV_EVENTFD] = XLAT(KVM_CAP_HYPERV_EVENTFD), + [KVM_CAP_HYPERV_TLBFLUSH] = XLAT(KVM_CAP_HYPERV_TLBFLUSH), + [KVM_CAP_S390_HPAGE_1M] = XLAT(KVM_CAP_S390_HPAGE_1M), + [KVM_CAP_NESTED_STATE] = XLAT(KVM_CAP_NESTED_STATE), + [KVM_CAP_ARM_INJECT_SERROR_ESR] = XLAT(KVM_CAP_ARM_INJECT_SERROR_ESR), + [KVM_CAP_MSR_PLATFORM_INFO] = XLAT(KVM_CAP_MSR_PLATFORM_INFO), + [KVM_CAP_PPC_NESTED_HV] = XLAT(KVM_CAP_PPC_NESTED_HV), + [KVM_CAP_HYPERV_SEND_IPI] = XLAT(KVM_CAP_HYPERV_SEND_IPI), + [KVM_CAP_COALESCED_PIO] = XLAT(KVM_CAP_COALESCED_PIO), + [KVM_CAP_HYPERV_ENLIGHTENED_VMCS] = XLAT(KVM_CAP_HYPERV_ENLIGHTENED_VMCS), + [KVM_CAP_EXCEPTION_PAYLOAD] = XLAT(KVM_CAP_EXCEPTION_PAYLOAD), + [KVM_CAP_ARM_VM_IPA_SIZE] = XLAT(KVM_CAP_ARM_VM_IPA_SIZE), + [KVM_CAP_MANUAL_DIRTY_LOG_PROTECT] = XLAT(KVM_CAP_MANUAL_DIRTY_LOG_PROTECT), + [KVM_CAP_HYPERV_CPUID] = XLAT(KVM_CAP_HYPERV_CPUID), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/kvm_cap.in b/xlat/kvm_cap.in new file mode 100644 index 00000000..64a3ca77 --- /dev/null +++ b/xlat/kvm_cap.in @@ -0,0 +1,163 @@ +#value_indexed +KVM_CAP_IRQCHIP 0 +KVM_CAP_HLT 1 +KVM_CAP_MMU_SHADOW_CACHE_CONTROL 2 +KVM_CAP_USER_MEMORY 3 +KVM_CAP_SET_TSS_ADDR 4 +KVM_CAP_VAPIC 6 +KVM_CAP_EXT_CPUID 7 +KVM_CAP_CLOCKSOURCE 8 +KVM_CAP_NR_VCPUS 9 +KVM_CAP_NR_MEMSLOTS 10 +KVM_CAP_PIT 11 +KVM_CAP_NOP_IO_DELAY 12 +KVM_CAP_PV_MMU 13 +KVM_CAP_MP_STATE 14 +KVM_CAP_COALESCED_MMIO 15 +KVM_CAP_SYNC_MMU 16 +KVM_CAP_IOMMU 18 +KVM_CAP_DESTROY_MEMORY_REGION_WORKS 21 +KVM_CAP_USER_NMI 22 +KVM_CAP_SET_GUEST_DEBUG 23 +KVM_CAP_REINJECT_CONTROL 24 +KVM_CAP_IRQ_ROUTING 25 +KVM_CAP_IRQ_INJECT_STATUS 26 +KVM_CAP_ASSIGN_DEV_IRQ 29 +KVM_CAP_JOIN_MEMORY_REGIONS_WORKS 30 +KVM_CAP_MCE 31 +KVM_CAP_IRQFD 32 +KVM_CAP_PIT2 33 +KVM_CAP_SET_BOOT_CPU_ID 34 +KVM_CAP_PIT_STATE2 35 +KVM_CAP_IOEVENTFD 36 +KVM_CAP_SET_IDENTITY_MAP_ADDR 37 +KVM_CAP_XEN_HVM 38 +KVM_CAP_ADJUST_CLOCK 39 +KVM_CAP_INTERNAL_ERROR_DATA 40 +KVM_CAP_VCPU_EVENTS 41 +KVM_CAP_S390_PSW 42 +KVM_CAP_PPC_SEGSTATE 43 +KVM_CAP_HYPERV 44 +KVM_CAP_HYPERV_VAPIC 45 +KVM_CAP_HYPERV_SPIN 46 +KVM_CAP_PCI_SEGMENT 47 +KVM_CAP_PPC_PAIRED_SINGLES 48 +KVM_CAP_INTR_SHADOW 49 +KVM_CAP_DEBUGREGS 50 +KVM_CAP_X86_ROBUST_SINGLESTEP 51 +KVM_CAP_PPC_OSI 52 +KVM_CAP_PPC_UNSET_IRQ 53 +KVM_CAP_ENABLE_CAP 54 +KVM_CAP_XSAVE 55 +KVM_CAP_XCRS 56 +KVM_CAP_PPC_GET_PVINFO 57 +KVM_CAP_PPC_IRQ_LEVEL 58 +KVM_CAP_ASYNC_PF 59 +KVM_CAP_TSC_CONTROL 60 +KVM_CAP_GET_TSC_KHZ 61 +KVM_CAP_PPC_BOOKE_SREGS 62 +KVM_CAP_SPAPR_TCE 63 +KVM_CAP_PPC_SMT 64 +KVM_CAP_PPC_RMA 65 +KVM_CAP_MAX_VCPUS 66 +KVM_CAP_PPC_HIOR 67 +KVM_CAP_PPC_PAPR 68 +KVM_CAP_SW_TLB 69 +KVM_CAP_ONE_REG 70 +KVM_CAP_S390_GMAP 71 +KVM_CAP_TSC_DEADLINE_TIMER 72 +KVM_CAP_S390_UCONTROL 73 +KVM_CAP_SYNC_REGS 74 +KVM_CAP_PCI_2_3 75 +KVM_CAP_KVMCLOCK_CTRL 76 +KVM_CAP_SIGNAL_MSI 77 +KVM_CAP_PPC_GET_SMMU_INFO 78 +KVM_CAP_S390_COW 79 +KVM_CAP_PPC_ALLOC_HTAB 80 +KVM_CAP_READONLY_MEM 81 +KVM_CAP_IRQFD_RESAMPLE 82 +KVM_CAP_PPC_BOOKE_WATCHDOG 83 +KVM_CAP_PPC_HTAB_FD 84 +KVM_CAP_S390_CSS_SUPPORT 85 +KVM_CAP_PPC_EPR 86 +KVM_CAP_ARM_PSCI 87 +KVM_CAP_ARM_SET_DEVICE_ADDR 88 +KVM_CAP_DEVICE_CTRL 89 +KVM_CAP_IRQ_MPIC 90 +KVM_CAP_PPC_RTAS 91 +KVM_CAP_IRQ_XICS 92 +KVM_CAP_ARM_EL1_32BIT 93 +KVM_CAP_SPAPR_MULTITCE 94 +KVM_CAP_EXT_EMUL_CPUID 95 +KVM_CAP_HYPERV_TIME 96 +KVM_CAP_IOAPIC_POLARITY_IGNORED 97 +KVM_CAP_ENABLE_CAP_VM 98 +KVM_CAP_S390_IRQCHIP 99 +KVM_CAP_IOEVENTFD_NO_LENGTH 100 +KVM_CAP_VM_ATTRIBUTES 101 +KVM_CAP_ARM_PSCI_0_2 102 +KVM_CAP_PPC_FIXUP_HCALL 103 +KVM_CAP_PPC_ENABLE_HCALL 104 +KVM_CAP_CHECK_EXTENSION_VM 105 +KVM_CAP_S390_USER_SIGP 106 +KVM_CAP_S390_VECTOR_REGISTERS 107 +KVM_CAP_S390_MEM_OP 108 +KVM_CAP_S390_USER_STSI 109 +KVM_CAP_S390_SKEYS 110 +KVM_CAP_MIPS_FPU 111 +KVM_CAP_MIPS_MSA 112 +KVM_CAP_S390_INJECT_IRQ 113 +KVM_CAP_S390_IRQ_STATE 114 +KVM_CAP_PPC_HWRNG 115 +KVM_CAP_DISABLE_QUIRKS 116 +KVM_CAP_X86_SMM 117 +KVM_CAP_MULTI_ADDRESS_SPACE 118 +KVM_CAP_GUEST_DEBUG_HW_BPS 119 +KVM_CAP_GUEST_DEBUG_HW_WPS 120 +KVM_CAP_SPLIT_IRQCHIP 121 +KVM_CAP_IOEVENTFD_ANY_LENGTH 122 +KVM_CAP_HYPERV_SYNIC 123 +KVM_CAP_S390_RI 124 +KVM_CAP_SPAPR_TCE_64 125 +KVM_CAP_ARM_PMU_V3 126 +KVM_CAP_VCPU_ATTRIBUTES 127 +KVM_CAP_MAX_VCPU_ID 128 +KVM_CAP_X2APIC_API 129 +KVM_CAP_S390_USER_INSTR0 130 +KVM_CAP_MSI_DEVID 131 +KVM_CAP_PPC_HTM 132 +KVM_CAP_SPAPR_RESIZE_HPT 133 +KVM_CAP_PPC_MMU_RADIX 134 +KVM_CAP_PPC_MMU_HASH_V3 135 +KVM_CAP_IMMEDIATE_EXIT 136 +KVM_CAP_MIPS_VZ 137 +KVM_CAP_MIPS_TE 138 +KVM_CAP_MIPS_64BIT 139 +KVM_CAP_S390_GS 140 +KVM_CAP_S390_AIS 141 +KVM_CAP_SPAPR_TCE_VFIO 142 +KVM_CAP_X86_DISABLE_EXITS 143 +KVM_CAP_ARM_USER_IRQ 144 +KVM_CAP_S390_CMMA_MIGRATION 145 +KVM_CAP_PPC_FWNMI 146 +KVM_CAP_PPC_SMT_POSSIBLE 147 +KVM_CAP_HYPERV_SYNIC2 148 +KVM_CAP_HYPERV_VP_INDEX 149 +KVM_CAP_S390_AIS_MIGRATION 150 +KVM_CAP_PPC_GET_CPU_CHAR 151 +KVM_CAP_S390_BPB 152 +KVM_CAP_GET_MSR_FEATURES 153 +KVM_CAP_HYPERV_EVENTFD 154 +KVM_CAP_HYPERV_TLBFLUSH 155 +KVM_CAP_S390_HPAGE_1M 156 +KVM_CAP_NESTED_STATE 157 +KVM_CAP_ARM_INJECT_SERROR_ESR 158 +KVM_CAP_MSR_PLATFORM_INFO 159 +KVM_CAP_PPC_NESTED_HV 160 +KVM_CAP_HYPERV_SEND_IPI 161 +KVM_CAP_COALESCED_PIO 162 +KVM_CAP_HYPERV_ENLIGHTENED_VMCS 163 +KVM_CAP_EXCEPTION_PAYLOAD 164 +KVM_CAP_ARM_VM_IPA_SIZE 165 +KVM_CAP_MANUAL_DIRTY_LOG_PROTECT 166 +KVM_CAP_HYPERV_CPUID 167 diff --git a/xlat/kvm_cpuid_flags.h b/xlat/kvm_cpuid_flags.h new file mode 100644 index 00000000..6b0afe99 --- /dev/null +++ b/xlat/kvm_cpuid_flags.h @@ -0,0 +1,56 @@ +/* Generated by ./xlat/gen.sh from ./xlat/kvm_cpuid_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#ifndef BIT +# define BIT(nr_) (1UL << (nr_)) +#endif +#if defined(KVM_CPUID_FLAG_SIGNIFCANT_INDEX) || (defined(HAVE_DECL_KVM_CPUID_FLAG_SIGNIFCANT_INDEX) && HAVE_DECL_KVM_CPUID_FLAG_SIGNIFCANT_INDEX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CPUID_FLAG_SIGNIFCANT_INDEX) == ((1 << 0)), "KVM_CPUID_FLAG_SIGNIFCANT_INDEX != (1 << 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CPUID_FLAG_SIGNIFCANT_INDEX (1 << 0) +#endif +#if defined(KVM_CPUID_FLAG_STATEFUL_FUNC) || (defined(HAVE_DECL_KVM_CPUID_FLAG_STATEFUL_FUNC) && HAVE_DECL_KVM_CPUID_FLAG_STATEFUL_FUNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CPUID_FLAG_STATEFUL_FUNC) == ((1 << 1)), "KVM_CPUID_FLAG_STATEFUL_FUNC != (1 << 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CPUID_FLAG_STATEFUL_FUNC (1 << 1) +#endif +#if defined(KVM_CPUID_FLAG_STATE_READ_NEXT) || (defined(HAVE_DECL_KVM_CPUID_FLAG_STATE_READ_NEXT) && HAVE_DECL_KVM_CPUID_FLAG_STATE_READ_NEXT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_CPUID_FLAG_STATE_READ_NEXT) == ((1 << 2)), "KVM_CPUID_FLAG_STATE_READ_NEXT != (1 << 2)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_CPUID_FLAG_STATE_READ_NEXT (1 << 2) +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat kvm_cpuid_flags in mpers mode + +# else + +static +const struct xlat kvm_cpuid_flags[] = { +#ifndef BIT +/* +* Workaround a bug in kernel headers fixed by linux commit v4.7-rc1~32^2~42. +*/ +# define BIT(nr_) (1UL << (nr_)) +#endif + + XLAT(KVM_CPUID_FLAG_SIGNIFCANT_INDEX), + XLAT(KVM_CPUID_FLAG_STATEFUL_FUNC), + XLAT(KVM_CPUID_FLAG_STATE_READ_NEXT), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/kvm_cpuid_flags.in b/xlat/kvm_cpuid_flags.in new file mode 100644 index 00000000..43640b76 --- /dev/null +++ b/xlat/kvm_cpuid_flags.in @@ -0,0 +1,10 @@ +#ifndef BIT +/* + * Workaround a bug in kernel headers fixed by linux commit v4.7-rc1~32^2~42. + */ +# define BIT(nr_) (1UL << (nr_)) +#endif + +KVM_CPUID_FLAG_SIGNIFCANT_INDEX (1 << 0) +KVM_CPUID_FLAG_STATEFUL_FUNC (1 << 1) +KVM_CPUID_FLAG_STATE_READ_NEXT (1 << 2) diff --git a/xlat/kvm_exit_reason.h b/xlat/kvm_exit_reason.h new file mode 100644 index 00000000..b5d37125 --- /dev/null +++ b/xlat/kvm_exit_reason.h @@ -0,0 +1,247 @@ +/* Generated by ./xlat/gen.sh from ./xlat/kvm_exit_reason.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(KVM_EXIT_UNKNOWN) || (defined(HAVE_DECL_KVM_EXIT_UNKNOWN) && HAVE_DECL_KVM_EXIT_UNKNOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_UNKNOWN) == (0), "KVM_EXIT_UNKNOWN != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_UNKNOWN 0 +#endif +#if defined(KVM_EXIT_EXCEPTION) || (defined(HAVE_DECL_KVM_EXIT_EXCEPTION) && HAVE_DECL_KVM_EXIT_EXCEPTION) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_EXCEPTION) == (1), "KVM_EXIT_EXCEPTION != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_EXCEPTION 1 +#endif +#if defined(KVM_EXIT_IO) || (defined(HAVE_DECL_KVM_EXIT_IO) && HAVE_DECL_KVM_EXIT_IO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_IO) == (2), "KVM_EXIT_IO != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_IO 2 +#endif +#if defined(KVM_EXIT_HYPERCALL) || (defined(HAVE_DECL_KVM_EXIT_HYPERCALL) && HAVE_DECL_KVM_EXIT_HYPERCALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_HYPERCALL) == (3), "KVM_EXIT_HYPERCALL != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_HYPERCALL 3 +#endif +#if defined(KVM_EXIT_DEBUG) || (defined(HAVE_DECL_KVM_EXIT_DEBUG) && HAVE_DECL_KVM_EXIT_DEBUG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_DEBUG) == (4), "KVM_EXIT_DEBUG != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_DEBUG 4 +#endif +#if defined(KVM_EXIT_HLT) || (defined(HAVE_DECL_KVM_EXIT_HLT) && HAVE_DECL_KVM_EXIT_HLT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_HLT) == (5), "KVM_EXIT_HLT != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_HLT 5 +#endif +#if defined(KVM_EXIT_MMIO) || (defined(HAVE_DECL_KVM_EXIT_MMIO) && HAVE_DECL_KVM_EXIT_MMIO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_MMIO) == (6), "KVM_EXIT_MMIO != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_MMIO 6 +#endif +#if defined(KVM_EXIT_IRQ_WINDOW_OPEN) || (defined(HAVE_DECL_KVM_EXIT_IRQ_WINDOW_OPEN) && HAVE_DECL_KVM_EXIT_IRQ_WINDOW_OPEN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_IRQ_WINDOW_OPEN) == (7), "KVM_EXIT_IRQ_WINDOW_OPEN != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_IRQ_WINDOW_OPEN 7 +#endif +#if defined(KVM_EXIT_SHUTDOWN) || (defined(HAVE_DECL_KVM_EXIT_SHUTDOWN) && HAVE_DECL_KVM_EXIT_SHUTDOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_SHUTDOWN) == (8), "KVM_EXIT_SHUTDOWN != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_SHUTDOWN 8 +#endif +#if defined(KVM_EXIT_FAIL_ENTRY) || (defined(HAVE_DECL_KVM_EXIT_FAIL_ENTRY) && HAVE_DECL_KVM_EXIT_FAIL_ENTRY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_FAIL_ENTRY) == (9), "KVM_EXIT_FAIL_ENTRY != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_FAIL_ENTRY 9 +#endif +#if defined(KVM_EXIT_INTR) || (defined(HAVE_DECL_KVM_EXIT_INTR) && HAVE_DECL_KVM_EXIT_INTR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_INTR) == (10), "KVM_EXIT_INTR != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_INTR 10 +#endif +#if defined(KVM_EXIT_SET_TPR) || (defined(HAVE_DECL_KVM_EXIT_SET_TPR) && HAVE_DECL_KVM_EXIT_SET_TPR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_SET_TPR) == (11), "KVM_EXIT_SET_TPR != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_SET_TPR 11 +#endif +#if defined(KVM_EXIT_TPR_ACCESS) || (defined(HAVE_DECL_KVM_EXIT_TPR_ACCESS) && HAVE_DECL_KVM_EXIT_TPR_ACCESS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_TPR_ACCESS) == (12), "KVM_EXIT_TPR_ACCESS != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_TPR_ACCESS 12 +#endif +#if defined(KVM_EXIT_S390_SIEIC) || (defined(HAVE_DECL_KVM_EXIT_S390_SIEIC) && HAVE_DECL_KVM_EXIT_S390_SIEIC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_S390_SIEIC) == (13), "KVM_EXIT_S390_SIEIC != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_S390_SIEIC 13 +#endif +#if defined(KVM_EXIT_S390_RESET) || (defined(HAVE_DECL_KVM_EXIT_S390_RESET) && HAVE_DECL_KVM_EXIT_S390_RESET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_S390_RESET) == (14), "KVM_EXIT_S390_RESET != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_S390_RESET 14 +#endif +#if defined(KVM_EXIT_DCR) || (defined(HAVE_DECL_KVM_EXIT_DCR) && HAVE_DECL_KVM_EXIT_DCR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_DCR) == (15), "KVM_EXIT_DCR != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_DCR 15 +#endif +#if defined(KVM_EXIT_NMI) || (defined(HAVE_DECL_KVM_EXIT_NMI) && HAVE_DECL_KVM_EXIT_NMI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_NMI) == (16), "KVM_EXIT_NMI != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_NMI 16 +#endif +#if defined(KVM_EXIT_INTERNAL_ERROR) || (defined(HAVE_DECL_KVM_EXIT_INTERNAL_ERROR) && HAVE_DECL_KVM_EXIT_INTERNAL_ERROR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_INTERNAL_ERROR) == (17), "KVM_EXIT_INTERNAL_ERROR != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_INTERNAL_ERROR 17 +#endif +#if defined(KVM_EXIT_OSI) || (defined(HAVE_DECL_KVM_EXIT_OSI) && HAVE_DECL_KVM_EXIT_OSI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_OSI) == (18), "KVM_EXIT_OSI != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_OSI 18 +#endif +#if defined(KVM_EXIT_PAPR_HCALL) || (defined(HAVE_DECL_KVM_EXIT_PAPR_HCALL) && HAVE_DECL_KVM_EXIT_PAPR_HCALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_PAPR_HCALL) == (19), "KVM_EXIT_PAPR_HCALL != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_PAPR_HCALL 19 +#endif +#if defined(KVM_EXIT_S390_UCONTROL) || (defined(HAVE_DECL_KVM_EXIT_S390_UCONTROL) && HAVE_DECL_KVM_EXIT_S390_UCONTROL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_S390_UCONTROL) == (20), "KVM_EXIT_S390_UCONTROL != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_S390_UCONTROL 20 +#endif +#if defined(KVM_EXIT_WATCHDOG) || (defined(HAVE_DECL_KVM_EXIT_WATCHDOG) && HAVE_DECL_KVM_EXIT_WATCHDOG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_WATCHDOG) == (21), "KVM_EXIT_WATCHDOG != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_WATCHDOG 21 +#endif +#if defined(KVM_EXIT_S390_TSCH) || (defined(HAVE_DECL_KVM_EXIT_S390_TSCH) && HAVE_DECL_KVM_EXIT_S390_TSCH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_S390_TSCH) == (22), "KVM_EXIT_S390_TSCH != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_S390_TSCH 22 +#endif +#if defined(KVM_EXIT_EPR) || (defined(HAVE_DECL_KVM_EXIT_EPR) && HAVE_DECL_KVM_EXIT_EPR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_EPR) == (23), "KVM_EXIT_EPR != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_EPR 23 +#endif +#if defined(KVM_EXIT_SYSTEM_EVENT) || (defined(HAVE_DECL_KVM_EXIT_SYSTEM_EVENT) && HAVE_DECL_KVM_EXIT_SYSTEM_EVENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_SYSTEM_EVENT) == (24), "KVM_EXIT_SYSTEM_EVENT != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_SYSTEM_EVENT 24 +#endif +#if defined(KVM_EXIT_S390_STSI) || (defined(HAVE_DECL_KVM_EXIT_S390_STSI) && HAVE_DECL_KVM_EXIT_S390_STSI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_S390_STSI) == (25), "KVM_EXIT_S390_STSI != 25"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_S390_STSI 25 +#endif +#if defined(KVM_EXIT_IOAPIC_EOI) || (defined(HAVE_DECL_KVM_EXIT_IOAPIC_EOI) && HAVE_DECL_KVM_EXIT_IOAPIC_EOI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_IOAPIC_EOI) == (26), "KVM_EXIT_IOAPIC_EOI != 26"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_IOAPIC_EOI 26 +#endif +#if defined(KVM_EXIT_HYPERV) || (defined(HAVE_DECL_KVM_EXIT_HYPERV) && HAVE_DECL_KVM_EXIT_HYPERV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_EXIT_HYPERV) == (27), "KVM_EXIT_HYPERV != 27"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_EXIT_HYPERV 27 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat kvm_exit_reason in mpers mode + +# else + +static +const struct xlat kvm_exit_reason[] = { + [KVM_EXIT_UNKNOWN] = XLAT(KVM_EXIT_UNKNOWN), + [KVM_EXIT_EXCEPTION] = XLAT(KVM_EXIT_EXCEPTION), + [KVM_EXIT_IO] = XLAT(KVM_EXIT_IO), + [KVM_EXIT_HYPERCALL] = XLAT(KVM_EXIT_HYPERCALL), + [KVM_EXIT_DEBUG] = XLAT(KVM_EXIT_DEBUG), + [KVM_EXIT_HLT] = XLAT(KVM_EXIT_HLT), + [KVM_EXIT_MMIO] = XLAT(KVM_EXIT_MMIO), + [KVM_EXIT_IRQ_WINDOW_OPEN] = XLAT(KVM_EXIT_IRQ_WINDOW_OPEN), + [KVM_EXIT_SHUTDOWN] = XLAT(KVM_EXIT_SHUTDOWN), + [KVM_EXIT_FAIL_ENTRY] = XLAT(KVM_EXIT_FAIL_ENTRY), + [KVM_EXIT_INTR] = XLAT(KVM_EXIT_INTR), + [KVM_EXIT_SET_TPR] = XLAT(KVM_EXIT_SET_TPR), + [KVM_EXIT_TPR_ACCESS] = XLAT(KVM_EXIT_TPR_ACCESS), + [KVM_EXIT_S390_SIEIC] = XLAT(KVM_EXIT_S390_SIEIC), + [KVM_EXIT_S390_RESET] = XLAT(KVM_EXIT_S390_RESET), + + [KVM_EXIT_DCR] = XLAT(KVM_EXIT_DCR), + [KVM_EXIT_NMI] = XLAT(KVM_EXIT_NMI), + [KVM_EXIT_INTERNAL_ERROR] = XLAT(KVM_EXIT_INTERNAL_ERROR), + [KVM_EXIT_OSI] = XLAT(KVM_EXIT_OSI), + [KVM_EXIT_PAPR_HCALL] = XLAT(KVM_EXIT_PAPR_HCALL), + [KVM_EXIT_S390_UCONTROL] = XLAT(KVM_EXIT_S390_UCONTROL), + [KVM_EXIT_WATCHDOG] = XLAT(KVM_EXIT_WATCHDOG), + [KVM_EXIT_S390_TSCH] = XLAT(KVM_EXIT_S390_TSCH), + [KVM_EXIT_EPR] = XLAT(KVM_EXIT_EPR), + [KVM_EXIT_SYSTEM_EVENT] = XLAT(KVM_EXIT_SYSTEM_EVENT), + [KVM_EXIT_S390_STSI] = XLAT(KVM_EXIT_S390_STSI), + [KVM_EXIT_IOAPIC_EOI] = XLAT(KVM_EXIT_IOAPIC_EOI), + [KVM_EXIT_HYPERV] = XLAT(KVM_EXIT_HYPERV), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/kvm_exit_reason.in b/xlat/kvm_exit_reason.in new file mode 100644 index 00000000..d2b24687 --- /dev/null +++ b/xlat/kvm_exit_reason.in @@ -0,0 +1,30 @@ +#value_indexed +KVM_EXIT_UNKNOWN 0 +KVM_EXIT_EXCEPTION 1 +KVM_EXIT_IO 2 +KVM_EXIT_HYPERCALL 3 +KVM_EXIT_DEBUG 4 +KVM_EXIT_HLT 5 +KVM_EXIT_MMIO 6 +KVM_EXIT_IRQ_WINDOW_OPEN 7 +KVM_EXIT_SHUTDOWN 8 +KVM_EXIT_FAIL_ENTRY 9 +KVM_EXIT_INTR 10 +KVM_EXIT_SET_TPR 11 +KVM_EXIT_TPR_ACCESS 12 +KVM_EXIT_S390_SIEIC 13 +KVM_EXIT_S390_RESET 14 +/* deprecated */ +KVM_EXIT_DCR 15 +KVM_EXIT_NMI 16 +KVM_EXIT_INTERNAL_ERROR 17 +KVM_EXIT_OSI 18 +KVM_EXIT_PAPR_HCALL 19 +KVM_EXIT_S390_UCONTROL 20 +KVM_EXIT_WATCHDOG 21 +KVM_EXIT_S390_TSCH 22 +KVM_EXIT_EPR 23 +KVM_EXIT_SYSTEM_EVENT 24 +KVM_EXIT_S390_STSI 25 +KVM_EXIT_IOAPIC_EOI 26 +KVM_EXIT_HYPERV 27 diff --git a/xlat/kvm_mem_flags.h b/xlat/kvm_mem_flags.h new file mode 100644 index 00000000..3598821c --- /dev/null +++ b/xlat/kvm_mem_flags.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/kvm_mem_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(KVM_MEM_LOG_DIRTY_PAGES) || (defined(HAVE_DECL_KVM_MEM_LOG_DIRTY_PAGES) && HAVE_DECL_KVM_MEM_LOG_DIRTY_PAGES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_MEM_LOG_DIRTY_PAGES) == ((1 << 0)), "KVM_MEM_LOG_DIRTY_PAGES != (1 << 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_MEM_LOG_DIRTY_PAGES (1 << 0) +#endif +#if defined(KVM_MEM_READONLY) || (defined(HAVE_DECL_KVM_MEM_READONLY) && HAVE_DECL_KVM_MEM_READONLY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KVM_MEM_READONLY) == ((1 << 1)), "KVM_MEM_READONLY != (1 << 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KVM_MEM_READONLY (1 << 1) +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat kvm_mem_flags in mpers mode + +# else + +static +const struct xlat kvm_mem_flags[] = { + XLAT(KVM_MEM_LOG_DIRTY_PAGES), + XLAT(KVM_MEM_READONLY), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/kvm_mem_flags.in b/xlat/kvm_mem_flags.in new file mode 100644 index 00000000..82b93ba7 --- /dev/null +++ b/xlat/kvm_mem_flags.in @@ -0,0 +1,2 @@ +KVM_MEM_LOG_DIRTY_PAGES (1 << 0) +KVM_MEM_READONLY (1 << 1) diff --git a/xlat/lockfcmds.h b/xlat/lockfcmds.h index 632c9cb7..da69625d 100644 --- a/xlat/lockfcmds.h +++ b/xlat/lockfcmds.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/lockfcmds.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat lockfcmds in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat lockfcmds in mpers mode + +# else static const struct xlat lockfcmds[] = { @@ -26,4 +32,6 @@ const struct xlat lockfcmds[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/loop_cmds.h b/xlat/loop_cmds.h index 258662d3..d0a9fa12 100644 --- a/xlat/loop_cmds.h +++ b/xlat/loop_cmds.h @@ -1,37 +1,128 @@ /* Generated by ./xlat/gen.sh from ./xlat/loop_cmds.in; do not edit. */ -#if !(defined(LOOP_SET_FD) || (defined(HAVE_DECL_LOOP_SET_FD) && HAVE_DECL_LOOP_SET_FD)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(LOOP_SET_FD) || (defined(HAVE_DECL_LOOP_SET_FD) && HAVE_DECL_LOOP_SET_FD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LOOP_SET_FD) == (0x4C00), "LOOP_SET_FD != 0x4C00"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LOOP_SET_FD 0x4C00 #endif -#if !(defined(LOOP_CLR_FD) || (defined(HAVE_DECL_LOOP_CLR_FD) && HAVE_DECL_LOOP_CLR_FD)) +#if defined(LOOP_CLR_FD) || (defined(HAVE_DECL_LOOP_CLR_FD) && HAVE_DECL_LOOP_CLR_FD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LOOP_CLR_FD) == (0x4C01), "LOOP_CLR_FD != 0x4C01"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LOOP_CLR_FD 0x4C01 #endif -#if !(defined(LOOP_SET_STATUS) || (defined(HAVE_DECL_LOOP_SET_STATUS) && HAVE_DECL_LOOP_SET_STATUS)) +#if defined(LOOP_SET_STATUS) || (defined(HAVE_DECL_LOOP_SET_STATUS) && HAVE_DECL_LOOP_SET_STATUS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LOOP_SET_STATUS) == (0x4C02), "LOOP_SET_STATUS != 0x4C02"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LOOP_SET_STATUS 0x4C02 #endif -#if !(defined(LOOP_GET_STATUS) || (defined(HAVE_DECL_LOOP_GET_STATUS) && HAVE_DECL_LOOP_GET_STATUS)) +#if defined(LOOP_GET_STATUS) || (defined(HAVE_DECL_LOOP_GET_STATUS) && HAVE_DECL_LOOP_GET_STATUS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LOOP_GET_STATUS) == (0x4C03), "LOOP_GET_STATUS != 0x4C03"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LOOP_GET_STATUS 0x4C03 #endif -#if !(defined(LOOP_SET_STATUS64) || (defined(HAVE_DECL_LOOP_SET_STATUS64) && HAVE_DECL_LOOP_SET_STATUS64)) +#if defined(LOOP_SET_STATUS64) || (defined(HAVE_DECL_LOOP_SET_STATUS64) && HAVE_DECL_LOOP_SET_STATUS64) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LOOP_SET_STATUS64) == (0x4C04), "LOOP_SET_STATUS64 != 0x4C04"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LOOP_SET_STATUS64 0x4C04 #endif -#if !(defined(LOOP_GET_STATUS64) || (defined(HAVE_DECL_LOOP_GET_STATUS64) && HAVE_DECL_LOOP_GET_STATUS64)) +#if defined(LOOP_GET_STATUS64) || (defined(HAVE_DECL_LOOP_GET_STATUS64) && HAVE_DECL_LOOP_GET_STATUS64) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LOOP_GET_STATUS64) == (0x4C05), "LOOP_GET_STATUS64 != 0x4C05"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LOOP_GET_STATUS64 0x4C05 #endif -#if !(defined(LOOP_CHANGE_FD) || (defined(HAVE_DECL_LOOP_CHANGE_FD) && HAVE_DECL_LOOP_CHANGE_FD)) +#if defined(LOOP_CHANGE_FD) || (defined(HAVE_DECL_LOOP_CHANGE_FD) && HAVE_DECL_LOOP_CHANGE_FD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LOOP_CHANGE_FD) == (0x4C06), "LOOP_CHANGE_FD != 0x4C06"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LOOP_CHANGE_FD 0x4C06 #endif -#if !(defined(LOOP_SET_CAPACITY) || (defined(HAVE_DECL_LOOP_SET_CAPACITY) && HAVE_DECL_LOOP_SET_CAPACITY)) +#if defined(LOOP_SET_CAPACITY) || (defined(HAVE_DECL_LOOP_SET_CAPACITY) && HAVE_DECL_LOOP_SET_CAPACITY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LOOP_SET_CAPACITY) == (0x4C07), "LOOP_SET_CAPACITY != 0x4C07"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LOOP_SET_CAPACITY 0x4C07 #endif -#if !(defined(LOOP_SET_DIRECT_IO) || (defined(HAVE_DECL_LOOP_SET_DIRECT_IO) && HAVE_DECL_LOOP_SET_DIRECT_IO)) +#if defined(LOOP_SET_DIRECT_IO) || (defined(HAVE_DECL_LOOP_SET_DIRECT_IO) && HAVE_DECL_LOOP_SET_DIRECT_IO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LOOP_SET_DIRECT_IO) == (0x4C08), "LOOP_SET_DIRECT_IO != 0x4C08"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LOOP_SET_DIRECT_IO 0x4C08 #endif -#if !(defined(LOOP_CTL_ADD) || (defined(HAVE_DECL_LOOP_CTL_ADD) && HAVE_DECL_LOOP_CTL_ADD)) +#if defined(LOOP_SET_BLOCK_SIZE) || (defined(HAVE_DECL_LOOP_SET_BLOCK_SIZE) && HAVE_DECL_LOOP_SET_BLOCK_SIZE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LOOP_SET_BLOCK_SIZE) == (0x4C09), "LOOP_SET_BLOCK_SIZE != 0x4C09"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LOOP_SET_BLOCK_SIZE 0x4C09 +#endif +#if defined(LOOP_CTL_ADD) || (defined(HAVE_DECL_LOOP_CTL_ADD) && HAVE_DECL_LOOP_CTL_ADD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LOOP_CTL_ADD) == (0x4C80), "LOOP_CTL_ADD != 0x4C80"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LOOP_CTL_ADD 0x4C80 #endif -#if !(defined(LOOP_CTL_REMOVE) || (defined(HAVE_DECL_LOOP_CTL_REMOVE) && HAVE_DECL_LOOP_CTL_REMOVE)) +#if defined(LOOP_CTL_REMOVE) || (defined(HAVE_DECL_LOOP_CTL_REMOVE) && HAVE_DECL_LOOP_CTL_REMOVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LOOP_CTL_REMOVE) == (0x4C81), "LOOP_CTL_REMOVE != 0x4C81"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LOOP_CTL_REMOVE 0x4C81 #endif -#if !(defined(LOOP_CTL_GET_FREE) || (defined(HAVE_DECL_LOOP_CTL_GET_FREE) && HAVE_DECL_LOOP_CTL_GET_FREE)) +#if defined(LOOP_CTL_GET_FREE) || (defined(HAVE_DECL_LOOP_CTL_GET_FREE) && HAVE_DECL_LOOP_CTL_GET_FREE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LOOP_CTL_GET_FREE) == (0x4C82), "LOOP_CTL_GET_FREE != 0x4C82"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LOOP_CTL_GET_FREE 0x4C82 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +extern const struct xlat loop_cmds[]; + +# else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat loop_cmds[] = { + XLAT(LOOP_SET_FD), + XLAT(LOOP_CLR_FD), + XLAT(LOOP_SET_STATUS), + XLAT(LOOP_GET_STATUS), + XLAT(LOOP_SET_STATUS64), + XLAT(LOOP_GET_STATUS64), + XLAT(LOOP_CHANGE_FD), + XLAT(LOOP_SET_CAPACITY), + XLAT(LOOP_SET_DIRECT_IO), + XLAT(LOOP_SET_BLOCK_SIZE), + XLAT(LOOP_CTL_ADD), + XLAT(LOOP_CTL_REMOVE), + XLAT(LOOP_CTL_GET_FREE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/loop_cmds.in b/xlat/loop_cmds.in index 6faca515..939fb480 100644 --- a/xlat/loop_cmds.in +++ b/xlat/loop_cmds.in @@ -7,7 +7,7 @@ LOOP_GET_STATUS64 0x4C05 LOOP_CHANGE_FD 0x4C06 LOOP_SET_CAPACITY 0x4C07 LOOP_SET_DIRECT_IO 0x4C08 +LOOP_SET_BLOCK_SIZE 0x4C09 LOOP_CTL_ADD 0x4C80 LOOP_CTL_REMOVE 0x4C81 LOOP_CTL_GET_FREE 0x4C82 -#stop diff --git a/xlat/loop_crypt_type_options.h b/xlat/loop_crypt_type_options.h index 478618bd..a08c6a74 100644 --- a/xlat/loop_crypt_type_options.h +++ b/xlat/loop_crypt_type_options.h @@ -1,14 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/loop_crypt_type_options.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat loop_crypt_type_options[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat loop_crypt_type_options[] = { #if defined(LO_CRYPT_NONE) || (defined(HAVE_DECL_LO_CRYPT_NONE) && HAVE_DECL_LO_CRYPT_NONE) XLAT(LO_CRYPT_NONE), @@ -43,4 +49,6 @@ const struct xlat loop_crypt_type_options[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/loop_flags_options.h b/xlat/loop_flags_options.h index 1e96f462..5af8dfc2 100644 --- a/xlat/loop_flags_options.h +++ b/xlat/loop_flags_options.h @@ -1,40 +1,68 @@ /* Generated by ./xlat/gen.sh from ./xlat/loop_flags_options.in; do not edit. */ -#if !(defined(LO_FLAGS_READ_ONLY) || (defined(HAVE_DECL_LO_FLAGS_READ_ONLY) && HAVE_DECL_LO_FLAGS_READ_ONLY)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(LO_FLAGS_READ_ONLY) || (defined(HAVE_DECL_LO_FLAGS_READ_ONLY) && HAVE_DECL_LO_FLAGS_READ_ONLY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LO_FLAGS_READ_ONLY) == (1), "LO_FLAGS_READ_ONLY != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LO_FLAGS_READ_ONLY 1 #endif -#if !(defined(LO_FLAGS_USE_AOPS) || (defined(HAVE_DECL_LO_FLAGS_USE_AOPS) && HAVE_DECL_LO_FLAGS_USE_AOPS)) +#if defined(LO_FLAGS_USE_AOPS) || (defined(HAVE_DECL_LO_FLAGS_USE_AOPS) && HAVE_DECL_LO_FLAGS_USE_AOPS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LO_FLAGS_USE_AOPS) == (2), "LO_FLAGS_USE_AOPS != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LO_FLAGS_USE_AOPS 2 #endif -#if !(defined(LO_FLAGS_AUTOCLEAR) || (defined(HAVE_DECL_LO_FLAGS_AUTOCLEAR) && HAVE_DECL_LO_FLAGS_AUTOCLEAR)) +#if defined(LO_FLAGS_AUTOCLEAR) || (defined(HAVE_DECL_LO_FLAGS_AUTOCLEAR) && HAVE_DECL_LO_FLAGS_AUTOCLEAR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LO_FLAGS_AUTOCLEAR) == (4), "LO_FLAGS_AUTOCLEAR != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LO_FLAGS_AUTOCLEAR 4 #endif -#if !(defined(LO_FLAGS_PARTSCAN) || (defined(HAVE_DECL_LO_FLAGS_PARTSCAN) && HAVE_DECL_LO_FLAGS_PARTSCAN)) +#if defined(LO_FLAGS_PARTSCAN) || (defined(HAVE_DECL_LO_FLAGS_PARTSCAN) && HAVE_DECL_LO_FLAGS_PARTSCAN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LO_FLAGS_PARTSCAN) == (8), "LO_FLAGS_PARTSCAN != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LO_FLAGS_PARTSCAN 8 #endif -#if !(defined(LO_FLAGS_DIRECT_IO) || (defined(HAVE_DECL_LO_FLAGS_DIRECT_IO) && HAVE_DECL_LO_FLAGS_DIRECT_IO)) +#if defined(LO_FLAGS_DIRECT_IO) || (defined(HAVE_DECL_LO_FLAGS_DIRECT_IO) && HAVE_DECL_LO_FLAGS_DIRECT_IO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LO_FLAGS_DIRECT_IO) == (16), "LO_FLAGS_DIRECT_IO != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define LO_FLAGS_DIRECT_IO 16 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat loop_flags_options[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat loop_flags_options[] = { XLAT(LO_FLAGS_READ_ONLY), -/* Added in v2.6.11-732-gf3f28e4, Removed in v3.2-rc1~49^2~5^2~3 */ + XLAT(LO_FLAGS_USE_AOPS), -/* Added in v2.6.25-rc1~758 */ + XLAT(LO_FLAGS_AUTOCLEAR), -/* Added in v3.2-rc1~48^2~7 */ + XLAT(LO_FLAGS_PARTSCAN), -/* Added in v4.4-rc1~133^2~22 */ + XLAT(LO_FLAGS_DIRECT_IO), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/lwtunnel_encap_types.h b/xlat/lwtunnel_encap_types.h new file mode 100644 index 00000000..f5f4c5f1 --- /dev/null +++ b/xlat/lwtunnel_encap_types.h @@ -0,0 +1,78 @@ +/* Generated by ./xlat/gen.sh from ./xlat/lwtunnel_encap_types.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(LWTUNNEL_ENCAP_NONE) || (defined(HAVE_DECL_LWTUNNEL_ENCAP_NONE) && HAVE_DECL_LWTUNNEL_ENCAP_NONE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LWTUNNEL_ENCAP_NONE) == (0), "LWTUNNEL_ENCAP_NONE != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LWTUNNEL_ENCAP_NONE 0 +#endif +#if defined(LWTUNNEL_ENCAP_MPLS) || (defined(HAVE_DECL_LWTUNNEL_ENCAP_MPLS) && HAVE_DECL_LWTUNNEL_ENCAP_MPLS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LWTUNNEL_ENCAP_MPLS) == (1), "LWTUNNEL_ENCAP_MPLS != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LWTUNNEL_ENCAP_MPLS 1 +#endif +#if defined(LWTUNNEL_ENCAP_IP) || (defined(HAVE_DECL_LWTUNNEL_ENCAP_IP) && HAVE_DECL_LWTUNNEL_ENCAP_IP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LWTUNNEL_ENCAP_IP) == (2), "LWTUNNEL_ENCAP_IP != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LWTUNNEL_ENCAP_IP 2 +#endif +#if defined(LWTUNNEL_ENCAP_ILA) || (defined(HAVE_DECL_LWTUNNEL_ENCAP_ILA) && HAVE_DECL_LWTUNNEL_ENCAP_ILA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LWTUNNEL_ENCAP_ILA) == (3), "LWTUNNEL_ENCAP_ILA != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LWTUNNEL_ENCAP_ILA 3 +#endif +#if defined(LWTUNNEL_ENCAP_IP6) || (defined(HAVE_DECL_LWTUNNEL_ENCAP_IP6) && HAVE_DECL_LWTUNNEL_ENCAP_IP6) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LWTUNNEL_ENCAP_IP6) == (4), "LWTUNNEL_ENCAP_IP6 != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LWTUNNEL_ENCAP_IP6 4 +#endif +#if defined(LWTUNNEL_ENCAP_SEG6) || (defined(HAVE_DECL_LWTUNNEL_ENCAP_SEG6) && HAVE_DECL_LWTUNNEL_ENCAP_SEG6) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LWTUNNEL_ENCAP_SEG6) == (5), "LWTUNNEL_ENCAP_SEG6 != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LWTUNNEL_ENCAP_SEG6 5 +#endif +#if defined(LWTUNNEL_ENCAP_BPF) || (defined(HAVE_DECL_LWTUNNEL_ENCAP_BPF) && HAVE_DECL_LWTUNNEL_ENCAP_BPF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LWTUNNEL_ENCAP_BPF) == (6), "LWTUNNEL_ENCAP_BPF != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LWTUNNEL_ENCAP_BPF 6 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat lwtunnel_encap_types in mpers mode + +# else + +static +const struct xlat lwtunnel_encap_types[] = { + XLAT(LWTUNNEL_ENCAP_NONE), + XLAT(LWTUNNEL_ENCAP_MPLS), + XLAT(LWTUNNEL_ENCAP_IP), + XLAT(LWTUNNEL_ENCAP_ILA), + XLAT(LWTUNNEL_ENCAP_IP6), + XLAT(LWTUNNEL_ENCAP_SEG6), + XLAT(LWTUNNEL_ENCAP_BPF), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/lwtunnel_encap_types.in b/xlat/lwtunnel_encap_types.in new file mode 100644 index 00000000..4654bd4a --- /dev/null +++ b/xlat/lwtunnel_encap_types.in @@ -0,0 +1,7 @@ +LWTUNNEL_ENCAP_NONE 0 +LWTUNNEL_ENCAP_MPLS 1 +LWTUNNEL_ENCAP_IP 2 +LWTUNNEL_ENCAP_ILA 3 +LWTUNNEL_ENCAP_IP6 4 +LWTUNNEL_ENCAP_SEG6 5 +LWTUNNEL_ENCAP_BPF 6 diff --git a/xlat/madvise_cmds.h b/xlat/madvise_cmds.h index 41aa3a55..c391c004 100644 --- a/xlat/madvise_cmds.h +++ b/xlat/madvise_cmds.h @@ -1,65 +1,320 @@ /* Generated by ./xlat/gen.sh from ./xlat/madvise_cmds.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat madvise_cmds in mpers mode - -#else - -static -const struct xlat madvise_cmds[] = { #if defined(MADV_NORMAL) || (defined(HAVE_DECL_MADV_NORMAL) && HAVE_DECL_MADV_NORMAL) - XLAT(MADV_NORMAL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_NORMAL) == (0), "MADV_NORMAL != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_NORMAL 0 #endif #if defined(MADV_RANDOM) || (defined(HAVE_DECL_MADV_RANDOM) && HAVE_DECL_MADV_RANDOM) - XLAT(MADV_RANDOM), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_RANDOM) == (1), "MADV_RANDOM != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_RANDOM 1 #endif #if defined(MADV_SEQUENTIAL) || (defined(HAVE_DECL_MADV_SEQUENTIAL) && HAVE_DECL_MADV_SEQUENTIAL) - XLAT(MADV_SEQUENTIAL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_SEQUENTIAL) == (2), "MADV_SEQUENTIAL != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_SEQUENTIAL 2 #endif #if defined(MADV_WILLNEED) || (defined(HAVE_DECL_MADV_WILLNEED) && HAVE_DECL_MADV_WILLNEED) - XLAT(MADV_WILLNEED), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_WILLNEED) == (3), "MADV_WILLNEED != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_WILLNEED 3 +#endif +#if defined __alpha__ +#if defined(MADV_DONTNEED) || (defined(HAVE_DECL_MADV_DONTNEED) && HAVE_DECL_MADV_DONTNEED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_DONTNEED) == (6), "MADV_DONTNEED != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_DONTNEED 6 #endif +#else #if defined(MADV_DONTNEED) || (defined(HAVE_DECL_MADV_DONTNEED) && HAVE_DECL_MADV_DONTNEED) - XLAT(MADV_DONTNEED), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_DONTNEED) == (4), "MADV_DONTNEED != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_DONTNEED 4 +#endif #endif #if defined(MADV_FREE) || (defined(HAVE_DECL_MADV_FREE) && HAVE_DECL_MADV_FREE) - XLAT(MADV_FREE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_FREE) == (8), "MADV_FREE != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_FREE 8 #endif #if defined(MADV_REMOVE) || (defined(HAVE_DECL_MADV_REMOVE) && HAVE_DECL_MADV_REMOVE) - XLAT(MADV_REMOVE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_REMOVE) == (9), "MADV_REMOVE != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_REMOVE 9 #endif #if defined(MADV_DONTFORK) || (defined(HAVE_DECL_MADV_DONTFORK) && HAVE_DECL_MADV_DONTFORK) - XLAT(MADV_DONTFORK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_DONTFORK) == (10), "MADV_DONTFORK != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_DONTFORK 10 #endif #if defined(MADV_DOFORK) || (defined(HAVE_DECL_MADV_DOFORK) && HAVE_DECL_MADV_DOFORK) - XLAT(MADV_DOFORK), -#endif -#if defined(MADV_HWPOISON) || (defined(HAVE_DECL_MADV_HWPOISON) && HAVE_DECL_MADV_HWPOISON) - XLAT(MADV_HWPOISON), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_DOFORK) == (11), "MADV_DOFORK != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_DOFORK 11 #endif -#if defined(MADV_SOFT_OFFLINE) || (defined(HAVE_DECL_MADV_SOFT_OFFLINE) && HAVE_DECL_MADV_SOFT_OFFLINE) - XLAT(MADV_SOFT_OFFLINE), +#if defined __hppa__ +#if defined(MADV_MERGEABLE) || (defined(HAVE_DECL_MADV_MERGEABLE) && HAVE_DECL_MADV_MERGEABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_MERGEABLE) == (65), "MADV_MERGEABLE != 65"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_MERGEABLE 65 #endif +#else #if defined(MADV_MERGEABLE) || (defined(HAVE_DECL_MADV_MERGEABLE) && HAVE_DECL_MADV_MERGEABLE) - XLAT(MADV_MERGEABLE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_MERGEABLE) == (12), "MADV_MERGEABLE != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_MERGEABLE 12 #endif +#endif +#if defined __hppa__ #if defined(MADV_UNMERGEABLE) || (defined(HAVE_DECL_MADV_UNMERGEABLE) && HAVE_DECL_MADV_UNMERGEABLE) - XLAT(MADV_UNMERGEABLE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_UNMERGEABLE) == (66), "MADV_UNMERGEABLE != 66"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_UNMERGEABLE 66 #endif +#else +#if defined(MADV_UNMERGEABLE) || (defined(HAVE_DECL_MADV_UNMERGEABLE) && HAVE_DECL_MADV_UNMERGEABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_UNMERGEABLE) == (13), "MADV_UNMERGEABLE != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_UNMERGEABLE 13 +#endif +#endif +#if defined __hppa__ +#if defined(MADV_HUGEPAGE) || (defined(HAVE_DECL_MADV_HUGEPAGE) && HAVE_DECL_MADV_HUGEPAGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_HUGEPAGE) == (67), "MADV_HUGEPAGE != 67"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_HUGEPAGE 67 +#endif +#else #if defined(MADV_HUGEPAGE) || (defined(HAVE_DECL_MADV_HUGEPAGE) && HAVE_DECL_MADV_HUGEPAGE) - XLAT(MADV_HUGEPAGE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_HUGEPAGE) == (14), "MADV_HUGEPAGE != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_HUGEPAGE 14 +#endif #endif +#if defined __hppa__ #if defined(MADV_NOHUGEPAGE) || (defined(HAVE_DECL_MADV_NOHUGEPAGE) && HAVE_DECL_MADV_NOHUGEPAGE) - XLAT(MADV_NOHUGEPAGE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_NOHUGEPAGE) == (68), "MADV_NOHUGEPAGE != 68"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_NOHUGEPAGE 68 +#endif +#else +#if defined(MADV_NOHUGEPAGE) || (defined(HAVE_DECL_MADV_NOHUGEPAGE) && HAVE_DECL_MADV_NOHUGEPAGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_NOHUGEPAGE) == (15), "MADV_NOHUGEPAGE != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_NOHUGEPAGE 15 +#endif +#endif +#if defined __hppa__ +#if defined(MADV_DONTDUMP) || (defined(HAVE_DECL_MADV_DONTDUMP) && HAVE_DECL_MADV_DONTDUMP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_DONTDUMP) == (69), "MADV_DONTDUMP != 69"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_DONTDUMP 69 #endif +#else #if defined(MADV_DONTDUMP) || (defined(HAVE_DECL_MADV_DONTDUMP) && HAVE_DECL_MADV_DONTDUMP) - XLAT(MADV_DONTDUMP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_DONTDUMP) == (16), "MADV_DONTDUMP != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_DONTDUMP 16 #endif +#endif +#if defined __hppa__ #if defined(MADV_DODUMP) || (defined(HAVE_DECL_MADV_DODUMP) && HAVE_DECL_MADV_DODUMP) - XLAT(MADV_DODUMP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_DODUMP) == (70), "MADV_DODUMP != 70"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_DODUMP 70 #endif +#else +#if defined(MADV_DODUMP) || (defined(HAVE_DECL_MADV_DODUMP) && HAVE_DECL_MADV_DODUMP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_DODUMP) == (17), "MADV_DODUMP != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_DODUMP 17 +#endif +#endif +#if defined __hppa__ +#if defined(MADV_WIPEONFORK) || (defined(HAVE_DECL_MADV_WIPEONFORK) && HAVE_DECL_MADV_WIPEONFORK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_WIPEONFORK) == (71), "MADV_WIPEONFORK != 71"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_WIPEONFORK 71 +#endif +#else +#if defined(MADV_WIPEONFORK) || (defined(HAVE_DECL_MADV_WIPEONFORK) && HAVE_DECL_MADV_WIPEONFORK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_WIPEONFORK) == (18), "MADV_WIPEONFORK != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_WIPEONFORK 18 +#endif +#endif +#if defined __hppa__ +#if defined(MADV_KEEPONFORK) || (defined(HAVE_DECL_MADV_KEEPONFORK) && HAVE_DECL_MADV_KEEPONFORK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_KEEPONFORK) == (72), "MADV_KEEPONFORK != 72"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_KEEPONFORK 72 +#endif +#else +#if defined(MADV_KEEPONFORK) || (defined(HAVE_DECL_MADV_KEEPONFORK) && HAVE_DECL_MADV_KEEPONFORK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_KEEPONFORK) == (19), "MADV_KEEPONFORK != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_KEEPONFORK 19 +#endif +#endif +#if defined(MADV_HWPOISON) || (defined(HAVE_DECL_MADV_HWPOISON) && HAVE_DECL_MADV_HWPOISON) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_HWPOISON) == (100), "MADV_HWPOISON != 100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_HWPOISON 100 +#endif +#if defined(MADV_SOFT_OFFLINE) || (defined(HAVE_DECL_MADV_SOFT_OFFLINE) && HAVE_DECL_MADV_SOFT_OFFLINE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MADV_SOFT_OFFLINE) == (101), "MADV_SOFT_OFFLINE != 101"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MADV_SOFT_OFFLINE 101 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat madvise_cmds in mpers mode + +# else + +static +const struct xlat madvise_cmds[] = { + + + XLAT(MADV_NORMAL), + + XLAT(MADV_RANDOM), + + XLAT(MADV_SEQUENTIAL), + + XLAT(MADV_WILLNEED), + +#if defined __alpha__ + XLAT(MADV_DONTNEED), +#else + XLAT(MADV_DONTNEED), +#endif + + XLAT(MADV_FREE), + + XLAT(MADV_REMOVE), + + XLAT(MADV_DONTFORK), + + XLAT(MADV_DOFORK), + +#if defined __hppa__ + XLAT(MADV_MERGEABLE), +#else + XLAT(MADV_MERGEABLE), +#endif + +#if defined __hppa__ + XLAT(MADV_UNMERGEABLE), +#else + XLAT(MADV_UNMERGEABLE), +#endif + +#if defined __hppa__ + XLAT(MADV_HUGEPAGE), +#else + XLAT(MADV_HUGEPAGE), +#endif + +#if defined __hppa__ + XLAT(MADV_NOHUGEPAGE), +#else + XLAT(MADV_NOHUGEPAGE), +#endif + +#if defined __hppa__ + XLAT(MADV_DONTDUMP), +#else + XLAT(MADV_DONTDUMP), +#endif + +#if defined __hppa__ + XLAT(MADV_DODUMP), +#else + XLAT(MADV_DODUMP), +#endif + +#if defined __hppa__ + XLAT(MADV_WIPEONFORK), +#else + XLAT(MADV_WIPEONFORK), +#endif + +#if defined __hppa__ + XLAT(MADV_KEEPONFORK), +#else + XLAT(MADV_KEEPONFORK), +#endif + + XLAT(MADV_HWPOISON), + + XLAT(MADV_SOFT_OFFLINE), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/madvise_cmds.in b/xlat/madvise_cmds.in index bf6b1da0..c836e360 100644 --- a/xlat/madvise_cmds.in +++ b/xlat/madvise_cmds.in @@ -1,17 +1,75 @@ -MADV_NORMAL -MADV_RANDOM -MADV_SEQUENTIAL -MADV_WILLNEED -MADV_DONTNEED -MADV_FREE -MADV_REMOVE -MADV_DONTFORK -MADV_DOFORK -MADV_HWPOISON -MADV_SOFT_OFFLINE -MADV_MERGEABLE -MADV_UNMERGEABLE -MADV_HUGEPAGE -MADV_NOHUGEPAGE -MADV_DONTDUMP -MADV_DODUMP +/* Generated by maint/gen_xlat_defs.sh -f 'd' -p 'MADV_' -c 'asm-generic/mman-common.h' -a 'asm/mman.h' */ + +MADV_NORMAL 0 + +MADV_RANDOM 1 + +MADV_SEQUENTIAL 2 + +MADV_WILLNEED 3 + +#if defined __alpha__ +MADV_DONTNEED 6 +#else +MADV_DONTNEED 4 +#endif + +MADV_FREE 8 + +MADV_REMOVE 9 + +MADV_DONTFORK 10 + +MADV_DOFORK 11 + +#if defined __hppa__ +MADV_MERGEABLE 65 +#else +MADV_MERGEABLE 12 +#endif + +#if defined __hppa__ +MADV_UNMERGEABLE 66 +#else +MADV_UNMERGEABLE 13 +#endif + +#if defined __hppa__ +MADV_HUGEPAGE 67 +#else +MADV_HUGEPAGE 14 +#endif + +#if defined __hppa__ +MADV_NOHUGEPAGE 68 +#else +MADV_NOHUGEPAGE 15 +#endif + +#if defined __hppa__ +MADV_DONTDUMP 69 +#else +MADV_DONTDUMP 16 +#endif + +#if defined __hppa__ +MADV_DODUMP 70 +#else +MADV_DODUMP 17 +#endif + +#if defined __hppa__ +MADV_WIPEONFORK 71 +#else +MADV_WIPEONFORK 18 +#endif + +#if defined __hppa__ +MADV_KEEPONFORK 72 +#else +MADV_KEEPONFORK 19 +#endif + +MADV_HWPOISON 100 + +MADV_SOFT_OFFLINE 101 diff --git a/xlat/mbindflags.h b/xlat/mbindflags.h index eb30ba10..ea4e1ecd 100644 --- a/xlat/mbindflags.h +++ b/xlat/mbindflags.h @@ -1,19 +1,37 @@ /* Generated by ./xlat/gen.sh from ./xlat/mbindflags.in; do not edit. */ -#if !(defined(MPOL_MF_STRICT) || (defined(HAVE_DECL_MPOL_MF_STRICT) && HAVE_DECL_MPOL_MF_STRICT)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(MPOL_MF_STRICT) || (defined(HAVE_DECL_MPOL_MF_STRICT) && HAVE_DECL_MPOL_MF_STRICT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MPOL_MF_STRICT) == (1), "MPOL_MF_STRICT != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MPOL_MF_STRICT 1 #endif -#if !(defined(MPOL_MF_MOVE) || (defined(HAVE_DECL_MPOL_MF_MOVE) && HAVE_DECL_MPOL_MF_MOVE)) +#if defined(MPOL_MF_MOVE) || (defined(HAVE_DECL_MPOL_MF_MOVE) && HAVE_DECL_MPOL_MF_MOVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MPOL_MF_MOVE) == (2), "MPOL_MF_MOVE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MPOL_MF_MOVE 2 #endif -#if !(defined(MPOL_MF_MOVE_ALL) || (defined(HAVE_DECL_MPOL_MF_MOVE_ALL) && HAVE_DECL_MPOL_MF_MOVE_ALL)) +#if defined(MPOL_MF_MOVE_ALL) || (defined(HAVE_DECL_MPOL_MF_MOVE_ALL) && HAVE_DECL_MPOL_MF_MOVE_ALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MPOL_MF_MOVE_ALL) == (4), "MPOL_MF_MOVE_ALL != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MPOL_MF_MOVE_ALL 4 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat mbindflags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat mbindflags in mpers mode + +# else static const struct xlat mbindflags[] = { @@ -23,4 +41,6 @@ const struct xlat mbindflags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/mctl_sync.h b/xlat/mctl_sync.h index 144f7f79..f70c693b 100644 --- a/xlat/mctl_sync.h +++ b/xlat/mctl_sync.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/mctl_sync.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat mctl_sync in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat mctl_sync in mpers mode + +# else static const struct xlat mctl_sync[] = { @@ -20,4 +26,6 @@ const struct xlat mctl_sync[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/mdb_flags.h b/xlat/mdb_flags.h new file mode 100644 index 00000000..15b066c3 --- /dev/null +++ b/xlat/mdb_flags.h @@ -0,0 +1,25 @@ +/* Generated by ./xlat/gen.sh from ./xlat/mdb_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat mdb_flags in mpers mode + +# else + +static +const struct xlat mdb_flags[] = { +#if defined(MDB_FLAGS_OFFLOAD) || (defined(HAVE_DECL_MDB_FLAGS_OFFLOAD) && HAVE_DECL_MDB_FLAGS_OFFLOAD) + XLAT(MDB_FLAGS_OFFLOAD), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/mdb_flags.in b/xlat/mdb_flags.in new file mode 100644 index 00000000..4c2f1ed3 --- /dev/null +++ b/xlat/mdb_flags.in @@ -0,0 +1 @@ +MDB_FLAGS_OFFLOAD diff --git a/xlat/mdb_states.h b/xlat/mdb_states.h new file mode 100644 index 00000000..f5ca3ed2 --- /dev/null +++ b/xlat/mdb_states.h @@ -0,0 +1,28 @@ +/* Generated by ./xlat/gen.sh from ./xlat/mdb_states.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat mdb_states in mpers mode + +# else + +static +const struct xlat mdb_states[] = { +#if defined(MDB_TEMPORARY) || (defined(HAVE_DECL_MDB_TEMPORARY) && HAVE_DECL_MDB_TEMPORARY) + XLAT(MDB_TEMPORARY), +#endif +#if defined(MDB_PERMANENT) || (defined(HAVE_DECL_MDB_PERMANENT) && HAVE_DECL_MDB_PERMANENT) + XLAT(MDB_PERMANENT), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/mdb_states.in b/xlat/mdb_states.in new file mode 100644 index 00000000..7a580b90 --- /dev/null +++ b/xlat/mdb_states.in @@ -0,0 +1,2 @@ +MDB_TEMPORARY +MDB_PERMANENT diff --git a/xlat/membarrier_cmds.h b/xlat/membarrier_cmds.h index 9d4d5187..71e29605 100644 --- a/xlat/membarrier_cmds.h +++ b/xlat/membarrier_cmds.h @@ -1,22 +1,86 @@ /* Generated by ./xlat/gen.sh from ./xlat/membarrier_cmds.in; do not edit. */ -#if !(defined(MEMBARRIER_CMD_QUERY) || (defined(HAVE_DECL_MEMBARRIER_CMD_QUERY) && HAVE_DECL_MEMBARRIER_CMD_QUERY)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(MEMBARRIER_CMD_QUERY) || (defined(HAVE_DECL_MEMBARRIER_CMD_QUERY) && HAVE_DECL_MEMBARRIER_CMD_QUERY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MEMBARRIER_CMD_QUERY) == (0), "MEMBARRIER_CMD_QUERY != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MEMBARRIER_CMD_QUERY 0 #endif -#if !(defined(MEMBARRIER_CMD_SHARED) || (defined(HAVE_DECL_MEMBARRIER_CMD_SHARED) && HAVE_DECL_MEMBARRIER_CMD_SHARED)) -# define MEMBARRIER_CMD_SHARED 1 +#if defined(MEMBARRIER_CMD_GLOBAL) || (defined(HAVE_DECL_MEMBARRIER_CMD_GLOBAL) && HAVE_DECL_MEMBARRIER_CMD_GLOBAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MEMBARRIER_CMD_GLOBAL) == (1 << 0), "MEMBARRIER_CMD_GLOBAL != 1 << 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MEMBARRIER_CMD_GLOBAL 1 << 0 +#endif +#if defined(MEMBARRIER_CMD_GLOBAL_EXPEDITED) || (defined(HAVE_DECL_MEMBARRIER_CMD_GLOBAL_EXPEDITED) && HAVE_DECL_MEMBARRIER_CMD_GLOBAL_EXPEDITED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MEMBARRIER_CMD_GLOBAL_EXPEDITED) == (1 << 1), "MEMBARRIER_CMD_GLOBAL_EXPEDITED != 1 << 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MEMBARRIER_CMD_GLOBAL_EXPEDITED 1 << 1 +#endif +#if defined(MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED) || (defined(HAVE_DECL_MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED) && HAVE_DECL_MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED) == (1 << 2), "MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED != 1 << 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED 1 << 2 +#endif +#if defined(MEMBARRIER_CMD_PRIVATE_EXPEDITED) || (defined(HAVE_DECL_MEMBARRIER_CMD_PRIVATE_EXPEDITED) && HAVE_DECL_MEMBARRIER_CMD_PRIVATE_EXPEDITED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MEMBARRIER_CMD_PRIVATE_EXPEDITED) == (1 << 3), "MEMBARRIER_CMD_PRIVATE_EXPEDITED != 1 << 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MEMBARRIER_CMD_PRIVATE_EXPEDITED 1 << 3 +#endif +#if defined(MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED) || (defined(HAVE_DECL_MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED) && HAVE_DECL_MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED) == (1 << 4), "MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED != 1 << 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED 1 << 4 +#endif +#if defined(MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE) || (defined(HAVE_DECL_MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE) && HAVE_DECL_MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE) == (1 << 5), "MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE != 1 << 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE 1 << 5 +#endif +#if defined(MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE) || (defined(HAVE_DECL_MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE) && HAVE_DECL_MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE) == (1 << 6), "MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE != 1 << 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE 1 << 6 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat membarrier_cmds in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat membarrier_cmds in mpers mode + +# else static const struct xlat membarrier_cmds[] = { XLAT(MEMBARRIER_CMD_QUERY), - XLAT(MEMBARRIER_CMD_SHARED), + XLAT(MEMBARRIER_CMD_GLOBAL), + XLAT(MEMBARRIER_CMD_GLOBAL_EXPEDITED), + XLAT(MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED), + XLAT(MEMBARRIER_CMD_PRIVATE_EXPEDITED), + XLAT(MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED), + XLAT(MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE), + XLAT(MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/membarrier_cmds.in b/xlat/membarrier_cmds.in index e087e8e3..284c7dad 100644 --- a/xlat/membarrier_cmds.in +++ b/xlat/membarrier_cmds.in @@ -1,2 +1,8 @@ -MEMBARRIER_CMD_QUERY 0 -MEMBARRIER_CMD_SHARED 1 +MEMBARRIER_CMD_QUERY 0 +MEMBARRIER_CMD_GLOBAL 1 << 0 +MEMBARRIER_CMD_GLOBAL_EXPEDITED 1 << 1 +MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED 1 << 2 +MEMBARRIER_CMD_PRIVATE_EXPEDITED 1 << 3 +MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED 1 << 4 +MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE 1 << 5 +MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE 1 << 6 diff --git a/xlat/memfd_create_flags.h b/xlat/memfd_create_flags.h index 9b760996..1fd77d18 100644 --- a/xlat/memfd_create_flags.h +++ b/xlat/memfd_create_flags.h @@ -1,22 +1,46 @@ /* Generated by ./xlat/gen.sh from ./xlat/memfd_create_flags.in; do not edit. */ -#if !(defined(MFD_CLOEXEC) || (defined(HAVE_DECL_MFD_CLOEXEC) && HAVE_DECL_MFD_CLOEXEC)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(MFD_CLOEXEC) || (defined(HAVE_DECL_MFD_CLOEXEC) && HAVE_DECL_MFD_CLOEXEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MFD_CLOEXEC) == (1), "MFD_CLOEXEC != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MFD_CLOEXEC 1 #endif -#if !(defined(MFD_ALLOW_SEALING) || (defined(HAVE_DECL_MFD_ALLOW_SEALING) && HAVE_DECL_MFD_ALLOW_SEALING)) +#if defined(MFD_ALLOW_SEALING) || (defined(HAVE_DECL_MFD_ALLOW_SEALING) && HAVE_DECL_MFD_ALLOW_SEALING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MFD_ALLOW_SEALING) == (2), "MFD_ALLOW_SEALING != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MFD_ALLOW_SEALING 2 #endif +#if defined(MFD_HUGETLB) || (defined(HAVE_DECL_MFD_HUGETLB) && HAVE_DECL_MFD_HUGETLB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MFD_HUGETLB) == (4), "MFD_HUGETLB != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MFD_HUGETLB 4 +#endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat memfd_create_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat memfd_create_flags in mpers mode + +# else static const struct xlat memfd_create_flags[] = { XLAT(MFD_CLOEXEC), XLAT(MFD_ALLOW_SEALING), + XLAT(MFD_HUGETLB), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/memfd_create_flags.in b/xlat/memfd_create_flags.in index 04a1b47a..9dd625fb 100644 --- a/xlat/memfd_create_flags.in +++ b/xlat/memfd_create_flags.in @@ -1,2 +1,3 @@ MFD_CLOEXEC 1 MFD_ALLOW_SEALING 2 +MFD_HUGETLB 4 diff --git a/xlat/mempolicyflags.h b/xlat/mempolicyflags.h index 38db13cc..a68fcecd 100644 --- a/xlat/mempolicyflags.h +++ b/xlat/mempolicyflags.h @@ -1,16 +1,30 @@ /* Generated by ./xlat/gen.sh from ./xlat/mempolicyflags.in; do not edit. */ -#if !(defined(MPOL_F_NODE) || (defined(HAVE_DECL_MPOL_F_NODE) && HAVE_DECL_MPOL_F_NODE)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(MPOL_F_NODE) || (defined(HAVE_DECL_MPOL_F_NODE) && HAVE_DECL_MPOL_F_NODE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MPOL_F_NODE) == (1), "MPOL_F_NODE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MPOL_F_NODE 1 #endif -#if !(defined(MPOL_F_ADDR) || (defined(HAVE_DECL_MPOL_F_ADDR) && HAVE_DECL_MPOL_F_ADDR)) +#if defined(MPOL_F_ADDR) || (defined(HAVE_DECL_MPOL_F_ADDR) && HAVE_DECL_MPOL_F_ADDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MPOL_F_ADDR) == (2), "MPOL_F_ADDR != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MPOL_F_ADDR 2 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat mempolicyflags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat mempolicyflags in mpers mode + +# else static const struct xlat mempolicyflags[] = { @@ -19,4 +33,6 @@ const struct xlat mempolicyflags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/mlock_flags.h b/xlat/mlock_flags.h index 9ec2e54b..f2ef3e4e 100644 --- a/xlat/mlock_flags.h +++ b/xlat/mlock_flags.h @@ -1,13 +1,23 @@ /* Generated by ./xlat/gen.sh from ./xlat/mlock_flags.in; do not edit. */ -#if !(defined(MLOCK_ONFAULT) || (defined(HAVE_DECL_MLOCK_ONFAULT) && HAVE_DECL_MLOCK_ONFAULT)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(MLOCK_ONFAULT) || (defined(HAVE_DECL_MLOCK_ONFAULT) && HAVE_DECL_MLOCK_ONFAULT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MLOCK_ONFAULT) == (1), "MLOCK_ONFAULT != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MLOCK_ONFAULT 1 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat mlock_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat mlock_flags in mpers mode + +# else static const struct xlat mlock_flags[] = { @@ -15,4 +25,6 @@ const struct xlat mlock_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/mlockall_flags.h b/xlat/mlockall_flags.h index c3fb08f8..718ce3f8 100644 --- a/xlat/mlockall_flags.h +++ b/xlat/mlockall_flags.h @@ -1,26 +1,76 @@ /* Generated by ./xlat/gen.sh from ./xlat/mlockall_flags.in; do not edit. */ -#if !(defined(MCL_CURRENT) || (defined(HAVE_DECL_MCL_CURRENT) && HAVE_DECL_MCL_CURRENT)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined __alpha__ || defined __powerpc__ || defined __powerpc64__ || defined __sparc__ +#if defined(MCL_CURRENT) || (defined(HAVE_DECL_MCL_CURRENT) && HAVE_DECL_MCL_CURRENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MCL_CURRENT) == (0x2000), "MCL_CURRENT != 0x2000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MCL_CURRENT 0x2000 +#endif +#if defined(MCL_FUTURE) || (defined(HAVE_DECL_MCL_FUTURE) && HAVE_DECL_MCL_FUTURE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MCL_FUTURE) == (0x4000), "MCL_FUTURE != 0x4000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MCL_FUTURE 0x4000 +#endif +#if defined(MCL_ONFAULT) || (defined(HAVE_DECL_MCL_ONFAULT) && HAVE_DECL_MCL_ONFAULT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MCL_ONFAULT) == (0x8000), "MCL_ONFAULT != 0x8000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MCL_ONFAULT 0x8000 +#endif +#else +#if defined(MCL_CURRENT) || (defined(HAVE_DECL_MCL_CURRENT) && HAVE_DECL_MCL_CURRENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MCL_CURRENT) == (1), "MCL_CURRENT != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MCL_CURRENT 1 #endif -#if !(defined(MCL_FUTURE) || (defined(HAVE_DECL_MCL_FUTURE) && HAVE_DECL_MCL_FUTURE)) +#if defined(MCL_FUTURE) || (defined(HAVE_DECL_MCL_FUTURE) && HAVE_DECL_MCL_FUTURE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MCL_FUTURE) == (2), "MCL_FUTURE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MCL_FUTURE 2 #endif -#if !(defined(MCL_ONFAULT) || (defined(HAVE_DECL_MCL_ONFAULT) && HAVE_DECL_MCL_ONFAULT)) +#if defined(MCL_ONFAULT) || (defined(HAVE_DECL_MCL_ONFAULT) && HAVE_DECL_MCL_ONFAULT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MCL_ONFAULT) == (4), "MCL_ONFAULT != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MCL_ONFAULT 4 #endif +#endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat mlockall_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat mlockall_flags in mpers mode + +# else static const struct xlat mlockall_flags[] = { +#if defined __alpha__ || defined __powerpc__ || defined __powerpc64__ || defined __sparc__ + XLAT(MCL_CURRENT), + XLAT(MCL_FUTURE), + XLAT(MCL_ONFAULT), +#else XLAT(MCL_CURRENT), XLAT(MCL_FUTURE), XLAT(MCL_ONFAULT), +#endif XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/mlockall_flags.in b/xlat/mlockall_flags.in index a39d7ba0..d9ad7afd 100644 --- a/xlat/mlockall_flags.in +++ b/xlat/mlockall_flags.in @@ -1,3 +1,9 @@ +#if defined __alpha__ || defined __powerpc__ || defined __powerpc64__ || defined __sparc__ +MCL_CURRENT 0x2000 +MCL_FUTURE 0x4000 +MCL_ONFAULT 0x8000 +#else MCL_CURRENT 1 MCL_FUTURE 2 MCL_ONFAULT 4 +#endif diff --git a/xlat/mmap_flags.h b/xlat/mmap_flags.h index 9ccc87e8..b82de094 100644 --- a/xlat/mmap_flags.h +++ b/xlat/mmap_flags.h @@ -1,119 +1,685 @@ /* Generated by ./xlat/gen.sh from ./xlat/mmap_flags.in; do not edit. */ -#if defined(MAP_ANON) && (!defined(MAP_ANONYMOUS) || MAP_ANON != MAP_ANONYMOUS) -#endif -#if defined MAP_UNINITIALIZED && MAP_UNINITIALIZED > 0 -#endif -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat mmap_flags in mpers mode - -#else - -static -const struct xlat mmap_flags[] = { #if defined(MAP_SHARED) || (defined(HAVE_DECL_MAP_SHARED) && HAVE_DECL_MAP_SHARED) - XLAT(MAP_SHARED), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_SHARED) == (0x1), "MAP_SHARED != 0x1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_SHARED 0x1 #endif #if defined(MAP_PRIVATE) || (defined(HAVE_DECL_MAP_PRIVATE) && HAVE_DECL_MAP_PRIVATE) - XLAT(MAP_PRIVATE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_PRIVATE) == (0x2), "MAP_PRIVATE != 0x2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_PRIVATE 0x2 +#endif +#if defined(MAP_SHARED_VALIDATE) || (defined(HAVE_DECL_MAP_SHARED_VALIDATE) && HAVE_DECL_MAP_SHARED_VALIDATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_SHARED_VALIDATE) == (0x3), "MAP_SHARED_VALIDATE != 0x3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_SHARED_VALIDATE 0x3 #endif +#if defined __hppa__ #if defined(MAP_FIXED) || (defined(HAVE_DECL_MAP_FIXED) && HAVE_DECL_MAP_FIXED) - XLAT(MAP_FIXED), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_FIXED) == (0x4), "MAP_FIXED != 0x4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_FIXED 0x4 #endif +#elif defined __alpha__ +#if defined(MAP_FIXED) || (defined(HAVE_DECL_MAP_FIXED) && HAVE_DECL_MAP_FIXED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_FIXED) == (0x100), "MAP_FIXED != 0x100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_FIXED 0x100 +#endif +#else +#if defined(MAP_FIXED) || (defined(HAVE_DECL_MAP_FIXED) && HAVE_DECL_MAP_FIXED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_FIXED) == (0x10), "MAP_FIXED != 0x10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_FIXED 0x10 +#endif +#endif +#if defined __alpha__ || defined __hppa__ #if defined(MAP_ANONYMOUS) || (defined(HAVE_DECL_MAP_ANONYMOUS) && HAVE_DECL_MAP_ANONYMOUS) - XLAT(MAP_ANONYMOUS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_ANONYMOUS) == (0x10), "MAP_ANONYMOUS != 0x10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_ANONYMOUS 0x10 #endif +#elif defined __mips__ || defined __xtensa__ +#if defined(MAP_ANONYMOUS) || (defined(HAVE_DECL_MAP_ANONYMOUS) && HAVE_DECL_MAP_ANONYMOUS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_ANONYMOUS) == (0x800), "MAP_ANONYMOUS != 0x800"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_ANONYMOUS 0x800 +#endif +#else +#if defined(MAP_ANONYMOUS) || (defined(HAVE_DECL_MAP_ANONYMOUS) && HAVE_DECL_MAP_ANONYMOUS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_ANONYMOUS) == (0x20), "MAP_ANONYMOUS != 0x20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_ANONYMOUS 0x20 +#endif +#endif +#if defined __x86_64__ || defined __i386__ #if defined(MAP_32BIT) || (defined(HAVE_DECL_MAP_32BIT) && HAVE_DECL_MAP_32BIT) - XLAT(MAP_32BIT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_32BIT) == (0x40), "MAP_32BIT != 0x40"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_32BIT 0x40 +#endif +#else +#endif +#if defined MAP_RENAME && MAP_RENAME == MAP_ANONYMOUS +# ifndef STRACE_WORKAROUND_FOR_MAP_RENAME +# define STRACE_WORKAROUND_FOR_MAP_RENAME +# undef MAP_RENAME +# endif #endif +#if defined __mips__ || defined __xtensa__ #if defined(MAP_RENAME) || (defined(HAVE_DECL_MAP_RENAME) && HAVE_DECL_MAP_RENAME) - XLAT(MAP_RENAME), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_RENAME) == (0x20), "MAP_RENAME != 0x20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_RENAME 0x20 #endif +#else +#endif +#if defined __powerpc__ || defined __sparc__ #if defined(MAP_NORESERVE) || (defined(HAVE_DECL_MAP_NORESERVE) && HAVE_DECL_MAP_NORESERVE) - XLAT(MAP_NORESERVE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_NORESERVE) == (0x40), "MAP_NORESERVE != 0x40"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_NORESERVE 0x40 +#endif +#elif defined __mips__ || defined __xtensa__ +#if defined(MAP_NORESERVE) || (defined(HAVE_DECL_MAP_NORESERVE) && HAVE_DECL_MAP_NORESERVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_NORESERVE) == (0x400), "MAP_NORESERVE != 0x400"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_NORESERVE 0x400 +#endif +#elif defined __alpha__ +#if defined(MAP_NORESERVE) || (defined(HAVE_DECL_MAP_NORESERVE) && HAVE_DECL_MAP_NORESERVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_NORESERVE) == (0x10000), "MAP_NORESERVE != 0x10000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_NORESERVE 0x10000 +#endif +#else +#if defined(MAP_NORESERVE) || (defined(HAVE_DECL_MAP_NORESERVE) && HAVE_DECL_MAP_NORESERVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_NORESERVE) == (0x4000), "MAP_NORESERVE != 0x4000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_NORESERVE 0x4000 +#endif +#endif +#if defined __hppa__ || defined __mips__ || defined __xtensa__ +#if defined(MAP_POPULATE) || (defined(HAVE_DECL_MAP_POPULATE) && HAVE_DECL_MAP_POPULATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_POPULATE) == (0x10000), "MAP_POPULATE != 0x10000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_POPULATE 0x10000 #endif +#elif defined __alpha__ #if defined(MAP_POPULATE) || (defined(HAVE_DECL_MAP_POPULATE) && HAVE_DECL_MAP_POPULATE) - XLAT(MAP_POPULATE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_POPULATE) == (0x20000), "MAP_POPULATE != 0x20000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_POPULATE 0x20000 #endif +#else +#if defined(MAP_POPULATE) || (defined(HAVE_DECL_MAP_POPULATE) && HAVE_DECL_MAP_POPULATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_POPULATE) == (0x8000), "MAP_POPULATE != 0x8000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_POPULATE 0x8000 +#endif +#endif +#if defined __hppa__ || defined __mips__ || defined __xtensa__ #if defined(MAP_NONBLOCK) || (defined(HAVE_DECL_MAP_NONBLOCK) && HAVE_DECL_MAP_NONBLOCK) - XLAT(MAP_NONBLOCK), -#endif -/* -* XXX - this was introduced in SunOS 4.x to distinguish between -* the old pre-4.x "mmap()", which: -* -* only let you map devices with an "mmap" routine (e.g., -* frame buffers) in; -* -* required you to specify the mapping address; -* -* returned 0 on success and -1 on failure; -* -* memory and which, and the 4.x "mmap()" which: -* -* can map plain files; -* -* can be asked to pick where to map the file; -* -* returns the address where it mapped the file on success -* and -1 on failure. -* -* It's not actually used in source code that calls "mmap()"; the -* "mmap()" routine adds it for you. -* -* It'd be nice to come up with some way of eliminating it from -* the flags, e.g. reporting calls *without* it as "old_mmap()" -* and calls with it as "mmap()". -*/ +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_NONBLOCK) == (0x20000), "MAP_NONBLOCK != 0x20000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_NONBLOCK 0x20000 +#endif +#elif defined __alpha__ +#if defined(MAP_NONBLOCK) || (defined(HAVE_DECL_MAP_NONBLOCK) && HAVE_DECL_MAP_NONBLOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_NONBLOCK) == (0x40000), "MAP_NONBLOCK != 0x40000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_NONBLOCK 0x40000 +#endif +#else +#if defined(MAP_NONBLOCK) || (defined(HAVE_DECL_MAP_NONBLOCK) && HAVE_DECL_MAP_NONBLOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_NONBLOCK) == (0x10000), "MAP_NONBLOCK != 0x10000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_NONBLOCK 0x10000 +#endif +#endif +#if defined __sparc__ #if defined(_MAP_NEW) || (defined(HAVE_DECL__MAP_NEW) && HAVE_DECL__MAP_NEW) - XLAT(_MAP_NEW), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((_MAP_NEW) == (0x80000000), "_MAP_NEW != 0x80000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define _MAP_NEW 0x80000000 +#endif +#else #endif +#if defined __sparc__ #if defined(MAP_GROWSDOWN) || (defined(HAVE_DECL_MAP_GROWSDOWN) && HAVE_DECL_MAP_GROWSDOWN) - XLAT(MAP_GROWSDOWN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_GROWSDOWN) == (0x200), "MAP_GROWSDOWN != 0x200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_GROWSDOWN 0x200 +#endif +#elif defined __alpha__ || defined __mips__ || defined __xtensa__ +#if defined(MAP_GROWSDOWN) || (defined(HAVE_DECL_MAP_GROWSDOWN) && HAVE_DECL_MAP_GROWSDOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_GROWSDOWN) == (0x1000), "MAP_GROWSDOWN != 0x1000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_GROWSDOWN 0x1000 +#endif +#elif defined __hppa__ +#if defined(MAP_GROWSDOWN) || (defined(HAVE_DECL_MAP_GROWSDOWN) && HAVE_DECL_MAP_GROWSDOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_GROWSDOWN) == (0x8000), "MAP_GROWSDOWN != 0x8000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_GROWSDOWN 0x8000 +#endif +#else +#if defined(MAP_GROWSDOWN) || (defined(HAVE_DECL_MAP_GROWSDOWN) && HAVE_DECL_MAP_GROWSDOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_GROWSDOWN) == (0x100), "MAP_GROWSDOWN != 0x100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_GROWSDOWN 0x100 +#endif #endif +#if defined __ia64__ +#if defined(MAP_GROWSUP) || (defined(HAVE_DECL_MAP_GROWSUP) && HAVE_DECL_MAP_GROWSUP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_GROWSUP) == (0x200), "MAP_GROWSUP != 0x200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_GROWSUP 0x200 +#endif +#else +#endif +#if defined __alpha__ || defined __mips__ || defined __xtensa__ #if defined(MAP_DENYWRITE) || (defined(HAVE_DECL_MAP_DENYWRITE) && HAVE_DECL_MAP_DENYWRITE) - XLAT(MAP_DENYWRITE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_DENYWRITE) == (0x2000), "MAP_DENYWRITE != 0x2000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_DENYWRITE 0x2000 +#endif +#else +#if defined(MAP_DENYWRITE) || (defined(HAVE_DECL_MAP_DENYWRITE) && HAVE_DECL_MAP_DENYWRITE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_DENYWRITE) == (0x800), "MAP_DENYWRITE != 0x800"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_DENYWRITE 0x800 #endif +#endif +#if defined __alpha__ || defined __mips__ || defined __xtensa__ +#if defined(MAP_EXECUTABLE) || (defined(HAVE_DECL_MAP_EXECUTABLE) && HAVE_DECL_MAP_EXECUTABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_EXECUTABLE) == (0x4000), "MAP_EXECUTABLE != 0x4000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_EXECUTABLE 0x4000 +#endif +#else #if defined(MAP_EXECUTABLE) || (defined(HAVE_DECL_MAP_EXECUTABLE) && HAVE_DECL_MAP_EXECUTABLE) - XLAT(MAP_EXECUTABLE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_EXECUTABLE) == (0x1000), "MAP_EXECUTABLE != 0x1000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_EXECUTABLE 0x1000 #endif +#endif +#if defined __sparc__ #if defined(MAP_INHERIT) || (defined(HAVE_DECL_MAP_INHERIT) && HAVE_DECL_MAP_INHERIT) - XLAT(MAP_INHERIT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_INHERIT) == (0x80), "MAP_INHERIT != 0x80"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_INHERIT 0x80 +#endif +#else +#endif +#if defined __alpha__ +#if defined(_MAP_INHERIT) || (defined(HAVE_DECL__MAP_INHERIT) && HAVE_DECL__MAP_INHERIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((_MAP_INHERIT) == (0x400), "_MAP_INHERIT != 0x400"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define _MAP_INHERIT 0x400 +#endif +#else #endif #if defined(MAP_FILE) || (defined(HAVE_DECL_MAP_FILE) && HAVE_DECL_MAP_FILE) - XLAT(MAP_FILE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_FILE) == (0), "MAP_FILE != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_FILE 0 +#endif +#if defined __powerpc__ +#if defined(MAP_LOCKED) || (defined(HAVE_DECL_MAP_LOCKED) && HAVE_DECL_MAP_LOCKED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_LOCKED) == (0x80), "MAP_LOCKED != 0x80"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_LOCKED 0x80 +#endif +#elif defined __sparc__ +#if defined(MAP_LOCKED) || (defined(HAVE_DECL_MAP_LOCKED) && HAVE_DECL_MAP_LOCKED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_LOCKED) == (0x100), "MAP_LOCKED != 0x100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_LOCKED 0x100 +#endif +#elif defined __alpha__ || defined __mips__ || defined __xtensa__ +#if defined(MAP_LOCKED) || (defined(HAVE_DECL_MAP_LOCKED) && HAVE_DECL_MAP_LOCKED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_LOCKED) == (0x8000), "MAP_LOCKED != 0x8000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_LOCKED 0x8000 #endif +#else #if defined(MAP_LOCKED) || (defined(HAVE_DECL_MAP_LOCKED) && HAVE_DECL_MAP_LOCKED) - XLAT(MAP_LOCKED), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_LOCKED) == (0x2000), "MAP_LOCKED != 0x2000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_LOCKED 0x2000 #endif -/* FreeBSD ones */ -#if defined(MAP_ANON) && (!defined(MAP_ANONYMOUS) || MAP_ANON != MAP_ANONYMOUS) -#if defined(MAP_ANON) || (defined(HAVE_DECL_MAP_ANON) && HAVE_DECL_MAP_ANON) - XLAT(MAP_ANON), #endif +#if defined __alpha__ +#if defined(_MAP_HASSEMAPHORE) || (defined(HAVE_DECL__MAP_HASSEMAPHORE) && HAVE_DECL__MAP_HASSEMAPHORE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((_MAP_HASSEMAPHORE) == (0x200), "_MAP_HASSEMAPHORE != 0x200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define _MAP_HASSEMAPHORE 0x200 #endif -#if defined(MAP_HASSEMAPHORE) || (defined(HAVE_DECL_MAP_HASSEMAPHORE) && HAVE_DECL_MAP_HASSEMAPHORE) - XLAT(MAP_HASSEMAPHORE), +#else #endif +#if defined __hppa__ || defined __mips__ || defined __xtensa__ #if defined(MAP_STACK) || (defined(HAVE_DECL_MAP_STACK) && HAVE_DECL_MAP_STACK) - XLAT(MAP_STACK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_STACK) == (0x40000), "MAP_STACK != 0x40000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_STACK 0x40000 #endif +#elif defined __alpha__ +#if defined(MAP_STACK) || (defined(HAVE_DECL_MAP_STACK) && HAVE_DECL_MAP_STACK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_STACK) == (0x80000), "MAP_STACK != 0x80000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_STACK 0x80000 +#endif +#else +#if defined(MAP_STACK) || (defined(HAVE_DECL_MAP_STACK) && HAVE_DECL_MAP_STACK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_STACK) == (0x20000), "MAP_STACK != 0x20000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_STACK 0x20000 +#endif +#endif +#if defined __hppa__ || defined __mips__ || defined __xtensa__ #if defined(MAP_HUGETLB) || (defined(HAVE_DECL_MAP_HUGETLB) && HAVE_DECL_MAP_HUGETLB) - XLAT(MAP_HUGETLB), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_HUGETLB) == (0x80000), "MAP_HUGETLB != 0x80000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_HUGETLB 0x80000 +#endif +#elif defined __alpha__ +#if defined(MAP_HUGETLB) || (defined(HAVE_DECL_MAP_HUGETLB) && HAVE_DECL_MAP_HUGETLB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_HUGETLB) == (0x100000), "MAP_HUGETLB != 0x100000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_HUGETLB 0x100000 #endif +#else +#if defined(MAP_HUGETLB) || (defined(HAVE_DECL_MAP_HUGETLB) && HAVE_DECL_MAP_HUGETLB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_HUGETLB) == (0x40000), "MAP_HUGETLB != 0x40000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_HUGETLB 0x40000 +#endif +#endif +#if defined(MAP_SYNC) || (defined(HAVE_DECL_MAP_SYNC) && HAVE_DECL_MAP_SYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_SYNC) == (0x80000), "MAP_SYNC != 0x80000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_SYNC 0x80000 +#endif +#if defined MAP_UNINITIALIZED && MAP_UNINITIALIZED > 0 +#endif +#if defined __alpha__ +#if defined(MAP_FIXED_NOREPLACE) || (defined(HAVE_DECL_MAP_FIXED_NOREPLACE) && HAVE_DECL_MAP_FIXED_NOREPLACE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_FIXED_NOREPLACE) == (0x200000), "MAP_FIXED_NOREPLACE != 0x200000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_FIXED_NOREPLACE 0x200000 +#endif +#else +#if defined(MAP_FIXED_NOREPLACE) || (defined(HAVE_DECL_MAP_FIXED_NOREPLACE) && HAVE_DECL_MAP_FIXED_NOREPLACE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_FIXED_NOREPLACE) == (0x100000), "MAP_FIXED_NOREPLACE != 0x100000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_FIXED_NOREPLACE 0x100000 +#endif +#endif +#if defined __mips__ || defined __xtensa__ +#if defined(MAP_AUTOGROW) || (defined(HAVE_DECL_MAP_AUTOGROW) && HAVE_DECL_MAP_AUTOGROW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_AUTOGROW) == (0x40), "MAP_AUTOGROW != 0x40"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_AUTOGROW 0x40 +#endif +#else +#endif +#if defined __mips__ || defined __xtensa__ +#if defined(MAP_AUTORSRV) || (defined(HAVE_DECL_MAP_AUTORSRV) && HAVE_DECL_MAP_AUTORSRV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_AUTORSRV) == (0x100), "MAP_AUTORSRV != 0x100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_AUTORSRV 0x100 +#endif +#else +#endif +#if defined __mips__ || defined __xtensa__ +#if defined(MAP_LOCAL) || (defined(HAVE_DECL_MAP_LOCAL) && HAVE_DECL_MAP_LOCAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MAP_LOCAL) == (0x80), "MAP_LOCAL != 0x80"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MAP_LOCAL 0x80 +#endif +#else +#endif +#if defined __alpha__ +#if defined(_MAP_UNALIGNED) || (defined(HAVE_DECL__MAP_UNALIGNED) && HAVE_DECL__MAP_UNALIGNED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((_MAP_UNALIGNED) == (0x800), "_MAP_UNALIGNED != 0x800"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define _MAP_UNALIGNED 0x800 +#endif +#else +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat mmap_flags in mpers mode + +# else + +static +const struct xlat mmap_flags[] = { + + + XLAT(MAP_SHARED), + + XLAT(MAP_PRIVATE), + + XLAT(MAP_SHARED_VALIDATE), + +#if defined __hppa__ + XLAT(MAP_FIXED), +#elif defined __alpha__ + XLAT(MAP_FIXED), +#else + XLAT(MAP_FIXED), +#endif + +#if defined __alpha__ || defined __hppa__ + XLAT(MAP_ANONYMOUS), +#elif defined __mips__ || defined __xtensa__ + XLAT(MAP_ANONYMOUS), +#else + XLAT(MAP_ANONYMOUS), +#endif + +#if defined __x86_64__ || defined __i386__ + XLAT(MAP_32BIT), +#else +#if defined(MAP_32BIT) || (defined(HAVE_DECL_MAP_32BIT) && HAVE_DECL_MAP_32BIT) + XLAT(MAP_32BIT), +#endif +#endif + +#if defined MAP_RENAME && MAP_RENAME == MAP_ANONYMOUS +# ifndef STRACE_WORKAROUND_FOR_MAP_RENAME +# define STRACE_WORKAROUND_FOR_MAP_RENAME + + +# undef MAP_RENAME +# endif +#endif + +#if defined __mips__ || defined __xtensa__ + XLAT(MAP_RENAME), +#else +#if defined(MAP_RENAME) || (defined(HAVE_DECL_MAP_RENAME) && HAVE_DECL_MAP_RENAME) + XLAT(MAP_RENAME), +#endif +#endif + +#if defined __powerpc__ || defined __sparc__ + XLAT(MAP_NORESERVE), +#elif defined __mips__ || defined __xtensa__ + XLAT(MAP_NORESERVE), +#elif defined __alpha__ + XLAT(MAP_NORESERVE), +#else + XLAT(MAP_NORESERVE), +#endif + +#if defined __hppa__ || defined __mips__ || defined __xtensa__ + XLAT(MAP_POPULATE), +#elif defined __alpha__ + XLAT(MAP_POPULATE), +#else + XLAT(MAP_POPULATE), +#endif + +#if defined __hppa__ || defined __mips__ || defined __xtensa__ + XLAT(MAP_NONBLOCK), +#elif defined __alpha__ + XLAT(MAP_NONBLOCK), +#else + XLAT(MAP_NONBLOCK), +#endif + +#if defined __sparc__ + XLAT(_MAP_NEW), +#else +#if defined(_MAP_NEW) || (defined(HAVE_DECL__MAP_NEW) && HAVE_DECL__MAP_NEW) + XLAT(_MAP_NEW), +#endif +#endif + +#if defined __sparc__ + XLAT(MAP_GROWSDOWN), +#elif defined __alpha__ || defined __mips__ || defined __xtensa__ + XLAT(MAP_GROWSDOWN), +#elif defined __hppa__ + XLAT(MAP_GROWSDOWN), +#else + XLAT(MAP_GROWSDOWN), +#endif + +#if defined __ia64__ + XLAT(MAP_GROWSUP), +#else +#if defined(MAP_GROWSUP) || (defined(HAVE_DECL_MAP_GROWSUP) && HAVE_DECL_MAP_GROWSUP) + XLAT(MAP_GROWSUP), +#endif +#endif + +#if defined __alpha__ || defined __mips__ || defined __xtensa__ + XLAT(MAP_DENYWRITE), +#else + XLAT(MAP_DENYWRITE), +#endif + +#if defined __alpha__ || defined __mips__ || defined __xtensa__ + XLAT(MAP_EXECUTABLE), +#else + XLAT(MAP_EXECUTABLE), +#endif + +#if defined __sparc__ + XLAT(MAP_INHERIT), +#else +#if defined(MAP_INHERIT) || (defined(HAVE_DECL_MAP_INHERIT) && HAVE_DECL_MAP_INHERIT) + XLAT(MAP_INHERIT), +#endif +#endif + +#if defined __alpha__ + XLAT(_MAP_INHERIT), +#else +#if defined(_MAP_INHERIT) || (defined(HAVE_DECL__MAP_INHERIT) && HAVE_DECL__MAP_INHERIT) + XLAT(_MAP_INHERIT), +#endif +#endif + + XLAT(MAP_FILE), + +#if defined __powerpc__ + XLAT(MAP_LOCKED), +#elif defined __sparc__ + XLAT(MAP_LOCKED), +#elif defined __alpha__ || defined __mips__ || defined __xtensa__ + XLAT(MAP_LOCKED), +#else + XLAT(MAP_LOCKED), +#endif + +#if defined __alpha__ + XLAT(_MAP_HASSEMAPHORE), +#else +#if defined(_MAP_HASSEMAPHORE) || (defined(HAVE_DECL__MAP_HASSEMAPHORE) && HAVE_DECL__MAP_HASSEMAPHORE) + XLAT(_MAP_HASSEMAPHORE), +#endif +#endif + +#if defined __hppa__ || defined __mips__ || defined __xtensa__ + XLAT(MAP_STACK), +#elif defined __alpha__ + XLAT(MAP_STACK), +#else + XLAT(MAP_STACK), +#endif + +#if defined __hppa__ || defined __mips__ || defined __xtensa__ + XLAT(MAP_HUGETLB), +#elif defined __alpha__ + XLAT(MAP_HUGETLB), +#else + XLAT(MAP_HUGETLB), +#endif + + XLAT(MAP_SYNC), + #if defined MAP_UNINITIALIZED && MAP_UNINITIALIZED > 0 #if defined(MAP_UNINITIALIZED) || (defined(HAVE_DECL_MAP_UNINITIALIZED) && HAVE_DECL_MAP_UNINITIALIZED) XLAT(MAP_UNINITIALIZED), #endif #endif -#if defined(MAP_NOSYNC) || (defined(HAVE_DECL_MAP_NOSYNC) && HAVE_DECL_MAP_NOSYNC) - XLAT(MAP_NOSYNC), + +#if defined __alpha__ + XLAT(MAP_FIXED_NOREPLACE), +#else + XLAT(MAP_FIXED_NOREPLACE), +#endif + +#if defined __mips__ || defined __xtensa__ + XLAT(MAP_AUTOGROW), +#else +#if defined(MAP_AUTOGROW) || (defined(HAVE_DECL_MAP_AUTOGROW) && HAVE_DECL_MAP_AUTOGROW) + XLAT(MAP_AUTOGROW), +#endif +#endif + +#if defined __mips__ || defined __xtensa__ + XLAT(MAP_AUTORSRV), +#else +#if defined(MAP_AUTORSRV) || (defined(HAVE_DECL_MAP_AUTORSRV) && HAVE_DECL_MAP_AUTORSRV) + XLAT(MAP_AUTORSRV), +#endif +#endif + +#if defined __mips__ || defined __xtensa__ + XLAT(MAP_LOCAL), +#else +#if defined(MAP_LOCAL) || (defined(HAVE_DECL_MAP_LOCAL) && HAVE_DECL_MAP_LOCAL) + XLAT(MAP_LOCAL), +#endif +#endif + +#if defined __alpha__ + XLAT(_MAP_UNALIGNED), +#else +#if defined(_MAP_UNALIGNED) || (defined(HAVE_DECL__MAP_UNALIGNED) && HAVE_DECL__MAP_UNALIGNED) + XLAT(_MAP_UNALIGNED), #endif -#if defined(MAP_NOCORE) || (defined(HAVE_DECL_MAP_NOCORE) && HAVE_DECL_MAP_NOCORE) - XLAT(MAP_NOCORE), #endif XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/mmap_flags.in b/xlat/mmap_flags.in index e9fde440..5a592494 100644 --- a/xlat/mmap_flags.in +++ b/xlat/mmap_flags.in @@ -1,55 +1,186 @@ -MAP_SHARED -MAP_PRIVATE -MAP_FIXED -MAP_ANONYMOUS +/* Generated by maint/gen_xlat_defs.sh -f '#x' -p '_?MAP_' -c 'asm-generic/mman*.h' -a 'asm/mman.h' */ + +MAP_SHARED 0x1 + +MAP_PRIVATE 0x2 + +MAP_SHARED_VALIDATE 0x3 + +#if defined __hppa__ +MAP_FIXED 0x4 +#elif defined __alpha__ +MAP_FIXED 0x100 +#else +MAP_FIXED 0x10 +#endif + +#if defined __alpha__ || defined __hppa__ +MAP_ANONYMOUS 0x10 +#elif defined __mips__ || defined __xtensa__ +MAP_ANONYMOUS 0x800 +#else +MAP_ANONYMOUS 0x20 +#endif + +#if defined __x86_64__ || defined __i386__ +MAP_32BIT 0x40 +#else MAP_32BIT +#endif + +#if defined MAP_RENAME && MAP_RENAME == MAP_ANONYMOUS /* MAP_RENAME is unusual */ +# ifndef STRACE_WORKAROUND_FOR_MAP_RENAME +# define STRACE_WORKAROUND_FOR_MAP_RENAME +/* glibc erroneously defines MAP_RENAME to MAP_ANONYMOUS on some architectures. */ +/* This is just wrong and has to be fixed. */ +# undef MAP_RENAME +# endif +#endif /* MAP_RENAME */ + +#if defined __mips__ || defined __xtensa__ +MAP_RENAME 0x20 +#else MAP_RENAME -MAP_NORESERVE -MAP_POPULATE -MAP_NONBLOCK -/* - * XXX - this was introduced in SunOS 4.x to distinguish between - * the old pre-4.x "mmap()", which: - * - * only let you map devices with an "mmap" routine (e.g., - * frame buffers) in; - * - * required you to specify the mapping address; - * - * returned 0 on success and -1 on failure; - * - * memory and which, and the 4.x "mmap()" which: - * - * can map plain files; - * - * can be asked to pick where to map the file; - * - * returns the address where it mapped the file on success - * and -1 on failure. - * - * It's not actually used in source code that calls "mmap()"; the - * "mmap()" routine adds it for you. - * - * It'd be nice to come up with some way of eliminating it from - * the flags, e.g. reporting calls *without* it as "old_mmap()" - * and calls with it as "mmap()". - */ +#endif + +#if defined __powerpc__ || defined __sparc__ +MAP_NORESERVE 0x40 +#elif defined __mips__ || defined __xtensa__ +MAP_NORESERVE 0x400 +#elif defined __alpha__ +MAP_NORESERVE 0x10000 +#else +MAP_NORESERVE 0x4000 +#endif + +#if defined __hppa__ || defined __mips__ || defined __xtensa__ +MAP_POPULATE 0x10000 +#elif defined __alpha__ +MAP_POPULATE 0x20000 +#else +MAP_POPULATE 0x8000 +#endif + +#if defined __hppa__ || defined __mips__ || defined __xtensa__ +MAP_NONBLOCK 0x20000 +#elif defined __alpha__ +MAP_NONBLOCK 0x40000 +#else +MAP_NONBLOCK 0x10000 +#endif + +#if defined __sparc__ +_MAP_NEW 0x80000000 +#else _MAP_NEW -MAP_GROWSDOWN -MAP_DENYWRITE -MAP_EXECUTABLE +#endif + +#if defined __sparc__ +MAP_GROWSDOWN 0x200 +#elif defined __alpha__ || defined __mips__ || defined __xtensa__ +MAP_GROWSDOWN 0x1000 +#elif defined __hppa__ +MAP_GROWSDOWN 0x8000 +#else +MAP_GROWSDOWN 0x100 +#endif + +#if defined __ia64__ +MAP_GROWSUP 0x200 +#else +MAP_GROWSUP +#endif + +#if defined __alpha__ || defined __mips__ || defined __xtensa__ +MAP_DENYWRITE 0x2000 +#else +MAP_DENYWRITE 0x800 +#endif + +#if defined __alpha__ || defined __mips__ || defined __xtensa__ +MAP_EXECUTABLE 0x4000 +#else +MAP_EXECUTABLE 0x1000 +#endif + +#if defined __sparc__ +MAP_INHERIT 0x80 +#else MAP_INHERIT -MAP_FILE -MAP_LOCKED -/* FreeBSD ones */ -#if defined(MAP_ANON) && (!defined(MAP_ANONYMOUS) || MAP_ANON != MAP_ANONYMOUS) -MAP_ANON -#endif -MAP_HASSEMAPHORE -MAP_STACK -MAP_HUGETLB +#endif + +#if defined __alpha__ +_MAP_INHERIT 0x400 +#else +_MAP_INHERIT +#endif + +MAP_FILE 0 + +#if defined __powerpc__ +MAP_LOCKED 0x80 +#elif defined __sparc__ +MAP_LOCKED 0x100 +#elif defined __alpha__ || defined __mips__ || defined __xtensa__ +MAP_LOCKED 0x8000 +#else +MAP_LOCKED 0x2000 +#endif + +#if defined __alpha__ +_MAP_HASSEMAPHORE 0x200 +#else +_MAP_HASSEMAPHORE +#endif + +#if defined __hppa__ || defined __mips__ || defined __xtensa__ +MAP_STACK 0x40000 +#elif defined __alpha__ +MAP_STACK 0x80000 +#else +MAP_STACK 0x20000 +#endif + +#if defined __hppa__ || defined __mips__ || defined __xtensa__ +MAP_HUGETLB 0x80000 +#elif defined __alpha__ +MAP_HUGETLB 0x100000 +#else +MAP_HUGETLB 0x40000 +#endif + +MAP_SYNC 0x80000 + #if defined MAP_UNINITIALIZED && MAP_UNINITIALIZED > 0 MAP_UNINITIALIZED #endif -MAP_NOSYNC -MAP_NOCORE + +#if defined __alpha__ +MAP_FIXED_NOREPLACE 0x200000 +#else +MAP_FIXED_NOREPLACE 0x100000 +#endif + +#if defined __mips__ || defined __xtensa__ +MAP_AUTOGROW 0x40 +#else +MAP_AUTOGROW +#endif + +#if defined __mips__ || defined __xtensa__ +MAP_AUTORSRV 0x100 +#else +MAP_AUTORSRV +#endif + +#if defined __mips__ || defined __xtensa__ +MAP_LOCAL 0x80 +#else +MAP_LOCAL +#endif + +#if defined __alpha__ +_MAP_UNALIGNED 0x800 +#else +_MAP_UNALIGNED +#endif diff --git a/xlat/mmap_prot.h b/xlat/mmap_prot.h index 0ff04eb9..310e7f1e 100644 --- a/xlat/mmap_prot.h +++ b/xlat/mmap_prot.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/mmap_prot.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat mmap_prot in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat mmap_prot in mpers mode + +# else static const struct xlat mmap_prot[] = { @@ -31,8 +37,13 @@ const struct xlat mmap_prot[] = { #endif #if defined(PROT_SAO) || (defined(HAVE_DECL_PROT_SAO) && HAVE_DECL_PROT_SAO) XLAT(PROT_SAO), +#endif +#if defined(PROT_ADI) || (defined(HAVE_DECL_PROT_ADI) && HAVE_DECL_PROT_ADI) + XLAT(PROT_ADI), #endif XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/mmap_prot.in b/xlat/mmap_prot.in index 05899804..e99ec297 100644 --- a/xlat/mmap_prot.in +++ b/xlat/mmap_prot.in @@ -6,3 +6,4 @@ PROT_SEM PROT_GROWSDOWN PROT_GROWSUP PROT_SAO +PROT_ADI diff --git a/xlat/modem_flags.h b/xlat/modem_flags.h index f1719755..322ff11a 100644 --- a/xlat/modem_flags.h +++ b/xlat/modem_flags.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/modem_flags.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat modem_flags in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat modem_flags in mpers mode + +# else static const struct xlat modem_flags[] = { @@ -44,4 +50,6 @@ const struct xlat modem_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/modetypes.h b/xlat/modetypes.h index 70d1868e..94bd51ab 100644 --- a/xlat/modetypes.h +++ b/xlat/modetypes.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/modetypes.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat modetypes in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat modetypes in mpers mode + +# else static const struct xlat modetypes[] = { @@ -32,4 +38,6 @@ const struct xlat modetypes[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/module_init_flags.h b/xlat/module_init_flags.h index b3219d19..3057478e 100644 --- a/xlat/module_init_flags.h +++ b/xlat/module_init_flags.h @@ -1,16 +1,30 @@ /* Generated by ./xlat/gen.sh from ./xlat/module_init_flags.in; do not edit. */ -#if !(defined(MODULE_INIT_IGNORE_MODVERSIONS) || (defined(HAVE_DECL_MODULE_INIT_IGNORE_MODVERSIONS) && HAVE_DECL_MODULE_INIT_IGNORE_MODVERSIONS)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(MODULE_INIT_IGNORE_MODVERSIONS) || (defined(HAVE_DECL_MODULE_INIT_IGNORE_MODVERSIONS) && HAVE_DECL_MODULE_INIT_IGNORE_MODVERSIONS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MODULE_INIT_IGNORE_MODVERSIONS) == ((1 << 0)), "MODULE_INIT_IGNORE_MODVERSIONS != (1 << 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MODULE_INIT_IGNORE_MODVERSIONS (1 << 0) #endif -#if !(defined(MODULE_INIT_IGNORE_VERMAGIC) || (defined(HAVE_DECL_MODULE_INIT_IGNORE_VERMAGIC) && HAVE_DECL_MODULE_INIT_IGNORE_VERMAGIC)) +#if defined(MODULE_INIT_IGNORE_VERMAGIC) || (defined(HAVE_DECL_MODULE_INIT_IGNORE_VERMAGIC) && HAVE_DECL_MODULE_INIT_IGNORE_VERMAGIC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MODULE_INIT_IGNORE_VERMAGIC) == ((1 << 1)), "MODULE_INIT_IGNORE_VERMAGIC != (1 << 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MODULE_INIT_IGNORE_VERMAGIC (1 << 1) #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat module_init_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat module_init_flags in mpers mode + +# else static const struct xlat module_init_flags[] = { @@ -19,4 +33,6 @@ const struct xlat module_init_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/mount_flags.h b/xlat/mount_flags.h index 98f1215e..8c552a42 100644 --- a/xlat/mount_flags.h +++ b/xlat/mount_flags.h @@ -1,97 +1,226 @@ /* Generated by ./xlat/gen.sh from ./xlat/mount_flags.in; do not edit. */ -#if !(defined(MS_RDONLY) || (defined(HAVE_DECL_MS_RDONLY) && HAVE_DECL_MS_RDONLY)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(MS_RDONLY) || (defined(HAVE_DECL_MS_RDONLY) && HAVE_DECL_MS_RDONLY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_RDONLY) == (1), "MS_RDONLY != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_RDONLY 1 #endif -#if !(defined(MS_NOSUID) || (defined(HAVE_DECL_MS_NOSUID) && HAVE_DECL_MS_NOSUID)) +#if defined(MS_NOSUID) || (defined(HAVE_DECL_MS_NOSUID) && HAVE_DECL_MS_NOSUID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_NOSUID) == (2), "MS_NOSUID != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_NOSUID 2 #endif -#if !(defined(MS_NODEV) || (defined(HAVE_DECL_MS_NODEV) && HAVE_DECL_MS_NODEV)) +#if defined(MS_NODEV) || (defined(HAVE_DECL_MS_NODEV) && HAVE_DECL_MS_NODEV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_NODEV) == (4), "MS_NODEV != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_NODEV 4 #endif -#if !(defined(MS_NOEXEC) || (defined(HAVE_DECL_MS_NOEXEC) && HAVE_DECL_MS_NOEXEC)) +#if defined(MS_NOEXEC) || (defined(HAVE_DECL_MS_NOEXEC) && HAVE_DECL_MS_NOEXEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_NOEXEC) == (8), "MS_NOEXEC != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_NOEXEC 8 #endif -#if !(defined(MS_SYNCHRONOUS) || (defined(HAVE_DECL_MS_SYNCHRONOUS) && HAVE_DECL_MS_SYNCHRONOUS)) +#if defined(MS_SYNCHRONOUS) || (defined(HAVE_DECL_MS_SYNCHRONOUS) && HAVE_DECL_MS_SYNCHRONOUS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_SYNCHRONOUS) == (16), "MS_SYNCHRONOUS != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_SYNCHRONOUS 16 #endif -#if !(defined(MS_REMOUNT) || (defined(HAVE_DECL_MS_REMOUNT) && HAVE_DECL_MS_REMOUNT)) +#if defined(MS_REMOUNT) || (defined(HAVE_DECL_MS_REMOUNT) && HAVE_DECL_MS_REMOUNT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_REMOUNT) == (32), "MS_REMOUNT != 32"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_REMOUNT 32 #endif -#if !(defined(MS_MANDLOCK) || (defined(HAVE_DECL_MS_MANDLOCK) && HAVE_DECL_MS_MANDLOCK)) +#if defined(MS_MANDLOCK) || (defined(HAVE_DECL_MS_MANDLOCK) && HAVE_DECL_MS_MANDLOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_MANDLOCK) == (64), "MS_MANDLOCK != 64"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_MANDLOCK 64 #endif -#if !(defined(MS_DIRSYNC) || (defined(HAVE_DECL_MS_DIRSYNC) && HAVE_DECL_MS_DIRSYNC)) +#if defined(MS_DIRSYNC) || (defined(HAVE_DECL_MS_DIRSYNC) && HAVE_DECL_MS_DIRSYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_DIRSYNC) == (128), "MS_DIRSYNC != 128"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_DIRSYNC 128 #endif -#if !(defined(MS_NOATIME) || (defined(HAVE_DECL_MS_NOATIME) && HAVE_DECL_MS_NOATIME)) +#if defined(MS_NOATIME) || (defined(HAVE_DECL_MS_NOATIME) && HAVE_DECL_MS_NOATIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_NOATIME) == (1024), "MS_NOATIME != 1024"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_NOATIME 1024 #endif -#if !(defined(MS_NODIRATIME) || (defined(HAVE_DECL_MS_NODIRATIME) && HAVE_DECL_MS_NODIRATIME)) +#if defined(MS_NODIRATIME) || (defined(HAVE_DECL_MS_NODIRATIME) && HAVE_DECL_MS_NODIRATIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_NODIRATIME) == (2048), "MS_NODIRATIME != 2048"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_NODIRATIME 2048 #endif -#if !(defined(MS_BIND) || (defined(HAVE_DECL_MS_BIND) && HAVE_DECL_MS_BIND)) +#if defined(MS_BIND) || (defined(HAVE_DECL_MS_BIND) && HAVE_DECL_MS_BIND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_BIND) == (4096), "MS_BIND != 4096"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_BIND 4096 #endif -#if !(defined(MS_MOVE) || (defined(HAVE_DECL_MS_MOVE) && HAVE_DECL_MS_MOVE)) +#if defined(MS_MOVE) || (defined(HAVE_DECL_MS_MOVE) && HAVE_DECL_MS_MOVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_MOVE) == (8192), "MS_MOVE != 8192"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_MOVE 8192 #endif -#if !(defined(MS_REC) || (defined(HAVE_DECL_MS_REC) && HAVE_DECL_MS_REC)) +#if defined(MS_REC) || (defined(HAVE_DECL_MS_REC) && HAVE_DECL_MS_REC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_REC) == (16384), "MS_REC != 16384"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_REC 16384 #endif -#if !(defined(MS_SILENT) || (defined(HAVE_DECL_MS_SILENT) && HAVE_DECL_MS_SILENT)) +#if defined(MS_SILENT) || (defined(HAVE_DECL_MS_SILENT) && HAVE_DECL_MS_SILENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_SILENT) == (32768), "MS_SILENT != 32768"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_SILENT 32768 #endif -#if !(defined(MS_POSIXACL) || (defined(HAVE_DECL_MS_POSIXACL) && HAVE_DECL_MS_POSIXACL)) +#if defined(MS_POSIXACL) || (defined(HAVE_DECL_MS_POSIXACL) && HAVE_DECL_MS_POSIXACL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_POSIXACL) == ((1<<16)), "MS_POSIXACL != (1<<16)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_POSIXACL (1<<16) #endif -#if !(defined(MS_UNBINDABLE) || (defined(HAVE_DECL_MS_UNBINDABLE) && HAVE_DECL_MS_UNBINDABLE)) +#if defined(MS_UNBINDABLE) || (defined(HAVE_DECL_MS_UNBINDABLE) && HAVE_DECL_MS_UNBINDABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_UNBINDABLE) == ((1<<17)), "MS_UNBINDABLE != (1<<17)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_UNBINDABLE (1<<17) #endif -#if !(defined(MS_PRIVATE) || (defined(HAVE_DECL_MS_PRIVATE) && HAVE_DECL_MS_PRIVATE)) +#if defined(MS_PRIVATE) || (defined(HAVE_DECL_MS_PRIVATE) && HAVE_DECL_MS_PRIVATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_PRIVATE) == ((1<<18)), "MS_PRIVATE != (1<<18)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_PRIVATE (1<<18) #endif -#if !(defined(MS_SLAVE) || (defined(HAVE_DECL_MS_SLAVE) && HAVE_DECL_MS_SLAVE)) +#if defined(MS_SLAVE) || (defined(HAVE_DECL_MS_SLAVE) && HAVE_DECL_MS_SLAVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_SLAVE) == ((1<<19)), "MS_SLAVE != (1<<19)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_SLAVE (1<<19) #endif -#if !(defined(MS_SHARED) || (defined(HAVE_DECL_MS_SHARED) && HAVE_DECL_MS_SHARED)) +#if defined(MS_SHARED) || (defined(HAVE_DECL_MS_SHARED) && HAVE_DECL_MS_SHARED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_SHARED) == ((1<<20)), "MS_SHARED != (1<<20)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_SHARED (1<<20) #endif -#if !(defined(MS_RELATIME) || (defined(HAVE_DECL_MS_RELATIME) && HAVE_DECL_MS_RELATIME)) +#if defined(MS_RELATIME) || (defined(HAVE_DECL_MS_RELATIME) && HAVE_DECL_MS_RELATIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_RELATIME) == ((1<<21)), "MS_RELATIME != (1<<21)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_RELATIME (1<<21) #endif -#if !(defined(MS_KERNMOUNT) || (defined(HAVE_DECL_MS_KERNMOUNT) && HAVE_DECL_MS_KERNMOUNT)) +#if defined(MS_KERNMOUNT) || (defined(HAVE_DECL_MS_KERNMOUNT) && HAVE_DECL_MS_KERNMOUNT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_KERNMOUNT) == ((1<<22)), "MS_KERNMOUNT != (1<<22)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_KERNMOUNT (1<<22) #endif -#if !(defined(MS_I_VERSION) || (defined(HAVE_DECL_MS_I_VERSION) && HAVE_DECL_MS_I_VERSION)) +#if defined(MS_I_VERSION) || (defined(HAVE_DECL_MS_I_VERSION) && HAVE_DECL_MS_I_VERSION) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_I_VERSION) == ((1<<23)), "MS_I_VERSION != (1<<23)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_I_VERSION (1<<23) #endif -#if !(defined(MS_STRICTATIME) || (defined(HAVE_DECL_MS_STRICTATIME) && HAVE_DECL_MS_STRICTATIME)) +#if defined(MS_STRICTATIME) || (defined(HAVE_DECL_MS_STRICTATIME) && HAVE_DECL_MS_STRICTATIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_STRICTATIME) == ((1<<24)), "MS_STRICTATIME != (1<<24)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_STRICTATIME (1<<24) #endif -#if !(defined(MS_LAZYTIME) || (defined(HAVE_DECL_MS_LAZYTIME) && HAVE_DECL_MS_LAZYTIME)) +#if defined(MS_LAZYTIME) || (defined(HAVE_DECL_MS_LAZYTIME) && HAVE_DECL_MS_LAZYTIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_LAZYTIME) == ((1<<25)), "MS_LAZYTIME != (1<<25)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_LAZYTIME (1<<25) #endif -#if !(defined(MS_NOREMOTELOCK) || (defined(HAVE_DECL_MS_NOREMOTELOCK) && HAVE_DECL_MS_NOREMOTELOCK)) +#if defined(MS_SUBMOUNT) || (defined(HAVE_DECL_MS_SUBMOUNT) && HAVE_DECL_MS_SUBMOUNT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_SUBMOUNT) == ((1<<26)), "MS_SUBMOUNT != (1<<26)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MS_SUBMOUNT (1<<26) +#endif +#if defined(MS_NOREMOTELOCK) || (defined(HAVE_DECL_MS_NOREMOTELOCK) && HAVE_DECL_MS_NOREMOTELOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_NOREMOTELOCK) == ((1<<27)), "MS_NOREMOTELOCK != (1<<27)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_NOREMOTELOCK (1<<27) #endif -#if !(defined(MS_NOSEC) || (defined(HAVE_DECL_MS_NOSEC) && HAVE_DECL_MS_NOSEC)) +#if defined(MS_NOSEC) || (defined(HAVE_DECL_MS_NOSEC) && HAVE_DECL_MS_NOSEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_NOSEC) == ((1<<28)), "MS_NOSEC != (1<<28)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_NOSEC (1<<28) #endif -#if !(defined(MS_BORN) || (defined(HAVE_DECL_MS_BORN) && HAVE_DECL_MS_BORN)) +#if defined(MS_BORN) || (defined(HAVE_DECL_MS_BORN) && HAVE_DECL_MS_BORN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_BORN) == ((1<<29)), "MS_BORN != (1<<29)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_BORN (1<<29) #endif -#if !(defined(MS_ACTIVE) || (defined(HAVE_DECL_MS_ACTIVE) && HAVE_DECL_MS_ACTIVE)) +#if defined(MS_ACTIVE) || (defined(HAVE_DECL_MS_ACTIVE) && HAVE_DECL_MS_ACTIVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_ACTIVE) == ((1<<30)), "MS_ACTIVE != (1<<30)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_ACTIVE (1<<30) #endif -#if !(defined(MS_NOUSER) || (defined(HAVE_DECL_MS_NOUSER) && HAVE_DECL_MS_NOUSER)) +#if defined(MS_NOUSER) || (defined(HAVE_DECL_MS_NOUSER) && HAVE_DECL_MS_NOUSER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MS_NOUSER) == ((1<<31)), "MS_NOUSER != (1<<31)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MS_NOUSER (1<<31) #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat mount_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat mount_flags in mpers mode + +# else static const struct xlat mount_flags[] = { @@ -119,6 +248,7 @@ const struct xlat mount_flags[] = { XLAT(MS_I_VERSION), XLAT(MS_STRICTATIME), XLAT(MS_LAZYTIME), + XLAT(MS_SUBMOUNT), XLAT(MS_NOREMOTELOCK), XLAT(MS_NOSEC), XLAT(MS_BORN), @@ -127,4 +257,6 @@ const struct xlat mount_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/mount_flags.in b/xlat/mount_flags.in index bf903d29..e7f3ce18 100644 --- a/xlat/mount_flags.in +++ b/xlat/mount_flags.in @@ -22,6 +22,7 @@ MS_KERNMOUNT (1<<22) MS_I_VERSION (1<<23) MS_STRICTATIME (1<<24) MS_LAZYTIME (1<<25) +MS_SUBMOUNT (1<<26) MS_NOREMOTELOCK (1<<27) MS_NOSEC (1<<28) MS_BORN (1<<29) diff --git a/xlat/move_pages_flags.h b/xlat/move_pages_flags.h index 0844fdaa..150d10df 100644 --- a/xlat/move_pages_flags.h +++ b/xlat/move_pages_flags.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/move_pages_flags.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat move_pages_flags in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat move_pages_flags in mpers mode + +# else static const struct xlat move_pages_flags[] = { @@ -17,4 +23,6 @@ const struct xlat move_pages_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/mq_attr_flags.h b/xlat/mq_attr_flags.h index ed2d767f..bde6678e 100644 --- a/xlat/mq_attr_flags.h +++ b/xlat/mq_attr_flags.h @@ -1,14 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/mq_attr_flags.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat mq_attr_flags[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat mq_attr_flags[] = { #if defined(O_NONBLOCK) || (defined(HAVE_DECL_O_NONBLOCK) && HAVE_DECL_O_NONBLOCK) XLAT(O_NONBLOCK), @@ -16,4 +22,6 @@ const struct xlat mq_attr_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/mremap_flags.h b/xlat/mremap_flags.h index 803cdeb8..ad86af7e 100644 --- a/xlat/mremap_flags.h +++ b/xlat/mremap_flags.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/mremap_flags.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat mremap_flags in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat mremap_flags in mpers mode + +# else static const struct xlat mremap_flags[] = { @@ -17,4 +23,6 @@ const struct xlat mremap_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/msg_flags.h b/xlat/msg_flags.h index f4729ba2..a169d9c8 100644 --- a/xlat/msg_flags.h +++ b/xlat/msg_flags.h @@ -1,73 +1,223 @@ /* Generated by ./xlat/gen.sh from ./xlat/msg_flags.in; do not edit. */ -#if !(defined(MSG_BATCH) || (defined(HAVE_DECL_MSG_BATCH) && HAVE_DECL_MSG_BATCH)) -# define MSG_BATCH 0x40000 -#endif -#ifndef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -const struct xlat msg_flags[] = { #if defined(MSG_OOB) || (defined(HAVE_DECL_MSG_OOB) && HAVE_DECL_MSG_OOB) - XLAT(MSG_OOB), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_OOB) == (0x1), "MSG_OOB != 0x1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_OOB 0x1 #endif #if defined(MSG_PEEK) || (defined(HAVE_DECL_MSG_PEEK) && HAVE_DECL_MSG_PEEK) - XLAT(MSG_PEEK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_PEEK) == (0x2), "MSG_PEEK != 0x2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_PEEK 0x2 #endif #if defined(MSG_DONTROUTE) || (defined(HAVE_DECL_MSG_DONTROUTE) && HAVE_DECL_MSG_DONTROUTE) - XLAT(MSG_DONTROUTE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_DONTROUTE) == (0x4), "MSG_DONTROUTE != 0x4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_DONTROUTE 0x4 #endif #if defined(MSG_CTRUNC) || (defined(HAVE_DECL_MSG_CTRUNC) && HAVE_DECL_MSG_CTRUNC) - XLAT(MSG_CTRUNC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_CTRUNC) == (0x8), "MSG_CTRUNC != 0x8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_CTRUNC 0x8 #endif #if defined(MSG_PROBE) || (defined(HAVE_DECL_MSG_PROBE) && HAVE_DECL_MSG_PROBE) - XLAT(MSG_PROBE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_PROBE) == (0x10), "MSG_PROBE != 0x10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_PROBE 0x10 #endif #if defined(MSG_TRUNC) || (defined(HAVE_DECL_MSG_TRUNC) && HAVE_DECL_MSG_TRUNC) - XLAT(MSG_TRUNC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_TRUNC) == (0x20), "MSG_TRUNC != 0x20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_TRUNC 0x20 #endif #if defined(MSG_DONTWAIT) || (defined(HAVE_DECL_MSG_DONTWAIT) && HAVE_DECL_MSG_DONTWAIT) - XLAT(MSG_DONTWAIT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_DONTWAIT) == (0x40), "MSG_DONTWAIT != 0x40"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_DONTWAIT 0x40 #endif #if defined(MSG_EOR) || (defined(HAVE_DECL_MSG_EOR) && HAVE_DECL_MSG_EOR) - XLAT(MSG_EOR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_EOR) == (0x80), "MSG_EOR != 0x80"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_EOR 0x80 #endif #if defined(MSG_WAITALL) || (defined(HAVE_DECL_MSG_WAITALL) && HAVE_DECL_MSG_WAITALL) - XLAT(MSG_WAITALL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_WAITALL) == (0x100), "MSG_WAITALL != 0x100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_WAITALL 0x100 #endif #if defined(MSG_FIN) || (defined(HAVE_DECL_MSG_FIN) && HAVE_DECL_MSG_FIN) - XLAT(MSG_FIN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_FIN) == (0x200), "MSG_FIN != 0x200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_FIN 0x200 #endif #if defined(MSG_SYN) || (defined(HAVE_DECL_MSG_SYN) && HAVE_DECL_MSG_SYN) - XLAT(MSG_SYN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_SYN) == (0x400), "MSG_SYN != 0x400"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_SYN 0x400 #endif #if defined(MSG_CONFIRM) || (defined(HAVE_DECL_MSG_CONFIRM) && HAVE_DECL_MSG_CONFIRM) - XLAT(MSG_CONFIRM), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_CONFIRM) == (0x800), "MSG_CONFIRM != 0x800"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_CONFIRM 0x800 #endif #if defined(MSG_RST) || (defined(HAVE_DECL_MSG_RST) && HAVE_DECL_MSG_RST) - XLAT(MSG_RST), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_RST) == (0x1000), "MSG_RST != 0x1000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_RST 0x1000 #endif #if defined(MSG_ERRQUEUE) || (defined(HAVE_DECL_MSG_ERRQUEUE) && HAVE_DECL_MSG_ERRQUEUE) - XLAT(MSG_ERRQUEUE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_ERRQUEUE) == (0x2000), "MSG_ERRQUEUE != 0x2000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_ERRQUEUE 0x2000 #endif #if defined(MSG_NOSIGNAL) || (defined(HAVE_DECL_MSG_NOSIGNAL) && HAVE_DECL_MSG_NOSIGNAL) - XLAT(MSG_NOSIGNAL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_NOSIGNAL) == (0x4000), "MSG_NOSIGNAL != 0x4000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_NOSIGNAL 0x4000 #endif #if defined(MSG_MORE) || (defined(HAVE_DECL_MSG_MORE) && HAVE_DECL_MSG_MORE) - XLAT(MSG_MORE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_MORE) == (0x8000), "MSG_MORE != 0x8000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_MORE 0x8000 #endif #if defined(MSG_WAITFORONE) || (defined(HAVE_DECL_MSG_WAITFORONE) && HAVE_DECL_MSG_WAITFORONE) - XLAT(MSG_WAITFORONE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_WAITFORONE) == (0x10000), "MSG_WAITFORONE != 0x10000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_WAITFORONE 0x10000 +#endif +#if defined(MSG_SENDPAGE_NOTLAST) || (defined(HAVE_DECL_MSG_SENDPAGE_NOTLAST) && HAVE_DECL_MSG_SENDPAGE_NOTLAST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_SENDPAGE_NOTLAST) == (0x20000), "MSG_SENDPAGE_NOTLAST != 0x20000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_SENDPAGE_NOTLAST 0x20000 +#endif +#if defined(MSG_BATCH) || (defined(HAVE_DECL_MSG_BATCH) && HAVE_DECL_MSG_BATCH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_BATCH) == (0x40000), "MSG_BATCH != 0x40000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_BATCH 0x40000 #endif - XLAT(MSG_BATCH), -#if defined(MSG_EOF) || (defined(HAVE_DECL_MSG_EOF) && HAVE_DECL_MSG_EOF) - XLAT(MSG_EOF), +#if defined(MSG_NO_SHARED_FRAGS) || (defined(HAVE_DECL_MSG_NO_SHARED_FRAGS) && HAVE_DECL_MSG_NO_SHARED_FRAGS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_NO_SHARED_FRAGS) == (0x80000), "MSG_NO_SHARED_FRAGS != 0x80000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_NO_SHARED_FRAGS 0x80000 +#endif +#if defined(MSG_ZEROCOPY) || (defined(HAVE_DECL_MSG_ZEROCOPY) && HAVE_DECL_MSG_ZEROCOPY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_ZEROCOPY) == (0x4000000), "MSG_ZEROCOPY != 0x4000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_ZEROCOPY 0x4000000 #endif #if defined(MSG_FASTOPEN) || (defined(HAVE_DECL_MSG_FASTOPEN) && HAVE_DECL_MSG_FASTOPEN) - XLAT(MSG_FASTOPEN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_FASTOPEN) == (0x20000000), "MSG_FASTOPEN != 0x20000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_FASTOPEN 0x20000000 #endif #if defined(MSG_CMSG_CLOEXEC) || (defined(HAVE_DECL_MSG_CMSG_CLOEXEC) && HAVE_DECL_MSG_CMSG_CLOEXEC) - XLAT(MSG_CMSG_CLOEXEC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_CMSG_CLOEXEC) == (0x40000000), "MSG_CMSG_CLOEXEC != 0x40000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_CMSG_CLOEXEC 0x40000000 +#endif +#ifndef STRACE_WORKAROUND_FOR_MSG_CMSG_COMPAT +# define STRACE_WORKAROUND_FOR_MSG_CMSG_COMPAT +# undef MSG_CMSG_COMPAT +#endif +#if defined(MSG_CMSG_COMPAT) || (defined(HAVE_DECL_MSG_CMSG_COMPAT) && HAVE_DECL_MSG_CMSG_COMPAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_CMSG_COMPAT) == (0x80000000), "MSG_CMSG_COMPAT != 0x80000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_CMSG_COMPAT 0x80000000 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS + +const struct xlat msg_flags[] = { + XLAT(MSG_OOB), + XLAT(MSG_PEEK), + XLAT(MSG_DONTROUTE), + + XLAT(MSG_CTRUNC), + XLAT(MSG_PROBE), + XLAT(MSG_TRUNC), + XLAT(MSG_DONTWAIT), + XLAT(MSG_EOR), + XLAT(MSG_WAITALL), + XLAT(MSG_FIN), + XLAT(MSG_SYN), + XLAT(MSG_CONFIRM), + XLAT(MSG_RST), + XLAT(MSG_ERRQUEUE), + XLAT(MSG_NOSIGNAL), + XLAT(MSG_MORE), + XLAT(MSG_WAITFORONE), + XLAT(MSG_SENDPAGE_NOTLAST), + XLAT(MSG_BATCH), + XLAT(MSG_NO_SHARED_FRAGS), + XLAT(MSG_ZEROCOPY), + + XLAT(MSG_FASTOPEN), + XLAT(MSG_CMSG_CLOEXEC), +#ifndef STRACE_WORKAROUND_FOR_MSG_CMSG_COMPAT +# define STRACE_WORKAROUND_FOR_MSG_CMSG_COMPAT +/* +* In Linux, the value of MSG_CMSG_COMPAT depends on CONFIG_COMPAT, +* and libc might want to replicate that behaviour. +*/ +# undef MSG_CMSG_COMPAT +#endif + XLAT(MSG_CMSG_COMPAT), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/msg_flags.in b/xlat/msg_flags.in index cf6b83ca..946b1326 100644 --- a/xlat/msg_flags.in +++ b/xlat/msg_flags.in @@ -1,21 +1,34 @@ -MSG_OOB -MSG_PEEK -MSG_DONTROUTE -MSG_CTRUNC -MSG_PROBE -MSG_TRUNC -MSG_DONTWAIT -MSG_EOR -MSG_WAITALL -MSG_FIN -MSG_SYN -MSG_CONFIRM -MSG_RST -MSG_ERRQUEUE -MSG_NOSIGNAL -MSG_MORE -MSG_WAITFORONE -MSG_BATCH 0x40000 -MSG_EOF -MSG_FASTOPEN -MSG_CMSG_CLOEXEC +MSG_OOB 0x1 +MSG_PEEK 0x2 +MSG_DONTROUTE 0x4 +/* MSG_TRYHARD 0x4 - synonym for MSG_DONTROUTE for DECnet */ +MSG_CTRUNC 0x8 +MSG_PROBE 0x10 +MSG_TRUNC 0x20 +MSG_DONTWAIT 0x40 +MSG_EOR 0x80 +MSG_WAITALL 0x100 +MSG_FIN 0x200 +MSG_SYN 0x400 +MSG_CONFIRM 0x800 +MSG_RST 0x1000 +MSG_ERRQUEUE 0x2000 +MSG_NOSIGNAL 0x4000 +MSG_MORE 0x8000 +MSG_WAITFORONE 0x10000 +MSG_SENDPAGE_NOTLAST 0x20000 /* sendpage() internal */ +MSG_BATCH 0x40000 +MSG_NO_SHARED_FRAGS 0x80000 /* sendpage() internal */ +MSG_ZEROCOPY 0x4000000 +/* MSG_EOF MSG_FIN */ +MSG_FASTOPEN 0x20000000 +MSG_CMSG_CLOEXEC 0x40000000 +#ifndef STRACE_WORKAROUND_FOR_MSG_CMSG_COMPAT +# define STRACE_WORKAROUND_FOR_MSG_CMSG_COMPAT +/* + * In Linux, the value of MSG_CMSG_COMPAT depends on CONFIG_COMPAT, + * and libc might want to replicate that behaviour. + */ +# undef MSG_CMSG_COMPAT +#endif +MSG_CMSG_COMPAT 0x80000000 diff --git a/xlat/msgctl_flags.h b/xlat/msgctl_flags.h index a78ee14b..0ac131d3 100644 --- a/xlat/msgctl_flags.h +++ b/xlat/msgctl_flags.h @@ -1,36 +1,81 @@ /* Generated by ./xlat/gen.sh from ./xlat/msgctl_flags.in; do not edit. */ -#if !(defined(MSG_STAT) || (defined(HAVE_DECL_MSG_STAT) && HAVE_DECL_MSG_STAT)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IPC_RMID) || (defined(HAVE_DECL_IPC_RMID) && HAVE_DECL_IPC_RMID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPC_RMID) == (0), "IPC_RMID != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPC_RMID 0 +#endif +#if defined(IPC_SET) || (defined(HAVE_DECL_IPC_SET) && HAVE_DECL_IPC_SET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPC_SET) == (1), "IPC_SET != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPC_SET 1 +#endif +#if defined(IPC_STAT) || (defined(HAVE_DECL_IPC_STAT) && HAVE_DECL_IPC_STAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPC_STAT) == (2), "IPC_STAT != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPC_STAT 2 +#endif +#if defined(IPC_INFO) || (defined(HAVE_DECL_IPC_INFO) && HAVE_DECL_IPC_INFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPC_INFO) == (3), "IPC_INFO != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPC_INFO 3 +#endif +#if defined(MSG_STAT) || (defined(HAVE_DECL_MSG_STAT) && HAVE_DECL_MSG_STAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_STAT) == (11), "MSG_STAT != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MSG_STAT 11 #endif -#if !(defined(MSG_INFO) || (defined(HAVE_DECL_MSG_INFO) && HAVE_DECL_MSG_INFO)) +#if defined(MSG_INFO) || (defined(HAVE_DECL_MSG_INFO) && HAVE_DECL_MSG_INFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_INFO) == (12), "MSG_INFO != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MSG_INFO 12 #endif +#if defined(MSG_STAT_ANY) || (defined(HAVE_DECL_MSG_STAT_ANY) && HAVE_DECL_MSG_STAT_ANY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MSG_STAT_ANY) == (13), "MSG_STAT_ANY != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MSG_STAT_ANY 13 +#endif + +#ifndef XLAT_MACROS_ONLY -#ifdef IN_MPERS +# ifdef IN_MPERS extern const struct xlat msgctl_flags[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat msgctl_flags[] = { -#if defined(IPC_RMID) || (defined(HAVE_DECL_IPC_RMID) && HAVE_DECL_IPC_RMID) - XLAT(IPC_RMID), -#endif -#if defined(IPC_SET) || (defined(HAVE_DECL_IPC_SET) && HAVE_DECL_IPC_SET) - XLAT(IPC_SET), -#endif -#if defined(IPC_STAT) || (defined(HAVE_DECL_IPC_STAT) && HAVE_DECL_IPC_STAT) - XLAT(IPC_STAT), -#endif -#if defined(IPC_INFO) || (defined(HAVE_DECL_IPC_INFO) && HAVE_DECL_IPC_INFO) - XLAT(IPC_INFO), -#endif + + XLAT(IPC_RMID), + XLAT(IPC_SET), + XLAT(IPC_STAT), + XLAT(IPC_INFO), XLAT(MSG_STAT), XLAT(MSG_INFO), + XLAT(MSG_STAT_ANY), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/msgctl_flags.in b/xlat/msgctl_flags.in index 4b54adf6..a81a8192 100644 --- a/xlat/msgctl_flags.in +++ b/xlat/msgctl_flags.in @@ -1,6 +1,8 @@ -IPC_RMID -IPC_SET -IPC_STAT -IPC_INFO +/* sort -k2,2g */ +IPC_RMID 0 +IPC_SET 1 +IPC_STAT 2 +IPC_INFO 3 MSG_STAT 11 MSG_INFO 12 +MSG_STAT_ANY 13 diff --git a/xlat/mtd_file_mode_options.h b/xlat/mtd_file_mode_options.h index 943919f3..0cbeeedb 100644 --- a/xlat/mtd_file_mode_options.h +++ b/xlat/mtd_file_mode_options.h @@ -1,14 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/mtd_file_mode_options.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat mtd_file_mode_options[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat mtd_file_mode_options[] = { XLAT(MTD_FILE_MODE_NORMAL), XLAT(MTD_FILE_MODE_OTP_FACTORY), @@ -17,4 +23,6 @@ const struct xlat mtd_file_mode_options[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/mtd_flags_options.h b/xlat/mtd_flags_options.h index 87125614..91d168f3 100644 --- a/xlat/mtd_flags_options.h +++ b/xlat/mtd_flags_options.h @@ -1,14 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/mtd_flags_options.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat mtd_flags_options[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat mtd_flags_options[] = { #if defined(MTD_WRITEABLE) || (defined(HAVE_DECL_MTD_WRITEABLE) && HAVE_DECL_MTD_WRITEABLE) XLAT(MTD_WRITEABLE), @@ -25,4 +31,6 @@ const struct xlat mtd_flags_options[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/mtd_mode_options.h b/xlat/mtd_mode_options.h index b7e8b4a6..89a238f0 100644 --- a/xlat/mtd_mode_options.h +++ b/xlat/mtd_mode_options.h @@ -1,14 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/mtd_mode_options.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat mtd_mode_options[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat mtd_mode_options[] = { XLAT(MTD_OPS_PLACE_OOB), XLAT(MTD_OPS_AUTO_OOB), @@ -16,4 +22,6 @@ const struct xlat mtd_mode_options[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/mtd_nandecc_options.h b/xlat/mtd_nandecc_options.h index 21b0166f..08a37f52 100644 --- a/xlat/mtd_nandecc_options.h +++ b/xlat/mtd_nandecc_options.h @@ -1,14 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/mtd_nandecc_options.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat mtd_nandecc_options[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat mtd_nandecc_options[] = { #if defined(MTD_NANDECC_OFF) || (defined(HAVE_DECL_MTD_NANDECC_OFF) && HAVE_DECL_MTD_NANDECC_OFF) XLAT(MTD_NANDECC_OFF), @@ -28,4 +34,6 @@ const struct xlat mtd_nandecc_options[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/mtd_otp_options.h b/xlat/mtd_otp_options.h index 2ee7f492..071fc5c3 100644 --- a/xlat/mtd_otp_options.h +++ b/xlat/mtd_otp_options.h @@ -1,14 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/mtd_otp_options.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat mtd_otp_options[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat mtd_otp_options[] = { #if defined(MTD_OTP_OFF) || (defined(HAVE_DECL_MTD_OTP_OFF) && HAVE_DECL_MTD_OTP_OFF) XLAT(MTD_OTP_OFF), @@ -22,4 +28,6 @@ const struct xlat mtd_otp_options[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/mtd_type_options.h b/xlat/mtd_type_options.h index 46829e8f..c6e0ecf1 100644 --- a/xlat/mtd_type_options.h +++ b/xlat/mtd_type_options.h @@ -1,14 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/mtd_type_options.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat mtd_type_options[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat mtd_type_options[] = { #if defined(MTD_ABSENT) || (defined(HAVE_DECL_MTD_ABSENT) && HAVE_DECL_MTD_ABSENT) XLAT(MTD_ABSENT), @@ -37,4 +43,6 @@ const struct xlat mtd_type_options[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/multicast_router_types.h b/xlat/multicast_router_types.h new file mode 100644 index 00000000..e1802054 --- /dev/null +++ b/xlat/multicast_router_types.h @@ -0,0 +1,54 @@ +/* Generated by ./xlat/gen.sh from ./xlat/multicast_router_types.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(MDB_RTR_TYPE_DISABLED) || (defined(HAVE_DECL_MDB_RTR_TYPE_DISABLED) && HAVE_DECL_MDB_RTR_TYPE_DISABLED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MDB_RTR_TYPE_DISABLED) == (0), "MDB_RTR_TYPE_DISABLED != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MDB_RTR_TYPE_DISABLED 0 +#endif +#if defined(MDB_RTR_TYPE_TEMP_QUERY) || (defined(HAVE_DECL_MDB_RTR_TYPE_TEMP_QUERY) && HAVE_DECL_MDB_RTR_TYPE_TEMP_QUERY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MDB_RTR_TYPE_TEMP_QUERY) == (1), "MDB_RTR_TYPE_TEMP_QUERY != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MDB_RTR_TYPE_TEMP_QUERY 1 +#endif +#if defined(MDB_RTR_TYPE_PERM) || (defined(HAVE_DECL_MDB_RTR_TYPE_PERM) && HAVE_DECL_MDB_RTR_TYPE_PERM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MDB_RTR_TYPE_PERM) == (2), "MDB_RTR_TYPE_PERM != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MDB_RTR_TYPE_PERM 2 +#endif +#if defined(MDB_RTR_TYPE_TEMP) || (defined(HAVE_DECL_MDB_RTR_TYPE_TEMP) && HAVE_DECL_MDB_RTR_TYPE_TEMP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MDB_RTR_TYPE_TEMP) == (3), "MDB_RTR_TYPE_TEMP != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MDB_RTR_TYPE_TEMP 3 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat multicast_router_types in mpers mode + +# else + +static +const struct xlat multicast_router_types[] = { + XLAT(MDB_RTR_TYPE_DISABLED), + XLAT(MDB_RTR_TYPE_TEMP_QUERY), + XLAT(MDB_RTR_TYPE_PERM), + XLAT(MDB_RTR_TYPE_TEMP), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/multicast_router_types.in b/xlat/multicast_router_types.in new file mode 100644 index 00000000..6a5c03c3 --- /dev/null +++ b/xlat/multicast_router_types.in @@ -0,0 +1,4 @@ +MDB_RTR_TYPE_DISABLED 0 +MDB_RTR_TYPE_TEMP_QUERY 1 +MDB_RTR_TYPE_PERM 2 +MDB_RTR_TYPE_TEMP 3 diff --git a/xlat/name_to_handle_at_flags.h b/xlat/name_to_handle_at_flags.h index 512889d7..87e63ae5 100644 --- a/xlat/name_to_handle_at_flags.h +++ b/xlat/name_to_handle_at_flags.h @@ -1,16 +1,30 @@ /* Generated by ./xlat/gen.sh from ./xlat/name_to_handle_at_flags.in; do not edit. */ -#if !(defined(AT_SYMLINK_FOLLOW) || (defined(HAVE_DECL_AT_SYMLINK_FOLLOW) && HAVE_DECL_AT_SYMLINK_FOLLOW)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(AT_SYMLINK_FOLLOW) || (defined(HAVE_DECL_AT_SYMLINK_FOLLOW) && HAVE_DECL_AT_SYMLINK_FOLLOW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AT_SYMLINK_FOLLOW) == (0x400), "AT_SYMLINK_FOLLOW != 0x400"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AT_SYMLINK_FOLLOW 0x400 #endif -#if !(defined(AT_EMPTY_PATH) || (defined(HAVE_DECL_AT_EMPTY_PATH) && HAVE_DECL_AT_EMPTY_PATH)) +#if defined(AT_EMPTY_PATH) || (defined(HAVE_DECL_AT_EMPTY_PATH) && HAVE_DECL_AT_EMPTY_PATH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AT_EMPTY_PATH) == (0x1000), "AT_EMPTY_PATH != 0x1000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define AT_EMPTY_PATH 0x1000 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat name_to_handle_at_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat name_to_handle_at_flags in mpers mode + +# else static const struct xlat name_to_handle_at_flags[] = { @@ -19,4 +33,6 @@ const struct xlat name_to_handle_at_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nbd_ioctl_cmds.h b/xlat/nbd_ioctl_cmds.h new file mode 100644 index 00000000..840dc8e2 --- /dev/null +++ b/xlat/nbd_ioctl_cmds.h @@ -0,0 +1,110 @@ +/* Generated by ./xlat/gen.sh from ./xlat/nbd_ioctl_cmds.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NBD_SET_SOCK) || (defined(HAVE_DECL_NBD_SET_SOCK) && HAVE_DECL_NBD_SET_SOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NBD_SET_SOCK) == (_IO( 0xab, 0 )), "NBD_SET_SOCK != _IO( 0xab, 0 )"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NBD_SET_SOCK _IO( 0xab, 0 ) +#endif +#if defined(NBD_SET_BLKSIZE) || (defined(HAVE_DECL_NBD_SET_BLKSIZE) && HAVE_DECL_NBD_SET_BLKSIZE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NBD_SET_BLKSIZE) == (_IO( 0xab, 1 )), "NBD_SET_BLKSIZE != _IO( 0xab, 1 )"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NBD_SET_BLKSIZE _IO( 0xab, 1 ) +#endif +#if defined(NBD_SET_SIZE) || (defined(HAVE_DECL_NBD_SET_SIZE) && HAVE_DECL_NBD_SET_SIZE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NBD_SET_SIZE) == (_IO( 0xab, 2 )), "NBD_SET_SIZE != _IO( 0xab, 2 )"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NBD_SET_SIZE _IO( 0xab, 2 ) +#endif +#if defined(NBD_DO_IT) || (defined(HAVE_DECL_NBD_DO_IT) && HAVE_DECL_NBD_DO_IT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NBD_DO_IT) == (_IO( 0xab, 3 )), "NBD_DO_IT != _IO( 0xab, 3 )"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NBD_DO_IT _IO( 0xab, 3 ) +#endif +#if defined(NBD_CLEAR_SOCK) || (defined(HAVE_DECL_NBD_CLEAR_SOCK) && HAVE_DECL_NBD_CLEAR_SOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NBD_CLEAR_SOCK) == (_IO( 0xab, 4 )), "NBD_CLEAR_SOCK != _IO( 0xab, 4 )"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NBD_CLEAR_SOCK _IO( 0xab, 4 ) +#endif +#if defined(NBD_CLEAR_QUE) || (defined(HAVE_DECL_NBD_CLEAR_QUE) && HAVE_DECL_NBD_CLEAR_QUE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NBD_CLEAR_QUE) == (_IO( 0xab, 5 )), "NBD_CLEAR_QUE != _IO( 0xab, 5 )"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NBD_CLEAR_QUE _IO( 0xab, 5 ) +#endif +#if defined(NBD_PRINT_DEBUG) || (defined(HAVE_DECL_NBD_PRINT_DEBUG) && HAVE_DECL_NBD_PRINT_DEBUG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NBD_PRINT_DEBUG) == (_IO( 0xab, 6 )), "NBD_PRINT_DEBUG != _IO( 0xab, 6 )"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NBD_PRINT_DEBUG _IO( 0xab, 6 ) +#endif +#if defined(NBD_SET_SIZE_BLOCKS) || (defined(HAVE_DECL_NBD_SET_SIZE_BLOCKS) && HAVE_DECL_NBD_SET_SIZE_BLOCKS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NBD_SET_SIZE_BLOCKS) == (_IO( 0xab, 7 )), "NBD_SET_SIZE_BLOCKS != _IO( 0xab, 7 )"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NBD_SET_SIZE_BLOCKS _IO( 0xab, 7 ) +#endif +#if defined(NBD_DISCONNECT) || (defined(HAVE_DECL_NBD_DISCONNECT) && HAVE_DECL_NBD_DISCONNECT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NBD_DISCONNECT) == (_IO( 0xab, 8 )), "NBD_DISCONNECT != _IO( 0xab, 8 )"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NBD_DISCONNECT _IO( 0xab, 8 ) +#endif +#if defined(NBD_SET_TIMEOUT) || (defined(HAVE_DECL_NBD_SET_TIMEOUT) && HAVE_DECL_NBD_SET_TIMEOUT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NBD_SET_TIMEOUT) == (_IO( 0xab, 9 )), "NBD_SET_TIMEOUT != _IO( 0xab, 9 )"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NBD_SET_TIMEOUT _IO( 0xab, 9 ) +#endif +#if defined(NBD_SET_FLAGS) || (defined(HAVE_DECL_NBD_SET_FLAGS) && HAVE_DECL_NBD_SET_FLAGS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NBD_SET_FLAGS) == (_IO( 0xab, 10)), "NBD_SET_FLAGS != _IO( 0xab, 10)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NBD_SET_FLAGS _IO( 0xab, 10) +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat nbd_ioctl_cmds in mpers mode + +# else + +static +const struct xlat nbd_ioctl_cmds[] = { + XLAT(NBD_SET_SOCK), + XLAT(NBD_SET_BLKSIZE), + XLAT(NBD_SET_SIZE), + XLAT(NBD_DO_IT), + XLAT(NBD_CLEAR_SOCK), + XLAT(NBD_CLEAR_QUE), + XLAT(NBD_PRINT_DEBUG), + XLAT(NBD_SET_SIZE_BLOCKS), + XLAT(NBD_DISCONNECT), + XLAT(NBD_SET_TIMEOUT), + XLAT(NBD_SET_FLAGS), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nbd_ioctl_cmds.in b/xlat/nbd_ioctl_cmds.in new file mode 100644 index 00000000..34f891e3 --- /dev/null +++ b/xlat/nbd_ioctl_cmds.in @@ -0,0 +1,11 @@ +NBD_SET_SOCK _IO( 0xab, 0 ) +NBD_SET_BLKSIZE _IO( 0xab, 1 ) +NBD_SET_SIZE _IO( 0xab, 2 ) +NBD_DO_IT _IO( 0xab, 3 ) +NBD_CLEAR_SOCK _IO( 0xab, 4 ) +NBD_CLEAR_QUE _IO( 0xab, 5 ) +NBD_PRINT_DEBUG _IO( 0xab, 6 ) +NBD_SET_SIZE_BLOCKS _IO( 0xab, 7 ) +NBD_DISCONNECT _IO( 0xab, 8 ) +NBD_SET_TIMEOUT _IO( 0xab, 9 ) +NBD_SET_FLAGS _IO( 0xab, 10) diff --git a/xlat/nbd_ioctl_flags.h b/xlat/nbd_ioctl_flags.h new file mode 100644 index 00000000..a1311a28 --- /dev/null +++ b/xlat/nbd_ioctl_flags.h @@ -0,0 +1,128 @@ +/* Generated by ./xlat/gen.sh from ./xlat/nbd_ioctl_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NBD_FLAG_HAS_FLAGS) || (defined(HAVE_DECL_NBD_FLAG_HAS_FLAGS) && HAVE_DECL_NBD_FLAG_HAS_FLAGS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NBD_FLAG_HAS_FLAGS) == ((1 << 0)), "NBD_FLAG_HAS_FLAGS != (1 << 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NBD_FLAG_HAS_FLAGS (1 << 0) +#endif +#if defined(NBD_FLAG_READ_ONLY) || (defined(HAVE_DECL_NBD_FLAG_READ_ONLY) && HAVE_DECL_NBD_FLAG_READ_ONLY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NBD_FLAG_READ_ONLY) == ((1 << 1)), "NBD_FLAG_READ_ONLY != (1 << 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NBD_FLAG_READ_ONLY (1 << 1) +#endif +#if defined(NBD_FLAG_SEND_FLUSH) || (defined(HAVE_DECL_NBD_FLAG_SEND_FLUSH) && HAVE_DECL_NBD_FLAG_SEND_FLUSH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NBD_FLAG_SEND_FLUSH) == ((1 << 2)), "NBD_FLAG_SEND_FLUSH != (1 << 2)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NBD_FLAG_SEND_FLUSH (1 << 2) +#endif +#if defined(NBD_FLAG_SEND_FUA) || (defined(HAVE_DECL_NBD_FLAG_SEND_FUA) && HAVE_DECL_NBD_FLAG_SEND_FUA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NBD_FLAG_SEND_FUA) == ((1 << 3)), "NBD_FLAG_SEND_FUA != (1 << 3)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NBD_FLAG_SEND_FUA (1 << 3) +#endif +#if defined(NBD_FLAG_ROTATIONAL) || (defined(HAVE_DECL_NBD_FLAG_ROTATIONAL) && HAVE_DECL_NBD_FLAG_ROTATIONAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NBD_FLAG_ROTATIONAL) == ((1 << 4)), "NBD_FLAG_ROTATIONAL != (1 << 4)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NBD_FLAG_ROTATIONAL (1 << 4) +#endif +#if defined(NBD_FLAG_SEND_TRIM) || (defined(HAVE_DECL_NBD_FLAG_SEND_TRIM) && HAVE_DECL_NBD_FLAG_SEND_TRIM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NBD_FLAG_SEND_TRIM) == ((1 << 5)), "NBD_FLAG_SEND_TRIM != (1 << 5)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NBD_FLAG_SEND_TRIM (1 << 5) +#endif +#if defined(NBD_FLAG_SEND_WRITE_ZEROES) || (defined(HAVE_DECL_NBD_FLAG_SEND_WRITE_ZEROES) && HAVE_DECL_NBD_FLAG_SEND_WRITE_ZEROES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NBD_FLAG_SEND_WRITE_ZEROES) == ((1 << 6)), "NBD_FLAG_SEND_WRITE_ZEROES != (1 << 6)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NBD_FLAG_SEND_WRITE_ZEROES (1 << 6) +#endif +#if defined(NBD_FLAG_SEND_DF) || (defined(HAVE_DECL_NBD_FLAG_SEND_DF) && HAVE_DECL_NBD_FLAG_SEND_DF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NBD_FLAG_SEND_DF) == ((1 << 7)), "NBD_FLAG_SEND_DF != (1 << 7)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NBD_FLAG_SEND_DF (1 << 7) +#endif +#if defined(NBD_FLAG_CAN_MULTI_CONN) || (defined(HAVE_DECL_NBD_FLAG_CAN_MULTI_CONN) && HAVE_DECL_NBD_FLAG_CAN_MULTI_CONN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NBD_FLAG_CAN_MULTI_CONN) == ((1 << 8)), "NBD_FLAG_CAN_MULTI_CONN != (1 << 8)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NBD_FLAG_CAN_MULTI_CONN (1 << 8) +#endif +#if defined(NBD_FLAG_SEND_RESIZE) || (defined(HAVE_DECL_NBD_FLAG_SEND_RESIZE) && HAVE_DECL_NBD_FLAG_SEND_RESIZE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NBD_FLAG_SEND_RESIZE) == ((1 << 9)), "NBD_FLAG_SEND_RESIZE != (1 << 9)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NBD_FLAG_SEND_RESIZE (1 << 9) +#endif +#if defined(NBD_FLAG_SEND_CACHE) || (defined(HAVE_DECL_NBD_FLAG_SEND_CACHE) && HAVE_DECL_NBD_FLAG_SEND_CACHE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NBD_FLAG_SEND_CACHE) == ((1 << 10)), "NBD_FLAG_SEND_CACHE != (1 << 10)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NBD_FLAG_SEND_CACHE (1 << 10) +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat nbd_ioctl_flags in mpers mode + +# else + +static +const struct xlat nbd_ioctl_flags[] = { +/* +* Some flags are not defined in , but are passed anyway. +* These flags are sent from nbd-server to the client, and the client +* passes them to the kernel unmodified after parsing. Both the client +* and the kernel ignore flags unknown to them. +*/ + + + XLAT(NBD_FLAG_HAS_FLAGS), + + XLAT(NBD_FLAG_READ_ONLY), + + XLAT(NBD_FLAG_SEND_FLUSH), + + XLAT(NBD_FLAG_SEND_FUA), + + XLAT(NBD_FLAG_ROTATIONAL), + + XLAT(NBD_FLAG_SEND_TRIM), + + XLAT(NBD_FLAG_SEND_WRITE_ZEROES), + + XLAT(NBD_FLAG_SEND_DF), + + XLAT(NBD_FLAG_CAN_MULTI_CONN), + + XLAT(NBD_FLAG_SEND_RESIZE), + + XLAT(NBD_FLAG_SEND_CACHE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nbd_ioctl_flags.in b/xlat/nbd_ioctl_flags.in new file mode 100644 index 00000000..60bb07f9 --- /dev/null +++ b/xlat/nbd_ioctl_flags.in @@ -0,0 +1,29 @@ +/* + * Some flags are not defined in , but are passed anyway. + * These flags are sent from nbd-server to the client, and the client + * passes them to the kernel unmodified after parsing. Both the client + * and the kernel ignore flags unknown to them. + */ + +/* The server supports flags */ +NBD_FLAG_HAS_FLAGS (1 << 0) +/* The export is read-only */ +NBD_FLAG_READ_ONLY (1 << 1) +/* The server supports NBD_CMD_FLUSH */ +NBD_FLAG_SEND_FLUSH (1 << 2) +/* The server supports NBD_CMD_FLAG_FUA (Force Unit Access) */ +NBD_FLAG_SEND_FUA (1 << 3) +/* The export is a rotational medium */ +NBD_FLAG_ROTATIONAL (1 << 4) +/* The server supports NBD_CMD_TRIM */ +NBD_FLAG_SEND_TRIM (1 << 5) +/* The server supports NBD_CMD_WRITE_ZEROES and NBD_CMD_FLAG_NO_HOLE */ +NBD_FLAG_SEND_WRITE_ZEROES (1 << 6) +/* The server supports NBD_CMD_FLAG_DF (don't fragment replies) */ +NBD_FLAG_SEND_DF (1 << 7) +/* The server supports multiple connections */ +NBD_FLAG_CAN_MULTI_CONN (1 << 8) +/* The server supports NBD_CMD_RESIZE (resizing the device) */ +NBD_FLAG_SEND_RESIZE (1 << 9) +/* The server supports NBD_CMD_CACHE */ +NBD_FLAG_SEND_CACHE (1 << 10) diff --git a/xlat/neighbor_cache_entry_flags.h b/xlat/neighbor_cache_entry_flags.h new file mode 100644 index 00000000..79982c98 --- /dev/null +++ b/xlat/neighbor_cache_entry_flags.h @@ -0,0 +1,86 @@ +/* Generated by ./xlat/gen.sh from ./xlat/neighbor_cache_entry_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NTF_USE) || (defined(HAVE_DECL_NTF_USE) && HAVE_DECL_NTF_USE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NTF_USE) == (0x01), "NTF_USE != 0x01"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NTF_USE 0x01 +#endif +#if defined(NTF_SELF) || (defined(HAVE_DECL_NTF_SELF) && HAVE_DECL_NTF_SELF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NTF_SELF) == (0x02), "NTF_SELF != 0x02"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NTF_SELF 0x02 +#endif +#if defined(NTF_MASTER) || (defined(HAVE_DECL_NTF_MASTER) && HAVE_DECL_NTF_MASTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NTF_MASTER) == (0x04), "NTF_MASTER != 0x04"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NTF_MASTER 0x04 +#endif +#if defined(NTF_PROXY) || (defined(HAVE_DECL_NTF_PROXY) && HAVE_DECL_NTF_PROXY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NTF_PROXY) == (0x08), "NTF_PROXY != 0x08"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NTF_PROXY 0x08 +#endif +#if defined(NTF_EXT_LEARNED) || (defined(HAVE_DECL_NTF_EXT_LEARNED) && HAVE_DECL_NTF_EXT_LEARNED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NTF_EXT_LEARNED) == (0x10), "NTF_EXT_LEARNED != 0x10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NTF_EXT_LEARNED 0x10 +#endif +#if defined(NTF_OFFLOADED) || (defined(HAVE_DECL_NTF_OFFLOADED) && HAVE_DECL_NTF_OFFLOADED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NTF_OFFLOADED) == (0x20), "NTF_OFFLOADED != 0x20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NTF_OFFLOADED 0x20 +#endif +#if defined(NTF_STICKY) || (defined(HAVE_DECL_NTF_STICKY) && HAVE_DECL_NTF_STICKY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NTF_STICKY) == (0x40), "NTF_STICKY != 0x40"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NTF_STICKY 0x40 +#endif +#if defined(NTF_ROUTER) || (defined(HAVE_DECL_NTF_ROUTER) && HAVE_DECL_NTF_ROUTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NTF_ROUTER) == (0x80), "NTF_ROUTER != 0x80"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NTF_ROUTER 0x80 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat neighbor_cache_entry_flags in mpers mode + +# else + +static +const struct xlat neighbor_cache_entry_flags[] = { + XLAT(NTF_USE), + XLAT(NTF_SELF), + XLAT(NTF_MASTER), + XLAT(NTF_PROXY), + XLAT(NTF_EXT_LEARNED), + XLAT(NTF_OFFLOADED), + XLAT(NTF_STICKY), + XLAT(NTF_ROUTER), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/neighbor_cache_entry_flags.in b/xlat/neighbor_cache_entry_flags.in new file mode 100644 index 00000000..0f0a83eb --- /dev/null +++ b/xlat/neighbor_cache_entry_flags.in @@ -0,0 +1,8 @@ +NTF_USE 0x01 +NTF_SELF 0x02 +NTF_MASTER 0x04 +NTF_PROXY 0x08 +NTF_EXT_LEARNED 0x10 +NTF_OFFLOADED 0x20 +NTF_STICKY 0x40 +NTF_ROUTER 0x80 diff --git a/xlat/neighbor_cache_entry_states.h b/xlat/neighbor_cache_entry_states.h new file mode 100644 index 00000000..d111697c --- /dev/null +++ b/xlat/neighbor_cache_entry_states.h @@ -0,0 +1,49 @@ +/* Generated by ./xlat/gen.sh from ./xlat/neighbor_cache_entry_states.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat neighbor_cache_entry_states in mpers mode + +# else + +static +const struct xlat neighbor_cache_entry_states[] = { +#if defined(NUD_INCOMPLETE) || (defined(HAVE_DECL_NUD_INCOMPLETE) && HAVE_DECL_NUD_INCOMPLETE) + XLAT(NUD_INCOMPLETE), +#endif +#if defined(NUD_REACHABLE) || (defined(HAVE_DECL_NUD_REACHABLE) && HAVE_DECL_NUD_REACHABLE) + XLAT(NUD_REACHABLE), +#endif +#if defined(NUD_STALE) || (defined(HAVE_DECL_NUD_STALE) && HAVE_DECL_NUD_STALE) + XLAT(NUD_STALE), +#endif +#if defined(NUD_DELAY) || (defined(HAVE_DECL_NUD_DELAY) && HAVE_DECL_NUD_DELAY) + XLAT(NUD_DELAY), +#endif +#if defined(NUD_PROBE) || (defined(HAVE_DECL_NUD_PROBE) && HAVE_DECL_NUD_PROBE) + XLAT(NUD_PROBE), +#endif +#if defined(NUD_FAILED) || (defined(HAVE_DECL_NUD_FAILED) && HAVE_DECL_NUD_FAILED) + XLAT(NUD_FAILED), +#endif +#if defined(NUD_NOARP) || (defined(HAVE_DECL_NUD_NOARP) && HAVE_DECL_NUD_NOARP) + XLAT(NUD_NOARP), +#endif +#if defined(NUD_PERMANENT) || (defined(HAVE_DECL_NUD_PERMANENT) && HAVE_DECL_NUD_PERMANENT) + XLAT(NUD_PERMANENT), +#endif +#if defined(NUD_NONE) || (defined(HAVE_DECL_NUD_NONE) && HAVE_DECL_NUD_NONE) + XLAT(NUD_NONE), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/neighbor_cache_entry_states.in b/xlat/neighbor_cache_entry_states.in new file mode 100644 index 00000000..5ae9c4da --- /dev/null +++ b/xlat/neighbor_cache_entry_states.in @@ -0,0 +1,9 @@ +NUD_INCOMPLETE +NUD_REACHABLE +NUD_STALE +NUD_DELAY +NUD_PROBE +NUD_FAILED +NUD_NOARP +NUD_PERMANENT +NUD_NONE diff --git a/xlat/netfilter_versions.h b/xlat/netfilter_versions.h new file mode 100644 index 00000000..9ccfd5a5 --- /dev/null +++ b/xlat/netfilter_versions.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/netfilter_versions.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NFNETLINK_V0) || (defined(HAVE_DECL_NFNETLINK_V0) && HAVE_DECL_NFNETLINK_V0) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNETLINK_V0) == (0), "NFNETLINK_V0 != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNETLINK_V0 0 +#endif +#if defined(NFNETLINK_V1) || (defined(HAVE_DECL_NFNETLINK_V1) && HAVE_DECL_NFNETLINK_V1) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNETLINK_V1) == (1), "NFNETLINK_V1 != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNETLINK_V1 1 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat netfilter_versions in mpers mode + +# else + +static +const struct xlat netfilter_versions[] = { + XLAT(NFNETLINK_V0), + XLAT(NFNETLINK_V1), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/netfilter_versions.in b/xlat/netfilter_versions.in new file mode 100644 index 00000000..09afc8e9 --- /dev/null +++ b/xlat/netfilter_versions.in @@ -0,0 +1,2 @@ +NFNETLINK_V0 0 +NFNETLINK_V1 1 diff --git a/xlat/netlink_ack_flags.h b/xlat/netlink_ack_flags.h new file mode 100644 index 00000000..dbe197d7 --- /dev/null +++ b/xlat/netlink_ack_flags.h @@ -0,0 +1,28 @@ +/* Generated by ./xlat/gen.sh from ./xlat/netlink_ack_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat netlink_ack_flags in mpers mode + +# else + +static +const struct xlat netlink_ack_flags[] = { +#if defined(NLM_F_CAPPED) || (defined(HAVE_DECL_NLM_F_CAPPED) && HAVE_DECL_NLM_F_CAPPED) + XLAT(NLM_F_CAPPED), +#endif +#if defined(NLM_F_ACK_TLVS) || (defined(HAVE_DECL_NLM_F_ACK_TLVS) && HAVE_DECL_NLM_F_ACK_TLVS) + XLAT(NLM_F_ACK_TLVS), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/netlink_ack_flags.in b/xlat/netlink_ack_flags.in new file mode 100644 index 00000000..2aabb840 --- /dev/null +++ b/xlat/netlink_ack_flags.in @@ -0,0 +1,2 @@ +NLM_F_CAPPED +NLM_F_ACK_TLVS diff --git a/xlat/netlink_delete_flags.h b/xlat/netlink_delete_flags.h new file mode 100644 index 00000000..4fe0db55 --- /dev/null +++ b/xlat/netlink_delete_flags.h @@ -0,0 +1,25 @@ +/* Generated by ./xlat/gen.sh from ./xlat/netlink_delete_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat netlink_delete_flags in mpers mode + +# else + +static +const struct xlat netlink_delete_flags[] = { +#if defined(NLM_F_NONREC) || (defined(HAVE_DECL_NLM_F_NONREC) && HAVE_DECL_NLM_F_NONREC) + XLAT(NLM_F_NONREC), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/netlink_delete_flags.in b/xlat/netlink_delete_flags.in new file mode 100644 index 00000000..01af41db --- /dev/null +++ b/xlat/netlink_delete_flags.in @@ -0,0 +1 @@ +NLM_F_NONREC diff --git a/xlat/netlink_diag_attrs.h b/xlat/netlink_diag_attrs.h new file mode 100644 index 00000000..fd8cd4f2 --- /dev/null +++ b/xlat/netlink_diag_attrs.h @@ -0,0 +1,27 @@ +/* Generated by ./xlat/gen.sh from ./xlat/netlink_diag_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat netlink_diag_attrs in mpers mode + +# else + +static +const struct xlat netlink_diag_attrs[] = { + XLAT(NETLINK_DIAG_MEMINFO), + XLAT(NETLINK_DIAG_GROUPS), + XLAT(NETLINK_DIAG_RX_RING), + XLAT(NETLINK_DIAG_TX_RING), + XLAT(NETLINK_DIAG_FLAGS), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/netlink_diag_attrs.in b/xlat/netlink_diag_attrs.in new file mode 100644 index 00000000..41e9a7a5 --- /dev/null +++ b/xlat/netlink_diag_attrs.in @@ -0,0 +1,6 @@ +#unconditional +NETLINK_DIAG_MEMINFO +NETLINK_DIAG_GROUPS +NETLINK_DIAG_RX_RING +NETLINK_DIAG_TX_RING +NETLINK_DIAG_FLAGS diff --git a/xlat/netlink_diag_show.h b/xlat/netlink_diag_show.h new file mode 100644 index 00000000..e7afb750 --- /dev/null +++ b/xlat/netlink_diag_show.h @@ -0,0 +1,34 @@ +/* Generated by ./xlat/gen.sh from ./xlat/netlink_diag_show.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat netlink_diag_show in mpers mode + +# else + +static +const struct xlat netlink_diag_show[] = { +#if defined(NDIAG_SHOW_MEMINFO) || (defined(HAVE_DECL_NDIAG_SHOW_MEMINFO) && HAVE_DECL_NDIAG_SHOW_MEMINFO) + XLAT(NDIAG_SHOW_MEMINFO), +#endif +#if defined(NDIAG_SHOW_GROUPS) || (defined(HAVE_DECL_NDIAG_SHOW_GROUPS) && HAVE_DECL_NDIAG_SHOW_GROUPS) + XLAT(NDIAG_SHOW_GROUPS), +#endif +#if defined(NDIAG_SHOW_RING_CFG) || (defined(HAVE_DECL_NDIAG_SHOW_RING_CFG) && HAVE_DECL_NDIAG_SHOW_RING_CFG) + XLAT(NDIAG_SHOW_RING_CFG), +#endif +#if defined(NDIAG_SHOW_FLAGS) || (defined(HAVE_DECL_NDIAG_SHOW_FLAGS) && HAVE_DECL_NDIAG_SHOW_FLAGS) + XLAT(NDIAG_SHOW_FLAGS), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/netlink_diag_show.in b/xlat/netlink_diag_show.in new file mode 100644 index 00000000..eee9620e --- /dev/null +++ b/xlat/netlink_diag_show.in @@ -0,0 +1,4 @@ +NDIAG_SHOW_MEMINFO +NDIAG_SHOW_GROUPS +NDIAG_SHOW_RING_CFG +NDIAG_SHOW_FLAGS diff --git a/xlat/netlink_flags.h b/xlat/netlink_flags.h index ca1f3a31..217c9dfa 100644 --- a/xlat/netlink_flags.h +++ b/xlat/netlink_flags.h @@ -1,28 +1,58 @@ /* Generated by ./xlat/gen.sh from ./xlat/netlink_flags.in; do not edit. */ -#if !(defined(NLM_F_REQUEST) || (defined(HAVE_DECL_NLM_F_REQUEST) && HAVE_DECL_NLM_F_REQUEST)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NLM_F_REQUEST) || (defined(HAVE_DECL_NLM_F_REQUEST) && HAVE_DECL_NLM_F_REQUEST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NLM_F_REQUEST) == (0x1), "NLM_F_REQUEST != 0x1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NLM_F_REQUEST 0x1 #endif -#if !(defined(NLM_F_MULTI) || (defined(HAVE_DECL_NLM_F_MULTI) && HAVE_DECL_NLM_F_MULTI)) +#if defined(NLM_F_MULTI) || (defined(HAVE_DECL_NLM_F_MULTI) && HAVE_DECL_NLM_F_MULTI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NLM_F_MULTI) == (0x2), "NLM_F_MULTI != 0x2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NLM_F_MULTI 0x2 #endif -#if !(defined(NLM_F_ACK) || (defined(HAVE_DECL_NLM_F_ACK) && HAVE_DECL_NLM_F_ACK)) +#if defined(NLM_F_ACK) || (defined(HAVE_DECL_NLM_F_ACK) && HAVE_DECL_NLM_F_ACK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NLM_F_ACK) == (0x4), "NLM_F_ACK != 0x4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NLM_F_ACK 0x4 #endif -#if !(defined(NLM_F_ECHO) || (defined(HAVE_DECL_NLM_F_ECHO) && HAVE_DECL_NLM_F_ECHO)) +#if defined(NLM_F_ECHO) || (defined(HAVE_DECL_NLM_F_ECHO) && HAVE_DECL_NLM_F_ECHO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NLM_F_ECHO) == (0x8), "NLM_F_ECHO != 0x8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NLM_F_ECHO 0x8 #endif -#if !(defined(NLM_F_DUMP_INTR) || (defined(HAVE_DECL_NLM_F_DUMP_INTR) && HAVE_DECL_NLM_F_DUMP_INTR)) +#if defined(NLM_F_DUMP_INTR) || (defined(HAVE_DECL_NLM_F_DUMP_INTR) && HAVE_DECL_NLM_F_DUMP_INTR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NLM_F_DUMP_INTR) == (0x10), "NLM_F_DUMP_INTR != 0x10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NLM_F_DUMP_INTR 0x10 #endif -#if !(defined(NLM_F_DUMP_FILTERED) || (defined(HAVE_DECL_NLM_F_DUMP_FILTERED) && HAVE_DECL_NLM_F_DUMP_FILTERED)) +#if defined(NLM_F_DUMP_FILTERED) || (defined(HAVE_DECL_NLM_F_DUMP_FILTERED) && HAVE_DECL_NLM_F_DUMP_FILTERED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NLM_F_DUMP_FILTERED) == (0x20), "NLM_F_DUMP_FILTERED != 0x20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NLM_F_DUMP_FILTERED 0x20 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat netlink_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat netlink_flags in mpers mode + +# else static const struct xlat netlink_flags[] = { @@ -35,4 +65,6 @@ const struct xlat netlink_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/netlink_get_flags.h b/xlat/netlink_get_flags.h new file mode 100644 index 00000000..4855c782 --- /dev/null +++ b/xlat/netlink_get_flags.h @@ -0,0 +1,34 @@ +/* Generated by ./xlat/gen.sh from ./xlat/netlink_get_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat netlink_get_flags in mpers mode + +# else + +static +const struct xlat netlink_get_flags[] = { +#if defined(NLM_F_DUMP) || (defined(HAVE_DECL_NLM_F_DUMP) && HAVE_DECL_NLM_F_DUMP) + XLAT(NLM_F_DUMP), +#endif +#if defined(NLM_F_ROOT) || (defined(HAVE_DECL_NLM_F_ROOT) && HAVE_DECL_NLM_F_ROOT) + XLAT(NLM_F_ROOT), +#endif +#if defined(NLM_F_MATCH) || (defined(HAVE_DECL_NLM_F_MATCH) && HAVE_DECL_NLM_F_MATCH) + XLAT(NLM_F_MATCH), +#endif +#if defined(NLM_F_ATOMIC) || (defined(HAVE_DECL_NLM_F_ATOMIC) && HAVE_DECL_NLM_F_ATOMIC) + XLAT(NLM_F_ATOMIC), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/netlink_get_flags.in b/xlat/netlink_get_flags.in new file mode 100644 index 00000000..96ab4a06 --- /dev/null +++ b/xlat/netlink_get_flags.in @@ -0,0 +1,4 @@ +NLM_F_DUMP +NLM_F_ROOT +NLM_F_MATCH +NLM_F_ATOMIC diff --git a/xlat/netlink_new_flags.h b/xlat/netlink_new_flags.h new file mode 100644 index 00000000..372432c4 --- /dev/null +++ b/xlat/netlink_new_flags.h @@ -0,0 +1,34 @@ +/* Generated by ./xlat/gen.sh from ./xlat/netlink_new_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat netlink_new_flags in mpers mode + +# else + +static +const struct xlat netlink_new_flags[] = { +#if defined(NLM_F_REPLACE) || (defined(HAVE_DECL_NLM_F_REPLACE) && HAVE_DECL_NLM_F_REPLACE) + XLAT(NLM_F_REPLACE), +#endif +#if defined(NLM_F_EXCL) || (defined(HAVE_DECL_NLM_F_EXCL) && HAVE_DECL_NLM_F_EXCL) + XLAT(NLM_F_EXCL), +#endif +#if defined(NLM_F_CREATE) || (defined(HAVE_DECL_NLM_F_CREATE) && HAVE_DECL_NLM_F_CREATE) + XLAT(NLM_F_CREATE), +#endif +#if defined(NLM_F_APPEND) || (defined(HAVE_DECL_NLM_F_APPEND) && HAVE_DECL_NLM_F_APPEND) + XLAT(NLM_F_APPEND), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/netlink_new_flags.in b/xlat/netlink_new_flags.in new file mode 100644 index 00000000..4ef2fea6 --- /dev/null +++ b/xlat/netlink_new_flags.in @@ -0,0 +1,4 @@ +NLM_F_REPLACE +NLM_F_EXCL +NLM_F_CREATE +NLM_F_APPEND diff --git a/xlat/netlink_protocols.h b/xlat/netlink_protocols.h index 0e1133fd..36845dc9 100644 --- a/xlat/netlink_protocols.h +++ b/xlat/netlink_protocols.h @@ -1,75 +1,167 @@ /* Generated by ./xlat/gen.sh from ./xlat/netlink_protocols.in; do not edit. */ -#if !(defined(NETLINK_ROUTE) || (defined(HAVE_DECL_NETLINK_ROUTE) && HAVE_DECL_NETLINK_ROUTE)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NETLINK_ROUTE) || (defined(HAVE_DECL_NETLINK_ROUTE) && HAVE_DECL_NETLINK_ROUTE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_ROUTE) == (0), "NETLINK_ROUTE != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NETLINK_ROUTE 0 #endif -#if !(defined(NETLINK_UNUSED) || (defined(HAVE_DECL_NETLINK_UNUSED) && HAVE_DECL_NETLINK_UNUSED)) +#if defined(NETLINK_UNUSED) || (defined(HAVE_DECL_NETLINK_UNUSED) && HAVE_DECL_NETLINK_UNUSED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_UNUSED) == (1), "NETLINK_UNUSED != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NETLINK_UNUSED 1 #endif -#if !(defined(NETLINK_USERSOCK) || (defined(HAVE_DECL_NETLINK_USERSOCK) && HAVE_DECL_NETLINK_USERSOCK)) +#if defined(NETLINK_USERSOCK) || (defined(HAVE_DECL_NETLINK_USERSOCK) && HAVE_DECL_NETLINK_USERSOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_USERSOCK) == (2), "NETLINK_USERSOCK != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NETLINK_USERSOCK 2 #endif -#if !(defined(NETLINK_FIREWALL) || (defined(HAVE_DECL_NETLINK_FIREWALL) && HAVE_DECL_NETLINK_FIREWALL)) +#if defined(NETLINK_FIREWALL) || (defined(HAVE_DECL_NETLINK_FIREWALL) && HAVE_DECL_NETLINK_FIREWALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_FIREWALL) == (3), "NETLINK_FIREWALL != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NETLINK_FIREWALL 3 #endif -#if !(defined(NETLINK_SOCK_DIAG) || (defined(HAVE_DECL_NETLINK_SOCK_DIAG) && HAVE_DECL_NETLINK_SOCK_DIAG)) +#if defined(NETLINK_SOCK_DIAG) || (defined(HAVE_DECL_NETLINK_SOCK_DIAG) && HAVE_DECL_NETLINK_SOCK_DIAG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_SOCK_DIAG) == (4), "NETLINK_SOCK_DIAG != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NETLINK_SOCK_DIAG 4 #endif -#if !(defined(NETLINK_NFLOG) || (defined(HAVE_DECL_NETLINK_NFLOG) && HAVE_DECL_NETLINK_NFLOG)) +#if defined(NETLINK_NFLOG) || (defined(HAVE_DECL_NETLINK_NFLOG) && HAVE_DECL_NETLINK_NFLOG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_NFLOG) == (5), "NETLINK_NFLOG != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NETLINK_NFLOG 5 #endif -#if !(defined(NETLINK_XFRM) || (defined(HAVE_DECL_NETLINK_XFRM) && HAVE_DECL_NETLINK_XFRM)) +#if defined(NETLINK_XFRM) || (defined(HAVE_DECL_NETLINK_XFRM) && HAVE_DECL_NETLINK_XFRM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_XFRM) == (6), "NETLINK_XFRM != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NETLINK_XFRM 6 #endif -#if !(defined(NETLINK_SELINUX) || (defined(HAVE_DECL_NETLINK_SELINUX) && HAVE_DECL_NETLINK_SELINUX)) +#if defined(NETLINK_SELINUX) || (defined(HAVE_DECL_NETLINK_SELINUX) && HAVE_DECL_NETLINK_SELINUX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_SELINUX) == (7), "NETLINK_SELINUX != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NETLINK_SELINUX 7 #endif -#if !(defined(NETLINK_ISCSI) || (defined(HAVE_DECL_NETLINK_ISCSI) && HAVE_DECL_NETLINK_ISCSI)) +#if defined(NETLINK_ISCSI) || (defined(HAVE_DECL_NETLINK_ISCSI) && HAVE_DECL_NETLINK_ISCSI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_ISCSI) == (8), "NETLINK_ISCSI != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NETLINK_ISCSI 8 #endif -#if !(defined(NETLINK_AUDIT) || (defined(HAVE_DECL_NETLINK_AUDIT) && HAVE_DECL_NETLINK_AUDIT)) +#if defined(NETLINK_AUDIT) || (defined(HAVE_DECL_NETLINK_AUDIT) && HAVE_DECL_NETLINK_AUDIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_AUDIT) == (9), "NETLINK_AUDIT != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NETLINK_AUDIT 9 #endif -#if !(defined(NETLINK_FIB_LOOKUP) || (defined(HAVE_DECL_NETLINK_FIB_LOOKUP) && HAVE_DECL_NETLINK_FIB_LOOKUP)) +#if defined(NETLINK_FIB_LOOKUP) || (defined(HAVE_DECL_NETLINK_FIB_LOOKUP) && HAVE_DECL_NETLINK_FIB_LOOKUP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_FIB_LOOKUP) == (10), "NETLINK_FIB_LOOKUP != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NETLINK_FIB_LOOKUP 10 #endif -#if !(defined(NETLINK_CONNECTOR) || (defined(HAVE_DECL_NETLINK_CONNECTOR) && HAVE_DECL_NETLINK_CONNECTOR)) +#if defined(NETLINK_CONNECTOR) || (defined(HAVE_DECL_NETLINK_CONNECTOR) && HAVE_DECL_NETLINK_CONNECTOR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_CONNECTOR) == (11), "NETLINK_CONNECTOR != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NETLINK_CONNECTOR 11 #endif -#if !(defined(NETLINK_NETFILTER) || (defined(HAVE_DECL_NETLINK_NETFILTER) && HAVE_DECL_NETLINK_NETFILTER)) +#if defined(NETLINK_NETFILTER) || (defined(HAVE_DECL_NETLINK_NETFILTER) && HAVE_DECL_NETLINK_NETFILTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_NETFILTER) == (12), "NETLINK_NETFILTER != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NETLINK_NETFILTER 12 #endif -#if !(defined(NETLINK_IP6_FW) || (defined(HAVE_DECL_NETLINK_IP6_FW) && HAVE_DECL_NETLINK_IP6_FW)) +#if defined(NETLINK_IP6_FW) || (defined(HAVE_DECL_NETLINK_IP6_FW) && HAVE_DECL_NETLINK_IP6_FW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_IP6_FW) == (13), "NETLINK_IP6_FW != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NETLINK_IP6_FW 13 #endif -#if !(defined(NETLINK_DNRTMSG) || (defined(HAVE_DECL_NETLINK_DNRTMSG) && HAVE_DECL_NETLINK_DNRTMSG)) +#if defined(NETLINK_DNRTMSG) || (defined(HAVE_DECL_NETLINK_DNRTMSG) && HAVE_DECL_NETLINK_DNRTMSG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_DNRTMSG) == (14), "NETLINK_DNRTMSG != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NETLINK_DNRTMSG 14 #endif -#if !(defined(NETLINK_KOBJECT_UEVENT) || (defined(HAVE_DECL_NETLINK_KOBJECT_UEVENT) && HAVE_DECL_NETLINK_KOBJECT_UEVENT)) +#if defined(NETLINK_KOBJECT_UEVENT) || (defined(HAVE_DECL_NETLINK_KOBJECT_UEVENT) && HAVE_DECL_NETLINK_KOBJECT_UEVENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_KOBJECT_UEVENT) == (15), "NETLINK_KOBJECT_UEVENT != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NETLINK_KOBJECT_UEVENT 15 #endif -#if !(defined(NETLINK_GENERIC) || (defined(HAVE_DECL_NETLINK_GENERIC) && HAVE_DECL_NETLINK_GENERIC)) +#if defined(NETLINK_GENERIC) || (defined(HAVE_DECL_NETLINK_GENERIC) && HAVE_DECL_NETLINK_GENERIC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_GENERIC) == (16), "NETLINK_GENERIC != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NETLINK_GENERIC 16 #endif -#if !(defined(NETLINK_SCSITRANSPORT) || (defined(HAVE_DECL_NETLINK_SCSITRANSPORT) && HAVE_DECL_NETLINK_SCSITRANSPORT)) +#if defined(NETLINK_SCSITRANSPORT) || (defined(HAVE_DECL_NETLINK_SCSITRANSPORT) && HAVE_DECL_NETLINK_SCSITRANSPORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_SCSITRANSPORT) == (18), "NETLINK_SCSITRANSPORT != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NETLINK_SCSITRANSPORT 18 #endif -#if !(defined(NETLINK_ECRYPTFS) || (defined(HAVE_DECL_NETLINK_ECRYPTFS) && HAVE_DECL_NETLINK_ECRYPTFS)) +#if defined(NETLINK_ECRYPTFS) || (defined(HAVE_DECL_NETLINK_ECRYPTFS) && HAVE_DECL_NETLINK_ECRYPTFS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_ECRYPTFS) == (19), "NETLINK_ECRYPTFS != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NETLINK_ECRYPTFS 19 #endif -#if !(defined(NETLINK_RDMA) || (defined(HAVE_DECL_NETLINK_RDMA) && HAVE_DECL_NETLINK_RDMA)) +#if defined(NETLINK_RDMA) || (defined(HAVE_DECL_NETLINK_RDMA) && HAVE_DECL_NETLINK_RDMA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_RDMA) == (20), "NETLINK_RDMA != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NETLINK_RDMA 20 #endif -#if !(defined(NETLINK_CRYPTO) || (defined(HAVE_DECL_NETLINK_CRYPTO) && HAVE_DECL_NETLINK_CRYPTO)) +#if defined(NETLINK_CRYPTO) || (defined(HAVE_DECL_NETLINK_CRYPTO) && HAVE_DECL_NETLINK_CRYPTO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_CRYPTO) == (21), "NETLINK_CRYPTO != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NETLINK_CRYPTO 21 #endif +#if defined(NETLINK_SMC) || (defined(HAVE_DECL_NETLINK_SMC) && HAVE_DECL_NETLINK_SMC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_SMC) == (22), "NETLINK_SMC != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETLINK_SMC 22 +#endif -#ifdef IN_MPERS - -# error static const struct xlat netlink_protocols in mpers mode +#ifndef XLAT_MACROS_ONLY -#else +# ifndef IN_MPERS -static const struct xlat netlink_protocols[] = { XLAT(NETLINK_ROUTE), XLAT(NETLINK_UNUSED), @@ -92,7 +184,10 @@ const struct xlat netlink_protocols[] = { XLAT(NETLINK_ECRYPTFS), XLAT(NETLINK_RDMA), XLAT(NETLINK_CRYPTO), + XLAT(NETLINK_SMC), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/netlink_protocols.in b/xlat/netlink_protocols.in index 45116cf0..a76ebd7e 100644 --- a/xlat/netlink_protocols.in +++ b/xlat/netlink_protocols.in @@ -19,3 +19,4 @@ NETLINK_SCSITRANSPORT 18 NETLINK_ECRYPTFS 19 NETLINK_RDMA 20 NETLINK_CRYPTO 21 +NETLINK_SMC 22 diff --git a/xlat/netlink_sk_meminfo_indices.h b/xlat/netlink_sk_meminfo_indices.h new file mode 100644 index 00000000..9d36e152 --- /dev/null +++ b/xlat/netlink_sk_meminfo_indices.h @@ -0,0 +1,94 @@ +/* Generated by ./xlat/gen.sh from ./xlat/netlink_sk_meminfo_indices.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SK_MEMINFO_RMEM_ALLOC) || (defined(HAVE_DECL_SK_MEMINFO_RMEM_ALLOC) && HAVE_DECL_SK_MEMINFO_RMEM_ALLOC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SK_MEMINFO_RMEM_ALLOC) == (0), "SK_MEMINFO_RMEM_ALLOC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SK_MEMINFO_RMEM_ALLOC 0 +#endif +#if defined(SK_MEMINFO_RCVBUF) || (defined(HAVE_DECL_SK_MEMINFO_RCVBUF) && HAVE_DECL_SK_MEMINFO_RCVBUF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SK_MEMINFO_RCVBUF) == (1), "SK_MEMINFO_RCVBUF != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SK_MEMINFO_RCVBUF 1 +#endif +#if defined(SK_MEMINFO_WMEM_ALLOC) || (defined(HAVE_DECL_SK_MEMINFO_WMEM_ALLOC) && HAVE_DECL_SK_MEMINFO_WMEM_ALLOC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SK_MEMINFO_WMEM_ALLOC) == (2), "SK_MEMINFO_WMEM_ALLOC != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SK_MEMINFO_WMEM_ALLOC 2 +#endif +#if defined(SK_MEMINFO_SNDBUF) || (defined(HAVE_DECL_SK_MEMINFO_SNDBUF) && HAVE_DECL_SK_MEMINFO_SNDBUF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SK_MEMINFO_SNDBUF) == (3), "SK_MEMINFO_SNDBUF != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SK_MEMINFO_SNDBUF 3 +#endif +#if defined(SK_MEMINFO_FWD_ALLOC) || (defined(HAVE_DECL_SK_MEMINFO_FWD_ALLOC) && HAVE_DECL_SK_MEMINFO_FWD_ALLOC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SK_MEMINFO_FWD_ALLOC) == (4), "SK_MEMINFO_FWD_ALLOC != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SK_MEMINFO_FWD_ALLOC 4 +#endif +#if defined(SK_MEMINFO_WMEM_QUEUED) || (defined(HAVE_DECL_SK_MEMINFO_WMEM_QUEUED) && HAVE_DECL_SK_MEMINFO_WMEM_QUEUED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SK_MEMINFO_WMEM_QUEUED) == (5), "SK_MEMINFO_WMEM_QUEUED != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SK_MEMINFO_WMEM_QUEUED 5 +#endif +#if defined(SK_MEMINFO_OPTMEM) || (defined(HAVE_DECL_SK_MEMINFO_OPTMEM) && HAVE_DECL_SK_MEMINFO_OPTMEM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SK_MEMINFO_OPTMEM) == (6), "SK_MEMINFO_OPTMEM != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SK_MEMINFO_OPTMEM 6 +#endif +#if defined(SK_MEMINFO_BACKLOG) || (defined(HAVE_DECL_SK_MEMINFO_BACKLOG) && HAVE_DECL_SK_MEMINFO_BACKLOG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SK_MEMINFO_BACKLOG) == (7), "SK_MEMINFO_BACKLOG != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SK_MEMINFO_BACKLOG 7 +#endif +#if defined(SK_MEMINFO_DROPS) || (defined(HAVE_DECL_SK_MEMINFO_DROPS) && HAVE_DECL_SK_MEMINFO_DROPS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SK_MEMINFO_DROPS) == (8), "SK_MEMINFO_DROPS != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SK_MEMINFO_DROPS 8 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat netlink_sk_meminfo_indices in mpers mode + +# else + +static +const struct xlat netlink_sk_meminfo_indices[] = { + [SK_MEMINFO_RMEM_ALLOC] = XLAT(SK_MEMINFO_RMEM_ALLOC), + [SK_MEMINFO_RCVBUF] = XLAT(SK_MEMINFO_RCVBUF), + [SK_MEMINFO_WMEM_ALLOC] = XLAT(SK_MEMINFO_WMEM_ALLOC), + [SK_MEMINFO_SNDBUF] = XLAT(SK_MEMINFO_SNDBUF), + [SK_MEMINFO_FWD_ALLOC] = XLAT(SK_MEMINFO_FWD_ALLOC), + [SK_MEMINFO_WMEM_QUEUED] = XLAT(SK_MEMINFO_WMEM_QUEUED), + [SK_MEMINFO_OPTMEM] = XLAT(SK_MEMINFO_OPTMEM), + [SK_MEMINFO_BACKLOG] = XLAT(SK_MEMINFO_BACKLOG), + [SK_MEMINFO_DROPS] = XLAT(SK_MEMINFO_DROPS), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/netlink_sk_meminfo_indices.in b/xlat/netlink_sk_meminfo_indices.in new file mode 100644 index 00000000..1e2f7950 --- /dev/null +++ b/xlat/netlink_sk_meminfo_indices.in @@ -0,0 +1,10 @@ +#value_indexed +SK_MEMINFO_RMEM_ALLOC 0 +SK_MEMINFO_RCVBUF 1 +SK_MEMINFO_WMEM_ALLOC 2 +SK_MEMINFO_SNDBUF 3 +SK_MEMINFO_FWD_ALLOC 4 +SK_MEMINFO_WMEM_QUEUED 5 +SK_MEMINFO_OPTMEM 6 +SK_MEMINFO_BACKLOG 7 +SK_MEMINFO_DROPS 8 diff --git a/xlat/netlink_socket_flags.h b/xlat/netlink_socket_flags.h new file mode 100644 index 00000000..7c090d24 --- /dev/null +++ b/xlat/netlink_socket_flags.h @@ -0,0 +1,40 @@ +/* Generated by ./xlat/gen.sh from ./xlat/netlink_socket_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat netlink_socket_flags in mpers mode + +# else + +static +const struct xlat netlink_socket_flags[] = { +#if defined(NDIAG_FLAG_CB_RUNNING) || (defined(HAVE_DECL_NDIAG_FLAG_CB_RUNNING) && HAVE_DECL_NDIAG_FLAG_CB_RUNNING) + XLAT(NDIAG_FLAG_CB_RUNNING), +#endif +#if defined(NDIAG_FLAG_PKTINFO) || (defined(HAVE_DECL_NDIAG_FLAG_PKTINFO) && HAVE_DECL_NDIAG_FLAG_PKTINFO) + XLAT(NDIAG_FLAG_PKTINFO), +#endif +#if defined(NDIAG_FLAG_BROADCAST_ERROR) || (defined(HAVE_DECL_NDIAG_FLAG_BROADCAST_ERROR) && HAVE_DECL_NDIAG_FLAG_BROADCAST_ERROR) + XLAT(NDIAG_FLAG_BROADCAST_ERROR), +#endif +#if defined(NDIAG_FLAG_NO_ENOBUFS) || (defined(HAVE_DECL_NDIAG_FLAG_NO_ENOBUFS) && HAVE_DECL_NDIAG_FLAG_NO_ENOBUFS) + XLAT(NDIAG_FLAG_NO_ENOBUFS), +#endif +#if defined(NDIAG_FLAG_LISTEN_ALL_NSID) || (defined(HAVE_DECL_NDIAG_FLAG_LISTEN_ALL_NSID) && HAVE_DECL_NDIAG_FLAG_LISTEN_ALL_NSID) + XLAT(NDIAG_FLAG_LISTEN_ALL_NSID), +#endif +#if defined(NDIAG_FLAG_CAP_ACK) || (defined(HAVE_DECL_NDIAG_FLAG_CAP_ACK) && HAVE_DECL_NDIAG_FLAG_CAP_ACK) + XLAT(NDIAG_FLAG_CAP_ACK), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/netlink_socket_flags.in b/xlat/netlink_socket_flags.in new file mode 100644 index 00000000..f36e35c6 --- /dev/null +++ b/xlat/netlink_socket_flags.in @@ -0,0 +1,6 @@ +NDIAG_FLAG_CB_RUNNING +NDIAG_FLAG_PKTINFO +NDIAG_FLAG_BROADCAST_ERROR +NDIAG_FLAG_NO_ENOBUFS +NDIAG_FLAG_LISTEN_ALL_NSID +NDIAG_FLAG_CAP_ACK diff --git a/xlat/netlink_states.h b/xlat/netlink_states.h new file mode 100644 index 00000000..9f3ae565 --- /dev/null +++ b/xlat/netlink_states.h @@ -0,0 +1,47 @@ +/* Generated by ./xlat/gen.sh from ./xlat/netlink_states.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NETLINK_UNCONNECTED) || (defined(HAVE_DECL_NETLINK_UNCONNECTED) && HAVE_DECL_NETLINK_UNCONNECTED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_UNCONNECTED) == (0), "NETLINK_UNCONNECTED != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETLINK_UNCONNECTED 0 +#endif +#if defined(NETLINK_CONNECTED) || (defined(HAVE_DECL_NETLINK_CONNECTED) && HAVE_DECL_NETLINK_CONNECTED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_CONNECTED) == (1), "NETLINK_CONNECTED != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETLINK_CONNECTED 1 +#endif +#if defined(TCP_CLOSE) || (defined(HAVE_DECL_TCP_CLOSE) && HAVE_DECL_TCP_CLOSE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_CLOSE) == (7), "TCP_CLOSE != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_CLOSE 7 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat netlink_states in mpers mode + +# else + +static +const struct xlat netlink_states[] = { + XLAT(NETLINK_UNCONNECTED), + XLAT(NETLINK_CONNECTED), + + XLAT(TCP_CLOSE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/netlink_states.in b/xlat/netlink_states.in new file mode 100644 index 00000000..d2ffb7bc --- /dev/null +++ b/xlat/netlink_states.in @@ -0,0 +1,4 @@ +NETLINK_UNCONNECTED 0 +NETLINK_CONNECTED 1 +/* The initial socket state, as set by net/code/sock.c:sock_init_data */ +TCP_CLOSE 7 diff --git a/xlat/netlink_types.h b/xlat/netlink_types.h index 96031f2a..f6d44a38 100644 --- a/xlat/netlink_types.h +++ b/xlat/netlink_types.h @@ -1,22 +1,44 @@ /* Generated by ./xlat/gen.sh from ./xlat/netlink_types.in; do not edit. */ -#if !(defined(NLMSG_NOOP) || (defined(HAVE_DECL_NLMSG_NOOP) && HAVE_DECL_NLMSG_NOOP)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NLMSG_NOOP) || (defined(HAVE_DECL_NLMSG_NOOP) && HAVE_DECL_NLMSG_NOOP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NLMSG_NOOP) == (0x1), "NLMSG_NOOP != 0x1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NLMSG_NOOP 0x1 #endif -#if !(defined(NLMSG_ERROR) || (defined(HAVE_DECL_NLMSG_ERROR) && HAVE_DECL_NLMSG_ERROR)) +#if defined(NLMSG_ERROR) || (defined(HAVE_DECL_NLMSG_ERROR) && HAVE_DECL_NLMSG_ERROR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NLMSG_ERROR) == (0x2), "NLMSG_ERROR != 0x2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NLMSG_ERROR 0x2 #endif -#if !(defined(NLMSG_DONE) || (defined(HAVE_DECL_NLMSG_DONE) && HAVE_DECL_NLMSG_DONE)) +#if defined(NLMSG_DONE) || (defined(HAVE_DECL_NLMSG_DONE) && HAVE_DECL_NLMSG_DONE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NLMSG_DONE) == (0x3), "NLMSG_DONE != 0x3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NLMSG_DONE 0x3 #endif -#if !(defined(NLMSG_OVERRUN) || (defined(HAVE_DECL_NLMSG_OVERRUN) && HAVE_DECL_NLMSG_OVERRUN)) +#if defined(NLMSG_OVERRUN) || (defined(HAVE_DECL_NLMSG_OVERRUN) && HAVE_DECL_NLMSG_OVERRUN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NLMSG_OVERRUN) == (0x4), "NLMSG_OVERRUN != 0x4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define NLMSG_OVERRUN 0x4 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat netlink_types in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat netlink_types in mpers mode + +# else static const struct xlat netlink_types[] = { @@ -27,4 +49,6 @@ const struct xlat netlink_types[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nf_acct_msg_types.h b/xlat/nf_acct_msg_types.h new file mode 100644 index 00000000..d0584b37 --- /dev/null +++ b/xlat/nf_acct_msg_types.h @@ -0,0 +1,62 @@ +/* Generated by ./xlat/gen.sh from ./xlat/nf_acct_msg_types.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NFNL_MSG_ACCT_NEW) || (defined(HAVE_DECL_NFNL_MSG_ACCT_NEW) && HAVE_DECL_NFNL_MSG_ACCT_NEW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNL_MSG_ACCT_NEW) == (0), "NFNL_MSG_ACCT_NEW != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNL_MSG_ACCT_NEW 0 +#endif +#if defined(NFNL_MSG_ACCT_GET) || (defined(HAVE_DECL_NFNL_MSG_ACCT_GET) && HAVE_DECL_NFNL_MSG_ACCT_GET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNL_MSG_ACCT_GET) == (1), "NFNL_MSG_ACCT_GET != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNL_MSG_ACCT_GET 1 +#endif +#if defined(NFNL_MSG_ACCT_GET_CTRZERO) || (defined(HAVE_DECL_NFNL_MSG_ACCT_GET_CTRZERO) && HAVE_DECL_NFNL_MSG_ACCT_GET_CTRZERO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNL_MSG_ACCT_GET_CTRZERO) == (2), "NFNL_MSG_ACCT_GET_CTRZERO != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNL_MSG_ACCT_GET_CTRZERO 2 +#endif +#if defined(NFNL_MSG_ACCT_DEL) || (defined(HAVE_DECL_NFNL_MSG_ACCT_DEL) && HAVE_DECL_NFNL_MSG_ACCT_DEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNL_MSG_ACCT_DEL) == (3), "NFNL_MSG_ACCT_DEL != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNL_MSG_ACCT_DEL 3 +#endif +#if defined(NFNL_MSG_ACCT_OVERQUOTA) || (defined(HAVE_DECL_NFNL_MSG_ACCT_OVERQUOTA) && HAVE_DECL_NFNL_MSG_ACCT_OVERQUOTA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNL_MSG_ACCT_OVERQUOTA) == (4), "NFNL_MSG_ACCT_OVERQUOTA != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNL_MSG_ACCT_OVERQUOTA 4 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat nf_acct_msg_types in mpers mode + +# else + +static +const struct xlat nf_acct_msg_types[] = { + XLAT(NFNL_MSG_ACCT_NEW), + XLAT(NFNL_MSG_ACCT_GET), + XLAT(NFNL_MSG_ACCT_GET_CTRZERO), + XLAT(NFNL_MSG_ACCT_DEL), + XLAT(NFNL_MSG_ACCT_OVERQUOTA), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nf_acct_msg_types.in b/xlat/nf_acct_msg_types.in new file mode 100644 index 00000000..3384ee0d --- /dev/null +++ b/xlat/nf_acct_msg_types.in @@ -0,0 +1,5 @@ +NFNL_MSG_ACCT_NEW 0 +NFNL_MSG_ACCT_GET 1 +NFNL_MSG_ACCT_GET_CTRZERO 2 +NFNL_MSG_ACCT_DEL 3 +NFNL_MSG_ACCT_OVERQUOTA 4 diff --git a/xlat/nf_cthelper_msg_types.h b/xlat/nf_cthelper_msg_types.h new file mode 100644 index 00000000..0fa432a8 --- /dev/null +++ b/xlat/nf_cthelper_msg_types.h @@ -0,0 +1,46 @@ +/* Generated by ./xlat/gen.sh from ./xlat/nf_cthelper_msg_types.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NFNL_MSG_CTHELPER_NEW) || (defined(HAVE_DECL_NFNL_MSG_CTHELPER_NEW) && HAVE_DECL_NFNL_MSG_CTHELPER_NEW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNL_MSG_CTHELPER_NEW) == (0), "NFNL_MSG_CTHELPER_NEW != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNL_MSG_CTHELPER_NEW 0 +#endif +#if defined(NFNL_MSG_CTHELPER_GET) || (defined(HAVE_DECL_NFNL_MSG_CTHELPER_GET) && HAVE_DECL_NFNL_MSG_CTHELPER_GET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNL_MSG_CTHELPER_GET) == (1), "NFNL_MSG_CTHELPER_GET != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNL_MSG_CTHELPER_GET 1 +#endif +#if defined(NFNL_MSG_CTHELPER_DEL) || (defined(HAVE_DECL_NFNL_MSG_CTHELPER_DEL) && HAVE_DECL_NFNL_MSG_CTHELPER_DEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNL_MSG_CTHELPER_DEL) == (2), "NFNL_MSG_CTHELPER_DEL != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNL_MSG_CTHELPER_DEL 2 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat nf_cthelper_msg_types in mpers mode + +# else + +static +const struct xlat nf_cthelper_msg_types[] = { + XLAT(NFNL_MSG_CTHELPER_NEW), + XLAT(NFNL_MSG_CTHELPER_GET), + XLAT(NFNL_MSG_CTHELPER_DEL), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nf_cthelper_msg_types.in b/xlat/nf_cthelper_msg_types.in new file mode 100644 index 00000000..bbee697a --- /dev/null +++ b/xlat/nf_cthelper_msg_types.in @@ -0,0 +1,3 @@ +NFNL_MSG_CTHELPER_NEW 0 +NFNL_MSG_CTHELPER_GET 1 +NFNL_MSG_CTHELPER_DEL 2 diff --git a/xlat/nf_ctnetlink_exp_msg_types.h b/xlat/nf_ctnetlink_exp_msg_types.h new file mode 100644 index 00000000..a6b13a10 --- /dev/null +++ b/xlat/nf_ctnetlink_exp_msg_types.h @@ -0,0 +1,54 @@ +/* Generated by ./xlat/gen.sh from ./xlat/nf_ctnetlink_exp_msg_types.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IPCTNL_MSG_EXP_NEW) || (defined(HAVE_DECL_IPCTNL_MSG_EXP_NEW) && HAVE_DECL_IPCTNL_MSG_EXP_NEW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPCTNL_MSG_EXP_NEW) == (0), "IPCTNL_MSG_EXP_NEW != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPCTNL_MSG_EXP_NEW 0 +#endif +#if defined(IPCTNL_MSG_EXP_GET) || (defined(HAVE_DECL_IPCTNL_MSG_EXP_GET) && HAVE_DECL_IPCTNL_MSG_EXP_GET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPCTNL_MSG_EXP_GET) == (1), "IPCTNL_MSG_EXP_GET != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPCTNL_MSG_EXP_GET 1 +#endif +#if defined(IPCTNL_MSG_EXP_DELETE) || (defined(HAVE_DECL_IPCTNL_MSG_EXP_DELETE) && HAVE_DECL_IPCTNL_MSG_EXP_DELETE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPCTNL_MSG_EXP_DELETE) == (2), "IPCTNL_MSG_EXP_DELETE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPCTNL_MSG_EXP_DELETE 2 +#endif +#if defined(IPCTNL_MSG_EXP_GET_STATS_CPU) || (defined(HAVE_DECL_IPCTNL_MSG_EXP_GET_STATS_CPU) && HAVE_DECL_IPCTNL_MSG_EXP_GET_STATS_CPU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPCTNL_MSG_EXP_GET_STATS_CPU) == (3), "IPCTNL_MSG_EXP_GET_STATS_CPU != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPCTNL_MSG_EXP_GET_STATS_CPU 3 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat nf_ctnetlink_exp_msg_types in mpers mode + +# else + +static +const struct xlat nf_ctnetlink_exp_msg_types[] = { + XLAT(IPCTNL_MSG_EXP_NEW), + XLAT(IPCTNL_MSG_EXP_GET), + XLAT(IPCTNL_MSG_EXP_DELETE), + XLAT(IPCTNL_MSG_EXP_GET_STATS_CPU), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nf_ctnetlink_exp_msg_types.in b/xlat/nf_ctnetlink_exp_msg_types.in new file mode 100644 index 00000000..8236e066 --- /dev/null +++ b/xlat/nf_ctnetlink_exp_msg_types.in @@ -0,0 +1,4 @@ +IPCTNL_MSG_EXP_NEW 0 +IPCTNL_MSG_EXP_GET 1 +IPCTNL_MSG_EXP_DELETE 2 +IPCTNL_MSG_EXP_GET_STATS_CPU 3 diff --git a/xlat/nf_ctnetlink_msg_types.h b/xlat/nf_ctnetlink_msg_types.h new file mode 100644 index 00000000..71d24aed --- /dev/null +++ b/xlat/nf_ctnetlink_msg_types.h @@ -0,0 +1,86 @@ +/* Generated by ./xlat/gen.sh from ./xlat/nf_ctnetlink_msg_types.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IPCTNL_MSG_CT_NEW) || (defined(HAVE_DECL_IPCTNL_MSG_CT_NEW) && HAVE_DECL_IPCTNL_MSG_CT_NEW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPCTNL_MSG_CT_NEW) == (0), "IPCTNL_MSG_CT_NEW != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPCTNL_MSG_CT_NEW 0 +#endif +#if defined(IPCTNL_MSG_CT_GET) || (defined(HAVE_DECL_IPCTNL_MSG_CT_GET) && HAVE_DECL_IPCTNL_MSG_CT_GET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPCTNL_MSG_CT_GET) == (1), "IPCTNL_MSG_CT_GET != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPCTNL_MSG_CT_GET 1 +#endif +#if defined(IPCTNL_MSG_CT_DELETE) || (defined(HAVE_DECL_IPCTNL_MSG_CT_DELETE) && HAVE_DECL_IPCTNL_MSG_CT_DELETE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPCTNL_MSG_CT_DELETE) == (2), "IPCTNL_MSG_CT_DELETE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPCTNL_MSG_CT_DELETE 2 +#endif +#if defined(IPCTNL_MSG_CT_GET_CTRZERO) || (defined(HAVE_DECL_IPCTNL_MSG_CT_GET_CTRZERO) && HAVE_DECL_IPCTNL_MSG_CT_GET_CTRZERO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPCTNL_MSG_CT_GET_CTRZERO) == (3), "IPCTNL_MSG_CT_GET_CTRZERO != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPCTNL_MSG_CT_GET_CTRZERO 3 +#endif +#if defined(IPCTNL_MSG_CT_GET_STATS_CPU) || (defined(HAVE_DECL_IPCTNL_MSG_CT_GET_STATS_CPU) && HAVE_DECL_IPCTNL_MSG_CT_GET_STATS_CPU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPCTNL_MSG_CT_GET_STATS_CPU) == (4), "IPCTNL_MSG_CT_GET_STATS_CPU != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPCTNL_MSG_CT_GET_STATS_CPU 4 +#endif +#if defined(IPCTNL_MSG_CT_GET_STATS) || (defined(HAVE_DECL_IPCTNL_MSG_CT_GET_STATS) && HAVE_DECL_IPCTNL_MSG_CT_GET_STATS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPCTNL_MSG_CT_GET_STATS) == (5), "IPCTNL_MSG_CT_GET_STATS != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPCTNL_MSG_CT_GET_STATS 5 +#endif +#if defined(IPCTNL_MSG_CT_GET_DYING) || (defined(HAVE_DECL_IPCTNL_MSG_CT_GET_DYING) && HAVE_DECL_IPCTNL_MSG_CT_GET_DYING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPCTNL_MSG_CT_GET_DYING) == (6), "IPCTNL_MSG_CT_GET_DYING != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPCTNL_MSG_CT_GET_DYING 6 +#endif +#if defined(IPCTNL_MSG_CT_GET_UNCONFIRMED) || (defined(HAVE_DECL_IPCTNL_MSG_CT_GET_UNCONFIRMED) && HAVE_DECL_IPCTNL_MSG_CT_GET_UNCONFIRMED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPCTNL_MSG_CT_GET_UNCONFIRMED) == (7), "IPCTNL_MSG_CT_GET_UNCONFIRMED != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPCTNL_MSG_CT_GET_UNCONFIRMED 7 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat nf_ctnetlink_msg_types in mpers mode + +# else + +static +const struct xlat nf_ctnetlink_msg_types[] = { + XLAT(IPCTNL_MSG_CT_NEW), + XLAT(IPCTNL_MSG_CT_GET), + XLAT(IPCTNL_MSG_CT_DELETE), + XLAT(IPCTNL_MSG_CT_GET_CTRZERO), + XLAT(IPCTNL_MSG_CT_GET_STATS_CPU), + XLAT(IPCTNL_MSG_CT_GET_STATS), + XLAT(IPCTNL_MSG_CT_GET_DYING), + XLAT(IPCTNL_MSG_CT_GET_UNCONFIRMED), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nf_ctnetlink_msg_types.in b/xlat/nf_ctnetlink_msg_types.in new file mode 100644 index 00000000..2dab1690 --- /dev/null +++ b/xlat/nf_ctnetlink_msg_types.in @@ -0,0 +1,8 @@ +IPCTNL_MSG_CT_NEW 0 +IPCTNL_MSG_CT_GET 1 +IPCTNL_MSG_CT_DELETE 2 +IPCTNL_MSG_CT_GET_CTRZERO 3 +IPCTNL_MSG_CT_GET_STATS_CPU 4 +IPCTNL_MSG_CT_GET_STATS 5 +IPCTNL_MSG_CT_GET_DYING 6 +IPCTNL_MSG_CT_GET_UNCONFIRMED 7 diff --git a/xlat/nf_cttimeout_msg_types.h b/xlat/nf_cttimeout_msg_types.h new file mode 100644 index 00000000..43ebec40 --- /dev/null +++ b/xlat/nf_cttimeout_msg_types.h @@ -0,0 +1,62 @@ +/* Generated by ./xlat/gen.sh from ./xlat/nf_cttimeout_msg_types.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IPCTNL_MSG_TIMEOUT_NEW) || (defined(HAVE_DECL_IPCTNL_MSG_TIMEOUT_NEW) && HAVE_DECL_IPCTNL_MSG_TIMEOUT_NEW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPCTNL_MSG_TIMEOUT_NEW) == (0), "IPCTNL_MSG_TIMEOUT_NEW != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPCTNL_MSG_TIMEOUT_NEW 0 +#endif +#if defined(IPCTNL_MSG_TIMEOUT_GET) || (defined(HAVE_DECL_IPCTNL_MSG_TIMEOUT_GET) && HAVE_DECL_IPCTNL_MSG_TIMEOUT_GET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPCTNL_MSG_TIMEOUT_GET) == (1), "IPCTNL_MSG_TIMEOUT_GET != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPCTNL_MSG_TIMEOUT_GET 1 +#endif +#if defined(IPCTNL_MSG_TIMEOUT_DELETE) || (defined(HAVE_DECL_IPCTNL_MSG_TIMEOUT_DELETE) && HAVE_DECL_IPCTNL_MSG_TIMEOUT_DELETE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPCTNL_MSG_TIMEOUT_DELETE) == (2), "IPCTNL_MSG_TIMEOUT_DELETE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPCTNL_MSG_TIMEOUT_DELETE 2 +#endif +#if defined(IPCTNL_MSG_TIMEOUT_DEFAULT_SET) || (defined(HAVE_DECL_IPCTNL_MSG_TIMEOUT_DEFAULT_SET) && HAVE_DECL_IPCTNL_MSG_TIMEOUT_DEFAULT_SET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPCTNL_MSG_TIMEOUT_DEFAULT_SET) == (3), "IPCTNL_MSG_TIMEOUT_DEFAULT_SET != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPCTNL_MSG_TIMEOUT_DEFAULT_SET 3 +#endif +#if defined(IPCTNL_MSG_TIMEOUT_DEFAULT_GET) || (defined(HAVE_DECL_IPCTNL_MSG_TIMEOUT_DEFAULT_GET) && HAVE_DECL_IPCTNL_MSG_TIMEOUT_DEFAULT_GET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPCTNL_MSG_TIMEOUT_DEFAULT_GET) == (4), "IPCTNL_MSG_TIMEOUT_DEFAULT_GET != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPCTNL_MSG_TIMEOUT_DEFAULT_GET 4 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat nf_cttimeout_msg_types in mpers mode + +# else + +static +const struct xlat nf_cttimeout_msg_types[] = { + XLAT(IPCTNL_MSG_TIMEOUT_NEW), + XLAT(IPCTNL_MSG_TIMEOUT_GET), + XLAT(IPCTNL_MSG_TIMEOUT_DELETE), + XLAT(IPCTNL_MSG_TIMEOUT_DEFAULT_SET), + XLAT(IPCTNL_MSG_TIMEOUT_DEFAULT_GET), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nf_cttimeout_msg_types.in b/xlat/nf_cttimeout_msg_types.in new file mode 100644 index 00000000..bf6c5293 --- /dev/null +++ b/xlat/nf_cttimeout_msg_types.in @@ -0,0 +1,5 @@ +IPCTNL_MSG_TIMEOUT_NEW 0 +IPCTNL_MSG_TIMEOUT_GET 1 +IPCTNL_MSG_TIMEOUT_DELETE 2 +IPCTNL_MSG_TIMEOUT_DEFAULT_SET 3 +IPCTNL_MSG_TIMEOUT_DEFAULT_GET 4 diff --git a/xlat/nf_ipset_msg_types.h b/xlat/nf_ipset_msg_types.h new file mode 100644 index 00000000..4fdedd93 --- /dev/null +++ b/xlat/nf_ipset_msg_types.h @@ -0,0 +1,176 @@ +/* Generated by ./xlat/gen.sh from ./xlat/nf_ipset_msg_types.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IPSET_CMD_NONE) || (defined(HAVE_DECL_IPSET_CMD_NONE) && HAVE_DECL_IPSET_CMD_NONE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSET_CMD_NONE) == (0), "IPSET_CMD_NONE != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSET_CMD_NONE 0 +#endif +#if defined(IPSET_CMD_PROTOCOL) || (defined(HAVE_DECL_IPSET_CMD_PROTOCOL) && HAVE_DECL_IPSET_CMD_PROTOCOL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSET_CMD_PROTOCOL) == (1), "IPSET_CMD_PROTOCOL != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSET_CMD_PROTOCOL 1 +#endif +#if defined(IPSET_CMD_CREATE) || (defined(HAVE_DECL_IPSET_CMD_CREATE) && HAVE_DECL_IPSET_CMD_CREATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSET_CMD_CREATE) == (2), "IPSET_CMD_CREATE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSET_CMD_CREATE 2 +#endif +#if defined(IPSET_CMD_DESTROY) || (defined(HAVE_DECL_IPSET_CMD_DESTROY) && HAVE_DECL_IPSET_CMD_DESTROY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSET_CMD_DESTROY) == (3), "IPSET_CMD_DESTROY != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSET_CMD_DESTROY 3 +#endif +#if defined(IPSET_CMD_FLUSH) || (defined(HAVE_DECL_IPSET_CMD_FLUSH) && HAVE_DECL_IPSET_CMD_FLUSH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSET_CMD_FLUSH) == (4), "IPSET_CMD_FLUSH != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSET_CMD_FLUSH 4 +#endif +#if defined(IPSET_CMD_RENAME) || (defined(HAVE_DECL_IPSET_CMD_RENAME) && HAVE_DECL_IPSET_CMD_RENAME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSET_CMD_RENAME) == (5), "IPSET_CMD_RENAME != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSET_CMD_RENAME 5 +#endif +#if defined(IPSET_CMD_SWAP) || (defined(HAVE_DECL_IPSET_CMD_SWAP) && HAVE_DECL_IPSET_CMD_SWAP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSET_CMD_SWAP) == (6), "IPSET_CMD_SWAP != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSET_CMD_SWAP 6 +#endif +#if defined(IPSET_CMD_LIST) || (defined(HAVE_DECL_IPSET_CMD_LIST) && HAVE_DECL_IPSET_CMD_LIST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSET_CMD_LIST) == (7), "IPSET_CMD_LIST != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSET_CMD_LIST 7 +#endif +#if defined(IPSET_CMD_SAVE) || (defined(HAVE_DECL_IPSET_CMD_SAVE) && HAVE_DECL_IPSET_CMD_SAVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSET_CMD_SAVE) == (8), "IPSET_CMD_SAVE != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSET_CMD_SAVE 8 +#endif +#if defined(IPSET_CMD_ADD) || (defined(HAVE_DECL_IPSET_CMD_ADD) && HAVE_DECL_IPSET_CMD_ADD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSET_CMD_ADD) == (9), "IPSET_CMD_ADD != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSET_CMD_ADD 9 +#endif +#if defined(IPSET_CMD_DEL) || (defined(HAVE_DECL_IPSET_CMD_DEL) && HAVE_DECL_IPSET_CMD_DEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSET_CMD_DEL) == (10), "IPSET_CMD_DEL != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSET_CMD_DEL 10 +#endif +#if defined(IPSET_CMD_TEST) || (defined(HAVE_DECL_IPSET_CMD_TEST) && HAVE_DECL_IPSET_CMD_TEST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSET_CMD_TEST) == (11), "IPSET_CMD_TEST != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSET_CMD_TEST 11 +#endif +#if defined(IPSET_CMD_HEADER) || (defined(HAVE_DECL_IPSET_CMD_HEADER) && HAVE_DECL_IPSET_CMD_HEADER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSET_CMD_HEADER) == (12), "IPSET_CMD_HEADER != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSET_CMD_HEADER 12 +#endif +#if defined(IPSET_CMD_TYPE) || (defined(HAVE_DECL_IPSET_CMD_TYPE) && HAVE_DECL_IPSET_CMD_TYPE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSET_CMD_TYPE) == (13), "IPSET_CMD_TYPE != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSET_CMD_TYPE 13 +#endif +#if defined(IPSET_CMD_RESTORE) || (defined(HAVE_DECL_IPSET_CMD_RESTORE) && HAVE_DECL_IPSET_CMD_RESTORE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSET_CMD_RESTORE) == (14), "IPSET_CMD_RESTORE != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSET_CMD_RESTORE 14 +#endif +#if defined(IPSET_CMD_HELP) || (defined(HAVE_DECL_IPSET_CMD_HELP) && HAVE_DECL_IPSET_CMD_HELP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSET_CMD_HELP) == (15), "IPSET_CMD_HELP != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSET_CMD_HELP 15 +#endif +#if defined(IPSET_CMD_VERSION) || (defined(HAVE_DECL_IPSET_CMD_VERSION) && HAVE_DECL_IPSET_CMD_VERSION) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSET_CMD_VERSION) == (16), "IPSET_CMD_VERSION != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSET_CMD_VERSION 16 +#endif +#if defined(IPSET_CMD_QUIT) || (defined(HAVE_DECL_IPSET_CMD_QUIT) && HAVE_DECL_IPSET_CMD_QUIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSET_CMD_QUIT) == (17), "IPSET_CMD_QUIT != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSET_CMD_QUIT 17 +#endif +#if defined(IPSET_CMD_COMMIT) || (defined(HAVE_DECL_IPSET_CMD_COMMIT) && HAVE_DECL_IPSET_CMD_COMMIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSET_CMD_COMMIT) == (18), "IPSET_CMD_COMMIT != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSET_CMD_COMMIT 18 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat nf_ipset_msg_types in mpers mode + +# else + +static +const struct xlat nf_ipset_msg_types[] = { + XLAT(IPSET_CMD_NONE), + XLAT(IPSET_CMD_PROTOCOL), + XLAT(IPSET_CMD_CREATE), + XLAT(IPSET_CMD_DESTROY), + XLAT(IPSET_CMD_FLUSH), + XLAT(IPSET_CMD_RENAME), + XLAT(IPSET_CMD_SWAP), + XLAT(IPSET_CMD_LIST), + XLAT(IPSET_CMD_SAVE), + XLAT(IPSET_CMD_ADD), + XLAT(IPSET_CMD_DEL), + XLAT(IPSET_CMD_TEST), + XLAT(IPSET_CMD_HEADER), + XLAT(IPSET_CMD_TYPE), + + XLAT(IPSET_CMD_RESTORE), + XLAT(IPSET_CMD_HELP), + XLAT(IPSET_CMD_VERSION), + XLAT(IPSET_CMD_QUIT), + + XLAT(IPSET_CMD_COMMIT), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nf_ipset_msg_types.in b/xlat/nf_ipset_msg_types.in new file mode 100644 index 00000000..a61d9064 --- /dev/null +++ b/xlat/nf_ipset_msg_types.in @@ -0,0 +1,21 @@ +IPSET_CMD_NONE 0 +IPSET_CMD_PROTOCOL 1 +IPSET_CMD_CREATE 2 +IPSET_CMD_DESTROY 3 +IPSET_CMD_FLUSH 4 +IPSET_CMD_RENAME 5 +IPSET_CMD_SWAP 6 +IPSET_CMD_LIST 7 +IPSET_CMD_SAVE 8 +IPSET_CMD_ADD 9 +IPSET_CMD_DEL 10 +IPSET_CMD_TEST 11 +IPSET_CMD_HEADER 12 +IPSET_CMD_TYPE 13 + +IPSET_CMD_RESTORE 14 +IPSET_CMD_HELP 15 +IPSET_CMD_VERSION 16 +IPSET_CMD_QUIT 17 + +IPSET_CMD_COMMIT 18 diff --git a/xlat/nf_nft_compat_msg_types.h b/xlat/nf_nft_compat_msg_types.h new file mode 100644 index 00000000..010ec9d2 --- /dev/null +++ b/xlat/nf_nft_compat_msg_types.h @@ -0,0 +1,30 @@ +/* Generated by ./xlat/gen.sh from ./xlat/nf_nft_compat_msg_types.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NFNL_MSG_COMPAT_GET) || (defined(HAVE_DECL_NFNL_MSG_COMPAT_GET) && HAVE_DECL_NFNL_MSG_COMPAT_GET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNL_MSG_COMPAT_GET) == (0), "NFNL_MSG_COMPAT_GET != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNL_MSG_COMPAT_GET 0 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat nf_nft_compat_msg_types in mpers mode + +# else + +static +const struct xlat nf_nft_compat_msg_types[] = { + XLAT(NFNL_MSG_COMPAT_GET), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nf_nft_compat_msg_types.in b/xlat/nf_nft_compat_msg_types.in new file mode 100644 index 00000000..e2f7da1c --- /dev/null +++ b/xlat/nf_nft_compat_msg_types.in @@ -0,0 +1 @@ +NFNL_MSG_COMPAT_GET 0 diff --git a/xlat/nf_nftables_msg_types.h b/xlat/nf_nftables_msg_types.h new file mode 100644 index 00000000..f2b3c51a --- /dev/null +++ b/xlat/nf_nftables_msg_types.h @@ -0,0 +1,198 @@ +/* Generated by ./xlat/gen.sh from ./xlat/nf_nftables_msg_types.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NFT_MSG_NEWTABLE) || (defined(HAVE_DECL_NFT_MSG_NEWTABLE) && HAVE_DECL_NFT_MSG_NEWTABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFT_MSG_NEWTABLE) == (0), "NFT_MSG_NEWTABLE != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFT_MSG_NEWTABLE 0 +#endif +#if defined(NFT_MSG_GETTABLE) || (defined(HAVE_DECL_NFT_MSG_GETTABLE) && HAVE_DECL_NFT_MSG_GETTABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFT_MSG_GETTABLE) == (1), "NFT_MSG_GETTABLE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFT_MSG_GETTABLE 1 +#endif +#if defined(NFT_MSG_DELTABLE) || (defined(HAVE_DECL_NFT_MSG_DELTABLE) && HAVE_DECL_NFT_MSG_DELTABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFT_MSG_DELTABLE) == (2), "NFT_MSG_DELTABLE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFT_MSG_DELTABLE 2 +#endif +#if defined(NFT_MSG_NEWCHAIN) || (defined(HAVE_DECL_NFT_MSG_NEWCHAIN) && HAVE_DECL_NFT_MSG_NEWCHAIN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFT_MSG_NEWCHAIN) == (3), "NFT_MSG_NEWCHAIN != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFT_MSG_NEWCHAIN 3 +#endif +#if defined(NFT_MSG_GETCHAIN) || (defined(HAVE_DECL_NFT_MSG_GETCHAIN) && HAVE_DECL_NFT_MSG_GETCHAIN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFT_MSG_GETCHAIN) == (4), "NFT_MSG_GETCHAIN != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFT_MSG_GETCHAIN 4 +#endif +#if defined(NFT_MSG_DELCHAIN) || (defined(HAVE_DECL_NFT_MSG_DELCHAIN) && HAVE_DECL_NFT_MSG_DELCHAIN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFT_MSG_DELCHAIN) == (5), "NFT_MSG_DELCHAIN != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFT_MSG_DELCHAIN 5 +#endif +#if defined(NFT_MSG_NEWRULE) || (defined(HAVE_DECL_NFT_MSG_NEWRULE) && HAVE_DECL_NFT_MSG_NEWRULE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFT_MSG_NEWRULE) == (6), "NFT_MSG_NEWRULE != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFT_MSG_NEWRULE 6 +#endif +#if defined(NFT_MSG_GETRULE) || (defined(HAVE_DECL_NFT_MSG_GETRULE) && HAVE_DECL_NFT_MSG_GETRULE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFT_MSG_GETRULE) == (7), "NFT_MSG_GETRULE != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFT_MSG_GETRULE 7 +#endif +#if defined(NFT_MSG_DELRULE) || (defined(HAVE_DECL_NFT_MSG_DELRULE) && HAVE_DECL_NFT_MSG_DELRULE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFT_MSG_DELRULE) == (8), "NFT_MSG_DELRULE != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFT_MSG_DELRULE 8 +#endif +#if defined(NFT_MSG_NEWSET) || (defined(HAVE_DECL_NFT_MSG_NEWSET) && HAVE_DECL_NFT_MSG_NEWSET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFT_MSG_NEWSET) == (9), "NFT_MSG_NEWSET != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFT_MSG_NEWSET 9 +#endif +#if defined(NFT_MSG_GETSET) || (defined(HAVE_DECL_NFT_MSG_GETSET) && HAVE_DECL_NFT_MSG_GETSET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFT_MSG_GETSET) == (10), "NFT_MSG_GETSET != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFT_MSG_GETSET 10 +#endif +#if defined(NFT_MSG_DELSET) || (defined(HAVE_DECL_NFT_MSG_DELSET) && HAVE_DECL_NFT_MSG_DELSET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFT_MSG_DELSET) == (11), "NFT_MSG_DELSET != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFT_MSG_DELSET 11 +#endif +#if defined(NFT_MSG_NEWSETELEM) || (defined(HAVE_DECL_NFT_MSG_NEWSETELEM) && HAVE_DECL_NFT_MSG_NEWSETELEM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFT_MSG_NEWSETELEM) == (12), "NFT_MSG_NEWSETELEM != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFT_MSG_NEWSETELEM 12 +#endif +#if defined(NFT_MSG_GETSETELEM) || (defined(HAVE_DECL_NFT_MSG_GETSETELEM) && HAVE_DECL_NFT_MSG_GETSETELEM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFT_MSG_GETSETELEM) == (13), "NFT_MSG_GETSETELEM != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFT_MSG_GETSETELEM 13 +#endif +#if defined(NFT_MSG_DELSETELEM) || (defined(HAVE_DECL_NFT_MSG_DELSETELEM) && HAVE_DECL_NFT_MSG_DELSETELEM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFT_MSG_DELSETELEM) == (14), "NFT_MSG_DELSETELEM != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFT_MSG_DELSETELEM 14 +#endif +#if defined(NFT_MSG_NEWGEN) || (defined(HAVE_DECL_NFT_MSG_NEWGEN) && HAVE_DECL_NFT_MSG_NEWGEN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFT_MSG_NEWGEN) == (15), "NFT_MSG_NEWGEN != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFT_MSG_NEWGEN 15 +#endif +#if defined(NFT_MSG_GETGEN) || (defined(HAVE_DECL_NFT_MSG_GETGEN) && HAVE_DECL_NFT_MSG_GETGEN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFT_MSG_GETGEN) == (16), "NFT_MSG_GETGEN != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFT_MSG_GETGEN 16 +#endif +#if defined(NFT_MSG_TRACE) || (defined(HAVE_DECL_NFT_MSG_TRACE) && HAVE_DECL_NFT_MSG_TRACE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFT_MSG_TRACE) == (17), "NFT_MSG_TRACE != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFT_MSG_TRACE 17 +#endif +#if defined(NFT_MSG_NEWOBJ) || (defined(HAVE_DECL_NFT_MSG_NEWOBJ) && HAVE_DECL_NFT_MSG_NEWOBJ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFT_MSG_NEWOBJ) == (18), "NFT_MSG_NEWOBJ != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFT_MSG_NEWOBJ 18 +#endif +#if defined(NFT_MSG_GETOBJ) || (defined(HAVE_DECL_NFT_MSG_GETOBJ) && HAVE_DECL_NFT_MSG_GETOBJ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFT_MSG_GETOBJ) == (19), "NFT_MSG_GETOBJ != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFT_MSG_GETOBJ 19 +#endif +#if defined(NFT_MSG_DELOBJ) || (defined(HAVE_DECL_NFT_MSG_DELOBJ) && HAVE_DECL_NFT_MSG_DELOBJ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFT_MSG_DELOBJ) == (20), "NFT_MSG_DELOBJ != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFT_MSG_DELOBJ 20 +#endif +#if defined(NFT_MSG_GETOBJ_RESET) || (defined(HAVE_DECL_NFT_MSG_GETOBJ_RESET) && HAVE_DECL_NFT_MSG_GETOBJ_RESET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFT_MSG_GETOBJ_RESET) == (21), "NFT_MSG_GETOBJ_RESET != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFT_MSG_GETOBJ_RESET 21 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat nf_nftables_msg_types in mpers mode + +# else + +static +const struct xlat nf_nftables_msg_types[] = { + XLAT(NFT_MSG_NEWTABLE), + XLAT(NFT_MSG_GETTABLE), + XLAT(NFT_MSG_DELTABLE), + XLAT(NFT_MSG_NEWCHAIN), + XLAT(NFT_MSG_GETCHAIN), + XLAT(NFT_MSG_DELCHAIN), + XLAT(NFT_MSG_NEWRULE), + XLAT(NFT_MSG_GETRULE), + XLAT(NFT_MSG_DELRULE), + XLAT(NFT_MSG_NEWSET), + XLAT(NFT_MSG_GETSET), + XLAT(NFT_MSG_DELSET), + XLAT(NFT_MSG_NEWSETELEM), + XLAT(NFT_MSG_GETSETELEM), + XLAT(NFT_MSG_DELSETELEM), + XLAT(NFT_MSG_NEWGEN), + XLAT(NFT_MSG_GETGEN), + XLAT(NFT_MSG_TRACE), + XLAT(NFT_MSG_NEWOBJ), + XLAT(NFT_MSG_GETOBJ), + XLAT(NFT_MSG_DELOBJ), + XLAT(NFT_MSG_GETOBJ_RESET), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nf_nftables_msg_types.in b/xlat/nf_nftables_msg_types.in new file mode 100644 index 00000000..eb1e773d --- /dev/null +++ b/xlat/nf_nftables_msg_types.in @@ -0,0 +1,22 @@ +NFT_MSG_NEWTABLE 0 +NFT_MSG_GETTABLE 1 +NFT_MSG_DELTABLE 2 +NFT_MSG_NEWCHAIN 3 +NFT_MSG_GETCHAIN 4 +NFT_MSG_DELCHAIN 5 +NFT_MSG_NEWRULE 6 +NFT_MSG_GETRULE 7 +NFT_MSG_DELRULE 8 +NFT_MSG_NEWSET 9 +NFT_MSG_GETSET 10 +NFT_MSG_DELSET 11 +NFT_MSG_NEWSETELEM 12 +NFT_MSG_GETSETELEM 13 +NFT_MSG_DELSETELEM 14 +NFT_MSG_NEWGEN 15 +NFT_MSG_GETGEN 16 +NFT_MSG_TRACE 17 +NFT_MSG_NEWOBJ 18 +NFT_MSG_GETOBJ 19 +NFT_MSG_DELOBJ 20 +NFT_MSG_GETOBJ_RESET 21 diff --git a/xlat/nf_osf_msg_types.h b/xlat/nf_osf_msg_types.h new file mode 100644 index 00000000..bf84df60 --- /dev/null +++ b/xlat/nf_osf_msg_types.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/nf_osf_msg_types.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(OSF_MSG_ADD) || (defined(HAVE_DECL_OSF_MSG_ADD) && HAVE_DECL_OSF_MSG_ADD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((OSF_MSG_ADD) == (0), "OSF_MSG_ADD != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define OSF_MSG_ADD 0 +#endif +#if defined(OSF_MSG_REMOVE) || (defined(HAVE_DECL_OSF_MSG_REMOVE) && HAVE_DECL_OSF_MSG_REMOVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((OSF_MSG_REMOVE) == (1), "OSF_MSG_REMOVE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define OSF_MSG_REMOVE 1 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat nf_osf_msg_types in mpers mode + +# else + +static +const struct xlat nf_osf_msg_types[] = { + XLAT(OSF_MSG_ADD), + XLAT(OSF_MSG_REMOVE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nf_osf_msg_types.in b/xlat/nf_osf_msg_types.in new file mode 100644 index 00000000..636c9323 --- /dev/null +++ b/xlat/nf_osf_msg_types.in @@ -0,0 +1,2 @@ +OSF_MSG_ADD 0 +OSF_MSG_REMOVE 1 diff --git a/xlat/nf_queue_msg_types.h b/xlat/nf_queue_msg_types.h new file mode 100644 index 00000000..88ab109d --- /dev/null +++ b/xlat/nf_queue_msg_types.h @@ -0,0 +1,54 @@ +/* Generated by ./xlat/gen.sh from ./xlat/nf_queue_msg_types.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NFQNL_MSG_PACKET) || (defined(HAVE_DECL_NFQNL_MSG_PACKET) && HAVE_DECL_NFQNL_MSG_PACKET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFQNL_MSG_PACKET) == (0), "NFQNL_MSG_PACKET != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFQNL_MSG_PACKET 0 +#endif +#if defined(NFQNL_MSG_VERDICT) || (defined(HAVE_DECL_NFQNL_MSG_VERDICT) && HAVE_DECL_NFQNL_MSG_VERDICT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFQNL_MSG_VERDICT) == (1), "NFQNL_MSG_VERDICT != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFQNL_MSG_VERDICT 1 +#endif +#if defined(NFQNL_MSG_CONFIG) || (defined(HAVE_DECL_NFQNL_MSG_CONFIG) && HAVE_DECL_NFQNL_MSG_CONFIG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFQNL_MSG_CONFIG) == (2), "NFQNL_MSG_CONFIG != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFQNL_MSG_CONFIG 2 +#endif +#if defined(NFQNL_MSG_VERDICT_BATCH) || (defined(HAVE_DECL_NFQNL_MSG_VERDICT_BATCH) && HAVE_DECL_NFQNL_MSG_VERDICT_BATCH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFQNL_MSG_VERDICT_BATCH) == (3), "NFQNL_MSG_VERDICT_BATCH != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFQNL_MSG_VERDICT_BATCH 3 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat nf_queue_msg_types in mpers mode + +# else + +static +const struct xlat nf_queue_msg_types[] = { + XLAT(NFQNL_MSG_PACKET), + XLAT(NFQNL_MSG_VERDICT), + XLAT(NFQNL_MSG_CONFIG), + XLAT(NFQNL_MSG_VERDICT_BATCH), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nf_queue_msg_types.in b/xlat/nf_queue_msg_types.in new file mode 100644 index 00000000..65c7bdd9 --- /dev/null +++ b/xlat/nf_queue_msg_types.in @@ -0,0 +1,4 @@ +NFQNL_MSG_PACKET 0 +NFQNL_MSG_VERDICT 1 +NFQNL_MSG_CONFIG 2 +NFQNL_MSG_VERDICT_BATCH 3 diff --git a/xlat/nf_ulog_msg_types.h b/xlat/nf_ulog_msg_types.h new file mode 100644 index 00000000..c8c8389b --- /dev/null +++ b/xlat/nf_ulog_msg_types.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/nf_ulog_msg_types.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NFULNL_MSG_PACKET) || (defined(HAVE_DECL_NFULNL_MSG_PACKET) && HAVE_DECL_NFULNL_MSG_PACKET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFULNL_MSG_PACKET) == (0), "NFULNL_MSG_PACKET != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFULNL_MSG_PACKET 0 +#endif +#if defined(NFULNL_MSG_CONFIG) || (defined(HAVE_DECL_NFULNL_MSG_CONFIG) && HAVE_DECL_NFULNL_MSG_CONFIG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFULNL_MSG_CONFIG) == (1), "NFULNL_MSG_CONFIG != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFULNL_MSG_CONFIG 1 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat nf_ulog_msg_types in mpers mode + +# else + +static +const struct xlat nf_ulog_msg_types[] = { + XLAT(NFULNL_MSG_PACKET), + XLAT(NFULNL_MSG_CONFIG), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nf_ulog_msg_types.in b/xlat/nf_ulog_msg_types.in new file mode 100644 index 00000000..13ff42f2 --- /dev/null +++ b/xlat/nf_ulog_msg_types.in @@ -0,0 +1,2 @@ +NFULNL_MSG_PACKET 0 +NFULNL_MSG_CONFIG 1 diff --git a/xlat/nfc_protocols.h b/xlat/nfc_protocols.h new file mode 100644 index 00000000..88331a53 --- /dev/null +++ b/xlat/nfc_protocols.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/nfc_protocols.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NFC_SOCKPROTO_RAW) || (defined(HAVE_DECL_NFC_SOCKPROTO_RAW) && HAVE_DECL_NFC_SOCKPROTO_RAW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFC_SOCKPROTO_RAW) == (0), "NFC_SOCKPROTO_RAW != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFC_SOCKPROTO_RAW 0 +#endif +#if defined(NFC_SOCKPROTO_LLCP) || (defined(HAVE_DECL_NFC_SOCKPROTO_LLCP) && HAVE_DECL_NFC_SOCKPROTO_LLCP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFC_SOCKPROTO_LLCP) == (1), "NFC_SOCKPROTO_LLCP != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFC_SOCKPROTO_LLCP 1 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat nfc_protocols in mpers mode + +# else + +static +const struct xlat nfc_protocols[] = { + [NFC_SOCKPROTO_RAW] = XLAT(NFC_SOCKPROTO_RAW), + [NFC_SOCKPROTO_LLCP] = XLAT(NFC_SOCKPROTO_LLCP), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nfc_protocols.in b/xlat/nfc_protocols.in new file mode 100644 index 00000000..27718976 --- /dev/null +++ b/xlat/nfc_protocols.in @@ -0,0 +1,3 @@ +#value_indexed +NFC_SOCKPROTO_RAW 0 +NFC_SOCKPROTO_LLCP 1 diff --git a/xlat/nl_audit_types.h b/xlat/nl_audit_types.h new file mode 100644 index 00000000..b9d0d0e3 --- /dev/null +++ b/xlat/nl_audit_types.h @@ -0,0 +1,787 @@ +/* Generated by ./xlat/gen.sh from ./xlat/nl_audit_types.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(AUDIT_GET) || (defined(HAVE_DECL_AUDIT_GET) && HAVE_DECL_AUDIT_GET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_GET) == (1000), "AUDIT_GET != 1000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_GET 1000 +#endif +#if defined(AUDIT_SET) || (defined(HAVE_DECL_AUDIT_SET) && HAVE_DECL_AUDIT_SET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_SET) == (1001), "AUDIT_SET != 1001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_SET 1001 +#endif +#if defined(AUDIT_LIST) || (defined(HAVE_DECL_AUDIT_LIST) && HAVE_DECL_AUDIT_LIST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_LIST) == (1002), "AUDIT_LIST != 1002"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_LIST 1002 +#endif +#if defined(AUDIT_ADD) || (defined(HAVE_DECL_AUDIT_ADD) && HAVE_DECL_AUDIT_ADD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_ADD) == (1003), "AUDIT_ADD != 1003"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_ADD 1003 +#endif +#if defined(AUDIT_DEL) || (defined(HAVE_DECL_AUDIT_DEL) && HAVE_DECL_AUDIT_DEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_DEL) == (1004), "AUDIT_DEL != 1004"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_DEL 1004 +#endif +#if defined(AUDIT_USER) || (defined(HAVE_DECL_AUDIT_USER) && HAVE_DECL_AUDIT_USER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_USER) == (1005), "AUDIT_USER != 1005"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_USER 1005 +#endif +#if defined(AUDIT_LOGIN) || (defined(HAVE_DECL_AUDIT_LOGIN) && HAVE_DECL_AUDIT_LOGIN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_LOGIN) == (1006), "AUDIT_LOGIN != 1006"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_LOGIN 1006 +#endif +#if defined(AUDIT_WATCH_INS) || (defined(HAVE_DECL_AUDIT_WATCH_INS) && HAVE_DECL_AUDIT_WATCH_INS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_WATCH_INS) == (1007), "AUDIT_WATCH_INS != 1007"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_WATCH_INS 1007 +#endif +#if defined(AUDIT_WATCH_REM) || (defined(HAVE_DECL_AUDIT_WATCH_REM) && HAVE_DECL_AUDIT_WATCH_REM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_WATCH_REM) == (1008), "AUDIT_WATCH_REM != 1008"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_WATCH_REM 1008 +#endif +#if defined(AUDIT_WATCH_LIST) || (defined(HAVE_DECL_AUDIT_WATCH_LIST) && HAVE_DECL_AUDIT_WATCH_LIST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_WATCH_LIST) == (1009), "AUDIT_WATCH_LIST != 1009"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_WATCH_LIST 1009 +#endif +#if defined(AUDIT_SIGNAL_INFO) || (defined(HAVE_DECL_AUDIT_SIGNAL_INFO) && HAVE_DECL_AUDIT_SIGNAL_INFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_SIGNAL_INFO) == (1010), "AUDIT_SIGNAL_INFO != 1010"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_SIGNAL_INFO 1010 +#endif +#if defined(AUDIT_ADD_RULE) || (defined(HAVE_DECL_AUDIT_ADD_RULE) && HAVE_DECL_AUDIT_ADD_RULE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_ADD_RULE) == (1011), "AUDIT_ADD_RULE != 1011"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_ADD_RULE 1011 +#endif +#if defined(AUDIT_DEL_RULE) || (defined(HAVE_DECL_AUDIT_DEL_RULE) && HAVE_DECL_AUDIT_DEL_RULE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_DEL_RULE) == (1012), "AUDIT_DEL_RULE != 1012"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_DEL_RULE 1012 +#endif +#if defined(AUDIT_LIST_RULES) || (defined(HAVE_DECL_AUDIT_LIST_RULES) && HAVE_DECL_AUDIT_LIST_RULES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_LIST_RULES) == (1013), "AUDIT_LIST_RULES != 1013"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_LIST_RULES 1013 +#endif +#if defined(AUDIT_TRIM) || (defined(HAVE_DECL_AUDIT_TRIM) && HAVE_DECL_AUDIT_TRIM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_TRIM) == (1014), "AUDIT_TRIM != 1014"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_TRIM 1014 +#endif +#if defined(AUDIT_MAKE_EQUIV) || (defined(HAVE_DECL_AUDIT_MAKE_EQUIV) && HAVE_DECL_AUDIT_MAKE_EQUIV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_MAKE_EQUIV) == (1015), "AUDIT_MAKE_EQUIV != 1015"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_MAKE_EQUIV 1015 +#endif +#if defined(AUDIT_TTY_GET) || (defined(HAVE_DECL_AUDIT_TTY_GET) && HAVE_DECL_AUDIT_TTY_GET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_TTY_GET) == (1016), "AUDIT_TTY_GET != 1016"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_TTY_GET 1016 +#endif +#if defined(AUDIT_TTY_SET) || (defined(HAVE_DECL_AUDIT_TTY_SET) && HAVE_DECL_AUDIT_TTY_SET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_TTY_SET) == (1017), "AUDIT_TTY_SET != 1017"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_TTY_SET 1017 +#endif +#if defined(AUDIT_SET_FEATURE) || (defined(HAVE_DECL_AUDIT_SET_FEATURE) && HAVE_DECL_AUDIT_SET_FEATURE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_SET_FEATURE) == (1018), "AUDIT_SET_FEATURE != 1018"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_SET_FEATURE 1018 +#endif +#if defined(AUDIT_GET_FEATURE) || (defined(HAVE_DECL_AUDIT_GET_FEATURE) && HAVE_DECL_AUDIT_GET_FEATURE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_GET_FEATURE) == (1019), "AUDIT_GET_FEATURE != 1019"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_GET_FEATURE 1019 +#endif +#if defined(AUDIT_FIRST_USER_MSG) || (defined(HAVE_DECL_AUDIT_FIRST_USER_MSG) && HAVE_DECL_AUDIT_FIRST_USER_MSG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_FIRST_USER_MSG) == (1100), "AUDIT_FIRST_USER_MSG != 1100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_FIRST_USER_MSG 1100 +#endif +#if defined(AUDIT_USER_AVC) || (defined(HAVE_DECL_AUDIT_USER_AVC) && HAVE_DECL_AUDIT_USER_AVC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_USER_AVC) == (1107), "AUDIT_USER_AVC != 1107"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_USER_AVC 1107 +#endif +#if defined(AUDIT_USER_TTY) || (defined(HAVE_DECL_AUDIT_USER_TTY) && HAVE_DECL_AUDIT_USER_TTY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_USER_TTY) == (1124), "AUDIT_USER_TTY != 1124"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_USER_TTY 1124 +#endif +#if defined(AUDIT_LAST_USER_MSG) || (defined(HAVE_DECL_AUDIT_LAST_USER_MSG) && HAVE_DECL_AUDIT_LAST_USER_MSG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_LAST_USER_MSG) == (1199), "AUDIT_LAST_USER_MSG != 1199"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_LAST_USER_MSG 1199 +#endif +#if defined(AUDIT_DAEMON_START) || (defined(HAVE_DECL_AUDIT_DAEMON_START) && HAVE_DECL_AUDIT_DAEMON_START) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_DAEMON_START) == (1200), "AUDIT_DAEMON_START != 1200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_DAEMON_START 1200 +#endif +#if defined(AUDIT_DAEMON_END) || (defined(HAVE_DECL_AUDIT_DAEMON_END) && HAVE_DECL_AUDIT_DAEMON_END) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_DAEMON_END) == (1201), "AUDIT_DAEMON_END != 1201"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_DAEMON_END 1201 +#endif +#if defined(AUDIT_DAEMON_ABORT) || (defined(HAVE_DECL_AUDIT_DAEMON_ABORT) && HAVE_DECL_AUDIT_DAEMON_ABORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_DAEMON_ABORT) == (1202), "AUDIT_DAEMON_ABORT != 1202"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_DAEMON_ABORT 1202 +#endif +#if defined(AUDIT_DAEMON_CONFIG) || (defined(HAVE_DECL_AUDIT_DAEMON_CONFIG) && HAVE_DECL_AUDIT_DAEMON_CONFIG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_DAEMON_CONFIG) == (1203), "AUDIT_DAEMON_CONFIG != 1203"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_DAEMON_CONFIG 1203 +#endif +#if defined(AUDIT_SYSCALL) || (defined(HAVE_DECL_AUDIT_SYSCALL) && HAVE_DECL_AUDIT_SYSCALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_SYSCALL) == (1300), "AUDIT_SYSCALL != 1300"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_SYSCALL 1300 +#endif +#if defined(AUDIT_FS_WATCH) || (defined(HAVE_DECL_AUDIT_FS_WATCH) && HAVE_DECL_AUDIT_FS_WATCH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_FS_WATCH) == (1301), "AUDIT_FS_WATCH != 1301"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_FS_WATCH 1301 +#endif +#if defined(AUDIT_PATH) || (defined(HAVE_DECL_AUDIT_PATH) && HAVE_DECL_AUDIT_PATH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_PATH) == (1302), "AUDIT_PATH != 1302"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_PATH 1302 +#endif +#if defined(AUDIT_IPC) || (defined(HAVE_DECL_AUDIT_IPC) && HAVE_DECL_AUDIT_IPC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_IPC) == (1303), "AUDIT_IPC != 1303"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_IPC 1303 +#endif +#if defined(AUDIT_SOCKETCALL) || (defined(HAVE_DECL_AUDIT_SOCKETCALL) && HAVE_DECL_AUDIT_SOCKETCALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_SOCKETCALL) == (1304), "AUDIT_SOCKETCALL != 1304"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_SOCKETCALL 1304 +#endif +#if defined(AUDIT_CONFIG_CHANGE) || (defined(HAVE_DECL_AUDIT_CONFIG_CHANGE) && HAVE_DECL_AUDIT_CONFIG_CHANGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_CONFIG_CHANGE) == (1305), "AUDIT_CONFIG_CHANGE != 1305"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_CONFIG_CHANGE 1305 +#endif +#if defined(AUDIT_SOCKADDR) || (defined(HAVE_DECL_AUDIT_SOCKADDR) && HAVE_DECL_AUDIT_SOCKADDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_SOCKADDR) == (1306), "AUDIT_SOCKADDR != 1306"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_SOCKADDR 1306 +#endif +#if defined(AUDIT_CWD) || (defined(HAVE_DECL_AUDIT_CWD) && HAVE_DECL_AUDIT_CWD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_CWD) == (1307), "AUDIT_CWD != 1307"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_CWD 1307 +#endif +#if defined(AUDIT_EXECVE) || (defined(HAVE_DECL_AUDIT_EXECVE) && HAVE_DECL_AUDIT_EXECVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_EXECVE) == (1309), "AUDIT_EXECVE != 1309"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_EXECVE 1309 +#endif +#if defined(AUDIT_IPC_SET_PERM) || (defined(HAVE_DECL_AUDIT_IPC_SET_PERM) && HAVE_DECL_AUDIT_IPC_SET_PERM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_IPC_SET_PERM) == (1311), "AUDIT_IPC_SET_PERM != 1311"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_IPC_SET_PERM 1311 +#endif +#if defined(AUDIT_MQ_OPEN) || (defined(HAVE_DECL_AUDIT_MQ_OPEN) && HAVE_DECL_AUDIT_MQ_OPEN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_MQ_OPEN) == (1312), "AUDIT_MQ_OPEN != 1312"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_MQ_OPEN 1312 +#endif +#if defined(AUDIT_MQ_SENDRECV) || (defined(HAVE_DECL_AUDIT_MQ_SENDRECV) && HAVE_DECL_AUDIT_MQ_SENDRECV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_MQ_SENDRECV) == (1313), "AUDIT_MQ_SENDRECV != 1313"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_MQ_SENDRECV 1313 +#endif +#if defined(AUDIT_MQ_NOTIFY) || (defined(HAVE_DECL_AUDIT_MQ_NOTIFY) && HAVE_DECL_AUDIT_MQ_NOTIFY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_MQ_NOTIFY) == (1314), "AUDIT_MQ_NOTIFY != 1314"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_MQ_NOTIFY 1314 +#endif +#if defined(AUDIT_MQ_GETSETATTR) || (defined(HAVE_DECL_AUDIT_MQ_GETSETATTR) && HAVE_DECL_AUDIT_MQ_GETSETATTR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_MQ_GETSETATTR) == (1315), "AUDIT_MQ_GETSETATTR != 1315"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_MQ_GETSETATTR 1315 +#endif +#if defined(AUDIT_KERNEL_OTHER) || (defined(HAVE_DECL_AUDIT_KERNEL_OTHER) && HAVE_DECL_AUDIT_KERNEL_OTHER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_KERNEL_OTHER) == (1316), "AUDIT_KERNEL_OTHER != 1316"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_KERNEL_OTHER 1316 +#endif +#if defined(AUDIT_FD_PAIR) || (defined(HAVE_DECL_AUDIT_FD_PAIR) && HAVE_DECL_AUDIT_FD_PAIR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_FD_PAIR) == (1317), "AUDIT_FD_PAIR != 1317"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_FD_PAIR 1317 +#endif +#if defined(AUDIT_OBJ_PID) || (defined(HAVE_DECL_AUDIT_OBJ_PID) && HAVE_DECL_AUDIT_OBJ_PID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_OBJ_PID) == (1318), "AUDIT_OBJ_PID != 1318"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_OBJ_PID 1318 +#endif +#if defined(AUDIT_TTY) || (defined(HAVE_DECL_AUDIT_TTY) && HAVE_DECL_AUDIT_TTY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_TTY) == (1319), "AUDIT_TTY != 1319"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_TTY 1319 +#endif +#if defined(AUDIT_EOE) || (defined(HAVE_DECL_AUDIT_EOE) && HAVE_DECL_AUDIT_EOE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_EOE) == (1320), "AUDIT_EOE != 1320"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_EOE 1320 +#endif +#if defined(AUDIT_BPRM_FCAPS) || (defined(HAVE_DECL_AUDIT_BPRM_FCAPS) && HAVE_DECL_AUDIT_BPRM_FCAPS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_BPRM_FCAPS) == (1321), "AUDIT_BPRM_FCAPS != 1321"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_BPRM_FCAPS 1321 +#endif +#if defined(AUDIT_CAPSET) || (defined(HAVE_DECL_AUDIT_CAPSET) && HAVE_DECL_AUDIT_CAPSET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_CAPSET) == (1322), "AUDIT_CAPSET != 1322"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_CAPSET 1322 +#endif +#if defined(AUDIT_MMAP) || (defined(HAVE_DECL_AUDIT_MMAP) && HAVE_DECL_AUDIT_MMAP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_MMAP) == (1323), "AUDIT_MMAP != 1323"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_MMAP 1323 +#endif +#if defined(AUDIT_NETFILTER_PKT) || (defined(HAVE_DECL_AUDIT_NETFILTER_PKT) && HAVE_DECL_AUDIT_NETFILTER_PKT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_NETFILTER_PKT) == (1324), "AUDIT_NETFILTER_PKT != 1324"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_NETFILTER_PKT 1324 +#endif +#if defined(AUDIT_NETFILTER_CFG) || (defined(HAVE_DECL_AUDIT_NETFILTER_CFG) && HAVE_DECL_AUDIT_NETFILTER_CFG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_NETFILTER_CFG) == (1325), "AUDIT_NETFILTER_CFG != 1325"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_NETFILTER_CFG 1325 +#endif +#if defined(AUDIT_SECCOMP) || (defined(HAVE_DECL_AUDIT_SECCOMP) && HAVE_DECL_AUDIT_SECCOMP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_SECCOMP) == (1326), "AUDIT_SECCOMP != 1326"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_SECCOMP 1326 +#endif +#if defined(AUDIT_PROCTITLE) || (defined(HAVE_DECL_AUDIT_PROCTITLE) && HAVE_DECL_AUDIT_PROCTITLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_PROCTITLE) == (1327), "AUDIT_PROCTITLE != 1327"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_PROCTITLE 1327 +#endif +#ifndef STRACE_WORKAROUND_FOR_AUDIT_FEATURE_CHANGE +# define STRACE_WORKAROUND_FOR_AUDIT_FEATURE_CHANGE +# undef AUDIT_FEATURE_CHANGE +#endif +#if defined(AUDIT_FEATURE_CHANGE) || (defined(HAVE_DECL_AUDIT_FEATURE_CHANGE) && HAVE_DECL_AUDIT_FEATURE_CHANGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_FEATURE_CHANGE) == (1328), "AUDIT_FEATURE_CHANGE != 1328"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_FEATURE_CHANGE 1328 +#endif +#if defined(AUDIT_REPLACE) || (defined(HAVE_DECL_AUDIT_REPLACE) && HAVE_DECL_AUDIT_REPLACE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_REPLACE) == (1329), "AUDIT_REPLACE != 1329"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_REPLACE 1329 +#endif +#if defined(AUDIT_KERN_MODULE) || (defined(HAVE_DECL_AUDIT_KERN_MODULE) && HAVE_DECL_AUDIT_KERN_MODULE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_KERN_MODULE) == (1330), "AUDIT_KERN_MODULE != 1330"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_KERN_MODULE 1330 +#endif +#if defined(AUDIT_AVC) || (defined(HAVE_DECL_AUDIT_AVC) && HAVE_DECL_AUDIT_AVC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_AVC) == (1400), "AUDIT_AVC != 1400"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_AVC 1400 +#endif +#if defined(AUDIT_SELINUX_ERR) || (defined(HAVE_DECL_AUDIT_SELINUX_ERR) && HAVE_DECL_AUDIT_SELINUX_ERR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_SELINUX_ERR) == (1401), "AUDIT_SELINUX_ERR != 1401"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_SELINUX_ERR 1401 +#endif +#if defined(AUDIT_AVC_PATH) || (defined(HAVE_DECL_AUDIT_AVC_PATH) && HAVE_DECL_AUDIT_AVC_PATH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_AVC_PATH) == (1402), "AUDIT_AVC_PATH != 1402"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_AVC_PATH 1402 +#endif +#if defined(AUDIT_MAC_POLICY_LOAD) || (defined(HAVE_DECL_AUDIT_MAC_POLICY_LOAD) && HAVE_DECL_AUDIT_MAC_POLICY_LOAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_MAC_POLICY_LOAD) == (1403), "AUDIT_MAC_POLICY_LOAD != 1403"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_MAC_POLICY_LOAD 1403 +#endif +#if defined(AUDIT_MAC_STATUS) || (defined(HAVE_DECL_AUDIT_MAC_STATUS) && HAVE_DECL_AUDIT_MAC_STATUS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_MAC_STATUS) == (1404), "AUDIT_MAC_STATUS != 1404"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_MAC_STATUS 1404 +#endif +#if defined(AUDIT_MAC_CONFIG_CHANGE) || (defined(HAVE_DECL_AUDIT_MAC_CONFIG_CHANGE) && HAVE_DECL_AUDIT_MAC_CONFIG_CHANGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_MAC_CONFIG_CHANGE) == (1405), "AUDIT_MAC_CONFIG_CHANGE != 1405"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_MAC_CONFIG_CHANGE 1405 +#endif +#if defined(AUDIT_MAC_UNLBL_ALLOW) || (defined(HAVE_DECL_AUDIT_MAC_UNLBL_ALLOW) && HAVE_DECL_AUDIT_MAC_UNLBL_ALLOW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_MAC_UNLBL_ALLOW) == (1406), "AUDIT_MAC_UNLBL_ALLOW != 1406"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_MAC_UNLBL_ALLOW 1406 +#endif +#if defined(AUDIT_MAC_CIPSOV4_ADD) || (defined(HAVE_DECL_AUDIT_MAC_CIPSOV4_ADD) && HAVE_DECL_AUDIT_MAC_CIPSOV4_ADD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_MAC_CIPSOV4_ADD) == (1407), "AUDIT_MAC_CIPSOV4_ADD != 1407"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_MAC_CIPSOV4_ADD 1407 +#endif +#if defined(AUDIT_MAC_CIPSOV4_DEL) || (defined(HAVE_DECL_AUDIT_MAC_CIPSOV4_DEL) && HAVE_DECL_AUDIT_MAC_CIPSOV4_DEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_MAC_CIPSOV4_DEL) == (1408), "AUDIT_MAC_CIPSOV4_DEL != 1408"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_MAC_CIPSOV4_DEL 1408 +#endif +#if defined(AUDIT_MAC_MAP_ADD) || (defined(HAVE_DECL_AUDIT_MAC_MAP_ADD) && HAVE_DECL_AUDIT_MAC_MAP_ADD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_MAC_MAP_ADD) == (1409), "AUDIT_MAC_MAP_ADD != 1409"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_MAC_MAP_ADD 1409 +#endif +#if defined(AUDIT_MAC_MAP_DEL) || (defined(HAVE_DECL_AUDIT_MAC_MAP_DEL) && HAVE_DECL_AUDIT_MAC_MAP_DEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_MAC_MAP_DEL) == (1410), "AUDIT_MAC_MAP_DEL != 1410"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_MAC_MAP_DEL 1410 +#endif +#if defined(AUDIT_MAC_IPSEC_ADDSA) || (defined(HAVE_DECL_AUDIT_MAC_IPSEC_ADDSA) && HAVE_DECL_AUDIT_MAC_IPSEC_ADDSA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_MAC_IPSEC_ADDSA) == (1411), "AUDIT_MAC_IPSEC_ADDSA != 1411"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_MAC_IPSEC_ADDSA 1411 +#endif +#if defined(AUDIT_MAC_IPSEC_DELSA) || (defined(HAVE_DECL_AUDIT_MAC_IPSEC_DELSA) && HAVE_DECL_AUDIT_MAC_IPSEC_DELSA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_MAC_IPSEC_DELSA) == (1412), "AUDIT_MAC_IPSEC_DELSA != 1412"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_MAC_IPSEC_DELSA 1412 +#endif +#if defined(AUDIT_MAC_IPSEC_ADDSPD) || (defined(HAVE_DECL_AUDIT_MAC_IPSEC_ADDSPD) && HAVE_DECL_AUDIT_MAC_IPSEC_ADDSPD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_MAC_IPSEC_ADDSPD) == (1413), "AUDIT_MAC_IPSEC_ADDSPD != 1413"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_MAC_IPSEC_ADDSPD 1413 +#endif +#if defined(AUDIT_MAC_IPSEC_DELSPD) || (defined(HAVE_DECL_AUDIT_MAC_IPSEC_DELSPD) && HAVE_DECL_AUDIT_MAC_IPSEC_DELSPD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_MAC_IPSEC_DELSPD) == (1414), "AUDIT_MAC_IPSEC_DELSPD != 1414"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_MAC_IPSEC_DELSPD 1414 +#endif +#if defined(AUDIT_MAC_IPSEC_EVENT) || (defined(HAVE_DECL_AUDIT_MAC_IPSEC_EVENT) && HAVE_DECL_AUDIT_MAC_IPSEC_EVENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_MAC_IPSEC_EVENT) == (1415), "AUDIT_MAC_IPSEC_EVENT != 1415"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_MAC_IPSEC_EVENT 1415 +#endif +#if defined(AUDIT_MAC_UNLBL_STCADD) || (defined(HAVE_DECL_AUDIT_MAC_UNLBL_STCADD) && HAVE_DECL_AUDIT_MAC_UNLBL_STCADD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_MAC_UNLBL_STCADD) == (1416), "AUDIT_MAC_UNLBL_STCADD != 1416"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_MAC_UNLBL_STCADD 1416 +#endif +#if defined(AUDIT_MAC_UNLBL_STCDEL) || (defined(HAVE_DECL_AUDIT_MAC_UNLBL_STCDEL) && HAVE_DECL_AUDIT_MAC_UNLBL_STCDEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_MAC_UNLBL_STCDEL) == (1417), "AUDIT_MAC_UNLBL_STCDEL != 1417"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_MAC_UNLBL_STCDEL 1417 +#endif +#if defined(AUDIT_MAC_CALIPSO_ADD) || (defined(HAVE_DECL_AUDIT_MAC_CALIPSO_ADD) && HAVE_DECL_AUDIT_MAC_CALIPSO_ADD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_MAC_CALIPSO_ADD) == (1418), "AUDIT_MAC_CALIPSO_ADD != 1418"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_MAC_CALIPSO_ADD 1418 +#endif +#if defined(AUDIT_MAC_CALIPSO_DEL) || (defined(HAVE_DECL_AUDIT_MAC_CALIPSO_DEL) && HAVE_DECL_AUDIT_MAC_CALIPSO_DEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_MAC_CALIPSO_DEL) == (1419), "AUDIT_MAC_CALIPSO_DEL != 1419"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_MAC_CALIPSO_DEL 1419 +#endif +#if defined(AUDIT_ANOM_PROMISCUOUS) || (defined(HAVE_DECL_AUDIT_ANOM_PROMISCUOUS) && HAVE_DECL_AUDIT_ANOM_PROMISCUOUS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_ANOM_PROMISCUOUS) == (1700), "AUDIT_ANOM_PROMISCUOUS != 1700"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_ANOM_PROMISCUOUS 1700 +#endif +#if defined(AUDIT_ANOM_ABEND) || (defined(HAVE_DECL_AUDIT_ANOM_ABEND) && HAVE_DECL_AUDIT_ANOM_ABEND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_ANOM_ABEND) == (1701), "AUDIT_ANOM_ABEND != 1701"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_ANOM_ABEND 1701 +#endif +#if defined(AUDIT_ANOM_LINK) || (defined(HAVE_DECL_AUDIT_ANOM_LINK) && HAVE_DECL_AUDIT_ANOM_LINK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_ANOM_LINK) == (1702), "AUDIT_ANOM_LINK != 1702"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_ANOM_LINK 1702 +#endif +#if defined(AUDIT_LAST_KERN_ANOM_MSG) || (defined(HAVE_DECL_AUDIT_LAST_KERN_ANOM_MSG) && HAVE_DECL_AUDIT_LAST_KERN_ANOM_MSG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_LAST_KERN_ANOM_MSG) == (1799), "AUDIT_LAST_KERN_ANOM_MSG != 1799"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_LAST_KERN_ANOM_MSG 1799 +#endif +#if defined(AUDIT_INTEGRITY_DATA) || (defined(HAVE_DECL_AUDIT_INTEGRITY_DATA) && HAVE_DECL_AUDIT_INTEGRITY_DATA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_INTEGRITY_DATA) == (1800), "AUDIT_INTEGRITY_DATA != 1800"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_INTEGRITY_DATA 1800 +#endif +#if defined(AUDIT_INTEGRITY_METADATA) || (defined(HAVE_DECL_AUDIT_INTEGRITY_METADATA) && HAVE_DECL_AUDIT_INTEGRITY_METADATA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_INTEGRITY_METADATA) == (1801), "AUDIT_INTEGRITY_METADATA != 1801"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_INTEGRITY_METADATA 1801 +#endif +#if defined(AUDIT_INTEGRITY_STATUS) || (defined(HAVE_DECL_AUDIT_INTEGRITY_STATUS) && HAVE_DECL_AUDIT_INTEGRITY_STATUS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_INTEGRITY_STATUS) == (1802), "AUDIT_INTEGRITY_STATUS != 1802"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_INTEGRITY_STATUS 1802 +#endif +#if defined(AUDIT_INTEGRITY_HASH) || (defined(HAVE_DECL_AUDIT_INTEGRITY_HASH) && HAVE_DECL_AUDIT_INTEGRITY_HASH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_INTEGRITY_HASH) == (1803), "AUDIT_INTEGRITY_HASH != 1803"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_INTEGRITY_HASH 1803 +#endif +#if defined(AUDIT_INTEGRITY_PCR) || (defined(HAVE_DECL_AUDIT_INTEGRITY_PCR) && HAVE_DECL_AUDIT_INTEGRITY_PCR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_INTEGRITY_PCR) == (1804), "AUDIT_INTEGRITY_PCR != 1804"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_INTEGRITY_PCR 1804 +#endif +#if defined(AUDIT_INTEGRITY_RULE) || (defined(HAVE_DECL_AUDIT_INTEGRITY_RULE) && HAVE_DECL_AUDIT_INTEGRITY_RULE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_INTEGRITY_RULE) == (1805), "AUDIT_INTEGRITY_RULE != 1805"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_INTEGRITY_RULE 1805 +#endif +#if defined(AUDIT_INTEGRITY_EVM_XATTR) || (defined(HAVE_DECL_AUDIT_INTEGRITY_EVM_XATTR) && HAVE_DECL_AUDIT_INTEGRITY_EVM_XATTR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_INTEGRITY_EVM_XATTR) == (1806), "AUDIT_INTEGRITY_EVM_XATTR != 1806"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_INTEGRITY_EVM_XATTR 1806 +#endif +#if defined(AUDIT_INTEGRITY_POLICY_RULE) || (defined(HAVE_DECL_AUDIT_INTEGRITY_POLICY_RULE) && HAVE_DECL_AUDIT_INTEGRITY_POLICY_RULE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_INTEGRITY_POLICY_RULE) == (1807), "AUDIT_INTEGRITY_POLICY_RULE != 1807"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_INTEGRITY_POLICY_RULE 1807 +#endif +#if defined(AUDIT_KERNEL) || (defined(HAVE_DECL_AUDIT_KERNEL) && HAVE_DECL_AUDIT_KERNEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_KERNEL) == (2000), "AUDIT_KERNEL != 2000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_KERNEL 2000 +#endif +#if defined(AUDIT_FIRST_USER_MSG2) || (defined(HAVE_DECL_AUDIT_FIRST_USER_MSG2) && HAVE_DECL_AUDIT_FIRST_USER_MSG2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_FIRST_USER_MSG2) == (2100), "AUDIT_FIRST_USER_MSG2 != 2100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_FIRST_USER_MSG2 2100 +#endif +#if defined(AUDIT_LAST_USER_MSG2) || (defined(HAVE_DECL_AUDIT_LAST_USER_MSG2) && HAVE_DECL_AUDIT_LAST_USER_MSG2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AUDIT_LAST_USER_MSG2) == (2999), "AUDIT_LAST_USER_MSG2 != 2999"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AUDIT_LAST_USER_MSG2 2999 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat nl_audit_types in mpers mode + +# else + +static +const struct xlat nl_audit_types[] = { + XLAT(AUDIT_GET), + XLAT(AUDIT_SET), + XLAT(AUDIT_LIST), + XLAT(AUDIT_ADD), + XLAT(AUDIT_DEL), + XLAT(AUDIT_USER), + XLAT(AUDIT_LOGIN), + XLAT(AUDIT_WATCH_INS), + XLAT(AUDIT_WATCH_REM), + XLAT(AUDIT_WATCH_LIST), + XLAT(AUDIT_SIGNAL_INFO), + XLAT(AUDIT_ADD_RULE), + XLAT(AUDIT_DEL_RULE), + XLAT(AUDIT_LIST_RULES), + XLAT(AUDIT_TRIM), + XLAT(AUDIT_MAKE_EQUIV), + XLAT(AUDIT_TTY_GET), + XLAT(AUDIT_TTY_SET), + XLAT(AUDIT_SET_FEATURE), + XLAT(AUDIT_GET_FEATURE), + + XLAT(AUDIT_FIRST_USER_MSG), + XLAT(AUDIT_USER_AVC), + XLAT(AUDIT_USER_TTY), + XLAT(AUDIT_LAST_USER_MSG), + + XLAT(AUDIT_DAEMON_START), + XLAT(AUDIT_DAEMON_END), + XLAT(AUDIT_DAEMON_ABORT), + XLAT(AUDIT_DAEMON_CONFIG), + + XLAT(AUDIT_SYSCALL), + XLAT(AUDIT_FS_WATCH), + XLAT(AUDIT_PATH), + XLAT(AUDIT_IPC), + XLAT(AUDIT_SOCKETCALL), + XLAT(AUDIT_CONFIG_CHANGE), + XLAT(AUDIT_SOCKADDR), + XLAT(AUDIT_CWD), + XLAT(AUDIT_EXECVE), + XLAT(AUDIT_IPC_SET_PERM), + XLAT(AUDIT_MQ_OPEN), + XLAT(AUDIT_MQ_SENDRECV), + XLAT(AUDIT_MQ_NOTIFY), + XLAT(AUDIT_MQ_GETSETATTR), + XLAT(AUDIT_KERNEL_OTHER), + XLAT(AUDIT_FD_PAIR), + XLAT(AUDIT_OBJ_PID), + XLAT(AUDIT_TTY), + XLAT(AUDIT_EOE), + XLAT(AUDIT_BPRM_FCAPS), + XLAT(AUDIT_CAPSET), + XLAT(AUDIT_MMAP), + XLAT(AUDIT_NETFILTER_PKT), + XLAT(AUDIT_NETFILTER_CFG), + XLAT(AUDIT_SECCOMP), + XLAT(AUDIT_PROCTITLE), + +#ifndef STRACE_WORKAROUND_FOR_AUDIT_FEATURE_CHANGE +# define STRACE_WORKAROUND_FOR_AUDIT_FEATURE_CHANGE +/* +* Linux kernel commit v3.15-rc1~18^2~1 has changed the value +* of AUDIT_FEATURE_CHANGE constant introduced by commit v3.13-rc1~19^2~20 +* which is of course an ABI breakage that affected 3.13 and 3.14 kernel +* releases as well as their LTS derivatives. +* Linux kernel commit v3.15-rc1~18^2~1 also claims that the old value +* of AUDIT_FEATURE_CHANGE was ignored by userspace because of the established +* convention how netlink messages for the audit system are divided into blocks. +* Looks like the best way to handle this situation is to pretend that +* the old value of AUDIT_FEATURE_CHANGE didn't exist. +*/ +# undef AUDIT_FEATURE_CHANGE +#endif + XLAT(AUDIT_FEATURE_CHANGE), + + XLAT(AUDIT_REPLACE), + XLAT(AUDIT_KERN_MODULE), + + XLAT(AUDIT_AVC), + XLAT(AUDIT_SELINUX_ERR), + XLAT(AUDIT_AVC_PATH), + XLAT(AUDIT_MAC_POLICY_LOAD), + XLAT(AUDIT_MAC_STATUS), + XLAT(AUDIT_MAC_CONFIG_CHANGE), + XLAT(AUDIT_MAC_UNLBL_ALLOW), + XLAT(AUDIT_MAC_CIPSOV4_ADD), + XLAT(AUDIT_MAC_CIPSOV4_DEL), + XLAT(AUDIT_MAC_MAP_ADD), + XLAT(AUDIT_MAC_MAP_DEL), + XLAT(AUDIT_MAC_IPSEC_ADDSA), + XLAT(AUDIT_MAC_IPSEC_DELSA), + XLAT(AUDIT_MAC_IPSEC_ADDSPD), + XLAT(AUDIT_MAC_IPSEC_DELSPD), + XLAT(AUDIT_MAC_IPSEC_EVENT), + XLAT(AUDIT_MAC_UNLBL_STCADD), + XLAT(AUDIT_MAC_UNLBL_STCDEL), + XLAT(AUDIT_MAC_CALIPSO_ADD), + XLAT(AUDIT_MAC_CALIPSO_DEL), + + XLAT(AUDIT_ANOM_PROMISCUOUS), + XLAT(AUDIT_ANOM_ABEND), + XLAT(AUDIT_ANOM_LINK), + XLAT(AUDIT_LAST_KERN_ANOM_MSG), + + XLAT(AUDIT_INTEGRITY_DATA), + XLAT(AUDIT_INTEGRITY_METADATA), + XLAT(AUDIT_INTEGRITY_STATUS), + XLAT(AUDIT_INTEGRITY_HASH), + XLAT(AUDIT_INTEGRITY_PCR), + XLAT(AUDIT_INTEGRITY_RULE), + XLAT(AUDIT_INTEGRITY_EVM_XATTR), + XLAT(AUDIT_INTEGRITY_POLICY_RULE), + + XLAT(AUDIT_KERNEL), + + XLAT(AUDIT_FIRST_USER_MSG2), + XLAT(AUDIT_LAST_USER_MSG2), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nl_audit_types.in b/xlat/nl_audit_types.in new file mode 100644 index 00000000..afba5cd5 --- /dev/null +++ b/xlat/nl_audit_types.in @@ -0,0 +1,117 @@ +AUDIT_GET 1000 +AUDIT_SET 1001 +AUDIT_LIST 1002 +AUDIT_ADD 1003 +AUDIT_DEL 1004 +AUDIT_USER 1005 +AUDIT_LOGIN 1006 +AUDIT_WATCH_INS 1007 +AUDIT_WATCH_REM 1008 +AUDIT_WATCH_LIST 1009 +AUDIT_SIGNAL_INFO 1010 +AUDIT_ADD_RULE 1011 +AUDIT_DEL_RULE 1012 +AUDIT_LIST_RULES 1013 +AUDIT_TRIM 1014 +AUDIT_MAKE_EQUIV 1015 +AUDIT_TTY_GET 1016 +AUDIT_TTY_SET 1017 +AUDIT_SET_FEATURE 1018 +AUDIT_GET_FEATURE 1019 + +AUDIT_FIRST_USER_MSG 1100 +AUDIT_USER_AVC 1107 +AUDIT_USER_TTY 1124 +AUDIT_LAST_USER_MSG 1199 + +AUDIT_DAEMON_START 1200 +AUDIT_DAEMON_END 1201 +AUDIT_DAEMON_ABORT 1202 +AUDIT_DAEMON_CONFIG 1203 + +AUDIT_SYSCALL 1300 +AUDIT_FS_WATCH 1301 +AUDIT_PATH 1302 +AUDIT_IPC 1303 +AUDIT_SOCKETCALL 1304 +AUDIT_CONFIG_CHANGE 1305 +AUDIT_SOCKADDR 1306 +AUDIT_CWD 1307 +AUDIT_EXECVE 1309 +AUDIT_IPC_SET_PERM 1311 +AUDIT_MQ_OPEN 1312 +AUDIT_MQ_SENDRECV 1313 +AUDIT_MQ_NOTIFY 1314 +AUDIT_MQ_GETSETATTR 1315 +AUDIT_KERNEL_OTHER 1316 +AUDIT_FD_PAIR 1317 +AUDIT_OBJ_PID 1318 +AUDIT_TTY 1319 +AUDIT_EOE 1320 +AUDIT_BPRM_FCAPS 1321 +AUDIT_CAPSET 1322 +AUDIT_MMAP 1323 +AUDIT_NETFILTER_PKT 1324 +AUDIT_NETFILTER_CFG 1325 +AUDIT_SECCOMP 1326 +AUDIT_PROCTITLE 1327 + +#ifndef STRACE_WORKAROUND_FOR_AUDIT_FEATURE_CHANGE +# define STRACE_WORKAROUND_FOR_AUDIT_FEATURE_CHANGE +/* + * Linux kernel commit v3.15-rc1~18^2~1 has changed the value + * of AUDIT_FEATURE_CHANGE constant introduced by commit v3.13-rc1~19^2~20 + * which is of course an ABI breakage that affected 3.13 and 3.14 kernel + * releases as well as their LTS derivatives. + * Linux kernel commit v3.15-rc1~18^2~1 also claims that the old value + * of AUDIT_FEATURE_CHANGE was ignored by userspace because of the established + * convention how netlink messages for the audit system are divided into blocks. + * Looks like the best way to handle this situation is to pretend that + * the old value of AUDIT_FEATURE_CHANGE didn't exist. + */ +# undef AUDIT_FEATURE_CHANGE +#endif +AUDIT_FEATURE_CHANGE 1328 + +AUDIT_REPLACE 1329 +AUDIT_KERN_MODULE 1330 + +AUDIT_AVC 1400 +AUDIT_SELINUX_ERR 1401 +AUDIT_AVC_PATH 1402 +AUDIT_MAC_POLICY_LOAD 1403 +AUDIT_MAC_STATUS 1404 +AUDIT_MAC_CONFIG_CHANGE 1405 +AUDIT_MAC_UNLBL_ALLOW 1406 +AUDIT_MAC_CIPSOV4_ADD 1407 +AUDIT_MAC_CIPSOV4_DEL 1408 +AUDIT_MAC_MAP_ADD 1409 +AUDIT_MAC_MAP_DEL 1410 +AUDIT_MAC_IPSEC_ADDSA 1411 +AUDIT_MAC_IPSEC_DELSA 1412 +AUDIT_MAC_IPSEC_ADDSPD 1413 +AUDIT_MAC_IPSEC_DELSPD 1414 +AUDIT_MAC_IPSEC_EVENT 1415 +AUDIT_MAC_UNLBL_STCADD 1416 +AUDIT_MAC_UNLBL_STCDEL 1417 +AUDIT_MAC_CALIPSO_ADD 1418 +AUDIT_MAC_CALIPSO_DEL 1419 + +AUDIT_ANOM_PROMISCUOUS 1700 +AUDIT_ANOM_ABEND 1701 +AUDIT_ANOM_LINK 1702 +AUDIT_LAST_KERN_ANOM_MSG 1799 + +AUDIT_INTEGRITY_DATA 1800 +AUDIT_INTEGRITY_METADATA 1801 +AUDIT_INTEGRITY_STATUS 1802 +AUDIT_INTEGRITY_HASH 1803 +AUDIT_INTEGRITY_PCR 1804 +AUDIT_INTEGRITY_RULE 1805 +AUDIT_INTEGRITY_EVM_XATTR 1806 +AUDIT_INTEGRITY_POLICY_RULE 1807 + +AUDIT_KERNEL 2000 + +AUDIT_FIRST_USER_MSG2 2100 +AUDIT_LAST_USER_MSG2 2999 diff --git a/xlat/nl_crypto_types.h b/xlat/nl_crypto_types.h new file mode 100644 index 00000000..87b6a68f --- /dev/null +++ b/xlat/nl_crypto_types.h @@ -0,0 +1,62 @@ +/* Generated by ./xlat/gen.sh from ./xlat/nl_crypto_types.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(CRYPTO_MSG_NEWALG) || (defined(HAVE_DECL_CRYPTO_MSG_NEWALG) && HAVE_DECL_CRYPTO_MSG_NEWALG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CRYPTO_MSG_NEWALG) == (0x10), "CRYPTO_MSG_NEWALG != 0x10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CRYPTO_MSG_NEWALG 0x10 +#endif +#if defined(CRYPTO_MSG_DELALG) || (defined(HAVE_DECL_CRYPTO_MSG_DELALG) && HAVE_DECL_CRYPTO_MSG_DELALG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CRYPTO_MSG_DELALG) == (0x11), "CRYPTO_MSG_DELALG != 0x11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CRYPTO_MSG_DELALG 0x11 +#endif +#if defined(CRYPTO_MSG_UPDATEALG) || (defined(HAVE_DECL_CRYPTO_MSG_UPDATEALG) && HAVE_DECL_CRYPTO_MSG_UPDATEALG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CRYPTO_MSG_UPDATEALG) == (0x12), "CRYPTO_MSG_UPDATEALG != 0x12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CRYPTO_MSG_UPDATEALG 0x12 +#endif +#if defined(CRYPTO_MSG_GETALG) || (defined(HAVE_DECL_CRYPTO_MSG_GETALG) && HAVE_DECL_CRYPTO_MSG_GETALG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CRYPTO_MSG_GETALG) == (0x13), "CRYPTO_MSG_GETALG != 0x13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CRYPTO_MSG_GETALG 0x13 +#endif +#if defined(CRYPTO_MSG_DELRNG) || (defined(HAVE_DECL_CRYPTO_MSG_DELRNG) && HAVE_DECL_CRYPTO_MSG_DELRNG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CRYPTO_MSG_DELRNG) == (0x14), "CRYPTO_MSG_DELRNG != 0x14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CRYPTO_MSG_DELRNG 0x14 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat nl_crypto_types in mpers mode + +# else + +static +const struct xlat nl_crypto_types[] = { + XLAT(CRYPTO_MSG_NEWALG), + XLAT(CRYPTO_MSG_DELALG), + XLAT(CRYPTO_MSG_UPDATEALG), + XLAT(CRYPTO_MSG_GETALG), + XLAT(CRYPTO_MSG_DELRNG), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nl_crypto_types.in b/xlat/nl_crypto_types.in new file mode 100644 index 00000000..021f85fc --- /dev/null +++ b/xlat/nl_crypto_types.in @@ -0,0 +1,5 @@ +CRYPTO_MSG_NEWALG 0x10 +CRYPTO_MSG_DELALG 0x11 +CRYPTO_MSG_UPDATEALG 0x12 +CRYPTO_MSG_GETALG 0x13 +CRYPTO_MSG_DELRNG 0x14 diff --git a/xlat/nl_netfilter_msg_types.h b/xlat/nl_netfilter_msg_types.h new file mode 100644 index 00000000..a92f1870 --- /dev/null +++ b/xlat/nl_netfilter_msg_types.h @@ -0,0 +1,33 @@ +/* Generated by ./xlat/gen.sh from ./xlat/nl_netfilter_msg_types.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NFNL_MSG_BATCH_BEGIN) || (defined(HAVE_DECL_NFNL_MSG_BATCH_BEGIN) && HAVE_DECL_NFNL_MSG_BATCH_BEGIN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNL_MSG_BATCH_BEGIN) == (0x10), "NFNL_MSG_BATCH_BEGIN != 0x10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNL_MSG_BATCH_BEGIN 0x10 +#endif +#if defined(NFNL_MSG_BATCH_END) || (defined(HAVE_DECL_NFNL_MSG_BATCH_END) && HAVE_DECL_NFNL_MSG_BATCH_END) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNL_MSG_BATCH_END) == (0x11), "NFNL_MSG_BATCH_END != 0x11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNL_MSG_BATCH_END 0x11 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS + +const struct xlat nl_netfilter_msg_types[] = { + XLAT(NFNL_MSG_BATCH_BEGIN), + XLAT(NFNL_MSG_BATCH_END), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nl_netfilter_msg_types.in b/xlat/nl_netfilter_msg_types.in new file mode 100644 index 00000000..dd13207e --- /dev/null +++ b/xlat/nl_netfilter_msg_types.in @@ -0,0 +1,2 @@ +NFNL_MSG_BATCH_BEGIN 0x10 +NFNL_MSG_BATCH_END 0x11 diff --git a/xlat/nl_netfilter_subsys_ids.h b/xlat/nl_netfilter_subsys_ids.h new file mode 100644 index 00000000..f6af1f3f --- /dev/null +++ b/xlat/nl_netfilter_subsys_ids.h @@ -0,0 +1,118 @@ +/* Generated by ./xlat/gen.sh from ./xlat/nl_netfilter_subsys_ids.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NFNL_SUBSYS_NONE) || (defined(HAVE_DECL_NFNL_SUBSYS_NONE) && HAVE_DECL_NFNL_SUBSYS_NONE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNL_SUBSYS_NONE) == (0), "NFNL_SUBSYS_NONE != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNL_SUBSYS_NONE 0 +#endif +#if defined(NFNL_SUBSYS_CTNETLINK) || (defined(HAVE_DECL_NFNL_SUBSYS_CTNETLINK) && HAVE_DECL_NFNL_SUBSYS_CTNETLINK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNL_SUBSYS_CTNETLINK) == (1), "NFNL_SUBSYS_CTNETLINK != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNL_SUBSYS_CTNETLINK 1 +#endif +#if defined(NFNL_SUBSYS_CTNETLINK_EXP) || (defined(HAVE_DECL_NFNL_SUBSYS_CTNETLINK_EXP) && HAVE_DECL_NFNL_SUBSYS_CTNETLINK_EXP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNL_SUBSYS_CTNETLINK_EXP) == (2), "NFNL_SUBSYS_CTNETLINK_EXP != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNL_SUBSYS_CTNETLINK_EXP 2 +#endif +#if defined(NFNL_SUBSYS_QUEUE) || (defined(HAVE_DECL_NFNL_SUBSYS_QUEUE) && HAVE_DECL_NFNL_SUBSYS_QUEUE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNL_SUBSYS_QUEUE) == (3), "NFNL_SUBSYS_QUEUE != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNL_SUBSYS_QUEUE 3 +#endif +#if defined(NFNL_SUBSYS_ULOG) || (defined(HAVE_DECL_NFNL_SUBSYS_ULOG) && HAVE_DECL_NFNL_SUBSYS_ULOG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNL_SUBSYS_ULOG) == (4), "NFNL_SUBSYS_ULOG != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNL_SUBSYS_ULOG 4 +#endif +#if defined(NFNL_SUBSYS_OSF) || (defined(HAVE_DECL_NFNL_SUBSYS_OSF) && HAVE_DECL_NFNL_SUBSYS_OSF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNL_SUBSYS_OSF) == (5), "NFNL_SUBSYS_OSF != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNL_SUBSYS_OSF 5 +#endif +#if defined(NFNL_SUBSYS_IPSET) || (defined(HAVE_DECL_NFNL_SUBSYS_IPSET) && HAVE_DECL_NFNL_SUBSYS_IPSET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNL_SUBSYS_IPSET) == (6), "NFNL_SUBSYS_IPSET != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNL_SUBSYS_IPSET 6 +#endif +#if defined(NFNL_SUBSYS_ACCT) || (defined(HAVE_DECL_NFNL_SUBSYS_ACCT) && HAVE_DECL_NFNL_SUBSYS_ACCT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNL_SUBSYS_ACCT) == (7), "NFNL_SUBSYS_ACCT != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNL_SUBSYS_ACCT 7 +#endif +#if defined(NFNL_SUBSYS_CTNETLINK_TIMEOUT) || (defined(HAVE_DECL_NFNL_SUBSYS_CTNETLINK_TIMEOUT) && HAVE_DECL_NFNL_SUBSYS_CTNETLINK_TIMEOUT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNL_SUBSYS_CTNETLINK_TIMEOUT) == (8), "NFNL_SUBSYS_CTNETLINK_TIMEOUT != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNL_SUBSYS_CTNETLINK_TIMEOUT 8 +#endif +#if defined(NFNL_SUBSYS_CTHELPER) || (defined(HAVE_DECL_NFNL_SUBSYS_CTHELPER) && HAVE_DECL_NFNL_SUBSYS_CTHELPER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNL_SUBSYS_CTHELPER) == (9), "NFNL_SUBSYS_CTHELPER != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNL_SUBSYS_CTHELPER 9 +#endif +#if defined(NFNL_SUBSYS_NFTABLES) || (defined(HAVE_DECL_NFNL_SUBSYS_NFTABLES) && HAVE_DECL_NFNL_SUBSYS_NFTABLES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNL_SUBSYS_NFTABLES) == (10), "NFNL_SUBSYS_NFTABLES != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNL_SUBSYS_NFTABLES 10 +#endif +#if defined(NFNL_SUBSYS_NFT_COMPAT) || (defined(HAVE_DECL_NFNL_SUBSYS_NFT_COMPAT) && HAVE_DECL_NFNL_SUBSYS_NFT_COMPAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFNL_SUBSYS_NFT_COMPAT) == (11), "NFNL_SUBSYS_NFT_COMPAT != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFNL_SUBSYS_NFT_COMPAT 11 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat nl_netfilter_subsys_ids in mpers mode + +# else + +static +const struct xlat nl_netfilter_subsys_ids[] = { + XLAT(NFNL_SUBSYS_NONE), + XLAT(NFNL_SUBSYS_CTNETLINK), + XLAT(NFNL_SUBSYS_CTNETLINK_EXP), + XLAT(NFNL_SUBSYS_QUEUE), + XLAT(NFNL_SUBSYS_ULOG), + XLAT(NFNL_SUBSYS_OSF), + XLAT(NFNL_SUBSYS_IPSET), + XLAT(NFNL_SUBSYS_ACCT), + XLAT(NFNL_SUBSYS_CTNETLINK_TIMEOUT), + XLAT(NFNL_SUBSYS_CTHELPER), + XLAT(NFNL_SUBSYS_NFTABLES), + XLAT(NFNL_SUBSYS_NFT_COMPAT), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nl_netfilter_subsys_ids.in b/xlat/nl_netfilter_subsys_ids.in new file mode 100644 index 00000000..52aad872 --- /dev/null +++ b/xlat/nl_netfilter_subsys_ids.in @@ -0,0 +1,12 @@ +NFNL_SUBSYS_NONE 0 +NFNL_SUBSYS_CTNETLINK 1 +NFNL_SUBSYS_CTNETLINK_EXP 2 +NFNL_SUBSYS_QUEUE 3 +NFNL_SUBSYS_ULOG 4 +NFNL_SUBSYS_OSF 5 +NFNL_SUBSYS_IPSET 6 +NFNL_SUBSYS_ACCT 7 +NFNL_SUBSYS_CTNETLINK_TIMEOUT 8 +NFNL_SUBSYS_CTHELPER 9 +NFNL_SUBSYS_NFTABLES 10 +NFNL_SUBSYS_NFT_COMPAT 11 diff --git a/xlat/nl_route_types.h b/xlat/nl_route_types.h new file mode 100644 index 00000000..80b06fe5 --- /dev/null +++ b/xlat/nl_route_types.h @@ -0,0 +1,452 @@ +/* Generated by ./xlat/gen.sh from ./xlat/nl_route_types.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(RTM_NEWLINK) || (defined(HAVE_DECL_RTM_NEWLINK) && HAVE_DECL_RTM_NEWLINK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_NEWLINK) == (16), "RTM_NEWLINK != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_NEWLINK 16 +#endif +#if defined(RTM_DELLINK) || (defined(HAVE_DECL_RTM_DELLINK) && HAVE_DECL_RTM_DELLINK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_DELLINK) == (17), "RTM_DELLINK != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_DELLINK 17 +#endif +#if defined(RTM_GETLINK) || (defined(HAVE_DECL_RTM_GETLINK) && HAVE_DECL_RTM_GETLINK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_GETLINK) == (18), "RTM_GETLINK != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_GETLINK 18 +#endif +#if defined(RTM_SETLINK) || (defined(HAVE_DECL_RTM_SETLINK) && HAVE_DECL_RTM_SETLINK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_SETLINK) == (19), "RTM_SETLINK != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_SETLINK 19 +#endif +#if defined(RTM_NEWADDR) || (defined(HAVE_DECL_RTM_NEWADDR) && HAVE_DECL_RTM_NEWADDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_NEWADDR) == (20), "RTM_NEWADDR != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_NEWADDR 20 +#endif +#if defined(RTM_DELADDR) || (defined(HAVE_DECL_RTM_DELADDR) && HAVE_DECL_RTM_DELADDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_DELADDR) == (21), "RTM_DELADDR != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_DELADDR 21 +#endif +#if defined(RTM_GETADDR) || (defined(HAVE_DECL_RTM_GETADDR) && HAVE_DECL_RTM_GETADDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_GETADDR) == (22), "RTM_GETADDR != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_GETADDR 22 +#endif +#if defined(RTM_NEWROUTE) || (defined(HAVE_DECL_RTM_NEWROUTE) && HAVE_DECL_RTM_NEWROUTE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_NEWROUTE) == (24), "RTM_NEWROUTE != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_NEWROUTE 24 +#endif +#if defined(RTM_DELROUTE) || (defined(HAVE_DECL_RTM_DELROUTE) && HAVE_DECL_RTM_DELROUTE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_DELROUTE) == (25), "RTM_DELROUTE != 25"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_DELROUTE 25 +#endif +#if defined(RTM_GETROUTE) || (defined(HAVE_DECL_RTM_GETROUTE) && HAVE_DECL_RTM_GETROUTE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_GETROUTE) == (26), "RTM_GETROUTE != 26"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_GETROUTE 26 +#endif +#if defined(RTM_NEWNEIGH) || (defined(HAVE_DECL_RTM_NEWNEIGH) && HAVE_DECL_RTM_NEWNEIGH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_NEWNEIGH) == (28), "RTM_NEWNEIGH != 28"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_NEWNEIGH 28 +#endif +#if defined(RTM_DELNEIGH) || (defined(HAVE_DECL_RTM_DELNEIGH) && HAVE_DECL_RTM_DELNEIGH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_DELNEIGH) == (29), "RTM_DELNEIGH != 29"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_DELNEIGH 29 +#endif +#if defined(RTM_GETNEIGH) || (defined(HAVE_DECL_RTM_GETNEIGH) && HAVE_DECL_RTM_GETNEIGH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_GETNEIGH) == (30), "RTM_GETNEIGH != 30"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_GETNEIGH 30 +#endif +#if defined(RTM_NEWRULE) || (defined(HAVE_DECL_RTM_NEWRULE) && HAVE_DECL_RTM_NEWRULE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_NEWRULE) == (32), "RTM_NEWRULE != 32"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_NEWRULE 32 +#endif +#if defined(RTM_DELRULE) || (defined(HAVE_DECL_RTM_DELRULE) && HAVE_DECL_RTM_DELRULE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_DELRULE) == (33), "RTM_DELRULE != 33"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_DELRULE 33 +#endif +#if defined(RTM_GETRULE) || (defined(HAVE_DECL_RTM_GETRULE) && HAVE_DECL_RTM_GETRULE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_GETRULE) == (34), "RTM_GETRULE != 34"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_GETRULE 34 +#endif +#if defined(RTM_NEWQDISC) || (defined(HAVE_DECL_RTM_NEWQDISC) && HAVE_DECL_RTM_NEWQDISC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_NEWQDISC) == (36), "RTM_NEWQDISC != 36"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_NEWQDISC 36 +#endif +#if defined(RTM_DELQDISC) || (defined(HAVE_DECL_RTM_DELQDISC) && HAVE_DECL_RTM_DELQDISC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_DELQDISC) == (37), "RTM_DELQDISC != 37"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_DELQDISC 37 +#endif +#if defined(RTM_GETQDISC) || (defined(HAVE_DECL_RTM_GETQDISC) && HAVE_DECL_RTM_GETQDISC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_GETQDISC) == (38), "RTM_GETQDISC != 38"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_GETQDISC 38 +#endif +#if defined(RTM_NEWTCLASS) || (defined(HAVE_DECL_RTM_NEWTCLASS) && HAVE_DECL_RTM_NEWTCLASS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_NEWTCLASS) == (40), "RTM_NEWTCLASS != 40"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_NEWTCLASS 40 +#endif +#if defined(RTM_DELTCLASS) || (defined(HAVE_DECL_RTM_DELTCLASS) && HAVE_DECL_RTM_DELTCLASS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_DELTCLASS) == (41), "RTM_DELTCLASS != 41"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_DELTCLASS 41 +#endif +#if defined(RTM_GETTCLASS) || (defined(HAVE_DECL_RTM_GETTCLASS) && HAVE_DECL_RTM_GETTCLASS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_GETTCLASS) == (42), "RTM_GETTCLASS != 42"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_GETTCLASS 42 +#endif +#if defined(RTM_NEWTFILTER) || (defined(HAVE_DECL_RTM_NEWTFILTER) && HAVE_DECL_RTM_NEWTFILTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_NEWTFILTER) == (44), "RTM_NEWTFILTER != 44"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_NEWTFILTER 44 +#endif +#if defined(RTM_DELTFILTER) || (defined(HAVE_DECL_RTM_DELTFILTER) && HAVE_DECL_RTM_DELTFILTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_DELTFILTER) == (45), "RTM_DELTFILTER != 45"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_DELTFILTER 45 +#endif +#if defined(RTM_GETTFILTER) || (defined(HAVE_DECL_RTM_GETTFILTER) && HAVE_DECL_RTM_GETTFILTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_GETTFILTER) == (46), "RTM_GETTFILTER != 46"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_GETTFILTER 46 +#endif +#if defined(RTM_NEWACTION) || (defined(HAVE_DECL_RTM_NEWACTION) && HAVE_DECL_RTM_NEWACTION) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_NEWACTION) == (48), "RTM_NEWACTION != 48"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_NEWACTION 48 +#endif +#if defined(RTM_DELACTION) || (defined(HAVE_DECL_RTM_DELACTION) && HAVE_DECL_RTM_DELACTION) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_DELACTION) == (49), "RTM_DELACTION != 49"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_DELACTION 49 +#endif +#if defined(RTM_GETACTION) || (defined(HAVE_DECL_RTM_GETACTION) && HAVE_DECL_RTM_GETACTION) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_GETACTION) == (50), "RTM_GETACTION != 50"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_GETACTION 50 +#endif +#if defined(RTM_NEWPREFIX) || (defined(HAVE_DECL_RTM_NEWPREFIX) && HAVE_DECL_RTM_NEWPREFIX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_NEWPREFIX) == (52), "RTM_NEWPREFIX != 52"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_NEWPREFIX 52 +#endif +#if defined(RTM_GETPREFIX) || (defined(HAVE_DECL_RTM_GETPREFIX) && HAVE_DECL_RTM_GETPREFIX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_GETPREFIX) == (54), "RTM_GETPREFIX != 54"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_GETPREFIX 54 +#endif +#if defined(RTM_GETMULTICAST) || (defined(HAVE_DECL_RTM_GETMULTICAST) && HAVE_DECL_RTM_GETMULTICAST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_GETMULTICAST) == (58), "RTM_GETMULTICAST != 58"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_GETMULTICAST 58 +#endif +#if defined(RTM_GETANYCAST) || (defined(HAVE_DECL_RTM_GETANYCAST) && HAVE_DECL_RTM_GETANYCAST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_GETANYCAST) == (62), "RTM_GETANYCAST != 62"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_GETANYCAST 62 +#endif +#if defined(RTM_NEWNEIGHTBL) || (defined(HAVE_DECL_RTM_NEWNEIGHTBL) && HAVE_DECL_RTM_NEWNEIGHTBL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_NEWNEIGHTBL) == (64), "RTM_NEWNEIGHTBL != 64"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_NEWNEIGHTBL 64 +#endif +#if defined(RTM_GETNEIGHTBL) || (defined(HAVE_DECL_RTM_GETNEIGHTBL) && HAVE_DECL_RTM_GETNEIGHTBL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_GETNEIGHTBL) == (66), "RTM_GETNEIGHTBL != 66"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_GETNEIGHTBL 66 +#endif +#if defined(RTM_SETNEIGHTBL) || (defined(HAVE_DECL_RTM_SETNEIGHTBL) && HAVE_DECL_RTM_SETNEIGHTBL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_SETNEIGHTBL) == (67), "RTM_SETNEIGHTBL != 67"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_SETNEIGHTBL 67 +#endif +#if defined(RTM_NEWNDUSEROPT) || (defined(HAVE_DECL_RTM_NEWNDUSEROPT) && HAVE_DECL_RTM_NEWNDUSEROPT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_NEWNDUSEROPT) == (68), "RTM_NEWNDUSEROPT != 68"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_NEWNDUSEROPT 68 +#endif +#if defined(RTM_NEWADDRLABEL) || (defined(HAVE_DECL_RTM_NEWADDRLABEL) && HAVE_DECL_RTM_NEWADDRLABEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_NEWADDRLABEL) == (72), "RTM_NEWADDRLABEL != 72"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_NEWADDRLABEL 72 +#endif +#if defined(RTM_DELADDRLABEL) || (defined(HAVE_DECL_RTM_DELADDRLABEL) && HAVE_DECL_RTM_DELADDRLABEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_DELADDRLABEL) == (73), "RTM_DELADDRLABEL != 73"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_DELADDRLABEL 73 +#endif +#if defined(RTM_GETADDRLABEL) || (defined(HAVE_DECL_RTM_GETADDRLABEL) && HAVE_DECL_RTM_GETADDRLABEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_GETADDRLABEL) == (74), "RTM_GETADDRLABEL != 74"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_GETADDRLABEL 74 +#endif +#if defined(RTM_GETDCB) || (defined(HAVE_DECL_RTM_GETDCB) && HAVE_DECL_RTM_GETDCB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_GETDCB) == (78), "RTM_GETDCB != 78"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_GETDCB 78 +#endif +#if defined(RTM_SETDCB) || (defined(HAVE_DECL_RTM_SETDCB) && HAVE_DECL_RTM_SETDCB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_SETDCB) == (79), "RTM_SETDCB != 79"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_SETDCB 79 +#endif +#if defined(RTM_NEWNETCONF) || (defined(HAVE_DECL_RTM_NEWNETCONF) && HAVE_DECL_RTM_NEWNETCONF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_NEWNETCONF) == (80), "RTM_NEWNETCONF != 80"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_NEWNETCONF 80 +#endif +#if defined(RTM_DELNETCONF) || (defined(HAVE_DECL_RTM_DELNETCONF) && HAVE_DECL_RTM_DELNETCONF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_DELNETCONF) == (81), "RTM_DELNETCONF != 81"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_DELNETCONF 81 +#endif +#if defined(RTM_GETNETCONF) || (defined(HAVE_DECL_RTM_GETNETCONF) && HAVE_DECL_RTM_GETNETCONF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_GETNETCONF) == (82), "RTM_GETNETCONF != 82"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_GETNETCONF 82 +#endif +#if defined(RTM_NEWMDB) || (defined(HAVE_DECL_RTM_NEWMDB) && HAVE_DECL_RTM_NEWMDB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_NEWMDB) == (84), "RTM_NEWMDB != 84"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_NEWMDB 84 +#endif +#if defined(RTM_DELMDB) || (defined(HAVE_DECL_RTM_DELMDB) && HAVE_DECL_RTM_DELMDB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_DELMDB) == (85), "RTM_DELMDB != 85"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_DELMDB 85 +#endif +#if defined(RTM_GETMDB) || (defined(HAVE_DECL_RTM_GETMDB) && HAVE_DECL_RTM_GETMDB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_GETMDB) == (86), "RTM_GETMDB != 86"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_GETMDB 86 +#endif +#if defined(RTM_NEWNSID) || (defined(HAVE_DECL_RTM_NEWNSID) && HAVE_DECL_RTM_NEWNSID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_NEWNSID) == (88), "RTM_NEWNSID != 88"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_NEWNSID 88 +#endif +#if defined(RTM_DELNSID) || (defined(HAVE_DECL_RTM_DELNSID) && HAVE_DECL_RTM_DELNSID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_DELNSID) == (89), "RTM_DELNSID != 89"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_DELNSID 89 +#endif +#if defined(RTM_GETNSID) || (defined(HAVE_DECL_RTM_GETNSID) && HAVE_DECL_RTM_GETNSID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_GETNSID) == (90), "RTM_GETNSID != 90"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_GETNSID 90 +#endif +#if defined(RTM_NEWSTATS) || (defined(HAVE_DECL_RTM_NEWSTATS) && HAVE_DECL_RTM_NEWSTATS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_NEWSTATS) == (92), "RTM_NEWSTATS != 92"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_NEWSTATS 92 +#endif +#if defined(RTM_GETSTATS) || (defined(HAVE_DECL_RTM_GETSTATS) && HAVE_DECL_RTM_GETSTATS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTM_GETSTATS) == (94), "RTM_GETSTATS != 94"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTM_GETSTATS 94 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS + +const struct xlat nl_route_types[] = { + XLAT(RTM_NEWLINK), + XLAT(RTM_DELLINK), + XLAT(RTM_GETLINK), + XLAT(RTM_SETLINK), + + XLAT(RTM_NEWADDR), + XLAT(RTM_DELADDR), + XLAT(RTM_GETADDR), + + XLAT(RTM_NEWROUTE), + XLAT(RTM_DELROUTE), + XLAT(RTM_GETROUTE), + + XLAT(RTM_NEWNEIGH), + XLAT(RTM_DELNEIGH), + XLAT(RTM_GETNEIGH), + + XLAT(RTM_NEWRULE), + XLAT(RTM_DELRULE), + XLAT(RTM_GETRULE), + + XLAT(RTM_NEWQDISC), + XLAT(RTM_DELQDISC), + XLAT(RTM_GETQDISC), + + XLAT(RTM_NEWTCLASS), + XLAT(RTM_DELTCLASS), + XLAT(RTM_GETTCLASS), + + XLAT(RTM_NEWTFILTER), + XLAT(RTM_DELTFILTER), + XLAT(RTM_GETTFILTER), + + XLAT(RTM_NEWACTION), + XLAT(RTM_DELACTION), + XLAT(RTM_GETACTION), + + XLAT(RTM_NEWPREFIX), + XLAT(RTM_GETPREFIX), + + XLAT(RTM_GETMULTICAST), + + XLAT(RTM_GETANYCAST), + + XLAT(RTM_NEWNEIGHTBL), + XLAT(RTM_GETNEIGHTBL), + XLAT(RTM_SETNEIGHTBL), + + XLAT(RTM_NEWNDUSEROPT), + + XLAT(RTM_NEWADDRLABEL), + XLAT(RTM_DELADDRLABEL), + XLAT(RTM_GETADDRLABEL), + + XLAT(RTM_GETDCB), + XLAT(RTM_SETDCB), + + XLAT(RTM_NEWNETCONF), + XLAT(RTM_DELNETCONF), + XLAT(RTM_GETNETCONF), + + XLAT(RTM_NEWMDB), + XLAT(RTM_DELMDB), + XLAT(RTM_GETMDB), + + XLAT(RTM_NEWNSID), + XLAT(RTM_DELNSID), + XLAT(RTM_GETNSID), + + XLAT(RTM_NEWSTATS), + XLAT(RTM_GETSTATS), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nl_route_types.in b/xlat/nl_route_types.in new file mode 100644 index 00000000..0356b615 --- /dev/null +++ b/xlat/nl_route_types.in @@ -0,0 +1,71 @@ +RTM_NEWLINK 16 +RTM_DELLINK 17 +RTM_GETLINK 18 +RTM_SETLINK 19 + +RTM_NEWADDR 20 +RTM_DELADDR 21 +RTM_GETADDR 22 + +RTM_NEWROUTE 24 +RTM_DELROUTE 25 +RTM_GETROUTE 26 + +RTM_NEWNEIGH 28 +RTM_DELNEIGH 29 +RTM_GETNEIGH 30 + +RTM_NEWRULE 32 +RTM_DELRULE 33 +RTM_GETRULE 34 + +RTM_NEWQDISC 36 +RTM_DELQDISC 37 +RTM_GETQDISC 38 + +RTM_NEWTCLASS 40 +RTM_DELTCLASS 41 +RTM_GETTCLASS 42 + +RTM_NEWTFILTER 44 +RTM_DELTFILTER 45 +RTM_GETTFILTER 46 + +RTM_NEWACTION 48 +RTM_DELACTION 49 +RTM_GETACTION 50 + +RTM_NEWPREFIX 52 +RTM_GETPREFIX 54 + +RTM_GETMULTICAST 58 + +RTM_GETANYCAST 62 + +RTM_NEWNEIGHTBL 64 +RTM_GETNEIGHTBL 66 +RTM_SETNEIGHTBL 67 + +RTM_NEWNDUSEROPT 68 + +RTM_NEWADDRLABEL 72 +RTM_DELADDRLABEL 73 +RTM_GETADDRLABEL 74 + +RTM_GETDCB 78 +RTM_SETDCB 79 + +RTM_NEWNETCONF 80 +RTM_DELNETCONF 81 +RTM_GETNETCONF 82 + +RTM_NEWMDB 84 +RTM_DELMDB 85 +RTM_GETMDB 86 + +RTM_NEWNSID 88 +RTM_DELNSID 89 +RTM_GETNSID 90 + +RTM_NEWSTATS 92 +RTM_GETSTATS 94 diff --git a/xlat/nl_selinux_types.h b/xlat/nl_selinux_types.h new file mode 100644 index 00000000..95ae3df0 --- /dev/null +++ b/xlat/nl_selinux_types.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/nl_selinux_types.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SELNL_MSG_SETENFORCE) || (defined(HAVE_DECL_SELNL_MSG_SETENFORCE) && HAVE_DECL_SELNL_MSG_SETENFORCE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SELNL_MSG_SETENFORCE) == (0x10), "SELNL_MSG_SETENFORCE != 0x10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SELNL_MSG_SETENFORCE 0x10 +#endif +#if defined(SELNL_MSG_POLICYLOAD) || (defined(HAVE_DECL_SELNL_MSG_POLICYLOAD) && HAVE_DECL_SELNL_MSG_POLICYLOAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SELNL_MSG_POLICYLOAD) == (0x11), "SELNL_MSG_POLICYLOAD != 0x11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SELNL_MSG_POLICYLOAD 0x11 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat nl_selinux_types in mpers mode + +# else + +static +const struct xlat nl_selinux_types[] = { + XLAT(SELNL_MSG_SETENFORCE), + XLAT(SELNL_MSG_POLICYLOAD), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nl_selinux_types.in b/xlat/nl_selinux_types.in new file mode 100644 index 00000000..1ac46053 --- /dev/null +++ b/xlat/nl_selinux_types.in @@ -0,0 +1,2 @@ +SELNL_MSG_SETENFORCE 0x10 +SELNL_MSG_POLICYLOAD 0x11 diff --git a/xlat/nl_sock_diag_types.h b/xlat/nl_sock_diag_types.h new file mode 100644 index 00000000..d0afe449 --- /dev/null +++ b/xlat/nl_sock_diag_types.h @@ -0,0 +1,54 @@ +/* Generated by ./xlat/gen.sh from ./xlat/nl_sock_diag_types.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(TCPDIAG_GETSOCK) || (defined(HAVE_DECL_TCPDIAG_GETSOCK) && HAVE_DECL_TCPDIAG_GETSOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCPDIAG_GETSOCK) == (18), "TCPDIAG_GETSOCK != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCPDIAG_GETSOCK 18 +#endif +#if defined(DCCPDIAG_GETSOCK) || (defined(HAVE_DECL_DCCPDIAG_GETSOCK) && HAVE_DECL_DCCPDIAG_GETSOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCCPDIAG_GETSOCK) == (19), "DCCPDIAG_GETSOCK != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCCPDIAG_GETSOCK 19 +#endif +#if defined(SOCK_DIAG_BY_FAMILY) || (defined(HAVE_DECL_SOCK_DIAG_BY_FAMILY) && HAVE_DECL_SOCK_DIAG_BY_FAMILY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOCK_DIAG_BY_FAMILY) == (20), "SOCK_DIAG_BY_FAMILY != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SOCK_DIAG_BY_FAMILY 20 +#endif +#if defined(SOCK_DESTROY) || (defined(HAVE_DECL_SOCK_DESTROY) && HAVE_DECL_SOCK_DESTROY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOCK_DESTROY) == (21), "SOCK_DESTROY != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SOCK_DESTROY 21 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat nl_sock_diag_types in mpers mode + +# else + +static +const struct xlat nl_sock_diag_types[] = { + XLAT(TCPDIAG_GETSOCK), + XLAT(DCCPDIAG_GETSOCK), + XLAT(SOCK_DIAG_BY_FAMILY), + XLAT(SOCK_DESTROY), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nl_sock_diag_types.in b/xlat/nl_sock_diag_types.in new file mode 100644 index 00000000..5c176c80 --- /dev/null +++ b/xlat/nl_sock_diag_types.in @@ -0,0 +1,4 @@ +TCPDIAG_GETSOCK 18 +DCCPDIAG_GETSOCK 19 +SOCK_DIAG_BY_FAMILY 20 +SOCK_DESTROY 21 diff --git a/xlat/nl_xfrm_types.h b/xlat/nl_xfrm_types.h new file mode 100644 index 00000000..47240fdb --- /dev/null +++ b/xlat/nl_xfrm_types.h @@ -0,0 +1,217 @@ +/* Generated by ./xlat/gen.sh from ./xlat/nl_xfrm_types.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(XFRM_MSG_NEWSA) || (defined(HAVE_DECL_XFRM_MSG_NEWSA) && HAVE_DECL_XFRM_MSG_NEWSA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XFRM_MSG_NEWSA) == (0x10), "XFRM_MSG_NEWSA != 0x10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XFRM_MSG_NEWSA 0x10 +#endif +#if defined(XFRM_MSG_DELSA) || (defined(HAVE_DECL_XFRM_MSG_DELSA) && HAVE_DECL_XFRM_MSG_DELSA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XFRM_MSG_DELSA) == (0x11), "XFRM_MSG_DELSA != 0x11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XFRM_MSG_DELSA 0x11 +#endif +#if defined(XFRM_MSG_GETSA) || (defined(HAVE_DECL_XFRM_MSG_GETSA) && HAVE_DECL_XFRM_MSG_GETSA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XFRM_MSG_GETSA) == (0x12), "XFRM_MSG_GETSA != 0x12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XFRM_MSG_GETSA 0x12 +#endif +#if defined(XFRM_MSG_NEWPOLICY) || (defined(HAVE_DECL_XFRM_MSG_NEWPOLICY) && HAVE_DECL_XFRM_MSG_NEWPOLICY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XFRM_MSG_NEWPOLICY) == (0x13), "XFRM_MSG_NEWPOLICY != 0x13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XFRM_MSG_NEWPOLICY 0x13 +#endif +#if defined(XFRM_MSG_DELPOLICY) || (defined(HAVE_DECL_XFRM_MSG_DELPOLICY) && HAVE_DECL_XFRM_MSG_DELPOLICY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XFRM_MSG_DELPOLICY) == (0x14), "XFRM_MSG_DELPOLICY != 0x14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XFRM_MSG_DELPOLICY 0x14 +#endif +#if defined(XFRM_MSG_GETPOLICY) || (defined(HAVE_DECL_XFRM_MSG_GETPOLICY) && HAVE_DECL_XFRM_MSG_GETPOLICY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XFRM_MSG_GETPOLICY) == (0x15), "XFRM_MSG_GETPOLICY != 0x15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XFRM_MSG_GETPOLICY 0x15 +#endif +#if defined(XFRM_MSG_ALLOCSPI) || (defined(HAVE_DECL_XFRM_MSG_ALLOCSPI) && HAVE_DECL_XFRM_MSG_ALLOCSPI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XFRM_MSG_ALLOCSPI) == (0x16), "XFRM_MSG_ALLOCSPI != 0x16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XFRM_MSG_ALLOCSPI 0x16 +#endif +#if defined(XFRM_MSG_ACQUIRE) || (defined(HAVE_DECL_XFRM_MSG_ACQUIRE) && HAVE_DECL_XFRM_MSG_ACQUIRE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XFRM_MSG_ACQUIRE) == (0x17), "XFRM_MSG_ACQUIRE != 0x17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XFRM_MSG_ACQUIRE 0x17 +#endif +#if defined(XFRM_MSG_EXPIRE) || (defined(HAVE_DECL_XFRM_MSG_EXPIRE) && HAVE_DECL_XFRM_MSG_EXPIRE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XFRM_MSG_EXPIRE) == (0x18), "XFRM_MSG_EXPIRE != 0x18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XFRM_MSG_EXPIRE 0x18 +#endif +#if defined(XFRM_MSG_UPDPOLICY) || (defined(HAVE_DECL_XFRM_MSG_UPDPOLICY) && HAVE_DECL_XFRM_MSG_UPDPOLICY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XFRM_MSG_UPDPOLICY) == (0x19), "XFRM_MSG_UPDPOLICY != 0x19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XFRM_MSG_UPDPOLICY 0x19 +#endif +#if defined(XFRM_MSG_UPDSA) || (defined(HAVE_DECL_XFRM_MSG_UPDSA) && HAVE_DECL_XFRM_MSG_UPDSA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XFRM_MSG_UPDSA) == (0x1a), "XFRM_MSG_UPDSA != 0x1a"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XFRM_MSG_UPDSA 0x1a +#endif +#if defined(XFRM_MSG_POLEXPIRE) || (defined(HAVE_DECL_XFRM_MSG_POLEXPIRE) && HAVE_DECL_XFRM_MSG_POLEXPIRE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XFRM_MSG_POLEXPIRE) == (0x1b), "XFRM_MSG_POLEXPIRE != 0x1b"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XFRM_MSG_POLEXPIRE 0x1b +#endif +#if defined(XFRM_MSG_FLUSHSA) || (defined(HAVE_DECL_XFRM_MSG_FLUSHSA) && HAVE_DECL_XFRM_MSG_FLUSHSA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XFRM_MSG_FLUSHSA) == (0x1c), "XFRM_MSG_FLUSHSA != 0x1c"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XFRM_MSG_FLUSHSA 0x1c +#endif +#if defined(XFRM_MSG_FLUSHPOLICY) || (defined(HAVE_DECL_XFRM_MSG_FLUSHPOLICY) && HAVE_DECL_XFRM_MSG_FLUSHPOLICY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XFRM_MSG_FLUSHPOLICY) == (0x1d), "XFRM_MSG_FLUSHPOLICY != 0x1d"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XFRM_MSG_FLUSHPOLICY 0x1d +#endif +#if defined(XFRM_MSG_NEWAE) || (defined(HAVE_DECL_XFRM_MSG_NEWAE) && HAVE_DECL_XFRM_MSG_NEWAE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XFRM_MSG_NEWAE) == (0x1e), "XFRM_MSG_NEWAE != 0x1e"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XFRM_MSG_NEWAE 0x1e +#endif +#if defined(XFRM_MSG_GETAE) || (defined(HAVE_DECL_XFRM_MSG_GETAE) && HAVE_DECL_XFRM_MSG_GETAE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XFRM_MSG_GETAE) == (0x1f), "XFRM_MSG_GETAE != 0x1f"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XFRM_MSG_GETAE 0x1f +#endif +#if defined(XFRM_MSG_REPORT) || (defined(HAVE_DECL_XFRM_MSG_REPORT) && HAVE_DECL_XFRM_MSG_REPORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XFRM_MSG_REPORT) == (0x20), "XFRM_MSG_REPORT != 0x20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XFRM_MSG_REPORT 0x20 +#endif +#if defined(XFRM_MSG_MIGRATE) || (defined(HAVE_DECL_XFRM_MSG_MIGRATE) && HAVE_DECL_XFRM_MSG_MIGRATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XFRM_MSG_MIGRATE) == (0x21), "XFRM_MSG_MIGRATE != 0x21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XFRM_MSG_MIGRATE 0x21 +#endif +#if defined(XFRM_MSG_NEWSADINFO) || (defined(HAVE_DECL_XFRM_MSG_NEWSADINFO) && HAVE_DECL_XFRM_MSG_NEWSADINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XFRM_MSG_NEWSADINFO) == (0x22), "XFRM_MSG_NEWSADINFO != 0x22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XFRM_MSG_NEWSADINFO 0x22 +#endif +#if defined(XFRM_MSG_GETSADINFO) || (defined(HAVE_DECL_XFRM_MSG_GETSADINFO) && HAVE_DECL_XFRM_MSG_GETSADINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XFRM_MSG_GETSADINFO) == (0x23), "XFRM_MSG_GETSADINFO != 0x23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XFRM_MSG_GETSADINFO 0x23 +#endif +#if defined(XFRM_MSG_NEWSPDINFO) || (defined(HAVE_DECL_XFRM_MSG_NEWSPDINFO) && HAVE_DECL_XFRM_MSG_NEWSPDINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XFRM_MSG_NEWSPDINFO) == (0x24), "XFRM_MSG_NEWSPDINFO != 0x24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XFRM_MSG_NEWSPDINFO 0x24 +#endif +#if defined(XFRM_MSG_GETSPDINFO) || (defined(HAVE_DECL_XFRM_MSG_GETSPDINFO) && HAVE_DECL_XFRM_MSG_GETSPDINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XFRM_MSG_GETSPDINFO) == (0x25), "XFRM_MSG_GETSPDINFO != 0x25"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XFRM_MSG_GETSPDINFO 0x25 +#endif +#if defined(XFRM_MSG_MAPPING) || (defined(HAVE_DECL_XFRM_MSG_MAPPING) && HAVE_DECL_XFRM_MSG_MAPPING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XFRM_MSG_MAPPING) == (0x26), "XFRM_MSG_MAPPING != 0x26"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XFRM_MSG_MAPPING 0x26 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat nl_xfrm_types in mpers mode + +# else + +static +const struct xlat nl_xfrm_types[] = { + XLAT(XFRM_MSG_NEWSA), + XLAT(XFRM_MSG_DELSA), + XLAT(XFRM_MSG_GETSA), + + XLAT(XFRM_MSG_NEWPOLICY), + XLAT(XFRM_MSG_DELPOLICY), + XLAT(XFRM_MSG_GETPOLICY), + + XLAT(XFRM_MSG_ALLOCSPI), + XLAT(XFRM_MSG_ACQUIRE), + XLAT(XFRM_MSG_EXPIRE), + + XLAT(XFRM_MSG_UPDPOLICY), + XLAT(XFRM_MSG_UPDSA), + + XLAT(XFRM_MSG_POLEXPIRE), + + XLAT(XFRM_MSG_FLUSHSA), + XLAT(XFRM_MSG_FLUSHPOLICY), + + XLAT(XFRM_MSG_NEWAE), + XLAT(XFRM_MSG_GETAE), + + XLAT(XFRM_MSG_REPORT), + + XLAT(XFRM_MSG_MIGRATE), + + XLAT(XFRM_MSG_NEWSADINFO), + XLAT(XFRM_MSG_GETSADINFO), + + XLAT(XFRM_MSG_NEWSPDINFO), + XLAT(XFRM_MSG_GETSPDINFO), + + XLAT(XFRM_MSG_MAPPING), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nl_xfrm_types.in b/xlat/nl_xfrm_types.in new file mode 100644 index 00000000..ee81394c --- /dev/null +++ b/xlat/nl_xfrm_types.in @@ -0,0 +1,34 @@ +XFRM_MSG_NEWSA 0x10 +XFRM_MSG_DELSA 0x11 +XFRM_MSG_GETSA 0x12 + +XFRM_MSG_NEWPOLICY 0x13 +XFRM_MSG_DELPOLICY 0x14 +XFRM_MSG_GETPOLICY 0x15 + +XFRM_MSG_ALLOCSPI 0x16 +XFRM_MSG_ACQUIRE 0x17 +XFRM_MSG_EXPIRE 0x18 + +XFRM_MSG_UPDPOLICY 0x19 +XFRM_MSG_UPDSA 0x1a + +XFRM_MSG_POLEXPIRE 0x1b + +XFRM_MSG_FLUSHSA 0x1c +XFRM_MSG_FLUSHPOLICY 0x1d + +XFRM_MSG_NEWAE 0x1e +XFRM_MSG_GETAE 0x1f + +XFRM_MSG_REPORT 0x20 + +XFRM_MSG_MIGRATE 0x21 + +XFRM_MSG_NEWSADINFO 0x22 +XFRM_MSG_GETSADINFO 0x23 + +XFRM_MSG_NEWSPDINFO 0x24 +XFRM_MSG_GETSPDINFO 0x25 + +XFRM_MSG_MAPPING 0x26 diff --git a/xlat/nlmsgerr_attrs.h b/xlat/nlmsgerr_attrs.h new file mode 100644 index 00000000..2d0f46f4 --- /dev/null +++ b/xlat/nlmsgerr_attrs.h @@ -0,0 +1,54 @@ +/* Generated by ./xlat/gen.sh from ./xlat/nlmsgerr_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NLMSGERR_ATTR_UNUSED) || (defined(HAVE_DECL_NLMSGERR_ATTR_UNUSED) && HAVE_DECL_NLMSGERR_ATTR_UNUSED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NLMSGERR_ATTR_UNUSED) == (0), "NLMSGERR_ATTR_UNUSED != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NLMSGERR_ATTR_UNUSED 0 +#endif +#if defined(NLMSGERR_ATTR_MSG) || (defined(HAVE_DECL_NLMSGERR_ATTR_MSG) && HAVE_DECL_NLMSGERR_ATTR_MSG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NLMSGERR_ATTR_MSG) == (1), "NLMSGERR_ATTR_MSG != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NLMSGERR_ATTR_MSG 1 +#endif +#if defined(NLMSGERR_ATTR_OFFS) || (defined(HAVE_DECL_NLMSGERR_ATTR_OFFS) && HAVE_DECL_NLMSGERR_ATTR_OFFS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NLMSGERR_ATTR_OFFS) == (2), "NLMSGERR_ATTR_OFFS != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NLMSGERR_ATTR_OFFS 2 +#endif +#if defined(NLMSGERR_ATTR_COOKIE) || (defined(HAVE_DECL_NLMSGERR_ATTR_COOKIE) && HAVE_DECL_NLMSGERR_ATTR_COOKIE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NLMSGERR_ATTR_COOKIE) == (3), "NLMSGERR_ATTR_COOKIE != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NLMSGERR_ATTR_COOKIE 3 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat nlmsgerr_attrs in mpers mode + +# else + +static +const struct xlat nlmsgerr_attrs[] = { + XLAT(NLMSGERR_ATTR_UNUSED), + XLAT(NLMSGERR_ATTR_MSG), + XLAT(NLMSGERR_ATTR_OFFS), + XLAT(NLMSGERR_ATTR_COOKIE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nlmsgerr_attrs.in b/xlat/nlmsgerr_attrs.in new file mode 100644 index 00000000..589bc557 --- /dev/null +++ b/xlat/nlmsgerr_attrs.in @@ -0,0 +1,4 @@ +NLMSGERR_ATTR_UNUSED 0 +NLMSGERR_ATTR_MSG 1 +NLMSGERR_ATTR_OFFS 2 +NLMSGERR_ATTR_COOKIE 3 diff --git a/xlat/notifyflags.h b/xlat/notifyflags.h index e496e8cd..cccc7d1f 100644 --- a/xlat/notifyflags.h +++ b/xlat/notifyflags.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/notifyflags.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat notifyflags in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat notifyflags in mpers mode + +# else static const struct xlat notifyflags[] = { @@ -32,4 +38,6 @@ const struct xlat notifyflags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nt_descriptor_types.h b/xlat/nt_descriptor_types.h index 715c2817..319dcdcc 100644 --- a/xlat/nt_descriptor_types.h +++ b/xlat/nt_descriptor_types.h @@ -1,83 +1,582 @@ /* Generated by ./xlat/gen.sh from ./xlat/nt_descriptor_types.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat nt_descriptor_types in mpers mode - -#else - -static -const struct xlat nt_descriptor_types[] = { #if defined(NT_PRSTATUS) || (defined(HAVE_DECL_NT_PRSTATUS) && HAVE_DECL_NT_PRSTATUS) - XLAT(NT_PRSTATUS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PRSTATUS) == (1), "NT_PRSTATUS != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PRSTATUS 1 #endif #if defined(NT_FPREGSET) || (defined(HAVE_DECL_NT_FPREGSET) && HAVE_DECL_NT_FPREGSET) - XLAT(NT_FPREGSET), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_FPREGSET) == (2), "NT_FPREGSET != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_FPREGSET 2 #endif #if defined(NT_PRPSINFO) || (defined(HAVE_DECL_NT_PRPSINFO) && HAVE_DECL_NT_PRPSINFO) - XLAT(NT_PRPSINFO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PRPSINFO) == (3), "NT_PRPSINFO != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PRPSINFO 3 #endif #if defined(NT_PRXREG) || (defined(HAVE_DECL_NT_PRXREG) && HAVE_DECL_NT_PRXREG) - XLAT(NT_PRXREG), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PRXREG) == (4), "NT_PRXREG != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PRXREG 4 #endif #if defined(NT_TASKSTRUCT) || (defined(HAVE_DECL_NT_TASKSTRUCT) && HAVE_DECL_NT_TASKSTRUCT) - XLAT(NT_TASKSTRUCT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_TASKSTRUCT) == (4), "NT_TASKSTRUCT != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_TASKSTRUCT 4 #endif #if defined(NT_PLATFORM) || (defined(HAVE_DECL_NT_PLATFORM) && HAVE_DECL_NT_PLATFORM) - XLAT(NT_PLATFORM), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PLATFORM) == (5), "NT_PLATFORM != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PLATFORM 5 #endif #if defined(NT_AUXV) || (defined(HAVE_DECL_NT_AUXV) && HAVE_DECL_NT_AUXV) - XLAT(NT_AUXV), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_AUXV) == (6), "NT_AUXV != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_AUXV 6 #endif #if defined(NT_GWINDOWS) || (defined(HAVE_DECL_NT_GWINDOWS) && HAVE_DECL_NT_GWINDOWS) - XLAT(NT_GWINDOWS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_GWINDOWS) == (7), "NT_GWINDOWS != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_GWINDOWS 7 #endif #if defined(NT_ASRS) || (defined(HAVE_DECL_NT_ASRS) && HAVE_DECL_NT_ASRS) - XLAT(NT_ASRS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_ASRS) == (8), "NT_ASRS != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_ASRS 8 #endif #if defined(NT_PSTATUS) || (defined(HAVE_DECL_NT_PSTATUS) && HAVE_DECL_NT_PSTATUS) - XLAT(NT_PSTATUS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PSTATUS) == (10), "NT_PSTATUS != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PSTATUS 10 #endif #if defined(NT_PSINFO) || (defined(HAVE_DECL_NT_PSINFO) && HAVE_DECL_NT_PSINFO) - XLAT(NT_PSINFO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PSINFO) == (13), "NT_PSINFO != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PSINFO 13 #endif #if defined(NT_PRCRED) || (defined(HAVE_DECL_NT_PRCRED) && HAVE_DECL_NT_PRCRED) - XLAT(NT_PRCRED), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PRCRED) == (14), "NT_PRCRED != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PRCRED 14 #endif #if defined(NT_UTSNAME) || (defined(HAVE_DECL_NT_UTSNAME) && HAVE_DECL_NT_UTSNAME) - XLAT(NT_UTSNAME), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_UTSNAME) == (15), "NT_UTSNAME != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_UTSNAME 15 #endif #if defined(NT_LWPSTATUS) || (defined(HAVE_DECL_NT_LWPSTATUS) && HAVE_DECL_NT_LWPSTATUS) - XLAT(NT_LWPSTATUS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_LWPSTATUS) == (16), "NT_LWPSTATUS != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_LWPSTATUS 16 #endif #if defined(NT_LWPSINFO) || (defined(HAVE_DECL_NT_LWPSINFO) && HAVE_DECL_NT_LWPSINFO) - XLAT(NT_LWPSINFO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_LWPSINFO) == (17), "NT_LWPSINFO != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_LWPSINFO 17 #endif #if defined(NT_PRFPXREG) || (defined(HAVE_DECL_NT_PRFPXREG) && HAVE_DECL_NT_PRFPXREG) - XLAT(NT_PRFPXREG), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PRFPXREG) == (20), "NT_PRFPXREG != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PRFPXREG 20 +#endif +#if defined(NT_SIGINFO) || (defined(HAVE_DECL_NT_SIGINFO) && HAVE_DECL_NT_SIGINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_SIGINFO) == (0x53494749), "NT_SIGINFO != 0x53494749"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_SIGINFO 0x53494749 +#endif +#if defined(NT_FILE) || (defined(HAVE_DECL_NT_FILE) && HAVE_DECL_NT_FILE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_FILE) == (0x46494c45), "NT_FILE != 0x46494c45"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_FILE 0x46494c45 #endif #if defined(NT_PRXFPREG) || (defined(HAVE_DECL_NT_PRXFPREG) && HAVE_DECL_NT_PRXFPREG) - XLAT(NT_PRXFPREG), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PRXFPREG) == (0x46e62b7f), "NT_PRXFPREG != 0x46e62b7f"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PRXFPREG 0x46e62b7f #endif #if defined(NT_PPC_VMX) || (defined(HAVE_DECL_NT_PPC_VMX) && HAVE_DECL_NT_PPC_VMX) - XLAT(NT_PPC_VMX), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PPC_VMX) == (0x100), "NT_PPC_VMX != 0x100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PPC_VMX 0x100 #endif #if defined(NT_PPC_SPE) || (defined(HAVE_DECL_NT_PPC_SPE) && HAVE_DECL_NT_PPC_SPE) - XLAT(NT_PPC_SPE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PPC_SPE) == (0x101), "NT_PPC_SPE != 0x101"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PPC_SPE 0x101 #endif #if defined(NT_PPC_VSX) || (defined(HAVE_DECL_NT_PPC_VSX) && HAVE_DECL_NT_PPC_VSX) - XLAT(NT_PPC_VSX), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PPC_VSX) == (0x102), "NT_PPC_VSX != 0x102"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PPC_VSX 0x102 +#endif +#if defined(NT_PPC_TAR) || (defined(HAVE_DECL_NT_PPC_TAR) && HAVE_DECL_NT_PPC_TAR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PPC_TAR) == (0x103), "NT_PPC_TAR != 0x103"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PPC_TAR 0x103 +#endif +#if defined(NT_PPC_PPR) || (defined(HAVE_DECL_NT_PPC_PPR) && HAVE_DECL_NT_PPC_PPR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PPC_PPR) == (0x104), "NT_PPC_PPR != 0x104"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PPC_PPR 0x104 +#endif +#if defined(NT_PPC_DSCR) || (defined(HAVE_DECL_NT_PPC_DSCR) && HAVE_DECL_NT_PPC_DSCR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PPC_DSCR) == (0x105), "NT_PPC_DSCR != 0x105"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PPC_DSCR 0x105 +#endif +#if defined(NT_PPC_EBB) || (defined(HAVE_DECL_NT_PPC_EBB) && HAVE_DECL_NT_PPC_EBB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PPC_EBB) == (0x106), "NT_PPC_EBB != 0x106"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PPC_EBB 0x106 +#endif +#if defined(NT_PPC_PMU) || (defined(HAVE_DECL_NT_PPC_PMU) && HAVE_DECL_NT_PPC_PMU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PPC_PMU) == (0x107), "NT_PPC_PMU != 0x107"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PPC_PMU 0x107 +#endif +#if defined(NT_PPC_TM_CGPR) || (defined(HAVE_DECL_NT_PPC_TM_CGPR) && HAVE_DECL_NT_PPC_TM_CGPR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PPC_TM_CGPR) == (0x108), "NT_PPC_TM_CGPR != 0x108"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PPC_TM_CGPR 0x108 +#endif +#if defined(NT_PPC_TM_CFPR) || (defined(HAVE_DECL_NT_PPC_TM_CFPR) && HAVE_DECL_NT_PPC_TM_CFPR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PPC_TM_CFPR) == (0x109), "NT_PPC_TM_CFPR != 0x109"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PPC_TM_CFPR 0x109 +#endif +#if defined(NT_PPC_TM_CVMX) || (defined(HAVE_DECL_NT_PPC_TM_CVMX) && HAVE_DECL_NT_PPC_TM_CVMX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PPC_TM_CVMX) == (0x10a), "NT_PPC_TM_CVMX != 0x10a"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PPC_TM_CVMX 0x10a +#endif +#if defined(NT_PPC_TM_CVSX) || (defined(HAVE_DECL_NT_PPC_TM_CVSX) && HAVE_DECL_NT_PPC_TM_CVSX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PPC_TM_CVSX) == (0x10b), "NT_PPC_TM_CVSX != 0x10b"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PPC_TM_CVSX 0x10b +#endif +#if defined(NT_PPC_TM_SPR) || (defined(HAVE_DECL_NT_PPC_TM_SPR) && HAVE_DECL_NT_PPC_TM_SPR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PPC_TM_SPR) == (0x10c), "NT_PPC_TM_SPR != 0x10c"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PPC_TM_SPR 0x10c +#endif +#if defined(NT_PPC_TM_CTAR) || (defined(HAVE_DECL_NT_PPC_TM_CTAR) && HAVE_DECL_NT_PPC_TM_CTAR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PPC_TM_CTAR) == (0x10d), "NT_PPC_TM_CTAR != 0x10d"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PPC_TM_CTAR 0x10d +#endif +#if defined(NT_PPC_TM_CPPR) || (defined(HAVE_DECL_NT_PPC_TM_CPPR) && HAVE_DECL_NT_PPC_TM_CPPR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PPC_TM_CPPR) == (0x10e), "NT_PPC_TM_CPPR != 0x10e"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PPC_TM_CPPR 0x10e +#endif +#if defined(NT_PPC_TM_CDSCR) || (defined(HAVE_DECL_NT_PPC_TM_CDSCR) && HAVE_DECL_NT_PPC_TM_CDSCR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PPC_TM_CDSCR) == (0x10f), "NT_PPC_TM_CDSCR != 0x10f"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PPC_TM_CDSCR 0x10f +#endif +#if defined(NT_PPC_PKEY) || (defined(HAVE_DECL_NT_PPC_PKEY) && HAVE_DECL_NT_PPC_PKEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_PPC_PKEY) == (0x110), "NT_PPC_PKEY != 0x110"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_PPC_PKEY 0x110 #endif #if defined(NT_386_TLS) || (defined(HAVE_DECL_NT_386_TLS) && HAVE_DECL_NT_386_TLS) - XLAT(NT_386_TLS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_386_TLS) == (0x200), "NT_386_TLS != 0x200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_386_TLS 0x200 #endif #if defined(NT_386_IOPERM) || (defined(HAVE_DECL_NT_386_IOPERM) && HAVE_DECL_NT_386_IOPERM) - XLAT(NT_386_IOPERM), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_386_IOPERM) == (0x201), "NT_386_IOPERM != 0x201"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_386_IOPERM 0x201 #endif #if defined(NT_X86_XSTATE) || (defined(HAVE_DECL_NT_X86_XSTATE) && HAVE_DECL_NT_X86_XSTATE) - XLAT(NT_X86_XSTATE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_X86_XSTATE) == (0x202), "NT_X86_XSTATE != 0x202"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_X86_XSTATE 0x202 +#endif +#if defined(NT_S390_HIGH_GPRS) || (defined(HAVE_DECL_NT_S390_HIGH_GPRS) && HAVE_DECL_NT_S390_HIGH_GPRS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_S390_HIGH_GPRS) == (0x300), "NT_S390_HIGH_GPRS != 0x300"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_S390_HIGH_GPRS 0x300 +#endif +#if defined(NT_S390_TIMER) || (defined(HAVE_DECL_NT_S390_TIMER) && HAVE_DECL_NT_S390_TIMER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_S390_TIMER) == (0x301), "NT_S390_TIMER != 0x301"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_S390_TIMER 0x301 +#endif +#if defined(NT_S390_TODCMP) || (defined(HAVE_DECL_NT_S390_TODCMP) && HAVE_DECL_NT_S390_TODCMP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_S390_TODCMP) == (0x302), "NT_S390_TODCMP != 0x302"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_S390_TODCMP 0x302 +#endif +#if defined(NT_S390_TODPREG) || (defined(HAVE_DECL_NT_S390_TODPREG) && HAVE_DECL_NT_S390_TODPREG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_S390_TODPREG) == (0x303), "NT_S390_TODPREG != 0x303"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_S390_TODPREG 0x303 +#endif +#if defined(NT_S390_CTRS) || (defined(HAVE_DECL_NT_S390_CTRS) && HAVE_DECL_NT_S390_CTRS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_S390_CTRS) == (0x304), "NT_S390_CTRS != 0x304"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_S390_CTRS 0x304 +#endif +#if defined(NT_S390_PREFIX) || (defined(HAVE_DECL_NT_S390_PREFIX) && HAVE_DECL_NT_S390_PREFIX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_S390_PREFIX) == (0x305), "NT_S390_PREFIX != 0x305"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_S390_PREFIX 0x305 +#endif +#if defined(NT_S390_LAST_BREAK) || (defined(HAVE_DECL_NT_S390_LAST_BREAK) && HAVE_DECL_NT_S390_LAST_BREAK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_S390_LAST_BREAK) == (0x306), "NT_S390_LAST_BREAK != 0x306"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_S390_LAST_BREAK 0x306 +#endif +#if defined(NT_S390_SYSTEM_CALL) || (defined(HAVE_DECL_NT_S390_SYSTEM_CALL) && HAVE_DECL_NT_S390_SYSTEM_CALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_S390_SYSTEM_CALL) == (0x307), "NT_S390_SYSTEM_CALL != 0x307"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_S390_SYSTEM_CALL 0x307 +#endif +#if defined(NT_S390_TDB) || (defined(HAVE_DECL_NT_S390_TDB) && HAVE_DECL_NT_S390_TDB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_S390_TDB) == (0x308), "NT_S390_TDB != 0x308"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_S390_TDB 0x308 +#endif +#if defined(NT_S390_VXRS_LOW) || (defined(HAVE_DECL_NT_S390_VXRS_LOW) && HAVE_DECL_NT_S390_VXRS_LOW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_S390_VXRS_LOW) == (0x309), "NT_S390_VXRS_LOW != 0x309"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_S390_VXRS_LOW 0x309 +#endif +#if defined(NT_S390_VXRS_HIGH) || (defined(HAVE_DECL_NT_S390_VXRS_HIGH) && HAVE_DECL_NT_S390_VXRS_HIGH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_S390_VXRS_HIGH) == (0x30a), "NT_S390_VXRS_HIGH != 0x30a"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_S390_VXRS_HIGH 0x30a +#endif +#if defined(NT_S390_GS_CB) || (defined(HAVE_DECL_NT_S390_GS_CB) && HAVE_DECL_NT_S390_GS_CB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_S390_GS_CB) == (0x30b), "NT_S390_GS_CB != 0x30b"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_S390_GS_CB 0x30b +#endif +#if defined(NT_S390_GS_BC) || (defined(HAVE_DECL_NT_S390_GS_BC) && HAVE_DECL_NT_S390_GS_BC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_S390_GS_BC) == (0x30c), "NT_S390_GS_BC != 0x30c"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_S390_GS_BC 0x30c +#endif +#if defined(NT_S390_RI_CB) || (defined(HAVE_DECL_NT_S390_RI_CB) && HAVE_DECL_NT_S390_RI_CB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_S390_RI_CB) == (0x30d), "NT_S390_RI_CB != 0x30d"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_S390_RI_CB 0x30d +#endif +#if defined(NT_ARM_VFP) || (defined(HAVE_DECL_NT_ARM_VFP) && HAVE_DECL_NT_ARM_VFP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_ARM_VFP) == (0x400), "NT_ARM_VFP != 0x400"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_ARM_VFP 0x400 +#endif +#if defined(NT_ARM_TLS) || (defined(HAVE_DECL_NT_ARM_TLS) && HAVE_DECL_NT_ARM_TLS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_ARM_TLS) == (0x401), "NT_ARM_TLS != 0x401"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_ARM_TLS 0x401 +#endif +#if defined(NT_ARM_HW_BREAK) || (defined(HAVE_DECL_NT_ARM_HW_BREAK) && HAVE_DECL_NT_ARM_HW_BREAK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_ARM_HW_BREAK) == (0x402), "NT_ARM_HW_BREAK != 0x402"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_ARM_HW_BREAK 0x402 +#endif +#if defined(NT_ARM_HW_WATCH) || (defined(HAVE_DECL_NT_ARM_HW_WATCH) && HAVE_DECL_NT_ARM_HW_WATCH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_ARM_HW_WATCH) == (0x403), "NT_ARM_HW_WATCH != 0x403"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_ARM_HW_WATCH 0x403 +#endif +#if defined(NT_ARM_SYSTEM_CALL) || (defined(HAVE_DECL_NT_ARM_SYSTEM_CALL) && HAVE_DECL_NT_ARM_SYSTEM_CALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_ARM_SYSTEM_CALL) == (0x404), "NT_ARM_SYSTEM_CALL != 0x404"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_ARM_SYSTEM_CALL 0x404 #endif +#if defined(NT_ARM_SVE) || (defined(HAVE_DECL_NT_ARM_SVE) && HAVE_DECL_NT_ARM_SVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_ARM_SVE) == (0x405), "NT_ARM_SVE != 0x405"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_ARM_SVE 0x405 +#endif +#if defined(NT_ARM_PAC_MASK) || (defined(HAVE_DECL_NT_ARM_PAC_MASK) && HAVE_DECL_NT_ARM_PAC_MASK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_ARM_PAC_MASK) == (0x406), "NT_ARM_PAC_MASK != 0x406"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_ARM_PAC_MASK 0x406 +#endif +#if defined(NT_ARM_PACA_KEYS) || (defined(HAVE_DECL_NT_ARM_PACA_KEYS) && HAVE_DECL_NT_ARM_PACA_KEYS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_ARM_PACA_KEYS) == (0x407), "NT_ARM_PACA_KEYS != 0x407"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_ARM_PACA_KEYS 0x407 +#endif +#if defined(NT_ARM_PACG_KEYS) || (defined(HAVE_DECL_NT_ARM_PACG_KEYS) && HAVE_DECL_NT_ARM_PACG_KEYS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_ARM_PACG_KEYS) == (0x408), "NT_ARM_PACG_KEYS != 0x408"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_ARM_PACG_KEYS 0x408 +#endif +#if defined(NT_METAG_CBUF) || (defined(HAVE_DECL_NT_METAG_CBUF) && HAVE_DECL_NT_METAG_CBUF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_METAG_CBUF) == (0x500), "NT_METAG_CBUF != 0x500"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_METAG_CBUF 0x500 +#endif +#if defined(NT_METAG_RPIPE) || (defined(HAVE_DECL_NT_METAG_RPIPE) && HAVE_DECL_NT_METAG_RPIPE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_METAG_RPIPE) == (0x501), "NT_METAG_RPIPE != 0x501"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_METAG_RPIPE 0x501 +#endif +#if defined(NT_METAG_TLS) || (defined(HAVE_DECL_NT_METAG_TLS) && HAVE_DECL_NT_METAG_TLS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_METAG_TLS) == (0x502), "NT_METAG_TLS != 0x502"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_METAG_TLS 0x502 +#endif +#if defined(NT_ARC_V2) || (defined(HAVE_DECL_NT_ARC_V2) && HAVE_DECL_NT_ARC_V2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_ARC_V2) == (0x600), "NT_ARC_V2 != 0x600"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_ARC_V2 0x600 +#endif +#if defined(NT_VMCOREDD) || (defined(HAVE_DECL_NT_VMCOREDD) && HAVE_DECL_NT_VMCOREDD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_VMCOREDD) == (0x700), "NT_VMCOREDD != 0x700"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_VMCOREDD 0x700 +#endif +#if defined(NT_MIPS_DSP) || (defined(HAVE_DECL_NT_MIPS_DSP) && HAVE_DECL_NT_MIPS_DSP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_MIPS_DSP) == (0x800), "NT_MIPS_DSP != 0x800"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_MIPS_DSP 0x800 +#endif +#if defined(NT_MIPS_FP_MODE) || (defined(HAVE_DECL_NT_MIPS_FP_MODE) && HAVE_DECL_NT_MIPS_FP_MODE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_MIPS_FP_MODE) == (0x801), "NT_MIPS_FP_MODE != 0x801"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_MIPS_FP_MODE 0x801 +#endif +#if defined(NT_MIPS_MSA) || (defined(HAVE_DECL_NT_MIPS_MSA) && HAVE_DECL_NT_MIPS_MSA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NT_MIPS_MSA) == (0x802), "NT_MIPS_MSA != 0x802"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NT_MIPS_MSA 0x802 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat nt_descriptor_types in mpers mode + +# else + +static +const struct xlat nt_descriptor_types[] = { + XLAT(NT_PRSTATUS), + XLAT(NT_FPREGSET), + XLAT(NT_PRPSINFO), + XLAT(NT_PRXREG), + XLAT(NT_TASKSTRUCT), + XLAT(NT_PLATFORM), + XLAT(NT_AUXV), + XLAT(NT_GWINDOWS), + XLAT(NT_ASRS), + XLAT(NT_PSTATUS), + XLAT(NT_PSINFO), + XLAT(NT_PRCRED), + XLAT(NT_UTSNAME), + XLAT(NT_LWPSTATUS), + XLAT(NT_LWPSINFO), + XLAT(NT_PRFPXREG), + XLAT(NT_SIGINFO), + XLAT(NT_FILE), + XLAT(NT_PRXFPREG), + XLAT(NT_PPC_VMX), + XLAT(NT_PPC_SPE), + XLAT(NT_PPC_VSX), + XLAT(NT_PPC_TAR), + XLAT(NT_PPC_PPR), + XLAT(NT_PPC_DSCR), + XLAT(NT_PPC_EBB), + XLAT(NT_PPC_PMU), + XLAT(NT_PPC_TM_CGPR), + XLAT(NT_PPC_TM_CFPR), + XLAT(NT_PPC_TM_CVMX), + XLAT(NT_PPC_TM_CVSX), + XLAT(NT_PPC_TM_SPR), + XLAT(NT_PPC_TM_CTAR), + XLAT(NT_PPC_TM_CPPR), + XLAT(NT_PPC_TM_CDSCR), + XLAT(NT_PPC_PKEY), + XLAT(NT_386_TLS), + XLAT(NT_386_IOPERM), + XLAT(NT_X86_XSTATE), + XLAT(NT_S390_HIGH_GPRS), + XLAT(NT_S390_TIMER), + XLAT(NT_S390_TODCMP), + XLAT(NT_S390_TODPREG), + XLAT(NT_S390_CTRS), + XLAT(NT_S390_PREFIX), + XLAT(NT_S390_LAST_BREAK), + XLAT(NT_S390_SYSTEM_CALL), + XLAT(NT_S390_TDB), + XLAT(NT_S390_VXRS_LOW), + XLAT(NT_S390_VXRS_HIGH), + XLAT(NT_S390_GS_CB), + XLAT(NT_S390_GS_BC), + XLAT(NT_S390_RI_CB), + XLAT(NT_ARM_VFP), + XLAT(NT_ARM_TLS), + XLAT(NT_ARM_HW_BREAK), + XLAT(NT_ARM_HW_WATCH), + XLAT(NT_ARM_SYSTEM_CALL), + XLAT(NT_ARM_SVE), + XLAT(NT_ARM_PAC_MASK), + XLAT(NT_ARM_PACA_KEYS), + XLAT(NT_ARM_PACG_KEYS), + XLAT(NT_METAG_CBUF), + XLAT(NT_METAG_RPIPE), + XLAT(NT_METAG_TLS), + XLAT(NT_ARC_V2), + XLAT(NT_VMCOREDD), + XLAT(NT_MIPS_DSP), + XLAT(NT_MIPS_FP_MODE), + XLAT(NT_MIPS_MSA), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/nt_descriptor_types.in b/xlat/nt_descriptor_types.in index 5e47d661..f298ca95 100644 --- a/xlat/nt_descriptor_types.in +++ b/xlat/nt_descriptor_types.in @@ -1,23 +1,70 @@ -NT_PRSTATUS -NT_FPREGSET -NT_PRPSINFO -NT_PRXREG -NT_TASKSTRUCT -NT_PLATFORM -NT_AUXV -NT_GWINDOWS -NT_ASRS -NT_PSTATUS -NT_PSINFO -NT_PRCRED -NT_UTSNAME -NT_LWPSTATUS -NT_LWPSINFO -NT_PRFPXREG -NT_PRXFPREG -NT_PPC_VMX -NT_PPC_SPE -NT_PPC_VSX -NT_386_TLS -NT_386_IOPERM -NT_X86_XSTATE +NT_PRSTATUS 1 +NT_FPREGSET 2 +NT_PRPSINFO 3 +NT_PRXREG 4 +NT_TASKSTRUCT 4 +NT_PLATFORM 5 +NT_AUXV 6 +NT_GWINDOWS 7 +NT_ASRS 8 +NT_PSTATUS 10 +NT_PSINFO 13 +NT_PRCRED 14 +NT_UTSNAME 15 +NT_LWPSTATUS 16 +NT_LWPSINFO 17 +NT_PRFPXREG 20 +NT_SIGINFO 0x53494749 +NT_FILE 0x46494c45 +NT_PRXFPREG 0x46e62b7f +NT_PPC_VMX 0x100 +NT_PPC_SPE 0x101 +NT_PPC_VSX 0x102 +NT_PPC_TAR 0x103 +NT_PPC_PPR 0x104 +NT_PPC_DSCR 0x105 +NT_PPC_EBB 0x106 +NT_PPC_PMU 0x107 +NT_PPC_TM_CGPR 0x108 +NT_PPC_TM_CFPR 0x109 +NT_PPC_TM_CVMX 0x10a +NT_PPC_TM_CVSX 0x10b +NT_PPC_TM_SPR 0x10c +NT_PPC_TM_CTAR 0x10d +NT_PPC_TM_CPPR 0x10e +NT_PPC_TM_CDSCR 0x10f +NT_PPC_PKEY 0x110 +NT_386_TLS 0x200 +NT_386_IOPERM 0x201 +NT_X86_XSTATE 0x202 +NT_S390_HIGH_GPRS 0x300 +NT_S390_TIMER 0x301 +NT_S390_TODCMP 0x302 +NT_S390_TODPREG 0x303 +NT_S390_CTRS 0x304 +NT_S390_PREFIX 0x305 +NT_S390_LAST_BREAK 0x306 +NT_S390_SYSTEM_CALL 0x307 +NT_S390_TDB 0x308 +NT_S390_VXRS_LOW 0x309 +NT_S390_VXRS_HIGH 0x30a +NT_S390_GS_CB 0x30b +NT_S390_GS_BC 0x30c +NT_S390_RI_CB 0x30d +NT_ARM_VFP 0x400 +NT_ARM_TLS 0x401 +NT_ARM_HW_BREAK 0x402 +NT_ARM_HW_WATCH 0x403 +NT_ARM_SYSTEM_CALL 0x404 +NT_ARM_SVE 0x405 +NT_ARM_PAC_MASK 0x406 +NT_ARM_PACA_KEYS 0x407 +NT_ARM_PACG_KEYS 0x408 +NT_METAG_CBUF 0x500 +NT_METAG_RPIPE 0x501 +NT_METAG_TLS 0x502 +NT_ARC_V2 0x600 +NT_VMCOREDD 0x700 +NT_MIPS_DSP 0x800 +NT_MIPS_FP_MODE 0x801 +NT_MIPS_MSA 0x802 diff --git a/xlat/numa_node.h b/xlat/numa_node.h new file mode 100644 index 00000000..0d167456 --- /dev/null +++ b/xlat/numa_node.h @@ -0,0 +1,30 @@ +/* Generated by ./xlat/gen.sh from ./xlat/numa_node.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NUMA_NO_NODE) || (defined(HAVE_DECL_NUMA_NO_NODE) && HAVE_DECL_NUMA_NO_NODE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NUMA_NO_NODE) == (-1U), "NUMA_NO_NODE != -1U"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NUMA_NO_NODE -1U +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat numa_node in mpers mode + +# else + +static +const struct xlat numa_node[] = { + XLAT(NUMA_NO_NODE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/numa_node.in b/xlat/numa_node.in new file mode 100644 index 00000000..414b35a9 --- /dev/null +++ b/xlat/numa_node.in @@ -0,0 +1 @@ +NUMA_NO_NODE -1U diff --git a/xlat/open_access_modes.h b/xlat/open_access_modes.h index 8b11517c..bf96a8ff 100644 --- a/xlat/open_access_modes.h +++ b/xlat/open_access_modes.h @@ -1,21 +1,49 @@ /* Generated by ./xlat/gen.sh from ./xlat/open_access_modes.in; do not edit. */ -#ifndef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -const struct xlat open_access_modes[] = { #if defined(O_RDONLY) || (defined(HAVE_DECL_O_RDONLY) && HAVE_DECL_O_RDONLY) - XLAT(O_RDONLY), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_RDONLY) == (0), "O_RDONLY != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_RDONLY 0 #endif #if defined(O_WRONLY) || (defined(HAVE_DECL_O_WRONLY) && HAVE_DECL_O_WRONLY) - XLAT(O_WRONLY), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_WRONLY) == (1), "O_WRONLY != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_WRONLY 1 #endif #if defined(O_RDWR) || (defined(HAVE_DECL_O_RDWR) && HAVE_DECL_O_RDWR) - XLAT(O_RDWR), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_RDWR) == (2), "O_RDWR != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_RDWR 2 #endif #if defined(O_ACCMODE) || (defined(HAVE_DECL_O_ACCMODE) && HAVE_DECL_O_ACCMODE) - XLAT(O_ACCMODE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_ACCMODE) == (3), "O_ACCMODE != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_ACCMODE 3 #endif + +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS + +const struct xlat open_access_modes[] = { + [O_RDONLY] = XLAT(O_RDONLY), + [O_WRONLY] = XLAT(O_WRONLY), + [O_RDWR] = XLAT(O_RDWR), + [O_ACCMODE] = XLAT(O_ACCMODE), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/open_access_modes.in b/xlat/open_access_modes.in index 423a29b5..45dcd737 100644 --- a/xlat/open_access_modes.in +++ b/xlat/open_access_modes.in @@ -1,4 +1,5 @@ -O_RDONLY -O_WRONLY -O_RDWR -O_ACCMODE +#value_indexed +O_RDONLY 0 +O_WRONLY 1 +O_RDWR 2 +O_ACCMODE 3 diff --git a/xlat/open_mode_flags.h b/xlat/open_mode_flags.h index f81f16bb..5c317e21 100644 --- a/xlat/open_mode_flags.h +++ b/xlat/open_mode_flags.h @@ -1,121 +1,805 @@ /* Generated by ./xlat/gen.sh from ./xlat/open_mode_flags.in; do not edit. */ -#if defined(O_NDELAY) && (O_NDELAY != O_NONBLOCK) -#endif -#if defined(O_TMPFILE) && defined(O_DIRECTORY) -#endif -#ifndef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -const struct xlat open_mode_flags[] = { +#if defined __hppa__ || defined __mips__ +#if defined(O_CREAT) || (defined(HAVE_DECL_O_CREAT) && HAVE_DECL_O_CREAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_CREAT) == (0400), "O_CREAT != 0400"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_CREAT 0400 +#endif +#elif defined __alpha__ || defined __sparc__ #if defined(O_CREAT) || (defined(HAVE_DECL_O_CREAT) && HAVE_DECL_O_CREAT) - XLAT(O_CREAT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_CREAT) == (01000), "O_CREAT != 01000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_CREAT 01000 +#endif +#else +#if defined(O_CREAT) || (defined(HAVE_DECL_O_CREAT) && HAVE_DECL_O_CREAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_CREAT) == (0100), "O_CREAT != 0100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_CREAT 0100 +#endif +#endif +#if defined __hppa__ || defined __mips__ +#if defined(O_EXCL) || (defined(HAVE_DECL_O_EXCL) && HAVE_DECL_O_EXCL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_EXCL) == (02000), "O_EXCL != 02000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_EXCL 02000 #endif +#elif defined __alpha__ || defined __sparc__ #if defined(O_EXCL) || (defined(HAVE_DECL_O_EXCL) && HAVE_DECL_O_EXCL) - XLAT(O_EXCL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_EXCL) == (04000), "O_EXCL != 04000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_EXCL 04000 +#endif +#else +#if defined(O_EXCL) || (defined(HAVE_DECL_O_EXCL) && HAVE_DECL_O_EXCL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_EXCL) == (0200), "O_EXCL != 0200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_EXCL 0200 +#endif +#endif +#if defined __mips__ +#if defined(O_NOCTTY) || (defined(HAVE_DECL_O_NOCTTY) && HAVE_DECL_O_NOCTTY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_NOCTTY) == (04000), "O_NOCTTY != 04000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_NOCTTY 04000 +#endif +#elif defined __alpha__ +#if defined(O_NOCTTY) || (defined(HAVE_DECL_O_NOCTTY) && HAVE_DECL_O_NOCTTY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_NOCTTY) == (010000), "O_NOCTTY != 010000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_NOCTTY 010000 +#endif +#elif defined __sparc__ +#if defined(O_NOCTTY) || (defined(HAVE_DECL_O_NOCTTY) && HAVE_DECL_O_NOCTTY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_NOCTTY) == (0100000), "O_NOCTTY != 0100000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_NOCTTY 0100000 +#endif +#elif defined __hppa__ +#if defined(O_NOCTTY) || (defined(HAVE_DECL_O_NOCTTY) && HAVE_DECL_O_NOCTTY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_NOCTTY) == (0400000), "O_NOCTTY != 0400000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_NOCTTY 0400000 #endif +#else #if defined(O_NOCTTY) || (defined(HAVE_DECL_O_NOCTTY) && HAVE_DECL_O_NOCTTY) - XLAT(O_NOCTTY), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_NOCTTY) == (0400), "O_NOCTTY != 0400"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_NOCTTY 0400 +#endif #endif +#if defined __alpha__ || defined __sparc__ #if defined(O_TRUNC) || (defined(HAVE_DECL_O_TRUNC) && HAVE_DECL_O_TRUNC) - XLAT(O_TRUNC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_TRUNC) == (02000), "O_TRUNC != 02000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_TRUNC 02000 +#endif +#else +#if defined(O_TRUNC) || (defined(HAVE_DECL_O_TRUNC) && HAVE_DECL_O_TRUNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_TRUNC) == (01000), "O_TRUNC != 01000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_TRUNC 01000 +#endif #endif +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ #if defined(O_APPEND) || (defined(HAVE_DECL_O_APPEND) && HAVE_DECL_O_APPEND) - XLAT(O_APPEND), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_APPEND) == (010), "O_APPEND != 010"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_APPEND 010 #endif +#else +#if defined(O_APPEND) || (defined(HAVE_DECL_O_APPEND) && HAVE_DECL_O_APPEND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_APPEND) == (02000), "O_APPEND != 02000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_APPEND 02000 +#endif +#endif +#if defined __alpha__ #if defined(O_NONBLOCK) || (defined(HAVE_DECL_O_NONBLOCK) && HAVE_DECL_O_NONBLOCK) - XLAT(O_NONBLOCK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_NONBLOCK) == (04), "O_NONBLOCK != 04"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_NONBLOCK 04 #endif -#if defined(O_SYNC) || (defined(HAVE_DECL_O_SYNC) && HAVE_DECL_O_SYNC) - XLAT(O_SYNC), +#elif defined __mips__ +#if defined(O_NONBLOCK) || (defined(HAVE_DECL_O_NONBLOCK) && HAVE_DECL_O_NONBLOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_NONBLOCK) == (0200), "O_NONBLOCK != 0200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_NONBLOCK 0200 #endif -#if defined(O_ASYNC) || (defined(HAVE_DECL_O_ASYNC) && HAVE_DECL_O_ASYNC) - XLAT(O_ASYNC), +#elif defined __sparc__ +#if defined(O_NONBLOCK) || (defined(HAVE_DECL_O_NONBLOCK) && HAVE_DECL_O_NONBLOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_NONBLOCK) == (040000), "O_NONBLOCK != 040000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_NONBLOCK 040000 +#endif +#elif defined __hppa__ +#if defined(O_NONBLOCK) || (defined(HAVE_DECL_O_NONBLOCK) && HAVE_DECL_O_NONBLOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_NONBLOCK) == (0200004), "O_NONBLOCK != 0200004"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_NONBLOCK 0200004 +#endif +#else +#if defined(O_NONBLOCK) || (defined(HAVE_DECL_O_NONBLOCK) && HAVE_DECL_O_NONBLOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_NONBLOCK) == (04000), "O_NONBLOCK != 04000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_NONBLOCK 04000 +#endif +#endif +#if defined __mips__ +#if defined(__O_SYNC) || (defined(HAVE_DECL___O_SYNC) && HAVE_DECL___O_SYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((__O_SYNC) == (040000), "__O_SYNC != 040000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define __O_SYNC 040000 +#endif +#elif defined __hppa__ +#if defined(__O_SYNC) || (defined(HAVE_DECL___O_SYNC) && HAVE_DECL___O_SYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((__O_SYNC) == (0100000), "__O_SYNC != 0100000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define __O_SYNC 0100000 +#endif +#elif defined __alpha__ +#if defined(__O_SYNC) || (defined(HAVE_DECL___O_SYNC) && HAVE_DECL___O_SYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((__O_SYNC) == (020000000), "__O_SYNC != 020000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define __O_SYNC 020000000 +#endif +#elif defined __sparc__ +#if defined(__O_SYNC) || (defined(HAVE_DECL___O_SYNC) && HAVE_DECL___O_SYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((__O_SYNC) == (040000000), "__O_SYNC != 040000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define __O_SYNC 040000000 +#endif +#else +#if defined(__O_SYNC) || (defined(HAVE_DECL___O_SYNC) && HAVE_DECL___O_SYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((__O_SYNC) == (04000000), "__O_SYNC != 04000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define __O_SYNC 04000000 +#endif +#endif +#if defined __mips__ +#if defined(O_DSYNC) || (defined(HAVE_DECL_O_DSYNC) && HAVE_DECL_O_DSYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_DSYNC) == (020), "O_DSYNC != 020"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_DSYNC 020 +#endif +#elif defined __sparc__ +#if defined(O_DSYNC) || (defined(HAVE_DECL_O_DSYNC) && HAVE_DECL_O_DSYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_DSYNC) == (020000), "O_DSYNC != 020000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_DSYNC 020000 +#endif +#elif defined __alpha__ +#if defined(O_DSYNC) || (defined(HAVE_DECL_O_DSYNC) && HAVE_DECL_O_DSYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_DSYNC) == (040000), "O_DSYNC != 040000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_DSYNC 040000 +#endif +#elif defined __hppa__ +#if defined(O_DSYNC) || (defined(HAVE_DECL_O_DSYNC) && HAVE_DECL_O_DSYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_DSYNC) == (01000000), "O_DSYNC != 01000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_DSYNC 01000000 #endif +#else #if defined(O_DSYNC) || (defined(HAVE_DECL_O_DSYNC) && HAVE_DECL_O_DSYNC) - XLAT(O_DSYNC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_DSYNC) == (010000), "O_DSYNC != 010000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_DSYNC 010000 #endif +#endif +#if defined __hppa__ #if defined(O_RSYNC) || (defined(HAVE_DECL_O_RSYNC) && HAVE_DECL_O_RSYNC) - XLAT(O_RSYNC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_RSYNC) == (02000000), "O_RSYNC != 02000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_RSYNC 02000000 +#endif +#else #endif -#if defined(O_NDELAY) && (O_NDELAY != O_NONBLOCK) +#if defined O_NDELAY && O_NDELAY & O_NONBLOCK +# ifndef STRACE_WORKAROUND_FOR_O_NDELAY +# define STRACE_WORKAROUND_FOR_O_NDELAY +# undef O_NDELAY +# endif +#endif +#if defined __sparc__ #if defined(O_NDELAY) || (defined(HAVE_DECL_O_NDELAY) && HAVE_DECL_O_NDELAY) - XLAT(O_NDELAY), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_NDELAY) == (04), "O_NDELAY != 04"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_NDELAY 04 #endif +#else #endif -#if defined(O_PRIV) || (defined(HAVE_DECL_O_PRIV) && HAVE_DECL_O_PRIV) - XLAT(O_PRIV), +#if defined __sparc__ +#if defined(O_DIRECT) || (defined(HAVE_DECL_O_DIRECT) && HAVE_DECL_O_DIRECT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_DIRECT) == (04000000), "O_DIRECT != 04000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_DIRECT 04000000 +#endif +#elif defined __mips__ +#if defined(O_DIRECT) || (defined(HAVE_DECL_O_DIRECT) && HAVE_DECL_O_DIRECT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_DIRECT) == (0100000), "O_DIRECT != 0100000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_DIRECT 0100000 +#endif +#elif defined __arm__ || defined __arm64__ || defined __aarch64__ || defined __m68k__ +#if defined(O_DIRECT) || (defined(HAVE_DECL_O_DIRECT) && HAVE_DECL_O_DIRECT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_DIRECT) == (0200000), "O_DIRECT != 0200000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_DIRECT 0200000 #endif +#elif defined __powerpc__ #if defined(O_DIRECT) || (defined(HAVE_DECL_O_DIRECT) && HAVE_DECL_O_DIRECT) - XLAT(O_DIRECT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_DIRECT) == (0400000), "O_DIRECT != 0400000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_DIRECT 0400000 +#endif +#elif defined __alpha__ +#if defined(O_DIRECT) || (defined(HAVE_DECL_O_DIRECT) && HAVE_DECL_O_DIRECT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_DIRECT) == (02000000), "O_DIRECT != 02000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_DIRECT 02000000 +#endif +#else +#if defined(O_DIRECT) || (defined(HAVE_DECL_O_DIRECT) && HAVE_DECL_O_DIRECT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_DIRECT) == (040000), "O_DIRECT != 040000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_DIRECT 040000 +#endif #endif +#if defined __hppa__ #if defined(O_LARGEFILE) || (defined(HAVE_DECL_O_LARGEFILE) && HAVE_DECL_O_LARGEFILE) - XLAT(O_LARGEFILE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_LARGEFILE) == (04000), "O_LARGEFILE != 04000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_LARGEFILE 04000 #endif -#if defined(O_DIRECTORY) || (defined(HAVE_DECL_O_DIRECTORY) && HAVE_DECL_O_DIRECTORY) - XLAT(O_DIRECTORY), +#elif defined __mips__ +#if defined(O_LARGEFILE) || (defined(HAVE_DECL_O_LARGEFILE) && HAVE_DECL_O_LARGEFILE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_LARGEFILE) == (020000), "O_LARGEFILE != 020000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_LARGEFILE 020000 +#endif +#elif defined __powerpc__ +#if defined(O_LARGEFILE) || (defined(HAVE_DECL_O_LARGEFILE) && HAVE_DECL_O_LARGEFILE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_LARGEFILE) == (0200000), "O_LARGEFILE != 0200000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_LARGEFILE 0200000 +#endif +#elif defined __alpha__ || defined __arm__ || defined __arm64__ || defined __aarch64__ || defined __m68k__ +#if defined(O_LARGEFILE) || (defined(HAVE_DECL_O_LARGEFILE) && HAVE_DECL_O_LARGEFILE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_LARGEFILE) == (0400000), "O_LARGEFILE != 0400000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_LARGEFILE 0400000 +#endif +#elif defined __sparc__ +#if defined(O_LARGEFILE) || (defined(HAVE_DECL_O_LARGEFILE) && HAVE_DECL_O_LARGEFILE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_LARGEFILE) == (01000000), "O_LARGEFILE != 01000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_LARGEFILE 01000000 +#endif +#else +#if defined(O_LARGEFILE) || (defined(HAVE_DECL_O_LARGEFILE) && HAVE_DECL_O_LARGEFILE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_LARGEFILE) == (0100000), "O_LARGEFILE != 0100000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_LARGEFILE 0100000 #endif +#endif +#if defined __hppa__ +#if defined(O_NOFOLLOW) || (defined(HAVE_DECL_O_NOFOLLOW) && HAVE_DECL_O_NOFOLLOW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_NOFOLLOW) == (0200), "O_NOFOLLOW != 0200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_NOFOLLOW 0200 +#endif +#elif defined __arm__ || defined __arm64__ || defined __aarch64__ || defined __m68k__ || defined __powerpc__ +#if defined(O_NOFOLLOW) || (defined(HAVE_DECL_O_NOFOLLOW) && HAVE_DECL_O_NOFOLLOW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_NOFOLLOW) == (0100000), "O_NOFOLLOW != 0100000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_NOFOLLOW 0100000 +#endif +#elif defined __alpha__ #if defined(O_NOFOLLOW) || (defined(HAVE_DECL_O_NOFOLLOW) && HAVE_DECL_O_NOFOLLOW) - XLAT(O_NOFOLLOW), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_NOFOLLOW) == (0200000), "O_NOFOLLOW != 0200000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_NOFOLLOW 0200000 +#endif +#else +#if defined(O_NOFOLLOW) || (defined(HAVE_DECL_O_NOFOLLOW) && HAVE_DECL_O_NOFOLLOW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_NOFOLLOW) == (0400000), "O_NOFOLLOW != 0400000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_NOFOLLOW 0400000 +#endif +#endif +#if defined __alpha__ || defined __hppa__ +#if defined(O_NOATIME) || (defined(HAVE_DECL_O_NOATIME) && HAVE_DECL_O_NOATIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_NOATIME) == (04000000), "O_NOATIME != 04000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_NOATIME 04000000 #endif +#elif defined __sparc__ #if defined(O_NOATIME) || (defined(HAVE_DECL_O_NOATIME) && HAVE_DECL_O_NOATIME) - XLAT(O_NOATIME), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_NOATIME) == (010000000), "O_NOATIME != 010000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_NOATIME 010000000 #endif +#else +#if defined(O_NOATIME) || (defined(HAVE_DECL_O_NOATIME) && HAVE_DECL_O_NOATIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_NOATIME) == (01000000), "O_NOATIME != 01000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_NOATIME 01000000 +#endif +#endif +#if defined __alpha__ || defined __hppa__ +#if defined(O_CLOEXEC) || (defined(HAVE_DECL_O_CLOEXEC) && HAVE_DECL_O_CLOEXEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_CLOEXEC) == (010000000), "O_CLOEXEC != 010000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_CLOEXEC 010000000 +#endif +#elif defined __sparc__ #if defined(O_CLOEXEC) || (defined(HAVE_DECL_O_CLOEXEC) && HAVE_DECL_O_CLOEXEC) - XLAT(O_CLOEXEC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_CLOEXEC) == (020000000), "O_CLOEXEC != 020000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_CLOEXEC 020000000 +#endif +#else +#if defined(O_CLOEXEC) || (defined(HAVE_DECL_O_CLOEXEC) && HAVE_DECL_O_CLOEXEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_CLOEXEC) == (02000000), "O_CLOEXEC != 02000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_CLOEXEC 02000000 +#endif +#endif +#if defined __hppa__ +#if defined(O_PATH) || (defined(HAVE_DECL_O_PATH) && HAVE_DECL_O_PATH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_PATH) == (020000000), "O_PATH != 020000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_PATH 020000000 #endif +#elif defined __alpha__ #if defined(O_PATH) || (defined(HAVE_DECL_O_PATH) && HAVE_DECL_O_PATH) - XLAT(O_PATH), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_PATH) == (040000000), "O_PATH != 040000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_PATH 040000000 #endif -#if defined(O_TMPFILE) && defined(O_DIRECTORY) -/* The kernel & C libraries often inline O_DIRECTORY */ -{ O_TMPFILE & ~O_DIRECTORY, "O_TMPFILE" }, +#elif defined __sparc__ +#if defined(O_PATH) || (defined(HAVE_DECL_O_PATH) && HAVE_DECL_O_PATH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_PATH) == (0100000000), "O_PATH != 0100000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_PATH 0100000000 +#endif +#else +#if defined(O_PATH) || (defined(HAVE_DECL_O_PATH) && HAVE_DECL_O_PATH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_PATH) == (010000000), "O_PATH != 010000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_PATH 010000000 +#endif +#endif +#if defined __hppa__ +#if defined(__O_TMPFILE) || (defined(HAVE_DECL___O_TMPFILE) && HAVE_DECL___O_TMPFILE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((__O_TMPFILE) == (040000000), "__O_TMPFILE != 040000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define __O_TMPFILE 040000000 +#endif +#elif defined __alpha__ +#if defined(__O_TMPFILE) || (defined(HAVE_DECL___O_TMPFILE) && HAVE_DECL___O_TMPFILE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((__O_TMPFILE) == (0100000000), "__O_TMPFILE != 0100000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define __O_TMPFILE 0100000000 +#endif +#elif defined __sparc__ +#if defined(__O_TMPFILE) || (defined(HAVE_DECL___O_TMPFILE) && HAVE_DECL___O_TMPFILE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((__O_TMPFILE) == (0200000000), "__O_TMPFILE != 0200000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define __O_TMPFILE 0200000000 +#endif +#else +#if defined(__O_TMPFILE) || (defined(HAVE_DECL___O_TMPFILE) && HAVE_DECL___O_TMPFILE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((__O_TMPFILE) == (020000000), "__O_TMPFILE != 020000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define __O_TMPFILE 020000000 +#endif +#endif +#if defined __hppa__ +#if defined(O_DIRECTORY) || (defined(HAVE_DECL_O_DIRECTORY) && HAVE_DECL_O_DIRECTORY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_DIRECTORY) == (010000), "O_DIRECTORY != 010000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_DIRECTORY 010000 +#endif +#elif defined __arm__ || defined __arm64__ || defined __aarch64__ || defined __m68k__ || defined __powerpc__ +#if defined(O_DIRECTORY) || (defined(HAVE_DECL_O_DIRECTORY) && HAVE_DECL_O_DIRECTORY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_DIRECTORY) == (040000), "O_DIRECTORY != 040000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_DIRECTORY 040000 #endif -#if defined(FNDELAY) || (defined(HAVE_DECL_FNDELAY) && HAVE_DECL_FNDELAY) - XLAT(FNDELAY), +#elif defined __alpha__ +#if defined(O_DIRECTORY) || (defined(HAVE_DECL_O_DIRECTORY) && HAVE_DECL_O_DIRECTORY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_DIRECTORY) == (0100000), "O_DIRECTORY != 0100000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_DIRECTORY 0100000 #endif -#if defined(FAPPEND) || (defined(HAVE_DECL_FAPPEND) && HAVE_DECL_FAPPEND) - XLAT(FAPPEND), +#else +#if defined(O_DIRECTORY) || (defined(HAVE_DECL_O_DIRECTORY) && HAVE_DECL_O_DIRECTORY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((O_DIRECTORY) == (0200000), "O_DIRECTORY != 0200000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define O_DIRECTORY 0200000 #endif -#if defined(FMARK) || (defined(HAVE_DECL_FMARK) && HAVE_DECL_FMARK) - XLAT(FMARK), #endif -#if defined(FDEFER) || (defined(HAVE_DECL_FDEFER) && HAVE_DECL_FDEFER) - XLAT(FDEFER), +#if defined __sparc__ +#if defined(FASYNC) || (defined(HAVE_DECL_FASYNC) && HAVE_DECL_FASYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FASYNC) == (0100), "FASYNC != 0100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FASYNC 0100 +#endif +#elif defined __mips__ +#if defined(FASYNC) || (defined(HAVE_DECL_FASYNC) && HAVE_DECL_FASYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FASYNC) == (010000), "FASYNC != 010000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FASYNC 010000 #endif +#else #if defined(FASYNC) || (defined(HAVE_DECL_FASYNC) && HAVE_DECL_FASYNC) - XLAT(FASYNC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FASYNC) == (020000), "FASYNC != 020000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FASYNC 020000 #endif -#if defined(FSHLOCK) || (defined(HAVE_DECL_FSHLOCK) && HAVE_DECL_FSHLOCK) - XLAT(FSHLOCK), #endif -#if defined(FEXLOCK) || (defined(HAVE_DECL_FEXLOCK) && HAVE_DECL_FEXLOCK) - XLAT(FEXLOCK), + +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS + +const struct xlat open_mode_flags[] = { + + +#if defined __hppa__ || defined __mips__ + XLAT(O_CREAT), +#elif defined __alpha__ || defined __sparc__ + XLAT(O_CREAT), +#else + XLAT(O_CREAT), #endif -#if defined(FCREAT) || (defined(HAVE_DECL_FCREAT) && HAVE_DECL_FCREAT) - XLAT(FCREAT), + +#if defined __hppa__ || defined __mips__ + XLAT(O_EXCL), +#elif defined __alpha__ || defined __sparc__ + XLAT(O_EXCL), +#else + XLAT(O_EXCL), #endif -#if defined(FTRUNC) || (defined(HAVE_DECL_FTRUNC) && HAVE_DECL_FTRUNC) - XLAT(FTRUNC), + +#if defined __mips__ + XLAT(O_NOCTTY), +#elif defined __alpha__ + XLAT(O_NOCTTY), +#elif defined __sparc__ + XLAT(O_NOCTTY), +#elif defined __hppa__ + XLAT(O_NOCTTY), +#else + XLAT(O_NOCTTY), #endif -#if defined(FEXCL) || (defined(HAVE_DECL_FEXCL) && HAVE_DECL_FEXCL) - XLAT(FEXCL), + +#if defined __alpha__ || defined __sparc__ + XLAT(O_TRUNC), +#else + XLAT(O_TRUNC), #endif -#if defined(FNBIO) || (defined(HAVE_DECL_FNBIO) && HAVE_DECL_FNBIO) - XLAT(FNBIO), + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(O_APPEND), +#else + XLAT(O_APPEND), #endif -#if defined(FSYNC) || (defined(HAVE_DECL_FSYNC) && HAVE_DECL_FSYNC) - XLAT(FSYNC), + +#if defined __alpha__ + XLAT(O_NONBLOCK), +#elif defined __mips__ + XLAT(O_NONBLOCK), +#elif defined __sparc__ + XLAT(O_NONBLOCK), +#elif defined __hppa__ + XLAT(O_NONBLOCK), +#else + XLAT(O_NONBLOCK), #endif -#if defined(FNOCTTY) || (defined(HAVE_DECL_FNOCTTY) && HAVE_DECL_FNOCTTY) - XLAT(FNOCTTY), + + +#if defined(O_SYNC) || (defined(HAVE_DECL_O_SYNC) && HAVE_DECL_O_SYNC) + XLAT(O_SYNC), #endif -#if defined(O_SHLOCK) || (defined(HAVE_DECL_O_SHLOCK) && HAVE_DECL_O_SHLOCK) - XLAT(O_SHLOCK), + +#if defined __mips__ + XLAT(__O_SYNC), +#elif defined __hppa__ + XLAT(__O_SYNC), +#elif defined __alpha__ + XLAT(__O_SYNC), +#elif defined __sparc__ + XLAT(__O_SYNC), +#else + XLAT(__O_SYNC), #endif -#if defined(O_EXLOCK) || (defined(HAVE_DECL_O_EXLOCK) && HAVE_DECL_O_EXLOCK) - XLAT(O_EXLOCK), + +#if defined(O_ASYNC) || (defined(HAVE_DECL_O_ASYNC) && HAVE_DECL_O_ASYNC) + XLAT(O_ASYNC), +#endif + +#if defined __mips__ + XLAT(O_DSYNC), +#elif defined __sparc__ + XLAT(O_DSYNC), +#elif defined __alpha__ + XLAT(O_DSYNC), +#elif defined __hppa__ + XLAT(O_DSYNC), +#else + XLAT(O_DSYNC), +#endif + +#if defined __hppa__ + XLAT(O_RSYNC), +#else +#if defined(O_RSYNC) || (defined(HAVE_DECL_O_RSYNC) && HAVE_DECL_O_RSYNC) + XLAT(O_RSYNC), +#endif +#endif + +#if defined O_NDELAY && O_NDELAY & O_NONBLOCK +# ifndef STRACE_WORKAROUND_FOR_O_NDELAY +# define STRACE_WORKAROUND_FOR_O_NDELAY + + + +# undef O_NDELAY +# endif +#endif + +#if defined __sparc__ + XLAT(O_NDELAY), +#else +#if defined(O_NDELAY) || (defined(HAVE_DECL_O_NDELAY) && HAVE_DECL_O_NDELAY) + XLAT(O_NDELAY), +#endif +#endif + +#if defined __sparc__ + XLAT(O_DIRECT), +#elif defined __mips__ + XLAT(O_DIRECT), +#elif defined __arm__ || defined __arm64__ || defined __aarch64__ || defined __m68k__ + XLAT(O_DIRECT), +#elif defined __powerpc__ + XLAT(O_DIRECT), +#elif defined __alpha__ + XLAT(O_DIRECT), +#else + XLAT(O_DIRECT), +#endif + +#if defined __hppa__ + XLAT(O_LARGEFILE), +#elif defined __mips__ + XLAT(O_LARGEFILE), +#elif defined __powerpc__ + XLAT(O_LARGEFILE), +#elif defined __alpha__ || defined __arm__ || defined __arm64__ || defined __aarch64__ || defined __m68k__ + XLAT(O_LARGEFILE), +#elif defined __sparc__ + XLAT(O_LARGEFILE), +#else + XLAT(O_LARGEFILE), +#endif + +#if defined __hppa__ + XLAT(O_NOFOLLOW), +#elif defined __arm__ || defined __arm64__ || defined __aarch64__ || defined __m68k__ || defined __powerpc__ + XLAT(O_NOFOLLOW), +#elif defined __alpha__ + XLAT(O_NOFOLLOW), +#else + XLAT(O_NOFOLLOW), +#endif + +#if defined __alpha__ || defined __hppa__ + XLAT(O_NOATIME), +#elif defined __sparc__ + XLAT(O_NOATIME), +#else + XLAT(O_NOATIME), +#endif + +#if defined __alpha__ || defined __hppa__ + XLAT(O_CLOEXEC), +#elif defined __sparc__ + XLAT(O_CLOEXEC), +#else + XLAT(O_CLOEXEC), +#endif + +#if defined __hppa__ + XLAT(O_PATH), +#elif defined __alpha__ + XLAT(O_PATH), +#elif defined __sparc__ + XLAT(O_PATH), +#else + XLAT(O_PATH), +#endif + + +#if defined(O_TMPFILE) || (defined(HAVE_DECL_O_TMPFILE) && HAVE_DECL_O_TMPFILE) + XLAT(O_TMPFILE), +#endif + +#if defined __hppa__ + XLAT(__O_TMPFILE), +#elif defined __alpha__ + XLAT(__O_TMPFILE), +#elif defined __sparc__ + XLAT(__O_TMPFILE), +#else + XLAT(__O_TMPFILE), +#endif + +#if defined __hppa__ + XLAT(O_DIRECTORY), +#elif defined __arm__ || defined __arm64__ || defined __aarch64__ || defined __m68k__ || defined __powerpc__ + XLAT(O_DIRECTORY), +#elif defined __alpha__ + XLAT(O_DIRECTORY), +#else + XLAT(O_DIRECTORY), +#endif + +#if defined __sparc__ + XLAT(FASYNC), +#elif defined __mips__ + XLAT(FASYNC), +#else + XLAT(FASYNC), #endif XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/open_mode_flags.in b/xlat/open_mode_flags.in index 30bed260..82377e2b 100644 --- a/xlat/open_mode_flags.in +++ b/xlat/open_mode_flags.in @@ -1,40 +1,199 @@ -O_CREAT -O_EXCL -O_NOCTTY -O_TRUNC -O_APPEND -O_NONBLOCK +/* Generated by maint/gen_xlat_defs.sh -f '#o' -p '[_OF]' -c 'asm-generic/fcntl.h' -a 'asm/fcntl.h' */ + +#if defined __hppa__ || defined __mips__ +O_CREAT 0400 +#elif defined __alpha__ || defined __sparc__ +O_CREAT 01000 +#else +O_CREAT 0100 +#endif + +#if defined __hppa__ || defined __mips__ +O_EXCL 02000 +#elif defined __alpha__ || defined __sparc__ +O_EXCL 04000 +#else +O_EXCL 0200 +#endif + +#if defined __mips__ +O_NOCTTY 04000 +#elif defined __alpha__ +O_NOCTTY 010000 +#elif defined __sparc__ +O_NOCTTY 0100000 +#elif defined __hppa__ +O_NOCTTY 0400000 +#else +O_NOCTTY 0400 +#endif + +#if defined __alpha__ || defined __sparc__ +O_TRUNC 02000 +#else +O_TRUNC 01000 +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +O_APPEND 010 +#else +O_APPEND 02000 +#endif + +#if defined __alpha__ +O_NONBLOCK 04 +#elif defined __mips__ +O_NONBLOCK 0200 +#elif defined __sparc__ +O_NONBLOCK 040000 +#elif defined __hppa__ +O_NONBLOCK 0200004 +#else +O_NONBLOCK 04000 +#endif + +/* O_SYNC should be listed before O_DSYNC and __O_SYNC */ O_SYNC + +#if defined __mips__ +__O_SYNC 040000 +#elif defined __hppa__ +__O_SYNC 0100000 +#elif defined __alpha__ +__O_SYNC 020000000 +#elif defined __sparc__ +__O_SYNC 040000000 +#else +__O_SYNC 04000000 +#endif + O_ASYNC -O_DSYNC + +#if defined __mips__ +O_DSYNC 020 +#elif defined __sparc__ +O_DSYNC 020000 +#elif defined __alpha__ +O_DSYNC 040000 +#elif defined __hppa__ +O_DSYNC 01000000 +#else +O_DSYNC 010000 +#endif + +#if defined __hppa__ +O_RSYNC 02000000 +#else O_RSYNC -#if defined(O_NDELAY) && (O_NDELAY != O_NONBLOCK) +#endif + +#if defined O_NDELAY && O_NDELAY & O_NONBLOCK /* O_NDELAY is unusual */ +# ifndef STRACE_WORKAROUND_FOR_O_NDELAY +# define STRACE_WORKAROUND_FOR_O_NDELAY +/* On sparc32 O_NDELAY is erroneously defined to (0x0004 | O_NONBLOCK). */ +/* On many architectures O_NDELAY is defined to O_NONBLOCK. */ +/* Both cases are wrong and have to be fixed. */ +# undef O_NDELAY +# endif +#endif /* O_NDELAY & O_NONBLOCK */ + +#if defined __sparc__ +O_NDELAY 04 +#else O_NDELAY #endif -O_PRIV -O_DIRECT -O_LARGEFILE -O_DIRECTORY -O_NOFOLLOW -O_NOATIME -O_CLOEXEC -O_PATH -#if defined(O_TMPFILE) && defined(O_DIRECTORY) -/* The kernel & C libraries often inline O_DIRECTORY */ -{ O_TMPFILE & ~O_DIRECTORY, "O_TMPFILE" }, -#endif -FNDELAY -FAPPEND -FMARK -FDEFER -FASYNC -FSHLOCK -FEXLOCK -FCREAT -FTRUNC -FEXCL -FNBIO -FSYNC -FNOCTTY -O_SHLOCK -O_EXLOCK + +#if defined __sparc__ +O_DIRECT 04000000 +#elif defined __mips__ +O_DIRECT 0100000 +#elif defined __arm__ || defined __arm64__ || defined __aarch64__ || defined __m68k__ +O_DIRECT 0200000 +#elif defined __powerpc__ +O_DIRECT 0400000 +#elif defined __alpha__ +O_DIRECT 02000000 +#else +O_DIRECT 040000 +#endif + +#if defined __hppa__ +O_LARGEFILE 04000 +#elif defined __mips__ +O_LARGEFILE 020000 +#elif defined __powerpc__ +O_LARGEFILE 0200000 +#elif defined __alpha__ || defined __arm__ || defined __arm64__ || defined __aarch64__ || defined __m68k__ +O_LARGEFILE 0400000 +#elif defined __sparc__ +O_LARGEFILE 01000000 +#else +O_LARGEFILE 0100000 +#endif + +#if defined __hppa__ +O_NOFOLLOW 0200 +#elif defined __arm__ || defined __arm64__ || defined __aarch64__ || defined __m68k__ || defined __powerpc__ +O_NOFOLLOW 0100000 +#elif defined __alpha__ +O_NOFOLLOW 0200000 +#else +O_NOFOLLOW 0400000 +#endif + +#if defined __alpha__ || defined __hppa__ +O_NOATIME 04000000 +#elif defined __sparc__ +O_NOATIME 010000000 +#else +O_NOATIME 01000000 +#endif + +#if defined __alpha__ || defined __hppa__ +O_CLOEXEC 010000000 +#elif defined __sparc__ +O_CLOEXEC 020000000 +#else +O_CLOEXEC 02000000 +#endif + +#if defined __hppa__ +O_PATH 020000000 +#elif defined __alpha__ +O_PATH 040000000 +#elif defined __sparc__ +O_PATH 0100000000 +#else +O_PATH 010000000 +#endif + +/* O_TMPFILE should be listed before O_DIRECTORY and __O_TMPFILE */ +O_TMPFILE + +#if defined __hppa__ +__O_TMPFILE 040000000 +#elif defined __alpha__ +__O_TMPFILE 0100000000 +#elif defined __sparc__ +__O_TMPFILE 0200000000 +#else +__O_TMPFILE 020000000 +#endif + +#if defined __hppa__ +O_DIRECTORY 010000 +#elif defined __arm__ || defined __arm64__ || defined __aarch64__ || defined __m68k__ || defined __powerpc__ +O_DIRECTORY 040000 +#elif defined __alpha__ +O_DIRECTORY 0100000 +#else +O_DIRECTORY 0200000 +#endif + +#if defined __sparc__ +FASYNC 0100 +#elif defined __mips__ +FASYNC 010000 +#else +FASYNC 020000 +#endif diff --git a/xlat/openmodessol.h b/xlat/openmodessol.h deleted file mode 100644 index fb6a5533..00000000 --- a/xlat/openmodessol.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Generated by ./xlat/gen.sh from ./xlat/openmodessol.in; do not edit. */ - -#ifdef IN_MPERS - -# error static const struct xlat openmodessol in mpers mode - -#else - -static -const struct xlat openmodessol[] = { -{ 0, "O_RDWR" }, -{ 1, "O_RDONLY" }, -{ 2, "O_WRONLY" }, -{ 0x80, "O_NONBLOCK" }, -{ 8, "O_APPEND" }, -{ 0x100, "O_CREAT" }, -{ 0x200, "O_TRUNC" }, -{ 0x400, "O_EXCL" }, -{ 0x800, "O_NOCTTY" }, -{ 0x10, "O_SYNC" }, -{ 0x40, "O_DSYNC" }, -{ 0x8000, "O_RSYNC" }, -{ 4, "O_NDELAY" }, -{ 0x1000, "O_PRIV" }, - XLAT_END -}; - -#endif /* !IN_MPERS */ diff --git a/xlat/openmodessol.in b/xlat/openmodessol.in deleted file mode 100644 index e42af6f8..00000000 --- a/xlat/openmodessol.in +++ /dev/null @@ -1,14 +0,0 @@ - { 0, "O_RDWR" }, - { 1, "O_RDONLY" }, - { 2, "O_WRONLY" }, - { 0x80, "O_NONBLOCK" }, - { 8, "O_APPEND" }, - { 0x100, "O_CREAT" }, - { 0x200, "O_TRUNC" }, - { 0x400, "O_EXCL" }, - { 0x800, "O_NOCTTY" }, - { 0x10, "O_SYNC" }, - { 0x40, "O_DSYNC" }, - { 0x8000, "O_RSYNC" }, - { 4, "O_NDELAY" }, - { 0x1000, "O_PRIV" }, diff --git a/xlat/packet_diag_attrs.h b/xlat/packet_diag_attrs.h new file mode 100644 index 00000000..90253b89 --- /dev/null +++ b/xlat/packet_diag_attrs.h @@ -0,0 +1,30 @@ +/* Generated by ./xlat/gen.sh from ./xlat/packet_diag_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat packet_diag_attrs in mpers mode + +# else + +static +const struct xlat packet_diag_attrs[] = { + XLAT(PACKET_DIAG_INFO), + XLAT(PACKET_DIAG_MCLIST), + XLAT(PACKET_DIAG_RX_RING), + XLAT(PACKET_DIAG_TX_RING), + XLAT(PACKET_DIAG_FANOUT), + XLAT(PACKET_DIAG_UID), + XLAT(PACKET_DIAG_MEMINFO), + XLAT(PACKET_DIAG_FILTER), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/packet_diag_attrs.in b/xlat/packet_diag_attrs.in new file mode 100644 index 00000000..5e33871e --- /dev/null +++ b/xlat/packet_diag_attrs.in @@ -0,0 +1,9 @@ +#unconditional +PACKET_DIAG_INFO +PACKET_DIAG_MCLIST +PACKET_DIAG_RX_RING +PACKET_DIAG_TX_RING +PACKET_DIAG_FANOUT +PACKET_DIAG_UID +PACKET_DIAG_MEMINFO +PACKET_DIAG_FILTER diff --git a/xlat/packet_diag_info_flags.h b/xlat/packet_diag_info_flags.h new file mode 100644 index 00000000..8a083da7 --- /dev/null +++ b/xlat/packet_diag_info_flags.h @@ -0,0 +1,37 @@ +/* Generated by ./xlat/gen.sh from ./xlat/packet_diag_info_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat packet_diag_info_flags in mpers mode + +# else + +static +const struct xlat packet_diag_info_flags[] = { +#if defined(PDI_RUNNING) || (defined(HAVE_DECL_PDI_RUNNING) && HAVE_DECL_PDI_RUNNING) + XLAT(PDI_RUNNING), +#endif +#if defined(PDI_AUXDATA) || (defined(HAVE_DECL_PDI_AUXDATA) && HAVE_DECL_PDI_AUXDATA) + XLAT(PDI_AUXDATA), +#endif +#if defined(PDI_ORIGDEV) || (defined(HAVE_DECL_PDI_ORIGDEV) && HAVE_DECL_PDI_ORIGDEV) + XLAT(PDI_ORIGDEV), +#endif +#if defined(PDI_VNETHDR) || (defined(HAVE_DECL_PDI_VNETHDR) && HAVE_DECL_PDI_VNETHDR) + XLAT(PDI_VNETHDR), +#endif +#if defined(PDI_LOSS) || (defined(HAVE_DECL_PDI_LOSS) && HAVE_DECL_PDI_LOSS) + XLAT(PDI_LOSS), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/packet_diag_info_flags.in b/xlat/packet_diag_info_flags.in new file mode 100644 index 00000000..7e591d85 --- /dev/null +++ b/xlat/packet_diag_info_flags.in @@ -0,0 +1,5 @@ +PDI_RUNNING +PDI_AUXDATA +PDI_ORIGDEV +PDI_VNETHDR +PDI_LOSS diff --git a/xlat/packet_diag_show.h b/xlat/packet_diag_show.h new file mode 100644 index 00000000..40df9733 --- /dev/null +++ b/xlat/packet_diag_show.h @@ -0,0 +1,40 @@ +/* Generated by ./xlat/gen.sh from ./xlat/packet_diag_show.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat packet_diag_show in mpers mode + +# else + +static +const struct xlat packet_diag_show[] = { +#if defined(PACKET_SHOW_INFO) || (defined(HAVE_DECL_PACKET_SHOW_INFO) && HAVE_DECL_PACKET_SHOW_INFO) + XLAT(PACKET_SHOW_INFO), +#endif +#if defined(PACKET_SHOW_MCLIST) || (defined(HAVE_DECL_PACKET_SHOW_MCLIST) && HAVE_DECL_PACKET_SHOW_MCLIST) + XLAT(PACKET_SHOW_MCLIST), +#endif +#if defined(PACKET_SHOW_RING_CFG) || (defined(HAVE_DECL_PACKET_SHOW_RING_CFG) && HAVE_DECL_PACKET_SHOW_RING_CFG) + XLAT(PACKET_SHOW_RING_CFG), +#endif +#if defined(PACKET_SHOW_FANOUT) || (defined(HAVE_DECL_PACKET_SHOW_FANOUT) && HAVE_DECL_PACKET_SHOW_FANOUT) + XLAT(PACKET_SHOW_FANOUT), +#endif +#if defined(PACKET_SHOW_MEMINFO) || (defined(HAVE_DECL_PACKET_SHOW_MEMINFO) && HAVE_DECL_PACKET_SHOW_MEMINFO) + XLAT(PACKET_SHOW_MEMINFO), +#endif +#if defined(PACKET_SHOW_FILTER) || (defined(HAVE_DECL_PACKET_SHOW_FILTER) && HAVE_DECL_PACKET_SHOW_FILTER) + XLAT(PACKET_SHOW_FILTER), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/packet_diag_show.in b/xlat/packet_diag_show.in new file mode 100644 index 00000000..b495af81 --- /dev/null +++ b/xlat/packet_diag_show.in @@ -0,0 +1,6 @@ +PACKET_SHOW_INFO +PACKET_SHOW_MCLIST +PACKET_SHOW_RING_CFG +PACKET_SHOW_FANOUT +PACKET_SHOW_MEMINFO +PACKET_SHOW_FILTER diff --git a/xlat/packet_mreq_type.h b/xlat/packet_mreq_type.h index 012d3e78..c1448d37 100644 --- a/xlat/packet_mreq_type.h +++ b/xlat/packet_mreq_type.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/packet_mreq_type.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat packet_mreq_type in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat packet_mreq_type in mpers mode + +# else static const struct xlat packet_mreq_type[] = { @@ -23,4 +29,6 @@ const struct xlat packet_mreq_type[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/perf_attr_size.h b/xlat/perf_attr_size.h index ecebb4d7..fa876d3a 100644 --- a/xlat/perf_attr_size.h +++ b/xlat/perf_attr_size.h @@ -1,28 +1,58 @@ /* Generated by ./xlat/gen.sh from ./xlat/perf_attr_size.in; do not edit. */ -#if !(defined(PERF_ATTR_SIZE_VER0) || (defined(HAVE_DECL_PERF_ATTR_SIZE_VER0) && HAVE_DECL_PERF_ATTR_SIZE_VER0)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PERF_ATTR_SIZE_VER0) || (defined(HAVE_DECL_PERF_ATTR_SIZE_VER0) && HAVE_DECL_PERF_ATTR_SIZE_VER0) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_ATTR_SIZE_VER0) == (64), "PERF_ATTR_SIZE_VER0 != 64"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_ATTR_SIZE_VER0 64 #endif -#if !(defined(PERF_ATTR_SIZE_VER1) || (defined(HAVE_DECL_PERF_ATTR_SIZE_VER1) && HAVE_DECL_PERF_ATTR_SIZE_VER1)) +#if defined(PERF_ATTR_SIZE_VER1) || (defined(HAVE_DECL_PERF_ATTR_SIZE_VER1) && HAVE_DECL_PERF_ATTR_SIZE_VER1) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_ATTR_SIZE_VER1) == (72), "PERF_ATTR_SIZE_VER1 != 72"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_ATTR_SIZE_VER1 72 #endif -#if !(defined(PERF_ATTR_SIZE_VER2) || (defined(HAVE_DECL_PERF_ATTR_SIZE_VER2) && HAVE_DECL_PERF_ATTR_SIZE_VER2)) +#if defined(PERF_ATTR_SIZE_VER2) || (defined(HAVE_DECL_PERF_ATTR_SIZE_VER2) && HAVE_DECL_PERF_ATTR_SIZE_VER2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_ATTR_SIZE_VER2) == (80), "PERF_ATTR_SIZE_VER2 != 80"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_ATTR_SIZE_VER2 80 #endif -#if !(defined(PERF_ATTR_SIZE_VER3) || (defined(HAVE_DECL_PERF_ATTR_SIZE_VER3) && HAVE_DECL_PERF_ATTR_SIZE_VER3)) +#if defined(PERF_ATTR_SIZE_VER3) || (defined(HAVE_DECL_PERF_ATTR_SIZE_VER3) && HAVE_DECL_PERF_ATTR_SIZE_VER3) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_ATTR_SIZE_VER3) == (96), "PERF_ATTR_SIZE_VER3 != 96"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_ATTR_SIZE_VER3 96 #endif -#if !(defined(PERF_ATTR_SIZE_VER4) || (defined(HAVE_DECL_PERF_ATTR_SIZE_VER4) && HAVE_DECL_PERF_ATTR_SIZE_VER4)) +#if defined(PERF_ATTR_SIZE_VER4) || (defined(HAVE_DECL_PERF_ATTR_SIZE_VER4) && HAVE_DECL_PERF_ATTR_SIZE_VER4) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_ATTR_SIZE_VER4) == (104), "PERF_ATTR_SIZE_VER4 != 104"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_ATTR_SIZE_VER4 104 #endif -#if !(defined(PERF_ATTR_SIZE_VER5) || (defined(HAVE_DECL_PERF_ATTR_SIZE_VER5) && HAVE_DECL_PERF_ATTR_SIZE_VER5)) +#if defined(PERF_ATTR_SIZE_VER5) || (defined(HAVE_DECL_PERF_ATTR_SIZE_VER5) && HAVE_DECL_PERF_ATTR_SIZE_VER5) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_ATTR_SIZE_VER5) == (112), "PERF_ATTR_SIZE_VER5 != 112"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_ATTR_SIZE_VER5 112 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat perf_attr_size in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat perf_attr_size in mpers mode + +# else static const struct xlat perf_attr_size[] = { @@ -35,4 +65,6 @@ const struct xlat perf_attr_size[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/perf_branch_sample_type.h b/xlat/perf_branch_sample_type.h index 6d710939..3632fa82 100644 --- a/xlat/perf_branch_sample_type.h +++ b/xlat/perf_branch_sample_type.h @@ -1,58 +1,135 @@ /* Generated by ./xlat/gen.sh from ./xlat/perf_branch_sample_type.in; do not edit. */ -#if !(defined(PERF_SAMPLE_BRANCH_USER) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_USER) && HAVE_DECL_PERF_SAMPLE_BRANCH_USER)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PERF_SAMPLE_BRANCH_USER) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_USER) && HAVE_DECL_PERF_SAMPLE_BRANCH_USER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_BRANCH_USER) == (1 << 0), "PERF_SAMPLE_BRANCH_USER != 1 << 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_BRANCH_USER 1 << 0 #endif -#if !(defined(PERF_SAMPLE_BRANCH_KERNEL) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_KERNEL) && HAVE_DECL_PERF_SAMPLE_BRANCH_KERNEL)) +#if defined(PERF_SAMPLE_BRANCH_KERNEL) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_KERNEL) && HAVE_DECL_PERF_SAMPLE_BRANCH_KERNEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_BRANCH_KERNEL) == (1 << 1), "PERF_SAMPLE_BRANCH_KERNEL != 1 << 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_BRANCH_KERNEL 1 << 1 #endif -#if !(defined(PERF_SAMPLE_BRANCH_HV) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_HV) && HAVE_DECL_PERF_SAMPLE_BRANCH_HV)) +#if defined(PERF_SAMPLE_BRANCH_HV) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_HV) && HAVE_DECL_PERF_SAMPLE_BRANCH_HV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_BRANCH_HV) == (1 << 2), "PERF_SAMPLE_BRANCH_HV != 1 << 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_BRANCH_HV 1 << 2 #endif -#if !(defined(PERF_SAMPLE_BRANCH_ANY) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_ANY) && HAVE_DECL_PERF_SAMPLE_BRANCH_ANY)) +#if defined(PERF_SAMPLE_BRANCH_ANY) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_ANY) && HAVE_DECL_PERF_SAMPLE_BRANCH_ANY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_BRANCH_ANY) == (1 << 3), "PERF_SAMPLE_BRANCH_ANY != 1 << 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_BRANCH_ANY 1 << 3 #endif -#if !(defined(PERF_SAMPLE_BRANCH_ANY_CALL) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_ANY_CALL) && HAVE_DECL_PERF_SAMPLE_BRANCH_ANY_CALL)) +#if defined(PERF_SAMPLE_BRANCH_ANY_CALL) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_ANY_CALL) && HAVE_DECL_PERF_SAMPLE_BRANCH_ANY_CALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_BRANCH_ANY_CALL) == (1 << 4), "PERF_SAMPLE_BRANCH_ANY_CALL != 1 << 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_BRANCH_ANY_CALL 1 << 4 #endif -#if !(defined(PERF_SAMPLE_BRANCH_ANY_RETURN) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_ANY_RETURN) && HAVE_DECL_PERF_SAMPLE_BRANCH_ANY_RETURN)) +#if defined(PERF_SAMPLE_BRANCH_ANY_RETURN) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_ANY_RETURN) && HAVE_DECL_PERF_SAMPLE_BRANCH_ANY_RETURN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_BRANCH_ANY_RETURN) == (1 << 5), "PERF_SAMPLE_BRANCH_ANY_RETURN != 1 << 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_BRANCH_ANY_RETURN 1 << 5 #endif -#if !(defined(PERF_SAMPLE_BRANCH_IND_CALL) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_IND_CALL) && HAVE_DECL_PERF_SAMPLE_BRANCH_IND_CALL)) +#if defined(PERF_SAMPLE_BRANCH_IND_CALL) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_IND_CALL) && HAVE_DECL_PERF_SAMPLE_BRANCH_IND_CALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_BRANCH_IND_CALL) == (1 << 6), "PERF_SAMPLE_BRANCH_IND_CALL != 1 << 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_BRANCH_IND_CALL 1 << 6 #endif -#if !(defined(PERF_SAMPLE_BRANCH_ABORT_TX) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_ABORT_TX) && HAVE_DECL_PERF_SAMPLE_BRANCH_ABORT_TX)) +#if defined(PERF_SAMPLE_BRANCH_ABORT_TX) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_ABORT_TX) && HAVE_DECL_PERF_SAMPLE_BRANCH_ABORT_TX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_BRANCH_ABORT_TX) == (1 << 7), "PERF_SAMPLE_BRANCH_ABORT_TX != 1 << 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_BRANCH_ABORT_TX 1 << 7 #endif -#if !(defined(PERF_SAMPLE_BRANCH_IN_TX) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_IN_TX) && HAVE_DECL_PERF_SAMPLE_BRANCH_IN_TX)) +#if defined(PERF_SAMPLE_BRANCH_IN_TX) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_IN_TX) && HAVE_DECL_PERF_SAMPLE_BRANCH_IN_TX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_BRANCH_IN_TX) == (1 << 8), "PERF_SAMPLE_BRANCH_IN_TX != 1 << 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_BRANCH_IN_TX 1 << 8 #endif -#if !(defined(PERF_SAMPLE_BRANCH_NO_TX) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_NO_TX) && HAVE_DECL_PERF_SAMPLE_BRANCH_NO_TX)) +#if defined(PERF_SAMPLE_BRANCH_NO_TX) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_NO_TX) && HAVE_DECL_PERF_SAMPLE_BRANCH_NO_TX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_BRANCH_NO_TX) == (1 << 9), "PERF_SAMPLE_BRANCH_NO_TX != 1 << 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_BRANCH_NO_TX 1 << 9 #endif -#if !(defined(PERF_SAMPLE_BRANCH_COND) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_COND) && HAVE_DECL_PERF_SAMPLE_BRANCH_COND)) +#if defined(PERF_SAMPLE_BRANCH_COND) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_COND) && HAVE_DECL_PERF_SAMPLE_BRANCH_COND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_BRANCH_COND) == (1 << 10), "PERF_SAMPLE_BRANCH_COND != 1 << 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_BRANCH_COND 1 << 10 #endif -#if !(defined(PERF_SAMPLE_BRANCH_CALL_STACK) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_CALL_STACK) && HAVE_DECL_PERF_SAMPLE_BRANCH_CALL_STACK)) +#if defined(PERF_SAMPLE_BRANCH_CALL_STACK) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_CALL_STACK) && HAVE_DECL_PERF_SAMPLE_BRANCH_CALL_STACK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_BRANCH_CALL_STACK) == (1 << 11), "PERF_SAMPLE_BRANCH_CALL_STACK != 1 << 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_BRANCH_CALL_STACK 1 << 11 #endif -#if !(defined(PERF_SAMPLE_BRANCH_IND_JUMP) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_IND_JUMP) && HAVE_DECL_PERF_SAMPLE_BRANCH_IND_JUMP)) +#if defined(PERF_SAMPLE_BRANCH_IND_JUMP) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_IND_JUMP) && HAVE_DECL_PERF_SAMPLE_BRANCH_IND_JUMP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_BRANCH_IND_JUMP) == (1 << 12), "PERF_SAMPLE_BRANCH_IND_JUMP != 1 << 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_BRANCH_IND_JUMP 1 << 12 #endif -#if !(defined(PERF_SAMPLE_BRANCH_CALL) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_CALL) && HAVE_DECL_PERF_SAMPLE_BRANCH_CALL)) +#if defined(PERF_SAMPLE_BRANCH_CALL) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_CALL) && HAVE_DECL_PERF_SAMPLE_BRANCH_CALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_BRANCH_CALL) == (1 << 13), "PERF_SAMPLE_BRANCH_CALL != 1 << 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_BRANCH_CALL 1 << 13 #endif -#if !(defined(PERF_SAMPLE_BRANCH_NO_FLAGS) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_NO_FLAGS) && HAVE_DECL_PERF_SAMPLE_BRANCH_NO_FLAGS)) +#if defined(PERF_SAMPLE_BRANCH_NO_FLAGS) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_NO_FLAGS) && HAVE_DECL_PERF_SAMPLE_BRANCH_NO_FLAGS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_BRANCH_NO_FLAGS) == (1 << 14), "PERF_SAMPLE_BRANCH_NO_FLAGS != 1 << 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_BRANCH_NO_FLAGS 1 << 14 #endif -#if !(defined(PERF_SAMPLE_BRANCH_NO_CYCLES) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_NO_CYCLES) && HAVE_DECL_PERF_SAMPLE_BRANCH_NO_CYCLES)) +#if defined(PERF_SAMPLE_BRANCH_NO_CYCLES) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_NO_CYCLES) && HAVE_DECL_PERF_SAMPLE_BRANCH_NO_CYCLES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_BRANCH_NO_CYCLES) == (1 << 15), "PERF_SAMPLE_BRANCH_NO_CYCLES != 1 << 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_BRANCH_NO_CYCLES 1 << 15 #endif +#if defined(PERF_SAMPLE_BRANCH_TYPE_SAVE) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_TYPE_SAVE) && HAVE_DECL_PERF_SAMPLE_BRANCH_TYPE_SAVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_BRANCH_TYPE_SAVE) == (1 << 16), "PERF_SAMPLE_BRANCH_TYPE_SAVE != 1 << 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PERF_SAMPLE_BRANCH_TYPE_SAVE 1 << 16 +#endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat perf_branch_sample_type in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat perf_branch_sample_type in mpers mode + +# else static const struct xlat perf_branch_sample_type[] = { @@ -72,7 +149,10 @@ const struct xlat perf_branch_sample_type[] = { XLAT(PERF_SAMPLE_BRANCH_CALL), XLAT(PERF_SAMPLE_BRANCH_NO_FLAGS), XLAT(PERF_SAMPLE_BRANCH_NO_CYCLES), + XLAT(PERF_SAMPLE_BRANCH_TYPE_SAVE), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/perf_branch_sample_type.in b/xlat/perf_branch_sample_type.in index 0e33d980..9370569d 100644 --- a/xlat/perf_branch_sample_type.in +++ b/xlat/perf_branch_sample_type.in @@ -14,3 +14,4 @@ PERF_SAMPLE_BRANCH_IND_JUMP 1 << 12 PERF_SAMPLE_BRANCH_CALL 1 << 13 PERF_SAMPLE_BRANCH_NO_FLAGS 1 << 14 PERF_SAMPLE_BRANCH_NO_CYCLES 1 << 15 +PERF_SAMPLE_BRANCH_TYPE_SAVE 1 << 16 diff --git a/xlat/perf_event_open_flags.h b/xlat/perf_event_open_flags.h index 922f9c45..86475b9d 100644 --- a/xlat/perf_event_open_flags.h +++ b/xlat/perf_event_open_flags.h @@ -1,22 +1,44 @@ /* Generated by ./xlat/gen.sh from ./xlat/perf_event_open_flags.in; do not edit. */ -#if !(defined(PERF_FLAG_FD_NO_GROUP) || (defined(HAVE_DECL_PERF_FLAG_FD_NO_GROUP) && HAVE_DECL_PERF_FLAG_FD_NO_GROUP)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PERF_FLAG_FD_NO_GROUP) || (defined(HAVE_DECL_PERF_FLAG_FD_NO_GROUP) && HAVE_DECL_PERF_FLAG_FD_NO_GROUP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_FLAG_FD_NO_GROUP) == (1), "PERF_FLAG_FD_NO_GROUP != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_FLAG_FD_NO_GROUP 1 #endif -#if !(defined(PERF_FLAG_FD_OUTPUT) || (defined(HAVE_DECL_PERF_FLAG_FD_OUTPUT) && HAVE_DECL_PERF_FLAG_FD_OUTPUT)) +#if defined(PERF_FLAG_FD_OUTPUT) || (defined(HAVE_DECL_PERF_FLAG_FD_OUTPUT) && HAVE_DECL_PERF_FLAG_FD_OUTPUT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_FLAG_FD_OUTPUT) == (2), "PERF_FLAG_FD_OUTPUT != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_FLAG_FD_OUTPUT 2 #endif -#if !(defined(PERF_FLAG_PID_CGROUP) || (defined(HAVE_DECL_PERF_FLAG_PID_CGROUP) && HAVE_DECL_PERF_FLAG_PID_CGROUP)) +#if defined(PERF_FLAG_PID_CGROUP) || (defined(HAVE_DECL_PERF_FLAG_PID_CGROUP) && HAVE_DECL_PERF_FLAG_PID_CGROUP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_FLAG_PID_CGROUP) == (4), "PERF_FLAG_PID_CGROUP != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_FLAG_PID_CGROUP 4 #endif -#if !(defined(PERF_FLAG_FD_CLOEXEC) || (defined(HAVE_DECL_PERF_FLAG_FD_CLOEXEC) && HAVE_DECL_PERF_FLAG_FD_CLOEXEC)) +#if defined(PERF_FLAG_FD_CLOEXEC) || (defined(HAVE_DECL_PERF_FLAG_FD_CLOEXEC) && HAVE_DECL_PERF_FLAG_FD_CLOEXEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_FLAG_FD_CLOEXEC) == (8), "PERF_FLAG_FD_CLOEXEC != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_FLAG_FD_CLOEXEC 8 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat perf_event_open_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat perf_event_open_flags in mpers mode + +# else static const struct xlat perf_event_open_flags[] = { @@ -27,4 +49,6 @@ const struct xlat perf_event_open_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/perf_event_read_format.h b/xlat/perf_event_read_format.h index 7b4c71d7..0c74308e 100644 --- a/xlat/perf_event_read_format.h +++ b/xlat/perf_event_read_format.h @@ -1,22 +1,44 @@ /* Generated by ./xlat/gen.sh from ./xlat/perf_event_read_format.in; do not edit. */ -#if !(defined(PERF_FORMAT_TOTAL_TIME_ENABLED) || (defined(HAVE_DECL_PERF_FORMAT_TOTAL_TIME_ENABLED) && HAVE_DECL_PERF_FORMAT_TOTAL_TIME_ENABLED)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PERF_FORMAT_TOTAL_TIME_ENABLED) || (defined(HAVE_DECL_PERF_FORMAT_TOTAL_TIME_ENABLED) && HAVE_DECL_PERF_FORMAT_TOTAL_TIME_ENABLED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_FORMAT_TOTAL_TIME_ENABLED) == (1 << 0), "PERF_FORMAT_TOTAL_TIME_ENABLED != 1 << 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_FORMAT_TOTAL_TIME_ENABLED 1 << 0 #endif -#if !(defined(PERF_FORMAT_TOTAL_TIME_RUNNING) || (defined(HAVE_DECL_PERF_FORMAT_TOTAL_TIME_RUNNING) && HAVE_DECL_PERF_FORMAT_TOTAL_TIME_RUNNING)) +#if defined(PERF_FORMAT_TOTAL_TIME_RUNNING) || (defined(HAVE_DECL_PERF_FORMAT_TOTAL_TIME_RUNNING) && HAVE_DECL_PERF_FORMAT_TOTAL_TIME_RUNNING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_FORMAT_TOTAL_TIME_RUNNING) == (1 << 1), "PERF_FORMAT_TOTAL_TIME_RUNNING != 1 << 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_FORMAT_TOTAL_TIME_RUNNING 1 << 1 #endif -#if !(defined(PERF_FORMAT_ID) || (defined(HAVE_DECL_PERF_FORMAT_ID) && HAVE_DECL_PERF_FORMAT_ID)) +#if defined(PERF_FORMAT_ID) || (defined(HAVE_DECL_PERF_FORMAT_ID) && HAVE_DECL_PERF_FORMAT_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_FORMAT_ID) == (1 << 2), "PERF_FORMAT_ID != 1 << 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_FORMAT_ID 1 << 2 #endif -#if !(defined(PERF_FORMAT_GROUP) || (defined(HAVE_DECL_PERF_FORMAT_GROUP) && HAVE_DECL_PERF_FORMAT_GROUP)) +#if defined(PERF_FORMAT_GROUP) || (defined(HAVE_DECL_PERF_FORMAT_GROUP) && HAVE_DECL_PERF_FORMAT_GROUP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_FORMAT_GROUP) == (1 << 3), "PERF_FORMAT_GROUP != 1 << 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_FORMAT_GROUP 1 << 3 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat perf_event_read_format in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat perf_event_read_format in mpers mode + +# else static const struct xlat perf_event_read_format[] = { @@ -27,4 +49,6 @@ const struct xlat perf_event_read_format[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/perf_event_sample_format.h b/xlat/perf_event_sample_format.h index c4b04229..3adda9c5 100644 --- a/xlat/perf_event_sample_format.h +++ b/xlat/perf_event_sample_format.h @@ -1,67 +1,156 @@ /* Generated by ./xlat/gen.sh from ./xlat/perf_event_sample_format.in; do not edit. */ -#if !(defined(PERF_SAMPLE_IP) || (defined(HAVE_DECL_PERF_SAMPLE_IP) && HAVE_DECL_PERF_SAMPLE_IP)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PERF_SAMPLE_IP) || (defined(HAVE_DECL_PERF_SAMPLE_IP) && HAVE_DECL_PERF_SAMPLE_IP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_IP) == (1 << 0), "PERF_SAMPLE_IP != 1 << 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_IP 1 << 0 #endif -#if !(defined(PERF_SAMPLE_TID) || (defined(HAVE_DECL_PERF_SAMPLE_TID) && HAVE_DECL_PERF_SAMPLE_TID)) +#if defined(PERF_SAMPLE_TID) || (defined(HAVE_DECL_PERF_SAMPLE_TID) && HAVE_DECL_PERF_SAMPLE_TID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_TID) == (1 << 1), "PERF_SAMPLE_TID != 1 << 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_TID 1 << 1 #endif -#if !(defined(PERF_SAMPLE_TIME) || (defined(HAVE_DECL_PERF_SAMPLE_TIME) && HAVE_DECL_PERF_SAMPLE_TIME)) +#if defined(PERF_SAMPLE_TIME) || (defined(HAVE_DECL_PERF_SAMPLE_TIME) && HAVE_DECL_PERF_SAMPLE_TIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_TIME) == (1 << 2), "PERF_SAMPLE_TIME != 1 << 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_TIME 1 << 2 #endif -#if !(defined(PERF_SAMPLE_ADDR) || (defined(HAVE_DECL_PERF_SAMPLE_ADDR) && HAVE_DECL_PERF_SAMPLE_ADDR)) +#if defined(PERF_SAMPLE_ADDR) || (defined(HAVE_DECL_PERF_SAMPLE_ADDR) && HAVE_DECL_PERF_SAMPLE_ADDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_ADDR) == (1 << 3), "PERF_SAMPLE_ADDR != 1 << 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_ADDR 1 << 3 #endif -#if !(defined(PERF_SAMPLE_READ) || (defined(HAVE_DECL_PERF_SAMPLE_READ) && HAVE_DECL_PERF_SAMPLE_READ)) +#if defined(PERF_SAMPLE_READ) || (defined(HAVE_DECL_PERF_SAMPLE_READ) && HAVE_DECL_PERF_SAMPLE_READ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_READ) == (1 << 4), "PERF_SAMPLE_READ != 1 << 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_READ 1 << 4 #endif -#if !(defined(PERF_SAMPLE_CALLCHAIN) || (defined(HAVE_DECL_PERF_SAMPLE_CALLCHAIN) && HAVE_DECL_PERF_SAMPLE_CALLCHAIN)) +#if defined(PERF_SAMPLE_CALLCHAIN) || (defined(HAVE_DECL_PERF_SAMPLE_CALLCHAIN) && HAVE_DECL_PERF_SAMPLE_CALLCHAIN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_CALLCHAIN) == (1 << 5), "PERF_SAMPLE_CALLCHAIN != 1 << 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_CALLCHAIN 1 << 5 #endif -#if !(defined(PERF_SAMPLE_ID) || (defined(HAVE_DECL_PERF_SAMPLE_ID) && HAVE_DECL_PERF_SAMPLE_ID)) +#if defined(PERF_SAMPLE_ID) || (defined(HAVE_DECL_PERF_SAMPLE_ID) && HAVE_DECL_PERF_SAMPLE_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_ID) == (1 << 6), "PERF_SAMPLE_ID != 1 << 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_ID 1 << 6 #endif -#if !(defined(PERF_SAMPLE_CPU) || (defined(HAVE_DECL_PERF_SAMPLE_CPU) && HAVE_DECL_PERF_SAMPLE_CPU)) +#if defined(PERF_SAMPLE_CPU) || (defined(HAVE_DECL_PERF_SAMPLE_CPU) && HAVE_DECL_PERF_SAMPLE_CPU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_CPU) == (1 << 7), "PERF_SAMPLE_CPU != 1 << 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_CPU 1 << 7 #endif -#if !(defined(PERF_SAMPLE_PERIOD) || (defined(HAVE_DECL_PERF_SAMPLE_PERIOD) && HAVE_DECL_PERF_SAMPLE_PERIOD)) +#if defined(PERF_SAMPLE_PERIOD) || (defined(HAVE_DECL_PERF_SAMPLE_PERIOD) && HAVE_DECL_PERF_SAMPLE_PERIOD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_PERIOD) == (1 << 8), "PERF_SAMPLE_PERIOD != 1 << 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_PERIOD 1 << 8 #endif -#if !(defined(PERF_SAMPLE_STREAM_ID) || (defined(HAVE_DECL_PERF_SAMPLE_STREAM_ID) && HAVE_DECL_PERF_SAMPLE_STREAM_ID)) +#if defined(PERF_SAMPLE_STREAM_ID) || (defined(HAVE_DECL_PERF_SAMPLE_STREAM_ID) && HAVE_DECL_PERF_SAMPLE_STREAM_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_STREAM_ID) == (1 << 9), "PERF_SAMPLE_STREAM_ID != 1 << 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_STREAM_ID 1 << 9 #endif -#if !(defined(PERF_SAMPLE_RAW) || (defined(HAVE_DECL_PERF_SAMPLE_RAW) && HAVE_DECL_PERF_SAMPLE_RAW)) +#if defined(PERF_SAMPLE_RAW) || (defined(HAVE_DECL_PERF_SAMPLE_RAW) && HAVE_DECL_PERF_SAMPLE_RAW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_RAW) == (1 << 10), "PERF_SAMPLE_RAW != 1 << 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_RAW 1 << 10 #endif -#if !(defined(PERF_SAMPLE_BRANCH_STACK) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_STACK) && HAVE_DECL_PERF_SAMPLE_BRANCH_STACK)) +#if defined(PERF_SAMPLE_BRANCH_STACK) || (defined(HAVE_DECL_PERF_SAMPLE_BRANCH_STACK) && HAVE_DECL_PERF_SAMPLE_BRANCH_STACK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_BRANCH_STACK) == (1 << 11), "PERF_SAMPLE_BRANCH_STACK != 1 << 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_BRANCH_STACK 1 << 11 #endif -#if !(defined(PERF_SAMPLE_REGS_USER) || (defined(HAVE_DECL_PERF_SAMPLE_REGS_USER) && HAVE_DECL_PERF_SAMPLE_REGS_USER)) +#if defined(PERF_SAMPLE_REGS_USER) || (defined(HAVE_DECL_PERF_SAMPLE_REGS_USER) && HAVE_DECL_PERF_SAMPLE_REGS_USER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_REGS_USER) == (1 << 12), "PERF_SAMPLE_REGS_USER != 1 << 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_REGS_USER 1 << 12 #endif -#if !(defined(PERF_SAMPLE_STACK_USER) || (defined(HAVE_DECL_PERF_SAMPLE_STACK_USER) && HAVE_DECL_PERF_SAMPLE_STACK_USER)) +#if defined(PERF_SAMPLE_STACK_USER) || (defined(HAVE_DECL_PERF_SAMPLE_STACK_USER) && HAVE_DECL_PERF_SAMPLE_STACK_USER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_STACK_USER) == (1 << 13), "PERF_SAMPLE_STACK_USER != 1 << 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_STACK_USER 1 << 13 #endif -#if !(defined(PERF_SAMPLE_WEIGHT) || (defined(HAVE_DECL_PERF_SAMPLE_WEIGHT) && HAVE_DECL_PERF_SAMPLE_WEIGHT)) +#if defined(PERF_SAMPLE_WEIGHT) || (defined(HAVE_DECL_PERF_SAMPLE_WEIGHT) && HAVE_DECL_PERF_SAMPLE_WEIGHT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_WEIGHT) == (1 << 14), "PERF_SAMPLE_WEIGHT != 1 << 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_WEIGHT 1 << 14 #endif -#if !(defined(PERF_SAMPLE_DATA_SRC) || (defined(HAVE_DECL_PERF_SAMPLE_DATA_SRC) && HAVE_DECL_PERF_SAMPLE_DATA_SRC)) +#if defined(PERF_SAMPLE_DATA_SRC) || (defined(HAVE_DECL_PERF_SAMPLE_DATA_SRC) && HAVE_DECL_PERF_SAMPLE_DATA_SRC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_DATA_SRC) == (1 << 15), "PERF_SAMPLE_DATA_SRC != 1 << 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_DATA_SRC 1 << 15 #endif -#if !(defined(PERF_SAMPLE_IDENTIFIER) || (defined(HAVE_DECL_PERF_SAMPLE_IDENTIFIER) && HAVE_DECL_PERF_SAMPLE_IDENTIFIER)) +#if defined(PERF_SAMPLE_IDENTIFIER) || (defined(HAVE_DECL_PERF_SAMPLE_IDENTIFIER) && HAVE_DECL_PERF_SAMPLE_IDENTIFIER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_IDENTIFIER) == (1 << 16), "PERF_SAMPLE_IDENTIFIER != 1 << 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_IDENTIFIER 1 << 16 #endif -#if !(defined(PERF_SAMPLE_TRANSACTION) || (defined(HAVE_DECL_PERF_SAMPLE_TRANSACTION) && HAVE_DECL_PERF_SAMPLE_TRANSACTION)) +#if defined(PERF_SAMPLE_TRANSACTION) || (defined(HAVE_DECL_PERF_SAMPLE_TRANSACTION) && HAVE_DECL_PERF_SAMPLE_TRANSACTION) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_TRANSACTION) == (1 << 17), "PERF_SAMPLE_TRANSACTION != 1 << 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_TRANSACTION 1 << 17 #endif -#if !(defined(PERF_SAMPLE_REGS_INTR) || (defined(HAVE_DECL_PERF_SAMPLE_REGS_INTR) && HAVE_DECL_PERF_SAMPLE_REGS_INTR)) +#if defined(PERF_SAMPLE_REGS_INTR) || (defined(HAVE_DECL_PERF_SAMPLE_REGS_INTR) && HAVE_DECL_PERF_SAMPLE_REGS_INTR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_REGS_INTR) == (1 << 18), "PERF_SAMPLE_REGS_INTR != 1 << 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_SAMPLE_REGS_INTR 1 << 18 #endif +#if defined(PERF_SAMPLE_PHYS_ADDR) || (defined(HAVE_DECL_PERF_SAMPLE_PHYS_ADDR) && HAVE_DECL_PERF_SAMPLE_PHYS_ADDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_SAMPLE_PHYS_ADDR) == (1 << 19), "PERF_SAMPLE_PHYS_ADDR != 1 << 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PERF_SAMPLE_PHYS_ADDR 1 << 19 +#endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat perf_event_sample_format in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat perf_event_sample_format in mpers mode + +# else static const struct xlat perf_event_sample_format[] = { @@ -84,7 +173,10 @@ const struct xlat perf_event_sample_format[] = { XLAT(PERF_SAMPLE_IDENTIFIER), XLAT(PERF_SAMPLE_TRANSACTION), XLAT(PERF_SAMPLE_REGS_INTR), + XLAT(PERF_SAMPLE_PHYS_ADDR), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/perf_event_sample_format.in b/xlat/perf_event_sample_format.in index 6203e174..d310754e 100644 --- a/xlat/perf_event_sample_format.in +++ b/xlat/perf_event_sample_format.in @@ -17,3 +17,4 @@ PERF_SAMPLE_DATA_SRC 1 << 15 PERF_SAMPLE_IDENTIFIER 1 << 16 PERF_SAMPLE_TRANSACTION 1 << 17 PERF_SAMPLE_REGS_INTR 1 << 18 +PERF_SAMPLE_PHYS_ADDR 1 << 19 diff --git a/xlat/perf_hw_cache_id.h b/xlat/perf_hw_cache_id.h index bfcae9fa..04ef0585 100644 --- a/xlat/perf_hw_cache_id.h +++ b/xlat/perf_hw_cache_id.h @@ -1,34 +1,69 @@ /* Generated by ./xlat/gen.sh from ./xlat/perf_hw_cache_id.in; do not edit. */ -#if !(defined(PERF_COUNT_HW_CACHE_L1D) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_L1D) && HAVE_DECL_PERF_COUNT_HW_CACHE_L1D)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PERF_COUNT_HW_CACHE_L1D) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_L1D) && HAVE_DECL_PERF_COUNT_HW_CACHE_L1D) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_HW_CACHE_L1D) == (0), "PERF_COUNT_HW_CACHE_L1D != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_HW_CACHE_L1D 0 #endif -#if !(defined(PERF_COUNT_HW_CACHE_L1I) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_L1I) && HAVE_DECL_PERF_COUNT_HW_CACHE_L1I)) +#if defined(PERF_COUNT_HW_CACHE_L1I) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_L1I) && HAVE_DECL_PERF_COUNT_HW_CACHE_L1I) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_HW_CACHE_L1I) == (1), "PERF_COUNT_HW_CACHE_L1I != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_HW_CACHE_L1I 1 #endif -#if !(defined(PERF_COUNT_HW_CACHE_LL) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_LL) && HAVE_DECL_PERF_COUNT_HW_CACHE_LL)) +#if defined(PERF_COUNT_HW_CACHE_LL) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_LL) && HAVE_DECL_PERF_COUNT_HW_CACHE_LL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_HW_CACHE_LL) == (2), "PERF_COUNT_HW_CACHE_LL != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_HW_CACHE_LL 2 #endif -#if !(defined(PERF_COUNT_HW_CACHE_DTLB) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_DTLB) && HAVE_DECL_PERF_COUNT_HW_CACHE_DTLB)) +#if defined(PERF_COUNT_HW_CACHE_DTLB) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_DTLB) && HAVE_DECL_PERF_COUNT_HW_CACHE_DTLB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_HW_CACHE_DTLB) == (3), "PERF_COUNT_HW_CACHE_DTLB != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_HW_CACHE_DTLB 3 #endif -#if !(defined(PERF_COUNT_HW_CACHE_ITLB) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_ITLB) && HAVE_DECL_PERF_COUNT_HW_CACHE_ITLB)) +#if defined(PERF_COUNT_HW_CACHE_ITLB) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_ITLB) && HAVE_DECL_PERF_COUNT_HW_CACHE_ITLB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_HW_CACHE_ITLB) == (4), "PERF_COUNT_HW_CACHE_ITLB != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_HW_CACHE_ITLB 4 #endif -#if !(defined(PERF_COUNT_HW_CACHE_BPU) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_BPU) && HAVE_DECL_PERF_COUNT_HW_CACHE_BPU)) +#if defined(PERF_COUNT_HW_CACHE_BPU) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_BPU) && HAVE_DECL_PERF_COUNT_HW_CACHE_BPU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_HW_CACHE_BPU) == (5), "PERF_COUNT_HW_CACHE_BPU != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_HW_CACHE_BPU 5 #endif -#if !(defined(PERF_COUNT_HW_CACHE_NODE) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_NODE) && HAVE_DECL_PERF_COUNT_HW_CACHE_NODE)) +#if defined(PERF_COUNT_HW_CACHE_NODE) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_NODE) && HAVE_DECL_PERF_COUNT_HW_CACHE_NODE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_HW_CACHE_NODE) == (6), "PERF_COUNT_HW_CACHE_NODE != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_HW_CACHE_NODE 6 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat perf_hw_cache_id in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat perf_hw_cache_id in mpers mode + +# else static const struct xlat perf_hw_cache_id[] = { + XLAT(PERF_COUNT_HW_CACHE_L1D), XLAT(PERF_COUNT_HW_CACHE_L1I), XLAT(PERF_COUNT_HW_CACHE_LL), @@ -36,7 +71,9 @@ const struct xlat perf_hw_cache_id[] = { XLAT(PERF_COUNT_HW_CACHE_ITLB), XLAT(PERF_COUNT_HW_CACHE_BPU), XLAT(PERF_COUNT_HW_CACHE_NODE), - /* this array should remain not NULL-terminated */ + XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/perf_hw_cache_id.in b/xlat/perf_hw_cache_id.in index ecddcb0c..1ba0b1fc 100644 --- a/xlat/perf_hw_cache_id.in +++ b/xlat/perf_hw_cache_id.in @@ -1,3 +1,4 @@ +/* sort -k2,2n */ PERF_COUNT_HW_CACHE_L1D 0 PERF_COUNT_HW_CACHE_L1I 1 PERF_COUNT_HW_CACHE_LL 2 @@ -5,4 +6,3 @@ PERF_COUNT_HW_CACHE_DTLB 3 PERF_COUNT_HW_CACHE_ITLB 4 PERF_COUNT_HW_CACHE_BPU 5 PERF_COUNT_HW_CACHE_NODE 6 -#unterminated diff --git a/xlat/perf_hw_cache_op_id.h b/xlat/perf_hw_cache_op_id.h index 2274bc58..b0cadd32 100644 --- a/xlat/perf_hw_cache_op_id.h +++ b/xlat/perf_hw_cache_op_id.h @@ -1,26 +1,47 @@ /* Generated by ./xlat/gen.sh from ./xlat/perf_hw_cache_op_id.in; do not edit. */ -#if !(defined(PERF_COUNT_HW_CACHE_OP_READ) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_OP_READ) && HAVE_DECL_PERF_COUNT_HW_CACHE_OP_READ)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PERF_COUNT_HW_CACHE_OP_READ) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_OP_READ) && HAVE_DECL_PERF_COUNT_HW_CACHE_OP_READ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_HW_CACHE_OP_READ) == (0), "PERF_COUNT_HW_CACHE_OP_READ != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_HW_CACHE_OP_READ 0 #endif -#if !(defined(PERF_COUNT_HW_CACHE_OP_WRITE) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_OP_WRITE) && HAVE_DECL_PERF_COUNT_HW_CACHE_OP_WRITE)) +#if defined(PERF_COUNT_HW_CACHE_OP_WRITE) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_OP_WRITE) && HAVE_DECL_PERF_COUNT_HW_CACHE_OP_WRITE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_HW_CACHE_OP_WRITE) == (1), "PERF_COUNT_HW_CACHE_OP_WRITE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_HW_CACHE_OP_WRITE 1 #endif -#if !(defined(PERF_COUNT_HW_CACHE_OP_PREFETCH) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_OP_PREFETCH) && HAVE_DECL_PERF_COUNT_HW_CACHE_OP_PREFETCH)) +#if defined(PERF_COUNT_HW_CACHE_OP_PREFETCH) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_OP_PREFETCH) && HAVE_DECL_PERF_COUNT_HW_CACHE_OP_PREFETCH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_HW_CACHE_OP_PREFETCH) == (2), "PERF_COUNT_HW_CACHE_OP_PREFETCH != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_HW_CACHE_OP_PREFETCH 2 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat perf_hw_cache_op_id in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat perf_hw_cache_op_id in mpers mode + +# else static const struct xlat perf_hw_cache_op_id[] = { + XLAT(PERF_COUNT_HW_CACHE_OP_READ), XLAT(PERF_COUNT_HW_CACHE_OP_WRITE), XLAT(PERF_COUNT_HW_CACHE_OP_PREFETCH), - /* this array should remain not NULL-terminated */ + XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/perf_hw_cache_op_id.in b/xlat/perf_hw_cache_op_id.in index 8a46e0d7..7e30c3ad 100644 --- a/xlat/perf_hw_cache_op_id.in +++ b/xlat/perf_hw_cache_op_id.in @@ -1,4 +1,4 @@ +/* sort -k2,2n */ PERF_COUNT_HW_CACHE_OP_READ 0 PERF_COUNT_HW_CACHE_OP_WRITE 1 PERF_COUNT_HW_CACHE_OP_PREFETCH 2 -#unterminated diff --git a/xlat/perf_hw_cache_op_result_id.h b/xlat/perf_hw_cache_op_result_id.h index d5457516..c026ce88 100644 --- a/xlat/perf_hw_cache_op_result_id.h +++ b/xlat/perf_hw_cache_op_result_id.h @@ -1,22 +1,39 @@ /* Generated by ./xlat/gen.sh from ./xlat/perf_hw_cache_op_result_id.in; do not edit. */ -#if !(defined(PERF_COUNT_HW_CACHE_RESULT_ACCESS) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_RESULT_ACCESS) && HAVE_DECL_PERF_COUNT_HW_CACHE_RESULT_ACCESS)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PERF_COUNT_HW_CACHE_RESULT_ACCESS) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_RESULT_ACCESS) && HAVE_DECL_PERF_COUNT_HW_CACHE_RESULT_ACCESS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_HW_CACHE_RESULT_ACCESS) == (0), "PERF_COUNT_HW_CACHE_RESULT_ACCESS != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_HW_CACHE_RESULT_ACCESS 0 #endif -#if !(defined(PERF_COUNT_HW_CACHE_RESULT_MISS) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_RESULT_MISS) && HAVE_DECL_PERF_COUNT_HW_CACHE_RESULT_MISS)) +#if defined(PERF_COUNT_HW_CACHE_RESULT_MISS) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_RESULT_MISS) && HAVE_DECL_PERF_COUNT_HW_CACHE_RESULT_MISS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_HW_CACHE_RESULT_MISS) == (1), "PERF_COUNT_HW_CACHE_RESULT_MISS != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_HW_CACHE_RESULT_MISS 1 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat perf_hw_cache_op_result_id in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat perf_hw_cache_op_result_id in mpers mode + +# else static const struct xlat perf_hw_cache_op_result_id[] = { + XLAT(PERF_COUNT_HW_CACHE_RESULT_ACCESS), XLAT(PERF_COUNT_HW_CACHE_RESULT_MISS), - /* this array should remain not NULL-terminated */ + XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/perf_hw_cache_op_result_id.in b/xlat/perf_hw_cache_op_result_id.in index d2a77f5a..07505465 100644 --- a/xlat/perf_hw_cache_op_result_id.in +++ b/xlat/perf_hw_cache_op_result_id.in @@ -1,3 +1,3 @@ +/* sort -k2,2n */ PERF_COUNT_HW_CACHE_RESULT_ACCESS 0 PERF_COUNT_HW_CACHE_RESULT_MISS 1 -#unterminated diff --git a/xlat/perf_hw_id.h b/xlat/perf_hw_id.h index 52384862..8c71a546 100644 --- a/xlat/perf_hw_id.h +++ b/xlat/perf_hw_id.h @@ -1,43 +1,90 @@ /* Generated by ./xlat/gen.sh from ./xlat/perf_hw_id.in; do not edit. */ -#if !(defined(PERF_COUNT_HW_CPU_CYCLES) || (defined(HAVE_DECL_PERF_COUNT_HW_CPU_CYCLES) && HAVE_DECL_PERF_COUNT_HW_CPU_CYCLES)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PERF_COUNT_HW_CPU_CYCLES) || (defined(HAVE_DECL_PERF_COUNT_HW_CPU_CYCLES) && HAVE_DECL_PERF_COUNT_HW_CPU_CYCLES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_HW_CPU_CYCLES) == (0), "PERF_COUNT_HW_CPU_CYCLES != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_HW_CPU_CYCLES 0 #endif -#if !(defined(PERF_COUNT_HW_INSTRUCTIONS) || (defined(HAVE_DECL_PERF_COUNT_HW_INSTRUCTIONS) && HAVE_DECL_PERF_COUNT_HW_INSTRUCTIONS)) +#if defined(PERF_COUNT_HW_INSTRUCTIONS) || (defined(HAVE_DECL_PERF_COUNT_HW_INSTRUCTIONS) && HAVE_DECL_PERF_COUNT_HW_INSTRUCTIONS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_HW_INSTRUCTIONS) == (1), "PERF_COUNT_HW_INSTRUCTIONS != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_HW_INSTRUCTIONS 1 #endif -#if !(defined(PERF_COUNT_HW_CACHE_REFERENCES) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_REFERENCES) && HAVE_DECL_PERF_COUNT_HW_CACHE_REFERENCES)) +#if defined(PERF_COUNT_HW_CACHE_REFERENCES) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_REFERENCES) && HAVE_DECL_PERF_COUNT_HW_CACHE_REFERENCES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_HW_CACHE_REFERENCES) == (2), "PERF_COUNT_HW_CACHE_REFERENCES != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_HW_CACHE_REFERENCES 2 #endif -#if !(defined(PERF_COUNT_HW_CACHE_MISSES) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_MISSES) && HAVE_DECL_PERF_COUNT_HW_CACHE_MISSES)) +#if defined(PERF_COUNT_HW_CACHE_MISSES) || (defined(HAVE_DECL_PERF_COUNT_HW_CACHE_MISSES) && HAVE_DECL_PERF_COUNT_HW_CACHE_MISSES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_HW_CACHE_MISSES) == (3), "PERF_COUNT_HW_CACHE_MISSES != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_HW_CACHE_MISSES 3 #endif -#if !(defined(PERF_COUNT_HW_BRANCH_INSTRUCTIONS) || (defined(HAVE_DECL_PERF_COUNT_HW_BRANCH_INSTRUCTIONS) && HAVE_DECL_PERF_COUNT_HW_BRANCH_INSTRUCTIONS)) +#if defined(PERF_COUNT_HW_BRANCH_INSTRUCTIONS) || (defined(HAVE_DECL_PERF_COUNT_HW_BRANCH_INSTRUCTIONS) && HAVE_DECL_PERF_COUNT_HW_BRANCH_INSTRUCTIONS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_HW_BRANCH_INSTRUCTIONS) == (4), "PERF_COUNT_HW_BRANCH_INSTRUCTIONS != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_HW_BRANCH_INSTRUCTIONS 4 #endif -#if !(defined(PERF_COUNT_HW_BRANCH_MISSES) || (defined(HAVE_DECL_PERF_COUNT_HW_BRANCH_MISSES) && HAVE_DECL_PERF_COUNT_HW_BRANCH_MISSES)) +#if defined(PERF_COUNT_HW_BRANCH_MISSES) || (defined(HAVE_DECL_PERF_COUNT_HW_BRANCH_MISSES) && HAVE_DECL_PERF_COUNT_HW_BRANCH_MISSES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_HW_BRANCH_MISSES) == (5), "PERF_COUNT_HW_BRANCH_MISSES != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_HW_BRANCH_MISSES 5 #endif -#if !(defined(PERF_COUNT_HW_BUS_CYCLES) || (defined(HAVE_DECL_PERF_COUNT_HW_BUS_CYCLES) && HAVE_DECL_PERF_COUNT_HW_BUS_CYCLES)) +#if defined(PERF_COUNT_HW_BUS_CYCLES) || (defined(HAVE_DECL_PERF_COUNT_HW_BUS_CYCLES) && HAVE_DECL_PERF_COUNT_HW_BUS_CYCLES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_HW_BUS_CYCLES) == (6), "PERF_COUNT_HW_BUS_CYCLES != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_HW_BUS_CYCLES 6 #endif -#if !(defined(PERF_COUNT_HW_STALLED_CYCLES_FRONTEND) || (defined(HAVE_DECL_PERF_COUNT_HW_STALLED_CYCLES_FRONTEND) && HAVE_DECL_PERF_COUNT_HW_STALLED_CYCLES_FRONTEND)) +#if defined(PERF_COUNT_HW_STALLED_CYCLES_FRONTEND) || (defined(HAVE_DECL_PERF_COUNT_HW_STALLED_CYCLES_FRONTEND) && HAVE_DECL_PERF_COUNT_HW_STALLED_CYCLES_FRONTEND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_HW_STALLED_CYCLES_FRONTEND) == (7), "PERF_COUNT_HW_STALLED_CYCLES_FRONTEND != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_HW_STALLED_CYCLES_FRONTEND 7 #endif -#if !(defined(PERF_COUNT_HW_STALLED_CYCLES_BACKEND) || (defined(HAVE_DECL_PERF_COUNT_HW_STALLED_CYCLES_BACKEND) && HAVE_DECL_PERF_COUNT_HW_STALLED_CYCLES_BACKEND)) +#if defined(PERF_COUNT_HW_STALLED_CYCLES_BACKEND) || (defined(HAVE_DECL_PERF_COUNT_HW_STALLED_CYCLES_BACKEND) && HAVE_DECL_PERF_COUNT_HW_STALLED_CYCLES_BACKEND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_HW_STALLED_CYCLES_BACKEND) == (8), "PERF_COUNT_HW_STALLED_CYCLES_BACKEND != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_HW_STALLED_CYCLES_BACKEND 8 #endif -#if !(defined(PERF_COUNT_HW_REF_CPU_CYCLES) || (defined(HAVE_DECL_PERF_COUNT_HW_REF_CPU_CYCLES) && HAVE_DECL_PERF_COUNT_HW_REF_CPU_CYCLES)) +#if defined(PERF_COUNT_HW_REF_CPU_CYCLES) || (defined(HAVE_DECL_PERF_COUNT_HW_REF_CPU_CYCLES) && HAVE_DECL_PERF_COUNT_HW_REF_CPU_CYCLES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_HW_REF_CPU_CYCLES) == (9), "PERF_COUNT_HW_REF_CPU_CYCLES != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_HW_REF_CPU_CYCLES 9 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat perf_hw_id in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat perf_hw_id in mpers mode + +# else static const struct xlat perf_hw_id[] = { + XLAT(PERF_COUNT_HW_CPU_CYCLES), XLAT(PERF_COUNT_HW_INSTRUCTIONS), XLAT(PERF_COUNT_HW_CACHE_REFERENCES), @@ -48,7 +95,9 @@ const struct xlat perf_hw_id[] = { XLAT(PERF_COUNT_HW_STALLED_CYCLES_FRONTEND), XLAT(PERF_COUNT_HW_STALLED_CYCLES_BACKEND), XLAT(PERF_COUNT_HW_REF_CPU_CYCLES), - /* this array should remain not NULL-terminated */ + XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/perf_hw_id.in b/xlat/perf_hw_id.in index a642d0b4..c46bcecd 100644 --- a/xlat/perf_hw_id.in +++ b/xlat/perf_hw_id.in @@ -1,3 +1,4 @@ +/* sort -k2,2n */ PERF_COUNT_HW_CPU_CYCLES 0 PERF_COUNT_HW_INSTRUCTIONS 1 PERF_COUNT_HW_CACHE_REFERENCES 2 @@ -8,4 +9,3 @@ PERF_COUNT_HW_BUS_CYCLES 6 PERF_COUNT_HW_STALLED_CYCLES_FRONTEND 7 PERF_COUNT_HW_STALLED_CYCLES_BACKEND 8 PERF_COUNT_HW_REF_CPU_CYCLES 9 -#unterminated diff --git a/xlat/perf_ioctl_cmds.h b/xlat/perf_ioctl_cmds.h new file mode 100644 index 00000000..d3f2a09a --- /dev/null +++ b/xlat/perf_ioctl_cmds.h @@ -0,0 +1,120 @@ +/* Generated by ./xlat/gen.sh from ./xlat/perf_ioctl_cmds.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PERF_EVENT_IOC_ENABLE) || (defined(HAVE_DECL_PERF_EVENT_IOC_ENABLE) && HAVE_DECL_PERF_EVENT_IOC_ENABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_EVENT_IOC_ENABLE) == (_IO ('$', 0)), "PERF_EVENT_IOC_ENABLE != _IO ('$', 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PERF_EVENT_IOC_ENABLE _IO ('$', 0) +#endif +#if defined(PERF_EVENT_IOC_DISABLE) || (defined(HAVE_DECL_PERF_EVENT_IOC_DISABLE) && HAVE_DECL_PERF_EVENT_IOC_DISABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_EVENT_IOC_DISABLE) == (_IO ('$', 1)), "PERF_EVENT_IOC_DISABLE != _IO ('$', 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PERF_EVENT_IOC_DISABLE _IO ('$', 1) +#endif +#if defined(PERF_EVENT_IOC_REFRESH) || (defined(HAVE_DECL_PERF_EVENT_IOC_REFRESH) && HAVE_DECL_PERF_EVENT_IOC_REFRESH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_EVENT_IOC_REFRESH) == (_IO ('$', 2)), "PERF_EVENT_IOC_REFRESH != _IO ('$', 2)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PERF_EVENT_IOC_REFRESH _IO ('$', 2) +#endif +#if defined(PERF_EVENT_IOC_RESET) || (defined(HAVE_DECL_PERF_EVENT_IOC_RESET) && HAVE_DECL_PERF_EVENT_IOC_RESET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_EVENT_IOC_RESET) == (_IO ('$', 3)), "PERF_EVENT_IOC_RESET != _IO ('$', 3)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PERF_EVENT_IOC_RESET _IO ('$', 3) +#endif +#if defined(PERF_EVENT_IOC_PERIOD) || (defined(HAVE_DECL_PERF_EVENT_IOC_PERIOD) && HAVE_DECL_PERF_EVENT_IOC_PERIOD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_EVENT_IOC_PERIOD) == (_IOW('$', 4, uint64_t)), "PERF_EVENT_IOC_PERIOD != _IOW('$', 4, uint64_t)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PERF_EVENT_IOC_PERIOD _IOW('$', 4, uint64_t) +#endif +#if defined(PERF_EVENT_IOC_SET_OUTPUT) || (defined(HAVE_DECL_PERF_EVENT_IOC_SET_OUTPUT) && HAVE_DECL_PERF_EVENT_IOC_SET_OUTPUT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_EVENT_IOC_SET_OUTPUT) == (_IO ('$', 5)), "PERF_EVENT_IOC_SET_OUTPUT != _IO ('$', 5)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5) +#endif +#if defined(PERF_EVENT_IOC_SET_FILTER) || (defined(HAVE_DECL_PERF_EVENT_IOC_SET_FILTER) && HAVE_DECL_PERF_EVENT_IOC_SET_FILTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_EVENT_IOC_SET_FILTER) == (_IOW('$', 6, char *)), "PERF_EVENT_IOC_SET_FILTER != _IOW('$', 6, char *)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *) +#endif +#if defined(PERF_EVENT_IOC_ID) || (defined(HAVE_DECL_PERF_EVENT_IOC_ID) && HAVE_DECL_PERF_EVENT_IOC_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_EVENT_IOC_ID) == (_IOR('$', 7, uint64_t *)), "PERF_EVENT_IOC_ID != _IOR('$', 7, uint64_t *)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PERF_EVENT_IOC_ID _IOR('$', 7, uint64_t *) +#endif +#if defined(PERF_EVENT_IOC_SET_BPF) || (defined(HAVE_DECL_PERF_EVENT_IOC_SET_BPF) && HAVE_DECL_PERF_EVENT_IOC_SET_BPF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_EVENT_IOC_SET_BPF) == (_IOW('$', 8, uint32_t)), "PERF_EVENT_IOC_SET_BPF != _IOW('$', 8, uint32_t)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PERF_EVENT_IOC_SET_BPF _IOW('$', 8, uint32_t) +#endif +#if defined(PERF_EVENT_IOC_PAUSE_OUTPUT) || (defined(HAVE_DECL_PERF_EVENT_IOC_PAUSE_OUTPUT) && HAVE_DECL_PERF_EVENT_IOC_PAUSE_OUTPUT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_EVENT_IOC_PAUSE_OUTPUT) == (_IOW('$', 9, uint32_t)), "PERF_EVENT_IOC_PAUSE_OUTPUT != _IOW('$', 9, uint32_t)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PERF_EVENT_IOC_PAUSE_OUTPUT _IOW('$', 9, uint32_t) +#endif +#if defined(PERF_EVENT_IOC_QUERY_BPF) || (defined(HAVE_DECL_PERF_EVENT_IOC_QUERY_BPF) && HAVE_DECL_PERF_EVENT_IOC_QUERY_BPF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_EVENT_IOC_QUERY_BPF) == (_IOWR('$', 10, struct perf_event_query_bpf *)), "PERF_EVENT_IOC_QUERY_BPF != _IOWR('$', 10, struct perf_event_query_bpf *)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PERF_EVENT_IOC_QUERY_BPF _IOWR('$', 10, struct perf_event_query_bpf *) +#endif +#if defined(PERF_EVENT_IOC_MODIFY_ATTRIBUTES) || (defined(HAVE_DECL_PERF_EVENT_IOC_MODIFY_ATTRIBUTES) && HAVE_DECL_PERF_EVENT_IOC_MODIFY_ATTRIBUTES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_EVENT_IOC_MODIFY_ATTRIBUTES) == (_IOW('$', 11, struct perf_event_attr *)), "PERF_EVENT_IOC_MODIFY_ATTRIBUTES != _IOW('$', 11, struct perf_event_attr *)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PERF_EVENT_IOC_MODIFY_ATTRIBUTES _IOW('$', 11, struct perf_event_attr *) +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +extern const struct xlat perf_ioctl_cmds[]; + +# else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat perf_ioctl_cmds[] = { + XLAT(PERF_EVENT_IOC_ENABLE), + XLAT(PERF_EVENT_IOC_DISABLE), + XLAT(PERF_EVENT_IOC_REFRESH), + XLAT(PERF_EVENT_IOC_RESET), + XLAT(PERF_EVENT_IOC_PERIOD), + XLAT(PERF_EVENT_IOC_SET_OUTPUT), + XLAT(PERF_EVENT_IOC_SET_FILTER), + XLAT(PERF_EVENT_IOC_ID), + XLAT(PERF_EVENT_IOC_SET_BPF), + XLAT(PERF_EVENT_IOC_PAUSE_OUTPUT), + XLAT(PERF_EVENT_IOC_QUERY_BPF), + XLAT(PERF_EVENT_IOC_MODIFY_ATTRIBUTES), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/perf_ioctl_cmds.in b/xlat/perf_ioctl_cmds.in new file mode 100644 index 00000000..bf7ad78a --- /dev/null +++ b/xlat/perf_ioctl_cmds.in @@ -0,0 +1,12 @@ +PERF_EVENT_IOC_ENABLE _IO ('$', 0) +PERF_EVENT_IOC_DISABLE _IO ('$', 1) +PERF_EVENT_IOC_REFRESH _IO ('$', 2) +PERF_EVENT_IOC_RESET _IO ('$', 3) +PERF_EVENT_IOC_PERIOD _IOW('$', 4, uint64_t) +PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5) +PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *) +PERF_EVENT_IOC_ID _IOR('$', 7, uint64_t *) +PERF_EVENT_IOC_SET_BPF _IOW('$', 8, uint32_t) +PERF_EVENT_IOC_PAUSE_OUTPUT _IOW('$', 9, uint32_t) +PERF_EVENT_IOC_QUERY_BPF _IOWR('$', 10, struct perf_event_query_bpf *) +PERF_EVENT_IOC_MODIFY_ATTRIBUTES _IOW('$', 11, struct perf_event_attr *) diff --git a/xlat/perf_ioctl_flags.h b/xlat/perf_ioctl_flags.h new file mode 100644 index 00000000..de3883aa --- /dev/null +++ b/xlat/perf_ioctl_flags.h @@ -0,0 +1,32 @@ +/* Generated by ./xlat/gen.sh from ./xlat/perf_ioctl_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PERF_IOC_FLAG_GROUP) || (defined(HAVE_DECL_PERF_IOC_FLAG_GROUP) && HAVE_DECL_PERF_IOC_FLAG_GROUP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_IOC_FLAG_GROUP) == ((1U << 0)), "PERF_IOC_FLAG_GROUP != (1U << 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PERF_IOC_FLAG_GROUP (1U << 0) +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +extern const struct xlat perf_ioctl_flags[]; + +# else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat perf_ioctl_flags[] = { + XLAT(PERF_IOC_FLAG_GROUP), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/perf_ioctl_flags.in b/xlat/perf_ioctl_flags.in new file mode 100644 index 00000000..502f69a7 --- /dev/null +++ b/xlat/perf_ioctl_flags.in @@ -0,0 +1 @@ +PERF_IOC_FLAG_GROUP (1U << 0) diff --git a/xlat/perf_sw_ids.h b/xlat/perf_sw_ids.h index b29b547b..ecf0f83f 100644 --- a/xlat/perf_sw_ids.h +++ b/xlat/perf_sw_ids.h @@ -1,46 +1,97 @@ /* Generated by ./xlat/gen.sh from ./xlat/perf_sw_ids.in; do not edit. */ -#if !(defined(PERF_COUNT_SW_CPU_CLOCK) || (defined(HAVE_DECL_PERF_COUNT_SW_CPU_CLOCK) && HAVE_DECL_PERF_COUNT_SW_CPU_CLOCK)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PERF_COUNT_SW_CPU_CLOCK) || (defined(HAVE_DECL_PERF_COUNT_SW_CPU_CLOCK) && HAVE_DECL_PERF_COUNT_SW_CPU_CLOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_SW_CPU_CLOCK) == (0), "PERF_COUNT_SW_CPU_CLOCK != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_SW_CPU_CLOCK 0 #endif -#if !(defined(PERF_COUNT_SW_TASK_CLOCK) || (defined(HAVE_DECL_PERF_COUNT_SW_TASK_CLOCK) && HAVE_DECL_PERF_COUNT_SW_TASK_CLOCK)) +#if defined(PERF_COUNT_SW_TASK_CLOCK) || (defined(HAVE_DECL_PERF_COUNT_SW_TASK_CLOCK) && HAVE_DECL_PERF_COUNT_SW_TASK_CLOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_SW_TASK_CLOCK) == (1), "PERF_COUNT_SW_TASK_CLOCK != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_SW_TASK_CLOCK 1 #endif -#if !(defined(PERF_COUNT_SW_PAGE_FAULTS) || (defined(HAVE_DECL_PERF_COUNT_SW_PAGE_FAULTS) && HAVE_DECL_PERF_COUNT_SW_PAGE_FAULTS)) +#if defined(PERF_COUNT_SW_PAGE_FAULTS) || (defined(HAVE_DECL_PERF_COUNT_SW_PAGE_FAULTS) && HAVE_DECL_PERF_COUNT_SW_PAGE_FAULTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_SW_PAGE_FAULTS) == (2), "PERF_COUNT_SW_PAGE_FAULTS != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_SW_PAGE_FAULTS 2 #endif -#if !(defined(PERF_COUNT_SW_CONTEXT_SWITCHES) || (defined(HAVE_DECL_PERF_COUNT_SW_CONTEXT_SWITCHES) && HAVE_DECL_PERF_COUNT_SW_CONTEXT_SWITCHES)) +#if defined(PERF_COUNT_SW_CONTEXT_SWITCHES) || (defined(HAVE_DECL_PERF_COUNT_SW_CONTEXT_SWITCHES) && HAVE_DECL_PERF_COUNT_SW_CONTEXT_SWITCHES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_SW_CONTEXT_SWITCHES) == (3), "PERF_COUNT_SW_CONTEXT_SWITCHES != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_SW_CONTEXT_SWITCHES 3 #endif -#if !(defined(PERF_COUNT_SW_CPU_MIGRATIONS) || (defined(HAVE_DECL_PERF_COUNT_SW_CPU_MIGRATIONS) && HAVE_DECL_PERF_COUNT_SW_CPU_MIGRATIONS)) +#if defined(PERF_COUNT_SW_CPU_MIGRATIONS) || (defined(HAVE_DECL_PERF_COUNT_SW_CPU_MIGRATIONS) && HAVE_DECL_PERF_COUNT_SW_CPU_MIGRATIONS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_SW_CPU_MIGRATIONS) == (4), "PERF_COUNT_SW_CPU_MIGRATIONS != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_SW_CPU_MIGRATIONS 4 #endif -#if !(defined(PERF_COUNT_SW_PAGE_FAULTS_MIN) || (defined(HAVE_DECL_PERF_COUNT_SW_PAGE_FAULTS_MIN) && HAVE_DECL_PERF_COUNT_SW_PAGE_FAULTS_MIN)) +#if defined(PERF_COUNT_SW_PAGE_FAULTS_MIN) || (defined(HAVE_DECL_PERF_COUNT_SW_PAGE_FAULTS_MIN) && HAVE_DECL_PERF_COUNT_SW_PAGE_FAULTS_MIN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_SW_PAGE_FAULTS_MIN) == (5), "PERF_COUNT_SW_PAGE_FAULTS_MIN != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_SW_PAGE_FAULTS_MIN 5 #endif -#if !(defined(PERF_COUNT_SW_PAGE_FAULTS_MAJ) || (defined(HAVE_DECL_PERF_COUNT_SW_PAGE_FAULTS_MAJ) && HAVE_DECL_PERF_COUNT_SW_PAGE_FAULTS_MAJ)) +#if defined(PERF_COUNT_SW_PAGE_FAULTS_MAJ) || (defined(HAVE_DECL_PERF_COUNT_SW_PAGE_FAULTS_MAJ) && HAVE_DECL_PERF_COUNT_SW_PAGE_FAULTS_MAJ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_SW_PAGE_FAULTS_MAJ) == (6), "PERF_COUNT_SW_PAGE_FAULTS_MAJ != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_SW_PAGE_FAULTS_MAJ 6 #endif -#if !(defined(PERF_COUNT_SW_ALIGNMENT_FAULTS) || (defined(HAVE_DECL_PERF_COUNT_SW_ALIGNMENT_FAULTS) && HAVE_DECL_PERF_COUNT_SW_ALIGNMENT_FAULTS)) +#if defined(PERF_COUNT_SW_ALIGNMENT_FAULTS) || (defined(HAVE_DECL_PERF_COUNT_SW_ALIGNMENT_FAULTS) && HAVE_DECL_PERF_COUNT_SW_ALIGNMENT_FAULTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_SW_ALIGNMENT_FAULTS) == (7), "PERF_COUNT_SW_ALIGNMENT_FAULTS != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_SW_ALIGNMENT_FAULTS 7 #endif -#if !(defined(PERF_COUNT_SW_EMULATION_FAULTS) || (defined(HAVE_DECL_PERF_COUNT_SW_EMULATION_FAULTS) && HAVE_DECL_PERF_COUNT_SW_EMULATION_FAULTS)) +#if defined(PERF_COUNT_SW_EMULATION_FAULTS) || (defined(HAVE_DECL_PERF_COUNT_SW_EMULATION_FAULTS) && HAVE_DECL_PERF_COUNT_SW_EMULATION_FAULTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_SW_EMULATION_FAULTS) == (8), "PERF_COUNT_SW_EMULATION_FAULTS != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_SW_EMULATION_FAULTS 8 #endif -#if !(defined(PERF_COUNT_SW_DUMMY) || (defined(HAVE_DECL_PERF_COUNT_SW_DUMMY) && HAVE_DECL_PERF_COUNT_SW_DUMMY)) +#if defined(PERF_COUNT_SW_DUMMY) || (defined(HAVE_DECL_PERF_COUNT_SW_DUMMY) && HAVE_DECL_PERF_COUNT_SW_DUMMY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_SW_DUMMY) == (9), "PERF_COUNT_SW_DUMMY != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_SW_DUMMY 9 #endif -#if !(defined(PERF_COUNT_SW_BPF_OUTPUT) || (defined(HAVE_DECL_PERF_COUNT_SW_BPF_OUTPUT) && HAVE_DECL_PERF_COUNT_SW_BPF_OUTPUT)) +#if defined(PERF_COUNT_SW_BPF_OUTPUT) || (defined(HAVE_DECL_PERF_COUNT_SW_BPF_OUTPUT) && HAVE_DECL_PERF_COUNT_SW_BPF_OUTPUT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_COUNT_SW_BPF_OUTPUT) == (10), "PERF_COUNT_SW_BPF_OUTPUT != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_COUNT_SW_BPF_OUTPUT 10 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat perf_sw_ids in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat perf_sw_ids in mpers mode + +# else static const struct xlat perf_sw_ids[] = { + XLAT(PERF_COUNT_SW_CPU_CLOCK), XLAT(PERF_COUNT_SW_TASK_CLOCK), XLAT(PERF_COUNT_SW_PAGE_FAULTS), @@ -52,7 +103,9 @@ const struct xlat perf_sw_ids[] = { XLAT(PERF_COUNT_SW_EMULATION_FAULTS), XLAT(PERF_COUNT_SW_DUMMY), XLAT(PERF_COUNT_SW_BPF_OUTPUT), - /* this array should remain not NULL-terminated */ + XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/perf_sw_ids.in b/xlat/perf_sw_ids.in index 95ca15c4..e2ad8a8c 100644 --- a/xlat/perf_sw_ids.in +++ b/xlat/perf_sw_ids.in @@ -1,3 +1,4 @@ +/* sort -k2,2n */ PERF_COUNT_SW_CPU_CLOCK 0 PERF_COUNT_SW_TASK_CLOCK 1 PERF_COUNT_SW_PAGE_FAULTS 2 @@ -9,4 +10,3 @@ PERF_COUNT_SW_ALIGNMENT_FAULTS 7 PERF_COUNT_SW_EMULATION_FAULTS 8 PERF_COUNT_SW_DUMMY 9 PERF_COUNT_SW_BPF_OUTPUT 10 -#unterminated diff --git a/xlat/perf_type_id.h b/xlat/perf_type_id.h index edf62168..bbe5c581 100644 --- a/xlat/perf_type_id.h +++ b/xlat/perf_type_id.h @@ -1,38 +1,71 @@ /* Generated by ./xlat/gen.sh from ./xlat/perf_type_id.in; do not edit. */ -#if !(defined(PERF_TYPE_HARDWARE) || (defined(HAVE_DECL_PERF_TYPE_HARDWARE) && HAVE_DECL_PERF_TYPE_HARDWARE)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PERF_TYPE_HARDWARE) || (defined(HAVE_DECL_PERF_TYPE_HARDWARE) && HAVE_DECL_PERF_TYPE_HARDWARE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_TYPE_HARDWARE) == (0), "PERF_TYPE_HARDWARE != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_TYPE_HARDWARE 0 #endif -#if !(defined(PERF_TYPE_SOFTWARE) || (defined(HAVE_DECL_PERF_TYPE_SOFTWARE) && HAVE_DECL_PERF_TYPE_SOFTWARE)) +#if defined(PERF_TYPE_SOFTWARE) || (defined(HAVE_DECL_PERF_TYPE_SOFTWARE) && HAVE_DECL_PERF_TYPE_SOFTWARE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_TYPE_SOFTWARE) == (1), "PERF_TYPE_SOFTWARE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_TYPE_SOFTWARE 1 #endif -#if !(defined(PERF_TYPE_TRACEPOINT) || (defined(HAVE_DECL_PERF_TYPE_TRACEPOINT) && HAVE_DECL_PERF_TYPE_TRACEPOINT)) +#if defined(PERF_TYPE_TRACEPOINT) || (defined(HAVE_DECL_PERF_TYPE_TRACEPOINT) && HAVE_DECL_PERF_TYPE_TRACEPOINT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_TYPE_TRACEPOINT) == (2), "PERF_TYPE_TRACEPOINT != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_TYPE_TRACEPOINT 2 #endif -#if !(defined(PERF_TYPE_HW_CACHE) || (defined(HAVE_DECL_PERF_TYPE_HW_CACHE) && HAVE_DECL_PERF_TYPE_HW_CACHE)) +#if defined(PERF_TYPE_HW_CACHE) || (defined(HAVE_DECL_PERF_TYPE_HW_CACHE) && HAVE_DECL_PERF_TYPE_HW_CACHE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_TYPE_HW_CACHE) == (3), "PERF_TYPE_HW_CACHE != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_TYPE_HW_CACHE 3 #endif -#if !(defined(PERF_TYPE_RAW) || (defined(HAVE_DECL_PERF_TYPE_RAW) && HAVE_DECL_PERF_TYPE_RAW)) +#if defined(PERF_TYPE_RAW) || (defined(HAVE_DECL_PERF_TYPE_RAW) && HAVE_DECL_PERF_TYPE_RAW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_TYPE_RAW) == (4), "PERF_TYPE_RAW != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_TYPE_RAW 4 #endif -#if !(defined(PERF_TYPE_BREAKPOINT) || (defined(HAVE_DECL_PERF_TYPE_BREAKPOINT) && HAVE_DECL_PERF_TYPE_BREAKPOINT)) +#if defined(PERF_TYPE_BREAKPOINT) || (defined(HAVE_DECL_PERF_TYPE_BREAKPOINT) && HAVE_DECL_PERF_TYPE_BREAKPOINT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PERF_TYPE_BREAKPOINT) == (5), "PERF_TYPE_BREAKPOINT != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PERF_TYPE_BREAKPOINT 5 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat perf_type_id in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat perf_type_id in mpers mode + +# else static const struct xlat perf_type_id[] = { + XLAT(PERF_TYPE_HARDWARE), XLAT(PERF_TYPE_SOFTWARE), XLAT(PERF_TYPE_TRACEPOINT), XLAT(PERF_TYPE_HW_CACHE), XLAT(PERF_TYPE_RAW), XLAT(PERF_TYPE_BREAKPOINT), - /* this array should remain not NULL-terminated */ + XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/perf_type_id.in b/xlat/perf_type_id.in index 9133e74d..88f63381 100644 --- a/xlat/perf_type_id.in +++ b/xlat/perf_type_id.in @@ -1,7 +1,7 @@ +/* sort -k2,2n */ PERF_TYPE_HARDWARE 0 PERF_TYPE_SOFTWARE 1 PERF_TYPE_TRACEPOINT 2 PERF_TYPE_HW_CACHE 3 PERF_TYPE_RAW 4 PERF_TYPE_BREAKPOINT 5 -#unterminated diff --git a/xlat/personality_flags.h b/xlat/personality_flags.h index 1941e146..4b2a3693 100644 --- a/xlat/personality_flags.h +++ b/xlat/personality_flags.h @@ -1,10 +1,93 @@ /* Generated by ./xlat/gen.sh from ./xlat/personality_flags.in; do not edit. */ -#ifdef IN_MPERS - -# error static const struct xlat personality_flags in mpers mode +#include "gcc_compat.h" +#include "static_assert.h" +#if defined(UNAME26) || (defined(HAVE_DECL_UNAME26) && HAVE_DECL_UNAME26) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((UNAME26) == (0x0020000), "UNAME26 != 0x0020000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define UNAME26 0x0020000 +#endif +#if defined(ADDR_NO_RANDOMIZE) || (defined(HAVE_DECL_ADDR_NO_RANDOMIZE) && HAVE_DECL_ADDR_NO_RANDOMIZE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ADDR_NO_RANDOMIZE) == (0x0040000), "ADDR_NO_RANDOMIZE != 0x0040000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ADDR_NO_RANDOMIZE 0x0040000 +#endif +#if defined(FDPIC_FUNCPTRS) || (defined(HAVE_DECL_FDPIC_FUNCPTRS) && HAVE_DECL_FDPIC_FUNCPTRS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FDPIC_FUNCPTRS) == (0x0080000), "FDPIC_FUNCPTRS != 0x0080000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FDPIC_FUNCPTRS 0x0080000 +#endif +#if defined(MMAP_PAGE_ZERO) || (defined(HAVE_DECL_MMAP_PAGE_ZERO) && HAVE_DECL_MMAP_PAGE_ZERO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MMAP_PAGE_ZERO) == (0x0100000), "MMAP_PAGE_ZERO != 0x0100000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MMAP_PAGE_ZERO 0x0100000 +#endif +#if defined(ADDR_COMPAT_LAYOUT) || (defined(HAVE_DECL_ADDR_COMPAT_LAYOUT) && HAVE_DECL_ADDR_COMPAT_LAYOUT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ADDR_COMPAT_LAYOUT) == (0x0200000), "ADDR_COMPAT_LAYOUT != 0x0200000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ADDR_COMPAT_LAYOUT 0x0200000 +#endif +#if defined(READ_IMPLIES_EXEC) || (defined(HAVE_DECL_READ_IMPLIES_EXEC) && HAVE_DECL_READ_IMPLIES_EXEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((READ_IMPLIES_EXEC) == (0x0400000), "READ_IMPLIES_EXEC != 0x0400000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define READ_IMPLIES_EXEC 0x0400000 +#endif +#if defined(ADDR_LIMIT_32BIT) || (defined(HAVE_DECL_ADDR_LIMIT_32BIT) && HAVE_DECL_ADDR_LIMIT_32BIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ADDR_LIMIT_32BIT) == (0x0800000), "ADDR_LIMIT_32BIT != 0x0800000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ADDR_LIMIT_32BIT 0x0800000 +#endif +#if defined(SHORT_INODE) || (defined(HAVE_DECL_SHORT_INODE) && HAVE_DECL_SHORT_INODE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SHORT_INODE) == (0x1000000), "SHORT_INODE != 0x1000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE #else +# define SHORT_INODE 0x1000000 +#endif +#if defined(WHOLE_SECONDS) || (defined(HAVE_DECL_WHOLE_SECONDS) && HAVE_DECL_WHOLE_SECONDS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((WHOLE_SECONDS) == (0x2000000), "WHOLE_SECONDS != 0x2000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define WHOLE_SECONDS 0x2000000 +#endif +#if defined(STICKY_TIMEOUTS) || (defined(HAVE_DECL_STICKY_TIMEOUTS) && HAVE_DECL_STICKY_TIMEOUTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STICKY_TIMEOUTS) == (0x4000000), "STICKY_TIMEOUTS != 0x4000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STICKY_TIMEOUTS 0x4000000 +#endif +#if defined(ADDR_LIMIT_3GB) || (defined(HAVE_DECL_ADDR_LIMIT_3GB) && HAVE_DECL_ADDR_LIMIT_3GB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ADDR_LIMIT_3GB) == (0x8000000), "ADDR_LIMIT_3GB != 0x8000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ADDR_LIMIT_3GB 0x8000000 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat personality_flags in mpers mode + +# else static const struct xlat personality_flags[] = { @@ -22,4 +105,6 @@ const struct xlat personality_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/personality_flags.in b/xlat/personality_flags.in index a8715e2f..886b5b99 100644 --- a/xlat/personality_flags.in +++ b/xlat/personality_flags.in @@ -1,12 +1,11 @@ -#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 +UNAME26 0x0020000 +ADDR_NO_RANDOMIZE 0x0040000 +FDPIC_FUNCPTRS 0x0080000 +MMAP_PAGE_ZERO 0x0100000 +ADDR_COMPAT_LAYOUT 0x0200000 +READ_IMPLIES_EXEC 0x0400000 +ADDR_LIMIT_32BIT 0x0800000 +SHORT_INODE 0x1000000 +WHOLE_SECONDS 0x2000000 +STICKY_TIMEOUTS 0x4000000 +ADDR_LIMIT_3GB 0x8000000 diff --git a/xlat/personality_types.h b/xlat/personality_types.h index 859ded3d..7560b887 100644 --- a/xlat/personality_types.h +++ b/xlat/personality_types.h @@ -1,10 +1,177 @@ /* Generated by ./xlat/gen.sh from ./xlat/personality_types.in; do not edit. */ -#ifdef IN_MPERS - -# error static const struct xlat personality_types in mpers mode +#include "gcc_compat.h" +#include "static_assert.h" +#if defined(PER_LINUX) || (defined(HAVE_DECL_PER_LINUX) && HAVE_DECL_PER_LINUX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PER_LINUX) == (0), "PER_LINUX != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PER_LINUX 0 +#endif +#if defined(PER_LINUX_32BIT) || (defined(HAVE_DECL_PER_LINUX_32BIT) && HAVE_DECL_PER_LINUX_32BIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PER_LINUX_32BIT) == (ADDR_LIMIT_32BIT), "PER_LINUX_32BIT != ADDR_LIMIT_32BIT"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PER_LINUX_32BIT ADDR_LIMIT_32BIT +#endif +#if defined(PER_LINUX_FDPIC) || (defined(HAVE_DECL_PER_LINUX_FDPIC) && HAVE_DECL_PER_LINUX_FDPIC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PER_LINUX_FDPIC) == (FDPIC_FUNCPTRS), "PER_LINUX_FDPIC != FDPIC_FUNCPTRS"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PER_LINUX_FDPIC FDPIC_FUNCPTRS +#endif +#if defined(PER_SVR4) || (defined(HAVE_DECL_PER_SVR4) && HAVE_DECL_PER_SVR4) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PER_SVR4) == ((0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO)), "PER_SVR4 != (0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PER_SVR4 (0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO) +#endif +#if defined(PER_SVR3) || (defined(HAVE_DECL_PER_SVR3) && HAVE_DECL_PER_SVR3) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PER_SVR3) == ((0x0002 | STICKY_TIMEOUTS | SHORT_INODE)), "PER_SVR3 != (0x0002 | STICKY_TIMEOUTS | SHORT_INODE)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PER_SVR3 (0x0002 | STICKY_TIMEOUTS | SHORT_INODE) +#endif +#if defined(PER_SCOSVR3) || (defined(HAVE_DECL_PER_SCOSVR3) && HAVE_DECL_PER_SCOSVR3) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PER_SCOSVR3) == ((0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE)), "PER_SCOSVR3 != (0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PER_SCOSVR3 (0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE) +#endif +#if defined(PER_OSR5) || (defined(HAVE_DECL_PER_OSR5) && HAVE_DECL_PER_OSR5) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PER_OSR5) == ((0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS)), "PER_OSR5 != (0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PER_OSR5 (0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS) +#endif +#if defined(PER_WYSEV386) || (defined(HAVE_DECL_PER_WYSEV386) && HAVE_DECL_PER_WYSEV386) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PER_WYSEV386) == ((0x0004 | STICKY_TIMEOUTS | SHORT_INODE)), "PER_WYSEV386 != (0x0004 | STICKY_TIMEOUTS | SHORT_INODE)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PER_WYSEV386 (0x0004 | STICKY_TIMEOUTS | SHORT_INODE) +#endif +#if defined(PER_ISCR4) || (defined(HAVE_DECL_PER_ISCR4) && HAVE_DECL_PER_ISCR4) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PER_ISCR4) == ((0x0005 | STICKY_TIMEOUTS)), "PER_ISCR4 != (0x0005 | STICKY_TIMEOUTS)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PER_ISCR4 (0x0005 | STICKY_TIMEOUTS) +#endif +#if defined(PER_BSD) || (defined(HAVE_DECL_PER_BSD) && HAVE_DECL_PER_BSD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PER_BSD) == (0x0006), "PER_BSD != 0x0006"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PER_BSD 0x0006 +#endif +#if defined(PER_SUNOS) || (defined(HAVE_DECL_PER_SUNOS) && HAVE_DECL_PER_SUNOS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PER_SUNOS) == ((0x0006 | STICKY_TIMEOUTS)), "PER_SUNOS != (0x0006 | STICKY_TIMEOUTS)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PER_SUNOS (0x0006 | STICKY_TIMEOUTS) +#endif +#if defined(PER_XENIX) || (defined(HAVE_DECL_PER_XENIX) && HAVE_DECL_PER_XENIX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PER_XENIX) == ((0x0007 | STICKY_TIMEOUTS | SHORT_INODE)), "PER_XENIX != (0x0007 | STICKY_TIMEOUTS | SHORT_INODE)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PER_XENIX (0x0007 | STICKY_TIMEOUTS | SHORT_INODE) +#endif +#if defined(PER_LINUX32) || (defined(HAVE_DECL_PER_LINUX32) && HAVE_DECL_PER_LINUX32) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PER_LINUX32) == (0x0008), "PER_LINUX32 != 0x0008"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PER_LINUX32 0x0008 +#endif +#if defined(PER_LINUX32_3GB) || (defined(HAVE_DECL_PER_LINUX32_3GB) && HAVE_DECL_PER_LINUX32_3GB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PER_LINUX32_3GB) == ((0x0008 | ADDR_LIMIT_3GB)), "PER_LINUX32_3GB != (0x0008 | ADDR_LIMIT_3GB)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE #else +# define PER_LINUX32_3GB (0x0008 | ADDR_LIMIT_3GB) +#endif +#if defined(PER_IRIX32) || (defined(HAVE_DECL_PER_IRIX32) && HAVE_DECL_PER_IRIX32) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PER_IRIX32) == ((0x0009 | STICKY_TIMEOUTS)), "PER_IRIX32 != (0x0009 | STICKY_TIMEOUTS)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PER_IRIX32 (0x0009 | STICKY_TIMEOUTS) +#endif +#if defined(PER_IRIXN32) || (defined(HAVE_DECL_PER_IRIXN32) && HAVE_DECL_PER_IRIXN32) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PER_IRIXN32) == ((0x000a | STICKY_TIMEOUTS)), "PER_IRIXN32 != (0x000a | STICKY_TIMEOUTS)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PER_IRIXN32 (0x000a | STICKY_TIMEOUTS) +#endif +#if defined(PER_IRIX64) || (defined(HAVE_DECL_PER_IRIX64) && HAVE_DECL_PER_IRIX64) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PER_IRIX64) == ((0x000b | STICKY_TIMEOUTS)), "PER_IRIX64 != (0x000b | STICKY_TIMEOUTS)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PER_IRIX64 (0x000b | STICKY_TIMEOUTS) +#endif +#if defined(PER_RISCOS) || (defined(HAVE_DECL_PER_RISCOS) && HAVE_DECL_PER_RISCOS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PER_RISCOS) == (0x000c), "PER_RISCOS != 0x000c"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PER_RISCOS 0x000c +#endif +#if defined(PER_SOLARIS) || (defined(HAVE_DECL_PER_SOLARIS) && HAVE_DECL_PER_SOLARIS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PER_SOLARIS) == ((0x000d | STICKY_TIMEOUTS)), "PER_SOLARIS != (0x000d | STICKY_TIMEOUTS)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PER_SOLARIS (0x000d | STICKY_TIMEOUTS) +#endif +#if defined(PER_UW7) || (defined(HAVE_DECL_PER_UW7) && HAVE_DECL_PER_UW7) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PER_UW7) == ((0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO)), "PER_UW7 != (0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PER_UW7 (0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO) +#endif +#if defined(PER_OSF4) || (defined(HAVE_DECL_PER_OSF4) && HAVE_DECL_PER_OSF4) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PER_OSF4) == (0x000f), "PER_OSF4 != 0x000f"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PER_OSF4 0x000f +#endif +#if defined(PER_HPUX) || (defined(HAVE_DECL_PER_HPUX) && HAVE_DECL_PER_HPUX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PER_HPUX) == (0x0010), "PER_HPUX != 0x0010"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PER_HPUX 0x0010 +#endif +#if defined(PER_MASK) || (defined(HAVE_DECL_PER_MASK) && HAVE_DECL_PER_MASK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PER_MASK) == (0x00ff), "PER_MASK != 0x00ff"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PER_MASK 0x00ff +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat personality_types in mpers mode + +# else static const struct xlat personality_types[] = { @@ -30,7 +197,10 @@ const struct xlat personality_types[] = { XLAT(PER_UW7), XLAT(PER_OSF4), XLAT(PER_HPUX), + XLAT(PER_MASK), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/personality_types.in b/xlat/personality_types.in index 6832c65d..5b2f545d 100644 --- a/xlat/personality_types.in +++ b/xlat/personality_types.in @@ -1,23 +1,23 @@ -#unconditional -PER_LINUX -PER_LINUX_32BIT -PER_LINUX_FDPIC -PER_SVR4 -PER_SVR3 -PER_SCOSVR3 -PER_OSR5 -PER_WYSEV386 -PER_ISCR4 -PER_BSD -PER_SUNOS -PER_XENIX -PER_LINUX32 -PER_LINUX32_3GB -PER_IRIX32 -PER_IRIXN32 -PER_IRIX64 -PER_RISCOS -PER_SOLARIS -PER_UW7 -PER_OSF4 -PER_HPUX +PER_LINUX 0 +PER_LINUX_32BIT ADDR_LIMIT_32BIT +PER_LINUX_FDPIC FDPIC_FUNCPTRS +PER_SVR4 (0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO) +PER_SVR3 (0x0002 | STICKY_TIMEOUTS | SHORT_INODE) +PER_SCOSVR3 (0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS | SHORT_INODE) +PER_OSR5 (0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS) +PER_WYSEV386 (0x0004 | STICKY_TIMEOUTS | SHORT_INODE) +PER_ISCR4 (0x0005 | STICKY_TIMEOUTS) +PER_BSD 0x0006 +PER_SUNOS (0x0006 | STICKY_TIMEOUTS) +PER_XENIX (0x0007 | STICKY_TIMEOUTS | SHORT_INODE) +PER_LINUX32 0x0008 +PER_LINUX32_3GB (0x0008 | ADDR_LIMIT_3GB) +PER_IRIX32 (0x0009 | STICKY_TIMEOUTS) +PER_IRIXN32 (0x000a | STICKY_TIMEOUTS) +PER_IRIX64 (0x000b | STICKY_TIMEOUTS) +PER_RISCOS 0x000c +PER_SOLARIS (0x000d | STICKY_TIMEOUTS) +PER_UW7 (0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO) +PER_OSF4 0x000f +PER_HPUX 0x0010 +PER_MASK 0x00ff diff --git a/xlat/phonet_protocols.h b/xlat/phonet_protocols.h new file mode 100644 index 00000000..811672c2 --- /dev/null +++ b/xlat/phonet_protocols.h @@ -0,0 +1,46 @@ +/* Generated by ./xlat/gen.sh from ./xlat/phonet_protocols.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PN_PROTO_TRANSPORT) || (defined(HAVE_DECL_PN_PROTO_TRANSPORT) && HAVE_DECL_PN_PROTO_TRANSPORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PN_PROTO_TRANSPORT) == (0), "PN_PROTO_TRANSPORT != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PN_PROTO_TRANSPORT 0 +#endif +#if defined(PN_PROTO_PHONET) || (defined(HAVE_DECL_PN_PROTO_PHONET) && HAVE_DECL_PN_PROTO_PHONET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PN_PROTO_PHONET) == (1), "PN_PROTO_PHONET != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PN_PROTO_PHONET 1 +#endif +#if defined(PN_PROTO_PIPE) || (defined(HAVE_DECL_PN_PROTO_PIPE) && HAVE_DECL_PN_PROTO_PIPE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PN_PROTO_PIPE) == (2), "PN_PROTO_PIPE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PN_PROTO_PIPE 2 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat phonet_protocols in mpers mode + +# else + +static +const struct xlat phonet_protocols[] = { + [PN_PROTO_TRANSPORT] = XLAT(PN_PROTO_TRANSPORT), + [PN_PROTO_PHONET] = XLAT(PN_PROTO_PHONET), + [PN_PROTO_PIPE] = XLAT(PN_PROTO_PIPE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/phonet_protocols.in b/xlat/phonet_protocols.in new file mode 100644 index 00000000..5245ed7e --- /dev/null +++ b/xlat/phonet_protocols.in @@ -0,0 +1,4 @@ +#value_indexed +PN_PROTO_TRANSPORT 0 +PN_PROTO_PHONET 1 +PN_PROTO_PIPE 2 diff --git a/xlat/pkey_access.h b/xlat/pkey_access.h index 161c9e5d..cc32932a 100644 --- a/xlat/pkey_access.h +++ b/xlat/pkey_access.h @@ -1,22 +1,46 @@ /* Generated by ./xlat/gen.sh from ./xlat/pkey_access.in; do not edit. */ -#if !(defined(PKEY_DISABLE_ACCESS) || (defined(HAVE_DECL_PKEY_DISABLE_ACCESS) && HAVE_DECL_PKEY_DISABLE_ACCESS)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PKEY_DISABLE_ACCESS) || (defined(HAVE_DECL_PKEY_DISABLE_ACCESS) && HAVE_DECL_PKEY_DISABLE_ACCESS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PKEY_DISABLE_ACCESS) == (0x1), "PKEY_DISABLE_ACCESS != 0x1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PKEY_DISABLE_ACCESS 0x1 #endif -#if !(defined(PKEY_DISABLE_WRITE) || (defined(HAVE_DECL_PKEY_DISABLE_WRITE) && HAVE_DECL_PKEY_DISABLE_WRITE)) +#if defined(PKEY_DISABLE_WRITE) || (defined(HAVE_DECL_PKEY_DISABLE_WRITE) && HAVE_DECL_PKEY_DISABLE_WRITE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PKEY_DISABLE_WRITE) == (0x2), "PKEY_DISABLE_WRITE != 0x2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PKEY_DISABLE_WRITE 0x2 #endif +#if defined(PKEY_DISABLE_EXECUTE) || (defined(HAVE_DECL_PKEY_DISABLE_EXECUTE) && HAVE_DECL_PKEY_DISABLE_EXECUTE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PKEY_DISABLE_EXECUTE) == (0x4), "PKEY_DISABLE_EXECUTE != 0x4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PKEY_DISABLE_EXECUTE 0x4 +#endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat pkey_access in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat pkey_access in mpers mode + +# else static const struct xlat pkey_access[] = { XLAT(PKEY_DISABLE_ACCESS), XLAT(PKEY_DISABLE_WRITE), + XLAT(PKEY_DISABLE_EXECUTE), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/pkey_access.in b/xlat/pkey_access.in index 37372a88..108eb3b7 100644 --- a/xlat/pkey_access.in +++ b/xlat/pkey_access.in @@ -1,2 +1,3 @@ PKEY_DISABLE_ACCESS 0x1 PKEY_DISABLE_WRITE 0x2 +PKEY_DISABLE_EXECUTE 0x4 diff --git a/xlat/policies.h b/xlat/policies.h index 8b44db6d..9e4f4cf6 100644 --- a/xlat/policies.h +++ b/xlat/policies.h @@ -1,22 +1,44 @@ /* Generated by ./xlat/gen.sh from ./xlat/policies.in; do not edit. */ -#if !(defined(MPOL_DEFAULT) || (defined(HAVE_DECL_MPOL_DEFAULT) && HAVE_DECL_MPOL_DEFAULT)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(MPOL_DEFAULT) || (defined(HAVE_DECL_MPOL_DEFAULT) && HAVE_DECL_MPOL_DEFAULT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MPOL_DEFAULT) == (0), "MPOL_DEFAULT != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MPOL_DEFAULT 0 #endif -#if !(defined(MPOL_PREFERRED) || (defined(HAVE_DECL_MPOL_PREFERRED) && HAVE_DECL_MPOL_PREFERRED)) +#if defined(MPOL_PREFERRED) || (defined(HAVE_DECL_MPOL_PREFERRED) && HAVE_DECL_MPOL_PREFERRED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MPOL_PREFERRED) == (1), "MPOL_PREFERRED != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MPOL_PREFERRED 1 #endif -#if !(defined(MPOL_BIND) || (defined(HAVE_DECL_MPOL_BIND) && HAVE_DECL_MPOL_BIND)) +#if defined(MPOL_BIND) || (defined(HAVE_DECL_MPOL_BIND) && HAVE_DECL_MPOL_BIND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MPOL_BIND) == (2), "MPOL_BIND != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MPOL_BIND 2 #endif -#if !(defined(MPOL_INTERLEAVE) || (defined(HAVE_DECL_MPOL_INTERLEAVE) && HAVE_DECL_MPOL_INTERLEAVE)) +#if defined(MPOL_INTERLEAVE) || (defined(HAVE_DECL_MPOL_INTERLEAVE) && HAVE_DECL_MPOL_INTERLEAVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MPOL_INTERLEAVE) == (3), "MPOL_INTERLEAVE != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define MPOL_INTERLEAVE 3 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat policies in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat policies in mpers mode + +# else static const struct xlat policies[] = { @@ -27,4 +49,6 @@ const struct xlat policies[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/pollflags.h b/xlat/pollflags.h index 3c9f24ab..f0fd1448 100644 --- a/xlat/pollflags.h +++ b/xlat/pollflags.h @@ -1,44 +1,213 @@ /* Generated by ./xlat/gen.sh from ./xlat/pollflags.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat pollflags in mpers mode - -#else - -static -const struct xlat pollflags[] = { #if defined(POLLIN) || (defined(HAVE_DECL_POLLIN) && HAVE_DECL_POLLIN) - XLAT(POLLIN), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLLIN) == (0x0001), "POLLIN != 0x0001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POLLIN 0x0001 #endif #if defined(POLLPRI) || (defined(HAVE_DECL_POLLPRI) && HAVE_DECL_POLLPRI) - XLAT(POLLPRI), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLLPRI) == (0x0002), "POLLPRI != 0x0002"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POLLPRI 0x0002 #endif #if defined(POLLOUT) || (defined(HAVE_DECL_POLLOUT) && HAVE_DECL_POLLOUT) - XLAT(POLLOUT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLLOUT) == (0x0004), "POLLOUT != 0x0004"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POLLOUT 0x0004 +#endif +#if defined(POLLERR) || (defined(HAVE_DECL_POLLERR) && HAVE_DECL_POLLERR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLLERR) == (0x0008), "POLLERR != 0x0008"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POLLERR 0x0008 +#endif +#if defined(POLLHUP) || (defined(HAVE_DECL_POLLHUP) && HAVE_DECL_POLLHUP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLLHUP) == (0x0010), "POLLHUP != 0x0010"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POLLHUP 0x0010 +#endif +#if defined(POLLNVAL) || (defined(HAVE_DECL_POLLNVAL) && HAVE_DECL_POLLNVAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLLNVAL) == (0x0020), "POLLNVAL != 0x0020"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POLLNVAL 0x0020 #endif #if defined(POLLRDNORM) || (defined(HAVE_DECL_POLLRDNORM) && HAVE_DECL_POLLRDNORM) - XLAT(POLLRDNORM), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLLRDNORM) == (0x0040), "POLLRDNORM != 0x0040"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POLLRDNORM 0x0040 #endif +#if defined(POLLRDBAND) || (defined(HAVE_DECL_POLLRDBAND) && HAVE_DECL_POLLRDBAND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLLRDBAND) == (0x0080), "POLLRDBAND != 0x0080"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POLLRDBAND 0x0080 +#endif +#if defined(__m68k__) || defined(__mips__) || defined(__sparc__) || defined(__xtensa__) +#else #if defined(POLLWRNORM) || (defined(HAVE_DECL_POLLWRNORM) && HAVE_DECL_POLLWRNORM) - XLAT(POLLWRNORM), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLLWRNORM) == (0x0100), "POLLWRNORM != 0x0100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POLLWRNORM 0x0100 #endif -#if defined(POLLRDBAND) || (defined(HAVE_DECL_POLLRDBAND) && HAVE_DECL_POLLRDBAND) - XLAT(POLLRDBAND), #endif +#if defined(__m68k__) || defined(__mips__) || defined(__sparc__) || defined(__xtensa__) #if defined(POLLWRBAND) || (defined(HAVE_DECL_POLLWRBAND) && HAVE_DECL_POLLWRBAND) - XLAT(POLLWRBAND), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLLWRBAND) == (0x0100), "POLLWRBAND != 0x0100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POLLWRBAND 0x0100 #endif -#if defined(POLLERR) || (defined(HAVE_DECL_POLLERR) && HAVE_DECL_POLLERR) - XLAT(POLLERR), +#else +#if defined(POLLWRBAND) || (defined(HAVE_DECL_POLLWRBAND) && HAVE_DECL_POLLWRBAND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLLWRBAND) == (0x0200), "POLLWRBAND != 0x0200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POLLWRBAND 0x0200 #endif -#if defined(POLLHUP) || (defined(HAVE_DECL_POLLHUP) && HAVE_DECL_POLLHUP) - XLAT(POLLHUP), #endif -#if defined(POLLNVAL) || (defined(HAVE_DECL_POLLNVAL) && HAVE_DECL_POLLNVAL) - XLAT(POLLNVAL), +#if defined(__sparc__) +#if defined(POLLMSG) || (defined(HAVE_DECL_POLLMSG) && HAVE_DECL_POLLMSG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLLMSG) == (0x0200), "POLLMSG != 0x0200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POLLMSG 0x0200 +#endif +#else +#if defined(POLLMSG) || (defined(HAVE_DECL_POLLMSG) && HAVE_DECL_POLLMSG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLLMSG) == (0x0400), "POLLMSG != 0x0400"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POLLMSG 0x0400 #endif +#endif +#if defined(__sparc__) +#if defined(POLLREMOVE) || (defined(HAVE_DECL_POLLREMOVE) && HAVE_DECL_POLLREMOVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLLREMOVE) == (0x0400), "POLLREMOVE != 0x0400"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POLLREMOVE 0x0400 +#endif +#elif defined(__xtensa__) +#if defined(POLLREMOVE) || (defined(HAVE_DECL_POLLREMOVE) && HAVE_DECL_POLLREMOVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLLREMOVE) == (0x0800), "POLLREMOVE != 0x0800"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POLLREMOVE 0x0800 +#endif +#else +#if defined(POLLREMOVE) || (defined(HAVE_DECL_POLLREMOVE) && HAVE_DECL_POLLREMOVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLLREMOVE) == (0x1000), "POLLREMOVE != 0x1000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POLLREMOVE 0x1000 +#endif +#endif +#if defined(__sparc__) +#if defined(POLLRDHUP) || (defined(HAVE_DECL_POLLRDHUP) && HAVE_DECL_POLLRDHUP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLLRDHUP) == (0x0800), "POLLRDHUP != 0x0800"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POLLRDHUP 0x0800 +#endif +#else +#if defined(POLLRDHUP) || (defined(HAVE_DECL_POLLRDHUP) && HAVE_DECL_POLLRDHUP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLLRDHUP) == (0x2000), "POLLRDHUP != 0x2000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POLLRDHUP 0x2000 +#endif +#endif +#if defined(POLL_BUSY_LOOP) || (defined(HAVE_DECL_POLL_BUSY_LOOP) && HAVE_DECL_POLL_BUSY_LOOP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLL_BUSY_LOOP) == (0x8000), "POLL_BUSY_LOOP != 0x8000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define POLL_BUSY_LOOP 0x8000 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat pollflags in mpers mode + +# else + +static +const struct xlat pollflags[] = { + XLAT(POLLIN), + XLAT(POLLPRI), + XLAT(POLLOUT), + XLAT(POLLERR), + XLAT(POLLHUP), + XLAT(POLLNVAL), + XLAT(POLLRDNORM), + XLAT(POLLRDBAND), + +#if defined(__m68k__) || defined(__mips__) || defined(__sparc__) || defined(__xtensa__) + +#else + XLAT(POLLWRNORM), +#endif + +#if defined(__m68k__) || defined(__mips__) || defined(__sparc__) || defined(__xtensa__) + XLAT(POLLWRBAND), +#else + XLAT(POLLWRBAND), +#endif + +#if defined(__sparc__) + XLAT(POLLMSG), +#else + XLAT(POLLMSG), +#endif + +#if defined(__sparc__) + XLAT(POLLREMOVE), +#elif defined(__xtensa__) + XLAT(POLLREMOVE), +#else + XLAT(POLLREMOVE), +#endif + +#if defined(__sparc__) + XLAT(POLLRDHUP), +#else + XLAT(POLLRDHUP), +#endif + + XLAT(POLL_BUSY_LOOP), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/pollflags.in b/xlat/pollflags.in index db41909f..8081e78b 100644 --- a/xlat/pollflags.in +++ b/xlat/pollflags.in @@ -1,10 +1,42 @@ -POLLIN -POLLPRI -POLLOUT -POLLRDNORM -POLLWRNORM -POLLRDBAND -POLLWRBAND -POLLERR -POLLHUP -POLLNVAL +POLLIN 0x0001 +POLLPRI 0x0002 +POLLOUT 0x0004 +POLLERR 0x0008 +POLLHUP 0x0010 +POLLNVAL 0x0020 +POLLRDNORM 0x0040 +POLLRDBAND 0x0080 + +#if defined(__m68k__) || defined(__mips__) || defined(__sparc__) || defined(__xtensa__) +/* POLLWRNORM POLLOUT */ +#else +POLLWRNORM 0x0100 +#endif + +#if defined(__m68k__) || defined(__mips__) || defined(__sparc__) || defined(__xtensa__) +POLLWRBAND 0x0100 +#else +POLLWRBAND 0x0200 +#endif + +#if defined(__sparc__) +POLLMSG 0x0200 +#else +POLLMSG 0x0400 +#endif + +#if defined(__sparc__) +POLLREMOVE 0x0400 +#elif defined(__xtensa__) +POLLREMOVE 0x0800 +#else +POLLREMOVE 0x1000 +#endif + +#if defined(__sparc__) +POLLRDHUP 0x0800 +#else +POLLRDHUP 0x2000 +#endif + +POLL_BUSY_LOOP 0x8000 diff --git a/xlat/pr_cap_ambient.h b/xlat/pr_cap_ambient.h index 83fa8822..2a89ebaa 100644 --- a/xlat/pr_cap_ambient.h +++ b/xlat/pr_cap_ambient.h @@ -1,22 +1,44 @@ /* Generated by ./xlat/gen.sh from ./xlat/pr_cap_ambient.in; do not edit. */ -#if !(defined(PR_CAP_AMBIENT_IS_SET) || (defined(HAVE_DECL_PR_CAP_AMBIENT_IS_SET) && HAVE_DECL_PR_CAP_AMBIENT_IS_SET)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PR_CAP_AMBIENT_IS_SET) || (defined(HAVE_DECL_PR_CAP_AMBIENT_IS_SET) && HAVE_DECL_PR_CAP_AMBIENT_IS_SET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_CAP_AMBIENT_IS_SET) == (1), "PR_CAP_AMBIENT_IS_SET != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_CAP_AMBIENT_IS_SET 1 #endif -#if !(defined(PR_CAP_AMBIENT_RAISE) || (defined(HAVE_DECL_PR_CAP_AMBIENT_RAISE) && HAVE_DECL_PR_CAP_AMBIENT_RAISE)) +#if defined(PR_CAP_AMBIENT_RAISE) || (defined(HAVE_DECL_PR_CAP_AMBIENT_RAISE) && HAVE_DECL_PR_CAP_AMBIENT_RAISE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_CAP_AMBIENT_RAISE) == (2), "PR_CAP_AMBIENT_RAISE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_CAP_AMBIENT_RAISE 2 #endif -#if !(defined(PR_CAP_AMBIENT_LOWER) || (defined(HAVE_DECL_PR_CAP_AMBIENT_LOWER) && HAVE_DECL_PR_CAP_AMBIENT_LOWER)) +#if defined(PR_CAP_AMBIENT_LOWER) || (defined(HAVE_DECL_PR_CAP_AMBIENT_LOWER) && HAVE_DECL_PR_CAP_AMBIENT_LOWER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_CAP_AMBIENT_LOWER) == (3), "PR_CAP_AMBIENT_LOWER != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_CAP_AMBIENT_LOWER 3 #endif -#if !(defined(PR_CAP_AMBIENT_CLEAR_ALL) || (defined(HAVE_DECL_PR_CAP_AMBIENT_CLEAR_ALL) && HAVE_DECL_PR_CAP_AMBIENT_CLEAR_ALL)) +#if defined(PR_CAP_AMBIENT_CLEAR_ALL) || (defined(HAVE_DECL_PR_CAP_AMBIENT_CLEAR_ALL) && HAVE_DECL_PR_CAP_AMBIENT_CLEAR_ALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_CAP_AMBIENT_CLEAR_ALL) == (4), "PR_CAP_AMBIENT_CLEAR_ALL != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_CAP_AMBIENT_CLEAR_ALL 4 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat pr_cap_ambient in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat pr_cap_ambient in mpers mode + +# else static const struct xlat pr_cap_ambient[] = { @@ -27,4 +49,6 @@ const struct xlat pr_cap_ambient[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/pr_dumpable.h b/xlat/pr_dumpable.h index b101482e..0a9404af 100644 --- a/xlat/pr_dumpable.h +++ b/xlat/pr_dumpable.h @@ -1,27 +1,47 @@ /* Generated by ./xlat/gen.sh from ./xlat/pr_dumpable.in; do not edit. */ -#if !(defined(SUID_DUMP_DISABLE) || (defined(HAVE_DECL_SUID_DUMP_DISABLE) && HAVE_DECL_SUID_DUMP_DISABLE)) -# define SUID_DUMP_DISABLE 0 /* No setuid dumping */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SUID_DUMP_DISABLE) || (defined(HAVE_DECL_SUID_DUMP_DISABLE) && HAVE_DECL_SUID_DUMP_DISABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SUID_DUMP_DISABLE) == (0), "SUID_DUMP_DISABLE != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SUID_DUMP_DISABLE 0 #endif -#if !(defined(SUID_DUMP_USER) || (defined(HAVE_DECL_SUID_DUMP_USER) && HAVE_DECL_SUID_DUMP_USER)) -# define SUID_DUMP_USER 1 /* Dump as user of process */ +#if defined(SUID_DUMP_USER) || (defined(HAVE_DECL_SUID_DUMP_USER) && HAVE_DECL_SUID_DUMP_USER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SUID_DUMP_USER) == (1), "SUID_DUMP_USER != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SUID_DUMP_USER 1 #endif -#if !(defined(SUID_DUMP_ROOT) || (defined(HAVE_DECL_SUID_DUMP_ROOT) && HAVE_DECL_SUID_DUMP_ROOT)) -# define SUID_DUMP_ROOT 2 /* Dump as root */ +#if defined(SUID_DUMP_ROOT) || (defined(HAVE_DECL_SUID_DUMP_ROOT) && HAVE_DECL_SUID_DUMP_ROOT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SUID_DUMP_ROOT) == (2), "SUID_DUMP_ROOT != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SUID_DUMP_ROOT 2 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat pr_dumpable in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat pr_dumpable in mpers mode + +# else static const struct xlat pr_dumpable[] = { -/* Defined in include/linux/sched.h */ + XLAT(SUID_DUMP_DISABLE), XLAT(SUID_DUMP_USER), XLAT(SUID_DUMP_ROOT), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/pr_fp_mode.h b/xlat/pr_fp_mode.h index 90275021..40a59db4 100644 --- a/xlat/pr_fp_mode.h +++ b/xlat/pr_fp_mode.h @@ -1,16 +1,30 @@ /* Generated by ./xlat/gen.sh from ./xlat/pr_fp_mode.in; do not edit. */ -#if !(defined(PR_FP_MODE_FR) || (defined(HAVE_DECL_PR_FP_MODE_FR) && HAVE_DECL_PR_FP_MODE_FR)) -# define PR_FP_MODE_FR (1 << 0) /* 64b FP registers */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PR_FP_MODE_FR) || (defined(HAVE_DECL_PR_FP_MODE_FR) && HAVE_DECL_PR_FP_MODE_FR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_FP_MODE_FR) == ((1 << 0)), "PR_FP_MODE_FR != (1 << 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PR_FP_MODE_FR (1 << 0) #endif -#if !(defined(PR_FP_MODE_FRE) || (defined(HAVE_DECL_PR_FP_MODE_FRE) && HAVE_DECL_PR_FP_MODE_FRE)) -# define PR_FP_MODE_FRE (1 << 1) /* 32b compatibility */ +#if defined(PR_FP_MODE_FRE) || (defined(HAVE_DECL_PR_FP_MODE_FRE) && HAVE_DECL_PR_FP_MODE_FRE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_FP_MODE_FRE) == ((1 << 1)), "PR_FP_MODE_FRE != (1 << 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PR_FP_MODE_FRE (1 << 1) #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat pr_fp_mode in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat pr_fp_mode in mpers mode + +# else static const struct xlat pr_fp_mode[] = { @@ -19,4 +33,6 @@ const struct xlat pr_fp_mode[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/pr_mce_kill.h b/xlat/pr_mce_kill.h index d2839db9..1c490fe3 100644 --- a/xlat/pr_mce_kill.h +++ b/xlat/pr_mce_kill.h @@ -1,16 +1,30 @@ /* Generated by ./xlat/gen.sh from ./xlat/pr_mce_kill.in; do not edit. */ -#if !(defined(PR_MCE_KILL_CLEAR) || (defined(HAVE_DECL_PR_MCE_KILL_CLEAR) && HAVE_DECL_PR_MCE_KILL_CLEAR)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PR_MCE_KILL_CLEAR) || (defined(HAVE_DECL_PR_MCE_KILL_CLEAR) && HAVE_DECL_PR_MCE_KILL_CLEAR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_MCE_KILL_CLEAR) == (0), "PR_MCE_KILL_CLEAR != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_MCE_KILL_CLEAR 0 #endif -#if !(defined(PR_MCE_KILL_SET) || (defined(HAVE_DECL_PR_MCE_KILL_SET) && HAVE_DECL_PR_MCE_KILL_SET)) +#if defined(PR_MCE_KILL_SET) || (defined(HAVE_DECL_PR_MCE_KILL_SET) && HAVE_DECL_PR_MCE_KILL_SET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_MCE_KILL_SET) == (1), "PR_MCE_KILL_SET != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_MCE_KILL_SET 1 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat pr_mce_kill in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat pr_mce_kill in mpers mode + +# else static const struct xlat pr_mce_kill[] = { @@ -19,4 +33,6 @@ const struct xlat pr_mce_kill[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/pr_mce_kill_policy.h b/xlat/pr_mce_kill_policy.h index aee9568d..d60e2cad 100644 --- a/xlat/pr_mce_kill_policy.h +++ b/xlat/pr_mce_kill_policy.h @@ -1,19 +1,37 @@ /* Generated by ./xlat/gen.sh from ./xlat/pr_mce_kill_policy.in; do not edit. */ -#if !(defined(PR_MCE_KILL_LATE) || (defined(HAVE_DECL_PR_MCE_KILL_LATE) && HAVE_DECL_PR_MCE_KILL_LATE)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PR_MCE_KILL_LATE) || (defined(HAVE_DECL_PR_MCE_KILL_LATE) && HAVE_DECL_PR_MCE_KILL_LATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_MCE_KILL_LATE) == (0), "PR_MCE_KILL_LATE != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_MCE_KILL_LATE 0 #endif -#if !(defined(PR_MCE_KILL_EARLY) || (defined(HAVE_DECL_PR_MCE_KILL_EARLY) && HAVE_DECL_PR_MCE_KILL_EARLY)) +#if defined(PR_MCE_KILL_EARLY) || (defined(HAVE_DECL_PR_MCE_KILL_EARLY) && HAVE_DECL_PR_MCE_KILL_EARLY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_MCE_KILL_EARLY) == (1), "PR_MCE_KILL_EARLY != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_MCE_KILL_EARLY 1 #endif -#if !(defined(PR_MCE_KILL_DEFAULT) || (defined(HAVE_DECL_PR_MCE_KILL_DEFAULT) && HAVE_DECL_PR_MCE_KILL_DEFAULT)) +#if defined(PR_MCE_KILL_DEFAULT) || (defined(HAVE_DECL_PR_MCE_KILL_DEFAULT) && HAVE_DECL_PR_MCE_KILL_DEFAULT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_MCE_KILL_DEFAULT) == (2), "PR_MCE_KILL_DEFAULT != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_MCE_KILL_DEFAULT 2 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat pr_mce_kill_policy in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat pr_mce_kill_policy in mpers mode + +# else static const struct xlat pr_mce_kill_policy[] = { @@ -23,4 +41,6 @@ const struct xlat pr_mce_kill_policy[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/pr_set_mm.h b/xlat/pr_set_mm.h index bc07483c..e70ffc25 100644 --- a/xlat/pr_set_mm.h +++ b/xlat/pr_set_mm.h @@ -1,55 +1,121 @@ /* Generated by ./xlat/gen.sh from ./xlat/pr_set_mm.in; do not edit. */ -#if !(defined(PR_SET_MM_START_CODE) || (defined(HAVE_DECL_PR_SET_MM_START_CODE) && HAVE_DECL_PR_SET_MM_START_CODE)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PR_SET_MM_START_CODE) || (defined(HAVE_DECL_PR_SET_MM_START_CODE) && HAVE_DECL_PR_SET_MM_START_CODE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_MM_START_CODE) == (1), "PR_SET_MM_START_CODE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_MM_START_CODE 1 #endif -#if !(defined(PR_SET_MM_END_CODE) || (defined(HAVE_DECL_PR_SET_MM_END_CODE) && HAVE_DECL_PR_SET_MM_END_CODE)) +#if defined(PR_SET_MM_END_CODE) || (defined(HAVE_DECL_PR_SET_MM_END_CODE) && HAVE_DECL_PR_SET_MM_END_CODE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_MM_END_CODE) == (2), "PR_SET_MM_END_CODE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_MM_END_CODE 2 #endif -#if !(defined(PR_SET_MM_START_DATA) || (defined(HAVE_DECL_PR_SET_MM_START_DATA) && HAVE_DECL_PR_SET_MM_START_DATA)) +#if defined(PR_SET_MM_START_DATA) || (defined(HAVE_DECL_PR_SET_MM_START_DATA) && HAVE_DECL_PR_SET_MM_START_DATA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_MM_START_DATA) == (3), "PR_SET_MM_START_DATA != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_MM_START_DATA 3 #endif -#if !(defined(PR_SET_MM_END_DATA) || (defined(HAVE_DECL_PR_SET_MM_END_DATA) && HAVE_DECL_PR_SET_MM_END_DATA)) +#if defined(PR_SET_MM_END_DATA) || (defined(HAVE_DECL_PR_SET_MM_END_DATA) && HAVE_DECL_PR_SET_MM_END_DATA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_MM_END_DATA) == (4), "PR_SET_MM_END_DATA != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_MM_END_DATA 4 #endif -#if !(defined(PR_SET_MM_START_STACK) || (defined(HAVE_DECL_PR_SET_MM_START_STACK) && HAVE_DECL_PR_SET_MM_START_STACK)) +#if defined(PR_SET_MM_START_STACK) || (defined(HAVE_DECL_PR_SET_MM_START_STACK) && HAVE_DECL_PR_SET_MM_START_STACK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_MM_START_STACK) == (5), "PR_SET_MM_START_STACK != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_MM_START_STACK 5 #endif -#if !(defined(PR_SET_MM_START_BRK) || (defined(HAVE_DECL_PR_SET_MM_START_BRK) && HAVE_DECL_PR_SET_MM_START_BRK)) +#if defined(PR_SET_MM_START_BRK) || (defined(HAVE_DECL_PR_SET_MM_START_BRK) && HAVE_DECL_PR_SET_MM_START_BRK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_MM_START_BRK) == (6), "PR_SET_MM_START_BRK != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_MM_START_BRK 6 #endif -#if !(defined(PR_SET_MM_BRK) || (defined(HAVE_DECL_PR_SET_MM_BRK) && HAVE_DECL_PR_SET_MM_BRK)) +#if defined(PR_SET_MM_BRK) || (defined(HAVE_DECL_PR_SET_MM_BRK) && HAVE_DECL_PR_SET_MM_BRK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_MM_BRK) == (7), "PR_SET_MM_BRK != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_MM_BRK 7 #endif -#if !(defined(PR_SET_MM_ARG_START) || (defined(HAVE_DECL_PR_SET_MM_ARG_START) && HAVE_DECL_PR_SET_MM_ARG_START)) +#if defined(PR_SET_MM_ARG_START) || (defined(HAVE_DECL_PR_SET_MM_ARG_START) && HAVE_DECL_PR_SET_MM_ARG_START) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_MM_ARG_START) == (8), "PR_SET_MM_ARG_START != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_MM_ARG_START 8 #endif -#if !(defined(PR_SET_MM_ARG_END) || (defined(HAVE_DECL_PR_SET_MM_ARG_END) && HAVE_DECL_PR_SET_MM_ARG_END)) +#if defined(PR_SET_MM_ARG_END) || (defined(HAVE_DECL_PR_SET_MM_ARG_END) && HAVE_DECL_PR_SET_MM_ARG_END) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_MM_ARG_END) == (9), "PR_SET_MM_ARG_END != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_MM_ARG_END 9 #endif -#if !(defined(PR_SET_MM_ENV_START) || (defined(HAVE_DECL_PR_SET_MM_ENV_START) && HAVE_DECL_PR_SET_MM_ENV_START)) +#if defined(PR_SET_MM_ENV_START) || (defined(HAVE_DECL_PR_SET_MM_ENV_START) && HAVE_DECL_PR_SET_MM_ENV_START) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_MM_ENV_START) == (10), "PR_SET_MM_ENV_START != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_MM_ENV_START 10 #endif -#if !(defined(PR_SET_MM_ENV_END) || (defined(HAVE_DECL_PR_SET_MM_ENV_END) && HAVE_DECL_PR_SET_MM_ENV_END)) +#if defined(PR_SET_MM_ENV_END) || (defined(HAVE_DECL_PR_SET_MM_ENV_END) && HAVE_DECL_PR_SET_MM_ENV_END) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_MM_ENV_END) == (11), "PR_SET_MM_ENV_END != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_MM_ENV_END 11 #endif -#if !(defined(PR_SET_MM_AUXV) || (defined(HAVE_DECL_PR_SET_MM_AUXV) && HAVE_DECL_PR_SET_MM_AUXV)) +#if defined(PR_SET_MM_AUXV) || (defined(HAVE_DECL_PR_SET_MM_AUXV) && HAVE_DECL_PR_SET_MM_AUXV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_MM_AUXV) == (12), "PR_SET_MM_AUXV != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_MM_AUXV 12 #endif -#if !(defined(PR_SET_MM_EXE_FILE) || (defined(HAVE_DECL_PR_SET_MM_EXE_FILE) && HAVE_DECL_PR_SET_MM_EXE_FILE)) +#if defined(PR_SET_MM_EXE_FILE) || (defined(HAVE_DECL_PR_SET_MM_EXE_FILE) && HAVE_DECL_PR_SET_MM_EXE_FILE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_MM_EXE_FILE) == (13), "PR_SET_MM_EXE_FILE != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_MM_EXE_FILE 13 #endif -#if !(defined(PR_SET_MM_MAP) || (defined(HAVE_DECL_PR_SET_MM_MAP) && HAVE_DECL_PR_SET_MM_MAP)) +#if defined(PR_SET_MM_MAP) || (defined(HAVE_DECL_PR_SET_MM_MAP) && HAVE_DECL_PR_SET_MM_MAP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_MM_MAP) == (14), "PR_SET_MM_MAP != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_MM_MAP 14 #endif -#if !(defined(PR_SET_MM_MAP_SIZE) || (defined(HAVE_DECL_PR_SET_MM_MAP_SIZE) && HAVE_DECL_PR_SET_MM_MAP_SIZE)) +#if defined(PR_SET_MM_MAP_SIZE) || (defined(HAVE_DECL_PR_SET_MM_MAP_SIZE) && HAVE_DECL_PR_SET_MM_MAP_SIZE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_MM_MAP_SIZE) == (15), "PR_SET_MM_MAP_SIZE != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_MM_MAP_SIZE 15 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat pr_set_mm in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat pr_set_mm in mpers mode + +# else static const struct xlat pr_set_mm[] = { @@ -71,4 +137,6 @@ const struct xlat pr_set_mm[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/pr_spec_cmds.h b/xlat/pr_spec_cmds.h new file mode 100644 index 00000000..9fa9f653 --- /dev/null +++ b/xlat/pr_spec_cmds.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/pr_spec_cmds.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PR_SPEC_STORE_BYPASS) || (defined(HAVE_DECL_PR_SPEC_STORE_BYPASS) && HAVE_DECL_PR_SPEC_STORE_BYPASS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SPEC_STORE_BYPASS) == (0), "PR_SPEC_STORE_BYPASS != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PR_SPEC_STORE_BYPASS 0 +#endif +#if defined(PR_SPEC_INDIRECT_BRANCH) || (defined(HAVE_DECL_PR_SPEC_INDIRECT_BRANCH) && HAVE_DECL_PR_SPEC_INDIRECT_BRANCH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SPEC_INDIRECT_BRANCH) == (1), "PR_SPEC_INDIRECT_BRANCH != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PR_SPEC_INDIRECT_BRANCH 1 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat pr_spec_cmds in mpers mode + +# else + +static +const struct xlat pr_spec_cmds[] = { + [PR_SPEC_STORE_BYPASS] = XLAT(PR_SPEC_STORE_BYPASS), + [PR_SPEC_INDIRECT_BRANCH] = XLAT(PR_SPEC_INDIRECT_BRANCH), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/pr_spec_cmds.in b/xlat/pr_spec_cmds.in new file mode 100644 index 00000000..8e5ded0b --- /dev/null +++ b/xlat/pr_spec_cmds.in @@ -0,0 +1,3 @@ +#value_indexed +PR_SPEC_STORE_BYPASS 0 +PR_SPEC_INDIRECT_BRANCH 1 diff --git a/xlat/pr_spec_get_store_bypass_flags.h b/xlat/pr_spec_get_store_bypass_flags.h new file mode 100644 index 00000000..340d88db --- /dev/null +++ b/xlat/pr_spec_get_store_bypass_flags.h @@ -0,0 +1,70 @@ +/* Generated by ./xlat/gen.sh from ./xlat/pr_spec_get_store_bypass_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PR_SPEC_NOT_AFFECTED) || (defined(HAVE_DECL_PR_SPEC_NOT_AFFECTED) && HAVE_DECL_PR_SPEC_NOT_AFFECTED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SPEC_NOT_AFFECTED) == (0), "PR_SPEC_NOT_AFFECTED != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PR_SPEC_NOT_AFFECTED 0 +#endif +#if defined(PR_SPEC_PRCTL) || (defined(HAVE_DECL_PR_SPEC_PRCTL) && HAVE_DECL_PR_SPEC_PRCTL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SPEC_PRCTL) == ((1 << 0)), "PR_SPEC_PRCTL != (1 << 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PR_SPEC_PRCTL (1 << 0) +#endif +#if defined(PR_SPEC_ENABLE) || (defined(HAVE_DECL_PR_SPEC_ENABLE) && HAVE_DECL_PR_SPEC_ENABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SPEC_ENABLE) == ((1 << 1)), "PR_SPEC_ENABLE != (1 << 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PR_SPEC_ENABLE (1 << 1) +#endif +#if defined(PR_SPEC_DISABLE) || (defined(HAVE_DECL_PR_SPEC_DISABLE) && HAVE_DECL_PR_SPEC_DISABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SPEC_DISABLE) == ((1 << 2)), "PR_SPEC_DISABLE != (1 << 2)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PR_SPEC_DISABLE (1 << 2) +#endif +#if defined(PR_SPEC_FORCE_DISABLE) || (defined(HAVE_DECL_PR_SPEC_FORCE_DISABLE) && HAVE_DECL_PR_SPEC_FORCE_DISABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SPEC_FORCE_DISABLE) == ((1 << 3)), "PR_SPEC_FORCE_DISABLE != (1 << 3)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PR_SPEC_FORCE_DISABLE (1 << 3) +#endif +#if defined(PR_SPEC_DISABLE_NOEXEC) || (defined(HAVE_DECL_PR_SPEC_DISABLE_NOEXEC) && HAVE_DECL_PR_SPEC_DISABLE_NOEXEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SPEC_DISABLE_NOEXEC) == ((1 << 4)), "PR_SPEC_DISABLE_NOEXEC != (1 << 4)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PR_SPEC_DISABLE_NOEXEC (1 << 4) +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat pr_spec_get_store_bypass_flags in mpers mode + +# else + +static +const struct xlat pr_spec_get_store_bypass_flags[] = { + XLAT(PR_SPEC_NOT_AFFECTED), + XLAT(PR_SPEC_PRCTL), + XLAT(PR_SPEC_ENABLE), + XLAT(PR_SPEC_DISABLE), + XLAT(PR_SPEC_FORCE_DISABLE), + XLAT(PR_SPEC_DISABLE_NOEXEC), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/pr_spec_get_store_bypass_flags.in b/xlat/pr_spec_get_store_bypass_flags.in new file mode 100644 index 00000000..64309c38 --- /dev/null +++ b/xlat/pr_spec_get_store_bypass_flags.in @@ -0,0 +1,6 @@ +PR_SPEC_NOT_AFFECTED 0 +PR_SPEC_PRCTL (1 << 0) +PR_SPEC_ENABLE (1 << 1) +PR_SPEC_DISABLE (1 << 2) +PR_SPEC_FORCE_DISABLE (1 << 3) +PR_SPEC_DISABLE_NOEXEC (1 << 4) diff --git a/xlat/pr_spec_set_store_bypass_flags.h b/xlat/pr_spec_set_store_bypass_flags.h new file mode 100644 index 00000000..b3ebe584 --- /dev/null +++ b/xlat/pr_spec_set_store_bypass_flags.h @@ -0,0 +1,54 @@ +/* Generated by ./xlat/gen.sh from ./xlat/pr_spec_set_store_bypass_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PR_SPEC_ENABLE) || (defined(HAVE_DECL_PR_SPEC_ENABLE) && HAVE_DECL_PR_SPEC_ENABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SPEC_ENABLE) == ((1 << 1)), "PR_SPEC_ENABLE != (1 << 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PR_SPEC_ENABLE (1 << 1) +#endif +#if defined(PR_SPEC_DISABLE) || (defined(HAVE_DECL_PR_SPEC_DISABLE) && HAVE_DECL_PR_SPEC_DISABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SPEC_DISABLE) == ((1 << 2)), "PR_SPEC_DISABLE != (1 << 2)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PR_SPEC_DISABLE (1 << 2) +#endif +#if defined(PR_SPEC_FORCE_DISABLE) || (defined(HAVE_DECL_PR_SPEC_FORCE_DISABLE) && HAVE_DECL_PR_SPEC_FORCE_DISABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SPEC_FORCE_DISABLE) == ((1 << 3)), "PR_SPEC_FORCE_DISABLE != (1 << 3)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PR_SPEC_FORCE_DISABLE (1 << 3) +#endif +#if defined(PR_SPEC_DISABLE_NOEXEC) || (defined(HAVE_DECL_PR_SPEC_DISABLE_NOEXEC) && HAVE_DECL_PR_SPEC_DISABLE_NOEXEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SPEC_DISABLE_NOEXEC) == ((1 << 4)), "PR_SPEC_DISABLE_NOEXEC != (1 << 4)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PR_SPEC_DISABLE_NOEXEC (1 << 4) +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat pr_spec_set_store_bypass_flags in mpers mode + +# else + +static +const struct xlat pr_spec_set_store_bypass_flags[] = { + XLAT(PR_SPEC_ENABLE), + XLAT(PR_SPEC_DISABLE), + XLAT(PR_SPEC_FORCE_DISABLE), + XLAT(PR_SPEC_DISABLE_NOEXEC), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/pr_spec_set_store_bypass_flags.in b/xlat/pr_spec_set_store_bypass_flags.in new file mode 100644 index 00000000..6f9b6259 --- /dev/null +++ b/xlat/pr_spec_set_store_bypass_flags.in @@ -0,0 +1,4 @@ +PR_SPEC_ENABLE (1 << 1) +PR_SPEC_DISABLE (1 << 2) +PR_SPEC_FORCE_DISABLE (1 << 3) +PR_SPEC_DISABLE_NOEXEC (1 << 4) diff --git a/xlat/pr_sve_vl_flags.h b/xlat/pr_sve_vl_flags.h new file mode 100644 index 00000000..9a524b01 --- /dev/null +++ b/xlat/pr_sve_vl_flags.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/pr_sve_vl_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PR_SVE_SET_VL_ONEXEC) || (defined(HAVE_DECL_PR_SVE_SET_VL_ONEXEC) && HAVE_DECL_PR_SVE_SET_VL_ONEXEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SVE_SET_VL_ONEXEC) == ((1 << 18)), "PR_SVE_SET_VL_ONEXEC != (1 << 18)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PR_SVE_SET_VL_ONEXEC (1 << 18) +#endif +#if defined(PR_SVE_VL_INHERIT) || (defined(HAVE_DECL_PR_SVE_VL_INHERIT) && HAVE_DECL_PR_SVE_VL_INHERIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SVE_VL_INHERIT) == ((1 << 17)), "PR_SVE_VL_INHERIT != (1 << 17)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PR_SVE_VL_INHERIT (1 << 17) +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat pr_sve_vl_flags in mpers mode + +# else + +static +const struct xlat pr_sve_vl_flags[] = { + XLAT(PR_SVE_SET_VL_ONEXEC), + XLAT(PR_SVE_VL_INHERIT), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/pr_sve_vl_flags.in b/xlat/pr_sve_vl_flags.in new file mode 100644 index 00000000..dcd69980 --- /dev/null +++ b/xlat/pr_sve_vl_flags.in @@ -0,0 +1,2 @@ +PR_SVE_SET_VL_ONEXEC (1 << 18) +PR_SVE_VL_INHERIT (1 << 17) diff --git a/xlat/pr_tsc.h b/xlat/pr_tsc.h index daec871e..52b8caf0 100644 --- a/xlat/pr_tsc.h +++ b/xlat/pr_tsc.h @@ -1,16 +1,30 @@ /* Generated by ./xlat/gen.sh from ./xlat/pr_tsc.in; do not edit. */ -#if !(defined(PR_TSC_ENABLE) || (defined(HAVE_DECL_PR_TSC_ENABLE) && HAVE_DECL_PR_TSC_ENABLE)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PR_TSC_ENABLE) || (defined(HAVE_DECL_PR_TSC_ENABLE) && HAVE_DECL_PR_TSC_ENABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_TSC_ENABLE) == (1), "PR_TSC_ENABLE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_TSC_ENABLE 1 #endif -#if !(defined(PR_TSC_SIGSEGV) || (defined(HAVE_DECL_PR_TSC_SIGSEGV) && HAVE_DECL_PR_TSC_SIGSEGV)) +#if defined(PR_TSC_SIGSEGV) || (defined(HAVE_DECL_PR_TSC_SIGSEGV) && HAVE_DECL_PR_TSC_SIGSEGV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_TSC_SIGSEGV) == (2), "PR_TSC_SIGSEGV != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_TSC_SIGSEGV 2 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat pr_tsc in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat pr_tsc in mpers mode + +# else static const struct xlat pr_tsc[] = { @@ -19,4 +33,6 @@ const struct xlat pr_tsc[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/pr_unalign_flags.h b/xlat/pr_unalign_flags.h index 5a92686e..e80c130f 100644 --- a/xlat/pr_unalign_flags.h +++ b/xlat/pr_unalign_flags.h @@ -1,16 +1,30 @@ /* Generated by ./xlat/gen.sh from ./xlat/pr_unalign_flags.in; do not edit. */ -#if !(defined(PR_UNALIGN_NOPRINT) || (defined(HAVE_DECL_PR_UNALIGN_NOPRINT) && HAVE_DECL_PR_UNALIGN_NOPRINT)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PR_UNALIGN_NOPRINT) || (defined(HAVE_DECL_PR_UNALIGN_NOPRINT) && HAVE_DECL_PR_UNALIGN_NOPRINT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_UNALIGN_NOPRINT) == (1), "PR_UNALIGN_NOPRINT != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_UNALIGN_NOPRINT 1 #endif -#if !(defined(PR_UNALIGN_SIGBUS) || (defined(HAVE_DECL_PR_UNALIGN_SIGBUS) && HAVE_DECL_PR_UNALIGN_SIGBUS)) +#if defined(PR_UNALIGN_SIGBUS) || (defined(HAVE_DECL_PR_UNALIGN_SIGBUS) && HAVE_DECL_PR_UNALIGN_SIGBUS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_UNALIGN_SIGBUS) == (2), "PR_UNALIGN_SIGBUS != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_UNALIGN_SIGBUS 2 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat pr_unalign_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat pr_unalign_flags in mpers mode + +# else static const struct xlat pr_unalign_flags[] = { @@ -19,4 +33,6 @@ const struct xlat pr_unalign_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/prctl_options.h b/xlat/prctl_options.h index f1475b4a..89061d6e 100644 --- a/xlat/prctl_options.h +++ b/xlat/prctl_options.h @@ -1,151 +1,380 @@ /* Generated by ./xlat/gen.sh from ./xlat/prctl_options.in; do not edit. */ -#if !(defined(PR_SET_PDEATHSIG) || (defined(HAVE_DECL_PR_SET_PDEATHSIG) && HAVE_DECL_PR_SET_PDEATHSIG)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PR_SET_PDEATHSIG) || (defined(HAVE_DECL_PR_SET_PDEATHSIG) && HAVE_DECL_PR_SET_PDEATHSIG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_PDEATHSIG) == (1), "PR_SET_PDEATHSIG != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_PDEATHSIG 1 #endif -#if !(defined(PR_GET_PDEATHSIG) || (defined(HAVE_DECL_PR_GET_PDEATHSIG) && HAVE_DECL_PR_GET_PDEATHSIG)) +#if defined(PR_GET_PDEATHSIG) || (defined(HAVE_DECL_PR_GET_PDEATHSIG) && HAVE_DECL_PR_GET_PDEATHSIG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_GET_PDEATHSIG) == (2), "PR_GET_PDEATHSIG != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_GET_PDEATHSIG 2 #endif -#if !(defined(PR_GET_DUMPABLE) || (defined(HAVE_DECL_PR_GET_DUMPABLE) && HAVE_DECL_PR_GET_DUMPABLE)) +#if defined(PR_GET_DUMPABLE) || (defined(HAVE_DECL_PR_GET_DUMPABLE) && HAVE_DECL_PR_GET_DUMPABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_GET_DUMPABLE) == (3), "PR_GET_DUMPABLE != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_GET_DUMPABLE 3 #endif -#if !(defined(PR_SET_DUMPABLE) || (defined(HAVE_DECL_PR_SET_DUMPABLE) && HAVE_DECL_PR_SET_DUMPABLE)) +#if defined(PR_SET_DUMPABLE) || (defined(HAVE_DECL_PR_SET_DUMPABLE) && HAVE_DECL_PR_SET_DUMPABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_DUMPABLE) == (4), "PR_SET_DUMPABLE != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_DUMPABLE 4 #endif -#if !(defined(PR_GET_UNALIGN) || (defined(HAVE_DECL_PR_GET_UNALIGN) && HAVE_DECL_PR_GET_UNALIGN)) +#if defined(PR_GET_UNALIGN) || (defined(HAVE_DECL_PR_GET_UNALIGN) && HAVE_DECL_PR_GET_UNALIGN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_GET_UNALIGN) == (5), "PR_GET_UNALIGN != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_GET_UNALIGN 5 #endif -#if !(defined(PR_SET_UNALIGN) || (defined(HAVE_DECL_PR_SET_UNALIGN) && HAVE_DECL_PR_SET_UNALIGN)) +#if defined(PR_SET_UNALIGN) || (defined(HAVE_DECL_PR_SET_UNALIGN) && HAVE_DECL_PR_SET_UNALIGN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_UNALIGN) == (6), "PR_SET_UNALIGN != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_UNALIGN 6 #endif -#if !(defined(PR_GET_KEEPCAPS) || (defined(HAVE_DECL_PR_GET_KEEPCAPS) && HAVE_DECL_PR_GET_KEEPCAPS)) +#if defined(PR_GET_KEEPCAPS) || (defined(HAVE_DECL_PR_GET_KEEPCAPS) && HAVE_DECL_PR_GET_KEEPCAPS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_GET_KEEPCAPS) == (7), "PR_GET_KEEPCAPS != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_GET_KEEPCAPS 7 #endif -#if !(defined(PR_SET_KEEPCAPS) || (defined(HAVE_DECL_PR_SET_KEEPCAPS) && HAVE_DECL_PR_SET_KEEPCAPS)) +#if defined(PR_SET_KEEPCAPS) || (defined(HAVE_DECL_PR_SET_KEEPCAPS) && HAVE_DECL_PR_SET_KEEPCAPS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_KEEPCAPS) == (8), "PR_SET_KEEPCAPS != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_KEEPCAPS 8 #endif -#if !(defined(PR_GET_FPEMU) || (defined(HAVE_DECL_PR_GET_FPEMU) && HAVE_DECL_PR_GET_FPEMU)) +#if defined(PR_GET_FPEMU) || (defined(HAVE_DECL_PR_GET_FPEMU) && HAVE_DECL_PR_GET_FPEMU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_GET_FPEMU) == (9), "PR_GET_FPEMU != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_GET_FPEMU 9 #endif -#if !(defined(PR_SET_FPEMU) || (defined(HAVE_DECL_PR_SET_FPEMU) && HAVE_DECL_PR_SET_FPEMU)) +#if defined(PR_SET_FPEMU) || (defined(HAVE_DECL_PR_SET_FPEMU) && HAVE_DECL_PR_SET_FPEMU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_FPEMU) == (10), "PR_SET_FPEMU != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_FPEMU 10 #endif -#if !(defined(PR_GET_FPEXC) || (defined(HAVE_DECL_PR_GET_FPEXC) && HAVE_DECL_PR_GET_FPEXC)) +#if defined(PR_GET_FPEXC) || (defined(HAVE_DECL_PR_GET_FPEXC) && HAVE_DECL_PR_GET_FPEXC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_GET_FPEXC) == (11), "PR_GET_FPEXC != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_GET_FPEXC 11 #endif -#if !(defined(PR_SET_FPEXC) || (defined(HAVE_DECL_PR_SET_FPEXC) && HAVE_DECL_PR_SET_FPEXC)) +#if defined(PR_SET_FPEXC) || (defined(HAVE_DECL_PR_SET_FPEXC) && HAVE_DECL_PR_SET_FPEXC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_FPEXC) == (12), "PR_SET_FPEXC != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_FPEXC 12 #endif -#if !(defined(PR_GET_TIMING) || (defined(HAVE_DECL_PR_GET_TIMING) && HAVE_DECL_PR_GET_TIMING)) +#if defined(PR_GET_TIMING) || (defined(HAVE_DECL_PR_GET_TIMING) && HAVE_DECL_PR_GET_TIMING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_GET_TIMING) == (13), "PR_GET_TIMING != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_GET_TIMING 13 #endif -#if !(defined(PR_SET_TIMING) || (defined(HAVE_DECL_PR_SET_TIMING) && HAVE_DECL_PR_SET_TIMING)) +#if defined(PR_SET_TIMING) || (defined(HAVE_DECL_PR_SET_TIMING) && HAVE_DECL_PR_SET_TIMING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_TIMING) == (14), "PR_SET_TIMING != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_TIMING 14 #endif -#if !(defined(PR_SET_NAME) || (defined(HAVE_DECL_PR_SET_NAME) && HAVE_DECL_PR_SET_NAME)) +#if defined(PR_SET_NAME) || (defined(HAVE_DECL_PR_SET_NAME) && HAVE_DECL_PR_SET_NAME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_NAME) == (15), "PR_SET_NAME != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_NAME 15 #endif -#if !(defined(PR_GET_NAME) || (defined(HAVE_DECL_PR_GET_NAME) && HAVE_DECL_PR_GET_NAME)) +#if defined(PR_GET_NAME) || (defined(HAVE_DECL_PR_GET_NAME) && HAVE_DECL_PR_GET_NAME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_GET_NAME) == (16), "PR_GET_NAME != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_GET_NAME 16 #endif -#if !(defined(PR_GET_ENDIAN) || (defined(HAVE_DECL_PR_GET_ENDIAN) && HAVE_DECL_PR_GET_ENDIAN)) +#if defined(PR_GET_ENDIAN) || (defined(HAVE_DECL_PR_GET_ENDIAN) && HAVE_DECL_PR_GET_ENDIAN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_GET_ENDIAN) == (19), "PR_GET_ENDIAN != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_GET_ENDIAN 19 #endif -#if !(defined(PR_SET_ENDIAN) || (defined(HAVE_DECL_PR_SET_ENDIAN) && HAVE_DECL_PR_SET_ENDIAN)) +#if defined(PR_SET_ENDIAN) || (defined(HAVE_DECL_PR_SET_ENDIAN) && HAVE_DECL_PR_SET_ENDIAN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_ENDIAN) == (20), "PR_SET_ENDIAN != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_ENDIAN 20 #endif -#if !(defined(PR_GET_SECCOMP) || (defined(HAVE_DECL_PR_GET_SECCOMP) && HAVE_DECL_PR_GET_SECCOMP)) +#if defined(PR_GET_SECCOMP) || (defined(HAVE_DECL_PR_GET_SECCOMP) && HAVE_DECL_PR_GET_SECCOMP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_GET_SECCOMP) == (21), "PR_GET_SECCOMP != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_GET_SECCOMP 21 #endif -#if !(defined(PR_SET_SECCOMP) || (defined(HAVE_DECL_PR_SET_SECCOMP) && HAVE_DECL_PR_SET_SECCOMP)) +#if defined(PR_SET_SECCOMP) || (defined(HAVE_DECL_PR_SET_SECCOMP) && HAVE_DECL_PR_SET_SECCOMP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_SECCOMP) == (22), "PR_SET_SECCOMP != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_SECCOMP 22 #endif -#if !(defined(PR_CAPBSET_READ) || (defined(HAVE_DECL_PR_CAPBSET_READ) && HAVE_DECL_PR_CAPBSET_READ)) +#if defined(PR_CAPBSET_READ) || (defined(HAVE_DECL_PR_CAPBSET_READ) && HAVE_DECL_PR_CAPBSET_READ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_CAPBSET_READ) == (23), "PR_CAPBSET_READ != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_CAPBSET_READ 23 #endif -#if !(defined(PR_CAPBSET_DROP) || (defined(HAVE_DECL_PR_CAPBSET_DROP) && HAVE_DECL_PR_CAPBSET_DROP)) +#if defined(PR_CAPBSET_DROP) || (defined(HAVE_DECL_PR_CAPBSET_DROP) && HAVE_DECL_PR_CAPBSET_DROP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_CAPBSET_DROP) == (24), "PR_CAPBSET_DROP != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_CAPBSET_DROP 24 #endif -#if !(defined(PR_GET_TSC) || (defined(HAVE_DECL_PR_GET_TSC) && HAVE_DECL_PR_GET_TSC)) +#if defined(PR_GET_TSC) || (defined(HAVE_DECL_PR_GET_TSC) && HAVE_DECL_PR_GET_TSC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_GET_TSC) == (25), "PR_GET_TSC != 25"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_GET_TSC 25 #endif -#if !(defined(PR_SET_TSC) || (defined(HAVE_DECL_PR_SET_TSC) && HAVE_DECL_PR_SET_TSC)) +#if defined(PR_SET_TSC) || (defined(HAVE_DECL_PR_SET_TSC) && HAVE_DECL_PR_SET_TSC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_TSC) == (26), "PR_SET_TSC != 26"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_TSC 26 #endif -#if !(defined(PR_GET_SECUREBITS) || (defined(HAVE_DECL_PR_GET_SECUREBITS) && HAVE_DECL_PR_GET_SECUREBITS)) +#if defined(PR_GET_SECUREBITS) || (defined(HAVE_DECL_PR_GET_SECUREBITS) && HAVE_DECL_PR_GET_SECUREBITS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_GET_SECUREBITS) == (27), "PR_GET_SECUREBITS != 27"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_GET_SECUREBITS 27 #endif -#if !(defined(PR_SET_SECUREBITS) || (defined(HAVE_DECL_PR_SET_SECUREBITS) && HAVE_DECL_PR_SET_SECUREBITS)) +#if defined(PR_SET_SECUREBITS) || (defined(HAVE_DECL_PR_SET_SECUREBITS) && HAVE_DECL_PR_SET_SECUREBITS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_SECUREBITS) == (28), "PR_SET_SECUREBITS != 28"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_SECUREBITS 28 #endif -#if !(defined(PR_SET_TIMERSLACK) || (defined(HAVE_DECL_PR_SET_TIMERSLACK) && HAVE_DECL_PR_SET_TIMERSLACK)) +#if defined(PR_SET_TIMERSLACK) || (defined(HAVE_DECL_PR_SET_TIMERSLACK) && HAVE_DECL_PR_SET_TIMERSLACK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_TIMERSLACK) == (29), "PR_SET_TIMERSLACK != 29"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_TIMERSLACK 29 #endif -#if !(defined(PR_GET_TIMERSLACK) || (defined(HAVE_DECL_PR_GET_TIMERSLACK) && HAVE_DECL_PR_GET_TIMERSLACK)) +#if defined(PR_GET_TIMERSLACK) || (defined(HAVE_DECL_PR_GET_TIMERSLACK) && HAVE_DECL_PR_GET_TIMERSLACK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_GET_TIMERSLACK) == (30), "PR_GET_TIMERSLACK != 30"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_GET_TIMERSLACK 30 #endif -#if !(defined(PR_TASK_PERF_EVENTS_DISABLE) || (defined(HAVE_DECL_PR_TASK_PERF_EVENTS_DISABLE) && HAVE_DECL_PR_TASK_PERF_EVENTS_DISABLE)) +#if defined(PR_TASK_PERF_EVENTS_DISABLE) || (defined(HAVE_DECL_PR_TASK_PERF_EVENTS_DISABLE) && HAVE_DECL_PR_TASK_PERF_EVENTS_DISABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_TASK_PERF_EVENTS_DISABLE) == (31), "PR_TASK_PERF_EVENTS_DISABLE != 31"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_TASK_PERF_EVENTS_DISABLE 31 #endif -#if !(defined(PR_TASK_PERF_EVENTS_ENABLE) || (defined(HAVE_DECL_PR_TASK_PERF_EVENTS_ENABLE) && HAVE_DECL_PR_TASK_PERF_EVENTS_ENABLE)) +#if defined(PR_TASK_PERF_EVENTS_ENABLE) || (defined(HAVE_DECL_PR_TASK_PERF_EVENTS_ENABLE) && HAVE_DECL_PR_TASK_PERF_EVENTS_ENABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_TASK_PERF_EVENTS_ENABLE) == (32), "PR_TASK_PERF_EVENTS_ENABLE != 32"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_TASK_PERF_EVENTS_ENABLE 32 #endif -#if !(defined(PR_MCE_KILL) || (defined(HAVE_DECL_PR_MCE_KILL) && HAVE_DECL_PR_MCE_KILL)) +#if defined(PR_MCE_KILL) || (defined(HAVE_DECL_PR_MCE_KILL) && HAVE_DECL_PR_MCE_KILL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_MCE_KILL) == (33), "PR_MCE_KILL != 33"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_MCE_KILL 33 #endif -#if !(defined(PR_MCE_KILL_GET) || (defined(HAVE_DECL_PR_MCE_KILL_GET) && HAVE_DECL_PR_MCE_KILL_GET)) +#if defined(PR_MCE_KILL_GET) || (defined(HAVE_DECL_PR_MCE_KILL_GET) && HAVE_DECL_PR_MCE_KILL_GET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_MCE_KILL_GET) == (34), "PR_MCE_KILL_GET != 34"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_MCE_KILL_GET 34 #endif -#if !(defined(PR_SET_MM) || (defined(HAVE_DECL_PR_SET_MM) && HAVE_DECL_PR_SET_MM)) +#if defined(PR_SET_MM) || (defined(HAVE_DECL_PR_SET_MM) && HAVE_DECL_PR_SET_MM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_MM) == (35), "PR_SET_MM != 35"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_MM 35 #endif -#if !(defined(PR_SET_PTRACER) || (defined(HAVE_DECL_PR_SET_PTRACER) && HAVE_DECL_PR_SET_PTRACER)) +#if defined(PR_SET_PTRACER) || (defined(HAVE_DECL_PR_SET_PTRACER) && HAVE_DECL_PR_SET_PTRACER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_PTRACER) == (0x59616d61), "PR_SET_PTRACER != 0x59616d61"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_PTRACER 0x59616d61 #endif -#if !(defined(PR_SET_CHILD_SUBREAPER) || (defined(HAVE_DECL_PR_SET_CHILD_SUBREAPER) && HAVE_DECL_PR_SET_CHILD_SUBREAPER)) +#if defined(PR_SET_CHILD_SUBREAPER) || (defined(HAVE_DECL_PR_SET_CHILD_SUBREAPER) && HAVE_DECL_PR_SET_CHILD_SUBREAPER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_CHILD_SUBREAPER) == (36), "PR_SET_CHILD_SUBREAPER != 36"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_CHILD_SUBREAPER 36 #endif -#if !(defined(PR_GET_CHILD_SUBREAPER) || (defined(HAVE_DECL_PR_GET_CHILD_SUBREAPER) && HAVE_DECL_PR_GET_CHILD_SUBREAPER)) +#if defined(PR_GET_CHILD_SUBREAPER) || (defined(HAVE_DECL_PR_GET_CHILD_SUBREAPER) && HAVE_DECL_PR_GET_CHILD_SUBREAPER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_GET_CHILD_SUBREAPER) == (37), "PR_GET_CHILD_SUBREAPER != 37"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_GET_CHILD_SUBREAPER 37 #endif -#if !(defined(PR_SET_NO_NEW_PRIVS) || (defined(HAVE_DECL_PR_SET_NO_NEW_PRIVS) && HAVE_DECL_PR_SET_NO_NEW_PRIVS)) +#if defined(PR_SET_NO_NEW_PRIVS) || (defined(HAVE_DECL_PR_SET_NO_NEW_PRIVS) && HAVE_DECL_PR_SET_NO_NEW_PRIVS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_NO_NEW_PRIVS) == (38), "PR_SET_NO_NEW_PRIVS != 38"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_NO_NEW_PRIVS 38 #endif -#if !(defined(PR_GET_NO_NEW_PRIVS) || (defined(HAVE_DECL_PR_GET_NO_NEW_PRIVS) && HAVE_DECL_PR_GET_NO_NEW_PRIVS)) +#if defined(PR_GET_NO_NEW_PRIVS) || (defined(HAVE_DECL_PR_GET_NO_NEW_PRIVS) && HAVE_DECL_PR_GET_NO_NEW_PRIVS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_GET_NO_NEW_PRIVS) == (39), "PR_GET_NO_NEW_PRIVS != 39"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_GET_NO_NEW_PRIVS 39 #endif -#if !(defined(PR_GET_TID_ADDRESS) || (defined(HAVE_DECL_PR_GET_TID_ADDRESS) && HAVE_DECL_PR_GET_TID_ADDRESS)) +#if defined(PR_GET_TID_ADDRESS) || (defined(HAVE_DECL_PR_GET_TID_ADDRESS) && HAVE_DECL_PR_GET_TID_ADDRESS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_GET_TID_ADDRESS) == (40), "PR_GET_TID_ADDRESS != 40"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_GET_TID_ADDRESS 40 #endif -#if !(defined(PR_SET_THP_DISABLE) || (defined(HAVE_DECL_PR_SET_THP_DISABLE) && HAVE_DECL_PR_SET_THP_DISABLE)) +#if defined(PR_SET_THP_DISABLE) || (defined(HAVE_DECL_PR_SET_THP_DISABLE) && HAVE_DECL_PR_SET_THP_DISABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_THP_DISABLE) == (41), "PR_SET_THP_DISABLE != 41"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_THP_DISABLE 41 #endif -#if !(defined(PR_GET_THP_DISABLE) || (defined(HAVE_DECL_PR_GET_THP_DISABLE) && HAVE_DECL_PR_GET_THP_DISABLE)) +#if defined(PR_GET_THP_DISABLE) || (defined(HAVE_DECL_PR_GET_THP_DISABLE) && HAVE_DECL_PR_GET_THP_DISABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_GET_THP_DISABLE) == (42), "PR_GET_THP_DISABLE != 42"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_GET_THP_DISABLE 42 #endif -#if !(defined(PR_MPX_ENABLE_MANAGEMENT) || (defined(HAVE_DECL_PR_MPX_ENABLE_MANAGEMENT) && HAVE_DECL_PR_MPX_ENABLE_MANAGEMENT)) +#if defined(PR_MPX_ENABLE_MANAGEMENT) || (defined(HAVE_DECL_PR_MPX_ENABLE_MANAGEMENT) && HAVE_DECL_PR_MPX_ENABLE_MANAGEMENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_MPX_ENABLE_MANAGEMENT) == (43), "PR_MPX_ENABLE_MANAGEMENT != 43"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_MPX_ENABLE_MANAGEMENT 43 #endif -#if !(defined(PR_MPX_DISABLE_MANAGEMENT) || (defined(HAVE_DECL_PR_MPX_DISABLE_MANAGEMENT) && HAVE_DECL_PR_MPX_DISABLE_MANAGEMENT)) +#if defined(PR_MPX_DISABLE_MANAGEMENT) || (defined(HAVE_DECL_PR_MPX_DISABLE_MANAGEMENT) && HAVE_DECL_PR_MPX_DISABLE_MANAGEMENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_MPX_DISABLE_MANAGEMENT) == (44), "PR_MPX_DISABLE_MANAGEMENT != 44"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_MPX_DISABLE_MANAGEMENT 44 #endif -#if !(defined(PR_SET_FP_MODE) || (defined(HAVE_DECL_PR_SET_FP_MODE) && HAVE_DECL_PR_SET_FP_MODE)) +#if defined(PR_SET_FP_MODE) || (defined(HAVE_DECL_PR_SET_FP_MODE) && HAVE_DECL_PR_SET_FP_MODE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_FP_MODE) == (45), "PR_SET_FP_MODE != 45"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_FP_MODE 45 #endif -#if !(defined(PR_GET_FP_MODE) || (defined(HAVE_DECL_PR_GET_FP_MODE) && HAVE_DECL_PR_GET_FP_MODE)) +#if defined(PR_GET_FP_MODE) || (defined(HAVE_DECL_PR_GET_FP_MODE) && HAVE_DECL_PR_GET_FP_MODE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_GET_FP_MODE) == (46), "PR_GET_FP_MODE != 46"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_GET_FP_MODE 46 #endif -#if !(defined(PR_CAP_AMBIENT) || (defined(HAVE_DECL_PR_CAP_AMBIENT) && HAVE_DECL_PR_CAP_AMBIENT)) +#if defined(PR_CAP_AMBIENT) || (defined(HAVE_DECL_PR_CAP_AMBIENT) && HAVE_DECL_PR_CAP_AMBIENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_CAP_AMBIENT) == (47), "PR_CAP_AMBIENT != 47"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_CAP_AMBIENT 47 #endif -#if !(defined(PR_SET_VMA) || (defined(HAVE_DECL_PR_SET_VMA) && HAVE_DECL_PR_SET_VMA)) +#if defined(PR_SVE_SET_VL) || (defined(HAVE_DECL_PR_SVE_SET_VL) && HAVE_DECL_PR_SVE_SET_VL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SVE_SET_VL) == (50), "PR_SVE_SET_VL != 50"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PR_SVE_SET_VL 50 +#endif +#if defined(PR_SVE_GET_VL) || (defined(HAVE_DECL_PR_SVE_GET_VL) && HAVE_DECL_PR_SVE_GET_VL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SVE_GET_VL) == (51), "PR_SVE_GET_VL != 51"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PR_SVE_GET_VL 51 +#endif +#if defined(PR_GET_SPECULATION_CTRL) || (defined(HAVE_DECL_PR_GET_SPECULATION_CTRL) && HAVE_DECL_PR_GET_SPECULATION_CTRL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_GET_SPECULATION_CTRL) == (52), "PR_GET_SPECULATION_CTRL != 52"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PR_GET_SPECULATION_CTRL 52 +#endif +#if defined(PR_SET_SPECULATION_CTRL) || (defined(HAVE_DECL_PR_SET_SPECULATION_CTRL) && HAVE_DECL_PR_SET_SPECULATION_CTRL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_SPECULATION_CTRL) == (53), "PR_SET_SPECULATION_CTRL != 53"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PR_SET_SPECULATION_CTRL 53 +#endif +#if defined(PR_PAC_RESET_KEYS) || (defined(HAVE_DECL_PR_PAC_RESET_KEYS) && HAVE_DECL_PR_PAC_RESET_KEYS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_PAC_RESET_KEYS) == (54), "PR_PAC_RESET_KEYS != 54"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PR_PAC_RESET_KEYS 54 +#endif +#if defined(PR_SET_VMA) || (defined(HAVE_DECL_PR_SET_VMA) && HAVE_DECL_PR_SET_VMA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PR_SET_VMA) == (0x53564d41), "PR_SET_VMA != 0x53564d41"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PR_SET_VMA 0x53564d41 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat prctl_options in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat prctl_options in mpers mode + +# else static const struct xlat prctl_options[] = { @@ -195,8 +424,15 @@ const struct xlat prctl_options[] = { XLAT(PR_SET_FP_MODE), XLAT(PR_GET_FP_MODE), XLAT(PR_CAP_AMBIENT), + XLAT(PR_SVE_SET_VL), + XLAT(PR_SVE_GET_VL), + XLAT(PR_GET_SPECULATION_CTRL), + XLAT(PR_SET_SPECULATION_CTRL), + XLAT(PR_PAC_RESET_KEYS), XLAT(PR_SET_VMA), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/prctl_options.in b/xlat/prctl_options.in index 8c09ee31..22706faf 100644 --- a/xlat/prctl_options.in +++ b/xlat/prctl_options.in @@ -44,4 +44,9 @@ PR_MPX_DISABLE_MANAGEMENT 44 PR_SET_FP_MODE 45 PR_GET_FP_MODE 46 PR_CAP_AMBIENT 47 +PR_SVE_SET_VL 50 +PR_SVE_GET_VL 51 +PR_GET_SPECULATION_CTRL 52 +PR_SET_SPECULATION_CTRL 53 +PR_PAC_RESET_KEYS 54 PR_SET_VMA 0x53564d41 diff --git a/xlat/priorities.h b/xlat/priorities.h index 72c1a440..0163ee76 100644 --- a/xlat/priorities.h +++ b/xlat/priorities.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/priorities.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat priorities in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat priorities in mpers mode + +# else static const struct xlat priorities[] = { @@ -20,4 +26,6 @@ const struct xlat priorities[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ptp_flags_options.h b/xlat/ptp_flags_options.h index 4ceffa65..df4e2d3c 100644 --- a/xlat/ptp_flags_options.h +++ b/xlat/ptp_flags_options.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/ptp_flags_options.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat ptp_flags_options in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat ptp_flags_options in mpers mode + +# else static const struct xlat ptp_flags_options[] = { @@ -20,4 +26,6 @@ const struct xlat ptp_flags_options[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ptrace_cmds.h b/xlat/ptrace_cmds.h index ee9ebe22..cc2e8f5a 100644 --- a/xlat/ptrace_cmds.h +++ b/xlat/ptrace_cmds.h @@ -1,12 +1,13 @@ /* Generated by ./xlat/gen.sh from ./xlat/ptrace_cmds.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat ptrace_cmds in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS -static const struct xlat ptrace_cmds[] = { #if defined(PTRACE_TRACEME) || (defined(HAVE_DECL_PTRACE_TRACEME) && HAVE_DECL_PTRACE_TRACEME) XLAT(PTRACE_TRACEME), @@ -113,7 +114,13 @@ const struct xlat ptrace_cmds[] = { #if defined(PTRACE_SECCOMP_GET_FILTER) || (defined(HAVE_DECL_PTRACE_SECCOMP_GET_FILTER) && HAVE_DECL_PTRACE_SECCOMP_GET_FILTER) XLAT(PTRACE_SECCOMP_GET_FILTER), #endif -/* arch-specific */ +#if defined(PTRACE_SECCOMP_GET_METADATA) || (defined(HAVE_DECL_PTRACE_SECCOMP_GET_METADATA) && HAVE_DECL_PTRACE_SECCOMP_GET_METADATA) + XLAT(PTRACE_SECCOMP_GET_METADATA), +#endif +#if defined(PTRACE_GET_SYSCALL_INFO) || (defined(HAVE_DECL_PTRACE_GET_SYSCALL_INFO) && HAVE_DECL_PTRACE_GET_SYSCALL_INFO) + XLAT(PTRACE_GET_SYSCALL_INFO), +#endif + #if defined(PTRACE_GET_THREAD_AREA) || (defined(HAVE_DECL_PTRACE_GET_THREAD_AREA) && HAVE_DECL_PTRACE_GET_THREAD_AREA) XLAT(PTRACE_GET_THREAD_AREA), #endif @@ -129,7 +136,7 @@ const struct xlat ptrace_cmds[] = { #if defined(PTRACE_SINGLEBLOCK) || (defined(HAVE_DECL_PTRACE_SINGLEBLOCK) && HAVE_DECL_PTRACE_SINGLEBLOCK) XLAT(PTRACE_SINGLEBLOCK), #endif -/* arm */ + #if defined(PTRACE_GETWMMXREGS) || (defined(HAVE_DECL_PTRACE_GETWMMXREGS) && HAVE_DECL_PTRACE_GETWMMXREGS) XLAT(PTRACE_GETWMMXREGS), #endif @@ -154,14 +161,14 @@ const struct xlat ptrace_cmds[] = { #if defined(PTRACE_SETHBPREGS) || (defined(HAVE_DECL_PTRACE_SETHBPREGS) && HAVE_DECL_PTRACE_SETHBPREGS) XLAT(PTRACE_SETHBPREGS), #endif -/* ia64 */ + #if defined(PTRACE_OLD_GETSIGINFO) || (defined(HAVE_DECL_PTRACE_OLD_GETSIGINFO) && HAVE_DECL_PTRACE_OLD_GETSIGINFO) XLAT(PTRACE_OLD_GETSIGINFO), #endif #if defined(PTRACE_OLD_SETSIGINFO) || (defined(HAVE_DECL_PTRACE_OLD_SETSIGINFO) && HAVE_DECL_PTRACE_OLD_SETSIGINFO) XLAT(PTRACE_OLD_SETSIGINFO), #endif -/* mips */ + #if defined(PTRACE_PEEKTEXT_3264) || (defined(HAVE_DECL_PTRACE_PEEKTEXT_3264) && HAVE_DECL_PTRACE_PEEKTEXT_3264) XLAT(PTRACE_PEEKTEXT_3264), #endif @@ -183,7 +190,7 @@ const struct xlat ptrace_cmds[] = { #if defined(PTRACE_SET_WATCH_REGS) || (defined(HAVE_DECL_PTRACE_SET_WATCH_REGS) && HAVE_DECL_PTRACE_SET_WATCH_REGS) XLAT(PTRACE_SET_WATCH_REGS), #endif -/* powerpc */ + #if defined(PTRACE_GETEVRREGS) || (defined(HAVE_DECL_PTRACE_GETEVRREGS) && HAVE_DECL_PTRACE_GETEVRREGS) XLAT(PTRACE_GETEVRREGS), #endif @@ -211,7 +218,7 @@ const struct xlat ptrace_cmds[] = { #if defined(PPC_PTRACE_DELHWDEBUG) || (defined(HAVE_DECL_PPC_PTRACE_DELHWDEBUG) && HAVE_DECL_PPC_PTRACE_DELHWDEBUG) XLAT(PPC_PTRACE_DELHWDEBUG), #endif -/* s390 */ + #if defined(PTRACE_PEEKUSR_AREA) || (defined(HAVE_DECL_PTRACE_PEEKUSR_AREA) && HAVE_DECL_PTRACE_PEEKUSR_AREA) XLAT(PTRACE_PEEKUSR_AREA), #endif @@ -248,14 +255,14 @@ const struct xlat ptrace_cmds[] = { #if defined(PTRACE_TE_ABORT_RAND) || (defined(HAVE_DECL_PTRACE_TE_ABORT_RAND) && HAVE_DECL_PTRACE_TE_ABORT_RAND) XLAT(PTRACE_TE_ABORT_RAND), #endif -/* sh */ + #if defined(PTRACE_GETDSPREGS) || (defined(HAVE_DECL_PTRACE_GETDSPREGS) && HAVE_DECL_PTRACE_GETDSPREGS) XLAT(PTRACE_GETDSPREGS), #endif #if defined(PTRACE_SETDSPREGS) || (defined(HAVE_DECL_PTRACE_SETDSPREGS) && HAVE_DECL_PTRACE_SETDSPREGS) XLAT(PTRACE_SETDSPREGS), #endif -/* sparc */ + #if defined(PTRACE_SPARC_DETACH) || (defined(HAVE_DECL_PTRACE_SPARC_DETACH) && HAVE_DECL_PTRACE_SPARC_DETACH) XLAT(PTRACE_SPARC_DETACH), #endif @@ -289,7 +296,7 @@ const struct xlat ptrace_cmds[] = { #if defined(PTRACE_SETFPREGS64) || (defined(HAVE_DECL_PTRACE_SETFPREGS64) && HAVE_DECL_PTRACE_SETFPREGS64) XLAT(PTRACE_SETFPREGS64), #endif -/* x86 */ + #if defined(PTRACE_ARCH_PRCTL) || (defined(HAVE_DECL_PTRACE_ARCH_PRCTL) && HAVE_DECL_PTRACE_ARCH_PRCTL) XLAT(PTRACE_ARCH_PRCTL), #endif @@ -299,7 +306,7 @@ const struct xlat ptrace_cmds[] = { #if defined(PTRACE_SYSEMU_SINGLESTEP) || (defined(HAVE_DECL_PTRACE_SYSEMU_SINGLESTEP) && HAVE_DECL_PTRACE_SYSEMU_SINGLESTEP) XLAT(PTRACE_SYSEMU_SINGLESTEP), #endif -/* xtensa */ + #if defined(PTRACE_GETXTREGS) || (defined(HAVE_DECL_PTRACE_GETXTREGS) && HAVE_DECL_PTRACE_GETXTREGS) XLAT(PTRACE_GETXTREGS), #endif @@ -309,4 +316,6 @@ const struct xlat ptrace_cmds[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ptrace_cmds.in b/xlat/ptrace_cmds.in index 525494da..3840f346 100644 --- a/xlat/ptrace_cmds.in +++ b/xlat/ptrace_cmds.in @@ -33,6 +33,8 @@ PTRACE_PEEKSIGINFO PTRACE_GETSIGMASK PTRACE_SETSIGMASK PTRACE_SECCOMP_GET_FILTER +PTRACE_SECCOMP_GET_METADATA +PTRACE_GET_SYSCALL_INFO /* arch-specific */ PTRACE_GET_THREAD_AREA PTRACE_SET_THREAD_AREA diff --git a/xlat/ptrace_events.h b/xlat/ptrace_events.h index a466f105..d0085bc2 100644 --- a/xlat/ptrace_events.h +++ b/xlat/ptrace_events.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/ptrace_events.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat ptrace_events in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat ptrace_events in mpers mode + +# else static const struct xlat ptrace_events[] = { @@ -32,11 +38,13 @@ const struct xlat ptrace_events[] = { #if defined(PTRACE_EVENT_STOP) || (defined(HAVE_DECL_PTRACE_EVENT_STOP) && HAVE_DECL_PTRACE_EVENT_STOP) XLAT(PTRACE_EVENT_STOP), #endif -/* tile */ + #if defined(PTRACE_EVENT_MIGRATE) || (defined(HAVE_DECL_PTRACE_EVENT_MIGRATE) && HAVE_DECL_PTRACE_EVENT_MIGRATE) XLAT(PTRACE_EVENT_MIGRATE), #endif XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ptrace_peeksiginfo_flags.h b/xlat/ptrace_peeksiginfo_flags.h index c6152b77..c2a946cb 100644 --- a/xlat/ptrace_peeksiginfo_flags.h +++ b/xlat/ptrace_peeksiginfo_flags.h @@ -1,13 +1,23 @@ /* Generated by ./xlat/gen.sh from ./xlat/ptrace_peeksiginfo_flags.in; do not edit. */ -#if !(defined(PTRACE_PEEKSIGINFO_SHARED) || (defined(HAVE_DECL_PTRACE_PEEKSIGINFO_SHARED) && HAVE_DECL_PTRACE_PEEKSIGINFO_SHARED)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PTRACE_PEEKSIGINFO_SHARED) || (defined(HAVE_DECL_PTRACE_PEEKSIGINFO_SHARED) && HAVE_DECL_PTRACE_PEEKSIGINFO_SHARED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PTRACE_PEEKSIGINFO_SHARED) == (1), "PTRACE_PEEKSIGINFO_SHARED != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PTRACE_PEEKSIGINFO_SHARED 1 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat ptrace_peeksiginfo_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat ptrace_peeksiginfo_flags in mpers mode + +# else static const struct xlat ptrace_peeksiginfo_flags[] = { @@ -15,4 +25,6 @@ const struct xlat ptrace_peeksiginfo_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ptrace_setoptions_flags.h b/xlat/ptrace_setoptions_flags.h index 4eaca067..622354c4 100644 --- a/xlat/ptrace_setoptions_flags.h +++ b/xlat/ptrace_setoptions_flags.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/ptrace_setoptions_flags.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat ptrace_setoptions_flags in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat ptrace_setoptions_flags in mpers mode + +# else static const struct xlat ptrace_setoptions_flags[] = { @@ -38,11 +44,13 @@ const struct xlat ptrace_setoptions_flags[] = { #if defined(PTRACE_O_SUSPEND_SECCOMP) || (defined(HAVE_DECL_PTRACE_O_SUSPEND_SECCOMP) && HAVE_DECL_PTRACE_O_SUSPEND_SECCOMP) XLAT(PTRACE_O_SUSPEND_SECCOMP), #endif -/* tile */ + #if defined(PTRACE_O_TRACEMIGRATE) || (defined(HAVE_DECL_PTRACE_O_TRACEMIGRATE) && HAVE_DECL_PTRACE_O_TRACEMIGRATE) XLAT(PTRACE_O_TRACEMIGRATE), #endif XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ptrace_syscall_info_op.h b/xlat/ptrace_syscall_info_op.h new file mode 100644 index 00000000..0384d14f --- /dev/null +++ b/xlat/ptrace_syscall_info_op.h @@ -0,0 +1,34 @@ +/* Generated by ./xlat/gen.sh from ./xlat/ptrace_syscall_info_op.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat ptrace_syscall_info_op in mpers mode + +# else + +static +const struct xlat ptrace_syscall_info_op[] = { +#if defined(PTRACE_SYSCALL_INFO_NONE) || (defined(HAVE_DECL_PTRACE_SYSCALL_INFO_NONE) && HAVE_DECL_PTRACE_SYSCALL_INFO_NONE) + [PTRACE_SYSCALL_INFO_NONE] = XLAT(PTRACE_SYSCALL_INFO_NONE), +#endif +#if defined(PTRACE_SYSCALL_INFO_ENTRY) || (defined(HAVE_DECL_PTRACE_SYSCALL_INFO_ENTRY) && HAVE_DECL_PTRACE_SYSCALL_INFO_ENTRY) + [PTRACE_SYSCALL_INFO_ENTRY] = XLAT(PTRACE_SYSCALL_INFO_ENTRY), +#endif +#if defined(PTRACE_SYSCALL_INFO_EXIT) || (defined(HAVE_DECL_PTRACE_SYSCALL_INFO_EXIT) && HAVE_DECL_PTRACE_SYSCALL_INFO_EXIT) + [PTRACE_SYSCALL_INFO_EXIT] = XLAT(PTRACE_SYSCALL_INFO_EXIT), +#endif +#if defined(PTRACE_SYSCALL_INFO_SECCOMP) || (defined(HAVE_DECL_PTRACE_SYSCALL_INFO_SECCOMP) && HAVE_DECL_PTRACE_SYSCALL_INFO_SECCOMP) + [PTRACE_SYSCALL_INFO_SECCOMP] = XLAT(PTRACE_SYSCALL_INFO_SECCOMP), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/ptrace_syscall_info_op.in b/xlat/ptrace_syscall_info_op.in new file mode 100644 index 00000000..96e76209 --- /dev/null +++ b/xlat/ptrace_syscall_info_op.in @@ -0,0 +1,5 @@ +#value_indexed +PTRACE_SYSCALL_INFO_NONE +PTRACE_SYSCALL_INFO_ENTRY +PTRACE_SYSCALL_INFO_EXIT +PTRACE_SYSCALL_INFO_SECCOMP diff --git a/xlat/quota_formats.h b/xlat/quota_formats.h index 37f40271..9a24084d 100644 --- a/xlat/quota_formats.h +++ b/xlat/quota_formats.h @@ -1,22 +1,44 @@ /* Generated by ./xlat/gen.sh from ./xlat/quota_formats.in; do not edit. */ -#if !(defined(QFMT_VFS_OLD) || (defined(HAVE_DECL_QFMT_VFS_OLD) && HAVE_DECL_QFMT_VFS_OLD)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(QFMT_VFS_OLD) || (defined(HAVE_DECL_QFMT_VFS_OLD) && HAVE_DECL_QFMT_VFS_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((QFMT_VFS_OLD) == (1), "QFMT_VFS_OLD != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define QFMT_VFS_OLD 1 #endif -#if !(defined(QFMT_VFS_V0) || (defined(HAVE_DECL_QFMT_VFS_V0) && HAVE_DECL_QFMT_VFS_V0)) +#if defined(QFMT_VFS_V0) || (defined(HAVE_DECL_QFMT_VFS_V0) && HAVE_DECL_QFMT_VFS_V0) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((QFMT_VFS_V0) == (2), "QFMT_VFS_V0 != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define QFMT_VFS_V0 2 #endif -#if !(defined(QFMT_OCFS2) || (defined(HAVE_DECL_QFMT_OCFS2) && HAVE_DECL_QFMT_OCFS2)) +#if defined(QFMT_OCFS2) || (defined(HAVE_DECL_QFMT_OCFS2) && HAVE_DECL_QFMT_OCFS2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((QFMT_OCFS2) == (3), "QFMT_OCFS2 != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define QFMT_OCFS2 3 #endif -#if !(defined(QFMT_VFS_V1) || (defined(HAVE_DECL_QFMT_VFS_V1) && HAVE_DECL_QFMT_VFS_V1)) +#if defined(QFMT_VFS_V1) || (defined(HAVE_DECL_QFMT_VFS_V1) && HAVE_DECL_QFMT_VFS_V1) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((QFMT_VFS_V1) == (4), "QFMT_VFS_V1 != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define QFMT_VFS_V1 4 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat quota_formats in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat quota_formats in mpers mode + +# else static const struct xlat quota_formats[] = { @@ -27,4 +49,6 @@ const struct xlat quota_formats[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/quotacmds.h b/xlat/quotacmds.h index 675cde9d..54dfbadb 100644 --- a/xlat/quotacmds.h +++ b/xlat/quotacmds.h @@ -1,115 +1,261 @@ /* Generated by ./xlat/gen.sh from ./xlat/quotacmds.in; do not edit. */ -#if !(defined(Q_V1_QUOTAON) || (defined(HAVE_DECL_Q_V1_QUOTAON) && HAVE_DECL_Q_V1_QUOTAON)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(Q_V1_QUOTAON) || (defined(HAVE_DECL_Q_V1_QUOTAON) && HAVE_DECL_Q_V1_QUOTAON) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_V1_QUOTAON) == (OLD_CMD(0x1)), "Q_V1_QUOTAON != OLD_CMD(0x1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_V1_QUOTAON OLD_CMD(0x1) #endif -#if !(defined(Q_V1_QUOTAOFF) || (defined(HAVE_DECL_Q_V1_QUOTAOFF) && HAVE_DECL_Q_V1_QUOTAOFF)) +#if defined(Q_V1_QUOTAOFF) || (defined(HAVE_DECL_Q_V1_QUOTAOFF) && HAVE_DECL_Q_V1_QUOTAOFF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_V1_QUOTAOFF) == (OLD_CMD(0x2)), "Q_V1_QUOTAOFF != OLD_CMD(0x2)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_V1_QUOTAOFF OLD_CMD(0x2) #endif -#if !(defined(Q_V1_GETQUOTA) || (defined(HAVE_DECL_Q_V1_GETQUOTA) && HAVE_DECL_Q_V1_GETQUOTA)) +#if defined(Q_V1_GETQUOTA) || (defined(HAVE_DECL_Q_V1_GETQUOTA) && HAVE_DECL_Q_V1_GETQUOTA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_V1_GETQUOTA) == (OLD_CMD(0x3)), "Q_V1_GETQUOTA != OLD_CMD(0x3)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_V1_GETQUOTA OLD_CMD(0x3) #endif -#if !(defined(Q_V1_SETQUOTA) || (defined(HAVE_DECL_Q_V1_SETQUOTA) && HAVE_DECL_Q_V1_SETQUOTA)) +#if defined(Q_V1_SETQUOTA) || (defined(HAVE_DECL_Q_V1_SETQUOTA) && HAVE_DECL_Q_V1_SETQUOTA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_V1_SETQUOTA) == (OLD_CMD(0x4)), "Q_V1_SETQUOTA != OLD_CMD(0x4)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_V1_SETQUOTA OLD_CMD(0x4) #endif -#if !(defined(Q_V1_SETUSE) || (defined(HAVE_DECL_Q_V1_SETUSE) && HAVE_DECL_Q_V1_SETUSE)) +#if defined(Q_V1_SETUSE) || (defined(HAVE_DECL_Q_V1_SETUSE) && HAVE_DECL_Q_V1_SETUSE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_V1_SETUSE) == (OLD_CMD(0x5)), "Q_V1_SETUSE != OLD_CMD(0x5)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_V1_SETUSE OLD_CMD(0x5) #endif -#if !(defined(Q_V1_SYNC) || (defined(HAVE_DECL_Q_V1_SYNC) && HAVE_DECL_Q_V1_SYNC)) +#if defined(Q_V1_SYNC) || (defined(HAVE_DECL_Q_V1_SYNC) && HAVE_DECL_Q_V1_SYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_V1_SYNC) == (OLD_CMD(0x6)), "Q_V1_SYNC != OLD_CMD(0x6)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_V1_SYNC OLD_CMD(0x6) #endif -#if !(defined(Q_SETQLIM) || (defined(HAVE_DECL_Q_SETQLIM) && HAVE_DECL_Q_SETQLIM)) +#if defined(Q_SETQLIM) || (defined(HAVE_DECL_Q_SETQLIM) && HAVE_DECL_Q_SETQLIM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_SETQLIM) == (OLD_CMD(0x7)), "Q_SETQLIM != OLD_CMD(0x7)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_SETQLIM OLD_CMD(0x7) #endif -#if !(defined(Q_V1_GETSTATS) || (defined(HAVE_DECL_Q_V1_GETSTATS) && HAVE_DECL_Q_V1_GETSTATS)) +#if defined(Q_V1_GETSTATS) || (defined(HAVE_DECL_Q_V1_GETSTATS) && HAVE_DECL_Q_V1_GETSTATS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_V1_GETSTATS) == (OLD_CMD(0x8)), "Q_V1_GETSTATS != OLD_CMD(0x8)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_V1_GETSTATS OLD_CMD(0x8) #endif -#if !(defined(Q_V1_RSQUASH) || (defined(HAVE_DECL_Q_V1_RSQUASH) && HAVE_DECL_Q_V1_RSQUASH)) +#if defined(Q_V1_RSQUASH) || (defined(HAVE_DECL_Q_V1_RSQUASH) && HAVE_DECL_Q_V1_RSQUASH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_V1_RSQUASH) == (OLD_CMD(0x10)), "Q_V1_RSQUASH != OLD_CMD(0x10)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_V1_RSQUASH OLD_CMD(0x10) #endif -#if !(defined(Q_V2_GETQUOTA) || (defined(HAVE_DECL_Q_V2_GETQUOTA) && HAVE_DECL_Q_V2_GETQUOTA)) +#if defined(Q_V2_GETQUOTA) || (defined(HAVE_DECL_Q_V2_GETQUOTA) && HAVE_DECL_Q_V2_GETQUOTA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_V2_GETQUOTA) == (OLD_CMD(0xD)), "Q_V2_GETQUOTA != OLD_CMD(0xD)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_V2_GETQUOTA OLD_CMD(0xD) #endif -#if !(defined(Q_V2_SETQUOTA) || (defined(HAVE_DECL_Q_V2_SETQUOTA) && HAVE_DECL_Q_V2_SETQUOTA)) +#if defined(Q_V2_SETQUOTA) || (defined(HAVE_DECL_Q_V2_SETQUOTA) && HAVE_DECL_Q_V2_SETQUOTA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_V2_SETQUOTA) == (OLD_CMD(0xE)), "Q_V2_SETQUOTA != OLD_CMD(0xE)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_V2_SETQUOTA OLD_CMD(0xE) #endif -#if !(defined(Q_V2_SETUSE) || (defined(HAVE_DECL_Q_V2_SETUSE) && HAVE_DECL_Q_V2_SETUSE)) +#if defined(Q_V2_SETUSE) || (defined(HAVE_DECL_Q_V2_SETUSE) && HAVE_DECL_Q_V2_SETUSE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_V2_SETUSE) == (OLD_CMD(0xF)), "Q_V2_SETUSE != OLD_CMD(0xF)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_V2_SETUSE OLD_CMD(0xF) #endif -#if !(defined(Q_V2_GETINFO) || (defined(HAVE_DECL_Q_V2_GETINFO) && HAVE_DECL_Q_V2_GETINFO)) +#if defined(Q_V2_GETINFO) || (defined(HAVE_DECL_Q_V2_GETINFO) && HAVE_DECL_Q_V2_GETINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_V2_GETINFO) == (OLD_CMD(0x9)), "Q_V2_GETINFO != OLD_CMD(0x9)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_V2_GETINFO OLD_CMD(0x9) #endif -#if !(defined(Q_V2_SETINFO) || (defined(HAVE_DECL_Q_V2_SETINFO) && HAVE_DECL_Q_V2_SETINFO)) +#if defined(Q_V2_SETINFO) || (defined(HAVE_DECL_Q_V2_SETINFO) && HAVE_DECL_Q_V2_SETINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_V2_SETINFO) == (OLD_CMD(0xA)), "Q_V2_SETINFO != OLD_CMD(0xA)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_V2_SETINFO OLD_CMD(0xA) #endif -#if !(defined(Q_V2_SETGRACE) || (defined(HAVE_DECL_Q_V2_SETGRACE) && HAVE_DECL_Q_V2_SETGRACE)) +#if defined(Q_V2_SETGRACE) || (defined(HAVE_DECL_Q_V2_SETGRACE) && HAVE_DECL_Q_V2_SETGRACE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_V2_SETGRACE) == (OLD_CMD(0xB)), "Q_V2_SETGRACE != OLD_CMD(0xB)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_V2_SETGRACE OLD_CMD(0xB) #endif -#if !(defined(Q_V2_SETFLAGS) || (defined(HAVE_DECL_Q_V2_SETFLAGS) && HAVE_DECL_Q_V2_SETFLAGS)) +#if defined(Q_V2_SETFLAGS) || (defined(HAVE_DECL_Q_V2_SETFLAGS) && HAVE_DECL_Q_V2_SETFLAGS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_V2_SETFLAGS) == (OLD_CMD(0xC)), "Q_V2_SETFLAGS != OLD_CMD(0xC)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_V2_SETFLAGS OLD_CMD(0xC) #endif -#if !(defined(Q_V2_GETSTATS) || (defined(HAVE_DECL_Q_V2_GETSTATS) && HAVE_DECL_Q_V2_GETSTATS)) +#if defined(Q_V2_GETSTATS) || (defined(HAVE_DECL_Q_V2_GETSTATS) && HAVE_DECL_Q_V2_GETSTATS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_V2_GETSTATS) == (OLD_CMD(0x11)), "Q_V2_GETSTATS != OLD_CMD(0x11)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_V2_GETSTATS OLD_CMD(0x11) #endif -#if !(defined(Q_SYNC) || (defined(HAVE_DECL_Q_SYNC) && HAVE_DECL_Q_SYNC)) +#if defined(Q_SYNC) || (defined(HAVE_DECL_Q_SYNC) && HAVE_DECL_Q_SYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_SYNC) == (NEW_CMD(0x1)), "Q_SYNC != NEW_CMD(0x1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_SYNC NEW_CMD(0x1) #endif -#if !(defined(Q_QUOTAON) || (defined(HAVE_DECL_Q_QUOTAON) && HAVE_DECL_Q_QUOTAON)) +#if defined(Q_QUOTAON) || (defined(HAVE_DECL_Q_QUOTAON) && HAVE_DECL_Q_QUOTAON) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_QUOTAON) == (NEW_CMD(0x2)), "Q_QUOTAON != NEW_CMD(0x2)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_QUOTAON NEW_CMD(0x2) #endif -#if !(defined(Q_QUOTAOFF) || (defined(HAVE_DECL_Q_QUOTAOFF) && HAVE_DECL_Q_QUOTAOFF)) +#if defined(Q_QUOTAOFF) || (defined(HAVE_DECL_Q_QUOTAOFF) && HAVE_DECL_Q_QUOTAOFF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_QUOTAOFF) == (NEW_CMD(0x3)), "Q_QUOTAOFF != NEW_CMD(0x3)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_QUOTAOFF NEW_CMD(0x3) #endif -#if !(defined(Q_GETFMT) || (defined(HAVE_DECL_Q_GETFMT) && HAVE_DECL_Q_GETFMT)) +#if defined(Q_GETFMT) || (defined(HAVE_DECL_Q_GETFMT) && HAVE_DECL_Q_GETFMT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_GETFMT) == (NEW_CMD(0x4)), "Q_GETFMT != NEW_CMD(0x4)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_GETFMT NEW_CMD(0x4) #endif -#if !(defined(Q_GETINFO) || (defined(HAVE_DECL_Q_GETINFO) && HAVE_DECL_Q_GETINFO)) +#if defined(Q_GETINFO) || (defined(HAVE_DECL_Q_GETINFO) && HAVE_DECL_Q_GETINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_GETINFO) == (NEW_CMD(0x5)), "Q_GETINFO != NEW_CMD(0x5)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_GETINFO NEW_CMD(0x5) #endif -#if !(defined(Q_SETINFO) || (defined(HAVE_DECL_Q_SETINFO) && HAVE_DECL_Q_SETINFO)) +#if defined(Q_SETINFO) || (defined(HAVE_DECL_Q_SETINFO) && HAVE_DECL_Q_SETINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_SETINFO) == (NEW_CMD(0x6)), "Q_SETINFO != NEW_CMD(0x6)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_SETINFO NEW_CMD(0x6) #endif -#if !(defined(Q_GETQUOTA) || (defined(HAVE_DECL_Q_GETQUOTA) && HAVE_DECL_Q_GETQUOTA)) +#if defined(Q_GETQUOTA) || (defined(HAVE_DECL_Q_GETQUOTA) && HAVE_DECL_Q_GETQUOTA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_GETQUOTA) == (NEW_CMD(0x7)), "Q_GETQUOTA != NEW_CMD(0x7)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_GETQUOTA NEW_CMD(0x7) #endif -#if !(defined(Q_SETQUOTA) || (defined(HAVE_DECL_Q_SETQUOTA) && HAVE_DECL_Q_SETQUOTA)) +#if defined(Q_SETQUOTA) || (defined(HAVE_DECL_Q_SETQUOTA) && HAVE_DECL_Q_SETQUOTA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_SETQUOTA) == (NEW_CMD(0x8)), "Q_SETQUOTA != NEW_CMD(0x8)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_SETQUOTA NEW_CMD(0x8) #endif -#if !(defined(Q_GETNEXTQUOTA) || (defined(HAVE_DECL_Q_GETNEXTQUOTA) && HAVE_DECL_Q_GETNEXTQUOTA)) +#if defined(Q_GETNEXTQUOTA) || (defined(HAVE_DECL_Q_GETNEXTQUOTA) && HAVE_DECL_Q_GETNEXTQUOTA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_GETNEXTQUOTA) == (NEW_CMD(0x9)), "Q_GETNEXTQUOTA != NEW_CMD(0x9)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_GETNEXTQUOTA NEW_CMD(0x9) #endif -#if !(defined(Q_XQUOTAON) || (defined(HAVE_DECL_Q_XQUOTAON) && HAVE_DECL_Q_XQUOTAON)) +#if defined(Q_XQUOTAON) || (defined(HAVE_DECL_Q_XQUOTAON) && HAVE_DECL_Q_XQUOTAON) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_XQUOTAON) == (XQM_CMD(0x1)), "Q_XQUOTAON != XQM_CMD(0x1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_XQUOTAON XQM_CMD(0x1) #endif -#if !(defined(Q_XQUOTAOFF) || (defined(HAVE_DECL_Q_XQUOTAOFF) && HAVE_DECL_Q_XQUOTAOFF)) +#if defined(Q_XQUOTAOFF) || (defined(HAVE_DECL_Q_XQUOTAOFF) && HAVE_DECL_Q_XQUOTAOFF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_XQUOTAOFF) == (XQM_CMD(0x2)), "Q_XQUOTAOFF != XQM_CMD(0x2)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_XQUOTAOFF XQM_CMD(0x2) #endif -#if !(defined(Q_XGETQUOTA) || (defined(HAVE_DECL_Q_XGETQUOTA) && HAVE_DECL_Q_XGETQUOTA)) +#if defined(Q_XGETQUOTA) || (defined(HAVE_DECL_Q_XGETQUOTA) && HAVE_DECL_Q_XGETQUOTA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_XGETQUOTA) == (XQM_CMD(0x3)), "Q_XGETQUOTA != XQM_CMD(0x3)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_XGETQUOTA XQM_CMD(0x3) #endif -#if !(defined(Q_XSETQLIM) || (defined(HAVE_DECL_Q_XSETQLIM) && HAVE_DECL_Q_XSETQLIM)) +#if defined(Q_XSETQLIM) || (defined(HAVE_DECL_Q_XSETQLIM) && HAVE_DECL_Q_XSETQLIM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_XSETQLIM) == (XQM_CMD(0x4)), "Q_XSETQLIM != XQM_CMD(0x4)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_XSETQLIM XQM_CMD(0x4) #endif -#if !(defined(Q_XGETQSTAT) || (defined(HAVE_DECL_Q_XGETQSTAT) && HAVE_DECL_Q_XGETQSTAT)) +#if defined(Q_XGETQSTAT) || (defined(HAVE_DECL_Q_XGETQSTAT) && HAVE_DECL_Q_XGETQSTAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_XGETQSTAT) == (XQM_CMD(0x5)), "Q_XGETQSTAT != XQM_CMD(0x5)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_XGETQSTAT XQM_CMD(0x5) #endif -#if !(defined(Q_XQUOTARM) || (defined(HAVE_DECL_Q_XQUOTARM) && HAVE_DECL_Q_XQUOTARM)) +#if defined(Q_XQUOTARM) || (defined(HAVE_DECL_Q_XQUOTARM) && HAVE_DECL_Q_XQUOTARM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_XQUOTARM) == (XQM_CMD(0x6)), "Q_XQUOTARM != XQM_CMD(0x6)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_XQUOTARM XQM_CMD(0x6) #endif -#if !(defined(Q_XQUOTASYNC) || (defined(HAVE_DECL_Q_XQUOTASYNC) && HAVE_DECL_Q_XQUOTASYNC)) +#if defined(Q_XQUOTASYNC) || (defined(HAVE_DECL_Q_XQUOTASYNC) && HAVE_DECL_Q_XQUOTASYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_XQUOTASYNC) == (XQM_CMD(0x7)), "Q_XQUOTASYNC != XQM_CMD(0x7)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_XQUOTASYNC XQM_CMD(0x7) #endif -#if !(defined(Q_XGETQSTATV) || (defined(HAVE_DECL_Q_XGETQSTATV) && HAVE_DECL_Q_XGETQSTATV)) +#if defined(Q_XGETQSTATV) || (defined(HAVE_DECL_Q_XGETQSTATV) && HAVE_DECL_Q_XGETQSTATV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_XGETQSTATV) == (XQM_CMD(0x8)), "Q_XGETQSTATV != XQM_CMD(0x8)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_XGETQSTATV XQM_CMD(0x8) #endif -#if !(defined(Q_XGETNEXTQUOTA) || (defined(HAVE_DECL_Q_XGETNEXTQUOTA) && HAVE_DECL_Q_XGETNEXTQUOTA)) +#if defined(Q_XGETNEXTQUOTA) || (defined(HAVE_DECL_Q_XGETNEXTQUOTA) && HAVE_DECL_Q_XGETNEXTQUOTA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((Q_XGETNEXTQUOTA) == (XQM_CMD(0x9)), "Q_XGETNEXTQUOTA != XQM_CMD(0x9)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define Q_XGETNEXTQUOTA XQM_CMD(0x9) #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat quotacmds in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat quotacmds in mpers mode + +# else static const struct xlat quotacmds[] = { @@ -154,4 +300,6 @@ const struct xlat quotacmds[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/quotatypes.h b/xlat/quotatypes.h index d2231444..bbc9567d 100644 --- a/xlat/quotatypes.h +++ b/xlat/quotatypes.h @@ -1,19 +1,37 @@ /* Generated by ./xlat/gen.sh from ./xlat/quotatypes.in; do not edit. */ -#if !(defined(USRQUOTA) || (defined(HAVE_DECL_USRQUOTA) && HAVE_DECL_USRQUOTA)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(USRQUOTA) || (defined(HAVE_DECL_USRQUOTA) && HAVE_DECL_USRQUOTA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((USRQUOTA) == (0), "USRQUOTA != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define USRQUOTA 0 #endif -#if !(defined(GRPQUOTA) || (defined(HAVE_DECL_GRPQUOTA) && HAVE_DECL_GRPQUOTA)) +#if defined(GRPQUOTA) || (defined(HAVE_DECL_GRPQUOTA) && HAVE_DECL_GRPQUOTA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((GRPQUOTA) == (1), "GRPQUOTA != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define GRPQUOTA 1 #endif -#if !(defined(PRJQUOTA) || (defined(HAVE_DECL_PRJQUOTA) && HAVE_DECL_PRJQUOTA)) +#if defined(PRJQUOTA) || (defined(HAVE_DECL_PRJQUOTA) && HAVE_DECL_PRJQUOTA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PRJQUOTA) == (2), "PRJQUOTA != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define PRJQUOTA 2 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat quotatypes in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat quotatypes in mpers mode + +# else static const struct xlat quotatypes[] = { @@ -23,4 +41,6 @@ const struct xlat quotatypes[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/random_ioctl_cmds.h b/xlat/random_ioctl_cmds.h new file mode 100644 index 00000000..e5564749 --- /dev/null +++ b/xlat/random_ioctl_cmds.h @@ -0,0 +1,78 @@ +/* Generated by ./xlat/gen.sh from ./xlat/random_ioctl_cmds.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(RNDGETENTCNT) || (defined(HAVE_DECL_RNDGETENTCNT) && HAVE_DECL_RNDGETENTCNT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RNDGETENTCNT) == (_IOR( 'R', 0x00, int )), "RNDGETENTCNT != _IOR( 'R', 0x00, int )"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RNDGETENTCNT _IOR( 'R', 0x00, int ) +#endif +#if defined(RNDADDTOENTCNT) || (defined(HAVE_DECL_RNDADDTOENTCNT) && HAVE_DECL_RNDADDTOENTCNT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RNDADDTOENTCNT) == (_IOW( 'R', 0x01, int )), "RNDADDTOENTCNT != _IOW( 'R', 0x01, int )"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RNDADDTOENTCNT _IOW( 'R', 0x01, int ) +#endif +#if defined(RNDGETPOOL) || (defined(HAVE_DECL_RNDGETPOOL) && HAVE_DECL_RNDGETPOOL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RNDGETPOOL) == (_IOR( 'R', 0x02, int [2] )), "RNDGETPOOL != _IOR( 'R', 0x02, int [2] )"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RNDGETPOOL _IOR( 'R', 0x02, int [2] ) +#endif +#if defined(RNDADDENTROPY) || (defined(HAVE_DECL_RNDADDENTROPY) && HAVE_DECL_RNDADDENTROPY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RNDADDENTROPY) == (_IOW( 'R', 0x03, int [2] )), "RNDADDENTROPY != _IOW( 'R', 0x03, int [2] )"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RNDADDENTROPY _IOW( 'R', 0x03, int [2] ) +#endif +#if defined(RNDZAPENTCNT) || (defined(HAVE_DECL_RNDZAPENTCNT) && HAVE_DECL_RNDZAPENTCNT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RNDZAPENTCNT) == (_IO( 'R', 0x04 )), "RNDZAPENTCNT != _IO( 'R', 0x04 )"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RNDZAPENTCNT _IO( 'R', 0x04 ) +#endif +#if defined(RNDCLEARPOOL) || (defined(HAVE_DECL_RNDCLEARPOOL) && HAVE_DECL_RNDCLEARPOOL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RNDCLEARPOOL) == (_IO( 'R', 0x06 )), "RNDCLEARPOOL != _IO( 'R', 0x06 )"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RNDCLEARPOOL _IO( 'R', 0x06 ) +#endif +#if defined(RNDRESEEDCRNG) || (defined(HAVE_DECL_RNDRESEEDCRNG) && HAVE_DECL_RNDRESEEDCRNG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RNDRESEEDCRNG) == (_IO( 'R', 0x07 )), "RNDRESEEDCRNG != _IO( 'R', 0x07 )"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RNDRESEEDCRNG _IO( 'R', 0x07 ) +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat random_ioctl_cmds in mpers mode + +# else + +static +const struct xlat random_ioctl_cmds[] = { + XLAT(RNDGETENTCNT), + XLAT(RNDADDTOENTCNT), + XLAT(RNDGETPOOL), + XLAT(RNDADDENTROPY), + XLAT(RNDZAPENTCNT), + XLAT(RNDCLEARPOOL), + XLAT(RNDRESEEDCRNG), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/random_ioctl_cmds.in b/xlat/random_ioctl_cmds.in new file mode 100644 index 00000000..1b31dc52 --- /dev/null +++ b/xlat/random_ioctl_cmds.in @@ -0,0 +1,7 @@ +RNDGETENTCNT _IOR( 'R', 0x00, int ) +RNDADDTOENTCNT _IOW( 'R', 0x01, int ) +RNDGETPOOL _IOR( 'R', 0x02, int [2] ) +RNDADDENTROPY _IOW( 'R', 0x03, int [2] ) +RNDZAPENTCNT _IO( 'R', 0x04 ) +RNDCLEARPOOL _IO( 'R', 0x06 ) +RNDRESEEDCRNG _IO( 'R', 0x07 ) diff --git a/xlat/rename_flags.h b/xlat/rename_flags.h index 2fc0a76f..5eb07aac 100644 --- a/xlat/rename_flags.h +++ b/xlat/rename_flags.h @@ -1,19 +1,37 @@ /* Generated by ./xlat/gen.sh from ./xlat/rename_flags.in; do not edit. */ -#if !(defined(RENAME_NOREPLACE) || (defined(HAVE_DECL_RENAME_NOREPLACE) && HAVE_DECL_RENAME_NOREPLACE)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(RENAME_NOREPLACE) || (defined(HAVE_DECL_RENAME_NOREPLACE) && HAVE_DECL_RENAME_NOREPLACE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RENAME_NOREPLACE) == (1), "RENAME_NOREPLACE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define RENAME_NOREPLACE 1 #endif -#if !(defined(RENAME_EXCHANGE) || (defined(HAVE_DECL_RENAME_EXCHANGE) && HAVE_DECL_RENAME_EXCHANGE)) +#if defined(RENAME_EXCHANGE) || (defined(HAVE_DECL_RENAME_EXCHANGE) && HAVE_DECL_RENAME_EXCHANGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RENAME_EXCHANGE) == (2), "RENAME_EXCHANGE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define RENAME_EXCHANGE 2 #endif -#if !(defined(RENAME_WHITEOUT) || (defined(HAVE_DECL_RENAME_WHITEOUT) && HAVE_DECL_RENAME_WHITEOUT)) +#if defined(RENAME_WHITEOUT) || (defined(HAVE_DECL_RENAME_WHITEOUT) && HAVE_DECL_RENAME_WHITEOUT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RENAME_WHITEOUT) == (4), "RENAME_WHITEOUT != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define RENAME_WHITEOUT 4 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat rename_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat rename_flags in mpers mode + +# else static const struct xlat rename_flags[] = { @@ -23,4 +41,6 @@ const struct xlat rename_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/resource_flags.h b/xlat/resource_flags.h index 7761ca22..67bed2d2 100644 --- a/xlat/resource_flags.h +++ b/xlat/resource_flags.h @@ -1,6 +1,12 @@ /* Generated by ./xlat/gen.sh from ./xlat/resource_flags.in; do not edit. */ -#ifndef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS const struct xlat resource_flags[] = { #if defined(IPC_CREAT) || (defined(HAVE_DECL_IPC_CREAT) && HAVE_DECL_IPC_CREAT) @@ -15,4 +21,6 @@ const struct xlat resource_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/resources.h b/xlat/resources.h index 4493b083..41a04974 100644 --- a/xlat/resources.h +++ b/xlat/resources.h @@ -1,65 +1,282 @@ /* Generated by ./xlat/gen.sh from ./xlat/resources.in; do not edit. */ -#ifdef IN_MPERS - -# error static const struct xlat resources in mpers mode +#include "gcc_compat.h" +#include "static_assert.h" +#if defined(RLIMIT_CPU) || (defined(HAVE_DECL_RLIMIT_CPU) && HAVE_DECL_RLIMIT_CPU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_CPU) == (0), "RLIMIT_CPU != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE #else - -static -const struct xlat resources[] = { -#if defined(RLIMIT_AS) || (defined(HAVE_DECL_RLIMIT_AS) && HAVE_DECL_RLIMIT_AS) - XLAT(RLIMIT_AS), +# define RLIMIT_CPU 0 +#endif +#if defined(RLIMIT_FSIZE) || (defined(HAVE_DECL_RLIMIT_FSIZE) && HAVE_DECL_RLIMIT_FSIZE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_FSIZE) == (1), "RLIMIT_FSIZE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_FSIZE 1 +#endif +#if defined(RLIMIT_DATA) || (defined(HAVE_DECL_RLIMIT_DATA) && HAVE_DECL_RLIMIT_DATA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_DATA) == (2), "RLIMIT_DATA != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_DATA 2 +#endif +#if defined(RLIMIT_STACK) || (defined(HAVE_DECL_RLIMIT_STACK) && HAVE_DECL_RLIMIT_STACK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_STACK) == (3), "RLIMIT_STACK != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_STACK 3 #endif #if defined(RLIMIT_CORE) || (defined(HAVE_DECL_RLIMIT_CORE) && HAVE_DECL_RLIMIT_CORE) - XLAT(RLIMIT_CORE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_CORE) == (4), "RLIMIT_CORE != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_CORE 4 #endif -#if defined(RLIMIT_CPU) || (defined(HAVE_DECL_RLIMIT_CPU) && HAVE_DECL_RLIMIT_CPU) - XLAT(RLIMIT_CPU), +#if defined(__alpha__) +#if defined(RLIMIT_RSS) || (defined(HAVE_DECL_RLIMIT_RSS) && HAVE_DECL_RLIMIT_RSS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_RSS) == (5), "RLIMIT_RSS != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_RSS 5 #endif -#if defined(RLIMIT_DATA) || (defined(HAVE_DECL_RLIMIT_DATA) && HAVE_DECL_RLIMIT_DATA) - XLAT(RLIMIT_DATA), +#if defined(RLIMIT_NOFILE) || (defined(HAVE_DECL_RLIMIT_NOFILE) && HAVE_DECL_RLIMIT_NOFILE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_NOFILE) == (6), "RLIMIT_NOFILE != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_NOFILE 6 #endif -#if defined(RLIMIT_FSIZE) || (defined(HAVE_DECL_RLIMIT_FSIZE) && HAVE_DECL_RLIMIT_FSIZE) - XLAT(RLIMIT_FSIZE), +#if defined(RLIMIT_AS) || (defined(HAVE_DECL_RLIMIT_AS) && HAVE_DECL_RLIMIT_AS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_AS) == (7), "RLIMIT_AS != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_AS 7 #endif -#if defined(RLIMIT_LOCKS) || (defined(HAVE_DECL_RLIMIT_LOCKS) && HAVE_DECL_RLIMIT_LOCKS) - XLAT(RLIMIT_LOCKS), +#if defined(RLIMIT_NPROC) || (defined(HAVE_DECL_RLIMIT_NPROC) && HAVE_DECL_RLIMIT_NPROC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_NPROC) == (8), "RLIMIT_NPROC != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_NPROC 8 #endif #if defined(RLIMIT_MEMLOCK) || (defined(HAVE_DECL_RLIMIT_MEMLOCK) && HAVE_DECL_RLIMIT_MEMLOCK) - XLAT(RLIMIT_MEMLOCK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_MEMLOCK) == (9), "RLIMIT_MEMLOCK != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_MEMLOCK 9 #endif -#if defined(RLIMIT_MSGQUEUE) || (defined(HAVE_DECL_RLIMIT_MSGQUEUE) && HAVE_DECL_RLIMIT_MSGQUEUE) - XLAT(RLIMIT_MSGQUEUE), +#elif defined(__mips__) +#if defined(RLIMIT_NOFILE) || (defined(HAVE_DECL_RLIMIT_NOFILE) && HAVE_DECL_RLIMIT_NOFILE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_NOFILE) == (5), "RLIMIT_NOFILE != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_NOFILE 5 #endif -#if defined(RLIMIT_NICE) || (defined(HAVE_DECL_RLIMIT_NICE) && HAVE_DECL_RLIMIT_NICE) - XLAT(RLIMIT_NICE), +#if defined(RLIMIT_AS) || (defined(HAVE_DECL_RLIMIT_AS) && HAVE_DECL_RLIMIT_AS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_AS) == (6), "RLIMIT_AS != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_AS 6 +#endif +#if defined(RLIMIT_RSS) || (defined(HAVE_DECL_RLIMIT_RSS) && HAVE_DECL_RLIMIT_RSS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_RSS) == (7), "RLIMIT_RSS != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_RSS 7 +#endif +#if defined(RLIMIT_NPROC) || (defined(HAVE_DECL_RLIMIT_NPROC) && HAVE_DECL_RLIMIT_NPROC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_NPROC) == (8), "RLIMIT_NPROC != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_NPROC 8 +#endif +#if defined(RLIMIT_MEMLOCK) || (defined(HAVE_DECL_RLIMIT_MEMLOCK) && HAVE_DECL_RLIMIT_MEMLOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_MEMLOCK) == (9), "RLIMIT_MEMLOCK != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_MEMLOCK 9 +#endif +#elif defined(__sparc__) +#if defined(RLIMIT_RSS) || (defined(HAVE_DECL_RLIMIT_RSS) && HAVE_DECL_RLIMIT_RSS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_RSS) == (5), "RLIMIT_RSS != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_RSS 5 #endif #if defined(RLIMIT_NOFILE) || (defined(HAVE_DECL_RLIMIT_NOFILE) && HAVE_DECL_RLIMIT_NOFILE) - XLAT(RLIMIT_NOFILE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_NOFILE) == (6), "RLIMIT_NOFILE != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_NOFILE 6 #endif #if defined(RLIMIT_NPROC) || (defined(HAVE_DECL_RLIMIT_NPROC) && HAVE_DECL_RLIMIT_NPROC) - XLAT(RLIMIT_NPROC), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_NPROC) == (7), "RLIMIT_NPROC != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_NPROC 7 #endif +#if defined(RLIMIT_MEMLOCK) || (defined(HAVE_DECL_RLIMIT_MEMLOCK) && HAVE_DECL_RLIMIT_MEMLOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_MEMLOCK) == (8), "RLIMIT_MEMLOCK != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_MEMLOCK 8 +#endif +#if defined(RLIMIT_AS) || (defined(HAVE_DECL_RLIMIT_AS) && HAVE_DECL_RLIMIT_AS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_AS) == (9), "RLIMIT_AS != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_AS 9 +#endif +#else #if defined(RLIMIT_RSS) || (defined(HAVE_DECL_RLIMIT_RSS) && HAVE_DECL_RLIMIT_RSS) - XLAT(RLIMIT_RSS), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_RSS) == (5), "RLIMIT_RSS != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_RSS 5 #endif -#if defined(RLIMIT_RTPRIO) || (defined(HAVE_DECL_RLIMIT_RTPRIO) && HAVE_DECL_RLIMIT_RTPRIO) - XLAT(RLIMIT_RTPRIO), +#if defined(RLIMIT_NPROC) || (defined(HAVE_DECL_RLIMIT_NPROC) && HAVE_DECL_RLIMIT_NPROC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_NPROC) == (6), "RLIMIT_NPROC != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_NPROC 6 #endif -#if defined(RLIMIT_RTTIME) || (defined(HAVE_DECL_RLIMIT_RTTIME) && HAVE_DECL_RLIMIT_RTTIME) - XLAT(RLIMIT_RTTIME), +#if defined(RLIMIT_NOFILE) || (defined(HAVE_DECL_RLIMIT_NOFILE) && HAVE_DECL_RLIMIT_NOFILE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_NOFILE) == (7), "RLIMIT_NOFILE != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_NOFILE 7 +#endif +#if defined(RLIMIT_MEMLOCK) || (defined(HAVE_DECL_RLIMIT_MEMLOCK) && HAVE_DECL_RLIMIT_MEMLOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_MEMLOCK) == (8), "RLIMIT_MEMLOCK != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_MEMLOCK 8 +#endif +#if defined(RLIMIT_AS) || (defined(HAVE_DECL_RLIMIT_AS) && HAVE_DECL_RLIMIT_AS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_AS) == (9), "RLIMIT_AS != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_AS 9 +#endif +#endif +#if defined(RLIMIT_LOCKS) || (defined(HAVE_DECL_RLIMIT_LOCKS) && HAVE_DECL_RLIMIT_LOCKS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_LOCKS) == (10), "RLIMIT_LOCKS != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_LOCKS 10 #endif #if defined(RLIMIT_SIGPENDING) || (defined(HAVE_DECL_RLIMIT_SIGPENDING) && HAVE_DECL_RLIMIT_SIGPENDING) - XLAT(RLIMIT_SIGPENDING), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_SIGPENDING) == (11), "RLIMIT_SIGPENDING != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_SIGPENDING 11 #endif -#if defined(RLIMIT_STACK) || (defined(HAVE_DECL_RLIMIT_STACK) && HAVE_DECL_RLIMIT_STACK) - XLAT(RLIMIT_STACK), +#if defined(RLIMIT_MSGQUEUE) || (defined(HAVE_DECL_RLIMIT_MSGQUEUE) && HAVE_DECL_RLIMIT_MSGQUEUE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_MSGQUEUE) == (12), "RLIMIT_MSGQUEUE != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_MSGQUEUE 12 +#endif +#if defined(RLIMIT_NICE) || (defined(HAVE_DECL_RLIMIT_NICE) && HAVE_DECL_RLIMIT_NICE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_NICE) == (13), "RLIMIT_NICE != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_NICE 13 +#endif +#if defined(RLIMIT_RTPRIO) || (defined(HAVE_DECL_RLIMIT_RTPRIO) && HAVE_DECL_RLIMIT_RTPRIO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_RTPRIO) == (14), "RLIMIT_RTPRIO != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_RTPRIO 14 +#endif +#if defined(RLIMIT_RTTIME) || (defined(HAVE_DECL_RLIMIT_RTTIME) && HAVE_DECL_RLIMIT_RTTIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RLIMIT_RTTIME) == (15), "RLIMIT_RTTIME != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RLIMIT_RTTIME 15 #endif -#if defined(RLIMIT_VMEM) || (defined(HAVE_DECL_RLIMIT_VMEM) && HAVE_DECL_RLIMIT_VMEM) - XLAT(RLIMIT_VMEM), + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat resources in mpers mode + +# else + +static +const struct xlat resources[] = { + [RLIMIT_CPU] = XLAT(RLIMIT_CPU), + [RLIMIT_FSIZE] = XLAT(RLIMIT_FSIZE), + [RLIMIT_DATA] = XLAT(RLIMIT_DATA), + [RLIMIT_STACK] = XLAT(RLIMIT_STACK), + [RLIMIT_CORE] = XLAT(RLIMIT_CORE), + +#if defined(__alpha__) + [RLIMIT_RSS] = XLAT(RLIMIT_RSS), + [RLIMIT_NOFILE] = XLAT(RLIMIT_NOFILE), + [RLIMIT_AS] = XLAT(RLIMIT_AS), + [RLIMIT_NPROC] = XLAT(RLIMIT_NPROC), + [RLIMIT_MEMLOCK] = XLAT(RLIMIT_MEMLOCK), +#elif defined(__mips__) + [RLIMIT_NOFILE] = XLAT(RLIMIT_NOFILE), + [RLIMIT_AS] = XLAT(RLIMIT_AS), + [RLIMIT_RSS] = XLAT(RLIMIT_RSS), + [RLIMIT_NPROC] = XLAT(RLIMIT_NPROC), + [RLIMIT_MEMLOCK] = XLAT(RLIMIT_MEMLOCK), +#elif defined(__sparc__) + [RLIMIT_RSS] = XLAT(RLIMIT_RSS), + [RLIMIT_NOFILE] = XLAT(RLIMIT_NOFILE), + [RLIMIT_NPROC] = XLAT(RLIMIT_NPROC), + [RLIMIT_MEMLOCK] = XLAT(RLIMIT_MEMLOCK), + [RLIMIT_AS] = XLAT(RLIMIT_AS), +#else + [RLIMIT_RSS] = XLAT(RLIMIT_RSS), + [RLIMIT_NPROC] = XLAT(RLIMIT_NPROC), + [RLIMIT_NOFILE] = XLAT(RLIMIT_NOFILE), + [RLIMIT_MEMLOCK] = XLAT(RLIMIT_MEMLOCK), + [RLIMIT_AS] = XLAT(RLIMIT_AS), #endif + + [RLIMIT_LOCKS] = XLAT(RLIMIT_LOCKS), + [RLIMIT_SIGPENDING] = XLAT(RLIMIT_SIGPENDING), + [RLIMIT_MSGQUEUE] = XLAT(RLIMIT_MSGQUEUE), + [RLIMIT_NICE] = XLAT(RLIMIT_NICE), + [RLIMIT_RTPRIO] = XLAT(RLIMIT_RTPRIO), + [RLIMIT_RTTIME] = XLAT(RLIMIT_RTTIME), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/resources.in b/xlat/resources.in index 8c45b7fd..f12cb855 100644 --- a/xlat/resources.in +++ b/xlat/resources.in @@ -1,17 +1,39 @@ -RLIMIT_AS -RLIMIT_CORE -RLIMIT_CPU -RLIMIT_DATA -RLIMIT_FSIZE -RLIMIT_LOCKS -RLIMIT_MEMLOCK -RLIMIT_MSGQUEUE -RLIMIT_NICE -RLIMIT_NOFILE -RLIMIT_NPROC -RLIMIT_RSS -RLIMIT_RTPRIO -RLIMIT_RTTIME -RLIMIT_SIGPENDING -RLIMIT_STACK -RLIMIT_VMEM +#value_indexed +RLIMIT_CPU 0 +RLIMIT_FSIZE 1 +RLIMIT_DATA 2 +RLIMIT_STACK 3 +RLIMIT_CORE 4 + +#if defined(__alpha__) +RLIMIT_RSS 5 +RLIMIT_NOFILE 6 +RLIMIT_AS 7 +RLIMIT_NPROC 8 +RLIMIT_MEMLOCK 9 +#elif defined(__mips__) +RLIMIT_NOFILE 5 +RLIMIT_AS 6 +RLIMIT_RSS 7 +RLIMIT_NPROC 8 +RLIMIT_MEMLOCK 9 +#elif defined(__sparc__) +RLIMIT_RSS 5 +RLIMIT_NOFILE 6 +RLIMIT_NPROC 7 +RLIMIT_MEMLOCK 8 +RLIMIT_AS 9 +#else +RLIMIT_RSS 5 +RLIMIT_NPROC 6 +RLIMIT_NOFILE 7 +RLIMIT_MEMLOCK 8 +RLIMIT_AS 9 +#endif + +RLIMIT_LOCKS 10 +RLIMIT_SIGPENDING 11 +RLIMIT_MSGQUEUE 12 +RLIMIT_NICE 13 +RLIMIT_RTPRIO 14 +RLIMIT_RTTIME 15 diff --git a/xlat/riscv_flush_icache_flags.h b/xlat/riscv_flush_icache_flags.h new file mode 100644 index 00000000..4b9a812b --- /dev/null +++ b/xlat/riscv_flush_icache_flags.h @@ -0,0 +1,30 @@ +/* Generated by ./xlat/gen.sh from ./xlat/riscv_flush_icache_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SYS_RISCV_FLUSH_ICACHE_LOCAL) || (defined(HAVE_DECL_SYS_RISCV_FLUSH_ICACHE_LOCAL) && HAVE_DECL_SYS_RISCV_FLUSH_ICACHE_LOCAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYS_RISCV_FLUSH_ICACHE_LOCAL) == (1), "SYS_RISCV_FLUSH_ICACHE_LOCAL != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SYS_RISCV_FLUSH_ICACHE_LOCAL 1 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat riscv_flush_icache_flags in mpers mode + +# else + +static +const struct xlat riscv_flush_icache_flags[] = { + XLAT(SYS_RISCV_FLUSH_ICACHE_LOCAL), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/riscv_flush_icache_flags.in b/xlat/riscv_flush_icache_flags.in new file mode 100644 index 00000000..173da076 --- /dev/null +++ b/xlat/riscv_flush_icache_flags.in @@ -0,0 +1 @@ +SYS_RISCV_FLUSH_ICACHE_LOCAL 1 diff --git a/xlat/route_nexthop_flags.h b/xlat/route_nexthop_flags.h new file mode 100644 index 00000000..d794c6c3 --- /dev/null +++ b/xlat/route_nexthop_flags.h @@ -0,0 +1,70 @@ +/* Generated by ./xlat/gen.sh from ./xlat/route_nexthop_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(RTNH_F_DEAD) || (defined(HAVE_DECL_RTNH_F_DEAD) && HAVE_DECL_RTNH_F_DEAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTNH_F_DEAD) == (1), "RTNH_F_DEAD != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTNH_F_DEAD 1 +#endif +#if defined(RTNH_F_PERVASIVE) || (defined(HAVE_DECL_RTNH_F_PERVASIVE) && HAVE_DECL_RTNH_F_PERVASIVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTNH_F_PERVASIVE) == (2), "RTNH_F_PERVASIVE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTNH_F_PERVASIVE 2 +#endif +#if defined(RTNH_F_ONLINK) || (defined(HAVE_DECL_RTNH_F_ONLINK) && HAVE_DECL_RTNH_F_ONLINK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTNH_F_ONLINK) == (4), "RTNH_F_ONLINK != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTNH_F_ONLINK 4 +#endif +#if defined(RTNH_F_OFFLOAD) || (defined(HAVE_DECL_RTNH_F_OFFLOAD) && HAVE_DECL_RTNH_F_OFFLOAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTNH_F_OFFLOAD) == (8), "RTNH_F_OFFLOAD != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTNH_F_OFFLOAD 8 +#endif +#if defined(RTNH_F_LINKDOWN) || (defined(HAVE_DECL_RTNH_F_LINKDOWN) && HAVE_DECL_RTNH_F_LINKDOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTNH_F_LINKDOWN) == (16), "RTNH_F_LINKDOWN != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTNH_F_LINKDOWN 16 +#endif +#if defined(RTNH_F_UNRESOLVED) || (defined(HAVE_DECL_RTNH_F_UNRESOLVED) && HAVE_DECL_RTNH_F_UNRESOLVED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTNH_F_UNRESOLVED) == (32), "RTNH_F_UNRESOLVED != 32"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTNH_F_UNRESOLVED 32 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat route_nexthop_flags in mpers mode + +# else + +static +const struct xlat route_nexthop_flags[] = { + XLAT(RTNH_F_DEAD), + XLAT(RTNH_F_PERVASIVE), + XLAT(RTNH_F_ONLINK), + XLAT(RTNH_F_OFFLOAD), + XLAT(RTNH_F_LINKDOWN), + XLAT(RTNH_F_UNRESOLVED), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/route_nexthop_flags.in b/xlat/route_nexthop_flags.in new file mode 100644 index 00000000..a64a9885 --- /dev/null +++ b/xlat/route_nexthop_flags.in @@ -0,0 +1,6 @@ +RTNH_F_DEAD 1 +RTNH_F_PERVASIVE 2 +RTNH_F_ONLINK 4 +RTNH_F_OFFLOAD 8 +RTNH_F_LINKDOWN 16 +RTNH_F_UNRESOLVED 32 diff --git a/xlat/routing_flags.h b/xlat/routing_flags.h new file mode 100644 index 00000000..fa6a212c --- /dev/null +++ b/xlat/routing_flags.h @@ -0,0 +1,37 @@ +/* Generated by ./xlat/gen.sh from ./xlat/routing_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat routing_flags in mpers mode + +# else + +static +const struct xlat routing_flags[] = { +#if defined(RTM_F_NOTIFY) || (defined(HAVE_DECL_RTM_F_NOTIFY) && HAVE_DECL_RTM_F_NOTIFY) + XLAT(RTM_F_NOTIFY), +#endif +#if defined(RTM_F_CLONED) || (defined(HAVE_DECL_RTM_F_CLONED) && HAVE_DECL_RTM_F_CLONED) + XLAT(RTM_F_CLONED), +#endif +#if defined(RTM_F_EQUALIZE) || (defined(HAVE_DECL_RTM_F_EQUALIZE) && HAVE_DECL_RTM_F_EQUALIZE) + XLAT(RTM_F_EQUALIZE), +#endif +#if defined(RTM_F_PREFIX) || (defined(HAVE_DECL_RTM_F_PREFIX) && HAVE_DECL_RTM_F_PREFIX) + XLAT(RTM_F_PREFIX), +#endif +#if defined(RTM_F_LOOKUP_TABLE) || (defined(HAVE_DECL_RTM_F_LOOKUP_TABLE) && HAVE_DECL_RTM_F_LOOKUP_TABLE) + XLAT(RTM_F_LOOKUP_TABLE), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/routing_flags.in b/xlat/routing_flags.in new file mode 100644 index 00000000..fe66b678 --- /dev/null +++ b/xlat/routing_flags.in @@ -0,0 +1,5 @@ +RTM_F_NOTIFY +RTM_F_CLONED +RTM_F_EQUALIZE +RTM_F_PREFIX +RTM_F_LOOKUP_TABLE diff --git a/xlat/routing_protocols.h b/xlat/routing_protocols.h new file mode 100644 index 00000000..bf51f164 --- /dev/null +++ b/xlat/routing_protocols.h @@ -0,0 +1,191 @@ +/* Generated by ./xlat/gen.sh from ./xlat/routing_protocols.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(RTPROT_UNSPEC) || (defined(HAVE_DECL_RTPROT_UNSPEC) && HAVE_DECL_RTPROT_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTPROT_UNSPEC) == (0), "RTPROT_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTPROT_UNSPEC 0 +#endif +#if defined(RTPROT_REDIRECT) || (defined(HAVE_DECL_RTPROT_REDIRECT) && HAVE_DECL_RTPROT_REDIRECT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTPROT_REDIRECT) == (1), "RTPROT_REDIRECT != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTPROT_REDIRECT 1 +#endif +#if defined(RTPROT_KERNEL) || (defined(HAVE_DECL_RTPROT_KERNEL) && HAVE_DECL_RTPROT_KERNEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTPROT_KERNEL) == (2), "RTPROT_KERNEL != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTPROT_KERNEL 2 +#endif +#if defined(RTPROT_BOOT) || (defined(HAVE_DECL_RTPROT_BOOT) && HAVE_DECL_RTPROT_BOOT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTPROT_BOOT) == (3), "RTPROT_BOOT != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTPROT_BOOT 3 +#endif +#if defined(RTPROT_STATIC) || (defined(HAVE_DECL_RTPROT_STATIC) && HAVE_DECL_RTPROT_STATIC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTPROT_STATIC) == (4), "RTPROT_STATIC != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTPROT_STATIC 4 +#endif +#if defined(RTPROT_GATED) || (defined(HAVE_DECL_RTPROT_GATED) && HAVE_DECL_RTPROT_GATED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTPROT_GATED) == (8), "RTPROT_GATED != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTPROT_GATED 8 +#endif +#if defined(RTPROT_RA) || (defined(HAVE_DECL_RTPROT_RA) && HAVE_DECL_RTPROT_RA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTPROT_RA) == (9), "RTPROT_RA != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTPROT_RA 9 +#endif +#if defined(RTPROT_MRT) || (defined(HAVE_DECL_RTPROT_MRT) && HAVE_DECL_RTPROT_MRT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTPROT_MRT) == (10), "RTPROT_MRT != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTPROT_MRT 10 +#endif +#if defined(RTPROT_ZEBRA) || (defined(HAVE_DECL_RTPROT_ZEBRA) && HAVE_DECL_RTPROT_ZEBRA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTPROT_ZEBRA) == (11), "RTPROT_ZEBRA != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTPROT_ZEBRA 11 +#endif +#if defined(RTPROT_BIRD) || (defined(HAVE_DECL_RTPROT_BIRD) && HAVE_DECL_RTPROT_BIRD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTPROT_BIRD) == (12), "RTPROT_BIRD != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTPROT_BIRD 12 +#endif +#if defined(RTPROT_DNROUTED) || (defined(HAVE_DECL_RTPROT_DNROUTED) && HAVE_DECL_RTPROT_DNROUTED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTPROT_DNROUTED) == (13), "RTPROT_DNROUTED != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTPROT_DNROUTED 13 +#endif +#if defined(RTPROT_XORP) || (defined(HAVE_DECL_RTPROT_XORP) && HAVE_DECL_RTPROT_XORP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTPROT_XORP) == (14), "RTPROT_XORP != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTPROT_XORP 14 +#endif +#if defined(RTPROT_NTK) || (defined(HAVE_DECL_RTPROT_NTK) && HAVE_DECL_RTPROT_NTK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTPROT_NTK) == (15), "RTPROT_NTK != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTPROT_NTK 15 +#endif +#if defined(RTPROT_DHCP) || (defined(HAVE_DECL_RTPROT_DHCP) && HAVE_DECL_RTPROT_DHCP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTPROT_DHCP) == (16), "RTPROT_DHCP != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTPROT_DHCP 16 +#endif +#if defined(RTPROT_MROUTED) || (defined(HAVE_DECL_RTPROT_MROUTED) && HAVE_DECL_RTPROT_MROUTED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTPROT_MROUTED) == (17), "RTPROT_MROUTED != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTPROT_MROUTED 17 +#endif +#if defined(RTPROT_BABEL) || (defined(HAVE_DECL_RTPROT_BABEL) && HAVE_DECL_RTPROT_BABEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTPROT_BABEL) == (42), "RTPROT_BABEL != 42"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTPROT_BABEL 42 +#endif +#if defined(RTPROT_BGP) || (defined(HAVE_DECL_RTPROT_BGP) && HAVE_DECL_RTPROT_BGP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTPROT_BGP) == (186), "RTPROT_BGP != 186"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTPROT_BGP 186 +#endif +#if defined(RTPROT_ISIS) || (defined(HAVE_DECL_RTPROT_ISIS) && HAVE_DECL_RTPROT_ISIS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTPROT_ISIS) == (187), "RTPROT_ISIS != 187"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTPROT_ISIS 187 +#endif +#if defined(RTPROT_OSPF) || (defined(HAVE_DECL_RTPROT_OSPF) && HAVE_DECL_RTPROT_OSPF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTPROT_OSPF) == (188), "RTPROT_OSPF != 188"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTPROT_OSPF 188 +#endif +#if defined(RTPROT_RIP) || (defined(HAVE_DECL_RTPROT_RIP) && HAVE_DECL_RTPROT_RIP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTPROT_RIP) == (189), "RTPROT_RIP != 189"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTPROT_RIP 189 +#endif +#if defined(RTPROT_EIGRP) || (defined(HAVE_DECL_RTPROT_EIGRP) && HAVE_DECL_RTPROT_EIGRP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTPROT_EIGRP) == (192), "RTPROT_EIGRP != 192"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTPROT_EIGRP 192 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat routing_protocols in mpers mode + +# else + +static +const struct xlat routing_protocols[] = { + + XLAT(RTPROT_UNSPEC), + XLAT(RTPROT_REDIRECT), + XLAT(RTPROT_KERNEL), + XLAT(RTPROT_BOOT), + XLAT(RTPROT_STATIC), + XLAT(RTPROT_GATED), + XLAT(RTPROT_RA), + XLAT(RTPROT_MRT), + XLAT(RTPROT_ZEBRA), + XLAT(RTPROT_BIRD), + XLAT(RTPROT_DNROUTED), + XLAT(RTPROT_XORP), + XLAT(RTPROT_NTK), + XLAT(RTPROT_DHCP), + XLAT(RTPROT_MROUTED), + XLAT(RTPROT_BABEL), + XLAT(RTPROT_BGP), + XLAT(RTPROT_ISIS), + XLAT(RTPROT_OSPF), + XLAT(RTPROT_RIP), + XLAT(RTPROT_EIGRP), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/routing_protocols.in b/xlat/routing_protocols.in new file mode 100644 index 00000000..5433c25e --- /dev/null +++ b/xlat/routing_protocols.in @@ -0,0 +1,22 @@ +/* sort -k2,2n */ +RTPROT_UNSPEC 0 +RTPROT_REDIRECT 1 +RTPROT_KERNEL 2 +RTPROT_BOOT 3 +RTPROT_STATIC 4 +RTPROT_GATED 8 +RTPROT_RA 9 +RTPROT_MRT 10 +RTPROT_ZEBRA 11 +RTPROT_BIRD 12 +RTPROT_DNROUTED 13 +RTPROT_XORP 14 +RTPROT_NTK 15 +RTPROT_DHCP 16 +RTPROT_MROUTED 17 +RTPROT_BABEL 42 +RTPROT_BGP 186 +RTPROT_ISIS 187 +RTPROT_OSPF 188 +RTPROT_RIP 189 +RTPROT_EIGRP 192 diff --git a/xlat/routing_scopes.h b/xlat/routing_scopes.h new file mode 100644 index 00000000..f718f3b4 --- /dev/null +++ b/xlat/routing_scopes.h @@ -0,0 +1,57 @@ +/* Generated by ./xlat/gen.sh from ./xlat/routing_scopes.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(RT_SCOPE_UNIVERSE) || (defined(HAVE_DECL_RT_SCOPE_UNIVERSE) && HAVE_DECL_RT_SCOPE_UNIVERSE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RT_SCOPE_UNIVERSE) == (0), "RT_SCOPE_UNIVERSE != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RT_SCOPE_UNIVERSE 0 +#endif +#if defined(RT_SCOPE_SITE) || (defined(HAVE_DECL_RT_SCOPE_SITE) && HAVE_DECL_RT_SCOPE_SITE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RT_SCOPE_SITE) == (200), "RT_SCOPE_SITE != 200"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RT_SCOPE_SITE 200 +#endif +#if defined(RT_SCOPE_LINK) || (defined(HAVE_DECL_RT_SCOPE_LINK) && HAVE_DECL_RT_SCOPE_LINK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RT_SCOPE_LINK) == (253), "RT_SCOPE_LINK != 253"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RT_SCOPE_LINK 253 +#endif +#if defined(RT_SCOPE_HOST) || (defined(HAVE_DECL_RT_SCOPE_HOST) && HAVE_DECL_RT_SCOPE_HOST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RT_SCOPE_HOST) == (254), "RT_SCOPE_HOST != 254"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RT_SCOPE_HOST 254 +#endif +#if defined(RT_SCOPE_NOWHERE) || (defined(HAVE_DECL_RT_SCOPE_NOWHERE) && HAVE_DECL_RT_SCOPE_NOWHERE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RT_SCOPE_NOWHERE) == (255), "RT_SCOPE_NOWHERE != 255"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RT_SCOPE_NOWHERE 255 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS + +const struct xlat routing_scopes[] = { + XLAT(RT_SCOPE_UNIVERSE), + XLAT(RT_SCOPE_SITE), + XLAT(RT_SCOPE_LINK), + XLAT(RT_SCOPE_HOST), + XLAT(RT_SCOPE_NOWHERE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/routing_scopes.in b/xlat/routing_scopes.in new file mode 100644 index 00000000..c431e9f2 --- /dev/null +++ b/xlat/routing_scopes.in @@ -0,0 +1,5 @@ +RT_SCOPE_UNIVERSE 0 +RT_SCOPE_SITE 200 +RT_SCOPE_LINK 253 +RT_SCOPE_HOST 254 +RT_SCOPE_NOWHERE 255 diff --git a/xlat/routing_table_ids.h b/xlat/routing_table_ids.h new file mode 100644 index 00000000..9bab8026 --- /dev/null +++ b/xlat/routing_table_ids.h @@ -0,0 +1,57 @@ +/* Generated by ./xlat/gen.sh from ./xlat/routing_table_ids.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(RT_TABLE_UNSPEC) || (defined(HAVE_DECL_RT_TABLE_UNSPEC) && HAVE_DECL_RT_TABLE_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RT_TABLE_UNSPEC) == (0), "RT_TABLE_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RT_TABLE_UNSPEC 0 +#endif +#if defined(RT_TABLE_COMPAT) || (defined(HAVE_DECL_RT_TABLE_COMPAT) && HAVE_DECL_RT_TABLE_COMPAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RT_TABLE_COMPAT) == (252), "RT_TABLE_COMPAT != 252"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RT_TABLE_COMPAT 252 +#endif +#if defined(RT_TABLE_DEFAULT) || (defined(HAVE_DECL_RT_TABLE_DEFAULT) && HAVE_DECL_RT_TABLE_DEFAULT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RT_TABLE_DEFAULT) == (253), "RT_TABLE_DEFAULT != 253"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RT_TABLE_DEFAULT 253 +#endif +#if defined(RT_TABLE_MAIN) || (defined(HAVE_DECL_RT_TABLE_MAIN) && HAVE_DECL_RT_TABLE_MAIN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RT_TABLE_MAIN) == (254), "RT_TABLE_MAIN != 254"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RT_TABLE_MAIN 254 +#endif +#if defined(RT_TABLE_LOCAL) || (defined(HAVE_DECL_RT_TABLE_LOCAL) && HAVE_DECL_RT_TABLE_LOCAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RT_TABLE_LOCAL) == (255), "RT_TABLE_LOCAL != 255"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RT_TABLE_LOCAL 255 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS + +const struct xlat routing_table_ids[] = { + XLAT(RT_TABLE_UNSPEC), + XLAT(RT_TABLE_COMPAT), + XLAT(RT_TABLE_DEFAULT), + XLAT(RT_TABLE_MAIN), + XLAT(RT_TABLE_LOCAL), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/routing_table_ids.in b/xlat/routing_table_ids.in new file mode 100644 index 00000000..6a1f7977 --- /dev/null +++ b/xlat/routing_table_ids.in @@ -0,0 +1,5 @@ +RT_TABLE_UNSPEC 0 +RT_TABLE_COMPAT 252 +RT_TABLE_DEFAULT 253 +RT_TABLE_MAIN 254 +RT_TABLE_LOCAL 255 diff --git a/xlat/routing_types.h b/xlat/routing_types.h new file mode 100644 index 00000000..e5b76fc3 --- /dev/null +++ b/xlat/routing_types.h @@ -0,0 +1,113 @@ +/* Generated by ./xlat/gen.sh from ./xlat/routing_types.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(RTN_UNSPEC) || (defined(HAVE_DECL_RTN_UNSPEC) && HAVE_DECL_RTN_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTN_UNSPEC) == (0), "RTN_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTN_UNSPEC 0 +#endif +#if defined(RTN_UNICAST) || (defined(HAVE_DECL_RTN_UNICAST) && HAVE_DECL_RTN_UNICAST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTN_UNICAST) == (1), "RTN_UNICAST != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTN_UNICAST 1 +#endif +#if defined(RTN_LOCAL) || (defined(HAVE_DECL_RTN_LOCAL) && HAVE_DECL_RTN_LOCAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTN_LOCAL) == (2), "RTN_LOCAL != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTN_LOCAL 2 +#endif +#if defined(RTN_BROADCAST) || (defined(HAVE_DECL_RTN_BROADCAST) && HAVE_DECL_RTN_BROADCAST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTN_BROADCAST) == (3), "RTN_BROADCAST != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTN_BROADCAST 3 +#endif +#if defined(RTN_ANYCAST) || (defined(HAVE_DECL_RTN_ANYCAST) && HAVE_DECL_RTN_ANYCAST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTN_ANYCAST) == (4), "RTN_ANYCAST != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTN_ANYCAST 4 +#endif +#if defined(RTN_MULTICAST) || (defined(HAVE_DECL_RTN_MULTICAST) && HAVE_DECL_RTN_MULTICAST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTN_MULTICAST) == (5), "RTN_MULTICAST != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTN_MULTICAST 5 +#endif +#if defined(RTN_BLACKHOLE) || (defined(HAVE_DECL_RTN_BLACKHOLE) && HAVE_DECL_RTN_BLACKHOLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTN_BLACKHOLE) == (6), "RTN_BLACKHOLE != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTN_BLACKHOLE 6 +#endif +#if defined(RTN_UNREACHABLE) || (defined(HAVE_DECL_RTN_UNREACHABLE) && HAVE_DECL_RTN_UNREACHABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTN_UNREACHABLE) == (7), "RTN_UNREACHABLE != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTN_UNREACHABLE 7 +#endif +#if defined(RTN_PROHIBIT) || (defined(HAVE_DECL_RTN_PROHIBIT) && HAVE_DECL_RTN_PROHIBIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTN_PROHIBIT) == (8), "RTN_PROHIBIT != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTN_PROHIBIT 8 +#endif +#if defined(RTN_THROW) || (defined(HAVE_DECL_RTN_THROW) && HAVE_DECL_RTN_THROW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTN_THROW) == (9), "RTN_THROW != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTN_THROW 9 +#endif +#if defined(RTN_NAT) || (defined(HAVE_DECL_RTN_NAT) && HAVE_DECL_RTN_NAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTN_NAT) == (10), "RTN_NAT != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTN_NAT 10 +#endif +#if defined(RTN_XRESOLVE) || (defined(HAVE_DECL_RTN_XRESOLVE) && HAVE_DECL_RTN_XRESOLVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTN_XRESOLVE) == (11), "RTN_XRESOLVE != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTN_XRESOLVE 11 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS + +const struct xlat routing_types[] = { + XLAT(RTN_UNSPEC), + XLAT(RTN_UNICAST), + XLAT(RTN_LOCAL), + XLAT(RTN_BROADCAST), + XLAT(RTN_ANYCAST), + XLAT(RTN_MULTICAST), + XLAT(RTN_BLACKHOLE), + XLAT(RTN_UNREACHABLE), + XLAT(RTN_PROHIBIT), + XLAT(RTN_THROW), + XLAT(RTN_NAT), + XLAT(RTN_XRESOLVE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/routing_types.in b/xlat/routing_types.in new file mode 100644 index 00000000..f7079d4e --- /dev/null +++ b/xlat/routing_types.in @@ -0,0 +1,12 @@ +RTN_UNSPEC 0 +RTN_UNICAST 1 +RTN_LOCAL 2 +RTN_BROADCAST 3 +RTN_ANYCAST 4 +RTN_MULTICAST 5 +RTN_BLACKHOLE 6 +RTN_UNREACHABLE 7 +RTN_PROHIBIT 8 +RTN_THROW 9 +RTN_NAT 10 +RTN_XRESOLVE 11 diff --git a/xlat/rtnl_addr_attrs.h b/xlat/rtnl_addr_attrs.h new file mode 100644 index 00000000..3e58ba23 --- /dev/null +++ b/xlat/rtnl_addr_attrs.h @@ -0,0 +1,110 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_addr_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IFA_UNSPEC) || (defined(HAVE_DECL_IFA_UNSPEC) && HAVE_DECL_IFA_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFA_UNSPEC) == (0), "IFA_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFA_UNSPEC 0 +#endif +#if defined(IFA_ADDRESS) || (defined(HAVE_DECL_IFA_ADDRESS) && HAVE_DECL_IFA_ADDRESS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFA_ADDRESS) == (1), "IFA_ADDRESS != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFA_ADDRESS 1 +#endif +#if defined(IFA_LOCAL) || (defined(HAVE_DECL_IFA_LOCAL) && HAVE_DECL_IFA_LOCAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFA_LOCAL) == (2), "IFA_LOCAL != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFA_LOCAL 2 +#endif +#if defined(IFA_LABEL) || (defined(HAVE_DECL_IFA_LABEL) && HAVE_DECL_IFA_LABEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFA_LABEL) == (3), "IFA_LABEL != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFA_LABEL 3 +#endif +#if defined(IFA_BROADCAST) || (defined(HAVE_DECL_IFA_BROADCAST) && HAVE_DECL_IFA_BROADCAST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFA_BROADCAST) == (4), "IFA_BROADCAST != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFA_BROADCAST 4 +#endif +#if defined(IFA_ANYCAST) || (defined(HAVE_DECL_IFA_ANYCAST) && HAVE_DECL_IFA_ANYCAST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFA_ANYCAST) == (5), "IFA_ANYCAST != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFA_ANYCAST 5 +#endif +#if defined(IFA_CACHEINFO) || (defined(HAVE_DECL_IFA_CACHEINFO) && HAVE_DECL_IFA_CACHEINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFA_CACHEINFO) == (6), "IFA_CACHEINFO != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFA_CACHEINFO 6 +#endif +#if defined(IFA_MULTICAST) || (defined(HAVE_DECL_IFA_MULTICAST) && HAVE_DECL_IFA_MULTICAST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFA_MULTICAST) == (7), "IFA_MULTICAST != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFA_MULTICAST 7 +#endif +#if defined(IFA_FLAGS) || (defined(HAVE_DECL_IFA_FLAGS) && HAVE_DECL_IFA_FLAGS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFA_FLAGS) == (8), "IFA_FLAGS != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFA_FLAGS 8 +#endif +#if defined(IFA_RT_PRIORITY) || (defined(HAVE_DECL_IFA_RT_PRIORITY) && HAVE_DECL_IFA_RT_PRIORITY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFA_RT_PRIORITY) == (9), "IFA_RT_PRIORITY != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFA_RT_PRIORITY 9 +#endif +#if defined(IFA_TARGET_NETNSID) || (defined(HAVE_DECL_IFA_TARGET_NETNSID) && HAVE_DECL_IFA_TARGET_NETNSID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFA_TARGET_NETNSID) == (10), "IFA_TARGET_NETNSID != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFA_TARGET_NETNSID 10 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_addr_attrs in mpers mode + +# else + +static +const struct xlat rtnl_addr_attrs[] = { + XLAT(IFA_UNSPEC), + XLAT(IFA_ADDRESS), + XLAT(IFA_LOCAL), + XLAT(IFA_LABEL), + XLAT(IFA_BROADCAST), + XLAT(IFA_ANYCAST), + XLAT(IFA_CACHEINFO), + XLAT(IFA_MULTICAST), + XLAT(IFA_FLAGS), + XLAT(IFA_RT_PRIORITY), + XLAT(IFA_TARGET_NETNSID), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_addr_attrs.in b/xlat/rtnl_addr_attrs.in new file mode 100644 index 00000000..747a1c7d --- /dev/null +++ b/xlat/rtnl_addr_attrs.in @@ -0,0 +1,11 @@ +IFA_UNSPEC 0 +IFA_ADDRESS 1 +IFA_LOCAL 2 +IFA_LABEL 3 +IFA_BROADCAST 4 +IFA_ANYCAST 5 +IFA_CACHEINFO 6 +IFA_MULTICAST 7 +IFA_FLAGS 8 +IFA_RT_PRIORITY 9 +IFA_TARGET_NETNSID 10 diff --git a/xlat/rtnl_addrlabel_attrs.h b/xlat/rtnl_addrlabel_attrs.h new file mode 100644 index 00000000..f4b7e7f6 --- /dev/null +++ b/xlat/rtnl_addrlabel_attrs.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_addrlabel_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IFAL_ADDRESS) || (defined(HAVE_DECL_IFAL_ADDRESS) && HAVE_DECL_IFAL_ADDRESS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFAL_ADDRESS) == (1), "IFAL_ADDRESS != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFAL_ADDRESS 1 +#endif +#if defined(IFAL_LABEL) || (defined(HAVE_DECL_IFAL_LABEL) && HAVE_DECL_IFAL_LABEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFAL_LABEL) == (2), "IFAL_LABEL != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFAL_LABEL 2 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_addrlabel_attrs in mpers mode + +# else + +static +const struct xlat rtnl_addrlabel_attrs[] = { + XLAT(IFAL_ADDRESS), + XLAT(IFAL_LABEL), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_addrlabel_attrs.in b/xlat/rtnl_addrlabel_attrs.in new file mode 100644 index 00000000..0dc464d6 --- /dev/null +++ b/xlat/rtnl_addrlabel_attrs.in @@ -0,0 +1,2 @@ +IFAL_ADDRESS 1 +IFAL_LABEL 2 diff --git a/xlat/rtnl_dcb_attrs.h b/xlat/rtnl_dcb_attrs.h new file mode 100644 index 00000000..9f2b6751 --- /dev/null +++ b/xlat/rtnl_dcb_attrs.h @@ -0,0 +1,158 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_dcb_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(DCB_ATTR_UNDEFINED) || (defined(HAVE_DECL_DCB_ATTR_UNDEFINED) && HAVE_DECL_DCB_ATTR_UNDEFINED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_ATTR_UNDEFINED) == (0), "DCB_ATTR_UNDEFINED != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_ATTR_UNDEFINED 0 +#endif +#if defined(DCB_ATTR_IFNAME) || (defined(HAVE_DECL_DCB_ATTR_IFNAME) && HAVE_DECL_DCB_ATTR_IFNAME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_ATTR_IFNAME) == (1), "DCB_ATTR_IFNAME != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_ATTR_IFNAME 1 +#endif +#if defined(DCB_ATTR_STATE) || (defined(HAVE_DECL_DCB_ATTR_STATE) && HAVE_DECL_DCB_ATTR_STATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_ATTR_STATE) == (2), "DCB_ATTR_STATE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_ATTR_STATE 2 +#endif +#if defined(DCB_ATTR_PFC_STATE) || (defined(HAVE_DECL_DCB_ATTR_PFC_STATE) && HAVE_DECL_DCB_ATTR_PFC_STATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_ATTR_PFC_STATE) == (3), "DCB_ATTR_PFC_STATE != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_ATTR_PFC_STATE 3 +#endif +#if defined(DCB_ATTR_PFC_CFG) || (defined(HAVE_DECL_DCB_ATTR_PFC_CFG) && HAVE_DECL_DCB_ATTR_PFC_CFG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_ATTR_PFC_CFG) == (4), "DCB_ATTR_PFC_CFG != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_ATTR_PFC_CFG 4 +#endif +#if defined(DCB_ATTR_NUM_TC) || (defined(HAVE_DECL_DCB_ATTR_NUM_TC) && HAVE_DECL_DCB_ATTR_NUM_TC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_ATTR_NUM_TC) == (5), "DCB_ATTR_NUM_TC != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_ATTR_NUM_TC 5 +#endif +#if defined(DCB_ATTR_PG_CFG) || (defined(HAVE_DECL_DCB_ATTR_PG_CFG) && HAVE_DECL_DCB_ATTR_PG_CFG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_ATTR_PG_CFG) == (6), "DCB_ATTR_PG_CFG != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_ATTR_PG_CFG 6 +#endif +#if defined(DCB_ATTR_SET_ALL) || (defined(HAVE_DECL_DCB_ATTR_SET_ALL) && HAVE_DECL_DCB_ATTR_SET_ALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_ATTR_SET_ALL) == (7), "DCB_ATTR_SET_ALL != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_ATTR_SET_ALL 7 +#endif +#if defined(DCB_ATTR_PERM_HWADDR) || (defined(HAVE_DECL_DCB_ATTR_PERM_HWADDR) && HAVE_DECL_DCB_ATTR_PERM_HWADDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_ATTR_PERM_HWADDR) == (8), "DCB_ATTR_PERM_HWADDR != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_ATTR_PERM_HWADDR 8 +#endif +#if defined(DCB_ATTR_CAP) || (defined(HAVE_DECL_DCB_ATTR_CAP) && HAVE_DECL_DCB_ATTR_CAP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_ATTR_CAP) == (9), "DCB_ATTR_CAP != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_ATTR_CAP 9 +#endif +#if defined(DCB_ATTR_NUMTCS) || (defined(HAVE_DECL_DCB_ATTR_NUMTCS) && HAVE_DECL_DCB_ATTR_NUMTCS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_ATTR_NUMTCS) == (10), "DCB_ATTR_NUMTCS != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_ATTR_NUMTCS 10 +#endif +#if defined(DCB_ATTR_BCN) || (defined(HAVE_DECL_DCB_ATTR_BCN) && HAVE_DECL_DCB_ATTR_BCN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_ATTR_BCN) == (11), "DCB_ATTR_BCN != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_ATTR_BCN 11 +#endif +#if defined(DCB_ATTR_APP) || (defined(HAVE_DECL_DCB_ATTR_APP) && HAVE_DECL_DCB_ATTR_APP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_ATTR_APP) == (12), "DCB_ATTR_APP != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_ATTR_APP 12 +#endif +#if defined(DCB_ATTR_IEEE) || (defined(HAVE_DECL_DCB_ATTR_IEEE) && HAVE_DECL_DCB_ATTR_IEEE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_ATTR_IEEE) == (13), "DCB_ATTR_IEEE != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_ATTR_IEEE 13 +#endif +#if defined(DCB_ATTR_DCBX) || (defined(HAVE_DECL_DCB_ATTR_DCBX) && HAVE_DECL_DCB_ATTR_DCBX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_ATTR_DCBX) == (14), "DCB_ATTR_DCBX != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_ATTR_DCBX 14 +#endif +#if defined(DCB_ATTR_FEATCFG) || (defined(HAVE_DECL_DCB_ATTR_FEATCFG) && HAVE_DECL_DCB_ATTR_FEATCFG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_ATTR_FEATCFG) == (15), "DCB_ATTR_FEATCFG != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_ATTR_FEATCFG 15 +#endif +#if defined(DCB_ATTR_CEE) || (defined(HAVE_DECL_DCB_ATTR_CEE) && HAVE_DECL_DCB_ATTR_CEE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCB_ATTR_CEE) == (16), "DCB_ATTR_CEE != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCB_ATTR_CEE 16 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_dcb_attrs in mpers mode + +# else + +static +const struct xlat rtnl_dcb_attrs[] = { + XLAT(DCB_ATTR_UNDEFINED), + XLAT(DCB_ATTR_IFNAME), + XLAT(DCB_ATTR_STATE), + XLAT(DCB_ATTR_PFC_STATE), + XLAT(DCB_ATTR_PFC_CFG), + XLAT(DCB_ATTR_NUM_TC), + XLAT(DCB_ATTR_PG_CFG), + XLAT(DCB_ATTR_SET_ALL), + XLAT(DCB_ATTR_PERM_HWADDR), + XLAT(DCB_ATTR_CAP), + XLAT(DCB_ATTR_NUMTCS), + XLAT(DCB_ATTR_BCN), + XLAT(DCB_ATTR_APP), + XLAT(DCB_ATTR_IEEE), + XLAT(DCB_ATTR_DCBX), + XLAT(DCB_ATTR_FEATCFG), + XLAT(DCB_ATTR_CEE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_dcb_attrs.in b/xlat/rtnl_dcb_attrs.in new file mode 100644 index 00000000..dd2ddf73 --- /dev/null +++ b/xlat/rtnl_dcb_attrs.in @@ -0,0 +1,17 @@ +DCB_ATTR_UNDEFINED 0 +DCB_ATTR_IFNAME 1 +DCB_ATTR_STATE 2 +DCB_ATTR_PFC_STATE 3 +DCB_ATTR_PFC_CFG 4 +DCB_ATTR_NUM_TC 5 +DCB_ATTR_PG_CFG 6 +DCB_ATTR_SET_ALL 7 +DCB_ATTR_PERM_HWADDR 8 +DCB_ATTR_CAP 9 +DCB_ATTR_NUMTCS 10 +DCB_ATTR_BCN 11 +DCB_ATTR_APP 12 +DCB_ATTR_IEEE 13 +DCB_ATTR_DCBX 14 +DCB_ATTR_FEATCFG 15 +DCB_ATTR_CEE 16 diff --git a/xlat/rtnl_ifla_af_spec_inet6_attrs.h b/xlat/rtnl_ifla_af_spec_inet6_attrs.h new file mode 100644 index 00000000..7a2e18bb --- /dev/null +++ b/xlat/rtnl_ifla_af_spec_inet6_attrs.h @@ -0,0 +1,94 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_ifla_af_spec_inet6_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IFLA_INET6_UNSPEC) || (defined(HAVE_DECL_IFLA_INET6_UNSPEC) && HAVE_DECL_IFLA_INET6_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_INET6_UNSPEC) == (0), "IFLA_INET6_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_INET6_UNSPEC 0 +#endif +#if defined(IFLA_INET6_FLAGS) || (defined(HAVE_DECL_IFLA_INET6_FLAGS) && HAVE_DECL_IFLA_INET6_FLAGS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_INET6_FLAGS) == (1), "IFLA_INET6_FLAGS != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_INET6_FLAGS 1 +#endif +#if defined(IFLA_INET6_CONF) || (defined(HAVE_DECL_IFLA_INET6_CONF) && HAVE_DECL_IFLA_INET6_CONF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_INET6_CONF) == (2), "IFLA_INET6_CONF != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_INET6_CONF 2 +#endif +#if defined(IFLA_INET6_STATS) || (defined(HAVE_DECL_IFLA_INET6_STATS) && HAVE_DECL_IFLA_INET6_STATS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_INET6_STATS) == (3), "IFLA_INET6_STATS != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_INET6_STATS 3 +#endif +#if defined(IFLA_INET6_MCAST) || (defined(HAVE_DECL_IFLA_INET6_MCAST) && HAVE_DECL_IFLA_INET6_MCAST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_INET6_MCAST) == (4), "IFLA_INET6_MCAST != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_INET6_MCAST 4 +#endif +#if defined(IFLA_INET6_CACHEINFO) || (defined(HAVE_DECL_IFLA_INET6_CACHEINFO) && HAVE_DECL_IFLA_INET6_CACHEINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_INET6_CACHEINFO) == (5), "IFLA_INET6_CACHEINFO != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_INET6_CACHEINFO 5 +#endif +#if defined(IFLA_INET6_ICMP6STATS) || (defined(HAVE_DECL_IFLA_INET6_ICMP6STATS) && HAVE_DECL_IFLA_INET6_ICMP6STATS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_INET6_ICMP6STATS) == (6), "IFLA_INET6_ICMP6STATS != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_INET6_ICMP6STATS 6 +#endif +#if defined(IFLA_INET6_TOKEN) || (defined(HAVE_DECL_IFLA_INET6_TOKEN) && HAVE_DECL_IFLA_INET6_TOKEN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_INET6_TOKEN) == (7), "IFLA_INET6_TOKEN != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_INET6_TOKEN 7 +#endif +#if defined(IFLA_INET6_ADDR_GEN_MODE) || (defined(HAVE_DECL_IFLA_INET6_ADDR_GEN_MODE) && HAVE_DECL_IFLA_INET6_ADDR_GEN_MODE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_INET6_ADDR_GEN_MODE) == (8), "IFLA_INET6_ADDR_GEN_MODE != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_INET6_ADDR_GEN_MODE 8 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_ifla_af_spec_inet6_attrs in mpers mode + +# else + +static +const struct xlat rtnl_ifla_af_spec_inet6_attrs[] = { + [IFLA_INET6_UNSPEC] = XLAT(IFLA_INET6_UNSPEC), + [IFLA_INET6_FLAGS] = XLAT(IFLA_INET6_FLAGS), + [IFLA_INET6_CONF] = XLAT(IFLA_INET6_CONF), + [IFLA_INET6_STATS] = XLAT(IFLA_INET6_STATS), + [IFLA_INET6_MCAST] = XLAT(IFLA_INET6_MCAST), + [IFLA_INET6_CACHEINFO] = XLAT(IFLA_INET6_CACHEINFO), + [IFLA_INET6_ICMP6STATS] = XLAT(IFLA_INET6_ICMP6STATS), + [IFLA_INET6_TOKEN] = XLAT(IFLA_INET6_TOKEN), + [IFLA_INET6_ADDR_GEN_MODE] = XLAT(IFLA_INET6_ADDR_GEN_MODE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_ifla_af_spec_inet6_attrs.in b/xlat/rtnl_ifla_af_spec_inet6_attrs.in new file mode 100644 index 00000000..9717d5aa --- /dev/null +++ b/xlat/rtnl_ifla_af_spec_inet6_attrs.in @@ -0,0 +1,10 @@ +#value_indexed +IFLA_INET6_UNSPEC 0 +IFLA_INET6_FLAGS 1 +IFLA_INET6_CONF 2 +IFLA_INET6_STATS 3 +IFLA_INET6_MCAST 4 +IFLA_INET6_CACHEINFO 5 +IFLA_INET6_ICMP6STATS 6 +IFLA_INET6_TOKEN 7 +IFLA_INET6_ADDR_GEN_MODE 8 diff --git a/xlat/rtnl_ifla_af_spec_inet_attrs.h b/xlat/rtnl_ifla_af_spec_inet_attrs.h new file mode 100644 index 00000000..8dd12203 --- /dev/null +++ b/xlat/rtnl_ifla_af_spec_inet_attrs.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_ifla_af_spec_inet_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IFLA_INET_UNSPEC) || (defined(HAVE_DECL_IFLA_INET_UNSPEC) && HAVE_DECL_IFLA_INET_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_INET_UNSPEC) == (0), "IFLA_INET_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_INET_UNSPEC 0 +#endif +#if defined(IFLA_INET_CONF) || (defined(HAVE_DECL_IFLA_INET_CONF) && HAVE_DECL_IFLA_INET_CONF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_INET_CONF) == (1), "IFLA_INET_CONF != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_INET_CONF 1 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_ifla_af_spec_inet_attrs in mpers mode + +# else + +static +const struct xlat rtnl_ifla_af_spec_inet_attrs[] = { + [IFLA_INET_UNSPEC] = XLAT(IFLA_INET_UNSPEC), + [IFLA_INET_CONF] = XLAT(IFLA_INET_CONF), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_ifla_af_spec_inet_attrs.in b/xlat/rtnl_ifla_af_spec_inet_attrs.in new file mode 100644 index 00000000..79799758 --- /dev/null +++ b/xlat/rtnl_ifla_af_spec_inet_attrs.in @@ -0,0 +1,3 @@ +#value_indexed +IFLA_INET_UNSPEC 0 +IFLA_INET_CONF 1 diff --git a/xlat/rtnl_ifla_brport_attrs.h b/xlat/rtnl_ifla_brport_attrs.h new file mode 100644 index 00000000..fdef1af3 --- /dev/null +++ b/xlat/rtnl_ifla_brport_attrs.h @@ -0,0 +1,302 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_ifla_brport_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IFLA_BRPORT_UNSPEC) || (defined(HAVE_DECL_IFLA_BRPORT_UNSPEC) && HAVE_DECL_IFLA_BRPORT_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_UNSPEC) == (0), "IFLA_BRPORT_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_UNSPEC 0 +#endif +#if defined(IFLA_BRPORT_STATE) || (defined(HAVE_DECL_IFLA_BRPORT_STATE) && HAVE_DECL_IFLA_BRPORT_STATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_STATE) == (1), "IFLA_BRPORT_STATE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_STATE 1 +#endif +#if defined(IFLA_BRPORT_PRIORITY) || (defined(HAVE_DECL_IFLA_BRPORT_PRIORITY) && HAVE_DECL_IFLA_BRPORT_PRIORITY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_PRIORITY) == (2), "IFLA_BRPORT_PRIORITY != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_PRIORITY 2 +#endif +#if defined(IFLA_BRPORT_COST) || (defined(HAVE_DECL_IFLA_BRPORT_COST) && HAVE_DECL_IFLA_BRPORT_COST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_COST) == (3), "IFLA_BRPORT_COST != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_COST 3 +#endif +#if defined(IFLA_BRPORT_MODE) || (defined(HAVE_DECL_IFLA_BRPORT_MODE) && HAVE_DECL_IFLA_BRPORT_MODE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_MODE) == (4), "IFLA_BRPORT_MODE != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_MODE 4 +#endif +#if defined(IFLA_BRPORT_GUARD) || (defined(HAVE_DECL_IFLA_BRPORT_GUARD) && HAVE_DECL_IFLA_BRPORT_GUARD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_GUARD) == (5), "IFLA_BRPORT_GUARD != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_GUARD 5 +#endif +#if defined(IFLA_BRPORT_PROTECT) || (defined(HAVE_DECL_IFLA_BRPORT_PROTECT) && HAVE_DECL_IFLA_BRPORT_PROTECT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_PROTECT) == (6), "IFLA_BRPORT_PROTECT != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_PROTECT 6 +#endif +#if defined(IFLA_BRPORT_FAST_LEAVE) || (defined(HAVE_DECL_IFLA_BRPORT_FAST_LEAVE) && HAVE_DECL_IFLA_BRPORT_FAST_LEAVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_FAST_LEAVE) == (7), "IFLA_BRPORT_FAST_LEAVE != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_FAST_LEAVE 7 +#endif +#if defined(IFLA_BRPORT_LEARNING) || (defined(HAVE_DECL_IFLA_BRPORT_LEARNING) && HAVE_DECL_IFLA_BRPORT_LEARNING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_LEARNING) == (8), "IFLA_BRPORT_LEARNING != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_LEARNING 8 +#endif +#if defined(IFLA_BRPORT_UNICAST_FLOOD) || (defined(HAVE_DECL_IFLA_BRPORT_UNICAST_FLOOD) && HAVE_DECL_IFLA_BRPORT_UNICAST_FLOOD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_UNICAST_FLOOD) == (9), "IFLA_BRPORT_UNICAST_FLOOD != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_UNICAST_FLOOD 9 +#endif +#if defined(IFLA_BRPORT_PROXYARP) || (defined(HAVE_DECL_IFLA_BRPORT_PROXYARP) && HAVE_DECL_IFLA_BRPORT_PROXYARP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_PROXYARP) == (10), "IFLA_BRPORT_PROXYARP != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_PROXYARP 10 +#endif +#if defined(IFLA_BRPORT_LEARNING_SYNC) || (defined(HAVE_DECL_IFLA_BRPORT_LEARNING_SYNC) && HAVE_DECL_IFLA_BRPORT_LEARNING_SYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_LEARNING_SYNC) == (11), "IFLA_BRPORT_LEARNING_SYNC != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_LEARNING_SYNC 11 +#endif +#if defined(IFLA_BRPORT_PROXYARP_WIFI) || (defined(HAVE_DECL_IFLA_BRPORT_PROXYARP_WIFI) && HAVE_DECL_IFLA_BRPORT_PROXYARP_WIFI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_PROXYARP_WIFI) == (12), "IFLA_BRPORT_PROXYARP_WIFI != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_PROXYARP_WIFI 12 +#endif +#if defined(IFLA_BRPORT_ROOT_ID) || (defined(HAVE_DECL_IFLA_BRPORT_ROOT_ID) && HAVE_DECL_IFLA_BRPORT_ROOT_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_ROOT_ID) == (13), "IFLA_BRPORT_ROOT_ID != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_ROOT_ID 13 +#endif +#if defined(IFLA_BRPORT_BRIDGE_ID) || (defined(HAVE_DECL_IFLA_BRPORT_BRIDGE_ID) && HAVE_DECL_IFLA_BRPORT_BRIDGE_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_BRIDGE_ID) == (14), "IFLA_BRPORT_BRIDGE_ID != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_BRIDGE_ID 14 +#endif +#if defined(IFLA_BRPORT_DESIGNATED_PORT) || (defined(HAVE_DECL_IFLA_BRPORT_DESIGNATED_PORT) && HAVE_DECL_IFLA_BRPORT_DESIGNATED_PORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_DESIGNATED_PORT) == (15), "IFLA_BRPORT_DESIGNATED_PORT != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_DESIGNATED_PORT 15 +#endif +#if defined(IFLA_BRPORT_DESIGNATED_COST) || (defined(HAVE_DECL_IFLA_BRPORT_DESIGNATED_COST) && HAVE_DECL_IFLA_BRPORT_DESIGNATED_COST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_DESIGNATED_COST) == (16), "IFLA_BRPORT_DESIGNATED_COST != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_DESIGNATED_COST 16 +#endif +#if defined(IFLA_BRPORT_ID) || (defined(HAVE_DECL_IFLA_BRPORT_ID) && HAVE_DECL_IFLA_BRPORT_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_ID) == (17), "IFLA_BRPORT_ID != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_ID 17 +#endif +#if defined(IFLA_BRPORT_NO) || (defined(HAVE_DECL_IFLA_BRPORT_NO) && HAVE_DECL_IFLA_BRPORT_NO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_NO) == (18), "IFLA_BRPORT_NO != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_NO 18 +#endif +#if defined(IFLA_BRPORT_TOPOLOGY_CHANGE_ACK) || (defined(HAVE_DECL_IFLA_BRPORT_TOPOLOGY_CHANGE_ACK) && HAVE_DECL_IFLA_BRPORT_TOPOLOGY_CHANGE_ACK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_TOPOLOGY_CHANGE_ACK) == (19), "IFLA_BRPORT_TOPOLOGY_CHANGE_ACK != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_TOPOLOGY_CHANGE_ACK 19 +#endif +#if defined(IFLA_BRPORT_CONFIG_PENDING) || (defined(HAVE_DECL_IFLA_BRPORT_CONFIG_PENDING) && HAVE_DECL_IFLA_BRPORT_CONFIG_PENDING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_CONFIG_PENDING) == (20), "IFLA_BRPORT_CONFIG_PENDING != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_CONFIG_PENDING 20 +#endif +#if defined(IFLA_BRPORT_MESSAGE_AGE_TIMER) || (defined(HAVE_DECL_IFLA_BRPORT_MESSAGE_AGE_TIMER) && HAVE_DECL_IFLA_BRPORT_MESSAGE_AGE_TIMER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_MESSAGE_AGE_TIMER) == (21), "IFLA_BRPORT_MESSAGE_AGE_TIMER != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_MESSAGE_AGE_TIMER 21 +#endif +#if defined(IFLA_BRPORT_FORWARD_DELAY_TIMER) || (defined(HAVE_DECL_IFLA_BRPORT_FORWARD_DELAY_TIMER) && HAVE_DECL_IFLA_BRPORT_FORWARD_DELAY_TIMER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_FORWARD_DELAY_TIMER) == (22), "IFLA_BRPORT_FORWARD_DELAY_TIMER != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_FORWARD_DELAY_TIMER 22 +#endif +#if defined(IFLA_BRPORT_HOLD_TIMER) || (defined(HAVE_DECL_IFLA_BRPORT_HOLD_TIMER) && HAVE_DECL_IFLA_BRPORT_HOLD_TIMER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_HOLD_TIMER) == (23), "IFLA_BRPORT_HOLD_TIMER != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_HOLD_TIMER 23 +#endif +#if defined(IFLA_BRPORT_FLUSH) || (defined(HAVE_DECL_IFLA_BRPORT_FLUSH) && HAVE_DECL_IFLA_BRPORT_FLUSH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_FLUSH) == (24), "IFLA_BRPORT_FLUSH != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_FLUSH 24 +#endif +#if defined(IFLA_BRPORT_MULTICAST_ROUTER) || (defined(HAVE_DECL_IFLA_BRPORT_MULTICAST_ROUTER) && HAVE_DECL_IFLA_BRPORT_MULTICAST_ROUTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_MULTICAST_ROUTER) == (25), "IFLA_BRPORT_MULTICAST_ROUTER != 25"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_MULTICAST_ROUTER 25 +#endif +#if defined(IFLA_BRPORT_PAD) || (defined(HAVE_DECL_IFLA_BRPORT_PAD) && HAVE_DECL_IFLA_BRPORT_PAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_PAD) == (26), "IFLA_BRPORT_PAD != 26"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_PAD 26 +#endif +#if defined(IFLA_BRPORT_MCAST_FLOOD) || (defined(HAVE_DECL_IFLA_BRPORT_MCAST_FLOOD) && HAVE_DECL_IFLA_BRPORT_MCAST_FLOOD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_MCAST_FLOOD) == (27), "IFLA_BRPORT_MCAST_FLOOD != 27"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_MCAST_FLOOD 27 +#endif +#if defined(IFLA_BRPORT_MCAST_TO_UCAST) || (defined(HAVE_DECL_IFLA_BRPORT_MCAST_TO_UCAST) && HAVE_DECL_IFLA_BRPORT_MCAST_TO_UCAST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_MCAST_TO_UCAST) == (28), "IFLA_BRPORT_MCAST_TO_UCAST != 28"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_MCAST_TO_UCAST 28 +#endif +#if defined(IFLA_BRPORT_VLAN_TUNNEL) || (defined(HAVE_DECL_IFLA_BRPORT_VLAN_TUNNEL) && HAVE_DECL_IFLA_BRPORT_VLAN_TUNNEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_VLAN_TUNNEL) == (29), "IFLA_BRPORT_VLAN_TUNNEL != 29"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_VLAN_TUNNEL 29 +#endif +#if defined(IFLA_BRPORT_BCAST_FLOOD) || (defined(HAVE_DECL_IFLA_BRPORT_BCAST_FLOOD) && HAVE_DECL_IFLA_BRPORT_BCAST_FLOOD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_BCAST_FLOOD) == (30), "IFLA_BRPORT_BCAST_FLOOD != 30"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_BCAST_FLOOD 30 +#endif +#if defined(IFLA_BRPORT_GROUP_FWD_MASK) || (defined(HAVE_DECL_IFLA_BRPORT_GROUP_FWD_MASK) && HAVE_DECL_IFLA_BRPORT_GROUP_FWD_MASK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_GROUP_FWD_MASK) == (31), "IFLA_BRPORT_GROUP_FWD_MASK != 31"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_GROUP_FWD_MASK 31 +#endif +#if defined(IFLA_BRPORT_NEIGH_SUPPRESS) || (defined(HAVE_DECL_IFLA_BRPORT_NEIGH_SUPPRESS) && HAVE_DECL_IFLA_BRPORT_NEIGH_SUPPRESS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_NEIGH_SUPPRESS) == (32), "IFLA_BRPORT_NEIGH_SUPPRESS != 32"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_NEIGH_SUPPRESS 32 +#endif +#if defined(IFLA_BRPORT_ISOLATED) || (defined(HAVE_DECL_IFLA_BRPORT_ISOLATED) && HAVE_DECL_IFLA_BRPORT_ISOLATED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_ISOLATED) == (33), "IFLA_BRPORT_ISOLATED != 33"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_ISOLATED 33 +#endif +#if defined(IFLA_BRPORT_BACKUP_PORT) || (defined(HAVE_DECL_IFLA_BRPORT_BACKUP_PORT) && HAVE_DECL_IFLA_BRPORT_BACKUP_PORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BRPORT_BACKUP_PORT) == (34), "IFLA_BRPORT_BACKUP_PORT != 34"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BRPORT_BACKUP_PORT 34 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_ifla_brport_attrs in mpers mode + +# else + +static +const struct xlat rtnl_ifla_brport_attrs[] = { + XLAT(IFLA_BRPORT_UNSPEC), + XLAT(IFLA_BRPORT_STATE), + XLAT(IFLA_BRPORT_PRIORITY), + XLAT(IFLA_BRPORT_COST), + XLAT(IFLA_BRPORT_MODE), + XLAT(IFLA_BRPORT_GUARD), + XLAT(IFLA_BRPORT_PROTECT), + XLAT(IFLA_BRPORT_FAST_LEAVE), + XLAT(IFLA_BRPORT_LEARNING), + XLAT(IFLA_BRPORT_UNICAST_FLOOD), + XLAT(IFLA_BRPORT_PROXYARP), + XLAT(IFLA_BRPORT_LEARNING_SYNC), + XLAT(IFLA_BRPORT_PROXYARP_WIFI), + XLAT(IFLA_BRPORT_ROOT_ID), + XLAT(IFLA_BRPORT_BRIDGE_ID), + XLAT(IFLA_BRPORT_DESIGNATED_PORT), + XLAT(IFLA_BRPORT_DESIGNATED_COST), + XLAT(IFLA_BRPORT_ID), + XLAT(IFLA_BRPORT_NO), + XLAT(IFLA_BRPORT_TOPOLOGY_CHANGE_ACK), + XLAT(IFLA_BRPORT_CONFIG_PENDING), + XLAT(IFLA_BRPORT_MESSAGE_AGE_TIMER), + XLAT(IFLA_BRPORT_FORWARD_DELAY_TIMER), + XLAT(IFLA_BRPORT_HOLD_TIMER), + XLAT(IFLA_BRPORT_FLUSH), + XLAT(IFLA_BRPORT_MULTICAST_ROUTER), + XLAT(IFLA_BRPORT_PAD), + XLAT(IFLA_BRPORT_MCAST_FLOOD), + XLAT(IFLA_BRPORT_MCAST_TO_UCAST), + XLAT(IFLA_BRPORT_VLAN_TUNNEL), + XLAT(IFLA_BRPORT_BCAST_FLOOD), + XLAT(IFLA_BRPORT_GROUP_FWD_MASK), + XLAT(IFLA_BRPORT_NEIGH_SUPPRESS), + XLAT(IFLA_BRPORT_ISOLATED), + XLAT(IFLA_BRPORT_BACKUP_PORT), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_ifla_brport_attrs.in b/xlat/rtnl_ifla_brport_attrs.in new file mode 100644 index 00000000..70177165 --- /dev/null +++ b/xlat/rtnl_ifla_brport_attrs.in @@ -0,0 +1,35 @@ +IFLA_BRPORT_UNSPEC 0 +IFLA_BRPORT_STATE 1 +IFLA_BRPORT_PRIORITY 2 +IFLA_BRPORT_COST 3 +IFLA_BRPORT_MODE 4 +IFLA_BRPORT_GUARD 5 +IFLA_BRPORT_PROTECT 6 +IFLA_BRPORT_FAST_LEAVE 7 +IFLA_BRPORT_LEARNING 8 +IFLA_BRPORT_UNICAST_FLOOD 9 +IFLA_BRPORT_PROXYARP 10 +IFLA_BRPORT_LEARNING_SYNC 11 +IFLA_BRPORT_PROXYARP_WIFI 12 +IFLA_BRPORT_ROOT_ID 13 +IFLA_BRPORT_BRIDGE_ID 14 +IFLA_BRPORT_DESIGNATED_PORT 15 +IFLA_BRPORT_DESIGNATED_COST 16 +IFLA_BRPORT_ID 17 +IFLA_BRPORT_NO 18 +IFLA_BRPORT_TOPOLOGY_CHANGE_ACK 19 +IFLA_BRPORT_CONFIG_PENDING 20 +IFLA_BRPORT_MESSAGE_AGE_TIMER 21 +IFLA_BRPORT_FORWARD_DELAY_TIMER 22 +IFLA_BRPORT_HOLD_TIMER 23 +IFLA_BRPORT_FLUSH 24 +IFLA_BRPORT_MULTICAST_ROUTER 25 +IFLA_BRPORT_PAD 26 +IFLA_BRPORT_MCAST_FLOOD 27 +IFLA_BRPORT_MCAST_TO_UCAST 28 +IFLA_BRPORT_VLAN_TUNNEL 29 +IFLA_BRPORT_BCAST_FLOOD 30 +IFLA_BRPORT_GROUP_FWD_MASK 31 +IFLA_BRPORT_NEIGH_SUPPRESS 32 +IFLA_BRPORT_ISOLATED 33 +IFLA_BRPORT_BACKUP_PORT 34 diff --git a/xlat/rtnl_ifla_events.h b/xlat/rtnl_ifla_events.h new file mode 100644 index 00000000..0f214d63 --- /dev/null +++ b/xlat/rtnl_ifla_events.h @@ -0,0 +1,78 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_ifla_events.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IFLA_EVENT_NONE) || (defined(HAVE_DECL_IFLA_EVENT_NONE) && HAVE_DECL_IFLA_EVENT_NONE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_EVENT_NONE) == (0), "IFLA_EVENT_NONE != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_EVENT_NONE 0 +#endif +#if defined(IFLA_EVENT_REBOOT) || (defined(HAVE_DECL_IFLA_EVENT_REBOOT) && HAVE_DECL_IFLA_EVENT_REBOOT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_EVENT_REBOOT) == (1), "IFLA_EVENT_REBOOT != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_EVENT_REBOOT 1 +#endif +#if defined(IFLA_EVENT_FEATURES) || (defined(HAVE_DECL_IFLA_EVENT_FEATURES) && HAVE_DECL_IFLA_EVENT_FEATURES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_EVENT_FEATURES) == (2), "IFLA_EVENT_FEATURES != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_EVENT_FEATURES 2 +#endif +#if defined(IFLA_EVENT_BONDING_FAILOVER) || (defined(HAVE_DECL_IFLA_EVENT_BONDING_FAILOVER) && HAVE_DECL_IFLA_EVENT_BONDING_FAILOVER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_EVENT_BONDING_FAILOVER) == (3), "IFLA_EVENT_BONDING_FAILOVER != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_EVENT_BONDING_FAILOVER 3 +#endif +#if defined(IFLA_EVENT_NOTIFY_PEERS) || (defined(HAVE_DECL_IFLA_EVENT_NOTIFY_PEERS) && HAVE_DECL_IFLA_EVENT_NOTIFY_PEERS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_EVENT_NOTIFY_PEERS) == (4), "IFLA_EVENT_NOTIFY_PEERS != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_EVENT_NOTIFY_PEERS 4 +#endif +#if defined(IFLA_EVENT_IGMP_RESEND) || (defined(HAVE_DECL_IFLA_EVENT_IGMP_RESEND) && HAVE_DECL_IFLA_EVENT_IGMP_RESEND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_EVENT_IGMP_RESEND) == (5), "IFLA_EVENT_IGMP_RESEND != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_EVENT_IGMP_RESEND 5 +#endif +#if defined(IFLA_EVENT_BONDING_OPTIONS) || (defined(HAVE_DECL_IFLA_EVENT_BONDING_OPTIONS) && HAVE_DECL_IFLA_EVENT_BONDING_OPTIONS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_EVENT_BONDING_OPTIONS) == (6), "IFLA_EVENT_BONDING_OPTIONS != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_EVENT_BONDING_OPTIONS 6 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_ifla_events in mpers mode + +# else + +static +const struct xlat rtnl_ifla_events[] = { + XLAT(IFLA_EVENT_NONE), + XLAT(IFLA_EVENT_REBOOT), + XLAT(IFLA_EVENT_FEATURES), + XLAT(IFLA_EVENT_BONDING_FAILOVER), + XLAT(IFLA_EVENT_NOTIFY_PEERS), + XLAT(IFLA_EVENT_IGMP_RESEND), + XLAT(IFLA_EVENT_BONDING_OPTIONS), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_ifla_events.in b/xlat/rtnl_ifla_events.in new file mode 100644 index 00000000..487b6ac2 --- /dev/null +++ b/xlat/rtnl_ifla_events.in @@ -0,0 +1,7 @@ +IFLA_EVENT_NONE 0 +IFLA_EVENT_REBOOT 1 +IFLA_EVENT_FEATURES 2 +IFLA_EVENT_BONDING_FAILOVER 3 +IFLA_EVENT_NOTIFY_PEERS 4 +IFLA_EVENT_IGMP_RESEND 5 +IFLA_EVENT_BONDING_OPTIONS 6 diff --git a/xlat/rtnl_ifla_info_attrs.h b/xlat/rtnl_ifla_info_attrs.h new file mode 100644 index 00000000..dd3124b0 --- /dev/null +++ b/xlat/rtnl_ifla_info_attrs.h @@ -0,0 +1,70 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_ifla_info_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IFLA_INFO_UNSPEC) || (defined(HAVE_DECL_IFLA_INFO_UNSPEC) && HAVE_DECL_IFLA_INFO_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_INFO_UNSPEC) == (0), "IFLA_INFO_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_INFO_UNSPEC 0 +#endif +#if defined(IFLA_INFO_KIND) || (defined(HAVE_DECL_IFLA_INFO_KIND) && HAVE_DECL_IFLA_INFO_KIND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_INFO_KIND) == (1), "IFLA_INFO_KIND != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_INFO_KIND 1 +#endif +#if defined(IFLA_INFO_DATA) || (defined(HAVE_DECL_IFLA_INFO_DATA) && HAVE_DECL_IFLA_INFO_DATA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_INFO_DATA) == (2), "IFLA_INFO_DATA != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_INFO_DATA 2 +#endif +#if defined(IFLA_INFO_XSTATS) || (defined(HAVE_DECL_IFLA_INFO_XSTATS) && HAVE_DECL_IFLA_INFO_XSTATS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_INFO_XSTATS) == (3), "IFLA_INFO_XSTATS != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_INFO_XSTATS 3 +#endif +#if defined(IFLA_INFO_SLAVE_KIND) || (defined(HAVE_DECL_IFLA_INFO_SLAVE_KIND) && HAVE_DECL_IFLA_INFO_SLAVE_KIND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_INFO_SLAVE_KIND) == (4), "IFLA_INFO_SLAVE_KIND != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_INFO_SLAVE_KIND 4 +#endif +#if defined(IFLA_INFO_SLAVE_DATA) || (defined(HAVE_DECL_IFLA_INFO_SLAVE_DATA) && HAVE_DECL_IFLA_INFO_SLAVE_DATA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_INFO_SLAVE_DATA) == (5), "IFLA_INFO_SLAVE_DATA != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_INFO_SLAVE_DATA 5 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_ifla_info_attrs in mpers mode + +# else + +static +const struct xlat rtnl_ifla_info_attrs[] = { + XLAT(IFLA_INFO_UNSPEC), + XLAT(IFLA_INFO_KIND), + XLAT(IFLA_INFO_DATA), + XLAT(IFLA_INFO_XSTATS), + XLAT(IFLA_INFO_SLAVE_KIND), + XLAT(IFLA_INFO_SLAVE_DATA), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_ifla_info_attrs.in b/xlat/rtnl_ifla_info_attrs.in new file mode 100644 index 00000000..61201d34 --- /dev/null +++ b/xlat/rtnl_ifla_info_attrs.in @@ -0,0 +1,6 @@ +IFLA_INFO_UNSPEC 0 +IFLA_INFO_KIND 1 +IFLA_INFO_DATA 2 +IFLA_INFO_XSTATS 3 +IFLA_INFO_SLAVE_KIND 4 +IFLA_INFO_SLAVE_DATA 5 diff --git a/xlat/rtnl_ifla_info_data_bridge_attrs.h b/xlat/rtnl_ifla_info_data_bridge_attrs.h new file mode 100644 index 00000000..a879a33f --- /dev/null +++ b/xlat/rtnl_ifla_info_data_bridge_attrs.h @@ -0,0 +1,398 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_ifla_info_data_bridge_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IFLA_BR_UNSPEC) || (defined(HAVE_DECL_IFLA_BR_UNSPEC) && HAVE_DECL_IFLA_BR_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_UNSPEC) == (0), "IFLA_BR_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_UNSPEC 0 +#endif +#if defined(IFLA_BR_FORWARD_DELAY) || (defined(HAVE_DECL_IFLA_BR_FORWARD_DELAY) && HAVE_DECL_IFLA_BR_FORWARD_DELAY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_FORWARD_DELAY) == (1), "IFLA_BR_FORWARD_DELAY != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_FORWARD_DELAY 1 +#endif +#if defined(IFLA_BR_HELLO_TIME) || (defined(HAVE_DECL_IFLA_BR_HELLO_TIME) && HAVE_DECL_IFLA_BR_HELLO_TIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_HELLO_TIME) == (2), "IFLA_BR_HELLO_TIME != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_HELLO_TIME 2 +#endif +#if defined(IFLA_BR_MAX_AGE) || (defined(HAVE_DECL_IFLA_BR_MAX_AGE) && HAVE_DECL_IFLA_BR_MAX_AGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_MAX_AGE) == (3), "IFLA_BR_MAX_AGE != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_MAX_AGE 3 +#endif +#if defined(IFLA_BR_AGEING_TIME) || (defined(HAVE_DECL_IFLA_BR_AGEING_TIME) && HAVE_DECL_IFLA_BR_AGEING_TIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_AGEING_TIME) == (4), "IFLA_BR_AGEING_TIME != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_AGEING_TIME 4 +#endif +#if defined(IFLA_BR_STP_STATE) || (defined(HAVE_DECL_IFLA_BR_STP_STATE) && HAVE_DECL_IFLA_BR_STP_STATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_STP_STATE) == (5), "IFLA_BR_STP_STATE != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_STP_STATE 5 +#endif +#if defined(IFLA_BR_PRIORITY) || (defined(HAVE_DECL_IFLA_BR_PRIORITY) && HAVE_DECL_IFLA_BR_PRIORITY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_PRIORITY) == (6), "IFLA_BR_PRIORITY != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_PRIORITY 6 +#endif +#if defined(IFLA_BR_VLAN_FILTERING) || (defined(HAVE_DECL_IFLA_BR_VLAN_FILTERING) && HAVE_DECL_IFLA_BR_VLAN_FILTERING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_VLAN_FILTERING) == (7), "IFLA_BR_VLAN_FILTERING != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_VLAN_FILTERING 7 +#endif +#if defined(IFLA_BR_VLAN_PROTOCOL) || (defined(HAVE_DECL_IFLA_BR_VLAN_PROTOCOL) && HAVE_DECL_IFLA_BR_VLAN_PROTOCOL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_VLAN_PROTOCOL) == (8), "IFLA_BR_VLAN_PROTOCOL != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_VLAN_PROTOCOL 8 +#endif +#if defined(IFLA_BR_GROUP_FWD_MASK) || (defined(HAVE_DECL_IFLA_BR_GROUP_FWD_MASK) && HAVE_DECL_IFLA_BR_GROUP_FWD_MASK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_GROUP_FWD_MASK) == (9), "IFLA_BR_GROUP_FWD_MASK != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_GROUP_FWD_MASK 9 +#endif +#if defined(IFLA_BR_ROOT_ID) || (defined(HAVE_DECL_IFLA_BR_ROOT_ID) && HAVE_DECL_IFLA_BR_ROOT_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_ROOT_ID) == (10), "IFLA_BR_ROOT_ID != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_ROOT_ID 10 +#endif +#if defined(IFLA_BR_BRIDGE_ID) || (defined(HAVE_DECL_IFLA_BR_BRIDGE_ID) && HAVE_DECL_IFLA_BR_BRIDGE_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_BRIDGE_ID) == (11), "IFLA_BR_BRIDGE_ID != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_BRIDGE_ID 11 +#endif +#if defined(IFLA_BR_ROOT_PORT) || (defined(HAVE_DECL_IFLA_BR_ROOT_PORT) && HAVE_DECL_IFLA_BR_ROOT_PORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_ROOT_PORT) == (12), "IFLA_BR_ROOT_PORT != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_ROOT_PORT 12 +#endif +#if defined(IFLA_BR_ROOT_PATH_COST) || (defined(HAVE_DECL_IFLA_BR_ROOT_PATH_COST) && HAVE_DECL_IFLA_BR_ROOT_PATH_COST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_ROOT_PATH_COST) == (13), "IFLA_BR_ROOT_PATH_COST != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_ROOT_PATH_COST 13 +#endif +#if defined(IFLA_BR_TOPOLOGY_CHANGE) || (defined(HAVE_DECL_IFLA_BR_TOPOLOGY_CHANGE) && HAVE_DECL_IFLA_BR_TOPOLOGY_CHANGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_TOPOLOGY_CHANGE) == (14), "IFLA_BR_TOPOLOGY_CHANGE != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_TOPOLOGY_CHANGE 14 +#endif +#if defined(IFLA_BR_TOPOLOGY_CHANGE_DETECTED) || (defined(HAVE_DECL_IFLA_BR_TOPOLOGY_CHANGE_DETECTED) && HAVE_DECL_IFLA_BR_TOPOLOGY_CHANGE_DETECTED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_TOPOLOGY_CHANGE_DETECTED) == (15), "IFLA_BR_TOPOLOGY_CHANGE_DETECTED != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_TOPOLOGY_CHANGE_DETECTED 15 +#endif +#if defined(IFLA_BR_HELLO_TIMER) || (defined(HAVE_DECL_IFLA_BR_HELLO_TIMER) && HAVE_DECL_IFLA_BR_HELLO_TIMER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_HELLO_TIMER) == (16), "IFLA_BR_HELLO_TIMER != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_HELLO_TIMER 16 +#endif +#if defined(IFLA_BR_TCN_TIMER) || (defined(HAVE_DECL_IFLA_BR_TCN_TIMER) && HAVE_DECL_IFLA_BR_TCN_TIMER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_TCN_TIMER) == (17), "IFLA_BR_TCN_TIMER != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_TCN_TIMER 17 +#endif +#if defined(IFLA_BR_TOPOLOGY_CHANGE_TIMER) || (defined(HAVE_DECL_IFLA_BR_TOPOLOGY_CHANGE_TIMER) && HAVE_DECL_IFLA_BR_TOPOLOGY_CHANGE_TIMER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_TOPOLOGY_CHANGE_TIMER) == (18), "IFLA_BR_TOPOLOGY_CHANGE_TIMER != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_TOPOLOGY_CHANGE_TIMER 18 +#endif +#if defined(IFLA_BR_GC_TIMER) || (defined(HAVE_DECL_IFLA_BR_GC_TIMER) && HAVE_DECL_IFLA_BR_GC_TIMER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_GC_TIMER) == (19), "IFLA_BR_GC_TIMER != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_GC_TIMER 19 +#endif +#if defined(IFLA_BR_GROUP_ADDR) || (defined(HAVE_DECL_IFLA_BR_GROUP_ADDR) && HAVE_DECL_IFLA_BR_GROUP_ADDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_GROUP_ADDR) == (20), "IFLA_BR_GROUP_ADDR != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_GROUP_ADDR 20 +#endif +#if defined(IFLA_BR_FDB_FLUSH) || (defined(HAVE_DECL_IFLA_BR_FDB_FLUSH) && HAVE_DECL_IFLA_BR_FDB_FLUSH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_FDB_FLUSH) == (21), "IFLA_BR_FDB_FLUSH != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_FDB_FLUSH 21 +#endif +#if defined(IFLA_BR_MCAST_ROUTER) || (defined(HAVE_DECL_IFLA_BR_MCAST_ROUTER) && HAVE_DECL_IFLA_BR_MCAST_ROUTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_MCAST_ROUTER) == (22), "IFLA_BR_MCAST_ROUTER != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_MCAST_ROUTER 22 +#endif +#if defined(IFLA_BR_MCAST_SNOOPING) || (defined(HAVE_DECL_IFLA_BR_MCAST_SNOOPING) && HAVE_DECL_IFLA_BR_MCAST_SNOOPING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_MCAST_SNOOPING) == (23), "IFLA_BR_MCAST_SNOOPING != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_MCAST_SNOOPING 23 +#endif +#if defined(IFLA_BR_MCAST_QUERY_USE_IFADDR) || (defined(HAVE_DECL_IFLA_BR_MCAST_QUERY_USE_IFADDR) && HAVE_DECL_IFLA_BR_MCAST_QUERY_USE_IFADDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_MCAST_QUERY_USE_IFADDR) == (24), "IFLA_BR_MCAST_QUERY_USE_IFADDR != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_MCAST_QUERY_USE_IFADDR 24 +#endif +#if defined(IFLA_BR_MCAST_QUERIER) || (defined(HAVE_DECL_IFLA_BR_MCAST_QUERIER) && HAVE_DECL_IFLA_BR_MCAST_QUERIER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_MCAST_QUERIER) == (25), "IFLA_BR_MCAST_QUERIER != 25"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_MCAST_QUERIER 25 +#endif +#if defined(IFLA_BR_MCAST_HASH_ELASTICITY) || (defined(HAVE_DECL_IFLA_BR_MCAST_HASH_ELASTICITY) && HAVE_DECL_IFLA_BR_MCAST_HASH_ELASTICITY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_MCAST_HASH_ELASTICITY) == (26), "IFLA_BR_MCAST_HASH_ELASTICITY != 26"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_MCAST_HASH_ELASTICITY 26 +#endif +#if defined(IFLA_BR_MCAST_HASH_MAX) || (defined(HAVE_DECL_IFLA_BR_MCAST_HASH_MAX) && HAVE_DECL_IFLA_BR_MCAST_HASH_MAX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_MCAST_HASH_MAX) == (27), "IFLA_BR_MCAST_HASH_MAX != 27"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_MCAST_HASH_MAX 27 +#endif +#if defined(IFLA_BR_MCAST_LAST_MEMBER_CNT) || (defined(HAVE_DECL_IFLA_BR_MCAST_LAST_MEMBER_CNT) && HAVE_DECL_IFLA_BR_MCAST_LAST_MEMBER_CNT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_MCAST_LAST_MEMBER_CNT) == (28), "IFLA_BR_MCAST_LAST_MEMBER_CNT != 28"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_MCAST_LAST_MEMBER_CNT 28 +#endif +#if defined(IFLA_BR_MCAST_STARTUP_QUERY_CNT) || (defined(HAVE_DECL_IFLA_BR_MCAST_STARTUP_QUERY_CNT) && HAVE_DECL_IFLA_BR_MCAST_STARTUP_QUERY_CNT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_MCAST_STARTUP_QUERY_CNT) == (29), "IFLA_BR_MCAST_STARTUP_QUERY_CNT != 29"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_MCAST_STARTUP_QUERY_CNT 29 +#endif +#if defined(IFLA_BR_MCAST_LAST_MEMBER_INTVL) || (defined(HAVE_DECL_IFLA_BR_MCAST_LAST_MEMBER_INTVL) && HAVE_DECL_IFLA_BR_MCAST_LAST_MEMBER_INTVL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_MCAST_LAST_MEMBER_INTVL) == (30), "IFLA_BR_MCAST_LAST_MEMBER_INTVL != 30"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_MCAST_LAST_MEMBER_INTVL 30 +#endif +#if defined(IFLA_BR_MCAST_MEMBERSHIP_INTVL) || (defined(HAVE_DECL_IFLA_BR_MCAST_MEMBERSHIP_INTVL) && HAVE_DECL_IFLA_BR_MCAST_MEMBERSHIP_INTVL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_MCAST_MEMBERSHIP_INTVL) == (31), "IFLA_BR_MCAST_MEMBERSHIP_INTVL != 31"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_MCAST_MEMBERSHIP_INTVL 31 +#endif +#if defined(IFLA_BR_MCAST_QUERIER_INTVL) || (defined(HAVE_DECL_IFLA_BR_MCAST_QUERIER_INTVL) && HAVE_DECL_IFLA_BR_MCAST_QUERIER_INTVL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_MCAST_QUERIER_INTVL) == (32), "IFLA_BR_MCAST_QUERIER_INTVL != 32"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_MCAST_QUERIER_INTVL 32 +#endif +#if defined(IFLA_BR_MCAST_QUERY_INTVL) || (defined(HAVE_DECL_IFLA_BR_MCAST_QUERY_INTVL) && HAVE_DECL_IFLA_BR_MCAST_QUERY_INTVL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_MCAST_QUERY_INTVL) == (33), "IFLA_BR_MCAST_QUERY_INTVL != 33"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_MCAST_QUERY_INTVL 33 +#endif +#if defined(IFLA_BR_MCAST_QUERY_RESPONSE_INTVL) || (defined(HAVE_DECL_IFLA_BR_MCAST_QUERY_RESPONSE_INTVL) && HAVE_DECL_IFLA_BR_MCAST_QUERY_RESPONSE_INTVL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_MCAST_QUERY_RESPONSE_INTVL) == (34), "IFLA_BR_MCAST_QUERY_RESPONSE_INTVL != 34"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_MCAST_QUERY_RESPONSE_INTVL 34 +#endif +#if defined(IFLA_BR_MCAST_STARTUP_QUERY_INTVL) || (defined(HAVE_DECL_IFLA_BR_MCAST_STARTUP_QUERY_INTVL) && HAVE_DECL_IFLA_BR_MCAST_STARTUP_QUERY_INTVL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_MCAST_STARTUP_QUERY_INTVL) == (35), "IFLA_BR_MCAST_STARTUP_QUERY_INTVL != 35"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_MCAST_STARTUP_QUERY_INTVL 35 +#endif +#if defined(IFLA_BR_NF_CALL_IPTABLES) || (defined(HAVE_DECL_IFLA_BR_NF_CALL_IPTABLES) && HAVE_DECL_IFLA_BR_NF_CALL_IPTABLES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_NF_CALL_IPTABLES) == (36), "IFLA_BR_NF_CALL_IPTABLES != 36"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_NF_CALL_IPTABLES 36 +#endif +#if defined(IFLA_BR_NF_CALL_IP6TABLES) || (defined(HAVE_DECL_IFLA_BR_NF_CALL_IP6TABLES) && HAVE_DECL_IFLA_BR_NF_CALL_IP6TABLES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_NF_CALL_IP6TABLES) == (37), "IFLA_BR_NF_CALL_IP6TABLES != 37"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_NF_CALL_IP6TABLES 37 +#endif +#if defined(IFLA_BR_NF_CALL_ARPTABLES) || (defined(HAVE_DECL_IFLA_BR_NF_CALL_ARPTABLES) && HAVE_DECL_IFLA_BR_NF_CALL_ARPTABLES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_NF_CALL_ARPTABLES) == (38), "IFLA_BR_NF_CALL_ARPTABLES != 38"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_NF_CALL_ARPTABLES 38 +#endif +#if defined(IFLA_BR_VLAN_DEFAULT_PVID) || (defined(HAVE_DECL_IFLA_BR_VLAN_DEFAULT_PVID) && HAVE_DECL_IFLA_BR_VLAN_DEFAULT_PVID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_VLAN_DEFAULT_PVID) == (39), "IFLA_BR_VLAN_DEFAULT_PVID != 39"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_VLAN_DEFAULT_PVID 39 +#endif +#if defined(IFLA_BR_PAD) || (defined(HAVE_DECL_IFLA_BR_PAD) && HAVE_DECL_IFLA_BR_PAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_PAD) == (40), "IFLA_BR_PAD != 40"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_PAD 40 +#endif +#if defined(IFLA_BR_VLAN_STATS_ENABLED) || (defined(HAVE_DECL_IFLA_BR_VLAN_STATS_ENABLED) && HAVE_DECL_IFLA_BR_VLAN_STATS_ENABLED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_VLAN_STATS_ENABLED) == (41), "IFLA_BR_VLAN_STATS_ENABLED != 41"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_VLAN_STATS_ENABLED 41 +#endif +#if defined(IFLA_BR_MCAST_STATS_ENABLED) || (defined(HAVE_DECL_IFLA_BR_MCAST_STATS_ENABLED) && HAVE_DECL_IFLA_BR_MCAST_STATS_ENABLED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_MCAST_STATS_ENABLED) == (42), "IFLA_BR_MCAST_STATS_ENABLED != 42"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_MCAST_STATS_ENABLED 42 +#endif +#if defined(IFLA_BR_MCAST_IGMP_VERSION) || (defined(HAVE_DECL_IFLA_BR_MCAST_IGMP_VERSION) && HAVE_DECL_IFLA_BR_MCAST_IGMP_VERSION) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_MCAST_IGMP_VERSION) == (43), "IFLA_BR_MCAST_IGMP_VERSION != 43"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_MCAST_IGMP_VERSION 43 +#endif +#if defined(IFLA_BR_MCAST_MLD_VERSION) || (defined(HAVE_DECL_IFLA_BR_MCAST_MLD_VERSION) && HAVE_DECL_IFLA_BR_MCAST_MLD_VERSION) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_MCAST_MLD_VERSION) == (44), "IFLA_BR_MCAST_MLD_VERSION != 44"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_MCAST_MLD_VERSION 44 +#endif +#if defined(IFLA_BR_VLAN_STATS_PER_PORT) || (defined(HAVE_DECL_IFLA_BR_VLAN_STATS_PER_PORT) && HAVE_DECL_IFLA_BR_VLAN_STATS_PER_PORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_VLAN_STATS_PER_PORT) == (45), "IFLA_BR_VLAN_STATS_PER_PORT != 45"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_VLAN_STATS_PER_PORT 45 +#endif +#if defined(IFLA_BR_MULTI_BOOLOPT) || (defined(HAVE_DECL_IFLA_BR_MULTI_BOOLOPT) && HAVE_DECL_IFLA_BR_MULTI_BOOLOPT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BR_MULTI_BOOLOPT) == (46), "IFLA_BR_MULTI_BOOLOPT != 46"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BR_MULTI_BOOLOPT 46 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_ifla_info_data_bridge_attrs in mpers mode + +# else + +static +const struct xlat rtnl_ifla_info_data_bridge_attrs[] = { + [IFLA_BR_UNSPEC] = XLAT(IFLA_BR_UNSPEC), + [IFLA_BR_FORWARD_DELAY] = XLAT(IFLA_BR_FORWARD_DELAY), + [IFLA_BR_HELLO_TIME] = XLAT(IFLA_BR_HELLO_TIME), + [IFLA_BR_MAX_AGE] = XLAT(IFLA_BR_MAX_AGE), + [IFLA_BR_AGEING_TIME] = XLAT(IFLA_BR_AGEING_TIME), + [IFLA_BR_STP_STATE] = XLAT(IFLA_BR_STP_STATE), + [IFLA_BR_PRIORITY] = XLAT(IFLA_BR_PRIORITY), + [IFLA_BR_VLAN_FILTERING] = XLAT(IFLA_BR_VLAN_FILTERING), + [IFLA_BR_VLAN_PROTOCOL] = XLAT(IFLA_BR_VLAN_PROTOCOL), + [IFLA_BR_GROUP_FWD_MASK] = XLAT(IFLA_BR_GROUP_FWD_MASK), + [IFLA_BR_ROOT_ID] = XLAT(IFLA_BR_ROOT_ID), + [IFLA_BR_BRIDGE_ID] = XLAT(IFLA_BR_BRIDGE_ID), + [IFLA_BR_ROOT_PORT] = XLAT(IFLA_BR_ROOT_PORT), + [IFLA_BR_ROOT_PATH_COST] = XLAT(IFLA_BR_ROOT_PATH_COST), + [IFLA_BR_TOPOLOGY_CHANGE] = XLAT(IFLA_BR_TOPOLOGY_CHANGE), + [IFLA_BR_TOPOLOGY_CHANGE_DETECTED] = XLAT(IFLA_BR_TOPOLOGY_CHANGE_DETECTED), + [IFLA_BR_HELLO_TIMER] = XLAT(IFLA_BR_HELLO_TIMER), + [IFLA_BR_TCN_TIMER] = XLAT(IFLA_BR_TCN_TIMER), + [IFLA_BR_TOPOLOGY_CHANGE_TIMER] = XLAT(IFLA_BR_TOPOLOGY_CHANGE_TIMER), + [IFLA_BR_GC_TIMER] = XLAT(IFLA_BR_GC_TIMER), + [IFLA_BR_GROUP_ADDR] = XLAT(IFLA_BR_GROUP_ADDR), + [IFLA_BR_FDB_FLUSH] = XLAT(IFLA_BR_FDB_FLUSH), + [IFLA_BR_MCAST_ROUTER] = XLAT(IFLA_BR_MCAST_ROUTER), + [IFLA_BR_MCAST_SNOOPING] = XLAT(IFLA_BR_MCAST_SNOOPING), + [IFLA_BR_MCAST_QUERY_USE_IFADDR] = XLAT(IFLA_BR_MCAST_QUERY_USE_IFADDR), + [IFLA_BR_MCAST_QUERIER] = XLAT(IFLA_BR_MCAST_QUERIER), + [IFLA_BR_MCAST_HASH_ELASTICITY] = XLAT(IFLA_BR_MCAST_HASH_ELASTICITY), + [IFLA_BR_MCAST_HASH_MAX] = XLAT(IFLA_BR_MCAST_HASH_MAX), + [IFLA_BR_MCAST_LAST_MEMBER_CNT] = XLAT(IFLA_BR_MCAST_LAST_MEMBER_CNT), + [IFLA_BR_MCAST_STARTUP_QUERY_CNT] = XLAT(IFLA_BR_MCAST_STARTUP_QUERY_CNT), + [IFLA_BR_MCAST_LAST_MEMBER_INTVL] = XLAT(IFLA_BR_MCAST_LAST_MEMBER_INTVL), + [IFLA_BR_MCAST_MEMBERSHIP_INTVL] = XLAT(IFLA_BR_MCAST_MEMBERSHIP_INTVL), + [IFLA_BR_MCAST_QUERIER_INTVL] = XLAT(IFLA_BR_MCAST_QUERIER_INTVL), + [IFLA_BR_MCAST_QUERY_INTVL] = XLAT(IFLA_BR_MCAST_QUERY_INTVL), + [IFLA_BR_MCAST_QUERY_RESPONSE_INTVL] = XLAT(IFLA_BR_MCAST_QUERY_RESPONSE_INTVL), + [IFLA_BR_MCAST_STARTUP_QUERY_INTVL] = XLAT(IFLA_BR_MCAST_STARTUP_QUERY_INTVL), + [IFLA_BR_NF_CALL_IPTABLES] = XLAT(IFLA_BR_NF_CALL_IPTABLES), + [IFLA_BR_NF_CALL_IP6TABLES] = XLAT(IFLA_BR_NF_CALL_IP6TABLES), + [IFLA_BR_NF_CALL_ARPTABLES] = XLAT(IFLA_BR_NF_CALL_ARPTABLES), + [IFLA_BR_VLAN_DEFAULT_PVID] = XLAT(IFLA_BR_VLAN_DEFAULT_PVID), + [IFLA_BR_PAD] = XLAT(IFLA_BR_PAD), + [IFLA_BR_VLAN_STATS_ENABLED] = XLAT(IFLA_BR_VLAN_STATS_ENABLED), + [IFLA_BR_MCAST_STATS_ENABLED] = XLAT(IFLA_BR_MCAST_STATS_ENABLED), + [IFLA_BR_MCAST_IGMP_VERSION] = XLAT(IFLA_BR_MCAST_IGMP_VERSION), + [IFLA_BR_MCAST_MLD_VERSION] = XLAT(IFLA_BR_MCAST_MLD_VERSION), + [IFLA_BR_VLAN_STATS_PER_PORT] = XLAT(IFLA_BR_VLAN_STATS_PER_PORT), + [IFLA_BR_MULTI_BOOLOPT] = XLAT(IFLA_BR_MULTI_BOOLOPT), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_ifla_info_data_bridge_attrs.in b/xlat/rtnl_ifla_info_data_bridge_attrs.in new file mode 100644 index 00000000..87988471 --- /dev/null +++ b/xlat/rtnl_ifla_info_data_bridge_attrs.in @@ -0,0 +1,48 @@ +#value_indexed +IFLA_BR_UNSPEC 0 +IFLA_BR_FORWARD_DELAY 1 +IFLA_BR_HELLO_TIME 2 +IFLA_BR_MAX_AGE 3 +IFLA_BR_AGEING_TIME 4 +IFLA_BR_STP_STATE 5 +IFLA_BR_PRIORITY 6 +IFLA_BR_VLAN_FILTERING 7 +IFLA_BR_VLAN_PROTOCOL 8 +IFLA_BR_GROUP_FWD_MASK 9 +IFLA_BR_ROOT_ID 10 +IFLA_BR_BRIDGE_ID 11 +IFLA_BR_ROOT_PORT 12 +IFLA_BR_ROOT_PATH_COST 13 +IFLA_BR_TOPOLOGY_CHANGE 14 +IFLA_BR_TOPOLOGY_CHANGE_DETECTED 15 +IFLA_BR_HELLO_TIMER 16 +IFLA_BR_TCN_TIMER 17 +IFLA_BR_TOPOLOGY_CHANGE_TIMER 18 +IFLA_BR_GC_TIMER 19 +IFLA_BR_GROUP_ADDR 20 +IFLA_BR_FDB_FLUSH 21 +IFLA_BR_MCAST_ROUTER 22 +IFLA_BR_MCAST_SNOOPING 23 +IFLA_BR_MCAST_QUERY_USE_IFADDR 24 +IFLA_BR_MCAST_QUERIER 25 +IFLA_BR_MCAST_HASH_ELASTICITY 26 +IFLA_BR_MCAST_HASH_MAX 27 +IFLA_BR_MCAST_LAST_MEMBER_CNT 28 +IFLA_BR_MCAST_STARTUP_QUERY_CNT 29 +IFLA_BR_MCAST_LAST_MEMBER_INTVL 30 +IFLA_BR_MCAST_MEMBERSHIP_INTVL 31 +IFLA_BR_MCAST_QUERIER_INTVL 32 +IFLA_BR_MCAST_QUERY_INTVL 33 +IFLA_BR_MCAST_QUERY_RESPONSE_INTVL 34 +IFLA_BR_MCAST_STARTUP_QUERY_INTVL 35 +IFLA_BR_NF_CALL_IPTABLES 36 +IFLA_BR_NF_CALL_IP6TABLES 37 +IFLA_BR_NF_CALL_ARPTABLES 38 +IFLA_BR_VLAN_DEFAULT_PVID 39 +IFLA_BR_PAD 40 +IFLA_BR_VLAN_STATS_ENABLED 41 +IFLA_BR_MCAST_STATS_ENABLED 42 +IFLA_BR_MCAST_IGMP_VERSION 43 +IFLA_BR_MCAST_MLD_VERSION 44 +IFLA_BR_VLAN_STATS_PER_PORT 45 +IFLA_BR_MULTI_BOOLOPT 46 diff --git a/xlat/rtnl_ifla_info_data_tun_attrs.h b/xlat/rtnl_ifla_info_data_tun_attrs.h new file mode 100644 index 00000000..ee9ad580 --- /dev/null +++ b/xlat/rtnl_ifla_info_data_tun_attrs.h @@ -0,0 +1,102 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_ifla_info_data_tun_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IFLA_TUN_UNSPEC) || (defined(HAVE_DECL_IFLA_TUN_UNSPEC) && HAVE_DECL_IFLA_TUN_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_TUN_UNSPEC) == (0), "IFLA_TUN_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_TUN_UNSPEC 0 +#endif +#if defined(IFLA_TUN_OWNER) || (defined(HAVE_DECL_IFLA_TUN_OWNER) && HAVE_DECL_IFLA_TUN_OWNER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_TUN_OWNER) == (1), "IFLA_TUN_OWNER != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_TUN_OWNER 1 +#endif +#if defined(IFLA_TUN_GROUP) || (defined(HAVE_DECL_IFLA_TUN_GROUP) && HAVE_DECL_IFLA_TUN_GROUP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_TUN_GROUP) == (2), "IFLA_TUN_GROUP != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_TUN_GROUP 2 +#endif +#if defined(IFLA_TUN_TYPE) || (defined(HAVE_DECL_IFLA_TUN_TYPE) && HAVE_DECL_IFLA_TUN_TYPE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_TUN_TYPE) == (3), "IFLA_TUN_TYPE != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_TUN_TYPE 3 +#endif +#if defined(IFLA_TUN_PI) || (defined(HAVE_DECL_IFLA_TUN_PI) && HAVE_DECL_IFLA_TUN_PI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_TUN_PI) == (4), "IFLA_TUN_PI != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_TUN_PI 4 +#endif +#if defined(IFLA_TUN_VNET_HDR) || (defined(HAVE_DECL_IFLA_TUN_VNET_HDR) && HAVE_DECL_IFLA_TUN_VNET_HDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_TUN_VNET_HDR) == (5), "IFLA_TUN_VNET_HDR != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_TUN_VNET_HDR 5 +#endif +#if defined(IFLA_TUN_PERSIST) || (defined(HAVE_DECL_IFLA_TUN_PERSIST) && HAVE_DECL_IFLA_TUN_PERSIST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_TUN_PERSIST) == (6), "IFLA_TUN_PERSIST != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_TUN_PERSIST 6 +#endif +#if defined(IFLA_TUN_MULTI_QUEUE) || (defined(HAVE_DECL_IFLA_TUN_MULTI_QUEUE) && HAVE_DECL_IFLA_TUN_MULTI_QUEUE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_TUN_MULTI_QUEUE) == (7), "IFLA_TUN_MULTI_QUEUE != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_TUN_MULTI_QUEUE 7 +#endif +#if defined(IFLA_TUN_NUM_QUEUES) || (defined(HAVE_DECL_IFLA_TUN_NUM_QUEUES) && HAVE_DECL_IFLA_TUN_NUM_QUEUES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_TUN_NUM_QUEUES) == (8), "IFLA_TUN_NUM_QUEUES != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_TUN_NUM_QUEUES 8 +#endif +#if defined(IFLA_TUN_NUM_DISABLED_QUEUES) || (defined(HAVE_DECL_IFLA_TUN_NUM_DISABLED_QUEUES) && HAVE_DECL_IFLA_TUN_NUM_DISABLED_QUEUES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_TUN_NUM_DISABLED_QUEUES) == (9), "IFLA_TUN_NUM_DISABLED_QUEUES != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_TUN_NUM_DISABLED_QUEUES 9 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_ifla_info_data_tun_attrs in mpers mode + +# else + +static +const struct xlat rtnl_ifla_info_data_tun_attrs[] = { + [IFLA_TUN_UNSPEC] = XLAT(IFLA_TUN_UNSPEC), + [IFLA_TUN_OWNER] = XLAT(IFLA_TUN_OWNER), + [IFLA_TUN_GROUP] = XLAT(IFLA_TUN_GROUP), + [IFLA_TUN_TYPE] = XLAT(IFLA_TUN_TYPE), + [IFLA_TUN_PI] = XLAT(IFLA_TUN_PI), + [IFLA_TUN_VNET_HDR] = XLAT(IFLA_TUN_VNET_HDR), + [IFLA_TUN_PERSIST] = XLAT(IFLA_TUN_PERSIST), + [IFLA_TUN_MULTI_QUEUE] = XLAT(IFLA_TUN_MULTI_QUEUE), + [IFLA_TUN_NUM_QUEUES] = XLAT(IFLA_TUN_NUM_QUEUES), + [IFLA_TUN_NUM_DISABLED_QUEUES] = XLAT(IFLA_TUN_NUM_DISABLED_QUEUES), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_ifla_info_data_tun_attrs.in b/xlat/rtnl_ifla_info_data_tun_attrs.in new file mode 100644 index 00000000..2ac187e3 --- /dev/null +++ b/xlat/rtnl_ifla_info_data_tun_attrs.in @@ -0,0 +1,11 @@ +#value_indexed +IFLA_TUN_UNSPEC 0 +IFLA_TUN_OWNER 1 +IFLA_TUN_GROUP 2 +IFLA_TUN_TYPE 3 +IFLA_TUN_PI 4 +IFLA_TUN_VNET_HDR 5 +IFLA_TUN_PERSIST 6 +IFLA_TUN_MULTI_QUEUE 7 +IFLA_TUN_NUM_QUEUES 8 +IFLA_TUN_NUM_DISABLED_QUEUES 9 diff --git a/xlat/rtnl_ifla_port_attrs.h b/xlat/rtnl_ifla_port_attrs.h new file mode 100644 index 00000000..ce6af735 --- /dev/null +++ b/xlat/rtnl_ifla_port_attrs.h @@ -0,0 +1,86 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_ifla_port_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IFLA_PORT_UNSPEC) || (defined(HAVE_DECL_IFLA_PORT_UNSPEC) && HAVE_DECL_IFLA_PORT_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_PORT_UNSPEC) == (0), "IFLA_PORT_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_PORT_UNSPEC 0 +#endif +#if defined(IFLA_PORT_VF) || (defined(HAVE_DECL_IFLA_PORT_VF) && HAVE_DECL_IFLA_PORT_VF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_PORT_VF) == (1), "IFLA_PORT_VF != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_PORT_VF 1 +#endif +#if defined(IFLA_PORT_PROFILE) || (defined(HAVE_DECL_IFLA_PORT_PROFILE) && HAVE_DECL_IFLA_PORT_PROFILE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_PORT_PROFILE) == (2), "IFLA_PORT_PROFILE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_PORT_PROFILE 2 +#endif +#if defined(IFLA_PORT_VSI_TYPE) || (defined(HAVE_DECL_IFLA_PORT_VSI_TYPE) && HAVE_DECL_IFLA_PORT_VSI_TYPE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_PORT_VSI_TYPE) == (3), "IFLA_PORT_VSI_TYPE != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_PORT_VSI_TYPE 3 +#endif +#if defined(IFLA_PORT_INSTANCE_UUID) || (defined(HAVE_DECL_IFLA_PORT_INSTANCE_UUID) && HAVE_DECL_IFLA_PORT_INSTANCE_UUID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_PORT_INSTANCE_UUID) == (4), "IFLA_PORT_INSTANCE_UUID != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_PORT_INSTANCE_UUID 4 +#endif +#if defined(IFLA_PORT_HOST_UUID) || (defined(HAVE_DECL_IFLA_PORT_HOST_UUID) && HAVE_DECL_IFLA_PORT_HOST_UUID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_PORT_HOST_UUID) == (5), "IFLA_PORT_HOST_UUID != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_PORT_HOST_UUID 5 +#endif +#if defined(IFLA_PORT_REQUEST) || (defined(HAVE_DECL_IFLA_PORT_REQUEST) && HAVE_DECL_IFLA_PORT_REQUEST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_PORT_REQUEST) == (6), "IFLA_PORT_REQUEST != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_PORT_REQUEST 6 +#endif +#if defined(IFLA_PORT_RESPONSE) || (defined(HAVE_DECL_IFLA_PORT_RESPONSE) && HAVE_DECL_IFLA_PORT_RESPONSE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_PORT_RESPONSE) == (7), "IFLA_PORT_RESPONSE != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_PORT_RESPONSE 7 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_ifla_port_attrs in mpers mode + +# else + +static +const struct xlat rtnl_ifla_port_attrs[] = { + XLAT(IFLA_PORT_UNSPEC), + XLAT(IFLA_PORT_VF), + XLAT(IFLA_PORT_PROFILE), + XLAT(IFLA_PORT_VSI_TYPE), + XLAT(IFLA_PORT_INSTANCE_UUID), + XLAT(IFLA_PORT_HOST_UUID), + XLAT(IFLA_PORT_REQUEST), + XLAT(IFLA_PORT_RESPONSE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_ifla_port_attrs.in b/xlat/rtnl_ifla_port_attrs.in new file mode 100644 index 00000000..9079006c --- /dev/null +++ b/xlat/rtnl_ifla_port_attrs.in @@ -0,0 +1,8 @@ +IFLA_PORT_UNSPEC 0 +IFLA_PORT_VF 1 +IFLA_PORT_PROFILE 2 +IFLA_PORT_VSI_TYPE 3 +IFLA_PORT_INSTANCE_UUID 4 +IFLA_PORT_HOST_UUID 5 +IFLA_PORT_REQUEST 6 +IFLA_PORT_RESPONSE 7 diff --git a/xlat/rtnl_ifla_vf_port_attrs.h b/xlat/rtnl_ifla_vf_port_attrs.h new file mode 100644 index 00000000..6227bc31 --- /dev/null +++ b/xlat/rtnl_ifla_vf_port_attrs.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_ifla_vf_port_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IFLA_VF_PORT_UNSPEC) || (defined(HAVE_DECL_IFLA_VF_PORT_UNSPEC) && HAVE_DECL_IFLA_VF_PORT_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_VF_PORT_UNSPEC) == (0), "IFLA_VF_PORT_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_VF_PORT_UNSPEC 0 +#endif +#if defined(IFLA_VF_PORT) || (defined(HAVE_DECL_IFLA_VF_PORT) && HAVE_DECL_IFLA_VF_PORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_VF_PORT) == (1), "IFLA_VF_PORT != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_VF_PORT 1 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_ifla_vf_port_attrs in mpers mode + +# else + +static +const struct xlat rtnl_ifla_vf_port_attrs[] = { + XLAT(IFLA_VF_PORT_UNSPEC), + XLAT(IFLA_VF_PORT), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_ifla_vf_port_attrs.in b/xlat/rtnl_ifla_vf_port_attrs.in new file mode 100644 index 00000000..7f93051c --- /dev/null +++ b/xlat/rtnl_ifla_vf_port_attrs.in @@ -0,0 +1,2 @@ +IFLA_VF_PORT_UNSPEC 0 +IFLA_VF_PORT 1 diff --git a/xlat/rtnl_ifla_xdp_attached_mode.h b/xlat/rtnl_ifla_xdp_attached_mode.h new file mode 100644 index 00000000..bfa9deef --- /dev/null +++ b/xlat/rtnl_ifla_xdp_attached_mode.h @@ -0,0 +1,62 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_ifla_xdp_attached_mode.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(XDP_ATTACHED_NONE) || (defined(HAVE_DECL_XDP_ATTACHED_NONE) && HAVE_DECL_XDP_ATTACHED_NONE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XDP_ATTACHED_NONE) == (0), "XDP_ATTACHED_NONE != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XDP_ATTACHED_NONE 0 +#endif +#if defined(XDP_ATTACHED_DRV) || (defined(HAVE_DECL_XDP_ATTACHED_DRV) && HAVE_DECL_XDP_ATTACHED_DRV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XDP_ATTACHED_DRV) == (1), "XDP_ATTACHED_DRV != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XDP_ATTACHED_DRV 1 +#endif +#if defined(XDP_ATTACHED_SKB) || (defined(HAVE_DECL_XDP_ATTACHED_SKB) && HAVE_DECL_XDP_ATTACHED_SKB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XDP_ATTACHED_SKB) == (2), "XDP_ATTACHED_SKB != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XDP_ATTACHED_SKB 2 +#endif +#if defined(XDP_ATTACHED_HW) || (defined(HAVE_DECL_XDP_ATTACHED_HW) && HAVE_DECL_XDP_ATTACHED_HW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XDP_ATTACHED_HW) == (3), "XDP_ATTACHED_HW != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XDP_ATTACHED_HW 3 +#endif +#if defined(XDP_ATTACHED_MULTI) || (defined(HAVE_DECL_XDP_ATTACHED_MULTI) && HAVE_DECL_XDP_ATTACHED_MULTI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XDP_ATTACHED_MULTI) == (4), "XDP_ATTACHED_MULTI != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XDP_ATTACHED_MULTI 4 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_ifla_xdp_attached_mode in mpers mode + +# else + +static +const struct xlat rtnl_ifla_xdp_attached_mode[] = { + [XDP_ATTACHED_NONE] = XLAT(XDP_ATTACHED_NONE), + [XDP_ATTACHED_DRV] = XLAT(XDP_ATTACHED_DRV), + [XDP_ATTACHED_SKB] = XLAT(XDP_ATTACHED_SKB), + [XDP_ATTACHED_HW] = XLAT(XDP_ATTACHED_HW), + [XDP_ATTACHED_MULTI] = XLAT(XDP_ATTACHED_MULTI), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_ifla_xdp_attached_mode.in b/xlat/rtnl_ifla_xdp_attached_mode.in new file mode 100644 index 00000000..f3742302 --- /dev/null +++ b/xlat/rtnl_ifla_xdp_attached_mode.in @@ -0,0 +1,6 @@ +#value_indexed +XDP_ATTACHED_NONE 0 +XDP_ATTACHED_DRV 1 +XDP_ATTACHED_SKB 2 +XDP_ATTACHED_HW 3 +XDP_ATTACHED_MULTI 4 diff --git a/xlat/rtnl_ifla_xdp_attrs.h b/xlat/rtnl_ifla_xdp_attrs.h new file mode 100644 index 00000000..dc9018fe --- /dev/null +++ b/xlat/rtnl_ifla_xdp_attrs.h @@ -0,0 +1,86 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_ifla_xdp_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IFLA_XDP_UNSPEC) || (defined(HAVE_DECL_IFLA_XDP_UNSPEC) && HAVE_DECL_IFLA_XDP_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_XDP_UNSPEC) == (0), "IFLA_XDP_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_XDP_UNSPEC 0 +#endif +#if defined(IFLA_XDP_FD) || (defined(HAVE_DECL_IFLA_XDP_FD) && HAVE_DECL_IFLA_XDP_FD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_XDP_FD) == (1), "IFLA_XDP_FD != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_XDP_FD 1 +#endif +#if defined(IFLA_XDP_ATTACHED) || (defined(HAVE_DECL_IFLA_XDP_ATTACHED) && HAVE_DECL_IFLA_XDP_ATTACHED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_XDP_ATTACHED) == (2), "IFLA_XDP_ATTACHED != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_XDP_ATTACHED 2 +#endif +#if defined(IFLA_XDP_FLAGS) || (defined(HAVE_DECL_IFLA_XDP_FLAGS) && HAVE_DECL_IFLA_XDP_FLAGS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_XDP_FLAGS) == (3), "IFLA_XDP_FLAGS != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_XDP_FLAGS 3 +#endif +#if defined(IFLA_XDP_PROG_ID) || (defined(HAVE_DECL_IFLA_XDP_PROG_ID) && HAVE_DECL_IFLA_XDP_PROG_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_XDP_PROG_ID) == (4), "IFLA_XDP_PROG_ID != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_XDP_PROG_ID 4 +#endif +#if defined(IFLA_XDP_DRV_PROG_ID) || (defined(HAVE_DECL_IFLA_XDP_DRV_PROG_ID) && HAVE_DECL_IFLA_XDP_DRV_PROG_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_XDP_DRV_PROG_ID) == (5), "IFLA_XDP_DRV_PROG_ID != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_XDP_DRV_PROG_ID 5 +#endif +#if defined(IFLA_XDP_SKB_PROG_ID) || (defined(HAVE_DECL_IFLA_XDP_SKB_PROG_ID) && HAVE_DECL_IFLA_XDP_SKB_PROG_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_XDP_SKB_PROG_ID) == (6), "IFLA_XDP_SKB_PROG_ID != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_XDP_SKB_PROG_ID 6 +#endif +#if defined(IFLA_XDP_HW_PROG_ID) || (defined(HAVE_DECL_IFLA_XDP_HW_PROG_ID) && HAVE_DECL_IFLA_XDP_HW_PROG_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_XDP_HW_PROG_ID) == (7), "IFLA_XDP_HW_PROG_ID != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_XDP_HW_PROG_ID 7 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_ifla_xdp_attrs in mpers mode + +# else + +static +const struct xlat rtnl_ifla_xdp_attrs[] = { + XLAT(IFLA_XDP_UNSPEC), + XLAT(IFLA_XDP_FD), + XLAT(IFLA_XDP_ATTACHED), + XLAT(IFLA_XDP_FLAGS), + XLAT(IFLA_XDP_PROG_ID), + XLAT(IFLA_XDP_DRV_PROG_ID), + XLAT(IFLA_XDP_SKB_PROG_ID), + XLAT(IFLA_XDP_HW_PROG_ID), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_ifla_xdp_attrs.in b/xlat/rtnl_ifla_xdp_attrs.in new file mode 100644 index 00000000..b12958f5 --- /dev/null +++ b/xlat/rtnl_ifla_xdp_attrs.in @@ -0,0 +1,8 @@ +IFLA_XDP_UNSPEC 0 +IFLA_XDP_FD 1 +IFLA_XDP_ATTACHED 2 +IFLA_XDP_FLAGS 3 +IFLA_XDP_PROG_ID 4 +IFLA_XDP_DRV_PROG_ID 5 +IFLA_XDP_SKB_PROG_ID 6 +IFLA_XDP_HW_PROG_ID 7 diff --git a/xlat/rtnl_link_attrs.h b/xlat/rtnl_link_attrs.h new file mode 100644 index 00000000..6a298606 --- /dev/null +++ b/xlat/rtnl_link_attrs.h @@ -0,0 +1,438 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_link_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IFLA_UNSPEC) || (defined(HAVE_DECL_IFLA_UNSPEC) && HAVE_DECL_IFLA_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_UNSPEC) == (0), "IFLA_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_UNSPEC 0 +#endif +#if defined(IFLA_ADDRESS) || (defined(HAVE_DECL_IFLA_ADDRESS) && HAVE_DECL_IFLA_ADDRESS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_ADDRESS) == (1), "IFLA_ADDRESS != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_ADDRESS 1 +#endif +#if defined(IFLA_BROADCAST) || (defined(HAVE_DECL_IFLA_BROADCAST) && HAVE_DECL_IFLA_BROADCAST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_BROADCAST) == (2), "IFLA_BROADCAST != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_BROADCAST 2 +#endif +#if defined(IFLA_IFNAME) || (defined(HAVE_DECL_IFLA_IFNAME) && HAVE_DECL_IFLA_IFNAME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_IFNAME) == (3), "IFLA_IFNAME != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_IFNAME 3 +#endif +#if defined(IFLA_MTU) || (defined(HAVE_DECL_IFLA_MTU) && HAVE_DECL_IFLA_MTU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_MTU) == (4), "IFLA_MTU != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_MTU 4 +#endif +#if defined(IFLA_LINK) || (defined(HAVE_DECL_IFLA_LINK) && HAVE_DECL_IFLA_LINK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_LINK) == (5), "IFLA_LINK != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_LINK 5 +#endif +#if defined(IFLA_QDISC) || (defined(HAVE_DECL_IFLA_QDISC) && HAVE_DECL_IFLA_QDISC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_QDISC) == (6), "IFLA_QDISC != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_QDISC 6 +#endif +#if defined(IFLA_STATS) || (defined(HAVE_DECL_IFLA_STATS) && HAVE_DECL_IFLA_STATS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_STATS) == (7), "IFLA_STATS != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_STATS 7 +#endif +#if defined(IFLA_COST) || (defined(HAVE_DECL_IFLA_COST) && HAVE_DECL_IFLA_COST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_COST) == (8), "IFLA_COST != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_COST 8 +#endif +#if defined(IFLA_PRIORITY) || (defined(HAVE_DECL_IFLA_PRIORITY) && HAVE_DECL_IFLA_PRIORITY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_PRIORITY) == (9), "IFLA_PRIORITY != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_PRIORITY 9 +#endif +#if defined(IFLA_MASTER) || (defined(HAVE_DECL_IFLA_MASTER) && HAVE_DECL_IFLA_MASTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_MASTER) == (10), "IFLA_MASTER != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_MASTER 10 +#endif +#if defined(IFLA_WIRELESS) || (defined(HAVE_DECL_IFLA_WIRELESS) && HAVE_DECL_IFLA_WIRELESS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_WIRELESS) == (11), "IFLA_WIRELESS != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_WIRELESS 11 +#endif +#if defined(IFLA_PROTINFO) || (defined(HAVE_DECL_IFLA_PROTINFO) && HAVE_DECL_IFLA_PROTINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_PROTINFO) == (12), "IFLA_PROTINFO != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_PROTINFO 12 +#endif +#if defined(IFLA_TXQLEN) || (defined(HAVE_DECL_IFLA_TXQLEN) && HAVE_DECL_IFLA_TXQLEN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_TXQLEN) == (13), "IFLA_TXQLEN != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_TXQLEN 13 +#endif +#if defined(IFLA_MAP) || (defined(HAVE_DECL_IFLA_MAP) && HAVE_DECL_IFLA_MAP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_MAP) == (14), "IFLA_MAP != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_MAP 14 +#endif +#if defined(IFLA_WEIGHT) || (defined(HAVE_DECL_IFLA_WEIGHT) && HAVE_DECL_IFLA_WEIGHT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_WEIGHT) == (15), "IFLA_WEIGHT != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_WEIGHT 15 +#endif +#if defined(IFLA_OPERSTATE) || (defined(HAVE_DECL_IFLA_OPERSTATE) && HAVE_DECL_IFLA_OPERSTATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_OPERSTATE) == (16), "IFLA_OPERSTATE != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_OPERSTATE 16 +#endif +#if defined(IFLA_LINKMODE) || (defined(HAVE_DECL_IFLA_LINKMODE) && HAVE_DECL_IFLA_LINKMODE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_LINKMODE) == (17), "IFLA_LINKMODE != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_LINKMODE 17 +#endif +#if defined(IFLA_LINKINFO) || (defined(HAVE_DECL_IFLA_LINKINFO) && HAVE_DECL_IFLA_LINKINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_LINKINFO) == (18), "IFLA_LINKINFO != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_LINKINFO 18 +#endif +#if defined(IFLA_NET_NS_PID) || (defined(HAVE_DECL_IFLA_NET_NS_PID) && HAVE_DECL_IFLA_NET_NS_PID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_NET_NS_PID) == (19), "IFLA_NET_NS_PID != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_NET_NS_PID 19 +#endif +#if defined(IFLA_IFALIAS) || (defined(HAVE_DECL_IFLA_IFALIAS) && HAVE_DECL_IFLA_IFALIAS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_IFALIAS) == (20), "IFLA_IFALIAS != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_IFALIAS 20 +#endif +#if defined(IFLA_NUM_VF) || (defined(HAVE_DECL_IFLA_NUM_VF) && HAVE_DECL_IFLA_NUM_VF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_NUM_VF) == (21), "IFLA_NUM_VF != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_NUM_VF 21 +#endif +#if defined(IFLA_VFINFO_LIST) || (defined(HAVE_DECL_IFLA_VFINFO_LIST) && HAVE_DECL_IFLA_VFINFO_LIST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_VFINFO_LIST) == (22), "IFLA_VFINFO_LIST != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_VFINFO_LIST 22 +#endif +#if defined(IFLA_STATS64) || (defined(HAVE_DECL_IFLA_STATS64) && HAVE_DECL_IFLA_STATS64) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_STATS64) == (23), "IFLA_STATS64 != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_STATS64 23 +#endif +#if defined(IFLA_VF_PORTS) || (defined(HAVE_DECL_IFLA_VF_PORTS) && HAVE_DECL_IFLA_VF_PORTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_VF_PORTS) == (24), "IFLA_VF_PORTS != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_VF_PORTS 24 +#endif +#if defined(IFLA_PORT_SELF) || (defined(HAVE_DECL_IFLA_PORT_SELF) && HAVE_DECL_IFLA_PORT_SELF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_PORT_SELF) == (25), "IFLA_PORT_SELF != 25"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_PORT_SELF 25 +#endif +#if defined(IFLA_AF_SPEC) || (defined(HAVE_DECL_IFLA_AF_SPEC) && HAVE_DECL_IFLA_AF_SPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_AF_SPEC) == (26), "IFLA_AF_SPEC != 26"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_AF_SPEC 26 +#endif +#if defined(IFLA_GROUP) || (defined(HAVE_DECL_IFLA_GROUP) && HAVE_DECL_IFLA_GROUP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_GROUP) == (27), "IFLA_GROUP != 27"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_GROUP 27 +#endif +#if defined(IFLA_NET_NS_FD) || (defined(HAVE_DECL_IFLA_NET_NS_FD) && HAVE_DECL_IFLA_NET_NS_FD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_NET_NS_FD) == (28), "IFLA_NET_NS_FD != 28"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_NET_NS_FD 28 +#endif +#if defined(IFLA_EXT_MASK) || (defined(HAVE_DECL_IFLA_EXT_MASK) && HAVE_DECL_IFLA_EXT_MASK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_EXT_MASK) == (29), "IFLA_EXT_MASK != 29"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_EXT_MASK 29 +#endif +#if defined(IFLA_PROMISCUITY) || (defined(HAVE_DECL_IFLA_PROMISCUITY) && HAVE_DECL_IFLA_PROMISCUITY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_PROMISCUITY) == (30), "IFLA_PROMISCUITY != 30"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_PROMISCUITY 30 +#endif +#if defined(IFLA_NUM_TX_QUEUES) || (defined(HAVE_DECL_IFLA_NUM_TX_QUEUES) && HAVE_DECL_IFLA_NUM_TX_QUEUES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_NUM_TX_QUEUES) == (31), "IFLA_NUM_TX_QUEUES != 31"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_NUM_TX_QUEUES 31 +#endif +#if defined(IFLA_NUM_RX_QUEUES) || (defined(HAVE_DECL_IFLA_NUM_RX_QUEUES) && HAVE_DECL_IFLA_NUM_RX_QUEUES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_NUM_RX_QUEUES) == (32), "IFLA_NUM_RX_QUEUES != 32"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_NUM_RX_QUEUES 32 +#endif +#if defined(IFLA_CARRIER) || (defined(HAVE_DECL_IFLA_CARRIER) && HAVE_DECL_IFLA_CARRIER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_CARRIER) == (33), "IFLA_CARRIER != 33"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_CARRIER 33 +#endif +#if defined(IFLA_PHYS_PORT_ID) || (defined(HAVE_DECL_IFLA_PHYS_PORT_ID) && HAVE_DECL_IFLA_PHYS_PORT_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_PHYS_PORT_ID) == (34), "IFLA_PHYS_PORT_ID != 34"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_PHYS_PORT_ID 34 +#endif +#if defined(IFLA_CARRIER_CHANGES) || (defined(HAVE_DECL_IFLA_CARRIER_CHANGES) && HAVE_DECL_IFLA_CARRIER_CHANGES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_CARRIER_CHANGES) == (35), "IFLA_CARRIER_CHANGES != 35"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_CARRIER_CHANGES 35 +#endif +#if defined(IFLA_PHYS_SWITCH_ID) || (defined(HAVE_DECL_IFLA_PHYS_SWITCH_ID) && HAVE_DECL_IFLA_PHYS_SWITCH_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_PHYS_SWITCH_ID) == (36), "IFLA_PHYS_SWITCH_ID != 36"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_PHYS_SWITCH_ID 36 +#endif +#if defined(IFLA_LINK_NETNSID) || (defined(HAVE_DECL_IFLA_LINK_NETNSID) && HAVE_DECL_IFLA_LINK_NETNSID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_LINK_NETNSID) == (37), "IFLA_LINK_NETNSID != 37"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_LINK_NETNSID 37 +#endif +#if defined(IFLA_PHYS_PORT_NAME) || (defined(HAVE_DECL_IFLA_PHYS_PORT_NAME) && HAVE_DECL_IFLA_PHYS_PORT_NAME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_PHYS_PORT_NAME) == (38), "IFLA_PHYS_PORT_NAME != 38"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_PHYS_PORT_NAME 38 +#endif +#if defined(IFLA_PROTO_DOWN) || (defined(HAVE_DECL_IFLA_PROTO_DOWN) && HAVE_DECL_IFLA_PROTO_DOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_PROTO_DOWN) == (39), "IFLA_PROTO_DOWN != 39"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_PROTO_DOWN 39 +#endif +#if defined(IFLA_GSO_MAX_SEGS) || (defined(HAVE_DECL_IFLA_GSO_MAX_SEGS) && HAVE_DECL_IFLA_GSO_MAX_SEGS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_GSO_MAX_SEGS) == (40), "IFLA_GSO_MAX_SEGS != 40"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_GSO_MAX_SEGS 40 +#endif +#if defined(IFLA_GSO_MAX_SIZE) || (defined(HAVE_DECL_IFLA_GSO_MAX_SIZE) && HAVE_DECL_IFLA_GSO_MAX_SIZE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_GSO_MAX_SIZE) == (41), "IFLA_GSO_MAX_SIZE != 41"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_GSO_MAX_SIZE 41 +#endif +#if defined(IFLA_PAD) || (defined(HAVE_DECL_IFLA_PAD) && HAVE_DECL_IFLA_PAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_PAD) == (42), "IFLA_PAD != 42"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_PAD 42 +#endif +#if defined(IFLA_XDP) || (defined(HAVE_DECL_IFLA_XDP) && HAVE_DECL_IFLA_XDP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_XDP) == (43), "IFLA_XDP != 43"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_XDP 43 +#endif +#if defined(IFLA_EVENT) || (defined(HAVE_DECL_IFLA_EVENT) && HAVE_DECL_IFLA_EVENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_EVENT) == (44), "IFLA_EVENT != 44"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_EVENT 44 +#endif +#if defined(IFLA_NEW_NETNSID) || (defined(HAVE_DECL_IFLA_NEW_NETNSID) && HAVE_DECL_IFLA_NEW_NETNSID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_NEW_NETNSID) == (45), "IFLA_NEW_NETNSID != 45"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_NEW_NETNSID 45 +#endif +#if defined(IFLA_IF_NETNSID) || (defined(HAVE_DECL_IFLA_IF_NETNSID) && HAVE_DECL_IFLA_IF_NETNSID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_IF_NETNSID) == (46), "IFLA_IF_NETNSID != 46"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_IF_NETNSID 46 +#endif +#if defined(IFLA_CARRIER_UP_COUNT) || (defined(HAVE_DECL_IFLA_CARRIER_UP_COUNT) && HAVE_DECL_IFLA_CARRIER_UP_COUNT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_CARRIER_UP_COUNT) == (47), "IFLA_CARRIER_UP_COUNT != 47"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_CARRIER_UP_COUNT 47 +#endif +#if defined(IFLA_CARRIER_DOWN_COUNT) || (defined(HAVE_DECL_IFLA_CARRIER_DOWN_COUNT) && HAVE_DECL_IFLA_CARRIER_DOWN_COUNT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_CARRIER_DOWN_COUNT) == (48), "IFLA_CARRIER_DOWN_COUNT != 48"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_CARRIER_DOWN_COUNT 48 +#endif +#if defined(IFLA_NEW_IFINDEX) || (defined(HAVE_DECL_IFLA_NEW_IFINDEX) && HAVE_DECL_IFLA_NEW_IFINDEX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_NEW_IFINDEX) == (49), "IFLA_NEW_IFINDEX != 49"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_NEW_IFINDEX 49 +#endif +#if defined(IFLA_MIN_MTU) || (defined(HAVE_DECL_IFLA_MIN_MTU) && HAVE_DECL_IFLA_MIN_MTU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_MIN_MTU) == (50), "IFLA_MIN_MTU != 50"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_MIN_MTU 50 +#endif +#if defined(IFLA_MAX_MTU) || (defined(HAVE_DECL_IFLA_MAX_MTU) && HAVE_DECL_IFLA_MAX_MTU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IFLA_MAX_MTU) == (51), "IFLA_MAX_MTU != 51"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IFLA_MAX_MTU 51 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_link_attrs in mpers mode + +# else + +static +const struct xlat rtnl_link_attrs[] = { + XLAT(IFLA_UNSPEC), + XLAT(IFLA_ADDRESS), + XLAT(IFLA_BROADCAST), + XLAT(IFLA_IFNAME), + XLAT(IFLA_MTU), + XLAT(IFLA_LINK), + XLAT(IFLA_QDISC), + XLAT(IFLA_STATS), + XLAT(IFLA_COST), + XLAT(IFLA_PRIORITY), + XLAT(IFLA_MASTER), + XLAT(IFLA_WIRELESS), + XLAT(IFLA_PROTINFO), + XLAT(IFLA_TXQLEN), + XLAT(IFLA_MAP), + XLAT(IFLA_WEIGHT), + XLAT(IFLA_OPERSTATE), + XLAT(IFLA_LINKMODE), + XLAT(IFLA_LINKINFO), + XLAT(IFLA_NET_NS_PID), + XLAT(IFLA_IFALIAS), + XLAT(IFLA_NUM_VF), + XLAT(IFLA_VFINFO_LIST), + XLAT(IFLA_STATS64), + XLAT(IFLA_VF_PORTS), + XLAT(IFLA_PORT_SELF), + XLAT(IFLA_AF_SPEC), + XLAT(IFLA_GROUP), + XLAT(IFLA_NET_NS_FD), + XLAT(IFLA_EXT_MASK), + XLAT(IFLA_PROMISCUITY), + XLAT(IFLA_NUM_TX_QUEUES), + XLAT(IFLA_NUM_RX_QUEUES), + XLAT(IFLA_CARRIER), + XLAT(IFLA_PHYS_PORT_ID), + XLAT(IFLA_CARRIER_CHANGES), + XLAT(IFLA_PHYS_SWITCH_ID), + XLAT(IFLA_LINK_NETNSID), + XLAT(IFLA_PHYS_PORT_NAME), + XLAT(IFLA_PROTO_DOWN), + XLAT(IFLA_GSO_MAX_SEGS), + XLAT(IFLA_GSO_MAX_SIZE), + XLAT(IFLA_PAD), + XLAT(IFLA_XDP), + XLAT(IFLA_EVENT), + XLAT(IFLA_NEW_NETNSID), + XLAT(IFLA_IF_NETNSID), + XLAT(IFLA_CARRIER_UP_COUNT), + XLAT(IFLA_CARRIER_DOWN_COUNT), + XLAT(IFLA_NEW_IFINDEX), + XLAT(IFLA_MIN_MTU), + XLAT(IFLA_MAX_MTU), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_link_attrs.in b/xlat/rtnl_link_attrs.in new file mode 100644 index 00000000..1c0fa2dd --- /dev/null +++ b/xlat/rtnl_link_attrs.in @@ -0,0 +1,52 @@ +IFLA_UNSPEC 0 +IFLA_ADDRESS 1 +IFLA_BROADCAST 2 +IFLA_IFNAME 3 +IFLA_MTU 4 +IFLA_LINK 5 +IFLA_QDISC 6 +IFLA_STATS 7 +IFLA_COST 8 +IFLA_PRIORITY 9 +IFLA_MASTER 10 +IFLA_WIRELESS 11 +IFLA_PROTINFO 12 +IFLA_TXQLEN 13 +IFLA_MAP 14 +IFLA_WEIGHT 15 +IFLA_OPERSTATE 16 +IFLA_LINKMODE 17 +IFLA_LINKINFO 18 +IFLA_NET_NS_PID 19 +IFLA_IFALIAS 20 +IFLA_NUM_VF 21 +IFLA_VFINFO_LIST 22 +IFLA_STATS64 23 +IFLA_VF_PORTS 24 +IFLA_PORT_SELF 25 +IFLA_AF_SPEC 26 +IFLA_GROUP 27 +IFLA_NET_NS_FD 28 +IFLA_EXT_MASK 29 +IFLA_PROMISCUITY 30 +IFLA_NUM_TX_QUEUES 31 +IFLA_NUM_RX_QUEUES 32 +IFLA_CARRIER 33 +IFLA_PHYS_PORT_ID 34 +IFLA_CARRIER_CHANGES 35 +IFLA_PHYS_SWITCH_ID 36 +IFLA_LINK_NETNSID 37 +IFLA_PHYS_PORT_NAME 38 +IFLA_PROTO_DOWN 39 +IFLA_GSO_MAX_SEGS 40 +IFLA_GSO_MAX_SIZE 41 +IFLA_PAD 42 +IFLA_XDP 43 +IFLA_EVENT 44 +IFLA_NEW_NETNSID 45 +IFLA_IF_NETNSID 46 +IFLA_CARRIER_UP_COUNT 47 +IFLA_CARRIER_DOWN_COUNT 48 +IFLA_NEW_IFINDEX 49 +IFLA_MIN_MTU 50 +IFLA_MAX_MTU 51 diff --git a/xlat/rtnl_mdb_attrs.h b/xlat/rtnl_mdb_attrs.h new file mode 100644 index 00000000..8dc0308b --- /dev/null +++ b/xlat/rtnl_mdb_attrs.h @@ -0,0 +1,46 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_mdb_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(MDBA_UNSPEC) || (defined(HAVE_DECL_MDBA_UNSPEC) && HAVE_DECL_MDBA_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MDBA_UNSPEC) == (0), "MDBA_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MDBA_UNSPEC 0 +#endif +#if defined(MDBA_MDB) || (defined(HAVE_DECL_MDBA_MDB) && HAVE_DECL_MDBA_MDB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MDBA_MDB) == (1), "MDBA_MDB != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MDBA_MDB 1 +#endif +#if defined(MDBA_ROUTER) || (defined(HAVE_DECL_MDBA_ROUTER) && HAVE_DECL_MDBA_ROUTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MDBA_ROUTER) == (2), "MDBA_ROUTER != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MDBA_ROUTER 2 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_mdb_attrs in mpers mode + +# else + +static +const struct xlat rtnl_mdb_attrs[] = { + XLAT(MDBA_UNSPEC), + XLAT(MDBA_MDB), + XLAT(MDBA_ROUTER), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_mdb_attrs.in b/xlat/rtnl_mdb_attrs.in new file mode 100644 index 00000000..b8046624 --- /dev/null +++ b/xlat/rtnl_mdb_attrs.in @@ -0,0 +1,3 @@ +MDBA_UNSPEC 0 +MDBA_MDB 1 +MDBA_ROUTER 2 diff --git a/xlat/rtnl_mdba_mdb_attrs.h b/xlat/rtnl_mdba_mdb_attrs.h new file mode 100644 index 00000000..ff9c4aba --- /dev/null +++ b/xlat/rtnl_mdba_mdb_attrs.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_mdba_mdb_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(MDBA_MDB_UNSPEC) || (defined(HAVE_DECL_MDBA_MDB_UNSPEC) && HAVE_DECL_MDBA_MDB_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MDBA_MDB_UNSPEC) == (0), "MDBA_MDB_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MDBA_MDB_UNSPEC 0 +#endif +#if defined(MDBA_MDB_ENTRY) || (defined(HAVE_DECL_MDBA_MDB_ENTRY) && HAVE_DECL_MDBA_MDB_ENTRY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MDBA_MDB_ENTRY) == (1), "MDBA_MDB_ENTRY != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MDBA_MDB_ENTRY 1 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_mdba_mdb_attrs in mpers mode + +# else + +static +const struct xlat rtnl_mdba_mdb_attrs[] = { + XLAT(MDBA_MDB_UNSPEC), + XLAT(MDBA_MDB_ENTRY), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_mdba_mdb_attrs.in b/xlat/rtnl_mdba_mdb_attrs.in new file mode 100644 index 00000000..7ff5cce3 --- /dev/null +++ b/xlat/rtnl_mdba_mdb_attrs.in @@ -0,0 +1,2 @@ +MDBA_MDB_UNSPEC 0 +MDBA_MDB_ENTRY 1 diff --git a/xlat/rtnl_mdba_mdb_eattr_attrs.h b/xlat/rtnl_mdba_mdb_eattr_attrs.h new file mode 100644 index 00000000..47aa3bd9 --- /dev/null +++ b/xlat/rtnl_mdba_mdb_eattr_attrs.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_mdba_mdb_eattr_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(MDBA_MDB_EATTR_UNSPEC) || (defined(HAVE_DECL_MDBA_MDB_EATTR_UNSPEC) && HAVE_DECL_MDBA_MDB_EATTR_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MDBA_MDB_EATTR_UNSPEC) == (0), "MDBA_MDB_EATTR_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MDBA_MDB_EATTR_UNSPEC 0 +#endif +#if defined(MDBA_MDB_EATTR_TIMER) || (defined(HAVE_DECL_MDBA_MDB_EATTR_TIMER) && HAVE_DECL_MDBA_MDB_EATTR_TIMER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MDBA_MDB_EATTR_TIMER) == (1), "MDBA_MDB_EATTR_TIMER != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MDBA_MDB_EATTR_TIMER 1 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_mdba_mdb_eattr_attrs in mpers mode + +# else + +static +const struct xlat rtnl_mdba_mdb_eattr_attrs[] = { + XLAT(MDBA_MDB_EATTR_UNSPEC), + XLAT(MDBA_MDB_EATTR_TIMER), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_mdba_mdb_eattr_attrs.in b/xlat/rtnl_mdba_mdb_eattr_attrs.in new file mode 100644 index 00000000..c7c1b7b3 --- /dev/null +++ b/xlat/rtnl_mdba_mdb_eattr_attrs.in @@ -0,0 +1,2 @@ +MDBA_MDB_EATTR_UNSPEC 0 +MDBA_MDB_EATTR_TIMER 1 diff --git a/xlat/rtnl_mdba_mdb_entry_attrs.h b/xlat/rtnl_mdba_mdb_entry_attrs.h new file mode 100644 index 00000000..8c385186 --- /dev/null +++ b/xlat/rtnl_mdba_mdb_entry_attrs.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_mdba_mdb_entry_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(MDBA_MDB_ENTRY_UNSPEC) || (defined(HAVE_DECL_MDBA_MDB_ENTRY_UNSPEC) && HAVE_DECL_MDBA_MDB_ENTRY_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MDBA_MDB_ENTRY_UNSPEC) == (0), "MDBA_MDB_ENTRY_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MDBA_MDB_ENTRY_UNSPEC 0 +#endif +#if defined(MDBA_MDB_ENTRY_INFO) || (defined(HAVE_DECL_MDBA_MDB_ENTRY_INFO) && HAVE_DECL_MDBA_MDB_ENTRY_INFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MDBA_MDB_ENTRY_INFO) == (1), "MDBA_MDB_ENTRY_INFO != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MDBA_MDB_ENTRY_INFO 1 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_mdba_mdb_entry_attrs in mpers mode + +# else + +static +const struct xlat rtnl_mdba_mdb_entry_attrs[] = { + XLAT(MDBA_MDB_ENTRY_UNSPEC), + XLAT(MDBA_MDB_ENTRY_INFO), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_mdba_mdb_entry_attrs.in b/xlat/rtnl_mdba_mdb_entry_attrs.in new file mode 100644 index 00000000..52b18d69 --- /dev/null +++ b/xlat/rtnl_mdba_mdb_entry_attrs.in @@ -0,0 +1,2 @@ +MDBA_MDB_ENTRY_UNSPEC 0 +MDBA_MDB_ENTRY_INFO 1 diff --git a/xlat/rtnl_mdba_router_attrs.h b/xlat/rtnl_mdba_router_attrs.h new file mode 100644 index 00000000..cd50e549 --- /dev/null +++ b/xlat/rtnl_mdba_router_attrs.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_mdba_router_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(MDBA_ROUTER_UNSPEC) || (defined(HAVE_DECL_MDBA_ROUTER_UNSPEC) && HAVE_DECL_MDBA_ROUTER_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MDBA_ROUTER_UNSPEC) == (0), "MDBA_ROUTER_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MDBA_ROUTER_UNSPEC 0 +#endif +#if defined(MDBA_ROUTER_PORT) || (defined(HAVE_DECL_MDBA_ROUTER_PORT) && HAVE_DECL_MDBA_ROUTER_PORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MDBA_ROUTER_PORT) == (1), "MDBA_ROUTER_PORT != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MDBA_ROUTER_PORT 1 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_mdba_router_attrs in mpers mode + +# else + +static +const struct xlat rtnl_mdba_router_attrs[] = { + XLAT(MDBA_ROUTER_UNSPEC), + XLAT(MDBA_ROUTER_PORT), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_mdba_router_attrs.in b/xlat/rtnl_mdba_router_attrs.in new file mode 100644 index 00000000..21dfeaa3 --- /dev/null +++ b/xlat/rtnl_mdba_router_attrs.in @@ -0,0 +1,2 @@ +MDBA_ROUTER_UNSPEC 0 +MDBA_ROUTER_PORT 1 diff --git a/xlat/rtnl_mdba_router_pattr_attrs.h b/xlat/rtnl_mdba_router_pattr_attrs.h new file mode 100644 index 00000000..7081d57a --- /dev/null +++ b/xlat/rtnl_mdba_router_pattr_attrs.h @@ -0,0 +1,46 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_mdba_router_pattr_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(MDBA_ROUTER_PATTR_UNSPEC) || (defined(HAVE_DECL_MDBA_ROUTER_PATTR_UNSPEC) && HAVE_DECL_MDBA_ROUTER_PATTR_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MDBA_ROUTER_PATTR_UNSPEC) == (0), "MDBA_ROUTER_PATTR_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MDBA_ROUTER_PATTR_UNSPEC 0 +#endif +#if defined(MDBA_ROUTER_PATTR_TIMER) || (defined(HAVE_DECL_MDBA_ROUTER_PATTR_TIMER) && HAVE_DECL_MDBA_ROUTER_PATTR_TIMER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MDBA_ROUTER_PATTR_TIMER) == (1), "MDBA_ROUTER_PATTR_TIMER != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MDBA_ROUTER_PATTR_TIMER 1 +#endif +#if defined(MDBA_ROUTER_PATTR_TYPE) || (defined(HAVE_DECL_MDBA_ROUTER_PATTR_TYPE) && HAVE_DECL_MDBA_ROUTER_PATTR_TYPE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((MDBA_ROUTER_PATTR_TYPE) == (2), "MDBA_ROUTER_PATTR_TYPE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define MDBA_ROUTER_PATTR_TYPE 2 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_mdba_router_pattr_attrs in mpers mode + +# else + +static +const struct xlat rtnl_mdba_router_pattr_attrs[] = { + XLAT(MDBA_ROUTER_PATTR_UNSPEC), + XLAT(MDBA_ROUTER_PATTR_TIMER), + XLAT(MDBA_ROUTER_PATTR_TYPE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_mdba_router_pattr_attrs.in b/xlat/rtnl_mdba_router_pattr_attrs.in new file mode 100644 index 00000000..901e4f2f --- /dev/null +++ b/xlat/rtnl_mdba_router_pattr_attrs.in @@ -0,0 +1,3 @@ +MDBA_ROUTER_PATTR_UNSPEC 0 +MDBA_ROUTER_PATTR_TIMER 1 +MDBA_ROUTER_PATTR_TYPE 2 diff --git a/xlat/rtnl_neigh_attrs.h b/xlat/rtnl_neigh_attrs.h new file mode 100644 index 00000000..a31be6d9 --- /dev/null +++ b/xlat/rtnl_neigh_attrs.h @@ -0,0 +1,126 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_neigh_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NDA_UNSPEC) || (defined(HAVE_DECL_NDA_UNSPEC) && HAVE_DECL_NDA_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDA_UNSPEC) == (0), "NDA_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDA_UNSPEC 0 +#endif +#if defined(NDA_DST) || (defined(HAVE_DECL_NDA_DST) && HAVE_DECL_NDA_DST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDA_DST) == (1), "NDA_DST != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDA_DST 1 +#endif +#if defined(NDA_LLADDR) || (defined(HAVE_DECL_NDA_LLADDR) && HAVE_DECL_NDA_LLADDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDA_LLADDR) == (2), "NDA_LLADDR != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDA_LLADDR 2 +#endif +#if defined(NDA_CACHEINFO) || (defined(HAVE_DECL_NDA_CACHEINFO) && HAVE_DECL_NDA_CACHEINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDA_CACHEINFO) == (3), "NDA_CACHEINFO != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDA_CACHEINFO 3 +#endif +#if defined(NDA_PROBES) || (defined(HAVE_DECL_NDA_PROBES) && HAVE_DECL_NDA_PROBES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDA_PROBES) == (4), "NDA_PROBES != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDA_PROBES 4 +#endif +#if defined(NDA_VLAN) || (defined(HAVE_DECL_NDA_VLAN) && HAVE_DECL_NDA_VLAN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDA_VLAN) == (5), "NDA_VLAN != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDA_VLAN 5 +#endif +#if defined(NDA_PORT) || (defined(HAVE_DECL_NDA_PORT) && HAVE_DECL_NDA_PORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDA_PORT) == (6), "NDA_PORT != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDA_PORT 6 +#endif +#if defined(NDA_VNI) || (defined(HAVE_DECL_NDA_VNI) && HAVE_DECL_NDA_VNI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDA_VNI) == (7), "NDA_VNI != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDA_VNI 7 +#endif +#if defined(NDA_IFINDEX) || (defined(HAVE_DECL_NDA_IFINDEX) && HAVE_DECL_NDA_IFINDEX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDA_IFINDEX) == (8), "NDA_IFINDEX != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDA_IFINDEX 8 +#endif +#if defined(NDA_MASTER) || (defined(HAVE_DECL_NDA_MASTER) && HAVE_DECL_NDA_MASTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDA_MASTER) == (9), "NDA_MASTER != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDA_MASTER 9 +#endif +#if defined(NDA_LINK_NETNSID) || (defined(HAVE_DECL_NDA_LINK_NETNSID) && HAVE_DECL_NDA_LINK_NETNSID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDA_LINK_NETNSID) == (10), "NDA_LINK_NETNSID != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDA_LINK_NETNSID 10 +#endif +#if defined(NDA_SRC_VNI) || (defined(HAVE_DECL_NDA_SRC_VNI) && HAVE_DECL_NDA_SRC_VNI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDA_SRC_VNI) == (11), "NDA_SRC_VNI != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDA_SRC_VNI 11 +#endif +#if defined(NDA_PROTOCOL) || (defined(HAVE_DECL_NDA_PROTOCOL) && HAVE_DECL_NDA_PROTOCOL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDA_PROTOCOL) == (12), "NDA_PROTOCOL != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDA_PROTOCOL 12 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_neigh_attrs in mpers mode + +# else + +static +const struct xlat rtnl_neigh_attrs[] = { + XLAT(NDA_UNSPEC), + XLAT(NDA_DST), + XLAT(NDA_LLADDR), + XLAT(NDA_CACHEINFO), + XLAT(NDA_PROBES), + XLAT(NDA_VLAN), + XLAT(NDA_PORT), + XLAT(NDA_VNI), + XLAT(NDA_IFINDEX), + XLAT(NDA_MASTER), + XLAT(NDA_LINK_NETNSID), + XLAT(NDA_SRC_VNI), + XLAT(NDA_PROTOCOL), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_neigh_attrs.in b/xlat/rtnl_neigh_attrs.in new file mode 100644 index 00000000..b59c63d2 --- /dev/null +++ b/xlat/rtnl_neigh_attrs.in @@ -0,0 +1,13 @@ +NDA_UNSPEC 0 +NDA_DST 1 +NDA_LLADDR 2 +NDA_CACHEINFO 3 +NDA_PROBES 4 +NDA_VLAN 5 +NDA_PORT 6 +NDA_VNI 7 +NDA_IFINDEX 8 +NDA_MASTER 9 +NDA_LINK_NETNSID 10 +NDA_SRC_VNI 11 +NDA_PROTOCOL 12 diff --git a/xlat/rtnl_neightbl_attrs.h b/xlat/rtnl_neightbl_attrs.h new file mode 100644 index 00000000..8768bab8 --- /dev/null +++ b/xlat/rtnl_neightbl_attrs.h @@ -0,0 +1,102 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_neightbl_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NDTA_UNSPEC) || (defined(HAVE_DECL_NDTA_UNSPEC) && HAVE_DECL_NDTA_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTA_UNSPEC) == (0), "NDTA_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTA_UNSPEC 0 +#endif +#if defined(NDTA_NAME) || (defined(HAVE_DECL_NDTA_NAME) && HAVE_DECL_NDTA_NAME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTA_NAME) == (1), "NDTA_NAME != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTA_NAME 1 +#endif +#if defined(NDTA_THRESH1) || (defined(HAVE_DECL_NDTA_THRESH1) && HAVE_DECL_NDTA_THRESH1) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTA_THRESH1) == (2), "NDTA_THRESH1 != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTA_THRESH1 2 +#endif +#if defined(NDTA_THRESH2) || (defined(HAVE_DECL_NDTA_THRESH2) && HAVE_DECL_NDTA_THRESH2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTA_THRESH2) == (3), "NDTA_THRESH2 != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTA_THRESH2 3 +#endif +#if defined(NDTA_THRESH3) || (defined(HAVE_DECL_NDTA_THRESH3) && HAVE_DECL_NDTA_THRESH3) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTA_THRESH3) == (4), "NDTA_THRESH3 != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTA_THRESH3 4 +#endif +#if defined(NDTA_CONFIG) || (defined(HAVE_DECL_NDTA_CONFIG) && HAVE_DECL_NDTA_CONFIG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTA_CONFIG) == (5), "NDTA_CONFIG != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTA_CONFIG 5 +#endif +#if defined(NDTA_PARMS) || (defined(HAVE_DECL_NDTA_PARMS) && HAVE_DECL_NDTA_PARMS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTA_PARMS) == (6), "NDTA_PARMS != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTA_PARMS 6 +#endif +#if defined(NDTA_STATS) || (defined(HAVE_DECL_NDTA_STATS) && HAVE_DECL_NDTA_STATS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTA_STATS) == (7), "NDTA_STATS != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTA_STATS 7 +#endif +#if defined(NDTA_GC_INTERVAL) || (defined(HAVE_DECL_NDTA_GC_INTERVAL) && HAVE_DECL_NDTA_GC_INTERVAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTA_GC_INTERVAL) == (8), "NDTA_GC_INTERVAL != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTA_GC_INTERVAL 8 +#endif +#if defined(NDTA_PAD) || (defined(HAVE_DECL_NDTA_PAD) && HAVE_DECL_NDTA_PAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTA_PAD) == (9), "NDTA_PAD != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTA_PAD 9 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_neightbl_attrs in mpers mode + +# else + +static +const struct xlat rtnl_neightbl_attrs[] = { + XLAT(NDTA_UNSPEC), + XLAT(NDTA_NAME), + XLAT(NDTA_THRESH1), + XLAT(NDTA_THRESH2), + XLAT(NDTA_THRESH3), + XLAT(NDTA_CONFIG), + XLAT(NDTA_PARMS), + XLAT(NDTA_STATS), + XLAT(NDTA_GC_INTERVAL), + XLAT(NDTA_PAD), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_neightbl_attrs.in b/xlat/rtnl_neightbl_attrs.in new file mode 100644 index 00000000..ea840f66 --- /dev/null +++ b/xlat/rtnl_neightbl_attrs.in @@ -0,0 +1,10 @@ +NDTA_UNSPEC 0 +NDTA_NAME 1 +NDTA_THRESH1 2 +NDTA_THRESH2 3 +NDTA_THRESH3 4 +NDTA_CONFIG 5 +NDTA_PARMS 6 +NDTA_STATS 7 +NDTA_GC_INTERVAL 8 +NDTA_PAD 9 diff --git a/xlat/rtnl_neightbl_parms_attrs.h b/xlat/rtnl_neightbl_parms_attrs.h new file mode 100644 index 00000000..75bbdec7 --- /dev/null +++ b/xlat/rtnl_neightbl_parms_attrs.h @@ -0,0 +1,174 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_neightbl_parms_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NDTPA_UNSPEC) || (defined(HAVE_DECL_NDTPA_UNSPEC) && HAVE_DECL_NDTPA_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTPA_UNSPEC) == (0), "NDTPA_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTPA_UNSPEC 0 +#endif +#if defined(NDTPA_IFINDEX) || (defined(HAVE_DECL_NDTPA_IFINDEX) && HAVE_DECL_NDTPA_IFINDEX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTPA_IFINDEX) == (1), "NDTPA_IFINDEX != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTPA_IFINDEX 1 +#endif +#if defined(NDTPA_REFCNT) || (defined(HAVE_DECL_NDTPA_REFCNT) && HAVE_DECL_NDTPA_REFCNT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTPA_REFCNT) == (2), "NDTPA_REFCNT != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTPA_REFCNT 2 +#endif +#if defined(NDTPA_REACHABLE_TIME) || (defined(HAVE_DECL_NDTPA_REACHABLE_TIME) && HAVE_DECL_NDTPA_REACHABLE_TIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTPA_REACHABLE_TIME) == (3), "NDTPA_REACHABLE_TIME != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTPA_REACHABLE_TIME 3 +#endif +#if defined(NDTPA_BASE_REACHABLE_TIME) || (defined(HAVE_DECL_NDTPA_BASE_REACHABLE_TIME) && HAVE_DECL_NDTPA_BASE_REACHABLE_TIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTPA_BASE_REACHABLE_TIME) == (4), "NDTPA_BASE_REACHABLE_TIME != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTPA_BASE_REACHABLE_TIME 4 +#endif +#if defined(NDTPA_RETRANS_TIME) || (defined(HAVE_DECL_NDTPA_RETRANS_TIME) && HAVE_DECL_NDTPA_RETRANS_TIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTPA_RETRANS_TIME) == (5), "NDTPA_RETRANS_TIME != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTPA_RETRANS_TIME 5 +#endif +#if defined(NDTPA_GC_STALETIME) || (defined(HAVE_DECL_NDTPA_GC_STALETIME) && HAVE_DECL_NDTPA_GC_STALETIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTPA_GC_STALETIME) == (6), "NDTPA_GC_STALETIME != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTPA_GC_STALETIME 6 +#endif +#if defined(NDTPA_DELAY_PROBE_TIME) || (defined(HAVE_DECL_NDTPA_DELAY_PROBE_TIME) && HAVE_DECL_NDTPA_DELAY_PROBE_TIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTPA_DELAY_PROBE_TIME) == (7), "NDTPA_DELAY_PROBE_TIME != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTPA_DELAY_PROBE_TIME 7 +#endif +#if defined(NDTPA_QUEUE_LEN) || (defined(HAVE_DECL_NDTPA_QUEUE_LEN) && HAVE_DECL_NDTPA_QUEUE_LEN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTPA_QUEUE_LEN) == (8), "NDTPA_QUEUE_LEN != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTPA_QUEUE_LEN 8 +#endif +#if defined(NDTPA_APP_PROBES) || (defined(HAVE_DECL_NDTPA_APP_PROBES) && HAVE_DECL_NDTPA_APP_PROBES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTPA_APP_PROBES) == (9), "NDTPA_APP_PROBES != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTPA_APP_PROBES 9 +#endif +#if defined(NDTPA_UCAST_PROBES) || (defined(HAVE_DECL_NDTPA_UCAST_PROBES) && HAVE_DECL_NDTPA_UCAST_PROBES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTPA_UCAST_PROBES) == (10), "NDTPA_UCAST_PROBES != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTPA_UCAST_PROBES 10 +#endif +#if defined(NDTPA_MCAST_PROBES) || (defined(HAVE_DECL_NDTPA_MCAST_PROBES) && HAVE_DECL_NDTPA_MCAST_PROBES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTPA_MCAST_PROBES) == (11), "NDTPA_MCAST_PROBES != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTPA_MCAST_PROBES 11 +#endif +#if defined(NDTPA_ANYCAST_DELAY) || (defined(HAVE_DECL_NDTPA_ANYCAST_DELAY) && HAVE_DECL_NDTPA_ANYCAST_DELAY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTPA_ANYCAST_DELAY) == (12), "NDTPA_ANYCAST_DELAY != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTPA_ANYCAST_DELAY 12 +#endif +#if defined(NDTPA_PROXY_DELAY) || (defined(HAVE_DECL_NDTPA_PROXY_DELAY) && HAVE_DECL_NDTPA_PROXY_DELAY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTPA_PROXY_DELAY) == (13), "NDTPA_PROXY_DELAY != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTPA_PROXY_DELAY 13 +#endif +#if defined(NDTPA_PROXY_QLEN) || (defined(HAVE_DECL_NDTPA_PROXY_QLEN) && HAVE_DECL_NDTPA_PROXY_QLEN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTPA_PROXY_QLEN) == (14), "NDTPA_PROXY_QLEN != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTPA_PROXY_QLEN 14 +#endif +#if defined(NDTPA_LOCKTIME) || (defined(HAVE_DECL_NDTPA_LOCKTIME) && HAVE_DECL_NDTPA_LOCKTIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTPA_LOCKTIME) == (15), "NDTPA_LOCKTIME != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTPA_LOCKTIME 15 +#endif +#if defined(NDTPA_QUEUE_LENBYTES) || (defined(HAVE_DECL_NDTPA_QUEUE_LENBYTES) && HAVE_DECL_NDTPA_QUEUE_LENBYTES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTPA_QUEUE_LENBYTES) == (16), "NDTPA_QUEUE_LENBYTES != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTPA_QUEUE_LENBYTES 16 +#endif +#if defined(NDTPA_MCAST_REPROBES) || (defined(HAVE_DECL_NDTPA_MCAST_REPROBES) && HAVE_DECL_NDTPA_MCAST_REPROBES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTPA_MCAST_REPROBES) == (17), "NDTPA_MCAST_REPROBES != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTPA_MCAST_REPROBES 17 +#endif +#if defined(NDTPA_PAD) || (defined(HAVE_DECL_NDTPA_PAD) && HAVE_DECL_NDTPA_PAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NDTPA_PAD) == (18), "NDTPA_PAD != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NDTPA_PAD 18 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_neightbl_parms_attrs in mpers mode + +# else + +static +const struct xlat rtnl_neightbl_parms_attrs[] = { + XLAT(NDTPA_UNSPEC), + XLAT(NDTPA_IFINDEX), + XLAT(NDTPA_REFCNT), + XLAT(NDTPA_REACHABLE_TIME), + XLAT(NDTPA_BASE_REACHABLE_TIME), + XLAT(NDTPA_RETRANS_TIME), + XLAT(NDTPA_GC_STALETIME), + XLAT(NDTPA_DELAY_PROBE_TIME), + XLAT(NDTPA_QUEUE_LEN), + XLAT(NDTPA_APP_PROBES), + XLAT(NDTPA_UCAST_PROBES), + XLAT(NDTPA_MCAST_PROBES), + XLAT(NDTPA_ANYCAST_DELAY), + XLAT(NDTPA_PROXY_DELAY), + XLAT(NDTPA_PROXY_QLEN), + XLAT(NDTPA_LOCKTIME), + XLAT(NDTPA_QUEUE_LENBYTES), + XLAT(NDTPA_MCAST_REPROBES), + XLAT(NDTPA_PAD), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_neightbl_parms_attrs.in b/xlat/rtnl_neightbl_parms_attrs.in new file mode 100644 index 00000000..9fcbff09 --- /dev/null +++ b/xlat/rtnl_neightbl_parms_attrs.in @@ -0,0 +1,19 @@ +NDTPA_UNSPEC 0 +NDTPA_IFINDEX 1 +NDTPA_REFCNT 2 +NDTPA_REACHABLE_TIME 3 +NDTPA_BASE_REACHABLE_TIME 4 +NDTPA_RETRANS_TIME 5 +NDTPA_GC_STALETIME 6 +NDTPA_DELAY_PROBE_TIME 7 +NDTPA_QUEUE_LEN 8 +NDTPA_APP_PROBES 9 +NDTPA_UCAST_PROBES 10 +NDTPA_MCAST_PROBES 11 +NDTPA_ANYCAST_DELAY 12 +NDTPA_PROXY_DELAY 13 +NDTPA_PROXY_QLEN 14 +NDTPA_LOCKTIME 15 +NDTPA_QUEUE_LENBYTES 16 +NDTPA_MCAST_REPROBES 17 +NDTPA_PAD 18 diff --git a/xlat/rtnl_netconf_attrs.h b/xlat/rtnl_netconf_attrs.h new file mode 100644 index 00000000..d1d7c873 --- /dev/null +++ b/xlat/rtnl_netconf_attrs.h @@ -0,0 +1,94 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_netconf_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NETCONFA_UNSPEC) || (defined(HAVE_DECL_NETCONFA_UNSPEC) && HAVE_DECL_NETCONFA_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETCONFA_UNSPEC) == (0), "NETCONFA_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETCONFA_UNSPEC 0 +#endif +#if defined(NETCONFA_IFINDEX) || (defined(HAVE_DECL_NETCONFA_IFINDEX) && HAVE_DECL_NETCONFA_IFINDEX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETCONFA_IFINDEX) == (1), "NETCONFA_IFINDEX != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETCONFA_IFINDEX 1 +#endif +#if defined(NETCONFA_FORWARDING) || (defined(HAVE_DECL_NETCONFA_FORWARDING) && HAVE_DECL_NETCONFA_FORWARDING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETCONFA_FORWARDING) == (2), "NETCONFA_FORWARDING != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETCONFA_FORWARDING 2 +#endif +#if defined(NETCONFA_RP_FILTER) || (defined(HAVE_DECL_NETCONFA_RP_FILTER) && HAVE_DECL_NETCONFA_RP_FILTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETCONFA_RP_FILTER) == (3), "NETCONFA_RP_FILTER != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETCONFA_RP_FILTER 3 +#endif +#if defined(NETCONFA_MC_FORWARDING) || (defined(HAVE_DECL_NETCONFA_MC_FORWARDING) && HAVE_DECL_NETCONFA_MC_FORWARDING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETCONFA_MC_FORWARDING) == (4), "NETCONFA_MC_FORWARDING != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETCONFA_MC_FORWARDING 4 +#endif +#if defined(NETCONFA_PROXY_NEIGH) || (defined(HAVE_DECL_NETCONFA_PROXY_NEIGH) && HAVE_DECL_NETCONFA_PROXY_NEIGH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETCONFA_PROXY_NEIGH) == (5), "NETCONFA_PROXY_NEIGH != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETCONFA_PROXY_NEIGH 5 +#endif +#if defined(NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN) || (defined(HAVE_DECL_NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN) && HAVE_DECL_NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN) == (6), "NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN 6 +#endif +#if defined(NETCONFA_INPUT) || (defined(HAVE_DECL_NETCONFA_INPUT) && HAVE_DECL_NETCONFA_INPUT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETCONFA_INPUT) == (7), "NETCONFA_INPUT != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETCONFA_INPUT 7 +#endif +#if defined(NETCONFA_BC_FORWARDING) || (defined(HAVE_DECL_NETCONFA_BC_FORWARDING) && HAVE_DECL_NETCONFA_BC_FORWARDING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETCONFA_BC_FORWARDING) == (8), "NETCONFA_BC_FORWARDING != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETCONFA_BC_FORWARDING 8 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_netconf_attrs in mpers mode + +# else + +static +const struct xlat rtnl_netconf_attrs[] = { + XLAT(NETCONFA_UNSPEC), + XLAT(NETCONFA_IFINDEX), + XLAT(NETCONFA_FORWARDING), + XLAT(NETCONFA_RP_FILTER), + XLAT(NETCONFA_MC_FORWARDING), + XLAT(NETCONFA_PROXY_NEIGH), + XLAT(NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN), + XLAT(NETCONFA_INPUT), + XLAT(NETCONFA_BC_FORWARDING), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_netconf_attrs.in b/xlat/rtnl_netconf_attrs.in new file mode 100644 index 00000000..285398f5 --- /dev/null +++ b/xlat/rtnl_netconf_attrs.in @@ -0,0 +1,9 @@ +NETCONFA_UNSPEC 0 +NETCONFA_IFINDEX 1 +NETCONFA_FORWARDING 2 +NETCONFA_RP_FILTER 3 +NETCONFA_MC_FORWARDING 4 +NETCONFA_PROXY_NEIGH 5 +NETCONFA_IGNORE_ROUTES_WITH_LINKDOWN 6 +NETCONFA_INPUT 7 +NETCONFA_BC_FORWARDING 8 diff --git a/xlat/rtnl_nsid_attrs.h b/xlat/rtnl_nsid_attrs.h new file mode 100644 index 00000000..b532361c --- /dev/null +++ b/xlat/rtnl_nsid_attrs.h @@ -0,0 +1,78 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_nsid_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NETNSA_NSID_NOT_ASSIGNED) || (defined(HAVE_DECL_NETNSA_NSID_NOT_ASSIGNED) && HAVE_DECL_NETNSA_NSID_NOT_ASSIGNED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETNSA_NSID_NOT_ASSIGNED) == (-1), "NETNSA_NSID_NOT_ASSIGNED != -1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETNSA_NSID_NOT_ASSIGNED -1 +#endif +#if defined(NETNSA_NONE) || (defined(HAVE_DECL_NETNSA_NONE) && HAVE_DECL_NETNSA_NONE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETNSA_NONE) == (0), "NETNSA_NONE != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETNSA_NONE 0 +#endif +#if defined(NETNSA_NSID) || (defined(HAVE_DECL_NETNSA_NSID) && HAVE_DECL_NETNSA_NSID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETNSA_NSID) == (1), "NETNSA_NSID != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETNSA_NSID 1 +#endif +#if defined(NETNSA_PID) || (defined(HAVE_DECL_NETNSA_PID) && HAVE_DECL_NETNSA_PID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETNSA_PID) == (2), "NETNSA_PID != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETNSA_PID 2 +#endif +#if defined(NETNSA_FD) || (defined(HAVE_DECL_NETNSA_FD) && HAVE_DECL_NETNSA_FD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETNSA_FD) == (3), "NETNSA_FD != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETNSA_FD 3 +#endif +#if defined(NETNSA_TARGET_NSID) || (defined(HAVE_DECL_NETNSA_TARGET_NSID) && HAVE_DECL_NETNSA_TARGET_NSID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETNSA_TARGET_NSID) == (4), "NETNSA_TARGET_NSID != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETNSA_TARGET_NSID 4 +#endif +#if defined(NETNSA_CURRENT_NSID) || (defined(HAVE_DECL_NETNSA_CURRENT_NSID) && HAVE_DECL_NETNSA_CURRENT_NSID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETNSA_CURRENT_NSID) == (5), "NETNSA_CURRENT_NSID != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETNSA_CURRENT_NSID 5 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_nsid_attrs in mpers mode + +# else + +static +const struct xlat rtnl_nsid_attrs[] = { + XLAT(NETNSA_NSID_NOT_ASSIGNED), + XLAT(NETNSA_NONE), + XLAT(NETNSA_NSID), + XLAT(NETNSA_PID), + XLAT(NETNSA_FD), + XLAT(NETNSA_TARGET_NSID), + XLAT(NETNSA_CURRENT_NSID), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_nsid_attrs.in b/xlat/rtnl_nsid_attrs.in new file mode 100644 index 00000000..591fb23f --- /dev/null +++ b/xlat/rtnl_nsid_attrs.in @@ -0,0 +1,7 @@ +NETNSA_NSID_NOT_ASSIGNED -1 +NETNSA_NONE 0 +NETNSA_NSID 1 +NETNSA_PID 2 +NETNSA_FD 3 +NETNSA_TARGET_NSID 4 +NETNSA_CURRENT_NSID 5 diff --git a/xlat/rtnl_route_attrs.h b/xlat/rtnl_route_attrs.h new file mode 100644 index 00000000..a3d64690 --- /dev/null +++ b/xlat/rtnl_route_attrs.h @@ -0,0 +1,262 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_route_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(RTA_UNSPEC) || (defined(HAVE_DECL_RTA_UNSPEC) && HAVE_DECL_RTA_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_UNSPEC) == (0), "RTA_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_UNSPEC 0 +#endif +#if defined(RTA_DST) || (defined(HAVE_DECL_RTA_DST) && HAVE_DECL_RTA_DST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_DST) == (1), "RTA_DST != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_DST 1 +#endif +#if defined(RTA_SRC) || (defined(HAVE_DECL_RTA_SRC) && HAVE_DECL_RTA_SRC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_SRC) == (2), "RTA_SRC != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_SRC 2 +#endif +#if defined(RTA_IIF) || (defined(HAVE_DECL_RTA_IIF) && HAVE_DECL_RTA_IIF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_IIF) == (3), "RTA_IIF != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_IIF 3 +#endif +#if defined(RTA_OIF) || (defined(HAVE_DECL_RTA_OIF) && HAVE_DECL_RTA_OIF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_OIF) == (4), "RTA_OIF != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_OIF 4 +#endif +#if defined(RTA_GATEWAY) || (defined(HAVE_DECL_RTA_GATEWAY) && HAVE_DECL_RTA_GATEWAY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_GATEWAY) == (5), "RTA_GATEWAY != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_GATEWAY 5 +#endif +#if defined(RTA_PRIORITY) || (defined(HAVE_DECL_RTA_PRIORITY) && HAVE_DECL_RTA_PRIORITY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_PRIORITY) == (6), "RTA_PRIORITY != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_PRIORITY 6 +#endif +#if defined(RTA_PREFSRC) || (defined(HAVE_DECL_RTA_PREFSRC) && HAVE_DECL_RTA_PREFSRC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_PREFSRC) == (7), "RTA_PREFSRC != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_PREFSRC 7 +#endif +#if defined(RTA_METRICS) || (defined(HAVE_DECL_RTA_METRICS) && HAVE_DECL_RTA_METRICS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_METRICS) == (8), "RTA_METRICS != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_METRICS 8 +#endif +#if defined(RTA_MULTIPATH) || (defined(HAVE_DECL_RTA_MULTIPATH) && HAVE_DECL_RTA_MULTIPATH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_MULTIPATH) == (9), "RTA_MULTIPATH != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_MULTIPATH 9 +#endif +#if defined(RTA_PROTOINFO) || (defined(HAVE_DECL_RTA_PROTOINFO) && HAVE_DECL_RTA_PROTOINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_PROTOINFO) == (10), "RTA_PROTOINFO != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_PROTOINFO 10 +#endif +#if defined(RTA_FLOW) || (defined(HAVE_DECL_RTA_FLOW) && HAVE_DECL_RTA_FLOW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_FLOW) == (11), "RTA_FLOW != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_FLOW 11 +#endif +#if defined(RTA_CACHEINFO) || (defined(HAVE_DECL_RTA_CACHEINFO) && HAVE_DECL_RTA_CACHEINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_CACHEINFO) == (12), "RTA_CACHEINFO != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_CACHEINFO 12 +#endif +#if defined(RTA_SESSION) || (defined(HAVE_DECL_RTA_SESSION) && HAVE_DECL_RTA_SESSION) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_SESSION) == (13), "RTA_SESSION != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_SESSION 13 +#endif +#if defined(RTA_MP_ALGO) || (defined(HAVE_DECL_RTA_MP_ALGO) && HAVE_DECL_RTA_MP_ALGO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_MP_ALGO) == (14), "RTA_MP_ALGO != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_MP_ALGO 14 +#endif +#if defined(RTA_TABLE) || (defined(HAVE_DECL_RTA_TABLE) && HAVE_DECL_RTA_TABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_TABLE) == (15), "RTA_TABLE != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_TABLE 15 +#endif +#if defined(RTA_MARK) || (defined(HAVE_DECL_RTA_MARK) && HAVE_DECL_RTA_MARK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_MARK) == (16), "RTA_MARK != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_MARK 16 +#endif +#if defined(RTA_MFC_STATS) || (defined(HAVE_DECL_RTA_MFC_STATS) && HAVE_DECL_RTA_MFC_STATS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_MFC_STATS) == (17), "RTA_MFC_STATS != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_MFC_STATS 17 +#endif +#if defined(RTA_VIA) || (defined(HAVE_DECL_RTA_VIA) && HAVE_DECL_RTA_VIA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_VIA) == (18), "RTA_VIA != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_VIA 18 +#endif +#if defined(RTA_NEWDST) || (defined(HAVE_DECL_RTA_NEWDST) && HAVE_DECL_RTA_NEWDST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_NEWDST) == (19), "RTA_NEWDST != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_NEWDST 19 +#endif +#if defined(RTA_PREF) || (defined(HAVE_DECL_RTA_PREF) && HAVE_DECL_RTA_PREF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_PREF) == (20), "RTA_PREF != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_PREF 20 +#endif +#if defined(RTA_ENCAP_TYPE) || (defined(HAVE_DECL_RTA_ENCAP_TYPE) && HAVE_DECL_RTA_ENCAP_TYPE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_ENCAP_TYPE) == (21), "RTA_ENCAP_TYPE != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_ENCAP_TYPE 21 +#endif +#if defined(RTA_ENCAP) || (defined(HAVE_DECL_RTA_ENCAP) && HAVE_DECL_RTA_ENCAP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_ENCAP) == (22), "RTA_ENCAP != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_ENCAP 22 +#endif +#if defined(RTA_EXPIRES) || (defined(HAVE_DECL_RTA_EXPIRES) && HAVE_DECL_RTA_EXPIRES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_EXPIRES) == (23), "RTA_EXPIRES != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_EXPIRES 23 +#endif +#if defined(RTA_PAD) || (defined(HAVE_DECL_RTA_PAD) && HAVE_DECL_RTA_PAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_PAD) == (24), "RTA_PAD != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_PAD 24 +#endif +#if defined(RTA_UID) || (defined(HAVE_DECL_RTA_UID) && HAVE_DECL_RTA_UID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_UID) == (25), "RTA_UID != 25"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_UID 25 +#endif +#if defined(RTA_TTL_PROPAGATE) || (defined(HAVE_DECL_RTA_TTL_PROPAGATE) && HAVE_DECL_RTA_TTL_PROPAGATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_TTL_PROPAGATE) == (26), "RTA_TTL_PROPAGATE != 26"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_TTL_PROPAGATE 26 +#endif +#if defined(RTA_IP_PROTO) || (defined(HAVE_DECL_RTA_IP_PROTO) && HAVE_DECL_RTA_IP_PROTO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_IP_PROTO) == (27), "RTA_IP_PROTO != 27"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_IP_PROTO 27 +#endif +#if defined(RTA_SPORT) || (defined(HAVE_DECL_RTA_SPORT) && HAVE_DECL_RTA_SPORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_SPORT) == (28), "RTA_SPORT != 28"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_SPORT 28 +#endif +#if defined(RTA_DPORT) || (defined(HAVE_DECL_RTA_DPORT) && HAVE_DECL_RTA_DPORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTA_DPORT) == (29), "RTA_DPORT != 29"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTA_DPORT 29 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_route_attrs in mpers mode + +# else + +static +const struct xlat rtnl_route_attrs[] = { + XLAT(RTA_UNSPEC), + XLAT(RTA_DST), + XLAT(RTA_SRC), + XLAT(RTA_IIF), + XLAT(RTA_OIF), + XLAT(RTA_GATEWAY), + XLAT(RTA_PRIORITY), + XLAT(RTA_PREFSRC), + XLAT(RTA_METRICS), + XLAT(RTA_MULTIPATH), + XLAT(RTA_PROTOINFO), + XLAT(RTA_FLOW), + XLAT(RTA_CACHEINFO), + XLAT(RTA_SESSION), + XLAT(RTA_MP_ALGO), + XLAT(RTA_TABLE), + XLAT(RTA_MARK), + XLAT(RTA_MFC_STATS), + XLAT(RTA_VIA), + XLAT(RTA_NEWDST), + XLAT(RTA_PREF), + XLAT(RTA_ENCAP_TYPE), + XLAT(RTA_ENCAP), + XLAT(RTA_EXPIRES), + XLAT(RTA_PAD), + XLAT(RTA_UID), + XLAT(RTA_TTL_PROPAGATE), + XLAT(RTA_IP_PROTO), + XLAT(RTA_SPORT), + XLAT(RTA_DPORT), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_route_attrs.in b/xlat/rtnl_route_attrs.in new file mode 100644 index 00000000..bfd76580 --- /dev/null +++ b/xlat/rtnl_route_attrs.in @@ -0,0 +1,30 @@ +RTA_UNSPEC 0 +RTA_DST 1 +RTA_SRC 2 +RTA_IIF 3 +RTA_OIF 4 +RTA_GATEWAY 5 +RTA_PRIORITY 6 +RTA_PREFSRC 7 +RTA_METRICS 8 +RTA_MULTIPATH 9 +RTA_PROTOINFO 10 +RTA_FLOW 11 +RTA_CACHEINFO 12 +RTA_SESSION 13 +RTA_MP_ALGO 14 +RTA_TABLE 15 +RTA_MARK 16 +RTA_MFC_STATS 17 +RTA_VIA 18 +RTA_NEWDST 19 +RTA_PREF 20 +RTA_ENCAP_TYPE 21 +RTA_ENCAP 22 +RTA_EXPIRES 23 +RTA_PAD 24 +RTA_UID 25 +RTA_TTL_PROPAGATE 26 +RTA_IP_PROTO 27 +RTA_SPORT 28 +RTA_DPORT 29 diff --git a/xlat/rtnl_rta_metrics_attrs.h b/xlat/rtnl_rta_metrics_attrs.h new file mode 100644 index 00000000..b4414592 --- /dev/null +++ b/xlat/rtnl_rta_metrics_attrs.h @@ -0,0 +1,158 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_rta_metrics_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(RTAX_UNSPEC) || (defined(HAVE_DECL_RTAX_UNSPEC) && HAVE_DECL_RTAX_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTAX_UNSPEC) == (0), "RTAX_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTAX_UNSPEC 0 +#endif +#if defined(RTAX_LOCK) || (defined(HAVE_DECL_RTAX_LOCK) && HAVE_DECL_RTAX_LOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTAX_LOCK) == (1), "RTAX_LOCK != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTAX_LOCK 1 +#endif +#if defined(RTAX_MTU) || (defined(HAVE_DECL_RTAX_MTU) && HAVE_DECL_RTAX_MTU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTAX_MTU) == (2), "RTAX_MTU != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTAX_MTU 2 +#endif +#if defined(RTAX_WINDOW) || (defined(HAVE_DECL_RTAX_WINDOW) && HAVE_DECL_RTAX_WINDOW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTAX_WINDOW) == (3), "RTAX_WINDOW != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTAX_WINDOW 3 +#endif +#if defined(RTAX_RTT) || (defined(HAVE_DECL_RTAX_RTT) && HAVE_DECL_RTAX_RTT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTAX_RTT) == (4), "RTAX_RTT != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTAX_RTT 4 +#endif +#if defined(RTAX_RTTVAR) || (defined(HAVE_DECL_RTAX_RTTVAR) && HAVE_DECL_RTAX_RTTVAR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTAX_RTTVAR) == (5), "RTAX_RTTVAR != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTAX_RTTVAR 5 +#endif +#if defined(RTAX_SSTHRESH) || (defined(HAVE_DECL_RTAX_SSTHRESH) && HAVE_DECL_RTAX_SSTHRESH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTAX_SSTHRESH) == (6), "RTAX_SSTHRESH != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTAX_SSTHRESH 6 +#endif +#if defined(RTAX_CWND) || (defined(HAVE_DECL_RTAX_CWND) && HAVE_DECL_RTAX_CWND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTAX_CWND) == (7), "RTAX_CWND != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTAX_CWND 7 +#endif +#if defined(RTAX_ADVMSS) || (defined(HAVE_DECL_RTAX_ADVMSS) && HAVE_DECL_RTAX_ADVMSS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTAX_ADVMSS) == (8), "RTAX_ADVMSS != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTAX_ADVMSS 8 +#endif +#if defined(RTAX_REORDERING) || (defined(HAVE_DECL_RTAX_REORDERING) && HAVE_DECL_RTAX_REORDERING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTAX_REORDERING) == (9), "RTAX_REORDERING != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTAX_REORDERING 9 +#endif +#if defined(RTAX_HOPLIMIT) || (defined(HAVE_DECL_RTAX_HOPLIMIT) && HAVE_DECL_RTAX_HOPLIMIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTAX_HOPLIMIT) == (10), "RTAX_HOPLIMIT != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTAX_HOPLIMIT 10 +#endif +#if defined(RTAX_INITCWND) || (defined(HAVE_DECL_RTAX_INITCWND) && HAVE_DECL_RTAX_INITCWND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTAX_INITCWND) == (11), "RTAX_INITCWND != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTAX_INITCWND 11 +#endif +#if defined(RTAX_FEATURES) || (defined(HAVE_DECL_RTAX_FEATURES) && HAVE_DECL_RTAX_FEATURES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTAX_FEATURES) == (12), "RTAX_FEATURES != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTAX_FEATURES 12 +#endif +#if defined(RTAX_RTO_MIN) || (defined(HAVE_DECL_RTAX_RTO_MIN) && HAVE_DECL_RTAX_RTO_MIN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTAX_RTO_MIN) == (13), "RTAX_RTO_MIN != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTAX_RTO_MIN 13 +#endif +#if defined(RTAX_INITRWND) || (defined(HAVE_DECL_RTAX_INITRWND) && HAVE_DECL_RTAX_INITRWND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTAX_INITRWND) == (14), "RTAX_INITRWND != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTAX_INITRWND 14 +#endif +#if defined(RTAX_QUICKACK) || (defined(HAVE_DECL_RTAX_QUICKACK) && HAVE_DECL_RTAX_QUICKACK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTAX_QUICKACK) == (15), "RTAX_QUICKACK != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTAX_QUICKACK 15 +#endif +#if defined(RTAX_CC_ALGO) || (defined(HAVE_DECL_RTAX_CC_ALGO) && HAVE_DECL_RTAX_CC_ALGO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RTAX_CC_ALGO) == (16), "RTAX_CC_ALGO != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RTAX_CC_ALGO 16 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_rta_metrics_attrs in mpers mode + +# else + +static +const struct xlat rtnl_rta_metrics_attrs[] = { + XLAT(RTAX_UNSPEC), + XLAT(RTAX_LOCK), + XLAT(RTAX_MTU), + XLAT(RTAX_WINDOW), + XLAT(RTAX_RTT), + XLAT(RTAX_RTTVAR), + XLAT(RTAX_SSTHRESH), + XLAT(RTAX_CWND), + XLAT(RTAX_ADVMSS), + XLAT(RTAX_REORDERING), + XLAT(RTAX_HOPLIMIT), + XLAT(RTAX_INITCWND), + XLAT(RTAX_FEATURES), + XLAT(RTAX_RTO_MIN), + XLAT(RTAX_INITRWND), + XLAT(RTAX_QUICKACK), + XLAT(RTAX_CC_ALGO), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_rta_metrics_attrs.in b/xlat/rtnl_rta_metrics_attrs.in new file mode 100644 index 00000000..2a683332 --- /dev/null +++ b/xlat/rtnl_rta_metrics_attrs.in @@ -0,0 +1,17 @@ +RTAX_UNSPEC 0 +RTAX_LOCK 1 +RTAX_MTU 2 +RTAX_WINDOW 3 +RTAX_RTT 4 +RTAX_RTTVAR 5 +RTAX_SSTHRESH 6 +RTAX_CWND 7 +RTAX_ADVMSS 8 +RTAX_REORDERING 9 +RTAX_HOPLIMIT 10 +RTAX_INITCWND 11 +RTAX_FEATURES 12 +RTAX_RTO_MIN 13 +RTAX_INITRWND 14 +RTAX_QUICKACK 15 +RTAX_CC_ALGO 16 diff --git a/xlat/rtnl_rule_attrs.h b/xlat/rtnl_rule_attrs.h new file mode 100644 index 00000000..683bbee2 --- /dev/null +++ b/xlat/rtnl_rule_attrs.h @@ -0,0 +1,222 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_rule_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(FRA_UNSPEC) || (defined(HAVE_DECL_FRA_UNSPEC) && HAVE_DECL_FRA_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_UNSPEC) == (0), "FRA_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_UNSPEC 0 +#endif +#if defined(FRA_DST) || (defined(HAVE_DECL_FRA_DST) && HAVE_DECL_FRA_DST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_DST) == (1), "FRA_DST != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_DST 1 +#endif +#if defined(FRA_SRC) || (defined(HAVE_DECL_FRA_SRC) && HAVE_DECL_FRA_SRC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_SRC) == (2), "FRA_SRC != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_SRC 2 +#endif +#if defined(FRA_IIFNAME) || (defined(HAVE_DECL_FRA_IIFNAME) && HAVE_DECL_FRA_IIFNAME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_IIFNAME) == (3), "FRA_IIFNAME != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_IIFNAME 3 +#endif +#if defined(FRA_GOTO) || (defined(HAVE_DECL_FRA_GOTO) && HAVE_DECL_FRA_GOTO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_GOTO) == (4), "FRA_GOTO != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_GOTO 4 +#endif +#if defined(FRA_UNUSED2) || (defined(HAVE_DECL_FRA_UNUSED2) && HAVE_DECL_FRA_UNUSED2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_UNUSED2) == (5), "FRA_UNUSED2 != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_UNUSED2 5 +#endif +#if defined(FRA_PRIORITY) || (defined(HAVE_DECL_FRA_PRIORITY) && HAVE_DECL_FRA_PRIORITY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_PRIORITY) == (6), "FRA_PRIORITY != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_PRIORITY 6 +#endif +#if defined(FRA_UNUSED3) || (defined(HAVE_DECL_FRA_UNUSED3) && HAVE_DECL_FRA_UNUSED3) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_UNUSED3) == (7), "FRA_UNUSED3 != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_UNUSED3 7 +#endif +#if defined(FRA_UNUSED4) || (defined(HAVE_DECL_FRA_UNUSED4) && HAVE_DECL_FRA_UNUSED4) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_UNUSED4) == (8), "FRA_UNUSED4 != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_UNUSED4 8 +#endif +#if defined(FRA_UNUSED5) || (defined(HAVE_DECL_FRA_UNUSED5) && HAVE_DECL_FRA_UNUSED5) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_UNUSED5) == (9), "FRA_UNUSED5 != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_UNUSED5 9 +#endif +#if defined(FRA_FWMARK) || (defined(HAVE_DECL_FRA_FWMARK) && HAVE_DECL_FRA_FWMARK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_FWMARK) == (10), "FRA_FWMARK != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_FWMARK 10 +#endif +#if defined(FRA_FLOW) || (defined(HAVE_DECL_FRA_FLOW) && HAVE_DECL_FRA_FLOW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_FLOW) == (11), "FRA_FLOW != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_FLOW 11 +#endif +#if defined(FRA_TUN_ID) || (defined(HAVE_DECL_FRA_TUN_ID) && HAVE_DECL_FRA_TUN_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_TUN_ID) == (12), "FRA_TUN_ID != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_TUN_ID 12 +#endif +#if defined(FRA_SUPPRESS_IFGROUP) || (defined(HAVE_DECL_FRA_SUPPRESS_IFGROUP) && HAVE_DECL_FRA_SUPPRESS_IFGROUP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_SUPPRESS_IFGROUP) == (13), "FRA_SUPPRESS_IFGROUP != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_SUPPRESS_IFGROUP 13 +#endif +#if defined(FRA_SUPPRESS_PREFIXLEN) || (defined(HAVE_DECL_FRA_SUPPRESS_PREFIXLEN) && HAVE_DECL_FRA_SUPPRESS_PREFIXLEN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_SUPPRESS_PREFIXLEN) == (14), "FRA_SUPPRESS_PREFIXLEN != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_SUPPRESS_PREFIXLEN 14 +#endif +#if defined(FRA_TABLE) || (defined(HAVE_DECL_FRA_TABLE) && HAVE_DECL_FRA_TABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_TABLE) == (15), "FRA_TABLE != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_TABLE 15 +#endif +#if defined(FRA_FWMASK) || (defined(HAVE_DECL_FRA_FWMASK) && HAVE_DECL_FRA_FWMASK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_FWMASK) == (16), "FRA_FWMASK != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_FWMASK 16 +#endif +#if defined(FRA_OIFNAME) || (defined(HAVE_DECL_FRA_OIFNAME) && HAVE_DECL_FRA_OIFNAME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_OIFNAME) == (17), "FRA_OIFNAME != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_OIFNAME 17 +#endif +#if defined(FRA_PAD) || (defined(HAVE_DECL_FRA_PAD) && HAVE_DECL_FRA_PAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_PAD) == (18), "FRA_PAD != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_PAD 18 +#endif +#if defined(FRA_L3MDEV) || (defined(HAVE_DECL_FRA_L3MDEV) && HAVE_DECL_FRA_L3MDEV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_L3MDEV) == (19), "FRA_L3MDEV != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_L3MDEV 19 +#endif +#if defined(FRA_UID_RANGE) || (defined(HAVE_DECL_FRA_UID_RANGE) && HAVE_DECL_FRA_UID_RANGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_UID_RANGE) == (20), "FRA_UID_RANGE != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_UID_RANGE 20 +#endif +#if defined(FRA_PROTOCOL) || (defined(HAVE_DECL_FRA_PROTOCOL) && HAVE_DECL_FRA_PROTOCOL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_PROTOCOL) == (21), "FRA_PROTOCOL != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_PROTOCOL 21 +#endif +#if defined(FRA_IP_PROTO) || (defined(HAVE_DECL_FRA_IP_PROTO) && HAVE_DECL_FRA_IP_PROTO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_IP_PROTO) == (22), "FRA_IP_PROTO != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_IP_PROTO 22 +#endif +#if defined(FRA_SPORT_RANGE) || (defined(HAVE_DECL_FRA_SPORT_RANGE) && HAVE_DECL_FRA_SPORT_RANGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_SPORT_RANGE) == (23), "FRA_SPORT_RANGE != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_SPORT_RANGE 23 +#endif +#if defined(FRA_DPORT_RANGE) || (defined(HAVE_DECL_FRA_DPORT_RANGE) && HAVE_DECL_FRA_DPORT_RANGE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FRA_DPORT_RANGE) == (24), "FRA_DPORT_RANGE != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FRA_DPORT_RANGE 24 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_rule_attrs in mpers mode + +# else + +static +const struct xlat rtnl_rule_attrs[] = { + XLAT(FRA_UNSPEC), + XLAT(FRA_DST), + XLAT(FRA_SRC), + XLAT(FRA_IIFNAME), + XLAT(FRA_GOTO), + XLAT(FRA_UNUSED2), + XLAT(FRA_PRIORITY), + XLAT(FRA_UNUSED3), + XLAT(FRA_UNUSED4), + XLAT(FRA_UNUSED5), + XLAT(FRA_FWMARK), + XLAT(FRA_FLOW), + XLAT(FRA_TUN_ID), + XLAT(FRA_SUPPRESS_IFGROUP), + XLAT(FRA_SUPPRESS_PREFIXLEN), + XLAT(FRA_TABLE), + XLAT(FRA_FWMASK), + XLAT(FRA_OIFNAME), + XLAT(FRA_PAD), + XLAT(FRA_L3MDEV), + XLAT(FRA_UID_RANGE), + XLAT(FRA_PROTOCOL), + XLAT(FRA_IP_PROTO), + XLAT(FRA_SPORT_RANGE), + XLAT(FRA_DPORT_RANGE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_rule_attrs.in b/xlat/rtnl_rule_attrs.in new file mode 100644 index 00000000..96ab4427 --- /dev/null +++ b/xlat/rtnl_rule_attrs.in @@ -0,0 +1,25 @@ +FRA_UNSPEC 0 +FRA_DST 1 +FRA_SRC 2 +FRA_IIFNAME 3 +FRA_GOTO 4 +FRA_UNUSED2 5 +FRA_PRIORITY 6 +FRA_UNUSED3 7 +FRA_UNUSED4 8 +FRA_UNUSED5 9 +FRA_FWMARK 10 +FRA_FLOW 11 +FRA_TUN_ID 12 +FRA_SUPPRESS_IFGROUP 13 +FRA_SUPPRESS_PREFIXLEN 14 +FRA_TABLE 15 +FRA_FWMASK 16 +FRA_OIFNAME 17 +FRA_PAD 18 +FRA_L3MDEV 19 +FRA_UID_RANGE 20 +FRA_PROTOCOL 21 +FRA_IP_PROTO 22 +FRA_SPORT_RANGE 23 +FRA_DPORT_RANGE 24 diff --git a/xlat/rtnl_tc_action_attrs.h b/xlat/rtnl_tc_action_attrs.h new file mode 100644 index 00000000..03990c5f --- /dev/null +++ b/xlat/rtnl_tc_action_attrs.h @@ -0,0 +1,78 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_tc_action_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(TCA_ACT_UNSPEC) || (defined(HAVE_DECL_TCA_ACT_UNSPEC) && HAVE_DECL_TCA_ACT_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_ACT_UNSPEC) == (0), "TCA_ACT_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_ACT_UNSPEC 0 +#endif +#if defined(TCA_ACT_KIND) || (defined(HAVE_DECL_TCA_ACT_KIND) && HAVE_DECL_TCA_ACT_KIND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_ACT_KIND) == (1), "TCA_ACT_KIND != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_ACT_KIND 1 +#endif +#if defined(TCA_ACT_OPTIONS) || (defined(HAVE_DECL_TCA_ACT_OPTIONS) && HAVE_DECL_TCA_ACT_OPTIONS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_ACT_OPTIONS) == (2), "TCA_ACT_OPTIONS != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_ACT_OPTIONS 2 +#endif +#if defined(TCA_ACT_INDEX) || (defined(HAVE_DECL_TCA_ACT_INDEX) && HAVE_DECL_TCA_ACT_INDEX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_ACT_INDEX) == (3), "TCA_ACT_INDEX != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_ACT_INDEX 3 +#endif +#if defined(TCA_ACT_STATS) || (defined(HAVE_DECL_TCA_ACT_STATS) && HAVE_DECL_TCA_ACT_STATS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_ACT_STATS) == (4), "TCA_ACT_STATS != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_ACT_STATS 4 +#endif +#if defined(TCA_ACT_PAD) || (defined(HAVE_DECL_TCA_ACT_PAD) && HAVE_DECL_TCA_ACT_PAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_ACT_PAD) == (5), "TCA_ACT_PAD != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_ACT_PAD 5 +#endif +#if defined(TCA_ACT_COOKIE) || (defined(HAVE_DECL_TCA_ACT_COOKIE) && HAVE_DECL_TCA_ACT_COOKIE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_ACT_COOKIE) == (6), "TCA_ACT_COOKIE != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_ACT_COOKIE 6 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_tc_action_attrs in mpers mode + +# else + +static +const struct xlat rtnl_tc_action_attrs[] = { + XLAT(TCA_ACT_UNSPEC), + XLAT(TCA_ACT_KIND), + XLAT(TCA_ACT_OPTIONS), + XLAT(TCA_ACT_INDEX), + XLAT(TCA_ACT_STATS), + XLAT(TCA_ACT_PAD), + XLAT(TCA_ACT_COOKIE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_tc_action_attrs.in b/xlat/rtnl_tc_action_attrs.in new file mode 100644 index 00000000..ebb3dd47 --- /dev/null +++ b/xlat/rtnl_tc_action_attrs.in @@ -0,0 +1,7 @@ +TCA_ACT_UNSPEC 0 +TCA_ACT_KIND 1 +TCA_ACT_OPTIONS 2 +TCA_ACT_INDEX 3 +TCA_ACT_STATS 4 +TCA_ACT_PAD 5 +TCA_ACT_COOKIE 6 diff --git a/xlat/rtnl_tc_attrs.h b/xlat/rtnl_tc_attrs.h new file mode 100644 index 00000000..fc0dedca --- /dev/null +++ b/xlat/rtnl_tc_attrs.h @@ -0,0 +1,142 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_tc_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(TCA_UNSPEC) || (defined(HAVE_DECL_TCA_UNSPEC) && HAVE_DECL_TCA_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_UNSPEC) == (0), "TCA_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_UNSPEC 0 +#endif +#if defined(TCA_KIND) || (defined(HAVE_DECL_TCA_KIND) && HAVE_DECL_TCA_KIND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_KIND) == (1), "TCA_KIND != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_KIND 1 +#endif +#if defined(TCA_OPTIONS) || (defined(HAVE_DECL_TCA_OPTIONS) && HAVE_DECL_TCA_OPTIONS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_OPTIONS) == (2), "TCA_OPTIONS != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_OPTIONS 2 +#endif +#if defined(TCA_STATS) || (defined(HAVE_DECL_TCA_STATS) && HAVE_DECL_TCA_STATS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_STATS) == (3), "TCA_STATS != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_STATS 3 +#endif +#if defined(TCA_XSTATS) || (defined(HAVE_DECL_TCA_XSTATS) && HAVE_DECL_TCA_XSTATS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_XSTATS) == (4), "TCA_XSTATS != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_XSTATS 4 +#endif +#if defined(TCA_RATE) || (defined(HAVE_DECL_TCA_RATE) && HAVE_DECL_TCA_RATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_RATE) == (5), "TCA_RATE != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_RATE 5 +#endif +#if defined(TCA_FCNT) || (defined(HAVE_DECL_TCA_FCNT) && HAVE_DECL_TCA_FCNT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_FCNT) == (6), "TCA_FCNT != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_FCNT 6 +#endif +#if defined(TCA_STATS2) || (defined(HAVE_DECL_TCA_STATS2) && HAVE_DECL_TCA_STATS2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_STATS2) == (7), "TCA_STATS2 != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_STATS2 7 +#endif +#if defined(TCA_STAB) || (defined(HAVE_DECL_TCA_STAB) && HAVE_DECL_TCA_STAB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_STAB) == (8), "TCA_STAB != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_STAB 8 +#endif +#if defined(TCA_PAD) || (defined(HAVE_DECL_TCA_PAD) && HAVE_DECL_TCA_PAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_PAD) == (9), "TCA_PAD != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_PAD 9 +#endif +#if defined(TCA_DUMP_INVISIBLE) || (defined(HAVE_DECL_TCA_DUMP_INVISIBLE) && HAVE_DECL_TCA_DUMP_INVISIBLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_DUMP_INVISIBLE) == (10), "TCA_DUMP_INVISIBLE != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_DUMP_INVISIBLE 10 +#endif +#if defined(TCA_CHAIN) || (defined(HAVE_DECL_TCA_CHAIN) && HAVE_DECL_TCA_CHAIN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_CHAIN) == (11), "TCA_CHAIN != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_CHAIN 11 +#endif +#if defined(TCA_HW_OFFLOAD) || (defined(HAVE_DECL_TCA_HW_OFFLOAD) && HAVE_DECL_TCA_HW_OFFLOAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_HW_OFFLOAD) == (12), "TCA_HW_OFFLOAD != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_HW_OFFLOAD 12 +#endif +#if defined(TCA_INGRESS_BLOCK) || (defined(HAVE_DECL_TCA_INGRESS_BLOCK) && HAVE_DECL_TCA_INGRESS_BLOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_INGRESS_BLOCK) == (13), "TCA_INGRESS_BLOCK != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_INGRESS_BLOCK 13 +#endif +#if defined(TCA_EGRESS_BLOCK) || (defined(HAVE_DECL_TCA_EGRESS_BLOCK) && HAVE_DECL_TCA_EGRESS_BLOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_EGRESS_BLOCK) == (14), "TCA_EGRESS_BLOCK != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_EGRESS_BLOCK 14 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_tc_attrs in mpers mode + +# else + +static +const struct xlat rtnl_tc_attrs[] = { + XLAT(TCA_UNSPEC), + XLAT(TCA_KIND), + XLAT(TCA_OPTIONS), + XLAT(TCA_STATS), + XLAT(TCA_XSTATS), + XLAT(TCA_RATE), + XLAT(TCA_FCNT), + XLAT(TCA_STATS2), + XLAT(TCA_STAB), + XLAT(TCA_PAD), + XLAT(TCA_DUMP_INVISIBLE), + XLAT(TCA_CHAIN), + XLAT(TCA_HW_OFFLOAD), + XLAT(TCA_INGRESS_BLOCK), + XLAT(TCA_EGRESS_BLOCK), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_tc_attrs.in b/xlat/rtnl_tc_attrs.in new file mode 100644 index 00000000..b3cdcf4e --- /dev/null +++ b/xlat/rtnl_tc_attrs.in @@ -0,0 +1,15 @@ +TCA_UNSPEC 0 +TCA_KIND 1 +TCA_OPTIONS 2 +TCA_STATS 3 +TCA_XSTATS 4 +TCA_RATE 5 +TCA_FCNT 6 +TCA_STATS2 7 +TCA_STAB 8 +TCA_PAD 9 +TCA_DUMP_INVISIBLE 10 +TCA_CHAIN 11 +TCA_HW_OFFLOAD 12 +TCA_INGRESS_BLOCK 13 +TCA_EGRESS_BLOCK 14 diff --git a/xlat/rtnl_tca_stab_attrs.h b/xlat/rtnl_tca_stab_attrs.h new file mode 100644 index 00000000..ca2f1678 --- /dev/null +++ b/xlat/rtnl_tca_stab_attrs.h @@ -0,0 +1,46 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_tca_stab_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(TCA_STAB_UNSPEC) || (defined(HAVE_DECL_TCA_STAB_UNSPEC) && HAVE_DECL_TCA_STAB_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_STAB_UNSPEC) == (0), "TCA_STAB_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_STAB_UNSPEC 0 +#endif +#if defined(TCA_STAB_BASE) || (defined(HAVE_DECL_TCA_STAB_BASE) && HAVE_DECL_TCA_STAB_BASE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_STAB_BASE) == (1), "TCA_STAB_BASE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_STAB_BASE 1 +#endif +#if defined(TCA_STAB_DATA) || (defined(HAVE_DECL_TCA_STAB_DATA) && HAVE_DECL_TCA_STAB_DATA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_STAB_DATA) == (2), "TCA_STAB_DATA != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_STAB_DATA 2 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_tca_stab_attrs in mpers mode + +# else + +static +const struct xlat rtnl_tca_stab_attrs[] = { + XLAT(TCA_STAB_UNSPEC), + XLAT(TCA_STAB_BASE), + XLAT(TCA_STAB_DATA), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_tca_stab_attrs.in b/xlat/rtnl_tca_stab_attrs.in new file mode 100644 index 00000000..dd3d6efc --- /dev/null +++ b/xlat/rtnl_tca_stab_attrs.in @@ -0,0 +1,3 @@ +TCA_STAB_UNSPEC 0 +TCA_STAB_BASE 1 +TCA_STAB_DATA 2 diff --git a/xlat/rtnl_tca_stats_attrs.h b/xlat/rtnl_tca_stats_attrs.h new file mode 100644 index 00000000..501aa409 --- /dev/null +++ b/xlat/rtnl_tca_stats_attrs.h @@ -0,0 +1,86 @@ +/* Generated by ./xlat/gen.sh from ./xlat/rtnl_tca_stats_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(TCA_STATS_UNSPEC) || (defined(HAVE_DECL_TCA_STATS_UNSPEC) && HAVE_DECL_TCA_STATS_UNSPEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_STATS_UNSPEC) == (0), "TCA_STATS_UNSPEC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_STATS_UNSPEC 0 +#endif +#if defined(TCA_STATS_BASIC) || (defined(HAVE_DECL_TCA_STATS_BASIC) && HAVE_DECL_TCA_STATS_BASIC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_STATS_BASIC) == (1), "TCA_STATS_BASIC != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_STATS_BASIC 1 +#endif +#if defined(TCA_STATS_RATE_EST) || (defined(HAVE_DECL_TCA_STATS_RATE_EST) && HAVE_DECL_TCA_STATS_RATE_EST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_STATS_RATE_EST) == (2), "TCA_STATS_RATE_EST != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_STATS_RATE_EST 2 +#endif +#if defined(TCA_STATS_QUEUE) || (defined(HAVE_DECL_TCA_STATS_QUEUE) && HAVE_DECL_TCA_STATS_QUEUE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_STATS_QUEUE) == (3), "TCA_STATS_QUEUE != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_STATS_QUEUE 3 +#endif +#if defined(TCA_STATS_APP) || (defined(HAVE_DECL_TCA_STATS_APP) && HAVE_DECL_TCA_STATS_APP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_STATS_APP) == (4), "TCA_STATS_APP != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_STATS_APP 4 +#endif +#if defined(TCA_STATS_RATE_EST64) || (defined(HAVE_DECL_TCA_STATS_RATE_EST64) && HAVE_DECL_TCA_STATS_RATE_EST64) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_STATS_RATE_EST64) == (5), "TCA_STATS_RATE_EST64 != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_STATS_RATE_EST64 5 +#endif +#if defined(TCA_STATS_PAD) || (defined(HAVE_DECL_TCA_STATS_PAD) && HAVE_DECL_TCA_STATS_PAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_STATS_PAD) == (6), "TCA_STATS_PAD != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_STATS_PAD 6 +#endif +#if defined(TCA_STATS_BASIC_HW) || (defined(HAVE_DECL_TCA_STATS_BASIC_HW) && HAVE_DECL_TCA_STATS_BASIC_HW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCA_STATS_BASIC_HW) == (7), "TCA_STATS_BASIC_HW != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCA_STATS_BASIC_HW 7 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat rtnl_tca_stats_attrs in mpers mode + +# else + +static +const struct xlat rtnl_tca_stats_attrs[] = { + XLAT(TCA_STATS_UNSPEC), + XLAT(TCA_STATS_BASIC), + XLAT(TCA_STATS_RATE_EST), + XLAT(TCA_STATS_QUEUE), + XLAT(TCA_STATS_APP), + XLAT(TCA_STATS_RATE_EST64), + XLAT(TCA_STATS_PAD), + XLAT(TCA_STATS_BASIC_HW), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rtnl_tca_stats_attrs.in b/xlat/rtnl_tca_stats_attrs.in new file mode 100644 index 00000000..82b8a337 --- /dev/null +++ b/xlat/rtnl_tca_stats_attrs.in @@ -0,0 +1,8 @@ +TCA_STATS_UNSPEC 0 +TCA_STATS_BASIC 1 +TCA_STATS_RATE_EST 2 +TCA_STATS_QUEUE 3 +TCA_STATS_APP 4 +TCA_STATS_RATE_EST64 5 +TCA_STATS_PAD 6 +TCA_STATS_BASIC_HW 7 diff --git a/xlat/rwf_flags.h b/xlat/rwf_flags.h index cd5cfdc1..9b410e8f 100644 --- a/xlat/rwf_flags.h +++ b/xlat/rwf_flags.h @@ -1,26 +1,62 @@ /* Generated by ./xlat/gen.sh from ./xlat/rwf_flags.in; do not edit. */ -#if !(defined(RWF_HIPRI) || (defined(HAVE_DECL_RWF_HIPRI) && HAVE_DECL_RWF_HIPRI)) -# define RWF_HIPRI 1 + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(RWF_HIPRI) || (defined(HAVE_DECL_RWF_HIPRI) && HAVE_DECL_RWF_HIPRI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RWF_HIPRI) == (0x01), "RWF_HIPRI != 0x01"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RWF_HIPRI 0x01 +#endif +#if defined(RWF_DSYNC) || (defined(HAVE_DECL_RWF_DSYNC) && HAVE_DECL_RWF_DSYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RWF_DSYNC) == (0x02), "RWF_DSYNC != 0x02"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RWF_DSYNC 0x02 +#endif +#if defined(RWF_SYNC) || (defined(HAVE_DECL_RWF_SYNC) && HAVE_DECL_RWF_SYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RWF_SYNC) == (0x04), "RWF_SYNC != 0x04"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RWF_SYNC 0x04 #endif -#if !(defined(RWF_DSYNC) || (defined(HAVE_DECL_RWF_DSYNC) && HAVE_DECL_RWF_DSYNC)) -# define RWF_DSYNC 2 +#if defined(RWF_NOWAIT) || (defined(HAVE_DECL_RWF_NOWAIT) && HAVE_DECL_RWF_NOWAIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RWF_NOWAIT) == (0x08), "RWF_NOWAIT != 0x08"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RWF_NOWAIT 0x08 #endif -#if !(defined(RWF_SYNC) || (defined(HAVE_DECL_RWF_SYNC) && HAVE_DECL_RWF_SYNC)) -# define RWF_SYNC 4 +#if defined(RWF_APPEND) || (defined(HAVE_DECL_RWF_APPEND) && HAVE_DECL_RWF_APPEND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RWF_APPEND) == (0x10), "RWF_APPEND != 0x10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RWF_APPEND 0x10 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat rwf_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat rwf_flags in mpers mode + +# else static const struct xlat rwf_flags[] = { XLAT(RWF_HIPRI), XLAT(RWF_DSYNC), XLAT(RWF_SYNC), + XLAT(RWF_NOWAIT), + XLAT(RWF_APPEND), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/rwf_flags.in b/xlat/rwf_flags.in index 2e754459..3f63f5a2 100644 --- a/xlat/rwf_flags.in +++ b/xlat/rwf_flags.in @@ -1,3 +1,5 @@ -RWF_HIPRI 1 -RWF_DSYNC 2 -RWF_SYNC 4 +RWF_HIPRI 0x01 +RWF_DSYNC 0x02 +RWF_SYNC 0x04 +RWF_NOWAIT 0x08 +RWF_APPEND 0x10 diff --git a/xlat/s390_guarded_storage_commands.h b/xlat/s390_guarded_storage_commands.h new file mode 100644 index 00000000..9899819d --- /dev/null +++ b/xlat/s390_guarded_storage_commands.h @@ -0,0 +1,62 @@ +/* Generated by ./xlat/gen.sh from ./xlat/s390_guarded_storage_commands.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(GS_ENABLE) || (defined(HAVE_DECL_GS_ENABLE) && HAVE_DECL_GS_ENABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((GS_ENABLE) == (0), "GS_ENABLE != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define GS_ENABLE 0 +#endif +#if defined(GS_DISABLE) || (defined(HAVE_DECL_GS_DISABLE) && HAVE_DECL_GS_DISABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((GS_DISABLE) == (1), "GS_DISABLE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define GS_DISABLE 1 +#endif +#if defined(GS_SET_BC_CB) || (defined(HAVE_DECL_GS_SET_BC_CB) && HAVE_DECL_GS_SET_BC_CB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((GS_SET_BC_CB) == (2), "GS_SET_BC_CB != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define GS_SET_BC_CB 2 +#endif +#if defined(GS_CLEAR_BC_CB) || (defined(HAVE_DECL_GS_CLEAR_BC_CB) && HAVE_DECL_GS_CLEAR_BC_CB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((GS_CLEAR_BC_CB) == (3), "GS_CLEAR_BC_CB != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define GS_CLEAR_BC_CB 3 +#endif +#if defined(GS_BROADCAST) || (defined(HAVE_DECL_GS_BROADCAST) && HAVE_DECL_GS_BROADCAST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((GS_BROADCAST) == (4), "GS_BROADCAST != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define GS_BROADCAST 4 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat s390_guarded_storage_commands in mpers mode + +# else + +static +const struct xlat s390_guarded_storage_commands[] = { + XLAT(GS_ENABLE), + XLAT(GS_DISABLE), + XLAT(GS_SET_BC_CB), + XLAT(GS_CLEAR_BC_CB), + XLAT(GS_BROADCAST), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/s390_guarded_storage_commands.in b/xlat/s390_guarded_storage_commands.in new file mode 100644 index 00000000..410e33e7 --- /dev/null +++ b/xlat/s390_guarded_storage_commands.in @@ -0,0 +1,5 @@ +GS_ENABLE 0 +GS_DISABLE 1 +GS_SET_BC_CB 2 +GS_CLEAR_BC_CB 3 +GS_BROADCAST 4 diff --git a/xlat/s390_runtime_instr_commands.h b/xlat/s390_runtime_instr_commands.h new file mode 100644 index 00000000..a33a97f0 --- /dev/null +++ b/xlat/s390_runtime_instr_commands.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/s390_runtime_instr_commands.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(S390_RUNTIME_INSTR_START) || (defined(HAVE_DECL_S390_RUNTIME_INSTR_START) && HAVE_DECL_S390_RUNTIME_INSTR_START) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((S390_RUNTIME_INSTR_START) == (0x1), "S390_RUNTIME_INSTR_START != 0x1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define S390_RUNTIME_INSTR_START 0x1 +#endif +#if defined(S390_RUNTIME_INSTR_STOP) || (defined(HAVE_DECL_S390_RUNTIME_INSTR_STOP) && HAVE_DECL_S390_RUNTIME_INSTR_STOP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((S390_RUNTIME_INSTR_STOP) == (0x2), "S390_RUNTIME_INSTR_STOP != 0x2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define S390_RUNTIME_INSTR_STOP 0x2 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat s390_runtime_instr_commands in mpers mode + +# else + +static +const struct xlat s390_runtime_instr_commands[] = { + XLAT(S390_RUNTIME_INSTR_START), + XLAT(S390_RUNTIME_INSTR_STOP), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/s390_runtime_instr_commands.in b/xlat/s390_runtime_instr_commands.in new file mode 100644 index 00000000..395afc41 --- /dev/null +++ b/xlat/s390_runtime_instr_commands.in @@ -0,0 +1,2 @@ +S390_RUNTIME_INSTR_START 0x1 +S390_RUNTIME_INSTR_STOP 0x2 diff --git a/xlat/s390_sthyi_function_codes.h b/xlat/s390_sthyi_function_codes.h new file mode 100644 index 00000000..df04b309 --- /dev/null +++ b/xlat/s390_sthyi_function_codes.h @@ -0,0 +1,30 @@ +/* Generated by ./xlat/gen.sh from ./xlat/s390_sthyi_function_codes.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(STHYI_FC_CP_IFL_CAP) || (defined(HAVE_DECL_STHYI_FC_CP_IFL_CAP) && HAVE_DECL_STHYI_FC_CP_IFL_CAP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STHYI_FC_CP_IFL_CAP) == (0), "STHYI_FC_CP_IFL_CAP != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STHYI_FC_CP_IFL_CAP 0 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat s390_sthyi_function_codes in mpers mode + +# else + +static +const struct xlat s390_sthyi_function_codes[] = { + XLAT(STHYI_FC_CP_IFL_CAP), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/s390_sthyi_function_codes.in b/xlat/s390_sthyi_function_codes.in new file mode 100644 index 00000000..380cd7fc --- /dev/null +++ b/xlat/s390_sthyi_function_codes.in @@ -0,0 +1 @@ +STHYI_FC_CP_IFL_CAP 0 diff --git a/xlat/sa_handler_values.h b/xlat/sa_handler_values.h index 3d7da047..796e4b75 100644 --- a/xlat/sa_handler_values.h +++ b/xlat/sa_handler_values.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/sa_handler_values.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat sa_handler_values in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sa_handler_values in mpers mode + +# else static const struct xlat sa_handler_values[] = { @@ -20,4 +26,6 @@ const struct xlat sa_handler_values[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sched_flags.h b/xlat/sched_flags.h index 78638612..759994f1 100644 --- a/xlat/sched_flags.h +++ b/xlat/sched_flags.h @@ -1,18 +1,46 @@ /* Generated by ./xlat/gen.sh from ./xlat/sched_flags.in; do not edit. */ -#if !(defined(SCHED_FLAG_RESET_ON_FORK) || (defined(HAVE_DECL_SCHED_FLAG_RESET_ON_FORK) && HAVE_DECL_SCHED_FLAG_RESET_ON_FORK)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SCHED_FLAG_RESET_ON_FORK) || (defined(HAVE_DECL_SCHED_FLAG_RESET_ON_FORK) && HAVE_DECL_SCHED_FLAG_RESET_ON_FORK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCHED_FLAG_RESET_ON_FORK) == (1), "SCHED_FLAG_RESET_ON_FORK != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SCHED_FLAG_RESET_ON_FORK 1 #endif +#if defined(SCHED_FLAG_RECLAIM) || (defined(HAVE_DECL_SCHED_FLAG_RECLAIM) && HAVE_DECL_SCHED_FLAG_RECLAIM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCHED_FLAG_RECLAIM) == (2), "SCHED_FLAG_RECLAIM != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCHED_FLAG_RECLAIM 2 +#endif +#if defined(SCHED_FLAG_DL_OVERRUN) || (defined(HAVE_DECL_SCHED_FLAG_DL_OVERRUN) && HAVE_DECL_SCHED_FLAG_DL_OVERRUN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCHED_FLAG_DL_OVERRUN) == (4), "SCHED_FLAG_DL_OVERRUN != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCHED_FLAG_DL_OVERRUN 4 +#endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat sched_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat sched_flags in mpers mode + +# else static const struct xlat sched_flags[] = { XLAT(SCHED_FLAG_RESET_ON_FORK), + XLAT(SCHED_FLAG_RECLAIM), + XLAT(SCHED_FLAG_DL_OVERRUN), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sched_flags.in b/xlat/sched_flags.in index 824d91dc..10c90661 100644 --- a/xlat/sched_flags.in +++ b/xlat/sched_flags.in @@ -1 +1,3 @@ -SCHED_FLAG_RESET_ON_FORK 1 +SCHED_FLAG_RESET_ON_FORK 1 +SCHED_FLAG_RECLAIM 2 +SCHED_FLAG_DL_OVERRUN 4 diff --git a/xlat/schedulers.h b/xlat/schedulers.h index 099db27d..2ce324f9 100644 --- a/xlat/schedulers.h +++ b/xlat/schedulers.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/schedulers.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat schedulers in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat schedulers in mpers mode + +# else static const struct xlat schedulers[] = { @@ -32,4 +38,6 @@ const struct xlat schedulers[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/scmvals.h b/xlat/scmvals.h index a7ca2f0a..a02ba9a1 100644 --- a/xlat/scmvals.h +++ b/xlat/scmvals.h @@ -1,26 +1,137 @@ /* Generated by ./xlat/gen.sh from ./xlat/scmvals.in; do not edit. */ -#if !(defined(SCM_RIGHTS) || (defined(HAVE_DECL_SCM_RIGHTS) && HAVE_DECL_SCM_RIGHTS)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SCM_RIGHTS) || (defined(HAVE_DECL_SCM_RIGHTS) && HAVE_DECL_SCM_RIGHTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCM_RIGHTS) == (1), "SCM_RIGHTS != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SCM_RIGHTS 1 #endif -#if !(defined(SCM_CREDENTIALS) || (defined(HAVE_DECL_SCM_CREDENTIALS) && HAVE_DECL_SCM_CREDENTIALS)) +#if defined(SCM_CREDENTIALS) || (defined(HAVE_DECL_SCM_CREDENTIALS) && HAVE_DECL_SCM_CREDENTIALS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCM_CREDENTIALS) == (2), "SCM_CREDENTIALS != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SCM_CREDENTIALS 2 #endif -#if !(defined(SCM_SECURITY) || (defined(HAVE_DECL_SCM_SECURITY) && HAVE_DECL_SCM_SECURITY)) +#if defined(SCM_SECURITY) || (defined(HAVE_DECL_SCM_SECURITY) && HAVE_DECL_SCM_SECURITY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCM_SECURITY) == (3), "SCM_SECURITY != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SCM_SECURITY 3 #endif +#if defined __sparc__ +#if defined(SCM_TIMESTAMPING_OPT_STATS) || (defined(HAVE_DECL_SCM_TIMESTAMPING_OPT_STATS) && HAVE_DECL_SCM_TIMESTAMPING_OPT_STATS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCM_TIMESTAMPING_OPT_STATS) == (0x38), "SCM_TIMESTAMPING_OPT_STATS != 0x38"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCM_TIMESTAMPING_OPT_STATS 0x38 +#endif +#elif defined __hppa__ +#if defined(SCM_TIMESTAMPING_OPT_STATS) || (defined(HAVE_DECL_SCM_TIMESTAMPING_OPT_STATS) && HAVE_DECL_SCM_TIMESTAMPING_OPT_STATS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCM_TIMESTAMPING_OPT_STATS) == (0x402f), "SCM_TIMESTAMPING_OPT_STATS != 0x402f"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCM_TIMESTAMPING_OPT_STATS 0x402f +#endif +#else +#if defined(SCM_TIMESTAMPING_OPT_STATS) || (defined(HAVE_DECL_SCM_TIMESTAMPING_OPT_STATS) && HAVE_DECL_SCM_TIMESTAMPING_OPT_STATS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCM_TIMESTAMPING_OPT_STATS) == (0x36), "SCM_TIMESTAMPING_OPT_STATS != 0x36"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCM_TIMESTAMPING_OPT_STATS 0x36 +#endif +#endif +#if defined __sparc__ +#if defined(SCM_TIMESTAMPING_PKTINFO) || (defined(HAVE_DECL_SCM_TIMESTAMPING_PKTINFO) && HAVE_DECL_SCM_TIMESTAMPING_PKTINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCM_TIMESTAMPING_PKTINFO) == (0x3c), "SCM_TIMESTAMPING_PKTINFO != 0x3c"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCM_TIMESTAMPING_PKTINFO 0x3c +#endif +#elif defined __hppa__ +#if defined(SCM_TIMESTAMPING_PKTINFO) || (defined(HAVE_DECL_SCM_TIMESTAMPING_PKTINFO) && HAVE_DECL_SCM_TIMESTAMPING_PKTINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCM_TIMESTAMPING_PKTINFO) == (0x4033), "SCM_TIMESTAMPING_PKTINFO != 0x4033"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCM_TIMESTAMPING_PKTINFO 0x4033 +#endif +#else +#if defined(SCM_TIMESTAMPING_PKTINFO) || (defined(HAVE_DECL_SCM_TIMESTAMPING_PKTINFO) && HAVE_DECL_SCM_TIMESTAMPING_PKTINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCM_TIMESTAMPING_PKTINFO) == (0x3a), "SCM_TIMESTAMPING_PKTINFO != 0x3a"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCM_TIMESTAMPING_PKTINFO 0x3a +#endif +#endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat scmvals in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat scmvals in mpers mode + +# else static const struct xlat scmvals[] = { XLAT(SCM_RIGHTS), XLAT(SCM_CREDENTIALS), XLAT(SCM_SECURITY), + +#if defined(SO_WIFI_STATUS) || (defined(HAVE_DECL_SO_WIFI_STATUS) && HAVE_DECL_SO_WIFI_STATUS) + XLAT(SO_WIFI_STATUS), +#endif +#if defined(SO_TXTIME) || (defined(HAVE_DECL_SO_TXTIME) && HAVE_DECL_SO_TXTIME) + XLAT(SO_TXTIME), +#endif +#if defined(SO_TIMESTAMP_OLD) || (defined(HAVE_DECL_SO_TIMESTAMP_OLD) && HAVE_DECL_SO_TIMESTAMP_OLD) + XLAT(SO_TIMESTAMP_OLD), +#endif +#if defined(SO_TIMESTAMPNS_OLD) || (defined(HAVE_DECL_SO_TIMESTAMPNS_OLD) && HAVE_DECL_SO_TIMESTAMPNS_OLD) + XLAT(SO_TIMESTAMPNS_OLD), +#endif +#if defined(SO_TIMESTAMPING_OLD) || (defined(HAVE_DECL_SO_TIMESTAMPING_OLD) && HAVE_DECL_SO_TIMESTAMPING_OLD) + XLAT(SO_TIMESTAMPING_OLD), +#endif +#if defined(SO_TIMESTAMP_NEW) || (defined(HAVE_DECL_SO_TIMESTAMP_NEW) && HAVE_DECL_SO_TIMESTAMP_NEW) + XLAT(SO_TIMESTAMP_NEW), +#endif +#if defined(SO_TIMESTAMPNS_NEW) || (defined(HAVE_DECL_SO_TIMESTAMPNS_NEW) && HAVE_DECL_SO_TIMESTAMPNS_NEW) + XLAT(SO_TIMESTAMPNS_NEW), +#endif +#if defined(SO_TIMESTAMPING_NEW) || (defined(HAVE_DECL_SO_TIMESTAMPING_NEW) && HAVE_DECL_SO_TIMESTAMPING_NEW) + XLAT(SO_TIMESTAMPING_NEW), +#endif + + +#if defined __sparc__ + XLAT(SCM_TIMESTAMPING_OPT_STATS), +#elif defined __hppa__ + XLAT(SCM_TIMESTAMPING_OPT_STATS), +#else + XLAT(SCM_TIMESTAMPING_OPT_STATS), +#endif +#if defined __sparc__ + XLAT(SCM_TIMESTAMPING_PKTINFO), +#elif defined __hppa__ + XLAT(SCM_TIMESTAMPING_PKTINFO), +#else + XLAT(SCM_TIMESTAMPING_PKTINFO), +#endif XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/scmvals.in b/xlat/scmvals.in index 3d61f9ef..c3b5539b 100644 --- a/xlat/scmvals.in +++ b/xlat/scmvals.in @@ -1,3 +1,28 @@ SCM_RIGHTS 1 SCM_CREDENTIALS 2 SCM_SECURITY 3 + +SO_WIFI_STATUS +SO_TXTIME +SO_TIMESTAMP_OLD +SO_TIMESTAMPNS_OLD +SO_TIMESTAMPING_OLD +SO_TIMESTAMP_NEW +SO_TIMESTAMPNS_NEW +SO_TIMESTAMPING_NEW + +/* Generated by maint/gen_xlat_defs.sh -f '#x' -p 'SCM_TIMESTAMPING_' -c 'asm-generic/socket.h' -a 'asm/socket.h' */ +#if defined __sparc__ +SCM_TIMESTAMPING_OPT_STATS 0x38 +#elif defined __hppa__ +SCM_TIMESTAMPING_OPT_STATS 0x402f +#else +SCM_TIMESTAMPING_OPT_STATS 0x36 +#endif +#if defined __sparc__ +SCM_TIMESTAMPING_PKTINFO 0x3c +#elif defined __hppa__ +SCM_TIMESTAMPING_PKTINFO 0x4033 +#else +SCM_TIMESTAMPING_PKTINFO 0x3a +#endif diff --git a/xlat/scsi_sg_commands.h b/xlat/scsi_sg_commands.h index 6ccafbc7..b274b225 100644 --- a/xlat/scsi_sg_commands.h +++ b/xlat/scsi_sg_commands.h @@ -1,76 +1,180 @@ /* Generated by ./xlat/gen.sh from ./xlat/scsi_sg_commands.in; do not edit. */ -#if !(defined(SG_SET_TIMEOUT) || (defined(HAVE_DECL_SG_SET_TIMEOUT) && HAVE_DECL_SG_SET_TIMEOUT)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SG_SET_TIMEOUT) || (defined(HAVE_DECL_SG_SET_TIMEOUT) && HAVE_DECL_SG_SET_TIMEOUT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_SET_TIMEOUT) == (0x2201), "SG_SET_TIMEOUT != 0x2201"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_SET_TIMEOUT 0x2201 #endif -#if !(defined(SG_GET_TIMEOUT) || (defined(HAVE_DECL_SG_GET_TIMEOUT) && HAVE_DECL_SG_GET_TIMEOUT)) +#if defined(SG_GET_TIMEOUT) || (defined(HAVE_DECL_SG_GET_TIMEOUT) && HAVE_DECL_SG_GET_TIMEOUT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_GET_TIMEOUT) == (0x2202), "SG_GET_TIMEOUT != 0x2202"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_GET_TIMEOUT 0x2202 #endif -#if !(defined(SG_EMULATED_HOST) || (defined(HAVE_DECL_SG_EMULATED_HOST) && HAVE_DECL_SG_EMULATED_HOST)) +#if defined(SG_EMULATED_HOST) || (defined(HAVE_DECL_SG_EMULATED_HOST) && HAVE_DECL_SG_EMULATED_HOST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_EMULATED_HOST) == (0x2203), "SG_EMULATED_HOST != 0x2203"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_EMULATED_HOST 0x2203 #endif -#if !(defined(SG_SET_TRANSFORM) || (defined(HAVE_DECL_SG_SET_TRANSFORM) && HAVE_DECL_SG_SET_TRANSFORM)) +#if defined(SG_SET_TRANSFORM) || (defined(HAVE_DECL_SG_SET_TRANSFORM) && HAVE_DECL_SG_SET_TRANSFORM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_SET_TRANSFORM) == (0x2204), "SG_SET_TRANSFORM != 0x2204"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_SET_TRANSFORM 0x2204 #endif -#if !(defined(SG_GET_TRANSFORM) || (defined(HAVE_DECL_SG_GET_TRANSFORM) && HAVE_DECL_SG_GET_TRANSFORM)) +#if defined(SG_GET_TRANSFORM) || (defined(HAVE_DECL_SG_GET_TRANSFORM) && HAVE_DECL_SG_GET_TRANSFORM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_GET_TRANSFORM) == (0x2205), "SG_GET_TRANSFORM != 0x2205"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_GET_TRANSFORM 0x2205 #endif -#if !(defined(SG_GET_COMMAND_Q) || (defined(HAVE_DECL_SG_GET_COMMAND_Q) && HAVE_DECL_SG_GET_COMMAND_Q)) +#if defined(SG_GET_COMMAND_Q) || (defined(HAVE_DECL_SG_GET_COMMAND_Q) && HAVE_DECL_SG_GET_COMMAND_Q) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_GET_COMMAND_Q) == (0x2270), "SG_GET_COMMAND_Q != 0x2270"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_GET_COMMAND_Q 0x2270 #endif -#if !(defined(SG_SET_COMMAND_Q) || (defined(HAVE_DECL_SG_SET_COMMAND_Q) && HAVE_DECL_SG_SET_COMMAND_Q)) +#if defined(SG_SET_COMMAND_Q) || (defined(HAVE_DECL_SG_SET_COMMAND_Q) && HAVE_DECL_SG_SET_COMMAND_Q) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_SET_COMMAND_Q) == (0x2271), "SG_SET_COMMAND_Q != 0x2271"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_SET_COMMAND_Q 0x2271 #endif -#if !(defined(SG_GET_RESERVED_SIZE) || (defined(HAVE_DECL_SG_GET_RESERVED_SIZE) && HAVE_DECL_SG_GET_RESERVED_SIZE)) +#if defined(SG_GET_RESERVED_SIZE) || (defined(HAVE_DECL_SG_GET_RESERVED_SIZE) && HAVE_DECL_SG_GET_RESERVED_SIZE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_GET_RESERVED_SIZE) == (0x2272), "SG_GET_RESERVED_SIZE != 0x2272"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_GET_RESERVED_SIZE 0x2272 #endif -#if !(defined(SG_SET_RESERVED_SIZE) || (defined(HAVE_DECL_SG_SET_RESERVED_SIZE) && HAVE_DECL_SG_SET_RESERVED_SIZE)) +#if defined(SG_SET_RESERVED_SIZE) || (defined(HAVE_DECL_SG_SET_RESERVED_SIZE) && HAVE_DECL_SG_SET_RESERVED_SIZE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_SET_RESERVED_SIZE) == (0x2275), "SG_SET_RESERVED_SIZE != 0x2275"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_SET_RESERVED_SIZE 0x2275 #endif -#if !(defined(SG_GET_SCSI_ID) || (defined(HAVE_DECL_SG_GET_SCSI_ID) && HAVE_DECL_SG_GET_SCSI_ID)) +#if defined(SG_GET_SCSI_ID) || (defined(HAVE_DECL_SG_GET_SCSI_ID) && HAVE_DECL_SG_GET_SCSI_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_GET_SCSI_ID) == (0x2276), "SG_GET_SCSI_ID != 0x2276"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_GET_SCSI_ID 0x2276 #endif -#if !(defined(SG_SET_FORCE_LOW_DMA) || (defined(HAVE_DECL_SG_SET_FORCE_LOW_DMA) && HAVE_DECL_SG_SET_FORCE_LOW_DMA)) +#if defined(SG_SET_FORCE_LOW_DMA) || (defined(HAVE_DECL_SG_SET_FORCE_LOW_DMA) && HAVE_DECL_SG_SET_FORCE_LOW_DMA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_SET_FORCE_LOW_DMA) == (0x2279), "SG_SET_FORCE_LOW_DMA != 0x2279"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_SET_FORCE_LOW_DMA 0x2279 #endif -#if !(defined(SG_GET_LOW_DMA) || (defined(HAVE_DECL_SG_GET_LOW_DMA) && HAVE_DECL_SG_GET_LOW_DMA)) +#if defined(SG_GET_LOW_DMA) || (defined(HAVE_DECL_SG_GET_LOW_DMA) && HAVE_DECL_SG_GET_LOW_DMA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_GET_LOW_DMA) == (0x227a), "SG_GET_LOW_DMA != 0x227a"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_GET_LOW_DMA 0x227a #endif -#if !(defined(SG_SET_FORCE_PACK_ID) || (defined(HAVE_DECL_SG_SET_FORCE_PACK_ID) && HAVE_DECL_SG_SET_FORCE_PACK_ID)) +#if defined(SG_SET_FORCE_PACK_ID) || (defined(HAVE_DECL_SG_SET_FORCE_PACK_ID) && HAVE_DECL_SG_SET_FORCE_PACK_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_SET_FORCE_PACK_ID) == (0x227b), "SG_SET_FORCE_PACK_ID != 0x227b"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_SET_FORCE_PACK_ID 0x227b #endif -#if !(defined(SG_GET_PACK_ID) || (defined(HAVE_DECL_SG_GET_PACK_ID) && HAVE_DECL_SG_GET_PACK_ID)) +#if defined(SG_GET_PACK_ID) || (defined(HAVE_DECL_SG_GET_PACK_ID) && HAVE_DECL_SG_GET_PACK_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_GET_PACK_ID) == (0x227c), "SG_GET_PACK_ID != 0x227c"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_GET_PACK_ID 0x227c #endif -#if !(defined(SG_GET_NUM_WAITING) || (defined(HAVE_DECL_SG_GET_NUM_WAITING) && HAVE_DECL_SG_GET_NUM_WAITING)) +#if defined(SG_GET_NUM_WAITING) || (defined(HAVE_DECL_SG_GET_NUM_WAITING) && HAVE_DECL_SG_GET_NUM_WAITING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_GET_NUM_WAITING) == (0x227d), "SG_GET_NUM_WAITING != 0x227d"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_GET_NUM_WAITING 0x227d #endif -#if !(defined(SG_SET_DEBUG) || (defined(HAVE_DECL_SG_SET_DEBUG) && HAVE_DECL_SG_SET_DEBUG)) +#if defined(SG_SET_DEBUG) || (defined(HAVE_DECL_SG_SET_DEBUG) && HAVE_DECL_SG_SET_DEBUG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_SET_DEBUG) == (0x227e), "SG_SET_DEBUG != 0x227e"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_SET_DEBUG 0x227e #endif -#if !(defined(SG_GET_SG_TABLESIZE) || (defined(HAVE_DECL_SG_GET_SG_TABLESIZE) && HAVE_DECL_SG_GET_SG_TABLESIZE)) +#if defined(SG_GET_SG_TABLESIZE) || (defined(HAVE_DECL_SG_GET_SG_TABLESIZE) && HAVE_DECL_SG_GET_SG_TABLESIZE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_GET_SG_TABLESIZE) == (0x227F), "SG_GET_SG_TABLESIZE != 0x227F"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_GET_SG_TABLESIZE 0x227F #endif -#if !(defined(SG_GET_VERSION_NUM) || (defined(HAVE_DECL_SG_GET_VERSION_NUM) && HAVE_DECL_SG_GET_VERSION_NUM)) +#if defined(SG_GET_VERSION_NUM) || (defined(HAVE_DECL_SG_GET_VERSION_NUM) && HAVE_DECL_SG_GET_VERSION_NUM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_GET_VERSION_NUM) == (0x2282), "SG_GET_VERSION_NUM != 0x2282"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_GET_VERSION_NUM 0x2282 #endif -#if !(defined(SG_NEXT_CMD_LEN) || (defined(HAVE_DECL_SG_NEXT_CMD_LEN) && HAVE_DECL_SG_NEXT_CMD_LEN)) +#if defined(SG_NEXT_CMD_LEN) || (defined(HAVE_DECL_SG_NEXT_CMD_LEN) && HAVE_DECL_SG_NEXT_CMD_LEN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_NEXT_CMD_LEN) == (0x2283), "SG_NEXT_CMD_LEN != 0x2283"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_NEXT_CMD_LEN 0x2283 #endif -#if !(defined(SG_SCSI_RESET) || (defined(HAVE_DECL_SG_SCSI_RESET) && HAVE_DECL_SG_SCSI_RESET)) +#if defined(SG_SCSI_RESET) || (defined(HAVE_DECL_SG_SCSI_RESET) && HAVE_DECL_SG_SCSI_RESET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_SCSI_RESET) == (0x2284), "SG_SCSI_RESET != 0x2284"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_SCSI_RESET 0x2284 #endif -#if !(defined(SG_IO) || (defined(HAVE_DECL_SG_IO) && HAVE_DECL_SG_IO)) +#if defined(SG_IO) || (defined(HAVE_DECL_SG_IO) && HAVE_DECL_SG_IO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_IO) == (0x2285), "SG_IO != 0x2285"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_IO 0x2285 #endif -#if !(defined(SG_GET_REQUEST_TABLE) || (defined(HAVE_DECL_SG_GET_REQUEST_TABLE) && HAVE_DECL_SG_GET_REQUEST_TABLE)) +#if defined(SG_GET_REQUEST_TABLE) || (defined(HAVE_DECL_SG_GET_REQUEST_TABLE) && HAVE_DECL_SG_GET_REQUEST_TABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_GET_REQUEST_TABLE) == (0x2286), "SG_GET_REQUEST_TABLE != 0x2286"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_GET_REQUEST_TABLE 0x2286 #endif -#if !(defined(SG_SET_KEEP_ORPHAN) || (defined(HAVE_DECL_SG_SET_KEEP_ORPHAN) && HAVE_DECL_SG_SET_KEEP_ORPHAN)) +#if defined(SG_SET_KEEP_ORPHAN) || (defined(HAVE_DECL_SG_SET_KEEP_ORPHAN) && HAVE_DECL_SG_SET_KEEP_ORPHAN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_SET_KEEP_ORPHAN) == (0x2287), "SG_SET_KEEP_ORPHAN != 0x2287"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_SET_KEEP_ORPHAN 0x2287 #endif -#if !(defined(SG_GET_KEEP_ORPHAN) || (defined(HAVE_DECL_SG_GET_KEEP_ORPHAN) && HAVE_DECL_SG_GET_KEEP_ORPHAN)) +#if defined(SG_GET_KEEP_ORPHAN) || (defined(HAVE_DECL_SG_GET_KEEP_ORPHAN) && HAVE_DECL_SG_GET_KEEP_ORPHAN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_GET_KEEP_ORPHAN) == (0x2288), "SG_GET_KEEP_ORPHAN != 0x2288"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_GET_KEEP_ORPHAN 0x2288 #endif -#if !(defined(SG_GET_ACCESS_COUNT) || (defined(HAVE_DECL_SG_GET_ACCESS_COUNT) && HAVE_DECL_SG_GET_ACCESS_COUNT)) +#if defined(SG_GET_ACCESS_COUNT) || (defined(HAVE_DECL_SG_GET_ACCESS_COUNT) && HAVE_DECL_SG_GET_ACCESS_COUNT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_GET_ACCESS_COUNT) == (0x2289), "SG_GET_ACCESS_COUNT != 0x2289"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_GET_ACCESS_COUNT 0x2289 #endif diff --git a/xlat/secbits.h b/xlat/secbits.h index d616e1f5..50589302 100644 --- a/xlat/secbits.h +++ b/xlat/secbits.h @@ -1,34 +1,72 @@ /* Generated by ./xlat/gen.sh from ./xlat/secbits.in; do not edit. */ -#if !(defined(SECBIT_NOROOT) || (defined(HAVE_DECL_SECBIT_NOROOT) && HAVE_DECL_SECBIT_NOROOT)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SECBIT_NOROOT) || (defined(HAVE_DECL_SECBIT_NOROOT) && HAVE_DECL_SECBIT_NOROOT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECBIT_NOROOT) == ((1 << 0)), "SECBIT_NOROOT != (1 << 0)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SECBIT_NOROOT (1 << 0) #endif -#if !(defined(SECBIT_NOROOT_LOCKED) || (defined(HAVE_DECL_SECBIT_NOROOT_LOCKED) && HAVE_DECL_SECBIT_NOROOT_LOCKED)) +#if defined(SECBIT_NOROOT_LOCKED) || (defined(HAVE_DECL_SECBIT_NOROOT_LOCKED) && HAVE_DECL_SECBIT_NOROOT_LOCKED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECBIT_NOROOT_LOCKED) == ((1 << 1)), "SECBIT_NOROOT_LOCKED != (1 << 1)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SECBIT_NOROOT_LOCKED (1 << 1) #endif -#if !(defined(SECBIT_NO_SETUID_FIXUP) || (defined(HAVE_DECL_SECBIT_NO_SETUID_FIXUP) && HAVE_DECL_SECBIT_NO_SETUID_FIXUP)) +#if defined(SECBIT_NO_SETUID_FIXUP) || (defined(HAVE_DECL_SECBIT_NO_SETUID_FIXUP) && HAVE_DECL_SECBIT_NO_SETUID_FIXUP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECBIT_NO_SETUID_FIXUP) == ((1 << 2)), "SECBIT_NO_SETUID_FIXUP != (1 << 2)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SECBIT_NO_SETUID_FIXUP (1 << 2) #endif -#if !(defined(SECBIT_NO_SETUID_FIXUP_LOCKED) || (defined(HAVE_DECL_SECBIT_NO_SETUID_FIXUP_LOCKED) && HAVE_DECL_SECBIT_NO_SETUID_FIXUP_LOCKED)) +#if defined(SECBIT_NO_SETUID_FIXUP_LOCKED) || (defined(HAVE_DECL_SECBIT_NO_SETUID_FIXUP_LOCKED) && HAVE_DECL_SECBIT_NO_SETUID_FIXUP_LOCKED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECBIT_NO_SETUID_FIXUP_LOCKED) == ((1 << 3)), "SECBIT_NO_SETUID_FIXUP_LOCKED != (1 << 3)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SECBIT_NO_SETUID_FIXUP_LOCKED (1 << 3) #endif -#if !(defined(SECBIT_KEEP_CAPS) || (defined(HAVE_DECL_SECBIT_KEEP_CAPS) && HAVE_DECL_SECBIT_KEEP_CAPS)) +#if defined(SECBIT_KEEP_CAPS) || (defined(HAVE_DECL_SECBIT_KEEP_CAPS) && HAVE_DECL_SECBIT_KEEP_CAPS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECBIT_KEEP_CAPS) == ((1 << 4)), "SECBIT_KEEP_CAPS != (1 << 4)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SECBIT_KEEP_CAPS (1 << 4) #endif -#if !(defined(SECBIT_KEEP_CAPS_LOCKED) || (defined(HAVE_DECL_SECBIT_KEEP_CAPS_LOCKED) && HAVE_DECL_SECBIT_KEEP_CAPS_LOCKED)) +#if defined(SECBIT_KEEP_CAPS_LOCKED) || (defined(HAVE_DECL_SECBIT_KEEP_CAPS_LOCKED) && HAVE_DECL_SECBIT_KEEP_CAPS_LOCKED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECBIT_KEEP_CAPS_LOCKED) == ((1 << 5)), "SECBIT_KEEP_CAPS_LOCKED != (1 << 5)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SECBIT_KEEP_CAPS_LOCKED (1 << 5) #endif -#if !(defined(SECBIT_NO_CAP_AMBIENT_RAISE) || (defined(HAVE_DECL_SECBIT_NO_CAP_AMBIENT_RAISE) && HAVE_DECL_SECBIT_NO_CAP_AMBIENT_RAISE)) +#if defined(SECBIT_NO_CAP_AMBIENT_RAISE) || (defined(HAVE_DECL_SECBIT_NO_CAP_AMBIENT_RAISE) && HAVE_DECL_SECBIT_NO_CAP_AMBIENT_RAISE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECBIT_NO_CAP_AMBIENT_RAISE) == ((1 << 6)), "SECBIT_NO_CAP_AMBIENT_RAISE != (1 << 6)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SECBIT_NO_CAP_AMBIENT_RAISE (1 << 6) #endif -#if !(defined(SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED) || (defined(HAVE_DECL_SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED) && HAVE_DECL_SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED)) +#if defined(SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED) || (defined(HAVE_DECL_SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED) && HAVE_DECL_SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED) == ((1 << 7)), "SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED != (1 << 7)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SECBIT_NO_CAP_AMBIENT_RAISE_LOCKED (1 << 7) #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat secbits in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat secbits in mpers mode + +# else static const struct xlat secbits[] = { @@ -43,4 +81,6 @@ const struct xlat secbits[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/seccomp_filter_flags.h b/xlat/seccomp_filter_flags.h index 5c0decd5..ae933f09 100644 --- a/xlat/seccomp_filter_flags.h +++ b/xlat/seccomp_filter_flags.h @@ -1,18 +1,49 @@ /* Generated by ./xlat/gen.sh from ./xlat/seccomp_filter_flags.in; do not edit. */ -#if !(defined(SECCOMP_FILTER_FLAG_TSYNC) || (defined(HAVE_DECL_SECCOMP_FILTER_FLAG_TSYNC) && HAVE_DECL_SECCOMP_FILTER_FLAG_TSYNC)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SECCOMP_FILTER_FLAG_TSYNC) || (defined(HAVE_DECL_SECCOMP_FILTER_FLAG_TSYNC) && HAVE_DECL_SECCOMP_FILTER_FLAG_TSYNC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECCOMP_FILTER_FLAG_TSYNC) == (1), "SECCOMP_FILTER_FLAG_TSYNC != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SECCOMP_FILTER_FLAG_TSYNC 1 #endif +#if defined(SECCOMP_FILTER_FLAG_LOG) || (defined(HAVE_DECL_SECCOMP_FILTER_FLAG_LOG) && HAVE_DECL_SECCOMP_FILTER_FLAG_LOG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECCOMP_FILTER_FLAG_LOG) == (2), "SECCOMP_FILTER_FLAG_LOG != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SECCOMP_FILTER_FLAG_LOG 2 +#endif +#if defined(SECCOMP_FILTER_FLAG_SPEC_ALLOW) || (defined(HAVE_DECL_SECCOMP_FILTER_FLAG_SPEC_ALLOW) && HAVE_DECL_SECCOMP_FILTER_FLAG_SPEC_ALLOW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECCOMP_FILTER_FLAG_SPEC_ALLOW) == (4), "SECCOMP_FILTER_FLAG_SPEC_ALLOW != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SECCOMP_FILTER_FLAG_SPEC_ALLOW 4 +#endif +#if defined(SECCOMP_FILTER_FLAG_NEW_LISTENER) || (defined(HAVE_DECL_SECCOMP_FILTER_FLAG_NEW_LISTENER) && HAVE_DECL_SECCOMP_FILTER_FLAG_NEW_LISTENER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECCOMP_FILTER_FLAG_NEW_LISTENER) == (8), "SECCOMP_FILTER_FLAG_NEW_LISTENER != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SECCOMP_FILTER_FLAG_NEW_LISTENER 8 +#endif -#ifdef IN_MPERS - -# error static const struct xlat seccomp_filter_flags in mpers mode +#ifndef XLAT_MACROS_ONLY -#else +# ifndef IN_MPERS -static const struct xlat seccomp_filter_flags[] = { XLAT(SECCOMP_FILTER_FLAG_TSYNC), + XLAT(SECCOMP_FILTER_FLAG_LOG), + XLAT(SECCOMP_FILTER_FLAG_SPEC_ALLOW), + XLAT(SECCOMP_FILTER_FLAG_NEW_LISTENER), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/seccomp_filter_flags.in b/xlat/seccomp_filter_flags.in index 83482d00..8fc71de4 100644 --- a/xlat/seccomp_filter_flags.in +++ b/xlat/seccomp_filter_flags.in @@ -1 +1,4 @@ SECCOMP_FILTER_FLAG_TSYNC 1 +SECCOMP_FILTER_FLAG_LOG 2 +SECCOMP_FILTER_FLAG_SPEC_ALLOW 4 +SECCOMP_FILTER_FLAG_NEW_LISTENER 8 diff --git a/xlat/seccomp_mode.h b/xlat/seccomp_mode.h index 842dd444..bb5200f1 100644 --- a/xlat/seccomp_mode.h +++ b/xlat/seccomp_mode.h @@ -1,19 +1,37 @@ /* Generated by ./xlat/gen.sh from ./xlat/seccomp_mode.in; do not edit. */ -#if !(defined(SECCOMP_MODE_DISABLED) || (defined(HAVE_DECL_SECCOMP_MODE_DISABLED) && HAVE_DECL_SECCOMP_MODE_DISABLED)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SECCOMP_MODE_DISABLED) || (defined(HAVE_DECL_SECCOMP_MODE_DISABLED) && HAVE_DECL_SECCOMP_MODE_DISABLED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECCOMP_MODE_DISABLED) == (0), "SECCOMP_MODE_DISABLED != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SECCOMP_MODE_DISABLED 0 #endif -#if !(defined(SECCOMP_MODE_STRICT) || (defined(HAVE_DECL_SECCOMP_MODE_STRICT) && HAVE_DECL_SECCOMP_MODE_STRICT)) +#if defined(SECCOMP_MODE_STRICT) || (defined(HAVE_DECL_SECCOMP_MODE_STRICT) && HAVE_DECL_SECCOMP_MODE_STRICT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECCOMP_MODE_STRICT) == (1), "SECCOMP_MODE_STRICT != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SECCOMP_MODE_STRICT 1 #endif -#if !(defined(SECCOMP_MODE_FILTER) || (defined(HAVE_DECL_SECCOMP_MODE_FILTER) && HAVE_DECL_SECCOMP_MODE_FILTER)) +#if defined(SECCOMP_MODE_FILTER) || (defined(HAVE_DECL_SECCOMP_MODE_FILTER) && HAVE_DECL_SECCOMP_MODE_FILTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECCOMP_MODE_FILTER) == (2), "SECCOMP_MODE_FILTER != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SECCOMP_MODE_FILTER 2 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat seccomp_mode in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat seccomp_mode in mpers mode + +# else static const struct xlat seccomp_mode[] = { @@ -23,4 +41,6 @@ const struct xlat seccomp_mode[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/seccomp_ops.h b/xlat/seccomp_ops.h index 3fd0dc66..fd50d97c 100644 --- a/xlat/seccomp_ops.h +++ b/xlat/seccomp_ops.h @@ -1,22 +1,54 @@ /* Generated by ./xlat/gen.sh from ./xlat/seccomp_ops.in; do not edit. */ -#if !(defined(SECCOMP_SET_MODE_STRICT) || (defined(HAVE_DECL_SECCOMP_SET_MODE_STRICT) && HAVE_DECL_SECCOMP_SET_MODE_STRICT)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SECCOMP_SET_MODE_STRICT) || (defined(HAVE_DECL_SECCOMP_SET_MODE_STRICT) && HAVE_DECL_SECCOMP_SET_MODE_STRICT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECCOMP_SET_MODE_STRICT) == (0), "SECCOMP_SET_MODE_STRICT != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SECCOMP_SET_MODE_STRICT 0 #endif -#if !(defined(SECCOMP_SET_MODE_FILTER) || (defined(HAVE_DECL_SECCOMP_SET_MODE_FILTER) && HAVE_DECL_SECCOMP_SET_MODE_FILTER)) +#if defined(SECCOMP_SET_MODE_FILTER) || (defined(HAVE_DECL_SECCOMP_SET_MODE_FILTER) && HAVE_DECL_SECCOMP_SET_MODE_FILTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECCOMP_SET_MODE_FILTER) == (1), "SECCOMP_SET_MODE_FILTER != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SECCOMP_SET_MODE_FILTER 1 #endif +#if defined(SECCOMP_GET_ACTION_AVAIL) || (defined(HAVE_DECL_SECCOMP_GET_ACTION_AVAIL) && HAVE_DECL_SECCOMP_GET_ACTION_AVAIL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECCOMP_GET_ACTION_AVAIL) == (2), "SECCOMP_GET_ACTION_AVAIL != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SECCOMP_GET_ACTION_AVAIL 2 +#endif +#if defined(SECCOMP_GET_NOTIF_SIZES) || (defined(HAVE_DECL_SECCOMP_GET_NOTIF_SIZES) && HAVE_DECL_SECCOMP_GET_NOTIF_SIZES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECCOMP_GET_NOTIF_SIZES) == (3), "SECCOMP_GET_NOTIF_SIZES != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SECCOMP_GET_NOTIF_SIZES 3 +#endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat seccomp_ops in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat seccomp_ops in mpers mode + +# else static const struct xlat seccomp_ops[] = { XLAT(SECCOMP_SET_MODE_STRICT), XLAT(SECCOMP_SET_MODE_FILTER), + XLAT(SECCOMP_GET_ACTION_AVAIL), + XLAT(SECCOMP_GET_NOTIF_SIZES), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/seccomp_ops.in b/xlat/seccomp_ops.in index c3320af7..97de186f 100644 --- a/xlat/seccomp_ops.in +++ b/xlat/seccomp_ops.in @@ -1,2 +1,4 @@ SECCOMP_SET_MODE_STRICT 0 SECCOMP_SET_MODE_FILTER 1 +SECCOMP_GET_ACTION_AVAIL 2 +SECCOMP_GET_NOTIF_SIZES 3 diff --git a/xlat/seccomp_ret_action.h b/xlat/seccomp_ret_action.h index 2d416099..e9074e00 100644 --- a/xlat/seccomp_ret_action.h +++ b/xlat/seccomp_ret_action.h @@ -1,29 +1,81 @@ /* Generated by ./xlat/gen.sh from ./xlat/seccomp_ret_action.in; do not edit. */ -#ifdef IN_MPERS - -# error static const struct xlat seccomp_ret_action in mpers mode +#include "gcc_compat.h" +#include "static_assert.h" +#if defined(SECCOMP_RET_KILL_PROCESS) || (defined(HAVE_DECL_SECCOMP_RET_KILL_PROCESS) && HAVE_DECL_SECCOMP_RET_KILL_PROCESS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECCOMP_RET_KILL_PROCESS) == (0x80000000U), "SECCOMP_RET_KILL_PROCESS != 0x80000000U"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE #else - -static -const struct xlat seccomp_ret_action[] = { -#if defined(SECCOMP_RET_KILL) || (defined(HAVE_DECL_SECCOMP_RET_KILL) && HAVE_DECL_SECCOMP_RET_KILL) - XLAT(SECCOMP_RET_KILL), +# define SECCOMP_RET_KILL_PROCESS 0x80000000U +#endif +#if defined(SECCOMP_RET_KILL_THREAD) || (defined(HAVE_DECL_SECCOMP_RET_KILL_THREAD) && HAVE_DECL_SECCOMP_RET_KILL_THREAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECCOMP_RET_KILL_THREAD) == (0), "SECCOMP_RET_KILL_THREAD != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SECCOMP_RET_KILL_THREAD 0 #endif #if defined(SECCOMP_RET_TRAP) || (defined(HAVE_DECL_SECCOMP_RET_TRAP) && HAVE_DECL_SECCOMP_RET_TRAP) - XLAT(SECCOMP_RET_TRAP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECCOMP_RET_TRAP) == (0x00030000U), "SECCOMP_RET_TRAP != 0x00030000U"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SECCOMP_RET_TRAP 0x00030000U #endif #if defined(SECCOMP_RET_ERRNO) || (defined(HAVE_DECL_SECCOMP_RET_ERRNO) && HAVE_DECL_SECCOMP_RET_ERRNO) - XLAT(SECCOMP_RET_ERRNO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECCOMP_RET_ERRNO) == (0x00050000U), "SECCOMP_RET_ERRNO != 0x00050000U"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SECCOMP_RET_ERRNO 0x00050000U +#endif +#if defined(SECCOMP_RET_USER_NOTIF) || (defined(HAVE_DECL_SECCOMP_RET_USER_NOTIF) && HAVE_DECL_SECCOMP_RET_USER_NOTIF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECCOMP_RET_USER_NOTIF) == (0x7fc00000U), "SECCOMP_RET_USER_NOTIF != 0x7fc00000U"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SECCOMP_RET_USER_NOTIF 0x7fc00000U #endif #if defined(SECCOMP_RET_TRACE) || (defined(HAVE_DECL_SECCOMP_RET_TRACE) && HAVE_DECL_SECCOMP_RET_TRACE) - XLAT(SECCOMP_RET_TRACE), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECCOMP_RET_TRACE) == (0x7ff00000U), "SECCOMP_RET_TRACE != 0x7ff00000U"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SECCOMP_RET_TRACE 0x7ff00000U +#endif +#if defined(SECCOMP_RET_LOG) || (defined(HAVE_DECL_SECCOMP_RET_LOG) && HAVE_DECL_SECCOMP_RET_LOG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECCOMP_RET_LOG) == (0x7ffc0000U), "SECCOMP_RET_LOG != 0x7ffc0000U"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SECCOMP_RET_LOG 0x7ffc0000U #endif #if defined(SECCOMP_RET_ALLOW) || (defined(HAVE_DECL_SECCOMP_RET_ALLOW) && HAVE_DECL_SECCOMP_RET_ALLOW) - XLAT(SECCOMP_RET_ALLOW), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SECCOMP_RET_ALLOW) == (0x7fff0000U), "SECCOMP_RET_ALLOW != 0x7fff0000U"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SECCOMP_RET_ALLOW 0x7fff0000U #endif + +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS + +const struct xlat seccomp_ret_action[] = { + XLAT(SECCOMP_RET_KILL_PROCESS), + XLAT(SECCOMP_RET_KILL_THREAD), + XLAT(SECCOMP_RET_TRAP), + XLAT(SECCOMP_RET_ERRNO), + XLAT(SECCOMP_RET_USER_NOTIF), + XLAT(SECCOMP_RET_TRACE), + XLAT(SECCOMP_RET_LOG), + XLAT(SECCOMP_RET_ALLOW), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/seccomp_ret_action.in b/xlat/seccomp_ret_action.in index 6212dcb6..4b1455f5 100644 --- a/xlat/seccomp_ret_action.in +++ b/xlat/seccomp_ret_action.in @@ -1,5 +1,8 @@ -SECCOMP_RET_KILL -SECCOMP_RET_TRAP -SECCOMP_RET_ERRNO -SECCOMP_RET_TRACE -SECCOMP_RET_ALLOW +SECCOMP_RET_KILL_PROCESS 0x80000000U +SECCOMP_RET_KILL_THREAD 0 +SECCOMP_RET_TRAP 0x00030000U +SECCOMP_RET_ERRNO 0x00050000U +SECCOMP_RET_USER_NOTIF 0x7fc00000U +SECCOMP_RET_TRACE 0x7ff00000U +SECCOMP_RET_LOG 0x7ffc0000U +SECCOMP_RET_ALLOW 0x7fff0000U diff --git a/xlat/semctl_flags.h b/xlat/semctl_flags.h index b8e0c629..ffb88de5 100644 --- a/xlat/semctl_flags.h +++ b/xlat/semctl_flags.h @@ -1,55 +1,135 @@ /* Generated by ./xlat/gen.sh from ./xlat/semctl_flags.in; do not edit. */ -#if !(defined(SEM_STAT) || (defined(HAVE_DECL_SEM_STAT) && HAVE_DECL_SEM_STAT)) -# define SEM_STAT 18 -#endif -#if !(defined(SEM_INFO) || (defined(HAVE_DECL_SEM_INFO) && HAVE_DECL_SEM_INFO)) -# define SEM_INFO 19 -#endif - -#ifdef IN_MPERS -# error static const struct xlat semctl_flags in mpers mode +#include "gcc_compat.h" +#include "static_assert.h" -#else - -static -const struct xlat semctl_flags[] = { #if defined(IPC_RMID) || (defined(HAVE_DECL_IPC_RMID) && HAVE_DECL_IPC_RMID) - XLAT(IPC_RMID), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPC_RMID) == (0), "IPC_RMID != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPC_RMID 0 #endif #if defined(IPC_SET) || (defined(HAVE_DECL_IPC_SET) && HAVE_DECL_IPC_SET) - XLAT(IPC_SET), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPC_SET) == (1), "IPC_SET != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPC_SET 1 #endif #if defined(IPC_STAT) || (defined(HAVE_DECL_IPC_STAT) && HAVE_DECL_IPC_STAT) - XLAT(IPC_STAT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPC_STAT) == (2), "IPC_STAT != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPC_STAT 2 #endif #if defined(IPC_INFO) || (defined(HAVE_DECL_IPC_INFO) && HAVE_DECL_IPC_INFO) - XLAT(IPC_INFO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPC_INFO) == (3), "IPC_INFO != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPC_INFO 3 #endif - XLAT(SEM_STAT), - XLAT(SEM_INFO), #if defined(GETPID) || (defined(HAVE_DECL_GETPID) && HAVE_DECL_GETPID) - XLAT(GETPID), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((GETPID) == (11), "GETPID != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define GETPID 11 #endif #if defined(GETVAL) || (defined(HAVE_DECL_GETVAL) && HAVE_DECL_GETVAL) - XLAT(GETVAL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((GETVAL) == (12), "GETVAL != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define GETVAL 12 #endif #if defined(GETALL) || (defined(HAVE_DECL_GETALL) && HAVE_DECL_GETALL) - XLAT(GETALL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((GETALL) == (13), "GETALL != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define GETALL 13 #endif #if defined(GETNCNT) || (defined(HAVE_DECL_GETNCNT) && HAVE_DECL_GETNCNT) - XLAT(GETNCNT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((GETNCNT) == (14), "GETNCNT != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define GETNCNT 14 #endif #if defined(GETZCNT) || (defined(HAVE_DECL_GETZCNT) && HAVE_DECL_GETZCNT) - XLAT(GETZCNT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((GETZCNT) == (15), "GETZCNT != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define GETZCNT 15 #endif #if defined(SETVAL) || (defined(HAVE_DECL_SETVAL) && HAVE_DECL_SETVAL) - XLAT(SETVAL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SETVAL) == (16), "SETVAL != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SETVAL 16 #endif #if defined(SETALL) || (defined(HAVE_DECL_SETALL) && HAVE_DECL_SETALL) - XLAT(SETALL), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SETALL) == (17), "SETALL != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SETALL 17 +#endif +#if defined(SEM_STAT) || (defined(HAVE_DECL_SEM_STAT) && HAVE_DECL_SEM_STAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SEM_STAT) == (18), "SEM_STAT != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SEM_STAT 18 +#endif +#if defined(SEM_INFO) || (defined(HAVE_DECL_SEM_INFO) && HAVE_DECL_SEM_INFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SEM_INFO) == (19), "SEM_INFO != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SEM_INFO 19 #endif +#if defined(SEM_STAT_ANY) || (defined(HAVE_DECL_SEM_STAT_ANY) && HAVE_DECL_SEM_STAT_ANY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SEM_STAT_ANY) == (20), "SEM_STAT_ANY != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SEM_STAT_ANY 20 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat semctl_flags in mpers mode + +# else + +static +const struct xlat semctl_flags[] = { + + XLAT(IPC_RMID), + XLAT(IPC_SET), + XLAT(IPC_STAT), + XLAT(IPC_INFO), + XLAT(GETPID), + XLAT(GETVAL), + XLAT(GETALL), + XLAT(GETNCNT), + XLAT(GETZCNT), + XLAT(SETVAL), + XLAT(SETALL), + XLAT(SEM_STAT), + XLAT(SEM_INFO), + XLAT(SEM_STAT_ANY), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/semctl_flags.in b/xlat/semctl_flags.in index 5638adba..9e8b84b3 100644 --- a/xlat/semctl_flags.in +++ b/xlat/semctl_flags.in @@ -1,13 +1,15 @@ -IPC_RMID -IPC_SET -IPC_STAT -IPC_INFO +/* sort -k2,2g */ +IPC_RMID 0 +IPC_SET 1 +IPC_STAT 2 +IPC_INFO 3 +GETPID 11 +GETVAL 12 +GETALL 13 +GETNCNT 14 +GETZCNT 15 +SETVAL 16 +SETALL 17 SEM_STAT 18 SEM_INFO 19 -GETPID -GETVAL -GETALL -GETNCNT -GETZCNT -SETVAL -SETALL +SEM_STAT_ANY 20 diff --git a/xlat/semop_flags.h b/xlat/semop_flags.h index b5ce4a01..fcd9e117 100644 --- a/xlat/semop_flags.h +++ b/xlat/semop_flags.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/semop_flags.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat semop_flags in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat semop_flags in mpers mode + +# else static const struct xlat semop_flags[] = { @@ -17,4 +23,6 @@ const struct xlat semop_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/setns_types.h b/xlat/setns_types.h index 8ed5afa8..2b5368fc 100644 --- a/xlat/setns_types.h +++ b/xlat/setns_types.h @@ -1,33 +1,62 @@ /* Generated by ./xlat/gen.sh from ./xlat/setns_types.in; do not edit. */ -#if !(defined(CLONE_NEWNS) || (defined(HAVE_DECL_CLONE_NEWNS) && HAVE_DECL_CLONE_NEWNS)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(CLONE_NEWNS) || (defined(HAVE_DECL_CLONE_NEWNS) && HAVE_DECL_CLONE_NEWNS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_NEWNS) == (0x00020000), "CLONE_NEWNS != 0x00020000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_NEWNS 0x00020000 #endif -#if !(defined(CLONE_NEWCGROUP) || (defined(HAVE_DECL_CLONE_NEWCGROUP) && HAVE_DECL_CLONE_NEWCGROUP)) +#if defined(CLONE_NEWCGROUP) || (defined(HAVE_DECL_CLONE_NEWCGROUP) && HAVE_DECL_CLONE_NEWCGROUP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_NEWCGROUP) == (0x02000000), "CLONE_NEWCGROUP != 0x02000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_NEWCGROUP 0x02000000 #endif -#if !(defined(CLONE_NEWUTS) || (defined(HAVE_DECL_CLONE_NEWUTS) && HAVE_DECL_CLONE_NEWUTS)) +#if defined(CLONE_NEWUTS) || (defined(HAVE_DECL_CLONE_NEWUTS) && HAVE_DECL_CLONE_NEWUTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_NEWUTS) == (0x04000000), "CLONE_NEWUTS != 0x04000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_NEWUTS 0x04000000 #endif -#if !(defined(CLONE_NEWIPC) || (defined(HAVE_DECL_CLONE_NEWIPC) && HAVE_DECL_CLONE_NEWIPC)) +#if defined(CLONE_NEWIPC) || (defined(HAVE_DECL_CLONE_NEWIPC) && HAVE_DECL_CLONE_NEWIPC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_NEWIPC) == (0x08000000), "CLONE_NEWIPC != 0x08000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_NEWIPC 0x08000000 #endif -#if !(defined(CLONE_NEWUSER) || (defined(HAVE_DECL_CLONE_NEWUSER) && HAVE_DECL_CLONE_NEWUSER)) +#if defined(CLONE_NEWUSER) || (defined(HAVE_DECL_CLONE_NEWUSER) && HAVE_DECL_CLONE_NEWUSER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_NEWUSER) == (0x10000000), "CLONE_NEWUSER != 0x10000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_NEWUSER 0x10000000 #endif -#if !(defined(CLONE_NEWPID) || (defined(HAVE_DECL_CLONE_NEWPID) && HAVE_DECL_CLONE_NEWPID)) +#if defined(CLONE_NEWPID) || (defined(HAVE_DECL_CLONE_NEWPID) && HAVE_DECL_CLONE_NEWPID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_NEWPID) == (0x20000000), "CLONE_NEWPID != 0x20000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_NEWPID 0x20000000 #endif -#if !(defined(CLONE_NEWNET) || (defined(HAVE_DECL_CLONE_NEWNET) && HAVE_DECL_CLONE_NEWNET)) +#if defined(CLONE_NEWNET) || (defined(HAVE_DECL_CLONE_NEWNET) && HAVE_DECL_CLONE_NEWNET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLONE_NEWNET) == (0x40000000), "CLONE_NEWNET != 0x40000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLONE_NEWNET 0x40000000 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat setns_types in mpers mode +# ifndef IN_MPERS -#else - -static const struct xlat setns_types[] = { XLAT(0), XLAT(CLONE_NEWNS), @@ -40,4 +69,6 @@ const struct xlat setns_types[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/setsock_ip_options.h b/xlat/setsock_ip_options.h new file mode 100644 index 00000000..c5f8fc59 --- /dev/null +++ b/xlat/setsock_ip_options.h @@ -0,0 +1,97 @@ +/* Generated by ./xlat/gen.sh from ./xlat/setsock_ip_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat setsock_ip_options in mpers mode + +# else + +static +const struct xlat setsock_ip_options[] = { +/* +* Options specific to setsockopt(SOL_IP). +* Common {g,s}etsockopt(SOL_IP) options +* should be in sock_ip_options.in instead. +*/ + +#if defined(ARPT_SO_SET_REPLACE) || (defined(HAVE_DECL_ARPT_SO_SET_REPLACE) && HAVE_DECL_ARPT_SO_SET_REPLACE) + XLAT(ARPT_SO_SET_REPLACE), +#endif +#if defined(ARPT_SO_SET_ADD_COUNTERS) || (defined(HAVE_DECL_ARPT_SO_SET_ADD_COUNTERS) && HAVE_DECL_ARPT_SO_SET_ADD_COUNTERS) + XLAT(ARPT_SO_SET_ADD_COUNTERS), +#endif + +#if defined(EBT_SO_SET_ENTRIES) || (defined(HAVE_DECL_EBT_SO_SET_ENTRIES) && HAVE_DECL_EBT_SO_SET_ENTRIES) + XLAT(EBT_SO_SET_ENTRIES), +#endif +#if defined(EBT_SO_SET_COUNTERS) || (defined(HAVE_DECL_EBT_SO_SET_COUNTERS) && HAVE_DECL_EBT_SO_SET_COUNTERS) + XLAT(EBT_SO_SET_COUNTERS), +#endif + +#if defined(IP_VS_SO_SET_NONE) || (defined(HAVE_DECL_IP_VS_SO_SET_NONE) && HAVE_DECL_IP_VS_SO_SET_NONE) + XLAT(IP_VS_SO_SET_NONE), +#endif +#if defined(IP_VS_SO_SET_INSERT) || (defined(HAVE_DECL_IP_VS_SO_SET_INSERT) && HAVE_DECL_IP_VS_SO_SET_INSERT) + XLAT(IP_VS_SO_SET_INSERT), +#endif +#if defined(IP_VS_SO_SET_ADD) || (defined(HAVE_DECL_IP_VS_SO_SET_ADD) && HAVE_DECL_IP_VS_SO_SET_ADD) + XLAT(IP_VS_SO_SET_ADD), +#endif +#if defined(IP_VS_SO_SET_EDIT) || (defined(HAVE_DECL_IP_VS_SO_SET_EDIT) && HAVE_DECL_IP_VS_SO_SET_EDIT) + XLAT(IP_VS_SO_SET_EDIT), +#endif +#if defined(IP_VS_SO_SET_DEL) || (defined(HAVE_DECL_IP_VS_SO_SET_DEL) && HAVE_DECL_IP_VS_SO_SET_DEL) + XLAT(IP_VS_SO_SET_DEL), +#endif +#if defined(IP_VS_SO_SET_FLUSH) || (defined(HAVE_DECL_IP_VS_SO_SET_FLUSH) && HAVE_DECL_IP_VS_SO_SET_FLUSH) + XLAT(IP_VS_SO_SET_FLUSH), +#endif +#if defined(IP_VS_SO_SET_LIST) || (defined(HAVE_DECL_IP_VS_SO_SET_LIST) && HAVE_DECL_IP_VS_SO_SET_LIST) + XLAT(IP_VS_SO_SET_LIST), +#endif +#if defined(IP_VS_SO_SET_ADDDEST) || (defined(HAVE_DECL_IP_VS_SO_SET_ADDDEST) && HAVE_DECL_IP_VS_SO_SET_ADDDEST) + XLAT(IP_VS_SO_SET_ADDDEST), +#endif +#if defined(IP_VS_SO_SET_DELDEST) || (defined(HAVE_DECL_IP_VS_SO_SET_DELDEST) && HAVE_DECL_IP_VS_SO_SET_DELDEST) + XLAT(IP_VS_SO_SET_DELDEST), +#endif +#if defined(IP_VS_SO_SET_EDITDEST) || (defined(HAVE_DECL_IP_VS_SO_SET_EDITDEST) && HAVE_DECL_IP_VS_SO_SET_EDITDEST) + XLAT(IP_VS_SO_SET_EDITDEST), +#endif +#if defined(IP_VS_SO_SET_TIMEOUT) || (defined(HAVE_DECL_IP_VS_SO_SET_TIMEOUT) && HAVE_DECL_IP_VS_SO_SET_TIMEOUT) + XLAT(IP_VS_SO_SET_TIMEOUT), +#endif +#if defined(IP_VS_SO_SET_STARTDAEMON) || (defined(HAVE_DECL_IP_VS_SO_SET_STARTDAEMON) && HAVE_DECL_IP_VS_SO_SET_STARTDAEMON) + XLAT(IP_VS_SO_SET_STARTDAEMON), +#endif +#if defined(IP_VS_SO_SET_STOPDAEMON) || (defined(HAVE_DECL_IP_VS_SO_SET_STOPDAEMON) && HAVE_DECL_IP_VS_SO_SET_STOPDAEMON) + XLAT(IP_VS_SO_SET_STOPDAEMON), +#endif +#if defined(IP_VS_SO_SET_RESTORE) || (defined(HAVE_DECL_IP_VS_SO_SET_RESTORE) && HAVE_DECL_IP_VS_SO_SET_RESTORE) + XLAT(IP_VS_SO_SET_RESTORE), +#endif +#if defined(IP_VS_SO_SET_SAVE) || (defined(HAVE_DECL_IP_VS_SO_SET_SAVE) && HAVE_DECL_IP_VS_SO_SET_SAVE) + XLAT(IP_VS_SO_SET_SAVE), +#endif +#if defined(IP_VS_SO_SET_ZERO) || (defined(HAVE_DECL_IP_VS_SO_SET_ZERO) && HAVE_DECL_IP_VS_SO_SET_ZERO) + XLAT(IP_VS_SO_SET_ZERO), +#endif + +#if defined(IPT_SO_SET_REPLACE) || (defined(HAVE_DECL_IPT_SO_SET_REPLACE) && HAVE_DECL_IPT_SO_SET_REPLACE) + XLAT(IPT_SO_SET_REPLACE), +#endif +#if defined(IPT_SO_SET_ADD_COUNTERS) || (defined(HAVE_DECL_IPT_SO_SET_ADD_COUNTERS) && HAVE_DECL_IPT_SO_SET_ADD_COUNTERS) + XLAT(IPT_SO_SET_ADD_COUNTERS), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/setsock_ip_options.in b/xlat/setsock_ip_options.in new file mode 100644 index 00000000..c811439f --- /dev/null +++ b/xlat/setsock_ip_options.in @@ -0,0 +1,31 @@ +/* + * Options specific to setsockopt(SOL_IP). + * Common {g,s}etsockopt(SOL_IP) options + * should be in sock_ip_options.in instead. + */ + +ARPT_SO_SET_REPLACE +ARPT_SO_SET_ADD_COUNTERS + +EBT_SO_SET_ENTRIES +EBT_SO_SET_COUNTERS + +IP_VS_SO_SET_NONE +IP_VS_SO_SET_INSERT +IP_VS_SO_SET_ADD +IP_VS_SO_SET_EDIT +IP_VS_SO_SET_DEL +IP_VS_SO_SET_FLUSH +IP_VS_SO_SET_LIST +IP_VS_SO_SET_ADDDEST +IP_VS_SO_SET_DELDEST +IP_VS_SO_SET_EDITDEST +IP_VS_SO_SET_TIMEOUT +IP_VS_SO_SET_STARTDAEMON +IP_VS_SO_SET_STOPDAEMON +IP_VS_SO_SET_RESTORE +IP_VS_SO_SET_SAVE +IP_VS_SO_SET_ZERO + +IPT_SO_SET_REPLACE +IPT_SO_SET_ADD_COUNTERS diff --git a/xlat/setsock_ipv6_options.h b/xlat/setsock_ipv6_options.h new file mode 100644 index 00000000..328a4087 --- /dev/null +++ b/xlat/setsock_ipv6_options.h @@ -0,0 +1,44 @@ +/* Generated by ./xlat/gen.sh from ./xlat/setsock_ipv6_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IP6T_SO_SET_REPLACE) || (defined(HAVE_DECL_IP6T_SO_SET_REPLACE) && HAVE_DECL_IP6T_SO_SET_REPLACE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IP6T_SO_SET_REPLACE) == (64), "IP6T_SO_SET_REPLACE != 64"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IP6T_SO_SET_REPLACE 64 +#endif +#if defined(IP6T_SO_SET_ADD_COUNTERS) || (defined(HAVE_DECL_IP6T_SO_SET_ADD_COUNTERS) && HAVE_DECL_IP6T_SO_SET_ADD_COUNTERS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IP6T_SO_SET_ADD_COUNTERS) == (65), "IP6T_SO_SET_ADD_COUNTERS != 65"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IP6T_SO_SET_ADD_COUNTERS 65 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat setsock_ipv6_options in mpers mode + +# else + +static +const struct xlat setsock_ipv6_options[] = { +/* +* Options specific to setsockopt(SOL_IPV6). +* Common {g,s}etsockopt(SOL_IPV6) options +* should be in sock_ipv6_options.in instead. +*/ + + XLAT(IP6T_SO_SET_REPLACE), + XLAT(IP6T_SO_SET_ADD_COUNTERS), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/setsock_ipv6_options.in b/xlat/setsock_ipv6_options.in new file mode 100644 index 00000000..5a42cdf9 --- /dev/null +++ b/xlat/setsock_ipv6_options.in @@ -0,0 +1,8 @@ +/* + * Options specific to setsockopt(SOL_IPV6). + * Common {g,s}etsockopt(SOL_IPV6) options + * should be in sock_ipv6_options.in instead. + */ + +IP6T_SO_SET_REPLACE 64 +IP6T_SO_SET_ADD_COUNTERS 65 diff --git a/xlat/setsock_options.h b/xlat/setsock_options.h new file mode 100644 index 00000000..2ee500c9 --- /dev/null +++ b/xlat/setsock_options.h @@ -0,0 +1,44 @@ +/* Generated by ./xlat/gen.sh from ./xlat/setsock_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined __hppa__ +#if defined(SO_ATTACH_FILTER) || (defined(HAVE_DECL_SO_ATTACH_FILTER) && HAVE_DECL_SO_ATTACH_FILTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_ATTACH_FILTER) == (16410), "SO_ATTACH_FILTER != 16410"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_ATTACH_FILTER 16410 +#endif +#else +#if defined(SO_ATTACH_FILTER) || (defined(HAVE_DECL_SO_ATTACH_FILTER) && HAVE_DECL_SO_ATTACH_FILTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_ATTACH_FILTER) == (26), "SO_ATTACH_FILTER != 26"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_ATTACH_FILTER 26 +#endif +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat setsock_options in mpers mode + +# else + +static +const struct xlat setsock_options[] = { +#if defined __hppa__ + XLAT(SO_ATTACH_FILTER), +#else + XLAT(SO_ATTACH_FILTER), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/setsock_options.in b/xlat/setsock_options.in new file mode 100644 index 00000000..38f29207 --- /dev/null +++ b/xlat/setsock_options.in @@ -0,0 +1,5 @@ +#if defined __hppa__ +SO_ATTACH_FILTER 16410 +#else +SO_ATTACH_FILTER 26 +#endif diff --git a/xlat/setsockipoptions.h b/xlat/setsockipoptions.h deleted file mode 100644 index 34ae307f..00000000 --- a/xlat/setsockipoptions.h +++ /dev/null @@ -1,89 +0,0 @@ -/* Generated by ./xlat/gen.sh from ./xlat/setsockipoptions.in; do not edit. */ - -#ifdef IN_MPERS - -# error static const struct xlat setsockipoptions in mpers mode - -#else - -static -const struct xlat setsockipoptions[] = { -/* -* Options specific to setsockopt(SOL_IP). -* Common {g,s}etsockopt(SOL_IP) options -* should be in sockipoptions.in instead. -*/ - -#if defined(ARPT_SO_SET_REPLACE) || (defined(HAVE_DECL_ARPT_SO_SET_REPLACE) && HAVE_DECL_ARPT_SO_SET_REPLACE) - XLAT(ARPT_SO_SET_REPLACE), -#endif -#if defined(ARPT_SO_SET_ADD_COUNTERS) || (defined(HAVE_DECL_ARPT_SO_SET_ADD_COUNTERS) && HAVE_DECL_ARPT_SO_SET_ADD_COUNTERS) - XLAT(ARPT_SO_SET_ADD_COUNTERS), -#endif - -#if defined(EBT_SO_SET_ENTRIES) || (defined(HAVE_DECL_EBT_SO_SET_ENTRIES) && HAVE_DECL_EBT_SO_SET_ENTRIES) - XLAT(EBT_SO_SET_ENTRIES), -#endif -#if defined(EBT_SO_SET_COUNTERS) || (defined(HAVE_DECL_EBT_SO_SET_COUNTERS) && HAVE_DECL_EBT_SO_SET_COUNTERS) - XLAT(EBT_SO_SET_COUNTERS), -#endif - -#if defined(IP_VS_SO_SET_NONE) || (defined(HAVE_DECL_IP_VS_SO_SET_NONE) && HAVE_DECL_IP_VS_SO_SET_NONE) - XLAT(IP_VS_SO_SET_NONE), -#endif -#if defined(IP_VS_SO_SET_INSERT) || (defined(HAVE_DECL_IP_VS_SO_SET_INSERT) && HAVE_DECL_IP_VS_SO_SET_INSERT) - XLAT(IP_VS_SO_SET_INSERT), -#endif -#if defined(IP_VS_SO_SET_ADD) || (defined(HAVE_DECL_IP_VS_SO_SET_ADD) && HAVE_DECL_IP_VS_SO_SET_ADD) - XLAT(IP_VS_SO_SET_ADD), -#endif -#if defined(IP_VS_SO_SET_EDIT) || (defined(HAVE_DECL_IP_VS_SO_SET_EDIT) && HAVE_DECL_IP_VS_SO_SET_EDIT) - XLAT(IP_VS_SO_SET_EDIT), -#endif -#if defined(IP_VS_SO_SET_DEL) || (defined(HAVE_DECL_IP_VS_SO_SET_DEL) && HAVE_DECL_IP_VS_SO_SET_DEL) - XLAT(IP_VS_SO_SET_DEL), -#endif -#if defined(IP_VS_SO_SET_FLUSH) || (defined(HAVE_DECL_IP_VS_SO_SET_FLUSH) && HAVE_DECL_IP_VS_SO_SET_FLUSH) - XLAT(IP_VS_SO_SET_FLUSH), -#endif -#if defined(IP_VS_SO_SET_LIST) || (defined(HAVE_DECL_IP_VS_SO_SET_LIST) && HAVE_DECL_IP_VS_SO_SET_LIST) - XLAT(IP_VS_SO_SET_LIST), -#endif -#if defined(IP_VS_SO_SET_ADDDEST) || (defined(HAVE_DECL_IP_VS_SO_SET_ADDDEST) && HAVE_DECL_IP_VS_SO_SET_ADDDEST) - XLAT(IP_VS_SO_SET_ADDDEST), -#endif -#if defined(IP_VS_SO_SET_DELDEST) || (defined(HAVE_DECL_IP_VS_SO_SET_DELDEST) && HAVE_DECL_IP_VS_SO_SET_DELDEST) - XLAT(IP_VS_SO_SET_DELDEST), -#endif -#if defined(IP_VS_SO_SET_EDITDEST) || (defined(HAVE_DECL_IP_VS_SO_SET_EDITDEST) && HAVE_DECL_IP_VS_SO_SET_EDITDEST) - XLAT(IP_VS_SO_SET_EDITDEST), -#endif -#if defined(IP_VS_SO_SET_TIMEOUT) || (defined(HAVE_DECL_IP_VS_SO_SET_TIMEOUT) && HAVE_DECL_IP_VS_SO_SET_TIMEOUT) - XLAT(IP_VS_SO_SET_TIMEOUT), -#endif -#if defined(IP_VS_SO_SET_STARTDAEMON) || (defined(HAVE_DECL_IP_VS_SO_SET_STARTDAEMON) && HAVE_DECL_IP_VS_SO_SET_STARTDAEMON) - XLAT(IP_VS_SO_SET_STARTDAEMON), -#endif -#if defined(IP_VS_SO_SET_STOPDAEMON) || (defined(HAVE_DECL_IP_VS_SO_SET_STOPDAEMON) && HAVE_DECL_IP_VS_SO_SET_STOPDAEMON) - XLAT(IP_VS_SO_SET_STOPDAEMON), -#endif -#if defined(IP_VS_SO_SET_RESTORE) || (defined(HAVE_DECL_IP_VS_SO_SET_RESTORE) && HAVE_DECL_IP_VS_SO_SET_RESTORE) - XLAT(IP_VS_SO_SET_RESTORE), -#endif -#if defined(IP_VS_SO_SET_SAVE) || (defined(HAVE_DECL_IP_VS_SO_SET_SAVE) && HAVE_DECL_IP_VS_SO_SET_SAVE) - XLAT(IP_VS_SO_SET_SAVE), -#endif -#if defined(IP_VS_SO_SET_ZERO) || (defined(HAVE_DECL_IP_VS_SO_SET_ZERO) && HAVE_DECL_IP_VS_SO_SET_ZERO) - XLAT(IP_VS_SO_SET_ZERO), -#endif - -#if defined(IPT_SO_SET_REPLACE) || (defined(HAVE_DECL_IPT_SO_SET_REPLACE) && HAVE_DECL_IPT_SO_SET_REPLACE) - XLAT(IPT_SO_SET_REPLACE), -#endif -#if defined(IPT_SO_SET_ADD_COUNTERS) || (defined(HAVE_DECL_IPT_SO_SET_ADD_COUNTERS) && HAVE_DECL_IPT_SO_SET_ADD_COUNTERS) - XLAT(IPT_SO_SET_ADD_COUNTERS), -#endif - XLAT_END -}; - -#endif /* !IN_MPERS */ diff --git a/xlat/setsockipoptions.in b/xlat/setsockipoptions.in deleted file mode 100644 index 878a5945..00000000 --- a/xlat/setsockipoptions.in +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Options specific to setsockopt(SOL_IP). - * Common {g,s}etsockopt(SOL_IP) options - * should be in sockipoptions.in instead. - */ - -ARPT_SO_SET_REPLACE -ARPT_SO_SET_ADD_COUNTERS - -EBT_SO_SET_ENTRIES -EBT_SO_SET_COUNTERS - -IP_VS_SO_SET_NONE -IP_VS_SO_SET_INSERT -IP_VS_SO_SET_ADD -IP_VS_SO_SET_EDIT -IP_VS_SO_SET_DEL -IP_VS_SO_SET_FLUSH -IP_VS_SO_SET_LIST -IP_VS_SO_SET_ADDDEST -IP_VS_SO_SET_DELDEST -IP_VS_SO_SET_EDITDEST -IP_VS_SO_SET_TIMEOUT -IP_VS_SO_SET_STARTDAEMON -IP_VS_SO_SET_STOPDAEMON -IP_VS_SO_SET_RESTORE -IP_VS_SO_SET_SAVE -IP_VS_SO_SET_ZERO - -IPT_SO_SET_REPLACE -IPT_SO_SET_ADD_COUNTERS diff --git a/xlat/setsockipv6options.h b/xlat/setsockipv6options.h deleted file mode 100644 index 4fea6bc2..00000000 --- a/xlat/setsockipv6options.h +++ /dev/null @@ -1,26 +0,0 @@ -/* Generated by ./xlat/gen.sh from ./xlat/setsockipv6options.in; do not edit. */ - -#ifdef IN_MPERS - -# error static const struct xlat setsockipv6options in mpers mode - -#else - -static -const struct xlat setsockipv6options[] = { -/* -* Options specific to setsockopt(SOL_IPV6). -* Common {g,s}etsockopt(SOL_IPV6) options -* should be in sockipv6options.in instead. -*/ - -#if defined(IP6T_SO_SET_REPLACE) || (defined(HAVE_DECL_IP6T_SO_SET_REPLACE) && HAVE_DECL_IP6T_SO_SET_REPLACE) - XLAT(IP6T_SO_SET_REPLACE), -#endif -#if defined(IP6T_SO_SET_ADD_COUNTERS) || (defined(HAVE_DECL_IP6T_SO_SET_ADD_COUNTERS) && HAVE_DECL_IP6T_SO_SET_ADD_COUNTERS) - XLAT(IP6T_SO_SET_ADD_COUNTERS), -#endif - XLAT_END -}; - -#endif /* !IN_MPERS */ diff --git a/xlat/setsockipv6options.in b/xlat/setsockipv6options.in deleted file mode 100644 index a9eff851..00000000 --- a/xlat/setsockipv6options.in +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Options specific to setsockopt(SOL_IPV6). - * Common {g,s}etsockopt(SOL_IPV6) options - * should be in sockipv6options.in instead. - */ - -IP6T_SO_SET_REPLACE -IP6T_SO_SET_ADD_COUNTERS diff --git a/xlat/sfd_flags.h b/xlat/sfd_flags.h index 23d08b81..84e29ded 100644 --- a/xlat/sfd_flags.h +++ b/xlat/sfd_flags.h @@ -1,18 +1,32 @@ /* Generated by ./xlat/gen.sh from ./xlat/sfd_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + #if defined SFD_CLOEXEC || defined O_CLOEXEC -#if !(defined(SFD_CLOEXEC) || (defined(HAVE_DECL_SFD_CLOEXEC) && HAVE_DECL_SFD_CLOEXEC)) +#if defined(SFD_CLOEXEC) || (defined(HAVE_DECL_SFD_CLOEXEC) && HAVE_DECL_SFD_CLOEXEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SFD_CLOEXEC) == (O_CLOEXEC), "SFD_CLOEXEC != O_CLOEXEC"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SFD_CLOEXEC O_CLOEXEC #endif #endif -#if !(defined(SFD_NONBLOCK) || (defined(HAVE_DECL_SFD_NONBLOCK) && HAVE_DECL_SFD_NONBLOCK)) +#if defined(SFD_NONBLOCK) || (defined(HAVE_DECL_SFD_NONBLOCK) && HAVE_DECL_SFD_NONBLOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SFD_NONBLOCK) == (O_NONBLOCK), "SFD_NONBLOCK != O_NONBLOCK"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SFD_NONBLOCK O_NONBLOCK #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat sfd_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat sfd_flags in mpers mode + +# else static const struct xlat sfd_flags[] = { @@ -23,4 +37,6 @@ const struct xlat sfd_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sg_io_dxfer_direction.h b/xlat/sg_io_dxfer_direction.h index 4923016d..93dda68a 100644 --- a/xlat/sg_io_dxfer_direction.h +++ b/xlat/sg_io_dxfer_direction.h @@ -1,14 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/sg_io_dxfer_direction.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat sg_io_dxfer_direction[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat sg_io_dxfer_direction[] = { #if defined(SG_DXFER_NONE) || (defined(HAVE_DECL_SG_DXFER_NONE) && HAVE_DECL_SG_DXFER_NONE) XLAT(SG_DXFER_NONE), @@ -25,4 +31,6 @@ const struct xlat sg_io_dxfer_direction[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sg_io_flags.h b/xlat/sg_io_flags.h index 5c25ad7e..9b938e9f 100644 --- a/xlat/sg_io_flags.h +++ b/xlat/sg_io_flags.h @@ -1,32 +1,62 @@ /* Generated by ./xlat/gen.sh from ./xlat/sg_io_flags.in; do not edit. */ -#if !(defined(SG_FLAG_DIRECT_IO) || (defined(HAVE_DECL_SG_FLAG_DIRECT_IO) && HAVE_DECL_SG_FLAG_DIRECT_IO)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SG_FLAG_DIRECT_IO) || (defined(HAVE_DECL_SG_FLAG_DIRECT_IO) && HAVE_DECL_SG_FLAG_DIRECT_IO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_FLAG_DIRECT_IO) == (1), "SG_FLAG_DIRECT_IO != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_FLAG_DIRECT_IO 1 #endif -#if !(defined(SG_FLAG_UNUSED_LUN_INHIBIT) || (defined(HAVE_DECL_SG_FLAG_UNUSED_LUN_INHIBIT) && HAVE_DECL_SG_FLAG_UNUSED_LUN_INHIBIT)) +#if defined(SG_FLAG_UNUSED_LUN_INHIBIT) || (defined(HAVE_DECL_SG_FLAG_UNUSED_LUN_INHIBIT) && HAVE_DECL_SG_FLAG_UNUSED_LUN_INHIBIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_FLAG_UNUSED_LUN_INHIBIT) == (2), "SG_FLAG_UNUSED_LUN_INHIBIT != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_FLAG_UNUSED_LUN_INHIBIT 2 #endif -#if !(defined(SG_FLAG_MMAP_IO) || (defined(HAVE_DECL_SG_FLAG_MMAP_IO) && HAVE_DECL_SG_FLAG_MMAP_IO)) +#if defined(SG_FLAG_MMAP_IO) || (defined(HAVE_DECL_SG_FLAG_MMAP_IO) && HAVE_DECL_SG_FLAG_MMAP_IO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_FLAG_MMAP_IO) == (4), "SG_FLAG_MMAP_IO != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_FLAG_MMAP_IO 4 #endif -#if !(defined(SG_FLAG_NO_DXFER) || (defined(HAVE_DECL_SG_FLAG_NO_DXFER) && HAVE_DECL_SG_FLAG_NO_DXFER)) +#if defined(SG_FLAG_NO_DXFER) || (defined(HAVE_DECL_SG_FLAG_NO_DXFER) && HAVE_DECL_SG_FLAG_NO_DXFER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_FLAG_NO_DXFER) == (0x10000), "SG_FLAG_NO_DXFER != 0x10000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_FLAG_NO_DXFER 0x10000 #endif -#if !(defined(SG_FLAG_Q_AT_TAIL) || (defined(HAVE_DECL_SG_FLAG_Q_AT_TAIL) && HAVE_DECL_SG_FLAG_Q_AT_TAIL)) +#if defined(SG_FLAG_Q_AT_TAIL) || (defined(HAVE_DECL_SG_FLAG_Q_AT_TAIL) && HAVE_DECL_SG_FLAG_Q_AT_TAIL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_FLAG_Q_AT_TAIL) == (0x10), "SG_FLAG_Q_AT_TAIL != 0x10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_FLAG_Q_AT_TAIL 0x10 #endif -#if !(defined(SG_FLAG_Q_AT_HEAD) || (defined(HAVE_DECL_SG_FLAG_Q_AT_HEAD) && HAVE_DECL_SG_FLAG_Q_AT_HEAD)) +#if defined(SG_FLAG_Q_AT_HEAD) || (defined(HAVE_DECL_SG_FLAG_Q_AT_HEAD) && HAVE_DECL_SG_FLAG_Q_AT_HEAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_FLAG_Q_AT_HEAD) == (0x20), "SG_FLAG_Q_AT_HEAD != 0x20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_FLAG_Q_AT_HEAD 0x20 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat sg_io_flags[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat sg_io_flags[] = { XLAT(SG_FLAG_DIRECT_IO), XLAT(SG_FLAG_UNUSED_LUN_INHIBIT), @@ -37,4 +67,6 @@ const struct xlat sg_io_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sg_io_info.h b/xlat/sg_io_info.h index 49929be4..af88616d 100644 --- a/xlat/sg_io_info.h +++ b/xlat/sg_io_info.h @@ -1,15 +1,33 @@ /* Generated by ./xlat/gen.sh from ./xlat/sg_io_info.in; do not edit. */ -#if !(defined(SG_INFO_CHECK) || (defined(HAVE_DECL_SG_INFO_CHECK) && HAVE_DECL_SG_INFO_CHECK)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SG_INFO_CHECK) || (defined(HAVE_DECL_SG_INFO_CHECK) && HAVE_DECL_SG_INFO_CHECK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_INFO_CHECK) == (1), "SG_INFO_CHECK != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_INFO_CHECK 1 #endif -#if !(defined(SG_INFO_DIRECT_IO) || (defined(HAVE_DECL_SG_INFO_DIRECT_IO) && HAVE_DECL_SG_INFO_DIRECT_IO)) +#if defined(SG_INFO_DIRECT_IO) || (defined(HAVE_DECL_SG_INFO_DIRECT_IO) && HAVE_DECL_SG_INFO_DIRECT_IO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_INFO_DIRECT_IO) == (2), "SG_INFO_DIRECT_IO != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_INFO_DIRECT_IO 2 #endif -#if !(defined(SG_INFO_MIXED_IO) || (defined(HAVE_DECL_SG_INFO_MIXED_IO) && HAVE_DECL_SG_INFO_MIXED_IO)) +#if defined(SG_INFO_MIXED_IO) || (defined(HAVE_DECL_SG_INFO_MIXED_IO) && HAVE_DECL_SG_INFO_MIXED_IO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_INFO_MIXED_IO) == (4), "SG_INFO_MIXED_IO != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_INFO_MIXED_IO 4 #endif -#ifndef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS const struct xlat sg_io_info[] = { XLAT(SG_INFO_CHECK), @@ -18,4 +36,6 @@ const struct xlat sg_io_info[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sg_scsi_reset.h b/xlat/sg_scsi_reset.h index b33ed1d6..e261fd53 100644 --- a/xlat/sg_scsi_reset.h +++ b/xlat/sg_scsi_reset.h @@ -1,28 +1,58 @@ /* Generated by ./xlat/gen.sh from ./xlat/sg_scsi_reset.in; do not edit. */ -#if !(defined(SG_SCSI_RESET_NOTHING) || (defined(HAVE_DECL_SG_SCSI_RESET_NOTHING) && HAVE_DECL_SG_SCSI_RESET_NOTHING)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SG_SCSI_RESET_NOTHING) || (defined(HAVE_DECL_SG_SCSI_RESET_NOTHING) && HAVE_DECL_SG_SCSI_RESET_NOTHING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_SCSI_RESET_NOTHING) == (0), "SG_SCSI_RESET_NOTHING != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_SCSI_RESET_NOTHING 0 #endif -#if !(defined(SG_SCSI_RESET_DEVICE) || (defined(HAVE_DECL_SG_SCSI_RESET_DEVICE) && HAVE_DECL_SG_SCSI_RESET_DEVICE)) +#if defined(SG_SCSI_RESET_DEVICE) || (defined(HAVE_DECL_SG_SCSI_RESET_DEVICE) && HAVE_DECL_SG_SCSI_RESET_DEVICE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_SCSI_RESET_DEVICE) == (1), "SG_SCSI_RESET_DEVICE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_SCSI_RESET_DEVICE 1 #endif -#if !(defined(SG_SCSI_RESET_BUS) || (defined(HAVE_DECL_SG_SCSI_RESET_BUS) && HAVE_DECL_SG_SCSI_RESET_BUS)) +#if defined(SG_SCSI_RESET_BUS) || (defined(HAVE_DECL_SG_SCSI_RESET_BUS) && HAVE_DECL_SG_SCSI_RESET_BUS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_SCSI_RESET_BUS) == (2), "SG_SCSI_RESET_BUS != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_SCSI_RESET_BUS 2 #endif -#if !(defined(SG_SCSI_RESET_HOST) || (defined(HAVE_DECL_SG_SCSI_RESET_HOST) && HAVE_DECL_SG_SCSI_RESET_HOST)) +#if defined(SG_SCSI_RESET_HOST) || (defined(HAVE_DECL_SG_SCSI_RESET_HOST) && HAVE_DECL_SG_SCSI_RESET_HOST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_SCSI_RESET_HOST) == (3), "SG_SCSI_RESET_HOST != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_SCSI_RESET_HOST 3 #endif -#if !(defined(SG_SCSI_RESET_TARGET) || (defined(HAVE_DECL_SG_SCSI_RESET_TARGET) && HAVE_DECL_SG_SCSI_RESET_TARGET)) +#if defined(SG_SCSI_RESET_TARGET) || (defined(HAVE_DECL_SG_SCSI_RESET_TARGET) && HAVE_DECL_SG_SCSI_RESET_TARGET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_SCSI_RESET_TARGET) == (4), "SG_SCSI_RESET_TARGET != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_SCSI_RESET_TARGET 4 #endif -#if !(defined(SG_SCSI_RESET_NO_ESCALATE) || (defined(HAVE_DECL_SG_SCSI_RESET_NO_ESCALATE) && HAVE_DECL_SG_SCSI_RESET_NO_ESCALATE)) +#if defined(SG_SCSI_RESET_NO_ESCALATE) || (defined(HAVE_DECL_SG_SCSI_RESET_NO_ESCALATE) && HAVE_DECL_SG_SCSI_RESET_NO_ESCALATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SG_SCSI_RESET_NO_ESCALATE) == (0x100), "SG_SCSI_RESET_NO_ESCALATE != 0x100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SG_SCSI_RESET_NO_ESCALATE 0x100 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat sg_scsi_reset in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat sg_scsi_reset in mpers mode + +# else static const struct xlat sg_scsi_reset[] = { @@ -35,4 +65,6 @@ const struct xlat sg_scsi_reset[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/shm_flags.h b/xlat/shm_flags.h index 79e54073..f7f5b38c 100644 --- a/xlat/shm_flags.h +++ b/xlat/shm_flags.h @@ -1,23 +1,39 @@ /* Generated by ./xlat/gen.sh from ./xlat/shm_flags.in; do not edit. */ -#ifdef IN_MPERS - -# error static const struct xlat shm_flags in mpers mode +#include "gcc_compat.h" +#include "static_assert.h" +#if defined(SHM_EXEC) || (defined(HAVE_DECL_SHM_EXEC) && HAVE_DECL_SHM_EXEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SHM_EXEC) == (0100000), "SHM_EXEC != 0100000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE #else +# define SHM_EXEC 0100000 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat shm_flags in mpers mode + +# else static const struct xlat shm_flags[] = { -#if defined(SHM_REMAP) || (defined(HAVE_DECL_SHM_REMAP) && HAVE_DECL_SHM_REMAP) - XLAT(SHM_REMAP), -#endif #if defined(SHM_RDONLY) || (defined(HAVE_DECL_SHM_RDONLY) && HAVE_DECL_SHM_RDONLY) XLAT(SHM_RDONLY), #endif #if defined(SHM_RND) || (defined(HAVE_DECL_SHM_RND) && HAVE_DECL_SHM_RND) XLAT(SHM_RND), #endif +#if defined(SHM_REMAP) || (defined(HAVE_DECL_SHM_REMAP) && HAVE_DECL_SHM_REMAP) + XLAT(SHM_REMAP), +#endif + XLAT(SHM_EXEC), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/shm_flags.in b/xlat/shm_flags.in index a6206347..ef39382f 100644 --- a/xlat/shm_flags.in +++ b/xlat/shm_flags.in @@ -1,3 +1,4 @@ -SHM_REMAP SHM_RDONLY SHM_RND +SHM_REMAP +SHM_EXEC 0100000 diff --git a/xlat/shm_resource_flags.h b/xlat/shm_resource_flags.h index b216b45f..6b703af1 100644 --- a/xlat/shm_resource_flags.h +++ b/xlat/shm_resource_flags.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/shm_resource_flags.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat shm_resource_flags in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat shm_resource_flags in mpers mode + +# else static const struct xlat shm_resource_flags[] = { @@ -16,8 +22,13 @@ const struct xlat shm_resource_flags[] = { #endif #if defined(SHM_HUGETLB) || (defined(HAVE_DECL_SHM_HUGETLB) && HAVE_DECL_SHM_HUGETLB) XLAT(SHM_HUGETLB), +#endif +#if defined(SHM_NORESERVE) || (defined(HAVE_DECL_SHM_NORESERVE) && HAVE_DECL_SHM_NORESERVE) + XLAT(SHM_NORESERVE), #endif XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/shm_resource_flags.in b/xlat/shm_resource_flags.in index f3fc0dc4..1b07687e 100644 --- a/xlat/shm_resource_flags.in +++ b/xlat/shm_resource_flags.in @@ -1,3 +1,4 @@ IPC_CREAT IPC_EXCL SHM_HUGETLB +SHM_NORESERVE diff --git a/xlat/shmctl_flags.h b/xlat/shmctl_flags.h index a5e9f1b8..40ac3aef 100644 --- a/xlat/shmctl_flags.h +++ b/xlat/shmctl_flags.h @@ -1,42 +1,97 @@ /* Generated by ./xlat/gen.sh from ./xlat/shmctl_flags.in; do not edit. */ -#if !(defined(SHM_STAT) || (defined(HAVE_DECL_SHM_STAT) && HAVE_DECL_SHM_STAT)) -# define SHM_STAT 13 -#endif -#if !(defined(SHM_INFO) || (defined(HAVE_DECL_SHM_INFO) && HAVE_DECL_SHM_INFO)) -# define SHM_INFO 14 -#endif - -#ifdef IN_MPERS -extern const struct xlat shmctl_flags[]; - -#else +#include "gcc_compat.h" +#include "static_assert.h" -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) -static -# endif -const struct xlat shmctl_flags[] = { #if defined(IPC_RMID) || (defined(HAVE_DECL_IPC_RMID) && HAVE_DECL_IPC_RMID) - XLAT(IPC_RMID), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPC_RMID) == (0), "IPC_RMID != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPC_RMID 0 #endif #if defined(IPC_SET) || (defined(HAVE_DECL_IPC_SET) && HAVE_DECL_IPC_SET) - XLAT(IPC_SET), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPC_SET) == (1), "IPC_SET != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPC_SET 1 #endif #if defined(IPC_STAT) || (defined(HAVE_DECL_IPC_STAT) && HAVE_DECL_IPC_STAT) - XLAT(IPC_STAT), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPC_STAT) == (2), "IPC_STAT != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPC_STAT 2 #endif #if defined(IPC_INFO) || (defined(HAVE_DECL_IPC_INFO) && HAVE_DECL_IPC_INFO) - XLAT(IPC_INFO), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPC_INFO) == (3), "IPC_INFO != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPC_INFO 3 #endif - XLAT(SHM_STAT), - XLAT(SHM_INFO), #if defined(SHM_LOCK) || (defined(HAVE_DECL_SHM_LOCK) && HAVE_DECL_SHM_LOCK) - XLAT(SHM_LOCK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SHM_LOCK) == (11), "SHM_LOCK != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SHM_LOCK 11 #endif #if defined(SHM_UNLOCK) || (defined(HAVE_DECL_SHM_UNLOCK) && HAVE_DECL_SHM_UNLOCK) - XLAT(SHM_UNLOCK), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SHM_UNLOCK) == (12), "SHM_UNLOCK != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SHM_UNLOCK 12 +#endif +#if defined(SHM_STAT) || (defined(HAVE_DECL_SHM_STAT) && HAVE_DECL_SHM_STAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SHM_STAT) == (13), "SHM_STAT != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SHM_STAT 13 +#endif +#if defined(SHM_INFO) || (defined(HAVE_DECL_SHM_INFO) && HAVE_DECL_SHM_INFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SHM_INFO) == (14), "SHM_INFO != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SHM_INFO 14 #endif +#if defined(SHM_STAT_ANY) || (defined(HAVE_DECL_SHM_STAT_ANY) && HAVE_DECL_SHM_STAT_ANY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SHM_STAT_ANY) == (15), "SHM_STAT_ANY != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SHM_STAT_ANY 15 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +extern const struct xlat shmctl_flags[]; + +# else + +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +static +# endif +const struct xlat shmctl_flags[] = { + + XLAT(IPC_RMID), + XLAT(IPC_SET), + XLAT(IPC_STAT), + XLAT(IPC_INFO), + XLAT(SHM_LOCK), + XLAT(SHM_UNLOCK), + XLAT(SHM_STAT), + XLAT(SHM_INFO), + XLAT(SHM_STAT_ANY), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/shmctl_flags.in b/xlat/shmctl_flags.in index 08908bb3..b7943064 100644 --- a/xlat/shmctl_flags.in +++ b/xlat/shmctl_flags.in @@ -1,8 +1,10 @@ -IPC_RMID -IPC_SET -IPC_STAT -IPC_INFO +/* sort -k2,2g */ +IPC_RMID 0 +IPC_SET 1 +IPC_STAT 2 +IPC_INFO 3 +SHM_LOCK 11 +SHM_UNLOCK 12 SHM_STAT 13 SHM_INFO 14 -SHM_LOCK -SHM_UNLOCK +SHM_STAT_ANY 15 diff --git a/xlat/shutdown_modes.h b/xlat/shutdown_modes.h index f34cb6b7..2662c369 100644 --- a/xlat/shutdown_modes.h +++ b/xlat/shutdown_modes.h @@ -1,19 +1,37 @@ /* Generated by ./xlat/gen.sh from ./xlat/shutdown_modes.in; do not edit. */ -#if !(defined(SHUT_RD) || (defined(HAVE_DECL_SHUT_RD) && HAVE_DECL_SHUT_RD)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SHUT_RD) || (defined(HAVE_DECL_SHUT_RD) && HAVE_DECL_SHUT_RD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SHUT_RD) == (0), "SHUT_RD != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SHUT_RD 0 #endif -#if !(defined(SHUT_WR) || (defined(HAVE_DECL_SHUT_WR) && HAVE_DECL_SHUT_WR)) +#if defined(SHUT_WR) || (defined(HAVE_DECL_SHUT_WR) && HAVE_DECL_SHUT_WR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SHUT_WR) == (1), "SHUT_WR != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SHUT_WR 1 #endif -#if !(defined(SHUT_RDWR) || (defined(HAVE_DECL_SHUT_RDWR) && HAVE_DECL_SHUT_RDWR)) +#if defined(SHUT_RDWR) || (defined(HAVE_DECL_SHUT_RDWR) && HAVE_DECL_SHUT_RDWR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SHUT_RDWR) == (2), "SHUT_RDWR != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SHUT_RDWR 2 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat shutdown_modes in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat shutdown_modes in mpers mode + +# else static const struct xlat shutdown_modes[] = { @@ -23,4 +41,6 @@ const struct xlat shutdown_modes[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sigact_flags.h b/xlat/sigact_flags.h index 31debc49..14bb0128 100644 --- a/xlat/sigact_flags.h +++ b/xlat/sigact_flags.h @@ -1,22 +1,28 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigact_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + #if defined SA_NOMASK && SA_NODEFER != SA_NOMASK #endif #if defined SA_ONESHOT && SA_ONESHOT != SA_RESETHAND #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS -# error static const struct xlat sigact_flags in mpers mode +# error static const struct xlat sigact_flags in mpers mode -#else +# else static const struct xlat sigact_flags[] = { #if defined(SA_RESTORER) || (defined(HAVE_DECL_SA_RESTORER) && HAVE_DECL_SA_RESTORER) XLAT(SA_RESTORER), #endif -#if defined(SA_STACK) || (defined(HAVE_DECL_SA_STACK) && HAVE_DECL_SA_STACK) - XLAT(SA_STACK), +#if defined(SA_ONSTACK) || (defined(HAVE_DECL_SA_ONSTACK) && HAVE_DECL_SA_ONSTACK) + XLAT(SA_ONSTACK), #endif #if defined(SA_RESTART) || (defined(HAVE_DECL_SA_RESTART) && HAVE_DECL_SA_RESTART) XLAT(SA_RESTART), @@ -67,4 +73,6 @@ const struct xlat sigact_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sigact_flags.in b/xlat/sigact_flags.in index 27bcff8a..00ad9431 100644 --- a/xlat/sigact_flags.in +++ b/xlat/sigact_flags.in @@ -1,5 +1,5 @@ SA_RESTORER -SA_STACK +SA_ONSTACK SA_RESTART SA_INTERRUPT SA_NODEFER diff --git a/xlat/sigaltstack_flags.h b/xlat/sigaltstack_flags.h index 76ed327d..68359b45 100644 --- a/xlat/sigaltstack_flags.h +++ b/xlat/sigaltstack_flags.h @@ -1,23 +1,41 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigaltstack_flags.in; do not edit. */ -#if !(defined(SS_ONSTACK) || (defined(HAVE_DECL_SS_ONSTACK) && HAVE_DECL_SS_ONSTACK)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SS_ONSTACK) || (defined(HAVE_DECL_SS_ONSTACK) && HAVE_DECL_SS_ONSTACK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SS_ONSTACK) == (1), "SS_ONSTACK != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SS_ONSTACK 1 #endif -#if !(defined(SS_DISABLE) || (defined(HAVE_DECL_SS_DISABLE) && HAVE_DECL_SS_DISABLE)) +#if defined(SS_DISABLE) || (defined(HAVE_DECL_SS_DISABLE) && HAVE_DECL_SS_DISABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SS_DISABLE) == (2), "SS_DISABLE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SS_DISABLE 2 #endif -#if !(defined(SS_AUTODISARM) || (defined(HAVE_DECL_SS_AUTODISARM) && HAVE_DECL_SS_AUTODISARM)) +#if defined(SS_AUTODISARM) || (defined(HAVE_DECL_SS_AUTODISARM) && HAVE_DECL_SS_AUTODISARM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SS_AUTODISARM) == ((1U << 31)), "SS_AUTODISARM != (1U << 31)"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SS_AUTODISARM (1U << 31) #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat sigaltstack_flags[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat sigaltstack_flags[] = { XLAT(SS_ONSTACK), XLAT(SS_DISABLE), @@ -25,4 +43,6 @@ const struct xlat sigaltstack_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sigbus_codes.h b/xlat/sigbus_codes.h index 4ad49ab7..42123568 100644 --- a/xlat/sigbus_codes.h +++ b/xlat/sigbus_codes.h @@ -1,36 +1,67 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigbus_codes.in; do not edit. */ -#if !(defined(BUS_ADRALN) || (defined(HAVE_DECL_BUS_ADRALN) && HAVE_DECL_BUS_ADRALN)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BUS_ADRALN) || (defined(HAVE_DECL_BUS_ADRALN) && HAVE_DECL_BUS_ADRALN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BUS_ADRALN) == (1), "BUS_ADRALN != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BUS_ADRALN 1 #endif -#if !(defined(BUS_ADRERR) || (defined(HAVE_DECL_BUS_ADRERR) && HAVE_DECL_BUS_ADRERR)) +#if defined(BUS_ADRERR) || (defined(HAVE_DECL_BUS_ADRERR) && HAVE_DECL_BUS_ADRERR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BUS_ADRERR) == (2), "BUS_ADRERR != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BUS_ADRERR 2 #endif -#if !(defined(BUS_OBJERR) || (defined(HAVE_DECL_BUS_OBJERR) && HAVE_DECL_BUS_OBJERR)) +#if defined(BUS_OBJERR) || (defined(HAVE_DECL_BUS_OBJERR) && HAVE_DECL_BUS_OBJERR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BUS_OBJERR) == (3), "BUS_OBJERR != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BUS_OBJERR 3 #endif -#if !(defined(BUS_MCEERR_AR) || (defined(HAVE_DECL_BUS_MCEERR_AR) && HAVE_DECL_BUS_MCEERR_AR)) +#if defined(BUS_MCEERR_AR) || (defined(HAVE_DECL_BUS_MCEERR_AR) && HAVE_DECL_BUS_MCEERR_AR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BUS_MCEERR_AR) == (4), "BUS_MCEERR_AR != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BUS_MCEERR_AR 4 #endif -#if !(defined(BUS_MCEERR_AO) || (defined(HAVE_DECL_BUS_MCEERR_AO) && HAVE_DECL_BUS_MCEERR_AO)) +#if defined(BUS_MCEERR_AO) || (defined(HAVE_DECL_BUS_MCEERR_AO) && HAVE_DECL_BUS_MCEERR_AO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BUS_MCEERR_AO) == (5), "BUS_MCEERR_AO != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define BUS_MCEERR_AO 5 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat sigbus_codes[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat sigbus_codes[] = { XLAT(BUS_ADRALN), XLAT(BUS_ADRERR), XLAT(BUS_OBJERR), +#if defined(BUS_OPFETCH) || (defined(HAVE_DECL_BUS_OPFETCH) && HAVE_DECL_BUS_OPFETCH) + XLAT(BUS_OPFETCH), +#endif XLAT(BUS_MCEERR_AR), XLAT(BUS_MCEERR_AO), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sigbus_codes.in b/xlat/sigbus_codes.in index 1bce25f2..54f1b433 100644 --- a/xlat/sigbus_codes.in +++ b/xlat/sigbus_codes.in @@ -1,5 +1,6 @@ BUS_ADRALN 1 BUS_ADRERR 2 BUS_OBJERR 3 +BUS_OPFETCH /* 4 - bfin */ BUS_MCEERR_AR 4 BUS_MCEERR_AO 5 diff --git a/xlat/sigchld_codes.h b/xlat/sigchld_codes.h index e1bf046d..515eb2cd 100644 --- a/xlat/sigchld_codes.h +++ b/xlat/sigchld_codes.h @@ -1,32 +1,62 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigchld_codes.in; do not edit. */ -#if !(defined(CLD_EXITED) || (defined(HAVE_DECL_CLD_EXITED) && HAVE_DECL_CLD_EXITED)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(CLD_EXITED) || (defined(HAVE_DECL_CLD_EXITED) && HAVE_DECL_CLD_EXITED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLD_EXITED) == (1), "CLD_EXITED != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLD_EXITED 1 #endif -#if !(defined(CLD_KILLED) || (defined(HAVE_DECL_CLD_KILLED) && HAVE_DECL_CLD_KILLED)) +#if defined(CLD_KILLED) || (defined(HAVE_DECL_CLD_KILLED) && HAVE_DECL_CLD_KILLED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLD_KILLED) == (2), "CLD_KILLED != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLD_KILLED 2 #endif -#if !(defined(CLD_DUMPED) || (defined(HAVE_DECL_CLD_DUMPED) && HAVE_DECL_CLD_DUMPED)) +#if defined(CLD_DUMPED) || (defined(HAVE_DECL_CLD_DUMPED) && HAVE_DECL_CLD_DUMPED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLD_DUMPED) == (3), "CLD_DUMPED != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLD_DUMPED 3 #endif -#if !(defined(CLD_TRAPPED) || (defined(HAVE_DECL_CLD_TRAPPED) && HAVE_DECL_CLD_TRAPPED)) +#if defined(CLD_TRAPPED) || (defined(HAVE_DECL_CLD_TRAPPED) && HAVE_DECL_CLD_TRAPPED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLD_TRAPPED) == (4), "CLD_TRAPPED != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLD_TRAPPED 4 #endif -#if !(defined(CLD_STOPPED) || (defined(HAVE_DECL_CLD_STOPPED) && HAVE_DECL_CLD_STOPPED)) +#if defined(CLD_STOPPED) || (defined(HAVE_DECL_CLD_STOPPED) && HAVE_DECL_CLD_STOPPED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLD_STOPPED) == (5), "CLD_STOPPED != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLD_STOPPED 5 #endif -#if !(defined(CLD_CONTINUED) || (defined(HAVE_DECL_CLD_CONTINUED) && HAVE_DECL_CLD_CONTINUED)) +#if defined(CLD_CONTINUED) || (defined(HAVE_DECL_CLD_CONTINUED) && HAVE_DECL_CLD_CONTINUED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CLD_CONTINUED) == (6), "CLD_CONTINUED != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define CLD_CONTINUED 6 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat sigchld_codes[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat sigchld_codes[] = { XLAT(CLD_EXITED), XLAT(CLD_KILLED), @@ -37,4 +67,6 @@ const struct xlat sigchld_codes[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sigemt_codes.h b/xlat/sigemt_codes.h index 68f6fb4d..0938327d 100644 --- a/xlat/sigemt_codes.h +++ b/xlat/sigemt_codes.h @@ -1,20 +1,32 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigemt_codes.in; do not edit. */ -#if !(defined(EMT_TAGOVF) || (defined(HAVE_DECL_EMT_TAGOVF) && HAVE_DECL_EMT_TAGOVF)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(EMT_TAGOVF) || (defined(HAVE_DECL_EMT_TAGOVF) && HAVE_DECL_EMT_TAGOVF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((EMT_TAGOVF) == (1), "EMT_TAGOVF != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define EMT_TAGOVF 1 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat sigemt_codes[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat sigemt_codes[] = { XLAT(EMT_TAGOVF), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sigev_value.h b/xlat/sigev_value.h index 7c569a5a..c9069d57 100644 --- a/xlat/sigev_value.h +++ b/xlat/sigev_value.h @@ -1,26 +1,48 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigev_value.in; do not edit. */ -#if !(defined(SIGEV_SIGNAL) || (defined(HAVE_DECL_SIGEV_SIGNAL) && HAVE_DECL_SIGEV_SIGNAL)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SIGEV_SIGNAL) || (defined(HAVE_DECL_SIGEV_SIGNAL) && HAVE_DECL_SIGEV_SIGNAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SIGEV_SIGNAL) == (0), "SIGEV_SIGNAL != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SIGEV_SIGNAL 0 #endif -#if !(defined(SIGEV_NONE) || (defined(HAVE_DECL_SIGEV_NONE) && HAVE_DECL_SIGEV_NONE)) +#if defined(SIGEV_NONE) || (defined(HAVE_DECL_SIGEV_NONE) && HAVE_DECL_SIGEV_NONE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SIGEV_NONE) == (1), "SIGEV_NONE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SIGEV_NONE 1 #endif -#if !(defined(SIGEV_THREAD) || (defined(HAVE_DECL_SIGEV_THREAD) && HAVE_DECL_SIGEV_THREAD)) +#if defined(SIGEV_THREAD) || (defined(HAVE_DECL_SIGEV_THREAD) && HAVE_DECL_SIGEV_THREAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SIGEV_THREAD) == (2), "SIGEV_THREAD != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SIGEV_THREAD 2 #endif -#if !(defined(SIGEV_THREAD_ID) || (defined(HAVE_DECL_SIGEV_THREAD_ID) && HAVE_DECL_SIGEV_THREAD_ID)) +#if defined(SIGEV_THREAD_ID) || (defined(HAVE_DECL_SIGEV_THREAD_ID) && HAVE_DECL_SIGEV_THREAD_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SIGEV_THREAD_ID) == (4), "SIGEV_THREAD_ID != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SIGEV_THREAD_ID 4 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat sigev_value[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat sigev_value[] = { XLAT(SIGEV_SIGNAL), XLAT(SIGEV_NONE), @@ -29,4 +51,6 @@ const struct xlat sigev_value[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sigfpe_codes.h b/xlat/sigfpe_codes.h index c9e29597..eab8237d 100644 --- a/xlat/sigfpe_codes.h +++ b/xlat/sigfpe_codes.h @@ -1,38 +1,90 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigfpe_codes.in; do not edit. */ -#if !(defined(FPE_INTDIV) || (defined(HAVE_DECL_FPE_INTDIV) && HAVE_DECL_FPE_INTDIV)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(FPE_INTDIV) || (defined(HAVE_DECL_FPE_INTDIV) && HAVE_DECL_FPE_INTDIV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FPE_INTDIV) == (1), "FPE_INTDIV != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FPE_INTDIV 1 #endif -#if !(defined(FPE_INTOVF) || (defined(HAVE_DECL_FPE_INTOVF) && HAVE_DECL_FPE_INTOVF)) +#if defined(FPE_INTOVF) || (defined(HAVE_DECL_FPE_INTOVF) && HAVE_DECL_FPE_INTOVF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FPE_INTOVF) == (2), "FPE_INTOVF != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FPE_INTOVF 2 #endif -#if !(defined(FPE_FLTDIV) || (defined(HAVE_DECL_FPE_FLTDIV) && HAVE_DECL_FPE_FLTDIV)) +#if defined(FPE_FLTDIV) || (defined(HAVE_DECL_FPE_FLTDIV) && HAVE_DECL_FPE_FLTDIV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FPE_FLTDIV) == (3), "FPE_FLTDIV != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FPE_FLTDIV 3 #endif -#if !(defined(FPE_FLTOVF) || (defined(HAVE_DECL_FPE_FLTOVF) && HAVE_DECL_FPE_FLTOVF)) +#if defined(FPE_FLTOVF) || (defined(HAVE_DECL_FPE_FLTOVF) && HAVE_DECL_FPE_FLTOVF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FPE_FLTOVF) == (4), "FPE_FLTOVF != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FPE_FLTOVF 4 #endif -#if !(defined(FPE_FLTUND) || (defined(HAVE_DECL_FPE_FLTUND) && HAVE_DECL_FPE_FLTUND)) +#if defined(FPE_FLTUND) || (defined(HAVE_DECL_FPE_FLTUND) && HAVE_DECL_FPE_FLTUND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FPE_FLTUND) == (5), "FPE_FLTUND != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FPE_FLTUND 5 #endif -#if !(defined(FPE_FLTRES) || (defined(HAVE_DECL_FPE_FLTRES) && HAVE_DECL_FPE_FLTRES)) +#if defined(FPE_FLTRES) || (defined(HAVE_DECL_FPE_FLTRES) && HAVE_DECL_FPE_FLTRES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FPE_FLTRES) == (6), "FPE_FLTRES != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FPE_FLTRES 6 #endif -#if !(defined(FPE_FLTINV) || (defined(HAVE_DECL_FPE_FLTINV) && HAVE_DECL_FPE_FLTINV)) +#if defined(FPE_FLTINV) || (defined(HAVE_DECL_FPE_FLTINV) && HAVE_DECL_FPE_FLTINV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FPE_FLTINV) == (7), "FPE_FLTINV != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FPE_FLTINV 7 #endif -#if !(defined(FPE_FLTSUB) || (defined(HAVE_DECL_FPE_FLTSUB) && HAVE_DECL_FPE_FLTSUB)) +#if defined(FPE_FLTSUB) || (defined(HAVE_DECL_FPE_FLTSUB) && HAVE_DECL_FPE_FLTSUB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FPE_FLTSUB) == (8), "FPE_FLTSUB != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define FPE_FLTSUB 8 #endif +#if defined(FPE_FLTUNK) || (defined(HAVE_DECL_FPE_FLTUNK) && HAVE_DECL_FPE_FLTUNK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FPE_FLTUNK) == (14), "FPE_FLTUNK != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FPE_FLTUNK 14 +#endif +#if defined(FPE_CONDTRAP) || (defined(HAVE_DECL_FPE_CONDTRAP) && HAVE_DECL_FPE_CONDTRAP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((FPE_CONDTRAP) == (15), "FPE_CONDTRAP != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define FPE_CONDTRAP 15 +#endif + +#ifndef XLAT_MACROS_ONLY -#ifdef IN_MPERS +# ifdef IN_MPERS extern const struct xlat sigfpe_codes[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat sigfpe_codes[] = { XLAT(FPE_INTDIV), XLAT(FPE_INTOVF), @@ -42,7 +94,29 @@ const struct xlat sigfpe_codes[] = { XLAT(FPE_FLTRES), XLAT(FPE_FLTINV), XLAT(FPE_FLTSUB), +#if defined(FPE_MDAOVF) || (defined(HAVE_DECL_FPE_MDAOVF) && HAVE_DECL_FPE_MDAOVF) + XLAT(FPE_MDAOVF), +#endif +#if defined(__FPE_DECOVF) || (defined(HAVE_DECL___FPE_DECOVF) && HAVE_DECL___FPE_DECOVF) + XLAT(__FPE_DECOVF), +#endif +#if defined(__FPE_DECDIV) || (defined(HAVE_DECL___FPE_DECDIV) && HAVE_DECL___FPE_DECDIV) + XLAT(__FPE_DECDIV), +#endif +#if defined(__FPE_DECERR) || (defined(HAVE_DECL___FPE_DECERR) && HAVE_DECL___FPE_DECERR) + XLAT(__FPE_DECERR), +#endif +#if defined(__FPE_INVASC) || (defined(HAVE_DECL___FPE_INVASC) && HAVE_DECL___FPE_INVASC) + XLAT(__FPE_INVASC), +#endif +#if defined(__FPE_INVDEC) || (defined(HAVE_DECL___FPE_INVDEC) && HAVE_DECL___FPE_INVDEC) + XLAT(__FPE_INVDEC), +#endif + XLAT(FPE_FLTUNK), + XLAT(FPE_CONDTRAP), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sigfpe_codes.in b/xlat/sigfpe_codes.in index 4ef0667a..4abd621a 100644 --- a/xlat/sigfpe_codes.in +++ b/xlat/sigfpe_codes.in @@ -6,3 +6,11 @@ FPE_FLTUND 5 FPE_FLTRES 6 FPE_FLTINV 7 FPE_FLTSUB 8 +FPE_MDAOVF /* 9 - frv */ +__FPE_DECOVF /* 9 - ia64 */ +__FPE_DECDIV /* 10 - ia64 */ +__FPE_DECERR /* 11 - ia64 */ +__FPE_INVASC /* 12 - ia64 */ +__FPE_INVDEC /* 13 - ia64 */ +FPE_FLTUNK 14 +FPE_CONDTRAP 15 diff --git a/xlat/sigill_codes.h b/xlat/sigill_codes.h index f16a69c8..74eaea09 100644 --- a/xlat/sigill_codes.h +++ b/xlat/sigill_codes.h @@ -1,48 +1,118 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigill_codes.in; do not edit. */ -#if !(defined(ILL_ILLOPC) || (defined(HAVE_DECL_ILL_ILLOPC) && HAVE_DECL_ILL_ILLOPC)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(ILL_ILLOPC) || (defined(HAVE_DECL_ILL_ILLOPC) && HAVE_DECL_ILL_ILLOPC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ILL_ILLOPC) == (1), "ILL_ILLOPC != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define ILL_ILLOPC 1 #endif -#if !(defined(ILL_ILLOPN) || (defined(HAVE_DECL_ILL_ILLOPN) && HAVE_DECL_ILL_ILLOPN)) +#if defined(ILL_ILLOPN) || (defined(HAVE_DECL_ILL_ILLOPN) && HAVE_DECL_ILL_ILLOPN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ILL_ILLOPN) == (2), "ILL_ILLOPN != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define ILL_ILLOPN 2 #endif -#if !(defined(ILL_ILLADR) || (defined(HAVE_DECL_ILL_ILLADR) && HAVE_DECL_ILL_ILLADR)) +#if defined(ILL_ILLADR) || (defined(HAVE_DECL_ILL_ILLADR) && HAVE_DECL_ILL_ILLADR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ILL_ILLADR) == (3), "ILL_ILLADR != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define ILL_ILLADR 3 #endif -#if !(defined(ILL_ILLTRP) || (defined(HAVE_DECL_ILL_ILLTRP) && HAVE_DECL_ILL_ILLTRP)) +#if defined(ILL_ILLTRP) || (defined(HAVE_DECL_ILL_ILLTRP) && HAVE_DECL_ILL_ILLTRP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ILL_ILLTRP) == (4), "ILL_ILLTRP != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define ILL_ILLTRP 4 #endif -#if !(defined(ILL_PRVOPC) || (defined(HAVE_DECL_ILL_PRVOPC) && HAVE_DECL_ILL_PRVOPC)) +#if defined(ILL_PRVOPC) || (defined(HAVE_DECL_ILL_PRVOPC) && HAVE_DECL_ILL_PRVOPC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ILL_PRVOPC) == (5), "ILL_PRVOPC != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define ILL_PRVOPC 5 #endif -#if !(defined(ILL_PRVREG) || (defined(HAVE_DECL_ILL_PRVREG) && HAVE_DECL_ILL_PRVREG)) +#if defined(ILL_PRVREG) || (defined(HAVE_DECL_ILL_PRVREG) && HAVE_DECL_ILL_PRVREG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ILL_PRVREG) == (6), "ILL_PRVREG != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define ILL_PRVREG 6 #endif -#if !(defined(ILL_COPROC) || (defined(HAVE_DECL_ILL_COPROC) && HAVE_DECL_ILL_COPROC)) +#if defined(ILL_COPROC) || (defined(HAVE_DECL_ILL_COPROC) && HAVE_DECL_ILL_COPROC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ILL_COPROC) == (7), "ILL_COPROC != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define ILL_COPROC 7 #endif -#if !(defined(ILL_BADSTK) || (defined(HAVE_DECL_ILL_BADSTK) && HAVE_DECL_ILL_BADSTK)) +#if defined(ILL_BADSTK) || (defined(HAVE_DECL_ILL_BADSTK) && HAVE_DECL_ILL_BADSTK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ILL_BADSTK) == (8), "ILL_BADSTK != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define ILL_BADSTK 8 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat sigill_codes[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat sigill_codes[] = { XLAT(ILL_ILLOPC), +#if defined(ILL_ILLPARAOP) || (defined(HAVE_DECL_ILL_ILLPARAOP) && HAVE_DECL_ILL_ILLPARAOP) + XLAT(ILL_ILLPARAOP), +#endif XLAT(ILL_ILLOPN), XLAT(ILL_ILLADR), +#if defined(ILL_ILLEXCPT) || (defined(HAVE_DECL_ILL_ILLEXCPT) && HAVE_DECL_ILL_ILLEXCPT) + XLAT(ILL_ILLEXCPT), +#endif XLAT(ILL_ILLTRP), XLAT(ILL_PRVOPC), XLAT(ILL_PRVREG), XLAT(ILL_COPROC), XLAT(ILL_BADSTK), +#if defined(ILL_CPLB_VI) || (defined(HAVE_DECL_ILL_CPLB_VI) && HAVE_DECL_ILL_CPLB_VI) + XLAT(ILL_CPLB_VI), +#endif +#if defined(ILL_CPLB_MISS) || (defined(HAVE_DECL_ILL_CPLB_MISS) && HAVE_DECL_ILL_CPLB_MISS) + XLAT(ILL_CPLB_MISS), +#endif +#if defined(ILL_CPLB_MULHIT) || (defined(HAVE_DECL_ILL_CPLB_MULHIT) && HAVE_DECL_ILL_CPLB_MULHIT) + XLAT(ILL_CPLB_MULHIT), +#endif +#if defined(ILL_DBLFLT) || (defined(HAVE_DECL_ILL_DBLFLT) && HAVE_DECL_ILL_DBLFLT) + XLAT(ILL_DBLFLT), +#endif +#if defined(ILL_HARDWALL) || (defined(HAVE_DECL_ILL_HARDWALL) && HAVE_DECL_ILL_HARDWALL) + XLAT(ILL_HARDWALL), +#endif +#if defined(ILL_BADIADDR) || (defined(HAVE_DECL_ILL_BADIADDR) && HAVE_DECL_ILL_BADIADDR) + XLAT(ILL_BADIADDR), +#endif +#if defined(__ILL_BREAK) || (defined(HAVE_DECL___ILL_BREAK) && HAVE_DECL___ILL_BREAK) + XLAT(__ILL_BREAK), +#endif +#if defined(__ILL_BNDMOD) || (defined(HAVE_DECL___ILL_BNDMOD) && HAVE_DECL___ILL_BNDMOD) + XLAT(__ILL_BNDMOD), +#endif XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sigill_codes.in b/xlat/sigill_codes.in index ca111ec8..12cd2cfa 100644 --- a/xlat/sigill_codes.in +++ b/xlat/sigill_codes.in @@ -1,8 +1,18 @@ ILL_ILLOPC 1 +ILL_ILLPARAOP /* 2 - bfin */ ILL_ILLOPN 2 ILL_ILLADR 3 +ILL_ILLEXCPT /* 4 - bfin */ ILL_ILLTRP 4 ILL_PRVOPC 5 ILL_PRVREG 6 ILL_COPROC 7 ILL_BADSTK 8 +ILL_CPLB_VI /* 9 - bfin */ +ILL_CPLB_MISS /* 10 - bfin */ +ILL_CPLB_MULHIT /* 11 - bfin */ +ILL_DBLFLT /* 9 - tile */ +ILL_HARDWALL /* 10 - tile */ +ILL_BADIADDR /* 9 - ia64 */ +__ILL_BREAK /* 10 - ia64 */ +__ILL_BNDMOD /* 11 - ia64 */ diff --git a/xlat/siginfo_codes.h b/xlat/siginfo_codes.h index faef6c79..74c577b2 100644 --- a/xlat/siginfo_codes.h +++ b/xlat/siginfo_codes.h @@ -1,62 +1,149 @@ /* Generated by ./xlat/gen.sh from ./xlat/siginfo_codes.in; do not edit. */ -#if !(defined(SI_USER) || (defined(HAVE_DECL_SI_USER) && HAVE_DECL_SI_USER)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SI_USER) || (defined(HAVE_DECL_SI_USER) && HAVE_DECL_SI_USER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SI_USER) == (0), "SI_USER != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SI_USER 0 #endif -#if !(defined(SI_KERNEL) || (defined(HAVE_DECL_SI_KERNEL) && HAVE_DECL_SI_KERNEL)) +#if defined(SI_KERNEL) || (defined(HAVE_DECL_SI_KERNEL) && HAVE_DECL_SI_KERNEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SI_KERNEL) == (0x80), "SI_KERNEL != 0x80"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SI_KERNEL 0x80 #endif -#if !(defined(SI_QUEUE) || (defined(HAVE_DECL_SI_QUEUE) && HAVE_DECL_SI_QUEUE)) +#if defined(SI_QUEUE) || (defined(HAVE_DECL_SI_QUEUE) && HAVE_DECL_SI_QUEUE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SI_QUEUE) == (-1), "SI_QUEUE != -1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SI_QUEUE -1 #endif -#if !(defined(SI_TIMER) || (defined(HAVE_DECL_SI_TIMER) && HAVE_DECL_SI_TIMER)) +#ifdef __mips__ +#if defined(SI_ASYNCIO) || (defined(HAVE_DECL_SI_ASYNCIO) && HAVE_DECL_SI_ASYNCIO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SI_ASYNCIO) == (-2), "SI_ASYNCIO != -2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SI_ASYNCIO -2 +#endif +#if defined(SI_TIMER) || (defined(HAVE_DECL_SI_TIMER) && HAVE_DECL_SI_TIMER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SI_TIMER) == (-3), "SI_TIMER != -3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SI_TIMER -3 +#endif +#if defined(SI_MESGQ) || (defined(HAVE_DECL_SI_MESGQ) && HAVE_DECL_SI_MESGQ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SI_MESGQ) == (-4), "SI_MESGQ != -4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SI_MESGQ -4 +#endif +#else +#if defined(SI_TIMER) || (defined(HAVE_DECL_SI_TIMER) && HAVE_DECL_SI_TIMER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SI_TIMER) == (-2), "SI_TIMER != -2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SI_TIMER -2 #endif -#if !(defined(SI_MESGQ) || (defined(HAVE_DECL_SI_MESGQ) && HAVE_DECL_SI_MESGQ)) +#if defined(SI_MESGQ) || (defined(HAVE_DECL_SI_MESGQ) && HAVE_DECL_SI_MESGQ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SI_MESGQ) == (-3), "SI_MESGQ != -3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SI_MESGQ -3 #endif -#if !(defined(SI_ASYNCIO) || (defined(HAVE_DECL_SI_ASYNCIO) && HAVE_DECL_SI_ASYNCIO)) +#if defined(SI_ASYNCIO) || (defined(HAVE_DECL_SI_ASYNCIO) && HAVE_DECL_SI_ASYNCIO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SI_ASYNCIO) == (-4), "SI_ASYNCIO != -4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SI_ASYNCIO -4 #endif -#if !(defined(SI_SIGIO) || (defined(HAVE_DECL_SI_SIGIO) && HAVE_DECL_SI_SIGIO)) +#endif +#if defined(SI_SIGIO) || (defined(HAVE_DECL_SI_SIGIO) && HAVE_DECL_SI_SIGIO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SI_SIGIO) == (-5), "SI_SIGIO != -5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SI_SIGIO -5 #endif -#if !(defined(SI_TKILL) || (defined(HAVE_DECL_SI_TKILL) && HAVE_DECL_SI_TKILL)) +#if defined(SI_TKILL) || (defined(HAVE_DECL_SI_TKILL) && HAVE_DECL_SI_TKILL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SI_TKILL) == (-6), "SI_TKILL != -6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SI_TKILL -6 #endif -#if !(defined(SI_DETHREAD) || (defined(HAVE_DECL_SI_DETHREAD) && HAVE_DECL_SI_DETHREAD)) +#if defined(SI_DETHREAD) || (defined(HAVE_DECL_SI_DETHREAD) && HAVE_DECL_SI_DETHREAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SI_DETHREAD) == (-7), "SI_DETHREAD != -7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SI_DETHREAD -7 #endif -#if !(defined(SI_ASYNCNL) || (defined(HAVE_DECL_SI_ASYNCNL) && HAVE_DECL_SI_ASYNCNL)) +#if defined(SI_ASYNCNL) || (defined(HAVE_DECL_SI_ASYNCNL) && HAVE_DECL_SI_ASYNCNL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SI_ASYNCNL) == (-60), "SI_ASYNCNL != -60"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SI_ASYNCNL -60 #endif +#ifdef __sparc__ +#if defined(SI_NOINFO) || (defined(HAVE_DECL_SI_NOINFO) && HAVE_DECL_SI_NOINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SI_NOINFO) == (32767), "SI_NOINFO != 32767"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SI_NOINFO 32767 +#endif +#endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat siginfo_codes[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat siginfo_codes[] = { XLAT(SI_USER), XLAT(SI_KERNEL), XLAT(SI_QUEUE), + +#ifdef __mips__ + XLAT(SI_ASYNCIO), + XLAT(SI_TIMER), + XLAT(SI_MESGQ), +#else XLAT(SI_TIMER), XLAT(SI_MESGQ), XLAT(SI_ASYNCIO), +#endif + XLAT(SI_SIGIO), XLAT(SI_TKILL), XLAT(SI_DETHREAD), XLAT(SI_ASYNCNL), -#if defined(SI_NOINFO) || (defined(HAVE_DECL_SI_NOINFO) && HAVE_DECL_SI_NOINFO) - XLAT(SI_NOINFO), -#endif -#if defined(SI_LWP) || (defined(HAVE_DECL_SI_LWP) && HAVE_DECL_SI_LWP) - XLAT(SI_LWP), + +#ifdef __sparc__ + XLAT(SI_NOINFO), #endif XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/siginfo_codes.in b/xlat/siginfo_codes.in index a57c370c..b3e0888a 100644 --- a/xlat/siginfo_codes.in +++ b/xlat/siginfo_codes.in @@ -1,12 +1,22 @@ SI_USER 0 SI_KERNEL 0x80 SI_QUEUE -1 + +#ifdef __mips__ +SI_ASYNCIO -2 +SI_TIMER -3 +SI_MESGQ -4 +#else SI_TIMER -2 SI_MESGQ -3 SI_ASYNCIO -4 +#endif + SI_SIGIO -5 SI_TKILL -6 SI_DETHREAD -7 SI_ASYNCNL -60 -SI_NOINFO -SI_LWP + +#ifdef __sparc__ +SI_NOINFO 32767 +#endif diff --git a/xlat/sigpoll_codes.h b/xlat/sigpoll_codes.h index 55cc1bbf..5e9f08b7 100644 --- a/xlat/sigpoll_codes.h +++ b/xlat/sigpoll_codes.h @@ -1,32 +1,62 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigpoll_codes.in; do not edit. */ -#if !(defined(POLL_IN) || (defined(HAVE_DECL_POLL_IN) && HAVE_DECL_POLL_IN)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(POLL_IN) || (defined(HAVE_DECL_POLL_IN) && HAVE_DECL_POLL_IN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLL_IN) == (1), "POLL_IN != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define POLL_IN 1 #endif -#if !(defined(POLL_OUT) || (defined(HAVE_DECL_POLL_OUT) && HAVE_DECL_POLL_OUT)) +#if defined(POLL_OUT) || (defined(HAVE_DECL_POLL_OUT) && HAVE_DECL_POLL_OUT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLL_OUT) == (2), "POLL_OUT != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define POLL_OUT 2 #endif -#if !(defined(POLL_MSG) || (defined(HAVE_DECL_POLL_MSG) && HAVE_DECL_POLL_MSG)) +#if defined(POLL_MSG) || (defined(HAVE_DECL_POLL_MSG) && HAVE_DECL_POLL_MSG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLL_MSG) == (3), "POLL_MSG != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define POLL_MSG 3 #endif -#if !(defined(POLL_ERR) || (defined(HAVE_DECL_POLL_ERR) && HAVE_DECL_POLL_ERR)) +#if defined(POLL_ERR) || (defined(HAVE_DECL_POLL_ERR) && HAVE_DECL_POLL_ERR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLL_ERR) == (4), "POLL_ERR != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define POLL_ERR 4 #endif -#if !(defined(POLL_PRI) || (defined(HAVE_DECL_POLL_PRI) && HAVE_DECL_POLL_PRI)) +#if defined(POLL_PRI) || (defined(HAVE_DECL_POLL_PRI) && HAVE_DECL_POLL_PRI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLL_PRI) == (5), "POLL_PRI != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define POLL_PRI 5 #endif -#if !(defined(POLL_HUP) || (defined(HAVE_DECL_POLL_HUP) && HAVE_DECL_POLL_HUP)) +#if defined(POLL_HUP) || (defined(HAVE_DECL_POLL_HUP) && HAVE_DECL_POLL_HUP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((POLL_HUP) == (6), "POLL_HUP != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define POLL_HUP 6 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat sigpoll_codes[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat sigpoll_codes[] = { XLAT(POLL_IN), XLAT(POLL_OUT), @@ -37,4 +67,6 @@ const struct xlat sigpoll_codes[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sigprocmaskcmds.h b/xlat/sigprocmaskcmds.h index 427680bd..02df7057 100644 --- a/xlat/sigprocmaskcmds.h +++ b/xlat/sigprocmaskcmds.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigprocmaskcmds.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat sigprocmaskcmds in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sigprocmaskcmds in mpers mode + +# else static const struct xlat sigprocmaskcmds[] = { @@ -23,4 +29,6 @@ const struct xlat sigprocmaskcmds[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sigprof_codes.h b/xlat/sigprof_codes.h index 2323b9e7..6776434a 100644 --- a/xlat/sigprof_codes.h +++ b/xlat/sigprof_codes.h @@ -1,14 +1,20 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigprof_codes.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat sigprof_codes[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat sigprof_codes[] = { #if defined(PROF_SIG) || (defined(HAVE_DECL_PROF_SIG) && HAVE_DECL_PROF_SIG) XLAT(PROF_SIG), @@ -16,4 +22,6 @@ const struct xlat sigprof_codes[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sigsegv_codes.h b/xlat/sigsegv_codes.h index 67034cba..64fbc794 100644 --- a/xlat/sigsegv_codes.h +++ b/xlat/sigsegv_codes.h @@ -1,32 +1,86 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigsegv_codes.in; do not edit. */ -#if !(defined(SEGV_MAPERR) || (defined(HAVE_DECL_SEGV_MAPERR) && HAVE_DECL_SEGV_MAPERR)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SEGV_MAPERR) || (defined(HAVE_DECL_SEGV_MAPERR) && HAVE_DECL_SEGV_MAPERR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SEGV_MAPERR) == (1), "SEGV_MAPERR != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SEGV_MAPERR 1 #endif -#if !(defined(SEGV_ACCERR) || (defined(HAVE_DECL_SEGV_ACCERR) && HAVE_DECL_SEGV_ACCERR)) +#if defined(SEGV_ACCERR) || (defined(HAVE_DECL_SEGV_ACCERR) && HAVE_DECL_SEGV_ACCERR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SEGV_ACCERR) == (2), "SEGV_ACCERR != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SEGV_ACCERR 2 #endif -#if !(defined(SEGV_BNDERR) || (defined(HAVE_DECL_SEGV_BNDERR) && HAVE_DECL_SEGV_BNDERR)) +#if defined(SEGV_BNDERR) || (defined(HAVE_DECL_SEGV_BNDERR) && HAVE_DECL_SEGV_BNDERR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SEGV_BNDERR) == (3), "SEGV_BNDERR != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SEGV_BNDERR 3 #endif -#if !(defined(SEGV_PKUERR) || (defined(HAVE_DECL_SEGV_PKUERR) && HAVE_DECL_SEGV_PKUERR)) +#if defined(SEGV_PKUERR) || (defined(HAVE_DECL_SEGV_PKUERR) && HAVE_DECL_SEGV_PKUERR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SEGV_PKUERR) == (4), "SEGV_PKUERR != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SEGV_PKUERR 4 #endif +#if defined(SEGV_ACCADI) || (defined(HAVE_DECL_SEGV_ACCADI) && HAVE_DECL_SEGV_ACCADI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SEGV_ACCADI) == (5), "SEGV_ACCADI != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SEGV_ACCADI 5 +#endif +#if defined(SEGV_ADIDERR) || (defined(HAVE_DECL_SEGV_ADIDERR) && HAVE_DECL_SEGV_ADIDERR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SEGV_ADIDERR) == (6), "SEGV_ADIDERR != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SEGV_ADIDERR 6 +#endif +#if defined(SEGV_ADIPERR) || (defined(HAVE_DECL_SEGV_ADIPERR) && HAVE_DECL_SEGV_ADIPERR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SEGV_ADIPERR) == (7), "SEGV_ADIPERR != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SEGV_ADIPERR 7 +#endif + +#ifndef XLAT_MACROS_ONLY -#ifdef IN_MPERS +# ifdef IN_MPERS extern const struct xlat sigsegv_codes[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat sigsegv_codes[] = { XLAT(SEGV_MAPERR), XLAT(SEGV_ACCERR), +#if defined(SEGV_STACKFLOW) || (defined(HAVE_DECL_SEGV_STACKFLOW) && HAVE_DECL_SEGV_STACKFLOW) + XLAT(SEGV_STACKFLOW), +#endif XLAT(SEGV_BNDERR), +#if defined(__SEGV_PSTKOVF) || (defined(HAVE_DECL___SEGV_PSTKOVF) && HAVE_DECL___SEGV_PSTKOVF) + XLAT(__SEGV_PSTKOVF), +#endif XLAT(SEGV_PKUERR), + XLAT(SEGV_ACCADI), + XLAT(SEGV_ADIDERR), + XLAT(SEGV_ADIPERR), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sigsegv_codes.in b/xlat/sigsegv_codes.in index 09c16069..2ca98f6d 100644 --- a/xlat/sigsegv_codes.in +++ b/xlat/sigsegv_codes.in @@ -1,4 +1,9 @@ SEGV_MAPERR 1 SEGV_ACCERR 2 +SEGV_STACKFLOW /* 3 - bfin */ SEGV_BNDERR 3 +__SEGV_PSTKOVF /* 4 - ia64 */ SEGV_PKUERR 4 +SEGV_ACCADI 5 /* sparc */ +SEGV_ADIDERR 6 /* sparc */ +SEGV_ADIPERR 7 /* sparc */ diff --git a/xlat/sigsys_codes.h b/xlat/sigsys_codes.h index 6fba1fbb..45397403 100644 --- a/xlat/sigsys_codes.h +++ b/xlat/sigsys_codes.h @@ -1,20 +1,32 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigsys_codes.in; do not edit. */ -#if !(defined(SYS_SECCOMP) || (defined(HAVE_DECL_SYS_SECCOMP) && HAVE_DECL_SYS_SECCOMP)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SYS_SECCOMP) || (defined(HAVE_DECL_SYS_SECCOMP) && HAVE_DECL_SYS_SECCOMP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYS_SECCOMP) == (1), "SYS_SECCOMP != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYS_SECCOMP 1 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat sigsys_codes[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat sigsys_codes[] = { XLAT(SYS_SECCOMP), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sigtrap_codes.h b/xlat/sigtrap_codes.h index f451dc44..e13233ff 100644 --- a/xlat/sigtrap_codes.h +++ b/xlat/sigtrap_codes.h @@ -1,32 +1,76 @@ /* Generated by ./xlat/gen.sh from ./xlat/sigtrap_codes.in; do not edit. */ -#if !(defined(TRAP_BRKPT) || (defined(HAVE_DECL_TRAP_BRKPT) && HAVE_DECL_TRAP_BRKPT)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(TRAP_BRKPT) || (defined(HAVE_DECL_TRAP_BRKPT) && HAVE_DECL_TRAP_BRKPT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TRAP_BRKPT) == (1), "TRAP_BRKPT != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define TRAP_BRKPT 1 #endif -#if !(defined(TRAP_TRACE) || (defined(HAVE_DECL_TRAP_TRACE) && HAVE_DECL_TRAP_TRACE)) +#if defined(TRAP_TRACE) || (defined(HAVE_DECL_TRAP_TRACE) && HAVE_DECL_TRAP_TRACE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TRAP_TRACE) == (2), "TRAP_TRACE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define TRAP_TRACE 2 #endif -#if !(defined(TRAP_BRANCH) || (defined(HAVE_DECL_TRAP_BRANCH) && HAVE_DECL_TRAP_BRANCH)) +#if defined(TRAP_BRANCH) || (defined(HAVE_DECL_TRAP_BRANCH) && HAVE_DECL_TRAP_BRANCH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TRAP_BRANCH) == (3), "TRAP_BRANCH != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define TRAP_BRANCH 3 #endif -#if !(defined(TRAP_HWBKPT) || (defined(HAVE_DECL_TRAP_HWBKPT) && HAVE_DECL_TRAP_HWBKPT)) +#if defined(TRAP_HWBKPT) || (defined(HAVE_DECL_TRAP_HWBKPT) && HAVE_DECL_TRAP_HWBKPT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TRAP_HWBKPT) == (4), "TRAP_HWBKPT != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define TRAP_HWBKPT 4 #endif +#if defined(TRAP_UNK) || (defined(HAVE_DECL_TRAP_UNK) && HAVE_DECL_TRAP_UNK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TRAP_UNK) == (5), "TRAP_UNK != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TRAP_UNK 5 +#endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS extern const struct xlat sigtrap_codes[]; -#else +# else -# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) +# if !(defined HAVE_M32_MPERS || defined HAVE_MX32_MPERS) static -# endif +# endif const struct xlat sigtrap_codes[] = { +#if defined(TRAP_STEP) || (defined(HAVE_DECL_TRAP_STEP) && HAVE_DECL_TRAP_STEP) + XLAT(TRAP_STEP), +#endif XLAT(TRAP_BRKPT), +#if defined(TRAP_TRACEFLOW) || (defined(HAVE_DECL_TRAP_TRACEFLOW) && HAVE_DECL_TRAP_TRACEFLOW) + XLAT(TRAP_TRACEFLOW), +#endif XLAT(TRAP_TRACE), +#if defined(TRAP_WATCHPT) || (defined(HAVE_DECL_TRAP_WATCHPT) && HAVE_DECL_TRAP_WATCHPT) + XLAT(TRAP_WATCHPT), +#endif XLAT(TRAP_BRANCH), +#if defined(TRAP_ILLTRAP) || (defined(HAVE_DECL_TRAP_ILLTRAP) && HAVE_DECL_TRAP_ILLTRAP) + XLAT(TRAP_ILLTRAP), +#endif XLAT(TRAP_HWBKPT), + XLAT(TRAP_UNK), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sigtrap_codes.in b/xlat/sigtrap_codes.in index 078aec87..55917a7f 100644 --- a/xlat/sigtrap_codes.in +++ b/xlat/sigtrap_codes.in @@ -1,4 +1,9 @@ +TRAP_STEP /* 1 - bfin */ TRAP_BRKPT 1 +TRAP_TRACEFLOW /* 2 - bfin */ TRAP_TRACE 2 +TRAP_WATCHPT /* 3 - bfin */ TRAP_BRANCH 3 +TRAP_ILLTRAP /* 4 - bfin */ TRAP_HWBKPT 4 +TRAP_UNK 5 diff --git a/xlat/skf_ad.h b/xlat/skf_ad.h new file mode 100644 index 00000000..fac1518c --- /dev/null +++ b/xlat/skf_ad.h @@ -0,0 +1,150 @@ +/* Generated by ./xlat/gen.sh from ./xlat/skf_ad.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SKF_AD_PROTOCOL) || (defined(HAVE_DECL_SKF_AD_PROTOCOL) && HAVE_DECL_SKF_AD_PROTOCOL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SKF_AD_PROTOCOL) == (0), "SKF_AD_PROTOCOL != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SKF_AD_PROTOCOL 0 +#endif +#if defined(SKF_AD_PKTTYPE) || (defined(HAVE_DECL_SKF_AD_PKTTYPE) && HAVE_DECL_SKF_AD_PKTTYPE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SKF_AD_PKTTYPE) == (4), "SKF_AD_PKTTYPE != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SKF_AD_PKTTYPE 4 +#endif +#if defined(SKF_AD_IFINDEX) || (defined(HAVE_DECL_SKF_AD_IFINDEX) && HAVE_DECL_SKF_AD_IFINDEX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SKF_AD_IFINDEX) == (8), "SKF_AD_IFINDEX != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SKF_AD_IFINDEX 8 +#endif +#if defined(SKF_AD_NLATTR) || (defined(HAVE_DECL_SKF_AD_NLATTR) && HAVE_DECL_SKF_AD_NLATTR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SKF_AD_NLATTR) == (12), "SKF_AD_NLATTR != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SKF_AD_NLATTR 12 +#endif +#if defined(SKF_AD_NLATTR_NEST) || (defined(HAVE_DECL_SKF_AD_NLATTR_NEST) && HAVE_DECL_SKF_AD_NLATTR_NEST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SKF_AD_NLATTR_NEST) == (16), "SKF_AD_NLATTR_NEST != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SKF_AD_NLATTR_NEST 16 +#endif +#if defined(SKF_AD_MARK) || (defined(HAVE_DECL_SKF_AD_MARK) && HAVE_DECL_SKF_AD_MARK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SKF_AD_MARK) == (20), "SKF_AD_MARK != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SKF_AD_MARK 20 +#endif +#if defined(SKF_AD_QUEUE) || (defined(HAVE_DECL_SKF_AD_QUEUE) && HAVE_DECL_SKF_AD_QUEUE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SKF_AD_QUEUE) == (24), "SKF_AD_QUEUE != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SKF_AD_QUEUE 24 +#endif +#if defined(SKF_AD_HATYPE) || (defined(HAVE_DECL_SKF_AD_HATYPE) && HAVE_DECL_SKF_AD_HATYPE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SKF_AD_HATYPE) == (28), "SKF_AD_HATYPE != 28"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SKF_AD_HATYPE 28 +#endif +#if defined(SKF_AD_RXHASH) || (defined(HAVE_DECL_SKF_AD_RXHASH) && HAVE_DECL_SKF_AD_RXHASH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SKF_AD_RXHASH) == (32), "SKF_AD_RXHASH != 32"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SKF_AD_RXHASH 32 +#endif +#if defined(SKF_AD_CPU) || (defined(HAVE_DECL_SKF_AD_CPU) && HAVE_DECL_SKF_AD_CPU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SKF_AD_CPU) == (36), "SKF_AD_CPU != 36"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SKF_AD_CPU 36 +#endif +#if defined(SKF_AD_ALU_XOR_X) || (defined(HAVE_DECL_SKF_AD_ALU_XOR_X) && HAVE_DECL_SKF_AD_ALU_XOR_X) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SKF_AD_ALU_XOR_X) == (40), "SKF_AD_ALU_XOR_X != 40"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SKF_AD_ALU_XOR_X 40 +#endif +#if defined(SKF_AD_VLAN_TAG) || (defined(HAVE_DECL_SKF_AD_VLAN_TAG) && HAVE_DECL_SKF_AD_VLAN_TAG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SKF_AD_VLAN_TAG) == (44), "SKF_AD_VLAN_TAG != 44"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SKF_AD_VLAN_TAG 44 +#endif +#if defined(SKF_AD_VLAN_TAG_PRESENT) || (defined(HAVE_DECL_SKF_AD_VLAN_TAG_PRESENT) && HAVE_DECL_SKF_AD_VLAN_TAG_PRESENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SKF_AD_VLAN_TAG_PRESENT) == (48), "SKF_AD_VLAN_TAG_PRESENT != 48"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SKF_AD_VLAN_TAG_PRESENT 48 +#endif +#if defined(SKF_AD_PAY_OFFSET) || (defined(HAVE_DECL_SKF_AD_PAY_OFFSET) && HAVE_DECL_SKF_AD_PAY_OFFSET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SKF_AD_PAY_OFFSET) == (52), "SKF_AD_PAY_OFFSET != 52"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SKF_AD_PAY_OFFSET 52 +#endif +#if defined(SKF_AD_RANDOM) || (defined(HAVE_DECL_SKF_AD_RANDOM) && HAVE_DECL_SKF_AD_RANDOM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SKF_AD_RANDOM) == (56), "SKF_AD_RANDOM != 56"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SKF_AD_RANDOM 56 +#endif +#if defined(SKF_AD_VLAN_TPID) || (defined(HAVE_DECL_SKF_AD_VLAN_TPID) && HAVE_DECL_SKF_AD_VLAN_TPID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SKF_AD_VLAN_TPID) == (60), "SKF_AD_VLAN_TPID != 60"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SKF_AD_VLAN_TPID 60 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat skf_ad in mpers mode + +# else + +static +const struct xlat skf_ad[] = { + XLAT(SKF_AD_PROTOCOL), + XLAT(SKF_AD_PKTTYPE), + XLAT(SKF_AD_IFINDEX), + XLAT(SKF_AD_NLATTR), + XLAT(SKF_AD_NLATTR_NEST), + XLAT(SKF_AD_MARK), + XLAT(SKF_AD_QUEUE), + XLAT(SKF_AD_HATYPE), + XLAT(SKF_AD_RXHASH), + XLAT(SKF_AD_CPU), + XLAT(SKF_AD_ALU_XOR_X), + XLAT(SKF_AD_VLAN_TAG), + XLAT(SKF_AD_VLAN_TAG_PRESENT), + XLAT(SKF_AD_PAY_OFFSET), + XLAT(SKF_AD_RANDOM), + XLAT(SKF_AD_VLAN_TPID), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/skf_ad.in b/xlat/skf_ad.in new file mode 100644 index 00000000..f5b56134 --- /dev/null +++ b/xlat/skf_ad.in @@ -0,0 +1,16 @@ +SKF_AD_PROTOCOL 0 +SKF_AD_PKTTYPE 4 +SKF_AD_IFINDEX 8 +SKF_AD_NLATTR 12 +SKF_AD_NLATTR_NEST 16 +SKF_AD_MARK 20 +SKF_AD_QUEUE 24 +SKF_AD_HATYPE 28 +SKF_AD_RXHASH 32 +SKF_AD_CPU 36 +SKF_AD_ALU_XOR_X 40 +SKF_AD_VLAN_TAG 44 +SKF_AD_VLAN_TAG_PRESENT 48 +SKF_AD_PAY_OFFSET 52 +SKF_AD_RANDOM 56 +SKF_AD_VLAN_TPID 60 diff --git a/xlat/skf_off.h b/xlat/skf_off.h new file mode 100644 index 00000000..77afe64d --- /dev/null +++ b/xlat/skf_off.h @@ -0,0 +1,26 @@ +/* Generated by ./xlat/gen.sh from ./xlat/skf_off.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SKF_AD_OFF) || (defined(HAVE_DECL_SKF_AD_OFF) && HAVE_DECL_SKF_AD_OFF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SKF_AD_OFF) == (-0x1000), "SKF_AD_OFF != -0x1000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SKF_AD_OFF -0x1000 +#endif +#if defined(SKF_NET_OFF) || (defined(HAVE_DECL_SKF_NET_OFF) && HAVE_DECL_SKF_NET_OFF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SKF_NET_OFF) == (-0x100000), "SKF_NET_OFF != -0x100000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SKF_NET_OFF -0x100000 +#endif +#if defined(SKF_LL_OFF) || (defined(HAVE_DECL_SKF_LL_OFF) && HAVE_DECL_SKF_LL_OFF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SKF_LL_OFF) == (-0x200000), "SKF_LL_OFF != -0x200000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SKF_LL_OFF -0x200000 +#endif diff --git a/xlat/skf_off.in b/xlat/skf_off.in new file mode 100644 index 00000000..6db30a9a --- /dev/null +++ b/xlat/skf_off.in @@ -0,0 +1,4 @@ +SKF_AD_OFF -0x1000 +SKF_NET_OFF -0x100000 +SKF_LL_OFF -0x200000 +#stop diff --git a/xlat/smc_decl_codes.h b/xlat/smc_decl_codes.h new file mode 100644 index 00000000..2f8f859f --- /dev/null +++ b/xlat/smc_decl_codes.h @@ -0,0 +1,151 @@ +/* Generated by ./xlat/gen.sh from ./xlat/smc_decl_codes.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SMC_CLC_DECL_MEM) || (defined(HAVE_DECL_SMC_CLC_DECL_MEM) && HAVE_DECL_SMC_CLC_DECL_MEM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_CLC_DECL_MEM) == (0x01010000), "SMC_CLC_DECL_MEM != 0x01010000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_CLC_DECL_MEM 0x01010000 +#endif +#if defined(SMC_CLC_DECL_TIMEOUT_CL) || (defined(HAVE_DECL_SMC_CLC_DECL_TIMEOUT_CL) && HAVE_DECL_SMC_CLC_DECL_TIMEOUT_CL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_CLC_DECL_TIMEOUT_CL) == (0x02010000), "SMC_CLC_DECL_TIMEOUT_CL != 0x02010000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_CLC_DECL_TIMEOUT_CL 0x02010000 +#endif +#if defined(SMC_CLC_DECL_TIMEOUT_AL) || (defined(HAVE_DECL_SMC_CLC_DECL_TIMEOUT_AL) && HAVE_DECL_SMC_CLC_DECL_TIMEOUT_AL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_CLC_DECL_TIMEOUT_AL) == (0x02020000), "SMC_CLC_DECL_TIMEOUT_AL != 0x02020000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_CLC_DECL_TIMEOUT_AL 0x02020000 +#endif +#if defined(SMC_CLC_DECL_CNFERR) || (defined(HAVE_DECL_SMC_CLC_DECL_CNFERR) && HAVE_DECL_SMC_CLC_DECL_CNFERR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_CLC_DECL_CNFERR) == (0x03000000), "SMC_CLC_DECL_CNFERR != 0x03000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_CLC_DECL_CNFERR 0x03000000 +#endif +#if defined(SMC_CLC_DECL_PEERNOSMC) || (defined(HAVE_DECL_SMC_CLC_DECL_PEERNOSMC) && HAVE_DECL_SMC_CLC_DECL_PEERNOSMC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_CLC_DECL_PEERNOSMC) == (0x03010000), "SMC_CLC_DECL_PEERNOSMC != 0x03010000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_CLC_DECL_PEERNOSMC 0x03010000 +#endif +#if defined(SMC_CLC_DECL_IPSEC) || (defined(HAVE_DECL_SMC_CLC_DECL_IPSEC) && HAVE_DECL_SMC_CLC_DECL_IPSEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_CLC_DECL_IPSEC) == (0x03020000), "SMC_CLC_DECL_IPSEC != 0x03020000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_CLC_DECL_IPSEC 0x03020000 +#endif +#if defined(SMC_CLC_DECL_NOSMCDEV) || (defined(HAVE_DECL_SMC_CLC_DECL_NOSMCDEV) && HAVE_DECL_SMC_CLC_DECL_NOSMCDEV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_CLC_DECL_NOSMCDEV) == (0x03030000), "SMC_CLC_DECL_NOSMCDEV != 0x03030000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_CLC_DECL_NOSMCDEV 0x03030000 +#endif +#if defined(SMC_CLC_DECL_MODEUNSUPP) || (defined(HAVE_DECL_SMC_CLC_DECL_MODEUNSUPP) && HAVE_DECL_SMC_CLC_DECL_MODEUNSUPP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_CLC_DECL_MODEUNSUPP) == (0x03040000), "SMC_CLC_DECL_MODEUNSUPP != 0x03040000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_CLC_DECL_MODEUNSUPP 0x03040000 +#endif +#if defined(SMC_CLC_DECL_RMBE_EC) || (defined(HAVE_DECL_SMC_CLC_DECL_RMBE_EC) && HAVE_DECL_SMC_CLC_DECL_RMBE_EC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_CLC_DECL_RMBE_EC) == (0x03050000), "SMC_CLC_DECL_RMBE_EC != 0x03050000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_CLC_DECL_RMBE_EC 0x03050000 +#endif +#if defined(SMC_CLC_DECL_OPTUNSUPP) || (defined(HAVE_DECL_SMC_CLC_DECL_OPTUNSUPP) && HAVE_DECL_SMC_CLC_DECL_OPTUNSUPP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_CLC_DECL_OPTUNSUPP) == (0x03060000), "SMC_CLC_DECL_OPTUNSUPP != 0x03060000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_CLC_DECL_OPTUNSUPP 0x03060000 +#endif +#if defined(SMC_CLC_DECL_SYNCERR) || (defined(HAVE_DECL_SMC_CLC_DECL_SYNCERR) && HAVE_DECL_SMC_CLC_DECL_SYNCERR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_CLC_DECL_SYNCERR) == (0x04000000), "SMC_CLC_DECL_SYNCERR != 0x04000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_CLC_DECL_SYNCERR 0x04000000 +#endif +#if defined(SMC_CLC_DECL_PEERDECL) || (defined(HAVE_DECL_SMC_CLC_DECL_PEERDECL) && HAVE_DECL_SMC_CLC_DECL_PEERDECL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_CLC_DECL_PEERDECL) == (0x05000000), "SMC_CLC_DECL_PEERDECL != 0x05000000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_CLC_DECL_PEERDECL 0x05000000 +#endif +#if defined(SMC_CLC_DECL_INTERR) || (defined(HAVE_DECL_SMC_CLC_DECL_INTERR) && HAVE_DECL_SMC_CLC_DECL_INTERR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_CLC_DECL_INTERR) == (0x99990000), "SMC_CLC_DECL_INTERR != 0x99990000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_CLC_DECL_INTERR 0x99990000 +#endif +#if defined(SMC_CLC_DECL_ERR_RTOK) || (defined(HAVE_DECL_SMC_CLC_DECL_ERR_RTOK) && HAVE_DECL_SMC_CLC_DECL_ERR_RTOK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_CLC_DECL_ERR_RTOK) == (0x99990001), "SMC_CLC_DECL_ERR_RTOK != 0x99990001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_CLC_DECL_ERR_RTOK 0x99990001 +#endif +#if defined(SMC_CLC_DECL_ERR_RDYLNK) || (defined(HAVE_DECL_SMC_CLC_DECL_ERR_RDYLNK) && HAVE_DECL_SMC_CLC_DECL_ERR_RDYLNK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_CLC_DECL_ERR_RDYLNK) == (0x99990002), "SMC_CLC_DECL_ERR_RDYLNK != 0x99990002"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_CLC_DECL_ERR_RDYLNK 0x99990002 +#endif +#if defined(SMC_CLC_DECL_ERR_REGRMB) || (defined(HAVE_DECL_SMC_CLC_DECL_ERR_REGRMB) && HAVE_DECL_SMC_CLC_DECL_ERR_REGRMB) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_CLC_DECL_ERR_REGRMB) == (0x99990003), "SMC_CLC_DECL_ERR_REGRMB != 0x99990003"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_CLC_DECL_ERR_REGRMB 0x99990003 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat smc_decl_codes in mpers mode + +# else + +static +const struct xlat smc_decl_codes[] = { + + XLAT(SMC_CLC_DECL_MEM), + XLAT(SMC_CLC_DECL_TIMEOUT_CL), + XLAT(SMC_CLC_DECL_TIMEOUT_AL), + XLAT(SMC_CLC_DECL_CNFERR), + XLAT(SMC_CLC_DECL_PEERNOSMC), + XLAT(SMC_CLC_DECL_IPSEC), + XLAT(SMC_CLC_DECL_NOSMCDEV), + XLAT(SMC_CLC_DECL_MODEUNSUPP), + XLAT(SMC_CLC_DECL_RMBE_EC), + XLAT(SMC_CLC_DECL_OPTUNSUPP), + XLAT(SMC_CLC_DECL_SYNCERR), + XLAT(SMC_CLC_DECL_PEERDECL), + XLAT(SMC_CLC_DECL_INTERR), + XLAT(SMC_CLC_DECL_ERR_RTOK), + XLAT(SMC_CLC_DECL_ERR_RDYLNK), + XLAT(SMC_CLC_DECL_ERR_REGRMB), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/smc_decl_codes.in b/xlat/smc_decl_codes.in new file mode 100644 index 00000000..d7810f89 --- /dev/null +++ b/xlat/smc_decl_codes.in @@ -0,0 +1,17 @@ +/* sorted */ +SMC_CLC_DECL_MEM 0x01010000 +SMC_CLC_DECL_TIMEOUT_CL 0x02010000 +SMC_CLC_DECL_TIMEOUT_AL 0x02020000 +SMC_CLC_DECL_CNFERR 0x03000000 +SMC_CLC_DECL_PEERNOSMC 0x03010000 +SMC_CLC_DECL_IPSEC 0x03020000 +SMC_CLC_DECL_NOSMCDEV 0x03030000 +SMC_CLC_DECL_MODEUNSUPP 0x03040000 +SMC_CLC_DECL_RMBE_EC 0x03050000 +SMC_CLC_DECL_OPTUNSUPP 0x03060000 +SMC_CLC_DECL_SYNCERR 0x04000000 +SMC_CLC_DECL_PEERDECL 0x05000000 +SMC_CLC_DECL_INTERR 0x99990000 +SMC_CLC_DECL_ERR_RTOK 0x99990001 +SMC_CLC_DECL_ERR_RDYLNK 0x99990002 +SMC_CLC_DECL_ERR_REGRMB 0x99990003 diff --git a/xlat/smc_diag_attrs.h b/xlat/smc_diag_attrs.h new file mode 100644 index 00000000..9ec8b073 --- /dev/null +++ b/xlat/smc_diag_attrs.h @@ -0,0 +1,28 @@ +/* Generated by ./xlat/gen.sh from ./xlat/smc_diag_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat smc_diag_attrs in mpers mode + +# else + +static +const struct xlat smc_diag_attrs[] = { + XLAT(SMC_DIAG_NONE), + XLAT(SMC_DIAG_CONNINFO), + XLAT(SMC_DIAG_LGRINFO), + XLAT(SMC_DIAG_SHUTDOWN), + XLAT(SMC_DIAG_DMBINFO), + XLAT(SMC_DIAG_FALLBACK), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/smc_diag_attrs.in b/xlat/smc_diag_attrs.in new file mode 100644 index 00000000..8d0ebeb4 --- /dev/null +++ b/xlat/smc_diag_attrs.in @@ -0,0 +1,7 @@ +#unconditional +SMC_DIAG_NONE +SMC_DIAG_CONNINFO +SMC_DIAG_LGRINFO +SMC_DIAG_SHUTDOWN +SMC_DIAG_DMBINFO +SMC_DIAG_FALLBACK diff --git a/xlat/smc_diag_extended_flags.h b/xlat/smc_diag_extended_flags.h new file mode 100644 index 00000000..48cb3a4e --- /dev/null +++ b/xlat/smc_diag_extended_flags.h @@ -0,0 +1,24 @@ +/* Generated by ./xlat/gen.sh from ./xlat/smc_diag_extended_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat smc_diag_extended_flags in mpers mode + +# else + +static +const struct xlat smc_diag_extended_flags[] = { + XLAT(1<<(SMC_DIAG_CONNINFO-1)), + XLAT(1<<(SMC_DIAG_LGRINFO-1)), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/smc_diag_extended_flags.in b/xlat/smc_diag_extended_flags.in new file mode 100644 index 00000000..9bd39581 --- /dev/null +++ b/xlat/smc_diag_extended_flags.in @@ -0,0 +1,3 @@ +#unconditional +1<<(SMC_DIAG_CONNINFO-1) +1<<(SMC_DIAG_LGRINFO-1) diff --git a/xlat/smc_diag_mode.h b/xlat/smc_diag_mode.h new file mode 100644 index 00000000..7cbddcde --- /dev/null +++ b/xlat/smc_diag_mode.h @@ -0,0 +1,46 @@ +/* Generated by ./xlat/gen.sh from ./xlat/smc_diag_mode.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SMC_DIAG_MODE_SMCR) || (defined(HAVE_DECL_SMC_DIAG_MODE_SMCR) && HAVE_DECL_SMC_DIAG_MODE_SMCR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_DIAG_MODE_SMCR) == (0), "SMC_DIAG_MODE_SMCR != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_DIAG_MODE_SMCR 0 +#endif +#if defined(SMC_DIAG_MODE_FALLBACK_TCP) || (defined(HAVE_DECL_SMC_DIAG_MODE_FALLBACK_TCP) && HAVE_DECL_SMC_DIAG_MODE_FALLBACK_TCP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_DIAG_MODE_FALLBACK_TCP) == (1), "SMC_DIAG_MODE_FALLBACK_TCP != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_DIAG_MODE_FALLBACK_TCP 1 +#endif +#if defined(SMC_DIAG_MODE_SMCD) || (defined(HAVE_DECL_SMC_DIAG_MODE_SMCD) && HAVE_DECL_SMC_DIAG_MODE_SMCD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_DIAG_MODE_SMCD) == (2), "SMC_DIAG_MODE_SMCD != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_DIAG_MODE_SMCD 2 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat smc_diag_mode in mpers mode + +# else + +static +const struct xlat smc_diag_mode[] = { + [SMC_DIAG_MODE_SMCR] = XLAT(SMC_DIAG_MODE_SMCR), + [SMC_DIAG_MODE_FALLBACK_TCP] = XLAT(SMC_DIAG_MODE_FALLBACK_TCP), + [SMC_DIAG_MODE_SMCD] = XLAT(SMC_DIAG_MODE_SMCD), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/smc_diag_mode.in b/xlat/smc_diag_mode.in new file mode 100644 index 00000000..4ac39639 --- /dev/null +++ b/xlat/smc_diag_mode.in @@ -0,0 +1,4 @@ +#value_indexed +SMC_DIAG_MODE_SMCR 0 +SMC_DIAG_MODE_FALLBACK_TCP 1 +SMC_DIAG_MODE_SMCD 2 diff --git a/xlat/smc_link_group_roles.h b/xlat/smc_link_group_roles.h new file mode 100644 index 00000000..24f2f5dd --- /dev/null +++ b/xlat/smc_link_group_roles.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/smc_link_group_roles.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SMC_CLNT) || (defined(HAVE_DECL_SMC_CLNT) && HAVE_DECL_SMC_CLNT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_CLNT) == (0), "SMC_CLNT != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_CLNT 0 +#endif +#if defined(SMC_SERV) || (defined(HAVE_DECL_SMC_SERV) && HAVE_DECL_SMC_SERV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_SERV) == (1), "SMC_SERV != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_SERV 1 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat smc_link_group_roles in mpers mode + +# else + +static +const struct xlat smc_link_group_roles[] = { + XLAT(SMC_CLNT), + XLAT(SMC_SERV), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/smc_link_group_roles.in b/xlat/smc_link_group_roles.in new file mode 100644 index 00000000..d1cc06d4 --- /dev/null +++ b/xlat/smc_link_group_roles.in @@ -0,0 +1,2 @@ +SMC_CLNT 0 +SMC_SERV 1 diff --git a/xlat/smc_protocols.h b/xlat/smc_protocols.h new file mode 100644 index 00000000..47ad92b2 --- /dev/null +++ b/xlat/smc_protocols.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/smc_protocols.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SMCPROTO_SMC) || (defined(HAVE_DECL_SMCPROTO_SMC) && HAVE_DECL_SMCPROTO_SMC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMCPROTO_SMC) == (0), "SMCPROTO_SMC != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMCPROTO_SMC 0 +#endif +#if defined(SMCPROTO_SMC6) || (defined(HAVE_DECL_SMCPROTO_SMC6) && HAVE_DECL_SMCPROTO_SMC6) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMCPROTO_SMC6) == (1), "SMCPROTO_SMC6 != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMCPROTO_SMC6 1 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat smc_protocols in mpers mode + +# else + +static +const struct xlat smc_protocols[] = { + [SMCPROTO_SMC] = XLAT(SMCPROTO_SMC), + [SMCPROTO_SMC6] = XLAT(SMCPROTO_SMC6), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/smc_protocols.in b/xlat/smc_protocols.in new file mode 100644 index 00000000..b8c1aaea --- /dev/null +++ b/xlat/smc_protocols.in @@ -0,0 +1,3 @@ +#value_indexed +SMCPROTO_SMC 0 +SMCPROTO_SMC6 1 diff --git a/xlat/smc_states.h b/xlat/smc_states.h new file mode 100644 index 00000000..e88a62c2 --- /dev/null +++ b/xlat/smc_states.h @@ -0,0 +1,118 @@ +/* Generated by ./xlat/gen.sh from ./xlat/smc_states.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SMC_ACTIVE) || (defined(HAVE_DECL_SMC_ACTIVE) && HAVE_DECL_SMC_ACTIVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_ACTIVE) == (1), "SMC_ACTIVE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_ACTIVE 1 +#endif +#if defined(SMC_INIT) || (defined(HAVE_DECL_SMC_INIT) && HAVE_DECL_SMC_INIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_INIT) == (2), "SMC_INIT != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_INIT 2 +#endif +#if defined(SMC_CLOSED) || (defined(HAVE_DECL_SMC_CLOSED) && HAVE_DECL_SMC_CLOSED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_CLOSED) == (7), "SMC_CLOSED != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_CLOSED 7 +#endif +#if defined(SMC_LISTEN) || (defined(HAVE_DECL_SMC_LISTEN) && HAVE_DECL_SMC_LISTEN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_LISTEN) == (10), "SMC_LISTEN != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_LISTEN 10 +#endif +#if defined(SMC_PEERCLOSEWAIT1) || (defined(HAVE_DECL_SMC_PEERCLOSEWAIT1) && HAVE_DECL_SMC_PEERCLOSEWAIT1) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_PEERCLOSEWAIT1) == (20), "SMC_PEERCLOSEWAIT1 != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_PEERCLOSEWAIT1 20 +#endif +#if defined(SMC_PEERCLOSEWAIT2) || (defined(HAVE_DECL_SMC_PEERCLOSEWAIT2) && HAVE_DECL_SMC_PEERCLOSEWAIT2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_PEERCLOSEWAIT2) == (21), "SMC_PEERCLOSEWAIT2 != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_PEERCLOSEWAIT2 21 +#endif +#if defined(SMC_APPFINCLOSEWAIT) || (defined(HAVE_DECL_SMC_APPFINCLOSEWAIT) && HAVE_DECL_SMC_APPFINCLOSEWAIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_APPFINCLOSEWAIT) == (24), "SMC_APPFINCLOSEWAIT != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_APPFINCLOSEWAIT 24 +#endif +#if defined(SMC_APPCLOSEWAIT1) || (defined(HAVE_DECL_SMC_APPCLOSEWAIT1) && HAVE_DECL_SMC_APPCLOSEWAIT1) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_APPCLOSEWAIT1) == (22), "SMC_APPCLOSEWAIT1 != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_APPCLOSEWAIT1 22 +#endif +#if defined(SMC_APPCLOSEWAIT2) || (defined(HAVE_DECL_SMC_APPCLOSEWAIT2) && HAVE_DECL_SMC_APPCLOSEWAIT2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_APPCLOSEWAIT2) == (23), "SMC_APPCLOSEWAIT2 != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_APPCLOSEWAIT2 23 +#endif +#if defined(SMC_PEERFINCLOSEWAIT) || (defined(HAVE_DECL_SMC_PEERFINCLOSEWAIT) && HAVE_DECL_SMC_PEERFINCLOSEWAIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_PEERFINCLOSEWAIT) == (25), "SMC_PEERFINCLOSEWAIT != 25"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_PEERFINCLOSEWAIT 25 +#endif +#if defined(SMC_PEERABORTWAIT) || (defined(HAVE_DECL_SMC_PEERABORTWAIT) && HAVE_DECL_SMC_PEERABORTWAIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_PEERABORTWAIT) == (26), "SMC_PEERABORTWAIT != 26"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_PEERABORTWAIT 26 +#endif +#if defined(SMC_PROCESSABORT) || (defined(HAVE_DECL_SMC_PROCESSABORT) && HAVE_DECL_SMC_PROCESSABORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SMC_PROCESSABORT) == (27), "SMC_PROCESSABORT != 27"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SMC_PROCESSABORT 27 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat smc_states in mpers mode + +# else + +static +const struct xlat smc_states[] = { + XLAT(SMC_ACTIVE), + XLAT(SMC_INIT), + XLAT(SMC_CLOSED), + XLAT(SMC_LISTEN), + XLAT(SMC_PEERCLOSEWAIT1), + XLAT(SMC_PEERCLOSEWAIT2), + XLAT(SMC_APPFINCLOSEWAIT), + XLAT(SMC_APPCLOSEWAIT1), + XLAT(SMC_APPCLOSEWAIT2), + XLAT(SMC_PEERFINCLOSEWAIT), + XLAT(SMC_PEERABORTWAIT), + XLAT(SMC_PROCESSABORT), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/smc_states.in b/xlat/smc_states.in new file mode 100644 index 00000000..d197b1f7 --- /dev/null +++ b/xlat/smc_states.in @@ -0,0 +1,12 @@ +SMC_ACTIVE 1 +SMC_INIT 2 +SMC_CLOSED 7 +SMC_LISTEN 10 +SMC_PEERCLOSEWAIT1 20 +SMC_PEERCLOSEWAIT2 21 +SMC_APPFINCLOSEWAIT 24 +SMC_APPCLOSEWAIT1 22 +SMC_APPCLOSEWAIT2 23 +SMC_PEERFINCLOSEWAIT 25 +SMC_PEERABORTWAIT 26 +SMC_PROCESSABORT 27 diff --git a/xlat/snmp_icmp6_stats.h b/xlat/snmp_icmp6_stats.h new file mode 100644 index 00000000..62553d53 --- /dev/null +++ b/xlat/snmp_icmp6_stats.h @@ -0,0 +1,70 @@ +/* Generated by ./xlat/gen.sh from ./xlat/snmp_icmp6_stats.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(ICMP6_MIB_NUM) || (defined(HAVE_DECL_ICMP6_MIB_NUM) && HAVE_DECL_ICMP6_MIB_NUM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ICMP6_MIB_NUM) == (0), "ICMP6_MIB_NUM != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ICMP6_MIB_NUM 0 +#endif +#if defined(ICMP6_MIB_INMSGS) || (defined(HAVE_DECL_ICMP6_MIB_INMSGS) && HAVE_DECL_ICMP6_MIB_INMSGS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ICMP6_MIB_INMSGS) == (1), "ICMP6_MIB_INMSGS != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ICMP6_MIB_INMSGS 1 +#endif +#if defined(ICMP6_MIB_INERRORS) || (defined(HAVE_DECL_ICMP6_MIB_INERRORS) && HAVE_DECL_ICMP6_MIB_INERRORS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ICMP6_MIB_INERRORS) == (2), "ICMP6_MIB_INERRORS != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ICMP6_MIB_INERRORS 2 +#endif +#if defined(ICMP6_MIB_OUTMSGS) || (defined(HAVE_DECL_ICMP6_MIB_OUTMSGS) && HAVE_DECL_ICMP6_MIB_OUTMSGS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ICMP6_MIB_OUTMSGS) == (3), "ICMP6_MIB_OUTMSGS != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ICMP6_MIB_OUTMSGS 3 +#endif +#if defined(ICMP6_MIB_OUTERRORS) || (defined(HAVE_DECL_ICMP6_MIB_OUTERRORS) && HAVE_DECL_ICMP6_MIB_OUTERRORS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ICMP6_MIB_OUTERRORS) == (4), "ICMP6_MIB_OUTERRORS != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ICMP6_MIB_OUTERRORS 4 +#endif +#if defined(ICMP6_MIB_CSUMERRORS) || (defined(HAVE_DECL_ICMP6_MIB_CSUMERRORS) && HAVE_DECL_ICMP6_MIB_CSUMERRORS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ICMP6_MIB_CSUMERRORS) == (5), "ICMP6_MIB_CSUMERRORS != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ICMP6_MIB_CSUMERRORS 5 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat snmp_icmp6_stats in mpers mode + +# else + +static +const struct xlat snmp_icmp6_stats[] = { + [ICMP6_MIB_NUM] = XLAT(ICMP6_MIB_NUM), + [ICMP6_MIB_INMSGS] = XLAT(ICMP6_MIB_INMSGS), + [ICMP6_MIB_INERRORS] = XLAT(ICMP6_MIB_INERRORS), + [ICMP6_MIB_OUTMSGS] = XLAT(ICMP6_MIB_OUTMSGS), + [ICMP6_MIB_OUTERRORS] = XLAT(ICMP6_MIB_OUTERRORS), + [ICMP6_MIB_CSUMERRORS] = XLAT(ICMP6_MIB_CSUMERRORS), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/snmp_icmp6_stats.in b/xlat/snmp_icmp6_stats.in new file mode 100644 index 00000000..ee4769e7 --- /dev/null +++ b/xlat/snmp_icmp6_stats.in @@ -0,0 +1,7 @@ +#value_indexed +ICMP6_MIB_NUM 0 +ICMP6_MIB_INMSGS 1 +ICMP6_MIB_INERRORS 2 +ICMP6_MIB_OUTMSGS 3 +ICMP6_MIB_OUTERRORS 4 +ICMP6_MIB_CSUMERRORS 5 diff --git a/xlat/snmp_ip_stats.h b/xlat/snmp_ip_stats.h new file mode 100644 index 00000000..0f743222 --- /dev/null +++ b/xlat/snmp_ip_stats.h @@ -0,0 +1,318 @@ +/* Generated by ./xlat/gen.sh from ./xlat/snmp_ip_stats.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IPSTATS_MIB_NUM) || (defined(HAVE_DECL_IPSTATS_MIB_NUM) && HAVE_DECL_IPSTATS_MIB_NUM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_NUM) == (0), "IPSTATS_MIB_NUM != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_NUM 0 +#endif +#if defined(IPSTATS_MIB_INPKTS) || (defined(HAVE_DECL_IPSTATS_MIB_INPKTS) && HAVE_DECL_IPSTATS_MIB_INPKTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_INPKTS) == (1), "IPSTATS_MIB_INPKTS != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_INPKTS 1 +#endif +#if defined(IPSTATS_MIB_INOCTETS) || (defined(HAVE_DECL_IPSTATS_MIB_INOCTETS) && HAVE_DECL_IPSTATS_MIB_INOCTETS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_INOCTETS) == (2), "IPSTATS_MIB_INOCTETS != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_INOCTETS 2 +#endif +#if defined(IPSTATS_MIB_INDELIVERS) || (defined(HAVE_DECL_IPSTATS_MIB_INDELIVERS) && HAVE_DECL_IPSTATS_MIB_INDELIVERS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_INDELIVERS) == (3), "IPSTATS_MIB_INDELIVERS != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_INDELIVERS 3 +#endif +#if defined(IPSTATS_MIB_OUTFORWDATAGRAMS) || (defined(HAVE_DECL_IPSTATS_MIB_OUTFORWDATAGRAMS) && HAVE_DECL_IPSTATS_MIB_OUTFORWDATAGRAMS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_OUTFORWDATAGRAMS) == (4), "IPSTATS_MIB_OUTFORWDATAGRAMS != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_OUTFORWDATAGRAMS 4 +#endif +#if defined(IPSTATS_MIB_OUTPKTS) || (defined(HAVE_DECL_IPSTATS_MIB_OUTPKTS) && HAVE_DECL_IPSTATS_MIB_OUTPKTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_OUTPKTS) == (5), "IPSTATS_MIB_OUTPKTS != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_OUTPKTS 5 +#endif +#if defined(IPSTATS_MIB_OUTOCTETS) || (defined(HAVE_DECL_IPSTATS_MIB_OUTOCTETS) && HAVE_DECL_IPSTATS_MIB_OUTOCTETS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_OUTOCTETS) == (6), "IPSTATS_MIB_OUTOCTETS != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_OUTOCTETS 6 +#endif +#if defined(IPSTATS_MIB_INHDRERRORS) || (defined(HAVE_DECL_IPSTATS_MIB_INHDRERRORS) && HAVE_DECL_IPSTATS_MIB_INHDRERRORS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_INHDRERRORS) == (7), "IPSTATS_MIB_INHDRERRORS != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_INHDRERRORS 7 +#endif +#if defined(IPSTATS_MIB_INTOOBIGERRORS) || (defined(HAVE_DECL_IPSTATS_MIB_INTOOBIGERRORS) && HAVE_DECL_IPSTATS_MIB_INTOOBIGERRORS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_INTOOBIGERRORS) == (8), "IPSTATS_MIB_INTOOBIGERRORS != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_INTOOBIGERRORS 8 +#endif +#if defined(IPSTATS_MIB_INNOROUTES) || (defined(HAVE_DECL_IPSTATS_MIB_INNOROUTES) && HAVE_DECL_IPSTATS_MIB_INNOROUTES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_INNOROUTES) == (9), "IPSTATS_MIB_INNOROUTES != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_INNOROUTES 9 +#endif +#if defined(IPSTATS_MIB_INADDRERRORS) || (defined(HAVE_DECL_IPSTATS_MIB_INADDRERRORS) && HAVE_DECL_IPSTATS_MIB_INADDRERRORS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_INADDRERRORS) == (10), "IPSTATS_MIB_INADDRERRORS != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_INADDRERRORS 10 +#endif +#if defined(IPSTATS_MIB_INUNKNOWNPROTOS) || (defined(HAVE_DECL_IPSTATS_MIB_INUNKNOWNPROTOS) && HAVE_DECL_IPSTATS_MIB_INUNKNOWNPROTOS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_INUNKNOWNPROTOS) == (11), "IPSTATS_MIB_INUNKNOWNPROTOS != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_INUNKNOWNPROTOS 11 +#endif +#if defined(IPSTATS_MIB_INTRUNCATEDPKTS) || (defined(HAVE_DECL_IPSTATS_MIB_INTRUNCATEDPKTS) && HAVE_DECL_IPSTATS_MIB_INTRUNCATEDPKTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_INTRUNCATEDPKTS) == (12), "IPSTATS_MIB_INTRUNCATEDPKTS != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_INTRUNCATEDPKTS 12 +#endif +#if defined(IPSTATS_MIB_INDISCARDS) || (defined(HAVE_DECL_IPSTATS_MIB_INDISCARDS) && HAVE_DECL_IPSTATS_MIB_INDISCARDS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_INDISCARDS) == (13), "IPSTATS_MIB_INDISCARDS != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_INDISCARDS 13 +#endif +#if defined(IPSTATS_MIB_OUTDISCARDS) || (defined(HAVE_DECL_IPSTATS_MIB_OUTDISCARDS) && HAVE_DECL_IPSTATS_MIB_OUTDISCARDS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_OUTDISCARDS) == (14), "IPSTATS_MIB_OUTDISCARDS != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_OUTDISCARDS 14 +#endif +#if defined(IPSTATS_MIB_OUTNOROUTES) || (defined(HAVE_DECL_IPSTATS_MIB_OUTNOROUTES) && HAVE_DECL_IPSTATS_MIB_OUTNOROUTES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_OUTNOROUTES) == (15), "IPSTATS_MIB_OUTNOROUTES != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_OUTNOROUTES 15 +#endif +#if defined(IPSTATS_MIB_REASMTIMEOUT) || (defined(HAVE_DECL_IPSTATS_MIB_REASMTIMEOUT) && HAVE_DECL_IPSTATS_MIB_REASMTIMEOUT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_REASMTIMEOUT) == (16), "IPSTATS_MIB_REASMTIMEOUT != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_REASMTIMEOUT 16 +#endif +#if defined(IPSTATS_MIB_REASMREQDS) || (defined(HAVE_DECL_IPSTATS_MIB_REASMREQDS) && HAVE_DECL_IPSTATS_MIB_REASMREQDS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_REASMREQDS) == (17), "IPSTATS_MIB_REASMREQDS != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_REASMREQDS 17 +#endif +#if defined(IPSTATS_MIB_REASMOKS) || (defined(HAVE_DECL_IPSTATS_MIB_REASMOKS) && HAVE_DECL_IPSTATS_MIB_REASMOKS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_REASMOKS) == (18), "IPSTATS_MIB_REASMOKS != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_REASMOKS 18 +#endif +#if defined(IPSTATS_MIB_REASMFAILS) || (defined(HAVE_DECL_IPSTATS_MIB_REASMFAILS) && HAVE_DECL_IPSTATS_MIB_REASMFAILS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_REASMFAILS) == (19), "IPSTATS_MIB_REASMFAILS != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_REASMFAILS 19 +#endif +#if defined(IPSTATS_MIB_FRAGOKS) || (defined(HAVE_DECL_IPSTATS_MIB_FRAGOKS) && HAVE_DECL_IPSTATS_MIB_FRAGOKS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_FRAGOKS) == (20), "IPSTATS_MIB_FRAGOKS != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_FRAGOKS 20 +#endif +#if defined(IPSTATS_MIB_FRAGFAILS) || (defined(HAVE_DECL_IPSTATS_MIB_FRAGFAILS) && HAVE_DECL_IPSTATS_MIB_FRAGFAILS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_FRAGFAILS) == (21), "IPSTATS_MIB_FRAGFAILS != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_FRAGFAILS 21 +#endif +#if defined(IPSTATS_MIB_FRAGCREATES) || (defined(HAVE_DECL_IPSTATS_MIB_FRAGCREATES) && HAVE_DECL_IPSTATS_MIB_FRAGCREATES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_FRAGCREATES) == (22), "IPSTATS_MIB_FRAGCREATES != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_FRAGCREATES 22 +#endif +#if defined(IPSTATS_MIB_INMCASTPKTS) || (defined(HAVE_DECL_IPSTATS_MIB_INMCASTPKTS) && HAVE_DECL_IPSTATS_MIB_INMCASTPKTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_INMCASTPKTS) == (23), "IPSTATS_MIB_INMCASTPKTS != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_INMCASTPKTS 23 +#endif +#if defined(IPSTATS_MIB_OUTMCASTPKTS) || (defined(HAVE_DECL_IPSTATS_MIB_OUTMCASTPKTS) && HAVE_DECL_IPSTATS_MIB_OUTMCASTPKTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_OUTMCASTPKTS) == (24), "IPSTATS_MIB_OUTMCASTPKTS != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_OUTMCASTPKTS 24 +#endif +#if defined(IPSTATS_MIB_INBCASTPKTS) || (defined(HAVE_DECL_IPSTATS_MIB_INBCASTPKTS) && HAVE_DECL_IPSTATS_MIB_INBCASTPKTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_INBCASTPKTS) == (25), "IPSTATS_MIB_INBCASTPKTS != 25"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_INBCASTPKTS 25 +#endif +#if defined(IPSTATS_MIB_OUTBCASTPKTS) || (defined(HAVE_DECL_IPSTATS_MIB_OUTBCASTPKTS) && HAVE_DECL_IPSTATS_MIB_OUTBCASTPKTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_OUTBCASTPKTS) == (26), "IPSTATS_MIB_OUTBCASTPKTS != 26"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_OUTBCASTPKTS 26 +#endif +#if defined(IPSTATS_MIB_INMCASTOCTETS) || (defined(HAVE_DECL_IPSTATS_MIB_INMCASTOCTETS) && HAVE_DECL_IPSTATS_MIB_INMCASTOCTETS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_INMCASTOCTETS) == (27), "IPSTATS_MIB_INMCASTOCTETS != 27"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_INMCASTOCTETS 27 +#endif +#if defined(IPSTATS_MIB_OUTMCASTOCTETS) || (defined(HAVE_DECL_IPSTATS_MIB_OUTMCASTOCTETS) && HAVE_DECL_IPSTATS_MIB_OUTMCASTOCTETS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_OUTMCASTOCTETS) == (28), "IPSTATS_MIB_OUTMCASTOCTETS != 28"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_OUTMCASTOCTETS 28 +#endif +#if defined(IPSTATS_MIB_INBCASTOCTETS) || (defined(HAVE_DECL_IPSTATS_MIB_INBCASTOCTETS) && HAVE_DECL_IPSTATS_MIB_INBCASTOCTETS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_INBCASTOCTETS) == (29), "IPSTATS_MIB_INBCASTOCTETS != 29"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_INBCASTOCTETS 29 +#endif +#if defined(IPSTATS_MIB_OUTBCASTOCTETS) || (defined(HAVE_DECL_IPSTATS_MIB_OUTBCASTOCTETS) && HAVE_DECL_IPSTATS_MIB_OUTBCASTOCTETS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_OUTBCASTOCTETS) == (30), "IPSTATS_MIB_OUTBCASTOCTETS != 30"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_OUTBCASTOCTETS 30 +#endif +#if defined(IPSTATS_MIB_CSUMERRORS) || (defined(HAVE_DECL_IPSTATS_MIB_CSUMERRORS) && HAVE_DECL_IPSTATS_MIB_CSUMERRORS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_CSUMERRORS) == (31), "IPSTATS_MIB_CSUMERRORS != 31"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_CSUMERRORS 31 +#endif +#if defined(IPSTATS_MIB_NOECTPKTS) || (defined(HAVE_DECL_IPSTATS_MIB_NOECTPKTS) && HAVE_DECL_IPSTATS_MIB_NOECTPKTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_NOECTPKTS) == (32), "IPSTATS_MIB_NOECTPKTS != 32"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_NOECTPKTS 32 +#endif +#if defined(IPSTATS_MIB_ECT1PKTS) || (defined(HAVE_DECL_IPSTATS_MIB_ECT1PKTS) && HAVE_DECL_IPSTATS_MIB_ECT1PKTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_ECT1PKTS) == (33), "IPSTATS_MIB_ECT1PKTS != 33"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_ECT1PKTS 33 +#endif +#if defined(IPSTATS_MIB_ECT0PKTS) || (defined(HAVE_DECL_IPSTATS_MIB_ECT0PKTS) && HAVE_DECL_IPSTATS_MIB_ECT0PKTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_ECT0PKTS) == (34), "IPSTATS_MIB_ECT0PKTS != 34"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_ECT0PKTS 34 +#endif +#if defined(IPSTATS_MIB_CEPKTS) || (defined(HAVE_DECL_IPSTATS_MIB_CEPKTS) && HAVE_DECL_IPSTATS_MIB_CEPKTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_CEPKTS) == (35), "IPSTATS_MIB_CEPKTS != 35"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_CEPKTS 35 +#endif +#if defined(IPSTATS_MIB_REASM_OVERLAPS) || (defined(HAVE_DECL_IPSTATS_MIB_REASM_OVERLAPS) && HAVE_DECL_IPSTATS_MIB_REASM_OVERLAPS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IPSTATS_MIB_REASM_OVERLAPS) == (36), "IPSTATS_MIB_REASM_OVERLAPS != 36"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IPSTATS_MIB_REASM_OVERLAPS 36 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat snmp_ip_stats in mpers mode + +# else + +static +const struct xlat snmp_ip_stats[] = { + [IPSTATS_MIB_NUM] = XLAT(IPSTATS_MIB_NUM), + [IPSTATS_MIB_INPKTS] = XLAT(IPSTATS_MIB_INPKTS), + [IPSTATS_MIB_INOCTETS] = XLAT(IPSTATS_MIB_INOCTETS), + [IPSTATS_MIB_INDELIVERS] = XLAT(IPSTATS_MIB_INDELIVERS), + [IPSTATS_MIB_OUTFORWDATAGRAMS] = XLAT(IPSTATS_MIB_OUTFORWDATAGRAMS), + [IPSTATS_MIB_OUTPKTS] = XLAT(IPSTATS_MIB_OUTPKTS), + [IPSTATS_MIB_OUTOCTETS] = XLAT(IPSTATS_MIB_OUTOCTETS), + [IPSTATS_MIB_INHDRERRORS] = XLAT(IPSTATS_MIB_INHDRERRORS), + [IPSTATS_MIB_INTOOBIGERRORS] = XLAT(IPSTATS_MIB_INTOOBIGERRORS), + [IPSTATS_MIB_INNOROUTES] = XLAT(IPSTATS_MIB_INNOROUTES), + [IPSTATS_MIB_INADDRERRORS] = XLAT(IPSTATS_MIB_INADDRERRORS), + [IPSTATS_MIB_INUNKNOWNPROTOS] = XLAT(IPSTATS_MIB_INUNKNOWNPROTOS), + [IPSTATS_MIB_INTRUNCATEDPKTS] = XLAT(IPSTATS_MIB_INTRUNCATEDPKTS), + [IPSTATS_MIB_INDISCARDS] = XLAT(IPSTATS_MIB_INDISCARDS), + [IPSTATS_MIB_OUTDISCARDS] = XLAT(IPSTATS_MIB_OUTDISCARDS), + [IPSTATS_MIB_OUTNOROUTES] = XLAT(IPSTATS_MIB_OUTNOROUTES), + [IPSTATS_MIB_REASMTIMEOUT] = XLAT(IPSTATS_MIB_REASMTIMEOUT), + [IPSTATS_MIB_REASMREQDS] = XLAT(IPSTATS_MIB_REASMREQDS), + [IPSTATS_MIB_REASMOKS] = XLAT(IPSTATS_MIB_REASMOKS), + [IPSTATS_MIB_REASMFAILS] = XLAT(IPSTATS_MIB_REASMFAILS), + [IPSTATS_MIB_FRAGOKS] = XLAT(IPSTATS_MIB_FRAGOKS), + [IPSTATS_MIB_FRAGFAILS] = XLAT(IPSTATS_MIB_FRAGFAILS), + [IPSTATS_MIB_FRAGCREATES] = XLAT(IPSTATS_MIB_FRAGCREATES), + [IPSTATS_MIB_INMCASTPKTS] = XLAT(IPSTATS_MIB_INMCASTPKTS), + [IPSTATS_MIB_OUTMCASTPKTS] = XLAT(IPSTATS_MIB_OUTMCASTPKTS), + [IPSTATS_MIB_INBCASTPKTS] = XLAT(IPSTATS_MIB_INBCASTPKTS), + [IPSTATS_MIB_OUTBCASTPKTS] = XLAT(IPSTATS_MIB_OUTBCASTPKTS), + [IPSTATS_MIB_INMCASTOCTETS] = XLAT(IPSTATS_MIB_INMCASTOCTETS), + [IPSTATS_MIB_OUTMCASTOCTETS] = XLAT(IPSTATS_MIB_OUTMCASTOCTETS), + [IPSTATS_MIB_INBCASTOCTETS] = XLAT(IPSTATS_MIB_INBCASTOCTETS), + [IPSTATS_MIB_OUTBCASTOCTETS] = XLAT(IPSTATS_MIB_OUTBCASTOCTETS), + [IPSTATS_MIB_CSUMERRORS] = XLAT(IPSTATS_MIB_CSUMERRORS), + [IPSTATS_MIB_NOECTPKTS] = XLAT(IPSTATS_MIB_NOECTPKTS), + [IPSTATS_MIB_ECT1PKTS] = XLAT(IPSTATS_MIB_ECT1PKTS), + [IPSTATS_MIB_ECT0PKTS] = XLAT(IPSTATS_MIB_ECT0PKTS), + [IPSTATS_MIB_CEPKTS] = XLAT(IPSTATS_MIB_CEPKTS), + [IPSTATS_MIB_REASM_OVERLAPS] = XLAT(IPSTATS_MIB_REASM_OVERLAPS), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/snmp_ip_stats.in b/xlat/snmp_ip_stats.in new file mode 100644 index 00000000..7de755dc --- /dev/null +++ b/xlat/snmp_ip_stats.in @@ -0,0 +1,38 @@ +#value_indexed +IPSTATS_MIB_NUM 0 +IPSTATS_MIB_INPKTS 1 +IPSTATS_MIB_INOCTETS 2 +IPSTATS_MIB_INDELIVERS 3 +IPSTATS_MIB_OUTFORWDATAGRAMS 4 +IPSTATS_MIB_OUTPKTS 5 +IPSTATS_MIB_OUTOCTETS 6 +IPSTATS_MIB_INHDRERRORS 7 +IPSTATS_MIB_INTOOBIGERRORS 8 +IPSTATS_MIB_INNOROUTES 9 +IPSTATS_MIB_INADDRERRORS 10 +IPSTATS_MIB_INUNKNOWNPROTOS 11 +IPSTATS_MIB_INTRUNCATEDPKTS 12 +IPSTATS_MIB_INDISCARDS 13 +IPSTATS_MIB_OUTDISCARDS 14 +IPSTATS_MIB_OUTNOROUTES 15 +IPSTATS_MIB_REASMTIMEOUT 16 +IPSTATS_MIB_REASMREQDS 17 +IPSTATS_MIB_REASMOKS 18 +IPSTATS_MIB_REASMFAILS 19 +IPSTATS_MIB_FRAGOKS 20 +IPSTATS_MIB_FRAGFAILS 21 +IPSTATS_MIB_FRAGCREATES 22 +IPSTATS_MIB_INMCASTPKTS 23 +IPSTATS_MIB_OUTMCASTPKTS 24 +IPSTATS_MIB_INBCASTPKTS 25 +IPSTATS_MIB_OUTBCASTPKTS 26 +IPSTATS_MIB_INMCASTOCTETS 27 +IPSTATS_MIB_OUTMCASTOCTETS 28 +IPSTATS_MIB_INBCASTOCTETS 29 +IPSTATS_MIB_OUTBCASTOCTETS 30 +IPSTATS_MIB_CSUMERRORS 31 +IPSTATS_MIB_NOECTPKTS 32 +IPSTATS_MIB_ECT1PKTS 33 +IPSTATS_MIB_ECT0PKTS 34 +IPSTATS_MIB_CEPKTS 35 +IPSTATS_MIB_REASM_OVERLAPS 36 diff --git a/xlat/sock_alg_options.h b/xlat/sock_alg_options.h new file mode 100644 index 00000000..41b00a99 --- /dev/null +++ b/xlat/sock_alg_options.h @@ -0,0 +1,62 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_alg_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(ALG_SET_KEY) || (defined(HAVE_DECL_ALG_SET_KEY) && HAVE_DECL_ALG_SET_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ALG_SET_KEY) == (1), "ALG_SET_KEY != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ALG_SET_KEY 1 +#endif +#if defined(ALG_SET_IV) || (defined(HAVE_DECL_ALG_SET_IV) && HAVE_DECL_ALG_SET_IV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ALG_SET_IV) == (2), "ALG_SET_IV != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ALG_SET_IV 2 +#endif +#if defined(ALG_SET_OP) || (defined(HAVE_DECL_ALG_SET_OP) && HAVE_DECL_ALG_SET_OP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ALG_SET_OP) == (3), "ALG_SET_OP != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ALG_SET_OP 3 +#endif +#if defined(ALG_SET_AEAD_ASSOCLEN) || (defined(HAVE_DECL_ALG_SET_AEAD_ASSOCLEN) && HAVE_DECL_ALG_SET_AEAD_ASSOCLEN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ALG_SET_AEAD_ASSOCLEN) == (4), "ALG_SET_AEAD_ASSOCLEN != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ALG_SET_AEAD_ASSOCLEN 4 +#endif +#if defined(ALG_SET_AEAD_AUTHSIZE) || (defined(HAVE_DECL_ALG_SET_AEAD_AUTHSIZE) && HAVE_DECL_ALG_SET_AEAD_AUTHSIZE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ALG_SET_AEAD_AUTHSIZE) == (5), "ALG_SET_AEAD_AUTHSIZE != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define ALG_SET_AEAD_AUTHSIZE 5 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_alg_options in mpers mode + +# else + +static +const struct xlat sock_alg_options[] = { + [ALG_SET_KEY] = XLAT(ALG_SET_KEY), + [ALG_SET_IV] = XLAT(ALG_SET_IV), + [ALG_SET_OP] = XLAT(ALG_SET_OP), + [ALG_SET_AEAD_ASSOCLEN] = XLAT(ALG_SET_AEAD_ASSOCLEN), + [ALG_SET_AEAD_AUTHSIZE] = XLAT(ALG_SET_AEAD_AUTHSIZE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_alg_options.in b/xlat/sock_alg_options.in new file mode 100644 index 00000000..a1fb4a18 --- /dev/null +++ b/xlat/sock_alg_options.in @@ -0,0 +1,6 @@ +#value_indexed +ALG_SET_KEY 1 +ALG_SET_IV 2 +ALG_SET_OP 3 +ALG_SET_AEAD_ASSOCLEN 4 +ALG_SET_AEAD_AUTHSIZE 5 diff --git a/xlat/sock_ax25_options.h b/xlat/sock_ax25_options.h new file mode 100644 index 00000000..11c833d1 --- /dev/null +++ b/xlat/sock_ax25_options.h @@ -0,0 +1,116 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_ax25_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(AX25_WINDOW) || (defined(HAVE_DECL_AX25_WINDOW) && HAVE_DECL_AX25_WINDOW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_WINDOW) == (1), "AX25_WINDOW != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_WINDOW 1 +#endif +#if defined(AX25_T1) || (defined(HAVE_DECL_AX25_T1) && HAVE_DECL_AX25_T1) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_T1) == (2), "AX25_T1 != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_T1 2 +#endif +#if defined(AX25_N2) || (defined(HAVE_DECL_AX25_N2) && HAVE_DECL_AX25_N2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_N2) == (3), "AX25_N2 != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_N2 3 +#endif +#if defined(AX25_T3) || (defined(HAVE_DECL_AX25_T3) && HAVE_DECL_AX25_T3) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_T3) == (4), "AX25_T3 != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_T3 4 +#endif +#if defined(AX25_T2) || (defined(HAVE_DECL_AX25_T2) && HAVE_DECL_AX25_T2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_T2) == (5), "AX25_T2 != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_T2 5 +#endif +#if defined(AX25_BACKOFF) || (defined(HAVE_DECL_AX25_BACKOFF) && HAVE_DECL_AX25_BACKOFF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_BACKOFF) == (6), "AX25_BACKOFF != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_BACKOFF 6 +#endif +#if defined(AX25_EXTSEQ) || (defined(HAVE_DECL_AX25_EXTSEQ) && HAVE_DECL_AX25_EXTSEQ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_EXTSEQ) == (7), "AX25_EXTSEQ != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_EXTSEQ 7 +#endif +#if defined(AX25_PIDINCL) || (defined(HAVE_DECL_AX25_PIDINCL) && HAVE_DECL_AX25_PIDINCL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_PIDINCL) == (8), "AX25_PIDINCL != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_PIDINCL 8 +#endif +#if defined(AX25_IDLE) || (defined(HAVE_DECL_AX25_IDLE) && HAVE_DECL_AX25_IDLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_IDLE) == (9), "AX25_IDLE != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_IDLE 9 +#endif +#if defined(AX25_PACLEN) || (defined(HAVE_DECL_AX25_PACLEN) && HAVE_DECL_AX25_PACLEN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_PACLEN) == (10), "AX25_PACLEN != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_PACLEN 10 +#endif +#if defined(AX25_IAMDIGI) || (defined(HAVE_DECL_AX25_IAMDIGI) && HAVE_DECL_AX25_IAMDIGI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((AX25_IAMDIGI) == (12), "AX25_IAMDIGI != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define AX25_IAMDIGI 12 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_ax25_options in mpers mode + +# else + +static +const struct xlat sock_ax25_options[] = { + + XLAT(AX25_WINDOW), + XLAT(AX25_T1), + XLAT(AX25_N2), + XLAT(AX25_T3), + XLAT(AX25_T2), + XLAT(AX25_BACKOFF), + XLAT(AX25_EXTSEQ), + XLAT(AX25_PIDINCL), + XLAT(AX25_IDLE), + XLAT(AX25_PACLEN), + XLAT(AX25_IAMDIGI), + + +#if defined(SO_BINDTODEVICE) || (defined(HAVE_DECL_SO_BINDTODEVICE) && HAVE_DECL_SO_BINDTODEVICE) + XLAT(SO_BINDTODEVICE), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_ax25_options.in b/xlat/sock_ax25_options.in new file mode 100644 index 00000000..4b6bed58 --- /dev/null +++ b/xlat/sock_ax25_options.in @@ -0,0 +1,15 @@ +/* sorted */ +AX25_WINDOW 1 +AX25_T1 2 +AX25_N2 3 +AX25_T3 4 +AX25_T2 5 +AX25_BACKOFF 6 +AX25_EXTSEQ 7 +AX25_PIDINCL 8 +AX25_IDLE 9 +AX25_PACLEN 10 +AX25_IAMDIGI 12 + +/* 13, 25, or 16409, depending on arch */ +SO_BINDTODEVICE diff --git a/xlat/sock_bluetooth_options.h b/xlat/sock_bluetooth_options.h new file mode 100644 index 00000000..4a57abd9 --- /dev/null +++ b/xlat/sock_bluetooth_options.h @@ -0,0 +1,87 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_bluetooth_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(BT_SECURITY) || (defined(HAVE_DECL_BT_SECURITY) && HAVE_DECL_BT_SECURITY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BT_SECURITY) == (4), "BT_SECURITY != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BT_SECURITY 4 +#endif +#if defined(BT_DEFER_SETUP) || (defined(HAVE_DECL_BT_DEFER_SETUP) && HAVE_DECL_BT_DEFER_SETUP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BT_DEFER_SETUP) == (7), "BT_DEFER_SETUP != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BT_DEFER_SETUP 7 +#endif +#if defined(BT_FLUSHABLE) || (defined(HAVE_DECL_BT_FLUSHABLE) && HAVE_DECL_BT_FLUSHABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BT_FLUSHABLE) == (8), "BT_FLUSHABLE != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BT_FLUSHABLE 8 +#endif +#if defined(BT_POWER) || (defined(HAVE_DECL_BT_POWER) && HAVE_DECL_BT_POWER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BT_POWER) == (9), "BT_POWER != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BT_POWER 9 +#endif +#if defined(BT_CHANNEL_POLICY) || (defined(HAVE_DECL_BT_CHANNEL_POLICY) && HAVE_DECL_BT_CHANNEL_POLICY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BT_CHANNEL_POLICY) == (10), "BT_CHANNEL_POLICY != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BT_CHANNEL_POLICY 10 +#endif +#if defined(BT_VOICE) || (defined(HAVE_DECL_BT_VOICE) && HAVE_DECL_BT_VOICE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BT_VOICE) == (11), "BT_VOICE != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BT_VOICE 11 +#endif +#if defined(BT_SNDMTU) || (defined(HAVE_DECL_BT_SNDMTU) && HAVE_DECL_BT_SNDMTU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BT_SNDMTU) == (12), "BT_SNDMTU != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BT_SNDMTU 12 +#endif +#if defined(BT_RCVMTU) || (defined(HAVE_DECL_BT_RCVMTU) && HAVE_DECL_BT_RCVMTU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((BT_RCVMTU) == (13), "BT_RCVMTU != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define BT_RCVMTU 13 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_bluetooth_options in mpers mode + +# else + +static +const struct xlat sock_bluetooth_options[] = { + + XLAT(BT_SECURITY), + XLAT(BT_DEFER_SETUP), + XLAT(BT_FLUSHABLE), + XLAT(BT_POWER), + XLAT(BT_CHANNEL_POLICY), + XLAT(BT_VOICE), + XLAT(BT_SNDMTU), + XLAT(BT_RCVMTU), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_bluetooth_options.in b/xlat/sock_bluetooth_options.in new file mode 100644 index 00000000..919b21b0 --- /dev/null +++ b/xlat/sock_bluetooth_options.in @@ -0,0 +1,9 @@ +/* sort -k2,2n */ +BT_SECURITY 4 +BT_DEFER_SETUP 7 +BT_FLUSHABLE 8 +BT_POWER 9 +BT_CHANNEL_POLICY 10 +BT_VOICE 11 +BT_SNDMTU 12 +BT_RCVMTU 13 diff --git a/xlat/sock_caif_options.h b/xlat/sock_caif_options.h new file mode 100644 index 00000000..1066132f --- /dev/null +++ b/xlat/sock_caif_options.h @@ -0,0 +1,46 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_caif_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(CAIFSO_LINK_SELECT) || (defined(HAVE_DECL_CAIFSO_LINK_SELECT) && HAVE_DECL_CAIFSO_LINK_SELECT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CAIFSO_LINK_SELECT) == (127), "CAIFSO_LINK_SELECT != 127"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CAIFSO_LINK_SELECT 127 +#endif +#if defined(CAIFSO_REQ_PARAM) || (defined(HAVE_DECL_CAIFSO_REQ_PARAM) && HAVE_DECL_CAIFSO_REQ_PARAM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CAIFSO_REQ_PARAM) == (128), "CAIFSO_REQ_PARAM != 128"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CAIFSO_REQ_PARAM 128 +#endif +#if defined(CAIFSO_RSP_PARAM) || (defined(HAVE_DECL_CAIFSO_RSP_PARAM) && HAVE_DECL_CAIFSO_RSP_PARAM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((CAIFSO_RSP_PARAM) == (129), "CAIFSO_RSP_PARAM != 129"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define CAIFSO_RSP_PARAM 129 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_caif_options in mpers mode + +# else + +static +const struct xlat sock_caif_options[] = { + XLAT(CAIFSO_LINK_SELECT), + XLAT(CAIFSO_REQ_PARAM), + XLAT(CAIFSO_RSP_PARAM), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_caif_options.in b/xlat/sock_caif_options.in new file mode 100644 index 00000000..5e1c0444 --- /dev/null +++ b/xlat/sock_caif_options.in @@ -0,0 +1,3 @@ +CAIFSO_LINK_SELECT 127 +CAIFSO_REQ_PARAM 128 +CAIFSO_RSP_PARAM 129 diff --git a/xlat/sock_dccp_options.h b/xlat/sock_dccp_options.h new file mode 100644 index 00000000..41b487cc --- /dev/null +++ b/xlat/sock_dccp_options.h @@ -0,0 +1,151 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_dccp_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(DCCP_SOCKOPT_PACKET_SIZE) || (defined(HAVE_DECL_DCCP_SOCKOPT_PACKET_SIZE) && HAVE_DECL_DCCP_SOCKOPT_PACKET_SIZE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCCP_SOCKOPT_PACKET_SIZE) == (1), "DCCP_SOCKOPT_PACKET_SIZE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCCP_SOCKOPT_PACKET_SIZE 1 +#endif +#if defined(DCCP_SOCKOPT_SERVICE) || (defined(HAVE_DECL_DCCP_SOCKOPT_SERVICE) && HAVE_DECL_DCCP_SOCKOPT_SERVICE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCCP_SOCKOPT_SERVICE) == (2), "DCCP_SOCKOPT_SERVICE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCCP_SOCKOPT_SERVICE 2 +#endif +#if defined(DCCP_SOCKOPT_CHANGE_L) || (defined(HAVE_DECL_DCCP_SOCKOPT_CHANGE_L) && HAVE_DECL_DCCP_SOCKOPT_CHANGE_L) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCCP_SOCKOPT_CHANGE_L) == (3), "DCCP_SOCKOPT_CHANGE_L != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCCP_SOCKOPT_CHANGE_L 3 +#endif +#if defined(DCCP_SOCKOPT_CHANGE_R) || (defined(HAVE_DECL_DCCP_SOCKOPT_CHANGE_R) && HAVE_DECL_DCCP_SOCKOPT_CHANGE_R) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCCP_SOCKOPT_CHANGE_R) == (4), "DCCP_SOCKOPT_CHANGE_R != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCCP_SOCKOPT_CHANGE_R 4 +#endif +#if defined(DCCP_SOCKOPT_GET_CUR_MPS) || (defined(HAVE_DECL_DCCP_SOCKOPT_GET_CUR_MPS) && HAVE_DECL_DCCP_SOCKOPT_GET_CUR_MPS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCCP_SOCKOPT_GET_CUR_MPS) == (5), "DCCP_SOCKOPT_GET_CUR_MPS != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCCP_SOCKOPT_GET_CUR_MPS 5 +#endif +#if defined(DCCP_SOCKOPT_SERVER_TIMEWAIT) || (defined(HAVE_DECL_DCCP_SOCKOPT_SERVER_TIMEWAIT) && HAVE_DECL_DCCP_SOCKOPT_SERVER_TIMEWAIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCCP_SOCKOPT_SERVER_TIMEWAIT) == (6), "DCCP_SOCKOPT_SERVER_TIMEWAIT != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCCP_SOCKOPT_SERVER_TIMEWAIT 6 +#endif +#if defined(DCCP_SOCKOPT_SEND_CSCOV) || (defined(HAVE_DECL_DCCP_SOCKOPT_SEND_CSCOV) && HAVE_DECL_DCCP_SOCKOPT_SEND_CSCOV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCCP_SOCKOPT_SEND_CSCOV) == (10), "DCCP_SOCKOPT_SEND_CSCOV != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCCP_SOCKOPT_SEND_CSCOV 10 +#endif +#if defined(DCCP_SOCKOPT_RECV_CSCOV) || (defined(HAVE_DECL_DCCP_SOCKOPT_RECV_CSCOV) && HAVE_DECL_DCCP_SOCKOPT_RECV_CSCOV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCCP_SOCKOPT_RECV_CSCOV) == (11), "DCCP_SOCKOPT_RECV_CSCOV != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCCP_SOCKOPT_RECV_CSCOV 11 +#endif +#if defined(DCCP_SOCKOPT_AVAILABLE_CCIDS) || (defined(HAVE_DECL_DCCP_SOCKOPT_AVAILABLE_CCIDS) && HAVE_DECL_DCCP_SOCKOPT_AVAILABLE_CCIDS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCCP_SOCKOPT_AVAILABLE_CCIDS) == (12), "DCCP_SOCKOPT_AVAILABLE_CCIDS != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCCP_SOCKOPT_AVAILABLE_CCIDS 12 +#endif +#if defined(DCCP_SOCKOPT_CCID) || (defined(HAVE_DECL_DCCP_SOCKOPT_CCID) && HAVE_DECL_DCCP_SOCKOPT_CCID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCCP_SOCKOPT_CCID) == (13), "DCCP_SOCKOPT_CCID != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCCP_SOCKOPT_CCID 13 +#endif +#if defined(DCCP_SOCKOPT_TX_CCID) || (defined(HAVE_DECL_DCCP_SOCKOPT_TX_CCID) && HAVE_DECL_DCCP_SOCKOPT_TX_CCID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCCP_SOCKOPT_TX_CCID) == (14), "DCCP_SOCKOPT_TX_CCID != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCCP_SOCKOPT_TX_CCID 14 +#endif +#if defined(DCCP_SOCKOPT_RX_CCID) || (defined(HAVE_DECL_DCCP_SOCKOPT_RX_CCID) && HAVE_DECL_DCCP_SOCKOPT_RX_CCID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCCP_SOCKOPT_RX_CCID) == (15), "DCCP_SOCKOPT_RX_CCID != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCCP_SOCKOPT_RX_CCID 15 +#endif +#if defined(DCCP_SOCKOPT_QPOLICY_ID) || (defined(HAVE_DECL_DCCP_SOCKOPT_QPOLICY_ID) && HAVE_DECL_DCCP_SOCKOPT_QPOLICY_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCCP_SOCKOPT_QPOLICY_ID) == (16), "DCCP_SOCKOPT_QPOLICY_ID != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCCP_SOCKOPT_QPOLICY_ID 16 +#endif +#if defined(DCCP_SOCKOPT_QPOLICY_TXQLEN) || (defined(HAVE_DECL_DCCP_SOCKOPT_QPOLICY_TXQLEN) && HAVE_DECL_DCCP_SOCKOPT_QPOLICY_TXQLEN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCCP_SOCKOPT_QPOLICY_TXQLEN) == (17), "DCCP_SOCKOPT_QPOLICY_TXQLEN != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCCP_SOCKOPT_QPOLICY_TXQLEN 17 +#endif +#if defined(DCCP_SOCKOPT_CCID_RX_INFO) || (defined(HAVE_DECL_DCCP_SOCKOPT_CCID_RX_INFO) && HAVE_DECL_DCCP_SOCKOPT_CCID_RX_INFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCCP_SOCKOPT_CCID_RX_INFO) == (128), "DCCP_SOCKOPT_CCID_RX_INFO != 128"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCCP_SOCKOPT_CCID_RX_INFO 128 +#endif +#if defined(DCCP_SOCKOPT_CCID_TX_INFO) || (defined(HAVE_DECL_DCCP_SOCKOPT_CCID_TX_INFO) && HAVE_DECL_DCCP_SOCKOPT_CCID_TX_INFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((DCCP_SOCKOPT_CCID_TX_INFO) == (192), "DCCP_SOCKOPT_CCID_TX_INFO != 192"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define DCCP_SOCKOPT_CCID_TX_INFO 192 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_dccp_options in mpers mode + +# else + +static +const struct xlat sock_dccp_options[] = { + + XLAT(DCCP_SOCKOPT_PACKET_SIZE), + XLAT(DCCP_SOCKOPT_SERVICE), + XLAT(DCCP_SOCKOPT_CHANGE_L), + XLAT(DCCP_SOCKOPT_CHANGE_R), + XLAT(DCCP_SOCKOPT_GET_CUR_MPS), + XLAT(DCCP_SOCKOPT_SERVER_TIMEWAIT), + XLAT(DCCP_SOCKOPT_SEND_CSCOV), + XLAT(DCCP_SOCKOPT_RECV_CSCOV), + XLAT(DCCP_SOCKOPT_AVAILABLE_CCIDS), + XLAT(DCCP_SOCKOPT_CCID), + XLAT(DCCP_SOCKOPT_TX_CCID), + XLAT(DCCP_SOCKOPT_RX_CCID), + XLAT(DCCP_SOCKOPT_QPOLICY_ID), + XLAT(DCCP_SOCKOPT_QPOLICY_TXQLEN), + XLAT(DCCP_SOCKOPT_CCID_RX_INFO), + XLAT(DCCP_SOCKOPT_CCID_TX_INFO), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_dccp_options.in b/xlat/sock_dccp_options.in new file mode 100644 index 00000000..06a0efe8 --- /dev/null +++ b/xlat/sock_dccp_options.in @@ -0,0 +1,17 @@ +/* sort -k2,2n */ +DCCP_SOCKOPT_PACKET_SIZE 1 +DCCP_SOCKOPT_SERVICE 2 +DCCP_SOCKOPT_CHANGE_L 3 +DCCP_SOCKOPT_CHANGE_R 4 +DCCP_SOCKOPT_GET_CUR_MPS 5 +DCCP_SOCKOPT_SERVER_TIMEWAIT 6 +DCCP_SOCKOPT_SEND_CSCOV 10 +DCCP_SOCKOPT_RECV_CSCOV 11 +DCCP_SOCKOPT_AVAILABLE_CCIDS 12 +DCCP_SOCKOPT_CCID 13 +DCCP_SOCKOPT_TX_CCID 14 +DCCP_SOCKOPT_RX_CCID 15 +DCCP_SOCKOPT_QPOLICY_ID 16 +DCCP_SOCKOPT_QPOLICY_TXQLEN 17 +DCCP_SOCKOPT_CCID_RX_INFO 128 +DCCP_SOCKOPT_CCID_TX_INFO 192 diff --git a/xlat/sock_ip_options.h b/xlat/sock_ip_options.h new file mode 100644 index 00000000..496db57c --- /dev/null +++ b/xlat/sock_ip_options.h @@ -0,0 +1,172 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_ip_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_ip_options in mpers mode + +# else + +static +const struct xlat sock_ip_options[] = { +#if defined(IP_TOS) || (defined(HAVE_DECL_IP_TOS) && HAVE_DECL_IP_TOS) + XLAT(IP_TOS), +#endif +#if defined(IP_TTL) || (defined(HAVE_DECL_IP_TTL) && HAVE_DECL_IP_TTL) + XLAT(IP_TTL), +#endif +#if defined(IP_HDRINCL) || (defined(HAVE_DECL_IP_HDRINCL) && HAVE_DECL_IP_HDRINCL) + XLAT(IP_HDRINCL), +#endif +#if defined(IP_OPTIONS) || (defined(HAVE_DECL_IP_OPTIONS) && HAVE_DECL_IP_OPTIONS) + XLAT(IP_OPTIONS), +#endif +#if defined(IP_ROUTER_ALERT) || (defined(HAVE_DECL_IP_ROUTER_ALERT) && HAVE_DECL_IP_ROUTER_ALERT) + XLAT(IP_ROUTER_ALERT), +#endif +#if defined(IP_RECVOPTIONS) || (defined(HAVE_DECL_IP_RECVOPTIONS) && HAVE_DECL_IP_RECVOPTIONS) + XLAT(IP_RECVOPTIONS), +#endif +#if defined(IP_RECVOPTS) || (defined(HAVE_DECL_IP_RECVOPTS) && HAVE_DECL_IP_RECVOPTS) + XLAT(IP_RECVOPTS), +#endif +#if defined(IP_RETOPTS) || (defined(HAVE_DECL_IP_RETOPTS) && HAVE_DECL_IP_RETOPTS) + XLAT(IP_RETOPTS), +#endif +#if defined(IP_RECVRETOPTS) || (defined(HAVE_DECL_IP_RECVRETOPTS) && HAVE_DECL_IP_RECVRETOPTS) + XLAT(IP_RECVRETOPTS), +#endif +#if defined(IP_RECVDSTADDR) || (defined(HAVE_DECL_IP_RECVDSTADDR) && HAVE_DECL_IP_RECVDSTADDR) + XLAT(IP_RECVDSTADDR), +#endif +#if defined(IP_PKTINFO) || (defined(HAVE_DECL_IP_PKTINFO) && HAVE_DECL_IP_PKTINFO) + XLAT(IP_PKTINFO), +#endif +#if defined(IP_PKTOPTIONS) || (defined(HAVE_DECL_IP_PKTOPTIONS) && HAVE_DECL_IP_PKTOPTIONS) + XLAT(IP_PKTOPTIONS), +#endif +#if defined(IP_MTU_DISCOVER) || (defined(HAVE_DECL_IP_MTU_DISCOVER) && HAVE_DECL_IP_MTU_DISCOVER) + XLAT(IP_MTU_DISCOVER), +#endif +#if defined(IP_RECVERR) || (defined(HAVE_DECL_IP_RECVERR) && HAVE_DECL_IP_RECVERR) + XLAT(IP_RECVERR), +#endif +#if defined(IP_RECVTTL) || (defined(HAVE_DECL_IP_RECVTTL) && HAVE_DECL_IP_RECVTTL) + XLAT(IP_RECVTTL), +#endif +#if defined(IP_RECVTOS) || (defined(HAVE_DECL_IP_RECVTOS) && HAVE_DECL_IP_RECVTOS) + XLAT(IP_RECVTOS), +#endif +#if defined(IP_MTU) || (defined(HAVE_DECL_IP_MTU) && HAVE_DECL_IP_MTU) + XLAT(IP_MTU), +#endif +#if defined(IP_MULTICAST_IF) || (defined(HAVE_DECL_IP_MULTICAST_IF) && HAVE_DECL_IP_MULTICAST_IF) + XLAT(IP_MULTICAST_IF), +#endif +#if defined(IP_MULTICAST_TTL) || (defined(HAVE_DECL_IP_MULTICAST_TTL) && HAVE_DECL_IP_MULTICAST_TTL) + XLAT(IP_MULTICAST_TTL), +#endif +#if defined(IP_MULTICAST_LOOP) || (defined(HAVE_DECL_IP_MULTICAST_LOOP) && HAVE_DECL_IP_MULTICAST_LOOP) + XLAT(IP_MULTICAST_LOOP), +#endif +#if defined(IP_ADD_MEMBERSHIP) || (defined(HAVE_DECL_IP_ADD_MEMBERSHIP) && HAVE_DECL_IP_ADD_MEMBERSHIP) + XLAT(IP_ADD_MEMBERSHIP), +#endif +#if defined(IP_DROP_MEMBERSHIP) || (defined(HAVE_DECL_IP_DROP_MEMBERSHIP) && HAVE_DECL_IP_DROP_MEMBERSHIP) + XLAT(IP_DROP_MEMBERSHIP), +#endif +#if defined(IP_BROADCAST_IF) || (defined(HAVE_DECL_IP_BROADCAST_IF) && HAVE_DECL_IP_BROADCAST_IF) + XLAT(IP_BROADCAST_IF), +#endif +#if defined(IP_RECVIFINDEX) || (defined(HAVE_DECL_IP_RECVIFINDEX) && HAVE_DECL_IP_RECVIFINDEX) + XLAT(IP_RECVIFINDEX), +#endif +#if defined(IP_MSFILTER) || (defined(HAVE_DECL_IP_MSFILTER) && HAVE_DECL_IP_MSFILTER) + XLAT(IP_MSFILTER), +#endif +#if defined(IP_FREEBIND) || (defined(HAVE_DECL_IP_FREEBIND) && HAVE_DECL_IP_FREEBIND) + XLAT(IP_FREEBIND), +#endif +#if defined(IP_IPSEC_POLICY) || (defined(HAVE_DECL_IP_IPSEC_POLICY) && HAVE_DECL_IP_IPSEC_POLICY) + XLAT(IP_IPSEC_POLICY), +#endif +#if defined(IP_XFRM_POLICY) || (defined(HAVE_DECL_IP_XFRM_POLICY) && HAVE_DECL_IP_XFRM_POLICY) + XLAT(IP_XFRM_POLICY), +#endif +#if defined(IP_PASSSEC) || (defined(HAVE_DECL_IP_PASSSEC) && HAVE_DECL_IP_PASSSEC) + XLAT(IP_PASSSEC), +#endif +#if defined(IP_TRANSPARENT) || (defined(HAVE_DECL_IP_TRANSPARENT) && HAVE_DECL_IP_TRANSPARENT) + XLAT(IP_TRANSPARENT), +#endif +#if defined(IP_ORIGDSTADDR) || (defined(HAVE_DECL_IP_ORIGDSTADDR) && HAVE_DECL_IP_ORIGDSTADDR) + XLAT(IP_ORIGDSTADDR), +#endif +#if defined(IP_RECVORIGDSTADDR) || (defined(HAVE_DECL_IP_RECVORIGDSTADDR) && HAVE_DECL_IP_RECVORIGDSTADDR) + XLAT(IP_RECVORIGDSTADDR), +#endif +#if defined(IP_MINTTL) || (defined(HAVE_DECL_IP_MINTTL) && HAVE_DECL_IP_MINTTL) + XLAT(IP_MINTTL), +#endif +#if defined(IP_NODEFRAG) || (defined(HAVE_DECL_IP_NODEFRAG) && HAVE_DECL_IP_NODEFRAG) + XLAT(IP_NODEFRAG), +#endif +#if defined(IP_CHECKSUM) || (defined(HAVE_DECL_IP_CHECKSUM) && HAVE_DECL_IP_CHECKSUM) + XLAT(IP_CHECKSUM), +#endif +#if defined(IP_BIND_ADDRESS_NO_PORT) || (defined(HAVE_DECL_IP_BIND_ADDRESS_NO_PORT) && HAVE_DECL_IP_BIND_ADDRESS_NO_PORT) + XLAT(IP_BIND_ADDRESS_NO_PORT), +#endif +#if defined(IP_RECVFRAGSIZE) || (defined(HAVE_DECL_IP_RECVFRAGSIZE) && HAVE_DECL_IP_RECVFRAGSIZE) + XLAT(IP_RECVFRAGSIZE), +#endif +#if defined(IP_UNBLOCK_SOURCE) || (defined(HAVE_DECL_IP_UNBLOCK_SOURCE) && HAVE_DECL_IP_UNBLOCK_SOURCE) + XLAT(IP_UNBLOCK_SOURCE), +#endif +#if defined(IP_BLOCK_SOURCE) || (defined(HAVE_DECL_IP_BLOCK_SOURCE) && HAVE_DECL_IP_BLOCK_SOURCE) + XLAT(IP_BLOCK_SOURCE), +#endif +#if defined(IP_ADD_SOURCE_MEMBERSHIP) || (defined(HAVE_DECL_IP_ADD_SOURCE_MEMBERSHIP) && HAVE_DECL_IP_ADD_SOURCE_MEMBERSHIP) + XLAT(IP_ADD_SOURCE_MEMBERSHIP), +#endif +#if defined(IP_DROP_SOURCE_MEMBERSHIP) || (defined(HAVE_DECL_IP_DROP_SOURCE_MEMBERSHIP) && HAVE_DECL_IP_DROP_SOURCE_MEMBERSHIP) + XLAT(IP_DROP_SOURCE_MEMBERSHIP), +#endif +#if defined(MCAST_JOIN_GROUP) || (defined(HAVE_DECL_MCAST_JOIN_GROUP) && HAVE_DECL_MCAST_JOIN_GROUP) + XLAT(MCAST_JOIN_GROUP), +#endif +#if defined(MCAST_BLOCK_SOURCE) || (defined(HAVE_DECL_MCAST_BLOCK_SOURCE) && HAVE_DECL_MCAST_BLOCK_SOURCE) + XLAT(MCAST_BLOCK_SOURCE), +#endif +#if defined(MCAST_UNBLOCK_SOURCE) || (defined(HAVE_DECL_MCAST_UNBLOCK_SOURCE) && HAVE_DECL_MCAST_UNBLOCK_SOURCE) + XLAT(MCAST_UNBLOCK_SOURCE), +#endif +#if defined(MCAST_LEAVE_GROUP) || (defined(HAVE_DECL_MCAST_LEAVE_GROUP) && HAVE_DECL_MCAST_LEAVE_GROUP) + XLAT(MCAST_LEAVE_GROUP), +#endif +#if defined(MCAST_JOIN_SOURCE_GROUP) || (defined(HAVE_DECL_MCAST_JOIN_SOURCE_GROUP) && HAVE_DECL_MCAST_JOIN_SOURCE_GROUP) + XLAT(MCAST_JOIN_SOURCE_GROUP), +#endif +#if defined(MCAST_LEAVE_SOURCE_GROUP) || (defined(HAVE_DECL_MCAST_LEAVE_SOURCE_GROUP) && HAVE_DECL_MCAST_LEAVE_SOURCE_GROUP) + XLAT(MCAST_LEAVE_SOURCE_GROUP), +#endif +#if defined(MCAST_MSFILTER) || (defined(HAVE_DECL_MCAST_MSFILTER) && HAVE_DECL_MCAST_MSFILTER) + XLAT(MCAST_MSFILTER), +#endif +#if defined(IP_MULTICAST_ALL) || (defined(HAVE_DECL_IP_MULTICAST_ALL) && HAVE_DECL_IP_MULTICAST_ALL) + XLAT(IP_MULTICAST_ALL), +#endif +#if defined(IP_UNICAST_IF) || (defined(HAVE_DECL_IP_UNICAST_IF) && HAVE_DECL_IP_UNICAST_IF) + XLAT(IP_UNICAST_IF), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sockipoptions.in b/xlat/sock_ip_options.in similarity index 100% rename from xlat/sockipoptions.in rename to xlat/sock_ip_options.in diff --git a/xlat/sock_ipv6_options.h b/xlat/sock_ipv6_options.h new file mode 100644 index 00000000..ad58b5d1 --- /dev/null +++ b/xlat/sock_ipv6_options.h @@ -0,0 +1,214 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_ipv6_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_ipv6_options in mpers mode + +# else + +static +const struct xlat sock_ipv6_options[] = { +#if defined(IPV6_ADDRFORM) || (defined(HAVE_DECL_IPV6_ADDRFORM) && HAVE_DECL_IPV6_ADDRFORM) + XLAT(IPV6_ADDRFORM), +#endif +#if defined(IPV6_2292PKTINFO) || (defined(HAVE_DECL_IPV6_2292PKTINFO) && HAVE_DECL_IPV6_2292PKTINFO) + XLAT(IPV6_2292PKTINFO), +#endif +#if defined(IPV6_2292HOPOPTS) || (defined(HAVE_DECL_IPV6_2292HOPOPTS) && HAVE_DECL_IPV6_2292HOPOPTS) + XLAT(IPV6_2292HOPOPTS), +#endif +#if defined(IPV6_2292DSTOPTS) || (defined(HAVE_DECL_IPV6_2292DSTOPTS) && HAVE_DECL_IPV6_2292DSTOPTS) + XLAT(IPV6_2292DSTOPTS), +#endif +#if defined(IPV6_2292RTHDR) || (defined(HAVE_DECL_IPV6_2292RTHDR) && HAVE_DECL_IPV6_2292RTHDR) + XLAT(IPV6_2292RTHDR), +#endif +#if defined(IPV6_2292PKTOPTIONS) || (defined(HAVE_DECL_IPV6_2292PKTOPTIONS) && HAVE_DECL_IPV6_2292PKTOPTIONS) + XLAT(IPV6_2292PKTOPTIONS), +#endif +#if defined(IPV6_CHECKSUM) || (defined(HAVE_DECL_IPV6_CHECKSUM) && HAVE_DECL_IPV6_CHECKSUM) + XLAT(IPV6_CHECKSUM), +#endif +#if defined(IPV6_2292HOPLIMIT) || (defined(HAVE_DECL_IPV6_2292HOPLIMIT) && HAVE_DECL_IPV6_2292HOPLIMIT) + XLAT(IPV6_2292HOPLIMIT), +#endif +#if defined(IPV6_NEXTHOP) || (defined(HAVE_DECL_IPV6_NEXTHOP) && HAVE_DECL_IPV6_NEXTHOP) + XLAT(IPV6_NEXTHOP), +#endif +#if defined(IPV6_AUTHHDR) || (defined(HAVE_DECL_IPV6_AUTHHDR) && HAVE_DECL_IPV6_AUTHHDR) + XLAT(IPV6_AUTHHDR), +#endif +#if defined(IPV6_FLOWINFO) || (defined(HAVE_DECL_IPV6_FLOWINFO) && HAVE_DECL_IPV6_FLOWINFO) + XLAT(IPV6_FLOWINFO), +#endif +#if defined(IPV6_UNICAST_HOPS) || (defined(HAVE_DECL_IPV6_UNICAST_HOPS) && HAVE_DECL_IPV6_UNICAST_HOPS) + XLAT(IPV6_UNICAST_HOPS), +#endif +#if defined(IPV6_MULTICAST_IF) || (defined(HAVE_DECL_IPV6_MULTICAST_IF) && HAVE_DECL_IPV6_MULTICAST_IF) + XLAT(IPV6_MULTICAST_IF), +#endif +#if defined(IPV6_MULTICAST_HOPS) || (defined(HAVE_DECL_IPV6_MULTICAST_HOPS) && HAVE_DECL_IPV6_MULTICAST_HOPS) + XLAT(IPV6_MULTICAST_HOPS), +#endif +#if defined(IPV6_MULTICAST_LOOP) || (defined(HAVE_DECL_IPV6_MULTICAST_LOOP) && HAVE_DECL_IPV6_MULTICAST_LOOP) + XLAT(IPV6_MULTICAST_LOOP), +#endif +#if defined(IPV6_ADD_MEMBERSHIP) || (defined(HAVE_DECL_IPV6_ADD_MEMBERSHIP) && HAVE_DECL_IPV6_ADD_MEMBERSHIP) + XLAT(IPV6_ADD_MEMBERSHIP), +#endif +#if defined(IPV6_DROP_MEMBERSHIP) || (defined(HAVE_DECL_IPV6_DROP_MEMBERSHIP) && HAVE_DECL_IPV6_DROP_MEMBERSHIP) + XLAT(IPV6_DROP_MEMBERSHIP), +#endif +#if defined(IPV6_ROUTER_ALERT) || (defined(HAVE_DECL_IPV6_ROUTER_ALERT) && HAVE_DECL_IPV6_ROUTER_ALERT) + XLAT(IPV6_ROUTER_ALERT), +#endif +#if defined(IPV6_MTU_DISCOVER) || (defined(HAVE_DECL_IPV6_MTU_DISCOVER) && HAVE_DECL_IPV6_MTU_DISCOVER) + XLAT(IPV6_MTU_DISCOVER), +#endif +#if defined(IPV6_MTU) || (defined(HAVE_DECL_IPV6_MTU) && HAVE_DECL_IPV6_MTU) + XLAT(IPV6_MTU), +#endif +#if defined(IPV6_RECVERR) || (defined(HAVE_DECL_IPV6_RECVERR) && HAVE_DECL_IPV6_RECVERR) + XLAT(IPV6_RECVERR), +#endif +#if defined(IPV6_V6ONLY) || (defined(HAVE_DECL_IPV6_V6ONLY) && HAVE_DECL_IPV6_V6ONLY) + XLAT(IPV6_V6ONLY), +#endif +#if defined(IPV6_JOIN_ANYCAST) || (defined(HAVE_DECL_IPV6_JOIN_ANYCAST) && HAVE_DECL_IPV6_JOIN_ANYCAST) + XLAT(IPV6_JOIN_ANYCAST), +#endif +#if defined(IPV6_LEAVE_ANYCAST) || (defined(HAVE_DECL_IPV6_LEAVE_ANYCAST) && HAVE_DECL_IPV6_LEAVE_ANYCAST) + XLAT(IPV6_LEAVE_ANYCAST), +#endif +#if defined(IPV6_MULTICAST_ALL) || (defined(HAVE_DECL_IPV6_MULTICAST_ALL) && HAVE_DECL_IPV6_MULTICAST_ALL) + XLAT(IPV6_MULTICAST_ALL), +#endif +#if defined(IPV6_ROUTER_ALERT_ISOLATE) || (defined(HAVE_DECL_IPV6_ROUTER_ALERT_ISOLATE) && HAVE_DECL_IPV6_ROUTER_ALERT_ISOLATE) + XLAT(IPV6_ROUTER_ALERT_ISOLATE), +#endif +#if defined(IPV6_FLOWLABEL_MGR) || (defined(HAVE_DECL_IPV6_FLOWLABEL_MGR) && HAVE_DECL_IPV6_FLOWLABEL_MGR) + XLAT(IPV6_FLOWLABEL_MGR), +#endif +#if defined(IPV6_FLOWINFO_SEND) || (defined(HAVE_DECL_IPV6_FLOWINFO_SEND) && HAVE_DECL_IPV6_FLOWINFO_SEND) + XLAT(IPV6_FLOWINFO_SEND), +#endif +#if defined(IPV6_IPSEC_POLICY) || (defined(HAVE_DECL_IPV6_IPSEC_POLICY) && HAVE_DECL_IPV6_IPSEC_POLICY) + XLAT(IPV6_IPSEC_POLICY), +#endif +#if defined(IPV6_XFRM_POLICY) || (defined(HAVE_DECL_IPV6_XFRM_POLICY) && HAVE_DECL_IPV6_XFRM_POLICY) + XLAT(IPV6_XFRM_POLICY), +#endif +#if defined(IPV6_HDRINCL) || (defined(HAVE_DECL_IPV6_HDRINCL) && HAVE_DECL_IPV6_HDRINCL) + XLAT(IPV6_HDRINCL), +#endif +#if defined(MCAST_JOIN_GROUP) || (defined(HAVE_DECL_MCAST_JOIN_GROUP) && HAVE_DECL_MCAST_JOIN_GROUP) + XLAT(MCAST_JOIN_GROUP), +#endif +#if defined(MCAST_BLOCK_SOURCE) || (defined(HAVE_DECL_MCAST_BLOCK_SOURCE) && HAVE_DECL_MCAST_BLOCK_SOURCE) + XLAT(MCAST_BLOCK_SOURCE), +#endif +#if defined(MCAST_UNBLOCK_SOURCE) || (defined(HAVE_DECL_MCAST_UNBLOCK_SOURCE) && HAVE_DECL_MCAST_UNBLOCK_SOURCE) + XLAT(MCAST_UNBLOCK_SOURCE), +#endif +#if defined(MCAST_LEAVE_GROUP) || (defined(HAVE_DECL_MCAST_LEAVE_GROUP) && HAVE_DECL_MCAST_LEAVE_GROUP) + XLAT(MCAST_LEAVE_GROUP), +#endif +#if defined(MCAST_JOIN_SOURCE_GROUP) || (defined(HAVE_DECL_MCAST_JOIN_SOURCE_GROUP) && HAVE_DECL_MCAST_JOIN_SOURCE_GROUP) + XLAT(MCAST_JOIN_SOURCE_GROUP), +#endif +#if defined(MCAST_LEAVE_SOURCE_GROUP) || (defined(HAVE_DECL_MCAST_LEAVE_SOURCE_GROUP) && HAVE_DECL_MCAST_LEAVE_SOURCE_GROUP) + XLAT(MCAST_LEAVE_SOURCE_GROUP), +#endif +#if defined(MCAST_MSFILTER) || (defined(HAVE_DECL_MCAST_MSFILTER) && HAVE_DECL_MCAST_MSFILTER) + XLAT(MCAST_MSFILTER), +#endif +#if defined(IPV6_RECVPKTINFO) || (defined(HAVE_DECL_IPV6_RECVPKTINFO) && HAVE_DECL_IPV6_RECVPKTINFO) + XLAT(IPV6_RECVPKTINFO), +#endif +#if defined(IPV6_PKTINFO) || (defined(HAVE_DECL_IPV6_PKTINFO) && HAVE_DECL_IPV6_PKTINFO) + XLAT(IPV6_PKTINFO), +#endif +#if defined(IPV6_RECVHOPLIMIT) || (defined(HAVE_DECL_IPV6_RECVHOPLIMIT) && HAVE_DECL_IPV6_RECVHOPLIMIT) + XLAT(IPV6_RECVHOPLIMIT), +#endif +#if defined(IPV6_HOPLIMIT) || (defined(HAVE_DECL_IPV6_HOPLIMIT) && HAVE_DECL_IPV6_HOPLIMIT) + XLAT(IPV6_HOPLIMIT), +#endif +#if defined(IPV6_RECVHOPOPTS) || (defined(HAVE_DECL_IPV6_RECVHOPOPTS) && HAVE_DECL_IPV6_RECVHOPOPTS) + XLAT(IPV6_RECVHOPOPTS), +#endif +#if defined(IPV6_HOPOPTS) || (defined(HAVE_DECL_IPV6_HOPOPTS) && HAVE_DECL_IPV6_HOPOPTS) + XLAT(IPV6_HOPOPTS), +#endif +#if defined(IPV6_RTHDRDSTOPTS) || (defined(HAVE_DECL_IPV6_RTHDRDSTOPTS) && HAVE_DECL_IPV6_RTHDRDSTOPTS) + XLAT(IPV6_RTHDRDSTOPTS), +#endif +#if defined(IPV6_RECVRTHDR) || (defined(HAVE_DECL_IPV6_RECVRTHDR) && HAVE_DECL_IPV6_RECVRTHDR) + XLAT(IPV6_RECVRTHDR), +#endif +#if defined(IPV6_RTHDR) || (defined(HAVE_DECL_IPV6_RTHDR) && HAVE_DECL_IPV6_RTHDR) + XLAT(IPV6_RTHDR), +#endif +#if defined(IPV6_RECVDSTOPTS) || (defined(HAVE_DECL_IPV6_RECVDSTOPTS) && HAVE_DECL_IPV6_RECVDSTOPTS) + XLAT(IPV6_RECVDSTOPTS), +#endif +#if defined(IPV6_DSTOPTS) || (defined(HAVE_DECL_IPV6_DSTOPTS) && HAVE_DECL_IPV6_DSTOPTS) + XLAT(IPV6_DSTOPTS), +#endif +#if defined(IPV6_RECVPATHMTU) || (defined(HAVE_DECL_IPV6_RECVPATHMTU) && HAVE_DECL_IPV6_RECVPATHMTU) + XLAT(IPV6_RECVPATHMTU), +#endif +#if defined(IPV6_PATHMTU) || (defined(HAVE_DECL_IPV6_PATHMTU) && HAVE_DECL_IPV6_PATHMTU) + XLAT(IPV6_PATHMTU), +#endif +#if defined(IPV6_DONTFRAG) || (defined(HAVE_DECL_IPV6_DONTFRAG) && HAVE_DECL_IPV6_DONTFRAG) + XLAT(IPV6_DONTFRAG), +#endif +#if defined(IPV6_USE_MIN_MTU) || (defined(HAVE_DECL_IPV6_USE_MIN_MTU) && HAVE_DECL_IPV6_USE_MIN_MTU) + XLAT(IPV6_USE_MIN_MTU), +#endif +#if defined(IPV6_RECVTCLASS) || (defined(HAVE_DECL_IPV6_RECVTCLASS) && HAVE_DECL_IPV6_RECVTCLASS) + XLAT(IPV6_RECVTCLASS), +#endif +#if defined(IPV6_TCLASS) || (defined(HAVE_DECL_IPV6_TCLASS) && HAVE_DECL_IPV6_TCLASS) + XLAT(IPV6_TCLASS), +#endif +#if defined(IPV6_AUTOFLOWLABEL) || (defined(HAVE_DECL_IPV6_AUTOFLOWLABEL) && HAVE_DECL_IPV6_AUTOFLOWLABEL) + XLAT(IPV6_AUTOFLOWLABEL), +#endif +#if defined(IPV6_ADDR_PREFERENCES) || (defined(HAVE_DECL_IPV6_ADDR_PREFERENCES) && HAVE_DECL_IPV6_ADDR_PREFERENCES) + XLAT(IPV6_ADDR_PREFERENCES), +#endif +#if defined(IPV6_MINHOPCOUNT) || (defined(HAVE_DECL_IPV6_MINHOPCOUNT) && HAVE_DECL_IPV6_MINHOPCOUNT) + XLAT(IPV6_MINHOPCOUNT), +#endif +#if defined(IPV6_ORIGDSTADDR) || (defined(HAVE_DECL_IPV6_ORIGDSTADDR) && HAVE_DECL_IPV6_ORIGDSTADDR) + XLAT(IPV6_ORIGDSTADDR), +#endif +#if defined(IPV6_RECVORIGDSTADDR) || (defined(HAVE_DECL_IPV6_RECVORIGDSTADDR) && HAVE_DECL_IPV6_RECVORIGDSTADDR) + XLAT(IPV6_RECVORIGDSTADDR), +#endif +#if defined(IPV6_TRANSPARENT) || (defined(HAVE_DECL_IPV6_TRANSPARENT) && HAVE_DECL_IPV6_TRANSPARENT) + XLAT(IPV6_TRANSPARENT), +#endif +#if defined(IPV6_UNICAST_IF) || (defined(HAVE_DECL_IPV6_UNICAST_IF) && HAVE_DECL_IPV6_UNICAST_IF) + XLAT(IPV6_UNICAST_IF), +#endif +#if defined(IPV6_RECVFRAGSIZE) || (defined(HAVE_DECL_IPV6_RECVFRAGSIZE) && HAVE_DECL_IPV6_RECVFRAGSIZE) + XLAT(IPV6_RECVFRAGSIZE), +#endif +#if defined(IPV6_FREEBIND) || (defined(HAVE_DECL_IPV6_FREEBIND) && HAVE_DECL_IPV6_FREEBIND) + XLAT(IPV6_FREEBIND), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_ipv6_options.in b/xlat/sock_ipv6_options.in new file mode 100644 index 00000000..97fcbbfa --- /dev/null +++ b/xlat/sock_ipv6_options.in @@ -0,0 +1,64 @@ +IPV6_ADDRFORM +IPV6_2292PKTINFO +IPV6_2292HOPOPTS +IPV6_2292DSTOPTS +IPV6_2292RTHDR +IPV6_2292PKTOPTIONS +IPV6_CHECKSUM +IPV6_2292HOPLIMIT +IPV6_NEXTHOP +IPV6_AUTHHDR +IPV6_FLOWINFO +IPV6_UNICAST_HOPS +IPV6_MULTICAST_IF +IPV6_MULTICAST_HOPS +IPV6_MULTICAST_LOOP +IPV6_ADD_MEMBERSHIP +IPV6_DROP_MEMBERSHIP +IPV6_ROUTER_ALERT +IPV6_MTU_DISCOVER +IPV6_MTU +IPV6_RECVERR +IPV6_V6ONLY +IPV6_JOIN_ANYCAST +IPV6_LEAVE_ANYCAST +IPV6_MULTICAST_ALL +IPV6_ROUTER_ALERT_ISOLATE +IPV6_FLOWLABEL_MGR +IPV6_FLOWINFO_SEND +IPV6_IPSEC_POLICY +IPV6_XFRM_POLICY +IPV6_HDRINCL +MCAST_JOIN_GROUP +MCAST_BLOCK_SOURCE +MCAST_UNBLOCK_SOURCE +MCAST_LEAVE_GROUP +MCAST_JOIN_SOURCE_GROUP +MCAST_LEAVE_SOURCE_GROUP +MCAST_MSFILTER +IPV6_RECVPKTINFO +IPV6_PKTINFO +IPV6_RECVHOPLIMIT +IPV6_HOPLIMIT +IPV6_RECVHOPOPTS +IPV6_HOPOPTS +IPV6_RTHDRDSTOPTS +IPV6_RECVRTHDR +IPV6_RTHDR +IPV6_RECVDSTOPTS +IPV6_DSTOPTS +IPV6_RECVPATHMTU +IPV6_PATHMTU +IPV6_DONTFRAG +IPV6_USE_MIN_MTU +IPV6_RECVTCLASS +IPV6_TCLASS +IPV6_AUTOFLOWLABEL +IPV6_ADDR_PREFERENCES +IPV6_MINHOPCOUNT +IPV6_ORIGDSTADDR +IPV6_RECVORIGDSTADDR +IPV6_TRANSPARENT +IPV6_UNICAST_IF +IPV6_RECVFRAGSIZE +IPV6_FREEBIND diff --git a/xlat/sock_ipx_options.h b/xlat/sock_ipx_options.h new file mode 100644 index 00000000..cee80f17 --- /dev/null +++ b/xlat/sock_ipx_options.h @@ -0,0 +1,25 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_ipx_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_ipx_options in mpers mode + +# else + +static +const struct xlat sock_ipx_options[] = { +#if defined(IPX_TYPE) || (defined(HAVE_DECL_IPX_TYPE) && HAVE_DECL_IPX_TYPE) + XLAT(IPX_TYPE), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sockipxoptions.in b/xlat/sock_ipx_options.in similarity index 100% rename from xlat/sockipxoptions.in rename to xlat/sock_ipx_options.in diff --git a/xlat/sock_irda_options.h b/xlat/sock_irda_options.h new file mode 100644 index 00000000..59643905 --- /dev/null +++ b/xlat/sock_irda_options.h @@ -0,0 +1,110 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_irda_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(IRLMP_ENUMDEVICES) || (defined(HAVE_DECL_IRLMP_ENUMDEVICES) && HAVE_DECL_IRLMP_ENUMDEVICES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IRLMP_ENUMDEVICES) == (1), "IRLMP_ENUMDEVICES != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IRLMP_ENUMDEVICES 1 +#endif +#if defined(IRLMP_IAS_SET) || (defined(HAVE_DECL_IRLMP_IAS_SET) && HAVE_DECL_IRLMP_IAS_SET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IRLMP_IAS_SET) == (2), "IRLMP_IAS_SET != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IRLMP_IAS_SET 2 +#endif +#if defined(IRLMP_IAS_QUERY) || (defined(HAVE_DECL_IRLMP_IAS_QUERY) && HAVE_DECL_IRLMP_IAS_QUERY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IRLMP_IAS_QUERY) == (3), "IRLMP_IAS_QUERY != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IRLMP_IAS_QUERY 3 +#endif +#if defined(IRLMP_HINTS_SET) || (defined(HAVE_DECL_IRLMP_HINTS_SET) && HAVE_DECL_IRLMP_HINTS_SET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IRLMP_HINTS_SET) == (4), "IRLMP_HINTS_SET != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IRLMP_HINTS_SET 4 +#endif +#if defined(IRLMP_QOS_SET) || (defined(HAVE_DECL_IRLMP_QOS_SET) && HAVE_DECL_IRLMP_QOS_SET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IRLMP_QOS_SET) == (5), "IRLMP_QOS_SET != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IRLMP_QOS_SET 5 +#endif +#if defined(IRLMP_QOS_GET) || (defined(HAVE_DECL_IRLMP_QOS_GET) && HAVE_DECL_IRLMP_QOS_GET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IRLMP_QOS_GET) == (6), "IRLMP_QOS_GET != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IRLMP_QOS_GET 6 +#endif +#if defined(IRLMP_MAX_SDU_SIZE) || (defined(HAVE_DECL_IRLMP_MAX_SDU_SIZE) && HAVE_DECL_IRLMP_MAX_SDU_SIZE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IRLMP_MAX_SDU_SIZE) == (7), "IRLMP_MAX_SDU_SIZE != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IRLMP_MAX_SDU_SIZE 7 +#endif +#if defined(IRLMP_IAS_GET) || (defined(HAVE_DECL_IRLMP_IAS_GET) && HAVE_DECL_IRLMP_IAS_GET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IRLMP_IAS_GET) == (8), "IRLMP_IAS_GET != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IRLMP_IAS_GET 8 +#endif +#if defined(IRLMP_IAS_DEL) || (defined(HAVE_DECL_IRLMP_IAS_DEL) && HAVE_DECL_IRLMP_IAS_DEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IRLMP_IAS_DEL) == (9), "IRLMP_IAS_DEL != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IRLMP_IAS_DEL 9 +#endif +#if defined(IRLMP_HINT_MASK_SET) || (defined(HAVE_DECL_IRLMP_HINT_MASK_SET) && HAVE_DECL_IRLMP_HINT_MASK_SET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IRLMP_HINT_MASK_SET) == (10), "IRLMP_HINT_MASK_SET != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IRLMP_HINT_MASK_SET 10 +#endif +#if defined(IRLMP_WAITDEVICE) || (defined(HAVE_DECL_IRLMP_WAITDEVICE) && HAVE_DECL_IRLMP_WAITDEVICE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((IRLMP_WAITDEVICE) == (11), "IRLMP_WAITDEVICE != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define IRLMP_WAITDEVICE 11 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_irda_options in mpers mode + +# else + +static +const struct xlat sock_irda_options[] = { + [IRLMP_ENUMDEVICES] = XLAT(IRLMP_ENUMDEVICES), + [IRLMP_IAS_SET] = XLAT(IRLMP_IAS_SET), + [IRLMP_IAS_QUERY] = XLAT(IRLMP_IAS_QUERY), + [IRLMP_HINTS_SET] = XLAT(IRLMP_HINTS_SET), + [IRLMP_QOS_SET] = XLAT(IRLMP_QOS_SET), + [IRLMP_QOS_GET] = XLAT(IRLMP_QOS_GET), + [IRLMP_MAX_SDU_SIZE] = XLAT(IRLMP_MAX_SDU_SIZE), + [IRLMP_IAS_GET] = XLAT(IRLMP_IAS_GET), + [IRLMP_IAS_DEL] = XLAT(IRLMP_IAS_DEL), + [IRLMP_HINT_MASK_SET] = XLAT(IRLMP_HINT_MASK_SET), + [IRLMP_WAITDEVICE] = XLAT(IRLMP_WAITDEVICE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_irda_options.in b/xlat/sock_irda_options.in new file mode 100644 index 00000000..a26e098b --- /dev/null +++ b/xlat/sock_irda_options.in @@ -0,0 +1,12 @@ +#value_indexed +IRLMP_ENUMDEVICES 1 +IRLMP_IAS_SET 2 +IRLMP_IAS_QUERY 3 +IRLMP_HINTS_SET 4 +IRLMP_QOS_SET 5 +IRLMP_QOS_GET 6 +IRLMP_MAX_SDU_SIZE 7 +IRLMP_IAS_GET 8 +IRLMP_IAS_DEL 9 +IRLMP_HINT_MASK_SET 10 +IRLMP_WAITDEVICE 11 diff --git a/xlat/sock_iucv_options.h b/xlat/sock_iucv_options.h new file mode 100644 index 00000000..ad4b1734 --- /dev/null +++ b/xlat/sock_iucv_options.h @@ -0,0 +1,46 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_iucv_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SO_IPRMDATA_MSG) || (defined(HAVE_DECL_SO_IPRMDATA_MSG) && HAVE_DECL_SO_IPRMDATA_MSG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_IPRMDATA_MSG) == (0x0080), "SO_IPRMDATA_MSG != 0x0080"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_IPRMDATA_MSG 0x0080 +#endif +#if defined(SO_MSGLIMIT) || (defined(HAVE_DECL_SO_MSGLIMIT) && HAVE_DECL_SO_MSGLIMIT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_MSGLIMIT) == (0x1000), "SO_MSGLIMIT != 0x1000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_MSGLIMIT 0x1000 +#endif +#if defined(SO_MSGSIZE) || (defined(HAVE_DECL_SO_MSGSIZE) && HAVE_DECL_SO_MSGSIZE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_MSGSIZE) == (0x0800), "SO_MSGSIZE != 0x0800"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_MSGSIZE 0x0800 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_iucv_options in mpers mode + +# else + +static +const struct xlat sock_iucv_options[] = { + XLAT(SO_IPRMDATA_MSG), + XLAT(SO_MSGLIMIT), + XLAT(SO_MSGSIZE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_iucv_options.in b/xlat/sock_iucv_options.in new file mode 100644 index 00000000..827b54c2 --- /dev/null +++ b/xlat/sock_iucv_options.in @@ -0,0 +1,3 @@ +SO_IPRMDATA_MSG 0x0080 +SO_MSGLIMIT 0x1000 +SO_MSGSIZE 0x0800 diff --git a/xlat/sock_kcm_options.h b/xlat/sock_kcm_options.h new file mode 100644 index 00000000..43e4cc48 --- /dev/null +++ b/xlat/sock_kcm_options.h @@ -0,0 +1,30 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_kcm_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(KCM_RECV_DISABLE) || (defined(HAVE_DECL_KCM_RECV_DISABLE) && HAVE_DECL_KCM_RECV_DISABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KCM_RECV_DISABLE) == (1), "KCM_RECV_DISABLE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KCM_RECV_DISABLE 1 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_kcm_options in mpers mode + +# else + +static +const struct xlat sock_kcm_options[] = { + XLAT(KCM_RECV_DISABLE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_kcm_options.in b/xlat/sock_kcm_options.in new file mode 100644 index 00000000..ee58639a --- /dev/null +++ b/xlat/sock_kcm_options.in @@ -0,0 +1 @@ +KCM_RECV_DISABLE 1 diff --git a/xlat/sock_llc_options.h b/xlat/sock_llc_options.h new file mode 100644 index 00000000..109ecdc5 --- /dev/null +++ b/xlat/sock_llc_options.h @@ -0,0 +1,102 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_llc_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(LLC_OPT_UNKNOWN) || (defined(HAVE_DECL_LLC_OPT_UNKNOWN) && HAVE_DECL_LLC_OPT_UNKNOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LLC_OPT_UNKNOWN) == (0), "LLC_OPT_UNKNOWN != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LLC_OPT_UNKNOWN 0 +#endif +#if defined(LLC_OPT_RETRY) || (defined(HAVE_DECL_LLC_OPT_RETRY) && HAVE_DECL_LLC_OPT_RETRY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LLC_OPT_RETRY) == (1), "LLC_OPT_RETRY != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LLC_OPT_RETRY 1 +#endif +#if defined(LLC_OPT_SIZE) || (defined(HAVE_DECL_LLC_OPT_SIZE) && HAVE_DECL_LLC_OPT_SIZE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LLC_OPT_SIZE) == (2), "LLC_OPT_SIZE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LLC_OPT_SIZE 2 +#endif +#if defined(LLC_OPT_ACK_TMR_EXP) || (defined(HAVE_DECL_LLC_OPT_ACK_TMR_EXP) && HAVE_DECL_LLC_OPT_ACK_TMR_EXP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LLC_OPT_ACK_TMR_EXP) == (3), "LLC_OPT_ACK_TMR_EXP != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LLC_OPT_ACK_TMR_EXP 3 +#endif +#if defined(LLC_OPT_P_TMR_EXP) || (defined(HAVE_DECL_LLC_OPT_P_TMR_EXP) && HAVE_DECL_LLC_OPT_P_TMR_EXP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LLC_OPT_P_TMR_EXP) == (4), "LLC_OPT_P_TMR_EXP != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LLC_OPT_P_TMR_EXP 4 +#endif +#if defined(LLC_OPT_REJ_TMR_EXP) || (defined(HAVE_DECL_LLC_OPT_REJ_TMR_EXP) && HAVE_DECL_LLC_OPT_REJ_TMR_EXP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LLC_OPT_REJ_TMR_EXP) == (5), "LLC_OPT_REJ_TMR_EXP != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LLC_OPT_REJ_TMR_EXP 5 +#endif +#if defined(LLC_OPT_BUSY_TMR_EXP) || (defined(HAVE_DECL_LLC_OPT_BUSY_TMR_EXP) && HAVE_DECL_LLC_OPT_BUSY_TMR_EXP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LLC_OPT_BUSY_TMR_EXP) == (6), "LLC_OPT_BUSY_TMR_EXP != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LLC_OPT_BUSY_TMR_EXP 6 +#endif +#if defined(LLC_OPT_TX_WIN) || (defined(HAVE_DECL_LLC_OPT_TX_WIN) && HAVE_DECL_LLC_OPT_TX_WIN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LLC_OPT_TX_WIN) == (7), "LLC_OPT_TX_WIN != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LLC_OPT_TX_WIN 7 +#endif +#if defined(LLC_OPT_RX_WIN) || (defined(HAVE_DECL_LLC_OPT_RX_WIN) && HAVE_DECL_LLC_OPT_RX_WIN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LLC_OPT_RX_WIN) == (8), "LLC_OPT_RX_WIN != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LLC_OPT_RX_WIN 8 +#endif +#if defined(LLC_OPT_PKTINFO) || (defined(HAVE_DECL_LLC_OPT_PKTINFO) && HAVE_DECL_LLC_OPT_PKTINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((LLC_OPT_PKTINFO) == (9), "LLC_OPT_PKTINFO != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define LLC_OPT_PKTINFO 9 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_llc_options in mpers mode + +# else + +static +const struct xlat sock_llc_options[] = { + [LLC_OPT_UNKNOWN] = XLAT(LLC_OPT_UNKNOWN), + [LLC_OPT_RETRY] = XLAT(LLC_OPT_RETRY), + [LLC_OPT_SIZE] = XLAT(LLC_OPT_SIZE), + [LLC_OPT_ACK_TMR_EXP] = XLAT(LLC_OPT_ACK_TMR_EXP), + [LLC_OPT_P_TMR_EXP] = XLAT(LLC_OPT_P_TMR_EXP), + [LLC_OPT_REJ_TMR_EXP] = XLAT(LLC_OPT_REJ_TMR_EXP), + [LLC_OPT_BUSY_TMR_EXP] = XLAT(LLC_OPT_BUSY_TMR_EXP), + [LLC_OPT_TX_WIN] = XLAT(LLC_OPT_TX_WIN), + [LLC_OPT_RX_WIN] = XLAT(LLC_OPT_RX_WIN), + [LLC_OPT_PKTINFO] = XLAT(LLC_OPT_PKTINFO), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_llc_options.in b/xlat/sock_llc_options.in new file mode 100644 index 00000000..7a948d71 --- /dev/null +++ b/xlat/sock_llc_options.in @@ -0,0 +1,11 @@ +#value_indexed +LLC_OPT_UNKNOWN 0 +LLC_OPT_RETRY 1 +LLC_OPT_SIZE 2 +LLC_OPT_ACK_TMR_EXP 3 +LLC_OPT_P_TMR_EXP 4 +LLC_OPT_REJ_TMR_EXP 5 +LLC_OPT_BUSY_TMR_EXP 6 +LLC_OPT_TX_WIN 7 +LLC_OPT_RX_WIN 8 +LLC_OPT_PKTINFO 9 diff --git a/xlat/sock_netlink_options.h b/xlat/sock_netlink_options.h new file mode 100644 index 00000000..a8568336 --- /dev/null +++ b/xlat/sock_netlink_options.h @@ -0,0 +1,118 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_netlink_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NETLINK_ADD_MEMBERSHIP) || (defined(HAVE_DECL_NETLINK_ADD_MEMBERSHIP) && HAVE_DECL_NETLINK_ADD_MEMBERSHIP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_ADD_MEMBERSHIP) == (1), "NETLINK_ADD_MEMBERSHIP != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETLINK_ADD_MEMBERSHIP 1 +#endif +#if defined(NETLINK_DROP_MEMBERSHIP) || (defined(HAVE_DECL_NETLINK_DROP_MEMBERSHIP) && HAVE_DECL_NETLINK_DROP_MEMBERSHIP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_DROP_MEMBERSHIP) == (2), "NETLINK_DROP_MEMBERSHIP != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETLINK_DROP_MEMBERSHIP 2 +#endif +#if defined(NETLINK_PKTINFO) || (defined(HAVE_DECL_NETLINK_PKTINFO) && HAVE_DECL_NETLINK_PKTINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_PKTINFO) == (3), "NETLINK_PKTINFO != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETLINK_PKTINFO 3 +#endif +#if defined(NETLINK_BROADCAST_ERROR) || (defined(HAVE_DECL_NETLINK_BROADCAST_ERROR) && HAVE_DECL_NETLINK_BROADCAST_ERROR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_BROADCAST_ERROR) == (4), "NETLINK_BROADCAST_ERROR != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETLINK_BROADCAST_ERROR 4 +#endif +#if defined(NETLINK_NO_ENOBUFS) || (defined(HAVE_DECL_NETLINK_NO_ENOBUFS) && HAVE_DECL_NETLINK_NO_ENOBUFS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_NO_ENOBUFS) == (5), "NETLINK_NO_ENOBUFS != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETLINK_NO_ENOBUFS 5 +#endif +#if defined(NETLINK_RX_RING) || (defined(HAVE_DECL_NETLINK_RX_RING) && HAVE_DECL_NETLINK_RX_RING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_RX_RING) == (6), "NETLINK_RX_RING != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETLINK_RX_RING 6 +#endif +#if defined(NETLINK_TX_RING) || (defined(HAVE_DECL_NETLINK_TX_RING) && HAVE_DECL_NETLINK_TX_RING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_TX_RING) == (7), "NETLINK_TX_RING != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETLINK_TX_RING 7 +#endif +#if defined(NETLINK_LISTEN_ALL_NSID) || (defined(HAVE_DECL_NETLINK_LISTEN_ALL_NSID) && HAVE_DECL_NETLINK_LISTEN_ALL_NSID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_LISTEN_ALL_NSID) == (8), "NETLINK_LISTEN_ALL_NSID != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETLINK_LISTEN_ALL_NSID 8 +#endif +#if defined(NETLINK_LIST_MEMBERSHIPS) || (defined(HAVE_DECL_NETLINK_LIST_MEMBERSHIPS) && HAVE_DECL_NETLINK_LIST_MEMBERSHIPS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_LIST_MEMBERSHIPS) == (9), "NETLINK_LIST_MEMBERSHIPS != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETLINK_LIST_MEMBERSHIPS 9 +#endif +#if defined(NETLINK_CAP_ACK) || (defined(HAVE_DECL_NETLINK_CAP_ACK) && HAVE_DECL_NETLINK_CAP_ACK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_CAP_ACK) == (10), "NETLINK_CAP_ACK != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETLINK_CAP_ACK 10 +#endif +#if defined(NETLINK_EXT_ACK) || (defined(HAVE_DECL_NETLINK_EXT_ACK) && HAVE_DECL_NETLINK_EXT_ACK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_EXT_ACK) == (11), "NETLINK_EXT_ACK != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETLINK_EXT_ACK 11 +#endif +#if defined(NETLINK_DUMP_STRICT_CHK) || (defined(HAVE_DECL_NETLINK_DUMP_STRICT_CHK) && HAVE_DECL_NETLINK_DUMP_STRICT_CHK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NETLINK_DUMP_STRICT_CHK) == (12), "NETLINK_DUMP_STRICT_CHK != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NETLINK_DUMP_STRICT_CHK 12 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_netlink_options in mpers mode + +# else + +static +const struct xlat sock_netlink_options[] = { + XLAT(NETLINK_ADD_MEMBERSHIP), + XLAT(NETLINK_DROP_MEMBERSHIP), + XLAT(NETLINK_PKTINFO), + XLAT(NETLINK_BROADCAST_ERROR), + XLAT(NETLINK_NO_ENOBUFS), + XLAT(NETLINK_RX_RING), + XLAT(NETLINK_TX_RING), + XLAT(NETLINK_LISTEN_ALL_NSID), + XLAT(NETLINK_LIST_MEMBERSHIPS), + XLAT(NETLINK_CAP_ACK), + XLAT(NETLINK_EXT_ACK), + XLAT(NETLINK_DUMP_STRICT_CHK), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_netlink_options.in b/xlat/sock_netlink_options.in new file mode 100644 index 00000000..39115747 --- /dev/null +++ b/xlat/sock_netlink_options.in @@ -0,0 +1,12 @@ +NETLINK_ADD_MEMBERSHIP 1 +NETLINK_DROP_MEMBERSHIP 2 +NETLINK_PKTINFO 3 +NETLINK_BROADCAST_ERROR 4 +NETLINK_NO_ENOBUFS 5 +NETLINK_RX_RING 6 +NETLINK_TX_RING 7 +NETLINK_LISTEN_ALL_NSID 8 +NETLINK_LIST_MEMBERSHIPS 9 +NETLINK_CAP_ACK 10 +NETLINK_EXT_ACK 11 +NETLINK_DUMP_STRICT_CHK 12 diff --git a/xlat/sock_nfcllcp_options.h b/xlat/sock_nfcllcp_options.h new file mode 100644 index 00000000..4d7bfb8f --- /dev/null +++ b/xlat/sock_nfcllcp_options.h @@ -0,0 +1,62 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_nfcllcp_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(NFC_LLCP_RW) || (defined(HAVE_DECL_NFC_LLCP_RW) && HAVE_DECL_NFC_LLCP_RW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFC_LLCP_RW) == (0), "NFC_LLCP_RW != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFC_LLCP_RW 0 +#endif +#if defined(NFC_LLCP_MIUX) || (defined(HAVE_DECL_NFC_LLCP_MIUX) && HAVE_DECL_NFC_LLCP_MIUX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFC_LLCP_MIUX) == (1), "NFC_LLCP_MIUX != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFC_LLCP_MIUX 1 +#endif +#if defined(NFC_LLCP_REMOTE_MIU) || (defined(HAVE_DECL_NFC_LLCP_REMOTE_MIU) && HAVE_DECL_NFC_LLCP_REMOTE_MIU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFC_LLCP_REMOTE_MIU) == (2), "NFC_LLCP_REMOTE_MIU != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFC_LLCP_REMOTE_MIU 2 +#endif +#if defined(NFC_LLCP_REMOTE_LTO) || (defined(HAVE_DECL_NFC_LLCP_REMOTE_LTO) && HAVE_DECL_NFC_LLCP_REMOTE_LTO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFC_LLCP_REMOTE_LTO) == (3), "NFC_LLCP_REMOTE_LTO != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFC_LLCP_REMOTE_LTO 3 +#endif +#if defined(NFC_LLCP_REMOTE_RW) || (defined(HAVE_DECL_NFC_LLCP_REMOTE_RW) && HAVE_DECL_NFC_LLCP_REMOTE_RW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((NFC_LLCP_REMOTE_RW) == (4), "NFC_LLCP_REMOTE_RW != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define NFC_LLCP_REMOTE_RW 4 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_nfcllcp_options in mpers mode + +# else + +static +const struct xlat sock_nfcllcp_options[] = { + [NFC_LLCP_RW] = XLAT(NFC_LLCP_RW), + [NFC_LLCP_MIUX] = XLAT(NFC_LLCP_MIUX), + [NFC_LLCP_REMOTE_MIU] = XLAT(NFC_LLCP_REMOTE_MIU), + [NFC_LLCP_REMOTE_LTO] = XLAT(NFC_LLCP_REMOTE_LTO), + [NFC_LLCP_REMOTE_RW] = XLAT(NFC_LLCP_REMOTE_RW), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_nfcllcp_options.in b/xlat/sock_nfcllcp_options.in new file mode 100644 index 00000000..c9f9fdc0 --- /dev/null +++ b/xlat/sock_nfcllcp_options.in @@ -0,0 +1,6 @@ +#value_indexed +NFC_LLCP_RW 0 +NFC_LLCP_MIUX 1 +NFC_LLCP_REMOTE_MIU 2 +NFC_LLCP_REMOTE_LTO 3 +NFC_LLCP_REMOTE_RW 4 diff --git a/xlat/sock_options.h b/xlat/sock_options.h new file mode 100644 index 00000000..550969f7 --- /dev/null +++ b/xlat/sock_options.h @@ -0,0 +1,1990 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SO_DEBUG) || (defined(HAVE_DECL_SO_DEBUG) && HAVE_DECL_SO_DEBUG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_DEBUG) == (1), "SO_DEBUG != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_DEBUG 1 +#endif +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +#if defined(SO_REUSEADDR) || (defined(HAVE_DECL_SO_REUSEADDR) && HAVE_DECL_SO_REUSEADDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_REUSEADDR) == (4), "SO_REUSEADDR != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_REUSEADDR 4 +#endif +#else +#if defined(SO_REUSEADDR) || (defined(HAVE_DECL_SO_REUSEADDR) && HAVE_DECL_SO_REUSEADDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_REUSEADDR) == (2), "SO_REUSEADDR != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_REUSEADDR 2 +#endif +#endif +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +#if defined(SO_TYPE) || (defined(HAVE_DECL_SO_TYPE) && HAVE_DECL_SO_TYPE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TYPE) == (4104), "SO_TYPE != 4104"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TYPE 4104 +#endif +#else +#if defined(SO_TYPE) || (defined(HAVE_DECL_SO_TYPE) && HAVE_DECL_SO_TYPE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TYPE) == (3), "SO_TYPE != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TYPE 3 +#endif +#endif +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +#if defined(SO_ERROR) || (defined(HAVE_DECL_SO_ERROR) && HAVE_DECL_SO_ERROR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_ERROR) == (4103), "SO_ERROR != 4103"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_ERROR 4103 +#endif +#else +#if defined(SO_ERROR) || (defined(HAVE_DECL_SO_ERROR) && HAVE_DECL_SO_ERROR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_ERROR) == (4), "SO_ERROR != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_ERROR 4 +#endif +#endif +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +#if defined(SO_DONTROUTE) || (defined(HAVE_DECL_SO_DONTROUTE) && HAVE_DECL_SO_DONTROUTE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_DONTROUTE) == (16), "SO_DONTROUTE != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_DONTROUTE 16 +#endif +#else +#if defined(SO_DONTROUTE) || (defined(HAVE_DECL_SO_DONTROUTE) && HAVE_DECL_SO_DONTROUTE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_DONTROUTE) == (5), "SO_DONTROUTE != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_DONTROUTE 5 +#endif +#endif +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +#if defined(SO_BROADCAST) || (defined(HAVE_DECL_SO_BROADCAST) && HAVE_DECL_SO_BROADCAST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_BROADCAST) == (32), "SO_BROADCAST != 32"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_BROADCAST 32 +#endif +#else +#if defined(SO_BROADCAST) || (defined(HAVE_DECL_SO_BROADCAST) && HAVE_DECL_SO_BROADCAST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_BROADCAST) == (6), "SO_BROADCAST != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_BROADCAST 6 +#endif +#endif +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +#if defined(SO_SNDBUF) || (defined(HAVE_DECL_SO_SNDBUF) && HAVE_DECL_SO_SNDBUF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SNDBUF) == (4097), "SO_SNDBUF != 4097"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SNDBUF 4097 +#endif +#else +#if defined(SO_SNDBUF) || (defined(HAVE_DECL_SO_SNDBUF) && HAVE_DECL_SO_SNDBUF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SNDBUF) == (7), "SO_SNDBUF != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SNDBUF 7 +#endif +#endif +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +#if defined(SO_RCVBUF) || (defined(HAVE_DECL_SO_RCVBUF) && HAVE_DECL_SO_RCVBUF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_RCVBUF) == (4098), "SO_RCVBUF != 4098"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_RCVBUF 4098 +#endif +#else +#if defined(SO_RCVBUF) || (defined(HAVE_DECL_SO_RCVBUF) && HAVE_DECL_SO_RCVBUF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_RCVBUF) == (8), "SO_RCVBUF != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_RCVBUF 8 +#endif +#endif +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +#if defined(SO_KEEPALIVE) || (defined(HAVE_DECL_SO_KEEPALIVE) && HAVE_DECL_SO_KEEPALIVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_KEEPALIVE) == (8), "SO_KEEPALIVE != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_KEEPALIVE 8 +#endif +#else +#if defined(SO_KEEPALIVE) || (defined(HAVE_DECL_SO_KEEPALIVE) && HAVE_DECL_SO_KEEPALIVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_KEEPALIVE) == (9), "SO_KEEPALIVE != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_KEEPALIVE 9 +#endif +#endif +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +#if defined(SO_OOBINLINE) || (defined(HAVE_DECL_SO_OOBINLINE) && HAVE_DECL_SO_OOBINLINE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_OOBINLINE) == (256), "SO_OOBINLINE != 256"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_OOBINLINE 256 +#endif +#else +#if defined(SO_OOBINLINE) || (defined(HAVE_DECL_SO_OOBINLINE) && HAVE_DECL_SO_OOBINLINE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_OOBINLINE) == (10), "SO_OOBINLINE != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_OOBINLINE 10 +#endif +#endif +#if defined __hppa__ +#if defined(SO_NO_CHECK) || (defined(HAVE_DECL_SO_NO_CHECK) && HAVE_DECL_SO_NO_CHECK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_NO_CHECK) == (16395), "SO_NO_CHECK != 16395"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_NO_CHECK 16395 +#endif +#else +#if defined(SO_NO_CHECK) || (defined(HAVE_DECL_SO_NO_CHECK) && HAVE_DECL_SO_NO_CHECK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_NO_CHECK) == (11), "SO_NO_CHECK != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_NO_CHECK 11 +#endif +#endif +#if defined __hppa__ +#if defined(SO_PRIORITY) || (defined(HAVE_DECL_SO_PRIORITY) && HAVE_DECL_SO_PRIORITY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PRIORITY) == (16396), "SO_PRIORITY != 16396"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PRIORITY 16396 +#endif +#else +#if defined(SO_PRIORITY) || (defined(HAVE_DECL_SO_PRIORITY) && HAVE_DECL_SO_PRIORITY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PRIORITY) == (12), "SO_PRIORITY != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PRIORITY 12 +#endif +#endif +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +#if defined(SO_LINGER) || (defined(HAVE_DECL_SO_LINGER) && HAVE_DECL_SO_LINGER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_LINGER) == (128), "SO_LINGER != 128"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_LINGER 128 +#endif +#else +#if defined(SO_LINGER) || (defined(HAVE_DECL_SO_LINGER) && HAVE_DECL_SO_LINGER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_LINGER) == (13), "SO_LINGER != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_LINGER 13 +#endif +#endif +#if defined __sparc__ +#if defined(SO_BSDCOMPAT) || (defined(HAVE_DECL_SO_BSDCOMPAT) && HAVE_DECL_SO_BSDCOMPAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_BSDCOMPAT) == (1024), "SO_BSDCOMPAT != 1024"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_BSDCOMPAT 1024 +#endif +#elif defined __hppa__ +#if defined(SO_BSDCOMPAT) || (defined(HAVE_DECL_SO_BSDCOMPAT) && HAVE_DECL_SO_BSDCOMPAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_BSDCOMPAT) == (16398), "SO_BSDCOMPAT != 16398"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_BSDCOMPAT 16398 +#endif +#else +#if defined(SO_BSDCOMPAT) || (defined(HAVE_DECL_SO_BSDCOMPAT) && HAVE_DECL_SO_BSDCOMPAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_BSDCOMPAT) == (14), "SO_BSDCOMPAT != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_BSDCOMPAT 14 +#endif +#endif +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +#if defined(SO_REUSEPORT) || (defined(HAVE_DECL_SO_REUSEPORT) && HAVE_DECL_SO_REUSEPORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_REUSEPORT) == (512), "SO_REUSEPORT != 512"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_REUSEPORT 512 +#endif +#else +#if defined(SO_REUSEPORT) || (defined(HAVE_DECL_SO_REUSEPORT) && HAVE_DECL_SO_REUSEPORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_REUSEPORT) == (15), "SO_REUSEPORT != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_REUSEPORT 15 +#endif +#endif +#if defined __sparc__ +#if defined(SO_PASSCRED) || (defined(HAVE_DECL_SO_PASSCRED) && HAVE_DECL_SO_PASSCRED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PASSCRED) == (2), "SO_PASSCRED != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PASSCRED 2 +#endif +#elif defined __alpha__ || defined __mips__ +#if defined(SO_PASSCRED) || (defined(HAVE_DECL_SO_PASSCRED) && HAVE_DECL_SO_PASSCRED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PASSCRED) == (17), "SO_PASSCRED != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PASSCRED 17 +#endif +#elif defined __powerpc__ +#if defined(SO_PASSCRED) || (defined(HAVE_DECL_SO_PASSCRED) && HAVE_DECL_SO_PASSCRED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PASSCRED) == (20), "SO_PASSCRED != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PASSCRED 20 +#endif +#elif defined __hppa__ +#if defined(SO_PASSCRED) || (defined(HAVE_DECL_SO_PASSCRED) && HAVE_DECL_SO_PASSCRED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PASSCRED) == (16400), "SO_PASSCRED != 16400"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PASSCRED 16400 +#endif +#else +#if defined(SO_PASSCRED) || (defined(HAVE_DECL_SO_PASSCRED) && HAVE_DECL_SO_PASSCRED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PASSCRED) == (16), "SO_PASSCRED != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PASSCRED 16 +#endif +#endif +#if defined __alpha__ || defined __mips__ +#if defined(SO_PEERCRED) || (defined(HAVE_DECL_SO_PEERCRED) && HAVE_DECL_SO_PEERCRED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PEERCRED) == (18), "SO_PEERCRED != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PEERCRED 18 +#endif +#elif defined __powerpc__ +#if defined(SO_PEERCRED) || (defined(HAVE_DECL_SO_PEERCRED) && HAVE_DECL_SO_PEERCRED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PEERCRED) == (21), "SO_PEERCRED != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PEERCRED 21 +#endif +#elif defined __sparc__ +#if defined(SO_PEERCRED) || (defined(HAVE_DECL_SO_PEERCRED) && HAVE_DECL_SO_PEERCRED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PEERCRED) == (64), "SO_PEERCRED != 64"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PEERCRED 64 +#endif +#elif defined __hppa__ +#if defined(SO_PEERCRED) || (defined(HAVE_DECL_SO_PEERCRED) && HAVE_DECL_SO_PEERCRED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PEERCRED) == (16401), "SO_PEERCRED != 16401"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PEERCRED 16401 +#endif +#else +#if defined(SO_PEERCRED) || (defined(HAVE_DECL_SO_PEERCRED) && HAVE_DECL_SO_PEERCRED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PEERCRED) == (17), "SO_PEERCRED != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PEERCRED 17 +#endif +#endif +#if defined __powerpc__ +#if defined(SO_RCVLOWAT) || (defined(HAVE_DECL_SO_RCVLOWAT) && HAVE_DECL_SO_RCVLOWAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_RCVLOWAT) == (16), "SO_RCVLOWAT != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_RCVLOWAT 16 +#endif +#elif defined __sparc__ +#if defined(SO_RCVLOWAT) || (defined(HAVE_DECL_SO_RCVLOWAT) && HAVE_DECL_SO_RCVLOWAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_RCVLOWAT) == (2048), "SO_RCVLOWAT != 2048"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_RCVLOWAT 2048 +#endif +#elif defined __hppa__ || defined __mips__ +#if defined(SO_RCVLOWAT) || (defined(HAVE_DECL_SO_RCVLOWAT) && HAVE_DECL_SO_RCVLOWAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_RCVLOWAT) == (4100), "SO_RCVLOWAT != 4100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_RCVLOWAT 4100 +#endif +#elif defined __alpha__ +#if defined(SO_RCVLOWAT) || (defined(HAVE_DECL_SO_RCVLOWAT) && HAVE_DECL_SO_RCVLOWAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_RCVLOWAT) == (4112), "SO_RCVLOWAT != 4112"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_RCVLOWAT 4112 +#endif +#else +#if defined(SO_RCVLOWAT) || (defined(HAVE_DECL_SO_RCVLOWAT) && HAVE_DECL_SO_RCVLOWAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_RCVLOWAT) == (18), "SO_RCVLOWAT != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_RCVLOWAT 18 +#endif +#endif +#if defined __powerpc__ +#if defined(SO_SNDLOWAT) || (defined(HAVE_DECL_SO_SNDLOWAT) && HAVE_DECL_SO_SNDLOWAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SNDLOWAT) == (17), "SO_SNDLOWAT != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SNDLOWAT 17 +#endif +#elif defined __sparc__ +#if defined(SO_SNDLOWAT) || (defined(HAVE_DECL_SO_SNDLOWAT) && HAVE_DECL_SO_SNDLOWAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SNDLOWAT) == (4096), "SO_SNDLOWAT != 4096"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SNDLOWAT 4096 +#endif +#elif defined __hppa__ || defined __mips__ +#if defined(SO_SNDLOWAT) || (defined(HAVE_DECL_SO_SNDLOWAT) && HAVE_DECL_SO_SNDLOWAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SNDLOWAT) == (4099), "SO_SNDLOWAT != 4099"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SNDLOWAT 4099 +#endif +#elif defined __alpha__ +#if defined(SO_SNDLOWAT) || (defined(HAVE_DECL_SO_SNDLOWAT) && HAVE_DECL_SO_SNDLOWAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SNDLOWAT) == (4113), "SO_SNDLOWAT != 4113"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SNDLOWAT 4113 +#endif +#else +#if defined(SO_SNDLOWAT) || (defined(HAVE_DECL_SO_SNDLOWAT) && HAVE_DECL_SO_SNDLOWAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SNDLOWAT) == (19), "SO_SNDLOWAT != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SNDLOWAT 19 +#endif +#endif +#if defined __powerpc__ +#if defined(SO_RCVTIMEO_OLD) || (defined(HAVE_DECL_SO_RCVTIMEO_OLD) && HAVE_DECL_SO_RCVTIMEO_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_RCVTIMEO_OLD) == (18), "SO_RCVTIMEO_OLD != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_RCVTIMEO_OLD 18 +#endif +#elif defined __hppa__ || defined __mips__ +#if defined(SO_RCVTIMEO_OLD) || (defined(HAVE_DECL_SO_RCVTIMEO_OLD) && HAVE_DECL_SO_RCVTIMEO_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_RCVTIMEO_OLD) == (4102), "SO_RCVTIMEO_OLD != 4102"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_RCVTIMEO_OLD 4102 +#endif +#elif defined __alpha__ +#if defined(SO_RCVTIMEO_OLD) || (defined(HAVE_DECL_SO_RCVTIMEO_OLD) && HAVE_DECL_SO_RCVTIMEO_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_RCVTIMEO_OLD) == (4114), "SO_RCVTIMEO_OLD != 4114"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_RCVTIMEO_OLD 4114 +#endif +#elif defined __sparc__ +#if defined(SO_RCVTIMEO_OLD) || (defined(HAVE_DECL_SO_RCVTIMEO_OLD) && HAVE_DECL_SO_RCVTIMEO_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_RCVTIMEO_OLD) == (8192), "SO_RCVTIMEO_OLD != 8192"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_RCVTIMEO_OLD 8192 +#endif +#else +#if defined(SO_RCVTIMEO_OLD) || (defined(HAVE_DECL_SO_RCVTIMEO_OLD) && HAVE_DECL_SO_RCVTIMEO_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_RCVTIMEO_OLD) == (20), "SO_RCVTIMEO_OLD != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_RCVTIMEO_OLD 20 +#endif +#endif +#if defined __powerpc__ +#if defined(SO_SNDTIMEO_OLD) || (defined(HAVE_DECL_SO_SNDTIMEO_OLD) && HAVE_DECL_SO_SNDTIMEO_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SNDTIMEO_OLD) == (19), "SO_SNDTIMEO_OLD != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SNDTIMEO_OLD 19 +#endif +#elif defined __hppa__ || defined __mips__ +#if defined(SO_SNDTIMEO_OLD) || (defined(HAVE_DECL_SO_SNDTIMEO_OLD) && HAVE_DECL_SO_SNDTIMEO_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SNDTIMEO_OLD) == (4101), "SO_SNDTIMEO_OLD != 4101"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SNDTIMEO_OLD 4101 +#endif +#elif defined __alpha__ +#if defined(SO_SNDTIMEO_OLD) || (defined(HAVE_DECL_SO_SNDTIMEO_OLD) && HAVE_DECL_SO_SNDTIMEO_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SNDTIMEO_OLD) == (4115), "SO_SNDTIMEO_OLD != 4115"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SNDTIMEO_OLD 4115 +#endif +#elif defined __sparc__ +#if defined(SO_SNDTIMEO_OLD) || (defined(HAVE_DECL_SO_SNDTIMEO_OLD) && HAVE_DECL_SO_SNDTIMEO_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SNDTIMEO_OLD) == (16384), "SO_SNDTIMEO_OLD != 16384"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SNDTIMEO_OLD 16384 +#endif +#else +#if defined(SO_SNDTIMEO_OLD) || (defined(HAVE_DECL_SO_SNDTIMEO_OLD) && HAVE_DECL_SO_SNDTIMEO_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SNDTIMEO_OLD) == (21), "SO_SNDTIMEO_OLD != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SNDTIMEO_OLD 21 +#endif +#endif +#if defined __alpha__ +#if defined(SO_SECURITY_AUTHENTICATION) || (defined(HAVE_DECL_SO_SECURITY_AUTHENTICATION) && HAVE_DECL_SO_SECURITY_AUTHENTICATION) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SECURITY_AUTHENTICATION) == (19), "SO_SECURITY_AUTHENTICATION != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SECURITY_AUTHENTICATION 19 +#endif +#elif defined __hppa__ +#if defined(SO_SECURITY_AUTHENTICATION) || (defined(HAVE_DECL_SO_SECURITY_AUTHENTICATION) && HAVE_DECL_SO_SECURITY_AUTHENTICATION) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SECURITY_AUTHENTICATION) == (16406), "SO_SECURITY_AUTHENTICATION != 16406"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SECURITY_AUTHENTICATION 16406 +#endif +#elif defined __sparc__ +#if defined(SO_SECURITY_AUTHENTICATION) || (defined(HAVE_DECL_SO_SECURITY_AUTHENTICATION) && HAVE_DECL_SO_SECURITY_AUTHENTICATION) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SECURITY_AUTHENTICATION) == (20481), "SO_SECURITY_AUTHENTICATION != 20481"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SECURITY_AUTHENTICATION 20481 +#endif +#else +#if defined(SO_SECURITY_AUTHENTICATION) || (defined(HAVE_DECL_SO_SECURITY_AUTHENTICATION) && HAVE_DECL_SO_SECURITY_AUTHENTICATION) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SECURITY_AUTHENTICATION) == (22), "SO_SECURITY_AUTHENTICATION != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SECURITY_AUTHENTICATION 22 +#endif +#endif +#if defined __alpha__ +#if defined(SO_SECURITY_ENCRYPTION_TRANSPORT) || (defined(HAVE_DECL_SO_SECURITY_ENCRYPTION_TRANSPORT) && HAVE_DECL_SO_SECURITY_ENCRYPTION_TRANSPORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SECURITY_ENCRYPTION_TRANSPORT) == (20), "SO_SECURITY_ENCRYPTION_TRANSPORT != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SECURITY_ENCRYPTION_TRANSPORT 20 +#endif +#elif defined __hppa__ +#if defined(SO_SECURITY_ENCRYPTION_TRANSPORT) || (defined(HAVE_DECL_SO_SECURITY_ENCRYPTION_TRANSPORT) && HAVE_DECL_SO_SECURITY_ENCRYPTION_TRANSPORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SECURITY_ENCRYPTION_TRANSPORT) == (16407), "SO_SECURITY_ENCRYPTION_TRANSPORT != 16407"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SECURITY_ENCRYPTION_TRANSPORT 16407 +#endif +#elif defined __sparc__ +#if defined(SO_SECURITY_ENCRYPTION_TRANSPORT) || (defined(HAVE_DECL_SO_SECURITY_ENCRYPTION_TRANSPORT) && HAVE_DECL_SO_SECURITY_ENCRYPTION_TRANSPORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SECURITY_ENCRYPTION_TRANSPORT) == (20482), "SO_SECURITY_ENCRYPTION_TRANSPORT != 20482"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SECURITY_ENCRYPTION_TRANSPORT 20482 +#endif +#else +#if defined(SO_SECURITY_ENCRYPTION_TRANSPORT) || (defined(HAVE_DECL_SO_SECURITY_ENCRYPTION_TRANSPORT) && HAVE_DECL_SO_SECURITY_ENCRYPTION_TRANSPORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SECURITY_ENCRYPTION_TRANSPORT) == (23), "SO_SECURITY_ENCRYPTION_TRANSPORT != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SECURITY_ENCRYPTION_TRANSPORT 23 +#endif +#endif +#if defined __alpha__ +#if defined(SO_SECURITY_ENCRYPTION_NETWORK) || (defined(HAVE_DECL_SO_SECURITY_ENCRYPTION_NETWORK) && HAVE_DECL_SO_SECURITY_ENCRYPTION_NETWORK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SECURITY_ENCRYPTION_NETWORK) == (21), "SO_SECURITY_ENCRYPTION_NETWORK != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SECURITY_ENCRYPTION_NETWORK 21 +#endif +#elif defined __hppa__ +#if defined(SO_SECURITY_ENCRYPTION_NETWORK) || (defined(HAVE_DECL_SO_SECURITY_ENCRYPTION_NETWORK) && HAVE_DECL_SO_SECURITY_ENCRYPTION_NETWORK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SECURITY_ENCRYPTION_NETWORK) == (16408), "SO_SECURITY_ENCRYPTION_NETWORK != 16408"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SECURITY_ENCRYPTION_NETWORK 16408 +#endif +#elif defined __sparc__ +#if defined(SO_SECURITY_ENCRYPTION_NETWORK) || (defined(HAVE_DECL_SO_SECURITY_ENCRYPTION_NETWORK) && HAVE_DECL_SO_SECURITY_ENCRYPTION_NETWORK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SECURITY_ENCRYPTION_NETWORK) == (20484), "SO_SECURITY_ENCRYPTION_NETWORK != 20484"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SECURITY_ENCRYPTION_NETWORK 20484 +#endif +#else +#if defined(SO_SECURITY_ENCRYPTION_NETWORK) || (defined(HAVE_DECL_SO_SECURITY_ENCRYPTION_NETWORK) && HAVE_DECL_SO_SECURITY_ENCRYPTION_NETWORK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SECURITY_ENCRYPTION_NETWORK) == (24), "SO_SECURITY_ENCRYPTION_NETWORK != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SECURITY_ENCRYPTION_NETWORK 24 +#endif +#endif +#if defined __sparc__ +#if defined(SO_BINDTODEVICE) || (defined(HAVE_DECL_SO_BINDTODEVICE) && HAVE_DECL_SO_BINDTODEVICE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_BINDTODEVICE) == (13), "SO_BINDTODEVICE != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_BINDTODEVICE 13 +#endif +#elif defined __hppa__ +#if defined(SO_BINDTODEVICE) || (defined(HAVE_DECL_SO_BINDTODEVICE) && HAVE_DECL_SO_BINDTODEVICE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_BINDTODEVICE) == (16409), "SO_BINDTODEVICE != 16409"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_BINDTODEVICE 16409 +#endif +#else +#if defined(SO_BINDTODEVICE) || (defined(HAVE_DECL_SO_BINDTODEVICE) && HAVE_DECL_SO_BINDTODEVICE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_BINDTODEVICE) == (25), "SO_BINDTODEVICE != 25"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_BINDTODEVICE 25 +#endif +#endif +#if defined __hppa__ +#if defined(SO_DETACH_FILTER) || (defined(HAVE_DECL_SO_DETACH_FILTER) && HAVE_DECL_SO_DETACH_FILTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_DETACH_FILTER) == (16411), "SO_DETACH_FILTER != 16411"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_DETACH_FILTER 16411 +#endif +#else +#if defined(SO_DETACH_FILTER) || (defined(HAVE_DECL_SO_DETACH_FILTER) && HAVE_DECL_SO_DETACH_FILTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_DETACH_FILTER) == (27), "SO_DETACH_FILTER != 27"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_DETACH_FILTER 27 +#endif +#endif +#if defined __hppa__ +#if defined(SO_PEERNAME) || (defined(HAVE_DECL_SO_PEERNAME) && HAVE_DECL_SO_PEERNAME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PEERNAME) == (8192), "SO_PEERNAME != 8192"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PEERNAME 8192 +#endif +#else +#if defined(SO_PEERNAME) || (defined(HAVE_DECL_SO_PEERNAME) && HAVE_DECL_SO_PEERNAME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PEERNAME) == (28), "SO_PEERNAME != 28"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PEERNAME 28 +#endif +#endif +#if defined __hppa__ +#if defined(SO_TIMESTAMP_OLD) || (defined(HAVE_DECL_SO_TIMESTAMP_OLD) && HAVE_DECL_SO_TIMESTAMP_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TIMESTAMP_OLD) == (16402), "SO_TIMESTAMP_OLD != 16402"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TIMESTAMP_OLD 16402 +#endif +#else +#if defined(SO_TIMESTAMP_OLD) || (defined(HAVE_DECL_SO_TIMESTAMP_OLD) && HAVE_DECL_SO_TIMESTAMP_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TIMESTAMP_OLD) == (29), "SO_TIMESTAMP_OLD != 29"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TIMESTAMP_OLD 29 +#endif +#endif +#if defined __mips__ +#if defined(SO_ACCEPTCONN) || (defined(HAVE_DECL_SO_ACCEPTCONN) && HAVE_DECL_SO_ACCEPTCONN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_ACCEPTCONN) == (4105), "SO_ACCEPTCONN != 4105"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_ACCEPTCONN 4105 +#endif +#elif defined __alpha__ +#if defined(SO_ACCEPTCONN) || (defined(HAVE_DECL_SO_ACCEPTCONN) && HAVE_DECL_SO_ACCEPTCONN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_ACCEPTCONN) == (4116), "SO_ACCEPTCONN != 4116"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_ACCEPTCONN 4116 +#endif +#elif defined __hppa__ +#if defined(SO_ACCEPTCONN) || (defined(HAVE_DECL_SO_ACCEPTCONN) && HAVE_DECL_SO_ACCEPTCONN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_ACCEPTCONN) == (16412), "SO_ACCEPTCONN != 16412"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_ACCEPTCONN 16412 +#endif +#elif defined __sparc__ +#if defined(SO_ACCEPTCONN) || (defined(HAVE_DECL_SO_ACCEPTCONN) && HAVE_DECL_SO_ACCEPTCONN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_ACCEPTCONN) == (32768), "SO_ACCEPTCONN != 32768"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_ACCEPTCONN 32768 +#endif +#else +#if defined(SO_ACCEPTCONN) || (defined(HAVE_DECL_SO_ACCEPTCONN) && HAVE_DECL_SO_ACCEPTCONN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_ACCEPTCONN) == (30), "SO_ACCEPTCONN != 30"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_ACCEPTCONN 30 +#endif +#endif +#if defined __alpha__ || defined __mips__ || defined __sparc__ +#if defined(SO_PEERSEC) || (defined(HAVE_DECL_SO_PEERSEC) && HAVE_DECL_SO_PEERSEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PEERSEC) == (30), "SO_PEERSEC != 30"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PEERSEC 30 +#endif +#elif defined __hppa__ +#if defined(SO_PEERSEC) || (defined(HAVE_DECL_SO_PEERSEC) && HAVE_DECL_SO_PEERSEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PEERSEC) == (16413), "SO_PEERSEC != 16413"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PEERSEC 16413 +#endif +#else +#if defined(SO_PEERSEC) || (defined(HAVE_DECL_SO_PEERSEC) && HAVE_DECL_SO_PEERSEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PEERSEC) == (31), "SO_PEERSEC != 31"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PEERSEC 31 +#endif +#endif +#if defined __mips__ +#if defined(SO_SNDBUFFORCE) || (defined(HAVE_DECL_SO_SNDBUFFORCE) && HAVE_DECL_SO_SNDBUFFORCE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SNDBUFFORCE) == (31), "SO_SNDBUFFORCE != 31"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SNDBUFFORCE 31 +#endif +#elif defined __alpha__ || defined __hppa__ || defined __sparc__ +#if defined(SO_SNDBUFFORCE) || (defined(HAVE_DECL_SO_SNDBUFFORCE) && HAVE_DECL_SO_SNDBUFFORCE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SNDBUFFORCE) == (4106), "SO_SNDBUFFORCE != 4106"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SNDBUFFORCE 4106 +#endif +#else +#if defined(SO_SNDBUFFORCE) || (defined(HAVE_DECL_SO_SNDBUFFORCE) && HAVE_DECL_SO_SNDBUFFORCE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SNDBUFFORCE) == (32), "SO_SNDBUFFORCE != 32"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SNDBUFFORCE 32 +#endif +#endif +#if defined __alpha__ || defined __hppa__ || defined __sparc__ +#if defined(SO_RCVBUFFORCE) || (defined(HAVE_DECL_SO_RCVBUFFORCE) && HAVE_DECL_SO_RCVBUFFORCE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_RCVBUFFORCE) == (4107), "SO_RCVBUFFORCE != 4107"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_RCVBUFFORCE 4107 +#endif +#else +#if defined(SO_RCVBUFFORCE) || (defined(HAVE_DECL_SO_RCVBUFFORCE) && HAVE_DECL_SO_RCVBUFFORCE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_RCVBUFFORCE) == (33), "SO_RCVBUFFORCE != 33"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_RCVBUFFORCE 33 +#endif +#endif +#if defined __sparc__ +#if defined(SO_PASSSEC) || (defined(HAVE_DECL_SO_PASSSEC) && HAVE_DECL_SO_PASSSEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PASSSEC) == (31), "SO_PASSSEC != 31"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PASSSEC 31 +#endif +#elif defined __hppa__ +#if defined(SO_PASSSEC) || (defined(HAVE_DECL_SO_PASSSEC) && HAVE_DECL_SO_PASSSEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PASSSEC) == (16414), "SO_PASSSEC != 16414"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PASSSEC 16414 +#endif +#else +#if defined(SO_PASSSEC) || (defined(HAVE_DECL_SO_PASSSEC) && HAVE_DECL_SO_PASSSEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PASSSEC) == (34), "SO_PASSSEC != 34"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PASSSEC 34 +#endif +#endif +#if defined __sparc__ +#if defined(SO_TIMESTAMPNS_OLD) || (defined(HAVE_DECL_SO_TIMESTAMPNS_OLD) && HAVE_DECL_SO_TIMESTAMPNS_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TIMESTAMPNS_OLD) == (33), "SO_TIMESTAMPNS_OLD != 33"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TIMESTAMPNS_OLD 33 +#endif +#elif defined __hppa__ +#if defined(SO_TIMESTAMPNS_OLD) || (defined(HAVE_DECL_SO_TIMESTAMPNS_OLD) && HAVE_DECL_SO_TIMESTAMPNS_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TIMESTAMPNS_OLD) == (16403), "SO_TIMESTAMPNS_OLD != 16403"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TIMESTAMPNS_OLD 16403 +#endif +#else +#if defined(SO_TIMESTAMPNS_OLD) || (defined(HAVE_DECL_SO_TIMESTAMPNS_OLD) && HAVE_DECL_SO_TIMESTAMPNS_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TIMESTAMPNS_OLD) == (35), "SO_TIMESTAMPNS_OLD != 35"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TIMESTAMPNS_OLD 35 +#endif +#endif +#if defined __sparc__ +#if defined(SO_MARK) || (defined(HAVE_DECL_SO_MARK) && HAVE_DECL_SO_MARK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_MARK) == (34), "SO_MARK != 34"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_MARK 34 +#endif +#elif defined __hppa__ +#if defined(SO_MARK) || (defined(HAVE_DECL_SO_MARK) && HAVE_DECL_SO_MARK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_MARK) == (16415), "SO_MARK != 16415"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_MARK 16415 +#endif +#else +#if defined(SO_MARK) || (defined(HAVE_DECL_SO_MARK) && HAVE_DECL_SO_MARK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_MARK) == (36), "SO_MARK != 36"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_MARK 36 +#endif +#endif +#if defined __sparc__ +#if defined(SO_TIMESTAMPING_OLD) || (defined(HAVE_DECL_SO_TIMESTAMPING_OLD) && HAVE_DECL_SO_TIMESTAMPING_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TIMESTAMPING_OLD) == (35), "SO_TIMESTAMPING_OLD != 35"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TIMESTAMPING_OLD 35 +#endif +#elif defined __hppa__ +#if defined(SO_TIMESTAMPING_OLD) || (defined(HAVE_DECL_SO_TIMESTAMPING_OLD) && HAVE_DECL_SO_TIMESTAMPING_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TIMESTAMPING_OLD) == (16416), "SO_TIMESTAMPING_OLD != 16416"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TIMESTAMPING_OLD 16416 +#endif +#else +#if defined(SO_TIMESTAMPING_OLD) || (defined(HAVE_DECL_SO_TIMESTAMPING_OLD) && HAVE_DECL_SO_TIMESTAMPING_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TIMESTAMPING_OLD) == (37), "SO_TIMESTAMPING_OLD != 37"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TIMESTAMPING_OLD 37 +#endif +#endif +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +#if defined(SO_PROTOCOL) || (defined(HAVE_DECL_SO_PROTOCOL) && HAVE_DECL_SO_PROTOCOL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PROTOCOL) == (4136), "SO_PROTOCOL != 4136"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PROTOCOL 4136 +#endif +#else +#if defined(SO_PROTOCOL) || (defined(HAVE_DECL_SO_PROTOCOL) && HAVE_DECL_SO_PROTOCOL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PROTOCOL) == (38), "SO_PROTOCOL != 38"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PROTOCOL 38 +#endif +#endif +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +#if defined(SO_DOMAIN) || (defined(HAVE_DECL_SO_DOMAIN) && HAVE_DECL_SO_DOMAIN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_DOMAIN) == (4137), "SO_DOMAIN != 4137"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_DOMAIN 4137 +#endif +#else +#if defined(SO_DOMAIN) || (defined(HAVE_DECL_SO_DOMAIN) && HAVE_DECL_SO_DOMAIN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_DOMAIN) == (39), "SO_DOMAIN != 39"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_DOMAIN 39 +#endif +#endif +#if defined __sparc__ +#if defined(SO_RXQ_OVFL) || (defined(HAVE_DECL_SO_RXQ_OVFL) && HAVE_DECL_SO_RXQ_OVFL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_RXQ_OVFL) == (36), "SO_RXQ_OVFL != 36"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_RXQ_OVFL 36 +#endif +#elif defined __hppa__ +#if defined(SO_RXQ_OVFL) || (defined(HAVE_DECL_SO_RXQ_OVFL) && HAVE_DECL_SO_RXQ_OVFL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_RXQ_OVFL) == (16417), "SO_RXQ_OVFL != 16417"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_RXQ_OVFL 16417 +#endif +#else +#if defined(SO_RXQ_OVFL) || (defined(HAVE_DECL_SO_RXQ_OVFL) && HAVE_DECL_SO_RXQ_OVFL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_RXQ_OVFL) == (40), "SO_RXQ_OVFL != 40"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_RXQ_OVFL 40 +#endif +#endif +#if defined __sparc__ +#if defined(SO_WIFI_STATUS) || (defined(HAVE_DECL_SO_WIFI_STATUS) && HAVE_DECL_SO_WIFI_STATUS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_WIFI_STATUS) == (37), "SO_WIFI_STATUS != 37"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_WIFI_STATUS 37 +#endif +#elif defined __hppa__ +#if defined(SO_WIFI_STATUS) || (defined(HAVE_DECL_SO_WIFI_STATUS) && HAVE_DECL_SO_WIFI_STATUS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_WIFI_STATUS) == (16418), "SO_WIFI_STATUS != 16418"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_WIFI_STATUS 16418 +#endif +#else +#if defined(SO_WIFI_STATUS) || (defined(HAVE_DECL_SO_WIFI_STATUS) && HAVE_DECL_SO_WIFI_STATUS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_WIFI_STATUS) == (41), "SO_WIFI_STATUS != 41"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_WIFI_STATUS 41 +#endif +#endif +#if defined __sparc__ +#if defined(SO_PEEK_OFF) || (defined(HAVE_DECL_SO_PEEK_OFF) && HAVE_DECL_SO_PEEK_OFF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PEEK_OFF) == (38), "SO_PEEK_OFF != 38"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PEEK_OFF 38 +#endif +#elif defined __hppa__ +#if defined(SO_PEEK_OFF) || (defined(HAVE_DECL_SO_PEEK_OFF) && HAVE_DECL_SO_PEEK_OFF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PEEK_OFF) == (16419), "SO_PEEK_OFF != 16419"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PEEK_OFF 16419 +#endif +#else +#if defined(SO_PEEK_OFF) || (defined(HAVE_DECL_SO_PEEK_OFF) && HAVE_DECL_SO_PEEK_OFF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PEEK_OFF) == (42), "SO_PEEK_OFF != 42"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PEEK_OFF 42 +#endif +#endif +#if defined __sparc__ +#if defined(SO_NOFCS) || (defined(HAVE_DECL_SO_NOFCS) && HAVE_DECL_SO_NOFCS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_NOFCS) == (39), "SO_NOFCS != 39"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_NOFCS 39 +#endif +#elif defined __hppa__ +#if defined(SO_NOFCS) || (defined(HAVE_DECL_SO_NOFCS) && HAVE_DECL_SO_NOFCS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_NOFCS) == (16420), "SO_NOFCS != 16420"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_NOFCS 16420 +#endif +#else +#if defined(SO_NOFCS) || (defined(HAVE_DECL_SO_NOFCS) && HAVE_DECL_SO_NOFCS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_NOFCS) == (43), "SO_NOFCS != 43"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_NOFCS 43 +#endif +#endif +#if defined __sparc__ +#if defined(SO_LOCK_FILTER) || (defined(HAVE_DECL_SO_LOCK_FILTER) && HAVE_DECL_SO_LOCK_FILTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_LOCK_FILTER) == (40), "SO_LOCK_FILTER != 40"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_LOCK_FILTER 40 +#endif +#elif defined __hppa__ +#if defined(SO_LOCK_FILTER) || (defined(HAVE_DECL_SO_LOCK_FILTER) && HAVE_DECL_SO_LOCK_FILTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_LOCK_FILTER) == (16421), "SO_LOCK_FILTER != 16421"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_LOCK_FILTER 16421 +#endif +#else +#if defined(SO_LOCK_FILTER) || (defined(HAVE_DECL_SO_LOCK_FILTER) && HAVE_DECL_SO_LOCK_FILTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_LOCK_FILTER) == (44), "SO_LOCK_FILTER != 44"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_LOCK_FILTER 44 +#endif +#endif +#if defined __sparc__ +#if defined(SO_SELECT_ERR_QUEUE) || (defined(HAVE_DECL_SO_SELECT_ERR_QUEUE) && HAVE_DECL_SO_SELECT_ERR_QUEUE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SELECT_ERR_QUEUE) == (41), "SO_SELECT_ERR_QUEUE != 41"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SELECT_ERR_QUEUE 41 +#endif +#elif defined __hppa__ +#if defined(SO_SELECT_ERR_QUEUE) || (defined(HAVE_DECL_SO_SELECT_ERR_QUEUE) && HAVE_DECL_SO_SELECT_ERR_QUEUE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SELECT_ERR_QUEUE) == (16422), "SO_SELECT_ERR_QUEUE != 16422"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SELECT_ERR_QUEUE 16422 +#endif +#else +#if defined(SO_SELECT_ERR_QUEUE) || (defined(HAVE_DECL_SO_SELECT_ERR_QUEUE) && HAVE_DECL_SO_SELECT_ERR_QUEUE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_SELECT_ERR_QUEUE) == (45), "SO_SELECT_ERR_QUEUE != 45"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_SELECT_ERR_QUEUE 45 +#endif +#endif +#if defined __sparc__ +#if defined(SO_BUSY_POLL) || (defined(HAVE_DECL_SO_BUSY_POLL) && HAVE_DECL_SO_BUSY_POLL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_BUSY_POLL) == (48), "SO_BUSY_POLL != 48"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_BUSY_POLL 48 +#endif +#elif defined __hppa__ +#if defined(SO_BUSY_POLL) || (defined(HAVE_DECL_SO_BUSY_POLL) && HAVE_DECL_SO_BUSY_POLL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_BUSY_POLL) == (16423), "SO_BUSY_POLL != 16423"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_BUSY_POLL 16423 +#endif +#else +#if defined(SO_BUSY_POLL) || (defined(HAVE_DECL_SO_BUSY_POLL) && HAVE_DECL_SO_BUSY_POLL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_BUSY_POLL) == (46), "SO_BUSY_POLL != 46"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_BUSY_POLL 46 +#endif +#endif +#if defined __sparc__ +#if defined(SO_MAX_PACING_RATE) || (defined(HAVE_DECL_SO_MAX_PACING_RATE) && HAVE_DECL_SO_MAX_PACING_RATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_MAX_PACING_RATE) == (49), "SO_MAX_PACING_RATE != 49"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_MAX_PACING_RATE 49 +#endif +#elif defined __hppa__ +#if defined(SO_MAX_PACING_RATE) || (defined(HAVE_DECL_SO_MAX_PACING_RATE) && HAVE_DECL_SO_MAX_PACING_RATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_MAX_PACING_RATE) == (16424), "SO_MAX_PACING_RATE != 16424"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_MAX_PACING_RATE 16424 +#endif +#else +#if defined(SO_MAX_PACING_RATE) || (defined(HAVE_DECL_SO_MAX_PACING_RATE) && HAVE_DECL_SO_MAX_PACING_RATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_MAX_PACING_RATE) == (47), "SO_MAX_PACING_RATE != 47"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_MAX_PACING_RATE 47 +#endif +#endif +#if defined __sparc__ +#if defined(SO_BPF_EXTENSIONS) || (defined(HAVE_DECL_SO_BPF_EXTENSIONS) && HAVE_DECL_SO_BPF_EXTENSIONS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_BPF_EXTENSIONS) == (50), "SO_BPF_EXTENSIONS != 50"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_BPF_EXTENSIONS 50 +#endif +#elif defined __hppa__ +#if defined(SO_BPF_EXTENSIONS) || (defined(HAVE_DECL_SO_BPF_EXTENSIONS) && HAVE_DECL_SO_BPF_EXTENSIONS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_BPF_EXTENSIONS) == (16425), "SO_BPF_EXTENSIONS != 16425"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_BPF_EXTENSIONS 16425 +#endif +#else +#if defined(SO_BPF_EXTENSIONS) || (defined(HAVE_DECL_SO_BPF_EXTENSIONS) && HAVE_DECL_SO_BPF_EXTENSIONS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_BPF_EXTENSIONS) == (48), "SO_BPF_EXTENSIONS != 48"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_BPF_EXTENSIONS 48 +#endif +#endif +#if defined __sparc__ +#if defined(SO_INCOMING_CPU) || (defined(HAVE_DECL_SO_INCOMING_CPU) && HAVE_DECL_SO_INCOMING_CPU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_INCOMING_CPU) == (51), "SO_INCOMING_CPU != 51"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_INCOMING_CPU 51 +#endif +#elif defined __hppa__ +#if defined(SO_INCOMING_CPU) || (defined(HAVE_DECL_SO_INCOMING_CPU) && HAVE_DECL_SO_INCOMING_CPU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_INCOMING_CPU) == (16426), "SO_INCOMING_CPU != 16426"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_INCOMING_CPU 16426 +#endif +#else +#if defined(SO_INCOMING_CPU) || (defined(HAVE_DECL_SO_INCOMING_CPU) && HAVE_DECL_SO_INCOMING_CPU) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_INCOMING_CPU) == (49), "SO_INCOMING_CPU != 49"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_INCOMING_CPU 49 +#endif +#endif +#if defined __sparc__ +#if defined(SO_ATTACH_BPF) || (defined(HAVE_DECL_SO_ATTACH_BPF) && HAVE_DECL_SO_ATTACH_BPF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_ATTACH_BPF) == (52), "SO_ATTACH_BPF != 52"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_ATTACH_BPF 52 +#endif +#elif defined __hppa__ +#if defined(SO_ATTACH_BPF) || (defined(HAVE_DECL_SO_ATTACH_BPF) && HAVE_DECL_SO_ATTACH_BPF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_ATTACH_BPF) == (16427), "SO_ATTACH_BPF != 16427"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_ATTACH_BPF 16427 +#endif +#else +#if defined(SO_ATTACH_BPF) || (defined(HAVE_DECL_SO_ATTACH_BPF) && HAVE_DECL_SO_ATTACH_BPF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_ATTACH_BPF) == (50), "SO_ATTACH_BPF != 50"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_ATTACH_BPF 50 +#endif +#endif +#if defined __sparc__ +#if defined(SO_ATTACH_REUSEPORT_CBPF) || (defined(HAVE_DECL_SO_ATTACH_REUSEPORT_CBPF) && HAVE_DECL_SO_ATTACH_REUSEPORT_CBPF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_ATTACH_REUSEPORT_CBPF) == (53), "SO_ATTACH_REUSEPORT_CBPF != 53"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_ATTACH_REUSEPORT_CBPF 53 +#endif +#elif defined __hppa__ +#if defined(SO_ATTACH_REUSEPORT_CBPF) || (defined(HAVE_DECL_SO_ATTACH_REUSEPORT_CBPF) && HAVE_DECL_SO_ATTACH_REUSEPORT_CBPF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_ATTACH_REUSEPORT_CBPF) == (16428), "SO_ATTACH_REUSEPORT_CBPF != 16428"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_ATTACH_REUSEPORT_CBPF 16428 +#endif +#else +#if defined(SO_ATTACH_REUSEPORT_CBPF) || (defined(HAVE_DECL_SO_ATTACH_REUSEPORT_CBPF) && HAVE_DECL_SO_ATTACH_REUSEPORT_CBPF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_ATTACH_REUSEPORT_CBPF) == (51), "SO_ATTACH_REUSEPORT_CBPF != 51"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_ATTACH_REUSEPORT_CBPF 51 +#endif +#endif +#if defined __sparc__ +#if defined(SO_ATTACH_REUSEPORT_EBPF) || (defined(HAVE_DECL_SO_ATTACH_REUSEPORT_EBPF) && HAVE_DECL_SO_ATTACH_REUSEPORT_EBPF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_ATTACH_REUSEPORT_EBPF) == (54), "SO_ATTACH_REUSEPORT_EBPF != 54"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_ATTACH_REUSEPORT_EBPF 54 +#endif +#elif defined __hppa__ +#if defined(SO_ATTACH_REUSEPORT_EBPF) || (defined(HAVE_DECL_SO_ATTACH_REUSEPORT_EBPF) && HAVE_DECL_SO_ATTACH_REUSEPORT_EBPF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_ATTACH_REUSEPORT_EBPF) == (16429), "SO_ATTACH_REUSEPORT_EBPF != 16429"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_ATTACH_REUSEPORT_EBPF 16429 +#endif +#else +#if defined(SO_ATTACH_REUSEPORT_EBPF) || (defined(HAVE_DECL_SO_ATTACH_REUSEPORT_EBPF) && HAVE_DECL_SO_ATTACH_REUSEPORT_EBPF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_ATTACH_REUSEPORT_EBPF) == (52), "SO_ATTACH_REUSEPORT_EBPF != 52"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_ATTACH_REUSEPORT_EBPF 52 +#endif +#endif +#if defined __sparc__ +#if defined(SO_CNX_ADVICE) || (defined(HAVE_DECL_SO_CNX_ADVICE) && HAVE_DECL_SO_CNX_ADVICE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_CNX_ADVICE) == (55), "SO_CNX_ADVICE != 55"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_CNX_ADVICE 55 +#endif +#elif defined __hppa__ +#if defined(SO_CNX_ADVICE) || (defined(HAVE_DECL_SO_CNX_ADVICE) && HAVE_DECL_SO_CNX_ADVICE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_CNX_ADVICE) == (16430), "SO_CNX_ADVICE != 16430"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_CNX_ADVICE 16430 +#endif +#else +#if defined(SO_CNX_ADVICE) || (defined(HAVE_DECL_SO_CNX_ADVICE) && HAVE_DECL_SO_CNX_ADVICE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_CNX_ADVICE) == (53), "SO_CNX_ADVICE != 53"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_CNX_ADVICE 53 +#endif +#endif +#if defined __sparc__ +#if defined(SO_MEMINFO) || (defined(HAVE_DECL_SO_MEMINFO) && HAVE_DECL_SO_MEMINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_MEMINFO) == (57), "SO_MEMINFO != 57"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_MEMINFO 57 +#endif +#elif defined __hppa__ +#if defined(SO_MEMINFO) || (defined(HAVE_DECL_SO_MEMINFO) && HAVE_DECL_SO_MEMINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_MEMINFO) == (16432), "SO_MEMINFO != 16432"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_MEMINFO 16432 +#endif +#else +#if defined(SO_MEMINFO) || (defined(HAVE_DECL_SO_MEMINFO) && HAVE_DECL_SO_MEMINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_MEMINFO) == (55), "SO_MEMINFO != 55"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_MEMINFO 55 +#endif +#endif +#if defined __sparc__ +#if defined(SO_INCOMING_NAPI_ID) || (defined(HAVE_DECL_SO_INCOMING_NAPI_ID) && HAVE_DECL_SO_INCOMING_NAPI_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_INCOMING_NAPI_ID) == (58), "SO_INCOMING_NAPI_ID != 58"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_INCOMING_NAPI_ID 58 +#endif +#elif defined __hppa__ +#if defined(SO_INCOMING_NAPI_ID) || (defined(HAVE_DECL_SO_INCOMING_NAPI_ID) && HAVE_DECL_SO_INCOMING_NAPI_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_INCOMING_NAPI_ID) == (16433), "SO_INCOMING_NAPI_ID != 16433"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_INCOMING_NAPI_ID 16433 +#endif +#else +#if defined(SO_INCOMING_NAPI_ID) || (defined(HAVE_DECL_SO_INCOMING_NAPI_ID) && HAVE_DECL_SO_INCOMING_NAPI_ID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_INCOMING_NAPI_ID) == (56), "SO_INCOMING_NAPI_ID != 56"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_INCOMING_NAPI_ID 56 +#endif +#endif +#if defined __sparc__ +#if defined(SO_COOKIE) || (defined(HAVE_DECL_SO_COOKIE) && HAVE_DECL_SO_COOKIE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_COOKIE) == (59), "SO_COOKIE != 59"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_COOKIE 59 +#endif +#elif defined __hppa__ +#if defined(SO_COOKIE) || (defined(HAVE_DECL_SO_COOKIE) && HAVE_DECL_SO_COOKIE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_COOKIE) == (16434), "SO_COOKIE != 16434"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_COOKIE 16434 +#endif +#else +#if defined(SO_COOKIE) || (defined(HAVE_DECL_SO_COOKIE) && HAVE_DECL_SO_COOKIE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_COOKIE) == (57), "SO_COOKIE != 57"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_COOKIE 57 +#endif +#endif +#if defined __sparc__ +#if defined(SO_PEERGROUPS) || (defined(HAVE_DECL_SO_PEERGROUPS) && HAVE_DECL_SO_PEERGROUPS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PEERGROUPS) == (61), "SO_PEERGROUPS != 61"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PEERGROUPS 61 +#endif +#elif defined __hppa__ +#if defined(SO_PEERGROUPS) || (defined(HAVE_DECL_SO_PEERGROUPS) && HAVE_DECL_SO_PEERGROUPS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PEERGROUPS) == (16436), "SO_PEERGROUPS != 16436"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PEERGROUPS 16436 +#endif +#else +#if defined(SO_PEERGROUPS) || (defined(HAVE_DECL_SO_PEERGROUPS) && HAVE_DECL_SO_PEERGROUPS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_PEERGROUPS) == (59), "SO_PEERGROUPS != 59"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_PEERGROUPS 59 +#endif +#endif +#if defined __sparc__ +#if defined(SO_ZEROCOPY) || (defined(HAVE_DECL_SO_ZEROCOPY) && HAVE_DECL_SO_ZEROCOPY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_ZEROCOPY) == (62), "SO_ZEROCOPY != 62"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_ZEROCOPY 62 +#endif +#elif defined __hppa__ +#if defined(SO_ZEROCOPY) || (defined(HAVE_DECL_SO_ZEROCOPY) && HAVE_DECL_SO_ZEROCOPY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_ZEROCOPY) == (16437), "SO_ZEROCOPY != 16437"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_ZEROCOPY 16437 +#endif +#else +#if defined(SO_ZEROCOPY) || (defined(HAVE_DECL_SO_ZEROCOPY) && HAVE_DECL_SO_ZEROCOPY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_ZEROCOPY) == (60), "SO_ZEROCOPY != 60"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_ZEROCOPY 60 +#endif +#endif +#if defined __sparc__ +#if defined(SO_TXTIME) || (defined(HAVE_DECL_SO_TXTIME) && HAVE_DECL_SO_TXTIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TXTIME) == (63), "SO_TXTIME != 63"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TXTIME 63 +#endif +#elif defined __hppa__ +#if defined(SO_TXTIME) || (defined(HAVE_DECL_SO_TXTIME) && HAVE_DECL_SO_TXTIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TXTIME) == (16438), "SO_TXTIME != 16438"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TXTIME 16438 +#endif +#else +#if defined(SO_TXTIME) || (defined(HAVE_DECL_SO_TXTIME) && HAVE_DECL_SO_TXTIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TXTIME) == (61), "SO_TXTIME != 61"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TXTIME 61 +#endif +#endif +#if defined __sparc__ +#if defined(SO_TIMESTAMP_NEW) || (defined(HAVE_DECL_SO_TIMESTAMP_NEW) && HAVE_DECL_SO_TIMESTAMP_NEW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TIMESTAMP_NEW) == (70), "SO_TIMESTAMP_NEW != 70"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TIMESTAMP_NEW 70 +#endif +#elif defined __hppa__ +#if defined(SO_TIMESTAMP_NEW) || (defined(HAVE_DECL_SO_TIMESTAMP_NEW) && HAVE_DECL_SO_TIMESTAMP_NEW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TIMESTAMP_NEW) == (16440), "SO_TIMESTAMP_NEW != 16440"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TIMESTAMP_NEW 16440 +#endif +#else +#if defined(SO_TIMESTAMP_NEW) || (defined(HAVE_DECL_SO_TIMESTAMP_NEW) && HAVE_DECL_SO_TIMESTAMP_NEW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TIMESTAMP_NEW) == (63), "SO_TIMESTAMP_NEW != 63"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TIMESTAMP_NEW 63 +#endif +#endif +#if defined __sparc__ +#if defined(SO_TIMESTAMPNS_NEW) || (defined(HAVE_DECL_SO_TIMESTAMPNS_NEW) && HAVE_DECL_SO_TIMESTAMPNS_NEW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TIMESTAMPNS_NEW) == (66), "SO_TIMESTAMPNS_NEW != 66"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TIMESTAMPNS_NEW 66 +#endif +#elif defined __hppa__ +#if defined(SO_TIMESTAMPNS_NEW) || (defined(HAVE_DECL_SO_TIMESTAMPNS_NEW) && HAVE_DECL_SO_TIMESTAMPNS_NEW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TIMESTAMPNS_NEW) == (16441), "SO_TIMESTAMPNS_NEW != 16441"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TIMESTAMPNS_NEW 16441 +#endif +#else +#if defined(SO_TIMESTAMPNS_NEW) || (defined(HAVE_DECL_SO_TIMESTAMPNS_NEW) && HAVE_DECL_SO_TIMESTAMPNS_NEW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TIMESTAMPNS_NEW) == (64), "SO_TIMESTAMPNS_NEW != 64"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TIMESTAMPNS_NEW 64 +#endif +#endif +#if defined __sparc__ +#if defined(SO_TIMESTAMPING_NEW) || (defined(HAVE_DECL_SO_TIMESTAMPING_NEW) && HAVE_DECL_SO_TIMESTAMPING_NEW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TIMESTAMPING_NEW) == (67), "SO_TIMESTAMPING_NEW != 67"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TIMESTAMPING_NEW 67 +#endif +#elif defined __hppa__ +#if defined(SO_TIMESTAMPING_NEW) || (defined(HAVE_DECL_SO_TIMESTAMPING_NEW) && HAVE_DECL_SO_TIMESTAMPING_NEW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TIMESTAMPING_NEW) == (16442), "SO_TIMESTAMPING_NEW != 16442"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TIMESTAMPING_NEW 16442 +#endif +#else +#if defined(SO_TIMESTAMPING_NEW) || (defined(HAVE_DECL_SO_TIMESTAMPING_NEW) && HAVE_DECL_SO_TIMESTAMPING_NEW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TIMESTAMPING_NEW) == (65), "SO_TIMESTAMPING_NEW != 65"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TIMESTAMPING_NEW 65 +#endif +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_options in mpers mode + +# else + +static +const struct xlat sock_options[] = { + + + XLAT(SO_DEBUG), + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_REUSEADDR), +#else + XLAT(SO_REUSEADDR), +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_TYPE), +#else + XLAT(SO_TYPE), +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_ERROR), +#else + XLAT(SO_ERROR), +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_DONTROUTE), +#else + XLAT(SO_DONTROUTE), +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_BROADCAST), +#else + XLAT(SO_BROADCAST), +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_SNDBUF), +#else + XLAT(SO_SNDBUF), +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_RCVBUF), +#else + XLAT(SO_RCVBUF), +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_KEEPALIVE), +#else + XLAT(SO_KEEPALIVE), +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_OOBINLINE), +#else + XLAT(SO_OOBINLINE), +#endif + +#if defined __hppa__ + XLAT(SO_NO_CHECK), +#else + XLAT(SO_NO_CHECK), +#endif + +#if defined __hppa__ + XLAT(SO_PRIORITY), +#else + XLAT(SO_PRIORITY), +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_LINGER), +#else + XLAT(SO_LINGER), +#endif + +#if defined __sparc__ + XLAT(SO_BSDCOMPAT), +#elif defined __hppa__ + XLAT(SO_BSDCOMPAT), +#else + XLAT(SO_BSDCOMPAT), +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_REUSEPORT), +#else + XLAT(SO_REUSEPORT), +#endif + +#if defined __sparc__ + XLAT(SO_PASSCRED), +#elif defined __alpha__ || defined __mips__ + XLAT(SO_PASSCRED), +#elif defined __powerpc__ + XLAT(SO_PASSCRED), +#elif defined __hppa__ + XLAT(SO_PASSCRED), +#else + XLAT(SO_PASSCRED), +#endif + +#if defined __alpha__ || defined __mips__ + XLAT(SO_PEERCRED), +#elif defined __powerpc__ + XLAT(SO_PEERCRED), +#elif defined __sparc__ + XLAT(SO_PEERCRED), +#elif defined __hppa__ + XLAT(SO_PEERCRED), +#else + XLAT(SO_PEERCRED), +#endif + +#if defined __powerpc__ + XLAT(SO_RCVLOWAT), +#elif defined __sparc__ + XLAT(SO_RCVLOWAT), +#elif defined __hppa__ || defined __mips__ + XLAT(SO_RCVLOWAT), +#elif defined __alpha__ + XLAT(SO_RCVLOWAT), +#else + XLAT(SO_RCVLOWAT), +#endif + +#if defined __powerpc__ + XLAT(SO_SNDLOWAT), +#elif defined __sparc__ + XLAT(SO_SNDLOWAT), +#elif defined __hppa__ || defined __mips__ + XLAT(SO_SNDLOWAT), +#elif defined __alpha__ + XLAT(SO_SNDLOWAT), +#else + XLAT(SO_SNDLOWAT), +#endif + +#if defined __powerpc__ + XLAT(SO_RCVTIMEO_OLD), +#elif defined __hppa__ || defined __mips__ + XLAT(SO_RCVTIMEO_OLD), +#elif defined __alpha__ + XLAT(SO_RCVTIMEO_OLD), +#elif defined __sparc__ + XLAT(SO_RCVTIMEO_OLD), +#else + XLAT(SO_RCVTIMEO_OLD), +#endif + +#if defined __powerpc__ + XLAT(SO_SNDTIMEO_OLD), +#elif defined __hppa__ || defined __mips__ + XLAT(SO_SNDTIMEO_OLD), +#elif defined __alpha__ + XLAT(SO_SNDTIMEO_OLD), +#elif defined __sparc__ + XLAT(SO_SNDTIMEO_OLD), +#else + XLAT(SO_SNDTIMEO_OLD), +#endif + +#if defined __alpha__ + XLAT(SO_SECURITY_AUTHENTICATION), +#elif defined __hppa__ + XLAT(SO_SECURITY_AUTHENTICATION), +#elif defined __sparc__ + XLAT(SO_SECURITY_AUTHENTICATION), +#else + XLAT(SO_SECURITY_AUTHENTICATION), +#endif + +#if defined __alpha__ + XLAT(SO_SECURITY_ENCRYPTION_TRANSPORT), +#elif defined __hppa__ + XLAT(SO_SECURITY_ENCRYPTION_TRANSPORT), +#elif defined __sparc__ + XLAT(SO_SECURITY_ENCRYPTION_TRANSPORT), +#else + XLAT(SO_SECURITY_ENCRYPTION_TRANSPORT), +#endif + +#if defined __alpha__ + XLAT(SO_SECURITY_ENCRYPTION_NETWORK), +#elif defined __hppa__ + XLAT(SO_SECURITY_ENCRYPTION_NETWORK), +#elif defined __sparc__ + XLAT(SO_SECURITY_ENCRYPTION_NETWORK), +#else + XLAT(SO_SECURITY_ENCRYPTION_NETWORK), +#endif + +#if defined __sparc__ + XLAT(SO_BINDTODEVICE), +#elif defined __hppa__ + XLAT(SO_BINDTODEVICE), +#else + XLAT(SO_BINDTODEVICE), +#endif + +#if defined __hppa__ + XLAT(SO_DETACH_FILTER), +#else + XLAT(SO_DETACH_FILTER), +#endif + +#if defined __hppa__ + XLAT(SO_PEERNAME), +#else + XLAT(SO_PEERNAME), +#endif + +#if defined __hppa__ + XLAT(SO_TIMESTAMP_OLD), +#else + XLAT(SO_TIMESTAMP_OLD), +#endif + +#if defined __mips__ + XLAT(SO_ACCEPTCONN), +#elif defined __alpha__ + XLAT(SO_ACCEPTCONN), +#elif defined __hppa__ + XLAT(SO_ACCEPTCONN), +#elif defined __sparc__ + XLAT(SO_ACCEPTCONN), +#else + XLAT(SO_ACCEPTCONN), +#endif + +#if defined __alpha__ || defined __mips__ || defined __sparc__ + XLAT(SO_PEERSEC), +#elif defined __hppa__ + XLAT(SO_PEERSEC), +#else + XLAT(SO_PEERSEC), +#endif + +#if defined __mips__ + XLAT(SO_SNDBUFFORCE), +#elif defined __alpha__ || defined __hppa__ || defined __sparc__ + XLAT(SO_SNDBUFFORCE), +#else + XLAT(SO_SNDBUFFORCE), +#endif + +#if defined __alpha__ || defined __hppa__ || defined __sparc__ + XLAT(SO_RCVBUFFORCE), +#else + XLAT(SO_RCVBUFFORCE), +#endif + +#if defined __sparc__ + XLAT(SO_PASSSEC), +#elif defined __hppa__ + XLAT(SO_PASSSEC), +#else + XLAT(SO_PASSSEC), +#endif + +#if defined __sparc__ + XLAT(SO_TIMESTAMPNS_OLD), +#elif defined __hppa__ + XLAT(SO_TIMESTAMPNS_OLD), +#else + XLAT(SO_TIMESTAMPNS_OLD), +#endif + +#if defined __sparc__ + XLAT(SO_MARK), +#elif defined __hppa__ + XLAT(SO_MARK), +#else + XLAT(SO_MARK), +#endif + +#if defined __sparc__ + XLAT(SO_TIMESTAMPING_OLD), +#elif defined __hppa__ + XLAT(SO_TIMESTAMPING_OLD), +#else + XLAT(SO_TIMESTAMPING_OLD), +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_PROTOCOL), +#else + XLAT(SO_PROTOCOL), +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SO_DOMAIN), +#else + XLAT(SO_DOMAIN), +#endif + +#if defined __sparc__ + XLAT(SO_RXQ_OVFL), +#elif defined __hppa__ + XLAT(SO_RXQ_OVFL), +#else + XLAT(SO_RXQ_OVFL), +#endif + +#if defined __sparc__ + XLAT(SO_WIFI_STATUS), +#elif defined __hppa__ + XLAT(SO_WIFI_STATUS), +#else + XLAT(SO_WIFI_STATUS), +#endif + +#if defined __sparc__ + XLAT(SO_PEEK_OFF), +#elif defined __hppa__ + XLAT(SO_PEEK_OFF), +#else + XLAT(SO_PEEK_OFF), +#endif + +#if defined __sparc__ + XLAT(SO_NOFCS), +#elif defined __hppa__ + XLAT(SO_NOFCS), +#else + XLAT(SO_NOFCS), +#endif + +#if defined __sparc__ + XLAT(SO_LOCK_FILTER), +#elif defined __hppa__ + XLAT(SO_LOCK_FILTER), +#else + XLAT(SO_LOCK_FILTER), +#endif + +#if defined __sparc__ + XLAT(SO_SELECT_ERR_QUEUE), +#elif defined __hppa__ + XLAT(SO_SELECT_ERR_QUEUE), +#else + XLAT(SO_SELECT_ERR_QUEUE), +#endif + +#if defined __sparc__ + XLAT(SO_BUSY_POLL), +#elif defined __hppa__ + XLAT(SO_BUSY_POLL), +#else + XLAT(SO_BUSY_POLL), +#endif + +#if defined __sparc__ + XLAT(SO_MAX_PACING_RATE), +#elif defined __hppa__ + XLAT(SO_MAX_PACING_RATE), +#else + XLAT(SO_MAX_PACING_RATE), +#endif + +#if defined __sparc__ + XLAT(SO_BPF_EXTENSIONS), +#elif defined __hppa__ + XLAT(SO_BPF_EXTENSIONS), +#else + XLAT(SO_BPF_EXTENSIONS), +#endif + +#if defined __sparc__ + XLAT(SO_INCOMING_CPU), +#elif defined __hppa__ + XLAT(SO_INCOMING_CPU), +#else + XLAT(SO_INCOMING_CPU), +#endif + +#if defined __sparc__ + XLAT(SO_ATTACH_BPF), +#elif defined __hppa__ + XLAT(SO_ATTACH_BPF), +#else + XLAT(SO_ATTACH_BPF), +#endif + +#if defined __sparc__ + XLAT(SO_ATTACH_REUSEPORT_CBPF), +#elif defined __hppa__ + XLAT(SO_ATTACH_REUSEPORT_CBPF), +#else + XLAT(SO_ATTACH_REUSEPORT_CBPF), +#endif + +#if defined __sparc__ + XLAT(SO_ATTACH_REUSEPORT_EBPF), +#elif defined __hppa__ + XLAT(SO_ATTACH_REUSEPORT_EBPF), +#else + XLAT(SO_ATTACH_REUSEPORT_EBPF), +#endif + +#if defined __sparc__ + XLAT(SO_CNX_ADVICE), +#elif defined __hppa__ + XLAT(SO_CNX_ADVICE), +#else + XLAT(SO_CNX_ADVICE), +#endif + +#if defined __sparc__ + XLAT(SO_MEMINFO), +#elif defined __hppa__ + XLAT(SO_MEMINFO), +#else + XLAT(SO_MEMINFO), +#endif + +#if defined __sparc__ + XLAT(SO_INCOMING_NAPI_ID), +#elif defined __hppa__ + XLAT(SO_INCOMING_NAPI_ID), +#else + XLAT(SO_INCOMING_NAPI_ID), +#endif + +#if defined __sparc__ + XLAT(SO_COOKIE), +#elif defined __hppa__ + XLAT(SO_COOKIE), +#else + XLAT(SO_COOKIE), +#endif + +#if defined __sparc__ + XLAT(SO_PEERGROUPS), +#elif defined __hppa__ + XLAT(SO_PEERGROUPS), +#else + XLAT(SO_PEERGROUPS), +#endif + +#if defined __sparc__ + XLAT(SO_ZEROCOPY), +#elif defined __hppa__ + XLAT(SO_ZEROCOPY), +#else + XLAT(SO_ZEROCOPY), +#endif + +#if defined __sparc__ + XLAT(SO_TXTIME), +#elif defined __hppa__ + XLAT(SO_TXTIME), +#else + XLAT(SO_TXTIME), +#endif + +#if defined __sparc__ + XLAT(SO_TIMESTAMP_NEW), +#elif defined __hppa__ + XLAT(SO_TIMESTAMP_NEW), +#else + XLAT(SO_TIMESTAMP_NEW), +#endif +#if defined __sparc__ + XLAT(SO_TIMESTAMPNS_NEW), +#elif defined __hppa__ + XLAT(SO_TIMESTAMPNS_NEW), +#else + XLAT(SO_TIMESTAMPNS_NEW), +#endif +#if defined __sparc__ + XLAT(SO_TIMESTAMPING_NEW), +#elif defined __hppa__ + XLAT(SO_TIMESTAMPING_NEW), +#else + XLAT(SO_TIMESTAMPING_NEW), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_options.in b/xlat/sock_options.in new file mode 100644 index 00000000..619356e3 --- /dev/null +++ b/xlat/sock_options.in @@ -0,0 +1,477 @@ +/* Generated by maint/gen_xlat_defs.sh -f 'u' -p 'SO_' -c 'asm-generic/socket.h' -a 'asm/socket.h' */ + +SO_DEBUG 1 + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +SO_REUSEADDR 4 +#else +SO_REUSEADDR 2 +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +SO_TYPE 4104 +#else +SO_TYPE 3 +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +SO_ERROR 4103 +#else +SO_ERROR 4 +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +SO_DONTROUTE 16 +#else +SO_DONTROUTE 5 +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +SO_BROADCAST 32 +#else +SO_BROADCAST 6 +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +SO_SNDBUF 4097 +#else +SO_SNDBUF 7 +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +SO_RCVBUF 4098 +#else +SO_RCVBUF 8 +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +SO_KEEPALIVE 8 +#else +SO_KEEPALIVE 9 +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +SO_OOBINLINE 256 +#else +SO_OOBINLINE 10 +#endif + +#if defined __hppa__ +SO_NO_CHECK 16395 +#else +SO_NO_CHECK 11 +#endif + +#if defined __hppa__ +SO_PRIORITY 16396 +#else +SO_PRIORITY 12 +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +SO_LINGER 128 +#else +SO_LINGER 13 +#endif + +#if defined __sparc__ +SO_BSDCOMPAT 1024 +#elif defined __hppa__ +SO_BSDCOMPAT 16398 +#else +SO_BSDCOMPAT 14 +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +SO_REUSEPORT 512 +#else +SO_REUSEPORT 15 +#endif + +#if defined __sparc__ +SO_PASSCRED 2 +#elif defined __alpha__ || defined __mips__ +SO_PASSCRED 17 +#elif defined __powerpc__ +SO_PASSCRED 20 +#elif defined __hppa__ +SO_PASSCRED 16400 +#else +SO_PASSCRED 16 +#endif + +#if defined __alpha__ || defined __mips__ +SO_PEERCRED 18 +#elif defined __powerpc__ +SO_PEERCRED 21 +#elif defined __sparc__ +SO_PEERCRED 64 +#elif defined __hppa__ +SO_PEERCRED 16401 +#else +SO_PEERCRED 17 +#endif + +#if defined __powerpc__ +SO_RCVLOWAT 16 +#elif defined __sparc__ +SO_RCVLOWAT 2048 +#elif defined __hppa__ || defined __mips__ +SO_RCVLOWAT 4100 +#elif defined __alpha__ +SO_RCVLOWAT 4112 +#else +SO_RCVLOWAT 18 +#endif + +#if defined __powerpc__ +SO_SNDLOWAT 17 +#elif defined __sparc__ +SO_SNDLOWAT 4096 +#elif defined __hppa__ || defined __mips__ +SO_SNDLOWAT 4099 +#elif defined __alpha__ +SO_SNDLOWAT 4113 +#else +SO_SNDLOWAT 19 +#endif + +#if defined __powerpc__ +SO_RCVTIMEO_OLD 18 +#elif defined __hppa__ || defined __mips__ +SO_RCVTIMEO_OLD 4102 +#elif defined __alpha__ +SO_RCVTIMEO_OLD 4114 +#elif defined __sparc__ +SO_RCVTIMEO_OLD 8192 +#else +SO_RCVTIMEO_OLD 20 +#endif + +#if defined __powerpc__ +SO_SNDTIMEO_OLD 19 +#elif defined __hppa__ || defined __mips__ +SO_SNDTIMEO_OLD 4101 +#elif defined __alpha__ +SO_SNDTIMEO_OLD 4115 +#elif defined __sparc__ +SO_SNDTIMEO_OLD 16384 +#else +SO_SNDTIMEO_OLD 21 +#endif + +#if defined __alpha__ +SO_SECURITY_AUTHENTICATION 19 +#elif defined __hppa__ +SO_SECURITY_AUTHENTICATION 16406 +#elif defined __sparc__ +SO_SECURITY_AUTHENTICATION 20481 +#else +SO_SECURITY_AUTHENTICATION 22 +#endif + +#if defined __alpha__ +SO_SECURITY_ENCRYPTION_TRANSPORT 20 +#elif defined __hppa__ +SO_SECURITY_ENCRYPTION_TRANSPORT 16407 +#elif defined __sparc__ +SO_SECURITY_ENCRYPTION_TRANSPORT 20482 +#else +SO_SECURITY_ENCRYPTION_TRANSPORT 23 +#endif + +#if defined __alpha__ +SO_SECURITY_ENCRYPTION_NETWORK 21 +#elif defined __hppa__ +SO_SECURITY_ENCRYPTION_NETWORK 16408 +#elif defined __sparc__ +SO_SECURITY_ENCRYPTION_NETWORK 20484 +#else +SO_SECURITY_ENCRYPTION_NETWORK 24 +#endif + +#if defined __sparc__ +SO_BINDTODEVICE 13 +#elif defined __hppa__ +SO_BINDTODEVICE 16409 +#else +SO_BINDTODEVICE 25 +#endif + +#if defined __hppa__ +SO_DETACH_FILTER 16411 +#else +SO_DETACH_FILTER 27 +#endif + +#if defined __hppa__ +SO_PEERNAME 8192 +#else +SO_PEERNAME 28 +#endif + +#if defined __hppa__ +SO_TIMESTAMP_OLD 16402 +#else +SO_TIMESTAMP_OLD 29 +#endif + +#if defined __mips__ +SO_ACCEPTCONN 4105 +#elif defined __alpha__ +SO_ACCEPTCONN 4116 +#elif defined __hppa__ +SO_ACCEPTCONN 16412 +#elif defined __sparc__ +SO_ACCEPTCONN 32768 +#else +SO_ACCEPTCONN 30 +#endif + +#if defined __alpha__ || defined __mips__ || defined __sparc__ +SO_PEERSEC 30 +#elif defined __hppa__ +SO_PEERSEC 16413 +#else +SO_PEERSEC 31 +#endif + +#if defined __mips__ +SO_SNDBUFFORCE 31 +#elif defined __alpha__ || defined __hppa__ || defined __sparc__ +SO_SNDBUFFORCE 4106 +#else +SO_SNDBUFFORCE 32 +#endif + +#if defined __alpha__ || defined __hppa__ || defined __sparc__ +SO_RCVBUFFORCE 4107 +#else +SO_RCVBUFFORCE 33 +#endif + +#if defined __sparc__ +SO_PASSSEC 31 +#elif defined __hppa__ +SO_PASSSEC 16414 +#else +SO_PASSSEC 34 +#endif + +#if defined __sparc__ +SO_TIMESTAMPNS_OLD 33 +#elif defined __hppa__ +SO_TIMESTAMPNS_OLD 16403 +#else +SO_TIMESTAMPNS_OLD 35 +#endif + +#if defined __sparc__ +SO_MARK 34 +#elif defined __hppa__ +SO_MARK 16415 +#else +SO_MARK 36 +#endif + +#if defined __sparc__ +SO_TIMESTAMPING_OLD 35 +#elif defined __hppa__ +SO_TIMESTAMPING_OLD 16416 +#else +SO_TIMESTAMPING_OLD 37 +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +SO_PROTOCOL 4136 +#else +SO_PROTOCOL 38 +#endif + +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +SO_DOMAIN 4137 +#else +SO_DOMAIN 39 +#endif + +#if defined __sparc__ +SO_RXQ_OVFL 36 +#elif defined __hppa__ +SO_RXQ_OVFL 16417 +#else +SO_RXQ_OVFL 40 +#endif + +#if defined __sparc__ +SO_WIFI_STATUS 37 +#elif defined __hppa__ +SO_WIFI_STATUS 16418 +#else +SO_WIFI_STATUS 41 +#endif + +#if defined __sparc__ +SO_PEEK_OFF 38 +#elif defined __hppa__ +SO_PEEK_OFF 16419 +#else +SO_PEEK_OFF 42 +#endif + +#if defined __sparc__ +SO_NOFCS 39 +#elif defined __hppa__ +SO_NOFCS 16420 +#else +SO_NOFCS 43 +#endif + +#if defined __sparc__ +SO_LOCK_FILTER 40 +#elif defined __hppa__ +SO_LOCK_FILTER 16421 +#else +SO_LOCK_FILTER 44 +#endif + +#if defined __sparc__ +SO_SELECT_ERR_QUEUE 41 +#elif defined __hppa__ +SO_SELECT_ERR_QUEUE 16422 +#else +SO_SELECT_ERR_QUEUE 45 +#endif + +#if defined __sparc__ +SO_BUSY_POLL 48 +#elif defined __hppa__ +SO_BUSY_POLL 16423 +#else +SO_BUSY_POLL 46 +#endif + +#if defined __sparc__ +SO_MAX_PACING_RATE 49 +#elif defined __hppa__ +SO_MAX_PACING_RATE 16424 +#else +SO_MAX_PACING_RATE 47 +#endif + +#if defined __sparc__ +SO_BPF_EXTENSIONS 50 +#elif defined __hppa__ +SO_BPF_EXTENSIONS 16425 +#else +SO_BPF_EXTENSIONS 48 +#endif + +#if defined __sparc__ +SO_INCOMING_CPU 51 +#elif defined __hppa__ +SO_INCOMING_CPU 16426 +#else +SO_INCOMING_CPU 49 +#endif + +#if defined __sparc__ +SO_ATTACH_BPF 52 +#elif defined __hppa__ +SO_ATTACH_BPF 16427 +#else +SO_ATTACH_BPF 50 +#endif + +#if defined __sparc__ +SO_ATTACH_REUSEPORT_CBPF 53 +#elif defined __hppa__ +SO_ATTACH_REUSEPORT_CBPF 16428 +#else +SO_ATTACH_REUSEPORT_CBPF 51 +#endif + +#if defined __sparc__ +SO_ATTACH_REUSEPORT_EBPF 54 +#elif defined __hppa__ +SO_ATTACH_REUSEPORT_EBPF 16429 +#else +SO_ATTACH_REUSEPORT_EBPF 52 +#endif + +#if defined __sparc__ +SO_CNX_ADVICE 55 +#elif defined __hppa__ +SO_CNX_ADVICE 16430 +#else +SO_CNX_ADVICE 53 +#endif + +#if defined __sparc__ +SO_MEMINFO 57 +#elif defined __hppa__ +SO_MEMINFO 16432 +#else +SO_MEMINFO 55 +#endif + +#if defined __sparc__ +SO_INCOMING_NAPI_ID 58 +#elif defined __hppa__ +SO_INCOMING_NAPI_ID 16433 +#else +SO_INCOMING_NAPI_ID 56 +#endif + +#if defined __sparc__ +SO_COOKIE 59 +#elif defined __hppa__ +SO_COOKIE 16434 +#else +SO_COOKIE 57 +#endif + +#if defined __sparc__ +SO_PEERGROUPS 61 +#elif defined __hppa__ +SO_PEERGROUPS 16436 +#else +SO_PEERGROUPS 59 +#endif + +#if defined __sparc__ +SO_ZEROCOPY 62 +#elif defined __hppa__ +SO_ZEROCOPY 16437 +#else +SO_ZEROCOPY 60 +#endif + +#if defined __sparc__ +SO_TXTIME 63 +#elif defined __hppa__ +SO_TXTIME 16438 +#else +SO_TXTIME 61 +#endif + +#if defined __sparc__ +SO_TIMESTAMP_NEW 70 +#elif defined __hppa__ +SO_TIMESTAMP_NEW 16440 +#else +SO_TIMESTAMP_NEW 63 +#endif +#if defined __sparc__ +SO_TIMESTAMPNS_NEW 66 +#elif defined __hppa__ +SO_TIMESTAMPNS_NEW 16441 +#else +SO_TIMESTAMPNS_NEW 64 +#endif +#if defined __sparc__ +SO_TIMESTAMPING_NEW 67 +#elif defined __hppa__ +SO_TIMESTAMPING_NEW 16442 +#else +SO_TIMESTAMPING_NEW 65 +#endif diff --git a/xlat/sock_packet_options.h b/xlat/sock_packet_options.h new file mode 100644 index 00000000..045fc591 --- /dev/null +++ b/xlat/sock_packet_options.h @@ -0,0 +1,85 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_packet_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_packet_options in mpers mode + +# else + +static +const struct xlat sock_packet_options[] = { +#if defined(PACKET_ADD_MEMBERSHIP) || (defined(HAVE_DECL_PACKET_ADD_MEMBERSHIP) && HAVE_DECL_PACKET_ADD_MEMBERSHIP) + XLAT(PACKET_ADD_MEMBERSHIP), +#endif +#if defined(PACKET_DROP_MEMBERSHIP) || (defined(HAVE_DECL_PACKET_DROP_MEMBERSHIP) && HAVE_DECL_PACKET_DROP_MEMBERSHIP) + XLAT(PACKET_DROP_MEMBERSHIP), +#endif +#if defined(PACKET_RECV_OUTPUT) || (defined(HAVE_DECL_PACKET_RECV_OUTPUT) && HAVE_DECL_PACKET_RECV_OUTPUT) + XLAT(PACKET_RECV_OUTPUT), +#endif +#if defined(PACKET_RX_RING) || (defined(HAVE_DECL_PACKET_RX_RING) && HAVE_DECL_PACKET_RX_RING) + XLAT(PACKET_RX_RING), +#endif +#if defined(PACKET_STATISTICS) || (defined(HAVE_DECL_PACKET_STATISTICS) && HAVE_DECL_PACKET_STATISTICS) + XLAT(PACKET_STATISTICS), +#endif +#if defined(PACKET_COPY_THRESH) || (defined(HAVE_DECL_PACKET_COPY_THRESH) && HAVE_DECL_PACKET_COPY_THRESH) + XLAT(PACKET_COPY_THRESH), +#endif +#if defined(PACKET_AUXDATA) || (defined(HAVE_DECL_PACKET_AUXDATA) && HAVE_DECL_PACKET_AUXDATA) + XLAT(PACKET_AUXDATA), +#endif +#if defined(PACKET_ORIGDEV) || (defined(HAVE_DECL_PACKET_ORIGDEV) && HAVE_DECL_PACKET_ORIGDEV) + XLAT(PACKET_ORIGDEV), +#endif +#if defined(PACKET_VERSION) || (defined(HAVE_DECL_PACKET_VERSION) && HAVE_DECL_PACKET_VERSION) + XLAT(PACKET_VERSION), +#endif +#if defined(PACKET_HDRLEN) || (defined(HAVE_DECL_PACKET_HDRLEN) && HAVE_DECL_PACKET_HDRLEN) + XLAT(PACKET_HDRLEN), +#endif +#if defined(PACKET_RESERVE) || (defined(HAVE_DECL_PACKET_RESERVE) && HAVE_DECL_PACKET_RESERVE) + XLAT(PACKET_RESERVE), +#endif +#if defined(PACKET_TX_RING) || (defined(HAVE_DECL_PACKET_TX_RING) && HAVE_DECL_PACKET_TX_RING) + XLAT(PACKET_TX_RING), +#endif +#if defined(PACKET_LOSS) || (defined(HAVE_DECL_PACKET_LOSS) && HAVE_DECL_PACKET_LOSS) + XLAT(PACKET_LOSS), +#endif +#if defined(PACKET_VNET_HDR) || (defined(HAVE_DECL_PACKET_VNET_HDR) && HAVE_DECL_PACKET_VNET_HDR) + XLAT(PACKET_VNET_HDR), +#endif +#if defined(PACKET_TX_TIMESTAMP) || (defined(HAVE_DECL_PACKET_TX_TIMESTAMP) && HAVE_DECL_PACKET_TX_TIMESTAMP) + XLAT(PACKET_TX_TIMESTAMP), +#endif +#if defined(PACKET_TIMESTAMP) || (defined(HAVE_DECL_PACKET_TIMESTAMP) && HAVE_DECL_PACKET_TIMESTAMP) + XLAT(PACKET_TIMESTAMP), +#endif +#if defined(PACKET_FANOUT) || (defined(HAVE_DECL_PACKET_FANOUT) && HAVE_DECL_PACKET_FANOUT) + XLAT(PACKET_FANOUT), +#endif +#if defined(PACKET_TX_HAS_OFF) || (defined(HAVE_DECL_PACKET_TX_HAS_OFF) && HAVE_DECL_PACKET_TX_HAS_OFF) + XLAT(PACKET_TX_HAS_OFF), +#endif +#if defined(PACKET_QDISC_BYPASS) || (defined(HAVE_DECL_PACKET_QDISC_BYPASS) && HAVE_DECL_PACKET_QDISC_BYPASS) + XLAT(PACKET_QDISC_BYPASS), +#endif +#if defined(PACKET_ROLLOVER_STATS) || (defined(HAVE_DECL_PACKET_ROLLOVER_STATS) && HAVE_DECL_PACKET_ROLLOVER_STATS) + XLAT(PACKET_ROLLOVER_STATS), +#endif +#if defined(PACKET_FANOUT_DATA) || (defined(HAVE_DECL_PACKET_FANOUT_DATA) && HAVE_DECL_PACKET_FANOUT_DATA) + XLAT(PACKET_FANOUT_DATA), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sockpacketoptions.in b/xlat/sock_packet_options.in similarity index 100% rename from xlat/sockpacketoptions.in rename to xlat/sock_packet_options.in diff --git a/xlat/sock_pnp_options.h b/xlat/sock_pnp_options.h new file mode 100644 index 00000000..d9083b32 --- /dev/null +++ b/xlat/sock_pnp_options.h @@ -0,0 +1,54 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_pnp_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PNPIPE_ENCAP) || (defined(HAVE_DECL_PNPIPE_ENCAP) && HAVE_DECL_PNPIPE_ENCAP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PNPIPE_ENCAP) == (1), "PNPIPE_ENCAP != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PNPIPE_ENCAP 1 +#endif +#if defined(PNPIPE_IFINDEX) || (defined(HAVE_DECL_PNPIPE_IFINDEX) && HAVE_DECL_PNPIPE_IFINDEX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PNPIPE_IFINDEX) == (2), "PNPIPE_IFINDEX != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PNPIPE_IFINDEX 2 +#endif +#if defined(PNPIPE_HANDLE) || (defined(HAVE_DECL_PNPIPE_HANDLE) && HAVE_DECL_PNPIPE_HANDLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PNPIPE_HANDLE) == (3), "PNPIPE_HANDLE != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PNPIPE_HANDLE 3 +#endif +#if defined(PNPIPE_INITSTATE) || (defined(HAVE_DECL_PNPIPE_INITSTATE) && HAVE_DECL_PNPIPE_INITSTATE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PNPIPE_INITSTATE) == (4), "PNPIPE_INITSTATE != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PNPIPE_INITSTATE 4 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_pnp_options in mpers mode + +# else + +static +const struct xlat sock_pnp_options[] = { + XLAT(PNPIPE_ENCAP), + XLAT(PNPIPE_IFINDEX), + XLAT(PNPIPE_HANDLE), + XLAT(PNPIPE_INITSTATE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_pnp_options.in b/xlat/sock_pnp_options.in new file mode 100644 index 00000000..a8d939c2 --- /dev/null +++ b/xlat/sock_pnp_options.in @@ -0,0 +1,4 @@ +PNPIPE_ENCAP 1 +PNPIPE_IFINDEX 2 +PNPIPE_HANDLE 3 +PNPIPE_INITSTATE 4 diff --git a/xlat/sock_pppol2tp_options.h b/xlat/sock_pppol2tp_options.h new file mode 100644 index 00000000..4f4064f9 --- /dev/null +++ b/xlat/sock_pppol2tp_options.h @@ -0,0 +1,62 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_pppol2tp_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(PPPOL2TP_SO_DEBUG) || (defined(HAVE_DECL_PPPOL2TP_SO_DEBUG) && HAVE_DECL_PPPOL2TP_SO_DEBUG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PPPOL2TP_SO_DEBUG) == (1), "PPPOL2TP_SO_DEBUG != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PPPOL2TP_SO_DEBUG 1 +#endif +#if defined(PPPOL2TP_SO_RECVSEQ) || (defined(HAVE_DECL_PPPOL2TP_SO_RECVSEQ) && HAVE_DECL_PPPOL2TP_SO_RECVSEQ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PPPOL2TP_SO_RECVSEQ) == (2), "PPPOL2TP_SO_RECVSEQ != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PPPOL2TP_SO_RECVSEQ 2 +#endif +#if defined(PPPOL2TP_SO_SENDSEQ) || (defined(HAVE_DECL_PPPOL2TP_SO_SENDSEQ) && HAVE_DECL_PPPOL2TP_SO_SENDSEQ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PPPOL2TP_SO_SENDSEQ) == (3), "PPPOL2TP_SO_SENDSEQ != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PPPOL2TP_SO_SENDSEQ 3 +#endif +#if defined(PPPOL2TP_SO_LNSMODE) || (defined(HAVE_DECL_PPPOL2TP_SO_LNSMODE) && HAVE_DECL_PPPOL2TP_SO_LNSMODE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PPPOL2TP_SO_LNSMODE) == (4), "PPPOL2TP_SO_LNSMODE != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PPPOL2TP_SO_LNSMODE 4 +#endif +#if defined(PPPOL2TP_SO_REORDERTO) || (defined(HAVE_DECL_PPPOL2TP_SO_REORDERTO) && HAVE_DECL_PPPOL2TP_SO_REORDERTO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((PPPOL2TP_SO_REORDERTO) == (5), "PPPOL2TP_SO_REORDERTO != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define PPPOL2TP_SO_REORDERTO 5 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_pppol2tp_options in mpers mode + +# else + +static +const struct xlat sock_pppol2tp_options[] = { + [PPPOL2TP_SO_DEBUG] = XLAT(PPPOL2TP_SO_DEBUG), + [PPPOL2TP_SO_RECVSEQ] = XLAT(PPPOL2TP_SO_RECVSEQ), + [PPPOL2TP_SO_SENDSEQ] = XLAT(PPPOL2TP_SO_SENDSEQ), + [PPPOL2TP_SO_LNSMODE] = XLAT(PPPOL2TP_SO_LNSMODE), + [PPPOL2TP_SO_REORDERTO] = XLAT(PPPOL2TP_SO_REORDERTO), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_pppol2tp_options.in b/xlat/sock_pppol2tp_options.in new file mode 100644 index 00000000..9c4177a0 --- /dev/null +++ b/xlat/sock_pppol2tp_options.in @@ -0,0 +1,6 @@ +#value_indexed +PPPOL2TP_SO_DEBUG 1 +PPPOL2TP_SO_RECVSEQ 2 +PPPOL2TP_SO_SENDSEQ 3 +PPPOL2TP_SO_LNSMODE 4 +PPPOL2TP_SO_REORDERTO 5 diff --git a/xlat/sock_raw_options.h b/xlat/sock_raw_options.h new file mode 100644 index 00000000..e69998c7 --- /dev/null +++ b/xlat/sock_raw_options.h @@ -0,0 +1,25 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_raw_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_raw_options in mpers mode + +# else + +static +const struct xlat sock_raw_options[] = { +#if defined(ICMP_FILTER) || (defined(HAVE_DECL_ICMP_FILTER) && HAVE_DECL_ICMP_FILTER) + XLAT(ICMP_FILTER), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sockrawoptions.in b/xlat/sock_raw_options.in similarity index 100% rename from xlat/sockrawoptions.in rename to xlat/sock_raw_options.in diff --git a/xlat/sock_rds_options.h b/xlat/sock_rds_options.h new file mode 100644 index 00000000..f76a56b2 --- /dev/null +++ b/xlat/sock_rds_options.h @@ -0,0 +1,209 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_rds_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(RDS_CANCEL_SENT_TO) || (defined(HAVE_DECL_RDS_CANCEL_SENT_TO) && HAVE_DECL_RDS_CANCEL_SENT_TO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RDS_CANCEL_SENT_TO) == (1), "RDS_CANCEL_SENT_TO != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RDS_CANCEL_SENT_TO 1 +#endif +#if defined(RDS_GET_MR) || (defined(HAVE_DECL_RDS_GET_MR) && HAVE_DECL_RDS_GET_MR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RDS_GET_MR) == (2), "RDS_GET_MR != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RDS_GET_MR 2 +#endif +#if defined(RDS_FREE_MR) || (defined(HAVE_DECL_RDS_FREE_MR) && HAVE_DECL_RDS_FREE_MR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RDS_FREE_MR) == (3), "RDS_FREE_MR != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RDS_FREE_MR 3 +#endif +#if defined(RDS_BARRIER) || (defined(HAVE_DECL_RDS_BARRIER) && HAVE_DECL_RDS_BARRIER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RDS_BARRIER) == (4), "RDS_BARRIER != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RDS_BARRIER 4 +#endif +#if defined(RDS_RECVERR) || (defined(HAVE_DECL_RDS_RECVERR) && HAVE_DECL_RDS_RECVERR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RDS_RECVERR) == (5), "RDS_RECVERR != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RDS_RECVERR 5 +#endif +#if defined(RDS_CONG_MONITOR) || (defined(HAVE_DECL_RDS_CONG_MONITOR) && HAVE_DECL_RDS_CONG_MONITOR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RDS_CONG_MONITOR) == (6), "RDS_CONG_MONITOR != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RDS_CONG_MONITOR 6 +#endif +#if defined(RDS_GET_MR_FOR_DEST) || (defined(HAVE_DECL_RDS_GET_MR_FOR_DEST) && HAVE_DECL_RDS_GET_MR_FOR_DEST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RDS_GET_MR_FOR_DEST) == (7), "RDS_GET_MR_FOR_DEST != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RDS_GET_MR_FOR_DEST 7 +#endif +#if defined(SO_RDS_TRANSPORT) || (defined(HAVE_DECL_SO_RDS_TRANSPORT) && HAVE_DECL_SO_RDS_TRANSPORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_RDS_TRANSPORT) == (8), "SO_RDS_TRANSPORT != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_RDS_TRANSPORT 8 +#endif +#if defined(SO_RDS_MSG_RXPATH_LATENCY) || (defined(HAVE_DECL_SO_RDS_MSG_RXPATH_LATENCY) && HAVE_DECL_SO_RDS_MSG_RXPATH_LATENCY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_RDS_MSG_RXPATH_LATENCY) == (10), "SO_RDS_MSG_RXPATH_LATENCY != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_RDS_MSG_RXPATH_LATENCY 10 +#endif +#ifndef __hppa__ +#if defined(SO_TIMESTAMP_OLD) || (defined(HAVE_DECL_SO_TIMESTAMP_OLD) && HAVE_DECL_SO_TIMESTAMP_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TIMESTAMP_OLD) == (29), "SO_TIMESTAMP_OLD != 29"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TIMESTAMP_OLD 29 +#endif +#endif +#if defined(RDS_INFO_COUNTERS) || (defined(HAVE_DECL_RDS_INFO_COUNTERS) && HAVE_DECL_RDS_INFO_COUNTERS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RDS_INFO_COUNTERS) == (10000), "RDS_INFO_COUNTERS != 10000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RDS_INFO_COUNTERS 10000 +#endif +#if defined(RDS_INFO_CONNECTIONS) || (defined(HAVE_DECL_RDS_INFO_CONNECTIONS) && HAVE_DECL_RDS_INFO_CONNECTIONS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RDS_INFO_CONNECTIONS) == (10001), "RDS_INFO_CONNECTIONS != 10001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RDS_INFO_CONNECTIONS 10001 +#endif +#if defined(RDS_INFO_FLOWS) || (defined(HAVE_DECL_RDS_INFO_FLOWS) && HAVE_DECL_RDS_INFO_FLOWS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RDS_INFO_FLOWS) == (10002), "RDS_INFO_FLOWS != 10002"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RDS_INFO_FLOWS 10002 +#endif +#if defined(RDS_INFO_SEND_MESSAGES) || (defined(HAVE_DECL_RDS_INFO_SEND_MESSAGES) && HAVE_DECL_RDS_INFO_SEND_MESSAGES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RDS_INFO_SEND_MESSAGES) == (10003), "RDS_INFO_SEND_MESSAGES != 10003"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RDS_INFO_SEND_MESSAGES 10003 +#endif +#if defined(RDS_INFO_RETRANS_MESSAGES) || (defined(HAVE_DECL_RDS_INFO_RETRANS_MESSAGES) && HAVE_DECL_RDS_INFO_RETRANS_MESSAGES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RDS_INFO_RETRANS_MESSAGES) == (10004), "RDS_INFO_RETRANS_MESSAGES != 10004"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RDS_INFO_RETRANS_MESSAGES 10004 +#endif +#if defined(RDS_INFO_RECV_MESSAGES) || (defined(HAVE_DECL_RDS_INFO_RECV_MESSAGES) && HAVE_DECL_RDS_INFO_RECV_MESSAGES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RDS_INFO_RECV_MESSAGES) == (10005), "RDS_INFO_RECV_MESSAGES != 10005"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RDS_INFO_RECV_MESSAGES 10005 +#endif +#if defined(RDS_INFO_SOCKETS) || (defined(HAVE_DECL_RDS_INFO_SOCKETS) && HAVE_DECL_RDS_INFO_SOCKETS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RDS_INFO_SOCKETS) == (10006), "RDS_INFO_SOCKETS != 10006"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RDS_INFO_SOCKETS 10006 +#endif +#if defined(RDS_INFO_TCP_SOCKETS) || (defined(HAVE_DECL_RDS_INFO_TCP_SOCKETS) && HAVE_DECL_RDS_INFO_TCP_SOCKETS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RDS_INFO_TCP_SOCKETS) == (10007), "RDS_INFO_TCP_SOCKETS != 10007"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RDS_INFO_TCP_SOCKETS 10007 +#endif +#if defined(RDS_INFO_IB_CONNECTIONS) || (defined(HAVE_DECL_RDS_INFO_IB_CONNECTIONS) && HAVE_DECL_RDS_INFO_IB_CONNECTIONS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RDS_INFO_IB_CONNECTIONS) == (10008), "RDS_INFO_IB_CONNECTIONS != 10008"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RDS_INFO_IB_CONNECTIONS 10008 +#endif +#if defined(RDS_INFO_CONNECTION_STATS) || (defined(HAVE_DECL_RDS_INFO_CONNECTION_STATS) && HAVE_DECL_RDS_INFO_CONNECTION_STATS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RDS_INFO_CONNECTION_STATS) == (10009), "RDS_INFO_CONNECTION_STATS != 10009"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RDS_INFO_CONNECTION_STATS 10009 +#endif +#if defined(RDS_INFO_IWARP_CONNECTIONS) || (defined(HAVE_DECL_RDS_INFO_IWARP_CONNECTIONS) && HAVE_DECL_RDS_INFO_IWARP_CONNECTIONS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RDS_INFO_IWARP_CONNECTIONS) == (10010), "RDS_INFO_IWARP_CONNECTIONS != 10010"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RDS_INFO_IWARP_CONNECTIONS 10010 +#endif +#ifdef __hppa__ +#if defined(SO_TIMESTAMP_OLD) || (defined(HAVE_DECL_SO_TIMESTAMP_OLD) && HAVE_DECL_SO_TIMESTAMP_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SO_TIMESTAMP_OLD) == (0x4012), "SO_TIMESTAMP_OLD != 0x4012"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SO_TIMESTAMP_OLD 0x4012 +#endif +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_rds_options in mpers mode + +# else + +static +const struct xlat sock_rds_options[] = { + XLAT(RDS_CANCEL_SENT_TO), + XLAT(RDS_GET_MR), + XLAT(RDS_FREE_MR), + XLAT(RDS_BARRIER), + XLAT(RDS_RECVERR), + XLAT(RDS_CONG_MONITOR), + XLAT(RDS_GET_MR_FOR_DEST), + XLAT(SO_RDS_TRANSPORT), + XLAT(SO_RDS_MSG_RXPATH_LATENCY), + +#ifndef __hppa__ + XLAT(SO_TIMESTAMP_OLD), +#endif + + XLAT(RDS_INFO_COUNTERS), + XLAT(RDS_INFO_CONNECTIONS), + XLAT(RDS_INFO_FLOWS), + XLAT(RDS_INFO_SEND_MESSAGES), + XLAT(RDS_INFO_RETRANS_MESSAGES), + XLAT(RDS_INFO_RECV_MESSAGES), + XLAT(RDS_INFO_SOCKETS), + XLAT(RDS_INFO_TCP_SOCKETS), + XLAT(RDS_INFO_IB_CONNECTIONS), + XLAT(RDS_INFO_CONNECTION_STATS), + XLAT(RDS_INFO_IWARP_CONNECTIONS), + +#ifdef __hppa__ + XLAT(SO_TIMESTAMP_OLD), +#endif + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_rds_options.in b/xlat/sock_rds_options.in new file mode 100644 index 00000000..041261c2 --- /dev/null +++ b/xlat/sock_rds_options.in @@ -0,0 +1,29 @@ +RDS_CANCEL_SENT_TO 1 +RDS_GET_MR 2 +RDS_FREE_MR 3 +RDS_BARRIER 4 +RDS_RECVERR 5 +RDS_CONG_MONITOR 6 +RDS_GET_MR_FOR_DEST 7 +SO_RDS_TRANSPORT 8 +SO_RDS_MSG_RXPATH_LATENCY 10 + +#ifndef __hppa__ +SO_TIMESTAMP_OLD 29 +#endif + +RDS_INFO_COUNTERS 10000 +RDS_INFO_CONNECTIONS 10001 +RDS_INFO_FLOWS 10002 +RDS_INFO_SEND_MESSAGES 10003 +RDS_INFO_RETRANS_MESSAGES 10004 +RDS_INFO_RECV_MESSAGES 10005 +RDS_INFO_SOCKETS 10006 +RDS_INFO_TCP_SOCKETS 10007 +RDS_INFO_IB_CONNECTIONS 10008 +RDS_INFO_CONNECTION_STATS 10009 +RDS_INFO_IWARP_CONNECTIONS 10010 + +#ifdef __hppa__ +SO_TIMESTAMP_OLD 0x4012 +#endif diff --git a/xlat/sock_rxrpc_options.h b/xlat/sock_rxrpc_options.h new file mode 100644 index 00000000..a7ab59ac --- /dev/null +++ b/xlat/sock_rxrpc_options.h @@ -0,0 +1,70 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_rxrpc_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(RXRPC_SECURITY_KEY) || (defined(HAVE_DECL_RXRPC_SECURITY_KEY) && HAVE_DECL_RXRPC_SECURITY_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RXRPC_SECURITY_KEY) == (1), "RXRPC_SECURITY_KEY != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RXRPC_SECURITY_KEY 1 +#endif +#if defined(RXRPC_SECURITY_KEYRING) || (defined(HAVE_DECL_RXRPC_SECURITY_KEYRING) && HAVE_DECL_RXRPC_SECURITY_KEYRING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RXRPC_SECURITY_KEYRING) == (2), "RXRPC_SECURITY_KEYRING != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RXRPC_SECURITY_KEYRING 2 +#endif +#if defined(RXRPC_EXCLUSIVE_CONNECTION) || (defined(HAVE_DECL_RXRPC_EXCLUSIVE_CONNECTION) && HAVE_DECL_RXRPC_EXCLUSIVE_CONNECTION) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RXRPC_EXCLUSIVE_CONNECTION) == (3), "RXRPC_EXCLUSIVE_CONNECTION != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RXRPC_EXCLUSIVE_CONNECTION 3 +#endif +#if defined(RXRPC_MIN_SECURITY_LEVEL) || (defined(HAVE_DECL_RXRPC_MIN_SECURITY_LEVEL) && HAVE_DECL_RXRPC_MIN_SECURITY_LEVEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RXRPC_MIN_SECURITY_LEVEL) == (4), "RXRPC_MIN_SECURITY_LEVEL != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RXRPC_MIN_SECURITY_LEVEL 4 +#endif +#if defined(RXRPC_UPGRADEABLE_SERVICE) || (defined(HAVE_DECL_RXRPC_UPGRADEABLE_SERVICE) && HAVE_DECL_RXRPC_UPGRADEABLE_SERVICE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RXRPC_UPGRADEABLE_SERVICE) == (5), "RXRPC_UPGRADEABLE_SERVICE != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RXRPC_UPGRADEABLE_SERVICE 5 +#endif +#if defined(RXRPC_SUPPORTED_CMSG) || (defined(HAVE_DECL_RXRPC_SUPPORTED_CMSG) && HAVE_DECL_RXRPC_SUPPORTED_CMSG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RXRPC_SUPPORTED_CMSG) == (6), "RXRPC_SUPPORTED_CMSG != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RXRPC_SUPPORTED_CMSG 6 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_rxrpc_options in mpers mode + +# else + +static +const struct xlat sock_rxrpc_options[] = { + [RXRPC_SECURITY_KEY] = XLAT(RXRPC_SECURITY_KEY), + [RXRPC_SECURITY_KEYRING] = XLAT(RXRPC_SECURITY_KEYRING), + [RXRPC_EXCLUSIVE_CONNECTION] = XLAT(RXRPC_EXCLUSIVE_CONNECTION), + [RXRPC_MIN_SECURITY_LEVEL] = XLAT(RXRPC_MIN_SECURITY_LEVEL), + [RXRPC_UPGRADEABLE_SERVICE] = XLAT(RXRPC_UPGRADEABLE_SERVICE), + [RXRPC_SUPPORTED_CMSG] = XLAT(RXRPC_SUPPORTED_CMSG), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_rxrpc_options.in b/xlat/sock_rxrpc_options.in new file mode 100644 index 00000000..55408292 --- /dev/null +++ b/xlat/sock_rxrpc_options.in @@ -0,0 +1,7 @@ +#value_indexed +RXRPC_SECURITY_KEY 1 +RXRPC_SECURITY_KEYRING 2 +RXRPC_EXCLUSIVE_CONNECTION 3 +RXRPC_MIN_SECURITY_LEVEL 4 +RXRPC_UPGRADEABLE_SERVICE 5 +RXRPC_SUPPORTED_CMSG 6 diff --git a/xlat/sock_sctp_options.h b/xlat/sock_sctp_options.h new file mode 100644 index 00000000..766c2251 --- /dev/null +++ b/xlat/sock_sctp_options.h @@ -0,0 +1,543 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_sctp_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SCTP_RTOINFO) || (defined(HAVE_DECL_SCTP_RTOINFO) && HAVE_DECL_SCTP_RTOINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_RTOINFO) == (0), "SCTP_RTOINFO != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_RTOINFO 0 +#endif +#if defined(SCTP_ASSOCINFO) || (defined(HAVE_DECL_SCTP_ASSOCINFO) && HAVE_DECL_SCTP_ASSOCINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_ASSOCINFO) == (1), "SCTP_ASSOCINFO != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_ASSOCINFO 1 +#endif +#if defined(SCTP_INITMSG) || (defined(HAVE_DECL_SCTP_INITMSG) && HAVE_DECL_SCTP_INITMSG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_INITMSG) == (2), "SCTP_INITMSG != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_INITMSG 2 +#endif +#if defined(SCTP_NODELAY) || (defined(HAVE_DECL_SCTP_NODELAY) && HAVE_DECL_SCTP_NODELAY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_NODELAY) == (3), "SCTP_NODELAY != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_NODELAY 3 +#endif +#if defined(SCTP_AUTOCLOSE) || (defined(HAVE_DECL_SCTP_AUTOCLOSE) && HAVE_DECL_SCTP_AUTOCLOSE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_AUTOCLOSE) == (4), "SCTP_AUTOCLOSE != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_AUTOCLOSE 4 +#endif +#if defined(SCTP_SET_PEER_PRIMARY_ADDR) || (defined(HAVE_DECL_SCTP_SET_PEER_PRIMARY_ADDR) && HAVE_DECL_SCTP_SET_PEER_PRIMARY_ADDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_SET_PEER_PRIMARY_ADDR) == (5), "SCTP_SET_PEER_PRIMARY_ADDR != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_SET_PEER_PRIMARY_ADDR 5 +#endif +#if defined(SCTP_PRIMARY_ADDR) || (defined(HAVE_DECL_SCTP_PRIMARY_ADDR) && HAVE_DECL_SCTP_PRIMARY_ADDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_PRIMARY_ADDR) == (6), "SCTP_PRIMARY_ADDR != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_PRIMARY_ADDR 6 +#endif +#if defined(SCTP_ADAPTATION_LAYER) || (defined(HAVE_DECL_SCTP_ADAPTATION_LAYER) && HAVE_DECL_SCTP_ADAPTATION_LAYER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_ADAPTATION_LAYER) == (7), "SCTP_ADAPTATION_LAYER != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_ADAPTATION_LAYER 7 +#endif +#if defined(SCTP_DISABLE_FRAGMENTS) || (defined(HAVE_DECL_SCTP_DISABLE_FRAGMENTS) && HAVE_DECL_SCTP_DISABLE_FRAGMENTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_DISABLE_FRAGMENTS) == (8), "SCTP_DISABLE_FRAGMENTS != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_DISABLE_FRAGMENTS 8 +#endif +#if defined(SCTP_PEER_ADDR_PARAMS) || (defined(HAVE_DECL_SCTP_PEER_ADDR_PARAMS) && HAVE_DECL_SCTP_PEER_ADDR_PARAMS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_PEER_ADDR_PARAMS) == (9), "SCTP_PEER_ADDR_PARAMS != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_PEER_ADDR_PARAMS 9 +#endif +#if defined(SCTP_DEFAULT_SEND_PARAM) || (defined(HAVE_DECL_SCTP_DEFAULT_SEND_PARAM) && HAVE_DECL_SCTP_DEFAULT_SEND_PARAM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_DEFAULT_SEND_PARAM) == (10), "SCTP_DEFAULT_SEND_PARAM != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_DEFAULT_SEND_PARAM 10 +#endif +#if defined(SCTP_EVENTS) || (defined(HAVE_DECL_SCTP_EVENTS) && HAVE_DECL_SCTP_EVENTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_EVENTS) == (11), "SCTP_EVENTS != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_EVENTS 11 +#endif +#if defined(SCTP_I_WANT_MAPPED_V4_ADDR) || (defined(HAVE_DECL_SCTP_I_WANT_MAPPED_V4_ADDR) && HAVE_DECL_SCTP_I_WANT_MAPPED_V4_ADDR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_I_WANT_MAPPED_V4_ADDR) == (12), "SCTP_I_WANT_MAPPED_V4_ADDR != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_I_WANT_MAPPED_V4_ADDR 12 +#endif +#if defined(SCTP_MAXSEG) || (defined(HAVE_DECL_SCTP_MAXSEG) && HAVE_DECL_SCTP_MAXSEG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_MAXSEG) == (13), "SCTP_MAXSEG != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_MAXSEG 13 +#endif +#if defined(SCTP_STATUS) || (defined(HAVE_DECL_SCTP_STATUS) && HAVE_DECL_SCTP_STATUS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_STATUS) == (14), "SCTP_STATUS != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_STATUS 14 +#endif +#if defined(SCTP_GET_PEER_ADDR_INFO) || (defined(HAVE_DECL_SCTP_GET_PEER_ADDR_INFO) && HAVE_DECL_SCTP_GET_PEER_ADDR_INFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_GET_PEER_ADDR_INFO) == (15), "SCTP_GET_PEER_ADDR_INFO != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_GET_PEER_ADDR_INFO 15 +#endif +#if defined(SCTP_DELAYED_SACK) || (defined(HAVE_DECL_SCTP_DELAYED_SACK) && HAVE_DECL_SCTP_DELAYED_SACK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_DELAYED_SACK) == (16), "SCTP_DELAYED_SACK != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_DELAYED_SACK 16 +#endif +#if defined(SCTP_CONTEXT) || (defined(HAVE_DECL_SCTP_CONTEXT) && HAVE_DECL_SCTP_CONTEXT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_CONTEXT) == (17), "SCTP_CONTEXT != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_CONTEXT 17 +#endif +#if defined(SCTP_FRAGMENT_INTERLEAVE) || (defined(HAVE_DECL_SCTP_FRAGMENT_INTERLEAVE) && HAVE_DECL_SCTP_FRAGMENT_INTERLEAVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_FRAGMENT_INTERLEAVE) == (18), "SCTP_FRAGMENT_INTERLEAVE != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_FRAGMENT_INTERLEAVE 18 +#endif +#if defined(SCTP_PARTIAL_DELIVERY_POINT) || (defined(HAVE_DECL_SCTP_PARTIAL_DELIVERY_POINT) && HAVE_DECL_SCTP_PARTIAL_DELIVERY_POINT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_PARTIAL_DELIVERY_POINT) == (19), "SCTP_PARTIAL_DELIVERY_POINT != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_PARTIAL_DELIVERY_POINT 19 +#endif +#if defined(SCTP_MAX_BURST) || (defined(HAVE_DECL_SCTP_MAX_BURST) && HAVE_DECL_SCTP_MAX_BURST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_MAX_BURST) == (20), "SCTP_MAX_BURST != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_MAX_BURST 20 +#endif +#if defined(SCTP_AUTH_CHUNK) || (defined(HAVE_DECL_SCTP_AUTH_CHUNK) && HAVE_DECL_SCTP_AUTH_CHUNK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_AUTH_CHUNK) == (21), "SCTP_AUTH_CHUNK != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_AUTH_CHUNK 21 +#endif +#if defined(SCTP_HMAC_IDENT) || (defined(HAVE_DECL_SCTP_HMAC_IDENT) && HAVE_DECL_SCTP_HMAC_IDENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_HMAC_IDENT) == (22), "SCTP_HMAC_IDENT != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_HMAC_IDENT 22 +#endif +#if defined(SCTP_AUTH_KEY) || (defined(HAVE_DECL_SCTP_AUTH_KEY) && HAVE_DECL_SCTP_AUTH_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_AUTH_KEY) == (23), "SCTP_AUTH_KEY != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_AUTH_KEY 23 +#endif +#if defined(SCTP_AUTH_ACTIVE_KEY) || (defined(HAVE_DECL_SCTP_AUTH_ACTIVE_KEY) && HAVE_DECL_SCTP_AUTH_ACTIVE_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_AUTH_ACTIVE_KEY) == (24), "SCTP_AUTH_ACTIVE_KEY != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_AUTH_ACTIVE_KEY 24 +#endif +#if defined(SCTP_AUTH_DELETE_KEY) || (defined(HAVE_DECL_SCTP_AUTH_DELETE_KEY) && HAVE_DECL_SCTP_AUTH_DELETE_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_AUTH_DELETE_KEY) == (25), "SCTP_AUTH_DELETE_KEY != 25"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_AUTH_DELETE_KEY 25 +#endif +#if defined(SCTP_PEER_AUTH_CHUNKS) || (defined(HAVE_DECL_SCTP_PEER_AUTH_CHUNKS) && HAVE_DECL_SCTP_PEER_AUTH_CHUNKS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_PEER_AUTH_CHUNKS) == (26), "SCTP_PEER_AUTH_CHUNKS != 26"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_PEER_AUTH_CHUNKS 26 +#endif +#if defined(SCTP_LOCAL_AUTH_CHUNKS) || (defined(HAVE_DECL_SCTP_LOCAL_AUTH_CHUNKS) && HAVE_DECL_SCTP_LOCAL_AUTH_CHUNKS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_LOCAL_AUTH_CHUNKS) == (27), "SCTP_LOCAL_AUTH_CHUNKS != 27"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_LOCAL_AUTH_CHUNKS 27 +#endif +#if defined(SCTP_GET_ASSOC_NUMBER) || (defined(HAVE_DECL_SCTP_GET_ASSOC_NUMBER) && HAVE_DECL_SCTP_GET_ASSOC_NUMBER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_GET_ASSOC_NUMBER) == (28), "SCTP_GET_ASSOC_NUMBER != 28"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_GET_ASSOC_NUMBER 28 +#endif +#if defined(SCTP_GET_ASSOC_ID_LIST) || (defined(HAVE_DECL_SCTP_GET_ASSOC_ID_LIST) && HAVE_DECL_SCTP_GET_ASSOC_ID_LIST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_GET_ASSOC_ID_LIST) == (29), "SCTP_GET_ASSOC_ID_LIST != 29"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_GET_ASSOC_ID_LIST 29 +#endif +#if defined(SCTP_AUTO_ASCONF) || (defined(HAVE_DECL_SCTP_AUTO_ASCONF) && HAVE_DECL_SCTP_AUTO_ASCONF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_AUTO_ASCONF) == (30), "SCTP_AUTO_ASCONF != 30"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_AUTO_ASCONF 30 +#endif +#if defined(SCTP_PEER_ADDR_THLDS) || (defined(HAVE_DECL_SCTP_PEER_ADDR_THLDS) && HAVE_DECL_SCTP_PEER_ADDR_THLDS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_PEER_ADDR_THLDS) == (31), "SCTP_PEER_ADDR_THLDS != 31"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_PEER_ADDR_THLDS 31 +#endif +#if defined(SCTP_RECVRCVINFO) || (defined(HAVE_DECL_SCTP_RECVRCVINFO) && HAVE_DECL_SCTP_RECVRCVINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_RECVRCVINFO) == (32), "SCTP_RECVRCVINFO != 32"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_RECVRCVINFO 32 +#endif +#if defined(SCTP_RECVNXTINFO) || (defined(HAVE_DECL_SCTP_RECVNXTINFO) && HAVE_DECL_SCTP_RECVNXTINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_RECVNXTINFO) == (33), "SCTP_RECVNXTINFO != 33"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_RECVNXTINFO 33 +#endif +#if defined(SCTP_DEFAULT_SNDINFO) || (defined(HAVE_DECL_SCTP_DEFAULT_SNDINFO) && HAVE_DECL_SCTP_DEFAULT_SNDINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_DEFAULT_SNDINFO) == (34), "SCTP_DEFAULT_SNDINFO != 34"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_DEFAULT_SNDINFO 34 +#endif +#if defined(SCTP_AUTH_DEACTIVATE_KEY) || (defined(HAVE_DECL_SCTP_AUTH_DEACTIVATE_KEY) && HAVE_DECL_SCTP_AUTH_DEACTIVATE_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_AUTH_DEACTIVATE_KEY) == (35), "SCTP_AUTH_DEACTIVATE_KEY != 35"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_AUTH_DEACTIVATE_KEY 35 +#endif +#if defined(SCTP_REUSE_PORT) || (defined(HAVE_DECL_SCTP_REUSE_PORT) && HAVE_DECL_SCTP_REUSE_PORT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_REUSE_PORT) == (36), "SCTP_REUSE_PORT != 36"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_REUSE_PORT 36 +#endif +#if defined(SCTP_SOCKOPT_BINDX_ADD) || (defined(HAVE_DECL_SCTP_SOCKOPT_BINDX_ADD) && HAVE_DECL_SCTP_SOCKOPT_BINDX_ADD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_SOCKOPT_BINDX_ADD) == (100), "SCTP_SOCKOPT_BINDX_ADD != 100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_SOCKOPT_BINDX_ADD 100 +#endif +#if defined(SCTP_SOCKOPT_BINDX_REM) || (defined(HAVE_DECL_SCTP_SOCKOPT_BINDX_REM) && HAVE_DECL_SCTP_SOCKOPT_BINDX_REM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_SOCKOPT_BINDX_REM) == (101), "SCTP_SOCKOPT_BINDX_REM != 101"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_SOCKOPT_BINDX_REM 101 +#endif +#if defined(SCTP_SOCKOPT_PEELOFF) || (defined(HAVE_DECL_SCTP_SOCKOPT_PEELOFF) && HAVE_DECL_SCTP_SOCKOPT_PEELOFF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_SOCKOPT_PEELOFF) == (102), "SCTP_SOCKOPT_PEELOFF != 102"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_SOCKOPT_PEELOFF 102 +#endif +#if defined(SCTP_GET_PEER_ADDRS_NUM_OLD) || (defined(HAVE_DECL_SCTP_GET_PEER_ADDRS_NUM_OLD) && HAVE_DECL_SCTP_GET_PEER_ADDRS_NUM_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_GET_PEER_ADDRS_NUM_OLD) == (103), "SCTP_GET_PEER_ADDRS_NUM_OLD != 103"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_GET_PEER_ADDRS_NUM_OLD 103 +#endif +#if defined(SCTP_GET_PEER_ADDRS_OLD) || (defined(HAVE_DECL_SCTP_GET_PEER_ADDRS_OLD) && HAVE_DECL_SCTP_GET_PEER_ADDRS_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_GET_PEER_ADDRS_OLD) == (104), "SCTP_GET_PEER_ADDRS_OLD != 104"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_GET_PEER_ADDRS_OLD 104 +#endif +#if defined(SCTP_GET_LOCAL_ADDRS_NUM_OLD) || (defined(HAVE_DECL_SCTP_GET_LOCAL_ADDRS_NUM_OLD) && HAVE_DECL_SCTP_GET_LOCAL_ADDRS_NUM_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_GET_LOCAL_ADDRS_NUM_OLD) == (105), "SCTP_GET_LOCAL_ADDRS_NUM_OLD != 105"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_GET_LOCAL_ADDRS_NUM_OLD 105 +#endif +#if defined(SCTP_GET_LOCAL_ADDRS_OLD) || (defined(HAVE_DECL_SCTP_GET_LOCAL_ADDRS_OLD) && HAVE_DECL_SCTP_GET_LOCAL_ADDRS_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_GET_LOCAL_ADDRS_OLD) == (106), "SCTP_GET_LOCAL_ADDRS_OLD != 106"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_GET_LOCAL_ADDRS_OLD 106 +#endif +#if defined(SCTP_SOCKOPT_CONNECTX_OLD) || (defined(HAVE_DECL_SCTP_SOCKOPT_CONNECTX_OLD) && HAVE_DECL_SCTP_SOCKOPT_CONNECTX_OLD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_SOCKOPT_CONNECTX_OLD) == (107), "SCTP_SOCKOPT_CONNECTX_OLD != 107"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_SOCKOPT_CONNECTX_OLD 107 +#endif +#if defined(SCTP_GET_PEER_ADDRS) || (defined(HAVE_DECL_SCTP_GET_PEER_ADDRS) && HAVE_DECL_SCTP_GET_PEER_ADDRS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_GET_PEER_ADDRS) == (108), "SCTP_GET_PEER_ADDRS != 108"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_GET_PEER_ADDRS 108 +#endif +#if defined(SCTP_GET_LOCAL_ADDRS) || (defined(HAVE_DECL_SCTP_GET_LOCAL_ADDRS) && HAVE_DECL_SCTP_GET_LOCAL_ADDRS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_GET_LOCAL_ADDRS) == (109), "SCTP_GET_LOCAL_ADDRS != 109"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_GET_LOCAL_ADDRS 109 +#endif +#if defined(SCTP_SOCKOPT_CONNECTX) || (defined(HAVE_DECL_SCTP_SOCKOPT_CONNECTX) && HAVE_DECL_SCTP_SOCKOPT_CONNECTX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_SOCKOPT_CONNECTX) == (110), "SCTP_SOCKOPT_CONNECTX != 110"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_SOCKOPT_CONNECTX 110 +#endif +#if defined(SCTP_SOCKOPT_CONNECTX3) || (defined(HAVE_DECL_SCTP_SOCKOPT_CONNECTX3) && HAVE_DECL_SCTP_SOCKOPT_CONNECTX3) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_SOCKOPT_CONNECTX3) == (111), "SCTP_SOCKOPT_CONNECTX3 != 111"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_SOCKOPT_CONNECTX3 111 +#endif +#if defined(SCTP_GET_ASSOC_STATS) || (defined(HAVE_DECL_SCTP_GET_ASSOC_STATS) && HAVE_DECL_SCTP_GET_ASSOC_STATS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_GET_ASSOC_STATS) == (112), "SCTP_GET_ASSOC_STATS != 112"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_GET_ASSOC_STATS 112 +#endif +#if defined(SCTP_PR_SUPPORTED) || (defined(HAVE_DECL_SCTP_PR_SUPPORTED) && HAVE_DECL_SCTP_PR_SUPPORTED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_PR_SUPPORTED) == (113), "SCTP_PR_SUPPORTED != 113"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_PR_SUPPORTED 113 +#endif +#if defined(SCTP_DEFAULT_PRINFO) || (defined(HAVE_DECL_SCTP_DEFAULT_PRINFO) && HAVE_DECL_SCTP_DEFAULT_PRINFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_DEFAULT_PRINFO) == (114), "SCTP_DEFAULT_PRINFO != 114"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_DEFAULT_PRINFO 114 +#endif +#if defined(SCTP_PR_ASSOC_STATUS) || (defined(HAVE_DECL_SCTP_PR_ASSOC_STATUS) && HAVE_DECL_SCTP_PR_ASSOC_STATUS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_PR_ASSOC_STATUS) == (115), "SCTP_PR_ASSOC_STATUS != 115"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_PR_ASSOC_STATUS 115 +#endif +#if defined(SCTP_PR_STREAM_STATUS) || (defined(HAVE_DECL_SCTP_PR_STREAM_STATUS) && HAVE_DECL_SCTP_PR_STREAM_STATUS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_PR_STREAM_STATUS) == (116), "SCTP_PR_STREAM_STATUS != 116"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_PR_STREAM_STATUS 116 +#endif +#if defined(SCTP_RECONFIG_SUPPORTED) || (defined(HAVE_DECL_SCTP_RECONFIG_SUPPORTED) && HAVE_DECL_SCTP_RECONFIG_SUPPORTED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_RECONFIG_SUPPORTED) == (117), "SCTP_RECONFIG_SUPPORTED != 117"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_RECONFIG_SUPPORTED 117 +#endif +#if defined(SCTP_ENABLE_STREAM_RESET) || (defined(HAVE_DECL_SCTP_ENABLE_STREAM_RESET) && HAVE_DECL_SCTP_ENABLE_STREAM_RESET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_ENABLE_STREAM_RESET) == (118), "SCTP_ENABLE_STREAM_RESET != 118"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_ENABLE_STREAM_RESET 118 +#endif +#if defined(SCTP_RESET_STREAMS) || (defined(HAVE_DECL_SCTP_RESET_STREAMS) && HAVE_DECL_SCTP_RESET_STREAMS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_RESET_STREAMS) == (119), "SCTP_RESET_STREAMS != 119"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_RESET_STREAMS 119 +#endif +#if defined(SCTP_RESET_ASSOC) || (defined(HAVE_DECL_SCTP_RESET_ASSOC) && HAVE_DECL_SCTP_RESET_ASSOC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_RESET_ASSOC) == (120), "SCTP_RESET_ASSOC != 120"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_RESET_ASSOC 120 +#endif +#if defined(SCTP_ADD_STREAMS) || (defined(HAVE_DECL_SCTP_ADD_STREAMS) && HAVE_DECL_SCTP_ADD_STREAMS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_ADD_STREAMS) == (121), "SCTP_ADD_STREAMS != 121"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_ADD_STREAMS 121 +#endif +#if defined(SCTP_SOCKOPT_PEELOFF_FLAGS) || (defined(HAVE_DECL_SCTP_SOCKOPT_PEELOFF_FLAGS) && HAVE_DECL_SCTP_SOCKOPT_PEELOFF_FLAGS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_SOCKOPT_PEELOFF_FLAGS) == (122), "SCTP_SOCKOPT_PEELOFF_FLAGS != 122"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_SOCKOPT_PEELOFF_FLAGS 122 +#endif +#if defined(SCTP_STREAM_SCHEDULER) || (defined(HAVE_DECL_SCTP_STREAM_SCHEDULER) && HAVE_DECL_SCTP_STREAM_SCHEDULER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_STREAM_SCHEDULER) == (123), "SCTP_STREAM_SCHEDULER != 123"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_STREAM_SCHEDULER 123 +#endif +#if defined(SCTP_STREAM_SCHEDULER_VALUE) || (defined(HAVE_DECL_SCTP_STREAM_SCHEDULER_VALUE) && HAVE_DECL_SCTP_STREAM_SCHEDULER_VALUE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_STREAM_SCHEDULER_VALUE) == (124), "SCTP_STREAM_SCHEDULER_VALUE != 124"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_STREAM_SCHEDULER_VALUE 124 +#endif +#if defined(SCTP_INTERLEAVING_SUPPORTED) || (defined(HAVE_DECL_SCTP_INTERLEAVING_SUPPORTED) && HAVE_DECL_SCTP_INTERLEAVING_SUPPORTED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_INTERLEAVING_SUPPORTED) == (125), "SCTP_INTERLEAVING_SUPPORTED != 125"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_INTERLEAVING_SUPPORTED 125 +#endif +#if defined(SCTP_SENDMSG_CONNECT) || (defined(HAVE_DECL_SCTP_SENDMSG_CONNECT) && HAVE_DECL_SCTP_SENDMSG_CONNECT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_SENDMSG_CONNECT) == (126), "SCTP_SENDMSG_CONNECT != 126"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_SENDMSG_CONNECT 126 +#endif +#if defined(SCTP_EVENT) || (defined(HAVE_DECL_SCTP_EVENT) && HAVE_DECL_SCTP_EVENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SCTP_EVENT) == (127), "SCTP_EVENT != 127"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SCTP_EVENT 127 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_sctp_options in mpers mode + +# else + +static +const struct xlat sock_sctp_options[] = { + XLAT(SCTP_RTOINFO), + XLAT(SCTP_ASSOCINFO), + XLAT(SCTP_INITMSG), + XLAT(SCTP_NODELAY), + XLAT(SCTP_AUTOCLOSE), + XLAT(SCTP_SET_PEER_PRIMARY_ADDR), + XLAT(SCTP_PRIMARY_ADDR), + XLAT(SCTP_ADAPTATION_LAYER), + XLAT(SCTP_DISABLE_FRAGMENTS), + XLAT(SCTP_PEER_ADDR_PARAMS), + XLAT(SCTP_DEFAULT_SEND_PARAM), + XLAT(SCTP_EVENTS), + XLAT(SCTP_I_WANT_MAPPED_V4_ADDR), + XLAT(SCTP_MAXSEG), + XLAT(SCTP_STATUS), + XLAT(SCTP_GET_PEER_ADDR_INFO), + XLAT(SCTP_DELAYED_SACK), + XLAT(SCTP_CONTEXT), + XLAT(SCTP_FRAGMENT_INTERLEAVE), + XLAT(SCTP_PARTIAL_DELIVERY_POINT), + XLAT(SCTP_MAX_BURST), + XLAT(SCTP_AUTH_CHUNK), + XLAT(SCTP_HMAC_IDENT), + XLAT(SCTP_AUTH_KEY), + XLAT(SCTP_AUTH_ACTIVE_KEY), + XLAT(SCTP_AUTH_DELETE_KEY), + XLAT(SCTP_PEER_AUTH_CHUNKS), + XLAT(SCTP_LOCAL_AUTH_CHUNKS), + XLAT(SCTP_GET_ASSOC_NUMBER), + XLAT(SCTP_GET_ASSOC_ID_LIST), + XLAT(SCTP_AUTO_ASCONF), + XLAT(SCTP_PEER_ADDR_THLDS), + XLAT(SCTP_RECVRCVINFO), + XLAT(SCTP_RECVNXTINFO), + XLAT(SCTP_DEFAULT_SNDINFO), + XLAT(SCTP_AUTH_DEACTIVATE_KEY), + XLAT(SCTP_REUSE_PORT), + + XLAT(SCTP_SOCKOPT_BINDX_ADD), + XLAT(SCTP_SOCKOPT_BINDX_REM), + XLAT(SCTP_SOCKOPT_PEELOFF), + XLAT(SCTP_GET_PEER_ADDRS_NUM_OLD), + XLAT(SCTP_GET_PEER_ADDRS_OLD), + XLAT(SCTP_GET_LOCAL_ADDRS_NUM_OLD), + XLAT(SCTP_GET_LOCAL_ADDRS_OLD), + XLAT(SCTP_SOCKOPT_CONNECTX_OLD), + XLAT(SCTP_GET_PEER_ADDRS), + XLAT(SCTP_GET_LOCAL_ADDRS), + XLAT(SCTP_SOCKOPT_CONNECTX), + XLAT(SCTP_SOCKOPT_CONNECTX3), + XLAT(SCTP_GET_ASSOC_STATS), + XLAT(SCTP_PR_SUPPORTED), + XLAT(SCTP_DEFAULT_PRINFO), + XLAT(SCTP_PR_ASSOC_STATUS), + XLAT(SCTP_PR_STREAM_STATUS), + XLAT(SCTP_RECONFIG_SUPPORTED), + XLAT(SCTP_ENABLE_STREAM_RESET), + XLAT(SCTP_RESET_STREAMS), + XLAT(SCTP_RESET_ASSOC), + XLAT(SCTP_ADD_STREAMS), + XLAT(SCTP_SOCKOPT_PEELOFF_FLAGS), + XLAT(SCTP_STREAM_SCHEDULER), + XLAT(SCTP_STREAM_SCHEDULER_VALUE), + XLAT(SCTP_INTERLEAVING_SUPPORTED), + XLAT(SCTP_SENDMSG_CONNECT), + XLAT(SCTP_EVENT), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_sctp_options.in b/xlat/sock_sctp_options.in new file mode 100644 index 00000000..2227ef94 --- /dev/null +++ b/xlat/sock_sctp_options.in @@ -0,0 +1,66 @@ +SCTP_RTOINFO 0 +SCTP_ASSOCINFO 1 +SCTP_INITMSG 2 +SCTP_NODELAY 3 +SCTP_AUTOCLOSE 4 +SCTP_SET_PEER_PRIMARY_ADDR 5 +SCTP_PRIMARY_ADDR 6 +SCTP_ADAPTATION_LAYER 7 +SCTP_DISABLE_FRAGMENTS 8 +SCTP_PEER_ADDR_PARAMS 9 +SCTP_DEFAULT_SEND_PARAM 10 +SCTP_EVENTS 11 +SCTP_I_WANT_MAPPED_V4_ADDR 12 +SCTP_MAXSEG 13 +SCTP_STATUS 14 +SCTP_GET_PEER_ADDR_INFO 15 +SCTP_DELAYED_SACK 16 +SCTP_CONTEXT 17 +SCTP_FRAGMENT_INTERLEAVE 18 +SCTP_PARTIAL_DELIVERY_POINT 19 +SCTP_MAX_BURST 20 +SCTP_AUTH_CHUNK 21 +SCTP_HMAC_IDENT 22 +SCTP_AUTH_KEY 23 +SCTP_AUTH_ACTIVE_KEY 24 +SCTP_AUTH_DELETE_KEY 25 +SCTP_PEER_AUTH_CHUNKS 26 +SCTP_LOCAL_AUTH_CHUNKS 27 +SCTP_GET_ASSOC_NUMBER 28 +SCTP_GET_ASSOC_ID_LIST 29 +SCTP_AUTO_ASCONF 30 +SCTP_PEER_ADDR_THLDS 31 +SCTP_RECVRCVINFO 32 +SCTP_RECVNXTINFO 33 +SCTP_DEFAULT_SNDINFO 34 +SCTP_AUTH_DEACTIVATE_KEY 35 +SCTP_REUSE_PORT 36 +/* linux specific things */ +SCTP_SOCKOPT_BINDX_ADD 100 +SCTP_SOCKOPT_BINDX_REM 101 +SCTP_SOCKOPT_PEELOFF 102 +SCTP_GET_PEER_ADDRS_NUM_OLD 103 +SCTP_GET_PEER_ADDRS_OLD 104 +SCTP_GET_LOCAL_ADDRS_NUM_OLD 105 +SCTP_GET_LOCAL_ADDRS_OLD 106 +SCTP_SOCKOPT_CONNECTX_OLD 107 +SCTP_GET_PEER_ADDRS 108 +SCTP_GET_LOCAL_ADDRS 109 +SCTP_SOCKOPT_CONNECTX 110 +SCTP_SOCKOPT_CONNECTX3 111 +SCTP_GET_ASSOC_STATS 112 +SCTP_PR_SUPPORTED 113 +SCTP_DEFAULT_PRINFO 114 +SCTP_PR_ASSOC_STATUS 115 +SCTP_PR_STREAM_STATUS 116 +SCTP_RECONFIG_SUPPORTED 117 +SCTP_ENABLE_STREAM_RESET 118 +SCTP_RESET_STREAMS 119 +SCTP_RESET_ASSOC 120 +SCTP_ADD_STREAMS 121 +SCTP_SOCKOPT_PEELOFF_FLAGS 122 +SCTP_STREAM_SCHEDULER 123 +SCTP_STREAM_SCHEDULER_VALUE 124 +SCTP_INTERLEAVING_SUPPORTED 125 +SCTP_SENDMSG_CONNECT 126 +SCTP_EVENT 127 diff --git a/xlat/sock_shutdown_flags.h b/xlat/sock_shutdown_flags.h new file mode 100644 index 00000000..8f6caa29 --- /dev/null +++ b/xlat/sock_shutdown_flags.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_shutdown_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(RCV_SHUTDOWN) || (defined(HAVE_DECL_RCV_SHUTDOWN) && HAVE_DECL_RCV_SHUTDOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((RCV_SHUTDOWN) == (1), "RCV_SHUTDOWN != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define RCV_SHUTDOWN 1 +#endif +#if defined(SEND_SHUTDOWN) || (defined(HAVE_DECL_SEND_SHUTDOWN) && HAVE_DECL_SEND_SHUTDOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SEND_SHUTDOWN) == (2), "SEND_SHUTDOWN != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SEND_SHUTDOWN 2 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_shutdown_flags in mpers mode + +# else + +static +const struct xlat sock_shutdown_flags[] = { + XLAT(RCV_SHUTDOWN), + XLAT(SEND_SHUTDOWN), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_shutdown_flags.in b/xlat/sock_shutdown_flags.in new file mode 100644 index 00000000..ff7d4322 --- /dev/null +++ b/xlat/sock_shutdown_flags.in @@ -0,0 +1,2 @@ +RCV_SHUTDOWN 1 +SEND_SHUTDOWN 2 diff --git a/xlat/sock_tcp_options.h b/xlat/sock_tcp_options.h new file mode 100644 index 00000000..1778adcd --- /dev/null +++ b/xlat/sock_tcp_options.h @@ -0,0 +1,310 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_tcp_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(TCP_NODELAY) || (defined(HAVE_DECL_TCP_NODELAY) && HAVE_DECL_TCP_NODELAY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_NODELAY) == (1), "TCP_NODELAY != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_NODELAY 1 +#endif +#if defined(TCP_MAXSEG) || (defined(HAVE_DECL_TCP_MAXSEG) && HAVE_DECL_TCP_MAXSEG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_MAXSEG) == (2), "TCP_MAXSEG != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_MAXSEG 2 +#endif +#if defined(TCP_CORK) || (defined(HAVE_DECL_TCP_CORK) && HAVE_DECL_TCP_CORK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_CORK) == (3), "TCP_CORK != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_CORK 3 +#endif +#if defined(TCP_KEEPIDLE) || (defined(HAVE_DECL_TCP_KEEPIDLE) && HAVE_DECL_TCP_KEEPIDLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_KEEPIDLE) == (4), "TCP_KEEPIDLE != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_KEEPIDLE 4 +#endif +#if defined(TCP_KEEPINTVL) || (defined(HAVE_DECL_TCP_KEEPINTVL) && HAVE_DECL_TCP_KEEPINTVL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_KEEPINTVL) == (5), "TCP_KEEPINTVL != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_KEEPINTVL 5 +#endif +#if defined(TCP_KEEPCNT) || (defined(HAVE_DECL_TCP_KEEPCNT) && HAVE_DECL_TCP_KEEPCNT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_KEEPCNT) == (6), "TCP_KEEPCNT != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_KEEPCNT 6 +#endif +#if defined(TCP_SYNCNT) || (defined(HAVE_DECL_TCP_SYNCNT) && HAVE_DECL_TCP_SYNCNT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_SYNCNT) == (7), "TCP_SYNCNT != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_SYNCNT 7 +#endif +#if defined(TCP_LINGER2) || (defined(HAVE_DECL_TCP_LINGER2) && HAVE_DECL_TCP_LINGER2) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_LINGER2) == (8), "TCP_LINGER2 != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_LINGER2 8 +#endif +#if defined(TCP_DEFER_ACCEPT) || (defined(HAVE_DECL_TCP_DEFER_ACCEPT) && HAVE_DECL_TCP_DEFER_ACCEPT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_DEFER_ACCEPT) == (9), "TCP_DEFER_ACCEPT != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_DEFER_ACCEPT 9 +#endif +#if defined(TCP_WINDOW_CLAMP) || (defined(HAVE_DECL_TCP_WINDOW_CLAMP) && HAVE_DECL_TCP_WINDOW_CLAMP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_WINDOW_CLAMP) == (10), "TCP_WINDOW_CLAMP != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_WINDOW_CLAMP 10 +#endif +#if defined(TCP_INFO) || (defined(HAVE_DECL_TCP_INFO) && HAVE_DECL_TCP_INFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_INFO) == (11), "TCP_INFO != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_INFO 11 +#endif +#if defined(TCP_QUICKACK) || (defined(HAVE_DECL_TCP_QUICKACK) && HAVE_DECL_TCP_QUICKACK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_QUICKACK) == (12), "TCP_QUICKACK != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_QUICKACK 12 +#endif +#if defined(TCP_CONGESTION) || (defined(HAVE_DECL_TCP_CONGESTION) && HAVE_DECL_TCP_CONGESTION) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_CONGESTION) == (13), "TCP_CONGESTION != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_CONGESTION 13 +#endif +#if defined(TCP_MD5SIG) || (defined(HAVE_DECL_TCP_MD5SIG) && HAVE_DECL_TCP_MD5SIG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_MD5SIG) == (14), "TCP_MD5SIG != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_MD5SIG 14 +#endif +#if defined(TCP_COOKIE_TRANSACTIONS) || (defined(HAVE_DECL_TCP_COOKIE_TRANSACTIONS) && HAVE_DECL_TCP_COOKIE_TRANSACTIONS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_COOKIE_TRANSACTIONS) == (15), "TCP_COOKIE_TRANSACTIONS != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_COOKIE_TRANSACTIONS 15 +#endif +#if defined(TCP_THIN_LINEAR_TIMEOUTS) || (defined(HAVE_DECL_TCP_THIN_LINEAR_TIMEOUTS) && HAVE_DECL_TCP_THIN_LINEAR_TIMEOUTS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_THIN_LINEAR_TIMEOUTS) == (16), "TCP_THIN_LINEAR_TIMEOUTS != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_THIN_LINEAR_TIMEOUTS 16 +#endif +#if defined(TCP_THIN_DUPACK) || (defined(HAVE_DECL_TCP_THIN_DUPACK) && HAVE_DECL_TCP_THIN_DUPACK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_THIN_DUPACK) == (17), "TCP_THIN_DUPACK != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_THIN_DUPACK 17 +#endif +#if defined(TCP_USER_TIMEOUT) || (defined(HAVE_DECL_TCP_USER_TIMEOUT) && HAVE_DECL_TCP_USER_TIMEOUT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_USER_TIMEOUT) == (18), "TCP_USER_TIMEOUT != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_USER_TIMEOUT 18 +#endif +#if defined(TCP_REPAIR) || (defined(HAVE_DECL_TCP_REPAIR) && HAVE_DECL_TCP_REPAIR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_REPAIR) == (19), "TCP_REPAIR != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_REPAIR 19 +#endif +#if defined(TCP_REPAIR_QUEUE) || (defined(HAVE_DECL_TCP_REPAIR_QUEUE) && HAVE_DECL_TCP_REPAIR_QUEUE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_REPAIR_QUEUE) == (20), "TCP_REPAIR_QUEUE != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_REPAIR_QUEUE 20 +#endif +#if defined(TCP_QUEUE_SEQ) || (defined(HAVE_DECL_TCP_QUEUE_SEQ) && HAVE_DECL_TCP_QUEUE_SEQ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_QUEUE_SEQ) == (21), "TCP_QUEUE_SEQ != 21"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_QUEUE_SEQ 21 +#endif +#if defined(TCP_REPAIR_OPTIONS) || (defined(HAVE_DECL_TCP_REPAIR_OPTIONS) && HAVE_DECL_TCP_REPAIR_OPTIONS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_REPAIR_OPTIONS) == (22), "TCP_REPAIR_OPTIONS != 22"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_REPAIR_OPTIONS 22 +#endif +#if defined(TCP_FASTOPEN) || (defined(HAVE_DECL_TCP_FASTOPEN) && HAVE_DECL_TCP_FASTOPEN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_FASTOPEN) == (23), "TCP_FASTOPEN != 23"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_FASTOPEN 23 +#endif +#if defined(TCP_TIMESTAMP) || (defined(HAVE_DECL_TCP_TIMESTAMP) && HAVE_DECL_TCP_TIMESTAMP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_TIMESTAMP) == (24), "TCP_TIMESTAMP != 24"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_TIMESTAMP 24 +#endif +#if defined(TCP_NOTSENT_LOWAT) || (defined(HAVE_DECL_TCP_NOTSENT_LOWAT) && HAVE_DECL_TCP_NOTSENT_LOWAT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_NOTSENT_LOWAT) == (25), "TCP_NOTSENT_LOWAT != 25"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_NOTSENT_LOWAT 25 +#endif +#if defined(TCP_CC_INFO) || (defined(HAVE_DECL_TCP_CC_INFO) && HAVE_DECL_TCP_CC_INFO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_CC_INFO) == (26), "TCP_CC_INFO != 26"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_CC_INFO 26 +#endif +#if defined(TCP_SAVE_SYN) || (defined(HAVE_DECL_TCP_SAVE_SYN) && HAVE_DECL_TCP_SAVE_SYN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_SAVE_SYN) == (27), "TCP_SAVE_SYN != 27"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_SAVE_SYN 27 +#endif +#if defined(TCP_SAVED_SYN) || (defined(HAVE_DECL_TCP_SAVED_SYN) && HAVE_DECL_TCP_SAVED_SYN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_SAVED_SYN) == (28), "TCP_SAVED_SYN != 28"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_SAVED_SYN 28 +#endif +#if defined(TCP_REPAIR_WINDOW) || (defined(HAVE_DECL_TCP_REPAIR_WINDOW) && HAVE_DECL_TCP_REPAIR_WINDOW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_REPAIR_WINDOW) == (29), "TCP_REPAIR_WINDOW != 29"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_REPAIR_WINDOW 29 +#endif +#if defined(TCP_FASTOPEN_CONNECT) || (defined(HAVE_DECL_TCP_FASTOPEN_CONNECT) && HAVE_DECL_TCP_FASTOPEN_CONNECT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_FASTOPEN_CONNECT) == (30), "TCP_FASTOPEN_CONNECT != 30"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_FASTOPEN_CONNECT 30 +#endif +#if defined(TCP_ULP) || (defined(HAVE_DECL_TCP_ULP) && HAVE_DECL_TCP_ULP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_ULP) == (31), "TCP_ULP != 31"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_ULP 31 +#endif +#if defined(TCP_MD5SIG_EXT) || (defined(HAVE_DECL_TCP_MD5SIG_EXT) && HAVE_DECL_TCP_MD5SIG_EXT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_MD5SIG_EXT) == (32), "TCP_MD5SIG_EXT != 32"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_MD5SIG_EXT 32 +#endif +#if defined(TCP_FASTOPEN_KEY) || (defined(HAVE_DECL_TCP_FASTOPEN_KEY) && HAVE_DECL_TCP_FASTOPEN_KEY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_FASTOPEN_KEY) == (33), "TCP_FASTOPEN_KEY != 33"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_FASTOPEN_KEY 33 +#endif +#if defined(TCP_FASTOPEN_NO_COOKIE) || (defined(HAVE_DECL_TCP_FASTOPEN_NO_COOKIE) && HAVE_DECL_TCP_FASTOPEN_NO_COOKIE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_FASTOPEN_NO_COOKIE) == (34), "TCP_FASTOPEN_NO_COOKIE != 34"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_FASTOPEN_NO_COOKIE 34 +#endif +#if defined(TCP_ZEROCOPY_RECEIVE) || (defined(HAVE_DECL_TCP_ZEROCOPY_RECEIVE) && HAVE_DECL_TCP_ZEROCOPY_RECEIVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_ZEROCOPY_RECEIVE) == (35), "TCP_ZEROCOPY_RECEIVE != 35"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_ZEROCOPY_RECEIVE 35 +#endif +#if defined(TCP_INQ) || (defined(HAVE_DECL_TCP_INQ) && HAVE_DECL_TCP_INQ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TCP_INQ) == (36), "TCP_INQ != 36"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TCP_INQ 36 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_tcp_options in mpers mode + +# else + +static +const struct xlat sock_tcp_options[] = { + [TCP_NODELAY] = XLAT(TCP_NODELAY), + [TCP_MAXSEG] = XLAT(TCP_MAXSEG), + [TCP_CORK] = XLAT(TCP_CORK), + [TCP_KEEPIDLE] = XLAT(TCP_KEEPIDLE), + [TCP_KEEPINTVL] = XLAT(TCP_KEEPINTVL), + [TCP_KEEPCNT] = XLAT(TCP_KEEPCNT), + [TCP_SYNCNT] = XLAT(TCP_SYNCNT), + [TCP_LINGER2] = XLAT(TCP_LINGER2), + [TCP_DEFER_ACCEPT] = XLAT(TCP_DEFER_ACCEPT), + [TCP_WINDOW_CLAMP] = XLAT(TCP_WINDOW_CLAMP), + [TCP_INFO] = XLAT(TCP_INFO), + [TCP_QUICKACK] = XLAT(TCP_QUICKACK), + [TCP_CONGESTION] = XLAT(TCP_CONGESTION), + [TCP_MD5SIG] = XLAT(TCP_MD5SIG), + [TCP_COOKIE_TRANSACTIONS] = XLAT(TCP_COOKIE_TRANSACTIONS), + [TCP_THIN_LINEAR_TIMEOUTS] = XLAT(TCP_THIN_LINEAR_TIMEOUTS), + [TCP_THIN_DUPACK] = XLAT(TCP_THIN_DUPACK), + [TCP_USER_TIMEOUT] = XLAT(TCP_USER_TIMEOUT), + [TCP_REPAIR] = XLAT(TCP_REPAIR), + [TCP_REPAIR_QUEUE] = XLAT(TCP_REPAIR_QUEUE), + [TCP_QUEUE_SEQ] = XLAT(TCP_QUEUE_SEQ), + [TCP_REPAIR_OPTIONS] = XLAT(TCP_REPAIR_OPTIONS), + [TCP_FASTOPEN] = XLAT(TCP_FASTOPEN), + [TCP_TIMESTAMP] = XLAT(TCP_TIMESTAMP), + [TCP_NOTSENT_LOWAT] = XLAT(TCP_NOTSENT_LOWAT), + [TCP_CC_INFO] = XLAT(TCP_CC_INFO), + [TCP_SAVE_SYN] = XLAT(TCP_SAVE_SYN), + [TCP_SAVED_SYN] = XLAT(TCP_SAVED_SYN), + [TCP_REPAIR_WINDOW] = XLAT(TCP_REPAIR_WINDOW), + [TCP_FASTOPEN_CONNECT] = XLAT(TCP_FASTOPEN_CONNECT), + [TCP_ULP] = XLAT(TCP_ULP), + [TCP_MD5SIG_EXT] = XLAT(TCP_MD5SIG_EXT), + [TCP_FASTOPEN_KEY] = XLAT(TCP_FASTOPEN_KEY), + [TCP_FASTOPEN_NO_COOKIE] = XLAT(TCP_FASTOPEN_NO_COOKIE), + [TCP_ZEROCOPY_RECEIVE] = XLAT(TCP_ZEROCOPY_RECEIVE), + [TCP_INQ] = XLAT(TCP_INQ), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_tcp_options.in b/xlat/sock_tcp_options.in new file mode 100644 index 00000000..70543cce --- /dev/null +++ b/xlat/sock_tcp_options.in @@ -0,0 +1,37 @@ +#value_indexed +TCP_NODELAY 1 +TCP_MAXSEG 2 +TCP_CORK 3 +TCP_KEEPIDLE 4 +TCP_KEEPINTVL 5 +TCP_KEEPCNT 6 +TCP_SYNCNT 7 +TCP_LINGER2 8 +TCP_DEFER_ACCEPT 9 +TCP_WINDOW_CLAMP 10 +TCP_INFO 11 +TCP_QUICKACK 12 +TCP_CONGESTION 13 +TCP_MD5SIG 14 +TCP_COOKIE_TRANSACTIONS 15 +TCP_THIN_LINEAR_TIMEOUTS 16 +TCP_THIN_DUPACK 17 +TCP_USER_TIMEOUT 18 +TCP_REPAIR 19 +TCP_REPAIR_QUEUE 20 +TCP_QUEUE_SEQ 21 +TCP_REPAIR_OPTIONS 22 +TCP_FASTOPEN 23 +TCP_TIMESTAMP 24 +TCP_NOTSENT_LOWAT 25 +TCP_CC_INFO 26 +TCP_SAVE_SYN 27 +TCP_SAVED_SYN 28 +TCP_REPAIR_WINDOW 29 +TCP_FASTOPEN_CONNECT 30 +TCP_ULP 31 +TCP_MD5SIG_EXT 32 +TCP_FASTOPEN_KEY 33 +TCP_FASTOPEN_NO_COOKIE 34 +TCP_ZEROCOPY_RECEIVE 35 +TCP_INQ 36 diff --git a/xlat/sock_tipc_options.h b/xlat/sock_tipc_options.h new file mode 100644 index 00000000..c41a91cb --- /dev/null +++ b/xlat/sock_tipc_options.h @@ -0,0 +1,103 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_tipc_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(TIPC_IMPORTANCE) || (defined(HAVE_DECL_TIPC_IMPORTANCE) && HAVE_DECL_TIPC_IMPORTANCE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TIPC_IMPORTANCE) == (127), "TIPC_IMPORTANCE != 127"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TIPC_IMPORTANCE 127 +#endif +#if defined(TIPC_SRC_DROPPABLE) || (defined(HAVE_DECL_TIPC_SRC_DROPPABLE) && HAVE_DECL_TIPC_SRC_DROPPABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TIPC_SRC_DROPPABLE) == (128), "TIPC_SRC_DROPPABLE != 128"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TIPC_SRC_DROPPABLE 128 +#endif +#if defined(TIPC_DEST_DROPPABLE) || (defined(HAVE_DECL_TIPC_DEST_DROPPABLE) && HAVE_DECL_TIPC_DEST_DROPPABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TIPC_DEST_DROPPABLE) == (129), "TIPC_DEST_DROPPABLE != 129"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TIPC_DEST_DROPPABLE 129 +#endif +#if defined(TIPC_CONN_TIMEOUT) || (defined(HAVE_DECL_TIPC_CONN_TIMEOUT) && HAVE_DECL_TIPC_CONN_TIMEOUT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TIPC_CONN_TIMEOUT) == (130), "TIPC_CONN_TIMEOUT != 130"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TIPC_CONN_TIMEOUT 130 +#endif +#if defined(TIPC_NODE_RECVQ_DEPTH) || (defined(HAVE_DECL_TIPC_NODE_RECVQ_DEPTH) && HAVE_DECL_TIPC_NODE_RECVQ_DEPTH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TIPC_NODE_RECVQ_DEPTH) == (131), "TIPC_NODE_RECVQ_DEPTH != 131"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TIPC_NODE_RECVQ_DEPTH 131 +#endif +#if defined(TIPC_SOCK_RECVQ_DEPTH) || (defined(HAVE_DECL_TIPC_SOCK_RECVQ_DEPTH) && HAVE_DECL_TIPC_SOCK_RECVQ_DEPTH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TIPC_SOCK_RECVQ_DEPTH) == (132), "TIPC_SOCK_RECVQ_DEPTH != 132"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TIPC_SOCK_RECVQ_DEPTH 132 +#endif +#if defined(TIPC_MCAST_BROADCAST) || (defined(HAVE_DECL_TIPC_MCAST_BROADCAST) && HAVE_DECL_TIPC_MCAST_BROADCAST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TIPC_MCAST_BROADCAST) == (133), "TIPC_MCAST_BROADCAST != 133"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TIPC_MCAST_BROADCAST 133 +#endif +#if defined(TIPC_MCAST_REPLICAST) || (defined(HAVE_DECL_TIPC_MCAST_REPLICAST) && HAVE_DECL_TIPC_MCAST_REPLICAST) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TIPC_MCAST_REPLICAST) == (134), "TIPC_MCAST_REPLICAST != 134"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TIPC_MCAST_REPLICAST 134 +#endif +#if defined(TIPC_GROUP_JOIN) || (defined(HAVE_DECL_TIPC_GROUP_JOIN) && HAVE_DECL_TIPC_GROUP_JOIN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TIPC_GROUP_JOIN) == (135), "TIPC_GROUP_JOIN != 135"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TIPC_GROUP_JOIN 135 +#endif +#if defined(TIPC_GROUP_LEAVE) || (defined(HAVE_DECL_TIPC_GROUP_LEAVE) && HAVE_DECL_TIPC_GROUP_LEAVE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TIPC_GROUP_LEAVE) == (136), "TIPC_GROUP_LEAVE != 136"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TIPC_GROUP_LEAVE 136 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_tipc_options in mpers mode + +# else + +static +const struct xlat sock_tipc_options[] = { + + XLAT(TIPC_IMPORTANCE), + XLAT(TIPC_SRC_DROPPABLE), + XLAT(TIPC_DEST_DROPPABLE), + XLAT(TIPC_CONN_TIMEOUT), + XLAT(TIPC_NODE_RECVQ_DEPTH), + XLAT(TIPC_SOCK_RECVQ_DEPTH), + XLAT(TIPC_MCAST_BROADCAST), + XLAT(TIPC_MCAST_REPLICAST), + XLAT(TIPC_GROUP_JOIN), + XLAT(TIPC_GROUP_LEAVE), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_tipc_options.in b/xlat/sock_tipc_options.in new file mode 100644 index 00000000..849e50d6 --- /dev/null +++ b/xlat/sock_tipc_options.in @@ -0,0 +1,11 @@ +/* sort -k2,2n */ +TIPC_IMPORTANCE 127 +TIPC_SRC_DROPPABLE 128 +TIPC_DEST_DROPPABLE 129 +TIPC_CONN_TIMEOUT 130 +TIPC_NODE_RECVQ_DEPTH 131 +TIPC_SOCK_RECVQ_DEPTH 132 +TIPC_MCAST_BROADCAST 133 +TIPC_MCAST_REPLICAST 134 +TIPC_GROUP_JOIN 135 +TIPC_GROUP_LEAVE 136 diff --git a/xlat/sock_tls_options.h b/xlat/sock_tls_options.h new file mode 100644 index 00000000..7e1f2533 --- /dev/null +++ b/xlat/sock_tls_options.h @@ -0,0 +1,38 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_tls_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(TLS_TX) || (defined(HAVE_DECL_TLS_TX) && HAVE_DECL_TLS_TX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TLS_TX) == (1), "TLS_TX != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TLS_TX 1 +#endif +#if defined(TLS_RX) || (defined(HAVE_DECL_TLS_RX) && HAVE_DECL_TLS_RX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((TLS_RX) == (2), "TLS_RX != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define TLS_RX 2 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_tls_options in mpers mode + +# else + +static +const struct xlat sock_tls_options[] = { + XLAT(TLS_TX), + XLAT(TLS_RX), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_tls_options.in b/xlat/sock_tls_options.in new file mode 100644 index 00000000..5fcefd64 --- /dev/null +++ b/xlat/sock_tls_options.in @@ -0,0 +1,2 @@ +TLS_TX 1 +TLS_RX 2 diff --git a/xlat/sock_type_flags.h b/xlat/sock_type_flags.h index d1af088c..d8755c4e 100644 --- a/xlat/sock_type_flags.h +++ b/xlat/sock_type_flags.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/sock_type_flags.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat sock_type_flags in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_type_flags in mpers mode + +# else static const struct xlat sock_type_flags[] = { @@ -17,4 +23,6 @@ const struct xlat sock_type_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_udp_options.h b/xlat/sock_udp_options.h new file mode 100644 index 00000000..37e199fa --- /dev/null +++ b/xlat/sock_udp_options.h @@ -0,0 +1,70 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_udp_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(UDP_CORK) || (defined(HAVE_DECL_UDP_CORK) && HAVE_DECL_UDP_CORK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((UDP_CORK) == (1), "UDP_CORK != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define UDP_CORK 1 +#endif +#if defined(UDP_ENCAP) || (defined(HAVE_DECL_UDP_ENCAP) && HAVE_DECL_UDP_ENCAP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((UDP_ENCAP) == (100), "UDP_ENCAP != 100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define UDP_ENCAP 100 +#endif +#if defined(UDP_NO_CHECK6_TX) || (defined(HAVE_DECL_UDP_NO_CHECK6_TX) && HAVE_DECL_UDP_NO_CHECK6_TX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((UDP_NO_CHECK6_TX) == (101), "UDP_NO_CHECK6_TX != 101"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define UDP_NO_CHECK6_TX 101 +#endif +#if defined(UDP_NO_CHECK6_RX) || (defined(HAVE_DECL_UDP_NO_CHECK6_RX) && HAVE_DECL_UDP_NO_CHECK6_RX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((UDP_NO_CHECK6_RX) == (102), "UDP_NO_CHECK6_RX != 102"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define UDP_NO_CHECK6_RX 102 +#endif +#if defined(UDP_SEGMENT) || (defined(HAVE_DECL_UDP_SEGMENT) && HAVE_DECL_UDP_SEGMENT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((UDP_SEGMENT) == (103), "UDP_SEGMENT != 103"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define UDP_SEGMENT 103 +#endif +#if defined(UDP_GRO) || (defined(HAVE_DECL_UDP_GRO) && HAVE_DECL_UDP_GRO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((UDP_GRO) == (104), "UDP_GRO != 104"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define UDP_GRO 104 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_udp_options in mpers mode + +# else + +static +const struct xlat sock_udp_options[] = { + XLAT(UDP_CORK), + XLAT(UDP_ENCAP), + XLAT(UDP_NO_CHECK6_TX), + XLAT(UDP_NO_CHECK6_RX), + XLAT(UDP_SEGMENT), + XLAT(UDP_GRO), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_udp_options.in b/xlat/sock_udp_options.in new file mode 100644 index 00000000..753582f3 --- /dev/null +++ b/xlat/sock_udp_options.in @@ -0,0 +1,6 @@ +UDP_CORK 1 +UDP_ENCAP 100 +UDP_NO_CHECK6_TX 101 +UDP_NO_CHECK6_RX 102 +UDP_SEGMENT 103 +UDP_GRO 104 diff --git a/xlat/sock_xdp_options.h b/xlat/sock_xdp_options.h new file mode 100644 index 00000000..8cd2ded1 --- /dev/null +++ b/xlat/sock_xdp_options.h @@ -0,0 +1,78 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sock_xdp_options.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(XDP_MMAP_OFFSETS) || (defined(HAVE_DECL_XDP_MMAP_OFFSETS) && HAVE_DECL_XDP_MMAP_OFFSETS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XDP_MMAP_OFFSETS) == (1), "XDP_MMAP_OFFSETS != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XDP_MMAP_OFFSETS 1 +#endif +#if defined(XDP_RX_RING) || (defined(HAVE_DECL_XDP_RX_RING) && HAVE_DECL_XDP_RX_RING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XDP_RX_RING) == (2), "XDP_RX_RING != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XDP_RX_RING 2 +#endif +#if defined(XDP_TX_RING) || (defined(HAVE_DECL_XDP_TX_RING) && HAVE_DECL_XDP_TX_RING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XDP_TX_RING) == (3), "XDP_TX_RING != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XDP_TX_RING 3 +#endif +#if defined(XDP_UMEM_REG) || (defined(HAVE_DECL_XDP_UMEM_REG) && HAVE_DECL_XDP_UMEM_REG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XDP_UMEM_REG) == (4), "XDP_UMEM_REG != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XDP_UMEM_REG 4 +#endif +#if defined(XDP_UMEM_FILL_RING) || (defined(HAVE_DECL_XDP_UMEM_FILL_RING) && HAVE_DECL_XDP_UMEM_FILL_RING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XDP_UMEM_FILL_RING) == (5), "XDP_UMEM_FILL_RING != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XDP_UMEM_FILL_RING 5 +#endif +#if defined(XDP_UMEM_COMPLETION_RING) || (defined(HAVE_DECL_XDP_UMEM_COMPLETION_RING) && HAVE_DECL_XDP_UMEM_COMPLETION_RING) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XDP_UMEM_COMPLETION_RING) == (6), "XDP_UMEM_COMPLETION_RING != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XDP_UMEM_COMPLETION_RING 6 +#endif +#if defined(XDP_STATISTICS) || (defined(HAVE_DECL_XDP_STATISTICS) && HAVE_DECL_XDP_STATISTICS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((XDP_STATISTICS) == (7), "XDP_STATISTICS != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define XDP_STATISTICS 7 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sock_xdp_options in mpers mode + +# else + +static +const struct xlat sock_xdp_options[] = { + [XDP_MMAP_OFFSETS] = XLAT(XDP_MMAP_OFFSETS), + [XDP_RX_RING] = XLAT(XDP_RX_RING), + [XDP_TX_RING] = XLAT(XDP_TX_RING), + [XDP_UMEM_REG] = XLAT(XDP_UMEM_REG), + [XDP_UMEM_FILL_RING] = XLAT(XDP_UMEM_FILL_RING), + [XDP_UMEM_COMPLETION_RING] = XLAT(XDP_UMEM_COMPLETION_RING), + [XDP_STATISTICS] = XLAT(XDP_STATISTICS), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sock_xdp_options.in b/xlat/sock_xdp_options.in new file mode 100644 index 00000000..f2b7a68b --- /dev/null +++ b/xlat/sock_xdp_options.in @@ -0,0 +1,8 @@ +#value_indexed +XDP_MMAP_OFFSETS 1 +XDP_RX_RING 2 +XDP_TX_RING 3 +XDP_UMEM_REG 4 +XDP_UMEM_FILL_RING 5 +XDP_UMEM_COMPLETION_RING 6 +XDP_STATISTICS 7 diff --git a/xlat/socketcalls.h b/xlat/socketcalls.h index 3680446b..a3ae1484 100644 --- a/xlat/socketcalls.h +++ b/xlat/socketcalls.h @@ -1,70 +1,156 @@ /* Generated by ./xlat/gen.sh from ./xlat/socketcalls.in; do not edit. */ -#if !(defined(SYS_SOCKET) || (defined(HAVE_DECL_SYS_SOCKET) && HAVE_DECL_SYS_SOCKET)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SYS_SOCKET) || (defined(HAVE_DECL_SYS_SOCKET) && HAVE_DECL_SYS_SOCKET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYS_SOCKET) == (1), "SYS_SOCKET != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYS_SOCKET 1 #endif -#if !(defined(SYS_BIND) || (defined(HAVE_DECL_SYS_BIND) && HAVE_DECL_SYS_BIND)) +#if defined(SYS_BIND) || (defined(HAVE_DECL_SYS_BIND) && HAVE_DECL_SYS_BIND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYS_BIND) == (2), "SYS_BIND != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYS_BIND 2 #endif -#if !(defined(SYS_CONNECT) || (defined(HAVE_DECL_SYS_CONNECT) && HAVE_DECL_SYS_CONNECT)) +#if defined(SYS_CONNECT) || (defined(HAVE_DECL_SYS_CONNECT) && HAVE_DECL_SYS_CONNECT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYS_CONNECT) == (3), "SYS_CONNECT != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYS_CONNECT 3 #endif -#if !(defined(SYS_LISTEN) || (defined(HAVE_DECL_SYS_LISTEN) && HAVE_DECL_SYS_LISTEN)) +#if defined(SYS_LISTEN) || (defined(HAVE_DECL_SYS_LISTEN) && HAVE_DECL_SYS_LISTEN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYS_LISTEN) == (4), "SYS_LISTEN != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYS_LISTEN 4 #endif -#if !(defined(SYS_ACCEPT) || (defined(HAVE_DECL_SYS_ACCEPT) && HAVE_DECL_SYS_ACCEPT)) +#if defined(SYS_ACCEPT) || (defined(HAVE_DECL_SYS_ACCEPT) && HAVE_DECL_SYS_ACCEPT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYS_ACCEPT) == (5), "SYS_ACCEPT != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYS_ACCEPT 5 #endif -#if !(defined(SYS_GETSOCKNAME) || (defined(HAVE_DECL_SYS_GETSOCKNAME) && HAVE_DECL_SYS_GETSOCKNAME)) +#if defined(SYS_GETSOCKNAME) || (defined(HAVE_DECL_SYS_GETSOCKNAME) && HAVE_DECL_SYS_GETSOCKNAME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYS_GETSOCKNAME) == (6), "SYS_GETSOCKNAME != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYS_GETSOCKNAME 6 #endif -#if !(defined(SYS_GETPEERNAME) || (defined(HAVE_DECL_SYS_GETPEERNAME) && HAVE_DECL_SYS_GETPEERNAME)) +#if defined(SYS_GETPEERNAME) || (defined(HAVE_DECL_SYS_GETPEERNAME) && HAVE_DECL_SYS_GETPEERNAME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYS_GETPEERNAME) == (7), "SYS_GETPEERNAME != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYS_GETPEERNAME 7 #endif -#if !(defined(SYS_SOCKETPAIR) || (defined(HAVE_DECL_SYS_SOCKETPAIR) && HAVE_DECL_SYS_SOCKETPAIR)) +#if defined(SYS_SOCKETPAIR) || (defined(HAVE_DECL_SYS_SOCKETPAIR) && HAVE_DECL_SYS_SOCKETPAIR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYS_SOCKETPAIR) == (8), "SYS_SOCKETPAIR != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYS_SOCKETPAIR 8 #endif -#if !(defined(SYS_SEND) || (defined(HAVE_DECL_SYS_SEND) && HAVE_DECL_SYS_SEND)) +#if defined(SYS_SEND) || (defined(HAVE_DECL_SYS_SEND) && HAVE_DECL_SYS_SEND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYS_SEND) == (9), "SYS_SEND != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYS_SEND 9 #endif -#if !(defined(SYS_RECV) || (defined(HAVE_DECL_SYS_RECV) && HAVE_DECL_SYS_RECV)) +#if defined(SYS_RECV) || (defined(HAVE_DECL_SYS_RECV) && HAVE_DECL_SYS_RECV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYS_RECV) == (10), "SYS_RECV != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYS_RECV 10 #endif -#if !(defined(SYS_SENDTO) || (defined(HAVE_DECL_SYS_SENDTO) && HAVE_DECL_SYS_SENDTO)) +#if defined(SYS_SENDTO) || (defined(HAVE_DECL_SYS_SENDTO) && HAVE_DECL_SYS_SENDTO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYS_SENDTO) == (11), "SYS_SENDTO != 11"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYS_SENDTO 11 #endif -#if !(defined(SYS_RECVFROM) || (defined(HAVE_DECL_SYS_RECVFROM) && HAVE_DECL_SYS_RECVFROM)) +#if defined(SYS_RECVFROM) || (defined(HAVE_DECL_SYS_RECVFROM) && HAVE_DECL_SYS_RECVFROM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYS_RECVFROM) == (12), "SYS_RECVFROM != 12"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYS_RECVFROM 12 #endif -#if !(defined(SYS_SHUTDOWN) || (defined(HAVE_DECL_SYS_SHUTDOWN) && HAVE_DECL_SYS_SHUTDOWN)) +#if defined(SYS_SHUTDOWN) || (defined(HAVE_DECL_SYS_SHUTDOWN) && HAVE_DECL_SYS_SHUTDOWN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYS_SHUTDOWN) == (13), "SYS_SHUTDOWN != 13"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYS_SHUTDOWN 13 #endif -#if !(defined(SYS_SETSOCKOPT) || (defined(HAVE_DECL_SYS_SETSOCKOPT) && HAVE_DECL_SYS_SETSOCKOPT)) +#if defined(SYS_SETSOCKOPT) || (defined(HAVE_DECL_SYS_SETSOCKOPT) && HAVE_DECL_SYS_SETSOCKOPT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYS_SETSOCKOPT) == (14), "SYS_SETSOCKOPT != 14"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYS_SETSOCKOPT 14 #endif -#if !(defined(SYS_GETSOCKOPT) || (defined(HAVE_DECL_SYS_GETSOCKOPT) && HAVE_DECL_SYS_GETSOCKOPT)) +#if defined(SYS_GETSOCKOPT) || (defined(HAVE_DECL_SYS_GETSOCKOPT) && HAVE_DECL_SYS_GETSOCKOPT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYS_GETSOCKOPT) == (15), "SYS_GETSOCKOPT != 15"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYS_GETSOCKOPT 15 #endif -#if !(defined(SYS_SENDMSG) || (defined(HAVE_DECL_SYS_SENDMSG) && HAVE_DECL_SYS_SENDMSG)) +#if defined(SYS_SENDMSG) || (defined(HAVE_DECL_SYS_SENDMSG) && HAVE_DECL_SYS_SENDMSG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYS_SENDMSG) == (16), "SYS_SENDMSG != 16"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYS_SENDMSG 16 #endif -#if !(defined(SYS_RECVMSG) || (defined(HAVE_DECL_SYS_RECVMSG) && HAVE_DECL_SYS_RECVMSG)) +#if defined(SYS_RECVMSG) || (defined(HAVE_DECL_SYS_RECVMSG) && HAVE_DECL_SYS_RECVMSG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYS_RECVMSG) == (17), "SYS_RECVMSG != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYS_RECVMSG 17 #endif -#if !(defined(SYS_ACCEPT4) || (defined(HAVE_DECL_SYS_ACCEPT4) && HAVE_DECL_SYS_ACCEPT4)) +#if defined(SYS_ACCEPT4) || (defined(HAVE_DECL_SYS_ACCEPT4) && HAVE_DECL_SYS_ACCEPT4) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYS_ACCEPT4) == (18), "SYS_ACCEPT4 != 18"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYS_ACCEPT4 18 #endif -#if !(defined(SYS_RECVMMSG) || (defined(HAVE_DECL_SYS_RECVMMSG) && HAVE_DECL_SYS_RECVMMSG)) +#if defined(SYS_RECVMMSG) || (defined(HAVE_DECL_SYS_RECVMMSG) && HAVE_DECL_SYS_RECVMMSG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYS_RECVMMSG) == (19), "SYS_RECVMMSG != 19"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYS_RECVMMSG 19 #endif -#if !(defined(SYS_SENDMMSG) || (defined(HAVE_DECL_SYS_SENDMMSG) && HAVE_DECL_SYS_SENDMMSG)) +#if defined(SYS_SENDMMSG) || (defined(HAVE_DECL_SYS_SENDMMSG) && HAVE_DECL_SYS_SENDMMSG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYS_SENDMMSG) == (20), "SYS_SENDMMSG != 20"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYS_SENDMMSG 20 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat socketcalls in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat socketcalls in mpers mode + +# else static const struct xlat socketcalls[] = { @@ -91,4 +177,6 @@ const struct xlat socketcalls[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/socketlayers.h b/xlat/socketlayers.h index 5e486c38..2239cdc0 100644 --- a/xlat/socketlayers.h +++ b/xlat/socketlayers.h @@ -1,119 +1,309 @@ /* Generated by ./xlat/gen.sh from ./xlat/socketlayers.in; do not edit. */ -#if !(defined(SOL_IP) || (defined(HAVE_DECL_SOL_IP) && HAVE_DECL_SOL_IP)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SOL_IP) || (defined(HAVE_DECL_SOL_IP) && HAVE_DECL_SOL_IP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_IP) == (0), "SOL_IP != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_IP 0 #endif -#if !(defined(SOL_SOCKET) || (defined(HAVE_DECL_SOL_SOCKET) && HAVE_DECL_SOL_SOCKET)) +#if !(defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__) +#if defined(SOL_SOCKET) || (defined(HAVE_DECL_SOL_SOCKET) && HAVE_DECL_SOL_SOCKET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_SOCKET) == (1), "SOL_SOCKET != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_SOCKET 1 #endif -#if !(defined(SOL_TCP) || (defined(HAVE_DECL_SOL_TCP) && HAVE_DECL_SOL_TCP)) +#endif +#if defined(SOL_TCP) || (defined(HAVE_DECL_SOL_TCP) && HAVE_DECL_SOL_TCP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_TCP) == (6), "SOL_TCP != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_TCP 6 #endif -#if !(defined(SOL_UDP) || (defined(HAVE_DECL_SOL_UDP) && HAVE_DECL_SOL_UDP)) +#if defined(SOL_UDP) || (defined(HAVE_DECL_SOL_UDP) && HAVE_DECL_SOL_UDP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_UDP) == (17), "SOL_UDP != 17"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_UDP 17 #endif -#if !(defined(SOL_IPV6) || (defined(HAVE_DECL_SOL_IPV6) && HAVE_DECL_SOL_IPV6)) +#if defined(SOL_IPV6) || (defined(HAVE_DECL_SOL_IPV6) && HAVE_DECL_SOL_IPV6) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_IPV6) == (41), "SOL_IPV6 != 41"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_IPV6 41 #endif -#if !(defined(SOL_ICMPV6) || (defined(HAVE_DECL_SOL_ICMPV6) && HAVE_DECL_SOL_ICMPV6)) +#if defined(SOL_ICMPV6) || (defined(HAVE_DECL_SOL_ICMPV6) && HAVE_DECL_SOL_ICMPV6) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_ICMPV6) == (58), "SOL_ICMPV6 != 58"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_ICMPV6 58 #endif -#if !(defined(SOL_SCTP) || (defined(HAVE_DECL_SOL_SCTP) && HAVE_DECL_SOL_SCTP)) +#if defined(SOL_CAN_BASE) || (defined(HAVE_DECL_SOL_CAN_BASE) && HAVE_DECL_SOL_CAN_BASE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_CAN_BASE) == (100), "SOL_CAN_BASE != 100"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SOL_CAN_BASE 100 +#endif +#if defined(SOL_CAN_RAW) || (defined(HAVE_DECL_SOL_CAN_RAW) && HAVE_DECL_SOL_CAN_RAW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_CAN_RAW) == (101), "SOL_CAN_RAW != 101"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SOL_CAN_RAW 101 +#endif +#if defined(SOL_SCTP) || (defined(HAVE_DECL_SOL_SCTP) && HAVE_DECL_SOL_SCTP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_SCTP) == (132), "SOL_SCTP != 132"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_SCTP 132 #endif -#if !(defined(SOL_UDPLITE) || (defined(HAVE_DECL_SOL_UDPLITE) && HAVE_DECL_SOL_UDPLITE)) +#if defined(SOL_UDPLITE) || (defined(HAVE_DECL_SOL_UDPLITE) && HAVE_DECL_SOL_UDPLITE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_UDPLITE) == (136), "SOL_UDPLITE != 136"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_UDPLITE 136 #endif -#if !(defined(SOL_RAW) || (defined(HAVE_DECL_SOL_RAW) && HAVE_DECL_SOL_RAW)) +#if defined(SOL_RAW) || (defined(HAVE_DECL_SOL_RAW) && HAVE_DECL_SOL_RAW) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_RAW) == (255), "SOL_RAW != 255"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_RAW 255 #endif -#if !(defined(SOL_IPX) || (defined(HAVE_DECL_SOL_IPX) && HAVE_DECL_SOL_IPX)) +#if defined(SOL_IPX) || (defined(HAVE_DECL_SOL_IPX) && HAVE_DECL_SOL_IPX) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_IPX) == (256), "SOL_IPX != 256"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_IPX 256 #endif -#if !(defined(SOL_AX25) || (defined(HAVE_DECL_SOL_AX25) && HAVE_DECL_SOL_AX25)) +#if defined(SOL_AX25) || (defined(HAVE_DECL_SOL_AX25) && HAVE_DECL_SOL_AX25) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_AX25) == (257), "SOL_AX25 != 257"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_AX25 257 #endif -#if !(defined(SOL_ATALK) || (defined(HAVE_DECL_SOL_ATALK) && HAVE_DECL_SOL_ATALK)) +#if defined(SOL_ATALK) || (defined(HAVE_DECL_SOL_ATALK) && HAVE_DECL_SOL_ATALK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_ATALK) == (258), "SOL_ATALK != 258"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_ATALK 258 #endif -#if !(defined(SOL_NETROM) || (defined(HAVE_DECL_SOL_NETROM) && HAVE_DECL_SOL_NETROM)) +#if defined(SOL_NETROM) || (defined(HAVE_DECL_SOL_NETROM) && HAVE_DECL_SOL_NETROM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_NETROM) == (259), "SOL_NETROM != 259"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_NETROM 259 #endif -#if !(defined(SOL_ROSE) || (defined(HAVE_DECL_SOL_ROSE) && HAVE_DECL_SOL_ROSE)) +#if defined(SOL_ROSE) || (defined(HAVE_DECL_SOL_ROSE) && HAVE_DECL_SOL_ROSE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_ROSE) == (260), "SOL_ROSE != 260"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_ROSE 260 #endif -#if !(defined(SOL_DECNET) || (defined(HAVE_DECL_SOL_DECNET) && HAVE_DECL_SOL_DECNET)) +#if defined(SOL_DECNET) || (defined(HAVE_DECL_SOL_DECNET) && HAVE_DECL_SOL_DECNET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_DECNET) == (261), "SOL_DECNET != 261"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_DECNET 261 #endif -#if !(defined(SOL_X25) || (defined(HAVE_DECL_SOL_X25) && HAVE_DECL_SOL_X25)) +#if defined(SOL_X25) || (defined(HAVE_DECL_SOL_X25) && HAVE_DECL_SOL_X25) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_X25) == (262), "SOL_X25 != 262"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_X25 262 #endif -#if !(defined(SOL_PACKET) || (defined(HAVE_DECL_SOL_PACKET) && HAVE_DECL_SOL_PACKET)) +#if defined(SOL_PACKET) || (defined(HAVE_DECL_SOL_PACKET) && HAVE_DECL_SOL_PACKET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_PACKET) == (263), "SOL_PACKET != 263"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_PACKET 263 #endif -#if !(defined(SOL_ATM) || (defined(HAVE_DECL_SOL_ATM) && HAVE_DECL_SOL_ATM)) +#if defined(SOL_ATM) || (defined(HAVE_DECL_SOL_ATM) && HAVE_DECL_SOL_ATM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_ATM) == (264), "SOL_ATM != 264"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_ATM 264 #endif -#if !(defined(SOL_AAL) || (defined(HAVE_DECL_SOL_AAL) && HAVE_DECL_SOL_AAL)) +#if defined(SOL_AAL) || (defined(HAVE_DECL_SOL_AAL) && HAVE_DECL_SOL_AAL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_AAL) == (265), "SOL_AAL != 265"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_AAL 265 #endif -#if !(defined(SOL_IRDA) || (defined(HAVE_DECL_SOL_IRDA) && HAVE_DECL_SOL_IRDA)) +#if defined(SOL_IRDA) || (defined(HAVE_DECL_SOL_IRDA) && HAVE_DECL_SOL_IRDA) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_IRDA) == (266), "SOL_IRDA != 266"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_IRDA 266 #endif -#if !(defined(SOL_NETBEUI) || (defined(HAVE_DECL_SOL_NETBEUI) && HAVE_DECL_SOL_NETBEUI)) +#if defined(SOL_NETBEUI) || (defined(HAVE_DECL_SOL_NETBEUI) && HAVE_DECL_SOL_NETBEUI) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_NETBEUI) == (267), "SOL_NETBEUI != 267"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_NETBEUI 267 #endif -#if !(defined(SOL_LLC) || (defined(HAVE_DECL_SOL_LLC) && HAVE_DECL_SOL_LLC)) +#if defined(SOL_LLC) || (defined(HAVE_DECL_SOL_LLC) && HAVE_DECL_SOL_LLC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_LLC) == (268), "SOL_LLC != 268"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_LLC 268 #endif -#if !(defined(SOL_DCCP) || (defined(HAVE_DECL_SOL_DCCP) && HAVE_DECL_SOL_DCCP)) +#if defined(SOL_DCCP) || (defined(HAVE_DECL_SOL_DCCP) && HAVE_DECL_SOL_DCCP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_DCCP) == (269), "SOL_DCCP != 269"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_DCCP 269 #endif -#if !(defined(SOL_NETLINK) || (defined(HAVE_DECL_SOL_NETLINK) && HAVE_DECL_SOL_NETLINK)) +#if defined(SOL_NETLINK) || (defined(HAVE_DECL_SOL_NETLINK) && HAVE_DECL_SOL_NETLINK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_NETLINK) == (270), "SOL_NETLINK != 270"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_NETLINK 270 #endif -#if !(defined(SOL_TIPC) || (defined(HAVE_DECL_SOL_TIPC) && HAVE_DECL_SOL_TIPC)) +#if defined(SOL_TIPC) || (defined(HAVE_DECL_SOL_TIPC) && HAVE_DECL_SOL_TIPC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_TIPC) == (271), "SOL_TIPC != 271"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_TIPC 271 #endif -#if !(defined(SOL_RXRPC) || (defined(HAVE_DECL_SOL_RXRPC) && HAVE_DECL_SOL_RXRPC)) +#if defined(SOL_RXRPC) || (defined(HAVE_DECL_SOL_RXRPC) && HAVE_DECL_SOL_RXRPC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_RXRPC) == (272), "SOL_RXRPC != 272"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_RXRPC 272 #endif -#if !(defined(SOL_PPPOL2TP) || (defined(HAVE_DECL_SOL_PPPOL2TP) && HAVE_DECL_SOL_PPPOL2TP)) +#if defined(SOL_PPPOL2TP) || (defined(HAVE_DECL_SOL_PPPOL2TP) && HAVE_DECL_SOL_PPPOL2TP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_PPPOL2TP) == (273), "SOL_PPPOL2TP != 273"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_PPPOL2TP 273 #endif -#if !(defined(SOL_BLUETOOTH) || (defined(HAVE_DECL_SOL_BLUETOOTH) && HAVE_DECL_SOL_BLUETOOTH)) +#if defined(SOL_BLUETOOTH) || (defined(HAVE_DECL_SOL_BLUETOOTH) && HAVE_DECL_SOL_BLUETOOTH) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_BLUETOOTH) == (274), "SOL_BLUETOOTH != 274"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_BLUETOOTH 274 #endif -#if !(defined(SOL_PNPIPE) || (defined(HAVE_DECL_SOL_PNPIPE) && HAVE_DECL_SOL_PNPIPE)) +#if defined(SOL_PNPIPE) || (defined(HAVE_DECL_SOL_PNPIPE) && HAVE_DECL_SOL_PNPIPE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_PNPIPE) == (275), "SOL_PNPIPE != 275"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_PNPIPE 275 #endif -#if !(defined(SOL_RDS) || (defined(HAVE_DECL_SOL_RDS) && HAVE_DECL_SOL_RDS)) +#if defined(SOL_RDS) || (defined(HAVE_DECL_SOL_RDS) && HAVE_DECL_SOL_RDS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_RDS) == (276), "SOL_RDS != 276"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_RDS 276 #endif -#if !(defined(SOL_IUCV) || (defined(HAVE_DECL_SOL_IUCV) && HAVE_DECL_SOL_IUCV)) +#if defined(SOL_IUCV) || (defined(HAVE_DECL_SOL_IUCV) && HAVE_DECL_SOL_IUCV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_IUCV) == (277), "SOL_IUCV != 277"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_IUCV 277 #endif -#if !(defined(SOL_CAIF) || (defined(HAVE_DECL_SOL_CAIF) && HAVE_DECL_SOL_CAIF)) +#if defined(SOL_CAIF) || (defined(HAVE_DECL_SOL_CAIF) && HAVE_DECL_SOL_CAIF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_CAIF) == (278), "SOL_CAIF != 278"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_CAIF 278 #endif -#if !(defined(SOL_ALG) || (defined(HAVE_DECL_SOL_ALG) && HAVE_DECL_SOL_ALG)) +#if defined(SOL_ALG) || (defined(HAVE_DECL_SOL_ALG) && HAVE_DECL_SOL_ALG) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_ALG) == (279), "SOL_ALG != 279"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_ALG 279 #endif -#if !(defined(SOL_NFC) || (defined(HAVE_DECL_SOL_NFC) && HAVE_DECL_SOL_NFC)) +#if defined(SOL_NFC) || (defined(HAVE_DECL_SOL_NFC) && HAVE_DECL_SOL_NFC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_NFC) == (280), "SOL_NFC != 280"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_NFC 280 #endif -#if !(defined(SOL_KCM) || (defined(HAVE_DECL_SOL_KCM) && HAVE_DECL_SOL_KCM)) +#if defined(SOL_KCM) || (defined(HAVE_DECL_SOL_KCM) && HAVE_DECL_SOL_KCM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_KCM) == (281), "SOL_KCM != 281"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SOL_KCM 281 #endif +#if defined(SOL_TLS) || (defined(HAVE_DECL_SOL_TLS) && HAVE_DECL_SOL_TLS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_TLS) == (282), "SOL_TLS != 282"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SOL_TLS 282 +#endif +#if defined(SOL_XDP) || (defined(HAVE_DECL_SOL_XDP) && HAVE_DECL_SOL_XDP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_XDP) == (283), "SOL_XDP != 283"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SOL_XDP 283 +#endif +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +#if defined(SOL_SOCKET) || (defined(HAVE_DECL_SOL_SOCKET) && HAVE_DECL_SOL_SOCKET) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOL_SOCKET) == (0xffff), "SOL_SOCKET != 0xffff"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SOL_SOCKET 0xffff +#endif +#endif + +#ifndef XLAT_MACROS_ONLY -#ifndef IN_MPERS +# ifndef IN_MPERS const struct xlat socketlayers[] = { + XLAT(SOL_IP), +#if !(defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__) XLAT(SOL_SOCKET), +#endif XLAT(SOL_TCP), XLAT(SOL_UDP), XLAT(SOL_IPV6), XLAT(SOL_ICMPV6), + XLAT(SOL_CAN_BASE), + XLAT(SOL_CAN_RAW), XLAT(SOL_SCTP), XLAT(SOL_UDPLITE), XLAT(SOL_RAW), @@ -143,7 +333,14 @@ const struct xlat socketlayers[] = { XLAT(SOL_ALG), XLAT(SOL_NFC), XLAT(SOL_KCM), + XLAT(SOL_TLS), + XLAT(SOL_XDP), +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ + XLAT(SOL_SOCKET), +#endif XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/socketlayers.in b/xlat/socketlayers.in index 7b0b86e3..fd44dd19 100644 --- a/xlat/socketlayers.in +++ b/xlat/socketlayers.in @@ -1,9 +1,14 @@ +/* sort -k2,2n */ SOL_IP 0 +#if !(defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__) SOL_SOCKET 1 +#endif SOL_TCP 6 SOL_UDP 17 SOL_IPV6 41 SOL_ICMPV6 58 +SOL_CAN_BASE 100 +SOL_CAN_RAW 101 SOL_SCTP 132 SOL_UDPLITE 136 SOL_RAW 255 @@ -33,3 +38,8 @@ SOL_CAIF 278 SOL_ALG 279 SOL_NFC 280 SOL_KCM 281 +SOL_TLS 282 +SOL_XDP 283 +#if defined __alpha__ || defined __hppa__ || defined __mips__ || defined __sparc__ +SOL_SOCKET 0xffff +#endif diff --git a/xlat/sockipoptions.h b/xlat/sockipoptions.h deleted file mode 100644 index 26d768f9..00000000 --- a/xlat/sockipoptions.h +++ /dev/null @@ -1,164 +0,0 @@ -/* Generated by ./xlat/gen.sh from ./xlat/sockipoptions.in; do not edit. */ - -#ifdef IN_MPERS - -# error static const struct xlat sockipoptions in mpers mode - -#else - -static -const struct xlat sockipoptions[] = { -#if defined(IP_TOS) || (defined(HAVE_DECL_IP_TOS) && HAVE_DECL_IP_TOS) - XLAT(IP_TOS), -#endif -#if defined(IP_TTL) || (defined(HAVE_DECL_IP_TTL) && HAVE_DECL_IP_TTL) - XLAT(IP_TTL), -#endif -#if defined(IP_HDRINCL) || (defined(HAVE_DECL_IP_HDRINCL) && HAVE_DECL_IP_HDRINCL) - XLAT(IP_HDRINCL), -#endif -#if defined(IP_OPTIONS) || (defined(HAVE_DECL_IP_OPTIONS) && HAVE_DECL_IP_OPTIONS) - XLAT(IP_OPTIONS), -#endif -#if defined(IP_ROUTER_ALERT) || (defined(HAVE_DECL_IP_ROUTER_ALERT) && HAVE_DECL_IP_ROUTER_ALERT) - XLAT(IP_ROUTER_ALERT), -#endif -#if defined(IP_RECVOPTIONS) || (defined(HAVE_DECL_IP_RECVOPTIONS) && HAVE_DECL_IP_RECVOPTIONS) - XLAT(IP_RECVOPTIONS), -#endif -#if defined(IP_RECVOPTS) || (defined(HAVE_DECL_IP_RECVOPTS) && HAVE_DECL_IP_RECVOPTS) - XLAT(IP_RECVOPTS), -#endif -#if defined(IP_RETOPTS) || (defined(HAVE_DECL_IP_RETOPTS) && HAVE_DECL_IP_RETOPTS) - XLAT(IP_RETOPTS), -#endif -#if defined(IP_RECVRETOPTS) || (defined(HAVE_DECL_IP_RECVRETOPTS) && HAVE_DECL_IP_RECVRETOPTS) - XLAT(IP_RECVRETOPTS), -#endif -#if defined(IP_RECVDSTADDR) || (defined(HAVE_DECL_IP_RECVDSTADDR) && HAVE_DECL_IP_RECVDSTADDR) - XLAT(IP_RECVDSTADDR), -#endif -#if defined(IP_PKTINFO) || (defined(HAVE_DECL_IP_PKTINFO) && HAVE_DECL_IP_PKTINFO) - XLAT(IP_PKTINFO), -#endif -#if defined(IP_PKTOPTIONS) || (defined(HAVE_DECL_IP_PKTOPTIONS) && HAVE_DECL_IP_PKTOPTIONS) - XLAT(IP_PKTOPTIONS), -#endif -#if defined(IP_MTU_DISCOVER) || (defined(HAVE_DECL_IP_MTU_DISCOVER) && HAVE_DECL_IP_MTU_DISCOVER) - XLAT(IP_MTU_DISCOVER), -#endif -#if defined(IP_RECVERR) || (defined(HAVE_DECL_IP_RECVERR) && HAVE_DECL_IP_RECVERR) - XLAT(IP_RECVERR), -#endif -#if defined(IP_RECVTTL) || (defined(HAVE_DECL_IP_RECVTTL) && HAVE_DECL_IP_RECVTTL) - XLAT(IP_RECVTTL), -#endif -#if defined(IP_RECVTOS) || (defined(HAVE_DECL_IP_RECVTOS) && HAVE_DECL_IP_RECVTOS) - XLAT(IP_RECVTOS), -#endif -#if defined(IP_MTU) || (defined(HAVE_DECL_IP_MTU) && HAVE_DECL_IP_MTU) - XLAT(IP_MTU), -#endif -#if defined(IP_MULTICAST_IF) || (defined(HAVE_DECL_IP_MULTICAST_IF) && HAVE_DECL_IP_MULTICAST_IF) - XLAT(IP_MULTICAST_IF), -#endif -#if defined(IP_MULTICAST_TTL) || (defined(HAVE_DECL_IP_MULTICAST_TTL) && HAVE_DECL_IP_MULTICAST_TTL) - XLAT(IP_MULTICAST_TTL), -#endif -#if defined(IP_MULTICAST_LOOP) || (defined(HAVE_DECL_IP_MULTICAST_LOOP) && HAVE_DECL_IP_MULTICAST_LOOP) - XLAT(IP_MULTICAST_LOOP), -#endif -#if defined(IP_ADD_MEMBERSHIP) || (defined(HAVE_DECL_IP_ADD_MEMBERSHIP) && HAVE_DECL_IP_ADD_MEMBERSHIP) - XLAT(IP_ADD_MEMBERSHIP), -#endif -#if defined(IP_DROP_MEMBERSHIP) || (defined(HAVE_DECL_IP_DROP_MEMBERSHIP) && HAVE_DECL_IP_DROP_MEMBERSHIP) - XLAT(IP_DROP_MEMBERSHIP), -#endif -#if defined(IP_BROADCAST_IF) || (defined(HAVE_DECL_IP_BROADCAST_IF) && HAVE_DECL_IP_BROADCAST_IF) - XLAT(IP_BROADCAST_IF), -#endif -#if defined(IP_RECVIFINDEX) || (defined(HAVE_DECL_IP_RECVIFINDEX) && HAVE_DECL_IP_RECVIFINDEX) - XLAT(IP_RECVIFINDEX), -#endif -#if defined(IP_MSFILTER) || (defined(HAVE_DECL_IP_MSFILTER) && HAVE_DECL_IP_MSFILTER) - XLAT(IP_MSFILTER), -#endif -#if defined(IP_FREEBIND) || (defined(HAVE_DECL_IP_FREEBIND) && HAVE_DECL_IP_FREEBIND) - XLAT(IP_FREEBIND), -#endif -#if defined(IP_IPSEC_POLICY) || (defined(HAVE_DECL_IP_IPSEC_POLICY) && HAVE_DECL_IP_IPSEC_POLICY) - XLAT(IP_IPSEC_POLICY), -#endif -#if defined(IP_XFRM_POLICY) || (defined(HAVE_DECL_IP_XFRM_POLICY) && HAVE_DECL_IP_XFRM_POLICY) - XLAT(IP_XFRM_POLICY), -#endif -#if defined(IP_PASSSEC) || (defined(HAVE_DECL_IP_PASSSEC) && HAVE_DECL_IP_PASSSEC) - XLAT(IP_PASSSEC), -#endif -#if defined(IP_TRANSPARENT) || (defined(HAVE_DECL_IP_TRANSPARENT) && HAVE_DECL_IP_TRANSPARENT) - XLAT(IP_TRANSPARENT), -#endif -#if defined(IP_ORIGDSTADDR) || (defined(HAVE_DECL_IP_ORIGDSTADDR) && HAVE_DECL_IP_ORIGDSTADDR) - XLAT(IP_ORIGDSTADDR), -#endif -#if defined(IP_RECVORIGDSTADDR) || (defined(HAVE_DECL_IP_RECVORIGDSTADDR) && HAVE_DECL_IP_RECVORIGDSTADDR) - XLAT(IP_RECVORIGDSTADDR), -#endif -#if defined(IP_MINTTL) || (defined(HAVE_DECL_IP_MINTTL) && HAVE_DECL_IP_MINTTL) - XLAT(IP_MINTTL), -#endif -#if defined(IP_NODEFRAG) || (defined(HAVE_DECL_IP_NODEFRAG) && HAVE_DECL_IP_NODEFRAG) - XLAT(IP_NODEFRAG), -#endif -#if defined(IP_CHECKSUM) || (defined(HAVE_DECL_IP_CHECKSUM) && HAVE_DECL_IP_CHECKSUM) - XLAT(IP_CHECKSUM), -#endif -#if defined(IP_BIND_ADDRESS_NO_PORT) || (defined(HAVE_DECL_IP_BIND_ADDRESS_NO_PORT) && HAVE_DECL_IP_BIND_ADDRESS_NO_PORT) - XLAT(IP_BIND_ADDRESS_NO_PORT), -#endif -#if defined(IP_RECVFRAGSIZE) || (defined(HAVE_DECL_IP_RECVFRAGSIZE) && HAVE_DECL_IP_RECVFRAGSIZE) - XLAT(IP_RECVFRAGSIZE), -#endif -#if defined(IP_UNBLOCK_SOURCE) || (defined(HAVE_DECL_IP_UNBLOCK_SOURCE) && HAVE_DECL_IP_UNBLOCK_SOURCE) - XLAT(IP_UNBLOCK_SOURCE), -#endif -#if defined(IP_BLOCK_SOURCE) || (defined(HAVE_DECL_IP_BLOCK_SOURCE) && HAVE_DECL_IP_BLOCK_SOURCE) - XLAT(IP_BLOCK_SOURCE), -#endif -#if defined(IP_ADD_SOURCE_MEMBERSHIP) || (defined(HAVE_DECL_IP_ADD_SOURCE_MEMBERSHIP) && HAVE_DECL_IP_ADD_SOURCE_MEMBERSHIP) - XLAT(IP_ADD_SOURCE_MEMBERSHIP), -#endif -#if defined(IP_DROP_SOURCE_MEMBERSHIP) || (defined(HAVE_DECL_IP_DROP_SOURCE_MEMBERSHIP) && HAVE_DECL_IP_DROP_SOURCE_MEMBERSHIP) - XLAT(IP_DROP_SOURCE_MEMBERSHIP), -#endif -#if defined(MCAST_JOIN_GROUP) || (defined(HAVE_DECL_MCAST_JOIN_GROUP) && HAVE_DECL_MCAST_JOIN_GROUP) - XLAT(MCAST_JOIN_GROUP), -#endif -#if defined(MCAST_BLOCK_SOURCE) || (defined(HAVE_DECL_MCAST_BLOCK_SOURCE) && HAVE_DECL_MCAST_BLOCK_SOURCE) - XLAT(MCAST_BLOCK_SOURCE), -#endif -#if defined(MCAST_UNBLOCK_SOURCE) || (defined(HAVE_DECL_MCAST_UNBLOCK_SOURCE) && HAVE_DECL_MCAST_UNBLOCK_SOURCE) - XLAT(MCAST_UNBLOCK_SOURCE), -#endif -#if defined(MCAST_LEAVE_GROUP) || (defined(HAVE_DECL_MCAST_LEAVE_GROUP) && HAVE_DECL_MCAST_LEAVE_GROUP) - XLAT(MCAST_LEAVE_GROUP), -#endif -#if defined(MCAST_JOIN_SOURCE_GROUP) || (defined(HAVE_DECL_MCAST_JOIN_SOURCE_GROUP) && HAVE_DECL_MCAST_JOIN_SOURCE_GROUP) - XLAT(MCAST_JOIN_SOURCE_GROUP), -#endif -#if defined(MCAST_LEAVE_SOURCE_GROUP) || (defined(HAVE_DECL_MCAST_LEAVE_SOURCE_GROUP) && HAVE_DECL_MCAST_LEAVE_SOURCE_GROUP) - XLAT(MCAST_LEAVE_SOURCE_GROUP), -#endif -#if defined(MCAST_MSFILTER) || (defined(HAVE_DECL_MCAST_MSFILTER) && HAVE_DECL_MCAST_MSFILTER) - XLAT(MCAST_MSFILTER), -#endif -#if defined(IP_MULTICAST_ALL) || (defined(HAVE_DECL_IP_MULTICAST_ALL) && HAVE_DECL_IP_MULTICAST_ALL) - XLAT(IP_MULTICAST_ALL), -#endif -#if defined(IP_UNICAST_IF) || (defined(HAVE_DECL_IP_UNICAST_IF) && HAVE_DECL_IP_UNICAST_IF) - XLAT(IP_UNICAST_IF), -#endif - XLAT_END -}; - -#endif /* !IN_MPERS */ diff --git a/xlat/sockipv6options.h b/xlat/sockipv6options.h deleted file mode 100644 index dd201a97..00000000 --- a/xlat/sockipv6options.h +++ /dev/null @@ -1,176 +0,0 @@ -/* Generated by ./xlat/gen.sh from ./xlat/sockipv6options.in; do not edit. */ - -#ifdef IN_MPERS - -# error static const struct xlat sockipv6options in mpers mode - -#else - -static -const struct xlat sockipv6options[] = { -#if defined(IPV6_ADDRFORM) || (defined(HAVE_DECL_IPV6_ADDRFORM) && HAVE_DECL_IPV6_ADDRFORM) - XLAT(IPV6_ADDRFORM), -#endif -#if defined(IPV6_2292PKTINFO) || (defined(HAVE_DECL_IPV6_2292PKTINFO) && HAVE_DECL_IPV6_2292PKTINFO) - XLAT(IPV6_2292PKTINFO), -#endif -#if defined(IPV6_2292HOPOPTS) || (defined(HAVE_DECL_IPV6_2292HOPOPTS) && HAVE_DECL_IPV6_2292HOPOPTS) - XLAT(IPV6_2292HOPOPTS), -#endif -#if defined(IPV6_2292DSTOPTS) || (defined(HAVE_DECL_IPV6_2292DSTOPTS) && HAVE_DECL_IPV6_2292DSTOPTS) - XLAT(IPV6_2292DSTOPTS), -#endif -#if defined(IPV6_2292RTHDR) || (defined(HAVE_DECL_IPV6_2292RTHDR) && HAVE_DECL_IPV6_2292RTHDR) - XLAT(IPV6_2292RTHDR), -#endif -#if defined(IPV6_2292PKTOPTIONS) || (defined(HAVE_DECL_IPV6_2292PKTOPTIONS) && HAVE_DECL_IPV6_2292PKTOPTIONS) - XLAT(IPV6_2292PKTOPTIONS), -#endif -#if defined(IPV6_CHECKSUM) || (defined(HAVE_DECL_IPV6_CHECKSUM) && HAVE_DECL_IPV6_CHECKSUM) - XLAT(IPV6_CHECKSUM), -#endif -#if defined(IPV6_2292HOPLIMIT) || (defined(HAVE_DECL_IPV6_2292HOPLIMIT) && HAVE_DECL_IPV6_2292HOPLIMIT) - XLAT(IPV6_2292HOPLIMIT), -#endif -#if defined(IPV6_NEXTHOP) || (defined(HAVE_DECL_IPV6_NEXTHOP) && HAVE_DECL_IPV6_NEXTHOP) - XLAT(IPV6_NEXTHOP), -#endif -#if defined(IPV6_AUTHHDR) || (defined(HAVE_DECL_IPV6_AUTHHDR) && HAVE_DECL_IPV6_AUTHHDR) - XLAT(IPV6_AUTHHDR), -#endif -#if defined(IPV6_FLOWINFO) || (defined(HAVE_DECL_IPV6_FLOWINFO) && HAVE_DECL_IPV6_FLOWINFO) - XLAT(IPV6_FLOWINFO), -#endif -#if defined(IPV6_UNICAST_HOPS) || (defined(HAVE_DECL_IPV6_UNICAST_HOPS) && HAVE_DECL_IPV6_UNICAST_HOPS) - XLAT(IPV6_UNICAST_HOPS), -#endif -#if defined(IPV6_MULTICAST_IF) || (defined(HAVE_DECL_IPV6_MULTICAST_IF) && HAVE_DECL_IPV6_MULTICAST_IF) - XLAT(IPV6_MULTICAST_IF), -#endif -#if defined(IPV6_MULTICAST_HOPS) || (defined(HAVE_DECL_IPV6_MULTICAST_HOPS) && HAVE_DECL_IPV6_MULTICAST_HOPS) - XLAT(IPV6_MULTICAST_HOPS), -#endif -#if defined(IPV6_MULTICAST_LOOP) || (defined(HAVE_DECL_IPV6_MULTICAST_LOOP) && HAVE_DECL_IPV6_MULTICAST_LOOP) - XLAT(IPV6_MULTICAST_LOOP), -#endif -#if defined(IPV6_ADD_MEMBERSHIP) || (defined(HAVE_DECL_IPV6_ADD_MEMBERSHIP) && HAVE_DECL_IPV6_ADD_MEMBERSHIP) - XLAT(IPV6_ADD_MEMBERSHIP), -#endif -#if defined(IPV6_DROP_MEMBERSHIP) || (defined(HAVE_DECL_IPV6_DROP_MEMBERSHIP) && HAVE_DECL_IPV6_DROP_MEMBERSHIP) - XLAT(IPV6_DROP_MEMBERSHIP), -#endif -#if defined(IPV6_ROUTER_ALERT) || (defined(HAVE_DECL_IPV6_ROUTER_ALERT) && HAVE_DECL_IPV6_ROUTER_ALERT) - XLAT(IPV6_ROUTER_ALERT), -#endif -#if defined(IPV6_MTU_DISCOVER) || (defined(HAVE_DECL_IPV6_MTU_DISCOVER) && HAVE_DECL_IPV6_MTU_DISCOVER) - XLAT(IPV6_MTU_DISCOVER), -#endif -#if defined(IPV6_MTU) || (defined(HAVE_DECL_IPV6_MTU) && HAVE_DECL_IPV6_MTU) - XLAT(IPV6_MTU), -#endif -#if defined(IPV6_RECVERR) || (defined(HAVE_DECL_IPV6_RECVERR) && HAVE_DECL_IPV6_RECVERR) - XLAT(IPV6_RECVERR), -#endif -#if defined(IPV6_V6ONLY) || (defined(HAVE_DECL_IPV6_V6ONLY) && HAVE_DECL_IPV6_V6ONLY) - XLAT(IPV6_V6ONLY), -#endif -#if defined(IPV6_JOIN_ANYCAST) || (defined(HAVE_DECL_IPV6_JOIN_ANYCAST) && HAVE_DECL_IPV6_JOIN_ANYCAST) - XLAT(IPV6_JOIN_ANYCAST), -#endif -#if defined(IPV6_LEAVE_ANYCAST) || (defined(HAVE_DECL_IPV6_LEAVE_ANYCAST) && HAVE_DECL_IPV6_LEAVE_ANYCAST) - XLAT(IPV6_LEAVE_ANYCAST), -#endif -#if defined(IPV6_FLOWLABEL_MGR) || (defined(HAVE_DECL_IPV6_FLOWLABEL_MGR) && HAVE_DECL_IPV6_FLOWLABEL_MGR) - XLAT(IPV6_FLOWLABEL_MGR), -#endif -#if defined(IPV6_FLOWINFO_SEND) || (defined(HAVE_DECL_IPV6_FLOWINFO_SEND) && HAVE_DECL_IPV6_FLOWINFO_SEND) - XLAT(IPV6_FLOWINFO_SEND), -#endif -#if defined(IPV6_IPSEC_POLICY) || (defined(HAVE_DECL_IPV6_IPSEC_POLICY) && HAVE_DECL_IPV6_IPSEC_POLICY) - XLAT(IPV6_IPSEC_POLICY), -#endif -#if defined(IPV6_XFRM_POLICY) || (defined(HAVE_DECL_IPV6_XFRM_POLICY) && HAVE_DECL_IPV6_XFRM_POLICY) - XLAT(IPV6_XFRM_POLICY), -#endif -#if defined(IPV6_HDRINCL) || (defined(HAVE_DECL_IPV6_HDRINCL) && HAVE_DECL_IPV6_HDRINCL) - XLAT(IPV6_HDRINCL), -#endif -#if defined(IPV6_RECVPKTINFO) || (defined(HAVE_DECL_IPV6_RECVPKTINFO) && HAVE_DECL_IPV6_RECVPKTINFO) - XLAT(IPV6_RECVPKTINFO), -#endif -#if defined(IPV6_PKTINFO) || (defined(HAVE_DECL_IPV6_PKTINFO) && HAVE_DECL_IPV6_PKTINFO) - XLAT(IPV6_PKTINFO), -#endif -#if defined(IPV6_RECVHOPLIMIT) || (defined(HAVE_DECL_IPV6_RECVHOPLIMIT) && HAVE_DECL_IPV6_RECVHOPLIMIT) - XLAT(IPV6_RECVHOPLIMIT), -#endif -#if defined(IPV6_HOPLIMIT) || (defined(HAVE_DECL_IPV6_HOPLIMIT) && HAVE_DECL_IPV6_HOPLIMIT) - XLAT(IPV6_HOPLIMIT), -#endif -#if defined(IPV6_RECVHOPOPTS) || (defined(HAVE_DECL_IPV6_RECVHOPOPTS) && HAVE_DECL_IPV6_RECVHOPOPTS) - XLAT(IPV6_RECVHOPOPTS), -#endif -#if defined(IPV6_HOPOPTS) || (defined(HAVE_DECL_IPV6_HOPOPTS) && HAVE_DECL_IPV6_HOPOPTS) - XLAT(IPV6_HOPOPTS), -#endif -#if defined(IPV6_RTHDRDSTOPTS) || (defined(HAVE_DECL_IPV6_RTHDRDSTOPTS) && HAVE_DECL_IPV6_RTHDRDSTOPTS) - XLAT(IPV6_RTHDRDSTOPTS), -#endif -#if defined(IPV6_RECVRTHDR) || (defined(HAVE_DECL_IPV6_RECVRTHDR) && HAVE_DECL_IPV6_RECVRTHDR) - XLAT(IPV6_RECVRTHDR), -#endif -#if defined(IPV6_RTHDR) || (defined(HAVE_DECL_IPV6_RTHDR) && HAVE_DECL_IPV6_RTHDR) - XLAT(IPV6_RTHDR), -#endif -#if defined(IPV6_RECVDSTOPTS) || (defined(HAVE_DECL_IPV6_RECVDSTOPTS) && HAVE_DECL_IPV6_RECVDSTOPTS) - XLAT(IPV6_RECVDSTOPTS), -#endif -#if defined(IPV6_DSTOPTS) || (defined(HAVE_DECL_IPV6_DSTOPTS) && HAVE_DECL_IPV6_DSTOPTS) - XLAT(IPV6_DSTOPTS), -#endif -#if defined(IPV6_RECVPATHMTU) || (defined(HAVE_DECL_IPV6_RECVPATHMTU) && HAVE_DECL_IPV6_RECVPATHMTU) - XLAT(IPV6_RECVPATHMTU), -#endif -#if defined(IPV6_PATHMTU) || (defined(HAVE_DECL_IPV6_PATHMTU) && HAVE_DECL_IPV6_PATHMTU) - XLAT(IPV6_PATHMTU), -#endif -#if defined(IPV6_DONTFRAG) || (defined(HAVE_DECL_IPV6_DONTFRAG) && HAVE_DECL_IPV6_DONTFRAG) - XLAT(IPV6_DONTFRAG), -#endif -#if defined(IPV6_USE_MIN_MTU) || (defined(HAVE_DECL_IPV6_USE_MIN_MTU) && HAVE_DECL_IPV6_USE_MIN_MTU) - XLAT(IPV6_USE_MIN_MTU), -#endif -#if defined(IPV6_RECVTCLASS) || (defined(HAVE_DECL_IPV6_RECVTCLASS) && HAVE_DECL_IPV6_RECVTCLASS) - XLAT(IPV6_RECVTCLASS), -#endif -#if defined(IPV6_TCLASS) || (defined(HAVE_DECL_IPV6_TCLASS) && HAVE_DECL_IPV6_TCLASS) - XLAT(IPV6_TCLASS), -#endif -#if defined(IPV6_AUTOFLOWLABEL) || (defined(HAVE_DECL_IPV6_AUTOFLOWLABEL) && HAVE_DECL_IPV6_AUTOFLOWLABEL) - XLAT(IPV6_AUTOFLOWLABEL), -#endif -#if defined(IPV6_ADDR_PREFERENCES) || (defined(HAVE_DECL_IPV6_ADDR_PREFERENCES) && HAVE_DECL_IPV6_ADDR_PREFERENCES) - XLAT(IPV6_ADDR_PREFERENCES), -#endif -#if defined(IPV6_MINHOPCOUNT) || (defined(HAVE_DECL_IPV6_MINHOPCOUNT) && HAVE_DECL_IPV6_MINHOPCOUNT) - XLAT(IPV6_MINHOPCOUNT), -#endif -#if defined(IPV6_ORIGDSTADDR) || (defined(HAVE_DECL_IPV6_ORIGDSTADDR) && HAVE_DECL_IPV6_ORIGDSTADDR) - XLAT(IPV6_ORIGDSTADDR), -#endif -#if defined(IPV6_RECVORIGDSTADDR) || (defined(HAVE_DECL_IPV6_RECVORIGDSTADDR) && HAVE_DECL_IPV6_RECVORIGDSTADDR) - XLAT(IPV6_RECVORIGDSTADDR), -#endif -#if defined(IPV6_TRANSPARENT) || (defined(HAVE_DECL_IPV6_TRANSPARENT) && HAVE_DECL_IPV6_TRANSPARENT) - XLAT(IPV6_TRANSPARENT), -#endif -#if defined(IPV6_UNICAST_IF) || (defined(HAVE_DECL_IPV6_UNICAST_IF) && HAVE_DECL_IPV6_UNICAST_IF) - XLAT(IPV6_UNICAST_IF), -#endif -#if defined(IPV6_RECVFRAGSIZE) || (defined(HAVE_DECL_IPV6_RECVFRAGSIZE) && HAVE_DECL_IPV6_RECVFRAGSIZE) - XLAT(IPV6_RECVFRAGSIZE), -#endif - XLAT_END -}; - -#endif /* !IN_MPERS */ diff --git a/xlat/sockipv6options.in b/xlat/sockipv6options.in deleted file mode 100644 index 56e2721d..00000000 --- a/xlat/sockipv6options.in +++ /dev/null @@ -1,54 +0,0 @@ -IPV6_ADDRFORM -IPV6_2292PKTINFO -IPV6_2292HOPOPTS -IPV6_2292DSTOPTS -IPV6_2292RTHDR -IPV6_2292PKTOPTIONS -IPV6_CHECKSUM -IPV6_2292HOPLIMIT -IPV6_NEXTHOP -IPV6_AUTHHDR -IPV6_FLOWINFO -IPV6_UNICAST_HOPS -IPV6_MULTICAST_IF -IPV6_MULTICAST_HOPS -IPV6_MULTICAST_LOOP -IPV6_ADD_MEMBERSHIP -IPV6_DROP_MEMBERSHIP -IPV6_ROUTER_ALERT -IPV6_MTU_DISCOVER -IPV6_MTU -IPV6_RECVERR -IPV6_V6ONLY -IPV6_JOIN_ANYCAST -IPV6_LEAVE_ANYCAST -IPV6_FLOWLABEL_MGR -IPV6_FLOWINFO_SEND -IPV6_IPSEC_POLICY -IPV6_XFRM_POLICY -IPV6_HDRINCL -IPV6_RECVPKTINFO -IPV6_PKTINFO -IPV6_RECVHOPLIMIT -IPV6_HOPLIMIT -IPV6_RECVHOPOPTS -IPV6_HOPOPTS -IPV6_RTHDRDSTOPTS -IPV6_RECVRTHDR -IPV6_RTHDR -IPV6_RECVDSTOPTS -IPV6_DSTOPTS -IPV6_RECVPATHMTU -IPV6_PATHMTU -IPV6_DONTFRAG -IPV6_USE_MIN_MTU -IPV6_RECVTCLASS -IPV6_TCLASS -IPV6_AUTOFLOWLABEL -IPV6_ADDR_PREFERENCES -IPV6_MINHOPCOUNT -IPV6_ORIGDSTADDR -IPV6_RECVORIGDSTADDR -IPV6_TRANSPARENT -IPV6_UNICAST_IF -IPV6_RECVFRAGSIZE diff --git a/xlat/sockipxoptions.h b/xlat/sockipxoptions.h deleted file mode 100644 index 0e92f0ea..00000000 --- a/xlat/sockipxoptions.h +++ /dev/null @@ -1,17 +0,0 @@ -/* Generated by ./xlat/gen.sh from ./xlat/sockipxoptions.in; do not edit. */ - -#ifdef IN_MPERS - -# error static const struct xlat sockipxoptions in mpers mode - -#else - -static -const struct xlat sockipxoptions[] = { -#if defined(IPX_TYPE) || (defined(HAVE_DECL_IPX_TYPE) && HAVE_DECL_IPX_TYPE) - XLAT(IPX_TYPE), -#endif - XLAT_END -}; - -#endif /* !IN_MPERS */ diff --git a/xlat/sockoptions.h b/xlat/sockoptions.h deleted file mode 100644 index 87d570f1..00000000 --- a/xlat/sockoptions.h +++ /dev/null @@ -1,213 +0,0 @@ -/* Generated by ./xlat/gen.sh from ./xlat/sockoptions.in; do not edit. */ - -#ifdef IN_MPERS - -# error static const struct xlat sockoptions in mpers mode - -#else - -static -const struct xlat sockoptions[] = { -#if defined(SO_DEBUG) || (defined(HAVE_DECL_SO_DEBUG) && HAVE_DECL_SO_DEBUG) - XLAT(SO_DEBUG), -#endif -#if defined(SO_REUSEADDR) || (defined(HAVE_DECL_SO_REUSEADDR) && HAVE_DECL_SO_REUSEADDR) - XLAT(SO_REUSEADDR), -#endif -#if defined(SO_TYPE) || (defined(HAVE_DECL_SO_TYPE) && HAVE_DECL_SO_TYPE) - XLAT(SO_TYPE), -#endif -#if defined(SO_ERROR) || (defined(HAVE_DECL_SO_ERROR) && HAVE_DECL_SO_ERROR) - XLAT(SO_ERROR), -#endif -#if defined(SO_DONTROUTE) || (defined(HAVE_DECL_SO_DONTROUTE) && HAVE_DECL_SO_DONTROUTE) - XLAT(SO_DONTROUTE), -#endif -#if defined(SO_BROADCAST) || (defined(HAVE_DECL_SO_BROADCAST) && HAVE_DECL_SO_BROADCAST) - XLAT(SO_BROADCAST), -#endif -#if defined(SO_SNDBUF) || (defined(HAVE_DECL_SO_SNDBUF) && HAVE_DECL_SO_SNDBUF) - XLAT(SO_SNDBUF), -#endif -#if defined(SO_RCVBUF) || (defined(HAVE_DECL_SO_RCVBUF) && HAVE_DECL_SO_RCVBUF) - XLAT(SO_RCVBUF), -#endif -#if defined(SO_SNDBUFFORCE) || (defined(HAVE_DECL_SO_SNDBUFFORCE) && HAVE_DECL_SO_SNDBUFFORCE) - XLAT(SO_SNDBUFFORCE), -#endif -#if defined(SO_RCVBUFFORCE) || (defined(HAVE_DECL_SO_RCVBUFFORCE) && HAVE_DECL_SO_RCVBUFFORCE) - XLAT(SO_RCVBUFFORCE), -#endif -#if defined(SO_KEEPALIVE) || (defined(HAVE_DECL_SO_KEEPALIVE) && HAVE_DECL_SO_KEEPALIVE) - XLAT(SO_KEEPALIVE), -#endif -#if defined(SO_OOBINLINE) || (defined(HAVE_DECL_SO_OOBINLINE) && HAVE_DECL_SO_OOBINLINE) - XLAT(SO_OOBINLINE), -#endif -#if defined(SO_NO_CHECK) || (defined(HAVE_DECL_SO_NO_CHECK) && HAVE_DECL_SO_NO_CHECK) - XLAT(SO_NO_CHECK), -#endif -#if defined(SO_PRIORITY) || (defined(HAVE_DECL_SO_PRIORITY) && HAVE_DECL_SO_PRIORITY) - XLAT(SO_PRIORITY), -#endif -#if defined(SO_LINGER) || (defined(HAVE_DECL_SO_LINGER) && HAVE_DECL_SO_LINGER) - XLAT(SO_LINGER), -#endif -#if defined(SO_BSDCOMPAT) || (defined(HAVE_DECL_SO_BSDCOMPAT) && HAVE_DECL_SO_BSDCOMPAT) - XLAT(SO_BSDCOMPAT), -#endif -#if defined(SO_REUSEPORT) || (defined(HAVE_DECL_SO_REUSEPORT) && HAVE_DECL_SO_REUSEPORT) - XLAT(SO_REUSEPORT), -#endif -#if defined(SO_PASSCRED) || (defined(HAVE_DECL_SO_PASSCRED) && HAVE_DECL_SO_PASSCRED) - XLAT(SO_PASSCRED), -#endif -#if defined(SO_PEERCRED) || (defined(HAVE_DECL_SO_PEERCRED) && HAVE_DECL_SO_PEERCRED) - XLAT(SO_PEERCRED), -#endif -#if defined(SO_RCVLOWAT) || (defined(HAVE_DECL_SO_RCVLOWAT) && HAVE_DECL_SO_RCVLOWAT) - XLAT(SO_RCVLOWAT), -#endif -#if defined(SO_SNDLOWAT) || (defined(HAVE_DECL_SO_SNDLOWAT) && HAVE_DECL_SO_SNDLOWAT) - XLAT(SO_SNDLOWAT), -#endif -#if defined(SO_RCVTIMEO) || (defined(HAVE_DECL_SO_RCVTIMEO) && HAVE_DECL_SO_RCVTIMEO) - XLAT(SO_RCVTIMEO), -#endif -#if defined(SO_SNDTIMEO) || (defined(HAVE_DECL_SO_SNDTIMEO) && HAVE_DECL_SO_SNDTIMEO) - XLAT(SO_SNDTIMEO), -#endif -#if defined(SO_SECURITY_AUTHENTICATION) || (defined(HAVE_DECL_SO_SECURITY_AUTHENTICATION) && HAVE_DECL_SO_SECURITY_AUTHENTICATION) - XLAT(SO_SECURITY_AUTHENTICATION), -#endif -#if defined(SO_SECURITY_ENCRYPTION_TRANSPORT) || (defined(HAVE_DECL_SO_SECURITY_ENCRYPTION_TRANSPORT) && HAVE_DECL_SO_SECURITY_ENCRYPTION_TRANSPORT) - XLAT(SO_SECURITY_ENCRYPTION_TRANSPORT), -#endif -#if defined(SO_SECURITY_ENCRYPTION_NETWORK) || (defined(HAVE_DECL_SO_SECURITY_ENCRYPTION_NETWORK) && HAVE_DECL_SO_SECURITY_ENCRYPTION_NETWORK) - XLAT(SO_SECURITY_ENCRYPTION_NETWORK), -#endif -#if defined(SO_BINDTODEVICE) || (defined(HAVE_DECL_SO_BINDTODEVICE) && HAVE_DECL_SO_BINDTODEVICE) - XLAT(SO_BINDTODEVICE), -#endif -#if defined(SO_ATTACH_FILTER) || (defined(HAVE_DECL_SO_ATTACH_FILTER) && HAVE_DECL_SO_ATTACH_FILTER) - XLAT(SO_ATTACH_FILTER), -#endif -#if defined(SO_GET_FILTER) || (defined(HAVE_DECL_SO_GET_FILTER) && HAVE_DECL_SO_GET_FILTER) - XLAT(SO_GET_FILTER), -#endif -#if defined(SO_DETACH_FILTER) || (defined(HAVE_DECL_SO_DETACH_FILTER) && HAVE_DECL_SO_DETACH_FILTER) - XLAT(SO_DETACH_FILTER), -#endif -#if defined(SO_DETACH_BPF) || (defined(HAVE_DECL_SO_DETACH_BPF) && HAVE_DECL_SO_DETACH_BPF) - XLAT(SO_DETACH_BPF), -#endif -#if defined(SO_PEERNAME) || (defined(HAVE_DECL_SO_PEERNAME) && HAVE_DECL_SO_PEERNAME) - XLAT(SO_PEERNAME), -#endif -#if defined(SO_TIMESTAMP) || (defined(HAVE_DECL_SO_TIMESTAMP) && HAVE_DECL_SO_TIMESTAMP) - XLAT(SO_TIMESTAMP), -#endif -#if defined(SO_ACCEPTCONN) || (defined(HAVE_DECL_SO_ACCEPTCONN) && HAVE_DECL_SO_ACCEPTCONN) - XLAT(SO_ACCEPTCONN), -#endif -#if defined(SO_PEERSEC) || (defined(HAVE_DECL_SO_PEERSEC) && HAVE_DECL_SO_PEERSEC) - XLAT(SO_PEERSEC), -#endif -#if defined(SO_PASSSEC) || (defined(HAVE_DECL_SO_PASSSEC) && HAVE_DECL_SO_PASSSEC) - XLAT(SO_PASSSEC), -#endif -#if defined(SO_TIMESTAMPNS) || (defined(HAVE_DECL_SO_TIMESTAMPNS) && HAVE_DECL_SO_TIMESTAMPNS) - XLAT(SO_TIMESTAMPNS), -#endif -#if defined(SO_MARK) || (defined(HAVE_DECL_SO_MARK) && HAVE_DECL_SO_MARK) - XLAT(SO_MARK), -#endif -#if defined(SO_TIMESTAMPING) || (defined(HAVE_DECL_SO_TIMESTAMPING) && HAVE_DECL_SO_TIMESTAMPING) - XLAT(SO_TIMESTAMPING), -#endif -#if defined(SO_PROTOCOL) || (defined(HAVE_DECL_SO_PROTOCOL) && HAVE_DECL_SO_PROTOCOL) - XLAT(SO_PROTOCOL), -#endif -#if defined(SO_DOMAIN) || (defined(HAVE_DECL_SO_DOMAIN) && HAVE_DECL_SO_DOMAIN) - XLAT(SO_DOMAIN), -#endif -#if defined(SO_RXQ_OVFL) || (defined(HAVE_DECL_SO_RXQ_OVFL) && HAVE_DECL_SO_RXQ_OVFL) - XLAT(SO_RXQ_OVFL), -#endif -#if defined(SO_WIFI_STATUS) || (defined(HAVE_DECL_SO_WIFI_STATUS) && HAVE_DECL_SO_WIFI_STATUS) - XLAT(SO_WIFI_STATUS), -#endif -#if defined(SO_PEEK_OFF) || (defined(HAVE_DECL_SO_PEEK_OFF) && HAVE_DECL_SO_PEEK_OFF) - XLAT(SO_PEEK_OFF), -#endif -#if defined(SO_NOFCS) || (defined(HAVE_DECL_SO_NOFCS) && HAVE_DECL_SO_NOFCS) - XLAT(SO_NOFCS), -#endif -#if defined(SO_LOCK_FILTER) || (defined(HAVE_DECL_SO_LOCK_FILTER) && HAVE_DECL_SO_LOCK_FILTER) - XLAT(SO_LOCK_FILTER), -#endif -#if defined(SO_SELECT_ERR_QUEUE) || (defined(HAVE_DECL_SO_SELECT_ERR_QUEUE) && HAVE_DECL_SO_SELECT_ERR_QUEUE) - XLAT(SO_SELECT_ERR_QUEUE), -#endif -#if defined(SO_BUSY_POLL) || (defined(HAVE_DECL_SO_BUSY_POLL) && HAVE_DECL_SO_BUSY_POLL) - XLAT(SO_BUSY_POLL), -#endif -#if defined(SO_MAX_PACING_RATE) || (defined(HAVE_DECL_SO_MAX_PACING_RATE) && HAVE_DECL_SO_MAX_PACING_RATE) - XLAT(SO_MAX_PACING_RATE), -#endif -#if defined(SO_BPF_EXTENSIONS) || (defined(HAVE_DECL_SO_BPF_EXTENSIONS) && HAVE_DECL_SO_BPF_EXTENSIONS) - XLAT(SO_BPF_EXTENSIONS), -#endif -#if defined(SO_INCOMING_CPU) || (defined(HAVE_DECL_SO_INCOMING_CPU) && HAVE_DECL_SO_INCOMING_CPU) - XLAT(SO_INCOMING_CPU), -#endif -#if defined(SO_ATTACH_BPF) || (defined(HAVE_DECL_SO_ATTACH_BPF) && HAVE_DECL_SO_ATTACH_BPF) - XLAT(SO_ATTACH_BPF), -#endif -#if defined(SO_ATTACH_REUSEPORT_CBPF) || (defined(HAVE_DECL_SO_ATTACH_REUSEPORT_CBPF) && HAVE_DECL_SO_ATTACH_REUSEPORT_CBPF) - XLAT(SO_ATTACH_REUSEPORT_CBPF), -#endif -#if defined(SO_ATTACH_REUSEPORT_EBPF) || (defined(HAVE_DECL_SO_ATTACH_REUSEPORT_EBPF) && HAVE_DECL_SO_ATTACH_REUSEPORT_EBPF) - XLAT(SO_ATTACH_REUSEPORT_EBPF), -#endif -#if defined(SO_CNX_ADVICE) || (defined(HAVE_DECL_SO_CNX_ADVICE) && HAVE_DECL_SO_CNX_ADVICE) - XLAT(SO_CNX_ADVICE), -#endif - -#if defined(SO_ALLRAW) || (defined(HAVE_DECL_SO_ALLRAW) && HAVE_DECL_SO_ALLRAW) - XLAT(SO_ALLRAW), -#endif -#if defined(SO_ICS) || (defined(HAVE_DECL_SO_ICS) && HAVE_DECL_SO_ICS) - XLAT(SO_ICS), -#endif -#if defined(SO_IMASOCKET) || (defined(HAVE_DECL_SO_IMASOCKET) && HAVE_DECL_SO_IMASOCKET) - XLAT(SO_IMASOCKET), -#endif -#if defined(SO_LISTENING) || (defined(HAVE_DECL_SO_LISTENING) && HAVE_DECL_SO_LISTENING) - XLAT(SO_LISTENING), -#endif -#if defined(SO_MGMT) || (defined(HAVE_DECL_SO_MGMT) && HAVE_DECL_SO_MGMT) - XLAT(SO_MGMT), -#endif -#if defined(SO_ORDREL) || (defined(HAVE_DECL_SO_ORDREL) && HAVE_DECL_SO_ORDREL) - XLAT(SO_ORDREL), -#endif -#if defined(SO_PARALLELSVR) || (defined(HAVE_DECL_SO_PARALLELSVR) && HAVE_DECL_SO_PARALLELSVR) - XLAT(SO_PARALLELSVR), -#endif -#if defined(SO_PROTOTYPE) || (defined(HAVE_DECL_SO_PROTOTYPE) && HAVE_DECL_SO_PROTOTYPE) - XLAT(SO_PROTOTYPE), -#endif -#if defined(SO_RDWR) || (defined(HAVE_DECL_SO_RDWR) && HAVE_DECL_SO_RDWR) - XLAT(SO_RDWR), -#endif -#if defined(SO_SEMA) || (defined(HAVE_DECL_SO_SEMA) && HAVE_DECL_SO_SEMA) - XLAT(SO_SEMA), -#endif -#if defined(SO_USELOOPBACK) || (defined(HAVE_DECL_SO_USELOOPBACK) && HAVE_DECL_SO_USELOOPBACK) - XLAT(SO_USELOOPBACK), -#endif - XLAT_END -}; - -#endif /* !IN_MPERS */ diff --git a/xlat/sockoptions.in b/xlat/sockoptions.in deleted file mode 100644 index fce851a8..00000000 --- a/xlat/sockoptions.in +++ /dev/null @@ -1,67 +0,0 @@ -SO_DEBUG -SO_REUSEADDR -SO_TYPE -SO_ERROR -SO_DONTROUTE -SO_BROADCAST -SO_SNDBUF -SO_RCVBUF -SO_SNDBUFFORCE -SO_RCVBUFFORCE -SO_KEEPALIVE -SO_OOBINLINE -SO_NO_CHECK -SO_PRIORITY -SO_LINGER -SO_BSDCOMPAT -SO_REUSEPORT -SO_PASSCRED -SO_PEERCRED -SO_RCVLOWAT -SO_SNDLOWAT -SO_RCVTIMEO -SO_SNDTIMEO -SO_SECURITY_AUTHENTICATION -SO_SECURITY_ENCRYPTION_TRANSPORT -SO_SECURITY_ENCRYPTION_NETWORK -SO_BINDTODEVICE -SO_ATTACH_FILTER -SO_GET_FILTER -SO_DETACH_FILTER -SO_DETACH_BPF -SO_PEERNAME -SO_TIMESTAMP -SO_ACCEPTCONN -SO_PEERSEC -SO_PASSSEC -SO_TIMESTAMPNS -SO_MARK -SO_TIMESTAMPING -SO_PROTOCOL -SO_DOMAIN -SO_RXQ_OVFL -SO_WIFI_STATUS -SO_PEEK_OFF -SO_NOFCS -SO_LOCK_FILTER -SO_SELECT_ERR_QUEUE -SO_BUSY_POLL -SO_MAX_PACING_RATE -SO_BPF_EXTENSIONS -SO_INCOMING_CPU -SO_ATTACH_BPF -SO_ATTACH_REUSEPORT_CBPF -SO_ATTACH_REUSEPORT_EBPF -SO_CNX_ADVICE - -SO_ALLRAW -SO_ICS -SO_IMASOCKET -SO_LISTENING -SO_MGMT -SO_ORDREL -SO_PARALLELSVR -SO_PROTOTYPE -SO_RDWR -SO_SEMA -SO_USELOOPBACK diff --git a/xlat/sockpacketoptions.h b/xlat/sockpacketoptions.h deleted file mode 100644 index ae4c5f40..00000000 --- a/xlat/sockpacketoptions.h +++ /dev/null @@ -1,77 +0,0 @@ -/* Generated by ./xlat/gen.sh from ./xlat/sockpacketoptions.in; do not edit. */ - -#ifdef IN_MPERS - -# error static const struct xlat sockpacketoptions in mpers mode - -#else - -static -const struct xlat sockpacketoptions[] = { -#if defined(PACKET_ADD_MEMBERSHIP) || (defined(HAVE_DECL_PACKET_ADD_MEMBERSHIP) && HAVE_DECL_PACKET_ADD_MEMBERSHIP) - XLAT(PACKET_ADD_MEMBERSHIP), -#endif -#if defined(PACKET_DROP_MEMBERSHIP) || (defined(HAVE_DECL_PACKET_DROP_MEMBERSHIP) && HAVE_DECL_PACKET_DROP_MEMBERSHIP) - XLAT(PACKET_DROP_MEMBERSHIP), -#endif -#if defined(PACKET_RECV_OUTPUT) || (defined(HAVE_DECL_PACKET_RECV_OUTPUT) && HAVE_DECL_PACKET_RECV_OUTPUT) - XLAT(PACKET_RECV_OUTPUT), -#endif -#if defined(PACKET_RX_RING) || (defined(HAVE_DECL_PACKET_RX_RING) && HAVE_DECL_PACKET_RX_RING) - XLAT(PACKET_RX_RING), -#endif -#if defined(PACKET_STATISTICS) || (defined(HAVE_DECL_PACKET_STATISTICS) && HAVE_DECL_PACKET_STATISTICS) - XLAT(PACKET_STATISTICS), -#endif -#if defined(PACKET_COPY_THRESH) || (defined(HAVE_DECL_PACKET_COPY_THRESH) && HAVE_DECL_PACKET_COPY_THRESH) - XLAT(PACKET_COPY_THRESH), -#endif -#if defined(PACKET_AUXDATA) || (defined(HAVE_DECL_PACKET_AUXDATA) && HAVE_DECL_PACKET_AUXDATA) - XLAT(PACKET_AUXDATA), -#endif -#if defined(PACKET_ORIGDEV) || (defined(HAVE_DECL_PACKET_ORIGDEV) && HAVE_DECL_PACKET_ORIGDEV) - XLAT(PACKET_ORIGDEV), -#endif -#if defined(PACKET_VERSION) || (defined(HAVE_DECL_PACKET_VERSION) && HAVE_DECL_PACKET_VERSION) - XLAT(PACKET_VERSION), -#endif -#if defined(PACKET_HDRLEN) || (defined(HAVE_DECL_PACKET_HDRLEN) && HAVE_DECL_PACKET_HDRLEN) - XLAT(PACKET_HDRLEN), -#endif -#if defined(PACKET_RESERVE) || (defined(HAVE_DECL_PACKET_RESERVE) && HAVE_DECL_PACKET_RESERVE) - XLAT(PACKET_RESERVE), -#endif -#if defined(PACKET_TX_RING) || (defined(HAVE_DECL_PACKET_TX_RING) && HAVE_DECL_PACKET_TX_RING) - XLAT(PACKET_TX_RING), -#endif -#if defined(PACKET_LOSS) || (defined(HAVE_DECL_PACKET_LOSS) && HAVE_DECL_PACKET_LOSS) - XLAT(PACKET_LOSS), -#endif -#if defined(PACKET_VNET_HDR) || (defined(HAVE_DECL_PACKET_VNET_HDR) && HAVE_DECL_PACKET_VNET_HDR) - XLAT(PACKET_VNET_HDR), -#endif -#if defined(PACKET_TX_TIMESTAMP) || (defined(HAVE_DECL_PACKET_TX_TIMESTAMP) && HAVE_DECL_PACKET_TX_TIMESTAMP) - XLAT(PACKET_TX_TIMESTAMP), -#endif -#if defined(PACKET_TIMESTAMP) || (defined(HAVE_DECL_PACKET_TIMESTAMP) && HAVE_DECL_PACKET_TIMESTAMP) - XLAT(PACKET_TIMESTAMP), -#endif -#if defined(PACKET_FANOUT) || (defined(HAVE_DECL_PACKET_FANOUT) && HAVE_DECL_PACKET_FANOUT) - XLAT(PACKET_FANOUT), -#endif -#if defined(PACKET_TX_HAS_OFF) || (defined(HAVE_DECL_PACKET_TX_HAS_OFF) && HAVE_DECL_PACKET_TX_HAS_OFF) - XLAT(PACKET_TX_HAS_OFF), -#endif -#if defined(PACKET_QDISC_BYPASS) || (defined(HAVE_DECL_PACKET_QDISC_BYPASS) && HAVE_DECL_PACKET_QDISC_BYPASS) - XLAT(PACKET_QDISC_BYPASS), -#endif -#if defined(PACKET_ROLLOVER_STATS) || (defined(HAVE_DECL_PACKET_ROLLOVER_STATS) && HAVE_DECL_PACKET_ROLLOVER_STATS) - XLAT(PACKET_ROLLOVER_STATS), -#endif -#if defined(PACKET_FANOUT_DATA) || (defined(HAVE_DECL_PACKET_FANOUT_DATA) && HAVE_DECL_PACKET_FANOUT_DATA) - XLAT(PACKET_FANOUT_DATA), -#endif - XLAT_END -}; - -#endif /* !IN_MPERS */ diff --git a/xlat/sockrawoptions.h b/xlat/sockrawoptions.h deleted file mode 100644 index 99868c8e..00000000 --- a/xlat/sockrawoptions.h +++ /dev/null @@ -1,17 +0,0 @@ -/* Generated by ./xlat/gen.sh from ./xlat/sockrawoptions.in; do not edit. */ - -#ifdef IN_MPERS - -# error static const struct xlat sockrawoptions in mpers mode - -#else - -static -const struct xlat sockrawoptions[] = { -#if defined(ICMP_FILTER) || (defined(HAVE_DECL_ICMP_FILTER) && HAVE_DECL_ICMP_FILTER) - XLAT(ICMP_FILTER), -#endif - XLAT_END -}; - -#endif /* !IN_MPERS */ diff --git a/xlat/socksctpoptions.h b/xlat/socksctpoptions.h deleted file mode 100644 index cb34b9b6..00000000 --- a/xlat/socksctpoptions.h +++ /dev/null @@ -1,168 +0,0 @@ -/* Generated by ./xlat/gen.sh from ./xlat/socksctpoptions.in; do not edit. */ - -#ifdef IN_MPERS - -# error static const struct xlat socksctpoptions in mpers mode - -#else - -static -const struct xlat socksctpoptions[] = { -#if defined(SCTP_RTOINFO) || (defined(HAVE_DECL_SCTP_RTOINFO) && HAVE_DECL_SCTP_RTOINFO) - XLAT(SCTP_RTOINFO), -#endif -#if defined(SCTP_ASSOCINFO) || (defined(HAVE_DECL_SCTP_ASSOCINFO) && HAVE_DECL_SCTP_ASSOCINFO) - XLAT(SCTP_ASSOCINFO), -#endif -#if defined(SCTP_INITMSG) || (defined(HAVE_DECL_SCTP_INITMSG) && HAVE_DECL_SCTP_INITMSG) - XLAT(SCTP_INITMSG), -#endif -#if defined(SCTP_NODELAY) || (defined(HAVE_DECL_SCTP_NODELAY) && HAVE_DECL_SCTP_NODELAY) - XLAT(SCTP_NODELAY), -#endif -#if defined(SCTP_AUTOCLOSE) || (defined(HAVE_DECL_SCTP_AUTOCLOSE) && HAVE_DECL_SCTP_AUTOCLOSE) - XLAT(SCTP_AUTOCLOSE), -#endif -#if defined(SCTP_SET_PEER_PRIMARY_ADDR) || (defined(HAVE_DECL_SCTP_SET_PEER_PRIMARY_ADDR) && HAVE_DECL_SCTP_SET_PEER_PRIMARY_ADDR) - XLAT(SCTP_SET_PEER_PRIMARY_ADDR), -#endif -#if defined(SCTP_PRIMARY_ADDR) || (defined(HAVE_DECL_SCTP_PRIMARY_ADDR) && HAVE_DECL_SCTP_PRIMARY_ADDR) - XLAT(SCTP_PRIMARY_ADDR), -#endif -#if defined(SCTP_ADAPTATION_LAYER) || (defined(HAVE_DECL_SCTP_ADAPTATION_LAYER) && HAVE_DECL_SCTP_ADAPTATION_LAYER) - XLAT(SCTP_ADAPTATION_LAYER), -#endif -#if defined(SCTP_DISABLE_FRAGMENTS) || (defined(HAVE_DECL_SCTP_DISABLE_FRAGMENTS) && HAVE_DECL_SCTP_DISABLE_FRAGMENTS) - XLAT(SCTP_DISABLE_FRAGMENTS), -#endif -#if defined(SCTP_PEER_ADDR_PARAMS) || (defined(HAVE_DECL_SCTP_PEER_ADDR_PARAMS) && HAVE_DECL_SCTP_PEER_ADDR_PARAMS) - XLAT(SCTP_PEER_ADDR_PARAMS), -#endif -#if defined(SCTP_DEFAULT_SEND_PARAM) || (defined(HAVE_DECL_SCTP_DEFAULT_SEND_PARAM) && HAVE_DECL_SCTP_DEFAULT_SEND_PARAM) - XLAT(SCTP_DEFAULT_SEND_PARAM), -#endif -#if defined(SCTP_EVENTS) || (defined(HAVE_DECL_SCTP_EVENTS) && HAVE_DECL_SCTP_EVENTS) - XLAT(SCTP_EVENTS), -#endif -#if defined(SCTP_I_WANT_MAPPED_V4_ADDR) || (defined(HAVE_DECL_SCTP_I_WANT_MAPPED_V4_ADDR) && HAVE_DECL_SCTP_I_WANT_MAPPED_V4_ADDR) - XLAT(SCTP_I_WANT_MAPPED_V4_ADDR), -#endif -#if defined(SCTP_MAXSEG) || (defined(HAVE_DECL_SCTP_MAXSEG) && HAVE_DECL_SCTP_MAXSEG) - XLAT(SCTP_MAXSEG), -#endif -#if defined(SCTP_STATUS) || (defined(HAVE_DECL_SCTP_STATUS) && HAVE_DECL_SCTP_STATUS) - XLAT(SCTP_STATUS), -#endif -#if defined(SCTP_GET_PEER_ADDR_INFO) || (defined(HAVE_DECL_SCTP_GET_PEER_ADDR_INFO) && HAVE_DECL_SCTP_GET_PEER_ADDR_INFO) - XLAT(SCTP_GET_PEER_ADDR_INFO), -#endif -#if defined(SCTP_DELAYED_ACK) || (defined(HAVE_DECL_SCTP_DELAYED_ACK) && HAVE_DECL_SCTP_DELAYED_ACK) - XLAT(SCTP_DELAYED_ACK), -#endif -#if defined(SCTP_CONTEXT) || (defined(HAVE_DECL_SCTP_CONTEXT) && HAVE_DECL_SCTP_CONTEXT) - XLAT(SCTP_CONTEXT), -#endif -#if defined(SCTP_FRAGMENT_INTERLEAVE) || (defined(HAVE_DECL_SCTP_FRAGMENT_INTERLEAVE) && HAVE_DECL_SCTP_FRAGMENT_INTERLEAVE) - XLAT(SCTP_FRAGMENT_INTERLEAVE), -#endif -#if defined(SCTP_PARTIAL_DELIVERY_POINT) || (defined(HAVE_DECL_SCTP_PARTIAL_DELIVERY_POINT) && HAVE_DECL_SCTP_PARTIAL_DELIVERY_POINT) - XLAT(SCTP_PARTIAL_DELIVERY_POINT), -#endif -#if defined(SCTP_MAX_BURST) || (defined(HAVE_DECL_SCTP_MAX_BURST) && HAVE_DECL_SCTP_MAX_BURST) - XLAT(SCTP_MAX_BURST), -#endif -#if defined(SCTP_AUTH_CHUNK) || (defined(HAVE_DECL_SCTP_AUTH_CHUNK) && HAVE_DECL_SCTP_AUTH_CHUNK) - XLAT(SCTP_AUTH_CHUNK), -#endif -#if defined(SCTP_HMAC_IDENT) || (defined(HAVE_DECL_SCTP_HMAC_IDENT) && HAVE_DECL_SCTP_HMAC_IDENT) - XLAT(SCTP_HMAC_IDENT), -#endif -#if defined(SCTP_AUTH_KEY) || (defined(HAVE_DECL_SCTP_AUTH_KEY) && HAVE_DECL_SCTP_AUTH_KEY) - XLAT(SCTP_AUTH_KEY), -#endif -#if defined(SCTP_AUTH_ACTIVE_KEY) || (defined(HAVE_DECL_SCTP_AUTH_ACTIVE_KEY) && HAVE_DECL_SCTP_AUTH_ACTIVE_KEY) - XLAT(SCTP_AUTH_ACTIVE_KEY), -#endif -#if defined(SCTP_AUTH_DELETE_KEY) || (defined(HAVE_DECL_SCTP_AUTH_DELETE_KEY) && HAVE_DECL_SCTP_AUTH_DELETE_KEY) - XLAT(SCTP_AUTH_DELETE_KEY), -#endif -#if defined(SCTP_PEER_AUTH_CHUNKS) || (defined(HAVE_DECL_SCTP_PEER_AUTH_CHUNKS) && HAVE_DECL_SCTP_PEER_AUTH_CHUNKS) - XLAT(SCTP_PEER_AUTH_CHUNKS), -#endif -#if defined(SCTP_LOCAL_AUTH_CHUNKS) || (defined(HAVE_DECL_SCTP_LOCAL_AUTH_CHUNKS) && HAVE_DECL_SCTP_LOCAL_AUTH_CHUNKS) - XLAT(SCTP_LOCAL_AUTH_CHUNKS), -#endif -#if defined(SCTP_GET_ASSOC_NUMBER) || (defined(HAVE_DECL_SCTP_GET_ASSOC_NUMBER) && HAVE_DECL_SCTP_GET_ASSOC_NUMBER) - XLAT(SCTP_GET_ASSOC_NUMBER), -#endif -#if defined(SCTP_GET_ASSOC_ID_LIST) || (defined(HAVE_DECL_SCTP_GET_ASSOC_ID_LIST) && HAVE_DECL_SCTP_GET_ASSOC_ID_LIST) - XLAT(SCTP_GET_ASSOC_ID_LIST), -#endif -#if defined(SCTP_AUTO_ASCONF) || (defined(HAVE_DECL_SCTP_AUTO_ASCONF) && HAVE_DECL_SCTP_AUTO_ASCONF) - XLAT(SCTP_AUTO_ASCONF), -#endif -#if defined(SCTP_PEER_ADDR_THLDS) || (defined(HAVE_DECL_SCTP_PEER_ADDR_THLDS) && HAVE_DECL_SCTP_PEER_ADDR_THLDS) - XLAT(SCTP_PEER_ADDR_THLDS), -#endif -#if defined(SCTP_RECVRCVINFO) || (defined(HAVE_DECL_SCTP_RECVRCVINFO) && HAVE_DECL_SCTP_RECVRCVINFO) - XLAT(SCTP_RECVRCVINFO), -#endif -#if defined(SCTP_RECVNXTINFO) || (defined(HAVE_DECL_SCTP_RECVNXTINFO) && HAVE_DECL_SCTP_RECVNXTINFO) - XLAT(SCTP_RECVNXTINFO), -#endif -#if defined(SCTP_DEFAULT_SNDINFO) || (defined(HAVE_DECL_SCTP_DEFAULT_SNDINFO) && HAVE_DECL_SCTP_DEFAULT_SNDINFO) - XLAT(SCTP_DEFAULT_SNDINFO), -#endif -/* linux specific things */ -#if defined(SCTP_SOCKOPT_BINDX_ADD) || (defined(HAVE_DECL_SCTP_SOCKOPT_BINDX_ADD) && HAVE_DECL_SCTP_SOCKOPT_BINDX_ADD) - XLAT(SCTP_SOCKOPT_BINDX_ADD), -#endif -#if defined(SCTP_SOCKOPT_BINDX_REM) || (defined(HAVE_DECL_SCTP_SOCKOPT_BINDX_REM) && HAVE_DECL_SCTP_SOCKOPT_BINDX_REM) - XLAT(SCTP_SOCKOPT_BINDX_REM), -#endif -#if defined(SCTP_SOCKOPT_PEELOFF) || (defined(HAVE_DECL_SCTP_SOCKOPT_PEELOFF) && HAVE_DECL_SCTP_SOCKOPT_PEELOFF) - XLAT(SCTP_SOCKOPT_PEELOFF), -#endif -#if defined(SCTP_GET_PEER_ADDRS_NUM_OLD) || (defined(HAVE_DECL_SCTP_GET_PEER_ADDRS_NUM_OLD) && HAVE_DECL_SCTP_GET_PEER_ADDRS_NUM_OLD) - XLAT(SCTP_GET_PEER_ADDRS_NUM_OLD), -#endif -#if defined(SCTP_GET_PEER_ADDRS_OLD) || (defined(HAVE_DECL_SCTP_GET_PEER_ADDRS_OLD) && HAVE_DECL_SCTP_GET_PEER_ADDRS_OLD) - XLAT(SCTP_GET_PEER_ADDRS_OLD), -#endif -#if defined(SCTP_GET_LOCAL_ADDRS_NUM_OLD) || (defined(HAVE_DECL_SCTP_GET_LOCAL_ADDRS_NUM_OLD) && HAVE_DECL_SCTP_GET_LOCAL_ADDRS_NUM_OLD) - XLAT(SCTP_GET_LOCAL_ADDRS_NUM_OLD), -#endif -#if defined(SCTP_GET_LOCAL_ADDRS_OLD) || (defined(HAVE_DECL_SCTP_GET_LOCAL_ADDRS_OLD) && HAVE_DECL_SCTP_GET_LOCAL_ADDRS_OLD) - XLAT(SCTP_GET_LOCAL_ADDRS_OLD), -#endif -#if defined(SCTP_SOCKOPT_CONNECTX_OLD) || (defined(HAVE_DECL_SCTP_SOCKOPT_CONNECTX_OLD) && HAVE_DECL_SCTP_SOCKOPT_CONNECTX_OLD) - XLAT(SCTP_SOCKOPT_CONNECTX_OLD), -#endif -#if defined(SCTP_GET_PEER_ADDRS) || (defined(HAVE_DECL_SCTP_GET_PEER_ADDRS) && HAVE_DECL_SCTP_GET_PEER_ADDRS) - XLAT(SCTP_GET_PEER_ADDRS), -#endif -#if defined(SCTP_GET_LOCAL_ADDRS) || (defined(HAVE_DECL_SCTP_GET_LOCAL_ADDRS) && HAVE_DECL_SCTP_GET_LOCAL_ADDRS) - XLAT(SCTP_GET_LOCAL_ADDRS), -#endif -#if defined(SCTP_SOCKOPT_CONNECTX) || (defined(HAVE_DECL_SCTP_SOCKOPT_CONNECTX) && HAVE_DECL_SCTP_SOCKOPT_CONNECTX) - XLAT(SCTP_SOCKOPT_CONNECTX), -#endif -#if defined(SCTP_SOCKOPT_CONNECTX3) || (defined(HAVE_DECL_SCTP_SOCKOPT_CONNECTX3) && HAVE_DECL_SCTP_SOCKOPT_CONNECTX3) - XLAT(SCTP_SOCKOPT_CONNECTX3), -#endif -#if defined(SCTP_GET_ASSOC_STATS) || (defined(HAVE_DECL_SCTP_GET_ASSOC_STATS) && HAVE_DECL_SCTP_GET_ASSOC_STATS) - XLAT(SCTP_GET_ASSOC_STATS), -#endif -#if defined(SCTP_PR_SUPPORTED) || (defined(HAVE_DECL_SCTP_PR_SUPPORTED) && HAVE_DECL_SCTP_PR_SUPPORTED) - XLAT(SCTP_PR_SUPPORTED), -#endif -#if defined(SCTP_DEFAULT_PRINFO) || (defined(HAVE_DECL_SCTP_DEFAULT_PRINFO) && HAVE_DECL_SCTP_DEFAULT_PRINFO) - XLAT(SCTP_DEFAULT_PRINFO), -#endif -#if defined(SCTP_PR_ASSOC_STATUS) || (defined(HAVE_DECL_SCTP_PR_ASSOC_STATUS) && HAVE_DECL_SCTP_PR_ASSOC_STATUS) - XLAT(SCTP_PR_ASSOC_STATUS), -#endif - XLAT_END -}; - -#endif /* !IN_MPERS */ diff --git a/xlat/socksctpoptions.in b/xlat/socksctpoptions.in deleted file mode 100644 index fa967a23..00000000 --- a/xlat/socksctpoptions.in +++ /dev/null @@ -1,52 +0,0 @@ -SCTP_RTOINFO -SCTP_ASSOCINFO -SCTP_INITMSG -SCTP_NODELAY -SCTP_AUTOCLOSE -SCTP_SET_PEER_PRIMARY_ADDR -SCTP_PRIMARY_ADDR -SCTP_ADAPTATION_LAYER -SCTP_DISABLE_FRAGMENTS -SCTP_PEER_ADDR_PARAMS -SCTP_DEFAULT_SEND_PARAM -SCTP_EVENTS -SCTP_I_WANT_MAPPED_V4_ADDR -SCTP_MAXSEG -SCTP_STATUS -SCTP_GET_PEER_ADDR_INFO -SCTP_DELAYED_ACK -SCTP_CONTEXT -SCTP_FRAGMENT_INTERLEAVE -SCTP_PARTIAL_DELIVERY_POINT -SCTP_MAX_BURST -SCTP_AUTH_CHUNK -SCTP_HMAC_IDENT -SCTP_AUTH_KEY -SCTP_AUTH_ACTIVE_KEY -SCTP_AUTH_DELETE_KEY -SCTP_PEER_AUTH_CHUNKS -SCTP_LOCAL_AUTH_CHUNKS -SCTP_GET_ASSOC_NUMBER -SCTP_GET_ASSOC_ID_LIST -SCTP_AUTO_ASCONF -SCTP_PEER_ADDR_THLDS -SCTP_RECVRCVINFO -SCTP_RECVNXTINFO -SCTP_DEFAULT_SNDINFO -/* linux specific things */ -SCTP_SOCKOPT_BINDX_ADD -SCTP_SOCKOPT_BINDX_REM -SCTP_SOCKOPT_PEELOFF -SCTP_GET_PEER_ADDRS_NUM_OLD -SCTP_GET_PEER_ADDRS_OLD -SCTP_GET_LOCAL_ADDRS_NUM_OLD -SCTP_GET_LOCAL_ADDRS_OLD -SCTP_SOCKOPT_CONNECTX_OLD -SCTP_GET_PEER_ADDRS -SCTP_GET_LOCAL_ADDRS -SCTP_SOCKOPT_CONNECTX -SCTP_SOCKOPT_CONNECTX3 -SCTP_GET_ASSOC_STATS -SCTP_PR_SUPPORTED -SCTP_DEFAULT_PRINFO -SCTP_PR_ASSOC_STATUS diff --git a/xlat/socktcpoptions.h b/xlat/socktcpoptions.h deleted file mode 100644 index 7dd59239..00000000 --- a/xlat/socktcpoptions.h +++ /dev/null @@ -1,101 +0,0 @@ -/* Generated by ./xlat/gen.sh from ./xlat/socktcpoptions.in; do not edit. */ - -#ifdef IN_MPERS - -# error static const struct xlat socktcpoptions in mpers mode - -#else - -static -const struct xlat socktcpoptions[] = { -#if defined(TCP_NODELAY) || (defined(HAVE_DECL_TCP_NODELAY) && HAVE_DECL_TCP_NODELAY) - XLAT(TCP_NODELAY), -#endif -#if defined(TCP_MAXSEG) || (defined(HAVE_DECL_TCP_MAXSEG) && HAVE_DECL_TCP_MAXSEG) - XLAT(TCP_MAXSEG), -#endif -#if defined(TCP_CORK) || (defined(HAVE_DECL_TCP_CORK) && HAVE_DECL_TCP_CORK) - XLAT(TCP_CORK), -#endif -#if defined(TCP_KEEPIDLE) || (defined(HAVE_DECL_TCP_KEEPIDLE) && HAVE_DECL_TCP_KEEPIDLE) - XLAT(TCP_KEEPIDLE), -#endif -#if defined(TCP_KEEPINTVL) || (defined(HAVE_DECL_TCP_KEEPINTVL) && HAVE_DECL_TCP_KEEPINTVL) - XLAT(TCP_KEEPINTVL), -#endif -#if defined(TCP_KEEPCNT) || (defined(HAVE_DECL_TCP_KEEPCNT) && HAVE_DECL_TCP_KEEPCNT) - XLAT(TCP_KEEPCNT), -#endif -#if defined(TCP_SYNCNT) || (defined(HAVE_DECL_TCP_SYNCNT) && HAVE_DECL_TCP_SYNCNT) - XLAT(TCP_SYNCNT), -#endif -#if defined(TCP_LINGER2) || (defined(HAVE_DECL_TCP_LINGER2) && HAVE_DECL_TCP_LINGER2) - XLAT(TCP_LINGER2), -#endif -#if defined(TCP_DEFER_ACCEPT) || (defined(HAVE_DECL_TCP_DEFER_ACCEPT) && HAVE_DECL_TCP_DEFER_ACCEPT) - XLAT(TCP_DEFER_ACCEPT), -#endif -#if defined(TCP_WINDOW_CLAMP) || (defined(HAVE_DECL_TCP_WINDOW_CLAMP) && HAVE_DECL_TCP_WINDOW_CLAMP) - XLAT(TCP_WINDOW_CLAMP), -#endif -#if defined(TCP_INFO) || (defined(HAVE_DECL_TCP_INFO) && HAVE_DECL_TCP_INFO) - XLAT(TCP_INFO), -#endif -#if defined(TCP_QUICKACK) || (defined(HAVE_DECL_TCP_QUICKACK) && HAVE_DECL_TCP_QUICKACK) - XLAT(TCP_QUICKACK), -#endif -#if defined(TCP_CONGESTION) || (defined(HAVE_DECL_TCP_CONGESTION) && HAVE_DECL_TCP_CONGESTION) - XLAT(TCP_CONGESTION), -#endif -#if defined(TCP_MD5SIG) || (defined(HAVE_DECL_TCP_MD5SIG) && HAVE_DECL_TCP_MD5SIG) - XLAT(TCP_MD5SIG), -#endif -#if defined(TCP_COOKIE_TRANSACTIONS) || (defined(HAVE_DECL_TCP_COOKIE_TRANSACTIONS) && HAVE_DECL_TCP_COOKIE_TRANSACTIONS) - XLAT(TCP_COOKIE_TRANSACTIONS), -#endif -#if defined(TCP_THIN_LINEAR_TIMEOUTS) || (defined(HAVE_DECL_TCP_THIN_LINEAR_TIMEOUTS) && HAVE_DECL_TCP_THIN_LINEAR_TIMEOUTS) - XLAT(TCP_THIN_LINEAR_TIMEOUTS), -#endif -#if defined(TCP_THIN_DUPACK) || (defined(HAVE_DECL_TCP_THIN_DUPACK) && HAVE_DECL_TCP_THIN_DUPACK) - XLAT(TCP_THIN_DUPACK), -#endif -#if defined(TCP_USER_TIMEOUT) || (defined(HAVE_DECL_TCP_USER_TIMEOUT) && HAVE_DECL_TCP_USER_TIMEOUT) - XLAT(TCP_USER_TIMEOUT), -#endif -#if defined(TCP_REPAIR) || (defined(HAVE_DECL_TCP_REPAIR) && HAVE_DECL_TCP_REPAIR) - XLAT(TCP_REPAIR), -#endif -#if defined(TCP_REPAIR_QUEUE) || (defined(HAVE_DECL_TCP_REPAIR_QUEUE) && HAVE_DECL_TCP_REPAIR_QUEUE) - XLAT(TCP_REPAIR_QUEUE), -#endif -#if defined(TCP_QUEUE_SEQ) || (defined(HAVE_DECL_TCP_QUEUE_SEQ) && HAVE_DECL_TCP_QUEUE_SEQ) - XLAT(TCP_QUEUE_SEQ), -#endif -#if defined(TCP_REPAIR_OPTIONS) || (defined(HAVE_DECL_TCP_REPAIR_OPTIONS) && HAVE_DECL_TCP_REPAIR_OPTIONS) - XLAT(TCP_REPAIR_OPTIONS), -#endif -#if defined(TCP_FASTOPEN) || (defined(HAVE_DECL_TCP_FASTOPEN) && HAVE_DECL_TCP_FASTOPEN) - XLAT(TCP_FASTOPEN), -#endif -#if defined(TCP_TIMESTAMP) || (defined(HAVE_DECL_TCP_TIMESTAMP) && HAVE_DECL_TCP_TIMESTAMP) - XLAT(TCP_TIMESTAMP), -#endif -#if defined(TCP_NOTSENT_LOWAT) || (defined(HAVE_DECL_TCP_NOTSENT_LOWAT) && HAVE_DECL_TCP_NOTSENT_LOWAT) - XLAT(TCP_NOTSENT_LOWAT), -#endif -#if defined(TCP_CC_INFO) || (defined(HAVE_DECL_TCP_CC_INFO) && HAVE_DECL_TCP_CC_INFO) - XLAT(TCP_CC_INFO), -#endif -#if defined(TCP_SAVE_SYN) || (defined(HAVE_DECL_TCP_SAVE_SYN) && HAVE_DECL_TCP_SAVE_SYN) - XLAT(TCP_SAVE_SYN), -#endif -#if defined(TCP_SAVED_SYN) || (defined(HAVE_DECL_TCP_SAVED_SYN) && HAVE_DECL_TCP_SAVED_SYN) - XLAT(TCP_SAVED_SYN), -#endif -#if defined(TCP_REPAIR_WINDOW) || (defined(HAVE_DECL_TCP_REPAIR_WINDOW) && HAVE_DECL_TCP_REPAIR_WINDOW) - XLAT(TCP_REPAIR_WINDOW), -#endif - XLAT_END -}; - -#endif /* !IN_MPERS */ diff --git a/xlat/socktcpoptions.in b/xlat/socktcpoptions.in deleted file mode 100644 index 89bbd7ea..00000000 --- a/xlat/socktcpoptions.in +++ /dev/null @@ -1,29 +0,0 @@ -TCP_NODELAY -TCP_MAXSEG -TCP_CORK -TCP_KEEPIDLE -TCP_KEEPINTVL -TCP_KEEPCNT -TCP_SYNCNT -TCP_LINGER2 -TCP_DEFER_ACCEPT -TCP_WINDOW_CLAMP -TCP_INFO -TCP_QUICKACK -TCP_CONGESTION -TCP_MD5SIG -TCP_COOKIE_TRANSACTIONS -TCP_THIN_LINEAR_TIMEOUTS -TCP_THIN_DUPACK -TCP_USER_TIMEOUT -TCP_REPAIR -TCP_REPAIR_QUEUE -TCP_QUEUE_SEQ -TCP_REPAIR_OPTIONS -TCP_FASTOPEN -TCP_TIMESTAMP -TCP_NOTSENT_LOWAT -TCP_CC_INFO -TCP_SAVE_SYN -TCP_SAVED_SYN -TCP_REPAIR_WINDOW diff --git a/xlat/socktypes.h b/xlat/socktypes.h index f9db97bc..113ccb09 100644 --- a/xlat/socktypes.h +++ b/xlat/socktypes.h @@ -1,35 +1,95 @@ /* Generated by ./xlat/gen.sh from ./xlat/socktypes.in; do not edit. */ -#ifdef IN_MPERS - -# error static const struct xlat socktypes in mpers mode +#include "gcc_compat.h" +#include "static_assert.h" +#ifdef __mips__ +#if defined(SOCK_DGRAM) || (defined(HAVE_DECL_SOCK_DGRAM) && HAVE_DECL_SOCK_DGRAM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOCK_DGRAM) == (1), "SOCK_DGRAM != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SOCK_DGRAM 1 +#endif +#if defined(SOCK_STREAM) || (defined(HAVE_DECL_SOCK_STREAM) && HAVE_DECL_SOCK_STREAM) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOCK_STREAM) == (2), "SOCK_STREAM != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SOCK_STREAM 2 +#endif #else - -static -const struct xlat socktypes[] = { #if defined(SOCK_STREAM) || (defined(HAVE_DECL_SOCK_STREAM) && HAVE_DECL_SOCK_STREAM) - XLAT(SOCK_STREAM), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOCK_STREAM) == (1), "SOCK_STREAM != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SOCK_STREAM 1 #endif #if defined(SOCK_DGRAM) || (defined(HAVE_DECL_SOCK_DGRAM) && HAVE_DECL_SOCK_DGRAM) - XLAT(SOCK_DGRAM), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOCK_DGRAM) == (2), "SOCK_DGRAM != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SOCK_DGRAM 2 +#endif #endif #if defined(SOCK_RAW) || (defined(HAVE_DECL_SOCK_RAW) && HAVE_DECL_SOCK_RAW) - XLAT(SOCK_RAW), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOCK_RAW) == (3), "SOCK_RAW != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SOCK_RAW 3 #endif #if defined(SOCK_RDM) || (defined(HAVE_DECL_SOCK_RDM) && HAVE_DECL_SOCK_RDM) - XLAT(SOCK_RDM), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOCK_RDM) == (4), "SOCK_RDM != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SOCK_RDM 4 #endif #if defined(SOCK_SEQPACKET) || (defined(HAVE_DECL_SOCK_SEQPACKET) && HAVE_DECL_SOCK_SEQPACKET) - XLAT(SOCK_SEQPACKET), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOCK_SEQPACKET) == (5), "SOCK_SEQPACKET != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SOCK_SEQPACKET 5 #endif #if defined(SOCK_DCCP) || (defined(HAVE_DECL_SOCK_DCCP) && HAVE_DECL_SOCK_DCCP) - XLAT(SOCK_DCCP), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOCK_DCCP) == (6), "SOCK_DCCP != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SOCK_DCCP 6 #endif #if defined(SOCK_PACKET) || (defined(HAVE_DECL_SOCK_PACKET) && HAVE_DECL_SOCK_PACKET) - XLAT(SOCK_PACKET), +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SOCK_PACKET) == (10), "SOCK_PACKET != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SOCK_PACKET 10 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS + +const struct xlat socktypes[] = { +#ifdef __mips__ + XLAT(SOCK_DGRAM), + XLAT(SOCK_STREAM), +#else + XLAT(SOCK_STREAM), + XLAT(SOCK_DGRAM), #endif + XLAT(SOCK_RAW), + XLAT(SOCK_RDM), + XLAT(SOCK_SEQPACKET), + XLAT(SOCK_DCCP), + XLAT(SOCK_PACKET), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/socktypes.in b/xlat/socktypes.in index 4b3eadc9..678c2dae 100644 --- a/xlat/socktypes.in +++ b/xlat/socktypes.in @@ -1,7 +1,12 @@ -SOCK_STREAM -SOCK_DGRAM -SOCK_RAW -SOCK_RDM -SOCK_SEQPACKET -SOCK_DCCP -SOCK_PACKET +#ifdef __mips__ +SOCK_DGRAM 1 +SOCK_STREAM 2 +#else +SOCK_STREAM 1 +SOCK_DGRAM 2 +#endif +SOCK_RAW 3 +SOCK_RDM 4 +SOCK_SEQPACKET 5 +SOCK_DCCP 6 +SOCK_PACKET 10 diff --git a/xlat/sparc_kern_features.h b/xlat/sparc_kern_features.h new file mode 100644 index 00000000..0cc647c6 --- /dev/null +++ b/xlat/sparc_kern_features.h @@ -0,0 +1,30 @@ +/* Generated by ./xlat/gen.sh from ./xlat/sparc_kern_features.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(KERN_FEATURE_MIXED_MODE_STACK) || (defined(HAVE_DECL_KERN_FEATURE_MIXED_MODE_STACK) && HAVE_DECL_KERN_FEATURE_MIXED_MODE_STACK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((KERN_FEATURE_MIXED_MODE_STACK) == (1), "KERN_FEATURE_MIXED_MODE_STACK != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define KERN_FEATURE_MIXED_MODE_STACK 1 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sparc_kern_features in mpers mode + +# else + +static +const struct xlat sparc_kern_features[] = { + XLAT(KERN_FEATURE_MIXED_MODE_STACK), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sparc_kern_features.in b/xlat/sparc_kern_features.in new file mode 100644 index 00000000..6c4b2d70 --- /dev/null +++ b/xlat/sparc_kern_features.in @@ -0,0 +1 @@ +KERN_FEATURE_MIXED_MODE_STACK 1 diff --git a/xlat/splice_flags.h b/xlat/splice_flags.h index 5d305839..e0118330 100644 --- a/xlat/splice_flags.h +++ b/xlat/splice_flags.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/splice_flags.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat splice_flags in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat splice_flags in mpers mode + +# else static const struct xlat splice_flags[] = { @@ -23,4 +29,6 @@ const struct xlat splice_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sram_alloc_flags.h b/xlat/sram_alloc_flags.h index 009324fc..0c9a9c0e 100644 --- a/xlat/sram_alloc_flags.h +++ b/xlat/sram_alloc_flags.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/sram_alloc_flags.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat sram_alloc_flags in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sram_alloc_flags in mpers mode + +# else static const struct xlat sram_alloc_flags[] = { @@ -26,4 +32,6 @@ const struct xlat sram_alloc_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/statfs_flags.h b/xlat/statfs_flags.h index 149f57fd..caf60635 100644 --- a/xlat/statfs_flags.h +++ b/xlat/statfs_flags.h @@ -1,40 +1,86 @@ /* Generated by ./xlat/gen.sh from ./xlat/statfs_flags.in; do not edit. */ -#if !(defined(ST_VALID) || (defined(HAVE_DECL_ST_VALID) && HAVE_DECL_ST_VALID)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(ST_VALID) || (defined(HAVE_DECL_ST_VALID) && HAVE_DECL_ST_VALID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ST_VALID) == (0x0020), "ST_VALID != 0x0020"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define ST_VALID 0x0020 #endif -#if !(defined(ST_RDONLY) || (defined(HAVE_DECL_ST_RDONLY) && HAVE_DECL_ST_RDONLY)) +#if defined(ST_RDONLY) || (defined(HAVE_DECL_ST_RDONLY) && HAVE_DECL_ST_RDONLY) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ST_RDONLY) == (0x0001), "ST_RDONLY != 0x0001"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define ST_RDONLY 0x0001 #endif -#if !(defined(ST_NOSUID) || (defined(HAVE_DECL_ST_NOSUID) && HAVE_DECL_ST_NOSUID)) +#if defined(ST_NOSUID) || (defined(HAVE_DECL_ST_NOSUID) && HAVE_DECL_ST_NOSUID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ST_NOSUID) == (0x0002), "ST_NOSUID != 0x0002"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define ST_NOSUID 0x0002 #endif -#if !(defined(ST_NODEV) || (defined(HAVE_DECL_ST_NODEV) && HAVE_DECL_ST_NODEV)) +#if defined(ST_NODEV) || (defined(HAVE_DECL_ST_NODEV) && HAVE_DECL_ST_NODEV) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ST_NODEV) == (0x0004), "ST_NODEV != 0x0004"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define ST_NODEV 0x0004 #endif -#if !(defined(ST_NOEXEC) || (defined(HAVE_DECL_ST_NOEXEC) && HAVE_DECL_ST_NOEXEC)) +#if defined(ST_NOEXEC) || (defined(HAVE_DECL_ST_NOEXEC) && HAVE_DECL_ST_NOEXEC) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ST_NOEXEC) == (0x0008), "ST_NOEXEC != 0x0008"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define ST_NOEXEC 0x0008 #endif -#if !(defined(ST_SYNCHRONOUS) || (defined(HAVE_DECL_ST_SYNCHRONOUS) && HAVE_DECL_ST_SYNCHRONOUS)) +#if defined(ST_SYNCHRONOUS) || (defined(HAVE_DECL_ST_SYNCHRONOUS) && HAVE_DECL_ST_SYNCHRONOUS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ST_SYNCHRONOUS) == (0x0010), "ST_SYNCHRONOUS != 0x0010"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define ST_SYNCHRONOUS 0x0010 #endif -#if !(defined(ST_MANDLOCK) || (defined(HAVE_DECL_ST_MANDLOCK) && HAVE_DECL_ST_MANDLOCK)) +#if defined(ST_MANDLOCK) || (defined(HAVE_DECL_ST_MANDLOCK) && HAVE_DECL_ST_MANDLOCK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ST_MANDLOCK) == (0x0040), "ST_MANDLOCK != 0x0040"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define ST_MANDLOCK 0x0040 #endif -#if !(defined(ST_NOATIME) || (defined(HAVE_DECL_ST_NOATIME) && HAVE_DECL_ST_NOATIME)) +#if defined(ST_NOATIME) || (defined(HAVE_DECL_ST_NOATIME) && HAVE_DECL_ST_NOATIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ST_NOATIME) == (0x0400), "ST_NOATIME != 0x0400"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define ST_NOATIME 0x0400 #endif -#if !(defined(ST_NODIRATIME) || (defined(HAVE_DECL_ST_NODIRATIME) && HAVE_DECL_ST_NODIRATIME)) +#if defined(ST_NODIRATIME) || (defined(HAVE_DECL_ST_NODIRATIME) && HAVE_DECL_ST_NODIRATIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ST_NODIRATIME) == (0x0800), "ST_NODIRATIME != 0x0800"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define ST_NODIRATIME 0x0800 #endif -#if !(defined(ST_RELATIME) || (defined(HAVE_DECL_ST_RELATIME) && HAVE_DECL_ST_RELATIME)) +#if defined(ST_RELATIME) || (defined(HAVE_DECL_ST_RELATIME) && HAVE_DECL_ST_RELATIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((ST_RELATIME) == (0x1000), "ST_RELATIME != 0x1000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define ST_RELATIME 0x1000 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat statfs_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat statfs_flags in mpers mode + +# else static const struct xlat statfs_flags[] = { @@ -51,4 +97,6 @@ const struct xlat statfs_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/statx_attrs.h b/xlat/statx_attrs.h new file mode 100644 index 00000000..849ec0ed --- /dev/null +++ b/xlat/statx_attrs.h @@ -0,0 +1,70 @@ +/* Generated by ./xlat/gen.sh from ./xlat/statx_attrs.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(STATX_ATTR_COMPRESSED) || (defined(HAVE_DECL_STATX_ATTR_COMPRESSED) && HAVE_DECL_STATX_ATTR_COMPRESSED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STATX_ATTR_COMPRESSED) == (0x00000004), "STATX_ATTR_COMPRESSED != 0x00000004"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STATX_ATTR_COMPRESSED 0x00000004 +#endif +#if defined(STATX_ATTR_IMMUTABLE) || (defined(HAVE_DECL_STATX_ATTR_IMMUTABLE) && HAVE_DECL_STATX_ATTR_IMMUTABLE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STATX_ATTR_IMMUTABLE) == (0x00000010), "STATX_ATTR_IMMUTABLE != 0x00000010"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STATX_ATTR_IMMUTABLE 0x00000010 +#endif +#if defined(STATX_ATTR_APPEND) || (defined(HAVE_DECL_STATX_ATTR_APPEND) && HAVE_DECL_STATX_ATTR_APPEND) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STATX_ATTR_APPEND) == (0x00000020), "STATX_ATTR_APPEND != 0x00000020"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STATX_ATTR_APPEND 0x00000020 +#endif +#if defined(STATX_ATTR_NODUMP) || (defined(HAVE_DECL_STATX_ATTR_NODUMP) && HAVE_DECL_STATX_ATTR_NODUMP) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STATX_ATTR_NODUMP) == (0x00000040), "STATX_ATTR_NODUMP != 0x00000040"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STATX_ATTR_NODUMP 0x00000040 +#endif +#if defined(STATX_ATTR_ENCRYPTED) || (defined(HAVE_DECL_STATX_ATTR_ENCRYPTED) && HAVE_DECL_STATX_ATTR_ENCRYPTED) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STATX_ATTR_ENCRYPTED) == (0x00000800), "STATX_ATTR_ENCRYPTED != 0x00000800"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STATX_ATTR_ENCRYPTED 0x00000800 +#endif +#if defined(STATX_ATTR_AUTOMOUNT) || (defined(HAVE_DECL_STATX_ATTR_AUTOMOUNT) && HAVE_DECL_STATX_ATTR_AUTOMOUNT) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STATX_ATTR_AUTOMOUNT) == (0x00001000), "STATX_ATTR_AUTOMOUNT != 0x00001000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STATX_ATTR_AUTOMOUNT 0x00001000 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat statx_attrs in mpers mode + +# else + +static +const struct xlat statx_attrs[] = { + XLAT(STATX_ATTR_COMPRESSED), + XLAT(STATX_ATTR_IMMUTABLE), + XLAT(STATX_ATTR_APPEND), + XLAT(STATX_ATTR_NODUMP), + XLAT(STATX_ATTR_ENCRYPTED), + XLAT(STATX_ATTR_AUTOMOUNT), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/statx_attrs.in b/xlat/statx_attrs.in new file mode 100644 index 00000000..f6e40786 --- /dev/null +++ b/xlat/statx_attrs.in @@ -0,0 +1,6 @@ +STATX_ATTR_COMPRESSED 0x00000004 +STATX_ATTR_IMMUTABLE 0x00000010 +STATX_ATTR_APPEND 0x00000020 +STATX_ATTR_NODUMP 0x00000040 +STATX_ATTR_ENCRYPTED 0x00000800 +STATX_ATTR_AUTOMOUNT 0x00001000 diff --git a/xlat/statx_masks.h b/xlat/statx_masks.h new file mode 100644 index 00000000..f94ee8a5 --- /dev/null +++ b/xlat/statx_masks.h @@ -0,0 +1,135 @@ +/* Generated by ./xlat/gen.sh from ./xlat/statx_masks.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(STATX_ALL) || (defined(HAVE_DECL_STATX_ALL) && HAVE_DECL_STATX_ALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STATX_ALL) == (0x00000fffU), "STATX_ALL != 0x00000fffU"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STATX_ALL 0x00000fffU +#endif +#if defined(STATX_BASIC_STATS) || (defined(HAVE_DECL_STATX_BASIC_STATS) && HAVE_DECL_STATX_BASIC_STATS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STATX_BASIC_STATS) == (0x000007ffU), "STATX_BASIC_STATS != 0x000007ffU"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STATX_BASIC_STATS 0x000007ffU +#endif +#if defined(STATX_TYPE) || (defined(HAVE_DECL_STATX_TYPE) && HAVE_DECL_STATX_TYPE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STATX_TYPE) == (0x00000001U), "STATX_TYPE != 0x00000001U"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STATX_TYPE 0x00000001U +#endif +#if defined(STATX_MODE) || (defined(HAVE_DECL_STATX_MODE) && HAVE_DECL_STATX_MODE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STATX_MODE) == (0x00000002U), "STATX_MODE != 0x00000002U"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STATX_MODE 0x00000002U +#endif +#if defined(STATX_NLINK) || (defined(HAVE_DECL_STATX_NLINK) && HAVE_DECL_STATX_NLINK) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STATX_NLINK) == (0x00000004U), "STATX_NLINK != 0x00000004U"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STATX_NLINK 0x00000004U +#endif +#if defined(STATX_UID) || (defined(HAVE_DECL_STATX_UID) && HAVE_DECL_STATX_UID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STATX_UID) == (0x00000008U), "STATX_UID != 0x00000008U"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STATX_UID 0x00000008U +#endif +#if defined(STATX_GID) || (defined(HAVE_DECL_STATX_GID) && HAVE_DECL_STATX_GID) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STATX_GID) == (0x00000010U), "STATX_GID != 0x00000010U"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STATX_GID 0x00000010U +#endif +#if defined(STATX_ATIME) || (defined(HAVE_DECL_STATX_ATIME) && HAVE_DECL_STATX_ATIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STATX_ATIME) == (0x00000020U), "STATX_ATIME != 0x00000020U"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STATX_ATIME 0x00000020U +#endif +#if defined(STATX_MTIME) || (defined(HAVE_DECL_STATX_MTIME) && HAVE_DECL_STATX_MTIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STATX_MTIME) == (0x00000040U), "STATX_MTIME != 0x00000040U"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STATX_MTIME 0x00000040U +#endif +#if defined(STATX_CTIME) || (defined(HAVE_DECL_STATX_CTIME) && HAVE_DECL_STATX_CTIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STATX_CTIME) == (0x00000080U), "STATX_CTIME != 0x00000080U"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STATX_CTIME 0x00000080U +#endif +#if defined(STATX_INO) || (defined(HAVE_DECL_STATX_INO) && HAVE_DECL_STATX_INO) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STATX_INO) == (0x00000100U), "STATX_INO != 0x00000100U"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STATX_INO 0x00000100U +#endif +#if defined(STATX_SIZE) || (defined(HAVE_DECL_STATX_SIZE) && HAVE_DECL_STATX_SIZE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STATX_SIZE) == (0x00000200U), "STATX_SIZE != 0x00000200U"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STATX_SIZE 0x00000200U +#endif +#if defined(STATX_BLOCKS) || (defined(HAVE_DECL_STATX_BLOCKS) && HAVE_DECL_STATX_BLOCKS) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STATX_BLOCKS) == (0x00000400U), "STATX_BLOCKS != 0x00000400U"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STATX_BLOCKS 0x00000400U +#endif +#if defined(STATX_BTIME) || (defined(HAVE_DECL_STATX_BTIME) && HAVE_DECL_STATX_BTIME) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((STATX_BTIME) == (0x00000800U), "STATX_BTIME != 0x00000800U"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define STATX_BTIME 0x00000800U +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat statx_masks in mpers mode + +# else + +static +const struct xlat statx_masks[] = { + XLAT(STATX_ALL), + XLAT(STATX_BASIC_STATS), + + XLAT(STATX_TYPE), + XLAT(STATX_MODE), + XLAT(STATX_NLINK), + XLAT(STATX_UID), + XLAT(STATX_GID), + XLAT(STATX_ATIME), + XLAT(STATX_MTIME), + XLAT(STATX_CTIME), + XLAT(STATX_INO), + XLAT(STATX_SIZE), + XLAT(STATX_BLOCKS), + XLAT(STATX_BTIME), + XLAT_END +}; + +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/statx_masks.in b/xlat/statx_masks.in new file mode 100644 index 00000000..d18dd259 --- /dev/null +++ b/xlat/statx_masks.in @@ -0,0 +1,15 @@ +STATX_ALL 0x00000fffU +STATX_BASIC_STATS 0x000007ffU + +STATX_TYPE 0x00000001U +STATX_MODE 0x00000002U +STATX_NLINK 0x00000004U +STATX_UID 0x00000008U +STATX_GID 0x00000010U +STATX_ATIME 0x00000020U +STATX_MTIME 0x00000040U +STATX_CTIME 0x00000080U +STATX_INO 0x00000100U +STATX_SIZE 0x00000200U +STATX_BLOCKS 0x00000400U +STATX_BTIME 0x00000800U diff --git a/xlat/swap_flags.h b/xlat/swap_flags.h index 9baec44e..d03aa13f 100644 --- a/xlat/swap_flags.h +++ b/xlat/swap_flags.h @@ -1,22 +1,44 @@ /* Generated by ./xlat/gen.sh from ./xlat/swap_flags.in; do not edit. */ -#if !(defined(SWAP_FLAG_PREFER) || (defined(HAVE_DECL_SWAP_FLAG_PREFER) && HAVE_DECL_SWAP_FLAG_PREFER)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SWAP_FLAG_PREFER) || (defined(HAVE_DECL_SWAP_FLAG_PREFER) && HAVE_DECL_SWAP_FLAG_PREFER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SWAP_FLAG_PREFER) == (0x8000), "SWAP_FLAG_PREFER != 0x8000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SWAP_FLAG_PREFER 0x8000 #endif -#if !(defined(SWAP_FLAG_DISCARD) || (defined(HAVE_DECL_SWAP_FLAG_DISCARD) && HAVE_DECL_SWAP_FLAG_DISCARD)) +#if defined(SWAP_FLAG_DISCARD) || (defined(HAVE_DECL_SWAP_FLAG_DISCARD) && HAVE_DECL_SWAP_FLAG_DISCARD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SWAP_FLAG_DISCARD) == (0x10000), "SWAP_FLAG_DISCARD != 0x10000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SWAP_FLAG_DISCARD 0x10000 #endif -#if !(defined(SWAP_FLAG_DISCARD_ONCE) || (defined(HAVE_DECL_SWAP_FLAG_DISCARD_ONCE) && HAVE_DECL_SWAP_FLAG_DISCARD_ONCE)) +#if defined(SWAP_FLAG_DISCARD_ONCE) || (defined(HAVE_DECL_SWAP_FLAG_DISCARD_ONCE) && HAVE_DECL_SWAP_FLAG_DISCARD_ONCE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SWAP_FLAG_DISCARD_ONCE) == (0x20000), "SWAP_FLAG_DISCARD_ONCE != 0x20000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SWAP_FLAG_DISCARD_ONCE 0x20000 #endif -#if !(defined(SWAP_FLAG_DISCARD_PAGES) || (defined(HAVE_DECL_SWAP_FLAG_DISCARD_PAGES) && HAVE_DECL_SWAP_FLAG_DISCARD_PAGES)) +#if defined(SWAP_FLAG_DISCARD_PAGES) || (defined(HAVE_DECL_SWAP_FLAG_DISCARD_PAGES) && HAVE_DECL_SWAP_FLAG_DISCARD_PAGES) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SWAP_FLAG_DISCARD_PAGES) == (0x40000), "SWAP_FLAG_DISCARD_PAGES != 0x40000"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SWAP_FLAG_DISCARD_PAGES 0x40000 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat swap_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat swap_flags in mpers mode + +# else static const struct xlat swap_flags[] = { @@ -27,4 +49,6 @@ const struct xlat swap_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sync_file_range_flags.h b/xlat/sync_file_range_flags.h index 08d9ac1c..2d7de908 100644 --- a/xlat/sync_file_range_flags.h +++ b/xlat/sync_file_range_flags.h @@ -1,19 +1,37 @@ /* Generated by ./xlat/gen.sh from ./xlat/sync_file_range_flags.in; do not edit. */ -#if !(defined(SYNC_FILE_RANGE_WAIT_BEFORE) || (defined(HAVE_DECL_SYNC_FILE_RANGE_WAIT_BEFORE) && HAVE_DECL_SYNC_FILE_RANGE_WAIT_BEFORE)) + +#include "gcc_compat.h" +#include "static_assert.h" + +#if defined(SYNC_FILE_RANGE_WAIT_BEFORE) || (defined(HAVE_DECL_SYNC_FILE_RANGE_WAIT_BEFORE) && HAVE_DECL_SYNC_FILE_RANGE_WAIT_BEFORE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYNC_FILE_RANGE_WAIT_BEFORE) == (1), "SYNC_FILE_RANGE_WAIT_BEFORE != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYNC_FILE_RANGE_WAIT_BEFORE 1 #endif -#if !(defined(SYNC_FILE_RANGE_WRITE) || (defined(HAVE_DECL_SYNC_FILE_RANGE_WRITE) && HAVE_DECL_SYNC_FILE_RANGE_WRITE)) +#if defined(SYNC_FILE_RANGE_WRITE) || (defined(HAVE_DECL_SYNC_FILE_RANGE_WRITE) && HAVE_DECL_SYNC_FILE_RANGE_WRITE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYNC_FILE_RANGE_WRITE) == (2), "SYNC_FILE_RANGE_WRITE != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYNC_FILE_RANGE_WRITE 2 #endif -#if !(defined(SYNC_FILE_RANGE_WAIT_AFTER) || (defined(HAVE_DECL_SYNC_FILE_RANGE_WAIT_AFTER) && HAVE_DECL_SYNC_FILE_RANGE_WAIT_AFTER)) +#if defined(SYNC_FILE_RANGE_WAIT_AFTER) || (defined(HAVE_DECL_SYNC_FILE_RANGE_WAIT_AFTER) && HAVE_DECL_SYNC_FILE_RANGE_WAIT_AFTER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYNC_FILE_RANGE_WAIT_AFTER) == (4), "SYNC_FILE_RANGE_WAIT_AFTER != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else # define SYNC_FILE_RANGE_WAIT_AFTER 4 #endif -#ifdef IN_MPERS +#ifndef XLAT_MACROS_ONLY -# error static const struct xlat sync_file_range_flags in mpers mode +# ifdef IN_MPERS -#else +# error static const struct xlat sync_file_range_flags in mpers mode + +# else static const struct xlat sync_file_range_flags[] = { @@ -23,4 +41,6 @@ const struct xlat sync_file_range_flags[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sysctl_kern.h b/xlat/sysctl_kern.h index b7276da6..ea1acdb6 100644 --- a/xlat/sysctl_kern.h +++ b/xlat/sysctl_kern.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysctl_kern.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat sysctl_kern in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sysctl_kern in mpers mode + +# else static const struct xlat sysctl_kern[] = { @@ -107,8 +113,16 @@ const struct xlat sysctl_kern[] = { #endif #if defined(KERN_PANIC_ON_NMI) || (defined(HAVE_DECL_KERN_PANIC_ON_NMI) && HAVE_DECL_KERN_PANIC_ON_NMI) XLAT(KERN_PANIC_ON_NMI), +#endif +#if defined(KERN_PANIC_ON_WARN) || (defined(HAVE_DECL_KERN_PANIC_ON_WARN) && HAVE_DECL_KERN_PANIC_ON_WARN) + XLAT(KERN_PANIC_ON_WARN), +#endif +#if defined(KERN_PANIC_PRINT) || (defined(HAVE_DECL_KERN_PANIC_PRINT) && HAVE_DECL_KERN_PANIC_PRINT) + XLAT(KERN_PANIC_PRINT), #endif XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sysctl_kern.in b/xlat/sysctl_kern.in index b0568cea..f920f1f4 100644 --- a/xlat/sysctl_kern.in +++ b/xlat/sysctl_kern.in @@ -66,3 +66,5 @@ KERN_COMPAT_LOG KERN_MAX_LOCK_DEPTH KERN_NMI_WATCHDOG KERN_PANIC_ON_NMI +KERN_PANIC_ON_WARN +KERN_PANIC_PRINT diff --git a/xlat/sysctl_net.h b/xlat/sysctl_net.h index 864c548b..1e2b0c7a 100644 --- a/xlat/sysctl_net.h +++ b/xlat/sysctl_net.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysctl_net.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat sysctl_net in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sysctl_net in mpers mode + +# else static const struct xlat sysctl_net[] = { @@ -40,4 +46,6 @@ const struct xlat sysctl_net[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sysctl_net_core.h b/xlat/sysctl_net_core.h index d3db06cd..2cce965f 100644 --- a/xlat/sysctl_net_core.h +++ b/xlat/sysctl_net_core.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysctl_net_core.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat sysctl_net_core in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sysctl_net_core in mpers mode + +# else static const struct xlat sysctl_net_core[] = { @@ -43,4 +49,6 @@ const struct xlat sysctl_net_core[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sysctl_net_ipv4.h b/xlat/sysctl_net_ipv4.h index cd0a005c..fdf02041 100644 --- a/xlat/sysctl_net_ipv4.h +++ b/xlat/sysctl_net_ipv4.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysctl_net_ipv4.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat sysctl_net_ipv4 in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sysctl_net_ipv4 in mpers mode + +# else static const struct xlat sysctl_net_ipv4[] = { @@ -149,4 +155,6 @@ const struct xlat sysctl_net_ipv4[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sysctl_net_ipv4_conf.h b/xlat/sysctl_net_ipv4_conf.h index c9cd4dcb..892df339 100644 --- a/xlat/sysctl_net_ipv4_conf.h +++ b/xlat/sysctl_net_ipv4_conf.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysctl_net_ipv4_conf.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat sysctl_net_ipv4_conf in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sysctl_net_ipv4_conf in mpers mode + +# else static const struct xlat sysctl_net_ipv4_conf[] = { @@ -45,4 +51,6 @@ const struct xlat sysctl_net_ipv4_conf[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sysctl_net_ipv4_route.h b/xlat/sysctl_net_ipv4_route.h index 91983e40..4cb40adb 100644 --- a/xlat/sysctl_net_ipv4_route.h +++ b/xlat/sysctl_net_ipv4_route.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysctl_net_ipv4_route.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat sysctl_net_ipv4_route in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sysctl_net_ipv4_route in mpers mode + +# else static const struct xlat sysctl_net_ipv4_route[] = { @@ -32,4 +38,6 @@ const struct xlat sysctl_net_ipv4_route[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sysctl_net_ipv6.h b/xlat/sysctl_net_ipv6.h index c92a16cb..06b6c455 100644 --- a/xlat/sysctl_net_ipv6.h +++ b/xlat/sysctl_net_ipv6.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysctl_net_ipv6.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat sysctl_net_ipv6 in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sysctl_net_ipv6 in mpers mode + +# else static const struct xlat sysctl_net_ipv6[] = { @@ -23,4 +29,6 @@ const struct xlat sysctl_net_ipv6[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sysctl_net_ipv6_route.h b/xlat/sysctl_net_ipv6_route.h index cc976ff3..7bcf4bc4 100644 --- a/xlat/sysctl_net_ipv6_route.h +++ b/xlat/sysctl_net_ipv6_route.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysctl_net_ipv6_route.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat sysctl_net_ipv6_route in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sysctl_net_ipv6_route in mpers mode + +# else static const struct xlat sysctl_net_ipv6_route[] = { @@ -23,4 +29,6 @@ const struct xlat sysctl_net_ipv6_route[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sysctl_net_unix.h b/xlat/sysctl_net_unix.h index c940dab6..ea0043cd 100644 --- a/xlat/sysctl_net_unix.h +++ b/xlat/sysctl_net_unix.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysctl_net_unix.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat sysctl_net_unix in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sysctl_net_unix in mpers mode + +# else static const struct xlat sysctl_net_unix[] = { @@ -14,4 +20,6 @@ const struct xlat sysctl_net_unix[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sysctl_root.h b/xlat/sysctl_root.h index 0d4b0398..ddb7a2dd 100644 --- a/xlat/sysctl_root.h +++ b/xlat/sysctl_root.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysctl_root.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat sysctl_root in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sysctl_root in mpers mode + +# else static const struct xlat sysctl_root[] = { @@ -38,4 +44,6 @@ const struct xlat sysctl_root[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/sysctl_vm.h b/xlat/sysctl_vm.h index 36896a20..bb86bd8d 100644 --- a/xlat/sysctl_vm.h +++ b/xlat/sysctl_vm.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysctl_vm.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat sysctl_vm in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sysctl_vm in mpers mode + +# else static const struct xlat sysctl_vm[] = { @@ -45,4 +51,6 @@ const struct xlat sysctl_vm[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/syslog_action_type.h b/xlat/syslog_action_type.h index b4f543fe..b81b336e 100644 --- a/xlat/syslog_action_type.h +++ b/xlat/syslog_action_type.h @@ -1,25 +1,110 @@ /* Generated by ./xlat/gen.sh from ./xlat/syslog_action_type.in; do not edit. */ -#ifdef IN_MPERS - -# error static const struct xlat syslog_action_type in mpers mode +#include "gcc_compat.h" +#include "static_assert.h" +#if defined(SYSLOG_ACTION_CLOSE) || (defined(HAVE_DECL_SYSLOG_ACTION_CLOSE) && HAVE_DECL_SYSLOG_ACTION_CLOSE) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYSLOG_ACTION_CLOSE) == (0), "SYSLOG_ACTION_CLOSE != 0"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SYSLOG_ACTION_CLOSE 0 +#endif +#if defined(SYSLOG_ACTION_OPEN) || (defined(HAVE_DECL_SYSLOG_ACTION_OPEN) && HAVE_DECL_SYSLOG_ACTION_OPEN) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYSLOG_ACTION_OPEN) == (1), "SYSLOG_ACTION_OPEN != 1"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SYSLOG_ACTION_OPEN 1 +#endif +#if defined(SYSLOG_ACTION_READ) || (defined(HAVE_DECL_SYSLOG_ACTION_READ) && HAVE_DECL_SYSLOG_ACTION_READ) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYSLOG_ACTION_READ) == (2), "SYSLOG_ACTION_READ != 2"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SYSLOG_ACTION_READ 2 +#endif +#if defined(SYSLOG_ACTION_READ_ALL) || (defined(HAVE_DECL_SYSLOG_ACTION_READ_ALL) && HAVE_DECL_SYSLOG_ACTION_READ_ALL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYSLOG_ACTION_READ_ALL) == (3), "SYSLOG_ACTION_READ_ALL != 3"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SYSLOG_ACTION_READ_ALL 3 +#endif +#if defined(SYSLOG_ACTION_READ_CLEAR) || (defined(HAVE_DECL_SYSLOG_ACTION_READ_CLEAR) && HAVE_DECL_SYSLOG_ACTION_READ_CLEAR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYSLOG_ACTION_READ_CLEAR) == (4), "SYSLOG_ACTION_READ_CLEAR != 4"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SYSLOG_ACTION_READ_CLEAR 4 +#endif +#if defined(SYSLOG_ACTION_CLEAR) || (defined(HAVE_DECL_SYSLOG_ACTION_CLEAR) && HAVE_DECL_SYSLOG_ACTION_CLEAR) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYSLOG_ACTION_CLEAR) == (5), "SYSLOG_ACTION_CLEAR != 5"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SYSLOG_ACTION_CLEAR 5 +#endif +#if defined(SYSLOG_ACTION_CONSOLE_OFF) || (defined(HAVE_DECL_SYSLOG_ACTION_CONSOLE_OFF) && HAVE_DECL_SYSLOG_ACTION_CONSOLE_OFF) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYSLOG_ACTION_CONSOLE_OFF) == (6), "SYSLOG_ACTION_CONSOLE_OFF != 6"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SYSLOG_ACTION_CONSOLE_OFF 6 +#endif +#if defined(SYSLOG_ACTION_CONSOLE_ON) || (defined(HAVE_DECL_SYSLOG_ACTION_CONSOLE_ON) && HAVE_DECL_SYSLOG_ACTION_CONSOLE_ON) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYSLOG_ACTION_CONSOLE_ON) == (7), "SYSLOG_ACTION_CONSOLE_ON != 7"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE #else +# define SYSLOG_ACTION_CONSOLE_ON 7 +#endif +#if defined(SYSLOG_ACTION_CONSOLE_LEVEL) || (defined(HAVE_DECL_SYSLOG_ACTION_CONSOLE_LEVEL) && HAVE_DECL_SYSLOG_ACTION_CONSOLE_LEVEL) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYSLOG_ACTION_CONSOLE_LEVEL) == (8), "SYSLOG_ACTION_CONSOLE_LEVEL != 8"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SYSLOG_ACTION_CONSOLE_LEVEL 8 +#endif +#if defined(SYSLOG_ACTION_SIZE_UNREAD) || (defined(HAVE_DECL_SYSLOG_ACTION_SIZE_UNREAD) && HAVE_DECL_SYSLOG_ACTION_SIZE_UNREAD) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYSLOG_ACTION_SIZE_UNREAD) == (9), "SYSLOG_ACTION_SIZE_UNREAD != 9"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SYSLOG_ACTION_SIZE_UNREAD 9 +#endif +#if defined(SYSLOG_ACTION_SIZE_BUFFER) || (defined(HAVE_DECL_SYSLOG_ACTION_SIZE_BUFFER) && HAVE_DECL_SYSLOG_ACTION_SIZE_BUFFER) +DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE +static_assert((SYSLOG_ACTION_SIZE_BUFFER) == (10), "SYSLOG_ACTION_SIZE_BUFFER != 10"); +DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE +#else +# define SYSLOG_ACTION_SIZE_BUFFER 10 +#endif + +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat syslog_action_type in mpers mode + +# else static const struct xlat syslog_action_type[] = { - XLAT(SYSLOG_ACTION_CLOSE), - XLAT(SYSLOG_ACTION_OPEN), - XLAT(SYSLOG_ACTION_READ), - XLAT(SYSLOG_ACTION_READ_ALL), - XLAT(SYSLOG_ACTION_READ_CLEAR), - XLAT(SYSLOG_ACTION_CLEAR), - XLAT(SYSLOG_ACTION_CONSOLE_OFF), - XLAT(SYSLOG_ACTION_CONSOLE_ON), - XLAT(SYSLOG_ACTION_CONSOLE_LEVEL), - XLAT(SYSLOG_ACTION_SIZE_UNREAD), - XLAT(SYSLOG_ACTION_SIZE_BUFFER), + [SYSLOG_ACTION_CLOSE] = XLAT(SYSLOG_ACTION_CLOSE), + [SYSLOG_ACTION_OPEN] = XLAT(SYSLOG_ACTION_OPEN), + [SYSLOG_ACTION_READ] = XLAT(SYSLOG_ACTION_READ), + [SYSLOG_ACTION_READ_ALL] = XLAT(SYSLOG_ACTION_READ_ALL), + [SYSLOG_ACTION_READ_CLEAR] = XLAT(SYSLOG_ACTION_READ_CLEAR), + [SYSLOG_ACTION_CLEAR] = XLAT(SYSLOG_ACTION_CLEAR), + [SYSLOG_ACTION_CONSOLE_OFF] = XLAT(SYSLOG_ACTION_CONSOLE_OFF), + [SYSLOG_ACTION_CONSOLE_ON] = XLAT(SYSLOG_ACTION_CONSOLE_ON), + [SYSLOG_ACTION_CONSOLE_LEVEL] = XLAT(SYSLOG_ACTION_CONSOLE_LEVEL), + [SYSLOG_ACTION_SIZE_UNREAD] = XLAT(SYSLOG_ACTION_SIZE_UNREAD), + [SYSLOG_ACTION_SIZE_BUFFER] = XLAT(SYSLOG_ACTION_SIZE_BUFFER), XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/syslog_action_type.in b/xlat/syslog_action_type.in index 6e0109a8..e2f78e76 100644 --- a/xlat/syslog_action_type.in +++ b/xlat/syslog_action_type.in @@ -1,12 +1,12 @@ -#unconditional -SYSLOG_ACTION_CLOSE -SYSLOG_ACTION_OPEN -SYSLOG_ACTION_READ -SYSLOG_ACTION_READ_ALL -SYSLOG_ACTION_READ_CLEAR -SYSLOG_ACTION_CLEAR -SYSLOG_ACTION_CONSOLE_OFF -SYSLOG_ACTION_CONSOLE_ON -SYSLOG_ACTION_CONSOLE_LEVEL -SYSLOG_ACTION_SIZE_UNREAD -SYSLOG_ACTION_SIZE_BUFFER +#value_indexed +SYSLOG_ACTION_CLOSE 0 +SYSLOG_ACTION_OPEN 1 +SYSLOG_ACTION_READ 2 +SYSLOG_ACTION_READ_ALL 3 +SYSLOG_ACTION_READ_CLEAR 4 +SYSLOG_ACTION_CLEAR 5 +SYSLOG_ACTION_CONSOLE_OFF 6 +SYSLOG_ACTION_CONSOLE_ON 7 +SYSLOG_ACTION_CONSOLE_LEVEL 8 +SYSLOG_ACTION_SIZE_UNREAD 9 +SYSLOG_ACTION_SIZE_BUFFER 10 diff --git a/xlat/sysmips_operations.h b/xlat/sysmips_operations.h index 107caa2b..6e3b00c0 100644 --- a/xlat/sysmips_operations.h +++ b/xlat/sysmips_operations.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/sysmips_operations.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat sysmips_operations in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat sysmips_operations in mpers mode + +# else static const struct xlat sysmips_operations[] = { @@ -26,4 +32,6 @@ const struct xlat sysmips_operations[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/tcflsh_options.h b/xlat/tcflsh_options.h index 5d67bb73..97302639 100644 --- a/xlat/tcflsh_options.h +++ b/xlat/tcflsh_options.h @@ -1,10 +1,16 @@ /* Generated by ./xlat/gen.sh from ./xlat/tcflsh_options.in; do not edit. */ -#ifdef IN_MPERS +#include "gcc_compat.h" +#include "static_assert.h" -# error static const struct xlat tcflsh_options in mpers mode -#else +#ifndef XLAT_MACROS_ONLY + +# ifdef IN_MPERS + +# error static const struct xlat tcflsh_options in mpers mode + +# else static const struct xlat tcflsh_options[] = { @@ -20,4 +26,6 @@ const struct xlat tcflsh_options[] = { XLAT_END }; -#endif /* !IN_MPERS */ +# endif /* !IN_MPERS */ + +#endif /* !XLAT_MACROS_ONLY */ diff --git a/xlat/tcp_state_flags.h b/xlat/tcp_state_flags.h new file mode 100644 index 00000000..3f0cb8c6 --- /dev/null +++ b/xlat/tcp_state_flags.h @@ -0,0 +1,54 @@ +/* Generated by ./xlat/gen.sh from ./xlat/tcp_state_flags.in; do not edit. */ + +#include "gcc_compat.h" +#include "static_assert.h" + + +#ifndef XLAT_MACROS_ONLY + +# ifndef IN_MPERS + +const struct xlat tcp_state_flags[] = { + +#if defined(TCP_ESTABLISHED) || (defined(HAVE_DECL_TCP_ESTABLISHED) && HAVE_DECL_TCP_ESTABLISHED) + XLAT_PAIR(1ULL< -;; All rights reserved. -;; -;; Redistribution and use in source and binary forms, with or without -;; modification, are permitted provided that the following conditions -;; are met: -;; 1. Redistributions of source code must retain the above copyright -;; notice, this list of conditions and the following disclaimer. -;; 2. Redistributions in binary form must reproduce the above copyright -;; notice, this list of conditions and the following disclaimer in the -;; documentation and/or other materials provided with the distribution. -;; 3. The name of the author may not be used to endorse or promote products -;; derived from this software without specific prior written permission. -;; -;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -;; IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -;; OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -;; IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -;; INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -;; NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -;; THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -;; Description: Automate the construction of strace xlat tables. - -;; Usage: Put point and mark around a set of definitions in a header -;; file. Then grab them with C-c G. Switch to the strace source file -;; and build the xlat table with C-c B. Then type the name of the table. - -(global-set-key "\C-cG" 'grab-xlate) -(global-set-key "\C-cB" 'build-xlate) - -(defvar xlate-list nil - "See grab-xlate and build-xlate.") - -(defun grab-xlate (beg end) - "Grab all of the defined names in the region and save them in xlate-list." - (interactive "r") - (save-excursion - (setq xlate-list nil) - (goto-char beg) - (beginning-of-line) - (while (< (point) end) - (and (looking-at "^#[ \t]*define[ \t]+\\([A-Za-z0-9_]+\\)[ \t]+") - (setq xlate-list (cons (buffer-substring (match-beginning 1) - (match-end 1)) - xlate-list))) - (forward-line))) - (and (fboundp 'deactivate-mark) - (deactivate-mark)) - (setq xlate-list (nreverse xlate-list))) - -(defun build-xlate (&optional list) - "Build and insert an strace xlat table based on the last grab." - (interactive) - (or list - (setq list xlate-list)) - (beginning-of-line) - (save-excursion - (insert "static struct xlat ?[] = {\n") - (while list - (insert "\t{ " (car list) ",\n") - (backward-char) - (move-to-column 24 'force) - (end-of-line) - (insert "\"" (car list) "\"") - (move-to-column 40 'force) - (end-of-line) - (insert "},") - (forward-line) - (setq list (cdr list))) - (insert " { 0, NULL },\n") - (insert "};\n") - (insert "\n")) - (search-forward "?") - (delete-backward-char 1)) diff --git a/xmalloc.c b/xmalloc.c index 11589270..af075e76 100644 --- a/xmalloc.c +++ b/xmalloc.c @@ -1,35 +1,25 @@ /* * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2019 The strace developers. * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * SPDX-License-Identifier: LGPL-2.1-or-later */ -#include "defs.h" +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif + +#include +#include + +#include "error_prints.h" +#include "xmalloc.h" -void die_out_of_memory(void) +static void +die_out_of_memory(void) { - static bool recursed = false; + static int recursed; if (recursed) exit(1); @@ -38,7 +28,8 @@ void die_out_of_memory(void) error_msg_and_die("Out of memory"); } -void *xmalloc(size_t size) +void * +xmalloc(size_t size) { void *p = malloc(size); @@ -48,7 +39,8 @@ void *xmalloc(size_t size) return p; } -void *xcalloc(size_t nmemb, size_t size) +void * +xcalloc(size_t nmemb, size_t size) { void *p = calloc(nmemb, size); @@ -60,7 +52,8 @@ void *xcalloc(size_t nmemb, size_t size) #define HALF_SIZE_T (((size_t) 1) << (sizeof(size_t) * 4)) -void *xreallocarray(void *ptr, size_t nmemb, size_t size) +void * +xreallocarray(void *ptr, size_t nmemb, size_t size) { size_t bytes = nmemb * size; @@ -76,8 +69,34 @@ void *xreallocarray(void *ptr, size_t nmemb, size_t size) return p; } -char *xstrdup(const char *str) +void * +xgrowarray(void *const ptr, size_t *const nmemb, const size_t memb_size) +{ + /* this is the same value as glibc DEFAULT_MXFAST */ + enum { DEFAULT_ALLOC_SIZE = 64 * SIZEOF_LONG / 4 }; + + size_t grow_memb; + + if (ptr == NULL) + grow_memb = *nmemb ? 0 : + (DEFAULT_ALLOC_SIZE + memb_size - 1) / memb_size; + else + grow_memb = (*nmemb >> 1) + 1; + + if ((*nmemb + grow_memb) < *nmemb) + die_out_of_memory(); + + *nmemb += grow_memb; + + return xreallocarray(ptr, *nmemb, memb_size); +} + +char * +xstrdup(const char *str) { + if (!str) + return NULL; + char *p = strdup(str); if (!p) @@ -85,3 +104,28 @@ char *xstrdup(const char *str) return p; } + +char * +xstrndup(const char *str, size_t n) +{ + char *p; + + if (!str) + return NULL; + +#ifdef HAVE_STRNDUP + p = strndup(str, n); +#else + p = xmalloc(n + 1); +#endif + + if (!p) + die_out_of_memory(); + +#ifndef HAVE_STRNDUP + strncpy(p, str, n); + p[n] = '\0'; +#endif + + return p; +} diff --git a/xmalloc.h b/xmalloc.h new file mode 100644 index 00000000..6212ac3b --- /dev/null +++ b/xmalloc.h @@ -0,0 +1,73 @@ +/* + * This file contains wrapper functions working with memory allocations, + * they just terminate the program in case of memory allocation failure. + * These functions can be used by various binaries included in the strace + * package. + * + * Copyright (c) 2001-2019 The strace developers. + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_XMALLOC_H +# define STRACE_XMALLOC_H + +# include +# include "gcc_compat.h" + +# define xcalloc strace_calloc +# define xmalloc strace_malloc + +/** Allocate memory, die if the allocation has failed. */ +void *xmalloc(size_t size) ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((1)); + +/** + * Allocate an array and zero it out (similar to calloc), die if the allocation + * has failed or if the product of nmemb and size is too big. + */ +void *xcalloc(size_t nmemb, size_t size) + ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((1, 2)); + +/** Wrapper for xcalloc(1, size) with xmalloc-like interface. */ +ATTRIBUTE_MALLOC ATTRIBUTE_ALLOC_SIZE((1)) +static inline void * +xzalloc(size_t size) +{ + return xcalloc(1, size); +} + +/** + * Reallocate memory for the array, die if the allocation has failed or + * if the product of nmemb and size is too big. + */ +void *xreallocarray(void *ptr, size_t nmemb, size_t size) + ATTRIBUTE_ALLOC_SIZE((2, 3)); + +/** + * Utility function for the simplification of managing various dynamic arrays. + * Knows better how to resize arrays. Dies if there's no enough memory. + * + * @param[in] ptr Pointer to the array to be resized. If ptr is NULL, + * new array is allocated. + * @param[in, out] nmemb Pointer to the current member count. If ptr is + * NULL, it specifies number of members in the newly + * created array. If ptr is NULL and nmemb is 0, + * number of members in the new array is decided by + * the function. Member count is updated by the + * function to the new value. + * @param[in] memb_size Size of array member in bytes. + * @return Pointer to the (re)allocated array. + */ +void *xgrowarray(void *ptr, size_t *nmemb, size_t memb_size); + +/* + * Note that the following two functions return NULL when NULL is specified + * and not when allocation is failed, since, as the "x" prefix implies, + * the allocation failure leads to program termination, so we may re-purpose + * this return value and simplify the idiom "str ? xstrdup(str) : NULL". + */ +char *xstrdup(const char *str) ATTRIBUTE_MALLOC; +char *xstrndup(const char *str, size_t n) ATTRIBUTE_MALLOC; + +#endif /* !STRACE_XMALLOC_H */ diff --git a/xstring.h b/xstring.h new file mode 100644 index 00000000..affaf791 --- /dev/null +++ b/xstring.h @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2018 Eugene Syromyatnikov + * All rights reserved. + * + * SPDX-License-Identifier: LGPL-2.1-or-later + */ + +#ifndef STRACE_XSTRING_H +# define STRACE_XSTRING_H + +# include +# include + +# include "error_prints.h" +# include "gcc_compat.h" + +/** + * Print to static buffer and die on (really unexpected) errors and overflows. + * Shouldn't be used directly; please refer to helper macros xsnprintf and + * xsprint instead. + * + * @param str String buffer to print into. + * @param size Size of the string buffer in bytes. + * @param func Function name from which this function is called. + * @param argstr Stringified arguments (including format argument). + * @param format Format string. + * @param ... Format arguments. + * @return Number of characters printed, excluding terminating null byte + * (the same as s(n)printf). + */ +static inline int ATTRIBUTE_FORMAT((printf, 5, 6)) +xsnprintf_(char *str, size_t size, const char *func, const char *argstr, + const char *format, ...) +{ + int ret; + va_list ap; + + va_start(ap, format); + ret = vsnprintf(str, size, format, ap); + va_end(ap); + + if (ret < 0 || (unsigned int) ret >= size) + error_msg_and_die("%s: got unexpected return value %d for " + "snprintf(buf, %zu, %s)", + func, ret, size, argstr); + + return ret; +} + +/** + * snprintf that dies on (really unexpected) errors and overflows. + * + * @param str_ String buffer to print into. + * @param size_ Size of the string buffer in bytes. + * @param fmt_ Format string. + * @param ... Format arguments. + */ +# define xsnprintf(str_, size_, fmt_, ...) \ + xsnprintf_((str_), (size_), __func__, #fmt_ ", " #__VA_ARGS__, \ + (fmt_), __VA_ARGS__) + +/** + * Print to a character array buffer and die on (really unexpected) errors and + * overflows. Buffer size is obtained with sizeof(). + * + * @param str_ Character array buffer to print into. + * @param fmt_ Format string. + * @param ... Format arguments. + */ +# define xsprintf(str_, fmt_, ...) \ + xsnprintf((str_), sizeof(str_) + MUST_BE_ARRAY(str_), (fmt_), \ + __VA_ARGS__) + +static inline size_t +get_pos_diff_(char *str, size_t size, char *pos, const char *func, + const char *call) +{ + if ((str + size) < str) + error_msg_and_die("%s: string size overflow (%p+%zu) in %s", + func, str, size, call); + + if (pos > (str + size)) + error_msg_and_die("%s: got position (%p) beyond string " + "(%p+%zu) in %s", + func, pos, str, size, call); + + if (pos < str) + error_msg_and_die("%s: got position %p before string %p in %s", + func, pos, str, call); + + return pos - str; +} + +/** + * Helper function for constructing string in a character array by appending + * new formatted parts. Returns new position. Fails on error or buffer + * overflow, in line with the rest of x* functions. Obtains buffer size via + * sizeof(str_). + * + * @param str_ Character array buffer to print into. + * @param pos_ Current position. + * @param fmt_ Format string. + * @param ... Format arguments. + * @return New position. + */ +# define xappendstr(str_, pos_, fmt_, ...) \ + (xsnprintf((pos_), sizeof(str_) + MUST_BE_ARRAY(str_) - \ + get_pos_diff_((str_), sizeof(str_), (pos_), __func__, \ + "xappendstr(" #str_ ", " #pos_ ", " #fmt_ ", " \ + #__VA_ARGS__ ")"), \ + (fmt_), ##__VA_ARGS__) + (pos_)) + +#endif /* !STRACE_XSTRING_H */ -- 2.34.1